From c73e448e494db409141286234086797b5f62c57c Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 17 May 2023 04:18:51 -0300 Subject: [PATCH 01/38] add mysql connector cpp --- .c3i/authorized_users.yml | 1156 ++++++ .c3i/conan_v2_ready_references.yml | 636 +++ .c3i/config_v1.yml | 193 + .c3i/config_v2.yml | 136 + .c3i/reviewers.yml | 86 + .c3i/v1.jenkins | 6 + .c3i/v2.jenkins | 6 + .editorconfig | 21 + .gitattributes | 9 + .github/ISSUE_TEMPLATE/center_conan_io.yml | 18 + .github/ISSUE_TEMPLATE/package_bug.yml | 87 + .github/ISSUE_TEMPLATE/package_request.yml | 42 + .../package_upstream_update.yml | 33 + .github/ISSUE_TEMPLATE/question.yml | 18 + .github/ISSUE_TEMPLATE/service.yml | 18 + .github/PULL_REQUEST_TEMPLATE.md | 10 + .github/actions/alert-community/action.yml | 31 + .github/actions/pr_changed_files/action.yml | 51 + .github/stale.yml | 61 + .github/workflows/alert-community.yml | 427 ++ .github/workflows/hooks-warnings.yml | 84 + .github/workflows/linter-conan-v2.yml | 124 + .github/workflows/linter-yaml.yml | 118 + .github/workflows/markdown-links.yml | 18 + .github/workflows/mlc_config.json | 13 + .github/workflows/on-push-do-doco.yml | 30 + .gitignore | 44 +- CONTRIBUTING.md | 56 + README.md | 84 + assets/JFrogConanCenter.png | Bin 0 -> 66567 bytes docs/CONTRIBUTOR_LICENSE_AGREEMENT.md | 23 + docs/README.md | 24 + docs/adding_packages/README.md | 133 + docs/adding_packages/build_and_package.md | 112 + docs/adding_packages/conandata_yml_format.md | 243 ++ docs/adding_packages/conanfile_attributes.md | 193 + docs/adding_packages/dependencies.md | 195 + docs/adding_packages/folders_and_files.md | 192 + docs/adding_packages/sources_and_patches.md | 199 + docs/adding_packages/test_packages.md | 111 + docs/bump_version.md | 48 + docs/changelog.md | 761 ++++ docs/code_of_conduct.md | 17 + docs/community_resources.md | 37 + docs/consuming_recipes.md | 70 + docs/developing_recipes_locally.md | 278 ++ docs/error_knowledge_base.md | 503 +++ docs/faqs.md | 466 +++ docs/labels.md | 96 + docs/linters.md | 190 + docs/package_templates/README.md | 27 + .../autotools_package/all/conandata.yml | 23 + .../autotools_package/all/conanfile.py | 178 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 19 + .../autotools_package/config.yml | 6 + .../cmake_package/all/conandata.yml | 23 + .../cmake_package/all/conanfile.py | 169 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + .../cmake_package/config.yml | 6 + .../header_only/all/conandata.yml | 23 + .../header_only/all/conanfile.py | 122 + .../all/test_package/CMakeLists.txt | 11 + .../header_only/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 19 + docs/package_templates/header_only/config.yml | 6 + .../meson_package/all/conandata.yml | 23 + .../meson_package/all/conanfile.py | 155 + .../all/test_package/conanfile.py | 33 + .../all/test_package/meson.build | 5 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/conanfile.py | 23 + .../meson_package/config.yml | 6 + .../msbuild_package/all/conandata.yml | 23 + .../msbuild_package/all/conanfile.py | 134 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 19 + .../msbuild_package/config.yml | 6 + .../prebuilt_tool_package/all/conandata.yml | 28 + .../prebuilt_tool_package/all/conanfile.py | 64 + .../all/test_package/conanfile.py | 15 + .../all/test_v1_package/conanfile.py | 13 + .../prebuilt_tool_package/config.yml | 6 + docs/review_process.md | 140 + .../supported_platforms_and_configurations.md | 87 + docs/v2_linter.md | 71 + docs/v2_migration.md | 208 + docs/v2_roadmap.md | 150 + linter/__init__.py | 0 linter/check_import_conanfile.py | 28 + linter/check_import_errors.py | 77 + linter/check_import_tools.py | 30 + linter/check_layout_src_folder.py | 44 + linter/check_package_name.py | 52 + linter/check_version_attribute.py | 33 + linter/conandata_yaml_linter.py | 125 + linter/conanv2_transition.py | 24 + linter/config_yaml_linter.py | 37 + linter/pylintrc_recipe | 30 + linter/pylintrc_testpackage | 32 + linter/recipe_linter.json | 43 + linter/transform_conanfile.py | 74 + linter/transform_imports.py | 46 + linter/yaml_linting.py | 9 + linter/yamllint_matcher.json | 22 + linter/yamllint_rules.yml | 26 + recipes/7zip/19.00/conandata.yml | 4 + recipes/7zip/19.00/conanfile.py | 101 + recipes/7zip/19.00/test_package/conanfile.py | 9 + recipes/7zip/config.yml | 3 + recipes/aaf/all/conandata.yml | 27 + recipes/aaf/all/conanfile.py | 93 + .../1.2.0-001-simpler-cmakelists.patch | 36 + ....2.0-002-link-core-with-find-library.patch | 51 + .../1.2.0-003-remove-register-keyword.patch | 46 + .../all/patches/1.2.0-004-remove-expat.patch | 49 + .../patches/1.2.0-005-remove-libjpeg.patch | 46 + .../all/patches/1.2.0-006-link-libuuid.patch | 25 + .../1.2.0-007-support-all-generators.patch | 31 + recipes/aaf/all/test_package/CMakeLists.txt | 7 + recipes/aaf/all/test_package/conanfile.py | 26 + recipes/aaf/all/test_package/test_package.cpp | 12 + .../aaf/all/test_v1_package/CMakeLists.txt | 8 + recipes/aaf/all/test_v1_package/conanfile.py | 17 + recipes/aaf/config.yml | 3 + recipes/aaplus/all/conandata.yml | 7 + recipes/aaplus/all/conanfile.py | 108 + .../aaplus/all/patches/0001-fix-cmake.patch | 117 + .../aaplus/all/test_package/CMakeLists.txt | 8 + recipes/aaplus/all/test_package/conanfile.py | 26 + .../aaplus/all/test_package/test_package.cpp | 8 + .../aaplus/all/test_v1_package/CMakeLists.txt | 8 + .../aaplus/all/test_v1_package/conanfile.py | 17 + recipes/aaplus/config.yml | 3 + recipes/abseil/all/abi_trick/abi.h.in | 5 + .../abseil/all/abi_trick/conan_abi_test.cmake | 44 + recipes/abseil/all/conandata.yml | 95 + recipes/abseil/all/conanfile.py | 267 ++ .../all/patches/0001-cmake-install.patch | 14 + .../0002-missing-numeric_limits.h.patch | 11 + .../all/patches/0003-absl-string-libm.patch | 15 + .../patches/0004-cpp-standard-20200225.patch | 15 + .../patches/0004-cpp-standard-20200923.patch | 15 + .../patches/0004-cpp-standard-20210324.patch | 15 + ...05-has-unique-object-representations.patch | 11 + .../abseil/all/test_package/CMakeLists.txt | 52 + recipes/abseil/all/test_package/conanfile.py | 33 + .../abseil/all/test_package/test_package.cpp | 56 + .../abseil/all/test_v1_package/CMakeLists.txt | 8 + .../abseil/all/test_v1_package/conanfile.py | 20 + recipes/abseil/config.yml | 21 + recipes/absent/all/conandata.yml | 16 + recipes/absent/all/conanfile.py | 86 + .../absent/all/test_package/CMakeLists.txt | 11 + recipes/absent/all/test_package/conanfile.py | 17 + .../absent/all/test_package/test_package.cpp | 13 + recipes/absent/config.yml | 11 + recipes/acado/all/CMakeLists.txt | 11 + recipes/acado/all/cmake/qpoases.cmake | 17 + recipes/acado/all/conandata.yml | 10 + recipes/acado/all/conanfile.py | 130 + .../patches/0001-binding-temp-object.patch | 19 + .../0002-read-template-path-from-env.patch | 25 + recipes/acado/all/test_package/CMakeLists.txt | 39 + recipes/acado/all/test_package/codegen.cpp | 72 + recipes/acado/all/test_package/conanfile.py | 19 + .../acado/all/test_package/test_package.cpp | 24 + recipes/acado/config.yml | 3 + .../accellera-uvm-systemc/all/conandata.yml | 4 + .../accellera-uvm-systemc/all/conanfile.py | 90 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.cpp | 12 + recipes/accellera-uvm-systemc/config.yml | 3 + recipes/access_private/all/conandata.yml | 4 + recipes/access_private/all/conanfile.py | 48 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/access_private/config.yml | 3 + recipes/acl/all/conandata.yml | 4 + recipes/acl/all/conanfile.py | 74 + recipes/acl/all/test_package/CMakeLists.txt | 7 + recipes/acl/all/test_package/conanfile.py | 26 + recipes/acl/all/test_package/test_package.c | 95 + .../acl/all/test_v1_package/CMakeLists.txt | 8 + recipes/acl/all/test_v1_package/conanfile.py | 17 + recipes/acl/config.yml | 3 + recipes/ada/all/conandata.yml | 16 + recipes/ada/all/conanfile.py | 99 + recipes/ada/all/test_package/CMakeLists.txt | 9 + recipes/ada/all/test_package/conanfile.py | 25 + recipes/ada/all/test_package/test_package.cpp | 14 + .../ada/all/test_v1_package/CMakeLists.txt | 8 + recipes/ada/all/test_v1_package/conanfile.py | 18 + recipes/ada/config.yml | 11 + recipes/ade/all/conandata.yml | 7 + recipes/ade/all/conanfile.py | 87 + recipes/ade/all/test_package/CMakeLists.txt | 8 + recipes/ade/all/test_package/conanfile.py | 26 + recipes/ade/all/test_package/test_package.cpp | 5 + .../ade/all/test_v1_package/CMakeLists.txt | 8 + recipes/ade/all/test_v1_package/conanfile.py | 17 + recipes/ade/config.yml | 5 + recipes/aeron/all/conandata.yml | 13 + recipes/aeron/all/conanfile.py | 145 + recipes/aeron/all/test_package/CMakeLists.txt | 8 + recipes/aeron/all/test_package/conanfile.py | 26 + .../aeron/all/test_package/test_package.cpp | 11 + .../aeron/all/test_v1_package/CMakeLists.txt | 8 + .../aeron/all/test_v1_package/conanfile.py | 17 + recipes/aeron/config.yml | 9 + recipes/ags/all/conandata.yml | 10 + recipes/ags/all/conanfile.py | 89 + recipes/ags/all/test_package/CMakeLists.txt | 9 + recipes/ags/all/test_package/conanfile.py | 16 + recipes/ags/all/test_package/test_package.cpp | 9 + recipes/ags/config.yml | 7 + recipes/alac/all/CMakeLists.txt | 34 + recipes/alac/all/conandata.yml | 4 + recipes/alac/all/conanfile.py | 71 + recipes/alac/all/test_package/CMakeLists.txt | 7 + recipes/alac/all/test_package/conanfile.py | 26 + .../alac/all/test_package/test_package.cpp | 6 + .../alac/all/test_v1_package/CMakeLists.txt | 10 + recipes/alac/all/test_v1_package/conanfile.py | 17 + recipes/alac/config.yml | 3 + recipes/alembic/all/conandata.yml | 12 + recipes/alembic/all/conanfile.py | 97 + .../all/patches/1.8.2-0001-fix-cmake.patch | 57 + .../alembic/all/test_package/CMakeLists.txt | 8 + recipes/alembic/all/test_package/conanfile.py | 26 + .../alembic/all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../alembic/all/test_v1_package/conanfile.py | 17 + recipes/alembic/config.yml | 5 + recipes/alpaca/all/conandata.yml | 4 + recipes/alpaca/all/conanfile.py | 69 + .../alpaca/all/test_package/CMakeLists.txt | 8 + recipes/alpaca/all/test_package/conanfile.py | 26 + .../alpaca/all/test_package/test_package.cpp | 35 + .../alpaca/all/test_v1_package/CMakeLists.txt | 9 + .../alpaca/all/test_v1_package/conanfile.py | 18 + recipes/alpaca/config.yml | 3 + recipes/amgcl/all/conandata.yml | 10 + recipes/amgcl/all/conanfile.py | 52 + recipes/amgcl/all/test_package/CMakeLists.txt | 8 + recipes/amgcl/all/test_package/conanfile.py | 26 + .../amgcl/all/test_package/test_package.cpp | 9 + .../amgcl/all/test_v1_package/CMakeLists.txt | 8 + .../amgcl/all/test_v1_package/conanfile.py | 17 + recipes/amgcl/config.yml | 7 + recipes/amqp-cpp/all/conandata.yml | 47 + recipes/amqp-cpp/all/conanfile.py | 146 + ...01-cmake-openssl-install-directories.patch | 23 + ...01-cmake-openssl-install-directories.patch | 25 + .../amqp-cpp/all/test_package/CMakeLists.txt | 12 + .../amqp-cpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../amqp-cpp/all/test_v1_package/conanfile.py | 17 + recipes/amqp-cpp/config.yml | 19 + .../andreasbuhr-cppcoro/all/CMakeLists.txt | 7 + recipes/andreasbuhr-cppcoro/all/conandata.yml | 4 + recipes/andreasbuhr-cppcoro/all/conanfile.py | 112 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 32 + recipes/andreasbuhr-cppcoro/config.yml | 3 + recipes/android-ndk/all/cmake-wrapper | 39 + recipes/android-ndk/all/cmake-wrapper.cmd | 35 + recipes/android-ndk/all/conandata.yml | 144 + recipes/android-ndk/all/conanfile.py | 402 ++ .../all/test_package/CMakeLists.txt | 4 + .../android-ndk/all/test_package/conanfile.py | 33 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 32 + recipes/android-ndk/config.yml | 23 + recipes/angelscript/all/conandata.yml | 28 + recipes/angelscript/all/conanfile.py | 102 + ...0-0001-fix-compatibility-apple-clang.patch | 30 + ...1-0001-fix-compatibility-apple-clang.patch | 18 + .../2.36.0-0001-missing-include-stdint.patch | 10 + .../all/test_package/CMakeLists.txt | 7 + .../angelscript/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/angelscript/config.yml | 7 + recipes/antlr4-cppruntime/all/conandata.yml | 42 + recipes/antlr4-cppruntime/all/conanfile.py | 177 + .../all/patches/0001-update-cmakelist.patch | 13 + .../all/patches/0002-update-FlatHashSet.patch | 15 + .../all/patches/0003-update-FlatHashMap.patch | 15 + .../0004-update-DropLibuuid-4.10.x-1.patch | 13 + .../0004-update-DropLibuuid-4.10.x-2.patch | 14 + .../0004-update-DropLibuuid-4.9.3-1.patch | 13 + .../0004-update-DropLibuuid-4.9.3-2.patch | 14 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/antlr4-cppruntime/config.yml | 9 + recipes/any-lite/all/conandata.yml | 10 + recipes/any-lite/all/conanfile.py | 52 + .../any-lite/all/test_package/CMakeLists.txt | 7 + .../any-lite/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 10 + .../any-lite/all/test_v1_package/conanfile.py | 17 + recipes/any-lite/config.yml | 7 + recipes/anyrpc/all/conandata.yml | 17 + recipes/anyrpc/all/conanfile.py | 110 + .../all/patches/0001-fix-asan-1.0.2.patch | 28 + .../0002-fix-shared-library-1.0.2.patch | 54 + .../patches/0003-use-conan-libs-1.0.2.patch | 44 + .../anyrpc/all/test_package/CMakeLists.txt | 9 + recipes/anyrpc/all/test_package/conanfile.py | 26 + .../anyrpc/all/test_package/test_anyrpc.cpp | 17 + .../anyrpc/all/test_v1_package/CMakeLists.txt | 6 + .../anyrpc/all/test_v1_package/conanfile.py | 18 + recipes/anyrpc/config.yml | 3 + recipes/approvaltests.cpp/all/conandata.yml | 41 + recipes/approvaltests.cpp/all/conanfile.py | 91 + .../all/test_package/CMakeLists.txt | 42 + .../all/test_package/conanfile.py | 33 + ...osttest.Module.Suite.TestCase.approved.txt | 1 + .../all/test_package/test_boosttest.cpp | 22 + .../test_catch.Package.approved.txt | 1 + .../all/test_package/test_catch.cpp | 12 + .../test_cpputest.Group.Package.approved.txt | 1 + .../all/test_package/test_cpputest.cpp | 17 + .../test_doctest.Package.approved.txt | 1 + .../all/test_package/test_doctest.cpp | 12 + .../test_gtest.Package.GTest.approved.txt | 1 + .../all/test_package/test_gtest.cpp | 12 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 27 + recipes/approvaltests.cpp/config.yml | 17 + recipes/apr-util/all/conandata.yml | 10 + recipes/apr-util/all/conanfile.py | 221 ++ .../apr-util/all/patches/0001-fix-cmake.patch | 89 + .../patches/0002-apu-config-prefix-env.patch | 22 + .../apr-util/all/test_package/CMakeLists.txt | 7 + .../apr-util/all/test_package/conanfile.py | 26 + .../apr-util/all/test_package/test_package.c | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../apr-util/all/test_v1_package/conanfile.py | 17 + recipes/apr-util/config.yml | 3 + recipes/apr/all/conandata.yml | 13 + recipes/apr/all/conanfile.py | 155 + .../0001-cmake-build-only-shared-static.patch | 33 + .../patches/0002-apr-config-prefix-env.patch | 11 + .../0003-cmake-gen_test_char-use-target.patch | 16 + .../all/patches/0004-autotools-mingw.patch | 160 + .../apr/all/patches/0005-clang12-apple.patch | 12 + .../all/patches/0006-sys_siglist-fix.patch | 13 + .../patches/0007-cmake-minimum-required.patch | 13 + recipes/apr/all/test_package/CMakeLists.txt | 7 + recipes/apr/all/test_package/conanfile.py | 26 + recipes/apr/all/test_package/test_package.c | 8 + .../apr/all/test_v1_package/CMakeLists.txt | 8 + recipes/apr/all/test_v1_package/conanfile.py | 17 + recipes/apr/config.yml | 3 + recipes/apriltag/all/conandata.yml | 20 + recipes/apriltag/all/conanfile.py | 91 + .../all/patches/3.1.1-0001-fix-cmake.patch | 67 + .../patches/3.1.1-0002-windows-nominmax.patch | 20 + .../all/patches/3.1.2-0001-fix-cmake.patch | 83 + .../all/patches/3.1.4-0001-fix-cmake.patch | 69 + .../apriltag/all/test_package/CMakeLists.txt | 7 + .../apriltag/all/test_package/conanfile.py | 26 + .../apriltag/all/test_package/test_package.c | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../apriltag/all/test_v1_package/conanfile.py | 17 + recipes/apriltag/config.yml | 7 + recipes/aravis/all/conandata.yml | 7 + recipes/aravis/all/conanfile.py | 166 + .../all/patches/0.8.19-gst-shared-lib.patch | 11 + .../aravis/all/test_package/CMakeLists.txt | 7 + recipes/aravis/all/test_package/conanfile.py | 26 + .../aravis/all/test_package/test_package.c | 16 + .../aravis/all/test_v1_package/CMakeLists.txt | 8 + .../aravis/all/test_v1_package/conanfile.py | 17 + recipes/aravis/config.yml | 3 + recipes/archicad-apidevkit/all/conandata.yml | 28 + recipes/archicad-apidevkit/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 44 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_gsroot.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 20 + recipes/archicad-apidevkit/config.yml | 5 + recipes/arcus/all/conandata.yml | 10 + recipes/arcus/all/conanfile.py | 114 + .../arcus/all/patches/0001-fix-cmake.patch | 62 + .../0002-protobuf-compat-ge-3.18.patch | 22 + recipes/arcus/all/test_package/CMakeLists.txt | 8 + recipes/arcus/all/test_package/conanfile.py | 26 + .../arcus/all/test_package/test_package.cpp | 6 + .../arcus/all/test_v1_package/CMakeLists.txt | 8 + .../arcus/all/test_v1_package/conanfile.py | 17 + recipes/arcus/config.yml | 3 + recipes/arduinojson/all/conandata.yml | 25 + recipes/arduinojson/all/conanfile.py | 80 + .../all/test_package/CMakeLists.txt | 10 + .../arduinojson/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 23 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/arduinojson/config.yml | 17 + recipes/arg_router/all/conandata.yml | 4 + recipes/arg_router/all/conanfile.py | 57 + .../all/test_package/CMakeLists.txt | 9 + .../arg_router/all/test_package/conanfile.py | 27 + recipes/arg_router/all/test_package/main.cpp | 61 + .../all/test_v1_package/CMakeLists.txt | 7 + .../all/test_v1_package/conanfile.py | 23 + recipes/arg_router/config.yml | 4 + recipes/argh/all/conandata.yml | 7 + recipes/argh/all/conanfile.py | 73 + recipes/argh/all/test_package/CMakeLists.txt | 8 + recipes/argh/all/test_package/conanfile.py | 25 + .../argh/all/test_package/test_package.cpp | 13 + .../argh/all/test_v1_package/CMakeLists.txt | 11 + recipes/argh/all/test_v1_package/conanfile.py | 16 + recipes/argh/config.yml | 5 + recipes/argon2/all/conandata.yml | 7 + recipes/argon2/all/conanfile.py | 166 + .../all/patches/0001-makefile-no-march.patch | 34 + .../argon2/all/test_package/CMakeLists.txt | 7 + recipes/argon2/all/test_package/conanfile.py | 26 + .../argon2/all/test_package/test_package.c | 23 + .../argon2/all/test_v1_package/CMakeLists.txt | 8 + .../argon2/all/test_v1_package/conanfile.py | 17 + recipes/argon2/config.yml | 3 + recipes/argparse/all/conandata.yml | 31 + recipes/argparse/all/conanfile.py | 84 + .../0001-v2.1-add-missing-include.patch | 12 + .../0001-v2.2-add-missing-include.patch | 12 + .../0001-v2.3-add-missing-include.patch | 12 + .../argparse/all/test_package/CMakeLists.txt | 8 + .../argparse/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 25 + .../all/test_v1_package/CMakeLists.txt | 11 + .../argparse/all/test_v1_package/conanfile.py | 18 + recipes/argparse/config.yml | 15 + recipes/args-parser/all/conandata.yml | 25 + recipes/args-parser/all/conanfile.py | 67 + .../all/test_package/CMakeLists.txt | 8 + .../args-parser/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/args-parser/config.yml | 17 + recipes/argtable2/all/conandata.yml | 9 + recipes/argtable2/all/conanfile.py | 108 + .../patches/2.13-0001-enable-mingw-dll.patch | 11 + .../2.13-0002-msvc-nmake-honor-profile.patch | 14 + .../all/patches/2.13-0003-armv8-build.patch | 12 + .../argtable2/all/test_package/CMakeLists.txt | 7 + .../argtable2/all/test_package/conanfile.py | 26 + .../argtable2/all/test_package/test_package.c | 120 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/argtable2/config.yml | 3 + recipes/argtable3/all/conandata.yml | 22 + recipes/argtable3/all/conanfile.py | 110 + .../all/patches/3.1.5-0001-cmake-fixes.patch | 59 + .../all/patches/3.2.0-0001-cmake-fixes.patch | 59 + .../argtable3/all/test_package/CMakeLists.txt | 13 + .../argtable3/all/test_package/conanfile.py | 25 + .../argtable3/all/test_package/test_package.c | 55 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/argtable3/config.yml | 9 + recipes/armadillo/all/conandata.yml | 24 + recipes/armadillo/all/conanfile.py | 314 ++ ...01-Guard-dependency-discovery-10.7.x.patch | 148 + ...02-Guard-dependency-discovery-11.4.x.patch | 155 + .../armadillo/all/test_package/CMakeLists.txt | 8 + .../armadillo/all/test_package/conanfile.py | 30 + .../all/test_package/src/example.cpp | 207 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/armadillo/config.yml | 7 + recipes/arrow/all/conandata.yml | 67 + recipes/arrow/all/conanfile.py | 686 ++++ .../patches/1.0.0-0003-fix-shared-msvc.patch | 13 + .../1.0.0-0005-fix-make12-namespace.patch | 22 + .../all/patches/1.0.0-0006-fix-cmake.patch | 333 ++ .../patches/2.0.0-0003-fix-shared-msvc.patch | 13 + .../patches/2.0.0-0005-gandiva-engine.patch | 13 + .../all/patches/2.0.0-0008-fix-cmake.patch | 273 ++ .../patches/7.0.0-0006-install-utils.patch | 17 + .../all/patches/7.0.0-0007-fix-cmake.patch | 347 ++ .../patches/8.0.0-0005-install-utils.patch | 43 + .../all/patches/8.0.0-0006-fix-cmake.patch | 425 ++ recipes/arrow/all/test_package/CMakeLists.txt | 12 + recipes/arrow/all/test_package/conanfile.py | 27 + .../arrow/all/test_package/test_package.cpp | 190 + .../arrow/all/test_v1_package/CMakeLists.txt | 9 + .../arrow/all/test_v1_package/conanfile.py | 18 + recipes/arrow/config.yml | 17 + recipes/arsenalgear/all/CMakeLists.txt | 45 + recipes/arsenalgear/all/conandata.yml | 10 + recipes/arsenalgear/all/conanfile.py | 108 + .../all/test_package/CMakeLists.txt | 9 + .../arsenalgear/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/arsenalgear/config.yml | 7 + recipes/artery-font-format/all/conandata.yml | 7 + recipes/artery-font-format/all/conanfile.py | 27 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.arfont | Bin 0 -> 66580 bytes .../all/test_package/test_package.cpp | 32 + recipes/artery-font-format/config.yml | 5 + recipes/aruco/3.x.x/conandata.yml | 4 + recipes/aruco/3.x.x/conanfile.py | 75 + .../aruco/3.x.x/test_package/CMakeLists.txt | 8 + recipes/aruco/3.x.x/test_package/conanfile.py | 26 + .../aruco/3.x.x/test_package/test_package.cpp | 19 + .../3.x.x/test_v1_package/CMakeLists.txt | 8 + .../aruco/3.x.x/test_v1_package/conanfile.py | 17 + recipes/aruco/config.yml | 3 + recipes/asio-grpc/all/conandata.yml | 19 + recipes/asio-grpc/all/conanfile.py | 123 + .../asio-grpc/all/test_package/CMakeLists.txt | 31 + .../asio-grpc/all/test_package/conanfile.py | 25 + recipes/asio-grpc/all/test_package/test.proto | 11 + .../all/test_package/test_package.cpp | 36 + .../all/test_v1_package/CMakeLists.txt | 34 + .../all/test_v1_package/conanfile.py | 19 + recipes/asio-grpc/config.yml | 13 + recipes/asio/all/conandata.yml | 67 + recipes/asio/all/conanfile.py | 47 + recipes/asio/all/test_package/CMakeLists.txt | 8 + recipes/asio/all/test_package/conanfile.py | 25 + .../asio/all/test_package/test_package.cpp | 7 + .../asio/all/test_v1_package/CMakeLists.txt | 11 + recipes/asio/all/test_v1_package/conanfile.py | 17 + recipes/asio/config.yml | 45 + recipes/asmjit/all/conandata.yml | 13 + recipes/asmjit/all/conanfile.py | 80 + .../asmjit/all/test_package/CMakeLists.txt | 8 + recipes/asmjit/all/test_package/conanfile.py | 26 + .../asmjit/all/test_package/test_package.cpp | 27 + .../asmjit/all/test_v1_package/CMakeLists.txt | 8 + .../asmjit/all/test_v1_package/conanfile.py | 17 + recipes/asmjit/config.yml | 9 + recipes/asn1c/all/conandata.yml | 4 + recipes/asn1c/all/conanfile.py | 82 + recipes/asn1c/all/test_package/CMakeLists.txt | 48 + recipes/asn1c/all/test_package/MyModule.asn1 | 15 + recipes/asn1c/all/test_package/conanfile.py | 27 + recipes/asn1c/all/test_package/test_package.c | 73 + recipes/asn1c/config.yml | 3 + recipes/assimp/5.x/conandata.yml | 31 + recipes/assimp/5.x/conanfile.py | 283 ++ .../patches/0001-unvendor-deps-5.0.x.patch | 278 ++ .../0002-fix-all-exporters-disabled.patch | 253 ++ .../patches/0003-unvendor-deps-5.1.x.patch | 354 ++ .../patches/0004-unvendor-deps-5.1.6.patch | 330 ++ .../assimp/5.x/patches/0005-fix-unzip.patch | 13 + .../patches/0006-unvendor-deps-5.2.x.patch | 330 ++ .../assimp/5.x/test_package/CMakeLists.txt | 11 + recipes/assimp/5.x/test_package/box.obj | 30 + recipes/assimp/5.x/test_package/conanfile.py | 31 + .../assimp/5.x/test_package/test_package.c | 26 + .../assimp/5.x/test_package/test_package.cpp | 25 + .../assimp/5.x/test_v1_package/CMakeLists.txt | 8 + .../assimp/5.x/test_v1_package/conanfile.py | 22 + recipes/assimp/config.yml | 11 + recipes/astc-codec/all/conandata.yml | 9 + recipes/astc-codec/all/conanfile.py | 70 + .../all/patches/0001-fix-cmake.patch | 76 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/atlas_small_4x4.astc | Bin 0 -> 65552 bytes .../astc-codec/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 30 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/astc-codec/config.yml | 3 + .../astro-informatics-so3/all/CMakeLists.txt | 7 + .../astro-informatics-so3/all/conandata.yml | 4 + .../astro-informatics-so3/all/conanfile.py | 71 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/example.c | 10 + recipes/astro-informatics-so3/config.yml | 3 + recipes/async_simple/all/conandata.yml | 5 + recipes/async_simple/all/conanfile.py | 94 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 15 + .../all/test_v1_package/conanfile.py | 19 + recipes/async_simple/config.yml | 4 + recipes/asyncplusplus/all/conandata.yml | 4 + recipes/asyncplusplus/all/conanfile.py | 97 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 44 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/asyncplusplus/config.yml | 3 + recipes/at-spi2-atk/all/conandata.yml | 4 + recipes/at-spi2-atk/all/conanfile.py | 98 + .../all/test_package/CMakeLists.txt | 9 + .../at-spi2-atk/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 51 + recipes/at-spi2-atk/config.yml | 3 + recipes/at-spi2-core/all/conandata.yml | 23 + recipes/at-spi2-core/all/conanfile.py | 110 + ...6a4c4491eea57d7b713bb4440f541584204b.patch | 37 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 9 + recipes/at-spi2-core/config.yml | 23 + recipes/at-spi2-core/new/conandata.yml | 27 + recipes/at-spi2-core/new/conanfile.py | 128 + recipes/at-spi2-core/new/patches/93.patch | 521 +++ .../new/test_package/CMakeLists.txt | 9 + .../new/test_package/conanfile.py | 17 + .../new/test_package/test_package.c | 9 + recipes/atk/all/conandata.yml | 10 + recipes/atk/all/conanfile.py | 127 + .../define_dllmain_only_when_shared.patch | 19 + recipes/atk/all/test_package/CMakeLists.txt | 7 + recipes/atk/all/test_package/conanfile.py | 26 + recipes/atk/all/test_package/test_package.c | 10 + .../atk/all/test_v1_package/CMakeLists.txt | 8 + recipes/atk/all/test_v1_package/conanfile.py | 17 + recipes/atk/config.yml | 5 + recipes/audiofile/all/conandata.yml | 10 + recipes/audiofile/all/conanfile.py | 47 + .../audiofile/all/test_package/CMakeLists.txt | 8 + .../audiofile/all/test_package/conanfile.py | 26 + recipes/audiofile/all/test_package/sine.wav | Bin 0 -> 24044 bytes .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/audiofile/config.yml | 7 + recipes/autoconf-archive/all/conandata.yml | 7 + recipes/autoconf-archive/all/conanfile.py | 77 + .../all/test_package/Makefile.am | 2 + .../all/test_package/conanfile.py | 54 + .../all/test_package/configure.ac | 15 + .../all/test_package/test_package.c | 6 + .../all/test_v1_package/Makefile.am | 2 + .../all/test_v1_package/conanfile.py | 52 + .../all/test_v1_package/configure.ac | 15 + .../all/test_v1_package/test_package.c | 6 + recipes/autoconf-archive/config.yml | 5 + recipes/autoconf/all/conandata.yml | 15 + recipes/autoconf/all/conanfile.py | 139 + .../2.71-0001-relocatable-autoconf.patch | 275 ++ .../2.71-0002-no-perl-path-in-shebang.patch | 48 + .../2.71-0003-disable-man-regeneration.patch | 23 + recipes/autoconf/all/test_package/Makefile.in | 14 + .../autoconf/all/test_package/conanfile.py | 51 + recipes/autoconf/all/test_package/config.h.in | 23 + .../autoconf/all/test_package/configure.ac | 25 + .../all/test_package/test_package_c.c | 8 + .../all/test_package/test_package_cpp.cpp | 17 + .../autoconf/all/test_v1_package/conanfile.py | 43 + recipes/autoconf/config.yml | 3 + recipes/automake/all/conandata.yml | 54 + recipes/automake/all/conanfile.py | 128 + ...01-help2man-no-discard-stderr-1.16.2.patch | 13 + ...01-help2man-no-discard-stderr-1.16.3.patch | 13 + ...01-help2man-no-discard-stderr-1.16.4.patch | 13 + ...01-help2man-no-discard-stderr-1.16.5.patch | 13 + .../0002-no-perl-path-in-shebang-1.16.2.patch | 46 + .../0002-no-perl-path-in-shebang-1.16.3.patch | 46 + .../0002-no-perl-path-in-shebang-1.16.4.patch | 46 + .../0002-no-perl-path-in-shebang-1.16.5.patch | 46 + .../0003-relocatable-automake-1.16.2.patch | 106 + .../0003-relocatable-automake-1.16.3.patch | 106 + .../0003-relocatable-automake-1.16.4.patch | 106 + .../0003-relocatable-automake-1.16.5.patch | 107 + recipes/automake/all/test_package/Makefile.am | 4 + .../automake/all/test_package/conanfile.py | 95 + .../automake/all/test_package/configure.ac | 28 + recipes/automake/all/test_package/extra.m4 | 14 + .../automake/all/test_package/src/Makefile.am | 4 + .../all/test_package/src/configure.ac | 28 + .../automake/all/test_package/src/extra.m4 | 14 + .../all/test_package/src/test_package.cpp | 9 + .../all/test_package/src/test_package_1.c | 7 + .../all/test_package/test_package.cpp | 9 + .../all/test_package/test_package_1.c | 7 + .../automake/all/test_v1_package/Makefile.am | 4 + .../automake/all/test_v1_package/conanfile.py | 89 + .../automake/all/test_v1_package/configure.ac | 28 + recipes/automake/all/test_v1_package/extra.m4 | 14 + .../all/test_v1_package/test_package.cpp | 9 + .../all/test_v1_package/test_package_1.c | 7 + recipes/automake/config.yml | 9 + recipes/avahi/all/conandata.yml | 4 + recipes/avahi/all/conanfile.py | 130 + recipes/avahi/all/test_package/CMakeLists.txt | 7 + recipes/avahi/all/test_package/conanfile.py | 26 + recipes/avahi/all/test_package/test_package.c | 18 + .../avahi/all/test_v1_package/CMakeLists.txt | 8 + .../avahi/all/test_v1_package/conanfile.py | 17 + recipes/avahi/config.yml | 3 + recipes/avcpp/all/conandata.yml | 17 + recipes/avcpp/all/conanfile.py | 117 + .../avcpp/all/patches/2.1.0-fix-ffmpeg.patch | 46 + .../all/patches/cci.20220301-fix-ffmpeg.patch | 46 + recipes/avcpp/all/test_package/CMakeLists.txt | 12 + recipes/avcpp/all/test_package/conanfile.py | 26 + .../avcpp/all/test_package/test_package.cpp | 9 + .../avcpp/all/test_v1_package/CMakeLists.txt | 8 + .../avcpp/all/test_v1_package/conanfile.py | 16 + recipes/avcpp/config.yml | 5 + recipes/avir/all/conandata.yml | 4 + recipes/avir/all/conanfile.py | 40 + recipes/avir/all/test_package/CMakeLists.txt | 7 + recipes/avir/all/test_package/conanfile.py | 25 + .../avir/all/test_package/test_package.cpp | 8 + .../avir/all/test_v1_package/CMakeLists.txt | 10 + recipes/avir/all/test_v1_package/conanfile.py | 17 + recipes/avir/config.yml | 3 + recipes/aws-c-auth/all/conandata.yml | 16 + recipes/aws-c-auth/all/conanfile.py | 100 + .../all/test_package/CMakeLists.txt | 7 + .../aws-c-auth/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 + recipes/aws-c-auth/config.yml | 11 + recipes/aws-c-cal/all/conandata.yml | 52 + recipes/aws-c-cal/all/conanfile.py | 128 + ...01-use-openssl-cmake-imported-target.patch | 19 + .../0002-apple-corefoundation-0.5.11.patch | 26 + .../0002-apple-corefoundation-0.5.13.patch | 26 + .../aws-c-cal/all/test_package/CMakeLists.txt | 7 + .../aws-c-cal/all/test_package/conanfile.py | 31 + .../aws-c-cal/all/test_package/test_package.c | 19 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 22 + recipes/aws-c-cal/config.yml | 13 + recipes/aws-c-common/all/conandata.yml | 56 + recipes/aws-c-common/all/conanfile.py | 126 + .../all/patches/0001-disable-fPIC.patch | 13 + .../patches/0002-no-warnings-as-errors.patch | 20 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/aws-c-common/config.yml | 35 + recipes/aws-c-compression/all/conandata.yml | 10 + recipes/aws-c-compression/all/conanfile.py | 95 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/aws-c-compression/config.yml | 7 + recipes/aws-c-event-stream/all/conandata.yml | 20 + recipes/aws-c-event-stream/all/conanfile.py | 100 + .../all/patches/0001-disable-tests-bin.patch | 25 + .../patches/0002-use-PROJECT_SOURCE_DIR.patch | 61 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 35 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/aws-c-event-stream/config.yml | 11 + recipes/aws-c-http/all/conandata.yml | 16 + recipes/aws-c-http/all/conanfile.py | 96 + .../all/test_package/CMakeLists.txt | 7 + .../aws-c-http/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/aws-c-http/config.yml | 11 + recipes/aws-c-io/all/conandata.yml | 19 + recipes/aws-c-io/all/conanfile.py | 104 + .../aws-c-io/all/test_package/CMakeLists.txt | 7 + .../aws-c-io/all/test_package/conanfile.py | 25 + .../aws-c-io/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 10 + .../aws-c-io/all/test_v1_package/conanfile.py | 18 + recipes/aws-c-io/config.yml | 13 + recipes/aws-c-mqtt/all/conandata.yml | 13 + recipes/aws-c-mqtt/all/conanfile.py | 100 + .../all/test_package/CMakeLists.txt | 7 + .../aws-c-mqtt/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 + recipes/aws-c-mqtt/config.yml | 9 + recipes/aws-c-s3/all/conandata.yml | 16 + recipes/aws-c-s3/all/conanfile.py | 103 + .../aws-c-s3/all/test_package/CMakeLists.txt | 7 + .../aws-c-s3/all/test_package/conanfile.py | 26 + .../aws-c-s3/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 10 + .../aws-c-s3/all/test_v1_package/conanfile.py | 17 + recipes/aws-c-s3/config.yml | 11 + recipes/aws-c-sdkutils/all/conandata.yml | 10 + recipes/aws-c-sdkutils/all/conanfile.py | 95 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/aws-c-sdkutils/config.yml | 7 + recipes/aws-cdi-sdk/all/CMakeLists.txt | 10 + recipes/aws-cdi-sdk/all/conandata.yml | 8 + recipes/aws-cdi-sdk/all/conanfile.py | 144 + .../all/patches/001-Makefile.patch | 100 + .../all/test_package/CMakeLists.txt | 10 + .../aws-cdi-sdk/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 16 + recipes/aws-cdi-sdk/config.yml | 3 + recipes/aws-checksums/all/conandata.yml | 18 + recipes/aws-checksums/all/conanfile.py | 102 + .../patches/0001-use-PROJECT_SOURCE_DIR.patch | 41 + .../0002-disable-overriding-fPIC.patch | 15 + .../patches/0003-disable-building-tests.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 39 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/aws-checksums/config.yml | 9 + recipes/aws-crt-cpp/all/conandata.yml | 26 + recipes/aws-crt-cpp/all/conanfile.py | 116 + .../all/patches/0.17.12-fix-cast-error.patch | 13 + .../all/patches/0.17.23-fix-cast-error.patch | 13 + .../all/test_package/CMakeLists.txt | 8 + .../aws-crt-cpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/aws-crt-cpp/config.yml | 9 + recipes/aws-kvs-pic/all/CMakeLists.txt | 7 + recipes/aws-kvs-pic/all/conandata.yml | 8 + recipes/aws-kvs-pic/all/conanfile.py | 76 + .../patches/0001-do-not-enforce-fpic.patch | 11 + .../all/test_package/CMakeLists.txt | 11 + .../aws-kvs-pic/all/test_package/conanfile.py | 19 + .../all/test_package/test_package.c | 16 + recipes/aws-kvs-pic/config.yml | 3 + recipes/aws-libfabric/all/conandata.yml | 4 + recipes/aws-libfabric/all/conanfile.py | 116 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 11 + recipes/aws-libfabric/config.yml | 3 + recipes/aws-sdk-cpp/all/CMakeLists.txt | 11 + recipes/aws-sdk-cpp/all/conandata.yml | 38 + recipes/aws-sdk-cpp/all/conanfile.py | 553 +++ .../1.8.130-0001-disable-sort-links.patch | 13 + ...chive-directory-to-library-directory.patch | 17 + ...le-cmake-install-rpath-use-link-path.patch | 13 + ...30-0004-improve-pulseaudio-detection.patch | 30 + .../1.8.130-0005-aws-plugin-conf.patch | 44 + .../all/patches/1.8.130-0006-issue-1816.patch | 20 + .../1.9.100-0001-disable-sort-links.patch | 13 + .../1.9.100-0002-aws-plugin-conf.patch | 44 + .../all/patches/1.9.100-0003-issue-1816.patch | 20 + .../all/patches/1.9.234-0001-issue-1816.patch | 21 + .../1.9.234-0002-disable-sort-links.patch | 18 + .../all/test_package/CMakeLists.txt | 13 + .../aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp | 16 + .../aws-sdk-cpp-plugin/AwsSdkCppPlugin.h | 7 + .../aws-sdk-cpp-plugin/CMakeLists.txt | 15 + .../aws-sdk-cpp/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 14 + recipes/aws-sdk-cpp/config.yml | 7 + recipes/azure-storage-cpp/all/CMakeLists.txt | 7 + recipes/azure-storage-cpp/all/conandata.yml | 8 + recipes/azure-storage-cpp/all/conanfile.py | 123 + .../all/patches/0001-cmake-fixes.patch | 72 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.cpp | 12 + recipes/azure-storage-cpp/config.yml | 3 + recipes/b2/config.yml | 49 + recipes/b2/portable/conandata.yml | 61 + recipes/b2/portable/conanfile.py | 180 + recipes/b2/portable/test_package/conanfile.py | 13 + .../b2/portable/test_v1_package/conanfile.py | 8 + recipes/b2/standard/conandata.yml | 13 + recipes/b2/standard/conanfile.py | 101 + recipes/b2/standard/test_package/conanfile.py | 9 + recipes/b64/all/CMakeLists.txt | 23 + recipes/b64/all/conandata.yml | 20 + recipes/b64/all/conanfile.py | 65 + .../b64/all/patches/0001-windows-elseif.patch | 13 + recipes/b64/all/patches/0002-extern-c.patch | 117 + .../b64/all/patches/0003-stdlib-exit.patch | 57 + .../b64/all/patches/0004-include-order.patch | 22 + recipes/b64/all/test_package/CMakeLists.txt | 8 + recipes/b64/all/test_package/conanfile.py | 26 + recipes/b64/all/test_package/test_package.cpp | 26 + .../b64/all/test_v1_package/CMakeLists.txt | 8 + recipes/b64/all/test_v1_package/conanfile.py | 18 + recipes/b64/config.yml | 3 + recipes/backport-cpp/all/conandata.yml | 4 + recipes/backport-cpp/all/conanfile.py | 46 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/backport-cpp/config.yml | 3 + recipes/backward-cpp/all/conandata.yml | 25 + recipes/backward-cpp/all/conanfile.py | 140 + ...d53b54f08f056dc9366c8d5c24c5d749cfce.patch | 28 + ...d640ec48ada93045f8c46fc65f823490819b.patch | 35 + .../all/patches/backward-cpp-1.4.patch | 95 + ...7d6733d1ab6b79994f4acbc1ad86ba950d23.patch | 79 + ...ackward-cpp-1.5-add-iterator-include.patch | 10 + .../all/patches/backward-cpp-1.5-mingw.patch | 16 + .../all/patches/backward-cpp-1.5.patch | 73 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 45 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/backward-cpp/config.yml | 7 + recipes/bacnet-stack/all/conandata.yml | 10 + recipes/bacnet-stack/all/conanfile.py | 74 + .../all/patches/0001-fix-dll-install.patch | 10 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/bacnet-stack/config.yml | 3 + recipes/baical-p7/all/conandata.yml | 9 + recipes/baical-p7/all/conanfile.py | 72 + .../all/patches/0001-fix-cmake.patch | 86 + .../baical-p7/all/test_package/CMakeLists.txt | 7 + .../baical-p7/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/baical-p7/config.yml | 3 + recipes/bandit/all/conandata.yml | 9 + recipes/bandit/all/conanfile.py | 46 + .../patches/0001-change-snowhouse-path.patch | 13 + .../bandit/all/test_package/CMakeLists.txt | 8 + recipes/bandit/all/test_package/conanfile.py | 30 + .../bandit/all/test_package/test_package.cpp | 24 + .../bandit/all/test_v1_package/CMakeLists.txt | 12 + .../bandit/all/test_v1_package/conanfile.py | 19 + recipes/bandit/config.yml | 3 + recipes/base64/all/conandata.yml | 19 + recipes/base64/all/conanfile.py | 125 + .../base64/all/patches/0.4.0-0001-make.patch | 12 + .../base64/all/patches/0.4.0-0002-cmake.patch | 388 ++ .../base64/all/patches/0.5.0-0001-make.patch | 14 + .../base64/all/test_package/CMakeLists.txt | 8 + recipes/base64/all/test_package/conanfile.py | 26 + .../base64/all/test_package/test_package.c | 20 + .../base64/all/test_v1_package/CMakeLists.txt | 11 + .../base64/all/test_v1_package/conanfile.py | 18 + recipes/base64/config.yml | 5 + recipes/bazel/all/conandata.yml | 10 + recipes/bazel/all/conanfile.py | 53 + recipes/bazel/all/test_package/conanfile.py | 9 + recipes/bazel/config.yml | 3 + recipes/bdwgc/all/conandata.yml | 17 + recipes/bdwgc/all/conanfile.py | 169 + .../all/patches/update-cmake-8_0_4.patch | 841 ++++ .../all/patches/update-cmake-8_0_6.patch | 828 ++++ .../all/patches/update-cmake-8_2_2.patch | 15 + recipes/bdwgc/all/test_package/CMakeLists.txt | 7 + recipes/bdwgc/all/test_package/conanfile.py | 25 + recipes/bdwgc/all/test_package/test_package.c | 21 + .../bdwgc/all/test_v1_package/CMakeLists.txt | 10 + .../bdwgc/all/test_v1_package/conanfile.py | 17 + recipes/bdwgc/config.yml | 7 + recipes/bear/all/conandata.yml | 7 + recipes/bear/all/conanfile.py | 111 + ...12540948cd5e0ee5f966b5cc383bc0c0e5fe9.diff | 17 + recipes/bear/all/test_package/conanfile.py | 13 + recipes/bear/all/test_v1_package/conanfile.py | 11 + recipes/bear/config.yml | 3 + recipes/beauty/all/conandata.yml | 7 + recipes/beauty/all/conanfile.py | 109 + .../beauty/all/patches/0001-fix-cmake.patch | 18 + .../beauty/all/test_package/CMakeLists.txt | 8 + recipes/beauty/all/test_package/conanfile.py | 26 + .../beauty/all/test_package/test_package.cpp | 7 + .../beauty/all/test_v1_package/CMakeLists.txt | 8 + .../beauty/all/test_v1_package/conanfile.py | 17 + recipes/beauty/config.yml | 3 + recipes/behaviortree.cpp/all/conandata.yml | 28 + recipes/behaviortree.cpp/all/conanfile.py | 165 + .../all/patches/3.5.6-0001-remove-fpic.patch | 12 + .../all/patches/3.5.6-0002-find-zmq.patch | 68 + .../all/patches/3.5.6-0003-no-werror.patch | 17 + .../patches/3.5.6-0004-win-sigaction.patch | 22 + .../all/patches/3.5.6-0005-stdc-format.patch | 12 + .../all/patches/3.7.0-0001-remove-fpic.patch | 13 + .../all/patches/3.7.0-0002-find-zmq.patch | 68 + .../all/patches/3.7.0-0003-no-werror.patch | 13 + .../all/patches/4.0.1-0001-remove-fpic.patch | 13 + .../all/patches/4.0.1-0002-find-zmq.patch | 57 + .../all/patches/4.0.1-0003-no-werror.patch | 13 + .../all/test_package/CMakeLists.txt | 16 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 106 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/behaviortree.cpp/config.yml | 7 + recipes/benchmark/all/conandata.yml | 22 + recipes/benchmark/all/conanfile.py | 111 + .../benchmark/all/test_package/CMakeLists.txt | 7 + .../benchmark/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/benchmark/config.yml | 15 + recipes/bertrand/all/conandata.yml | 16 + recipes/bertrand/all/conanfile.py | 83 + .../bertrand/all/test_package/CMakeLists.txt | 8 + .../bertrand/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 11 + .../bertrand/all/test_v1_package/conanfile.py | 17 + recipes/bertrand/config.yml | 11 + recipes/bigint/all/CMakeLists.txt | 35 + recipes/bigint/all/conandata.yml | 7 + recipes/bigint/all/conanfile.py | 69 + .../patches/0001-deprecation-wanings.patch | 35 + .../bigint/all/test_package/CMakeLists.txt | 7 + recipes/bigint/all/test_package/conanfile.py | 26 + .../bigint/all/test_package/test_package.cpp | 9 + .../bigint/all/test_v1_package/CMakeLists.txt | 8 + .../bigint/all/test_v1_package/conanfile.py | 17 + recipes/bigint/config.yml | 3 + recipes/bimg/all/conandata.yml | 4 + recipes/bimg/all/conanfile.py | 246 ++ recipes/bimg/all/test_package/CMakeLists.txt | 9 + recipes/bimg/all/test_package/conanfile.py | 29 + .../bimg/all/test_package/test_package.cpp | 26 + .../bimg/all/test_v1_package/CMakeLists.txt | 9 + recipes/bimg/all/test_v1_package/conanfile.py | 17 + recipes/bimg/config.yml | 3 + recipes/binutils/all/conandata.yml | 12 + recipes/binutils/all/conanfile.py | 529 +++ .../all/patches/2.38-0001-no-texinfo.patch | 20 + .../binutils/all/test_package/conanfile.py | 32 + .../all/test_v1_package/Linux-armv7.s | 23 + .../all/test_v1_package/Linux-armv8.s | 19 + .../all/test_v1_package/Linux-riscv.s | 19 + .../binutils/all/test_v1_package/Linux-x86.s | 20 + .../all/test_v1_package/Linux-x86_64.s | 20 + .../all/test_v1_package/Windows-kernel32.def | 7 + .../all/test_v1_package/Windows-x86.s | 23 + .../all/test_v1_package/Windows-x86_64.s | 26 + .../binutils/all/test_v1_package/conanfile.py | 113 + recipes/binutils/config.yml | 5 + recipes/bison/all/conandata.yml | 63 + recipes/bison/all/conanfile.py | 171 + ...e_pipe-uses-O_TEXT-not-O_BINARY-mode.patch | 29 + ...e_pipe-uses-O_TEXT-not-O_BINARY-mode.patch | 29 + ...in-binary-mode-MS-ftell-bug-ks-68337.patch | 26 + ...in-binary-mode-MS-ftell-bug-ks-68337.patch | 26 + ...in-binary-mode-MS-ftell-bug-ks-68337.patch | 26 + .../all/patches/0003-3.5.3-msvc-changes.patch | 261 ++ .../all/patches/0004-3.5.3-relocatable.patch | 753 ++++ ...b-limit-search-range-of-_setmaxstdio.patch | 38 + ...-dont-link-bison-against-libreadline.patch | 14 + recipes/bison/all/test_package/CMakeLists.txt | 20 + recipes/bison/all/test_package/conanfile.py | 38 + recipes/bison/all/test_package/mc_parser.yy | 42 + .../bison/all/test_v1_package/CMakeLists.txt | 8 + .../bison/all/test_v1_package/conanfile.py | 31 + recipes/bison/config.yml | 9 + recipes/bit-lite/all/conandata.yml | 4 + recipes/bit-lite/all/conanfile.py | 52 + .../bit-lite/all/test_package/CMakeLists.txt | 7 + .../bit-lite/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 10 + .../bit-lite/all/test_v1_package/conanfile.py | 17 + recipes/bit-lite/config.yml | 3 + recipes/bitflags/all/conandata.yml | 4 + recipes/bitflags/all/conanfile.py | 65 + .../bitflags/all/test_package/CMakeLists.txt | 8 + .../bitflags/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../bitflags/all/test_v1_package/conanfile.py | 17 + recipes/bitflags/config.yml | 3 + recipes/bitmagic/all/conandata.yml | 25 + recipes/bitmagic/all/conanfile.py | 64 + .../bitmagic/all/test_package/CMakeLists.txt | 8 + .../bitmagic/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 11 + .../bitmagic/all/test_v1_package/conanfile.py | 17 + recipes/bitmagic/config.yml | 17 + recipes/bitserializer/all/conandata.yml | 10 + recipes/bitserializer/all/conanfile.py | 221 ++ .../all/test_package/CMakeLists.txt | 41 + .../all/test_package/conanfile.py | 36 + .../all/test_package/test_package.cpp | 81 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 29 + recipes/bitserializer/config.yml | 7 + recipes/bitsery/all/conandata.yml | 16 + recipes/bitsery/all/conanfile.py | 58 + .../bitsery/all/test_package/CMakeLists.txt | 8 + recipes/bitsery/all/test_package/conanfile.py | 25 + .../bitsery/all/test_package/test_package.cpp | 46 + .../all/test_v1_package/CMakeLists.txt | 11 + .../bitsery/all/test_v1_package/conanfile.py | 17 + recipes/bitsery/config.yml | 11 + recipes/blaze/all/conandata.yml | 7 + recipes/blaze/all/conanfile.py | 51 + recipes/blaze/all/test_package/CMakeLists.txt | 8 + recipes/blaze/all/test_package/conanfile.py | 25 + .../blaze/all/test_package/test_package.cpp | 26 + .../blaze/all/test_v1_package/CMakeLists.txt | 11 + .../blaze/all/test_v1_package/conanfile.py | 17 + recipes/blaze/config.yml | 5 + recipes/blend2d/all/conandata.yml | 27 + recipes/blend2d/all/conanfile.py | 95 + .../0.0.17-0001-disable-embed-asmjit.patch | 19 + ...0.18-0002-fix-gcc12-compilationerror.patch | 39 + .../0.8-0001-disable-embed-asmjit.patch | 27 + .../blend2d/all/test_package/CMakeLists.txt | 8 + recipes/blend2d/all/test_package/conanfile.py | 26 + .../blend2d/all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../blend2d/all/test_v1_package/conanfile.py | 17 + recipes/blend2d/config.yml | 7 + recipes/bliss/all/conandata.yml | 8 + recipes/bliss/all/conanfile.py | 93 + .../bliss/all/patches/0001-fix-cmake.patch | 52 + ...-assert-non-existent-member-variable.patch | 10 + recipes/bliss/all/test_package/CMakeLists.txt | 8 + recipes/bliss/all/test_package/conanfile.py | 28 + recipes/bliss/all/test_package/graph.cnf | 8 + .../bliss/all/test_package/test_package.cpp | 22 + .../bliss/all/test_v1_package/CMakeLists.txt | 8 + .../bliss/all/test_v1_package/conanfile.py | 19 + recipes/bliss/config.yml | 3 + recipes/boolean-lite/all/conandata.yml | 4 + recipes/boolean-lite/all/conanfile.py | 51 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 23 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/boolean-lite/config.yml | 3 + recipes/boolinq/all/conandata.yml | 13 + recipes/boolinq/all/conanfile.py | 45 + .../boolinq/all/test_package/CMakeLists.txt | 8 + recipes/boolinq/all/test_package/conanfile.py | 25 + .../boolinq/all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 11 + .../boolinq/all/test_v1_package/conanfile.py | 17 + recipes/boolinq/config.yml | 9 + recipes/boost-ext-ut/all/conandata.yml | 12 + recipes/boost-ext-ut/all/conanfile.py | 120 + .../patches/1.1.9_cmake_project_version.patch | 13 + .../boost-ext-ut/all/patches/license.patch | 29 + .../all/test_package/CMakeLists.txt | 13 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 16 + .../all/test_v1_package/conanfile.py | 19 + recipes/boost-ext-ut/config.yml | 5 + recipes/boost-leaf/all/conandata.yml | 4 + recipes/boost-leaf/all/conanfile.py | 90 + .../all/test_package/CMakeLists.txt | 9 + .../boost-leaf/all/test_package/conanfile.py | 26 + recipes/boost-leaf/all/test_package/main.cpp | 64 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 18 + recipes/boost-leaf/config.yml | 3 + recipes/boost/all/conandata.yml | 325 ++ recipes/boost/all/conanfile.py | 1768 +++++++++ .../all/dependencies/dependencies-1.71.0.yml | 269 ++ .../all/dependencies/dependencies-1.72.0.yml | 270 ++ .../all/dependencies/dependencies-1.73.0.yml | 274 ++ .../all/dependencies/dependencies-1.74.0.yml | 273 ++ .../all/dependencies/dependencies-1.75.0.yml | 280 ++ .../all/dependencies/dependencies-1.76.0.yml | 279 ++ .../all/dependencies/dependencies-1.77.0.yml | 277 ++ .../all/dependencies/dependencies-1.78.0.yml | 276 ++ .../all/dependencies/dependencies-1.79.0.yml | 276 ++ .../all/dependencies/dependencies-1.80.0.yml | 275 ++ .../all/dependencies/dependencies-1.81.0.yml | 280 ++ ...001-revert-cease-dependence-on-range.patch | 49 + .../patches/1.69.0-contract-no-system.patch | 11 + .../all/patches/1.69.0-locale-no-system.patch | 12 + .../all/patches/1.69.0-random-no-system.patch | 11 + .../1.69.0-type_erasure-no-system.patch | 9 + .../1.75.0-boost_build-with-newer-b2.patch | 51 + ...1-fix-include-inside-boost-namespace.patch | 33 + .../1.77.0-boost_build-with-newer-b2.patch | 51 + .../all/patches/1.77.0-fiber-mingw.patch | 20 + .../1.77.0-type_erasure-no-system.patch | 11 + .../all/patches/1.78.0-b2-fix-install.patch | 62 + ....79.0-0001-json-array-erase-relocate.patch | 49 + .../all/patches/1.79.0-geometry_no_rtti.patch | 169 + .../1.79.0-smart_ptr_cw_ppc_msync.patch | 25 + ...-filesystem-win-fix-dir-it-net-share.patch | 31 + ...ystem-fix-weakly-canonical-long-path.patch | 171 + ...80.0-0003-unordered-valid-after-move.patch | 175 + ...posix-fix-no-at-apis-missing-include.patch | 21 + .../patches/1.80.0-0005-config-libcpp15.patch | 16 + .../1.80.0-0006-unordered-msvc-rtcc.patch | 18 + ....80.0-locale-fail-on-missing-backend.patch | 84 + ....81.0-locale-fail-on-missing-backend.patch | 12 + .../patches/bcp_namespace_issues_1_71.patch | 33 + .../patches/bcp_namespace_issues_1_72.patch | 33 + .../all/patches/boost_1_77_mpi_check.patch | 24 + ..._build_qcc_fix_debug_build_parameter.patch | 22 + ...fix_debug_build_parameter_since_1_74.patch | 22 + ...re_qnx_cxx_provide___cxa_get_globals.patch | 20 + ...boost_locale_fail_on_missing_backend.patch | 60 + ...st_log_filesystem_no_deprecated_1_72.patch | 13 + .../boost/all/patches/boost_mpi_check.patch | 24 + .../all/patches/python_base_prefix.patch | 25 + .../python_base_prefix_since_1_74.patch | 26 + .../all/patches/solaris_pthread_data.patch | 13 + recipes/boost/all/rebuild-dependencies.py | 496 +++ recipes/boost/all/test_package/CMakeLists.txt | 159 + recipes/boost/all/test_package/chrono.cpp | 21 + recipes/boost/all/test_package/conanfile.py | 71 + recipes/boost/all/test_package/coroutine.cpp | 23 + recipes/boost/all/test_package/fiber.cpp | 134 + recipes/boost/all/test_package/json.cpp | 23 + recipes/boost/all/test_package/lambda.cpp | 21 + recipes/boost/all/test_package/locale.cpp | 61 + recipes/boost/all/test_package/nowide.cpp | 35 + recipes/boost/all/test_package/numpy.cpp | 28 + recipes/boost/all/test_package/python.cpp | 16 + recipes/boost/all/test_package/python.py | 8 + recipes/boost/all/test_package/random.cpp | 24 + recipes/boost/all/test_package/regex.cpp | 20 + recipes/boost/all/test_package/stacktrace.cpp | 130 + recipes/boost/all/test_package/test.cpp | 7 + recipes/boost/all/test_package/url.cpp | 14 + .../boost/all/test_v1_package/CMakeLists.txt | 10 + .../boost/all/test_v1_package/conanfile.py | 52 + recipes/boost/config.yml | 23 + recipes/boostdep/all/CMakeLists.txt | 7 + recipes/boostdep/all/conandata.yml | 6 + recipes/boostdep/all/conanfile.py | 58 + .../boostdep/all/test_package/conanfile.py | 17 + recipes/boostdep/config.yml | 3 + recipes/botan/all/conandata.yml | 58 + recipes/botan/all/conanfile.py | 447 +++ recipes/botan/all/patches/dll-dir.patch | 13 + .../all/patches/fix-amalgamation-build.patch | 22 + .../fix-unrecognized-linker-flag.patch | 17 + .../all/patches/vs2015-install-fix.patch | 56 + recipes/botan/all/test_package/CMakeLists.txt | 11 + recipes/botan/all/test_package/conanfile.py | 17 + .../botan/all/test_package/test_package.cpp | 7 + recipes/botan/config.yml | 31 + recipes/box2d/2.4.x/conandata.yml | 10 + recipes/box2d/2.4.x/conanfile.py | 71 + .../0001-install-and-allow-shared.patch | 37 + .../box2d/2.4.x/test_package/CMakeLists.txt | 8 + recipes/box2d/2.4.x/test_package/conanfile.py | 26 + .../box2d/2.4.x/test_package/test_package.cpp | 16 + .../2.4.x/test_v1_package/CMakeLists.txt | 11 + .../box2d/2.4.x/test_v1_package/conanfile.py | 17 + .../2.4.x/test_v1_package/test_package.cpp | 16 + recipes/box2d/all/conandata.yml | 4 + recipes/box2d/all/conanfile.py | 68 + recipes/box2d/all/test_package/CMakeLists.txt | 7 + recipes/box2d/all/test_package/conanfile.py | 24 + .../box2d/all/test_package/test_package.cpp | 88 + .../box2d/all/test_v1_package/CMakeLists.txt | 8 + .../box2d/all/test_v1_package/conanfile.py | 17 + recipes/box2d/config.yml | 7 + recipes/breakpad/all/conandata.yml | 8 + recipes/breakpad/all/conanfile.py | 81 + .../all/patches/0001-Use_conans_lss.patch | 258 ++ .../patches/0002-Remove-hardcoded-fpic.patch | 13 + .../breakpad/all/test_package/CMakeLists.txt | 8 + .../breakpad/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 35 + .../all/test_v1_package/CMakeLists.txt | 8 + .../breakpad/all/test_v1_package/conanfile.py | 17 + recipes/breakpad/config.yml | 3 + recipes/brigand/all/conandata.yml | 4 + recipes/brigand/all/conanfile.py | 64 + .../brigand/all/test_package/CMakeLists.txt | 8 + recipes/brigand/all/test_package/conanfile.py | 25 + .../brigand/all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 11 + .../brigand/all/test_v1_package/conanfile.py | 17 + recipes/brigand/config.yml | 3 + recipes/brotli/all/conandata.yml | 12 + recipes/brotli/all/conanfile.py | 130 + .../all/patches/0001-target-props.patch | 65 + .../all/patches/0002-target-props.patch | 67 + .../brotli/all/test_package/CMakeLists.txt | 7 + recipes/brotli/all/test_package/conanfile.py | 26 + .../brotli/all/test_package/test_package.cpp | 51 + .../brotli/all/test_v1_package/CMakeLists.txt | 10 + .../brotli/all/test_v1_package/conanfile.py | 17 + recipes/brotli/config.yml | 5 + recipes/brynet/all/conandata.yml | 13 + recipes/brynet/all/conanfile.py | 60 + .../brynet/all/test_package/CMakeLists.txt | 12 + recipes/brynet/all/test_package/conanfile.py | 26 + .../brynet/all/test_package/test_package.cpp | 11 + .../brynet/all/test_v1_package/CMakeLists.txt | 8 + .../brynet/all/test_v1_package/conanfile.py | 17 + recipes/brynet/config.yml | 9 + .../bshoshany-thread-pool/all/conandata.yml | 16 + .../bshoshany-thread-pool/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 14 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 59 + recipes/bshoshany-thread-pool/config.yml | 11 + recipes/btyacc/all/CMakeLists.txt | 8 + recipes/btyacc/all/conandata.yml | 4 + recipes/btyacc/all/conanfile.py | 80 + .../btyacc/all/test_package/CMakeLists.txt | 31 + recipes/btyacc/all/test_package/conanfile.py | 23 + recipes/btyacc/all/test_package/test.y | 43 + recipes/btyacc/config.yml | 3 + recipes/bullet3/all/conandata.yml | 31 + recipes/bullet3/all/conanfile.py | 198 + .../bullet3/all/test_package/CMakeLists.txt | 8 + recipes/bullet3/all/test_package/conanfile.py | 26 + .../bullet3/all/test_package/test_package.cpp | 177 + .../all/test_v1_package/CMakeLists.txt | 8 + .../bullet3/all/test_v1_package/conanfile.py | 17 + recipes/bullet3/config.yml | 21 + recipes/butteraugli/all/CMakeLists.txt | 31 + recipes/butteraugli/all/conandata.yml | 7 + recipes/butteraugli/all/conanfile.py | 84 + .../0001-compilation-fixes-for-vs2015.patch | 59 + .../all/test_package/CMakeLists.txt | 8 + .../butteraugli/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/butteraugli/config.yml | 3 + recipes/bvdberg-ctest/all/conandata.yml | 4 + recipes/bvdberg-ctest/all/conanfile.py | 45 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.c | 22 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/bvdberg-ctest/config.yml | 3 + recipes/bx/all/conandata.yml | 4 + recipes/bx/all/conanfile.py | 247 ++ recipes/bx/all/test_package/CMakeLists.txt | 9 + recipes/bx/all/test_package/conanfile.py | 28 + recipes/bx/all/test_package/test_package.cpp | 8 + recipes/bx/all/test_v1_package/CMakeLists.txt | 12 + recipes/bx/all/test_v1_package/conanfile.py | 17 + .../bx/all/test_v1_package/test_package.cpp | 8 + recipes/bx/config.yml | 3 + recipes/byte-lite/all/conandata.yml | 4 + recipes/byte-lite/all/conanfile.py | 56 + .../byte-lite/all/test_package/CMakeLists.txt | 7 + .../byte-lite/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/byte-lite/config.yml | 3 + recipes/bzip2/all/CMakeLists.txt | 41 + recipes/bzip2/all/conandata.yml | 10 + recipes/bzip2/all/conanfile.py | 106 + .../patches/0001-fix-sys-stat-include.patch | 11 + recipes/bzip2/all/test_package/CMakeLists.txt | 24 + recipes/bzip2/all/test_package/conanfile.py | 26 + recipes/bzip2/all/test_package/test_package.c | 14 + .../bzip2/all/test_v1_package/CMakeLists.txt | 8 + .../bzip2/all/test_v1_package/conanfile.py | 17 + recipes/bzip2/config.yml | 5 + recipes/bzip3/all/CMakeLists.txt | 68 + recipes/bzip3/all/conandata.yml | 37 + recipes/bzip3/all/conanfile.py | 81 + .../1.1.4-0001-make-restrict-alias.patch | 114 + .../patches/1.1.4-0002-export-symbols.patch | 95 + .../patches/1.1.5-0002-export-symbols.patch | 83 + recipes/bzip3/all/test_package/CMakeLists.txt | 7 + recipes/bzip3/all/test_package/conanfile.py | 25 + recipes/bzip3/all/test_package/test_package.c | 13 + .../bzip3/all/test_v1_package/CMakeLists.txt | 8 + .../bzip3/all/test_v1_package/conanfile.py | 17 + recipes/bzip3/config.yml | 21 + recipes/c-ares/all/conandata.yml | 47 + recipes/c-ares/all/conanfile.py | 101 + recipes/c-ares/all/patches/option-tools.patch | 16 + ...stream-pr-395-bundle-destination-v14.patch | 10 + ...stream-pr-395-bundle-destination-v15.patch | 10 + ...eam-pr-395-bundle-destination-v16-17.patch | 10 + .../c-ares/all/test_package/CMakeLists.txt | 7 + recipes/c-ares/all/test_package/conanfile.py | 26 + .../c-ares/all/test_package/test_package.c | 111 + .../c-ares/all/test_v1_package/CMakeLists.txt | 8 + .../c-ares/all/test_v1_package/conanfile.py | 17 + recipes/c-ares/config.yml | 15 + recipes/c-blosc/all/conandata.yml | 58 + recipes/c-blosc/all/conanfile.py | 124 + .../patches/cmake-dependencies-1.18.1-.patch | 72 + .../patches/cmake-dependencies-1.19.0.patch | 72 + .../patches/cmake-dependencies-1.20.0+.patch | 72 + .../patches/cmake-dependencies-1.21.1+.patch | 72 + .../patches/cmake-dependencies-1.21.2+.patch | 71 + .../c-blosc/all/test_package/CMakeLists.txt | 7 + recipes/c-blosc/all/test_package/conanfile.py | 26 + .../c-blosc/all/test_package/test_package.c | 79 + .../all/test_v1_package/CMakeLists.txt | 8 + .../c-blosc/all/test_v1_package/conanfile.py | 18 + recipes/c-blosc/config.yml | 17 + recipes/c-blosc2/all/conandata.yml | 51 + recipes/c-blosc2/all/conanfile.py | 146 + .../all/patches/2.2.0-0001-fix-cmake.patch | 127 + .../all/patches/2.4.1-0001-fix-cmake.patch | 119 + .../all/patches/2.6.0-0001-fix-cmake.patch | 122 + .../all/patches/2.8.0-0001-fix-cmake.patch | 119 + .../c-blosc2/all/test_package/CMakeLists.txt | 8 + .../c-blosc2/all/test_package/conanfile.py | 26 + .../c-blosc2/all/test_package/test_package.c | 114 + .../all/test_v1_package/CMakeLists.txt | 9 + .../c-blosc2/all/test_v1_package/conanfile.py | 18 + recipes/c-blosc2/config.yml | 15 + recipes/c-client/all/conandata.yml | 11 + recipes/c-client/all/conanfile.py | 138 + .../patches/0001-fix-yunchan-tempfile.patch | 68 + .../all/patches/0002-fix-makefile-w2k.patch | 13 + .../all/patches/0003-fix-env-nt.patch | 11 + .../all/patches/0004-fix-makefile.patch | 55 + .../all/patches/2014_openssl1.1.1_sni.patch | 42 + .../c-client/all/test_package/CMakeLists.txt | 7 + .../c-client/all/test_package/conanfile.py | 26 + .../c-client/all/test_package/test_package.c | 34 + .../all/test_v1_package/CMakeLists.txt | 8 + .../c-client/all/test_v1_package/conanfile.py | 17 + recipes/c-client/config.yml | 3 + recipes/c-dbg-macro/all/conandata.yml | 4 + recipes/c-dbg-macro/all/conanfile.py | 39 + .../all/test_package/CMakeLists.txt | 7 + .../c-dbg-macro/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 30 + .../all/test_v1_package/CMakeLists.txt | 7 + .../all/test_v1_package/conanfile.py | 17 + recipes/c-dbg-macro/config.yml | 3 + recipes/c4core/all/conandata.yml | 30 + recipes/c4core/all/conanfile.py | 96 + ...0.1.10-0001-make-fast_float-external.patch | 37 + ...0.1.11-0001-make-fast_float-external.patch | 37 + .../0.1.8-0001-make-fast_float-external.patch | 37 + .../0.1.9-0001-make-fast_float-external.patch | 37 + .../c4core/all/test_package/CMakeLists.txt | 9 + recipes/c4core/all/test_package/conanfile.py | 26 + .../c4core/all/test_package/test_package.cpp | 13 + .../c4core/all/test_v1_package/CMakeLists.txt | 9 + .../c4core/all/test_v1_package/conanfile.py | 18 + recipes/c4core/config.yml | 9 + recipes/caf/all/conandata.yml | 13 + recipes/caf/all/conanfile.py | 140 + recipes/caf/all/test_package/CMakeLists.txt | 8 + recipes/caf/all/test_package/conanfile.py | 26 + recipes/caf/all/test_package/test_package.cpp | 44 + .../caf/all/test_v1_package/CMakeLists.txt | 8 + recipes/caf/all/test_v1_package/conanfile.py | 17 + recipes/caf/config.yml | 9 + recipes/cairo/all/conandata.yml | 26 + recipes/cairo/all/conanfile.py | 340 ++ ...d-scripts-to-compile-with-more-featu.patch | 155 + .../patches/binutils-2.34-libbfd-fix.patch | 43 + recipes/cairo/all/test_package/CMakeLists.txt | 7 + recipes/cairo/all/test_package/conanfile.py | 26 + recipes/cairo/all/test_package/test_package.c | 36 + .../cairo/all/test_v1_package/CMakeLists.txt | 8 + .../cairo/all/test_v1_package/conanfile.py | 18 + recipes/cairo/config.yml | 9 + recipes/cairo/meson/conandata.yml | 34 + recipes/cairo/meson/conanfile.py | 360 ++ .../patches/binutils-2.34-libbfd-fix.patch | 43 + .../cairo-1.17.4-encoding-backport.patch | 40 + .../cairo-1.17.4-symbol-lookup-backport.patch | 25 + .../cairo-1.17.4-trace-cflags-fix.patch | 20 + .../cairo-1.17.4-xlib-xrender-option.patch | 26 + .../cairo/meson/test_package/CMakeLists.txt | 7 + recipes/cairo/meson/test_package/conanfile.py | 26 + .../cairo/meson/test_package/test_package.c | 36 + .../meson/test_v1_package/CMakeLists.txt | 8 + .../cairo/meson/test_v1_package/conanfile.py | 18 + recipes/cairomm/all/conandata.yml | 15 + recipes/cairomm/all/conanfile.py | 194 + .../patches/enable_static_lib_1_14_3.patch | 37 + .../patches/enable_static_lib_1_16_1.patch | 38 + .../cairomm/all/test_package/CMakeLists.txt | 16 + recipes/cairomm/all/test_package/conanfile.py | 18 + .../cairomm/all/test_package/test_package.cpp | 36 + recipes/cairomm/config.yml | 5 + recipes/cajun-jsonapi/all/conandata.yml | 7 + recipes/cajun-jsonapi/all/conanfile.py | 89 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../cajun-jsonapi/all/test_package/main.cpp | 43 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 16 + recipes/cajun-jsonapi/config.yml | 5 + recipes/calceph/all/conandata.yml | 16 + recipes/calceph/all/conanfile.py | 132 + .../calceph/all/test_package/CMakeLists.txt | 7 + recipes/calceph/all/test_package/conanfile.py | 26 + .../calceph/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../calceph/all/test_v1_package/conanfile.py | 17 + recipes/calceph/config.yml | 11 + recipes/canary/all/conandata.yml | 4 + recipes/canary/all/conanfile.py | 61 + .../canary/all/test_package/CMakeLists.txt | 8 + recipes/canary/all/test_package/conanfile.py | 27 + .../canary/all/test_package/test_package.cpp | 15 + .../canary/all/test_v1_package/CMakeLists.txt | 8 + .../canary/all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package/test_package.cpp | 15 + recipes/canary/config.yml | 3 + recipes/canvas_ity/all/conandata.yml | 4 + recipes/canvas_ity/all/conanfile.py | 48 + .../all/test_package/CMakeLists.txt | 7 + .../canvas_ity/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 71 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/canvas_ity/config.yml | 3 + recipes/capnproto/all/conandata.yml | 41 + recipes/capnproto/all/conanfile.py | 241 ++ .../all/patches/0001-disable-tests.patch | 161 + .../0002-cmake-compat-header-install.patch | 28 + .../all/patches/0003-kj-tls-windows.patch | 75 + .../all/patches/0004-cmake-module-path.patch | 11 + .../0005-msvc-16.7-ice-workaround.patch | 28 + .../capnproto/all/patches/0006-symlink.patch | 38 + .../all/patches/0007-cmake-module-path.patch | 11 + .../all/patches/0008-disable-tests.patch | 157 + .../0009-windows-symlink-fix-0.8.0.patch | 20 + .../0010-disable-tests-for-0.9.1.patch | 185 + ...11-msvc-cpp17-hassubstring-fix-0.9.1.patch | 39 + .../patches/0012-msvc-nogdi-fix-0.9.1.patch | 29 + .../0013-disable-tests-for-0.10.0.patch | 177 + .../0014-disable-tests-for-0.10.1.patch | 176 + .../capnproto/all/test_package/CMakeLists.txt | 21 + .../all/test_package/addressbook.c++ | 288 ++ .../all/test_package/addressbook.capnp | 55 + .../all/test_package/calculator-client.c++ | 367 ++ .../all/test_package/calculator-server.c++ | 215 + .../all/test_package/calculator.capnp | 118 + .../capnproto/all/test_package/conanfile.py | 38 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 26 + recipes/capnproto/config.yml | 13 + recipes/capstone/all/conandata.yml | 4 + recipes/capstone/all/conanfile.py | 86 + .../capstone/all/test_package/CMakeLists.txt | 7 + .../capstone/all/test_package/conanfile.py | 26 + .../capstone/all/test_package/test_package.c | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../capstone/all/test_v1_package/conanfile.py | 17 + recipes/capstone/config.yml | 3 + recipes/cargs/all/CMakeLists.txt | 7 + recipes/cargs/all/conandata.yml | 10 + recipes/cargs/all/conanfile.py | 68 + recipes/cargs/all/test_package/CMakeLists.txt | 9 + recipes/cargs/all/test_package/conanfile.py | 16 + recipes/cargs/all/test_package/test_package.c | 16 + recipes/cargs/config.yml | 7 + .../cassandra-cpp-driver/all/CMakeLists.txt | 7 + .../cassandra-cpp-driver/all/conandata.yml | 10 + recipes/cassandra-cpp-driver/all/conanfile.py | 155 + .../all/patches/2.15.3/fix-cmake.patch | 159 + .../all/patches/2.15.3/fix-rapidjson.patch | 38 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/main.cpp | 18 + recipes/cassandra-cpp-driver/config.yml | 3 + recipes/catch2/2.x.x/conandata.yml | 19 + recipes/catch2/2.x.x/conanfile.py | 133 + .../2.x.x/test_package/000-CatchMain.cpp | 3 + .../2.x.x/test_package/100-standalone.cpp | 5 + .../2.x.x/test_package/200-benchmark.cpp | 11 + .../300-standalone-with-prefix.cpp | 5 + .../400-benchmark-with-prefix.cpp | 11 + .../catch2/2.x.x/test_package/CMakeLists.txt | 31 + .../catch2/2.x.x/test_package/conanfile.py | 33 + .../2.x.x/test_v1_package/CMakeLists.txt | 10 + .../catch2/2.x.x/test_v1_package/conanfile.py | 18 + recipes/catch2/3.x.x/conandata.yml | 41 + recipes/catch2/3.x.x/conanfile.py | 184 + .../patches/3.0.1-0001-allow-shared.patch | 64 + ...1-0002-dllimport-global-symbols-msvc.patch | 77 + .../patches/3.1.0-0001-fix-dll-install.patch | 16 + ...0-0002-dllimport-global-symbols-msvc.patch | 77 + .../3.x.x/test_package/100-standalone.cpp | 5 + .../3.x.x/test_package/200-benchmark.cpp | 12 + .../300-standalone-with-prefix.cpp | 5 + .../400-benchmark-with-prefix.cpp | 12 + .../catch2/3.x.x/test_package/CMakeLists.txt | 16 + .../catch2/3.x.x/test_package/conanfile.py | 31 + .../3.x.x/test_v1_package/CMakeLists.txt | 8 + .../catch2/3.x.x/test_v1_package/conanfile.py | 18 + recipes/catch2/config.yml | 27 + recipes/cc65/all/conandata.yml | 18 + recipes/cc65/all/conanfile.py | 163 + ...2.18-0001-no-embedded-paths-makefile.patch | 11 + .../2.18-0002-libsrc-use-extension.patch | 17 + ...2.19-0001-no-embedded-paths-makefile.patch | 11 + .../2.19-0002-libsrc-use-extension.patch | 17 + recipes/cc65/all/test_package/conanfile.py | 33 + recipes/cc65/all/test_package/hello.c | 10 + recipes/cc65/all/test_package/text.s | 2 + recipes/cc65/config.yml | 5 + recipes/ccache/all/conandata.yml | 16 + recipes/ccache/all/conanfile.py | 105 + .../patches/4.7.4-cmake-msvc-runtime.patch | 11 + .../all/patches/4.8-cmake-msvc-runtime.patch | 11 + recipes/ccache/all/test_package/conanfile.py | 15 + .../ccache/all/test_v1_package/conanfile.py | 9 + recipes/ccache/config.yml | 5 + recipes/cccl/all/conandata.yml | 7 + recipes/cccl/all/conanfile.py | 92 + recipes/cccl/all/test_package/conanfile.py | 33 + recipes/cccl/all/test_package/example.cpp | 6 + recipes/cccl/all/test_v1_package/conanfile.py | 35 + recipes/cccl/all/test_v1_package/example.cpp | 6 + recipes/cccl/config.yml | 5 + recipes/ccfits/all/conandata.yml | 12 + recipes/ccfits/all/conanfile.py | 81 + .../0001-adapt-cmakelists-for-conan-2.5.patch | 44 + .../0001-adapt-cmakelists-for-conan-2.6.patch | 47 + .../ccfits/all/test_package/CMakeLists.txt | 7 + recipes/ccfits/all/test_package/conanfile.py | 26 + .../ccfits/all/test_package/test_package.cpp | 8 + .../ccfits/all/test_v1_package/CMakeLists.txt | 10 + .../ccfits/all/test_v1_package/conanfile.py | 17 + recipes/ccfits/config.yml | 5 + recipes/cctag/all/conandata.yml | 9 + recipes/cctag/all/conanfile.py | 155 + .../all/patches/0001-honor-vc-runtime.patch | 18 + recipes/cctag/all/test_package/CMakeLists.txt | 8 + recipes/cctag/all/test_package/conanfile.py | 26 + .../cctag/all/test_package/test_package.cpp | 6 + .../cctag/all/test_v1_package/CMakeLists.txt | 8 + .../cctag/all/test_v1_package/conanfile.py | 17 + recipes/cctag/config.yml | 3 + recipes/cctz/all/conandata.yml | 8 + recipes/cctz/all/conanfile.py | 86 + .../all/patches/0001-fix-installation.patch | 18 + .../patches/0002-fix-frameworks-apple.patch | 13 + recipes/cctz/all/test_package/CMakeLists.txt | 8 + recipes/cctz/all/test_package/conanfile.py | 26 + .../cctz/all/test_package/test_package.cpp | 41 + .../cctz/all/test_v1_package/CMakeLists.txt | 8 + recipes/cctz/all/test_v1_package/conanfile.py | 17 + recipes/cctz/config.yml | 3 + .../all/conandata.yml | 6 + .../all/conanfile.py | 96 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 19 + recipes/cd3-boost-unit-definitions/config.yml | 4 + recipes/celero/all/conandata.yml | 16 + recipes/celero/all/conanfile.py | 132 + ...-install-pic-cxx-standard-sytem-libs.patch | 86 + ...owercase-include-system-libs-windows.patch | 61 + .../all/patches/0003-typo-declspec.patch | 18 + .../patches/0004-2.6.0-missing-include.patch | 10 + .../patches/0004-2.8.2-missing-include.patch | 10 + .../all/patches/0005-drop-runtime.patch | 23 + .../celero/all/test_package/CMakeLists.txt | 8 + recipes/celero/all/test_package/conanfile.py | 26 + .../celero/all/test_package/test_package.cpp | 34 + .../celero/all/test_v1_package/CMakeLists.txt | 8 + .../celero/all/test_v1_package/conanfile.py | 17 + recipes/celero/config.yml | 5 + recipes/cereal/all/conandata.yml | 10 + recipes/cereal/all/conanfile.py | 94 + .../cereal/all/test_package/CMakeLists.txt | 8 + recipes/cereal/all/test_package/conanfile.py | 25 + .../cereal/all/test_package/test_package.cpp | 27 + .../cereal/all/test_v1_package/CMakeLists.txt | 11 + .../cereal/all/test_v1_package/conanfile.py | 17 + recipes/cereal/config.yml | 7 + recipes/ceres-solver/all/conandata.yml | 33 + recipes/ceres-solver/all/conanfile.py | 189 + .../1.14.0-0001-find-libraries-conan.patch | 148 + .../patches/1.14.0-0002-fix-msvc-c++17.patch | 36 + .../2.0.0-0001-find-libraries-conan.patch | 82 + .../patches/2.0.0-0002-fix-mingw-build.patch | 12 + .../2.1.0-0001-find-libraries-conan.patch | 54 + .../patches/2.1.0-0002-fix-mingw-build.patch | 12 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 188 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/ceres-solver/config.yml | 7 + recipes/cern-root/all/conandata.yml | 10 + recipes/cern-root/all/conanfile.py | 332 ++ .../patches/0001-add-missing-includes.patch | 11 + .../0002-cmake-missing-link-libraries.patch | 9 + .../cern-root/all/test_package/CMakeLists.txt | 19 + recipes/cern-root/all/test_package/Event.cpp | 18 + recipes/cern-root/all/test_package/Event.hpp | 29 + .../cern-root/all/test_package/EventLinkDef.h | 7 + .../cern-root/all/test_package/conanfile.py | 46 + .../all/test_package/testrootdictionaries.cpp | 63 + recipes/cern-root/config.yml | 3 + recipes/certify/all/conandata.yml | 4 + recipes/certify/all/conanfile.py | 76 + .../certify/all/test_package/CMakeLists.txt | 11 + recipes/certify/all/test_package/conanfile.py | 17 + .../certify/all/test_package/test_package.cpp | 20 + recipes/certify/config.yml | 3 + recipes/cfgfile/all/conandata.yml | 16 + recipes/cfgfile/all/conanfile.py | 92 + .../cfgfile/all/test_package/CMakeLists.txt | 15 + recipes/cfgfile/all/test_package/conanfile.py | 32 + .../cfgfile/all/test_package/session_cfg.conf | 19 + recipes/cfgfile/all/test_package/test.cfg | 3 + .../cfgfile/all/test_package/test_package.cpp | 41 + .../all/test_v1_package/CMakeLists.txt | 6 + .../cfgfile/all/test_v1_package/conanfile.py | 23 + recipes/cfgfile/config.yml | 11 + recipes/cfitsio/all/conandata.yml | 38 + recipes/cfitsio/all/conanfile.py | 121 + .../cfitsio/all/patches/fix-cmake-3.470.patch | 223 ++ .../cfitsio/all/patches/fix-cmake-3.490.patch | 222 ++ .../cfitsio/all/patches/fix-cmake-4.0.0.patch | 90 + .../cfitsio/all/patches/fix-cmake-4.1.0.patch | 79 + .../cfitsio/all/patches/fix-cmake-4.2.0.patch | 79 + .../all/patches/windows-use-strtok_s.patch | 14 + .../cfitsio/all/test_package/CMakeLists.txt | 7 + recipes/cfitsio/all/test_package/conanfile.py | 27 + recipes/cfitsio/all/test_package/file011.fits | Bin 0 -> 37440 bytes .../cfitsio/all/test_package/test_package.c | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cfitsio/all/test_v1_package/conanfile.py | 18 + recipes/cfitsio/config.yml | 13 + recipes/cgal/all/CMakeLists.txt | 7 + recipes/cgal/all/conandata.yml | 19 + recipes/cgal/all/conanfile.py | 76 + recipes/cgal/all/test_package/CMakeLists.txt | 9 + recipes/cgal/all/test_package/conanfile.py | 20 + .../cgal/all/test_package/test_package.cpp | 39 + recipes/cgal/config.yml | 13 + recipes/cgif/all/conandata.yml | 4 + recipes/cgif/all/conanfile.py | 93 + recipes/cgif/all/test_package/CMakeLists.txt | 8 + recipes/cgif/all/test_package/conanfile.py | 26 + recipes/cgif/all/test_package/test_package.c | 53 + .../cgif/all/test_v1_package/CMakeLists.txt | 8 + recipes/cgif/all/test_v1_package/conanfile.py | 17 + recipes/cgif/config.yml | 3 + recipes/cglm/all/CMakeLists.txt | 7 + recipes/cglm/all/conandata.yml | 4 + recipes/cglm/all/conanfile.py | 101 + recipes/cglm/all/test_package/CMakeLists.txt | 10 + recipes/cglm/all/test_package/conanfile.py | 17 + recipes/cglm/all/test_package/test_package.c | 21 + recipes/cglm/config.yml | 3 + recipes/cgltf/all/CMakeLists.txt | 29 + recipes/cgltf/all/conandata.yml | 28 + recipes/cgltf/all/conanfile.py | 89 + recipes/cgltf/all/test_package/CMakeLists.txt | 11 + recipes/cgltf/all/test_package/conanfile.py | 17 + .../cgltf/all/test_package/test_package.cpp | 54 + recipes/cgltf/config.yml | 19 + recipes/cgns/all/conandata.yml | 8 + recipes/cgns/all/conanfile.py | 128 + .../all/patches/4.3.0-fix_find_hdf5.patch | 23 + .../patches/4.3.0-fix_static_or_shared.patch | 24 + recipes/cgns/all/test_package/CMakeLists.txt | 7 + recipes/cgns/all/test_package/conanfile.py | 27 + .../cgns/all/test_package/test_package.cpp | 21 + .../cgns/all/test_v1_package/CMakeLists.txt | 8 + recipes/cgns/all/test_v1_package/conanfile.py | 18 + recipes/cgns/config.yml | 3 + recipes/chaiscript/all/CMakeLists.txt | 11 + recipes/chaiscript/all/conandata.yml | 4 + recipes/chaiscript/all/conanfile.py | 80 + .../all/test_package/CMakeLists.txt | 13 + .../chaiscript/all/test_package/conanfile.py | 15 + .../all/test_package/test_package.cpp | 17 + recipes/chaiscript/config.yml | 4 + recipes/charls/all/conandata.yml | 22 + recipes/charls/all/conanfile.py | 115 + .../all/patches/constexpr-msvc2015.patch | 48 + .../patches/def-and-rc-for-msvc-only.patch | 30 + .../patches/enum-name-lookup-for-gcc5.patch | 17 + ...x-missing-includes-for-clang5-stdc++.patch | 12 + .../charls/all/test_package/CMakeLists.txt | 12 + recipes/charls/all/test_package/conanfile.py | 28 + .../charls/all/test_package/test_package.c | 9 + .../charls/all/test_package/test_package.cpp | 9 + .../charls/all/test_v1_package/CMakeLists.txt | 8 + .../charls/all/test_v1_package/conanfile.py | 19 + recipes/charls/config.yml | 11 + recipes/chef-fun/all/conandata.yml | 6 + recipes/chef-fun/all/conanfile.py | 117 + .../chef-fun/all/test_package/CMakeLists.txt | 11 + .../chef-fun/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../chef-fun/all/test_v1_package/conanfile.py | 19 + recipes/chef-fun/config.yml | 4 + recipes/chipmunk2d/all/conandata.yml | 4 + recipes/chipmunk2d/all/conanfile.py | 68 + .../all/test_package/CMakeLists.txt | 7 + .../chipmunk2d/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/chipmunk2d/config.yml | 3 + recipes/cimg/all/conandata.yml | 22 + recipes/cimg/all/conanfile.py | 119 + recipes/cimg/all/test_package/CMakeLists.txt | 8 + recipes/cimg/all/test_package/conanfile.py | 26 + .../cimg/all/test_package/test_package.cpp | 157 + .../cimg/all/test_v1_package/CMakeLists.txt | 11 + recipes/cimg/all/test_v1_package/conanfile.py | 17 + recipes/cimg/config.yml | 15 + recipes/circularbuffer/all/conandata.yml | 4 + recipes/circularbuffer/all/conanfile.py | 51 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 17 + .../all/test_v1_package/test_package.cpp | 10 + recipes/circularbuffer/config.yml | 3 + recipes/cista/all/conandata.yml | 26 + recipes/cista/all/conanfile.py | 74 + recipes/cista/all/test_package/CMakeLists.txt | 8 + recipes/cista/all/test_package/conanfile.py | 25 + .../cista/all/test_package/test_package.cpp | 28 + .../cista/all/test_v1_package/CMakeLists.txt | 8 + .../cista/all/test_v1_package/conanfile.py | 17 + recipes/cista/config.yml | 11 + recipes/cityhash/all/conandata.yml | 4 + recipes/cityhash/all/conanfile.py | 101 + .../cityhash/all/test_package/CMakeLists.txt | 7 + .../cityhash/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cityhash/all/test_v1_package/conanfile.py | 17 + recipes/cityhash/config.yml | 3 + recipes/civetweb/all/conandata.yml | 18 + recipes/civetweb/all/conanfile.py | 191 + .../all/patches/0001-fix-install-bundle.patch | 13 + .../civetweb/all/test_package/CMakeLists.txt | 7 + .../civetweb/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../civetweb/all/test_v1_package/conanfile.py | 17 + recipes/civetweb/config.yml | 9 + recipes/cjson/all/conandata.yml | 16 + recipes/cjson/all/conanfile.py | 141 + .../cjson/all/patches/fix-cmake-install.patch | 32 + recipes/cjson/all/test_package/CMakeLists.txt | 7 + recipes/cjson/all/test_package/conanfile.py | 26 + recipes/cjson/all/test_package/test_package.c | 57 + .../cjson/all/test_v1_package/CMakeLists.txt | 8 + .../cjson/all/test_v1_package/conanfile.py | 17 + recipes/cjson/config.yml | 9 + recipes/clara/all/conandata.yml | 4 + recipes/clara/all/conanfile.py | 33 + recipes/clara/all/test_package/CMakeLists.txt | 8 + recipes/clara/all/test_package/conanfile.py | 27 + .../clara/all/test_package/test_package.cpp | 31 + .../clara/all/test_v1_package/CMakeLists.txt | 8 + .../clara/all/test_v1_package/conanfile.py | 18 + recipes/clara/config.yml | 3 + recipes/clhep/all/conandata.yml | 9 + recipes/clhep/all/conanfile.py | 130 + recipes/clhep/all/patches/fix-cmake.patch | 65 + recipes/clhep/all/patches/mingw-support.patch | 42 + .../all/patches/msvc-2015-no-SFINAE.patch | 67 + recipes/clhep/all/test_package/CMakeLists.txt | 12 + recipes/clhep/all/test_package/conanfile.py | 26 + .../clhep/all/test_package/test_package.cpp | 85 + .../clhep/all/test_v1_package/CMakeLists.txt | 8 + .../clhep/all/test_v1_package/conanfile.py | 17 + recipes/clhep/config.yml | 3 + recipes/cli11/all/conandata.yml | 25 + recipes/cli11/all/conanfile.py | 64 + recipes/cli11/all/test_package/CMakeLists.txt | 9 + recipes/cli11/all/test_package/conanfile.py | 26 + .../cli11/all/test_package/test_package.cpp | 27 + .../cli11/all/test_v1_package/CMakeLists.txt | 8 + .../cli11/all/test_v1_package/conanfile.py | 17 + recipes/cli11/config.yml | 17 + recipes/clipp/all/conandata.yml | 4 + recipes/clipp/all/conanfile.py | 25 + recipes/clipp/all/test_package/CMakeLists.txt | 9 + recipes/clipp/all/test_package/conanfile.py | 21 + .../clipp/all/test_package/test_package.cpp | 17 + recipes/clipp/config.yml | 3 + recipes/clipper/all/conandata.yml | 12 + recipes/clipper/all/conanfile.py | 74 + .../0001-include-install-directory-4.x.patch | 9 + .../0001-include-install-directory-6.x.patch | 13 + .../clipper/all/test_package/CMakeLists.txt | 8 + recipes/clipper/all/test_package/conanfile.py | 32 + .../clipper/all/test_package/test_package.cpp | 67 + .../all/test_v1_package/CMakeLists.txt | 11 + .../clipper/all/test_v1_package/conanfile.py | 18 + recipes/clipper/config.yml | 5 + recipes/clove-unit/all/conandata.yml | 13 + recipes/clove-unit/all/conanfile.py | 37 + .../all/test_package/CMakeLists.txt | 8 + .../clove-unit/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/clove-unit/config.yml | 9 + recipes/cmake/3.x.x/conandata.yml | 22 + recipes/cmake/3.x.x/conanfile.py | 166 + recipes/cmake/3.x.x/test_package/conanfile.py | 24 + .../cmake/3.x.x/test_v1_package/conanfile.py | 23 + recipes/cmake/binary/conandata.yml | 138 + recipes/cmake/binary/conanfile.py | 66 + .../cmake/binary/test_package/conanfile.py | 23 + .../cmake/binary/test_v1_package/conanfile.py | 23 + recipes/cmake/config.yml | 17 + recipes/cminpack/all/conandata.yml | 4 + recipes/cminpack/all/conanfile.py | 116 + .../cminpack/all/test_package/CMakeLists.txt | 13 + .../cminpack/all/test_package/conanfile.py | 25 + recipes/cminpack/all/test_package/tchkderc.c | 159 + .../all/test_v1_package/CMakeLists.txt | 16 + .../cminpack/all/test_v1_package/conanfile.py | 21 + recipes/cminpack/config.yml | 3 + recipes/cmocka/all/conandata.yml | 7 + recipes/cmocka/all/conanfile.py | 102 + .../build_either_static_or_shared.patch | 20 + .../cmocka/all/test_package/CMakeLists.txt | 8 + recipes/cmocka/all/test_package/conanfile.py | 26 + .../cmocka/all/test_package/test_package.c | 17 + .../cmocka/all/test_v1_package/CMakeLists.txt | 8 + .../cmocka/all/test_v1_package/conanfile.py | 17 + recipes/cmocka/config.yml | 3 + recipes/cmp/all/CMakeLists.txt | 17 + recipes/cmp/all/conandata.yml | 7 + recipes/cmp/all/conanfile.py | 62 + recipes/cmp/all/test_package/CMakeLists.txt | 7 + recipes/cmp/all/test_package/conanfile.py | 26 + recipes/cmp/all/test_package/test_package.c | 11 + .../cmp/all/test_v1_package/CMakeLists.txt | 8 + recipes/cmp/all/test_v1_package/conanfile.py | 17 + recipes/cmp/config.yml | 5 + recipes/cn-cbor/all/CMakeLists.txt | 7 + recipes/cn-cbor/all/conandata.yml | 4 + recipes/cn-cbor/all/conanfile.py | 82 + .../cn-cbor/all/test_package/CMakeLists.txt | 9 + recipes/cn-cbor/all/test_package/conanfile.py | 18 + .../cn-cbor/all/test_package/test_package.cpp | 21 + recipes/cn-cbor/config.yml | 4 + recipes/cnpy/all/conandata.yml | 7 + recipes/cnpy/all/conanfile.py | 71 + recipes/cnpy/all/patches/0001-fix-cmake.patch | 40 + recipes/cnpy/all/test_package/CMakeLists.txt | 8 + recipes/cnpy/all/test_package/conanfile.py | 26 + .../cnpy/all/test_package/test_package.cpp | 15 + .../cnpy/all/test_v1_package/CMakeLists.txt | 8 + recipes/cnpy/all/test_v1_package/conanfile.py | 17 + recipes/cnpy/config.yml | 3 + recipes/co/all/CMakeLists.txt | 7 + recipes/co/all/conandata.yml | 8 + recipes/co/all/conanfile.py | 104 + recipes/co/all/patches/001-install-dll.patch | 10 + .../all/patches/002-fix-event-destruct.patch | 13 + recipes/co/all/test_package/CMakeLists.txt | 11 + recipes/co/all/test_package/conanfile.py | 16 + recipes/co/all/test_package/test_package.cc | 7 + recipes/co/config.yml | 3 + recipes/cocoyaxi/all/conandata.yml | 4 + recipes/cocoyaxi/all/conanfile.py | 97 + .../cocoyaxi/all/test_package/CMakeLists.txt | 8 + .../cocoyaxi/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 11 + .../cocoyaxi/all/test_v1_package/conanfile.py | 17 + recipes/cocoyaxi/config.yml | 3 + recipes/coin-cbc/all/conandata.yml | 10 + recipes/coin-cbc/all/conanfile.py | 172 + .../patches/0001-no-pkg-config-check.patch | 13 + .../all/patches/0002-pthreads4w.patch | 11 + .../coin-cbc/all/test_package/CMakeLists.txt | 12 + .../coin-cbc/all/test_package/conanfile.py | 20 + .../all/test_package/test_package.cpp | 18 + recipes/coin-cbc/config.yml | 3 + recipes/coin-cgl/all/conandata.yml | 12 + recipes/coin-cgl/all/conanfile.py | 143 + .../0.60.3-0001-no-pkg-config-check.patch | 13 + .../0.60.6-0001-no-pkg-config-check.patch | 13 + .../coin-cgl/all/test_package/CMakeLists.txt | 8 + .../coin-cgl/all/test_package/conanfile.py | 30 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../coin-cgl/all/test_v1_package/conanfile.py | 20 + recipes/coin-cgl/config.yml | 5 + recipes/coin-clp/all/conandata.yml | 12 + recipes/coin-clp/all/conanfile.py | 146 + .../1.17.6-0001-no-pkg-config-check.patch | 13 + .../1.17.7-0001-no-pkg-config-check.patch | 13 + .../coin-clp/all/test_package/CMakeLists.txt | 8 + .../coin-clp/all/test_package/conanfile.py | 31 + recipes/coin-clp/all/test_package/sample.mps | 21 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../coin-clp/all/test_v1_package/conanfile.py | 21 + recipes/coin-clp/config.yml | 5 + recipes/coin-lemon/all/conandata.yml | 8 + recipes/coin-lemon/all/conanfile.py | 95 + .../0001-remove-register-keyword.patch | 15 + .../cmake-add-runtime-destination_1.3.1.patch | 12 + .../all/test_package/CMakeLists.txt | 8 + .../coin-lemon/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/coin-lemon/config.yml | 3 + recipes/coin-osi/all/conandata.yml | 20 + recipes/coin-osi/all/conanfile.py | 137 + .../0.108.6-0001-no-pkg-config-check.patch | 13 + .../patches/0.108.6-0002-cpp17-compat.patch | 28 + .../coin-osi/all/test_package/CMakeLists.txt | 8 + .../coin-osi/all/test_package/conanfile.py | 30 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../coin-osi/all/test_v1_package/conanfile.py | 20 + recipes/coin-osi/config.yml | 5 + recipes/coin-utils/all/conandata.yml | 18 + recipes/coin-utils/all/conanfile.py | 173 + .../all/patches/0001-no-check-pkgconfig.patch | 13 + .../all/patches/0002-cpp17-compat.patch | 75 + .../all/test_package/CMakeLists.txt | 8 + .../coin-utils/all/test_package/conanfile.py | 30 + .../all/test_package/test_package.cpp | 40 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/coin-utils/config.yml | 5 + recipes/commata/all/conandata.yml | 7 + recipes/commata/all/conanfile.py | 67 + .../commata/all/test_package/CMakeLists.txt | 8 + recipes/commata/all/test_package/conanfile.py | 26 + .../commata/all/test_package/test_package.cpp | 58 + .../all/test_v1_package/CMakeLists.txt | 8 + .../commata/all/test_v1_package/conanfile.py | 18 + recipes/commata/config.yml | 5 + recipes/concurrencpp/all/conandata.yml | 20 + recipes/concurrencpp/all/conanfile.py | 101 + .../all/patches/cmake-min-version.patch | 8 + .../all/patches/directory-name-0.1.5.patch | 14 + .../all/patches/directory-name-0.1.6.patch | 14 + .../all/patches/directory-name.patch | 14 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/concurrencpp/config.yml | 7 + recipes/concurrentqueue/all/conandata.yml | 10 + recipes/concurrentqueue/all/conanfile.py | 51 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/concurrentqueue/config.yml | 7 + recipes/confu_json/all/conandata.yml | 13 + recipes/confu_json/all/conanfile.py | 87 + .../all/test_package/CMakeLists.txt | 12 + .../confu_json/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/confu_json/config.yml | 9 + recipes/continuable/all/conandata.yml | 10 + recipes/continuable/all/conanfile.py | 92 + .../all/test_package/CMakeLists.txt | 14 + .../continuable/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 9 + recipes/continuable/config.yml | 7 + recipes/corrade/all/CMakeLists.txt | 7 + .../all/cmake/conan-corrade-vars.cmake | 61 + recipes/corrade/all/conandata.yml | 14 + recipes/corrade/all/conanfile.py | 189 + .../2020.06/0001-emscripten-toolchain.patch | 49 + .../corrade/all/test_package/CMakeLists.txt | 24 + recipes/corrade/all/test_package/conanfile.py | 28 + .../corrade/all/test_package/test_package.cpp | 23 + recipes/corrade/config.yml | 5 + recipes/cose-c/all/CMakeLists.txt | 11 + recipes/cose-c/all/conandata.yml | 8 + recipes/cose-c/all/conanfile.py | 94 + .../all/patches/001-fix-cmake-targets.patch | 17 + .../cose-c/all/test_package/CMakeLists.txt | 11 + recipes/cose-c/all/test_package/conanfile.py | 17 + .../cose-c/all/test_package/test_package.cpp | 20 + recipes/cose-c/config.yml | 4 + recipes/cotila/all/conandata.yml | 4 + recipes/cotila/all/conanfile.py | 66 + .../cotila/all/test_package/CMakeLists.txt | 11 + recipes/cotila/all/test_package/conanfile.py | 17 + .../cotila/all/test_package/test_package.cpp | 7 + recipes/cotila/config.yml | 3 + recipes/coz/all/CMakeLists.txt | 7 + recipes/coz/all/conandata.yml | 4 + recipes/coz/all/conanfile.py | 62 + recipes/coz/all/test_package/CMakeLists.txt | 8 + recipes/coz/all/test_package/conanfile.py | 19 + recipes/coz/all/test_package/test_package.c | 11 + recipes/coz/config.yml | 3 + recipes/cpp-httplib/all/conandata.yml | 43 + recipes/cpp-httplib/all/conanfile.py | 83 + .../all/test_package/CMakeLists.txt | 8 + .../cpp-httplib/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cpp-httplib/config.yml | 29 + recipes/cpp-ipc/all/CMakeLists.txt | 7 + recipes/cpp-ipc/all/conandata.yml | 7 + recipes/cpp-ipc/all/conanfile.py | 87 + .../cpp-ipc/all/test_package/CMakeLists.txt | 11 + recipes/cpp-ipc/all/test_package/conanfile.py | 17 + .../cpp-ipc/all/test_package/test_package.cpp | 7 + recipes/cpp-ipc/config.yml | 5 + recipes/cpp-jwt/all/conandata.yml | 17 + recipes/cpp-jwt/all/conanfile.py | 92 + .../patches/001-fix-msvc-14-compilation.patch | 22 + .../cpp-jwt/all/test_package/CMakeLists.txt | 8 + recipes/cpp-jwt/all/test_package/conanfile.py | 26 + .../cpp-jwt/all/test_package/test_package.cpp | 22 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cpp-jwt/all/test_v1_package/conanfile.py | 17 + recipes/cpp-jwt/config.yml | 7 + recipes/cpp-lazy/all/conandata.yml | 13 + recipes/cpp-lazy/all/conanfile.py | 59 + .../all/patches/0001-support-gcc5.patch | 297 ++ .../cpp-lazy/all/test_package/CMakeLists.txt | 8 + .../cpp-lazy/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cpp-lazy/all/test_v1_package/conanfile.py | 18 + recipes/cpp-lazy/config.yml | 5 + recipes/cpp-optparse/all/CMakeLists.txt | 14 + recipes/cpp-optparse/all/conandata.yml | 4 + recipes/cpp-optparse/all/conanfile.py | 62 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cpp-optparse/config.yml | 3 + recipes/cpp-peglib/0.x.x/conandata.yml | 4 + recipes/cpp-peglib/0.x.x/conanfile.py | 46 + .../0.x.x/test_package/CMakeLists.txt | 8 + .../0.x.x/test_package/conanfile.py | 25 + .../0.x.x/test_package/test_package.cpp | 49 + .../0.x.x/test_v1_package/CMakeLists.txt | 11 + .../0.x.x/test_v1_package/conanfile.py | 17 + recipes/cpp-peglib/1.x.x/conandata.yml | 37 + recipes/cpp-peglib/1.x.x/conanfile.py | 82 + .../1.x.x/test_package/CMakeLists.txt | 8 + .../1.x.x/test_package/conanfile.py | 26 + .../1.x.x/test_package/test_package.cpp | 51 + .../1.x.x/test_v1_package/CMakeLists.txt | 8 + .../1.x.x/test_v1_package/conanfile.py | 17 + recipes/cpp-peglib/config.yml | 27 + recipes/cpp-sort/all/conandata.yml | 43 + recipes/cpp-sort/all/conanfile.py | 105 + .../cpp-sort/all/test_package/CMakeLists.txt | 9 + .../cpp-sort/all/test_package/conanfile.py | 26 + .../all/test_package/cpp-sort-integrity.cpp | 22 + .../all/test_v1_package/CMakeLists.txt | 9 + .../cpp-sort/all/test_v1_package/conanfile.py | 17 + recipes/cpp-sort/config.yml | 29 + recipes/cpp-taskflow/all/conandata.yml | 7 + recipes/cpp-taskflow/all/conanfile.py | 73 + .../all/test_package/CMakeLists.txt | 14 + .../all/test_package/conanfile.py | 20 + .../all/test_package/test_package.cpp | 27 + recipes/cpp-taskflow/config.yml | 5 + .../cpp_project_framework/all/conandata.yml | 4 + .../cpp_project_framework/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 18 + .../all/test_package/conanfile.py | 20 + .../all/test_package/test_package.cpp | 30 + recipes/cpp_project_framework/config.yml | 3 + recipes/cppbenchmark/all/conandata.yml | 23 + recipes/cppbenchmark/all/conanfile.py | 98 + .../all/patches/1.0.0.0-0001-fix-cmake.patch | 82 + .../all/patches/1.0.3.0-0001-fix-cmake.patch | 82 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cppbenchmark/config.yml | 7 + recipes/cppcheck/all/conandata.yml | 61 + recipes/cppcheck/all/conanfile.py | 70 + .../0001-cli-remove-dmake-cmake-2.10.patch | 15 + .../0001-cli-remove-dmake-cmake-2.8.patch | 14 + .../patches/0001-cli-remove-dmake-cmake.patch | 14 + .../all/patches/0002-htmlreport-python3.patch | 10 + .../patches/0003-pcre-debuglib-name-2.7.patch | 28 + .../all/patches/0003-pcre-debuglib-name.patch | 11 + .../cppcheck/all/test_package/conanfile.py | 19 + .../all/test_package/file_to_check.cpp | 3 + .../cppcheck/all/test_v1_package/conanfile.py | 17 + .../all/test_v1_package/file_to_check.cpp | 3 + recipes/cppcheck/config.yml | 11 + recipes/cppcmd/all/conandata.yml | 4 + recipes/cppcmd/all/conanfile.py | 67 + .../cppcmd/all/test_package/CMakeLists.txt | 9 + recipes/cppcmd/all/test_package/conanfile.py | 17 + recipes/cppcmd/all/test_package/main.cpp | 21 + recipes/cppcmd/config.yml | 3 + recipes/cppcodec/all/conandata.yml | 4 + recipes/cppcodec/all/conanfile.py | 48 + .../cppcodec/all/test_package/CMakeLists.txt | 8 + .../cppcodec/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 11 + .../cppcodec/all/test_v1_package/conanfile.py | 17 + recipes/cppcodec/config.yml | 3 + recipes/cppcommon/all/CMakeLists.txt | 11 + recipes/cppcommon/all/conandata.yml | 43 + recipes/cppcommon/all/conanfile.py | 99 + .../0001-update-cmakelists-1-0-0-0.patch | 128 + .../0001-update-cmakelists-1-0-1-0.patch | 139 + .../0001-update-cmakelists-1-0-3-0.patch | 133 + .../0002-fix-cross-platform-issues.patch | 64 + .../0003-define-win32-winnt-1-0-1-0.patch | 33 + ...0003-define-win32-winnt-cci-20201104.patch | 21 + .../cppcommon/all/test_package/CMakeLists.txt | 10 + .../cppcommon/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 56 + recipes/cppcommon/config.yml | 11 + recipes/cppfront/all/CMakeLists.txt | 9 + recipes/cppfront/all/conandata.yml | 10 + recipes/cppfront/all/conanfile.py | 83 + .../cppfront/all/test_package/conanfile.py | 24 + .../all/test_package/pure2-hello.cpp2 | 13 + .../cppfront/all/test_v1_package/conanfile.py | 20 + recipes/cppfront/config.yml | 7 + recipes/cppitertools/all/conandata.yml | 4 + recipes/cppitertools/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 17 + .../all/test_package/conanfile.py | 23 + .../all/test_package/test_package.cpp | 29 + .../all/test_package/test_zip_longest.cpp | 26 + recipes/cppitertools/config.yml | 3 + recipes/cppkafka/all/conandata.yml | 9 + recipes/cppkafka/all/conanfile.py | 101 + .../all/patches/0001-no-template-export.patch | 45 + .../cppkafka/all/patches/0002-cppstd.patch | 20 + .../all/patches/0003-clean-rpath.patch | 11 + .../cppkafka/all/test_package/CMakeLists.txt | 8 + .../cppkafka/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cppkafka/all/test_v1_package/conanfile.py | 16 + recipes/cppkafka/config.yml | 3 + recipes/cpprestsdk/all/conandata.yml | 42 + recipes/cpprestsdk/all/conanfile.py | 154 + .../all/patches/0001-find-cmake-targets.patch | 117 + .../all/patches/0002-remove-wconversion.patch | 28 + .../all/patches/0003-find-cmake-targets.patch | 127 + .../all/test_package/CMakeLists.txt | 8 + .../cpprestsdk/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cpprestsdk/config.yml | 9 + recipes/cppserver/all/conandata.yml | 41 + recipes/cppserver/all/conanfile.py | 106 + .../patches/0001-cmake-clean-up-1-0-0-0.patch | 143 + .../patches/0001-cmake-clean-up-1-0-1-0.patch | 130 + .../patches/0001-cmake-clean-up-1-0-2-0.patch | 133 + .../0002-define-win32-winnt-1-0-0-0.patch | 15 + .../0002-define-win32-winnt-1-0-1-0.patch | 15 + .../0002-define-win32-winnt-1-0-2-0.patch | 15 + .../0003-remove-asio-defines-1-0-0-0.patch | 13 + .../cppserver/all/test_package/CMakeLists.txt | 8 + .../cppserver/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/cppserver/config.yml | 7 + recipes/cpptoml/all/conandata.yml | 4 + recipes/cpptoml/all/conanfile.py | 66 + .../cpptoml/all/test_package/CMakeLists.txt | 8 + recipes/cpptoml/all/test_package/conanfile.py | 26 + .../cpptoml/all/test_package/test_package.cpp | 72 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cpptoml/all/test_v1_package/conanfile.py | 17 + recipes/cpptoml/config.yml | 3 + recipes/cppunit/all/conandata.yml | 4 + recipes/cppunit/all/conanfile.py | 125 + .../cppunit/all/test_package/CMakeLists.txt | 8 + recipes/cppunit/all/test_package/conanfile.py | 26 + .../cppunit/all/test_package/test_package.cpp | 134 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cppunit/all/test_v1_package/conanfile.py | 17 + recipes/cppunit/config.yml | 3 + recipes/cpputest/all/conandata.yml | 8 + recipes/cpputest/all/conanfile.py | 126 + .../cpputest/all/patches/0001-fix-cmake.patch | 15 + .../cpputest/all/test_package/CMakeLists.txt | 12 + .../cpputest/all/test_package/conanfile.py | 34 + .../all/test_package/test_package.cpp | 18 + .../test_package_with_extensions.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cpputest/all/test_v1_package/conanfile.py | 21 + recipes/cpputest/config.yml | 3 + recipes/cppzmq/all/conandata.yml | 16 + recipes/cppzmq/all/conanfile.py | 80 + .../cppzmq/all/test_package/CMakeLists.txt | 7 + recipes/cppzmq/all/test_package/conanfile.py | 26 + .../cppzmq/all/test_package/test_package.cpp | 14 + .../cppzmq/all/test_v1_package/CMakeLists.txt | 8 + .../cppzmq/all/test_v1_package/conanfile.py | 17 + recipes/cppzmq/config.yml | 11 + recipes/cpr/all/conandata.yml | 89 + recipes/cpr/all/conanfile.py | 266 ++ .../patches/002-1.4.0-create-install.patch | 14 + .../patches/003-1.4.0-curl-use-target.patch | 15 + .../patches/004-1.4.0-curl-global-scope.patch | 14 + .../005-1.5.2-fix-curl-components.patch | 21 + .../005-1.6.2-fix-curl-components.patch | 36 + .../005-1.7.2-fix-curl-components.patch | 19 + .../005-1.8.1-fix-curl-components.patch | 55 + .../005-1.9.0-fix-curl-components.patch | 21 + .../005-1.9.3-fix-curl-components.patch | 21 + .../cpr/all/patches/007-fix-dll-install.patch | 18 + .../008-1.10.0-remove-warning-flags.patch | 16 + .../008-1.7.2-remove-warning-flags.patch | 16 + .../008-1.8.1-remove-warning-flags.patch | 16 + .../008-1.9.3-remove-warning-flags.patch | 16 + recipes/cpr/all/test_package/CMakeLists.txt | 12 + recipes/cpr/all/test_package/conanfile.py | 26 + recipes/cpr/all/test_package/test_package.cpp | 12 + .../cpr/all/test_v1_package/CMakeLists.txt | 8 + recipes/cpr/all/test_v1_package/conanfile.py | 17 + recipes/cpr/config.yml | 19 + recipes/cprocessing/all/conandata.yml | 4 + recipes/cprocessing/all/conanfile.py | 84 + .../all/test_package/CMakeLists.txt | 11 + .../cprocessing/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 72 + recipes/cprocessing/config.yml | 3 + recipes/cpu_features/all/conandata.yml | 25 + recipes/cpu_features/all/conanfile.py | 91 + .../0.6.0-0001-fix-bundle-install.patch | 10 + .../0.7.0-0001-support-aarch64-macos.patch | 288 ++ .../0.8.0-0001-support-aarch64-macos.patch | 257 ++ .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 40 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cpu_features/config.yml | 7 + recipes/cpuinfo/all/conandata.yml | 7 + recipes/cpuinfo/all/conanfile.py | 88 + .../cpuinfo/all/test_package/CMakeLists.txt | 8 + recipes/cpuinfo/all/test_package/conanfile.py | 26 + .../cpuinfo/all/test_package/test_package.c | 23 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cpuinfo/all/test_v1_package/conanfile.py | 17 + recipes/cpuinfo/config.yml | 5 + recipes/cpython/all/conandata.yml | 72 + recipes/cpython/all/conanfile.py | 738 ++++ .../all/patches/2.7.18-0001-msvc.patch | 278 ++ .../2.7.18-0002-add-support-msvc-14.patch | 59 + .../patches/2.7.18-0003-msvc-fix-static.patch | 11 + .../2.7.18-0004-disable-macos-tcltk.patch | 15 + .../all/patches/3.10.0-0001-msvc.patch | 416 ++ .../all/patches/3.10.0-0003-_ctypes-ffi.patch | 50 + ...0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch | 15 + .../3.10.0-0005-disable-macos-tcltk.patch | 13 + .../cpython/all/patches/3.7.9-0001-msvc.patch | 416 ++ ...9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch | 15 + .../3.7.9-0003-disable-macos-tcltk.patch | 15 + .../all/patches/3.8.12-0001-msvc.patch | 431 ++ .../all/patches/3.8.12-0002-_ctypes-ffi.patch | 67 + ...2-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch | 15 + .../3.8.12-0004-disable-macos-tcltk.patch | 13 + .../cpython/all/patches/3.9.7-0001-msvc.patch | 434 ++ .../all/patches/3.9.7-0002-_msi-vcxproj.patch | 11 + .../all/patches/3.9.7-0003-_ctypes-ffi.patch | 51 + ...7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch | 15 + .../3.9.7-0005-disable-macos-tcltk.patch | 13 + .../3.x-0001-relocatable-python-config.patch | 11 + .../cpython/all/test_package/CMakeLists.txt | 100 + recipes/cpython/all/test_package/conanfile.py | 192 + .../all/test_package/py2/test_module.c | 42 + .../all/test_package/py2/test_package.c | 12 + .../all/test_package/py3/test_module.c | 52 + .../all/test_package/py3/test_package.c | 21 + recipes/cpython/all/test_package/setup.py | 31 + .../cpython/all/test_package/test_package.py | 213 + recipes/cpython/config.yml | 11 + recipes/cqrlib/all/CMakeLists.txt | 19 + recipes/cqrlib/all/conandata.yml | 4 + recipes/cqrlib/all/conanfile.py | 64 + .../cqrlib/all/test_package/CMakeLists.txt | 10 + recipes/cqrlib/all/test_package/conanfile.py | 27 + .../cqrlib/all/test_package/test_package.c | 7 + .../cqrlib/all/test_package/test_package.cpp | 6 + .../cqrlib/all/test_v1_package/CMakeLists.txt | 13 + .../cqrlib/all/test_v1_package/conanfile.py | 19 + recipes/cqrlib/config.yml | 3 + recipes/crashpad/all/conandata.yml | 49 + recipes/crashpad/all/conanfile.py | 307 ++ ...20210507-0001-fix-openssl-link-order.patch | 23 + ...20210507-0002-remove-fPIC-Werror-LTO.patch | 70 + ...cci.20210507-0003-compilers-from-env.patch | 14 + ...-conan-linux-syscall-support-package.patch | 14 + .../cci.20210507-0005-allow-all-archs.patch | 40 + ...07-0006-mini_chromium-win_helper-py3.patch | 96 + .../cci.20210507-0007-use-system-zlib.patch | 11 + ...20220219-0001-fix-openssl-link-order.patch | 22 + ...20220219-0002-remove-fPIC-Werror-LTO.patch | 50 + ...cci.20220219-0003-compilers-from-env.patch | 13 + ...-conan-linux-syscall-support-package.patch | 14 + .../cci.20220219-0005-allow-all-archs.patch | 40 + ...19-0006-mini_chromium-win_helper-py3.patch | 96 + ...0220219-0007-static-lib-tool_support.patch | 13 + .../crashpad/all/test_package/CMakeLists.txt | 9 + .../crashpad/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 54 + recipes/crashpad/config.yml | 5 + recipes/crc32c/all/conandata.yml | 7 + recipes/crc32c/all/conanfile.py | 85 + .../crc32c/all/test_package/CMakeLists.txt | 8 + recipes/crc32c/all/test_package/conanfile.py | 26 + .../crc32c/all/test_package/test_package.cpp | 20 + .../crc32c/all/test_v1_package/CMakeLists.txt | 8 + .../crc32c/all/test_v1_package/conanfile.py | 17 + recipes/crc32c/config.yml | 5 + recipes/crc_cpp/all/conandata.yml | 13 + recipes/crc_cpp/all/conanfile.py | 53 + .../crc_cpp/all/test_package/CMakeLists.txt | 11 + recipes/crc_cpp/all/test_package/conanfile.py | 18 + .../crc_cpp/all/test_package/test_package.cpp | 35 + recipes/crc_cpp/config.yml | 9 + recipes/create-dmg/all/conandata.yml | 12 + recipes/create-dmg/all/conanfile.py | 52 + .../patches/0001-change-share-to-res.patch | 13 + .../create-dmg/all/test_package/conanfile.py | 13 + .../all/test_v1_package/conanfile.py | 10 + recipes/create-dmg/config.yml | 5 + recipes/croncpp/all/CMakeLists.txt | 9 + recipes/croncpp/all/conandata.yml | 4 + recipes/croncpp/all/conanfile.py | 45 + .../croncpp/all/test_package/CMakeLists.txt | 11 + recipes/croncpp/all/test_package/conanfile.py | 16 + .../croncpp/all/test_package/test_package.cpp | 18 + recipes/croncpp/config.yml | 3 + recipes/crow/all/conandata.yml | 8 + recipes/crow/all/conanfile.py | 46 + .../all/patches/001-fix-cmake-errors.patch | 25 + recipes/crow/all/test_package/CMakeLists.txt | 9 + recipes/crow/all/test_package/conanfile.py | 17 + .../crow/all/test_package/test_package.cpp | 13 + recipes/crow/config.yml | 3 + recipes/crowcpp-crow/all/conandata.yml | 34 + recipes/crowcpp-crow/all/conanfile.py | 135 + .../0.2/0001-normalize-buildsystem.patch | 31 + .../all/patches/0.2/0002-replace-uint.patch | 26 + .../all/test_package/CMakeLists.txt | 16 + .../all/test_package/conanfile.py | 31 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/crowcpp-crow/config.yml | 17 + recipes/crunch/all/CMakeLists.txt | 124 + recipes/crunch/all/conandata.yml | 9 + recipes/crunch/all/conanfile.py | 66 + .../001_linux64_compilation_fixes.patch | 35 + .../all/patches/002_fix_clang_inline.patch | 11 + .../all/patches/003_fix_missing_cast.patch | 22 + .../crunch/all/test_package/CMakeLists.txt | 8 + recipes/crunch/all/test_package/conanfile.py | 28 + recipes/crunch/all/test_package/test.png | Bin 0 -> 177424 bytes .../crunch/all/test_package/test_package.cpp | 9 + .../crunch/all/test_v1_package/CMakeLists.txt | 8 + .../crunch/all/test_v1_package/conanfile.py | 19 + recipes/crunch/config.yml | 3 + recipes/cryptopp-pem/all/CMakeLists.txt | 11 + recipes/cryptopp-pem/all/conandata.yml | 20 + recipes/cryptopp-pem/all/conanfile.py | 161 + .../cryptopp-pem/all/patches/fix-cmake.patch | 11 + .../all/patches/link-to-cryptopp.patch | 15 + .../remove-cryptopp-sources-from-cmake.patch | 25 + .../all/patches/rename-output-library.patch | 136 + .../use-cryptopp-include-from-conan.patch | 172 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 27 + recipes/cryptopp-pem/config.yml | 3 + recipes/cryptopp/all/conandata.yml | 57 + recipes/cryptopp/all/conanfile.py | 188 + .../all/patches/8.2.0-0001-fix-cmake.patch | 11 + .../8.2.0-0002-relocatable-macos.patch | 10 + .../8.4.0-0001-relocatable-macos.patch | 10 + .../all/patches/8.6.0-0001-fix-cmake.patch | 13 + .../8.6.0-0002-relocatable-macos.patch | 10 + .../patches/8.7.0-0001-fix-msvc-arm64.patch | 35 + .../cryptopp/all/test_package/CMakeLists.txt | 7 + .../cryptopp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cryptopp/all/test_v1_package/conanfile.py | 17 + recipes/cryptopp/config.yml | 11 + recipes/cs_libguarded/all/conandata.yml | 10 + recipes/cs_libguarded/all/conanfile.py | 102 + .../all/test_package/CMakeLists.txt | 15 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/cs_libguarded/config.yml | 7 + recipes/csm/all/CMakeLists.txt | 33 + recipes/csm/all/conandata.yml | 4 + recipes/csm/all/conanfile.py | 46 + recipes/csm/all/test_package/CMakeLists.txt | 7 + recipes/csm/all/test_package/conanfile.py | 26 + recipes/csm/all/test_package/test_package.cpp | 6 + .../csm/all/test_v1_package/CMakeLists.txt | 8 + recipes/csm/all/test_v1_package/conanfile.py | 17 + recipes/csm/config.yml | 3 + recipes/cspice/all/CMakeLists.txt | 131 + recipes/cspice/all/conandata.yml | 122 + recipes/cspice/all/conanfile.py | 131 + recipes/cspice/all/patches/isatty.patch | 19 + .../cspice/all/patches/patches20171106.patch | 473 +++ .../cspice/all/test_package/CMakeLists.txt | 7 + recipes/cspice/all/test_package/conanfile.py | 26 + .../cspice/all/test_package/test_package.c | 19 + .../cspice/all/test_v1_package/CMakeLists.txt | 8 + .../cspice/all/test_v1_package/conanfile.py | 17 + recipes/cspice/config.yml | 5 + recipes/csvmonkey/all/conandata.yml | 4 + recipes/csvmonkey/all/conanfile.py | 78 + .../csvmonkey/all/test_package/CMakeLists.txt | 8 + .../csvmonkey/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/csvmonkey/config.yml | 3 + recipes/ctml/all/conandata.yml | 4 + recipes/ctml/all/conanfile.py | 42 + recipes/ctml/all/test_package/CMakeLists.txt | 11 + recipes/ctml/all/test_package/conanfile.py | 16 + .../ctml/all/test_package/test_package.cpp | 11 + recipes/ctml/config.yml | 3 + recipes/ctpg/all/conandata.yml | 10 + recipes/ctpg/all/conanfile.py | 59 + recipes/ctpg/all/test_package/CMakeLists.txt | 19 + recipes/ctpg/all/test_package/conanfile.py | 18 + .../ctpg/all/test_package/test_package.cpp | 37 + recipes/ctpg/config.yml | 7 + recipes/ctre/all/conandata.yml | 31 + recipes/ctre/all/conanfile.py | 64 + recipes/ctre/all/test_package/CMakeLists.txt | 9 + recipes/ctre/all/test_package/conanfile.py | 30 + .../ctre/all/test_package/test_package.cpp | 41 + .../ctre/all/test_v1_package/CMakeLists.txt | 7 + recipes/ctre/all/test_v1_package/conanfile.py | 16 + recipes/ctre/config.yml | 21 + recipes/cubicinterpolation/all/CMakeLists.txt | 7 + recipes/cubicinterpolation/all/conandata.yml | 21 + recipes/cubicinterpolation/all/conanfile.py | 106 + .../all/patches/patch_conanbuildinfo.diff | 24 + .../all/patches/rm_conan_basic_setup.diff | 15 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 22 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cubicinterpolation/config.yml | 7 + recipes/cuda-kat/all/conandata.yml | 4 + recipes/cuda-kat/all/conanfile.py | 54 + .../cuda-kat/all/test_package/CMakeLists.txt | 11 + .../cuda-kat/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 13 + recipes/cuda-kat/config.yml | 3 + recipes/cunit/all/conandata.yml | 10 + recipes/cunit/all/conanfile.py | 149 + .../0001-configure-in-msvc-shortcuts.patch | 39 + .../all/patches/0002-snprintf-msvc.patch | 11 + recipes/cunit/all/test_package/CMakeLists.txt | 8 + recipes/cunit/all/test_package/conanfile.py | 17 + recipes/cunit/all/test_package/test_package.c | 128 + recipes/cunit/config.yml | 3 + recipes/cute_headers/all/conandata.yml | 4 + recipes/cute_headers/all/conanfile.py | 39 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.c | 28 + recipes/cute_headers/config.yml | 3 + recipes/cvplot/all/conandata.yml | 4 + recipes/cvplot/all/conanfile.py | 35 + .../cvplot/all/test_package/CMakeLists.txt | 12 + recipes/cvplot/all/test_package/conanfile.py | 17 + .../cvplot/all/test_package/test_package.cpp | 9 + recipes/cvplot/config.yml | 3 + recipes/cwalk/all/conandata.yml | 32 + recipes/cwalk/all/conanfile.py | 103 + .../all/patches/0001-fix-cmake-1.0.0.patch | 29 + .../all/patches/0001-fix-cmake-1.1.0.patch | 29 + .../all/patches/0001-fix-cmake-1.2.2.patch | 29 + .../all/patches/0001-fix-cmake-1.2.5.patch | 12 + recipes/cwalk/all/test_package/CMakeLists.txt | 8 + recipes/cwalk/all/test_package/conanfile.py | 26 + recipes/cwalk/all/test_package/test_package.c | 12 + .../cwalk/all/test_v1_package/CMakeLists.txt | 8 + .../cwalk/all/test_v1_package/conanfile.py | 17 + recipes/cwalk/config.yml | 13 + recipes/cxxopts/all/conandata.yml | 13 + recipes/cxxopts/all/conanfile.py | 85 + .../cxxopts/all/test_package/CMakeLists.txt | 20 + recipes/cxxopts/all/test_package/conanfile.py | 31 + .../cxxopts/all/test_package/test_package.cpp | 64 + .../all/test_v1_package/CMakeLists.txt | 8 + .../cxxopts/all/test_v1_package/conanfile.py | 27 + recipes/cxxopts/config.yml | 9 + recipes/cyclonedds/all/conandata.yml | 9 + recipes/cyclonedds/all/conanfile.py | 172 + .../0.10.2-0001-fix-find-iceoryx.patch | 15 + .../all/test_package/CMakeLists.txt | 8 + .../cyclonedds/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cyclonedds/config.yml | 3 + recipes/cyrus-sasl/all/conandata.yml | 4 + recipes/cyrus-sasl/all/conanfile.py | 176 + .../all/test_package/CMakeLists.txt | 7 + .../cyrus-sasl/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/cyrus-sasl/config.yml | 3 + recipes/czmq/all/conandata.yml | 20 + recipes/czmq/all/conanfile.py | 161 + .../all/patches/4.2.0-0001-fix-cmake.patch | 167 + .../all/patches/4.2.1-0001-fix-cmake.patch | 200 + .../4.2.1-0002-fix-zsys_thread-issue.patch | 43 + recipes/czmq/all/test_package/CMakeLists.txt | 12 + recipes/czmq/all/test_package/conanfile.py | 26 + recipes/czmq/all/test_package/test_package.c | 20 + .../czmq/all/test_v1_package/CMakeLists.txt | 8 + recipes/czmq/all/test_v1_package/conanfile.py | 17 + recipes/czmq/config.yml | 5 + recipes/dacap-clip/all/conandata.yml | 4 + recipes/dacap-clip/all/conanfile.py | 114 + .../all/test_package/CMakeLists.txt | 8 + .../dacap-clip/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 19 + recipes/dacap-clip/config.yml | 3 + recipes/daggy/2.1/CMakeLists.txt | 12 + recipes/daggy/2.1/conandata.yml | 4 + recipes/daggy/2.1/conanfile.py | 138 + recipes/daggy/2.1/test_package/CMakeLists.txt | 15 + recipes/daggy/2.1/test_package/conanfile.py | 21 + recipes/daggy/2.1/test_package/test.cpp | 86 + recipes/daggy/config.yml | 3 + recipes/darknet/all/conandata.yml | 8 + recipes/darknet/all/conanfile.py | 98 + .../all/patches/include_conan_flags.patch | 59 + .../darknet/all/test_package/CMakeLists.txt | 11 + recipes/darknet/all/test_package/conanfile.py | 18 + recipes/darknet/all/test_package/example.cpp | 9 + recipes/darknet/config.yml | 3 + recipes/dataframe/all/conandata.yml | 39 + recipes/dataframe/all/conanfile.py | 160 + .../all/patches/2.0.0-0001-use-abs.patch | 37 + .../dataframe/all/test_package/CMakeLists.txt | 8 + .../dataframe/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 81 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/dataframe/config.yml | 23 + recipes/date/all/conandata.yml | 29 + recipes/date/all/conanfile.py | 140 + recipes/date/all/patches/0001-fix-uwp.patch | 17 + recipes/date/all/patches/cmake-3.0.0.patch | 14 + recipes/date/all/patches/cmake-3.0.1.patch | 14 + recipes/date/all/patches/cmake.patch | 19 + recipes/date/all/patches/string_view.patch | 13 + recipes/date/all/test_package/CMakeLists.txt | 11 + recipes/date/all/test_package/conanfile.py | 31 + .../date/all/test_package/test_package.cpp | 62 + .../date/all/test_v1_package/CMakeLists.txt | 8 + recipes/date/all/test_v1_package/conanfile.py | 18 + recipes/date/config.yml | 7 + recipes/dav1d/all/conandata.yml | 13 + recipes/dav1d/all/conanfile.py | 128 + recipes/dav1d/all/test_package/CMakeLists.txt | 7 + recipes/dav1d/all/test_package/conanfile.py | 26 + recipes/dav1d/all/test_package/test_package.c | 9 + .../dav1d/all/test_v1_package/CMakeLists.txt | 8 + .../dav1d/all/test_v1_package/conanfile.py | 17 + recipes/dav1d/config.yml | 9 + .../daw_header_libraries/all/conandata.yml | 34 + recipes/daw_header_libraries/all/conanfile.py | 78 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/daw_header_libraries/config.yml | 23 + recipes/daw_json_link/all/conandata.yml | 40 + recipes/daw_json_link/all/conanfile.py | 94 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 16 + recipes/daw_json_link/config.yml | 27 + recipes/daw_utf_range/all/conandata.yml | 10 + recipes/daw_utf_range/all/conanfile.py | 91 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 16 + recipes/daw_utf_range/config.yml | 7 + recipes/dbcppp/all/conandata.yml | 9 + recipes/dbcppp/all/conanfile.py | 111 + .../all/patches/0001-dep-cmake-rem-kcd.patch | 317 ++ .../dbcppp/all/test_package/CMakeLists.txt | 8 + recipes/dbcppp/all/test_package/conanfile.py | 25 + .../dbcppp/all/test_package/test_package.cpp | 27 + .../dbcppp/all/test_v1_package/CMakeLists.txt | 8 + .../dbcppp/all/test_v1_package/conanfile.py | 16 + recipes/dbcppp/config.yml | 3 + recipes/dbg-macro/all/conandata.yml | 4 + recipes/dbg-macro/all/conanfile.py | 43 + .../dbg-macro/all/test_package/CMakeLists.txt | 9 + .../dbg-macro/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 30 + recipes/dbg-macro/config.yml | 3 + recipes/dbus/1.x.x/conandata.yml | 30 + recipes/dbus/1.x.x/conanfile.py | 225 ++ .../1.x.x/patches/0001-cmake-project.patch | 23 + ...make_configure_checks_list_separator.patch | 22 + .../0003-meson-monotonic-clock-check.patch | 15 + .../dbus/1.x.x/test_package/CMakeLists.txt | 7 + recipes/dbus/1.x.x/test_package/conanfile.py | 27 + .../dbus/1.x.x/test_package/test_package.c | 13 + .../dbus/1.x.x/test_v1_package/CMakeLists.txt | 8 + .../dbus/1.x.x/test_v1_package/conanfile.py | 18 + recipes/dbus/config.yml | 9 + recipes/dcmtk/all/CMakeLists.txt | 7 + recipes/dcmtk/all/conandata.yml | 26 + recipes/dcmtk/all/conanfile.py | 322 ++ .../0001-cmake-use-conan-packages.patch | 253 ++ .../0002-cmake-use-conan-packages.patch | 225 ++ .../all/patches/cmake-patching-3-6-7.patch | 216 + recipes/dcmtk/all/test_package/CMakeLists.txt | 11 + recipes/dcmtk/all/test_package/conanfile.py | 19 + .../dcmtk/all/test_package/test_package.cpp | 29 + recipes/dcmtk/config.yml | 7 + recipes/dd-opentracing-cpp/all/CMakeLists.txt | 11 + recipes/dd-opentracing-cpp/all/conandata.yml | 8 + recipes/dd-opentracing-cpp/all/conanfile.py | 120 + .../patches/0001-Find-packages-setup.patch | 65 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 12 + recipes/dd-opentracing-cpp/config.yml | 3 + recipes/debug_assert/all/conandata.yml | 4 + recipes/debug_assert/all/conanfile.py | 35 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 17 + recipes/debug_assert/config.yml | 3 + recipes/decimal_for_cpp/all/conandata.yml | 4 + recipes/decimal_for_cpp/all/conanfile.py | 40 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/decimal_for_cpp/config.yml | 3 + recipes/deco/all/conandata.yml | 7 + recipes/deco/all/conanfile.py | 56 + recipes/deco/all/test_package/CMakeLists.txt | 11 + recipes/deco/all/test_package/conanfile.py | 18 + recipes/deco/all/test_package/example.cpp | 18 + recipes/deco/config.yml | 5 + recipes/depot_tools/all/conandata.yml | 9 + recipes/depot_tools/all/conanfile.py | 92 + .../all/patches/001-use-system-python.patch | 16 + .../depot_tools/all/test_package/conanfile.py | 7 + recipes/depot_tools/config.yml | 5 + recipes/detools/all/CMakeLists.txt | 9 + recipes/detools/all/conandata.yml | 4 + recipes/detools/all/conanfile.py | 65 + .../detools/all/test_package/CMakeLists.txt | 10 + recipes/detools/all/test_package/conanfile.py | 32 + recipes/detools/all/test_package/old | Bin 0 -> 2780 bytes recipes/detools/all/test_package/patch | Bin 0 -> 126 bytes .../detools/all/test_package/test_package.c | 23 + recipes/detools/config.yml | 3 + recipes/detours/all/CMakeLists.txt | 19 + recipes/detours/all/conandata.yml | 4 + recipes/detours/all/conanfile.py | 98 + .../detours/all/test_package/CMakeLists.txt | 25 + recipes/detours/all/test_package/conanfile.py | 22 + recipes/detours/all/test_package/hook.c | 40 + .../detours/all/test_package/hook_mingw.def | 3 + .../detours/all/test_package/hook_msvc.def | 3 + .../detours/all/test_package/test_package.c | 134 + recipes/detours/all/test_package/victim.c | 11 + recipes/detours/config.yml | 3 + recipes/di/all/BSL-1.0.txt | 23 + recipes/di/all/conandata.yml | 7 + recipes/di/all/conanfile.py | 61 + recipes/di/all/test_package/CMakeLists.txt | 9 + recipes/di/all/test_package/conanfile.py | 16 + recipes/di/all/test_package/example.cpp | 34 + recipes/di/config.yml | 5 + .../dice-template-library/all/CMakeLists.txt | 7 + .../dice-template-library/all/conandata.yml | 10 + .../dice-template-library/all/conanfile.py | 69 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 11 + recipes/dice-template-library/config.yml | 7 + recipes/diligent-core/all/CMakeLists.txt | 22 + recipes/diligent-core/all/conandata.yml | 59 + recipes/diligent-core/all/conanfile.py | 225 ++ .../0001-remove_warning_as_error.patch | 30 + .../patches/0002-use_conan_dependencies.patch | 93 + .../patches/0003-use_volk_from_conan.patch | 40 + .../0005-spirv-cross-namespace-override.patch | 142 + .../0006-install-linux-platform-header.diff | 120 + ...07-API250014-remove_warning_as_error.patch | 30 + ...se_conan_dependencies_in_third_party.patch | 100 + .../0010-API250014-use_volk_from_conan.patch | 40 + ...50014-use-vulkan-headers-in-archiver.patch | 14 + .../all/patches/0014-252-exclude-tests.patch | 13 + ...15-252-dont-install-3d-party-license.patch | 78 + .../patches/0016-252-fix-glslang-usage.patch | 28 + .../0017-252-fix-glslang-include.patch | 13 + .../0018-252-fix-warning-as-error.patch | 21 + .../0023-252003-fix-warning-as-error.patch | 12 + .../all/test_package/CMakeLists.txt | 24 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 43 + recipes/diligent-core/config.yml | 15 + recipes/diligent-fx/all/BuildUtils.cmake | 399 ++ recipes/diligent-fx/all/CMakeLists.txt | 14 + recipes/diligent-fx/all/conandata.yml | 32 + recipes/diligent-fx/all/conanfile.py | 121 + .../patches/0001-use-conan-dependencies.diff | 18 + recipes/diligent-fx/all/script.py | 58 + .../all/test_package/CMakeLists.txt | 11 + .../diligent-fx/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/diligent-fx/config.yml | 11 + recipes/diligent-tools/all/BuildUtils.cmake | 399 ++ recipes/diligent-tools/all/CMakeLists.txt | 33 + recipes/diligent-tools/all/conandata.yml | 44 + recipes/diligent-tools/all/conanfile.py | 165 + .../patches/0001-use-imgui-from-conan.diff | 56 + .../patches/0002-use-conan-dependencies.diff | 131 + .../0003-fix-diligent-core-include-paths.diff | 122 + .../all/patches/0005-fix-include-path.diff | 13 + .../0006-2.5.2-use-imgui-from-conan.diff | 21 + ...-2.5.2-use-diligent-core-dependencies.diff | 97 + .../0008-2.5.2-use-conan-dependencies.diff | 18 + .../patches/0009-2.5.2-fix-include-path.diff | 13 + ...2.5.2-fix-render-state-notation-paths.diff | 43 + ...11-2.5.2-use-conan-dependencies-part2.diff | 35 + .../0012-2.5.2-fix-imgui-include-path.diff | 26 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 8 + recipes/diligent-tools/config.yml | 9 + .../all/CMakeLists.txt | 7 + .../all/conandata.yml | 4 + .../all/conanfile.py | 59 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 43 + .../diligentgraphics-spirv-headers/config.yml | 3 + .../all/CMakeLists.txt | 7 + .../all/conandata.yml | 4 + .../all/conanfile.py | 223 ++ ...upport-SPV_KHR_fragment_shading_rate.patch | 243 ++ .../all/test_package/CMakeLists.txt | 23 + .../all/test_package/conanfile.py | 20 + .../all/test_package/test_package.c | 31 + .../all/test_package/test_package.cpp | 65 + .../diligentgraphics-spirv-tools/config.yml | 3 + .../all/conandata.yml | 4 + .../all/conanfile.py | 49 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 21 + .../config.yml | 3 + recipes/dime/all/CMakeLists.txt | 7 + recipes/dime/all/conandata.yml | 4 + recipes/dime/all/conanfile.py | 96 + recipes/dime/all/test_package/CMakeLists.txt | 11 + recipes/dime/all/test_package/conanfile.py | 17 + .../dime/all/test_package/testFile_Bug01.dxf | 104 + .../dime/all/test_package/test_package.cpp | 24 + recipes/dime/config.yml | 3 + .../directshowbaseclasses/all/CMakeLists.txt | 27 + .../directshowbaseclasses/all/conandata.yml | 4 + .../directshowbaseclasses/all/conanfile.py | 40 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 20 + recipes/directshowbaseclasses/config.yml | 3 + recipes/dirent/all/conandata.yml | 4 + recipes/dirent/all/conanfile.py | 47 + .../dirent/all/test_package/CMakeLists.txt | 7 + recipes/dirent/all/test_package/conanfile.py | 25 + .../dirent/all/test_package/test_package.cpp | 97 + .../dirent/all/test_v1_package/CMakeLists.txt | 8 + .../dirent/all/test_v1_package/conanfile.py | 18 + recipes/dirent/config.yml | 3 + recipes/discount/all/conandata.yml | 8 + recipes/discount/all/conanfile.py | 89 + .../all/patches/0001-fix-cmake-install.patch | 14 + .../patches/0002-fix-incomplete-type.patch | 11 + .../discount/all/test_package/CMakeLists.txt | 7 + .../discount/all/test_package/conanfile.py | 26 + .../discount/all/test_package/test_package.c | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../discount/all/test_v1_package/conanfile.py | 17 + recipes/discount/config.yml | 3 + recipes/djinni-generator/all/conandata.yml | 31 + recipes/djinni-generator/all/conanfile.py | 37 + .../all/test_package/conanfile.py | 21 + recipes/djinni-generator/config.yml | 21 + .../djinni-support-lib/1.x.x/CMakeLists.txt | 11 + .../djinni-support-lib/1.x.x/conandata.yml | 13 + recipes/djinni-support-lib/1.x.x/conanfile.py | 145 + .../1.x.x/test_package/CMakeLists.txt | 9 + .../1.x.x/test_package/conanfile.py | 19 + .../1.x.x/test_package/test_package.cpp | 11 + recipes/djinni-support-lib/all/CMakeLists.txt | 11 + recipes/djinni-support-lib/all/conandata.yml | 9 + recipes/djinni-support-lib/all/conanfile.py | 93 + .../all/patches/cmake_install.patch | 16 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 19 + .../all/test_package/test_package.cpp | 11 + recipes/djinni-support-lib/config.yml | 11 + recipes/dlib/all/CMakeLists.txt | 8 + recipes/dlib/all/conandata.yml | 13 + recipes/dlib/all/conanfile.py | 193 + recipes/dlib/all/test_package/CMakeLists.txt | 11 + recipes/dlib/all/test_package/conanfile.py | 17 + .../dlib/all/test_package/test_package.cpp | 36 + recipes/dlib/config.yml | 9 + recipes/dlpack/all/conandata.yml | 10 + recipes/dlpack/all/conanfile.py | 41 + .../dlpack/all/test_package/CMakeLists.txt | 7 + recipes/dlpack/all/test_package/conanfile.py | 27 + .../dlpack/all/test_package/test_package.cpp | 18 + .../dlpack/all/test_v1_package/CMakeLists.txt | 8 + .../dlpack/all/test_v1_package/conanfile.py | 19 + recipes/dlpack/config.yml | 7 + recipes/docopt.cpp/all/conandata.yml | 25 + recipes/docopt.cpp/all/conanfile.py | 127 + .../all/patches/cmake-library-0.6.2.patch | 58 + .../all/patches/cmake-library-0.6.3.patch | 62 + .../all/patches/include-stdexcept.patch | 11 + .../all/patches/msvc-dll-export-0.6.2.patch | 43 + .../all/patches/msvc-dll-export-0.6.3.patch | 41 + .../all/test_package/CMakeLists.txt | 12 + .../docopt.cpp/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 37 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/docopt.cpp/config.yml | 5 + recipes/doctest/2.x.x/conandata.yml | 43 + recipes/doctest/2.x.x/conanfile.py | 55 + .../doctest/2.x.x/test_package/CMakeLists.txt | 8 + .../doctest/2.x.x/test_package/conanfile.py | 26 + .../2.x.x/test_package/test_package.cpp | 6 + .../2.x.x/test_v1_package/CMakeLists.txt | 8 + .../2.x.x/test_v1_package/conanfile.py | 17 + recipes/doctest/config.yml | 29 + recipes/double-conversion/all/conandata.yml | 19 + recipes/double-conversion/all/conanfile.py | 66 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/double-conversion/config.yml | 13 + recipes/doxygen/all/conandata.yml | 45 + recipes/doxygen/all/conanfile.py | 108 + .../doxygen/all/patches/1.8-0001-xapian.patch | 13 + .../patches/1.9.1-0001-imported-target.patch | 70 + .../patches/1.9.2-0001-imported-target.patch | 17 + .../1.9.4-0001-enable-modern-compilers.patch | 25 + .../doxygen/all/test_package/CMakeLists.txt | 8 + recipes/doxygen/all/test_package/conanfile.py | 28 + .../doxygen/all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../doxygen/all/test_v1_package/conanfile.py | 22 + recipes/doxygen/config.yml | 13 + recipes/draco/all/conandata.yml | 37 + recipes/draco/all/conanfile.py | 154 + .../all/patches/0001-fix-cmake-1.3.5.patch | 24 + .../all/patches/0001-fix-cmake-1.3.6.patch | 24 + .../all/patches/0001-fix-cmake-1.4.3.patch | 19 + .../all/patches/0001-fix-cmake-1.5.2.patch | 17 + .../all/patches/0002-v1.3.5-gcc-11.patch | 24 + .../all/patches/0002-v1.3.6-gcc-11.patch | 25 + .../0003-non-copy-ellision-workaround.patch | 15 + recipes/draco/all/test_package/CMakeLists.txt | 8 + recipes/draco/all/test_package/conanfile.py | 26 + .../draco/all/test_package/test_package.cpp | 124 + .../draco/all/test_v1_package/CMakeLists.txt | 8 + .../draco/all/test_v1_package/conanfile.py | 17 + recipes/draco/config.yml | 17 + recipes/dragonbox/all/conandata.yml | 9 + recipes/dragonbox/all/conanfile.py | 98 + .../patches/1.1.3-fix-include-directory.patch | 13 + .../dragonbox/all/test_package/CMakeLists.txt | 9 + .../dragonbox/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 23 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/dragonbox/config.yml | 3 + recipes/drflac/all/CMakeLists.txt | 49 + recipes/drflac/all/conandata.yml | 9 + recipes/drflac/all/conanfile.py | 95 + recipes/drflac/all/dr_flac.c | 3 + .../drflac/all/test_package/CMakeLists.txt | 8 + recipes/drflac/all/test_package/conanfile.py | 26 + .../drflac/all/test_package/test_package.c | 9 + .../drflac/all/test_v1_package/CMakeLists.txt | 8 + .../drflac/all/test_v1_package/conanfile.py | 17 + recipes/drflac/config.yml | 5 + recipes/drmp3/all/CMakeLists.txt | 33 + recipes/drmp3/all/conandata.yml | 9 + recipes/drmp3/all/conanfile.py | 72 + recipes/drmp3/all/dr_mp3.c | 3 + recipes/drmp3/all/test_package/CMakeLists.txt | 8 + recipes/drmp3/all/test_package/conanfile.py | 26 + recipes/drmp3/all/test_package/test_package.c | 9 + .../drmp3/all/test_v1_package/CMakeLists.txt | 8 + .../drmp3/all/test_v1_package/conanfile.py | 17 + recipes/drmp3/config.yml | 5 + recipes/drogon/all/conandata.yml | 62 + recipes/drogon/all/conanfile.py | 179 + .../patches/1.7.5-0001-disable_trantor.patch | 29 + .../1.7.5-0002-remove-boost-components.patch | 14 + .../1.7.5-0003-find-package-trantor.patch | 14 + .../1.7.5-0004-find-package-jsoncpp.patch | 17 + .../1.8.0-0001-disable-unused-data.patch | 41 + .../1.8.0-0002-find-package-jsoncpp.patch | 17 + .../1.8.0-0003-find-package-sqlite.patch | 13 + .../1.8.2-0003-find-package-sqlite.patch | 13 + .../1.8.3-0003-find-package-sqlite.patch | 13 + .../drogon/all/test_package/CMakeLists.txt | 15 + recipes/drogon/all/test_package/conanfile.py | 25 + .../drogon/all/test_package/test_package.cpp | 14 + .../drogon/all/test_v1_package/CMakeLists.txt | 8 + .../drogon/all/test_v1_package/conanfile.py | 16 + recipes/drogon/config.yml | 9 + recipes/drwav/all/CMakeLists.txt | 37 + recipes/drwav/all/conandata.yml | 9 + recipes/drwav/all/conanfile.py | 77 + recipes/drwav/all/dr_wav.c | 3 + recipes/drwav/all/test_package/CMakeLists.txt | 8 + recipes/drwav/all/test_package/conanfile.py | 26 + recipes/drwav/all/test_package/test_package.c | 9 + .../drwav/all/test_v1_package/CMakeLists.txt | 8 + .../drwav/all/test_v1_package/conanfile.py | 17 + recipes/drwav/config.yml | 5 + recipes/dtl/all/conandata.yml | 10 + recipes/dtl/all/conanfile.py | 28 + recipes/dtl/all/test_package/CMakeLists.txt | 10 + recipes/dtl/all/test_package/conanfile.py | 17 + recipes/dtl/all/test_package/test_package.cpp | 10 + recipes/dtl/config.yml | 7 + recipes/duckdb/all/conandata.yml | 39 + recipes/duckdb/all/conanfile.py | 203 + .../all/patches/0.5.1-0001-fix-cmake.patch | 82 + .../all/patches/0.6.0-0001-fix-cmake.patch | 58 + .../patches/0.6.0-0002-include-stdlib.patch | 12 + .../all/patches/0.7.0-0001-fix-cmake.patch | 61 + .../duckdb/all/test_package/CMakeLists.txt | 8 + recipes/duckdb/all/test_package/conanfile.py | 25 + .../duckdb/all/test_package/test_package.cpp | 7 + .../duckdb/all/test_v1_package/CMakeLists.txt | 8 + .../duckdb/all/test_v1_package/conanfile.py | 18 + recipes/duckdb/config.yml | 9 + recipes/duktape/all/CMakeLists.txt | 23 + recipes/duktape/all/conandata.yml | 10 + recipes/duktape/all/conanfile.py | 74 + .../duktape/all/test_package/CMakeLists.txt | 9 + recipes/duktape/all/test_package/conanfile.py | 17 + .../duktape/all/test_package/test_package.c | 42 + recipes/duktape/config.yml | 7 + recipes/eabase/all/conandata.yml | 10 + recipes/eabase/all/conanfile.py | 59 + .../eabase/all/test_package/CMakeLists.txt | 8 + recipes/eabase/all/test_package/conanfile.py | 27 + .../eabase/all/test_package/test_package.cpp | 47 + .../eabase/all/test_v1_package/CMakeLists.txt | 8 + .../eabase/all/test_v1_package/conanfile.py | 19 + recipes/eabase/config.yml | 7 + recipes/earcut/all/conandata.yml | 10 + recipes/earcut/all/conanfile.py | 72 + .../earcut/all/test_package/CMakeLists.txt | 8 + recipes/earcut/all/test_package/conanfile.py | 26 + recipes/earcut/all/test_package/example.cpp | 33 + .../earcut/all/test_v1_package/CMakeLists.txt | 8 + .../earcut/all/test_v1_package/conanfile.py | 18 + recipes/earcut/config.yml | 7 + recipes/eastl/all/CMakeLists.txt | 9 + recipes/eastl/all/conandata.yml | 50 + recipes/eastl/all/conanfile.py | 116 + ...1-cmake-shared-use-conan-add-install.patch | 22 + ...1-cmake-shared-use-conan-add-install.patch | 26 + .../3.17.03-0002-revert-c++14-constexpr.patch | 18 + recipes/eastl/all/test_package/CMakeLists.txt | 9 + recipes/eastl/all/test_package/conanfile.py | 17 + .../eastl/all/test_package/test_package.cpp | 9 + recipes/eastl/config.yml | 15 + recipes/easy_profiler/all/conandata.yml | 9 + recipes/easy_profiler/all/conanfile.py | 149 + .../0001-fix-cmake-bundle-install.patch | 10 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/example.cpp | 55 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/easy_profiler/config.yml | 3 + recipes/easyexif/all/CMakeLists.txt | 19 + recipes/easyexif/all/conandata.yml | 4 + recipes/easyexif/all/conanfile.py | 58 + .../easyexif/all/test_package/CMakeLists.txt | 10 + .../easyexif/all/test_package/conanfile.py | 17 + recipes/easyexif/all/test_package/example.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 10 + .../easyexif/all/test_v1_package/conanfile.py | 18 + recipes/easyexif/config.yml | 3 + recipes/easyhttpcpp/all/conandata.yml | 12 + recipes/easyhttpcpp/all/conanfile.py | 125 + .../0001-fix-cmake-config-in-path.patch | 11 + .../all/patches/0002-use-poco-targets.patch | 27 + .../all/test_package/CMakeLists.txt | 8 + .../easyhttpcpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 76 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/easyhttpcpp/config.yml | 3 + recipes/easyloggingpp/all/CMakeLists.txt | 67 + recipes/easyloggingpp/all/conandata.yml | 4 + recipes/easyloggingpp/all/conanfile.py | 121 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 20 + recipes/easyloggingpp/config.yml | 3 + recipes/easylzma/all/CMakeLists.txt | 7 + recipes/easylzma/all/conandata.yml | 11 + recipes/easylzma/all/conanfile.py | 72 + .../all/patches/cmake-no-cflags.patch | 27 + .../easylzma/all/patches/memleaksfix.patch | 74 + .../easylzma/all/test_package/CMakeLists.txt | 8 + .../easylzma/all/test_package/conanfile.py | 16 + .../easylzma/all/test_package/test_package.c | 33 + recipes/easylzma/config.yml | 3 + recipes/ecos/all/conandata.yml | 8 + recipes/ecos/all/conanfile.py | 88 + recipes/ecos/all/patches/0001-fix-cmake.patch | 15 + .../all/patches/0002-missing-include.patch | 10 + recipes/ecos/all/test_package/CMakeLists.txt | 7 + recipes/ecos/all/test_package/conanfile.py | 26 + recipes/ecos/all/test_package/test_package.c | 8 + .../ecos/all/test_v1_package/CMakeLists.txt | 10 + recipes/ecos/all/test_v1_package/conanfile.py | 17 + recipes/ecos/config.yml | 3 + recipes/editline/all/conandata.yml | 4 + recipes/editline/all/conanfile.py | 90 + .../editline/all/test_package/CMakeLists.txt | 7 + .../editline/all/test_package/conanfile.py | 32 + .../editline/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../editline/all/test_v1_package/conanfile.py | 17 + recipes/editline/config.yml | 3 + recipes/edlib/all/conandata.yml | 10 + recipes/edlib/all/conanfile.py | 112 + .../cmake-install-and-export-symbols.patch | 114 + recipes/edlib/all/test_package/CMakeLists.txt | 7 + recipes/edlib/all/test_package/conanfile.py | 26 + recipes/edlib/all/test_package/test_package.c | 10 + .../edlib/all/test_v1_package/CMakeLists.txt | 8 + .../edlib/all/test_v1_package/conanfile.py | 17 + recipes/edlib/config.yml | 5 + recipes/edyn/all/conandata.yml | 4 + recipes/edyn/all/conanfile.py | 109 + recipes/edyn/all/test_package/CMakeLists.txt | 8 + recipes/edyn/all/test_package/conanfile.py | 25 + .../edyn/all/test_package/test_package.cpp | 11 + .../edyn/all/test_v1_package/CMakeLists.txt | 8 + recipes/edyn/all/test_v1_package/conanfile.py | 17 + recipes/edyn/config.yml | 3 + recipes/effcee/all/conandata.yml | 7 + recipes/effcee/all/conanfile.py | 85 + .../effcee/all/patches/0001-fix-cmake.patch | 35 + .../effcee/all/test_package/CMakeLists.txt | 8 + recipes/effcee/all/test_package/conanfile.py | 26 + .../effcee/all/test_package/test_package.cpp | 7 + .../effcee/all/test_v1_package/CMakeLists.txt | 8 + .../effcee/all/test_v1_package/conanfile.py | 17 + recipes/effcee/config.yml | 3 + recipes/effolkronium-random/all/conandata.yml | 10 + recipes/effolkronium-random/all/conanfile.py | 31 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/effolkronium-random/config.yml | 7 + recipes/egl-headers/all/conandata.yml | 4 + recipes/egl-headers/all/conanfile.py | 46 + .../all/test_package/CMakeLists.txt | 7 + .../egl-headers/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/egl-headers/config.yml | 3 + recipes/egl/config.yml | 3 + recipes/egl/system/conanfile.py | 53 + .../egl/system/test_package/CMakeLists.txt | 10 + recipes/egl/system/test_package/conanfile.py | 26 + .../egl/system/test_package/test_package.c | 33 + .../egl/system/test_v1_package/CMakeLists.txt | 8 + .../egl/system/test_v1_package/conanfile.py | 17 + recipes/eigen/all/conandata.yml | 32 + recipes/eigen/all/conanfile.py | 81 + ...assert-exception-upstream-issue-2011.patch | 46 + .../patches/0002-cmake-minimum-required.patch | 10 + .../patches/3.4.0-0001-vec-reduce-half.patch | 49 + recipes/eigen/all/test_package/CMakeLists.txt | 7 + recipes/eigen/all/test_package/conanfile.py | 25 + .../eigen/all/test_package/test_package.cpp | 16 + .../eigen/all/test_v1_package/CMakeLists.txt | 8 + .../eigen/all/test_v1_package/conanfile.py | 18 + recipes/eigen/config.yml | 9 + recipes/elfio/all/conandata.yml | 13 + recipes/elfio/all/conanfile.py | 53 + recipes/elfio/all/test_package/CMakeLists.txt | 8 + recipes/elfio/all/test_package/conanfile.py | 26 + .../elfio/all/test_package/test_package.cpp | 14 + .../elfio/all/test_v1_package/CMakeLists.txt | 8 + .../elfio/all/test_v1_package/conanfile.py | 17 + recipes/elfio/config.yml | 9 + recipes/elfutils/all/conandata.yml | 18 + recipes/elfutils/all/conanfile.py | 235 ++ ...1-Add-enable-werror-configure-option.patch | 41 + ...dd-enable-static-option-to-configure.patch | 29 + ...1-Add-enable-werror-configure-option.patch | 41 + ...dd-enable-static-option-to-configure.patch | 29 + .../elfutils/all/test_package/CMakeLists.txt | 8 + .../elfutils/all/test_package/conanfile.py | 25 + .../elfutils/all/test_package/test_package.c | 84 + recipes/elfutils/config.yml | 5 + recipes/embree3/all/conandata.yml | 34 + recipes/embree3/all/conanfile.py | 276 ++ .../3.12.x-0001-cmake-minimum-required.patch | 17 + .../3.13.x-0001-cmake-minimum-required.patch | 17 + .../embree3/all/test_package/CMakeLists.txt | 7 + recipes/embree3/all/test_package/conanfile.py | 26 + .../embree3/all/test_package/test_package.cpp | 49 + .../all/test_v1_package/CMakeLists.txt | 8 + .../embree3/all/test_v1_package/conanfile.py | 17 + recipes/embree3/config.yml | 9 + recipes/emsdk/all/conandata.yml | 61 + recipes/emsdk/all/conanfile.py | 196 + recipes/emsdk/all/test_package/CMakeLists.txt | 4 + recipes/emsdk/all/test_package/conanfile.py | 40 + .../emsdk/all/test_package/test_package.cpp | 8 + .../emsdk/all/test_v1_package/CMakeLists.txt | 7 + .../emsdk/all/test_v1_package/conanfile.py | 30 + recipes/emsdk/config.yml | 41 + recipes/enchant/all/CMakeLists.txt | 102 + recipes/enchant/all/conandata.yml | 18 + recipes/enchant/all/conanfile.py | 57 + recipes/enchant/all/configmake.h | 13 + recipes/enchant/all/configure.cmake | 42 + .../0001-add-visibility-annotations.patch | 283 ++ .../patches/0002-remove-strchrnul-usage.patch | 33 + .../all/patches/0003-fix-file-locking.patch | 100 + .../patches/0004-fix-ssize_t-in-headers.patch | 13 + .../all/patches/0005-fix-relocatable.patch | 10 + .../all/patches/0006-add-macos-support.patch | 51 + .../enchant/all/test_package/CMakeLists.txt | 10 + recipes/enchant/all/test_package/conanfile.py | 18 + .../enchant/all/test_package/test_package.c | 48 + recipes/enchant/config.yml | 3 + recipes/enet/all/conandata.yml | 22 + recipes/enet/all/conanfile.py | 71 + recipes/enet/all/patches/fix-cmake.patch | 32 + recipes/enet/all/test_package/CMakeLists.txt | 7 + recipes/enet/all/test_package/conanfile.py | 26 + recipes/enet/all/test_package/test_package.c | 11 + .../enet/all/test_v1_package/CMakeLists.txt | 8 + recipes/enet/all/test_v1_package/conanfile.py | 17 + recipes/enet/config.yml | 9 + .../all/conandata.yml | 4 + .../all/conanfile.py | 50 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.cpp | 123 + .../enhex-generic_serialization/config.yml | 3 + recipes/enhex-strong_type/all/conandata.yml | 4 + recipes/enhex-strong_type/all/conanfile.py | 50 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.cpp | 12 + recipes/enhex-strong_type/config.yml | 3 + recipes/enjincppsdk/all/CMakeLists.txt | 7 + recipes/enjincppsdk/all/conandata.yml | 13 + recipes/enjincppsdk/all/conanfile.py | 136 + .../all/test_package/CMakeLists.txt | 11 + .../enjincppsdk/all/test_package/conanfile.py | 19 + .../all/test_package/test_package.cpp | 90 + recipes/enjincppsdk/config.yml | 9 + recipes/enkits/all/CMakeLists.txt | 7 + recipes/enkits/all/conandata.yml | 20 + recipes/enkits/all/conanfile.py | 70 + .../patches/cmake-install-lib-location.patch | 5 + .../enkits/all/test_package/CMakeLists.txt | 9 + recipes/enkits/all/test_package/conanfile.py | 16 + .../enkits/all/test_package/test_package.cpp | 7 + recipes/enkits/config.yml | 7 + recipes/entityx/all/conandata.yml | 7 + recipes/entityx/all/conanfile.py | 81 + .../patches/0001-cmake-not-force-libcpp.patch | 55 + .../entityx/all/test_package/CMakeLists.txt | 8 + recipes/entityx/all/test_package/conanfile.py | 26 + .../entityx/all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../entityx/all/test_v1_package/conanfile.py | 17 + recipes/entityx/config.yml | 3 + recipes/entt/3.x.x/conandata.yml | 67 + recipes/entt/3.x.x/conanfile.py | 79 + .../patches/0001-3.11.0-fix-gcc-7.0-7.3.patch | 20 + .../entt/3.x.x/test_package/CMakeLists.txt | 11 + recipes/entt/3.x.x/test_package/conanfile.py | 26 + .../entt/3.x.x/test_package/test_package.cpp | 66 + .../entt/3.x.x/test_v1_package/CMakeLists.txt | 8 + .../entt/3.x.x/test_v1_package/conanfile.py | 17 + recipes/entt/config.yml | 39 + recipes/enum-flags/all/conandata.yml | 4 + recipes/enum-flags/all/conanfile.py | 64 + .../all/test_package/CMakeLists.txt | 8 + .../enum-flags/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/enum-flags/config.yml | 3 + recipes/erikzenker-hsm/all/conandata.yml | 10 + recipes/erikzenker-hsm/all/conanfile.py | 71 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 62 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/erikzenker-hsm/config.yml | 7 + recipes/erkir/all/conandata.yml | 25 + recipes/erkir/all/conanfile.py | 87 + .../patches/1.0.0-0001-remove-testing.patch | 24 + .../patches/1.0.0-0002-export-symbols.patch | 13 + ...0.0-0001-remove-specify-architecture.patch | 13 + .../all/patches/2.0.0-0002-fix-cmake.patch | 20 + .../patches/2.0.0-0003-fix-erkir_export.patch | 28 + recipes/erkir/all/test_package/CMakeLists.txt | 9 + recipes/erkir/all/test_package/conanfile.py | 26 + .../erkir/all/test_package/test_package.cpp | 27 + .../erkir/all/test_v1_package/CMakeLists.txt | 8 + .../erkir/all/test_v1_package/conanfile.py | 18 + recipes/erkir/config.yml | 5 + recipes/etc2comp/all/CMakeLists.txt | 7 + recipes/etc2comp/all/conandata.yml | 8 + recipes/etc2comp/all/conanfile.py | 74 + recipes/etc2comp/all/patches/fix-cmake.patch | 34 + .../etc2comp/all/test_package/CMakeLists.txt | 9 + .../etc2comp/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 16 + recipes/etc2comp/config.yml | 3 + recipes/eternal/all/conandata.yml | 4 + recipes/eternal/all/conanfile.py | 69 + .../eternal/all/test_package/CMakeLists.txt | 9 + recipes/eternal/all/test_package/conanfile.py | 26 + .../eternal/all/test_package/test_package.cpp | 41 + .../all/test_v1_package/CMakeLists.txt | 12 + .../eternal/all/test_v1_package/conanfile.py | 18 + recipes/eternal/config.yml | 3 + recipes/etl/all/conandata.yml | 37 + recipes/etl/all/conanfile.py | 68 + recipes/etl/all/test_package/CMakeLists.txt | 8 + recipes/etl/all/test_package/conanfile.py | 24 + recipes/etl/all/test_package/test_package.cpp | 6 + .../etl/all/test_v1_package/CMakeLists.txt | 11 + recipes/etl/all/test_v1_package/conanfile.py | 18 + recipes/etl/config.yml | 25 + recipes/exiv2/all/conandata.yml | 21 + recipes/exiv2/all/conanfile.py | 167 + .../exiv2/all/patches/0001-link-0.27.5.patch | 29 + recipes/exiv2/all/patches/0001-link.patch | 26 + recipes/exiv2/all/patches/0002-fpic.patch | 16 + recipes/exiv2/all/patches/0003-fix-ios.patch | 30 + .../exiv2/all/patches/0004-find-expat.patch | 15 + recipes/exiv2/all/test_package/CMakeLists.txt | 7 + recipes/exiv2/all/test_package/conanfile.py | 26 + .../exiv2/all/test_package/test_package.cpp | 7 + .../exiv2/all/test_v1_package/CMakeLists.txt | 8 + .../exiv2/all/test_v1_package/conanfile.py | 17 + recipes/exiv2/config.yml | 5 + recipes/expat/all/conandata.yml | 40 + recipes/expat/all/conanfile.py | 97 + .../0001-2.3.0-relax-vs-restriction.patch | 13 + recipes/expat/all/test_package/CMakeLists.txt | 7 + recipes/expat/all/test_package/conanfile.py | 26 + recipes/expat/all/test_package/test_package.c | 64 + .../all/test_package_module/CMakeLists.txt | 22 + .../all/test_package_module/conanfile.py | 26 + .../expat/all/test_v1_package/CMakeLists.txt | 8 + .../expat/all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package_module/CMakeLists.txt | 8 + .../all/test_v1_package_module/conanfile.py | 18 + recipes/expat/config.yml | 25 + recipes/expected-lite/all/conandata.yml | 22 + recipes/expected-lite/all/conanfile.py | 54 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 30 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/expected-lite/config.yml | 15 + recipes/exprtk/all/conandata.yml | 8 + recipes/exprtk/all/conanfile.py | 52 + .../exprtk/all/test_package/CMakeLists.txt | 15 + recipes/exprtk/all/test_package/conanfile.py | 26 + .../exprtk/all/test_package/test_package.cpp | 78 + .../exprtk/all/test_v1_package/CMakeLists.txt | 8 + .../exprtk/all/test_v1_package/conanfile.py | 18 + recipes/exprtk/config.yml | 5 + recipes/extra-cmake-modules/all/conandata.yml | 13 + recipes/extra-cmake-modules/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 21 + .../all/test_package/conanfile.py | 17 + .../all/test_package/example.cpp | 6 + .../all/test_package/foo.h | 5 + recipes/extra-cmake-modules/config.yml | 9 + recipes/ezc3d/all/conandata.yml | 15 + recipes/ezc3d/all/conanfile.py | 113 + .../all/patches/0001-fix-cmake-1.3.8.patch | 35 + .../all/patches/0001-fix-cmake-1.4.8.patch | 35 + recipes/ezc3d/all/test_package/CMakeLists.txt | 8 + recipes/ezc3d/all/test_package/conanfile.py | 26 + .../ezc3d/all/test_package/test_package.cpp | 6 + .../ezc3d/all/test_v1_package/CMakeLists.txt | 8 + .../ezc3d/all/test_v1_package/conanfile.py | 17 + recipes/ezc3d/config.yml | 7 + recipes/faac/all/conandata.yml | 16 + recipes/faac/all/conanfile.py | 191 + .../1.30-0001-fix-out-of-root-build.patch | 29 + .../patches/1.30-0002-dont-hardcode-x86.patch | 74 + .../patches/1.30-0003-relax-windows-sdk.patch | 40 + recipes/faac/all/test_package/CMakeLists.txt | 7 + recipes/faac/all/test_package/conanfile.py | 26 + recipes/faac/all/test_package/test_package.c | 21 + .../faac/all/test_v1_package/CMakeLists.txt | 8 + recipes/faac/all/test_v1_package/conanfile.py | 17 + recipes/faac/config.yml | 3 + recipes/fakeit/all/conandata.yml | 28 + recipes/fakeit/all/conanfile.py | 73 + .../fakeit/all/test_package/CMakeLists.txt | 8 + recipes/fakeit/all/test_package/conanfile.py | 26 + .../fakeit/all/test_package/test_package.cpp | 30 + .../fakeit/all/test_v1_package/CMakeLists.txt | 8 + .../fakeit/all/test_v1_package/conanfile.py | 18 + recipes/fakeit/config.yml | 19 + recipes/farmhash/all/CMakeLists.txt | 33 + recipes/farmhash/all/conandata.yml | 4 + recipes/farmhash/all/conanfile.py | 63 + .../farmhash/all/test_package/CMakeLists.txt | 7 + .../farmhash/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../farmhash/all/test_v1_package/conanfile.py | 17 + recipes/farmhash/config.yml | 3 + recipes/fast-cdr/all/conandata.yml | 19 + recipes/fast-cdr/all/conanfile.py | 107 + .../fast-cdr/all/test_package/CMakeLists.txt | 8 + .../fast-cdr/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 74 + .../all/test_v1_package/CMakeLists.txt | 8 + .../fast-cdr/all/test_v1_package/conanfile.py | 17 + recipes/fast-cdr/config.yml | 13 + recipes/fast-cpp-csv-parser/all/conandata.yml | 10 + recipes/fast-cpp-csv-parser/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 20 + .../all/test_package/test_package.csv | 3 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/fast-cpp-csv-parser/config.yml | 7 + recipes/fast-dds/all/conandata.yml | 23 + recipes/fast-dds/all/conanfile.py | 190 + ....3.2-0001-fix-find-asio-and-tinyxml2.patch | 46 + ....3.X-0001-fix-find-asio-and-tinyxml2.patch | 46 + .../fast-dds/all/test_package/CMakeLists.txt | 13 + .../fast-dds/all/test_package/conanfile.py | 26 + .../all/test_package/msg/HelloWorld.cxx | 207 + .../all/test_package/msg/HelloWorld.h | 206 + .../all/test_package/msg/HelloWorld.idl | 5 + .../msg/HelloWorldPubSubTypes.cxx | 133 + .../test_package/msg/HelloWorldPubSubTypes.h | 57 + .../all/test_package/test_package.cpp | 56 + .../all/test_v1_package/CMakeLists.txt | 8 + .../fast-dds/all/test_v1_package/conanfile.py | 16 + recipes/fast-dds/config.yml | 7 + recipes/fast_double_parser/all/conandata.yml | 10 + recipes/fast_double_parser/all/conanfile.py | 38 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/fast_double_parser/config.yml | 7 + recipes/fast_float/all/conandata.yml | 43 + recipes/fast_float/all/conanfile.py | 52 + .../all/test_package/CMakeLists.txt | 8 + .../fast_float/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/fast_float/config.yml | 29 + recipes/fastpfor/all/conandata.yml | 17 + recipes/fastpfor/all/conanfile.py | 82 + .../patches/cci.20220205-0001-fix-cmake.patch | 72 + .../patches/cci.20221225-0001-fix-cmake.patch | 71 + .../fastpfor/all/test_package/CMakeLists.txt | 8 + .../fastpfor/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../fastpfor/all/test_v1_package/conanfile.py | 17 + recipes/fastpfor/config.yml | 5 + recipes/fastprng/all/conandata.yml | 4 + recipes/fastprng/all/conanfile.py | 40 + .../fastprng/all/test_package/CMakeLists.txt | 8 + .../fastprng/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../fastprng/all/test_v1_package/conanfile.py | 16 + recipes/fastprng/config.yml | 3 + recipes/fcl/all/conandata.yml | 15 + recipes/fcl/all/conanfile.py | 134 + .../all/patches/0001-fix-cmake-0.6.1.patch | 22 + .../all/patches/0001-fix-cmake-0.7.0.patch | 22 + .../all/patches/0002-fix-mingw-bigobj.patch | 17 + .../0003-fix-alias-type-msvc2015.patch | 47 + recipes/fcl/all/test_package/CMakeLists.txt | 8 + recipes/fcl/all/test_package/conanfile.py | 26 + recipes/fcl/all/test_package/test_package.cpp | 78 + .../fcl/all/test_v1_package/CMakeLists.txt | 8 + recipes/fcl/all/test_v1_package/conanfile.py | 17 + recipes/fcl/config.yml | 5 + .../fernandovelcic-hexdump/all/conandata.yml | 4 + .../fernandovelcic-hexdump/all/conanfile.py | 24 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 34 + recipes/fernandovelcic-hexdump/config.yml | 3 + recipes/fff/all/conandata.yml | 4 + recipes/fff/all/conanfile.py | 26 + recipes/fff/all/test_package/CMakeLists.txt | 8 + recipes/fff/all/test_package/conanfile.py | 17 + recipes/fff/all/test_package/test_package.cpp | 16 + recipes/fff/config.yml | 3 + recipes/ffmpeg/all/conandata.yml | 30 + recipes/ffmpeg/all/conanfile.py | 980 +++++ .../5.0-0001-fix-hwcontext_vulkan.patch | 17 + .../ffmpeg/all/test_package/CMakeLists.txt | 35 + recipes/ffmpeg/all/test_package/conanfile.py | 26 + .../ffmpeg/all/test_package/test_package.c | 55 + .../ffmpeg/all/test_v1_package/CMakeLists.txt | 8 + .../ffmpeg/all/test_v1_package/conanfile.py | 20 + recipes/ffmpeg/config.yml | 13 + recipes/fft/all/CMakeLists.txt | 44 + recipes/fft/all/conandata.yml | 4 + recipes/fft/all/conanfile.py | 99 + recipes/fft/all/dct.h | 19 + recipes/fft/all/fft.h | 23 + recipes/fft/all/fft2.h | 22 + recipes/fft/all/fft3.h | 22 + recipes/fft/all/fft_build.c | 19 + recipes/fft/all/test_package/CMakeLists.txt | 10 + recipes/fft/all/test_package/conanfile.py | 26 + recipes/fft/all/test_package/test_package.c | 26 + .../fft/all/test_v1_package/CMakeLists.txt | 8 + recipes/fft/all/test_v1_package/conanfile.py | 17 + recipes/fft/config.yml | 3 + recipes/fftw/all/conandata.yml | 19 + recipes/fftw/all/conanfile.py | 133 + recipes/fftw/all/patches/fix-simd.patch | 43 + recipes/fftw/all/test_package/CMakeLists.txt | 24 + recipes/fftw/all/test_package/conanfile.py | 33 + recipes/fftw/all/test_package/test_package.c | 26 + .../fftw/all/test_v1_package/CMakeLists.txt | 8 + recipes/fftw/all/test_v1_package/conanfile.py | 20 + recipes/fftw/config.yml | 7 + recipes/fire-hpp/all/conandata.yml | 4 + recipes/fire-hpp/all/conanfile.py | 43 + .../fire-hpp/all/test_package/CMakeLists.txt | 11 + .../fire-hpp/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 9 + recipes/fire-hpp/config.yml | 3 + recipes/flac/all/conandata.yml | 16 + recipes/flac/all/conanfile.py | 114 + .../flac/all/patches/fix-cmake-1.3.3.patch | 66 + .../flac/all/patches/fix-cmake-1.4.2.patch | 38 + recipes/flac/all/test_package/CMakeLists.txt | 7 + recipes/flac/all/test_package/conanfile.py | 25 + .../flac/all/test_package/test_package.cpp | 21 + .../flac/all/test_v1_package/CMakeLists.txt | 10 + recipes/flac/all/test_v1_package/conanfile.py | 17 + recipes/flac/config.yml | 5 + recipes/flann/all/conandata.yml | 17 + recipes/flann/all/conanfile.py | 151 + ...0001-external-lz4-and-export-symbols.patch | 69 + .../patches/1.9.1-0002-support-cpp17.patch | 103 + .../patches/1.9.2-0001-cxx-11-required.patch | 28 + .../all/patches/1.9.2-0002-cmake-lz4.patch | 55 + recipes/flann/all/test_package/CMakeLists.txt | 11 + recipes/flann/all/test_package/conanfile.py | 26 + recipes/flann/all/test_package/test_package.c | 10 + .../flann/all/test_v1_package/CMakeLists.txt | 8 + .../flann/all/test_v1_package/conanfile.py | 17 + recipes/flann/config.yml | 5 + .../flatbuffers/all/cmake/FlatcTargets.cmake | 31 + recipes/flatbuffers/all/conandata.yml | 49 + recipes/flatbuffers/all/conanfile.py | 172 + .../0002-apple-no-universal-build.patch | 10 + .../0003-no-flatc-execution-build-time.patch | 18 + .../0004-no-flatc-execution-build-time.patch | 20 + .../all/test_package/CMakeLists.txt | 38 + .../flatbuffers/all/test_package/conanfile.py | 39 + .../flatbuffers/all/test_package/monster.fbs | 33 + .../all/test_package/sample_binary.cpp | 104 + .../all/test_package/test_package.cpp | 48 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 22 + recipes/flatbuffers/config.yml | 25 + recipes/flatbush/all/conandata.yml | 4 + recipes/flatbush/all/conanfile.py | 25 + .../flatbush/all/test_package/CMakeLists.txt | 12 + .../flatbush/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 33 + recipes/flatbush/config.yml | 3 + recipes/flatc/all/CMakeLists.txt | 10 + recipes/flatc/all/conandata.yml | 14 + recipes/flatc/all/conanfile.py | 64 + .../patches/0001-buildflatbuffers-cmake.patch | 13 + recipes/flatc/all/test_package/CMakeLists.txt | 12 + recipes/flatc/all/test_package/conanfile.py | 21 + .../flatc/all/test_package/test_package.cpp | 4 + .../flatc/all/test_package/test_package.fbs | 8 + recipes/flatc/config.yml | 7 + recipes/flatcc/all/CMakeLists.txt | 7 + recipes/flatcc/all/conandata.yml | 7 + recipes/flatcc/all/conanfile.py | 111 + .../flatcc/all/test_package/CMakeLists.txt | 33 + recipes/flatcc/all/test_package/conanfile.py | 35 + recipes/flatcc/all/test_package/monster.c | 350 ++ recipes/flatcc/all/test_package/monster.fbs | 32 + recipes/flatcc/config.yml | 5 + recipes/flecs/all/conandata.yml | 34 + recipes/flecs/all/conanfile.py | 90 + recipes/flecs/all/test_package/CMakeLists.txt | 11 + recipes/flecs/all/test_package/conanfile.py | 26 + recipes/flecs/all/test_package/test_package.c | 23 + .../flecs/all/test_v1_package/CMakeLists.txt | 8 + .../flecs/all/test_v1_package/conanfile.py | 17 + recipes/flecs/config.yml | 23 + recipes/flex/all/conandata.yml | 10 + recipes/flex/all/conanfile.py | 99 + .../all/patches/darwin-newer-versions.patch | 13 + recipes/flex/all/test_package/CMakeLists.txt | 9 + recipes/flex/all/test_package/basic_nr.l | 89 + recipes/flex/all/test_package/basic_nr.txt | 6 + recipes/flex/all/test_package/conanfile.py | 50 + .../flex/all/test_v1_package/CMakeLists.txt | 12 + recipes/flex/all/test_v1_package/basic_nr.l | 89 + recipes/flex/all/test_v1_package/basic_nr.txt | 6 + recipes/flex/all/test_v1_package/conanfile.py | 47 + recipes/flex/config.yml | 3 + recipes/flint/all/CMakeLists.txt | 7 + recipes/flint/all/conandata.yml | 18 + recipes/flint/all/conanfile.py | 91 + .../flint/all/patches/0001-cmake-2.8.1.patch | 63 + recipes/flint/all/patches/0001-cmake.patch | 63 + .../flint/all/patches/0002-msvc-alloca.patch | 13 + recipes/flint/all/test_package/CMakeLists.txt | 10 + recipes/flint/all/test_package/conanfile.py | 17 + .../flint/all/test_package/test_package.cpp | 6 + recipes/flint/config.yml | 5 + recipes/fltk/all/CMakeLists.txt | 7 + recipes/fltk/all/conandata.yml | 13 + recipes/fltk/all/conanfile.py | 139 + .../all/patches/1.3.8-0001-remove-fluid.patch | 20 + .../patches/1.3.8-0002-fix-resources.patch | 78 + ...3.8-0003-build-static-only-on-static.patch | 20 + recipes/fltk/all/test_package/CMakeLists.txt | 10 + recipes/fltk/all/test_package/conanfile.py | 16 + .../fltk/all/test_package/test_package.cpp | 12 + recipes/fltk/config.yml | 3 + recipes/fmt/all/conandata.yml | 28 + recipes/fmt/all/conanfile.py | 139 + .../fmt/all/patches/fix-install-5.3.0.patch | 13 + .../fmt/all/patches/fix-install-6.0.0.patch | 13 + ...gw-msvc2015-export-assert-fail-6.1.0.patch | 23 + recipes/fmt/all/test_package/CMakeLists.txt | 20 + recipes/fmt/all/test_package/conanfile.py | 31 + recipes/fmt/all/test_package/test_package.cpp | 62 + recipes/fmt/all/test_package/test_ranges.cpp | 11 + .../fmt/all/test_v1_package/CMakeLists.txt | 8 + recipes/fmt/all/test_v1_package/conanfile.py | 18 + recipes/fmt/config.yml | 17 + recipes/fmtlog/all/conandata.yml | 9 + recipes/fmtlog/all/conanfile.py | 119 + .../all/patches/2.2.1-0001-fix-cmake.patch | 39 + .../fmtlog/all/test_package/CMakeLists.txt | 9 + recipes/fmtlog/all/test_package/conanfile.py | 26 + .../fmtlog/all/test_package/test_package.cpp | 5 + .../fmtlog/all/test_v1_package/CMakeLists.txt | 12 + .../fmtlog/all/test_v1_package/conanfile.py | 18 + recipes/fmtlog/config.yml | 3 + recipes/folly/all/CMakeLists.txt | 7 + recipes/folly/all/conandata.yml | 56 + recipes/folly/all/conanfile.py | 307 ++ .../all/patches/0001-find-packages.patch | 93 + .../all/patches/0002-compiler-flags.patch | 24 + .../all/patches/0003-boost-shared-ptr.patch | 24 + .../patches/0004-disable-posix-names.patch | 27 + .../all/patches/0005-include-atomic.patch | 12 + .../all/patches/0006-duplicate-hash.patch | 13 + .../all/patches/0007-allow-builtins.patch | 128 + .../all/patches/0008-find-packages.patch | 73 + .../patches/0009-ill-formed-atomic-copy.patch | 13 + .../all/patches/0010-duplicate-hash.patch | 13 + .../patches/0011-disable-logger-example.patch | 12 + .../all/patches/0012-compiler-flags.patch | 24 + .../folly/all/patches/0013-include-bit.patch | 13 + .../folly/all/patches/0014-find-librt.patch | 18 + .../0015-benchmark-format-macros.patch | 15 + .../all/patches/0016-find-packages.patch | 80 + .../all/patches/0017-compiler-flags.patch | 24 + .../folly/all/patches/0018-find-glog.patch | 16 + .../all/patches/0019-exclude-example.patch | 12 + .../all/patches/0020-include-ssizet.patch | 12 + .../all/patches/0021-typedef-clockid.patch | 12 + .../all/patches/0022-fix-windows-minmax.patch | 12 + recipes/folly/all/test_package/CMakeLists.txt | 16 + recipes/folly/all/test_package/conanfile.py | 31 + .../folly/all/test_package/test_package.cpp | 29 + .../folly/all/test_v1_package/CMakeLists.txt | 17 + .../folly/all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package/test_package.cpp | 29 + recipes/folly/config.yml | 7 + recipes/fontconfig/all/conandata.yml | 7 + recipes/fontconfig/all/conanfile.py | 150 + .../all/test_package/CMakeLists.txt | 8 + .../fontconfig/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/fontconfig/config.yml | 9 + recipes/fontconfig/meson/conandata.yml | 13 + recipes/fontconfig/meson/conanfile.py | 142 + .../meson/patches/0001-meson-win32.patch | 19 + .../meson/test_package/CMakeLists.txt | 8 + .../meson/test_package/conanfile.py | 26 + .../meson/test_package/test_package.c | 24 + .../meson/test_v1_package/CMakeLists.txt | 9 + .../meson/test_v1_package/conanfile.py | 17 + recipes/foonathan-lexy/all/conandata.yml | 10 + recipes/foonathan-lexy/all/conanfile.py | 104 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 43 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/foonathan-lexy/config.yml | 7 + recipes/foonathan-memory/all/conandata.yml | 18 + recipes/foonathan-memory/all/conanfile.py | 134 + .../0.7.0-0001-fix-virtualAllocFromApp.patch | 22 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 69 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/foonathan-memory/config.yml | 9 + recipes/forestdb/all/CMakeLists.txt | 7 + recipes/forestdb/all/conandata.yml | 8 + recipes/forestdb/all/conanfile.py | 87 + .../patches/0001-proper-cxx-std-flag.patch | 25 + .../forestdb/all/test_package/CMakeLists.txt | 11 + .../forestdb/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 10 + recipes/forestdb/config.yml | 3 + recipes/foxglove-websocket/all/conandata.yml | 4 + recipes/foxglove-websocket/all/conanfile.py | 97 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 29 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 22 + recipes/foxglove-websocket/config.yml | 3 + recipes/foxi/all/conandata.yml | 7 + recipes/foxi/all/conanfile.py | 82 + .../all/patches/fix-conflicting-types.patch | 48 + recipes/foxi/all/test_package/CMakeLists.txt | 7 + recipes/foxi/all/test_package/conanfile.py | 25 + recipes/foxi/all/test_package/test_package.c | 14 + .../foxi/all/test_v1_package/CMakeLists.txt | 10 + recipes/foxi/all/test_v1_package/conanfile.py | 17 + recipes/foxi/config.yml | 3 + recipes/fp16/all/conandata.yml | 7 + recipes/fp16/all/conanfile.py | 41 + recipes/fp16/all/test_package/CMakeLists.txt | 8 + recipes/fp16/all/test_package/conanfile.py | 26 + recipes/fp16/all/test_package/test_package.c | 8 + .../fp16/all/test_v1_package/CMakeLists.txt | 11 + recipes/fp16/all/test_v1_package/conanfile.py | 17 + recipes/fp16/config.yml | 5 + recipes/fpgen/all/conandata.yml | 7 + recipes/fpgen/all/conanfile.py | 94 + recipes/fpgen/all/test_package/CMakeLists.txt | 11 + recipes/fpgen/all/test_package/conanfile.py | 18 + recipes/fpgen/all/test_package/main.cpp | 13 + recipes/fpgen/config.yml | 5 + recipes/freeglut/all/conandata.yml | 10 + recipes/freeglut/all/conanfile.py | 129 + .../freeglut/all/test_package/CMakeLists.txt | 12 + .../freeglut/all/test_package/conanfile.py | 27 + .../freeglut/all/test_package/test_package.c | 48 + .../all/test_package_module/CMakeLists.txt | 22 + .../all/test_package_module/conanfile.py | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../freeglut/all/test_v1_package/conanfile.py | 22 + .../all/test_v1_package_module/CMakeLists.txt | 8 + .../all/test_v1_package_module/conanfile.py | 22 + recipes/freeglut/config.yml | 7 + recipes/freeimage/all/CMakeLists.txt | 164 + recipes/freeimage/all/conandata.yml | 20 + recipes/freeimage/all/conanfile.py | 170 + ...ng-on-internal-third-party-libraries.patch | 136 + .../patches/002_fix-function-overload.patch | 40 + .../all/patches/003_use-external-jpeg.patch | 23 + .../all/patches/004_use-external-jxrlib.patch | 13 + .../patches/005_use-external-libtiff.patch | 204 + .../patches/006_use-external-openexr.patch | 44 + .../patches/007_use-external-openjpeg.patch | 39 + .../patches/008_use-external-png-zlib.patch | 40 + .../all/patches/009_use-external-rawlib.patch | 13 + .../all/patches/010_use-external-webp.patch | 17 + .../patches/011_update-libraw-support.patch | 149 + ...rride-libtiff-warning-error-handlers.patch | 31 + .../013_use-typedef-as-already-declared.patch | 15 + .../all/patches/014_no_auto_ptr.patch | 24 + .../freeimage/all/test_package/CMakeLists.txt | 7 + .../freeimage/all/test_package/conanfile.py | 27 + recipes/freeimage/all/test_package/test.png | Bin 0 -> 177424 bytes .../all/test_package/test_package.cpp | 53 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/freeimage/config.yml | 3 + recipes/freetype/all/conandata.yml | 26 + recipes/freetype/all/conanfile.py | 272 ++ .../patches/2.13.0-0001-fix-fallthrough.patch | 13 + .../freetype/all/test_package/CMakeLists.txt | 7 + .../all/test_package/OpenSans-Bold.ttf | Bin 0 -> 224592 bytes .../freetype/all/test_package/conanfile.py | 27 + .../freetype/all/test_package/test_package.c | 142 + .../all/test_package_module/CMakeLists.txt | 23 + .../all/test_package_module/conanfile.py | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../freetype/all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package_module/CMakeLists.txt | 8 + .../all/test_v1_package_module/conanfile.py | 18 + recipes/freetype/config.yml | 9 + recipes/freexl/all/conandata.yml | 13 + recipes/freexl/all/conanfile.py | 119 + .../freexl/all/patches/fix-nmake-1.0.5.patch | 35 + .../freexl/all/patches/fix-nmake-1.0.6.patch | 35 + .../all/patches/msvc-round-lround.patch | 11 + .../freexl/all/test_package/CMakeLists.txt | 7 + recipes/freexl/all/test_package/conanfile.py | 27 + .../freexl/all/test_package/simple2003_21.xls | Bin 0 -> 1102 bytes .../freexl/all/test_package/test_package.c | 317 ++ .../freexl/all/test_v1_package/CMakeLists.txt | 8 + .../freexl/all/test_v1_package/conanfile.py | 18 + recipes/freexl/config.yml | 5 + recipes/fribidi/all/conandata.yml | 13 + recipes/fribidi/all/conanfile.py | 106 + .../1.0.9-0001-meson-no-tests-bin.patch | 13 + .../fribidi/all/test_package/CMakeLists.txt | 7 + recipes/fribidi/all/test_package/conanfile.py | 26 + .../fribidi/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../fribidi/all/test_v1_package/conanfile.py | 17 + recipes/fribidi/config.yml | 7 + recipes/frozen/all/conandata.yml | 10 + recipes/frozen/all/conanfile.py | 67 + .../frozen/all/test_package/CMakeLists.txt | 8 + recipes/frozen/all/test_package/conanfile.py | 26 + .../frozen/all/test_package/test_package.cpp | 40 + .../frozen/all/test_v1_package/CMakeLists.txt | 8 + .../frozen/all/test_v1_package/conanfile.py | 17 + recipes/frozen/config.yml | 7 + recipes/frugally-deep/all/conandata.yml | 16 + recipes/frugally-deep/all/conanfile.py | 71 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 10 + recipes/frugally-deep/config.yml | 11 + recipes/fruit/all/conandata.yml | 64 + recipes/fruit/all/conanfile.py | 124 + .../all/patches/0001-fruit-3.4.0-cmake.patch | 201 + ...0002-remove-cmake-extra-target-3.5.0.patch | 37 + ...0002-remove-cmake-extra-target-3.6.0.patch | 37 + ...0002-remove-cmake-extra-target-3.7.0.patch | 37 + ...0002-remove-cmake-extra-target-3.7.1.patch | 37 + ...ke-multi-configuration-generator-3.7.patch | 91 + ...-cmake-multi-configuration-generator.patch | 87 + ...4-3.4.0-set-options-for-cmake-target.patch | 16 + .../0004-set-options-for-cmake-target.patch | 61 + recipes/fruit/all/test_package/CMakeLists.txt | 8 + recipes/fruit/all/test_package/conanfile.py | 26 + .../fruit/all/test_package/test_package.cpp | 55 + .../fruit/all/test_v1_package/CMakeLists.txt | 8 + .../fruit/all/test_v1_package/conanfile.py | 17 + recipes/fruit/config.yml | 11 + recipes/ftjam/all/conandata.yml | 12 + recipes/ftjam/all/conanfile.py | 127 + .../all/patches/0001-jam-2.5-overflow.patch | 74 + .../0002-msvc-mingw-fix-makefile.patch | 35 + .../all/patches/0003-missing-includes.patch | 26 + recipes/ftjam/all/test_package/Jamfile | 1 + recipes/ftjam/all/test_package/conanfile.py | 31 + recipes/ftjam/all/test_package/header.h | 6 + recipes/ftjam/all/test_package/main.c | 9 + recipes/ftjam/all/test_package/source.c | 5 + recipes/ftjam/config.yml | 3 + recipes/ftxui/all/conandata.yml | 27 + recipes/ftxui/all/conanfile.py | 121 + .../all/patches/2.0.0-0001-lib-prefix.patch | 23 + .../all/patches/2.0.0-0002-install-dll.patch | 10 + .../all/patches/4.0.0-0002-install-dll.patch | 12 + recipes/ftxui/all/test_package/CMakeLists.txt | 8 + recipes/ftxui/all/test_package/conanfile.py | 25 + .../ftxui/all/test_package/test_package.cpp | 24 + .../ftxui/all/test_v1_package/CMakeLists.txt | 8 + .../ftxui/all/test_v1_package/conanfile.py | 17 + recipes/ftxui/config.yml | 7 + recipes/function2/all/conandata.yml | 13 + recipes/function2/all/conanfile.py | 65 + .../function2/all/test_package/CMakeLists.txt | 11 + .../function2/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/function2/config.yml | 9 + recipes/functionalplus/all/conandata.yml | 19 + recipes/functionalplus/all/conanfile.py | 82 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/functionalplus/config.yml | 13 + .../all/CMakeLists.txt | 7 + .../functions-framework-cpp/all/conandata.yml | 8 + .../functions-framework-cpp/all/conanfile.py | 154 + .../all/patches/0001-dont-skip-namelink.patch | 10 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/functions-framework-cpp/config.yml | 3 + recipes/fusepp/all/CMakeLists.txt | 18 + recipes/fusepp/all/conandata.yml | 4 + recipes/fusepp/all/conanfile.py | 78 + .../fusepp/all/test_package/CMakeLists.txt | 10 + recipes/fusepp/all/test_package/conanfile.py | 17 + recipes/fusepp/all/test_package/example.cpp | 9 + recipes/fusepp/config.yml | 3 + recipes/fxdiv/all/conandata.yml | 4 + recipes/fxdiv/all/conanfile.py | 39 + recipes/fxdiv/all/test_package/CMakeLists.txt | 8 + recipes/fxdiv/all/test_package/conanfile.py | 26 + recipes/fxdiv/all/test_package/test_package.c | 17 + .../fxdiv/all/test_v1_package/CMakeLists.txt | 8 + .../fxdiv/all/test_v1_package/conanfile.py | 17 + recipes/fxdiv/config.yml | 3 + recipes/g3log/all/conandata.yml | 27 + recipes/g3log/all/conanfile.py | 170 + ...-0001-remove-explicit-stdlib-setting.patch | 57 + recipes/g3log/all/test_package/CMakeLists.txt | 12 + recipes/g3log/all/test_package/conanfile.py | 26 + .../g3log/all/test_package/test_package.cpp | 13 + .../g3log/all/test_v1_package/CMakeLists.txt | 8 + .../g3log/all/test_v1_package/conanfile.py | 17 + recipes/g3log/config.yml | 15 + recipes/gainput/all/conandata.yml | 7 + recipes/gainput/all/conanfile.py | 85 + .../gainput/all/patches/0001-fix-cmake.patch | 52 + .../gainput/all/test_package/CMakeLists.txt | 7 + recipes/gainput/all/test_package/conanfile.py | 26 + .../gainput/all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 10 + .../gainput/all/test_v1_package/conanfile.py | 17 + recipes/gainput/config.yml | 3 + .../gamenetworkingsockets/all/CMakeLists.txt | 7 + .../gamenetworkingsockets/all/conandata.yml | 10 + .../gamenetworkingsockets/all/conanfile.py | 126 + .../001-disable-runtime-override.patch | 13 + .../patches/002-either-static-or-shared.patch | 49 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 55 + recipes/gamenetworkingsockets/config.yml | 3 + recipes/gamma/all/CMakeLists.txt | 62 + recipes/gamma/all/conandata.yml | 4 + recipes/gamma/all/conanfile.py | 89 + recipes/gamma/all/test_package/CMakeLists.txt | 8 + recipes/gamma/all/test_package/conanfile.py | 26 + .../gamma/all/test_package/test_package.cpp | 85 + .../gamma/all/test_v1_package/CMakeLists.txt | 8 + .../gamma/all/test_v1_package/conanfile.py | 17 + recipes/gamma/config.yml | 3 + recipes/gcc/all/conandata.yml | 10 + recipes/gcc/all/conanfile.py | 188 + recipes/gcc/all/test_package/conanfile.py | 84 + recipes/gcc/all/test_package/hello.c | 8 + recipes/gcc/all/test_package/hello.cpp | 8 + recipes/gcc/all/test_package/hello.f90 | 4 + recipes/gcc/all/test_v1_package/conanfile.py | 34 + recipes/gcc/all/test_v1_package/hello.c | 8 + recipes/gcc/all/test_v1_package/hello.cpp | 8 + recipes/gcc/config.yml | 7 + recipes/gcem/all/conandata.yml | 13 + recipes/gcem/all/conanfile.py | 72 + recipes/gcem/all/test_package/CMakeLists.txt | 8 + recipes/gcem/all/test_package/conanfile.py | 26 + .../gcem/all/test_package/test_package.cpp | 22 + .../gcem/all/test_v1_package/CMakeLists.txt | 8 + recipes/gcem/all/test_v1_package/conanfile.py | 17 + recipes/gcem/config.yml | 9 + recipes/gdal/config.yml | 15 + recipes/gdal/post_3.5.0/CMakeLists.txt | 117 + recipes/gdal/post_3.5.0/conandata.yml | 14 + recipes/gdal/post_3.5.0/conanfile.py | 899 +++++ .../3.5.1/0-replace-find-package.patch | 266 ++ .../3.5.2/0-replace-find-package.patch | 266 ++ .../post_3.5.0/test_package/CMakeLists.txt | 14 + .../gdal/post_3.5.0/test_package/conanfile.py | 23 + .../post_3.5.0/test_package/test_package.c | 58 + .../post_3.5.0/test_package/test_package.cpp | 54 + recipes/gdal/pre_3.5.0/conandata.yml | 49 + recipes/gdal/pre_3.5.0/conanfile.py | 934 +++++ .../patches/3.1.x/fix-autotools-3.1.4.patch | 283 ++ .../patches/3.1.x/fix-import-dll-msvc.patch | 15 + .../patches/3.1.x/fix-include-jsonc.patch | 104 + .../patches/3.1.x/fix-include-podofo.patch | 11 + .../3.1.x/fix-include-xerces-3.1.2.patch | 63 + .../patches/3.1.x/fix-nmake-common.patch | 165 + .../patches/3.1.x/fix-nmake-opt-3.1.2.patch | 14 + .../patches/3.2.x/fix-autotools.patch | 304 ++ .../patches/3.2.x/fix-include-jsonc.patch | 104 + .../patches/3.2.x/fix-include-podofo.patch | 11 + .../patches/3.2.x/fix-include-xerces.patch | 63 + .../pre_3.5.0/patches/3.2.x/fix-nmake.patch | 179 + .../patches/3.3.x/fix-autotools-3.3.3.patch | 302 ++ .../patches/3.3.x/fix-include-jsonc.patch | 104 + .../patches/3.3.x/fix-include-podofo.patch | 11 + .../patches/3.3.x/fix-include-xerces.patch | 63 + .../pre_3.5.0/patches/3.3.x/fix-nmake.patch | 179 + .../patches/3.4.x/fix-autotools-3.4.1.patch | 333 ++ .../patches/3.4.x/fix-autotools-3.4.3.patch | 333 ++ .../3.4.x/fix-include-jsonc-3.4.1.patch | 104 + .../3.4.x/fix-include-jsonc-3.4.3.patch | 104 + .../patches/3.4.x/fix-include-podofo.patch | 11 + .../patches/3.4.x/fix-include-xerces.patch | 48 + .../pre_3.5.0/patches/3.4.x/fix-nmake.patch | 168 + .../pre_3.5.0/test_package/CMakeLists.txt | 11 + .../gdal/pre_3.5.0/test_package/conanfile.py | 30 + .../pre_3.5.0/test_package/test_package.c | 58 + .../pre_3.5.0/test_package/test_package.cpp | 54 + .../pre_3.5.0/test_v1_package/CMakeLists.txt | 8 + .../pre_3.5.0/test_v1_package/conanfile.py | 21 + recipes/gdbm/all/conandata.yml | 22 + recipes/gdbm/all/conanfile.py | 143 + .../0001-fix-multiple-definitions.patch | 11 + recipes/gdbm/all/test_package/CMakeLists.txt | 7 + recipes/gdbm/all/test_package/conanfile.py | 27 + recipes/gdbm/all/test_package/test_package.c | 62 + .../gdbm/all/test_v1_package/CMakeLists.txt | 8 + recipes/gdbm/all/test_v1_package/conanfile.py | 18 + recipes/gdbm/config.yml | 7 + recipes/gdcm/all/conandata.yml | 81 + recipes/gdcm/all/conanfile.py | 250 ++ .../all/patches/0001-charls-linking.patch | 38 + .../all/patches/0002-3.0.20-openjpeg.patch | 22 + .../all/patches/0002-3.0.9-openjpeg.patch | 22 + .../all/patches/0003-gcc-11-compilation.patch | 68 + .../all/patches/0004-3.0.20-find-expat.patch | 11 + .../all/patches/0004-3.0.9-find-expat.patch | 11 + .../all/patches/0005-3.0.20-openssl.patch | 23 + .../gdcm/all/patches/0005-3.0.9-openssl.patch | 19 + recipes/gdcm/all/patches/0006-json.patch | 13 + .../all/patches/0007-3.0.20-find-json.patch | 45 + .../all/patches/0007-3.0.9-find-json.patch | 45 + .../patches/0008-3.0.20-find-libuuid.patch | 40 + .../all/patches/0008-3.0.9-find-libuuid.patch | 40 + recipes/gdcm/all/test_package/CMakeLists.txt | 9 + .../all/test_package/DCMTK_JPEGExt_12Bits.dcm | Bin 0 -> 3626 bytes recipes/gdcm/all/test_package/conanfile.py | 30 + .../gdcm/all/test_package/test_package.cpp | 104 + .../gdcm/all/test_v1_package/CMakeLists.txt | 8 + recipes/gdcm/all/test_v1_package/conanfile.py | 23 + recipes/gdcm/config.yml | 7 + recipes/gdk-pixbuf/all/conandata.yml | 19 + recipes/gdk-pixbuf/all/conanfile.py | 231 ++ .../define_dllmain_only_when_shared.patch | 63 + .../all/test_package/CMakeLists.txt | 7 + .../gdk-pixbuf/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/gdk-pixbuf/config.yml | 9 + recipes/gemmlowp/all/conandata.yml | 7 + recipes/gemmlowp/all/conanfile.py | 78 + .../all/patches/build-static-libraries.patch | 19 + .../gemmlowp/all/test_package/CMakeLists.txt | 8 + .../gemmlowp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 60 + .../all/test_v1_package/CMakeLists.txt | 8 + .../gemmlowp/all/test_v1_package/conanfile.py | 17 + recipes/gemmlowp/config.yml | 3 + recipes/genie/all/conandata.yml | 13 + recipes/genie/all/conanfile.py | 118 + recipes/genie/all/test_package/conanfile.py | 16 + .../genie/all/test_package/scripts/genie.lua | 23 + .../all/test_package/scripts/test_package.lua | 8 + .../genie/all/test_package/test_package.cpp | 7 + .../genie/all/test_v1_package/conanfile.py | 11 + recipes/genie/config.yml | 9 + recipes/geographiclib/all/conandata.yml | 27 + recipes/geographiclib/all/conanfile.py | 148 + .../all/patches/0001-streamoff.patch | 38 + .../0002-cmake-minimum-required-1.50.1.patch | 15 + .../0002-cmake-minimum-required-1.51.patch | 15 + .../0002-cmake-minimum-required-1.52.patch | 15 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/geographiclib/config.yml | 7 + recipes/geos/all/conandata.yml | 16 + recipes/geos/all/conanfile.py | 125 + recipes/geos/all/test_package/CMakeLists.txt | 7 + recipes/geos/all/test_package/conanfile.py | 26 + recipes/geos/all/test_package/test_package.c | 37 + .../geos/all/test_v1_package/CMakeLists.txt | 8 + recipes/geos/all/test_v1_package/conanfile.py | 17 + recipes/geos/config.yml | 11 + recipes/geotrans/all/CMakeLists.txt | 76 + recipes/geotrans/all/conandata.yml | 12 + recipes/geotrans/all/conanfile.py | 88 + .../all/patches/3.x-fix-for-cxx20.patch | 15 + .../geotrans/all/test_package/CMakeLists.txt | 7 + .../geotrans/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 576 +++ .../all/test_v1_package/CMakeLists.txt | 8 + .../geotrans/all/test_v1_package/conanfile.py | 29 + recipes/geotrans/config.yml | 5 + recipes/getdns/all/CMakeLists.txt | 11 + recipes/getdns/all/conandata.yml | 14 + recipes/getdns/all/conanfile.py | 170 + .../patches/1.6.0-0001-install-runtimes.patch | 33 + ...0002-fix-exports-extension-libraries.patch | 13 + ...-0003-let-find-modules-use-pkgconfig.patch | 641 +++ ...-0004-dont-install-symlinked-license.patch | 16 + .../getdns/all/test_package/CMakeLists.txt | 8 + recipes/getdns/all/test_package/conanfile.py | 17 + .../getdns/all/test_package/test_package.c | 26 + recipes/getdns/config.yml | 3 + .../all/conandata.yml | 7 + .../getopt-for-visual-studio/all/conanfile.py | 51 + ...-usage-in-multiple-compilation-units.patch | 59 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/getopt-for-visual-studio/config.yml | 3 + recipes/gettext/all/conandata.yml | 20 + recipes/gettext/all/conanfile.py | 148 + ...20.1-0001-fix-build-errors-with-MSVC.patch | 362 ++ ...eported-by-Gabor-Z.-Papp-gzp-papp.hu.patch | 29 + ...emmove-is-intrinsic-function-on-MSVC.patch | 72 + .../patches/0004-autopoint-relocatable.patch | 27 + recipes/gettext/all/test_package/conanfile.py | 58 + .../gettext/all/test_package/src/configure.ac | 6 + .../gettext/all/test_v1_package/conanfile.py | 51 + .../gettext/all/test_v1_package/configure.ac | 6 + recipes/gettext/config.yml | 5 + recipes/gf-complete/all/conandata.yml | 11 + recipes/gf-complete/all/conanfile.py | 162 + .../patches/0001-fix-msvc-cci.20170410.patch | 70 + .../all/test_package/CMakeLists.txt | 9 + .../gf-complete/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 7 + recipes/gf-complete/config.yml | 5 + recipes/gflags/all/conandata.yml | 4 + recipes/gflags/all/conanfile.py | 109 + .../gflags/all/test_package/CMakeLists.txt | 7 + recipes/gflags/all/test_package/conanfile.py | 26 + .../gflags/all/test_package/test_package.cpp | 12 + .../gflags/all/test_v1_package/CMakeLists.txt | 8 + .../gflags/all/test_v1_package/conanfile.py | 17 + recipes/gflags/config.yml | 3 + recipes/gfortran/all/conandata.yml | 14 + recipes/gfortran/all/conanfile.py | 79 + .../gfortran/all/test_package/conanfile.py | 14 + .../gfortran/all/test_v1_package/conanfile.py | 8 + recipes/gfortran/config.yml | 3 + recipes/ghc-filesystem/all/conandata.yml | 10 + recipes/ghc-filesystem/all/conanfile.py | 61 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/ghc-filesystem/config.yml | 7 + recipes/giflib/5.1.x/conandata.yml | 4 + recipes/giflib/5.1.x/conanfile.py | 169 + recipes/giflib/5.1.x/gif_lib.h | 342 ++ .../giflib/5.1.x/test_package/CMakeLists.txt | 11 + .../giflib/5.1.x/test_package/conanfile.py | 28 + .../giflib/5.1.x/test_package/test_package.c | 131 + recipes/giflib/5.1.x/unistd.h | 51 + recipes/giflib/5.2.x/CMakeLists.txt | 62 + recipes/giflib/5.2.x/conandata.yml | 7 + recipes/giflib/5.2.x/conanfile.py | 86 + .../5.2.x/patches/0001-msvc-unistd.patch | 261 ++ .../giflib/5.2.x/test_package/CMakeLists.txt | 7 + .../giflib/5.2.x/test_package/conanfile.py | 26 + .../giflib/5.2.x/test_package/test_package.c | 134 + .../5.2.x/test_v1_package/CMakeLists.txt | 8 + .../giflib/5.2.x/test_v1_package/conanfile.py | 21 + recipes/giflib/config.yml | 5 + recipes/ginkgo/all/conandata.yml | 13 + recipes/ginkgo/all/conanfile.py | 177 + recipes/ginkgo/all/patches/cmake-fixes.patch | 114 + .../ginkgo/all/patches/windows-iterator.patch | 119 + .../ginkgo/all/patches/windows-symbols.patch | 710 ++++ .../ginkgo/all/test_package/CMakeLists.txt | 8 + recipes/ginkgo/all/test_package/conanfile.py | 26 + .../ginkgo/all/test_package/test_package.cpp | 21 + .../ginkgo/all/test_v1_package/CMakeLists.txt | 8 + .../ginkgo/all/test_v1_package/conanfile.py | 17 + recipes/ginkgo/config.yml | 5 + recipes/gklib/all/CMakeLists.txt | 7 + recipes/gklib/all/conandata.yml | 12 + recipes/gklib/all/conanfile.py | 96 + .../patches/001-install-win32-headers.patch | 21 + .../gklib/all/patches/002-disable-tests.patch | 12 + .../all/patches/003-install-runtime.patch | 11 + recipes/gklib/all/test_package/CMakeLists.txt | 10 + recipes/gklib/all/test_package/conanfile.py | 24 + recipes/gklib/all/test_package/test_package.c | 72 + recipes/gklib/config.yml | 3 + recipes/glad/all/conandata.yml | 22 + recipes/glad/all/conanfile.py | 145 + .../patches/0001-CMake-handle-all-specs.patch | 26 + .../patches/0002-CMake-handle-all-specs.patch | 24 + .../patches/0003-CMake-handle-all-specs.patch | 26 + recipes/glad/all/test_package/CMakeLists.txt | 7 + recipes/glad/all/test_package/conanfile.py | 26 + recipes/glad/all/test_package/test_package.c | 7 + .../glad/all/test_v1_package/CMakeLists.txt | 8 + recipes/glad/all/test_v1_package/conanfile.py | 17 + recipes/glad/config.yml | 9 + recipes/glaze/all/conandata.yml | 56 + recipes/glaze/all/conanfile.py | 88 + .../patches/0.2.0-0001-use-cci-frozen.patch | 28 + recipes/glaze/all/test_package/CMakeLists.txt | 11 + recipes/glaze/all/test_package/conanfile.py | 26 + .../glaze/all/test_package/test_package.cpp | 43 + .../glaze/all/test_v1_package/CMakeLists.txt | 9 + .../glaze/all/test_v1_package/conanfile.py | 18 + recipes/glaze/config.yml | 29 + recipes/glbinding/all/conandata.yml | 8 + recipes/glbinding/all/conanfile.py | 120 + .../glbinding/all/patches/cmake-install.patch | 16 + .../glbinding/all/patches/getProcAddr.patch | 21 + .../glbinding/all/test_package/CMakeLists.txt | 9 + .../glbinding/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/glbinding/config.yml | 3 + recipes/glew/all/conandata.yml | 19 + recipes/glew/all/conanfile.py | 111 + .../all/patches/0001-fix-cmake-2.1.0.patch | 15 + .../all/patches/0001-fix-cmake-2.2.0.patch | 15 + .../all/patches/0002-vs16-release-fix.patch | 12 + recipes/glew/all/test_package/CMakeLists.txt | 7 + recipes/glew/all/test_package/conanfile.py | 26 + recipes/glew/all/test_package/test_package.c | 12 + .../glew/all/test_v1_package/CMakeLists.txt | 10 + recipes/glew/all/test_v1_package/conanfile.py | 17 + recipes/glew/config.yml | 5 + recipes/glext/all/conandata.yml | 4 + recipes/glext/all/conanfile.py | 35 + recipes/glext/all/test_package/CMakeLists.txt | 10 + recipes/glext/all/test_package/conanfile.py | 17 + recipes/glext/all/test_package/test_package.c | 19 + recipes/glext/config.yml | 3 + recipes/glfw/all/conandata.yml | 32 + recipes/glfw/all/conanfile.py | 156 + .../3.3.2-0001-fix-objc-cmake3.19+.patch | 11 + .../3.3.2-0002-macos-relocatable.patch | 11 + recipes/glfw/all/test_package/CMakeLists.txt | 7 + recipes/glfw/all/test_package/conanfile.py | 26 + recipes/glfw/all/test_package/test_package.c | 16 + .../glfw/all/test_v1_package/CMakeLists.txt | 8 + recipes/glfw/all/test_v1_package/conanfile.py | 17 + recipes/glfw/config.yml | 15 + recipes/gli/all/conandata.yml | 4 + recipes/gli/all/conanfile.py | 77 + recipes/gli/all/test_package/CMakeLists.txt | 8 + recipes/gli/all/test_package/conanfile.py | 26 + recipes/gli/all/test_package/test_package.cpp | 8 + .../gli/all/test_v1_package/CMakeLists.txt | 8 + recipes/gli/all/test_v1_package/conanfile.py | 17 + recipes/gli/config.yml | 3 + recipes/glib/all/conandata.yml | 37 + recipes/glib/all/conanfile.py | 302 ++ .../0001-2.73.3-clang-static-assert.patch | 33 + recipes/glib/all/test_package/CMakeLists.txt | 17 + recipes/glib/all/test_package/conanfile.py | 50 + recipes/glib/all/test_package/test_package.c | 26 + .../glib/all/test_v1_package/CMakeLists.txt | 8 + recipes/glib/all/test_v1_package/conanfile.py | 27 + recipes/glib/config.yml | 21 + recipes/glibmm/all/conandata.yml | 33 + recipes/glibmm/all/conanfile.py | 195 + .../patches/enable_static_libs_2_66_4.patch | 32 + .../patches/enable_static_libs_2_72_1.patch | 32 + .../patches/enable_static_libs_2_75_0.patch | 32 + ...x_initialization_order_fiasco_2_66_4.patch | 163 + ...x_initialization_order_fiasco_2_72_1.patch | 95 + ...x_initialization_order_fiasco_2_75_0.patch | 84 + .../glibmm/all/test_package/CMakeLists.txt | 15 + recipes/glibmm/all/test_package/conanfile.py | 27 + .../glibmm/all/test_package/test_package.cpp | 63 + .../glibmm/all/test_v1_package/CMakeLists.txt | 8 + .../glibmm/all/test_v1_package/conanfile.py | 17 + recipes/glibmm/config.yml | 7 + recipes/glm/all/conandata.yml | 22 + recipes/glm/all/conanfile.py | 58 + recipes/glm/all/test_package/CMakeLists.txt | 7 + recipes/glm/all/test_package/conanfile.py | 26 + recipes/glm/all/test_package/test_package.cpp | 11 + .../glm/all/test_v1_package/CMakeLists.txt | 8 + recipes/glm/all/test_v1_package/conanfile.py | 17 + recipes/glm/config.yml | 15 + recipes/glog/all/conandata.yml | 15 + recipes/glog/all/conanfile.py | 131 + .../all/patches/0001-fix-msvc-snprintf.patch | 11 + recipes/glog/all/test_package/CMakeLists.txt | 7 + recipes/glog/all/test_package/conanfile.py | 26 + .../glog/all/test_package/test_package.cpp | 8 + .../glog/all/test_v1_package/CMakeLists.txt | 8 + recipes/glog/all/test_v1_package/conanfile.py | 18 + recipes/glog/config.yml | 7 + recipes/glpk/all/conandata.yml | 4 + recipes/glpk/all/conanfile.py | 150 + recipes/glpk/all/test_package/CMakeLists.txt | 10 + recipes/glpk/all/test_package/conanfile.py | 24 + recipes/glpk/all/test_package/test_package.c | 54 + recipes/glpk/config.yml | 3 + recipes/glshaderpp/all/conandata.yml | 4 + recipes/glshaderpp/all/conanfile.py | 55 + .../all/test_package/CMakeLists.txt | 12 + .../glshaderpp/all/test_package/conanfile.py | 19 + .../glshaderpp/all/test_package/example.cpp | 11 + recipes/glshaderpp/config.yml | 3 + recipes/glslang/all/CMakeLists.txt | 16 + recipes/glslang/all/conandata.yml | 55 + recipes/glslang/all/conanfile.py | 261 ++ .../patches/0001-no-force-glslang-pic.patch | 10 + .../1.3.236.0-0001-no-force-glslang-pic.patch | 10 + .../glslang/all/test_package/CMakeLists.txt | 8 + recipes/glslang/all/test_package/conanfile.py | 28 + .../glslang/all/test_package/test_package.cpp | 8 + .../all/test_package/test_package.vert | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../glslang/all/test_v1_package/conanfile.py | 19 + recipes/glslang/config.yml | 23 + recipes/glu/all/conanfile.py | 59 + recipes/glu/all/test_package/CMakeLists.txt | 7 + recipes/glu/all/test_package/conanfile.py | 26 + recipes/glu/all/test_package/test_package.c | 17 + .../glu/all/test_v1_package/CMakeLists.txt | 8 + recipes/glu/all/test_v1_package/conanfile.py | 16 + recipes/glu/config.yml | 3 + recipes/gm2calc/all/CMakeLists.txt | 11 + recipes/gm2calc/all/conandata.yml | 14 + recipes/gm2calc/all/conanfile.py | 74 + ...pdate-1.7.5-to-FindMathematica-3.6.0.patch | 285 ++ .../gm2calc/all/test_package/CMakeLists.txt | 11 + recipes/gm2calc/all/test_package/conanfile.py | 17 + .../gm2calc/all/test_package/test_package.cpp | 96 + recipes/gm2calc/config.yml | 7 + recipes/gmp/all/conandata.yml | 21 + recipes/gmp/all/conanfile.py | 179 + .../0001-msvc-dumpbin-yasm-wrapper.patch | 72 + ...6.1.x-0001-fix-MSVC-next-prime-error.patch | 14 + .../patches/6.1.x-0002-fix-MSVC-debug.patch | 11 + ...6.2.x-0001-fix-MSVC-next-prime-error.patch | 14 + recipes/gmp/all/test_package/CMakeLists.txt | 24 + recipes/gmp/all/test_package/conanfile.py | 33 + recipes/gmp/all/test_package/test_package.c | 25 + recipes/gmp/all/test_package/test_package.cpp | 14 + .../gmp/all/test_v1_package/CMakeLists.txt | 24 + recipes/gmp/all/test_v1_package/conanfile.py | 22 + recipes/gmp/config.yml | 7 + recipes/gn/all/conandata.yml | 3 + recipes/gn/all/conanfile.py | 128 + recipes/gn/all/test_package/.gn | 2 + recipes/gn/all/test_package/BUILD.gn | 22 + recipes/gn/all/test_package/conanfile.py | 69 + recipes/gn/all/test_package/config/BUILD.gn | 24 + .../gn/all/test_package/config/BUILDCONFIG.gn | 48 + .../test_package/config/toolchain/BUILD.gn | 174 + recipes/gn/all/test_package/test_package.cpp | 10 + recipes/gn/all/test_package/test_shared.cpp | 5 + recipes/gn/all/test_package/test_shared.h | 14 + recipes/gn/all/test_package/test_static.cpp | 5 + recipes/gn/all/test_package/test_static.h | 3 + recipes/gn/config.yml | 3 + recipes/gnu-config/all/conandata.yml | 12 + recipes/gnu-config/all/conanfile.py | 67 + .../cci.20210814-0001-tvos-support.patch | 11 + .../gnu-config/all/test_package/conanfile.py | 21 + .../all/test_v1_package/conanfile.py | 22 + recipes/gnu-config/config.yml | 5 + recipes/gnulib/all/conandata.yml | 4 + recipes/gnulib/all/conanfile.py | 51 + recipes/gnulib/all/test_package/Makefile.am | 9 + recipes/gnulib/all/test_package/conanfile.py | 60 + recipes/gnulib/all/test_package/configure.ac | 21 + .../gnulib/all/test_package/test_package.c | 53 + recipes/gnulib/config.yml | 3 + recipes/gnutls/all/conandata.yml | 13 + recipes/gnutls/all/conanfile.py | 205 + .../gnutls/all/patches/0001-fix-isdigit.patch | 149 + .../gnutls/all/test_package/CMakeLists.txt | 23 + recipes/gnutls/all/test_package/conanfile.py | 26 + .../gnutls/all/test_package/test_package.c | 16 + .../gnutls/all/test_v1_package/CMakeLists.txt | 8 + .../gnutls/all/test_v1_package/conanfile.py | 17 + recipes/gnutls/config.yml | 3 + .../gobject-introspection/all/conandata.yml | 19 + .../gobject-introspection/all/conanfile.py | 129 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 12 + recipes/gobject-introspection/config.yml | 13 + recipes/godot-cpp/all/conandata.yml | 10 + recipes/godot-cpp/all/conanfile.py | 142 + .../godot-cpp/all/test_package/CMakeLists.txt | 9 + .../godot-cpp/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 7 + recipes/godot-cpp/config.yml | 7 + recipes/godot_headers/all/conandata.yml | 22 + recipes/godot_headers/all/conanfile.py | 40 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/godot_headers/config.yml | 15 + .../2.x/conan_cmake_project_include.cmake | 10 + recipes/google-cloud-cpp/2.x/conandata.yml | 16 + recipes/google-cloud-cpp/2.x/conanfile.py | 336 ++ .../001-use-googleapis-conan-package.patch | 1279 ++++++ .../002-interface-library-properties.patch | 44 + .../2.5.0/003-use-conan-msvc-runtime.patch | 53 + .../2.x/test_package/CMakeLists.txt | 19 + .../2.x/test_package/bigtable.cpp | 16 + .../2.x/test_package/conanfile.py | 37 + .../2.x/test_package/pubsub.cpp | 16 + .../2.x/test_package/spanner.cpp | 17 + .../2.x/test_package/speech.cpp | 13 + .../2.x/test_package/storage.cpp | 18 + .../2.x/test_v1_package/CMakeLists.txt | 8 + .../2.x/test_v1_package/conanfile.py | 21 + recipes/google-cloud-cpp/all/CMakeLists.txt | 14 + recipes/google-cloud-cpp/all/conandata.yml | 23 + recipes/google-cloud-cpp/all/conanfile.py | 374 ++ .../all/patches/0001-googleapis-folder.patch | 22 + .../all/test_package/CMakeLists.txt | 14 + .../all/test_package/conanfile.py | 16 + .../all/test_package/storage.cpp | 24 + recipes/google-cloud-cpp/config.yml | 13 + recipes/googleapis/all/CMakeLists.txt | 10 + recipes/googleapis/all/conandata.yml | 53 + recipes/googleapis/all/conanfile.py | 210 + recipes/googleapis/all/helpers.py | 190 + .../001-fix-google-api-deps.patch | 19 + .../001-fix-google-api-deps.patch | 19 + .../001-fix-google-api-deps.patch | 19 + .../001-fix-google-api-deps.patch | 19 + .../all/test_package/CMakeLists.txt | 8 + .../googleapis/all/test_package/conanfile.py | 28 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/googleapis/config.yml | 13 + recipes/gperf/all/conandata.yml | 7 + recipes/gperf/all/conanfile.py | 95 + .../0001-remove-register-keyword.patch | 13 + recipes/gperf/all/test_package/conanfile.py | 13 + .../gperf/all/test_v1_package/conanfile.py | 9 + recipes/gperf/config.yml | 3 + recipes/graphene/all/conandata.yml | 13 + recipes/graphene/all/conanfile.py | 142 + .../graphene/all/test_package/CMakeLists.txt | 7 + .../graphene/all/test_package/conanfile.py | 27 + .../graphene/all/test_package/test_package.c | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../graphene/all/test_v1_package/conanfile.py | 17 + recipes/graphene/config.yml | 9 + recipes/graphthewy/all/conandata.yml | 4 + recipes/graphthewy/all/conanfile.py | 55 + .../all/test_package/CMakeLists.txt | 10 + .../graphthewy/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 17 + recipes/graphthewy/config.yml | 3 + recipes/greatest/all/conandata.yml | 7 + recipes/greatest/all/conanfile.py | 26 + .../greatest/all/test_package/CMakeLists.txt | 8 + .../greatest/all/test_package/conanfile.py | 17 + .../greatest/all/test_package/test_package.c | 21 + recipes/greatest/config.yml | 5 + recipes/greg7mdp-gtl/all/conandata.yml | 16 + recipes/greg7mdp-gtl/all/conanfile.py | 72 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/greg7mdp-gtl/config.yml | 11 + recipes/grpc-proto/all/CMakeLists.txt | 10 + recipes/grpc-proto/all/conandata.yml | 7 + recipes/grpc-proto/all/conanfile.py | 144 + recipes/grpc-proto/all/helpers.py | 151 + .../all/test_package/CMakeLists.txt | 8 + .../grpc-proto/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/grpc-proto/config.yml | 5 + .../all/cmake/grpc_plugin_template.cmake.in | 31 + .../all/conan_cmake_project_include.cmake | 18 + recipes/grpc/all/conandata.yml | 29 + recipes/grpc/all/conanfile.py | 444 +++ .../v1.46.x/001-disable-cppstd-override.patch | 26 + ...002-consume-protos-from-requirements.patch | 290 ++ .../v1.47.x/001-disable-cppstd-override.patch | 31 + ...002-consume-protos-from-requirements.patch | 309 ++ .../v1.48.x/001-disable-cppstd-override.patch | 26 + ...002-consume-protos-from-requirements.patch | 327 ++ .../v1.50.x/001-disable-cppstd-override.patch | 26 + ...002-consume-protos-from-requirements.patch | 326 ++ recipes/grpc/all/test_package/CMakeLists.txt | 30 + recipes/grpc/all/test_package/conanfile.py | 56 + .../grpc/all/test_package/helloworld.proto | 38 + .../test_package/macos_make_override.cmake | 13 + .../grpc/all/test_package/test_package.cpp | 122 + .../grpc/all/test_v1_package/CMakeLists.txt | 8 + recipes/grpc/all/test_v1_package/conanfile.py | 55 + recipes/grpc/config.yml | 9 + recipes/gsl-lite/all/conandata.yml | 22 + recipes/gsl-lite/all/conanfile.py | 70 + .../gsl-lite/all/test_package/CMakeLists.txt | 8 + .../gsl-lite/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../gsl-lite/all/test_v1_package/conanfile.py | 23 + recipes/gsl-lite/config.yml | 15 + recipes/gsl/all/conandata.yml | 14 + recipes/gsl/all/conanfile.py | 143 + .../all/patches/0001-windows-support.patch | 90 + .../0002-export-all-gsl_-symbols.patch | 12 + recipes/gsl/all/test_package/CMakeLists.txt | 7 + recipes/gsl/all/test_package/conanfile.py | 26 + recipes/gsl/all/test_package/test_package.c | 14 + .../gsl/all/test_v1_package/CMakeLists.txt | 8 + recipes/gsl/all/test_v1_package/conanfile.py | 17 + recipes/gsl/config.yml | 5 + recipes/gsoap/all/CMakeLists.txt | 29 + recipes/gsoap/all/cmake/gsoap.cmake | 71 + recipes/gsoap/all/cmake/soapcpp2.cmake | 65 + recipes/gsoap/all/cmake/wsdl2h.cmake | 64 + recipes/gsoap/all/conandata.yml | 21 + recipes/gsoap/all/conanfile.py | 111 + recipes/gsoap/all/test_package/CMakeLists.txt | 12 + recipes/gsoap/all/test_package/calc.nsmap | 11 + recipes/gsoap/all/test_package/calc.wsdl | 161 + recipes/gsoap/all/test_package/conanfile.py | 49 + .../gsoap/all/test_package/test_package.cpp | 20 + .../gsoap/all/test_v1_package/CMakeLists.txt | 8 + .../gsoap/all/test_v1_package/conanfile.py | 32 + recipes/gsoap/config.yml | 9 + recipes/gst-libav/all/conandata.yml | 4 + recipes/gst-libav/all/conanfile.py | 170 + .../gst-libav/all/test_package/CMakeLists.txt | 11 + .../gst-libav/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 34 + recipes/gst-libav/config.yml | 3 + recipes/gst-plugins-bad/all/conandata.yml | 4 + recipes/gst-plugins-bad/all/conanfile.py | 232 ++ .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 34 + recipes/gst-plugins-bad/config.yml | 3 + recipes/gst-plugins-base/all/conandata.yml | 7 + recipes/gst-plugins-base/all/conanfile.py | 696 ++++ .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 44 + recipes/gst-plugins-base/config.yml | 5 + recipes/gst-plugins-good/all/conandata.yml | 4 + recipes/gst-plugins-good/all/conanfile.py | 209 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 34 + recipes/gst-plugins-good/config.yml | 3 + recipes/gst-plugins-ugly/all/conandata.yml | 4 + recipes/gst-plugins-ugly/all/conanfile.py | 171 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 34 + recipes/gst-plugins-ugly/config.yml | 3 + recipes/gstreamer/all/conandata.yml | 19 + recipes/gstreamer/all/conanfile.py | 210 + .../gstreamer/all/test_package/CMakeLists.txt | 15 + .../gstreamer/all/test_package/conanfile.py | 17 + .../gstreamer/all/test_package/test_package.c | 35 + recipes/gstreamer/config.yml | 13 + recipes/gtest/all/conandata.yml | 19 + recipes/gtest/all/conanfile.py | 192 + .../all/patches/gtest-1.10.0-override.patch | 450 +++ recipes/gtest/all/patches/gtest-1.10.0.patch | 13 + recipes/gtest/all/test_package/CMakeLists.txt | 26 + recipes/gtest/all/test_package/conanfile.py | 38 + recipes/gtest/all/test_package/main.cpp | 6 + .../gtest/all/test_package/test_package.cpp | 52 + .../gtest/all/test_v1_package/CMakeLists.txt | 8 + .../gtest/all/test_v1_package/conanfile.py | 21 + recipes/gtest/config.yml | 7 + recipes/gtk-doc-stub/all/conandata.yml | 8 + recipes/gtk-doc-stub/all/conanfile.py | 65 + .../patches/0001-relocatable-gtkdocize.patch | 15 + .../all/test_package/conanfile.py | 37 + .../all/test_package/configure.ac | 7 + recipes/gtk-doc-stub/config.yml | 3 + recipes/gtk/all/conandata.yml | 41 + recipes/gtk/all/conanfile.py | 242 ++ .../patches/0001-fix-UAC-manifest-rc.patch | 36 + ...-version-resource-for-Windows-11-sdk.patch | 25 + recipes/gtk/all/test_package/CMakeLists.txt | 9 + recipes/gtk/all/test_package/conanfile.py | 17 + recipes/gtk/all/test_package/test_package.c | 10 + recipes/gtk/config.yml | 19 + recipes/gtk/system/conanfile.py | 53 + .../gtk/system/test_package/CMakeLists.txt | 10 + recipes/gtk/system/test_package/conanfile.py | 27 + .../gtk/system/test_package/test_package.c | 8 + .../gtk/system/test_v1_package/CMakeLists.txt | 8 + .../gtk/system/test_v1_package/conanfile.py | 17 + .../gtk/system/test_v1_package/test_package.c | 8 + recipes/gtsam/all/conandata.yml | 50 + recipes/gtsam/all/conanfile.py | 258 ++ .../all/patches/4.0.2-0001-cmake-boost.patch | 61 + .../all/patches/4.0.2-0002-cmake-eigen.patch | 20 + .../patches/4.0.2-0003-cmake-project.patch | 9 + .../all/patches/4.0.2-0003-macos-rpath.patch | 34 + .../all/patches/4.0.3-0001-cmake-boost.patch | 30 + .../all/patches/4.0.3-0002-cmake-eigen.patch | 20 + .../all/patches/4.0.3-0003-macos-rpath.patch | 30 + .../all/patches/4.1.1-0001-cmake-boost.patch | 27 + .../all/patches/4.1.1-0002-cmake-eigen.patch | 20 + .../all/patches/4.1.1-0003-macos-rpath.patch | 32 + recipes/gtsam/all/test_package/CMakeLists.txt | 8 + recipes/gtsam/all/test_package/conanfile.py | 26 + .../gtsam/all/test_package/test_package.cpp | 18 + .../gtsam/all/test_v1_package/CMakeLists.txt | 8 + .../gtsam/all/test_v1_package/conanfile.py | 17 + recipes/gtsam/config.yml | 7 + recipes/guetzli/all/conandata.yml | 8 + recipes/guetzli/all/conanfile.py | 76 + .../guetzli/all/patches/0001-no-debug.patch | 24 + recipes/guetzli/all/test_package/bees.png | Bin 0 -> 177424 bytes recipes/guetzli/all/test_package/conanfile.py | 16 + recipes/guetzli/config.yml | 4 + recipes/gumbo-parser/all/conandata.yml | 4 + recipes/gumbo-parser/all/conanfile.py | 89 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/gumbo-parser/config.yml | 3 + recipes/gurkenlaeufer/all/conandata.yml | 5 + recipes/gurkenlaeufer/all/conanfile.py | 70 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 26 + .../gurkenlaeufer/all/test_package/main.cpp | 7 + .../all/test_package/parsertests.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/gurkenlaeufer/config.yml | 3 + recipes/gzip-hpp/all/conandata.yml | 4 + recipes/gzip-hpp/all/conanfile.py | 56 + .../gzip-hpp/all/test_package/CMakeLists.txt | 8 + .../gzip-hpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 8 + .../gzip-hpp/all/test_v1_package/conanfile.py | 18 + recipes/gzip-hpp/config.yml | 3 + recipes/h3/all/conandata.yml | 40 + recipes/h3/all/conanfile.py | 91 + recipes/h3/all/patches/fix-cmake-3.6.3.patch | 56 + recipes/h3/all/patches/fix-cmake-3.6.4.patch | 65 + recipes/h3/all/patches/fix-cmake-3.7.x.patch | 57 + recipes/h3/all/test_package/CMakeLists.txt | 11 + recipes/h3/all/test_package/conanfile.py | 26 + recipes/h3/all/test_package/test_package.c | 89 + recipes/h3/all/test_v1_package/CMakeLists.txt | 8 + recipes/h3/all/test_v1_package/conanfile.py | 17 + recipes/h3/config.yml | 13 + recipes/h5pp/all/conandata.yml | 48 + recipes/h5pp/all/conanfile.py | 151 + .../fix-support-new-hdf5-v1.8.3-5.patch | 13 + .../patches/fix-support-new-hdf5-v1.8.6.patch | 22 + .../patches/fix-support-new-hdf5-v1.9.0.patch | 23 + recipes/h5pp/all/test_package/CMakeLists.txt | 8 + recipes/h5pp/all/test_package/conanfile.py | 25 + .../h5pp/all/test_package/test_package.cpp | 23 + .../h5pp/all/test_v1_package/CMakeLists.txt | 11 + recipes/h5pp/all/test_v1_package/conanfile.py | 16 + .../h5pp/all/test_v1_package/test_package.cpp | 23 + recipes/h5pp/config.yml | 15 + recipes/half/all/conandata.yml | 4 + recipes/half/all/conanfile.py | 44 + recipes/half/all/test_package/CMakeLists.txt | 7 + recipes/half/all/test_package/conanfile.py | 25 + .../half/all/test_package/test_package.cpp | 11 + .../half/all/test_v1_package/CMakeLists.txt | 10 + recipes/half/all/test_v1_package/conanfile.py | 17 + recipes/half/config.yml | 3 + recipes/hana/all/conandata.yml | 16 + recipes/hana/all/conanfile.py | 98 + recipes/hana/all/test_package/CMakeLists.txt | 11 + recipes/hana/all/test_package/conanfile.py | 16 + .../hana/all/test_package/test_package.cpp | 15 + recipes/hana/config.yml | 11 + recipes/happly/all/conandata.yml | 4 + recipes/happly/all/conanfile.py | 30 + .../happly/all/test_package/CMakeLists.txt | 9 + recipes/happly/all/test_package/conanfile.py | 21 + .../happly/all/test_package/test_package.cpp | 24 + recipes/happly/config.yml | 3 + recipes/harfbuzz/all/conandata.yml | 36 + recipes/harfbuzz/all/conanfile.py | 203 + .../0000-fix-freetype-lookup-4.4.1.patch | 99 + .../0000-fix-freetype-lookup-5.1.0.patch | 72 + .../harfbuzz/all/test_package/CMakeLists.txt | 8 + .../harfbuzz/all/test_package/conanfile.py | 28 + recipes/harfbuzz/all/test_package/example.ttf | Bin 0 -> 2948 bytes .../harfbuzz/all/test_package/test_package.c | 141 + .../all/test_v1_package/CMakeLists.txt | 8 + .../harfbuzz/all/test_v1_package/conanfile.py | 19 + recipes/harfbuzz/config.yml | 17 + recipes/hash-library/all/CMakeLists.txt | 37 + recipes/hash-library/all/conandata.yml | 7 + recipes/hash-library/all/conanfile.py | 63 + .../all/patches/001-fix-macos.patch | 98 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/hash-library/config.yml | 3 + .../hazelcast-cpp-client/all/conandata.yml | 31 + recipes/hazelcast-cpp-client/all/conanfile.py | 89 + .../all/patches/gcc_11_1_0.patch | 40 + .../all/patches/gcc_4.9_5_fix.patch | 79 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/hazelcast-cpp-client/config.yml | 15 + recipes/hdf4/all/CMakeLists.txt | 7 + recipes/hdf4/all/conandata.yml | 10 + recipes/hdf4/all/conanfile.py | 156 + .../hdf4/all/patches/fix-export-macro.patch | 11 + .../patches/fix-missing-unistd-include.patch | 13 + recipes/hdf4/all/test_package/CMakeLists.txt | 14 + recipes/hdf4/all/test_package/conanfile.py | 24 + recipes/hdf4/all/test_package/test_package.c | 114 + recipes/hdf4/config.yml | 3 + recipes/hdf5/all/conandata.yml | 76 + recipes/hdf5/all/conanfile.py | 300 ++ .../patches/conanize-link-szip-1.10.5+.patch | 37 + .../patches/conanize-link-szip-1.12.2+.patch | 46 + .../patches/conanize-link-szip-1.14.0+.patch | 45 + .../patches/conanize-link-szip-1.8.21.patch | 37 + ...-missing-function-prototypes-1.10.5+.patch | 34 + ...x-missing-function-prototypes-1.10.6.patch | 24 + .../mingw-cmake-size-type-checks-1.10.5.patch | 29 + .../mingw-cmake-size-type-checks-1.8.21.patch | 29 + .../all/patches/mingw-fix-prefix-lib.patch | 11 + .../all/patches/mingw-unused-ellipses.patch | 16 + recipes/hdf5/all/test_package/CMakeLists.txt | 28 + recipes/hdf5/all/test_package/conanfile.py | 35 + recipes/hdf5/all/test_package/test_package.c | 50 + .../hdf5/all/test_package/test_package.cpp | 9 + recipes/hdf5/all/test_package/test_parallel.c | 99 + .../hdf5/all/test_v1_package/CMakeLists.txt | 8 + recipes/hdf5/all/test_v1_package/conanfile.py | 22 + recipes/hdf5/config.yml | 15 + recipes/hdrhistogram-c/all/conandata.yml | 13 + recipes/hdrhistogram-c/all/conanfile.py | 98 + .../all/patches/cmake-install.patch | 13 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/hdrhistogram-c/config.yml | 7 + recipes/heatshrink/all/CMakeLists.txt | 27 + recipes/heatshrink/all/conandata.yml | 4 + recipes/heatshrink/all/conanfile.py | 84 + .../all/test_package/CMakeLists.txt | 7 + .../heatshrink/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/heatshrink/config.yml | 3 + recipes/hedley/all/conandata.yml | 4 + recipes/hedley/all/conanfile.py | 38 + .../hedley/all/test_package/CMakeLists.txt | 7 + recipes/hedley/all/test_package/conanfile.py | 26 + .../hedley/all/test_package/test_package.cpp | 7 + .../hedley/all/test_v1_package/CMakeLists.txt | 8 + .../hedley/all/test_v1_package/conanfile.py | 17 + recipes/hedley/config.yml | 3 + recipes/hexl/all/CMakeLists.txt | 7 + recipes/hexl/all/conandata.yml | 8 + recipes/hexl/all/conanfile.py | 158 + recipes/hexl/all/patches/fix-cmake.patch | 122 + recipes/hexl/all/test_package/CMakeLists.txt | 14 + recipes/hexl/all/test_package/conanfile.py | 20 + recipes/hexl/all/test_package/example.cpp | 43 + recipes/hexl/config.yml | 3 + recipes/hffix/all/conandata.yml | 4 + recipes/hffix/all/conanfile.py | 42 + recipes/hffix/all/test_package/CMakeLists.txt | 7 + recipes/hffix/all/test_package/conanfile.py | 25 + .../hffix/all/test_package/test_package.cpp | 69 + .../hffix/all/test_v1_package/CMakeLists.txt | 10 + .../hffix/all/test_v1_package/conanfile.py | 17 + recipes/hffix/config.yml | 3 + recipes/hidapi/all/conandata.yml | 16 + recipes/hidapi/all/conanfile.py | 156 + .../hidapi/all/test_package/CMakeLists.txt | 7 + recipes/hidapi/all/test_package/conanfile.py | 26 + .../hidapi/all/test_package/test_package.c | 6 + .../hidapi/all/test_v1_package/CMakeLists.txt | 8 + .../hidapi/all/test_v1_package/conanfile.py | 17 + recipes/hidapi/config.yml | 11 + recipes/highfive/all/conandata.yml | 19 + recipes/highfive/all/conanfile.py | 139 + .../highfive/all/test_package/CMakeLists.txt | 8 + .../highfive/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 77 + .../all/test_v1_package/CMakeLists.txt | 11 + .../highfive/all/test_v1_package/conanfile.py | 17 + recipes/highfive/config.yml | 13 + recipes/highs/all/conandata.yml | 10 + recipes/highs/all/conanfile.py | 88 + .../0001-missing-includes-msvc15-1.4.2.patch | 48 + recipes/highs/all/test_package/CMakeLists.txt | 7 + recipes/highs/all/test_package/conanfile.py | 26 + recipes/highs/all/test_package/main.cpp | 164 + .../highs/all/test_v1_package/CMakeLists.txt | 9 + .../highs/all/test_v1_package/conanfile.py | 18 + recipes/highs/config.yml | 3 + recipes/highway/all/conandata.yml | 34 + recipes/highway/all/conanfile.py | 114 + .../patches/0.11.1-0001-remove-contrib.patch | 12 + .../0.16.0-0001-fix-sys-random-h.patch | 50 + .../highway/all/test_package/CMakeLists.txt | 8 + recipes/highway/all/test_package/conanfile.py | 26 + .../highway/all/test_package/test_package.cpp | 45 + .../all/test_v1_package/CMakeLists.txt | 8 + .../highway/all/test_v1_package/conanfile.py | 17 + recipes/highway/config.yml | 17 + recipes/hipony-enumerate/all/conandata.yml | 10 + recipes/hipony-enumerate/all/conanfile.py | 117 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/hipony-enumerate/config.yml | 7 + recipes/hippomocks/all/conandata.yml | 4 + recipes/hippomocks/all/conanfile.py | 28 + .../all/test_package/CMakeLists.txt | 10 + .../hippomocks/all/test_package/conanfile.py | 16 + recipes/hippomocks/all/test_package/main.cpp | 20 + recipes/hippomocks/config.yml | 3 + recipes/hiredis/0.x.x/conandata.yml | 8 + recipes/hiredis/0.x.x/conanfile.py | 78 + .../0.x.x/patches/0001-fix-makefile.patch | 42 + .../hiredis/0.x.x/test_package/CMakeLists.txt | 8 + .../hiredis/0.x.x/test_package/conanfile.py | 17 + .../hiredis/0.x.x/test_package/test_package.c | 21 + recipes/hiredis/all/conandata.yml | 29 + recipes/hiredis/all/conanfile.py | 113 + .../all/patches/0001-fix-cmake-1.0.0.patch | 40 + .../all/patches/0001-fix-cmake-1.1.0.patch | 219 ++ .../hiredis/all/patches/0002-fix-aix.patch | 15 + .../hiredis/all/test_package/CMakeLists.txt | 7 + recipes/hiredis/all/test_package/conanfile.py | 26 + .../hiredis/all/test_package/test_package.c | 24 + .../all/test_v1_package/CMakeLists.txt | 10 + .../hiredis/all/test_v1_package/conanfile.py | 17 + recipes/hiredis/config.yml | 9 + recipes/hlslpp/all/conandata.yml | 16 + recipes/hlslpp/all/conanfile.py | 43 + .../hlslpp/all/test_package/CMakeLists.txt | 8 + recipes/hlslpp/all/test_package/conanfile.py | 26 + .../hlslpp/all/test_package/test_package.cpp | 18 + .../hlslpp/all/test_v1_package/CMakeLists.txt | 8 + .../hlslpp/all/test_v1_package/conanfile.py | 17 + recipes/hlslpp/config.yml | 11 + recipes/homog2d/all/conandata.yml | 20 + recipes/homog2d/all/conanfile.py | 69 + .../all/patches/0001-include-array.patch | 12 + .../0002-pretty_function-for-msvc.patch | 33 + .../all/patches/0003-support-msvc.patch | 22 + .../homog2d/all/test_package/CMakeLists.txt | 8 + recipes/homog2d/all/test_package/conanfile.py | 26 + .../homog2d/all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../homog2d/all/test_v1_package/conanfile.py | 18 + recipes/homog2d/config.yml | 5 + recipes/http_parser/all/CMakeLists.txt | 15 + recipes/http_parser/all/conandata.yml | 10 + recipes/http_parser/all/conanfile.py | 62 + .../all/test_package/CMakeLists.txt | 7 + .../http_parser/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/http_parser/config.yml | 7 + recipes/huffman/all/CMakeLists.txt | 39 + recipes/huffman/all/conandata.yml | 15 + recipes/huffman/all/conanfile.py | 69 + .../all/patches/1.2.2-0001-use-_WIN32.patch | 13 + .../all/patches/1.2.7-0001-use-_WIN32.patch | 13 + .../huffman/all/test_package/CMakeLists.txt | 11 + recipes/huffman/all/test_package/conanfile.py | 17 + .../huffman/all/test_package/test_package.cpp | 14 + recipes/huffman/config.yml | 5 + recipes/hunspell/all/CMakeLists.txt | 69 + recipes/hunspell/all/conandata.yml | 4 + recipes/hunspell/all/conanfile.py | 67 + .../hunspell/all/test_package/CMakeLists.txt | 10 + .../hunspell/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cxx | 12 + recipes/hunspell/config.yml | 3 + recipes/hyperscan/all/conandata.yml | 12 + recipes/hyperscan/all/conanfile.py | 129 + .../all/patches/0001-fix-cmake.patch | 327 ++ .../patches/0002-use-ue2-make_unique.patch | 875 +++++ .../hyperscan/all/test_package/CMakeLists.txt | 15 + .../hyperscan/all/test_package/ch_example.cpp | 100 + .../hyperscan/all/test_package/conanfile.py | 35 + .../hyperscan/all/test_package/hs_example.cpp | 83 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 23 + recipes/hyperscan/config.yml | 3 + recipes/i2c-tools/all/conandata.yml | 4 + recipes/i2c-tools/all/conanfile.py | 78 + .../i2c-tools/all/test_package/CMakeLists.txt | 10 + .../i2c-tools/all/test_package/conanfile.py | 15 + .../i2c-tools/all/test_package/test_package.c | 31 + recipes/i2c-tools/config.yml | 3 + recipes/icecream-cpp/all/conandata.yml | 4 + recipes/icecream-cpp/all/conanfile.py | 42 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 18 + .../icecream-cpp/all/test_package/example.cpp | 5 + recipes/icecream-cpp/config.yml | 3 + recipes/iceoryx/all/CMakeLists.txt | 7 + recipes/iceoryx/all/conandata.yml | 40 + recipes/iceoryx/all/conanfile.py | 298 ++ .../patches/1.0.0-0001-fix-find-toml.patch | 21 + .../1.0.0-0002-fix-install-bundle.patch | 10 + .../1.0.0-0003-no-hardcoded-libcxx.patch | 10 + .../patches/2.0.X-0001-fix-find-toml.patch | 12 + .../iceoryx/all/test_package/CMakeLists.txt | 20 + recipes/iceoryx/all/test_package/conanfile.py | 21 + recipes/iceoryx/all/test_package/main.cpp | 24 + recipes/iceoryx/config.yml | 11 + recipes/icu/all/conandata.yml | 37 + recipes/icu/all/conanfile.py | 348 ++ .../icu/all/patches/0001-67.1-fix-mingw.patch | 37 + .../icu/all/patches/0001-69.1-fix-mingw.patch | 43 + .../patches/0001-71.1-fix-emscripten.patch | 117 + .../0001-71.1-fix-undef-strict-ansi.patch | 18 + ...9344a18f4f32e8070ee53b79495630901c26.patch | 22 + recipes/icu/all/test_package/CMakeLists.txt | 8 + recipes/icu/all/test_package/conanfile.py | 26 + recipes/icu/all/test_package/test_package.cpp | 623 +++ .../icu/all/test_v1_package/CMakeLists.txt | 8 + recipes/icu/all/test_v1_package/conanfile.py | 17 + recipes/icu/config.yml | 13 + recipes/ignition-cmake/all/CMakeLists.txt | 7 + recipes/ignition-cmake/all/conandata.yml | 15 + recipes/ignition-cmake/all/conanfile.py | 115 + .../all/patches/0001-cmake-fixes.patch | 53 + .../0002-ignition-cmake-2.10.0-fixes.patch | 53 + .../all/test_package/CMakeLists.txt | 16 + .../all/test_package/conanfile.py | 23 + .../all/test_package/src/CMakeLists.txt | 3 + .../all/test_package/src/test_package.cpp | 8 + recipes/ignition-cmake/config.yml | 5 + recipes/ignition-math/all/CMakeLists.txt | 7 + recipes/ignition-math/all/conandata.yml | 14 + recipes/ignition-math/all/conanfile.py | 165 + .../0001-ign-math-6.7.0-cmake-fixes.patch | 64 + .../0002-ign-math-6.10.0-cmake-fixes.patch | 35 + .../all/test_package/CMakeLists.txt | 21 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 23 + recipes/ignition-math/config.yml | 5 + recipes/ignition-tools/all/CMakeLists.txt | 9 + recipes/ignition-tools/all/conandata.yml | 8 + recipes/ignition-tools/all/conanfile.py | 105 + .../0001-ign-tools-1.0.0-cmake-fixes.patch | 25 + .../0002-ign-tools-1.2.0-cmake-fixes.patch | 25 + .../0003-ign-tools-1.4.0-cmake-fixes.patch | 25 + .../all/test_package/CMakeLists.txt | 21 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/ignition-tools/config.yml | 3 + recipes/ignition-utils/all/CMakeLists.txt | 7 + recipes/ignition-utils/all/conandata.yml | 9 + recipes/ignition-utils/all/conanfile.py | 175 + .../0001-ign-utils-1.3.0-cmake-fixes.patch | 17 + .../all/test_package/CMakeLists.txt | 22 + .../all/test_package/conanfile.py | 20 + .../all/test_package/test_package.cpp | 18 + recipes/ignition-utils/config.yml | 3 + recipes/iir1/all/conandata.yml | 30 + recipes/iir1/all/conanfile.py | 104 + .../1.9.0-0001-no-export-static-win.patch | 14 + ...0-0002-Add-runtime-export-to-install.patch | 24 + .../1.9.0-0003-disable-test-demo.patch | 12 + recipes/iir1/all/test_package/CMakeLists.txt | 12 + recipes/iir1/all/test_package/conanfile.py | 26 + .../iir1/all/test_package/test_package.cpp | 11 + .../iir1/all/test_v1_package/CMakeLists.txt | 8 + recipes/iir1/all/test_v1_package/conanfile.py | 17 + recipes/iir1/config.yml | 5 + recipes/im95able-rea/all/conandata.yml | 9 + recipes/im95able-rea/all/conanfile.py | 81 + .../all/patches/0001-include-limits.patch | 12 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/im95able-rea/config.yml | 3 + recipes/imagemagick/all/conandata.yml | 13 + recipes/imagemagick/all/conanfile.py | 522 +++ .../remove-unnecessary-dependencies.patch | 194 + .../all/test_package/CMakeLists.txt | 8 + .../imagemagick/all/test_package/conanfile.py | 42 + .../all/test_package/test_package.c | 24 + recipes/imagemagick/config.yml | 4 + recipes/imagl/all/CMakeLists.txt | 7 + recipes/imagl/all/conandata.yml | 26 + recipes/imagl/all/conanfile.py | 131 + .../0001-no-unmanaged-conan-0.1.x.patch | 18 + .../0001-no-unmanaged-conan-0.2.1.patch | 18 + recipes/imagl/all/test_package/CMakeLists.txt | 9 + recipes/imagl/all/test_package/conanfile.py | 17 + recipes/imagl/all/test_package/example.cpp | 12 + recipes/imagl/config.yml | 9 + recipes/imake/all/conandata.yml | 8 + recipes/imake/all/conanfile.py | 141 + .../patches/0001-reproducible-behavior.patch | 14 + .../patches/0002-msvc-debug-build_type.patch | 57 + recipes/imake/all/test_package/Imake.tmpl | 2 + recipes/imake/all/test_package/Imakefile | 1 + recipes/imake/all/test_package/conanfile.py | 45 + recipes/imake/all/test_v1_package/Imake.tmpl | 2 + recipes/imake/all/test_v1_package/Imakefile | 1 + .../imake/all/test_v1_package/conanfile.py | 44 + recipes/imake/config.yml | 3 + recipes/imath/all/conandata.yml | 13 + recipes/imath/all/conanfile.py | 99 + recipes/imath/all/test_package/CMakeLists.txt | 8 + recipes/imath/all/test_package/conanfile.py | 26 + .../imath/all/test_package/test_package.cpp | 8 + .../imath/all/test_v1_package/CMakeLists.txt | 8 + .../imath/all/test_v1_package/conanfile.py | 17 + recipes/imath/config.yml | 9 + recipes/imgui/all/CMakeLists.txt | 54 + recipes/imgui/all/conandata.yml | 38 + recipes/imgui/all/conanfile.py | 88 + recipes/imgui/all/test_package/CMakeLists.txt | 12 + recipes/imgui/all/test_package/conanfile.py | 26 + .../imgui/all/test_package/my_imgui_config.h | 11 + .../imgui/all/test_package/test_package.cpp | 49 + .../imgui/all/test_v1_package/CMakeLists.txt | 8 + .../imgui/all/test_v1_package/conanfile.py | 17 + recipes/imgui/config.yml | 27 + recipes/imguizmo/all/CMakeLists.txt | 27 + recipes/imguizmo/all/conandata.yml | 4 + recipes/imguizmo/all/conanfile.py | 61 + .../imguizmo/all/test_package/CMakeLists.txt | 14 + .../imguizmo/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 15 + recipes/imguizmo/config.yml | 3 + recipes/immer/all/conandata.yml | 10 + recipes/immer/all/conanfile.py | 60 + recipes/immer/all/test_package/CMakeLists.txt | 13 + recipes/immer/all/test_package/conanfile.py | 17 + recipes/immer/all/test_package/example.cpp | 13 + recipes/immer/config.yml | 7 + recipes/implot/all/CMakeLists.txt | 28 + recipes/implot/all/conandata.yml | 13 + recipes/implot/all/conanfile.py | 72 + .../implot/all/test_package/CMakeLists.txt | 9 + recipes/implot/all/test_package/conanfile.py | 27 + .../implot/all/test_package/test_package.cpp | 6 + .../implot/all/test_v1_package/CMakeLists.txt | 8 + .../implot/all/test_v1_package/conanfile.py | 23 + recipes/implot/config.yml | 9 + recipes/imutils-cpp/all/conandata.yml | 9 + recipes/imutils-cpp/all/conanfile.py | 103 + .../all/patches/1.0.1-0001-fix-cmake.patch | 43 + .../1.0.1-0002-unuse-bits_stdcpp_h.patch | 49 + .../patches/1.0.1-0003-fix-path-cast.patch | 22 + .../all/test_package/CMakeLists.txt | 8 + .../imutils-cpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/imutils-cpp/config.yml | 3 + recipes/incbin/all/conandata.yml | 4 + recipes/incbin/all/conanfile.py | 37 + .../incbin/all/test_package/CMakeLists.txt | 8 + recipes/incbin/all/test_package/conanfile.py | 26 + .../incbin/all/test_package/test_package.c | 15 + .../incbin/all/test_v1_package/CMakeLists.txt | 8 + .../incbin/all/test_v1_package/conanfile.py | 18 + recipes/incbin/config.yml | 3 + recipes/indicators/all/conandata.yml | 13 + recipes/indicators/all/conanfile.py | 54 + .../all/test_package/CMakeLists.txt | 8 + .../indicators/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 57 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/indicators/config.yml | 9 + recipes/indirect_value/all/conandata.yml | 4 + recipes/indirect_value/all/conanfile.py | 70 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 9 + recipes/indirect_value/config.yml | 3 + recipes/influxdb-cpp/all/conandata.yml | 4 + recipes/influxdb-cpp/all/conanfile.py | 33 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 18 + .../influxdb-cpp/all/test_package/example.cpp | 6 + recipes/influxdb-cpp/config.yml | 3 + recipes/inih/all/conandata.yml | 13 + recipes/inih/all/conanfile.py | 101 + recipes/inih/all/test_package/CMakeLists.txt | 7 + recipes/inih/all/test_package/conanfile.py | 35 + recipes/inih/all/test_package/test_package.c | 43 + .../inih/all/test_v1_package/CMakeLists.txt | 8 + recipes/inih/all/test_v1_package/conanfile.py | 26 + recipes/inih/config.yml | 9 + recipes/inja/all/conandata.yml | 16 + recipes/inja/all/conanfile.py | 87 + recipes/inja/all/test_package/CMakeLists.txt | 12 + recipes/inja/all/test_package/conanfile.py | 25 + .../inja/all/test_package/test_package.cpp | 10 + .../inja/all/test_v1_package/CMakeLists.txt | 8 + recipes/inja/all/test_v1_package/conanfile.py | 17 + recipes/inja/config.yml | 11 + recipes/innoextract/all/conandata.yml | 10 + recipes/innoextract/all/conanfile.py | 71 + .../all/patches/0001-cmake-fix-module.patch | 13 + ...002-remove-custom-cmake-find-modules.patch | 19 + .../innoextract/all/test_package/conanfile.py | 14 + .../all/test_v1_package/conanfile.py | 19 + recipes/innoextract/config.yml | 3 + recipes/intel-neon2sse/all/conandata.yml | 4 + recipes/intel-neon2sse/all/conanfile.py | 64 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 26 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 16 + recipes/intel-neon2sse/config.yml | 3 + recipes/inversify-cpp/all/conandata.yml | 4 + recipes/inversify-cpp/all/conanfile.py | 50 + .../all/test_package/CMakeLists.txt | 15 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 22 + recipes/inversify-cpp/config.yml | 3 + recipes/ios-cmake/all/cmake-wrapper | 23 + recipes/ios-cmake/all/conandata.yml | 13 + recipes/ios-cmake/all/conanfile.py | 149 + .../ios-cmake/all/test_package/conanfile.py | 14 + recipes/ios-cmake/config.yml | 9 + recipes/iqa/all/CMakeLists.txt | 22 + recipes/iqa/all/conandata.yml | 4 + recipes/iqa/all/conanfile.py | 77 + recipes/iqa/all/test_package/CMakeLists.txt | 8 + recipes/iqa/all/test_package/conanfile.py | 17 + recipes/iqa/all/test_package/test_package.c | 6 + recipes/iqa/config.yml | 4 + recipes/irrxml/all/CMakeLists.txt | 20 + recipes/irrxml/all/conandata.yml | 7 + recipes/irrxml/all/conanfile.py | 70 + .../all/patches/1.2/irrtypes_debug_vs.patch | 24 + .../irrxml/all/test_package/CMakeLists.txt | 7 + recipes/irrxml/all/test_package/conanfile.py | 27 + recipes/irrxml/all/test_package/config.xml | 26 + .../irrxml/all/test_package/test_package.cpp | 45 + .../irrxml/all/test_v1_package/CMakeLists.txt | 8 + .../irrxml/all/test_v1_package/conanfile.py | 18 + recipes/irrxml/config.yml | 3 + recipes/isa-l/all/conandata.yml | 4 + recipes/isa-l/all/conanfile.py | 72 + recipes/isa-l/all/test_package/CMakeLists.txt | 8 + recipes/isa-l/all/test_package/conanfile.py | 23 + .../isa-l/all/test_package/test_package.cpp | 18 + recipes/isa-l/config.yml | 3 + recipes/isl/all/conandata.yml | 10 + recipes/isl/all/conanfile.py | 133 + recipes/isl/all/test_package/CMakeLists.txt | 8 + recipes/isl/all/test_package/conanfile.py | 17 + recipes/isl/all/test_package/test_package.c | 9 + recipes/isl/config.yml | 7 + recipes/iso8601lib/all/conandata.yml | 4 + recipes/iso8601lib/all/conanfile.py | 63 + .../all/test_package/CMakeLists.txt | 7 + .../iso8601lib/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/iso8601lib/config.yml | 3 + recipes/itk/all/CMakeLists.txt | 22 + recipes/itk/all/conandata.yml | 14 + recipes/itk/all/conanfile.py | 508 +++ .../patches/0001-find-conan-packages.patch | 172 + recipes/itk/all/test_package/CMakeLists.txt | 12 + recipes/itk/all/test_package/conanfile.py | 17 + recipes/itk/all/test_package/test_package.cpp | 23 + recipes/itk/config.yml | 5 + recipes/itlib/all/conandata.yml | 34 + recipes/itlib/all/conanfile.py | 44 + recipes/itlib/all/test_package/CMakeLists.txt | 9 + recipes/itlib/all/test_package/conanfile.py | 26 + .../itlib/all/test_package/test_package.cpp | 18 + .../itlib/all/test_v1_package/CMakeLists.txt | 9 + .../itlib/all/test_v1_package/conanfile.py | 18 + recipes/itlib/config.yml | 23 + recipes/ittapi/all/conandata.yml | 7 + recipes/ittapi/all/conanfile.py | 85 + .../ittapi/all/test_package/CMakeLists.txt | 7 + recipes/ittapi/all/test_package/conanfile.py | 25 + .../ittapi/all/test_package/test_package.cpp | 14 + .../ittapi/all/test_v1_package/CMakeLists.txt | 10 + .../ittapi/all/test_v1_package/conanfile.py | 19 + recipes/ittapi/config.yml | 5 + recipes/ixwebsocket/all/conandata.yml | 28 + recipes/ixwebsocket/all/conanfile.py | 153 + .../all/test_package/CMakeLists.txt | 8 + .../ixwebsocket/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/ixwebsocket/config.yml | 19 + recipes/jansson/all/conandata.yml | 10 + recipes/jansson/all/conanfile.py | 79 + .../jansson/all/test_package/CMakeLists.txt | 7 + recipes/jansson/all/test_package/conanfile.py | 26 + .../jansson/all/test_package/test_package.c | 201 + .../all/test_v1_package/CMakeLists.txt | 8 + .../jansson/all/test_v1_package/conanfile.py | 17 + recipes/jansson/config.yml | 7 + recipes/jasper/all/conandata.yml | 41 + recipes/jasper/all/conanfile.py | 145 + .../all/patches/2.0.33-0001-skip-rpath.patch | 24 + .../patches/2.0.33-0002-find-libjpeg.patch | 18 + .../all/patches/3.0.6-0001-skip-rpath.patch | 24 + .../all/patches/3.0.6-0002-find-libjpeg.patch | 18 + .../3.0.6-0003-deterministic-libname.patch | 11 + .../all/patches/4.0.0-0001-skip-rpath.patch | 22 + .../all/patches/4.0.0-0002-find-libjpeg.patch | 16 + .../4.0.0-0003-deterministic-libname.patch | 11 + .../jasper/all/test_package/CMakeLists.txt | 21 + recipes/jasper/all/test_package/conanfile.py | 26 + .../jasper/all/test_package/test_package.c | 43 + .../jasper/all/test_v1_package/CMakeLists.txt | 8 + .../jasper/all/test_v1_package/conanfile.py | 17 + recipes/jasper/config.yml | 7 + recipes/jbig/all/CMakeLists.txt | 34 + recipes/jbig/all/conandata.yml | 8 + recipes/jbig/all/conanfile.py | 74 + .../all/patches/0001-add-missing-export.patch | 9 + .../all/patches/0002-fix-msvc-export.patch | 41 + recipes/jbig/all/test_package/CMakeLists.txt | 7 + recipes/jbig/all/test_package/conanfile.py | 26 + recipes/jbig/all/test_package/test_package.c | 13 + .../jbig/all/test_v1_package/CMakeLists.txt | 8 + recipes/jbig/all/test_v1_package/conanfile.py | 17 + recipes/jbig/config.yml | 3 + recipes/jeaiii-itoa/all/conandata.yml | 4 + recipes/jeaiii-itoa/all/conanfile.py | 54 + .../all/test_package/CMakeLists.txt | 9 + .../jeaiii-itoa/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 18 + recipes/jeaiii-itoa/config.yml | 3 + recipes/jemalloc/all/conandata.yml | 11 + recipes/jemalloc/all/conanfile.py | 226 ++ ...-declare-system-functions-as-nothrow.patch | 90 + .../jemalloc/all/test_package/CMakeLists.txt | 9 + .../jemalloc/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 21 + recipes/jemalloc/config.yml | 5 + recipes/jerryscript/all/CMakeLists.txt | 7 + recipes/jerryscript/all/conandata.yml | 22 + recipes/jerryscript/all/conanfile.py | 250 ++ .../patches/0001-2.3.0-remove-werror.patch | 21 + .../patches/0002-2.4.0-remove-werror.patch | 21 + .../0003-2.4.0-no-CMAKE_SOURCE_DIR.patch | 11 + .../all/test_package/CMakeLists.txt | 8 + .../jerryscript/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 10 + recipes/jerryscript/config.yml | 7 + recipes/jfalcou-eve/all/conandata.yml | 16 + recipes/jfalcou-eve/all/conanfile.py | 87 + .../all/test_package/CMakeLists.txt | 8 + .../jfalcou-eve/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 16 + recipes/jfalcou-eve/config.yml | 11 + recipes/jinja2cpp/all/CMakeLists.txt | 7 + recipes/jinja2cpp/all/conandata.yml | 14 + recipes/jinja2cpp/all/conanfile.py | 148 + .../all/patches/fix-cmake-1.1.0.patch | 48 + .../all/patches/fix-cmake-1.2.1.patch | 39 + .../jinja2cpp/all/test_package/CMakeLists.txt | 11 + .../jinja2cpp/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 17 + recipes/jinja2cpp/config.yml | 5 + recipes/joltphysics/all/conandata.yml | 9 + recipes/joltphysics/all/conanfile.py | 160 + .../all/patches/0001-fix-cmake.patch | 90 + .../all/test_package/CMakeLists.txt | 8 + .../joltphysics/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 51 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/joltphysics/config.yml | 3 + recipes/jom/all/conandata.yml | 4 + recipes/jom/all/conanfile.py | 46 + recipes/jom/all/test_package/conanfile.py | 16 + recipes/jom/all/test_v1_package/conanfile.py | 13 + recipes/jom/config.yml | 3 + recipes/jpcre2/all/conandata.yml | 4 + recipes/jpcre2/all/conanfile.py | 33 + .../jpcre2/all/test_package/CMakeLists.txt | 10 + recipes/jpcre2/all/test_package/conanfile.py | 17 + .../jpcre2/all/test_package/test_package.cpp | 15 + recipes/jpcre2/config.yml | 3 + recipes/jpeg-compressor/all/CMakeLists.txt | 25 + recipes/jpeg-compressor/all/conandata.yml | 7 + recipes/jpeg-compressor/all/conanfile.py | 80 + .../patches/pr-18-remove-include-malloc.patch | 13 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 37 + .../all/test_package/testimg.jpg | Bin 0 -> 5764 bytes .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/jpeg-compressor/config.yml | 3 + recipes/jsmn/all/conandata.yml | 4 + recipes/jsmn/all/conanfile.py | 41 + recipes/jsmn/all/test_package/CMakeLists.txt | 7 + recipes/jsmn/all/test_package/conanfile.py | 26 + recipes/jsmn/all/test_package/test_package.c | 8 + .../jsmn/all/test_v1_package/CMakeLists.txt | 8 + recipes/jsmn/all/test_v1_package/conanfile.py | 17 + recipes/jsmn/config.yml | 3 + recipes/json-c/all/conandata.yml | 10 + recipes/json-c/all/conanfile.py | 70 + .../json-c/all/test_package/CMakeLists.txt | 7 + recipes/json-c/all/test_package/conanfile.py | 26 + .../json-c/all/test_package/test_package.c | 29 + .../json-c/all/test_v1_package/CMakeLists.txt | 8 + .../json-c/all/test_v1_package/conanfile.py | 17 + recipes/json-c/config.yml | 7 + .../json-schema-validator/all/conandata.yml | 24 + .../json-schema-validator/all/conanfile.py | 142 + .../patches/2.0.0-cmake_minimum_version.patch | 15 + .../patches/2.1.0-cmake_minimum_version.patch | 15 + .../all/patches/2.2.0-signed-char.patch | 64 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 65 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/json-schema-validator/config.yml | 7 + recipes/json_dto/all/conandata.yml | 22 + recipes/json_dto/all/conanfile.py | 74 + .../json_dto/all/test_package/CMakeLists.txt | 11 + .../json_dto/all/test_package/conanfile.py | 18 + recipes/json_dto/all/test_package/example.cpp | 76 + recipes/json_dto/config.yml | 15 + recipes/jsoncons/all/conandata.yml | 4 + recipes/jsoncons/all/conanfile.py | 47 + .../jsoncons/all/test_package/CMakeLists.txt | 8 + .../jsoncons/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 49 + .../all/test_v1_package/CMakeLists.txt | 11 + .../jsoncons/all/test_v1_package/conanfile.py | 18 + recipes/jsoncons/config.yml | 3 + recipes/jsoncpp/all/conandata.yml | 30 + recipes/jsoncpp/all/conanfile.py | 131 + .../all/patches/dont-force-pic-1.9.1.patch | 10 + .../all/patches/dont-force-pic-1.9.2.patch | 10 + .../all/patches/dont-force-pic-1.9.3.patch | 10 + .../patches/implicit-conversion-1.8.3.patch | 13 + .../patches/implicit-conversion-1.9.1.patch | 13 + recipes/jsoncpp/all/patches/no-examples.patch | 7 + .../jsoncpp/all/test_package/CMakeLists.txt | 8 + recipes/jsoncpp/all/test_package/conanfile.py | 26 + .../jsoncpp/all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../jsoncpp/all/test_v1_package/conanfile.py | 17 + recipes/jsoncpp/config.yml | 13 + recipes/jsonformoderncpp/all/conandata.yml | 4 + recipes/jsonformoderncpp/all/conanfile.py | 54 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 25 + recipes/jsonformoderncpp/config.yml | 3 + recipes/jsonnet/all/CMakeLists.txt | 9 + recipes/jsonnet/all/conandata.yml | 26 + recipes/jsonnet/all/conanfile.py | 109 + .../0.17.0/0001-fix-nlohmann-include.patch | 11 + .../all/patches/0.17.0/0002-cmake-fixes.patch | 87 + .../0.18.0/0001-fix-nlohmann-include.patch | 13 + .../all/patches/0.18.0/0002-cmake-fixes.patch | 103 + .../jsonnet/all/test_package/CMakeLists.txt | 14 + recipes/jsonnet/all/test_package/conanfile.py | 17 + .../jsonnet/all/test_package/test_package.c | 11 + .../jsonnet/all/test_package/test_package.cpp | 13 + recipes/jsonnet/config.yml | 7 + recipes/jthread-lite/all/conandata.yml | 4 + recipes/jthread-lite/all/conanfile.py | 59 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/jthread-lite/config.yml | 3 + recipes/jungle/all/CMakeLists.txt | 7 + recipes/jungle/all/conandata.yml | 40 + recipes/jungle/all/conanfile.py | 76 + .../all/patches/0001-cmake-alterations.patch | 52 + .../all/patches/0002-forestdb-path.patch | 62 + .../jungle/all/patches/0003-stdatomic.patch | 13 + .../0004-cmake-alterations-cci.20221201.patch | 48 + .../jungle/all/test_package/CMakeLists.txt | 11 + recipes/jungle/all/test_package/conanfile.py | 18 + .../jungle/all/test_package/test_package.cpp | 17 + recipes/jungle/config.yml | 5 + recipes/jwasm/all/conandata.yml | 13 + recipes/jwasm/all/conanfile.py | 66 + .../0001-2.13-fix-fatal-errors-msvc.patch | 21 + .../jwasm/all/patches/0002-fix-cmake.patch | 31 + recipes/jwasm/all/test_package/Lin64_1.asm | 24 + recipes/jwasm/all/test_package/conanfile.py | 28 + .../jwasm/all/test_v1_package/conanfile.py | 24 + recipes/jwasm/config.yml | 3 + recipes/jwt-cpp/all/conandata.yml | 37 + recipes/jwt-cpp/all/conanfile.py | 63 + .../0002-fix-openssl-change-version.patch | 12 + ...x-picojson-header-location-for-conan.patch | 6 + ...x-picojson-header-location-for-conan.patch | 6 + ...x-picojson-header-location-for-conan.patch | 12 + .../jwt-cpp/all/test_package/CMakeLists.txt | 17 + recipes/jwt-cpp/all/test_package/conanfile.py | 27 + .../jwt-cpp/all/test_package/test_package.cpp | 29 + .../all/test_package/traits/defaults.h | 58 + .../jwt-cpp/all/test_package/traits/traits.h | 76 + .../all/test_v1_package/CMakeLists.txt | 20 + .../jwt-cpp/all/test_v1_package/conanfile.py | 21 + recipes/jwt-cpp/config.yml | 11 + recipes/jxrlib/all/CMakeLists.txt | 89 + recipes/jxrlib/all/conandata.yml | 7 + recipes/jxrlib/all/conanfile.py | 89 + .../patches/0001-missing-declarations.patch | 26 + .../jxrlib/all/test_package/CMakeLists.txt | 7 + recipes/jxrlib/all/test_package/conanfile.py | 27 + recipes/jxrlib/all/test_package/test.jxr | Bin 0 -> 167308 bytes .../jxrlib/all/test_package/test_package.c | 32 + .../jxrlib/all/test_v1_package/CMakeLists.txt | 10 + .../jxrlib/all/test_v1_package/conanfile.py | 18 + recipes/jxrlib/config.yml | 3 + recipes/kainjow-mustache/all/conandata.yml | 4 + recipes/kainjow-mustache/all/conanfile.py | 35 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 18 + recipes/kainjow-mustache/config.yml | 3 + .../all/conandata.yml | 16 + .../all/conanfile.py | 64 + .../patches/0001-cmake-minimum-required.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + .../kaitai_struct_cpp_stl_runtime/config.yml | 5 + recipes/kangaru/all/conandata.yml | 10 + recipes/kangaru/all/conanfile.py | 93 + recipes/kangaru/all/patches/fix-cmake.patch | 38 + .../kangaru/all/test_package/CMakeLists.txt | 8 + recipes/kangaru/all/test_package/conanfile.py | 26 + .../kangaru/all/test_package/test_package.cpp | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../kangaru/all/test_v1_package/conanfile.py | 17 + recipes/kangaru/config.yml | 5 + recipes/kcov/all/CMakeLists.txt | 7 + recipes/kcov/all/conandata.yml | 14 + recipes/kcov/all/conanfile.py | 63 + .../all/patches/0001-fix-SOLIB-path.patch | 13 + .../0002-fix-missing-libssl-dependency.patch | 19 + recipes/kcov/all/test_package/conanfile.py | 9 + recipes/kcov/config.yml | 5 + recipes/kcp/all/CMakeLists.txt | 11 + recipes/kcp/all/conandata.yml | 14 + recipes/kcp/all/conanfile.py | 74 + .../0001-kcp-remove-add_library-STATIC.patch | 18 + recipes/kcp/all/test_package/CMakeLists.txt | 11 + recipes/kcp/all/test_package/conanfile.py | 16 + recipes/kcp/all/test_package/test_package.cpp | 82 + recipes/kcp/config.yml | 5 + recipes/kealib/all/CMakeLists.txt | 7 + recipes/kealib/all/conandata.yml | 14 + recipes/kealib/all/conanfile.py | 74 + .../kealib/all/patches/fix-cmake-1.4.14.patch | 20 + .../fix-export-symbols-and-cmake.patch | 219 ++ .../kealib/all/test_package/CMakeLists.txt | 8 + recipes/kealib/all/test_package/conanfile.py | 17 + .../kealib/all/test_package/test_package.cpp | 84 + recipes/kealib/config.yml | 5 + recipes/keychain/all/CMakeLists.txt | 7 + recipes/keychain/all/conandata.yml | 4 + recipes/keychain/all/conanfile.py | 62 + .../keychain/all/test_package/CMakeLists.txt | 9 + .../keychain/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 17 + recipes/keychain/config.yml | 3 + recipes/khrplatform/all/conandata.yml | 4 + recipes/khrplatform/all/conanfile.py | 43 + .../all/test_package/CMakeLists.txt | 7 + .../khrplatform/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/khrplatform/config.yml | 3 + recipes/kissfft/all/conandata.yml | 4 + recipes/kissfft/all/conanfile.py | 110 + .../kissfft/all/test_package/CMakeLists.txt | 7 + recipes/kissfft/all/test_package/conanfile.py | 26 + .../kissfft/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../kissfft/all/test_v1_package/conanfile.py | 17 + recipes/kissfft/config.yml | 3 + recipes/kitten/all/CMakeLists.txt | 7 + recipes/kitten/all/conandata.yml | 7 + recipes/kitten/all/conanfile.py | 88 + .../kitten/all/test_package/CMakeLists.txt | 11 + recipes/kitten/all/test_package/conanfile.py | 17 + .../kitten/all/test_package/test_package.cpp | 15 + recipes/kitten/config.yml | 5 + recipes/kmod/all/conandata.yml | 7 + recipes/kmod/all/conanfile.py | 110 + recipes/kmod/all/test_package/CMakeLists.txt | 7 + recipes/kmod/all/test_package/conanfile.py | 26 + recipes/kmod/all/test_package/test_package.c | 23 + .../kmod/all/test_v1_package/CMakeLists.txt | 8 + recipes/kmod/all/test_v1_package/conanfile.py | 17 + recipes/kmod/config.yml | 5 + recipes/kplot/all/CMakeLists.txt | 64 + recipes/kplot/all/conandata.yml | 4 + recipes/kplot/all/conanfile.py | 73 + recipes/kplot/all/test_package/CMakeLists.txt | 8 + recipes/kplot/all/test_package/conanfile.py | 26 + recipes/kplot/all/test_package/test_package.c | 14 + .../kplot/all/test_v1_package/CMakeLists.txt | 8 + .../kplot/all/test_v1_package/conanfile.py | 18 + recipes/kplot/config.yml | 3 + recipes/ktx/all/conandata.yml | 10 + recipes/ktx/all/conanfile.py | 130 + .../all/patches/0001-objutil-cxx-std.patch | 10 + .../0002-lodepng-no-export-symbols.patch | 16 + .../0003-clamp-include-algorithm.patch | 23 + .../patches/0004-unvendor-dependencies.patch | 48 + recipes/ktx/all/test_package/CMakeLists.txt | 7 + recipes/ktx/all/test_package/conanfile.py | 27 + recipes/ktx/all/test_package/etc1.ktx | Bin 0 -> 8260 bytes recipes/ktx/all/test_package/test_package.c | 19 + .../ktx/all/test_v1_package/CMakeLists.txt | 8 + recipes/ktx/all/test_v1_package/conanfile.py | 18 + recipes/ktx/config.yml | 3 + recipes/kuba-zip/all/conandata.yml | 22 + recipes/kuba-zip/all/conanfile.py | 75 + .../kuba-zip/all/test_package/CMakeLists.txt | 7 + .../kuba-zip/all/test_package/conanfile.py | 26 + .../kuba-zip/all/test_package/test_package.c | 28 + .../all/test_v1_package/CMakeLists.txt | 8 + .../kuba-zip/all/test_v1_package/conanfile.py | 17 + recipes/kuba-zip/config.yml | 15 + recipes/laszip/all/conandata.yml | 8 + recipes/laszip/all/conanfile.py | 73 + .../patches/0001-no-build-laszip-api.patch | 9 + .../0002-no-rpath-and-relocatable-macos.patch | 29 + .../laszip/all/test_package/CMakeLists.txt | 7 + recipes/laszip/all/test_package/conanfile.py | 26 + .../laszip/all/test_package/test_package.c | 13 + .../laszip/all/test_v1_package/CMakeLists.txt | 8 + .../laszip/all/test_v1_package/conanfile.py | 17 + recipes/laszip/config.yml | 3 + recipes/lcms/all/conandata.yml | 16 + recipes/lcms/all/conanfile.py | 103 + .../2.13.1-0001-fix-msvc-import-lib.patch | 10 + recipes/lcms/all/test_package/CMakeLists.txt | 7 + recipes/lcms/all/test_package/conanfile.py | 26 + recipes/lcms/all/test_package/test_package.c | 8 + .../lcms/all/test_v1_package/CMakeLists.txt | 8 + recipes/lcms/all/test_v1_package/conanfile.py | 17 + recipes/lcms/config.yml | 5 + recipes/ldns/all/conandata.yml | 4 + recipes/ldns/all/conanfile.py | 116 + recipes/ldns/all/test_package/CMakeLists.txt | 9 + recipes/ldns/all/test_package/conanfile.py | 25 + recipes/ldns/all/test_package/example.c | 46 + .../ldns/all/test_v1_package/CMakeLists.txt | 5 + recipes/ldns/all/test_v1_package/conanfile.py | 18 + recipes/ldns/config.yml | 3 + recipes/lely-core/all/conandata.yml | 4 + recipes/lely-core/all/conanfile.py | 241 ++ .../lely-core/all/test_package/CMakeLists.txt | 8 + .../lely-core/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 7 + .../all/test_v1_package/conanfile.py | 16 + recipes/lely-core/config.yml | 3 + recipes/lemon/all/CMakeLists.txt | 8 + recipes/lemon/all/conandata.yml | 7 + recipes/lemon/all/conanfile.py | 58 + .../0001-use-executable-template-path.patch | 65 + recipes/lemon/all/test_package/CMakeLists.txt | 12 + recipes/lemon/all/test_package/conanfile.py | 26 + recipes/lemon/all/test_package/gram.y | 71 + .../lemon/all/test_v1_package/CMakeLists.txt | 8 + .../lemon/all/test_v1_package/conanfile.py | 21 + recipes/lemon/config.yml | 3 + recipes/leptonica/all/conandata.yml | 25 + recipes/leptonica/all/conanfile.py | 256 ++ .../patches/fix-find-modules-variables.patch | 48 + .../leptonica/all/test_package/CMakeLists.txt | 7 + .../leptonica/all/test_package/conanfile.py | 26 + .../leptonica/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/leptonica/config.yml | 13 + recipes/lerc/all/conandata.yml | 23 + recipes/lerc/all/conanfile.py | 80 + .../2.1-add-CMakeLists-and-static.patch | 61 + .../all/patches/4.0.0-include-algorithm.patch | 24 + recipes/lerc/all/test_package/CMakeLists.txt | 12 + recipes/lerc/all/test_package/conanfile.py | 26 + .../lerc/all/test_package/test_package.cpp | 140 + .../lerc/all/test_v1_package/CMakeLists.txt | 8 + recipes/lerc/all/test_v1_package/conanfile.py | 17 + recipes/lerc/config.yml | 7 + recipes/lest/all/conandata.yml | 4 + recipes/lest/all/conanfile.py | 27 + recipes/lest/all/test_package/CMakeLists.txt | 9 + recipes/lest/all/test_package/conanfile.py | 17 + .../lest/all/test_package/test_package.cpp | 17 + recipes/lest/config.yml | 3 + recipes/leveldb/all/conandata.yml | 12 + recipes/leveldb/all/conanfile.py | 95 + .../patches/check_library_exists.1.22.patch | 30 + .../patches/check_library_exists.1.23.patch | 30 + .../leveldb/all/test_package/CMakeLists.txt | 8 + recipes/leveldb/all/test_package/conanfile.py | 26 + .../leveldb/all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../leveldb/all/test_v1_package/conanfile.py | 17 + recipes/leveldb/config.yml | 5 + recipes/lexbor/all/conandata.yml | 7 + recipes/lexbor/all/conanfile.py | 97 + .../lexbor/all/test_package/CMakeLists.txt | 12 + recipes/lexbor/all/test_package/conanfile.py | 26 + .../lexbor/all/test_package/test_package.c | 11 + .../lexbor/all/test_v1_package/CMakeLists.txt | 8 + .../lexbor/all/test_v1_package/conanfile.py | 18 + recipes/lexbor/config.yml | 5 + recipes/libaec/all/conandata.yml | 22 + recipes/libaec/all/conanfile.py | 106 + ...1.0.4-0001-Fix-static-library-builds.patch | 135 + .../patches/1.0.4-0002-fix-install-ios.patch | 10 + .../1.0.6-0001-fix-library-builds.patch | 113 + ....0.6-0002-fix-cmake-build-with-ninja.patch | 11 + .../libaec/all/test_package/CMakeLists.txt | 7 + recipes/libaec/all/test_package/conanfile.py | 33 + .../libaec/all/test_package/test_package.c | 55 + .../libaec/all/test_v1_package/CMakeLists.txt | 10 + .../libaec/all/test_v1_package/conanfile.py | 19 + recipes/libaec/config.yml | 5 + recipes/libaio/all/conandata.yml | 4 + recipes/libaio/all/conanfile.py | 77 + .../libaio/all/test_package/CMakeLists.txt | 7 + recipes/libaio/all/test_package/conanfile.py | 26 + .../libaio/all/test_package/test_package.c | 93 + .../libaio/all/test_v1_package/CMakeLists.txt | 8 + .../libaio/all/test_v1_package/conanfile.py | 18 + recipes/libaio/config.yml | 3 + recipes/libalsa/all/conandata.yml | 22 + recipes/libalsa/all/conanfile.py | 109 + ...1-control-empty-fix-the-static-build.patch | 25 + .../libalsa/all/test_package/CMakeLists.txt | 7 + recipes/libalsa/all/test_package/conanfile.py | 26 + .../libalsa/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libalsa/all/test_v1_package/conanfile.py | 17 + recipes/libalsa/config.yml | 13 + recipes/libaom-av1/all/conandata.yml | 51 + recipes/libaom-av1/all/conanfile.py | 99 + .../all/patches/0001-2.0.1-fix-install.patch | 34 + .../all/patches/0001-3.1.1-fix-install.patch | 34 + .../all/patches/0001-3.3.0-fix-install.patch | 21 + .../all/patches/0001-3.4.0-fix-install.patch | 21 + .../all/test_package/CMakeLists.txt | 7 + .../libaom-av1/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libaom-av1/config.yml | 15 + recipes/libarchive/all/conandata.yml | 84 + recipes/libarchive/all/conanfile.py | 185 + .../all/patches/0001-3.4.0-zlib-winapi.patch | 20 + .../all/patches/0001-3.4.3-zlib-winapi.patch | 20 + .../all/patches/0001-3.6.0-zlib-winapi.patch | 20 + .../all/patches/0001-3.6.2-zlib-winapi.patch | 20 + .../patches/0002-3.4.0-msvc-no-we4061.patch | 12 + .../all/patches/0003-3.4.0-cmake.patch | 101 + .../all/patches/0003-3.4.3-cmake.patch | 101 + .../all/patches/0003-3.5.2-cmake.patch | 101 + .../all/patches/0003-3.6.0-cmake.patch | 112 + .../all/patches/0003-3.6.2-cmake.patch | 103 + .../all/patches/0004-3.6.0-android.patch | 15 + .../0005-3.6.2-try-compile-cmakedeps.patch | 31 + .../all/test_package/CMakeLists.txt | 7 + .../libarchive/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libarchive/config.yml | 15 + recipes/libatomic_ops/all/conandata.yml | 4 + recipes/libatomic_ops/all/conanfile.py | 106 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.c | 54 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 19 + recipes/libatomic_ops/config.yml | 3 + recipes/libattr/all/conandata.yml | 4 + recipes/libattr/all/conanfile.py | 69 + .../libattr/all/test_package/CMakeLists.txt | 7 + recipes/libattr/all/test_package/conanfile.py | 26 + .../libattr/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libattr/all/test_v1_package/conanfile.py | 17 + recipes/libattr/config.yml | 4 + recipes/libavif/all/conandata.yml | 20 + recipes/libavif/all/conanfile.py | 137 + ...001-disable-developer-only-codepaths.patch | 34 + ...001-disable-developer-only-codepaths.patch | 20 + ...9.3-0002-fix-libyuv-version-handling.patch | 73 + .../libavif/all/test_package/CMakeLists.txt | 7 + recipes/libavif/all/test_package/conanfile.py | 26 + .../libavif/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libavif/all/test_v1_package/conanfile.py | 17 + recipes/libavif/config.yml | 5 + recipes/libavrocpp/all/conandata.yml | 70 + recipes/libavrocpp/all/conanfile.py | 104 + .../0001-add-iterator-include-1-11-0.patch | 96 + .../patches/0001-add-iterator-include.patch | 115 + .../patches/0002-disable-tests-1-10-1.patch | 33 + .../patches/0002-disable-tests-1-10-2.patch | 42 + .../patches/0002-disable-tests-1-11-0.patch | 30 + .../patches/0002-disable-tests-1-11-1.patch | 30 + ...03-allow-static-boost-linkage-1-11-0.patch | 18 + .../0003-allow-static-boost-linkage.patch | 29 + ...x-windows-shared-installation-1-10-1.patch | 31 + ...x-windows-shared-installation-1-10-2.patch | 34 + ...x-windows-shared-installation-1-11-0.patch | 13 + ...x-windows-shared-installation-1-11-1.patch | 13 + .../0005-fix-breaking-include-1-11-1.patch | 473 +++ .../all/test_package/CMakeLists.txt | 8 + .../libavrocpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 44 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/libavrocpp/config.yml | 9 + recipes/libb2/all/CMakeLists.txt | 48 + recipes/libb2/all/conandata.yml | 4 + recipes/libb2/all/conanfile.py | 65 + recipes/libb2/all/test_package/CMakeLists.txt | 9 + recipes/libb2/all/test_package/conanfile.py | 16 + recipes/libb2/all/test_package/example.cpp | 29 + recipes/libb2/config.yml | 3 + recipes/libbacktrace/all/conandata.yml | 8 + recipes/libbacktrace/all/conanfile.py | 108 + .../all/patches/0001-pointer-arithmetic.patch | 29 + .../0002-msvc-unistd-alternative.patch | 54 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libbacktrace/config.yml | 3 + recipes/libbasisu/all/CMakeLists.txt | 7 + recipes/libbasisu/all/conandata.yml | 8 + recipes/libbasisu/all/conanfile.py | 114 + .../all/patches/cmakelist_build_lib.patch | 205 + .../libbasisu/all/test_package/CMakeLists.txt | 10 + .../libbasisu/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 10 + recipes/libbasisu/config.yml | 3 + recipes/libbigwig/all/conandata.yml | 4 + recipes/libbigwig/all/conanfile.py | 99 + .../libbigwig/all/test_package/CMakeLists.txt | 8 + .../libbigwig/all/test_package/conanfile.py | 27 + .../libbigwig/all/test_package/test_package.c | 15 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 19 + recipes/libbigwig/config.yml | 3 + recipes/libbpf/all/conandata.yml | 10 + recipes/libbpf/all/conanfile.py | 92 + .../libbpf/all/test_package/CMakeLists.txt | 7 + recipes/libbpf/all/test_package/conanfile.py | 25 + .../libbpf/all/test_package/test_package.c | 9 + .../libbpf/all/test_v1_package/CMakeLists.txt | 8 + .../libbpf/all/test_v1_package/conanfile.py | 17 + recipes/libbpf/config.yml | 7 + recipes/libbsd/all/conandata.yml | 10 + recipes/libbsd/all/conanfile.py | 100 + .../all/patches/0001-support-macosx.patch | 456 +++ .../libbsd/all/test_package/CMakeLists.txt | 7 + recipes/libbsd/all/test_package/conanfile.py | 27 + .../libbsd/all/test_package/test_package.c | 15 + .../libbsd/all/test_v1_package/CMakeLists.txt | 8 + .../libbsd/all/test_v1_package/conanfile.py | 25 + recipes/libbsd/config.yml | 3 + recipes/libcap/all/conandata.yml | 102 + recipes/libcap/all/conanfile.py | 104 + ...001-Make.Rules-Remove-hardcoded-fPIC.patch | 26 + ...ules-Make-compile-tools-configurable.patch | 36 + .../0001-libcap-Remove-hardcoded-fPIC.patch | 27 + ...ules-Make-compile-tools-configurable.patch | 33 + .../libcap/all/test_package/CMakeLists.txt | 8 + recipes/libcap/all/test_package/conanfile.py | 30 + .../libcap/all/test_package/test_package.c | 15 + .../libcap/all/test_v1_package/CMakeLists.txt | 8 + .../libcap/all/test_v1_package/conanfile.py | 22 + recipes/libcap/config.yml | 21 + recipes/libcbor/all/conandata.yml | 28 + recipes/libcbor/all/conanfile.py | 79 + .../patches/0.7.0/001_fix_shared_build.patch | 1609 ++++++++ .../0.7.0/002_fix_cmake_module_path.patch | 12 + .../libcbor/all/test_package/CMakeLists.txt | 11 + recipes/libcbor/all/test_package/conanfile.py | 26 + .../libcbor/all/test_package/test_package.c | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libcbor/all/test_v1_package/conanfile.py | 17 + recipes/libcbor/config.yml | 11 + recipes/libccd/all/conandata.yml | 4 + recipes/libccd/all/conanfile.py | 102 + .../libccd/all/test_package/CMakeLists.txt | 7 + recipes/libccd/all/test_package/conanfile.py | 26 + .../libccd/all/test_package/test_package.c | 8 + .../libccd/all/test_v1_package/CMakeLists.txt | 8 + .../libccd/all/test_v1_package/conanfile.py | 17 + recipes/libccd/config.yml | 3 + recipes/libcds/all/conandata.yml | 7 + recipes/libcds/all/conanfile.py | 100 + recipes/libcds/all/patches/fix-cmake.patch | 57 + .../libcds/all/test_package/CMakeLists.txt | 12 + recipes/libcds/all/test_package/conanfile.py | 26 + .../libcds/all/test_package/test_package.cpp | 12 + .../libcds/all/test_v1_package/CMakeLists.txt | 8 + .../libcds/all/test_v1_package/conanfile.py | 17 + recipes/libcds/config.yml | 3 + recipes/libcheck/all/CMakeLists.txt | 7 + recipes/libcheck/all/conandata.yml | 16 + recipes/libcheck/all/conanfile.py | 119 + .../patches/0001-remove-check-h-header.patch | 2372 +++++++++++ .../0002-disable-cmake-subproject-check.patch | 11 + .../0003-don-t-check-subunit-dependency.patch | 12 + ...0004-install-shared-static-exclusive.patch | 15 + ...0005-add-missing-lib-pthread_mutex-c.patch | 74 + .../libcheck/all/test_package/CMakeLists.txt | 14 + .../libcheck/all/test_package/conanfile.py | 17 + .../libcheck/all/test_package/test_package.c | 46 + recipes/libcheck/config.yml | 3 + recipes/libcoap/all/CMakeLists.txt | 7 + recipes/libcoap/all/conandata.yml | 7 + recipes/libcoap/all/conanfile.py | 111 + .../libcoap/all/test_package/CMakeLists.txt | 12 + recipes/libcoap/all/test_package/conanfile.py | 24 + .../libcoap/all/test_package/test_package.cpp | 22 + recipes/libcoap/config.yml | 6 + recipes/libconfig/all/conandata.yml | 7 + recipes/libconfig/all/conanfile.py | 106 + .../libconfig/all/test_package/CMakeLists.txt | 10 + .../libconfig/all/test_package/conanfile.py | 28 + .../libconfig/all/test_package/test_package.c | 10 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/libconfig/config.yml | 5 + recipes/libconfuse/all/conandata.yml | 7 + recipes/libconfuse/all/conanfile.py | 99 + .../all/test_package/CMakeLists.txt | 7 + .../libconfuse/all/test_package/conanfile.py | 32 + .../libconfuse/all/test_package/hello.conf | 3 + .../all/test_package/test_package.c | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 23 + recipes/libconfuse/config.yml | 5 + recipes/libcoro/all/conandata.yml | 15 + recipes/libcoro/all/conanfile.py | 101 + .../all/patches/allow-shared-lib.patch | 9 + .../all/patches/disable-git-config.patch | 18 + .../all/patches/fix-dependencies.patch | 32 + .../libcoro/all/test_package/CMakeLists.txt | 8 + recipes/libcoro/all/test_package/conanfile.py | 26 + .../libcoro/all/test_package/test_package.cpp | 35 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libcoro/all/test_v1_package/conanfile.py | 17 + recipes/libcoro/config.yml | 3 + recipes/libcorrect/all/conandata.yml | 8 + recipes/libcorrect/all/conanfile.py | 84 + ...0001-Support-CMake-BUILD_SHARED_LIBS.patch | 65 + .../0002-Export-symbols-for-windows.patch | 296 ++ .../all/test_package/CMakeLists.txt | 7 + .../libcorrect/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/libcorrect/config.yml | 3 + recipes/libcpuid/all/CMakeLists.txt | 13 + recipes/libcpuid/all/conandata.yml | 14 + recipes/libcpuid/all/conanfile.py | 93 + .../all/patches/0.5.0-cmake-fixes.patch | 45 + .../libcpuid/all/test_package/CMakeLists.txt | 10 + .../libcpuid/all/test_package/conanfile.py | 19 + .../libcpuid/all/test_package/test_package.c | 51 + recipes/libcpuid/config.yml | 5 + recipes/libcuckoo/all/conandata.yml | 7 + recipes/libcuckoo/all/conanfile.py | 70 + .../libcuckoo/all/test_package/CMakeLists.txt | 10 + .../libcuckoo/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 22 + .../all/test_v1_package/CMakeLists.txt | 13 + .../all/test_v1_package/conanfile.py | 15 + recipes/libcuckoo/config.yml | 5 + recipes/libcurl/all/conandata.yml | 40 + recipes/libcurl/all/conanfile.py | 717 ++++ recipes/libcurl/all/lib_Makefile_add.am | 24 + .../libcurl/all/patches/004-no-checksrc.patch | 12 + .../libcurl/all/test_package/CMakeLists.txt | 7 + recipes/libcurl/all/test_package/conanfile.py | 52 + .../libcurl/all/test_package/test_package.c | 35 + .../all/test_v1_package/CMakeLists.txt | 9 + .../libcurl/all/test_v1_package/conanfile.py | 43 + recipes/libcurl/config.yml | 27 + recipes/libdaemon/all/conandata.yml | 4 + recipes/libdaemon/all/conanfile.py | 100 + .../libdaemon/all/test_package/CMakeLists.txt | 7 + .../libdaemon/all/test_package/conanfile.py | 27 + .../libdaemon/all/test_package/test_package.c | 195 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/libdaemon/config.yml | 3 + recipes/libdb/all/conandata.yml | 14 + recipes/libdb/all/conanfile.py | 272 ++ .../0001-rename_atomic_compare_exchange.patch | 20 + .../0002-no-conditional-tcl-include.patch | 197 + ...msvc-db_tcl-add-static-configuration.patch | 169 + ...svc-tcl-include-conanbuildinfo-props.patch | 9 + recipes/libdb/all/test_package/CMakeLists.txt | 8 + recipes/libdb/all/test_package/conanfile.py | 16 + recipes/libdb/all/test_package/test_package.c | 21 + recipes/libdb/config.yml | 3 + recipes/libdc1394/all/conandata.yml | 4 + recipes/libdc1394/all/conanfile.py | 103 + .../libdc1394/all/test_package/CMakeLists.txt | 7 + .../libdc1394/all/test_package/conanfile.py | 26 + .../libdc1394/all/test_package/test_package.c | 52 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libdc1394/config.yml | 3 + recipes/libde265/all/conandata.yml | 16 + recipes/libde265/all/conanfile.py | 123 + .../all/patches/0001-optional-sdl.patch | 13 + .../0002-fix-out-of-source-build.patch | 10 + .../libde265/all/test_package/CMakeLists.txt | 7 + .../libde265/all/test_package/conanfile.py | 26 + .../libde265/all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libde265/all/test_v1_package/conanfile.py | 17 + recipes/libde265/config.yml | 7 + recipes/libdeflate/all/conandata.yml | 10 + recipes/libdeflate/all/conanfile.py | 78 + .../all/test_package/CMakeLists.txt | 11 + .../libdeflate/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libdeflate/config.yml | 19 + recipes/libdeflate/pre_1.15/conandata.yml | 44 + recipes/libdeflate/pre_1.15/conanfile.py | 120 + .../patches/1.12-0001-fix-makefiles.patch | 40 + .../patches/1.14-0001-fix-makefiles.patch | 40 + .../patches/1.7-0001-fix-makefiles.patch | 40 + .../patches/1.9-0001-fix-makefiles.patch | 40 + .../pre_1.15/test_package/CMakeLists.txt | 7 + .../pre_1.15/test_package/conanfile.py | 26 + .../pre_1.15/test_package/test_package.c | 8 + .../pre_1.15/test_v1_package/CMakeLists.txt | 8 + .../pre_1.15/test_v1_package/conanfile.py | 17 + recipes/libdisasm/all/conandata.yml | 9 + recipes/libdisasm/all/conanfile.py | 109 + .../all/patches/0001-fix-size-of-void.patch | 27 + ...0002-only-build-libdisasm-by-default.patch | 8 + .../patches/0003-libdisasm-no-undefined.patch | 11 + .../libdisasm/all/test_package/CMakeLists.txt | 7 + .../libdisasm/all/test_package/conanfile.py | 28 + .../libdisasm/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/libdisasm/config.yml | 3 + recipes/libdispatch/all/CMakeLists.txt | 7 + recipes/libdispatch/all/conandata.yml | 4 + recipes/libdispatch/all/conanfile.py | 66 + .../all/test_package/CMakeLists.txt | 12 + .../libdispatch/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 6 + recipes/libdispatch/config.yml | 3 + recipes/libdivide/all/conandata.yml | 7 + recipes/libdivide/all/conanfile.py | 82 + .../libdivide/all/test_package/CMakeLists.txt | 15 + .../libdivide/all/test_package/conanfile.py | 19 + .../libdivide/all/test_package/test_package.c | 12 + .../all/test_package/test_package.cpp | 11 + recipes/libdivide/config.yml | 5 + recipes/libdmtx/all/conandata.yml | 12 + recipes/libdmtx/all/conanfile.py | 86 + .../all/patches/0001-0.7.7-fix-version.patch | 11 + .../all/patches/0002-0.7.7-add-install.patch | 14 + .../libdmtx/all/test_package/CMakeLists.txt | 8 + recipes/libdmtx/all/test_package/conanfile.py | 26 + .../libdmtx/all/test_package/test_package.c | 100 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libdmtx/all/test_v1_package/conanfile.py | 18 + recipes/libdmtx/config.yml | 3 + recipes/libdrm/all/conandata.yml | 7 + recipes/libdrm/all/conanfile.py | 188 + .../libdrm/all/test_package/CMakeLists.txt | 9 + recipes/libdrm/all/test_package/conanfile.py | 18 + .../libdrm/all/test_package/test_package.c | 11 + recipes/libdrm/config.yml | 5 + recipes/libdwarf/all/conandata.yml | 19 + recipes/libdwarf/all/conanfile.py | 107 + .../all/patches/0.5.0-0001-fix-DW_API.patch | 13 + .../all/patches/0.5.0-0001-fix-cmake.patch | 105 + .../all/patches/20191104-0001-patch.patch | 178 + .../libdwarf/all/test_package/CMakeLists.txt | 11 + .../libdwarf/all/test_package/conanfile.py | 25 + .../libdwarf/all/test_package/test_package.c | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libdwarf/all/test_v1_package/conanfile.py | 18 + recipes/libdwarf/config.yml | 5 + recipes/libdxfrw/all/conandata.yml | 7 + recipes/libdxfrw/all/conanfile.py | 80 + .../libdxfrw/all/test_package/CMakeLists.txt | 8 + .../libdxfrw/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 5 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libdxfrw/all/test_v1_package/conanfile.py | 18 + recipes/libdxfrw/config.yml | 5 + recipes/libe57format/all/conandata.yml | 13 + recipes/libe57format/all/conanfile.py | 111 + .../all/patches/0001-fix-pic.patch | 10 + .../all/patches/0002-missing-include.patch | 11 + .../all/patches/2.3.0-0001-fix-pic.patch | 10 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/libe57format/config.yml | 5 + recipes/libelf/all/CMakeLists.txt | 31 + recipes/libelf/all/conandata.yml | 7 + recipes/libelf/all/conanfile.py | 123 + .../libelf/all/test_package/CMakeLists.txt | 7 + recipes/libelf/all/test_package/conanfile.py | 26 + .../libelf/all/test_package/test_package.c | 114 + .../libelf/all/test_v1_package/CMakeLists.txt | 8 + .../libelf/all/test_v1_package/conanfile.py | 17 + recipes/libelf/config.yml | 3 + recipes/libelfin/all/CMakeLists.txt | 77 + recipes/libelfin/all/conandata.yml | 11 + recipes/libelfin/all/conanfile.py | 64 + ...b16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch | 173 + recipes/libelfin/all/patches/const-fix.patch | 19 + .../libelfin/all/test_package/CMakeLists.txt | 11 + recipes/libelfin/all/test_package/Makefile | 5 + .../libelfin/all/test_package/conanfile.py | 19 + recipes/libelfin/all/test_package/hello | Bin 0 -> 8468 bytes recipes/libelfin/all/test_package/hello.asm | 16 + .../all/test_package/test_package.cpp | 29 + recipes/libelfin/config.yml | 3 + recipes/libepoxy/all/conandata.yml | 15 + recipes/libepoxy/all/conanfile.py | 119 + ...x-for-building-on-non-English-locale.patch | 23 + .../libepoxy/all/test_package/CMakeLists.txt | 7 + .../libepoxy/all/test_package/conanfile.py | 26 + .../libepoxy/all/test_package/test_package.c | 90 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libepoxy/all/test_v1_package/conanfile.py | 17 + recipes/libepoxy/config.yml | 7 + recipes/libest/all/conandata.yml | 10 + recipes/libest/all/conanfile.py | 80 + ...examples-are-broken-don-t-build-them.patch | 27 + .../libest/all/patches/0002-add-extern.patch | 13 + .../libest/all/test_package/CMakeLists.txt | 8 + recipes/libest/all/test_package/conanfile.py | 16 + recipes/libest/all/test_package/example.c | 123 + recipes/libest/config.yml | 3 + recipes/libev/all/CMakeLists.txt | 22 + recipes/libev/all/conandata.yml | 10 + recipes/libev/all/conanfile.py | 109 + recipes/libev/all/config.h | 128 + recipes/libev/all/test_package/CMakeLists.txt | 7 + recipes/libev/all/test_package/conanfile.py | 26 + recipes/libev/all/test_package/test_package.c | 8 + .../libev/all/test_v1_package/CMakeLists.txt | 8 + .../libev/all/test_v1_package/conanfile.py | 17 + recipes/libev/config.yml | 7 + recipes/libevent/all/conandata.yml | 12 + recipes/libevent/all/conanfile.py | 132 + .../all/patches/fix-cmake-2.1.11.patch | 39 + .../all/patches/fix-cmake-2.1.12.patch | 41 + .../libevent/all/test_package/CMakeLists.txt | 7 + .../libevent/all/test_package/conanfile.py | 26 + .../libevent/all/test_package/test_package.c | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libevent/all/test_v1_package/conanfile.py | 17 + recipes/libevent/config.yml | 5 + recipes/libexif/all/conandata.yml | 12 + recipes/libexif/all/conanfile.py | 103 + .../all/patches/replace_ssize_t_windows.patch | 16 + .../libexif/all/test_package/CMakeLists.txt | 7 + recipes/libexif/all/test_package/conanfile.py | 26 + .../libexif/all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libexif/all/test_v1_package/conanfile.py | 17 + recipes/libexif/config.yml | 5 + recipes/libfabric/all/conandata.yml | 4 + recipes/libfabric/all/conanfile.py | 99 + .../libfabric/all/test_package/CMakeLists.txt | 8 + .../libfabric/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 9 + recipes/libfabric/config.yml | 3 + recipes/libfdk_aac/all/conandata.yml | 10 + recipes/libfdk_aac/all/conanfile.py | 158 + .../all/test_package/CMakeLists.txt | 8 + .../libfdk_aac/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 33 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libfdk_aac/config.yml | 7 + recipes/libffi/all/conandata.yml | 42 + recipes/libffi/all/conanfile.py | 173 + .../patches/0002-3.3-fix-libtool-path.patch | 20 + .../patches/0002-3.4.2-fix-libtool-path.patch | 20 + .../patches/0002-3.4.3-fix-libtool-path.patch | 20 + .../0004-3.3-fix-complex-type-msvc.patch | 56 + ...raries-to-arch-dependent-directories.patch | 11 + ...raries-to-arch-dependent-directories.patch | 11 + ...raries-to-arch-dependent-directories.patch | 11 + ...raries-to-arch-dependent-directories.patch | 13 + .../0006-3.3-library-no-version-suffix.patch | 11 + ...0006-3.4.2-library-no-version-suffix.patch | 11 + ...0006-3.4.3-library-no-version-suffix.patch | 11 + ...0006-3.4.4-library-no-version-suffix.patch | 13 + ...-forward-declare-open_temp_exec_file.patch | 30 + .../libffi/all/test_package/CMakeLists.txt | 8 + recipes/libffi/all/test_package/conanfile.py | 37 + .../libffi/all/test_package/test_package.c | 99 + .../libffi/all/test_v1_package/CMakeLists.txt | 11 + .../libffi/all/test_v1_package/conanfile.py | 17 + recipes/libffi/config.yml | 9 + recipes/libfreenect/all/conandata.yml | 7 + recipes/libfreenect/all/conanfile.py | 86 + .../all/patches/0.6.2-fix-cmake.patch | 60 + .../all/test_package/CMakeLists.txt | 7 + .../libfreenect/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libfreenect/config.yml | 3 + recipes/libfreenect2/all/CMakeLists.txt | 7 + recipes/libfreenect2/all/conandata.yml | 10 + recipes/libfreenect2/all/conanfile.py | 110 + .../all/patches/0.2.1-fix-cmake.patch | 203 + .../patches/0.2.1-generate-resources.patch | 41 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/libfreenect2/config.yml | 3 + recipes/libftdi/0.x/CMakeLists.txt | 10 + recipes/libftdi/0.x/conandata.yml | 8 + recipes/libftdi/0.x/conanfile.py | 90 + .../0.x/patches/0001-cmake-fixes.patch | 164 + .../libftdi/0.x/test_package/CMakeLists.txt | 8 + recipes/libftdi/0.x/test_package/conanfile.py | 18 + .../libftdi/0.x/test_package/test_package.c | 47 + recipes/libftdi/1.x/conandata.yml | 9 + recipes/libftdi/1.x/conanfile.py | 111 + .../1.x/patches/0001-cmake-targets.patch | 830 ++++ .../libftdi/1.x/test_package/CMakeLists.txt | 11 + recipes/libftdi/1.x/test_package/conanfile.py | 26 + .../libftdi/1.x/test_package/test_package.cpp | 49 + .../1.x/test_v1_package/CMakeLists.txt | 11 + .../libftdi/1.x/test_v1_package/conanfile.py | 18 + recipes/libftdi/config.yml | 5 + recipes/libfuse/2.x.x/conandata.yml | 4 + recipes/libfuse/2.x.x/conanfile.py | 77 + .../libfuse/2.x.x/test_package/CMakeLists.txt | 8 + .../libfuse/2.x.x/test_package/conanfile.py | 26 + .../libfuse/2.x.x/test_package/test_package.c | 6 + .../2.x.x/test_v1_package/CMakeLists.txt | 8 + .../2.x.x/test_v1_package/conanfile.py | 17 + recipes/libfuse/all/conandata.yml | 4 + recipes/libfuse/all/conanfile.py | 77 + .../libfuse/all/test_package/CMakeLists.txt | 8 + recipes/libfuse/all/test_package/conanfile.py | 26 + .../libfuse/all/test_package/test_package.c | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libfuse/all/test_v1_package/conanfile.py | 17 + recipes/libfuse/config.yml | 5 + recipes/libgcrypt/all/conandata.yml | 4 + recipes/libgcrypt/all/conanfile.py | 84 + .../libgcrypt/all/test_package/CMakeLists.txt | 7 + .../libgcrypt/all/test_package/conanfile.py | 26 + .../libgcrypt/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libgcrypt/config.yml | 3 + recipes/libgd/all/conandata.yml | 61 + recipes/libgd/all/conanfile.py | 138 + .../all/patches/2.2.5-msvc-static-lib.patch | 17 + .../all/patches/2.2.5-qualify-nondll.patch | 30 + .../all/patches/2.3.2-qualify-nondll.patch | 34 + .../all/patches/2.3.3-qualify-nondll.patch | 26 + .../libgd/all/patches/2.3.x-png-msvc.patch | 54 + .../libgd/all/patches/qualify-nondll.patch | 30 + .../libgd/all/patches/remove-unistd-h.patch | 12 + recipes/libgd/all/test_package/CMakeLists.txt | 8 + recipes/libgd/all/test_package/conanfile.py | 26 + recipes/libgd/all/test_package/test_package.c | 8 + .../libgd/all/test_v1_package/CMakeLists.txt | 8 + .../libgd/all/test_v1_package/conanfile.py | 18 + recipes/libgd/config.yml | 11 + recipes/libgeotiff/all/conandata.yml | 22 + recipes/libgeotiff/all/conanfile.py | 126 + .../all/patches/fix-cmake-1.5.1.patch | 102 + .../all/patches/fix-cmake-1.6.0.patch | 102 + .../all/patches/fix-cmake-1.7.1.patch | 78 + .../all/test_package/CMakeLists.txt | 7 + .../libgeotiff/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 98 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libgeotiff/config.yml | 9 + recipes/libgettext/all/conandata.yml | 22 + recipes/libgettext/all/conanfile.py | 227 ++ ...001-build-Fix-build-errors-with-MSVC.patch | 362 ++ ...emmove-is-intrinsic-function-on-MSVC.patch | 72 + ...eported-by-Gabor-Z.-Papp-gzp-papp.hu.patch | 29 + .../all/test_package/CMakeLists.txt | 7 + .../libgettext/all/test_package/conanfile.py | 49 + .../po/en/conan.mo.workaround_git_ignore | Bin 0 -> 460 bytes .../all/test_package/po/en/conan.po | 23 + .../po/es/conan.mo.workaround_git_ignore | Bin 0 -> 460 bytes .../all/test_package/po/es/conan.po | 23 + .../po/ru/conan.mo.workaround_git_ignore | Bin 0 -> 535 bytes .../all/test_package/po/ru/conan.po | 24 + .../all/test_package/test_package.c | 26 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 31 + recipes/libgettext/config.yml | 5 + recipes/libgit2/0.27.x/CMakeLists.txt | 7 + recipes/libgit2/0.27.x/conandata.yml | 4 + recipes/libgit2/0.27.x/conanfile.py | 156 + .../0.27.x/test_package/CMakeLists.txt | 10 + .../libgit2/0.27.x/test_package/conanfile.py | 17 + .../0.27.x/test_package/test_package.c | 34 + recipes/libgit2/0.28.x/CMakeLists.txt | 7 + recipes/libgit2/0.28.x/conandata.yml | 4 + recipes/libgit2/0.28.x/conanfile.py | 160 + .../0.28.x/test_package/CMakeLists.txt | 10 + .../libgit2/0.28.x/test_package/conanfile.py | 17 + .../0.28.x/test_package/test_package.c | 34 + recipes/libgit2/all/CMakeLists.txt | 7 + recipes/libgit2/all/conandata.yml | 38 + recipes/libgit2/all/conanfile.py | 181 + .../all/patches/1.0.1-0001-fix-cmake.patch | 33 + .../all/patches/1.1.1-0001-fix-cmake.patch | 33 + .../all/patches/1.2.0-0001-fix-cmake.patch | 33 + .../all/patches/1.3.0-0001-fix-cmake.patch | 40 + .../all/patches/1.4.3-0001-fix-cmake.patch | 42 + .../libgit2/all/test_package/CMakeLists.txt | 10 + recipes/libgit2/all/test_package/conanfile.py | 17 + .../libgit2/all/test_package/test_package.c | 34 + recipes/libgit2/config.yml | 17 + recipes/libglvnd/all/conandata.yml | 7 + recipes/libglvnd/all/conanfile.py | 166 + .../libglvnd/all/test_package/CMakeLists.txt | 8 + .../libglvnd/all/test_package/conanfile.py | 19 + .../libglvnd/all/test_package/test_package.c | 17 + recipes/libglvnd/config.yml | 5 + recipes/libgpg-error/all/conandata.yml | 7 + recipes/libgpg-error/all/conanfile.py | 84 + .../all/patches/0001-gawk-namespace.patch | 53 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libgpg-error/config.yml | 3 + recipes/libgphoto2/all/conandata.yml | 7 + recipes/libgphoto2/all/conanfile.py | 131 + .../patches/2.5.27-0001-macos_snprintf.patch | 12 + .../all/test_package/CMakeLists.txt | 7 + .../libgphoto2/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libgphoto2/config.yml | 3 + recipes/libgpiod/all/conandata.yml | 4 + recipes/libgpiod/all/conanfile.py | 87 + .../libgpiod/all/test_package/CMakeLists.txt | 8 + .../libgpiod/all/test_package/conanfile.py | 18 + .../libgpiod/all/test_package/test_package.c | 7 + recipes/libgpiod/config.yml | 3 + recipes/libgta/all/CMakeLists.txt | 7 + recipes/libgta/all/conandata.yml | 4 + recipes/libgta/all/conanfile.py | 69 + .../libgta/all/test_package/CMakeLists.txt | 8 + recipes/libgta/all/test_package/conanfile.py | 17 + .../libgta/all/test_package/test_package.c | 15 + recipes/libgta/config.yml | 3 + recipes/libhal/all/conandata.yml | 4 + recipes/libhal/all/conanfile.py | 77 + .../libhal/all/test_package/CMakeLists.txt | 9 + recipes/libhal/all/test_package/conanfile.py | 25 + recipes/libhal/all/test_package/main.cpp | 30 + .../libhal/all/test_v1_package/CMakeLists.txt | 12 + .../libhal/all/test_v1_package/conanfile.py | 18 + recipes/libhal/config.yml | 3 + recipes/libharu/all/conandata.yml | 18 + recipes/libharu/all/conanfile.py | 105 + .../patches/0001-allow-cmake-subproject.patch | 82 + .../0002-linux-add-m-system-library.patch | 19 + .../patches/0003-rename-tiff-symbols.patch | 46 + .../libharu/all/test_package/CMakeLists.txt | 8 + recipes/libharu/all/test_package/conanfile.py | 30 + .../libharu/all/test_package/test_package.c | 149 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libharu/all/test_v1_package/conanfile.py | 20 + recipes/libharu/config.yml | 5 + recipes/libheif/all/conandata.yml | 22 + recipes/libheif/all/conanfile.py | 119 + .../all/patches/0001-cmake-1.9.1.patch | 146 + .../all/patches/0001-cmake_1.11.0.patch | 162 + .../all/patches/0001-cmake_1.12.0.patch | 162 + .../all/patches/0001-cmake_1.13.0.patch | 159 + .../libheif/all/test_package/CMakeLists.txt | 8 + recipes/libheif/all/test_package/conanfile.py | 26 + .../libheif/all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libheif/all/test_v1_package/conanfile.py | 17 + recipes/libheif/config.yml | 9 + recipes/libhydrogen/all/conandata.yml | 9 + recipes/libhydrogen/all/conanfile.py | 71 + .../all/patches/0001-fix-cmake.patch | 46 + .../all/test_package/CMakeLists.txt | 8 + .../libhydrogen/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libhydrogen/config.yml | 3 + recipes/libiberty/all/conandata.yml | 4 + recipes/libiberty/all/conanfile.py | 88 + .../libiberty/all/test_package/CMakeLists.txt | 7 + .../libiberty/all/test_package/conanfile.py | 26 + .../libiberty/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libiberty/config.yml | 3 + recipes/libiconv/all/conandata.yml | 13 + recipes/libiconv/all/conanfile.py | 149 + .../patches/0001-libcharset-fix-linkage.patch | 155 + .../libiconv/all/test_package/CMakeLists.txt | 7 + .../libiconv/all/test_package/conanfile.py | 27 + .../libiconv/all/test_package/test_package.c | 50 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libiconv/all/test_v1_package/conanfile.py | 16 + recipes/libiconv/config.yml | 7 + recipes/libid3tag/all/conandata.yml | 4 + recipes/libid3tag/all/conanfile.py | 124 + .../libid3tag/all/test_package/CMakeLists.txt | 8 + .../libid3tag/all/test_package/conanfile.py | 17 + .../libid3tag/all/test_package/test_package.c | 16 + recipes/libid3tag/config.yml | 3 + recipes/libidn/all/conandata.yml | 8 + recipes/libidn/all/conanfile.py | 142 + .../0001-unconditional-system-stdint-h.patch | 19 + .../libidn/all/test_package/CMakeLists.txt | 8 + recipes/libidn/all/test_package/conanfile.py | 19 + .../libidn/all/test_package/test_package.c | 9 + recipes/libidn/config.yml | 3 + recipes/libidn2/all/conandata.yml | 8 + recipes/libidn2/all/conanfile.py | 131 + .../0001-no-versioning-of-symbols.patch | 22 + .../libidn2/all/test_package/CMakeLists.txt | 8 + recipes/libidn2/all/test_package/conanfile.py | 20 + .../libidn2/all/test_package/test_package.c | 20 + recipes/libidn2/config.yml | 3 + recipes/libigl/2.x.x/CMakeLists.txt | 9 + recipes/libigl/2.x.x/conandata.yml | 8 + recipes/libigl/2.x.x/conanfile.py | 140 + .../2.x.x/patches/0001-correct-fpic.patch | 17 + .../libigl/2.x.x/test_package/CMakeLists.txt | 11 + .../libigl/2.x.x/test_package/conanfile.py | 19 + recipes/libigl/2.x.x/test_package/example.cpp | 31 + recipes/libigl/config.yml | 3 + recipes/libinterpolate/all/conandata.yml | 5 + recipes/libinterpolate/all/conanfile.py | 101 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 19 + recipes/libinterpolate/config.yml | 3 + recipes/libipt/all/CMakeLists.txt | 7 + recipes/libipt/all/conandata.yml | 4 + recipes/libipt/all/conanfile.py | 74 + .../libipt/all/test_package/CMakeLists.txt | 11 + recipes/libipt/all/test_package/conanfile.py | 18 + .../libipt/all/test_package/test_package.cpp | 9 + recipes/libipt/config.yml | 3 + recipes/libjpeg-turbo/all/conandata.yml | 25 + recipes/libjpeg-turbo/all/conanfile.py | 174 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 528 +++ .../all/test_package/testimg.jpg | Bin 0 -> 5764 bytes .../all/test_package_module/CMakeLists.txt | 8 + .../all/test_package_module/conanfile.py | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package_module/CMakeLists.txt | 8 + .../all/test_v1_package_module/conanfile.py | 18 + recipes/libjpeg-turbo/config.yml | 17 + recipes/libjpeg/all/Win32.Mak | 671 ++++ recipes/libjpeg/all/conandata.yml | 23 + recipes/libjpeg/all/conanfile.py | 175 + ...0001-9e-libjpeg-add-msvc-dll-support.patch | 92 + .../0001-libjpeg-add-msvc-dll-support.patch | 92 + .../libjpeg/all/test_package/CMakeLists.txt | 20 + recipes/libjpeg/all/test_package/conanfile.py | 44 + .../libjpeg/all/test_package/test_package.c | 528 +++ .../libjpeg/all/test_package/test_transupp.c | 96 + recipes/libjpeg/all/test_package/testimg.jpg | Bin 0 -> 5764 bytes .../all/test_v1_package/CMakeLists.txt | 8 + .../libjpeg/all/test_v1_package/conanfile.py | 31 + recipes/libjpeg/config.yml | 7 + recipes/libjxl/all/CMakeLists.txt | 7 + recipes/libjxl/all/conandata.yml | 18 + recipes/libjxl/all/conanfile.py | 127 + .../all/patches/0001-clean-targets-v0.5.patch | 38 + .../all/patches/0001-clean-targets-v0.6.patch | 36 + .../patches/0002-fix-dependencies-v0.5.patch | 106 + .../patches/0002-fix-dependencies-v0.6.patch | 126 + .../libjxl/all/test_package/CMakeLists.txt | 8 + recipes/libjxl/all/test_package/conanfile.py | 18 + recipes/libjxl/all/test_package/test.jxl | Bin 0 -> 21274 bytes .../libjxl/all/test_package/test_package.c | 90 + recipes/libjxl/config.yml | 5 + recipes/libkml/all/conandata.yml | 10 + recipes/libkml/all/conanfile.py | 152 + .../libkml/all/patches/0001-fix-cmake.patch | 69 + ...x-for-mingw-and-empty-literal-for-vc.patch | 67 + .../0003-export-extern-symbols-for-msvc.patch | 61 + .../0004-minizip-no-crypt-header.patch | 16 + .../libkml/all/test_package/CMakeLists.txt | 7 + recipes/libkml/all/test_package/conanfile.py | 26 + .../libkml/all/test_package/test_package.cpp | 98 + .../libkml/all/test_v1_package/CMakeLists.txt | 8 + .../libkml/all/test_v1_package/conanfile.py | 17 + recipes/libkml/config.yml | 3 + recipes/liblsl/all/CMakeLists.txt | 7 + recipes/liblsl/all/conandata.yml | 7 + recipes/liblsl/all/conanfile.py | 129 + .../liblsl/all/test_package/CMakeLists.txt | 8 + recipes/liblsl/all/test_package/conanfile.py | 25 + .../liblsl/all/test_package/test_package.cpp | 14 + .../liblsl/all/test_v1_package/CMakeLists.txt | 8 + .../liblsl/all/test_v1_package/conanfile.py | 17 + recipes/liblsl/config.yml | 5 + recipes/libltc/all/conandata.yml | 7 + recipes/libltc/all/conanfile.py | 97 + .../libltc/all/test_package/CMakeLists.txt | 7 + recipes/libltc/all/test_package/conanfile.py | 26 + .../libltc/all/test_package/test_package.c | 9 + .../libltc/all/test_v1_package/CMakeLists.txt | 8 + .../libltc/all/test_v1_package/conanfile.py | 17 + recipes/libltc/config.yml | 5 + recipes/liblzf/all/CMakeLists.txt | 33 + recipes/liblzf/all/conandata.yml | 14 + recipes/liblzf/all/conanfile.py | 67 + .../all/patches/0001-add-extern-c.patch | 23 + .../patches/0002-fix-macro-expansion-ub.patch | 15 + .../liblzf/all/test_package/CMakeLists.txt | 7 + recipes/liblzf/all/test_package/conanfile.py | 27 + .../liblzf/all/test_package/test_package.cpp | 16 + .../liblzf/all/test_v1_package/CMakeLists.txt | 8 + .../liblzf/all/test_v1_package/conanfile.py | 19 + recipes/liblzf/config.yml | 3 + recipes/libmad/all/conandata.yml | 4 + recipes/libmad/all/conanfile.py | 114 + .../libmad/all/test_package/CMakeLists.txt | 8 + recipes/libmad/all/test_package/conanfile.py | 17 + .../libmad/all/test_package/test_package.c | 12 + recipes/libmad/config.yml | 3 + recipes/libmaxminddb/all/conandata.yml | 10 + recipes/libmaxminddb/all/conanfile.py | 89 + .../all/patches/0001-fix-cmake-bundle.patch | 10 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/libmaxminddb/config.yml | 5 + recipes/libmbus/all/CMakeLists.txt | 7 + recipes/libmbus/all/conandata.yml | 7 + recipes/libmbus/all/conanfile.py | 80 + .../libmbus/all/test_package/CMakeLists.txt | 8 + recipes/libmbus/all/test_package/conanfile.py | 18 + .../libmbus/all/test_package/test_package.c | 19 + recipes/libmbus/config.yml | 6 + recipes/libmediainfo/all/CMakeLists.txt | 11 + recipes/libmediainfo/all/conandata.yml | 20 + recipes/libmediainfo/all/conanfile.py | 149 + ...lists-CMAKE_MODULE_PATH-find_package.patch | 24 + .../0002-cmake-get-property-location.patch | 41 + .../all/test_package/CMakeLists.txt | 15 + .../all/test_package/conanfile.py | 22 + .../all/test_package/test_package.cpp | 36 + .../libmediainfo/all/test_package/testsrc.mp4 | Bin 0 -> 119619 bytes recipes/libmediainfo/config.yml | 9 + recipes/libmetalink/all/conandata.yml | 4 + recipes/libmetalink/all/conanfile.py | 119 + .../all/test_package/CMakeLists.txt | 7 + .../libmetalink/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libmetalink/config.yml | 3 + recipes/libmicrohttpd/all/conandata.yml | 9 + recipes/libmicrohttpd/all/conanfile.py | 192 + ...001-allow-release-with-debug-runtime.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 74 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libmicrohttpd/config.yml | 3 + recipes/libmikmod/all/CMakeLists.txt | 7 + recipes/libmikmod/all/conandata.yml | 8 + recipes/libmikmod/all/conanfile.py | 131 + .../all/patches/0001-CMakeLists.txt.patch | 56 + .../libmikmod/all/test_package/CMakeLists.txt | 9 + .../libmikmod/all/test_package/conanfile.py | 17 + .../libmikmod/all/test_package/test_package.c | 20 + recipes/libmikmod/config.yml | 3 + recipes/libmnl/all/conandata.yml | 4 + recipes/libmnl/all/conanfile.py | 63 + .../libmnl/all/test_package/CMakeLists.txt | 8 + recipes/libmnl/all/test_package/conanfile.py | 18 + recipes/libmnl/all/test_package/example.cpp | 14 + recipes/libmnl/config.yml | 3 + recipes/libmodbus/all/conandata.yml | 12 + recipes/libmodbus/all/conanfile.py | 118 + .../all/patches/3.1.6-0001-msvc-fixes.patch | 22 + .../all/patches/3.1.8-0001-msvc-fixes.patch | 22 + .../libmodbus/all/test_package/CMakeLists.txt | 8 + .../libmodbus/all/test_package/conanfile.py | 26 + .../libmodbus/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/libmodbus/config.yml | 5 + recipes/libmodplug/all/conandata.yml | 10 + recipes/libmodplug/all/conanfile.py | 75 + .../all/patches/0001-cmake-install-dll.patch | 11 + .../all/patches/0002-cpp17-compat.patch | 20 + .../all/test_package/CMakeLists.txt | 7 + .../libmodplug/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 69 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libmodplug/config.yml | 3 + recipes/libmorton/all/conandata.yml | 22 + recipes/libmorton/all/conanfile.py | 53 + .../all/patches/missing-includes.patch | 20 + .../libmorton/all/test_package/CMakeLists.txt | 7 + .../libmorton/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libmorton/config.yml | 13 + recipes/libmount/all/conandata.yml | 10 + recipes/libmount/all/conanfile.py | 77 + .../libmount/all/test_package/CMakeLists.txt | 7 + .../libmount/all/test_package/conanfile.py | 26 + .../libmount/all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libmount/all/test_v1_package/conanfile.py | 17 + recipes/libmount/config.yml | 7 + recipes/libmp3lame/all/conandata.yml | 17 + recipes/libmp3lame/all/conanfile.py | 152 + recipes/libmp3lame/all/patches/6410.patch | 77 + recipes/libmp3lame/all/patches/6416.patch | 39 + recipes/libmp3lame/all/patches/android.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../libmp3lame/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libmp3lame/config.yml | 3 + recipes/libmysqlclient/all/conandata.yml | 26 + recipes/libmysqlclient/all/conanfile.py | 279 ++ .../patches/0004-fix-805-cpp17-build.patch | 13 + ...5-fix-macos-12.0.x-version-detection.patch | 13 + .../patches/0006-fix-cpp20-build-8.0.29.patch | 17 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 + recipes/libmysqlclient/config.yml | 7 + recipes/libnabo/all/conandata.yml | 9 + recipes/libnabo/all/conanfile.py | 81 + .../all/patches/1.0.7-0001-fix-cmake.patch | 94 + .../libnabo/all/test_package/CMakeLists.txt | 8 + recipes/libnabo/all/test_package/conanfile.py | 26 + .../libnabo/all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libnabo/all/test_v1_package/conanfile.py | 17 + recipes/libnabo/config.yml | 3 + recipes/libnet/all/conandata.yml | 4 + recipes/libnet/all/conanfile.py | 105 + .../libnet/all/test_package/CMakeLists.txt | 7 + recipes/libnet/all/test_package/conanfile.py | 26 + .../libnet/all/test_package/test_package.c | 19 + .../libnet/all/test_v1_package/CMakeLists.txt | 8 + .../libnet/all/test_v1_package/conanfile.py | 17 + recipes/libnet/config.yml | 3 + .../libnetfilter_conntrack/all/conandata.yml | 4 + .../libnetfilter_conntrack/all/conanfile.py | 67 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/example.c | 75 + recipes/libnetfilter_conntrack/config.yml | 3 + recipes/libnetfilter_queue/all/conandata.yml | 4 + recipes/libnetfilter_queue/all/conanfile.py | 69 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.c | 172 + recipes/libnetfilter_queue/config.yml | 3 + recipes/libnfnetlink/all/conandata.yml | 7 + recipes/libnfnetlink/all/conanfile.py | 67 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 18 + .../libnfnetlink/all/test_package/example.cpp | 14 + recipes/libnfnetlink/config.yml | 5 + recipes/libnfs/all/conandata.yml | 10 + recipes/libnfs/all/conanfile.py | 71 + .../patches/5.0.1-0001-remove-exports.patch | 17 + .../libnfs/all/test_package/CMakeLists.txt | 7 + recipes/libnfs/all/test_package/conanfile.py | 26 + .../libnfs/all/test_package/test_package.c | 17 + .../libnfs/all/test_v1_package/CMakeLists.txt | 8 + .../libnfs/all/test_v1_package/conanfile.py | 17 + recipes/libnfs/config.yml | 3 + recipes/libnghttp2/all/conandata.yml | 72 + recipes/libnghttp2/all/conanfile.py | 186 + .../patches/1.40.0-remove-static-suffix.patch | 11 + .../fix-addNghttp2IncludesPathCMake.patch | 11 + .../all/patches/fix-findJemalloc.cmake | 14 + .../all/patches/fix-findLibevent.cmake | 11 + .../all/test_package/CMakeLists.txt | 8 + .../libnghttp2/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 7 + .../all/test_v1_package/conanfile.py | 17 + recipes/libnghttp2/config.yml | 25 + recipes/libnice/all/conandata.yml | 4 + recipes/libnice/all/conanfile.py | 114 + .../libnice/all/test_package/CMakeLists.txt | 7 + recipes/libnice/all/test_package/conanfile.py | 27 + .../libnice/all/test_package/src/example.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libnice/all/test_v1_package/conanfile.py | 19 + recipes/libnice/config.yml | 3 + recipes/libnl/all/conandata.yml | 4 + recipes/libnl/all/conanfile.py | 85 + recipes/libnl/all/test_package/CMakeLists.txt | 8 + recipes/libnl/all/test_package/conanfile.py | 18 + recipes/libnl/all/test_package/show_links.c | 164 + recipes/libnl/config.yml | 3 + recipes/libnoise/all/CMakeLists.txt | 30 + recipes/libnoise/all/conandata.yml | 4 + recipes/libnoise/all/conanfile.py | 66 + .../libnoise/all/test_package/CMakeLists.txt | 7 + .../libnoise/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libnoise/all/test_v1_package/conanfile.py | 17 + recipes/libnoise/config.yml | 3 + recipes/libnop/all/conandata.yml | 4 + recipes/libnop/all/conanfile.py | 64 + .../libnop/all/test_package/CMakeLists.txt | 8 + recipes/libnop/all/test_package/conanfile.py | 26 + .../libnop/all/test_package/test_package.cpp | 23 + .../libnop/all/test_v1_package/CMakeLists.txt | 8 + .../libnop/all/test_v1_package/conanfile.py | 17 + recipes/libnop/config.yml | 3 + recipes/libnova/all/conandata.yml | 15 + recipes/libnova/all/conanfile.py | 88 + .../libnova/all/patches/0001-fix-cmake.patch | 103 + .../all/patches/0002-fix-win32-def.patch | 16 + .../all/patches/0003-no-redefine-nan.patch | 22 + .../0004-constellation-syntax-error.patch | 20 + .../all/patches/0005-fix-mingw-w64.patch | 11 + .../libnova/all/test_package/CMakeLists.txt | 7 + recipes/libnova/all/test_package/conanfile.py | 26 + .../libnova/all/test_package/test_package.c | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libnova/all/test_v1_package/conanfile.py | 17 + recipes/libnova/config.yml | 3 + recipes/libnuma/all/conandata.yml | 7 + recipes/libnuma/all/conanfile.py | 71 + recipes/libnuma/all/patches/symver.patch | 21 + .../libnuma/all/test_package/CMakeLists.txt | 7 + recipes/libnuma/all/test_package/conanfile.py | 26 + .../libnuma/all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libnuma/all/test_v1_package/conanfile.py | 17 + recipes/libnuma/config.yml | 3 + recipes/liboping/all/conandata.yml | 9 + recipes/liboping/all/conanfile.py | 103 + .../patches/1.10.0-suppress_truncate.patch | 18 + .../liboping/all/test_package/CMakeLists.txt | 10 + .../liboping/all/test_package/conanfile.py | 17 + .../liboping/all/test_package/test_package.c | 16 + recipes/liboping/config.yml | 3 + recipes/libpcap/all/conandata.yml | 10 + recipes/libpcap/all/conanfile.py | 173 + .../libpcap/all/test_package/CMakeLists.txt | 7 + recipes/libpcap/all/test_package/conanfile.py | 26 + .../libpcap/all/test_package/test_package.c | 25 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libpcap/all/test_v1_package/conanfile.py | 17 + recipes/libpcap/config.yml | 7 + recipes/libpciaccess/all/conandata.yml | 7 + recipes/libpciaccess/all/conanfile.py | 83 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libpciaccess/config.yml | 5 + recipes/libpfm4/all/conandata.yml | 4 + recipes/libpfm4/all/conanfile.py | 95 + .../libpfm4/all/test_package/CMakeLists.txt | 7 + recipes/libpfm4/all/test_package/conanfile.py | 26 + .../libpfm4/all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 10 + .../libpfm4/all/test_v1_package/conanfile.py | 18 + recipes/libpfm4/config.yml | 3 + recipes/libpng/all/conandata.yml | 24 + recipes/libpng/all/conanfile.py | 185 + .../patches/0001-1.5.30-cmakefile-zlib.patch | 49 + .../patches/0001-1.6.37-cmakefile-zlib.patch | 56 + .../libpng/all/test_package/CMakeLists.txt | 7 + recipes/libpng/all/test_package/conanfile.py | 26 + .../libpng/all/test_package/test_package.c | 16 + .../libpng/all/test_v1_package/CMakeLists.txt | 8 + .../libpng/all/test_v1_package/conanfile.py | 17 + recipes/libpng/config.yml | 9 + recipes/libpointmatcher/all/conandata.yml | 9 + recipes/libpointmatcher/all/conanfile.py | 88 + .../all/patches/1.3.1-0001-fix-cmake.patch | 208 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libpointmatcher/config.yml | 3 + recipes/libpq/all/conandata.yml | 58 + recipes/libpq/all/conanfile.py | 282 ++ .../002-mingw-build-static-libraries.patch | 39 + .../002-mingw-build-static-libraries.patch | 39 + .../002-mingw-build-static-libraries.patch | 39 + .../13.3/001-Remove-thread-safety-check.patch | 65 + .../002-mingw-build-static-libraries.patch | 39 + .../002-mingw-build-static-libraries.patch | 39 + .../002-mingw-build-static-libraries.patch | 39 + .../002-mingw-build-static-libraries.patch | 39 + .../002-mingw-build-static-libraries.patch | 39 + recipes/libpq/all/test_package/CMakeLists.txt | 6 + recipes/libpq/all/test_package/conanfile.py | 26 + recipes/libpq/all/test_package/test_package.c | 17 + .../libpq/all/test_v1_package/CMakeLists.txt | 8 + .../libpq/all/test_v1_package/conanfile.py | 18 + recipes/libpq/config.yml | 17 + recipes/libpqxx/all/conandata.yml | 80 + recipes/libpqxx/all/conanfile.py | 143 + .../patches/0001-cmake-fix-module-6.4.8.patch | 14 + .../all/patches/0001-cmake-fix-module.patch | 13 + .../fix-apple-clang-compilation-7.4.0.patch | 25 + .../patches/fix-clang-compilation-7.7.0.patch | 25 + ...nstexpr-local-variable-problem-7.6.0.patch | 50 + .../fix-install-library-symlink-7.7.2.patch | 14 + .../patches/fix-missing-limits-include.patch | 13 + .../patches/fix-msvc-compilation-7.3.1.patch | 248 ++ ...red-dumb_stringstream-7.0.1_to_7.0.5.patch | 21 + ...red-dumb_stringstream-7.0.6_to_7.0.7.patch | 21 + ...not-declared-dumb_stringstream-7.1.1.patch | 21 + ...otation-before-return-7.6.0_to_7.6.1.patch | 13 + .../libpqxx/all/test_package/CMakeLists.txt | 17 + recipes/libpqxx/all/test_package/conanfile.py | 25 + .../libpqxx/all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libpqxx/all/test_v1_package/conanfile.py | 17 + recipes/libpqxx/config.yml | 29 + recipes/libproperties/all/CMakeLists.txt | 7 + recipes/libproperties/all/conandata.yml | 8 + recipes/libproperties/all/conanfile.py | 67 + .../patches/0001-set-CMAKE_C_STANDARD.patch | 11 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 31 + recipes/libproperties/config.yml | 3 + .../libprotobuf-mutator/all/CMakeLists.txt | 13 + recipes/libprotobuf-mutator/all/conandata.yml | 4 + recipes/libprotobuf-mutator/all/conanfile.py | 88 + .../all/test_package/CMakeLists.txt | 19 + .../all/test_package/conanfile.py | 17 + .../all/test_package/msg.proto | 11 + .../all/test_package/test_package.cpp | 23 + recipes/libprotobuf-mutator/config.yml | 3 + recipes/libpsl/all/conandata.yml | 7 + recipes/libpsl/all/conanfile.py | 122 + .../patches/0001-0.21.2-meson-no-tests.patch | 11 + .../libpsl/all/test_package/CMakeLists.txt | 7 + recipes/libpsl/all/test_package/conanfile.py | 26 + .../libpsl/all/test_package/test_package.c | 9 + .../libpsl/all/test_v1_package/CMakeLists.txt | 8 + .../libpsl/all/test_v1_package/conanfile.py | 17 + recipes/libpsl/config.yml | 3 + recipes/libqrencode/all/conandata.yml | 13 + recipes/libqrencode/all/conanfile.py | 79 + .../0001-remove-deprecated-attribute.patch | 11 + .../all/patches/0002-cmake-fix-install.patch | 11 + .../0003-cmake-fix-install-4.1.1.patch | 13 + .../all/test_package/CMakeLists.txt | 7 + .../libqrencode/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libqrencode/config.yml | 5 + recipes/librasterlite/all/conandata.yml | 10 + recipes/librasterlite/all/conanfile.py | 147 + .../all/patches/0001-fix-autotools.patch | 27 + .../all/patches/0002-nmake-honor-flags.patch | 43 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + recipes/librasterlite/config.yml | 3 + recipes/librasterlite2/all/conandata.yml | 8 + recipes/librasterlite2/all/conanfile.py | 169 + .../all/patches/0001-missing-include.patch | 11 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 9 + recipes/librasterlite2/config.yml | 3 + recipes/libraw/all/CMakeLists.txt | 70 + recipes/libraw/all/conandata.yml | 13 + recipes/libraw/all/conanfile.py | 95 + .../libraw/all/test_package/CMakeLists.txt | 8 + recipes/libraw/all/test_package/conanfile.py | 26 + .../libraw/all/test_package/test_package.cpp | 8 + .../libraw/all/test_v1_package/CMakeLists.txt | 8 + .../libraw/all/test_v1_package/conanfile.py | 18 + recipes/libraw/config.yml | 9 + recipes/librdkafka/all/conandata.yml | 92 + recipes/librdkafka/all/conanfile.py | 167 + .../0001-Change-library-names-1-5-2.patch | 31 + .../0001-Change-library-names-1-7-0.patch | 35 + .../0001-Change-library-names-1-9-1.patch | 23 + ...y-targets-and-result-variables-1-5-2.patch | 23 + ...y-targets-and-result-variables-1-6-0.patch | 23 + ...y-targets-and-result-variables-1-6-1.patch | 23 + ...y-targets-and-result-variables-1-7-0.patch | 37 + ...y-targets-and-result-variables-1-9-1.patch | 25 + ...y-targets-and-result-variables-2-0-2.patch | 24 + .../all/test_package/CMakeLists.txt | 10 + .../librdkafka/all/test_package/conanfile.py | 28 + .../all/test_package/test_package.c | 12 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/librdkafka/config.yml | 19 + recipes/librealsense/all/conandata.yml | 26 + recipes/librealsense/all/conanfile.py | 146 + .../all/patches/2.49.0-0001-fix-cmake.patch | 82 + .../patches/2.49.0-0002-fix-avx-check.patch | 13 + .../patches/2.49.0-0003-atlstr-removal.patch | 127 + ...004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch | 14 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/librealsense/config.yml | 3 + recipes/libressl/all/conandata.yml | 22 + recipes/libressl/all/conanfile.py | 145 + .../libressl/all/test_package/CMakeLists.txt | 7 + .../libressl/all/test_package/conanfile.py | 26 + .../libressl/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libressl/all/test_v1_package/conanfile.py | 17 + recipes/libressl/config.yml | 15 + recipes/librhash/all/conandata.yml | 11 + recipes/librhash/all/conanfile.py | 121 + .../0001-1.4.2-fix-compiler-detection.patch | 29 + .../librhash/all/test_package/CMakeLists.txt | 10 + .../librhash/all/test_package/conanfile.py | 17 + .../librhash/all/test_package/test_package.c | 20 + recipes/librhash/config.yml | 5 + recipes/librttopo/all/CMakeLists.txt | 42 + recipes/librttopo/all/conandata.yml | 4 + recipes/librttopo/all/conanfile.py | 81 + .../librttopo/all/test_package/CMakeLists.txt | 7 + .../librttopo/all/test_package/conanfile.py | 26 + .../librttopo/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/librttopo/config.yml | 3 + recipes/libsafec/all/conandata.yml | 4 + recipes/libsafec/all/conanfile.py | 122 + .../libsafec/all/test_package/CMakeLists.txt | 8 + .../libsafec/all/test_package/conanfile.py | 17 + .../libsafec/all/test_package/test_package.c | 23 + recipes/libsafec/config.yml | 3 + recipes/libsamplerate/all/conandata.yml | 7 + recipes/libsamplerate/all/conanfile.py | 98 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libsamplerate/config.yml | 5 + recipes/libsass/all/conandata.yml | 7 + recipes/libsass/all/conanfile.py | 147 + .../libsass/all/test_package/CMakeLists.txt | 10 + recipes/libsass/all/test_package/conanfile.py | 17 + .../libsass/all/test_package/test_package.c | 8 + recipes/libsass/config.yml | 5 + recipes/libschrift/all/CMakeLists.txt | 23 + recipes/libschrift/all/conandata.yml | 7 + recipes/libschrift/all/conanfile.py | 73 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/OpenSans-Bold.ttf | Bin 0 -> 224592 bytes .../libschrift/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 + recipes/libschrift/config.yml | 5 + recipes/libsecret/all/conandata.yml | 7 + recipes/libsecret/all/conanfile.py | 111 + .../libsecret/all/test_package/CMakeLists.txt | 7 + .../libsecret/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libsecret/config.yml | 5 + recipes/libselinux/all/conandata.yml | 37 + recipes/libselinux/all/conanfile.py | 125 + .../all/patches/0001-fix-fno-common-2.9.patch | 507 +++ .../all/patches/0001-fix-fno-common-3.0.patch | 510 +++ .../0002-remove-cil_mem_error_handler.patch | 45 + .../all/test_package/CMakeLists.txt | 7 + .../libselinux/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libselinux/config.yml | 11 + recipes/libserial/all/conandata.yml | 4 + recipes/libserial/all/conanfile.py | 92 + .../libserial/all/test_package/CMakeLists.txt | 9 + .../libserial/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/libserial/config.yml | 3 + recipes/libsgp4/all/conandata.yml | 7 + recipes/libsgp4/all/conanfile.py | 69 + .../libsgp4/all/patches/fix-cmake-files.patch | 52 + .../libsgp4/all/test_package/CMakeLists.txt | 8 + recipes/libsgp4/all/test_package/SGP4-VER.TLE | 110 + recipes/libsgp4/all/test_package/conanfile.py | 27 + .../libsgp4/all/test_package/test_package.cpp | 240 ++ .../all/test_v1_package/CMakeLists.txt | 8 + .../libsgp4/all/test_v1_package/conanfile.py | 18 + recipes/libsgp4/config.yml | 3 + recipes/libsigcpp/2.x.x/conandata.yml | 4 + recipes/libsigcpp/2.x.x/conanfile.py | 109 + .../2.x.x/test_package/CMakeLists.txt | 9 + .../libsigcpp/2.x.x/test_package/conanfile.py | 37 + .../2.x.x/test_package/test_package.cpp | 24 + .../2.x.x/test_v1_package/CMakeLists.txt | 8 + .../2.x.x/test_v1_package/conanfile.py | 20 + recipes/libsigcpp/3.x.x/conandata.yml | 12 + recipes/libsigcpp/3.x.x/conanfile.py | 147 + .../3.x.x/patches/3.0.0-0001-libsigcpp.patch | 31 + .../3.x.x/patches/3.0.7-0001-libsigcpp.patch | 31 + .../3.x.x/test_package/CMakeLists.txt | 8 + .../libsigcpp/3.x.x/test_package/conanfile.py | 26 + .../3.x.x/test_package/test_package.cpp | 26 + .../3.x.x/test_v1_package/CMakeLists.txt | 8 + .../3.x.x/test_v1_package/conanfile.py | 17 + recipes/libsigcpp/config.yml | 7 + recipes/libsixel/all/conandata.yml | 4 + recipes/libsixel/all/conanfile.py | 106 + .../libsixel/all/test_package/CMakeLists.txt | 10 + .../libsixel/all/test_package/conanfile.py | 17 + .../libsixel/all/test_package/test_package.c | 19 + recipes/libsixel/config.yml | 4 + recipes/libslz/all/CMakeLists.txt | 24 + recipes/libslz/all/conandata.yml | 7 + recipes/libslz/all/conanfile.py | 67 + .../libslz/all/test_package/CMakeLists.txt | 14 + recipes/libslz/all/test_package/conanfile.py | 17 + .../libslz/all/test_package/test_package.c | 21 + recipes/libslz/config.yml | 5 + recipes/libsmacker/all/conandata.yml | 7 + recipes/libsmacker/all/conanfile.py | 94 + .../all/patches/0001-install-header.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../libsmacker/all/test_package/conanfile.py | 23 + .../all/test_package/test_package.c | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 15 + recipes/libsmacker/config.yml | 3 + recipes/libsndfile/all/conandata.yml | 26 + recipes/libsndfile/all/conanfile.py | 145 + ....30-0001-disable-static-libgcc-mingw.patch | 11 + .../1.0.31-0001-fix-msvc-runtime-logic.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../libsndfile/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libsndfile/config.yml | 9 + recipes/libsodium/all/conandata.yml | 18 + recipes/libsodium/all/conanfile.py | 189 + .../all/patches/0001-1.0.18-msvc_props.patch | 38 + .../libsodium/all/test_package/CMakeLists.txt | 7 + .../libsodium/all/test_package/conanfile.py | 26 + .../libsodium/all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libsodium/config.yml | 5 + recipes/libsolace/all/conandata.yml | 11 + recipes/libsolace/all/conanfile.py | 66 + .../libsolace/all/test_package/CMakeLists.txt | 13 + .../libsolace/all/test_package/conanfile.py | 19 + .../libsolace/all/test_package/example.cpp | 7 + recipes/libsolace/config.yml | 7 + recipes/libspatialindex/all/conandata.yml | 9 + recipes/libspatialindex/all/conanfile.py | 101 + .../patches/0001-fix-static-and-mingw.patch | 92 + .../all/patches/0002-fix-capi.patch | 26 + .../all/patches/0003-macos-install-name.patch | 18 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 28 + .../all/test_package/test_package.c | 22 + .../all/test_package/test_package.cpp | 76 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/libspatialindex/config.yml | 3 + recipes/libspatialite/all/conandata.yml | 9 + recipes/libspatialite/all/conanfile.py | 247 ++ .../0001-autotools-no-geos-config.patch | 22 + .../all/patches/0002-nmake-honor-flags.patch | 36 + .../all/patches/0003-msvc-minizip.patch | 12 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libspatialite/config.yml | 3 + recipes/libspng/all/conandata.yml | 22 + recipes/libspng/all/conanfile.py | 82 + .../patches/0.7.2-0001-fix-dll-install.patch | 16 + .../all/patches/0.7.2-0002-allow-miniz.patch | 62 + .../patches/0.7.3-0001-fix-dll-install.patch | 18 + .../all/patches/0.7.3-0002-allow-miniz.patch | 64 + .../libspng/all/test_package/CMakeLists.txt | 7 + recipes/libspng/all/test_package/conanfile.py | 26 + .../libspng/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libspng/all/test_v1_package/conanfile.py | 17 + recipes/libspng/config.yml | 5 + recipes/libsquish/all/conandata.yml | 8 + recipes/libsquish/all/conanfile.py | 86 + .../0001-fix-cmake-simd-openmp-install.patch | 94 + .../all/patches/0002-export-symbols.patch | 88 + .../libsquish/all/test_package/CMakeLists.txt | 7 + .../libsquish/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 77 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libsquish/config.yml | 3 + recipes/libsrtp/all/conandata.yml | 10 + recipes/libsrtp/all/conanfile.py | 90 + .../libsrtp/all/test_package/CMakeLists.txt | 7 + recipes/libsrtp/all/test_package/conanfile.py | 26 + .../libsrtp/all/test_package/test_package.c | 33 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libsrtp/all/test_v1_package/conanfile.py | 17 + recipes/libsrtp/config.yml | 7 + recipes/libssh2/all/CMakeLists.txt | 7 + recipes/libssh2/all/conandata.yml | 26 + recipes/libssh2/all/conanfile.py | 132 + .../libssh2/all/patches/0001-threads.patch | 16 + .../libssh2/all/test_package/CMakeLists.txt | 10 + recipes/libssh2/all/test_package/conanfile.py | 17 + .../libssh2/all/test_package/test_package.c | 10 + recipes/libssh2/config.yml | 9 + recipes/libstudxml/1.0.x/conandata.yml | 10 + recipes/libstudxml/1.0.x/conanfile.py | 186 + .../1.0.x/patches/configure-ac.patch | 10 + .../1.0.x/patches/makefile-am.patch | 12 + .../1.0.x/test_package/CMakeLists.txt | 7 + .../1.0.x/test_package/conanfile.py | 26 + .../1.0.x/test_package/test_package.cpp | 14 + .../1.0.x/test_v1_package/CMakeLists.txt | 8 + .../1.0.x/test_v1_package/conanfile.py | 17 + recipes/libstudxml/1.1.x/CMakeLists.txt | 40 + recipes/libstudxml/1.1.x/conandata.yml | 4 + recipes/libstudxml/1.1.x/conanfile.py | 78 + .../1.1.x/test_package/CMakeLists.txt | 7 + .../1.1.x/test_package/conanfile.py | 26 + .../1.1.x/test_package/test_package.cpp | 14 + .../1.1.x/test_v1_package/CMakeLists.txt | 8 + .../1.1.x/test_v1_package/conanfile.py | 17 + recipes/libstudxml/config.yml | 5 + recipes/libsvm/all/CMakeLists.txt | 27 + recipes/libsvm/all/conandata.yml | 10 + recipes/libsvm/all/conanfile.py | 74 + .../libsvm/all/test_package/CMakeLists.txt | 7 + recipes/libsvm/all/test_package/conanfile.py | 26 + .../libsvm/all/test_package/test_package.c | 19 + .../libsvm/all/test_v1_package/CMakeLists.txt | 8 + .../libsvm/all/test_v1_package/conanfile.py | 18 + recipes/libsvm/config.yml | 7 + recipes/libsvtav1/all/conandata.yml | 26 + recipes/libsvtav1/all/conanfile.py | 92 + .../all/patches/llvm-clang-macos.patch | 21 + .../libsvtav1/all/test_package/CMakeLists.txt | 8 + .../libsvtav1/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/libsvtav1/config.yml | 7 + recipes/libsystemd/all/conandata.yml | 74 + recipes/libsystemd/all/conanfile.py | 199 + ...-Drop-bundled-copy-of-linux-if_arp.h.patch | 223 ++ ...ge-operator-combining-bools-from-to-.patch | 34 + ...003-Remove-dependency-from-coreutils.patch | 29 + ...001-Remove-dependency-from-coreutils.patch | 31 + ...scalls.py-Replace-unicode-with-ascii.patch | 32 + ...001-Remove-dependency-from-coreutils.patch | 31 + ...001-Remove-dependency-from-coreutils.patch | 32 + ...scalls.py-Replace-unicode-with-ascii.patch | 32 + .../all/test_package/CMakeLists.txt | 8 + .../libsystemd/all/test_package/conanfile.py | 31 + .../all/test_package/test_package.c | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/libsystemd/config.yml | 15 + recipes/libtar/all/conandata.yml | 4 + recipes/libtar/all/conanfile.py | 101 + .../libtar/all/test_package/CMakeLists.txt | 7 + recipes/libtar/all/test_package/conanfile.py | 49 + .../libtar/all/test_package/test_package.c | 40 + .../libtar/all/test_v1_package/CMakeLists.txt | 8 + .../libtar/all/test_v1_package/conanfile.py | 39 + recipes/libtar/config.yml | 3 + recipes/libtasn1/all/conandata.yml | 7 + recipes/libtasn1/all/conanfile.py | 101 + ...tatic-to-functions-meant-to-be-built.patch | 11 + .../libtasn1/all/test_package/CMakeLists.txt | 21 + .../libtasn1/all/test_package/conanfile.py | 39 + recipes/libtasn1/all/test_package/pkix.asn | 954 +++++ .../libtasn1/all/test_package/test_package.c | 24 + .../all/test_v1_package/CMakeLists.txt | 28 + .../libtasn1/all/test_v1_package/conanfile.py | 27 + recipes/libtasn1/config.yml | 3 + recipes/libtiff/all/conandata.yml | 67 + recipes/libtiff/all/conanfile.py | 199 + .../4.0.8-0001-cmake-dependencies.patch | 38 + .../patches/4.0.8-0002-no-libm-mingw.patch | 13 + .../4.0.8-0003-file-offsets-bits-mingw.patch | 11 + .../4.1.0-0001-cmake-dependencies.patch | 85 + .../patches/4.1.0-0002-no-libm-mingw.patch | 13 + .../4.2.0-0001-cmake-dependencies.patch | 102 + .../4.3.0-0001-cmake-dependencies.patch | 91 + .../4.4.0-0001-cmake-dependencies.patch | 92 + .../4.5.0-0001-cmake-dependencies.patch | 116 + .../libtiff/all/test_package/CMakeLists.txt | 7 + recipes/libtiff/all/test_package/conanfile.py | 26 + .../libtiff/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libtiff/all/test_v1_package/conanfile.py | 17 + recipes/libtiff/config.yml | 15 + recipes/libtins/all/CMakeLists.txt | 7 + recipes/libtins/all/conandata.yml | 10 + recipes/libtins/all/conanfile.py | 134 + .../libtins/all/test_package/CMakeLists.txt | 10 + recipes/libtins/all/test_package/conanfile.py | 17 + .../libtins/all/test_package/test_package.cpp | 10 + recipes/libtins/config.yml | 7 + recipes/libtommath/all/conandata.yml | 8 + recipes/libtommath/all/conanfile.py | 139 + ...e-building-dll-s-using-makefile-msvc.patch | 146 + .../all/test_package/CMakeLists.txt | 11 + .../libtommath/all/test_package/conanfile.py | 20 + .../all/test_package/test_package.c | 34 + recipes/libtommath/config.yml | 3 + recipes/libtool/all/conandata.yml | 19 + recipes/libtool/all/conanfile.py | 241 ++ .../2.4.6-0001-libtool-relocatable.patch | 41 + .../2.4.6-0002-libtool-fix-type-libtool.patch | 22 + .../2.4.7-0001-libtool-relocatable.patch | 41 + .../all/test_package/autotools/Makefile.am | 13 + .../all/test_package/autotools/configure.ac | 41 + .../libtool/all/test_package/autotools/lib.c | 11 + .../libtool/all/test_package/autotools/lib.h | 34 + .../all/test_package/autotools/libtestlib.sym | 2 + .../all/test_package/autotools/test_package.c | 11 + .../test_package/autotools/testlib_private.h | 8 + recipes/libtool/all/test_package/conanfile.py | 199 + .../all/test_package/ltdl/CMakeLists.txt | 27 + recipes/libtool/all/test_package/ltdl/liba.c | 6 + .../all/test_package/ltdl/static_lib.c | 4 + .../all/test_package/ltdl/test_package.c | 36 + .../libtool/all/test_package/sis/Makefile.am | 8 + .../libtool/all/test_package/sis/configure.ac | 13 + .../libtool/all/test_package/sis/shared.sym | 1 + .../libtool/all/test_package/sis/shared_lib.c | 7 + .../all/test_v1_package/autotools/Makefile.am | 13 + .../test_v1_package/autotools/configure.ac | 41 + .../all/test_v1_package/autotools/lib.c | 11 + .../all/test_v1_package/autotools/lib.h | 34 + .../test_v1_package/autotools/libtestlib.sym | 2 + .../test_v1_package/autotools/test_package.c | 11 + .../autotools/testlib_private.h | 8 + .../libtool/all/test_v1_package/conanfile.py | 159 + .../all/test_v1_package/ltdl/CMakeLists.txt | 20 + .../libtool/all/test_v1_package/ltdl/liba.c | 6 + .../all/test_v1_package/ltdl/test_package.c | 36 + .../all/test_v1_package/sis/CMakeLists.txt | 11 + .../all/test_v1_package/sis/Makefile.am | 8 + .../all/test_v1_package/sis/configure.ac | 13 + .../all/test_v1_package/sis/shared.sym | 1 + .../all/test_v1_package/sis/shared_lib.c | 7 + .../all/test_v1_package/sis/static_lib.c | 4 + recipes/libtool/config.yml | 5 + recipes/libtorrent/all/conandata.yml | 21 + recipes/libtorrent/all/conanfile.py | 213 + ...-0002-boost-system-header-only-1.69+.patch | 19 + .../patches/1.2.3-0003-include-cstddef.patch | 22 + ...3-0004-increase-handle-storage-sizes.patch | 64 + .../all/test_package/CMakeLists.txt | 16 + .../libtorrent/all/test_package/conanfile.py | 28 + .../all/test_package/test_package.cpp | 53 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/libtorrent/config.yml | 7 + recipes/libucl/all/conandata.yml | 40 + recipes/libucl/all/conanfile.py | 92 + .../all/patches/0001-0.8.1-shared-win32.patch | 16 + ...1-cmake-add-install+use-find_package.patch | 112 + ...2-cmake-add-install+use-find_package.patch | 122 + .../all/patches/0003-no-strings-h.patch | 11 + .../0004-0.8.1-cmake-minimum-required.patch | 11 + .../0004-0.8.2-cmake-minimum-required.patch | 11 + .../all/patches/0005-0.8.1-add-_tmp.patch | 20 + .../libucl/all/test_package/CMakeLists.txt | 8 + recipes/libucl/all/test_package/conanfile.py | 26 + recipes/libucl/all/test_package/sample.conf | 19 + .../libucl/all/test_package/test_package.cpp | 34 + .../libucl/all/test_v1_package/CMakeLists.txt | 8 + .../libucl/all/test_v1_package/conanfile.py | 19 + recipes/libucl/config.yml | 5 + recipes/libudev/all/conanfile.py | 50 + .../libudev/all/test_package/CMakeLists.txt | 8 + recipes/libudev/all/test_package/conanfile.py | 25 + .../libudev/all/test_package/test_package.c | 25 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libudev/all/test_v1_package/conanfile.py | 18 + recipes/libudev/config.yml | 3 + recipes/libui/all/CMakeLists.txt | 7 + recipes/libui/all/conandata.yml | 4 + recipes/libui/all/conanfile.py | 79 + recipes/libui/all/test_package/CMakeLists.txt | 9 + recipes/libui/all/test_package/conanfile.py | 17 + recipes/libui/all/test_package/test_package.c | 21 + recipes/libui/config.yml | 3 + recipes/libunifex/all/CMakeLists.txt | 7 + recipes/libunifex/all/conandata.yml | 4 + recipes/libunifex/all/conanfile.py | 110 + .../libunifex/all/test_package/CMakeLists.txt | 11 + .../libunifex/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 19 + recipes/libunifex/config.yml | 3 + recipes/libunistring/all/conandata.yml | 4 + recipes/libunistring/all/conanfile.py | 97 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 23 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libunistring/config.yml | 3 + recipes/libunwind/all/conandata.yml | 13 + recipes/libunwind/all/conanfile.py | 133 + .../0001-multiple-definition-gcc10.patch | 252 ++ .../libunwind/all/test_package/CMakeLists.txt | 7 + .../libunwind/all/test_package/conanfile.py | 26 + .../libunwind/all/test_package/test_package.c | 22 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libunwind/config.yml | 7 + recipes/liburing/all/conandata.yml | 18 + recipes/liburing/all/conanfile.py | 108 + .../0001-liburing-2.1-memfd-create.patch | 71 + .../liburing/all/test_package/CMakeLists.txt | 10 + .../liburing/all/test_package/conanfile.py | 28 + .../liburing/all/test_package/test_package.c | 15 + recipes/liburing/config.yml | 9 + recipes/libusb-compat/all/CMakeLists.txt.in | 30 + recipes/libusb-compat/all/conandata.yml | 10 + recipes/libusb-compat/all/conanfile.py | 209 + .../0001-fix-autoconf-msvc-mingw.patch | 29 + ...c-linkage-and-fix-msvc-vararg-macros.patch | 208 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 11 + recipes/libusb-compat/config.yml | 3 + recipes/libusb/all/conandata.yml | 30 + recipes/libusb/all/conanfile.py | 156 + ...3-0001-relax-windows-sdk-restriction.patch | 20 + ...4-0001-relax-windows-sdk-restriction.patch | 20 + .../libusb/all/test_package/CMakeLists.txt | 7 + recipes/libusb/all/test_package/conanfile.py | 26 + .../libusb/all/test_package/test_package.c | 18 + .../libusb/all/test_v1_package/CMakeLists.txt | 8 + .../libusb/all/test_v1_package/conanfile.py | 17 + recipes/libusb/config.yml | 9 + recipes/libuuid/all/conandata.yml | 7 + recipes/libuuid/all/conanfile.py | 89 + ...01-check-sys-syscall-h+wrap-includes.patch | 38 + .../libuuid/all/test_package/CMakeLists.txt | 8 + recipes/libuuid/all/test_package/conanfile.py | 26 + .../libuuid/all/test_package/test_package.c | 33 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libuuid/all/test_v1_package/conanfile.py | 17 + recipes/libuuid/config.yml | 3 + recipes/libuv/all/conandata.yml | 65 + recipes/libuv/all/conanfile.py | 122 + .../libuv/all/patches/1.38.1/fix-cmake.patch | 80 + .../libuv/all/patches/1.40.0/fix-cmake.patch | 77 + .../libuv/all/patches/1.40.0/fix-ios.patch | 28 + .../libuv/all/patches/1.41.0/fix-cmake.patch | 77 + .../libuv/all/patches/1.42.0/fix-cmake.patch | 81 + .../libuv/all/patches/1.43.0/fix-cmake.patch | 50 + .../libuv/all/patches/1.44.1/fix-cmake.patch | 47 + .../libuv/all/patches/1.44.2/fix-cmake.patch | 49 + recipes/libuv/all/test_package/CMakeLists.txt | 11 + recipes/libuv/all/test_package/conanfile.py | 26 + recipes/libuv/all/test_package/test_package.c | 25 + .../libuv/all/test_v1_package/CMakeLists.txt | 14 + .../libuv/all/test_v1_package/conanfile.py | 17 + recipes/libuv/config.yml | 17 + recipes/libuvc/all/conandata.yml | 19 + recipes/libuvc/all/conanfile.py | 141 + .../0.0.7-0001-fix-cci-packagename.patch | 13 + .../patches/0001-adjust-libusb-libjpeg.patch | 63 + .../patches/0002-adjust-install-folder.patch | 16 + .../libuvc/all/test_package/CMakeLists.txt | 11 + recipes/libuvc/all/test_package/conanfile.py | 26 + .../libuvc/all/test_package/test_package.c | 47 + .../libuvc/all/test_v1_package/CMakeLists.txt | 8 + .../libuvc/all/test_v1_package/conanfile.py | 17 + recipes/libuvc/config.yml | 5 + recipes/libvault/all/CMakeLists.txt | 7 + recipes/libvault/all/conandata.yml | 23 + recipes/libvault/all/conanfile.py | 117 + .../all/patches/fix-cmake-0.48.0.patch | 63 + .../all/patches/fix-cmake-0.51.0.patch | 49 + .../libvault/all/test_package/CMakeLists.txt | 9 + .../libvault/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libvault/all/test_v1_package/conanfile.py | 19 + recipes/libvault/config.yml | 7 + recipes/libverto/all/conandata.yml | 4 + recipes/libverto/all/conanfile.py | 187 + .../libverto/all/test_package/CMakeLists.txt | 22 + .../libverto/all/test_package/conanfile.py | 35 + .../libverto/all/test_package/test_package.c | 54 + .../all/test_v1_package/CMakeLists.txt | 10 + .../libverto/all/test_v1_package/conanfile.py | 19 + recipes/libverto/config.yml | 3 + recipes/libvips/all/conandata.yml | 4 + recipes/libvips/all/conanfile.py | 375 ++ .../libvips/all/test_package/CMakeLists.txt | 7 + recipes/libvips/all/test_package/conanfile.py | 27 + .../libvips/all/test_package/test_package.c | 29 + recipes/libvips/all/test_package/testimg.jpg | Bin 0 -> 5764 bytes .../all/test_v1_package/CMakeLists.txt | 8 + .../libvips/all/test_v1_package/conanfile.py | 18 + recipes/libvips/config.yml | 3 + recipes/libvpx/all/conandata.yml | 26 + recipes/libvpx/all/conanfile.py | 263 ++ .../0001-extended-support-1.10.0.patch | 98 + .../patches/0001-extended-support-1.9.0.patch | 58 + .../all/patches/0002-msvc_conan_build.patch | 13 + .../libvpx/all/test_package/CMakeLists.txt | 7 + recipes/libvpx/all/test_package/conanfile.py | 26 + .../libvpx/all/test_package/test_package.c | 9 + .../libvpx/all/test_v1_package/CMakeLists.txt | 8 + .../libvpx/all/test_v1_package/conanfile.py | 18 + recipes/libvpx/config.yml | 7 + recipes/libwebp/all/conandata.yml | 71 + recipes/libwebp/all/conanfile.py | 144 + .../patches/1.0.3-0001-fix-dll-export.patch | 15 + .../patches/1.0.3-0002-build-libwebpmux.patch | 11 + .../libwebp/all/patches/1.1.0-0002-qnx.patch | 14 + .../patches/1.1.0-0003-build-libwebpmux.patch | 11 + .../patches/1.2.0-0003-build-libwebpmux.patch | 11 + .../all/patches/1.3.0-0001-fix-cmake.patch | 21 + .../libwebp/all/test_package/CMakeLists.txt | 7 + recipes/libwebp/all/test_package/conanfile.py | 26 + .../libwebp/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libwebp/all/test_v1_package/conanfile.py | 17 + recipes/libwebp/config.yml | 17 + recipes/libwebsockets/all/CMakeLists.txt | 7 + recipes/libwebsockets/all/conandata.yml | 22 + recipes/libwebsockets/all/conanfile.py | 544 +++ .../all/test_package/CMakeLists.txt | 15 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.c | 92 + recipes/libwebsockets/config.yml | 15 + recipes/libx264/all/conandata.yml | 10 + recipes/libx264/all/conanfile.py | 177 + .../libx264/all/test_package/CMakeLists.txt | 7 + recipes/libx264/all/test_package/conanfile.py | 26 + .../libx264/all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 10 + .../libx264/all/test_v1_package/conanfile.py | 18 + recipes/libx264/config.yml | 7 + recipes/libx265/all/conandata.yml | 15 + recipes/libx265/all/conanfile.py | 155 + ....2.1-0001-remove_register_classifier.patch | 13 + .../3.2.1-0002-cmake-min-required.patch | 22 + .../libx265/all/patches/3.4-0001-numa.patch | 27 + .../libx265/all/test_package/CMakeLists.txt | 7 + recipes/libx265/all/test_package/conanfile.py | 26 + .../libx265/all/test_package/test_package.c | 32 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libx265/all/test_v1_package/conanfile.py | 17 + recipes/libx265/config.yml | 5 + recipes/libxcrypt/all/conandata.yml | 28 + recipes/libxcrypt/all/conanfile.py | 95 + .../libxcrypt/all/test_package/CMakeLists.txt | 7 + .../libxcrypt/all/test_package/conanfile.py | 26 + .../libxcrypt/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libxcrypt/config.yml | 19 + recipes/libxft/all/conandata.yml | 14 + recipes/libxft/all/conanfile.py | 78 + .../all/patches/0001-fix-gcc-5-and-11.patch | 24 + .../libxft/all/test_package/CMakeLists.txt | 10 + recipes/libxft/all/test_package/conanfile.py | 17 + .../libxft/all/test_package/test_package.c | 10 + recipes/libxft/config.yml | 5 + recipes/libxls/all/conandata.yml | 9 + recipes/libxls/all/conanfile.py | 117 + .../patches/1.6.2-0001-fix-ssize_t-msvc.patch | 14 + .../libxls/all/test_package/CMakeLists.txt | 7 + recipes/libxls/all/test_package/conanfile.py | 26 + .../libxls/all/test_package/test_package.c | 12 + .../libxls/all/test_v1_package/CMakeLists.txt | 8 + .../libxls/all/test_v1_package/conanfile.py | 16 + recipes/libxls/config.yml | 3 + recipes/libxlsxwriter/all/conandata.yml | 34 + recipes/libxlsxwriter/all/conanfile.py | 101 + .../all/patches/1.0.0-0001-fix-cmake.patch | 38 + .../all/patches/1.1.3-0001-fix-cmake.patch | 41 + .../all/patches/1.1.5-0001-fix-cmake.patch | 43 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/libxlsxwriter/config.yml | 9 + recipes/libxml2/all/conandata.yml | 22 + recipes/libxml2/all/conanfile.py | 407 ++ .../test_cmake_module_package/CMakeLists.txt | 26 + .../test_cmake_module_package/conanfile.py | 27 + .../libxml2/all/test_package/CMakeLists.txt | 7 + recipes/libxml2/all/test_package/books.xml | 120 + recipes/libxml2/all/test_package/conanfile.py | 27 + .../libxml2/all/test_package/test_package.c | 44 + .../CMakeLists.txt | 8 + .../test_v1_cmake_module_package/conanfile.py | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libxml2/all/test_v1_package/conanfile.py | 18 + recipes/libxml2/config.yml | 15 + recipes/libxmlpp/2.x.x/conandata.yml | 15 + recipes/libxmlpp/2.x.x/conanfile.py | 155 + ....1-0001-enable_static_builds_on_msvc.patch | 47 + ....1-0001-enable_static_builds_on_msvc.patch | 38 + .../2.x.x/test_package/CMakeLists.txt | 15 + .../libxmlpp/2.x.x/test_package/conanfile.py | 18 + .../libxmlpp/2.x.x/test_package/example.xml | 11 + .../2.x.x/test_package/test_package.cpp | 86 + recipes/libxmlpp/config.yml | 5 + recipes/libxpm/all/CMakeLists.txt | 95 + recipes/libxpm/all/conandata.yml | 4 + recipes/libxpm/all/conanfile.py | 71 + .../libxpm/all/test_package/CMakeLists.txt | 10 + recipes/libxpm/all/test_package/conanfile.py | 18 + .../libxpm/all/test_package/test_package.c | 12 + recipes/libxpm/all/windows/libXpm.def | 29 + recipes/libxpm/config.yml | 3 + recipes/libxshmfence/all/conandata.yml | 4 + recipes/libxshmfence/all/conanfile.py | 116 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 21 + recipes/libxshmfence/config.yml | 3 + recipes/libxslt/all/conandata.yml | 8 + recipes/libxslt/all/conanfile.py | 234 ++ .../0001-allow-xsltproc-link-shared-mt.patch | 11 + .../0002-Add-configuration-for-profiler.patch | 71 + .../libxslt/all/test_package/CMakeLists.txt | 8 + recipes/libxslt/all/test_package/conanfile.py | 29 + recipes/libxslt/all/test_package/example.xml | 11 + recipes/libxslt/all/test_package/example.xsl | 22 + .../all/test_package/libxslt_tutorial.c | 77 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libxslt/all/test_v1_package/conanfile.py | 20 + recipes/libxslt/config.yml | 3 + recipes/libyaml/all/conandata.yml | 7 + recipes/libyaml/all/conanfile.py | 100 + .../libyaml/all/test_package/CMakeLists.txt | 7 + recipes/libyaml/all/test_package/conanfile.py | 26 + .../libyaml/all/test_package/test_package.c | 101 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libyaml/all/test_v1_package/conanfile.py | 17 + recipes/libyaml/config.yml | 5 + recipes/libyuv/all/conandata.yml | 28 + recipes/libyuv/all/conanfile.py | 93 + .../all/patches/1768-0001-fix-cmake.patch | 58 + .../all/patches/1841-0001-fix-cmake.patch | 61 + .../all/patches/1854-0001-fix-cmake.patch | 68 + .../libyuv/all/test_package/CMakeLists.txt | 8 + recipes/libyuv/all/test_package/conanfile.py | 26 + .../libyuv/all/test_package/test_package.cpp | 9 + .../libyuv/all/test_v1_package/CMakeLists.txt | 8 + .../libyuv/all/test_v1_package/conanfile.py | 17 + recipes/libyuv/config.yml | 9 + recipes/libzen/all/conandata.yml | 8 + recipes/libzen/all/conanfile.py | 117 + .../0001-enable-WIN32-shared-libraries.patch | 11 + .../0002-export-data-in-windows-dlls.patch | 42 + .../libzen/all/test_package/CMakeLists.txt | 8 + recipes/libzen/all/test_package/conanfile.py | 26 + .../libzen/all/test_package/test_package.cpp | 28 + .../libzen/all/test_v1_package/CMakeLists.txt | 8 + .../libzen/all/test_v1_package/conanfile.py | 17 + recipes/libzen/config.yml | 3 + recipes/libzip/all/conandata.yml | 26 + recipes/libzip/all/conanfile.py | 186 + .../patches/0001-cmake-install-bundle.patch | 11 + .../libzip/all/test_package/CMakeLists.txt | 7 + recipes/libzip/all/test_package/conanfile.py | 26 + .../libzip/all/test_package/test_package.c | 100 + .../libzip/all/test_v1_package/CMakeLists.txt | 8 + .../libzip/all/test_v1_package/conanfile.py | 17 + recipes/libzip/config.yml | 7 + recipes/libzippp/all/conandata.yml | 10 + recipes/libzippp/all/conanfile.py | 112 + .../libzippp/all/test_package/CMakeLists.txt | 8 + .../libzippp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 52 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libzippp/all/test_v1_package/conanfile.py | 18 + recipes/libzippp/config.yml | 7 + recipes/lief/all/conandata.yml | 46 + recipes/lief/all/conanfile.py | 159 + .../patches/0.12.2-001_link_to_conan.patch | 96 + .../0.12.2-002_support_older_gcc.patch | 13 + .../patches/0.12.3-001_link_to_conan.patch | 89 + .../lief/all/patches/001_link_to_conan.patch | 155 + .../patches/002_fix_resources_manager.patch | 10 + .../patches/003_fix_json_include_path.patch | 11 + .../lief/all/patches/004_fix_elf_parser.patch | 20 + .../patches/005_fix_compiler_detection.patch | 26 + .../lief/all/patches/006_fix_binary_cpp.patch | 10 + recipes/lief/all/test_package/CMakeLists.txt | 11 + recipes/lief/all/test_package/conanfile.py | 29 + .../lief/all/test_package/test_package.cpp | 27 + .../lief/all/test_v1_package/CMakeLists.txt | 8 + recipes/lief/all/test_v1_package/conanfile.py | 20 + recipes/lief/config.yml | 7 + recipes/lightgbm/all/CMakeLists.txt | 7 + recipes/lightgbm/all/conandata.yml | 18 + recipes/lightgbm/all/conanfile.py | 105 + .../all/patches/0001-fix-includes.patch | 16 + .../all/patches/0002-fix-openmp-clang.patch | 13 + .../all/patches/0003-fix-openmp-clang.patch | 13 + .../lightgbm/all/test_package/CMakeLists.txt | 11 + .../lightgbm/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 12 + recipes/lightgbm/config.yml | 5 + recipes/lightpcapng/all/CMakeLists.txt | 8 + recipes/lightpcapng/all/conandata.yml | 4 + recipes/lightpcapng/all/conanfile.py | 82 + .../all/test_package/CMakeLists.txt | 10 + .../lightpcapng/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 10 + recipes/lightpcapng/config.yml | 3 + recipes/linmath.h/all/conandata.yml | 4 + recipes/linmath.h/all/conanfile.py | 41 + .../linmath.h/all/test_package/CMakeLists.txt | 7 + .../linmath.h/all/test_package/conanfile.py | 26 + .../linmath.h/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/linmath.h/config.yml | 3 + .../linux-headers-generic/all/conandata.yml | 7 + .../linux-headers-generic/all/conanfile.py | 43 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 18 + .../all/test_package/test_package.c | 8 + recipes/linux-headers-generic/config.yml | 5 + .../linux-syscall-support/all/conandata.yml | 3 + .../linux-syscall-support/all/conanfile.py | 49 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/linux-syscall-support/config.yml | 3 + recipes/liquid-dsp/all/conandata.yml | 8 + recipes/liquid-dsp/all/conanfile.py | 186 + .../liquid-dsp/all/generate_link_library.bat | 4 + .../1.3.2/0001-Remove-headers-check.patch | 37 + .../all/test_package/CMakeLists.txt | 8 + .../liquid-dsp/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 9 + recipes/liquid-dsp/config.yml | 3 + recipes/litehtml/all/conandata.yml | 7 + recipes/litehtml/all/conanfile.py | 141 + recipes/litehtml/all/patches/0001-icu.patch | 15 + .../litehtml/all/test_package/CMakeLists.txt | 8 + .../litehtml/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../litehtml/all/test_v1_package/conanfile.py | 17 + recipes/litehtml/config.yml | 3 + recipes/llhttp/all/CMakeLists.txt | 9 + recipes/llhttp/all/conandata.yml | 8 + recipes/llhttp/all/conanfile.py | 87 + .../all/patches/cmake_install_dirs.patch | 11 + .../llhttp/all/test_package/CMakeLists.txt | 11 + recipes/llhttp/all/test_package/conanfile.py | 17 + .../llhttp/all/test_package/test_package.c | 16 + recipes/llhttp/config.yml | 3 + recipes/llvm-core/all/CMakeLists.txt | 26 + recipes/llvm-core/all/conandata.yml | 27 + recipes/llvm-core/all/conanfile.py | 429 ++ .../all/patches/11x/11.1.0-cmake.patch | 57 + .../all/patches/11x/11.1.0-native.patch | 81 + .../all/patches/12x/12.0.0-cmake.patch | 55 + .../all/patches/12x/12.0.0-native.patch | 81 + .../all/patches/13x/13.0.0-cmake.patch | 54 + .../all/patches/13x/13.0.0-native.patch | 78 + .../llvm-core/all/test_package/CMakeLists.txt | 20 + .../llvm-core/all/test_package/conanfile.py | 39 + .../all/test_package/test_function.ll | 6 + .../all/test_package/test_package.cpp | 38 + recipes/llvm-core/config.yml | 7 + recipes/llvm-openmp/all/CMakeLists.txt | 7 + recipes/llvm-openmp/all/conandata.yml | 36 + recipes/llvm-openmp/all/conanfile.py | 141 + .../patches/0001-disable-build-testing.patch | 38 + .../0001-disable-build-testing_10.0.0.patch | 50 + .../0001-disable-build-testing_11.1.0.patch | 52 + .../0001-disable-build-testing_12.0.1.patch | 55 + .../0002-disable-omp-target_12.0.1.patch | 15 + .../patches/0003-fix-armv8-build_11.1.0.patch | 19 + .../all/test_package/CMakeLists.txt | 10 + .../llvm-openmp/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 22 + recipes/llvm-openmp/config.yml | 11 + recipes/lmdb/all/CMakeLists.txt | 43 + recipes/lmdb/all/conandata.yml | 4 + recipes/lmdb/all/conanfile.py | 86 + recipes/lmdb/all/test_package/CMakeLists.txt | 7 + recipes/lmdb/all/test_package/conanfile.py | 26 + recipes/lmdb/all/test_package/test_package.c | 10 + .../lmdb/all/test_v1_package/CMakeLists.txt | 10 + recipes/lmdb/all/test_v1_package/conanfile.py | 17 + recipes/lmdb/config.yml | 3 + recipes/lodepng/all/CMakeLists.txt | 12 + recipes/lodepng/all/conandata.yml | 4 + recipes/lodepng/all/conanfile.py | 68 + .../lodepng/all/test_package/CMakeLists.txt | 8 + recipes/lodepng/all/test_package/bees.png | Bin 0 -> 177424 bytes recipes/lodepng/all/test_package/conanfile.py | 27 + .../lodepng/all/test_package/test_package.cpp | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../lodepng/all/test_v1_package/conanfile.py | 18 + recipes/lodepng/config.yml | 3 + recipes/log.c/all/CMakeLists.txt | 21 + recipes/log.c/all/conandata.yml | 4 + recipes/log.c/all/conanfile.py | 65 + recipes/log.c/all/test_package/CMakeLists.txt | 7 + recipes/log.c/all/test_package/conanfile.py | 26 + recipes/log.c/all/test_package/test_package.c | 7 + .../log.c/all/test_v1_package/CMakeLists.txt | 8 + .../log.c/all/test_v1_package/conanfile.py | 17 + recipes/log.c/config.yml | 3 + recipes/log4cplus/all/conandata.yml | 45 + recipes/log4cplus/all/conanfile.py | 117 + .../all/patches/2.0.4-0001-fix-cmake.patch | 21 + .../all/patches/2.0.6-0001-fix-cmake.patch | 21 + .../log4cplus/all/test_package/CMakeLists.txt | 8 + .../log4cplus/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/log4cplus/config.yml | 13 + recipes/log4cxx/all/CMakeLists.txt | 7 + recipes/log4cxx/all/conandata.yml | 14 + recipes/log4cxx/all/conanfile.py | 149 + .../log4cxx/all/patches/0001-find-apr.patch | 17 + .../log4cxx/all/test_package/CMakeLists.txt | 11 + recipes/log4cxx/all/test_package/conanfile.py | 18 + .../all/test_package/log4cxx_config.xml | 22 + .../log4cxx/all/test_package/test_package.cpp | 20 + recipes/log4cxx/config.yml | 5 + recipes/logr/0.1.0/CMakeLists.txt | 7 + recipes/logr/0.1.0/conandata.yml | 4 + recipes/logr/0.1.0/conanfile.py | 97 + .../logr/0.1.0/test_package/CMakeLists.txt | 13 + recipes/logr/0.1.0/test_package/conanfile.py | 18 + recipes/logr/0.1.0/test_package/example.cpp | 31 + recipes/logr/all/conandata.yml | 19 + recipes/logr/all/conanfile.py | 142 + recipes/logr/all/test_package/CMakeLists.txt | 8 + recipes/logr/all/test_package/conanfile.py | 26 + recipes/logr/all/test_package/example.cpp | 31 + .../logr/all/test_v1_package/CMakeLists.txt | 11 + recipes/logr/all/test_v1_package/conanfile.py | 16 + recipes/logr/config.yml | 15 + recipes/ls-qpack/all/conandata.yml | 13 + recipes/ls-qpack/all/conanfile.py | 77 + .../all/patches/0001-use-cci-package.patch | 16 + .../all/patches/0002-add-installer.patch | 23 + .../ls-qpack/all/test_package/CMakeLists.txt | 7 + .../ls-qpack/all/test_package/conanfile.py | 26 + .../ls-qpack/all/test_package/test_package.c | 80 + .../all/test_v1_package/CMakeLists.txt | 8 + .../ls-qpack/all/test_v1_package/conanfile.py | 18 + recipes/ls-qpack/config.yml | 3 + recipes/lua/all/CMakeLists.txt | 108 + recipes/lua/all/conandata.yml | 20 + recipes/lua/all/conanfile.py | 83 + .../lua/all/patches/5.3.5/lua_mobile.patch | 21 + recipes/lua/all/test_package/CMakeLists.txt | 10 + recipes/lua/all/test_package/conanfile.py | 32 + recipes/lua/all/test_package/test_package.cpp | 20 + .../lua/all/test_v1_package/CMakeLists.txt | 7 + recipes/lua/all/test_v1_package/conanfile.py | 20 + recipes/lua/config.yml | 11 + recipes/luajit/all/conandata.yml | 12 + recipes/luajit/all/conanfile.py | 142 + .../2.1.0-beta3-0001-remove-mac-deploy.patch | 14 + .../20230104-0001-remove-mac-deploy.patch | 14 + .../luajit/all/test_package/CMakeLists.txt | 7 + recipes/luajit/all/test_package/conanfile.py | 26 + .../luajit/all/test_package/test_package.c | 9 + .../luajit/all/test_v1_package/CMakeLists.txt | 8 + .../luajit/all/test_v1_package/conanfile.py | 17 + recipes/luajit/config.yml | 5 + recipes/luau/all/CMakeLists.txt | 96 + recipes/luau/all/conandata.yml | 96 + recipes/luau/all/conanfile.py | 153 + .../all/patches/0.536-0001-fix-cmake.patch | 23 + .../all/patches/0.536-0002-rename-lerp.patch | 28 + .../all/patches/0.552-0001-fix-cmake.patch | 23 + .../all/patches/0.568-0001-fix-cmake.patch | 35 + .../all/patches/0.572-0001-fix-cmake.patch | 23 + recipes/luau/all/test_package/CMakeLists.txt | 8 + recipes/luau/all/test_package/conanfile.py | 25 + .../luau/all/test_package/test_package.cpp | 10 + .../luau/all/test_v1_package/CMakeLists.txt | 8 + recipes/luau/all/test_v1_package/conanfile.py | 17 + recipes/luau/config.yml | 21 + recipes/lunasvg/all/conandata.yml | 31 + recipes/lunasvg/all/conanfile.py | 115 + .../all/patches/2.3.1-0001-fix-cmake.patch | 36 + .../all/patches/2.3.5-0001-fix-cmake.patch | 36 + .../lunasvg/all/test_package/CMakeLists.txt | 8 + recipes/lunasvg/all/test_package/conanfile.py | 26 + .../lunasvg/all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 11 + .../lunasvg/all/test_v1_package/conanfile.py | 17 + recipes/lunasvg/config.yml | 9 + recipes/luple/all/conandata.yml | 6 + recipes/luple/all/conanfile.py | 71 + recipes/luple/all/test_package/CMakeLists.txt | 8 + recipes/luple/all/test_package/conanfile.py | 26 + .../luple/all/test_package/test_package.cpp | 52 + .../luple/all/test_v1_package/CMakeLists.txt | 8 + .../luple/all/test_v1_package/conanfile.py | 17 + recipes/luple/config.yml | 3 + recipes/lurlparser/all/CMakeLists.txt | 21 + recipes/lurlparser/all/conandata.yml | 4 + recipes/lurlparser/all/conanfile.py | 73 + .../all/test_package/CMakeLists.txt | 8 + .../lurlparser/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/lurlparser/config.yml | 3 + recipes/lyra/all/conandata.yml | 28 + recipes/lyra/all/conanfile.py | 59 + recipes/lyra/all/test_package/CMakeLists.txt | 8 + recipes/lyra/all/test_package/conanfile.py | 26 + .../lyra/all/test_package/test_package.cpp | 6 + .../lyra/all/test_v1_package/CMakeLists.txt | 11 + recipes/lyra/all/test_v1_package/conanfile.py | 17 + .../lyra/all/test_v1_package/test_package.cpp | 6 + recipes/lyra/config.yml | 19 + recipes/lz4/all/conandata.yml | 25 + recipes/lz4/all/conanfile.py | 122 + .../0001-cmake-add-shared-DEFINE_SYMBOL.patch | 16 + .../all/patches/0002-cmake-optional-cli.patch | 41 + ...3-cmake-minimum-required-first-1.9.2.patch | 25 + ...3-cmake-minimum-required-first-1.9.3.patch | 25 + recipes/lz4/all/test_package/CMakeLists.txt | 21 + recipes/lz4/all/test_package/conanfile.py | 32 + recipes/lz4/all/test_package/lib.c | 13 + recipes/lz4/all/test_package/test_package.c | 13 + .../lz4/all/test_v1_package/CMakeLists.txt | 24 + recipes/lz4/all/test_v1_package/conanfile.py | 19 + recipes/lz4/config.yml | 7 + recipes/lzfse/all/conandata.yml | 7 + recipes/lzfse/all/conanfile.py | 72 + .../lzfse/all/patches/0001-fix-cmake.patch | 33 + recipes/lzfse/all/test_package/CMakeLists.txt | 8 + recipes/lzfse/all/test_package/conanfile.py | 27 + recipes/lzfse/all/test_package/test.txt | 1 + recipes/lzfse/all/test_package/test_package.c | 336 ++ .../lzfse/all/test_v1_package/CMakeLists.txt | 8 + .../lzfse/all/test_v1_package/conanfile.py | 18 + recipes/lzfse/config.yml | 3 + recipes/lzham/all/conandata.yml | 33 + recipes/lzham/all/conanfile.py | 158 + .../patches/aarch64-yield-cci.20220103.patch | 16 + .../cmake-min-req-swap-cci.20220103.patch | 55 + .../patches/cmake-rm-tests-cci.20220103.patch | 12 + .../all/patches/fix-osx-cci.20220103.patch | 28 + .../all/patches/msvc-conan-cci.20220103.patch | 83 + .../use-lzham-types-cci.20220103.patch | 142 + recipes/lzham/all/test_package/CMakeLists.txt | 7 + recipes/lzham/all/test_package/conanfile.py | 27 + .../lzham/all/test_package/test_package.cpp | 23 + .../lzham/all/test_v1_package/CMakeLists.txt | 10 + .../lzham/all/test_v1_package/conanfile.py | 17 + recipes/lzham/config.yml | 3 + recipes/lzip/all/conandata.yml | 20 + recipes/lzip/all/conanfile.py | 102 + .../all/patches/1.21-0001-any-compiler.patch | 25 + .../all/patches/1.22-0001-any-compiler.patch | 18 + recipes/lzip/all/test_package/conanfile.py | 27 + recipes/lzip/config.yml | 5 + recipes/lzma_sdk/9.20/conandata.yml | 4 + recipes/lzma_sdk/9.20/conanfile.py | 140 + .../lzma_sdk/9.20/test_package/conanfile.py | 10 + recipes/lzma_sdk/config.yml | 3 + recipes/lzo/all/conandata.yml | 4 + recipes/lzo/all/conanfile.py | 66 + recipes/lzo/all/test_package/CMakeLists.txt | 7 + recipes/lzo/all/test_package/conanfile.py | 26 + recipes/lzo/all/test_package/test_package.c | 47 + .../lzo/all/test_v1_package/CMakeLists.txt | 8 + recipes/lzo/all/test_v1_package/conanfile.py | 18 + .../lzo/all/test_v1_package/test_package.c | 47 + recipes/lzo/config.yml | 3 + recipes/m4/all/conandata.yml | 27 + recipes/m4/all/conanfile.py | 123 + ...adjust-to-glibc-2.28-libio.h-removal.patch | 170 + ...e-more-paranoid-about-libio.h-change.patch | 156 + .../patches/1.4.18-0003-secure_snprintf.patch | 16 + .../all/patches/1.4.18-0004-fix-checks.patch | 35 + ...4.18-0005-vasnprintf-Fix-for-MSVC-14.patch | 124 + ...8-0006-manywarnings-update-for-gcc-7.patch | 50 + ...-0007-vasnprintf-port-to-macos-10.13.patch | 47 + ....4.18-0008-open-files-in-binary-mode.patch | 15 + ....18-0009-disable-hardening-in-source.patch | 16 + ....18-0010-c-stack-stop-using-SIGSTKSZ.patch | 106 + ....4.19-0001-open-files-in-binary-mode.patch | 15 + .../m4/all/patches/1.4.19-0002-ar-lib.patch | 276 ++ .../1.4.19-0003-msvc-debug-assertion.patch | 31 + ....19-0004-disable-hardening-in-source.patch | 16 + recipes/m4/all/test_package/conanfile.py | 36 + recipes/m4/all/test_package/frozen.m4f | 11 + recipes/m4/all/test_package/test.m4 | 2 + recipes/m4/all/test_v1_package/conanfile.py | 41 + recipes/m4/config.yml | 5 + recipes/maddy/all/conandata.yml | 4 + recipes/maddy/all/conanfile.py | 47 + recipes/maddy/all/test_package/CMakeLists.txt | 12 + recipes/maddy/all/test_package/conanfile.py | 17 + recipes/maddy/all/test_package/example.cpp | 31 + recipes/maddy/config.yml | 3 + recipes/magic_enum/all/conandata.yml | 28 + recipes/magic_enum/all/conanfile.py | 71 + .../all/test_package/CMakeLists.txt | 8 + .../magic_enum/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/magic_enum/config.yml | 19 + recipes/magnum-extras/all/CMakeLists.txt | 10 + recipes/magnum-extras/all/conandata.yml | 11 + recipes/magnum-extras/all/conanfile.py | 144 + .../2020.06/0001-emscripten-toolchain.patch | 15 + .../all/test_package/CMakeLists.txt | 16 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 25 + recipes/magnum-extras/config.yml | 3 + recipes/magnum-integration/all/CMakeLists.txt | 10 + recipes/magnum-integration/all/conandata.yml | 4 + recipes/magnum-integration/all/conanfile.py | 171 + .../all/test_package/CMakeLists.txt | 36 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 72 + recipes/magnum-integration/config.yml | 3 + recipes/magnum-plugins/all/CMakeLists.txt | 41 + .../cmake/conan-bugfix-global-target.cmake | 24 + recipes/magnum-plugins/all/conandata.yml | 11 + recipes/magnum-plugins/all/conanfile.py | 323 ++ .../2020.06/0001-emscripten-toolchain.patch | 15 + .../all/test_package/CMakeLists.txt | 36 + .../magnum-plugins/all/test_package/conan.stl | Bin 0 -> 9084 bytes .../all/test_package/conanfile.py | 25 + .../all/test_package/configure.h.in | 4 + .../all/test_package/test_package.cpp | 17 + recipes/magnum-plugins/config.yml | 3 + recipes/magnum/all/CMakeLists.txt | 7 + .../cmake/conan-bugfix-global-target.cmake | 24 + .../magnum/all/cmake/conan-magnum-vars.cmake | 25 + recipes/magnum/all/conandata.yml | 4 + recipes/magnum/all/conanfile.py | 708 ++++ .../magnum/all/test_package/CMakeLists.txt | 83 + recipes/magnum/all/test_package/conanfile.py | 44 + .../magnum/all/test_package/configure.h.in | 3 + .../magnum/all/test_package/test_package.cpp | 37 + .../magnum/all/test_package/triangleMesh.obj | 9 + recipes/magnum/config.yml | 3 + recipes/mailio/all/conandata.yml | 16 + recipes/mailio/all/conanfile.py | 109 + .../all/patches/0.20.0-adapt-cmakelists.patch | 13 + .../all/patches/0.21.0-adapt-cmakelists.patch | 32 + .../mailio/all/test_package/CMakeLists.txt | 8 + recipes/mailio/all/test_package/conanfile.py | 26 + .../mailio/all/test_package/test_package.cpp | 14 + .../mailio/all/test_v1_package/CMakeLists.txt | 8 + .../mailio/all/test_v1_package/conanfile.py | 18 + recipes/mailio/config.yml | 5 + recipes/make/all/conandata.yml | 12 + recipes/make/all/conanfile.py | 82 + .../make/all/patches/4.2.1-0001-clang.patch | 11 + recipes/make/all/patches/4.3-0001-clang.patch | 11 + recipes/make/all/test_package/Makefile | 2 + recipes/make/all/test_package/conanfile.py | 14 + recipes/make/all/test_v1_package/conanfile.py | 13 + recipes/make/config.yml | 5 + .../all/conandata.yml | 4 + .../all/conanfile.py | 37 + .../all/test_package/conanfile.py | 12 + .../config.yml | 3 + recipes/mapbox-geometry/all/conandata.yml | 4 + recipes/mapbox-geometry/all/conanfile.py | 49 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/mapbox-geometry/config.yml | 3 + recipes/mapbox-variant/all/conandata.yml | 4 + recipes/mapbox-variant/all/conanfile.py | 45 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/mapbox-variant/config.yml | 3 + recipes/mariadb-connector-c/all/conandata.yml | 74 + recipes/mariadb-connector-c/all/conanfile.py | 141 + ...001-fix-install-and-static-or-shared.patch | 96 + .../3.1.11-0002-msvc-no-override-md-zi.patch | 11 + ...-0003-include-order-windows-winsock2.patch | 18 + ....11-0004-include-mysqld_error-header.patch | 11 + .../3.1.11-0005-fix-cmake-connectorname.patch | 11 + ...001-fix-install-and-static-or-shared.patch | 122 + .../patches/3.1.19-0002-remove-wx-flag.patch | 13 + ...001-fix-install-and-static-or-shared.patch | 127 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 21 + recipes/mariadb-connector-c/config.yml | 9 + recipes/marisa/all/CMakeLists.txt | 7 + recipes/marisa/all/conandata.yml | 8 + recipes/marisa/all/conanfile.py | 87 + .../marisa/all/patches/0001-add-cmake.patch | 120 + .../marisa/all/test_package/CMakeLists.txt | 10 + recipes/marisa/all/test_package/conanfile.py | 18 + .../marisa/all/test_package/test_package.cpp | 12 + recipes/marisa/config.yml | 3 + recipes/matchit/all/conandata.yml | 4 + recipes/matchit/all/conanfile.py | 71 + .../matchit/all/test_package/CMakeLists.txt | 8 + recipes/matchit/all/test_package/conanfile.py | 26 + .../matchit/all/test_package/test_package.cpp | 23 + .../all/test_v1_package/CMakeLists.txt | 8 + .../matchit/all/test_v1_package/conanfile.py | 17 + recipes/matchit/config.yml | 3 + recipes/mathfu/all/conandata.yml | 4 + recipes/mathfu/all/conanfile.py | 43 + .../mathfu/all/test_package/CMakeLists.txt | 7 + recipes/mathfu/all/test_package/conanfile.py | 26 + .../mathfu/all/test_package/test_package.cpp | 11 + .../mathfu/all/test_v1_package/CMakeLists.txt | 8 + .../mathfu/all/test_v1_package/conanfile.py | 17 + recipes/mathfu/config.yml | 3 + recipes/mathter/all/conandata.yml | 4 + recipes/mathter/all/conanfile.py | 49 + .../mathter/all/test_package/CMakeLists.txt | 9 + recipes/mathter/all/test_package/conanfile.py | 16 + .../mathter/all/test_package/test_package.cpp | 11 + recipes/mathter/config.yml | 3 + recipes/matio/all/CMakeLists.txt | 7 + recipes/matio/all/conandata.yml | 42 + recipes/matio/all/conanfile.py | 104 + .../all/patches/cmake-install-bundle.patch | 14 + .../all/patches/disable-hdf5-target.patch | 12 + .../patches/patch-apple-no-undefined.patch | 17 + .../all/patches/require-cmake-3.10.patch | 8 + recipes/matio/all/test_package/CMakeLists.txt | 8 + recipes/matio/all/test_package/conanfile.py | 17 + recipes/matio/all/test_package/test_package.c | 11 + recipes/matio/config.yml | 9 + .../mattiasgustavsson-libs/all/conandata.yml | 4 + .../mattiasgustavsson-libs/all/conanfile.py | 37 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 15 + recipes/mattiasgustavsson-libs/config.yml | 3 + recipes/mbedtls/all/CMakeLists.txt | 16 + recipes/mbedtls/all/conandata.yml | 19 + recipes/mbedtls/all/conanfile.py | 118 + .../mbedtls/all/test_package/CMakeLists.txt | 7 + recipes/mbedtls/all/test_package/conanfile.py | 26 + .../mbedtls/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../mbedtls/all/test_v1_package/conanfile.py | 17 + recipes/mbedtls/config.yml | 13 + recipes/mbits-args/all/conandata.yml | 10 + recipes/mbits-args/all/conanfile.py | 122 + .../0.12.3-0001-export-cmake-config.patch | 36 + .../all/test_package/CMakeLists.txt | 8 + .../mbits-args/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 32 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/mbits-args/config.yml | 3 + recipes/mbits-diags/all/conandata.yml | 4 + recipes/mbits-diags/all/conanfile.py | 117 + .../all/test_package/CMakeLists.txt | 8 + .../mbits-diags/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 59 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/mbits-diags/config.yml | 3 + recipes/mbits-mstch/all/conandata.yml | 5 + recipes/mbits-mstch/all/conanfile.py | 105 + .../all/test_package/CMakeLists.txt | 8 + .../mbits-mstch/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/mbits-mstch/config.yml | 4 + recipes/mbits-semver/all/conandata.yml | 4 + recipes/mbits-semver/all/conanfile.py | 103 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/mbits-semver/config.yml | 3 + recipes/mbits-utfconv/all/conandata.yml | 4 + recipes/mbits-utfconv/all/conanfile.py | 115 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/mbits-utfconv/config.yml | 3 + recipes/mcap/all/conandata.yml | 25 + recipes/mcap/all/conanfile.py | 79 + recipes/mcap/all/test_package/CMakeLists.txt | 8 + recipes/mcap/all/test_package/conanfile.py | 22 + .../mcap/all/test_package/test_package.cpp | 101 + .../mcap/all/test_v1_package/CMakeLists.txt | 8 + recipes/mcap/all/test_v1_package/conanfile.py | 17 + recipes/mcap/config.yml | 17 + recipes/md4c/all/conandata.yml | 8 + recipes/md4c/all/conanfile.py | 112 + .../all/patches/0001-honor-vc-runtime.patch | 18 + recipes/md4c/all/test_package/CMakeLists.txt | 7 + recipes/md4c/all/test_package/conanfile.py | 26 + recipes/md4c/all/test_package/test_package.c | 57 + .../md4c/all/test_v1_package/CMakeLists.txt | 8 + recipes/md4c/all/test_v1_package/conanfile.py | 18 + recipes/md4c/config.yml | 3 + recipes/md4qt/all/conandata.yml | 28 + recipes/md4qt/all/conanfile.py | 72 + recipes/md4qt/all/test_package/CMakeLists.txt | 8 + recipes/md4qt/all/test_package/conanfile.py | 26 + recipes/md4qt/all/test_package/test.md | 1 + .../md4qt/all/test_package/test_package.cpp | 30 + .../md4qt/all/test_v1_package/CMakeLists.txt | 11 + .../md4qt/all/test_v1_package/conanfile.py | 18 + recipes/md4qt/config.yml | 19 + recipes/mdns/all/conandata.yml | 22 + recipes/mdns/all/conanfile.py | 38 + recipes/mdns/all/test_package/CMakeLists.txt | 9 + recipes/mdns/all/test_package/conanfile.py | 17 + recipes/mdns/all/test_package/test_package.c | 43 + recipes/mdns/config.yml | 15 + recipes/mdnsresponder/all/conandata.yml | 27 + recipes/mdnsresponder/all/conanfile.py | 188 + .../all/patches/1310.140.1/dns_sd.c.patch | 19 + .../all/patches/878.200.35/DLLStub.c.patch | 32 + .../all/patches/878.200.35/Service.c.patch | 42 + .../878.200.35/mDNSResponder.sln.patch | 333 ++ .../all/patches/878.200.35/mDNSWin32.c.patch | 218 ++ .../opt/permit-over-long-service-types.patch | 11 + .../opt/poll-rather-than-select.patch | 121 + .../all/patches/878.200.35/opt/unicast.patch | 538 +++ .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.c | 18 + recipes/mdnsresponder/config.yml | 5 + recipes/mdspan/all/conandata.yml | 10 + recipes/mdspan/all/conanfile.py | 100 + .../mdspan/all/test_package/CMakeLists.txt | 20 + recipes/mdspan/all/test_package/conanfile.py | 25 + .../mdspan/all/test_package/test_package.cpp | 23 + .../mdspan/all/test_v1_package/CMakeLists.txt | 8 + .../mdspan/all/test_v1_package/conanfile.py | 18 + recipes/mdspan/config.yml | 7 + recipes/meshoptimizer/all/conandata.yml | 16 + recipes/meshoptimizer/all/conanfile.py | 80 + ...fix-build-on-old-AppleClang-versions.patch | 13 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/meshoptimizer/config.yml | 9 + recipes/meson/all/conandata.yml | 58 + recipes/meson/all/conanfile.py | 71 + recipes/meson/all/test_package/conanfile.py | 29 + recipes/meson/all/test_package/meson.build | 2 + .../meson/all/test_package/test_package.cpp | 6 + .../meson/all/test_v1_package/conanfile.py | 22 + recipes/meson/all/test_v1_package/meson.build | 2 + recipes/meson/config.yml | 39 + recipes/metall/all/conandata.yml | 10 + recipes/metall/all/conanfile.py | 89 + .../metall/all/test_package/CMakeLists.txt | 8 + recipes/metall/all/test_package/conanfile.py | 25 + .../metall/all/test_package/test_package.cpp | 51 + .../metall/all/test_v1_package/CMakeLists.txt | 11 + .../metall/all/test_v1_package/conanfile.py | 17 + recipes/metall/config.yml | 7 + recipes/metis/all/CMakeLists.txt | 10 + recipes/metis/all/conandata.yml | 16 + recipes/metis/all/conanfile.py | 101 + .../patches/001-add-gklib-system-cmake.patch | 151 + .../all/patches/002-support-pure-cmake.patch | 771 ++++ .../all/patches/003-remove-programs.patch | 8 + .../all/patches/004-use-conan-gklib.patch | 17 + .../metis/all/patches/005-fix-install.patch | 28 + recipes/metis/all/test_package/CMakeLists.txt | 10 + recipes/metis/all/test_package/conanfile.py | 24 + recipes/metis/all/test_package/test.cpp | 37 + recipes/metis/config.yml | 3 + recipes/mfast/all/conandata.yml | 14 + recipes/mfast/all/conanfile.py | 283 ++ .../all/patches/0001-fix-cmake-1.2.1.patch | 196 + .../all/patches/0001-fix-cmake-1.2.2.patch | 194 + ...emove-deprecated-boost-detail-endian.patch | 40 + .../all/patches/0003-mfast-sqlite3.patch | 22 + recipes/mfast/all/test_package/CMakeLists.txt | 13 + recipes/mfast/all/test_package/Test.xml | 8 + recipes/mfast/all/test_package/conanfile.py | 38 + .../all/test_package/message_printer.cpp | 9 + .../mfast/all/test_v1_package/CMakeLists.txt | 8 + .../mfast/all/test_v1_package/conanfile.py | 26 + recipes/mfast/config.yml | 5 + recipes/mgs/all/conandata.yml | 16 + recipes/mgs/all/conanfile.py | 123 + recipes/mgs/all/test_package/CMakeLists.txt | 7 + recipes/mgs/all/test_package/conanfile.py | 25 + recipes/mgs/all/test_package/test_package.cpp | 7 + .../mgs/all/test_v1_package/CMakeLists.txt | 8 + recipes/mgs/all/test_v1_package/conanfile.py | 17 + recipes/mgs/config.yml | 11 + recipes/microprofile/all/CMakeLists.txt | 7 + recipes/microprofile/all/conandata.yml | 12 + recipes/microprofile/all/conanfile.py | 203 + recipes/microprofile/all/patches/cmake.patch | 67 + .../all/patches/sources_fix.patch | 135 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 12 + recipes/microprofile/config.yml | 3 + recipes/microtar/all/CMakeLists.txt | 18 + recipes/microtar/all/conandata.yml | 4 + recipes/microtar/all/conanfile.py | 62 + .../microtar/all/test_package/CMakeLists.txt | 7 + .../microtar/all/test_package/conanfile.py | 26 + .../microtar/all/test_package/test_package.c | 26 + .../all/test_v1_package/CMakeLists.txt | 8 + .../microtar/all/test_v1_package/conanfile.py | 17 + recipes/microtar/config.yml | 3 + recipes/mikelankamp-fpm/all/conandata.yml | 4 + recipes/mikelankamp-fpm/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/mikelankamp-fpm/config.yml | 3 + recipes/mikktspace/all/CMakeLists.txt | 20 + recipes/mikktspace/all/conandata.yml | 4 + recipes/mikktspace/all/conanfile.py | 72 + .../all/test_package/CMakeLists.txt | 7 + .../mikktspace/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/mikktspace/config.yml | 3 + recipes/mimalloc/all/conandata.yml | 91 + recipes/mimalloc/all/conanfile.py | 251 ++ ...1-change-install-paths-avoid-symlink.patch | 40 + ...02-include-cstddef-to-get-std-size-t.patch | 12 + .../1.7.5-0001-change-install-paths.patch | 22 + .../1.7.7-0001-change-install-paths.patch | 22 + .../1.7.9-0001-change-install-paths.patch | 22 + .../1.7.9-0002-support-older-compiler.patch | 22 + ...1-change-install-paths-avoid-symlink.patch | 30 + ...02-include-cstddef-to-get-std-size-t.patch | 12 + ...1-change-install-paths-avoid-symlink.patch | 31 + .../2.0.6-0001-change-install-paths.patch | 22 + .../2.0.7-0001-change-install-paths.patch | 22 + .../2.0.9-0001-change-install-paths.patch | 22 + .../2.0.9-0002-support-older-compiler.patch | 22 + .../mimalloc/all/test_package/CMakeLists.txt | 51 + .../mimalloc/all/test_package/conanfile.py | 72 + .../all/test_package/include_override.c | 11 + .../all/test_package/include_override.cpp | 16 + recipes/mimalloc/all/test_package/mi_api.c | 11 + recipes/mimalloc/all/test_package/mi_api.cpp | 13 + .../mimalloc/all/test_package/no_changes.c | 12 + .../mimalloc/all/test_package/no_changes.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 10 + .../mimalloc/all/test_v1_package/conanfile.py | 70 + recipes/mimalloc/config.yml | 23 + recipes/mingw-builds/all/conandata.yml | 55 + recipes/mingw-builds/all/conanfile.py | 99 + .../all/test_package/conanfile.py | 16 + .../mingw-builds/all/test_package/main.cpp | 7 + recipes/mingw-builds/config.yml | 9 + recipes/mingw-w64/config.yml | 3 + recipes/mingw-w64/linux/conandata.yml | 12 + recipes/mingw-w64/linux/conanfile.py | 286 ++ .../mingw-w64/linux/test_package/conanfile.py | 16 + recipes/mingw-w64/linux/test_package/main.cpp | 9 + recipes/miniaudio/all/CMakeLists.txt | 23 + recipes/miniaudio/all/conandata.yml | 25 + recipes/miniaudio/all/conanfile.py | 115 + .../miniaudio/all/test_package/CMakeLists.txt | 7 + .../miniaudio/all/test_package/conanfile.py | 26 + .../miniaudio/all/test_package/test_package.c | 56 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/miniaudio/config.yml | 17 + recipes/minimp3/all/conandata.yml | 7 + recipes/minimp3/all/conanfile.py | 40 + .../minimp3/all/test_package/CMakeLists.txt | 7 + recipes/minimp3/all/test_package/conanfile.py | 25 + .../minimp3/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 10 + .../minimp3/all/test_v1_package/conanfile.py | 17 + recipes/minimp3/config.yml | 5 + recipes/minisat/all/CMakeLists.txt | 27 + recipes/minisat/all/conandata.yml | 14 + recipes/minisat/all/conanfile.py | 71 + ...ault-arg-in-friend-declaration-2.2.0.patch | 22 + .../patches/0002-suffix-literal-2.2.0.patch | 23 + .../minisat/all/test_package/CMakeLists.txt | 8 + recipes/minisat/all/test_package/conanfile.py | 26 + .../minisat/all/test_package/test_package.cpp | 37 + .../all/test_v1_package/CMakeLists.txt | 8 + .../minisat/all/test_v1_package/conanfile.py | 18 + recipes/minisat/config.yml | 3 + recipes/miniscript/all/CMakeLists.txt | 66 + recipes/miniscript/all/conandata.yml | 4 + recipes/miniscript/all/conanfile.py | 60 + .../all/test_package/CMakeLists.txt | 8 + .../miniscript/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 25 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/miniscript/config.yml | 3 + recipes/minitrace/all/conandata.yml | 7 + recipes/minitrace/all/conanfile.py | 64 + .../all/patches/0001-fix-cmake.patch | 41 + .../minitrace/all/test_package/CMakeLists.txt | 8 + .../minitrace/all/test_package/conanfile.py | 26 + .../minitrace/all/test_package/test_package.c | 70 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/minitrace/config.yml | 3 + recipes/miniupnpc/all/conandata.yml | 7 + recipes/miniupnpc/all/conanfile.py | 87 + .../patches/0001-fix-cross-build-ios.patch | 20 + .../miniupnpc/all/test_package/CMakeLists.txt | 7 + .../miniupnpc/all/test_package/conanfile.py | 26 + .../miniupnpc/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/miniupnpc/config.yml | 3 + recipes/miniz/all/conandata.yml | 18 + recipes/miniz/all/conanfile.py | 80 + .../patches/2.1.0/001-remove-examples.patch | 36 + .../2.1.0/002-fix-shared-windows.patch | 26 + .../patches/2.1.0/003-include-miniz_zip.patch | 8 + recipes/miniz/all/test_package/CMakeLists.txt | 7 + recipes/miniz/all/test_package/conanfile.py | 25 + recipes/miniz/all/test_package/test_package.c | 105 + .../miniz/all/test_v1_package/CMakeLists.txt | 8 + .../miniz/all/test_v1_package/conanfile.py | 17 + recipes/miniz/config.yml | 9 + recipes/minizip-ng/all/conandata.yml | 93 + recipes/minizip-ng/all/conanfile.py | 194 + .../3.0.1-0001-fix-cmake-project.patch | 22 + .../patches/3.0.1-0002-fix-lzma-libdir.patch | 10 + .../3.0.2-0001-fix-cmake-project.patch | 22 + .../3.0.3-0001-fix-cmake-project.patch | 22 + .../3.0.4-0001-fix-cmake-project.patch | 22 + .../3.0.5-0001-fix-cmake-project.patch | 22 + .../patches/3.0.5-0002-fix-lzma-libdir.patch | 10 + .../3.0.6-0001-fix-cmake-project.patch | 18 + .../patches/3.0.6-0002-fix-lzma-libdir.patch | 10 + .../3.0.7-0001-fix-cmake-project.patch | 18 + .../3.0.8-0001-fix-cmake-project.patch | 20 + .../3.0.9-0001-fix-cmake-project.patch | 20 + .../all/test_package/CMakeLists.txt | 8 + .../minizip-ng/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/minizip-ng/config.yml | 19 + recipes/minizip/all/CMakeLists.txt | 75 + recipes/minizip/all/conandata.yml | 19 + recipes/minizip/all/conanfile.py | 90 + recipes/minizip/all/patches/ioapi.patch | 102 + recipes/minizip/all/patches/miniunz.patch | 11 + recipes/minizip/all/patches/minizip.patch | 16 + .../minizip/all/test_package/CMakeLists.txt | 7 + recipes/minizip/all/test_package/conanfile.py | 26 + .../minizip/all/test_package/test_package.c | 52 + .../all/test_v1_package/CMakeLists.txt | 8 + .../minizip/all/test_v1_package/conanfile.py | 17 + recipes/minizip/config.yml | 7 + recipes/mio/all/conandata.yml | 11 + recipes/mio/all/conanfile.py | 70 + .../patches/0001-fix-include-windows.patch | 13 + recipes/mio/all/test_package/CMakeLists.txt | 8 + recipes/mio/all/test_package/conanfile.py | 25 + recipes/mio/all/test_package/test_package.cpp | 51 + .../mio/all/test_v1_package/CMakeLists.txt | 11 + recipes/mio/all/test_v1_package/conanfile.py | 17 + recipes/mio/config.yml | 5 + recipes/modern-cpp-kafka/all/conandata.yml | 19 + recipes/modern-cpp-kafka/all/conanfile.py | 75 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/modern-cpp-kafka/config.yml | 13 + recipes/mold/1.3.1/conandata.yml | 4 + recipes/mold/1.3.1/conanfile.py | 104 + recipes/mold/1.3.1/test_package/conanfile.py | 9 + recipes/mold/all/conandata.yml | 16 + recipes/mold/all/conanfile.py | 100 + recipes/mold/all/test_package/conanfile.py | 16 + recipes/mold/all/test_v1_package/conanfile.py | 10 + recipes/mold/config.yml | 13 + recipes/moltenvk/all/CMakeLists.txt | 286 ++ recipes/moltenvk/all/conandata.yml | 78 + recipes/moltenvk/all/conanfile.py | 160 + .../all/dependencies/dependencies-1.1.0.yml | 4 + .../all/dependencies/dependencies-1.1.1.yml | 4 + .../all/dependencies/dependencies-1.1.10.yml | 4 + .../all/dependencies/dependencies-1.1.11.yml | 4 + .../all/dependencies/dependencies-1.1.4.yml | 4 + .../all/dependencies/dependencies-1.1.5.yml | 4 + .../all/dependencies/dependencies-1.1.6.yml | 4 + .../all/dependencies/dependencies-1.1.8.yml | 4 + .../all/dependencies/dependencies-1.1.9.yml | 4 + .../all/dependencies/dependencies-1.2.0.yml | 4 + .../all/dependencies/dependencies-1.2.1.yml | 4 + .../all/dependencies/dependencies-1.2.2.yml | 4 + .../1.1.0-0001-fix-spirv-cross-includes.patch | 54 + ....11-0001-vulkan-alias-private-extern.patch | 21 + .../patches/1.1.5-0001-allow-c++11-std.patch | 16 + .../patches/1.1.6-0001-allow-c++11-std.patch | 16 + .../patches/1.1.8-0001-allow-c++11-std.patch | 14 + ...1.8-0002-vulkan-alias-private-extern.patch | 21 + ...2.0-0001-fix-version-number-icd-json.patch | 11 + .../moltenvk/all/test_package/CMakeLists.txt | 8 + .../moltenvk/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 37 + .../all/test_v1_package/CMakeLists.txt | 8 + .../moltenvk/all/test_v1_package/conanfile.py | 17 + recipes/moltenvk/config.yml | 25 + recipes/mongo-c-driver/all/conandata.yml | 69 + recipes/mongo-c-driver/all/conanfile.py | 264 ++ ...17.2-0001-disable-shared-when-static.patch | 77 + ...17.6-0001-disable-shared-when-static.patch | 77 + ...22.0-0001-disable-shared-when-static.patch | 77 + ....22.0-0002-fix-uninitialized-warning.patch | 13 + .../1.22.0-0003-disable-warning-errors.patch | 15 + ...23.2-0001-disable-shared-when-static.patch | 82 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/mongo-c-driver/config.yml | 15 + recipes/mongo-cxx-driver/all/conandata.yml | 52 + recipes/mongo-cxx-driver/all/conanfile.py | 199 + .../all/patches/3.6.x-dirs_and_tests.patch | 121 + .../all/patches/3.7.0-dirs.patch | 80 + .../all/patches/poly_use_std_define.patch | 13 + .../all/test_package/CMakeLists.txt | 20 + .../all/test_package/conanfile.py | 31 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/mongo-cxx-driver/config.yml | 11 + recipes/morton-nd/all/conandata.yml | 7 + recipes/morton-nd/all/conanfile.py | 80 + .../morton-nd/all/test_package/CMakeLists.txt | 11 + .../morton-nd/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 14 + .../all/test_v1_package/conanfile.py | 17 + recipes/morton-nd/config.yml | 5 + recipes/mosquitto/1.x/conandata.yml | 12 + recipes/mosquitto/1.x/conanfile.py | 115 + .../1.x/patches/1.6.12-0001-fix-cmake.patch | 68 + .../1.x/patches/1.6.12-0002-fix-macos.patch | 24 + .../mosquitto/1.x/test_package/CMakeLists.txt | 7 + .../mosquitto/1.x/test_package/conanfile.py | 26 + .../mosquitto/1.x/test_package/test_package.c | 59 + .../1.x/test_v1_package/CMakeLists.txt | 8 + .../1.x/test_v1_package/conanfile.py | 17 + recipes/mosquitto/2.x/conandata.yml | 25 + recipes/mosquitto/2.x/conanfile.py | 171 + .../mosquitto/2.x/test_package/CMakeLists.txt | 7 + .../mosquitto/2.x/test_package/conanfile.py | 26 + .../mosquitto/2.x/test_package/test_package.c | 59 + .../2.x/test_v1_package/CMakeLists.txt | 8 + .../2.x/test_v1_package/conanfile.py | 18 + recipes/mosquitto/config.yml | 19 + recipes/mozilla-build/all/conandata.yml | 6 + recipes/mozilla-build/all/conanfile.py | 43 + .../all/test_package/conanfile.py | 15 + recipes/mozilla-build/config.yml | 3 + recipes/mozjpeg/all/conandata.yml | 23 + recipes/mozjpeg/all/conanfile.py | 212 + .../all/patches/3.3.1-0001-cmake-fixes.patch | 121 + .../all/patches/4.0.0-0001-cmake-fixes.patch | 32 + .../all/patches/4.1.1-0001-cmake-fixes.patch | 34 + .../mozjpeg/all/test_package/CMakeLists.txt | 11 + recipes/mozjpeg/all/test_package/conanfile.py | 27 + .../mozjpeg/all/test_package/test_package.c | 528 +++ recipes/mozjpeg/all/test_package/testimg.jpg | Bin 0 -> 5764 bytes .../all/test_package_module/CMakeLists.txt | 7 + .../all/test_package_module/conanfile.py | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../mozjpeg/all/test_v1_package/conanfile.py | 19 + .../all/test_v1_package_module/CMakeLists.txt | 8 + .../all/test_v1_package_module/conanfile.py | 18 + recipes/mozjpeg/config.yml | 7 + recipes/mp-units/0.6.0/conandata.yml | 4 + recipes/mp-units/0.6.0/conanfile.py | 69 + .../0.6.0/test_package/CMakeLists.txt | 9 + .../mp-units/0.6.0/test_package/conanfile.py | 25 + .../0.6.0/test_package/test_package.cpp | 8 + recipes/mp-units/0.7.0/conandata.yml | 4 + recipes/mp-units/0.7.0/conanfile.py | 84 + .../0.7.0/test_package/CMakeLists.txt | 10 + .../mp-units/0.7.0/test_package/conanfile.py | 25 + .../0.7.0/test_package/test_package.cpp | 19 + recipes/mp-units/config.yml | 5 + recipes/mpark-variant/all/conandata.yml | 4 + recipes/mpark-variant/all/conanfile.py | 73 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/mpark-variant/config.yml | 3 + recipes/mpc/all/conandata.yml | 12 + recipes/mpc/all/conanfile.py | 101 + .../1.2.0-0001-asin-missing-limits.patch | 11 + recipes/mpc/all/test_package/CMakeLists.txt | 7 + recipes/mpc/all/test_package/conanfile.py | 25 + recipes/mpc/all/test_package/test_package.c | 16 + .../mpc/all/test_v1_package/CMakeLists.txt | 8 + recipes/mpc/all/test_v1_package/conanfile.py | 17 + recipes/mpc/config.yml | 5 + recipes/mpdecimal/2.4.2/conandata.yml | 10 + recipes/mpdecimal/2.4.2/conanfile.py | 208 + .../2.4.2/patches/0001-msvc-fixes.patch | 34 + .../0002-disable-vcstdint-h-vs2015.patch | 18 + .../2.4.2/test_package/CMakeLists.txt | 8 + .../mpdecimal/2.4.2/test_package/conanfile.py | 16 + .../2.4.2/test_package/test_package.c | 74 + recipes/mpdecimal/2.5.x/conandata.yml | 15 + recipes/mpdecimal/2.5.x/conanfile.py | 242 ++ .../2.5.x/patches/0001-2.5.0-msvc-fixes.patch | 65 + .../0002-add-mingw-to-configure-ac.patch | 64 + .../2.5.x/patches/2.5.1-0001-msvc-fixes.patch | 73 + ...2.5.1-0002-add-mingw-to-configure-ac.patch | 36 + .../2.5.1-0003-use-MPDECIMAL_DLL.patch | 15 + .../2.5.x/test_package/CMakeLists.txt | 18 + .../mpdecimal/2.5.x/test_package/conanfile.py | 29 + .../2.5.x/test_package/test_package.c | 74 + .../2.5.x/test_package/test_package.cpp | 14 + .../2.5.x/test_v1_package/CMakeLists.txt | 10 + .../2.5.x/test_v1_package/conanfile.py | 18 + recipes/mpdecimal/config.yml | 7 + recipes/mpfr/all/CMakeLists.txt.in | 22 + recipes/mpfr/all/conandata.yml | 16 + recipes/mpfr/all/conanfile.py | 182 + .../4.0.2-0001-configure.ac-fixes.patch | 21 + .../4.0.2-0002-windows-header-dll.patch | 27 + .../4.1.0-0001-configure.ac-fixes.patch | 22 + .../4.1.0-0002-windows-header-dll.patch | 27 + recipes/mpfr/all/test_package/CMakeLists.txt | 7 + recipes/mpfr/all/test_package/conanfile.py | 25 + recipes/mpfr/all/test_package/test_package.c | 32 + .../mpfr/all/test_v1_package/CMakeLists.txt | 10 + recipes/mpfr/all/test_v1_package/conanfile.py | 17 + recipes/mpfr/config.yml | 5 + recipes/mpg123/all/conandata.yml | 25 + recipes/mpg123/all/conanfile.py | 235 ++ .../patches/0001-msvc-export-symbols.patch | 22 + .../0002-cmake-read_api_version-fix.patch | 10 + .../mpg123/all/test_package/CMakeLists.txt | 7 + recipes/mpg123/all/test_package/conanfile.py | 26 + .../mpg123/all/test_package/test_package.c | 12 + .../mpg123/all/test_v1_package/CMakeLists.txt | 8 + .../mpg123/all/test_v1_package/conanfile.py | 18 + .../mpg123/all/test_v1_package/test_package.c | 12 + recipes/mpg123/config.yml | 7 + recipes/mpir/all/conandata.yml | 4 + recipes/mpir/all/conanfile.py | 217 + recipes/mpir/all/test_package/CMakeLists.txt | 10 + recipes/mpir/all/test_package/conanfile.py | 18 + .../mpir/all/test_package/test_package.cpp | 20 + recipes/mpir/config.yml | 3 + recipes/mpmcqueue/all/conandata.yml | 4 + recipes/mpmcqueue/all/conanfile.py | 55 + .../mpmcqueue/all/test_package/CMakeLists.txt | 9 + .../mpmcqueue/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 17 + recipes/mpmcqueue/config.yml | 3 + recipes/mppp/all/conandata.yml | 16 + recipes/mppp/all/conanfile.py | 131 + .../0.26-0001-disable-warning-error.patch | 22 + .../0.27-0001-disable-warning-error.patch | 25 + recipes/mppp/all/test_package/CMakeLists.txt | 8 + recipes/mppp/all/test_package/conanfile.py | 25 + .../mppp/all/test_package/test_package.cpp | 14 + .../mppp/all/test_v1_package/CMakeLists.txt | 8 + recipes/mppp/all/test_v1_package/conanfile.py | 18 + recipes/mppp/config.yml | 5 + recipes/ms-gsl/all/conandata.yml | 16 + recipes/ms-gsl/all/conanfile.py | 105 + .../ms-gsl/all/test_package/CMakeLists.txt | 8 + recipes/ms-gsl/all/test_package/conanfile.py | 26 + .../ms-gsl/all/test_package/test_package.cpp | 12 + .../ms-gsl/all/test_v1_package/CMakeLists.txt | 8 + .../ms-gsl/all/test_v1_package/conanfile.py | 19 + recipes/ms-gsl/config.yml | 11 + recipes/msdf-atlas-gen/all/CMakeLists.txt | 10 + recipes/msdf-atlas-gen/all/conandata.yml | 4 + recipes/msdf-atlas-gen/all/conanfile.py | 71 + .../all/test_package/Sacramento-Regular.ttf | Bin 0 -> 79696 bytes .../all/test_package/conanfile.py | 28 + .../all/test_package/uppercase_charset | 1 + recipes/msdf-atlas-gen/config.yml | 3 + recipes/msdfgen/all/conandata.yml | 27 + recipes/msdfgen/all/conanfile.py | 173 + .../all/patches/1.10-0001-fix-cmake.patch | 24 + .../1.9-0001-unvendor-external-libs.patch | 29 + .../patches/1.9-0002-fix-install-bundle.patch | 11 + .../msdfgen/all/test_package/CMakeLists.txt | 8 + .../all/test_package/OpenSans-Bold.ttf | Bin 0 -> 224592 bytes recipes/msdfgen/all/test_package/conanfile.py | 27 + .../msdfgen/all/test_package/test_package.cpp | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../msdfgen/all/test_v1_package/conanfile.py | 18 + recipes/msdfgen/config.yml | 7 + recipes/msgpack-c/all/conandata.yml | 10 + recipes/msgpack-c/all/conanfile.py | 100 + .../msgpack-c/all/test_package/CMakeLists.txt | 11 + .../msgpack-c/all/test_package/conanfile.py | 26 + .../msgpack-c/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/msgpack-c/config.yml | 7 + recipes/msgpack-cxx/all/conandata.yml | 22 + recipes/msgpack-cxx/all/conanfile.py | 101 + .../all/test_package/CMakeLists.txt | 8 + .../msgpack-cxx/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/msgpack-cxx/config.yml | 15 + recipes/msgpack/all/CMakeLists.txt | 7 + recipes/msgpack/all/conandata.yml | 7 + recipes/msgpack/all/conanfile.py | 135 + .../msgpack/all/test_package/CMakeLists.txt | 18 + recipes/msgpack/all/test_package/conanfile.py | 23 + .../msgpack/all/test_package/test_package.c | 8 + .../msgpack/all/test_package/test_package.cpp | 10 + recipes/msgpack/config.yml | 5 + recipes/msix/all/CMakeLists.txt | 7 + recipes/msix/all/conandata.yml | 10 + recipes/msix/all/conanfile.py | 157 + recipes/msix/all/patches/1.7/cmake.patch | 233 ++ .../all/patches/1.7/signaturevalidator.patch | 39 + recipes/msix/all/test_package/CMakeLists.txt | 9 + recipes/msix/all/test_package/conanfile.py | 17 + recipes/msix/all/test_package/example.cpp | 26 + recipes/msix/config.yml | 3 + recipes/msys2/all/conandata.yml | 8 + recipes/msys2/all/conanfile.py | 194 + recipes/msys2/all/test_package/conanfile.py | 35 + .../msys2/all/test_v1_package/conanfile.py | 29 + recipes/msys2/config.yml | 4 + recipes/mujs/all/CMakeLists.txt | 20 + recipes/mujs/all/conandata.yml | 4 + recipes/mujs/all/conanfile.py | 66 + recipes/mujs/all/test_package/CMakeLists.txt | 7 + recipes/mujs/all/test_package/conanfile.py | 26 + recipes/mujs/all/test_package/test_package.c | 24 + .../mujs/all/test_v1_package/CMakeLists.txt | 8 + recipes/mujs/all/test_v1_package/conanfile.py | 17 + recipes/mujs/config.yml | 3 + recipes/muparser/all/conandata.yml | 7 + recipes/muparser/all/conanfile.py | 80 + .../muparser/all/test_package/CMakeLists.txt | 8 + .../muparser/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 35 + .../all/test_v1_package/CMakeLists.txt | 8 + .../muparser/all/test_v1_package/conanfile.py | 17 + recipes/muparser/config.yml | 5 + recipes/muparserx/all/conandata.yml | 4 + recipes/muparserx/all/conanfile.py | 77 + .../muparserx/all/test_package/CMakeLists.txt | 8 + .../muparserx/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/muparserx/config.yml | 3 + recipes/mysql-connector-c/all/CMakeLists.txt | 18 + recipes/mysql-connector-c/all/conandata.yml | 14 + recipes/mysql-connector-c/all/conanfile.py | 97 + .../001-20028_all_mysql-5.6-gcc7.patch | 13 + .../all/patches/002-mysql_config.patch | 55 + ...003-cmake-install-standard-locations.patch | 11 + .../all/patches/004-cmake-install-typo.patch | 15 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 8 + recipes/mysql-connector-c/config.yml | 3 + recipes/mysql-connector-cpp/all/conandata.yml | 4 + recipes/mysql-connector-cpp/all/conanfile.py | 111 + .../all/test_package/CMakeLists.txt | 6 + .../all/test_package/conanfile.py | 26 + .../all/test_package/src/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 7 + .../all/test_v1_package/conanfile.py | 18 + recipes/mysql-connector-cpp/config.yml | 3 + recipes/naive-tsearch/all/CMakeLists.txt | 7 + recipes/naive-tsearch/all/conandata.yml | 7 + recipes/naive-tsearch/all/conanfile.py | 78 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 12 + recipes/naive-tsearch/config.yml | 5 + recipes/namedtype/all/conandata.yml | 7 + recipes/namedtype/all/conanfile.py | 80 + .../namedtype/all/test_package/CMakeLists.txt | 8 + .../namedtype/all/test_package/conanfile.py | 26 + recipes/namedtype/all/test_package/main.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/namedtype/config.yml | 6 + recipes/nameof/all/conandata.yml | 16 + recipes/nameof/all/conanfile.py | 78 + .../nameof/all/test_package/CMakeLists.txt | 8 + recipes/nameof/all/test_package/conanfile.py | 25 + .../nameof/all/test_package/test_package.cpp | 19 + .../nameof/all/test_v1_package/CMakeLists.txt | 8 + .../nameof/all/test_v1_package/conanfile.py | 18 + recipes/nameof/config.yml | 11 + recipes/nanobench/all/conandata.yml | 29 + recipes/nanobench/all/conanfile.py | 53 + .../4.3.9-0001-support-older-msvc.patch | 51 + .../nanobench/all/test_package/CMakeLists.txt | 8 + .../nanobench/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/nanobench/config.yml | 15 + recipes/nanodbc/all/CMakeLists.txt | 11 + recipes/nanodbc/all/conandata.yml | 26 + recipes/nanodbc/all/conanfile.py | 104 + .../all/patches/0001-odbc-from-cci.patch | 31 + .../patches/0002-allow-windows-shared.patch | 15 + .../nanodbc/all/test_package/CMakeLists.txt | 9 + recipes/nanodbc/all/test_package/conanfile.py | 17 + .../nanodbc/all/test_package/test_package.cpp | 18 + recipes/nanodbc/config.yml | 7 + recipes/nanoflann/all/conandata.yml | 13 + recipes/nanoflann/all/conanfile.py | 52 + .../nanoflann/all/test_package/CMakeLists.txt | 8 + .../nanoflann/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/nanoflann/config.yml | 9 + recipes/nanorange/all/conandata.yml | 7 + recipes/nanorange/all/conanfile.py | 70 + .../nanorange/all/test_package/CMakeLists.txt | 8 + .../nanorange/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/nanorange/config.yml | 5 + recipes/nanosvg/all/conandata.yml | 7 + recipes/nanosvg/all/conanfile.py | 43 + .../nanosvg/all/test_package/CMakeLists.txt | 7 + recipes/nanosvg/all/test_package/conanfile.py | 26 + recipes/nanosvg/all/test_package/nano.svg | 27 + .../nanosvg/all/test_package/test_package.c | 17 + .../all/test_v1_package/CMakeLists.txt | 10 + .../nanosvg/all/test_v1_package/conanfile.py | 18 + recipes/nanosvg/config.yml | 5 + recipes/nas/all/conandata.yml | 16 + recipes/nas/all/conanfile.py | 144 + .../0001-1.9.4-extern-variable-bugfix.patch | 13 + recipes/nas/all/test_package/CMakeLists.txt | 7 + recipes/nas/all/test_package/conanfile.py | 26 + recipes/nas/all/test_package/test_package.c | 16 + .../nas/all/test_v1_package/CMakeLists.txt | 8 + recipes/nas/all/test_v1_package/conanfile.py | 18 + recipes/nas/config.yml | 5 + recipes/nasm/all/conandata.yml | 16 + recipes/nasm/all/conanfile.py | 103 + ...newly-integrated-dependency-tracking.patch | 34 + recipes/nasm/all/test_package/conanfile.py | 25 + recipes/nasm/all/test_package/hello_linux.asm | 16 + recipes/nasm/all/test_v1_package/conanfile.py | 22 + .../nasm/all/test_v1_package/hello_linux.asm | 16 + recipes/nasm/config.yml | 9 + recipes/nativefiledialog/all/conandata.yml | 4 + recipes/nativefiledialog/all/conanfile.py | 76 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 10 + recipes/nativefiledialog/config.yml | 3 + .../ncbi-cxx-toolkit-public/26/conandata.yml | 4 + .../ncbi-cxx-toolkit-public/26/conanfile.py | 1439 +++++++ .../26/test_package/CMakeLists.txt | 18 + .../26/test_package/basic_sample.cpp | 100 + .../26/test_package/conanfile.py | 18 + recipes/ncbi-cxx-toolkit-public/config.yml | 3 + recipes/ncurses/all/conandata.yml | 54 + recipes/ncurses/all/conanfile.py | 327 ++ .../all/maintainer/reduce-configure-patch.py | 49 + ...-pcre2posix-instead-of-pcre2-posix.h.patch | 59 + ...0-0002-Optionally-include-sys-time.h.patch | 51 + .../6.2.0-0003-Do-not-redeclare-exit.patch | 28 + .../all/patches/6.2.0-0004-fix-win32con.patch | 91 + ...must-be-placed-next-to-variable-name.patch | 45 + ...dd-potentially-missing-STDOUT_FILENO.patch | 31 + ...-export-declaration-on-class-members.patch | 53 + ...nclude-file-to-add-export-annotation.patch | 100 + ...X-compile-definition-while-building-.patch | 242 ++ ...blibrary-do-its-own-import-exporting.patch | 3326 ++++++++++++++++ ....2.0-0012-Learn-configure-about-msvc.patch | 423 ++ .../patches/6.2.0-0013-Fix-lib_gen.c.patch | 45 + ...nsion-in-args-by-defining-NCURSES_NO.patch | 53 + ...15-MSVC-access-does-not-support-X_OK.patch | 34 + .../6.2.0-0016-msvc-has-wchar-support.patch | 34 + .../patches/6.2.0-0017-msvc-fix-tests.patch | 50 + ...2.0-0018-missing-functions-c-linkage.patch | 25 + .../patches/6.2.0-0019-Run-autoreconf.patch | 565 +++ .../ncurses/all/test_package/CMakeLists.txt | 21 + recipes/ncurses/all/test_package/conanfile.py | 17 + .../ncurses/all/test_package/test_package.c | 17 + recipes/ncurses/config.yml | 7 + recipes/neargye-semver/all/conandata.yml | 4 + recipes/neargye-semver/all/conanfile.py | 63 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 22 + recipes/neargye-semver/config.yml | 3 + recipes/net-snmp/all/conandata.yml | 14 + recipes/net-snmp/all/conanfile.py | 196 + .../0001-fix-openssl-linking-msvc.patch | 63 + .../0002-install-only-libnetsnmp.patch | 35 + .../patches/0003-fix-perl-scripts-msvc.patch | 101 + .../patches/0004-fix-apple-arm64-build.patch | 17 + .../net-snmp/all/test_package/CMakeLists.txt | 10 + .../net-snmp/all/test_package/conanfile.py | 26 + .../net-snmp/all/test_package/test_package.c | 13 + recipes/net-snmp/config.yml | 3 + recipes/netcdf/all/conandata.yml | 16 + recipes/netcdf/all/conanfile.py | 148 + .../all/patches/4.7.4-0001-fix-cmake.patch | 114 + .../all/patches/4.8.1-0001-fix-cmake.patch | 107 + .../netcdf/all/test_package/CMakeLists.txt | 8 + recipes/netcdf/all/test_package/conanfile.py | 28 + .../netcdf/all/test_package/test_package.c | 7 + .../netcdf/all/test_v1_package/CMakeLists.txt | 10 + .../netcdf/all/test_v1_package/conanfile.py | 17 + recipes/netcdf/config.yml | 5 + recipes/nettle/all/conandata.yml | 10 + recipes/nettle/all/conanfile.py | 142 + .../nettle/all/test_package/CMakeLists.txt | 7 + recipes/nettle/all/test_package/conanfile.py | 26 + .../nettle/all/test_package/test_package.c | 30 + .../nettle/all/test_v1_package/CMakeLists.txt | 8 + .../nettle/all/test_v1_package/conanfile.py | 17 + recipes/nettle/config.yml | 7 + .../all/conandata.yml | 4 + .../all/conanfile.py | 27 + .../all/test_package/CMakeLists.txt | 14 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 28 + recipes/nextsilicon-cpp-subprocess/config.yml | 3 + recipes/nfrechette-acl/all/conandata.yml | 22 + recipes/nfrechette-acl/all/conanfile.py | 44 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 10 + recipes/nfrechette-acl/config.yml | 15 + recipes/ninja/all/conandata.yml | 10 + recipes/ninja/all/conanfile.py | 51 + recipes/ninja/all/test_package/conanfile.py | 13 + .../ninja/all/test_v1_package/conanfile.py | 12 + recipes/ninja/config.yml | 7 + recipes/nlohmann_json/all/conandata.yml | 49 + recipes/nlohmann_json/all/conanfile.py | 53 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 30 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/nlohmann_json/config.yml | 33 + recipes/nlopt/all/conandata.yml | 13 + recipes/nlopt/all/conanfile.py | 119 + recipes/nlopt/all/test_package/CMakeLists.txt | 7 + recipes/nlopt/all/test_package/conanfile.py | 26 + recipes/nlopt/all/test_package/test_package.c | 142 + .../nlopt/all/test_v1_package/CMakeLists.txt | 8 + .../nlopt/all/test_v1_package/conanfile.py | 17 + recipes/nlopt/config.yml | 9 + recipes/nmos-cpp/all/conandata.yml | 34 + recipes/nmos-cpp/all/conanfile.py | 256 ++ .../all/patches/cmakedeps-targets.patch | 20 + .../nmos-cpp/all/test_package/CMakeLists.txt | 9 + .../nmos-cpp/all/test_package/conanfile.py | 54 + .../all/test_package/test_package.cpp | 40 + .../all/test_v1_package/CMakeLists.txt | 8 + .../nmos-cpp/all/test_v1_package/conanfile.py | 43 + recipes/nmos-cpp/config.yml | 11 + recipes/nmslib/all/CMakeLists.txt | 7 + recipes/nmslib/all/conandata.yml | 14 + recipes/nmslib/all/conanfile.py | 66 + .../0001-cmake-disable-app-build.patch | 10 + .../all/patches/0002-cmake-fix-install.patch | 11 + .../all/patches/0003-cmake-fix-flags.patch | 33 + .../patches/0004-missing-utils-header.patch | 12 + .../nmslib/all/test_package/CMakeLists.txt | 11 + recipes/nmslib/all/test_package/conanfile.py | 17 + .../nmslib/all/test_package/test_package.cpp | 28 + recipes/nmslib/config.yml | 3 + recipes/nng/all/conandata.yml | 25 + recipes/nng/all/conanfile.py | 114 + .../0001-fix-ios-tvos-watchos-1.3.0.patch | 11 + .../0001-fix-ios-tvos-watchos-1.3.1.patch | 11 + .../0001-fix-ios-tvos-watchos-1.5.1.patch | 11 + recipes/nng/all/test_package/CMakeLists.txt | 8 + recipes/nng/all/test_package/conanfile.py | 26 + recipes/nng/all/test_package/test_package.c | 9 + .../nng/all/test_v1_package/CMakeLists.txt | 8 + recipes/nng/all/test_v1_package/conanfile.py | 22 + recipes/nng/config.yml | 11 + recipes/nodejs/all/conandata.yml | 71 + recipes/nodejs/all/conanfile.py | 70 + recipes/nodejs/all/test_package/conanfile.py | 16 + .../nodejs/all/test_v1_package/conanfile.py | 16 + recipes/nodejs/config.yml | 9 + recipes/nodesoup/all/CMakeLists.txt | 9 + recipes/nodesoup/all/conandata.yml | 8 + recipes/nodesoup/all/conanfile.py | 81 + .../patches/0001-install-shared-windows.patch | 11 + .../nodesoup/all/test_package/CMakeLists.txt | 11 + .../nodesoup/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 33 + recipes/nodesoup/config.yml | 3 + recipes/norm/all/conandata.yml | 11 + recipes/norm/all/conanfile.py | 84 + .../norm/all/patches/0001-fix-pthread.patch | 18 + recipes/norm/all/patches/0002-fix-fpic.patch | 12 + .../norm/all/patches/0003-cpp20-compat.patch | 11 + recipes/norm/all/test_package/CMakeLists.txt | 8 + recipes/norm/all/test_package/conanfile.py | 26 + .../norm/all/test_package/test_package.cpp | 17 + .../norm/all/test_v1_package/CMakeLists.txt | 8 + recipes/norm/all/test_v1_package/conanfile.py | 17 + recipes/norm/config.yml | 3 + recipes/npcap/all/conandata.yml | 13 + recipes/npcap/all/conanfile.py | 53 + recipes/npcap/all/test_package/CMakeLists.txt | 9 + recipes/npcap/all/test_package/conanfile.py | 47 + recipes/npcap/all/test_package/test_package.c | 9 + .../npcap/all/test_v1_package/CMakeLists.txt | 13 + .../npcap/all/test_v1_package/conanfile.py | 41 + recipes/npcap/config.yml | 4 + recipes/nsimd/2.x/CMakeLists.txt | 7 + recipes/nsimd/2.x/conandata.yml | 7 + recipes/nsimd/2.x/conanfile.py | 89 + recipes/nsimd/2.x/test_package/CMakeLists.txt | 10 + recipes/nsimd/2.x/test_package/conanfile.py | 18 + .../nsimd/2.x/test_package/test_package.cpp | 102 + recipes/nsimd/config.yml | 5 + recipes/nspr/all/conandata.yml | 19 + recipes/nspr/all/conanfile.py | 207 + recipes/nspr/all/test_package/CMakeLists.txt | 10 + recipes/nspr/all/test_package/conanfile.py | 26 + recipes/nspr/all/test_package/test_package.c | 26 + recipes/nspr/config.yml | 13 + recipes/nss/all/conandata.yml | 31 + recipes/nss/all/conanfile.py | 224 ++ recipes/nss/all/test_package/CMakeLists.txt | 9 + recipes/nss/all/test_package/conanfile.py | 18 + recipes/nss/all/test_package/test_package.c | 21 + recipes/nss/config.yml | 21 + recipes/nsync/all/conandata.yml | 17 + recipes/nsync/all/conanfile.py | 93 + ...semaphore_mutex_c_from_nsync_cpp_lib.patch | 10 + recipes/nsync/all/test_package/CMakeLists.txt | 10 + recipes/nsync/all/test_package/conanfile.py | 28 + recipes/nsync/all/test_package/example_c.c | 9 + .../nsync/all/test_package/example_cpp.cpp | 9 + .../nsync/all/test_v1_package/CMakeLists.txt | 8 + .../nsync/all/test_v1_package/conanfile.py | 21 + recipes/nsync/config.yml | 7 + recipes/ntv2/all/conandata.yml | 4 + recipes/ntv2/all/conanfile.py | 140 + recipes/ntv2/all/test_package/CMakeLists.txt | 7 + recipes/ntv2/all/test_package/conanfile.py | 26 + .../ntv2/all/test_package/test_package.cpp | 10 + .../ntv2/all/test_v1_package/CMakeLists.txt | 8 + recipes/ntv2/all/test_v1_package/conanfile.py | 17 + recipes/ntv2/config.yml | 3 + recipes/nudb/all/conandata.yml | 4 + recipes/nudb/all/conanfile.py | 42 + recipes/nudb/all/test_package/CMakeLists.txt | 11 + recipes/nudb/all/test_package/conanfile.py | 17 + .../nudb/all/test_package/test_package.cpp | 7 + recipes/nudb/config.yml | 3 + recipes/nuklear/all/conandata.yml | 22 + recipes/nuklear/all/conanfile.py | 42 + .../nuklear/all/test_package/CMakeLists.txt | 7 + recipes/nuklear/all/test_package/conanfile.py | 25 + .../nuklear/all/test_package/test_package.c | 11 + .../all/test_v1_package/CMakeLists.txt | 10 + .../nuklear/all/test_v1_package/conanfile.py | 17 + recipes/nuklear/config.yml | 15 + recipes/numcpp/all/conandata.yml | 22 + recipes/numcpp/all/conanfile.py | 106 + .../numcpp/all/test_package/CMakeLists.txt | 12 + recipes/numcpp/all/test_package/conanfile.py | 26 + .../numcpp/all/test_package/test_package.cpp | 70 + .../numcpp/all/test_v1_package/CMakeLists.txt | 8 + .../numcpp/all/test_v1_package/conanfile.py | 17 + recipes/numcpp/config.yml | 15 + recipes/nuraft/all/conandata.yml | 16 + recipes/nuraft/all/conanfile.py | 80 + .../all/patches/0001-cmake_patches.patch | 147 + .../all/patches/1001-cmake_patches.patch | 151 + .../nuraft/all/test_package/CMakeLists.txt | 8 + recipes/nuraft/all/test_package/conanfile.py | 26 + .../nuraft/all/test_package/test_package.cpp | 61 + .../nuraft/all/test_v1_package/CMakeLists.txt | 8 + .../nuraft/all/test_v1_package/conanfile.py | 17 + recipes/nuraft/config.yml | 5 + recipes/nv-codec-headers/all/conandata.yml | 7 + recipes/nv-codec-headers/all/conanfile.py | 60 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 10 + recipes/nv-codec-headers/config.yml | 5 + recipes/nvcloth/1.1.6/CMakeLists.txt | 7 + recipes/nvcloth/1.1.6/conandata.yml | 12 + recipes/nvcloth/1.1.6/conanfile.py | 175 + .../0001-PsAllocator-include-typeinfo.patch | 17 + .../1.1.6/patches/0002-CallbackFix.patch | 21 + .../1.1.6/patches/0003-PsAllocator.patch | 13 + .../nvcloth/1.1.6/test_package/CMakeLists.txt | 10 + .../nvcloth/1.1.6/test_package/conanfile.py | 16 + .../1.1.6/test_package/test_package.cpp | 81 + recipes/nvcloth/config.yml | 3 + recipes/nvtx/all/conandata.yml | 4 + recipes/nvtx/all/conanfile.py | 43 + recipes/nvtx/all/test_package/CMakeLists.txt | 8 + recipes/nvtx/all/test_package/conanfile.py | 26 + recipes/nvtx/all/test_package/test_package.c | 10 + .../nvtx/all/test_v1_package/CMakeLists.txt | 8 + recipes/nvtx/all/test_v1_package/conanfile.py | 17 + recipes/nvtx/config.yml | 3 + recipes/oatpp-libressl/all/conandata.yml | 10 + recipes/oatpp-libressl/all/conanfile.py | 108 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/oatpp-libressl/config.yml | 7 + recipes/oatpp-openssl/all/conandata.yml | 10 + recipes/oatpp-openssl/all/conanfile.py | 108 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/oatpp-openssl/config.yml | 7 + recipes/oatpp-postgresql/all/conandata.yml | 18 + recipes/oatpp-postgresql/all/conanfile.py | 112 + .../patches/1.2.5/01-fix-windows-build.patch | 13 + .../all/patches/1.3.0/01-add-bigobj.patch | 15 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/oatpp-postgresql/config.yml | 7 + recipes/oatpp-sqlite/all/conandata.yml | 10 + recipes/oatpp-sqlite/all/conanfile.py | 106 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/oatpp-sqlite/config.yml | 7 + recipes/oatpp-swagger/all/conandata.yml | 10 + recipes/oatpp-swagger/all/conanfile.py | 113 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/oatpp-swagger/config.yml | 7 + recipes/oatpp-websocket/all/conandata.yml | 13 + recipes/oatpp-websocket/all/conanfile.py | 109 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/oatpp-websocket/config.yml | 9 + recipes/oatpp/all/conandata.yml | 16 + recipes/oatpp/all/conanfile.py | 102 + recipes/oatpp/all/test_package/CMakeLists.txt | 14 + .../all/test_package/DeserializerTest.hpp | 18 + .../test_package/DeserializerTest_1_0_0.cpp | 51 + .../test_package/DeserializerTest_1_1_0.cpp | 49 + .../test_package/DeserializerTest_1_3_0.cpp | 49 + recipes/oatpp/all/test_package/conanfile.py | 26 + .../oatpp/all/test_package/test_package.cpp | 31 + .../oatpp/all/test_v1_package/CMakeLists.txt | 8 + .../oatpp/all/test_v1_package/conanfile.py | 17 + recipes/oatpp/config.yml | 11 + recipes/objectbox-generator/all/conandata.yml | 14 + recipes/objectbox-generator/all/conanfile.py | 48 + .../all/test_package/conanfile.py | 11 + recipes/objectbox-generator/config.yml | 3 + recipes/objectbox/all/conandata.yml | 24 + recipes/objectbox/all/conanfile.py | 56 + .../all/patches/0001-fix-cmake.patch | 66 + .../objectbox/all/test_package/CMakeLists.txt | 7 + .../objectbox/all/test_package/conanfile.py | 25 + .../objectbox/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/objectbox/config.yml | 7 + recipes/oboe/all/conandata.yml | 9 + recipes/oboe/all/conanfile.py | 65 + .../all/patches/1.7.0-0001-fix-cmake.patch | 30 + recipes/oboe/all/test_package/CMakeLists.txt | 8 + recipes/oboe/all/test_package/conanfile.py | 26 + .../oboe/all/test_package/test_package.cpp | 11 + .../oboe/all/test_v1_package/CMakeLists.txt | 8 + recipes/oboe/all/test_v1_package/conanfile.py | 17 + recipes/oboe/config.yml | 3 + recipes/observer-ptr-lite/all/conandata.yml | 4 + recipes/observer-ptr-lite/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/observer-ptr-lite/config.yml | 3 + recipes/octo-encryption-cpp/all/conandata.yml | 4 + recipes/octo-encryption-cpp/all/conanfile.py | 86 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 28 + .../all/test_package/test_package.cpp | 17 + recipes/octo-encryption-cpp/config.yml | 3 + recipes/octo-keygen-cpp/all/conandata.yml | 4 + recipes/octo-keygen-cpp/all/conanfile.py | 93 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 123 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/octo-keygen-cpp/config.yml | 3 + recipes/octo-logger-cpp/all/conandata.yml | 7 + recipes/octo-logger-cpp/all/conanfile.py | 114 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 21 + recipes/octo-logger-cpp/config.yml | 5 + .../all/conandata.yml | 4 + .../all/conanfile.py | 82 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 28 + .../all/test_package/test_package.cpp | 10 + recipes/octo-wildcardmatching-cpp/config.yml | 3 + recipes/octomap/all/conandata.yml | 22 + recipes/octomap/all/conanfile.py | 147 + .../targets-outputname-collision-1.9.3.patch | 96 + .../targets-outputname-collision-1.9.5.patch | 96 + .../octomap/all/test_package/CMakeLists.txt | 11 + recipes/octomap/all/test_package/conanfile.py | 26 + .../octomap/all/test_package/test_package.cpp | 82 + .../all/test_v1_package/CMakeLists.txt | 8 + .../octomap/all/test_v1_package/conanfile.py | 17 + recipes/octomap/config.yml | 9 + recipes/odbc/all/conandata.yml | 24 + recipes/odbc/all/conanfile.py | 149 + .../0001-duplicated-get-connection.patch | 11 + .../patches/0002-missing-declarations.patch | 53 + recipes/odbc/all/test_package/CMakeLists.txt | 7 + recipes/odbc/all/test_package/conanfile.py | 27 + recipes/odbc/all/test_package/test_package.c | 17 + .../odbc/all/test_v1_package/CMakeLists.txt | 8 + recipes/odbc/all/test_v1_package/conanfile.py | 18 + recipes/odbc/config.yml | 7 + recipes/ode/all/conandata.yml | 18 + recipes/ode/all/conanfile.py | 126 + recipes/ode/all/patches/0001-fix-apple.patch | 28 + .../ode/all/patches/0002-dont-force-pic.patch | 10 + .../patches/0003-cmake-fix-ccd-target.patch | 11 + .../patches/0004-fix-include-ode-timer.patch | 11 + recipes/ode/all/test_package/CMakeLists.txt | 7 + recipes/ode/all/test_package/conanfile.py | 26 + recipes/ode/all/test_package/test_package.c | 40 + .../ode/all/test_v1_package/CMakeLists.txt | 8 + recipes/ode/all/test_v1_package/conanfile.py | 17 + recipes/ode/config.yml | 3 + recipes/ofeli/all/CMakeLists.txt | 7 + recipes/ofeli/all/conandata.yml | 4 + recipes/ofeli/all/conanfile.py | 73 + recipes/ofeli/all/test_package/CMakeLists.txt | 11 + recipes/ofeli/all/test_package/conanfile.py | 17 + .../ofeli/all/test_package/test_package.cpp | 76 + recipes/ofeli/config.yml | 3 + recipes/ogdf/all/conandata.yml | 4 + recipes/ogdf/all/conanfile.py | 100 + recipes/ogdf/all/test_package/CMakeLists.txt | 7 + recipes/ogdf/all/test_package/conanfile.py | 26 + recipes/ogdf/all/test_package/main.cpp | 18 + .../ogdf/all/test_v1_package/CMakeLists.txt | 9 + recipes/ogdf/all/test_v1_package/conanfile.py | 18 + recipes/ogdf/config.yml | 3 + recipes/ogg/all/conandata.yml | 10 + recipes/ogg/all/conanfile.py | 83 + .../001-fix-unsigned-typedefs-for-macos.patch | 19 + recipes/ogg/all/test_package/CMakeLists.txt | 7 + recipes/ogg/all/test_package/conanfile.py | 25 + recipes/ogg/all/test_package/test_package.c | 10 + .../ogg/all/test_v1_package/CMakeLists.txt | 10 + recipes/ogg/all/test_v1_package/conanfile.py | 17 + recipes/ogg/config.yml | 5 + recipes/ogre/1.x/CMakeLists.txt | 7 + recipes/ogre/1.x/conandata.yml | 8 + recipes/ogre/1.x/conanfile.py | 368 ++ .../0001-ogre-1.10.2-cmake-fixes.patch | 532 +++ recipes/ogre/1.x/test_package/CMakeLists.txt | 15 + recipes/ogre/1.x/test_package/conanfile.py | 19 + recipes/ogre/1.x/test_package/ogre_main.cpp | 17 + recipes/ogre/config.yml | 3 + recipes/ois/all/CMakeLists.txt | 11 + recipes/ois/all/conandata.yml | 8 + recipes/ois/all/conanfile.py | 89 + ...eaders_from_CMAKE_CURRENT_SOURCE_DIR.patch | 21 + recipes/ois/all/test_package/CMakeLists.txt | 8 + recipes/ois/all/test_package/conanfile.py | 17 + recipes/ois/all/test_package/test_package.cpp | 9 + recipes/ois/config.yml | 3 + recipes/onedpl/all/conandata.yml | 10 + recipes/onedpl/all/conanfile.py | 76 + .../onedpl/all/test_package/CMakeLists.txt | 9 + recipes/onedpl/all/test_package/conanfile.py | 31 + .../all/test_package/test_package.2020.cpp | 11 + .../all/test_package/test_package.2021.cpp | 12 + .../onedpl/all/test_v1_package/CMakeLists.txt | 12 + .../onedpl/all/test_v1_package/conanfile.py | 18 + recipes/onedpl/config.yml | 7 + recipes/onetbb/2020.x/conandata.yml | 16 + recipes/onetbb/2020.x/conanfile.py | 283 ++ .../onetbb/2020.x/test_package/CMakeLists.txt | 11 + .../onetbb/2020.x/test_package/conanfile.py | 17 + .../2020.x/test_package/test_package.cpp | 40 + recipes/onetbb/all/conandata.yml | 37 + recipes/onetbb/all/conanfile.py | 157 + .../onetbb/all/patches/android-ndk25.patch | 46 + ...x-overeager-stripping-of-compile-flag.diff | 13 + .../onetbb/all/test_package/CMakeLists.txt | 8 + recipes/onetbb/all/test_package/conanfile.py | 26 + .../onetbb/all/test_package/test_package.cpp | 39 + .../onetbb/all/test_v1_package/CMakeLists.txt | 8 + .../onetbb/all/test_v1_package/conanfile.py | 17 + recipes/onetbb/config.yml | 21 + recipes/oniguruma/all/conandata.yml | 7 + recipes/oniguruma/all/conanfile.py | 89 + .../oniguruma/all/test_package/CMakeLists.txt | 7 + .../oniguruma/all/test_package/conanfile.py | 26 + .../oniguruma/all/test_package/test_package.c | 58 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/oniguruma/config.yml | 5 + recipes/onnx/all/conandata.yml | 35 + recipes/onnx/all/conanfile.py | 204 + ...-fix-concurrent-proto3-remove-1.11.0.patch | 11 + ...-fix-concurrent-proto3-remove-1.12.0.patch | 11 + ...1-fix-concurrent-proto3-remove-1.8.1.patch | 11 + ...1-fix-concurrent-proto3-remove-1.9.0.patch | 11 + ...002-msvc-no-warnings-as-errors-1.8.1.patch | 26 + ...002-msvc-no-warnings-as-errors-1.9.0.patch | 26 + recipes/onnx/all/test_package/CMakeLists.txt | 8 + recipes/onnx/all/test_package/conanfile.py | 26 + .../onnx/all/test_package/test_package.cpp | 6 + .../onnx/all/test_v1_package/CMakeLists.txt | 8 + recipes/onnx/all/test_v1_package/conanfile.py | 17 + recipes/onnx/config.yml | 15 + recipes/onnxruntime/all/conandata.yml | 20 + recipes/onnxruntime/all/conanfile.py | 233 ++ .../1.14.1-0001-cmake-dependencies.patch | 247 ++ .../1.14.1-0002-cmake-dependencies.patch | 191 + .../patches/1.14.1-0003-amx-gas-version.patch | 42 + .../1.14.1-0004-abseil-no-string-view.patch | 22 + .../all/test_package/CMakeLists.txt | 9 + .../onnxruntime/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/onnxruntime/config.yml | 3 + recipes/open-dis-cpp/all/conandata.yml | 4 + recipes/open-dis-cpp/all/conanfile.py | 94 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/open-dis-cpp/config.yml | 3 + .../all/CMakeLists.txt | 8 + .../all/conandata.yml | 21 + .../all/conanfile.py | 97 + .../all/patches/3.1.2_single_lib.patch | 82 + .../all/patches/3.3.x_single_lib.patch | 81 + .../all/patches/3.4.0_single_lib.patch | 69 + .../all/test_package/CMakeLists.txt | 16 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 18 + recipes/open-simulation-interface/config.yml | 7 + recipes/open62541/all/CMakeLists.txt | 7 + recipes/open62541/all/conandata.yml | 99 + recipes/open62541/all/conanfile.py | 459 +++ .../0001-fix-cmake-find-deps-1_1_x.patch | 191 + .../0001-fix-cmake-find-deps-1_2_x.patch | 209 + .../0001-fix-cmake-find-deps-1_3_1.patch | 200 + .../0001-fix-cmake-find-deps-1_3_4.patch | 196 + ...2-disable-sanitizers-1_1_3-and-1_1_5.patch | 23 + .../0003-disable-sanitizers-1_1_6.patch | 23 + .../0003-disable-sanitizers-1_2_x.patch | 20 + .../0003-fix-use-usr-bin-env-python3.patch | 113 + recipes/open62541/all/patches/1_0_x.patch | 178 + recipes/open62541/all/submoduledata.yml | 51 + .../open62541/all/test_package/CMakeLists.txt | 33 + .../all/test_package/FooFlt.NodeSet2.xml | 282 ++ .../all/test_package/FooFlt.Types.bsd | 15 + .../all/test_package/FooFltModel.csv | 42 + .../open62541/all/test_package/conanfile.py | 36 + .../open62541/all/test_package/test_package.c | 75 + .../all/test_v1_package/CMakeLists.txt | 36 + .../all/test_v1_package/conanfile.py | 24 + recipes/open62541/config.yml | 21 + recipes/openal-soft/all/conandata.yml | 37 + recipes/openal-soft/all/conanfile.py | 163 + .../patches/1.19.1-0001-aligned-alloc.patch | 11 + .../1.19.1-0002-gcc-10-fnocommon.patch | 15 + .../patches/1.19.1-0003-fix-windows-sdk.patch | 38 + .../patches/1.20.1-0001-fix-windows-sdk.patch | 76 + ...++14-does-not-have-std-aligned_alloc.patch | 16 + .../patches/1.21.0-0002-fix-windows-sdk.patch | 74 + ...-fix-al-optional-in-if-compile-error.patch | 47 + .../all/test_package/CMakeLists.txt | 22 + .../openal-soft/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 134 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/openal-soft/config.yml | 11 + recipes/openal/all/conandata.yml | 37 + recipes/openal/all/conanfile.py | 167 + .../patches/1.19.1-0001-aligned-alloc.patch | 11 + .../1.19.1-0002-gcc-10-fnocommon.patch | 15 + .../patches/1.19.1-0003-fix-windows-sdk.patch | 38 + .../patches/1.20.1-0001-fix-windows-sdk.patch | 76 + ...++14-does-not-have-std-aligned_alloc.patch | 16 + .../patches/1.21.0-0002-fix-windows-sdk.patch | 74 + ...-fix-al-optional-in-if-compile-error.patch | 47 + .../openal/all/test_package/CMakeLists.txt | 7 + recipes/openal/all/test_package/conanfile.py | 26 + .../openal/all/test_package/test_package.c | 134 + .../openal/all/test_v1_package/CMakeLists.txt | 8 + .../openal/all/test_v1_package/conanfile.py | 17 + recipes/openal/config.yml | 11 + recipes/openapi-generator/all/conandata.yml | 10 + recipes/openapi-generator/all/conanfile.py | 80 + .../all/test_package/conanfile.py | 16 + .../all/test_v1_package/conanfile.py | 10 + recipes/openapi-generator/config.yml | 7 + recipes/openassetio/all/conandata.yml | 4 + recipes/openassetio/all/conanfile.py | 160 + .../all/test_package/CMakeLists.txt | 121 + .../openassetio/all/test_package/conanfile.py | 66 + .../all/test_package/test.core.cpp | 9 + recipes/openassetio/all/test_package/test.py | 15 + .../all/test_package/test.python.bridge.cpp | 25 + .../all/test_v1_package/CMakeLists.txt | 121 + .../all/test_v1_package/conanfile.py | 66 + .../all/test_v1_package/test.core.cpp | 29 + .../openassetio/all/test_v1_package/test.py | 15 + .../test_v1_package/test.python.bridge.cpp | 25 + recipes/openassetio/config.yml | 3 + recipes/openblas/all/CMakeLists.txt | 11 + recipes/openblas/all/conandata.yml | 19 + recipes/openblas/all/conanfile.py | 152 + .../openblas/all/test_package/CMakeLists.txt | 10 + .../openblas/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 15 + recipes/openblas/config.yml | 13 + recipes/opencascade/all/conandata.yml | 14 + recipes/opencascade/all/conanfile.py | 531 +++ .../0001-undefined-ref-ncollection-lerp.patch | 119 + .../all/test_package/CMakeLists.txt | 17 + .../opencascade/all/test_package/conanfile.py | 19 + .../all/test_package/test_package.cpp | 14 + recipes/opencascade/config.yml | 7 + recipes/opencl-headers/all/conandata.yml | 25 + recipes/opencl-headers/all/conanfile.py | 54 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/opencl-headers/config.yml | 17 + recipes/opencl-icd-loader/all/conandata.yml | 22 + recipes/opencl-icd-loader/all/conanfile.py | 96 + .../0001-xcode-missing-includes.patch | 22 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/opencl-icd-loader/config.yml | 11 + recipes/opencolorio/all/CMakeLists.txt | 7 + recipes/opencolorio/all/conandata.yml | 18 + recipes/opencolorio/all/conanfile.py | 167 + recipes/opencolorio/all/patches/1.1.1.patch | 283 ++ .../fix-cmake-source-dir-and-targets.patch | 86 + recipes/opencolorio/all/patches/pstring.patch | 117 + recipes/opencolorio/all/patches/strlen.patch | 12 + .../all/test_package/CMakeLists.txt | 11 + .../opencolorio/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 8 + recipes/opencolorio/config.yml | 5 + recipes/opencore-amr/all/conandata.yml | 7 + recipes/opencore-amr/all/conanfile.py | 118 + .../all/test_package/CMakeLists.txt | 13 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 15 + recipes/opencore-amr/config.yml | 5 + recipes/opencv/2.x/conandata.yml | 12 + recipes/opencv/2.x/conanfile.py | 633 +++ recipes/opencv/2.x/patches/0001-jasper.patch | 20 + .../2.x/patches/0002-find-openexr.patch | 18 + .../opencv/2.x/test_package/CMakeLists.txt | 7 + recipes/opencv/2.x/test_package/conanfile.py | 26 + .../opencv/2.x/test_package/test_package.cpp | 164 + .../opencv/2.x/test_v1_package/CMakeLists.txt | 8 + .../opencv/2.x/test_v1_package/conanfile.py | 17 + recipes/opencv/3.x/conandata.yml | 20 + recipes/opencv/3.x/conanfile.py | 456 +++ .../patches/3.4.12-0001-find-openexr.patch | 18 + .../patches/3.4.17-0001-find-openexr.patch | 18 + .../opencv/3.x/test_package/CMakeLists.txt | 12 + recipes/opencv/3.x/test_package/conanfile.py | 31 + .../opencv/3.x/test_package/test_package.cpp | 179 + .../opencv/3.x/test_v1_package/CMakeLists.txt | 8 + .../opencv/3.x/test_v1_package/conanfile.py | 18 + recipes/opencv/4.x/conandata.yml | 65 + recipes/opencv/4.x/conanfile.py | 789 ++++ .../4.x/patches/4.1.2-0001-find-openexr.patch | 18 + .../4.x/patches/4.1.2-0002-find-ade.patch | 11 + .../4.x/patches/4.1.2-0003-find-quirc.patch | 8 + .../4.x/patches/4.1.2-0004-jasper.patch | 20 + .../4.1.2-0007-android-install-layout.patch | 11 + .../4.x/patches/4.5.0-0002-find-ade.patch | 11 + .../4.5.2-0001-fix-zlib-static-android.patch | 17 + .../4.x/patches/4.5.3-0001-find-openexr.patch | 23 + .../4.x/patches/4.5.5-0001-find-openexr.patch | 32 + .../opencv/4.x/test_package/CMakeLists.txt | 32 + recipes/opencv/4.x/test_package/conanfile.py | 34 + .../opencv/4.x/test_package/test_package.cpp | 235 ++ .../opencv/4.x/test_v1_package/CMakeLists.txt | 8 + .../opencv/4.x/test_v1_package/conanfile.py | 21 + recipes/opencv/config.yml | 13 + recipes/openddl-parser/all/conandata.yml | 10 + recipes/openddl-parser/all/conanfile.py | 80 + .../all/patches/0001-fix-cmake.patch | 42 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/openddl-parser/config.yml | 5 + recipes/opene57/all/CMakeLists.txt | 7 + recipes/opene57/all/conandata.yml | 7 + recipes/opene57/all/conanfile.py | 123 + .../opene57/all/test_package/CMakeLists.txt | 11 + recipes/opene57/all/test_package/conanfile.py | 16 + recipes/opene57/all/test_package/example.cpp | 19 + recipes/opene57/config.yml | 5 + recipes/openexr/2.x/conandata.yml | 19 + recipes/openexr/2.x/conanfile.py | 253 ++ .../openexr/2.x/test_package/CMakeLists.txt | 8 + .../test_package/comp_short_decode_piz.exr | Bin 0 -> 3147 bytes recipes/openexr/2.x/test_package/conanfile.py | 26 + .../openexr/2.x/test_package/test_package.cpp | 18 + .../2.x/test_v1_package/CMakeLists.txt | 11 + .../openexr/2.x/test_v1_package/conanfile.py | 18 + recipes/openexr/3.x/conandata.yml | 17 + recipes/openexr/3.x/conanfile.py | 150 + .../patches/v3.1.4-gcc5-bug-workaround.patch | 14 + .../openexr/3.x/test_package/CMakeLists.txt | 8 + .../test_package/comp_short_decode_piz.exr | Bin 0 -> 3147 bytes recipes/openexr/3.x/test_package/conanfile.py | 26 + .../openexr/3.x/test_package/test_package.cpp | 18 + .../3.x/test_v1_package/CMakeLists.txt | 11 + .../openexr/3.x/test_v1_package/conanfile.py | 18 + recipes/openexr/config.yml | 19 + recipes/openfbx/all/CMakeLists.txt | 16 + recipes/openfbx/all/conandata.yml | 4 + recipes/openfbx/all/conanfile.py | 77 + .../openfbx/all/test_package/CMakeLists.txt | 8 + recipes/openfbx/all/test_package/conanfile.py | 27 + recipes/openfbx/all/test_package/d.fbx | Bin 0 -> 27660 bytes .../openfbx/all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../openfbx/all/test_v1_package/conanfile.py | 18 + recipes/openfbx/config.yml | 3 + recipes/openfst/all/conandata.yml | 8 + recipes/openfst/all/conanfile.py | 203 + .../all/patches/1.8.2-allocate-hint.patch | 34 + .../openfst/all/test_package/CMakeLists.txt | 12 + recipes/openfst/all/test_package/conanfile.py | 17 + .../openfst/all/test_package/test_package.cpp | 8 + recipes/openfst/config.yml | 3 + recipes/openfx/all/CMakeLists.txt | 74 + recipes/openfx/all/cmake/OpenFX.cmake | 22 + recipes/openfx/all/conandata.yml | 4 + recipes/openfx/all/conanfile.py | 88 + recipes/openfx/all/symbols/linux.symbols | 7 + recipes/openfx/all/symbols/osx.symbols | 2 + recipes/openfx/all/symbols/windows.symbols | 3 + .../openfx/all/test_package/CMakeLists.txt | 21 + recipes/openfx/all/test_package/conanfile.py | 17 + recipes/openfx/all/test_package/invert.cpp | 299 ++ recipes/openfx/config.yml | 3 + recipes/opengl-registry/all/conandata.yml | 4 + recipes/opengl-registry/all/conanfile.py | 48 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/opengl-registry/config.yml | 3 + recipes/opengl/all/conanfile.py | 61 + .../test_cmake_module_package/CMakeLists.txt | 31 + .../test_cmake_module_package/conanfile.py | 26 + .../opengl/all/test_package/CMakeLists.txt | 31 + recipes/opengl/all/test_package/conanfile.py | 26 + recipes/opengl/all/test_package/osx.mm | 31 + .../opengl/all/test_package/test_package.cpp | 47 + recipes/opengl/all/test_package/win.cpp | 58 + .../CMakeLists.txt | 8 + .../test_v1_cmake_module_package/conanfile.py | 17 + .../opengl/all/test_v1_package/CMakeLists.txt | 8 + .../opengl/all/test_v1_package/conanfile.py | 17 + recipes/opengl/config.yml | 3 + recipes/opengrm/all/conandata.yml | 4 + recipes/opengrm/all/conanfile.py | 118 + .../opengrm/all/test_package/CMakeLists.txt | 8 + recipes/opengrm/all/test_package/conanfile.py | 26 + .../opengrm/all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../opengrm/all/test_v1_package/conanfile.py | 17 + recipes/opengrm/config.yml | 3 + recipes/opengv/all/conandata.yml | 15 + recipes/opengv/all/conanfile.py | 116 + .../patches/0001-use-conans-pybind11.patch | 9 + .../all/patches/0002-use-conans-eigen.patch | 13 + ...-conan-handle-shared-fpic-and-marchs.patch | 24 + .../opengv/all/test_package/CMakeLists.txt | 8 + recipes/opengv/all/test_package/conanfile.py | 26 + .../opengv/all/test_package/test_package.cpp | 30 + .../opengv/all/test_v1_package/CMakeLists.txt | 8 + .../opengv/all/test_v1_package/conanfile.py | 17 + recipes/opengv/config.yml | 3 + recipes/openh264/all/conandata.yml | 38 + recipes/openh264/all/conanfile.py | 190 + .../1.7.0-0001-platform-android.mk.patch | 28 + .../1.7.0-0002-macos-relocatable-shared.patch | 11 + ...04-mingw-override-CC-CXX-AR-from-env.patch | 9 + .../2.1.1-0001-platform-android.mk.patch | 18 + .../2.1.1-0002-macos-relocatable-shared.patch | 11 + .../2.3.1-0001-platform-android.mk.patch | 21 + .../2.3.1-0002-macos-relocatable-shared.patch | 11 + .../openh264/all/test_package/CMakeLists.txt | 7 + .../openh264/all/test_package/conanfile.py | 26 + .../openh264/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../openh264/all/test_v1_package/conanfile.py | 17 + recipes/openh264/config.yml | 7 + recipes/openimageio/all/CMakeLists.txt | 19 + recipes/openimageio/all/conandata.yml | 32 + recipes/openimageio/all/conanfile.py | 322 ++ .../all/patches/2.2.18.0-cmake-targets.patch | 711 ++++ .../all/patches/2.2.7.0-cmake-targets.patch | 673 ++++ .../all/patches/2.3.7.2-cmake-targets.patch | 710 ++++ .../all/patches/2.4.7.1-cmake-targets.patch | 403 ++ .../all/patches/2.4.7.1-fix-msvc2017.patch | 23 + .../all/test_package/CMakeLists.txt | 10 + .../openimageio/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 9 + recipes/openimageio/config.yml | 9 + recipes/openjdk/all/conandata.yml | 24 + recipes/openjdk/all/conanfile.py | 75 + recipes/openjdk/all/test_package/conanfile.py | 29 + .../openjdk/all/test_v1_package/conanfile.py | 23 + recipes/openjdk/config.yml | 5 + recipes/openjpeg/all/conandata.yml | 15 + recipes/openjpeg/all/conanfile.py | 130 + .../0001-relocatable-shared-macos-2.3.1.patch | 11 + .../0001-relocatable-shared-macos-2.4.0.patch | 11 + .../openjpeg/all/test_package/CMakeLists.txt | 7 + .../openjpeg/all/test_package/conanfile.py | 26 + .../openjpeg/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../openjpeg/all/test_v1_package/conanfile.py | 17 + recipes/openjpeg/config.yml | 7 + recipes/openldap/all/conandata.yml | 8 + recipes/openldap/all/conanfile.py | 110 + .../all/patches/configure-2.6.1.patch | 12 + .../openldap/all/test_package/CMakeLists.txt | 8 + .../openldap/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 83 + recipes/openldap/config.yml | 3 + recipes/openmesh/all/conandata.yml | 12 + recipes/openmesh/all/conanfile.py | 128 + .../all/patches/cmake-install_8.1.patch | 11 + .../all/patches/cmake-install_9.0.patch | 13 + .../openmesh/all/test_package/CMakeLists.txt | 8 + .../openmesh/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 85 + .../all/test_v1_package/CMakeLists.txt | 8 + .../openmesh/all/test_v1_package/conanfile.py | 17 + recipes/openmesh/config.yml | 5 + recipes/openmpi/all/conandata.yml | 4 + recipes/openmpi/all/conanfile.py | 97 + .../openmpi/all/test_package/CMakeLists.txt | 10 + recipes/openmpi/all/test_package/conanfile.py | 18 + .../openmpi/all/test_package/test_package.cpp | 23 + recipes/openmpi/config.yml | 3 + recipes/openmvg/all/conandata.yml | 22 + recipes/openmvg/all/conanfile.py | 273 ++ .../2.0-0001-robust-dependencies.patch | 198 + .../patches/2.0-0002-dont-force-c++11.patch | 18 + .../all/patches/2.0-0003-fix-non-x86.patch | 12 + .../2.0-0004-no-auto-simd-optimization.patch | 29 + .../all/patches/2.0-0005-msvc-bigobj.patch | 25 + .../openmvg/all/test_package/CMakeLists.txt | 13 + recipes/openmvg/all/test_package/conanfile.py | 26 + .../openmvg/all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../openmvg/all/test_v1_package/conanfile.py | 17 + recipes/openmvg/config.yml | 3 + recipes/openscenegraph/all/CMakeLists.txt | 23 + recipes/openscenegraph/all/conandata.yml | 18 + recipes/openscenegraph/all/conanfile.py | 541 +++ .../0001-fix-to_cmake_path-usage.patch | 31 + ...0002-Use-standard-CMake-name-for-gif.patch | 54 + ...rect-usage-of-_LIBRARY-to-_LIBRARIES.patch | 155 + ...04-Allow-explicit-control-of-plugins.patch | 259 ++ .../0005-use-JPEG-target-for-plugin.patch | 25 + ...clare-result-as-LONG-for-Mingw-build.patch | 29 + .../all/test_package/CMakeLists.txt | 21 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 109 + recipes/openscenegraph/config.yml | 3 + recipes/openssl/1.x.x/conandata.yml | 45 + recipes/openssl/1.x.x/conanfile.py | 917 +++++ .../1.x.x/patches/1.0.2u-darwin-arm64.patch | 12 + .../1.x.x/patches/1.1.1-tvos-watchos.patch | 32 + .../openssl/1.x.x/test_package/CMakeLists.txt | 31 + .../openssl/1.x.x/test_package/conanfile.py | 31 + recipes/openssl/1.x.x/test_package/digest.c | 106 + .../1.x.x/test_v1_package/CMakeLists.txt | 8 + .../1.x.x/test_v1_package/conanfile.py | 25 + recipes/openssl/3.x.x/conandata.yml | 18 + recipes/openssl/3.x.x/conanfile.py | 675 ++++ .../openssl/3.x.x/test_package/CMakeLists.txt | 44 + .../openssl/3.x.x/test_package/conanfile.py | 38 + recipes/openssl/3.x.x/test_package/digest.c | 65 + .../3.x.x/test_package/digest_legacy.c | 141 + .../openssl/3.x.x/test_package/test_package.c | 24 + .../3.x.x/test_v1_package/CMakeLists.txt | 44 + .../3.x.x/test_v1_package/conanfile.py | 40 + .../openssl/3.x.x/test_v1_package/digest.c | 73 + .../3.x.x/test_v1_package/digest_legacy.c | 148 + recipes/openssl/config.yml | 24 + recipes/opensubdiv/all/conandata.yml | 19 + recipes/opensubdiv/all/conanfile.py | 180 + .../3.4.4-0001-cmake-minimum-required.patch | 13 + .../patches/3.4.4-0002-cmake-no-rpath.patch | 15 + .../all/test_package/CMakeLists.txt | 11 + .../opensubdiv/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 41 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/opensubdiv/config.yml | 5 + recipes/opentdf-client/all/CMakeLists.txt | 9 + recipes/opentdf-client/all/conandata.yml | 37 + recipes/opentdf-client/all/conanfile.py | 123 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 26 + recipes/opentdf-client/config.yml | 25 + recipes/opentelemetry-cpp/all/conandata.yml | 59 + recipes/opentelemetry-cpp/all/conanfile.py | 477 +++ .../all/patches/1.0.1-0001-fix-cmake.patch | 28 + .../all/patches/1.2.0-0001-fix-cmake.patch | 15 + .../all/patches/1.3.0-0001-fix-cmake.patch | 27 + .../all/patches/1.4.0-0001-fix-cmake.patch | 27 + .../all/patches/1.6.1-0001-fix-cmake.patch | 27 + .../all/patches/1.7.0-0001-fix-cmake.patch | 27 + .../all/patches/1.8.1-0001-fix-cmake.patch | 27 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 22 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 18 + recipes/opentelemetry-cpp/config.yml | 17 + recipes/opentelemetry-proto/all/conandata.yml | 16 + recipes/opentelemetry-proto/all/conanfile.py | 36 + .../all/test_package/conanfile.py | 9 + recipes/opentelemetry-proto/config.yml | 11 + recipes/opentracing-cpp/all/CMakeLists.txt | 7 + recipes/opentracing-cpp/all/conandata.yml | 8 + recipes/opentracing-cpp/all/conanfile.py | 119 + ...001-Set-default-installation-folders.patch | 54 + .../all/test_package/CMakeLists.txt | 17 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 12 + recipes/opentracing-cpp/config.yml | 3 + recipes/openvdb/all/CMakeLists.txt | 7 + recipes/openvdb/all/conandata.yml | 8 + recipes/openvdb/all/conanfile.py | 247 ++ .../patches/0001-Find-packages-fixes.patch | 14 + .../openvdb/all/test_package/CMakeLists.txt | 11 + recipes/openvdb/all/test_package/conanfile.py | 17 + .../openvdb/all/test_package/test_package.cpp | 12 + recipes/openvdb/config.yml | 3 + recipes/openvr/all/CMakeLists.txt | 9 + recipes/openvr/all/conandata.yml | 14 + recipes/openvr/all/conanfile.py | 102 + .../fix-includes-and-assert-1.16.8.patch | 122 + .../openvr/all/test_package/CMakeLists.txt | 9 + recipes/openvr/all/test_package/conanfile.py | 16 + .../openvr/all/test_package/test_package.cpp | 11 + recipes/openvr/config.yml | 7 + recipes/openxlsx/all/conandata.yml | 4 + recipes/openxlsx/all/conanfile.py | 102 + .../openxlsx/all/test_package/CMakeLists.txt | 9 + .../openxlsx/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../openxlsx/all/test_v1_package/conanfile.py | 18 + recipes/openxlsx/config.yml | 3 + recipes/optional-lite/all/conandata.yml | 13 + recipes/optional-lite/all/conanfile.py | 51 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/optional-lite/config.yml | 9 + recipes/opus/all/conandata.yml | 7 + recipes/opus/all/conanfile.py | 89 + .../1.3.1-add-opus_buildtype-cmake.patch | 30 + recipes/opus/all/test_package/CMakeLists.txt | 7 + recipes/opus/all/test_package/conanfile.py | 27 + recipes/opus/all/test_package/test.pcm | Bin 0 -> 196608 bytes recipes/opus/all/test_package/test_package.c | 159 + .../opus/all/test_v1_package/CMakeLists.txt | 8 + recipes/opus/all/test_v1_package/conanfile.py | 18 + recipes/opus/config.yml | 3 + recipes/opusfile/all/conandata.yml | 18 + recipes/opusfile/all/conanfile.py | 175 + .../001-disable-cert-store-integration.patch | 33 + .../opusfile/all/test_package/CMakeLists.txt | 7 + .../opusfile/all/test_package/conanfile.py | 26 + .../opusfile/all/test_package/test_package.c | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../opusfile/all/test_v1_package/conanfile.py | 17 + recipes/opusfile/config.yml | 5 + recipes/orcania/all/conandata.yml | 15 + recipes/orcania/all/conanfile.py | 144 + ...mingw-fix-Werror=stringop-truncation.patch | 25 + .../orcania/all/patches/2.3.1-0002-no-m.patch | 9 + .../2.3.1-0003-shared-static-conan.patch | 156 + .../orcania/all/test_package/CMakeLists.txt | 13 + recipes/orcania/all/test_package/conanfile.py | 31 + .../orcania/all/test_package/test_package.c | 11 + .../all/test_v1_package/CMakeLists.txt | 16 + .../orcania/all/test_v1_package/conanfile.py | 18 + recipes/orcania/config.yml | 3 + recipes/osgearth/all/CMakeLists.txt | 85 + recipes/osgearth/all/conandata.yml | 14 + recipes/osgearth/all/conanfile.py | 302 ++ .../osgearth/all/patches/3.2-osgearth.patch | 197 + .../osgearth/all/patches/3.3-osgearth.patch | 165 + .../osgearth/all/test_package/CMakeLists.txt | 10 + .../osgearth/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 6 + recipes/osgearth/config.yml | 5 + recipes/osmanip/all/CMakeLists.txt | 54 + recipes/osmanip/all/conandata.yml | 25 + recipes/osmanip/all/conanfile.py | 101 + .../0001-replace-runtime_error_func.patch | 102 + .../osmanip/all/test_package/CMakeLists.txt | 9 + recipes/osmanip/all/test_package/conanfile.py | 25 + .../osmanip/all/test_package/test_package.cpp | 113 + .../all/test_v1_package/CMakeLists.txt | 9 + .../osmanip/all/test_v1_package/conanfile.py | 18 + recipes/osmanip/config.yml | 13 + recipes/osqp/all/conandata.yml | 4 + recipes/osqp/all/conanfile.py | 95 + recipes/osqp/all/test_package/CMakeLists.txt | 8 + recipes/osqp/all/test_package/conanfile.py | 27 + .../osqp/all/test_package/test_package.cpp | 69 + .../osqp/all/test_v1_package/CMakeLists.txt | 8 + recipes/osqp/all/test_v1_package/conanfile.py | 19 + recipes/osqp/config.yml | 3 + recipes/out_ptr/all/conandata.yml | 4 + recipes/out_ptr/all/conanfile.py | 39 + .../out_ptr/all/test_package/CMakeLists.txt | 8 + recipes/out_ptr/all/test_package/conanfile.py | 26 + .../out_ptr/all/test_package/test_package.cpp | 38 + .../all/test_v1_package/CMakeLists.txt | 8 + .../out_ptr/all/test_v1_package/conanfile.py | 17 + recipes/out_ptr/config.yml | 3 + recipes/outcome/all/conandata.yml | 22 + recipes/outcome/all/conanfile.py | 66 + .../outcome/all/test_package/CMakeLists.txt | 8 + recipes/outcome/all/test_package/conanfile.py | 26 + .../outcome/all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../outcome/all/test_v1_package/conanfile.py | 17 + recipes/outcome/config.yml | 15 + recipes/ozz-animation/all/CMakeLists.txt | 7 + recipes/ozz-animation/all/conandata.yml | 7 + recipes/ozz-animation/all/conanfile.py | 66 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 12 + recipes/ozz-animation/config.yml | 5 + recipes/p-ranav-glob/all/conandata.yml | 4 + recipes/p-ranav-glob/all/conanfile.py | 50 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 8 + recipes/p-ranav-glob/config.yml | 3 + recipes/p7zip/all/conandata.yml | 24 + recipes/p7zip/all/conanfile.py | 86 + .../p7zip/all/patches/06-CVE-2018-5996.patch | 221 ++ .../p7zip/all/patches/12-CVE-2016-9296.patch | 23 + .../p7zip/all/patches/13-CVE-2017-17969.patch | 35 + .../all/patches/14-Fix-g++-warning.patch | 24 + .../p7zip/all/patches/CVE-2018-10115.patch | 311 ++ recipes/p7zip/all/patches/clang.diff | 49 + recipes/p7zip/all/test_package/conanfile.py | 15 + .../p7zip/all/test_v1_package/conanfile.py | 9 + recipes/p7zip/config.yml | 3 + recipes/packio/all/conandata.yml | 46 + recipes/packio/all/conanfile.py | 107 + .../packio/all/test_package/1.0.x-1.1.x.cpp | 16 + recipes/packio/all/test_package/1.2.x.cpp | 19 + .../packio/all/test_package/CMakeLists.txt | 16 + recipes/packio/all/test_package/conanfile.py | 18 + recipes/packio/all/test_package/latest.cpp | 20 + recipes/packio/config.yml | 31 + recipes/pagmo2/all/CMakeLists.txt | 7 + recipes/pagmo2/all/conandata.yml | 4 + recipes/pagmo2/all/conanfile.py | 153 + .../pagmo2/all/test_package/CMakeLists.txt | 11 + recipes/pagmo2/all/test_package/conanfile.py | 17 + .../pagmo2/all/test_package/test_package.cpp | 42 + recipes/pagmo2/config.yml | 5 + recipes/pagmo2/pre_2.11/CMakeLists.txt | 7 + recipes/pagmo2/pre_2.11/conandata.yml | 8 + recipes/pagmo2/pre_2.11/conanfile.py | 111 + .../0001-fix-cmake-module-path-2-10.patch | 13 + .../pre_2.11/test_package/CMakeLists.txt | 11 + .../pagmo2/pre_2.11/test_package/conanfile.py | 17 + .../pre_2.11/test_package/test_package.cpp | 42 + recipes/paho-mqtt-c/all/conandata.yml | 46 + recipes/paho-mqtt-c/all/conanfile.py | 163 + ...2-fix-MinGW-and-OSX-builds-for-1-3-4.patch | 98 + .../0003-allow-static-windows-runtimes.patch | 15 + .../all/test_package/CMakeLists.txt | 36 + .../paho-mqtt-c/all/test_package/conanfile.py | 31 + .../all/test_package/test_package_async.c | 122 + .../all/test_package/test_package_client.c | 50 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/paho-mqtt-c/config.yml | 17 + recipes/paho-mqtt-cpp/all/conandata.yml | 24 + recipes/paho-mqtt-cpp/all/conanfile.py | 125 + .../all/patches/1.0.1-0001-fix-cmake.patch | 13 + .../all/patches/1.1-0001-fix-cmake.patch | 26 + ...1.1-0002-deadlock_and_remlog-for-1-1.patch | 360 ++ .../all/patches/1.2.0-0001-fix-cmake.patch | 26 + .../all/test_package/CMakeLists.txt | 18 + .../all/test_package/conanfile.py | 33 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 21 + recipes/paho-mqtt-cpp/config.yml | 7 + recipes/pango/all/conandata.yml | 16 + recipes/pango/all/conanfile.py | 207 + recipes/pango/all/test_package/CMakeLists.txt | 10 + recipes/pango/all/test_package/conanfile.py | 17 + .../pango/all/test_package/test_package.cpp | 8 + recipes/pango/config.yml | 11 + recipes/pangomm/all/conandata.yml | 18 + recipes/pangomm/all/conanfile.py | 189 + .../patches/enable_static_libs_2_46_2.patch | 29 + .../patches/enable_static_libs_2_50_0.patch | 29 + .../patches/fix_exporting_pango_init.patch | 24 + .../pangomm/all/test_package/CMakeLists.txt | 18 + recipes/pangomm/all/test_package/conanfile.py | 17 + .../pangomm/all/test_package/test_package.cpp | 8 + recipes/pangomm/config.yml | 5 + .../panzi-portable-endian/all/conandata.yml | 4 + .../panzi-portable-endian/all/conanfile.py | 34 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 8 + recipes/panzi-portable-endian/config.yml | 3 + recipes/parallel-hashmap/all/conandata.yml | 31 + recipes/parallel-hashmap/all/conanfile.py | 76 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/parallel-hashmap/config.yml | 21 + recipes/parg/all/CMakeLists.txt | 12 + recipes/parg/all/conandata.yml | 4 + recipes/parg/all/conanfile.py | 60 + recipes/parg/all/test_package/CMakeLists.txt | 10 + recipes/parg/all/test_package/conanfile.py | 17 + recipes/parg/all/test_package/test_package.c | 50 + recipes/parg/config.yml | 3 + recipes/parson/all/conandata.yml | 4 + recipes/parson/all/conanfile.py | 63 + .../parson/all/test_package/CMakeLists.txt | 7 + recipes/parson/all/test_package/conanfile.py | 26 + .../parson/all/test_package/test_package.c | 19 + .../parson/all/test_v1_package/CMakeLists.txt | 8 + .../parson/all/test_v1_package/conanfile.py | 17 + recipes/parson/config.yml | 3 + recipes/patchelf/all/conandata.yml | 7 + recipes/patchelf/all/conanfile.py | 74 + .../patchelf/all/test_package/conanfile.py | 15 + .../patchelf/all/test_v1_package/conanfile.py | 9 + recipes/patchelf/config.yml | 5 + recipes/pbc/all/conandata.yml | 8 + recipes/pbc/all/conanfile.py | 98 + .../0.5.14-0001-fix-config-sub-ios.patch | 3128 +++++++++++++++ recipes/pbc/all/test_package/CMakeLists.txt | 10 + recipes/pbc/all/test_package/conanfile.py | 17 + recipes/pbc/all/test_package/test_package.c | 36 + recipes/pbc/config.yml | 3 + recipes/pbtools/all/CMakeLists.txt | 7 + recipes/pbtools/all/conandata.yml | 7 + recipes/pbtools/all/conanfile.py | 54 + .../pbtools/all/test_package/CMakeLists.txt | 10 + recipes/pbtools/all/test_package/conanfile.py | 25 + .../pbtools/all/test_package/hello_world.c | 134 + .../pbtools/all/test_package/hello_world.h | 99 + .../pbtools/all/test_package/test_package.c | 45 + recipes/pbtools/config.yml | 5 + recipes/pcapplusplus/all/conandata.yml | 48 + recipes/pcapplusplus/all/conanfile.py | 145 + ...PFLAGS-when-compiling-3rd-party-sour.patch | 22 + ...PFLAGS-when-compiling-3rd-party-sour.patch | 11 + .../all/patches/0003-Use-pthreads4w.patch | 18 + .../all/patches/0004-Fix-md5-include.patch | 11 + .../all/patches/0005-Fix-md5-include.patch | 11 + .../all/patches/0006-Fix-md5-include.patch | 11 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/pcapplusplus/config.yml | 9 + recipes/pcg-cpp/all/conandata.yml | 7 + recipes/pcg-cpp/all/conanfile.py | 43 + .../pcg-cpp/all/test_package/CMakeLists.txt | 8 + recipes/pcg-cpp/all/test_package/conanfile.py | 25 + .../pcg-cpp/all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 11 + .../pcg-cpp/all/test_v1_package/conanfile.py | 17 + recipes/pcg-cpp/config.yml | 5 + recipes/pciutils/all/conandata.yml | 4 + recipes/pciutils/all/conanfile.py | 76 + .../pciutils/all/test_package/CMakeLists.txt | 8 + .../pciutils/all/test_package/conanfile.py | 16 + recipes/pciutils/all/test_package/example.c | 30 + recipes/pciutils/config.yml | 3 + recipes/pcre/all/conandata.yml | 17 + recipes/pcre/all/conanfile.py | 193 + .../all/patches/0001-fix-cmake-8.41.patch | 17 + .../all/patches/0001-fix-cmake-8.45.patch | 17 + recipes/pcre/all/test_package/CMakeLists.txt | 7 + recipes/pcre/all/test_package/conanfile.py | 27 + recipes/pcre/all/test_package/test_package.c | 406 ++ .../pcre/all/test_v1_package/CMakeLists.txt | 10 + recipes/pcre/all/test_v1_package/conanfile.py | 18 + recipes/pcre/config.yml | 7 + recipes/pcre2/all/conandata.yml | 71 + recipes/pcre2/all/conanfile.py | 204 + .../all/patches/0001-fix-cmake-1.32.patch | 17 + .../all/patches/0001-fix-cmake-1.33.patch | 14 + .../all/patches/0001-fix-cmake-1.35.patch | 14 + .../all/patches/0001-fix-cmake-1.36.patch | 14 + .../all/patches/0001-fix-cmake-1.39.patch | 15 + recipes/pcre2/all/test_package/CMakeLists.txt | 7 + recipes/pcre2/all/test_package/conanfile.py | 26 + recipes/pcre2/all/test_package/test_package.c | 34 + .../pcre2/all/test_v1_package/CMakeLists.txt | 8 + .../pcre2/all/test_v1_package/conanfile.py | 17 + recipes/pcre2/config.yml | 17 + recipes/pdal/all/CMakeLists.txt | 9 + recipes/pdal/all/conandata.yml | 28 + recipes/pdal/all/conanfile.py | 283 ++ .../pdal/all/patches/0001-cmakelists.patch | 44 + .../all/patches/0002-cmake-deps-2.2.0.patch | 44 + .../all/patches/0002-cmake-deps-2.3.0.patch | 40 + recipes/pdal/all/patches/0003-stdexcept.patch | 14 + recipes/pdal/all/patches/0004-cstdlib.patch | 14 + .../all/patches/0005-vendor-nanoflann.patch | 13 + recipes/pdal/all/patches/0006-pointview.patch | 26 + recipes/pdal/all/test_package/CMakeLists.txt | 12 + recipes/pdal/all/test_package/conanfile.py | 17 + .../pdal/all/test_package/test_package.cpp | 17 + recipes/pdal/config.yml | 5 + recipes/pdcurses/all/CMakeLists.txt | 7 + recipes/pdcurses/all/conandata.yml | 4 + recipes/pdcurses/all/conanfile.py | 149 + .../pdcurses/all/test_package/CMakeLists.txt | 8 + .../pdcurses/all/test_package/conanfile.py | 18 + .../pdcurses/all/test_package/test_package.c | 10 + recipes/pdcurses/config.yml | 3 + recipes/pdfgen/all/CMakeLists.txt | 20 + recipes/pdfgen/all/conandata.yml | 4 + recipes/pdfgen/all/conanfile.py | 58 + .../pdfgen/all/test_package/CMakeLists.txt | 8 + recipes/pdfgen/all/test_package/conanfile.py | 25 + .../pdfgen/all/test_package/test_package.c | 17 + .../pdfgen/all/test_v1_package/CMakeLists.txt | 8 + .../pdfgen/all/test_v1_package/conanfile.py | 18 + recipes/pdfgen/config.yml | 3 + recipes/pdfium/all/CMakeLists.txt | 7 + recipes/pdfium/all/conandata.yml | 15 + recipes/pdfium/all/conanfile.py | 107 + .../pdfium/all/test_package/CMakeLists.txt | 8 + recipes/pdfium/all/test_package/conanfile.py | 18 + .../pdfium/all/test_package/test_package.c | 7 + recipes/pdfium/config.yml | 3 + recipes/pdqsort/all/conandata.yml | 4 + recipes/pdqsort/all/conanfile.py | 40 + .../pdqsort/all/test_package/CMakeLists.txt | 7 + recipes/pdqsort/all/test_package/conanfile.py | 25 + .../pdqsort/all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 10 + .../pdqsort/all/test_v1_package/conanfile.py | 17 + recipes/pdqsort/config.yml | 3 + recipes/perf/all/conandata.yml | 8 + recipes/perf/all/conanfile.py | 51 + .../patches/0001-Wno-strict-prototypes.patch | 14 + recipes/perf/all/test_package/conanfile.py | 9 + recipes/perf/config.yml | 3 + recipes/perfetto/all/CMakeLists.txt | 41 + recipes/perfetto/all/conandata.yml | 60 + recipes/perfetto/all/conanfile.py | 110 + ...ging-when-PERFETTO_DISABLE_LOG-activ.patch | 14 + ...ging-when-PERFETTO_DISABLE_LOG-activ.patch | 14 + ...ging-when-PERFETTO_DISABLE_LOG-activ.patch | 14 + ...-MSVC-Fix-narrowing-conversion-error.patch | 13 + .../0001-tracing-fix-compile-on-MSVC.patch | 19 + .../perfetto/all/test_package/CMakeLists.txt | 12 + .../perfetto/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../perfetto/all/test_v1_package/conanfile.py | 17 + recipes/perfetto/config.yml | 29 + recipes/perlinnoise/all/conandata.yml | 4 + recipes/perlinnoise/all/conanfile.py | 79 + .../all/test_package/CMakeLists.txt | 8 + .../perlinnoise/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/perlinnoise/config.yml | 3 + recipes/pexports/all/conandata.yml | 12 + recipes/pexports/all/conanfile.py | 94 + .../pexports/all/patches/0001-add-help.patch | 32 + .../0002-fix-MSVC-stack-overflow.patch | 12 + .../all/patches/0003-fix-MSVC-x86.patch | 7 + .../pexports/all/test_package/CMakeLists.txt | 57 + .../pexports/all/test_package/conanfile.py | 26 + .../pexports/all/test_package/test_library.c | 4 + .../pexports/all/test_package/test_package.c | 11 + recipes/pexports/config.yml | 3 + recipes/pffft/all/CMakeLists.txt | 29 + recipes/pffft/all/conandata.yml | 7 + recipes/pffft/all/conanfile.py | 69 + recipes/pffft/all/test_package/CMakeLists.txt | 7 + recipes/pffft/all/test_package/conanfile.py | 26 + recipes/pffft/all/test_package/test_package.c | 9 + .../pffft/all/test_v1_package/CMakeLists.txt | 8 + .../pffft/all/test_v1_package/conanfile.py | 17 + recipes/pffft/config.yml | 5 + recipes/pfr/all/conandata.yml | 16 + recipes/pfr/all/conanfile.py | 70 + recipes/pfr/all/patches/50_add_license.patch | 39 + recipes/pfr/all/test_package/CMakeLists.txt | 16 + recipes/pfr/all/test_package/conanfile.py | 32 + .../pfr/all/test_package/test_package_1.cpp | 129 + .../pfr/all/test_package/test_package_2.cpp | 184 + .../pfr/all/test_v1_package/CMakeLists.txt | 8 + recipes/pfr/all/test_v1_package/conanfile.py | 20 + recipes/pfr/config.yml | 9 + recipes/pgm-index/all/conandata.yml | 4 + recipes/pgm-index/all/conanfile.py | 70 + .../pgm-index/all/test_package/CMakeLists.txt | 8 + .../pgm-index/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/pgm-index/config.yml | 3 + recipes/physfs/all/conandata.yml | 8 + recipes/physfs/all/conanfile.py | 146 + .../0001-fix-export-import-symbols.patch | 41 + .../all/patches/0002-cmake-doc-option.patch | 20 + .../physfs/all/test_package/CMakeLists.txt | 11 + recipes/physfs/all/test_package/conanfile.py | 26 + .../physfs/all/test_package/test_package.c | 10 + .../physfs/all/test_v1_package/CMakeLists.txt | 8 + .../physfs/all/test_v1_package/conanfile.py | 17 + recipes/physfs/config.yml | 3 + recipes/physx/4.x.x/conandata.yml | 21 + recipes/physx/4.x.x/conanfile.py | 359 ++ .../0001-PsAllocator-include-typeinfo.patch | 17 + ...2-GuGJKType-const-discard-qualifiers.patch | 13 + ...dowsInlineAoS-msvc142-bug-workaround.patch | 13 + .../0004-Conan-PhysXGpu-name-workaround.patch | 37 + ...ke-macos-ios-android-install-targets.patch | 54 + .../physx/4.x.x/test_package/CMakeLists.txt | 14 + recipes/physx/4.x.x/test_package/conanfile.py | 29 + .../physx/4.x.x/test_package/test_library.cpp | 25 + .../physx/4.x.x/test_package/test_package.cpp | 143 + .../4.x.x/test_v1_package/CMakeLists.txt | 17 + .../physx/4.x.x/test_v1_package/conanfile.py | 18 + .../4.x.x/test_v1_package/test_library.cpp | 25 + .../4.x.x/test_v1_package/test_package.cpp | 143 + recipes/physx/config.yml | 3 + recipes/picobench/all/conandata.yml | 16 + recipes/picobench/all/conanfile.py | 72 + .../all/patches/2.01-0001-add-install.patch | 30 + .../all/patches/2.02-0001-add-install.patch | 28 + .../picobench/all/test_package/CMakeLists.txt | 8 + .../picobench/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 38 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/picobench/config.yml | 5 + recipes/picojson/all/conandata.yml | 7 + recipes/picojson/all/conanfile.py | 39 + .../picojson/all/test_package/CMakeLists.txt | 8 + .../picojson/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 11 + .../picojson/all/test_v1_package/conanfile.py | 17 + recipes/picojson/config.yml | 5 + recipes/picosha2/all/conandata.yml | 7 + recipes/picosha2/all/conanfile.py | 59 + .../picosha2/all/test_package/CMakeLists.txt | 8 + .../picosha2/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../picosha2/all/test_v1_package/conanfile.py | 18 + recipes/picosha2/config.yml | 5 + recipes/pipes/all/conandata.yml | 4 + recipes/pipes/all/conanfile.py | 53 + recipes/pipes/all/test_package/CMakeLists.txt | 11 + recipes/pipes/all/test_package/conanfile.py | 16 + .../pipes/all/test_package/test_package.cpp | 16 + recipes/pipes/config.yml | 3 + recipes/pistache/all/conandata.yml | 15 + recipes/pistache/all/conanfile.py | 169 + .../all/patches/0001-remove-fpic.patch | 12 + .../all/patches/0002-include-stddef.patch | 12 + .../pistache/all/test_package/CMakeLists.txt | 12 + .../pistache/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../pistache/all/test_v1_package/conanfile.py | 18 + recipes/pistache/config.yml | 5 + recipes/pixman/all/conandata.yml | 18 + recipes/pixman/all/conanfile.py | 100 + .../0001-incompatible-pointer-types.patch | 21 + .../pixman/all/patches/0002-meson-build.patch | 253 ++ .../pixman/all/test_package/CMakeLists.txt | 7 + recipes/pixman/all/test_package/conanfile.py | 27 + .../pixman/all/test_package/test_package.c | 52 + .../pixman/all/test_v1_package/CMakeLists.txt | 8 + .../pixman/all/test_v1_package/conanfile.py | 17 + recipes/pixman/config.yml | 5 + recipes/pkgconf/all/conandata.yml | 22 + recipes/pkgconf/all/conanfile.py | 149 + ...-0001-meson-use-declare-dependencies.patch | 20 + ...002-clang-12-strndup-not-in-string-h.patch | 19 + .../1.7.3-0003-meson-use-library.patch | 11 + ...PATH-allow-colon+semicolon-separator.patch | 11 + ...001-clang-12-strndup-not-in-string-h.patch | 19 + .../patches/1.7.4-0002-fix-static-link.patch | 44 + ...PATH-allow-colon+semicolon-separator.patch | 11 + ...PATH-allow-colon+semicolon-separator.patch | 11 + recipes/pkgconf/all/test_package/conanfile.py | 92 + .../all/test_package/src/CMakeLists.txt | 6 + .../pkgconf/all/test_package/src/configure.ac | 9 + .../all/test_package/src/libexample1.pc | 6 + .../all/test_package/src/test_package.c | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../pkgconf/all/test_v1_package/conanfile.py | 56 + .../pkgconf/all/test_v1_package/configure.ac | 9 + .../all/test_v1_package/libexample1.pc | 6 + .../all/test_v1_package/test_package.c | 24 + recipes/pkgconf/config.yml | 7 + recipes/platform.converters/all/conandata.yml | 4 + recipes/platform.converters/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 12 + recipes/platform.converters/config.yml | 3 + recipes/platform.delegates/all/conandata.yml | 7 + recipes/platform.delegates/all/conanfile.py | 68 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 57 + recipes/platform.delegates/config.yml | 5 + recipes/platform.equality/all/conandata.yml | 4 + recipes/platform.equality/all/conanfile.py | 66 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 16 + recipes/platform.equality/config.yml | 3 + recipes/platform.exceptions/all/conandata.yml | 7 + recipes/platform.exceptions/all/conanfile.py | 71 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 13 + recipes/platform.exceptions/config.yml | 5 + recipes/platform.hashing/all/conandata.yml | 10 + recipes/platform.hashing/all/conanfile.py | 91 + .../all/test_package/CMakeLists.txt | 15 + .../all/test_package/conanfile.py | 28 + .../all/test_package/test_package.cpp | 15 + recipes/platform.hashing/config.yml | 7 + recipes/platform.interfaces/all/conandata.yml | 12 + recipes/platform.interfaces/all/conanfile.py | 93 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 101 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/platform.interfaces/config.yml | 5 + recipes/playrho/all/CMakeLists.txt | 9 + recipes/playrho/all/conandata.yml | 9 + recipes/playrho/all/conanfile.py | 103 + .../patches/1.1.0-0001-fix-target-name.patch | 24 + .../playrho/all/test_package/CMakeLists.txt | 11 + recipes/playrho/all/test_package/conanfile.py | 18 + .../playrho/all/test_package/test_package.cpp | 5 + recipes/playrho/config.yml | 3 + recipes/plf_colony/all/conandata.yml | 26 + recipes/plf_colony/all/conanfile.py | 43 + ...001-disable-cxx20-from-apple-clang14.patch | 13 + ...001-disable-cxx20-from-apple-clang14.patch | 13 + .../all/test_package/CMakeLists.txt | 7 + .../plf_colony/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/plf_colony/config.yml | 9 + recipes/plf_indiesort/all/conandata.yml | 7 + recipes/plf_indiesort/all/conanfile.py | 43 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/plf_indiesort/config.yml | 5 + recipes/plf_list/all/conandata.yml | 26 + recipes/plf_list/all/conanfile.py | 42 + ...001-disable-cxx20-from-apple-clang14.patch | 13 + ...001-disable-cxx20-from-apple-clang14.patch | 13 + .../plf_list/all/test_package/CMakeLists.txt | 7 + .../plf_list/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../plf_list/all/test_v1_package/conanfile.py | 17 + recipes/plf_list/config.yml | 9 + recipes/plf_nanotimer/all/conandata.yml | 4 + recipes/plf_nanotimer/all/conanfile.py | 40 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/plf_nanotimer/config.yml | 3 + recipes/plf_queue/all/conandata.yml | 10 + recipes/plf_queue/all/conanfile.py | 40 + .../plf_queue/all/test_package/CMakeLists.txt | 7 + .../plf_queue/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/plf_queue/config.yml | 7 + recipes/plf_stack/all/conandata.yml | 10 + recipes/plf_stack/all/conanfile.py | 43 + .../plf_stack/all/test_package/CMakeLists.txt | 7 + .../plf_stack/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/plf_stack/config.yml | 7 + recipes/plog/all/conandata.yml | 7 + recipes/plog/all/conanfile.py | 37 + recipes/plog/all/test_package/CMakeLists.txt | 11 + recipes/plog/all/test_package/conanfile.py | 26 + .../plog/all/test_package/test_package.cpp | 13 + .../plog/all/test_v1_package/CMakeLists.txt | 8 + recipes/plog/all/test_v1_package/conanfile.py | 18 + recipes/plog/config.yml | 5 + recipes/plusaes/all/conandata.yml | 4 + recipes/plusaes/all/conanfile.py | 35 + .../plusaes/all/test_package/CMakeLists.txt | 11 + recipes/plusaes/all/test_package/conanfile.py | 16 + .../plusaes/all/test_package/test_package.cpp | 30 + recipes/plusaes/config.yml | 3 + recipes/plutovg/all/conandata.yml | 7 + recipes/plutovg/all/conanfile.py | 78 + .../plutovg/all/test_package/CMakeLists.txt | 7 + recipes/plutovg/all/test_package/conanfile.py | 25 + .../plutovg/all/test_package/test_package.c | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../plutovg/all/test_v1_package/conanfile.py | 17 + recipes/plutovg/config.yml | 5 + recipes/pngpp/all/conandata.yml | 7 + recipes/pngpp/all/conanfile.py | 43 + .../pngpp/all/patches/0001-fix-windows.patch | 11 + recipes/pngpp/all/test_package/CMakeLists.txt | 7 + recipes/pngpp/all/test_package/conanfile.py | 26 + .../pngpp/all/test_package/test_package.cpp | 12 + .../pngpp/all/test_v1_package/CMakeLists.txt | 10 + .../pngpp/all/test_v1_package/conanfile.py | 17 + recipes/pngpp/config.yml | 3 + recipes/poco/all/conandata.yml | 82 + recipes/poco/all/conanfile.py | 325 ++ .../poco/all/patches/0002-mysql-include.patch | 156 + .../1.10.0-set-missing-cmake-variable.patch | 11 + recipes/poco/all/patches/1.10.0.patch | 51 + recipes/poco/all/patches/1.10.1.patch | 51 + recipes/poco/all/patches/1.11.0.patch | 120 + recipes/poco/all/patches/1.11.1.patch | 50 + recipes/poco/all/patches/1.12.0.patch | 36 + recipes/poco/all/patches/1.12.1.patch | 36 + recipes/poco/all/patches/1.12.2.patch | 36 + recipes/poco/all/patches/1.12.3.patch | 39 + recipes/poco/all/patches/1.12.4.patch | 39 + recipes/poco/all/patches/1.8.1.patch | 81 + recipes/poco/all/patches/1.9.2.patch | 81 + recipes/poco/all/test_package/CMakeLists.txt | 111 + recipes/poco/all/test_package/conanfile.py | 39 + recipes/poco/all/test_package/test_core.cpp | 55 + recipes/poco/all/test_package/test_crypto.cpp | 54 + .../poco/all/test_package/test_encodings.cpp | 21 + recipes/poco/all/test_package/test_jwt.cpp | 34 + recipes/poco/all/test_package/test_net.cpp | 5 + recipes/poco/all/test_package/test_net_2.cpp | 255 ++ recipes/poco/all/test_package/test_netssl.cpp | 47 + .../poco/all/test_package/test_prometheus.cpp | 21 + recipes/poco/all/test_package/test_sqlite.cpp | 68 + recipes/poco/all/test_package/test_util.cpp | 192 + .../poco/all/test_v1_package/CMakeLists.txt | 10 + recipes/poco/all/test_v1_package/conanfile.py | 30 + recipes/poco/config.yml | 29 + recipes/podofo/all/conandata.yml | 16 + recipes/podofo/all/conanfile.py | 138 + .../all/patches/0001-fix-cmake-0.9.6.patch | 183 + .../all/patches/0001-fix-cmake-0.9.7.patch | 183 + .../podofo/all/test_package/CMakeLists.txt | 8 + recipes/podofo/all/test_package/conanfile.py | 26 + .../podofo/all/test_package/test_package.cpp | 9 + .../podofo/all/test_v1_package/CMakeLists.txt | 8 + .../podofo/all/test_v1_package/conanfile.py | 17 + recipes/podofo/config.yml | 5 + recipes/poly2tri/all/CMakeLists.txt | 29 + recipes/poly2tri/all/conandata.yml | 4 + recipes/poly2tri/all/conanfile.py | 60 + .../poly2tri/all/test_package/CMakeLists.txt | 7 + .../poly2tri/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../poly2tri/all/test_v1_package/conanfile.py | 17 + recipes/poly2tri/config.yml | 3 + recipes/polylabel/all/conandata.yml | 4 + recipes/polylabel/all/conanfile.py | 46 + .../polylabel/all/test_package/CMakeLists.txt | 8 + .../polylabel/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/polylabel/config.yml | 3 + recipes/polylineencoder/all/conandata.yml | 15 + recipes/polylineencoder/all/conanfile.py | 75 + .../1.0.0/0001-cmake-target-name.patch | 22 + .../patches/1.0.0/0002-include-limits.patch | 12 + .../patches/1.0.0/0003-cmake-install.patch | 24 + .../all/patches/1.1.2/0001-cmake.patch | 47 + .../1.1.2/0002-backward-compatibility.patch | 24 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 25 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/polylineencoder/config.yml | 5 + recipes/polymorphic_value/all/conandata.yml | 4 + recipes/polymorphic_value/all/conanfile.py | 75 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 20 + recipes/polymorphic_value/config.yml | 3 + recipes/poppler-data/all/conandata.yml | 17 + recipes/poppler-data/all/conanfile.py | 66 + .../0001-cmake-use-GNUInstallDirs.patch | 7 + .../all/test_package/conanfile.py | 14 + .../all/test_v1_package/conanfile.py | 10 + recipes/poppler-data/config.yml | 7 + recipes/poppler/all/CMakeLists.txt | 15 + recipes/poppler/all/conandata.yml | 34 + recipes/poppler/all/conanfile.py | 322 ++ ...ECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch | 118 + .../20/0002-cmake-use_CONAN_PKG-targets.patch | 78 + .../patches/20/0003-cmake-disable-tests.patch | 11 + ...POPPLER_DATADIR-environment-variable.patch | 11 + ...isual-studio-basetsd.h-libjpeg-INT32.patch | 21 + .../20/0006-missing-symbol-dll-windows.patch | 25 + .../patches/20/0007-cmake-use_conan_qt.patch | 63 + ...ECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch | 125 + .../21/0002-cmake-use_CONAN_PKG-targets.patch | 158 + ...POPPLER_DATADIR-environment-variable.patch | 11 + ...isual-studio-basetsd.h-libjpeg-INT32.patch | 21 + .../patches/21/0007-cmake-use_conan_qt.patch | 70 + .../poppler/all/test_package/CMakeLists.txt | 9 + recipes/poppler/all/test_package/conanfile.py | 19 + recipes/poppler/all/test_package/sample.pdf | Bin 0 -> 21355 bytes .../poppler/all/test_package/test_package.cpp | 22 + recipes/poppler/config.yml | 5 + recipes/popt/all/conandata.yml | 10 + recipes/popt/all/conanfile.py | 131 + .../popt/all/patches/0004-vcpkg-fixmsvc.patch | 62 + recipes/popt/all/test_package/CMakeLists.txt | 7 + recipes/popt/all/test_package/conanfile.py | 26 + recipes/popt/all/test_package/test_package.c | 17 + .../popt/all/test_v1_package/CMakeLists.txt | 10 + recipes/popt/all/test_v1_package/conanfile.py | 18 + recipes/popt/config.yml | 3 + .../portable-file-dialogs/all/conandata.yml | 4 + .../portable-file-dialogs/all/conanfile.py | 36 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 11 + recipes/portable-file-dialogs/config.yml | 3 + recipes/poshlib/all/CMakeLists.txt | 22 + recipes/poshlib/all/conandata.yml | 4 + recipes/poshlib/all/conanfile.py | 68 + .../poshlib/all/test_package/CMakeLists.txt | 8 + recipes/poshlib/all/test_package/conanfile.py | 17 + .../poshlib/all/test_package/test_package.c | 9 + recipes/poshlib/config.yml | 3 + recipes/pprint/all/conandata.yml | 5 + recipes/pprint/all/conanfile.py | 48 + .../pprint/all/test_package/CMakeLists.txt | 9 + recipes/pprint/all/test_package/conanfile.py | 17 + .../pprint/all/test_package/test_package.cpp | 15 + recipes/pprint/config.yml | 3 + recipes/pranav-csv2/all/conandata.yml | 4 + recipes/pranav-csv2/all/conanfile.py | 100 + .../all/test_package/CMakeLists.txt | 11 + .../pranav-csv2/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 13 + recipes/pranav-csv2/config.yml | 3 + recipes/premake/5.x/conandata.yml | 14 + recipes/premake/5.x/conanfile.py | 125 + .../patches/0001-5.0.0-alpha14-mingw.patch | 72 + .../patches/0001-5.0.0-alpha15-mingw.patch | 72 + recipes/premake/5.x/test_package/conanfile.py | 9 + recipes/premake/config.yml | 5 + recipes/pretty-name/all/conandata.yml | 4 + recipes/pretty-name/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 16 + .../pretty-name/all/test_package/conanfile.py | 17 + .../pretty-name/all/test_package/src/test.cpp | 23 + recipes/pretty-name/config.yml | 3 + recipes/pro-mdnsd/all/CMakeLists.txt | 7 + recipes/pro-mdnsd/all/conandata.yml | 8 + recipes/pro-mdnsd/all/conanfile.py | 110 + .../patches/0001-cmake-install-bundle.patch | 11 + .../pro-mdnsd/all/test_package/CMakeLists.txt | 10 + .../pro-mdnsd/all/test_package/conanfile.py | 17 + .../pro-mdnsd/all/test_package/test_package.c | 129 + recipes/pro-mdnsd/config.yml | 3 + .../procxx-boost-ext-simd/all/conandata.yml | 4 + .../procxx-boost-ext-simd/all/conanfile.py | 61 + .../all/test_package/CMakeLists.txt | 19 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 19 + recipes/procxx-boost-ext-simd/config.yml | 3 + recipes/proj/all/conandata.yml | 55 + recipes/proj/all/conanfile.py | 227 ++ .../0001-use-cmake-targets-6.x.x.patch | 34 + .../0001-use-cmake-targets-7.2.1.patch | 37 + .../0001-use-cmake-targets-8.2.0.patch | 31 + .../0001-use-cmake-targets-9.0.0.patch | 31 + .../0001-use-cmake-targets-9.0.1.patch | 31 + .../0001-use-cmake-targets-9.1.0.patch | 31 + .../0002-cmake-configure-proj-pc.patch | 13 + recipes/proj/all/test_package/CMakeLists.txt | 11 + recipes/proj/all/test_package/conanfile.py | 32 + recipes/proj/all/test_package/test_package.c | 52 + .../proj/all/test_v1_package/CMakeLists.txt | 8 + recipes/proj/all/test_v1_package/conanfile.py | 18 + recipes/proj/config.yml | 15 + recipes/prometheus-cpp/all/conandata.yml | 22 + recipes/prometheus-cpp/all/conanfile.py | 159 + .../all/patches/0001-include-limits.patch | 10 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/prometheus-cpp/config.yml | 13 + recipes/proposal/all/conandata.yml | 43 + recipes/proposal/all/conanfile.py | 116 + .../proposal/all/test_package/CMakeLists.txt | 8 + .../proposal/all/test_package/conanfile.py | 24 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../proposal/all/test_v1_package/conanfile.py | 17 + recipes/proposal/config.yml | 29 + recipes/protobuf/all/conandata.yml | 66 + recipes/protobuf/all/conanfile.py | 262 ++ ...rotobuf-3.17.1-upstream-macos-macros.patch | 46 + ...rotobuf-3.18.1-upstream-macos-macros.patch | 46 + ...rotobuf-3.19.4-upstream-macos-macros.patch | 46 + ...rotobuf-3.19.6-upstream-macos-macros.patch | 46 + ...rotobuf-3.20.0-upstream-macos-macros.patch | 29 + ...rotobuf-3.21.4-upstream-macos-macros.patch | 25 + ...rotobuf-3.21.9-upstream-macos-macros.patch | 25 + .../upstream-pr-9153-msvc-runtime.patch | 15 + .../upstream-pr-9437-msvc-runtime.patch | 17 + .../protobuf/all/test_package/CMakeLists.txt | 21 + .../all/test_package/addressbook.proto | 64 + .../protobuf/all/test_package/conanfile.py | 41 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../protobuf/all/test_v1_package/conanfile.py | 27 + recipes/protobuf/config.yml | 15 + recipes/protopuf/all/conandata.yml | 7 + recipes/protopuf/all/conanfile.py | 75 + .../protopuf/all/test_package/CMakeLists.txt | 9 + .../protopuf/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 32 + .../all/test_v1_package/CMakeLists.txt | 12 + .../protopuf/all/test_v1_package/conanfile.py | 18 + recipes/protopuf/config.yml | 5 + recipes/protozero/all/conandata.yml | 4 + recipes/protozero/all/conanfile.py | 45 + .../protozero/all/test_package/CMakeLists.txt | 8 + .../protozero/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/protozero/config.yml | 3 + recipes/psimd/all/conandata.yml | 4 + recipes/psimd/all/conanfile.py | 38 + recipes/psimd/all/test_package/CMakeLists.txt | 7 + recipes/psimd/all/test_package/conanfile.py | 26 + recipes/psimd/all/test_package/test_package.c | 10 + .../psimd/all/test_v1_package/CMakeLists.txt | 10 + .../psimd/all/test_v1_package/conanfile.py | 17 + recipes/psimd/config.yml | 3 + recipes/psyinf-gmtl/all/conandata.yml | 4 + recipes/psyinf-gmtl/all/conanfile.py | 49 + .../all/test_package/CMakeLists.txt | 8 + .../psyinf-gmtl/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 18 + recipes/psyinf-gmtl/config.yml | 3 + recipes/ptex/all/conandata.yml | 7 + recipes/ptex/all/conanfile.py | 88 + recipes/ptex/all/patches/0001-fix-cmake.patch | 57 + recipes/ptex/all/test_package/CMakeLists.txt | 11 + recipes/ptex/all/test_package/conanfile.py | 26 + .../ptex/all/test_package/test_package.cpp | 6 + .../ptex/all/test_v1_package/CMakeLists.txt | 8 + recipes/ptex/all/test_v1_package/conanfile.py | 17 + recipes/ptex/config.yml | 3 + recipes/pthreadpool/all/CMakeLists.txt | 10 + recipes/pthreadpool/all/conandata.yml | 4 + recipes/pthreadpool/all/conanfile.py | 84 + .../all/test_package/CMakeLists.txt | 8 + .../pthreadpool/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/pthreadpool/config.yml | 3 + recipes/pthreads4w/all/conandata.yml | 4 + recipes/pthreads4w/all/conanfile.py | 130 + .../all/test_package/CMakeLists.txt | 8 + .../pthreads4w/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.c | 29 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/pthreads4w/config.yml | 3 + recipes/pugixml/all/conandata.yml | 13 + recipes/pugixml/all/conanfile.py | 116 + .../pugixml/all/test_package/CMakeLists.txt | 7 + recipes/pugixml/all/test_package/conanfile.py | 26 + .../pugixml/all/test_package/test_package.cpp | 38 + .../all/test_v1_package/CMakeLists.txt | 8 + .../pugixml/all/test_v1_package/conanfile.py | 17 + recipes/pugixml/config.yml | 9 + recipes/pulseaudio/all/conandata.yml | 10 + recipes/pulseaudio/all/conanfile.py | 167 + .../all/test_package/CMakeLists.txt | 7 + .../pulseaudio/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/pulseaudio/config.yml | 7 + recipes/pupnp/all/conandata.yml | 10 + recipes/pupnp/all/conanfile.py | 140 + recipes/pupnp/all/test_package/CMakeLists.txt | 11 + recipes/pupnp/all/test_package/conanfile.py | 17 + recipes/pupnp/all/test_package/test_package.c | 15 + recipes/pupnp/config.yml | 7 + recipes/pybind11/all/conandata.yml | 19 + recipes/pybind11/all/conanfile.py | 78 + .../pybind11/all/test_package/CMakeLists.txt | 5 + .../pybind11/all/test_package/conanfile.py | 50 + recipes/pybind11/all/test_package/test.py | 5 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 18 + .../pybind11/all/test_v1_package/conanfile.py | 27 + recipes/pybind11/config.yml | 13 + recipes/pybind11_json/all/conandata.yml | 10 + recipes/pybind11_json/all/conanfile.py | 48 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 30 + recipes/pybind11_json/config.yml | 7 + recipes/pystring/all/CMakeLists.txt | 14 + recipes/pystring/all/conandata.yml | 7 + recipes/pystring/all/conanfile.py | 61 + .../pystring/all/test_package/CMakeLists.txt | 7 + .../pystring/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../pystring/all/test_v1_package/conanfile.py | 17 + recipes/pystring/config.yml | 5 + recipes/qarchive/all/conandata.yml | 26 + recipes/qarchive/all/conanfile.py | 114 + .../0001-cmake-conan-compatibility.patch | 18 + .../all/patches/0002-export-symbols.patch | 15 + .../qarchive/all/test_package/CMakeLists.txt | 10 + .../qarchive/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../qarchive/all/test_v1_package/conanfile.py | 17 + recipes/qarchive/config.yml | 11 + recipes/qcbor/all/conandata.yml | 23 + recipes/qcbor/all/conanfile.py | 82 + .../all/patches/1.0-0001-fix-cmake.patch | 23 + .../all/patches/1.1-0001-fix-cmake.patch | 24 + .../all/patches/1.2-0001-fix-cmake.patch | 33 + recipes/qcbor/all/test_package/CMakeLists.txt | 7 + recipes/qcbor/all/test_package/conanfile.py | 26 + recipes/qcbor/all/test_package/test_package.c | 18 + .../qcbor/all/test_v1_package/CMakeLists.txt | 8 + .../qcbor/all/test_v1_package/conanfile.py | 17 + recipes/qcbor/config.yml | 7 + recipes/qcoro/all/CMakeLists.txt | 7 + recipes/qcoro/all/conandata.yml | 4 + recipes/qcoro/all/conanfile.py | 146 + recipes/qcoro/all/test_package/CMakeLists.txt | 14 + recipes/qcoro/all/test_package/conanfile.py | 21 + .../qcoro/all/test_package/test_package.cpp | 41 + recipes/qcoro/config.yml | 3 + recipes/qcustomplot/all/CMakeLists.txt | 61 + recipes/qcustomplot/all/conandata.yml | 13 + recipes/qcustomplot/all/conanfile.py | 109 + .../all/patches/0001-fix-for-qt6.2.patch | 78 + .../all/test_package/CMakeLists.txt | 19 + .../qcustomplot/all/test_package/conanfile.py | 32 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/qcustomplot/config.yml | 7 + recipes/qdbm/all/CMakeLists.txt | 85 + recipes/qdbm/all/conandata.yml | 4 + recipes/qdbm/all/conanfile.py | 81 + recipes/qdbm/all/test_package/CMakeLists.txt | 10 + recipes/qdbm/all/test_package/conanfile.py | 18 + recipes/qdbm/all/test_package/test_package.c | 12 + recipes/qdbm/config.yml | 3 + recipes/qhull/all/conandata.yml | 34 + recipes/qhull/all/conanfile.py | 128 + .../0001-fix-cmake-conflict-exec-dir.patch | 35 + ...make-minimum-required-location-7.3.2.patch | 12 + ...make-minimum-required-location-8.0.0.patch | 12 + ...make-minimum-required-location-8.0.1.patch | 12 + .../all/patches/0003-fix-cmake-7.3.2.patch | 170 + .../all/patches/0003-fix-cmake-8.0.x.patch | 184 + recipes/qhull/all/patches/0004-no-cpp11.patch | 46 + recipes/qhull/all/test_package/CMakeLists.txt | 20 + recipes/qhull/all/test_package/conanfile.py | 31 + recipes/qhull/all/test_package/test_package.c | 308 ++ .../qhull/all/test_package/test_package_r.c | 304 ++ .../qhull/all/test_v1_package/CMakeLists.txt | 8 + .../qhull/all/test_v1_package/conanfile.py | 18 + recipes/qhull/config.yml | 7 + recipes/qpdf/all/conandata.yml | 12 + recipes/qpdf/all/conanfile.py | 185 + .../0001-libqpdf-cmake-deps-jpeg-zlib.patch | 113 + ...xclude-unnecessary-cmake-subprojects.patch | 17 + recipes/qpdf/all/test_package/CMakeLists.txt | 12 + recipes/qpdf/all/test_package/conanfile.py | 24 + .../qpdf/all/test_package/test_package.cpp | 21 + .../qpdf/all/test_v1_package/CMakeLists.txt | 8 + recipes/qpdf/all/test_v1_package/conanfile.py | 17 + recipes/qpdf/config.yml | 3 + recipes/qpoases/all/conandata.yml | 4 + recipes/qpoases/all/conanfile.py | 52 + .../qpoases/all/test_package/CMakeLists.txt | 7 + recipes/qpoases/all/test_package/conanfile.py | 26 + .../qpoases/all/test_package/test_package.cpp | 62 + .../all/test_v1_package/CMakeLists.txt | 8 + .../qpoases/all/test_v1_package/conanfile.py | 17 + recipes/qpoases/config.yml | 3 + recipes/qr-code-generator/all/CMakeLists.txt | 9 + recipes/qr-code-generator/all/conandata.yml | 41 + recipes/qr-code-generator/all/conanfile.py | 108 + .../all/patches/001-qrcode-1_4.patch | 10 + .../all/patches/002-cmake-pre-1.6.patch | 6 + .../all/patches/003-cmake-1.6.patch | 6 + .../all/patches/004-cmake-1.7.patch | 6 + .../all/test_package/CMakeLists.txt | 13 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 47 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/qr-code-generator/config.yml | 11 + .../all/CMakeLists.txt | 7 + .../all/conandata.yml | 11 + .../all/conanfile.py | 95 + .../patches/fix-cmake-license-install.patch | 15 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/example.cpp | 9 + recipes/qt-advanced-docking-system/config.yml | 5 + recipes/qt/5.x.x/conandata.yml | 188 + recipes/qt/5.x.x/conanfile.py | 1513 +++++++ ...001-Find-fontconfig-using-pkg-config.patch | 56 + recipes/qt/5.x.x/patches/107ed30ec5.patch | 35 + .../qt/5.x.x/patches/337f28c9ab-5.15.5.patch | 40 + .../qt/5.x.x/patches/337f28c9ab-5.15.8.patch | 39 + recipes/qt/5.x.x/patches/337f28c9ab.patch | 40 + recipes/qt/5.x.x/patches/QTBUG-98813.patch | 38 + recipes/qt/5.x.x/patches/aa2a39dea5.diff | 29 + .../qt/5.x.x/patches/android-backtrace.diff | 19 + recipes/qt/5.x.x/patches/android-new-ndk.diff | 27 + recipes/qt/5.x.x/patches/android-openssl.diff | 13 + recipes/qt/5.x.x/patches/c72097e.diff | 42 + ...romium-skia-missing-iterator-include.patch | 10 + .../chromium-v8-missing-constexpr.patch | 46 + recipes/qt/5.x.x/patches/d3396fb6fc.patch | 30 + recipes/qt/5.x.x/patches/dece6f5.diff | 14 + recipes/qt/5.x.x/patches/fix-macdeployqt.diff | 66 + recipes/qt/5.x.x/patches/skia-cd397f3.diff | 25 + recipes/qt/5.x.x/qtmodules5.15.5.conf | 326 ++ recipes/qt/5.x.x/qtmodules5.15.6.conf | 326 ++ recipes/qt/5.x.x/qtmodules5.15.7.conf | 326 ++ recipes/qt/5.x.x/qtmodules5.15.8.conf | 326 ++ recipes/qt/5.x.x/qtmodules5.15.9.conf | 326 ++ recipes/qt/5.x.x/test_package/CMakeLists.txt | 9 + recipes/qt/5.x.x/test_package/conanfile.py | 58 + recipes/qt/5.x.x/test_package/example.qrc | 5 + recipes/qt/5.x.x/test_package/greeter.h | 26 + recipes/qt/5.x.x/test_package/resource.txt | 1 + .../qt/5.x.x/test_package/test_package.cpp | 52 + .../qt/5.x.x/test_v1_package/CMakeLists.txt | 23 + recipes/qt/5.x.x/test_v1_package/conanfile.py | 145 + recipes/qt/5.x.x/test_v1_package/meson.build | 6 + .../qt/5.x.x/test_v1_package/test_package.pro | 14 + recipes/qt/6.x.x/conandata.yml | 122 + recipes/qt/6.x.x/conanfile.py | 1449 +++++++ recipes/qt/6.x.x/patches/138a720.diff | 21 + recipes/qt/6.x.x/patches/311d29d.patch | 30 + recipes/qt/6.x.x/patches/32451d5.diff | 32 + recipes/qt/6.x.x/patches/3801bba82.patch | 27 + recipes/qt/6.x.x/patches/5fe0b82.patch | 23 + .../CVE-2022-1096-qtwebengine-6.2.diff | 27 + .../patches/CVE-2022-25255-qprocess6-2.diff | 25 + .../qt/6.x.x/patches/CVE-2022-25643-6.2.diff | 73 + recipes/qt/6.x.x/patches/c72097e.diff | 42 + recipes/qt/6.x.x/patches/c76d2f6.patch | 70 + recipes/qt/6.x.x/patches/d13958d.diff | 26 + recipes/qt/6.x.x/patches/d13958d_.diff | 23 + recipes/qt/6.x.x/patches/dece6f5.patch | 25 + .../qt/6.x.x/patches/qt6-pri-helpers-fix.diff | 15 + recipes/qt/6.x.x/qtmodules6.2.4.conf | 299 ++ recipes/qt/6.x.x/qtmodules6.3.2.conf | 305 ++ recipes/qt/6.x.x/qtmodules6.4.1.conf | 318 ++ recipes/qt/6.x.x/qtmodules6.4.2.conf | 318 ++ recipes/qt/6.x.x/qtmodules6.5.0.conf | 331 ++ recipes/qt/6.x.x/test_package/CMakeLists.txt | 25 + recipes/qt/6.x.x/test_package/conanfile.py | 130 + recipes/qt/6.x.x/test_package/example.qrc | 5 + recipes/qt/6.x.x/test_package/greeter.h | 26 + recipes/qt/6.x.x/test_package/meson.build | 6 + recipes/qt/6.x.x/test_package/resource.txt | 1 + .../qt/6.x.x/test_package/test_package.cpp | 48 + .../qt/6.x.x/test_package/test_package.pro | 15 + recipes/qt/config.yml | 21 + recipes/qtxlsxwriter/all/CMakeLists.txt | 39 + recipes/qtxlsxwriter/all/conandata.yml | 11 + recipes/qtxlsxwriter/all/conanfile.py | 96 + .../all/patches/0.3.0/fix-export-macro.patch | 13 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/qtxlsxwriter/config.yml | 3 + recipes/quantlib/all/conandata.yml | 7 + recipes/quantlib/all/conanfile.py | 91 + .../quantlib/all/patches/0001-fix-cmake.patch | 48 + .../quantlib/all/test_package/CMakeLists.txt | 8 + .../quantlib/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 69 + .../all/test_v1_package/CMakeLists.txt | 8 + .../quantlib/all/test_v1_package/conanfile.py | 17 + recipes/quantlib/config.yml | 3 + recipes/quaternions/all/conandata.yml | 4 + recipes/quaternions/all/conanfile.py | 36 + .../all/test_package/CMakeLists.txt | 9 + .../quaternions/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 13 + recipes/quaternions/config.yml | 3 + recipes/quazip/all/conandata.yml | 16 + recipes/quazip/all/conanfile.py | 99 + .../patches/1.3-0001-use-cpp17-for-qt6.patch | 36 + .../quazip/all/test_package/CMakeLists.txt | 10 + recipes/quazip/all/test_package/conanfile.py | 27 + .../quazip/all/test_package/test_package.cpp | 30 + recipes/quazip/all/test_package/zipFile.zip | Bin 0 -> 347 bytes .../quazip/all/test_v1_package/CMakeLists.txt | 8 + .../quazip/all/test_v1_package/conanfile.py | 20 + recipes/quazip/config.yml | 9 + recipes/quickfast/all/CMakeLists.txt | 75 + recipes/quickfast/all/conandata.yml | 14 + recipes/quickfast/all/conanfile.py | 70 + .../all/patches/00001-fix-boost-asio.patch | 42 + .../all/patches/00002-fix-boost-asio.patch | 42 + .../quickfast/all/test_package/CMakeLists.txt | 11 + .../quickfast/all/test_package/conanfile.py | 18 + recipes/quickfast/all/test_package/main.cpp | 37 + recipes/quickfast/config.yml | 5 + recipes/quickfix/all/conandata.yml | 24 + recipes/quickfix/all/conanfile.py | 103 + ...for-C-17-replace-throw-.-with-EXCEPT.patch | 3485 +++++++++++++++++ .../all/patches/0002-except-copy.patch | 52 + ...ix-condition-for-using-tr1-namespace.patch | 25 + ...m-compilatin-unit-performance-and-ac.patch | 25 + ...ake-version-add-conan-basic-setup-an.patch | 114 + .../0006-manage-postgres-through-conan.patch | 25 + ...tatic-libraries-for-non-windows-buil.patch | 42 + .../0008-manage-mysql-through-conan.patch | 41 + ...009-downgrade-cmake-minimum-required.patch | 10 + .../quickfix/all/test_package/CMakeLists.txt | 8 + .../quickfix/all/test_package/conanfile.py | 18 + .../quickfix/all/test_package/executor.cpp | 69 + recipes/quickfix/config.yml | 3 + recipes/quickjs/all/CMakeLists.txt | 62 + recipes/quickjs/all/conandata.yml | 4 + recipes/quickjs/all/conanfile.py | 91 + .../quickjs/all/test_package/CMakeLists.txt | 7 + recipes/quickjs/all/test_package/conanfile.py | 26 + .../quickjs/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 10 + .../quickjs/all/test_v1_package/conanfile.py | 18 + recipes/quickjs/config.yml | 3 + recipes/quill/all/conandata.yml | 34 + recipes/quill/all/conanfile.py | 175 + recipes/quill/all/test_package/CMakeLists.txt | 12 + recipes/quill/all/test_package/conanfile.py | 26 + .../quill/all/test_package/test_package.cpp | 11 + .../quill/all/test_v1_package/CMakeLists.txt | 8 + .../quill/all/test_v1_package/conanfile.py | 18 + recipes/quill/config.yml | 23 + recipes/quirc/all/CMakeLists.txt | 28 + recipes/quirc/all/conandata.yml | 12 + recipes/quirc/all/conanfile.py | 70 + .../all/patches/remove-c99-features.patch | 35 + recipes/quirc/all/patches/replace-vla.patch | 115 + recipes/quirc/all/test_package/CMakeLists.txt | 7 + recipes/quirc/all/test_package/conanfile.py | 26 + recipes/quirc/all/test_package/test_package.c | 15 + .../quirc/all/test_v1_package/CMakeLists.txt | 8 + .../quirc/all/test_v1_package/conanfile.py | 17 + recipes/quirc/config.yml | 6 + recipes/qwt/all/conandata.yml | 9 + recipes/qwt/all/conanfile.py | 155 + .../qwt/all/patches/cmake-support-patch.patch | 32 + recipes/qwt/all/patches/cmake-support.patch | 1439 +++++++ recipes/qwt/all/test_package/CMakeLists.txt | 13 + recipes/qwt/all/test_package/conanfile.py | 26 + recipes/qwt/all/test_package/test_package.cpp | 10 + .../qwt/all/test_v1_package/CMakeLists.txt | 8 + recipes/qwt/all/test_v1_package/conanfile.py | 17 + recipes/qwt/config.yml | 3 + recipes/qxlsx/all/conandata.yml | 18 + recipes/qxlsx/all/conanfile.py | 95 + .../all/patches/1.4.3/0001-allow-shared.patch | 218 ++ .../1.4.3/0002-add-install-target.patch | 37 + recipes/qxlsx/all/test_package/CMakeLists.txt | 8 + recipes/qxlsx/all/test_package/conanfile.py | 29 + .../qxlsx/all/test_package/test_package.cpp | 15 + .../qxlsx/all/test_v1_package/CMakeLists.txt | 8 + .../qxlsx/all/test_v1_package/conanfile.py | 17 + recipes/qxlsx/config.yml | 7 + recipes/qxmpp/all/CMakeLists.txt | 9 + recipes/qxmpp/all/conandata.yml | 10 + recipes/qxmpp/all/conanfile.py | 97 + .../all/patches/001-add_conan_1.4.0.patch | 20 + .../all/patches/002-add_gstreamer_1.4.0.patch | 26 + recipes/qxmpp/all/test_package/CMakeLists.txt | 12 + recipes/qxmpp/all/test_package/conanfile.py | 16 + .../qxmpp/all/test_package/test_package.cpp | 7 + recipes/qxmpp/config.yml | 3 + recipes/r8brain-free-src/all/CMakeLists.txt | 47 + recipes/r8brain-free-src/all/conandata.yml | 7 + recipes/r8brain-free-src/all/conanfile.py | 86 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/r8brain-free-src/config.yml | 5 + recipes/rabbitmq-c/all/conandata.yml | 13 + recipes/rabbitmq-c/all/conanfile.py | 117 + .../all/test_package/CMakeLists.txt | 20 + .../rabbitmq-c/all/test_package/conanfile.py | 32 + .../all/test_package/test_package.c | 42 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/rabbitmq-c/config.yml | 9 + recipes/ragel/all/CMakeLists.txt | 133 + recipes/ragel/all/conandata.yml | 9 + recipes/ragel/all/conanfile.py | 69 + recipes/ragel/all/config.h | 26 + recipes/ragel/all/patches/0001-unistd.patch | 20 + recipes/ragel/all/test_package/conanfile.py | 10 + recipes/ragel/config.yml | 3 + recipes/rang/all/conandata.yml | 7 + recipes/rang/all/conanfile.py | 40 + recipes/rang/all/test_package/CMakeLists.txt | 8 + recipes/rang/all/test_package/conanfile.py | 26 + .../rang/all/test_package/test_package.cpp | 11 + .../rang/all/test_v1_package/CMakeLists.txt | 8 + recipes/rang/all/test_v1_package/conanfile.py | 17 + recipes/rang/config.yml | 5 + recipes/range-v3/all/conandata.yml | 22 + recipes/range-v3/all/conanfile.py | 80 + .../range-v3/all/test_package/CMakeLists.txt | 12 + .../range-v3/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 39 + .../all/test_v1_package/CMakeLists.txt | 8 + .../range-v3/all/test_v1_package/conanfile.py | 18 + recipes/range-v3/config.yml | 15 + recipes/rangeless/all/conandata.yml | 4 + recipes/rangeless/all/conanfile.py | 34 + .../rangeless/all/test_package/CMakeLists.txt | 9 + .../rangeless/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 19 + recipes/rangeless/config.yml | 3 + recipes/rangesnext/all/conandata.yml | 8 + recipes/rangesnext/all/conanfile.py | 37 + .../all/test_package/CMakeLists.txt | 11 + .../rangesnext/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 29 + recipes/rangesnext/config.yml | 3 + recipes/rapidcheck/all/conandata.yml | 30 + recipes/rapidcheck/all/conanfile.py | 164 + ...001-gtest-catch-integration-20200131.patch | 13 + ...001-gtest-catch-integration-20210107.patch | 13 + ...001-gtest-catch-integration-20210702.patch | 13 + ...001-gtest-catch-integration-20220514.patch | 13 + .../all/test_package/CMakeLists.txt | 9 + .../rapidcheck/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/rapidcheck/config.yml | 9 + recipes/rapidcsv/all/conandata.yml | 16 + recipes/rapidcsv/all/conanfile.py | 47 + .../rapidcsv/all/test_package/CMakeLists.txt | 8 + .../rapidcsv/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../rapidcsv/all/test_v1_package/conanfile.py | 18 + recipes/rapidcsv/config.yml | 11 + recipes/rapidfuzz/all/conandata.yml | 7 + recipes/rapidfuzz/all/conanfile.py | 65 + .../rapidfuzz/all/test_package/CMakeLists.txt | 8 + .../rapidfuzz/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/rapidfuzz/config.yml | 5 + recipes/rapidjson/all/conandata.yml | 14 + recipes/rapidjson/all/conanfile.py | 39 + .../rapidjson/all/test_package/CMakeLists.txt | 8 + .../rapidjson/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 23 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/rapidjson/config.yml | 9 + recipes/rapidxml/all/conandata.yml | 10 + recipes/rapidxml/all/conanfile.py | 44 + .../1.13-fix-template-compile-issue.patch | 36 + .../rapidxml/all/test_package/CMakeLists.txt | 7 + .../all/test_package/beer_journal.xml | 18 + .../rapidxml/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 49 + .../all/test_v1_package/CMakeLists.txt | 10 + .../rapidxml/all/test_v1_package/conanfile.py | 18 + recipes/rapidxml/config.yml | 3 + recipes/rapidyaml/all/conandata.yml | 30 + recipes/rapidyaml/all/conanfile.py | 93 + .../0.3.0-001-remove-internal-c4core.patch | 41 + .../0.4.0-001-remove-internal-c4core.patch | 41 + .../0.4.1-001-remove-internal-c4core.patch | 41 + .../0.5.0-001-remove-internal-c4core.patch | 43 + .../rapidyaml/all/test_package/CMakeLists.txt | 11 + .../rapidyaml/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 32 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/rapidyaml/config.yml | 9 + recipes/raylib/all/CMakeLists.txt | 7 + recipes/raylib/all/conandata.yml | 15 + recipes/raylib/all/conanfile.py | 150 + .../0001-3.5.0-enable-cmake-build.patch | 123 + .../0001-4.0.0-enable-cmake-build.patch | 38 + .../raylib/all/test_package/CMakeLists.txt | 10 + recipes/raylib/all/test_package/conanfile.py | 17 + .../raylib/all/test_package/test_package.c | 12 + recipes/raylib/config.yml | 5 + recipes/re2/all/conandata.yml | 34 + recipes/re2/all/conanfile.py | 70 + recipes/re2/all/test_package/CMakeLists.txt | 8 + recipes/re2/all/test_package/conanfile.py | 26 + recipes/re2/all/test_package/test_package.cpp | 10 + .../re2/all/test_v1_package/CMakeLists.txt | 8 + recipes/re2/all/test_v1_package/conanfile.py | 17 + recipes/re2/config.yml | 23 + recipes/re2c/all/conandata.yml | 34 + recipes/re2c/all/conanfile.py | 95 + .../all/patches/0001-add-msvc_cl-sh.patch | 94 + .../2.0.3-0001-add-missing-include.patch | 11 + recipes/re2c/all/test_package/CMakeLists.txt | 11 + recipes/re2c/all/test_package/conanfile.py | 18 + recipes/re2c/all/test_package/syntax.re | 31 + recipes/re2c/config.yml | 11 + recipes/reactiveplusplus/all/conandata.yml | 7 + recipes/reactiveplusplus/all/conanfile.py | 87 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/reactiveplusplus/config.yml | 5 + recipes/read-excel/all/conandata.yml | 34 + recipes/read-excel/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 8 + .../read-excel/all/test_package/conanfile.py | 27 + .../read-excel/all/test_package/sample.xls | Bin 0 -> 6144 bytes .../all/test_package/test_package.cpp | 36 + .../all/test_v1_package/CMakeLists.txt | 6 + .../all/test_v1_package/conanfile.py | 18 + recipes/read-excel/config.yml | 23 + recipes/readerwriterqueue/all/conandata.yml | 10 + recipes/readerwriterqueue/all/conanfile.py | 40 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 24 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 15 + recipes/readerwriterqueue/config.yml | 7 + recipes/readline/all/conandata.yml | 7 + recipes/readline/all/conanfile.py | 97 + .../readline/all/test_package/CMakeLists.txt | 7 + .../readline/all/test_package/conanfile.py | 25 + .../readline/all/test_package/test_package.c | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../readline/all/test_v1_package/conanfile.py | 17 + recipes/readline/config.yml | 5 + recipes/readosm/all/conandata.yml | 9 + recipes/readosm/all/conanfile.py | 135 + .../readosm/all/patches/0001-fix-nmake.patch | 27 + .../readosm/all/test_package/CMakeLists.txt | 7 + recipes/readosm/all/test_package/conanfile.py | 26 + .../readosm/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../readosm/all/test_v1_package/conanfile.py | 17 + recipes/readosm/config.yml | 3 + recipes/recastnavigation/all/conandata.yml | 7 + recipes/recastnavigation/all/conanfile.py | 104 + .../all/patches/001_fix_shared_option.patch | 129 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/recastnavigation/config.yml | 3 + recipes/reckless/all/conandata.yml | 7 + recipes/reckless/all/conanfile.py | 84 + .../reckless/all/patches/0001-fix-cmake.patch | 48 + .../reckless/all/test_package/CMakeLists.txt | 8 + .../reckless/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../reckless/all/test_v1_package/conanfile.py | 17 + recipes/reckless/config.yml | 3 + recipes/rectanglebinpack/all/CMakeLists.txt | 9 + recipes/rectanglebinpack/all/conandata.yml | 10 + recipes/rectanglebinpack/all/conanfile.py | 78 + .../all/patches/0001_fix_win32_build.patch | 11 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 47 + recipes/rectanglebinpack/config.yml | 3 + recipes/rectpack2d/all/conandata.yml | 4 + recipes/rectpack2d/all/conanfile.py | 60 + .../all/test_package/CMakeLists.txt | 12 + .../rectpack2d/all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 193 + recipes/rectpack2d/config.yml | 3 + recipes/redboltz-mqtt_cpp/all/conandata.yml | 4 + recipes/redboltz-mqtt_cpp/all/conanfile.py | 64 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 14 + recipes/redboltz-mqtt_cpp/config.yml | 3 + recipes/redis-plus-plus/all/conandata.yml | 40 + recipes/redis-plus-plus/all/conanfile.py | 153 + .../1.2.1-0001-fix-hiredis-consumption.patch | 62 + .../1.2.1-0002-cmake-minimum-required.patch | 15 + .../1.2.3-0001-fix-conan-cmake-package.patch | 21 + ....3.2-0001-fix-dependencies-injection.patch | 39 + ....3.3-0001-fix-dependencies-injection.patch | 39 + ....3.7-0001-fix-dependencies-injection.patch | 41 + .../all/test_package/CMakeLists.txt | 18 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/redis-plus-plus/config.yml | 11 + recipes/redradist-icc/all/CMakeLists.txt | 7 + recipes/redradist-icc/all/conandata.yml | 4 + recipes/redradist-icc/all/conanfile.py | 115 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/example.cpp | 14 + recipes/redradist-icc/config.yml | 3 + recipes/refl-cpp/all/conandata.yml | 14 + recipes/refl-cpp/all/conanfile.py | 71 + .../0.12.1-0001-remove-memory-fwd.patch | 27 + .../refl-cpp/all/test_package/CMakeLists.txt | 8 + .../refl-cpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 63 + .../all/test_v1_package/CMakeLists.txt | 8 + .../refl-cpp/all/test_v1_package/conanfile.py | 17 + recipes/refl-cpp/config.yml | 5 + recipes/replxx/all/CMakeLists.txt | 7 + recipes/replxx/all/conandata.yml | 10 + recipes/replxx/all/conanfile.py | 77 + .../replxx/all/test_package/CMakeLists.txt | 11 + recipes/replxx/all/test_package/conanfile.py | 17 + .../replxx/all/test_package/test_package.cpp | 26 + recipes/replxx/config.yml | 8 + recipes/resiprocate/all/conandata.yml | 4 + recipes/resiprocate/all/conanfile.py | 94 + .../all/test_package/CMakeLists.txt | 9 + .../resiprocate/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 71 + recipes/resiprocate/config.yml | 3 + recipes/resource_pool/all/conandata.yml | 4 + recipes/resource_pool/all/conanfile.py | 80 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../resource_pool/all/test_package/coro.cc | 36 + recipes/resource_pool/config.yml | 3 + recipes/restbed/all/conandata.yml | 12 + recipes/restbed/all/conanfile.py | 123 + .../all/patches/4.8-0001-cmake-conan.patch | 84 + .../4.8-0002-mingw-deprecated-fix.patch | 12 + .../restbed/all/test_package/CMakeLists.txt | 8 + recipes/restbed/all/test_package/conanfile.py | 30 + .../restbed/all/test_package/test_package.cpp | 40 + .../all/test_v1_package/CMakeLists.txt | 8 + .../restbed/all/test_v1_package/conanfile.py | 17 + recipes/restbed/config.yml | 3 + recipes/restinio/all/conandata.yml | 37 + recipes/restinio/all/conanfile.py | 127 + .../restinio/all/test_package/CMakeLists.txt | 8 + .../restinio/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 11 + .../restinio/all/test_v1_package/conanfile.py | 16 + recipes/restinio/config.yml | 25 + recipes/rg-etc1/all/CMakeLists.txt | 22 + recipes/rg-etc1/all/conandata.yml | 4 + recipes/rg-etc1/all/conanfile.py | 74 + .../rg-etc1/all/test_package/CMakeLists.txt | 8 + recipes/rg-etc1/all/test_package/conanfile.py | 17 + .../rg-etc1/all/test_package/test_package.cpp | 9 + recipes/rg-etc1/config.yml | 3 + recipes/rgbcx/all/conandata.yml | 4 + recipes/rgbcx/all/conanfile.py | 34 + recipes/rgbcx/all/test_package/CMakeLists.txt | 9 + recipes/rgbcx/all/test_package/conanfile.py | 16 + .../rgbcx/all/test_package/test_package.cpp | 8 + recipes/rgbcx/config.yml | 3 + recipes/ring-span-lite/all/conandata.yml | 10 + recipes/ring-span-lite/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/ring-span-lite/config.yml | 7 + recipes/rmlui/3.3/CMakeLists.txt | 7 + recipes/rmlui/3.3/conandata.yml | 4 + recipes/rmlui/3.3/conanfile.py | 150 + recipes/rmlui/3.3/test_package/CMakeLists.txt | 9 + recipes/rmlui/3.3/test_package/conanfile.py | 18 + recipes/rmlui/3.3/test_package/example.cpp | 7 + recipes/rmlui/4.x/CMakeLists.txt | 7 + recipes/rmlui/4.x/conandata.yml | 37 + recipes/rmlui/4.x/conanfile.py | 149 + .../4.0-fix-cmake-targets-and-config.patch | 88 + .../4.1-fix-cmake-targets-and-config.patch | 82 + .../4.2-fix-cmake-targets-and-config.patch | 82 + .../4.3-fix-cmake-targets-and-config.patch | 82 + .../4.4-fix-cmake-targets-and-config.patch | 82 + recipes/rmlui/4.x/test_package/CMakeLists.txt | 8 + recipes/rmlui/4.x/test_package/conanfile.py | 29 + recipes/rmlui/4.x/test_package/example.cpp | 28 + .../rmlui/4.x/test_v1_package/CMakeLists.txt | 9 + .../rmlui/4.x/test_v1_package/conanfile.py | 18 + recipes/rmlui/config.yml | 13 + recipes/roaring/all/conandata.yml | 46 + recipes/roaring/all/conanfile.py | 90 + .../roaring/all/test_package/CMakeLists.txt | 11 + recipes/roaring/all/test_package/conanfile.py | 26 + .../roaring/all/test_package/test_package.cpp | 198 + .../all/test_v1_package/CMakeLists.txt | 8 + .../roaring/all/test_v1_package/conanfile.py | 17 + recipes/roaring/config.yml | 31 + recipes/robin-hood-hashing/all/conandata.yml | 39 + recipes/robin-hood-hashing/all/conanfile.py | 52 + ...11.1-0001-fix-missing-limits-include.patch | 10 + ....7.0-0001-fix-missing-limits-include.patch | 10 + ....8.0-0001-fix-missing-limits-include.patch | 10 + ....9.1-0001-fix-missing-limits-include.patch | 10 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/robin-hood-hashing/config.yml | 15 + recipes/rocksdb/all/CMakeLists.txt | 7 + recipes/rocksdb/all/conandata.yml | 38 + recipes/rocksdb/all/conanfile.py | 241 ++ ...jemalloc-according-to-conan-packages.patch | 9 + ...jemalloc-according-to-conan-packages.patch | 14 + ...jemalloc-according-to-conan-packages.patch | 14 + ...jemalloc-according-to-conan-packages.patch | 14 + ...jemalloc-according-to-conan-packages.patch | 14 + ...jemalloc-according-to-conan-packages.patch | 14 + .../rocksdb/all/test_package/CMakeLists.txt | 18 + recipes/rocksdb/all/test_package/conanfile.py | 22 + .../rocksdb/all/test_package/test_package.cpp | 16 + .../test_package/test_package_stable_abi.cpp | 26 + recipes/rocksdb/config.yml | 13 + recipes/rotor/all/CMakeLists.txt | 7 + recipes/rotor/all/conandata.yml | 13 + recipes/rotor/all/conanfile.py | 125 + recipes/rotor/all/test_package/CMakeLists.txt | 12 + recipes/rotor/all/test_package/conanfile.py | 18 + .../rotor/all/test_package/test_package.cpp | 58 + recipes/rotor/config.yml | 9 + recipes/rpclib/all/CMakeLists.txt | 9 + recipes/rpclib/all/conandata.yml | 4 + recipes/rpclib/all/conanfile.py | 87 + .../rpclib/all/test_package/CMakeLists.txt | 11 + recipes/rpclib/all/test_package/conanfile.py | 15 + recipes/rpclib/all/test_package/example.cpp | 32 + recipes/rpclib/config.yml | 3 + recipes/rply/all/CMakeLists.txt | 18 + recipes/rply/all/conandata.yml | 4 + recipes/rply/all/conanfile.py | 62 + recipes/rply/all/test_package/CMakeLists.txt | 7 + recipes/rply/all/test_package/conanfile.py | 27 + recipes/rply/all/test_package/test_package.c | 47 + recipes/rply/all/test_package/triangle.ply | 15 + .../rply/all/test_v1_package/CMakeLists.txt | 8 + recipes/rply/all/test_v1_package/conanfile.py | 18 + recipes/rply/config.yml | 3 + recipes/rtm/all/conandata.yml | 16 + recipes/rtm/all/conanfile.py | 28 + recipes/rtm/all/test_package/CMakeLists.txt | 9 + recipes/rtm/all/test_package/conanfile.py | 17 + recipes/rtm/all/test_package/test_package.cpp | 35 + recipes/rtm/config.yml | 11 + recipes/rtmidi/all/conandata.yml | 14 + recipes/rtmidi/all/conanfile.py | 108 + ...-add-a-separate-licence-file-0b5d67c.patch | 76 + ...tmidiconfig-install-location-da51f21.patch | 13 + .../4.0.0-0003-relocatable-macos.patch | 10 + .../rtmidi/all/test_package/CMakeLists.txt | 9 + recipes/rtmidi/all/test_package/conanfile.py | 26 + .../rtmidi/all/test_package/test_package.cpp | 9 + .../rtmidi/all/test_v1_package/CMakeLists.txt | 8 + .../rtmidi/all/test_v1_package/conanfile.py | 19 + recipes/rtmidi/config.yml | 5 + recipes/rttr/all/conandata.yml | 8 + recipes/rttr/all/conanfile.py | 106 + .../patches/001_fix_build_without_RTTI.patch | 23 + .../patches/002_fix_license_installer.patch | 16 + recipes/rttr/all/test_package/CMakeLists.txt | 12 + recipes/rttr/all/test_package/conanfile.py | 26 + .../rttr/all/test_package/test_package.cpp | 14 + .../rttr/all/test_v1_package/CMakeLists.txt | 8 + recipes/rttr/all/test_v1_package/conanfile.py | 17 + recipes/rttr/config.yml | 3 + recipes/ruby/all/conandata.yml | 14 + recipes/ruby/all/conanfile.py | 196 + .../all/patches/0001-darwin-includedir.patch | 14 + .../ruby/all/patches/0002-remove-fpic.patch | 16 + .../ruby/all/patches/0003-openssl-ext.patch | 13 + .../all/patches/0004-windows-cflags.patch | 14 + recipes/ruby/all/test_package/CMakeLists.txt | 11 + recipes/ruby/all/test_package/conanfile.py | 21 + recipes/ruby/all/test_package/test_package.c | 11 + recipes/ruby/config.yml | 3 + recipes/runtimeqml/all/CMakeLists.txt | 34 + recipes/runtimeqml/all/conandata.yml | 7 + recipes/runtimeqml/all/conanfile.py | 105 + .../all/test_package/CMakeLists.txt | 8 + .../runtimeqml/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/runtimeqml/config.yml | 5 + recipes/ruy/all/conandata.yml | 4 + recipes/ruy/all/conanfile.py | 146 + recipes/ruy/all/test_package/CMakeLists.txt | 10 + recipes/ruy/all/test_package/conanfile.py | 25 + recipes/ruy/all/test_package/test_package.cpp | 27 + .../ruy/all/test_v1_package/CMakeLists.txt | 11 + recipes/ruy/all/test_v1_package/conanfile.py | 17 + .../ruy/all/test_v1_package/test_package.cpp | 27 + recipes/ruy/config.yml | 3 + recipes/rvo2/all/CMakeLists.txt | 11 + recipes/rvo2/all/conandata.yml | 4 + recipes/rvo2/all/conanfile.py | 74 + recipes/rvo2/all/test_package/CMakeLists.txt | 8 + recipes/rvo2/all/test_package/conanfile.py | 17 + .../rvo2/all/test_package/test_package.cpp | 25 + recipes/rvo2/config.yml | 3 + recipes/rxcpp/all/conandata.yml | 7 + recipes/rxcpp/all/conanfile.py | 40 + recipes/rxcpp/all/test_package/CMakeLists.txt | 8 + recipes/rxcpp/all/test_package/conanfile.py | 25 + .../rxcpp/all/test_package/test_package.cpp | 6 + .../rxcpp/all/test_v1_package/CMakeLists.txt | 11 + .../rxcpp/all/test_v1_package/conanfile.py | 17 + recipes/rxcpp/config.yml | 5 + recipes/s2let/all/CMakeLists.txt | 7 + recipes/s2let/all/conandata.yml | 4 + recipes/s2let/all/conanfile.py | 81 + recipes/s2let/all/test_package/CMakeLists.txt | 11 + recipes/s2let/all/test_package/conanfile.py | 17 + recipes/s2let/all/test_package/example.c | 9 + recipes/s2let/config.yml | 3 + recipes/s2n/all/CMakeLists.txt | 11 + recipes/s2n/all/conandata.yml | 27 + recipes/s2n/all/conanfile.py | 104 + .../all/patches/1.0.11/001-try-compile.patch | 115 + .../all/patches/1.1.0/001-try-compile.patch | 115 + recipes/s2n/all/test_package/CMakeLists.txt | 7 + recipes/s2n/all/test_package/conanfile.py | 26 + recipes/s2n/all/test_package/test_package.c | 8 + .../s2n/all/test_v1_package/CMakeLists.txt | 8 + recipes/s2n/all/test_v1_package/conanfile.py | 17 + recipes/s2n/config.yml | 15 + recipes/safeint/all/conandata.yml | 13 + recipes/safeint/all/conanfile.py | 44 + .../safeint/all/test_package/CMakeLists.txt | 8 + recipes/safeint/all/test_package/conanfile.py | 26 + .../safeint/all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../safeint/all/test_v1_package/conanfile.py | 17 + recipes/safeint/config.yml | 9 + recipes/sail/all/conandata.yml | 9 + recipes/sail/all/conanfile.py | 197 + .../patches/0.9.0-rc2-avif-find-package.patch | 22 + recipes/sail/all/test_package/CMakeLists.txt | 20 + recipes/sail/all/test_package/bmp.bmp | Bin 0 -> 246 bytes recipes/sail/all/test_package/conanfile.py | 28 + recipes/sail/all/test_package/test_package.c | 26 + .../sail/all/test_package/test_package.cpp | 28 + .../sail/all/test_v1_package/CMakeLists.txt | 8 + recipes/sail/all/test_v1_package/bmp.bmp | Bin 0 -> 246 bytes recipes/sail/all/test_v1_package/conanfile.py | 20 + recipes/sail/config.yml | 3 + recipes/samarium/all/conandata.yml | 28 + recipes/samarium/all/conanfile.py | 86 + .../1.0.0-Grid.hpp-include-vector.patch | 12 + .../1.0.0-RandomGenerator.cpp-link.patch | 22 + .../1.0.0-RandomGenerator.hpp-link.patch | 34 + .../all/patches/1.0.0-updated-cmake.patch | 39 + .../samarium/all/test_package/CMakeLists.txt | 8 + .../samarium/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 8 + recipes/samarium/config.yml | 5 + recipes/sassc/all/conandata.yml | 7 + recipes/sassc/all/conanfile.py | 98 + recipes/sassc/all/test_package/conanfile.py | 9 + recipes/sassc/config.yml | 5 + recipes/sbp/all/CMakeLists.txt | 7 + recipes/sbp/all/conandata.yml | 15 + recipes/sbp/all/conanfile.py | 70 + recipes/sbp/all/test_package/CMakeLists.txt | 10 + recipes/sbp/all/test_package/conanfile.py | 17 + recipes/sbp/all/test_package/test_package.c | 14 + recipes/sbp/config.yml | 5 + recipes/scc/all/CMakeLists.txt | 7 + recipes/scc/all/conandata.yml | 4 + recipes/scc/all/conanfile.py | 89 + recipes/scc/all/test_package/CMakeLists.txt | 10 + recipes/scc/all/test_package/conanfile.py | 18 + recipes/scc/all/test_package/example.cpp | 7 + recipes/scc/config.yml | 3 + recipes/scdoc/all/conandata.yml | 4 + recipes/scdoc/all/conanfile.py | 79 + recipes/scdoc/all/test_package/conanfile.py | 10 + .../scdoc/all/test_package/test_package.1.scd | 9 + recipes/scdoc/config.yml | 3 + recipes/scnlib/all/conandata.yml | 35 + recipes/scnlib/all/conanfile.py | 140 + .../0.4-0001-install-dll-windows.patch | 10 + .../1.0-0001-install-dll-windows.patch | 12 + .../1.0-0002-remove-header-only-target.patch | 18 + .../patches/1.0-0003-use-conan-package.patch | 35 + .../1.1.2-0001-install-dll-windows.patch | 12 + ...1.1.2-0002-remove-header-only-target.patch | 18 + .../patches/1.1.2-0003-fix-link-keyword.patch | 22 + .../scnlib/all/test_package/CMakeLists.txt | 12 + recipes/scnlib/all/test_package/conanfile.py | 26 + .../scnlib/all/test_package/test_package.cpp | 9 + .../scnlib/all/test_v1_package/CMakeLists.txt | 8 + .../scnlib/all/test_v1_package/conanfile.py | 17 + recipes/scnlib/config.yml | 7 + recipes/scons/all/conandata.yml | 10 + recipes/scons/all/conanfile.py | 104 + recipes/scons/all/test_package/SConscript | 17 + recipes/scons/all/test_package/SConstruct | 6 + recipes/scons/all/test_package/conanfile.py | 43 + recipes/scons/all/test_package/test_package.c | 7 + recipes/scons/config.yml | 7 + recipes/scope-lite/all/conandata.yml | 7 + recipes/scope-lite/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 8 + .../scope-lite/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/scope-lite/config.yml | 5 + recipes/screen_capture_lite/all/conandata.yml | 22 + recipes/screen_capture_lite/all/conanfile.py | 144 + .../all/patches/17.1.439-0001-fix-cmake.patch | 69 + .../all/patches/17.1.462-0001-fix-cmake.patch | 66 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/screen_capture_lite/config.yml | 9 + recipes/sdbus-cpp/all/conandata.yml | 25 + recipes/sdbus-cpp/all/conanfile.py | 137 + ...p-Add-missing-EXPAT-include-dirs-136.patch | 35 + ...2-correct-readme-cpack-resource-path.patch | 20 + .../sdbus-cpp/all/test_package/CMakeLists.txt | 7 + .../sdbus-cpp/all/test_package/conanfile.py | 27 + .../sdbus-cpp/all/test_package/example.cpp | 15 + .../sdbus-cpp/all/test_pkgconf/CMakeLists.txt | 8 + .../sdbus-cpp/all/test_pkgconf/conanfile.py | 36 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 21 + .../all/test_v1_pkgconf/CMakeLists.txt | 11 + .../all/test_v1_pkgconf/conanfile.py | 24 + recipes/sdbus-cpp/config.yml | 9 + recipes/sdf/all/conandata.yml | 4 + recipes/sdf/all/conanfile.py | 41 + recipes/sdf/all/test_package/CMakeLists.txt | 8 + recipes/sdf/all/test_package/conanfile.py | 28 + recipes/sdf/all/test_package/test.png | Bin 0 -> 8484 bytes recipes/sdf/all/test_package/test_package.c | 37 + .../sdf/all/test_v1_package/CMakeLists.txt | 11 + recipes/sdf/all/test_v1_package/conanfile.py | 21 + recipes/sdf/config.yml | 3 + recipes/sdl/all/conandata.yml | 21 + recipes/sdl/all/conanfile.py | 449 +++ .../all/patches/0001-fix-cmake-ios-tvos.patch | 26 + .../all/patches/0002-mingw-improvements.patch | 27 + ...2.0.14-wayland-scanner-buildrequires.patch | 23 + ...2.0.16-wayland-scanner-buildrequires.patch | 24 + recipes/sdl/all/patches/0004-2.0.20-ndk.patch | 26 + recipes/sdl/all/test_package/CMakeLists.txt | 13 + recipes/sdl/all/test_package/conanfile.py | 32 + recipes/sdl/all/test_package/test_package.cpp | 9 + .../sdl/all/test_v1_package/CMakeLists.txt | 15 + recipes/sdl/all/test_v1_package/conanfile.py | 18 + .../sdl/all/test_v1_package/test_package.cpp | 9 + recipes/sdl/config.yml | 11 + recipes/sdl_image/all/CMakeLists.txt | 118 + recipes/sdl_image/all/conandata.yml | 4 + recipes/sdl_image/all/conanfile.py | 174 + .../sdl_image/all/test_package/CMakeLists.txt | 11 + .../sdl_image/all/test_package/conanfile.py | 26 + .../sdl_image/all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/sdl_image/config.yml | 3 + recipes/sdl_mixer/all/CMakeLists.txt | 167 + recipes/sdl_mixer/all/conandata.yml | 4 + recipes/sdl_mixer/all/conanfile.py | 144 + .../sdl_mixer/all/test_package/CMakeLists.txt | 11 + .../sdl_mixer/all/test_package/conanfile.py | 17 + .../sdl_mixer/all/test_package/test_package.c | 42 + recipes/sdl_mixer/config.yml | 3 + recipes/sdl_net/all/CMakeLists.txt | 33 + recipes/sdl_net/all/conandata.yml | 4 + recipes/sdl_net/all/conanfile.py | 85 + .../sdl_net/all/test_package/CMakeLists.txt | 7 + recipes/sdl_net/all/test_package/conanfile.py | 27 + .../sdl_net/all/test_package/test_package.c | 65 + .../all/test_v1_package/CMakeLists.txt | 8 + .../sdl_net/all/test_v1_package/conanfile.py | 18 + recipes/sdl_net/config.yml | 3 + recipes/sdl_ttf/all/conandata.yml | 26 + recipes/sdl_ttf/all/conanfile.py | 129 + .../2.0.15-0001-cmake-fix-link-target.patch | 19 + .../2.0.18-0001-cmake-fix-link-target.patch | 17 + .../all/patches/2.0.18-0002-fix-android.patch | 11 + .../2.20.1-0001-fix-cmake-min-version.patch | 11 + .../sdl_ttf/all/test_package/CMakeLists.txt | 11 + .../all/test_package/OpenSans-Bold.ttf | Bin 0 -> 224592 bytes recipes/sdl_ttf/all/test_package/conanfile.py | 27 + .../sdl_ttf/all/test_package/test_package.c | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../sdl_ttf/all/test_v1_package/conanfile.py | 18 + recipes/sdl_ttf/config.yml | 7 + recipes/seadex-essentials/all/conandata.yml | 5 + recipes/seadex-essentials/all/conanfile.py | 99 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 31 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/seadex-essentials/config.yml | 3 + recipes/seasocks/all/CMakeLists.txt | 7 + recipes/seasocks/all/conandata.yml | 7 + recipes/seasocks/all/conanfile.py | 124 + .../seasocks/all/test_package/CMakeLists.txt | 13 + .../seasocks/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../seasocks/all/test_v1_package/conanfile.py | 18 + recipes/seasocks/config.yml | 5 + recipes/semimap/all/conandata.yml | 4 + recipes/semimap/all/conanfile.py | 64 + .../semimap/all/test_package/CMakeLists.txt | 8 + recipes/semimap/all/test_package/conanfile.py | 25 + .../semimap/all/test_package/test_package.cpp | 43 + .../all/test_v1_package/CMakeLists.txt | 8 + .../semimap/all/test_v1_package/conanfile.py | 18 + recipes/semimap/config.yml | 3 + recipes/semver.c/all/CMakeLists.txt | 17 + recipes/semver.c/all/conandata.yml | 4 + recipes/semver.c/all/conanfile.py | 62 + .../semver.c/all/test_package/CMakeLists.txt | 7 + .../semver.c/all/test_package/conanfile.py | 26 + .../semver.c/all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 8 + .../semver.c/all/test_v1_package/conanfile.py | 17 + recipes/semver.c/config.yml | 3 + recipes/sentry-breakpad/all/CMakeLists.txt | 4 + recipes/sentry-breakpad/all/conandata.yml | 16 + recipes/sentry-breakpad/all/conanfile.py | 173 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 30 + .../all/test_package/test_package.cpp | 85 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/sentry-breakpad/config.yml | 11 + recipes/sentry-crashpad/all/conandata.yml | 13 + recipes/sentry-crashpad/all/conanfile.py | 223 ++ ...0.2.6-0001-missing-installed-headers.patch | 66 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 31 + .../all/test_package/test_package.cpp | 48 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 23 + recipes/sentry-crashpad/config.yml | 9 + recipes/sentry-native/all/conandata.yml | 19 + recipes/sentry-native/all/conanfile.py | 209 + .../all/patches/sentry-native-903c17a.patch | 34 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/sentry-native/config.yml | 9 + recipes/seqan/2.x.x/conandata.yml | 4 + recipes/seqan/2.x.x/conanfile.py | 56 + .../seqan/2.x.x/test_package/CMakeLists.txt | 9 + recipes/seqan/2.x.x/test_package/conanfile.py | 17 + .../seqan/2.x.x/test_package/test_package.cpp | 25 + recipes/seqan/config.yml | 3 + recipes/seqan3/all/conandata.yml | 4 + recipes/seqan3/all/conanfile.py | 65 + .../seqan3/all/test_package/CMakeLists.txt | 11 + recipes/seqan3/all/test_package/conanfile.py | 17 + .../seqan3/all/test_package/test_package.cpp | 15 + recipes/seqan3/config.yml | 3 + recipes/serd/all/conandata.yml | 7 + recipes/serd/all/conanfile.py | 100 + recipes/serd/all/test_package/CMakeLists.txt | 7 + recipes/serd/all/test_package/conanfile.py | 26 + recipes/serd/all/test_package/test_package.c | 6 + .../serd/all/test_v1_package/CMakeLists.txt | 8 + recipes/serd/all/test_v1_package/conanfile.py | 17 + recipes/serd/config.yml | 5 + recipes/serdepp/all/conandata.yml | 4 + recipes/serdepp/all/conanfile.py | 99 + .../serdepp/all/test_package/CMakeLists.txt | 10 + recipes/serdepp/all/test_package/conanfile.py | 18 + .../serdepp/all/test_package/test_package.cpp | 24 + recipes/serdepp/config.yml | 3 + recipes/serf/all/CMakeLists.txt | 7 + recipes/serf/all/conandata.yml | 19 + recipes/serf/all/conanfile.py | 165 + .../patches/0001-1.3.9-scons-python3.patch | 22 + .../0002-1.3.9-scons-respect-flags.patch | 18 + .../all/patches/0003-1.3.9-scons-msvc.patch | 67 + .../0004-1.3.9-scons-python-spaces.patch | 17 + .../patches/0005-1.3.9-serf-openssl-3.x.patch | 30 + recipes/serf/all/test_package/CMakeLists.txt | 8 + recipes/serf/all/test_package/conanfile.py | 18 + recipes/serf/all/test_package/test_package.c | 10 + recipes/serf/config.yml | 3 + recipes/serial/all/CMakeLists.txt | 16 + recipes/serial/all/Findcatkin.cmake | 9 + recipes/serial/all/conandata.yml | 4 + recipes/serial/all/conanfile.py | 68 + .../serial/all/test_package/CMakeLists.txt | 10 + recipes/serial/all/test_package/conanfile.py | 16 + .../serial/all/test_package/test_package.cpp | 23 + recipes/serial/config.yml | 3 + recipes/sfml/all/conandata.yml | 22 + recipes/sfml/all/conanfile.py | 290 ++ .../patches/0001-cmake-robust-find-deps.patch | 89 + .../patches/0002-allow-non-x86-64-macos.patch | 11 + .../all/patches/0003-allow-shared-MT.patch | 11 + recipes/sfml/all/patches/0004-fix-ios.patch | 26 + .../all/patches/0005-remove-auto-ptr.patch | 43 + recipes/sfml/all/test_package/CMakeLists.txt | 30 + recipes/sfml/all/test_package/conanfile.py | 34 + .../sfml/all/test_package/test_package.cpp | 42 + .../sfml/all/test_v1_package/CMakeLists.txt | 8 + recipes/sfml/all/test_v1_package/conanfile.py | 21 + recipes/sfml/config.yml | 3 + recipes/shaderc/all/CMakeLists.txt | 7 + recipes/shaderc/all/conandata.yml | 16 + recipes/shaderc/all/conanfile.py | 131 + .../all/patches/2019.0/fix-cmake.patch | 402 ++ .../shaderc/all/patches/2019.0/fix-spvc.patch | 24 + .../all/patches/2021.1/fix-cmake.patch | 324 ++ .../shaderc/all/test_package/CMakeLists.txt | 21 + recipes/shaderc/all/test_package/conanfile.py | 32 + .../all/test_package/test_package.vert | 8 + .../all/test_package/test_package_shaderc.c | 8 + .../all/test_package/test_package_shaderc.cpp | 8 + .../all/test_package/test_package_spvc.c | 8 + .../all/test_package/test_package_spvc.cpp | 8 + recipes/shaderc/config.yml | 5 + recipes/shapelib/all/conandata.yml | 14 + recipes/shapelib/all/conanfile.py | 80 + .../patches/0001-cmake-minimum-required.patch | 23 + .../all/patches/0002-build-testing.patch | 57 + .../shapelib/all/test_package/CMakeLists.txt | 7 + .../shapelib/all/test_package/conanfile.py | 26 + .../shapelib/all/test_package/test_package.c | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../shapelib/all/test_v1_package/conanfile.py | 17 + recipes/shapelib/config.yml | 3 + recipes/shield/all/conandata.yml | 13 + recipes/shield/all/conanfile.py | 43 + .../shield/all/test_package/CMakeLists.txt | 6 + recipes/shield/all/test_package/conanfile.py | 25 + .../shield/all/test_package/test_package.cpp | 9 + .../shield/all/test_v1_package/CMakeLists.txt | 8 + .../shield/all/test_v1_package/conanfile.py | 17 + recipes/shield/config.yml | 9 + recipes/si/all/CMakeLists.txt | 7 + recipes/si/all/conandata.yml | 28 + recipes/si/all/conanfile.py | 74 + recipes/si/all/test_package/CMakeLists.txt | 11 + recipes/si/all/test_package/conanfile.py | 18 + .../si/all/test_package/si_package_test.cpp | 17 + recipes/si/config.yml | 19 + recipes/sigslot/all/conandata.yml | 10 + recipes/sigslot/all/conanfile.py | 84 + .../sigslot/all/test_package/CMakeLists.txt | 8 + recipes/sigslot/all/test_package/conanfile.py | 26 + .../sigslot/all/test_package/test_package.cpp | 44 + .../all/test_v1_package/CMakeLists.txt | 8 + .../sigslot/all/test_v1_package/conanfile.py | 17 + recipes/sigslot/config.yml | 7 + recipes/simdjson/all/conandata.yml | 40 + recipes/simdjson/all/conanfile.py | 139 + .../simdjson/all/test_package/CMakeLists.txt | 8 + .../simdjson/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 8 + .../simdjson/all/test_v1_package/conanfile.py | 17 + recipes/simdjson/config.yml | 27 + recipes/simdutf/all/conandata.yml | 78 + recipes/simdutf/all/conanfile.py | 82 + .../all/patches/1.0.1-0001-fix-cmake.patch | 39 + .../patches/1.0.1-0002-remove-static.patch | 13 + .../all/patches/2.0.3-0001-fix-cmake.patch | 23 + .../2.0.6-0002-add-workaround-gcc9.patch | 42 + .../simdutf/all/test_package/CMakeLists.txt | 8 + recipes/simdutf/all/test_package/conanfile.py | 25 + .../simdutf/all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 10 + .../simdutf/all/test_v1_package/conanfile.py | 18 + recipes/simdutf/config.yml | 21 + .../simple-websocket-server/all/conandata.yml | 10 + .../simple-websocket-server/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 13 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 151 + recipes/simple-websocket-server/config.yml | 8 + recipes/simple-yaml/all/conandata.yml | 4 + recipes/simple-yaml/all/conanfile.py | 74 + .../all/test_package/CMakeLists.txt | 16 + .../simple-yaml/all/test_package/conanfile.py | 17 + .../simple-yaml/all/test_package/src/test.cpp | 21 + recipes/simple-yaml/config.yml | 3 + recipes/sjson-cpp/all/conandata.yml | 13 + recipes/sjson-cpp/all/conanfile.py | 34 + .../sjson-cpp/all/test_package/CMakeLists.txt | 11 + .../sjson-cpp/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 17 + recipes/sjson-cpp/config.yml | 9 + recipes/skyr-url/all/CMakeLists.txt | 9 + recipes/skyr-url/all/conandata.yml | 15 + recipes/skyr-url/all/conanfile.py | 134 + .../all/patches/1.12.0-0001-fix-cmake.patch | 38 + .../all/patches/1.13.0-0001-fix-cmake.patch | 38 + .../skyr-url/all/test_package/CMakeLists.txt | 11 + .../skyr-url/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 10 + recipes/skyr-url/config.yml | 5 + recipes/sleef/all/CMakeLists.txt | 7 + recipes/sleef/all/conandata.yml | 4 + recipes/sleef/all/conanfile.py | 98 + recipes/sleef/all/test_package/CMakeLists.txt | 8 + recipes/sleef/all/test_package/conanfile.py | 17 + recipes/sleef/all/test_package/test_package.c | 8 + recipes/sleef/config.yml | 3 + recipes/sml/all/conandata.yml | 13 + recipes/sml/all/conanfile.py | 70 + .../all/patches/0001-fix-clang12-error.patch | 14 + recipes/sml/all/test_package/CMakeLists.txt | 8 + recipes/sml/all/test_package/conanfile.py | 26 + recipes/sml/all/test_package/test_package.cpp | 95 + .../sml/all/test_v1_package/CMakeLists.txt | 11 + recipes/sml/all/test_v1_package/conanfile.py | 17 + recipes/sml/config.yml | 7 + recipes/snappy/all/conandata.yml | 40 + recipes/snappy/all/conanfile.py | 94 + .../1.1.10-0001-fix-inlining-failure.patch | 13 + ....10-0003-fix-clobber-list-older-llvm.patch | 13 + .../1.1.9-0001-fix-inlining-failure.patch | 14 + .../all/patches/1.1.9-0002-no-Werror.patch | 12 + ...1.9-0003-fix-clobber-list-older-llvm.patch | 12 + .../patches/1.1.9-0004-rtti-by-default.patch | 20 + .../snappy/all/test_package/CMakeLists.txt | 11 + recipes/snappy/all/test_package/conanfile.py | 28 + .../snappy/all/test_package/test_package.c | 19 + .../snappy/all/test_package/test_package.cpp | 16 + .../snappy/all/test_v1_package/CMakeLists.txt | 8 + .../snappy/all/test_v1_package/conanfile.py | 19 + recipes/snappy/config.yml | 9 + recipes/snowhouse/all/conandata.yml | 4 + recipes/snowhouse/all/conanfile.py | 28 + .../snowhouse/all/test_package/CMakeLists.txt | 9 + .../snowhouse/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 23 + recipes/snowhouse/config.yml | 3 + recipes/so5extra/all/conandata.yml | 16 + recipes/so5extra/all/conanfile.py | 70 + .../so5extra/all/test_package/CMakeLists.txt | 11 + .../so5extra/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 69 + recipes/so5extra/config.yml | 11 + recipes/sobjectizer/all/CMakeLists.txt | 7 + recipes/sobjectizer/all/conandata.yml | 29 + recipes/sobjectizer/all/conanfile.py | 114 + .../all/test_package/CMakeLists.txt | 15 + .../sobjectizer/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 43 + recipes/sobjectizer/config.yml | 19 + recipes/soci/all/conandata.yml | 9 + recipes/soci/all/conanfile.py | 217 + ...-INSTALL_NAME_DIR-for-relocatable-li.patch | 39 + recipes/soci/all/test_package/CMakeLists.txt | 12 + recipes/soci/all/test_package/conanfile.py | 25 + .../soci/all/test_package/test_package.cpp | 11 + .../soci/all/test_v1_package/CMakeLists.txt | 8 + recipes/soci/all/test_v1_package/conanfile.py | 17 + recipes/soci/config.yml | 3 + recipes/sofa/all/CMakeLists.txt | 24 + recipes/sofa/all/conandata.yml | 13 + recipes/sofa/all/conanfile.py | 73 + recipes/sofa/all/test_package/CMakeLists.txt | 7 + recipes/sofa/all/test_package/conanfile.py | 26 + recipes/sofa/all/test_package/test_package.c | 10 + .../sofa/all/test_v1_package/CMakeLists.txt | 8 + recipes/sofa/all/test_v1_package/conanfile.py | 17 + recipes/sofa/config.yml | 9 + recipes/sokol/all/conandata.yml | 4 + recipes/sokol/all/conanfile.py | 38 + recipes/sokol/all/test_package/CMakeLists.txt | 7 + recipes/sokol/all/test_package/conanfile.py | 26 + recipes/sokol/all/test_package/test_package.c | 10 + .../sokol/all/test_v1_package/CMakeLists.txt | 10 + .../sokol/all/test_v1_package/conanfile.py | 17 + recipes/sokol/config.yml | 3 + recipes/sol2/all/conandata.yml | 13 + recipes/sol2/all/conanfile.py | 117 + recipes/sol2/all/test_package/CMakeLists.txt | 13 + recipes/sol2/all/test_package/conanfile.py | 26 + .../sol2/all/test_package/test_package.cpp | 25 + .../sol2/all/test_v1_package/CMakeLists.txt | 7 + recipes/sol2/all/test_v1_package/conanfile.py | 17 + recipes/sol2/config.yml | 9 + recipes/sole/all/conandata.yml | 17 + recipes/sole/all/conanfile.py | 54 + .../patches/1.0.4-0001-fix-clang-error.patch | 30 + recipes/sole/all/test_package/CMakeLists.txt | 9 + recipes/sole/all/test_package/conanfile.py | 17 + .../sole/all/test_package/test_package.cpp | 26 + recipes/sole/config.yml | 7 + recipes/sophus/all/conandata.yml | 10 + recipes/sophus/all/conanfile.py | 62 + .../sophus/all/test_package/CMakeLists.txt | 8 + recipes/sophus/all/test_package/conanfile.py | 25 + .../sophus/all/test_package/test_package.cpp | 16 + .../sophus/all/test_v1_package/CMakeLists.txt | 11 + .../sophus/all/test_v1_package/conanfile.py | 17 + recipes/sophus/config.yml | 7 + recipes/soplex/all/conandata.yml | 4 + recipes/soplex/all/conanfile.py | 129 + .../soplex/all/test_package/CMakeLists.txt | 13 + recipes/soplex/all/test_package/conanfile.py | 26 + recipes/soplex/all/test_package/main.cpp | 26 + .../soplex/all/test_v1_package/CMakeLists.txt | 9 + .../soplex/all/test_v1_package/conanfile.py | 18 + recipes/soplex/config.yml | 3 + recipes/soundtouch/all/conandata.yml | 4 + recipes/soundtouch/all/conanfile.py | 113 + .../all/test_package/CMakeLists.txt | 8 + .../soundtouch/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/soundtouch/config.yml | 3 + recipes/source_location/all/conandata.yml | 10 + recipes/source_location/all/conanfile.py | 54 + .../all/test_package/CMakeLists.txt | 16 + .../all/test_package/conanfile.py | 17 + .../all/test_package/src/test.cpp | 8 + recipes/source_location/config.yml | 7 + recipes/soxr/all/conandata.yml | 15 + recipes/soxr/all/conanfile.py | 114 + .../0.1.3-0001-findpackage-openmp.patch | 15 + .../patches/0.1.3-0002-cmake-source-dir.patch | 12 + .../0.1.3-0003-relocatable-macos.patch | 18 + recipes/soxr/all/test_package/CMakeLists.txt | 16 + recipes/soxr/all/test_package/conanfile.py | 26 + .../soxr/all/test_package/test_package_core.c | 7 + .../soxr/all/test_package/test_package_lsr.c | 7 + .../soxr/all/test_v1_package/CMakeLists.txt | 10 + recipes/soxr/all/test_v1_package/conanfile.py | 15 + recipes/soxr/config.yml | 3 + recipes/span-lite/all/conandata.yml | 28 + recipes/span-lite/all/conanfile.py | 53 + .../span-lite/all/test_package/CMakeLists.txt | 7 + .../span-lite/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 25 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/span-lite/config.yml | 19 + recipes/spdlog/all/conandata.yml | 13 + recipes/spdlog/all/conanfile.py | 159 + .../spdlog/all/test_package/CMakeLists.txt | 12 + recipes/spdlog/all/test_package/conanfile.py | 32 + .../spdlog/all/test_package/test_package.cpp | 13 + .../spdlog/all/test_v1_package/CMakeLists.txt | 8 + .../spdlog/all/test_v1_package/conanfile.py | 18 + recipes/spdlog/config.yml | 9 + recipes/spectra/all/conandata.yml | 13 + recipes/spectra/all/conanfile.py | 58 + .../spectra/all/test_package/CMakeLists.txt | 12 + recipes/spectra/all/test_package/conanfile.py | 26 + .../spectra/all/test_package/test_package.cpp | 42 + .../all/test_v1_package/CMakeLists.txt | 8 + .../spectra/all/test_v1_package/conanfile.py | 17 + recipes/spectra/config.yml | 9 + recipes/spirv-cross/all/conandata.yml | 69 + recipes/spirv-cross/all/conanfile.py | 206 + .../0001-fix-bundle-install-20200403.patch | 11 + .../0001-fix-bundle-install-20210115.patch | 11 + ...0001-fix-bundle-install-cci.20210621.patch | 13 + .../all/patches/1.3.236.0-0001-fix-gcc5.patch | 14 + .../all/test_package/CMakeLists.txt | 12 + .../spirv-cross/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/spirv-cross/config.yml | 35 + recipes/spirv-headers/all/conandata.yml | 49 + recipes/spirv-headers/all/conanfile.py | 55 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 43 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/spirv-headers/config.yml | 33 + recipes/spirv-tools/all/conandata.yml | 22 + recipes/spirv-tools/all/conanfile.py | 289 ++ .../all/test_package/CMakeLists.txt | 24 + .../spirv-tools/all/test_package/conanfile.py | 29 + .../all/test_package/test_package.c | 31 + .../all/test_package/test_package.cpp | 65 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/spirv-tools/config.yml | 15 + recipes/spix/all/conandata.yml | 16 + recipes/spix/all/conanfile.py | 130 + .../all/patches/0001-use-conan-libs-0.4.patch | 10 + .../all/patches/0001-use-conan-libs-0.5.patch | 10 + recipes/spix/all/test_package/CMakeLists.txt | 9 + recipes/spix/all/test_package/conanfile.py | 26 + recipes/spix/all/test_package/test_spix.cpp | 30 + .../spix/all/test_v1_package/CMakeLists.txt | 6 + recipes/spix/all/test_v1_package/conanfile.py | 18 + recipes/spix/config.yml | 5 + .../all/CMakeLists.txt | 7 + .../all/conandata.yml | 4 + .../splunk-opentelemetry-cpp/all/conanfile.py | 83 + .../all/test_package/CMakeLists.txt | 13 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 22 + recipes/splunk-opentelemetry-cpp/config.yml | 3 + recipes/spscqueue/all/conandata.yml | 7 + recipes/spscqueue/all/conanfile.py | 55 + .../spscqueue/all/test_package/CMakeLists.txt | 9 + .../spscqueue/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 19 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 17 + recipes/spscqueue/config.yml | 5 + recipes/spy/all/conandata.yml | 7 + recipes/spy/all/conanfile.py | 71 + recipes/spy/all/test_package/CMakeLists.txt | 8 + recipes/spy/all/test_package/conanfile.py | 25 + recipes/spy/all/test_package/test_package.cpp | 12 + .../spy/all/test_v1_package/CMakeLists.txt | 11 + recipes/spy/all/test_v1_package/conanfile.py | 17 + recipes/spy/config.yml | 5 + recipes/sqlcipher/all/conandata.yml | 62 + recipes/sqlcipher/all/conanfile.py | 233 ++ .../all/patches/Makefile.in-v4.3.0.patch | 24 + .../all/patches/Makefile.in-v4.4.0.patch | 24 + .../all/patches/Makefile.in-v4.4.2.patch | 24 + .../all/patches/Makefile.in-v4.4.3.patch | 24 + .../all/patches/Makefile.in-v4.5.0.patch | 24 + .../all/patches/Makefile.in-v4.5.1.patch | 24 + .../all/patches/Makefile.msc-v4.3.0.patch | 161 + .../all/patches/Makefile.msc-v4.4.0.patch | 161 + .../all/patches/Makefile.msc-v4.4.2.patch | 161 + .../all/patches/Makefile.msc-v4.4.3.patch | 161 + .../all/patches/Makefile.msc-v4.5.0.patch | 161 + .../all/patches/Makefile.msc-v4.5.1.patch | 161 + .../all/patches/fix_configure-v4.3.0.patch | 20 + .../all/patches/fix_configure-v4.4.0.patch | 20 + .../all/patches/fix_configure-v4.4.2.patch | 20 + .../all/patches/fix_configure-v4.4.3.patch | 20 + .../all/patches/fix_configure-v4.5.0.patch | 20 + .../all/patches/fix_configure-v4.5.1.patch | 20 + .../sqlcipher/all/test_package/CMakeLists.txt | 10 + .../sqlcipher/all/test_package/conanfile.py | 25 + .../sqlcipher/all/test_package/test_package.c | 9 + recipes/sqlcipher/config.yml | 13 + recipes/sqlite3/all/CMakeLists.txt | 186 + recipes/sqlite3/all/conandata.yml | 37 + recipes/sqlite3/all/conanfile.py | 223 ++ .../sqlite3/all/test_package/CMakeLists.txt | 14 + recipes/sqlite3/all/test_package/conanfile.py | 26 + recipes/sqlite3/all/test_package/empty_vfs.c | 90 + .../sqlite3/all/test_package/test_package.c | 46 + .../all/test_v1_package/CMakeLists.txt | 8 + .../sqlite3/all/test_v1_package/conanfile.py | 18 + recipes/sqlite3/config.yml | 25 + recipes/sqlite_orm/all/conandata.yml | 25 + recipes/sqlite_orm/all/conanfile.py | 83 + .../0001-declare-is-upsert-clause.patch | 14 + .../all/test_package/CMakeLists.txt | 8 + .../sqlite_orm/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/sqlite_orm/config.yml | 13 + recipes/sqlitecpp/all/conandata.yml | 28 + recipes/sqlitecpp/all/conanfile.py | 138 + .../patches/2.4.0-0001-cmake-sqlite3.patch | 23 + .../all/patches/2.4.0-0002-mingw-flags.patch | 18 + .../patches/2.5.0-0001-cmake-sqlite3.patch | 25 + .../sqlitecpp/all/test_package/CMakeLists.txt | 8 + .../sqlitecpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/sqlitecpp/config.yml | 11 + .../all/CMakeLists.txt | 7 + .../all/conandata.yml | 14 + .../all/conanfile.py | 77 + .../all/patches/cmake-dependencies.patch | 28 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/TabSample.h | 250 ++ .../all/test_package/conanfile.py | 29 + .../all/test_package/test_package.cpp | 244 ++ recipes/sqlpp11-connector-sqlite3/config.yml | 5 + recipes/sqlpp11/all/conandata.yml | 13 + recipes/sqlpp11/all/conanfile.py | 71 + .../sqlpp11/all/test_package/CMakeLists.txt | 11 + recipes/sqlpp11/all/test_package/conanfile.py | 16 + recipes/sqlpp11/all/test_package/example.cpp | 6 + recipes/sqlpp11/config.yml | 9 + recipes/squirrel/all/conandata.yml | 16 + recipes/squirrel/all/conanfile.py | 113 + .../patches/3.1-fix-cmake-static-shared.patch | 94 + .../patches/3.2-fix-cmake-static-build.patch | 13 + .../squirrel/all/test_package/CMakeLists.txt | 12 + .../squirrel/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 48 + .../all/test_v1_package/CMakeLists.txt | 8 + .../squirrel/all/test_v1_package/conanfile.py | 18 + recipes/squirrel/config.yml | 5 + recipes/srt/all/CMakeLists.txt | 12 + recipes/srt/all/conandata.yml | 17 + recipes/srt/all/conanfile.py | 103 + .../all/patches/no-delayload-libeay32.patch | 15 + recipes/srt/all/test_package/CMakeLists.txt | 10 + recipes/srt/all/test_package/conanfile.py | 16 + recipes/srt/all/test_package/test_package.cpp | 41 + recipes/srt/config.yml | 9 + recipes/ssht/all/CMakeLists.txt | 7 + recipes/ssht/all/conandata.yml | 7 + recipes/ssht/all/conanfile.py | 59 + recipes/ssht/all/test_package/CMakeLists.txt | 11 + recipes/ssht/all/test_package/conanfile.py | 20 + recipes/ssht/all/test_package/example.c | 7 + recipes/ssht/config.yml | 5 + recipes/st_tree/all/conandata.yml | 7 + recipes/st_tree/all/conanfile.py | 42 + .../st_tree/all/test_package/CMakeLists.txt | 11 + recipes/st_tree/all/test_package/conanfile.py | 16 + .../st_tree/all/test_package/test_package.cpp | 19 + recipes/st_tree/config.yml | 5 + recipes/statslib/all/conandata.yml | 13 + recipes/statslib/all/conanfile.py | 51 + .../statslib/all/test_package/CMakeLists.txt | 8 + .../statslib/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../statslib/all/test_v1_package/conanfile.py | 18 + recipes/statslib/config.yml | 9 + recipes/status-code/all/conandata.yml | 4 + recipes/status-code/all/conanfile.py | 55 + .../all/test_package/CMakeLists.txt | 8 + .../status-code/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 18 + recipes/status-code/config.yml | 3 + recipes/status-value-lite/all/conandata.yml | 4 + recipes/status-value-lite/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/status-value-lite/config.yml | 3 + recipes/stb/all/conandata.yml | 13 + recipes/stb/all/conanfile.py | 67 + recipes/stb/all/test_package/CMakeLists.txt | 7 + recipes/stb/all/test_package/conanfile.py | 26 + recipes/stb/all/test_package/test_package.c | 153 + .../stb/all/test_v1_package/CMakeLists.txt | 8 + recipes/stb/all/test_v1_package/conanfile.py | 17 + recipes/stb/config.yml | 9 + recipes/stc/all/conandata.yml | 13 + recipes/stc/all/conanfile.py | 45 + recipes/stc/all/test_package/CMakeLists.txt | 13 + recipes/stc/all/test_package/conanfile.py | 26 + recipes/stc/all/test_package/test_package.c | 45 + .../stc/all/test_v1_package/CMakeLists.txt | 8 + recipes/stc/all/test_v1_package/conanfile.py | 17 + recipes/stc/config.yml | 9 + recipes/stduuid/all/conandata.yml | 10 + recipes/stduuid/all/conanfile.py | 79 + .../stduuid/all/test_package/CMakeLists.txt | 11 + recipes/stduuid/all/test_package/conanfile.py | 26 + .../stduuid/all/test_package/test_package.cpp | 39 + .../all/test_v1_package/CMakeLists.txt | 8 + .../stduuid/all/test_v1_package/conanfile.py | 17 + recipes/stduuid/config.yml | 7 + recipes/stlab/all/conandata.yml | 16 + recipes/stlab/all/conanfile.py | 180 + recipes/stlab/all/test_package/CMakeLists.txt | 10 + recipes/stlab/all/test_package/conanfile.py | 17 + .../stlab/all/test_package/test_package.cpp | 25 + recipes/stlab/config.yml | 11 + recipes/strawberryperl/all/conandata.yml | 22 + recipes/strawberryperl/all/conanfile.py | 54 + .../all/test_package/conanfile.py | 16 + .../all/test_package/list_files.pl | 12 + .../all/test_v1_package/conanfile.py | 12 + recipes/strawberryperl/config.yml | 7 + recipes/string-view-lite/all/conandata.yml | 16 + recipes/string-view-lite/all/conanfile.py | 51 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/string-view-lite/config.yml | 11 + recipes/stringtoolbox/all/conandata.yml | 4 + recipes/stringtoolbox/all/conanfile.py | 31 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 15 + recipes/stringtoolbox/config.yml | 3 + recipes/strong_type/all/conandata.yml | 13 + recipes/strong_type/all/conanfile.py | 68 + .../all/test_package/CMakeLists.txt | 8 + .../strong_type/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 16 + recipes/strong_type/config.yml | 9 + recipes/structopt/all/conandata.yml | 26 + recipes/structopt/all/conanfile.py | 77 + .../all/patches/0.1.0-0001-use-recipes.patch | 41 + .../structopt/all/test_package/CMakeLists.txt | 11 + .../structopt/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 73 + recipes/structopt/config.yml | 9 + recipes/stx/all/CMakeLists.txt | 7 + recipes/stx/all/conandata.yml | 10 + recipes/stx/all/conanfile.py | 164 + .../patches/0001-abseil_find_package.patch | 18 + .../all/patches/0002-cmake_module_path.patch | 13 + recipes/stx/all/test_package/CMakeLists.txt | 14 + recipes/stx/all/test_package/conanfile.py | 16 + recipes/stx/all/test_package/example.cpp | 39 + recipes/stx/config.yml | 3 + recipes/subunit/all/conandata.yml | 8 + recipes/subunit/all/conanfile.py | 148 + .../0001-fix-ExtUtils-MakeMaker-error.patch | 13 + .../subunit/all/test_package/CMakeLists.txt | 8 + recipes/subunit/all/test_package/conanfile.py | 17 + .../subunit/all/test_package/test_package.c | 12 + recipes/subunit/config.yml | 3 + recipes/sundials/all/conandata.yml | 10 + recipes/sundials/all/conanfile.py | 142 + .../sundials/all/test_package/CMakeLists.txt | 7 + .../sundials/all/test_package/conanfile.py | 26 + .../sundials/all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../sundials/all/test_v1_package/conanfile.py | 17 + recipes/sundials/config.yml | 7 + recipes/svector/all/conandata.yml | 4 + recipes/svector/all/conanfile.py | 65 + .../svector/all/test_package/CMakeLists.txt | 9 + recipes/svector/all/test_package/conanfile.py | 26 + .../svector/all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 12 + .../svector/all/test_v1_package/conanfile.py | 18 + recipes/svector/config.yml | 3 + recipes/svgwrite/all/CMakeLists.txt | 11 + recipes/svgwrite/all/conandata.yml | 13 + recipes/svgwrite/all/conanfile.py | 79 + .../all/patches/0001-remove-gcc-flags.patch | 12 + .../all/patches/0002-span-lite-ns.patch | 12 + .../svgwrite/all/test_package/CMakeLists.txt | 9 + .../svgwrite/all/test_package/conanfile.py | 18 + recipes/svgwrite/all/test_package/example.cpp | 17 + recipes/svgwrite/config.yml | 5 + .../cmake/conan-official-swig-targets.cmake | 7 + recipes/swig/all/conandata.yml | 26 + recipes/swig/all/conanfile.py | 170 + .../0001-4.1.0-swig-linux-library-path.patch | 51 + .../0001-swig-linux-library-path.patch | 51 + ....0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch | 11 + ....0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch | 11 + ....1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch | 11 + recipes/swig/all/test_package/CMakeLists.txt | 51 + recipes/swig/all/test_package/conanfile.py | 27 + recipes/swig/all/test_package/test.i | 6 + recipes/swig/all/test_package/test_package.c | 31 + recipes/swig/config.yml | 7 + recipes/symengine/all/conandata.yml | 10 + recipes/symengine/all/conanfile.py | 95 + .../symengine/all/test_package/CMakeLists.txt | 7 + .../symengine/all/test_package/conanfile.py | 31 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package/test_package.cpp | 13 + recipes/symengine/config.yml | 7 + recipes/systemc-cci/all/CMakeLists.txt | 48 + recipes/systemc-cci/all/conandata.yml | 12 + recipes/systemc-cci/all/conanfile.py | 82 + recipes/systemc-cci/all/patches/broker.patch | 28 + .../patches/cci_param_untyped_handle.patch | 13 + .../all/patches/cci_value_converter.patch | 63 + .../all/test_package/CMakeLists.txt | 10 + .../systemc-cci/all/test_package/conanfile.py | 18 + .../systemc-cci/all/test_package/example.cpp | 8 + recipes/systemc-cci/config.yml | 3 + recipes/systemc/all/CMakeLists.txt | 7 + recipes/systemc/all/conandata.yml | 22 + recipes/systemc/all/conanfile.py | 132 + recipes/systemc/all/patches/0001-cmake.patch | 21 + .../all/patches/0002-sc_string_view.patch | 58 + recipes/systemc/all/patches/0003-mingw.patch | 11 + recipes/systemc/all/patches/0004-cmake.patch | 21 + .../systemc/all/test_package/CMakeLists.txt | 10 + recipes/systemc/all/test_package/conanfile.py | 17 + .../systemc/all/test_package/test_package.cpp | 12 + recipes/systemc/config.yml | 5 + recipes/szip/all/conandata.yml | 8 + recipes/szip/all/conanfile.py | 124 + .../build_either_static_or_shared.patch | 31 + .../szip/all/patches/fix_unknown_size_t.patch | 11 + recipes/szip/all/test_package/CMakeLists.txt | 12 + recipes/szip/all/test_package/conanfile.py | 26 + recipes/szip/all/test_package/test_package.c | 80 + .../szip/all/test_v1_package/CMakeLists.txt | 16 + recipes/szip/all/test_v1_package/conanfile.py | 17 + recipes/szip/config.yml | 3 + recipes/tabulate/all/conandata.yml | 13 + recipes/tabulate/all/conanfile.py | 66 + .../tabulate/all/test_package/CMakeLists.txt | 8 + .../tabulate/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tabulate/all/test_v1_package/conanfile.py | 18 + recipes/tabulate/config.yml | 9 + recipes/taglib/all/conandata.yml | 10 + recipes/taglib/all/conanfile.py | 107 + ...12-0001-fix-error-duplicate-volatile.patch | 30 + .../taglib/all/test_package/CMakeLists.txt | 7 + recipes/taglib/all/test_package/conanfile.py | 26 + .../taglib/all/test_package/test_package.cpp | 7 + .../taglib/all/test_v1_package/CMakeLists.txt | 8 + .../taglib/all/test_v1_package/conanfile.py | 17 + recipes/taglib/config.yml | 5 + recipes/taocpp-json/all/conandata.yml | 13 + recipes/taocpp-json/all/conanfile.py | 89 + .../all/test_package/CMakeLists.txt | 8 + .../taocpp-json/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/taocpp-json/config.yml | 9 + recipes/taocpp-operators/all/conandata.yml | 4 + recipes/taocpp-operators/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 102 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/taocpp-operators/config.yml | 3 + recipes/taocpp-pegtl/2.x.x/conandata.yml | 10 + recipes/taocpp-pegtl/2.x.x/conanfile.py | 49 + .../2.x.x/test_package/CMakeLists.txt | 8 + .../2.x.x/test_package/conanfile.py | 26 + .../2.x.x/test_package/test_package.cpp | 19 + .../2.x.x/test_v1_package/CMakeLists.txt | 8 + .../2.x.x/test_v1_package/conanfile.py | 18 + recipes/taocpp-pegtl/3.x.x/conandata.yml | 22 + recipes/taocpp-pegtl/3.x.x/conanfile.py | 96 + .../3.x.x/test_package/CMakeLists.txt | 8 + .../3.x.x/test_package/conanfile.py | 26 + .../3.x.x/test_package/test_package.cpp | 45 + .../3.x.x/test_v1_package/CMakeLists.txt | 8 + .../3.x.x/test_v1_package/conanfile.py | 18 + recipes/taocpp-pegtl/config.yml | 21 + recipes/taocpp-sequences/all/conandata.yml | 4 + recipes/taocpp-sequences/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/taocpp-sequences/config.yml | 3 + recipes/taocpp-taopq/all/conandata.yml | 7 + recipes/taocpp-taopq/all/conanfile.py | 108 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/taocpp-taopq/config.yml | 5 + recipes/taocpp-tuple/all/conandata.yml | 4 + recipes/taocpp-tuple/all/conanfile.py | 56 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 22 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/taocpp-tuple/config.yml | 3 + recipes/tar/all/conandata.yml | 4 + recipes/tar/all/conanfile.py | 98 + recipes/tar/all/test_package/conanfile.py | 17 + recipes/tar/config.yml | 3 + recipes/taskflow/all/conandata.yml | 36 + recipes/taskflow/all/conanfile.py | 100 + .../all/patches/3.3.0-immintrin-guard.patch | 18 + .../taskflow/all/test_package/CMakeLists.txt | 13 + .../taskflow/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 27 + .../all/test_v1_package/CMakeLists.txt | 8 + .../taskflow/all/test_v1_package/conanfile.py | 17 + recipes/taskflow/config.yml | 21 + recipes/taywee-args/all/conandata.yml | 31 + recipes/taywee-args/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../taywee-args/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/taywee-args/config.yml | 21 + recipes/tbb/all/conandata.yml | 16 + recipes/tbb/all/conanfile.py | 275 ++ recipes/tbb/all/test_package/CMakeLists.txt | 11 + recipes/tbb/all/test_package/conanfile.py | 17 + recipes/tbb/all/test_package/test_package.cpp | 40 + recipes/tbb/config.yml | 11 + recipes/tcb-span/all/conandata.yml | 7 + recipes/tcb-span/all/conanfile.py | 49 + .../tcb-span/all/test_package/CMakeLists.txt | 8 + .../tcb-span/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cxx | 22 + .../all/test_v1_package/CMakeLists.txt | 11 + .../tcb-span/all/test_v1_package/conanfile.py | 18 + recipes/tcb-span/config.yml | 5 + recipes/tcl/all/conandata.yml | 12 + recipes/tcl/all/conanfile.py | 251 ++ .../0001-8.6.10-no-read-only-data.patch | 21 + .../0001-8.6.11-no-read-only-data.patch | 21 + recipes/tcl/all/test_package/CMakeLists.txt | 7 + recipes/tcl/all/test_package/conanfile.py | 29 + recipes/tcl/all/test_package/hello.bat | 1 + recipes/tcl/all/test_package/hello.tcl | 2 + recipes/tcl/all/test_package/test_package.c | 75 + .../tcl/all/test_v1_package/CMakeLists.txt | 8 + recipes/tcl/all/test_v1_package/conanfile.py | 19 + recipes/tcl/config.yml | 5 + recipes/tclap/all/conandata.yml | 10 + recipes/tclap/all/conanfile.py | 30 + recipes/tclap/all/test_package/CMakeLists.txt | 8 + recipes/tclap/all/test_package/conanfile.py | 16 + recipes/tclap/all/test_package/test.cpp | 33 + recipes/tclap/config.yml | 7 + recipes/tcp-wrappers/all/conandata.yml | 12 + recipes/tcp-wrappers/all/conanfile.py | 95 + .../all/patches/0001-shared-clang.patch | 55 + ...0002-fix-warnings-by-include-headers.patch | 314 ++ .../0003-add-severity-level-to-library.patch | 60 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 11 + recipes/tcp-wrappers/config.yml | 3 + recipes/tcsbank-uconfig/all/conandata.yml | 7 + recipes/tcsbank-uconfig/all/conanfile.py | 80 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 31 + recipes/tcsbank-uconfig/config.yml | 5 + .../tcsbank-uri-template/all/CMakeLists.txt | 7 + .../tcsbank-uri-template/all/conandata.yml | 10 + recipes/tcsbank-uri-template/all/conanfile.py | 107 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 25 + recipes/tcsbank-uri-template/config.yml | 7 + recipes/teemo/all/conandata.yml | 13 + recipes/teemo/all/conanfile.py | 101 + .../patches/0001-follow-cxx-standards.patch | 25 + .../all/patches/0002-support-macosx.patch | 40 + recipes/teemo/all/test_package/CMakeLists.txt | 9 + recipes/teemo/all/test_package/conanfile.py | 26 + .../teemo/all/test_package/test_package.cpp | 31 + .../teemo/all/test_v1_package/CMakeLists.txt | 8 + .../teemo/all/test_v1_package/conanfile.py | 18 + recipes/teemo/config.yml | 3 + recipes/tensorflow-lite/all/conandata.yml | 14 + recipes/tensorflow-lite/all/conanfile.py | 179 + .../all/patches/dependencies_2_10.patch | 78 + .../all/patches/disable_fetch_content.patch | 12 + ...emove_simple_memory_arena_debug_dump.patch | 14 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 27 + .../all/test_package/model.tflite | Bin 0 -> 516 bytes .../all/test_package/test_package.cpp | 40 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/tensorflow-lite/config.yml | 3 + recipes/tensorpipe/all/conandata.yml | 4 + recipes/tensorpipe/all/conanfile.py | 150 + .../all/test_package/CMakeLists.txt | 8 + .../tensorpipe/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/tensorpipe/config.yml | 3 + recipes/termcap/all/CMakeLists.txt | 39 + recipes/termcap/all/conandata.yml | 8 + recipes/termcap/all/conanfile.py | 98 + recipes/termcap/all/patches/0001-msvc.patch | 193 + recipes/termcap/all/patches/0002-macOS.patch | 15 + .../termcap/all/test_package/CMakeLists.txt | 7 + recipes/termcap/all/test_package/conanfile.py | 32 + .../termcap/all/test_package/test_package.c | 39 + .../all/test_v1_package/CMakeLists.txt | 8 + .../termcap/all/test_v1_package/conanfile.py | 18 + recipes/termcap/config.yml | 3 + recipes/termcolor/all/conandata.yml | 11 + recipes/termcolor/all/conanfile.py | 36 + .../termcolor/all/test_package/CMakeLists.txt | 11 + .../termcolor/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 12 + recipes/termcolor/config.yml | 7 + recipes/tesseract/all/conandata.yml | 55 + recipes/tesseract/all/conanfile.py | 217 + .../all/patches/0001-install-bundle.patch | 11 + .../0002-Link-with-targets-5.0.0.patch | 22 + .../0002-Link-with-targets-5.1.0.patch | 22 + .../0002-Link-with-targets-5.2.0.patch | 22 + .../all/patches/0002-Link-with-targets.patch | 18 + .../all/patches/0003-Dont-change-locale.patch | 11 + .../0004-control-optimizations-4.1.1.patch | 12 + .../0004-control-optimizations-5.0.0.patch | 48 + .../0004-control-optimizations-5.1.0.patch | 31 + .../0004-control-optimizations-5.2.0.patch | 31 + .../0004-control-optimizations-5.3.0.patch | 31 + .../tesseract/all/test_package/CMakeLists.txt | 12 + .../tesseract/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/tesseract/config.yml | 11 + recipes/tgbot/all/CMakeLists.txt | 7 + recipes/tgbot/all/conandata.yml | 13 + recipes/tgbot/all/conanfile.py | 92 + recipes/tgbot/all/test_package/CMakeLists.txt | 11 + recipes/tgbot/all/test_package/conanfile.py | 16 + .../tgbot/all/test_package/test_package.cpp | 27 + recipes/tgbot/config.yml | 9 + recipes/tgc/all/CMakeLists.txt | 13 + recipes/tgc/all/conandata.yml | 4 + recipes/tgc/all/conanfile.py | 62 + recipes/tgc/all/test_package/CMakeLists.txt | 7 + recipes/tgc/all/test_package/conanfile.py | 26 + recipes/tgc/all/test_package/test_package.c | 18 + .../tgc/all/test_v1_package/CMakeLists.txt | 8 + recipes/tgc/all/test_v1_package/conanfile.py | 17 + recipes/tgc/config.yml | 3 + recipes/thelink2012-any/all/conandata.yml | 4 + recipes/thelink2012-any/all/conanfile.py | 37 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.cpp | 28 + recipes/thelink2012-any/config.yml | 3 + recipes/theora/all/CMakeLists.txt | 122 + recipes/theora/all/conandata.yml | 4 + recipes/theora/all/conanfile.py | 90 + .../theora/all/test_package/CMakeLists.txt | 7 + recipes/theora/all/test_package/conanfile.py | 26 + .../theora/all/test_package/test_package.c | 138 + .../theora/all/test_v1_package/CMakeLists.txt | 10 + .../theora/all/test_v1_package/conanfile.py | 17 + recipes/theora/config.yml | 3 + recipes/threadpool/all/conandata.yml | 4 + recipes/threadpool/all/conanfile.py | 50 + .../all/test_package/CMakeLists.txt | 8 + .../threadpool/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/threadpool/config.yml | 3 + recipes/thrift/all/conandata.yml | 44 + recipes/thrift/all/conanfile.py | 232 ++ recipes/thrift/all/patches/cmake-0.13.0.patch | 80 + recipes/thrift/all/patches/cmake-0.14.1.patch | 108 + recipes/thrift/all/patches/cmake-0.15.0.patch | 116 + recipes/thrift/all/patches/cmake-0.16.0.patch | 125 + .../thrift/all/test_package/CMakeLists.txt | 13 + .../thrift/all/test_package/Calculator.cpp | 436 +++ recipes/thrift/all/test_package/Calculator.h | 303 ++ recipes/thrift/all/test_package/calc.thrift | 77 + .../all/test_package/calculator_constants.cpp | 17 + .../all/test_package/calculator_constants.h | 24 + .../all/test_package/calculator_types.cpp | 16 + .../all/test_package/calculator_types.h | 23 + recipes/thrift/all/test_package/conanfile.py | 27 + .../thrift/all/test_package/test_package.cpp | 60 + .../thrift/all/test_v1_package/CMakeLists.txt | 8 + .../thrift/all/test_v1_package/conanfile.py | 18 + recipes/thrift/config.yml | 13 + recipes/thrust/all/conandata.yml | 10 + recipes/thrust/all/conanfile.py | 44 + .../thrust/all/test_package/CMakeLists.txt | 11 + recipes/thrust/all/test_package/conanfile.py | 17 + .../thrust/all/test_package/test_package.cpp | 81 + recipes/thrust/config.yml | 7 + recipes/tidy-html5/all/CMakeLists.txt | 7 + recipes/tidy-html5/all/conandata.yml | 8 + recipes/tidy-html5/all/conanfile.py | 92 + .../all/patches/0001-robust-install-pdb.patch | 24 + .../all/test_package/CMakeLists.txt | 8 + .../tidy-html5/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 9 + recipes/tidy-html5/config.yml | 3 + recipes/timsort/all/conandata.yml | 25 + recipes/timsort/all/conanfile.py | 48 + .../timsort/all/test_package/CMakeLists.txt | 11 + recipes/timsort/all/test_package/conanfile.py | 17 + .../timsort/all/test_package/test_package.cpp | 22 + recipes/timsort/config.yml | 17 + .../tinkerforge-bindings/all/CMakeLists.txt | 26 + .../tinkerforge-bindings/all/conandata.yml | 5 + recipes/tinkerforge-bindings/all/conanfile.py | 86 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 16 + .../all/test_package/test_package.c | 26 + recipes/tinkerforge-bindings/config.yml | 3 + recipes/tiny-aes-c/all/conandata.yml | 9 + recipes/tiny-aes-c/all/conanfile.py | 105 + .../all/patches/0001-cmake-install.patch | 14 + .../all/test_package/CMakeLists.txt | 10 + .../tiny-aes-c/all/test_package/conanfile.py | 28 + .../all/test_package/test_package.c | 100 + .../all/test_package/test_package.cpp | 100 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/tiny-aes-c/config.yml | 3 + recipes/tiny-bignum-c/all/CMakeLists.txt | 13 + recipes/tiny-bignum-c/all/conandata.yml | 4 + recipes/tiny-bignum-c/all/conanfile.py | 62 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 31 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/tiny-bignum-c/config.yml | 3 + recipes/tiny-dnn/all/CMakeLists.txt | 7 + recipes/tiny-dnn/all/conandata.yml | 4 + recipes/tiny-dnn/all/conanfile.py | 107 + .../tiny-dnn/all/test_package/CMakeLists.txt | 11 + .../tiny-dnn/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 34 + recipes/tiny-dnn/config.yml | 3 + recipes/tiny-regex-c/all/CMakeLists.txt | 19 + recipes/tiny-regex-c/all/conandata.yml | 4 + recipes/tiny-regex-c/all/conanfile.py | 66 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/tiny-regex-c/config.yml | 3 + recipes/tiny-utf8/all/conandata.yml | 13 + recipes/tiny-utf8/all/conanfile.py | 51 + .../tiny-utf8/all/test_package/CMakeLists.txt | 8 + .../tiny-utf8/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tiny-utf8/config.yml | 9 + recipes/tinyalsa/all/conandata.yml | 11 + recipes/tinyalsa/all/conanfile.py | 68 + .../tinyalsa-2.0.0-strncpy-warning.patch | 46 + .../tinyalsa/all/test_package/CMakeLists.txt | 10 + .../tinyalsa/all/test_package/conanfile.py | 16 + recipes/tinyalsa/all/test_package/example.c | 28 + recipes/tinyalsa/config.yml | 5 + recipes/tinycbor/all/conandata.yml | 12 + recipes/tinycbor/all/conanfile.py | 113 + .../all/patches/0.5.3/001-build-system.patch | 49 + .../all/patches/0.6.0/001-build-system.patch | 49 + .../tinycbor/all/test_package/CMakeLists.txt | 8 + .../tinycbor/all/test_package/conanfile.py | 26 + .../tinycbor/all/test_package/test_package.c | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinycbor/all/test_v1_package/conanfile.py | 17 + recipes/tinycbor/config.yml | 5 + recipes/tinycthread/all/conandata.yml | 4 + recipes/tinycthread/all/conanfile.py | 59 + .../all/test_package/CMakeLists.txt | 9 + .../tinycthread/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 25 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 16 + recipes/tinycthread/config.yml | 3 + recipes/tinycthreadpool/all/conandata.yml | 4 + recipes/tinycthreadpool/all/conanfile.py | 66 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/example.c | 14 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/tinycthreadpool/config.yml | 4 + recipes/tinydir/all/conandata.yml | 7 + recipes/tinydir/all/conanfile.py | 28 + .../tinydir/all/test_package/CMakeLists.txt | 10 + recipes/tinydir/all/test_package/conanfile.py | 17 + .../tinydir/all/test_package/test_package.c | 27 + recipes/tinydir/config.yml | 5 + recipes/tinyexif/all/conandata.yml | 7 + recipes/tinyexif/all/conanfile.py | 92 + .../tinyexif/all/test_package/CMakeLists.txt | 8 + .../tinyexif/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 10 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinyexif/all/test_v1_package/conanfile.py | 18 + recipes/tinyexif/config.yml | 5 + recipes/tinyexr/all/conandata.yml | 17 + recipes/tinyexr/all/conanfile.py | 87 + .../patches/1.0.0-0001-use-conan-deps.patch | 66 + ...1-0001-fix-SaveEXRNPartImageToMemory.patch | 13 + .../tinyexr/all/test_package/CMakeLists.txt | 8 + recipes/tinyexr/all/test_package/conanfile.py | 27 + recipes/tinyexr/all/test_package/test.exr | Bin 0 -> 395 bytes .../tinyexr/all/test_package/test_package.cpp | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinyexr/all/test_v1_package/conanfile.py | 18 + recipes/tinyexr/config.yml | 5 + recipes/tinygltf/all/conandata.yml | 10 + recipes/tinygltf/all/conanfile.py | 74 + .../tinygltf/all/test_package/CMakeLists.txt | 8 + recipes/tinygltf/all/test_package/box01.glb | Bin 0 -> 3816 bytes .../tinygltf/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinygltf/all/test_v1_package/conanfile.py | 18 + recipes/tinygltf/config.yml | 7 + recipes/tinymidi/all/CMakeLists.txt | 13 + recipes/tinymidi/all/conandata.yml | 4 + recipes/tinymidi/all/conanfile.py | 62 + .../tinymidi/all/test_package/CMakeLists.txt | 7 + .../tinymidi/all/test_package/conanfile.py | 26 + .../tinymidi/all/test_package/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinymidi/all/test_v1_package/conanfile.py | 17 + recipes/tinymidi/config.yml | 3 + recipes/tinyobjloader/all/conandata.yml | 26 + recipes/tinyobjloader/all/conanfile.py | 117 + .../1.0.x-0001-cmake-minimum-required.patch | 12 + ...0.0-rc10-0001-cmake-minimum-required.patch | 12 + .../all/test_package/CMakeLists.txt | 17 + .../all/test_package/conanfile.py | 28 + .../tinyobjloader/all/test_package/cube.mtl | 24 + .../tinyobjloader/all/test_package/cube.obj | 32 + .../all/test_package/test_package.cpp | 52 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/tinyobjloader/config.yml | 7 + recipes/tinyply/all/conandata.yml | 7 + recipes/tinyply/all/conanfile.py | 75 + .../tinyply/all/test_package/CMakeLists.txt | 8 + recipes/tinyply/all/test_package/conanfile.py | 26 + .../tinyply/all/test_package/test_package.cpp | 91 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinyply/all/test_v1_package/conanfile.py | 17 + recipes/tinyply/config.yml | 5 + recipes/tinyspline/all/conandata.yml | 21 + recipes/tinyspline/all/conanfile.py | 170 + .../all/patches/0.2.0-0001-fix-cmake.patch | 134 + .../all/patches/0.3.0-0001-fix-cmake.patch | 121 + .../all/test_package/CMakeLists.txt | 20 + .../tinyspline/all/test_package/conanfile.py | 36 + .../all/test_package/test_package.c | 14 + .../all/test_package/test_package.cpp | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 20 + recipes/tinyspline/config.yml | 11 + recipes/tinyxml/all/CMakeLists.txt | 27 + recipes/tinyxml/all/conandata.yml | 4 + recipes/tinyxml/all/conanfile.py | 86 + .../tinyxml/all/test_package/CMakeLists.txt | 7 + recipes/tinyxml/all/test_package/conanfile.py | 26 + .../tinyxml/all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 10 + .../tinyxml/all/test_v1_package/conanfile.py | 17 + recipes/tinyxml/config.yml | 3 + recipes/tinyxml2/all/conandata.yml | 15 + recipes/tinyxml2/all/conanfile.py | 75 + .../tinyxml2/all/patches/0001-cmake-pic.patch | 10 + .../tinyxml2/all/test_package/CMakeLists.txt | 7 + .../tinyxml2/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../tinyxml2/all/test_v1_package/conanfile.py | 17 + recipes/tinyxml2/config.yml | 7 + recipes/tixi3/all/conandata.yml | 12 + recipes/tixi3/all/conanfile.py | 127 + .../all/patches/disable_tixi_examples.patch | 24 + recipes/tixi3/all/patches/link_curl.patch | 13 + recipes/tixi3/all/test_package/CMakeLists.txt | 7 + recipes/tixi3/all/test_package/conanfile.py | 23 + recipes/tixi3/all/test_package/main.cpp | 20 + .../tixi3/all/test_v1_package/CMakeLists.txt | 10 + .../tixi3/all/test_v1_package/conanfile.py | 19 + recipes/tixi3/config.yml | 3 + recipes/tk/all/conandata.yml | 4 + recipes/tk/all/conanfile.py | 258 ++ recipes/tk/all/test_package/CMakeLists.txt | 8 + recipes/tk/all/test_package/conanfile.py | 17 + recipes/tk/all/test_package/test_package.c | 23 + recipes/tk/config.yml | 3 + recipes/tl-expected/all/conandata.yml | 10 + recipes/tl-expected/all/conanfile.py | 60 + .../all/test_package/CMakeLists.txt | 8 + .../tl-expected/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 13 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tl-expected/config.yml | 7 + recipes/tl-function-ref/all/conandata.yml | 4 + recipes/tl-function-ref/all/conanfile.py | 60 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 17 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tl-function-ref/config.yml | 3 + recipes/tl-optional/all/conandata.yml | 4 + recipes/tl-optional/all/conanfile.py | 60 + .../all/test_package/CMakeLists.txt | 8 + .../tl-optional/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tl-optional/config.yml | 3 + recipes/tl/all/conandata.yml | 4 + recipes/tl/all/conanfile.py | 72 + recipes/tl/all/test_package/CMakeLists.txt | 8 + recipes/tl/all/test_package/conanfile.py | 25 + recipes/tl/all/test_package/test_package.cpp | 68 + recipes/tl/all/test_v1_package/CMakeLists.txt | 11 + recipes/tl/all/test_v1_package/conanfile.py | 17 + recipes/tl/config.yml | 3 + recipes/tllist/all/conandata.yml | 4 + recipes/tllist/all/conanfile.py | 40 + .../tllist/all/test_package/CMakeLists.txt | 10 + recipes/tllist/all/test_package/conanfile.py | 17 + .../tllist/all/test_package/test_package.c | 10 + recipes/tllist/config.yml | 3 + recipes/tlx/all/conandata.yml | 8 + recipes/tlx/all/conanfile.py | 117 + .../all/patches/0001-fix-dll-install.patch | 10 + .../all/patches/0002-fix-shared-apple.patch | 16 + recipes/tlx/all/test_package/CMakeLists.txt | 8 + recipes/tlx/all/test_package/conanfile.py | 26 + recipes/tlx/all/test_package/test_package.cpp | 6 + .../tlx/all/test_v1_package/CMakeLists.txt | 8 + recipes/tlx/all/test_v1_package/conanfile.py | 17 + recipes/tlx/config.yml | 3 + recipes/tmx/all/conandata.yml | 4 + recipes/tmx/all/conanfile.py | 118 + recipes/tmx/all/test_package/CMakeLists.txt | 7 + recipes/tmx/all/test_package/conanfile.py | 27 + .../tmx/all/test_package/externtileset.tmx | 60 + recipes/tmx/all/test_package/test_package.c | 19 + recipes/tmx/all/test_package/tileset.tsx | 34 + .../tmx/all/test_v1_package/CMakeLists.txt | 10 + recipes/tmx/all/test_v1_package/conanfile.py | 18 + recipes/tmx/config.yml | 3 + recipes/tmxlite/all/conandata.yml | 8 + recipes/tmxlite/all/conanfile.py | 100 + .../0001-include-external-pugixml.patch | 99 + ...02-cmake-link-external-miniz-pugixml.patch | 12 + .../tmxlite/all/test_package/CMakeLists.txt | 8 + recipes/tmxlite/all/test_package/conanfile.py | 26 + .../tmxlite/all/test_package/test_package.cpp | 6 + .../all/test_v1_package/CMakeLists.txt | 11 + .../tmxlite/all/test_v1_package/conanfile.py | 17 + recipes/tmxlite/config.yml | 3 + recipes/tng/all/conandata.yml | 9 + recipes/tng/all/conanfile.py | 82 + .../tng/all/patches/0001-cmake-install.patch | 14 + recipes/tng/all/test_package/CMakeLists.txt | 7 + recipes/tng/all/test_package/conanfile.py | 26 + recipes/tng/all/test_package/test_package.c | 31 + .../tng/all/test_v1_package/CMakeLists.txt | 8 + recipes/tng/all/test_v1_package/conanfile.py | 17 + recipes/tng/config.yml | 3 + recipes/toml11/all/conandata.yml | 22 + recipes/toml11/all/conanfile.py | 47 + .../toml11/all/test_package/CMakeLists.txt | 8 + recipes/toml11/all/test_package/conanfile.py | 26 + .../toml11/all/test_package/test_package.cpp | 14 + .../toml11/all/test_v1_package/CMakeLists.txt | 8 + .../toml11/all/test_v1_package/conanfile.py | 17 + recipes/toml11/config.yml | 15 + recipes/tomlplusplus/all/conandata.yml | 19 + recipes/tomlplusplus/all/conanfile.py | 74 + .../all/test_package/CMakeLists.txt | 14 + .../all/test_package/conanfile.py | 36 + .../all/test_package/configuration.toml | 6 + .../all/test_package/test_package.cpp | 38 + .../all/test_package/test_package_multi.cpp | 38 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 29 + recipes/tomlplusplus/config.yml | 13 + recipes/tracy/all/conandata.yml | 13 + recipes/tracy/all/conanfile.py | 118 + recipes/tracy/all/test_package/CMakeLists.txt | 11 + recipes/tracy/all/test_package/conanfile.py | 25 + .../tracy/all/test_package/test_package.cpp | 11 + .../tracy/all/test_v1_package/CMakeLists.txt | 8 + .../tracy/all/test_v1_package/conanfile.py | 17 + recipes/tracy/config.yml | 9 + recipes/transwarp/all/conandata.yml | 7 + recipes/transwarp/all/conanfile.py | 47 + .../transwarp/all/test_package/CMakeLists.txt | 9 + .../transwarp/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 39 + .../all/test_v1_package/CMakeLists.txt | 12 + .../all/test_v1_package/conanfile.py | 17 + recipes/transwarp/config.yml | 5 + recipes/trantor/all/conandata.yml | 19 + recipes/trantor/all/conanfile.py | 126 + .../trantor/all/test_package/CMakeLists.txt | 8 + recipes/trantor/all/test_package/conanfile.py | 25 + .../trantor/all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 9 + .../trantor/all/test_v1_package/conanfile.py | 18 + recipes/trantor/config.yml | 13 + recipes/tree-sitter-c/all/CMakeLists.txt | 46 + recipes/tree-sitter-c/all/conandata.yml | 7 + recipes/tree-sitter-c/all/conanfile.py | 73 + .../all/test_package/CMakeLists.txt | 10 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 27 + recipes/tree-sitter-c/config.yml | 5 + recipes/tree-sitter/all/CMakeLists.txt | 33 + recipes/tree-sitter/all/conandata.yml | 10 + recipes/tree-sitter/all/conanfile.py | 62 + .../all/test_package/CMakeLists.txt | 10 + .../tree-sitter/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.c | 8 + recipes/tree-sitter/config.yml | 7 + recipes/troldal-zippy/all/conandata.yml | 8 + recipes/troldal-zippy/all/conanfile.py | 68 + .../all/patches/zippy-archive-mkdir.patch | 17 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 6 + recipes/troldal-zippy/config.yml | 3 + recipes/trompeloeil/all/conandata.yml | 16 + recipes/trompeloeil/all/conanfile.py | 46 + .../all/test_package/CMakeLists.txt | 8 + .../trompeloeil/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/trompeloeil/config.yml | 11 + recipes/tscns/all/conandata.yml | 15 + recipes/tscns/all/conanfile.py | 56 + .../all/patches/0001-include-thread.patch | 12 + .../patches/0002-support-older-compiler.patch | 13 + recipes/tscns/all/test_package/CMakeLists.txt | 8 + recipes/tscns/all/test_package/conanfile.py | 26 + .../tscns/all/test_package/test_package.cpp | 23 + .../tscns/all/test_v1_package/CMakeLists.txt | 11 + .../tscns/all/test_v1_package/conanfile.py | 17 + recipes/tscns/config.yml | 3 + recipes/tsil/all/CMakeLists.txt | 73 + recipes/tsil/all/conandata.yml | 7 + recipes/tsil/all/conanfile.py | 92 + recipes/tsil/all/test_package/CMakeLists.txt | 7 + recipes/tsil/all/test_package/conanfile.py | 26 + recipes/tsil/all/test_package/test_package.c | 17 + .../tsil/all/test_v1_package/CMakeLists.txt | 10 + recipes/tsil/all/test_v1_package/conanfile.py | 17 + recipes/tsil/config.yml | 3 + recipes/tsl-array-hash/all/conandata.yml | 4 + recipes/tsl-array-hash/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 44 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tsl-array-hash/config.yml | 3 + recipes/tsl-hat-trie/all/conandata.yml | 4 + recipes/tsl-hat-trie/all/conanfile.py | 64 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 77 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tsl-hat-trie/config.yml | 3 + recipes/tsl-hopscotch-map/all/conandata.yml | 4 + recipes/tsl-hopscotch-map/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 61 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tsl-hopscotch-map/config.yml | 3 + recipes/tsl-ordered-map/all/conandata.yml | 7 + recipes/tsl-ordered-map/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 55 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/tsl-ordered-map/config.yml | 5 + recipes/tsl-robin-map/all/conandata.yml | 13 + recipes/tsl-robin-map/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 67 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/tsl-robin-map/config.yml | 9 + recipes/tsl-sparse-map/all/conandata.yml | 4 + recipes/tsl-sparse-map/all/conanfile.py | 58 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 44 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/tsl-sparse-map/config.yml | 3 + recipes/tuplet/all/conandata.yml | 10 + recipes/tuplet/all/conanfile.py | 84 + .../tuplet/all/test_package/CMakeLists.txt | 8 + recipes/tuplet/all/test_package/conanfile.py | 25 + .../tuplet/all/test_package/test_package.cpp | 8 + .../tuplet/all/test_v1_package/CMakeLists.txt | 8 + .../tuplet/all/test_v1_package/conanfile.py | 17 + recipes/tuplet/config.yml | 7 + recipes/turtle/all/conandata.yml | 7 + recipes/turtle/all/conanfile.py | 30 + .../turtle/all/test_package/CMakeLists.txt | 10 + recipes/turtle/all/test_package/conanfile.py | 17 + .../turtle/all/test_package/test_package.cpp | 15 + recipes/turtle/config.yml | 5 + recipes/tweetnacl/all/CMakeLists.txt | 17 + recipes/tweetnacl/all/conandata.yml | 8 + recipes/tweetnacl/all/conanfile.py | 66 + .../tweetnacl/all/test_package/CMakeLists.txt | 8 + .../tweetnacl/all/test_package/conanfile.py | 17 + .../tweetnacl/all/test_package/test_package.c | 97 + recipes/tweetnacl/config.yml | 3 + recipes/twitch-native-ipc/all/CMakeLists.txt | 6 + recipes/twitch-native-ipc/all/conandata.yml | 12 + recipes/twitch-native-ipc/all/conanfile.py | 95 + .../all/patches/cmake-fixes.patch | 58 + .../all/patches/export-fixes.patch | 13 + .../all/patches/linux-build-fixes.patch | 85 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 18 + .../all/test_package/example.c | 19 + .../all/test_package/example2.cpp | 16 + recipes/twitch-native-ipc/config.yml | 3 + .../all/CMakeLists.txt | 6 + .../all/conandata.yml | 8 + .../all/conanfile.py | 90 + .../all/patches/clang-8-fix.patch | 12 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 17 + .../all/test_package/example.cpp | 8 + recipes/twitchtv-libsoundtrackutil/config.yml | 3 + recipes/type_safe/all/conandata.yml | 7 + recipes/type_safe/all/conanfile.py | 37 + .../type_safe/all/test_package/CMakeLists.txt | 9 + .../type_safe/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 79 + recipes/type_safe/config.yml | 5 + recipes/ua-nodeset/all/conandata.yml | 5 + recipes/ua-nodeset/all/conanfile.py | 43 + .../ua-nodeset/all/test_package/conanfile.py | 12 + recipes/ua-nodeset/config.yml | 3 + recipes/uchardet/all/CMakeLists.txt | 7 + recipes/uchardet/all/conandata.yml | 4 + recipes/uchardet/all/conanfile.py | 103 + .../uchardet/all/test_package/CMakeLists.txt | 13 + .../uchardet/all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/uchardet/config.yml | 3 + recipes/ulfius/all/conandata.yml | 12 + recipes/ulfius/all/conanfile.py | 217 + .../2.7.11-0001-shared-static-conan.patch | 323 ++ ....11-0002-pthread-for-websockets-only.patch | 41 + .../ulfius/all/test_package/CMakeLists.txt | 13 + recipes/ulfius/all/test_package/conanfile.py | 31 + .../ulfius/all/test_package/test_package.c | 64 + .../ulfius/all/test_v1_package/CMakeLists.txt | 16 + .../ulfius/all/test_v1_package/conanfile.py | 18 + recipes/ulfius/config.yml | 3 + recipes/uncrustify/all/conandata.yml | 7 + recipes/uncrustify/all/conanfile.py | 73 + .../uncrustify/all/test_package/conanfile.py | 15 + .../all/test_v1_package/conanfile.py | 9 + recipes/uncrustify/config.yml | 5 + recipes/uni-algo/all/conandata.yml | 13 + recipes/uni-algo/all/conanfile.py | 130 + .../uni-algo/all/test_package/CMakeLists.txt | 12 + .../uni-algo/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 30 + .../all/test_v1_package/CMakeLists.txt | 8 + .../uni-algo/all/test_v1_package/conanfile.py | 18 + recipes/uni-algo/config.yml | 9 + recipes/unicorn/all/conandata.yml | 19 + recipes/unicorn/all/conanfile.py | 163 + .../1.0.3-0001-cmake-crossbuild-support.patch | 40 + .../2.0.0-0001-cmake-msvc-support.patch | 11 + .../2.0.0-0002-cmake-msvc-runtime.patch | 11 + .../2.0.1-0001-cmake-msvc-support.patch | 13 + .../2.0.1-0002-cmake-msvc-runtime.patch | 16 + .../unicorn/all/test_package/CMakeLists.txt | 7 + recipes/unicorn/all/test_package/conanfile.py | 26 + .../unicorn/all/test_package/test_package.c | 73 + .../all/test_v1_package/CMakeLists.txt | 8 + .../unicorn/all/test_v1_package/conanfile.py | 17 + recipes/unicorn/config.yml | 7 + recipes/units/all/conandata.yml | 7 + recipes/units/all/conanfile.py | 67 + recipes/units/all/test_package/CMakeLists.txt | 8 + recipes/units/all/test_package/conanfile.py | 26 + .../units/all/test_package/test_package.cpp | 15 + .../units/all/test_v1_package/CMakeLists.txt | 11 + .../units/all/test_v1_package/conanfile.py | 17 + recipes/units/config.yml | 5 + recipes/univalue/all/conandata.yml | 12 + recipes/univalue/all/conanfile.py | 117 + .../all/patches/1.0.5-0001-fix-windows.patch | 89 + .../all/patches/1.1.1-0001-fix-windows.patch | 89 + .../univalue/all/test_package/CMakeLists.txt | 7 + .../univalue/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../univalue/all/test_v1_package/conanfile.py | 17 + recipes/univalue/config.yml | 5 + recipes/unleash-client-cpp/all/CMakeLists.txt | 7 + recipes/unleash-client-cpp/all/conandata.yml | 8 + recipes/unleash-client-cpp/all/conanfile.py | 116 + .../all/patches/0001-no-conan-cmake.patch | 11 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 10 + recipes/unleash-client-cpp/config.yml | 3 + recipes/unordered_dense/all/conandata.yml | 34 + recipes/unordered_dense/all/conanfile.py | 72 + .../all/test_package/CMakeLists.txt | 9 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 14 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/unordered_dense/config.yml | 23 + recipes/unqlite/all/conandata.yml | 4 + recipes/unqlite/all/conanfile.py | 54 + .../unqlite/all/test_package/CMakeLists.txt | 7 + recipes/unqlite/all/test_package/conanfile.py | 26 + .../unqlite/all/test_package/test_package.c | 53 + .../all/test_v1_package/CMakeLists.txt | 8 + .../unqlite/all/test_v1_package/conanfile.py | 17 + recipes/unqlite/config.yml | 3 + recipes/upx/all/CMakeLists.txt | 7 + recipes/upx/all/conandata.yml | 25 + recipes/upx/all/conanfile.py | 55 + recipes/upx/all/test_package/CMakeLists.txt | 11 + recipes/upx/all/test_package/conanfile.py | 35 + recipes/upx/all/test_package/test_package.c | 6 + recipes/upx/config.yml | 3 + recipes/uriparser/all/conandata.yml | 21 + recipes/uriparser/all/conanfile.py | 85 + .../patches/fix-lib-name-mingw-0.9.3.patch | 14 + .../patches/fix-lib-name-mingw-0.9.4.patch | 14 + .../uriparser/all/test_package/CMakeLists.txt | 7 + .../uriparser/all/test_package/conanfile.py | 26 + .../uriparser/all/test_package/test_package.c | 39 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/uriparser/config.yml | 11 + recipes/userspace-rcu/all/conandata.yml | 4 + recipes/userspace-rcu/all/conanfile.py | 97 + .../all/test_package/CMakeLists.txt | 15 + .../all/test_package/conanfile.py | 22 + recipes/userspace-rcu/all/test_package/tap.c | 492 +++ recipes/userspace-rcu/all/test_package/tap.h | 89 + .../all/test_package/test_urcu_fork.c | 214 + recipes/userspace-rcu/config.yml | 3 + recipes/usockets/all/conandata.yml | 78 + recipes/usockets/all/conanfile.py | 224 ++ .../usockets/all/patches/0001-makefile.patch | 13 + .../all/patches/0001-makefile_0.6.0.patch | 19 + .../all/patches/0001-makefile_0.8.1.patch | 26 + .../all/patches/0001-makefile_0.8.2.patch | 39 + .../all/patches/0001-makefile_0.8.3.patch | 40 + .../usockets/all/patches/0002-vcxproj.patch | 15 + .../all/patches/0002-vcxproj_0.8.1.patch | 17 + .../usockets/all/test_package/CMakeLists.txt | 11 + .../usockets/all/test_package/conanfile.py | 19 + .../all/test_package/test_package.cpp | 6 + recipes/usockets/config.yml | 15 + recipes/usrsctp/all/CMakeLists.txt | 11 + recipes/usrsctp/all/conandata.yml | 8 + recipes/usrsctp/all/conanfile.py | 74 + .../usrsctp/all/patches/0001-install.patch | 16 + .../usrsctp/all/test_package/CMakeLists.txt | 10 + recipes/usrsctp/all/test_package/conanfile.py | 17 + .../usrsctp/all/test_package/test_package.c | 7 + recipes/usrsctp/config.yml | 3 + recipes/utf8.h/all/conandata.yml | 4 + recipes/utf8.h/all/conanfile.py | 39 + .../utf8.h/all/test_package/CMakeLists.txt | 7 + recipes/utf8.h/all/test_package/conanfile.py | 26 + .../utf8.h/all/test_package/test_package.cpp | 13 + .../utf8.h/all/test_v1_package/CMakeLists.txt | 10 + .../utf8.h/all/test_v1_package/conanfile.py | 17 + recipes/utf8.h/config.yml | 3 + recipes/utf8proc/all/conandata.yml | 16 + recipes/utf8proc/all/conanfile.py | 74 + .../utf8proc/all/test_package/CMakeLists.txt | 7 + .../utf8proc/all/test_package/conanfile.py | 26 + .../utf8proc/all/test_package/test_package.c | 10 + .../all/test_v1_package/CMakeLists.txt | 10 + .../utf8proc/all/test_v1_package/conanfile.py | 17 + recipes/utf8proc/config.yml | 11 + recipes/utfcpp/all/conandata.yml | 22 + recipes/utfcpp/all/conanfile.py | 70 + .../utfcpp/all/test_package/CMakeLists.txt | 8 + recipes/utfcpp/all/test_package/conanfile.py | 25 + .../utfcpp/all/test_package/test_package.cpp | 18 + .../utfcpp/all/test_v1_package/CMakeLists.txt | 8 + .../utfcpp/all/test_v1_package/conanfile.py | 17 + recipes/utfcpp/config.yml | 15 + recipes/uvw/all/conandata.yml | 19 + recipes/uvw/all/conanfile.py | 85 + recipes/uvw/all/test_package/CMakeLists.txt | 11 + recipes/uvw/all/test_package/conanfile.py | 17 + recipes/uvw/all/test_package/test_package.cpp | 8 + recipes/uvw/config.yml | 13 + recipes/uwebsockets/all/conandata.yml | 28 + recipes/uwebsockets/all/conanfile.py | 109 + .../all/test_package/CMakeLists.txt | 8 + .../uwebsockets/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/uwebsockets/config.yml | 19 + recipes/v-hacd/all/conandata.yml | 4 + recipes/v-hacd/all/conanfile.py | 60 + .../v-hacd/all/test_package/CMakeLists.txt | 8 + recipes/v-hacd/all/test_package/conanfile.py | 26 + .../v-hacd/all/test_package/test_package.cpp | 9 + .../v-hacd/all/test_v1_package/CMakeLists.txt | 8 + .../v-hacd/all/test_v1_package/conanfile.py | 17 + recipes/v-hacd/config.yml | 3 + recipes/vaapi/all/conanfile.py | 55 + recipes/vaapi/all/test_package/CMakeLists.txt | 8 + recipes/vaapi/all/test_package/conanfile.py | 27 + recipes/vaapi/all/test_package/test_package.c | 38 + .../vaapi/all/test_v1_package/CMakeLists.txt | 10 + .../vaapi/all/test_v1_package/conanfile.py | 18 + recipes/vaapi/config.yml | 3 + recipes/valijson/all/conandata.yml | 10 + recipes/valijson/all/conanfile.py | 61 + .../valijson/all/test_package/CMakeLists.txt | 18 + .../valijson/all/test_package/conanfile.py | 34 + .../valijson/all/test_package/invalid.json | 1 + recipes/valijson/all/test_package/schema.json | 20 + .../all/test_package/test_package.cpp | 62 + recipes/valijson/all/test_package/valid.json | 1 + .../all/test_v1_package/CMakeLists.txt | 20 + .../valijson/all/test_v1_package/conanfile.py | 28 + recipes/valijson/config.yml | 7 + recipes/variant-lite/all/conandata.yml | 7 + recipes/variant-lite/all/conanfile.py | 55 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 30 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/variant-lite/config.yml | 5 + recipes/vc/all/conandata.yml | 7 + recipes/vc/all/conanfile.py | 68 + recipes/vc/all/test_package/CMakeLists.txt | 8 + recipes/vc/all/test_package/conanfile.py | 26 + recipes/vc/all/test_package/test_package.cpp | 16 + recipes/vc/all/test_v1_package/CMakeLists.txt | 11 + recipes/vc/all/test_v1_package/conanfile.py | 17 + recipes/vc/config.yml | 5 + recipes/vcglib/all/CMakeLists.txt | 23 + recipes/vcglib/all/conandata.yml | 12 + recipes/vcglib/all/conanfile.py | 76 + .../all/patches/0001-use-external-eigen.patch | 17 + .../vcglib/all/test_package/CMakeLists.txt | 8 + recipes/vcglib/all/test_package/conanfile.py | 27 + recipes/vcglib/all/test_package/cube.obj | 14 + .../vcglib/all/test_package/test_package.cpp | 34 + .../vcglib/all/test_v1_package/CMakeLists.txt | 11 + .../vcglib/all/test_v1_package/conanfile.py | 18 + recipes/vcglib/config.yml | 5 + recipes/vdpau/all/conanfile.py | 54 + recipes/vdpau/all/test_package/CMakeLists.txt | 10 + recipes/vdpau/all/test_package/conanfile.py | 27 + recipes/vdpau/all/test_package/test_package.c | 46 + .../vdpau/all/test_v1_package/CMakeLists.txt | 8 + .../vdpau/all/test_v1_package/conanfile.py | 18 + recipes/vdpau/config.yml | 3 + recipes/vectorclass/all/CMakeLists.txt | 15 + recipes/vectorclass/all/conandata.yml | 10 + recipes/vectorclass/all/conanfile.py | 91 + .../all/test_package/CMakeLists.txt | 8 + .../vectorclass/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 62 + .../all/test_v1_package/CMakeLists.txt | 11 + .../all/test_v1_package/conanfile.py | 17 + recipes/vectorclass/config.yml | 7 + recipes/vectorial/all/conandata.yml | 4 + recipes/vectorial/all/conanfile.py | 42 + .../vectorial/all/test_package/CMakeLists.txt | 7 + .../vectorial/all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 9 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 + recipes/vectorial/config.yml | 3 + recipes/veque/all/conandata.yml | 7 + recipes/veque/all/conanfile.py | 69 + recipes/veque/all/test_package/CMakeLists.txt | 8 + recipes/veque/all/test_package/conanfile.py | 25 + .../veque/all/test_package/test_package.cpp | 15 + .../veque/all/test_v1_package/CMakeLists.txt | 11 + .../veque/all/test_v1_package/conanfile.py | 17 + recipes/veque/config.yml | 5 + recipes/verilator/all/conandata.yml | 28 + recipes/verilator/all/conanfile.py | 204 + ...01-split-opt-and-debug-build-install.patch | 33 + .../all/patches/0002-msvc-patches.patch | 141 + .../all/patches/0003-add-msvc_link-sh.patch | 65 + .../all/patches/0004-msvc-patches.patch | 88 + .../verilator/all/test_package/CMakeLists.txt | 22 + recipes/verilator/all/test_package/blinky.cpp | 50 + recipes/verilator/all/test_package/blinky.v | 43 + .../verilator/all/test_package/blinky_sc.cpp | 39 + .../verilator/all/test_package/conanfile.py | 31 + recipes/verilator/config.yml | 9 + .../all/conandata.yml | 4 + .../vincentlaucsb-csv-parser/all/conanfile.py | 48 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 25 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 17 + recipes/vincentlaucsb-csv-parser/config.yml | 3 + recipes/visit_struct/all/conandata.yml | 4 + recipes/visit_struct/all/conanfile.py | 49 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 27 + recipes/visit_struct/config.yml | 3 + recipes/vk-bootstrap/all/conandata.yml | 30 + recipes/vk-bootstrap/all/conanfile.py | 118 + .../all/patches/0001-fix-cmake-0.2.patch | 43 + .../all/patches/0001-fix-cmake-0.3.1.patch | 23 + .../all/patches/0001-fix-cmake-0.4.patch | 11 + .../all/patches/0001-fix-cmake-0.5.patch | 20 + .../all/patches/0001-fix-cmake-0.6.patch | 13 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/vk-bootstrap/config.yml | 13 + recipes/volk/all/conandata.yml | 46 + recipes/volk/all/conanfile.py | 93 + recipes/volk/all/test_package/CMakeLists.txt | 11 + recipes/volk/all/test_package/conanfile.py | 28 + recipes/volk/all/test_package/test_package.c | 16 + .../volk/all/test_v1_package/CMakeLists.txt | 14 + recipes/volk/all/test_v1_package/conanfile.py | 17 + recipes/volk/config.yml | 31 + recipes/vorbis/all/conandata.yml | 10 + recipes/vorbis/all/conanfile.py | 124 + .../patches/link-libm-find-package-ogg.patch | 56 + recipes/vorbis/all/test_package/8kadpcm.wav | Bin 0 -> 56072 bytes .../vorbis/all/test_package/CMakeLists.txt | 7 + recipes/vorbis/all/test_package/conanfile.py | 27 + .../vorbis/all/test_package/test_package.c | 252 ++ .../vorbis/all/test_v1_package/CMakeLists.txt | 10 + .../vorbis/all/test_v1_package/conanfile.py | 19 + recipes/vorbis/config.yml | 5 + recipes/voropp/all/CMakeLists.txt | 15 + recipes/voropp/all/conandata.yml | 4 + recipes/voropp/all/conanfile.py | 64 + .../voropp/all/test_package/CMakeLists.txt | 7 + recipes/voropp/all/test_package/conanfile.py | 26 + .../voropp/all/test_package/test_package.cpp | 29 + .../voropp/all/test_v1_package/CMakeLists.txt | 8 + .../voropp/all/test_v1_package/conanfile.py | 17 + recipes/voropp/config.yml | 3 + recipes/vtu11/all/conandata.yml | 10 + recipes/vtu11/all/conanfile.py | 75 + ...0001-use-CPP17-filesystem-by-default.patch | 33 + recipes/vtu11/all/test_package/CMakeLists.txt | 9 + recipes/vtu11/all/test_package/conanfile.py | 33 + .../vtu11/all/test_package/test_package.cpp | 50 + .../vtu11/all/test_v1_package/CMakeLists.txt | 8 + .../vtu11/all/test_v1_package/conanfile.py | 25 + recipes/vtu11/config.yml | 3 + recipes/vulkan-headers/all/conandata.yml | 85 + recipes/vulkan-headers/all/conanfile.py | 55 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 21 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/vulkan-headers/config.yml | 57 + recipes/vulkan-loader/all/conandata.yml | 78 + recipes/vulkan-loader/all/conanfile.py | 193 + .../patches/1.2.154.0-0001-fix-mingw.patch | 77 + .../all/patches/1.2.182-0001-fix-mingw.patch | 24 + ...3.231.1-0001-no-find-package-wayland.patch | 13 + ...6.0-0001-cmake-minimum-required-3.10.patch | 24 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 37 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/vulkan-loader/config.yml | 37 + .../vulkan-memory-allocator/all/conandata.yml | 13 + .../vulkan-memory-allocator/all/conanfile.py | 58 + .../all/patches/0001-fix-appleclang.patch | 97 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/vulkan-memory-allocator/config.yml | 7 + .../vulkan-validationlayers/all/conandata.yml | 75 + .../vulkan-validationlayers/all/conanfile.py | 229 ++ .../all/dependencies/dependencies-1.2.182.yml | 3 + .../dependencies/dependencies-1.2.189.2.yml | 3 + .../dependencies/dependencies-1.2.198.0.yml | 3 + .../dependencies/dependencies-1.3.204.1.yml | 3 + .../dependencies/dependencies-1.3.211.0.yml | 3 + .../dependencies/dependencies-1.3.216.0.yml | 3 + .../dependencies/dependencies-1.3.224.1.yml | 3 + .../dependencies/dependencies-1.3.231.1.yml | 3 + .../dependencies/dependencies-1.3.236.0.yml | 3 + .../dependencies/dependencies-1.3.239.0.yml | 3 + .../all/patches/1.2.182-0001-fix-cmake.patch | 83 + .../patches/1.2.189.2-0001-fix-cmake.patch | 75 + .../patches/1.2.198.0-0001-fix-cmake.patch | 75 + .../patches/1.3.204.1-0001-fix-cmake.patch | 31 + .../patches/1.3.224.1-0001-fix-cmake.patch | 31 + .../patches/1.3.231.1-0001-fix-cmake.patch | 30 + .../1.3.231.1-0002-cmake-no-werror.patch | 13 + .../patches/1.3.236.0-0001-fix-cmake.patch | 10 + .../patches/1.3.239.0-0001-fix-cmake.patch | 11 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/vulkan-validationlayers/config.yml | 21 + recipes/waf/all/conandata.yml | 4 + recipes/waf/all/conanfile.py | 60 + recipes/waf/all/test_package/a.cpp | 11 + recipes/waf/all/test_package/b.cpp | 1 + recipes/waf/all/test_package/conanfile.py | 42 + recipes/waf/all/test_package/main.c | 3 + recipes/waf/all/test_package/main.cpp | 8 + recipes/waf/all/test_package/wscript | 36 + recipes/waf/config.yml | 3 + recipes/wasmedge/all/conandata.yml | 153 + recipes/wasmedge/all/conanfile.py | 90 + .../wasmedge/all/test_package/CMakeLists.txt | 8 + .../wasmedge/all/test_package/conanfile.py | 26 + .../wasmedge/all/test_package/test_package.c | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../wasmedge/all/test_v1_package/conanfile.py | 18 + recipes/wasmedge/config.yml | 11 + recipes/wasmer/all/conandata.yml | 115 + recipes/wasmer/all/conanfile.py | 94 + .../wasmer/all/test_package/CMakeLists.txt | 8 + recipes/wasmer/all/test_package/conanfile.py | 26 + .../wasmer/all/test_package/test_package.c | 15 + .../wasmer/all/test_v1_package/CMakeLists.txt | 8 + .../wasmer/all/test_v1_package/conanfile.py | 18 + recipes/wasmer/config.yml | 11 + recipes/wasmtime-cpp/all/conandata.yml | 34 + recipes/wasmtime-cpp/all/conanfile.py | 74 + .../all/test_package/CMakeLists.txt | 12 + .../all/test_package/conanfile.py | 25 + .../wasmtime-cpp/all/test_package/hello.wat | 4 + .../all/test_package/test_package.cpp | 61 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 18 + recipes/wasmtime-cpp/config.yml | 23 + recipes/wasmtime/all/conandata.yml | 355 ++ recipes/wasmtime/all/conanfile.py | 119 + .../wasmtime/all/test_package/CMakeLists.txt | 9 + .../wasmtime/all/test_package/conanfile.py | 25 + .../wasmtime/all/test_package/test_package.c | 35 + .../all/test_v1_package/CMakeLists.txt | 9 + .../wasmtime/all/test_v1_package/conanfile.py | 18 + recipes/wasmtime/config.yml | 25 + recipes/watcher/all/conandata.yml | 38 + recipes/watcher/all/conanfile.py | 83 + .../all/patches/0.3.1-fix-include.patch | 12 + .../all/patches/0.5.5-fix-limits_max.patch | 13 + .../watcher/all/test_package/CMakeLists.txt | 21 + recipes/watcher/all/test_package/conanfile.py | 26 + .../watcher/all/test_package/test_package.cpp | 47 + .../all/test_v1_package/CMakeLists.txt | 9 + .../watcher/all/test_v1_package/conanfile.py | 17 + recipes/watcher/config.yml | 19 + recipes/wavelet_buffer/all/conandata.yml | 24 + recipes/wavelet_buffer/all/conanfile.py | 117 + .../0001-0.4.0-cmake-no-openblas.patch | 18 + .../0002-0.4.0-cmake-find-jpeblib.patch | 20 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 47 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/wavelet_buffer/config.yml | 5 + recipes/wayland-protocols/all/conandata.yml | 22 + recipes/wayland-protocols/all/conanfile.py | 77 + .../all/test_package/conanfile.py | 52 + .../all/test_package/meson.build | 36 + .../all/test_package/meson_options.txt | 1 + .../all/test_package/test_package.c | 18 + .../all/test_v1_package/conanfile.py | 27 + .../all/test_v1_package/meson.build | 30 + recipes/wayland-protocols/config.yml | 15 + recipes/wayland/all/conandata.yml | 13 + recipes/wayland/all/conanfile.py | 179 + .../wayland/all/test_package/CMakeLists.txt | 7 + recipes/wayland/all/test_package/conanfile.py | 55 + .../wayland/all/test_package/test_package.c | 20 + .../all/test_v1_package/CMakeLists.txt | 8 + .../wayland/all/test_v1_package/conanfile.py | 21 + recipes/wayland/config.yml | 9 + recipes/websocketpp/all/conandata.yml | 21 + recipes/websocketpp/all/conanfile.py | 74 + .../all/patches/support-gcc-12.patch | 93 + .../websocket_boost_support_1_7_x.patch | 157 + .../all/test_package/CMakeLists.txt | 8 + .../websocketpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 7 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/websocketpp/config.yml | 5 + recipes/wg21-linear_algebra/all/conandata.yml | 4 + recipes/wg21-linear_algebra/all/conanfile.py | 65 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 18 + recipes/wg21-linear_algebra/config.yml | 3 + recipes/wglext/all/conandata.yml | 4 + recipes/wglext/all/conanfile.py | 37 + .../wglext/all/test_package/CMakeLists.txt | 10 + recipes/wglext/all/test_package/conanfile.py | 17 + .../wglext/all/test_package/test_package.c | 74 + recipes/wglext/config.yml | 3 + recipes/whereami/all/CMakeLists.txt | 25 + recipes/whereami/all/conandata.yml | 4 + recipes/whereami/all/conanfile.py | 59 + .../whereami/all/test_package/CMakeLists.txt | 10 + .../whereami/all/test_package/conanfile.py | 17 + .../whereami/all/test_package/test_package.c | 46 + recipes/whereami/config.yml | 3 + recipes/wil/all/conandata.yml | 12 + recipes/wil/all/conanfile.py | 92 + ....0.230202.1-0001-fix-type-conversion.patch | 11 + recipes/wil/all/test_package/CMakeLists.txt | 8 + recipes/wil/all/test_package/conanfile.py | 27 + recipes/wil/all/test_package/test_package.cpp | 12 + .../wil/all/test_v1_package/CMakeLists.txt | 8 + recipes/wil/all/test_v1_package/conanfile.py | 19 + recipes/wil/config.yml | 3 + recipes/wildmidi/all/conandata.yml | 4 + recipes/wildmidi/all/conanfile.py | 94 + .../wildmidi/all/test_package/CMakeLists.txt | 8 + .../wildmidi/all/test_package/conanfile.py | 26 + .../wildmidi/all/test_package/test_package.c | 11 + .../all/test_v1_package/CMakeLists.txt | 8 + .../wildmidi/all/test_v1_package/conanfile.py | 18 + recipes/wildmidi/config.yml | 3 + recipes/wilzegers-autotest/all/conandata.yml | 4 + recipes/wilzegers-autotest/all/conanfile.py | 36 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 17 + .../all/test_package/test_package.cpp | 7 + recipes/wilzegers-autotest/config.yml | 3 + recipes/wineditline/all/CMakeLists.txt | 8 + recipes/wineditline/all/conandata.yml | 8 + recipes/wineditline/all/conanfile.py | 64 + .../all/patches/0001-fix-cmakelists.patch | 43 + .../all/test_package/CMakeLists.txt | 10 + .../wineditline/all/test_package/conanfile.py | 18 + .../all/test_package/test_package.c | 12 + recipes/wineditline/config.yml | 3 + recipes/winflexbison/all/conandata.yml | 12 + recipes/winflexbison/all/conanfile.py | 90 + .../patches/0001-2.5.22-mingw-support.patch | 207 + .../patches/0001-2.5.24-mingw-support.patch | 201 + .../all/test_package/CMakeLists.txt | 51 + .../winflexbison/all/test_package/basic_nr.l | 77 + .../all/test_package/basic_nr.txt | 5 + .../all/test_package/conanfile.py | 31 + .../winflexbison/all/test_package/dummy_lex.c | 19 + .../all/test_package/mc_parser.yy | 44 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 26 + recipes/winflexbison/config.yml | 5 + recipes/winmd/all/conandata.yml | 4 + recipes/winmd/all/conanfile.py | 70 + recipes/winmd/all/test_package/CMakeLists.txt | 8 + recipes/winmd/all/test_package/conanfile.py | 26 + .../winmd/all/test_package/test_package.cpp | 12 + .../winmd/all/test_v1_package/CMakeLists.txt | 8 + .../winmd/all/test_v1_package/conanfile.py | 18 + recipes/winmd/config.yml | 4 + recipes/wiringpi/all/CMakeLists.txt | 40 + recipes/wiringpi/all/conandata.yml | 10 + recipes/wiringpi/all/conanfile.py | 69 + .../wiringpi/all/test_package/CMakeLists.txt | 7 + .../wiringpi/all/test_package/conanfile.py | 27 + .../wiringpi/all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 10 + .../wiringpi/all/test_v1_package/conanfile.py | 17 + recipes/wiringpi/config.yml | 7 + recipes/wise_enum/all/conandata.yml | 4 + recipes/wise_enum/all/conanfile.py | 90 + .../wise_enum/all/test_package/CMakeLists.txt | 8 + .../wise_enum/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 79 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/wise_enum/config.yml | 3 + recipes/wolfssl/all/conandata.yml | 22 + recipes/wolfssl/all/conanfile.py | 159 + .../wolfssl/all/test_package/CMakeLists.txt | 7 + recipes/wolfssl/all/test_package/conanfile.py | 26 + .../wolfssl/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../wolfssl/all/test_v1_package/conanfile.py | 17 + recipes/wolfssl/config.yml | 15 + recipes/wslay/all/conandata.yml | 8 + recipes/wslay/all/conanfile.py | 104 + .../wslay/all/patches/0001-msvc-support.patch | 74 + .../0002-cmake-install-shared-artifacts.patch | 10 + recipes/wslay/all/test_package/CMakeLists.txt | 11 + recipes/wslay/all/test_package/conanfile.py | 26 + recipes/wslay/all/test_package/test_package.c | 16 + .../wslay/all/test_v1_package/CMakeLists.txt | 8 + .../wslay/all/test_v1_package/conanfile.py | 17 + recipes/wslay/config.yml | 3 + recipes/wt/all/conandata.yml | 74 + recipes/wt/all/conanfile.py | 393 ++ .../patches/4.3.1-0001-use-cci-package.patch | 32 + .../wt/all/patches/4.3.1-0002-gcc_11.patch | 10 + .../patches/4.6.2-0001-use-cci-package.patch | 32 + .../patches/4.7.1-0001-use-cci-package.patch | 32 + .../patches/4.8.0-0001-use-cci-package.patch | 32 + recipes/wt/all/test_package/CMakeLists.txt | 21 + recipes/wt/all/test_package/conanfile.py | 26 + recipes/wt/all/test_package/test_package.cpp | 9 + recipes/wt/all/test_v1_package/CMakeLists.txt | 8 + recipes/wt/all/test_v1_package/conanfile.py | 18 + recipes/wt/config.yml | 19 + recipes/wtl/all/conandata.yml | 11 + recipes/wtl/all/conanfile.py | 45 + recipes/wtl/all/test_package/CMakeLists.txt | 8 + recipes/wtl/all/test_package/conanfile.py | 27 + recipes/wtl/all/test_package/example.cpp | 17 + .../wtl/all/test_v1_package/CMakeLists.txt | 8 + recipes/wtl/all/test_v1_package/conanfile.py | 19 + recipes/wtl/config.yml | 5 + recipes/wyhash/all/conandata.yml | 4 + recipes/wyhash/all/conanfile.py | 39 + .../wyhash/all/test_package/CMakeLists.txt | 8 + recipes/wyhash/all/test_package/conanfile.py | 26 + .../wyhash/all/test_package/test_package.c | 15 + .../wyhash/all/test_v1_package/CMakeLists.txt | 8 + .../wyhash/all/test_v1_package/conanfile.py | 18 + recipes/wyhash/config.yml | 3 + recipes/xapian-core/all/conandata.yml | 13 + recipes/xapian-core/all/conanfile.py | 211 + .../all/patches/0001-add-msvc-cl-sh.patch | 99 + .../all/patches/0002-add-cerrno.patch | 12 + .../all/test_package/CMakeLists.txt | 8 + .../xapian-core/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/xapian-core/config.yml | 5 + recipes/xbyak/all/conandata.yml | 22 + recipes/xbyak/all/conanfile.py | 43 + recipes/xbyak/all/test_package/CMakeLists.txt | 7 + recipes/xbyak/all/test_package/conanfile.py | 25 + .../xbyak/all/test_package/test_package.cpp | 126 + .../xbyak/all/test_v1_package/CMakeLists.txt | 10 + .../xbyak/all/test_v1_package/conanfile.py | 17 + recipes/xbyak/config.yml | 15 + recipes/xege/all/CMakeLists.txt | 7 + recipes/xege/all/conandata.yml | 4 + recipes/xege/all/conanfile.py | 58 + recipes/xege/all/test_package/CMakeLists.txt | 12 + recipes/xege/all/test_package/conanfile.py | 17 + recipes/xege/all/test_package/example.cpp | 11 + recipes/xege/config.yml | 3 + recipes/xerces-c/all/conandata.yml | 20 + recipes/xerces-c/all/conanfile.py | 158 + .../0001-remove-test-samples-324.patch | 27 + .../patches/0001-remove-test-samples.patch | 27 + .../all/patches/0002-find-icu-programs.patch | 12 + .../xerces-c/all/test_package/CMakeLists.txt | 8 + .../xerces-c/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../xerces-c/all/test_v1_package/conanfile.py | 17 + recipes/xerces-c/config.yml | 7 + recipes/xkbcommon/all/conandata.yml | 22 + recipes/xkbcommon/all/conanfile.py | 181 + .../xkbcommon/all/test_package/CMakeLists.txt | 7 + .../xkbcommon/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/xkbcommon/config.yml | 15 + recipes/xkeyboard-config/all/conanfile.py | 50 + .../all/test_package/conanfile.py | 23 + .../all/test_v1_package/conanfile.py | 13 + recipes/xkeyboard-config/config.yml | 3 + recipes/xlnt/all/conandata.yml | 12 + recipes/xlnt/all/conanfile.py | 105 + .../0001-fix-cmake-and-unvendor-deps.patch | 113 + .../all/patches/0002-include-limits.patch | 20 + recipes/xlnt/all/test_package/CMakeLists.txt | 8 + recipes/xlnt/all/test_package/conanfile.py | 26 + .../xlnt/all/test_package/test_package.cpp | 14 + .../xlnt/all/test_v1_package/CMakeLists.txt | 8 + recipes/xlnt/all/test_v1_package/conanfile.py | 17 + recipes/xlnt/config.yml | 3 + recipes/xmlsec/all/conandata.yml | 10 + recipes/xmlsec/all/conanfile.py | 241 ++ .../xmlsec/all/test_package/CMakeLists.txt | 14 + recipes/xmlsec/all/test_package/conanfile.py | 34 + recipes/xmlsec/all/test_package/rsakey.pem | 9 + .../xmlsec/all/test_package/sign1-tmpl.xml | 26 + recipes/xmlsec/all/test_package/sign1.c | 211 + .../xmlsec/all/test_v1_package/CMakeLists.txt | 8 + .../xmlsec/all/test_v1_package/conanfile.py | 20 + recipes/xmlsec/config.yml | 7 + recipes/xnnpack/all/conandata.yml | 10 + recipes/xnnpack/all/conanfile.py | 131 + .../xnnpack/all/test_package/CMakeLists.txt | 8 + recipes/xnnpack/all/test_package/conanfile.py | 26 + .../xnnpack/all/test_package/test_package.c | 13 + .../all/test_v1_package/CMakeLists.txt | 11 + .../xnnpack/all/test_v1_package/conanfile.py | 17 + .../xnnpack/all/xnnpack_project_include.cmake | 19 + recipes/xnnpack/config.yml | 7 + recipes/xorg-cf-files/all/conandata.yml | 7 + recipes/xorg-cf-files/all/conanfile.py | 100 + .../all/patches/1.0.7-0001-win-fixes.patch | 233 ++ .../xorg-cf-files/all/test_package/Imakefile | 4 + .../all/test_package/conanfile.py | 51 + .../all/test_package/test_package.c | 6 + .../all/test_v1_package/Imakefile | 4 + .../all/test_v1_package/conanfile.py | 45 + .../all/test_v1_package/test_package.c | 6 + recipes/xorg-cf-files/config.yml | 3 + recipes/xorg-gccmakedep/all/conandata.yml | 4 + recipes/xorg-gccmakedep/all/conanfile.py | 82 + .../xorg-gccmakedep/all/test_package/Makefile | 2 + .../all/test_package/conanfile.py | 31 + .../all/test_package/test_package.c | 8 + .../all/test_package/test_package.h | 8 + .../all/test_v1_package/Makefile | 2 + .../all/test_v1_package/conanfile.py | 20 + .../all/test_v1_package/test_package.c | 8 + .../all/test_v1_package/test_package.h | 8 + recipes/xorg-gccmakedep/config.yml | 3 + recipes/xorg-macros/all/conandata.yml | 7 + recipes/xorg-macros/all/conanfile.py | 95 + ...001-export-XORG_MACROS_VERSION-macro.patch | 12 + .../xorg-macros/all/test_package/Makefile.am | 0 .../xorg-macros/all/test_package/conanfile.py | 36 + .../xorg-macros/all/test_package/configure.ac | 14 + .../all/test_package/src/Makefile.am | 0 .../all/test_package/src/configure.ac | 14 + .../all/test_v1_package/Makefile.am | 0 .../all/test_v1_package/conanfile.py | 32 + .../all/test_v1_package/configure.ac | 14 + recipes/xorg-macros/config.yml | 3 + recipes/xorg-makedepend/all/conandata.yml | 4 + recipes/xorg-makedepend/all/conanfile.py | 86 + .../all/test_package/conanfile.py | 22 + .../all/test_package/test_package.c | 8 + .../all/test_package/test_package.h | 8 + .../all/test_v1_package/conanfile.py | 13 + .../all/test_v1_package/test_package.c | 8 + .../all/test_v1_package/test_package.h | 8 + recipes/xorg-makedepend/config.yml | 3 + recipes/xorg-proto/all/conandata.yml | 7 + recipes/xorg-proto/all/conanfile.py | 108 + .../xorg-proto/all/test_package/conanfile.py | 27 + .../all/test_package/src/CMakeLists.txt | 8 + .../all/test_package/src/test_package.c | 7 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 19 + recipes/xorg-proto/config.yml | 5 + recipes/xorg/all/conanfile.py | 95 + recipes/xorg/all/test_package/CMakeLists.txt | 7 + recipes/xorg/all/test_package/conanfile.py | 34 + recipes/xorg/all/test_package/test_package.c | 26 + .../xorg/all/test_v1_package/CMakeLists.txt | 10 + recipes/xorg/all/test_v1_package/conanfile.py | 18 + recipes/xorg/config.yml | 3 + recipes/xorstr/all/conandata.yml | 4 + recipes/xorstr/all/conanfile.py | 70 + .../xorstr/all/test_package/CMakeLists.txt | 8 + recipes/xorstr/all/test_package/conanfile.py | 26 + .../xorstr/all/test_package/test_package.cpp | 9 + .../xorstr/all/test_v1_package/CMakeLists.txt | 8 + .../xorstr/all/test_v1_package/conanfile.py | 17 + recipes/xorstr/config.yml | 3 + recipes/xoshiro-cpp/all/conandata.yml | 4 + recipes/xoshiro-cpp/all/conanfile.py | 74 + .../all/test_package/CMakeLists.txt | 10 + .../xoshiro-cpp/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 18 + .../all/test_v1_package/CMakeLists.txt | 13 + .../all/test_v1_package/conanfile.py | 18 + recipes/xoshiro-cpp/config.yml | 3 + recipes/xpack/all/conandata.yml | 23 + recipes/xpack/all/conanfile.py | 58 + .../all/patches/1.0.2-0001-use-cci.patch | 43 + recipes/xpack/all/test_package/CMakeLists.txt | 8 + recipes/xpack/all/test_package/conanfile.py | 25 + .../xpack/all/test_package/test_package.cpp | 14 + .../xpack/all/test_v1_package/CMakeLists.txt | 8 + .../xpack/all/test_v1_package/conanfile.py | 18 + recipes/xpack/config.yml | 7 + recipes/xproperty/all/conandata.yml | 4 + recipes/xproperty/all/conanfile.py | 73 + .../xproperty/all/test_package/CMakeLists.txt | 8 + .../xproperty/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 36 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/xproperty/config.yml | 3 + recipes/xqilla/all/conandata.yml | 9 + recipes/xqilla/all/conanfile.py | 137 + .../all/patches/0001-honor-deps-ldflags.patch | 11 + .../xqilla/all/test_package/CMakeLists.txt | 8 + recipes/xqilla/all/test_package/conanfile.py | 27 + .../xqilla/all/test_package/test_package.cpp | 14 + .../xqilla/all/test_v1_package/CMakeLists.txt | 8 + .../xqilla/all/test_v1_package/conanfile.py | 18 + recipes/xqilla/config.yml | 3 + recipes/xsd/all/conandata.yml | 16 + recipes/xsd/all/conanfile.py | 91 + .../all/patches/0002-missing-include.patch | 19 + .../0100-C++Parser_Expat_support.patch | 58 + .../patches/0105-Fix_path_handling_bug.patch | 19 + .../xsd/all/patches/0110-xerces-c3.2.patch | 182 + .../xsd/all/patches/0700_hurd_PATH_MAX.patch | 21 + recipes/xsd/all/test_package/conanfile.py | 10 + recipes/xsd/config.yml | 3 + recipes/xsimd/all/conandata.yml | 25 + recipes/xsimd/all/conanfile.py | 93 + recipes/xsimd/all/test_package/CMakeLists.txt | 26 + recipes/xsimd/all/test_package/conanfile.py | 25 + .../xsimd/all/test_package/test_package.cpp | 27 + .../xsimd/all/test_v1_package/CMakeLists.txt | 29 + .../xsimd/all/test_v1_package/conanfile.py | 17 + recipes/xsimd/config.yml | 17 + recipes/xtensor/all/conandata.yml | 59 + recipes/xtensor/all/conanfile.py | 134 + .../all/patches/0.21.4-cxx11-abi.patch | 22 + .../all/patches/0.21.5-cxx11-abi.patch | 22 + .../all/patches/0.23.9-cxx11-abi.patch | 21 + .../all/patches/0.24.0-cxx11-abi.patch | 21 + .../xtensor/all/test_package/CMakeLists.txt | 17 + recipes/xtensor/all/test_package/conanfile.py | 26 + .../xtensor/all/test_package/test_package.cpp | 16 + .../all/test_v1_package/CMakeLists.txt | 8 + .../xtensor/all/test_v1_package/conanfile.py | 17 + recipes/xtensor/config.yml | 19 + recipes/xtl/all/conandata.yml | 28 + recipes/xtl/all/conanfile.py | 96 + recipes/xtl/all/test_package/CMakeLists.txt | 8 + recipes/xtl/all/test_package/conanfile.py | 25 + recipes/xtl/all/test_package/test_package.cpp | 15 + .../xtl/all/test_v1_package/CMakeLists.txt | 8 + recipes/xtl/all/test_v1_package/conanfile.py | 17 + recipes/xtl/config.yml | 19 + recipes/xtr/all/conandata.yml | 13 + recipes/xtr/all/conanfile.py | 125 + recipes/xtr/all/test_package/CMakeLists.txt | 11 + recipes/xtr/all/test_package/conanfile.py | 17 + recipes/xtr/all/test_package/example.cpp | 9 + recipes/xtr/config.yml | 9 + recipes/xtrans/all/conanfile.py | 53 + recipes/xtrans/all/test_package/conanfile.py | 25 + .../xtrans/all/test_v1_package/conanfile.py | 13 + recipes/xtrans/config.yml | 3 + recipes/xxhash/all/conandata.yml | 17 + recipes/xxhash/all/conanfile.py | 88 + .../all/patches/0.8.1-fix-cmakelists.patch | 13 + .../0.8.1-fix-static-assert-link-error.patch | 14 + .../xxhash/all/test_package/CMakeLists.txt | 7 + recipes/xxhash/all/test_package/conanfile.py | 26 + .../xxhash/all/test_package/test_package.c | 15 + .../xxhash/all/test_v1_package/CMakeLists.txt | 8 + .../xxhash/all/test_v1_package/conanfile.py | 17 + recipes/xxhash/config.yml | 5 + recipes/xxsds-sdsl-lite/all/conandata.yml | 18 + recipes/xxsds-sdsl-lite/all/conanfile.py | 46 + .../all/patches/bits.hpp.patch | 22 + .../all/patches/util.hpp.patch | 13 + .../all/test_package/CMakeLists.txt | 11 + .../all/test_package/conanfile.py | 18 + .../all/test_package/test_package.cpp | 42 + recipes/xxsds-sdsl-lite/config.yml | 5 + recipes/xz_utils/all/conandata.yml | 21 + recipes/xz_utils/all/conanfile.py | 201 + .../0001-relax_windows-sdk-restriction.patch | 20 + .../xz_utils/all/test_package/CMakeLists.txt | 26 + .../xz_utils/all/test_package/conanfile.py | 26 + .../xz_utils/all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../xz_utils/all/test_v1_package/conanfile.py | 17 + recipes/xz_utils/config.yml | 11 + recipes/yaclib/all/conandata.yml | 15 + recipes/yaclib/all/conanfile.py | 157 + ...7-as-default-or-20-if-CORO-specified.patch | 17 + .../patches/0002-Add-install-commands.patch | 30 + .../yaclib/all/test_package/CMakeLists.txt | 13 + recipes/yaclib/all/test_package/conanfile.py | 30 + .../yaclib/all/test_package/test_package.cpp | 25 + .../yaclib/all/test_v1_package/CMakeLists.txt | 8 + .../yaclib/all/test_v1_package/conanfile.py | 17 + recipes/yaclib/config.yml | 5 + recipes/yajl/all/conandata.yml | 4 + recipes/yajl/all/conanfile.py | 69 + recipes/yajl/all/test_package/CMakeLists.txt | 8 + recipes/yajl/all/test_package/conanfile.py | 26 + recipes/yajl/all/test_package/test_package.c | 19 + .../yajl/all/test_v1_package/CMakeLists.txt | 8 + recipes/yajl/all/test_v1_package/conanfile.py | 19 + recipes/yajl/config.yml | 3 + recipes/yaml-cpp/all/conandata.yml | 11 + recipes/yaml-cpp/all/conanfile.py | 118 + .../all/patches/0001-install-0.7.0.patch | 17 + .../all/patches/0002-libcxx-and-gcc.patch | 23 + .../yaml-cpp/all/test_package/CMakeLists.txt | 8 + .../yaml-cpp/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 26 + .../all/test_v1_package/CMakeLists.txt | 8 + .../yaml-cpp/all/test_v1_package/conanfile.py | 17 + recipes/yaml-cpp/config.yml | 5 + recipes/yandex-ozo/all/conandata.yml | 4 + recipes/yandex-ozo/all/conanfile.py | 86 + .../all/test_package/CMakeLists.txt | 11 + .../yandex-ozo/all/test_package/conanfile.py | 17 + .../yandex-ozo/all/test_package/request.cpp | 29 + recipes/yandex-ozo/config.yml | 3 + recipes/yas/all/conandata.yml | 10 + recipes/yas/all/conanfile.py | 39 + recipes/yas/all/test_package/CMakeLists.txt | 10 + recipes/yas/all/test_package/conanfile.py | 17 + recipes/yas/all/test_package/test_package.cpp | 37 + recipes/yas/config.yml | 7 + recipes/yasm/all/conandata.yml | 9 + recipes/yasm/all/conanfile.py | 112 + .../yasm/all/patches/0001-cmake-updates.patch | 67 + recipes/yasm/all/test_package/conanfile.py | 13 + recipes/yasm/all/test_v1_package/conanfile.py | 10 + recipes/yasm/config.yml | 3 + recipes/yder/all/conandata.yml | 9 + recipes/yder/all/conanfile.py | 149 + .../1.4.18-0001-shared-static-conan.patch | 406 ++ recipes/yder/all/test_package/CMakeLists.txt | 13 + recipes/yder/all/test_package/conanfile.py | 31 + recipes/yder/all/test_package/test_package.c | 13 + .../yder/all/test_v1_package/CMakeLists.txt | 16 + recipes/yder/all/test_v1_package/conanfile.py | 18 + recipes/yder/config.yml | 3 + recipes/yojimbo/all/conandata.yml | 4 + recipes/yojimbo/all/conanfile.py | 117 + recipes/yojimbo/all/submoduledata.yml | 10 + .../yojimbo/all/test_package/CMakeLists.txt | 8 + recipes/yojimbo/all/test_package/conanfile.py | 17 + .../yojimbo/all/test_package/test_package.cpp | 19 + recipes/yojimbo/config.yml | 3 + recipes/yyjson/all/conandata.yml | 16 + recipes/yyjson/all/conanfile.py | 64 + .../yyjson/all/test_package/CMakeLists.txt | 7 + recipes/yyjson/all/test_package/conanfile.py | 25 + .../yyjson/all/test_package/test_package.c | 29 + .../yyjson/all/test_v1_package/CMakeLists.txt | 8 + .../yyjson/all/test_v1_package/conanfile.py | 17 + recipes/yyjson/config.yml | 11 + recipes/z3/all/CMakeLists.txt | 7 + recipes/z3/all/conandata.yml | 30 + recipes/z3/all/conanfile.py | 159 + .../0001-cmake-use-conan-mpir-4.10.2.patch | 22 + .../0001-cmake-use-conan-mpir-4.8.8.patch | 23 + .../patches/0002-python-interp-3-4.8.8.patch | 11 + .../0003-cmake-try-compile-flags-4.10.2.patch | 17 + recipes/z3/all/test_package/CMakeLists.txt | 10 + recipes/z3/all/test_package/conanfile.py | 17 + recipes/z3/all/test_package/test_package.cpp | 145 + recipes/z3/config.yml | 5 + recipes/zbar/all/conandata.yml | 12 + recipes/zbar/all/conanfile.py | 160 + .../zbar/all/patches/0001-support-aarch.patch | 12 + recipes/zbar/all/test_package/CMakeLists.txt | 11 + recipes/zbar/all/test_package/conanfile.py | 26 + recipes/zbar/all/test_package/test_package.c | 38 + .../zbar/all/test_v1_package/CMakeLists.txt | 8 + recipes/zbar/all/test_v1_package/conanfile.py | 18 + recipes/zbar/config.yml | 5 + recipes/zeromq/all/conandata.yml | 22 + recipes/zeromq/all/conanfile.py | 180 + ...n-t-universally-supported-on-windows.patch | 81 + ...x-for-calling-convention-on-function.patch | 34 + .../all/patches/0003-rpath-macos-4.3.2.patch | 24 + .../all/patches/0003-rpath-macos-4.3.3.patch | 24 + .../0004-cmake-minimum-required-first.patch | 15 + .../zeromq/all/test_package/CMakeLists.txt | 22 + recipes/zeromq/all/test_package/conanfile.py | 33 + .../zeromq/all/test_package/test_package.cpp | 30 + .../zeromq/all/test_v1_package/CMakeLists.txt | 8 + .../zeromq/all/test_v1_package/conanfile.py | 20 + recipes/zeromq/config.yml | 7 + recipes/zfp/all/conandata.yml | 7 + recipes/zfp/all/conanfile.py | 124 + recipes/zfp/all/test_package/CMakeLists.txt | 7 + recipes/zfp/all/test_package/conanfile.py | 26 + recipes/zfp/all/test_package/test_package.cpp | 33 + .../zfp/all/test_v1_package/CMakeLists.txt | 8 + recipes/zfp/all/test_v1_package/conanfile.py | 17 + recipes/zfp/config.yml | 5 + recipes/zimg/all/conandata.yml | 33 + recipes/zimg/all/conanfile.py | 148 + ...-msvc-remove-windows-target-platform.patch | 22 + .../zimg/all/patches/0002-msvc-solution.patch | 14 + .../all/patches/0003-include-stddef.patch | 8 + recipes/zimg/all/test_package/CMakeLists.txt | 7 + recipes/zimg/all/test_package/conanfile.py | 26 + recipes/zimg/all/test_package/test_package.c | 10 + .../zimg/all/test_v1_package/CMakeLists.txt | 8 + recipes/zimg/all/test_v1_package/conanfile.py | 17 + recipes/zimg/config.yml | 11 + recipes/zint/all/conandata.yml | 7 + recipes/zint/all/conanfile.py | 137 + .../0001-2.10.0-conan-integration.patch | 152 + recipes/zint/all/test_package/CMakeLists.txt | 17 + recipes/zint/all/test_package/conanfile.py | 34 + recipes/zint/all/test_package/test_package.c | 16 + .../zint/all/test_package/test_package.cpp | 13 + .../zint/all/test_v1_package/CMakeLists.txt | 20 + recipes/zint/all/test_v1_package/conanfile.py | 21 + recipes/zint/config.yml | 3 + recipes/zlib-ng/all/conandata.yml | 13 + recipes/zlib-ng/all/conanfile.py | 104 + .../zlib-ng/all/test_package/CMakeLists.txt | 8 + recipes/zlib-ng/all/test_package/conanfile.py | 26 + .../zlib-ng/all/test_package/test_package.c | 15 + .../all/test_v1_package/CMakeLists.txt | 8 + .../zlib-ng/all/test_v1_package/conanfile.py | 17 + recipes/zlib-ng/config.yml | 9 + recipes/zlib/all/conandata.yml | 34 + recipes/zlib/all/conanfile.py | 109 + .../all/patches/1.2.13/0001-Fix-cmake.patch | 118 + .../all/patches/1.2.x/0001-fix-cmake.patch | 104 + .../0002-gzguts-xcode12-compile-fix.patch | 27 + .../0003-gzguts-fix-widechar-condition.patch | 13 + ...etting-a-gzip-header-extra-field-wit.patch | 35 + ...processing-bug-that-dereferences-NUL.patch | 32 + recipes/zlib/all/test_package/CMakeLists.txt | 7 + recipes/zlib/all/test_package/conanfile.py | 26 + recipes/zlib/all/test_package/test_package.c | 32 + .../zlib/all/test_v1_package/CMakeLists.txt | 10 + recipes/zlib/all/test_v1_package/conanfile.py | 16 + recipes/zlib/config.yml | 7 + recipes/zmarok-semver/all/conandata.yml | 15 + recipes/zmarok-semver/all/conanfile.py | 83 + .../all/patches/0001-unused-var-fix.patch | 19 + .../patches/0002-macro-invocation-fix.patch | 32 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 25 + .../all/test_package/test_package.cpp | 8 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 + recipes/zmarok-semver/config.yml | 3 + recipes/zmqpp/all/conandata.yml | 9 + recipes/zmqpp/all/conanfile.py | 87 + .../zmqpp/all/patches/0001-fix-cmake.patch | 103 + .../all/patches/0002-missing-includes.patch | 30 + ...003-Allow-building-with-Werror-undef.patch | 13 + recipes/zmqpp/all/test_package/CMakeLists.txt | 8 + recipes/zmqpp/all/test_package/conanfile.py | 26 + .../zmqpp/all/test_package/test_package.cpp | 9 + .../zmqpp/all/test_v1_package/CMakeLists.txt | 8 + .../zmqpp/all/test_v1_package/conanfile.py | 17 + recipes/zmqpp/config.yml | 3 + recipes/zopfli/all/conandata.yml | 4 + recipes/zopfli/all/conanfile.py | 92 + .../zopfli/all/test_package/CMakeLists.txt | 7 + recipes/zopfli/all/test_package/conanfile.py | 26 + .../zopfli/all/test_package/test_package.c | 10 + .../zopfli/all/test_v1_package/CMakeLists.txt | 10 + .../zopfli/all/test_v1_package/conanfile.py | 17 + recipes/zopfli/config.yml | 3 + recipes/zpp_bits/all/conandata.yml | 7 + recipes/zpp_bits/all/conanfile.py | 71 + .../zpp_bits/all/test_package/CMakeLists.txt | 8 + .../zpp_bits/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 24 + .../all/test_v1_package/CMakeLists.txt | 8 + .../zpp_bits/all/test_v1_package/conanfile.py | 18 + recipes/zpp_bits/config.yml | 5 + recipes/zpp_throwing/all/conandata.yml | 4 + recipes/zpp_throwing/all/conanfile.py | 87 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.cpp | 28 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 + recipes/zpp_throwing/config.yml | 3 + recipes/zstd/all/conandata.yml | 82 + recipes/zstd/all/conanfile.py | 92 + .../all/patches/1.3.5-cmake-project.patch | 12 + .../all/patches/1.4.5-cmake-install-dll.patch | 10 + ...5.0-remove-explicit-standard-setting.patch | 21 + ...1.5.1-cmake-remove-asm-except-x86_64.patch | 17 + ...1.5.2-cmake-remove-asm-except-x86_64.patch | 17 + .../1.5.4-decrease-min-cmake-version.patch | 36 + recipes/zstd/all/test_package/CMakeLists.txt | 11 + recipes/zstd/all/test_package/conanfile.py | 27 + recipes/zstd/all/test_package/logo.png | Bin 0 -> 18903 bytes recipes/zstd/all/test_package/test_package.c | 126 + .../zstd/all/test_v1_package/CMakeLists.txt | 8 + recipes/zstd/all/test_v1_package/conanfile.py | 18 + recipes/zstd/config.yml | 27 + recipes/zstr/all/conandata.yml | 13 + recipes/zstr/all/conanfile.py | 46 + recipes/zstr/all/test_package/CMakeLists.txt | 8 + recipes/zstr/all/test_package/conanfile.py | 26 + .../zstr/all/test_package/test_package.cpp | 9 + .../zstr/all/test_v1_package/CMakeLists.txt | 8 + recipes/zstr/all/test_v1_package/conanfile.py | 17 + recipes/zstr/config.yml | 9 + recipes/zug/all/conandata.yml | 4 + recipes/zug/all/conanfile.py | 57 + recipes/zug/all/test_package/CMakeLists.txt | 11 + recipes/zug/all/test_package/conanfile.py | 17 + recipes/zug/all/test_package/example.cpp | 37 + recipes/zug/config.yml | 3 + recipes/zulu-openjdk/all/conandata.yml | 40 + recipes/zulu-openjdk/all/conanfile.py | 74 + .../all/test_package/conanfile.py | 29 + .../all/test_v1_package/conanfile.py | 29 + recipes/zulu-openjdk/config.yml | 5 + recipes/zxing-cpp/all/conandata.yml | 33 + recipes/zxing-cpp/all/conanfile.py | 123 + .../1.0.8-0001-Fix-C2327-for-MSVC-2015.patch | 11 + .../patches/1.0.8-0002-include-limits.patch | 70 + .../1.0.8-0003-include-stdexcept.patch | 30 + .../patches/1.0.8-0004-include-cstddef.patch | 12 + .../patches/1.4.0-0001-fix-string-view.patch | 22 + .../zxing-cpp/all/test_package/CMakeLists.txt | 20 + .../zxing-cpp/all/test_package/conanfile.py | 32 + .../all/test_package/test_package.cpp | 39 + .../all/test_package/test_package_1.1.cpp | 46 + .../all/test_package/test_package_2.0.cpp | 45 + .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 27 + recipes/zxing-cpp/config.yml | 9 + recipes/zyre/all/CMakeLists.txt | 13 + recipes/zyre/all/conandata.yml | 20 + recipes/zyre/all/conanfile.py | 93 + ...-cmake-use-conan-disable-executables.patch | 66 + ...-disable-git-escape-CMAKE_BUILD_TYPE.patch | 20 + ...0-0003-fix-zyre-self-test-on-windows.patch | 55 + ...-cmake-use-conan-disable-executables.patch | 91 + ...-disable-git-escape-CMAKE_BUILD_TYPE.patch | 22 + recipes/zyre/all/test_package/CMakeLists.txt | 10 + recipes/zyre/all/test_package/conanfile.py | 17 + .../zyre/all/test_package/test_package.cpp | 11 + recipes/zyre/config.yml | 5 + recipes/zziplib/all/conandata.yml | 16 + recipes/zziplib/all/conanfile.py | 121 + .../zziplib/all/patches/0.13.71-001_fix.patch | 35 + .../zziplib/all/patches/0.13.72-001_fix.patch | 12 + .../zziplib/all/test_package/CMakeLists.txt | 7 + recipes/zziplib/all/test_package/conanfile.py | 26 + .../zziplib/all/test_package/test_package.c | 12 + .../all/test_v1_package/CMakeLists.txt | 8 + .../zziplib/all/test_v1_package/conanfile.py | 17 + recipes/zziplib/config.yml | 5 + 14375 files changed, 528434 insertions(+), 4 deletions(-) create mode 100644 .c3i/authorized_users.yml create mode 100644 .c3i/conan_v2_ready_references.yml create mode 100644 .c3i/config_v1.yml create mode 100644 .c3i/config_v2.yml create mode 100644 .c3i/reviewers.yml create mode 100644 .c3i/v1.jenkins create mode 100644 .c3i/v2.jenkins create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/ISSUE_TEMPLATE/center_conan_io.yml create mode 100644 .github/ISSUE_TEMPLATE/package_bug.yml create mode 100644 .github/ISSUE_TEMPLATE/package_request.yml create mode 100644 .github/ISSUE_TEMPLATE/package_upstream_update.yml create mode 100644 .github/ISSUE_TEMPLATE/question.yml create mode 100644 .github/ISSUE_TEMPLATE/service.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/actions/alert-community/action.yml create mode 100644 .github/actions/pr_changed_files/action.yml create mode 100644 .github/stale.yml create mode 100644 .github/workflows/alert-community.yml create mode 100644 .github/workflows/hooks-warnings.yml create mode 100644 .github/workflows/linter-conan-v2.yml create mode 100644 .github/workflows/linter-yaml.yml create mode 100644 .github/workflows/markdown-links.yml create mode 100644 .github/workflows/mlc_config.json create mode 100644 .github/workflows/on-push-do-doco.yml create mode 100644 CONTRIBUTING.md create mode 100644 README.md create mode 100644 assets/JFrogConanCenter.png create mode 100644 docs/CONTRIBUTOR_LICENSE_AGREEMENT.md create mode 100644 docs/README.md create mode 100644 docs/adding_packages/README.md create mode 100644 docs/adding_packages/build_and_package.md create mode 100644 docs/adding_packages/conandata_yml_format.md create mode 100644 docs/adding_packages/conanfile_attributes.md create mode 100644 docs/adding_packages/dependencies.md create mode 100644 docs/adding_packages/folders_and_files.md create mode 100644 docs/adding_packages/sources_and_patches.md create mode 100644 docs/adding_packages/test_packages.md create mode 100644 docs/bump_version.md create mode 100644 docs/changelog.md create mode 100644 docs/code_of_conduct.md create mode 100644 docs/community_resources.md create mode 100644 docs/consuming_recipes.md create mode 100644 docs/developing_recipes_locally.md create mode 100644 docs/error_knowledge_base.md create mode 100644 docs/faqs.md create mode 100644 docs/labels.md create mode 100644 docs/linters.md create mode 100644 docs/package_templates/README.md create mode 100644 docs/package_templates/autotools_package/all/conandata.yml create mode 100644 docs/package_templates/autotools_package/all/conanfile.py create mode 100644 docs/package_templates/autotools_package/all/test_package/CMakeLists.txt create mode 100644 docs/package_templates/autotools_package/all/test_package/conanfile.py create mode 100644 docs/package_templates/autotools_package/all/test_package/test_package.c create mode 100644 docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt create mode 100644 docs/package_templates/autotools_package/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/autotools_package/config.yml create mode 100644 docs/package_templates/cmake_package/all/conandata.yml create mode 100644 docs/package_templates/cmake_package/all/conanfile.py create mode 100644 docs/package_templates/cmake_package/all/test_package/CMakeLists.txt create mode 100644 docs/package_templates/cmake_package/all/test_package/conanfile.py create mode 100644 docs/package_templates/cmake_package/all/test_package/test_package.cpp create mode 100644 docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt create mode 100644 docs/package_templates/cmake_package/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/cmake_package/config.yml create mode 100644 docs/package_templates/header_only/all/conandata.yml create mode 100644 docs/package_templates/header_only/all/conanfile.py create mode 100644 docs/package_templates/header_only/all/test_package/CMakeLists.txt create mode 100644 docs/package_templates/header_only/all/test_package/conanfile.py create mode 100644 docs/package_templates/header_only/all/test_package/test_package.cpp create mode 100644 docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt create mode 100644 docs/package_templates/header_only/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/header_only/config.yml create mode 100644 docs/package_templates/meson_package/all/conandata.yml create mode 100644 docs/package_templates/meson_package/all/conanfile.py create mode 100644 docs/package_templates/meson_package/all/test_package/conanfile.py create mode 100644 docs/package_templates/meson_package/all/test_package/meson.build create mode 100644 docs/package_templates/meson_package/all/test_package/test_package.cpp create mode 100644 docs/package_templates/meson_package/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/meson_package/config.yml create mode 100644 docs/package_templates/msbuild_package/all/conandata.yml create mode 100644 docs/package_templates/msbuild_package/all/conanfile.py create mode 100644 docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt create mode 100644 docs/package_templates/msbuild_package/all/test_package/conanfile.py create mode 100644 docs/package_templates/msbuild_package/all/test_package/test_package.cpp create mode 100644 docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt create mode 100644 docs/package_templates/msbuild_package/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/msbuild_package/config.yml create mode 100644 docs/package_templates/prebuilt_tool_package/all/conandata.yml create mode 100644 docs/package_templates/prebuilt_tool_package/all/conanfile.py create mode 100644 docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py create mode 100644 docs/package_templates/prebuilt_tool_package/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/prebuilt_tool_package/config.yml create mode 100644 docs/review_process.md create mode 100644 docs/supported_platforms_and_configurations.md create mode 100644 docs/v2_linter.md create mode 100644 docs/v2_migration.md create mode 100644 docs/v2_roadmap.md create mode 100644 linter/__init__.py create mode 100644 linter/check_import_conanfile.py create mode 100644 linter/check_import_errors.py create mode 100644 linter/check_import_tools.py create mode 100644 linter/check_layout_src_folder.py create mode 100644 linter/check_package_name.py create mode 100644 linter/check_version_attribute.py create mode 100644 linter/conandata_yaml_linter.py create mode 100644 linter/conanv2_transition.py create mode 100644 linter/config_yaml_linter.py create mode 100644 linter/pylintrc_recipe create mode 100644 linter/pylintrc_testpackage create mode 100644 linter/recipe_linter.json create mode 100644 linter/transform_conanfile.py create mode 100644 linter/transform_imports.py create mode 100644 linter/yaml_linting.py create mode 100644 linter/yamllint_matcher.json create mode 100644 linter/yamllint_rules.yml create mode 100644 recipes/7zip/19.00/conandata.yml create mode 100644 recipes/7zip/19.00/conanfile.py create mode 100644 recipes/7zip/19.00/test_package/conanfile.py create mode 100644 recipes/7zip/config.yml create mode 100644 recipes/aaf/all/conandata.yml create mode 100644 recipes/aaf/all/conanfile.py create mode 100644 recipes/aaf/all/patches/1.2.0-001-simpler-cmakelists.patch create mode 100644 recipes/aaf/all/patches/1.2.0-002-link-core-with-find-library.patch create mode 100644 recipes/aaf/all/patches/1.2.0-003-remove-register-keyword.patch create mode 100644 recipes/aaf/all/patches/1.2.0-004-remove-expat.patch create mode 100644 recipes/aaf/all/patches/1.2.0-005-remove-libjpeg.patch create mode 100644 recipes/aaf/all/patches/1.2.0-006-link-libuuid.patch create mode 100644 recipes/aaf/all/patches/1.2.0-007-support-all-generators.patch create mode 100644 recipes/aaf/all/test_package/CMakeLists.txt create mode 100644 recipes/aaf/all/test_package/conanfile.py create mode 100644 recipes/aaf/all/test_package/test_package.cpp create mode 100644 recipes/aaf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aaf/all/test_v1_package/conanfile.py create mode 100644 recipes/aaf/config.yml create mode 100644 recipes/aaplus/all/conandata.yml create mode 100644 recipes/aaplus/all/conanfile.py create mode 100644 recipes/aaplus/all/patches/0001-fix-cmake.patch create mode 100644 recipes/aaplus/all/test_package/CMakeLists.txt create mode 100644 recipes/aaplus/all/test_package/conanfile.py create mode 100644 recipes/aaplus/all/test_package/test_package.cpp create mode 100644 recipes/aaplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aaplus/all/test_v1_package/conanfile.py create mode 100644 recipes/aaplus/config.yml create mode 100644 recipes/abseil/all/abi_trick/abi.h.in create mode 100644 recipes/abseil/all/abi_trick/conan_abi_test.cmake create mode 100644 recipes/abseil/all/conandata.yml create mode 100644 recipes/abseil/all/conanfile.py create mode 100644 recipes/abseil/all/patches/0001-cmake-install.patch create mode 100644 recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch create mode 100644 recipes/abseil/all/patches/0003-absl-string-libm.patch create mode 100644 recipes/abseil/all/patches/0004-cpp-standard-20200225.patch create mode 100644 recipes/abseil/all/patches/0004-cpp-standard-20200923.patch create mode 100644 recipes/abseil/all/patches/0004-cpp-standard-20210324.patch create mode 100644 recipes/abseil/all/patches/0005-has-unique-object-representations.patch create mode 100644 recipes/abseil/all/test_package/CMakeLists.txt create mode 100644 recipes/abseil/all/test_package/conanfile.py create mode 100644 recipes/abseil/all/test_package/test_package.cpp create mode 100644 recipes/abseil/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/abseil/all/test_v1_package/conanfile.py create mode 100644 recipes/abseil/config.yml create mode 100644 recipes/absent/all/conandata.yml create mode 100644 recipes/absent/all/conanfile.py create mode 100644 recipes/absent/all/test_package/CMakeLists.txt create mode 100644 recipes/absent/all/test_package/conanfile.py create mode 100644 recipes/absent/all/test_package/test_package.cpp create mode 100644 recipes/absent/config.yml create mode 100644 recipes/acado/all/CMakeLists.txt create mode 100644 recipes/acado/all/cmake/qpoases.cmake create mode 100644 recipes/acado/all/conandata.yml create mode 100644 recipes/acado/all/conanfile.py create mode 100644 recipes/acado/all/patches/0001-binding-temp-object.patch create mode 100644 recipes/acado/all/patches/0002-read-template-path-from-env.patch create mode 100644 recipes/acado/all/test_package/CMakeLists.txt create mode 100644 recipes/acado/all/test_package/codegen.cpp create mode 100644 recipes/acado/all/test_package/conanfile.py create mode 100644 recipes/acado/all/test_package/test_package.cpp create mode 100644 recipes/acado/config.yml create mode 100644 recipes/accellera-uvm-systemc/all/conandata.yml create mode 100644 recipes/accellera-uvm-systemc/all/conanfile.py create mode 100644 recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt create mode 100644 recipes/accellera-uvm-systemc/all/test_package/conanfile.py create mode 100644 recipes/accellera-uvm-systemc/all/test_package/example.cpp create mode 100644 recipes/accellera-uvm-systemc/config.yml create mode 100644 recipes/access_private/all/conandata.yml create mode 100644 recipes/access_private/all/conanfile.py create mode 100644 recipes/access_private/all/test_package/CMakeLists.txt create mode 100644 recipes/access_private/all/test_package/conanfile.py create mode 100644 recipes/access_private/all/test_package/test_package.cpp create mode 100644 recipes/access_private/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/access_private/all/test_v1_package/conanfile.py create mode 100644 recipes/access_private/config.yml create mode 100644 recipes/acl/all/conandata.yml create mode 100644 recipes/acl/all/conanfile.py create mode 100644 recipes/acl/all/test_package/CMakeLists.txt create mode 100644 recipes/acl/all/test_package/conanfile.py create mode 100644 recipes/acl/all/test_package/test_package.c create mode 100644 recipes/acl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/acl/all/test_v1_package/conanfile.py create mode 100644 recipes/acl/config.yml create mode 100644 recipes/ada/all/conandata.yml create mode 100644 recipes/ada/all/conanfile.py create mode 100644 recipes/ada/all/test_package/CMakeLists.txt create mode 100644 recipes/ada/all/test_package/conanfile.py create mode 100644 recipes/ada/all/test_package/test_package.cpp create mode 100644 recipes/ada/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ada/all/test_v1_package/conanfile.py create mode 100644 recipes/ada/config.yml create mode 100644 recipes/ade/all/conandata.yml create mode 100644 recipes/ade/all/conanfile.py create mode 100644 recipes/ade/all/test_package/CMakeLists.txt create mode 100644 recipes/ade/all/test_package/conanfile.py create mode 100644 recipes/ade/all/test_package/test_package.cpp create mode 100644 recipes/ade/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ade/all/test_v1_package/conanfile.py create mode 100644 recipes/ade/config.yml create mode 100644 recipes/aeron/all/conandata.yml create mode 100644 recipes/aeron/all/conanfile.py create mode 100644 recipes/aeron/all/test_package/CMakeLists.txt create mode 100644 recipes/aeron/all/test_package/conanfile.py create mode 100644 recipes/aeron/all/test_package/test_package.cpp create mode 100644 recipes/aeron/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aeron/all/test_v1_package/conanfile.py create mode 100644 recipes/aeron/config.yml create mode 100644 recipes/ags/all/conandata.yml create mode 100644 recipes/ags/all/conanfile.py create mode 100644 recipes/ags/all/test_package/CMakeLists.txt create mode 100644 recipes/ags/all/test_package/conanfile.py create mode 100644 recipes/ags/all/test_package/test_package.cpp create mode 100644 recipes/ags/config.yml create mode 100644 recipes/alac/all/CMakeLists.txt create mode 100644 recipes/alac/all/conandata.yml create mode 100644 recipes/alac/all/conanfile.py create mode 100644 recipes/alac/all/test_package/CMakeLists.txt create mode 100644 recipes/alac/all/test_package/conanfile.py create mode 100644 recipes/alac/all/test_package/test_package.cpp create mode 100644 recipes/alac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/alac/all/test_v1_package/conanfile.py create mode 100644 recipes/alac/config.yml create mode 100644 recipes/alembic/all/conandata.yml create mode 100644 recipes/alembic/all/conanfile.py create mode 100644 recipes/alembic/all/patches/1.8.2-0001-fix-cmake.patch create mode 100644 recipes/alembic/all/test_package/CMakeLists.txt create mode 100644 recipes/alembic/all/test_package/conanfile.py create mode 100644 recipes/alembic/all/test_package/test_package.cpp create mode 100644 recipes/alembic/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/alembic/all/test_v1_package/conanfile.py create mode 100644 recipes/alembic/config.yml create mode 100644 recipes/alpaca/all/conandata.yml create mode 100644 recipes/alpaca/all/conanfile.py create mode 100644 recipes/alpaca/all/test_package/CMakeLists.txt create mode 100644 recipes/alpaca/all/test_package/conanfile.py create mode 100644 recipes/alpaca/all/test_package/test_package.cpp create mode 100644 recipes/alpaca/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/alpaca/all/test_v1_package/conanfile.py create mode 100644 recipes/alpaca/config.yml create mode 100644 recipes/amgcl/all/conandata.yml create mode 100644 recipes/amgcl/all/conanfile.py create mode 100644 recipes/amgcl/all/test_package/CMakeLists.txt create mode 100644 recipes/amgcl/all/test_package/conanfile.py create mode 100644 recipes/amgcl/all/test_package/test_package.cpp create mode 100644 recipes/amgcl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/amgcl/all/test_v1_package/conanfile.py create mode 100644 recipes/amgcl/config.yml create mode 100644 recipes/amqp-cpp/all/conandata.yml create mode 100644 recipes/amqp-cpp/all/conanfile.py create mode 100644 recipes/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch create mode 100644 recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch create mode 100644 recipes/amqp-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/amqp-cpp/all/test_package/conanfile.py create mode 100644 recipes/amqp-cpp/all/test_package/test_package.cpp create mode 100644 recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/amqp-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/amqp-cpp/config.yml create mode 100644 recipes/andreasbuhr-cppcoro/all/CMakeLists.txt create mode 100644 recipes/andreasbuhr-cppcoro/all/conandata.yml create mode 100644 recipes/andreasbuhr-cppcoro/all/conanfile.py create mode 100644 recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt create mode 100644 recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py create mode 100644 recipes/andreasbuhr-cppcoro/all/test_package/test_package.cpp create mode 100644 recipes/andreasbuhr-cppcoro/config.yml create mode 100755 recipes/android-ndk/all/cmake-wrapper create mode 100644 recipes/android-ndk/all/cmake-wrapper.cmd create mode 100644 recipes/android-ndk/all/conandata.yml create mode 100644 recipes/android-ndk/all/conanfile.py create mode 100644 recipes/android-ndk/all/test_package/CMakeLists.txt create mode 100644 recipes/android-ndk/all/test_package/conanfile.py create mode 100644 recipes/android-ndk/all/test_package/test_package.cpp create mode 100644 recipes/android-ndk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/android-ndk/all/test_v1_package/conanfile.py create mode 100644 recipes/android-ndk/config.yml create mode 100644 recipes/angelscript/all/conandata.yml create mode 100644 recipes/angelscript/all/conanfile.py create mode 100644 recipes/angelscript/all/patches/2.35.0-0001-fix-compatibility-apple-clang.patch create mode 100644 recipes/angelscript/all/patches/2.35.1-0001-fix-compatibility-apple-clang.patch create mode 100644 recipes/angelscript/all/patches/2.36.0-0001-missing-include-stdint.patch create mode 100644 recipes/angelscript/all/test_package/CMakeLists.txt create mode 100644 recipes/angelscript/all/test_package/conanfile.py create mode 100644 recipes/angelscript/all/test_package/test_package.cpp create mode 100644 recipes/angelscript/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/angelscript/all/test_v1_package/conanfile.py create mode 100644 recipes/angelscript/config.yml create mode 100644 recipes/antlr4-cppruntime/all/conandata.yml create mode 100644 recipes/antlr4-cppruntime/all/conanfile.py create mode 100644 recipes/antlr4-cppruntime/all/patches/0001-update-cmakelist.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch create mode 100644 recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt create mode 100644 recipes/antlr4-cppruntime/all/test_package/conanfile.py create mode 100644 recipes/antlr4-cppruntime/all/test_package/test_package.cpp create mode 100644 recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py create mode 100644 recipes/antlr4-cppruntime/config.yml create mode 100644 recipes/any-lite/all/conandata.yml create mode 100644 recipes/any-lite/all/conanfile.py create mode 100644 recipes/any-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/any-lite/all/test_package/conanfile.py create mode 100644 recipes/any-lite/all/test_package/test_package.cpp create mode 100644 recipes/any-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/any-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/any-lite/config.yml create mode 100644 recipes/anyrpc/all/conandata.yml create mode 100644 recipes/anyrpc/all/conanfile.py create mode 100644 recipes/anyrpc/all/patches/0001-fix-asan-1.0.2.patch create mode 100644 recipes/anyrpc/all/patches/0002-fix-shared-library-1.0.2.patch create mode 100644 recipes/anyrpc/all/patches/0003-use-conan-libs-1.0.2.patch create mode 100644 recipes/anyrpc/all/test_package/CMakeLists.txt create mode 100644 recipes/anyrpc/all/test_package/conanfile.py create mode 100644 recipes/anyrpc/all/test_package/test_anyrpc.cpp create mode 100644 recipes/anyrpc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/anyrpc/all/test_v1_package/conanfile.py create mode 100644 recipes/anyrpc/config.yml create mode 100644 recipes/approvaltests.cpp/all/conandata.yml create mode 100644 recipes/approvaltests.cpp/all/conanfile.py create mode 100644 recipes/approvaltests.cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/approvaltests.cpp/all/test_package/conanfile.py create mode 100644 recipes/approvaltests.cpp/all/test_package/test_boosttest.Module.Suite.TestCase.approved.txt create mode 100644 recipes/approvaltests.cpp/all/test_package/test_boosttest.cpp create mode 100644 recipes/approvaltests.cpp/all/test_package/test_catch.Package.approved.txt create mode 100644 recipes/approvaltests.cpp/all/test_package/test_catch.cpp create mode 100644 recipes/approvaltests.cpp/all/test_package/test_cpputest.Group.Package.approved.txt create mode 100644 recipes/approvaltests.cpp/all/test_package/test_cpputest.cpp create mode 100644 recipes/approvaltests.cpp/all/test_package/test_doctest.Package.approved.txt create mode 100644 recipes/approvaltests.cpp/all/test_package/test_doctest.cpp create mode 100644 recipes/approvaltests.cpp/all/test_package/test_gtest.Package.GTest.approved.txt create mode 100644 recipes/approvaltests.cpp/all/test_package/test_gtest.cpp create mode 100644 recipes/approvaltests.cpp/all/test_package/test_package.cpp create mode 100644 recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/approvaltests.cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/approvaltests.cpp/config.yml create mode 100644 recipes/apr-util/all/conandata.yml create mode 100644 recipes/apr-util/all/conanfile.py create mode 100644 recipes/apr-util/all/patches/0001-fix-cmake.patch create mode 100644 recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch create mode 100644 recipes/apr-util/all/test_package/CMakeLists.txt create mode 100644 recipes/apr-util/all/test_package/conanfile.py create mode 100644 recipes/apr-util/all/test_package/test_package.c create mode 100644 recipes/apr-util/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/apr-util/all/test_v1_package/conanfile.py create mode 100644 recipes/apr-util/config.yml create mode 100644 recipes/apr/all/conandata.yml create mode 100644 recipes/apr/all/conanfile.py create mode 100644 recipes/apr/all/patches/0001-cmake-build-only-shared-static.patch create mode 100644 recipes/apr/all/patches/0002-apr-config-prefix-env.patch create mode 100644 recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch create mode 100644 recipes/apr/all/patches/0004-autotools-mingw.patch create mode 100644 recipes/apr/all/patches/0005-clang12-apple.patch create mode 100644 recipes/apr/all/patches/0006-sys_siglist-fix.patch create mode 100644 recipes/apr/all/patches/0007-cmake-minimum-required.patch create mode 100644 recipes/apr/all/test_package/CMakeLists.txt create mode 100644 recipes/apr/all/test_package/conanfile.py create mode 100644 recipes/apr/all/test_package/test_package.c create mode 100644 recipes/apr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/apr/all/test_v1_package/conanfile.py create mode 100644 recipes/apr/config.yml create mode 100644 recipes/apriltag/all/conandata.yml create mode 100644 recipes/apriltag/all/conanfile.py create mode 100644 recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch create mode 100644 recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch create mode 100644 recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch create mode 100644 recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch create mode 100644 recipes/apriltag/all/test_package/CMakeLists.txt create mode 100644 recipes/apriltag/all/test_package/conanfile.py create mode 100644 recipes/apriltag/all/test_package/test_package.c create mode 100644 recipes/apriltag/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/apriltag/all/test_v1_package/conanfile.py create mode 100644 recipes/apriltag/config.yml create mode 100644 recipes/aravis/all/conandata.yml create mode 100644 recipes/aravis/all/conanfile.py create mode 100644 recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch create mode 100644 recipes/aravis/all/test_package/CMakeLists.txt create mode 100644 recipes/aravis/all/test_package/conanfile.py create mode 100644 recipes/aravis/all/test_package/test_package.c create mode 100644 recipes/aravis/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aravis/all/test_v1_package/conanfile.py create mode 100644 recipes/aravis/config.yml create mode 100644 recipes/archicad-apidevkit/all/conandata.yml create mode 100644 recipes/archicad-apidevkit/all/conanfile.py create mode 100644 recipes/archicad-apidevkit/all/test_package/CMakeLists.txt create mode 100644 recipes/archicad-apidevkit/all/test_package/conanfile.py create mode 100644 recipes/archicad-apidevkit/all/test_package/test_gsroot.cpp create mode 100644 recipes/archicad-apidevkit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/archicad-apidevkit/all/test_v1_package/conanfile.py create mode 100644 recipes/archicad-apidevkit/config.yml create mode 100644 recipes/arcus/all/conandata.yml create mode 100644 recipes/arcus/all/conanfile.py create mode 100644 recipes/arcus/all/patches/0001-fix-cmake.patch create mode 100644 recipes/arcus/all/patches/0002-protobuf-compat-ge-3.18.patch create mode 100644 recipes/arcus/all/test_package/CMakeLists.txt create mode 100644 recipes/arcus/all/test_package/conanfile.py create mode 100644 recipes/arcus/all/test_package/test_package.cpp create mode 100644 recipes/arcus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arcus/all/test_v1_package/conanfile.py create mode 100644 recipes/arcus/config.yml create mode 100644 recipes/arduinojson/all/conandata.yml create mode 100644 recipes/arduinojson/all/conanfile.py create mode 100644 recipes/arduinojson/all/test_package/CMakeLists.txt create mode 100644 recipes/arduinojson/all/test_package/conanfile.py create mode 100644 recipes/arduinojson/all/test_package/test_package.cpp create mode 100644 recipes/arduinojson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arduinojson/all/test_v1_package/conanfile.py create mode 100644 recipes/arduinojson/config.yml create mode 100644 recipes/arg_router/all/conandata.yml create mode 100644 recipes/arg_router/all/conanfile.py create mode 100644 recipes/arg_router/all/test_package/CMakeLists.txt create mode 100644 recipes/arg_router/all/test_package/conanfile.py create mode 100644 recipes/arg_router/all/test_package/main.cpp create mode 100644 recipes/arg_router/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arg_router/all/test_v1_package/conanfile.py create mode 100644 recipes/arg_router/config.yml create mode 100644 recipes/argh/all/conandata.yml create mode 100644 recipes/argh/all/conanfile.py create mode 100644 recipes/argh/all/test_package/CMakeLists.txt create mode 100644 recipes/argh/all/test_package/conanfile.py create mode 100644 recipes/argh/all/test_package/test_package.cpp create mode 100644 recipes/argh/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/argh/all/test_v1_package/conanfile.py create mode 100644 recipes/argh/config.yml create mode 100644 recipes/argon2/all/conandata.yml create mode 100644 recipes/argon2/all/conanfile.py create mode 100644 recipes/argon2/all/patches/0001-makefile-no-march.patch create mode 100644 recipes/argon2/all/test_package/CMakeLists.txt create mode 100644 recipes/argon2/all/test_package/conanfile.py create mode 100644 recipes/argon2/all/test_package/test_package.c create mode 100644 recipes/argon2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/argon2/all/test_v1_package/conanfile.py create mode 100644 recipes/argon2/config.yml create mode 100644 recipes/argparse/all/conandata.yml create mode 100644 recipes/argparse/all/conanfile.py create mode 100644 recipes/argparse/all/patches/0001-v2.1-add-missing-include.patch create mode 100644 recipes/argparse/all/patches/0001-v2.2-add-missing-include.patch create mode 100644 recipes/argparse/all/patches/0001-v2.3-add-missing-include.patch create mode 100644 recipes/argparse/all/test_package/CMakeLists.txt create mode 100644 recipes/argparse/all/test_package/conanfile.py create mode 100644 recipes/argparse/all/test_package/test_package.cpp create mode 100644 recipes/argparse/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/argparse/all/test_v1_package/conanfile.py create mode 100644 recipes/argparse/config.yml create mode 100644 recipes/args-parser/all/conandata.yml create mode 100644 recipes/args-parser/all/conanfile.py create mode 100644 recipes/args-parser/all/test_package/CMakeLists.txt create mode 100644 recipes/args-parser/all/test_package/conanfile.py create mode 100644 recipes/args-parser/all/test_package/test_package.cpp create mode 100644 recipes/args-parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/args-parser/all/test_v1_package/conanfile.py create mode 100644 recipes/args-parser/config.yml create mode 100644 recipes/argtable2/all/conandata.yml create mode 100644 recipes/argtable2/all/conanfile.py create mode 100644 recipes/argtable2/all/patches/2.13-0001-enable-mingw-dll.patch create mode 100644 recipes/argtable2/all/patches/2.13-0002-msvc-nmake-honor-profile.patch create mode 100644 recipes/argtable2/all/patches/2.13-0003-armv8-build.patch create mode 100644 recipes/argtable2/all/test_package/CMakeLists.txt create mode 100644 recipes/argtable2/all/test_package/conanfile.py create mode 100644 recipes/argtable2/all/test_package/test_package.c create mode 100644 recipes/argtable2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/argtable2/all/test_v1_package/conanfile.py create mode 100644 recipes/argtable2/config.yml create mode 100644 recipes/argtable3/all/conandata.yml create mode 100644 recipes/argtable3/all/conanfile.py create mode 100644 recipes/argtable3/all/patches/3.1.5-0001-cmake-fixes.patch create mode 100644 recipes/argtable3/all/patches/3.2.0-0001-cmake-fixes.patch create mode 100644 recipes/argtable3/all/test_package/CMakeLists.txt create mode 100644 recipes/argtable3/all/test_package/conanfile.py create mode 100644 recipes/argtable3/all/test_package/test_package.c create mode 100644 recipes/argtable3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/argtable3/all/test_v1_package/conanfile.py create mode 100644 recipes/argtable3/config.yml create mode 100644 recipes/armadillo/all/conandata.yml create mode 100644 recipes/armadillo/all/conanfile.py create mode 100644 recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch create mode 100644 recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch create mode 100644 recipes/armadillo/all/test_package/CMakeLists.txt create mode 100644 recipes/armadillo/all/test_package/conanfile.py create mode 100644 recipes/armadillo/all/test_package/src/example.cpp create mode 100644 recipes/armadillo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/armadillo/all/test_v1_package/conanfile.py create mode 100644 recipes/armadillo/config.yml create mode 100644 recipes/arrow/all/conandata.yml create mode 100644 recipes/arrow/all/conanfile.py create mode 100644 recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch create mode 100644 recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch create mode 100644 recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch create mode 100644 recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch create mode 100644 recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch create mode 100644 recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch create mode 100644 recipes/arrow/all/patches/7.0.0-0006-install-utils.patch create mode 100644 recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch create mode 100644 recipes/arrow/all/patches/8.0.0-0005-install-utils.patch create mode 100644 recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch create mode 100644 recipes/arrow/all/test_package/CMakeLists.txt create mode 100644 recipes/arrow/all/test_package/conanfile.py create mode 100644 recipes/arrow/all/test_package/test_package.cpp create mode 100644 recipes/arrow/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arrow/all/test_v1_package/conanfile.py create mode 100644 recipes/arrow/config.yml create mode 100644 recipes/arsenalgear/all/CMakeLists.txt create mode 100644 recipes/arsenalgear/all/conandata.yml create mode 100644 recipes/arsenalgear/all/conanfile.py create mode 100644 recipes/arsenalgear/all/test_package/CMakeLists.txt create mode 100644 recipes/arsenalgear/all/test_package/conanfile.py create mode 100644 recipes/arsenalgear/all/test_package/test_package.cpp create mode 100644 recipes/arsenalgear/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arsenalgear/all/test_v1_package/conanfile.py create mode 100644 recipes/arsenalgear/config.yml create mode 100644 recipes/artery-font-format/all/conandata.yml create mode 100644 recipes/artery-font-format/all/conanfile.py create mode 100644 recipes/artery-font-format/all/test_package/CMakeLists.txt create mode 100644 recipes/artery-font-format/all/test_package/conanfile.py create mode 100644 recipes/artery-font-format/all/test_package/example.arfont create mode 100644 recipes/artery-font-format/all/test_package/test_package.cpp create mode 100644 recipes/artery-font-format/config.yml create mode 100644 recipes/aruco/3.x.x/conandata.yml create mode 100644 recipes/aruco/3.x.x/conanfile.py create mode 100644 recipes/aruco/3.x.x/test_package/CMakeLists.txt create mode 100644 recipes/aruco/3.x.x/test_package/conanfile.py create mode 100644 recipes/aruco/3.x.x/test_package/test_package.cpp create mode 100644 recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/aruco/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/aruco/config.yml create mode 100644 recipes/asio-grpc/all/conandata.yml create mode 100644 recipes/asio-grpc/all/conanfile.py create mode 100644 recipes/asio-grpc/all/test_package/CMakeLists.txt create mode 100644 recipes/asio-grpc/all/test_package/conanfile.py create mode 100644 recipes/asio-grpc/all/test_package/test.proto create mode 100644 recipes/asio-grpc/all/test_package/test_package.cpp create mode 100644 recipes/asio-grpc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/asio-grpc/all/test_v1_package/conanfile.py create mode 100644 recipes/asio-grpc/config.yml create mode 100644 recipes/asio/all/conandata.yml create mode 100644 recipes/asio/all/conanfile.py create mode 100644 recipes/asio/all/test_package/CMakeLists.txt create mode 100644 recipes/asio/all/test_package/conanfile.py create mode 100644 recipes/asio/all/test_package/test_package.cpp create mode 100644 recipes/asio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/asio/all/test_v1_package/conanfile.py create mode 100644 recipes/asio/config.yml create mode 100644 recipes/asmjit/all/conandata.yml create mode 100644 recipes/asmjit/all/conanfile.py create mode 100644 recipes/asmjit/all/test_package/CMakeLists.txt create mode 100644 recipes/asmjit/all/test_package/conanfile.py create mode 100644 recipes/asmjit/all/test_package/test_package.cpp create mode 100644 recipes/asmjit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/asmjit/all/test_v1_package/conanfile.py create mode 100644 recipes/asmjit/config.yml create mode 100644 recipes/asn1c/all/conandata.yml create mode 100644 recipes/asn1c/all/conanfile.py create mode 100644 recipes/asn1c/all/test_package/CMakeLists.txt create mode 100644 recipes/asn1c/all/test_package/MyModule.asn1 create mode 100644 recipes/asn1c/all/test_package/conanfile.py create mode 100644 recipes/asn1c/all/test_package/test_package.c create mode 100644 recipes/asn1c/config.yml create mode 100644 recipes/assimp/5.x/conandata.yml create mode 100644 recipes/assimp/5.x/conanfile.py create mode 100644 recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch create mode 100644 recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch create mode 100644 recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch create mode 100644 recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch create mode 100644 recipes/assimp/5.x/patches/0005-fix-unzip.patch create mode 100644 recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch create mode 100644 recipes/assimp/5.x/test_package/CMakeLists.txt create mode 100644 recipes/assimp/5.x/test_package/box.obj create mode 100644 recipes/assimp/5.x/test_package/conanfile.py create mode 100644 recipes/assimp/5.x/test_package/test_package.c create mode 100644 recipes/assimp/5.x/test_package/test_package.cpp create mode 100644 recipes/assimp/5.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/assimp/5.x/test_v1_package/conanfile.py create mode 100644 recipes/assimp/config.yml create mode 100644 recipes/astc-codec/all/conandata.yml create mode 100644 recipes/astc-codec/all/conanfile.py create mode 100644 recipes/astc-codec/all/patches/0001-fix-cmake.patch create mode 100644 recipes/astc-codec/all/test_package/CMakeLists.txt create mode 100644 recipes/astc-codec/all/test_package/atlas_small_4x4.astc create mode 100644 recipes/astc-codec/all/test_package/conanfile.py create mode 100644 recipes/astc-codec/all/test_package/test_package.cpp create mode 100644 recipes/astc-codec/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/astc-codec/all/test_v1_package/conanfile.py create mode 100644 recipes/astc-codec/config.yml create mode 100644 recipes/astro-informatics-so3/all/CMakeLists.txt create mode 100644 recipes/astro-informatics-so3/all/conandata.yml create mode 100644 recipes/astro-informatics-so3/all/conanfile.py create mode 100644 recipes/astro-informatics-so3/all/test_package/CMakeLists.txt create mode 100644 recipes/astro-informatics-so3/all/test_package/conanfile.py create mode 100644 recipes/astro-informatics-so3/all/test_package/example.c create mode 100644 recipes/astro-informatics-so3/config.yml create mode 100644 recipes/async_simple/all/conandata.yml create mode 100644 recipes/async_simple/all/conanfile.py create mode 100644 recipes/async_simple/all/test_package/CMakeLists.txt create mode 100644 recipes/async_simple/all/test_package/conanfile.py create mode 100644 recipes/async_simple/all/test_package/test_package.cpp create mode 100644 recipes/async_simple/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/async_simple/all/test_v1_package/conanfile.py create mode 100644 recipes/async_simple/config.yml create mode 100644 recipes/asyncplusplus/all/conandata.yml create mode 100644 recipes/asyncplusplus/all/conanfile.py create mode 100644 recipes/asyncplusplus/all/test_package/CMakeLists.txt create mode 100644 recipes/asyncplusplus/all/test_package/conanfile.py create mode 100644 recipes/asyncplusplus/all/test_package/test_package.cpp create mode 100644 recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/asyncplusplus/all/test_v1_package/conanfile.py create mode 100644 recipes/asyncplusplus/config.yml create mode 100644 recipes/at-spi2-atk/all/conandata.yml create mode 100644 recipes/at-spi2-atk/all/conanfile.py create mode 100644 recipes/at-spi2-atk/all/test_package/CMakeLists.txt create mode 100644 recipes/at-spi2-atk/all/test_package/conanfile.py create mode 100644 recipes/at-spi2-atk/all/test_package/test_package.c create mode 100644 recipes/at-spi2-atk/config.yml create mode 100644 recipes/at-spi2-core/all/conandata.yml create mode 100644 recipes/at-spi2-core/all/conanfile.py create mode 100644 recipes/at-spi2-core/all/patches/08036a4c4491eea57d7b713bb4440f541584204b.patch create mode 100644 recipes/at-spi2-core/all/test_package/CMakeLists.txt create mode 100644 recipes/at-spi2-core/all/test_package/conanfile.py create mode 100644 recipes/at-spi2-core/all/test_package/test_package.c create mode 100644 recipes/at-spi2-core/config.yml create mode 100644 recipes/at-spi2-core/new/conandata.yml create mode 100644 recipes/at-spi2-core/new/conanfile.py create mode 100644 recipes/at-spi2-core/new/patches/93.patch create mode 100644 recipes/at-spi2-core/new/test_package/CMakeLists.txt create mode 100644 recipes/at-spi2-core/new/test_package/conanfile.py create mode 100644 recipes/at-spi2-core/new/test_package/test_package.c create mode 100644 recipes/atk/all/conandata.yml create mode 100644 recipes/atk/all/conanfile.py create mode 100644 recipes/atk/all/patches/define_dllmain_only_when_shared.patch create mode 100644 recipes/atk/all/test_package/CMakeLists.txt create mode 100644 recipes/atk/all/test_package/conanfile.py create mode 100644 recipes/atk/all/test_package/test_package.c create mode 100644 recipes/atk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/atk/all/test_v1_package/conanfile.py create mode 100644 recipes/atk/config.yml create mode 100644 recipes/audiofile/all/conandata.yml create mode 100644 recipes/audiofile/all/conanfile.py create mode 100644 recipes/audiofile/all/test_package/CMakeLists.txt create mode 100644 recipes/audiofile/all/test_package/conanfile.py create mode 100644 recipes/audiofile/all/test_package/sine.wav create mode 100644 recipes/audiofile/all/test_package/test_package.cpp create mode 100644 recipes/audiofile/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/audiofile/all/test_v1_package/conanfile.py create mode 100644 recipes/audiofile/config.yml create mode 100644 recipes/autoconf-archive/all/conandata.yml create mode 100644 recipes/autoconf-archive/all/conanfile.py create mode 100644 recipes/autoconf-archive/all/test_package/Makefile.am create mode 100644 recipes/autoconf-archive/all/test_package/conanfile.py create mode 100644 recipes/autoconf-archive/all/test_package/configure.ac create mode 100644 recipes/autoconf-archive/all/test_package/test_package.c create mode 100644 recipes/autoconf-archive/all/test_v1_package/Makefile.am create mode 100644 recipes/autoconf-archive/all/test_v1_package/conanfile.py create mode 100644 recipes/autoconf-archive/all/test_v1_package/configure.ac create mode 100644 recipes/autoconf-archive/all/test_v1_package/test_package.c create mode 100644 recipes/autoconf-archive/config.yml create mode 100644 recipes/autoconf/all/conandata.yml create mode 100644 recipes/autoconf/all/conanfile.py create mode 100644 recipes/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch create mode 100644 recipes/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch create mode 100644 recipes/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch create mode 100644 recipes/autoconf/all/test_package/Makefile.in create mode 100644 recipes/autoconf/all/test_package/conanfile.py create mode 100644 recipes/autoconf/all/test_package/config.h.in create mode 100644 recipes/autoconf/all/test_package/configure.ac create mode 100644 recipes/autoconf/all/test_package/test_package_c.c create mode 100644 recipes/autoconf/all/test_package/test_package_cpp.cpp create mode 100644 recipes/autoconf/all/test_v1_package/conanfile.py create mode 100644 recipes/autoconf/config.yml create mode 100644 recipes/automake/all/conandata.yml create mode 100644 recipes/automake/all/conanfile.py create mode 100644 recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch create mode 100644 recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch create mode 100644 recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch create mode 100644 recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch create mode 100644 recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch create mode 100644 recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch create mode 100644 recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch create mode 100644 recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch create mode 100644 recipes/automake/all/patches/0003-relocatable-automake-1.16.2.patch create mode 100644 recipes/automake/all/patches/0003-relocatable-automake-1.16.3.patch create mode 100644 recipes/automake/all/patches/0003-relocatable-automake-1.16.4.patch create mode 100644 recipes/automake/all/patches/0003-relocatable-automake-1.16.5.patch create mode 100644 recipes/automake/all/test_package/Makefile.am create mode 100644 recipes/automake/all/test_package/conanfile.py create mode 100644 recipes/automake/all/test_package/configure.ac create mode 100644 recipes/automake/all/test_package/extra.m4 create mode 100644 recipes/automake/all/test_package/src/Makefile.am create mode 100644 recipes/automake/all/test_package/src/configure.ac create mode 100644 recipes/automake/all/test_package/src/extra.m4 create mode 100644 recipes/automake/all/test_package/src/test_package.cpp create mode 100644 recipes/automake/all/test_package/src/test_package_1.c create mode 100644 recipes/automake/all/test_package/test_package.cpp create mode 100644 recipes/automake/all/test_package/test_package_1.c create mode 100644 recipes/automake/all/test_v1_package/Makefile.am create mode 100644 recipes/automake/all/test_v1_package/conanfile.py create mode 100644 recipes/automake/all/test_v1_package/configure.ac create mode 100644 recipes/automake/all/test_v1_package/extra.m4 create mode 100644 recipes/automake/all/test_v1_package/test_package.cpp create mode 100644 recipes/automake/all/test_v1_package/test_package_1.c create mode 100644 recipes/automake/config.yml create mode 100644 recipes/avahi/all/conandata.yml create mode 100644 recipes/avahi/all/conanfile.py create mode 100644 recipes/avahi/all/test_package/CMakeLists.txt create mode 100644 recipes/avahi/all/test_package/conanfile.py create mode 100644 recipes/avahi/all/test_package/test_package.c create mode 100644 recipes/avahi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/avahi/all/test_v1_package/conanfile.py create mode 100644 recipes/avahi/config.yml create mode 100644 recipes/avcpp/all/conandata.yml create mode 100644 recipes/avcpp/all/conanfile.py create mode 100644 recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch create mode 100644 recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch create mode 100644 recipes/avcpp/all/test_package/CMakeLists.txt create mode 100644 recipes/avcpp/all/test_package/conanfile.py create mode 100644 recipes/avcpp/all/test_package/test_package.cpp create mode 100644 recipes/avcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/avcpp/all/test_v1_package/conanfile.py create mode 100644 recipes/avcpp/config.yml create mode 100644 recipes/avir/all/conandata.yml create mode 100644 recipes/avir/all/conanfile.py create mode 100644 recipes/avir/all/test_package/CMakeLists.txt create mode 100644 recipes/avir/all/test_package/conanfile.py create mode 100644 recipes/avir/all/test_package/test_package.cpp create mode 100644 recipes/avir/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/avir/all/test_v1_package/conanfile.py create mode 100644 recipes/avir/config.yml create mode 100644 recipes/aws-c-auth/all/conandata.yml create mode 100644 recipes/aws-c-auth/all/conanfile.py create mode 100644 recipes/aws-c-auth/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-auth/all/test_package/conanfile.py create mode 100644 recipes/aws-c-auth/all/test_package/test_package.c create mode 100644 recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-auth/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-auth/config.yml create mode 100644 recipes/aws-c-cal/all/conandata.yml create mode 100644 recipes/aws-c-cal/all/conanfile.py create mode 100644 recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.patch create mode 100644 recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch create mode 100644 recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch create mode 100644 recipes/aws-c-cal/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-cal/all/test_package/conanfile.py create mode 100644 recipes/aws-c-cal/all/test_package/test_package.c create mode 100644 recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-cal/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-cal/config.yml create mode 100644 recipes/aws-c-common/all/conandata.yml create mode 100644 recipes/aws-c-common/all/conanfile.py create mode 100644 recipes/aws-c-common/all/patches/0001-disable-fPIC.patch create mode 100644 recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch create mode 100644 recipes/aws-c-common/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-common/all/test_package/conanfile.py create mode 100644 recipes/aws-c-common/all/test_package/test_package.c create mode 100644 recipes/aws-c-common/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-common/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-common/config.yml create mode 100644 recipes/aws-c-compression/all/conandata.yml create mode 100644 recipes/aws-c-compression/all/conanfile.py create mode 100644 recipes/aws-c-compression/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-compression/all/test_package/conanfile.py create mode 100644 recipes/aws-c-compression/all/test_package/test_package.c create mode 100644 recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-compression/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-compression/config.yml create mode 100644 recipes/aws-c-event-stream/all/conandata.yml create mode 100644 recipes/aws-c-event-stream/all/conanfile.py create mode 100644 recipes/aws-c-event-stream/all/patches/0001-disable-tests-bin.patch create mode 100644 recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch create mode 100644 recipes/aws-c-event-stream/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-event-stream/all/test_package/conanfile.py create mode 100644 recipes/aws-c-event-stream/all/test_package/test_package.c create mode 100644 recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-event-stream/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-event-stream/config.yml create mode 100644 recipes/aws-c-http/all/conandata.yml create mode 100644 recipes/aws-c-http/all/conanfile.py create mode 100644 recipes/aws-c-http/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-http/all/test_package/conanfile.py create mode 100644 recipes/aws-c-http/all/test_package/test_package.c create mode 100644 recipes/aws-c-http/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-http/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-http/config.yml create mode 100644 recipes/aws-c-io/all/conandata.yml create mode 100644 recipes/aws-c-io/all/conanfile.py create mode 100644 recipes/aws-c-io/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-io/all/test_package/conanfile.py create mode 100644 recipes/aws-c-io/all/test_package/test_package.c create mode 100644 recipes/aws-c-io/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-io/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-io/config.yml create mode 100644 recipes/aws-c-mqtt/all/conandata.yml create mode 100644 recipes/aws-c-mqtt/all/conanfile.py create mode 100644 recipes/aws-c-mqtt/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-mqtt/all/test_package/conanfile.py create mode 100644 recipes/aws-c-mqtt/all/test_package/test_package.c create mode 100644 recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-mqtt/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-mqtt/config.yml create mode 100644 recipes/aws-c-s3/all/conandata.yml create mode 100644 recipes/aws-c-s3/all/conanfile.py create mode 100644 recipes/aws-c-s3/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-s3/all/test_package/conanfile.py create mode 100644 recipes/aws-c-s3/all/test_package/test_package.c create mode 100644 recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-s3/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-s3/config.yml create mode 100644 recipes/aws-c-sdkutils/all/conandata.yml create mode 100644 recipes/aws-c-sdkutils/all/conanfile.py create mode 100644 recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-c-sdkutils/all/test_package/conanfile.py create mode 100644 recipes/aws-c-sdkutils/all/test_package/test_package.c create mode 100644 recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-c-sdkutils/config.yml create mode 100644 recipes/aws-cdi-sdk/all/CMakeLists.txt create mode 100644 recipes/aws-cdi-sdk/all/conandata.yml create mode 100644 recipes/aws-cdi-sdk/all/conanfile.py create mode 100644 recipes/aws-cdi-sdk/all/patches/001-Makefile.patch create mode 100644 recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-cdi-sdk/all/test_package/conanfile.py create mode 100644 recipes/aws-cdi-sdk/all/test_package/test_package.c create mode 100644 recipes/aws-cdi-sdk/config.yml create mode 100644 recipes/aws-checksums/all/conandata.yml create mode 100644 recipes/aws-checksums/all/conanfile.py create mode 100644 recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch create mode 100644 recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch create mode 100644 recipes/aws-checksums/all/patches/0003-disable-building-tests.patch create mode 100644 recipes/aws-checksums/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-checksums/all/test_package/conanfile.py create mode 100644 recipes/aws-checksums/all/test_package/test_package.c create mode 100644 recipes/aws-checksums/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-checksums/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-checksums/config.yml create mode 100644 recipes/aws-crt-cpp/all/conandata.yml create mode 100644 recipes/aws-crt-cpp/all/conanfile.py create mode 100644 recipes/aws-crt-cpp/all/patches/0.17.12-fix-cast-error.patch create mode 100644 recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch create mode 100644 recipes/aws-crt-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-crt-cpp/all/test_package/conanfile.py create mode 100644 recipes/aws-crt-cpp/all/test_package/test_package.cpp create mode 100644 recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-crt-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/aws-crt-cpp/config.yml create mode 100644 recipes/aws-kvs-pic/all/CMakeLists.txt create mode 100644 recipes/aws-kvs-pic/all/conandata.yml create mode 100644 recipes/aws-kvs-pic/all/conanfile.py create mode 100644 recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch create mode 100644 recipes/aws-kvs-pic/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-kvs-pic/all/test_package/conanfile.py create mode 100644 recipes/aws-kvs-pic/all/test_package/test_package.c create mode 100644 recipes/aws-kvs-pic/config.yml create mode 100644 recipes/aws-libfabric/all/conandata.yml create mode 100644 recipes/aws-libfabric/all/conanfile.py create mode 100644 recipes/aws-libfabric/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-libfabric/all/test_package/conanfile.py create mode 100644 recipes/aws-libfabric/all/test_package/test_package.c create mode 100644 recipes/aws-libfabric/config.yml create mode 100644 recipes/aws-sdk-cpp/all/CMakeLists.txt create mode 100644 recipes/aws-sdk-cpp/all/conandata.yml create mode 100644 recipes/aws-sdk-cpp/all/conanfile.py create mode 100644 recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.9.100-0002-aws-plugin-conf.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.9.234-0001-issue-1816.patch create mode 100644 recipes/aws-sdk-cpp/all/patches/1.9.234-0002-disable-sort-links.patch create mode 100644 recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp create mode 100644 recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.h create mode 100644 recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt create mode 100644 recipes/aws-sdk-cpp/all/test_package/conanfile.py create mode 100644 recipes/aws-sdk-cpp/all/test_package/test_package.cpp create mode 100644 recipes/aws-sdk-cpp/config.yml create mode 100644 recipes/azure-storage-cpp/all/CMakeLists.txt create mode 100644 recipes/azure-storage-cpp/all/conandata.yml create mode 100644 recipes/azure-storage-cpp/all/conanfile.py create mode 100644 recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch create mode 100644 recipes/azure-storage-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/azure-storage-cpp/all/test_package/conanfile.py create mode 100644 recipes/azure-storage-cpp/all/test_package/example.cpp create mode 100644 recipes/azure-storage-cpp/config.yml create mode 100644 recipes/b2/config.yml create mode 100644 recipes/b2/portable/conandata.yml create mode 100644 recipes/b2/portable/conanfile.py create mode 100644 recipes/b2/portable/test_package/conanfile.py create mode 100644 recipes/b2/portable/test_v1_package/conanfile.py create mode 100644 recipes/b2/standard/conandata.yml create mode 100644 recipes/b2/standard/conanfile.py create mode 100644 recipes/b2/standard/test_package/conanfile.py create mode 100644 recipes/b64/all/CMakeLists.txt create mode 100644 recipes/b64/all/conandata.yml create mode 100755 recipes/b64/all/conanfile.py create mode 100644 recipes/b64/all/patches/0001-windows-elseif.patch create mode 100644 recipes/b64/all/patches/0002-extern-c.patch create mode 100644 recipes/b64/all/patches/0003-stdlib-exit.patch create mode 100644 recipes/b64/all/patches/0004-include-order.patch create mode 100644 recipes/b64/all/test_package/CMakeLists.txt create mode 100644 recipes/b64/all/test_package/conanfile.py create mode 100644 recipes/b64/all/test_package/test_package.cpp create mode 100644 recipes/b64/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/b64/all/test_v1_package/conanfile.py create mode 100644 recipes/b64/config.yml create mode 100644 recipes/backport-cpp/all/conandata.yml create mode 100644 recipes/backport-cpp/all/conanfile.py create mode 100644 recipes/backport-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/backport-cpp/all/test_package/conanfile.py create mode 100644 recipes/backport-cpp/all/test_package/test_package.cpp create mode 100644 recipes/backport-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/backport-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/backport-cpp/config.yml create mode 100644 recipes/backward-cpp/all/conandata.yml create mode 100644 recipes/backward-cpp/all/conanfile.py create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.4.patch create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.5-mingw.patch create mode 100644 recipes/backward-cpp/all/patches/backward-cpp-1.5.patch create mode 100644 recipes/backward-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/backward-cpp/all/test_package/conanfile.py create mode 100644 recipes/backward-cpp/all/test_package/test_package.cpp create mode 100644 recipes/backward-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/backward-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/backward-cpp/config.yml create mode 100644 recipes/bacnet-stack/all/conandata.yml create mode 100644 recipes/bacnet-stack/all/conanfile.py create mode 100644 recipes/bacnet-stack/all/patches/0001-fix-dll-install.patch create mode 100644 recipes/bacnet-stack/all/test_package/CMakeLists.txt create mode 100644 recipes/bacnet-stack/all/test_package/conanfile.py create mode 100644 recipes/bacnet-stack/all/test_package/test_package.c create mode 100644 recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bacnet-stack/all/test_v1_package/conanfile.py create mode 100644 recipes/bacnet-stack/config.yml create mode 100644 recipes/baical-p7/all/conandata.yml create mode 100644 recipes/baical-p7/all/conanfile.py create mode 100644 recipes/baical-p7/all/patches/0001-fix-cmake.patch create mode 100644 recipes/baical-p7/all/test_package/CMakeLists.txt create mode 100644 recipes/baical-p7/all/test_package/conanfile.py create mode 100644 recipes/baical-p7/all/test_package/test_package.cpp create mode 100644 recipes/baical-p7/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/baical-p7/all/test_v1_package/conanfile.py create mode 100644 recipes/baical-p7/config.yml create mode 100644 recipes/bandit/all/conandata.yml create mode 100644 recipes/bandit/all/conanfile.py create mode 100644 recipes/bandit/all/patches/0001-change-snowhouse-path.patch create mode 100644 recipes/bandit/all/test_package/CMakeLists.txt create mode 100644 recipes/bandit/all/test_package/conanfile.py create mode 100644 recipes/bandit/all/test_package/test_package.cpp create mode 100644 recipes/bandit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bandit/all/test_v1_package/conanfile.py create mode 100644 recipes/bandit/config.yml create mode 100644 recipes/base64/all/conandata.yml create mode 100644 recipes/base64/all/conanfile.py create mode 100644 recipes/base64/all/patches/0.4.0-0001-make.patch create mode 100644 recipes/base64/all/patches/0.4.0-0002-cmake.patch create mode 100644 recipes/base64/all/patches/0.5.0-0001-make.patch create mode 100644 recipes/base64/all/test_package/CMakeLists.txt create mode 100644 recipes/base64/all/test_package/conanfile.py create mode 100644 recipes/base64/all/test_package/test_package.c create mode 100644 recipes/base64/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/base64/all/test_v1_package/conanfile.py create mode 100644 recipes/base64/config.yml create mode 100644 recipes/bazel/all/conandata.yml create mode 100644 recipes/bazel/all/conanfile.py create mode 100644 recipes/bazel/all/test_package/conanfile.py create mode 100644 recipes/bazel/config.yml create mode 100644 recipes/bdwgc/all/conandata.yml create mode 100644 recipes/bdwgc/all/conanfile.py create mode 100644 recipes/bdwgc/all/patches/update-cmake-8_0_4.patch create mode 100644 recipes/bdwgc/all/patches/update-cmake-8_0_6.patch create mode 100644 recipes/bdwgc/all/patches/update-cmake-8_2_2.patch create mode 100644 recipes/bdwgc/all/test_package/CMakeLists.txt create mode 100644 recipes/bdwgc/all/test_package/conanfile.py create mode 100644 recipes/bdwgc/all/test_package/test_package.c create mode 100644 recipes/bdwgc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bdwgc/all/test_v1_package/conanfile.py create mode 100644 recipes/bdwgc/config.yml create mode 100644 recipes/bear/all/conandata.yml create mode 100644 recipes/bear/all/conanfile.py create mode 100644 recipes/bear/all/patches/7de12540948cd5e0ee5f966b5cc383bc0c0e5fe9.diff create mode 100644 recipes/bear/all/test_package/conanfile.py create mode 100644 recipes/bear/all/test_v1_package/conanfile.py create mode 100644 recipes/bear/config.yml create mode 100644 recipes/beauty/all/conandata.yml create mode 100644 recipes/beauty/all/conanfile.py create mode 100644 recipes/beauty/all/patches/0001-fix-cmake.patch create mode 100644 recipes/beauty/all/test_package/CMakeLists.txt create mode 100644 recipes/beauty/all/test_package/conanfile.py create mode 100644 recipes/beauty/all/test_package/test_package.cpp create mode 100644 recipes/beauty/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/beauty/all/test_v1_package/conanfile.py create mode 100644 recipes/beauty/config.yml create mode 100644 recipes/behaviortree.cpp/all/conandata.yml create mode 100644 recipes/behaviortree.cpp/all/conanfile.py create mode 100644 recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch create mode 100644 recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch create mode 100644 recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch create mode 100644 recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch create mode 100644 recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch create mode 100644 recipes/behaviortree.cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/behaviortree.cpp/all/test_package/conanfile.py create mode 100644 recipes/behaviortree.cpp/all/test_package/test_package.cpp create mode 100644 recipes/behaviortree.cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/behaviortree.cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/behaviortree.cpp/config.yml create mode 100644 recipes/benchmark/all/conandata.yml create mode 100644 recipes/benchmark/all/conanfile.py create mode 100644 recipes/benchmark/all/test_package/CMakeLists.txt create mode 100644 recipes/benchmark/all/test_package/conanfile.py create mode 100644 recipes/benchmark/all/test_package/test_package.cpp create mode 100644 recipes/benchmark/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/benchmark/all/test_v1_package/conanfile.py create mode 100644 recipes/benchmark/config.yml create mode 100644 recipes/bertrand/all/conandata.yml create mode 100644 recipes/bertrand/all/conanfile.py create mode 100644 recipes/bertrand/all/test_package/CMakeLists.txt create mode 100644 recipes/bertrand/all/test_package/conanfile.py create mode 100644 recipes/bertrand/all/test_package/test_package.cpp create mode 100644 recipes/bertrand/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bertrand/all/test_v1_package/conanfile.py create mode 100644 recipes/bertrand/config.yml create mode 100644 recipes/bigint/all/CMakeLists.txt create mode 100644 recipes/bigint/all/conandata.yml create mode 100644 recipes/bigint/all/conanfile.py create mode 100644 recipes/bigint/all/patches/0001-deprecation-wanings.patch create mode 100644 recipes/bigint/all/test_package/CMakeLists.txt create mode 100644 recipes/bigint/all/test_package/conanfile.py create mode 100644 recipes/bigint/all/test_package/test_package.cpp create mode 100644 recipes/bigint/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bigint/all/test_v1_package/conanfile.py create mode 100644 recipes/bigint/config.yml create mode 100644 recipes/bimg/all/conandata.yml create mode 100644 recipes/bimg/all/conanfile.py create mode 100644 recipes/bimg/all/test_package/CMakeLists.txt create mode 100644 recipes/bimg/all/test_package/conanfile.py create mode 100644 recipes/bimg/all/test_package/test_package.cpp create mode 100644 recipes/bimg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bimg/all/test_v1_package/conanfile.py create mode 100644 recipes/bimg/config.yml create mode 100644 recipes/binutils/all/conandata.yml create mode 100644 recipes/binutils/all/conanfile.py create mode 100644 recipes/binutils/all/patches/2.38-0001-no-texinfo.patch create mode 100644 recipes/binutils/all/test_package/conanfile.py create mode 100644 recipes/binutils/all/test_v1_package/Linux-armv7.s create mode 100644 recipes/binutils/all/test_v1_package/Linux-armv8.s create mode 100644 recipes/binutils/all/test_v1_package/Linux-riscv.s create mode 100644 recipes/binutils/all/test_v1_package/Linux-x86.s create mode 100644 recipes/binutils/all/test_v1_package/Linux-x86_64.s create mode 100644 recipes/binutils/all/test_v1_package/Windows-kernel32.def create mode 100644 recipes/binutils/all/test_v1_package/Windows-x86.s create mode 100644 recipes/binutils/all/test_v1_package/Windows-x86_64.s create mode 100644 recipes/binutils/all/test_v1_package/conanfile.py create mode 100644 recipes/binutils/config.yml create mode 100644 recipes/bison/all/conandata.yml create mode 100644 recipes/bison/all/conanfile.py create mode 100644 recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch create mode 100644 recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch create mode 100644 recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch create mode 100644 recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch create mode 100644 recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch create mode 100644 recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch create mode 100644 recipes/bison/all/patches/0004-3.5.3-relocatable.patch create mode 100644 recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch create mode 100644 recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch create mode 100644 recipes/bison/all/test_package/CMakeLists.txt create mode 100644 recipes/bison/all/test_package/conanfile.py create mode 100644 recipes/bison/all/test_package/mc_parser.yy create mode 100644 recipes/bison/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bison/all/test_v1_package/conanfile.py create mode 100644 recipes/bison/config.yml create mode 100644 recipes/bit-lite/all/conandata.yml create mode 100644 recipes/bit-lite/all/conanfile.py create mode 100644 recipes/bit-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/bit-lite/all/test_package/conanfile.py create mode 100644 recipes/bit-lite/all/test_package/test_package.cpp create mode 100644 recipes/bit-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bit-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/bit-lite/config.yml create mode 100644 recipes/bitflags/all/conandata.yml create mode 100644 recipes/bitflags/all/conanfile.py create mode 100644 recipes/bitflags/all/test_package/CMakeLists.txt create mode 100644 recipes/bitflags/all/test_package/conanfile.py create mode 100644 recipes/bitflags/all/test_package/test_package.cpp create mode 100644 recipes/bitflags/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bitflags/all/test_v1_package/conanfile.py create mode 100644 recipes/bitflags/config.yml create mode 100644 recipes/bitmagic/all/conandata.yml create mode 100644 recipes/bitmagic/all/conanfile.py create mode 100644 recipes/bitmagic/all/test_package/CMakeLists.txt create mode 100644 recipes/bitmagic/all/test_package/conanfile.py create mode 100644 recipes/bitmagic/all/test_package/test_package.cpp create mode 100644 recipes/bitmagic/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bitmagic/all/test_v1_package/conanfile.py create mode 100644 recipes/bitmagic/config.yml create mode 100644 recipes/bitserializer/all/conandata.yml create mode 100644 recipes/bitserializer/all/conanfile.py create mode 100644 recipes/bitserializer/all/test_package/CMakeLists.txt create mode 100644 recipes/bitserializer/all/test_package/conanfile.py create mode 100644 recipes/bitserializer/all/test_package/test_package.cpp create mode 100644 recipes/bitserializer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bitserializer/all/test_v1_package/conanfile.py create mode 100644 recipes/bitserializer/config.yml create mode 100644 recipes/bitsery/all/conandata.yml create mode 100644 recipes/bitsery/all/conanfile.py create mode 100644 recipes/bitsery/all/test_package/CMakeLists.txt create mode 100644 recipes/bitsery/all/test_package/conanfile.py create mode 100644 recipes/bitsery/all/test_package/test_package.cpp create mode 100644 recipes/bitsery/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bitsery/all/test_v1_package/conanfile.py create mode 100644 recipes/bitsery/config.yml create mode 100644 recipes/blaze/all/conandata.yml create mode 100644 recipes/blaze/all/conanfile.py create mode 100755 recipes/blaze/all/test_package/CMakeLists.txt create mode 100755 recipes/blaze/all/test_package/conanfile.py create mode 100755 recipes/blaze/all/test_package/test_package.cpp create mode 100755 recipes/blaze/all/test_v1_package/CMakeLists.txt create mode 100755 recipes/blaze/all/test_v1_package/conanfile.py create mode 100644 recipes/blaze/config.yml create mode 100644 recipes/blend2d/all/conandata.yml create mode 100644 recipes/blend2d/all/conanfile.py create mode 100644 recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch create mode 100644 recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch create mode 100644 recipes/blend2d/all/patches/0.8-0001-disable-embed-asmjit.patch create mode 100644 recipes/blend2d/all/test_package/CMakeLists.txt create mode 100644 recipes/blend2d/all/test_package/conanfile.py create mode 100644 recipes/blend2d/all/test_package/test_package.cpp create mode 100644 recipes/blend2d/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/blend2d/all/test_v1_package/conanfile.py create mode 100644 recipes/blend2d/config.yml create mode 100644 recipes/bliss/all/conandata.yml create mode 100644 recipes/bliss/all/conanfile.py create mode 100644 recipes/bliss/all/patches/0001-fix-cmake.patch create mode 100644 recipes/bliss/all/patches/0002-no-assert-non-existent-member-variable.patch create mode 100644 recipes/bliss/all/test_package/CMakeLists.txt create mode 100644 recipes/bliss/all/test_package/conanfile.py create mode 100644 recipes/bliss/all/test_package/graph.cnf create mode 100644 recipes/bliss/all/test_package/test_package.cpp create mode 100644 recipes/bliss/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bliss/all/test_v1_package/conanfile.py create mode 100644 recipes/bliss/config.yml create mode 100644 recipes/boolean-lite/all/conandata.yml create mode 100644 recipes/boolean-lite/all/conanfile.py create mode 100644 recipes/boolean-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/boolean-lite/all/test_package/conanfile.py create mode 100644 recipes/boolean-lite/all/test_package/test_package.cpp create mode 100644 recipes/boolean-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/boolean-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/boolean-lite/config.yml create mode 100644 recipes/boolinq/all/conandata.yml create mode 100644 recipes/boolinq/all/conanfile.py create mode 100644 recipes/boolinq/all/test_package/CMakeLists.txt create mode 100644 recipes/boolinq/all/test_package/conanfile.py create mode 100644 recipes/boolinq/all/test_package/test_package.cpp create mode 100644 recipes/boolinq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/boolinq/all/test_v1_package/conanfile.py create mode 100644 recipes/boolinq/config.yml create mode 100644 recipes/boost-ext-ut/all/conandata.yml create mode 100644 recipes/boost-ext-ut/all/conanfile.py create mode 100644 recipes/boost-ext-ut/all/patches/1.1.9_cmake_project_version.patch create mode 100644 recipes/boost-ext-ut/all/patches/license.patch create mode 100644 recipes/boost-ext-ut/all/test_package/CMakeLists.txt create mode 100644 recipes/boost-ext-ut/all/test_package/conanfile.py create mode 100644 recipes/boost-ext-ut/all/test_package/test_package.cpp create mode 100644 recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/boost-ext-ut/all/test_v1_package/conanfile.py create mode 100644 recipes/boost-ext-ut/config.yml create mode 100644 recipes/boost-leaf/all/conandata.yml create mode 100644 recipes/boost-leaf/all/conanfile.py create mode 100644 recipes/boost-leaf/all/test_package/CMakeLists.txt create mode 100644 recipes/boost-leaf/all/test_package/conanfile.py create mode 100644 recipes/boost-leaf/all/test_package/main.cpp create mode 100644 recipes/boost-leaf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/boost-leaf/all/test_v1_package/conanfile.py create mode 100644 recipes/boost-leaf/config.yml create mode 100644 recipes/boost/all/conandata.yml create mode 100644 recipes/boost/all/conanfile.py create mode 100644 recipes/boost/all/dependencies/dependencies-1.71.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.72.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.73.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.74.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.75.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.76.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.77.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.78.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.79.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.80.0.yml create mode 100644 recipes/boost/all/dependencies/dependencies-1.81.0.yml create mode 100644 recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch create mode 100644 recipes/boost/all/patches/1.69.0-contract-no-system.patch create mode 100644 recipes/boost/all/patches/1.69.0-locale-no-system.patch create mode 100644 recipes/boost/all/patches/1.69.0-random-no-system.patch create mode 100644 recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch create mode 100644 recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch create mode 100644 recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch create mode 100644 recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch create mode 100644 recipes/boost/all/patches/1.77.0-fiber-mingw.patch create mode 100644 recipes/boost/all/patches/1.77.0-type_erasure-no-system.patch create mode 100644 recipes/boost/all/patches/1.78.0-b2-fix-install.patch create mode 100644 recipes/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch create mode 100644 recipes/boost/all/patches/1.79.0-geometry_no_rtti.patch create mode 100644 recipes/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch create mode 100644 recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch create mode 100644 recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch create mode 100644 recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch create mode 100644 recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch create mode 100644 recipes/boost/all/patches/1.80.0-0005-config-libcpp15.patch create mode 100644 recipes/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch create mode 100644 recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch create mode 100644 recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch create mode 100644 recipes/boost/all/patches/bcp_namespace_issues_1_71.patch create mode 100644 recipes/boost/all/patches/bcp_namespace_issues_1_72.patch create mode 100644 recipes/boost/all/patches/boost_1_77_mpi_check.patch create mode 100644 recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch create mode 100644 recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch create mode 100644 recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch create mode 100644 recipes/boost/all/patches/boost_locale_fail_on_missing_backend.patch create mode 100644 recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch create mode 100644 recipes/boost/all/patches/boost_mpi_check.patch create mode 100644 recipes/boost/all/patches/python_base_prefix.patch create mode 100644 recipes/boost/all/patches/python_base_prefix_since_1_74.patch create mode 100644 recipes/boost/all/patches/solaris_pthread_data.patch create mode 100755 recipes/boost/all/rebuild-dependencies.py create mode 100644 recipes/boost/all/test_package/CMakeLists.txt create mode 100644 recipes/boost/all/test_package/chrono.cpp create mode 100644 recipes/boost/all/test_package/conanfile.py create mode 100644 recipes/boost/all/test_package/coroutine.cpp create mode 100644 recipes/boost/all/test_package/fiber.cpp create mode 100644 recipes/boost/all/test_package/json.cpp create mode 100644 recipes/boost/all/test_package/lambda.cpp create mode 100644 recipes/boost/all/test_package/locale.cpp create mode 100644 recipes/boost/all/test_package/nowide.cpp create mode 100644 recipes/boost/all/test_package/numpy.cpp create mode 100644 recipes/boost/all/test_package/python.cpp create mode 100644 recipes/boost/all/test_package/python.py create mode 100644 recipes/boost/all/test_package/random.cpp create mode 100644 recipes/boost/all/test_package/regex.cpp create mode 100644 recipes/boost/all/test_package/stacktrace.cpp create mode 100644 recipes/boost/all/test_package/test.cpp create mode 100644 recipes/boost/all/test_package/url.cpp create mode 100644 recipes/boost/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/boost/all/test_v1_package/conanfile.py create mode 100644 recipes/boost/config.yml create mode 100644 recipes/boostdep/all/CMakeLists.txt create mode 100644 recipes/boostdep/all/conandata.yml create mode 100644 recipes/boostdep/all/conanfile.py create mode 100644 recipes/boostdep/all/test_package/conanfile.py create mode 100644 recipes/boostdep/config.yml create mode 100644 recipes/botan/all/conandata.yml create mode 100644 recipes/botan/all/conanfile.py create mode 100644 recipes/botan/all/patches/dll-dir.patch create mode 100644 recipes/botan/all/patches/fix-amalgamation-build.patch create mode 100644 recipes/botan/all/patches/fix-unrecognized-linker-flag.patch create mode 100644 recipes/botan/all/patches/vs2015-install-fix.patch create mode 100644 recipes/botan/all/test_package/CMakeLists.txt create mode 100644 recipes/botan/all/test_package/conanfile.py create mode 100644 recipes/botan/all/test_package/test_package.cpp create mode 100644 recipes/botan/config.yml create mode 100644 recipes/box2d/2.4.x/conandata.yml create mode 100644 recipes/box2d/2.4.x/conanfile.py create mode 100644 recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch create mode 100644 recipes/box2d/2.4.x/test_package/CMakeLists.txt create mode 100644 recipes/box2d/2.4.x/test_package/conanfile.py create mode 100644 recipes/box2d/2.4.x/test_package/test_package.cpp create mode 100644 recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/box2d/2.4.x/test_v1_package/conanfile.py create mode 100644 recipes/box2d/2.4.x/test_v1_package/test_package.cpp create mode 100644 recipes/box2d/all/conandata.yml create mode 100644 recipes/box2d/all/conanfile.py create mode 100644 recipes/box2d/all/test_package/CMakeLists.txt create mode 100644 recipes/box2d/all/test_package/conanfile.py create mode 100644 recipes/box2d/all/test_package/test_package.cpp create mode 100644 recipes/box2d/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/box2d/all/test_v1_package/conanfile.py create mode 100644 recipes/box2d/config.yml create mode 100644 recipes/breakpad/all/conandata.yml create mode 100644 recipes/breakpad/all/conanfile.py create mode 100644 recipes/breakpad/all/patches/0001-Use_conans_lss.patch create mode 100644 recipes/breakpad/all/patches/0002-Remove-hardcoded-fpic.patch create mode 100644 recipes/breakpad/all/test_package/CMakeLists.txt create mode 100644 recipes/breakpad/all/test_package/conanfile.py create mode 100644 recipes/breakpad/all/test_package/test_package.cpp create mode 100644 recipes/breakpad/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/breakpad/all/test_v1_package/conanfile.py create mode 100644 recipes/breakpad/config.yml create mode 100644 recipes/brigand/all/conandata.yml create mode 100644 recipes/brigand/all/conanfile.py create mode 100644 recipes/brigand/all/test_package/CMakeLists.txt create mode 100644 recipes/brigand/all/test_package/conanfile.py create mode 100644 recipes/brigand/all/test_package/test_package.cpp create mode 100644 recipes/brigand/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/brigand/all/test_v1_package/conanfile.py create mode 100644 recipes/brigand/config.yml create mode 100644 recipes/brotli/all/conandata.yml create mode 100644 recipes/brotli/all/conanfile.py create mode 100644 recipes/brotli/all/patches/0001-target-props.patch create mode 100644 recipes/brotli/all/patches/0002-target-props.patch create mode 100644 recipes/brotli/all/test_package/CMakeLists.txt create mode 100644 recipes/brotli/all/test_package/conanfile.py create mode 100644 recipes/brotli/all/test_package/test_package.cpp create mode 100644 recipes/brotli/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/brotli/all/test_v1_package/conanfile.py create mode 100644 recipes/brotli/config.yml create mode 100644 recipes/brynet/all/conandata.yml create mode 100644 recipes/brynet/all/conanfile.py create mode 100644 recipes/brynet/all/test_package/CMakeLists.txt create mode 100644 recipes/brynet/all/test_package/conanfile.py create mode 100644 recipes/brynet/all/test_package/test_package.cpp create mode 100644 recipes/brynet/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/brynet/all/test_v1_package/conanfile.py create mode 100644 recipes/brynet/config.yml create mode 100644 recipes/bshoshany-thread-pool/all/conandata.yml create mode 100644 recipes/bshoshany-thread-pool/all/conanfile.py create mode 100644 recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt create mode 100644 recipes/bshoshany-thread-pool/all/test_package/conanfile.py create mode 100644 recipes/bshoshany-thread-pool/all/test_package/test_package.cpp create mode 100644 recipes/bshoshany-thread-pool/config.yml create mode 100644 recipes/btyacc/all/CMakeLists.txt create mode 100644 recipes/btyacc/all/conandata.yml create mode 100644 recipes/btyacc/all/conanfile.py create mode 100644 recipes/btyacc/all/test_package/CMakeLists.txt create mode 100644 recipes/btyacc/all/test_package/conanfile.py create mode 100644 recipes/btyacc/all/test_package/test.y create mode 100644 recipes/btyacc/config.yml create mode 100644 recipes/bullet3/all/conandata.yml create mode 100644 recipes/bullet3/all/conanfile.py create mode 100644 recipes/bullet3/all/test_package/CMakeLists.txt create mode 100644 recipes/bullet3/all/test_package/conanfile.py create mode 100644 recipes/bullet3/all/test_package/test_package.cpp create mode 100644 recipes/bullet3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bullet3/all/test_v1_package/conanfile.py create mode 100644 recipes/bullet3/config.yml create mode 100644 recipes/butteraugli/all/CMakeLists.txt create mode 100644 recipes/butteraugli/all/conandata.yml create mode 100644 recipes/butteraugli/all/conanfile.py create mode 100644 recipes/butteraugli/all/patches/0001-compilation-fixes-for-vs2015.patch create mode 100644 recipes/butteraugli/all/test_package/CMakeLists.txt create mode 100644 recipes/butteraugli/all/test_package/conanfile.py create mode 100644 recipes/butteraugli/all/test_package/test_package.cpp create mode 100644 recipes/butteraugli/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/butteraugli/all/test_v1_package/conanfile.py create mode 100644 recipes/butteraugli/config.yml create mode 100644 recipes/bvdberg-ctest/all/conandata.yml create mode 100644 recipes/bvdberg-ctest/all/conanfile.py create mode 100644 recipes/bvdberg-ctest/all/test_package/CMakeLists.txt create mode 100644 recipes/bvdberg-ctest/all/test_package/conanfile.py create mode 100644 recipes/bvdberg-ctest/all/test_package/test_package.c create mode 100644 recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bvdberg-ctest/all/test_v1_package/conanfile.py create mode 100644 recipes/bvdberg-ctest/config.yml create mode 100644 recipes/bx/all/conandata.yml create mode 100644 recipes/bx/all/conanfile.py create mode 100644 recipes/bx/all/test_package/CMakeLists.txt create mode 100644 recipes/bx/all/test_package/conanfile.py create mode 100644 recipes/bx/all/test_package/test_package.cpp create mode 100644 recipes/bx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bx/all/test_v1_package/conanfile.py create mode 100644 recipes/bx/all/test_v1_package/test_package.cpp create mode 100644 recipes/bx/config.yml create mode 100644 recipes/byte-lite/all/conandata.yml create mode 100644 recipes/byte-lite/all/conanfile.py create mode 100644 recipes/byte-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/byte-lite/all/test_package/conanfile.py create mode 100644 recipes/byte-lite/all/test_package/test_package.cpp create mode 100644 recipes/byte-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/byte-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/byte-lite/config.yml create mode 100644 recipes/bzip2/all/CMakeLists.txt create mode 100644 recipes/bzip2/all/conandata.yml create mode 100644 recipes/bzip2/all/conanfile.py create mode 100644 recipes/bzip2/all/patches/0001-fix-sys-stat-include.patch create mode 100644 recipes/bzip2/all/test_package/CMakeLists.txt create mode 100644 recipes/bzip2/all/test_package/conanfile.py create mode 100644 recipes/bzip2/all/test_package/test_package.c create mode 100644 recipes/bzip2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bzip2/all/test_v1_package/conanfile.py create mode 100644 recipes/bzip2/config.yml create mode 100644 recipes/bzip3/all/CMakeLists.txt create mode 100644 recipes/bzip3/all/conandata.yml create mode 100644 recipes/bzip3/all/conanfile.py create mode 100644 recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch create mode 100644 recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch create mode 100644 recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch create mode 100644 recipes/bzip3/all/test_package/CMakeLists.txt create mode 100644 recipes/bzip3/all/test_package/conanfile.py create mode 100644 recipes/bzip3/all/test_package/test_package.c create mode 100644 recipes/bzip3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bzip3/all/test_v1_package/conanfile.py create mode 100644 recipes/bzip3/config.yml create mode 100644 recipes/c-ares/all/conandata.yml create mode 100644 recipes/c-ares/all/conanfile.py create mode 100644 recipes/c-ares/all/patches/option-tools.patch create mode 100644 recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch create mode 100644 recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch create mode 100644 recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch create mode 100644 recipes/c-ares/all/test_package/CMakeLists.txt create mode 100644 recipes/c-ares/all/test_package/conanfile.py create mode 100644 recipes/c-ares/all/test_package/test_package.c create mode 100644 recipes/c-ares/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-ares/all/test_v1_package/conanfile.py create mode 100644 recipes/c-ares/config.yml create mode 100644 recipes/c-blosc/all/conandata.yml create mode 100644 recipes/c-blosc/all/conanfile.py create mode 100644 recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch create mode 100644 recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch create mode 100644 recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch create mode 100644 recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch create mode 100644 recipes/c-blosc/all/patches/cmake-dependencies-1.21.2+.patch create mode 100644 recipes/c-blosc/all/test_package/CMakeLists.txt create mode 100644 recipes/c-blosc/all/test_package/conanfile.py create mode 100644 recipes/c-blosc/all/test_package/test_package.c create mode 100644 recipes/c-blosc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-blosc/all/test_v1_package/conanfile.py create mode 100644 recipes/c-blosc/config.yml create mode 100644 recipes/c-blosc2/all/conandata.yml create mode 100644 recipes/c-blosc2/all/conanfile.py create mode 100644 recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch create mode 100644 recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch create mode 100644 recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch create mode 100644 recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch create mode 100644 recipes/c-blosc2/all/test_package/CMakeLists.txt create mode 100644 recipes/c-blosc2/all/test_package/conanfile.py create mode 100644 recipes/c-blosc2/all/test_package/test_package.c create mode 100644 recipes/c-blosc2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-blosc2/all/test_v1_package/conanfile.py create mode 100644 recipes/c-blosc2/config.yml create mode 100644 recipes/c-client/all/conandata.yml create mode 100644 recipes/c-client/all/conanfile.py create mode 100644 recipes/c-client/all/patches/0001-fix-yunchan-tempfile.patch create mode 100644 recipes/c-client/all/patches/0002-fix-makefile-w2k.patch create mode 100644 recipes/c-client/all/patches/0003-fix-env-nt.patch create mode 100644 recipes/c-client/all/patches/0004-fix-makefile.patch create mode 100644 recipes/c-client/all/patches/2014_openssl1.1.1_sni.patch create mode 100644 recipes/c-client/all/test_package/CMakeLists.txt create mode 100644 recipes/c-client/all/test_package/conanfile.py create mode 100644 recipes/c-client/all/test_package/test_package.c create mode 100644 recipes/c-client/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-client/all/test_v1_package/conanfile.py create mode 100644 recipes/c-client/config.yml create mode 100644 recipes/c-dbg-macro/all/conandata.yml create mode 100644 recipes/c-dbg-macro/all/conanfile.py create mode 100644 recipes/c-dbg-macro/all/test_package/CMakeLists.txt create mode 100644 recipes/c-dbg-macro/all/test_package/conanfile.py create mode 100644 recipes/c-dbg-macro/all/test_package/test_package.c create mode 100644 recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-dbg-macro/all/test_v1_package/conanfile.py create mode 100644 recipes/c-dbg-macro/config.yml create mode 100644 recipes/c4core/all/conandata.yml create mode 100644 recipes/c4core/all/conanfile.py create mode 100644 recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/test_package/CMakeLists.txt create mode 100644 recipes/c4core/all/test_package/conanfile.py create mode 100644 recipes/c4core/all/test_package/test_package.cpp create mode 100644 recipes/c4core/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c4core/all/test_v1_package/conanfile.py create mode 100644 recipes/c4core/config.yml create mode 100644 recipes/caf/all/conandata.yml create mode 100644 recipes/caf/all/conanfile.py create mode 100644 recipes/caf/all/test_package/CMakeLists.txt create mode 100644 recipes/caf/all/test_package/conanfile.py create mode 100644 recipes/caf/all/test_package/test_package.cpp create mode 100644 recipes/caf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/caf/all/test_v1_package/conanfile.py create mode 100644 recipes/caf/config.yml create mode 100644 recipes/cairo/all/conandata.yml create mode 100644 recipes/cairo/all/conanfile.py create mode 100644 recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch create mode 100644 recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch create mode 100644 recipes/cairo/all/test_package/CMakeLists.txt create mode 100644 recipes/cairo/all/test_package/conanfile.py create mode 100644 recipes/cairo/all/test_package/test_package.c create mode 100644 recipes/cairo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cairo/all/test_v1_package/conanfile.py create mode 100644 recipes/cairo/config.yml create mode 100644 recipes/cairo/meson/conandata.yml create mode 100644 recipes/cairo/meson/conanfile.py create mode 100644 recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch create mode 100644 recipes/cairo/meson/patches/cairo-1.17.4-encoding-backport.patch create mode 100644 recipes/cairo/meson/patches/cairo-1.17.4-symbol-lookup-backport.patch create mode 100644 recipes/cairo/meson/patches/cairo-1.17.4-trace-cflags-fix.patch create mode 100644 recipes/cairo/meson/patches/cairo-1.17.4-xlib-xrender-option.patch create mode 100644 recipes/cairo/meson/test_package/CMakeLists.txt create mode 100644 recipes/cairo/meson/test_package/conanfile.py create mode 100644 recipes/cairo/meson/test_package/test_package.c create mode 100644 recipes/cairo/meson/test_v1_package/CMakeLists.txt create mode 100644 recipes/cairo/meson/test_v1_package/conanfile.py create mode 100644 recipes/cairomm/all/conandata.yml create mode 100644 recipes/cairomm/all/conanfile.py create mode 100644 recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch create mode 100644 recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch create mode 100644 recipes/cairomm/all/test_package/CMakeLists.txt create mode 100644 recipes/cairomm/all/test_package/conanfile.py create mode 100644 recipes/cairomm/all/test_package/test_package.cpp create mode 100644 recipes/cairomm/config.yml create mode 100644 recipes/cajun-jsonapi/all/conandata.yml create mode 100644 recipes/cajun-jsonapi/all/conanfile.py create mode 100644 recipes/cajun-jsonapi/all/test_package/CMakeLists.txt create mode 100644 recipes/cajun-jsonapi/all/test_package/conanfile.py create mode 100644 recipes/cajun-jsonapi/all/test_package/main.cpp create mode 100644 recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cajun-jsonapi/all/test_v1_package/conanfile.py create mode 100644 recipes/cajun-jsonapi/config.yml create mode 100644 recipes/calceph/all/conandata.yml create mode 100644 recipes/calceph/all/conanfile.py create mode 100644 recipes/calceph/all/test_package/CMakeLists.txt create mode 100644 recipes/calceph/all/test_package/conanfile.py create mode 100644 recipes/calceph/all/test_package/test_package.c create mode 100644 recipes/calceph/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/calceph/all/test_v1_package/conanfile.py create mode 100644 recipes/calceph/config.yml create mode 100644 recipes/canary/all/conandata.yml create mode 100644 recipes/canary/all/conanfile.py create mode 100644 recipes/canary/all/test_package/CMakeLists.txt create mode 100644 recipes/canary/all/test_package/conanfile.py create mode 100644 recipes/canary/all/test_package/test_package.cpp create mode 100644 recipes/canary/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/canary/all/test_v1_package/conanfile.py create mode 100644 recipes/canary/all/test_v1_package/test_package.cpp create mode 100644 recipes/canary/config.yml create mode 100644 recipes/canvas_ity/all/conandata.yml create mode 100644 recipes/canvas_ity/all/conanfile.py create mode 100644 recipes/canvas_ity/all/test_package/CMakeLists.txt create mode 100644 recipes/canvas_ity/all/test_package/conanfile.py create mode 100644 recipes/canvas_ity/all/test_package/test_package.cpp create mode 100644 recipes/canvas_ity/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/canvas_ity/all/test_v1_package/conanfile.py create mode 100644 recipes/canvas_ity/config.yml create mode 100644 recipes/capnproto/all/conandata.yml create mode 100644 recipes/capnproto/all/conanfile.py create mode 100644 recipes/capnproto/all/patches/0001-disable-tests.patch create mode 100644 recipes/capnproto/all/patches/0002-cmake-compat-header-install.patch create mode 100644 recipes/capnproto/all/patches/0003-kj-tls-windows.patch create mode 100644 recipes/capnproto/all/patches/0004-cmake-module-path.patch create mode 100644 recipes/capnproto/all/patches/0005-msvc-16.7-ice-workaround.patch create mode 100644 recipes/capnproto/all/patches/0006-symlink.patch create mode 100644 recipes/capnproto/all/patches/0007-cmake-module-path.patch create mode 100644 recipes/capnproto/all/patches/0008-disable-tests.patch create mode 100644 recipes/capnproto/all/patches/0009-windows-symlink-fix-0.8.0.patch create mode 100644 recipes/capnproto/all/patches/0010-disable-tests-for-0.9.1.patch create mode 100644 recipes/capnproto/all/patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch create mode 100644 recipes/capnproto/all/patches/0012-msvc-nogdi-fix-0.9.1.patch create mode 100644 recipes/capnproto/all/patches/0013-disable-tests-for-0.10.0.patch create mode 100644 recipes/capnproto/all/patches/0014-disable-tests-for-0.10.1.patch create mode 100644 recipes/capnproto/all/test_package/CMakeLists.txt create mode 100644 recipes/capnproto/all/test_package/addressbook.c++ create mode 100644 recipes/capnproto/all/test_package/addressbook.capnp create mode 100644 recipes/capnproto/all/test_package/calculator-client.c++ create mode 100644 recipes/capnproto/all/test_package/calculator-server.c++ create mode 100644 recipes/capnproto/all/test_package/calculator.capnp create mode 100644 recipes/capnproto/all/test_package/conanfile.py create mode 100644 recipes/capnproto/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/capnproto/all/test_v1_package/conanfile.py create mode 100644 recipes/capnproto/config.yml create mode 100644 recipes/capstone/all/conandata.yml create mode 100644 recipes/capstone/all/conanfile.py create mode 100644 recipes/capstone/all/test_package/CMakeLists.txt create mode 100644 recipes/capstone/all/test_package/conanfile.py create mode 100644 recipes/capstone/all/test_package/test_package.c create mode 100644 recipes/capstone/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/capstone/all/test_v1_package/conanfile.py create mode 100644 recipes/capstone/config.yml create mode 100644 recipes/cargs/all/CMakeLists.txt create mode 100644 recipes/cargs/all/conandata.yml create mode 100644 recipes/cargs/all/conanfile.py create mode 100644 recipes/cargs/all/test_package/CMakeLists.txt create mode 100644 recipes/cargs/all/test_package/conanfile.py create mode 100644 recipes/cargs/all/test_package/test_package.c create mode 100644 recipes/cargs/config.yml create mode 100644 recipes/cassandra-cpp-driver/all/CMakeLists.txt create mode 100644 recipes/cassandra-cpp-driver/all/conandata.yml create mode 100644 recipes/cassandra-cpp-driver/all/conanfile.py create mode 100644 recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch create mode 100644 recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch create mode 100644 recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt create mode 100644 recipes/cassandra-cpp-driver/all/test_package/conanfile.py create mode 100644 recipes/cassandra-cpp-driver/all/test_package/main.cpp create mode 100644 recipes/cassandra-cpp-driver/config.yml create mode 100644 recipes/catch2/2.x.x/conandata.yml create mode 100644 recipes/catch2/2.x.x/conanfile.py create mode 100644 recipes/catch2/2.x.x/test_package/000-CatchMain.cpp create mode 100644 recipes/catch2/2.x.x/test_package/100-standalone.cpp create mode 100644 recipes/catch2/2.x.x/test_package/200-benchmark.cpp create mode 100644 recipes/catch2/2.x.x/test_package/300-standalone-with-prefix.cpp create mode 100644 recipes/catch2/2.x.x/test_package/400-benchmark-with-prefix.cpp create mode 100644 recipes/catch2/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/catch2/2.x.x/test_package/conanfile.py create mode 100644 recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/catch2/2.x.x/test_v1_package/conanfile.py create mode 100644 recipes/catch2/3.x.x/conandata.yml create mode 100644 recipes/catch2/3.x.x/conanfile.py create mode 100644 recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch create mode 100644 recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch create mode 100644 recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch create mode 100644 recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch create mode 100644 recipes/catch2/3.x.x/test_package/100-standalone.cpp create mode 100644 recipes/catch2/3.x.x/test_package/200-benchmark.cpp create mode 100644 recipes/catch2/3.x.x/test_package/300-standalone-with-prefix.cpp create mode 100644 recipes/catch2/3.x.x/test_package/400-benchmark-with-prefix.cpp create mode 100644 recipes/catch2/3.x.x/test_package/CMakeLists.txt create mode 100644 recipes/catch2/3.x.x/test_package/conanfile.py create mode 100644 recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/catch2/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/catch2/config.yml create mode 100644 recipes/cc65/all/conandata.yml create mode 100644 recipes/cc65/all/conanfile.py create mode 100644 recipes/cc65/all/patches/2.18-0001-no-embedded-paths-makefile.patch create mode 100644 recipes/cc65/all/patches/2.18-0002-libsrc-use-extension.patch create mode 100644 recipes/cc65/all/patches/2.19-0001-no-embedded-paths-makefile.patch create mode 100644 recipes/cc65/all/patches/2.19-0002-libsrc-use-extension.patch create mode 100644 recipes/cc65/all/test_package/conanfile.py create mode 100644 recipes/cc65/all/test_package/hello.c create mode 100644 recipes/cc65/all/test_package/text.s create mode 100644 recipes/cc65/config.yml create mode 100644 recipes/ccache/all/conandata.yml create mode 100644 recipes/ccache/all/conanfile.py create mode 100644 recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch create mode 100644 recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch create mode 100644 recipes/ccache/all/test_package/conanfile.py create mode 100644 recipes/ccache/all/test_v1_package/conanfile.py create mode 100644 recipes/ccache/config.yml create mode 100644 recipes/cccl/all/conandata.yml create mode 100644 recipes/cccl/all/conanfile.py create mode 100644 recipes/cccl/all/test_package/conanfile.py create mode 100644 recipes/cccl/all/test_package/example.cpp create mode 100644 recipes/cccl/all/test_v1_package/conanfile.py create mode 100644 recipes/cccl/all/test_v1_package/example.cpp create mode 100644 recipes/cccl/config.yml create mode 100644 recipes/ccfits/all/conandata.yml create mode 100644 recipes/ccfits/all/conanfile.py create mode 100644 recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch create mode 100644 recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch create mode 100644 recipes/ccfits/all/test_package/CMakeLists.txt create mode 100644 recipes/ccfits/all/test_package/conanfile.py create mode 100644 recipes/ccfits/all/test_package/test_package.cpp create mode 100644 recipes/ccfits/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ccfits/all/test_v1_package/conanfile.py create mode 100644 recipes/ccfits/config.yml create mode 100644 recipes/cctag/all/conandata.yml create mode 100644 recipes/cctag/all/conanfile.py create mode 100644 recipes/cctag/all/patches/0001-honor-vc-runtime.patch create mode 100644 recipes/cctag/all/test_package/CMakeLists.txt create mode 100644 recipes/cctag/all/test_package/conanfile.py create mode 100644 recipes/cctag/all/test_package/test_package.cpp create mode 100644 recipes/cctag/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cctag/all/test_v1_package/conanfile.py create mode 100644 recipes/cctag/config.yml create mode 100644 recipes/cctz/all/conandata.yml create mode 100644 recipes/cctz/all/conanfile.py create mode 100644 recipes/cctz/all/patches/0001-fix-installation.patch create mode 100644 recipes/cctz/all/patches/0002-fix-frameworks-apple.patch create mode 100644 recipes/cctz/all/test_package/CMakeLists.txt create mode 100644 recipes/cctz/all/test_package/conanfile.py create mode 100644 recipes/cctz/all/test_package/test_package.cpp create mode 100644 recipes/cctz/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cctz/all/test_v1_package/conanfile.py create mode 100644 recipes/cctz/config.yml create mode 100644 recipes/cd3-boost-unit-definitions/all/conandata.yml create mode 100644 recipes/cd3-boost-unit-definitions/all/conanfile.py create mode 100644 recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt create mode 100644 recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py create mode 100644 recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp create mode 100644 recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py create mode 100644 recipes/cd3-boost-unit-definitions/config.yml create mode 100644 recipes/celero/all/conandata.yml create mode 100644 recipes/celero/all/conanfile.py create mode 100644 recipes/celero/all/patches/0001-cmake-install-pic-cxx-standard-sytem-libs.patch create mode 100644 recipes/celero/all/patches/0002-lowercase-include-system-libs-windows.patch create mode 100644 recipes/celero/all/patches/0003-typo-declspec.patch create mode 100644 recipes/celero/all/patches/0004-2.6.0-missing-include.patch create mode 100644 recipes/celero/all/patches/0004-2.8.2-missing-include.patch create mode 100644 recipes/celero/all/patches/0005-drop-runtime.patch create mode 100644 recipes/celero/all/test_package/CMakeLists.txt create mode 100644 recipes/celero/all/test_package/conanfile.py create mode 100644 recipes/celero/all/test_package/test_package.cpp create mode 100644 recipes/celero/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/celero/all/test_v1_package/conanfile.py create mode 100644 recipes/celero/config.yml create mode 100644 recipes/cereal/all/conandata.yml create mode 100644 recipes/cereal/all/conanfile.py create mode 100644 recipes/cereal/all/test_package/CMakeLists.txt create mode 100644 recipes/cereal/all/test_package/conanfile.py create mode 100644 recipes/cereal/all/test_package/test_package.cpp create mode 100644 recipes/cereal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cereal/all/test_v1_package/conanfile.py create mode 100644 recipes/cereal/config.yml create mode 100644 recipes/ceres-solver/all/conandata.yml create mode 100644 recipes/ceres-solver/all/conanfile.py create mode 100644 recipes/ceres-solver/all/patches/1.14.0-0001-find-libraries-conan.patch create mode 100644 recipes/ceres-solver/all/patches/1.14.0-0002-fix-msvc-c++17.patch create mode 100644 recipes/ceres-solver/all/patches/2.0.0-0001-find-libraries-conan.patch create mode 100644 recipes/ceres-solver/all/patches/2.0.0-0002-fix-mingw-build.patch create mode 100644 recipes/ceres-solver/all/patches/2.1.0-0001-find-libraries-conan.patch create mode 100644 recipes/ceres-solver/all/patches/2.1.0-0002-fix-mingw-build.patch create mode 100644 recipes/ceres-solver/all/test_package/CMakeLists.txt create mode 100644 recipes/ceres-solver/all/test_package/conanfile.py create mode 100644 recipes/ceres-solver/all/test_package/test_package.c create mode 100644 recipes/ceres-solver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ceres-solver/all/test_v1_package/conanfile.py create mode 100644 recipes/ceres-solver/config.yml create mode 100644 recipes/cern-root/all/conandata.yml create mode 100644 recipes/cern-root/all/conanfile.py create mode 100644 recipes/cern-root/all/patches/0001-add-missing-includes.patch create mode 100644 recipes/cern-root/all/patches/0002-cmake-missing-link-libraries.patch create mode 100644 recipes/cern-root/all/test_package/CMakeLists.txt create mode 100644 recipes/cern-root/all/test_package/Event.cpp create mode 100644 recipes/cern-root/all/test_package/Event.hpp create mode 100644 recipes/cern-root/all/test_package/EventLinkDef.h create mode 100644 recipes/cern-root/all/test_package/conanfile.py create mode 100644 recipes/cern-root/all/test_package/testrootdictionaries.cpp create mode 100644 recipes/cern-root/config.yml create mode 100644 recipes/certify/all/conandata.yml create mode 100644 recipes/certify/all/conanfile.py create mode 100644 recipes/certify/all/test_package/CMakeLists.txt create mode 100644 recipes/certify/all/test_package/conanfile.py create mode 100644 recipes/certify/all/test_package/test_package.cpp create mode 100644 recipes/certify/config.yml create mode 100644 recipes/cfgfile/all/conandata.yml create mode 100644 recipes/cfgfile/all/conanfile.py create mode 100644 recipes/cfgfile/all/test_package/CMakeLists.txt create mode 100644 recipes/cfgfile/all/test_package/conanfile.py create mode 100644 recipes/cfgfile/all/test_package/session_cfg.conf create mode 100644 recipes/cfgfile/all/test_package/test.cfg create mode 100644 recipes/cfgfile/all/test_package/test_package.cpp create mode 100644 recipes/cfgfile/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cfgfile/all/test_v1_package/conanfile.py create mode 100644 recipes/cfgfile/config.yml create mode 100644 recipes/cfitsio/all/conandata.yml create mode 100644 recipes/cfitsio/all/conanfile.py create mode 100644 recipes/cfitsio/all/patches/fix-cmake-3.470.patch create mode 100644 recipes/cfitsio/all/patches/fix-cmake-3.490.patch create mode 100644 recipes/cfitsio/all/patches/fix-cmake-4.0.0.patch create mode 100644 recipes/cfitsio/all/patches/fix-cmake-4.1.0.patch create mode 100644 recipes/cfitsio/all/patches/fix-cmake-4.2.0.patch create mode 100644 recipes/cfitsio/all/patches/windows-use-strtok_s.patch create mode 100644 recipes/cfitsio/all/test_package/CMakeLists.txt create mode 100644 recipes/cfitsio/all/test_package/conanfile.py create mode 100644 recipes/cfitsio/all/test_package/file011.fits create mode 100644 recipes/cfitsio/all/test_package/test_package.c create mode 100644 recipes/cfitsio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cfitsio/all/test_v1_package/conanfile.py create mode 100644 recipes/cfitsio/config.yml create mode 100644 recipes/cgal/all/CMakeLists.txt create mode 100644 recipes/cgal/all/conandata.yml create mode 100644 recipes/cgal/all/conanfile.py create mode 100644 recipes/cgal/all/test_package/CMakeLists.txt create mode 100644 recipes/cgal/all/test_package/conanfile.py create mode 100644 recipes/cgal/all/test_package/test_package.cpp create mode 100644 recipes/cgal/config.yml create mode 100644 recipes/cgif/all/conandata.yml create mode 100644 recipes/cgif/all/conanfile.py create mode 100644 recipes/cgif/all/test_package/CMakeLists.txt create mode 100644 recipes/cgif/all/test_package/conanfile.py create mode 100644 recipes/cgif/all/test_package/test_package.c create mode 100644 recipes/cgif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cgif/all/test_v1_package/conanfile.py create mode 100644 recipes/cgif/config.yml create mode 100644 recipes/cglm/all/CMakeLists.txt create mode 100644 recipes/cglm/all/conandata.yml create mode 100644 recipes/cglm/all/conanfile.py create mode 100644 recipes/cglm/all/test_package/CMakeLists.txt create mode 100644 recipes/cglm/all/test_package/conanfile.py create mode 100644 recipes/cglm/all/test_package/test_package.c create mode 100644 recipes/cglm/config.yml create mode 100644 recipes/cgltf/all/CMakeLists.txt create mode 100644 recipes/cgltf/all/conandata.yml create mode 100644 recipes/cgltf/all/conanfile.py create mode 100644 recipes/cgltf/all/test_package/CMakeLists.txt create mode 100644 recipes/cgltf/all/test_package/conanfile.py create mode 100644 recipes/cgltf/all/test_package/test_package.cpp create mode 100644 recipes/cgltf/config.yml create mode 100644 recipes/cgns/all/conandata.yml create mode 100644 recipes/cgns/all/conanfile.py create mode 100644 recipes/cgns/all/patches/4.3.0-fix_find_hdf5.patch create mode 100644 recipes/cgns/all/patches/4.3.0-fix_static_or_shared.patch create mode 100644 recipes/cgns/all/test_package/CMakeLists.txt create mode 100644 recipes/cgns/all/test_package/conanfile.py create mode 100644 recipes/cgns/all/test_package/test_package.cpp create mode 100644 recipes/cgns/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cgns/all/test_v1_package/conanfile.py create mode 100644 recipes/cgns/config.yml create mode 100644 recipes/chaiscript/all/CMakeLists.txt create mode 100644 recipes/chaiscript/all/conandata.yml create mode 100644 recipes/chaiscript/all/conanfile.py create mode 100644 recipes/chaiscript/all/test_package/CMakeLists.txt create mode 100644 recipes/chaiscript/all/test_package/conanfile.py create mode 100644 recipes/chaiscript/all/test_package/test_package.cpp create mode 100644 recipes/chaiscript/config.yml create mode 100644 recipes/charls/all/conandata.yml create mode 100644 recipes/charls/all/conanfile.py create mode 100644 recipes/charls/all/patches/constexpr-msvc2015.patch create mode 100644 recipes/charls/all/patches/def-and-rc-for-msvc-only.patch create mode 100644 recipes/charls/all/patches/enum-name-lookup-for-gcc5.patch create mode 100644 recipes/charls/all/patches/fix-missing-includes-for-clang5-stdc++.patch create mode 100644 recipes/charls/all/test_package/CMakeLists.txt create mode 100644 recipes/charls/all/test_package/conanfile.py create mode 100644 recipes/charls/all/test_package/test_package.c create mode 100644 recipes/charls/all/test_package/test_package.cpp create mode 100644 recipes/charls/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/charls/all/test_v1_package/conanfile.py create mode 100644 recipes/charls/config.yml create mode 100644 recipes/chef-fun/all/conandata.yml create mode 100644 recipes/chef-fun/all/conanfile.py create mode 100644 recipes/chef-fun/all/test_package/CMakeLists.txt create mode 100644 recipes/chef-fun/all/test_package/conanfile.py create mode 100644 recipes/chef-fun/all/test_package/test_package.cpp create mode 100644 recipes/chef-fun/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/chef-fun/all/test_v1_package/conanfile.py create mode 100644 recipes/chef-fun/config.yml create mode 100644 recipes/chipmunk2d/all/conandata.yml create mode 100644 recipes/chipmunk2d/all/conanfile.py create mode 100644 recipes/chipmunk2d/all/test_package/CMakeLists.txt create mode 100644 recipes/chipmunk2d/all/test_package/conanfile.py create mode 100644 recipes/chipmunk2d/all/test_package/test_package.c create mode 100644 recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/chipmunk2d/all/test_v1_package/conanfile.py create mode 100644 recipes/chipmunk2d/config.yml create mode 100644 recipes/cimg/all/conandata.yml create mode 100644 recipes/cimg/all/conanfile.py create mode 100644 recipes/cimg/all/test_package/CMakeLists.txt create mode 100644 recipes/cimg/all/test_package/conanfile.py create mode 100644 recipes/cimg/all/test_package/test_package.cpp create mode 100644 recipes/cimg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cimg/all/test_v1_package/conanfile.py create mode 100644 recipes/cimg/config.yml create mode 100644 recipes/circularbuffer/all/conandata.yml create mode 100644 recipes/circularbuffer/all/conanfile.py create mode 100644 recipes/circularbuffer/all/test_package/CMakeLists.txt create mode 100644 recipes/circularbuffer/all/test_package/conanfile.py create mode 100644 recipes/circularbuffer/all/test_package/test_package.cpp create mode 100644 recipes/circularbuffer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/circularbuffer/all/test_v1_package/conanfile.py create mode 100644 recipes/circularbuffer/all/test_v1_package/test_package.cpp create mode 100644 recipes/circularbuffer/config.yml create mode 100644 recipes/cista/all/conandata.yml create mode 100644 recipes/cista/all/conanfile.py create mode 100644 recipes/cista/all/test_package/CMakeLists.txt create mode 100644 recipes/cista/all/test_package/conanfile.py create mode 100644 recipes/cista/all/test_package/test_package.cpp create mode 100644 recipes/cista/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cista/all/test_v1_package/conanfile.py create mode 100644 recipes/cista/config.yml create mode 100644 recipes/cityhash/all/conandata.yml create mode 100644 recipes/cityhash/all/conanfile.py create mode 100644 recipes/cityhash/all/test_package/CMakeLists.txt create mode 100644 recipes/cityhash/all/test_package/conanfile.py create mode 100644 recipes/cityhash/all/test_package/test_package.cpp create mode 100644 recipes/cityhash/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cityhash/all/test_v1_package/conanfile.py create mode 100644 recipes/cityhash/config.yml create mode 100644 recipes/civetweb/all/conandata.yml create mode 100644 recipes/civetweb/all/conanfile.py create mode 100644 recipes/civetweb/all/patches/0001-fix-install-bundle.patch create mode 100644 recipes/civetweb/all/test_package/CMakeLists.txt create mode 100644 recipes/civetweb/all/test_package/conanfile.py create mode 100644 recipes/civetweb/all/test_package/test_package.cpp create mode 100644 recipes/civetweb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/civetweb/all/test_v1_package/conanfile.py create mode 100644 recipes/civetweb/config.yml create mode 100644 recipes/cjson/all/conandata.yml create mode 100644 recipes/cjson/all/conanfile.py create mode 100644 recipes/cjson/all/patches/fix-cmake-install.patch create mode 100644 recipes/cjson/all/test_package/CMakeLists.txt create mode 100644 recipes/cjson/all/test_package/conanfile.py create mode 100644 recipes/cjson/all/test_package/test_package.c create mode 100644 recipes/cjson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cjson/all/test_v1_package/conanfile.py create mode 100644 recipes/cjson/config.yml create mode 100644 recipes/clara/all/conandata.yml create mode 100644 recipes/clara/all/conanfile.py create mode 100644 recipes/clara/all/test_package/CMakeLists.txt create mode 100644 recipes/clara/all/test_package/conanfile.py create mode 100644 recipes/clara/all/test_package/test_package.cpp create mode 100644 recipes/clara/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/clara/all/test_v1_package/conanfile.py create mode 100644 recipes/clara/config.yml create mode 100644 recipes/clhep/all/conandata.yml create mode 100644 recipes/clhep/all/conanfile.py create mode 100644 recipes/clhep/all/patches/fix-cmake.patch create mode 100644 recipes/clhep/all/patches/mingw-support.patch create mode 100644 recipes/clhep/all/patches/msvc-2015-no-SFINAE.patch create mode 100644 recipes/clhep/all/test_package/CMakeLists.txt create mode 100644 recipes/clhep/all/test_package/conanfile.py create mode 100644 recipes/clhep/all/test_package/test_package.cpp create mode 100644 recipes/clhep/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/clhep/all/test_v1_package/conanfile.py create mode 100644 recipes/clhep/config.yml create mode 100644 recipes/cli11/all/conandata.yml create mode 100644 recipes/cli11/all/conanfile.py create mode 100644 recipes/cli11/all/test_package/CMakeLists.txt create mode 100644 recipes/cli11/all/test_package/conanfile.py create mode 100644 recipes/cli11/all/test_package/test_package.cpp create mode 100644 recipes/cli11/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cli11/all/test_v1_package/conanfile.py create mode 100644 recipes/cli11/config.yml create mode 100644 recipes/clipp/all/conandata.yml create mode 100644 recipes/clipp/all/conanfile.py create mode 100644 recipes/clipp/all/test_package/CMakeLists.txt create mode 100644 recipes/clipp/all/test_package/conanfile.py create mode 100644 recipes/clipp/all/test_package/test_package.cpp create mode 100644 recipes/clipp/config.yml create mode 100644 recipes/clipper/all/conandata.yml create mode 100644 recipes/clipper/all/conanfile.py create mode 100644 recipes/clipper/all/patches/0001-include-install-directory-4.x.patch create mode 100644 recipes/clipper/all/patches/0001-include-install-directory-6.x.patch create mode 100644 recipes/clipper/all/test_package/CMakeLists.txt create mode 100644 recipes/clipper/all/test_package/conanfile.py create mode 100644 recipes/clipper/all/test_package/test_package.cpp create mode 100644 recipes/clipper/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/clipper/all/test_v1_package/conanfile.py create mode 100644 recipes/clipper/config.yml create mode 100644 recipes/clove-unit/all/conandata.yml create mode 100644 recipes/clove-unit/all/conanfile.py create mode 100644 recipes/clove-unit/all/test_package/CMakeLists.txt create mode 100644 recipes/clove-unit/all/test_package/conanfile.py create mode 100644 recipes/clove-unit/all/test_package/test_package.cpp create mode 100644 recipes/clove-unit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/clove-unit/all/test_v1_package/conanfile.py create mode 100644 recipes/clove-unit/config.yml create mode 100644 recipes/cmake/3.x.x/conandata.yml create mode 100644 recipes/cmake/3.x.x/conanfile.py create mode 100644 recipes/cmake/3.x.x/test_package/conanfile.py create mode 100644 recipes/cmake/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/cmake/binary/conandata.yml create mode 100644 recipes/cmake/binary/conanfile.py create mode 100644 recipes/cmake/binary/test_package/conanfile.py create mode 100644 recipes/cmake/binary/test_v1_package/conanfile.py create mode 100644 recipes/cmake/config.yml create mode 100644 recipes/cminpack/all/conandata.yml create mode 100644 recipes/cminpack/all/conanfile.py create mode 100644 recipes/cminpack/all/test_package/CMakeLists.txt create mode 100644 recipes/cminpack/all/test_package/conanfile.py create mode 100644 recipes/cminpack/all/test_package/tchkderc.c create mode 100644 recipes/cminpack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cminpack/all/test_v1_package/conanfile.py create mode 100644 recipes/cminpack/config.yml create mode 100644 recipes/cmocka/all/conandata.yml create mode 100644 recipes/cmocka/all/conanfile.py create mode 100644 recipes/cmocka/all/patches/build_either_static_or_shared.patch create mode 100644 recipes/cmocka/all/test_package/CMakeLists.txt create mode 100644 recipes/cmocka/all/test_package/conanfile.py create mode 100644 recipes/cmocka/all/test_package/test_package.c create mode 100644 recipes/cmocka/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cmocka/all/test_v1_package/conanfile.py create mode 100644 recipes/cmocka/config.yml create mode 100644 recipes/cmp/all/CMakeLists.txt create mode 100644 recipes/cmp/all/conandata.yml create mode 100644 recipes/cmp/all/conanfile.py create mode 100644 recipes/cmp/all/test_package/CMakeLists.txt create mode 100644 recipes/cmp/all/test_package/conanfile.py create mode 100644 recipes/cmp/all/test_package/test_package.c create mode 100644 recipes/cmp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cmp/all/test_v1_package/conanfile.py create mode 100644 recipes/cmp/config.yml create mode 100644 recipes/cn-cbor/all/CMakeLists.txt create mode 100644 recipes/cn-cbor/all/conandata.yml create mode 100644 recipes/cn-cbor/all/conanfile.py create mode 100644 recipes/cn-cbor/all/test_package/CMakeLists.txt create mode 100644 recipes/cn-cbor/all/test_package/conanfile.py create mode 100644 recipes/cn-cbor/all/test_package/test_package.cpp create mode 100644 recipes/cn-cbor/config.yml create mode 100644 recipes/cnpy/all/conandata.yml create mode 100644 recipes/cnpy/all/conanfile.py create mode 100644 recipes/cnpy/all/patches/0001-fix-cmake.patch create mode 100644 recipes/cnpy/all/test_package/CMakeLists.txt create mode 100644 recipes/cnpy/all/test_package/conanfile.py create mode 100644 recipes/cnpy/all/test_package/test_package.cpp create mode 100644 recipes/cnpy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cnpy/all/test_v1_package/conanfile.py create mode 100644 recipes/cnpy/config.yml create mode 100644 recipes/co/all/CMakeLists.txt create mode 100644 recipes/co/all/conandata.yml create mode 100644 recipes/co/all/conanfile.py create mode 100644 recipes/co/all/patches/001-install-dll.patch create mode 100644 recipes/co/all/patches/002-fix-event-destruct.patch create mode 100644 recipes/co/all/test_package/CMakeLists.txt create mode 100644 recipes/co/all/test_package/conanfile.py create mode 100644 recipes/co/all/test_package/test_package.cc create mode 100644 recipes/co/config.yml create mode 100644 recipes/cocoyaxi/all/conandata.yml create mode 100644 recipes/cocoyaxi/all/conanfile.py create mode 100644 recipes/cocoyaxi/all/test_package/CMakeLists.txt create mode 100644 recipes/cocoyaxi/all/test_package/conanfile.py create mode 100644 recipes/cocoyaxi/all/test_package/test_package.cpp create mode 100644 recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cocoyaxi/all/test_v1_package/conanfile.py create mode 100644 recipes/cocoyaxi/config.yml create mode 100644 recipes/coin-cbc/all/conandata.yml create mode 100644 recipes/coin-cbc/all/conanfile.py create mode 100644 recipes/coin-cbc/all/patches/0001-no-pkg-config-check.patch create mode 100644 recipes/coin-cbc/all/patches/0002-pthreads4w.patch create mode 100644 recipes/coin-cbc/all/test_package/CMakeLists.txt create mode 100644 recipes/coin-cbc/all/test_package/conanfile.py create mode 100644 recipes/coin-cbc/all/test_package/test_package.cpp create mode 100644 recipes/coin-cbc/config.yml create mode 100644 recipes/coin-cgl/all/conandata.yml create mode 100644 recipes/coin-cgl/all/conanfile.py create mode 100644 recipes/coin-cgl/all/patches/0.60.3-0001-no-pkg-config-check.patch create mode 100644 recipes/coin-cgl/all/patches/0.60.6-0001-no-pkg-config-check.patch create mode 100644 recipes/coin-cgl/all/test_package/CMakeLists.txt create mode 100644 recipes/coin-cgl/all/test_package/conanfile.py create mode 100644 recipes/coin-cgl/all/test_package/test_package.cpp create mode 100644 recipes/coin-cgl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/coin-cgl/all/test_v1_package/conanfile.py create mode 100644 recipes/coin-cgl/config.yml create mode 100644 recipes/coin-clp/all/conandata.yml create mode 100644 recipes/coin-clp/all/conanfile.py create mode 100644 recipes/coin-clp/all/patches/1.17.6-0001-no-pkg-config-check.patch create mode 100644 recipes/coin-clp/all/patches/1.17.7-0001-no-pkg-config-check.patch create mode 100644 recipes/coin-clp/all/test_package/CMakeLists.txt create mode 100644 recipes/coin-clp/all/test_package/conanfile.py create mode 100644 recipes/coin-clp/all/test_package/sample.mps create mode 100644 recipes/coin-clp/all/test_package/test_package.cpp create mode 100644 recipes/coin-clp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/coin-clp/all/test_v1_package/conanfile.py create mode 100644 recipes/coin-clp/config.yml create mode 100644 recipes/coin-lemon/all/conandata.yml create mode 100644 recipes/coin-lemon/all/conanfile.py create mode 100644 recipes/coin-lemon/all/patches/0001-remove-register-keyword.patch create mode 100644 recipes/coin-lemon/all/patches/cmake-add-runtime-destination_1.3.1.patch create mode 100644 recipes/coin-lemon/all/test_package/CMakeLists.txt create mode 100644 recipes/coin-lemon/all/test_package/conanfile.py create mode 100644 recipes/coin-lemon/all/test_package/test_package.cpp create mode 100644 recipes/coin-lemon/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/coin-lemon/all/test_v1_package/conanfile.py create mode 100644 recipes/coin-lemon/config.yml create mode 100644 recipes/coin-osi/all/conandata.yml create mode 100644 recipes/coin-osi/all/conanfile.py create mode 100644 recipes/coin-osi/all/patches/0.108.6-0001-no-pkg-config-check.patch create mode 100644 recipes/coin-osi/all/patches/0.108.6-0002-cpp17-compat.patch create mode 100644 recipes/coin-osi/all/test_package/CMakeLists.txt create mode 100644 recipes/coin-osi/all/test_package/conanfile.py create mode 100644 recipes/coin-osi/all/test_package/test_package.cpp create mode 100644 recipes/coin-osi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/coin-osi/all/test_v1_package/conanfile.py create mode 100644 recipes/coin-osi/config.yml create mode 100644 recipes/coin-utils/all/conandata.yml create mode 100644 recipes/coin-utils/all/conanfile.py create mode 100644 recipes/coin-utils/all/patches/0001-no-check-pkgconfig.patch create mode 100644 recipes/coin-utils/all/patches/0002-cpp17-compat.patch create mode 100644 recipes/coin-utils/all/test_package/CMakeLists.txt create mode 100644 recipes/coin-utils/all/test_package/conanfile.py create mode 100644 recipes/coin-utils/all/test_package/test_package.cpp create mode 100644 recipes/coin-utils/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/coin-utils/all/test_v1_package/conanfile.py create mode 100644 recipes/coin-utils/config.yml create mode 100644 recipes/commata/all/conandata.yml create mode 100644 recipes/commata/all/conanfile.py create mode 100644 recipes/commata/all/test_package/CMakeLists.txt create mode 100644 recipes/commata/all/test_package/conanfile.py create mode 100644 recipes/commata/all/test_package/test_package.cpp create mode 100644 recipes/commata/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/commata/all/test_v1_package/conanfile.py create mode 100644 recipes/commata/config.yml create mode 100644 recipes/concurrencpp/all/conandata.yml create mode 100644 recipes/concurrencpp/all/conanfile.py create mode 100644 recipes/concurrencpp/all/patches/cmake-min-version.patch create mode 100644 recipes/concurrencpp/all/patches/directory-name-0.1.5.patch create mode 100644 recipes/concurrencpp/all/patches/directory-name-0.1.6.patch create mode 100644 recipes/concurrencpp/all/patches/directory-name.patch create mode 100644 recipes/concurrencpp/all/test_package/CMakeLists.txt create mode 100644 recipes/concurrencpp/all/test_package/conanfile.py create mode 100644 recipes/concurrencpp/all/test_package/test_package.cpp create mode 100644 recipes/concurrencpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/concurrencpp/all/test_v1_package/conanfile.py create mode 100644 recipes/concurrencpp/config.yml create mode 100644 recipes/concurrentqueue/all/conandata.yml create mode 100644 recipes/concurrentqueue/all/conanfile.py create mode 100644 recipes/concurrentqueue/all/test_package/CMakeLists.txt create mode 100644 recipes/concurrentqueue/all/test_package/conanfile.py create mode 100644 recipes/concurrentqueue/all/test_package/test_package.cpp create mode 100644 recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/concurrentqueue/all/test_v1_package/conanfile.py create mode 100644 recipes/concurrentqueue/config.yml create mode 100644 recipes/confu_json/all/conandata.yml create mode 100644 recipes/confu_json/all/conanfile.py create mode 100644 recipes/confu_json/all/test_package/CMakeLists.txt create mode 100644 recipes/confu_json/all/test_package/conanfile.py create mode 100644 recipes/confu_json/all/test_package/test_package.cpp create mode 100644 recipes/confu_json/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/confu_json/all/test_v1_package/conanfile.py create mode 100644 recipes/confu_json/config.yml create mode 100644 recipes/continuable/all/conandata.yml create mode 100644 recipes/continuable/all/conanfile.py create mode 100644 recipes/continuable/all/test_package/CMakeLists.txt create mode 100644 recipes/continuable/all/test_package/conanfile.py create mode 100644 recipes/continuable/all/test_package/test_package.cpp create mode 100644 recipes/continuable/config.yml create mode 100644 recipes/corrade/all/CMakeLists.txt create mode 100644 recipes/corrade/all/cmake/conan-corrade-vars.cmake create mode 100644 recipes/corrade/all/conandata.yml create mode 100644 recipes/corrade/all/conanfile.py create mode 100644 recipes/corrade/all/patches/2020.06/0001-emscripten-toolchain.patch create mode 100644 recipes/corrade/all/test_package/CMakeLists.txt create mode 100644 recipes/corrade/all/test_package/conanfile.py create mode 100644 recipes/corrade/all/test_package/test_package.cpp create mode 100644 recipes/corrade/config.yml create mode 100644 recipes/cose-c/all/CMakeLists.txt create mode 100644 recipes/cose-c/all/conandata.yml create mode 100644 recipes/cose-c/all/conanfile.py create mode 100644 recipes/cose-c/all/patches/001-fix-cmake-targets.patch create mode 100644 recipes/cose-c/all/test_package/CMakeLists.txt create mode 100644 recipes/cose-c/all/test_package/conanfile.py create mode 100644 recipes/cose-c/all/test_package/test_package.cpp create mode 100644 recipes/cose-c/config.yml create mode 100644 recipes/cotila/all/conandata.yml create mode 100644 recipes/cotila/all/conanfile.py create mode 100644 recipes/cotila/all/test_package/CMakeLists.txt create mode 100644 recipes/cotila/all/test_package/conanfile.py create mode 100644 recipes/cotila/all/test_package/test_package.cpp create mode 100644 recipes/cotila/config.yml create mode 100644 recipes/coz/all/CMakeLists.txt create mode 100644 recipes/coz/all/conandata.yml create mode 100644 recipes/coz/all/conanfile.py create mode 100644 recipes/coz/all/test_package/CMakeLists.txt create mode 100644 recipes/coz/all/test_package/conanfile.py create mode 100644 recipes/coz/all/test_package/test_package.c create mode 100644 recipes/coz/config.yml create mode 100644 recipes/cpp-httplib/all/conandata.yml create mode 100644 recipes/cpp-httplib/all/conanfile.py create mode 100644 recipes/cpp-httplib/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-httplib/all/test_package/conanfile.py create mode 100644 recipes/cpp-httplib/all/test_package/test_package.cpp create mode 100644 recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-httplib/all/test_v1_package/conanfile.py create mode 100644 recipes/cpp-httplib/config.yml create mode 100644 recipes/cpp-ipc/all/CMakeLists.txt create mode 100644 recipes/cpp-ipc/all/conandata.yml create mode 100644 recipes/cpp-ipc/all/conanfile.py create mode 100644 recipes/cpp-ipc/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-ipc/all/test_package/conanfile.py create mode 100644 recipes/cpp-ipc/all/test_package/test_package.cpp create mode 100644 recipes/cpp-ipc/config.yml create mode 100644 recipes/cpp-jwt/all/conandata.yml create mode 100644 recipes/cpp-jwt/all/conanfile.py create mode 100644 recipes/cpp-jwt/all/patches/001-fix-msvc-14-compilation.patch create mode 100644 recipes/cpp-jwt/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-jwt/all/test_package/conanfile.py create mode 100644 recipes/cpp-jwt/all/test_package/test_package.cpp create mode 100644 recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-jwt/all/test_v1_package/conanfile.py create mode 100644 recipes/cpp-jwt/config.yml create mode 100644 recipes/cpp-lazy/all/conandata.yml create mode 100644 recipes/cpp-lazy/all/conanfile.py create mode 100644 recipes/cpp-lazy/all/patches/0001-support-gcc5.patch create mode 100644 recipes/cpp-lazy/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-lazy/all/test_package/conanfile.py create mode 100644 recipes/cpp-lazy/all/test_package/test_package.cpp create mode 100644 recipes/cpp-lazy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-lazy/all/test_v1_package/conanfile.py create mode 100644 recipes/cpp-lazy/config.yml create mode 100644 recipes/cpp-optparse/all/CMakeLists.txt create mode 100644 recipes/cpp-optparse/all/conandata.yml create mode 100644 recipes/cpp-optparse/all/conanfile.py create mode 100644 recipes/cpp-optparse/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-optparse/all/test_package/conanfile.py create mode 100644 recipes/cpp-optparse/all/test_package/test_package.cpp create mode 100644 recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-optparse/all/test_v1_package/conanfile.py create mode 100644 recipes/cpp-optparse/config.yml create mode 100644 recipes/cpp-peglib/0.x.x/conandata.yml create mode 100644 recipes/cpp-peglib/0.x.x/conanfile.py create mode 100644 recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt create mode 100644 recipes/cpp-peglib/0.x.x/test_package/conanfile.py create mode 100644 recipes/cpp-peglib/0.x.x/test_package/test_package.cpp create mode 100644 recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-peglib/0.x.x/test_v1_package/conanfile.py create mode 100644 recipes/cpp-peglib/1.x.x/conandata.yml create mode 100644 recipes/cpp-peglib/1.x.x/conanfile.py create mode 100644 recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt create mode 100644 recipes/cpp-peglib/1.x.x/test_package/conanfile.py create mode 100644 recipes/cpp-peglib/1.x.x/test_package/test_package.cpp create mode 100644 recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-peglib/1.x.x/test_v1_package/conanfile.py create mode 100644 recipes/cpp-peglib/config.yml create mode 100644 recipes/cpp-sort/all/conandata.yml create mode 100644 recipes/cpp-sort/all/conanfile.py create mode 100644 recipes/cpp-sort/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-sort/all/test_package/conanfile.py create mode 100644 recipes/cpp-sort/all/test_package/cpp-sort-integrity.cpp create mode 100644 recipes/cpp-sort/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpp-sort/all/test_v1_package/conanfile.py create mode 100644 recipes/cpp-sort/config.yml create mode 100644 recipes/cpp-taskflow/all/conandata.yml create mode 100644 recipes/cpp-taskflow/all/conanfile.py create mode 100644 recipes/cpp-taskflow/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp-taskflow/all/test_package/conanfile.py create mode 100644 recipes/cpp-taskflow/all/test_package/test_package.cpp create mode 100644 recipes/cpp-taskflow/config.yml create mode 100644 recipes/cpp_project_framework/all/conandata.yml create mode 100644 recipes/cpp_project_framework/all/conanfile.py create mode 100644 recipes/cpp_project_framework/all/test_package/CMakeLists.txt create mode 100644 recipes/cpp_project_framework/all/test_package/conanfile.py create mode 100644 recipes/cpp_project_framework/all/test_package/test_package.cpp create mode 100644 recipes/cpp_project_framework/config.yml create mode 100644 recipes/cppbenchmark/all/conandata.yml create mode 100644 recipes/cppbenchmark/all/conanfile.py create mode 100644 recipes/cppbenchmark/all/patches/1.0.0.0-0001-fix-cmake.patch create mode 100644 recipes/cppbenchmark/all/patches/1.0.3.0-0001-fix-cmake.patch create mode 100644 recipes/cppbenchmark/all/test_package/CMakeLists.txt create mode 100644 recipes/cppbenchmark/all/test_package/conanfile.py create mode 100644 recipes/cppbenchmark/all/test_package/test_package.cpp create mode 100644 recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppbenchmark/all/test_v1_package/conanfile.py create mode 100644 recipes/cppbenchmark/config.yml create mode 100644 recipes/cppcheck/all/conandata.yml create mode 100644 recipes/cppcheck/all/conanfile.py create mode 100644 recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.10.patch create mode 100644 recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch create mode 100644 recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch create mode 100644 recipes/cppcheck/all/patches/0002-htmlreport-python3.patch create mode 100644 recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch create mode 100644 recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch create mode 100644 recipes/cppcheck/all/test_package/conanfile.py create mode 100644 recipes/cppcheck/all/test_package/file_to_check.cpp create mode 100644 recipes/cppcheck/all/test_v1_package/conanfile.py create mode 100644 recipes/cppcheck/all/test_v1_package/file_to_check.cpp create mode 100644 recipes/cppcheck/config.yml create mode 100644 recipes/cppcmd/all/conandata.yml create mode 100644 recipes/cppcmd/all/conanfile.py create mode 100644 recipes/cppcmd/all/test_package/CMakeLists.txt create mode 100644 recipes/cppcmd/all/test_package/conanfile.py create mode 100644 recipes/cppcmd/all/test_package/main.cpp create mode 100644 recipes/cppcmd/config.yml create mode 100644 recipes/cppcodec/all/conandata.yml create mode 100644 recipes/cppcodec/all/conanfile.py create mode 100644 recipes/cppcodec/all/test_package/CMakeLists.txt create mode 100644 recipes/cppcodec/all/test_package/conanfile.py create mode 100644 recipes/cppcodec/all/test_package/test_package.cpp create mode 100644 recipes/cppcodec/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppcodec/all/test_v1_package/conanfile.py create mode 100644 recipes/cppcodec/config.yml create mode 100644 recipes/cppcommon/all/CMakeLists.txt create mode 100644 recipes/cppcommon/all/conandata.yml create mode 100644 recipes/cppcommon/all/conanfile.py create mode 100644 recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch create mode 100644 recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch create mode 100644 recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch create mode 100644 recipes/cppcommon/all/patches/0002-fix-cross-platform-issues.patch create mode 100644 recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch create mode 100644 recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch create mode 100644 recipes/cppcommon/all/test_package/CMakeLists.txt create mode 100644 recipes/cppcommon/all/test_package/conanfile.py create mode 100644 recipes/cppcommon/all/test_package/test_package.cpp create mode 100644 recipes/cppcommon/config.yml create mode 100644 recipes/cppfront/all/CMakeLists.txt create mode 100644 recipes/cppfront/all/conandata.yml create mode 100644 recipes/cppfront/all/conanfile.py create mode 100644 recipes/cppfront/all/test_package/conanfile.py create mode 100644 recipes/cppfront/all/test_package/pure2-hello.cpp2 create mode 100644 recipes/cppfront/all/test_v1_package/conanfile.py create mode 100644 recipes/cppfront/config.yml create mode 100644 recipes/cppitertools/all/conandata.yml create mode 100644 recipes/cppitertools/all/conanfile.py create mode 100644 recipes/cppitertools/all/test_package/CMakeLists.txt create mode 100644 recipes/cppitertools/all/test_package/conanfile.py create mode 100644 recipes/cppitertools/all/test_package/test_package.cpp create mode 100644 recipes/cppitertools/all/test_package/test_zip_longest.cpp create mode 100644 recipes/cppitertools/config.yml create mode 100644 recipes/cppkafka/all/conandata.yml create mode 100644 recipes/cppkafka/all/conanfile.py create mode 100644 recipes/cppkafka/all/patches/0001-no-template-export.patch create mode 100644 recipes/cppkafka/all/patches/0002-cppstd.patch create mode 100644 recipes/cppkafka/all/patches/0003-clean-rpath.patch create mode 100644 recipes/cppkafka/all/test_package/CMakeLists.txt create mode 100644 recipes/cppkafka/all/test_package/conanfile.py create mode 100644 recipes/cppkafka/all/test_package/test_package.cpp create mode 100644 recipes/cppkafka/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppkafka/all/test_v1_package/conanfile.py create mode 100644 recipes/cppkafka/config.yml create mode 100644 recipes/cpprestsdk/all/conandata.yml create mode 100644 recipes/cpprestsdk/all/conanfile.py create mode 100644 recipes/cpprestsdk/all/patches/0001-find-cmake-targets.patch create mode 100644 recipes/cpprestsdk/all/patches/0002-remove-wconversion.patch create mode 100644 recipes/cpprestsdk/all/patches/0003-find-cmake-targets.patch create mode 100644 recipes/cpprestsdk/all/test_package/CMakeLists.txt create mode 100644 recipes/cpprestsdk/all/test_package/conanfile.py create mode 100644 recipes/cpprestsdk/all/test_package/test_package.cpp create mode 100644 recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpprestsdk/all/test_v1_package/conanfile.py create mode 100644 recipes/cpprestsdk/config.yml create mode 100644 recipes/cppserver/all/conandata.yml create mode 100644 recipes/cppserver/all/conanfile.py create mode 100644 recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch create mode 100644 recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch create mode 100644 recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-2-0.patch create mode 100644 recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch create mode 100644 recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch create mode 100644 recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-2-0.patch create mode 100644 recipes/cppserver/all/patches/0003-remove-asio-defines-1-0-0-0.patch create mode 100644 recipes/cppserver/all/test_package/CMakeLists.txt create mode 100644 recipes/cppserver/all/test_package/conanfile.py create mode 100644 recipes/cppserver/all/test_package/test_package.cpp create mode 100644 recipes/cppserver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppserver/all/test_v1_package/conanfile.py create mode 100644 recipes/cppserver/config.yml create mode 100644 recipes/cpptoml/all/conandata.yml create mode 100644 recipes/cpptoml/all/conanfile.py create mode 100644 recipes/cpptoml/all/test_package/CMakeLists.txt create mode 100644 recipes/cpptoml/all/test_package/conanfile.py create mode 100644 recipes/cpptoml/all/test_package/test_package.cpp create mode 100644 recipes/cpptoml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpptoml/all/test_v1_package/conanfile.py create mode 100644 recipes/cpptoml/config.yml create mode 100644 recipes/cppunit/all/conandata.yml create mode 100644 recipes/cppunit/all/conanfile.py create mode 100644 recipes/cppunit/all/test_package/CMakeLists.txt create mode 100644 recipes/cppunit/all/test_package/conanfile.py create mode 100644 recipes/cppunit/all/test_package/test_package.cpp create mode 100644 recipes/cppunit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppunit/all/test_v1_package/conanfile.py create mode 100644 recipes/cppunit/config.yml create mode 100644 recipes/cpputest/all/conandata.yml create mode 100644 recipes/cpputest/all/conanfile.py create mode 100644 recipes/cpputest/all/patches/0001-fix-cmake.patch create mode 100644 recipes/cpputest/all/test_package/CMakeLists.txt create mode 100644 recipes/cpputest/all/test_package/conanfile.py create mode 100644 recipes/cpputest/all/test_package/test_package.cpp create mode 100644 recipes/cpputest/all/test_package/test_package_with_extensions.cpp create mode 100644 recipes/cpputest/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpputest/all/test_v1_package/conanfile.py create mode 100644 recipes/cpputest/config.yml create mode 100644 recipes/cppzmq/all/conandata.yml create mode 100644 recipes/cppzmq/all/conanfile.py create mode 100644 recipes/cppzmq/all/test_package/CMakeLists.txt create mode 100644 recipes/cppzmq/all/test_package/conanfile.py create mode 100644 recipes/cppzmq/all/test_package/test_package.cpp create mode 100644 recipes/cppzmq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppzmq/all/test_v1_package/conanfile.py create mode 100644 recipes/cppzmq/config.yml create mode 100644 recipes/cpr/all/conandata.yml create mode 100644 recipes/cpr/all/conanfile.py create mode 100644 recipes/cpr/all/patches/002-1.4.0-create-install.patch create mode 100644 recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch create mode 100644 recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch create mode 100644 recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch create mode 100644 recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch create mode 100644 recipes/cpr/all/patches/005-1.7.2-fix-curl-components.patch create mode 100644 recipes/cpr/all/patches/005-1.8.1-fix-curl-components.patch create mode 100644 recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch create mode 100644 recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch create mode 100644 recipes/cpr/all/patches/007-fix-dll-install.patch create mode 100644 recipes/cpr/all/patches/008-1.10.0-remove-warning-flags.patch create mode 100644 recipes/cpr/all/patches/008-1.7.2-remove-warning-flags.patch create mode 100644 recipes/cpr/all/patches/008-1.8.1-remove-warning-flags.patch create mode 100644 recipes/cpr/all/patches/008-1.9.3-remove-warning-flags.patch create mode 100644 recipes/cpr/all/test_package/CMakeLists.txt create mode 100644 recipes/cpr/all/test_package/conanfile.py create mode 100644 recipes/cpr/all/test_package/test_package.cpp create mode 100644 recipes/cpr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpr/all/test_v1_package/conanfile.py create mode 100644 recipes/cpr/config.yml create mode 100644 recipes/cprocessing/all/conandata.yml create mode 100644 recipes/cprocessing/all/conanfile.py create mode 100644 recipes/cprocessing/all/test_package/CMakeLists.txt create mode 100644 recipes/cprocessing/all/test_package/conanfile.py create mode 100644 recipes/cprocessing/all/test_package/test_package.cpp create mode 100644 recipes/cprocessing/config.yml create mode 100644 recipes/cpu_features/all/conandata.yml create mode 100644 recipes/cpu_features/all/conanfile.py create mode 100644 recipes/cpu_features/all/patches/0.6.0-0001-fix-bundle-install.patch create mode 100644 recipes/cpu_features/all/patches/0.7.0-0001-support-aarch64-macos.patch create mode 100644 recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch create mode 100644 recipes/cpu_features/all/test_package/CMakeLists.txt create mode 100644 recipes/cpu_features/all/test_package/conanfile.py create mode 100644 recipes/cpu_features/all/test_package/test_package.c create mode 100644 recipes/cpu_features/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpu_features/all/test_v1_package/conanfile.py create mode 100644 recipes/cpu_features/config.yml create mode 100644 recipes/cpuinfo/all/conandata.yml create mode 100644 recipes/cpuinfo/all/conanfile.py create mode 100644 recipes/cpuinfo/all/test_package/CMakeLists.txt create mode 100644 recipes/cpuinfo/all/test_package/conanfile.py create mode 100644 recipes/cpuinfo/all/test_package/test_package.c create mode 100644 recipes/cpuinfo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpuinfo/all/test_v1_package/conanfile.py create mode 100644 recipes/cpuinfo/config.yml create mode 100644 recipes/cpython/all/conandata.yml create mode 100644 recipes/cpython/all/conanfile.py create mode 100644 recipes/cpython/all/patches/2.7.18-0001-msvc.patch create mode 100644 recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch create mode 100644 recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch create mode 100644 recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch create mode 100644 recipes/cpython/all/patches/3.10.0-0001-msvc.patch create mode 100644 recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch create mode 100644 recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch create mode 100644 recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch create mode 100644 recipes/cpython/all/patches/3.7.9-0001-msvc.patch create mode 100644 recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch create mode 100644 recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch create mode 100644 recipes/cpython/all/patches/3.8.12-0001-msvc.patch create mode 100644 recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch create mode 100644 recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch create mode 100644 recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch create mode 100644 recipes/cpython/all/patches/3.9.7-0001-msvc.patch create mode 100644 recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch create mode 100644 recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch create mode 100644 recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch create mode 100644 recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch create mode 100644 recipes/cpython/all/patches/3.x-0001-relocatable-python-config.patch create mode 100644 recipes/cpython/all/test_package/CMakeLists.txt create mode 100644 recipes/cpython/all/test_package/conanfile.py create mode 100644 recipes/cpython/all/test_package/py2/test_module.c create mode 100644 recipes/cpython/all/test_package/py2/test_package.c create mode 100644 recipes/cpython/all/test_package/py3/test_module.c create mode 100644 recipes/cpython/all/test_package/py3/test_package.c create mode 100644 recipes/cpython/all/test_package/setup.py create mode 100644 recipes/cpython/all/test_package/test_package.py create mode 100644 recipes/cpython/config.yml create mode 100644 recipes/cqrlib/all/CMakeLists.txt create mode 100644 recipes/cqrlib/all/conandata.yml create mode 100644 recipes/cqrlib/all/conanfile.py create mode 100644 recipes/cqrlib/all/test_package/CMakeLists.txt create mode 100644 recipes/cqrlib/all/test_package/conanfile.py create mode 100644 recipes/cqrlib/all/test_package/test_package.c create mode 100644 recipes/cqrlib/all/test_package/test_package.cpp create mode 100644 recipes/cqrlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cqrlib/all/test_v1_package/conanfile.py create mode 100644 recipes/cqrlib/config.yml create mode 100644 recipes/crashpad/all/conandata.yml create mode 100644 recipes/crashpad/all/conanfile.py create mode 100644 recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch create mode 100644 recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch create mode 100644 recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch create mode 100644 recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch create mode 100644 recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch create mode 100644 recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch create mode 100644 recipes/crashpad/all/patches/cci.20210507-0007-use-system-zlib.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0001-fix-openssl-link-order.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0003-compilers-from-env.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0005-allow-all-archs.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0006-mini_chromium-win_helper-py3.patch create mode 100644 recipes/crashpad/all/patches/cci.20220219-0007-static-lib-tool_support.patch create mode 100644 recipes/crashpad/all/test_package/CMakeLists.txt create mode 100644 recipes/crashpad/all/test_package/conanfile.py create mode 100644 recipes/crashpad/all/test_package/test_package.cpp create mode 100644 recipes/crashpad/config.yml create mode 100644 recipes/crc32c/all/conandata.yml create mode 100644 recipes/crc32c/all/conanfile.py create mode 100644 recipes/crc32c/all/test_package/CMakeLists.txt create mode 100644 recipes/crc32c/all/test_package/conanfile.py create mode 100644 recipes/crc32c/all/test_package/test_package.cpp create mode 100644 recipes/crc32c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/crc32c/all/test_v1_package/conanfile.py create mode 100644 recipes/crc32c/config.yml create mode 100644 recipes/crc_cpp/all/conandata.yml create mode 100644 recipes/crc_cpp/all/conanfile.py create mode 100644 recipes/crc_cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/crc_cpp/all/test_package/conanfile.py create mode 100644 recipes/crc_cpp/all/test_package/test_package.cpp create mode 100644 recipes/crc_cpp/config.yml create mode 100644 recipes/create-dmg/all/conandata.yml create mode 100644 recipes/create-dmg/all/conanfile.py create mode 100644 recipes/create-dmg/all/patches/0001-change-share-to-res.patch create mode 100644 recipes/create-dmg/all/test_package/conanfile.py create mode 100644 recipes/create-dmg/all/test_v1_package/conanfile.py create mode 100644 recipes/create-dmg/config.yml create mode 100644 recipes/croncpp/all/CMakeLists.txt create mode 100644 recipes/croncpp/all/conandata.yml create mode 100644 recipes/croncpp/all/conanfile.py create mode 100644 recipes/croncpp/all/test_package/CMakeLists.txt create mode 100644 recipes/croncpp/all/test_package/conanfile.py create mode 100644 recipes/croncpp/all/test_package/test_package.cpp create mode 100644 recipes/croncpp/config.yml create mode 100644 recipes/crow/all/conandata.yml create mode 100644 recipes/crow/all/conanfile.py create mode 100644 recipes/crow/all/patches/001-fix-cmake-errors.patch create mode 100644 recipes/crow/all/test_package/CMakeLists.txt create mode 100644 recipes/crow/all/test_package/conanfile.py create mode 100644 recipes/crow/all/test_package/test_package.cpp create mode 100644 recipes/crow/config.yml create mode 100644 recipes/crowcpp-crow/all/conandata.yml create mode 100644 recipes/crowcpp-crow/all/conanfile.py create mode 100644 recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch create mode 100644 recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch create mode 100644 recipes/crowcpp-crow/all/test_package/CMakeLists.txt create mode 100644 recipes/crowcpp-crow/all/test_package/conanfile.py create mode 100644 recipes/crowcpp-crow/all/test_package/test_package.cpp create mode 100644 recipes/crowcpp-crow/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/crowcpp-crow/all/test_v1_package/conanfile.py create mode 100644 recipes/crowcpp-crow/config.yml create mode 100644 recipes/crunch/all/CMakeLists.txt create mode 100644 recipes/crunch/all/conandata.yml create mode 100644 recipes/crunch/all/conanfile.py create mode 100644 recipes/crunch/all/patches/001_linux64_compilation_fixes.patch create mode 100644 recipes/crunch/all/patches/002_fix_clang_inline.patch create mode 100644 recipes/crunch/all/patches/003_fix_missing_cast.patch create mode 100644 recipes/crunch/all/test_package/CMakeLists.txt create mode 100644 recipes/crunch/all/test_package/conanfile.py create mode 100644 recipes/crunch/all/test_package/test.png create mode 100644 recipes/crunch/all/test_package/test_package.cpp create mode 100644 recipes/crunch/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/crunch/all/test_v1_package/conanfile.py create mode 100644 recipes/crunch/config.yml create mode 100644 recipes/cryptopp-pem/all/CMakeLists.txt create mode 100644 recipes/cryptopp-pem/all/conandata.yml create mode 100644 recipes/cryptopp-pem/all/conanfile.py create mode 100644 recipes/cryptopp-pem/all/patches/fix-cmake.patch create mode 100644 recipes/cryptopp-pem/all/patches/link-to-cryptopp.patch create mode 100644 recipes/cryptopp-pem/all/patches/remove-cryptopp-sources-from-cmake.patch create mode 100644 recipes/cryptopp-pem/all/patches/rename-output-library.patch create mode 100644 recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch create mode 100644 recipes/cryptopp-pem/all/test_package/CMakeLists.txt create mode 100644 recipes/cryptopp-pem/all/test_package/conanfile.py create mode 100644 recipes/cryptopp-pem/all/test_package/test_package.cpp create mode 100644 recipes/cryptopp-pem/config.yml create mode 100644 recipes/cryptopp/all/conandata.yml create mode 100644 recipes/cryptopp/all/conanfile.py create mode 100644 recipes/cryptopp/all/patches/8.2.0-0001-fix-cmake.patch create mode 100644 recipes/cryptopp/all/patches/8.2.0-0002-relocatable-macos.patch create mode 100644 recipes/cryptopp/all/patches/8.4.0-0001-relocatable-macos.patch create mode 100644 recipes/cryptopp/all/patches/8.6.0-0001-fix-cmake.patch create mode 100644 recipes/cryptopp/all/patches/8.6.0-0002-relocatable-macos.patch create mode 100755 recipes/cryptopp/all/patches/8.7.0-0001-fix-msvc-arm64.patch create mode 100644 recipes/cryptopp/all/test_package/CMakeLists.txt create mode 100644 recipes/cryptopp/all/test_package/conanfile.py create mode 100644 recipes/cryptopp/all/test_package/test_package.cpp create mode 100644 recipes/cryptopp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cryptopp/all/test_v1_package/conanfile.py create mode 100644 recipes/cryptopp/config.yml create mode 100644 recipes/cs_libguarded/all/conandata.yml create mode 100644 recipes/cs_libguarded/all/conanfile.py create mode 100644 recipes/cs_libguarded/all/test_package/CMakeLists.txt create mode 100644 recipes/cs_libguarded/all/test_package/conanfile.py create mode 100644 recipes/cs_libguarded/all/test_package/test_package.cpp create mode 100644 recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cs_libguarded/all/test_v1_package/conanfile.py create mode 100644 recipes/cs_libguarded/config.yml create mode 100644 recipes/csm/all/CMakeLists.txt create mode 100644 recipes/csm/all/conandata.yml create mode 100644 recipes/csm/all/conanfile.py create mode 100644 recipes/csm/all/test_package/CMakeLists.txt create mode 100644 recipes/csm/all/test_package/conanfile.py create mode 100644 recipes/csm/all/test_package/test_package.cpp create mode 100644 recipes/csm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/csm/all/test_v1_package/conanfile.py create mode 100644 recipes/csm/config.yml create mode 100644 recipes/cspice/all/CMakeLists.txt create mode 100644 recipes/cspice/all/conandata.yml create mode 100644 recipes/cspice/all/conanfile.py create mode 100644 recipes/cspice/all/patches/isatty.patch create mode 100644 recipes/cspice/all/patches/patches20171106.patch create mode 100644 recipes/cspice/all/test_package/CMakeLists.txt create mode 100644 recipes/cspice/all/test_package/conanfile.py create mode 100644 recipes/cspice/all/test_package/test_package.c create mode 100644 recipes/cspice/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cspice/all/test_v1_package/conanfile.py create mode 100644 recipes/cspice/config.yml create mode 100644 recipes/csvmonkey/all/conandata.yml create mode 100644 recipes/csvmonkey/all/conanfile.py create mode 100644 recipes/csvmonkey/all/test_package/CMakeLists.txt create mode 100644 recipes/csvmonkey/all/test_package/conanfile.py create mode 100644 recipes/csvmonkey/all/test_package/test_package.cpp create mode 100644 recipes/csvmonkey/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/csvmonkey/all/test_v1_package/conanfile.py create mode 100644 recipes/csvmonkey/config.yml create mode 100644 recipes/ctml/all/conandata.yml create mode 100644 recipes/ctml/all/conanfile.py create mode 100644 recipes/ctml/all/test_package/CMakeLists.txt create mode 100644 recipes/ctml/all/test_package/conanfile.py create mode 100644 recipes/ctml/all/test_package/test_package.cpp create mode 100644 recipes/ctml/config.yml create mode 100644 recipes/ctpg/all/conandata.yml create mode 100644 recipes/ctpg/all/conanfile.py create mode 100644 recipes/ctpg/all/test_package/CMakeLists.txt create mode 100644 recipes/ctpg/all/test_package/conanfile.py create mode 100644 recipes/ctpg/all/test_package/test_package.cpp create mode 100644 recipes/ctpg/config.yml create mode 100644 recipes/ctre/all/conandata.yml create mode 100644 recipes/ctre/all/conanfile.py create mode 100644 recipes/ctre/all/test_package/CMakeLists.txt create mode 100644 recipes/ctre/all/test_package/conanfile.py create mode 100644 recipes/ctre/all/test_package/test_package.cpp create mode 100644 recipes/ctre/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ctre/all/test_v1_package/conanfile.py create mode 100644 recipes/ctre/config.yml create mode 100644 recipes/cubicinterpolation/all/CMakeLists.txt create mode 100644 recipes/cubicinterpolation/all/conandata.yml create mode 100644 recipes/cubicinterpolation/all/conanfile.py create mode 100644 recipes/cubicinterpolation/all/patches/patch_conanbuildinfo.diff create mode 100644 recipes/cubicinterpolation/all/patches/rm_conan_basic_setup.diff create mode 100644 recipes/cubicinterpolation/all/test_package/CMakeLists.txt create mode 100644 recipes/cubicinterpolation/all/test_package/conanfile.py create mode 100644 recipes/cubicinterpolation/all/test_package/test_package.cpp create mode 100644 recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cubicinterpolation/all/test_v1_package/conanfile.py create mode 100644 recipes/cubicinterpolation/config.yml create mode 100644 recipes/cuda-kat/all/conandata.yml create mode 100644 recipes/cuda-kat/all/conanfile.py create mode 100644 recipes/cuda-kat/all/test_package/CMakeLists.txt create mode 100644 recipes/cuda-kat/all/test_package/conanfile.py create mode 100644 recipes/cuda-kat/all/test_package/test_package.cpp create mode 100644 recipes/cuda-kat/config.yml create mode 100644 recipes/cunit/all/conandata.yml create mode 100644 recipes/cunit/all/conanfile.py create mode 100644 recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch create mode 100644 recipes/cunit/all/patches/0002-snprintf-msvc.patch create mode 100644 recipes/cunit/all/test_package/CMakeLists.txt create mode 100644 recipes/cunit/all/test_package/conanfile.py create mode 100644 recipes/cunit/all/test_package/test_package.c create mode 100644 recipes/cunit/config.yml create mode 100644 recipes/cute_headers/all/conandata.yml create mode 100644 recipes/cute_headers/all/conanfile.py create mode 100644 recipes/cute_headers/all/test_package/CMakeLists.txt create mode 100644 recipes/cute_headers/all/test_package/conanfile.py create mode 100644 recipes/cute_headers/all/test_package/test_package.c create mode 100644 recipes/cute_headers/config.yml create mode 100644 recipes/cvplot/all/conandata.yml create mode 100644 recipes/cvplot/all/conanfile.py create mode 100644 recipes/cvplot/all/test_package/CMakeLists.txt create mode 100644 recipes/cvplot/all/test_package/conanfile.py create mode 100644 recipes/cvplot/all/test_package/test_package.cpp create mode 100644 recipes/cvplot/config.yml create mode 100644 recipes/cwalk/all/conandata.yml create mode 100644 recipes/cwalk/all/conanfile.py create mode 100644 recipes/cwalk/all/patches/0001-fix-cmake-1.0.0.patch create mode 100644 recipes/cwalk/all/patches/0001-fix-cmake-1.1.0.patch create mode 100644 recipes/cwalk/all/patches/0001-fix-cmake-1.2.2.patch create mode 100644 recipes/cwalk/all/patches/0001-fix-cmake-1.2.5.patch create mode 100644 recipes/cwalk/all/test_package/CMakeLists.txt create mode 100644 recipes/cwalk/all/test_package/conanfile.py create mode 100755 recipes/cwalk/all/test_package/test_package.c create mode 100644 recipes/cwalk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cwalk/all/test_v1_package/conanfile.py create mode 100644 recipes/cwalk/config.yml create mode 100644 recipes/cxxopts/all/conandata.yml create mode 100644 recipes/cxxopts/all/conanfile.py create mode 100644 recipes/cxxopts/all/test_package/CMakeLists.txt create mode 100644 recipes/cxxopts/all/test_package/conanfile.py create mode 100644 recipes/cxxopts/all/test_package/test_package.cpp create mode 100644 recipes/cxxopts/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cxxopts/all/test_v1_package/conanfile.py create mode 100644 recipes/cxxopts/config.yml create mode 100644 recipes/cyclonedds/all/conandata.yml create mode 100644 recipes/cyclonedds/all/conanfile.py create mode 100644 recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch create mode 100644 recipes/cyclonedds/all/test_package/CMakeLists.txt create mode 100644 recipes/cyclonedds/all/test_package/conanfile.py create mode 100644 recipes/cyclonedds/all/test_package/test_package.cpp create mode 100644 recipes/cyclonedds/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cyclonedds/all/test_v1_package/conanfile.py create mode 100644 recipes/cyclonedds/config.yml create mode 100644 recipes/cyrus-sasl/all/conandata.yml create mode 100644 recipes/cyrus-sasl/all/conanfile.py create mode 100644 recipes/cyrus-sasl/all/test_package/CMakeLists.txt create mode 100644 recipes/cyrus-sasl/all/test_package/conanfile.py create mode 100644 recipes/cyrus-sasl/all/test_package/test_package.c create mode 100644 recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cyrus-sasl/all/test_v1_package/conanfile.py create mode 100644 recipes/cyrus-sasl/config.yml create mode 100644 recipes/czmq/all/conandata.yml create mode 100644 recipes/czmq/all/conanfile.py create mode 100644 recipes/czmq/all/patches/4.2.0-0001-fix-cmake.patch create mode 100644 recipes/czmq/all/patches/4.2.1-0001-fix-cmake.patch create mode 100644 recipes/czmq/all/patches/4.2.1-0002-fix-zsys_thread-issue.patch create mode 100644 recipes/czmq/all/test_package/CMakeLists.txt create mode 100644 recipes/czmq/all/test_package/conanfile.py create mode 100644 recipes/czmq/all/test_package/test_package.c create mode 100644 recipes/czmq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/czmq/all/test_v1_package/conanfile.py create mode 100644 recipes/czmq/config.yml create mode 100644 recipes/dacap-clip/all/conandata.yml create mode 100644 recipes/dacap-clip/all/conanfile.py create mode 100644 recipes/dacap-clip/all/test_package/CMakeLists.txt create mode 100644 recipes/dacap-clip/all/test_package/conanfile.py create mode 100644 recipes/dacap-clip/all/test_package/test_package.cpp create mode 100644 recipes/dacap-clip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dacap-clip/all/test_v1_package/conanfile.py create mode 100644 recipes/dacap-clip/config.yml create mode 100644 recipes/daggy/2.1/CMakeLists.txt create mode 100644 recipes/daggy/2.1/conandata.yml create mode 100644 recipes/daggy/2.1/conanfile.py create mode 100644 recipes/daggy/2.1/test_package/CMakeLists.txt create mode 100644 recipes/daggy/2.1/test_package/conanfile.py create mode 100644 recipes/daggy/2.1/test_package/test.cpp create mode 100644 recipes/daggy/config.yml create mode 100644 recipes/darknet/all/conandata.yml create mode 100644 recipes/darknet/all/conanfile.py create mode 100644 recipes/darknet/all/patches/include_conan_flags.patch create mode 100644 recipes/darknet/all/test_package/CMakeLists.txt create mode 100644 recipes/darknet/all/test_package/conanfile.py create mode 100644 recipes/darknet/all/test_package/example.cpp create mode 100644 recipes/darknet/config.yml create mode 100644 recipes/dataframe/all/conandata.yml create mode 100644 recipes/dataframe/all/conanfile.py create mode 100644 recipes/dataframe/all/patches/2.0.0-0001-use-abs.patch create mode 100644 recipes/dataframe/all/test_package/CMakeLists.txt create mode 100644 recipes/dataframe/all/test_package/conanfile.py create mode 100644 recipes/dataframe/all/test_package/test_package.cpp create mode 100644 recipes/dataframe/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dataframe/all/test_v1_package/conanfile.py create mode 100644 recipes/dataframe/config.yml create mode 100644 recipes/date/all/conandata.yml create mode 100644 recipes/date/all/conanfile.py create mode 100644 recipes/date/all/patches/0001-fix-uwp.patch create mode 100644 recipes/date/all/patches/cmake-3.0.0.patch create mode 100644 recipes/date/all/patches/cmake-3.0.1.patch create mode 100644 recipes/date/all/patches/cmake.patch create mode 100644 recipes/date/all/patches/string_view.patch create mode 100644 recipes/date/all/test_package/CMakeLists.txt create mode 100644 recipes/date/all/test_package/conanfile.py create mode 100644 recipes/date/all/test_package/test_package.cpp create mode 100644 recipes/date/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/date/all/test_v1_package/conanfile.py create mode 100644 recipes/date/config.yml create mode 100644 recipes/dav1d/all/conandata.yml create mode 100644 recipes/dav1d/all/conanfile.py create mode 100644 recipes/dav1d/all/test_package/CMakeLists.txt create mode 100644 recipes/dav1d/all/test_package/conanfile.py create mode 100644 recipes/dav1d/all/test_package/test_package.c create mode 100644 recipes/dav1d/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dav1d/all/test_v1_package/conanfile.py create mode 100644 recipes/dav1d/config.yml create mode 100644 recipes/daw_header_libraries/all/conandata.yml create mode 100644 recipes/daw_header_libraries/all/conanfile.py create mode 100644 recipes/daw_header_libraries/all/test_package/CMakeLists.txt create mode 100644 recipes/daw_header_libraries/all/test_package/conanfile.py create mode 100644 recipes/daw_header_libraries/all/test_package/test_package.cpp create mode 100644 recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/daw_header_libraries/all/test_v1_package/conanfile.py create mode 100644 recipes/daw_header_libraries/config.yml create mode 100644 recipes/daw_json_link/all/conandata.yml create mode 100644 recipes/daw_json_link/all/conanfile.py create mode 100644 recipes/daw_json_link/all/test_package/CMakeLists.txt create mode 100644 recipes/daw_json_link/all/test_package/conanfile.py create mode 100644 recipes/daw_json_link/all/test_package/test_package.cpp create mode 100644 recipes/daw_json_link/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/daw_json_link/all/test_v1_package/conanfile.py create mode 100644 recipes/daw_json_link/config.yml create mode 100644 recipes/daw_utf_range/all/conandata.yml create mode 100644 recipes/daw_utf_range/all/conanfile.py create mode 100644 recipes/daw_utf_range/all/test_package/CMakeLists.txt create mode 100644 recipes/daw_utf_range/all/test_package/conanfile.py create mode 100644 recipes/daw_utf_range/all/test_package/test_package.cpp create mode 100644 recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/daw_utf_range/all/test_v1_package/conanfile.py create mode 100644 recipes/daw_utf_range/config.yml create mode 100644 recipes/dbcppp/all/conandata.yml create mode 100644 recipes/dbcppp/all/conanfile.py create mode 100644 recipes/dbcppp/all/patches/0001-dep-cmake-rem-kcd.patch create mode 100644 recipes/dbcppp/all/test_package/CMakeLists.txt create mode 100644 recipes/dbcppp/all/test_package/conanfile.py create mode 100644 recipes/dbcppp/all/test_package/test_package.cpp create mode 100644 recipes/dbcppp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dbcppp/all/test_v1_package/conanfile.py create mode 100644 recipes/dbcppp/config.yml create mode 100644 recipes/dbg-macro/all/conandata.yml create mode 100644 recipes/dbg-macro/all/conanfile.py create mode 100644 recipes/dbg-macro/all/test_package/CMakeLists.txt create mode 100644 recipes/dbg-macro/all/test_package/conanfile.py create mode 100644 recipes/dbg-macro/all/test_package/test_package.cpp create mode 100644 recipes/dbg-macro/config.yml create mode 100644 recipes/dbus/1.x.x/conandata.yml create mode 100644 recipes/dbus/1.x.x/conanfile.py create mode 100644 recipes/dbus/1.x.x/patches/0001-cmake-project.patch create mode 100644 recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch create mode 100644 recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch create mode 100644 recipes/dbus/1.x.x/test_package/CMakeLists.txt create mode 100644 recipes/dbus/1.x.x/test_package/conanfile.py create mode 100644 recipes/dbus/1.x.x/test_package/test_package.c create mode 100644 recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/dbus/1.x.x/test_v1_package/conanfile.py create mode 100644 recipes/dbus/config.yml create mode 100644 recipes/dcmtk/all/CMakeLists.txt create mode 100644 recipes/dcmtk/all/conandata.yml create mode 100644 recipes/dcmtk/all/conanfile.py create mode 100644 recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch create mode 100644 recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch create mode 100644 recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch create mode 100644 recipes/dcmtk/all/test_package/CMakeLists.txt create mode 100644 recipes/dcmtk/all/test_package/conanfile.py create mode 100644 recipes/dcmtk/all/test_package/test_package.cpp create mode 100644 recipes/dcmtk/config.yml create mode 100644 recipes/dd-opentracing-cpp/all/CMakeLists.txt create mode 100644 recipes/dd-opentracing-cpp/all/conandata.yml create mode 100644 recipes/dd-opentracing-cpp/all/conanfile.py create mode 100644 recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch create mode 100644 recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/dd-opentracing-cpp/all/test_package/conanfile.py create mode 100644 recipes/dd-opentracing-cpp/all/test_package/test_package.cpp create mode 100644 recipes/dd-opentracing-cpp/config.yml create mode 100644 recipes/debug_assert/all/conandata.yml create mode 100644 recipes/debug_assert/all/conanfile.py create mode 100644 recipes/debug_assert/all/test_package/CMakeLists.txt create mode 100644 recipes/debug_assert/all/test_package/conanfile.py create mode 100644 recipes/debug_assert/all/test_package/test_package.cpp create mode 100644 recipes/debug_assert/config.yml create mode 100644 recipes/decimal_for_cpp/all/conandata.yml create mode 100644 recipes/decimal_for_cpp/all/conanfile.py create mode 100644 recipes/decimal_for_cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/decimal_for_cpp/all/test_package/conanfile.py create mode 100644 recipes/decimal_for_cpp/all/test_package/test_package.cpp create mode 100644 recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/decimal_for_cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/decimal_for_cpp/config.yml create mode 100644 recipes/deco/all/conandata.yml create mode 100644 recipes/deco/all/conanfile.py create mode 100644 recipes/deco/all/test_package/CMakeLists.txt create mode 100644 recipes/deco/all/test_package/conanfile.py create mode 100644 recipes/deco/all/test_package/example.cpp create mode 100644 recipes/deco/config.yml create mode 100644 recipes/depot_tools/all/conandata.yml create mode 100644 recipes/depot_tools/all/conanfile.py create mode 100644 recipes/depot_tools/all/patches/001-use-system-python.patch create mode 100644 recipes/depot_tools/all/test_package/conanfile.py create mode 100644 recipes/depot_tools/config.yml create mode 100644 recipes/detools/all/CMakeLists.txt create mode 100644 recipes/detools/all/conandata.yml create mode 100644 recipes/detools/all/conanfile.py create mode 100644 recipes/detools/all/test_package/CMakeLists.txt create mode 100644 recipes/detools/all/test_package/conanfile.py create mode 100644 recipes/detools/all/test_package/old create mode 100644 recipes/detools/all/test_package/patch create mode 100644 recipes/detools/all/test_package/test_package.c create mode 100644 recipes/detools/config.yml create mode 100644 recipes/detours/all/CMakeLists.txt create mode 100644 recipes/detours/all/conandata.yml create mode 100644 recipes/detours/all/conanfile.py create mode 100644 recipes/detours/all/test_package/CMakeLists.txt create mode 100644 recipes/detours/all/test_package/conanfile.py create mode 100644 recipes/detours/all/test_package/hook.c create mode 100644 recipes/detours/all/test_package/hook_mingw.def create mode 100644 recipes/detours/all/test_package/hook_msvc.def create mode 100644 recipes/detours/all/test_package/test_package.c create mode 100644 recipes/detours/all/test_package/victim.c create mode 100644 recipes/detours/config.yml create mode 100644 recipes/di/all/BSL-1.0.txt create mode 100644 recipes/di/all/conandata.yml create mode 100644 recipes/di/all/conanfile.py create mode 100644 recipes/di/all/test_package/CMakeLists.txt create mode 100644 recipes/di/all/test_package/conanfile.py create mode 100644 recipes/di/all/test_package/example.cpp create mode 100644 recipes/di/config.yml create mode 100644 recipes/dice-template-library/all/CMakeLists.txt create mode 100644 recipes/dice-template-library/all/conandata.yml create mode 100644 recipes/dice-template-library/all/conanfile.py create mode 100644 recipes/dice-template-library/all/test_package/CMakeLists.txt create mode 100644 recipes/dice-template-library/all/test_package/conanfile.py create mode 100644 recipes/dice-template-library/all/test_package/test_package.cpp create mode 100644 recipes/dice-template-library/config.yml create mode 100644 recipes/diligent-core/all/CMakeLists.txt create mode 100644 recipes/diligent-core/all/conandata.yml create mode 100644 recipes/diligent-core/all/conanfile.py create mode 100644 recipes/diligent-core/all/patches/0001-remove_warning_as_error.patch create mode 100644 recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch create mode 100644 recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch create mode 100644 recipes/diligent-core/all/patches/0005-spirv-cross-namespace-override.patch create mode 100644 recipes/diligent-core/all/patches/0006-install-linux-platform-header.diff create mode 100644 recipes/diligent-core/all/patches/0007-API250014-remove_warning_as_error.patch create mode 100644 recipes/diligent-core/all/patches/0009-API250014-use_conan_dependencies_in_third_party.patch create mode 100644 recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch create mode 100644 recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch create mode 100644 recipes/diligent-core/all/patches/0014-252-exclude-tests.patch create mode 100644 recipes/diligent-core/all/patches/0015-252-dont-install-3d-party-license.patch create mode 100644 recipes/diligent-core/all/patches/0016-252-fix-glslang-usage.patch create mode 100644 recipes/diligent-core/all/patches/0017-252-fix-glslang-include.patch create mode 100644 recipes/diligent-core/all/patches/0018-252-fix-warning-as-error.patch create mode 100644 recipes/diligent-core/all/patches/0023-252003-fix-warning-as-error.patch create mode 100644 recipes/diligent-core/all/test_package/CMakeLists.txt create mode 100644 recipes/diligent-core/all/test_package/conanfile.py create mode 100644 recipes/diligent-core/all/test_package/test_package.cpp create mode 100644 recipes/diligent-core/config.yml create mode 100644 recipes/diligent-fx/all/BuildUtils.cmake create mode 100644 recipes/diligent-fx/all/CMakeLists.txt create mode 100644 recipes/diligent-fx/all/conandata.yml create mode 100644 recipes/diligent-fx/all/conanfile.py create mode 100644 recipes/diligent-fx/all/patches/0001-use-conan-dependencies.diff create mode 100644 recipes/diligent-fx/all/script.py create mode 100644 recipes/diligent-fx/all/test_package/CMakeLists.txt create mode 100644 recipes/diligent-fx/all/test_package/conanfile.py create mode 100644 recipes/diligent-fx/all/test_package/test_package.cpp create mode 100644 recipes/diligent-fx/config.yml create mode 100644 recipes/diligent-tools/all/BuildUtils.cmake create mode 100644 recipes/diligent-tools/all/CMakeLists.txt create mode 100644 recipes/diligent-tools/all/conandata.yml create mode 100644 recipes/diligent-tools/all/conanfile.py create mode 100644 recipes/diligent-tools/all/patches/0001-use-imgui-from-conan.diff create mode 100644 recipes/diligent-tools/all/patches/0002-use-conan-dependencies.diff create mode 100644 recipes/diligent-tools/all/patches/0003-fix-diligent-core-include-paths.diff create mode 100644 recipes/diligent-tools/all/patches/0005-fix-include-path.diff create mode 100644 recipes/diligent-tools/all/patches/0006-2.5.2-use-imgui-from-conan.diff create mode 100644 recipes/diligent-tools/all/patches/0007-2.5.2-use-diligent-core-dependencies.diff create mode 100644 recipes/diligent-tools/all/patches/0008-2.5.2-use-conan-dependencies.diff create mode 100644 recipes/diligent-tools/all/patches/0009-2.5.2-fix-include-path.diff create mode 100644 recipes/diligent-tools/all/patches/0010-2.5.2-fix-render-state-notation-paths.diff create mode 100644 recipes/diligent-tools/all/patches/0011-2.5.2-use-conan-dependencies-part2.diff create mode 100644 recipes/diligent-tools/all/patches/0012-2.5.2-fix-imgui-include-path.diff create mode 100644 recipes/diligent-tools/all/test_package/CMakeLists.txt create mode 100644 recipes/diligent-tools/all/test_package/conanfile.py create mode 100644 recipes/diligent-tools/all/test_package/test_package.cpp create mode 100644 recipes/diligent-tools/config.yml create mode 100644 recipes/diligentgraphics-spirv-headers/all/CMakeLists.txt create mode 100644 recipes/diligentgraphics-spirv-headers/all/conandata.yml create mode 100644 recipes/diligentgraphics-spirv-headers/all/conanfile.py create mode 100644 recipes/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/diligentgraphics-spirv-headers/all/test_package/conanfile.py create mode 100644 recipes/diligentgraphics-spirv-headers/all/test_package/test_package.cpp create mode 100644 recipes/diligentgraphics-spirv-headers/config.yml create mode 100644 recipes/diligentgraphics-spirv-tools/all/CMakeLists.txt create mode 100644 recipes/diligentgraphics-spirv-tools/all/conandata.yml create mode 100644 recipes/diligentgraphics-spirv-tools/all/conanfile.py create mode 100644 recipes/diligentgraphics-spirv-tools/all/patches/support-SPV_KHR_fragment_shading_rate.patch create mode 100644 recipes/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt create mode 100644 recipes/diligentgraphics-spirv-tools/all/test_package/conanfile.py create mode 100644 recipes/diligentgraphics-spirv-tools/all/test_package/test_package.c create mode 100644 recipes/diligentgraphics-spirv-tools/all/test_package/test_package.cpp create mode 100644 recipes/diligentgraphics-spirv-tools/config.yml create mode 100644 recipes/diligentgraphics-vulkan-headers/all/conandata.yml create mode 100644 recipes/diligentgraphics-vulkan-headers/all/conanfile.py create mode 100644 recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/diligentgraphics-vulkan-headers/all/test_package/conanfile.py create mode 100644 recipes/diligentgraphics-vulkan-headers/all/test_package/test_package.c create mode 100644 recipes/diligentgraphics-vulkan-headers/config.yml create mode 100644 recipes/dime/all/CMakeLists.txt create mode 100644 recipes/dime/all/conandata.yml create mode 100644 recipes/dime/all/conanfile.py create mode 100644 recipes/dime/all/test_package/CMakeLists.txt create mode 100644 recipes/dime/all/test_package/conanfile.py create mode 100644 recipes/dime/all/test_package/testFile_Bug01.dxf create mode 100644 recipes/dime/all/test_package/test_package.cpp create mode 100644 recipes/dime/config.yml create mode 100644 recipes/directshowbaseclasses/all/CMakeLists.txt create mode 100644 recipes/directshowbaseclasses/all/conandata.yml create mode 100644 recipes/directshowbaseclasses/all/conanfile.py create mode 100644 recipes/directshowbaseclasses/all/test_package/CMakeLists.txt create mode 100644 recipes/directshowbaseclasses/all/test_package/conanfile.py create mode 100644 recipes/directshowbaseclasses/all/test_package/test_package.cpp create mode 100644 recipes/directshowbaseclasses/config.yml create mode 100644 recipes/dirent/all/conandata.yml create mode 100644 recipes/dirent/all/conanfile.py create mode 100644 recipes/dirent/all/test_package/CMakeLists.txt create mode 100644 recipes/dirent/all/test_package/conanfile.py create mode 100644 recipes/dirent/all/test_package/test_package.cpp create mode 100644 recipes/dirent/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dirent/all/test_v1_package/conanfile.py create mode 100644 recipes/dirent/config.yml create mode 100644 recipes/discount/all/conandata.yml create mode 100644 recipes/discount/all/conanfile.py create mode 100644 recipes/discount/all/patches/0001-fix-cmake-install.patch create mode 100644 recipes/discount/all/patches/0002-fix-incomplete-type.patch create mode 100644 recipes/discount/all/test_package/CMakeLists.txt create mode 100644 recipes/discount/all/test_package/conanfile.py create mode 100644 recipes/discount/all/test_package/test_package.c create mode 100644 recipes/discount/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/discount/all/test_v1_package/conanfile.py create mode 100644 recipes/discount/config.yml create mode 100644 recipes/djinni-generator/all/conandata.yml create mode 100644 recipes/djinni-generator/all/conanfile.py create mode 100644 recipes/djinni-generator/all/test_package/conanfile.py create mode 100644 recipes/djinni-generator/config.yml create mode 100644 recipes/djinni-support-lib/1.x.x/CMakeLists.txt create mode 100644 recipes/djinni-support-lib/1.x.x/conandata.yml create mode 100644 recipes/djinni-support-lib/1.x.x/conanfile.py create mode 100644 recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt create mode 100644 recipes/djinni-support-lib/1.x.x/test_package/conanfile.py create mode 100644 recipes/djinni-support-lib/1.x.x/test_package/test_package.cpp create mode 100644 recipes/djinni-support-lib/all/CMakeLists.txt create mode 100644 recipes/djinni-support-lib/all/conandata.yml create mode 100644 recipes/djinni-support-lib/all/conanfile.py create mode 100644 recipes/djinni-support-lib/all/patches/cmake_install.patch create mode 100644 recipes/djinni-support-lib/all/test_package/CMakeLists.txt create mode 100644 recipes/djinni-support-lib/all/test_package/conanfile.py create mode 100644 recipes/djinni-support-lib/all/test_package/test_package.cpp create mode 100644 recipes/djinni-support-lib/config.yml create mode 100644 recipes/dlib/all/CMakeLists.txt create mode 100644 recipes/dlib/all/conandata.yml create mode 100644 recipes/dlib/all/conanfile.py create mode 100644 recipes/dlib/all/test_package/CMakeLists.txt create mode 100644 recipes/dlib/all/test_package/conanfile.py create mode 100644 recipes/dlib/all/test_package/test_package.cpp create mode 100644 recipes/dlib/config.yml create mode 100644 recipes/dlpack/all/conandata.yml create mode 100644 recipes/dlpack/all/conanfile.py create mode 100644 recipes/dlpack/all/test_package/CMakeLists.txt create mode 100644 recipes/dlpack/all/test_package/conanfile.py create mode 100644 recipes/dlpack/all/test_package/test_package.cpp create mode 100644 recipes/dlpack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dlpack/all/test_v1_package/conanfile.py create mode 100644 recipes/dlpack/config.yml create mode 100644 recipes/docopt.cpp/all/conandata.yml create mode 100644 recipes/docopt.cpp/all/conanfile.py create mode 100644 recipes/docopt.cpp/all/patches/cmake-library-0.6.2.patch create mode 100644 recipes/docopt.cpp/all/patches/cmake-library-0.6.3.patch create mode 100644 recipes/docopt.cpp/all/patches/include-stdexcept.patch create mode 100644 recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.2.patch create mode 100644 recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.3.patch create mode 100644 recipes/docopt.cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/docopt.cpp/all/test_package/conanfile.py create mode 100644 recipes/docopt.cpp/all/test_package/test_package.cpp create mode 100644 recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/docopt.cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/docopt.cpp/config.yml create mode 100644 recipes/doctest/2.x.x/conandata.yml create mode 100644 recipes/doctest/2.x.x/conanfile.py create mode 100644 recipes/doctest/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/doctest/2.x.x/test_package/conanfile.py create mode 100644 recipes/doctest/2.x.x/test_package/test_package.cpp create mode 100644 recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/doctest/2.x.x/test_v1_package/conanfile.py create mode 100644 recipes/doctest/config.yml create mode 100644 recipes/double-conversion/all/conandata.yml create mode 100644 recipes/double-conversion/all/conanfile.py create mode 100644 recipes/double-conversion/all/test_package/CMakeLists.txt create mode 100644 recipes/double-conversion/all/test_package/conanfile.py create mode 100644 recipes/double-conversion/all/test_package/test_package.cpp create mode 100644 recipes/double-conversion/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/double-conversion/all/test_v1_package/conanfile.py create mode 100644 recipes/double-conversion/config.yml create mode 100644 recipes/doxygen/all/conandata.yml create mode 100644 recipes/doxygen/all/conanfile.py create mode 100644 recipes/doxygen/all/patches/1.8-0001-xapian.patch create mode 100644 recipes/doxygen/all/patches/1.9.1-0001-imported-target.patch create mode 100644 recipes/doxygen/all/patches/1.9.2-0001-imported-target.patch create mode 100644 recipes/doxygen/all/patches/1.9.4-0001-enable-modern-compilers.patch create mode 100644 recipes/doxygen/all/test_package/CMakeLists.txt create mode 100644 recipes/doxygen/all/test_package/conanfile.py create mode 100644 recipes/doxygen/all/test_package/test_package.cpp create mode 100644 recipes/doxygen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/doxygen/all/test_v1_package/conanfile.py create mode 100644 recipes/doxygen/config.yml create mode 100644 recipes/draco/all/conandata.yml create mode 100644 recipes/draco/all/conanfile.py create mode 100644 recipes/draco/all/patches/0001-fix-cmake-1.3.5.patch create mode 100644 recipes/draco/all/patches/0001-fix-cmake-1.3.6.patch create mode 100644 recipes/draco/all/patches/0001-fix-cmake-1.4.3.patch create mode 100644 recipes/draco/all/patches/0001-fix-cmake-1.5.2.patch create mode 100644 recipes/draco/all/patches/0002-v1.3.5-gcc-11.patch create mode 100644 recipes/draco/all/patches/0002-v1.3.6-gcc-11.patch create mode 100644 recipes/draco/all/patches/0003-non-copy-ellision-workaround.patch create mode 100644 recipes/draco/all/test_package/CMakeLists.txt create mode 100644 recipes/draco/all/test_package/conanfile.py create mode 100644 recipes/draco/all/test_package/test_package.cpp create mode 100644 recipes/draco/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/draco/all/test_v1_package/conanfile.py create mode 100644 recipes/draco/config.yml create mode 100644 recipes/dragonbox/all/conandata.yml create mode 100644 recipes/dragonbox/all/conanfile.py create mode 100644 recipes/dragonbox/all/patches/1.1.3-fix-include-directory.patch create mode 100644 recipes/dragonbox/all/test_package/CMakeLists.txt create mode 100644 recipes/dragonbox/all/test_package/conanfile.py create mode 100644 recipes/dragonbox/all/test_package/test_package.cpp create mode 100644 recipes/dragonbox/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dragonbox/all/test_v1_package/conanfile.py create mode 100644 recipes/dragonbox/config.yml create mode 100644 recipes/drflac/all/CMakeLists.txt create mode 100644 recipes/drflac/all/conandata.yml create mode 100644 recipes/drflac/all/conanfile.py create mode 100644 recipes/drflac/all/dr_flac.c create mode 100644 recipes/drflac/all/test_package/CMakeLists.txt create mode 100644 recipes/drflac/all/test_package/conanfile.py create mode 100644 recipes/drflac/all/test_package/test_package.c create mode 100644 recipes/drflac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drflac/all/test_v1_package/conanfile.py create mode 100644 recipes/drflac/config.yml create mode 100644 recipes/drmp3/all/CMakeLists.txt create mode 100644 recipes/drmp3/all/conandata.yml create mode 100644 recipes/drmp3/all/conanfile.py create mode 100644 recipes/drmp3/all/dr_mp3.c create mode 100644 recipes/drmp3/all/test_package/CMakeLists.txt create mode 100644 recipes/drmp3/all/test_package/conanfile.py create mode 100644 recipes/drmp3/all/test_package/test_package.c create mode 100644 recipes/drmp3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drmp3/all/test_v1_package/conanfile.py create mode 100644 recipes/drmp3/config.yml create mode 100644 recipes/drogon/all/conandata.yml create mode 100644 recipes/drogon/all/conanfile.py create mode 100644 recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch create mode 100644 recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch create mode 100644 recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch create mode 100644 recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch create mode 100644 recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch create mode 100644 recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch create mode 100644 recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch create mode 100644 recipes/drogon/all/patches/1.8.2-0003-find-package-sqlite.patch create mode 100644 recipes/drogon/all/patches/1.8.3-0003-find-package-sqlite.patch create mode 100644 recipes/drogon/all/test_package/CMakeLists.txt create mode 100644 recipes/drogon/all/test_package/conanfile.py create mode 100644 recipes/drogon/all/test_package/test_package.cpp create mode 100644 recipes/drogon/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drogon/all/test_v1_package/conanfile.py create mode 100644 recipes/drogon/config.yml create mode 100644 recipes/drwav/all/CMakeLists.txt create mode 100644 recipes/drwav/all/conandata.yml create mode 100644 recipes/drwav/all/conanfile.py create mode 100644 recipes/drwav/all/dr_wav.c create mode 100644 recipes/drwav/all/test_package/CMakeLists.txt create mode 100644 recipes/drwav/all/test_package/conanfile.py create mode 100644 recipes/drwav/all/test_package/test_package.c create mode 100644 recipes/drwav/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drwav/all/test_v1_package/conanfile.py create mode 100644 recipes/drwav/config.yml create mode 100644 recipes/dtl/all/conandata.yml create mode 100644 recipes/dtl/all/conanfile.py create mode 100644 recipes/dtl/all/test_package/CMakeLists.txt create mode 100644 recipes/dtl/all/test_package/conanfile.py create mode 100644 recipes/dtl/all/test_package/test_package.cpp create mode 100644 recipes/dtl/config.yml create mode 100644 recipes/duckdb/all/conandata.yml create mode 100644 recipes/duckdb/all/conanfile.py create mode 100644 recipes/duckdb/all/patches/0.5.1-0001-fix-cmake.patch create mode 100644 recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch create mode 100644 recipes/duckdb/all/patches/0.6.0-0002-include-stdlib.patch create mode 100644 recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch create mode 100644 recipes/duckdb/all/test_package/CMakeLists.txt create mode 100644 recipes/duckdb/all/test_package/conanfile.py create mode 100644 recipes/duckdb/all/test_package/test_package.cpp create mode 100644 recipes/duckdb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/duckdb/all/test_v1_package/conanfile.py create mode 100644 recipes/duckdb/config.yml create mode 100644 recipes/duktape/all/CMakeLists.txt create mode 100644 recipes/duktape/all/conandata.yml create mode 100644 recipes/duktape/all/conanfile.py create mode 100644 recipes/duktape/all/test_package/CMakeLists.txt create mode 100644 recipes/duktape/all/test_package/conanfile.py create mode 100644 recipes/duktape/all/test_package/test_package.c create mode 100644 recipes/duktape/config.yml create mode 100644 recipes/eabase/all/conandata.yml create mode 100644 recipes/eabase/all/conanfile.py create mode 100644 recipes/eabase/all/test_package/CMakeLists.txt create mode 100644 recipes/eabase/all/test_package/conanfile.py create mode 100644 recipes/eabase/all/test_package/test_package.cpp create mode 100644 recipes/eabase/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/eabase/all/test_v1_package/conanfile.py create mode 100644 recipes/eabase/config.yml create mode 100644 recipes/earcut/all/conandata.yml create mode 100644 recipes/earcut/all/conanfile.py create mode 100644 recipes/earcut/all/test_package/CMakeLists.txt create mode 100644 recipes/earcut/all/test_package/conanfile.py create mode 100644 recipes/earcut/all/test_package/example.cpp create mode 100644 recipes/earcut/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/earcut/all/test_v1_package/conanfile.py create mode 100644 recipes/earcut/config.yml create mode 100644 recipes/eastl/all/CMakeLists.txt create mode 100644 recipes/eastl/all/conandata.yml create mode 100644 recipes/eastl/all/conanfile.py create mode 100644 recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch create mode 100644 recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch create mode 100644 recipes/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch create mode 100644 recipes/eastl/all/test_package/CMakeLists.txt create mode 100644 recipes/eastl/all/test_package/conanfile.py create mode 100644 recipes/eastl/all/test_package/test_package.cpp create mode 100644 recipes/eastl/config.yml create mode 100644 recipes/easy_profiler/all/conandata.yml create mode 100644 recipes/easy_profiler/all/conanfile.py create mode 100644 recipes/easy_profiler/all/patches/0001-fix-cmake-bundle-install.patch create mode 100644 recipes/easy_profiler/all/test_package/CMakeLists.txt create mode 100644 recipes/easy_profiler/all/test_package/conanfile.py create mode 100644 recipes/easy_profiler/all/test_package/example.cpp create mode 100644 recipes/easy_profiler/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/easy_profiler/all/test_v1_package/conanfile.py create mode 100644 recipes/easy_profiler/config.yml create mode 100644 recipes/easyexif/all/CMakeLists.txt create mode 100644 recipes/easyexif/all/conandata.yml create mode 100644 recipes/easyexif/all/conanfile.py create mode 100644 recipes/easyexif/all/test_package/CMakeLists.txt create mode 100644 recipes/easyexif/all/test_package/conanfile.py create mode 100644 recipes/easyexif/all/test_package/example.cpp create mode 100644 recipes/easyexif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/easyexif/all/test_v1_package/conanfile.py create mode 100644 recipes/easyexif/config.yml create mode 100644 recipes/easyhttpcpp/all/conandata.yml create mode 100644 recipes/easyhttpcpp/all/conanfile.py create mode 100644 recipes/easyhttpcpp/all/patches/0001-fix-cmake-config-in-path.patch create mode 100644 recipes/easyhttpcpp/all/patches/0002-use-poco-targets.patch create mode 100644 recipes/easyhttpcpp/all/test_package/CMakeLists.txt create mode 100644 recipes/easyhttpcpp/all/test_package/conanfile.py create mode 100644 recipes/easyhttpcpp/all/test_package/test_package.cpp create mode 100644 recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/easyhttpcpp/all/test_v1_package/conanfile.py create mode 100644 recipes/easyhttpcpp/config.yml create mode 100644 recipes/easyloggingpp/all/CMakeLists.txt create mode 100644 recipes/easyloggingpp/all/conandata.yml create mode 100644 recipes/easyloggingpp/all/conanfile.py create mode 100644 recipes/easyloggingpp/all/test_package/CMakeLists.txt create mode 100644 recipes/easyloggingpp/all/test_package/conanfile.py create mode 100644 recipes/easyloggingpp/all/test_package/test_package.cpp create mode 100644 recipes/easyloggingpp/config.yml create mode 100644 recipes/easylzma/all/CMakeLists.txt create mode 100644 recipes/easylzma/all/conandata.yml create mode 100644 recipes/easylzma/all/conanfile.py create mode 100644 recipes/easylzma/all/patches/cmake-no-cflags.patch create mode 100644 recipes/easylzma/all/patches/memleaksfix.patch create mode 100644 recipes/easylzma/all/test_package/CMakeLists.txt create mode 100644 recipes/easylzma/all/test_package/conanfile.py create mode 100644 recipes/easylzma/all/test_package/test_package.c create mode 100644 recipes/easylzma/config.yml create mode 100644 recipes/ecos/all/conandata.yml create mode 100644 recipes/ecos/all/conanfile.py create mode 100644 recipes/ecos/all/patches/0001-fix-cmake.patch create mode 100644 recipes/ecos/all/patches/0002-missing-include.patch create mode 100644 recipes/ecos/all/test_package/CMakeLists.txt create mode 100644 recipes/ecos/all/test_package/conanfile.py create mode 100644 recipes/ecos/all/test_package/test_package.c create mode 100644 recipes/ecos/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ecos/all/test_v1_package/conanfile.py create mode 100644 recipes/ecos/config.yml create mode 100644 recipes/editline/all/conandata.yml create mode 100644 recipes/editline/all/conanfile.py create mode 100644 recipes/editline/all/test_package/CMakeLists.txt create mode 100644 recipes/editline/all/test_package/conanfile.py create mode 100644 recipes/editline/all/test_package/test_package.c create mode 100644 recipes/editline/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/editline/all/test_v1_package/conanfile.py create mode 100644 recipes/editline/config.yml create mode 100644 recipes/edlib/all/conandata.yml create mode 100644 recipes/edlib/all/conanfile.py create mode 100644 recipes/edlib/all/patches/cmake-install-and-export-symbols.patch create mode 100644 recipes/edlib/all/test_package/CMakeLists.txt create mode 100644 recipes/edlib/all/test_package/conanfile.py create mode 100644 recipes/edlib/all/test_package/test_package.c create mode 100644 recipes/edlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/edlib/all/test_v1_package/conanfile.py create mode 100644 recipes/edlib/config.yml create mode 100644 recipes/edyn/all/conandata.yml create mode 100644 recipes/edyn/all/conanfile.py create mode 100644 recipes/edyn/all/test_package/CMakeLists.txt create mode 100644 recipes/edyn/all/test_package/conanfile.py create mode 100644 recipes/edyn/all/test_package/test_package.cpp create mode 100644 recipes/edyn/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/edyn/all/test_v1_package/conanfile.py create mode 100644 recipes/edyn/config.yml create mode 100644 recipes/effcee/all/conandata.yml create mode 100644 recipes/effcee/all/conanfile.py create mode 100644 recipes/effcee/all/patches/0001-fix-cmake.patch create mode 100644 recipes/effcee/all/test_package/CMakeLists.txt create mode 100644 recipes/effcee/all/test_package/conanfile.py create mode 100644 recipes/effcee/all/test_package/test_package.cpp create mode 100644 recipes/effcee/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/effcee/all/test_v1_package/conanfile.py create mode 100644 recipes/effcee/config.yml create mode 100644 recipes/effolkronium-random/all/conandata.yml create mode 100644 recipes/effolkronium-random/all/conanfile.py create mode 100644 recipes/effolkronium-random/all/test_package/CMakeLists.txt create mode 100644 recipes/effolkronium-random/all/test_package/conanfile.py create mode 100644 recipes/effolkronium-random/all/test_package/test_package.cpp create mode 100644 recipes/effolkronium-random/config.yml create mode 100644 recipes/egl-headers/all/conandata.yml create mode 100644 recipes/egl-headers/all/conanfile.py create mode 100644 recipes/egl-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/egl-headers/all/test_package/conanfile.py create mode 100644 recipes/egl-headers/all/test_package/test_package.c create mode 100644 recipes/egl-headers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/egl-headers/all/test_v1_package/conanfile.py create mode 100644 recipes/egl-headers/config.yml create mode 100644 recipes/egl/config.yml create mode 100644 recipes/egl/system/conanfile.py create mode 100644 recipes/egl/system/test_package/CMakeLists.txt create mode 100644 recipes/egl/system/test_package/conanfile.py create mode 100644 recipes/egl/system/test_package/test_package.c create mode 100644 recipes/egl/system/test_v1_package/CMakeLists.txt create mode 100644 recipes/egl/system/test_v1_package/conanfile.py create mode 100644 recipes/eigen/all/conandata.yml create mode 100644 recipes/eigen/all/conanfile.py create mode 100644 recipes/eigen/all/patches/0001-assert-exception-upstream-issue-2011.patch create mode 100644 recipes/eigen/all/patches/0002-cmake-minimum-required.patch create mode 100644 recipes/eigen/all/patches/3.4.0-0001-vec-reduce-half.patch create mode 100644 recipes/eigen/all/test_package/CMakeLists.txt create mode 100644 recipes/eigen/all/test_package/conanfile.py create mode 100644 recipes/eigen/all/test_package/test_package.cpp create mode 100644 recipes/eigen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/eigen/all/test_v1_package/conanfile.py create mode 100644 recipes/eigen/config.yml create mode 100644 recipes/elfio/all/conandata.yml create mode 100644 recipes/elfio/all/conanfile.py create mode 100755 recipes/elfio/all/test_package/CMakeLists.txt create mode 100755 recipes/elfio/all/test_package/conanfile.py create mode 100755 recipes/elfio/all/test_package/test_package.cpp create mode 100755 recipes/elfio/all/test_v1_package/CMakeLists.txt create mode 100755 recipes/elfio/all/test_v1_package/conanfile.py create mode 100644 recipes/elfio/config.yml create mode 100644 recipes/elfutils/all/conandata.yml create mode 100644 recipes/elfutils/all/conanfile.py create mode 100644 recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch create mode 100644 recipes/elfutils/all/patches/0.180-0002-add-enable-static-option-to-configure.patch create mode 100644 recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch create mode 100644 recipes/elfutils/all/patches/0.186-0002-add-enable-static-option-to-configure.patch create mode 100644 recipes/elfutils/all/test_package/CMakeLists.txt create mode 100644 recipes/elfutils/all/test_package/conanfile.py create mode 100644 recipes/elfutils/all/test_package/test_package.c create mode 100644 recipes/elfutils/config.yml create mode 100644 recipes/embree3/all/conandata.yml create mode 100644 recipes/embree3/all/conanfile.py create mode 100644 recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch create mode 100644 recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch create mode 100644 recipes/embree3/all/test_package/CMakeLists.txt create mode 100644 recipes/embree3/all/test_package/conanfile.py create mode 100644 recipes/embree3/all/test_package/test_package.cpp create mode 100644 recipes/embree3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/embree3/all/test_v1_package/conanfile.py create mode 100644 recipes/embree3/config.yml create mode 100644 recipes/emsdk/all/conandata.yml create mode 100644 recipes/emsdk/all/conanfile.py create mode 100644 recipes/emsdk/all/test_package/CMakeLists.txt create mode 100644 recipes/emsdk/all/test_package/conanfile.py create mode 100644 recipes/emsdk/all/test_package/test_package.cpp create mode 100644 recipes/emsdk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/emsdk/all/test_v1_package/conanfile.py create mode 100644 recipes/emsdk/config.yml create mode 100644 recipes/enchant/all/CMakeLists.txt create mode 100644 recipes/enchant/all/conandata.yml create mode 100644 recipes/enchant/all/conanfile.py create mode 100644 recipes/enchant/all/configmake.h create mode 100644 recipes/enchant/all/configure.cmake create mode 100644 recipes/enchant/all/patches/0001-add-visibility-annotations.patch create mode 100644 recipes/enchant/all/patches/0002-remove-strchrnul-usage.patch create mode 100644 recipes/enchant/all/patches/0003-fix-file-locking.patch create mode 100644 recipes/enchant/all/patches/0004-fix-ssize_t-in-headers.patch create mode 100644 recipes/enchant/all/patches/0005-fix-relocatable.patch create mode 100644 recipes/enchant/all/patches/0006-add-macos-support.patch create mode 100644 recipes/enchant/all/test_package/CMakeLists.txt create mode 100644 recipes/enchant/all/test_package/conanfile.py create mode 100644 recipes/enchant/all/test_package/test_package.c create mode 100644 recipes/enchant/config.yml create mode 100644 recipes/enet/all/conandata.yml create mode 100644 recipes/enet/all/conanfile.py create mode 100644 recipes/enet/all/patches/fix-cmake.patch create mode 100644 recipes/enet/all/test_package/CMakeLists.txt create mode 100644 recipes/enet/all/test_package/conanfile.py create mode 100644 recipes/enet/all/test_package/test_package.c create mode 100644 recipes/enet/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/enet/all/test_v1_package/conanfile.py create mode 100644 recipes/enet/config.yml create mode 100644 recipes/enhex-generic_serialization/all/conandata.yml create mode 100644 recipes/enhex-generic_serialization/all/conanfile.py create mode 100644 recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt create mode 100644 recipes/enhex-generic_serialization/all/test_package/conanfile.py create mode 100644 recipes/enhex-generic_serialization/all/test_package/example.cpp create mode 100644 recipes/enhex-generic_serialization/config.yml create mode 100644 recipes/enhex-strong_type/all/conandata.yml create mode 100644 recipes/enhex-strong_type/all/conanfile.py create mode 100644 recipes/enhex-strong_type/all/test_package/CMakeLists.txt create mode 100644 recipes/enhex-strong_type/all/test_package/conanfile.py create mode 100644 recipes/enhex-strong_type/all/test_package/example.cpp create mode 100644 recipes/enhex-strong_type/config.yml create mode 100644 recipes/enjincppsdk/all/CMakeLists.txt create mode 100644 recipes/enjincppsdk/all/conandata.yml create mode 100644 recipes/enjincppsdk/all/conanfile.py create mode 100644 recipes/enjincppsdk/all/test_package/CMakeLists.txt create mode 100644 recipes/enjincppsdk/all/test_package/conanfile.py create mode 100644 recipes/enjincppsdk/all/test_package/test_package.cpp create mode 100644 recipes/enjincppsdk/config.yml create mode 100644 recipes/enkits/all/CMakeLists.txt create mode 100644 recipes/enkits/all/conandata.yml create mode 100644 recipes/enkits/all/conanfile.py create mode 100644 recipes/enkits/all/patches/cmake-install-lib-location.patch create mode 100644 recipes/enkits/all/test_package/CMakeLists.txt create mode 100644 recipes/enkits/all/test_package/conanfile.py create mode 100644 recipes/enkits/all/test_package/test_package.cpp create mode 100644 recipes/enkits/config.yml create mode 100644 recipes/entityx/all/conandata.yml create mode 100644 recipes/entityx/all/conanfile.py create mode 100644 recipes/entityx/all/patches/0001-cmake-not-force-libcpp.patch create mode 100644 recipes/entityx/all/test_package/CMakeLists.txt create mode 100644 recipes/entityx/all/test_package/conanfile.py create mode 100644 recipes/entityx/all/test_package/test_package.cpp create mode 100644 recipes/entityx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/entityx/all/test_v1_package/conanfile.py create mode 100644 recipes/entityx/config.yml create mode 100644 recipes/entt/3.x.x/conandata.yml create mode 100644 recipes/entt/3.x.x/conanfile.py create mode 100644 recipes/entt/3.x.x/patches/0001-3.11.0-fix-gcc-7.0-7.3.patch create mode 100644 recipes/entt/3.x.x/test_package/CMakeLists.txt create mode 100644 recipes/entt/3.x.x/test_package/conanfile.py create mode 100644 recipes/entt/3.x.x/test_package/test_package.cpp create mode 100644 recipes/entt/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/entt/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/entt/config.yml create mode 100644 recipes/enum-flags/all/conandata.yml create mode 100644 recipes/enum-flags/all/conanfile.py create mode 100644 recipes/enum-flags/all/test_package/CMakeLists.txt create mode 100644 recipes/enum-flags/all/test_package/conanfile.py create mode 100644 recipes/enum-flags/all/test_package/test_package.cpp create mode 100644 recipes/enum-flags/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/enum-flags/all/test_v1_package/conanfile.py create mode 100644 recipes/enum-flags/config.yml create mode 100644 recipes/erikzenker-hsm/all/conandata.yml create mode 100644 recipes/erikzenker-hsm/all/conanfile.py create mode 100644 recipes/erikzenker-hsm/all/test_package/CMakeLists.txt create mode 100644 recipes/erikzenker-hsm/all/test_package/conanfile.py create mode 100644 recipes/erikzenker-hsm/all/test_package/test_package.cpp create mode 100644 recipes/erikzenker-hsm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/erikzenker-hsm/all/test_v1_package/conanfile.py create mode 100644 recipes/erikzenker-hsm/config.yml create mode 100644 recipes/erkir/all/conandata.yml create mode 100644 recipes/erkir/all/conanfile.py create mode 100644 recipes/erkir/all/patches/1.0.0-0001-remove-testing.patch create mode 100644 recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch create mode 100644 recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch create mode 100644 recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch create mode 100644 recipes/erkir/all/patches/2.0.0-0003-fix-erkir_export.patch create mode 100644 recipes/erkir/all/test_package/CMakeLists.txt create mode 100644 recipes/erkir/all/test_package/conanfile.py create mode 100644 recipes/erkir/all/test_package/test_package.cpp create mode 100644 recipes/erkir/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/erkir/all/test_v1_package/conanfile.py create mode 100644 recipes/erkir/config.yml create mode 100644 recipes/etc2comp/all/CMakeLists.txt create mode 100644 recipes/etc2comp/all/conandata.yml create mode 100644 recipes/etc2comp/all/conanfile.py create mode 100644 recipes/etc2comp/all/patches/fix-cmake.patch create mode 100644 recipes/etc2comp/all/test_package/CMakeLists.txt create mode 100644 recipes/etc2comp/all/test_package/conanfile.py create mode 100644 recipes/etc2comp/all/test_package/test_package.cpp create mode 100644 recipes/etc2comp/config.yml create mode 100644 recipes/eternal/all/conandata.yml create mode 100644 recipes/eternal/all/conanfile.py create mode 100644 recipes/eternal/all/test_package/CMakeLists.txt create mode 100644 recipes/eternal/all/test_package/conanfile.py create mode 100644 recipes/eternal/all/test_package/test_package.cpp create mode 100644 recipes/eternal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/eternal/all/test_v1_package/conanfile.py create mode 100644 recipes/eternal/config.yml create mode 100644 recipes/etl/all/conandata.yml create mode 100644 recipes/etl/all/conanfile.py create mode 100644 recipes/etl/all/test_package/CMakeLists.txt create mode 100644 recipes/etl/all/test_package/conanfile.py create mode 100644 recipes/etl/all/test_package/test_package.cpp create mode 100644 recipes/etl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/etl/all/test_v1_package/conanfile.py create mode 100644 recipes/etl/config.yml create mode 100644 recipes/exiv2/all/conandata.yml create mode 100644 recipes/exiv2/all/conanfile.py create mode 100644 recipes/exiv2/all/patches/0001-link-0.27.5.patch create mode 100644 recipes/exiv2/all/patches/0001-link.patch create mode 100644 recipes/exiv2/all/patches/0002-fpic.patch create mode 100644 recipes/exiv2/all/patches/0003-fix-ios.patch create mode 100644 recipes/exiv2/all/patches/0004-find-expat.patch create mode 100644 recipes/exiv2/all/test_package/CMakeLists.txt create mode 100644 recipes/exiv2/all/test_package/conanfile.py create mode 100644 recipes/exiv2/all/test_package/test_package.cpp create mode 100644 recipes/exiv2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/exiv2/all/test_v1_package/conanfile.py create mode 100644 recipes/exiv2/config.yml create mode 100644 recipes/expat/all/conandata.yml create mode 100644 recipes/expat/all/conanfile.py create mode 100644 recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch create mode 100644 recipes/expat/all/test_package/CMakeLists.txt create mode 100644 recipes/expat/all/test_package/conanfile.py create mode 100644 recipes/expat/all/test_package/test_package.c create mode 100644 recipes/expat/all/test_package_module/CMakeLists.txt create mode 100644 recipes/expat/all/test_package_module/conanfile.py create mode 100644 recipes/expat/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/expat/all/test_v1_package/conanfile.py create mode 100644 recipes/expat/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/expat/all/test_v1_package_module/conanfile.py create mode 100644 recipes/expat/config.yml create mode 100644 recipes/expected-lite/all/conandata.yml create mode 100644 recipes/expected-lite/all/conanfile.py create mode 100644 recipes/expected-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/expected-lite/all/test_package/conanfile.py create mode 100644 recipes/expected-lite/all/test_package/test_package.cpp create mode 100644 recipes/expected-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/expected-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/expected-lite/config.yml create mode 100755 recipes/exprtk/all/conandata.yml create mode 100755 recipes/exprtk/all/conanfile.py create mode 100755 recipes/exprtk/all/test_package/CMakeLists.txt create mode 100755 recipes/exprtk/all/test_package/conanfile.py create mode 100755 recipes/exprtk/all/test_package/test_package.cpp create mode 100644 recipes/exprtk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/exprtk/all/test_v1_package/conanfile.py create mode 100755 recipes/exprtk/config.yml create mode 100644 recipes/extra-cmake-modules/all/conandata.yml create mode 100644 recipes/extra-cmake-modules/all/conanfile.py create mode 100644 recipes/extra-cmake-modules/all/test_package/CMakeLists.txt create mode 100644 recipes/extra-cmake-modules/all/test_package/conanfile.py create mode 100644 recipes/extra-cmake-modules/all/test_package/example.cpp create mode 100644 recipes/extra-cmake-modules/all/test_package/foo.h create mode 100644 recipes/extra-cmake-modules/config.yml create mode 100644 recipes/ezc3d/all/conandata.yml create mode 100644 recipes/ezc3d/all/conanfile.py create mode 100644 recipes/ezc3d/all/patches/0001-fix-cmake-1.3.8.patch create mode 100644 recipes/ezc3d/all/patches/0001-fix-cmake-1.4.8.patch create mode 100644 recipes/ezc3d/all/test_package/CMakeLists.txt create mode 100644 recipes/ezc3d/all/test_package/conanfile.py create mode 100644 recipes/ezc3d/all/test_package/test_package.cpp create mode 100644 recipes/ezc3d/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ezc3d/all/test_v1_package/conanfile.py create mode 100644 recipes/ezc3d/config.yml create mode 100644 recipes/faac/all/conandata.yml create mode 100644 recipes/faac/all/conanfile.py create mode 100644 recipes/faac/all/patches/1.30-0001-fix-out-of-root-build.patch create mode 100644 recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch create mode 100644 recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch create mode 100644 recipes/faac/all/test_package/CMakeLists.txt create mode 100644 recipes/faac/all/test_package/conanfile.py create mode 100644 recipes/faac/all/test_package/test_package.c create mode 100644 recipes/faac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/faac/all/test_v1_package/conanfile.py create mode 100644 recipes/faac/config.yml create mode 100644 recipes/fakeit/all/conandata.yml create mode 100644 recipes/fakeit/all/conanfile.py create mode 100644 recipes/fakeit/all/test_package/CMakeLists.txt create mode 100644 recipes/fakeit/all/test_package/conanfile.py create mode 100644 recipes/fakeit/all/test_package/test_package.cpp create mode 100644 recipes/fakeit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fakeit/all/test_v1_package/conanfile.py create mode 100644 recipes/fakeit/config.yml create mode 100644 recipes/farmhash/all/CMakeLists.txt create mode 100644 recipes/farmhash/all/conandata.yml create mode 100644 recipes/farmhash/all/conanfile.py create mode 100644 recipes/farmhash/all/test_package/CMakeLists.txt create mode 100644 recipes/farmhash/all/test_package/conanfile.py create mode 100644 recipes/farmhash/all/test_package/test_package.cpp create mode 100644 recipes/farmhash/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/farmhash/all/test_v1_package/conanfile.py create mode 100644 recipes/farmhash/config.yml create mode 100644 recipes/fast-cdr/all/conandata.yml create mode 100644 recipes/fast-cdr/all/conanfile.py create mode 100644 recipes/fast-cdr/all/test_package/CMakeLists.txt create mode 100644 recipes/fast-cdr/all/test_package/conanfile.py create mode 100644 recipes/fast-cdr/all/test_package/test_package.cpp create mode 100644 recipes/fast-cdr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fast-cdr/all/test_v1_package/conanfile.py create mode 100644 recipes/fast-cdr/config.yml create mode 100644 recipes/fast-cpp-csv-parser/all/conandata.yml create mode 100644 recipes/fast-cpp-csv-parser/all/conanfile.py create mode 100644 recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt create mode 100644 recipes/fast-cpp-csv-parser/all/test_package/conanfile.py create mode 100644 recipes/fast-cpp-csv-parser/all/test_package/test_package.cpp create mode 100644 recipes/fast-cpp-csv-parser/all/test_package/test_package.csv create mode 100644 recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fast-cpp-csv-parser/all/test_v1_package/conanfile.py create mode 100644 recipes/fast-cpp-csv-parser/config.yml create mode 100644 recipes/fast-dds/all/conandata.yml create mode 100644 recipes/fast-dds/all/conanfile.py create mode 100644 recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch create mode 100644 recipes/fast-dds/all/patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch create mode 100644 recipes/fast-dds/all/test_package/CMakeLists.txt create mode 100644 recipes/fast-dds/all/test_package/conanfile.py create mode 100644 recipes/fast-dds/all/test_package/msg/HelloWorld.cxx create mode 100644 recipes/fast-dds/all/test_package/msg/HelloWorld.h create mode 100644 recipes/fast-dds/all/test_package/msg/HelloWorld.idl create mode 100644 recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.cxx create mode 100644 recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.h create mode 100644 recipes/fast-dds/all/test_package/test_package.cpp create mode 100644 recipes/fast-dds/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fast-dds/all/test_v1_package/conanfile.py create mode 100644 recipes/fast-dds/config.yml create mode 100644 recipes/fast_double_parser/all/conandata.yml create mode 100644 recipes/fast_double_parser/all/conanfile.py create mode 100644 recipes/fast_double_parser/all/test_package/CMakeLists.txt create mode 100644 recipes/fast_double_parser/all/test_package/conanfile.py create mode 100644 recipes/fast_double_parser/all/test_package/test_package.cpp create mode 100644 recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fast_double_parser/all/test_v1_package/conanfile.py create mode 100644 recipes/fast_double_parser/config.yml create mode 100644 recipes/fast_float/all/conandata.yml create mode 100644 recipes/fast_float/all/conanfile.py create mode 100644 recipes/fast_float/all/test_package/CMakeLists.txt create mode 100644 recipes/fast_float/all/test_package/conanfile.py create mode 100644 recipes/fast_float/all/test_package/test_package.cpp create mode 100644 recipes/fast_float/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fast_float/all/test_v1_package/conanfile.py create mode 100644 recipes/fast_float/config.yml create mode 100644 recipes/fastpfor/all/conandata.yml create mode 100644 recipes/fastpfor/all/conanfile.py create mode 100644 recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch create mode 100644 recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch create mode 100644 recipes/fastpfor/all/test_package/CMakeLists.txt create mode 100644 recipes/fastpfor/all/test_package/conanfile.py create mode 100644 recipes/fastpfor/all/test_package/test_package.cpp create mode 100644 recipes/fastpfor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fastpfor/all/test_v1_package/conanfile.py create mode 100644 recipes/fastpfor/config.yml create mode 100644 recipes/fastprng/all/conandata.yml create mode 100644 recipes/fastprng/all/conanfile.py create mode 100644 recipes/fastprng/all/test_package/CMakeLists.txt create mode 100644 recipes/fastprng/all/test_package/conanfile.py create mode 100644 recipes/fastprng/all/test_package/test_package.cpp create mode 100644 recipes/fastprng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fastprng/all/test_v1_package/conanfile.py create mode 100644 recipes/fastprng/config.yml create mode 100644 recipes/fcl/all/conandata.yml create mode 100644 recipes/fcl/all/conanfile.py create mode 100644 recipes/fcl/all/patches/0001-fix-cmake-0.6.1.patch create mode 100644 recipes/fcl/all/patches/0001-fix-cmake-0.7.0.patch create mode 100644 recipes/fcl/all/patches/0002-fix-mingw-bigobj.patch create mode 100644 recipes/fcl/all/patches/0003-fix-alias-type-msvc2015.patch create mode 100644 recipes/fcl/all/test_package/CMakeLists.txt create mode 100644 recipes/fcl/all/test_package/conanfile.py create mode 100644 recipes/fcl/all/test_package/test_package.cpp create mode 100644 recipes/fcl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fcl/all/test_v1_package/conanfile.py create mode 100644 recipes/fcl/config.yml create mode 100644 recipes/fernandovelcic-hexdump/all/conandata.yml create mode 100644 recipes/fernandovelcic-hexdump/all/conanfile.py create mode 100644 recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt create mode 100644 recipes/fernandovelcic-hexdump/all/test_package/conanfile.py create mode 100644 recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp create mode 100644 recipes/fernandovelcic-hexdump/config.yml create mode 100644 recipes/fff/all/conandata.yml create mode 100644 recipes/fff/all/conanfile.py create mode 100644 recipes/fff/all/test_package/CMakeLists.txt create mode 100644 recipes/fff/all/test_package/conanfile.py create mode 100644 recipes/fff/all/test_package/test_package.cpp create mode 100644 recipes/fff/config.yml create mode 100644 recipes/ffmpeg/all/conandata.yml create mode 100644 recipes/ffmpeg/all/conanfile.py create mode 100644 recipes/ffmpeg/all/patches/5.0-0001-fix-hwcontext_vulkan.patch create mode 100644 recipes/ffmpeg/all/test_package/CMakeLists.txt create mode 100644 recipes/ffmpeg/all/test_package/conanfile.py create mode 100644 recipes/ffmpeg/all/test_package/test_package.c create mode 100644 recipes/ffmpeg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ffmpeg/all/test_v1_package/conanfile.py create mode 100644 recipes/ffmpeg/config.yml create mode 100644 recipes/fft/all/CMakeLists.txt create mode 100644 recipes/fft/all/conandata.yml create mode 100644 recipes/fft/all/conanfile.py create mode 100644 recipes/fft/all/dct.h create mode 100644 recipes/fft/all/fft.h create mode 100644 recipes/fft/all/fft2.h create mode 100644 recipes/fft/all/fft3.h create mode 100644 recipes/fft/all/fft_build.c create mode 100644 recipes/fft/all/test_package/CMakeLists.txt create mode 100644 recipes/fft/all/test_package/conanfile.py create mode 100644 recipes/fft/all/test_package/test_package.c create mode 100644 recipes/fft/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fft/all/test_v1_package/conanfile.py create mode 100644 recipes/fft/config.yml create mode 100644 recipes/fftw/all/conandata.yml create mode 100644 recipes/fftw/all/conanfile.py create mode 100644 recipes/fftw/all/patches/fix-simd.patch create mode 100644 recipes/fftw/all/test_package/CMakeLists.txt create mode 100644 recipes/fftw/all/test_package/conanfile.py create mode 100644 recipes/fftw/all/test_package/test_package.c create mode 100644 recipes/fftw/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fftw/all/test_v1_package/conanfile.py create mode 100644 recipes/fftw/config.yml create mode 100644 recipes/fire-hpp/all/conandata.yml create mode 100644 recipes/fire-hpp/all/conanfile.py create mode 100644 recipes/fire-hpp/all/test_package/CMakeLists.txt create mode 100644 recipes/fire-hpp/all/test_package/conanfile.py create mode 100644 recipes/fire-hpp/all/test_package/test_package.cpp create mode 100644 recipes/fire-hpp/config.yml create mode 100644 recipes/flac/all/conandata.yml create mode 100644 recipes/flac/all/conanfile.py create mode 100644 recipes/flac/all/patches/fix-cmake-1.3.3.patch create mode 100644 recipes/flac/all/patches/fix-cmake-1.4.2.patch create mode 100644 recipes/flac/all/test_package/CMakeLists.txt create mode 100644 recipes/flac/all/test_package/conanfile.py create mode 100644 recipes/flac/all/test_package/test_package.cpp create mode 100644 recipes/flac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/flac/all/test_v1_package/conanfile.py create mode 100644 recipes/flac/config.yml create mode 100644 recipes/flann/all/conandata.yml create mode 100644 recipes/flann/all/conanfile.py create mode 100644 recipes/flann/all/patches/1.9.1-0001-external-lz4-and-export-symbols.patch create mode 100644 recipes/flann/all/patches/1.9.1-0002-support-cpp17.patch create mode 100644 recipes/flann/all/patches/1.9.2-0001-cxx-11-required.patch create mode 100644 recipes/flann/all/patches/1.9.2-0002-cmake-lz4.patch create mode 100644 recipes/flann/all/test_package/CMakeLists.txt create mode 100644 recipes/flann/all/test_package/conanfile.py create mode 100644 recipes/flann/all/test_package/test_package.c create mode 100644 recipes/flann/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/flann/all/test_v1_package/conanfile.py create mode 100644 recipes/flann/config.yml create mode 100644 recipes/flatbuffers/all/cmake/FlatcTargets.cmake create mode 100644 recipes/flatbuffers/all/conandata.yml create mode 100644 recipes/flatbuffers/all/conanfile.py create mode 100644 recipes/flatbuffers/all/patches/0002-apple-no-universal-build.patch create mode 100644 recipes/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch create mode 100644 recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch create mode 100644 recipes/flatbuffers/all/test_package/CMakeLists.txt create mode 100644 recipes/flatbuffers/all/test_package/conanfile.py create mode 100644 recipes/flatbuffers/all/test_package/monster.fbs create mode 100644 recipes/flatbuffers/all/test_package/sample_binary.cpp create mode 100644 recipes/flatbuffers/all/test_package/test_package.cpp create mode 100644 recipes/flatbuffers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/flatbuffers/all/test_v1_package/conanfile.py create mode 100644 recipes/flatbuffers/config.yml create mode 100644 recipes/flatbush/all/conandata.yml create mode 100644 recipes/flatbush/all/conanfile.py create mode 100644 recipes/flatbush/all/test_package/CMakeLists.txt create mode 100644 recipes/flatbush/all/test_package/conanfile.py create mode 100644 recipes/flatbush/all/test_package/test_package.cpp create mode 100644 recipes/flatbush/config.yml create mode 100644 recipes/flatc/all/CMakeLists.txt create mode 100644 recipes/flatc/all/conandata.yml create mode 100644 recipes/flatc/all/conanfile.py create mode 100644 recipes/flatc/all/patches/0001-buildflatbuffers-cmake.patch create mode 100644 recipes/flatc/all/test_package/CMakeLists.txt create mode 100644 recipes/flatc/all/test_package/conanfile.py create mode 100644 recipes/flatc/all/test_package/test_package.cpp create mode 100644 recipes/flatc/all/test_package/test_package.fbs create mode 100644 recipes/flatc/config.yml create mode 100644 recipes/flatcc/all/CMakeLists.txt create mode 100644 recipes/flatcc/all/conandata.yml create mode 100644 recipes/flatcc/all/conanfile.py create mode 100644 recipes/flatcc/all/test_package/CMakeLists.txt create mode 100644 recipes/flatcc/all/test_package/conanfile.py create mode 100644 recipes/flatcc/all/test_package/monster.c create mode 100644 recipes/flatcc/all/test_package/monster.fbs create mode 100644 recipes/flatcc/config.yml create mode 100644 recipes/flecs/all/conandata.yml create mode 100644 recipes/flecs/all/conanfile.py create mode 100644 recipes/flecs/all/test_package/CMakeLists.txt create mode 100644 recipes/flecs/all/test_package/conanfile.py create mode 100644 recipes/flecs/all/test_package/test_package.c create mode 100644 recipes/flecs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/flecs/all/test_v1_package/conanfile.py create mode 100644 recipes/flecs/config.yml create mode 100644 recipes/flex/all/conandata.yml create mode 100644 recipes/flex/all/conanfile.py create mode 100644 recipes/flex/all/patches/darwin-newer-versions.patch create mode 100644 recipes/flex/all/test_package/CMakeLists.txt create mode 100644 recipes/flex/all/test_package/basic_nr.l create mode 100644 recipes/flex/all/test_package/basic_nr.txt create mode 100644 recipes/flex/all/test_package/conanfile.py create mode 100644 recipes/flex/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/flex/all/test_v1_package/basic_nr.l create mode 100644 recipes/flex/all/test_v1_package/basic_nr.txt create mode 100644 recipes/flex/all/test_v1_package/conanfile.py create mode 100644 recipes/flex/config.yml create mode 100644 recipes/flint/all/CMakeLists.txt create mode 100644 recipes/flint/all/conandata.yml create mode 100644 recipes/flint/all/conanfile.py create mode 100644 recipes/flint/all/patches/0001-cmake-2.8.1.patch create mode 100644 recipes/flint/all/patches/0001-cmake.patch create mode 100644 recipes/flint/all/patches/0002-msvc-alloca.patch create mode 100644 recipes/flint/all/test_package/CMakeLists.txt create mode 100644 recipes/flint/all/test_package/conanfile.py create mode 100644 recipes/flint/all/test_package/test_package.cpp create mode 100644 recipes/flint/config.yml create mode 100644 recipes/fltk/all/CMakeLists.txt create mode 100644 recipes/fltk/all/conandata.yml create mode 100644 recipes/fltk/all/conanfile.py create mode 100644 recipes/fltk/all/patches/1.3.8-0001-remove-fluid.patch create mode 100644 recipes/fltk/all/patches/1.3.8-0002-fix-resources.patch create mode 100644 recipes/fltk/all/patches/1.3.8-0003-build-static-only-on-static.patch create mode 100644 recipes/fltk/all/test_package/CMakeLists.txt create mode 100644 recipes/fltk/all/test_package/conanfile.py create mode 100644 recipes/fltk/all/test_package/test_package.cpp create mode 100644 recipes/fltk/config.yml create mode 100644 recipes/fmt/all/conandata.yml create mode 100644 recipes/fmt/all/conanfile.py create mode 100644 recipes/fmt/all/patches/fix-install-5.3.0.patch create mode 100644 recipes/fmt/all/patches/fix-install-6.0.0.patch create mode 100644 recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch create mode 100644 recipes/fmt/all/test_package/CMakeLists.txt create mode 100644 recipes/fmt/all/test_package/conanfile.py create mode 100644 recipes/fmt/all/test_package/test_package.cpp create mode 100644 recipes/fmt/all/test_package/test_ranges.cpp create mode 100644 recipes/fmt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fmt/all/test_v1_package/conanfile.py create mode 100644 recipes/fmt/config.yml create mode 100644 recipes/fmtlog/all/conandata.yml create mode 100644 recipes/fmtlog/all/conanfile.py create mode 100644 recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch create mode 100644 recipes/fmtlog/all/test_package/CMakeLists.txt create mode 100644 recipes/fmtlog/all/test_package/conanfile.py create mode 100644 recipes/fmtlog/all/test_package/test_package.cpp create mode 100644 recipes/fmtlog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fmtlog/all/test_v1_package/conanfile.py create mode 100644 recipes/fmtlog/config.yml create mode 100644 recipes/folly/all/CMakeLists.txt create mode 100644 recipes/folly/all/conandata.yml create mode 100755 recipes/folly/all/conanfile.py create mode 100644 recipes/folly/all/patches/0001-find-packages.patch create mode 100644 recipes/folly/all/patches/0002-compiler-flags.patch create mode 100644 recipes/folly/all/patches/0003-boost-shared-ptr.patch create mode 100644 recipes/folly/all/patches/0004-disable-posix-names.patch create mode 100644 recipes/folly/all/patches/0005-include-atomic.patch create mode 100644 recipes/folly/all/patches/0006-duplicate-hash.patch create mode 100644 recipes/folly/all/patches/0007-allow-builtins.patch create mode 100644 recipes/folly/all/patches/0008-find-packages.patch create mode 100644 recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch create mode 100644 recipes/folly/all/patches/0010-duplicate-hash.patch create mode 100644 recipes/folly/all/patches/0011-disable-logger-example.patch create mode 100644 recipes/folly/all/patches/0012-compiler-flags.patch create mode 100644 recipes/folly/all/patches/0013-include-bit.patch create mode 100644 recipes/folly/all/patches/0014-find-librt.patch create mode 100644 recipes/folly/all/patches/0015-benchmark-format-macros.patch create mode 100644 recipes/folly/all/patches/0016-find-packages.patch create mode 100644 recipes/folly/all/patches/0017-compiler-flags.patch create mode 100644 recipes/folly/all/patches/0018-find-glog.patch create mode 100644 recipes/folly/all/patches/0019-exclude-example.patch create mode 100644 recipes/folly/all/patches/0020-include-ssizet.patch create mode 100644 recipes/folly/all/patches/0021-typedef-clockid.patch create mode 100644 recipes/folly/all/patches/0022-fix-windows-minmax.patch create mode 100644 recipes/folly/all/test_package/CMakeLists.txt create mode 100644 recipes/folly/all/test_package/conanfile.py create mode 100644 recipes/folly/all/test_package/test_package.cpp create mode 100644 recipes/folly/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/folly/all/test_v1_package/conanfile.py create mode 100644 recipes/folly/all/test_v1_package/test_package.cpp create mode 100644 recipes/folly/config.yml create mode 100644 recipes/fontconfig/all/conandata.yml create mode 100644 recipes/fontconfig/all/conanfile.py create mode 100644 recipes/fontconfig/all/test_package/CMakeLists.txt create mode 100644 recipes/fontconfig/all/test_package/conanfile.py create mode 100644 recipes/fontconfig/all/test_package/test_package.c create mode 100644 recipes/fontconfig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fontconfig/all/test_v1_package/conanfile.py create mode 100644 recipes/fontconfig/config.yml create mode 100644 recipes/fontconfig/meson/conandata.yml create mode 100644 recipes/fontconfig/meson/conanfile.py create mode 100644 recipes/fontconfig/meson/patches/0001-meson-win32.patch create mode 100644 recipes/fontconfig/meson/test_package/CMakeLists.txt create mode 100644 recipes/fontconfig/meson/test_package/conanfile.py create mode 100644 recipes/fontconfig/meson/test_package/test_package.c create mode 100644 recipes/fontconfig/meson/test_v1_package/CMakeLists.txt create mode 100644 recipes/fontconfig/meson/test_v1_package/conanfile.py create mode 100644 recipes/foonathan-lexy/all/conandata.yml create mode 100644 recipes/foonathan-lexy/all/conanfile.py create mode 100644 recipes/foonathan-lexy/all/test_package/CMakeLists.txt create mode 100644 recipes/foonathan-lexy/all/test_package/conanfile.py create mode 100644 recipes/foonathan-lexy/all/test_package/test_package.cpp create mode 100644 recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/foonathan-lexy/all/test_v1_package/conanfile.py create mode 100644 recipes/foonathan-lexy/config.yml create mode 100644 recipes/foonathan-memory/all/conandata.yml create mode 100644 recipes/foonathan-memory/all/conanfile.py create mode 100755 recipes/foonathan-memory/all/patches/0.7.0-0001-fix-virtualAllocFromApp.patch create mode 100644 recipes/foonathan-memory/all/test_package/CMakeLists.txt create mode 100644 recipes/foonathan-memory/all/test_package/conanfile.py create mode 100644 recipes/foonathan-memory/all/test_package/test_package.cpp create mode 100644 recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/foonathan-memory/all/test_v1_package/conanfile.py create mode 100644 recipes/foonathan-memory/config.yml create mode 100644 recipes/forestdb/all/CMakeLists.txt create mode 100644 recipes/forestdb/all/conandata.yml create mode 100644 recipes/forestdb/all/conanfile.py create mode 100644 recipes/forestdb/all/patches/0001-proper-cxx-std-flag.patch create mode 100644 recipes/forestdb/all/test_package/CMakeLists.txt create mode 100644 recipes/forestdb/all/test_package/conanfile.py create mode 100644 recipes/forestdb/all/test_package/test_package.cpp create mode 100644 recipes/forestdb/config.yml create mode 100644 recipes/foxglove-websocket/all/conandata.yml create mode 100644 recipes/foxglove-websocket/all/conanfile.py create mode 100644 recipes/foxglove-websocket/all/test_package/CMakeLists.txt create mode 100644 recipes/foxglove-websocket/all/test_package/conanfile.py create mode 100644 recipes/foxglove-websocket/all/test_package/test_package.cpp create mode 100644 recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/foxglove-websocket/all/test_v1_package/conanfile.py create mode 100644 recipes/foxglove-websocket/config.yml create mode 100644 recipes/foxi/all/conandata.yml create mode 100644 recipes/foxi/all/conanfile.py create mode 100644 recipes/foxi/all/patches/fix-conflicting-types.patch create mode 100644 recipes/foxi/all/test_package/CMakeLists.txt create mode 100644 recipes/foxi/all/test_package/conanfile.py create mode 100644 recipes/foxi/all/test_package/test_package.c create mode 100644 recipes/foxi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/foxi/all/test_v1_package/conanfile.py create mode 100644 recipes/foxi/config.yml create mode 100644 recipes/fp16/all/conandata.yml create mode 100644 recipes/fp16/all/conanfile.py create mode 100644 recipes/fp16/all/test_package/CMakeLists.txt create mode 100644 recipes/fp16/all/test_package/conanfile.py create mode 100644 recipes/fp16/all/test_package/test_package.c create mode 100644 recipes/fp16/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fp16/all/test_v1_package/conanfile.py create mode 100644 recipes/fp16/config.yml create mode 100644 recipes/fpgen/all/conandata.yml create mode 100644 recipes/fpgen/all/conanfile.py create mode 100644 recipes/fpgen/all/test_package/CMakeLists.txt create mode 100644 recipes/fpgen/all/test_package/conanfile.py create mode 100644 recipes/fpgen/all/test_package/main.cpp create mode 100644 recipes/fpgen/config.yml create mode 100644 recipes/freeglut/all/conandata.yml create mode 100644 recipes/freeglut/all/conanfile.py create mode 100644 recipes/freeglut/all/test_package/CMakeLists.txt create mode 100644 recipes/freeglut/all/test_package/conanfile.py create mode 100644 recipes/freeglut/all/test_package/test_package.c create mode 100644 recipes/freeglut/all/test_package_module/CMakeLists.txt create mode 100644 recipes/freeglut/all/test_package_module/conanfile.py create mode 100644 recipes/freeglut/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/freeglut/all/test_v1_package/conanfile.py create mode 100644 recipes/freeglut/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/freeglut/all/test_v1_package_module/conanfile.py create mode 100644 recipes/freeglut/config.yml create mode 100644 recipes/freeimage/all/CMakeLists.txt create mode 100644 recipes/freeimage/all/conandata.yml create mode 100644 recipes/freeimage/all/conanfile.py create mode 100644 recipes/freeimage/all/patches/001_disable-plugins-depending-on-internal-third-party-libraries.patch create mode 100644 recipes/freeimage/all/patches/002_fix-function-overload.patch create mode 100644 recipes/freeimage/all/patches/003_use-external-jpeg.patch create mode 100644 recipes/freeimage/all/patches/004_use-external-jxrlib.patch create mode 100644 recipes/freeimage/all/patches/005_use-external-libtiff.patch create mode 100644 recipes/freeimage/all/patches/006_use-external-openexr.patch create mode 100644 recipes/freeimage/all/patches/007_use-external-openjpeg.patch create mode 100644 recipes/freeimage/all/patches/008_use-external-png-zlib.patch create mode 100644 recipes/freeimage/all/patches/009_use-external-rawlib.patch create mode 100644 recipes/freeimage/all/patches/010_use-external-webp.patch create mode 100644 recipes/freeimage/all/patches/011_update-libraw-support.patch create mode 100644 recipes/freeimage/all/patches/012_use-functions-to-override-libtiff-warning-error-handlers.patch create mode 100644 recipes/freeimage/all/patches/013_use-typedef-as-already-declared.patch create mode 100644 recipes/freeimage/all/patches/014_no_auto_ptr.patch create mode 100644 recipes/freeimage/all/test_package/CMakeLists.txt create mode 100644 recipes/freeimage/all/test_package/conanfile.py create mode 100644 recipes/freeimage/all/test_package/test.png create mode 100644 recipes/freeimage/all/test_package/test_package.cpp create mode 100644 recipes/freeimage/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/freeimage/all/test_v1_package/conanfile.py create mode 100644 recipes/freeimage/config.yml create mode 100644 recipes/freetype/all/conandata.yml create mode 100644 recipes/freetype/all/conanfile.py create mode 100644 recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch create mode 100644 recipes/freetype/all/test_package/CMakeLists.txt create mode 100644 recipes/freetype/all/test_package/OpenSans-Bold.ttf create mode 100644 recipes/freetype/all/test_package/conanfile.py create mode 100644 recipes/freetype/all/test_package/test_package.c create mode 100644 recipes/freetype/all/test_package_module/CMakeLists.txt create mode 100644 recipes/freetype/all/test_package_module/conanfile.py create mode 100644 recipes/freetype/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/freetype/all/test_v1_package/conanfile.py create mode 100644 recipes/freetype/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/freetype/all/test_v1_package_module/conanfile.py create mode 100644 recipes/freetype/config.yml create mode 100644 recipes/freexl/all/conandata.yml create mode 100644 recipes/freexl/all/conanfile.py create mode 100644 recipes/freexl/all/patches/fix-nmake-1.0.5.patch create mode 100644 recipes/freexl/all/patches/fix-nmake-1.0.6.patch create mode 100644 recipes/freexl/all/patches/msvc-round-lround.patch create mode 100644 recipes/freexl/all/test_package/CMakeLists.txt create mode 100644 recipes/freexl/all/test_package/conanfile.py create mode 100644 recipes/freexl/all/test_package/simple2003_21.xls create mode 100644 recipes/freexl/all/test_package/test_package.c create mode 100644 recipes/freexl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/freexl/all/test_v1_package/conanfile.py create mode 100644 recipes/freexl/config.yml create mode 100644 recipes/fribidi/all/conandata.yml create mode 100644 recipes/fribidi/all/conanfile.py create mode 100644 recipes/fribidi/all/patches/1.0.9-0001-meson-no-tests-bin.patch create mode 100644 recipes/fribidi/all/test_package/CMakeLists.txt create mode 100644 recipes/fribidi/all/test_package/conanfile.py create mode 100644 recipes/fribidi/all/test_package/test_package.c create mode 100644 recipes/fribidi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fribidi/all/test_v1_package/conanfile.py create mode 100644 recipes/fribidi/config.yml create mode 100644 recipes/frozen/all/conandata.yml create mode 100644 recipes/frozen/all/conanfile.py create mode 100644 recipes/frozen/all/test_package/CMakeLists.txt create mode 100644 recipes/frozen/all/test_package/conanfile.py create mode 100644 recipes/frozen/all/test_package/test_package.cpp create mode 100644 recipes/frozen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/frozen/all/test_v1_package/conanfile.py create mode 100644 recipes/frozen/config.yml create mode 100644 recipes/frugally-deep/all/conandata.yml create mode 100644 recipes/frugally-deep/all/conanfile.py create mode 100644 recipes/frugally-deep/all/test_package/CMakeLists.txt create mode 100644 recipes/frugally-deep/all/test_package/conanfile.py create mode 100644 recipes/frugally-deep/all/test_package/test_package.cpp create mode 100644 recipes/frugally-deep/config.yml create mode 100644 recipes/fruit/all/conandata.yml create mode 100644 recipes/fruit/all/conanfile.py create mode 100644 recipes/fruit/all/patches/0001-fruit-3.4.0-cmake.patch create mode 100644 recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.5.0.patch create mode 100644 recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.6.0.patch create mode 100644 recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.0.patch create mode 100644 recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.1.patch create mode 100644 recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator-3.7.patch create mode 100644 recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator.patch create mode 100644 recipes/fruit/all/patches/0004-3.4.0-set-options-for-cmake-target.patch create mode 100644 recipes/fruit/all/patches/0004-set-options-for-cmake-target.patch create mode 100644 recipes/fruit/all/test_package/CMakeLists.txt create mode 100644 recipes/fruit/all/test_package/conanfile.py create mode 100644 recipes/fruit/all/test_package/test_package.cpp create mode 100644 recipes/fruit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fruit/all/test_v1_package/conanfile.py create mode 100644 recipes/fruit/config.yml create mode 100644 recipes/ftjam/all/conandata.yml create mode 100644 recipes/ftjam/all/conanfile.py create mode 100644 recipes/ftjam/all/patches/0001-jam-2.5-overflow.patch create mode 100644 recipes/ftjam/all/patches/0002-msvc-mingw-fix-makefile.patch create mode 100644 recipes/ftjam/all/patches/0003-missing-includes.patch create mode 100644 recipes/ftjam/all/test_package/Jamfile create mode 100644 recipes/ftjam/all/test_package/conanfile.py create mode 100644 recipes/ftjam/all/test_package/header.h create mode 100644 recipes/ftjam/all/test_package/main.c create mode 100644 recipes/ftjam/all/test_package/source.c create mode 100644 recipes/ftjam/config.yml create mode 100644 recipes/ftxui/all/conandata.yml create mode 100644 recipes/ftxui/all/conanfile.py create mode 100644 recipes/ftxui/all/patches/2.0.0-0001-lib-prefix.patch create mode 100644 recipes/ftxui/all/patches/2.0.0-0002-install-dll.patch create mode 100644 recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch create mode 100644 recipes/ftxui/all/test_package/CMakeLists.txt create mode 100644 recipes/ftxui/all/test_package/conanfile.py create mode 100644 recipes/ftxui/all/test_package/test_package.cpp create mode 100644 recipes/ftxui/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ftxui/all/test_v1_package/conanfile.py create mode 100644 recipes/ftxui/config.yml create mode 100644 recipes/function2/all/conandata.yml create mode 100644 recipes/function2/all/conanfile.py create mode 100644 recipes/function2/all/test_package/CMakeLists.txt create mode 100644 recipes/function2/all/test_package/conanfile.py create mode 100644 recipes/function2/all/test_package/test_package.cpp create mode 100644 recipes/function2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/function2/all/test_v1_package/conanfile.py create mode 100644 recipes/function2/config.yml create mode 100644 recipes/functionalplus/all/conandata.yml create mode 100644 recipes/functionalplus/all/conanfile.py create mode 100644 recipes/functionalplus/all/test_package/CMakeLists.txt create mode 100644 recipes/functionalplus/all/test_package/conanfile.py create mode 100644 recipes/functionalplus/all/test_package/test_package.cpp create mode 100644 recipes/functionalplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/functionalplus/all/test_v1_package/conanfile.py create mode 100644 recipes/functionalplus/config.yml create mode 100644 recipes/functions-framework-cpp/all/CMakeLists.txt create mode 100644 recipes/functions-framework-cpp/all/conandata.yml create mode 100644 recipes/functions-framework-cpp/all/conanfile.py create mode 100644 recipes/functions-framework-cpp/all/patches/0001-dont-skip-namelink.patch create mode 100644 recipes/functions-framework-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/functions-framework-cpp/all/test_package/conanfile.py create mode 100644 recipes/functions-framework-cpp/all/test_package/test_package.cpp create mode 100644 recipes/functions-framework-cpp/config.yml create mode 100644 recipes/fusepp/all/CMakeLists.txt create mode 100644 recipes/fusepp/all/conandata.yml create mode 100644 recipes/fusepp/all/conanfile.py create mode 100644 recipes/fusepp/all/test_package/CMakeLists.txt create mode 100644 recipes/fusepp/all/test_package/conanfile.py create mode 100644 recipes/fusepp/all/test_package/example.cpp create mode 100644 recipes/fusepp/config.yml create mode 100644 recipes/fxdiv/all/conandata.yml create mode 100644 recipes/fxdiv/all/conanfile.py create mode 100644 recipes/fxdiv/all/test_package/CMakeLists.txt create mode 100644 recipes/fxdiv/all/test_package/conanfile.py create mode 100644 recipes/fxdiv/all/test_package/test_package.c create mode 100644 recipes/fxdiv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fxdiv/all/test_v1_package/conanfile.py create mode 100644 recipes/fxdiv/config.yml create mode 100644 recipes/g3log/all/conandata.yml create mode 100644 recipes/g3log/all/conanfile.py create mode 100644 recipes/g3log/all/patches/1.3.2-0001-remove-explicit-stdlib-setting.patch create mode 100644 recipes/g3log/all/test_package/CMakeLists.txt create mode 100644 recipes/g3log/all/test_package/conanfile.py create mode 100644 recipes/g3log/all/test_package/test_package.cpp create mode 100644 recipes/g3log/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/g3log/all/test_v1_package/conanfile.py create mode 100644 recipes/g3log/config.yml create mode 100644 recipes/gainput/all/conandata.yml create mode 100644 recipes/gainput/all/conanfile.py create mode 100644 recipes/gainput/all/patches/0001-fix-cmake.patch create mode 100644 recipes/gainput/all/test_package/CMakeLists.txt create mode 100644 recipes/gainput/all/test_package/conanfile.py create mode 100644 recipes/gainput/all/test_package/test_package.cpp create mode 100644 recipes/gainput/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gainput/all/test_v1_package/conanfile.py create mode 100644 recipes/gainput/config.yml create mode 100644 recipes/gamenetworkingsockets/all/CMakeLists.txt create mode 100644 recipes/gamenetworkingsockets/all/conandata.yml create mode 100644 recipes/gamenetworkingsockets/all/conanfile.py create mode 100644 recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch create mode 100644 recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch create mode 100644 recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt create mode 100644 recipes/gamenetworkingsockets/all/test_package/conanfile.py create mode 100644 recipes/gamenetworkingsockets/all/test_package/test_package.cpp create mode 100644 recipes/gamenetworkingsockets/config.yml create mode 100644 recipes/gamma/all/CMakeLists.txt create mode 100644 recipes/gamma/all/conandata.yml create mode 100644 recipes/gamma/all/conanfile.py create mode 100644 recipes/gamma/all/test_package/CMakeLists.txt create mode 100644 recipes/gamma/all/test_package/conanfile.py create mode 100644 recipes/gamma/all/test_package/test_package.cpp create mode 100644 recipes/gamma/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gamma/all/test_v1_package/conanfile.py create mode 100644 recipes/gamma/config.yml create mode 100644 recipes/gcc/all/conandata.yml create mode 100644 recipes/gcc/all/conanfile.py create mode 100644 recipes/gcc/all/test_package/conanfile.py create mode 100644 recipes/gcc/all/test_package/hello.c create mode 100644 recipes/gcc/all/test_package/hello.cpp create mode 100644 recipes/gcc/all/test_package/hello.f90 create mode 100644 recipes/gcc/all/test_v1_package/conanfile.py create mode 100644 recipes/gcc/all/test_v1_package/hello.c create mode 100644 recipes/gcc/all/test_v1_package/hello.cpp create mode 100644 recipes/gcc/config.yml create mode 100644 recipes/gcem/all/conandata.yml create mode 100644 recipes/gcem/all/conanfile.py create mode 100644 recipes/gcem/all/test_package/CMakeLists.txt create mode 100644 recipes/gcem/all/test_package/conanfile.py create mode 100644 recipes/gcem/all/test_package/test_package.cpp create mode 100644 recipes/gcem/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gcem/all/test_v1_package/conanfile.py create mode 100644 recipes/gcem/config.yml create mode 100644 recipes/gdal/config.yml create mode 100644 recipes/gdal/post_3.5.0/CMakeLists.txt create mode 100644 recipes/gdal/post_3.5.0/conandata.yml create mode 100644 recipes/gdal/post_3.5.0/conanfile.py create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch create mode 100644 recipes/gdal/post_3.5.0/test_package/CMakeLists.txt create mode 100644 recipes/gdal/post_3.5.0/test_package/conanfile.py create mode 100644 recipes/gdal/post_3.5.0/test_package/test_package.c create mode 100644 recipes/gdal/post_3.5.0/test_package/test_package.cpp create mode 100644 recipes/gdal/pre_3.5.0/conandata.yml create mode 100644 recipes/gdal/pre_3.5.0/conanfile.py create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-import-dll-msvc.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-podofo.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-xerces-3.1.2.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-common.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-opt-3.1.2.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.2.x/fix-autotools.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-jsonc.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-podofo.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-xerces.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.2.x/fix-nmake.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-jsonc.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-podofo.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-xerces.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.3.x/fix-nmake.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-autotools-3.4.1.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-autotools-3.4.3.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.1.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.3.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-podofo.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-xerces.patch create mode 100644 recipes/gdal/pre_3.5.0/patches/3.4.x/fix-nmake.patch create mode 100644 recipes/gdal/pre_3.5.0/test_package/CMakeLists.txt create mode 100644 recipes/gdal/pre_3.5.0/test_package/conanfile.py create mode 100644 recipes/gdal/pre_3.5.0/test_package/test_package.c create mode 100644 recipes/gdal/pre_3.5.0/test_package/test_package.cpp create mode 100644 recipes/gdal/pre_3.5.0/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdal/pre_3.5.0/test_v1_package/conanfile.py create mode 100644 recipes/gdbm/all/conandata.yml create mode 100644 recipes/gdbm/all/conanfile.py create mode 100644 recipes/gdbm/all/patches/0001-fix-multiple-definitions.patch create mode 100644 recipes/gdbm/all/test_package/CMakeLists.txt create mode 100644 recipes/gdbm/all/test_package/conanfile.py create mode 100644 recipes/gdbm/all/test_package/test_package.c create mode 100644 recipes/gdbm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdbm/all/test_v1_package/conanfile.py create mode 100644 recipes/gdbm/config.yml create mode 100644 recipes/gdcm/all/conandata.yml create mode 100644 recipes/gdcm/all/conanfile.py create mode 100644 recipes/gdcm/all/patches/0001-charls-linking.patch create mode 100644 recipes/gdcm/all/patches/0002-3.0.20-openjpeg.patch create mode 100644 recipes/gdcm/all/patches/0002-3.0.9-openjpeg.patch create mode 100644 recipes/gdcm/all/patches/0003-gcc-11-compilation.patch create mode 100644 recipes/gdcm/all/patches/0004-3.0.20-find-expat.patch create mode 100644 recipes/gdcm/all/patches/0004-3.0.9-find-expat.patch create mode 100644 recipes/gdcm/all/patches/0005-3.0.20-openssl.patch create mode 100644 recipes/gdcm/all/patches/0005-3.0.9-openssl.patch create mode 100644 recipes/gdcm/all/patches/0006-json.patch create mode 100644 recipes/gdcm/all/patches/0007-3.0.20-find-json.patch create mode 100644 recipes/gdcm/all/patches/0007-3.0.9-find-json.patch create mode 100644 recipes/gdcm/all/patches/0008-3.0.20-find-libuuid.patch create mode 100644 recipes/gdcm/all/patches/0008-3.0.9-find-libuuid.patch create mode 100644 recipes/gdcm/all/test_package/CMakeLists.txt create mode 100644 recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm create mode 100644 recipes/gdcm/all/test_package/conanfile.py create mode 100644 recipes/gdcm/all/test_package/test_package.cpp create mode 100644 recipes/gdcm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdcm/all/test_v1_package/conanfile.py create mode 100644 recipes/gdcm/config.yml create mode 100644 recipes/gdk-pixbuf/all/conandata.yml create mode 100644 recipes/gdk-pixbuf/all/conanfile.py create mode 100644 recipes/gdk-pixbuf/all/patches/define_dllmain_only_when_shared.patch create mode 100644 recipes/gdk-pixbuf/all/test_package/CMakeLists.txt create mode 100644 recipes/gdk-pixbuf/all/test_package/conanfile.py create mode 100644 recipes/gdk-pixbuf/all/test_package/test_package.c create mode 100644 recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdk-pixbuf/all/test_v1_package/conanfile.py create mode 100644 recipes/gdk-pixbuf/config.yml create mode 100644 recipes/gemmlowp/all/conandata.yml create mode 100644 recipes/gemmlowp/all/conanfile.py create mode 100644 recipes/gemmlowp/all/patches/build-static-libraries.patch create mode 100644 recipes/gemmlowp/all/test_package/CMakeLists.txt create mode 100644 recipes/gemmlowp/all/test_package/conanfile.py create mode 100644 recipes/gemmlowp/all/test_package/test_package.cpp create mode 100644 recipes/gemmlowp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gemmlowp/all/test_v1_package/conanfile.py create mode 100644 recipes/gemmlowp/config.yml create mode 100644 recipes/genie/all/conandata.yml create mode 100644 recipes/genie/all/conanfile.py create mode 100644 recipes/genie/all/test_package/conanfile.py create mode 100644 recipes/genie/all/test_package/scripts/genie.lua create mode 100644 recipes/genie/all/test_package/scripts/test_package.lua create mode 100644 recipes/genie/all/test_package/test_package.cpp create mode 100644 recipes/genie/all/test_v1_package/conanfile.py create mode 100644 recipes/genie/config.yml create mode 100644 recipes/geographiclib/all/conandata.yml create mode 100644 recipes/geographiclib/all/conanfile.py create mode 100644 recipes/geographiclib/all/patches/0001-streamoff.patch create mode 100644 recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.50.1.patch create mode 100644 recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.51.patch create mode 100644 recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch create mode 100644 recipes/geographiclib/all/test_package/CMakeLists.txt create mode 100644 recipes/geographiclib/all/test_package/conanfile.py create mode 100644 recipes/geographiclib/all/test_package/test_package.cpp create mode 100644 recipes/geographiclib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/geographiclib/all/test_v1_package/conanfile.py create mode 100644 recipes/geographiclib/config.yml create mode 100644 recipes/geos/all/conandata.yml create mode 100644 recipes/geos/all/conanfile.py create mode 100644 recipes/geos/all/test_package/CMakeLists.txt create mode 100644 recipes/geos/all/test_package/conanfile.py create mode 100644 recipes/geos/all/test_package/test_package.c create mode 100644 recipes/geos/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/geos/all/test_v1_package/conanfile.py create mode 100644 recipes/geos/config.yml create mode 100644 recipes/geotrans/all/CMakeLists.txt create mode 100644 recipes/geotrans/all/conandata.yml create mode 100644 recipes/geotrans/all/conanfile.py create mode 100644 recipes/geotrans/all/patches/3.x-fix-for-cxx20.patch create mode 100644 recipes/geotrans/all/test_package/CMakeLists.txt create mode 100644 recipes/geotrans/all/test_package/conanfile.py create mode 100644 recipes/geotrans/all/test_package/test_package.cpp create mode 100644 recipes/geotrans/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/geotrans/all/test_v1_package/conanfile.py create mode 100644 recipes/geotrans/config.yml create mode 100644 recipes/getdns/all/CMakeLists.txt create mode 100644 recipes/getdns/all/conandata.yml create mode 100644 recipes/getdns/all/conanfile.py create mode 100644 recipes/getdns/all/patches/1.6.0-0001-install-runtimes.patch create mode 100644 recipes/getdns/all/patches/1.6.0-0002-fix-exports-extension-libraries.patch create mode 100644 recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch create mode 100644 recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch create mode 100644 recipes/getdns/all/test_package/CMakeLists.txt create mode 100644 recipes/getdns/all/test_package/conanfile.py create mode 100644 recipes/getdns/all/test_package/test_package.c create mode 100644 recipes/getdns/config.yml create mode 100644 recipes/getopt-for-visual-studio/all/conandata.yml create mode 100644 recipes/getopt-for-visual-studio/all/conanfile.py create mode 100644 recipes/getopt-for-visual-studio/all/patches/0001-allow-usage-in-multiple-compilation-units.patch create mode 100644 recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt create mode 100644 recipes/getopt-for-visual-studio/all/test_package/conanfile.py create mode 100644 recipes/getopt-for-visual-studio/all/test_package/test_package.c create mode 100644 recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/getopt-for-visual-studio/all/test_v1_package/conanfile.py create mode 100644 recipes/getopt-for-visual-studio/config.yml create mode 100644 recipes/gettext/all/conandata.yml create mode 100644 recipes/gettext/all/conanfile.py create mode 100644 recipes/gettext/all/patches/0.20.1-0001-fix-build-errors-with-MSVC.patch create mode 100644 recipes/gettext/all/patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch create mode 100644 recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch create mode 100644 recipes/gettext/all/patches/0004-autopoint-relocatable.patch create mode 100644 recipes/gettext/all/test_package/conanfile.py create mode 100644 recipes/gettext/all/test_package/src/configure.ac create mode 100644 recipes/gettext/all/test_v1_package/conanfile.py create mode 100644 recipes/gettext/all/test_v1_package/configure.ac create mode 100644 recipes/gettext/config.yml create mode 100644 recipes/gf-complete/all/conandata.yml create mode 100644 recipes/gf-complete/all/conanfile.py create mode 100644 recipes/gf-complete/all/patches/0001-fix-msvc-cci.20170410.patch create mode 100644 recipes/gf-complete/all/test_package/CMakeLists.txt create mode 100644 recipes/gf-complete/all/test_package/conanfile.py create mode 100644 recipes/gf-complete/all/test_package/test_package.c create mode 100644 recipes/gf-complete/config.yml create mode 100644 recipes/gflags/all/conandata.yml create mode 100644 recipes/gflags/all/conanfile.py create mode 100644 recipes/gflags/all/test_package/CMakeLists.txt create mode 100644 recipes/gflags/all/test_package/conanfile.py create mode 100644 recipes/gflags/all/test_package/test_package.cpp create mode 100644 recipes/gflags/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gflags/all/test_v1_package/conanfile.py create mode 100644 recipes/gflags/config.yml create mode 100644 recipes/gfortran/all/conandata.yml create mode 100644 recipes/gfortran/all/conanfile.py create mode 100644 recipes/gfortran/all/test_package/conanfile.py create mode 100644 recipes/gfortran/all/test_v1_package/conanfile.py create mode 100644 recipes/gfortran/config.yml create mode 100644 recipes/ghc-filesystem/all/conandata.yml create mode 100644 recipes/ghc-filesystem/all/conanfile.py create mode 100644 recipes/ghc-filesystem/all/test_package/CMakeLists.txt create mode 100644 recipes/ghc-filesystem/all/test_package/conanfile.py create mode 100644 recipes/ghc-filesystem/all/test_package/test_package.cpp create mode 100644 recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ghc-filesystem/all/test_v1_package/conanfile.py create mode 100644 recipes/ghc-filesystem/config.yml create mode 100644 recipes/giflib/5.1.x/conandata.yml create mode 100644 recipes/giflib/5.1.x/conanfile.py create mode 100644 recipes/giflib/5.1.x/gif_lib.h create mode 100644 recipes/giflib/5.1.x/test_package/CMakeLists.txt create mode 100644 recipes/giflib/5.1.x/test_package/conanfile.py create mode 100644 recipes/giflib/5.1.x/test_package/test_package.c create mode 100644 recipes/giflib/5.1.x/unistd.h create mode 100644 recipes/giflib/5.2.x/CMakeLists.txt create mode 100644 recipes/giflib/5.2.x/conandata.yml create mode 100644 recipes/giflib/5.2.x/conanfile.py create mode 100644 recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch create mode 100644 recipes/giflib/5.2.x/test_package/CMakeLists.txt create mode 100644 recipes/giflib/5.2.x/test_package/conanfile.py create mode 100644 recipes/giflib/5.2.x/test_package/test_package.c create mode 100644 recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/giflib/5.2.x/test_v1_package/conanfile.py create mode 100644 recipes/giflib/config.yml create mode 100644 recipes/ginkgo/all/conandata.yml create mode 100644 recipes/ginkgo/all/conanfile.py create mode 100644 recipes/ginkgo/all/patches/cmake-fixes.patch create mode 100644 recipes/ginkgo/all/patches/windows-iterator.patch create mode 100644 recipes/ginkgo/all/patches/windows-symbols.patch create mode 100644 recipes/ginkgo/all/test_package/CMakeLists.txt create mode 100644 recipes/ginkgo/all/test_package/conanfile.py create mode 100644 recipes/ginkgo/all/test_package/test_package.cpp create mode 100644 recipes/ginkgo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ginkgo/all/test_v1_package/conanfile.py create mode 100644 recipes/ginkgo/config.yml create mode 100644 recipes/gklib/all/CMakeLists.txt create mode 100644 recipes/gklib/all/conandata.yml create mode 100644 recipes/gklib/all/conanfile.py create mode 100644 recipes/gklib/all/patches/001-install-win32-headers.patch create mode 100644 recipes/gklib/all/patches/002-disable-tests.patch create mode 100644 recipes/gklib/all/patches/003-install-runtime.patch create mode 100644 recipes/gklib/all/test_package/CMakeLists.txt create mode 100644 recipes/gklib/all/test_package/conanfile.py create mode 100644 recipes/gklib/all/test_package/test_package.c create mode 100644 recipes/gklib/config.yml create mode 100644 recipes/glad/all/conandata.yml create mode 100644 recipes/glad/all/conanfile.py create mode 100644 recipes/glad/all/patches/0001-CMake-handle-all-specs.patch create mode 100644 recipes/glad/all/patches/0002-CMake-handle-all-specs.patch create mode 100644 recipes/glad/all/patches/0003-CMake-handle-all-specs.patch create mode 100644 recipes/glad/all/test_package/CMakeLists.txt create mode 100644 recipes/glad/all/test_package/conanfile.py create mode 100644 recipes/glad/all/test_package/test_package.c create mode 100644 recipes/glad/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glad/all/test_v1_package/conanfile.py create mode 100644 recipes/glad/config.yml create mode 100644 recipes/glaze/all/conandata.yml create mode 100644 recipes/glaze/all/conanfile.py create mode 100644 recipes/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch create mode 100644 recipes/glaze/all/test_package/CMakeLists.txt create mode 100644 recipes/glaze/all/test_package/conanfile.py create mode 100644 recipes/glaze/all/test_package/test_package.cpp create mode 100644 recipes/glaze/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glaze/all/test_v1_package/conanfile.py create mode 100644 recipes/glaze/config.yml create mode 100644 recipes/glbinding/all/conandata.yml create mode 100644 recipes/glbinding/all/conanfile.py create mode 100644 recipes/glbinding/all/patches/cmake-install.patch create mode 100644 recipes/glbinding/all/patches/getProcAddr.patch create mode 100644 recipes/glbinding/all/test_package/CMakeLists.txt create mode 100644 recipes/glbinding/all/test_package/conanfile.py create mode 100644 recipes/glbinding/all/test_package/test_package.cpp create mode 100644 recipes/glbinding/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glbinding/all/test_v1_package/conanfile.py create mode 100644 recipes/glbinding/config.yml create mode 100644 recipes/glew/all/conandata.yml create mode 100644 recipes/glew/all/conanfile.py create mode 100644 recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch create mode 100644 recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch create mode 100644 recipes/glew/all/patches/0002-vs16-release-fix.patch create mode 100644 recipes/glew/all/test_package/CMakeLists.txt create mode 100644 recipes/glew/all/test_package/conanfile.py create mode 100644 recipes/glew/all/test_package/test_package.c create mode 100644 recipes/glew/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glew/all/test_v1_package/conanfile.py create mode 100644 recipes/glew/config.yml create mode 100644 recipes/glext/all/conandata.yml create mode 100644 recipes/glext/all/conanfile.py create mode 100644 recipes/glext/all/test_package/CMakeLists.txt create mode 100644 recipes/glext/all/test_package/conanfile.py create mode 100644 recipes/glext/all/test_package/test_package.c create mode 100644 recipes/glext/config.yml create mode 100644 recipes/glfw/all/conandata.yml create mode 100644 recipes/glfw/all/conanfile.py create mode 100644 recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch create mode 100644 recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch create mode 100644 recipes/glfw/all/test_package/CMakeLists.txt create mode 100644 recipes/glfw/all/test_package/conanfile.py create mode 100644 recipes/glfw/all/test_package/test_package.c create mode 100644 recipes/glfw/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glfw/all/test_v1_package/conanfile.py create mode 100644 recipes/glfw/config.yml create mode 100644 recipes/gli/all/conandata.yml create mode 100644 recipes/gli/all/conanfile.py create mode 100644 recipes/gli/all/test_package/CMakeLists.txt create mode 100644 recipes/gli/all/test_package/conanfile.py create mode 100644 recipes/gli/all/test_package/test_package.cpp create mode 100644 recipes/gli/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gli/all/test_v1_package/conanfile.py create mode 100644 recipes/gli/config.yml create mode 100644 recipes/glib/all/conandata.yml create mode 100644 recipes/glib/all/conanfile.py create mode 100644 recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch create mode 100644 recipes/glib/all/test_package/CMakeLists.txt create mode 100644 recipes/glib/all/test_package/conanfile.py create mode 100644 recipes/glib/all/test_package/test_package.c create mode 100644 recipes/glib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glib/all/test_v1_package/conanfile.py create mode 100644 recipes/glib/config.yml create mode 100644 recipes/glibmm/all/conandata.yml create mode 100644 recipes/glibmm/all/conanfile.py create mode 100644 recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch create mode 100644 recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch create mode 100644 recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch create mode 100644 recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch create mode 100644 recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch create mode 100644 recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch create mode 100644 recipes/glibmm/all/test_package/CMakeLists.txt create mode 100644 recipes/glibmm/all/test_package/conanfile.py create mode 100644 recipes/glibmm/all/test_package/test_package.cpp create mode 100644 recipes/glibmm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glibmm/all/test_v1_package/conanfile.py create mode 100644 recipes/glibmm/config.yml create mode 100644 recipes/glm/all/conandata.yml create mode 100644 recipes/glm/all/conanfile.py create mode 100644 recipes/glm/all/test_package/CMakeLists.txt create mode 100644 recipes/glm/all/test_package/conanfile.py create mode 100644 recipes/glm/all/test_package/test_package.cpp create mode 100644 recipes/glm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glm/all/test_v1_package/conanfile.py create mode 100644 recipes/glm/config.yml create mode 100644 recipes/glog/all/conandata.yml create mode 100644 recipes/glog/all/conanfile.py create mode 100644 recipes/glog/all/patches/0001-fix-msvc-snprintf.patch create mode 100644 recipes/glog/all/test_package/CMakeLists.txt create mode 100644 recipes/glog/all/test_package/conanfile.py create mode 100644 recipes/glog/all/test_package/test_package.cpp create mode 100644 recipes/glog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glog/all/test_v1_package/conanfile.py create mode 100644 recipes/glog/config.yml create mode 100644 recipes/glpk/all/conandata.yml create mode 100644 recipes/glpk/all/conanfile.py create mode 100644 recipes/glpk/all/test_package/CMakeLists.txt create mode 100644 recipes/glpk/all/test_package/conanfile.py create mode 100644 recipes/glpk/all/test_package/test_package.c create mode 100644 recipes/glpk/config.yml create mode 100644 recipes/glshaderpp/all/conandata.yml create mode 100644 recipes/glshaderpp/all/conanfile.py create mode 100644 recipes/glshaderpp/all/test_package/CMakeLists.txt create mode 100644 recipes/glshaderpp/all/test_package/conanfile.py create mode 100644 recipes/glshaderpp/all/test_package/example.cpp create mode 100644 recipes/glshaderpp/config.yml create mode 100644 recipes/glslang/all/CMakeLists.txt create mode 100644 recipes/glslang/all/conandata.yml create mode 100644 recipes/glslang/all/conanfile.py create mode 100644 recipes/glslang/all/patches/0001-no-force-glslang-pic.patch create mode 100644 recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch create mode 100644 recipes/glslang/all/test_package/CMakeLists.txt create mode 100644 recipes/glslang/all/test_package/conanfile.py create mode 100644 recipes/glslang/all/test_package/test_package.cpp create mode 100644 recipes/glslang/all/test_package/test_package.vert create mode 100644 recipes/glslang/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glslang/all/test_v1_package/conanfile.py create mode 100644 recipes/glslang/config.yml create mode 100644 recipes/glu/all/conanfile.py create mode 100644 recipes/glu/all/test_package/CMakeLists.txt create mode 100644 recipes/glu/all/test_package/conanfile.py create mode 100644 recipes/glu/all/test_package/test_package.c create mode 100644 recipes/glu/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glu/all/test_v1_package/conanfile.py create mode 100644 recipes/glu/config.yml create mode 100644 recipes/gm2calc/all/CMakeLists.txt create mode 100644 recipes/gm2calc/all/conandata.yml create mode 100644 recipes/gm2calc/all/conanfile.py create mode 100644 recipes/gm2calc/all/patches/0001-update-1.7.5-to-FindMathematica-3.6.0.patch create mode 100644 recipes/gm2calc/all/test_package/CMakeLists.txt create mode 100644 recipes/gm2calc/all/test_package/conanfile.py create mode 100644 recipes/gm2calc/all/test_package/test_package.cpp create mode 100644 recipes/gm2calc/config.yml create mode 100644 recipes/gmp/all/conandata.yml create mode 100644 recipes/gmp/all/conanfile.py create mode 100644 recipes/gmp/all/patches/0001-msvc-dumpbin-yasm-wrapper.patch create mode 100644 recipes/gmp/all/patches/6.1.x-0001-fix-MSVC-next-prime-error.patch create mode 100644 recipes/gmp/all/patches/6.1.x-0002-fix-MSVC-debug.patch create mode 100644 recipes/gmp/all/patches/6.2.x-0001-fix-MSVC-next-prime-error.patch create mode 100644 recipes/gmp/all/test_package/CMakeLists.txt create mode 100644 recipes/gmp/all/test_package/conanfile.py create mode 100644 recipes/gmp/all/test_package/test_package.c create mode 100644 recipes/gmp/all/test_package/test_package.cpp create mode 100644 recipes/gmp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gmp/all/test_v1_package/conanfile.py create mode 100644 recipes/gmp/config.yml create mode 100644 recipes/gn/all/conandata.yml create mode 100644 recipes/gn/all/conanfile.py create mode 100644 recipes/gn/all/test_package/.gn create mode 100644 recipes/gn/all/test_package/BUILD.gn create mode 100644 recipes/gn/all/test_package/conanfile.py create mode 100644 recipes/gn/all/test_package/config/BUILD.gn create mode 100644 recipes/gn/all/test_package/config/BUILDCONFIG.gn create mode 100644 recipes/gn/all/test_package/config/toolchain/BUILD.gn create mode 100644 recipes/gn/all/test_package/test_package.cpp create mode 100644 recipes/gn/all/test_package/test_shared.cpp create mode 100644 recipes/gn/all/test_package/test_shared.h create mode 100644 recipes/gn/all/test_package/test_static.cpp create mode 100644 recipes/gn/all/test_package/test_static.h create mode 100644 recipes/gn/config.yml create mode 100644 recipes/gnu-config/all/conandata.yml create mode 100644 recipes/gnu-config/all/conanfile.py create mode 100644 recipes/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch create mode 100644 recipes/gnu-config/all/test_package/conanfile.py create mode 100644 recipes/gnu-config/all/test_v1_package/conanfile.py create mode 100644 recipes/gnu-config/config.yml create mode 100644 recipes/gnulib/all/conandata.yml create mode 100644 recipes/gnulib/all/conanfile.py create mode 100644 recipes/gnulib/all/test_package/Makefile.am create mode 100644 recipes/gnulib/all/test_package/conanfile.py create mode 100644 recipes/gnulib/all/test_package/configure.ac create mode 100644 recipes/gnulib/all/test_package/test_package.c create mode 100644 recipes/gnulib/config.yml create mode 100644 recipes/gnutls/all/conandata.yml create mode 100644 recipes/gnutls/all/conanfile.py create mode 100644 recipes/gnutls/all/patches/0001-fix-isdigit.patch create mode 100644 recipes/gnutls/all/test_package/CMakeLists.txt create mode 100644 recipes/gnutls/all/test_package/conanfile.py create mode 100644 recipes/gnutls/all/test_package/test_package.c create mode 100644 recipes/gnutls/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gnutls/all/test_v1_package/conanfile.py create mode 100644 recipes/gnutls/config.yml create mode 100644 recipes/gobject-introspection/all/conandata.yml create mode 100644 recipes/gobject-introspection/all/conanfile.py create mode 100644 recipes/gobject-introspection/all/test_package/CMakeLists.txt create mode 100644 recipes/gobject-introspection/all/test_package/conanfile.py create mode 100644 recipes/gobject-introspection/all/test_package/test_package.c create mode 100644 recipes/gobject-introspection/config.yml create mode 100644 recipes/godot-cpp/all/conandata.yml create mode 100644 recipes/godot-cpp/all/conanfile.py create mode 100644 recipes/godot-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/godot-cpp/all/test_package/conanfile.py create mode 100644 recipes/godot-cpp/all/test_package/test_package.cpp create mode 100644 recipes/godot-cpp/config.yml create mode 100644 recipes/godot_headers/all/conandata.yml create mode 100644 recipes/godot_headers/all/conanfile.py create mode 100644 recipes/godot_headers/all/test_package/CMakeLists.txt create mode 100644 recipes/godot_headers/all/test_package/conanfile.py create mode 100644 recipes/godot_headers/all/test_package/test_package.c create mode 100644 recipes/godot_headers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/godot_headers/all/test_v1_package/conanfile.py create mode 100644 recipes/godot_headers/config.yml create mode 100644 recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake create mode 100644 recipes/google-cloud-cpp/2.x/conandata.yml create mode 100644 recipes/google-cloud-cpp/2.x/conanfile.py create mode 100644 recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch create mode 100644 recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch create mode 100644 recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch create mode 100644 recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt create mode 100644 recipes/google-cloud-cpp/2.x/test_package/bigtable.cpp create mode 100644 recipes/google-cloud-cpp/2.x/test_package/conanfile.py create mode 100644 recipes/google-cloud-cpp/2.x/test_package/pubsub.cpp create mode 100644 recipes/google-cloud-cpp/2.x/test_package/spanner.cpp create mode 100644 recipes/google-cloud-cpp/2.x/test_package/speech.cpp create mode 100644 recipes/google-cloud-cpp/2.x/test_package/storage.cpp create mode 100644 recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/google-cloud-cpp/2.x/test_v1_package/conanfile.py create mode 100644 recipes/google-cloud-cpp/all/CMakeLists.txt create mode 100644 recipes/google-cloud-cpp/all/conandata.yml create mode 100644 recipes/google-cloud-cpp/all/conanfile.py create mode 100644 recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch create mode 100644 recipes/google-cloud-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/google-cloud-cpp/all/test_package/conanfile.py create mode 100644 recipes/google-cloud-cpp/all/test_package/storage.cpp create mode 100644 recipes/google-cloud-cpp/config.yml create mode 100644 recipes/googleapis/all/CMakeLists.txt create mode 100644 recipes/googleapis/all/conandata.yml create mode 100644 recipes/googleapis/all/conanfile.py create mode 100644 recipes/googleapis/all/helpers.py create mode 100644 recipes/googleapis/all/patches/cci.20210730/001-fix-google-api-deps.patch create mode 100644 recipes/googleapis/all/patches/cci.20211122/001-fix-google-api-deps.patch create mode 100644 recipes/googleapis/all/patches/cci.20220531/001-fix-google-api-deps.patch create mode 100644 recipes/googleapis/all/patches/cci.20220711/001-fix-google-api-deps.patch create mode 100644 recipes/googleapis/all/test_package/CMakeLists.txt create mode 100644 recipes/googleapis/all/test_package/conanfile.py create mode 100644 recipes/googleapis/all/test_package/test_package.cpp create mode 100644 recipes/googleapis/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/googleapis/all/test_v1_package/conanfile.py create mode 100644 recipes/googleapis/config.yml create mode 100644 recipes/gperf/all/conandata.yml create mode 100644 recipes/gperf/all/conanfile.py create mode 100644 recipes/gperf/all/patches/0001-remove-register-keyword.patch create mode 100644 recipes/gperf/all/test_package/conanfile.py create mode 100644 recipes/gperf/all/test_v1_package/conanfile.py create mode 100644 recipes/gperf/config.yml create mode 100644 recipes/graphene/all/conandata.yml create mode 100644 recipes/graphene/all/conanfile.py create mode 100644 recipes/graphene/all/test_package/CMakeLists.txt create mode 100644 recipes/graphene/all/test_package/conanfile.py create mode 100644 recipes/graphene/all/test_package/test_package.c create mode 100644 recipes/graphene/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/graphene/all/test_v1_package/conanfile.py create mode 100644 recipes/graphene/config.yml create mode 100644 recipes/graphthewy/all/conandata.yml create mode 100644 recipes/graphthewy/all/conanfile.py create mode 100644 recipes/graphthewy/all/test_package/CMakeLists.txt create mode 100644 recipes/graphthewy/all/test_package/conanfile.py create mode 100644 recipes/graphthewy/all/test_package/test_package.cpp create mode 100644 recipes/graphthewy/config.yml create mode 100644 recipes/greatest/all/conandata.yml create mode 100644 recipes/greatest/all/conanfile.py create mode 100644 recipes/greatest/all/test_package/CMakeLists.txt create mode 100644 recipes/greatest/all/test_package/conanfile.py create mode 100644 recipes/greatest/all/test_package/test_package.c create mode 100644 recipes/greatest/config.yml create mode 100644 recipes/greg7mdp-gtl/all/conandata.yml create mode 100644 recipes/greg7mdp-gtl/all/conanfile.py create mode 100644 recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt create mode 100644 recipes/greg7mdp-gtl/all/test_package/conanfile.py create mode 100644 recipes/greg7mdp-gtl/all/test_package/test_package.cpp create mode 100644 recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py create mode 100644 recipes/greg7mdp-gtl/config.yml create mode 100644 recipes/grpc-proto/all/CMakeLists.txt create mode 100644 recipes/grpc-proto/all/conandata.yml create mode 100644 recipes/grpc-proto/all/conanfile.py create mode 100644 recipes/grpc-proto/all/helpers.py create mode 100644 recipes/grpc-proto/all/test_package/CMakeLists.txt create mode 100644 recipes/grpc-proto/all/test_package/conanfile.py create mode 100644 recipes/grpc-proto/all/test_package/test_package.cpp create mode 100644 recipes/grpc-proto/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/grpc-proto/all/test_v1_package/conanfile.py create mode 100644 recipes/grpc-proto/config.yml create mode 100644 recipes/grpc/all/cmake/grpc_plugin_template.cmake.in create mode 100644 recipes/grpc/all/conan_cmake_project_include.cmake create mode 100644 recipes/grpc/all/conandata.yml create mode 100644 recipes/grpc/all/conanfile.py create mode 100644 recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch create mode 100644 recipes/grpc/all/patches/v1.46.x/002-consume-protos-from-requirements.patch create mode 100644 recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch create mode 100644 recipes/grpc/all/patches/v1.47.x/002-consume-protos-from-requirements.patch create mode 100644 recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch create mode 100644 recipes/grpc/all/patches/v1.48.x/002-consume-protos-from-requirements.patch create mode 100644 recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch create mode 100644 recipes/grpc/all/patches/v1.50.x/002-consume-protos-from-requirements.patch create mode 100644 recipes/grpc/all/test_package/CMakeLists.txt create mode 100644 recipes/grpc/all/test_package/conanfile.py create mode 100644 recipes/grpc/all/test_package/helloworld.proto create mode 100644 recipes/grpc/all/test_package/macos_make_override.cmake create mode 100644 recipes/grpc/all/test_package/test_package.cpp create mode 100644 recipes/grpc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/grpc/all/test_v1_package/conanfile.py create mode 100644 recipes/grpc/config.yml create mode 100644 recipes/gsl-lite/all/conandata.yml create mode 100644 recipes/gsl-lite/all/conanfile.py create mode 100644 recipes/gsl-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/gsl-lite/all/test_package/conanfile.py create mode 100644 recipes/gsl-lite/all/test_package/test_package.cpp create mode 100644 recipes/gsl-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gsl-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/gsl-lite/config.yml create mode 100644 recipes/gsl/all/conandata.yml create mode 100644 recipes/gsl/all/conanfile.py create mode 100644 recipes/gsl/all/patches/0001-windows-support.patch create mode 100644 recipes/gsl/all/patches/0002-export-all-gsl_-symbols.patch create mode 100644 recipes/gsl/all/test_package/CMakeLists.txt create mode 100644 recipes/gsl/all/test_package/conanfile.py create mode 100644 recipes/gsl/all/test_package/test_package.c create mode 100644 recipes/gsl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gsl/all/test_v1_package/conanfile.py create mode 100644 recipes/gsl/config.yml create mode 100644 recipes/gsoap/all/CMakeLists.txt create mode 100644 recipes/gsoap/all/cmake/gsoap.cmake create mode 100644 recipes/gsoap/all/cmake/soapcpp2.cmake create mode 100644 recipes/gsoap/all/cmake/wsdl2h.cmake create mode 100644 recipes/gsoap/all/conandata.yml create mode 100644 recipes/gsoap/all/conanfile.py create mode 100644 recipes/gsoap/all/test_package/CMakeLists.txt create mode 100644 recipes/gsoap/all/test_package/calc.nsmap create mode 100644 recipes/gsoap/all/test_package/calc.wsdl create mode 100644 recipes/gsoap/all/test_package/conanfile.py create mode 100644 recipes/gsoap/all/test_package/test_package.cpp create mode 100644 recipes/gsoap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gsoap/all/test_v1_package/conanfile.py create mode 100644 recipes/gsoap/config.yml create mode 100644 recipes/gst-libav/all/conandata.yml create mode 100644 recipes/gst-libav/all/conanfile.py create mode 100644 recipes/gst-libav/all/test_package/CMakeLists.txt create mode 100644 recipes/gst-libav/all/test_package/conanfile.py create mode 100644 recipes/gst-libav/all/test_package/test_package.cpp create mode 100644 recipes/gst-libav/config.yml create mode 100644 recipes/gst-plugins-bad/all/conandata.yml create mode 100644 recipes/gst-plugins-bad/all/conanfile.py create mode 100644 recipes/gst-plugins-bad/all/test_package/CMakeLists.txt create mode 100644 recipes/gst-plugins-bad/all/test_package/conanfile.py create mode 100644 recipes/gst-plugins-bad/all/test_package/test_package.cpp create mode 100644 recipes/gst-plugins-bad/config.yml create mode 100644 recipes/gst-plugins-base/all/conandata.yml create mode 100644 recipes/gst-plugins-base/all/conanfile.py create mode 100644 recipes/gst-plugins-base/all/test_package/CMakeLists.txt create mode 100644 recipes/gst-plugins-base/all/test_package/conanfile.py create mode 100644 recipes/gst-plugins-base/all/test_package/test_package.cpp create mode 100644 recipes/gst-plugins-base/config.yml create mode 100644 recipes/gst-plugins-good/all/conandata.yml create mode 100644 recipes/gst-plugins-good/all/conanfile.py create mode 100644 recipes/gst-plugins-good/all/test_package/CMakeLists.txt create mode 100644 recipes/gst-plugins-good/all/test_package/conanfile.py create mode 100644 recipes/gst-plugins-good/all/test_package/test_package.cpp create mode 100644 recipes/gst-plugins-good/config.yml create mode 100644 recipes/gst-plugins-ugly/all/conandata.yml create mode 100644 recipes/gst-plugins-ugly/all/conanfile.py create mode 100644 recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt create mode 100644 recipes/gst-plugins-ugly/all/test_package/conanfile.py create mode 100644 recipes/gst-plugins-ugly/all/test_package/test_package.cpp create mode 100644 recipes/gst-plugins-ugly/config.yml create mode 100644 recipes/gstreamer/all/conandata.yml create mode 100644 recipes/gstreamer/all/conanfile.py create mode 100644 recipes/gstreamer/all/test_package/CMakeLists.txt create mode 100644 recipes/gstreamer/all/test_package/conanfile.py create mode 100644 recipes/gstreamer/all/test_package/test_package.c create mode 100644 recipes/gstreamer/config.yml create mode 100644 recipes/gtest/all/conandata.yml create mode 100644 recipes/gtest/all/conanfile.py create mode 100644 recipes/gtest/all/patches/gtest-1.10.0-override.patch create mode 100644 recipes/gtest/all/patches/gtest-1.10.0.patch create mode 100644 recipes/gtest/all/test_package/CMakeLists.txt create mode 100644 recipes/gtest/all/test_package/conanfile.py create mode 100644 recipes/gtest/all/test_package/main.cpp create mode 100644 recipes/gtest/all/test_package/test_package.cpp create mode 100644 recipes/gtest/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gtest/all/test_v1_package/conanfile.py create mode 100644 recipes/gtest/config.yml create mode 100644 recipes/gtk-doc-stub/all/conandata.yml create mode 100644 recipes/gtk-doc-stub/all/conanfile.py create mode 100644 recipes/gtk-doc-stub/all/patches/0001-relocatable-gtkdocize.patch create mode 100644 recipes/gtk-doc-stub/all/test_package/conanfile.py create mode 100644 recipes/gtk-doc-stub/all/test_package/configure.ac create mode 100644 recipes/gtk-doc-stub/config.yml create mode 100644 recipes/gtk/all/conandata.yml create mode 100644 recipes/gtk/all/conanfile.py create mode 100644 recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch create mode 100644 recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch create mode 100644 recipes/gtk/all/test_package/CMakeLists.txt create mode 100644 recipes/gtk/all/test_package/conanfile.py create mode 100644 recipes/gtk/all/test_package/test_package.c create mode 100644 recipes/gtk/config.yml create mode 100644 recipes/gtk/system/conanfile.py create mode 100644 recipes/gtk/system/test_package/CMakeLists.txt create mode 100644 recipes/gtk/system/test_package/conanfile.py create mode 100644 recipes/gtk/system/test_package/test_package.c create mode 100644 recipes/gtk/system/test_v1_package/CMakeLists.txt create mode 100644 recipes/gtk/system/test_v1_package/conanfile.py create mode 100644 recipes/gtk/system/test_v1_package/test_package.c create mode 100644 recipes/gtsam/all/conandata.yml create mode 100644 recipes/gtsam/all/conanfile.py create mode 100644 recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch create mode 100644 recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch create mode 100644 recipes/gtsam/all/patches/4.0.2-0003-cmake-project.patch create mode 100644 recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch create mode 100644 recipes/gtsam/all/patches/4.0.3-0001-cmake-boost.patch create mode 100644 recipes/gtsam/all/patches/4.0.3-0002-cmake-eigen.patch create mode 100644 recipes/gtsam/all/patches/4.0.3-0003-macos-rpath.patch create mode 100644 recipes/gtsam/all/patches/4.1.1-0001-cmake-boost.patch create mode 100644 recipes/gtsam/all/patches/4.1.1-0002-cmake-eigen.patch create mode 100644 recipes/gtsam/all/patches/4.1.1-0003-macos-rpath.patch create mode 100644 recipes/gtsam/all/test_package/CMakeLists.txt create mode 100644 recipes/gtsam/all/test_package/conanfile.py create mode 100644 recipes/gtsam/all/test_package/test_package.cpp create mode 100644 recipes/gtsam/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gtsam/all/test_v1_package/conanfile.py create mode 100644 recipes/gtsam/config.yml create mode 100644 recipes/guetzli/all/conandata.yml create mode 100644 recipes/guetzli/all/conanfile.py create mode 100644 recipes/guetzli/all/patches/0001-no-debug.patch create mode 100644 recipes/guetzli/all/test_package/bees.png create mode 100644 recipes/guetzli/all/test_package/conanfile.py create mode 100644 recipes/guetzli/config.yml create mode 100644 recipes/gumbo-parser/all/conandata.yml create mode 100644 recipes/gumbo-parser/all/conanfile.py create mode 100644 recipes/gumbo-parser/all/test_package/CMakeLists.txt create mode 100644 recipes/gumbo-parser/all/test_package/conanfile.py create mode 100644 recipes/gumbo-parser/all/test_package/test_package.c create mode 100644 recipes/gumbo-parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gumbo-parser/all/test_v1_package/conanfile.py create mode 100644 recipes/gumbo-parser/config.yml create mode 100644 recipes/gurkenlaeufer/all/conandata.yml create mode 100644 recipes/gurkenlaeufer/all/conanfile.py create mode 100644 recipes/gurkenlaeufer/all/test_package/CMakeLists.txt create mode 100644 recipes/gurkenlaeufer/all/test_package/conanfile.py create mode 100644 recipes/gurkenlaeufer/all/test_package/main.cpp create mode 100644 recipes/gurkenlaeufer/all/test_package/parsertests.cpp create mode 100644 recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gurkenlaeufer/all/test_v1_package/conanfile.py create mode 100644 recipes/gurkenlaeufer/config.yml create mode 100644 recipes/gzip-hpp/all/conandata.yml create mode 100644 recipes/gzip-hpp/all/conanfile.py create mode 100644 recipes/gzip-hpp/all/test_package/CMakeLists.txt create mode 100644 recipes/gzip-hpp/all/test_package/conanfile.py create mode 100644 recipes/gzip-hpp/all/test_package/test_package.cpp create mode 100644 recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gzip-hpp/all/test_v1_package/conanfile.py create mode 100644 recipes/gzip-hpp/config.yml create mode 100644 recipes/h3/all/conandata.yml create mode 100644 recipes/h3/all/conanfile.py create mode 100644 recipes/h3/all/patches/fix-cmake-3.6.3.patch create mode 100644 recipes/h3/all/patches/fix-cmake-3.6.4.patch create mode 100644 recipes/h3/all/patches/fix-cmake-3.7.x.patch create mode 100644 recipes/h3/all/test_package/CMakeLists.txt create mode 100644 recipes/h3/all/test_package/conanfile.py create mode 100644 recipes/h3/all/test_package/test_package.c create mode 100644 recipes/h3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/h3/all/test_v1_package/conanfile.py create mode 100644 recipes/h3/config.yml create mode 100644 recipes/h5pp/all/conandata.yml create mode 100644 recipes/h5pp/all/conanfile.py create mode 100644 recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.3-5.patch create mode 100644 recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.6.patch create mode 100644 recipes/h5pp/all/patches/fix-support-new-hdf5-v1.9.0.patch create mode 100644 recipes/h5pp/all/test_package/CMakeLists.txt create mode 100644 recipes/h5pp/all/test_package/conanfile.py create mode 100644 recipes/h5pp/all/test_package/test_package.cpp create mode 100644 recipes/h5pp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/h5pp/all/test_v1_package/conanfile.py create mode 100644 recipes/h5pp/all/test_v1_package/test_package.cpp create mode 100644 recipes/h5pp/config.yml create mode 100644 recipes/half/all/conandata.yml create mode 100644 recipes/half/all/conanfile.py create mode 100644 recipes/half/all/test_package/CMakeLists.txt create mode 100644 recipes/half/all/test_package/conanfile.py create mode 100644 recipes/half/all/test_package/test_package.cpp create mode 100644 recipes/half/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/half/all/test_v1_package/conanfile.py create mode 100644 recipes/half/config.yml create mode 100644 recipes/hana/all/conandata.yml create mode 100644 recipes/hana/all/conanfile.py create mode 100644 recipes/hana/all/test_package/CMakeLists.txt create mode 100644 recipes/hana/all/test_package/conanfile.py create mode 100644 recipes/hana/all/test_package/test_package.cpp create mode 100644 recipes/hana/config.yml create mode 100644 recipes/happly/all/conandata.yml create mode 100644 recipes/happly/all/conanfile.py create mode 100644 recipes/happly/all/test_package/CMakeLists.txt create mode 100644 recipes/happly/all/test_package/conanfile.py create mode 100644 recipes/happly/all/test_package/test_package.cpp create mode 100644 recipes/happly/config.yml create mode 100644 recipes/harfbuzz/all/conandata.yml create mode 100644 recipes/harfbuzz/all/conanfile.py create mode 100644 recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch create mode 100644 recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch create mode 100644 recipes/harfbuzz/all/test_package/CMakeLists.txt create mode 100644 recipes/harfbuzz/all/test_package/conanfile.py create mode 100644 recipes/harfbuzz/all/test_package/example.ttf create mode 100644 recipes/harfbuzz/all/test_package/test_package.c create mode 100644 recipes/harfbuzz/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/harfbuzz/all/test_v1_package/conanfile.py create mode 100644 recipes/harfbuzz/config.yml create mode 100644 recipes/hash-library/all/CMakeLists.txt create mode 100644 recipes/hash-library/all/conandata.yml create mode 100644 recipes/hash-library/all/conanfile.py create mode 100644 recipes/hash-library/all/patches/001-fix-macos.patch create mode 100644 recipes/hash-library/all/test_package/CMakeLists.txt create mode 100644 recipes/hash-library/all/test_package/conanfile.py create mode 100644 recipes/hash-library/all/test_package/test_package.cpp create mode 100644 recipes/hash-library/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hash-library/all/test_v1_package/conanfile.py create mode 100644 recipes/hash-library/config.yml create mode 100644 recipes/hazelcast-cpp-client/all/conandata.yml create mode 100644 recipes/hazelcast-cpp-client/all/conanfile.py create mode 100644 recipes/hazelcast-cpp-client/all/patches/gcc_11_1_0.patch create mode 100644 recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch create mode 100644 recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt create mode 100644 recipes/hazelcast-cpp-client/all/test_package/conanfile.py create mode 100644 recipes/hazelcast-cpp-client/all/test_package/test_package.cpp create mode 100644 recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py create mode 100644 recipes/hazelcast-cpp-client/config.yml create mode 100644 recipes/hdf4/all/CMakeLists.txt create mode 100644 recipes/hdf4/all/conandata.yml create mode 100644 recipes/hdf4/all/conanfile.py create mode 100644 recipes/hdf4/all/patches/fix-export-macro.patch create mode 100644 recipes/hdf4/all/patches/fix-missing-unistd-include.patch create mode 100644 recipes/hdf4/all/test_package/CMakeLists.txt create mode 100644 recipes/hdf4/all/test_package/conanfile.py create mode 100644 recipes/hdf4/all/test_package/test_package.c create mode 100644 recipes/hdf4/config.yml create mode 100644 recipes/hdf5/all/conandata.yml create mode 100644 recipes/hdf5/all/conanfile.py create mode 100644 recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch create mode 100644 recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch create mode 100644 recipes/hdf5/all/patches/conanize-link-szip-1.14.0+.patch create mode 100644 recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch create mode 100644 recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.5+.patch create mode 100644 recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.6.patch create mode 100644 recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.10.5.patch create mode 100644 recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.8.21.patch create mode 100644 recipes/hdf5/all/patches/mingw-fix-prefix-lib.patch create mode 100644 recipes/hdf5/all/patches/mingw-unused-ellipses.patch create mode 100644 recipes/hdf5/all/test_package/CMakeLists.txt create mode 100644 recipes/hdf5/all/test_package/conanfile.py create mode 100644 recipes/hdf5/all/test_package/test_package.c create mode 100644 recipes/hdf5/all/test_package/test_package.cpp create mode 100644 recipes/hdf5/all/test_package/test_parallel.c create mode 100644 recipes/hdf5/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hdf5/all/test_v1_package/conanfile.py create mode 100644 recipes/hdf5/config.yml create mode 100644 recipes/hdrhistogram-c/all/conandata.yml create mode 100644 recipes/hdrhistogram-c/all/conanfile.py create mode 100644 recipes/hdrhistogram-c/all/patches/cmake-install.patch create mode 100644 recipes/hdrhistogram-c/all/test_package/CMakeLists.txt create mode 100644 recipes/hdrhistogram-c/all/test_package/conanfile.py create mode 100644 recipes/hdrhistogram-c/all/test_package/test_package.c create mode 100644 recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hdrhistogram-c/all/test_v1_package/conanfile.py create mode 100644 recipes/hdrhistogram-c/config.yml create mode 100644 recipes/heatshrink/all/CMakeLists.txt create mode 100644 recipes/heatshrink/all/conandata.yml create mode 100644 recipes/heatshrink/all/conanfile.py create mode 100644 recipes/heatshrink/all/test_package/CMakeLists.txt create mode 100644 recipes/heatshrink/all/test_package/conanfile.py create mode 100644 recipes/heatshrink/all/test_package/test_package.c create mode 100644 recipes/heatshrink/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/heatshrink/all/test_v1_package/conanfile.py create mode 100644 recipes/heatshrink/config.yml create mode 100644 recipes/hedley/all/conandata.yml create mode 100644 recipes/hedley/all/conanfile.py create mode 100644 recipes/hedley/all/test_package/CMakeLists.txt create mode 100644 recipes/hedley/all/test_package/conanfile.py create mode 100644 recipes/hedley/all/test_package/test_package.cpp create mode 100644 recipes/hedley/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hedley/all/test_v1_package/conanfile.py create mode 100644 recipes/hedley/config.yml create mode 100644 recipes/hexl/all/CMakeLists.txt create mode 100644 recipes/hexl/all/conandata.yml create mode 100644 recipes/hexl/all/conanfile.py create mode 100644 recipes/hexl/all/patches/fix-cmake.patch create mode 100644 recipes/hexl/all/test_package/CMakeLists.txt create mode 100644 recipes/hexl/all/test_package/conanfile.py create mode 100644 recipes/hexl/all/test_package/example.cpp create mode 100644 recipes/hexl/config.yml create mode 100644 recipes/hffix/all/conandata.yml create mode 100644 recipes/hffix/all/conanfile.py create mode 100644 recipes/hffix/all/test_package/CMakeLists.txt create mode 100644 recipes/hffix/all/test_package/conanfile.py create mode 100644 recipes/hffix/all/test_package/test_package.cpp create mode 100644 recipes/hffix/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hffix/all/test_v1_package/conanfile.py create mode 100644 recipes/hffix/config.yml create mode 100644 recipes/hidapi/all/conandata.yml create mode 100644 recipes/hidapi/all/conanfile.py create mode 100644 recipes/hidapi/all/test_package/CMakeLists.txt create mode 100644 recipes/hidapi/all/test_package/conanfile.py create mode 100644 recipes/hidapi/all/test_package/test_package.c create mode 100644 recipes/hidapi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hidapi/all/test_v1_package/conanfile.py create mode 100644 recipes/hidapi/config.yml create mode 100644 recipes/highfive/all/conandata.yml create mode 100644 recipes/highfive/all/conanfile.py create mode 100644 recipes/highfive/all/test_package/CMakeLists.txt create mode 100644 recipes/highfive/all/test_package/conanfile.py create mode 100644 recipes/highfive/all/test_package/test_package.cpp create mode 100644 recipes/highfive/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/highfive/all/test_v1_package/conanfile.py create mode 100644 recipes/highfive/config.yml create mode 100644 recipes/highs/all/conandata.yml create mode 100644 recipes/highs/all/conanfile.py create mode 100644 recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch create mode 100644 recipes/highs/all/test_package/CMakeLists.txt create mode 100644 recipes/highs/all/test_package/conanfile.py create mode 100644 recipes/highs/all/test_package/main.cpp create mode 100644 recipes/highs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/highs/all/test_v1_package/conanfile.py create mode 100644 recipes/highs/config.yml create mode 100644 recipes/highway/all/conandata.yml create mode 100644 recipes/highway/all/conanfile.py create mode 100644 recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch create mode 100644 recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch create mode 100644 recipes/highway/all/test_package/CMakeLists.txt create mode 100644 recipes/highway/all/test_package/conanfile.py create mode 100644 recipes/highway/all/test_package/test_package.cpp create mode 100644 recipes/highway/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/highway/all/test_v1_package/conanfile.py create mode 100644 recipes/highway/config.yml create mode 100644 recipes/hipony-enumerate/all/conandata.yml create mode 100644 recipes/hipony-enumerate/all/conanfile.py create mode 100644 recipes/hipony-enumerate/all/test_package/CMakeLists.txt create mode 100644 recipes/hipony-enumerate/all/test_package/conanfile.py create mode 100644 recipes/hipony-enumerate/all/test_package/test_package.cpp create mode 100644 recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hipony-enumerate/all/test_v1_package/conanfile.py create mode 100644 recipes/hipony-enumerate/config.yml create mode 100644 recipes/hippomocks/all/conandata.yml create mode 100755 recipes/hippomocks/all/conanfile.py create mode 100755 recipes/hippomocks/all/test_package/CMakeLists.txt create mode 100755 recipes/hippomocks/all/test_package/conanfile.py create mode 100755 recipes/hippomocks/all/test_package/main.cpp create mode 100644 recipes/hippomocks/config.yml create mode 100644 recipes/hiredis/0.x.x/conandata.yml create mode 100644 recipes/hiredis/0.x.x/conanfile.py create mode 100644 recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch create mode 100644 recipes/hiredis/0.x.x/test_package/CMakeLists.txt create mode 100644 recipes/hiredis/0.x.x/test_package/conanfile.py create mode 100644 recipes/hiredis/0.x.x/test_package/test_package.c create mode 100644 recipes/hiredis/all/conandata.yml create mode 100644 recipes/hiredis/all/conanfile.py create mode 100644 recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch create mode 100644 recipes/hiredis/all/patches/0001-fix-cmake-1.1.0.patch create mode 100644 recipes/hiredis/all/patches/0002-fix-aix.patch create mode 100644 recipes/hiredis/all/test_package/CMakeLists.txt create mode 100644 recipes/hiredis/all/test_package/conanfile.py create mode 100644 recipes/hiredis/all/test_package/test_package.c create mode 100644 recipes/hiredis/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hiredis/all/test_v1_package/conanfile.py create mode 100644 recipes/hiredis/config.yml create mode 100644 recipes/hlslpp/all/conandata.yml create mode 100644 recipes/hlslpp/all/conanfile.py create mode 100644 recipes/hlslpp/all/test_package/CMakeLists.txt create mode 100644 recipes/hlslpp/all/test_package/conanfile.py create mode 100644 recipes/hlslpp/all/test_package/test_package.cpp create mode 100644 recipes/hlslpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hlslpp/all/test_v1_package/conanfile.py create mode 100644 recipes/hlslpp/config.yml create mode 100644 recipes/homog2d/all/conandata.yml create mode 100644 recipes/homog2d/all/conanfile.py create mode 100644 recipes/homog2d/all/patches/0001-include-array.patch create mode 100644 recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch create mode 100644 recipes/homog2d/all/patches/0003-support-msvc.patch create mode 100644 recipes/homog2d/all/test_package/CMakeLists.txt create mode 100644 recipes/homog2d/all/test_package/conanfile.py create mode 100644 recipes/homog2d/all/test_package/test_package.cpp create mode 100644 recipes/homog2d/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/homog2d/all/test_v1_package/conanfile.py create mode 100644 recipes/homog2d/config.yml create mode 100644 recipes/http_parser/all/CMakeLists.txt create mode 100644 recipes/http_parser/all/conandata.yml create mode 100644 recipes/http_parser/all/conanfile.py create mode 100644 recipes/http_parser/all/test_package/CMakeLists.txt create mode 100644 recipes/http_parser/all/test_package/conanfile.py create mode 100644 recipes/http_parser/all/test_package/test_package.c create mode 100644 recipes/http_parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/http_parser/all/test_v1_package/conanfile.py create mode 100644 recipes/http_parser/config.yml create mode 100644 recipes/huffman/all/CMakeLists.txt create mode 100644 recipes/huffman/all/conandata.yml create mode 100644 recipes/huffman/all/conanfile.py create mode 100644 recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch create mode 100644 recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch create mode 100644 recipes/huffman/all/test_package/CMakeLists.txt create mode 100644 recipes/huffman/all/test_package/conanfile.py create mode 100644 recipes/huffman/all/test_package/test_package.cpp create mode 100644 recipes/huffman/config.yml create mode 100644 recipes/hunspell/all/CMakeLists.txt create mode 100644 recipes/hunspell/all/conandata.yml create mode 100644 recipes/hunspell/all/conanfile.py create mode 100644 recipes/hunspell/all/test_package/CMakeLists.txt create mode 100644 recipes/hunspell/all/test_package/conanfile.py create mode 100644 recipes/hunspell/all/test_package/test_package.cxx create mode 100644 recipes/hunspell/config.yml create mode 100644 recipes/hyperscan/all/conandata.yml create mode 100644 recipes/hyperscan/all/conanfile.py create mode 100644 recipes/hyperscan/all/patches/0001-fix-cmake.patch create mode 100644 recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch create mode 100644 recipes/hyperscan/all/test_package/CMakeLists.txt create mode 100644 recipes/hyperscan/all/test_package/ch_example.cpp create mode 100644 recipes/hyperscan/all/test_package/conanfile.py create mode 100644 recipes/hyperscan/all/test_package/hs_example.cpp create mode 100644 recipes/hyperscan/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hyperscan/all/test_v1_package/conanfile.py create mode 100644 recipes/hyperscan/config.yml create mode 100644 recipes/i2c-tools/all/conandata.yml create mode 100644 recipes/i2c-tools/all/conanfile.py create mode 100644 recipes/i2c-tools/all/test_package/CMakeLists.txt create mode 100644 recipes/i2c-tools/all/test_package/conanfile.py create mode 100644 recipes/i2c-tools/all/test_package/test_package.c create mode 100644 recipes/i2c-tools/config.yml create mode 100644 recipes/icecream-cpp/all/conandata.yml create mode 100644 recipes/icecream-cpp/all/conanfile.py create mode 100644 recipes/icecream-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/icecream-cpp/all/test_package/conanfile.py create mode 100644 recipes/icecream-cpp/all/test_package/example.cpp create mode 100644 recipes/icecream-cpp/config.yml create mode 100644 recipes/iceoryx/all/CMakeLists.txt create mode 100644 recipes/iceoryx/all/conandata.yml create mode 100644 recipes/iceoryx/all/conanfile.py create mode 100644 recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch create mode 100644 recipes/iceoryx/all/patches/1.0.0-0002-fix-install-bundle.patch create mode 100644 recipes/iceoryx/all/patches/1.0.0-0003-no-hardcoded-libcxx.patch create mode 100644 recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch create mode 100644 recipes/iceoryx/all/test_package/CMakeLists.txt create mode 100644 recipes/iceoryx/all/test_package/conanfile.py create mode 100644 recipes/iceoryx/all/test_package/main.cpp create mode 100644 recipes/iceoryx/config.yml create mode 100644 recipes/icu/all/conandata.yml create mode 100644 recipes/icu/all/conanfile.py create mode 100644 recipes/icu/all/patches/0001-67.1-fix-mingw.patch create mode 100644 recipes/icu/all/patches/0001-69.1-fix-mingw.patch create mode 100644 recipes/icu/all/patches/0001-71.1-fix-emscripten.patch create mode 100644 recipes/icu/all/patches/0001-71.1-fix-undef-strict-ansi.patch create mode 100644 recipes/icu/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch create mode 100644 recipes/icu/all/test_package/CMakeLists.txt create mode 100644 recipes/icu/all/test_package/conanfile.py create mode 100644 recipes/icu/all/test_package/test_package.cpp create mode 100644 recipes/icu/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/icu/all/test_v1_package/conanfile.py create mode 100644 recipes/icu/config.yml create mode 100644 recipes/ignition-cmake/all/CMakeLists.txt create mode 100644 recipes/ignition-cmake/all/conandata.yml create mode 100644 recipes/ignition-cmake/all/conanfile.py create mode 100644 recipes/ignition-cmake/all/patches/0001-cmake-fixes.patch create mode 100644 recipes/ignition-cmake/all/patches/0002-ignition-cmake-2.10.0-fixes.patch create mode 100644 recipes/ignition-cmake/all/test_package/CMakeLists.txt create mode 100644 recipes/ignition-cmake/all/test_package/conanfile.py create mode 100644 recipes/ignition-cmake/all/test_package/src/CMakeLists.txt create mode 100644 recipes/ignition-cmake/all/test_package/src/test_package.cpp create mode 100644 recipes/ignition-cmake/config.yml create mode 100644 recipes/ignition-math/all/CMakeLists.txt create mode 100644 recipes/ignition-math/all/conandata.yml create mode 100644 recipes/ignition-math/all/conanfile.py create mode 100644 recipes/ignition-math/all/patches/0001-ign-math-6.7.0-cmake-fixes.patch create mode 100644 recipes/ignition-math/all/patches/0002-ign-math-6.10.0-cmake-fixes.patch create mode 100644 recipes/ignition-math/all/test_package/CMakeLists.txt create mode 100644 recipes/ignition-math/all/test_package/conanfile.py create mode 100644 recipes/ignition-math/all/test_package/test_package.cpp create mode 100644 recipes/ignition-math/config.yml create mode 100644 recipes/ignition-tools/all/CMakeLists.txt create mode 100644 recipes/ignition-tools/all/conandata.yml create mode 100644 recipes/ignition-tools/all/conanfile.py create mode 100644 recipes/ignition-tools/all/patches/0001-ign-tools-1.0.0-cmake-fixes.patch create mode 100644 recipes/ignition-tools/all/patches/0002-ign-tools-1.2.0-cmake-fixes.patch create mode 100644 recipes/ignition-tools/all/patches/0003-ign-tools-1.4.0-cmake-fixes.patch create mode 100644 recipes/ignition-tools/all/test_package/CMakeLists.txt create mode 100644 recipes/ignition-tools/all/test_package/conanfile.py create mode 100644 recipes/ignition-tools/all/test_package/test_package.cpp create mode 100644 recipes/ignition-tools/config.yml create mode 100644 recipes/ignition-utils/all/CMakeLists.txt create mode 100644 recipes/ignition-utils/all/conandata.yml create mode 100644 recipes/ignition-utils/all/conanfile.py create mode 100644 recipes/ignition-utils/all/patches/0001-ign-utils-1.3.0-cmake-fixes.patch create mode 100644 recipes/ignition-utils/all/test_package/CMakeLists.txt create mode 100644 recipes/ignition-utils/all/test_package/conanfile.py create mode 100644 recipes/ignition-utils/all/test_package/test_package.cpp create mode 100644 recipes/ignition-utils/config.yml create mode 100644 recipes/iir1/all/conandata.yml create mode 100644 recipes/iir1/all/conanfile.py create mode 100644 recipes/iir1/all/patches/1.9.0-0001-no-export-static-win.patch create mode 100644 recipes/iir1/all/patches/1.9.0-0002-Add-runtime-export-to-install.patch create mode 100644 recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch create mode 100644 recipes/iir1/all/test_package/CMakeLists.txt create mode 100644 recipes/iir1/all/test_package/conanfile.py create mode 100644 recipes/iir1/all/test_package/test_package.cpp create mode 100644 recipes/iir1/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/iir1/all/test_v1_package/conanfile.py create mode 100644 recipes/iir1/config.yml create mode 100644 recipes/im95able-rea/all/conandata.yml create mode 100644 recipes/im95able-rea/all/conanfile.py create mode 100644 recipes/im95able-rea/all/patches/0001-include-limits.patch create mode 100644 recipes/im95able-rea/all/test_package/CMakeLists.txt create mode 100644 recipes/im95able-rea/all/test_package/conanfile.py create mode 100644 recipes/im95able-rea/all/test_package/test_package.cpp create mode 100644 recipes/im95able-rea/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/im95able-rea/all/test_v1_package/conanfile.py create mode 100644 recipes/im95able-rea/config.yml create mode 100644 recipes/imagemagick/all/conandata.yml create mode 100644 recipes/imagemagick/all/conanfile.py create mode 100644 recipes/imagemagick/all/patches/remove-unnecessary-dependencies.patch create mode 100644 recipes/imagemagick/all/test_package/CMakeLists.txt create mode 100644 recipes/imagemagick/all/test_package/conanfile.py create mode 100644 recipes/imagemagick/all/test_package/test_package.c create mode 100644 recipes/imagemagick/config.yml create mode 100644 recipes/imagl/all/CMakeLists.txt create mode 100644 recipes/imagl/all/conandata.yml create mode 100644 recipes/imagl/all/conanfile.py create mode 100644 recipes/imagl/all/patches/0001-no-unmanaged-conan-0.1.x.patch create mode 100644 recipes/imagl/all/patches/0001-no-unmanaged-conan-0.2.1.patch create mode 100644 recipes/imagl/all/test_package/CMakeLists.txt create mode 100644 recipes/imagl/all/test_package/conanfile.py create mode 100644 recipes/imagl/all/test_package/example.cpp create mode 100644 recipes/imagl/config.yml create mode 100644 recipes/imake/all/conandata.yml create mode 100644 recipes/imake/all/conanfile.py create mode 100644 recipes/imake/all/patches/0001-reproducible-behavior.patch create mode 100644 recipes/imake/all/patches/0002-msvc-debug-build_type.patch create mode 100644 recipes/imake/all/test_package/Imake.tmpl create mode 100644 recipes/imake/all/test_package/Imakefile create mode 100644 recipes/imake/all/test_package/conanfile.py create mode 100644 recipes/imake/all/test_v1_package/Imake.tmpl create mode 100644 recipes/imake/all/test_v1_package/Imakefile create mode 100644 recipes/imake/all/test_v1_package/conanfile.py create mode 100644 recipes/imake/config.yml create mode 100644 recipes/imath/all/conandata.yml create mode 100644 recipes/imath/all/conanfile.py create mode 100644 recipes/imath/all/test_package/CMakeLists.txt create mode 100644 recipes/imath/all/test_package/conanfile.py create mode 100644 recipes/imath/all/test_package/test_package.cpp create mode 100644 recipes/imath/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/imath/all/test_v1_package/conanfile.py create mode 100644 recipes/imath/config.yml create mode 100644 recipes/imgui/all/CMakeLists.txt create mode 100644 recipes/imgui/all/conandata.yml create mode 100644 recipes/imgui/all/conanfile.py create mode 100644 recipes/imgui/all/test_package/CMakeLists.txt create mode 100644 recipes/imgui/all/test_package/conanfile.py create mode 100644 recipes/imgui/all/test_package/my_imgui_config.h create mode 100644 recipes/imgui/all/test_package/test_package.cpp create mode 100644 recipes/imgui/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/imgui/all/test_v1_package/conanfile.py create mode 100644 recipes/imgui/config.yml create mode 100644 recipes/imguizmo/all/CMakeLists.txt create mode 100644 recipes/imguizmo/all/conandata.yml create mode 100644 recipes/imguizmo/all/conanfile.py create mode 100644 recipes/imguizmo/all/test_package/CMakeLists.txt create mode 100644 recipes/imguizmo/all/test_package/conanfile.py create mode 100644 recipes/imguizmo/all/test_package/test_package.cpp create mode 100644 recipes/imguizmo/config.yml create mode 100644 recipes/immer/all/conandata.yml create mode 100644 recipes/immer/all/conanfile.py create mode 100644 recipes/immer/all/test_package/CMakeLists.txt create mode 100644 recipes/immer/all/test_package/conanfile.py create mode 100644 recipes/immer/all/test_package/example.cpp create mode 100644 recipes/immer/config.yml create mode 100644 recipes/implot/all/CMakeLists.txt create mode 100644 recipes/implot/all/conandata.yml create mode 100644 recipes/implot/all/conanfile.py create mode 100644 recipes/implot/all/test_package/CMakeLists.txt create mode 100644 recipes/implot/all/test_package/conanfile.py create mode 100644 recipes/implot/all/test_package/test_package.cpp create mode 100644 recipes/implot/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/implot/all/test_v1_package/conanfile.py create mode 100644 recipes/implot/config.yml create mode 100644 recipes/imutils-cpp/all/conandata.yml create mode 100644 recipes/imutils-cpp/all/conanfile.py create mode 100644 recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch create mode 100644 recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch create mode 100644 recipes/imutils-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/imutils-cpp/all/test_package/conanfile.py create mode 100644 recipes/imutils-cpp/all/test_package/test_package.cpp create mode 100644 recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/imutils-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/imutils-cpp/config.yml create mode 100644 recipes/incbin/all/conandata.yml create mode 100644 recipes/incbin/all/conanfile.py create mode 100644 recipes/incbin/all/test_package/CMakeLists.txt create mode 100644 recipes/incbin/all/test_package/conanfile.py create mode 100644 recipes/incbin/all/test_package/test_package.c create mode 100644 recipes/incbin/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/incbin/all/test_v1_package/conanfile.py create mode 100644 recipes/incbin/config.yml create mode 100644 recipes/indicators/all/conandata.yml create mode 100644 recipes/indicators/all/conanfile.py create mode 100644 recipes/indicators/all/test_package/CMakeLists.txt create mode 100644 recipes/indicators/all/test_package/conanfile.py create mode 100644 recipes/indicators/all/test_package/test_package.cpp create mode 100644 recipes/indicators/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/indicators/all/test_v1_package/conanfile.py create mode 100644 recipes/indicators/config.yml create mode 100644 recipes/indirect_value/all/conandata.yml create mode 100644 recipes/indirect_value/all/conanfile.py create mode 100644 recipes/indirect_value/all/test_package/CMakeLists.txt create mode 100644 recipes/indirect_value/all/test_package/conanfile.py create mode 100644 recipes/indirect_value/all/test_package/test_package.cpp create mode 100644 recipes/indirect_value/config.yml create mode 100644 recipes/influxdb-cpp/all/conandata.yml create mode 100644 recipes/influxdb-cpp/all/conanfile.py create mode 100644 recipes/influxdb-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/influxdb-cpp/all/test_package/conanfile.py create mode 100644 recipes/influxdb-cpp/all/test_package/example.cpp create mode 100644 recipes/influxdb-cpp/config.yml create mode 100644 recipes/inih/all/conandata.yml create mode 100644 recipes/inih/all/conanfile.py create mode 100644 recipes/inih/all/test_package/CMakeLists.txt create mode 100644 recipes/inih/all/test_package/conanfile.py create mode 100644 recipes/inih/all/test_package/test_package.c create mode 100644 recipes/inih/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/inih/all/test_v1_package/conanfile.py create mode 100644 recipes/inih/config.yml create mode 100644 recipes/inja/all/conandata.yml create mode 100644 recipes/inja/all/conanfile.py create mode 100644 recipes/inja/all/test_package/CMakeLists.txt create mode 100644 recipes/inja/all/test_package/conanfile.py create mode 100644 recipes/inja/all/test_package/test_package.cpp create mode 100644 recipes/inja/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/inja/all/test_v1_package/conanfile.py create mode 100644 recipes/inja/config.yml create mode 100644 recipes/innoextract/all/conandata.yml create mode 100644 recipes/innoextract/all/conanfile.py create mode 100644 recipes/innoextract/all/patches/0001-cmake-fix-module.patch create mode 100644 recipes/innoextract/all/patches/0002-remove-custom-cmake-find-modules.patch create mode 100644 recipes/innoextract/all/test_package/conanfile.py create mode 100644 recipes/innoextract/all/test_v1_package/conanfile.py create mode 100644 recipes/innoextract/config.yml create mode 100644 recipes/intel-neon2sse/all/conandata.yml create mode 100644 recipes/intel-neon2sse/all/conanfile.py create mode 100644 recipes/intel-neon2sse/all/test_package/CMakeLists.txt create mode 100644 recipes/intel-neon2sse/all/test_package/conanfile.py create mode 100644 recipes/intel-neon2sse/all/test_package/test_package.c create mode 100644 recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/intel-neon2sse/all/test_v1_package/conanfile.py create mode 100644 recipes/intel-neon2sse/config.yml create mode 100644 recipes/inversify-cpp/all/conandata.yml create mode 100644 recipes/inversify-cpp/all/conanfile.py create mode 100644 recipes/inversify-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/inversify-cpp/all/test_package/conanfile.py create mode 100644 recipes/inversify-cpp/all/test_package/test_package.cpp create mode 100644 recipes/inversify-cpp/config.yml create mode 100644 recipes/ios-cmake/all/cmake-wrapper create mode 100644 recipes/ios-cmake/all/conandata.yml create mode 100644 recipes/ios-cmake/all/conanfile.py create mode 100644 recipes/ios-cmake/all/test_package/conanfile.py create mode 100644 recipes/ios-cmake/config.yml create mode 100644 recipes/iqa/all/CMakeLists.txt create mode 100644 recipes/iqa/all/conandata.yml create mode 100644 recipes/iqa/all/conanfile.py create mode 100644 recipes/iqa/all/test_package/CMakeLists.txt create mode 100644 recipes/iqa/all/test_package/conanfile.py create mode 100644 recipes/iqa/all/test_package/test_package.c create mode 100644 recipes/iqa/config.yml create mode 100644 recipes/irrxml/all/CMakeLists.txt create mode 100644 recipes/irrxml/all/conandata.yml create mode 100644 recipes/irrxml/all/conanfile.py create mode 100644 recipes/irrxml/all/patches/1.2/irrtypes_debug_vs.patch create mode 100644 recipes/irrxml/all/test_package/CMakeLists.txt create mode 100644 recipes/irrxml/all/test_package/conanfile.py create mode 100644 recipes/irrxml/all/test_package/config.xml create mode 100644 recipes/irrxml/all/test_package/test_package.cpp create mode 100644 recipes/irrxml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/irrxml/all/test_v1_package/conanfile.py create mode 100644 recipes/irrxml/config.yml create mode 100644 recipes/isa-l/all/conandata.yml create mode 100644 recipes/isa-l/all/conanfile.py create mode 100644 recipes/isa-l/all/test_package/CMakeLists.txt create mode 100644 recipes/isa-l/all/test_package/conanfile.py create mode 100644 recipes/isa-l/all/test_package/test_package.cpp create mode 100644 recipes/isa-l/config.yml create mode 100644 recipes/isl/all/conandata.yml create mode 100644 recipes/isl/all/conanfile.py create mode 100644 recipes/isl/all/test_package/CMakeLists.txt create mode 100644 recipes/isl/all/test_package/conanfile.py create mode 100644 recipes/isl/all/test_package/test_package.c create mode 100644 recipes/isl/config.yml create mode 100644 recipes/iso8601lib/all/conandata.yml create mode 100644 recipes/iso8601lib/all/conanfile.py create mode 100644 recipes/iso8601lib/all/test_package/CMakeLists.txt create mode 100644 recipes/iso8601lib/all/test_package/conanfile.py create mode 100644 recipes/iso8601lib/all/test_package/test_package.cpp create mode 100644 recipes/iso8601lib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/iso8601lib/all/test_v1_package/conanfile.py create mode 100644 recipes/iso8601lib/config.yml create mode 100644 recipes/itk/all/CMakeLists.txt create mode 100644 recipes/itk/all/conandata.yml create mode 100644 recipes/itk/all/conanfile.py create mode 100644 recipes/itk/all/patches/0001-find-conan-packages.patch create mode 100644 recipes/itk/all/test_package/CMakeLists.txt create mode 100644 recipes/itk/all/test_package/conanfile.py create mode 100644 recipes/itk/all/test_package/test_package.cpp create mode 100644 recipes/itk/config.yml create mode 100644 recipes/itlib/all/conandata.yml create mode 100644 recipes/itlib/all/conanfile.py create mode 100644 recipes/itlib/all/test_package/CMakeLists.txt create mode 100644 recipes/itlib/all/test_package/conanfile.py create mode 100644 recipes/itlib/all/test_package/test_package.cpp create mode 100644 recipes/itlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/itlib/all/test_v1_package/conanfile.py create mode 100644 recipes/itlib/config.yml create mode 100644 recipes/ittapi/all/conandata.yml create mode 100644 recipes/ittapi/all/conanfile.py create mode 100644 recipes/ittapi/all/test_package/CMakeLists.txt create mode 100644 recipes/ittapi/all/test_package/conanfile.py create mode 100644 recipes/ittapi/all/test_package/test_package.cpp create mode 100644 recipes/ittapi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ittapi/all/test_v1_package/conanfile.py create mode 100644 recipes/ittapi/config.yml create mode 100644 recipes/ixwebsocket/all/conandata.yml create mode 100644 recipes/ixwebsocket/all/conanfile.py create mode 100644 recipes/ixwebsocket/all/test_package/CMakeLists.txt create mode 100644 recipes/ixwebsocket/all/test_package/conanfile.py create mode 100644 recipes/ixwebsocket/all/test_package/test_package.cpp create mode 100644 recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ixwebsocket/all/test_v1_package/conanfile.py create mode 100644 recipes/ixwebsocket/config.yml create mode 100644 recipes/jansson/all/conandata.yml create mode 100644 recipes/jansson/all/conanfile.py create mode 100644 recipes/jansson/all/test_package/CMakeLists.txt create mode 100644 recipes/jansson/all/test_package/conanfile.py create mode 100644 recipes/jansson/all/test_package/test_package.c create mode 100644 recipes/jansson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jansson/all/test_v1_package/conanfile.py create mode 100644 recipes/jansson/config.yml create mode 100644 recipes/jasper/all/conandata.yml create mode 100644 recipes/jasper/all/conanfile.py create mode 100644 recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch create mode 100644 recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch create mode 100644 recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch create mode 100644 recipes/jasper/all/test_package/CMakeLists.txt create mode 100644 recipes/jasper/all/test_package/conanfile.py create mode 100644 recipes/jasper/all/test_package/test_package.c create mode 100644 recipes/jasper/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jasper/all/test_v1_package/conanfile.py create mode 100644 recipes/jasper/config.yml create mode 100644 recipes/jbig/all/CMakeLists.txt create mode 100644 recipes/jbig/all/conandata.yml create mode 100644 recipes/jbig/all/conanfile.py create mode 100644 recipes/jbig/all/patches/0001-add-missing-export.patch create mode 100644 recipes/jbig/all/patches/0002-fix-msvc-export.patch create mode 100644 recipes/jbig/all/test_package/CMakeLists.txt create mode 100644 recipes/jbig/all/test_package/conanfile.py create mode 100644 recipes/jbig/all/test_package/test_package.c create mode 100644 recipes/jbig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jbig/all/test_v1_package/conanfile.py create mode 100644 recipes/jbig/config.yml create mode 100644 recipes/jeaiii-itoa/all/conandata.yml create mode 100644 recipes/jeaiii-itoa/all/conanfile.py create mode 100644 recipes/jeaiii-itoa/all/test_package/CMakeLists.txt create mode 100644 recipes/jeaiii-itoa/all/test_package/conanfile.py create mode 100644 recipes/jeaiii-itoa/all/test_package/test_package.cpp create mode 100644 recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jeaiii-itoa/all/test_v1_package/conanfile.py create mode 100644 recipes/jeaiii-itoa/config.yml create mode 100644 recipes/jemalloc/all/conandata.yml create mode 100644 recipes/jemalloc/all/conanfile.py create mode 100644 recipes/jemalloc/all/patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch create mode 100644 recipes/jemalloc/all/test_package/CMakeLists.txt create mode 100644 recipes/jemalloc/all/test_package/conanfile.py create mode 100644 recipes/jemalloc/all/test_package/test_package.cpp create mode 100644 recipes/jemalloc/config.yml create mode 100644 recipes/jerryscript/all/CMakeLists.txt create mode 100644 recipes/jerryscript/all/conandata.yml create mode 100644 recipes/jerryscript/all/conanfile.py create mode 100644 recipes/jerryscript/all/patches/0001-2.3.0-remove-werror.patch create mode 100644 recipes/jerryscript/all/patches/0002-2.4.0-remove-werror.patch create mode 100644 recipes/jerryscript/all/patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch create mode 100644 recipes/jerryscript/all/test_package/CMakeLists.txt create mode 100644 recipes/jerryscript/all/test_package/conanfile.py create mode 100644 recipes/jerryscript/all/test_package/test_package.c create mode 100644 recipes/jerryscript/config.yml create mode 100644 recipes/jfalcou-eve/all/conandata.yml create mode 100644 recipes/jfalcou-eve/all/conanfile.py create mode 100644 recipes/jfalcou-eve/all/test_package/CMakeLists.txt create mode 100644 recipes/jfalcou-eve/all/test_package/conanfile.py create mode 100644 recipes/jfalcou-eve/all/test_package/test_package.cpp create mode 100644 recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jfalcou-eve/all/test_v1_package/conanfile.py create mode 100644 recipes/jfalcou-eve/config.yml create mode 100644 recipes/jinja2cpp/all/CMakeLists.txt create mode 100644 recipes/jinja2cpp/all/conandata.yml create mode 100644 recipes/jinja2cpp/all/conanfile.py create mode 100644 recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch create mode 100644 recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch create mode 100644 recipes/jinja2cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/jinja2cpp/all/test_package/conanfile.py create mode 100644 recipes/jinja2cpp/all/test_package/test_package.cpp create mode 100644 recipes/jinja2cpp/config.yml create mode 100644 recipes/joltphysics/all/conandata.yml create mode 100644 recipes/joltphysics/all/conanfile.py create mode 100644 recipes/joltphysics/all/patches/0001-fix-cmake.patch create mode 100644 recipes/joltphysics/all/test_package/CMakeLists.txt create mode 100644 recipes/joltphysics/all/test_package/conanfile.py create mode 100644 recipes/joltphysics/all/test_package/test_package.cpp create mode 100644 recipes/joltphysics/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/joltphysics/all/test_v1_package/conanfile.py create mode 100644 recipes/joltphysics/config.yml create mode 100644 recipes/jom/all/conandata.yml create mode 100644 recipes/jom/all/conanfile.py create mode 100644 recipes/jom/all/test_package/conanfile.py create mode 100644 recipes/jom/all/test_v1_package/conanfile.py create mode 100644 recipes/jom/config.yml create mode 100644 recipes/jpcre2/all/conandata.yml create mode 100644 recipes/jpcre2/all/conanfile.py create mode 100644 recipes/jpcre2/all/test_package/CMakeLists.txt create mode 100644 recipes/jpcre2/all/test_package/conanfile.py create mode 100644 recipes/jpcre2/all/test_package/test_package.cpp create mode 100644 recipes/jpcre2/config.yml create mode 100644 recipes/jpeg-compressor/all/CMakeLists.txt create mode 100644 recipes/jpeg-compressor/all/conandata.yml create mode 100644 recipes/jpeg-compressor/all/conanfile.py create mode 100644 recipes/jpeg-compressor/all/patches/pr-18-remove-include-malloc.patch create mode 100644 recipes/jpeg-compressor/all/test_package/CMakeLists.txt create mode 100644 recipes/jpeg-compressor/all/test_package/conanfile.py create mode 100644 recipes/jpeg-compressor/all/test_package/test_package.cpp create mode 100644 recipes/jpeg-compressor/all/test_package/testimg.jpg create mode 100644 recipes/jpeg-compressor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jpeg-compressor/all/test_v1_package/conanfile.py create mode 100644 recipes/jpeg-compressor/config.yml create mode 100644 recipes/jsmn/all/conandata.yml create mode 100644 recipes/jsmn/all/conanfile.py create mode 100644 recipes/jsmn/all/test_package/CMakeLists.txt create mode 100644 recipes/jsmn/all/test_package/conanfile.py create mode 100644 recipes/jsmn/all/test_package/test_package.c create mode 100644 recipes/jsmn/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jsmn/all/test_v1_package/conanfile.py create mode 100644 recipes/jsmn/config.yml create mode 100644 recipes/json-c/all/conandata.yml create mode 100644 recipes/json-c/all/conanfile.py create mode 100644 recipes/json-c/all/test_package/CMakeLists.txt create mode 100644 recipes/json-c/all/test_package/conanfile.py create mode 100644 recipes/json-c/all/test_package/test_package.c create mode 100644 recipes/json-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/json-c/all/test_v1_package/conanfile.py create mode 100644 recipes/json-c/config.yml create mode 100644 recipes/json-schema-validator/all/conandata.yml create mode 100644 recipes/json-schema-validator/all/conanfile.py create mode 100644 recipes/json-schema-validator/all/patches/2.0.0-cmake_minimum_version.patch create mode 100644 recipes/json-schema-validator/all/patches/2.1.0-cmake_minimum_version.patch create mode 100644 recipes/json-schema-validator/all/patches/2.2.0-signed-char.patch create mode 100644 recipes/json-schema-validator/all/test_package/CMakeLists.txt create mode 100644 recipes/json-schema-validator/all/test_package/conanfile.py create mode 100644 recipes/json-schema-validator/all/test_package/test_package.cpp create mode 100644 recipes/json-schema-validator/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/json-schema-validator/all/test_v1_package/conanfile.py create mode 100644 recipes/json-schema-validator/config.yml create mode 100644 recipes/json_dto/all/conandata.yml create mode 100644 recipes/json_dto/all/conanfile.py create mode 100644 recipes/json_dto/all/test_package/CMakeLists.txt create mode 100644 recipes/json_dto/all/test_package/conanfile.py create mode 100644 recipes/json_dto/all/test_package/example.cpp create mode 100644 recipes/json_dto/config.yml create mode 100644 recipes/jsoncons/all/conandata.yml create mode 100644 recipes/jsoncons/all/conanfile.py create mode 100644 recipes/jsoncons/all/test_package/CMakeLists.txt create mode 100644 recipes/jsoncons/all/test_package/conanfile.py create mode 100644 recipes/jsoncons/all/test_package/test_package.cpp create mode 100644 recipes/jsoncons/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jsoncons/all/test_v1_package/conanfile.py create mode 100644 recipes/jsoncons/config.yml create mode 100644 recipes/jsoncpp/all/conandata.yml create mode 100644 recipes/jsoncpp/all/conanfile.py create mode 100644 recipes/jsoncpp/all/patches/dont-force-pic-1.9.1.patch create mode 100644 recipes/jsoncpp/all/patches/dont-force-pic-1.9.2.patch create mode 100644 recipes/jsoncpp/all/patches/dont-force-pic-1.9.3.patch create mode 100644 recipes/jsoncpp/all/patches/implicit-conversion-1.8.3.patch create mode 100644 recipes/jsoncpp/all/patches/implicit-conversion-1.9.1.patch create mode 100644 recipes/jsoncpp/all/patches/no-examples.patch create mode 100644 recipes/jsoncpp/all/test_package/CMakeLists.txt create mode 100644 recipes/jsoncpp/all/test_package/conanfile.py create mode 100644 recipes/jsoncpp/all/test_package/test_package.cpp create mode 100644 recipes/jsoncpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jsoncpp/all/test_v1_package/conanfile.py create mode 100644 recipes/jsoncpp/config.yml create mode 100644 recipes/jsonformoderncpp/all/conandata.yml create mode 100644 recipes/jsonformoderncpp/all/conanfile.py create mode 100644 recipes/jsonformoderncpp/all/test_package/CMakeLists.txt create mode 100644 recipes/jsonformoderncpp/all/test_package/conanfile.py create mode 100644 recipes/jsonformoderncpp/all/test_package/test_package.cpp create mode 100644 recipes/jsonformoderncpp/config.yml create mode 100644 recipes/jsonnet/all/CMakeLists.txt create mode 100644 recipes/jsonnet/all/conandata.yml create mode 100644 recipes/jsonnet/all/conanfile.py create mode 100644 recipes/jsonnet/all/patches/0.17.0/0001-fix-nlohmann-include.patch create mode 100644 recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch create mode 100644 recipes/jsonnet/all/patches/0.18.0/0001-fix-nlohmann-include.patch create mode 100644 recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch create mode 100644 recipes/jsonnet/all/test_package/CMakeLists.txt create mode 100644 recipes/jsonnet/all/test_package/conanfile.py create mode 100644 recipes/jsonnet/all/test_package/test_package.c create mode 100644 recipes/jsonnet/all/test_package/test_package.cpp create mode 100644 recipes/jsonnet/config.yml create mode 100644 recipes/jthread-lite/all/conandata.yml create mode 100644 recipes/jthread-lite/all/conanfile.py create mode 100644 recipes/jthread-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/jthread-lite/all/test_package/conanfile.py create mode 100644 recipes/jthread-lite/all/test_package/test_package.cpp create mode 100644 recipes/jthread-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jthread-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/jthread-lite/config.yml create mode 100644 recipes/jungle/all/CMakeLists.txt create mode 100644 recipes/jungle/all/conandata.yml create mode 100644 recipes/jungle/all/conanfile.py create mode 100644 recipes/jungle/all/patches/0001-cmake-alterations.patch create mode 100644 recipes/jungle/all/patches/0002-forestdb-path.patch create mode 100644 recipes/jungle/all/patches/0003-stdatomic.patch create mode 100644 recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch create mode 100644 recipes/jungle/all/test_package/CMakeLists.txt create mode 100644 recipes/jungle/all/test_package/conanfile.py create mode 100644 recipes/jungle/all/test_package/test_package.cpp create mode 100644 recipes/jungle/config.yml create mode 100644 recipes/jwasm/all/conandata.yml create mode 100644 recipes/jwasm/all/conanfile.py create mode 100644 recipes/jwasm/all/patches/0001-2.13-fix-fatal-errors-msvc.patch create mode 100644 recipes/jwasm/all/patches/0002-fix-cmake.patch create mode 100644 recipes/jwasm/all/test_package/Lin64_1.asm create mode 100644 recipes/jwasm/all/test_package/conanfile.py create mode 100644 recipes/jwasm/all/test_v1_package/conanfile.py create mode 100644 recipes/jwasm/config.yml create mode 100644 recipes/jwt-cpp/all/conandata.yml create mode 100644 recipes/jwt-cpp/all/conanfile.py create mode 100644 recipes/jwt-cpp/all/patches/0002-fix-openssl-change-version.patch create mode 100644 recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch create mode 100644 recipes/jwt-cpp/all/patches/0004-fix-picojson-header-location-for-conan.patch create mode 100644 recipes/jwt-cpp/all/patches/0005-fix-picojson-header-location-for-conan.patch create mode 100644 recipes/jwt-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/jwt-cpp/all/test_package/conanfile.py create mode 100644 recipes/jwt-cpp/all/test_package/test_package.cpp create mode 100644 recipes/jwt-cpp/all/test_package/traits/defaults.h create mode 100644 recipes/jwt-cpp/all/test_package/traits/traits.h create mode 100644 recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jwt-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/jwt-cpp/config.yml create mode 100644 recipes/jxrlib/all/CMakeLists.txt create mode 100644 recipes/jxrlib/all/conandata.yml create mode 100644 recipes/jxrlib/all/conanfile.py create mode 100644 recipes/jxrlib/all/patches/0001-missing-declarations.patch create mode 100644 recipes/jxrlib/all/test_package/CMakeLists.txt create mode 100644 recipes/jxrlib/all/test_package/conanfile.py create mode 100644 recipes/jxrlib/all/test_package/test.jxr create mode 100644 recipes/jxrlib/all/test_package/test_package.c create mode 100644 recipes/jxrlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jxrlib/all/test_v1_package/conanfile.py create mode 100644 recipes/jxrlib/config.yml create mode 100644 recipes/kainjow-mustache/all/conandata.yml create mode 100644 recipes/kainjow-mustache/all/conanfile.py create mode 100644 recipes/kainjow-mustache/all/test_package/CMakeLists.txt create mode 100644 recipes/kainjow-mustache/all/test_package/conanfile.py create mode 100644 recipes/kainjow-mustache/all/test_package/test_package.cpp create mode 100644 recipes/kainjow-mustache/config.yml create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/patches/0001-cmake-minimum-required.patch create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/test_package/conanfile.py create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/test_package/test_package.cpp create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py create mode 100644 recipes/kaitai_struct_cpp_stl_runtime/config.yml create mode 100644 recipes/kangaru/all/conandata.yml create mode 100644 recipes/kangaru/all/conanfile.py create mode 100644 recipes/kangaru/all/patches/fix-cmake.patch create mode 100644 recipes/kangaru/all/test_package/CMakeLists.txt create mode 100644 recipes/kangaru/all/test_package/conanfile.py create mode 100644 recipes/kangaru/all/test_package/test_package.cpp create mode 100644 recipes/kangaru/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/kangaru/all/test_v1_package/conanfile.py create mode 100644 recipes/kangaru/config.yml create mode 100644 recipes/kcov/all/CMakeLists.txt create mode 100644 recipes/kcov/all/conandata.yml create mode 100644 recipes/kcov/all/conanfile.py create mode 100644 recipes/kcov/all/patches/0001-fix-SOLIB-path.patch create mode 100644 recipes/kcov/all/patches/0002-fix-missing-libssl-dependency.patch create mode 100644 recipes/kcov/all/test_package/conanfile.py create mode 100644 recipes/kcov/config.yml create mode 100644 recipes/kcp/all/CMakeLists.txt create mode 100644 recipes/kcp/all/conandata.yml create mode 100644 recipes/kcp/all/conanfile.py create mode 100644 recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch create mode 100644 recipes/kcp/all/test_package/CMakeLists.txt create mode 100644 recipes/kcp/all/test_package/conanfile.py create mode 100644 recipes/kcp/all/test_package/test_package.cpp create mode 100644 recipes/kcp/config.yml create mode 100644 recipes/kealib/all/CMakeLists.txt create mode 100644 recipes/kealib/all/conandata.yml create mode 100644 recipes/kealib/all/conanfile.py create mode 100644 recipes/kealib/all/patches/fix-cmake-1.4.14.patch create mode 100644 recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch create mode 100644 recipes/kealib/all/test_package/CMakeLists.txt create mode 100644 recipes/kealib/all/test_package/conanfile.py create mode 100644 recipes/kealib/all/test_package/test_package.cpp create mode 100644 recipes/kealib/config.yml create mode 100644 recipes/keychain/all/CMakeLists.txt create mode 100644 recipes/keychain/all/conandata.yml create mode 100644 recipes/keychain/all/conanfile.py create mode 100644 recipes/keychain/all/test_package/CMakeLists.txt create mode 100644 recipes/keychain/all/test_package/conanfile.py create mode 100644 recipes/keychain/all/test_package/test_package.cpp create mode 100644 recipes/keychain/config.yml create mode 100644 recipes/khrplatform/all/conandata.yml create mode 100644 recipes/khrplatform/all/conanfile.py create mode 100644 recipes/khrplatform/all/test_package/CMakeLists.txt create mode 100644 recipes/khrplatform/all/test_package/conanfile.py create mode 100644 recipes/khrplatform/all/test_package/test_package.c create mode 100644 recipes/khrplatform/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/khrplatform/all/test_v1_package/conanfile.py create mode 100644 recipes/khrplatform/config.yml create mode 100644 recipes/kissfft/all/conandata.yml create mode 100644 recipes/kissfft/all/conanfile.py create mode 100644 recipes/kissfft/all/test_package/CMakeLists.txt create mode 100644 recipes/kissfft/all/test_package/conanfile.py create mode 100644 recipes/kissfft/all/test_package/test_package.c create mode 100644 recipes/kissfft/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/kissfft/all/test_v1_package/conanfile.py create mode 100644 recipes/kissfft/config.yml create mode 100644 recipes/kitten/all/CMakeLists.txt create mode 100644 recipes/kitten/all/conandata.yml create mode 100644 recipes/kitten/all/conanfile.py create mode 100644 recipes/kitten/all/test_package/CMakeLists.txt create mode 100644 recipes/kitten/all/test_package/conanfile.py create mode 100644 recipes/kitten/all/test_package/test_package.cpp create mode 100644 recipes/kitten/config.yml create mode 100644 recipes/kmod/all/conandata.yml create mode 100644 recipes/kmod/all/conanfile.py create mode 100644 recipes/kmod/all/test_package/CMakeLists.txt create mode 100644 recipes/kmod/all/test_package/conanfile.py create mode 100644 recipes/kmod/all/test_package/test_package.c create mode 100644 recipes/kmod/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/kmod/all/test_v1_package/conanfile.py create mode 100644 recipes/kmod/config.yml create mode 100644 recipes/kplot/all/CMakeLists.txt create mode 100644 recipes/kplot/all/conandata.yml create mode 100644 recipes/kplot/all/conanfile.py create mode 100644 recipes/kplot/all/test_package/CMakeLists.txt create mode 100644 recipes/kplot/all/test_package/conanfile.py create mode 100644 recipes/kplot/all/test_package/test_package.c create mode 100644 recipes/kplot/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/kplot/all/test_v1_package/conanfile.py create mode 100644 recipes/kplot/config.yml create mode 100644 recipes/ktx/all/conandata.yml create mode 100644 recipes/ktx/all/conanfile.py create mode 100644 recipes/ktx/all/patches/0001-objutil-cxx-std.patch create mode 100644 recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch create mode 100644 recipes/ktx/all/patches/0003-clamp-include-algorithm.patch create mode 100644 recipes/ktx/all/patches/0004-unvendor-dependencies.patch create mode 100644 recipes/ktx/all/test_package/CMakeLists.txt create mode 100644 recipes/ktx/all/test_package/conanfile.py create mode 100644 recipes/ktx/all/test_package/etc1.ktx create mode 100644 recipes/ktx/all/test_package/test_package.c create mode 100644 recipes/ktx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ktx/all/test_v1_package/conanfile.py create mode 100644 recipes/ktx/config.yml create mode 100644 recipes/kuba-zip/all/conandata.yml create mode 100644 recipes/kuba-zip/all/conanfile.py create mode 100644 recipes/kuba-zip/all/test_package/CMakeLists.txt create mode 100644 recipes/kuba-zip/all/test_package/conanfile.py create mode 100644 recipes/kuba-zip/all/test_package/test_package.c create mode 100644 recipes/kuba-zip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/kuba-zip/all/test_v1_package/conanfile.py create mode 100644 recipes/kuba-zip/config.yml create mode 100644 recipes/laszip/all/conandata.yml create mode 100644 recipes/laszip/all/conanfile.py create mode 100644 recipes/laszip/all/patches/0001-no-build-laszip-api.patch create mode 100644 recipes/laszip/all/patches/0002-no-rpath-and-relocatable-macos.patch create mode 100644 recipes/laszip/all/test_package/CMakeLists.txt create mode 100644 recipes/laszip/all/test_package/conanfile.py create mode 100644 recipes/laszip/all/test_package/test_package.c create mode 100644 recipes/laszip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/laszip/all/test_v1_package/conanfile.py create mode 100644 recipes/laszip/config.yml create mode 100644 recipes/lcms/all/conandata.yml create mode 100644 recipes/lcms/all/conanfile.py create mode 100644 recipes/lcms/all/patches/2.13.1-0001-fix-msvc-import-lib.patch create mode 100644 recipes/lcms/all/test_package/CMakeLists.txt create mode 100644 recipes/lcms/all/test_package/conanfile.py create mode 100644 recipes/lcms/all/test_package/test_package.c create mode 100644 recipes/lcms/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lcms/all/test_v1_package/conanfile.py create mode 100644 recipes/lcms/config.yml create mode 100644 recipes/ldns/all/conandata.yml create mode 100644 recipes/ldns/all/conanfile.py create mode 100644 recipes/ldns/all/test_package/CMakeLists.txt create mode 100644 recipes/ldns/all/test_package/conanfile.py create mode 100644 recipes/ldns/all/test_package/example.c create mode 100644 recipes/ldns/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ldns/all/test_v1_package/conanfile.py create mode 100644 recipes/ldns/config.yml create mode 100644 recipes/lely-core/all/conandata.yml create mode 100644 recipes/lely-core/all/conanfile.py create mode 100644 recipes/lely-core/all/test_package/CMakeLists.txt create mode 100644 recipes/lely-core/all/test_package/conanfile.py create mode 100644 recipes/lely-core/all/test_package/test_package.cpp create mode 100644 recipes/lely-core/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lely-core/all/test_v1_package/conanfile.py create mode 100644 recipes/lely-core/config.yml create mode 100644 recipes/lemon/all/CMakeLists.txt create mode 100644 recipes/lemon/all/conandata.yml create mode 100644 recipes/lemon/all/conanfile.py create mode 100644 recipes/lemon/all/patches/0001-use-executable-template-path.patch create mode 100644 recipes/lemon/all/test_package/CMakeLists.txt create mode 100644 recipes/lemon/all/test_package/conanfile.py create mode 100644 recipes/lemon/all/test_package/gram.y create mode 100644 recipes/lemon/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lemon/all/test_v1_package/conanfile.py create mode 100644 recipes/lemon/config.yml create mode 100644 recipes/leptonica/all/conandata.yml create mode 100644 recipes/leptonica/all/conanfile.py create mode 100644 recipes/leptonica/all/patches/fix-find-modules-variables.patch create mode 100644 recipes/leptonica/all/test_package/CMakeLists.txt create mode 100644 recipes/leptonica/all/test_package/conanfile.py create mode 100644 recipes/leptonica/all/test_package/test_package.c create mode 100644 recipes/leptonica/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/leptonica/all/test_v1_package/conanfile.py create mode 100644 recipes/leptonica/config.yml create mode 100644 recipes/lerc/all/conandata.yml create mode 100644 recipes/lerc/all/conanfile.py create mode 100644 recipes/lerc/all/patches/2.1-add-CMakeLists-and-static.patch create mode 100644 recipes/lerc/all/patches/4.0.0-include-algorithm.patch create mode 100644 recipes/lerc/all/test_package/CMakeLists.txt create mode 100644 recipes/lerc/all/test_package/conanfile.py create mode 100644 recipes/lerc/all/test_package/test_package.cpp create mode 100644 recipes/lerc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lerc/all/test_v1_package/conanfile.py create mode 100644 recipes/lerc/config.yml create mode 100644 recipes/lest/all/conandata.yml create mode 100644 recipes/lest/all/conanfile.py create mode 100644 recipes/lest/all/test_package/CMakeLists.txt create mode 100644 recipes/lest/all/test_package/conanfile.py create mode 100644 recipes/lest/all/test_package/test_package.cpp create mode 100644 recipes/lest/config.yml create mode 100644 recipes/leveldb/all/conandata.yml create mode 100644 recipes/leveldb/all/conanfile.py create mode 100644 recipes/leveldb/all/patches/check_library_exists.1.22.patch create mode 100644 recipes/leveldb/all/patches/check_library_exists.1.23.patch create mode 100644 recipes/leveldb/all/test_package/CMakeLists.txt create mode 100644 recipes/leveldb/all/test_package/conanfile.py create mode 100644 recipes/leveldb/all/test_package/test_package.cpp create mode 100644 recipes/leveldb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/leveldb/all/test_v1_package/conanfile.py create mode 100644 recipes/leveldb/config.yml create mode 100644 recipes/lexbor/all/conandata.yml create mode 100644 recipes/lexbor/all/conanfile.py create mode 100644 recipes/lexbor/all/test_package/CMakeLists.txt create mode 100644 recipes/lexbor/all/test_package/conanfile.py create mode 100644 recipes/lexbor/all/test_package/test_package.c create mode 100644 recipes/lexbor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lexbor/all/test_v1_package/conanfile.py create mode 100644 recipes/lexbor/config.yml create mode 100644 recipes/libaec/all/conandata.yml create mode 100644 recipes/libaec/all/conanfile.py create mode 100644 recipes/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch create mode 100644 recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch create mode 100644 recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch create mode 100644 recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch create mode 100644 recipes/libaec/all/test_package/CMakeLists.txt create mode 100644 recipes/libaec/all/test_package/conanfile.py create mode 100644 recipes/libaec/all/test_package/test_package.c create mode 100644 recipes/libaec/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libaec/all/test_v1_package/conanfile.py create mode 100644 recipes/libaec/config.yml create mode 100644 recipes/libaio/all/conandata.yml create mode 100644 recipes/libaio/all/conanfile.py create mode 100644 recipes/libaio/all/test_package/CMakeLists.txt create mode 100644 recipes/libaio/all/test_package/conanfile.py create mode 100644 recipes/libaio/all/test_package/test_package.c create mode 100644 recipes/libaio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libaio/all/test_v1_package/conanfile.py create mode 100644 recipes/libaio/config.yml create mode 100644 recipes/libalsa/all/conandata.yml create mode 100644 recipes/libalsa/all/conanfile.py create mode 100644 recipes/libalsa/all/patches/1.2.5.1-0001-control-empty-fix-the-static-build.patch create mode 100644 recipes/libalsa/all/test_package/CMakeLists.txt create mode 100644 recipes/libalsa/all/test_package/conanfile.py create mode 100644 recipes/libalsa/all/test_package/test_package.c create mode 100644 recipes/libalsa/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libalsa/all/test_v1_package/conanfile.py create mode 100644 recipes/libalsa/config.yml create mode 100644 recipes/libaom-av1/all/conandata.yml create mode 100644 recipes/libaom-av1/all/conanfile.py create mode 100644 recipes/libaom-av1/all/patches/0001-2.0.1-fix-install.patch create mode 100644 recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch create mode 100644 recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch create mode 100644 recipes/libaom-av1/all/patches/0001-3.4.0-fix-install.patch create mode 100644 recipes/libaom-av1/all/test_package/CMakeLists.txt create mode 100644 recipes/libaom-av1/all/test_package/conanfile.py create mode 100644 recipes/libaom-av1/all/test_package/test_package.c create mode 100644 recipes/libaom-av1/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libaom-av1/all/test_v1_package/conanfile.py create mode 100644 recipes/libaom-av1/config.yml create mode 100644 recipes/libarchive/all/conandata.yml create mode 100644 recipes/libarchive/all/conanfile.py create mode 100644 recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch create mode 100644 recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch create mode 100644 recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch create mode 100644 recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch create mode 100644 recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch create mode 100644 recipes/libarchive/all/patches/0003-3.4.0-cmake.patch create mode 100644 recipes/libarchive/all/patches/0003-3.4.3-cmake.patch create mode 100644 recipes/libarchive/all/patches/0003-3.5.2-cmake.patch create mode 100644 recipes/libarchive/all/patches/0003-3.6.0-cmake.patch create mode 100644 recipes/libarchive/all/patches/0003-3.6.2-cmake.patch create mode 100644 recipes/libarchive/all/patches/0004-3.6.0-android.patch create mode 100644 recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch create mode 100644 recipes/libarchive/all/test_package/CMakeLists.txt create mode 100644 recipes/libarchive/all/test_package/conanfile.py create mode 100644 recipes/libarchive/all/test_package/test_package.c create mode 100644 recipes/libarchive/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libarchive/all/test_v1_package/conanfile.py create mode 100644 recipes/libarchive/config.yml create mode 100644 recipes/libatomic_ops/all/conandata.yml create mode 100644 recipes/libatomic_ops/all/conanfile.py create mode 100644 recipes/libatomic_ops/all/test_package/CMakeLists.txt create mode 100644 recipes/libatomic_ops/all/test_package/conanfile.py create mode 100644 recipes/libatomic_ops/all/test_package/test_package.c create mode 100644 recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libatomic_ops/all/test_v1_package/conanfile.py create mode 100644 recipes/libatomic_ops/config.yml create mode 100644 recipes/libattr/all/conandata.yml create mode 100644 recipes/libattr/all/conanfile.py create mode 100644 recipes/libattr/all/test_package/CMakeLists.txt create mode 100644 recipes/libattr/all/test_package/conanfile.py create mode 100644 recipes/libattr/all/test_package/test_package.c create mode 100644 recipes/libattr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libattr/all/test_v1_package/conanfile.py create mode 100644 recipes/libattr/config.yml create mode 100644 recipes/libavif/all/conandata.yml create mode 100644 recipes/libavif/all/conanfile.py create mode 100644 recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch create mode 100644 recipes/libavif/all/patches/0.9.3-0001-disable-developer-only-codepaths.patch create mode 100644 recipes/libavif/all/patches/0.9.3-0002-fix-libyuv-version-handling.patch create mode 100644 recipes/libavif/all/test_package/CMakeLists.txt create mode 100644 recipes/libavif/all/test_package/conanfile.py create mode 100644 recipes/libavif/all/test_package/test_package.c create mode 100644 recipes/libavif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libavif/all/test_v1_package/conanfile.py create mode 100644 recipes/libavif/config.yml create mode 100644 recipes/libavrocpp/all/conandata.yml create mode 100644 recipes/libavrocpp/all/conanfile.py create mode 100644 recipes/libavrocpp/all/patches/0001-add-iterator-include-1-11-0.patch create mode 100644 recipes/libavrocpp/all/patches/0001-add-iterator-include.patch create mode 100644 recipes/libavrocpp/all/patches/0002-disable-tests-1-10-1.patch create mode 100644 recipes/libavrocpp/all/patches/0002-disable-tests-1-10-2.patch create mode 100644 recipes/libavrocpp/all/patches/0002-disable-tests-1-11-0.patch create mode 100644 recipes/libavrocpp/all/patches/0002-disable-tests-1-11-1.patch create mode 100644 recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage-1-11-0.patch create mode 100644 recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage.patch create mode 100644 recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-1.patch create mode 100644 recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-2.patch create mode 100644 recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-0.patch create mode 100644 recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-1.patch create mode 100644 recipes/libavrocpp/all/patches/0005-fix-breaking-include-1-11-1.patch create mode 100644 recipes/libavrocpp/all/test_package/CMakeLists.txt create mode 100644 recipes/libavrocpp/all/test_package/conanfile.py create mode 100644 recipes/libavrocpp/all/test_package/test_package.cpp create mode 100644 recipes/libavrocpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libavrocpp/all/test_v1_package/conanfile.py create mode 100644 recipes/libavrocpp/config.yml create mode 100644 recipes/libb2/all/CMakeLists.txt create mode 100644 recipes/libb2/all/conandata.yml create mode 100644 recipes/libb2/all/conanfile.py create mode 100644 recipes/libb2/all/test_package/CMakeLists.txt create mode 100644 recipes/libb2/all/test_package/conanfile.py create mode 100644 recipes/libb2/all/test_package/example.cpp create mode 100644 recipes/libb2/config.yml create mode 100644 recipes/libbacktrace/all/conandata.yml create mode 100644 recipes/libbacktrace/all/conanfile.py create mode 100644 recipes/libbacktrace/all/patches/0001-pointer-arithmetic.patch create mode 100644 recipes/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch create mode 100644 recipes/libbacktrace/all/test_package/CMakeLists.txt create mode 100644 recipes/libbacktrace/all/test_package/conanfile.py create mode 100644 recipes/libbacktrace/all/test_package/test_package.c create mode 100644 recipes/libbacktrace/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbacktrace/all/test_v1_package/conanfile.py create mode 100644 recipes/libbacktrace/config.yml create mode 100644 recipes/libbasisu/all/CMakeLists.txt create mode 100644 recipes/libbasisu/all/conandata.yml create mode 100644 recipes/libbasisu/all/conanfile.py create mode 100644 recipes/libbasisu/all/patches/cmakelist_build_lib.patch create mode 100644 recipes/libbasisu/all/test_package/CMakeLists.txt create mode 100644 recipes/libbasisu/all/test_package/conanfile.py create mode 100644 recipes/libbasisu/all/test_package/test_package.cpp create mode 100644 recipes/libbasisu/config.yml create mode 100644 recipes/libbigwig/all/conandata.yml create mode 100644 recipes/libbigwig/all/conanfile.py create mode 100644 recipes/libbigwig/all/test_package/CMakeLists.txt create mode 100644 recipes/libbigwig/all/test_package/conanfile.py create mode 100644 recipes/libbigwig/all/test_package/test_package.c create mode 100644 recipes/libbigwig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbigwig/all/test_v1_package/conanfile.py create mode 100644 recipes/libbigwig/config.yml create mode 100644 recipes/libbpf/all/conandata.yml create mode 100644 recipes/libbpf/all/conanfile.py create mode 100644 recipes/libbpf/all/test_package/CMakeLists.txt create mode 100644 recipes/libbpf/all/test_package/conanfile.py create mode 100644 recipes/libbpf/all/test_package/test_package.c create mode 100644 recipes/libbpf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbpf/all/test_v1_package/conanfile.py create mode 100644 recipes/libbpf/config.yml create mode 100644 recipes/libbsd/all/conandata.yml create mode 100644 recipes/libbsd/all/conanfile.py create mode 100644 recipes/libbsd/all/patches/0001-support-macosx.patch create mode 100644 recipes/libbsd/all/test_package/CMakeLists.txt create mode 100644 recipes/libbsd/all/test_package/conanfile.py create mode 100644 recipes/libbsd/all/test_package/test_package.c create mode 100644 recipes/libbsd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbsd/all/test_v1_package/conanfile.py create mode 100644 recipes/libbsd/config.yml create mode 100644 recipes/libcap/all/conandata.yml create mode 100644 recipes/libcap/all/conanfile.py create mode 100644 recipes/libcap/all/patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch create mode 100644 recipes/libcap/all/patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch create mode 100644 recipes/libcap/all/patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch create mode 100644 recipes/libcap/all/patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch create mode 100644 recipes/libcap/all/test_package/CMakeLists.txt create mode 100644 recipes/libcap/all/test_package/conanfile.py create mode 100644 recipes/libcap/all/test_package/test_package.c create mode 100644 recipes/libcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcap/all/test_v1_package/conanfile.py create mode 100644 recipes/libcap/config.yml create mode 100644 recipes/libcbor/all/conandata.yml create mode 100644 recipes/libcbor/all/conanfile.py create mode 100644 recipes/libcbor/all/patches/0.7.0/001_fix_shared_build.patch create mode 100644 recipes/libcbor/all/patches/0.7.0/002_fix_cmake_module_path.patch create mode 100644 recipes/libcbor/all/test_package/CMakeLists.txt create mode 100644 recipes/libcbor/all/test_package/conanfile.py create mode 100644 recipes/libcbor/all/test_package/test_package.c create mode 100644 recipes/libcbor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcbor/all/test_v1_package/conanfile.py create mode 100644 recipes/libcbor/config.yml create mode 100644 recipes/libccd/all/conandata.yml create mode 100644 recipes/libccd/all/conanfile.py create mode 100644 recipes/libccd/all/test_package/CMakeLists.txt create mode 100644 recipes/libccd/all/test_package/conanfile.py create mode 100644 recipes/libccd/all/test_package/test_package.c create mode 100644 recipes/libccd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libccd/all/test_v1_package/conanfile.py create mode 100644 recipes/libccd/config.yml create mode 100644 recipes/libcds/all/conandata.yml create mode 100644 recipes/libcds/all/conanfile.py create mode 100644 recipes/libcds/all/patches/fix-cmake.patch create mode 100644 recipes/libcds/all/test_package/CMakeLists.txt create mode 100644 recipes/libcds/all/test_package/conanfile.py create mode 100644 recipes/libcds/all/test_package/test_package.cpp create mode 100644 recipes/libcds/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcds/all/test_v1_package/conanfile.py create mode 100644 recipes/libcds/config.yml create mode 100644 recipes/libcheck/all/CMakeLists.txt create mode 100644 recipes/libcheck/all/conandata.yml create mode 100644 recipes/libcheck/all/conanfile.py create mode 100644 recipes/libcheck/all/patches/0001-remove-check-h-header.patch create mode 100644 recipes/libcheck/all/patches/0002-disable-cmake-subproject-check.patch create mode 100644 recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch create mode 100644 recipes/libcheck/all/patches/0004-install-shared-static-exclusive.patch create mode 100644 recipes/libcheck/all/patches/0005-add-missing-lib-pthread_mutex-c.patch create mode 100644 recipes/libcheck/all/test_package/CMakeLists.txt create mode 100644 recipes/libcheck/all/test_package/conanfile.py create mode 100644 recipes/libcheck/all/test_package/test_package.c create mode 100644 recipes/libcheck/config.yml create mode 100644 recipes/libcoap/all/CMakeLists.txt create mode 100644 recipes/libcoap/all/conandata.yml create mode 100644 recipes/libcoap/all/conanfile.py create mode 100644 recipes/libcoap/all/test_package/CMakeLists.txt create mode 100644 recipes/libcoap/all/test_package/conanfile.py create mode 100644 recipes/libcoap/all/test_package/test_package.cpp create mode 100644 recipes/libcoap/config.yml create mode 100644 recipes/libconfig/all/conandata.yml create mode 100644 recipes/libconfig/all/conanfile.py create mode 100644 recipes/libconfig/all/test_package/CMakeLists.txt create mode 100644 recipes/libconfig/all/test_package/conanfile.py create mode 100644 recipes/libconfig/all/test_package/test_package.c create mode 100644 recipes/libconfig/all/test_package/test_package.cpp create mode 100644 recipes/libconfig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libconfig/all/test_v1_package/conanfile.py create mode 100644 recipes/libconfig/config.yml create mode 100644 recipes/libconfuse/all/conandata.yml create mode 100644 recipes/libconfuse/all/conanfile.py create mode 100644 recipes/libconfuse/all/test_package/CMakeLists.txt create mode 100644 recipes/libconfuse/all/test_package/conanfile.py create mode 100644 recipes/libconfuse/all/test_package/hello.conf create mode 100644 recipes/libconfuse/all/test_package/test_package.c create mode 100644 recipes/libconfuse/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libconfuse/all/test_v1_package/conanfile.py create mode 100644 recipes/libconfuse/config.yml create mode 100644 recipes/libcoro/all/conandata.yml create mode 100644 recipes/libcoro/all/conanfile.py create mode 100644 recipes/libcoro/all/patches/allow-shared-lib.patch create mode 100644 recipes/libcoro/all/patches/disable-git-config.patch create mode 100644 recipes/libcoro/all/patches/fix-dependencies.patch create mode 100644 recipes/libcoro/all/test_package/CMakeLists.txt create mode 100644 recipes/libcoro/all/test_package/conanfile.py create mode 100644 recipes/libcoro/all/test_package/test_package.cpp create mode 100644 recipes/libcoro/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcoro/all/test_v1_package/conanfile.py create mode 100644 recipes/libcoro/config.yml create mode 100644 recipes/libcorrect/all/conandata.yml create mode 100644 recipes/libcorrect/all/conanfile.py create mode 100644 recipes/libcorrect/all/patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch create mode 100644 recipes/libcorrect/all/patches/0002-Export-symbols-for-windows.patch create mode 100644 recipes/libcorrect/all/test_package/CMakeLists.txt create mode 100644 recipes/libcorrect/all/test_package/conanfile.py create mode 100644 recipes/libcorrect/all/test_package/test_package.c create mode 100644 recipes/libcorrect/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcorrect/all/test_v1_package/conanfile.py create mode 100644 recipes/libcorrect/config.yml create mode 100644 recipes/libcpuid/all/CMakeLists.txt create mode 100644 recipes/libcpuid/all/conandata.yml create mode 100644 recipes/libcpuid/all/conanfile.py create mode 100644 recipes/libcpuid/all/patches/0.5.0-cmake-fixes.patch create mode 100644 recipes/libcpuid/all/test_package/CMakeLists.txt create mode 100644 recipes/libcpuid/all/test_package/conanfile.py create mode 100644 recipes/libcpuid/all/test_package/test_package.c create mode 100644 recipes/libcpuid/config.yml create mode 100644 recipes/libcuckoo/all/conandata.yml create mode 100644 recipes/libcuckoo/all/conanfile.py create mode 100644 recipes/libcuckoo/all/test_package/CMakeLists.txt create mode 100644 recipes/libcuckoo/all/test_package/conanfile.py create mode 100644 recipes/libcuckoo/all/test_package/test_package.cpp create mode 100644 recipes/libcuckoo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcuckoo/all/test_v1_package/conanfile.py create mode 100644 recipes/libcuckoo/config.yml create mode 100644 recipes/libcurl/all/conandata.yml create mode 100644 recipes/libcurl/all/conanfile.py create mode 100644 recipes/libcurl/all/lib_Makefile_add.am create mode 100644 recipes/libcurl/all/patches/004-no-checksrc.patch create mode 100644 recipes/libcurl/all/test_package/CMakeLists.txt create mode 100644 recipes/libcurl/all/test_package/conanfile.py create mode 100644 recipes/libcurl/all/test_package/test_package.c create mode 100644 recipes/libcurl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcurl/all/test_v1_package/conanfile.py create mode 100644 recipes/libcurl/config.yml create mode 100644 recipes/libdaemon/all/conandata.yml create mode 100644 recipes/libdaemon/all/conanfile.py create mode 100644 recipes/libdaemon/all/test_package/CMakeLists.txt create mode 100644 recipes/libdaemon/all/test_package/conanfile.py create mode 100644 recipes/libdaemon/all/test_package/test_package.c create mode 100644 recipes/libdaemon/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdaemon/all/test_v1_package/conanfile.py create mode 100644 recipes/libdaemon/config.yml create mode 100644 recipes/libdb/all/conandata.yml create mode 100644 recipes/libdb/all/conanfile.py create mode 100644 recipes/libdb/all/patches/0001-rename_atomic_compare_exchange.patch create mode 100644 recipes/libdb/all/patches/0002-no-conditional-tcl-include.patch create mode 100644 recipes/libdb/all/patches/0003-msvc-db_tcl-add-static-configuration.patch create mode 100644 recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch create mode 100644 recipes/libdb/all/test_package/CMakeLists.txt create mode 100644 recipes/libdb/all/test_package/conanfile.py create mode 100644 recipes/libdb/all/test_package/test_package.c create mode 100644 recipes/libdb/config.yml create mode 100644 recipes/libdc1394/all/conandata.yml create mode 100644 recipes/libdc1394/all/conanfile.py create mode 100644 recipes/libdc1394/all/test_package/CMakeLists.txt create mode 100644 recipes/libdc1394/all/test_package/conanfile.py create mode 100644 recipes/libdc1394/all/test_package/test_package.c create mode 100644 recipes/libdc1394/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdc1394/all/test_v1_package/conanfile.py create mode 100644 recipes/libdc1394/config.yml create mode 100644 recipes/libde265/all/conandata.yml create mode 100644 recipes/libde265/all/conanfile.py create mode 100644 recipes/libde265/all/patches/0001-optional-sdl.patch create mode 100644 recipes/libde265/all/patches/0002-fix-out-of-source-build.patch create mode 100644 recipes/libde265/all/test_package/CMakeLists.txt create mode 100644 recipes/libde265/all/test_package/conanfile.py create mode 100644 recipes/libde265/all/test_package/test_package.c create mode 100644 recipes/libde265/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libde265/all/test_v1_package/conanfile.py create mode 100644 recipes/libde265/config.yml create mode 100644 recipes/libdeflate/all/conandata.yml create mode 100644 recipes/libdeflate/all/conanfile.py create mode 100644 recipes/libdeflate/all/test_package/CMakeLists.txt create mode 100644 recipes/libdeflate/all/test_package/conanfile.py create mode 100644 recipes/libdeflate/all/test_package/test_package.c create mode 100644 recipes/libdeflate/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdeflate/all/test_v1_package/conanfile.py create mode 100644 recipes/libdeflate/config.yml create mode 100644 recipes/libdeflate/pre_1.15/conandata.yml create mode 100644 recipes/libdeflate/pre_1.15/conanfile.py create mode 100644 recipes/libdeflate/pre_1.15/patches/1.12-0001-fix-makefiles.patch create mode 100644 recipes/libdeflate/pre_1.15/patches/1.14-0001-fix-makefiles.patch create mode 100644 recipes/libdeflate/pre_1.15/patches/1.7-0001-fix-makefiles.patch create mode 100644 recipes/libdeflate/pre_1.15/patches/1.9-0001-fix-makefiles.patch create mode 100644 recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt create mode 100644 recipes/libdeflate/pre_1.15/test_package/conanfile.py create mode 100644 recipes/libdeflate/pre_1.15/test_package/test_package.c create mode 100644 recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py create mode 100644 recipes/libdisasm/all/conandata.yml create mode 100644 recipes/libdisasm/all/conanfile.py create mode 100644 recipes/libdisasm/all/patches/0001-fix-size-of-void.patch create mode 100644 recipes/libdisasm/all/patches/0002-only-build-libdisasm-by-default.patch create mode 100644 recipes/libdisasm/all/patches/0003-libdisasm-no-undefined.patch create mode 100644 recipes/libdisasm/all/test_package/CMakeLists.txt create mode 100644 recipes/libdisasm/all/test_package/conanfile.py create mode 100644 recipes/libdisasm/all/test_package/test_package.c create mode 100644 recipes/libdisasm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdisasm/all/test_v1_package/conanfile.py create mode 100644 recipes/libdisasm/config.yml create mode 100644 recipes/libdispatch/all/CMakeLists.txt create mode 100644 recipes/libdispatch/all/conandata.yml create mode 100644 recipes/libdispatch/all/conanfile.py create mode 100644 recipes/libdispatch/all/test_package/CMakeLists.txt create mode 100644 recipes/libdispatch/all/test_package/conanfile.py create mode 100644 recipes/libdispatch/all/test_package/test_package.cpp create mode 100644 recipes/libdispatch/config.yml create mode 100644 recipes/libdivide/all/conandata.yml create mode 100644 recipes/libdivide/all/conanfile.py create mode 100644 recipes/libdivide/all/test_package/CMakeLists.txt create mode 100644 recipes/libdivide/all/test_package/conanfile.py create mode 100644 recipes/libdivide/all/test_package/test_package.c create mode 100644 recipes/libdivide/all/test_package/test_package.cpp create mode 100644 recipes/libdivide/config.yml create mode 100644 recipes/libdmtx/all/conandata.yml create mode 100644 recipes/libdmtx/all/conanfile.py create mode 100644 recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch create mode 100644 recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch create mode 100644 recipes/libdmtx/all/test_package/CMakeLists.txt create mode 100644 recipes/libdmtx/all/test_package/conanfile.py create mode 100644 recipes/libdmtx/all/test_package/test_package.c create mode 100644 recipes/libdmtx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdmtx/all/test_v1_package/conanfile.py create mode 100644 recipes/libdmtx/config.yml create mode 100644 recipes/libdrm/all/conandata.yml create mode 100644 recipes/libdrm/all/conanfile.py create mode 100644 recipes/libdrm/all/test_package/CMakeLists.txt create mode 100644 recipes/libdrm/all/test_package/conanfile.py create mode 100644 recipes/libdrm/all/test_package/test_package.c create mode 100644 recipes/libdrm/config.yml create mode 100644 recipes/libdwarf/all/conandata.yml create mode 100644 recipes/libdwarf/all/conanfile.py create mode 100644 recipes/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch create mode 100644 recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch create mode 100644 recipes/libdwarf/all/patches/20191104-0001-patch.patch create mode 100644 recipes/libdwarf/all/test_package/CMakeLists.txt create mode 100644 recipes/libdwarf/all/test_package/conanfile.py create mode 100644 recipes/libdwarf/all/test_package/test_package.c create mode 100644 recipes/libdwarf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdwarf/all/test_v1_package/conanfile.py create mode 100644 recipes/libdwarf/config.yml create mode 100644 recipes/libdxfrw/all/conandata.yml create mode 100644 recipes/libdxfrw/all/conanfile.py create mode 100644 recipes/libdxfrw/all/test_package/CMakeLists.txt create mode 100644 recipes/libdxfrw/all/test_package/conanfile.py create mode 100644 recipes/libdxfrw/all/test_package/test_package.cpp create mode 100644 recipes/libdxfrw/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdxfrw/all/test_v1_package/conanfile.py create mode 100644 recipes/libdxfrw/config.yml create mode 100644 recipes/libe57format/all/conandata.yml create mode 100644 recipes/libe57format/all/conanfile.py create mode 100644 recipes/libe57format/all/patches/0001-fix-pic.patch create mode 100644 recipes/libe57format/all/patches/0002-missing-include.patch create mode 100644 recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch create mode 100644 recipes/libe57format/all/test_package/CMakeLists.txt create mode 100644 recipes/libe57format/all/test_package/conanfile.py create mode 100644 recipes/libe57format/all/test_package/test_package.cpp create mode 100644 recipes/libe57format/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libe57format/all/test_v1_package/conanfile.py create mode 100644 recipes/libe57format/config.yml create mode 100644 recipes/libelf/all/CMakeLists.txt create mode 100644 recipes/libelf/all/conandata.yml create mode 100644 recipes/libelf/all/conanfile.py create mode 100644 recipes/libelf/all/test_package/CMakeLists.txt create mode 100644 recipes/libelf/all/test_package/conanfile.py create mode 100644 recipes/libelf/all/test_package/test_package.c create mode 100644 recipes/libelf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libelf/all/test_v1_package/conanfile.py create mode 100644 recipes/libelf/config.yml create mode 100644 recipes/libelfin/all/CMakeLists.txt create mode 100644 recipes/libelfin/all/conandata.yml create mode 100644 recipes/libelfin/all/conanfile.py create mode 100644 recipes/libelfin/all/patches/commit-9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch create mode 100644 recipes/libelfin/all/patches/const-fix.patch create mode 100644 recipes/libelfin/all/test_package/CMakeLists.txt create mode 100644 recipes/libelfin/all/test_package/Makefile create mode 100644 recipes/libelfin/all/test_package/conanfile.py create mode 100644 recipes/libelfin/all/test_package/hello create mode 100644 recipes/libelfin/all/test_package/hello.asm create mode 100644 recipes/libelfin/all/test_package/test_package.cpp create mode 100644 recipes/libelfin/config.yml create mode 100644 recipes/libepoxy/all/conandata.yml create mode 100644 recipes/libepoxy/all/conanfile.py create mode 100644 recipes/libepoxy/all/patches/0001-fix-for-building-on-non-English-locale.patch create mode 100644 recipes/libepoxy/all/test_package/CMakeLists.txt create mode 100644 recipes/libepoxy/all/test_package/conanfile.py create mode 100644 recipes/libepoxy/all/test_package/test_package.c create mode 100644 recipes/libepoxy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libepoxy/all/test_v1_package/conanfile.py create mode 100644 recipes/libepoxy/config.yml create mode 100644 recipes/libest/all/conandata.yml create mode 100644 recipes/libest/all/conanfile.py create mode 100644 recipes/libest/all/patches/0001-examples-are-broken-don-t-build-them.patch create mode 100644 recipes/libest/all/patches/0002-add-extern.patch create mode 100644 recipes/libest/all/test_package/CMakeLists.txt create mode 100644 recipes/libest/all/test_package/conanfile.py create mode 100644 recipes/libest/all/test_package/example.c create mode 100644 recipes/libest/config.yml create mode 100644 recipes/libev/all/CMakeLists.txt create mode 100644 recipes/libev/all/conandata.yml create mode 100644 recipes/libev/all/conanfile.py create mode 100644 recipes/libev/all/config.h create mode 100644 recipes/libev/all/test_package/CMakeLists.txt create mode 100644 recipes/libev/all/test_package/conanfile.py create mode 100644 recipes/libev/all/test_package/test_package.c create mode 100644 recipes/libev/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libev/all/test_v1_package/conanfile.py create mode 100644 recipes/libev/config.yml create mode 100644 recipes/libevent/all/conandata.yml create mode 100644 recipes/libevent/all/conanfile.py create mode 100644 recipes/libevent/all/patches/fix-cmake-2.1.11.patch create mode 100644 recipes/libevent/all/patches/fix-cmake-2.1.12.patch create mode 100644 recipes/libevent/all/test_package/CMakeLists.txt create mode 100644 recipes/libevent/all/test_package/conanfile.py create mode 100644 recipes/libevent/all/test_package/test_package.c create mode 100644 recipes/libevent/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libevent/all/test_v1_package/conanfile.py create mode 100644 recipes/libevent/config.yml create mode 100644 recipes/libexif/all/conandata.yml create mode 100644 recipes/libexif/all/conanfile.py create mode 100644 recipes/libexif/all/patches/replace_ssize_t_windows.patch create mode 100644 recipes/libexif/all/test_package/CMakeLists.txt create mode 100644 recipes/libexif/all/test_package/conanfile.py create mode 100644 recipes/libexif/all/test_package/test_package.c create mode 100644 recipes/libexif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libexif/all/test_v1_package/conanfile.py create mode 100644 recipes/libexif/config.yml create mode 100644 recipes/libfabric/all/conandata.yml create mode 100644 recipes/libfabric/all/conanfile.py create mode 100644 recipes/libfabric/all/test_package/CMakeLists.txt create mode 100644 recipes/libfabric/all/test_package/conanfile.py create mode 100644 recipes/libfabric/all/test_package/test_package.cpp create mode 100644 recipes/libfabric/config.yml create mode 100644 recipes/libfdk_aac/all/conandata.yml create mode 100644 recipes/libfdk_aac/all/conanfile.py create mode 100644 recipes/libfdk_aac/all/test_package/CMakeLists.txt create mode 100644 recipes/libfdk_aac/all/test_package/conanfile.py create mode 100644 recipes/libfdk_aac/all/test_package/test_package.c create mode 100644 recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libfdk_aac/all/test_v1_package/conanfile.py create mode 100644 recipes/libfdk_aac/config.yml create mode 100644 recipes/libffi/all/conandata.yml create mode 100644 recipes/libffi/all/conanfile.py create mode 100644 recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch create mode 100644 recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0006-3.4.4-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch create mode 100644 recipes/libffi/all/test_package/CMakeLists.txt create mode 100644 recipes/libffi/all/test_package/conanfile.py create mode 100644 recipes/libffi/all/test_package/test_package.c create mode 100644 recipes/libffi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libffi/all/test_v1_package/conanfile.py create mode 100644 recipes/libffi/config.yml create mode 100644 recipes/libfreenect/all/conandata.yml create mode 100644 recipes/libfreenect/all/conanfile.py create mode 100644 recipes/libfreenect/all/patches/0.6.2-fix-cmake.patch create mode 100644 recipes/libfreenect/all/test_package/CMakeLists.txt create mode 100644 recipes/libfreenect/all/test_package/conanfile.py create mode 100644 recipes/libfreenect/all/test_package/test_package.c create mode 100644 recipes/libfreenect/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libfreenect/all/test_v1_package/conanfile.py create mode 100644 recipes/libfreenect/config.yml create mode 100644 recipes/libfreenect2/all/CMakeLists.txt create mode 100644 recipes/libfreenect2/all/conandata.yml create mode 100644 recipes/libfreenect2/all/conanfile.py create mode 100644 recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch create mode 100644 recipes/libfreenect2/all/patches/0.2.1-generate-resources.patch create mode 100644 recipes/libfreenect2/all/test_package/CMakeLists.txt create mode 100644 recipes/libfreenect2/all/test_package/conanfile.py create mode 100644 recipes/libfreenect2/all/test_package/test_package.cpp create mode 100644 recipes/libfreenect2/config.yml create mode 100644 recipes/libftdi/0.x/CMakeLists.txt create mode 100644 recipes/libftdi/0.x/conandata.yml create mode 100644 recipes/libftdi/0.x/conanfile.py create mode 100644 recipes/libftdi/0.x/patches/0001-cmake-fixes.patch create mode 100644 recipes/libftdi/0.x/test_package/CMakeLists.txt create mode 100644 recipes/libftdi/0.x/test_package/conanfile.py create mode 100644 recipes/libftdi/0.x/test_package/test_package.c create mode 100644 recipes/libftdi/1.x/conandata.yml create mode 100644 recipes/libftdi/1.x/conanfile.py create mode 100644 recipes/libftdi/1.x/patches/0001-cmake-targets.patch create mode 100644 recipes/libftdi/1.x/test_package/CMakeLists.txt create mode 100644 recipes/libftdi/1.x/test_package/conanfile.py create mode 100644 recipes/libftdi/1.x/test_package/test_package.cpp create mode 100644 recipes/libftdi/1.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libftdi/1.x/test_v1_package/conanfile.py create mode 100644 recipes/libftdi/config.yml create mode 100644 recipes/libfuse/2.x.x/conandata.yml create mode 100644 recipes/libfuse/2.x.x/conanfile.py create mode 100644 recipes/libfuse/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/libfuse/2.x.x/test_package/conanfile.py create mode 100644 recipes/libfuse/2.x.x/test_package/test_package.c create mode 100644 recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libfuse/2.x.x/test_v1_package/conanfile.py create mode 100644 recipes/libfuse/all/conandata.yml create mode 100644 recipes/libfuse/all/conanfile.py create mode 100644 recipes/libfuse/all/test_package/CMakeLists.txt create mode 100644 recipes/libfuse/all/test_package/conanfile.py create mode 100644 recipes/libfuse/all/test_package/test_package.c create mode 100644 recipes/libfuse/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libfuse/all/test_v1_package/conanfile.py create mode 100644 recipes/libfuse/config.yml create mode 100644 recipes/libgcrypt/all/conandata.yml create mode 100644 recipes/libgcrypt/all/conanfile.py create mode 100644 recipes/libgcrypt/all/test_package/CMakeLists.txt create mode 100644 recipes/libgcrypt/all/test_package/conanfile.py create mode 100644 recipes/libgcrypt/all/test_package/test_package.c create mode 100644 recipes/libgcrypt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libgcrypt/all/test_v1_package/conanfile.py create mode 100644 recipes/libgcrypt/config.yml create mode 100644 recipes/libgd/all/conandata.yml create mode 100644 recipes/libgd/all/conanfile.py create mode 100644 recipes/libgd/all/patches/2.2.5-msvc-static-lib.patch create mode 100644 recipes/libgd/all/patches/2.2.5-qualify-nondll.patch create mode 100644 recipes/libgd/all/patches/2.3.2-qualify-nondll.patch create mode 100644 recipes/libgd/all/patches/2.3.3-qualify-nondll.patch create mode 100644 recipes/libgd/all/patches/2.3.x-png-msvc.patch create mode 100644 recipes/libgd/all/patches/qualify-nondll.patch create mode 100644 recipes/libgd/all/patches/remove-unistd-h.patch create mode 100644 recipes/libgd/all/test_package/CMakeLists.txt create mode 100644 recipes/libgd/all/test_package/conanfile.py create mode 100644 recipes/libgd/all/test_package/test_package.c create mode 100644 recipes/libgd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libgd/all/test_v1_package/conanfile.py create mode 100644 recipes/libgd/config.yml create mode 100644 recipes/libgeotiff/all/conandata.yml create mode 100644 recipes/libgeotiff/all/conanfile.py create mode 100644 recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch create mode 100644 recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch create mode 100644 recipes/libgeotiff/all/patches/fix-cmake-1.7.1.patch create mode 100644 recipes/libgeotiff/all/test_package/CMakeLists.txt create mode 100644 recipes/libgeotiff/all/test_package/conanfile.py create mode 100644 recipes/libgeotiff/all/test_package/test_package.c create mode 100644 recipes/libgeotiff/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libgeotiff/all/test_v1_package/conanfile.py create mode 100644 recipes/libgeotiff/config.yml create mode 100644 recipes/libgettext/all/conandata.yml create mode 100644 recipes/libgettext/all/conanfile.py create mode 100644 recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch create mode 100644 recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch create mode 100644 recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch create mode 100644 recipes/libgettext/all/test_package/CMakeLists.txt create mode 100644 recipes/libgettext/all/test_package/conanfile.py create mode 100644 recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore create mode 100644 recipes/libgettext/all/test_package/po/en/conan.po create mode 100644 recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore create mode 100644 recipes/libgettext/all/test_package/po/es/conan.po create mode 100644 recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore create mode 100644 recipes/libgettext/all/test_package/po/ru/conan.po create mode 100644 recipes/libgettext/all/test_package/test_package.c create mode 100644 recipes/libgettext/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libgettext/all/test_v1_package/conanfile.py create mode 100644 recipes/libgettext/config.yml create mode 100644 recipes/libgit2/0.27.x/CMakeLists.txt create mode 100644 recipes/libgit2/0.27.x/conandata.yml create mode 100644 recipes/libgit2/0.27.x/conanfile.py create mode 100644 recipes/libgit2/0.27.x/test_package/CMakeLists.txt create mode 100644 recipes/libgit2/0.27.x/test_package/conanfile.py create mode 100644 recipes/libgit2/0.27.x/test_package/test_package.c create mode 100644 recipes/libgit2/0.28.x/CMakeLists.txt create mode 100644 recipes/libgit2/0.28.x/conandata.yml create mode 100644 recipes/libgit2/0.28.x/conanfile.py create mode 100644 recipes/libgit2/0.28.x/test_package/CMakeLists.txt create mode 100644 recipes/libgit2/0.28.x/test_package/conanfile.py create mode 100644 recipes/libgit2/0.28.x/test_package/test_package.c create mode 100644 recipes/libgit2/all/CMakeLists.txt create mode 100644 recipes/libgit2/all/conandata.yml create mode 100644 recipes/libgit2/all/conanfile.py create mode 100644 recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch create mode 100644 recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch create mode 100644 recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch create mode 100644 recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch create mode 100644 recipes/libgit2/all/test_package/CMakeLists.txt create mode 100644 recipes/libgit2/all/test_package/conanfile.py create mode 100644 recipes/libgit2/all/test_package/test_package.c create mode 100644 recipes/libgit2/config.yml create mode 100644 recipes/libglvnd/all/conandata.yml create mode 100644 recipes/libglvnd/all/conanfile.py create mode 100644 recipes/libglvnd/all/test_package/CMakeLists.txt create mode 100644 recipes/libglvnd/all/test_package/conanfile.py create mode 100644 recipes/libglvnd/all/test_package/test_package.c create mode 100644 recipes/libglvnd/config.yml create mode 100644 recipes/libgpg-error/all/conandata.yml create mode 100644 recipes/libgpg-error/all/conanfile.py create mode 100644 recipes/libgpg-error/all/patches/0001-gawk-namespace.patch create mode 100644 recipes/libgpg-error/all/test_package/CMakeLists.txt create mode 100644 recipes/libgpg-error/all/test_package/conanfile.py create mode 100644 recipes/libgpg-error/all/test_package/test_package.c create mode 100644 recipes/libgpg-error/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libgpg-error/all/test_v1_package/conanfile.py create mode 100644 recipes/libgpg-error/config.yml create mode 100644 recipes/libgphoto2/all/conandata.yml create mode 100644 recipes/libgphoto2/all/conanfile.py create mode 100644 recipes/libgphoto2/all/patches/2.5.27-0001-macos_snprintf.patch create mode 100644 recipes/libgphoto2/all/test_package/CMakeLists.txt create mode 100644 recipes/libgphoto2/all/test_package/conanfile.py create mode 100644 recipes/libgphoto2/all/test_package/test_package.c create mode 100644 recipes/libgphoto2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libgphoto2/all/test_v1_package/conanfile.py create mode 100644 recipes/libgphoto2/config.yml create mode 100644 recipes/libgpiod/all/conandata.yml create mode 100644 recipes/libgpiod/all/conanfile.py create mode 100644 recipes/libgpiod/all/test_package/CMakeLists.txt create mode 100644 recipes/libgpiod/all/test_package/conanfile.py create mode 100644 recipes/libgpiod/all/test_package/test_package.c create mode 100644 recipes/libgpiod/config.yml create mode 100644 recipes/libgta/all/CMakeLists.txt create mode 100644 recipes/libgta/all/conandata.yml create mode 100644 recipes/libgta/all/conanfile.py create mode 100644 recipes/libgta/all/test_package/CMakeLists.txt create mode 100644 recipes/libgta/all/test_package/conanfile.py create mode 100644 recipes/libgta/all/test_package/test_package.c create mode 100644 recipes/libgta/config.yml create mode 100644 recipes/libhal/all/conandata.yml create mode 100644 recipes/libhal/all/conanfile.py create mode 100644 recipes/libhal/all/test_package/CMakeLists.txt create mode 100644 recipes/libhal/all/test_package/conanfile.py create mode 100644 recipes/libhal/all/test_package/main.cpp create mode 100644 recipes/libhal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libhal/all/test_v1_package/conanfile.py create mode 100644 recipes/libhal/config.yml create mode 100644 recipes/libharu/all/conandata.yml create mode 100644 recipes/libharu/all/conanfile.py create mode 100644 recipes/libharu/all/patches/0001-allow-cmake-subproject.patch create mode 100644 recipes/libharu/all/patches/0002-linux-add-m-system-library.patch create mode 100644 recipes/libharu/all/patches/0003-rename-tiff-symbols.patch create mode 100644 recipes/libharu/all/test_package/CMakeLists.txt create mode 100644 recipes/libharu/all/test_package/conanfile.py create mode 100644 recipes/libharu/all/test_package/test_package.c create mode 100644 recipes/libharu/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libharu/all/test_v1_package/conanfile.py create mode 100644 recipes/libharu/config.yml create mode 100644 recipes/libheif/all/conandata.yml create mode 100644 recipes/libheif/all/conanfile.py create mode 100644 recipes/libheif/all/patches/0001-cmake-1.9.1.patch create mode 100644 recipes/libheif/all/patches/0001-cmake_1.11.0.patch create mode 100644 recipes/libheif/all/patches/0001-cmake_1.12.0.patch create mode 100644 recipes/libheif/all/patches/0001-cmake_1.13.0.patch create mode 100644 recipes/libheif/all/test_package/CMakeLists.txt create mode 100644 recipes/libheif/all/test_package/conanfile.py create mode 100644 recipes/libheif/all/test_package/test_package.cpp create mode 100644 recipes/libheif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libheif/all/test_v1_package/conanfile.py create mode 100644 recipes/libheif/config.yml create mode 100644 recipes/libhydrogen/all/conandata.yml create mode 100644 recipes/libhydrogen/all/conanfile.py create mode 100644 recipes/libhydrogen/all/patches/0001-fix-cmake.patch create mode 100644 recipes/libhydrogen/all/test_package/CMakeLists.txt create mode 100644 recipes/libhydrogen/all/test_package/conanfile.py create mode 100644 recipes/libhydrogen/all/test_package/test_package.c create mode 100644 recipes/libhydrogen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libhydrogen/all/test_v1_package/conanfile.py create mode 100644 recipes/libhydrogen/config.yml create mode 100644 recipes/libiberty/all/conandata.yml create mode 100644 recipes/libiberty/all/conanfile.py create mode 100644 recipes/libiberty/all/test_package/CMakeLists.txt create mode 100644 recipes/libiberty/all/test_package/conanfile.py create mode 100644 recipes/libiberty/all/test_package/test_package.c create mode 100644 recipes/libiberty/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libiberty/all/test_v1_package/conanfile.py create mode 100644 recipes/libiberty/config.yml create mode 100644 recipes/libiconv/all/conandata.yml create mode 100644 recipes/libiconv/all/conanfile.py create mode 100644 recipes/libiconv/all/patches/0001-libcharset-fix-linkage.patch create mode 100644 recipes/libiconv/all/test_package/CMakeLists.txt create mode 100644 recipes/libiconv/all/test_package/conanfile.py create mode 100644 recipes/libiconv/all/test_package/test_package.c create mode 100644 recipes/libiconv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libiconv/all/test_v1_package/conanfile.py create mode 100644 recipes/libiconv/config.yml create mode 100644 recipes/libid3tag/all/conandata.yml create mode 100644 recipes/libid3tag/all/conanfile.py create mode 100644 recipes/libid3tag/all/test_package/CMakeLists.txt create mode 100644 recipes/libid3tag/all/test_package/conanfile.py create mode 100644 recipes/libid3tag/all/test_package/test_package.c create mode 100644 recipes/libid3tag/config.yml create mode 100644 recipes/libidn/all/conandata.yml create mode 100644 recipes/libidn/all/conanfile.py create mode 100644 recipes/libidn/all/patches/0001-unconditional-system-stdint-h.patch create mode 100644 recipes/libidn/all/test_package/CMakeLists.txt create mode 100644 recipes/libidn/all/test_package/conanfile.py create mode 100644 recipes/libidn/all/test_package/test_package.c create mode 100644 recipes/libidn/config.yml create mode 100644 recipes/libidn2/all/conandata.yml create mode 100644 recipes/libidn2/all/conanfile.py create mode 100644 recipes/libidn2/all/patches/0001-no-versioning-of-symbols.patch create mode 100644 recipes/libidn2/all/test_package/CMakeLists.txt create mode 100644 recipes/libidn2/all/test_package/conanfile.py create mode 100644 recipes/libidn2/all/test_package/test_package.c create mode 100644 recipes/libidn2/config.yml create mode 100644 recipes/libigl/2.x.x/CMakeLists.txt create mode 100644 recipes/libigl/2.x.x/conandata.yml create mode 100644 recipes/libigl/2.x.x/conanfile.py create mode 100644 recipes/libigl/2.x.x/patches/0001-correct-fpic.patch create mode 100644 recipes/libigl/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/libigl/2.x.x/test_package/conanfile.py create mode 100644 recipes/libigl/2.x.x/test_package/example.cpp create mode 100644 recipes/libigl/config.yml create mode 100644 recipes/libinterpolate/all/conandata.yml create mode 100644 recipes/libinterpolate/all/conanfile.py create mode 100644 recipes/libinterpolate/all/test_package/CMakeLists.txt create mode 100644 recipes/libinterpolate/all/test_package/conanfile.py create mode 100644 recipes/libinterpolate/all/test_package/test_package.cpp create mode 100644 recipes/libinterpolate/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libinterpolate/all/test_v1_package/conanfile.py create mode 100644 recipes/libinterpolate/config.yml create mode 100644 recipes/libipt/all/CMakeLists.txt create mode 100644 recipes/libipt/all/conandata.yml create mode 100644 recipes/libipt/all/conanfile.py create mode 100644 recipes/libipt/all/test_package/CMakeLists.txt create mode 100644 recipes/libipt/all/test_package/conanfile.py create mode 100644 recipes/libipt/all/test_package/test_package.cpp create mode 100644 recipes/libipt/config.yml create mode 100644 recipes/libjpeg-turbo/all/conandata.yml create mode 100644 recipes/libjpeg-turbo/all/conanfile.py create mode 100644 recipes/libjpeg-turbo/all/test_package/CMakeLists.txt create mode 100644 recipes/libjpeg-turbo/all/test_package/conanfile.py create mode 100644 recipes/libjpeg-turbo/all/test_package/test_package.c create mode 100644 recipes/libjpeg-turbo/all/test_package/testimg.jpg create mode 100644 recipes/libjpeg-turbo/all/test_package_module/CMakeLists.txt create mode 100644 recipes/libjpeg-turbo/all/test_package_module/conanfile.py create mode 100644 recipes/libjpeg-turbo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libjpeg-turbo/all/test_v1_package/conanfile.py create mode 100644 recipes/libjpeg-turbo/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py create mode 100644 recipes/libjpeg-turbo/config.yml create mode 100644 recipes/libjpeg/all/Win32.Mak create mode 100644 recipes/libjpeg/all/conandata.yml create mode 100644 recipes/libjpeg/all/conanfile.py create mode 100644 recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch create mode 100644 recipes/libjpeg/all/patches/0001-libjpeg-add-msvc-dll-support.patch create mode 100644 recipes/libjpeg/all/test_package/CMakeLists.txt create mode 100644 recipes/libjpeg/all/test_package/conanfile.py create mode 100644 recipes/libjpeg/all/test_package/test_package.c create mode 100644 recipes/libjpeg/all/test_package/test_transupp.c create mode 100644 recipes/libjpeg/all/test_package/testimg.jpg create mode 100644 recipes/libjpeg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libjpeg/all/test_v1_package/conanfile.py create mode 100644 recipes/libjpeg/config.yml create mode 100644 recipes/libjxl/all/CMakeLists.txt create mode 100644 recipes/libjxl/all/conandata.yml create mode 100644 recipes/libjxl/all/conanfile.py create mode 100644 recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch create mode 100644 recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch create mode 100644 recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch create mode 100644 recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch create mode 100644 recipes/libjxl/all/test_package/CMakeLists.txt create mode 100644 recipes/libjxl/all/test_package/conanfile.py create mode 100644 recipes/libjxl/all/test_package/test.jxl create mode 100644 recipes/libjxl/all/test_package/test_package.c create mode 100644 recipes/libjxl/config.yml create mode 100644 recipes/libkml/all/conandata.yml create mode 100644 recipes/libkml/all/conanfile.py create mode 100644 recipes/libkml/all/patches/0001-fix-cmake.patch create mode 100644 recipes/libkml/all/patches/0002-fix-for-mingw-and-empty-literal-for-vc.patch create mode 100644 recipes/libkml/all/patches/0003-export-extern-symbols-for-msvc.patch create mode 100644 recipes/libkml/all/patches/0004-minizip-no-crypt-header.patch create mode 100644 recipes/libkml/all/test_package/CMakeLists.txt create mode 100644 recipes/libkml/all/test_package/conanfile.py create mode 100644 recipes/libkml/all/test_package/test_package.cpp create mode 100644 recipes/libkml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libkml/all/test_v1_package/conanfile.py create mode 100644 recipes/libkml/config.yml create mode 100644 recipes/liblsl/all/CMakeLists.txt create mode 100644 recipes/liblsl/all/conandata.yml create mode 100644 recipes/liblsl/all/conanfile.py create mode 100644 recipes/liblsl/all/test_package/CMakeLists.txt create mode 100644 recipes/liblsl/all/test_package/conanfile.py create mode 100644 recipes/liblsl/all/test_package/test_package.cpp create mode 100644 recipes/liblsl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/liblsl/all/test_v1_package/conanfile.py create mode 100644 recipes/liblsl/config.yml create mode 100644 recipes/libltc/all/conandata.yml create mode 100644 recipes/libltc/all/conanfile.py create mode 100644 recipes/libltc/all/test_package/CMakeLists.txt create mode 100644 recipes/libltc/all/test_package/conanfile.py create mode 100644 recipes/libltc/all/test_package/test_package.c create mode 100644 recipes/libltc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libltc/all/test_v1_package/conanfile.py create mode 100644 recipes/libltc/config.yml create mode 100644 recipes/liblzf/all/CMakeLists.txt create mode 100644 recipes/liblzf/all/conandata.yml create mode 100644 recipes/liblzf/all/conanfile.py create mode 100644 recipes/liblzf/all/patches/0001-add-extern-c.patch create mode 100644 recipes/liblzf/all/patches/0002-fix-macro-expansion-ub.patch create mode 100644 recipes/liblzf/all/test_package/CMakeLists.txt create mode 100644 recipes/liblzf/all/test_package/conanfile.py create mode 100644 recipes/liblzf/all/test_package/test_package.cpp create mode 100644 recipes/liblzf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/liblzf/all/test_v1_package/conanfile.py create mode 100644 recipes/liblzf/config.yml create mode 100644 recipes/libmad/all/conandata.yml create mode 100644 recipes/libmad/all/conanfile.py create mode 100644 recipes/libmad/all/test_package/CMakeLists.txt create mode 100644 recipes/libmad/all/test_package/conanfile.py create mode 100644 recipes/libmad/all/test_package/test_package.c create mode 100644 recipes/libmad/config.yml create mode 100644 recipes/libmaxminddb/all/conandata.yml create mode 100644 recipes/libmaxminddb/all/conanfile.py create mode 100644 recipes/libmaxminddb/all/patches/0001-fix-cmake-bundle.patch create mode 100644 recipes/libmaxminddb/all/test_package/CMakeLists.txt create mode 100644 recipes/libmaxminddb/all/test_package/conanfile.py create mode 100644 recipes/libmaxminddb/all/test_package/test_package.c create mode 100644 recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmaxminddb/all/test_v1_package/conanfile.py create mode 100644 recipes/libmaxminddb/config.yml create mode 100644 recipes/libmbus/all/CMakeLists.txt create mode 100644 recipes/libmbus/all/conandata.yml create mode 100644 recipes/libmbus/all/conanfile.py create mode 100644 recipes/libmbus/all/test_package/CMakeLists.txt create mode 100644 recipes/libmbus/all/test_package/conanfile.py create mode 100644 recipes/libmbus/all/test_package/test_package.c create mode 100644 recipes/libmbus/config.yml create mode 100644 recipes/libmediainfo/all/CMakeLists.txt create mode 100644 recipes/libmediainfo/all/conandata.yml create mode 100644 recipes/libmediainfo/all/conanfile.py create mode 100644 recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch create mode 100644 recipes/libmediainfo/all/patches/0002-cmake-get-property-location.patch create mode 100644 recipes/libmediainfo/all/test_package/CMakeLists.txt create mode 100644 recipes/libmediainfo/all/test_package/conanfile.py create mode 100644 recipes/libmediainfo/all/test_package/test_package.cpp create mode 100644 recipes/libmediainfo/all/test_package/testsrc.mp4 create mode 100644 recipes/libmediainfo/config.yml create mode 100644 recipes/libmetalink/all/conandata.yml create mode 100644 recipes/libmetalink/all/conanfile.py create mode 100644 recipes/libmetalink/all/test_package/CMakeLists.txt create mode 100644 recipes/libmetalink/all/test_package/conanfile.py create mode 100644 recipes/libmetalink/all/test_package/test_package.c create mode 100644 recipes/libmetalink/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmetalink/all/test_v1_package/conanfile.py create mode 100644 recipes/libmetalink/config.yml create mode 100644 recipes/libmicrohttpd/all/conandata.yml create mode 100644 recipes/libmicrohttpd/all/conanfile.py create mode 100644 recipes/libmicrohttpd/all/patches/0.9.75-0001-allow-release-with-debug-runtime.patch create mode 100644 recipes/libmicrohttpd/all/test_package/CMakeLists.txt create mode 100644 recipes/libmicrohttpd/all/test_package/conanfile.py create mode 100644 recipes/libmicrohttpd/all/test_package/test_package.c create mode 100644 recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmicrohttpd/all/test_v1_package/conanfile.py create mode 100644 recipes/libmicrohttpd/config.yml create mode 100644 recipes/libmikmod/all/CMakeLists.txt create mode 100644 recipes/libmikmod/all/conandata.yml create mode 100644 recipes/libmikmod/all/conanfile.py create mode 100644 recipes/libmikmod/all/patches/0001-CMakeLists.txt.patch create mode 100644 recipes/libmikmod/all/test_package/CMakeLists.txt create mode 100644 recipes/libmikmod/all/test_package/conanfile.py create mode 100644 recipes/libmikmod/all/test_package/test_package.c create mode 100644 recipes/libmikmod/config.yml create mode 100644 recipes/libmnl/all/conandata.yml create mode 100644 recipes/libmnl/all/conanfile.py create mode 100644 recipes/libmnl/all/test_package/CMakeLists.txt create mode 100644 recipes/libmnl/all/test_package/conanfile.py create mode 100644 recipes/libmnl/all/test_package/example.cpp create mode 100644 recipes/libmnl/config.yml create mode 100644 recipes/libmodbus/all/conandata.yml create mode 100644 recipes/libmodbus/all/conanfile.py create mode 100644 recipes/libmodbus/all/patches/3.1.6-0001-msvc-fixes.patch create mode 100644 recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch create mode 100644 recipes/libmodbus/all/test_package/CMakeLists.txt create mode 100644 recipes/libmodbus/all/test_package/conanfile.py create mode 100644 recipes/libmodbus/all/test_package/test_package.c create mode 100644 recipes/libmodbus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmodbus/all/test_v1_package/conanfile.py create mode 100644 recipes/libmodbus/config.yml create mode 100644 recipes/libmodplug/all/conandata.yml create mode 100644 recipes/libmodplug/all/conanfile.py create mode 100644 recipes/libmodplug/all/patches/0001-cmake-install-dll.patch create mode 100644 recipes/libmodplug/all/patches/0002-cpp17-compat.patch create mode 100644 recipes/libmodplug/all/test_package/CMakeLists.txt create mode 100644 recipes/libmodplug/all/test_package/conanfile.py create mode 100644 recipes/libmodplug/all/test_package/test_package.c create mode 100644 recipes/libmodplug/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmodplug/all/test_v1_package/conanfile.py create mode 100644 recipes/libmodplug/config.yml create mode 100644 recipes/libmorton/all/conandata.yml create mode 100644 recipes/libmorton/all/conanfile.py create mode 100644 recipes/libmorton/all/patches/missing-includes.patch create mode 100644 recipes/libmorton/all/test_package/CMakeLists.txt create mode 100644 recipes/libmorton/all/test_package/conanfile.py create mode 100644 recipes/libmorton/all/test_package/test_package.cpp create mode 100644 recipes/libmorton/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmorton/all/test_v1_package/conanfile.py create mode 100644 recipes/libmorton/config.yml create mode 100644 recipes/libmount/all/conandata.yml create mode 100644 recipes/libmount/all/conanfile.py create mode 100644 recipes/libmount/all/test_package/CMakeLists.txt create mode 100644 recipes/libmount/all/test_package/conanfile.py create mode 100644 recipes/libmount/all/test_package/test_package.c create mode 100644 recipes/libmount/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmount/all/test_v1_package/conanfile.py create mode 100644 recipes/libmount/config.yml create mode 100644 recipes/libmp3lame/all/conandata.yml create mode 100644 recipes/libmp3lame/all/conanfile.py create mode 100644 recipes/libmp3lame/all/patches/6410.patch create mode 100644 recipes/libmp3lame/all/patches/6416.patch create mode 100644 recipes/libmp3lame/all/patches/android.patch create mode 100644 recipes/libmp3lame/all/test_package/CMakeLists.txt create mode 100644 recipes/libmp3lame/all/test_package/conanfile.py create mode 100644 recipes/libmp3lame/all/test_package/test_package.c create mode 100644 recipes/libmp3lame/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmp3lame/all/test_v1_package/conanfile.py create mode 100644 recipes/libmp3lame/config.yml create mode 100644 recipes/libmysqlclient/all/conandata.yml create mode 100644 recipes/libmysqlclient/all/conanfile.py create mode 100644 recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch create mode 100644 recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch create mode 100644 recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch create mode 100644 recipes/libmysqlclient/all/test_package/CMakeLists.txt create mode 100644 recipes/libmysqlclient/all/test_package/conanfile.py create mode 100644 recipes/libmysqlclient/all/test_package/test_package.c create mode 100644 recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmysqlclient/all/test_v1_package/conanfile.py create mode 100644 recipes/libmysqlclient/config.yml create mode 100644 recipes/libnabo/all/conandata.yml create mode 100644 recipes/libnabo/all/conanfile.py create mode 100644 recipes/libnabo/all/patches/1.0.7-0001-fix-cmake.patch create mode 100644 recipes/libnabo/all/test_package/CMakeLists.txt create mode 100644 recipes/libnabo/all/test_package/conanfile.py create mode 100644 recipes/libnabo/all/test_package/test_package.cpp create mode 100644 recipes/libnabo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnabo/all/test_v1_package/conanfile.py create mode 100644 recipes/libnabo/config.yml create mode 100644 recipes/libnet/all/conandata.yml create mode 100644 recipes/libnet/all/conanfile.py create mode 100644 recipes/libnet/all/test_package/CMakeLists.txt create mode 100644 recipes/libnet/all/test_package/conanfile.py create mode 100644 recipes/libnet/all/test_package/test_package.c create mode 100644 recipes/libnet/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnet/all/test_v1_package/conanfile.py create mode 100644 recipes/libnet/config.yml create mode 100644 recipes/libnetfilter_conntrack/all/conandata.yml create mode 100644 recipes/libnetfilter_conntrack/all/conanfile.py create mode 100644 recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt create mode 100644 recipes/libnetfilter_conntrack/all/test_package/conanfile.py create mode 100644 recipes/libnetfilter_conntrack/all/test_package/example.c create mode 100644 recipes/libnetfilter_conntrack/config.yml create mode 100644 recipes/libnetfilter_queue/all/conandata.yml create mode 100644 recipes/libnetfilter_queue/all/conanfile.py create mode 100644 recipes/libnetfilter_queue/all/test_package/CMakeLists.txt create mode 100644 recipes/libnetfilter_queue/all/test_package/conanfile.py create mode 100644 recipes/libnetfilter_queue/all/test_package/example.c create mode 100644 recipes/libnetfilter_queue/config.yml create mode 100644 recipes/libnfnetlink/all/conandata.yml create mode 100644 recipes/libnfnetlink/all/conanfile.py create mode 100644 recipes/libnfnetlink/all/test_package/CMakeLists.txt create mode 100644 recipes/libnfnetlink/all/test_package/conanfile.py create mode 100644 recipes/libnfnetlink/all/test_package/example.cpp create mode 100644 recipes/libnfnetlink/config.yml create mode 100644 recipes/libnfs/all/conandata.yml create mode 100644 recipes/libnfs/all/conanfile.py create mode 100644 recipes/libnfs/all/patches/5.0.1-0001-remove-exports.patch create mode 100644 recipes/libnfs/all/test_package/CMakeLists.txt create mode 100644 recipes/libnfs/all/test_package/conanfile.py create mode 100644 recipes/libnfs/all/test_package/test_package.c create mode 100644 recipes/libnfs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnfs/all/test_v1_package/conanfile.py create mode 100644 recipes/libnfs/config.yml create mode 100644 recipes/libnghttp2/all/conandata.yml create mode 100644 recipes/libnghttp2/all/conanfile.py create mode 100644 recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch create mode 100644 recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch create mode 100644 recipes/libnghttp2/all/patches/fix-findJemalloc.cmake create mode 100644 recipes/libnghttp2/all/patches/fix-findLibevent.cmake create mode 100644 recipes/libnghttp2/all/test_package/CMakeLists.txt create mode 100644 recipes/libnghttp2/all/test_package/conanfile.py create mode 100644 recipes/libnghttp2/all/test_package/test_package.cpp create mode 100644 recipes/libnghttp2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnghttp2/all/test_v1_package/conanfile.py create mode 100644 recipes/libnghttp2/config.yml create mode 100644 recipes/libnice/all/conandata.yml create mode 100644 recipes/libnice/all/conanfile.py create mode 100644 recipes/libnice/all/test_package/CMakeLists.txt create mode 100644 recipes/libnice/all/test_package/conanfile.py create mode 100644 recipes/libnice/all/test_package/src/example.c create mode 100644 recipes/libnice/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnice/all/test_v1_package/conanfile.py create mode 100644 recipes/libnice/config.yml create mode 100644 recipes/libnl/all/conandata.yml create mode 100644 recipes/libnl/all/conanfile.py create mode 100644 recipes/libnl/all/test_package/CMakeLists.txt create mode 100644 recipes/libnl/all/test_package/conanfile.py create mode 100644 recipes/libnl/all/test_package/show_links.c create mode 100644 recipes/libnl/config.yml create mode 100644 recipes/libnoise/all/CMakeLists.txt create mode 100644 recipes/libnoise/all/conandata.yml create mode 100644 recipes/libnoise/all/conanfile.py create mode 100644 recipes/libnoise/all/test_package/CMakeLists.txt create mode 100644 recipes/libnoise/all/test_package/conanfile.py create mode 100644 recipes/libnoise/all/test_package/test_package.cpp create mode 100644 recipes/libnoise/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnoise/all/test_v1_package/conanfile.py create mode 100644 recipes/libnoise/config.yml create mode 100644 recipes/libnop/all/conandata.yml create mode 100644 recipes/libnop/all/conanfile.py create mode 100644 recipes/libnop/all/test_package/CMakeLists.txt create mode 100644 recipes/libnop/all/test_package/conanfile.py create mode 100644 recipes/libnop/all/test_package/test_package.cpp create mode 100644 recipes/libnop/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnop/all/test_v1_package/conanfile.py create mode 100644 recipes/libnop/config.yml create mode 100644 recipes/libnova/all/conandata.yml create mode 100644 recipes/libnova/all/conanfile.py create mode 100644 recipes/libnova/all/patches/0001-fix-cmake.patch create mode 100644 recipes/libnova/all/patches/0002-fix-win32-def.patch create mode 100644 recipes/libnova/all/patches/0003-no-redefine-nan.patch create mode 100644 recipes/libnova/all/patches/0004-constellation-syntax-error.patch create mode 100644 recipes/libnova/all/patches/0005-fix-mingw-w64.patch create mode 100644 recipes/libnova/all/test_package/CMakeLists.txt create mode 100644 recipes/libnova/all/test_package/conanfile.py create mode 100644 recipes/libnova/all/test_package/test_package.c create mode 100644 recipes/libnova/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnova/all/test_v1_package/conanfile.py create mode 100644 recipes/libnova/config.yml create mode 100644 recipes/libnuma/all/conandata.yml create mode 100644 recipes/libnuma/all/conanfile.py create mode 100644 recipes/libnuma/all/patches/symver.patch create mode 100644 recipes/libnuma/all/test_package/CMakeLists.txt create mode 100644 recipes/libnuma/all/test_package/conanfile.py create mode 100644 recipes/libnuma/all/test_package/test_package.c create mode 100644 recipes/libnuma/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnuma/all/test_v1_package/conanfile.py create mode 100644 recipes/libnuma/config.yml create mode 100644 recipes/liboping/all/conandata.yml create mode 100644 recipes/liboping/all/conanfile.py create mode 100644 recipes/liboping/all/patches/1.10.0-suppress_truncate.patch create mode 100644 recipes/liboping/all/test_package/CMakeLists.txt create mode 100644 recipes/liboping/all/test_package/conanfile.py create mode 100644 recipes/liboping/all/test_package/test_package.c create mode 100644 recipes/liboping/config.yml create mode 100644 recipes/libpcap/all/conandata.yml create mode 100644 recipes/libpcap/all/conanfile.py create mode 100644 recipes/libpcap/all/test_package/CMakeLists.txt create mode 100644 recipes/libpcap/all/test_package/conanfile.py create mode 100644 recipes/libpcap/all/test_package/test_package.c create mode 100644 recipes/libpcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpcap/all/test_v1_package/conanfile.py create mode 100644 recipes/libpcap/config.yml create mode 100644 recipes/libpciaccess/all/conandata.yml create mode 100644 recipes/libpciaccess/all/conanfile.py create mode 100644 recipes/libpciaccess/all/test_package/CMakeLists.txt create mode 100644 recipes/libpciaccess/all/test_package/conanfile.py create mode 100644 recipes/libpciaccess/all/test_package/test_package.c create mode 100644 recipes/libpciaccess/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpciaccess/all/test_v1_package/conanfile.py create mode 100644 recipes/libpciaccess/config.yml create mode 100644 recipes/libpfm4/all/conandata.yml create mode 100644 recipes/libpfm4/all/conanfile.py create mode 100644 recipes/libpfm4/all/test_package/CMakeLists.txt create mode 100644 recipes/libpfm4/all/test_package/conanfile.py create mode 100644 recipes/libpfm4/all/test_package/test_package.c create mode 100644 recipes/libpfm4/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpfm4/all/test_v1_package/conanfile.py create mode 100644 recipes/libpfm4/config.yml create mode 100644 recipes/libpng/all/conandata.yml create mode 100644 recipes/libpng/all/conanfile.py create mode 100644 recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch create mode 100644 recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch create mode 100644 recipes/libpng/all/test_package/CMakeLists.txt create mode 100644 recipes/libpng/all/test_package/conanfile.py create mode 100644 recipes/libpng/all/test_package/test_package.c create mode 100644 recipes/libpng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpng/all/test_v1_package/conanfile.py create mode 100644 recipes/libpng/config.yml create mode 100644 recipes/libpointmatcher/all/conandata.yml create mode 100644 recipes/libpointmatcher/all/conanfile.py create mode 100644 recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch create mode 100644 recipes/libpointmatcher/all/test_package/CMakeLists.txt create mode 100644 recipes/libpointmatcher/all/test_package/conanfile.py create mode 100644 recipes/libpointmatcher/all/test_package/test_package.cpp create mode 100644 recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpointmatcher/all/test_v1_package/conanfile.py create mode 100644 recipes/libpointmatcher/config.yml create mode 100644 recipes/libpq/all/conandata.yml create mode 100644 recipes/libpq/all/conanfile.py create mode 100644 recipes/libpq/all/patches/10.20/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/12.10/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch create mode 100644 recipes/libpq/all/patches/13.6/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/9.6.24/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/test_package/CMakeLists.txt create mode 100644 recipes/libpq/all/test_package/conanfile.py create mode 100644 recipes/libpq/all/test_package/test_package.c create mode 100644 recipes/libpq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpq/all/test_v1_package/conanfile.py create mode 100644 recipes/libpq/config.yml create mode 100644 recipes/libpqxx/all/conandata.yml create mode 100644 recipes/libpqxx/all/conanfile.py create mode 100644 recipes/libpqxx/all/patches/0001-cmake-fix-module-6.4.8.patch create mode 100644 recipes/libpqxx/all/patches/0001-cmake-fix-module.patch create mode 100644 recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch create mode 100644 recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch create mode 100644 recipes/libpqxx/all/patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch create mode 100644 recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch create mode 100644 recipes/libpqxx/all/patches/fix-missing-limits-include.patch create mode 100644 recipes/libpqxx/all/patches/fix-msvc-compilation-7.3.1.patch create mode 100644 recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch create mode 100644 recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch create mode 100644 recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch create mode 100644 recipes/libpqxx/all/patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch create mode 100644 recipes/libpqxx/all/test_package/CMakeLists.txt create mode 100644 recipes/libpqxx/all/test_package/conanfile.py create mode 100644 recipes/libpqxx/all/test_package/test_package.cpp create mode 100644 recipes/libpqxx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpqxx/all/test_v1_package/conanfile.py create mode 100644 recipes/libpqxx/config.yml create mode 100644 recipes/libproperties/all/CMakeLists.txt create mode 100644 recipes/libproperties/all/conandata.yml create mode 100644 recipes/libproperties/all/conanfile.py create mode 100644 recipes/libproperties/all/patches/0001-set-CMAKE_C_STANDARD.patch create mode 100644 recipes/libproperties/all/test_package/CMakeLists.txt create mode 100644 recipes/libproperties/all/test_package/conanfile.py create mode 100644 recipes/libproperties/all/test_package/test_package.c create mode 100644 recipes/libproperties/config.yml create mode 100644 recipes/libprotobuf-mutator/all/CMakeLists.txt create mode 100644 recipes/libprotobuf-mutator/all/conandata.yml create mode 100644 recipes/libprotobuf-mutator/all/conanfile.py create mode 100644 recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt create mode 100644 recipes/libprotobuf-mutator/all/test_package/conanfile.py create mode 100644 recipes/libprotobuf-mutator/all/test_package/msg.proto create mode 100644 recipes/libprotobuf-mutator/all/test_package/test_package.cpp create mode 100644 recipes/libprotobuf-mutator/config.yml create mode 100644 recipes/libpsl/all/conandata.yml create mode 100644 recipes/libpsl/all/conanfile.py create mode 100644 recipes/libpsl/all/patches/0001-0.21.2-meson-no-tests.patch create mode 100644 recipes/libpsl/all/test_package/CMakeLists.txt create mode 100644 recipes/libpsl/all/test_package/conanfile.py create mode 100644 recipes/libpsl/all/test_package/test_package.c create mode 100644 recipes/libpsl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpsl/all/test_v1_package/conanfile.py create mode 100644 recipes/libpsl/config.yml create mode 100644 recipes/libqrencode/all/conandata.yml create mode 100644 recipes/libqrencode/all/conanfile.py create mode 100644 recipes/libqrencode/all/patches/0001-remove-deprecated-attribute.patch create mode 100644 recipes/libqrencode/all/patches/0002-cmake-fix-install.patch create mode 100644 recipes/libqrencode/all/patches/0003-cmake-fix-install-4.1.1.patch create mode 100644 recipes/libqrencode/all/test_package/CMakeLists.txt create mode 100644 recipes/libqrencode/all/test_package/conanfile.py create mode 100644 recipes/libqrencode/all/test_package/test_package.c create mode 100644 recipes/libqrencode/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libqrencode/all/test_v1_package/conanfile.py create mode 100644 recipes/libqrencode/config.yml create mode 100644 recipes/librasterlite/all/conandata.yml create mode 100644 recipes/librasterlite/all/conanfile.py create mode 100644 recipes/librasterlite/all/patches/0001-fix-autotools.patch create mode 100644 recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch create mode 100644 recipes/librasterlite/all/test_package/CMakeLists.txt create mode 100644 recipes/librasterlite/all/test_package/conanfile.py create mode 100644 recipes/librasterlite/all/test_package/test_package.c create mode 100644 recipes/librasterlite/config.yml create mode 100644 recipes/librasterlite2/all/conandata.yml create mode 100644 recipes/librasterlite2/all/conanfile.py create mode 100644 recipes/librasterlite2/all/patches/0001-missing-include.patch create mode 100644 recipes/librasterlite2/all/test_package/CMakeLists.txt create mode 100644 recipes/librasterlite2/all/test_package/conanfile.py create mode 100644 recipes/librasterlite2/all/test_package/test_package.c create mode 100644 recipes/librasterlite2/config.yml create mode 100644 recipes/libraw/all/CMakeLists.txt create mode 100644 recipes/libraw/all/conandata.yml create mode 100644 recipes/libraw/all/conanfile.py create mode 100644 recipes/libraw/all/test_package/CMakeLists.txt create mode 100644 recipes/libraw/all/test_package/conanfile.py create mode 100644 recipes/libraw/all/test_package/test_package.cpp create mode 100644 recipes/libraw/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libraw/all/test_v1_package/conanfile.py create mode 100644 recipes/libraw/config.yml create mode 100644 recipes/librdkafka/all/conandata.yml create mode 100644 recipes/librdkafka/all/conanfile.py create mode 100644 recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch create mode 100644 recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch create mode 100644 recipes/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch create mode 100644 recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch create mode 100644 recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch create mode 100644 recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch create mode 100644 recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch create mode 100644 recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch create mode 100644 recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch create mode 100644 recipes/librdkafka/all/test_package/CMakeLists.txt create mode 100644 recipes/librdkafka/all/test_package/conanfile.py create mode 100644 recipes/librdkafka/all/test_package/test_package.c create mode 100644 recipes/librdkafka/all/test_package/test_package.cpp create mode 100644 recipes/librdkafka/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/librdkafka/all/test_v1_package/conanfile.py create mode 100644 recipes/librdkafka/config.yml create mode 100644 recipes/librealsense/all/conandata.yml create mode 100644 recipes/librealsense/all/conanfile.py create mode 100644 recipes/librealsense/all/patches/2.49.0-0001-fix-cmake.patch create mode 100644 recipes/librealsense/all/patches/2.49.0-0002-fix-avx-check.patch create mode 100644 recipes/librealsense/all/patches/2.49.0-0003-atlstr-removal.patch create mode 100644 recipes/librealsense/all/patches/2.49.0-0004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch create mode 100644 recipes/librealsense/all/test_package/CMakeLists.txt create mode 100644 recipes/librealsense/all/test_package/conanfile.py create mode 100644 recipes/librealsense/all/test_package/test_package.cpp create mode 100644 recipes/librealsense/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/librealsense/all/test_v1_package/conanfile.py create mode 100644 recipes/librealsense/config.yml create mode 100644 recipes/libressl/all/conandata.yml create mode 100644 recipes/libressl/all/conanfile.py create mode 100644 recipes/libressl/all/test_package/CMakeLists.txt create mode 100644 recipes/libressl/all/test_package/conanfile.py create mode 100644 recipes/libressl/all/test_package/test_package.c create mode 100644 recipes/libressl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libressl/all/test_v1_package/conanfile.py create mode 100644 recipes/libressl/config.yml create mode 100644 recipes/librhash/all/conandata.yml create mode 100644 recipes/librhash/all/conanfile.py create mode 100644 recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch create mode 100644 recipes/librhash/all/test_package/CMakeLists.txt create mode 100644 recipes/librhash/all/test_package/conanfile.py create mode 100644 recipes/librhash/all/test_package/test_package.c create mode 100644 recipes/librhash/config.yml create mode 100644 recipes/librttopo/all/CMakeLists.txt create mode 100644 recipes/librttopo/all/conandata.yml create mode 100644 recipes/librttopo/all/conanfile.py create mode 100644 recipes/librttopo/all/test_package/CMakeLists.txt create mode 100644 recipes/librttopo/all/test_package/conanfile.py create mode 100644 recipes/librttopo/all/test_package/test_package.c create mode 100644 recipes/librttopo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/librttopo/all/test_v1_package/conanfile.py create mode 100644 recipes/librttopo/config.yml create mode 100644 recipes/libsafec/all/conandata.yml create mode 100644 recipes/libsafec/all/conanfile.py create mode 100644 recipes/libsafec/all/test_package/CMakeLists.txt create mode 100644 recipes/libsafec/all/test_package/conanfile.py create mode 100644 recipes/libsafec/all/test_package/test_package.c create mode 100644 recipes/libsafec/config.yml create mode 100644 recipes/libsamplerate/all/conandata.yml create mode 100644 recipes/libsamplerate/all/conanfile.py create mode 100644 recipes/libsamplerate/all/test_package/CMakeLists.txt create mode 100644 recipes/libsamplerate/all/test_package/conanfile.py create mode 100644 recipes/libsamplerate/all/test_package/test_package.c create mode 100644 recipes/libsamplerate/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsamplerate/all/test_v1_package/conanfile.py create mode 100644 recipes/libsamplerate/config.yml create mode 100644 recipes/libsass/all/conandata.yml create mode 100644 recipes/libsass/all/conanfile.py create mode 100644 recipes/libsass/all/test_package/CMakeLists.txt create mode 100644 recipes/libsass/all/test_package/conanfile.py create mode 100644 recipes/libsass/all/test_package/test_package.c create mode 100644 recipes/libsass/config.yml create mode 100644 recipes/libschrift/all/CMakeLists.txt create mode 100644 recipes/libschrift/all/conandata.yml create mode 100644 recipes/libschrift/all/conanfile.py create mode 100644 recipes/libschrift/all/test_package/CMakeLists.txt create mode 100644 recipes/libschrift/all/test_package/OpenSans-Bold.ttf create mode 100644 recipes/libschrift/all/test_package/conanfile.py create mode 100644 recipes/libschrift/all/test_package/test_package.c create mode 100644 recipes/libschrift/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libschrift/all/test_v1_package/conanfile.py create mode 100644 recipes/libschrift/config.yml create mode 100644 recipes/libsecret/all/conandata.yml create mode 100644 recipes/libsecret/all/conanfile.py create mode 100644 recipes/libsecret/all/test_package/CMakeLists.txt create mode 100644 recipes/libsecret/all/test_package/conanfile.py create mode 100644 recipes/libsecret/all/test_package/test_package.cpp create mode 100644 recipes/libsecret/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsecret/all/test_v1_package/conanfile.py create mode 100644 recipes/libsecret/config.yml create mode 100644 recipes/libselinux/all/conandata.yml create mode 100644 recipes/libselinux/all/conanfile.py create mode 100644 recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch create mode 100644 recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch create mode 100644 recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch create mode 100644 recipes/libselinux/all/test_package/CMakeLists.txt create mode 100644 recipes/libselinux/all/test_package/conanfile.py create mode 100644 recipes/libselinux/all/test_package/test_package.c create mode 100644 recipes/libselinux/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libselinux/all/test_v1_package/conanfile.py create mode 100644 recipes/libselinux/config.yml create mode 100644 recipes/libserial/all/conandata.yml create mode 100644 recipes/libserial/all/conanfile.py create mode 100644 recipes/libserial/all/test_package/CMakeLists.txt create mode 100644 recipes/libserial/all/test_package/conanfile.py create mode 100644 recipes/libserial/all/test_package/test_package.cpp create mode 100644 recipes/libserial/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libserial/all/test_v1_package/conanfile.py create mode 100644 recipes/libserial/config.yml create mode 100644 recipes/libsgp4/all/conandata.yml create mode 100644 recipes/libsgp4/all/conanfile.py create mode 100644 recipes/libsgp4/all/patches/fix-cmake-files.patch create mode 100644 recipes/libsgp4/all/test_package/CMakeLists.txt create mode 100644 recipes/libsgp4/all/test_package/SGP4-VER.TLE create mode 100644 recipes/libsgp4/all/test_package/conanfile.py create mode 100644 recipes/libsgp4/all/test_package/test_package.cpp create mode 100644 recipes/libsgp4/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsgp4/all/test_v1_package/conanfile.py create mode 100644 recipes/libsgp4/config.yml create mode 100644 recipes/libsigcpp/2.x.x/conandata.yml create mode 100644 recipes/libsigcpp/2.x.x/conanfile.py create mode 100644 recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/libsigcpp/2.x.x/test_package/conanfile.py create mode 100644 recipes/libsigcpp/2.x.x/test_package/test_package.cpp create mode 100644 recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py create mode 100644 recipes/libsigcpp/3.x.x/conandata.yml create mode 100644 recipes/libsigcpp/3.x.x/conanfile.py create mode 100644 recipes/libsigcpp/3.x.x/patches/3.0.0-0001-libsigcpp.patch create mode 100644 recipes/libsigcpp/3.x.x/patches/3.0.7-0001-libsigcpp.patch create mode 100644 recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt create mode 100644 recipes/libsigcpp/3.x.x/test_package/conanfile.py create mode 100644 recipes/libsigcpp/3.x.x/test_package/test_package.cpp create mode 100644 recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/libsigcpp/config.yml create mode 100644 recipes/libsixel/all/conandata.yml create mode 100644 recipes/libsixel/all/conanfile.py create mode 100644 recipes/libsixel/all/test_package/CMakeLists.txt create mode 100644 recipes/libsixel/all/test_package/conanfile.py create mode 100644 recipes/libsixel/all/test_package/test_package.c create mode 100644 recipes/libsixel/config.yml create mode 100644 recipes/libslz/all/CMakeLists.txt create mode 100644 recipes/libslz/all/conandata.yml create mode 100644 recipes/libslz/all/conanfile.py create mode 100644 recipes/libslz/all/test_package/CMakeLists.txt create mode 100644 recipes/libslz/all/test_package/conanfile.py create mode 100644 recipes/libslz/all/test_package/test_package.c create mode 100644 recipes/libslz/config.yml create mode 100644 recipes/libsmacker/all/conandata.yml create mode 100644 recipes/libsmacker/all/conanfile.py create mode 100644 recipes/libsmacker/all/patches/0001-install-header.patch create mode 100644 recipes/libsmacker/all/test_package/CMakeLists.txt create mode 100644 recipes/libsmacker/all/test_package/conanfile.py create mode 100644 recipes/libsmacker/all/test_package/test_package.c create mode 100644 recipes/libsmacker/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsmacker/all/test_v1_package/conanfile.py create mode 100644 recipes/libsmacker/config.yml create mode 100644 recipes/libsndfile/all/conandata.yml create mode 100644 recipes/libsndfile/all/conanfile.py create mode 100644 recipes/libsndfile/all/patches/1.0.30-0001-disable-static-libgcc-mingw.patch create mode 100644 recipes/libsndfile/all/patches/1.0.31-0001-fix-msvc-runtime-logic.patch create mode 100644 recipes/libsndfile/all/test_package/CMakeLists.txt create mode 100644 recipes/libsndfile/all/test_package/conanfile.py create mode 100644 recipes/libsndfile/all/test_package/test_package.cpp create mode 100644 recipes/libsndfile/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsndfile/all/test_v1_package/conanfile.py create mode 100644 recipes/libsndfile/config.yml create mode 100644 recipes/libsodium/all/conandata.yml create mode 100644 recipes/libsodium/all/conanfile.py create mode 100644 recipes/libsodium/all/patches/0001-1.0.18-msvc_props.patch create mode 100644 recipes/libsodium/all/test_package/CMakeLists.txt create mode 100644 recipes/libsodium/all/test_package/conanfile.py create mode 100644 recipes/libsodium/all/test_package/test_package.c create mode 100644 recipes/libsodium/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsodium/all/test_v1_package/conanfile.py create mode 100644 recipes/libsodium/config.yml create mode 100644 recipes/libsolace/all/conandata.yml create mode 100644 recipes/libsolace/all/conanfile.py create mode 100644 recipes/libsolace/all/test_package/CMakeLists.txt create mode 100644 recipes/libsolace/all/test_package/conanfile.py create mode 100644 recipes/libsolace/all/test_package/example.cpp create mode 100644 recipes/libsolace/config.yml create mode 100644 recipes/libspatialindex/all/conandata.yml create mode 100644 recipes/libspatialindex/all/conanfile.py create mode 100644 recipes/libspatialindex/all/patches/0001-fix-static-and-mingw.patch create mode 100644 recipes/libspatialindex/all/patches/0002-fix-capi.patch create mode 100644 recipes/libspatialindex/all/patches/0003-macos-install-name.patch create mode 100644 recipes/libspatialindex/all/test_package/CMakeLists.txt create mode 100644 recipes/libspatialindex/all/test_package/conanfile.py create mode 100644 recipes/libspatialindex/all/test_package/test_package.c create mode 100644 recipes/libspatialindex/all/test_package/test_package.cpp create mode 100644 recipes/libspatialindex/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libspatialindex/all/test_v1_package/conanfile.py create mode 100644 recipes/libspatialindex/config.yml create mode 100644 recipes/libspatialite/all/conandata.yml create mode 100644 recipes/libspatialite/all/conanfile.py create mode 100644 recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch create mode 100644 recipes/libspatialite/all/patches/0002-nmake-honor-flags.patch create mode 100644 recipes/libspatialite/all/patches/0003-msvc-minizip.patch create mode 100644 recipes/libspatialite/all/test_package/CMakeLists.txt create mode 100644 recipes/libspatialite/all/test_package/conanfile.py create mode 100644 recipes/libspatialite/all/test_package/test_package.c create mode 100644 recipes/libspatialite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libspatialite/all/test_v1_package/conanfile.py create mode 100644 recipes/libspatialite/config.yml create mode 100644 recipes/libspng/all/conandata.yml create mode 100644 recipes/libspng/all/conanfile.py create mode 100644 recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch create mode 100644 recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch create mode 100644 recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch create mode 100644 recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch create mode 100644 recipes/libspng/all/test_package/CMakeLists.txt create mode 100644 recipes/libspng/all/test_package/conanfile.py create mode 100644 recipes/libspng/all/test_package/test_package.c create mode 100644 recipes/libspng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libspng/all/test_v1_package/conanfile.py create mode 100644 recipes/libspng/config.yml create mode 100644 recipes/libsquish/all/conandata.yml create mode 100644 recipes/libsquish/all/conanfile.py create mode 100644 recipes/libsquish/all/patches/0001-fix-cmake-simd-openmp-install.patch create mode 100644 recipes/libsquish/all/patches/0002-export-symbols.patch create mode 100644 recipes/libsquish/all/test_package/CMakeLists.txt create mode 100644 recipes/libsquish/all/test_package/conanfile.py create mode 100644 recipes/libsquish/all/test_package/test_package.cpp create mode 100644 recipes/libsquish/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsquish/all/test_v1_package/conanfile.py create mode 100644 recipes/libsquish/config.yml create mode 100644 recipes/libsrtp/all/conandata.yml create mode 100644 recipes/libsrtp/all/conanfile.py create mode 100644 recipes/libsrtp/all/test_package/CMakeLists.txt create mode 100644 recipes/libsrtp/all/test_package/conanfile.py create mode 100644 recipes/libsrtp/all/test_package/test_package.c create mode 100644 recipes/libsrtp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsrtp/all/test_v1_package/conanfile.py create mode 100644 recipes/libsrtp/config.yml create mode 100644 recipes/libssh2/all/CMakeLists.txt create mode 100644 recipes/libssh2/all/conandata.yml create mode 100644 recipes/libssh2/all/conanfile.py create mode 100644 recipes/libssh2/all/patches/0001-threads.patch create mode 100644 recipes/libssh2/all/test_package/CMakeLists.txt create mode 100644 recipes/libssh2/all/test_package/conanfile.py create mode 100644 recipes/libssh2/all/test_package/test_package.c create mode 100644 recipes/libssh2/config.yml create mode 100644 recipes/libstudxml/1.0.x/conandata.yml create mode 100644 recipes/libstudxml/1.0.x/conanfile.py create mode 100644 recipes/libstudxml/1.0.x/patches/configure-ac.patch create mode 100644 recipes/libstudxml/1.0.x/patches/makefile-am.patch create mode 100644 recipes/libstudxml/1.0.x/test_package/CMakeLists.txt create mode 100644 recipes/libstudxml/1.0.x/test_package/conanfile.py create mode 100644 recipes/libstudxml/1.0.x/test_package/test_package.cpp create mode 100644 recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libstudxml/1.0.x/test_v1_package/conanfile.py create mode 100644 recipes/libstudxml/1.1.x/CMakeLists.txt create mode 100644 recipes/libstudxml/1.1.x/conandata.yml create mode 100644 recipes/libstudxml/1.1.x/conanfile.py create mode 100644 recipes/libstudxml/1.1.x/test_package/CMakeLists.txt create mode 100644 recipes/libstudxml/1.1.x/test_package/conanfile.py create mode 100644 recipes/libstudxml/1.1.x/test_package/test_package.cpp create mode 100644 recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libstudxml/1.1.x/test_v1_package/conanfile.py create mode 100644 recipes/libstudxml/config.yml create mode 100644 recipes/libsvm/all/CMakeLists.txt create mode 100644 recipes/libsvm/all/conandata.yml create mode 100644 recipes/libsvm/all/conanfile.py create mode 100644 recipes/libsvm/all/test_package/CMakeLists.txt create mode 100644 recipes/libsvm/all/test_package/conanfile.py create mode 100644 recipes/libsvm/all/test_package/test_package.c create mode 100644 recipes/libsvm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsvm/all/test_v1_package/conanfile.py create mode 100644 recipes/libsvm/config.yml create mode 100644 recipes/libsvtav1/all/conandata.yml create mode 100644 recipes/libsvtav1/all/conanfile.py create mode 100644 recipes/libsvtav1/all/patches/llvm-clang-macos.patch create mode 100644 recipes/libsvtav1/all/test_package/CMakeLists.txt create mode 100644 recipes/libsvtav1/all/test_package/conanfile.py create mode 100644 recipes/libsvtav1/all/test_package/test_package.cpp create mode 100644 recipes/libsvtav1/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsvtav1/all/test_v1_package/conanfile.py create mode 100644 recipes/libsvtav1/config.yml create mode 100644 recipes/libsystemd/all/conandata.yml create mode 100644 recipes/libsystemd/all/conanfile.py create mode 100644 recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch create mode 100644 recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch create mode 100644 recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch create mode 100644 recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch create mode 100644 recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch create mode 100644 recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch create mode 100644 recipes/libsystemd/all/patches/251.15/0001-Remove-dependency-from-coreutils.patch create mode 100644 recipes/libsystemd/all/patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch create mode 100644 recipes/libsystemd/all/test_package/CMakeLists.txt create mode 100644 recipes/libsystemd/all/test_package/conanfile.py create mode 100644 recipes/libsystemd/all/test_package/test_package.c create mode 100644 recipes/libsystemd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsystemd/all/test_v1_package/conanfile.py create mode 100644 recipes/libsystemd/config.yml create mode 100644 recipes/libtar/all/conandata.yml create mode 100644 recipes/libtar/all/conanfile.py create mode 100644 recipes/libtar/all/test_package/CMakeLists.txt create mode 100644 recipes/libtar/all/test_package/conanfile.py create mode 100644 recipes/libtar/all/test_package/test_package.c create mode 100644 recipes/libtar/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtar/all/test_v1_package/conanfile.py create mode 100644 recipes/libtar/config.yml create mode 100644 recipes/libtasn1/all/conandata.yml create mode 100644 recipes/libtasn1/all/conanfile.py create mode 100644 recipes/libtasn1/all/patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch create mode 100644 recipes/libtasn1/all/test_package/CMakeLists.txt create mode 100644 recipes/libtasn1/all/test_package/conanfile.py create mode 100644 recipes/libtasn1/all/test_package/pkix.asn create mode 100644 recipes/libtasn1/all/test_package/test_package.c create mode 100644 recipes/libtasn1/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtasn1/all/test_v1_package/conanfile.py create mode 100644 recipes/libtasn1/config.yml create mode 100644 recipes/libtiff/all/conandata.yml create mode 100644 recipes/libtiff/all/conanfile.py create mode 100644 recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch create mode 100644 recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch create mode 100644 recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch create mode 100644 recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.5.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/test_package/CMakeLists.txt create mode 100644 recipes/libtiff/all/test_package/conanfile.py create mode 100644 recipes/libtiff/all/test_package/test_package.c create mode 100644 recipes/libtiff/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtiff/all/test_v1_package/conanfile.py create mode 100644 recipes/libtiff/config.yml create mode 100644 recipes/libtins/all/CMakeLists.txt create mode 100644 recipes/libtins/all/conandata.yml create mode 100644 recipes/libtins/all/conanfile.py create mode 100644 recipes/libtins/all/test_package/CMakeLists.txt create mode 100644 recipes/libtins/all/test_package/conanfile.py create mode 100644 recipes/libtins/all/test_package/test_package.cpp create mode 100644 recipes/libtins/config.yml create mode 100644 recipes/libtommath/all/conandata.yml create mode 100644 recipes/libtommath/all/conanfile.py create mode 100644 recipes/libtommath/all/patches/0001-enable-building-dll-s-using-makefile-msvc.patch create mode 100644 recipes/libtommath/all/test_package/CMakeLists.txt create mode 100644 recipes/libtommath/all/test_package/conanfile.py create mode 100644 recipes/libtommath/all/test_package/test_package.c create mode 100644 recipes/libtommath/config.yml create mode 100644 recipes/libtool/all/conandata.yml create mode 100644 recipes/libtool/all/conanfile.py create mode 100644 recipes/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch create mode 100644 recipes/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch create mode 100644 recipes/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch create mode 100644 recipes/libtool/all/test_package/autotools/Makefile.am create mode 100644 recipes/libtool/all/test_package/autotools/configure.ac create mode 100644 recipes/libtool/all/test_package/autotools/lib.c create mode 100644 recipes/libtool/all/test_package/autotools/lib.h create mode 100644 recipes/libtool/all/test_package/autotools/libtestlib.sym create mode 100644 recipes/libtool/all/test_package/autotools/test_package.c create mode 100644 recipes/libtool/all/test_package/autotools/testlib_private.h create mode 100644 recipes/libtool/all/test_package/conanfile.py create mode 100644 recipes/libtool/all/test_package/ltdl/CMakeLists.txt create mode 100644 recipes/libtool/all/test_package/ltdl/liba.c create mode 100644 recipes/libtool/all/test_package/ltdl/static_lib.c create mode 100644 recipes/libtool/all/test_package/ltdl/test_package.c create mode 100644 recipes/libtool/all/test_package/sis/Makefile.am create mode 100644 recipes/libtool/all/test_package/sis/configure.ac create mode 100644 recipes/libtool/all/test_package/sis/shared.sym create mode 100644 recipes/libtool/all/test_package/sis/shared_lib.c create mode 100644 recipes/libtool/all/test_v1_package/autotools/Makefile.am create mode 100644 recipes/libtool/all/test_v1_package/autotools/configure.ac create mode 100644 recipes/libtool/all/test_v1_package/autotools/lib.c create mode 100644 recipes/libtool/all/test_v1_package/autotools/lib.h create mode 100644 recipes/libtool/all/test_v1_package/autotools/libtestlib.sym create mode 100644 recipes/libtool/all/test_v1_package/autotools/test_package.c create mode 100644 recipes/libtool/all/test_v1_package/autotools/testlib_private.h create mode 100644 recipes/libtool/all/test_v1_package/conanfile.py create mode 100644 recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt create mode 100644 recipes/libtool/all/test_v1_package/ltdl/liba.c create mode 100644 recipes/libtool/all/test_v1_package/ltdl/test_package.c create mode 100644 recipes/libtool/all/test_v1_package/sis/CMakeLists.txt create mode 100644 recipes/libtool/all/test_v1_package/sis/Makefile.am create mode 100644 recipes/libtool/all/test_v1_package/sis/configure.ac create mode 100644 recipes/libtool/all/test_v1_package/sis/shared.sym create mode 100644 recipes/libtool/all/test_v1_package/sis/shared_lib.c create mode 100644 recipes/libtool/all/test_v1_package/sis/static_lib.c create mode 100644 recipes/libtool/config.yml create mode 100644 recipes/libtorrent/all/conandata.yml create mode 100644 recipes/libtorrent/all/conanfile.py create mode 100644 recipes/libtorrent/all/patches/1.2.3-0002-boost-system-header-only-1.69+.patch create mode 100644 recipes/libtorrent/all/patches/1.2.3-0003-include-cstddef.patch create mode 100644 recipes/libtorrent/all/patches/1.2.3-0004-increase-handle-storage-sizes.patch create mode 100644 recipes/libtorrent/all/test_package/CMakeLists.txt create mode 100644 recipes/libtorrent/all/test_package/conanfile.py create mode 100644 recipes/libtorrent/all/test_package/test_package.cpp create mode 100644 recipes/libtorrent/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtorrent/all/test_v1_package/conanfile.py create mode 100644 recipes/libtorrent/config.yml create mode 100644 recipes/libucl/all/conandata.yml create mode 100644 recipes/libucl/all/conanfile.py create mode 100644 recipes/libucl/all/patches/0001-0.8.1-shared-win32.patch create mode 100644 recipes/libucl/all/patches/0002-0.8.1-cmake-add-install+use-find_package.patch create mode 100644 recipes/libucl/all/patches/0002-0.8.2-cmake-add-install+use-find_package.patch create mode 100644 recipes/libucl/all/patches/0003-no-strings-h.patch create mode 100644 recipes/libucl/all/patches/0004-0.8.1-cmake-minimum-required.patch create mode 100644 recipes/libucl/all/patches/0004-0.8.2-cmake-minimum-required.patch create mode 100644 recipes/libucl/all/patches/0005-0.8.1-add-_tmp.patch create mode 100644 recipes/libucl/all/test_package/CMakeLists.txt create mode 100644 recipes/libucl/all/test_package/conanfile.py create mode 100644 recipes/libucl/all/test_package/sample.conf create mode 100644 recipes/libucl/all/test_package/test_package.cpp create mode 100644 recipes/libucl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libucl/all/test_v1_package/conanfile.py create mode 100644 recipes/libucl/config.yml create mode 100644 recipes/libudev/all/conanfile.py create mode 100644 recipes/libudev/all/test_package/CMakeLists.txt create mode 100644 recipes/libudev/all/test_package/conanfile.py create mode 100644 recipes/libudev/all/test_package/test_package.c create mode 100644 recipes/libudev/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libudev/all/test_v1_package/conanfile.py create mode 100644 recipes/libudev/config.yml create mode 100644 recipes/libui/all/CMakeLists.txt create mode 100644 recipes/libui/all/conandata.yml create mode 100644 recipes/libui/all/conanfile.py create mode 100644 recipes/libui/all/test_package/CMakeLists.txt create mode 100644 recipes/libui/all/test_package/conanfile.py create mode 100644 recipes/libui/all/test_package/test_package.c create mode 100644 recipes/libui/config.yml create mode 100644 recipes/libunifex/all/CMakeLists.txt create mode 100644 recipes/libunifex/all/conandata.yml create mode 100644 recipes/libunifex/all/conanfile.py create mode 100644 recipes/libunifex/all/test_package/CMakeLists.txt create mode 100644 recipes/libunifex/all/test_package/conanfile.py create mode 100644 recipes/libunifex/all/test_package/test_package.cpp create mode 100644 recipes/libunifex/config.yml create mode 100644 recipes/libunistring/all/conandata.yml create mode 100644 recipes/libunistring/all/conanfile.py create mode 100644 recipes/libunistring/all/test_package/CMakeLists.txt create mode 100644 recipes/libunistring/all/test_package/conanfile.py create mode 100644 recipes/libunistring/all/test_package/test_package.c create mode 100644 recipes/libunistring/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libunistring/all/test_v1_package/conanfile.py create mode 100644 recipes/libunistring/config.yml create mode 100644 recipes/libunwind/all/conandata.yml create mode 100644 recipes/libunwind/all/conanfile.py create mode 100644 recipes/libunwind/all/patches/0001-multiple-definition-gcc10.patch create mode 100644 recipes/libunwind/all/test_package/CMakeLists.txt create mode 100644 recipes/libunwind/all/test_package/conanfile.py create mode 100644 recipes/libunwind/all/test_package/test_package.c create mode 100644 recipes/libunwind/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libunwind/all/test_v1_package/conanfile.py create mode 100644 recipes/libunwind/config.yml create mode 100644 recipes/liburing/all/conandata.yml create mode 100644 recipes/liburing/all/conanfile.py create mode 100644 recipes/liburing/all/patches/0001-liburing-2.1-memfd-create.patch create mode 100644 recipes/liburing/all/test_package/CMakeLists.txt create mode 100644 recipes/liburing/all/test_package/conanfile.py create mode 100644 recipes/liburing/all/test_package/test_package.c create mode 100644 recipes/liburing/config.yml create mode 100644 recipes/libusb-compat/all/CMakeLists.txt.in create mode 100644 recipes/libusb-compat/all/conandata.yml create mode 100644 recipes/libusb-compat/all/conanfile.py create mode 100644 recipes/libusb-compat/all/patches/0001-fix-autoconf-msvc-mingw.patch create mode 100644 recipes/libusb-compat/all/patches/0002-fix-msvc-linkage-and-fix-msvc-vararg-macros.patch create mode 100644 recipes/libusb-compat/all/test_package/CMakeLists.txt create mode 100644 recipes/libusb-compat/all/test_package/conanfile.py create mode 100644 recipes/libusb-compat/all/test_package/test_package.c create mode 100644 recipes/libusb-compat/config.yml create mode 100644 recipes/libusb/all/conandata.yml create mode 100644 recipes/libusb/all/conanfile.py create mode 100644 recipes/libusb/all/patches/1.0.23-0001-relax-windows-sdk-restriction.patch create mode 100644 recipes/libusb/all/patches/1.0.24-0001-relax-windows-sdk-restriction.patch create mode 100644 recipes/libusb/all/test_package/CMakeLists.txt create mode 100644 recipes/libusb/all/test_package/conanfile.py create mode 100644 recipes/libusb/all/test_package/test_package.c create mode 100644 recipes/libusb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libusb/all/test_v1_package/conanfile.py create mode 100644 recipes/libusb/config.yml create mode 100644 recipes/libuuid/all/conandata.yml create mode 100644 recipes/libuuid/all/conanfile.py create mode 100644 recipes/libuuid/all/patches/0001-check-sys-syscall-h+wrap-includes.patch create mode 100644 recipes/libuuid/all/test_package/CMakeLists.txt create mode 100644 recipes/libuuid/all/test_package/conanfile.py create mode 100644 recipes/libuuid/all/test_package/test_package.c create mode 100644 recipes/libuuid/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libuuid/all/test_v1_package/conanfile.py create mode 100644 recipes/libuuid/config.yml create mode 100644 recipes/libuv/all/conandata.yml create mode 100644 recipes/libuv/all/conanfile.py create mode 100644 recipes/libuv/all/patches/1.38.1/fix-cmake.patch create mode 100644 recipes/libuv/all/patches/1.40.0/fix-cmake.patch create mode 100644 recipes/libuv/all/patches/1.40.0/fix-ios.patch create mode 100644 recipes/libuv/all/patches/1.41.0/fix-cmake.patch create mode 100644 recipes/libuv/all/patches/1.42.0/fix-cmake.patch create mode 100644 recipes/libuv/all/patches/1.43.0/fix-cmake.patch create mode 100644 recipes/libuv/all/patches/1.44.1/fix-cmake.patch create mode 100644 recipes/libuv/all/patches/1.44.2/fix-cmake.patch create mode 100644 recipes/libuv/all/test_package/CMakeLists.txt create mode 100644 recipes/libuv/all/test_package/conanfile.py create mode 100644 recipes/libuv/all/test_package/test_package.c create mode 100644 recipes/libuv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libuv/all/test_v1_package/conanfile.py create mode 100644 recipes/libuv/config.yml create mode 100644 recipes/libuvc/all/conandata.yml create mode 100644 recipes/libuvc/all/conanfile.py create mode 100644 recipes/libuvc/all/patches/0.0.7-0001-fix-cci-packagename.patch create mode 100644 recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch create mode 100644 recipes/libuvc/all/patches/0002-adjust-install-folder.patch create mode 100644 recipes/libuvc/all/test_package/CMakeLists.txt create mode 100644 recipes/libuvc/all/test_package/conanfile.py create mode 100644 recipes/libuvc/all/test_package/test_package.c create mode 100644 recipes/libuvc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libuvc/all/test_v1_package/conanfile.py create mode 100644 recipes/libuvc/config.yml create mode 100644 recipes/libvault/all/CMakeLists.txt create mode 100644 recipes/libvault/all/conandata.yml create mode 100644 recipes/libvault/all/conanfile.py create mode 100644 recipes/libvault/all/patches/fix-cmake-0.48.0.patch create mode 100644 recipes/libvault/all/patches/fix-cmake-0.51.0.patch create mode 100644 recipes/libvault/all/test_package/CMakeLists.txt create mode 100644 recipes/libvault/all/test_package/conanfile.py create mode 100644 recipes/libvault/all/test_package/test_package.cpp create mode 100644 recipes/libvault/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libvault/all/test_v1_package/conanfile.py create mode 100644 recipes/libvault/config.yml create mode 100644 recipes/libverto/all/conandata.yml create mode 100644 recipes/libverto/all/conanfile.py create mode 100644 recipes/libverto/all/test_package/CMakeLists.txt create mode 100644 recipes/libverto/all/test_package/conanfile.py create mode 100644 recipes/libverto/all/test_package/test_package.c create mode 100644 recipes/libverto/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libverto/all/test_v1_package/conanfile.py create mode 100644 recipes/libverto/config.yml create mode 100644 recipes/libvips/all/conandata.yml create mode 100644 recipes/libvips/all/conanfile.py create mode 100644 recipes/libvips/all/test_package/CMakeLists.txt create mode 100644 recipes/libvips/all/test_package/conanfile.py create mode 100644 recipes/libvips/all/test_package/test_package.c create mode 100644 recipes/libvips/all/test_package/testimg.jpg create mode 100644 recipes/libvips/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libvips/all/test_v1_package/conanfile.py create mode 100644 recipes/libvips/config.yml create mode 100644 recipes/libvpx/all/conandata.yml create mode 100644 recipes/libvpx/all/conanfile.py create mode 100644 recipes/libvpx/all/patches/0001-extended-support-1.10.0.patch create mode 100644 recipes/libvpx/all/patches/0001-extended-support-1.9.0.patch create mode 100644 recipes/libvpx/all/patches/0002-msvc_conan_build.patch create mode 100644 recipes/libvpx/all/test_package/CMakeLists.txt create mode 100644 recipes/libvpx/all/test_package/conanfile.py create mode 100644 recipes/libvpx/all/test_package/test_package.c create mode 100644 recipes/libvpx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libvpx/all/test_v1_package/conanfile.py create mode 100644 recipes/libvpx/config.yml create mode 100644 recipes/libwebp/all/conandata.yml create mode 100644 recipes/libwebp/all/conanfile.py create mode 100644 recipes/libwebp/all/patches/1.0.3-0001-fix-dll-export.patch create mode 100644 recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch create mode 100644 recipes/libwebp/all/patches/1.1.0-0002-qnx.patch create mode 100644 recipes/libwebp/all/patches/1.1.0-0003-build-libwebpmux.patch create mode 100644 recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch create mode 100644 recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch create mode 100644 recipes/libwebp/all/test_package/CMakeLists.txt create mode 100644 recipes/libwebp/all/test_package/conanfile.py create mode 100644 recipes/libwebp/all/test_package/test_package.c create mode 100644 recipes/libwebp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libwebp/all/test_v1_package/conanfile.py create mode 100644 recipes/libwebp/config.yml create mode 100644 recipes/libwebsockets/all/CMakeLists.txt create mode 100644 recipes/libwebsockets/all/conandata.yml create mode 100644 recipes/libwebsockets/all/conanfile.py create mode 100644 recipes/libwebsockets/all/test_package/CMakeLists.txt create mode 100644 recipes/libwebsockets/all/test_package/conanfile.py create mode 100644 recipes/libwebsockets/all/test_package/test_package.c create mode 100644 recipes/libwebsockets/config.yml create mode 100644 recipes/libx264/all/conandata.yml create mode 100644 recipes/libx264/all/conanfile.py create mode 100644 recipes/libx264/all/test_package/CMakeLists.txt create mode 100644 recipes/libx264/all/test_package/conanfile.py create mode 100644 recipes/libx264/all/test_package/test_package.c create mode 100644 recipes/libx264/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libx264/all/test_v1_package/conanfile.py create mode 100644 recipes/libx264/config.yml create mode 100644 recipes/libx265/all/conandata.yml create mode 100644 recipes/libx265/all/conanfile.py create mode 100644 recipes/libx265/all/patches/3.2.1-0001-remove_register_classifier.patch create mode 100644 recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch create mode 100644 recipes/libx265/all/patches/3.4-0001-numa.patch create mode 100644 recipes/libx265/all/test_package/CMakeLists.txt create mode 100644 recipes/libx265/all/test_package/conanfile.py create mode 100644 recipes/libx265/all/test_package/test_package.c create mode 100644 recipes/libx265/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libx265/all/test_v1_package/conanfile.py create mode 100644 recipes/libx265/config.yml create mode 100644 recipes/libxcrypt/all/conandata.yml create mode 100644 recipes/libxcrypt/all/conanfile.py create mode 100644 recipes/libxcrypt/all/test_package/CMakeLists.txt create mode 100644 recipes/libxcrypt/all/test_package/conanfile.py create mode 100644 recipes/libxcrypt/all/test_package/test_package.c create mode 100644 recipes/libxcrypt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxcrypt/all/test_v1_package/conanfile.py create mode 100644 recipes/libxcrypt/config.yml create mode 100644 recipes/libxft/all/conandata.yml create mode 100644 recipes/libxft/all/conanfile.py create mode 100644 recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch create mode 100644 recipes/libxft/all/test_package/CMakeLists.txt create mode 100644 recipes/libxft/all/test_package/conanfile.py create mode 100644 recipes/libxft/all/test_package/test_package.c create mode 100644 recipes/libxft/config.yml create mode 100644 recipes/libxls/all/conandata.yml create mode 100644 recipes/libxls/all/conanfile.py create mode 100644 recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch create mode 100644 recipes/libxls/all/test_package/CMakeLists.txt create mode 100644 recipes/libxls/all/test_package/conanfile.py create mode 100644 recipes/libxls/all/test_package/test_package.c create mode 100644 recipes/libxls/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxls/all/test_v1_package/conanfile.py create mode 100644 recipes/libxls/config.yml create mode 100644 recipes/libxlsxwriter/all/conandata.yml create mode 100644 recipes/libxlsxwriter/all/conanfile.py create mode 100644 recipes/libxlsxwriter/all/patches/1.0.0-0001-fix-cmake.patch create mode 100644 recipes/libxlsxwriter/all/patches/1.1.3-0001-fix-cmake.patch create mode 100644 recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch create mode 100644 recipes/libxlsxwriter/all/test_package/CMakeLists.txt create mode 100644 recipes/libxlsxwriter/all/test_package/conanfile.py create mode 100644 recipes/libxlsxwriter/all/test_package/test_package.c create mode 100644 recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxlsxwriter/all/test_v1_package/conanfile.py create mode 100644 recipes/libxlsxwriter/config.yml create mode 100644 recipes/libxml2/all/conandata.yml create mode 100644 recipes/libxml2/all/conanfile.py create mode 100644 recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_cmake_module_package/conanfile.py create mode 100644 recipes/libxml2/all/test_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_package/books.xml create mode 100644 recipes/libxml2/all/test_package/conanfile.py create mode 100644 recipes/libxml2/all/test_package/test_package.c create mode 100644 recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py create mode 100644 recipes/libxml2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_v1_package/conanfile.py create mode 100644 recipes/libxml2/config.yml create mode 100644 recipes/libxmlpp/2.x.x/conandata.yml create mode 100644 recipes/libxmlpp/2.x.x/conanfile.py create mode 100644 recipes/libxmlpp/2.x.x/patches/2.42.1-0001-enable_static_builds_on_msvc.patch create mode 100644 recipes/libxmlpp/2.x.x/patches/5.0.1-0001-enable_static_builds_on_msvc.patch create mode 100644 recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/libxmlpp/2.x.x/test_package/conanfile.py create mode 100644 recipes/libxmlpp/2.x.x/test_package/example.xml create mode 100644 recipes/libxmlpp/2.x.x/test_package/test_package.cpp create mode 100644 recipes/libxmlpp/config.yml create mode 100644 recipes/libxpm/all/CMakeLists.txt create mode 100644 recipes/libxpm/all/conandata.yml create mode 100644 recipes/libxpm/all/conanfile.py create mode 100644 recipes/libxpm/all/test_package/CMakeLists.txt create mode 100644 recipes/libxpm/all/test_package/conanfile.py create mode 100644 recipes/libxpm/all/test_package/test_package.c create mode 100644 recipes/libxpm/all/windows/libXpm.def create mode 100644 recipes/libxpm/config.yml create mode 100644 recipes/libxshmfence/all/conandata.yml create mode 100644 recipes/libxshmfence/all/conanfile.py create mode 100644 recipes/libxshmfence/all/test_package/CMakeLists.txt create mode 100644 recipes/libxshmfence/all/test_package/conanfile.py create mode 100644 recipes/libxshmfence/all/test_package/test_package.c create mode 100644 recipes/libxshmfence/config.yml create mode 100644 recipes/libxslt/all/conandata.yml create mode 100644 recipes/libxslt/all/conanfile.py create mode 100644 recipes/libxslt/all/patches/0001-allow-xsltproc-link-shared-mt.patch create mode 100644 recipes/libxslt/all/patches/0002-Add-configuration-for-profiler.patch create mode 100644 recipes/libxslt/all/test_package/CMakeLists.txt create mode 100644 recipes/libxslt/all/test_package/conanfile.py create mode 100644 recipes/libxslt/all/test_package/example.xml create mode 100644 recipes/libxslt/all/test_package/example.xsl create mode 100644 recipes/libxslt/all/test_package/libxslt_tutorial.c create mode 100644 recipes/libxslt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxslt/all/test_v1_package/conanfile.py create mode 100644 recipes/libxslt/config.yml create mode 100644 recipes/libyaml/all/conandata.yml create mode 100644 recipes/libyaml/all/conanfile.py create mode 100644 recipes/libyaml/all/test_package/CMakeLists.txt create mode 100644 recipes/libyaml/all/test_package/conanfile.py create mode 100644 recipes/libyaml/all/test_package/test_package.c create mode 100644 recipes/libyaml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libyaml/all/test_v1_package/conanfile.py create mode 100644 recipes/libyaml/config.yml create mode 100644 recipes/libyuv/all/conandata.yml create mode 100644 recipes/libyuv/all/conanfile.py create mode 100644 recipes/libyuv/all/patches/1768-0001-fix-cmake.patch create mode 100644 recipes/libyuv/all/patches/1841-0001-fix-cmake.patch create mode 100644 recipes/libyuv/all/patches/1854-0001-fix-cmake.patch create mode 100644 recipes/libyuv/all/test_package/CMakeLists.txt create mode 100644 recipes/libyuv/all/test_package/conanfile.py create mode 100644 recipes/libyuv/all/test_package/test_package.cpp create mode 100644 recipes/libyuv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libyuv/all/test_v1_package/conanfile.py create mode 100644 recipes/libyuv/config.yml create mode 100644 recipes/libzen/all/conandata.yml create mode 100644 recipes/libzen/all/conanfile.py create mode 100644 recipes/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch create mode 100644 recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch create mode 100644 recipes/libzen/all/test_package/CMakeLists.txt create mode 100644 recipes/libzen/all/test_package/conanfile.py create mode 100644 recipes/libzen/all/test_package/test_package.cpp create mode 100644 recipes/libzen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libzen/all/test_v1_package/conanfile.py create mode 100644 recipes/libzen/config.yml create mode 100644 recipes/libzip/all/conandata.yml create mode 100644 recipes/libzip/all/conanfile.py create mode 100644 recipes/libzip/all/patches/0001-cmake-install-bundle.patch create mode 100644 recipes/libzip/all/test_package/CMakeLists.txt create mode 100644 recipes/libzip/all/test_package/conanfile.py create mode 100644 recipes/libzip/all/test_package/test_package.c create mode 100644 recipes/libzip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libzip/all/test_v1_package/conanfile.py create mode 100644 recipes/libzip/config.yml create mode 100644 recipes/libzippp/all/conandata.yml create mode 100644 recipes/libzippp/all/conanfile.py create mode 100644 recipes/libzippp/all/test_package/CMakeLists.txt create mode 100644 recipes/libzippp/all/test_package/conanfile.py create mode 100644 recipes/libzippp/all/test_package/test_package.cpp create mode 100644 recipes/libzippp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libzippp/all/test_v1_package/conanfile.py create mode 100644 recipes/libzippp/config.yml create mode 100644 recipes/lief/all/conandata.yml create mode 100644 recipes/lief/all/conanfile.py create mode 100644 recipes/lief/all/patches/0.12.2-001_link_to_conan.patch create mode 100644 recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch create mode 100644 recipes/lief/all/patches/0.12.3-001_link_to_conan.patch create mode 100644 recipes/lief/all/patches/001_link_to_conan.patch create mode 100644 recipes/lief/all/patches/002_fix_resources_manager.patch create mode 100644 recipes/lief/all/patches/003_fix_json_include_path.patch create mode 100644 recipes/lief/all/patches/004_fix_elf_parser.patch create mode 100644 recipes/lief/all/patches/005_fix_compiler_detection.patch create mode 100644 recipes/lief/all/patches/006_fix_binary_cpp.patch create mode 100644 recipes/lief/all/test_package/CMakeLists.txt create mode 100644 recipes/lief/all/test_package/conanfile.py create mode 100644 recipes/lief/all/test_package/test_package.cpp create mode 100644 recipes/lief/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lief/all/test_v1_package/conanfile.py create mode 100644 recipes/lief/config.yml create mode 100644 recipes/lightgbm/all/CMakeLists.txt create mode 100644 recipes/lightgbm/all/conandata.yml create mode 100644 recipes/lightgbm/all/conanfile.py create mode 100644 recipes/lightgbm/all/patches/0001-fix-includes.patch create mode 100644 recipes/lightgbm/all/patches/0002-fix-openmp-clang.patch create mode 100644 recipes/lightgbm/all/patches/0003-fix-openmp-clang.patch create mode 100644 recipes/lightgbm/all/test_package/CMakeLists.txt create mode 100644 recipes/lightgbm/all/test_package/conanfile.py create mode 100644 recipes/lightgbm/all/test_package/test_package.cpp create mode 100644 recipes/lightgbm/config.yml create mode 100644 recipes/lightpcapng/all/CMakeLists.txt create mode 100644 recipes/lightpcapng/all/conandata.yml create mode 100644 recipes/lightpcapng/all/conanfile.py create mode 100644 recipes/lightpcapng/all/test_package/CMakeLists.txt create mode 100644 recipes/lightpcapng/all/test_package/conanfile.py create mode 100644 recipes/lightpcapng/all/test_package/test_package.c create mode 100644 recipes/lightpcapng/config.yml create mode 100644 recipes/linmath.h/all/conandata.yml create mode 100644 recipes/linmath.h/all/conanfile.py create mode 100644 recipes/linmath.h/all/test_package/CMakeLists.txt create mode 100644 recipes/linmath.h/all/test_package/conanfile.py create mode 100644 recipes/linmath.h/all/test_package/test_package.c create mode 100644 recipes/linmath.h/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/linmath.h/all/test_v1_package/conanfile.py create mode 100644 recipes/linmath.h/config.yml create mode 100644 recipes/linux-headers-generic/all/conandata.yml create mode 100644 recipes/linux-headers-generic/all/conanfile.py create mode 100644 recipes/linux-headers-generic/all/test_package/CMakeLists.txt create mode 100644 recipes/linux-headers-generic/all/test_package/conanfile.py create mode 100644 recipes/linux-headers-generic/all/test_package/test_package.c create mode 100644 recipes/linux-headers-generic/config.yml create mode 100644 recipes/linux-syscall-support/all/conandata.yml create mode 100644 recipes/linux-syscall-support/all/conanfile.py create mode 100644 recipes/linux-syscall-support/all/test_package/CMakeLists.txt create mode 100644 recipes/linux-syscall-support/all/test_package/conanfile.py create mode 100644 recipes/linux-syscall-support/all/test_package/test_package.c create mode 100644 recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/linux-syscall-support/all/test_v1_package/conanfile.py create mode 100644 recipes/linux-syscall-support/config.yml create mode 100644 recipes/liquid-dsp/all/conandata.yml create mode 100644 recipes/liquid-dsp/all/conanfile.py create mode 100644 recipes/liquid-dsp/all/generate_link_library.bat create mode 100644 recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch create mode 100644 recipes/liquid-dsp/all/test_package/CMakeLists.txt create mode 100644 recipes/liquid-dsp/all/test_package/conanfile.py create mode 100644 recipes/liquid-dsp/all/test_package/test_package.cpp create mode 100644 recipes/liquid-dsp/config.yml create mode 100644 recipes/litehtml/all/conandata.yml create mode 100644 recipes/litehtml/all/conanfile.py create mode 100644 recipes/litehtml/all/patches/0001-icu.patch create mode 100644 recipes/litehtml/all/test_package/CMakeLists.txt create mode 100644 recipes/litehtml/all/test_package/conanfile.py create mode 100644 recipes/litehtml/all/test_package/test_package.cpp create mode 100644 recipes/litehtml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/litehtml/all/test_v1_package/conanfile.py create mode 100644 recipes/litehtml/config.yml create mode 100644 recipes/llhttp/all/CMakeLists.txt create mode 100644 recipes/llhttp/all/conandata.yml create mode 100644 recipes/llhttp/all/conanfile.py create mode 100644 recipes/llhttp/all/patches/cmake_install_dirs.patch create mode 100644 recipes/llhttp/all/test_package/CMakeLists.txt create mode 100644 recipes/llhttp/all/test_package/conanfile.py create mode 100644 recipes/llhttp/all/test_package/test_package.c create mode 100644 recipes/llhttp/config.yml create mode 100644 recipes/llvm-core/all/CMakeLists.txt create mode 100644 recipes/llvm-core/all/conandata.yml create mode 100644 recipes/llvm-core/all/conanfile.py create mode 100644 recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch create mode 100644 recipes/llvm-core/all/patches/11x/11.1.0-native.patch create mode 100644 recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch create mode 100644 recipes/llvm-core/all/patches/12x/12.0.0-native.patch create mode 100644 recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch create mode 100644 recipes/llvm-core/all/patches/13x/13.0.0-native.patch create mode 100644 recipes/llvm-core/all/test_package/CMakeLists.txt create mode 100644 recipes/llvm-core/all/test_package/conanfile.py create mode 100644 recipes/llvm-core/all/test_package/test_function.ll create mode 100644 recipes/llvm-core/all/test_package/test_package.cpp create mode 100644 recipes/llvm-core/config.yml create mode 100644 recipes/llvm-openmp/all/CMakeLists.txt create mode 100644 recipes/llvm-openmp/all/conandata.yml create mode 100644 recipes/llvm-openmp/all/conanfile.py create mode 100644 recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch create mode 100644 recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch create mode 100644 recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch create mode 100644 recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch create mode 100644 recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch create mode 100644 recipes/llvm-openmp/all/patches/0003-fix-armv8-build_11.1.0.patch create mode 100644 recipes/llvm-openmp/all/test_package/CMakeLists.txt create mode 100644 recipes/llvm-openmp/all/test_package/conanfile.py create mode 100644 recipes/llvm-openmp/all/test_package/test_package.cpp create mode 100644 recipes/llvm-openmp/config.yml create mode 100644 recipes/lmdb/all/CMakeLists.txt create mode 100644 recipes/lmdb/all/conandata.yml create mode 100644 recipes/lmdb/all/conanfile.py create mode 100644 recipes/lmdb/all/test_package/CMakeLists.txt create mode 100644 recipes/lmdb/all/test_package/conanfile.py create mode 100644 recipes/lmdb/all/test_package/test_package.c create mode 100644 recipes/lmdb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lmdb/all/test_v1_package/conanfile.py create mode 100644 recipes/lmdb/config.yml create mode 100644 recipes/lodepng/all/CMakeLists.txt create mode 100644 recipes/lodepng/all/conandata.yml create mode 100644 recipes/lodepng/all/conanfile.py create mode 100644 recipes/lodepng/all/test_package/CMakeLists.txt create mode 100644 recipes/lodepng/all/test_package/bees.png create mode 100644 recipes/lodepng/all/test_package/conanfile.py create mode 100644 recipes/lodepng/all/test_package/test_package.cpp create mode 100644 recipes/lodepng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lodepng/all/test_v1_package/conanfile.py create mode 100644 recipes/lodepng/config.yml create mode 100644 recipes/log.c/all/CMakeLists.txt create mode 100644 recipes/log.c/all/conandata.yml create mode 100644 recipes/log.c/all/conanfile.py create mode 100644 recipes/log.c/all/test_package/CMakeLists.txt create mode 100644 recipes/log.c/all/test_package/conanfile.py create mode 100644 recipes/log.c/all/test_package/test_package.c create mode 100644 recipes/log.c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/log.c/all/test_v1_package/conanfile.py create mode 100644 recipes/log.c/config.yml create mode 100644 recipes/log4cplus/all/conandata.yml create mode 100644 recipes/log4cplus/all/conanfile.py create mode 100644 recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch create mode 100644 recipes/log4cplus/all/patches/2.0.6-0001-fix-cmake.patch create mode 100644 recipes/log4cplus/all/test_package/CMakeLists.txt create mode 100644 recipes/log4cplus/all/test_package/conanfile.py create mode 100644 recipes/log4cplus/all/test_package/test_package.cpp create mode 100644 recipes/log4cplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/log4cplus/all/test_v1_package/conanfile.py create mode 100644 recipes/log4cplus/config.yml create mode 100644 recipes/log4cxx/all/CMakeLists.txt create mode 100644 recipes/log4cxx/all/conandata.yml create mode 100644 recipes/log4cxx/all/conanfile.py create mode 100644 recipes/log4cxx/all/patches/0001-find-apr.patch create mode 100644 recipes/log4cxx/all/test_package/CMakeLists.txt create mode 100644 recipes/log4cxx/all/test_package/conanfile.py create mode 100644 recipes/log4cxx/all/test_package/log4cxx_config.xml create mode 100644 recipes/log4cxx/all/test_package/test_package.cpp create mode 100644 recipes/log4cxx/config.yml create mode 100644 recipes/logr/0.1.0/CMakeLists.txt create mode 100644 recipes/logr/0.1.0/conandata.yml create mode 100644 recipes/logr/0.1.0/conanfile.py create mode 100644 recipes/logr/0.1.0/test_package/CMakeLists.txt create mode 100644 recipes/logr/0.1.0/test_package/conanfile.py create mode 100644 recipes/logr/0.1.0/test_package/example.cpp create mode 100644 recipes/logr/all/conandata.yml create mode 100644 recipes/logr/all/conanfile.py create mode 100644 recipes/logr/all/test_package/CMakeLists.txt create mode 100644 recipes/logr/all/test_package/conanfile.py create mode 100644 recipes/logr/all/test_package/example.cpp create mode 100644 recipes/logr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/logr/all/test_v1_package/conanfile.py create mode 100644 recipes/logr/config.yml create mode 100644 recipes/ls-qpack/all/conandata.yml create mode 100644 recipes/ls-qpack/all/conanfile.py create mode 100644 recipes/ls-qpack/all/patches/0001-use-cci-package.patch create mode 100644 recipes/ls-qpack/all/patches/0002-add-installer.patch create mode 100644 recipes/ls-qpack/all/test_package/CMakeLists.txt create mode 100644 recipes/ls-qpack/all/test_package/conanfile.py create mode 100644 recipes/ls-qpack/all/test_package/test_package.c create mode 100644 recipes/ls-qpack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ls-qpack/all/test_v1_package/conanfile.py create mode 100644 recipes/ls-qpack/config.yml create mode 100644 recipes/lua/all/CMakeLists.txt create mode 100644 recipes/lua/all/conandata.yml create mode 100644 recipes/lua/all/conanfile.py create mode 100644 recipes/lua/all/patches/5.3.5/lua_mobile.patch create mode 100644 recipes/lua/all/test_package/CMakeLists.txt create mode 100644 recipes/lua/all/test_package/conanfile.py create mode 100644 recipes/lua/all/test_package/test_package.cpp create mode 100644 recipes/lua/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lua/all/test_v1_package/conanfile.py create mode 100644 recipes/lua/config.yml create mode 100644 recipes/luajit/all/conandata.yml create mode 100644 recipes/luajit/all/conanfile.py create mode 100644 recipes/luajit/all/patches/2.1.0-beta3-0001-remove-mac-deploy.patch create mode 100644 recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch create mode 100644 recipes/luajit/all/test_package/CMakeLists.txt create mode 100644 recipes/luajit/all/test_package/conanfile.py create mode 100644 recipes/luajit/all/test_package/test_package.c create mode 100644 recipes/luajit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/luajit/all/test_v1_package/conanfile.py create mode 100644 recipes/luajit/config.yml create mode 100644 recipes/luau/all/CMakeLists.txt create mode 100644 recipes/luau/all/conandata.yml create mode 100644 recipes/luau/all/conanfile.py create mode 100644 recipes/luau/all/patches/0.536-0001-fix-cmake.patch create mode 100644 recipes/luau/all/patches/0.536-0002-rename-lerp.patch create mode 100644 recipes/luau/all/patches/0.552-0001-fix-cmake.patch create mode 100644 recipes/luau/all/patches/0.568-0001-fix-cmake.patch create mode 100644 recipes/luau/all/patches/0.572-0001-fix-cmake.patch create mode 100644 recipes/luau/all/test_package/CMakeLists.txt create mode 100644 recipes/luau/all/test_package/conanfile.py create mode 100644 recipes/luau/all/test_package/test_package.cpp create mode 100644 recipes/luau/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/luau/all/test_v1_package/conanfile.py create mode 100644 recipes/luau/config.yml create mode 100644 recipes/lunasvg/all/conandata.yml create mode 100644 recipes/lunasvg/all/conanfile.py create mode 100644 recipes/lunasvg/all/patches/2.3.1-0001-fix-cmake.patch create mode 100644 recipes/lunasvg/all/patches/2.3.5-0001-fix-cmake.patch create mode 100644 recipes/lunasvg/all/test_package/CMakeLists.txt create mode 100644 recipes/lunasvg/all/test_package/conanfile.py create mode 100644 recipes/lunasvg/all/test_package/test_package.cpp create mode 100644 recipes/lunasvg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lunasvg/all/test_v1_package/conanfile.py create mode 100644 recipes/lunasvg/config.yml create mode 100644 recipes/luple/all/conandata.yml create mode 100644 recipes/luple/all/conanfile.py create mode 100644 recipes/luple/all/test_package/CMakeLists.txt create mode 100644 recipes/luple/all/test_package/conanfile.py create mode 100644 recipes/luple/all/test_package/test_package.cpp create mode 100644 recipes/luple/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/luple/all/test_v1_package/conanfile.py create mode 100644 recipes/luple/config.yml create mode 100644 recipes/lurlparser/all/CMakeLists.txt create mode 100644 recipes/lurlparser/all/conandata.yml create mode 100644 recipes/lurlparser/all/conanfile.py create mode 100644 recipes/lurlparser/all/test_package/CMakeLists.txt create mode 100644 recipes/lurlparser/all/test_package/conanfile.py create mode 100644 recipes/lurlparser/all/test_package/test_package.cpp create mode 100644 recipes/lurlparser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lurlparser/all/test_v1_package/conanfile.py create mode 100644 recipes/lurlparser/config.yml create mode 100644 recipes/lyra/all/conandata.yml create mode 100644 recipes/lyra/all/conanfile.py create mode 100644 recipes/lyra/all/test_package/CMakeLists.txt create mode 100644 recipes/lyra/all/test_package/conanfile.py create mode 100644 recipes/lyra/all/test_package/test_package.cpp create mode 100644 recipes/lyra/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lyra/all/test_v1_package/conanfile.py create mode 100644 recipes/lyra/all/test_v1_package/test_package.cpp create mode 100644 recipes/lyra/config.yml create mode 100644 recipes/lz4/all/conandata.yml create mode 100644 recipes/lz4/all/conanfile.py create mode 100644 recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch create mode 100644 recipes/lz4/all/patches/0002-cmake-optional-cli.patch create mode 100644 recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch create mode 100644 recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch create mode 100644 recipes/lz4/all/test_package/CMakeLists.txt create mode 100644 recipes/lz4/all/test_package/conanfile.py create mode 100644 recipes/lz4/all/test_package/lib.c create mode 100644 recipes/lz4/all/test_package/test_package.c create mode 100644 recipes/lz4/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lz4/all/test_v1_package/conanfile.py create mode 100644 recipes/lz4/config.yml create mode 100644 recipes/lzfse/all/conandata.yml create mode 100644 recipes/lzfse/all/conanfile.py create mode 100644 recipes/lzfse/all/patches/0001-fix-cmake.patch create mode 100644 recipes/lzfse/all/test_package/CMakeLists.txt create mode 100644 recipes/lzfse/all/test_package/conanfile.py create mode 100644 recipes/lzfse/all/test_package/test.txt create mode 100644 recipes/lzfse/all/test_package/test_package.c create mode 100644 recipes/lzfse/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lzfse/all/test_v1_package/conanfile.py create mode 100644 recipes/lzfse/config.yml create mode 100644 recipes/lzham/all/conandata.yml create mode 100644 recipes/lzham/all/conanfile.py create mode 100644 recipes/lzham/all/patches/aarch64-yield-cci.20220103.patch create mode 100644 recipes/lzham/all/patches/cmake-min-req-swap-cci.20220103.patch create mode 100644 recipes/lzham/all/patches/cmake-rm-tests-cci.20220103.patch create mode 100644 recipes/lzham/all/patches/fix-osx-cci.20220103.patch create mode 100644 recipes/lzham/all/patches/msvc-conan-cci.20220103.patch create mode 100644 recipes/lzham/all/patches/use-lzham-types-cci.20220103.patch create mode 100644 recipes/lzham/all/test_package/CMakeLists.txt create mode 100644 recipes/lzham/all/test_package/conanfile.py create mode 100644 recipes/lzham/all/test_package/test_package.cpp create mode 100644 recipes/lzham/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lzham/all/test_v1_package/conanfile.py create mode 100644 recipes/lzham/config.yml create mode 100644 recipes/lzip/all/conandata.yml create mode 100644 recipes/lzip/all/conanfile.py create mode 100644 recipes/lzip/all/patches/1.21-0001-any-compiler.patch create mode 100644 recipes/lzip/all/patches/1.22-0001-any-compiler.patch create mode 100644 recipes/lzip/all/test_package/conanfile.py create mode 100644 recipes/lzip/config.yml create mode 100644 recipes/lzma_sdk/9.20/conandata.yml create mode 100644 recipes/lzma_sdk/9.20/conanfile.py create mode 100644 recipes/lzma_sdk/9.20/test_package/conanfile.py create mode 100644 recipes/lzma_sdk/config.yml create mode 100644 recipes/lzo/all/conandata.yml create mode 100644 recipes/lzo/all/conanfile.py create mode 100644 recipes/lzo/all/test_package/CMakeLists.txt create mode 100644 recipes/lzo/all/test_package/conanfile.py create mode 100644 recipes/lzo/all/test_package/test_package.c create mode 100644 recipes/lzo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lzo/all/test_v1_package/conanfile.py create mode 100644 recipes/lzo/all/test_v1_package/test_package.c create mode 100644 recipes/lzo/config.yml create mode 100644 recipes/m4/all/conandata.yml create mode 100644 recipes/m4/all/conanfile.py create mode 100644 recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch create mode 100644 recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch create mode 100644 recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch create mode 100644 recipes/m4/all/patches/1.4.18-0004-fix-checks.patch create mode 100644 recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch create mode 100644 recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch create mode 100644 recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch create mode 100644 recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch create mode 100644 recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch create mode 100644 recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch create mode 100644 recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch create mode 100644 recipes/m4/all/patches/1.4.19-0002-ar-lib.patch create mode 100644 recipes/m4/all/patches/1.4.19-0003-msvc-debug-assertion.patch create mode 100644 recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch create mode 100644 recipes/m4/all/test_package/conanfile.py create mode 100644 recipes/m4/all/test_package/frozen.m4f create mode 100644 recipes/m4/all/test_package/test.m4 create mode 100644 recipes/m4/all/test_v1_package/conanfile.py create mode 100644 recipes/m4/config.yml create mode 100644 recipes/maddy/all/conandata.yml create mode 100644 recipes/maddy/all/conanfile.py create mode 100755 recipes/maddy/all/test_package/CMakeLists.txt create mode 100755 recipes/maddy/all/test_package/conanfile.py create mode 100755 recipes/maddy/all/test_package/example.cpp create mode 100644 recipes/maddy/config.yml create mode 100644 recipes/magic_enum/all/conandata.yml create mode 100644 recipes/magic_enum/all/conanfile.py create mode 100644 recipes/magic_enum/all/test_package/CMakeLists.txt create mode 100644 recipes/magic_enum/all/test_package/conanfile.py create mode 100644 recipes/magic_enum/all/test_package/test_package.cpp create mode 100644 recipes/magic_enum/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/magic_enum/all/test_v1_package/conanfile.py create mode 100644 recipes/magic_enum/config.yml create mode 100644 recipes/magnum-extras/all/CMakeLists.txt create mode 100644 recipes/magnum-extras/all/conandata.yml create mode 100644 recipes/magnum-extras/all/conanfile.py create mode 100644 recipes/magnum-extras/all/patches/2020.06/0001-emscripten-toolchain.patch create mode 100644 recipes/magnum-extras/all/test_package/CMakeLists.txt create mode 100644 recipes/magnum-extras/all/test_package/conanfile.py create mode 100644 recipes/magnum-extras/all/test_package/test_package.cpp create mode 100644 recipes/magnum-extras/config.yml create mode 100644 recipes/magnum-integration/all/CMakeLists.txt create mode 100644 recipes/magnum-integration/all/conandata.yml create mode 100644 recipes/magnum-integration/all/conanfile.py create mode 100644 recipes/magnum-integration/all/test_package/CMakeLists.txt create mode 100644 recipes/magnum-integration/all/test_package/conanfile.py create mode 100644 recipes/magnum-integration/all/test_package/test_package.cpp create mode 100644 recipes/magnum-integration/config.yml create mode 100644 recipes/magnum-plugins/all/CMakeLists.txt create mode 100644 recipes/magnum-plugins/all/cmake/conan-bugfix-global-target.cmake create mode 100644 recipes/magnum-plugins/all/conandata.yml create mode 100644 recipes/magnum-plugins/all/conanfile.py create mode 100644 recipes/magnum-plugins/all/patches/2020.06/0001-emscripten-toolchain.patch create mode 100644 recipes/magnum-plugins/all/test_package/CMakeLists.txt create mode 100644 recipes/magnum-plugins/all/test_package/conan.stl create mode 100644 recipes/magnum-plugins/all/test_package/conanfile.py create mode 100644 recipes/magnum-plugins/all/test_package/configure.h.in create mode 100644 recipes/magnum-plugins/all/test_package/test_package.cpp create mode 100644 recipes/magnum-plugins/config.yml create mode 100644 recipes/magnum/all/CMakeLists.txt create mode 100644 recipes/magnum/all/cmake/conan-bugfix-global-target.cmake create mode 100644 recipes/magnum/all/cmake/conan-magnum-vars.cmake create mode 100644 recipes/magnum/all/conandata.yml create mode 100644 recipes/magnum/all/conanfile.py create mode 100644 recipes/magnum/all/test_package/CMakeLists.txt create mode 100644 recipes/magnum/all/test_package/conanfile.py create mode 100644 recipes/magnum/all/test_package/configure.h.in create mode 100644 recipes/magnum/all/test_package/test_package.cpp create mode 100644 recipes/magnum/all/test_package/triangleMesh.obj create mode 100644 recipes/magnum/config.yml create mode 100644 recipes/mailio/all/conandata.yml create mode 100644 recipes/mailio/all/conanfile.py create mode 100644 recipes/mailio/all/patches/0.20.0-adapt-cmakelists.patch create mode 100644 recipes/mailio/all/patches/0.21.0-adapt-cmakelists.patch create mode 100644 recipes/mailio/all/test_package/CMakeLists.txt create mode 100644 recipes/mailio/all/test_package/conanfile.py create mode 100644 recipes/mailio/all/test_package/test_package.cpp create mode 100644 recipes/mailio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mailio/all/test_v1_package/conanfile.py create mode 100644 recipes/mailio/config.yml create mode 100644 recipes/make/all/conandata.yml create mode 100644 recipes/make/all/conanfile.py create mode 100644 recipes/make/all/patches/4.2.1-0001-clang.patch create mode 100644 recipes/make/all/patches/4.3-0001-clang.patch create mode 100644 recipes/make/all/test_package/Makefile create mode 100644 recipes/make/all/test_package/conanfile.py create mode 100644 recipes/make/all/test_v1_package/conanfile.py create mode 100644 recipes/make/config.yml create mode 100644 recipes/makefile-project-workspace-creator/all/conandata.yml create mode 100644 recipes/makefile-project-workspace-creator/all/conanfile.py create mode 100644 recipes/makefile-project-workspace-creator/all/test_package/conanfile.py create mode 100644 recipes/makefile-project-workspace-creator/config.yml create mode 100644 recipes/mapbox-geometry/all/conandata.yml create mode 100644 recipes/mapbox-geometry/all/conanfile.py create mode 100644 recipes/mapbox-geometry/all/test_package/CMakeLists.txt create mode 100644 recipes/mapbox-geometry/all/test_package/conanfile.py create mode 100644 recipes/mapbox-geometry/all/test_package/test_package.cpp create mode 100644 recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mapbox-geometry/all/test_v1_package/conanfile.py create mode 100644 recipes/mapbox-geometry/config.yml create mode 100644 recipes/mapbox-variant/all/conandata.yml create mode 100644 recipes/mapbox-variant/all/conanfile.py create mode 100644 recipes/mapbox-variant/all/test_package/CMakeLists.txt create mode 100644 recipes/mapbox-variant/all/test_package/conanfile.py create mode 100644 recipes/mapbox-variant/all/test_package/test_package.cpp create mode 100644 recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mapbox-variant/all/test_v1_package/conanfile.py create mode 100644 recipes/mapbox-variant/config.yml create mode 100644 recipes/mariadb-connector-c/all/conandata.yml create mode 100644 recipes/mariadb-connector-c/all/conanfile.py create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.11-0001-fix-install-and-static-or-shared.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.11-0002-msvc-no-override-md-zi.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.11-0003-include-order-windows-winsock2.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.11-0004-include-mysqld_error-header.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.11-0005-fix-cmake-connectorname.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.19-0001-fix-install-and-static-or-shared.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch create mode 100644 recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch create mode 100644 recipes/mariadb-connector-c/all/test_package/CMakeLists.txt create mode 100644 recipes/mariadb-connector-c/all/test_package/conanfile.py create mode 100644 recipes/mariadb-connector-c/all/test_package/test_package.c create mode 100644 recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mariadb-connector-c/all/test_v1_package/conanfile.py create mode 100644 recipes/mariadb-connector-c/config.yml create mode 100644 recipes/marisa/all/CMakeLists.txt create mode 100644 recipes/marisa/all/conandata.yml create mode 100644 recipes/marisa/all/conanfile.py create mode 100644 recipes/marisa/all/patches/0001-add-cmake.patch create mode 100644 recipes/marisa/all/test_package/CMakeLists.txt create mode 100644 recipes/marisa/all/test_package/conanfile.py create mode 100644 recipes/marisa/all/test_package/test_package.cpp create mode 100644 recipes/marisa/config.yml create mode 100644 recipes/matchit/all/conandata.yml create mode 100644 recipes/matchit/all/conanfile.py create mode 100644 recipes/matchit/all/test_package/CMakeLists.txt create mode 100644 recipes/matchit/all/test_package/conanfile.py create mode 100644 recipes/matchit/all/test_package/test_package.cpp create mode 100644 recipes/matchit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/matchit/all/test_v1_package/conanfile.py create mode 100644 recipes/matchit/config.yml create mode 100644 recipes/mathfu/all/conandata.yml create mode 100644 recipes/mathfu/all/conanfile.py create mode 100644 recipes/mathfu/all/test_package/CMakeLists.txt create mode 100644 recipes/mathfu/all/test_package/conanfile.py create mode 100644 recipes/mathfu/all/test_package/test_package.cpp create mode 100644 recipes/mathfu/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mathfu/all/test_v1_package/conanfile.py create mode 100644 recipes/mathfu/config.yml create mode 100644 recipes/mathter/all/conandata.yml create mode 100644 recipes/mathter/all/conanfile.py create mode 100644 recipes/mathter/all/test_package/CMakeLists.txt create mode 100644 recipes/mathter/all/test_package/conanfile.py create mode 100644 recipes/mathter/all/test_package/test_package.cpp create mode 100644 recipes/mathter/config.yml create mode 100644 recipes/matio/all/CMakeLists.txt create mode 100644 recipes/matio/all/conandata.yml create mode 100644 recipes/matio/all/conanfile.py create mode 100644 recipes/matio/all/patches/cmake-install-bundle.patch create mode 100644 recipes/matio/all/patches/disable-hdf5-target.patch create mode 100644 recipes/matio/all/patches/patch-apple-no-undefined.patch create mode 100644 recipes/matio/all/patches/require-cmake-3.10.patch create mode 100644 recipes/matio/all/test_package/CMakeLists.txt create mode 100644 recipes/matio/all/test_package/conanfile.py create mode 100644 recipes/matio/all/test_package/test_package.c create mode 100644 recipes/matio/config.yml create mode 100644 recipes/mattiasgustavsson-libs/all/conandata.yml create mode 100644 recipes/mattiasgustavsson-libs/all/conanfile.py create mode 100644 recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt create mode 100644 recipes/mattiasgustavsson-libs/all/test_package/conanfile.py create mode 100644 recipes/mattiasgustavsson-libs/all/test_package/test_package.cpp create mode 100644 recipes/mattiasgustavsson-libs/config.yml create mode 100644 recipes/mbedtls/all/CMakeLists.txt create mode 100644 recipes/mbedtls/all/conandata.yml create mode 100644 recipes/mbedtls/all/conanfile.py create mode 100644 recipes/mbedtls/all/test_package/CMakeLists.txt create mode 100644 recipes/mbedtls/all/test_package/conanfile.py create mode 100644 recipes/mbedtls/all/test_package/test_package.c create mode 100644 recipes/mbedtls/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbedtls/all/test_v1_package/conanfile.py create mode 100644 recipes/mbedtls/config.yml create mode 100644 recipes/mbits-args/all/conandata.yml create mode 100644 recipes/mbits-args/all/conanfile.py create mode 100644 recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch create mode 100644 recipes/mbits-args/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-args/all/test_package/conanfile.py create mode 100644 recipes/mbits-args/all/test_package/test_package.cpp create mode 100644 recipes/mbits-args/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-args/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-args/config.yml create mode 100644 recipes/mbits-diags/all/conandata.yml create mode 100644 recipes/mbits-diags/all/conanfile.py create mode 100644 recipes/mbits-diags/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-diags/all/test_package/conanfile.py create mode 100644 recipes/mbits-diags/all/test_package/test_package.cpp create mode 100644 recipes/mbits-diags/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-diags/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-diags/config.yml create mode 100644 recipes/mbits-mstch/all/conandata.yml create mode 100644 recipes/mbits-mstch/all/conanfile.py create mode 100644 recipes/mbits-mstch/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-mstch/all/test_package/conanfile.py create mode 100644 recipes/mbits-mstch/all/test_package/test_package.cpp create mode 100644 recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-mstch/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-mstch/config.yml create mode 100644 recipes/mbits-semver/all/conandata.yml create mode 100644 recipes/mbits-semver/all/conanfile.py create mode 100644 recipes/mbits-semver/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-semver/all/test_package/conanfile.py create mode 100644 recipes/mbits-semver/all/test_package/test_package.cpp create mode 100644 recipes/mbits-semver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-semver/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-semver/config.yml create mode 100644 recipes/mbits-utfconv/all/conandata.yml create mode 100644 recipes/mbits-utfconv/all/conanfile.py create mode 100644 recipes/mbits-utfconv/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-utfconv/all/test_package/conanfile.py create mode 100644 recipes/mbits-utfconv/all/test_package/test_package.cpp create mode 100644 recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-utfconv/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-utfconv/config.yml create mode 100644 recipes/mcap/all/conandata.yml create mode 100644 recipes/mcap/all/conanfile.py create mode 100644 recipes/mcap/all/test_package/CMakeLists.txt create mode 100644 recipes/mcap/all/test_package/conanfile.py create mode 100644 recipes/mcap/all/test_package/test_package.cpp create mode 100644 recipes/mcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mcap/all/test_v1_package/conanfile.py create mode 100644 recipes/mcap/config.yml create mode 100644 recipes/md4c/all/conandata.yml create mode 100644 recipes/md4c/all/conanfile.py create mode 100644 recipes/md4c/all/patches/0001-honor-vc-runtime.patch create mode 100644 recipes/md4c/all/test_package/CMakeLists.txt create mode 100644 recipes/md4c/all/test_package/conanfile.py create mode 100644 recipes/md4c/all/test_package/test_package.c create mode 100644 recipes/md4c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/md4c/all/test_v1_package/conanfile.py create mode 100644 recipes/md4c/config.yml create mode 100644 recipes/md4qt/all/conandata.yml create mode 100644 recipes/md4qt/all/conanfile.py create mode 100644 recipes/md4qt/all/test_package/CMakeLists.txt create mode 100644 recipes/md4qt/all/test_package/conanfile.py create mode 100644 recipes/md4qt/all/test_package/test.md create mode 100644 recipes/md4qt/all/test_package/test_package.cpp create mode 100644 recipes/md4qt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/md4qt/all/test_v1_package/conanfile.py create mode 100644 recipes/md4qt/config.yml create mode 100644 recipes/mdns/all/conandata.yml create mode 100644 recipes/mdns/all/conanfile.py create mode 100644 recipes/mdns/all/test_package/CMakeLists.txt create mode 100644 recipes/mdns/all/test_package/conanfile.py create mode 100644 recipes/mdns/all/test_package/test_package.c create mode 100644 recipes/mdns/config.yml create mode 100644 recipes/mdnsresponder/all/conandata.yml create mode 100644 recipes/mdnsresponder/all/conanfile.py create mode 100644 recipes/mdnsresponder/all/patches/1310.140.1/dns_sd.c.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/DLLStub.c.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/Service.c.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/mDNSResponder.sln.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/mDNSWin32.c.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/opt/permit-over-long-service-types.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/opt/poll-rather-than-select.patch create mode 100644 recipes/mdnsresponder/all/patches/878.200.35/opt/unicast.patch create mode 100644 recipes/mdnsresponder/all/test_package/CMakeLists.txt create mode 100644 recipes/mdnsresponder/all/test_package/conanfile.py create mode 100644 recipes/mdnsresponder/all/test_package/test_package.c create mode 100644 recipes/mdnsresponder/config.yml create mode 100644 recipes/mdspan/all/conandata.yml create mode 100644 recipes/mdspan/all/conanfile.py create mode 100644 recipes/mdspan/all/test_package/CMakeLists.txt create mode 100644 recipes/mdspan/all/test_package/conanfile.py create mode 100644 recipes/mdspan/all/test_package/test_package.cpp create mode 100644 recipes/mdspan/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mdspan/all/test_v1_package/conanfile.py create mode 100644 recipes/mdspan/config.yml create mode 100644 recipes/meshoptimizer/all/conandata.yml create mode 100644 recipes/meshoptimizer/all/conanfile.py create mode 100644 recipes/meshoptimizer/all/patches/0.14/0001-fix-build-on-old-AppleClang-versions.patch create mode 100644 recipes/meshoptimizer/all/test_package/CMakeLists.txt create mode 100644 recipes/meshoptimizer/all/test_package/conanfile.py create mode 100644 recipes/meshoptimizer/all/test_package/test_package.c create mode 100644 recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/meshoptimizer/all/test_v1_package/conanfile.py create mode 100644 recipes/meshoptimizer/config.yml create mode 100644 recipes/meson/all/conandata.yml create mode 100644 recipes/meson/all/conanfile.py create mode 100644 recipes/meson/all/test_package/conanfile.py create mode 100644 recipes/meson/all/test_package/meson.build create mode 100644 recipes/meson/all/test_package/test_package.cpp create mode 100644 recipes/meson/all/test_v1_package/conanfile.py create mode 100644 recipes/meson/all/test_v1_package/meson.build create mode 100644 recipes/meson/config.yml create mode 100644 recipes/metall/all/conandata.yml create mode 100644 recipes/metall/all/conanfile.py create mode 100644 recipes/metall/all/test_package/CMakeLists.txt create mode 100644 recipes/metall/all/test_package/conanfile.py create mode 100644 recipes/metall/all/test_package/test_package.cpp create mode 100644 recipes/metall/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/metall/all/test_v1_package/conanfile.py create mode 100644 recipes/metall/config.yml create mode 100644 recipes/metis/all/CMakeLists.txt create mode 100644 recipes/metis/all/conandata.yml create mode 100644 recipes/metis/all/conanfile.py create mode 100644 recipes/metis/all/patches/001-add-gklib-system-cmake.patch create mode 100644 recipes/metis/all/patches/002-support-pure-cmake.patch create mode 100644 recipes/metis/all/patches/003-remove-programs.patch create mode 100644 recipes/metis/all/patches/004-use-conan-gklib.patch create mode 100644 recipes/metis/all/patches/005-fix-install.patch create mode 100644 recipes/metis/all/test_package/CMakeLists.txt create mode 100644 recipes/metis/all/test_package/conanfile.py create mode 100644 recipes/metis/all/test_package/test.cpp create mode 100644 recipes/metis/config.yml create mode 100644 recipes/mfast/all/conandata.yml create mode 100644 recipes/mfast/all/conanfile.py create mode 100644 recipes/mfast/all/patches/0001-fix-cmake-1.2.1.patch create mode 100644 recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch create mode 100644 recipes/mfast/all/patches/0002-remove-deprecated-boost-detail-endian.patch create mode 100644 recipes/mfast/all/patches/0003-mfast-sqlite3.patch create mode 100644 recipes/mfast/all/test_package/CMakeLists.txt create mode 100644 recipes/mfast/all/test_package/Test.xml create mode 100644 recipes/mfast/all/test_package/conanfile.py create mode 100644 recipes/mfast/all/test_package/message_printer.cpp create mode 100644 recipes/mfast/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mfast/all/test_v1_package/conanfile.py create mode 100644 recipes/mfast/config.yml create mode 100644 recipes/mgs/all/conandata.yml create mode 100644 recipes/mgs/all/conanfile.py create mode 100644 recipes/mgs/all/test_package/CMakeLists.txt create mode 100644 recipes/mgs/all/test_package/conanfile.py create mode 100644 recipes/mgs/all/test_package/test_package.cpp create mode 100644 recipes/mgs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mgs/all/test_v1_package/conanfile.py create mode 100644 recipes/mgs/config.yml create mode 100644 recipes/microprofile/all/CMakeLists.txt create mode 100644 recipes/microprofile/all/conandata.yml create mode 100644 recipes/microprofile/all/conanfile.py create mode 100644 recipes/microprofile/all/patches/cmake.patch create mode 100644 recipes/microprofile/all/patches/sources_fix.patch create mode 100644 recipes/microprofile/all/test_package/CMakeLists.txt create mode 100644 recipes/microprofile/all/test_package/conanfile.py create mode 100644 recipes/microprofile/all/test_package/test_package.cpp create mode 100644 recipes/microprofile/config.yml create mode 100644 recipes/microtar/all/CMakeLists.txt create mode 100644 recipes/microtar/all/conandata.yml create mode 100644 recipes/microtar/all/conanfile.py create mode 100644 recipes/microtar/all/test_package/CMakeLists.txt create mode 100644 recipes/microtar/all/test_package/conanfile.py create mode 100644 recipes/microtar/all/test_package/test_package.c create mode 100644 recipes/microtar/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/microtar/all/test_v1_package/conanfile.py create mode 100644 recipes/microtar/config.yml create mode 100644 recipes/mikelankamp-fpm/all/conandata.yml create mode 100644 recipes/mikelankamp-fpm/all/conanfile.py create mode 100644 recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt create mode 100644 recipes/mikelankamp-fpm/all/test_package/conanfile.py create mode 100644 recipes/mikelankamp-fpm/all/test_package/test_package.cpp create mode 100644 recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py create mode 100644 recipes/mikelankamp-fpm/config.yml create mode 100644 recipes/mikktspace/all/CMakeLists.txt create mode 100644 recipes/mikktspace/all/conandata.yml create mode 100644 recipes/mikktspace/all/conanfile.py create mode 100644 recipes/mikktspace/all/test_package/CMakeLists.txt create mode 100644 recipes/mikktspace/all/test_package/conanfile.py create mode 100644 recipes/mikktspace/all/test_package/test_package.c create mode 100644 recipes/mikktspace/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mikktspace/all/test_v1_package/conanfile.py create mode 100644 recipes/mikktspace/config.yml create mode 100644 recipes/mimalloc/all/conandata.yml create mode 100644 recipes/mimalloc/all/conanfile.py create mode 100644 recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch create mode 100644 recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch create mode 100644 recipes/mimalloc/all/patches/1.7.5-0001-change-install-paths.patch create mode 100644 recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch create mode 100644 recipes/mimalloc/all/patches/1.7.9-0001-change-install-paths.patch create mode 100644 recipes/mimalloc/all/patches/1.7.9-0002-support-older-compiler.patch create mode 100644 recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch create mode 100644 recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch create mode 100644 recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch create mode 100644 recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch create mode 100644 recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch create mode 100644 recipes/mimalloc/all/patches/2.0.9-0001-change-install-paths.patch create mode 100644 recipes/mimalloc/all/patches/2.0.9-0002-support-older-compiler.patch create mode 100644 recipes/mimalloc/all/test_package/CMakeLists.txt create mode 100644 recipes/mimalloc/all/test_package/conanfile.py create mode 100644 recipes/mimalloc/all/test_package/include_override.c create mode 100644 recipes/mimalloc/all/test_package/include_override.cpp create mode 100644 recipes/mimalloc/all/test_package/mi_api.c create mode 100644 recipes/mimalloc/all/test_package/mi_api.cpp create mode 100644 recipes/mimalloc/all/test_package/no_changes.c create mode 100644 recipes/mimalloc/all/test_package/no_changes.cpp create mode 100644 recipes/mimalloc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mimalloc/all/test_v1_package/conanfile.py create mode 100644 recipes/mimalloc/config.yml create mode 100644 recipes/mingw-builds/all/conandata.yml create mode 100644 recipes/mingw-builds/all/conanfile.py create mode 100644 recipes/mingw-builds/all/test_package/conanfile.py create mode 100644 recipes/mingw-builds/all/test_package/main.cpp create mode 100644 recipes/mingw-builds/config.yml create mode 100644 recipes/mingw-w64/config.yml create mode 100644 recipes/mingw-w64/linux/conandata.yml create mode 100644 recipes/mingw-w64/linux/conanfile.py create mode 100644 recipes/mingw-w64/linux/test_package/conanfile.py create mode 100644 recipes/mingw-w64/linux/test_package/main.cpp create mode 100644 recipes/miniaudio/all/CMakeLists.txt create mode 100644 recipes/miniaudio/all/conandata.yml create mode 100644 recipes/miniaudio/all/conanfile.py create mode 100644 recipes/miniaudio/all/test_package/CMakeLists.txt create mode 100644 recipes/miniaudio/all/test_package/conanfile.py create mode 100644 recipes/miniaudio/all/test_package/test_package.c create mode 100644 recipes/miniaudio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/miniaudio/all/test_v1_package/conanfile.py create mode 100644 recipes/miniaudio/config.yml create mode 100644 recipes/minimp3/all/conandata.yml create mode 100644 recipes/minimp3/all/conanfile.py create mode 100644 recipes/minimp3/all/test_package/CMakeLists.txt create mode 100644 recipes/minimp3/all/test_package/conanfile.py create mode 100644 recipes/minimp3/all/test_package/test_package.c create mode 100644 recipes/minimp3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/minimp3/all/test_v1_package/conanfile.py create mode 100644 recipes/minimp3/config.yml create mode 100644 recipes/minisat/all/CMakeLists.txt create mode 100644 recipes/minisat/all/conandata.yml create mode 100644 recipes/minisat/all/conanfile.py create mode 100644 recipes/minisat/all/patches/0001-drop-default-arg-in-friend-declaration-2.2.0.patch create mode 100644 recipes/minisat/all/patches/0002-suffix-literal-2.2.0.patch create mode 100644 recipes/minisat/all/test_package/CMakeLists.txt create mode 100644 recipes/minisat/all/test_package/conanfile.py create mode 100644 recipes/minisat/all/test_package/test_package.cpp create mode 100644 recipes/minisat/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/minisat/all/test_v1_package/conanfile.py create mode 100644 recipes/minisat/config.yml create mode 100644 recipes/miniscript/all/CMakeLists.txt create mode 100644 recipes/miniscript/all/conandata.yml create mode 100644 recipes/miniscript/all/conanfile.py create mode 100644 recipes/miniscript/all/test_package/CMakeLists.txt create mode 100644 recipes/miniscript/all/test_package/conanfile.py create mode 100644 recipes/miniscript/all/test_package/test_package.cpp create mode 100644 recipes/miniscript/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/miniscript/all/test_v1_package/conanfile.py create mode 100644 recipes/miniscript/config.yml create mode 100644 recipes/minitrace/all/conandata.yml create mode 100644 recipes/minitrace/all/conanfile.py create mode 100644 recipes/minitrace/all/patches/0001-fix-cmake.patch create mode 100644 recipes/minitrace/all/test_package/CMakeLists.txt create mode 100644 recipes/minitrace/all/test_package/conanfile.py create mode 100644 recipes/minitrace/all/test_package/test_package.c create mode 100644 recipes/minitrace/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/minitrace/all/test_v1_package/conanfile.py create mode 100644 recipes/minitrace/config.yml create mode 100644 recipes/miniupnpc/all/conandata.yml create mode 100644 recipes/miniupnpc/all/conanfile.py create mode 100644 recipes/miniupnpc/all/patches/0001-fix-cross-build-ios.patch create mode 100644 recipes/miniupnpc/all/test_package/CMakeLists.txt create mode 100644 recipes/miniupnpc/all/test_package/conanfile.py create mode 100644 recipes/miniupnpc/all/test_package/test_package.c create mode 100644 recipes/miniupnpc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/miniupnpc/all/test_v1_package/conanfile.py create mode 100644 recipes/miniupnpc/config.yml create mode 100644 recipes/miniz/all/conandata.yml create mode 100644 recipes/miniz/all/conanfile.py create mode 100644 recipes/miniz/all/patches/2.1.0/001-remove-examples.patch create mode 100644 recipes/miniz/all/patches/2.1.0/002-fix-shared-windows.patch create mode 100644 recipes/miniz/all/patches/2.1.0/003-include-miniz_zip.patch create mode 100644 recipes/miniz/all/test_package/CMakeLists.txt create mode 100644 recipes/miniz/all/test_package/conanfile.py create mode 100644 recipes/miniz/all/test_package/test_package.c create mode 100644 recipes/miniz/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/miniz/all/test_v1_package/conanfile.py create mode 100644 recipes/miniz/config.yml create mode 100644 recipes/minizip-ng/all/conandata.yml create mode 100644 recipes/minizip-ng/all/conanfile.py create mode 100644 recipes/minizip-ng/all/patches/3.0.1-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.1-0002-fix-lzma-libdir.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.4-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.5-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.5-0002-fix-lzma-libdir.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.6-0002-fix-lzma-libdir.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.7-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.8-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/patches/3.0.9-0001-fix-cmake-project.patch create mode 100644 recipes/minizip-ng/all/test_package/CMakeLists.txt create mode 100644 recipes/minizip-ng/all/test_package/conanfile.py create mode 100644 recipes/minizip-ng/all/test_package/test_package.c create mode 100644 recipes/minizip-ng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/minizip-ng/all/test_v1_package/conanfile.py create mode 100644 recipes/minizip-ng/config.yml create mode 100644 recipes/minizip/all/CMakeLists.txt create mode 100644 recipes/minizip/all/conandata.yml create mode 100644 recipes/minizip/all/conanfile.py create mode 100644 recipes/minizip/all/patches/ioapi.patch create mode 100644 recipes/minizip/all/patches/miniunz.patch create mode 100644 recipes/minizip/all/patches/minizip.patch create mode 100644 recipes/minizip/all/test_package/CMakeLists.txt create mode 100644 recipes/minizip/all/test_package/conanfile.py create mode 100644 recipes/minizip/all/test_package/test_package.c create mode 100644 recipes/minizip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/minizip/all/test_v1_package/conanfile.py create mode 100644 recipes/minizip/config.yml create mode 100644 recipes/mio/all/conandata.yml create mode 100644 recipes/mio/all/conanfile.py create mode 100644 recipes/mio/all/patches/0001-fix-include-windows.patch create mode 100644 recipes/mio/all/test_package/CMakeLists.txt create mode 100644 recipes/mio/all/test_package/conanfile.py create mode 100644 recipes/mio/all/test_package/test_package.cpp create mode 100644 recipes/mio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mio/all/test_v1_package/conanfile.py create mode 100644 recipes/mio/config.yml create mode 100644 recipes/modern-cpp-kafka/all/conandata.yml create mode 100644 recipes/modern-cpp-kafka/all/conanfile.py create mode 100644 recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt create mode 100644 recipes/modern-cpp-kafka/all/test_package/conanfile.py create mode 100644 recipes/modern-cpp-kafka/all/test_package/test_package.cpp create mode 100644 recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py create mode 100644 recipes/modern-cpp-kafka/config.yml create mode 100644 recipes/mold/1.3.1/conandata.yml create mode 100644 recipes/mold/1.3.1/conanfile.py create mode 100644 recipes/mold/1.3.1/test_package/conanfile.py create mode 100644 recipes/mold/all/conandata.yml create mode 100644 recipes/mold/all/conanfile.py create mode 100644 recipes/mold/all/test_package/conanfile.py create mode 100644 recipes/mold/all/test_v1_package/conanfile.py create mode 100644 recipes/mold/config.yml create mode 100644 recipes/moltenvk/all/CMakeLists.txt create mode 100644 recipes/moltenvk/all/conandata.yml create mode 100644 recipes/moltenvk/all/conanfile.py create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.11.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml create mode 100644 recipes/moltenvk/all/dependencies/dependencies-1.2.2.yml create mode 100644 recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch create mode 100644 recipes/moltenvk/all/patches/1.1.11-0001-vulkan-alias-private-extern.patch create mode 100644 recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch create mode 100644 recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch create mode 100644 recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch create mode 100644 recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch create mode 100644 recipes/moltenvk/all/patches/1.2.0-0001-fix-version-number-icd-json.patch create mode 100644 recipes/moltenvk/all/test_package/CMakeLists.txt create mode 100644 recipes/moltenvk/all/test_package/conanfile.py create mode 100644 recipes/moltenvk/all/test_package/test_package.cpp create mode 100644 recipes/moltenvk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/moltenvk/all/test_v1_package/conanfile.py create mode 100644 recipes/moltenvk/config.yml create mode 100644 recipes/mongo-c-driver/all/conandata.yml create mode 100644 recipes/mongo-c-driver/all/conanfile.py create mode 100644 recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch create mode 100644 recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch create mode 100644 recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch create mode 100644 recipes/mongo-c-driver/all/patches/1.22.0-0002-fix-uninitialized-warning.patch create mode 100644 recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch create mode 100644 recipes/mongo-c-driver/all/patches/1.23.2-0001-disable-shared-when-static.patch create mode 100644 recipes/mongo-c-driver/all/test_package/CMakeLists.txt create mode 100644 recipes/mongo-c-driver/all/test_package/conanfile.py create mode 100644 recipes/mongo-c-driver/all/test_package/test_package.c create mode 100644 recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mongo-c-driver/all/test_v1_package/conanfile.py create mode 100644 recipes/mongo-c-driver/config.yml create mode 100644 recipes/mongo-cxx-driver/all/conandata.yml create mode 100644 recipes/mongo-cxx-driver/all/conanfile.py create mode 100644 recipes/mongo-cxx-driver/all/patches/3.6.x-dirs_and_tests.patch create mode 100644 recipes/mongo-cxx-driver/all/patches/3.7.0-dirs.patch create mode 100644 recipes/mongo-cxx-driver/all/patches/poly_use_std_define.patch create mode 100644 recipes/mongo-cxx-driver/all/test_package/CMakeLists.txt create mode 100644 recipes/mongo-cxx-driver/all/test_package/conanfile.py create mode 100644 recipes/mongo-cxx-driver/all/test_package/test_package.cpp create mode 100644 recipes/mongo-cxx-driver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mongo-cxx-driver/all/test_v1_package/conanfile.py create mode 100644 recipes/mongo-cxx-driver/config.yml create mode 100644 recipes/morton-nd/all/conandata.yml create mode 100644 recipes/morton-nd/all/conanfile.py create mode 100644 recipes/morton-nd/all/test_package/CMakeLists.txt create mode 100644 recipes/morton-nd/all/test_package/conanfile.py create mode 100644 recipes/morton-nd/all/test_package/test_package.cpp create mode 100644 recipes/morton-nd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/morton-nd/all/test_v1_package/conanfile.py create mode 100644 recipes/morton-nd/config.yml create mode 100644 recipes/mosquitto/1.x/conandata.yml create mode 100644 recipes/mosquitto/1.x/conanfile.py create mode 100644 recipes/mosquitto/1.x/patches/1.6.12-0001-fix-cmake.patch create mode 100644 recipes/mosquitto/1.x/patches/1.6.12-0002-fix-macos.patch create mode 100644 recipes/mosquitto/1.x/test_package/CMakeLists.txt create mode 100644 recipes/mosquitto/1.x/test_package/conanfile.py create mode 100644 recipes/mosquitto/1.x/test_package/test_package.c create mode 100644 recipes/mosquitto/1.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/mosquitto/1.x/test_v1_package/conanfile.py create mode 100644 recipes/mosquitto/2.x/conandata.yml create mode 100644 recipes/mosquitto/2.x/conanfile.py create mode 100644 recipes/mosquitto/2.x/test_package/CMakeLists.txt create mode 100644 recipes/mosquitto/2.x/test_package/conanfile.py create mode 100644 recipes/mosquitto/2.x/test_package/test_package.c create mode 100644 recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/mosquitto/2.x/test_v1_package/conanfile.py create mode 100644 recipes/mosquitto/config.yml create mode 100644 recipes/mozilla-build/all/conandata.yml create mode 100644 recipes/mozilla-build/all/conanfile.py create mode 100644 recipes/mozilla-build/all/test_package/conanfile.py create mode 100644 recipes/mozilla-build/config.yml create mode 100644 recipes/mozjpeg/all/conandata.yml create mode 100644 recipes/mozjpeg/all/conanfile.py create mode 100644 recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch create mode 100644 recipes/mozjpeg/all/patches/4.0.0-0001-cmake-fixes.patch create mode 100644 recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch create mode 100644 recipes/mozjpeg/all/test_package/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_package/conanfile.py create mode 100644 recipes/mozjpeg/all/test_package/test_package.c create mode 100644 recipes/mozjpeg/all/test_package/testimg.jpg create mode 100644 recipes/mozjpeg/all/test_package_module/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_package_module/conanfile.py create mode 100644 recipes/mozjpeg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_v1_package/conanfile.py create mode 100644 recipes/mozjpeg/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_v1_package_module/conanfile.py create mode 100644 recipes/mozjpeg/config.yml create mode 100644 recipes/mp-units/0.6.0/conandata.yml create mode 100644 recipes/mp-units/0.6.0/conanfile.py create mode 100644 recipes/mp-units/0.6.0/test_package/CMakeLists.txt create mode 100644 recipes/mp-units/0.6.0/test_package/conanfile.py create mode 100644 recipes/mp-units/0.6.0/test_package/test_package.cpp create mode 100644 recipes/mp-units/0.7.0/conandata.yml create mode 100644 recipes/mp-units/0.7.0/conanfile.py create mode 100644 recipes/mp-units/0.7.0/test_package/CMakeLists.txt create mode 100644 recipes/mp-units/0.7.0/test_package/conanfile.py create mode 100644 recipes/mp-units/0.7.0/test_package/test_package.cpp create mode 100644 recipes/mp-units/config.yml create mode 100644 recipes/mpark-variant/all/conandata.yml create mode 100644 recipes/mpark-variant/all/conanfile.py create mode 100644 recipes/mpark-variant/all/test_package/CMakeLists.txt create mode 100644 recipes/mpark-variant/all/test_package/conanfile.py create mode 100644 recipes/mpark-variant/all/test_package/test_package.cpp create mode 100644 recipes/mpark-variant/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mpark-variant/all/test_v1_package/conanfile.py create mode 100644 recipes/mpark-variant/config.yml create mode 100644 recipes/mpc/all/conandata.yml create mode 100644 recipes/mpc/all/conanfile.py create mode 100644 recipes/mpc/all/patches/1.2.0-0001-asin-missing-limits.patch create mode 100644 recipes/mpc/all/test_package/CMakeLists.txt create mode 100644 recipes/mpc/all/test_package/conanfile.py create mode 100644 recipes/mpc/all/test_package/test_package.c create mode 100644 recipes/mpc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mpc/all/test_v1_package/conanfile.py create mode 100644 recipes/mpc/config.yml create mode 100644 recipes/mpdecimal/2.4.2/conandata.yml create mode 100644 recipes/mpdecimal/2.4.2/conanfile.py create mode 100644 recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch create mode 100644 recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch create mode 100644 recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt create mode 100644 recipes/mpdecimal/2.4.2/test_package/conanfile.py create mode 100644 recipes/mpdecimal/2.4.2/test_package/test_package.c create mode 100644 recipes/mpdecimal/2.5.x/conandata.yml create mode 100644 recipes/mpdecimal/2.5.x/conanfile.py create mode 100644 recipes/mpdecimal/2.5.x/patches/0001-2.5.0-msvc-fixes.patch create mode 100644 recipes/mpdecimal/2.5.x/patches/0002-add-mingw-to-configure-ac.patch create mode 100644 recipes/mpdecimal/2.5.x/patches/2.5.1-0001-msvc-fixes.patch create mode 100644 recipes/mpdecimal/2.5.x/patches/2.5.1-0002-add-mingw-to-configure-ac.patch create mode 100644 recipes/mpdecimal/2.5.x/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch create mode 100644 recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt create mode 100644 recipes/mpdecimal/2.5.x/test_package/conanfile.py create mode 100644 recipes/mpdecimal/2.5.x/test_package/test_package.c create mode 100644 recipes/mpdecimal/2.5.x/test_package/test_package.cpp create mode 100644 recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py create mode 100644 recipes/mpdecimal/config.yml create mode 100644 recipes/mpfr/all/CMakeLists.txt.in create mode 100644 recipes/mpfr/all/conandata.yml create mode 100644 recipes/mpfr/all/conanfile.py create mode 100644 recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch create mode 100644 recipes/mpfr/all/patches/4.0.2-0002-windows-header-dll.patch create mode 100644 recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch create mode 100644 recipes/mpfr/all/patches/4.1.0-0002-windows-header-dll.patch create mode 100644 recipes/mpfr/all/test_package/CMakeLists.txt create mode 100644 recipes/mpfr/all/test_package/conanfile.py create mode 100644 recipes/mpfr/all/test_package/test_package.c create mode 100644 recipes/mpfr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mpfr/all/test_v1_package/conanfile.py create mode 100644 recipes/mpfr/config.yml create mode 100644 recipes/mpg123/all/conandata.yml create mode 100644 recipes/mpg123/all/conanfile.py create mode 100644 recipes/mpg123/all/patches/0001-msvc-export-symbols.patch create mode 100644 recipes/mpg123/all/patches/0002-cmake-read_api_version-fix.patch create mode 100644 recipes/mpg123/all/test_package/CMakeLists.txt create mode 100644 recipes/mpg123/all/test_package/conanfile.py create mode 100644 recipes/mpg123/all/test_package/test_package.c create mode 100644 recipes/mpg123/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mpg123/all/test_v1_package/conanfile.py create mode 100644 recipes/mpg123/all/test_v1_package/test_package.c create mode 100644 recipes/mpg123/config.yml create mode 100644 recipes/mpir/all/conandata.yml create mode 100644 recipes/mpir/all/conanfile.py create mode 100644 recipes/mpir/all/test_package/CMakeLists.txt create mode 100644 recipes/mpir/all/test_package/conanfile.py create mode 100644 recipes/mpir/all/test_package/test_package.cpp create mode 100644 recipes/mpir/config.yml create mode 100644 recipes/mpmcqueue/all/conandata.yml create mode 100644 recipes/mpmcqueue/all/conanfile.py create mode 100644 recipes/mpmcqueue/all/test_package/CMakeLists.txt create mode 100644 recipes/mpmcqueue/all/test_package/conanfile.py create mode 100644 recipes/mpmcqueue/all/test_package/test_package.cpp create mode 100644 recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mpmcqueue/all/test_v1_package/conanfile.py create mode 100644 recipes/mpmcqueue/config.yml create mode 100644 recipes/mppp/all/conandata.yml create mode 100644 recipes/mppp/all/conanfile.py create mode 100644 recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch create mode 100644 recipes/mppp/all/patches/0.27-0001-disable-warning-error.patch create mode 100644 recipes/mppp/all/test_package/CMakeLists.txt create mode 100644 recipes/mppp/all/test_package/conanfile.py create mode 100644 recipes/mppp/all/test_package/test_package.cpp create mode 100644 recipes/mppp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mppp/all/test_v1_package/conanfile.py create mode 100644 recipes/mppp/config.yml create mode 100644 recipes/ms-gsl/all/conandata.yml create mode 100644 recipes/ms-gsl/all/conanfile.py create mode 100644 recipes/ms-gsl/all/test_package/CMakeLists.txt create mode 100644 recipes/ms-gsl/all/test_package/conanfile.py create mode 100644 recipes/ms-gsl/all/test_package/test_package.cpp create mode 100644 recipes/ms-gsl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ms-gsl/all/test_v1_package/conanfile.py create mode 100644 recipes/ms-gsl/config.yml create mode 100644 recipes/msdf-atlas-gen/all/CMakeLists.txt create mode 100644 recipes/msdf-atlas-gen/all/conandata.yml create mode 100644 recipes/msdf-atlas-gen/all/conanfile.py create mode 100644 recipes/msdf-atlas-gen/all/test_package/Sacramento-Regular.ttf create mode 100644 recipes/msdf-atlas-gen/all/test_package/conanfile.py create mode 100644 recipes/msdf-atlas-gen/all/test_package/uppercase_charset create mode 100644 recipes/msdf-atlas-gen/config.yml create mode 100644 recipes/msdfgen/all/conandata.yml create mode 100644 recipes/msdfgen/all/conanfile.py create mode 100644 recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch create mode 100644 recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch create mode 100644 recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch create mode 100644 recipes/msdfgen/all/test_package/CMakeLists.txt create mode 100644 recipes/msdfgen/all/test_package/OpenSans-Bold.ttf create mode 100644 recipes/msdfgen/all/test_package/conanfile.py create mode 100644 recipes/msdfgen/all/test_package/test_package.cpp create mode 100644 recipes/msdfgen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/msdfgen/all/test_v1_package/conanfile.py create mode 100644 recipes/msdfgen/config.yml create mode 100644 recipes/msgpack-c/all/conandata.yml create mode 100644 recipes/msgpack-c/all/conanfile.py create mode 100644 recipes/msgpack-c/all/test_package/CMakeLists.txt create mode 100644 recipes/msgpack-c/all/test_package/conanfile.py create mode 100644 recipes/msgpack-c/all/test_package/test_package.c create mode 100644 recipes/msgpack-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/msgpack-c/all/test_v1_package/conanfile.py create mode 100644 recipes/msgpack-c/config.yml create mode 100644 recipes/msgpack-cxx/all/conandata.yml create mode 100644 recipes/msgpack-cxx/all/conanfile.py create mode 100644 recipes/msgpack-cxx/all/test_package/CMakeLists.txt create mode 100644 recipes/msgpack-cxx/all/test_package/conanfile.py create mode 100644 recipes/msgpack-cxx/all/test_package/test_package.cpp create mode 100644 recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/msgpack-cxx/all/test_v1_package/conanfile.py create mode 100644 recipes/msgpack-cxx/config.yml create mode 100644 recipes/msgpack/all/CMakeLists.txt create mode 100644 recipes/msgpack/all/conandata.yml create mode 100644 recipes/msgpack/all/conanfile.py create mode 100644 recipes/msgpack/all/test_package/CMakeLists.txt create mode 100644 recipes/msgpack/all/test_package/conanfile.py create mode 100644 recipes/msgpack/all/test_package/test_package.c create mode 100644 recipes/msgpack/all/test_package/test_package.cpp create mode 100644 recipes/msgpack/config.yml create mode 100644 recipes/msix/all/CMakeLists.txt create mode 100644 recipes/msix/all/conandata.yml create mode 100644 recipes/msix/all/conanfile.py create mode 100644 recipes/msix/all/patches/1.7/cmake.patch create mode 100644 recipes/msix/all/patches/1.7/signaturevalidator.patch create mode 100644 recipes/msix/all/test_package/CMakeLists.txt create mode 100644 recipes/msix/all/test_package/conanfile.py create mode 100644 recipes/msix/all/test_package/example.cpp create mode 100644 recipes/msix/config.yml create mode 100644 recipes/msys2/all/conandata.yml create mode 100644 recipes/msys2/all/conanfile.py create mode 100644 recipes/msys2/all/test_package/conanfile.py create mode 100644 recipes/msys2/all/test_v1_package/conanfile.py create mode 100644 recipes/msys2/config.yml create mode 100644 recipes/mujs/all/CMakeLists.txt create mode 100644 recipes/mujs/all/conandata.yml create mode 100644 recipes/mujs/all/conanfile.py create mode 100644 recipes/mujs/all/test_package/CMakeLists.txt create mode 100644 recipes/mujs/all/test_package/conanfile.py create mode 100644 recipes/mujs/all/test_package/test_package.c create mode 100644 recipes/mujs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mujs/all/test_v1_package/conanfile.py create mode 100644 recipes/mujs/config.yml create mode 100644 recipes/muparser/all/conandata.yml create mode 100644 recipes/muparser/all/conanfile.py create mode 100644 recipes/muparser/all/test_package/CMakeLists.txt create mode 100644 recipes/muparser/all/test_package/conanfile.py create mode 100644 recipes/muparser/all/test_package/test_package.cpp create mode 100644 recipes/muparser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/muparser/all/test_v1_package/conanfile.py create mode 100644 recipes/muparser/config.yml create mode 100644 recipes/muparserx/all/conandata.yml create mode 100644 recipes/muparserx/all/conanfile.py create mode 100644 recipes/muparserx/all/test_package/CMakeLists.txt create mode 100644 recipes/muparserx/all/test_package/conanfile.py create mode 100644 recipes/muparserx/all/test_package/test_package.cpp create mode 100644 recipes/muparserx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/muparserx/all/test_v1_package/conanfile.py create mode 100644 recipes/muparserx/config.yml create mode 100644 recipes/mysql-connector-c/all/CMakeLists.txt create mode 100644 recipes/mysql-connector-c/all/conandata.yml create mode 100644 recipes/mysql-connector-c/all/conanfile.py create mode 100644 recipes/mysql-connector-c/all/patches/001-20028_all_mysql-5.6-gcc7.patch create mode 100644 recipes/mysql-connector-c/all/patches/002-mysql_config.patch create mode 100644 recipes/mysql-connector-c/all/patches/003-cmake-install-standard-locations.patch create mode 100644 recipes/mysql-connector-c/all/patches/004-cmake-install-typo.patch create mode 100644 recipes/mysql-connector-c/all/test_package/CMakeLists.txt create mode 100644 recipes/mysql-connector-c/all/test_package/conanfile.py create mode 100644 recipes/mysql-connector-c/all/test_package/test_package.c create mode 100644 recipes/mysql-connector-c/config.yml create mode 100644 recipes/mysql-connector-cpp/all/conandata.yml create mode 100644 recipes/mysql-connector-cpp/all/conanfile.py create mode 100644 recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/mysql-connector-cpp/all/test_package/conanfile.py create mode 100644 recipes/mysql-connector-cpp/all/test_package/src/test_package.cpp create mode 100644 recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/mysql-connector-cpp/config.yml create mode 100644 recipes/naive-tsearch/all/CMakeLists.txt create mode 100644 recipes/naive-tsearch/all/conandata.yml create mode 100644 recipes/naive-tsearch/all/conanfile.py create mode 100644 recipes/naive-tsearch/all/test_package/CMakeLists.txt create mode 100644 recipes/naive-tsearch/all/test_package/conanfile.py create mode 100644 recipes/naive-tsearch/all/test_package/test_package.c create mode 100644 recipes/naive-tsearch/config.yml create mode 100644 recipes/namedtype/all/conandata.yml create mode 100644 recipes/namedtype/all/conanfile.py create mode 100644 recipes/namedtype/all/test_package/CMakeLists.txt create mode 100644 recipes/namedtype/all/test_package/conanfile.py create mode 100644 recipes/namedtype/all/test_package/main.cpp create mode 100644 recipes/namedtype/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/namedtype/all/test_v1_package/conanfile.py create mode 100644 recipes/namedtype/config.yml create mode 100644 recipes/nameof/all/conandata.yml create mode 100644 recipes/nameof/all/conanfile.py create mode 100644 recipes/nameof/all/test_package/CMakeLists.txt create mode 100644 recipes/nameof/all/test_package/conanfile.py create mode 100644 recipes/nameof/all/test_package/test_package.cpp create mode 100644 recipes/nameof/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nameof/all/test_v1_package/conanfile.py create mode 100644 recipes/nameof/config.yml create mode 100644 recipes/nanobench/all/conandata.yml create mode 100644 recipes/nanobench/all/conanfile.py create mode 100644 recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch create mode 100644 recipes/nanobench/all/test_package/CMakeLists.txt create mode 100644 recipes/nanobench/all/test_package/conanfile.py create mode 100644 recipes/nanobench/all/test_package/test_package.cpp create mode 100644 recipes/nanobench/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nanobench/all/test_v1_package/conanfile.py create mode 100644 recipes/nanobench/config.yml create mode 100644 recipes/nanodbc/all/CMakeLists.txt create mode 100644 recipes/nanodbc/all/conandata.yml create mode 100644 recipes/nanodbc/all/conanfile.py create mode 100644 recipes/nanodbc/all/patches/0001-odbc-from-cci.patch create mode 100644 recipes/nanodbc/all/patches/0002-allow-windows-shared.patch create mode 100644 recipes/nanodbc/all/test_package/CMakeLists.txt create mode 100644 recipes/nanodbc/all/test_package/conanfile.py create mode 100644 recipes/nanodbc/all/test_package/test_package.cpp create mode 100644 recipes/nanodbc/config.yml create mode 100644 recipes/nanoflann/all/conandata.yml create mode 100644 recipes/nanoflann/all/conanfile.py create mode 100644 recipes/nanoflann/all/test_package/CMakeLists.txt create mode 100644 recipes/nanoflann/all/test_package/conanfile.py create mode 100644 recipes/nanoflann/all/test_package/test_package.cpp create mode 100644 recipes/nanoflann/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nanoflann/all/test_v1_package/conanfile.py create mode 100644 recipes/nanoflann/config.yml create mode 100644 recipes/nanorange/all/conandata.yml create mode 100644 recipes/nanorange/all/conanfile.py create mode 100644 recipes/nanorange/all/test_package/CMakeLists.txt create mode 100644 recipes/nanorange/all/test_package/conanfile.py create mode 100644 recipes/nanorange/all/test_package/test_package.cpp create mode 100644 recipes/nanorange/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nanorange/all/test_v1_package/conanfile.py create mode 100644 recipes/nanorange/config.yml create mode 100644 recipes/nanosvg/all/conandata.yml create mode 100644 recipes/nanosvg/all/conanfile.py create mode 100644 recipes/nanosvg/all/test_package/CMakeLists.txt create mode 100644 recipes/nanosvg/all/test_package/conanfile.py create mode 100644 recipes/nanosvg/all/test_package/nano.svg create mode 100644 recipes/nanosvg/all/test_package/test_package.c create mode 100644 recipes/nanosvg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nanosvg/all/test_v1_package/conanfile.py create mode 100644 recipes/nanosvg/config.yml create mode 100644 recipes/nas/all/conandata.yml create mode 100644 recipes/nas/all/conanfile.py create mode 100644 recipes/nas/all/patches/0001-1.9.4-extern-variable-bugfix.patch create mode 100644 recipes/nas/all/test_package/CMakeLists.txt create mode 100644 recipes/nas/all/test_package/conanfile.py create mode 100644 recipes/nas/all/test_package/test_package.c create mode 100644 recipes/nas/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nas/all/test_v1_package/conanfile.py create mode 100644 recipes/nas/config.yml create mode 100644 recipes/nasm/all/conandata.yml create mode 100644 recipes/nasm/all/conanfile.py create mode 100644 recipes/nasm/all/patches/2.15.05-0001-disable-newly-integrated-dependency-tracking.patch create mode 100644 recipes/nasm/all/test_package/conanfile.py create mode 100644 recipes/nasm/all/test_package/hello_linux.asm create mode 100644 recipes/nasm/all/test_v1_package/conanfile.py create mode 100644 recipes/nasm/all/test_v1_package/hello_linux.asm create mode 100644 recipes/nasm/config.yml create mode 100644 recipes/nativefiledialog/all/conandata.yml create mode 100644 recipes/nativefiledialog/all/conanfile.py create mode 100644 recipes/nativefiledialog/all/test_package/CMakeLists.txt create mode 100644 recipes/nativefiledialog/all/test_package/conanfile.py create mode 100644 recipes/nativefiledialog/all/test_package/test_package.c create mode 100644 recipes/nativefiledialog/config.yml create mode 100644 recipes/ncbi-cxx-toolkit-public/26/conandata.yml create mode 100644 recipes/ncbi-cxx-toolkit-public/26/conanfile.py create mode 100644 recipes/ncbi-cxx-toolkit-public/26/test_package/CMakeLists.txt create mode 100644 recipes/ncbi-cxx-toolkit-public/26/test_package/basic_sample.cpp create mode 100644 recipes/ncbi-cxx-toolkit-public/26/test_package/conanfile.py create mode 100644 recipes/ncbi-cxx-toolkit-public/config.yml create mode 100644 recipes/ncurses/all/conandata.yml create mode 100644 recipes/ncurses/all/conanfile.py create mode 100644 recipes/ncurses/all/maintainer/reduce-configure-patch.py create mode 100644 recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0014-avoid-macro-expansion-in-args-by-defining-NCURSES_NO.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch create mode 100644 recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch create mode 100644 recipes/ncurses/all/test_package/CMakeLists.txt create mode 100644 recipes/ncurses/all/test_package/conanfile.py create mode 100644 recipes/ncurses/all/test_package/test_package.c create mode 100644 recipes/ncurses/config.yml create mode 100644 recipes/neargye-semver/all/conandata.yml create mode 100644 recipes/neargye-semver/all/conanfile.py create mode 100644 recipes/neargye-semver/all/test_package/CMakeLists.txt create mode 100644 recipes/neargye-semver/all/test_package/conanfile.py create mode 100644 recipes/neargye-semver/all/test_package/test_package.cpp create mode 100644 recipes/neargye-semver/config.yml create mode 100644 recipes/net-snmp/all/conandata.yml create mode 100644 recipes/net-snmp/all/conanfile.py create mode 100644 recipes/net-snmp/all/patches/0001-fix-openssl-linking-msvc.patch create mode 100644 recipes/net-snmp/all/patches/0002-install-only-libnetsnmp.patch create mode 100644 recipes/net-snmp/all/patches/0003-fix-perl-scripts-msvc.patch create mode 100644 recipes/net-snmp/all/patches/0004-fix-apple-arm64-build.patch create mode 100644 recipes/net-snmp/all/test_package/CMakeLists.txt create mode 100644 recipes/net-snmp/all/test_package/conanfile.py create mode 100644 recipes/net-snmp/all/test_package/test_package.c create mode 100644 recipes/net-snmp/config.yml create mode 100644 recipes/netcdf/all/conandata.yml create mode 100644 recipes/netcdf/all/conanfile.py create mode 100644 recipes/netcdf/all/patches/4.7.4-0001-fix-cmake.patch create mode 100644 recipes/netcdf/all/patches/4.8.1-0001-fix-cmake.patch create mode 100644 recipes/netcdf/all/test_package/CMakeLists.txt create mode 100644 recipes/netcdf/all/test_package/conanfile.py create mode 100644 recipes/netcdf/all/test_package/test_package.c create mode 100644 recipes/netcdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/netcdf/all/test_v1_package/conanfile.py create mode 100644 recipes/netcdf/config.yml create mode 100644 recipes/nettle/all/conandata.yml create mode 100644 recipes/nettle/all/conanfile.py create mode 100644 recipes/nettle/all/test_package/CMakeLists.txt create mode 100644 recipes/nettle/all/test_package/conanfile.py create mode 100644 recipes/nettle/all/test_package/test_package.c create mode 100644 recipes/nettle/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nettle/all/test_v1_package/conanfile.py create mode 100644 recipes/nettle/config.yml create mode 100644 recipes/nextsilicon-cpp-subprocess/all/conandata.yml create mode 100644 recipes/nextsilicon-cpp-subprocess/all/conanfile.py create mode 100644 recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt create mode 100644 recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py create mode 100644 recipes/nextsilicon-cpp-subprocess/all/test_package/test_package.cpp create mode 100644 recipes/nextsilicon-cpp-subprocess/config.yml create mode 100644 recipes/nfrechette-acl/all/conandata.yml create mode 100644 recipes/nfrechette-acl/all/conanfile.py create mode 100644 recipes/nfrechette-acl/all/test_package/CMakeLists.txt create mode 100644 recipes/nfrechette-acl/all/test_package/conanfile.py create mode 100644 recipes/nfrechette-acl/all/test_package/test_package.cpp create mode 100644 recipes/nfrechette-acl/config.yml create mode 100644 recipes/ninja/all/conandata.yml create mode 100644 recipes/ninja/all/conanfile.py create mode 100644 recipes/ninja/all/test_package/conanfile.py create mode 100644 recipes/ninja/all/test_v1_package/conanfile.py create mode 100644 recipes/ninja/config.yml create mode 100644 recipes/nlohmann_json/all/conandata.yml create mode 100644 recipes/nlohmann_json/all/conanfile.py create mode 100644 recipes/nlohmann_json/all/test_package/CMakeLists.txt create mode 100644 recipes/nlohmann_json/all/test_package/conanfile.py create mode 100644 recipes/nlohmann_json/all/test_package/test_package.cpp create mode 100644 recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nlohmann_json/all/test_v1_package/conanfile.py create mode 100644 recipes/nlohmann_json/config.yml create mode 100644 recipes/nlopt/all/conandata.yml create mode 100644 recipes/nlopt/all/conanfile.py create mode 100644 recipes/nlopt/all/test_package/CMakeLists.txt create mode 100644 recipes/nlopt/all/test_package/conanfile.py create mode 100644 recipes/nlopt/all/test_package/test_package.c create mode 100644 recipes/nlopt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nlopt/all/test_v1_package/conanfile.py create mode 100644 recipes/nlopt/config.yml create mode 100644 recipes/nmos-cpp/all/conandata.yml create mode 100644 recipes/nmos-cpp/all/conanfile.py create mode 100644 recipes/nmos-cpp/all/patches/cmakedeps-targets.patch create mode 100644 recipes/nmos-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/nmos-cpp/all/test_package/conanfile.py create mode 100644 recipes/nmos-cpp/all/test_package/test_package.cpp create mode 100644 recipes/nmos-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nmos-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/nmos-cpp/config.yml create mode 100644 recipes/nmslib/all/CMakeLists.txt create mode 100644 recipes/nmslib/all/conandata.yml create mode 100644 recipes/nmslib/all/conanfile.py create mode 100644 recipes/nmslib/all/patches/0001-cmake-disable-app-build.patch create mode 100644 recipes/nmslib/all/patches/0002-cmake-fix-install.patch create mode 100644 recipes/nmslib/all/patches/0003-cmake-fix-flags.patch create mode 100644 recipes/nmslib/all/patches/0004-missing-utils-header.patch create mode 100644 recipes/nmslib/all/test_package/CMakeLists.txt create mode 100644 recipes/nmslib/all/test_package/conanfile.py create mode 100644 recipes/nmslib/all/test_package/test_package.cpp create mode 100644 recipes/nmslib/config.yml create mode 100644 recipes/nng/all/conandata.yml create mode 100644 recipes/nng/all/conanfile.py create mode 100644 recipes/nng/all/patches/0001-fix-ios-tvos-watchos-1.3.0.patch create mode 100644 recipes/nng/all/patches/0001-fix-ios-tvos-watchos-1.3.1.patch create mode 100644 recipes/nng/all/patches/0001-fix-ios-tvos-watchos-1.5.1.patch create mode 100644 recipes/nng/all/test_package/CMakeLists.txt create mode 100644 recipes/nng/all/test_package/conanfile.py create mode 100644 recipes/nng/all/test_package/test_package.c create mode 100644 recipes/nng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nng/all/test_v1_package/conanfile.py create mode 100644 recipes/nng/config.yml create mode 100644 recipes/nodejs/all/conandata.yml create mode 100644 recipes/nodejs/all/conanfile.py create mode 100644 recipes/nodejs/all/test_package/conanfile.py create mode 100644 recipes/nodejs/all/test_v1_package/conanfile.py create mode 100644 recipes/nodejs/config.yml create mode 100644 recipes/nodesoup/all/CMakeLists.txt create mode 100644 recipes/nodesoup/all/conandata.yml create mode 100644 recipes/nodesoup/all/conanfile.py create mode 100644 recipes/nodesoup/all/patches/0001-install-shared-windows.patch create mode 100644 recipes/nodesoup/all/test_package/CMakeLists.txt create mode 100644 recipes/nodesoup/all/test_package/conanfile.py create mode 100644 recipes/nodesoup/all/test_package/test_package.cpp create mode 100644 recipes/nodesoup/config.yml create mode 100644 recipes/norm/all/conandata.yml create mode 100644 recipes/norm/all/conanfile.py create mode 100644 recipes/norm/all/patches/0001-fix-pthread.patch create mode 100644 recipes/norm/all/patches/0002-fix-fpic.patch create mode 100644 recipes/norm/all/patches/0003-cpp20-compat.patch create mode 100644 recipes/norm/all/test_package/CMakeLists.txt create mode 100644 recipes/norm/all/test_package/conanfile.py create mode 100644 recipes/norm/all/test_package/test_package.cpp create mode 100644 recipes/norm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/norm/all/test_v1_package/conanfile.py create mode 100644 recipes/norm/config.yml create mode 100644 recipes/npcap/all/conandata.yml create mode 100644 recipes/npcap/all/conanfile.py create mode 100644 recipes/npcap/all/test_package/CMakeLists.txt create mode 100644 recipes/npcap/all/test_package/conanfile.py create mode 100644 recipes/npcap/all/test_package/test_package.c create mode 100644 recipes/npcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/npcap/all/test_v1_package/conanfile.py create mode 100644 recipes/npcap/config.yml create mode 100644 recipes/nsimd/2.x/CMakeLists.txt create mode 100644 recipes/nsimd/2.x/conandata.yml create mode 100644 recipes/nsimd/2.x/conanfile.py create mode 100644 recipes/nsimd/2.x/test_package/CMakeLists.txt create mode 100644 recipes/nsimd/2.x/test_package/conanfile.py create mode 100644 recipes/nsimd/2.x/test_package/test_package.cpp create mode 100644 recipes/nsimd/config.yml create mode 100644 recipes/nspr/all/conandata.yml create mode 100644 recipes/nspr/all/conanfile.py create mode 100644 recipes/nspr/all/test_package/CMakeLists.txt create mode 100644 recipes/nspr/all/test_package/conanfile.py create mode 100644 recipes/nspr/all/test_package/test_package.c create mode 100644 recipes/nspr/config.yml create mode 100644 recipes/nss/all/conandata.yml create mode 100644 recipes/nss/all/conanfile.py create mode 100644 recipes/nss/all/test_package/CMakeLists.txt create mode 100644 recipes/nss/all/test_package/conanfile.py create mode 100644 recipes/nss/all/test_package/test_package.c create mode 100644 recipes/nss/config.yml create mode 100644 recipes/nsync/all/conandata.yml create mode 100644 recipes/nsync/all/conanfile.py create mode 100644 recipes/nsync/all/patches/0001-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch create mode 100644 recipes/nsync/all/test_package/CMakeLists.txt create mode 100644 recipes/nsync/all/test_package/conanfile.py create mode 100644 recipes/nsync/all/test_package/example_c.c create mode 100644 recipes/nsync/all/test_package/example_cpp.cpp create mode 100644 recipes/nsync/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nsync/all/test_v1_package/conanfile.py create mode 100644 recipes/nsync/config.yml create mode 100644 recipes/ntv2/all/conandata.yml create mode 100644 recipes/ntv2/all/conanfile.py create mode 100644 recipes/ntv2/all/test_package/CMakeLists.txt create mode 100644 recipes/ntv2/all/test_package/conanfile.py create mode 100644 recipes/ntv2/all/test_package/test_package.cpp create mode 100644 recipes/ntv2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ntv2/all/test_v1_package/conanfile.py create mode 100644 recipes/ntv2/config.yml create mode 100644 recipes/nudb/all/conandata.yml create mode 100644 recipes/nudb/all/conanfile.py create mode 100644 recipes/nudb/all/test_package/CMakeLists.txt create mode 100644 recipes/nudb/all/test_package/conanfile.py create mode 100644 recipes/nudb/all/test_package/test_package.cpp create mode 100644 recipes/nudb/config.yml create mode 100644 recipes/nuklear/all/conandata.yml create mode 100644 recipes/nuklear/all/conanfile.py create mode 100644 recipes/nuklear/all/test_package/CMakeLists.txt create mode 100644 recipes/nuklear/all/test_package/conanfile.py create mode 100644 recipes/nuklear/all/test_package/test_package.c create mode 100644 recipes/nuklear/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nuklear/all/test_v1_package/conanfile.py create mode 100644 recipes/nuklear/config.yml create mode 100644 recipes/numcpp/all/conandata.yml create mode 100644 recipes/numcpp/all/conanfile.py create mode 100644 recipes/numcpp/all/test_package/CMakeLists.txt create mode 100644 recipes/numcpp/all/test_package/conanfile.py create mode 100644 recipes/numcpp/all/test_package/test_package.cpp create mode 100644 recipes/numcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/numcpp/all/test_v1_package/conanfile.py create mode 100644 recipes/numcpp/config.yml create mode 100644 recipes/nuraft/all/conandata.yml create mode 100644 recipes/nuraft/all/conanfile.py create mode 100644 recipes/nuraft/all/patches/0001-cmake_patches.patch create mode 100644 recipes/nuraft/all/patches/1001-cmake_patches.patch create mode 100644 recipes/nuraft/all/test_package/CMakeLists.txt create mode 100644 recipes/nuraft/all/test_package/conanfile.py create mode 100644 recipes/nuraft/all/test_package/test_package.cpp create mode 100644 recipes/nuraft/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nuraft/all/test_v1_package/conanfile.py create mode 100644 recipes/nuraft/config.yml create mode 100644 recipes/nv-codec-headers/all/conandata.yml create mode 100644 recipes/nv-codec-headers/all/conanfile.py create mode 100644 recipes/nv-codec-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/nv-codec-headers/all/test_package/conanfile.py create mode 100644 recipes/nv-codec-headers/all/test_package/test_package.c create mode 100644 recipes/nv-codec-headers/config.yml create mode 100644 recipes/nvcloth/1.1.6/CMakeLists.txt create mode 100644 recipes/nvcloth/1.1.6/conandata.yml create mode 100644 recipes/nvcloth/1.1.6/conanfile.py create mode 100644 recipes/nvcloth/1.1.6/patches/0001-PsAllocator-include-typeinfo.patch create mode 100644 recipes/nvcloth/1.1.6/patches/0002-CallbackFix.patch create mode 100644 recipes/nvcloth/1.1.6/patches/0003-PsAllocator.patch create mode 100644 recipes/nvcloth/1.1.6/test_package/CMakeLists.txt create mode 100644 recipes/nvcloth/1.1.6/test_package/conanfile.py create mode 100644 recipes/nvcloth/1.1.6/test_package/test_package.cpp create mode 100644 recipes/nvcloth/config.yml create mode 100644 recipes/nvtx/all/conandata.yml create mode 100644 recipes/nvtx/all/conanfile.py create mode 100644 recipes/nvtx/all/test_package/CMakeLists.txt create mode 100644 recipes/nvtx/all/test_package/conanfile.py create mode 100644 recipes/nvtx/all/test_package/test_package.c create mode 100644 recipes/nvtx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nvtx/all/test_v1_package/conanfile.py create mode 100644 recipes/nvtx/config.yml create mode 100644 recipes/oatpp-libressl/all/conandata.yml create mode 100644 recipes/oatpp-libressl/all/conanfile.py create mode 100644 recipes/oatpp-libressl/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp-libressl/all/test_package/conanfile.py create mode 100644 recipes/oatpp-libressl/all/test_package/test_package.cpp create mode 100644 recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-libressl/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp-libressl/config.yml create mode 100644 recipes/oatpp-openssl/all/conandata.yml create mode 100644 recipes/oatpp-openssl/all/conanfile.py create mode 100644 recipes/oatpp-openssl/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp-openssl/all/test_package/conanfile.py create mode 100644 recipes/oatpp-openssl/all/test_package/test_package.cpp create mode 100644 recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-openssl/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp-openssl/config.yml create mode 100644 recipes/oatpp-postgresql/all/conandata.yml create mode 100644 recipes/oatpp-postgresql/all/conanfile.py create mode 100644 recipes/oatpp-postgresql/all/patches/1.2.5/01-fix-windows-build.patch create mode 100644 recipes/oatpp-postgresql/all/patches/1.3.0/01-add-bigobj.patch create mode 100644 recipes/oatpp-postgresql/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp-postgresql/all/test_package/conanfile.py create mode 100644 recipes/oatpp-postgresql/all/test_package/test_package.cpp create mode 100644 recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-postgresql/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp-postgresql/config.yml create mode 100644 recipes/oatpp-sqlite/all/conandata.yml create mode 100644 recipes/oatpp-sqlite/all/conanfile.py create mode 100644 recipes/oatpp-sqlite/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp-sqlite/all/test_package/conanfile.py create mode 100644 recipes/oatpp-sqlite/all/test_package/test_package.cpp create mode 100644 recipes/oatpp-sqlite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-sqlite/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp-sqlite/config.yml create mode 100644 recipes/oatpp-swagger/all/conandata.yml create mode 100644 recipes/oatpp-swagger/all/conanfile.py create mode 100644 recipes/oatpp-swagger/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp-swagger/all/test_package/conanfile.py create mode 100644 recipes/oatpp-swagger/all/test_package/test_package.cpp create mode 100644 recipes/oatpp-swagger/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-swagger/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp-swagger/config.yml create mode 100644 recipes/oatpp-websocket/all/conandata.yml create mode 100644 recipes/oatpp-websocket/all/conanfile.py create mode 100644 recipes/oatpp-websocket/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp-websocket/all/test_package/conanfile.py create mode 100644 recipes/oatpp-websocket/all/test_package/test_package.cpp create mode 100644 recipes/oatpp-websocket/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-websocket/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp-websocket/config.yml create mode 100644 recipes/oatpp/all/conandata.yml create mode 100644 recipes/oatpp/all/conanfile.py create mode 100644 recipes/oatpp/all/test_package/CMakeLists.txt create mode 100644 recipes/oatpp/all/test_package/DeserializerTest.hpp create mode 100644 recipes/oatpp/all/test_package/DeserializerTest_1_0_0.cpp create mode 100644 recipes/oatpp/all/test_package/DeserializerTest_1_1_0.cpp create mode 100644 recipes/oatpp/all/test_package/DeserializerTest_1_3_0.cpp create mode 100644 recipes/oatpp/all/test_package/conanfile.py create mode 100644 recipes/oatpp/all/test_package/test_package.cpp create mode 100644 recipes/oatpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp/all/test_v1_package/conanfile.py create mode 100644 recipes/oatpp/config.yml create mode 100644 recipes/objectbox-generator/all/conandata.yml create mode 100644 recipes/objectbox-generator/all/conanfile.py create mode 100644 recipes/objectbox-generator/all/test_package/conanfile.py create mode 100644 recipes/objectbox-generator/config.yml create mode 100644 recipes/objectbox/all/conandata.yml create mode 100644 recipes/objectbox/all/conanfile.py create mode 100644 recipes/objectbox/all/patches/0001-fix-cmake.patch create mode 100644 recipes/objectbox/all/test_package/CMakeLists.txt create mode 100644 recipes/objectbox/all/test_package/conanfile.py create mode 100644 recipes/objectbox/all/test_package/test_package.c create mode 100644 recipes/objectbox/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/objectbox/all/test_v1_package/conanfile.py create mode 100644 recipes/objectbox/config.yml create mode 100644 recipes/oboe/all/conandata.yml create mode 100644 recipes/oboe/all/conanfile.py create mode 100644 recipes/oboe/all/patches/1.7.0-0001-fix-cmake.patch create mode 100644 recipes/oboe/all/test_package/CMakeLists.txt create mode 100644 recipes/oboe/all/test_package/conanfile.py create mode 100644 recipes/oboe/all/test_package/test_package.cpp create mode 100644 recipes/oboe/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oboe/all/test_v1_package/conanfile.py create mode 100644 recipes/oboe/config.yml create mode 100644 recipes/observer-ptr-lite/all/conandata.yml create mode 100644 recipes/observer-ptr-lite/all/conanfile.py create mode 100644 recipes/observer-ptr-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/observer-ptr-lite/all/test_package/conanfile.py create mode 100644 recipes/observer-ptr-lite/all/test_package/test_package.cpp create mode 100644 recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/observer-ptr-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/observer-ptr-lite/config.yml create mode 100644 recipes/octo-encryption-cpp/all/conandata.yml create mode 100644 recipes/octo-encryption-cpp/all/conanfile.py create mode 100644 recipes/octo-encryption-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/octo-encryption-cpp/all/test_package/conanfile.py create mode 100644 recipes/octo-encryption-cpp/all/test_package/test_package.cpp create mode 100644 recipes/octo-encryption-cpp/config.yml create mode 100644 recipes/octo-keygen-cpp/all/conandata.yml create mode 100644 recipes/octo-keygen-cpp/all/conanfile.py create mode 100644 recipes/octo-keygen-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/octo-keygen-cpp/all/test_package/conanfile.py create mode 100644 recipes/octo-keygen-cpp/all/test_package/test_package.cpp create mode 100644 recipes/octo-keygen-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/octo-keygen-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/octo-keygen-cpp/config.yml create mode 100644 recipes/octo-logger-cpp/all/conandata.yml create mode 100644 recipes/octo-logger-cpp/all/conanfile.py create mode 100644 recipes/octo-logger-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/octo-logger-cpp/all/test_package/conanfile.py create mode 100644 recipes/octo-logger-cpp/all/test_package/test_package.cpp create mode 100644 recipes/octo-logger-cpp/config.yml create mode 100644 recipes/octo-wildcardmatching-cpp/all/conandata.yml create mode 100644 recipes/octo-wildcardmatching-cpp/all/conanfile.py create mode 100644 recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/octo-wildcardmatching-cpp/all/test_package/conanfile.py create mode 100644 recipes/octo-wildcardmatching-cpp/all/test_package/test_package.cpp create mode 100644 recipes/octo-wildcardmatching-cpp/config.yml create mode 100644 recipes/octomap/all/conandata.yml create mode 100644 recipes/octomap/all/conanfile.py create mode 100644 recipes/octomap/all/patches/targets-outputname-collision-1.9.3.patch create mode 100644 recipes/octomap/all/patches/targets-outputname-collision-1.9.5.patch create mode 100644 recipes/octomap/all/test_package/CMakeLists.txt create mode 100644 recipes/octomap/all/test_package/conanfile.py create mode 100644 recipes/octomap/all/test_package/test_package.cpp create mode 100644 recipes/octomap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/octomap/all/test_v1_package/conanfile.py create mode 100644 recipes/octomap/config.yml create mode 100644 recipes/odbc/all/conandata.yml create mode 100644 recipes/odbc/all/conanfile.py create mode 100644 recipes/odbc/all/patches/0001-duplicated-get-connection.patch create mode 100644 recipes/odbc/all/patches/0002-missing-declarations.patch create mode 100644 recipes/odbc/all/test_package/CMakeLists.txt create mode 100644 recipes/odbc/all/test_package/conanfile.py create mode 100644 recipes/odbc/all/test_package/test_package.c create mode 100644 recipes/odbc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/odbc/all/test_v1_package/conanfile.py create mode 100644 recipes/odbc/config.yml create mode 100644 recipes/ode/all/conandata.yml create mode 100644 recipes/ode/all/conanfile.py create mode 100644 recipes/ode/all/patches/0001-fix-apple.patch create mode 100644 recipes/ode/all/patches/0002-dont-force-pic.patch create mode 100644 recipes/ode/all/patches/0003-cmake-fix-ccd-target.patch create mode 100644 recipes/ode/all/patches/0004-fix-include-ode-timer.patch create mode 100644 recipes/ode/all/test_package/CMakeLists.txt create mode 100644 recipes/ode/all/test_package/conanfile.py create mode 100644 recipes/ode/all/test_package/test_package.c create mode 100644 recipes/ode/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ode/all/test_v1_package/conanfile.py create mode 100644 recipes/ode/config.yml create mode 100644 recipes/ofeli/all/CMakeLists.txt create mode 100644 recipes/ofeli/all/conandata.yml create mode 100644 recipes/ofeli/all/conanfile.py create mode 100644 recipes/ofeli/all/test_package/CMakeLists.txt create mode 100644 recipes/ofeli/all/test_package/conanfile.py create mode 100644 recipes/ofeli/all/test_package/test_package.cpp create mode 100644 recipes/ofeli/config.yml create mode 100644 recipes/ogdf/all/conandata.yml create mode 100644 recipes/ogdf/all/conanfile.py create mode 100644 recipes/ogdf/all/test_package/CMakeLists.txt create mode 100644 recipes/ogdf/all/test_package/conanfile.py create mode 100644 recipes/ogdf/all/test_package/main.cpp create mode 100644 recipes/ogdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ogdf/all/test_v1_package/conanfile.py create mode 100644 recipes/ogdf/config.yml create mode 100644 recipes/ogg/all/conandata.yml create mode 100644 recipes/ogg/all/conanfile.py create mode 100644 recipes/ogg/all/patches/001-fix-unsigned-typedefs-for-macos.patch create mode 100644 recipes/ogg/all/test_package/CMakeLists.txt create mode 100644 recipes/ogg/all/test_package/conanfile.py create mode 100644 recipes/ogg/all/test_package/test_package.c create mode 100644 recipes/ogg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ogg/all/test_v1_package/conanfile.py create mode 100644 recipes/ogg/config.yml create mode 100644 recipes/ogre/1.x/CMakeLists.txt create mode 100644 recipes/ogre/1.x/conandata.yml create mode 100644 recipes/ogre/1.x/conanfile.py create mode 100644 recipes/ogre/1.x/patches/0001-ogre-1.10.2-cmake-fixes.patch create mode 100644 recipes/ogre/1.x/test_package/CMakeLists.txt create mode 100644 recipes/ogre/1.x/test_package/conanfile.py create mode 100644 recipes/ogre/1.x/test_package/ogre_main.cpp create mode 100644 recipes/ogre/config.yml create mode 100644 recipes/ois/all/CMakeLists.txt create mode 100644 recipes/ois/all/conandata.yml create mode 100644 recipes/ois/all/conanfile.py create mode 100644 recipes/ois/all/patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch create mode 100644 recipes/ois/all/test_package/CMakeLists.txt create mode 100644 recipes/ois/all/test_package/conanfile.py create mode 100644 recipes/ois/all/test_package/test_package.cpp create mode 100644 recipes/ois/config.yml create mode 100644 recipes/onedpl/all/conandata.yml create mode 100644 recipes/onedpl/all/conanfile.py create mode 100644 recipes/onedpl/all/test_package/CMakeLists.txt create mode 100644 recipes/onedpl/all/test_package/conanfile.py create mode 100644 recipes/onedpl/all/test_package/test_package.2020.cpp create mode 100644 recipes/onedpl/all/test_package/test_package.2021.cpp create mode 100644 recipes/onedpl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/onedpl/all/test_v1_package/conanfile.py create mode 100644 recipes/onedpl/config.yml create mode 100644 recipes/onetbb/2020.x/conandata.yml create mode 100644 recipes/onetbb/2020.x/conanfile.py create mode 100644 recipes/onetbb/2020.x/test_package/CMakeLists.txt create mode 100644 recipes/onetbb/2020.x/test_package/conanfile.py create mode 100644 recipes/onetbb/2020.x/test_package/test_package.cpp create mode 100644 recipes/onetbb/all/conandata.yml create mode 100644 recipes/onetbb/all/conanfile.py create mode 100644 recipes/onetbb/all/patches/android-ndk25.patch create mode 100644 recipes/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff create mode 100644 recipes/onetbb/all/test_package/CMakeLists.txt create mode 100644 recipes/onetbb/all/test_package/conanfile.py create mode 100644 recipes/onetbb/all/test_package/test_package.cpp create mode 100644 recipes/onetbb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/onetbb/all/test_v1_package/conanfile.py create mode 100644 recipes/onetbb/config.yml create mode 100644 recipes/oniguruma/all/conandata.yml create mode 100644 recipes/oniguruma/all/conanfile.py create mode 100644 recipes/oniguruma/all/test_package/CMakeLists.txt create mode 100644 recipes/oniguruma/all/test_package/conanfile.py create mode 100644 recipes/oniguruma/all/test_package/test_package.c create mode 100644 recipes/oniguruma/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oniguruma/all/test_v1_package/conanfile.py create mode 100644 recipes/oniguruma/config.yml create mode 100644 recipes/onnx/all/conandata.yml create mode 100644 recipes/onnx/all/conanfile.py create mode 100644 recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.11.0.patch create mode 100644 recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch create mode 100644 recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.8.1.patch create mode 100644 recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.9.0.patch create mode 100644 recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.8.1.patch create mode 100644 recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.9.0.patch create mode 100644 recipes/onnx/all/test_package/CMakeLists.txt create mode 100644 recipes/onnx/all/test_package/conanfile.py create mode 100644 recipes/onnx/all/test_package/test_package.cpp create mode 100644 recipes/onnx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/onnx/all/test_v1_package/conanfile.py create mode 100644 recipes/onnx/config.yml create mode 100644 recipes/onnxruntime/all/conandata.yml create mode 100644 recipes/onnxruntime/all/conanfile.py create mode 100644 recipes/onnxruntime/all/patches/1.14.1-0001-cmake-dependencies.patch create mode 100644 recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch create mode 100644 recipes/onnxruntime/all/patches/1.14.1-0003-amx-gas-version.patch create mode 100644 recipes/onnxruntime/all/patches/1.14.1-0004-abseil-no-string-view.patch create mode 100644 recipes/onnxruntime/all/test_package/CMakeLists.txt create mode 100644 recipes/onnxruntime/all/test_package/conanfile.py create mode 100644 recipes/onnxruntime/all/test_package/test_package.cpp create mode 100644 recipes/onnxruntime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/onnxruntime/all/test_v1_package/conanfile.py create mode 100644 recipes/onnxruntime/config.yml create mode 100644 recipes/open-dis-cpp/all/conandata.yml create mode 100644 recipes/open-dis-cpp/all/conanfile.py create mode 100644 recipes/open-dis-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/open-dis-cpp/all/test_package/conanfile.py create mode 100644 recipes/open-dis-cpp/all/test_package/test_package.cpp create mode 100644 recipes/open-dis-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/open-dis-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/open-dis-cpp/config.yml create mode 100644 recipes/open-simulation-interface/all/CMakeLists.txt create mode 100644 recipes/open-simulation-interface/all/conandata.yml create mode 100644 recipes/open-simulation-interface/all/conanfile.py create mode 100644 recipes/open-simulation-interface/all/patches/3.1.2_single_lib.patch create mode 100644 recipes/open-simulation-interface/all/patches/3.3.x_single_lib.patch create mode 100644 recipes/open-simulation-interface/all/patches/3.4.0_single_lib.patch create mode 100644 recipes/open-simulation-interface/all/test_package/CMakeLists.txt create mode 100644 recipes/open-simulation-interface/all/test_package/conanfile.py create mode 100644 recipes/open-simulation-interface/all/test_package/test_package.cpp create mode 100644 recipes/open-simulation-interface/config.yml create mode 100644 recipes/open62541/all/CMakeLists.txt create mode 100644 recipes/open62541/all/conandata.yml create mode 100644 recipes/open62541/all/conanfile.py create mode 100644 recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_1_x.patch create mode 100644 recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_2_x.patch create mode 100644 recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_1.patch create mode 100644 recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_4.patch create mode 100644 recipes/open62541/all/patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch create mode 100644 recipes/open62541/all/patches/0003-disable-sanitizers-1_1_6.patch create mode 100644 recipes/open62541/all/patches/0003-disable-sanitizers-1_2_x.patch create mode 100644 recipes/open62541/all/patches/0003-fix-use-usr-bin-env-python3.patch create mode 100644 recipes/open62541/all/patches/1_0_x.patch create mode 100644 recipes/open62541/all/submoduledata.yml create mode 100644 recipes/open62541/all/test_package/CMakeLists.txt create mode 100644 recipes/open62541/all/test_package/FooFlt.NodeSet2.xml create mode 100644 recipes/open62541/all/test_package/FooFlt.Types.bsd create mode 100644 recipes/open62541/all/test_package/FooFltModel.csv create mode 100644 recipes/open62541/all/test_package/conanfile.py create mode 100644 recipes/open62541/all/test_package/test_package.c create mode 100644 recipes/open62541/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/open62541/all/test_v1_package/conanfile.py create mode 100644 recipes/open62541/config.yml create mode 100644 recipes/openal-soft/all/conandata.yml create mode 100644 recipes/openal-soft/all/conanfile.py create mode 100644 recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch create mode 100644 recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch create mode 100644 recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch create mode 100644 recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch create mode 100644 recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch create mode 100644 recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch create mode 100644 recipes/openal-soft/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch create mode 100644 recipes/openal-soft/all/test_package/CMakeLists.txt create mode 100644 recipes/openal-soft/all/test_package/conanfile.py create mode 100644 recipes/openal-soft/all/test_package/test_package.c create mode 100644 recipes/openal-soft/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openal-soft/all/test_v1_package/conanfile.py create mode 100644 recipes/openal-soft/config.yml create mode 100644 recipes/openal/all/conandata.yml create mode 100644 recipes/openal/all/conanfile.py create mode 100644 recipes/openal/all/patches/1.19.1-0001-aligned-alloc.patch create mode 100644 recipes/openal/all/patches/1.19.1-0002-gcc-10-fnocommon.patch create mode 100644 recipes/openal/all/patches/1.19.1-0003-fix-windows-sdk.patch create mode 100644 recipes/openal/all/patches/1.20.1-0001-fix-windows-sdk.patch create mode 100644 recipes/openal/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch create mode 100644 recipes/openal/all/patches/1.21.0-0002-fix-windows-sdk.patch create mode 100644 recipes/openal/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch create mode 100644 recipes/openal/all/test_package/CMakeLists.txt create mode 100644 recipes/openal/all/test_package/conanfile.py create mode 100644 recipes/openal/all/test_package/test_package.c create mode 100644 recipes/openal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openal/all/test_v1_package/conanfile.py create mode 100644 recipes/openal/config.yml create mode 100644 recipes/openapi-generator/all/conandata.yml create mode 100644 recipes/openapi-generator/all/conanfile.py create mode 100644 recipes/openapi-generator/all/test_package/conanfile.py create mode 100644 recipes/openapi-generator/all/test_v1_package/conanfile.py create mode 100644 recipes/openapi-generator/config.yml create mode 100644 recipes/openassetio/all/conandata.yml create mode 100644 recipes/openassetio/all/conanfile.py create mode 100644 recipes/openassetio/all/test_package/CMakeLists.txt create mode 100644 recipes/openassetio/all/test_package/conanfile.py create mode 100644 recipes/openassetio/all/test_package/test.core.cpp create mode 100644 recipes/openassetio/all/test_package/test.py create mode 100644 recipes/openassetio/all/test_package/test.python.bridge.cpp create mode 100644 recipes/openassetio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openassetio/all/test_v1_package/conanfile.py create mode 100644 recipes/openassetio/all/test_v1_package/test.core.cpp create mode 100644 recipes/openassetio/all/test_v1_package/test.py create mode 100644 recipes/openassetio/all/test_v1_package/test.python.bridge.cpp create mode 100644 recipes/openassetio/config.yml create mode 100644 recipes/openblas/all/CMakeLists.txt create mode 100644 recipes/openblas/all/conandata.yml create mode 100644 recipes/openblas/all/conanfile.py create mode 100644 recipes/openblas/all/test_package/CMakeLists.txt create mode 100644 recipes/openblas/all/test_package/conanfile.py create mode 100644 recipes/openblas/all/test_package/test_package.cpp create mode 100644 recipes/openblas/config.yml create mode 100644 recipes/opencascade/all/conandata.yml create mode 100644 recipes/opencascade/all/conanfile.py create mode 100644 recipes/opencascade/all/patches/0001-undefined-ref-ncollection-lerp.patch create mode 100644 recipes/opencascade/all/test_package/CMakeLists.txt create mode 100644 recipes/opencascade/all/test_package/conanfile.py create mode 100644 recipes/opencascade/all/test_package/test_package.cpp create mode 100644 recipes/opencascade/config.yml create mode 100644 recipes/opencl-headers/all/conandata.yml create mode 100644 recipes/opencl-headers/all/conanfile.py create mode 100644 recipes/opencl-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/opencl-headers/all/test_package/conanfile.py create mode 100644 recipes/opencl-headers/all/test_package/test_package.c create mode 100644 recipes/opencl-headers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opencl-headers/all/test_v1_package/conanfile.py create mode 100644 recipes/opencl-headers/config.yml create mode 100644 recipes/opencl-icd-loader/all/conandata.yml create mode 100644 recipes/opencl-icd-loader/all/conanfile.py create mode 100644 recipes/opencl-icd-loader/all/patches/2020.06.16/0001-xcode-missing-includes.patch create mode 100644 recipes/opencl-icd-loader/all/test_package/CMakeLists.txt create mode 100644 recipes/opencl-icd-loader/all/test_package/conanfile.py create mode 100644 recipes/opencl-icd-loader/all/test_package/test_package.c create mode 100644 recipes/opencl-icd-loader/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opencl-icd-loader/all/test_v1_package/conanfile.py create mode 100644 recipes/opencl-icd-loader/config.yml create mode 100644 recipes/opencolorio/all/CMakeLists.txt create mode 100644 recipes/opencolorio/all/conandata.yml create mode 100644 recipes/opencolorio/all/conanfile.py create mode 100644 recipes/opencolorio/all/patches/1.1.1.patch create mode 100644 recipes/opencolorio/all/patches/fix-cmake-source-dir-and-targets.patch create mode 100644 recipes/opencolorio/all/patches/pstring.patch create mode 100644 recipes/opencolorio/all/patches/strlen.patch create mode 100644 recipes/opencolorio/all/test_package/CMakeLists.txt create mode 100644 recipes/opencolorio/all/test_package/conanfile.py create mode 100644 recipes/opencolorio/all/test_package/test_package.cpp create mode 100644 recipes/opencolorio/config.yml create mode 100644 recipes/opencore-amr/all/conandata.yml create mode 100644 recipes/opencore-amr/all/conanfile.py create mode 100644 recipes/opencore-amr/all/test_package/CMakeLists.txt create mode 100644 recipes/opencore-amr/all/test_package/conanfile.py create mode 100644 recipes/opencore-amr/all/test_package/test_package.cpp create mode 100644 recipes/opencore-amr/config.yml create mode 100644 recipes/opencv/2.x/conandata.yml create mode 100644 recipes/opencv/2.x/conanfile.py create mode 100644 recipes/opencv/2.x/patches/0001-jasper.patch create mode 100644 recipes/opencv/2.x/patches/0002-find-openexr.patch create mode 100644 recipes/opencv/2.x/test_package/CMakeLists.txt create mode 100644 recipes/opencv/2.x/test_package/conanfile.py create mode 100644 recipes/opencv/2.x/test_package/test_package.cpp create mode 100644 recipes/opencv/2.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/opencv/2.x/test_v1_package/conanfile.py create mode 100644 recipes/opencv/3.x/conandata.yml create mode 100644 recipes/opencv/3.x/conanfile.py create mode 100644 recipes/opencv/3.x/patches/3.4.12-0001-find-openexr.patch create mode 100644 recipes/opencv/3.x/patches/3.4.17-0001-find-openexr.patch create mode 100644 recipes/opencv/3.x/test_package/CMakeLists.txt create mode 100644 recipes/opencv/3.x/test_package/conanfile.py create mode 100644 recipes/opencv/3.x/test_package/test_package.cpp create mode 100644 recipes/opencv/3.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/opencv/3.x/test_v1_package/conanfile.py create mode 100644 recipes/opencv/4.x/conandata.yml create mode 100644 recipes/opencv/4.x/conanfile.py create mode 100644 recipes/opencv/4.x/patches/4.1.2-0001-find-openexr.patch create mode 100644 recipes/opencv/4.x/patches/4.1.2-0002-find-ade.patch create mode 100644 recipes/opencv/4.x/patches/4.1.2-0003-find-quirc.patch create mode 100644 recipes/opencv/4.x/patches/4.1.2-0004-jasper.patch create mode 100644 recipes/opencv/4.x/patches/4.1.2-0007-android-install-layout.patch create mode 100644 recipes/opencv/4.x/patches/4.5.0-0002-find-ade.patch create mode 100644 recipes/opencv/4.x/patches/4.5.2-0001-fix-zlib-static-android.patch create mode 100644 recipes/opencv/4.x/patches/4.5.3-0001-find-openexr.patch create mode 100644 recipes/opencv/4.x/patches/4.5.5-0001-find-openexr.patch create mode 100644 recipes/opencv/4.x/test_package/CMakeLists.txt create mode 100644 recipes/opencv/4.x/test_package/conanfile.py create mode 100644 recipes/opencv/4.x/test_package/test_package.cpp create mode 100644 recipes/opencv/4.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/opencv/4.x/test_v1_package/conanfile.py create mode 100644 recipes/opencv/config.yml create mode 100644 recipes/openddl-parser/all/conandata.yml create mode 100644 recipes/openddl-parser/all/conanfile.py create mode 100644 recipes/openddl-parser/all/patches/0001-fix-cmake.patch create mode 100644 recipes/openddl-parser/all/test_package/CMakeLists.txt create mode 100644 recipes/openddl-parser/all/test_package/conanfile.py create mode 100644 recipes/openddl-parser/all/test_package/test_package.cpp create mode 100644 recipes/openddl-parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openddl-parser/all/test_v1_package/conanfile.py create mode 100644 recipes/openddl-parser/config.yml create mode 100644 recipes/opene57/all/CMakeLists.txt create mode 100644 recipes/opene57/all/conandata.yml create mode 100644 recipes/opene57/all/conanfile.py create mode 100644 recipes/opene57/all/test_package/CMakeLists.txt create mode 100644 recipes/opene57/all/test_package/conanfile.py create mode 100644 recipes/opene57/all/test_package/example.cpp create mode 100644 recipes/opene57/config.yml create mode 100644 recipes/openexr/2.x/conandata.yml create mode 100644 recipes/openexr/2.x/conanfile.py create mode 100644 recipes/openexr/2.x/test_package/CMakeLists.txt create mode 100644 recipes/openexr/2.x/test_package/comp_short_decode_piz.exr create mode 100644 recipes/openexr/2.x/test_package/conanfile.py create mode 100644 recipes/openexr/2.x/test_package/test_package.cpp create mode 100644 recipes/openexr/2.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/openexr/2.x/test_v1_package/conanfile.py create mode 100644 recipes/openexr/3.x/conandata.yml create mode 100644 recipes/openexr/3.x/conanfile.py create mode 100644 recipes/openexr/3.x/patches/v3.1.4-gcc5-bug-workaround.patch create mode 100644 recipes/openexr/3.x/test_package/CMakeLists.txt create mode 100644 recipes/openexr/3.x/test_package/comp_short_decode_piz.exr create mode 100644 recipes/openexr/3.x/test_package/conanfile.py create mode 100644 recipes/openexr/3.x/test_package/test_package.cpp create mode 100644 recipes/openexr/3.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/openexr/3.x/test_v1_package/conanfile.py create mode 100644 recipes/openexr/config.yml create mode 100644 recipes/openfbx/all/CMakeLists.txt create mode 100644 recipes/openfbx/all/conandata.yml create mode 100644 recipes/openfbx/all/conanfile.py create mode 100644 recipes/openfbx/all/test_package/CMakeLists.txt create mode 100644 recipes/openfbx/all/test_package/conanfile.py create mode 100644 recipes/openfbx/all/test_package/d.fbx create mode 100644 recipes/openfbx/all/test_package/test_package.cpp create mode 100644 recipes/openfbx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openfbx/all/test_v1_package/conanfile.py create mode 100644 recipes/openfbx/config.yml create mode 100644 recipes/openfst/all/conandata.yml create mode 100644 recipes/openfst/all/conanfile.py create mode 100644 recipes/openfst/all/patches/1.8.2-allocate-hint.patch create mode 100644 recipes/openfst/all/test_package/CMakeLists.txt create mode 100644 recipes/openfst/all/test_package/conanfile.py create mode 100644 recipes/openfst/all/test_package/test_package.cpp create mode 100644 recipes/openfst/config.yml create mode 100644 recipes/openfx/all/CMakeLists.txt create mode 100644 recipes/openfx/all/cmake/OpenFX.cmake create mode 100644 recipes/openfx/all/conandata.yml create mode 100644 recipes/openfx/all/conanfile.py create mode 100644 recipes/openfx/all/symbols/linux.symbols create mode 100644 recipes/openfx/all/symbols/osx.symbols create mode 100644 recipes/openfx/all/symbols/windows.symbols create mode 100644 recipes/openfx/all/test_package/CMakeLists.txt create mode 100644 recipes/openfx/all/test_package/conanfile.py create mode 100644 recipes/openfx/all/test_package/invert.cpp create mode 100644 recipes/openfx/config.yml create mode 100644 recipes/opengl-registry/all/conandata.yml create mode 100644 recipes/opengl-registry/all/conanfile.py create mode 100644 recipes/opengl-registry/all/test_package/CMakeLists.txt create mode 100644 recipes/opengl-registry/all/test_package/conanfile.py create mode 100644 recipes/opengl-registry/all/test_package/test_package.c create mode 100644 recipes/opengl-registry/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengl-registry/all/test_v1_package/conanfile.py create mode 100644 recipes/opengl-registry/config.yml create mode 100644 recipes/opengl/all/conanfile.py create mode 100644 recipes/opengl/all/test_cmake_module_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_cmake_module_package/conanfile.py create mode 100644 recipes/opengl/all/test_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_package/conanfile.py create mode 100644 recipes/opengl/all/test_package/osx.mm create mode 100644 recipes/opengl/all/test_package/test_package.cpp create mode 100644 recipes/opengl/all/test_package/win.cpp create mode 100644 recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_v1_cmake_module_package/conanfile.py create mode 100644 recipes/opengl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_v1_package/conanfile.py create mode 100644 recipes/opengl/config.yml create mode 100644 recipes/opengrm/all/conandata.yml create mode 100644 recipes/opengrm/all/conanfile.py create mode 100644 recipes/opengrm/all/test_package/CMakeLists.txt create mode 100644 recipes/opengrm/all/test_package/conanfile.py create mode 100644 recipes/opengrm/all/test_package/test_package.cpp create mode 100644 recipes/opengrm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengrm/all/test_v1_package/conanfile.py create mode 100644 recipes/opengrm/config.yml create mode 100644 recipes/opengv/all/conandata.yml create mode 100644 recipes/opengv/all/conanfile.py create mode 100644 recipes/opengv/all/patches/0001-use-conans-pybind11.patch create mode 100644 recipes/opengv/all/patches/0002-use-conans-eigen.patch create mode 100644 recipes/opengv/all/patches/0003-let-conan-handle-shared-fpic-and-marchs.patch create mode 100644 recipes/opengv/all/test_package/CMakeLists.txt create mode 100644 recipes/opengv/all/test_package/conanfile.py create mode 100644 recipes/opengv/all/test_package/test_package.cpp create mode 100644 recipes/opengv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengv/all/test_v1_package/conanfile.py create mode 100644 recipes/opengv/config.yml create mode 100644 recipes/openh264/all/conandata.yml create mode 100644 recipes/openh264/all/conanfile.py create mode 100644 recipes/openh264/all/patches/1.7.0-0001-platform-android.mk.patch create mode 100644 recipes/openh264/all/patches/1.7.0-0002-macos-relocatable-shared.patch create mode 100644 recipes/openh264/all/patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch create mode 100644 recipes/openh264/all/patches/2.1.1-0001-platform-android.mk.patch create mode 100644 recipes/openh264/all/patches/2.1.1-0002-macos-relocatable-shared.patch create mode 100644 recipes/openh264/all/patches/2.3.1-0001-platform-android.mk.patch create mode 100644 recipes/openh264/all/patches/2.3.1-0002-macos-relocatable-shared.patch create mode 100644 recipes/openh264/all/test_package/CMakeLists.txt create mode 100644 recipes/openh264/all/test_package/conanfile.py create mode 100644 recipes/openh264/all/test_package/test_package.c create mode 100644 recipes/openh264/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openh264/all/test_v1_package/conanfile.py create mode 100644 recipes/openh264/config.yml create mode 100644 recipes/openimageio/all/CMakeLists.txt create mode 100644 recipes/openimageio/all/conandata.yml create mode 100644 recipes/openimageio/all/conanfile.py create mode 100644 recipes/openimageio/all/patches/2.2.18.0-cmake-targets.patch create mode 100644 recipes/openimageio/all/patches/2.2.7.0-cmake-targets.patch create mode 100644 recipes/openimageio/all/patches/2.3.7.2-cmake-targets.patch create mode 100644 recipes/openimageio/all/patches/2.4.7.1-cmake-targets.patch create mode 100644 recipes/openimageio/all/patches/2.4.7.1-fix-msvc2017.patch create mode 100644 recipes/openimageio/all/test_package/CMakeLists.txt create mode 100644 recipes/openimageio/all/test_package/conanfile.py create mode 100644 recipes/openimageio/all/test_package/test_package.cpp create mode 100644 recipes/openimageio/config.yml create mode 100644 recipes/openjdk/all/conandata.yml create mode 100644 recipes/openjdk/all/conanfile.py create mode 100644 recipes/openjdk/all/test_package/conanfile.py create mode 100644 recipes/openjdk/all/test_v1_package/conanfile.py create mode 100644 recipes/openjdk/config.yml create mode 100644 recipes/openjpeg/all/conandata.yml create mode 100644 recipes/openjpeg/all/conanfile.py create mode 100644 recipes/openjpeg/all/patches/0001-relocatable-shared-macos-2.3.1.patch create mode 100644 recipes/openjpeg/all/patches/0001-relocatable-shared-macos-2.4.0.patch create mode 100644 recipes/openjpeg/all/test_package/CMakeLists.txt create mode 100644 recipes/openjpeg/all/test_package/conanfile.py create mode 100644 recipes/openjpeg/all/test_package/test_package.c create mode 100644 recipes/openjpeg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openjpeg/all/test_v1_package/conanfile.py create mode 100644 recipes/openjpeg/config.yml create mode 100644 recipes/openldap/all/conandata.yml create mode 100644 recipes/openldap/all/conanfile.py create mode 100644 recipes/openldap/all/patches/configure-2.6.1.patch create mode 100644 recipes/openldap/all/test_package/CMakeLists.txt create mode 100644 recipes/openldap/all/test_package/conanfile.py create mode 100644 recipes/openldap/all/test_package/test_package.cpp create mode 100644 recipes/openldap/config.yml create mode 100644 recipes/openmesh/all/conandata.yml create mode 100644 recipes/openmesh/all/conanfile.py create mode 100644 recipes/openmesh/all/patches/cmake-install_8.1.patch create mode 100644 recipes/openmesh/all/patches/cmake-install_9.0.patch create mode 100644 recipes/openmesh/all/test_package/CMakeLists.txt create mode 100644 recipes/openmesh/all/test_package/conanfile.py create mode 100644 recipes/openmesh/all/test_package/test_package.cpp create mode 100644 recipes/openmesh/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openmesh/all/test_v1_package/conanfile.py create mode 100644 recipes/openmesh/config.yml create mode 100644 recipes/openmpi/all/conandata.yml create mode 100644 recipes/openmpi/all/conanfile.py create mode 100644 recipes/openmpi/all/test_package/CMakeLists.txt create mode 100644 recipes/openmpi/all/test_package/conanfile.py create mode 100644 recipes/openmpi/all/test_package/test_package.cpp create mode 100644 recipes/openmpi/config.yml create mode 100644 recipes/openmvg/all/conandata.yml create mode 100644 recipes/openmvg/all/conanfile.py create mode 100644 recipes/openmvg/all/patches/2.0-0001-robust-dependencies.patch create mode 100644 recipes/openmvg/all/patches/2.0-0002-dont-force-c++11.patch create mode 100644 recipes/openmvg/all/patches/2.0-0003-fix-non-x86.patch create mode 100644 recipes/openmvg/all/patches/2.0-0004-no-auto-simd-optimization.patch create mode 100644 recipes/openmvg/all/patches/2.0-0005-msvc-bigobj.patch create mode 100644 recipes/openmvg/all/test_package/CMakeLists.txt create mode 100644 recipes/openmvg/all/test_package/conanfile.py create mode 100644 recipes/openmvg/all/test_package/test_package.cpp create mode 100644 recipes/openmvg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openmvg/all/test_v1_package/conanfile.py create mode 100644 recipes/openmvg/config.yml create mode 100644 recipes/openscenegraph/all/CMakeLists.txt create mode 100644 recipes/openscenegraph/all/conandata.yml create mode 100644 recipes/openscenegraph/all/conanfile.py create mode 100644 recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch create mode 100644 recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch create mode 100644 recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch create mode 100644 recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch create mode 100644 recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch create mode 100644 recipes/openscenegraph/all/patches/0006-Declare-result-as-LONG-for-Mingw-build.patch create mode 100644 recipes/openscenegraph/all/test_package/CMakeLists.txt create mode 100644 recipes/openscenegraph/all/test_package/conanfile.py create mode 100644 recipes/openscenegraph/all/test_package/test_package.cpp create mode 100644 recipes/openscenegraph/config.yml create mode 100644 recipes/openssl/1.x.x/conandata.yml create mode 100644 recipes/openssl/1.x.x/conanfile.py create mode 100644 recipes/openssl/1.x.x/patches/1.0.2u-darwin-arm64.patch create mode 100644 recipes/openssl/1.x.x/patches/1.1.1-tvos-watchos.patch create mode 100644 recipes/openssl/1.x.x/test_package/CMakeLists.txt create mode 100644 recipes/openssl/1.x.x/test_package/conanfile.py create mode 100644 recipes/openssl/1.x.x/test_package/digest.c create mode 100644 recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/openssl/1.x.x/test_v1_package/conanfile.py create mode 100644 recipes/openssl/3.x.x/conandata.yml create mode 100644 recipes/openssl/3.x.x/conanfile.py create mode 100644 recipes/openssl/3.x.x/test_package/CMakeLists.txt create mode 100644 recipes/openssl/3.x.x/test_package/conanfile.py create mode 100644 recipes/openssl/3.x.x/test_package/digest.c create mode 100644 recipes/openssl/3.x.x/test_package/digest_legacy.c create mode 100644 recipes/openssl/3.x.x/test_package/test_package.c create mode 100644 recipes/openssl/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/openssl/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/openssl/3.x.x/test_v1_package/digest.c create mode 100644 recipes/openssl/3.x.x/test_v1_package/digest_legacy.c create mode 100644 recipes/openssl/config.yml create mode 100644 recipes/opensubdiv/all/conandata.yml create mode 100644 recipes/opensubdiv/all/conanfile.py create mode 100644 recipes/opensubdiv/all/patches/3.4.4-0001-cmake-minimum-required.patch create mode 100644 recipes/opensubdiv/all/patches/3.4.4-0002-cmake-no-rpath.patch create mode 100644 recipes/opensubdiv/all/test_package/CMakeLists.txt create mode 100644 recipes/opensubdiv/all/test_package/conanfile.py create mode 100644 recipes/opensubdiv/all/test_package/test_package.cpp create mode 100644 recipes/opensubdiv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opensubdiv/all/test_v1_package/conanfile.py create mode 100644 recipes/opensubdiv/config.yml create mode 100644 recipes/opentdf-client/all/CMakeLists.txt create mode 100644 recipes/opentdf-client/all/conandata.yml create mode 100644 recipes/opentdf-client/all/conanfile.py create mode 100644 recipes/opentdf-client/all/test_package/CMakeLists.txt create mode 100644 recipes/opentdf-client/all/test_package/conanfile.py create mode 100644 recipes/opentdf-client/all/test_package/test_package.cpp create mode 100644 recipes/opentdf-client/config.yml create mode 100644 recipes/opentelemetry-cpp/all/conandata.yml create mode 100644 recipes/opentelemetry-cpp/all/conanfile.py create mode 100644 recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/opentelemetry-cpp/all/test_package/conanfile.py create mode 100644 recipes/opentelemetry-cpp/all/test_package/test_package.cpp create mode 100644 recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/opentelemetry-cpp/config.yml create mode 100644 recipes/opentelemetry-proto/all/conandata.yml create mode 100644 recipes/opentelemetry-proto/all/conanfile.py create mode 100644 recipes/opentelemetry-proto/all/test_package/conanfile.py create mode 100644 recipes/opentelemetry-proto/config.yml create mode 100644 recipes/opentracing-cpp/all/CMakeLists.txt create mode 100644 recipes/opentracing-cpp/all/conandata.yml create mode 100644 recipes/opentracing-cpp/all/conanfile.py create mode 100644 recipes/opentracing-cpp/all/patches/0001-Set-default-installation-folders.patch create mode 100644 recipes/opentracing-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/opentracing-cpp/all/test_package/conanfile.py create mode 100644 recipes/opentracing-cpp/all/test_package/test_package.cpp create mode 100644 recipes/opentracing-cpp/config.yml create mode 100644 recipes/openvdb/all/CMakeLists.txt create mode 100644 recipes/openvdb/all/conandata.yml create mode 100644 recipes/openvdb/all/conanfile.py create mode 100644 recipes/openvdb/all/patches/0001-Find-packages-fixes.patch create mode 100644 recipes/openvdb/all/test_package/CMakeLists.txt create mode 100644 recipes/openvdb/all/test_package/conanfile.py create mode 100644 recipes/openvdb/all/test_package/test_package.cpp create mode 100644 recipes/openvdb/config.yml create mode 100644 recipes/openvr/all/CMakeLists.txt create mode 100644 recipes/openvr/all/conandata.yml create mode 100644 recipes/openvr/all/conanfile.py create mode 100644 recipes/openvr/all/patches/fix-includes-and-assert-1.16.8.patch create mode 100644 recipes/openvr/all/test_package/CMakeLists.txt create mode 100644 recipes/openvr/all/test_package/conanfile.py create mode 100644 recipes/openvr/all/test_package/test_package.cpp create mode 100644 recipes/openvr/config.yml create mode 100644 recipes/openxlsx/all/conandata.yml create mode 100644 recipes/openxlsx/all/conanfile.py create mode 100644 recipes/openxlsx/all/test_package/CMakeLists.txt create mode 100644 recipes/openxlsx/all/test_package/conanfile.py create mode 100644 recipes/openxlsx/all/test_package/test_package.cpp create mode 100644 recipes/openxlsx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openxlsx/all/test_v1_package/conanfile.py create mode 100644 recipes/openxlsx/config.yml create mode 100644 recipes/optional-lite/all/conandata.yml create mode 100644 recipes/optional-lite/all/conanfile.py create mode 100644 recipes/optional-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/optional-lite/all/test_package/conanfile.py create mode 100644 recipes/optional-lite/all/test_package/test_package.cpp create mode 100644 recipes/optional-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/optional-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/optional-lite/config.yml create mode 100644 recipes/opus/all/conandata.yml create mode 100644 recipes/opus/all/conanfile.py create mode 100644 recipes/opus/all/patches/1.3.1-add-opus_buildtype-cmake.patch create mode 100644 recipes/opus/all/test_package/CMakeLists.txt create mode 100644 recipes/opus/all/test_package/conanfile.py create mode 100644 recipes/opus/all/test_package/test.pcm create mode 100644 recipes/opus/all/test_package/test_package.c create mode 100644 recipes/opus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opus/all/test_v1_package/conanfile.py create mode 100644 recipes/opus/config.yml create mode 100644 recipes/opusfile/all/conandata.yml create mode 100644 recipes/opusfile/all/conanfile.py create mode 100644 recipes/opusfile/all/patches/001-disable-cert-store-integration.patch create mode 100644 recipes/opusfile/all/test_package/CMakeLists.txt create mode 100644 recipes/opusfile/all/test_package/conanfile.py create mode 100644 recipes/opusfile/all/test_package/test_package.c create mode 100644 recipes/opusfile/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opusfile/all/test_v1_package/conanfile.py create mode 100644 recipes/opusfile/config.yml create mode 100644 recipes/orcania/all/conandata.yml create mode 100644 recipes/orcania/all/conanfile.py create mode 100644 recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch create mode 100644 recipes/orcania/all/patches/2.3.1-0002-no-m.patch create mode 100644 recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch create mode 100644 recipes/orcania/all/test_package/CMakeLists.txt create mode 100644 recipes/orcania/all/test_package/conanfile.py create mode 100644 recipes/orcania/all/test_package/test_package.c create mode 100644 recipes/orcania/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/orcania/all/test_v1_package/conanfile.py create mode 100644 recipes/orcania/config.yml create mode 100644 recipes/osgearth/all/CMakeLists.txt create mode 100644 recipes/osgearth/all/conandata.yml create mode 100644 recipes/osgearth/all/conanfile.py create mode 100644 recipes/osgearth/all/patches/3.2-osgearth.patch create mode 100644 recipes/osgearth/all/patches/3.3-osgearth.patch create mode 100644 recipes/osgearth/all/test_package/CMakeLists.txt create mode 100644 recipes/osgearth/all/test_package/conanfile.py create mode 100644 recipes/osgearth/all/test_package/test_package.cpp create mode 100644 recipes/osgearth/config.yml create mode 100644 recipes/osmanip/all/CMakeLists.txt create mode 100644 recipes/osmanip/all/conandata.yml create mode 100644 recipes/osmanip/all/conanfile.py create mode 100644 recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch create mode 100644 recipes/osmanip/all/test_package/CMakeLists.txt create mode 100644 recipes/osmanip/all/test_package/conanfile.py create mode 100644 recipes/osmanip/all/test_package/test_package.cpp create mode 100644 recipes/osmanip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/osmanip/all/test_v1_package/conanfile.py create mode 100644 recipes/osmanip/config.yml create mode 100644 recipes/osqp/all/conandata.yml create mode 100644 recipes/osqp/all/conanfile.py create mode 100644 recipes/osqp/all/test_package/CMakeLists.txt create mode 100644 recipes/osqp/all/test_package/conanfile.py create mode 100644 recipes/osqp/all/test_package/test_package.cpp create mode 100644 recipes/osqp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/osqp/all/test_v1_package/conanfile.py create mode 100644 recipes/osqp/config.yml create mode 100644 recipes/out_ptr/all/conandata.yml create mode 100644 recipes/out_ptr/all/conanfile.py create mode 100644 recipes/out_ptr/all/test_package/CMakeLists.txt create mode 100644 recipes/out_ptr/all/test_package/conanfile.py create mode 100644 recipes/out_ptr/all/test_package/test_package.cpp create mode 100644 recipes/out_ptr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/out_ptr/all/test_v1_package/conanfile.py create mode 100644 recipes/out_ptr/config.yml create mode 100644 recipes/outcome/all/conandata.yml create mode 100644 recipes/outcome/all/conanfile.py create mode 100644 recipes/outcome/all/test_package/CMakeLists.txt create mode 100644 recipes/outcome/all/test_package/conanfile.py create mode 100644 recipes/outcome/all/test_package/test_package.cpp create mode 100644 recipes/outcome/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/outcome/all/test_v1_package/conanfile.py create mode 100644 recipes/outcome/config.yml create mode 100644 recipes/ozz-animation/all/CMakeLists.txt create mode 100644 recipes/ozz-animation/all/conandata.yml create mode 100644 recipes/ozz-animation/all/conanfile.py create mode 100644 recipes/ozz-animation/all/test_package/CMakeLists.txt create mode 100644 recipes/ozz-animation/all/test_package/conanfile.py create mode 100644 recipes/ozz-animation/all/test_package/test_package.cpp create mode 100644 recipes/ozz-animation/config.yml create mode 100644 recipes/p-ranav-glob/all/conandata.yml create mode 100644 recipes/p-ranav-glob/all/conanfile.py create mode 100644 recipes/p-ranav-glob/all/test_package/CMakeLists.txt create mode 100644 recipes/p-ranav-glob/all/test_package/conanfile.py create mode 100644 recipes/p-ranav-glob/all/test_package/test_package.cpp create mode 100644 recipes/p-ranav-glob/config.yml create mode 100644 recipes/p7zip/all/conandata.yml create mode 100644 recipes/p7zip/all/conanfile.py create mode 100644 recipes/p7zip/all/patches/06-CVE-2018-5996.patch create mode 100644 recipes/p7zip/all/patches/12-CVE-2016-9296.patch create mode 100644 recipes/p7zip/all/patches/13-CVE-2017-17969.patch create mode 100644 recipes/p7zip/all/patches/14-Fix-g++-warning.patch create mode 100644 recipes/p7zip/all/patches/CVE-2018-10115.patch create mode 100644 recipes/p7zip/all/patches/clang.diff create mode 100644 recipes/p7zip/all/test_package/conanfile.py create mode 100644 recipes/p7zip/all/test_v1_package/conanfile.py create mode 100644 recipes/p7zip/config.yml create mode 100644 recipes/packio/all/conandata.yml create mode 100644 recipes/packio/all/conanfile.py create mode 100644 recipes/packio/all/test_package/1.0.x-1.1.x.cpp create mode 100644 recipes/packio/all/test_package/1.2.x.cpp create mode 100644 recipes/packio/all/test_package/CMakeLists.txt create mode 100644 recipes/packio/all/test_package/conanfile.py create mode 100644 recipes/packio/all/test_package/latest.cpp create mode 100644 recipes/packio/config.yml create mode 100644 recipes/pagmo2/all/CMakeLists.txt create mode 100644 recipes/pagmo2/all/conandata.yml create mode 100644 recipes/pagmo2/all/conanfile.py create mode 100644 recipes/pagmo2/all/test_package/CMakeLists.txt create mode 100644 recipes/pagmo2/all/test_package/conanfile.py create mode 100644 recipes/pagmo2/all/test_package/test_package.cpp create mode 100644 recipes/pagmo2/config.yml create mode 100644 recipes/pagmo2/pre_2.11/CMakeLists.txt create mode 100644 recipes/pagmo2/pre_2.11/conandata.yml create mode 100644 recipes/pagmo2/pre_2.11/conanfile.py create mode 100644 recipes/pagmo2/pre_2.11/patches/0001-fix-cmake-module-path-2-10.patch create mode 100644 recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt create mode 100644 recipes/pagmo2/pre_2.11/test_package/conanfile.py create mode 100644 recipes/pagmo2/pre_2.11/test_package/test_package.cpp create mode 100644 recipes/paho-mqtt-c/all/conandata.yml create mode 100644 recipes/paho-mqtt-c/all/conanfile.py create mode 100644 recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch create mode 100644 recipes/paho-mqtt-c/all/patches/0003-allow-static-windows-runtimes.patch create mode 100644 recipes/paho-mqtt-c/all/test_package/CMakeLists.txt create mode 100644 recipes/paho-mqtt-c/all/test_package/conanfile.py create mode 100644 recipes/paho-mqtt-c/all/test_package/test_package_async.c create mode 100644 recipes/paho-mqtt-c/all/test_package/test_package_client.c create mode 100644 recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/paho-mqtt-c/all/test_v1_package/conanfile.py create mode 100644 recipes/paho-mqtt-c/config.yml create mode 100644 recipes/paho-mqtt-cpp/all/conandata.yml create mode 100644 recipes/paho-mqtt-cpp/all/conanfile.py create mode 100644 recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch create mode 100644 recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch create mode 100644 recipes/paho-mqtt-cpp/all/patches/1.2.0-0001-fix-cmake.patch create mode 100644 recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/paho-mqtt-cpp/all/test_package/conanfile.py create mode 100644 recipes/paho-mqtt-cpp/all/test_package/test_package.cpp create mode 100644 recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/paho-mqtt-cpp/config.yml create mode 100644 recipes/pango/all/conandata.yml create mode 100644 recipes/pango/all/conanfile.py create mode 100644 recipes/pango/all/test_package/CMakeLists.txt create mode 100644 recipes/pango/all/test_package/conanfile.py create mode 100644 recipes/pango/all/test_package/test_package.cpp create mode 100644 recipes/pango/config.yml create mode 100644 recipes/pangomm/all/conandata.yml create mode 100644 recipes/pangomm/all/conanfile.py create mode 100644 recipes/pangomm/all/patches/enable_static_libs_2_46_2.patch create mode 100644 recipes/pangomm/all/patches/enable_static_libs_2_50_0.patch create mode 100644 recipes/pangomm/all/patches/fix_exporting_pango_init.patch create mode 100644 recipes/pangomm/all/test_package/CMakeLists.txt create mode 100644 recipes/pangomm/all/test_package/conanfile.py create mode 100644 recipes/pangomm/all/test_package/test_package.cpp create mode 100644 recipes/pangomm/config.yml create mode 100644 recipes/panzi-portable-endian/all/conandata.yml create mode 100644 recipes/panzi-portable-endian/all/conanfile.py create mode 100644 recipes/panzi-portable-endian/all/test_package/CMakeLists.txt create mode 100644 recipes/panzi-portable-endian/all/test_package/conanfile.py create mode 100644 recipes/panzi-portable-endian/all/test_package/test_package.cpp create mode 100644 recipes/panzi-portable-endian/config.yml create mode 100644 recipes/parallel-hashmap/all/conandata.yml create mode 100644 recipes/parallel-hashmap/all/conanfile.py create mode 100644 recipes/parallel-hashmap/all/test_package/CMakeLists.txt create mode 100644 recipes/parallel-hashmap/all/test_package/conanfile.py create mode 100644 recipes/parallel-hashmap/all/test_package/test_package.cpp create mode 100644 recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/parallel-hashmap/all/test_v1_package/conanfile.py create mode 100644 recipes/parallel-hashmap/config.yml create mode 100644 recipes/parg/all/CMakeLists.txt create mode 100644 recipes/parg/all/conandata.yml create mode 100644 recipes/parg/all/conanfile.py create mode 100644 recipes/parg/all/test_package/CMakeLists.txt create mode 100644 recipes/parg/all/test_package/conanfile.py create mode 100644 recipes/parg/all/test_package/test_package.c create mode 100644 recipes/parg/config.yml create mode 100644 recipes/parson/all/conandata.yml create mode 100644 recipes/parson/all/conanfile.py create mode 100644 recipes/parson/all/test_package/CMakeLists.txt create mode 100644 recipes/parson/all/test_package/conanfile.py create mode 100644 recipes/parson/all/test_package/test_package.c create mode 100644 recipes/parson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/parson/all/test_v1_package/conanfile.py create mode 100644 recipes/parson/config.yml create mode 100644 recipes/patchelf/all/conandata.yml create mode 100644 recipes/patchelf/all/conanfile.py create mode 100644 recipes/patchelf/all/test_package/conanfile.py create mode 100644 recipes/patchelf/all/test_v1_package/conanfile.py create mode 100644 recipes/patchelf/config.yml create mode 100644 recipes/pbc/all/conandata.yml create mode 100644 recipes/pbc/all/conanfile.py create mode 100644 recipes/pbc/all/patches/0.5.14-0001-fix-config-sub-ios.patch create mode 100644 recipes/pbc/all/test_package/CMakeLists.txt create mode 100644 recipes/pbc/all/test_package/conanfile.py create mode 100644 recipes/pbc/all/test_package/test_package.c create mode 100644 recipes/pbc/config.yml create mode 100644 recipes/pbtools/all/CMakeLists.txt create mode 100644 recipes/pbtools/all/conandata.yml create mode 100644 recipes/pbtools/all/conanfile.py create mode 100644 recipes/pbtools/all/test_package/CMakeLists.txt create mode 100644 recipes/pbtools/all/test_package/conanfile.py create mode 100644 recipes/pbtools/all/test_package/hello_world.c create mode 100644 recipes/pbtools/all/test_package/hello_world.h create mode 100644 recipes/pbtools/all/test_package/test_package.c create mode 100644 recipes/pbtools/config.yml create mode 100644 recipes/pcapplusplus/all/conandata.yml create mode 100644 recipes/pcapplusplus/all/conanfile.py create mode 100644 recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch create mode 100644 recipes/pcapplusplus/all/patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch create mode 100644 recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch create mode 100644 recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch create mode 100644 recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch create mode 100644 recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch create mode 100644 recipes/pcapplusplus/all/test_package/CMakeLists.txt create mode 100644 recipes/pcapplusplus/all/test_package/conanfile.py create mode 100644 recipes/pcapplusplus/all/test_package/test_package.cpp create mode 100644 recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pcapplusplus/all/test_v1_package/conanfile.py create mode 100644 recipes/pcapplusplus/config.yml create mode 100644 recipes/pcg-cpp/all/conandata.yml create mode 100644 recipes/pcg-cpp/all/conanfile.py create mode 100644 recipes/pcg-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/pcg-cpp/all/test_package/conanfile.py create mode 100644 recipes/pcg-cpp/all/test_package/test_package.cpp create mode 100644 recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pcg-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/pcg-cpp/config.yml create mode 100644 recipes/pciutils/all/conandata.yml create mode 100644 recipes/pciutils/all/conanfile.py create mode 100644 recipes/pciutils/all/test_package/CMakeLists.txt create mode 100644 recipes/pciutils/all/test_package/conanfile.py create mode 100644 recipes/pciutils/all/test_package/example.c create mode 100644 recipes/pciutils/config.yml create mode 100644 recipes/pcre/all/conandata.yml create mode 100644 recipes/pcre/all/conanfile.py create mode 100644 recipes/pcre/all/patches/0001-fix-cmake-8.41.patch create mode 100644 recipes/pcre/all/patches/0001-fix-cmake-8.45.patch create mode 100644 recipes/pcre/all/test_package/CMakeLists.txt create mode 100644 recipes/pcre/all/test_package/conanfile.py create mode 100644 recipes/pcre/all/test_package/test_package.c create mode 100644 recipes/pcre/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pcre/all/test_v1_package/conanfile.py create mode 100644 recipes/pcre/config.yml create mode 100644 recipes/pcre2/all/conandata.yml create mode 100644 recipes/pcre2/all/conanfile.py create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch create mode 100644 recipes/pcre2/all/test_package/CMakeLists.txt create mode 100644 recipes/pcre2/all/test_package/conanfile.py create mode 100644 recipes/pcre2/all/test_package/test_package.c create mode 100644 recipes/pcre2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pcre2/all/test_v1_package/conanfile.py create mode 100644 recipes/pcre2/config.yml create mode 100644 recipes/pdal/all/CMakeLists.txt create mode 100644 recipes/pdal/all/conandata.yml create mode 100644 recipes/pdal/all/conanfile.py create mode 100644 recipes/pdal/all/patches/0001-cmakelists.patch create mode 100644 recipes/pdal/all/patches/0002-cmake-deps-2.2.0.patch create mode 100644 recipes/pdal/all/patches/0002-cmake-deps-2.3.0.patch create mode 100644 recipes/pdal/all/patches/0003-stdexcept.patch create mode 100644 recipes/pdal/all/patches/0004-cstdlib.patch create mode 100644 recipes/pdal/all/patches/0005-vendor-nanoflann.patch create mode 100644 recipes/pdal/all/patches/0006-pointview.patch create mode 100644 recipes/pdal/all/test_package/CMakeLists.txt create mode 100644 recipes/pdal/all/test_package/conanfile.py create mode 100644 recipes/pdal/all/test_package/test_package.cpp create mode 100644 recipes/pdal/config.yml create mode 100644 recipes/pdcurses/all/CMakeLists.txt create mode 100644 recipes/pdcurses/all/conandata.yml create mode 100644 recipes/pdcurses/all/conanfile.py create mode 100644 recipes/pdcurses/all/test_package/CMakeLists.txt create mode 100644 recipes/pdcurses/all/test_package/conanfile.py create mode 100644 recipes/pdcurses/all/test_package/test_package.c create mode 100644 recipes/pdcurses/config.yml create mode 100644 recipes/pdfgen/all/CMakeLists.txt create mode 100644 recipes/pdfgen/all/conandata.yml create mode 100644 recipes/pdfgen/all/conanfile.py create mode 100644 recipes/pdfgen/all/test_package/CMakeLists.txt create mode 100644 recipes/pdfgen/all/test_package/conanfile.py create mode 100644 recipes/pdfgen/all/test_package/test_package.c create mode 100644 recipes/pdfgen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pdfgen/all/test_v1_package/conanfile.py create mode 100644 recipes/pdfgen/config.yml create mode 100644 recipes/pdfium/all/CMakeLists.txt create mode 100644 recipes/pdfium/all/conandata.yml create mode 100644 recipes/pdfium/all/conanfile.py create mode 100644 recipes/pdfium/all/test_package/CMakeLists.txt create mode 100644 recipes/pdfium/all/test_package/conanfile.py create mode 100644 recipes/pdfium/all/test_package/test_package.c create mode 100644 recipes/pdfium/config.yml create mode 100644 recipes/pdqsort/all/conandata.yml create mode 100644 recipes/pdqsort/all/conanfile.py create mode 100644 recipes/pdqsort/all/test_package/CMakeLists.txt create mode 100644 recipes/pdqsort/all/test_package/conanfile.py create mode 100644 recipes/pdqsort/all/test_package/test_package.cpp create mode 100644 recipes/pdqsort/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pdqsort/all/test_v1_package/conanfile.py create mode 100644 recipes/pdqsort/config.yml create mode 100644 recipes/perf/all/conandata.yml create mode 100644 recipes/perf/all/conanfile.py create mode 100644 recipes/perf/all/patches/0001-Wno-strict-prototypes.patch create mode 100644 recipes/perf/all/test_package/conanfile.py create mode 100644 recipes/perf/config.yml create mode 100644 recipes/perfetto/all/CMakeLists.txt create mode 100644 recipes/perfetto/all/conandata.yml create mode 100644 recipes/perfetto/all/conanfile.py create mode 100644 recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch create mode 100644 recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch create mode 100644 recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch create mode 100644 recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch create mode 100644 recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch create mode 100644 recipes/perfetto/all/test_package/CMakeLists.txt create mode 100644 recipes/perfetto/all/test_package/conanfile.py create mode 100644 recipes/perfetto/all/test_package/test_package.cpp create mode 100644 recipes/perfetto/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/perfetto/all/test_v1_package/conanfile.py create mode 100644 recipes/perfetto/config.yml create mode 100644 recipes/perlinnoise/all/conandata.yml create mode 100644 recipes/perlinnoise/all/conanfile.py create mode 100644 recipes/perlinnoise/all/test_package/CMakeLists.txt create mode 100644 recipes/perlinnoise/all/test_package/conanfile.py create mode 100644 recipes/perlinnoise/all/test_package/test_package.cpp create mode 100644 recipes/perlinnoise/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/perlinnoise/all/test_v1_package/conanfile.py create mode 100644 recipes/perlinnoise/config.yml create mode 100644 recipes/pexports/all/conandata.yml create mode 100644 recipes/pexports/all/conanfile.py create mode 100644 recipes/pexports/all/patches/0001-add-help.patch create mode 100644 recipes/pexports/all/patches/0002-fix-MSVC-stack-overflow.patch create mode 100644 recipes/pexports/all/patches/0003-fix-MSVC-x86.patch create mode 100644 recipes/pexports/all/test_package/CMakeLists.txt create mode 100644 recipes/pexports/all/test_package/conanfile.py create mode 100644 recipes/pexports/all/test_package/test_library.c create mode 100644 recipes/pexports/all/test_package/test_package.c create mode 100644 recipes/pexports/config.yml create mode 100644 recipes/pffft/all/CMakeLists.txt create mode 100644 recipes/pffft/all/conandata.yml create mode 100644 recipes/pffft/all/conanfile.py create mode 100644 recipes/pffft/all/test_package/CMakeLists.txt create mode 100644 recipes/pffft/all/test_package/conanfile.py create mode 100644 recipes/pffft/all/test_package/test_package.c create mode 100644 recipes/pffft/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pffft/all/test_v1_package/conanfile.py create mode 100644 recipes/pffft/config.yml create mode 100644 recipes/pfr/all/conandata.yml create mode 100644 recipes/pfr/all/conanfile.py create mode 100644 recipes/pfr/all/patches/50_add_license.patch create mode 100644 recipes/pfr/all/test_package/CMakeLists.txt create mode 100644 recipes/pfr/all/test_package/conanfile.py create mode 100644 recipes/pfr/all/test_package/test_package_1.cpp create mode 100644 recipes/pfr/all/test_package/test_package_2.cpp create mode 100644 recipes/pfr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pfr/all/test_v1_package/conanfile.py create mode 100644 recipes/pfr/config.yml create mode 100644 recipes/pgm-index/all/conandata.yml create mode 100644 recipes/pgm-index/all/conanfile.py create mode 100644 recipes/pgm-index/all/test_package/CMakeLists.txt create mode 100644 recipes/pgm-index/all/test_package/conanfile.py create mode 100644 recipes/pgm-index/all/test_package/test_package.cpp create mode 100644 recipes/pgm-index/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pgm-index/all/test_v1_package/conanfile.py create mode 100644 recipes/pgm-index/config.yml create mode 100644 recipes/physfs/all/conandata.yml create mode 100644 recipes/physfs/all/conanfile.py create mode 100644 recipes/physfs/all/patches/0001-fix-export-import-symbols.patch create mode 100644 recipes/physfs/all/patches/0002-cmake-doc-option.patch create mode 100644 recipes/physfs/all/test_package/CMakeLists.txt create mode 100644 recipes/physfs/all/test_package/conanfile.py create mode 100644 recipes/physfs/all/test_package/test_package.c create mode 100644 recipes/physfs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/physfs/all/test_v1_package/conanfile.py create mode 100644 recipes/physfs/config.yml create mode 100644 recipes/physx/4.x.x/conandata.yml create mode 100644 recipes/physx/4.x.x/conanfile.py create mode 100644 recipes/physx/4.x.x/patches/0001-PsAllocator-include-typeinfo.patch create mode 100644 recipes/physx/4.x.x/patches/0002-GuGJKType-const-discard-qualifiers.patch create mode 100644 recipes/physx/4.x.x/patches/0003-PsWindowsInlineAoS-msvc142-bug-workaround.patch create mode 100644 recipes/physx/4.x.x/patches/0004-Conan-PhysXGpu-name-workaround.patch create mode 100644 recipes/physx/4.x.x/patches/0005-CMake-macos-ios-android-install-targets.patch create mode 100644 recipes/physx/4.x.x/test_package/CMakeLists.txt create mode 100644 recipes/physx/4.x.x/test_package/conanfile.py create mode 100644 recipes/physx/4.x.x/test_package/test_library.cpp create mode 100644 recipes/physx/4.x.x/test_package/test_package.cpp create mode 100644 recipes/physx/4.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/physx/4.x.x/test_v1_package/conanfile.py create mode 100644 recipes/physx/4.x.x/test_v1_package/test_library.cpp create mode 100644 recipes/physx/4.x.x/test_v1_package/test_package.cpp create mode 100644 recipes/physx/config.yml create mode 100644 recipes/picobench/all/conandata.yml create mode 100644 recipes/picobench/all/conanfile.py create mode 100644 recipes/picobench/all/patches/2.01-0001-add-install.patch create mode 100644 recipes/picobench/all/patches/2.02-0001-add-install.patch create mode 100644 recipes/picobench/all/test_package/CMakeLists.txt create mode 100644 recipes/picobench/all/test_package/conanfile.py create mode 100644 recipes/picobench/all/test_package/test_package.cpp create mode 100644 recipes/picobench/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/picobench/all/test_v1_package/conanfile.py create mode 100644 recipes/picobench/config.yml create mode 100644 recipes/picojson/all/conandata.yml create mode 100644 recipes/picojson/all/conanfile.py create mode 100644 recipes/picojson/all/test_package/CMakeLists.txt create mode 100644 recipes/picojson/all/test_package/conanfile.py create mode 100644 recipes/picojson/all/test_package/test_package.cpp create mode 100644 recipes/picojson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/picojson/all/test_v1_package/conanfile.py create mode 100644 recipes/picojson/config.yml create mode 100644 recipes/picosha2/all/conandata.yml create mode 100644 recipes/picosha2/all/conanfile.py create mode 100644 recipes/picosha2/all/test_package/CMakeLists.txt create mode 100644 recipes/picosha2/all/test_package/conanfile.py create mode 100644 recipes/picosha2/all/test_package/test_package.cpp create mode 100644 recipes/picosha2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/picosha2/all/test_v1_package/conanfile.py create mode 100644 recipes/picosha2/config.yml create mode 100644 recipes/pipes/all/conandata.yml create mode 100644 recipes/pipes/all/conanfile.py create mode 100644 recipes/pipes/all/test_package/CMakeLists.txt create mode 100644 recipes/pipes/all/test_package/conanfile.py create mode 100644 recipes/pipes/all/test_package/test_package.cpp create mode 100644 recipes/pipes/config.yml create mode 100644 recipes/pistache/all/conandata.yml create mode 100644 recipes/pistache/all/conanfile.py create mode 100644 recipes/pistache/all/patches/0001-remove-fpic.patch create mode 100644 recipes/pistache/all/patches/0002-include-stddef.patch create mode 100644 recipes/pistache/all/test_package/CMakeLists.txt create mode 100644 recipes/pistache/all/test_package/conanfile.py create mode 100644 recipes/pistache/all/test_package/test_package.cpp create mode 100644 recipes/pistache/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pistache/all/test_v1_package/conanfile.py create mode 100644 recipes/pistache/config.yml create mode 100644 recipes/pixman/all/conandata.yml create mode 100644 recipes/pixman/all/conanfile.py create mode 100644 recipes/pixman/all/patches/0001-incompatible-pointer-types.patch create mode 100644 recipes/pixman/all/patches/0002-meson-build.patch create mode 100644 recipes/pixman/all/test_package/CMakeLists.txt create mode 100644 recipes/pixman/all/test_package/conanfile.py create mode 100644 recipes/pixman/all/test_package/test_package.c create mode 100644 recipes/pixman/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pixman/all/test_v1_package/conanfile.py create mode 100644 recipes/pixman/config.yml create mode 100644 recipes/pkgconf/all/conandata.yml create mode 100644 recipes/pkgconf/all/conanfile.py create mode 100644 recipes/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch create mode 100644 recipes/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch create mode 100644 recipes/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch create mode 100644 recipes/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch create mode 100644 recipes/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch create mode 100644 recipes/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch create mode 100644 recipes/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch create mode 100644 recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch create mode 100644 recipes/pkgconf/all/test_package/conanfile.py create mode 100644 recipes/pkgconf/all/test_package/src/CMakeLists.txt create mode 100644 recipes/pkgconf/all/test_package/src/configure.ac create mode 100644 recipes/pkgconf/all/test_package/src/libexample1.pc create mode 100644 recipes/pkgconf/all/test_package/src/test_package.c create mode 100644 recipes/pkgconf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pkgconf/all/test_v1_package/conanfile.py create mode 100644 recipes/pkgconf/all/test_v1_package/configure.ac create mode 100644 recipes/pkgconf/all/test_v1_package/libexample1.pc create mode 100644 recipes/pkgconf/all/test_v1_package/test_package.c create mode 100644 recipes/pkgconf/config.yml create mode 100644 recipes/platform.converters/all/conandata.yml create mode 100644 recipes/platform.converters/all/conanfile.py create mode 100644 recipes/platform.converters/all/test_package/CMakeLists.txt create mode 100644 recipes/platform.converters/all/test_package/conanfile.py create mode 100644 recipes/platform.converters/all/test_package/test_package.cpp create mode 100644 recipes/platform.converters/config.yml create mode 100644 recipes/platform.delegates/all/conandata.yml create mode 100644 recipes/platform.delegates/all/conanfile.py create mode 100644 recipes/platform.delegates/all/test_package/CMakeLists.txt create mode 100644 recipes/platform.delegates/all/test_package/conanfile.py create mode 100644 recipes/platform.delegates/all/test_package/test_package.cpp create mode 100644 recipes/platform.delegates/config.yml create mode 100644 recipes/platform.equality/all/conandata.yml create mode 100644 recipes/platform.equality/all/conanfile.py create mode 100644 recipes/platform.equality/all/test_package/CMakeLists.txt create mode 100644 recipes/platform.equality/all/test_package/conanfile.py create mode 100644 recipes/platform.equality/all/test_package/test_package.cpp create mode 100644 recipes/platform.equality/config.yml create mode 100644 recipes/platform.exceptions/all/conandata.yml create mode 100644 recipes/platform.exceptions/all/conanfile.py create mode 100644 recipes/platform.exceptions/all/test_package/CMakeLists.txt create mode 100644 recipes/platform.exceptions/all/test_package/conanfile.py create mode 100644 recipes/platform.exceptions/all/test_package/test_package.cpp create mode 100644 recipes/platform.exceptions/config.yml create mode 100644 recipes/platform.hashing/all/conandata.yml create mode 100644 recipes/platform.hashing/all/conanfile.py create mode 100644 recipes/platform.hashing/all/test_package/CMakeLists.txt create mode 100644 recipes/platform.hashing/all/test_package/conanfile.py create mode 100644 recipes/platform.hashing/all/test_package/test_package.cpp create mode 100644 recipes/platform.hashing/config.yml create mode 100644 recipes/platform.interfaces/all/conandata.yml create mode 100644 recipes/platform.interfaces/all/conanfile.py create mode 100644 recipes/platform.interfaces/all/test_package/CMakeLists.txt create mode 100644 recipes/platform.interfaces/all/test_package/conanfile.py create mode 100644 recipes/platform.interfaces/all/test_package/test_package.cpp create mode 100644 recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/platform.interfaces/all/test_v1_package/conanfile.py create mode 100644 recipes/platform.interfaces/config.yml create mode 100644 recipes/playrho/all/CMakeLists.txt create mode 100644 recipes/playrho/all/conandata.yml create mode 100644 recipes/playrho/all/conanfile.py create mode 100644 recipes/playrho/all/patches/1.1.0-0001-fix-target-name.patch create mode 100644 recipes/playrho/all/test_package/CMakeLists.txt create mode 100644 recipes/playrho/all/test_package/conanfile.py create mode 100644 recipes/playrho/all/test_package/test_package.cpp create mode 100644 recipes/playrho/config.yml create mode 100644 recipes/plf_colony/all/conandata.yml create mode 100644 recipes/plf_colony/all/conanfile.py create mode 100644 recipes/plf_colony/all/patches/7.00-0001-disable-cxx20-from-apple-clang14.patch create mode 100644 recipes/plf_colony/all/patches/7.06-0001-disable-cxx20-from-apple-clang14.patch create mode 100644 recipes/plf_colony/all/test_package/CMakeLists.txt create mode 100644 recipes/plf_colony/all/test_package/conanfile.py create mode 100644 recipes/plf_colony/all/test_package/test_package.cpp create mode 100644 recipes/plf_colony/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plf_colony/all/test_v1_package/conanfile.py create mode 100644 recipes/plf_colony/config.yml create mode 100644 recipes/plf_indiesort/all/conandata.yml create mode 100644 recipes/plf_indiesort/all/conanfile.py create mode 100644 recipes/plf_indiesort/all/test_package/CMakeLists.txt create mode 100644 recipes/plf_indiesort/all/test_package/conanfile.py create mode 100644 recipes/plf_indiesort/all/test_package/test_package.cpp create mode 100644 recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plf_indiesort/all/test_v1_package/conanfile.py create mode 100644 recipes/plf_indiesort/config.yml create mode 100644 recipes/plf_list/all/conandata.yml create mode 100644 recipes/plf_list/all/conanfile.py create mode 100644 recipes/plf_list/all/patches/2.50-0001-disable-cxx20-from-apple-clang14.patch create mode 100644 recipes/plf_list/all/patches/2.57-0001-disable-cxx20-from-apple-clang14.patch create mode 100644 recipes/plf_list/all/test_package/CMakeLists.txt create mode 100644 recipes/plf_list/all/test_package/conanfile.py create mode 100644 recipes/plf_list/all/test_package/test_package.cpp create mode 100644 recipes/plf_list/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plf_list/all/test_v1_package/conanfile.py create mode 100644 recipes/plf_list/config.yml create mode 100644 recipes/plf_nanotimer/all/conandata.yml create mode 100644 recipes/plf_nanotimer/all/conanfile.py create mode 100644 recipes/plf_nanotimer/all/test_package/CMakeLists.txt create mode 100644 recipes/plf_nanotimer/all/test_package/conanfile.py create mode 100644 recipes/plf_nanotimer/all/test_package/test_package.cpp create mode 100644 recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plf_nanotimer/all/test_v1_package/conanfile.py create mode 100644 recipes/plf_nanotimer/config.yml create mode 100644 recipes/plf_queue/all/conandata.yml create mode 100644 recipes/plf_queue/all/conanfile.py create mode 100644 recipes/plf_queue/all/test_package/CMakeLists.txt create mode 100644 recipes/plf_queue/all/test_package/conanfile.py create mode 100644 recipes/plf_queue/all/test_package/test_package.cpp create mode 100644 recipes/plf_queue/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plf_queue/all/test_v1_package/conanfile.py create mode 100644 recipes/plf_queue/config.yml create mode 100644 recipes/plf_stack/all/conandata.yml create mode 100644 recipes/plf_stack/all/conanfile.py create mode 100644 recipes/plf_stack/all/test_package/CMakeLists.txt create mode 100644 recipes/plf_stack/all/test_package/conanfile.py create mode 100644 recipes/plf_stack/all/test_package/test_package.cpp create mode 100644 recipes/plf_stack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plf_stack/all/test_v1_package/conanfile.py create mode 100644 recipes/plf_stack/config.yml create mode 100644 recipes/plog/all/conandata.yml create mode 100644 recipes/plog/all/conanfile.py create mode 100644 recipes/plog/all/test_package/CMakeLists.txt create mode 100644 recipes/plog/all/test_package/conanfile.py create mode 100644 recipes/plog/all/test_package/test_package.cpp create mode 100644 recipes/plog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plog/all/test_v1_package/conanfile.py create mode 100644 recipes/plog/config.yml create mode 100644 recipes/plusaes/all/conandata.yml create mode 100644 recipes/plusaes/all/conanfile.py create mode 100644 recipes/plusaes/all/test_package/CMakeLists.txt create mode 100644 recipes/plusaes/all/test_package/conanfile.py create mode 100644 recipes/plusaes/all/test_package/test_package.cpp create mode 100644 recipes/plusaes/config.yml create mode 100644 recipes/plutovg/all/conandata.yml create mode 100644 recipes/plutovg/all/conanfile.py create mode 100644 recipes/plutovg/all/test_package/CMakeLists.txt create mode 100644 recipes/plutovg/all/test_package/conanfile.py create mode 100644 recipes/plutovg/all/test_package/test_package.c create mode 100644 recipes/plutovg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plutovg/all/test_v1_package/conanfile.py create mode 100644 recipes/plutovg/config.yml create mode 100644 recipes/pngpp/all/conandata.yml create mode 100644 recipes/pngpp/all/conanfile.py create mode 100644 recipes/pngpp/all/patches/0001-fix-windows.patch create mode 100644 recipes/pngpp/all/test_package/CMakeLists.txt create mode 100644 recipes/pngpp/all/test_package/conanfile.py create mode 100644 recipes/pngpp/all/test_package/test_package.cpp create mode 100644 recipes/pngpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pngpp/all/test_v1_package/conanfile.py create mode 100644 recipes/pngpp/config.yml create mode 100644 recipes/poco/all/conandata.yml create mode 100644 recipes/poco/all/conanfile.py create mode 100644 recipes/poco/all/patches/0002-mysql-include.patch create mode 100644 recipes/poco/all/patches/1.10.0-set-missing-cmake-variable.patch create mode 100644 recipes/poco/all/patches/1.10.0.patch create mode 100644 recipes/poco/all/patches/1.10.1.patch create mode 100644 recipes/poco/all/patches/1.11.0.patch create mode 100644 recipes/poco/all/patches/1.11.1.patch create mode 100644 recipes/poco/all/patches/1.12.0.patch create mode 100644 recipes/poco/all/patches/1.12.1.patch create mode 100644 recipes/poco/all/patches/1.12.2.patch create mode 100644 recipes/poco/all/patches/1.12.3.patch create mode 100644 recipes/poco/all/patches/1.12.4.patch create mode 100644 recipes/poco/all/patches/1.8.1.patch create mode 100644 recipes/poco/all/patches/1.9.2.patch create mode 100644 recipes/poco/all/test_package/CMakeLists.txt create mode 100644 recipes/poco/all/test_package/conanfile.py create mode 100644 recipes/poco/all/test_package/test_core.cpp create mode 100644 recipes/poco/all/test_package/test_crypto.cpp create mode 100644 recipes/poco/all/test_package/test_encodings.cpp create mode 100644 recipes/poco/all/test_package/test_jwt.cpp create mode 100644 recipes/poco/all/test_package/test_net.cpp create mode 100644 recipes/poco/all/test_package/test_net_2.cpp create mode 100644 recipes/poco/all/test_package/test_netssl.cpp create mode 100644 recipes/poco/all/test_package/test_prometheus.cpp create mode 100644 recipes/poco/all/test_package/test_sqlite.cpp create mode 100644 recipes/poco/all/test_package/test_util.cpp create mode 100644 recipes/poco/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/poco/all/test_v1_package/conanfile.py create mode 100644 recipes/poco/config.yml create mode 100644 recipes/podofo/all/conandata.yml create mode 100644 recipes/podofo/all/conanfile.py create mode 100644 recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch create mode 100644 recipes/podofo/all/patches/0001-fix-cmake-0.9.7.patch create mode 100644 recipes/podofo/all/test_package/CMakeLists.txt create mode 100644 recipes/podofo/all/test_package/conanfile.py create mode 100644 recipes/podofo/all/test_package/test_package.cpp create mode 100644 recipes/podofo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/podofo/all/test_v1_package/conanfile.py create mode 100644 recipes/podofo/config.yml create mode 100644 recipes/poly2tri/all/CMakeLists.txt create mode 100644 recipes/poly2tri/all/conandata.yml create mode 100644 recipes/poly2tri/all/conanfile.py create mode 100644 recipes/poly2tri/all/test_package/CMakeLists.txt create mode 100644 recipes/poly2tri/all/test_package/conanfile.py create mode 100644 recipes/poly2tri/all/test_package/test_package.cpp create mode 100644 recipes/poly2tri/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/poly2tri/all/test_v1_package/conanfile.py create mode 100644 recipes/poly2tri/config.yml create mode 100644 recipes/polylabel/all/conandata.yml create mode 100644 recipes/polylabel/all/conanfile.py create mode 100644 recipes/polylabel/all/test_package/CMakeLists.txt create mode 100644 recipes/polylabel/all/test_package/conanfile.py create mode 100644 recipes/polylabel/all/test_package/test_package.cpp create mode 100644 recipes/polylabel/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/polylabel/all/test_v1_package/conanfile.py create mode 100644 recipes/polylabel/config.yml create mode 100644 recipes/polylineencoder/all/conandata.yml create mode 100644 recipes/polylineencoder/all/conanfile.py create mode 100644 recipes/polylineencoder/all/patches/1.0.0/0001-cmake-target-name.patch create mode 100644 recipes/polylineencoder/all/patches/1.0.0/0002-include-limits.patch create mode 100644 recipes/polylineencoder/all/patches/1.0.0/0003-cmake-install.patch create mode 100644 recipes/polylineencoder/all/patches/1.1.2/0001-cmake.patch create mode 100644 recipes/polylineencoder/all/patches/1.1.2/0002-backward-compatibility.patch create mode 100644 recipes/polylineencoder/all/test_package/CMakeLists.txt create mode 100644 recipes/polylineencoder/all/test_package/conanfile.py create mode 100644 recipes/polylineencoder/all/test_package/test_package.cpp create mode 100644 recipes/polylineencoder/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/polylineencoder/all/test_v1_package/conanfile.py create mode 100644 recipes/polylineencoder/config.yml create mode 100644 recipes/polymorphic_value/all/conandata.yml create mode 100644 recipes/polymorphic_value/all/conanfile.py create mode 100644 recipes/polymorphic_value/all/test_package/CMakeLists.txt create mode 100644 recipes/polymorphic_value/all/test_package/conanfile.py create mode 100644 recipes/polymorphic_value/all/test_package/test_package.cpp create mode 100644 recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/polymorphic_value/all/test_v1_package/conanfile.py create mode 100644 recipes/polymorphic_value/config.yml create mode 100644 recipes/poppler-data/all/conandata.yml create mode 100644 recipes/poppler-data/all/conanfile.py create mode 100644 recipes/poppler-data/all/patches/0001-cmake-use-GNUInstallDirs.patch create mode 100644 recipes/poppler-data/all/test_package/conanfile.py create mode 100644 recipes/poppler-data/all/test_v1_package/conanfile.py create mode 100644 recipes/poppler-data/config.yml create mode 100644 recipes/poppler/all/CMakeLists.txt create mode 100644 recipes/poppler/all/conandata.yml create mode 100644 recipes/poppler/all/conanfile.py create mode 100644 recipes/poppler/all/patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch create mode 100644 recipes/poppler/all/patches/20/0002-cmake-use_CONAN_PKG-targets.patch create mode 100644 recipes/poppler/all/patches/20/0003-cmake-disable-tests.patch create mode 100644 recipes/poppler/all/patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch create mode 100644 recipes/poppler/all/patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch create mode 100644 recipes/poppler/all/patches/20/0006-missing-symbol-dll-windows.patch create mode 100644 recipes/poppler/all/patches/20/0007-cmake-use_conan_qt.patch create mode 100644 recipes/poppler/all/patches/21/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch create mode 100644 recipes/poppler/all/patches/21/0002-cmake-use_CONAN_PKG-targets.patch create mode 100644 recipes/poppler/all/patches/21/0004-add-POPPLER_DATADIR-environment-variable.patch create mode 100644 recipes/poppler/all/patches/21/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch create mode 100644 recipes/poppler/all/patches/21/0007-cmake-use_conan_qt.patch create mode 100644 recipes/poppler/all/test_package/CMakeLists.txt create mode 100644 recipes/poppler/all/test_package/conanfile.py create mode 100644 recipes/poppler/all/test_package/sample.pdf create mode 100644 recipes/poppler/all/test_package/test_package.cpp create mode 100644 recipes/poppler/config.yml create mode 100644 recipes/popt/all/conandata.yml create mode 100644 recipes/popt/all/conanfile.py create mode 100644 recipes/popt/all/patches/0004-vcpkg-fixmsvc.patch create mode 100644 recipes/popt/all/test_package/CMakeLists.txt create mode 100644 recipes/popt/all/test_package/conanfile.py create mode 100644 recipes/popt/all/test_package/test_package.c create mode 100644 recipes/popt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/popt/all/test_v1_package/conanfile.py create mode 100644 recipes/popt/config.yml create mode 100644 recipes/portable-file-dialogs/all/conandata.yml create mode 100644 recipes/portable-file-dialogs/all/conanfile.py create mode 100644 recipes/portable-file-dialogs/all/test_package/CMakeLists.txt create mode 100644 recipes/portable-file-dialogs/all/test_package/conanfile.py create mode 100644 recipes/portable-file-dialogs/all/test_package/test_package.cpp create mode 100644 recipes/portable-file-dialogs/config.yml create mode 100644 recipes/poshlib/all/CMakeLists.txt create mode 100644 recipes/poshlib/all/conandata.yml create mode 100644 recipes/poshlib/all/conanfile.py create mode 100644 recipes/poshlib/all/test_package/CMakeLists.txt create mode 100644 recipes/poshlib/all/test_package/conanfile.py create mode 100644 recipes/poshlib/all/test_package/test_package.c create mode 100644 recipes/poshlib/config.yml create mode 100644 recipes/pprint/all/conandata.yml create mode 100644 recipes/pprint/all/conanfile.py create mode 100644 recipes/pprint/all/test_package/CMakeLists.txt create mode 100644 recipes/pprint/all/test_package/conanfile.py create mode 100644 recipes/pprint/all/test_package/test_package.cpp create mode 100644 recipes/pprint/config.yml create mode 100644 recipes/pranav-csv2/all/conandata.yml create mode 100644 recipes/pranav-csv2/all/conanfile.py create mode 100644 recipes/pranav-csv2/all/test_package/CMakeLists.txt create mode 100644 recipes/pranav-csv2/all/test_package/conanfile.py create mode 100644 recipes/pranav-csv2/all/test_package/test_package.cpp create mode 100644 recipes/pranav-csv2/config.yml create mode 100644 recipes/premake/5.x/conandata.yml create mode 100644 recipes/premake/5.x/conanfile.py create mode 100644 recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch create mode 100644 recipes/premake/5.x/patches/0001-5.0.0-alpha15-mingw.patch create mode 100644 recipes/premake/5.x/test_package/conanfile.py create mode 100644 recipes/premake/config.yml create mode 100644 recipes/pretty-name/all/conandata.yml create mode 100644 recipes/pretty-name/all/conanfile.py create mode 100644 recipes/pretty-name/all/test_package/CMakeLists.txt create mode 100644 recipes/pretty-name/all/test_package/conanfile.py create mode 100644 recipes/pretty-name/all/test_package/src/test.cpp create mode 100644 recipes/pretty-name/config.yml create mode 100644 recipes/pro-mdnsd/all/CMakeLists.txt create mode 100644 recipes/pro-mdnsd/all/conandata.yml create mode 100644 recipes/pro-mdnsd/all/conanfile.py create mode 100644 recipes/pro-mdnsd/all/patches/0001-cmake-install-bundle.patch create mode 100644 recipes/pro-mdnsd/all/test_package/CMakeLists.txt create mode 100644 recipes/pro-mdnsd/all/test_package/conanfile.py create mode 100644 recipes/pro-mdnsd/all/test_package/test_package.c create mode 100644 recipes/pro-mdnsd/config.yml create mode 100644 recipes/procxx-boost-ext-simd/all/conandata.yml create mode 100644 recipes/procxx-boost-ext-simd/all/conanfile.py create mode 100644 recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt create mode 100644 recipes/procxx-boost-ext-simd/all/test_package/conanfile.py create mode 100644 recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp create mode 100644 recipes/procxx-boost-ext-simd/config.yml create mode 100644 recipes/proj/all/conandata.yml create mode 100644 recipes/proj/all/conanfile.py create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch create mode 100644 recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch create mode 100644 recipes/proj/all/test_package/CMakeLists.txt create mode 100644 recipes/proj/all/test_package/conanfile.py create mode 100644 recipes/proj/all/test_package/test_package.c create mode 100644 recipes/proj/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/proj/all/test_v1_package/conanfile.py create mode 100644 recipes/proj/config.yml create mode 100644 recipes/prometheus-cpp/all/conandata.yml create mode 100644 recipes/prometheus-cpp/all/conanfile.py create mode 100644 recipes/prometheus-cpp/all/patches/0001-include-limits.patch create mode 100644 recipes/prometheus-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/prometheus-cpp/all/test_package/conanfile.py create mode 100644 recipes/prometheus-cpp/all/test_package/test_package.cpp create mode 100644 recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/prometheus-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/prometheus-cpp/config.yml create mode 100644 recipes/proposal/all/conandata.yml create mode 100644 recipes/proposal/all/conanfile.py create mode 100644 recipes/proposal/all/test_package/CMakeLists.txt create mode 100644 recipes/proposal/all/test_package/conanfile.py create mode 100644 recipes/proposal/all/test_package/test_package.cpp create mode 100644 recipes/proposal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/proposal/all/test_v1_package/conanfile.py create mode 100644 recipes/proposal/config.yml create mode 100644 recipes/protobuf/all/conandata.yml create mode 100644 recipes/protobuf/all/conanfile.py create mode 100644 recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch create mode 100644 recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch create mode 100644 recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch create mode 100644 recipes/protobuf/all/test_package/CMakeLists.txt create mode 100644 recipes/protobuf/all/test_package/addressbook.proto create mode 100644 recipes/protobuf/all/test_package/conanfile.py create mode 100644 recipes/protobuf/all/test_package/test_package.cpp create mode 100644 recipes/protobuf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/protobuf/all/test_v1_package/conanfile.py create mode 100644 recipes/protobuf/config.yml create mode 100644 recipes/protopuf/all/conandata.yml create mode 100644 recipes/protopuf/all/conanfile.py create mode 100644 recipes/protopuf/all/test_package/CMakeLists.txt create mode 100644 recipes/protopuf/all/test_package/conanfile.py create mode 100644 recipes/protopuf/all/test_package/test_package.cpp create mode 100644 recipes/protopuf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/protopuf/all/test_v1_package/conanfile.py create mode 100644 recipes/protopuf/config.yml create mode 100644 recipes/protozero/all/conandata.yml create mode 100644 recipes/protozero/all/conanfile.py create mode 100644 recipes/protozero/all/test_package/CMakeLists.txt create mode 100644 recipes/protozero/all/test_package/conanfile.py create mode 100644 recipes/protozero/all/test_package/test_package.cpp create mode 100644 recipes/protozero/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/protozero/all/test_v1_package/conanfile.py create mode 100644 recipes/protozero/config.yml create mode 100644 recipes/psimd/all/conandata.yml create mode 100644 recipes/psimd/all/conanfile.py create mode 100644 recipes/psimd/all/test_package/CMakeLists.txt create mode 100644 recipes/psimd/all/test_package/conanfile.py create mode 100644 recipes/psimd/all/test_package/test_package.c create mode 100644 recipes/psimd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/psimd/all/test_v1_package/conanfile.py create mode 100644 recipes/psimd/config.yml create mode 100644 recipes/psyinf-gmtl/all/conandata.yml create mode 100644 recipes/psyinf-gmtl/all/conanfile.py create mode 100644 recipes/psyinf-gmtl/all/test_package/CMakeLists.txt create mode 100644 recipes/psyinf-gmtl/all/test_package/conanfile.py create mode 100644 recipes/psyinf-gmtl/all/test_package/test_package.cpp create mode 100644 recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/psyinf-gmtl/all/test_v1_package/conanfile.py create mode 100644 recipes/psyinf-gmtl/config.yml create mode 100644 recipes/ptex/all/conandata.yml create mode 100644 recipes/ptex/all/conanfile.py create mode 100644 recipes/ptex/all/patches/0001-fix-cmake.patch create mode 100644 recipes/ptex/all/test_package/CMakeLists.txt create mode 100644 recipes/ptex/all/test_package/conanfile.py create mode 100644 recipes/ptex/all/test_package/test_package.cpp create mode 100644 recipes/ptex/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ptex/all/test_v1_package/conanfile.py create mode 100644 recipes/ptex/config.yml create mode 100644 recipes/pthreadpool/all/CMakeLists.txt create mode 100644 recipes/pthreadpool/all/conandata.yml create mode 100644 recipes/pthreadpool/all/conanfile.py create mode 100644 recipes/pthreadpool/all/test_package/CMakeLists.txt create mode 100644 recipes/pthreadpool/all/test_package/conanfile.py create mode 100644 recipes/pthreadpool/all/test_package/test_package.c create mode 100644 recipes/pthreadpool/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pthreadpool/all/test_v1_package/conanfile.py create mode 100644 recipes/pthreadpool/config.yml create mode 100644 recipes/pthreads4w/all/conandata.yml create mode 100644 recipes/pthreads4w/all/conanfile.py create mode 100644 recipes/pthreads4w/all/test_package/CMakeLists.txt create mode 100644 recipes/pthreads4w/all/test_package/conanfile.py create mode 100644 recipes/pthreads4w/all/test_package/test_package.c create mode 100644 recipes/pthreads4w/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pthreads4w/all/test_v1_package/conanfile.py create mode 100644 recipes/pthreads4w/config.yml create mode 100644 recipes/pugixml/all/conandata.yml create mode 100644 recipes/pugixml/all/conanfile.py create mode 100644 recipes/pugixml/all/test_package/CMakeLists.txt create mode 100644 recipes/pugixml/all/test_package/conanfile.py create mode 100644 recipes/pugixml/all/test_package/test_package.cpp create mode 100644 recipes/pugixml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pugixml/all/test_v1_package/conanfile.py create mode 100644 recipes/pugixml/config.yml create mode 100644 recipes/pulseaudio/all/conandata.yml create mode 100644 recipes/pulseaudio/all/conanfile.py create mode 100644 recipes/pulseaudio/all/test_package/CMakeLists.txt create mode 100644 recipes/pulseaudio/all/test_package/conanfile.py create mode 100644 recipes/pulseaudio/all/test_package/test_package.c create mode 100644 recipes/pulseaudio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pulseaudio/all/test_v1_package/conanfile.py create mode 100644 recipes/pulseaudio/config.yml create mode 100644 recipes/pupnp/all/conandata.yml create mode 100644 recipes/pupnp/all/conanfile.py create mode 100644 recipes/pupnp/all/test_package/CMakeLists.txt create mode 100644 recipes/pupnp/all/test_package/conanfile.py create mode 100644 recipes/pupnp/all/test_package/test_package.c create mode 100644 recipes/pupnp/config.yml create mode 100644 recipes/pybind11/all/conandata.yml create mode 100644 recipes/pybind11/all/conanfile.py create mode 100644 recipes/pybind11/all/test_package/CMakeLists.txt create mode 100644 recipes/pybind11/all/test_package/conanfile.py create mode 100644 recipes/pybind11/all/test_package/test.py create mode 100644 recipes/pybind11/all/test_package/test_package.cpp create mode 100644 recipes/pybind11/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pybind11/all/test_v1_package/conanfile.py create mode 100644 recipes/pybind11/config.yml create mode 100644 recipes/pybind11_json/all/conandata.yml create mode 100644 recipes/pybind11_json/all/conanfile.py create mode 100644 recipes/pybind11_json/all/test_package/CMakeLists.txt create mode 100644 recipes/pybind11_json/all/test_package/conanfile.py create mode 100644 recipes/pybind11_json/all/test_package/test_package.cpp create mode 100644 recipes/pybind11_json/config.yml create mode 100644 recipes/pystring/all/CMakeLists.txt create mode 100644 recipes/pystring/all/conandata.yml create mode 100644 recipes/pystring/all/conanfile.py create mode 100644 recipes/pystring/all/test_package/CMakeLists.txt create mode 100644 recipes/pystring/all/test_package/conanfile.py create mode 100644 recipes/pystring/all/test_package/test_package.cpp create mode 100644 recipes/pystring/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pystring/all/test_v1_package/conanfile.py create mode 100644 recipes/pystring/config.yml create mode 100644 recipes/qarchive/all/conandata.yml create mode 100644 recipes/qarchive/all/conanfile.py create mode 100644 recipes/qarchive/all/patches/0001-cmake-conan-compatibility.patch create mode 100644 recipes/qarchive/all/patches/0002-export-symbols.patch create mode 100644 recipes/qarchive/all/test_package/CMakeLists.txt create mode 100644 recipes/qarchive/all/test_package/conanfile.py create mode 100644 recipes/qarchive/all/test_package/test_package.cpp create mode 100644 recipes/qarchive/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qarchive/all/test_v1_package/conanfile.py create mode 100644 recipes/qarchive/config.yml create mode 100644 recipes/qcbor/all/conandata.yml create mode 100644 recipes/qcbor/all/conanfile.py create mode 100644 recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch create mode 100644 recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch create mode 100644 recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch create mode 100644 recipes/qcbor/all/test_package/CMakeLists.txt create mode 100644 recipes/qcbor/all/test_package/conanfile.py create mode 100644 recipes/qcbor/all/test_package/test_package.c create mode 100644 recipes/qcbor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qcbor/all/test_v1_package/conanfile.py create mode 100644 recipes/qcbor/config.yml create mode 100644 recipes/qcoro/all/CMakeLists.txt create mode 100644 recipes/qcoro/all/conandata.yml create mode 100644 recipes/qcoro/all/conanfile.py create mode 100644 recipes/qcoro/all/test_package/CMakeLists.txt create mode 100644 recipes/qcoro/all/test_package/conanfile.py create mode 100644 recipes/qcoro/all/test_package/test_package.cpp create mode 100644 recipes/qcoro/config.yml create mode 100644 recipes/qcustomplot/all/CMakeLists.txt create mode 100644 recipes/qcustomplot/all/conandata.yml create mode 100644 recipes/qcustomplot/all/conanfile.py create mode 100644 recipes/qcustomplot/all/patches/0001-fix-for-qt6.2.patch create mode 100644 recipes/qcustomplot/all/test_package/CMakeLists.txt create mode 100644 recipes/qcustomplot/all/test_package/conanfile.py create mode 100644 recipes/qcustomplot/all/test_package/test_package.cpp create mode 100644 recipes/qcustomplot/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qcustomplot/all/test_v1_package/conanfile.py create mode 100644 recipes/qcustomplot/config.yml create mode 100644 recipes/qdbm/all/CMakeLists.txt create mode 100644 recipes/qdbm/all/conandata.yml create mode 100644 recipes/qdbm/all/conanfile.py create mode 100644 recipes/qdbm/all/test_package/CMakeLists.txt create mode 100644 recipes/qdbm/all/test_package/conanfile.py create mode 100644 recipes/qdbm/all/test_package/test_package.c create mode 100644 recipes/qdbm/config.yml create mode 100644 recipes/qhull/all/conandata.yml create mode 100644 recipes/qhull/all/conanfile.py create mode 100644 recipes/qhull/all/patches/0001-fix-cmake-conflict-exec-dir.patch create mode 100644 recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch create mode 100644 recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch create mode 100644 recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch create mode 100644 recipes/qhull/all/patches/0003-fix-cmake-7.3.2.patch create mode 100644 recipes/qhull/all/patches/0003-fix-cmake-8.0.x.patch create mode 100644 recipes/qhull/all/patches/0004-no-cpp11.patch create mode 100644 recipes/qhull/all/test_package/CMakeLists.txt create mode 100644 recipes/qhull/all/test_package/conanfile.py create mode 100644 recipes/qhull/all/test_package/test_package.c create mode 100644 recipes/qhull/all/test_package/test_package_r.c create mode 100644 recipes/qhull/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qhull/all/test_v1_package/conanfile.py create mode 100644 recipes/qhull/config.yml create mode 100644 recipes/qpdf/all/conandata.yml create mode 100644 recipes/qpdf/all/conanfile.py create mode 100644 recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch create mode 100644 recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch create mode 100644 recipes/qpdf/all/test_package/CMakeLists.txt create mode 100644 recipes/qpdf/all/test_package/conanfile.py create mode 100644 recipes/qpdf/all/test_package/test_package.cpp create mode 100644 recipes/qpdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qpdf/all/test_v1_package/conanfile.py create mode 100644 recipes/qpdf/config.yml create mode 100644 recipes/qpoases/all/conandata.yml create mode 100644 recipes/qpoases/all/conanfile.py create mode 100644 recipes/qpoases/all/test_package/CMakeLists.txt create mode 100644 recipes/qpoases/all/test_package/conanfile.py create mode 100644 recipes/qpoases/all/test_package/test_package.cpp create mode 100644 recipes/qpoases/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qpoases/all/test_v1_package/conanfile.py create mode 100644 recipes/qpoases/config.yml create mode 100644 recipes/qr-code-generator/all/CMakeLists.txt create mode 100644 recipes/qr-code-generator/all/conandata.yml create mode 100644 recipes/qr-code-generator/all/conanfile.py create mode 100644 recipes/qr-code-generator/all/patches/001-qrcode-1_4.patch create mode 100644 recipes/qr-code-generator/all/patches/002-cmake-pre-1.6.patch create mode 100644 recipes/qr-code-generator/all/patches/003-cmake-1.6.patch create mode 100644 recipes/qr-code-generator/all/patches/004-cmake-1.7.patch create mode 100644 recipes/qr-code-generator/all/test_package/CMakeLists.txt create mode 100644 recipes/qr-code-generator/all/test_package/conanfile.py create mode 100644 recipes/qr-code-generator/all/test_package/test_package.cpp create mode 100644 recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qr-code-generator/all/test_v1_package/conanfile.py create mode 100644 recipes/qr-code-generator/config.yml create mode 100644 recipes/qt-advanced-docking-system/all/CMakeLists.txt create mode 100644 recipes/qt-advanced-docking-system/all/conandata.yml create mode 100644 recipes/qt-advanced-docking-system/all/conanfile.py create mode 100644 recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch create mode 100644 recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt create mode 100644 recipes/qt-advanced-docking-system/all/test_package/conanfile.py create mode 100644 recipes/qt-advanced-docking-system/all/test_package/example.cpp create mode 100644 recipes/qt-advanced-docking-system/config.yml create mode 100644 recipes/qt/5.x.x/conandata.yml create mode 100644 recipes/qt/5.x.x/conanfile.py create mode 100644 recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch create mode 100644 recipes/qt/5.x.x/patches/107ed30ec5.patch create mode 100644 recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch create mode 100644 recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch create mode 100644 recipes/qt/5.x.x/patches/337f28c9ab.patch create mode 100644 recipes/qt/5.x.x/patches/QTBUG-98813.patch create mode 100644 recipes/qt/5.x.x/patches/aa2a39dea5.diff create mode 100644 recipes/qt/5.x.x/patches/android-backtrace.diff create mode 100644 recipes/qt/5.x.x/patches/android-new-ndk.diff create mode 100644 recipes/qt/5.x.x/patches/android-openssl.diff create mode 100644 recipes/qt/5.x.x/patches/c72097e.diff create mode 100644 recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch create mode 100644 recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch create mode 100644 recipes/qt/5.x.x/patches/d3396fb6fc.patch create mode 100644 recipes/qt/5.x.x/patches/dece6f5.diff create mode 100644 recipes/qt/5.x.x/patches/fix-macdeployqt.diff create mode 100644 recipes/qt/5.x.x/patches/skia-cd397f3.diff create mode 100644 recipes/qt/5.x.x/qtmodules5.15.5.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.6.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.7.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.8.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.9.conf create mode 100644 recipes/qt/5.x.x/test_package/CMakeLists.txt create mode 100644 recipes/qt/5.x.x/test_package/conanfile.py create mode 100644 recipes/qt/5.x.x/test_package/example.qrc create mode 100644 recipes/qt/5.x.x/test_package/greeter.h create mode 100644 recipes/qt/5.x.x/test_package/resource.txt create mode 100644 recipes/qt/5.x.x/test_package/test_package.cpp create mode 100644 recipes/qt/5.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/qt/5.x.x/test_v1_package/conanfile.py create mode 100644 recipes/qt/5.x.x/test_v1_package/meson.build create mode 100644 recipes/qt/5.x.x/test_v1_package/test_package.pro create mode 100644 recipes/qt/6.x.x/conandata.yml create mode 100644 recipes/qt/6.x.x/conanfile.py create mode 100644 recipes/qt/6.x.x/patches/138a720.diff create mode 100644 recipes/qt/6.x.x/patches/311d29d.patch create mode 100644 recipes/qt/6.x.x/patches/32451d5.diff create mode 100644 recipes/qt/6.x.x/patches/3801bba82.patch create mode 100644 recipes/qt/6.x.x/patches/5fe0b82.patch create mode 100644 recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff create mode 100644 recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff create mode 100644 recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff create mode 100644 recipes/qt/6.x.x/patches/c72097e.diff create mode 100644 recipes/qt/6.x.x/patches/c76d2f6.patch create mode 100644 recipes/qt/6.x.x/patches/d13958d.diff create mode 100644 recipes/qt/6.x.x/patches/d13958d_.diff create mode 100644 recipes/qt/6.x.x/patches/dece6f5.patch create mode 100644 recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff create mode 100644 recipes/qt/6.x.x/qtmodules6.2.4.conf create mode 100644 recipes/qt/6.x.x/qtmodules6.3.2.conf create mode 100644 recipes/qt/6.x.x/qtmodules6.4.1.conf create mode 100644 recipes/qt/6.x.x/qtmodules6.4.2.conf create mode 100644 recipes/qt/6.x.x/qtmodules6.5.0.conf create mode 100644 recipes/qt/6.x.x/test_package/CMakeLists.txt create mode 100644 recipes/qt/6.x.x/test_package/conanfile.py create mode 100644 recipes/qt/6.x.x/test_package/example.qrc create mode 100644 recipes/qt/6.x.x/test_package/greeter.h create mode 100644 recipes/qt/6.x.x/test_package/meson.build create mode 100644 recipes/qt/6.x.x/test_package/resource.txt create mode 100644 recipes/qt/6.x.x/test_package/test_package.cpp create mode 100644 recipes/qt/6.x.x/test_package/test_package.pro create mode 100644 recipes/qt/config.yml create mode 100644 recipes/qtxlsxwriter/all/CMakeLists.txt create mode 100644 recipes/qtxlsxwriter/all/conandata.yml create mode 100644 recipes/qtxlsxwriter/all/conanfile.py create mode 100644 recipes/qtxlsxwriter/all/patches/0.3.0/fix-export-macro.patch create mode 100644 recipes/qtxlsxwriter/all/test_package/CMakeLists.txt create mode 100644 recipes/qtxlsxwriter/all/test_package/conanfile.py create mode 100644 recipes/qtxlsxwriter/all/test_package/test_package.cpp create mode 100644 recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qtxlsxwriter/all/test_v1_package/conanfile.py create mode 100644 recipes/qtxlsxwriter/config.yml create mode 100644 recipes/quantlib/all/conandata.yml create mode 100644 recipes/quantlib/all/conanfile.py create mode 100644 recipes/quantlib/all/patches/0001-fix-cmake.patch create mode 100644 recipes/quantlib/all/test_package/CMakeLists.txt create mode 100644 recipes/quantlib/all/test_package/conanfile.py create mode 100644 recipes/quantlib/all/test_package/test_package.cpp create mode 100644 recipes/quantlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/quantlib/all/test_v1_package/conanfile.py create mode 100644 recipes/quantlib/config.yml create mode 100644 recipes/quaternions/all/conandata.yml create mode 100644 recipes/quaternions/all/conanfile.py create mode 100644 recipes/quaternions/all/test_package/CMakeLists.txt create mode 100644 recipes/quaternions/all/test_package/conanfile.py create mode 100644 recipes/quaternions/all/test_package/test_package.cpp create mode 100644 recipes/quaternions/config.yml create mode 100644 recipes/quazip/all/conandata.yml create mode 100644 recipes/quazip/all/conanfile.py create mode 100644 recipes/quazip/all/patches/1.3-0001-use-cpp17-for-qt6.patch create mode 100644 recipes/quazip/all/test_package/CMakeLists.txt create mode 100644 recipes/quazip/all/test_package/conanfile.py create mode 100644 recipes/quazip/all/test_package/test_package.cpp create mode 100644 recipes/quazip/all/test_package/zipFile.zip create mode 100644 recipes/quazip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/quazip/all/test_v1_package/conanfile.py create mode 100644 recipes/quazip/config.yml create mode 100644 recipes/quickfast/all/CMakeLists.txt create mode 100644 recipes/quickfast/all/conandata.yml create mode 100644 recipes/quickfast/all/conanfile.py create mode 100644 recipes/quickfast/all/patches/00001-fix-boost-asio.patch create mode 100644 recipes/quickfast/all/patches/00002-fix-boost-asio.patch create mode 100644 recipes/quickfast/all/test_package/CMakeLists.txt create mode 100644 recipes/quickfast/all/test_package/conanfile.py create mode 100644 recipes/quickfast/all/test_package/main.cpp create mode 100644 recipes/quickfast/config.yml create mode 100644 recipes/quickfix/all/conandata.yml create mode 100644 recipes/quickfix/all/conanfile.py create mode 100644 recipes/quickfix/all/patches/0001-Fix-build-for-C-17-replace-throw-.-with-EXCEPT.patch create mode 100644 recipes/quickfix/all/patches/0002-except-copy.patch create mode 100644 recipes/quickfix/all/patches/0003-fix-condition-for-using-tr1-namespace.patch create mode 100644 recipes/quickfix/all/patches/0004-remove-tests-from-compilatin-unit-performance-and-ac.patch create mode 100644 recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch create mode 100644 recipes/quickfix/all/patches/0006-manage-postgres-through-conan.patch create mode 100644 recipes/quickfix/all/patches/0007-add-support-to-static-libraries-for-non-windows-buil.patch create mode 100644 recipes/quickfix/all/patches/0008-manage-mysql-through-conan.patch create mode 100644 recipes/quickfix/all/patches/0009-downgrade-cmake-minimum-required.patch create mode 100644 recipes/quickfix/all/test_package/CMakeLists.txt create mode 100644 recipes/quickfix/all/test_package/conanfile.py create mode 100644 recipes/quickfix/all/test_package/executor.cpp create mode 100644 recipes/quickfix/config.yml create mode 100644 recipes/quickjs/all/CMakeLists.txt create mode 100644 recipes/quickjs/all/conandata.yml create mode 100644 recipes/quickjs/all/conanfile.py create mode 100644 recipes/quickjs/all/test_package/CMakeLists.txt create mode 100644 recipes/quickjs/all/test_package/conanfile.py create mode 100644 recipes/quickjs/all/test_package/test_package.c create mode 100644 recipes/quickjs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/quickjs/all/test_v1_package/conanfile.py create mode 100644 recipes/quickjs/config.yml create mode 100644 recipes/quill/all/conandata.yml create mode 100644 recipes/quill/all/conanfile.py create mode 100644 recipes/quill/all/test_package/CMakeLists.txt create mode 100644 recipes/quill/all/test_package/conanfile.py create mode 100644 recipes/quill/all/test_package/test_package.cpp create mode 100644 recipes/quill/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/quill/all/test_v1_package/conanfile.py create mode 100644 recipes/quill/config.yml create mode 100644 recipes/quirc/all/CMakeLists.txt create mode 100644 recipes/quirc/all/conandata.yml create mode 100644 recipes/quirc/all/conanfile.py create mode 100644 recipes/quirc/all/patches/remove-c99-features.patch create mode 100644 recipes/quirc/all/patches/replace-vla.patch create mode 100644 recipes/quirc/all/test_package/CMakeLists.txt create mode 100644 recipes/quirc/all/test_package/conanfile.py create mode 100644 recipes/quirc/all/test_package/test_package.c create mode 100644 recipes/quirc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/quirc/all/test_v1_package/conanfile.py create mode 100644 recipes/quirc/config.yml create mode 100644 recipes/qwt/all/conandata.yml create mode 100644 recipes/qwt/all/conanfile.py create mode 100644 recipes/qwt/all/patches/cmake-support-patch.patch create mode 100644 recipes/qwt/all/patches/cmake-support.patch create mode 100644 recipes/qwt/all/test_package/CMakeLists.txt create mode 100644 recipes/qwt/all/test_package/conanfile.py create mode 100644 recipes/qwt/all/test_package/test_package.cpp create mode 100644 recipes/qwt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qwt/all/test_v1_package/conanfile.py create mode 100644 recipes/qwt/config.yml create mode 100644 recipes/qxlsx/all/conandata.yml create mode 100644 recipes/qxlsx/all/conanfile.py create mode 100644 recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch create mode 100644 recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch create mode 100644 recipes/qxlsx/all/test_package/CMakeLists.txt create mode 100644 recipes/qxlsx/all/test_package/conanfile.py create mode 100644 recipes/qxlsx/all/test_package/test_package.cpp create mode 100644 recipes/qxlsx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qxlsx/all/test_v1_package/conanfile.py create mode 100644 recipes/qxlsx/config.yml create mode 100644 recipes/qxmpp/all/CMakeLists.txt create mode 100644 recipes/qxmpp/all/conandata.yml create mode 100644 recipes/qxmpp/all/conanfile.py create mode 100644 recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch create mode 100644 recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch create mode 100644 recipes/qxmpp/all/test_package/CMakeLists.txt create mode 100644 recipes/qxmpp/all/test_package/conanfile.py create mode 100644 recipes/qxmpp/all/test_package/test_package.cpp create mode 100644 recipes/qxmpp/config.yml create mode 100644 recipes/r8brain-free-src/all/CMakeLists.txt create mode 100644 recipes/r8brain-free-src/all/conandata.yml create mode 100644 recipes/r8brain-free-src/all/conanfile.py create mode 100644 recipes/r8brain-free-src/all/test_package/CMakeLists.txt create mode 100644 recipes/r8brain-free-src/all/test_package/conanfile.py create mode 100644 recipes/r8brain-free-src/all/test_package/test_package.cpp create mode 100644 recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/r8brain-free-src/all/test_v1_package/conanfile.py create mode 100644 recipes/r8brain-free-src/config.yml create mode 100755 recipes/rabbitmq-c/all/conandata.yml create mode 100755 recipes/rabbitmq-c/all/conanfile.py create mode 100644 recipes/rabbitmq-c/all/test_package/CMakeLists.txt create mode 100644 recipes/rabbitmq-c/all/test_package/conanfile.py create mode 100644 recipes/rabbitmq-c/all/test_package/test_package.c create mode 100644 recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rabbitmq-c/all/test_v1_package/conanfile.py create mode 100644 recipes/rabbitmq-c/config.yml create mode 100644 recipes/ragel/all/CMakeLists.txt create mode 100644 recipes/ragel/all/conandata.yml create mode 100644 recipes/ragel/all/conanfile.py create mode 100644 recipes/ragel/all/config.h create mode 100644 recipes/ragel/all/patches/0001-unistd.patch create mode 100644 recipes/ragel/all/test_package/conanfile.py create mode 100644 recipes/ragel/config.yml create mode 100644 recipes/rang/all/conandata.yml create mode 100644 recipes/rang/all/conanfile.py create mode 100644 recipes/rang/all/test_package/CMakeLists.txt create mode 100644 recipes/rang/all/test_package/conanfile.py create mode 100644 recipes/rang/all/test_package/test_package.cpp create mode 100644 recipes/rang/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rang/all/test_v1_package/conanfile.py create mode 100644 recipes/rang/config.yml create mode 100644 recipes/range-v3/all/conandata.yml create mode 100644 recipes/range-v3/all/conanfile.py create mode 100644 recipes/range-v3/all/test_package/CMakeLists.txt create mode 100644 recipes/range-v3/all/test_package/conanfile.py create mode 100644 recipes/range-v3/all/test_package/test_package.cpp create mode 100644 recipes/range-v3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/range-v3/all/test_v1_package/conanfile.py create mode 100644 recipes/range-v3/config.yml create mode 100644 recipes/rangeless/all/conandata.yml create mode 100644 recipes/rangeless/all/conanfile.py create mode 100644 recipes/rangeless/all/test_package/CMakeLists.txt create mode 100644 recipes/rangeless/all/test_package/conanfile.py create mode 100644 recipes/rangeless/all/test_package/test_package.cpp create mode 100644 recipes/rangeless/config.yml create mode 100644 recipes/rangesnext/all/conandata.yml create mode 100644 recipes/rangesnext/all/conanfile.py create mode 100644 recipes/rangesnext/all/test_package/CMakeLists.txt create mode 100644 recipes/rangesnext/all/test_package/conanfile.py create mode 100644 recipes/rangesnext/all/test_package/test_package.cpp create mode 100644 recipes/rangesnext/config.yml create mode 100644 recipes/rapidcheck/all/conandata.yml create mode 100644 recipes/rapidcheck/all/conanfile.py create mode 100644 recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20200131.patch create mode 100644 recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210107.patch create mode 100644 recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210702.patch create mode 100644 recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20220514.patch create mode 100644 recipes/rapidcheck/all/test_package/CMakeLists.txt create mode 100644 recipes/rapidcheck/all/test_package/conanfile.py create mode 100644 recipes/rapidcheck/all/test_package/test_package.cpp create mode 100644 recipes/rapidcheck/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidcheck/all/test_v1_package/conanfile.py create mode 100644 recipes/rapidcheck/config.yml create mode 100644 recipes/rapidcsv/all/conandata.yml create mode 100644 recipes/rapidcsv/all/conanfile.py create mode 100644 recipes/rapidcsv/all/test_package/CMakeLists.txt create mode 100644 recipes/rapidcsv/all/test_package/conanfile.py create mode 100644 recipes/rapidcsv/all/test_package/test_package.cpp create mode 100644 recipes/rapidcsv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidcsv/all/test_v1_package/conanfile.py create mode 100644 recipes/rapidcsv/config.yml create mode 100644 recipes/rapidfuzz/all/conandata.yml create mode 100644 recipes/rapidfuzz/all/conanfile.py create mode 100644 recipes/rapidfuzz/all/test_package/CMakeLists.txt create mode 100644 recipes/rapidfuzz/all/test_package/conanfile.py create mode 100644 recipes/rapidfuzz/all/test_package/test_package.cpp create mode 100644 recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidfuzz/all/test_v1_package/conanfile.py create mode 100644 recipes/rapidfuzz/config.yml create mode 100644 recipes/rapidjson/all/conandata.yml create mode 100644 recipes/rapidjson/all/conanfile.py create mode 100644 recipes/rapidjson/all/test_package/CMakeLists.txt create mode 100644 recipes/rapidjson/all/test_package/conanfile.py create mode 100644 recipes/rapidjson/all/test_package/test_package.cpp create mode 100644 recipes/rapidjson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidjson/all/test_v1_package/conanfile.py create mode 100644 recipes/rapidjson/config.yml create mode 100644 recipes/rapidxml/all/conandata.yml create mode 100644 recipes/rapidxml/all/conanfile.py create mode 100644 recipes/rapidxml/all/patches/1.13-fix-template-compile-issue.patch create mode 100644 recipes/rapidxml/all/test_package/CMakeLists.txt create mode 100644 recipes/rapidxml/all/test_package/beer_journal.xml create mode 100644 recipes/rapidxml/all/test_package/conanfile.py create mode 100644 recipes/rapidxml/all/test_package/test_package.cpp create mode 100644 recipes/rapidxml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidxml/all/test_v1_package/conanfile.py create mode 100644 recipes/rapidxml/config.yml create mode 100644 recipes/rapidyaml/all/conandata.yml create mode 100644 recipes/rapidyaml/all/conanfile.py create mode 100644 recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch create mode 100644 recipes/rapidyaml/all/patches/0.4.0-001-remove-internal-c4core.patch create mode 100644 recipes/rapidyaml/all/patches/0.4.1-001-remove-internal-c4core.patch create mode 100644 recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch create mode 100644 recipes/rapidyaml/all/test_package/CMakeLists.txt create mode 100644 recipes/rapidyaml/all/test_package/conanfile.py create mode 100644 recipes/rapidyaml/all/test_package/test_package.cpp create mode 100644 recipes/rapidyaml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidyaml/all/test_v1_package/conanfile.py create mode 100644 recipes/rapidyaml/config.yml create mode 100644 recipes/raylib/all/CMakeLists.txt create mode 100644 recipes/raylib/all/conandata.yml create mode 100644 recipes/raylib/all/conanfile.py create mode 100644 recipes/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch create mode 100644 recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch create mode 100644 recipes/raylib/all/test_package/CMakeLists.txt create mode 100644 recipes/raylib/all/test_package/conanfile.py create mode 100644 recipes/raylib/all/test_package/test_package.c create mode 100644 recipes/raylib/config.yml create mode 100644 recipes/re2/all/conandata.yml create mode 100644 recipes/re2/all/conanfile.py create mode 100644 recipes/re2/all/test_package/CMakeLists.txt create mode 100644 recipes/re2/all/test_package/conanfile.py create mode 100644 recipes/re2/all/test_package/test_package.cpp create mode 100644 recipes/re2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/re2/all/test_v1_package/conanfile.py create mode 100644 recipes/re2/config.yml create mode 100644 recipes/re2c/all/conandata.yml create mode 100644 recipes/re2c/all/conanfile.py create mode 100644 recipes/re2c/all/patches/0001-add-msvc_cl-sh.patch create mode 100644 recipes/re2c/all/patches/2.0.3-0001-add-missing-include.patch create mode 100644 recipes/re2c/all/test_package/CMakeLists.txt create mode 100644 recipes/re2c/all/test_package/conanfile.py create mode 100644 recipes/re2c/all/test_package/syntax.re create mode 100644 recipes/re2c/config.yml create mode 100644 recipes/reactiveplusplus/all/conandata.yml create mode 100644 recipes/reactiveplusplus/all/conanfile.py create mode 100644 recipes/reactiveplusplus/all/test_package/CMakeLists.txt create mode 100644 recipes/reactiveplusplus/all/test_package/conanfile.py create mode 100644 recipes/reactiveplusplus/all/test_package/test_package.cpp create mode 100644 recipes/reactiveplusplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/reactiveplusplus/all/test_v1_package/conanfile.py create mode 100644 recipes/reactiveplusplus/config.yml create mode 100644 recipes/read-excel/all/conandata.yml create mode 100644 recipes/read-excel/all/conanfile.py create mode 100644 recipes/read-excel/all/test_package/CMakeLists.txt create mode 100644 recipes/read-excel/all/test_package/conanfile.py create mode 100644 recipes/read-excel/all/test_package/sample.xls create mode 100644 recipes/read-excel/all/test_package/test_package.cpp create mode 100644 recipes/read-excel/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/read-excel/all/test_v1_package/conanfile.py create mode 100644 recipes/read-excel/config.yml create mode 100644 recipes/readerwriterqueue/all/conandata.yml create mode 100644 recipes/readerwriterqueue/all/conanfile.py create mode 100644 recipes/readerwriterqueue/all/test_package/CMakeLists.txt create mode 100644 recipes/readerwriterqueue/all/test_package/conanfile.py create mode 100644 recipes/readerwriterqueue/all/test_package/test_package.cpp create mode 100644 recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/readerwriterqueue/all/test_v1_package/conanfile.py create mode 100644 recipes/readerwriterqueue/config.yml create mode 100644 recipes/readline/all/conandata.yml create mode 100644 recipes/readline/all/conanfile.py create mode 100644 recipes/readline/all/test_package/CMakeLists.txt create mode 100644 recipes/readline/all/test_package/conanfile.py create mode 100644 recipes/readline/all/test_package/test_package.c create mode 100644 recipes/readline/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/readline/all/test_v1_package/conanfile.py create mode 100644 recipes/readline/config.yml create mode 100644 recipes/readosm/all/conandata.yml create mode 100644 recipes/readosm/all/conanfile.py create mode 100644 recipes/readosm/all/patches/0001-fix-nmake.patch create mode 100644 recipes/readosm/all/test_package/CMakeLists.txt create mode 100644 recipes/readosm/all/test_package/conanfile.py create mode 100644 recipes/readosm/all/test_package/test_package.c create mode 100644 recipes/readosm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/readosm/all/test_v1_package/conanfile.py create mode 100644 recipes/readosm/config.yml create mode 100644 recipes/recastnavigation/all/conandata.yml create mode 100644 recipes/recastnavigation/all/conanfile.py create mode 100644 recipes/recastnavigation/all/patches/001_fix_shared_option.patch create mode 100644 recipes/recastnavigation/all/test_package/CMakeLists.txt create mode 100644 recipes/recastnavigation/all/test_package/conanfile.py create mode 100644 recipes/recastnavigation/all/test_package/test_package.cpp create mode 100644 recipes/recastnavigation/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/recastnavigation/all/test_v1_package/conanfile.py create mode 100644 recipes/recastnavigation/config.yml create mode 100644 recipes/reckless/all/conandata.yml create mode 100644 recipes/reckless/all/conanfile.py create mode 100644 recipes/reckless/all/patches/0001-fix-cmake.patch create mode 100644 recipes/reckless/all/test_package/CMakeLists.txt create mode 100644 recipes/reckless/all/test_package/conanfile.py create mode 100644 recipes/reckless/all/test_package/test_package.cpp create mode 100644 recipes/reckless/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/reckless/all/test_v1_package/conanfile.py create mode 100644 recipes/reckless/config.yml create mode 100644 recipes/rectanglebinpack/all/CMakeLists.txt create mode 100644 recipes/rectanglebinpack/all/conandata.yml create mode 100644 recipes/rectanglebinpack/all/conanfile.py create mode 100644 recipes/rectanglebinpack/all/patches/0001_fix_win32_build.patch create mode 100644 recipes/rectanglebinpack/all/test_package/CMakeLists.txt create mode 100644 recipes/rectanglebinpack/all/test_package/conanfile.py create mode 100644 recipes/rectanglebinpack/all/test_package/test_package.cpp create mode 100644 recipes/rectanglebinpack/config.yml create mode 100644 recipes/rectpack2d/all/conandata.yml create mode 100644 recipes/rectpack2d/all/conanfile.py create mode 100644 recipes/rectpack2d/all/test_package/CMakeLists.txt create mode 100644 recipes/rectpack2d/all/test_package/conanfile.py create mode 100644 recipes/rectpack2d/all/test_package/test_package.cpp create mode 100644 recipes/rectpack2d/config.yml create mode 100644 recipes/redboltz-mqtt_cpp/all/conandata.yml create mode 100644 recipes/redboltz-mqtt_cpp/all/conanfile.py create mode 100644 recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/redboltz-mqtt_cpp/all/test_package/conanfile.py create mode 100644 recipes/redboltz-mqtt_cpp/all/test_package/test_package.cpp create mode 100644 recipes/redboltz-mqtt_cpp/config.yml create mode 100644 recipes/redis-plus-plus/all/conandata.yml create mode 100644 recipes/redis-plus-plus/all/conanfile.py create mode 100644 recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch create mode 100644 recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch create mode 100644 recipes/redis-plus-plus/all/patches/1.2.3-0001-fix-conan-cmake-package.patch create mode 100644 recipes/redis-plus-plus/all/patches/1.3.2-0001-fix-dependencies-injection.patch create mode 100644 recipes/redis-plus-plus/all/patches/1.3.3-0001-fix-dependencies-injection.patch create mode 100644 recipes/redis-plus-plus/all/patches/1.3.7-0001-fix-dependencies-injection.patch create mode 100644 recipes/redis-plus-plus/all/test_package/CMakeLists.txt create mode 100644 recipes/redis-plus-plus/all/test_package/conanfile.py create mode 100644 recipes/redis-plus-plus/all/test_package/test_package.cpp create mode 100644 recipes/redis-plus-plus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/redis-plus-plus/all/test_v1_package/conanfile.py create mode 100644 recipes/redis-plus-plus/config.yml create mode 100644 recipes/redradist-icc/all/CMakeLists.txt create mode 100644 recipes/redradist-icc/all/conandata.yml create mode 100644 recipes/redradist-icc/all/conanfile.py create mode 100644 recipes/redradist-icc/all/test_package/CMakeLists.txt create mode 100644 recipes/redradist-icc/all/test_package/conanfile.py create mode 100644 recipes/redradist-icc/all/test_package/example.cpp create mode 100644 recipes/redradist-icc/config.yml create mode 100644 recipes/refl-cpp/all/conandata.yml create mode 100644 recipes/refl-cpp/all/conanfile.py create mode 100644 recipes/refl-cpp/all/patches/0.12.1-0001-remove-memory-fwd.patch create mode 100644 recipes/refl-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/refl-cpp/all/test_package/conanfile.py create mode 100644 recipes/refl-cpp/all/test_package/test_package.cpp create mode 100644 recipes/refl-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/refl-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/refl-cpp/config.yml create mode 100644 recipes/replxx/all/CMakeLists.txt create mode 100644 recipes/replxx/all/conandata.yml create mode 100644 recipes/replxx/all/conanfile.py create mode 100644 recipes/replxx/all/test_package/CMakeLists.txt create mode 100644 recipes/replxx/all/test_package/conanfile.py create mode 100644 recipes/replxx/all/test_package/test_package.cpp create mode 100644 recipes/replxx/config.yml create mode 100644 recipes/resiprocate/all/conandata.yml create mode 100644 recipes/resiprocate/all/conanfile.py create mode 100644 recipes/resiprocate/all/test_package/CMakeLists.txt create mode 100644 recipes/resiprocate/all/test_package/conanfile.py create mode 100644 recipes/resiprocate/all/test_package/test_package.cpp create mode 100644 recipes/resiprocate/config.yml create mode 100644 recipes/resource_pool/all/conandata.yml create mode 100644 recipes/resource_pool/all/conanfile.py create mode 100644 recipes/resource_pool/all/test_package/CMakeLists.txt create mode 100644 recipes/resource_pool/all/test_package/conanfile.py create mode 100644 recipes/resource_pool/all/test_package/coro.cc create mode 100644 recipes/resource_pool/config.yml create mode 100644 recipes/restbed/all/conandata.yml create mode 100644 recipes/restbed/all/conanfile.py create mode 100644 recipes/restbed/all/patches/4.8-0001-cmake-conan.patch create mode 100644 recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch create mode 100644 recipes/restbed/all/test_package/CMakeLists.txt create mode 100644 recipes/restbed/all/test_package/conanfile.py create mode 100644 recipes/restbed/all/test_package/test_package.cpp create mode 100644 recipes/restbed/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/restbed/all/test_v1_package/conanfile.py create mode 100644 recipes/restbed/config.yml create mode 100644 recipes/restinio/all/conandata.yml create mode 100644 recipes/restinio/all/conanfile.py create mode 100644 recipes/restinio/all/test_package/CMakeLists.txt create mode 100644 recipes/restinio/all/test_package/conanfile.py create mode 100644 recipes/restinio/all/test_package/test_package.cpp create mode 100644 recipes/restinio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/restinio/all/test_v1_package/conanfile.py create mode 100644 recipes/restinio/config.yml create mode 100644 recipes/rg-etc1/all/CMakeLists.txt create mode 100644 recipes/rg-etc1/all/conandata.yml create mode 100644 recipes/rg-etc1/all/conanfile.py create mode 100644 recipes/rg-etc1/all/test_package/CMakeLists.txt create mode 100644 recipes/rg-etc1/all/test_package/conanfile.py create mode 100644 recipes/rg-etc1/all/test_package/test_package.cpp create mode 100644 recipes/rg-etc1/config.yml create mode 100644 recipes/rgbcx/all/conandata.yml create mode 100644 recipes/rgbcx/all/conanfile.py create mode 100644 recipes/rgbcx/all/test_package/CMakeLists.txt create mode 100644 recipes/rgbcx/all/test_package/conanfile.py create mode 100644 recipes/rgbcx/all/test_package/test_package.cpp create mode 100644 recipes/rgbcx/config.yml create mode 100644 recipes/ring-span-lite/all/conandata.yml create mode 100644 recipes/ring-span-lite/all/conanfile.py create mode 100644 recipes/ring-span-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/ring-span-lite/all/test_package/conanfile.py create mode 100644 recipes/ring-span-lite/all/test_package/test_package.cpp create mode 100644 recipes/ring-span-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ring-span-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/ring-span-lite/config.yml create mode 100644 recipes/rmlui/3.3/CMakeLists.txt create mode 100644 recipes/rmlui/3.3/conandata.yml create mode 100644 recipes/rmlui/3.3/conanfile.py create mode 100644 recipes/rmlui/3.3/test_package/CMakeLists.txt create mode 100644 recipes/rmlui/3.3/test_package/conanfile.py create mode 100644 recipes/rmlui/3.3/test_package/example.cpp create mode 100644 recipes/rmlui/4.x/CMakeLists.txt create mode 100644 recipes/rmlui/4.x/conandata.yml create mode 100644 recipes/rmlui/4.x/conanfile.py create mode 100644 recipes/rmlui/4.x/patches/4.0-fix-cmake-targets-and-config.patch create mode 100644 recipes/rmlui/4.x/patches/4.1-fix-cmake-targets-and-config.patch create mode 100644 recipes/rmlui/4.x/patches/4.2-fix-cmake-targets-and-config.patch create mode 100644 recipes/rmlui/4.x/patches/4.3-fix-cmake-targets-and-config.patch create mode 100644 recipes/rmlui/4.x/patches/4.4-fix-cmake-targets-and-config.patch create mode 100644 recipes/rmlui/4.x/test_package/CMakeLists.txt create mode 100644 recipes/rmlui/4.x/test_package/conanfile.py create mode 100644 recipes/rmlui/4.x/test_package/example.cpp create mode 100644 recipes/rmlui/4.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/rmlui/4.x/test_v1_package/conanfile.py create mode 100644 recipes/rmlui/config.yml create mode 100644 recipes/roaring/all/conandata.yml create mode 100644 recipes/roaring/all/conanfile.py create mode 100644 recipes/roaring/all/test_package/CMakeLists.txt create mode 100644 recipes/roaring/all/test_package/conanfile.py create mode 100644 recipes/roaring/all/test_package/test_package.cpp create mode 100644 recipes/roaring/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/roaring/all/test_v1_package/conanfile.py create mode 100644 recipes/roaring/config.yml create mode 100644 recipes/robin-hood-hashing/all/conandata.yml create mode 100644 recipes/robin-hood-hashing/all/conanfile.py create mode 100644 recipes/robin-hood-hashing/all/patches/3.11.1-0001-fix-missing-limits-include.patch create mode 100644 recipes/robin-hood-hashing/all/patches/3.7.0-0001-fix-missing-limits-include.patch create mode 100644 recipes/robin-hood-hashing/all/patches/3.8.0-0001-fix-missing-limits-include.patch create mode 100644 recipes/robin-hood-hashing/all/patches/3.9.1-0001-fix-missing-limits-include.patch create mode 100644 recipes/robin-hood-hashing/all/test_package/CMakeLists.txt create mode 100644 recipes/robin-hood-hashing/all/test_package/conanfile.py create mode 100644 recipes/robin-hood-hashing/all/test_package/test_package.cpp create mode 100644 recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/robin-hood-hashing/all/test_v1_package/conanfile.py create mode 100644 recipes/robin-hood-hashing/config.yml create mode 100644 recipes/rocksdb/all/CMakeLists.txt create mode 100644 recipes/rocksdb/all/conandata.yml create mode 100644 recipes/rocksdb/all/conanfile.py create mode 100644 recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch create mode 100644 recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch create mode 100644 recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch create mode 100644 recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch create mode 100644 recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch create mode 100644 recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch create mode 100644 recipes/rocksdb/all/test_package/CMakeLists.txt create mode 100644 recipes/rocksdb/all/test_package/conanfile.py create mode 100644 recipes/rocksdb/all/test_package/test_package.cpp create mode 100644 recipes/rocksdb/all/test_package/test_package_stable_abi.cpp create mode 100644 recipes/rocksdb/config.yml create mode 100644 recipes/rotor/all/CMakeLists.txt create mode 100644 recipes/rotor/all/conandata.yml create mode 100644 recipes/rotor/all/conanfile.py create mode 100644 recipes/rotor/all/test_package/CMakeLists.txt create mode 100644 recipes/rotor/all/test_package/conanfile.py create mode 100644 recipes/rotor/all/test_package/test_package.cpp create mode 100644 recipes/rotor/config.yml create mode 100644 recipes/rpclib/all/CMakeLists.txt create mode 100644 recipes/rpclib/all/conandata.yml create mode 100644 recipes/rpclib/all/conanfile.py create mode 100644 recipes/rpclib/all/test_package/CMakeLists.txt create mode 100644 recipes/rpclib/all/test_package/conanfile.py create mode 100644 recipes/rpclib/all/test_package/example.cpp create mode 100644 recipes/rpclib/config.yml create mode 100644 recipes/rply/all/CMakeLists.txt create mode 100644 recipes/rply/all/conandata.yml create mode 100644 recipes/rply/all/conanfile.py create mode 100644 recipes/rply/all/test_package/CMakeLists.txt create mode 100644 recipes/rply/all/test_package/conanfile.py create mode 100644 recipes/rply/all/test_package/test_package.c create mode 100644 recipes/rply/all/test_package/triangle.ply create mode 100644 recipes/rply/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rply/all/test_v1_package/conanfile.py create mode 100644 recipes/rply/config.yml create mode 100644 recipes/rtm/all/conandata.yml create mode 100644 recipes/rtm/all/conanfile.py create mode 100644 recipes/rtm/all/test_package/CMakeLists.txt create mode 100644 recipes/rtm/all/test_package/conanfile.py create mode 100644 recipes/rtm/all/test_package/test_package.cpp create mode 100644 recipes/rtm/config.yml create mode 100644 recipes/rtmidi/all/conandata.yml create mode 100644 recipes/rtmidi/all/conanfile.py create mode 100644 recipes/rtmidi/all/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch create mode 100644 recipes/rtmidi/all/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch create mode 100644 recipes/rtmidi/all/patches/4.0.0-0003-relocatable-macos.patch create mode 100644 recipes/rtmidi/all/test_package/CMakeLists.txt create mode 100644 recipes/rtmidi/all/test_package/conanfile.py create mode 100644 recipes/rtmidi/all/test_package/test_package.cpp create mode 100644 recipes/rtmidi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rtmidi/all/test_v1_package/conanfile.py create mode 100644 recipes/rtmidi/config.yml create mode 100644 recipes/rttr/all/conandata.yml create mode 100644 recipes/rttr/all/conanfile.py create mode 100644 recipes/rttr/all/patches/001_fix_build_without_RTTI.patch create mode 100644 recipes/rttr/all/patches/002_fix_license_installer.patch create mode 100644 recipes/rttr/all/test_package/CMakeLists.txt create mode 100644 recipes/rttr/all/test_package/conanfile.py create mode 100644 recipes/rttr/all/test_package/test_package.cpp create mode 100644 recipes/rttr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rttr/all/test_v1_package/conanfile.py create mode 100644 recipes/rttr/config.yml create mode 100644 recipes/ruby/all/conandata.yml create mode 100644 recipes/ruby/all/conanfile.py create mode 100644 recipes/ruby/all/patches/0001-darwin-includedir.patch create mode 100644 recipes/ruby/all/patches/0002-remove-fpic.patch create mode 100644 recipes/ruby/all/patches/0003-openssl-ext.patch create mode 100644 recipes/ruby/all/patches/0004-windows-cflags.patch create mode 100644 recipes/ruby/all/test_package/CMakeLists.txt create mode 100644 recipes/ruby/all/test_package/conanfile.py create mode 100644 recipes/ruby/all/test_package/test_package.c create mode 100644 recipes/ruby/config.yml create mode 100644 recipes/runtimeqml/all/CMakeLists.txt create mode 100644 recipes/runtimeqml/all/conandata.yml create mode 100644 recipes/runtimeqml/all/conanfile.py create mode 100644 recipes/runtimeqml/all/test_package/CMakeLists.txt create mode 100644 recipes/runtimeqml/all/test_package/conanfile.py create mode 100644 recipes/runtimeqml/all/test_package/test_package.cpp create mode 100644 recipes/runtimeqml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/runtimeqml/all/test_v1_package/conanfile.py create mode 100644 recipes/runtimeqml/config.yml create mode 100644 recipes/ruy/all/conandata.yml create mode 100644 recipes/ruy/all/conanfile.py create mode 100644 recipes/ruy/all/test_package/CMakeLists.txt create mode 100644 recipes/ruy/all/test_package/conanfile.py create mode 100644 recipes/ruy/all/test_package/test_package.cpp create mode 100644 recipes/ruy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ruy/all/test_v1_package/conanfile.py create mode 100644 recipes/ruy/all/test_v1_package/test_package.cpp create mode 100644 recipes/ruy/config.yml create mode 100644 recipes/rvo2/all/CMakeLists.txt create mode 100644 recipes/rvo2/all/conandata.yml create mode 100644 recipes/rvo2/all/conanfile.py create mode 100644 recipes/rvo2/all/test_package/CMakeLists.txt create mode 100644 recipes/rvo2/all/test_package/conanfile.py create mode 100644 recipes/rvo2/all/test_package/test_package.cpp create mode 100644 recipes/rvo2/config.yml create mode 100644 recipes/rxcpp/all/conandata.yml create mode 100644 recipes/rxcpp/all/conanfile.py create mode 100644 recipes/rxcpp/all/test_package/CMakeLists.txt create mode 100644 recipes/rxcpp/all/test_package/conanfile.py create mode 100644 recipes/rxcpp/all/test_package/test_package.cpp create mode 100644 recipes/rxcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rxcpp/all/test_v1_package/conanfile.py create mode 100644 recipes/rxcpp/config.yml create mode 100644 recipes/s2let/all/CMakeLists.txt create mode 100644 recipes/s2let/all/conandata.yml create mode 100644 recipes/s2let/all/conanfile.py create mode 100644 recipes/s2let/all/test_package/CMakeLists.txt create mode 100644 recipes/s2let/all/test_package/conanfile.py create mode 100644 recipes/s2let/all/test_package/example.c create mode 100644 recipes/s2let/config.yml create mode 100644 recipes/s2n/all/CMakeLists.txt create mode 100644 recipes/s2n/all/conandata.yml create mode 100644 recipes/s2n/all/conanfile.py create mode 100644 recipes/s2n/all/patches/1.0.11/001-try-compile.patch create mode 100644 recipes/s2n/all/patches/1.1.0/001-try-compile.patch create mode 100644 recipes/s2n/all/test_package/CMakeLists.txt create mode 100644 recipes/s2n/all/test_package/conanfile.py create mode 100644 recipes/s2n/all/test_package/test_package.c create mode 100644 recipes/s2n/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/s2n/all/test_v1_package/conanfile.py create mode 100644 recipes/s2n/config.yml create mode 100644 recipes/safeint/all/conandata.yml create mode 100644 recipes/safeint/all/conanfile.py create mode 100644 recipes/safeint/all/test_package/CMakeLists.txt create mode 100644 recipes/safeint/all/test_package/conanfile.py create mode 100644 recipes/safeint/all/test_package/test_package.cpp create mode 100644 recipes/safeint/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/safeint/all/test_v1_package/conanfile.py create mode 100644 recipes/safeint/config.yml create mode 100644 recipes/sail/all/conandata.yml create mode 100644 recipes/sail/all/conanfile.py create mode 100644 recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch create mode 100644 recipes/sail/all/test_package/CMakeLists.txt create mode 100644 recipes/sail/all/test_package/bmp.bmp create mode 100644 recipes/sail/all/test_package/conanfile.py create mode 100644 recipes/sail/all/test_package/test_package.c create mode 100644 recipes/sail/all/test_package/test_package.cpp create mode 100644 recipes/sail/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sail/all/test_v1_package/bmp.bmp create mode 100644 recipes/sail/all/test_v1_package/conanfile.py create mode 100644 recipes/sail/config.yml create mode 100644 recipes/samarium/all/conandata.yml create mode 100644 recipes/samarium/all/conanfile.py create mode 100644 recipes/samarium/all/patches/1.0.0-Grid.hpp-include-vector.patch create mode 100644 recipes/samarium/all/patches/1.0.0-RandomGenerator.cpp-link.patch create mode 100644 recipes/samarium/all/patches/1.0.0-RandomGenerator.hpp-link.patch create mode 100644 recipes/samarium/all/patches/1.0.0-updated-cmake.patch create mode 100644 recipes/samarium/all/test_package/CMakeLists.txt create mode 100644 recipes/samarium/all/test_package/conanfile.py create mode 100644 recipes/samarium/all/test_package/test_package.cpp create mode 100644 recipes/samarium/config.yml create mode 100644 recipes/sassc/all/conandata.yml create mode 100644 recipes/sassc/all/conanfile.py create mode 100644 recipes/sassc/all/test_package/conanfile.py create mode 100644 recipes/sassc/config.yml create mode 100644 recipes/sbp/all/CMakeLists.txt create mode 100644 recipes/sbp/all/conandata.yml create mode 100644 recipes/sbp/all/conanfile.py create mode 100644 recipes/sbp/all/test_package/CMakeLists.txt create mode 100644 recipes/sbp/all/test_package/conanfile.py create mode 100644 recipes/sbp/all/test_package/test_package.c create mode 100644 recipes/sbp/config.yml create mode 100644 recipes/scc/all/CMakeLists.txt create mode 100644 recipes/scc/all/conandata.yml create mode 100644 recipes/scc/all/conanfile.py create mode 100644 recipes/scc/all/test_package/CMakeLists.txt create mode 100644 recipes/scc/all/test_package/conanfile.py create mode 100644 recipes/scc/all/test_package/example.cpp create mode 100644 recipes/scc/config.yml create mode 100644 recipes/scdoc/all/conandata.yml create mode 100644 recipes/scdoc/all/conanfile.py create mode 100644 recipes/scdoc/all/test_package/conanfile.py create mode 100644 recipes/scdoc/all/test_package/test_package.1.scd create mode 100644 recipes/scdoc/config.yml create mode 100644 recipes/scnlib/all/conandata.yml create mode 100644 recipes/scnlib/all/conanfile.py create mode 100644 recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch create mode 100644 recipes/scnlib/all/patches/1.0-0001-install-dll-windows.patch create mode 100644 recipes/scnlib/all/patches/1.0-0002-remove-header-only-target.patch create mode 100644 recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch create mode 100644 recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch create mode 100644 recipes/scnlib/all/patches/1.1.2-0002-remove-header-only-target.patch create mode 100644 recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch create mode 100644 recipes/scnlib/all/test_package/CMakeLists.txt create mode 100644 recipes/scnlib/all/test_package/conanfile.py create mode 100644 recipes/scnlib/all/test_package/test_package.cpp create mode 100644 recipes/scnlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/scnlib/all/test_v1_package/conanfile.py create mode 100644 recipes/scnlib/config.yml create mode 100644 recipes/scons/all/conandata.yml create mode 100644 recipes/scons/all/conanfile.py create mode 100644 recipes/scons/all/test_package/SConscript create mode 100644 recipes/scons/all/test_package/SConstruct create mode 100644 recipes/scons/all/test_package/conanfile.py create mode 100644 recipes/scons/all/test_package/test_package.c create mode 100644 recipes/scons/config.yml create mode 100644 recipes/scope-lite/all/conandata.yml create mode 100644 recipes/scope-lite/all/conanfile.py create mode 100644 recipes/scope-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/scope-lite/all/test_package/conanfile.py create mode 100644 recipes/scope-lite/all/test_package/test_package.cpp create mode 100644 recipes/scope-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/scope-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/scope-lite/config.yml create mode 100644 recipes/screen_capture_lite/all/conandata.yml create mode 100644 recipes/screen_capture_lite/all/conanfile.py create mode 100644 recipes/screen_capture_lite/all/patches/17.1.439-0001-fix-cmake.patch create mode 100644 recipes/screen_capture_lite/all/patches/17.1.462-0001-fix-cmake.patch create mode 100644 recipes/screen_capture_lite/all/test_package/CMakeLists.txt create mode 100644 recipes/screen_capture_lite/all/test_package/conanfile.py create mode 100644 recipes/screen_capture_lite/all/test_package/test_package.cpp create mode 100644 recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/screen_capture_lite/all/test_v1_package/conanfile.py create mode 100644 recipes/screen_capture_lite/config.yml create mode 100644 recipes/sdbus-cpp/all/conandata.yml create mode 100644 recipes/sdbus-cpp/all/conanfile.py create mode 100644 recipes/sdbus-cpp/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch create mode 100644 recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch create mode 100644 recipes/sdbus-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/sdbus-cpp/all/test_package/conanfile.py create mode 100644 recipes/sdbus-cpp/all/test_package/example.cpp create mode 100644 recipes/sdbus-cpp/all/test_pkgconf/CMakeLists.txt create mode 100644 recipes/sdbus-cpp/all/test_pkgconf/conanfile.py create mode 100644 recipes/sdbus-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdbus-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/sdbus-cpp/all/test_v1_pkgconf/CMakeLists.txt create mode 100644 recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py create mode 100644 recipes/sdbus-cpp/config.yml create mode 100644 recipes/sdf/all/conandata.yml create mode 100644 recipes/sdf/all/conanfile.py create mode 100644 recipes/sdf/all/test_package/CMakeLists.txt create mode 100644 recipes/sdf/all/test_package/conanfile.py create mode 100644 recipes/sdf/all/test_package/test.png create mode 100644 recipes/sdf/all/test_package/test_package.c create mode 100644 recipes/sdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdf/all/test_v1_package/conanfile.py create mode 100644 recipes/sdf/config.yml create mode 100644 recipes/sdl/all/conandata.yml create mode 100644 recipes/sdl/all/conanfile.py create mode 100644 recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch create mode 100644 recipes/sdl/all/patches/0002-mingw-improvements.patch create mode 100644 recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch create mode 100644 recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch create mode 100644 recipes/sdl/all/patches/0004-2.0.20-ndk.patch create mode 100644 recipes/sdl/all/test_package/CMakeLists.txt create mode 100644 recipes/sdl/all/test_package/conanfile.py create mode 100644 recipes/sdl/all/test_package/test_package.cpp create mode 100644 recipes/sdl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdl/all/test_v1_package/conanfile.py create mode 100644 recipes/sdl/all/test_v1_package/test_package.cpp create mode 100644 recipes/sdl/config.yml create mode 100644 recipes/sdl_image/all/CMakeLists.txt create mode 100644 recipes/sdl_image/all/conandata.yml create mode 100644 recipes/sdl_image/all/conanfile.py create mode 100644 recipes/sdl_image/all/test_package/CMakeLists.txt create mode 100644 recipes/sdl_image/all/test_package/conanfile.py create mode 100644 recipes/sdl_image/all/test_package/test_package.c create mode 100644 recipes/sdl_image/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdl_image/all/test_v1_package/conanfile.py create mode 100644 recipes/sdl_image/config.yml create mode 100644 recipes/sdl_mixer/all/CMakeLists.txt create mode 100644 recipes/sdl_mixer/all/conandata.yml create mode 100644 recipes/sdl_mixer/all/conanfile.py create mode 100644 recipes/sdl_mixer/all/test_package/CMakeLists.txt create mode 100644 recipes/sdl_mixer/all/test_package/conanfile.py create mode 100644 recipes/sdl_mixer/all/test_package/test_package.c create mode 100644 recipes/sdl_mixer/config.yml create mode 100644 recipes/sdl_net/all/CMakeLists.txt create mode 100644 recipes/sdl_net/all/conandata.yml create mode 100644 recipes/sdl_net/all/conanfile.py create mode 100644 recipes/sdl_net/all/test_package/CMakeLists.txt create mode 100644 recipes/sdl_net/all/test_package/conanfile.py create mode 100644 recipes/sdl_net/all/test_package/test_package.c create mode 100644 recipes/sdl_net/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdl_net/all/test_v1_package/conanfile.py create mode 100644 recipes/sdl_net/config.yml create mode 100644 recipes/sdl_ttf/all/conandata.yml create mode 100644 recipes/sdl_ttf/all/conanfile.py create mode 100644 recipes/sdl_ttf/all/patches/2.0.15-0001-cmake-fix-link-target.patch create mode 100644 recipes/sdl_ttf/all/patches/2.0.18-0001-cmake-fix-link-target.patch create mode 100644 recipes/sdl_ttf/all/patches/2.0.18-0002-fix-android.patch create mode 100644 recipes/sdl_ttf/all/patches/2.20.1-0001-fix-cmake-min-version.patch create mode 100644 recipes/sdl_ttf/all/test_package/CMakeLists.txt create mode 100644 recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf create mode 100644 recipes/sdl_ttf/all/test_package/conanfile.py create mode 100644 recipes/sdl_ttf/all/test_package/test_package.c create mode 100644 recipes/sdl_ttf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdl_ttf/all/test_v1_package/conanfile.py create mode 100644 recipes/sdl_ttf/config.yml create mode 100644 recipes/seadex-essentials/all/conandata.yml create mode 100644 recipes/seadex-essentials/all/conanfile.py create mode 100644 recipes/seadex-essentials/all/test_package/CMakeLists.txt create mode 100644 recipes/seadex-essentials/all/test_package/conanfile.py create mode 100644 recipes/seadex-essentials/all/test_package/test_package.cpp create mode 100644 recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/seadex-essentials/all/test_v1_package/conanfile.py create mode 100644 recipes/seadex-essentials/config.yml create mode 100644 recipes/seasocks/all/CMakeLists.txt create mode 100644 recipes/seasocks/all/conandata.yml create mode 100644 recipes/seasocks/all/conanfile.py create mode 100644 recipes/seasocks/all/test_package/CMakeLists.txt create mode 100644 recipes/seasocks/all/test_package/conanfile.py create mode 100644 recipes/seasocks/all/test_package/test_package.cpp create mode 100644 recipes/seasocks/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/seasocks/all/test_v1_package/conanfile.py create mode 100644 recipes/seasocks/config.yml create mode 100644 recipes/semimap/all/conandata.yml create mode 100644 recipes/semimap/all/conanfile.py create mode 100644 recipes/semimap/all/test_package/CMakeLists.txt create mode 100644 recipes/semimap/all/test_package/conanfile.py create mode 100644 recipes/semimap/all/test_package/test_package.cpp create mode 100644 recipes/semimap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/semimap/all/test_v1_package/conanfile.py create mode 100644 recipes/semimap/config.yml create mode 100644 recipes/semver.c/all/CMakeLists.txt create mode 100644 recipes/semver.c/all/conandata.yml create mode 100644 recipes/semver.c/all/conanfile.py create mode 100644 recipes/semver.c/all/test_package/CMakeLists.txt create mode 100644 recipes/semver.c/all/test_package/conanfile.py create mode 100644 recipes/semver.c/all/test_package/test_package.c create mode 100644 recipes/semver.c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/semver.c/all/test_v1_package/conanfile.py create mode 100644 recipes/semver.c/config.yml create mode 100644 recipes/sentry-breakpad/all/CMakeLists.txt create mode 100644 recipes/sentry-breakpad/all/conandata.yml create mode 100644 recipes/sentry-breakpad/all/conanfile.py create mode 100644 recipes/sentry-breakpad/all/test_package/CMakeLists.txt create mode 100644 recipes/sentry-breakpad/all/test_package/conanfile.py create mode 100644 recipes/sentry-breakpad/all/test_package/test_package.cpp create mode 100644 recipes/sentry-breakpad/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sentry-breakpad/all/test_v1_package/conanfile.py create mode 100644 recipes/sentry-breakpad/config.yml create mode 100644 recipes/sentry-crashpad/all/conandata.yml create mode 100644 recipes/sentry-crashpad/all/conanfile.py create mode 100644 recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch create mode 100644 recipes/sentry-crashpad/all/test_package/CMakeLists.txt create mode 100644 recipes/sentry-crashpad/all/test_package/conanfile.py create mode 100644 recipes/sentry-crashpad/all/test_package/test_package.cpp create mode 100644 recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sentry-crashpad/all/test_v1_package/conanfile.py create mode 100644 recipes/sentry-crashpad/config.yml create mode 100644 recipes/sentry-native/all/conandata.yml create mode 100644 recipes/sentry-native/all/conanfile.py create mode 100644 recipes/sentry-native/all/patches/sentry-native-903c17a.patch create mode 100644 recipes/sentry-native/all/test_package/CMakeLists.txt create mode 100644 recipes/sentry-native/all/test_package/conanfile.py create mode 100644 recipes/sentry-native/all/test_package/test_package.cpp create mode 100644 recipes/sentry-native/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sentry-native/all/test_v1_package/conanfile.py create mode 100644 recipes/sentry-native/config.yml create mode 100644 recipes/seqan/2.x.x/conandata.yml create mode 100644 recipes/seqan/2.x.x/conanfile.py create mode 100644 recipes/seqan/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/seqan/2.x.x/test_package/conanfile.py create mode 100644 recipes/seqan/2.x.x/test_package/test_package.cpp create mode 100644 recipes/seqan/config.yml create mode 100644 recipes/seqan3/all/conandata.yml create mode 100644 recipes/seqan3/all/conanfile.py create mode 100644 recipes/seqan3/all/test_package/CMakeLists.txt create mode 100644 recipes/seqan3/all/test_package/conanfile.py create mode 100644 recipes/seqan3/all/test_package/test_package.cpp create mode 100644 recipes/seqan3/config.yml create mode 100644 recipes/serd/all/conandata.yml create mode 100644 recipes/serd/all/conanfile.py create mode 100644 recipes/serd/all/test_package/CMakeLists.txt create mode 100644 recipes/serd/all/test_package/conanfile.py create mode 100644 recipes/serd/all/test_package/test_package.c create mode 100644 recipes/serd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/serd/all/test_v1_package/conanfile.py create mode 100644 recipes/serd/config.yml create mode 100644 recipes/serdepp/all/conandata.yml create mode 100644 recipes/serdepp/all/conanfile.py create mode 100644 recipes/serdepp/all/test_package/CMakeLists.txt create mode 100644 recipes/serdepp/all/test_package/conanfile.py create mode 100644 recipes/serdepp/all/test_package/test_package.cpp create mode 100644 recipes/serdepp/config.yml create mode 100644 recipes/serf/all/CMakeLists.txt create mode 100644 recipes/serf/all/conandata.yml create mode 100644 recipes/serf/all/conanfile.py create mode 100644 recipes/serf/all/patches/0001-1.3.9-scons-python3.patch create mode 100644 recipes/serf/all/patches/0002-1.3.9-scons-respect-flags.patch create mode 100644 recipes/serf/all/patches/0003-1.3.9-scons-msvc.patch create mode 100644 recipes/serf/all/patches/0004-1.3.9-scons-python-spaces.patch create mode 100644 recipes/serf/all/patches/0005-1.3.9-serf-openssl-3.x.patch create mode 100644 recipes/serf/all/test_package/CMakeLists.txt create mode 100644 recipes/serf/all/test_package/conanfile.py create mode 100644 recipes/serf/all/test_package/test_package.c create mode 100644 recipes/serf/config.yml create mode 100644 recipes/serial/all/CMakeLists.txt create mode 100644 recipes/serial/all/Findcatkin.cmake create mode 100644 recipes/serial/all/conandata.yml create mode 100644 recipes/serial/all/conanfile.py create mode 100644 recipes/serial/all/test_package/CMakeLists.txt create mode 100644 recipes/serial/all/test_package/conanfile.py create mode 100644 recipes/serial/all/test_package/test_package.cpp create mode 100644 recipes/serial/config.yml create mode 100644 recipes/sfml/all/conandata.yml create mode 100644 recipes/sfml/all/conanfile.py create mode 100644 recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch create mode 100644 recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch create mode 100644 recipes/sfml/all/patches/0003-allow-shared-MT.patch create mode 100644 recipes/sfml/all/patches/0004-fix-ios.patch create mode 100644 recipes/sfml/all/patches/0005-remove-auto-ptr.patch create mode 100644 recipes/sfml/all/test_package/CMakeLists.txt create mode 100644 recipes/sfml/all/test_package/conanfile.py create mode 100644 recipes/sfml/all/test_package/test_package.cpp create mode 100644 recipes/sfml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sfml/all/test_v1_package/conanfile.py create mode 100644 recipes/sfml/config.yml create mode 100644 recipes/shaderc/all/CMakeLists.txt create mode 100644 recipes/shaderc/all/conandata.yml create mode 100644 recipes/shaderc/all/conanfile.py create mode 100644 recipes/shaderc/all/patches/2019.0/fix-cmake.patch create mode 100644 recipes/shaderc/all/patches/2019.0/fix-spvc.patch create mode 100644 recipes/shaderc/all/patches/2021.1/fix-cmake.patch create mode 100644 recipes/shaderc/all/test_package/CMakeLists.txt create mode 100644 recipes/shaderc/all/test_package/conanfile.py create mode 100644 recipes/shaderc/all/test_package/test_package.vert create mode 100644 recipes/shaderc/all/test_package/test_package_shaderc.c create mode 100644 recipes/shaderc/all/test_package/test_package_shaderc.cpp create mode 100644 recipes/shaderc/all/test_package/test_package_spvc.c create mode 100644 recipes/shaderc/all/test_package/test_package_spvc.cpp create mode 100644 recipes/shaderc/config.yml create mode 100644 recipes/shapelib/all/conandata.yml create mode 100644 recipes/shapelib/all/conanfile.py create mode 100644 recipes/shapelib/all/patches/0001-cmake-minimum-required.patch create mode 100644 recipes/shapelib/all/patches/0002-build-testing.patch create mode 100644 recipes/shapelib/all/test_package/CMakeLists.txt create mode 100644 recipes/shapelib/all/test_package/conanfile.py create mode 100644 recipes/shapelib/all/test_package/test_package.c create mode 100644 recipes/shapelib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/shapelib/all/test_v1_package/conanfile.py create mode 100644 recipes/shapelib/config.yml create mode 100644 recipes/shield/all/conandata.yml create mode 100644 recipes/shield/all/conanfile.py create mode 100644 recipes/shield/all/test_package/CMakeLists.txt create mode 100644 recipes/shield/all/test_package/conanfile.py create mode 100644 recipes/shield/all/test_package/test_package.cpp create mode 100644 recipes/shield/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/shield/all/test_v1_package/conanfile.py create mode 100644 recipes/shield/config.yml create mode 100644 recipes/si/all/CMakeLists.txt create mode 100644 recipes/si/all/conandata.yml create mode 100644 recipes/si/all/conanfile.py create mode 100644 recipes/si/all/test_package/CMakeLists.txt create mode 100644 recipes/si/all/test_package/conanfile.py create mode 100644 recipes/si/all/test_package/si_package_test.cpp create mode 100644 recipes/si/config.yml create mode 100644 recipes/sigslot/all/conandata.yml create mode 100644 recipes/sigslot/all/conanfile.py create mode 100644 recipes/sigslot/all/test_package/CMakeLists.txt create mode 100644 recipes/sigslot/all/test_package/conanfile.py create mode 100644 recipes/sigslot/all/test_package/test_package.cpp create mode 100644 recipes/sigslot/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sigslot/all/test_v1_package/conanfile.py create mode 100644 recipes/sigslot/config.yml create mode 100644 recipes/simdjson/all/conandata.yml create mode 100644 recipes/simdjson/all/conanfile.py create mode 100644 recipes/simdjson/all/test_package/CMakeLists.txt create mode 100644 recipes/simdjson/all/test_package/conanfile.py create mode 100644 recipes/simdjson/all/test_package/test_package.cpp create mode 100644 recipes/simdjson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/simdjson/all/test_v1_package/conanfile.py create mode 100644 recipes/simdjson/config.yml create mode 100644 recipes/simdutf/all/conandata.yml create mode 100644 recipes/simdutf/all/conanfile.py create mode 100644 recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch create mode 100644 recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch create mode 100644 recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch create mode 100644 recipes/simdutf/all/test_package/CMakeLists.txt create mode 100644 recipes/simdutf/all/test_package/conanfile.py create mode 100644 recipes/simdutf/all/test_package/test_package.cpp create mode 100644 recipes/simdutf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/simdutf/all/test_v1_package/conanfile.py create mode 100644 recipes/simdutf/config.yml create mode 100644 recipes/simple-websocket-server/all/conandata.yml create mode 100644 recipes/simple-websocket-server/all/conanfile.py create mode 100644 recipes/simple-websocket-server/all/test_package/CMakeLists.txt create mode 100644 recipes/simple-websocket-server/all/test_package/conanfile.py create mode 100644 recipes/simple-websocket-server/all/test_package/test_package.cpp create mode 100644 recipes/simple-websocket-server/config.yml create mode 100644 recipes/simple-yaml/all/conandata.yml create mode 100644 recipes/simple-yaml/all/conanfile.py create mode 100644 recipes/simple-yaml/all/test_package/CMakeLists.txt create mode 100644 recipes/simple-yaml/all/test_package/conanfile.py create mode 100644 recipes/simple-yaml/all/test_package/src/test.cpp create mode 100644 recipes/simple-yaml/config.yml create mode 100644 recipes/sjson-cpp/all/conandata.yml create mode 100644 recipes/sjson-cpp/all/conanfile.py create mode 100644 recipes/sjson-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/sjson-cpp/all/test_package/conanfile.py create mode 100644 recipes/sjson-cpp/all/test_package/test_package.cpp create mode 100644 recipes/sjson-cpp/config.yml create mode 100644 recipes/skyr-url/all/CMakeLists.txt create mode 100644 recipes/skyr-url/all/conandata.yml create mode 100644 recipes/skyr-url/all/conanfile.py create mode 100644 recipes/skyr-url/all/patches/1.12.0-0001-fix-cmake.patch create mode 100644 recipes/skyr-url/all/patches/1.13.0-0001-fix-cmake.patch create mode 100644 recipes/skyr-url/all/test_package/CMakeLists.txt create mode 100644 recipes/skyr-url/all/test_package/conanfile.py create mode 100644 recipes/skyr-url/all/test_package/test_package.cpp create mode 100644 recipes/skyr-url/config.yml create mode 100644 recipes/sleef/all/CMakeLists.txt create mode 100644 recipes/sleef/all/conandata.yml create mode 100644 recipes/sleef/all/conanfile.py create mode 100644 recipes/sleef/all/test_package/CMakeLists.txt create mode 100644 recipes/sleef/all/test_package/conanfile.py create mode 100644 recipes/sleef/all/test_package/test_package.c create mode 100644 recipes/sleef/config.yml create mode 100644 recipes/sml/all/conandata.yml create mode 100644 recipes/sml/all/conanfile.py create mode 100644 recipes/sml/all/patches/0001-fix-clang12-error.patch create mode 100644 recipes/sml/all/test_package/CMakeLists.txt create mode 100644 recipes/sml/all/test_package/conanfile.py create mode 100644 recipes/sml/all/test_package/test_package.cpp create mode 100644 recipes/sml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sml/all/test_v1_package/conanfile.py create mode 100644 recipes/sml/config.yml create mode 100644 recipes/snappy/all/conandata.yml create mode 100644 recipes/snappy/all/conanfile.py create mode 100644 recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch create mode 100644 recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch create mode 100644 recipes/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch create mode 100644 recipes/snappy/all/patches/1.1.9-0002-no-Werror.patch create mode 100644 recipes/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch create mode 100644 recipes/snappy/all/patches/1.1.9-0004-rtti-by-default.patch create mode 100644 recipes/snappy/all/test_package/CMakeLists.txt create mode 100644 recipes/snappy/all/test_package/conanfile.py create mode 100644 recipes/snappy/all/test_package/test_package.c create mode 100644 recipes/snappy/all/test_package/test_package.cpp create mode 100644 recipes/snappy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/snappy/all/test_v1_package/conanfile.py create mode 100644 recipes/snappy/config.yml create mode 100644 recipes/snowhouse/all/conandata.yml create mode 100644 recipes/snowhouse/all/conanfile.py create mode 100644 recipes/snowhouse/all/test_package/CMakeLists.txt create mode 100644 recipes/snowhouse/all/test_package/conanfile.py create mode 100644 recipes/snowhouse/all/test_package/test_package.cpp create mode 100644 recipes/snowhouse/config.yml create mode 100644 recipes/so5extra/all/conandata.yml create mode 100644 recipes/so5extra/all/conanfile.py create mode 100644 recipes/so5extra/all/test_package/CMakeLists.txt create mode 100644 recipes/so5extra/all/test_package/conanfile.py create mode 100644 recipes/so5extra/all/test_package/test_package.cpp create mode 100644 recipes/so5extra/config.yml create mode 100644 recipes/sobjectizer/all/CMakeLists.txt create mode 100644 recipes/sobjectizer/all/conandata.yml create mode 100644 recipes/sobjectizer/all/conanfile.py create mode 100644 recipes/sobjectizer/all/test_package/CMakeLists.txt create mode 100644 recipes/sobjectizer/all/test_package/conanfile.py create mode 100644 recipes/sobjectizer/all/test_package/test_package.cpp create mode 100644 recipes/sobjectizer/config.yml create mode 100644 recipes/soci/all/conandata.yml create mode 100644 recipes/soci/all/conanfile.py create mode 100644 recipes/soci/all/patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch create mode 100644 recipes/soci/all/test_package/CMakeLists.txt create mode 100644 recipes/soci/all/test_package/conanfile.py create mode 100644 recipes/soci/all/test_package/test_package.cpp create mode 100644 recipes/soci/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/soci/all/test_v1_package/conanfile.py create mode 100644 recipes/soci/config.yml create mode 100644 recipes/sofa/all/CMakeLists.txt create mode 100644 recipes/sofa/all/conandata.yml create mode 100644 recipes/sofa/all/conanfile.py create mode 100644 recipes/sofa/all/test_package/CMakeLists.txt create mode 100644 recipes/sofa/all/test_package/conanfile.py create mode 100644 recipes/sofa/all/test_package/test_package.c create mode 100644 recipes/sofa/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sofa/all/test_v1_package/conanfile.py create mode 100644 recipes/sofa/config.yml create mode 100644 recipes/sokol/all/conandata.yml create mode 100644 recipes/sokol/all/conanfile.py create mode 100644 recipes/sokol/all/test_package/CMakeLists.txt create mode 100644 recipes/sokol/all/test_package/conanfile.py create mode 100644 recipes/sokol/all/test_package/test_package.c create mode 100644 recipes/sokol/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sokol/all/test_v1_package/conanfile.py create mode 100644 recipes/sokol/config.yml create mode 100644 recipes/sol2/all/conandata.yml create mode 100644 recipes/sol2/all/conanfile.py create mode 100644 recipes/sol2/all/test_package/CMakeLists.txt create mode 100644 recipes/sol2/all/test_package/conanfile.py create mode 100644 recipes/sol2/all/test_package/test_package.cpp create mode 100644 recipes/sol2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sol2/all/test_v1_package/conanfile.py create mode 100644 recipes/sol2/config.yml create mode 100644 recipes/sole/all/conandata.yml create mode 100644 recipes/sole/all/conanfile.py create mode 100644 recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch create mode 100644 recipes/sole/all/test_package/CMakeLists.txt create mode 100644 recipes/sole/all/test_package/conanfile.py create mode 100644 recipes/sole/all/test_package/test_package.cpp create mode 100644 recipes/sole/config.yml create mode 100644 recipes/sophus/all/conandata.yml create mode 100644 recipes/sophus/all/conanfile.py create mode 100644 recipes/sophus/all/test_package/CMakeLists.txt create mode 100644 recipes/sophus/all/test_package/conanfile.py create mode 100644 recipes/sophus/all/test_package/test_package.cpp create mode 100644 recipes/sophus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sophus/all/test_v1_package/conanfile.py create mode 100644 recipes/sophus/config.yml create mode 100644 recipes/soplex/all/conandata.yml create mode 100644 recipes/soplex/all/conanfile.py create mode 100644 recipes/soplex/all/test_package/CMakeLists.txt create mode 100644 recipes/soplex/all/test_package/conanfile.py create mode 100644 recipes/soplex/all/test_package/main.cpp create mode 100644 recipes/soplex/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/soplex/all/test_v1_package/conanfile.py create mode 100644 recipes/soplex/config.yml create mode 100644 recipes/soundtouch/all/conandata.yml create mode 100644 recipes/soundtouch/all/conanfile.py create mode 100644 recipes/soundtouch/all/test_package/CMakeLists.txt create mode 100644 recipes/soundtouch/all/test_package/conanfile.py create mode 100644 recipes/soundtouch/all/test_package/test_package.cpp create mode 100644 recipes/soundtouch/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/soundtouch/all/test_v1_package/conanfile.py create mode 100644 recipes/soundtouch/config.yml create mode 100644 recipes/source_location/all/conandata.yml create mode 100644 recipes/source_location/all/conanfile.py create mode 100644 recipes/source_location/all/test_package/CMakeLists.txt create mode 100644 recipes/source_location/all/test_package/conanfile.py create mode 100644 recipes/source_location/all/test_package/src/test.cpp create mode 100644 recipes/source_location/config.yml create mode 100644 recipes/soxr/all/conandata.yml create mode 100644 recipes/soxr/all/conanfile.py create mode 100644 recipes/soxr/all/patches/0.1.3-0001-findpackage-openmp.patch create mode 100644 recipes/soxr/all/patches/0.1.3-0002-cmake-source-dir.patch create mode 100644 recipes/soxr/all/patches/0.1.3-0003-relocatable-macos.patch create mode 100644 recipes/soxr/all/test_package/CMakeLists.txt create mode 100644 recipes/soxr/all/test_package/conanfile.py create mode 100644 recipes/soxr/all/test_package/test_package_core.c create mode 100644 recipes/soxr/all/test_package/test_package_lsr.c create mode 100644 recipes/soxr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/soxr/all/test_v1_package/conanfile.py create mode 100644 recipes/soxr/config.yml create mode 100644 recipes/span-lite/all/conandata.yml create mode 100644 recipes/span-lite/all/conanfile.py create mode 100644 recipes/span-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/span-lite/all/test_package/conanfile.py create mode 100644 recipes/span-lite/all/test_package/test_package.cpp create mode 100644 recipes/span-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/span-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/span-lite/config.yml create mode 100644 recipes/spdlog/all/conandata.yml create mode 100644 recipes/spdlog/all/conanfile.py create mode 100644 recipes/spdlog/all/test_package/CMakeLists.txt create mode 100644 recipes/spdlog/all/test_package/conanfile.py create mode 100644 recipes/spdlog/all/test_package/test_package.cpp create mode 100644 recipes/spdlog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spdlog/all/test_v1_package/conanfile.py create mode 100644 recipes/spdlog/config.yml create mode 100644 recipes/spectra/all/conandata.yml create mode 100644 recipes/spectra/all/conanfile.py create mode 100644 recipes/spectra/all/test_package/CMakeLists.txt create mode 100644 recipes/spectra/all/test_package/conanfile.py create mode 100644 recipes/spectra/all/test_package/test_package.cpp create mode 100644 recipes/spectra/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spectra/all/test_v1_package/conanfile.py create mode 100644 recipes/spectra/config.yml create mode 100644 recipes/spirv-cross/all/conandata.yml create mode 100644 recipes/spirv-cross/all/conanfile.py create mode 100644 recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch create mode 100644 recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch create mode 100644 recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch create mode 100644 recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch create mode 100644 recipes/spirv-cross/all/test_package/CMakeLists.txt create mode 100644 recipes/spirv-cross/all/test_package/conanfile.py create mode 100644 recipes/spirv-cross/all/test_package/test_package.c create mode 100644 recipes/spirv-cross/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spirv-cross/all/test_v1_package/conanfile.py create mode 100644 recipes/spirv-cross/config.yml create mode 100644 recipes/spirv-headers/all/conandata.yml create mode 100644 recipes/spirv-headers/all/conanfile.py create mode 100644 recipes/spirv-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/spirv-headers/all/test_package/conanfile.py create mode 100644 recipes/spirv-headers/all/test_package/test_package.cpp create mode 100644 recipes/spirv-headers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spirv-headers/all/test_v1_package/conanfile.py create mode 100644 recipes/spirv-headers/config.yml create mode 100644 recipes/spirv-tools/all/conandata.yml create mode 100644 recipes/spirv-tools/all/conanfile.py create mode 100644 recipes/spirv-tools/all/test_package/CMakeLists.txt create mode 100644 recipes/spirv-tools/all/test_package/conanfile.py create mode 100644 recipes/spirv-tools/all/test_package/test_package.c create mode 100644 recipes/spirv-tools/all/test_package/test_package.cpp create mode 100644 recipes/spirv-tools/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spirv-tools/all/test_v1_package/conanfile.py create mode 100644 recipes/spirv-tools/config.yml create mode 100644 recipes/spix/all/conandata.yml create mode 100644 recipes/spix/all/conanfile.py create mode 100644 recipes/spix/all/patches/0001-use-conan-libs-0.4.patch create mode 100644 recipes/spix/all/patches/0001-use-conan-libs-0.5.patch create mode 100644 recipes/spix/all/test_package/CMakeLists.txt create mode 100644 recipes/spix/all/test_package/conanfile.py create mode 100644 recipes/spix/all/test_package/test_spix.cpp create mode 100644 recipes/spix/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spix/all/test_v1_package/conanfile.py create mode 100644 recipes/spix/config.yml create mode 100644 recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt create mode 100644 recipes/splunk-opentelemetry-cpp/all/conandata.yml create mode 100644 recipes/splunk-opentelemetry-cpp/all/conanfile.py create mode 100644 recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/splunk-opentelemetry-cpp/all/test_package/conanfile.py create mode 100644 recipes/splunk-opentelemetry-cpp/all/test_package/test_package.cpp create mode 100644 recipes/splunk-opentelemetry-cpp/config.yml create mode 100644 recipes/spscqueue/all/conandata.yml create mode 100644 recipes/spscqueue/all/conanfile.py create mode 100644 recipes/spscqueue/all/test_package/CMakeLists.txt create mode 100644 recipes/spscqueue/all/test_package/conanfile.py create mode 100644 recipes/spscqueue/all/test_package/test_package.cpp create mode 100644 recipes/spscqueue/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spscqueue/all/test_v1_package/conanfile.py create mode 100644 recipes/spscqueue/config.yml create mode 100644 recipes/spy/all/conandata.yml create mode 100644 recipes/spy/all/conanfile.py create mode 100644 recipes/spy/all/test_package/CMakeLists.txt create mode 100644 recipes/spy/all/test_package/conanfile.py create mode 100644 recipes/spy/all/test_package/test_package.cpp create mode 100644 recipes/spy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spy/all/test_v1_package/conanfile.py create mode 100644 recipes/spy/config.yml create mode 100644 recipes/sqlcipher/all/conandata.yml create mode 100644 recipes/sqlcipher/all/conanfile.py create mode 100644 recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.in-v4.4.3.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.msc-v4.4.0.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.msc-v4.4.2.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.msc-v4.4.3.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.msc-v4.5.0.patch create mode 100644 recipes/sqlcipher/all/patches/Makefile.msc-v4.5.1.patch create mode 100644 recipes/sqlcipher/all/patches/fix_configure-v4.3.0.patch create mode 100644 recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch create mode 100644 recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch create mode 100644 recipes/sqlcipher/all/patches/fix_configure-v4.4.3.patch create mode 100644 recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch create mode 100644 recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch create mode 100644 recipes/sqlcipher/all/test_package/CMakeLists.txt create mode 100644 recipes/sqlcipher/all/test_package/conanfile.py create mode 100644 recipes/sqlcipher/all/test_package/test_package.c create mode 100644 recipes/sqlcipher/config.yml create mode 100644 recipes/sqlite3/all/CMakeLists.txt create mode 100644 recipes/sqlite3/all/conandata.yml create mode 100644 recipes/sqlite3/all/conanfile.py create mode 100644 recipes/sqlite3/all/test_package/CMakeLists.txt create mode 100644 recipes/sqlite3/all/test_package/conanfile.py create mode 100644 recipes/sqlite3/all/test_package/empty_vfs.c create mode 100644 recipes/sqlite3/all/test_package/test_package.c create mode 100644 recipes/sqlite3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sqlite3/all/test_v1_package/conanfile.py create mode 100644 recipes/sqlite3/config.yml create mode 100644 recipes/sqlite_orm/all/conandata.yml create mode 100644 recipes/sqlite_orm/all/conanfile.py create mode 100644 recipes/sqlite_orm/all/patches/0001-declare-is-upsert-clause.patch create mode 100644 recipes/sqlite_orm/all/test_package/CMakeLists.txt create mode 100644 recipes/sqlite_orm/all/test_package/conanfile.py create mode 100644 recipes/sqlite_orm/all/test_package/test_package.cpp create mode 100644 recipes/sqlite_orm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sqlite_orm/all/test_v1_package/conanfile.py create mode 100644 recipes/sqlite_orm/config.yml create mode 100644 recipes/sqlitecpp/all/conandata.yml create mode 100644 recipes/sqlitecpp/all/conanfile.py create mode 100644 recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch create mode 100644 recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch create mode 100644 recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch create mode 100644 recipes/sqlitecpp/all/test_package/CMakeLists.txt create mode 100644 recipes/sqlitecpp/all/test_package/conanfile.py create mode 100644 recipes/sqlitecpp/all/test_package/test_package.cpp create mode 100644 recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sqlitecpp/all/test_v1_package/conanfile.py create mode 100644 recipes/sqlitecpp/config.yml create mode 100644 recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt create mode 100644 recipes/sqlpp11-connector-sqlite3/all/conandata.yml create mode 100644 recipes/sqlpp11-connector-sqlite3/all/conanfile.py create mode 100644 recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch create mode 100644 recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt create mode 100644 recipes/sqlpp11-connector-sqlite3/all/test_package/TabSample.h create mode 100644 recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py create mode 100644 recipes/sqlpp11-connector-sqlite3/all/test_package/test_package.cpp create mode 100644 recipes/sqlpp11-connector-sqlite3/config.yml create mode 100644 recipes/sqlpp11/all/conandata.yml create mode 100644 recipes/sqlpp11/all/conanfile.py create mode 100644 recipes/sqlpp11/all/test_package/CMakeLists.txt create mode 100644 recipes/sqlpp11/all/test_package/conanfile.py create mode 100644 recipes/sqlpp11/all/test_package/example.cpp create mode 100644 recipes/sqlpp11/config.yml create mode 100644 recipes/squirrel/all/conandata.yml create mode 100644 recipes/squirrel/all/conanfile.py create mode 100644 recipes/squirrel/all/patches/3.1-fix-cmake-static-shared.patch create mode 100644 recipes/squirrel/all/patches/3.2-fix-cmake-static-build.patch create mode 100644 recipes/squirrel/all/test_package/CMakeLists.txt create mode 100644 recipes/squirrel/all/test_package/conanfile.py create mode 100644 recipes/squirrel/all/test_package/test_package.cpp create mode 100644 recipes/squirrel/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/squirrel/all/test_v1_package/conanfile.py create mode 100644 recipes/squirrel/config.yml create mode 100644 recipes/srt/all/CMakeLists.txt create mode 100644 recipes/srt/all/conandata.yml create mode 100644 recipes/srt/all/conanfile.py create mode 100644 recipes/srt/all/patches/no-delayload-libeay32.patch create mode 100644 recipes/srt/all/test_package/CMakeLists.txt create mode 100644 recipes/srt/all/test_package/conanfile.py create mode 100644 recipes/srt/all/test_package/test_package.cpp create mode 100644 recipes/srt/config.yml create mode 100644 recipes/ssht/all/CMakeLists.txt create mode 100644 recipes/ssht/all/conandata.yml create mode 100644 recipes/ssht/all/conanfile.py create mode 100644 recipes/ssht/all/test_package/CMakeLists.txt create mode 100644 recipes/ssht/all/test_package/conanfile.py create mode 100644 recipes/ssht/all/test_package/example.c create mode 100644 recipes/ssht/config.yml create mode 100644 recipes/st_tree/all/conandata.yml create mode 100644 recipes/st_tree/all/conanfile.py create mode 100644 recipes/st_tree/all/test_package/CMakeLists.txt create mode 100644 recipes/st_tree/all/test_package/conanfile.py create mode 100644 recipes/st_tree/all/test_package/test_package.cpp create mode 100644 recipes/st_tree/config.yml create mode 100644 recipes/statslib/all/conandata.yml create mode 100644 recipes/statslib/all/conanfile.py create mode 100644 recipes/statslib/all/test_package/CMakeLists.txt create mode 100644 recipes/statslib/all/test_package/conanfile.py create mode 100644 recipes/statslib/all/test_package/test_package.cpp create mode 100644 recipes/statslib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/statslib/all/test_v1_package/conanfile.py create mode 100644 recipes/statslib/config.yml create mode 100644 recipes/status-code/all/conandata.yml create mode 100644 recipes/status-code/all/conanfile.py create mode 100644 recipes/status-code/all/test_package/CMakeLists.txt create mode 100644 recipes/status-code/all/test_package/conanfile.py create mode 100644 recipes/status-code/all/test_package/test_package.cpp create mode 100644 recipes/status-code/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/status-code/all/test_v1_package/conanfile.py create mode 100644 recipes/status-code/config.yml create mode 100644 recipes/status-value-lite/all/conandata.yml create mode 100644 recipes/status-value-lite/all/conanfile.py create mode 100644 recipes/status-value-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/status-value-lite/all/test_package/conanfile.py create mode 100644 recipes/status-value-lite/all/test_package/test_package.cpp create mode 100644 recipes/status-value-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/status-value-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/status-value-lite/config.yml create mode 100644 recipes/stb/all/conandata.yml create mode 100644 recipes/stb/all/conanfile.py create mode 100644 recipes/stb/all/test_package/CMakeLists.txt create mode 100644 recipes/stb/all/test_package/conanfile.py create mode 100644 recipes/stb/all/test_package/test_package.c create mode 100644 recipes/stb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/stb/all/test_v1_package/conanfile.py create mode 100644 recipes/stb/config.yml create mode 100644 recipes/stc/all/conandata.yml create mode 100644 recipes/stc/all/conanfile.py create mode 100644 recipes/stc/all/test_package/CMakeLists.txt create mode 100644 recipes/stc/all/test_package/conanfile.py create mode 100644 recipes/stc/all/test_package/test_package.c create mode 100644 recipes/stc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/stc/all/test_v1_package/conanfile.py create mode 100644 recipes/stc/config.yml create mode 100644 recipes/stduuid/all/conandata.yml create mode 100644 recipes/stduuid/all/conanfile.py create mode 100644 recipes/stduuid/all/test_package/CMakeLists.txt create mode 100644 recipes/stduuid/all/test_package/conanfile.py create mode 100644 recipes/stduuid/all/test_package/test_package.cpp create mode 100644 recipes/stduuid/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/stduuid/all/test_v1_package/conanfile.py create mode 100644 recipes/stduuid/config.yml create mode 100644 recipes/stlab/all/conandata.yml create mode 100644 recipes/stlab/all/conanfile.py create mode 100644 recipes/stlab/all/test_package/CMakeLists.txt create mode 100644 recipes/stlab/all/test_package/conanfile.py create mode 100644 recipes/stlab/all/test_package/test_package.cpp create mode 100644 recipes/stlab/config.yml create mode 100644 recipes/strawberryperl/all/conandata.yml create mode 100644 recipes/strawberryperl/all/conanfile.py create mode 100644 recipes/strawberryperl/all/test_package/conanfile.py create mode 100644 recipes/strawberryperl/all/test_package/list_files.pl create mode 100644 recipes/strawberryperl/all/test_v1_package/conanfile.py create mode 100644 recipes/strawberryperl/config.yml create mode 100644 recipes/string-view-lite/all/conandata.yml create mode 100644 recipes/string-view-lite/all/conanfile.py create mode 100644 recipes/string-view-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/string-view-lite/all/test_package/conanfile.py create mode 100644 recipes/string-view-lite/all/test_package/test_package.cpp create mode 100644 recipes/string-view-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/string-view-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/string-view-lite/config.yml create mode 100644 recipes/stringtoolbox/all/conandata.yml create mode 100644 recipes/stringtoolbox/all/conanfile.py create mode 100644 recipes/stringtoolbox/all/test_package/CMakeLists.txt create mode 100644 recipes/stringtoolbox/all/test_package/conanfile.py create mode 100644 recipes/stringtoolbox/all/test_package/test_package.cpp create mode 100644 recipes/stringtoolbox/config.yml create mode 100644 recipes/strong_type/all/conandata.yml create mode 100644 recipes/strong_type/all/conanfile.py create mode 100644 recipes/strong_type/all/test_package/CMakeLists.txt create mode 100644 recipes/strong_type/all/test_package/conanfile.py create mode 100644 recipes/strong_type/all/test_package/test_package.cpp create mode 100644 recipes/strong_type/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/strong_type/all/test_v1_package/conanfile.py create mode 100644 recipes/strong_type/config.yml create mode 100644 recipes/structopt/all/conandata.yml create mode 100644 recipes/structopt/all/conanfile.py create mode 100644 recipes/structopt/all/patches/0.1.0-0001-use-recipes.patch create mode 100644 recipes/structopt/all/test_package/CMakeLists.txt create mode 100644 recipes/structopt/all/test_package/conanfile.py create mode 100644 recipes/structopt/all/test_package/test_package.cpp create mode 100644 recipes/structopt/config.yml create mode 100644 recipes/stx/all/CMakeLists.txt create mode 100644 recipes/stx/all/conandata.yml create mode 100644 recipes/stx/all/conanfile.py create mode 100644 recipes/stx/all/patches/0001-abseil_find_package.patch create mode 100644 recipes/stx/all/patches/0002-cmake_module_path.patch create mode 100644 recipes/stx/all/test_package/CMakeLists.txt create mode 100644 recipes/stx/all/test_package/conanfile.py create mode 100644 recipes/stx/all/test_package/example.cpp create mode 100644 recipes/stx/config.yml create mode 100644 recipes/subunit/all/conandata.yml create mode 100644 recipes/subunit/all/conanfile.py create mode 100644 recipes/subunit/all/patches/0001-fix-ExtUtils-MakeMaker-error.patch create mode 100644 recipes/subunit/all/test_package/CMakeLists.txt create mode 100644 recipes/subunit/all/test_package/conanfile.py create mode 100644 recipes/subunit/all/test_package/test_package.c create mode 100644 recipes/subunit/config.yml create mode 100644 recipes/sundials/all/conandata.yml create mode 100644 recipes/sundials/all/conanfile.py create mode 100644 recipes/sundials/all/test_package/CMakeLists.txt create mode 100644 recipes/sundials/all/test_package/conanfile.py create mode 100644 recipes/sundials/all/test_package/test_package.c create mode 100644 recipes/sundials/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sundials/all/test_v1_package/conanfile.py create mode 100644 recipes/sundials/config.yml create mode 100644 recipes/svector/all/conandata.yml create mode 100644 recipes/svector/all/conanfile.py create mode 100644 recipes/svector/all/test_package/CMakeLists.txt create mode 100644 recipes/svector/all/test_package/conanfile.py create mode 100644 recipes/svector/all/test_package/test_package.cpp create mode 100644 recipes/svector/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/svector/all/test_v1_package/conanfile.py create mode 100644 recipes/svector/config.yml create mode 100644 recipes/svgwrite/all/CMakeLists.txt create mode 100644 recipes/svgwrite/all/conandata.yml create mode 100644 recipes/svgwrite/all/conanfile.py create mode 100644 recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch create mode 100644 recipes/svgwrite/all/patches/0002-span-lite-ns.patch create mode 100644 recipes/svgwrite/all/test_package/CMakeLists.txt create mode 100644 recipes/svgwrite/all/test_package/conanfile.py create mode 100644 recipes/svgwrite/all/test_package/example.cpp create mode 100644 recipes/svgwrite/config.yml create mode 100644 recipes/swig/all/cmake/conan-official-swig-targets.cmake create mode 100644 recipes/swig/all/conandata.yml create mode 100644 recipes/swig/all/conanfile.py create mode 100644 recipes/swig/all/patches/0001-4.1.0-swig-linux-library-path.patch create mode 100644 recipes/swig/all/patches/0001-swig-linux-library-path.patch create mode 100644 recipes/swig/all/patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch create mode 100644 recipes/swig/all/patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch create mode 100644 recipes/swig/all/patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch create mode 100644 recipes/swig/all/test_package/CMakeLists.txt create mode 100644 recipes/swig/all/test_package/conanfile.py create mode 100644 recipes/swig/all/test_package/test.i create mode 100644 recipes/swig/all/test_package/test_package.c create mode 100644 recipes/swig/config.yml create mode 100644 recipes/symengine/all/conandata.yml create mode 100644 recipes/symengine/all/conanfile.py create mode 100644 recipes/symengine/all/test_package/CMakeLists.txt create mode 100644 recipes/symengine/all/test_package/conanfile.py create mode 100644 recipes/symengine/all/test_package/test_package.cpp create mode 100644 recipes/symengine/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/symengine/all/test_v1_package/conanfile.py create mode 100644 recipes/symengine/all/test_v1_package/test_package.cpp create mode 100644 recipes/symengine/config.yml create mode 100644 recipes/systemc-cci/all/CMakeLists.txt create mode 100644 recipes/systemc-cci/all/conandata.yml create mode 100644 recipes/systemc-cci/all/conanfile.py create mode 100644 recipes/systemc-cci/all/patches/broker.patch create mode 100644 recipes/systemc-cci/all/patches/cci_param_untyped_handle.patch create mode 100644 recipes/systemc-cci/all/patches/cci_value_converter.patch create mode 100644 recipes/systemc-cci/all/test_package/CMakeLists.txt create mode 100644 recipes/systemc-cci/all/test_package/conanfile.py create mode 100644 recipes/systemc-cci/all/test_package/example.cpp create mode 100644 recipes/systemc-cci/config.yml create mode 100644 recipes/systemc/all/CMakeLists.txt create mode 100644 recipes/systemc/all/conandata.yml create mode 100644 recipes/systemc/all/conanfile.py create mode 100644 recipes/systemc/all/patches/0001-cmake.patch create mode 100644 recipes/systemc/all/patches/0002-sc_string_view.patch create mode 100644 recipes/systemc/all/patches/0003-mingw.patch create mode 100644 recipes/systemc/all/patches/0004-cmake.patch create mode 100644 recipes/systemc/all/test_package/CMakeLists.txt create mode 100644 recipes/systemc/all/test_package/conanfile.py create mode 100644 recipes/systemc/all/test_package/test_package.cpp create mode 100644 recipes/systemc/config.yml create mode 100644 recipes/szip/all/conandata.yml create mode 100644 recipes/szip/all/conanfile.py create mode 100644 recipes/szip/all/patches/build_either_static_or_shared.patch create mode 100644 recipes/szip/all/patches/fix_unknown_size_t.patch create mode 100644 recipes/szip/all/test_package/CMakeLists.txt create mode 100644 recipes/szip/all/test_package/conanfile.py create mode 100644 recipes/szip/all/test_package/test_package.c create mode 100644 recipes/szip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/szip/all/test_v1_package/conanfile.py create mode 100644 recipes/szip/config.yml create mode 100644 recipes/tabulate/all/conandata.yml create mode 100644 recipes/tabulate/all/conanfile.py create mode 100644 recipes/tabulate/all/test_package/CMakeLists.txt create mode 100644 recipes/tabulate/all/test_package/conanfile.py create mode 100644 recipes/tabulate/all/test_package/test_package.cpp create mode 100644 recipes/tabulate/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tabulate/all/test_v1_package/conanfile.py create mode 100644 recipes/tabulate/config.yml create mode 100644 recipes/taglib/all/conandata.yml create mode 100644 recipes/taglib/all/conanfile.py create mode 100644 recipes/taglib/all/patches/1.12-0001-fix-error-duplicate-volatile.patch create mode 100644 recipes/taglib/all/test_package/CMakeLists.txt create mode 100644 recipes/taglib/all/test_package/conanfile.py create mode 100644 recipes/taglib/all/test_package/test_package.cpp create mode 100644 recipes/taglib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taglib/all/test_v1_package/conanfile.py create mode 100644 recipes/taglib/config.yml create mode 100644 recipes/taocpp-json/all/conandata.yml create mode 100644 recipes/taocpp-json/all/conanfile.py create mode 100644 recipes/taocpp-json/all/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-json/all/test_package/conanfile.py create mode 100644 recipes/taocpp-json/all/test_package/test_package.cpp create mode 100644 recipes/taocpp-json/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-json/all/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-json/config.yml create mode 100644 recipes/taocpp-operators/all/conandata.yml create mode 100644 recipes/taocpp-operators/all/conanfile.py create mode 100644 recipes/taocpp-operators/all/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-operators/all/test_package/conanfile.py create mode 100644 recipes/taocpp-operators/all/test_package/test_package.cpp create mode 100644 recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-operators/all/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-operators/config.yml create mode 100644 recipes/taocpp-pegtl/2.x.x/conandata.yml create mode 100644 recipes/taocpp-pegtl/2.x.x/conanfile.py create mode 100644 recipes/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-pegtl/2.x.x/test_package/conanfile.py create mode 100644 recipes/taocpp-pegtl/2.x.x/test_package/test_package.cpp create mode 100644 recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-pegtl/3.x.x/conandata.yml create mode 100644 recipes/taocpp-pegtl/3.x.x/conanfile.py create mode 100644 recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-pegtl/3.x.x/test_package/conanfile.py create mode 100644 recipes/taocpp-pegtl/3.x.x/test_package/test_package.cpp create mode 100644 recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-pegtl/config.yml create mode 100644 recipes/taocpp-sequences/all/conandata.yml create mode 100644 recipes/taocpp-sequences/all/conanfile.py create mode 100644 recipes/taocpp-sequences/all/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-sequences/all/test_package/conanfile.py create mode 100644 recipes/taocpp-sequences/all/test_package/test_package.cpp create mode 100644 recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-sequences/all/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-sequences/config.yml create mode 100644 recipes/taocpp-taopq/all/conandata.yml create mode 100644 recipes/taocpp-taopq/all/conanfile.py create mode 100644 recipes/taocpp-taopq/all/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-taopq/all/test_package/conanfile.py create mode 100644 recipes/taocpp-taopq/all/test_package/test_package.cpp create mode 100644 recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-taopq/all/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-taopq/config.yml create mode 100644 recipes/taocpp-tuple/all/conandata.yml create mode 100644 recipes/taocpp-tuple/all/conanfile.py create mode 100644 recipes/taocpp-tuple/all/test_package/CMakeLists.txt create mode 100644 recipes/taocpp-tuple/all/test_package/conanfile.py create mode 100644 recipes/taocpp-tuple/all/test_package/test_package.cpp create mode 100644 recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taocpp-tuple/all/test_v1_package/conanfile.py create mode 100644 recipes/taocpp-tuple/config.yml create mode 100644 recipes/tar/all/conandata.yml create mode 100644 recipes/tar/all/conanfile.py create mode 100644 recipes/tar/all/test_package/conanfile.py create mode 100644 recipes/tar/config.yml create mode 100644 recipes/taskflow/all/conandata.yml create mode 100644 recipes/taskflow/all/conanfile.py create mode 100644 recipes/taskflow/all/patches/3.3.0-immintrin-guard.patch create mode 100644 recipes/taskflow/all/test_package/CMakeLists.txt create mode 100644 recipes/taskflow/all/test_package/conanfile.py create mode 100644 recipes/taskflow/all/test_package/test_package.cpp create mode 100644 recipes/taskflow/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taskflow/all/test_v1_package/conanfile.py create mode 100644 recipes/taskflow/config.yml create mode 100644 recipes/taywee-args/all/conandata.yml create mode 100644 recipes/taywee-args/all/conanfile.py create mode 100644 recipes/taywee-args/all/test_package/CMakeLists.txt create mode 100644 recipes/taywee-args/all/test_package/conanfile.py create mode 100644 recipes/taywee-args/all/test_package/test_package.cpp create mode 100644 recipes/taywee-args/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taywee-args/all/test_v1_package/conanfile.py create mode 100644 recipes/taywee-args/config.yml create mode 100644 recipes/tbb/all/conandata.yml create mode 100644 recipes/tbb/all/conanfile.py create mode 100644 recipes/tbb/all/test_package/CMakeLists.txt create mode 100644 recipes/tbb/all/test_package/conanfile.py create mode 100644 recipes/tbb/all/test_package/test_package.cpp create mode 100644 recipes/tbb/config.yml create mode 100644 recipes/tcb-span/all/conandata.yml create mode 100644 recipes/tcb-span/all/conanfile.py create mode 100644 recipes/tcb-span/all/test_package/CMakeLists.txt create mode 100644 recipes/tcb-span/all/test_package/conanfile.py create mode 100644 recipes/tcb-span/all/test_package/test_package.cxx create mode 100644 recipes/tcb-span/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tcb-span/all/test_v1_package/conanfile.py create mode 100644 recipes/tcb-span/config.yml create mode 100644 recipes/tcl/all/conandata.yml create mode 100644 recipes/tcl/all/conanfile.py create mode 100644 recipes/tcl/all/patches/0001-8.6.10-no-read-only-data.patch create mode 100644 recipes/tcl/all/patches/0001-8.6.11-no-read-only-data.patch create mode 100644 recipes/tcl/all/test_package/CMakeLists.txt create mode 100644 recipes/tcl/all/test_package/conanfile.py create mode 100644 recipes/tcl/all/test_package/hello.bat create mode 100644 recipes/tcl/all/test_package/hello.tcl create mode 100644 recipes/tcl/all/test_package/test_package.c create mode 100644 recipes/tcl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tcl/all/test_v1_package/conanfile.py create mode 100644 recipes/tcl/config.yml create mode 100644 recipes/tclap/all/conandata.yml create mode 100644 recipes/tclap/all/conanfile.py create mode 100644 recipes/tclap/all/test_package/CMakeLists.txt create mode 100644 recipes/tclap/all/test_package/conanfile.py create mode 100644 recipes/tclap/all/test_package/test.cpp create mode 100644 recipes/tclap/config.yml create mode 100644 recipes/tcp-wrappers/all/conandata.yml create mode 100644 recipes/tcp-wrappers/all/conanfile.py create mode 100644 recipes/tcp-wrappers/all/patches/0001-shared-clang.patch create mode 100644 recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch create mode 100644 recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch create mode 100644 recipes/tcp-wrappers/all/test_package/CMakeLists.txt create mode 100644 recipes/tcp-wrappers/all/test_package/conanfile.py create mode 100644 recipes/tcp-wrappers/all/test_package/test_package.c create mode 100644 recipes/tcp-wrappers/config.yml create mode 100644 recipes/tcsbank-uconfig/all/conandata.yml create mode 100644 recipes/tcsbank-uconfig/all/conanfile.py create mode 100644 recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt create mode 100644 recipes/tcsbank-uconfig/all/test_package/conanfile.py create mode 100644 recipes/tcsbank-uconfig/all/test_package/test_package.cpp create mode 100644 recipes/tcsbank-uconfig/config.yml create mode 100644 recipes/tcsbank-uri-template/all/CMakeLists.txt create mode 100644 recipes/tcsbank-uri-template/all/conandata.yml create mode 100644 recipes/tcsbank-uri-template/all/conanfile.py create mode 100644 recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt create mode 100644 recipes/tcsbank-uri-template/all/test_package/conanfile.py create mode 100644 recipes/tcsbank-uri-template/all/test_package/test_package.cpp create mode 100644 recipes/tcsbank-uri-template/config.yml create mode 100644 recipes/teemo/all/conandata.yml create mode 100644 recipes/teemo/all/conanfile.py create mode 100644 recipes/teemo/all/patches/0001-follow-cxx-standards.patch create mode 100644 recipes/teemo/all/patches/0002-support-macosx.patch create mode 100644 recipes/teemo/all/test_package/CMakeLists.txt create mode 100644 recipes/teemo/all/test_package/conanfile.py create mode 100644 recipes/teemo/all/test_package/test_package.cpp create mode 100644 recipes/teemo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/teemo/all/test_v1_package/conanfile.py create mode 100644 recipes/teemo/config.yml create mode 100644 recipes/tensorflow-lite/all/conandata.yml create mode 100644 recipes/tensorflow-lite/all/conanfile.py create mode 100644 recipes/tensorflow-lite/all/patches/dependencies_2_10.patch create mode 100644 recipes/tensorflow-lite/all/patches/disable_fetch_content.patch create mode 100644 recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch create mode 100644 recipes/tensorflow-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/tensorflow-lite/all/test_package/conanfile.py create mode 100644 recipes/tensorflow-lite/all/test_package/model.tflite create mode 100644 recipes/tensorflow-lite/all/test_package/test_package.cpp create mode 100644 recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tensorflow-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/tensorflow-lite/config.yml create mode 100644 recipes/tensorpipe/all/conandata.yml create mode 100644 recipes/tensorpipe/all/conanfile.py create mode 100644 recipes/tensorpipe/all/test_package/CMakeLists.txt create mode 100644 recipes/tensorpipe/all/test_package/conanfile.py create mode 100644 recipes/tensorpipe/all/test_package/test_package.cpp create mode 100644 recipes/tensorpipe/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tensorpipe/all/test_v1_package/conanfile.py create mode 100644 recipes/tensorpipe/config.yml create mode 100644 recipes/termcap/all/CMakeLists.txt create mode 100644 recipes/termcap/all/conandata.yml create mode 100644 recipes/termcap/all/conanfile.py create mode 100644 recipes/termcap/all/patches/0001-msvc.patch create mode 100644 recipes/termcap/all/patches/0002-macOS.patch create mode 100644 recipes/termcap/all/test_package/CMakeLists.txt create mode 100644 recipes/termcap/all/test_package/conanfile.py create mode 100644 recipes/termcap/all/test_package/test_package.c create mode 100644 recipes/termcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/termcap/all/test_v1_package/conanfile.py create mode 100644 recipes/termcap/config.yml create mode 100644 recipes/termcolor/all/conandata.yml create mode 100644 recipes/termcolor/all/conanfile.py create mode 100644 recipes/termcolor/all/test_package/CMakeLists.txt create mode 100644 recipes/termcolor/all/test_package/conanfile.py create mode 100644 recipes/termcolor/all/test_package/test_package.cpp create mode 100644 recipes/termcolor/config.yml create mode 100644 recipes/tesseract/all/conandata.yml create mode 100644 recipes/tesseract/all/conanfile.py create mode 100644 recipes/tesseract/all/patches/0001-install-bundle.patch create mode 100644 recipes/tesseract/all/patches/0002-Link-with-targets-5.0.0.patch create mode 100644 recipes/tesseract/all/patches/0002-Link-with-targets-5.1.0.patch create mode 100644 recipes/tesseract/all/patches/0002-Link-with-targets-5.2.0.patch create mode 100644 recipes/tesseract/all/patches/0002-Link-with-targets.patch create mode 100644 recipes/tesseract/all/patches/0003-Dont-change-locale.patch create mode 100644 recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch create mode 100644 recipes/tesseract/all/patches/0004-control-optimizations-5.0.0.patch create mode 100644 recipes/tesseract/all/patches/0004-control-optimizations-5.1.0.patch create mode 100644 recipes/tesseract/all/patches/0004-control-optimizations-5.2.0.patch create mode 100644 recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch create mode 100644 recipes/tesseract/all/test_package/CMakeLists.txt create mode 100644 recipes/tesseract/all/test_package/conanfile.py create mode 100644 recipes/tesseract/all/test_package/test_package.cpp create mode 100644 recipes/tesseract/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tesseract/all/test_v1_package/conanfile.py create mode 100644 recipes/tesseract/config.yml create mode 100644 recipes/tgbot/all/CMakeLists.txt create mode 100644 recipes/tgbot/all/conandata.yml create mode 100644 recipes/tgbot/all/conanfile.py create mode 100644 recipes/tgbot/all/test_package/CMakeLists.txt create mode 100644 recipes/tgbot/all/test_package/conanfile.py create mode 100644 recipes/tgbot/all/test_package/test_package.cpp create mode 100644 recipes/tgbot/config.yml create mode 100644 recipes/tgc/all/CMakeLists.txt create mode 100644 recipes/tgc/all/conandata.yml create mode 100644 recipes/tgc/all/conanfile.py create mode 100644 recipes/tgc/all/test_package/CMakeLists.txt create mode 100644 recipes/tgc/all/test_package/conanfile.py create mode 100644 recipes/tgc/all/test_package/test_package.c create mode 100644 recipes/tgc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tgc/all/test_v1_package/conanfile.py create mode 100644 recipes/tgc/config.yml create mode 100644 recipes/thelink2012-any/all/conandata.yml create mode 100644 recipes/thelink2012-any/all/conanfile.py create mode 100644 recipes/thelink2012-any/all/test_package/CMakeLists.txt create mode 100644 recipes/thelink2012-any/all/test_package/conanfile.py create mode 100644 recipes/thelink2012-any/all/test_package/test_package.cpp create mode 100644 recipes/thelink2012-any/config.yml create mode 100644 recipes/theora/all/CMakeLists.txt create mode 100644 recipes/theora/all/conandata.yml create mode 100644 recipes/theora/all/conanfile.py create mode 100644 recipes/theora/all/test_package/CMakeLists.txt create mode 100644 recipes/theora/all/test_package/conanfile.py create mode 100644 recipes/theora/all/test_package/test_package.c create mode 100644 recipes/theora/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/theora/all/test_v1_package/conanfile.py create mode 100644 recipes/theora/config.yml create mode 100644 recipes/threadpool/all/conandata.yml create mode 100644 recipes/threadpool/all/conanfile.py create mode 100644 recipes/threadpool/all/test_package/CMakeLists.txt create mode 100644 recipes/threadpool/all/test_package/conanfile.py create mode 100644 recipes/threadpool/all/test_package/test_package.cpp create mode 100644 recipes/threadpool/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/threadpool/all/test_v1_package/conanfile.py create mode 100644 recipes/threadpool/config.yml create mode 100644 recipes/thrift/all/conandata.yml create mode 100644 recipes/thrift/all/conanfile.py create mode 100644 recipes/thrift/all/patches/cmake-0.13.0.patch create mode 100644 recipes/thrift/all/patches/cmake-0.14.1.patch create mode 100644 recipes/thrift/all/patches/cmake-0.15.0.patch create mode 100644 recipes/thrift/all/patches/cmake-0.16.0.patch create mode 100644 recipes/thrift/all/test_package/CMakeLists.txt create mode 100644 recipes/thrift/all/test_package/Calculator.cpp create mode 100644 recipes/thrift/all/test_package/Calculator.h create mode 100644 recipes/thrift/all/test_package/calc.thrift create mode 100644 recipes/thrift/all/test_package/calculator_constants.cpp create mode 100644 recipes/thrift/all/test_package/calculator_constants.h create mode 100644 recipes/thrift/all/test_package/calculator_types.cpp create mode 100644 recipes/thrift/all/test_package/calculator_types.h create mode 100644 recipes/thrift/all/test_package/conanfile.py create mode 100644 recipes/thrift/all/test_package/test_package.cpp create mode 100644 recipes/thrift/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/thrift/all/test_v1_package/conanfile.py create mode 100644 recipes/thrift/config.yml create mode 100644 recipes/thrust/all/conandata.yml create mode 100644 recipes/thrust/all/conanfile.py create mode 100644 recipes/thrust/all/test_package/CMakeLists.txt create mode 100644 recipes/thrust/all/test_package/conanfile.py create mode 100644 recipes/thrust/all/test_package/test_package.cpp create mode 100644 recipes/thrust/config.yml create mode 100644 recipes/tidy-html5/all/CMakeLists.txt create mode 100644 recipes/tidy-html5/all/conandata.yml create mode 100644 recipes/tidy-html5/all/conanfile.py create mode 100644 recipes/tidy-html5/all/patches/0001-robust-install-pdb.patch create mode 100644 recipes/tidy-html5/all/test_package/CMakeLists.txt create mode 100644 recipes/tidy-html5/all/test_package/conanfile.py create mode 100644 recipes/tidy-html5/all/test_package/test_package.c create mode 100644 recipes/tidy-html5/config.yml create mode 100644 recipes/timsort/all/conandata.yml create mode 100644 recipes/timsort/all/conanfile.py create mode 100644 recipes/timsort/all/test_package/CMakeLists.txt create mode 100644 recipes/timsort/all/test_package/conanfile.py create mode 100644 recipes/timsort/all/test_package/test_package.cpp create mode 100644 recipes/timsort/config.yml create mode 100644 recipes/tinkerforge-bindings/all/CMakeLists.txt create mode 100644 recipes/tinkerforge-bindings/all/conandata.yml create mode 100644 recipes/tinkerforge-bindings/all/conanfile.py create mode 100644 recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt create mode 100644 recipes/tinkerforge-bindings/all/test_package/conanfile.py create mode 100644 recipes/tinkerforge-bindings/all/test_package/test_package.c create mode 100644 recipes/tinkerforge-bindings/config.yml create mode 100644 recipes/tiny-aes-c/all/conandata.yml create mode 100644 recipes/tiny-aes-c/all/conanfile.py create mode 100644 recipes/tiny-aes-c/all/patches/0001-cmake-install.patch create mode 100644 recipes/tiny-aes-c/all/test_package/CMakeLists.txt create mode 100644 recipes/tiny-aes-c/all/test_package/conanfile.py create mode 100644 recipes/tiny-aes-c/all/test_package/test_package.c create mode 100644 recipes/tiny-aes-c/all/test_package/test_package.cpp create mode 100644 recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tiny-aes-c/all/test_v1_package/conanfile.py create mode 100644 recipes/tiny-aes-c/config.yml create mode 100644 recipes/tiny-bignum-c/all/CMakeLists.txt create mode 100644 recipes/tiny-bignum-c/all/conandata.yml create mode 100644 recipes/tiny-bignum-c/all/conanfile.py create mode 100644 recipes/tiny-bignum-c/all/test_package/CMakeLists.txt create mode 100644 recipes/tiny-bignum-c/all/test_package/conanfile.py create mode 100644 recipes/tiny-bignum-c/all/test_package/test_package.c create mode 100644 recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tiny-bignum-c/all/test_v1_package/conanfile.py create mode 100644 recipes/tiny-bignum-c/config.yml create mode 100644 recipes/tiny-dnn/all/CMakeLists.txt create mode 100644 recipes/tiny-dnn/all/conandata.yml create mode 100644 recipes/tiny-dnn/all/conanfile.py create mode 100644 recipes/tiny-dnn/all/test_package/CMakeLists.txt create mode 100644 recipes/tiny-dnn/all/test_package/conanfile.py create mode 100644 recipes/tiny-dnn/all/test_package/test_package.cpp create mode 100644 recipes/tiny-dnn/config.yml create mode 100644 recipes/tiny-regex-c/all/CMakeLists.txt create mode 100644 recipes/tiny-regex-c/all/conandata.yml create mode 100644 recipes/tiny-regex-c/all/conanfile.py create mode 100644 recipes/tiny-regex-c/all/test_package/CMakeLists.txt create mode 100644 recipes/tiny-regex-c/all/test_package/conanfile.py create mode 100644 recipes/tiny-regex-c/all/test_package/test_package.c create mode 100644 recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tiny-regex-c/all/test_v1_package/conanfile.py create mode 100644 recipes/tiny-regex-c/config.yml create mode 100644 recipes/tiny-utf8/all/conandata.yml create mode 100644 recipes/tiny-utf8/all/conanfile.py create mode 100644 recipes/tiny-utf8/all/test_package/CMakeLists.txt create mode 100644 recipes/tiny-utf8/all/test_package/conanfile.py create mode 100644 recipes/tiny-utf8/all/test_package/test_package.cpp create mode 100644 recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tiny-utf8/all/test_v1_package/conanfile.py create mode 100644 recipes/tiny-utf8/config.yml create mode 100644 recipes/tinyalsa/all/conandata.yml create mode 100644 recipes/tinyalsa/all/conanfile.py create mode 100644 recipes/tinyalsa/all/patches/tinyalsa-2.0.0-strncpy-warning.patch create mode 100644 recipes/tinyalsa/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyalsa/all/test_package/conanfile.py create mode 100644 recipes/tinyalsa/all/test_package/example.c create mode 100644 recipes/tinyalsa/config.yml create mode 100644 recipes/tinycbor/all/conandata.yml create mode 100644 recipes/tinycbor/all/conanfile.py create mode 100644 recipes/tinycbor/all/patches/0.5.3/001-build-system.patch create mode 100644 recipes/tinycbor/all/patches/0.6.0/001-build-system.patch create mode 100644 recipes/tinycbor/all/test_package/CMakeLists.txt create mode 100644 recipes/tinycbor/all/test_package/conanfile.py create mode 100644 recipes/tinycbor/all/test_package/test_package.c create mode 100644 recipes/tinycbor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinycbor/all/test_v1_package/conanfile.py create mode 100644 recipes/tinycbor/config.yml create mode 100644 recipes/tinycthread/all/conandata.yml create mode 100644 recipes/tinycthread/all/conanfile.py create mode 100644 recipes/tinycthread/all/test_package/CMakeLists.txt create mode 100644 recipes/tinycthread/all/test_package/conanfile.py create mode 100644 recipes/tinycthread/all/test_package/test_package.c create mode 100644 recipes/tinycthread/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinycthread/all/test_v1_package/conanfile.py create mode 100644 recipes/tinycthread/config.yml create mode 100644 recipes/tinycthreadpool/all/conandata.yml create mode 100644 recipes/tinycthreadpool/all/conanfile.py create mode 100644 recipes/tinycthreadpool/all/test_package/CMakeLists.txt create mode 100644 recipes/tinycthreadpool/all/test_package/conanfile.py create mode 100644 recipes/tinycthreadpool/all/test_package/example.c create mode 100644 recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinycthreadpool/all/test_v1_package/conanfile.py create mode 100644 recipes/tinycthreadpool/config.yml create mode 100644 recipes/tinydir/all/conandata.yml create mode 100644 recipes/tinydir/all/conanfile.py create mode 100644 recipes/tinydir/all/test_package/CMakeLists.txt create mode 100644 recipes/tinydir/all/test_package/conanfile.py create mode 100644 recipes/tinydir/all/test_package/test_package.c create mode 100644 recipes/tinydir/config.yml create mode 100644 recipes/tinyexif/all/conandata.yml create mode 100644 recipes/tinyexif/all/conanfile.py create mode 100644 recipes/tinyexif/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyexif/all/test_package/conanfile.py create mode 100644 recipes/tinyexif/all/test_package/test_package.cpp create mode 100644 recipes/tinyexif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyexif/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyexif/config.yml create mode 100644 recipes/tinyexr/all/conandata.yml create mode 100644 recipes/tinyexr/all/conanfile.py create mode 100644 recipes/tinyexr/all/patches/1.0.0-0001-use-conan-deps.patch create mode 100644 recipes/tinyexr/all/patches/1.0.1-0001-fix-SaveEXRNPartImageToMemory.patch create mode 100644 recipes/tinyexr/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyexr/all/test_package/conanfile.py create mode 100644 recipes/tinyexr/all/test_package/test.exr create mode 100644 recipes/tinyexr/all/test_package/test_package.cpp create mode 100644 recipes/tinyexr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyexr/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyexr/config.yml create mode 100644 recipes/tinygltf/all/conandata.yml create mode 100644 recipes/tinygltf/all/conanfile.py create mode 100644 recipes/tinygltf/all/test_package/CMakeLists.txt create mode 100644 recipes/tinygltf/all/test_package/box01.glb create mode 100644 recipes/tinygltf/all/test_package/conanfile.py create mode 100644 recipes/tinygltf/all/test_package/test_package.cpp create mode 100644 recipes/tinygltf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinygltf/all/test_v1_package/conanfile.py create mode 100644 recipes/tinygltf/config.yml create mode 100644 recipes/tinymidi/all/CMakeLists.txt create mode 100644 recipes/tinymidi/all/conandata.yml create mode 100644 recipes/tinymidi/all/conanfile.py create mode 100644 recipes/tinymidi/all/test_package/CMakeLists.txt create mode 100644 recipes/tinymidi/all/test_package/conanfile.py create mode 100644 recipes/tinymidi/all/test_package/test_package.c create mode 100644 recipes/tinymidi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinymidi/all/test_v1_package/conanfile.py create mode 100644 recipes/tinymidi/config.yml create mode 100644 recipes/tinyobjloader/all/conandata.yml create mode 100644 recipes/tinyobjloader/all/conanfile.py create mode 100644 recipes/tinyobjloader/all/patches/1.0.x-0001-cmake-minimum-required.patch create mode 100644 recipes/tinyobjloader/all/patches/2.0.0-rc10-0001-cmake-minimum-required.patch create mode 100644 recipes/tinyobjloader/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyobjloader/all/test_package/conanfile.py create mode 100644 recipes/tinyobjloader/all/test_package/cube.mtl create mode 100644 recipes/tinyobjloader/all/test_package/cube.obj create mode 100644 recipes/tinyobjloader/all/test_package/test_package.cpp create mode 100644 recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyobjloader/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyobjloader/config.yml create mode 100644 recipes/tinyply/all/conandata.yml create mode 100644 recipes/tinyply/all/conanfile.py create mode 100644 recipes/tinyply/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyply/all/test_package/conanfile.py create mode 100644 recipes/tinyply/all/test_package/test_package.cpp create mode 100644 recipes/tinyply/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyply/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyply/config.yml create mode 100644 recipes/tinyspline/all/conandata.yml create mode 100644 recipes/tinyspline/all/conanfile.py create mode 100644 recipes/tinyspline/all/patches/0.2.0-0001-fix-cmake.patch create mode 100644 recipes/tinyspline/all/patches/0.3.0-0001-fix-cmake.patch create mode 100644 recipes/tinyspline/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyspline/all/test_package/conanfile.py create mode 100644 recipes/tinyspline/all/test_package/test_package.c create mode 100644 recipes/tinyspline/all/test_package/test_package.cpp create mode 100644 recipes/tinyspline/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyspline/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyspline/config.yml create mode 100644 recipes/tinyxml/all/CMakeLists.txt create mode 100644 recipes/tinyxml/all/conandata.yml create mode 100644 recipes/tinyxml/all/conanfile.py create mode 100644 recipes/tinyxml/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyxml/all/test_package/conanfile.py create mode 100644 recipes/tinyxml/all/test_package/test_package.cpp create mode 100644 recipes/tinyxml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyxml/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyxml/config.yml create mode 100644 recipes/tinyxml2/all/conandata.yml create mode 100644 recipes/tinyxml2/all/conanfile.py create mode 100644 recipes/tinyxml2/all/patches/0001-cmake-pic.patch create mode 100644 recipes/tinyxml2/all/test_package/CMakeLists.txt create mode 100644 recipes/tinyxml2/all/test_package/conanfile.py create mode 100644 recipes/tinyxml2/all/test_package/test_package.cpp create mode 100644 recipes/tinyxml2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tinyxml2/all/test_v1_package/conanfile.py create mode 100644 recipes/tinyxml2/config.yml create mode 100644 recipes/tixi3/all/conandata.yml create mode 100644 recipes/tixi3/all/conanfile.py create mode 100644 recipes/tixi3/all/patches/disable_tixi_examples.patch create mode 100644 recipes/tixi3/all/patches/link_curl.patch create mode 100644 recipes/tixi3/all/test_package/CMakeLists.txt create mode 100644 recipes/tixi3/all/test_package/conanfile.py create mode 100644 recipes/tixi3/all/test_package/main.cpp create mode 100644 recipes/tixi3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tixi3/all/test_v1_package/conanfile.py create mode 100644 recipes/tixi3/config.yml create mode 100644 recipes/tk/all/conandata.yml create mode 100644 recipes/tk/all/conanfile.py create mode 100644 recipes/tk/all/test_package/CMakeLists.txt create mode 100644 recipes/tk/all/test_package/conanfile.py create mode 100644 recipes/tk/all/test_package/test_package.c create mode 100644 recipes/tk/config.yml create mode 100644 recipes/tl-expected/all/conandata.yml create mode 100644 recipes/tl-expected/all/conanfile.py create mode 100644 recipes/tl-expected/all/test_package/CMakeLists.txt create mode 100644 recipes/tl-expected/all/test_package/conanfile.py create mode 100644 recipes/tl-expected/all/test_package/test_package.cpp create mode 100644 recipes/tl-expected/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tl-expected/all/test_v1_package/conanfile.py create mode 100644 recipes/tl-expected/config.yml create mode 100644 recipes/tl-function-ref/all/conandata.yml create mode 100644 recipes/tl-function-ref/all/conanfile.py create mode 100644 recipes/tl-function-ref/all/test_package/CMakeLists.txt create mode 100644 recipes/tl-function-ref/all/test_package/conanfile.py create mode 100644 recipes/tl-function-ref/all/test_package/test_package.cpp create mode 100644 recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tl-function-ref/all/test_v1_package/conanfile.py create mode 100644 recipes/tl-function-ref/config.yml create mode 100644 recipes/tl-optional/all/conandata.yml create mode 100644 recipes/tl-optional/all/conanfile.py create mode 100644 recipes/tl-optional/all/test_package/CMakeLists.txt create mode 100644 recipes/tl-optional/all/test_package/conanfile.py create mode 100644 recipes/tl-optional/all/test_package/test_package.cpp create mode 100644 recipes/tl-optional/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tl-optional/all/test_v1_package/conanfile.py create mode 100644 recipes/tl-optional/config.yml create mode 100644 recipes/tl/all/conandata.yml create mode 100644 recipes/tl/all/conanfile.py create mode 100644 recipes/tl/all/test_package/CMakeLists.txt create mode 100644 recipes/tl/all/test_package/conanfile.py create mode 100644 recipes/tl/all/test_package/test_package.cpp create mode 100644 recipes/tl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tl/all/test_v1_package/conanfile.py create mode 100644 recipes/tl/config.yml create mode 100644 recipes/tllist/all/conandata.yml create mode 100644 recipes/tllist/all/conanfile.py create mode 100644 recipes/tllist/all/test_package/CMakeLists.txt create mode 100644 recipes/tllist/all/test_package/conanfile.py create mode 100644 recipes/tllist/all/test_package/test_package.c create mode 100644 recipes/tllist/config.yml create mode 100644 recipes/tlx/all/conandata.yml create mode 100644 recipes/tlx/all/conanfile.py create mode 100644 recipes/tlx/all/patches/0001-fix-dll-install.patch create mode 100644 recipes/tlx/all/patches/0002-fix-shared-apple.patch create mode 100644 recipes/tlx/all/test_package/CMakeLists.txt create mode 100644 recipes/tlx/all/test_package/conanfile.py create mode 100644 recipes/tlx/all/test_package/test_package.cpp create mode 100644 recipes/tlx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tlx/all/test_v1_package/conanfile.py create mode 100644 recipes/tlx/config.yml create mode 100644 recipes/tmx/all/conandata.yml create mode 100644 recipes/tmx/all/conanfile.py create mode 100644 recipes/tmx/all/test_package/CMakeLists.txt create mode 100644 recipes/tmx/all/test_package/conanfile.py create mode 100644 recipes/tmx/all/test_package/externtileset.tmx create mode 100644 recipes/tmx/all/test_package/test_package.c create mode 100644 recipes/tmx/all/test_package/tileset.tsx create mode 100644 recipes/tmx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tmx/all/test_v1_package/conanfile.py create mode 100644 recipes/tmx/config.yml create mode 100644 recipes/tmxlite/all/conandata.yml create mode 100644 recipes/tmxlite/all/conanfile.py create mode 100644 recipes/tmxlite/all/patches/0001-include-external-pugixml.patch create mode 100644 recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch create mode 100644 recipes/tmxlite/all/test_package/CMakeLists.txt create mode 100644 recipes/tmxlite/all/test_package/conanfile.py create mode 100644 recipes/tmxlite/all/test_package/test_package.cpp create mode 100644 recipes/tmxlite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tmxlite/all/test_v1_package/conanfile.py create mode 100644 recipes/tmxlite/config.yml create mode 100644 recipes/tng/all/conandata.yml create mode 100644 recipes/tng/all/conanfile.py create mode 100644 recipes/tng/all/patches/0001-cmake-install.patch create mode 100644 recipes/tng/all/test_package/CMakeLists.txt create mode 100644 recipes/tng/all/test_package/conanfile.py create mode 100644 recipes/tng/all/test_package/test_package.c create mode 100644 recipes/tng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tng/all/test_v1_package/conanfile.py create mode 100644 recipes/tng/config.yml create mode 100644 recipes/toml11/all/conandata.yml create mode 100644 recipes/toml11/all/conanfile.py create mode 100644 recipes/toml11/all/test_package/CMakeLists.txt create mode 100644 recipes/toml11/all/test_package/conanfile.py create mode 100644 recipes/toml11/all/test_package/test_package.cpp create mode 100644 recipes/toml11/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/toml11/all/test_v1_package/conanfile.py create mode 100644 recipes/toml11/config.yml create mode 100644 recipes/tomlplusplus/all/conandata.yml create mode 100644 recipes/tomlplusplus/all/conanfile.py create mode 100644 recipes/tomlplusplus/all/test_package/CMakeLists.txt create mode 100644 recipes/tomlplusplus/all/test_package/conanfile.py create mode 100644 recipes/tomlplusplus/all/test_package/configuration.toml create mode 100644 recipes/tomlplusplus/all/test_package/test_package.cpp create mode 100644 recipes/tomlplusplus/all/test_package/test_package_multi.cpp create mode 100644 recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tomlplusplus/all/test_v1_package/conanfile.py create mode 100644 recipes/tomlplusplus/config.yml create mode 100644 recipes/tracy/all/conandata.yml create mode 100644 recipes/tracy/all/conanfile.py create mode 100644 recipes/tracy/all/test_package/CMakeLists.txt create mode 100644 recipes/tracy/all/test_package/conanfile.py create mode 100644 recipes/tracy/all/test_package/test_package.cpp create mode 100644 recipes/tracy/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tracy/all/test_v1_package/conanfile.py create mode 100644 recipes/tracy/config.yml create mode 100644 recipes/transwarp/all/conandata.yml create mode 100644 recipes/transwarp/all/conanfile.py create mode 100644 recipes/transwarp/all/test_package/CMakeLists.txt create mode 100644 recipes/transwarp/all/test_package/conanfile.py create mode 100644 recipes/transwarp/all/test_package/test_package.cpp create mode 100644 recipes/transwarp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/transwarp/all/test_v1_package/conanfile.py create mode 100644 recipes/transwarp/config.yml create mode 100644 recipes/trantor/all/conandata.yml create mode 100644 recipes/trantor/all/conanfile.py create mode 100644 recipes/trantor/all/test_package/CMakeLists.txt create mode 100644 recipes/trantor/all/test_package/conanfile.py create mode 100644 recipes/trantor/all/test_package/test_package.cpp create mode 100644 recipes/trantor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/trantor/all/test_v1_package/conanfile.py create mode 100644 recipes/trantor/config.yml create mode 100644 recipes/tree-sitter-c/all/CMakeLists.txt create mode 100644 recipes/tree-sitter-c/all/conandata.yml create mode 100644 recipes/tree-sitter-c/all/conanfile.py create mode 100644 recipes/tree-sitter-c/all/test_package/CMakeLists.txt create mode 100644 recipes/tree-sitter-c/all/test_package/conanfile.py create mode 100644 recipes/tree-sitter-c/all/test_package/test_package.c create mode 100644 recipes/tree-sitter-c/config.yml create mode 100644 recipes/tree-sitter/all/CMakeLists.txt create mode 100644 recipes/tree-sitter/all/conandata.yml create mode 100644 recipes/tree-sitter/all/conanfile.py create mode 100644 recipes/tree-sitter/all/test_package/CMakeLists.txt create mode 100644 recipes/tree-sitter/all/test_package/conanfile.py create mode 100644 recipes/tree-sitter/all/test_package/test_package.c create mode 100644 recipes/tree-sitter/config.yml create mode 100644 recipes/troldal-zippy/all/conandata.yml create mode 100644 recipes/troldal-zippy/all/conanfile.py create mode 100644 recipes/troldal-zippy/all/patches/zippy-archive-mkdir.patch create mode 100644 recipes/troldal-zippy/all/test_package/CMakeLists.txt create mode 100644 recipes/troldal-zippy/all/test_package/conanfile.py create mode 100644 recipes/troldal-zippy/all/test_package/test_package.cpp create mode 100644 recipes/troldal-zippy/config.yml create mode 100644 recipes/trompeloeil/all/conandata.yml create mode 100644 recipes/trompeloeil/all/conanfile.py create mode 100644 recipes/trompeloeil/all/test_package/CMakeLists.txt create mode 100644 recipes/trompeloeil/all/test_package/conanfile.py create mode 100644 recipes/trompeloeil/all/test_package/test_package.cpp create mode 100644 recipes/trompeloeil/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/trompeloeil/all/test_v1_package/conanfile.py create mode 100644 recipes/trompeloeil/config.yml create mode 100644 recipes/tscns/all/conandata.yml create mode 100644 recipes/tscns/all/conanfile.py create mode 100644 recipes/tscns/all/patches/0001-include-thread.patch create mode 100644 recipes/tscns/all/patches/0002-support-older-compiler.patch create mode 100644 recipes/tscns/all/test_package/CMakeLists.txt create mode 100644 recipes/tscns/all/test_package/conanfile.py create mode 100644 recipes/tscns/all/test_package/test_package.cpp create mode 100644 recipes/tscns/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tscns/all/test_v1_package/conanfile.py create mode 100644 recipes/tscns/config.yml create mode 100644 recipes/tsil/all/CMakeLists.txt create mode 100644 recipes/tsil/all/conandata.yml create mode 100644 recipes/tsil/all/conanfile.py create mode 100644 recipes/tsil/all/test_package/CMakeLists.txt create mode 100644 recipes/tsil/all/test_package/conanfile.py create mode 100644 recipes/tsil/all/test_package/test_package.c create mode 100644 recipes/tsil/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsil/all/test_v1_package/conanfile.py create mode 100644 recipes/tsil/config.yml create mode 100644 recipes/tsl-array-hash/all/conandata.yml create mode 100644 recipes/tsl-array-hash/all/conanfile.py create mode 100644 recipes/tsl-array-hash/all/test_package/CMakeLists.txt create mode 100644 recipes/tsl-array-hash/all/test_package/conanfile.py create mode 100644 recipes/tsl-array-hash/all/test_package/test_package.cpp create mode 100644 recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-array-hash/all/test_v1_package/conanfile.py create mode 100644 recipes/tsl-array-hash/config.yml create mode 100644 recipes/tsl-hat-trie/all/conandata.yml create mode 100644 recipes/tsl-hat-trie/all/conanfile.py create mode 100644 recipes/tsl-hat-trie/all/test_package/CMakeLists.txt create mode 100644 recipes/tsl-hat-trie/all/test_package/conanfile.py create mode 100644 recipes/tsl-hat-trie/all/test_package/test_package.cpp create mode 100644 recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-hat-trie/all/test_v1_package/conanfile.py create mode 100644 recipes/tsl-hat-trie/config.yml create mode 100644 recipes/tsl-hopscotch-map/all/conandata.yml create mode 100644 recipes/tsl-hopscotch-map/all/conanfile.py create mode 100644 recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt create mode 100644 recipes/tsl-hopscotch-map/all/test_package/conanfile.py create mode 100644 recipes/tsl-hopscotch-map/all/test_package/test_package.cpp create mode 100644 recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py create mode 100644 recipes/tsl-hopscotch-map/config.yml create mode 100644 recipes/tsl-ordered-map/all/conandata.yml create mode 100644 recipes/tsl-ordered-map/all/conanfile.py create mode 100644 recipes/tsl-ordered-map/all/test_package/CMakeLists.txt create mode 100644 recipes/tsl-ordered-map/all/test_package/conanfile.py create mode 100644 recipes/tsl-ordered-map/all/test_package/test_package.cpp create mode 100644 recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-ordered-map/all/test_v1_package/conanfile.py create mode 100644 recipes/tsl-ordered-map/config.yml create mode 100644 recipes/tsl-robin-map/all/conandata.yml create mode 100644 recipes/tsl-robin-map/all/conanfile.py create mode 100644 recipes/tsl-robin-map/all/test_package/CMakeLists.txt create mode 100644 recipes/tsl-robin-map/all/test_package/conanfile.py create mode 100644 recipes/tsl-robin-map/all/test_package/test_package.cpp create mode 100644 recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-robin-map/all/test_v1_package/conanfile.py create mode 100644 recipes/tsl-robin-map/config.yml create mode 100644 recipes/tsl-sparse-map/all/conandata.yml create mode 100644 recipes/tsl-sparse-map/all/conanfile.py create mode 100644 recipes/tsl-sparse-map/all/test_package/CMakeLists.txt create mode 100644 recipes/tsl-sparse-map/all/test_package/conanfile.py create mode 100644 recipes/tsl-sparse-map/all/test_package/test_package.cpp create mode 100644 recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-sparse-map/all/test_v1_package/conanfile.py create mode 100644 recipes/tsl-sparse-map/config.yml create mode 100644 recipes/tuplet/all/conandata.yml create mode 100644 recipes/tuplet/all/conanfile.py create mode 100644 recipes/tuplet/all/test_package/CMakeLists.txt create mode 100644 recipes/tuplet/all/test_package/conanfile.py create mode 100644 recipes/tuplet/all/test_package/test_package.cpp create mode 100644 recipes/tuplet/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tuplet/all/test_v1_package/conanfile.py create mode 100644 recipes/tuplet/config.yml create mode 100644 recipes/turtle/all/conandata.yml create mode 100644 recipes/turtle/all/conanfile.py create mode 100644 recipes/turtle/all/test_package/CMakeLists.txt create mode 100644 recipes/turtle/all/test_package/conanfile.py create mode 100644 recipes/turtle/all/test_package/test_package.cpp create mode 100644 recipes/turtle/config.yml create mode 100644 recipes/tweetnacl/all/CMakeLists.txt create mode 100644 recipes/tweetnacl/all/conandata.yml create mode 100644 recipes/tweetnacl/all/conanfile.py create mode 100644 recipes/tweetnacl/all/test_package/CMakeLists.txt create mode 100644 recipes/tweetnacl/all/test_package/conanfile.py create mode 100644 recipes/tweetnacl/all/test_package/test_package.c create mode 100644 recipes/tweetnacl/config.yml create mode 100644 recipes/twitch-native-ipc/all/CMakeLists.txt create mode 100644 recipes/twitch-native-ipc/all/conandata.yml create mode 100644 recipes/twitch-native-ipc/all/conanfile.py create mode 100644 recipes/twitch-native-ipc/all/patches/cmake-fixes.patch create mode 100644 recipes/twitch-native-ipc/all/patches/export-fixes.patch create mode 100644 recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch create mode 100644 recipes/twitch-native-ipc/all/test_package/CMakeLists.txt create mode 100644 recipes/twitch-native-ipc/all/test_package/conanfile.py create mode 100644 recipes/twitch-native-ipc/all/test_package/example.c create mode 100644 recipes/twitch-native-ipc/all/test_package/example2.cpp create mode 100644 recipes/twitch-native-ipc/config.yml create mode 100644 recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt create mode 100644 recipes/twitchtv-libsoundtrackutil/all/conandata.yml create mode 100644 recipes/twitchtv-libsoundtrackutil/all/conanfile.py create mode 100644 recipes/twitchtv-libsoundtrackutil/all/patches/clang-8-fix.patch create mode 100644 recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt create mode 100644 recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py create mode 100644 recipes/twitchtv-libsoundtrackutil/all/test_package/example.cpp create mode 100644 recipes/twitchtv-libsoundtrackutil/config.yml create mode 100644 recipes/type_safe/all/conandata.yml create mode 100644 recipes/type_safe/all/conanfile.py create mode 100644 recipes/type_safe/all/test_package/CMakeLists.txt create mode 100644 recipes/type_safe/all/test_package/conanfile.py create mode 100644 recipes/type_safe/all/test_package/test_package.cpp create mode 100644 recipes/type_safe/config.yml create mode 100644 recipes/ua-nodeset/all/conandata.yml create mode 100644 recipes/ua-nodeset/all/conanfile.py create mode 100644 recipes/ua-nodeset/all/test_package/conanfile.py create mode 100644 recipes/ua-nodeset/config.yml create mode 100644 recipes/uchardet/all/CMakeLists.txt create mode 100644 recipes/uchardet/all/conandata.yml create mode 100644 recipes/uchardet/all/conanfile.py create mode 100644 recipes/uchardet/all/test_package/CMakeLists.txt create mode 100644 recipes/uchardet/all/test_package/conanfile.py create mode 100644 recipes/uchardet/all/test_package/test_package.cpp create mode 100644 recipes/uchardet/config.yml create mode 100644 recipes/ulfius/all/conandata.yml create mode 100644 recipes/ulfius/all/conanfile.py create mode 100644 recipes/ulfius/all/patches/2.7.11-0001-shared-static-conan.patch create mode 100644 recipes/ulfius/all/patches/2.7.11-0002-pthread-for-websockets-only.patch create mode 100644 recipes/ulfius/all/test_package/CMakeLists.txt create mode 100644 recipes/ulfius/all/test_package/conanfile.py create mode 100644 recipes/ulfius/all/test_package/test_package.c create mode 100644 recipes/ulfius/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ulfius/all/test_v1_package/conanfile.py create mode 100644 recipes/ulfius/config.yml create mode 100644 recipes/uncrustify/all/conandata.yml create mode 100644 recipes/uncrustify/all/conanfile.py create mode 100644 recipes/uncrustify/all/test_package/conanfile.py create mode 100644 recipes/uncrustify/all/test_v1_package/conanfile.py create mode 100644 recipes/uncrustify/config.yml create mode 100644 recipes/uni-algo/all/conandata.yml create mode 100644 recipes/uni-algo/all/conanfile.py create mode 100644 recipes/uni-algo/all/test_package/CMakeLists.txt create mode 100644 recipes/uni-algo/all/test_package/conanfile.py create mode 100644 recipes/uni-algo/all/test_package/test_package.cpp create mode 100644 recipes/uni-algo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/uni-algo/all/test_v1_package/conanfile.py create mode 100644 recipes/uni-algo/config.yml create mode 100644 recipes/unicorn/all/conandata.yml create mode 100644 recipes/unicorn/all/conanfile.py create mode 100644 recipes/unicorn/all/patches/1.0.3-0001-cmake-crossbuild-support.patch create mode 100644 recipes/unicorn/all/patches/2.0.0-0001-cmake-msvc-support.patch create mode 100644 recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch create mode 100644 recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch create mode 100644 recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch create mode 100644 recipes/unicorn/all/test_package/CMakeLists.txt create mode 100644 recipes/unicorn/all/test_package/conanfile.py create mode 100644 recipes/unicorn/all/test_package/test_package.c create mode 100644 recipes/unicorn/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/unicorn/all/test_v1_package/conanfile.py create mode 100644 recipes/unicorn/config.yml create mode 100644 recipes/units/all/conandata.yml create mode 100644 recipes/units/all/conanfile.py create mode 100644 recipes/units/all/test_package/CMakeLists.txt create mode 100644 recipes/units/all/test_package/conanfile.py create mode 100644 recipes/units/all/test_package/test_package.cpp create mode 100644 recipes/units/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/units/all/test_v1_package/conanfile.py create mode 100644 recipes/units/config.yml create mode 100644 recipes/univalue/all/conandata.yml create mode 100644 recipes/univalue/all/conanfile.py create mode 100644 recipes/univalue/all/patches/1.0.5-0001-fix-windows.patch create mode 100644 recipes/univalue/all/patches/1.1.1-0001-fix-windows.patch create mode 100644 recipes/univalue/all/test_package/CMakeLists.txt create mode 100644 recipes/univalue/all/test_package/conanfile.py create mode 100644 recipes/univalue/all/test_package/test_package.cpp create mode 100644 recipes/univalue/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/univalue/all/test_v1_package/conanfile.py create mode 100644 recipes/univalue/config.yml create mode 100644 recipes/unleash-client-cpp/all/CMakeLists.txt create mode 100644 recipes/unleash-client-cpp/all/conandata.yml create mode 100644 recipes/unleash-client-cpp/all/conanfile.py create mode 100644 recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch create mode 100644 recipes/unleash-client-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/unleash-client-cpp/all/test_package/conanfile.py create mode 100644 recipes/unleash-client-cpp/all/test_package/test_package.cpp create mode 100644 recipes/unleash-client-cpp/config.yml create mode 100644 recipes/unordered_dense/all/conandata.yml create mode 100644 recipes/unordered_dense/all/conanfile.py create mode 100644 recipes/unordered_dense/all/test_package/CMakeLists.txt create mode 100644 recipes/unordered_dense/all/test_package/conanfile.py create mode 100644 recipes/unordered_dense/all/test_package/test_package.cpp create mode 100644 recipes/unordered_dense/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/unordered_dense/all/test_v1_package/conanfile.py create mode 100644 recipes/unordered_dense/config.yml create mode 100644 recipes/unqlite/all/conandata.yml create mode 100644 recipes/unqlite/all/conanfile.py create mode 100644 recipes/unqlite/all/test_package/CMakeLists.txt create mode 100644 recipes/unqlite/all/test_package/conanfile.py create mode 100644 recipes/unqlite/all/test_package/test_package.c create mode 100644 recipes/unqlite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/unqlite/all/test_v1_package/conanfile.py create mode 100644 recipes/unqlite/config.yml create mode 100644 recipes/upx/all/CMakeLists.txt create mode 100644 recipes/upx/all/conandata.yml create mode 100644 recipes/upx/all/conanfile.py create mode 100644 recipes/upx/all/test_package/CMakeLists.txt create mode 100644 recipes/upx/all/test_package/conanfile.py create mode 100644 recipes/upx/all/test_package/test_package.c create mode 100644 recipes/upx/config.yml create mode 100644 recipes/uriparser/all/conandata.yml create mode 100644 recipes/uriparser/all/conanfile.py create mode 100644 recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.3.patch create mode 100644 recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.4.patch create mode 100644 recipes/uriparser/all/test_package/CMakeLists.txt create mode 100644 recipes/uriparser/all/test_package/conanfile.py create mode 100644 recipes/uriparser/all/test_package/test_package.c create mode 100644 recipes/uriparser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/uriparser/all/test_v1_package/conanfile.py create mode 100644 recipes/uriparser/config.yml create mode 100644 recipes/userspace-rcu/all/conandata.yml create mode 100644 recipes/userspace-rcu/all/conanfile.py create mode 100644 recipes/userspace-rcu/all/test_package/CMakeLists.txt create mode 100644 recipes/userspace-rcu/all/test_package/conanfile.py create mode 100644 recipes/userspace-rcu/all/test_package/tap.c create mode 100644 recipes/userspace-rcu/all/test_package/tap.h create mode 100644 recipes/userspace-rcu/all/test_package/test_urcu_fork.c create mode 100644 recipes/userspace-rcu/config.yml create mode 100644 recipes/usockets/all/conandata.yml create mode 100644 recipes/usockets/all/conanfile.py create mode 100644 recipes/usockets/all/patches/0001-makefile.patch create mode 100644 recipes/usockets/all/patches/0001-makefile_0.6.0.patch create mode 100644 recipes/usockets/all/patches/0001-makefile_0.8.1.patch create mode 100644 recipes/usockets/all/patches/0001-makefile_0.8.2.patch create mode 100644 recipes/usockets/all/patches/0001-makefile_0.8.3.patch create mode 100644 recipes/usockets/all/patches/0002-vcxproj.patch create mode 100644 recipes/usockets/all/patches/0002-vcxproj_0.8.1.patch create mode 100644 recipes/usockets/all/test_package/CMakeLists.txt create mode 100644 recipes/usockets/all/test_package/conanfile.py create mode 100644 recipes/usockets/all/test_package/test_package.cpp create mode 100644 recipes/usockets/config.yml create mode 100644 recipes/usrsctp/all/CMakeLists.txt create mode 100644 recipes/usrsctp/all/conandata.yml create mode 100644 recipes/usrsctp/all/conanfile.py create mode 100644 recipes/usrsctp/all/patches/0001-install.patch create mode 100644 recipes/usrsctp/all/test_package/CMakeLists.txt create mode 100644 recipes/usrsctp/all/test_package/conanfile.py create mode 100644 recipes/usrsctp/all/test_package/test_package.c create mode 100644 recipes/usrsctp/config.yml create mode 100644 recipes/utf8.h/all/conandata.yml create mode 100644 recipes/utf8.h/all/conanfile.py create mode 100644 recipes/utf8.h/all/test_package/CMakeLists.txt create mode 100644 recipes/utf8.h/all/test_package/conanfile.py create mode 100644 recipes/utf8.h/all/test_package/test_package.cpp create mode 100644 recipes/utf8.h/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/utf8.h/all/test_v1_package/conanfile.py create mode 100644 recipes/utf8.h/config.yml create mode 100644 recipes/utf8proc/all/conandata.yml create mode 100644 recipes/utf8proc/all/conanfile.py create mode 100644 recipes/utf8proc/all/test_package/CMakeLists.txt create mode 100644 recipes/utf8proc/all/test_package/conanfile.py create mode 100644 recipes/utf8proc/all/test_package/test_package.c create mode 100644 recipes/utf8proc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/utf8proc/all/test_v1_package/conanfile.py create mode 100644 recipes/utf8proc/config.yml create mode 100644 recipes/utfcpp/all/conandata.yml create mode 100644 recipes/utfcpp/all/conanfile.py create mode 100644 recipes/utfcpp/all/test_package/CMakeLists.txt create mode 100644 recipes/utfcpp/all/test_package/conanfile.py create mode 100644 recipes/utfcpp/all/test_package/test_package.cpp create mode 100644 recipes/utfcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/utfcpp/all/test_v1_package/conanfile.py create mode 100644 recipes/utfcpp/config.yml create mode 100644 recipes/uvw/all/conandata.yml create mode 100644 recipes/uvw/all/conanfile.py create mode 100644 recipes/uvw/all/test_package/CMakeLists.txt create mode 100644 recipes/uvw/all/test_package/conanfile.py create mode 100644 recipes/uvw/all/test_package/test_package.cpp create mode 100644 recipes/uvw/config.yml create mode 100644 recipes/uwebsockets/all/conandata.yml create mode 100644 recipes/uwebsockets/all/conanfile.py create mode 100644 recipes/uwebsockets/all/test_package/CMakeLists.txt create mode 100644 recipes/uwebsockets/all/test_package/conanfile.py create mode 100644 recipes/uwebsockets/all/test_package/test_package.cpp create mode 100644 recipes/uwebsockets/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/uwebsockets/all/test_v1_package/conanfile.py create mode 100644 recipes/uwebsockets/config.yml create mode 100644 recipes/v-hacd/all/conandata.yml create mode 100644 recipes/v-hacd/all/conanfile.py create mode 100644 recipes/v-hacd/all/test_package/CMakeLists.txt create mode 100644 recipes/v-hacd/all/test_package/conanfile.py create mode 100644 recipes/v-hacd/all/test_package/test_package.cpp create mode 100644 recipes/v-hacd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/v-hacd/all/test_v1_package/conanfile.py create mode 100644 recipes/v-hacd/config.yml create mode 100644 recipes/vaapi/all/conanfile.py create mode 100644 recipes/vaapi/all/test_package/CMakeLists.txt create mode 100644 recipes/vaapi/all/test_package/conanfile.py create mode 100644 recipes/vaapi/all/test_package/test_package.c create mode 100644 recipes/vaapi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vaapi/all/test_v1_package/conanfile.py create mode 100644 recipes/vaapi/config.yml create mode 100644 recipes/valijson/all/conandata.yml create mode 100644 recipes/valijson/all/conanfile.py create mode 100644 recipes/valijson/all/test_package/CMakeLists.txt create mode 100644 recipes/valijson/all/test_package/conanfile.py create mode 100644 recipes/valijson/all/test_package/invalid.json create mode 100644 recipes/valijson/all/test_package/schema.json create mode 100644 recipes/valijson/all/test_package/test_package.cpp create mode 100644 recipes/valijson/all/test_package/valid.json create mode 100644 recipes/valijson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/valijson/all/test_v1_package/conanfile.py create mode 100644 recipes/valijson/config.yml create mode 100644 recipes/variant-lite/all/conandata.yml create mode 100644 recipes/variant-lite/all/conanfile.py create mode 100644 recipes/variant-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/variant-lite/all/test_package/conanfile.py create mode 100644 recipes/variant-lite/all/test_package/test_package.cpp create mode 100644 recipes/variant-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/variant-lite/all/test_v1_package/conanfile.py create mode 100644 recipes/variant-lite/config.yml create mode 100644 recipes/vc/all/conandata.yml create mode 100644 recipes/vc/all/conanfile.py create mode 100644 recipes/vc/all/test_package/CMakeLists.txt create mode 100644 recipes/vc/all/test_package/conanfile.py create mode 100644 recipes/vc/all/test_package/test_package.cpp create mode 100644 recipes/vc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vc/all/test_v1_package/conanfile.py create mode 100644 recipes/vc/config.yml create mode 100644 recipes/vcglib/all/CMakeLists.txt create mode 100644 recipes/vcglib/all/conandata.yml create mode 100644 recipes/vcglib/all/conanfile.py create mode 100644 recipes/vcglib/all/patches/0001-use-external-eigen.patch create mode 100644 recipes/vcglib/all/test_package/CMakeLists.txt create mode 100644 recipes/vcglib/all/test_package/conanfile.py create mode 100644 recipes/vcglib/all/test_package/cube.obj create mode 100644 recipes/vcglib/all/test_package/test_package.cpp create mode 100644 recipes/vcglib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vcglib/all/test_v1_package/conanfile.py create mode 100644 recipes/vcglib/config.yml create mode 100644 recipes/vdpau/all/conanfile.py create mode 100644 recipes/vdpau/all/test_package/CMakeLists.txt create mode 100644 recipes/vdpau/all/test_package/conanfile.py create mode 100644 recipes/vdpau/all/test_package/test_package.c create mode 100644 recipes/vdpau/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vdpau/all/test_v1_package/conanfile.py create mode 100644 recipes/vdpau/config.yml create mode 100644 recipes/vectorclass/all/CMakeLists.txt create mode 100644 recipes/vectorclass/all/conandata.yml create mode 100644 recipes/vectorclass/all/conanfile.py create mode 100644 recipes/vectorclass/all/test_package/CMakeLists.txt create mode 100644 recipes/vectorclass/all/test_package/conanfile.py create mode 100644 recipes/vectorclass/all/test_package/test_package.cpp create mode 100644 recipes/vectorclass/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vectorclass/all/test_v1_package/conanfile.py create mode 100644 recipes/vectorclass/config.yml create mode 100644 recipes/vectorial/all/conandata.yml create mode 100644 recipes/vectorial/all/conanfile.py create mode 100644 recipes/vectorial/all/test_package/CMakeLists.txt create mode 100644 recipes/vectorial/all/test_package/conanfile.py create mode 100644 recipes/vectorial/all/test_package/test_package.cpp create mode 100644 recipes/vectorial/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vectorial/all/test_v1_package/conanfile.py create mode 100644 recipes/vectorial/config.yml create mode 100644 recipes/veque/all/conandata.yml create mode 100644 recipes/veque/all/conanfile.py create mode 100644 recipes/veque/all/test_package/CMakeLists.txt create mode 100644 recipes/veque/all/test_package/conanfile.py create mode 100644 recipes/veque/all/test_package/test_package.cpp create mode 100644 recipes/veque/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/veque/all/test_v1_package/conanfile.py create mode 100644 recipes/veque/config.yml create mode 100644 recipes/verilator/all/conandata.yml create mode 100644 recipes/verilator/all/conanfile.py create mode 100644 recipes/verilator/all/patches/0001-split-opt-and-debug-build-install.patch create mode 100644 recipes/verilator/all/patches/0002-msvc-patches.patch create mode 100644 recipes/verilator/all/patches/0003-add-msvc_link-sh.patch create mode 100644 recipes/verilator/all/patches/0004-msvc-patches.patch create mode 100644 recipes/verilator/all/test_package/CMakeLists.txt create mode 100644 recipes/verilator/all/test_package/blinky.cpp create mode 100644 recipes/verilator/all/test_package/blinky.v create mode 100644 recipes/verilator/all/test_package/blinky_sc.cpp create mode 100644 recipes/verilator/all/test_package/conanfile.py create mode 100644 recipes/verilator/config.yml create mode 100644 recipes/vincentlaucsb-csv-parser/all/conandata.yml create mode 100644 recipes/vincentlaucsb-csv-parser/all/conanfile.py create mode 100644 recipes/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt create mode 100644 recipes/vincentlaucsb-csv-parser/all/test_package/conanfile.py create mode 100644 recipes/vincentlaucsb-csv-parser/all/test_package/test_package.cpp create mode 100644 recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vincentlaucsb-csv-parser/all/test_v1_package/conanfile.py create mode 100644 recipes/vincentlaucsb-csv-parser/config.yml create mode 100644 recipes/visit_struct/all/conandata.yml create mode 100644 recipes/visit_struct/all/conanfile.py create mode 100644 recipes/visit_struct/all/test_package/CMakeLists.txt create mode 100644 recipes/visit_struct/all/test_package/conanfile.py create mode 100644 recipes/visit_struct/all/test_package/test_package.cpp create mode 100644 recipes/visit_struct/config.yml create mode 100644 recipes/vk-bootstrap/all/conandata.yml create mode 100644 recipes/vk-bootstrap/all/conanfile.py create mode 100644 recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch create mode 100644 recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch create mode 100644 recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch create mode 100644 recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch create mode 100644 recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch create mode 100644 recipes/vk-bootstrap/all/test_package/CMakeLists.txt create mode 100644 recipes/vk-bootstrap/all/test_package/conanfile.py create mode 100644 recipes/vk-bootstrap/all/test_package/test_package.cpp create mode 100644 recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vk-bootstrap/all/test_v1_package/conanfile.py create mode 100644 recipes/vk-bootstrap/config.yml create mode 100644 recipes/volk/all/conandata.yml create mode 100644 recipes/volk/all/conanfile.py create mode 100644 recipes/volk/all/test_package/CMakeLists.txt create mode 100644 recipes/volk/all/test_package/conanfile.py create mode 100644 recipes/volk/all/test_package/test_package.c create mode 100644 recipes/volk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/volk/all/test_v1_package/conanfile.py create mode 100644 recipes/volk/config.yml create mode 100644 recipes/vorbis/all/conandata.yml create mode 100644 recipes/vorbis/all/conanfile.py create mode 100644 recipes/vorbis/all/patches/link-libm-find-package-ogg.patch create mode 100644 recipes/vorbis/all/test_package/8kadpcm.wav create mode 100644 recipes/vorbis/all/test_package/CMakeLists.txt create mode 100644 recipes/vorbis/all/test_package/conanfile.py create mode 100644 recipes/vorbis/all/test_package/test_package.c create mode 100644 recipes/vorbis/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vorbis/all/test_v1_package/conanfile.py create mode 100644 recipes/vorbis/config.yml create mode 100644 recipes/voropp/all/CMakeLists.txt create mode 100644 recipes/voropp/all/conandata.yml create mode 100644 recipes/voropp/all/conanfile.py create mode 100644 recipes/voropp/all/test_package/CMakeLists.txt create mode 100644 recipes/voropp/all/test_package/conanfile.py create mode 100644 recipes/voropp/all/test_package/test_package.cpp create mode 100644 recipes/voropp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/voropp/all/test_v1_package/conanfile.py create mode 100644 recipes/voropp/config.yml create mode 100644 recipes/vtu11/all/conandata.yml create mode 100644 recipes/vtu11/all/conanfile.py create mode 100644 recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch create mode 100644 recipes/vtu11/all/test_package/CMakeLists.txt create mode 100644 recipes/vtu11/all/test_package/conanfile.py create mode 100644 recipes/vtu11/all/test_package/test_package.cpp create mode 100644 recipes/vtu11/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vtu11/all/test_v1_package/conanfile.py create mode 100644 recipes/vtu11/config.yml create mode 100644 recipes/vulkan-headers/all/conandata.yml create mode 100644 recipes/vulkan-headers/all/conanfile.py create mode 100644 recipes/vulkan-headers/all/test_package/CMakeLists.txt create mode 100644 recipes/vulkan-headers/all/test_package/conanfile.py create mode 100644 recipes/vulkan-headers/all/test_package/test_package.c create mode 100644 recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vulkan-headers/all/test_v1_package/conanfile.py create mode 100644 recipes/vulkan-headers/config.yml create mode 100644 recipes/vulkan-loader/all/conandata.yml create mode 100644 recipes/vulkan-loader/all/conanfile.py create mode 100644 recipes/vulkan-loader/all/patches/1.2.154.0-0001-fix-mingw.patch create mode 100644 recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch create mode 100644 recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch create mode 100644 recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch create mode 100644 recipes/vulkan-loader/all/test_package/CMakeLists.txt create mode 100644 recipes/vulkan-loader/all/test_package/conanfile.py create mode 100644 recipes/vulkan-loader/all/test_package/test_package.cpp create mode 100644 recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vulkan-loader/all/test_v1_package/conanfile.py create mode 100644 recipes/vulkan-loader/config.yml create mode 100644 recipes/vulkan-memory-allocator/all/conandata.yml create mode 100644 recipes/vulkan-memory-allocator/all/conanfile.py create mode 100644 recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch create mode 100644 recipes/vulkan-memory-allocator/all/test_package/CMakeLists.txt create mode 100644 recipes/vulkan-memory-allocator/all/test_package/conanfile.py create mode 100644 recipes/vulkan-memory-allocator/all/test_package/test_package.cpp create mode 100644 recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vulkan-memory-allocator/all/test_v1_package/conanfile.py create mode 100644 recipes/vulkan-memory-allocator/config.yml create mode 100644 recipes/vulkan-validationlayers/all/conandata.yml create mode 100644 recipes/vulkan-validationlayers/all/conanfile.py create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml create mode 100644 recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt create mode 100644 recipes/vulkan-validationlayers/all/test_package/conanfile.py create mode 100644 recipes/vulkan-validationlayers/all/test_package/test_package.cpp create mode 100644 recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py create mode 100644 recipes/vulkan-validationlayers/config.yml create mode 100644 recipes/waf/all/conandata.yml create mode 100644 recipes/waf/all/conanfile.py create mode 100644 recipes/waf/all/test_package/a.cpp create mode 100644 recipes/waf/all/test_package/b.cpp create mode 100644 recipes/waf/all/test_package/conanfile.py create mode 100644 recipes/waf/all/test_package/main.c create mode 100644 recipes/waf/all/test_package/main.cpp create mode 100644 recipes/waf/all/test_package/wscript create mode 100644 recipes/waf/config.yml create mode 100644 recipes/wasmedge/all/conandata.yml create mode 100644 recipes/wasmedge/all/conanfile.py create mode 100644 recipes/wasmedge/all/test_package/CMakeLists.txt create mode 100644 recipes/wasmedge/all/test_package/conanfile.py create mode 100644 recipes/wasmedge/all/test_package/test_package.c create mode 100644 recipes/wasmedge/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmedge/all/test_v1_package/conanfile.py create mode 100644 recipes/wasmedge/config.yml create mode 100644 recipes/wasmer/all/conandata.yml create mode 100644 recipes/wasmer/all/conanfile.py create mode 100644 recipes/wasmer/all/test_package/CMakeLists.txt create mode 100644 recipes/wasmer/all/test_package/conanfile.py create mode 100644 recipes/wasmer/all/test_package/test_package.c create mode 100644 recipes/wasmer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmer/all/test_v1_package/conanfile.py create mode 100644 recipes/wasmer/config.yml create mode 100644 recipes/wasmtime-cpp/all/conandata.yml create mode 100644 recipes/wasmtime-cpp/all/conanfile.py create mode 100644 recipes/wasmtime-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/wasmtime-cpp/all/test_package/conanfile.py create mode 100644 recipes/wasmtime-cpp/all/test_package/hello.wat create mode 100644 recipes/wasmtime-cpp/all/test_package/test_package.cpp create mode 100644 recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmtime-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/wasmtime-cpp/config.yml create mode 100644 recipes/wasmtime/all/conandata.yml create mode 100644 recipes/wasmtime/all/conanfile.py create mode 100644 recipes/wasmtime/all/test_package/CMakeLists.txt create mode 100644 recipes/wasmtime/all/test_package/conanfile.py create mode 100644 recipes/wasmtime/all/test_package/test_package.c create mode 100644 recipes/wasmtime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmtime/all/test_v1_package/conanfile.py create mode 100644 recipes/wasmtime/config.yml create mode 100644 recipes/watcher/all/conandata.yml create mode 100644 recipes/watcher/all/conanfile.py create mode 100644 recipes/watcher/all/patches/0.3.1-fix-include.patch create mode 100644 recipes/watcher/all/patches/0.5.5-fix-limits_max.patch create mode 100644 recipes/watcher/all/test_package/CMakeLists.txt create mode 100644 recipes/watcher/all/test_package/conanfile.py create mode 100644 recipes/watcher/all/test_package/test_package.cpp create mode 100644 recipes/watcher/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/watcher/all/test_v1_package/conanfile.py create mode 100644 recipes/watcher/config.yml create mode 100644 recipes/wavelet_buffer/all/conandata.yml create mode 100644 recipes/wavelet_buffer/all/conanfile.py create mode 100644 recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch create mode 100644 recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch create mode 100644 recipes/wavelet_buffer/all/test_package/CMakeLists.txt create mode 100644 recipes/wavelet_buffer/all/test_package/conanfile.py create mode 100644 recipes/wavelet_buffer/all/test_package/test_package.cpp create mode 100644 recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wavelet_buffer/all/test_v1_package/conanfile.py create mode 100644 recipes/wavelet_buffer/config.yml create mode 100644 recipes/wayland-protocols/all/conandata.yml create mode 100644 recipes/wayland-protocols/all/conanfile.py create mode 100644 recipes/wayland-protocols/all/test_package/conanfile.py create mode 100644 recipes/wayland-protocols/all/test_package/meson.build create mode 100644 recipes/wayland-protocols/all/test_package/meson_options.txt create mode 100644 recipes/wayland-protocols/all/test_package/test_package.c create mode 100644 recipes/wayland-protocols/all/test_v1_package/conanfile.py create mode 100644 recipes/wayland-protocols/all/test_v1_package/meson.build create mode 100644 recipes/wayland-protocols/config.yml create mode 100644 recipes/wayland/all/conandata.yml create mode 100644 recipes/wayland/all/conanfile.py create mode 100644 recipes/wayland/all/test_package/CMakeLists.txt create mode 100644 recipes/wayland/all/test_package/conanfile.py create mode 100644 recipes/wayland/all/test_package/test_package.c create mode 100644 recipes/wayland/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wayland/all/test_v1_package/conanfile.py create mode 100644 recipes/wayland/config.yml create mode 100644 recipes/websocketpp/all/conandata.yml create mode 100644 recipes/websocketpp/all/conanfile.py create mode 100644 recipes/websocketpp/all/patches/support-gcc-12.patch create mode 100644 recipes/websocketpp/all/patches/websocket_boost_support_1_7_x.patch create mode 100644 recipes/websocketpp/all/test_package/CMakeLists.txt create mode 100644 recipes/websocketpp/all/test_package/conanfile.py create mode 100644 recipes/websocketpp/all/test_package/test_package.cpp create mode 100644 recipes/websocketpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/websocketpp/all/test_v1_package/conanfile.py create mode 100644 recipes/websocketpp/config.yml create mode 100644 recipes/wg21-linear_algebra/all/conandata.yml create mode 100644 recipes/wg21-linear_algebra/all/conanfile.py create mode 100644 recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt create mode 100644 recipes/wg21-linear_algebra/all/test_package/conanfile.py create mode 100644 recipes/wg21-linear_algebra/all/test_package/test_package.cpp create mode 100644 recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wg21-linear_algebra/all/test_v1_package/conanfile.py create mode 100644 recipes/wg21-linear_algebra/config.yml create mode 100644 recipes/wglext/all/conandata.yml create mode 100644 recipes/wglext/all/conanfile.py create mode 100644 recipes/wglext/all/test_package/CMakeLists.txt create mode 100644 recipes/wglext/all/test_package/conanfile.py create mode 100644 recipes/wglext/all/test_package/test_package.c create mode 100644 recipes/wglext/config.yml create mode 100644 recipes/whereami/all/CMakeLists.txt create mode 100644 recipes/whereami/all/conandata.yml create mode 100644 recipes/whereami/all/conanfile.py create mode 100644 recipes/whereami/all/test_package/CMakeLists.txt create mode 100644 recipes/whereami/all/test_package/conanfile.py create mode 100644 recipes/whereami/all/test_package/test_package.c create mode 100644 recipes/whereami/config.yml create mode 100644 recipes/wil/all/conandata.yml create mode 100644 recipes/wil/all/conanfile.py create mode 100644 recipes/wil/all/patches/1.0.230202.1-0001-fix-type-conversion.patch create mode 100644 recipes/wil/all/test_package/CMakeLists.txt create mode 100644 recipes/wil/all/test_package/conanfile.py create mode 100644 recipes/wil/all/test_package/test_package.cpp create mode 100644 recipes/wil/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wil/all/test_v1_package/conanfile.py create mode 100644 recipes/wil/config.yml create mode 100644 recipes/wildmidi/all/conandata.yml create mode 100644 recipes/wildmidi/all/conanfile.py create mode 100644 recipes/wildmidi/all/test_package/CMakeLists.txt create mode 100644 recipes/wildmidi/all/test_package/conanfile.py create mode 100644 recipes/wildmidi/all/test_package/test_package.c create mode 100644 recipes/wildmidi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wildmidi/all/test_v1_package/conanfile.py create mode 100644 recipes/wildmidi/config.yml create mode 100644 recipes/wilzegers-autotest/all/conandata.yml create mode 100644 recipes/wilzegers-autotest/all/conanfile.py create mode 100644 recipes/wilzegers-autotest/all/test_package/CMakeLists.txt create mode 100644 recipes/wilzegers-autotest/all/test_package/conanfile.py create mode 100644 recipes/wilzegers-autotest/all/test_package/test_package.cpp create mode 100644 recipes/wilzegers-autotest/config.yml create mode 100644 recipes/wineditline/all/CMakeLists.txt create mode 100644 recipes/wineditline/all/conandata.yml create mode 100644 recipes/wineditline/all/conanfile.py create mode 100644 recipes/wineditline/all/patches/0001-fix-cmakelists.patch create mode 100644 recipes/wineditline/all/test_package/CMakeLists.txt create mode 100644 recipes/wineditline/all/test_package/conanfile.py create mode 100644 recipes/wineditline/all/test_package/test_package.c create mode 100644 recipes/wineditline/config.yml create mode 100644 recipes/winflexbison/all/conandata.yml create mode 100644 recipes/winflexbison/all/conanfile.py create mode 100644 recipes/winflexbison/all/patches/0001-2.5.22-mingw-support.patch create mode 100644 recipes/winflexbison/all/patches/0001-2.5.24-mingw-support.patch create mode 100644 recipes/winflexbison/all/test_package/CMakeLists.txt create mode 100644 recipes/winflexbison/all/test_package/basic_nr.l create mode 100644 recipes/winflexbison/all/test_package/basic_nr.txt create mode 100644 recipes/winflexbison/all/test_package/conanfile.py create mode 100644 recipes/winflexbison/all/test_package/dummy_lex.c create mode 100644 recipes/winflexbison/all/test_package/mc_parser.yy create mode 100644 recipes/winflexbison/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/winflexbison/all/test_v1_package/conanfile.py create mode 100644 recipes/winflexbison/config.yml create mode 100644 recipes/winmd/all/conandata.yml create mode 100644 recipes/winmd/all/conanfile.py create mode 100644 recipes/winmd/all/test_package/CMakeLists.txt create mode 100644 recipes/winmd/all/test_package/conanfile.py create mode 100644 recipes/winmd/all/test_package/test_package.cpp create mode 100644 recipes/winmd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/winmd/all/test_v1_package/conanfile.py create mode 100644 recipes/winmd/config.yml create mode 100644 recipes/wiringpi/all/CMakeLists.txt create mode 100644 recipes/wiringpi/all/conandata.yml create mode 100644 recipes/wiringpi/all/conanfile.py create mode 100644 recipes/wiringpi/all/test_package/CMakeLists.txt create mode 100644 recipes/wiringpi/all/test_package/conanfile.py create mode 100644 recipes/wiringpi/all/test_package/test_package.c create mode 100644 recipes/wiringpi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wiringpi/all/test_v1_package/conanfile.py create mode 100644 recipes/wiringpi/config.yml create mode 100644 recipes/wise_enum/all/conandata.yml create mode 100644 recipes/wise_enum/all/conanfile.py create mode 100644 recipes/wise_enum/all/test_package/CMakeLists.txt create mode 100644 recipes/wise_enum/all/test_package/conanfile.py create mode 100644 recipes/wise_enum/all/test_package/test_package.cpp create mode 100644 recipes/wise_enum/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wise_enum/all/test_v1_package/conanfile.py create mode 100644 recipes/wise_enum/config.yml create mode 100644 recipes/wolfssl/all/conandata.yml create mode 100644 recipes/wolfssl/all/conanfile.py create mode 100644 recipes/wolfssl/all/test_package/CMakeLists.txt create mode 100644 recipes/wolfssl/all/test_package/conanfile.py create mode 100644 recipes/wolfssl/all/test_package/test_package.c create mode 100644 recipes/wolfssl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wolfssl/all/test_v1_package/conanfile.py create mode 100644 recipes/wolfssl/config.yml create mode 100644 recipes/wslay/all/conandata.yml create mode 100644 recipes/wslay/all/conanfile.py create mode 100644 recipes/wslay/all/patches/0001-msvc-support.patch create mode 100644 recipes/wslay/all/patches/0002-cmake-install-shared-artifacts.patch create mode 100644 recipes/wslay/all/test_package/CMakeLists.txt create mode 100644 recipes/wslay/all/test_package/conanfile.py create mode 100644 recipes/wslay/all/test_package/test_package.c create mode 100644 recipes/wslay/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wslay/all/test_v1_package/conanfile.py create mode 100644 recipes/wslay/config.yml create mode 100644 recipes/wt/all/conandata.yml create mode 100644 recipes/wt/all/conanfile.py create mode 100644 recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch create mode 100644 recipes/wt/all/patches/4.3.1-0002-gcc_11.patch create mode 100644 recipes/wt/all/patches/4.6.2-0001-use-cci-package.patch create mode 100644 recipes/wt/all/patches/4.7.1-0001-use-cci-package.patch create mode 100644 recipes/wt/all/patches/4.8.0-0001-use-cci-package.patch create mode 100644 recipes/wt/all/test_package/CMakeLists.txt create mode 100644 recipes/wt/all/test_package/conanfile.py create mode 100644 recipes/wt/all/test_package/test_package.cpp create mode 100644 recipes/wt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wt/all/test_v1_package/conanfile.py create mode 100644 recipes/wt/config.yml create mode 100644 recipes/wtl/all/conandata.yml create mode 100644 recipes/wtl/all/conanfile.py create mode 100644 recipes/wtl/all/test_package/CMakeLists.txt create mode 100644 recipes/wtl/all/test_package/conanfile.py create mode 100644 recipes/wtl/all/test_package/example.cpp create mode 100644 recipes/wtl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wtl/all/test_v1_package/conanfile.py create mode 100644 recipes/wtl/config.yml create mode 100644 recipes/wyhash/all/conandata.yml create mode 100644 recipes/wyhash/all/conanfile.py create mode 100644 recipes/wyhash/all/test_package/CMakeLists.txt create mode 100644 recipes/wyhash/all/test_package/conanfile.py create mode 100644 recipes/wyhash/all/test_package/test_package.c create mode 100644 recipes/wyhash/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wyhash/all/test_v1_package/conanfile.py create mode 100644 recipes/wyhash/config.yml create mode 100644 recipes/xapian-core/all/conandata.yml create mode 100644 recipes/xapian-core/all/conanfile.py create mode 100644 recipes/xapian-core/all/patches/0001-add-msvc-cl-sh.patch create mode 100644 recipes/xapian-core/all/patches/0002-add-cerrno.patch create mode 100644 recipes/xapian-core/all/test_package/CMakeLists.txt create mode 100644 recipes/xapian-core/all/test_package/conanfile.py create mode 100644 recipes/xapian-core/all/test_package/test_package.cpp create mode 100644 recipes/xapian-core/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xapian-core/all/test_v1_package/conanfile.py create mode 100644 recipes/xapian-core/config.yml create mode 100644 recipes/xbyak/all/conandata.yml create mode 100644 recipes/xbyak/all/conanfile.py create mode 100644 recipes/xbyak/all/test_package/CMakeLists.txt create mode 100644 recipes/xbyak/all/test_package/conanfile.py create mode 100644 recipes/xbyak/all/test_package/test_package.cpp create mode 100644 recipes/xbyak/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xbyak/all/test_v1_package/conanfile.py create mode 100644 recipes/xbyak/config.yml create mode 100644 recipes/xege/all/CMakeLists.txt create mode 100644 recipes/xege/all/conandata.yml create mode 100644 recipes/xege/all/conanfile.py create mode 100644 recipes/xege/all/test_package/CMakeLists.txt create mode 100644 recipes/xege/all/test_package/conanfile.py create mode 100644 recipes/xege/all/test_package/example.cpp create mode 100644 recipes/xege/config.yml create mode 100644 recipes/xerces-c/all/conandata.yml create mode 100644 recipes/xerces-c/all/conanfile.py create mode 100644 recipes/xerces-c/all/patches/0001-remove-test-samples-324.patch create mode 100644 recipes/xerces-c/all/patches/0001-remove-test-samples.patch create mode 100644 recipes/xerces-c/all/patches/0002-find-icu-programs.patch create mode 100644 recipes/xerces-c/all/test_package/CMakeLists.txt create mode 100644 recipes/xerces-c/all/test_package/conanfile.py create mode 100644 recipes/xerces-c/all/test_package/test_package.cpp create mode 100644 recipes/xerces-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xerces-c/all/test_v1_package/conanfile.py create mode 100644 recipes/xerces-c/config.yml create mode 100644 recipes/xkbcommon/all/conandata.yml create mode 100644 recipes/xkbcommon/all/conanfile.py create mode 100644 recipes/xkbcommon/all/test_package/CMakeLists.txt create mode 100644 recipes/xkbcommon/all/test_package/conanfile.py create mode 100644 recipes/xkbcommon/all/test_package/test_package.cpp create mode 100644 recipes/xkbcommon/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xkbcommon/all/test_v1_package/conanfile.py create mode 100644 recipes/xkbcommon/config.yml create mode 100644 recipes/xkeyboard-config/all/conanfile.py create mode 100644 recipes/xkeyboard-config/all/test_package/conanfile.py create mode 100644 recipes/xkeyboard-config/all/test_v1_package/conanfile.py create mode 100644 recipes/xkeyboard-config/config.yml create mode 100644 recipes/xlnt/all/conandata.yml create mode 100644 recipes/xlnt/all/conanfile.py create mode 100644 recipes/xlnt/all/patches/0001-fix-cmake-and-unvendor-deps.patch create mode 100644 recipes/xlnt/all/patches/0002-include-limits.patch create mode 100644 recipes/xlnt/all/test_package/CMakeLists.txt create mode 100644 recipes/xlnt/all/test_package/conanfile.py create mode 100644 recipes/xlnt/all/test_package/test_package.cpp create mode 100644 recipes/xlnt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xlnt/all/test_v1_package/conanfile.py create mode 100644 recipes/xlnt/config.yml create mode 100644 recipes/xmlsec/all/conandata.yml create mode 100644 recipes/xmlsec/all/conanfile.py create mode 100644 recipes/xmlsec/all/test_package/CMakeLists.txt create mode 100644 recipes/xmlsec/all/test_package/conanfile.py create mode 100644 recipes/xmlsec/all/test_package/rsakey.pem create mode 100644 recipes/xmlsec/all/test_package/sign1-tmpl.xml create mode 100644 recipes/xmlsec/all/test_package/sign1.c create mode 100644 recipes/xmlsec/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xmlsec/all/test_v1_package/conanfile.py create mode 100644 recipes/xmlsec/config.yml create mode 100644 recipes/xnnpack/all/conandata.yml create mode 100644 recipes/xnnpack/all/conanfile.py create mode 100644 recipes/xnnpack/all/test_package/CMakeLists.txt create mode 100644 recipes/xnnpack/all/test_package/conanfile.py create mode 100644 recipes/xnnpack/all/test_package/test_package.c create mode 100644 recipes/xnnpack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xnnpack/all/test_v1_package/conanfile.py create mode 100644 recipes/xnnpack/all/xnnpack_project_include.cmake create mode 100644 recipes/xnnpack/config.yml create mode 100644 recipes/xorg-cf-files/all/conandata.yml create mode 100644 recipes/xorg-cf-files/all/conanfile.py create mode 100644 recipes/xorg-cf-files/all/patches/1.0.7-0001-win-fixes.patch create mode 100644 recipes/xorg-cf-files/all/test_package/Imakefile create mode 100644 recipes/xorg-cf-files/all/test_package/conanfile.py create mode 100644 recipes/xorg-cf-files/all/test_package/test_package.c create mode 100644 recipes/xorg-cf-files/all/test_v1_package/Imakefile create mode 100644 recipes/xorg-cf-files/all/test_v1_package/conanfile.py create mode 100644 recipes/xorg-cf-files/all/test_v1_package/test_package.c create mode 100644 recipes/xorg-cf-files/config.yml create mode 100644 recipes/xorg-gccmakedep/all/conandata.yml create mode 100644 recipes/xorg-gccmakedep/all/conanfile.py create mode 100644 recipes/xorg-gccmakedep/all/test_package/Makefile create mode 100644 recipes/xorg-gccmakedep/all/test_package/conanfile.py create mode 100644 recipes/xorg-gccmakedep/all/test_package/test_package.c create mode 100644 recipes/xorg-gccmakedep/all/test_package/test_package.h create mode 100644 recipes/xorg-gccmakedep/all/test_v1_package/Makefile create mode 100644 recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py create mode 100644 recipes/xorg-gccmakedep/all/test_v1_package/test_package.c create mode 100644 recipes/xorg-gccmakedep/all/test_v1_package/test_package.h create mode 100644 recipes/xorg-gccmakedep/config.yml create mode 100644 recipes/xorg-macros/all/conandata.yml create mode 100644 recipes/xorg-macros/all/conanfile.py create mode 100644 recipes/xorg-macros/all/patches/0001-export-XORG_MACROS_VERSION-macro.patch create mode 100644 recipes/xorg-macros/all/test_package/Makefile.am create mode 100644 recipes/xorg-macros/all/test_package/conanfile.py create mode 100644 recipes/xorg-macros/all/test_package/configure.ac create mode 100644 recipes/xorg-macros/all/test_package/src/Makefile.am create mode 100644 recipes/xorg-macros/all/test_package/src/configure.ac create mode 100644 recipes/xorg-macros/all/test_v1_package/Makefile.am create mode 100644 recipes/xorg-macros/all/test_v1_package/conanfile.py create mode 100644 recipes/xorg-macros/all/test_v1_package/configure.ac create mode 100644 recipes/xorg-macros/config.yml create mode 100644 recipes/xorg-makedepend/all/conandata.yml create mode 100644 recipes/xorg-makedepend/all/conanfile.py create mode 100644 recipes/xorg-makedepend/all/test_package/conanfile.py create mode 100644 recipes/xorg-makedepend/all/test_package/test_package.c create mode 100644 recipes/xorg-makedepend/all/test_package/test_package.h create mode 100644 recipes/xorg-makedepend/all/test_v1_package/conanfile.py create mode 100644 recipes/xorg-makedepend/all/test_v1_package/test_package.c create mode 100644 recipes/xorg-makedepend/all/test_v1_package/test_package.h create mode 100644 recipes/xorg-makedepend/config.yml create mode 100644 recipes/xorg-proto/all/conandata.yml create mode 100644 recipes/xorg-proto/all/conanfile.py create mode 100644 recipes/xorg-proto/all/test_package/conanfile.py create mode 100644 recipes/xorg-proto/all/test_package/src/CMakeLists.txt create mode 100644 recipes/xorg-proto/all/test_package/src/test_package.c create mode 100644 recipes/xorg-proto/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xorg-proto/all/test_v1_package/conanfile.py create mode 100644 recipes/xorg-proto/config.yml create mode 100644 recipes/xorg/all/conanfile.py create mode 100644 recipes/xorg/all/test_package/CMakeLists.txt create mode 100644 recipes/xorg/all/test_package/conanfile.py create mode 100644 recipes/xorg/all/test_package/test_package.c create mode 100644 recipes/xorg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xorg/all/test_v1_package/conanfile.py create mode 100644 recipes/xorg/config.yml create mode 100644 recipes/xorstr/all/conandata.yml create mode 100644 recipes/xorstr/all/conanfile.py create mode 100644 recipes/xorstr/all/test_package/CMakeLists.txt create mode 100644 recipes/xorstr/all/test_package/conanfile.py create mode 100644 recipes/xorstr/all/test_package/test_package.cpp create mode 100644 recipes/xorstr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xorstr/all/test_v1_package/conanfile.py create mode 100644 recipes/xorstr/config.yml create mode 100644 recipes/xoshiro-cpp/all/conandata.yml create mode 100644 recipes/xoshiro-cpp/all/conanfile.py create mode 100644 recipes/xoshiro-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/xoshiro-cpp/all/test_package/conanfile.py create mode 100644 recipes/xoshiro-cpp/all/test_package/test_package.cpp create mode 100644 recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xoshiro-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/xoshiro-cpp/config.yml create mode 100644 recipes/xpack/all/conandata.yml create mode 100644 recipes/xpack/all/conanfile.py create mode 100644 recipes/xpack/all/patches/1.0.2-0001-use-cci.patch create mode 100644 recipes/xpack/all/test_package/CMakeLists.txt create mode 100644 recipes/xpack/all/test_package/conanfile.py create mode 100644 recipes/xpack/all/test_package/test_package.cpp create mode 100644 recipes/xpack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xpack/all/test_v1_package/conanfile.py create mode 100644 recipes/xpack/config.yml create mode 100644 recipes/xproperty/all/conandata.yml create mode 100644 recipes/xproperty/all/conanfile.py create mode 100644 recipes/xproperty/all/test_package/CMakeLists.txt create mode 100644 recipes/xproperty/all/test_package/conanfile.py create mode 100644 recipes/xproperty/all/test_package/test_package.cpp create mode 100644 recipes/xproperty/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xproperty/all/test_v1_package/conanfile.py create mode 100644 recipes/xproperty/config.yml create mode 100644 recipes/xqilla/all/conandata.yml create mode 100644 recipes/xqilla/all/conanfile.py create mode 100644 recipes/xqilla/all/patches/0001-honor-deps-ldflags.patch create mode 100644 recipes/xqilla/all/test_package/CMakeLists.txt create mode 100644 recipes/xqilla/all/test_package/conanfile.py create mode 100644 recipes/xqilla/all/test_package/test_package.cpp create mode 100644 recipes/xqilla/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xqilla/all/test_v1_package/conanfile.py create mode 100644 recipes/xqilla/config.yml create mode 100644 recipes/xsd/all/conandata.yml create mode 100644 recipes/xsd/all/conanfile.py create mode 100644 recipes/xsd/all/patches/0002-missing-include.patch create mode 100644 recipes/xsd/all/patches/0100-C++Parser_Expat_support.patch create mode 100644 recipes/xsd/all/patches/0105-Fix_path_handling_bug.patch create mode 100644 recipes/xsd/all/patches/0110-xerces-c3.2.patch create mode 100644 recipes/xsd/all/patches/0700_hurd_PATH_MAX.patch create mode 100644 recipes/xsd/all/test_package/conanfile.py create mode 100644 recipes/xsd/config.yml create mode 100644 recipes/xsimd/all/conandata.yml create mode 100644 recipes/xsimd/all/conanfile.py create mode 100644 recipes/xsimd/all/test_package/CMakeLists.txt create mode 100644 recipes/xsimd/all/test_package/conanfile.py create mode 100644 recipes/xsimd/all/test_package/test_package.cpp create mode 100644 recipes/xsimd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xsimd/all/test_v1_package/conanfile.py create mode 100644 recipes/xsimd/config.yml create mode 100644 recipes/xtensor/all/conandata.yml create mode 100644 recipes/xtensor/all/conanfile.py create mode 100644 recipes/xtensor/all/patches/0.21.4-cxx11-abi.patch create mode 100644 recipes/xtensor/all/patches/0.21.5-cxx11-abi.patch create mode 100644 recipes/xtensor/all/patches/0.23.9-cxx11-abi.patch create mode 100644 recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch create mode 100644 recipes/xtensor/all/test_package/CMakeLists.txt create mode 100644 recipes/xtensor/all/test_package/conanfile.py create mode 100644 recipes/xtensor/all/test_package/test_package.cpp create mode 100644 recipes/xtensor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xtensor/all/test_v1_package/conanfile.py create mode 100644 recipes/xtensor/config.yml create mode 100644 recipes/xtl/all/conandata.yml create mode 100644 recipes/xtl/all/conanfile.py create mode 100644 recipes/xtl/all/test_package/CMakeLists.txt create mode 100644 recipes/xtl/all/test_package/conanfile.py create mode 100644 recipes/xtl/all/test_package/test_package.cpp create mode 100644 recipes/xtl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xtl/all/test_v1_package/conanfile.py create mode 100644 recipes/xtl/config.yml create mode 100644 recipes/xtr/all/conandata.yml create mode 100644 recipes/xtr/all/conanfile.py create mode 100644 recipes/xtr/all/test_package/CMakeLists.txt create mode 100644 recipes/xtr/all/test_package/conanfile.py create mode 100644 recipes/xtr/all/test_package/example.cpp create mode 100644 recipes/xtr/config.yml create mode 100644 recipes/xtrans/all/conanfile.py create mode 100644 recipes/xtrans/all/test_package/conanfile.py create mode 100644 recipes/xtrans/all/test_v1_package/conanfile.py create mode 100644 recipes/xtrans/config.yml create mode 100644 recipes/xxhash/all/conandata.yml create mode 100644 recipes/xxhash/all/conanfile.py create mode 100644 recipes/xxhash/all/patches/0.8.1-fix-cmakelists.patch create mode 100644 recipes/xxhash/all/patches/0.8.1-fix-static-assert-link-error.patch create mode 100644 recipes/xxhash/all/test_package/CMakeLists.txt create mode 100644 recipes/xxhash/all/test_package/conanfile.py create mode 100644 recipes/xxhash/all/test_package/test_package.c create mode 100644 recipes/xxhash/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xxhash/all/test_v1_package/conanfile.py create mode 100644 recipes/xxhash/config.yml create mode 100644 recipes/xxsds-sdsl-lite/all/conandata.yml create mode 100644 recipes/xxsds-sdsl-lite/all/conanfile.py create mode 100644 recipes/xxsds-sdsl-lite/all/patches/bits.hpp.patch create mode 100644 recipes/xxsds-sdsl-lite/all/patches/util.hpp.patch create mode 100644 recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt create mode 100644 recipes/xxsds-sdsl-lite/all/test_package/conanfile.py create mode 100644 recipes/xxsds-sdsl-lite/all/test_package/test_package.cpp create mode 100644 recipes/xxsds-sdsl-lite/config.yml create mode 100644 recipes/xz_utils/all/conandata.yml create mode 100644 recipes/xz_utils/all/conanfile.py create mode 100644 recipes/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch create mode 100644 recipes/xz_utils/all/test_package/CMakeLists.txt create mode 100644 recipes/xz_utils/all/test_package/conanfile.py create mode 100644 recipes/xz_utils/all/test_package/test_package.c create mode 100644 recipes/xz_utils/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xz_utils/all/test_v1_package/conanfile.py create mode 100644 recipes/xz_utils/config.yml create mode 100644 recipes/yaclib/all/conandata.yml create mode 100644 recipes/yaclib/all/conanfile.py create mode 100644 recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch create mode 100644 recipes/yaclib/all/patches/0002-Add-install-commands.patch create mode 100644 recipes/yaclib/all/test_package/CMakeLists.txt create mode 100644 recipes/yaclib/all/test_package/conanfile.py create mode 100644 recipes/yaclib/all/test_package/test_package.cpp create mode 100644 recipes/yaclib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/yaclib/all/test_v1_package/conanfile.py create mode 100644 recipes/yaclib/config.yml create mode 100644 recipes/yajl/all/conandata.yml create mode 100644 recipes/yajl/all/conanfile.py create mode 100644 recipes/yajl/all/test_package/CMakeLists.txt create mode 100644 recipes/yajl/all/test_package/conanfile.py create mode 100644 recipes/yajl/all/test_package/test_package.c create mode 100644 recipes/yajl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/yajl/all/test_v1_package/conanfile.py create mode 100644 recipes/yajl/config.yml create mode 100644 recipes/yaml-cpp/all/conandata.yml create mode 100644 recipes/yaml-cpp/all/conanfile.py create mode 100644 recipes/yaml-cpp/all/patches/0001-install-0.7.0.patch create mode 100644 recipes/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch create mode 100644 recipes/yaml-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/yaml-cpp/all/test_package/conanfile.py create mode 100644 recipes/yaml-cpp/all/test_package/test_package.cpp create mode 100644 recipes/yaml-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/yaml-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/yaml-cpp/config.yml create mode 100644 recipes/yandex-ozo/all/conandata.yml create mode 100644 recipes/yandex-ozo/all/conanfile.py create mode 100644 recipes/yandex-ozo/all/test_package/CMakeLists.txt create mode 100644 recipes/yandex-ozo/all/test_package/conanfile.py create mode 100644 recipes/yandex-ozo/all/test_package/request.cpp create mode 100644 recipes/yandex-ozo/config.yml create mode 100644 recipes/yas/all/conandata.yml create mode 100644 recipes/yas/all/conanfile.py create mode 100644 recipes/yas/all/test_package/CMakeLists.txt create mode 100644 recipes/yas/all/test_package/conanfile.py create mode 100644 recipes/yas/all/test_package/test_package.cpp create mode 100644 recipes/yas/config.yml create mode 100644 recipes/yasm/all/conandata.yml create mode 100644 recipes/yasm/all/conanfile.py create mode 100644 recipes/yasm/all/patches/0001-cmake-updates.patch create mode 100644 recipes/yasm/all/test_package/conanfile.py create mode 100644 recipes/yasm/all/test_v1_package/conanfile.py create mode 100644 recipes/yasm/config.yml create mode 100644 recipes/yder/all/conandata.yml create mode 100644 recipes/yder/all/conanfile.py create mode 100644 recipes/yder/all/patches/1.4.18-0001-shared-static-conan.patch create mode 100644 recipes/yder/all/test_package/CMakeLists.txt create mode 100644 recipes/yder/all/test_package/conanfile.py create mode 100644 recipes/yder/all/test_package/test_package.c create mode 100644 recipes/yder/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/yder/all/test_v1_package/conanfile.py create mode 100644 recipes/yder/config.yml create mode 100644 recipes/yojimbo/all/conandata.yml create mode 100644 recipes/yojimbo/all/conanfile.py create mode 100644 recipes/yojimbo/all/submoduledata.yml create mode 100644 recipes/yojimbo/all/test_package/CMakeLists.txt create mode 100644 recipes/yojimbo/all/test_package/conanfile.py create mode 100644 recipes/yojimbo/all/test_package/test_package.cpp create mode 100644 recipes/yojimbo/config.yml create mode 100644 recipes/yyjson/all/conandata.yml create mode 100644 recipes/yyjson/all/conanfile.py create mode 100644 recipes/yyjson/all/test_package/CMakeLists.txt create mode 100644 recipes/yyjson/all/test_package/conanfile.py create mode 100644 recipes/yyjson/all/test_package/test_package.c create mode 100644 recipes/yyjson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/yyjson/all/test_v1_package/conanfile.py create mode 100644 recipes/yyjson/config.yml create mode 100644 recipes/z3/all/CMakeLists.txt create mode 100644 recipes/z3/all/conandata.yml create mode 100644 recipes/z3/all/conanfile.py create mode 100644 recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch create mode 100644 recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch create mode 100644 recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch create mode 100644 recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch create mode 100644 recipes/z3/all/test_package/CMakeLists.txt create mode 100644 recipes/z3/all/test_package/conanfile.py create mode 100644 recipes/z3/all/test_package/test_package.cpp create mode 100644 recipes/z3/config.yml create mode 100644 recipes/zbar/all/conandata.yml create mode 100644 recipes/zbar/all/conanfile.py create mode 100644 recipes/zbar/all/patches/0001-support-aarch.patch create mode 100644 recipes/zbar/all/test_package/CMakeLists.txt create mode 100644 recipes/zbar/all/test_package/conanfile.py create mode 100644 recipes/zbar/all/test_package/test_package.c create mode 100644 recipes/zbar/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zbar/all/test_v1_package/conanfile.py create mode 100644 recipes/zbar/config.yml create mode 100644 recipes/zeromq/all/conandata.yml create mode 100644 recipes/zeromq/all/conanfile.py create mode 100644 recipes/zeromq/all/patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch create mode 100644 recipes/zeromq/all/patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch create mode 100644 recipes/zeromq/all/patches/0003-rpath-macos-4.3.2.patch create mode 100644 recipes/zeromq/all/patches/0003-rpath-macos-4.3.3.patch create mode 100644 recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch create mode 100644 recipes/zeromq/all/test_package/CMakeLists.txt create mode 100644 recipes/zeromq/all/test_package/conanfile.py create mode 100644 recipes/zeromq/all/test_package/test_package.cpp create mode 100644 recipes/zeromq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zeromq/all/test_v1_package/conanfile.py create mode 100644 recipes/zeromq/config.yml create mode 100644 recipes/zfp/all/conandata.yml create mode 100644 recipes/zfp/all/conanfile.py create mode 100644 recipes/zfp/all/test_package/CMakeLists.txt create mode 100644 recipes/zfp/all/test_package/conanfile.py create mode 100644 recipes/zfp/all/test_package/test_package.cpp create mode 100644 recipes/zfp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zfp/all/test_v1_package/conanfile.py create mode 100644 recipes/zfp/config.yml create mode 100644 recipes/zimg/all/conandata.yml create mode 100644 recipes/zimg/all/conanfile.py create mode 100644 recipes/zimg/all/patches/0001-msvc-remove-windows-target-platform.patch create mode 100644 recipes/zimg/all/patches/0002-msvc-solution.patch create mode 100644 recipes/zimg/all/patches/0003-include-stddef.patch create mode 100644 recipes/zimg/all/test_package/CMakeLists.txt create mode 100644 recipes/zimg/all/test_package/conanfile.py create mode 100644 recipes/zimg/all/test_package/test_package.c create mode 100644 recipes/zimg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zimg/all/test_v1_package/conanfile.py create mode 100644 recipes/zimg/config.yml create mode 100644 recipes/zint/all/conandata.yml create mode 100644 recipes/zint/all/conanfile.py create mode 100644 recipes/zint/all/patches/0001-2.10.0-conan-integration.patch create mode 100644 recipes/zint/all/test_package/CMakeLists.txt create mode 100644 recipes/zint/all/test_package/conanfile.py create mode 100644 recipes/zint/all/test_package/test_package.c create mode 100644 recipes/zint/all/test_package/test_package.cpp create mode 100644 recipes/zint/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zint/all/test_v1_package/conanfile.py create mode 100644 recipes/zint/config.yml create mode 100644 recipes/zlib-ng/all/conandata.yml create mode 100644 recipes/zlib-ng/all/conanfile.py create mode 100644 recipes/zlib-ng/all/test_package/CMakeLists.txt create mode 100644 recipes/zlib-ng/all/test_package/conanfile.py create mode 100644 recipes/zlib-ng/all/test_package/test_package.c create mode 100644 recipes/zlib-ng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zlib-ng/all/test_v1_package/conanfile.py create mode 100644 recipes/zlib-ng/config.yml create mode 100644 recipes/zlib/all/conandata.yml create mode 100644 recipes/zlib/all/conanfile.py create mode 100644 recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch create mode 100644 recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch create mode 100644 recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch create mode 100644 recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch create mode 100644 recipes/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch create mode 100644 recipes/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch create mode 100644 recipes/zlib/all/test_package/CMakeLists.txt create mode 100644 recipes/zlib/all/test_package/conanfile.py create mode 100644 recipes/zlib/all/test_package/test_package.c create mode 100644 recipes/zlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zlib/all/test_v1_package/conanfile.py create mode 100644 recipes/zlib/config.yml create mode 100644 recipes/zmarok-semver/all/conandata.yml create mode 100644 recipes/zmarok-semver/all/conanfile.py create mode 100644 recipes/zmarok-semver/all/patches/0001-unused-var-fix.patch create mode 100644 recipes/zmarok-semver/all/patches/0002-macro-invocation-fix.patch create mode 100644 recipes/zmarok-semver/all/test_package/CMakeLists.txt create mode 100644 recipes/zmarok-semver/all/test_package/conanfile.py create mode 100644 recipes/zmarok-semver/all/test_package/test_package.cpp create mode 100644 recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zmarok-semver/all/test_v1_package/conanfile.py create mode 100644 recipes/zmarok-semver/config.yml create mode 100644 recipes/zmqpp/all/conandata.yml create mode 100644 recipes/zmqpp/all/conanfile.py create mode 100644 recipes/zmqpp/all/patches/0001-fix-cmake.patch create mode 100644 recipes/zmqpp/all/patches/0002-missing-includes.patch create mode 100644 recipes/zmqpp/all/patches/0003-Allow-building-with-Werror-undef.patch create mode 100644 recipes/zmqpp/all/test_package/CMakeLists.txt create mode 100644 recipes/zmqpp/all/test_package/conanfile.py create mode 100644 recipes/zmqpp/all/test_package/test_package.cpp create mode 100644 recipes/zmqpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zmqpp/all/test_v1_package/conanfile.py create mode 100644 recipes/zmqpp/config.yml create mode 100644 recipes/zopfli/all/conandata.yml create mode 100644 recipes/zopfli/all/conanfile.py create mode 100644 recipes/zopfli/all/test_package/CMakeLists.txt create mode 100644 recipes/zopfli/all/test_package/conanfile.py create mode 100644 recipes/zopfli/all/test_package/test_package.c create mode 100644 recipes/zopfli/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zopfli/all/test_v1_package/conanfile.py create mode 100644 recipes/zopfli/config.yml create mode 100644 recipes/zpp_bits/all/conandata.yml create mode 100644 recipes/zpp_bits/all/conanfile.py create mode 100644 recipes/zpp_bits/all/test_package/CMakeLists.txt create mode 100644 recipes/zpp_bits/all/test_package/conanfile.py create mode 100644 recipes/zpp_bits/all/test_package/test_package.cpp create mode 100644 recipes/zpp_bits/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zpp_bits/all/test_v1_package/conanfile.py create mode 100644 recipes/zpp_bits/config.yml create mode 100644 recipes/zpp_throwing/all/conandata.yml create mode 100644 recipes/zpp_throwing/all/conanfile.py create mode 100644 recipes/zpp_throwing/all/test_package/CMakeLists.txt create mode 100644 recipes/zpp_throwing/all/test_package/conanfile.py create mode 100644 recipes/zpp_throwing/all/test_package/test_package.cpp create mode 100644 recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zpp_throwing/all/test_v1_package/conanfile.py create mode 100644 recipes/zpp_throwing/config.yml create mode 100644 recipes/zstd/all/conandata.yml create mode 100644 recipes/zstd/all/conanfile.py create mode 100644 recipes/zstd/all/patches/1.3.5-cmake-project.patch create mode 100644 recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch create mode 100644 recipes/zstd/all/patches/1.5.0-remove-explicit-standard-setting.patch create mode 100644 recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch create mode 100644 recipes/zstd/all/patches/1.5.2-cmake-remove-asm-except-x86_64.patch create mode 100644 recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch create mode 100644 recipes/zstd/all/test_package/CMakeLists.txt create mode 100644 recipes/zstd/all/test_package/conanfile.py create mode 100644 recipes/zstd/all/test_package/logo.png create mode 100644 recipes/zstd/all/test_package/test_package.c create mode 100644 recipes/zstd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zstd/all/test_v1_package/conanfile.py create mode 100644 recipes/zstd/config.yml create mode 100644 recipes/zstr/all/conandata.yml create mode 100644 recipes/zstr/all/conanfile.py create mode 100644 recipes/zstr/all/test_package/CMakeLists.txt create mode 100644 recipes/zstr/all/test_package/conanfile.py create mode 100644 recipes/zstr/all/test_package/test_package.cpp create mode 100644 recipes/zstr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zstr/all/test_v1_package/conanfile.py create mode 100644 recipes/zstr/config.yml create mode 100644 recipes/zug/all/conandata.yml create mode 100644 recipes/zug/all/conanfile.py create mode 100644 recipes/zug/all/test_package/CMakeLists.txt create mode 100644 recipes/zug/all/test_package/conanfile.py create mode 100644 recipes/zug/all/test_package/example.cpp create mode 100644 recipes/zug/config.yml create mode 100644 recipes/zulu-openjdk/all/conandata.yml create mode 100644 recipes/zulu-openjdk/all/conanfile.py create mode 100644 recipes/zulu-openjdk/all/test_package/conanfile.py create mode 100644 recipes/zulu-openjdk/all/test_v1_package/conanfile.py create mode 100644 recipes/zulu-openjdk/config.yml create mode 100644 recipes/zxing-cpp/all/conandata.yml create mode 100644 recipes/zxing-cpp/all/conanfile.py create mode 100644 recipes/zxing-cpp/all/patches/1.0.8-0001-Fix-C2327-for-MSVC-2015.patch create mode 100644 recipes/zxing-cpp/all/patches/1.0.8-0002-include-limits.patch create mode 100644 recipes/zxing-cpp/all/patches/1.0.8-0003-include-stdexcept.patch create mode 100644 recipes/zxing-cpp/all/patches/1.0.8-0004-include-cstddef.patch create mode 100644 recipes/zxing-cpp/all/patches/1.4.0-0001-fix-string-view.patch create mode 100644 recipes/zxing-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/zxing-cpp/all/test_package/conanfile.py create mode 100644 recipes/zxing-cpp/all/test_package/test_package.cpp create mode 100644 recipes/zxing-cpp/all/test_package/test_package_1.1.cpp create mode 100644 recipes/zxing-cpp/all/test_package/test_package_2.0.cpp create mode 100644 recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zxing-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/zxing-cpp/config.yml create mode 100644 recipes/zyre/all/CMakeLists.txt create mode 100644 recipes/zyre/all/conandata.yml create mode 100644 recipes/zyre/all/conanfile.py create mode 100644 recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch create mode 100644 recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch create mode 100644 recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch create mode 100644 recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch create mode 100644 recipes/zyre/all/patches/2.0.1-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch create mode 100644 recipes/zyre/all/test_package/CMakeLists.txt create mode 100644 recipes/zyre/all/test_package/conanfile.py create mode 100644 recipes/zyre/all/test_package/test_package.cpp create mode 100644 recipes/zyre/config.yml create mode 100644 recipes/zziplib/all/conandata.yml create mode 100644 recipes/zziplib/all/conanfile.py create mode 100644 recipes/zziplib/all/patches/0.13.71-001_fix.patch create mode 100644 recipes/zziplib/all/patches/0.13.72-001_fix.patch create mode 100644 recipes/zziplib/all/test_package/CMakeLists.txt create mode 100644 recipes/zziplib/all/test_package/conanfile.py create mode 100644 recipes/zziplib/all/test_package/test_package.c create mode 100644 recipes/zziplib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zziplib/all/test_v1_package/conanfile.py create mode 100644 recipes/zziplib/config.yml diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml new file mode 100644 index 0000000000000..50bd402bbb45c --- /dev/null +++ b/.c3i/authorized_users.yml @@ -0,0 +1,1156 @@ +authorized_users: +- github-actions[bot] +- conan-center-bot +- c3i-dev +- uilianries +- SSE4 +- Croydon +- Johnnyxy +- solvingj +- ericLemanissier +- tru +- sztomi +- theodelrieu +- grafikrobot +- piponazo +- minimonium +- lasote +- danimtb +- memsharded +- jgsogo +- czoido +- jcar87 +- theirix +- madebr +- sourcedelica +- obiltschnig +- martinmoene +- tonka3000 +- leonardoarcari +- bmanga +- flexferrum +- gocarlos +- flostellbrink +- rvarago +- cqjjjzr +- akemimadoka +- bverhagen +- IceflowRE +- mjvk +- Morwenn +- Talkless +- sgiessl +- KristianJerpetjon +- paulbendixen +- datalogics-robb +- PinkySan +- keysight-daryl +- gunmetal313 +- rdeterre +- Hopobcn +- rikdev +- arcadien +- aostrowski +- reneme +- abbyssoul +- ledocc +- fpelliccioni +- PierreRamoin +- yipdw +- soporide +- detwiler +- hrantzsch +- figroc +- robert-shade +- KaoCC +- planetmarshall +- cirla +- vaerizk +- Dattax +- TimSimpson +- intelligide +- ericriff +- renatofilho +- puetzk +- calvingiles +- raffienficiaud +- chfanghr +- dvirtz +- greenjava +- apeterson-branch +- david-sinuela-pix4d +- BlueSolei +- AndWass +- SpaceIm +- prsolucoes +- yssource +- dheater +- GavinNL +- sourcedelica +- kf6kjg +- StefansM +- Psy-Kai +- LunarWatcher +- nicoguillier +- a4z +- p-podsiadly +- tarc +- n-bes +- Manu343726 +- greenrobot +- KingKili +- Adnn +- arnesor +- gummif +- btashton +- osfd +- maddanio +- likle +- mbodmer +- feragon +- claremacrae +- nicolastagliani +- samuelpmish +- Garcia6l20 +- RemySphere +- pleroux0 +- qchateau +- datalogics-kam +- tt4g +- akshit-sharma +- jargonzombies +- xqp +- alnkpa +- prince-chrismc +- bk2221 +- igl42 +- casabre +- Nipheris +- faker00t +- vvilpas +- fredrikslattman +- worldemar +- rurabori +- chhitz +- zod +- Twon +- miketsukerman +- mgoldshteyn +- dab0bby +- atilag +- floriansimon1 +- jjkoshy +- kasunch +- mapau +- igor-sadchenko +- fulara +- BNL-Corp +- pyrige +- ZaMaZaN4iK +- rudolfheszele +- philburr +- vishsangale +- Artalus +- vanwinkeljan +- renatoGarcia +- Nekto89 +- gonestco +- xyz1001 +- axalon900 +- jfalcou +- pss146 +- zhenlei +- datalogics-aarroyo +- serpent7776 +- AndrewMeadows +- neobrain +- oxycoder +- dvd0101 +- anagno +- odygrd +- datalogics-kam +- ChaosWars +- ash7777 +- csch0 +- daixian +- Murazaki +- garethsb-sony +- Austin299792 +- FranckRJ +- danielaparker +- 0x8000-0000 +- ah7675 +- jmarrec +- icraggs +- davidtazy +- kchmck +- PavelKisliak +- vvandrounik +- pavanbadugu +- isnullxbh +- Michanne +- markusgod +- syoliver +- daravi +- museghost +- pezcode +- hnOsmium0001 +- kaihowl +- deimi +- tomlankhorst +- frek818 +- ddalcino +- saukijan +- sandro97git +- hoxnox +- madduci +- goranbrkic +- mohamedghita +- rweickelt +- faithfracture +- wolfee001 +- empyrical +- birgerbr +- akosik-anyvision +- jeremy-coulon +- TheStormN +- gmgunter +- ibmibmibm +- daniellecandid +- AGreat1 +- ytimenkov +- memchk +- lederernc +- lkotsonis +- DrewImm +- martin-schulze-vireso +- wdobbe +- Flow-It +- burace17 +- sam-mosleh +- db4 +- jaspervandeven +- DavidZemon +- yelu +- bibermann +- baltendorf +- Mahe-Thomas +- Eremiell +- d70-t +- ufkesba +- frtru +- Janos95 +- siebenschlaefer +- marzer +- timblechmann +- dBagrat +- lemire +- talyz +- rconde01 +- SemyonDuB +- reuk +- ppetraki +- ZachClayburn +- SergiusTheBest +- kirandivekar +- jaredkeithwhite +- DavidAce +- zhangyoufu +- nqle +- rushikesh90 +- marcvilletard +- klimkin +- jheaff1 +- Bigpet +- derived-coder +- thclark +- sielicki +- helmesjo +- dskachan +- johanneskares +- GirtsR +- greeng3 +- mattgodbolt +- mathbunnyru +- ngerke +- TheLavaBlock +- greeng3 +- ItsBasi +- yamadapc +- afedechko +- pmqtt +- uyha +- GIGte +- ctapmex +- ohanar +- bernedom +- ericniebler +- mmha +- mjvankampen +- ivan-kulikov-dev +- ntagliani +- bnlcorp +- Alberto-Izquierdo +- an-tao +- p-ranav +- omaralvarez +- djcsdy +- pepsiman +- Fefer-Ivan +- iblancasa +- dongskyler +- MartinDelille +- samr +- cen1 +- stefan-floeren +- oleurodecision +- tbeu +- joxoby +- halfelf +- matt-42 +- sunnycase +- ldobinson +- xiaotianrandom +- mpusz +- Erlkoenig90 +- mzdun +- annulen +- fmorgner +- gmikhaile +- wwhuie +- kyllingstad +- desertfury +- yarrr-ru +- fschoenm +- bel2125 +- melak47 +- b1ackviking +- remysalim +- hosseinmoein +- illume +- srnwk +- boussaffawalid +- atrelinski +- Arenoros +- narcdev +- steinerthomas +- w4bremer +- ddark008 +- andioz +- OleksiiKyslynskyi +- verybigbadboy +- bobrofon +- newlawrence +- ThomasHauth +- nicraMarcin +- dankamongmen +- davehadley +- G3nna +- dertuxmalwieder +- arlyon +- remiburtin +- mplemay +- mys007 +- jwellbelove +- gopaldappdev +- ngrodzitski +- spjuanjoc +- hongyx11 +- morth +- selaci +- hdhauk +- libbylg +- cacay +- fatliverfreddy +- dnck +- balintfodor +- blackliner +- HeinrichJanzing +- Nick-Deubert-Bose +- ruanformigoni +- CAMOBAP +- jwillikers +- bowb +- dsakurai +- dooho-h +- dmn-star +- avantgardnerio +- ShuangLiu1992 +- justinmcbride +- resttime +- ubnt-kannan +- taoyouh +- skannan89 +- paulo-coutinho +- AndreyMlashkin +- AndyMender +- triangulumlabs +- Woazim +- shubhamck +- Lukas-Heiligenbrunner +- marius-meissner +- Mikayex +- n-stone +- IvanRibakov +- dfontenot +- JonasProgrammer +- plopp +- sebastian-bergt +- xguerin +- Dobiasd +- ChGen +- Jonathan-Eid +- ihsandemir +- Marks101 +- whuji +- jiangdawhy +- MichelleHetzel +- Pro +- anton-dirac +- petiaccja +- Expander +- kdsx +- wolfram77 +- dsakilesh +- mdavezac +- Jihadist +- anton-danielsson +- rawbby +- wuzhiguocarter +- GaryN4 +- TheSalvator +- fcelda +- toge +- maksim-0 +- blackencino +- lukaszlaszko +- pichi-router +- dernasherbrezon +- bsergean +- krzysztof-jusiak +- riebl +- ruilvo +- jhurliman +- ralfholly +- MaxSac +- Linux13524 +- IanE9 +- upsj +- Hippskill +- ksamelyuk +- doshisahil +- FlayaN +- uglyog +- alex-87 +- mologie +- ChatPion +- heyzooi +- Firefly35 +- maxmouchet +- dvj +- bitwizeshift +- ondrej-outrata +- rileylev +- ltjax +- sloriot +- wbitesi +- canmor +- whyman +- garethsb +- sixten-hilborn +- qoelet +- lawrence-koh +- adrianjrg +- ayeganov +- tetsuo-cpp +- AlvaroFS +- ivabrajer +- kebadopp +- qoo2p5 +- aapocketz +- mbeutel +- redradist +- accwebs +- ZombieRaccoon +- hoyes +- rtosman +- ivalery111 +- krsch +- jothepro +- Jean1995 +- tomas-krupa +- ollien +- tupini07 +- yuanliuus +- luismartingil +- mydatamodels +- pixsperdavid +- rockdreamer +- jpilet +- voidbar +- jayaramganapathy +- AJIOB +- th-lp +- penfeizhou +- tapia +- igormironchik +- rkozakban +- avsej +- jakecobb +- johnmcfarlane +- FernandoVelcic +- LHLaurini +- dotChris90 +- mymichu +- i-vovk +- lakinwecker +- hpesoj +- shiena +- aurelienpre +- lieser +- zspasztori +- HRenata +- alejandro-colomar +- leha-bot +- werto87 +- cguentherTUChemnitz +- mmatrosov +- cesenaLA +- chgans +- sabelka +- stefled +- PengZheng +- mez +- beckerhe +- serszab +- mtrzas +- zuut +- JohanZackrisson +- VladimirVR +- franramirez688 +- nicholas-kelly +- yemreinci +- alvarogarcia7 +- daniele77 +- Renari +- AlexanderLanin +- Guyutongxue +- rockandsalt +- thmahe +- slietzau +- fennibay +- Konard +- uselessgoddess +- espositofulvio +- Elnee +- tisonkun +- AshleyRoll +- inparallel +- vcampmany +- 3d4m-vladimir +- thesummer +- NolanC33 +- Chnossos +- spaque-qustodio +- maxis11 +- cqc-alec +- Zugzwanger +- maspri +- ghorbanzade +- pchamuczynski +- Sahnvour +- torfinnberset +- davidsanfal +- COM8 +- seladb +- vvarma +- smsm2014 +- jngrb +- dilawar +- cbachhuber +- mmatisko +- sparik +- samuel-emrys +- lordafzal +- jayvdb +- wwizz +- sh0 +- jtorresfabra +- Snowapril +- ryanseipp +- exief +- Lemiort +- tcanabrava +- k0ekk0ek +- gerd2s +- Divix55 +- hannahwhy +- zodinyac +- claudius-kienle +- choll +- erikzenker +- dannftk +- Jairard +- Nicky-D +- pgeler +- gmeeker +- gokhanettin +- emwap +- vbieleny +- FusionBolt +- krotitom-embedded +- SamsonBox +- SkillerRaptor +- KerstinKeller +- hemantkashniyal +- ThePirate42 +- jhabermas +- TheClonerx +- FMeinicke +- isidore +- corporategoth +- nightlark +- jpauwels +- LighthouseJ +- vbeffara +- ChrisRuff +- eigenwhat +- samvik +- xissburg +- SuTanTank +- bemehiser +- szavadsky +- nfrechette +- patmantru +- kenfred +- coryan +- ciclark2 +- serge1 +- PatSche +- Mo-Tay +- kexianda +- dvetutnev +- mwcondino +- YaZasnyal +- walterbrebels +- tuxu +- dev-plvlml +- woidpointer +- dkruempe +- ehds +- sase-cs +- idealvin +- seemk +- chausner +- loic-lopez +- PolyPik +- fdgStilla +- jputcu +- ivmai +- Speak2Erase +- miklelappo +- ivanvurbanov +- cc0der +- kubasz +- killzoner +- MathiasDanzeisen +- mosure +- avitevet +- AntonHorbach +- darcamo +- DonOregano +- sebastianbergt +- yuriy-mochurad +- jtcarnes +- ValentiWorkLearning +- eyalroz +- Zvicii +- SteelBlueVision +- Fettpet +- sobotklp +- andiwand +- pdavydov108 +- gjasny +- eirikb +- wpalfi +- vkes +- wouterz +- szigetics +- kovdan01 +- willadsen +- michalwidera +- FlexW +- wizardsd +- eeyrw +- nioncode +- Kr4is +- tonyseek +- kevswims +- Tarek-Hasan +- SerkanTuerker +- Carsten87 +- aacebedo +- maximiliank +- drmacdon +- somedevfox +- Zeeno-atl +- hardsetting +- friendlyanon +- MrLIk +- OrianeGourdyStilla +- chusitoo +- csegarragonz +- dean0x7d +- MauriceS-WTI +- Lorac +- sonicxml +- elazarl +- synacker +- jtbandes +- gouriano +- hiemstar +- Enhex +- luk1337 +- ChristianPanov +- JurajX +- pedro-alves-ferreira +- BenjaminNavarro +- sophieeihpos +- jowr +- aruizs +- pbreaux +- fardragon +- njacquemin1993 +- earonesty +- capnkenny +- kring +- sanblch +- winternet +- jlouazel +- JonathanGirardeau +- BishopJohnson +- Tzoockee +- PeteAudinate +- Cyriuz +- ArashPartow +- dpronin +- The-EDev +- artem-ogre +- krzysztofskorupski +- jt416 +- Pollux42 +- gracicot +- Siviuze +- ggulgulia +- ondrej-benus +- RubyNova +- HerrNamenlos123 +- naresh97 +- rnapier +- eerimoq +- bb010g +- paulocoutinhox +- WilliamBehrens +- greg7mdp +- ruurdadema +- steromano87 +- marsven +- DS-Serafin +- DS-Alex-AG +- cbeattie-tl +- '0x28' +- nmgwddj +- brandonmkunkel +- MykolaPu +- petamas +- icarusdes +- the-nic +- zjg +- rfn123 +- icedream2linxi +- MikeLankamp +- AnotherFoxGuy +- fdefelici +- basiliscos +- svenpilz +- sfackler +- AnticliMaxtic +- serghov +- erikogenvik +- dssimonspoerri +- bysnack +- hannesa2 +- Aypahyo +- chausner-audeering +- gleb-kov +- Yen5666 +- jkimblad +- impugachev +- sebhmg +- sujankota +- 5chmidti +- l2dy +- DamDsj +- Anokhi1994 +- mscofield0 +- alex-700 +- StellaSmith +- buresu +- yzsolt +- aborzunov +- jsantorek +- tmartiel +- rbrich +- HappySeaFox +- hlewin +- victor1234 +- nextsilicon-itay-bookstein +- ekondis +- luizgabriel +- kshehata +- dietssa +- simoncent +- staskau +- Iswenzz +- DAP-IT-Aachen +- VladyslavUsenko +- vdsbenoit +- Macfly +- hesham-essam +- mkviatkovskii +- sgoth +- hellozee +- Ryan-rsm-McKenzie +- bog-dan-ro +- dennisjosesilva +- bartop +- cameron-devine +- wadimklincov +- vectorsli +- paulharris +- pbailey-hf +- Cogitri +- Sil3ntStorm +- jstzwj +- eseiler +- npuichigo +- dfleury2 +- bigerl +- EKathe +- hmartinez82 +- sfc-gh-mpilman +- apogza +- ameysutavani +- sify21 +- eigenraven +- jay-tux +- baptisteesteban +- chenpengfei +- minlexx +- kou +- 0xbk +- dsche +- tk-tnz +- strangeQuark1041 +- tuduongquyet +- lbakman +- gogoprog +- mvhv +- FreePhoenix888 +- tuccio +- martinvl +- robomics +- EricDeng1001 +- agom +- tsondergaard +- xhuohai +- Mitron57 +- EstebanDugueperoux2 +- suhasHere +- Tradias +- NeXuS4Developer +- jellespijker +- bshoshany +- Chrismarsh +- ice0 +- krjakbrjak +- romariorios +- Latios96 +- 0xFireWolf +- ashkulz +- kenneth-jia +- jnordin20 +- jubalh +- joaotavora +- VestniK +- sheepgrass +- allen-zhou-dev +- daemyung +- szmyd +- lo1ol +- victorpaleologue +- FaerHack +- netheril96 +- atimin +- ssophie01 +- mietzen +- mourogurt +- hoisunng +- abouvier +- jadamwilson2 +- nilsnolde +- olivia76 +- CD3 +- ovostrikov +- t-8ch +- ingydotnet +- SirCosty +- mvoelkle-cern +- markferry +- mttbernardini +- ofiriluz +- ksmets +- jonathan-conder-sm +- Bueddl +- dornbirndevelops +- boofhead +- marcusl +- Makamitsu +- ulrichji +- kammce +- tomconder +- horusxnetworks +- Nomalah +- kambala-decapitator +- rainman110 +- jiangshipengv8 +- BjoernAtBosch +- dubvulture +- ZbigniewRA +- JorgenPo +- AlexRamallo +- kissandras +- scandyna +- jave27 +- mark0n +- kayoub5 +- topheg +- curoky +- datalogics-saharay +- sproberts92 +- madhat1 +- vince-cheung +- mariopil +- PikachuHyA +- System-Arch +- sorny92 +- cubanpit +- winterz +- Kidsunbo +- antony-jr +- tankeco +- ElliotMugner +- jfaust +- morningstar1 +- lrineau +- jwidauer +- partiallyderived +- Ahajha +- mjimenofluendo +- jiaoew1991 +- ramin-raeisi +- schoetbi +- psyinf +- Novakov +- maksim-petukhov +- roedhaetten +- nassipkali +- petrovito +- razielxyz +- da1910 +- RazielXYZ +- EmilienBINET +- Doome161 +- Sneder89 +- connorsmacd +- jshanab +- ghost +- zamazan4ik +- elliotcmorris +- Ignition +- je894591 +- AlexandrePTJ +- peterSW +- shiyj +- KGrzeg +- goodtune +- theartful +- Yuhanun +- feltech +- geirhei +- Clueliss +- andrewwasielewski +- chatpion +- kletoz +- agilemapper +- ZXfkSIE +- RubenRBS +- Alex-PLACET +- antekone +- ambroff +- tiolan +- MateuszMiekicki +- EricAtORS +- calebkiage +- bennyhuo +- ashuels +- jjcasmar +- kaipenglu +- ashley-b +- psmitsu +- Viatorus +- mkoviazin +- shtanko-sv +- larshg +- Wuqiqi123 +- OzanCansel +- marlamb +- alexsmedin +- n-morales +- calebgray +- technic +- guillaume-michel +- okaerin +- marknefedov +- jmaillard01 +- hpe-ykoehler +- dbarkar +- weinhold +- activtrak-dsalemizadeh +- axxel +- nicosmd +- impegoraro +- lukaumi +- mkmkme +- hobbeshunter +- rturrado +- wadehunk +- yekmen +- rechbergera +- hedtke +- Loki-Astari +- robbeykaaso +- LevWi +- Tsche +- Seadex-GmbH +- art-ignatev +- MrSparc +- ahmed192a +- maxpagani +- tim-goto +- tannerbitz +- PodnimatelPingvinov +- tmilnthorp +- IronTony-Stark +- edisonhello +- billyzheli +- xuzhenbao +- SunYu2004 +- Thibb1 +- achim-k +- JoelLefkowitz +- schuetzle-vector +- thejohnfreeman +- dimi309 +- valgur +- jakobrieke +- witte +- liarokapisv +- kielby +- mayeut +- CedricSchmeits +- mwerminski +- Kasurus +- barynton +- Daparrag +- roalter +- jsallay +- lmife +- granger35 +- bjoernrennfanz +- tylerjw +- fong7x7 +- zillemarco +- vlebourl +- akeles85 +- joakimono +- hkk2023 +- agagniere +- DuncanChisholm +- dariusarnold +- robbert-ef +- tobiashienzsch +- maikelvdh +- cmannett85 +- edahlseng +- yatagarasu25 +- elejke +- spnda +- forthib +- cprieto +- zhuoqiang +- bigcat26 +- KozhinovAlexander +- sykhro +- kuroneko +- swebb2066 +- grabowski-d +- pezy +- holger-detering +- carterian8 +- jdoubleu +- poretga99 +- stefanpantic-smallpdf +- sebsnyk +- mercierd +- Tobulus +- fklassen +- Geertien +- weatherhead99 +- OleksandrKvl +- bariscelik +- mralexlupu +- danicriss +- voronaam +- MatusKysel +- Sfletche132 +- stefanpantic-pdftools +- silvergasp +- doocman +- gouarin +- gegles +- jusito +- pwqbot +- ilya-lavrenov +- aubreynicoll +- j-carl +- jeffgarrett +- Maaown +- Knapock +- kaveish +- kwach +- BrettDong +- mtudan +- kontrybutor +- ThomasKes +- wbehrens-on-gh +- raulcd +- bwhitchurch +- jhunold +- Corallo +- JGatley +- christapley +- mpimenov +- ashvardanian +- 7bitcoder +- samuaz diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml new file mode 100644 index 0000000000000..07f9287b8fd1e --- /dev/null +++ b/.c3i/conan_v2_ready_references.yml @@ -0,0 +1,636 @@ +required_for_references: +- aaf +- aaplus +- abseil +- access_private +- acl +- ada +- ade +- aeron +- alac +- alpaca +- amgcl +- amqp-cpp +- android-ndk +- angelscript +- antlr4-cppruntime +- any-lite +- anyrpc +- approvaltests.cpp +- apr +- apr-util +- apriltag +- arcus +- arduinojson +- arg_router +- argh +- argon2 +- argparse +- args-parser +- argtable2 +- argtable3 +- arsenalgear +- asio +- asmjit +- astc-codec +- async_simple +- asyncplusplus +- audiofile +- autoconf +- automake +- avir +- aws-c-common +- aws-c-compression +- aws-c-sdkutils +- aws-checksums +- b2 +- b64 +- backport-cpp +- backward-cpp +- bacnet-stack +- baical-p7 +- base64 +- bdwgc +- bear +- benchmark +- bertrand +- bigint +- binutils +- bison +- bit-lite +- bitflags +- bitmagic +- bitserializer +- bitsery +- blaze +- blend2d +- bliss +- boolean-lite +- boolinq +- boost +- boost-ext-ut +- boost-leaf +- box2d +- brigand +- brotli +- brynet +- bullet3 +- butteraugli +- bvdberg-ctest +- byte-lite +- bzip2 +- bzip3 +- c-ares +- c-blosc +- c-blosc2 +- c-client +- c-dbg-macro +- c4core +- caf +- cajun-jsonapi +- calceph +- canary +- canvas_ity +- capnproto +- capstone +- catch2 +- ccache +- cccl +- cctz +- cd3-boost-unit-definitions +- celero +- cereal +- ceres-solver +- cfgfile +- cfitsio +- cgif +- cgns +- charls +- chef-fun +- chipmunk2d +- cimg +- circularbuffer +- cista +- cityhash +- civetweb +- cjson +- clara +- clhep +- cli11 +- clipper +- clove-unit +- cmake +- cmocka +- cmp +- cnpy +- coin-cgl +- coin-clp +- coin-lemon +- coin-osi +- coin-utils +- commata +- concurrencpp +- concurrentqueue +- cpp-httplib +- cpp-jwt +- cpp-lazy +- cpp-optparse +- cpp-peglib +- cpp-sort +- cppbenchmark +- cppcheck +- cppcodec +- cppfront +- cpptoml +- cppunit +- cpputest +- cpr +- cpu_features +- cpuinfo +- cqrlib +- crc32c +- create-dmg +- crunch +- cryptopp +- cs_libguarded +- csm +- cspice +- csvmonkey +- ctre +- cubicinterpolation +- cwalk +- cxxopts +- cyclonedds +- cyrus-sasl +- dacap-clip +- dataframe +- date +- dav1d +- daw_header_libraries +- daw_json_link +- daw_utf_range +- dbcppp +- dbus +- decimal_for_cpp +- dirent +- discount +- dlpack +- docopt.cpp +- doctest +- double-conversion +- doxygen +- draco +- dragonbox +- drflac +- drmp3 +- drwav +- duckdb +- eabase +- earcut +- easy_profiler +- ecos +- editline +- edlib +- effcee +- egl +- eigen +- elfio +- embree3 +- enet +- entityx +- enum-flags +- erikzenker-hsm +- erkir +- eternal +- etl +- exiv2 +- expat +- expected-lite +- exprtk +- ezc3d +- faac +- fakeit +- farmhash +- fast-cdr +- fast-dds +- fast_float +- ffmpeg +- fft +- fftw +- flac +- flann +- flatbuffers +- flex +- fmt +- fontconfig +- foonathan-lexy +- foonathan-memory +- fp16 +- freeglut +- freetype +- frozen +- ftxui +- function2 +- fxdiv +- g3log +- gamma +- gdbm +- gdcm +- gdk-pixbuf +- gemmlowp +- geos +- getopt-for-visual-studio +- gettext +- gflags +- ghc-filesystem +- giflib +- ginkgo +- glad +- glfw +- gli +- glib +- glm +- glog +- glslang +- glu +- gmp +- gnu-config +- gnutls +- googleapis +- gperf +- grpc +- grpc-proto +- gsl +- gsl-lite +- gsoap +- gtest +- gtk +- gurkenlaeufer +- h3 +- h5pp +- harfbuzz +- hdf5 +- hdrhistogram-c +- hidapi +- highfive +- highway +- hipony-enumerate +- hiredis +- homog2d +- http_parser +- icu +- iir1 +- im95able-rea +- imake +- imath +- imgui +- incbin +- indicators +- inja +- intel-neon2sse +- itlib +- jasper +- jbig +- joltphysics +- jom +- json-c +- json-schema-validator +- jsoncons +- jsoncpp +- jwt-cpp +- kangaru +- kmod +- ktx +- kuba-zip +- lcms +- ldns +- lemon +- leptonica +- lerc +- lexbor +- libalsa +- libarchive +- libatomic_ops +- libattr +- libbacktrace +- libbigwig +- libbsd +- libcap +- libcbor +- libcds +- libconfuse +- libcuckoo +- libcurl +- libde265 +- libdeflate +- libdisasm +- libdwarf +- libelf +- libepoxy +- libev +- libevent +- libexif +- libfdk_aac +- libffi +- libfreenect +- libfuse +- libgcrypt +- libgettext +- libgpg-error +- libgphoto2 +- libiberty +- libiconv +- libjpeg +- libjpeg-turbo +- libkml +- liblsl +- libltc +- liblzf +- libmodbus +- libmodplug +- libmorton +- libmount +- libmp3lame +- libmysqlclient +- libnabo +- libnop +- libnova +- libnuma +- libpcap +- libpciaccess +- libpng +- libpq +- libpqxx +- libpsl +- libqrencode +- librdkafka +- librealsense +- libressl +- librttopo +- libsamplerate +- libselinux +- libsgp4 +- libsmacker +- libsndfile +- libsodium +- libspatialindex +- libspng +- libsrtp +- libsvtav1 +- libsystemd +- libtar +- libtasn1 +- libtiff +- libtool +- libtorrent +- libudev +- libunwind +- libusb +- libuuid +- libuv +- libuvc +- libverto +- libvips +- libvpx +- libwebp +- libx264 +- libx265 +- libxls +- libxml2 +- libxslt +- libyuv +- libzen +- libzip +- libzippp +- lief +- linux-syscall-support +- lodepng +- lua +- luau +- lz4 +- m4 +- magic_enum +- make +- mariadb-connector-c +- matchit +- mbedtls +- md4c +- md4qt +- mdspan +- meson +- mgs +- mikelankamp-fpm +- mimalloc +- minisat +- minizip +- minizip-ng +- mongo-c-driver +- mozjpeg +- mpg123 +- ms-gsl +- msgpack-c +- msgpack-cxx +- msys2 +- namedtype +- nameof +- nanoflann +- nanorange +- nas +- nasm +- netcdf +- nettle +- ninja +- nlohmann_json +- nng +- nodejs +- norm +- nsync +- nuraft +- odbc +- ogdf +- ogg +- onetbb +- onnx +- onnxruntime +- openal +- openal-soft +- openapi-generator +- opencl-headers +- opencl-icd-loader +- openexr +- opengl +- opengv +- openh264 +- openjdk +- openjpeg +- openmesh +- openssl +- opensubdiv +- optional-lite +- opus +- opusfile +- osqp +- out_ptr +- paho-mqtt-c +- paho-mqtt-cpp +- patchelf +- pcapplusplus +- pcre +- pcre2 +- pdfgen +- pfr +- physx +- picobench +- picojson +- pkgconf +- poco +- popt +- proj +- prometheus-cpp +- proposal +- protobuf +- psimd +- pthreadpool +- pthreads4w +- pugixml +- pulseaudio +- pybind11 +- qhull +- qpdf +- quill +- quirc +- rabbitmq-c +- rang +- range-v3 +- rapidcheck +- rapidfuzz +- rapidjson +- rapidxml +- rapidyaml +- re2 +- readerwriterqueue +- readline +- readosm +- restbed +- restinio +- roaring +- robin-hood-hashing +- rttr +- ruy +- s2n +- scnlib +- screen_capture_lite +- sdl +- sdl_image +- seadex-essentials +- semimap +- sentry-breakpad +- serd +- sfml +- shield +- sigslot +- simdjson +- simdutf +- snappy +- soci +- sophus +- soplex +- soxr +- span-lite +- spdlog +- spirv-cross +- spirv-headers +- spirv-tools +- sqlite3 +- sqlite_orm +- sqlitecpp +- status-code +- stb +- strawberryperl +- string-view-lite +- symengine +- tabulate +- taocpp-json +- taocpp-pegtl +- taskflow +- tcb-span +- tcl +- tensorflow-lite +- tensorpipe +- termcap +- threadpool +- thrift +- tinycthread +- tinycthreadpool +- tinyexif +- tinymidi +- tinyxml2 +- tl-expected +- tlx +- toml11 +- trantor +- uni-algo +- unicorn +- univalue +- unordered_dense +- unqlite +- uriparser +- utf8proc +- utfcpp +- vaapi +- variant-lite +- vdpau +- veque +- vincentlaucsb-csv-parser +- volk +- vorbis +- vtu11 +- vulkan-headers +- vulkan-loader +- vulkan-memory-allocator +- vulkan-validationlayers +- wasmtime +- wasmtime-cpp +- wayland +- wayland-protocols +- websocketpp +- wg21-linear_algebra +- wil +- winflexbison +- wiringpi +- wise_enum +- wolfssl +- wslay +- wt +- wtl +- xapian-core +- xerces-c +- xkbcommon +- xkeyboard-config +- xmlsec +- xnnpack +- xorg +- xorg-cf-files +- xorg-gccmakedep +- xorg-macros +- xorg-makedepend +- xorg-proto +- xoshiro-cpp +- xsimd +- xtensor +- xtl +- xtrans +- xxhash +- xz_utils +- yajl +- yaml-cpp +- yasm +- zbar +- zeromq +- zfp +- zimg +- zlib +- zlib-ng +- zmarok-semver +- zstd +- zulu-openjdk diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml new file mode 100644 index 0000000000000..ce17baffab669 --- /dev/null +++ b/.c3i/config_v1.yml @@ -0,0 +1,193 @@ +--- +# Configuration for `https://github.com/conan-io/conan-center-index` repository +id: 'conan-io/conan-center-index' + +conan: + version: 1.59.0 + +artifactory: + url: "https://c3i.jfrog.io/c3i" + main_repo: "conan-center" + pull-request_repo_prefix: "c3i_PR" + pull-request_permission: "c3i-pr" + logs_repo: "misc" + cache_repo: "cache" + +github: + reviewers: "reviewers.yml" + authorized_users: "authorized_users.yml" + +slack: + credential_success_url: SLACK_SUCCESS_WEBHOOK_URL + ceredential_errors_url: SLACK_FAILURE_WEBHOOK_URL + +# Things related to Jenkins jobs +tasks: + access_request: + request_issue_url: https://github.com/conan-io/conan-center-index/issues/4 + max_inactivity_days: 0 + automatic_merge: + reviews_required_total: 2 # Reviews that a PR needs so it can be merged + reviews_required_team: 1 # Reviews from the Conan team that a PR needs so it can be merged + branches: # PRs from automations that have these as base-branches will be merged automatically + - "conan-io:action-doc-toc" + # 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)" + - name: "Lint changed conanfile.py (v2 migration)" + status_checks: + - name: "license/cla" + - name: "continuous-integration/jenkins/pr-merge" + - name: "c3i/conan-v2/pr-merge" + required_for_references: "conan_v2_ready_references.yml" + cci: + conan_v2_run_export: false + write_comments: true + detailed_status_checks: true + update_labels: true + wait_for_multibranch: # CCI jobs should wait for other multibranch job for that same PR + job_name: "prod-v2/cci" # e.g. "cci-v2/cci" -> this means waiting for cci-v2/cci/PR- + timeout_seconds: 600 # Maximum time to wait for the multibranch job + merge_messages: true # Merge messages from the multibranch job waited for + scheduled_export_check: + report_issue_url: https://github.com/conan-io/conan-center-index/issues/2232 + report_issue_append: false + +# Profile configurations to build packages +configurations: + - id: linux-gcc + epochs: [0] + hrname: "Linux, GCC" + content: + - os: [ "Linux" ] + arch: [ "x86_64" ] + compiler: + - "gcc": + compiler.libcxx: [ "libstdc++11" ] + compiler.version: [ "5", "7", "9", "10" ] + build_type: [ "Release", "Debug" ] + - id: linux-gcc + epochs: [20211221, 20220120] + hrname: "Linux, GCC" + content: + - os: ["Linux"] + arch: ["x86_64"] + compiler: + - "gcc": + compiler.libcxx: [ "libstdc++11" ] + compiler.version: ["5", "7", "9", "10", "11"] + build_type: ["Release", "Debug"] + - id: linux-clang + epochs: [20211221, 20220120] + hrname: "Linux, Clang" + content: + - os: ["Linux"] + arch: ["x86_64"] + compiler: + - "clang": + compiler.libcxx: ["libstdc++", "libc++"] + compiler.version: ["12", "13"] + build_type: ["Release", "Debug"] + - id: macos-clang + epochs: [0, 20211221] + hrname: "macOS, Clang" + content: + - os: [ "Macos" ] + arch: [ "x86_64" ] + compiler: + - "apple-clang": + compiler.version: [ "11.0", "12.0" ] + compiler.libcxx: [ "libc++" ] + build_type: [ "Release", "Debug" ] + - id: macos-clang + epochs: [20220120] + hrname: "macOS, Clang" + content: + - os: [ "Macos" ] + arch: [ "x86_64" ] + compiler: + - "apple-clang": + compiler.version: [ "13.0" ] + compiler.libcxx: [ "libc++" ] + build_type: [ "Release", "Debug" ] + - id: macos-m1-clang + epochs: [0, 20211221] + hrname: "macOS, Clang (M1/arm64)" + build_profile: + os: "Macos" + arch: "x86_64" + content: + - os: [ "Macos" ] + arch: [ "armv8" ] + compiler: + - "apple-clang": + compiler.version: [ "12.0" ] + compiler.libcxx: [ "libc++" ] + build_type: [ "Release", "Debug" ] + - id: macos-m1-clang + epochs: [20220120] + hrname: "macOS, Clang (M1/arm64)" + build_profile: + os: "Macos" + arch: "x86_64" + content: + - os: [ "Macos" ] + arch: [ "armv8" ] + compiler: + - "apple-clang": + compiler.version: [ "13.0" ] + compiler.libcxx: [ "libc++" ] + build_type: [ "Release", "Debug" ] + - id: windows-visual_studio + epochs: [0, 20211221, 20220120] + hrname: "Windows, Visual Studio" + content: + - os: [ "Windows" ] + arch: [ "x86_64" ] + compiler: + - "Visual Studio": + compiler.version: [ "16" ] + build_type: + - "Release": + compiler.runtime: [ "MD" ] + - "Debug": + compiler.runtime: [ "MDd" ] + +jenkins: + url: "http://mb-jenkins-my-bloody-jenkins:8080" + +node_labels: + Windows: + x86_64: + "Visual Studio": + default: "windows20221212" + Macos: + x86_64: + "apple-clang": + default: "mac_apple_clang_${compiler.version}" + armv8: + "apple-clang": + default: "mac_apple_clang_${compiler.version}" + Linux: + x86_64: + "gcc": + default: "linux_gcc_${compiler.version}" + "11": "linux_gcc_${compiler.version}_ubuntu16.04" + "clang": + default: "linux_clang_${compiler.version}_ubuntu16.04" + "11": "linux_clang_${compiler.version}" + +pod_size: + # Map with references that need special memory resources to compile. + # - Can be only by name or by name/version. + # - name/version notation takes preference over the name only one + # - Both notations can be combined for the same reference name + large: + - "pcl" + - "duckdb" + - "ceres-solver" + xlarge: + - "llvm" + - "opengv" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml new file mode 100644 index 0000000000000..2138c690b60a9 --- /dev/null +++ b/.c3i/config_v2.yml @@ -0,0 +1,136 @@ +--- +# Configuration for `https://github.com/conan-io/conan-center-index` repository (using Conan v2) +id: 'conan-io/conan-center-index' + +conan: + version: 2.0.4 + +artifactory: + url: "https://c3i.jfrog.io/c3i" + main_repo: "conan-center" + pull-request_repo_prefix: "c3i_PR-v2" + pull-request_permission: "c3i-pr" + logs_repo: "misc-v2" + # cache_repo: "cache" + +github: + reviewers: "reviewers.yml" + authorized_users: "authorized_users.yml" + +#slack: +# credential_success_url: SLACK_SUCCESS_WEBHOOK_URL +# ceredential_errors_url: SLACK_FAILURE_WEBHOOK_URL + +# Things related to Jenkins jobs: +tasks: + automatic_merge: + reviews_required_total: 1000 # AutomaticMerge shouldn't run with this file, but just in case + reviews_required_team: 1000 # AutomaticMerge shouldn't run with this file, but just in case + access_request: + request_issue_url: https://github.com/conan-io/conan-center-index/issues/4 + max_inactivity_days: 0 + cci: + conan_v2_run_export: false + detailed_status_checks: false + write_comments: false + update_labels: false + user_feedback: + title: "Conan v2 pipeline" + description: "> **Note**: Conan v2 builds may be required once they are on the [v2 ready](https://github.com/conan-io/conan-center-index/blob/master/.c3i/conan_v2_ready_references.yml) list" + 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 will be required for pull requests to be merged in the near future." + collapse_on_success: false + collapse_on_failure: true + list_packages: + update_yaml_list_path: ".c3i/conan_v2_ready_references" + update_yaml_list_key: "required_for_references" + scheduled_export_check: + report_issue_url: https://github.com/conan-io/conan-center-index/issues/15557 + report_issue_append: false + +configurations: + - id: linux-gcc + epochs: [0, 20211221, 20220120, 20220628] + hrname: "Linux, GCC" + build_profile: + os: "Linux" + content: + - os: ["Linux"] + arch: ["x86_64"] + compiler: + - "gcc": + compiler.libcxx: ["libstdc++11"] + compiler.version: ["11"] + build_type: ["Release"] + - id: macos-clang + epochs: [0, 20211221, 20220120, 20220628] + hrname: "macOS, Clang" + build_profile: + os: "Macos" + content: + - os: [ "Macos" ] + arch: [ "x86_64" ] + compiler: + - "apple-clang": + compiler.version: [ "13" ] + compiler.libcxx: [ "libc++" ] + build_type: [ "Release"] + - id: macos-m1-clang + epochs: [0, 20211221, 20220120, 20220628] + hrname: "macOS M1, Clang" + build_profile: + os: "Macos" + arch: "x86_64" + content: + - os: [ "Macos" ] + arch: [ "armv8" ] + compiler: + - "apple-clang": + compiler.version: ["13" ] + compiler.libcxx: [ "libc++" ] + build_type: [ "Release"] + - id: windows-msvc + epochs: [0, 20211221, 20220120, 20220628] + hrname: "Windows, MSVC" + build_profile: + os: "Windows" + content: + - os: [ "Windows" ] + arch: [ "x86_64" ] + compiler: + - "msvc": + compiler.version: [ "192" ] + build_type: + - "Release": + compiler.runtime: ["dynamic"] + compiler.runtime_type: [ "Release" ] + +cppstd: + apple-clang: + "13": ["17", "gnu17", "20", "gnu20"] + gcc: + "11": ["17", "gnu17", "20", "gnu20"] + msvc: + "192": ["14", "17", "20"] + +jenkins: + url: "http://mb-jenkins-my-bloody-jenkins:8080" + +node_labels: + Windows: + x86_64: + "msvc": + default: "windows20221212" + Macos: + x86_64: + "apple-clang": + default: "mac_apple_clang_${compiler.version}" + armv8: + "apple-clang": + default: "mac_apple_clang_${compiler.version}" + Linux: + x86_64: + "gcc": + default: "linux_gcc_${compiler.version}_ubuntu16.04" + "clang": + default: "linux_clang_${compiler.version}_ubuntu16.04" diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml new file mode 100644 index 0000000000000..6c7ecd5befbc8 --- /dev/null +++ b/.c3i/reviewers.yml @@ -0,0 +1,86 @@ +reviewers: + # List with users whose review is taken into account so that a pull-request is merged. + # - : Name of the github user + # - : Either 'community' for community reviewers or 'team' for Conan reviewers. + # - : Make the bot proactively request the user's review of pull-requests ready for review. + - user: "danimtb" + type: "team" + request_reviews: true + - 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: "madebr" + type: "community" + request_reviews: false + - user: "SpaceIm" + type: "community" + request_reviews: false + - user: "theirix" + type: "community" + request_reviews: false + - user: "ericLemanissier" + type: "community" + request_reviews: false + - user: "prince-chrismc" + type: "team" + request_reviews: false + - user: "Croydon" + type: "community" + request_reviews: false + - user: "intelligide" + type: "community" + request_reviews: false + - user: "ericriff" + type: "community" + request_reviews: false + - user: "toge" + type: "community" + request_reviews: false + - user: "AndreyMlashkin" + type: "community" + request_reviews: false + - 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 + - user: "samuel-emrys" + type: "community" + request_reviews: false + - user: "StellaSmith" + type: "community" + request_reviews: false + - user: "davidsanfal" + type: "team" + request_reviews: false diff --git a/.c3i/v1.jenkins b/.c3i/v1.jenkins new file mode 100644 index 0000000000000..68f3504079ef2 --- /dev/null +++ b/.c3i/v1.jenkins @@ -0,0 +1,6 @@ +#!groovy + +@Library('c3i') _ + +String configurationFile = '.c3i/config_v1.yml' +cci.runBuild(this, configurationFile) diff --git a/.c3i/v2.jenkins b/.c3i/v2.jenkins new file mode 100644 index 0000000000000..865f167f1dcf0 --- /dev/null +++ b/.c3i/v2.jenkins @@ -0,0 +1,6 @@ +#!groovy + +@Library('c3i') _ + +String configurationFile = '.c3i/config_v2.yml' +cci.runBuild(this, configurationFile) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000..a0c12e281a351 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +tab_width = 4 +trim_trailing_whitespace = true + +[*.py] +max_line_length = 200 + +[*.yml] +tab_width = 2 + +[{Makefile,Makefile.am,Makefile.in}] +indent_style = tab + +[*.{diff,patch}] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000..f0e8d5041ca21 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +*.cmake text eol=lf +*.conf text eol=lf +*.diff text eol=lf +*.md text eol=lf +*.patch text eol=lf +*.py text eol=lf +*.txt text eol=lf +*.yml text eol=lf +*.am text eol=lf diff --git a/.github/ISSUE_TEMPLATE/center_conan_io.yml b/.github/ISSUE_TEMPLATE/center_conan_io.yml new file mode 100644 index 0000000000000..0662c491c9958 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/center_conan_io.yml @@ -0,0 +1,18 @@ +name: 'ConanCenter: Web UI Bugs Or Requests' +description: Bugs or feature requests for the Web UI of ConanCenter at https://conan.io/center +title: '[conan.io/center] SHORT DESCRIPTION' +labels: 'conan.io/center' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a report. + **Please don't forget to update the issue title.** + - type: textarea + id: contents + attributes: + label: What is your problem/feature request? + description: Please be as specific as possible! + placeholder: Hi! I would like for ConanCenter to ... + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/package_bug.yml b/.github/ISSUE_TEMPLATE/package_bug.yml new file mode 100644 index 0000000000000..2c6e3356c879b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package_bug.yml @@ -0,0 +1,87 @@ +name: 'Package: Bug Report' +description: 'Report a bug, something does not work as it is supposed to' +title: '[package] /: SHORT DESCRIPTION' +labels: bug +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a report. + **Please don't forget to update the issue title.** + Include all applicable information to help us reproduce + - type: textarea + id: description + attributes: + label: Description + description: | + What is not working? What were you expecting? Are there any workarounds? + Remember that a missing profile or a short log will make extremely difficult + to investigate your case or provide any help, please be as specific as possible. + placeholder: Include all applicable information with details to help us reproduce your problem + validations: + required: true + - type: textarea + id: env + attributes: + label: Package and Environment Details + description: (Include every applicable attribute) + value: | + * Package Name/Version: **zlib/1.2.8** + * Operating System+version: **Linux Ubuntu 18.04** + * Compiler+version: **GCC 8** + * Docker image: **conanio/gcc8** + * Conan version: **conan 1.18.0** + * Python version: **Python 3.7.4** + placeholder: | + cat /etc/lsb-release | grep + gcc --version + docker info + cmake --version + conan -v + python3 --version + validations: + required: true + - type: textarea + id: profile + attributes: + label: Conan profile + description: Output of `conan profile show default` or `conan profile show ` if a custom profile is in use + value: | + [settings] + os=Macos + os_build=Macos + arch=armv8 + arch_build=armv8 + compiler=apple-clang + compiler.version=14 + compiler.libcxx=libc++ + build_type=Release + [options] + [conf] + [build_requires] + [env] + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: Which commands did you run? + placeholder: conan install -r conancenter foobar/0.1.0@ -pr:b=default -pr:h=default + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs + description: Include/Attach the entire command output here. + value: | +
Click to expand log + + ``` + Put your log output here + ``` + +
+ validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/package_request.yml b/.github/ISSUE_TEMPLATE/package_request.yml new file mode 100644 index 0000000000000..3c08e51204866 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package_request.yml @@ -0,0 +1,42 @@ +name: 'Package: Completely New Recipe' +description: If you would like to see a completely new recipe +title: '[request] /' +labels: 'library request' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit your request. + **Please don't forget to update the issue title.** + - type: input + id: package + attributes: + label: Package Name/Version + placeholder: cmake/3.25.1 + validations: + required: true + - type: input + id: website + attributes: + label: Webpage + placeholder: https://cmake.org + validations: + required: true + - type: input + id: sources + attributes: + label: Source code + placeholder: https://github.com/Kitware/CMake + validations: + required: true + - type: textarea + id: description + attributes: + label: Description of the library/tool + description: | + Give us some context about this library/tool. + What is it about? + placeholder: | + CMake is an open-source, cross-platform family of tools designed to build, test and package software. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/package_upstream_update.yml b/.github/ISSUE_TEMPLATE/package_upstream_update.yml new file mode 100644 index 0000000000000..efbe2c5a38c32 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package_upstream_update.yml @@ -0,0 +1,33 @@ +name: 'Package: New Version' +description: If an existing package recipe needs an update for a new upstream version +title: '[request] /' +labels: 'upstream update' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit your request. + **Please don't forget to update the issue title.** + - type: input + id: package + attributes: + label: Package Name/Version + placeholder: cmake/3.25.1 + validations: + required: true + - type: input + id: changelog + attributes: + label: Changelog + placeholder: https://cmake.org/cmake/help/latest/release/3.25.html + validations: + required: true + - type: textarea + id: description + attributes: + label: Context about the new update + value: | + The above-mentioned version is newly released by the upstream project and not yet available as a recipe. + Please add this version. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000000000..afe36c847827d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,18 @@ +name: Question +description: If something needs clarification +title: '[question] SHORT DESCRIPTION' +labels: 'question' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill your question. + **Please don't forget to update the issue title.** + - type: textarea + id: question + attributes: + label: What is your question? + description: Please be as specific as possible! + placeholder: Hi! I have a question regarding ... + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/service.yml b/.github/ISSUE_TEMPLATE/service.yml new file mode 100644 index 0000000000000..4afdce69c57d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/service.yml @@ -0,0 +1,18 @@ +name: 'Service: Infrastructure Bugs Or Requests' +description: Bug or feature requests for Conan Center Index itself +title: '[service] SHORT DESCRIPTION' +labels: 'service' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a report. + **Please don't forget to update the issue title.** + - type: textarea + id: contents + attributes: + label: What is your problem/feature request? + description: Please be as specific as possible! + placeholder: Hi! I would like for Conan Center Index to ... + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..3f6e08d2479e9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +Specify library name and version: **lib/1.0** + + + + +--- + +- [ ] 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. diff --git a/.github/actions/alert-community/action.yml b/.github/actions/alert-community/action.yml new file mode 100644 index 0000000000000..ca390cd38b4e7 --- /dev/null +++ b/.github/actions/alert-community/action.yml @@ -0,0 +1,31 @@ +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/actions/pr_changed_files/action.yml b/.github/actions/pr_changed_files/action.yml new file mode 100644 index 0000000000000..70f97c9499430 --- /dev/null +++ b/.github/actions/pr_changed_files/action.yml @@ -0,0 +1,51 @@ +name: 'Changed files in PR' +description: 'Get all changed files in a Pull Request' +author: 'ericLemanissier' +inputs: + files: + description: "Check for changes using only this list of files (Defaults to the entire repo)" + required: false + default: "" + +outputs: + all_changed_files: + description: List of all copied, modified, and added files. + value: ${{ steps.changed-files.outputs.all_changed_files }} + any_changed: + description: Return true only when any files provided using the files input have changed. + value: ${{ steps.changed-files.outputs.any_changed }} +runs: + using: "composite" + steps: + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYVER }} + - name: Get changed files + id: changed-files + shell: python + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + import json + import subprocess + import fnmatch + import os + from pathlib import Path + + patterns = [Path(p).parts for p in '''${{ inputs.files }}'''.splitlines()] + + res = subprocess.run(["gh", "api", "/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files", "--paginate"], capture_output=True, check=True) + files = [] + for f in json.loads(res.stdout): + if f["status"] == "removed": + continue + filename = Path(f["filename"]).parts + for pattern in patterns: + if len(pattern) != len(filename): + continue + if all(fnmatch.fnmatch(filename[i], pattern[i]) for i in range(len(pattern))): + files.append(f["filename"]) + break + with open(os.getenv("GITHUB_OUTPUT"), "a") as output_file: + output_file.write(f"any_changed={'true' if files else 'false'}\n") + output_file.write(f"all_changed_files={' '.join(files)}\n") diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000000000..f3a08a0c9f04e --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,61 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 30 + +# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +daysUntilClose: 30 + +# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) +onlyLabels: [] + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - blocked + - infrastructure + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: false + +# Set to true to ignore issues with an assignee (defaults to false) +exemptAssignees: false + +# Label to use when marking as stale +staleLabel: stale + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. + +# Comment to post when removing the stale label. +# unmarkComment: > +# Your comment here. + +# Comment to post when closing a stale Issue or Pull Request. +closeComment: > + This pull request has been automatically closed because it has not had + recent activity. Thank you for your contributions. + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +# Limit to only `issues` or `pulls` +only: pulls + +# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': +# pulls: +# daysUntilStale: 30 +# markComment: > +# This pull request has been automatically marked as stale because it has not had +# recent activity. It will be closed if no further activity occurs. Thank you +# for your contributions. + +# issues: +# exemptLabels: +# - confirmed diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml new file mode 100644 index 0000000000000..7dcd6dc6c89c7 --- /dev/null +++ b/.github/workflows/alert-community.yml @@ -0,0 +1,427 @@ +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 @prince-chrismc @Croydon" + + - uses: ./.github/actions/alert-community + with: + files: "linter/*/*" + reviewers: "@ericLemanissier @prince-chrismc @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" + + - 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/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/libsodium/*/*" + reviewers: "@Hopobcn" + + - 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" + + - 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/opengl/*/*" + reviewers: "@Hopobcn" + + - uses: ./.github/actions/alert-community + with: + files: "recipes/opengl-registry/*/*" + reviewers: "@MartinDelille" + + - 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" + + - 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/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" diff --git a/.github/workflows/hooks-warnings.yml b/.github/workflows/hooks-warnings.yml new file mode 100644 index 0000000000000..e19b8ea189eb5 --- /dev/null +++ b/.github/workflows/hooks-warnings.yml @@ -0,0 +1,84 @@ +name: hooks warnings + +on: + issue_comment: + types: [created] + +jobs: + comment: + if: ${{ github.event.issue.pull_request && github.event.sender.login == 'conan-center-bot' }} + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + warnings_map = new Map() + const link_regex = /\[All logs\]\((?https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))\)/g; + for (const match of context.payload.comment.body.matchAll(link_regex)) + { + prefix = "https://c3i.jfrog.io/c3i/misc/summary.html?json=" + if(!match.groups.url.startsWith(prefix)) + continue; + url = match.groups.url.slice(prefix.length) + try { + result = await github.request({ + url: url, + }); + } catch(err) { + core.warning(`error ${err.status} for url ${err.request.url}`) + continue + } + for (const job of result.data) + { + if (job.build == null) + continue; + try { + log = await github.request({ + baseUrl: "https://c3i.jfrog.io/c3i/misc/", + url: job.build, + }); + } catch(err) { + core.warning(`error ${err.status} for url ${err.request.url}`) + continue + } + prefix = "[HOOK - conan-center.py] " + warnings = log.data.split("\n").filter(line => line.startsWith(prefix) && line.includes(" WARN: ")) + if(warnings.length == 0) + continue + if(!warnings_map.has(job.reference)) + warnings_map.set(job.reference, new Set()) + for(const warning of warnings) + { + msg = warning.slice(prefix.length) + warnings_map.get(job.reference).add(msg) + core.warning(msg) + } + } + } + if(warnings_map.size > 0) + { + comment = "
\n" + comment += "Hooks produced the following warnings" + const shaRegex = /(All green|Failure) in build \d+ \(`(?(\d|[a-z])+)`\):/g; + const shaMatch = shaRegex.exec(context.payload.comment.body) + if(shaMatch) + { + comment += " for commit " + shaMatch.groups.sha + } + comment += "\n\n" + for (const [ref, warnings] of warnings_map) + { + comment += "
\n" + comment += "" + ref + "\n\n```\n" + for(const warning of warnings) + comment += warning + "\n" + comment += "```\n
\n" + } + comment += "
\n" + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }) + } diff --git a/.github/workflows/linter-conan-v2.yml b/.github/workflows/linter-conan-v2.yml new file mode 100644 index 0000000000000..9b437a26e46d8 --- /dev/null +++ b/.github/workflows/linter-conan-v2.yml @@ -0,0 +1,124 @@ +name: "[linter] Conan v2 migration" + +on: + pull_request: + +env: + PYTHONPATH: ${{github.workspace}} + PYVER: "3.8" + REQUIREMENTS: "pylint==2.14" + +jobs: + test_linter: + name: Test linter changes (v2 migration) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get changed files + uses: ./.github/actions/pr_changed_files + id: changed_files + with: + files: | + linter/** + .github/workflows/linter-conan-v2.yml + + - name: Get Conan v1 version + id: parse_conan_v1_version + if: steps.changed_files.outputs.any_changed == 'true' + uses: mikefarah/yq@master + with: + cmd: yq '.conan.version' '.c3i/config_v1.yml' + + - uses: actions/setup-python@v4 + if: steps.changed_files.outputs.any_changed == 'true' + with: + python-version: ${{ env.PYVER }} + + - name: Install requirements + if: steps.changed_files.outputs.any_changed == 'true' + run: | + pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} + + - name: Execute linter over all recipes in the repository + id: linter_recipes + if: steps.changed_files.outputs.any_changed == 'true' + run: | + echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY + pylint --rcfile=linter/pylintrc_recipe `ls recipes/*/*/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --score=y --exit-zero + jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json + jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY + + - name: Execute linter over all test_package/recipes in the repository + id: linter_test_package + if: steps.changed_files.outputs.any_changed == 'true' + run: | + echo '## Linter summary (test_package)' >> $GITHUB_STEP_SUMMARY + pylint --rcfile=linter/pylintrc_testpackage `ls recipes/*/*/test_package/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --exit-zero + jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json + jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY + + conanfile_recipe: + name: Lint changed conanfile.py (v2 migration) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get changed files + id: changed-files + uses: ./.github/actions/pr_changed_files + with: + files: | + recipes/*/*/conanfile.py + - name: Get Conan v1 version + id: parse_conan_v1_version + if: steps.changed-files.outputs.any_changed == 'true' + uses: mikefarah/yq@master + with: + cmd: yq '.conan.version' '.c3i/config_v1.yml' + - uses: actions/setup-python@v4 + if: steps.changed-files.outputs.any_changed == 'true' + with: + python-version: ${{ env.PYVER }} + - name: Install dependencies + if: steps.changed-files.outputs.any_changed == 'true' + run: | + pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} + - name: Run linter + if: steps.changed-files.outputs.any_changed == 'true' + run: | + echo "::add-matcher::linter/recipe_linter.json" + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + pylint --rcfile=linter/pylintrc_recipe --output-format=parseable ${file} + done + + conanfile_test_package: + name: Lint changed test_package/conanfile.py (v2 migration) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get changed files + id: changed-files + uses: ./.github/actions/pr_changed_files + with: + files: | + recipes/*/*/test_*/conanfile.py + - name: Get Conan v1 version + id: parse_conan_v1_version + if: steps.changed-files.outputs.any_changed == 'true' + uses: mikefarah/yq@master + with: + cmd: yq '.conan.version' '.c3i/config_v1.yml' + - uses: actions/setup-python@v4 + if: steps.changed-files.outputs.any_changed == 'true' + with: + python-version: ${{ env.PYVER }} + - name: Install dependencies + if: steps.changed-files.outputs.any_changed == 'true' + run: | + pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} + - name: Run linter + if: steps.changed-files.outputs.any_changed == 'true' + run: | + echo "::add-matcher::linter/recipe_linter.json" + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + pylint --rcfile=linter/pylintrc_testpackage --ignore-paths="recipes/[^/]*/[^/]*/test_v1[^/]*/conanfile.py" --output-format=parseable ${file} + done diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml new file mode 100644 index 0000000000000..d7d4050e8071d --- /dev/null +++ b/.github/workflows/linter-yaml.yml @@ -0,0 +1,118 @@ +name: "[linter] YAML files" + +on: + pull_request: + +env: + PYTHONPATH: ${{github.workspace}} + PYVER: "3.8" + CONFIG_FILES_PATH: "recipes/*/config.yml" + CONANDATA_FILES_PATH: "recipes/*/*/conandata.yml" + +jobs: + test_linter: + # A job to run when the linter changes. We want to know in advance how many files will be broken + name: Test linter changes (YAML files) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get changed files + uses: ./.github/actions/pr_changed_files + id: changed_files + with: + files: | + linter/** + + - uses: actions/setup-python@v4 + if: steps.changed_files.outputs.any_changed == 'true' + with: + python-version: ${{ env.PYVER }} + + - name: Install dependencies + if: steps.changed_files.outputs.any_changed == 'true' + run: pip install yamllint strictyaml argparse + + - name: Run linter (config.yml) + if: steps.changed_files.outputs.any_changed == 'true' && always() + run: | + echo "::add-matcher::linter/yamllint_matcher.json" + yamllint --config-file linter/yamllint_rules.yml -f standard ${{ env.CONFIG_FILES_PATH }} + echo "::remove-matcher owner=yamllint_matcher::" + + - name: Run schema check (config.yml) + if: steps.changed_files.outputs.any_changed == 'true' && always() + run: | + for file in ${{ env.CONFIG_FILES_PATH }}; do + python3 linter/config_yaml_linter.py ${file} + done + + - name: Run linter (conandata.yml) + if: steps.changed_files.outputs.any_changed == 'true' && always() + run: | + echo "::add-matcher::linter/yamllint_matcher.json" + yamllint --config-file linter/yamllint_rules.yml -f standard ${{ env.CONANDATA_FILES_PATH }} + echo "::remove-matcher owner=yamllint_matcher::" + + - name: Run schema check (conandata.yml) + if: steps.changed_files.outputs.any_changed == 'true' && always() + run: | + for file in ${{ env.CONANDATA_FILES_PATH }}; do + python3 linter/conandata_yaml_linter.py ${file} + done + + lint_pr_files: + # Lint files modified in the pull_request + name: Lint changed files (YAML files) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYVER }} + + - name: Install dependencies + run: pip install yamllint strictyaml argparse + + ## Work on config.yml files + - name: Get changed files (config) + id: changed_files_config + if: always() + uses: ./.github/actions/pr_changed_files + with: + files: | + ${{ env.CONFIG_FILES_PATH }} + + - name: Run linter (config.yml) + if: steps.changed_files_config.outputs.any_changed == 'true' && always() + run: | + echo "::add-matcher::linter/yamllint_matcher.json" + for file in ${{ steps.changed_files_config.outputs.all_changed_files }}; do + yamllint --config-file linter/yamllint_rules.yml -f standard ${file} + done + echo "::remove-matcher owner=yamllint_matcher::" + + for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do + python3 linter/config_yaml_linter.py ${file} + done + + ## Work on conandata.yml files + - name: Get changed files (conandata) + id: changed_files_conandata + if: always() + uses: ./.github/actions/pr_changed_files + with: + files: | + ${{ env.CONANDATA_FILES_PATH }} + + - name: Run linter (conandata.yml) + if: steps.changed_files_conandata.outputs.any_changed == 'true' && always() + run: | + echo "::add-matcher::linter/yamllint_matcher.json" + for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do + yamllint --config-file linter/yamllint_rules.yml -f standard ${file} + done + echo "::remove-matcher owner=yamllint_matcher::" + + for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do + python3 linter/conandata_yaml_linter.py ${file} + done diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml new file mode 100644 index 0000000000000..50c393f373fb1 --- /dev/null +++ b/.github/workflows/markdown-links.yml @@ -0,0 +1,18 @@ +name: "[linter] Markdown links" + +on: + pull_request: + paths: + - '**.md' + +jobs: + markdown-link-check-pr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + config-file: .github/workflows/mlc_config.json + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json new file mode 100644 index 0000000000000..d16005bb86641 --- /dev/null +++ b/.github/workflows/mlc_config.json @@ -0,0 +1,13 @@ +{ + "retryOn429": true, + "retryCount": 5, + "fallbackRetryDelay": "30s", + "httpHeaders": [ + { + "urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"], + "headers": { + "Accept-Encoding": "zstd, br, gzip, deflate" + } + } + ] +} diff --git a/.github/workflows/on-push-do-doco.yml b/.github/workflows/on-push-do-doco.yml new file mode 100644 index 0000000000000..f5206b720d4a9 --- /dev/null +++ b/.github/workflows/on-push-do-doco.yml @@ -0,0 +1,30 @@ +name: docs_markdown_toc +on: + workflow_dispatch: + inputs: {} + push: + branches: + - master + paths: + - 'docs/**' + +jobs: + docs_markdown_toc: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Run MarkdownSnippets + run: | + dotnet tool install --global MarkdownSnippets.Tool + mdsnippets ${GITHUB_WORKSPACE} \ + --convention InPlaceOverwrite \ + --exclude-directories 'recipes' \ + --toc-level 5 + shell: bash + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + branch: bot/action-doc-toc + commit-message: "[docs] Regenerate tables of contents" + title: "[docs] Regenerate tables of contents" + body: "Automatic update of the documentation TOCs." diff --git a/.gitignore b/.gitignore index 894a44cc066a0..b2733bea8c3a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,36 @@ -# Byte-compiled / optimized / DLL files +# Conan specific +**/test_package/build/ +**/test_package/build-*/ +**/test_package/test_output/ +conan.lock +conanbuildinfo.txt +conaninfo.txt +graph_info.json +build/ + +# CMake +CMakeUserPresets.json + +# IDEs +.idea +.vs +.vscode +.project +.pydevproject +.settings/ +.ropeproject/ +.devcontainer/ +## emacs +*~ + +# Byte-compiled / optimized / DLL files / Cache __pycache__/ +**/test_package/__pycache__/ +*.pyc *.py[cod] *$py.class +tmp/ +.DS_Store # C extensions *.so @@ -94,11 +123,18 @@ venv.bak/ .spyderproject .spyproject -# Rope project settings -.ropeproject - # mkdocs documentation /site # mypy .mypy_cache/ + +# scons build files +*.dblite + +# vim temp files +.*.sw? +.sw? +Session.vim +*~ +.undodir diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000..e3e7f52de2da8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,56 @@ +# Contributing to Conan Center Index + +The following summarizes the process for contributing to the CCI (Conan Center Index) project. + + +## Contents + + * [Community](#community) + * [Dev-flow & Pull Requests](#dev-flow--pull-requests) + * [Issues](#issues) + +## Community + +ConanCenterIndex is an Open Source MIT licensed project; it is developed by the Conan maintainers and a great community of contributors. + +## Dev-flow & Pull Requests + +CCI follows the ["GitFlow"](https://datasift.github.io/gitflow/IntroducingGitFlow.html) branching model. +Issues are triaged and categorized mainly by type (package request, bug...) and priority (high, medium...) using GitHub +labels. + +To contribute follow the next steps: + +1. Comment in the corresponding issue that you want to contribute the package/fix proposed. If there is no open issue, we strongly suggest + opening one to gather feedback. +2. Make sure to [request access](docs/adding_packages/README.md#request-access) and be aware there is a [CLA](docs/CONTRIBUTOR_LICENSE_AGREEMENT.md). +3. Get setup by following the [Developing Recipes](docs/developing_recipes_locally.md) guide and learn the basic commands. +4. Check the [How To Add Packages](docs/adding_packages/README.md) page for the break down of ConanCenterIndex specific conventions and practices. +5. In your fork create a `package/xxx` branch from the `master` branch and develop + your fix/packages as discussed in previous step. +6. [Submit a pull request](docs/adding_packages/README.md#submitting-a-package) once you are ready. This can be when you + 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 [Review Process](docs/review_process.md) is partially automated with the help of @conan-center-index-bot :rocket: + +## Issues + +If you think you found a bug in CCI or in a recipe, open an issue indicating the following: + +- Explain the Conan version, Operating System, compiler and any other tool that could be related to the issue. +- Explain, as detailed as possible, how to reproduce the issue. Use git repository to contain code/recipes to reproduce issues, or a snippet. +- Include the expected behavior as well as what actually happened. +- Provide output captures (as text). +- Feel free to attach a screenshot or video illustrating the issue if you think it will be helpful. + +For any suggestion, feature request or question open an issue indicating the following: + +- Questions and support requests are always welcome. +- Use the [question] or [suggestion] tags in the title (provided by github issues templates). +- Try to explain the motivation, what are you trying to do, what is the pain it tries to solve. +- What do you expect from CCI. + +We use the following tags to control the status of the issues and pull requests, you can learn more in [Labels](docs/labels.md) document +which details the important one and their roles. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000..3206926309aed --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +

+ +

+ +Conan Center Index is the source index of recipes of the [ConanCenter](https://conan.io/center) package repository for [Conan](https://conan.io). + +This repository includes a Continuous Integration system that will build automatically the Conan packages for the recipes submitted via +[Pull Request](https://github.com/conan-io/conan-center-index/pulls). + +### Server Status + +The current Conan Center Index CI status can be found on https://status.conan.io/ + +Any maintenance, outage or important event related to the CI will be informed there. + + +### Add ConanCenter remote + +ConanCenter remote is configured by default in any Conan client installation. If, for any reason, you need to add it manually, just execute: + +``` +conan remote add conancenter https://center.conan.io +``` + +### How to consume recipes + +Starting to use recipes from this repository is as easy as running +one simple command after installing Conan: + +``` +conan install name/version@ [-g ] +``` + +Of course, we really encourage you to use a `conanfile.txt` or `conanfile.py` +to list all the requirements or your project and install them all together +(Conan will build a single graph and ensure congruency). + +:warning: It is very important to notice that recipes will evolve over time +and, while they are fixing some issues, they might introduce new features and +improvements, and your project can break if you upgrade them +([How to prevent these breaking changes in my project?](docs/consuming_recipes.md)). + + + +### Documentation + +All the documentation is available in this same repository in the [`docs/` subfolder](docs/README.md). + +This is a list of shortcuts to some interesting topics: + +* :rocket: If you want to learn how to **contribute new recipes**, please read [docs/adding_packages/](docs/adding_packages/README.md). +* :speech_balloon: **FAQ**: most common questions are listed in [docs/faqs.md](docs/faqs.md). +* :warning: The conan-center **hook errors** reported by CCI Bot can be found in the [docs/error_knowledge_base.md](docs/error_knowledge_base.md). +* :hammer_and_wrench: The internal changes related to infrastructure can be checked in [docs/changelog.md](docs/changelog.md). +* :world_map: There are various community lead initiatives which are outlined in [docs/community_resources.md](docs/community_resources.md). +* :magic_wand: To start preparing your recipes for **Conan 2.0**, please check [docs/v2_migration.md](docs/v2_migration.md). + +### Reporting Issues + +You can open issues in the [issue tracker](https://github.com/conan-io/conan-center-index/issues) to: + +* :bug: Report **bugs/issues** in a package: + - Use the `[package]` tag in the title of the issue to help identifying them. + - If you detect any issue or missing feature in a package, for example, a build failure or a recipe that not support a specific configuration. + - 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. + - 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. + +* :robot: Report **a failure** in the CI system: + - If you open a Pull Request and get an unexpected error you might comment in the failing PR. + - If the service or repository is down or failing, use the `[service]` tag in the title of a new issue to help identifying them. + +If your issue is not appropriate for a public discussion, please contact us via e-mail at `info@conan.io`. Thanks! + + +### License + +All the Conan recipes in this repository are distributed under the [MIT](LICENSE) license. There +are other files, like patches or examples used to test the packages, that could use different licenses, +for those files specific license and credit must be checked in the file itself. diff --git a/assets/JFrogConanCenter.png b/assets/JFrogConanCenter.png new file mode 100644 index 0000000000000000000000000000000000000000..6f9311012dac51f9e006da0cb61a9020c5d9fcc3 GIT binary patch literal 66567 zcmeFZcTiN_vOYWn0hOSlhdKo*Pcx?^b<(oT<`+*?afu)#2%r2ys=O8q zMra9x;iwbffo~k6GW=jLGHfqxT^B85cLoP1q`8$Xg2Bbp0l|Rquri0iJo>U;>P6Ft zIVl|GoZ@7pfjABVZ#JvNbN^Ad(&B5Uzl5O#yz85@Iv)ecE4)+S`cPG1vIQ@qW zD=X>yEcVzomZXPC{0Lw0J5PMwEIFWM|Jt&CsXh!dG%70AgY(@n*hY>r%d?(rr1FP2jF+jTvI9ZTyii{>BX--Rr_OFoYpiLFIj$Cw;BLGod-9-by&&i)*$?!EnTySy(n5`unpMW$ZEa~WUH zy6>b0AWL)JJkhwCpk|x<%tP$pPI&q1Blilsgt#b21V0{paVvCb*&TUcSm96XlC9FM zR?V`$q3ocoo=1q#kScz7zh}SpQ`s-y%9@r>2Rm9Oq?A{XFT|){wd@e)JlubmwKgT< zc-Pa(Lo(Q6!3W<+rtz-YHXDv+zIJ9`hl#EEmzB}V5}WNd$nwp$=?BbM#)!_g&oibGB5^K!YZHt07o0y7wKu%aEa{uI$t=E< zl;Ga$S~$4bv-%~5c)@?xYIF_W?Bc9apGTfORJOb9nUNoFUoqL$Z(ljyoTRsFzP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0rM-5{jP6hO~Xp; zqJg8d`c zC)tIQ{_0q#FPWKJlb2-tn-gE`-W4cX}YLHR$ws{Bz_*733XWv$4Ii5v{@RPoJ z0KC+3>cWL{66VH)XoEAOGO)UDNYFPm2zrwrln~mHR_G8mR)+DWsN{$Q33>5=3!Cp+a2XYVxx&d z69E6M+hln)RB~4$l`NyYe;LeAyi0R*-qm$29BJkrILqo$4r+YM+Fh3=8bw+4VqBwQ!P8FC>G4*N@Z^TkrL;AVYyT)n5lD^`RvV4BPB!!FJh%52hpc zPQ1ti=Rfa}BO1rC!{q5Bh_+i`K4O+*o9sMq@3`y7q&W)o8Ug>;t6bA4S zPK)~z4;z*0a*af#1AkEks*3lO{ifWCnW~b@>4r*MK6wRxHAt1=))J*XW`X>im-zX& z|HCS^V@YQQf zt`wpeHgL*{o99E&-#i`S;EY&a$<~u3rVlW{d4Ao2jKY(cX#UUdc1<8k5uZ6H)-C-p z21^GS{#U8p!f1U4yG_!C5g`+i#vJ$H)V$fX&18ZPHb6}+0srJX4T^aN#pfbpTTbT- z1O4iIc(o$*>&poZg0XE=f^#He8^(CIPm>SwLW;C zO1^97Ny&GEGe!$flPw1bG)z F{trzpJG=k@ literal 0 HcmV?d00001 diff --git a/recipes/astc-codec/all/test_package/conanfile.py b/recipes/astc-codec/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f50bbe4c73b2 --- /dev/null +++ b/recipes/astc-codec/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "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") + bees = os.path.join(self.source_folder, "atlas_small_4x4.astc") + self.run(f"{bin_path} {bees} 256 256", env="conanrun") diff --git a/recipes/astc-codec/all/test_package/test_package.cpp b/recipes/astc-codec/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec0a2e3ad6195 --- /dev/null +++ b/recipes/astc-codec/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include + +#include + +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::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); + + stream.close(); + + return 0; +} diff --git a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt b/recipes/astc-codec/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/astc-codec/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/astc-codec/all/test_v1_package/conanfile.py b/recipes/astc-codec/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3605ef5403092 --- /dev/null +++ b/recipes/astc-codec/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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) diff --git a/recipes/astc-codec/config.yml b/recipes/astc-codec/config.yml new file mode 100644 index 0000000000000..dc12e222a3828 --- /dev/null +++ b/recipes/astc-codec/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190617": + folder: all diff --git a/recipes/astro-informatics-so3/all/CMakeLists.txt b/recipes/astro-informatics-so3/all/CMakeLists.txt new file mode 100644 index 0000000000000..0496b29838549 --- /dev/null +++ b/recipes/astro-informatics-so3/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/astro-informatics-so3/all/conandata.yml b/recipes/astro-informatics-so3/all/conandata.yml new file mode 100644 index 0000000000000..044d46996e9be --- /dev/null +++ b/recipes/astro-informatics-so3/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "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 new file mode 100644 index 0000000000000..24be830f3db99 --- /dev/null +++ b/recipes/astro-informatics-so3/all/conanfile.py @@ -0,0 +1,71 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class AstroInformaticsSO3(ConanFile): + name = "astro-informatics-so3" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/astro-informatics/so3" + description = "Fast and accurate Wigner transforms" + settings = "os", "arch", "compiler", "build_type" + topics = ("physics", "astrophysics", "radio interferometry") + + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + + 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 + + def requirements(self): + self.requires("fftw/3.3.9") + self.requires("ssht/1.3.7") + + def validate(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration( + "Visual Studio not supported, since SO3 requires C99 support for complex numbers" + ) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @property + def cmake(self): + if not hasattr(self, "_cmake"): + self._cmake = CMake(self) + self._cmake.definitions["conan_deps"] = False + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self.cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.cmake.install() + + def package_info(self): + self.cpp_info.libs = ["astro-informatics-so3"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt b/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aecca63b59f68 --- /dev/null +++ b/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(astro-informatics-so3 REQUIRED NO_MODULE) + +add_executable(${PROJECT_NAME} example.c) +target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) +target_link_libraries(${PROJECT_NAME} + astro-informatics-so3::astro-informatics-so3) diff --git a/recipes/astro-informatics-so3/all/test_package/conanfile.py b/recipes/astro-informatics-so3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..abcaeed3f89b6 --- /dev/null +++ b/recipes/astro-informatics-so3/all/test_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/astro-informatics-so3/all/test_package/example.c b/recipes/astro-informatics-so3/all/test_package/example.c new file mode 100644 index 0000000000000..5e35f02f0e18f --- /dev/null +++ b/recipes/astro-informatics-so3/all/test_package/example.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + so3_parameters_t params; + params.sampling_scheme = SO3_SAMPLING_MW; + so3_sampling_weight(¶ms, 2); + return 0; +} diff --git a/recipes/astro-informatics-so3/config.yml b/recipes/astro-informatics-so3/config.yml new file mode 100644 index 0000000000000..a81e52666d075 --- /dev/null +++ b/recipes/astro-informatics-so3/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.4": + folder: all diff --git a/recipes/async_simple/all/conandata.yml b/recipes/async_simple/all/conandata.yml new file mode 100644 index 0000000000000..b0f536ac75473 --- /dev/null +++ b/recipes/async_simple/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.0.0": + url: + - "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" + sha256: "b243fb7af5d61b534fe18b662d16498392bbce1deffdc68e58829aa31db7badf" diff --git a/recipes/async_simple/all/conanfile.py b/recipes/async_simple/all/conanfile.py new file mode 100644 index 0000000000000..cd5c0701011d2 --- /dev/null +++ b/recipes/async_simple/all/conanfile.py @@ -0,0 +1,94 @@ +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.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class AsyncSimpleConan(ConanFile): + name = "async_simple" + description = "Simple, light-weight and easy-to-use asynchronous components" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/alibaba/async_simple" + topics = ("modules", "asynchronous", "coroutines", "cpp20") + 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": "10.3", + "clang": "13", + "apple-clang": "14", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + pass + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.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 + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, 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/async_simple"), + src=os.path.join(self.source_folder, "async_simple"), + excludes=("test", "executors", "uthread") + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.set_property("cmake_file_name", "async_simple") + self.cpp_info.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/test_package/CMakeLists.txt b/recipes/async_simple/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c557f6f0a457 --- /dev/null +++ b/recipes/async_simple/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) # if the project uses c++ +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +find_package(async_simple REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +# don't link to ${CONAN_LIBS} or CONAN_PKG::package +target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) diff --git a/recipes/async_simple/all/test_package/conanfile.py b/recipes/async_simple/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/async_simple/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/async_simple/all/test_package/test_package.cpp b/recipes/async_simple/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d1008ad4581c --- /dev/null +++ b/recipes/async_simple/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include +#include "async_simple/coro/Lazy.h" +#include "async_simple/coro/SyncAwait.h" +using namespace async_simple::coro; + +Lazy foo() { + co_return 1; +} + +int main(void) { + std::cout << "test async_simple" << std::endl; + auto lazy_task = foo(); + auto ret = syncAwait(lazy_task); + if (ret != 1) { + std::cout << "ERROR: " << ret << std::endl; + std::cout << EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/async_simple/all/test_v1_package/CMakeLists.txt b/recipes/async_simple/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d25dca4fa93e5 --- /dev/null +++ b/recipes/async_simple/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) # if the project uses c++ +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(async_simple REQUIRED CONFIG) + +# Re-use the same source file from test_package folder +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +# don't link to ${CONAN_LIBS} or CONAN_PKG::package +target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) diff --git a/recipes/async_simple/all/test_v1_package/conanfile.py b/recipes/async_simple/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/async_simple/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/async_simple/config.yml b/recipes/async_simple/config.yml new file mode 100644 index 0000000000000..5d96905a31039 --- /dev/null +++ b/recipes/async_simple/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0.0": + folder: all diff --git a/recipes/asyncplusplus/all/conandata.yml b/recipes/asyncplusplus/all/conandata.yml new file mode 100644 index 0000000000000..6e8a1f4ce6c53 --- /dev/null +++ b/recipes/asyncplusplus/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: "https://github.com/Amanieu/asyncplusplus/archive/v1.1.tar.gz" + sha256: "d160d3a433a1e08f51c785742843182c2b81a7bc872766f57bf5f3108377b858" diff --git a/recipes/asyncplusplus/all/conanfile.py b/recipes/asyncplusplus/all/conanfile.py new file mode 100644 index 0000000000000..1846058ae1e44 --- /dev/null +++ b/recipes/asyncplusplus/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AsyncplusplusConan(ConanFile): + name = "asyncplusplus" + description = "Async++ concurrency framework for C++11" + license = "MIT" + topics = ("async", "parallel", "task", "scheduler") + homepage = "https://github.com/Amanieu/asyncplusplus" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + 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")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"Async++": "Async++::Async++"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Async++") + self.cpp_info.set_property("cmake_target_name", "Async++") + self.cpp_info.libs = ["async++"] + if not self.options.shared: + self.cpp_info.defines = ["LIBASYNC_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "Async++" + self.cpp_info.names["cmake_find_package_multi"] = "Async++" + 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/asyncplusplus/all/test_package/CMakeLists.txt b/recipes/asyncplusplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a56b06843998 --- /dev/null +++ b/recipes/asyncplusplus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Async++ REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Async++) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/asyncplusplus/all/test_package/conanfile.py b/recipes/asyncplusplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/asyncplusplus/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/asyncplusplus/all/test_package/test_package.cpp b/recipes/asyncplusplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ebdac63120776 --- /dev/null +++ b/recipes/asyncplusplus/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +#include + +#include + +int main() +{ + auto task1 = async::spawn([] { + std::cout << "Task 1 executes asynchronously" << std::endl; + }); + auto task2 = async::spawn([]() -> int { + std::cout << "Task 2 executes in parallel with task 1" << std::endl; + return 42; + }); + auto task3 = task2.then([](int value) -> int { + std::cout << "Task 3 executes after task 2, which returned " + << value << std::endl; + return value * 3; + }); + auto task4 = async::when_all(task1, task3); + auto task5 = task4.then([](std::tuple, + async::task> results) { + std::cout << "Task 5 executes after tasks 1 and 3. Task 3 returned " + << std::get<1>(results).get() << std::endl; + }); + + task5.get(); + std::cout << "Task 5 has completed" << std::endl; + + async::parallel_invoke([] { + std::cout << "This is executed in parallel..." << std::endl; + }, [] { + std::cout << "with this" << std::endl; + }); + + async::parallel_for(async::irange(0, 5), [](int x) { + std::cout << x; + }); + std::cout << std::endl; + + int r = async::parallel_reduce({1, 2, 3, 4}, 0, [](int x, int y) { + return x + y; + }); + std::cout << "The sum of {1, 2, 3, 4} is " << r << std::endl; +} diff --git a/recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt b/recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/asyncplusplus/all/test_v1_package/conanfile.py b/recipes/asyncplusplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/asyncplusplus/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/asyncplusplus/config.yml b/recipes/asyncplusplus/config.yml new file mode 100644 index 0000000000000..3f8a45fae5832 --- /dev/null +++ b/recipes/asyncplusplus/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1": + folder: all diff --git a/recipes/at-spi2-atk/all/conandata.yml b/recipes/at-spi2-atk/all/conandata.yml new file mode 100644 index 0000000000000..eb79b712b86b1 --- /dev/null +++ b/recipes/at-spi2-atk/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.38.0": + url: "http://ftp.gnome.org/pub/gnome/sources/at-spi2-atk/2.38/at-spi2-atk-2.38.0.tar.xz" + sha256: "cfa008a5af822b36ae6287f18182c40c91dd699c55faa38605881ed175ca464f" diff --git a/recipes/at-spi2-atk/all/conanfile.py b/recipes/at-spi2-atk/all/conanfile.py new file mode 100644 index 0000000000000..2fc37026d8c0f --- /dev/null +++ b/recipes/at-spi2-atk/all/conanfile.py @@ -0,0 +1,98 @@ +from conans import ConanFile, Meson, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class AtSPI2AtkConan(ConanFile): + name = "at-spi2-atk" + description = "library that bridges ATK to At-Spi2 D-Bus service." + topics = ("conan", "atk", "accessibility") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.gnome.org/GNOME/at-spi2-atk" + license = "LGPL-2.1-or-later" + generators = "pkg_config" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _meson = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def validate(self): + if self.settings.os not in ("Linux", "FreeBSD"): + raise ConanInvalidConfiguration("at-spi2-atk is only supported on Linux and FreeBSD") + if self.options.shared and (not self.options["glib"].shared + or not self.options["at-spi2-core"].shared + or not self.options["atk"].shared): + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + self.options["at-spi2-core"].shared = True + self.options["atk"].shared = True + self.options["glib"].shared = True + + + def build_requirements(self): + self.build_requires("meson/0.62.2") + self.build_requires('pkgconf/1.7.4') + + def requirements(self): + self.requires("at-spi2-core/2.44.1") + self.requires("atk/2.38.0") + self.requires("glib/2.73.0") + self.requires("libxml2/2.9.14") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _configure_meson(self): + if self._meson: + return self._meson + self._meson = Meson(self) + args=[] + args.append('--wrap-mode=nofallback') + self._meson.configure(build_folder=self._build_subfolder, source_folder=self._source_subfolder, pkg_config_paths='.', args=args) + return self._meson + + def build(self): + meson = self._configure_meson() + meson.build() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + meson.install() + tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig')) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs = [os.path.join('include', 'at-spi2-atk', '2.0')] + self.cpp_info.names['pkg_config'] = 'atk-bridge-2.0' + + def package_id(self): + self.info.requires["at-spi2-core"].full_package_mode() + self.info.requires["atk"].full_package_mode() + self.info.requires["glib"].full_package_mode() diff --git a/recipes/at-spi2-atk/all/test_package/CMakeLists.txt b/recipes/at-spi2-atk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afa2476357074 --- /dev/null +++ b/recipes/at-spi2-atk/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +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/at-spi2-atk/all/test_package/conanfile.py b/recipes/at-spi2-atk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/at-spi2-atk/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/at-spi2-atk/all/test_package/test_package.c b/recipes/at-spi2-atk/all/test_package/test_package.c new file mode 100644 index 0000000000000..7596156d01b45 --- /dev/null +++ b/recipes/at-spi2-atk/all/test_package/test_package.c @@ -0,0 +1,51 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility) + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/* + * Testing AT-SPI requires both a test application and AT client. + * Test applications are built using the Dummy ATK implementation: MyAtk. + * This file contains the entry point for all test applications. + * The test will provide its own implementation of atk_get_root, + * and as such provide all the application state for the test. + */ + +#include +#include +#include +#include +#include +#include + + + +static GMainLoop *mainloop; + +int main (int argc, char *argv[]) +{ + atk_bridge_adaptor_init (NULL, NULL); + + mainloop = g_main_loop_new (NULL, FALSE); + + atk_bridge_adaptor_cleanup(); + + return 0; +} diff --git a/recipes/at-spi2-atk/config.yml b/recipes/at-spi2-atk/config.yml new file mode 100644 index 0000000000000..3fe6d23a68034 --- /dev/null +++ b/recipes/at-spi2-atk/config.yml @@ -0,0 +1,3 @@ +versions: + "2.38.0": + folder: all diff --git a/recipes/at-spi2-core/all/conandata.yml b/recipes/at-spi2-core/all/conandata.yml new file mode 100644 index 0000000000000..571d10adab672 --- /dev/null +++ b/recipes/at-spi2-core/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "2.38.0": + url: "http://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.38/at-spi2-core-2.38.0.tar.xz" + sha256: "84e36c3fe66862133f5fe229772b76aa2526e10de5014a3778f2fa46ce550da5" + "2.39.1": + url: "http://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.39/at-spi2-core-2.39.1.tar.xz" + sha256: "44d2b042e47d25571581efff673af0a8cd79531babbad2b043784879e15e4228" + "2.40.3": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.40/at-spi2-core-2.40.3.tar.xz" + sha256: "e49837c2ad30d71e1f29ca8e0968a54b95030272f7ff40b89b48968653f37a5c" + "2.42.0": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.42/at-spi2-core-2.42.0.tar.xz" + sha256: "4b5da10e94fa3c6195f95222438f63a0234b99ef9df772c7640e82baeaa6e386" + "2.44.0": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.44/at-spi2-core-2.44.0.tar.xz" + sha256: "7eee3cf285b089060fd6b6e51b3eb2cacf752cca3a082c7f4c2c5ab841e51353" + "2.44.1": + sha256: "4beb23270ba6cf7caf20b597354d75194d89afb69d2efcf15f4271688ba6f746" + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.44/at-spi2-core-2.44.1.tar.xz" +patches: + "2.44.0": + - base_path: "source_subfolder" + patch_file: "patches/08036a4c4491eea57d7b713bb4440f541584204b.patch" diff --git a/recipes/at-spi2-core/all/conanfile.py b/recipes/at-spi2-core/all/conanfile.py new file mode 100644 index 0000000000000..e6ca0e2427585 --- /dev/null +++ b/recipes/at-spi2-core/all/conanfile.py @@ -0,0 +1,110 @@ +from conans import ConanFile, Meson, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class AtSpi2CoreConan(ConanFile): + name = "at-spi2-core" + description = "It provides a Service Provider Interface for the Assistive Technologies available on the GNOME platform and a library against which applications can be linked" + topics = "atk", "accessibility" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.gnome.org/GNOME/at-spi2-core/" + license = "LGPL-2.1-or-later" + generators = "pkg_config" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_x11": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_x11": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + _meson = None + + 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.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + self.options["glib"].shared = True + + def build_requirements(self): + self.build_requires("meson/0.62.2") + self.build_requires("pkgconf/1.7.4") + + def requirements(self): + self.requires("glib/2.73.0") + if self.options.with_x11: + self.requires("xorg/system") + self.requires("dbus/1.12.20") + + def validate(self): + if self.options.shared and not self.options["glib"].shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("only linux is supported by this recipe") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _configure_meson(self): + if self._meson: + return self._meson + self._meson = Meson(self) + defs = {} + defs["introspection"] = "no" + defs["docs"] = "false" + defs["x11"] = "yes" if self.options.with_x11 else "no" + args=[] + args.append("--datadir=%s" % os.path.join(self.package_folder, "res")) + args.append("--localedir=%s" % os.path.join(self.package_folder, "res")) + args.append("--wrap-mode=nofallback") + self._meson.configure(defs=defs, build_folder=self._build_subfolder, source_folder=self._source_subfolder, pkg_config_paths=".", args=args) + return self._meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if tools.Version(self.version) >= "2.42.0": + tools.replace_in_file(os.path.join(self._source_subfolder, "bus", "meson.build"), + "if x11_dep.found()", + "if x11_option == 'yes'") + meson = self._configure_meson() + meson.build() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + meson.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs = ["include/at-spi-2.0"] + self.cpp_info.names["pkg_config"] = "atspi-2" + + def package_id(self): + self.info.requires["glib"].full_package_mode() diff --git a/recipes/at-spi2-core/all/patches/08036a4c4491eea57d7b713bb4440f541584204b.patch b/recipes/at-spi2-core/all/patches/08036a4c4491eea57d7b713bb4440f541584204b.patch new file mode 100644 index 0000000000000..ce10b7a2bce56 --- /dev/null +++ b/recipes/at-spi2-core/all/patches/08036a4c4491eea57d7b713bb4440f541584204b.patch @@ -0,0 +1,37 @@ +From 08036a4c4491eea57d7b713bb4440f541584204b Mon Sep 17 00:00:00 2001 +From: Mike Gorse +Date: Mon, 21 Mar 2022 10:19:03 -0500 +Subject: [PATCH] Fix build with X11 disabled + +Closes #51 +--- + registryd/deviceeventcontroller.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c +index 8a321adc..3068ec4b 100644 +--- a/registryd/deviceeventcontroller.c ++++ b/registryd/deviceeventcontroller.c +@@ -1720,16 +1720,16 @@ spi_dec_synth_keysym (SpiDEController *controller, long keysym) + if (synth_mods != modifiers) { + lock_mods = synth_mods & ~modifiers; + spi_dec_plat_lock_modifiers (controller, lock_mods); +- if (modifiers & LockMask) +- spi_dec_plat_unlock_modifiers (controller, LockMask); ++ if (modifiers & SPI_KEYMASK_SHIFTLOCK) ++ spi_dec_plat_unlock_modifiers (controller, SPI_KEYMASK_SHIFTLOCK); + } + spi_dec_plat_synth_keycode_press (controller, key_synth_code); + spi_dec_plat_synth_keycode_release (controller, key_synth_code); + + if (synth_mods != modifiers) { + spi_dec_plat_unlock_modifiers (controller, lock_mods); +- if (modifiers & LockMask) +- spi_dec_plat_lock_modifiers (controller, LockMask); ++ if (modifiers & SPI_KEYMASK_SHIFTLOCK) ++ spi_dec_plat_lock_modifiers (controller, SPI_KEYMASK_SHIFTLOCK); + } + return TRUE; + } +-- +GitLab diff --git a/recipes/at-spi2-core/all/test_package/CMakeLists.txt b/recipes/at-spi2-core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afa2476357074 --- /dev/null +++ b/recipes/at-spi2-core/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +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/at-spi2-core/all/test_package/conanfile.py b/recipes/at-spi2-core/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/at-spi2-core/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/at-spi2-core/all/test_package/test_package.c b/recipes/at-spi2-core/all/test_package/test_package.c new file mode 100644 index 0000000000000..c155308c155ba --- /dev/null +++ b/recipes/at-spi2-core/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "atspi/atspi.h" +#include "assert.h" + +int main() +{ + atspi_init (); + assert(atspi_get_desktop_count() > 0); + return atspi_exit(); +} diff --git a/recipes/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml new file mode 100644 index 0000000000000..f3e69dd713878 --- /dev/null +++ b/recipes/at-spi2-core/config.yml @@ -0,0 +1,23 @@ +versions: + "2.38.0": + folder: all + "2.39.1": + folder: all + "2.40.3": + folder: all + "2.42.0": + folder: all + "2.44.0": + folder: all + "2.44.1": + folder: all + "2.45.1": + folder: new + "2.45.90": + folder: new + "2.46.0": + folder: new + "2.47.1": + folder: new + "2.48.0": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml new file mode 100644 index 0000000000000..1d17c17af2c31 --- /dev/null +++ b/recipes/at-spi2-core/new/conandata.yml @@ -0,0 +1,27 @@ +sources: + "2.48.0": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.48/at-spi2-core-2.48.0.tar.xz" + sha256: "905a5b6f1790b68ee803bffa9f5fab4ceb591fb4fae0b2f8c612c54f1d4e8a30" + "2.47.1": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.47/at-spi2-core-2.47.1.tar.xz" + sha256: "c6ba7c160434edebf09d2936933569c936f6ec972301766f2bdac5a4d418153c" + "2.46.0": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.46/at-spi2-core-2.46.0.tar.xz" + sha256: "aa0c86c79f7a8d67bae49a5b7a5ab08430c608cffe6e33bf47a72f41ab03c3d0" + "2.45.90": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.90.tar.xz" + sha256: "e9050ad3c24937548396b2377f2fcdb9321ce2daffad35e7554e8f6ad850ab0d" + "2.45.1": + sha256: "ba95f346e93108fbb3462c62437081d582154db279b4052dedc52a706828b192" + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.1.tar.xz" +patches: + "2.48.0": + - patch_file: "patches/93.patch" + "2.47.1": + - patch_file: "patches/93.patch" + "2.46.0": + - patch_file: "patches/93.patch" + "2.45.90": + - patch_file: "patches/93.patch" + "2.45.1": + - patch_file: "patches/93.patch" diff --git a/recipes/at-spi2-core/new/conanfile.py b/recipes/at-spi2-core/new/conanfile.py new file mode 100644 index 0000000000000..a1cb677e5eea0 --- /dev/null +++ b/recipes/at-spi2-core/new/conanfile.py @@ -0,0 +1,128 @@ +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, replace_in_file, 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" +class AtSpi2CoreConan(ConanFile): + name = "at-spi2-core" + description = "It provides a Service Provider Interface for the Assistive Technologies available on the GNOME platform and a library against which applications can be linked" + topics = ("atk", "accessibility") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.gnome.org/GNOME/at-spi2-core/" + license = "LGPL-2.1-or-later" + + provides = "at-spi2-atk", "atk" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_x11": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_x11": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.options.shared: + self.options["glib"].shared = True + + def build_requirements(self): + self.tool_requires("meson/1.1.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def requirements(self): + self.requires("glib/2.76.2") + if self.options.with_x11: + self.requires("xorg/system") + self.requires("dbus/1.15.2") + + def validate(self): + if self.options.shared and not self.options["glib"].shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("only linux is supported by this recipe") + + def layout(self): + basic_layout(self, src_folder="src") + self.cpp.package.resdirs = ["res"] + + 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() + tc = MesonToolchain(self) + if Version(self.version) >= "2.47.1": + tc.project_options["introspection"] = "disabled" + tc.project_options["x11"] = "enabled" if self.options.with_x11 else "disabled" + else: + tc.project_options["introspection"] = "no" + tc.project_options["x11"] = "yes" if self.options.with_x11 else "no" + tc.project_options["docs"] = "false" + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "bus", "meson.build"), + "if x11_dep.found()", + "if get_option('x11').enabled()" if Version(self.version) >= "2.47.1" + else "if x11_option == 'yes'") + replace_in_file(self, os.path.join(self.source_folder, 'meson.build'), + "subdir('tests')", + "#subdir('tests')") + replace_in_file(self, os.path.join(self.source_folder, 'meson.build'), + "libxml_dep = dependency('libxml-2.0', version: libxml_req_version)", + "#libxml_dep = dependency('libxml-2.0', version: libxml_req_version)") + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "etc")) + + + def package_info(self): + self.cpp_info.components["atspi"].libs = ['atspi'] + self.cpp_info.components["atspi"].includedirs = ["include/at-spi-2.0"] + self.cpp_info.components["atspi"].requires = ["dbus::dbus", "glib::glib"] + self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2") + + self.cpp_info.components["atk"].libs = ["atk-1.0"] + self.cpp_info.components["atk"].includedirs = ['include/atk-1.0'] + self.cpp_info.components["atk"].requires = ["glib::glib"] + self.cpp_info.components["atk"].set_property("pkg_config_name", 'atk') + + self.cpp_info.components["atk-bridge"].libs = ['atk-bridge-2.0'] + self.cpp_info.components["atk-bridge"].includedirs = [os.path.join('include', 'at-spi2-atk', '2.0')] + self.cpp_info.components["atk-bridge"].requires = ["dbus::dbus", "atk", "glib::glib", "atspi"] + self.cpp_info.components["atk-bridge"].set_property("pkg_config_name", 'atk-bridge-2.0') + + def package_id(self): + self.info.requires["glib"].full_package_mode() diff --git a/recipes/at-spi2-core/new/patches/93.patch b/recipes/at-spi2-core/new/patches/93.patch new file mode 100644 index 0000000000000..7ff4a19473df8 --- /dev/null +++ b/recipes/at-spi2-core/new/patches/93.patch @@ -0,0 +1,521 @@ +From 99a88f23978d668802f63470c7f75ba3886166e1 Mon Sep 17 00:00:00 2001 +From: ericLemanissier +Date: Tue, 5 Jul 2022 10:13:54 +0000 +Subject: [PATCH] add license file + +fixes GNOME/at-spi2-core#78 +--- + COPYING | 502 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 502 insertions(+) + create mode 100644 COPYING + +diff --git a/COPYING b/COPYING +new file mode 100644 +index 00000000..4362b491 +--- /dev/null ++++ b/COPYING +@@ -0,0 +1,502 @@ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ Version 2.1, February 1999 ++ ++ Copyright (C) 1991, 1999 Free Software Foundation, Inc. ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++[This is the first released version of the Lesser GPL. It also counts ++ as the successor of the GNU Library Public License, version 2, hence ++ the version number 2.1.] ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++Licenses are intended to guarantee your freedom to share and change ++free software--to make sure the software is free for all its users. ++ ++ This license, the Lesser General Public License, applies to some ++specially designated software packages--typically libraries--of the ++Free Software Foundation and other authors who decide to use it. You ++can use it too, but we suggest you first think carefully about whether ++this license or the ordinary General Public License is the better ++strategy to use in any particular case, based on the explanations below. ++ ++ When we speak of free software, we are referring to freedom of use, ++not price. Our General Public Licenses are designed to make sure that ++you have the freedom to distribute copies of free software (and charge ++for this service if you wish); that you receive source code or can get ++it if you want it; that you can change the software and use pieces of ++it in new free programs; and that you are informed that you can do ++these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++distributors to deny you these rights or to ask you to surrender these ++rights. These restrictions translate to certain responsibilities for ++you if you distribute copies of the library or if you modify it. ++ ++ For example, if you distribute copies of the library, whether gratis ++or for a fee, you must give the recipients all the rights that we gave ++you. You must make sure that they, too, receive or can get the source ++code. If you link other code with the library, you must provide ++complete object files to the recipients, so that they can relink them ++with the library after making changes to the library and recompiling ++it. And you must show them these terms so they know their rights. ++ ++ We protect your rights with a two-step method: (1) we copyright the ++library, and (2) we offer you this license, which gives you legal ++permission to copy, distribute and/or modify the library. ++ ++ To protect each distributor, we want to make it very clear that ++there is no warranty for the free library. Also, if the library is ++modified by someone else and passed on, the recipients should know ++that what they have is not the original version, so that the original ++author's reputation will not be affected by problems that might be ++introduced by others. ++ ++ Finally, software patents pose a constant threat to the existence of ++any free program. We wish to make sure that a company cannot ++effectively restrict the users of a free program by obtaining a ++restrictive license from a patent holder. Therefore, we insist that ++any patent license obtained for a version of the library must be ++consistent with the full freedom of use specified in this license. ++ ++ Most GNU software, including some libraries, is covered by the ++ordinary GNU General Public License. This license, the GNU Lesser ++General Public License, applies to certain designated libraries, and ++is quite different from the ordinary General Public License. We use ++this license for certain libraries in order to permit linking those ++libraries into non-free programs. ++ ++ When a program is linked with a library, whether statically or using ++a shared library, the combination of the two is legally speaking a ++combined work, a derivative of the original library. The ordinary ++General Public License therefore permits such linking only if the ++entire combination fits its criteria of freedom. The Lesser General ++Public License permits more lax criteria for linking other code with ++the library. ++ ++ We call this license the "Lesser" General Public License because it ++does Less to protect the user's freedom than the ordinary General ++Public License. It also provides other free software developers Less ++of an advantage over competing non-free programs. These disadvantages ++are the reason we use the ordinary General Public License for many ++libraries. However, the Lesser license provides advantages in certain ++special circumstances. ++ ++ For example, on rare occasions, there may be a special need to ++encourage the widest possible use of a certain library, so that it becomes ++a de-facto standard. To achieve this, non-free programs must be ++allowed to use the library. A more frequent case is that a free ++library does the same job as widely used non-free libraries. In this ++case, there is little to gain by limiting the free library to free ++software only, so we use the Lesser General Public License. ++ ++ In other cases, permission to use a particular library in non-free ++programs enables a greater number of people to use a large body of ++free software. For example, permission to use the GNU C Library in ++non-free programs enables many more people to use the whole GNU ++operating system, as well as its variant, the GNU/Linux operating ++system. ++ ++ Although the Lesser General Public License is Less protective of the ++users' freedom, it does ensure that the user of a program that is ++linked with the Library has the freedom and the wherewithal to run ++that program using a modified version of the Library. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. Pay close attention to the difference between a ++"work based on the library" and a "work that uses the library". The ++former contains code derived from the library, whereas the latter must ++be combined with the library in order to run. ++ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License Agreement applies to any software library or other ++program which contains a notice placed by the copyright holder or ++other authorized party saying it may be distributed under the terms of ++this Lesser General Public License (also called "this License"). ++Each licensee is addressed as "you". ++ ++ A "library" means a collection of software functions and/or data ++prepared so as to be conveniently linked with application programs ++(which use some of those functions and data) to form executables. ++ ++ The "Library", below, refers to any such software library or work ++which has been distributed under these terms. A "work based on the ++Library" means either the Library or any derivative work under ++copyright law: that is to say, a work containing the Library or a ++portion of it, either verbatim or with modifications and/or translated ++straightforwardly into another language. (Hereinafter, translation is ++included without limitation in the term "modification".) ++ ++ "Source code" for a work means the preferred form of the work for ++making modifications to it. For a library, complete source code means ++all the source code for all modules it contains, plus any associated ++interface definition files, plus the scripts used to control compilation ++and installation of the library. ++ ++ Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running a program using the Library is not restricted, and output from ++such a program is covered only if its contents constitute a work based ++on the Library (independent of the use of the Library in a tool for ++writing it). Whether that is true depends on what the Library does ++and what the program that uses the Library does. ++ ++ 1. You may copy and distribute verbatim copies of the Library's ++complete source code as you receive it, in any medium, provided that ++you conspicuously and appropriately publish on each copy an ++appropriate copyright notice and disclaimer of warranty; keep intact ++all the notices that refer to this License and to the absence of any ++warranty; and distribute a copy of this License along with the ++Library. ++ ++ You may charge a fee for the physical act of transferring a copy, ++and you may at your option offer warranty protection in exchange for a ++fee. ++ ++ 2. You may modify your copy or copies of the Library or any portion ++of it, thus forming a work based on the Library, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) The modified work must itself be a software library. ++ ++ b) You must cause the files modified to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ c) You must cause the whole of the work to be licensed at no ++ charge to all third parties under the terms of this License. ++ ++ d) If a facility in the modified Library refers to a function or a ++ table of data to be supplied by an application program that uses ++ the facility, other than as an argument passed when the facility ++ is invoked, then you must make a good faith effort to ensure that, ++ in the event an application does not supply such function or ++ table, the facility still operates, and performs whatever part of ++ its purpose remains meaningful. ++ ++ (For example, a function in a library to compute square roots has ++ a purpose that is entirely well-defined independent of the ++ application. Therefore, Subsection 2d requires that any ++ application-supplied function or table used by this function must ++ be optional: if the application does not supply it, the square ++ root function must still compute square roots.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Library, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Library, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote ++it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Library. ++ ++In addition, mere aggregation of another work not based on the Library ++with the Library (or with a work based on the Library) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may opt to apply the terms of the ordinary GNU General Public ++License instead of this License to a given copy of the Library. To do ++this, you must alter all the notices that refer to this License, so ++that they refer to the ordinary GNU General Public License, version 2, ++instead of to this License. (If a newer version than version 2 of the ++ordinary GNU General Public License has appeared, then you can specify ++that version instead if you wish.) Do not make any other change in ++these notices. ++ ++ Once this change is made in a given copy, it is irreversible for ++that copy, so the ordinary GNU General Public License applies to all ++subsequent copies and derivative works made from that copy. ++ ++ This option is useful when you wish to copy part of the code of ++the Library into a program that is not a library. ++ ++ 4. You may copy and distribute the Library (or a portion or ++derivative of it, under Section 2) in object code or executable form ++under the terms of Sections 1 and 2 above provided that you accompany ++it with the complete corresponding machine-readable source code, which ++must be distributed under the terms of Sections 1 and 2 above on a ++medium customarily used for software interchange. ++ ++ If distribution of object code is made by offering access to copy ++from a designated place, then offering equivalent access to copy the ++source code from the same place satisfies the requirement to ++distribute the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 5. A program that contains no derivative of any portion of the ++Library, but is designed to work with the Library by being compiled or ++linked with it, is called a "work that uses the Library". Such a ++work, in isolation, is not a derivative work of the Library, and ++therefore falls outside the scope of this License. ++ ++ However, linking a "work that uses the Library" with the Library ++creates an executable that is a derivative of the Library (because it ++contains portions of the Library), rather than a "work that uses the ++library". The executable is therefore covered by this License. ++Section 6 states terms for distribution of such executables. ++ ++ When a "work that uses the Library" uses material from a header file ++that is part of the Library, the object code for the work may be a ++derivative work of the Library even though the source code is not. ++Whether this is true is especially significant if the work can be ++linked without the Library, or if the work is itself a library. The ++threshold for this to be true is not precisely defined by law. ++ ++ If such an object file uses only numerical parameters, data ++structure layouts and accessors, and small macros and small inline ++functions (ten lines or less in length), then the use of the object ++file is unrestricted, regardless of whether it is legally a derivative ++work. (Executables containing this object code plus portions of the ++Library will still fall under Section 6.) ++ ++ Otherwise, if the work is a derivative of the Library, you may ++distribute the object code for the work under the terms of Section 6. ++Any executables containing that work also fall under Section 6, ++whether or not they are linked directly with the Library itself. ++ ++ 6. As an exception to the Sections above, you may also combine or ++link a "work that uses the Library" with the Library to produce a ++work containing portions of the Library, and distribute that work ++under terms of your choice, provided that the terms permit ++modification of the work for the customer's own use and reverse ++engineering for debugging such modifications. ++ ++ You must give prominent notice with each copy of the work that the ++Library is used in it and that the Library and its use are covered by ++this License. You must supply a copy of this License. If the work ++during execution displays copyright notices, you must include the ++copyright notice for the Library among them, as well as a reference ++directing the user to the copy of this License. Also, you must do one ++of these things: ++ ++ a) Accompany the work with the complete corresponding ++ machine-readable source code for the Library including whatever ++ changes were used in the work (which must be distributed under ++ Sections 1 and 2 above); and, if the work is an executable linked ++ with the Library, with the complete machine-readable "work that ++ uses the Library", as object code and/or source code, so that the ++ user can modify the Library and then relink to produce a modified ++ executable containing the modified Library. (It is understood ++ that the user who changes the contents of definitions files in the ++ Library will not necessarily be able to recompile the application ++ to use the modified definitions.) ++ ++ b) Use a suitable shared library mechanism for linking with the ++ Library. A suitable mechanism is one that (1) uses at run time a ++ copy of the library already present on the user's computer system, ++ rather than copying library functions into the executable, and (2) ++ will operate properly with a modified version of the library, if ++ the user installs one, as long as the modified version is ++ interface-compatible with the version that the work was made with. ++ ++ c) Accompany the work with a written offer, valid for at ++ least three years, to give the same user the materials ++ specified in Subsection 6a, above, for a charge no more ++ than the cost of performing this distribution. ++ ++ d) If distribution of the work is made by offering access to copy ++ from a designated place, offer equivalent access to copy the above ++ specified materials from the same place. ++ ++ e) Verify that the user has already received a copy of these ++ materials or that you have already sent this user a copy. ++ ++ For an executable, the required form of the "work that uses the ++Library" must include any data and utility programs needed for ++reproducing the executable from it. However, as a special exception, ++the materials to be distributed need not include anything that is ++normally distributed (in either source or binary form) with the major ++components (compiler, kernel, and so on) of the operating system on ++which the executable runs, unless that component itself accompanies ++the executable. ++ ++ It may happen that this requirement contradicts the license ++restrictions of other proprietary libraries that do not normally ++accompany the operating system. Such a contradiction means you cannot ++use both them and the Library together in an executable that you ++distribute. ++ ++ 7. You may place library facilities that are a work based on the ++Library side-by-side in a single library together with other library ++facilities not covered by this License, and distribute such a combined ++library, provided that the separate distribution of the work based on ++the Library and of the other library facilities is otherwise ++permitted, and provided that you do these two things: ++ ++ a) Accompany the combined library with a copy of the same work ++ based on the Library, uncombined with any other library ++ facilities. This must be distributed under the terms of the ++ Sections above. ++ ++ b) Give prominent notice with the combined library of the fact ++ that part of it is a work based on the Library, and explaining ++ where to find the accompanying uncombined form of the same work. ++ ++ 8. You may not copy, modify, sublicense, link with, or distribute ++the Library except as expressly provided under this License. Any ++attempt otherwise to copy, modify, sublicense, link with, or ++distribute the Library is void, and will automatically terminate your ++rights under this License. However, parties who have received copies, ++or rights, from you under this License will not have their licenses ++terminated so long as such parties remain in full compliance. ++ ++ 9. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Library or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Library (or any work based on the ++Library), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Library or works based on it. ++ ++ 10. Each time you redistribute the Library (or any work based on the ++Library), the recipient automatically receives a license from the ++original licensor to copy, distribute, link with or modify the Library ++subject to these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties with ++this License. ++ ++ 11. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Library at all. For example, if a patent ++license would not permit royalty-free redistribution of the Library by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Library. ++ ++If any portion of this section is held invalid or unenforceable under any ++particular circumstance, the balance of the section is intended to apply, ++and the section as a whole is intended to apply in other circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 12. If the distribution and/or use of the Library is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Library under this License may add ++an explicit geographical distribution limitation excluding those countries, ++so that distribution is permitted only in or among countries not thus ++excluded. In such case, this License incorporates the limitation as if ++written in the body of this License. ++ ++ 13. The Free Software Foundation may publish revised and/or new ++versions of the Lesser General Public License from time to time. ++Such new versions will be similar in spirit to the present version, ++but may differ in detail to address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Library ++specifies a version number of this License which applies to it and ++"any later version", you have the option of following the terms and ++conditions either of that version or of any later version published by ++the Free Software Foundation. If the Library does not specify a ++license version number, you may choose any version ever published by ++the Free Software Foundation. ++ ++ 14. If you wish to incorporate parts of the Library into other free ++programs whose distribution conditions are incompatible with these, ++write to the author to ask for permission. For software which is ++copyrighted by the Free Software Foundation, write to the Free ++Software Foundation; we sometimes make exceptions for this. Our ++decision will be guided by the two goals of preserving the free status ++of all derivatives of our free software and of promoting the sharing ++and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO ++WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. ++EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR ++OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY ++KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ++LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME ++THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ++ ++ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ++WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY ++AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU ++FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR ++CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE ++LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING ++RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A ++FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF ++SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ++DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Libraries ++ ++ If you develop a new library, and you want it to be of the greatest ++possible use to the public, we recommend making it free software that ++everyone can redistribute and change. You can do so by permitting ++redistribution under these terms (or, alternatively, under the terms of the ++ordinary General Public License). ++ ++ To apply these terms, attach the following notices to the library. It is ++safest to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least the ++"copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the library, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the ++ library `Frob' (a library for tweaking knobs) written by James Random Hacker. ++ ++ , 1 April 1990 ++ Ty Coon, President of Vice ++ ++That's all there is to it! +-- +GitLab diff --git a/recipes/at-spi2-core/new/test_package/CMakeLists.txt b/recipes/at-spi2-core/new/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afa2476357074 --- /dev/null +++ b/recipes/at-spi2-core/new/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +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/at-spi2-core/new/test_package/conanfile.py b/recipes/at-spi2-core/new/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/at-spi2-core/new/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/at-spi2-core/new/test_package/test_package.c b/recipes/at-spi2-core/new/test_package/test_package.c new file mode 100644 index 0000000000000..c155308c155ba --- /dev/null +++ b/recipes/at-spi2-core/new/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "atspi/atspi.h" +#include "assert.h" + +int main() +{ + atspi_init (); + assert(atspi_get_desktop_count() > 0); + return atspi_exit(); +} diff --git a/recipes/atk/all/conandata.yml b/recipes/atk/all/conandata.yml new file mode 100644 index 0000000000000..40a2c07c87971 --- /dev/null +++ b/recipes/atk/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.38.0": + url: "https://download.gnome.org/sources/atk/2.38/atk-2.38.0.tar.xz" + sha256: "ac4de2a4ef4bd5665052952fe169657e65e895c5057dffb3c2a810f6191a0c36" + "2.36.0": + url: "https://download.gnome.org/sources/atk/2.36/atk-2.36.0.tar.xz" + sha256: "fb76247e369402be23f1f5c65d38a9639c1164d934e40f6a9cf3c9e96b652788" +patches: + "2.38.0": + - patch_file: "patches/define_dllmain_only_when_shared.patch" diff --git a/recipes/atk/all/conanfile.py b/recipes/atk/all/conanfile.py new file mode 100644 index 0000000000000..851368f9af235 --- /dev/null +++ b/recipes/atk/all/conanfile.py @@ -0,0 +1,127 @@ +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 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 +from conan.tools.microsoft import is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class AtkConan(ConanFile): + name = "atk" + description = "set of accessibility interfaces that are implemented by other toolkits and applications" + topics = ("accessibility",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.atk.org" + license = "LGPL-2.1-or-later" + + 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") + if self.options.shared: + self.options["glib"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.75.2") + + def validate(self): + if self.options.shared and not self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + + if str(self.settings.compiler) == "Visual Studio" and not self.options.shared and \ + is_msvc_static_runtime(self) and self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration("this specific configuration is prevented due to internal c3i limitations") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("glib/2.75.2") + + 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 = MesonToolchain(self) + tc.project_options["introspection"] = False + tc.project_options["docs"] = False + tc.project_options["localedir"] = os.path.join(self.package_folder, "bin", "share", "locale") + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('tests')", "#subdir('tests')") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + 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) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "atk") + self.cpp_info.libs = ["atk-1.0"] + self.cpp_info.includedirs = [os.path.join("include", "atk-1.0")] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/atk/all/patches/define_dllmain_only_when_shared.patch b/recipes/atk/all/patches/define_dllmain_only_when_shared.patch new file mode 100644 index 0000000000000..98af12c8b5189 --- /dev/null +++ b/recipes/atk/all/patches/define_dllmain_only_when_shared.patch @@ -0,0 +1,19 @@ +commit 2c8b80761a9ef6b381c909cf05dda711e7e9b85c +Author: Hesham Essam +Date: Fri Jun 3 15:58:03 2022 +0200 + + Define DllMain only when building a dll + +diff --git a/atk/atkprivate.c b/atk/atkprivate.c +index e414bf2..988acc8 100644 +--- a/atk/atkprivate.c ++++ b/atk/atkprivate.c +@@ -30,7 +30,7 @@ + + #include "atkprivate.h" + +-#ifdef G_OS_WIN32 ++#if defined(G_OS_WIN32) && defined(DLL_EXPORT) + + #define STRICT + #include diff --git a/recipes/atk/all/test_package/CMakeLists.txt b/recipes/atk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..331b8cd557e44 --- /dev/null +++ b/recipes/atk/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(atk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE atk::atk) diff --git a/recipes/atk/all/test_package/conanfile.py b/recipes/atk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/atk/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/atk/all/test_package/test_package.c b/recipes/atk/all/test_package/test_package.c new file mode 100644 index 0000000000000..284086622ab26 --- /dev/null +++ b/recipes/atk/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + printf("ATK version %d.%d.%d\n",atk_get_major_version(), atk_get_minor_version(), atk_get_micro_version()); + printf("binary age %d\n", atk_get_binary_age()); + printf("interface age %d\n", atk_get_interface_age()); + return 0; +} diff --git a/recipes/atk/all/test_v1_package/CMakeLists.txt b/recipes/atk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/atk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/atk/all/test_v1_package/conanfile.py b/recipes/atk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/atk/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/atk/config.yml b/recipes/atk/config.yml new file mode 100644 index 0000000000000..0a1f46c973b32 --- /dev/null +++ b/recipes/atk/config.yml @@ -0,0 +1,5 @@ +versions: + "2.38.0": + folder: all + "2.36.0": + folder: all diff --git a/recipes/audiofile/all/conandata.yml b/recipes/audiofile/all/conandata.yml new file mode 100644 index 0000000000000..042cc12d06dd1 --- /dev/null +++ b/recipes/audiofile/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.0": + url: "https://github.com/adamstark/AudioFile/archive/1.1.0.tar.gz" + sha256: "7546e39ca17ac09c653f46bfecce4a9936fae3784209ad53094915c78792a327" + "1.0.9": + url: "https://github.com/adamstark/AudioFile/archive/1.0.9.tar.gz" + sha256: "1d609b80496fc5c688d8e83086cdcad5b60ddb20f02d160f80be271fab97c4c0" + "1.0.8": + url: "https://github.com/adamstark/AudioFile/archive/1.0.8.tar.gz" + sha256: "f9ecc578425cb90a4a846b32c8ac162c9a61952713bd07525337245a8dee8ad2" diff --git a/recipes/audiofile/all/conanfile.py b/recipes/audiofile/all/conanfile.py new file mode 100644 index 0000000000000..0d083108cea08 --- /dev/null +++ b/recipes/audiofile/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class AudiofileConan(ConanFile): + name = "audiofile" + description = "A simple C++11 library for reading and writing audio files." + topics = ("audiofile", "audio", "file-format", "wav", "aif") + license = "MIT" + homepage = "https://github.com/adamstark/AudioFile" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def configure(self): + if Version(self.version) < "1.1.0": + self.license = "GPL-3.0-or-later" + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + 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, "AudioFile.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/audiofile/all/test_package/CMakeLists.txt b/recipes/audiofile/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6f7178f4a8927 --- /dev/null +++ b/recipes/audiofile/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(audiofile REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE audiofile::audiofile) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/audiofile/all/test_package/conanfile.py b/recipes/audiofile/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fb1d035fc5b12 --- /dev/null +++ b/recipes/audiofile/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + wav_path = os.path.join(self.source_folder, "sine.wav") + self.run(f"{bin_path} {wav_path}", env="conanrun") diff --git a/recipes/audiofile/all/test_package/sine.wav b/recipes/audiofile/all/test_package/sine.wav new file mode 100644 index 0000000000000000000000000000000000000000..a3225d12bf297b5ad29e601bb30edb6466d229f2 GIT binary patch literal 24044 zcmeI4=}VMR6vp3N+BBF-Nm4ZPgQ8_n5f%z+W|SZlrDTc=ZH7vy;Zi!Ipe)^wh{<;o^cwgG{Y+X)+wd6upX;1Kp zq1Juvz8hj(UHo$gqHEerpX!4=&ty22nI~#H({4luzbO9pefn-dO?cdsH<{H_r|NUe zsXci`)EV2OLJ&VWl5{a@-%vKVtJq6fiF9UYLC7jD^7T5o-RB&5TBCl zvu%8-X?W%6qT|+0gIBt@SB97@o-@_Sznb3d@0|QO?(=I^OivStYH(&*vAXL@Q7c$g8?Mq0TtLl2u{#~8RX!H1zcbRFWA8mrtpO| z+=&2jAR5Gk$Pgc*q;=)^x*}FuS6WxfSF@O}$nDw(wGV0^RDGrTN_G3Zt=qK^I$pQy zJgD=a`V8tbsDGvYmHMLUi>fcGe!KeZy2tsS?s0S;bo@N1dmNnybsp4taITyOm9Lbq zl&_Sp=1RU&zg_uC`AYdp`AYqE_1o2NSHJ!5_S9|m`f9G!SK0?1&sW4szaMn)_k&tjT36Z!XLlb|-LAS_x*yV$k)Din zilkE{{VVBTN&iZ^YSLAcUZ3>(qys4(Na;XIUsU>{(yf(lt@Mzkhb%p0>1_X-I@`Yi Dt1!Aa literal 0 HcmV?d00001 diff --git a/recipes/audiofile/all/test_package/test_package.cpp b/recipes/audiofile/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6943fcec35d57 --- /dev/null +++ b/recipes/audiofile/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#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.printSummary(); + return 0; +} diff --git a/recipes/audiofile/all/test_v1_package/CMakeLists.txt b/recipes/audiofile/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..60fb00c9f3f14 --- /dev/null +++ b/recipes/audiofile/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(audiofile REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE audiofile::audiofile) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/audiofile/all/test_v1_package/conanfile.py b/recipes/audiofile/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..21642db6ce1ba --- /dev/null +++ b/recipes/audiofile/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + wav_path = os.path.join(self.source_folder, os.pardir, "test_package", "sine.wav") + self.run(f"{bin_path} {wav_path}", run_environment=True) diff --git a/recipes/audiofile/config.yml b/recipes/audiofile/config.yml new file mode 100644 index 0000000000000..5fc24e2e9c188 --- /dev/null +++ b/recipes/audiofile/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.0": + folder: all + "1.0.9": + folder: all + "1.0.8": + folder: all diff --git a/recipes/autoconf-archive/all/conandata.yml b/recipes/autoconf-archive/all/conandata.yml new file mode 100644 index 0000000000000..5443eebf3e116 --- /dev/null +++ b/recipes/autoconf-archive/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2021.02.19": + url: "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2021.02.19.tar.xz" + sha256: "e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd" + "2022.09.03": + url: "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2022.09.03.tar.xz" + sha256: "e07454f00d8cae7907bed42d0747798927809947684d94c37207a4d63a32f423" diff --git a/recipes/autoconf-archive/all/conanfile.py b/recipes/autoconf-archive/all/conanfile.py new file mode 100644 index 0000000000000..f3f012f86b927 --- /dev/null +++ b/recipes/autoconf-archive/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.files import get, copy, mkdir, rename, rmdir, export_conandata_patches +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.56.0" + + +class AutoconfArchiveConan(ConanFile): + name = "autoconf-archive" + package_type = "build-scripts" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/autoconf-archive/" + license = "GPL-2.0-or-later" + description = "The GNU Autoconf Archive is a collection of more than 500 macros for GNU Autoconf" + topics = ("conan", "GNU", "autoconf", "autoconf-archive", "macro") + settings = "os" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + mkdir(self, os.path.join(self.package_folder, "res")) + rename(self, os.path.join(self.package_folder, "share", "aclocal"), + os.path.join(self.package_folder, "res", "aclocal")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res/aclocal"] + + # Use ACLOCAL_PATH to access the .m4 files provided with autoconf-archive + aclocal_path = os.path.join(self.package_folder, "res", "aclocal") + self.buildenv_info.append_path("ACLOCAL_PATH", aclocal_path) + + # Remove for Conan 2.0 + aclocal_path = "/" + aclocal_path.replace("\\", "/").replace(":", "") # Can't use unix_path with Conan 2.0 + self.output.info(f'Appending ACLOCAL_PATH env: {aclocal_path}') + self.env_info.ACLOCAL_PATH.append(aclocal_path) + self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment var: {}".format(aclocal_path)) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(aclocal_path) diff --git a/recipes/autoconf-archive/all/test_package/Makefile.am b/recipes/autoconf-archive/all/test_package/Makefile.am new file mode 100644 index 0000000000000..b5165c3af4560 --- /dev/null +++ b/recipes/autoconf-archive/all/test_package/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS = test_package +test_package_sources = test_package.c diff --git a/recipes/autoconf-archive/all/test_package/conanfile.py b/recipes/autoconf-archive/all/test_package/conanfile.py new file mode 100644 index 0000000000000..737285d3778bc --- /dev/null +++ b/recipes/autoconf-archive/all/test_package/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.build import cross_building, can_run +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.layout import basic_layout +import os +import shutil + +required_conan_version = ">=1.56.0" + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "configure.ac", "Makefile.am", "test_package.c" + test_type = "explicit" + generators = "VirtualBuildEnv" # Need VirtualBuildEnv for Conan 1.x env_info support + win_bash = True # This assignment must be *here* to avoid "Cannot wrap command with different envs." in Conan 1.x + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + self.tool_requires("autoconf/2.71") # Needed for autoreconf + self.tool_requires("automake/1.16.5") # Needed for aclocal called by autoreconf--does Coanan 2.0 need a transitive_run trait? + 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 generate(self): + tc = AutotoolsToolchain(self) + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + tc.generate(env) + + def build(self): + if not cross_building(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + self.run("autoreconf -fiv") + autotools = Autotools(self) + autotools.configure(build_script_folder=self.build_folder) + autotools.make() + + def test(self): + if can_run(self): + self.run(unix_path(self, os.path.join(".", "test_package"))) diff --git a/recipes/autoconf-archive/all/test_package/configure.ac b/recipes/autoconf-archive/all/test_package/configure.ac new file mode 100644 index 0000000000000..e74fbe8a4a2dd --- /dev/null +++ b/recipes/autoconf-archive/all/test_package/configure.ac @@ -0,0 +1,15 @@ +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([test_package.c]) +AC_CONFIG_AUX_DIR([autostuff]) +AM_INIT_AUTOMAKE([foreign]) +AC_PROG_CC +m4_pattern_forbid([^AX_], + [Unexpanded AX_ macro found. Please install GNU autoconf-archive.]) +AX_CXX_BOOL() +AX_CXX_HAVE_VECTOR_AT() +AX_CXX_HAVE_BIND() +AX_PRINTF_SIZE_T() +AX_CHECK_AWK_INDEX() +AX_BERKELEY_DB() +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/recipes/autoconf-archive/all/test_package/test_package.c b/recipes/autoconf-archive/all/test_package/test_package.c new file mode 100644 index 0000000000000..88b53a74dc6fb --- /dev/null +++ b/recipes/autoconf-archive/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello world from test_package.c\n"); + return 0; +} diff --git a/recipes/autoconf-archive/all/test_v1_package/Makefile.am b/recipes/autoconf-archive/all/test_v1_package/Makefile.am new file mode 100644 index 0000000000000..b5165c3af4560 --- /dev/null +++ b/recipes/autoconf-archive/all/test_v1_package/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS = test_package +test_package_sources = test_package.c diff --git a/recipes/autoconf-archive/all/test_v1_package/conanfile.py b/recipes/autoconf-archive/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..99631c75c0149 --- /dev/null +++ b/recipes/autoconf-archive/all/test_v1_package/conanfile.py @@ -0,0 +1,52 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import contextlib +import os +import shutil + +required_conan_version = ">=1.56.0" + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "configure.ac", "Makefile.am", "test_package.c" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + self.build_requires("automake/1.16.5") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextlib.contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + env = { + "CC": "cl -nologo", + "CXX": "cl -nologo", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + # Work around the fact that "used_special_vars" in conans/client/tools/win.py doesn't handle ACLOCAL_PATH + aclocal_path = "$ACLOCAL_PATH:" + self.deps_env_info.vars["ACLOCAL_PATH"][0].lower() + self.run("ACLOCAL_PATH={} autoreconf -fiv".format(aclocal_path), win_bash=self._settings_build.os == "Windows") + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") + autotools.libs = [] + autotools.configure() + autotools.make() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package")) diff --git a/recipes/autoconf-archive/all/test_v1_package/configure.ac b/recipes/autoconf-archive/all/test_v1_package/configure.ac new file mode 100644 index 0000000000000..e74fbe8a4a2dd --- /dev/null +++ b/recipes/autoconf-archive/all/test_v1_package/configure.ac @@ -0,0 +1,15 @@ +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([test_package.c]) +AC_CONFIG_AUX_DIR([autostuff]) +AM_INIT_AUTOMAKE([foreign]) +AC_PROG_CC +m4_pattern_forbid([^AX_], + [Unexpanded AX_ macro found. Please install GNU autoconf-archive.]) +AX_CXX_BOOL() +AX_CXX_HAVE_VECTOR_AT() +AX_CXX_HAVE_BIND() +AX_PRINTF_SIZE_T() +AX_CHECK_AWK_INDEX() +AX_BERKELEY_DB() +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/recipes/autoconf-archive/all/test_v1_package/test_package.c b/recipes/autoconf-archive/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..88b53a74dc6fb --- /dev/null +++ b/recipes/autoconf-archive/all/test_v1_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello world from test_package.c\n"); + return 0; +} diff --git a/recipes/autoconf-archive/config.yml b/recipes/autoconf-archive/config.yml new file mode 100644 index 0000000000000..d6031b4a79015 --- /dev/null +++ b/recipes/autoconf-archive/config.yml @@ -0,0 +1,5 @@ +versions: + "2021.02.19": + folder: all + "2022.09.03": + folder: all diff --git a/recipes/autoconf/all/conandata.yml b/recipes/autoconf/all/conandata.yml new file mode 100644 index 0000000000000..aefee4cae6132 --- /dev/null +++ b/recipes/autoconf/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "2.71": + sha256: "431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c" + url: "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz" +patches: + "2.71": + - patch_file: "patches/2.71-0001-relocatable-autoconf.patch" + patch_description: "Replace instances where absolute paths are embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.71-0002-no-perl-path-in-shebang.patch" + patch_description: "Avoid build machine's perl path to be embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.71-0003-disable-man-regeneration.patch" + patch_description: "Disable man regeneration" + patch_type: "conan" diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py new file mode 100644 index 0000000000000..09afbd7d337d1 --- /dev/null +++ b/recipes/autoconf/all/conanfile.py @@ -0,0 +1,139 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir, apply_conandata_patches, replace_in_file, export_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class AutoconfConan(ConanFile): + name = "autoconf" + package_type = "application" + description = ( + "Autoconf is an extensible package of M4 macros that produce shell " + "scripts to automatically configure software source code packages" + ) + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/autoconf/" + topics = ("autoconf", "configure", "build") + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + # TODO: Remove for Conan v2 + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def requirements(self): + self.requires("m4/1.4.19") # Needed at runtime by downstream clients as well + + def build_requirements(self): + self.tool_requires("m4/1.4.19") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + ]) + + if self.settings.os == "Windows": + if is_msvc(self): + build = "{}-{}-{}".format( + "x86_64" if self._settings_build.arch == "x86_64" else "i686", + "pc" if self._settings_build.arch == "x86" else "win64", + "mingw32") + host = "{}-{}-{}".format( + "x86_64" if self.settings.arch == "x86_64" else "i686", + "pc" if self.settings.arch == "x86" else "win64", + "mingw32") + tc.configure_args.append(f"--build={build}") + tc.configure_args.append(f"--host={host}") + + env = tc.environment() + env.define_path("INSTALL", unix_path(self, os.path.join(self.source_folder, "build-aux", "install-sh"))) + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), + "M4 = /usr/bin/env m4", "#M4 = /usr/bin/env m4") + if self._settings_build.os == "Windows": + # Handle vagaries of Windows line endings + replace_in_file(self, os.path.join(self.source_folder, "bin", "autom4te.in"), + "$result =~ s/^\\n//mg;", "$result =~ s/^\\R//mg;") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "res", "info")) + rmdir(self, os.path.join(self.package_folder, "res", "man")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.resdirs = ["res"] + + # TODO: These variables can be removed since the scripts now locate the resources + # relative to themselves. + dataroot_path = os.path.join(self.package_folder, "res", "autoconf") + self.output.info(f"Defining AC_MACRODIR environment variable: {dataroot_path}") + self.buildenv_info.define_path("AC_MACRODIR", dataroot_path) + + self.output.info(f"Defining autom4te_perllibdir environment variable: {dataroot_path}") + self.buildenv_info.define_path("autom4te_perllibdir", dataroot_path) + + bin_path = os.path.join(self.package_folder, "bin") + + autoconf_bin = os.path.join(bin_path, "autoconf") + self.output.info(f"Defining AUTOCONF environment variable: {autoconf_bin}") + self.buildenv_info.define_path("AUTOCONF", autoconf_bin) + + autoreconf_bin = os.path.join(bin_path, "autoreconf") + self.output.info(f"Defining AUTORECONF environment variable: {autoreconf_bin}") + self.buildenv_info.define_path("AUTORECONF", autoreconf_bin) + + autoheader_bin = os.path.join(bin_path, "autoheader") + self.output.info(f"Defining AUTOHEADER environment variable: {autoheader_bin}") + self.buildenv_info.define_path("AUTOHEADER", autoheader_bin) + + autom4te_bin = os.path.join(bin_path, "autom4te") + self.output.info(f"Defining AUTOM4TE environment variable: {autom4te_bin}") + self.buildenv_info.define_path("AUTOM4TE", autom4te_bin) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(bin_path) + self.env_info.AUTOCONF = "autoconf" + self.env_info.AUTORECONF = "autoreconf" + self.env_info.AUTOHEADER = "autoheader" + self.env_info.AUTOM4TE = "autom4te" diff --git a/recipes/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch b/recipes/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch new file mode 100644 index 0000000000000..ab33a00f77cb7 --- /dev/null +++ b/recipes/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch @@ -0,0 +1,275 @@ +diff --git a/Makefile.in b/Makefile.in +index 22a17b3..ac18c85 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -427,7 +427,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LTLIBOBJS = @LTLIBOBJS@ +-M4 = @M4@ ++M4 = /usr/bin/env m4 + M4_DEBUGFILE = @M4_DEBUGFILE@ + M4_GNU = @M4_GNU@ + MAKEINFO = @MAKEINFO@ +diff --git a/bin/autoconf.as b/bin/autoconf.as +index 1407739..50ad1de 100644 +--- a/bin/autoconf.as ++++ b/bin/autoconf.as +@@ -89,8 +89,17 @@ exit_missing_arg=' + # restore font-lock: ' + + # Variables. +-: ${AUTOM4TE='@bindir@/@autom4te-name@'} +-: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'} ++# Locate autom4ate and support files relative to current script inside package ++SCRIPT_DIR=$(dirname "$as_myself") ++RES_DIR="$SCRIPT_DIR/../res/autoconf" ++if [[ ! -d "$RES_DIR" ]] ++then ++ echo "Autoconf conan package error, unable to locate resource directory at $RES_DIR\n" ++ exit 1 ++fi ++ ++: ${AUTOM4TE="$SCRIPT_DIR/autom4te"} ++: ${trailer_m4="$RES_DIR/autoconf/trailer.m4"} + autom4te_options= + outfile= + verbose=false +diff --git a/bin/autoheader.in b/bin/autoheader.in +index 1cbf509..9bdd1cf 100644 +--- a/bin/autoheader.in ++++ b/bin/autoheader.in +@@ -29,10 +29,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, "$pkgdatadir"; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -54,7 +57,8 @@ use Autom4te::XFile; + our ($config_h, %symbol, %verbatim); + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $config_h_in; + my @prepend_include; + my @include; +diff --git a/bin/autom4te.in b/bin/autom4te.in +index 7ebe419..42f09b4 100644 +--- a/bin/autom4te.in ++++ b/bin/autom4te.in +@@ -25,10 +25,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -48,7 +51,8 @@ use Autom4te::General; + use Autom4te::XFile; + + # Data directory. +-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $pkgdatadir = $ENV{'AC_MACRODIR'} || "$scriptpath/../res/autoconf"; + + # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE. + my %language; +@@ -91,7 +95,7 @@ my @include; + my $freeze = 0; + + # $M4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + # Some non-GNU m4's don't reject the --help option, so give them /dev/null. + fatal "need GNU m4 1.4 or later: $m4" + if system "$m4 --help &1 | grep reload-state >/dev/null"; +@@ -271,6 +275,12 @@ sub load_configuration ($) + if /^\s*(\#.*)?$/; + + my @words = shellwords ($_); ++ # not using: s#AUTOCONF_M4DIR#$pkgdatadir#r to support perl <5.14 ++ my @words_clone = @words; ++ @words = (); ++ foreach ( @words_clone ) { ++ push(@words, do { (my $tmp = $_) =~ s#AUTOCONF_M4DIR#$pkgdatadir#; $tmp }); ++ } + my $type = shift @words; + if ($type eq 'begin-language:') + { +diff --git a/bin/autoreconf.in b/bin/autoreconf.in +index ec391a6..2992b16 100644 +--- a/bin/autoreconf.in ++++ b/bin/autoreconf.in +@@ -28,11 +28,14 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + my $buildauxdir; + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux'; +@@ -117,9 +120,10 @@ Written by David J. MacKenzie and Akim Demaille. + "; + + # Lib files. +-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@'; +-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@'; +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autoconf = $ENV{'AUTOCONF'} || "$scriptpath/@autoconf-name@"; ++my $autoheader = $ENV{'AUTOHEADER'} || "$scriptpath/@autoheader-name@"; ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $automake = $ENV{'AUTOMAKE'} || 'automake'; + my $aclocal = $ENV{'ACLOCAL'} || 'aclocal'; + my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize'; +diff --git a/bin/autoscan.in b/bin/autoscan.in +index b89fd1a..6113d62 100644 +--- a/bin/autoscan.in ++++ b/bin/autoscan.in +@@ -27,10 +27,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -95,7 +98,8 @@ my %needed_macros = + my $log; + + # Autoconf and lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + my @prepend_include; + my @include = ('@pkgdatadir@'); +diff --git a/bin/autoupdate.in b/bin/autoupdate.in +index c86203a..844dd20 100644 +--- a/bin/autoupdate.in ++++ b/bin/autoupdate.in +@@ -28,10 +28,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -51,14 +54,15 @@ use Autom4te::General; + use Autom4te::XFile; + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + # We need to find m4sugar. + my @prepend_include; + my @include = ('@pkgdatadir@'); + my $force = 0; + # m4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + + + # $HELP +diff --git a/bin/ifnames.in b/bin/ifnames.in +index b04947f..75d014e 100644 +--- a/bin/ifnames.in ++++ b/bin/ifnames.in +@@ -32,10 +32,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +diff --git a/lib/autom4te.in b/lib/autom4te.in +index 9e86c9f..bf3ae42 100644 +--- a/lib/autom4te.in ++++ b/lib/autom4te.in +@@ -115,7 +115,7 @@ end-language: "Autoreconf-preselections" + # This intermediate language is used by aclocal to build aclocal.m4. + + begin-language: "Autoconf-without-aclocal-m4" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: --cache=autom4te.cache + args: autoconf/autoconf.m4f + args: acsite.m4? +@@ -142,7 +142,7 @@ end-language: "Autoconf" + ## -------- ## + + begin-language: "Autotest" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: autotest/autotest.m4f + args: package.m4? + args: local.at? +@@ -156,7 +156,7 @@ end-language: "Autotest" + ## ---- ## + + begin-language: "M4sh" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sh.m4f + args: --mode 777 + args: --language M4sugar +@@ -168,6 +168,6 @@ end-language: "M4sh" + ## ------- ## + + begin-language: "M4sugar" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sugar.m4f + end-language: "M4sugar" diff --git a/recipes/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch b/recipes/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch new file mode 100644 index 0000000000000..6fcfe26cf5cd0 --- /dev/null +++ b/recipes/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch @@ -0,0 +1,48 @@ +--- bin/autoheader.in ++++ bin/autoheader.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- Perl -*- + # @configure_input@ + +--- bin/autom4te.in ++++ bin/autom4te.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/autoreconf.in ++++ bin/autoreconf.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/autoscan.in ++++ bin/autoscan.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/autoupdate.in ++++ bin/autoupdate.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/ifnames.in ++++ bin/ifnames.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + diff --git a/recipes/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch b/recipes/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch new file mode 100644 index 0000000000000..1e29ca14e52a1 --- /dev/null +++ b/recipes/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch @@ -0,0 +1,23 @@ +--- Makefile.in ++++ Makefile.in +@@ -2202,13 +2203,13 @@ + + .PHONY: install-data-hook install-data-hook-make-aux-scripts-executable + +-man/autoconf.1: $(common_dep) man/autoconf.w man/autoconf.x $(binsrcdir)/autoconf.as +-man/autoheader.1: $(common_dep) man/autoheader.w man/autoheader.x $(binsrcdir)/autoheader.in +-man/autom4te.1: $(common_dep) man/autom4te.w man/autom4te.x $(binsrcdir)/autom4te.in +-man/autoreconf.1: $(common_dep) man/autoreconf.w man/autoreconf.x $(binsrcdir)/autoreconf.in +-man/autoscan.1: $(common_dep) man/autoscan.w man/autoscan.x $(binsrcdir)/autoscan.in +-man/autoupdate.1: $(common_dep) man/autoupdate.w man/autoupdate.x $(binsrcdir)/autoupdate.in +-man/ifnames.1: $(common_dep) man/ifnames.w man/ifnames.x $(binsrcdir)/ifnames.in ++#man/autoconf.1: $(common_dep) man/autoconf.w man/autoconf.x $(binsrcdir)/autoconf.as ++#man/autoheader.1: $(common_dep) man/autoheader.w man/autoheader.x $(binsrcdir)/autoheader.in ++#man/autom4te.1: $(common_dep) man/autom4te.w man/autom4te.x $(binsrcdir)/autom4te.in ++#man/autoreconf.1: $(common_dep) man/autoreconf.w man/autoreconf.x $(binsrcdir)/autoreconf.in ++#man/autoscan.1: $(common_dep) man/autoscan.w man/autoscan.x $(binsrcdir)/autoscan.in ++#man/autoupdate.1: $(common_dep) man/autoupdate.w man/autoupdate.x $(binsrcdir)/autoupdate.in ++#man/ifnames.1: $(common_dep) man/ifnames.w man/ifnames.x $(binsrcdir)/ifnames.in + + .w.1: + @echo "Updating man page $@" diff --git a/recipes/autoconf/all/test_package/Makefile.in b/recipes/autoconf/all/test_package/Makefile.in new file mode 100644 index 0000000000000..193ade8719dfc --- /dev/null +++ b/recipes/autoconf/all/test_package/Makefile.in @@ -0,0 +1,14 @@ +# @configure_input@ + +SRCS = test_package_c.c test_package_cpp.cpp + +OBJS := $(patsubst %.c,%.@OBJEXT@,$(patsubst %.cpp,%.@OBJEXT@,$(SRCS))) + +test_package@EXEEXT@: $(OBJS) + @CXX@ @CXXFLAGS@ @LDFLAGS@ $^ -o $@ + +%.@OBJEXT@: %.cpp + @CXX@ @CXXFLAGS@ @CPPFLAGS@ -c $< @CC_MINUS_O@ $@ + +%.@OBJEXT@: %.c + @CC@ @CFLAGS@ @CPPFLAGS@ -c $< @CC_MINUS_O@ $@ diff --git a/recipes/autoconf/all/test_package/conanfile.py b/recipes/autoconf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bb22349ed9696 --- /dev/null +++ b/recipes/autoconf/all/test_package/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.vars(self).save_script("conanbuild_msvc") + + def build(self): + for src in ("configure.ac", "config.h.in", "Makefile.in", "test_package_c.c", "test_package_cpp.cpp"): + copy(self, src, self.source_folder, self.build_folder) + self.run("autoconf --verbose") + autotools = Autotools(self) + autotools.configure(build_script_folder=self.build_folder) + autotools.make() + + def test(self): + self.win_bash = None + if can_run(self): + bin_path = os.path.join(self.build_folder, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/autoconf/all/test_package/config.h.in b/recipes/autoconf/all/test_package/config.h.in new file mode 100644 index 0000000000000..93f81d1535769 --- /dev/null +++ b/recipes/autoconf/all/test_package/config.h.in @@ -0,0 +1,23 @@ +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/recipes/autoconf/all/test_package/configure.ac b/recipes/autoconf/all/test_package/configure.ac new file mode 100644 index 0000000000000..ae0a54a83b39b --- /dev/null +++ b/recipes/autoconf/all/test_package/configure.ac @@ -0,0 +1,25 @@ +# Must init the autoconf setup +# The first parameter is project name +# second is version number +# third is bug report address +AC_INIT([test_package], [1.0]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package_c.c]) + +# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) +# in this dir (build-aux) + +AC_CONFIG_FILES(Makefile) +AC_CONFIG_HEADER([config.h]) + +AC_PROG_CC +AC_PROG_CXX + +AC_PROG_CC_C_O + +AC_MSG_NOTICE("ac_cv_prog_cc_${ac_cc} is $ac_cv_prog_cc_${ac_cc}") +AS_IF([eval test \$ac_cv_prog_cc_${ac_cc}_c_o = "yes"], + [AC_SUBST([CC_MINUS_O], ["-o"])],[AC_SUBST([CC_MINUS_O], [""])]) + +AC_OUTPUT diff --git a/recipes/autoconf/all/test_package/test_package_c.c b/recipes/autoconf/all/test_package/test_package_c.c new file mode 100644 index 0000000000000..cd3baf25057d7 --- /dev/null +++ b/recipes/autoconf/all/test_package/test_package_c.c @@ -0,0 +1,8 @@ +#include "config.h" + +#include + +int hello_from_c(void) { + printf("Hello world (" PACKAGE_NAME ") from c!\n"); + return 0; +} diff --git a/recipes/autoconf/all/test_package/test_package_cpp.cpp b/recipes/autoconf/all/test_package/test_package_cpp.cpp new file mode 100644 index 0000000000000..e31a5ee3cfefa --- /dev/null +++ b/recipes/autoconf/all/test_package/test_package_cpp.cpp @@ -0,0 +1,17 @@ +#include "config.h" + +#include + +extern "C" { + int hello_from_c(void); +} + +void hello_from_cxx() { + std::cout << "Hello world (" PACKAGE_NAME ") from c++!\n"; +} + +int main(int argc, char** argv) { + hello_from_cxx(); + hello_from_c(); + return 0; +} diff --git a/recipes/autoconf/all/test_v1_package/conanfile.py b/recipes/autoconf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..422d5f44c10cf --- /dev/null +++ b/recipes/autoconf/all/test_v1_package/conanfile.py @@ -0,0 +1,43 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan.tools.files import copy +from conan.tools.microsoft import is_msvc +import contextlib +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextlib.contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + yield + else: + yield + + def build(self): + for src in ("configure.ac", "config.h.in", "Makefile.in", "test_package_c.c", "test_package_cpp.cpp"): + copy(self, src, os.path.join(self.source_folder, os.pardir, "test_package"), self.build_folder) + self.run("autoconf --verbose", win_bash=tools.os_info.is_windows) + self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), + win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools.configure() + autotools.make() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/autoconf/config.yml b/recipes/autoconf/config.yml new file mode 100644 index 0000000000000..f45dc3e529288 --- /dev/null +++ b/recipes/autoconf/config.yml @@ -0,0 +1,3 @@ +versions: + "2.71": + folder: all diff --git a/recipes/automake/all/conandata.yml b/recipes/automake/all/conandata.yml new file mode 100644 index 0000000000000..19afbb0666855 --- /dev/null +++ b/recipes/automake/all/conandata.yml @@ -0,0 +1,54 @@ +sources: + "1.16.5": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.gz" + sha256: "07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605" + "1.16.4": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.4.tar.gz" + sha256: "8a0f0be7aaae2efa3a68482af28e5872d8830b9813a6a932a2571eac63ca1794" + "1.16.3": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.3.tar.gz" + sha256: "ce010788b51f64511a1e9bb2a1ec626037c6d0e7ede32c1c103611b9d3cba65f" + "1.16.2": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz" + sha256: "b2f361094b410b4acbf4efba7337bdb786335ca09eb2518635a09fb7319ca5c1" +patches: + "1.16.5": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.5.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.5.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.5.patch" + patch_description: "relocatable automake" + patch_type: "portability" + "1.16.4": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.4.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.4.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.4.patch" + patch_description: "relocatable automake" + patch_type: "portability" + "1.16.3": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.3.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.3.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.3.patch" + patch_description: "relocatable automake" + patch_type: "portability" + "1.16.2": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.2.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.2.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.2.patch" + patch_description: "relocatable automake" + patch_type: "portability" diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py new file mode 100644 index 0000000000000..c5504ce85bf9a --- /dev/null +++ b/recipes/automake/all/conanfile.py @@ -0,0 +1,128 @@ +import os + +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class AutomakeConan(ConanFile): + name = "automake" + package_type = "application" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/automake/" + description = "Automake is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards." + topics = ("autotools", "configure", "build") + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("autoconf/2.71") + # automake requires perl-Thread-Queue package + + def package_id(self): + del self.info.settings.arch + del self.info.settings.compiler + del self.info.settings.build_type + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.tool_requires("autoconf/2.71") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + ]) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.settings.os == "Windows": + # tracing using m4 on Windows returns Windows paths => use cygpath to convert to unix paths + ac_local_in = os.path.join(self.source_folder, "bin", "aclocal.in") + replace_in_file(self, ac_local_in, + " $map_traced_defs{$arg1} = $file;", + " $file = `cygpath -u $file`;\n" + " $file =~ s/^\\s+|\\s+$//g;\n" + " $map_traced_defs{$arg1} = $file;") + # handle relative paths during aclocal.m4 creation + replace_in_file(self, ac_local_in, "$map{$m} eq $map_traced_defs{$m}", + "abs_path($map{$m}) eq abs_path($map_traced_defs{$m})") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + + def package(self): + autotools = Autotools(self) + autotools.install() + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder,"licenses")) + + rmdir(self, os.path.join(self._datarootdir, "info")) + rmdir(self, os.path.join(self._datarootdir, "man")) + rmdir(self, os.path.join(self._datarootdir, "doc")) + + # TODO: consider whether the following is still necessary on Windows + if self.settings.os == "Windows": + binpath = os.path.join(self.package_folder, "bin") + for filename in os.listdir(binpath): + fullpath = os.path.join(binpath, filename) + if not os.path.isfile(fullpath): + continue + os.rename(fullpath, fullpath + ".exe") + + @property + def _automake_libdir(self): + ver = Version(self.version) + return os.path.join(self._datarootdir, f"automake-{ver.major}.{ver.minor}") + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.resdirs = ["res"] + + # For consumers with new integrations (Conan 1 and 2 compatible): + compile_wrapper = os.path.join(self._automake_libdir, "compile") + lib_wrapper = os.path.join(self._automake_libdir, "ar-lib") + self.conf_info.define("user.automake:compile-wrapper", compile_wrapper) + self.conf_info.define("user.automake:lib-wrapper", lib_wrapper) + + # For legacy Conan 1.x consumers only: + self.user_info.compile = compile_wrapper + self.user_info.ar_lib = lib_wrapper + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch new file mode 100644 index 0000000000000..8caedb331444e --- /dev/null +++ b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 670f97a..feb1085 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -699,7 +699,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + amhello_sources = \ + doc/amhello/configure.ac \ diff --git a/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch new file mode 100644 index 0000000000000..e6fc1e37c7a20 --- /dev/null +++ b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 3190a66..c599705 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -711,7 +711,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + checklinkx = $(top_srcdir)/contrib/checklinkx + # that 4-second sleep seems to be what gnu.org likes. diff --git a/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch new file mode 100644 index 0000000000000..aec1e1e992850 --- /dev/null +++ b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index bbe2d04..3a0f57e 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -703,7 +703,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + checklinkx = $(top_srcdir)/contrib/checklinkx + # that 4-second sleep seems to be what gnu.org likes. diff --git a/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch new file mode 100644 index 0000000000000..c593ef11dafd1 --- /dev/null +++ b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 18850e7..ae75282 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -703,7 +703,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + checklinkx = $(top_srcdir)/contrib/checklinkx + # that 4-second sleep seems to be what gnu.org likes. diff --git a/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch new file mode 100644 index 0000000000000..62935414ace95 --- /dev/null +++ b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index feb1085..5d2f5cc 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -524,7 +524,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index 9a20325..0a4eac4 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2020 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index 212cb38..cb077a7 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2020 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index dff88b7..20b012f 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch new file mode 100644 index 0000000000000..1a24e6d5d93a7 --- /dev/null +++ b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index c599705..8c18ed2 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -535,7 +535,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index ca2f963..8782f24 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2020 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index 31c7238..e41b1f5 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2020 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index dff88b7..20b012f 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch new file mode 100644 index 0000000000000..e4e77c4731fc5 --- /dev/null +++ b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index 3a0f57e..4bdcf55 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -527,7 +527,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index f112447..a63ce4d 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2021 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index f04f5d5..4502558 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2021 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index c404b0e..381d965 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch new file mode 100644 index 0000000000000..aa3b831101596 --- /dev/null +++ b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index ae75282..55844e7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -527,7 +527,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index f112447..a63ce4d 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2021 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index 30babd6..d499bfd 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2021 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index c404b0e..381d965 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/recipes/automake/all/patches/0003-relocatable-automake-1.16.2.patch b/recipes/automake/all/patches/0003-relocatable-automake-1.16.2.patch new file mode 100644 index 0000000000000..c7d66e2f6959b --- /dev/null +++ b/recipes/automake/all/patches/0003-relocatable-automake-1.16.2.patch @@ -0,0 +1,106 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index 0a4eac4..487b93d 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -18,10 +18,13 @@ + + # Written by Tom Tromey , and + # Alexandre Duret-Lutz . ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -61,9 +64,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -445,6 +455,7 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -767,7 +778,7 @@ sub trace_used_macros () + # to silence m4_require warnings". + my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])"; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + $traces = "echo '$early_m4_code' | $traces - "; + +diff --git a/bin/automake.in b/bin/automake.in +index cb077a7..676593c 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -23,10 +23,13 @@ + package Automake; + + use strict; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5243,7 +5246,7 @@ sub scan_autoconf_traces + sinclude => 1, + ); + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index f79b8cd..ed78dd2 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ use strict; + + use 5.006; + require Exporter; ++use Cwd 'abs_path'; ++use File::Basename; + + our @ISA = qw (Exporter); + our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION +@@ -32,7 +34,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/recipes/automake/all/patches/0003-relocatable-automake-1.16.3.patch b/recipes/automake/all/patches/0003-relocatable-automake-1.16.3.patch new file mode 100644 index 0000000000000..2c34ed4d6edbe --- /dev/null +++ b/recipes/automake/all/patches/0003-relocatable-automake-1.16.3.patch @@ -0,0 +1,106 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index 8782f24..263ebc2 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -22,10 +22,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -64,9 +67,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -448,6 +458,7 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -768,7 +779,7 @@ sub trace_used_macros () + # aclocal.m4 is not yet available. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + + # Support AC_CONFIG_MACRO_DIRS also with older autoconf. +diff --git a/bin/automake.in b/bin/automake.in +index e41b1f5..233a6a3 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -25,10 +25,13 @@ package Automake; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5254,7 +5257,7 @@ sub scan_autoconf_traces + # and will see its warnings then. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index d44e0ab..fba2b81 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ package Automake::Config; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + use Exporter; + +@@ -34,7 +36,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/recipes/automake/all/patches/0003-relocatable-automake-1.16.4.patch b/recipes/automake/all/patches/0003-relocatable-automake-1.16.4.patch new file mode 100644 index 0000000000000..011c7ddfdc8db --- /dev/null +++ b/recipes/automake/all/patches/0003-relocatable-automake-1.16.4.patch @@ -0,0 +1,106 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index a63ce4d..e82d65b 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -22,10 +22,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -64,9 +67,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -448,6 +458,7 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -768,7 +779,7 @@ sub trace_used_macros () + # aclocal.m4 is not yet available. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + + # Support AC_CONFIG_MACRO_DIRS also with older autoconf. +diff --git a/bin/automake.in b/bin/automake.in +index 4502558..6506946 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -25,10 +25,13 @@ package Automake; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5280,7 +5283,7 @@ sub scan_autoconf_traces + # and will see its warnings then. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index d529f1b..ca98604 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ package Automake::Config; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + use Exporter; + +@@ -34,7 +36,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/recipes/automake/all/patches/0003-relocatable-automake-1.16.5.patch b/recipes/automake/all/patches/0003-relocatable-automake-1.16.5.patch new file mode 100644 index 0000000000000..56b752f9a116a --- /dev/null +++ b/recipes/automake/all/patches/0003-relocatable-automake-1.16.5.patch @@ -0,0 +1,107 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index a63ce4d..6224832 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -22,10 +22,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -64,9 +67,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -448,6 +458,8 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); ++ + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -768,7 +780,7 @@ sub trace_used_macros () + # aclocal.m4 is not yet available. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + + # Support AC_CONFIG_MACRO_DIRS also with older autoconf. +diff --git a/bin/automake.in b/bin/automake.in +index d499bfd..d4081c9 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -25,10 +25,13 @@ package Automake; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5280,7 +5283,7 @@ sub scan_autoconf_traces + # and will see its warnings then. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index d529f1b..ca98604 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ package Automake::Config; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + use Exporter; + +@@ -34,7 +36,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/recipes/automake/all/test_package/Makefile.am b/recipes/automake/all/test_package/Makefile.am new file mode 100644 index 0000000000000..655db7f1876cb --- /dev/null +++ b/recipes/automake/all/test_package/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a8b0427416846 --- /dev/null +++ b/recipes/automake/all/test_package/conanfile.py @@ -0,0 +1,95 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path + + +required_conan_version = ">=1.53.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + win_bash = True + + _default_cc = { + "gcc": "gcc", + "clang": "clang", + "Visual Studio": "cl -nologo", + "msvc": "cl -nologo", + "apple-clang": "clang", + } + + def _system_compiler(self, cxx=False): + system_cc = self._default_cc.get(str(self.settings.compiler)) + if system_cc and cxx: + if self.settings.compiler == "gcc": + system_cc = "g++" + elif "clang" in self.settings.compiler: + system_cc = "clang++" + return system_cc + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get( + "tools.microsoft.bash:path", check_type=str + ): + self.build_requires("msys2/cci.latest") + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + env = VirtualBuildEnv(self) + env.generate() + + env = Environment() + + compile_script = unix_path(self, + self.dependencies.build["automake"].conf_info.get("user.automake:compile-wrapper")) + + # define CC and CXX such that if the user hasn't already defined it + # via `tools.build:compiler_executables` or buildenv variables, + # we tell autotools to guess the name matching the current setting + # (otherwise it falls back to finding gcc first) + cc = self._system_compiler() + cxx = self._system_compiler(cxx=True) + if cc and cxx: + # Using shell parameter expansion + env.define("CC", f"${{CC-{cc}}}") + env.define("CXX", f"${{CXX-{cxx}}}") + + env.define("COMPILE", compile_script) + env.define("ACLOCAL_PATH", unix_path(self, os.path.join(self.source_folder))) + env.vars(self, scope="build").save_script("automake_build_test") + + def build(self): + # Test compilation through compile wrapper script + compiler = self._system_compiler() + source_file = unix_path(self, os.path.join(self.source_folder, "test_package_1.c")) + with chdir(self, self.build_folder): + self.run(f"$COMPILE {compiler} {source_file} -o script_test", env="conanbuild") + + # Build test project + autotools = Autotools(self) + autotools.autoreconf(args=['--debug']) + autotools.configure() + autotools.make() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run("./script_test") + self.run("./test_package") diff --git a/recipes/automake/all/test_package/configure.ac b/recipes/automake/all/test_package/configure.ac new file mode 100644 index 0000000000000..8a7ae1dc34e7f --- /dev/null +++ b/recipes/automake/all/test_package/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/recipes/automake/all/test_package/extra.m4 b/recipes/automake/all/test_package/extra.m4 new file mode 100644 index 0000000000000..69c85f5ac945d --- /dev/null +++ b/recipes/automake/all/test_package/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/recipes/automake/all/test_package/src/Makefile.am b/recipes/automake/all/test_package/src/Makefile.am new file mode 100644 index 0000000000000..655db7f1876cb --- /dev/null +++ b/recipes/automake/all/test_package/src/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_package/src/configure.ac b/recipes/automake/all/test_package/src/configure.ac new file mode 100644 index 0000000000000..8a7ae1dc34e7f --- /dev/null +++ b/recipes/automake/all/test_package/src/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/recipes/automake/all/test_package/src/extra.m4 b/recipes/automake/all/test_package/src/extra.m4 new file mode 100644 index 0000000000000..69c85f5ac945d --- /dev/null +++ b/recipes/automake/all/test_package/src/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/recipes/automake/all/test_package/src/test_package.cpp b/recipes/automake/all/test_package/src/test_package.cpp new file mode 100644 index 0000000000000..cd8c2f27c3587 --- /dev/null +++ b/recipes/automake/all/test_package/src/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main(int argc, char** argv) { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_package/src/test_package_1.c b/recipes/automake/all/test_package/src/test_package_1.c new file mode 100644 index 0000000000000..9aaff6c18e30d --- /dev/null +++ b/recipes/automake/all/test_package/src/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_package/test_package.cpp b/recipes/automake/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cd8c2f27c3587 --- /dev/null +++ b/recipes/automake/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main(int argc, char** argv) { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_package/test_package_1.c b/recipes/automake/all/test_package/test_package_1.c new file mode 100644 index 0000000000000..9aaff6c18e30d --- /dev/null +++ b/recipes/automake/all/test_package/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_v1_package/Makefile.am b/recipes/automake/all/test_v1_package/Makefile.am new file mode 100644 index 0000000000000..655db7f1876cb --- /dev/null +++ b/recipes/automake/all/test_v1_package/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_v1_package/conanfile.py b/recipes/automake/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8362800620a5a --- /dev/null +++ b/recipes/automake/all/test_v1_package/conanfile.py @@ -0,0 +1,89 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan.tools.microsoft import is_msvc +from contextlib import contextmanager +import os +import shutil + +required_conan_version = ">=1.45.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" + # DON'T COPY extra.m4 TO BUILD FOLDER!!! + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + yield + else: + yield + + _default_cc = { + "gcc": "gcc", + "clang": "clang", + "Visual Studio": "cl -nologo", + "apple-clang": "clang", + } + + @property + def _system_cc(self): + system_cc = os.environ.get("CC", None) + if not system_cc: + system_cc = self._default_cc.get(str(self.settings.compiler)) + return system_cc + + @property + def _user_info(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def _build_scripts(self): + """Test compile script of automake""" + compile_script = self._user_info["automake"].compile + ar_script = self._user_info["automake"].ar_lib + assert os.path.isfile(ar_script) + assert os.path.isfile(compile_script) + + if self._system_cc: + with tools.vcvars(self) if is_msvc(self) else tools.no_op(): + self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) + + def _build_autotools(self): + """Test autoreconf + configure + make""" + with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): + self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) + self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools.configure() + autotools.make() + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + self._build_scripts() + self._build_autotools() + + def test(self): + if self._system_cc: + if not tools.cross_building(self): + self.run(os.path.join(".", "script_test"), run_environment=True) + + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/automake/all/test_v1_package/configure.ac b/recipes/automake/all/test_v1_package/configure.ac new file mode 100644 index 0000000000000..8a7ae1dc34e7f --- /dev/null +++ b/recipes/automake/all/test_v1_package/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/recipes/automake/all/test_v1_package/extra.m4 b/recipes/automake/all/test_v1_package/extra.m4 new file mode 100644 index 0000000000000..69c85f5ac945d --- /dev/null +++ b/recipes/automake/all/test_v1_package/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/recipes/automake/all/test_v1_package/test_package.cpp b/recipes/automake/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..cd8c2f27c3587 --- /dev/null +++ b/recipes/automake/all/test_v1_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main(int argc, char** argv) { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_v1_package/test_package_1.c b/recipes/automake/all/test_v1_package/test_package_1.c new file mode 100644 index 0000000000000..9aaff6c18e30d --- /dev/null +++ b/recipes/automake/all/test_v1_package/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/automake/config.yml b/recipes/automake/config.yml new file mode 100644 index 0000000000000..020d6b55dbfab --- /dev/null +++ b/recipes/automake/config.yml @@ -0,0 +1,9 @@ +versions: + "1.16.5": + folder: all + "1.16.4": + folder: all + "1.16.3": + folder: all + "1.16.2": + folder: all diff --git a/recipes/avahi/all/conandata.yml b/recipes/avahi/all/conandata.yml new file mode 100644 index 0000000000000..49b6c0881959d --- /dev/null +++ b/recipes/avahi/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8": + url: "https://github.com/lathiat/avahi/releases/download/v0.8/avahi-0.8.tar.gz" + sha256: "060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda" diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py new file mode 100644 index 0000000000000..14386077db5e2 --- /dev/null +++ b/recipes/avahi/all/conanfile.py @@ -0,0 +1,130 @@ +import os + +from conan import ConanFile +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + + +class AvahiConan(ConanFile): + name = "avahi" + # --enable-compat-libdns_sd means that this recipe provides the mdnsresponder compile interface + provides = "mdnsresponder" + description = "Avahi - Service Discovery for Linux using mDNS/DNS-SD -- compatible with Bonjour" + topics = ("bonjour", "dns", "dns-sd", "mdns") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lathiat/avahi" + license = "LGPL-2.1-only" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.75.2") + self.requires("expat/2.5.0") + self.requires("libdaemon/0.14") + self.requires("dbus/1.15.2") + self.requires("gdbm/1.19") + self.requires("libevent/2.1.12") + + def build_requirements(self): + self.tool_requires("glib/2.75.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux.") + + 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 generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-compat-libdns_sd") + tc.configure_args.append("--disable-gtk3") + tc.configure_args.append("--disable-mono") + tc.configure_args.append("--disable-monodoc") + tc.configure_args.append("--disable-python") + tc.configure_args.append("--disable-qt5") + tc.configure_args.append("--with-systemdsystemunitdir=/lib/systemd/system") + tc.generate() + AutotoolsDeps(self).generate() + PkgConfigDeps(self).generate() + # Override Avahi's problematic check for the pkg-config executable. + env = Environment() + env.define("have_pkg_config", "yes") + env.vars(self).save_script("conanbuild_pkg_config") + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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, "run")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + for lib in ("client", "common", "core", "glib", "gobject", "libevent", "compat-libdns_sd"): + avahi_lib = f"avahi-{lib}" + self.cpp_info.components[lib].names["cmake_find_package"] = lib + self.cpp_info.components[lib].names["cmake_find_package_multi"] = lib + self.cpp_info.components[lib].names["pkg_config"] = avahi_lib + self.cpp_info.components[lib].libs = [avahi_lib] + self.cpp_info.components[lib].includedirs = [os.path.join("include", avahi_lib)] + self.cpp_info.components["compat-libdns_sd"].libs = ["dns_sd"] + + self.cpp_info.components["client"].requires = ["common", "dbus::dbus"] + self.cpp_info.components["common"].system_libs = ["pthread"] + self.cpp_info.components["core"].requires = ["common"] + self.cpp_info.components["glib"].requires = ["common", "glib::glib"] + self.cpp_info.components["gobject"].requires = ["client", "glib"] + self.cpp_info.components["libevent"].requires = ["common", "libevent::libevent"] + self.cpp_info.components["compat-libdns_sd"].requires = ["client"] + + for app in ("autoipd", "browse", "daemon", "dnsconfd", "publish", "resolve", "set-host-name"): + avahi_app = f"avahi-{app}" + self.cpp_info.components[app].names["cmake_find_package"] = app + self.cpp_info.components[app].names["cmake_find_package_multi"] = app + self.cpp_info.components[app].names["pkg_config"] = avahi_app + + self.cpp_info.components["autoipd"].requires = ["libdaemon::libdaemon"] + self.cpp_info.components["browse"].requires = ["client", "gdbm::gdbm"] + self.cpp_info.components["daemon"].requires = ["core", "expat::expat", "libdaemon::libdaemon"] + self.cpp_info.components["dnsconfd"].requires = ["common", "libdaemon::libdaemon"] + self.cpp_info.components["publish"].requires = ["client"] + self.cpp_info.components["resolve"].requires = ["client"] + self.cpp_info.components["set-host-name"].requires = ["client"] + + 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) diff --git a/recipes/avahi/all/test_package/CMakeLists.txt b/recipes/avahi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fce015c3405a9 --- /dev/null +++ b/recipes/avahi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Avahi CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE avahi::compat-libdns_sd) diff --git a/recipes/avahi/all/test_package/conanfile.py b/recipes/avahi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0cec595dd1ddc --- /dev/null +++ b/recipes/avahi/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/avahi/all/test_package/test_package.c b/recipes/avahi/all/test_package/test_package.c new file mode 100644 index 0000000000000..bae1467c7d687 --- /dev/null +++ b/recipes/avahi/all/test_package/test_package.c @@ -0,0 +1,18 @@ +#include +#include + +int main() +{ + DNSServiceRef sdRef; + DNSServiceErrorType err = DNSServiceBrowse(&sdRef, 0, 0, "_example._tcp", NULL, NULL, NULL); + if (err == kDNSServiceErr_NoError) + { + printf("DNSServiceBrowse succeeded\n"); + DNSServiceRefDeallocate(sdRef); + } + else + { + printf("DNSServiceBrowse failed: %d\n", err); + } + return 0; +} diff --git a/recipes/avahi/all/test_v1_package/CMakeLists.txt b/recipes/avahi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/avahi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/avahi/all/test_v1_package/conanfile.py b/recipes/avahi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b6a26067f365d --- /dev/null +++ b/recipes/avahi/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/avahi/config.yml b/recipes/avahi/config.yml new file mode 100644 index 0000000000000..37290caa0a7c9 --- /dev/null +++ b/recipes/avahi/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8": + folder: all diff --git a/recipes/avcpp/all/conandata.yml b/recipes/avcpp/all/conandata.yml new file mode 100644 index 0000000000000..1ba5e69f511c2 --- /dev/null +++ b/recipes/avcpp/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "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" + 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" + 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 new file mode 100644 index 0000000000000..e1479bc47146c --- /dev/null +++ b/recipes/avcpp/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class AvcppConan(ConanFile): + name = "avcpp" + description = "C++ wrapper for FFmpeg" + license = "LGPL-2.1", "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/h4tr3d/avcpp/" + topics = ("ffmpeg", "cpp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + "Visual Studio": "15", + "msvc": "191", + } + + 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("ffmpeg/5.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["AV_ENABLE_SHARED"] = self.options.shared + tc.variables["AV_ENABLE_STATIC"] = not self.options.shared + tc.variables["AV_BUILD_EXAMPLES"] = 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, 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): + target_name = "avcpp" if self.options.shared else "avcpp-static" + + self.cpp_info.set_property("cmake_file_name", "avcpp") + self.cpp_info.set_property("cmake_target_name", f"avcpp::{target_name}") + + self.cpp_info.components["AvCpp"].names["cmake_find_package"] = target_name + self.cpp_info.components["AvCpp"].names["cmake_find_package_multi"] = target_name + self.cpp_info.components["AvCpp"].set_property("cmake_target_name", f"avcpp::{target_name}") + self.cpp_info.components["AvCpp"].libs = ["avcpp", ] + self.cpp_info.components["AvCpp"].requires = ["ffmpeg::ffmpeg", ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["AvCpp"].system_libs = ["mvec"] + if self.settings.os == "Windows": + self.cpp_info.components["AvCpp"].system_libs = ["mfplat"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "avcpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "avcpp" + self.cpp_info.names["cmake_find_package"] = "avcpp" + self.cpp_info.names["cmake_find_package_multi"] = "avcpp" diff --git a/recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch b/recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch new file mode 100644 index 0000000000000..38c60a601238c --- /dev/null +++ b/recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 95b1a02..0f31197 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,8 +6,6 @@ endif() + + project(AvCpp LANGUAGES CXX VERSION 2.1.0) + +-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)") +@@ -28,8 +26,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 4c58281..bee779f 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/all/patches/cci.20220301-fix-ffmpeg.patch b/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch new file mode 100644 index 0000000000000..3207ead4b4610 --- /dev/null +++ b/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch @@ -0,0 +1,46 @@ +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/all/test_package/CMakeLists.txt b/recipes/avcpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b07f0b83ed62 --- /dev/null +++ b/recipes/avcpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(avcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if (TARGET avcpp::avcpp) + target_link_libraries(${PROJECT_NAME} PRIVATE avcpp::avcpp) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE avcpp::avcpp-static) +endif() +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/avcpp/all/test_package/conanfile.py b/recipes/avcpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/avcpp/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/avcpp/all/test_package/test_package.cpp b/recipes/avcpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4a0006ac9890a --- /dev/null +++ b/recipes/avcpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "avcpp/av.h" +#include "avcpp/avutils.h" + +int main() { + av::init(); + av::setFFmpegLoggingLevel(AV_LOG_DEBUG); + + return 0; +} diff --git a/recipes/avcpp/all/test_v1_package/CMakeLists.txt b/recipes/avcpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/avcpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/avcpp/all/test_v1_package/conanfile.py b/recipes/avcpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6b551939fbde3 --- /dev/null +++ b/recipes/avcpp/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/avcpp/config.yml b/recipes/avcpp/config.yml new file mode 100644 index 0000000000000..deb0eb011c7ea --- /dev/null +++ b/recipes/avcpp/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.0": + folder: all + "cci.20220301": + folder: all diff --git a/recipes/avir/all/conandata.yml b/recipes/avir/all/conandata.yml new file mode 100644 index 0000000000000..34c53c22f1e4f --- /dev/null +++ b/recipes/avir/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0": + url: "https://github.com/avaneev/avir/archive/refs/tags/3.0.tar.gz" + sha256: "011909d31cf782152a69f570563eb70700504f168174a6049b6acbb9b9f511ea" diff --git a/recipes/avir/all/conanfile.py b/recipes/avir/all/conanfile.py new file mode 100644 index 0000000000000..61093399842d4 --- /dev/null +++ b/recipes/avir/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.50.0" + + +class AVIRConan(ConanFile): + name = "avir" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + description = "High-quality pro image resizing / scaling C++ library, image resize" + topics = ("image-processing", "image-resizer", "lanczos", ) + homepage = "https://github.com/avaneev/avir" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/avir/all/test_package/CMakeLists.txt b/recipes/avir/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..51fd0e87ec014 --- /dev/null +++ b/recipes/avir/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(avir CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE avir::avir) diff --git a/recipes/avir/all/test_package/conanfile.py b/recipes/avir/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/avir/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/avir/all/test_package/test_package.cpp b/recipes/avir/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6726fc2fb72b5 --- /dev/null +++ b/recipes/avir/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "avir.h" + +int main() { + avir::CImageResizer<> ImageResizer(8); + + return 0; +} + diff --git a/recipes/avir/all/test_v1_package/CMakeLists.txt b/recipes/avir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b53aff65d290e --- /dev/null +++ b/recipes/avir/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(avir CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE avir::avir) diff --git a/recipes/avir/all/test_v1_package/conanfile.py b/recipes/avir/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/avir/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/avir/config.yml b/recipes/avir/config.yml new file mode 100644 index 0000000000000..fdd08f532337f --- /dev/null +++ b/recipes/avir/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0": + folder: all diff --git a/recipes/aws-c-auth/all/conandata.yml b/recipes/aws-c-auth/all/conandata.yml new file mode 100644 index 0000000000000..3f6bee7b4b086 --- /dev/null +++ b/recipes/aws-c-auth/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.6.17": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.17.tar.gz" + sha256: "b43678ad3a779c9c7fccf8f931c162eaaf4d5d64d2955ac1fcfd32e538545c0f" + "0.6.11": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.11.tar.gz" + sha256: "d8a0d373cf8b0ff148a014ae2ba24c51f2e7a598b5b0cf3a6e64482c1cd37f90" + "0.6.8": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.8.tar.gz" + sha256: "48b1c0008265ea8e7d7b653b34640ce8111e00d6e0e3f4855f3fba71e1ac5704" + "0.6.4": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.4.tar.gz" + sha256: "119cec67e85b01af8c01b11d962c610d8e9b183cde96fee77db669cccaa19ac9" + "0.6.0": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.0.tar.gz" + sha256: "5f5fff63110c3e8f619385ca563f77886bc101d3e054987eecbb87586e27b651" diff --git a/recipes/aws-c-auth/all/conanfile.py b/recipes/aws-c-auth/all/conanfile.py new file mode 100644 index 0000000000000..610bd376de920 --- /dev/null +++ b/recipes/aws-c-auth/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + + +class AwsCAuth(ConanFile): + name = "aws-c-auth" + description = ( + "C99 library implementation of AWS client-side authentication: " + "standard credentials providers and signing." + ) + license = "Apache-2.0", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-auth" + topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") + if Version(self.version) < "0.6.17": + self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.13", transitive_headers=True, transitive_libs=True) + else: + self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.22", transitive_headers=True, transitive_libs=True) + if Version(self.version) >= "0.6.5": + self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-auth")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-auth") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-auth") + # TODO: back to global scope once conan v1 support dropped + self.cpp_info.components["aws-c-auth-lib"].libs = ["aws-c-auth"] + self.cpp_info.components["aws-c-auth-lib"].requires = [ + "aws-c-common::aws-c-common-lib", + "aws-c-cal::aws-c-cal-lib", + "aws-c-io::aws-c-io-lib", + "aws-c-http::aws-c-http-lib", + ] + if Version(self.version) >= "0.6.5": + self.cpp_info.components["aws-c-auth-lib"].requires.append("aws-c-sdkutils::aws-c-sdkutils-lib") + + # TODO: to remove once conan v1 support dropped + self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package"] = "aws-c-auth" + self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package_multi"] = "aws-c-auth" + self.cpp_info.components["aws-c-auth-lib"].set_property("cmake_target_name", "AWS::aws-c-auth") diff --git a/recipes/aws-c-auth/all/test_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d0c587e8dd59d --- /dev/null +++ b/recipes/aws-c-auth/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-auth REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-auth) diff --git a/recipes/aws-c-auth/all/test_package/conanfile.py b/recipes/aws-c-auth/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/aws-c-auth/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/aws-c-auth/all/test_package/test_package.c b/recipes/aws-c-auth/all/test_package/test_package.c new file mode 100644 index 0000000000000..3a09afc9945dc --- /dev/null +++ b/recipes/aws-c-auth/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_auth_library_init(allocator); + aws_auth_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-auth/all/test_v1_package/conanfile.py b/recipes/aws-c-auth/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-auth/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-auth/config.yml b/recipes/aws-c-auth/config.yml new file mode 100644 index 0000000000000..503ab418198f1 --- /dev/null +++ b/recipes/aws-c-auth/config.yml @@ -0,0 +1,11 @@ +versions: + "0.6.17": + folder: all + "0.6.11": + folder: all + "0.6.8": + folder: all + "0.6.4": + folder: all + "0.6.0": + folder: all diff --git a/recipes/aws-c-cal/all/conandata.yml b/recipes/aws-c-cal/all/conandata.yml new file mode 100644 index 0000000000000..e1b848e4dfa2d --- /dev/null +++ b/recipes/aws-c-cal/all/conandata.yml @@ -0,0 +1,52 @@ +sources: + "0.5.20": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.20.tar.gz" + sha256: "acc352359bd06f8597415c366cf4ec4f00d0b0da92d637039a73323dd55b6cd0" + "0.5.19": + url: "https://github.com/awslabs/aws-c-cal/archive/refs/tags/v0.5.19.tar.gz" + sha256: "23452ab7960c480f1ec0a96ac55bde32d7d27c4a664baeadc248923b19c12086" + "0.5.17": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.17.tar.gz" + sha256: "40297da04443d4ee2988d1c5fb0dc4a156d0e4cfaf80e6a1df1867452566d540" + "0.5.13": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.13.tar.gz" + sha256: "3aba3954877ea5271ce68361f3bd9c155b422b1149eed403874f6493285ca04d" + "0.5.12": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.12.tar.gz" + sha256: "350c29a288d5d498bd6574fca659cffc9453bf62691fbde5788399716c2bd132" + "0.5.11": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.11.tar.gz" + sha256: "ef46e121b2231a0b19afce8af4b32d77501df4d470e926990918456636cd83c0" +patches: + "0.5.20": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.19": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.17": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.13": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.12": + - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" + - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.11": + - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" + - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" diff --git a/recipes/aws-c-cal/all/conanfile.py b/recipes/aws-c-cal/all/conanfile.py new file mode 100644 index 0000000000000..3ed5c70f492e6 --- /dev/null +++ b/recipes/aws-c-cal/all/conanfile.py @@ -0,0 +1,128 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.3" + + +class AwsCCal(ConanFile): + name = "aws-c-cal" + description = "Aws Crypto Abstraction Layer: Cross-Platform, C99 wrapper for cryptography primitives." + topics = ("aws", "amazon", "cloud", "cal", "crypt", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-cal" + license = "Apache-2.0", + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _needs_openssl(self): + return self.settings.os != "Windows" and not is_apple_os(self) + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) <= "0.5.11": + self.requires("aws-c-common/0.6.11") + else: + self.requires("aws-c-common/0.8.2") + if self._needs_openssl: + self.requires("openssl/1.1.1s") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["USE_OPENSSL"] = self._needs_openssl + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-cal")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-cal") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-cal") + + self.cpp_info.filenames["cmake_find_package"] = "aws-c-cal" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-cal" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["aws-c-cal-lib"].names["cmake_find_package"] = "aws-c-cal" + self.cpp_info.components["aws-c-cal-lib"].names["cmake_find_package_multi"] = "aws-c-cal" + self.cpp_info.components["aws-c-cal-lib"].set_property("cmake_target_name", "AWS::aws-c-cal") + + self.cpp_info.components["aws-c-cal-lib"].libs = ["aws-c-cal"] + self.cpp_info.components["aws-c-cal-lib"].requires = ["aws-c-common::aws-c-common-lib"] + if self.settings.os == "Windows": + self.cpp_info.components["aws-c-cal-lib"].system_libs.append("ncrypt") + elif is_apple_os(self): + self.cpp_info.components["aws-c-cal-lib"].frameworks.extend(["CoreFoundation", "Security"]) + elif self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["aws-c-cal-lib"].system_libs.append("dl") + + self.user_info.with_openssl = self._needs_openssl + if self._needs_openssl: + self.cpp_info.components["aws-c-cal-lib"].requires.append("openssl::crypto") + if not self.dependencies["openssl"].options.shared: + # aws-c-cal does not statically link to openssl and searches dynamically for openssl symbols . + # Mark these as undefined so the linker will include them. + # This avoids dynamical look-up for a system crypto library. + crypto_symbols = [ + "HMAC_Update", "HMAC_Final", "HMAC_Init_ex", + ] + if Version(self.dependencies["openssl"].ref.version) >= "1.1": + crypto_symbols.extend([ + "HMAC_CTX_new", "HMAC_CTX_free", "HMAC_CTX_reset", + ]) + else: + crypto_symbols.extend([ + "HMAC_CTX_init", "HMAC_CTX_cleanup", "HMAC_CTX_reset", + ]) + crypto_link_flags = "-Wl," + ",".join(f"-u{symbol}" for symbol in crypto_symbols) + self.cpp_info.components["aws-c-cal-lib"].exelinkflags.append(crypto_link_flags) + self.cpp_info.components["aws-c-cal-lib"].sharedlinkflags.append(crypto_link_flags) diff --git a/recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.patch b/recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.patch new file mode 100644 index 0000000000000..2ebcf79f59924 --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.patch @@ -0,0 +1,19 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -86,12 +86,12 @@ + if (USE_OPENSSL AND NOT ANDROID) + find_package(OpenSSL REQUIRED) + find_package(Threads REQUIRED) +- add_library(crypto UNKNOWN IMPORTED) ++ add_library(crypto INTERFACE IMPORTED) + set_target_properties(crypto PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") + set_target_properties(crypto PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}") ++ #IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ INTERFACE_LINK_LIBRARIES "OpenSSL::Crypto") + add_dependencies(crypto Threads::Threads) + message(STATUS "Using libcrypto from system: ${OPENSSL_CRYPTO_LIBRARY}") + elseif(NOT USE_OPENSSL AND IN_SOURCE_BUILD) + diff --git a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch new file mode 100644 index 0000000000000..3de09bddfa119 --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,12 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -7,6 +7,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch new file mode 100644 index 0000000000000..422624b80de7e --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -78,7 +78,12 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -7,6 +7,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/recipes/aws-c-cal/all/test_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ed07f4d9b8e6 --- /dev/null +++ b/recipes/aws-c-cal/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-cal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) diff --git a/recipes/aws-c-cal/all/test_package/conanfile.py b/recipes/aws-c-cal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1b3c18ef08ac1 --- /dev/null +++ b/recipes/aws-c-cal/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os +import io + + +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): + stream = io.StringIO() + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun", output=stream) + self.output.info(stream.getvalue()) + if self.deps_user_info["aws-c-cal"].with_openssl == "True": + assert "found static libcrypto" in stream.getvalue() diff --git a/recipes/aws-c-cal/all/test_package/test_package.c b/recipes/aws-c-cal/all/test_package/test_package.c new file mode 100644 index 0000000000000..a82e5eb0a2146 --- /dev/null +++ b/recipes/aws-c-cal/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +int main() { + struct aws_allocator* allocator = aws_default_allocator(); + + struct aws_logger_standard_options options; + options.level = AWS_LL_TRACE; + options.filename = NULL; + options.file = stdout; + struct aws_logger logger; + aws_logger_init_standard(&logger, allocator, &options); + aws_logger_set(&logger); + + aws_cal_library_init(allocator); + aws_cal_library_clean_up(); + aws_logger_clean_up(&logger); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a88842ed46e6 --- /dev/null +++ b/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-cal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) diff --git a/recipes/aws-c-cal/all/test_v1_package/conanfile.py b/recipes/aws-c-cal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ff0f4e1acbd6f --- /dev/null +++ b/recipes/aws-c-cal/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake, tools +import os +import io + + +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): + stream = io.StringIO() + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True, output=stream) + self.output.info(stream.getvalue()) + if self.deps_user_info["aws-c-cal"].with_openssl == "True": + assert "found static libcrypto" in stream.getvalue() diff --git a/recipes/aws-c-cal/config.yml b/recipes/aws-c-cal/config.yml new file mode 100644 index 0000000000000..f969df4acc583 --- /dev/null +++ b/recipes/aws-c-cal/config.yml @@ -0,0 +1,13 @@ +versions: + "0.5.20": + folder: all + "0.5.19": + folder: all + "0.5.17": + folder: all + "0.5.13": + folder: all + "0.5.12": + folder: all + "0.5.11": + folder: all diff --git a/recipes/aws-c-common/all/conandata.yml b/recipes/aws-c-common/all/conandata.yml new file mode 100644 index 0000000000000..773702bbe2c98 --- /dev/null +++ b/recipes/aws-c-common/all/conandata.yml @@ -0,0 +1,56 @@ +sources: + "0.8.2": + url: "https://github.com/awslabs/aws-c-common/archive/v0.8.2.tar.gz" + sha256: "36edc6e486c43bbb34059dde227e872c0d41ab54f0b3609d38f188cfbbc6d1f8" + "0.7.5": + url: "https://github.com/awslabs/aws-c-common/archive/v0.7.5.tar.gz" + sha256: "e34fd3d3d32e3597f572205aaabbe995e162f4015e14c7328987b596bd25812c" + "0.7.4": + url: "https://github.com/awslabs/aws-c-common/archive/v0.7.4.tar.gz" + sha256: "e9462a141b5db30006704f537d19b92357a59be38d590272e6118976b0356ccd" + "0.7.3": + url: "https://github.com/awslabs/aws-c-common/archive/v0.7.3.tar.gz" + sha256: "e4b80d368668814d9b76989fd2e3cd0fcf0be160bbb8bfeedf1f652e27f9c08c" + "0.7.2": + url: "https://github.com/awslabs/aws-c-common/archive/v0.7.2.tar.gz" + sha256: "455aed7447ed58eb7d5d3e8c952ed59f77c71dfed4115883e900f36d95f06dab" + "0.7.1": + url: "https://github.com/awslabs/aws-c-common/archive/v0.7.1.tar.gz" + sha256: "75c444a337e446e82d4f71c127118981656234b25cbdfd5913b8de713354fb43" + "0.7.0": + url: "https://github.com/awslabs/aws-c-common/archive/v0.7.0.tar.gz" + sha256: "a4e94d2c1d045a27467c9dfae51382f851a5223c3a0ecc15a96d1dba94f85ad6" + "0.6.20": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.20.tar.gz" + sha256: "6eb0b806c78b36a32eec9bcba8d2833e3973491a29d46fe3d11edc3f8d3e7f73" + "0.6.19": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.19.tar.gz" + sha256: "91cb2b809687be19fce8d6ca03ddc00c78723854ead30dcb58bdc4172cb1796c" + "0.6.17": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.17.tar.gz" + sha256: "441156ecfabb84e41601d7173a7f88267f099899f0ae6091c3b745d9e02211f6" + "0.6.15": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.15.tar.gz" + sha256: "eb3ead3fb7a1f09c046393f776a96a0f50ae5f38c70d462273084280383669f1" + "0.6.14": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.14.tar.gz" + sha256: "1691c9dad5a0d236c2a0e351cc972231b176947e454c61d1c4b3ea4ab42f32e7" + "0.6.11": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.11.tar.gz" + sha256: "86159bd1128eee2813f705c275d319e14d1b77017fab46f6ca5dafcc66edaea9" + "0.6.9": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.9.tar.gz" + sha256: "928a3e36f24d1ee46f9eec360ec5cebfe8b9b8994fe39d4fa74ff51aebb12717" + "0.6.8": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.8.tar.gz" + sha256: "2997e851ed690a614507a43f4c393f45a198614d94da1660ecdf9b5a729535fc" + "0.6.7": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.7.tar.gz" + sha256: "643b35c62f948367f484f3a436bc37b5799538f47b08aa72deb3818b8bcdc631" + "0.4.25": + url: "https://github.com/awslabs/aws-c-common/archive/v0.4.25.tar.gz" + sha256: "f85a8f74e42bd983a4615654457f8037876bc6b8dbf890e368bb516cbc2e9844" +patches: + "0.4.25": + - patch_file: "patches/0001-disable-fPIC.patch" + - patch_file: "patches/0002-no-warnings-as-errors.patch" diff --git a/recipes/aws-c-common/all/conanfile.py b/recipes/aws-c-common/all/conanfile.py new file mode 100644 index 0000000000000..4c7af96e0f6da --- /dev/null +++ b/recipes/aws-c-common/all/conanfile.py @@ -0,0 +1,126 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AwsCCommon(ConanFile): + name = "aws-c-common" + description = ( + "Core c99 package for AWS SDK for C. Includes cross-platform " + "primitives, configuration, data structures, and error handling." + ) + topics = ("aws", "amazon", "cloud", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-common" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cpu_extensions": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cpu_extensions": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "0.6.11": + del self.options.cpu_extensions + + 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 self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Static runtime + shared is not working for more recent releases") + + 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["AWS_ENABLE_LTO"] = False + if Version(self.version) >= "0.6.0": + tc.variables["AWS_WARNINGS_ARE_ERRORS"] = False + if is_msvc(self): + tc.variables["STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["USE_CPU_EXTENSIONS"] = self.options.get_safe("cpu_extensions", False) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-common")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-common": "aws-c-common::aws-c-common"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-common") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-common") + self.cpp_info.libs = ["aws-c-common"] + if self.options.shared: + self.cpp_info.defines.append("AWS_COMMON_USE_IMPORT_EXPORT") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m", "pthread", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["bcrypt", "ws2_32"] + if Version(self.version) >= "0.6.13": + self.cpp_info.system_libs.append("shlwapi") + if not self.options.shared: + if is_apple_os(self): + self.cpp_info.frameworks = ["CoreFoundation"] + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-c-common/all/patches/0001-disable-fPIC.patch b/recipes/aws-c-common/all/patches/0001-disable-fPIC.patch new file mode 100644 index 0000000000000..1c3c5cada4202 --- /dev/null +++ b/recipes/aws-c-common/all/patches/0001-disable-fPIC.patch @@ -0,0 +1,13 @@ +--- cmake/AwsCFlags.cmake ++++ cmake/AwsCFlags.cmake +@@ -62,8 +62,8 @@ + # Warning disables always go last to avoid future flags re-enabling them + list(APPEND AWS_C_FLAGS -Wno-long-long) + +- # Always enable position independent code, since this code will always end up in a shared lib +- list(APPEND AWS_C_FLAGS -fPIC) ++ # Don't always set fPIC as conan will handle position independent code. ++ # list(APPEND AWS_C_FLAGS -fPIC) + + if (LEGACY_COMPILER_SUPPORT) + list(APPEND AWS_C_FLAGS -Wno-strict-aliasing) diff --git a/recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch b/recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch new file mode 100644 index 0000000000000..8abe45bd0a3d6 --- /dev/null +++ b/recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch @@ -0,0 +1,20 @@ +--- a/cmake/AwsCFlags.cmake ++++ b/cmake/AwsCFlags.cmake +@@ -34,7 +34,7 @@ function(aws_set_common_properties target) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) + endif() + +- list(APPEND AWS_C_FLAGS /W4 /WX /MP) ++ list(APPEND AWS_C_FLAGS /W4 /MP) + # /volatile:iso relaxes some implicit memory barriers that MSVC normally applies for volatile accesses + # Since we want to be compatible with user builds using /volatile:iso, use it for the tests. + list(APPEND AWS_C_FLAGS /volatile:iso) +@@ -49,7 +49,7 @@ function(aws_set_common_properties target) + list(APPEND AWS_C_FLAGS "${_FLAGS}") + + else() +- list(APPEND AWS_C_FLAGS -Wall -Werror -Wstrict-prototypes) ++ list(APPEND AWS_C_FLAGS -Wall -Wstrict-prototypes) + + if(NOT SET_PROPERTIES_NO_WEXTRA) + list(APPEND AWS_C_FLAGS -Wextra) diff --git a/recipes/aws-c-common/all/test_package/CMakeLists.txt b/recipes/aws-c-common/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c60f5562de5c5 --- /dev/null +++ b/recipes/aws-c-common/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-common REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-common) diff --git a/recipes/aws-c-common/all/test_package/conanfile.py b/recipes/aws-c-common/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/aws-c-common/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/aws-c-common/all/test_package/test_package.c b/recipes/aws-c-common/all/test_package/test_package.c new file mode 100644 index 0000000000000..449c6bf89d673 --- /dev/null +++ b/recipes/aws-c-common/all/test_package/test_package.c @@ -0,0 +1,27 @@ +#include + +#include +#include + +#define LOG_LEVEL AWS_LOG_LEVEL_TRACE + +int main() { + struct aws_logger_standard_options log_options; + log_options.level = AWS_LL_TRACE; + log_options.filename = NULL; + log_options.file = stdout; + + struct aws_logger logger; + aws_logger_init_standard(&logger, aws_default_allocator(), &log_options); + aws_logger_set(&logger); + AWS_LOGF_TRACE(LOG_LEVEL, "This is a %s message", "trace"); + AWS_LOGF_DEBUG(LOG_LEVEL, "This is a %s message", "debug"); + AWS_LOGF_INFO(LOG_LEVEL, "This is an %s message", "info"); + AWS_LOGF_WARN(LOG_LEVEL, "This is a %s message", "warning"); + AWS_LOGF_ERROR(LOG_LEVEL, "This is a %s message", "error"); + AWS_LOGF_FATAL(LOG_LEVEL, "This is a %s message", "fatal"); + + aws_logger_clean_up(&logger); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-common/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-common/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aws-c-common/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-common/all/test_v1_package/conanfile.py b/recipes/aws-c-common/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aws-c-common/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/aws-c-common/config.yml b/recipes/aws-c-common/config.yml new file mode 100644 index 0000000000000..5a8e794412c2f --- /dev/null +++ b/recipes/aws-c-common/config.yml @@ -0,0 +1,35 @@ +versions: + "0.8.2": + folder: all + "0.7.5": + folder: all + "0.7.4": + folder: all + "0.7.3": + folder: all + "0.7.2": + folder: all + "0.7.1": + folder: all + "0.7.0": + folder: all + "0.6.20": + folder: all + "0.6.19": + folder: all + "0.6.17": + folder: all + "0.6.15": + folder: all + "0.6.14": + folder: all + "0.6.11": + folder: all + "0.6.9": + folder: all + "0.6.8": + folder: all + "0.6.7": + folder: all + "0.4.25": + folder: all diff --git a/recipes/aws-c-compression/all/conandata.yml b/recipes/aws-c-compression/all/conandata.yml new file mode 100644 index 0000000000000..1baf0be5b106a --- /dev/null +++ b/recipes/aws-c-compression/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.2.15": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.15.tar.gz" + sha256: "11d58a229e2961b2b36493155a981dea2c8a0bc0d113b0073deb8c3189cfa04e" + "0.2.14": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.14.tar.gz" + sha256: "8737863ced57d92f5a0bdde554bf0fe70eaa76aae118fec09a6c361dfc55d0d5" + "0.2.13": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.13.tar.gz" + sha256: "6b6ebb223408b48a8b2c74ba7042ff61e5333dc900acd67c40ca1cd4b382c137" diff --git a/recipes/aws-c-compression/all/conanfile.py b/recipes/aws-c-compression/all/conanfile.py new file mode 100644 index 0000000000000..828f55f643189 --- /dev/null +++ b/recipes/aws-c-compression/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AwsCCompression(ConanFile): + name = "aws-c-compression" + description = "C99 implementation of huffman encoding/decoding" + topics = ("aws", "amazon", "cloud", "compression", "huffman", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-compression" + license = "Apache-2.0", + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-compression")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-compression": "aws-c-compression::aws-c-compression"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-compression") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-compression") + self.cpp_info.libs = ["aws-c-compression"] + if self.options.shared: + self.cpp_info.defines.append("AWS_COMPRESSION_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-c-compression/all/test_package/CMakeLists.txt b/recipes/aws-c-compression/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8efb2e9b0efa5 --- /dev/null +++ b/recipes/aws-c-compression/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-compression REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-compression) diff --git a/recipes/aws-c-compression/all/test_package/conanfile.py b/recipes/aws-c-compression/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/aws-c-compression/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/aws-c-compression/all/test_package/test_package.c b/recipes/aws-c-compression/all/test_package/test_package.c new file mode 100644 index 0000000000000..3c3523903fd35 --- /dev/null +++ b/recipes/aws-c-compression/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_compression_library_init(allocator); + aws_compression_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-compression/all/test_v1_package/conanfile.py b/recipes/aws-c-compression/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aws-c-compression/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/aws-c-compression/config.yml b/recipes/aws-c-compression/config.yml new file mode 100644 index 0000000000000..5a381bb0e6674 --- /dev/null +++ b/recipes/aws-c-compression/config.yml @@ -0,0 +1,7 @@ +versions: + "0.2.15": + folder: all + "0.2.14": + folder: all + "0.2.13": + folder: all diff --git a/recipes/aws-c-event-stream/all/conandata.yml b/recipes/aws-c-event-stream/all/conandata.yml new file mode 100644 index 0000000000000..61428e916296b --- /dev/null +++ b/recipes/aws-c-event-stream/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "0.2.15": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.15.tar.gz" + sha256: "4ff2ada07ede3c6afa4b8e6e20de541e717038307f29b38c27efa7c4d875ee26" + "0.2.12": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.12.tar.gz" + sha256: "cc4ebfe715d8df5b9e3f4a3ce9b67d5f480017a7ebbbfa1d5e64ea53ec672580" + "0.2.11": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.11.tar.gz" + sha256: "4818b8d3fe02016fcfdd033c1e9d8f6be07ccaeb38664fe8c31c0fd153ea56e6" + "0.2.7": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.7.tar.gz" + sha256: "bb5c94cdff70c1985fb0b5f30d81756cedb5a3c3075d37f7e1e2b34e2a33c8c0" + "0.1.5": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.1.5.tar.gz" + sha256: "f1b423a487b5d6dca118bfc0d0c6cc596dc476b282258a3228e73a8f730422d4" +patches: + "0.1.5": + - patch_file: "patches/0001-disable-tests-bin.patch" + - patch_file: "patches/0002-use-PROJECT_SOURCE_DIR.patch" diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py new file mode 100644 index 0000000000000..25bb2fd989f0a --- /dev/null +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.52.0" + +class AwsCEventStream(ConanFile): + name = "aws-c-event-stream" + description = "C99 implementation of the vnd.amazon.eventstream content-type" + license = "Apache-2.0", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-event-stream" + topics = ("aws", "eventstream", "content", ) + 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: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("aws-checksums/0.1.13") + self.requires("aws-c-common/0.8.2") + if Version(self.version) >= "0.2": + if Version(self.version) < "0.2.11": + self.requires("aws-c-io/0.10.20") + else: + self.requires("aws-c-io/0.13.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BINARIES"] = False + tc.variables["BUILD_TESTING"] = 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-event-stream")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-event-stream") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-event-stream") + self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package"] = "aws-c-event-stream" + self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package_multi"] = "aws-c-event-stream" + self.cpp_info.components["aws-c-event-stream-lib"].libs = ["aws-c-event-stream"] + self.cpp_info.components["aws-c-event-stream-lib"].requires = ["aws-c-common::aws-c-common-lib", "aws-checksums::aws-checksums"] + if Version(self.version) >= "0.2": + self.cpp_info.components["aws-c-event-stream-lib"].requires.append("aws-c-io::aws-c-io-lib") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "aws-c-event-stream" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-event-stream" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" diff --git a/recipes/aws-c-event-stream/all/patches/0001-disable-tests-bin.patch b/recipes/aws-c-event-stream/all/patches/0001-disable-tests-bin.patch new file mode 100644 index 0000000000000..21eae44486c93 --- /dev/null +++ b/recipes/aws-c-event-stream/all/patches/0001-disable-tests-bin.patch @@ -0,0 +1,25 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -112,14 +112,18 @@ + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" + DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/" + COMPONENT Development) + + +-include(CTest) +-enable_testing() +-add_subdirectory(tests) ++if(BUILD_TESTING) ++ include(CTest) ++ enable_testing() ++ add_subdirectory(tests) ++endif() + + if(NOT MSVC) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + endif() + +-add_subdirectory(bin) ++if(BUILD_BINARIES) ++ add_subdirectory(bin) ++endif() diff --git a/recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch b/recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch new file mode 100644 index 0000000000000..f2b60bb0f9a1d --- /dev/null +++ b/recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch @@ -0,0 +1,61 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -70,25 +70,25 @@ + ${AWS_EVENT_STREAM_SRC} + ) + +-add_library(${CMAKE_PROJECT_NAME} ${EVENT_STREAM_SRC}) +-aws_set_common_properties(${CMAKE_PROJECT_NAME}) +-aws_add_sanitizers(${CMAKE_PROJECT_NAME}) +-aws_prepare_symbol_visibility_args(${CMAKE_PROJECT_NAME} "AWS_EVENT_STREAM") ++add_library(${PROJECT_NAME} ${EVENT_STREAM_SRC}) ++aws_set_common_properties(${PROJECT_NAME}) ++aws_add_sanitizers(${PROJECT_NAME}) ++aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_EVENT_STREAM") + +-target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ++target_include_directories(${PROJECT_NAME} PUBLIC + $ + $) + + +-set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VERSION 1.0.0) +-set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES SOVERSION 0unstable) ++set_target_properties(${PROJECT_NAME} PROPERTIES VERSION 1.0.0) ++set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 0unstable) + + find_package(aws-c-common REQUIRED) + find_package(aws-checksums REQUIRED) + +-target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC AWS::aws-c-common AWS::aws-checksums) ++target_link_libraries(${PROJECT_NAME} PUBLIC AWS::aws-c-common AWS::aws-checksums) + +-aws_prepare_shared_lib_exports(${CMAKE_PROJECT_NAME}) ++aws_prepare_shared_lib_exports(${PROJECT_NAME}) + + install(FILES ${AWS_EVENT_STREAM_HEADERS} + DESTINATION "include/aws/event-stream" +@@ -100,17 +100,17 @@ + set (TARGET_DIR "static") + endif() + +-install(EXPORT "${CMAKE_PROJECT_NAME}-targets" +- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/" ++install(EXPORT "${PROJECT_NAME}-targets" ++ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/${TARGET_DIR}/" + NAMESPACE AWS:: + COMPONENT Development) + +-configure_file("cmake/${CMAKE_PROJECT_NAME}-config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" ++configure_file("cmake/${PROJECT_NAME}-config.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + @ONLY) + +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" +- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/" ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" ++ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/" + COMPONENT Development) + + diff --git a/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt b/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05cae5027e20e --- /dev/null +++ b/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-event-stream REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-event-stream) diff --git a/recipes/aws-c-event-stream/all/test_package/conanfile.py b/recipes/aws-c-event-stream/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/aws-c-event-stream/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/aws-c-event-stream/all/test_package/test_package.c b/recipes/aws-c-event-stream/all/test_package/test_package.c new file mode 100644 index 0000000000000..1b923438da34f --- /dev/null +++ b/recipes/aws-c-event-stream/all/test_package/test_package.c @@ -0,0 +1,35 @@ +#include +#include + +#include +#include +#include + +int main() { + uint8_t expected_data[] = { + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc2, 0x48, 0xeb, 0x7d, 0x98, 0xc8, 0xff}; + struct aws_allocator *allocator = aws_default_allocator(); + + struct aws_event_stream_message message; + + int res = aws_event_stream_message_init(&message, allocator, NULL, NULL); + + if (res != 0) { + fprintf(stderr, "Failed to init messag\n"); + } + + if (sizeof(expected_data) != aws_event_stream_message_total_length(&message)) { + fprintf(stderr, "length of message is incorrect\n"); + return EXIT_FAILURE; + } + + const uint8_t *buffer = aws_event_stream_message_buffer(&message); + size_t i; + for (i=0; i + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_http_library_init(allocator); + aws_http_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b3195e120b0b2 --- /dev/null +++ b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-http REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-http) diff --git a/recipes/aws-c-http/all/test_v1_package/conanfile.py b/recipes/aws-c-http/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-http/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-http/config.yml b/recipes/aws-c-http/config.yml new file mode 100644 index 0000000000000..ab4b9f0488086 --- /dev/null +++ b/recipes/aws-c-http/config.yml @@ -0,0 +1,11 @@ +versions: + "0.6.22": + folder: all + "0.6.13": + folder: all + "0.6.10": + folder: all + "0.6.7": + folder: all + "0.6.5": + folder: all diff --git a/recipes/aws-c-io/all/conandata.yml b/recipes/aws-c-io/all/conandata.yml new file mode 100644 index 0000000000000..4a9102a6ede26 --- /dev/null +++ b/recipes/aws-c-io/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.13.4": + url: "https://github.com/awslabs/aws-c-io/archive/v0.13.4.tar.gz" + sha256: "133bd0aa46caa2041962cd4f6d076209686ce2934af82f86d1a258df4cbdce8b" + "0.11.2": + url: "https://github.com/awslabs/aws-c-io/archive/v0.11.2.tar.gz" + sha256: "b60270d23b6e2f4a5d80e64ca6538ba114cd6044b53752964c940f87e59bf0d9" + "0.10.20": + url: "https://github.com/awslabs/aws-c-io/archive/v0.10.20.tar.gz" + sha256: "293248ef96166826370223865bff2537bea5e08f6913919884c53add8238ba97" + "0.10.13": + url: "https://github.com/awslabs/aws-c-io/archive/v0.10.13.tar.gz" + sha256: "ee34a93190e35a5c372ba73661dd69c48986e051a4b26dedb62bc5aa78f1660f" + "0.10.9": + url: "https://github.com/awslabs/aws-c-io/archive/v0.10.9.tar.gz" + sha256: "c64464152abe8b7e23f10bc026ed54a15eaf0ec0aae625d28e2caf4489090327" + "0.10.5": + url: "https://github.com/awslabs/aws-c-io/archive/v0.10.5.tar.gz" + sha256: "59abd4606661790cc0b777807938f3134cce77c03383015781498cfbfd191811" diff --git a/recipes/aws-c-io/all/conanfile.py b/recipes/aws-c-io/all/conanfile.py new file mode 100644 index 0000000000000..84b513c37e69f --- /dev/null +++ b/recipes/aws-c-io/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.52.0" + +class AwsCIO(ConanFile): + name = "aws-c-io" + description = "IO and TLS for application protocols" + license = "Apache-2.0", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-io" + topics = ("aws", "amazon", "cloud", "io", "tls",) + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # the versions of aws-c-common and aws-c-io are tied since aws-c-common/0.6.12 and aws-c-io/0.10.10 + # Please refer https://github.com/conan-io/conan-center-index/issues/7763 + if Version(self.version) <= "0.10.9": + self.requires("aws-c-common/0.6.11") + self.requires("aws-c-cal/0.5.11") + else: + self.requires("aws-c-common/0.8.2") + self.requires("aws-c-cal/0.5.13") + + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.requires("s2n/1.3.15") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-io")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-io") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-io") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["aws-c-io-lib"].libs = ["aws-c-io"] + if self.settings.os == "Macos": + self.cpp_info.components["aws-c-io-lib"].frameworks.append("Security") + if self.settings.os == "Windows": + self.cpp_info.components["aws-c-io-lib"].system_libs = ["crypt32", "secur32", "shlwapi"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "aws-c-io" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-io" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["aws-c-io-lib"].names["cmake_find_package"] = "aws-c-io" + self.cpp_info.components["aws-c-io-lib"].names["cmake_find_package_multi"] = "aws-c-io" + self.cpp_info.components["aws-c-io-lib"].set_property("cmake_target_name", "AWS::aws-c-io") + self.cpp_info.components["aws-c-io-lib"].requires = ["aws-c-cal::aws-c-cal-lib", "aws-c-common::aws-c-common-lib"] + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.components["aws-c-io-lib"].requires.append("s2n::s2n-lib") diff --git a/recipes/aws-c-io/all/test_package/CMakeLists.txt b/recipes/aws-c-io/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3176cc25055 --- /dev/null +++ b/recipes/aws-c-io/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-io REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} AWS::aws-c-io) diff --git a/recipes/aws-c-io/all/test_package/conanfile.py b/recipes/aws-c-io/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/aws-c-io/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-io/all/test_package/test_package.c b/recipes/aws-c-io/all/test_package/test_package.c new file mode 100644 index 0000000000000..2cab00be1ddca --- /dev/null +++ b/recipes/aws-c-io/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_io_library_init(allocator); + aws_io_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e45dc2bc298c6 --- /dev/null +++ b/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-io REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} AWS::aws-c-io) diff --git a/recipes/aws-c-io/all/test_v1_package/conanfile.py b/recipes/aws-c-io/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-io/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-io/config.yml b/recipes/aws-c-io/config.yml new file mode 100644 index 0000000000000..6dca88e3f0554 --- /dev/null +++ b/recipes/aws-c-io/config.yml @@ -0,0 +1,13 @@ +versions: + "0.13.4": + folder: all + "0.11.2": + folder: all + "0.10.20": + folder: all + "0.10.13": + folder: all + "0.10.9": + folder: all + "0.10.5": + folder: all diff --git a/recipes/aws-c-mqtt/all/conandata.yml b/recipes/aws-c-mqtt/all/conandata.yml new file mode 100644 index 0000000000000..6240cf10ee0f5 --- /dev/null +++ b/recipes/aws-c-mqtt/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.7.12": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.12.tar.gz" + sha256: "cf80f1b4f37aa8a6b8698315fae32cbf2bd944b67784f07b5762f392f18e64df" + "0.7.10": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.10.tar.gz" + sha256: "95667477e17bc99d49a1d6674d7fb98f9a0379b6966cb2ed4863152e959d9e8f" + "0.7.9": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.9.tar.gz" + sha256: "8556ae7c2b30ebb4ccb61becb120a848ea33315f7cf85436ebe5f21b75ab09c4" + "0.7.6": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.6.tar.gz" + sha256: "a02c0525f7ddcdc058cd9f507b2f3a8be0383fc946920ed32c9d780cc29703ac" diff --git a/recipes/aws-c-mqtt/all/conanfile.py b/recipes/aws-c-mqtt/all/conanfile.py new file mode 100644 index 0000000000000..4edb02ac94d9f --- /dev/null +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.47.0" + + +class AwsCMQTT(ConanFile): + name = "aws-c-mqtt" + description = "C99 implementation of the MQTT 3.1.1 specification." + license = "Apache-2.0", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-mqtt" + topics = ("aws", "amazon", "cloud", "mqtt") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + def requirements(self): + self.requires("aws-c-common/0.8.2") + self.requires("aws-c-cal/0.5.13") + if Version(self.version) < "0.7.12": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-mqtt")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-mqtt") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-mqtt") + + self.cpp_info.filenames["cmake_find_package"] = "aws-c-mqtt" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-mqtt" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["aws-c-mqtt-lib"].names["cmake_find_package"] = "aws-c-mqtt" + self.cpp_info.components["aws-c-mqtt-lib"].names["cmake_find_package_multi"] = "aws-c-mqtt" + self.cpp_info.components["aws-c-mqtt-lib"].set_property("cmake_target_name", "AWS::aws-c-mqtt") + + self.cpp_info.components["aws-c-mqtt-lib"].libs = ["aws-c-mqtt"] + self.cpp_info.components["aws-c-mqtt-lib"].requires = [ + "aws-c-common::aws-c-common-lib", + "aws-c-cal::aws-c-cal-lib", + "aws-c-io::aws-c-io-lib", + "aws-c-http::aws-c-http-lib" + ] diff --git a/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..04c8de77ba626 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-mqtt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) diff --git a/recipes/aws-c-mqtt/all/test_package/conanfile.py b/recipes/aws-c-mqtt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-mqtt/all/test_package/test_package.c b/recipes/aws-c-mqtt/all/test_package/test_package.c new file mode 100644 index 0000000000000..95b2eb760ba12 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_mqtt_library_init(allocator); + aws_mqtt_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..610e2350e6503 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-mqtt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) diff --git a/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py b/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-mqtt/config.yml b/recipes/aws-c-mqtt/config.yml new file mode 100644 index 0000000000000..edbab7e67d700 --- /dev/null +++ b/recipes/aws-c-mqtt/config.yml @@ -0,0 +1,9 @@ +versions: + "0.7.12": + folder: all + "0.7.10": + folder: all + "0.7.9": + folder: all + "0.7.6": + folder: all diff --git a/recipes/aws-c-s3/all/conandata.yml b/recipes/aws-c-s3/all/conandata.yml new file mode 100644 index 0000000000000..af6e82a742aa6 --- /dev/null +++ b/recipes/aws-c-s3/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.1.49": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.49.tar.gz" + sha256: "71acbba41a02477a6c352172da561bc2138bf239b936490c773d7aaa83afc9ab" + "0.1.37": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.37.tar.gz" + sha256: "2c35100c1739300e438d47f49aaa2c374001416a79fe3c6f27d79371fb2ac90b" + "0.1.29": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.29.tar.gz" + sha256: "bcbc38d091ad994fec2789bffd1d99e157c5e29a60685e836f028006e531bc60" + "0.1.27": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.27.tar.gz" + sha256: "8fccbf967c3b29f0feaa1ba3de158b7ead805c3b4302c45b7cad3429f045920c" + "0.1.19": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.19.tar.gz" + sha256: "30e17e31eed18e8d621cd3d3978b2e6eeeee5557bfc3a9d701d0d3e1c4a8a74d" diff --git a/recipes/aws-c-s3/all/conanfile.py b/recipes/aws-c-s3/all/conanfile.py new file mode 100644 index 0000000000000..131627214ba79 --- /dev/null +++ b/recipes/aws-c-s3/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.47.0" + +class AwsCS3(ConanFile): + name = "aws-c-s3" + description = "C99 implementation of the S3 client" + license = "Apache-2.0", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-s3" + topics = ("aws", "amazon", "cloud", "s3") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("aws-c-common/0.8.2") + if Version(self.version) < "0.1.49": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + self.requires("aws-c-auth/0.6.11") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + self.requires("aws-c-auth/0.6.17") + if Version(self.version) >= "0.1.36": + self.requires("aws-checksums/0.1.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-s3")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-s3") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-s3") + + self.cpp_info.filenames["cmake_find_package"] = "aws-c-s3" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-s3" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["aws-c-s3-lib"].names["cmake_find_package"] = "aws-c-s3" + self.cpp_info.components["aws-c-s3-lib"].names["cmake_find_package_multi"] = "aws-c-s3" + self.cpp_info.components["aws-c-s3-lib"].set_property("cmake_target_name", "AWS::aws-c-s3") + + self.cpp_info.components["aws-c-s3-lib"].libs = ["aws-c-s3"] + self.cpp_info.components["aws-c-s3-lib"].requires = [ + "aws-c-common::aws-c-common-lib", + "aws-c-io::aws-c-io-lib", + "aws-c-http::aws-c-http-lib", + "aws-c-auth::aws-c-auth-lib" + ] + if Version(self.version) >= "0.1.36": + self.cpp_info.components["aws-c-s3-lib"].requires.append("aws-checksums::aws-checksums-lib") diff --git a/recipes/aws-c-s3/all/test_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8e0fdd1abc04c --- /dev/null +++ b/recipes/aws-c-s3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-s3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-s3) diff --git a/recipes/aws-c-s3/all/test_package/conanfile.py b/recipes/aws-c-s3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/aws-c-s3/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/aws-c-s3/all/test_package/test_package.c b/recipes/aws-c-s3/all/test_package/test_package.c new file mode 100644 index 0000000000000..6a88150ba4a43 --- /dev/null +++ b/recipes/aws-c-s3/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_s3_library_init(allocator); + aws_s3_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0778b2e2c7246 --- /dev/null +++ b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-s3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-s3) diff --git a/recipes/aws-c-s3/all/test_v1_package/conanfile.py b/recipes/aws-c-s3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/aws-c-s3/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/aws-c-s3/config.yml b/recipes/aws-c-s3/config.yml new file mode 100644 index 0000000000000..182095498622b --- /dev/null +++ b/recipes/aws-c-s3/config.yml @@ -0,0 +1,11 @@ +versions: + "0.1.49": + folder: all + "0.1.37": + folder: all + "0.1.29": + folder: all + "0.1.27": + folder: all + "0.1.19": + folder: all diff --git a/recipes/aws-c-sdkutils/all/conandata.yml b/recipes/aws-c-sdkutils/all/conandata.yml new file mode 100644 index 0000000000000..7ec4906cf9a7f --- /dev/null +++ b/recipes/aws-c-sdkutils/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.1.3": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.3.tar.gz" + sha256: "13d99c0877424a8fad40f312762968012dd54ec60a4438fb601ee65ff8b2484b" + "0.1.2": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/refs/tags/v0.1.2.tar.gz" + sha256: "d654670c145212ed3ce0699a988b9f83ebf3e7c44ed74d4d0772dc95ad46b38e" + "0.1.1": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/refs/tags/v0.1.1.tar.gz" + sha256: "201a5f694c912c952f50abab54fa0e576db75ddf6e8710c589896038ff9673f7" diff --git a/recipes/aws-c-sdkutils/all/conanfile.py b/recipes/aws-c-sdkutils/all/conanfile.py new file mode 100644 index 0000000000000..f2158c8d10fa8 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AwsCSDKUtils(ConanFile): + name = "aws-c-sdkutils" + description = "C99 library implementing AWS SDK specific utilities. Includes utilities for ARN parsing, reading AWS profiles, etc..." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-sdkutils" + topics = ("aws", "amazon", "cloud", "utility", "ARN") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-sdkutils")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-sdkutils": "aws-c-sdkutils::aws-c-sdkutils"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-sdkutils") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-sdkutils") + self.cpp_info.libs = ["aws-c-sdkutils"] + if self.options.shared: + self.cpp_info.defines.append("AWS_SDKUTILS_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt b/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4b5efc665c153 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-sdkutils REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} AWS::aws-c-sdkutils) diff --git a/recipes/aws-c-sdkutils/all/test_package/conanfile.py b/recipes/aws-c-sdkutils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/aws-c-sdkutils/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/aws-c-sdkutils/all/test_package/test_package.c b/recipes/aws-c-sdkutils/all/test_package/test_package.c new file mode 100644 index 0000000000000..3b89ef23f44f3 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_sdkutils_library_init(allocator); + aws_sdkutils_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py b/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-sdkutils/config.yml b/recipes/aws-c-sdkutils/config.yml new file mode 100644 index 0000000000000..b2ced6f0d7ab7 --- /dev/null +++ b/recipes/aws-c-sdkutils/config.yml @@ -0,0 +1,7 @@ +versions: + "0.1.3": + folder: all + "0.1.2": + folder: all + "0.1.1": + folder: all diff --git a/recipes/aws-cdi-sdk/all/CMakeLists.txt b/recipes/aws-cdi-sdk/all/CMakeLists.txt new file mode 100644 index 0000000000000..19f6430ae56b6 --- /dev/null +++ b/recipes/aws-cdi-sdk/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(AWSSDK REQUIRED) +add_library(aws-cpp-sdk-core ALIAS AWS::aws-sdk-cpp-core) + +add_subdirectory(source_subfolder/aws-cpp-sdk-cdi) diff --git a/recipes/aws-cdi-sdk/all/conandata.yml b/recipes/aws-cdi-sdk/all/conandata.yml new file mode 100644 index 0000000000000..c926a59a5cbb7 --- /dev/null +++ b/recipes/aws-cdi-sdk/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.2.0": + url: https://github.com/aws/aws-cdi-sdk/archive/refs/tags/v2.2.0.tar.gz + sha256: 4ee109b7fa2f683b4b0cd03028d0946857f09f34da4e89fe69a5c297cdaeb689 +patches: + "2.2.0": + - base_path: source_subfolder + patch_file: patches/001-Makefile.patch diff --git a/recipes/aws-cdi-sdk/all/conanfile.py b/recipes/aws-cdi-sdk/all/conanfile.py new file mode 100644 index 0000000000000..5fba77e00e10a --- /dev/null +++ b/recipes/aws-cdi-sdk/all/conanfile.py @@ -0,0 +1,144 @@ +import os +import re + +from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.35.0" + +class AwsCdiSdkConan(ConanFile): + name = "aws-cdi-sdk" + description = "AWS Cloud Digital Interface (CDI) SDK" + topics = ("aws", "communication", "framework", "service") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aws/aws-cdi-sdk" + license = "BSD-2-Clause" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + _autotools = None + _cmake = None + + def requirements(self): + self.requires("aws-libfabric/1.9.1amzncdi1.0") + self.requires("aws-sdk-cpp/1.8.130") + + def configure(self): + self.options["aws-libfabric"].shared = True + self.options["aws-sdk-cpp"].shared = True + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("This recipe currently only supports Linux. Feel free to contribute other platforms!") + if not self.options["aws-libfabric"].shared or not self.options["aws-sdk-cpp"].shared: + raise ConanInvalidConfiguration("Cannot build with static dependencies") + if not getattr(self.options["aws-sdk-cpp"], "monitoring"): + raise ConanInvalidConfiguration("This package requires the monitoring AWS SDK") + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + 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) + return self._autotools + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def _detect_compilers(self): + cmake_cache = tools.load(os.path.join(self.build_folder, "CMakeCache.txt")) + cc = re.search("CMAKE_C_COMPILER:FILEPATH=(.*)", cmake_cache)[1] + cxx = re.search("CMAKE_CXX_COMPILER:FILEPATH=(.*)", cmake_cache)[1] + return cc, cxx + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + # build aws-cpp-sdk-cdi + cmake = self._configure_cmake() + cmake.build() + + autotools = self._configure_autotools() + with tools.chdir(self._source_subfolder): + # configure autotools to find aws-cpp-sdk-cdi + autotools.include_paths.append(os.path.join(self.build_folder, self._source_subfolder, "aws-cpp-sdk-cdi", "include")) + autotools.library_paths.append(os.path.join(self.build_folder, "lib")) + autotools.libs.append("aws-cpp-sdk-cdi") + + vars = autotools.vars + cc, cxx = self._detect_compilers() + vars["CC"] = cc + vars["CXX"] = cxx + if self.settings.build_type == "Debug": + vars["DEBUG"] = "y" + + args = ["require_aws_sdk=no"] + + autotools.make(target="libsdk", vars=vars, args=args) + + def package(self): + cmake = self._configure_cmake() + cmake.install() + + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + config = "debug" if self.settings.build_type == "Debug" else "release" + self.copy(pattern="*", dst="lib", src=os.path.join(self._source_subfolder, "build", config, "lib")) + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-cdi-sdk") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # TODO: Remove the namespace on CMake targets + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.filenames["cmake_find_package"] = "aws-cdi-sdk" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-cdi-sdk" + + cppSdk = self.cpp_info.components["aws-cpp-sdk-cdi"] + cppSdk.libs = ["aws-cpp-sdk-cdi"] + + cppSdk.requires = ["aws-sdk-cpp::monitoring", "aws-libfabric::aws-libfabric"] + + cppSdk.set_property("cmake_target_name", "AWS::aws-cpp-sdk-cdi") + cppSdk.set_property("pkg_config_name", "aws-cpp-sdk-cdi") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # TODO: Remove the namespace on CMake targets + cppSdk.names["cmake_find_package"] = "aws-cpp-sdk-cdi" + cppSdk.names["cmake_find_package_multi"] = "aws-cpp-sdk-cdi" + cppSdk.names["pkg_config"] = "aws-cpp-sdk-cdi" + + cSdk = self.cpp_info.components["cdisdk"] + cSdk.libs = ["cdisdk"] + cSdk.requires = ["aws-cpp-sdk-cdi"] + if self.settings.os == "Linux": + cSdk.defines = ["_LINUX"] + + cSdk.set_property("cmake_target_name", "AWS::aws-cdi-sdk") + cSdk.set_property("pkg_config_name", "aws-cdi-sdk") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # TODO: Remove the namespace on CMake targets + cSdk.names["cmake_find_package"] = "aws-cdi-sdk" + cSdk.names["cmake_find_package_multi"] = "aws-cdi-sdk" + cSdk.names["pkg_config"] = "aws-cdi-sdk" + diff --git a/recipes/aws-cdi-sdk/all/patches/001-Makefile.patch b/recipes/aws-cdi-sdk/all/patches/001-Makefile.patch new file mode 100644 index 0000000000000..7462ee93a50e9 --- /dev/null +++ b/recipes/aws-cdi-sdk/all/patches/001-Makefile.patch @@ -0,0 +1,100 @@ +commit dfff3ca2bd52df35be52ec104d1f31f1e4aeef0e +Author: dvirtz +Date: Tue Aug 3 16:48:41 2021 +0300 + + build with external sdk + +diff --git a/Makefile b/Makefile +index 6929dee..74194b5 100644 +--- a/Makefile ++++ b/Makefile +@@ -98,9 +98,6 @@ endif + # makefile.[name].vars.mk. + -include makefile.*.vars.mk + +-ifeq ($(top.libfabric),) +- $(error libfabric source tree not found) +-endif + # Build artifacts for libfabric go into a debug or release directory under top.libfabric + build_dir.libfabric := $(top.libfabric)/build/$(config_libfabric) + +@@ -127,7 +124,7 @@ srcs.cdi := $(foreach ext,c cpp,$(wildcard $(src_dir.cdi)/*.$(ext))) + srcs.cdi += queue.c fifo.c list.c logger.c os_linux.c pool.c + objs.cdi := $(addprefix $(build_dir.obj)/,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(notdir $(srcs.cdi))))) + headers.cdi := $(foreach dir,$(include_dirs.cdi),$(wildcard $(dir)/*.h)) +-include_opts.cdi := $(foreach proj,cdi libfabric,$(addprefix -I,$(include_dirs.$(proj)))) ++include_opts.cdi := $(foreach proj,cdi,$(addprefix -I,$(include_dirs.$(proj)))) + depends.cdi := $(patsubst %.o,%.d,$(objs.cdi)) + + # the end goal of building the SDK library +@@ -186,24 +183,24 @@ headers.all := $(foreach dir,cdi test test_common test_min_tx test_min_rx test_u + # augment compiler flags + COMMON_COMPILER_FLAG_ADDITIONS := \ + $(include_opts.cdi) $(include_opts.test) \ +- $(EXTRA_COMPILER_FLAG_ADDITIONS) \ +- -Wall -Wextra -Werror -pthread -fPIC \ ++ -Wall -Wextra -pthread -fPIC \ + -D_LINUX -D_POSIX_C_SOURCE=200112L \ +- $(sanitize_opts) ++ $(sanitize_opts) \ ++ $(EXTRA_COMPILER_FLAG_ADDITIONS) + ifeq ($(config), debug) + COMMON_COMPILER_FLAG_ADDITIONS += -O0 -g -DDEBUG + else + COMMON_COMPILER_FLAG_ADDITIONS += -O3 -DNDEBUG + endif + +-CFLAGS += $(COMMON_COMPILER_FLAG_ADDITIONS) --std=c99 +-CXXFLAGS += $(COMMON_COMPILER_FLAG_ADDITIONS) --std=c++11 ++CFLAGS += $(CPPFLAGS) $(COMMON_COMPILER_FLAG_ADDITIONS) --std=c99 ++CXXFLAGS += $(CPPFLAGS) $(COMMON_COMPILER_FLAG_ADDITIONS) --std=c++11 + + # additional flags to pass to the linker to create cdi_test* programs + # The only libraries needed here are those that present new dependencies beyond what libcdisdk.so already requires. + # An rpath is specified so cdi_test can find libcdisdk.so.2 in the same directory as cdi_test or in a sibling directory + # named lib. +-CDI_LDFLAGS = $(LDFLAGS) -L$(build_dir.lib) -lcdisdk -lfabric $(EXTRA_LD_LIBS) -lncurses -lm $(aws_sdk_library_flags) \ ++CDI_LDFLAGS = $(LDFLAGS) -L$(build_dir.lib) -lcdisdk -lfabric $(EXTRA_LD_LIBS) -lncurses -lm \ + -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../lib64:\$$ORIGIN/../lib + + # docs go into the build directory but are not specific to release/debug +@@ -284,7 +281,7 @@ vpath %.c $(foreach proj,cdi common test test_common test_minimal test_unit,$(sr + vpath %.cpp $(src_dir.cdi) + + # rule to create the various build output directories +-$(foreach d,obj lib bin doc packages libfabric results image libaws,$(build_dir.$(d))) : ++$(foreach d,obj lib bin doc packages results image libaws,$(build_dir.$(d))) : + $(Q)mkdir -p $@ + + # Setup flags for libfabric depending on debug/release build target. +@@ -321,12 +318,10 @@ $(libfabric) : $(libfabric_config_h) | $(build_dir.lib) + # rule to create the SDK library file + .PHONY : libsdk + libsdk : $(libsdk) +-$(libsdk) : $(libfabric_config_h) $(objs.cdi) $(libfabric) $(libaws) | $(build_dir.lib) ++$(libsdk) : $(objs.cdi) | $(build_dir.lib) + @echo "GCC version is" $(GCCVERSION) + $(Q)$(CC) -shared -o $@ -Wl,-z,defs,-soname=$(basename $(notdir $@)),--version-script,libcdisdk.vers \ +- $(objs.cdi) -L$(build_dir.lib) $(aws_sdk_library_flags) \ +- -lfabric -ldl -lrt $(EXTRA_CC_LIBS) -lnl-3 -lm $(EXTRA_LD_LIBS) -lpthread -lc \ +- $(ASAN_LIBS) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../lib ++ $(objs.cdi) $(LDFLAGS) $(LIBS) + $(Q)ln -fs $@ $(basename $@) + $(Q)ln -fs $@ $(basename $(basename $@)) + +@@ -432,13 +427,12 @@ clean :: + $(Q)$(RM) -r $(top.build) + + cleanall :: clean +- $(Q)$(RM) -r $(top.libfabric)/build $(libfabric_config_h) + +-$(depends.cdi) : $(libfabric_config_h) $(aws_h) ++$(depends.cdi) : $(aws_h) + + # include dependency rules from generated files; this is conditional so .d files are only created if needed. + ifneq ($(real_build_goals),) +--include $(foreach proj,cdi test test_min_tx test_min_rx test_unit,$(depends.$(proj))) ++-include $(foreach proj,$(real_build_goals),$(depends.$(proj))) + endif + + # Users can add their own rules to this makefile by creating a makefile in this directory called diff --git a/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt b/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d207864c9df26 --- /dev/null +++ b/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(aws-cdi-sdk REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} AWS::aws-cdi-sdk) diff --git a/recipes/aws-cdi-sdk/all/test_package/conanfile.py b/recipes/aws-cdi-sdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/aws-cdi-sdk/all/test_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/aws-cdi-sdk/all/test_package/test_package.c b/recipes/aws-cdi-sdk/all/test_package/test_package.c new file mode 100644 index 0000000000000..e6b8b0eada16b --- /dev/null +++ b/recipes/aws-cdi-sdk/all/test_package/test_package.c @@ -0,0 +1,16 @@ +/* example was taken from https://www.gnu.org/ghm/2011/paris/slides/andreas-enge-mpc.pdf */ + +#include +#include +#include + +int main () { + CdiLoggerInitialize(); // Intialize logger so we can use the CDI_LOG_THREAD() macro to generate console messages. + + CDI_LOG_THREAD(kLogInfo, "CDI SDK Version: %d.%d.%d\n", CDI_SDK_VERSION, CDI_SDK_MAJOR_VERSION, + CDI_SDK_MINOR_VERSION); + + CdiLoggerShutdown(false); + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-cdi-sdk/config.yml b/recipes/aws-cdi-sdk/config.yml new file mode 100644 index 0000000000000..1979b3114ab95 --- /dev/null +++ b/recipes/aws-cdi-sdk/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.0": + folder: all diff --git a/recipes/aws-checksums/all/conandata.yml b/recipes/aws-checksums/all/conandata.yml new file mode 100644 index 0000000000000..ddf66e3fcf5ae --- /dev/null +++ b/recipes/aws-checksums/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "0.1.13": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.13.tar.gz" + sha256: "0f897686f1963253c5069a0e495b85c31635ba146cd3ac38cc2ea31eaf54694d" + "0.1.12": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.12.tar.gz" + sha256: "394723034b81cc7cd528401775bc7aca2b12c7471c92350c80a0e2fb9d2909fe" + "0.1.11": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.11.tar.gz" + sha256: "9312e305428655bcea1f81524c3a8f617ce5299b903187047078929e850fb6d4" + "0.1.5": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz" + sha256: "6e6bed6f75cf54006b6bafb01b3b96df19605572131a2260fddaf0e87949ced0" +patches: + "0.1.5": + - patch_file: "patches/0001-use-PROJECT_SOURCE_DIR.patch" + - patch_file: "patches/0002-disable-overriding-fPIC.patch" + - patch_file: "patches/0003-disable-building-tests.patch" diff --git a/recipes/aws-checksums/all/conanfile.py b/recipes/aws-checksums/all/conanfile.py new file mode 100644 index 0000000000000..80a0c88a8c55b --- /dev/null +++ b/recipes/aws-checksums/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AwsChecksums(ConanFile): + name = "aws-checksums" + description = ( + "Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient " + "SW implementations. C interface with language bindings for each of our SDKs." + ) + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-checksums" + topics = ("aws", "checksum", ) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("aws-c-common/0.8.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-checksums")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-checksums": "aws-checksums::aws-checksums"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-checksums") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-checksums") + self.cpp_info.libs = ["aws-checksums"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CHECKSUMS_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch b/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch new file mode 100644 index 0000000000000..9a309a9f74658 --- /dev/null +++ b/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch @@ -0,0 +1,41 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -98,7 +98,7 @@ + target_compile_definitions(aws-checksums PRIVATE "-DDEBUG_BUILD") + endif() + +-target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ++target_include_directories(${PROJECT_NAME} PUBLIC + $ + $) + +@@ -129,7 +129,7 @@ + endif() + + install(FILES ${AWS_CHECKSUMS_HEADERS} DESTINATION "include/aws/checksums") +-aws_prepare_shared_lib_exports(${CMAKE_PROJECT_NAME}) ++aws_prepare_shared_lib_exports(${PROJECT_NAME}) + + if (BUILD_SHARED_LIBS) + set (TARGET_DIR "shared") +@@ -137,14 +137,14 @@ + set (TARGET_DIR "static") + endif() + +-install(EXPORT "${CMAKE_PROJECT_NAME}-targets" +- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/" ++install(EXPORT "${PROJECT_NAME}-targets" ++ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/${TARGET_DIR}/" + NAMESPACE AWS::) + +-configure_file("cmake/${CMAKE_PROJECT_NAME}-config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" ++configure_file("cmake/${PROJECT_NAME}-config.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + @ONLY) + +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" +- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/") ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" ++ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/") + diff --git a/recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch b/recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch new file mode 100644 index 0000000000000..31249bcf0671b --- /dev/null +++ b/recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -83,9 +83,9 @@ + target_compile_definitions(aws-checksums PRIVATE "-DAWS_CHECKSUMS_EXPORTS") + endif() + +-if(NOT MSVC) +- target_compile_options(aws-checksums PRIVATE -fPIC) +-endif() ++#if(NOT MSVC) ++# target_compile_options(aws-checksums PRIVATE -fPIC) ++#endif() + + if(BUILD_JNI_BINDINGS) + find_package(JNI) diff --git a/recipes/aws-checksums/all/patches/0003-disable-building-tests.patch b/recipes/aws-checksums/all/patches/0003-disable-building-tests.patch new file mode 100644 index 0000000000000..f62f7e4733e64 --- /dev/null +++ b/recipes/aws-checksums/all/patches/0003-disable-building-tests.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -109,7 +109,7 @@ + file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC}) + + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tests) +-add_executable(aws-checksums-tests ${TESTS}) ++add_executable(aws-checksums-tests EXCLUDE_FROM_ALL ${TESTS}) + target_compile_options(aws-checksums-tests PRIVATE ${_FLAGS}) + target_link_libraries(aws-checksums-tests aws-checksums) + set_target_properties(aws-checksums-tests PROPERTIES LINKER_LANGUAGE C) diff --git a/recipes/aws-checksums/all/test_package/CMakeLists.txt b/recipes/aws-checksums/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9922744f24e3f --- /dev/null +++ b/recipes/aws-checksums/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-checksums REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-checksums) diff --git a/recipes/aws-checksums/all/test_package/conanfile.py b/recipes/aws-checksums/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/aws-checksums/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/aws-checksums/all/test_package/test_package.c b/recipes/aws-checksums/all/test_package/test_package.c new file mode 100644 index 0000000000000..773c9b3e1f5b7 --- /dev/null +++ b/recipes/aws-checksums/all/test_package/test_package.c @@ -0,0 +1,39 @@ +#include + +#include +#include + +#define LOG_LEVEL AWS_LOG_LEVEL_TRACE + + +static int fill(uint8_t *buffer, size_t size) { + size_t i; + for(i = 0; i < size; ++i) { + buffer[i] = i; + } +} + +/** + * reference: + * import binascii + * hex(binascii.crc32(b''.join(binascii.a2b_hex('{:02x}'.format(i)) for i in range(128))) + */ + +#define CRC32_REF 0x24650d57 + +int main() { + int crc32; + uint8_t buffer[128]; + fill(buffer, sizeof(buffer)); + crc32 = aws_checksums_crc32(buffer, sizeof(buffer), 0x0); + + printf("reference crc32: 0x%8x\n", CRC32_REF); + printf("calculated crc32: 0x%8x\n", crc32); + + if (crc32 != CRC32_REF) { + printf("MISMATCH\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-checksums/all/test_v1_package/conanfile.py b/recipes/aws-checksums/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aws-checksums/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/aws-checksums/config.yml b/recipes/aws-checksums/config.yml new file mode 100644 index 0000000000000..55fedf4c307f5 --- /dev/null +++ b/recipes/aws-checksums/config.yml @@ -0,0 +1,9 @@ +versions: + "0.1.13": + folder: all + "0.1.12": + folder: all + "0.1.11": + folder: all + "0.1.5": + folder: all diff --git a/recipes/aws-crt-cpp/all/conandata.yml b/recipes/aws-crt-cpp/all/conandata.yml new file mode 100644 index 0000000000000..5615e65f10a0b --- /dev/null +++ b/recipes/aws-crt-cpp/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "0.18.8": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.18.8.tar.gz" + sha256: "70ea622cf8c1a7028b24078e909ee5898990444436584178f58d61b50b5b197d" + "0.17.23": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.23.tar.gz" + sha256: "28061c3efa493519cfae46e4ea96389f03a81eeec7613d7da861dd8c5f4f6598" + "0.17.12": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.12.tar.gz" + sha256: "acdd8b83198c5a471f92702bc4101828fe55361005764143704c39acd6f80ffc" + "0.14.3": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.14.3.tar.gz" + sha256: "3ea16c43e691bab0c373ba1ad072f6535390c516ebda658dfaf4d074d920e0fb" +patches: + "0.18.8": + - patch_file: "patches/0.17.23-fix-cast-error.patch" + patch_description: "fix const cast error" + patch_type: "portability" + "0.17.23": + - patch_file: "patches/0.17.23-fix-cast-error.patch" + patch_description: "fix const cast error" + patch_type: "portability" + "0.17.12": + - patch_file: "patches/0.17.12-fix-cast-error.patch" + patch_description: "fix const cast error" + patch_type: "portability" diff --git a/recipes/aws-crt-cpp/all/conanfile.py b/recipes/aws-crt-cpp/all/conanfile.py new file mode 100644 index 0000000000000..0b0f3153a2863 --- /dev/null +++ b/recipes/aws-crt-cpp/all/conanfile.py @@ -0,0 +1,116 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + + +class AwsCrtCpp(ConanFile): + name = "aws-crt-cpp" + description = "C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++." + license = "Apache-2.0", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-crt-cpp" + topics = ("aws", "amazon", "cloud", "wrapper") + 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 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("aws-c-common/0.8.2") + self.requires("aws-checksums/0.1.13") + if Version(self.version) < "0.17.29": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + self.requires("aws-c-auth/0.6.11") + self.requires("aws-c-s3/0.1.37") + self.requires("aws-c-mqtt/0.7.10") + self.requires("aws-c-event-stream/0.2.7") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + self.requires("aws-c-auth/0.6.17") + self.requires("aws-c-s3/0.1.49") + self.requires("aws-c-mqtt/0.7.12") + self.requires("aws-c-event-stream/0.2.15") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DEPS"] = 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-crt-cpp")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-crt-cpp") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-crt-cpp") + + self.cpp_info.components["aws-crt-cpp-lib"].names["cmake_find_package"] = "aws-crt-cpp" + self.cpp_info.components["aws-crt-cpp-lib"].names["cmake_find_package_multi"] = "aws-crt-cpp" + self.cpp_info.components["aws-crt-cpp-lib"].libs = ["aws-crt-cpp"] + self.cpp_info.components["aws-crt-cpp-lib"].requires = [ + "aws-c-event-stream::aws-c-event-stream-lib", + "aws-c-common::aws-c-common-lib", + "aws-c-io::aws-c-io-lib", + "aws-c-http::aws-c-http-lib", + "aws-c-auth::aws-c-auth-lib", + "aws-c-mqtt::aws-c-mqtt-lib", + "aws-c-s3::aws-c-s3-lib", + "aws-checksums::aws-checksums-lib" + ] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "aws-crt-cpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-crt-cpp" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" diff --git a/recipes/aws-crt-cpp/all/patches/0.17.12-fix-cast-error.patch b/recipes/aws-crt-cpp/all/patches/0.17.12-fix-cast-error.patch new file mode 100644 index 0000000000000..be886c030a52c --- /dev/null +++ b/recipes/aws-crt-cpp/all/patches/0.17.12-fix-cast-error.patch @@ -0,0 +1,13 @@ +diff --git a/source/io/TlsOptions.cpp b/source/io/TlsOptions.cpp +index 9f9f8cf..e9913ef 100644 +--- a/source/io/TlsOptions.cpp ++++ b/source/io/TlsOptions.cpp +@@ -216,7 +216,7 @@ namespace Aws + + if (m_slotId) + { +- options.slot_id = &(*m_slotId); ++ options.slot_id = const_cast(&(*m_slotId)); + } + + if (m_userPin) diff --git a/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch b/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch new file mode 100644 index 0000000000000..676d3a87fbac2 --- /dev/null +++ b/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch @@ -0,0 +1,13 @@ +diff --git a/source/io/TlsOptions.cpp b/source/io/TlsOptions.cpp +index 3018e4c..eb5e129 100644 +--- a/source/io/TlsOptions.cpp ++++ b/source/io/TlsOptions.cpp +@@ -213,7 +213,7 @@ namespace Aws + + if (m_slotId) + { +- options.slot_id = &(*m_slotId); ++ options.slot_id = const_cast(&(*m_slotId)); + } + + if (m_userPin) diff --git a/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt b/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..50b34b056a787 --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(aws-crt-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aws-crt-cpp/all/test_package/conanfile.py b/recipes/aws-crt-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-crt-cpp/all/test_package/test_package.cpp b/recipes/aws-crt-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..16c00751ddda3 --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + Aws::Crt::HashString("test"); + + return 0; +} diff --git a/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py b/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-crt-cpp/config.yml b/recipes/aws-crt-cpp/config.yml new file mode 100644 index 0000000000000..a2a8f6922a602 --- /dev/null +++ b/recipes/aws-crt-cpp/config.yml @@ -0,0 +1,9 @@ +versions: + "0.18.8": + folder: all + "0.17.23": + folder: all + "0.17.12": + folder: all + "0.14.3": + folder: all diff --git a/recipes/aws-kvs-pic/all/CMakeLists.txt b/recipes/aws-kvs-pic/all/CMakeLists.txt new file mode 100644 index 0000000000000..6abb33ac667b0 --- /dev/null +++ b/recipes/aws-kvs-pic/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/aws-kvs-pic/all/conandata.yml b/recipes/aws-kvs-pic/all/conandata.yml new file mode 100644 index 0000000000000..3e715c5477031 --- /dev/null +++ b/recipes/aws-kvs-pic/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20210812": + url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/bbf0e4ba749a6c045fc3958951c1c3a61a808dd0.tar.gz" + sha256: "5a6d8da62af766ec86423ead2a45d9ff00cd80ddea679ce228ff9696a490fae5" +patches: + "cci.20210812": + - base_path: "source_subfolder" + patch_file: "patches/0001-do-not-enforce-fpic.patch" diff --git a/recipes/aws-kvs-pic/all/conanfile.py b/recipes/aws-kvs-pic/all/conanfile.py new file mode 100644 index 0000000000000..3cdebbedda863 --- /dev/null +++ b/recipes/aws-kvs-pic/all/conanfile.py @@ -0,0 +1,76 @@ +import os +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class awskvspicConan(ConanFile): + name = "aws-kvs-pic" + license = "Apache-2.0" + homepage = "https://github.com/awslabs/amazon-kinesis-video-streams-pic" + url = "https://github.com/conan-io/conan-center-index" + description = ("Platform Independent Code for Amazon Kinesis Video Streams") + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {'shared': False, "fPIC": True} + generators = "cmake" + topics = ("aws", "kvs", "kinesis", "video", "stream") + exports_sources = ["CMakeLists.txt", "patches/*"] + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["BUILD_DEPENDENCIES"] = False + self._cmake.configure() + return self._cmake + + def validate(self): + if (self.settings.os != "Linux" and self.options.shared): + raise ConanInvalidConfiguration("This library can only be built shared on Linux") + + 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 + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", 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.components["kvspic"].libs = ["kvspic"] + self.cpp_info.components["kvspic"].names["pkg_config"] = "libkvspic" + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["kvspic"].system_libs = ["dl", "rt", "pthread"] + + self.cpp_info.components["kvspicClient"].libs = ["kvspicClient"] + self.cpp_info.components["kvspicClient"].names["pkg_config"] = "libkvspicClient" + + self.cpp_info.components["kvspicState"].libs = ["kvspicState"] + self.cpp_info.components["kvspicState"].names["pkg_config"] = "libkvspicState" + + self.cpp_info.components["kvspicUtils"].libs = ["kvspicUtils"] + self.cpp_info.components["kvspicUtils"].names["pkg_config"] = "libkvspicUtils" + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["kvspicUtils"].system_libs = ["dl", "rt", "pthread"] diff --git a/recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch b/recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch new file mode 100644 index 0000000000000..0286a964caa2c --- /dev/null +++ b/recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2021-08-06 17:10:31.808434572 -0300 ++++ b/CMakeLists.txt 2021-08-06 17:10:31.888434646 -0300 +@@ -79,7 +79,7 @@ + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") ++ + + if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING) diff --git a/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt b/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dbfb3fd9c7861 --- /dev/null +++ b/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(LIBKVSPIC REQUIRED IMPORTED_TARGET libkvspic) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PkgConfig::LIBKVSPIC) diff --git a/recipes/aws-kvs-pic/all/test_package/conanfile.py b/recipes/aws-kvs-pic/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6fdab74d20c22 --- /dev/null +++ b/recipes/aws-kvs-pic/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + + 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/aws-kvs-pic/all/test_package/test_package.c b/recipes/aws-kvs-pic/all/test_package/test_package.c new file mode 100644 index 0000000000000..fe89810597779 --- /dev/null +++ b/recipes/aws-kvs-pic/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include "com/amazonaws/kinesis/video/client/Include.h" + +int main(int argc, char *argv[]) +{ + + CLIENT_HANDLE clientHandle = INVALID_CLIENT_HANDLE_VALUE; + PDeviceInfo pDeviceInfo = NULL; + PClientCallbacks pClientCallbacks = NULL; + + createKinesisVideoClient(pDeviceInfo, pClientCallbacks, &clientHandle); + + printf("aws-kps-pic test_package ran successfully \n"); + + return 0; +} diff --git a/recipes/aws-kvs-pic/config.yml b/recipes/aws-kvs-pic/config.yml new file mode 100644 index 0000000000000..e6b575a028845 --- /dev/null +++ b/recipes/aws-kvs-pic/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210812": + folder: all diff --git a/recipes/aws-libfabric/all/conandata.yml b/recipes/aws-libfabric/all/conandata.yml new file mode 100644 index 0000000000000..7836777b3aad7 --- /dev/null +++ b/recipes/aws-libfabric/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.9.1amzncdi1.0": + url: https://github.com/aws/libfabric/archive/refs/tags/1.9.1amzncdi1.0.tar.gz + sha256: 714935292fb85a6edad4f3824cc23e46d18ba0a65ba5e292b6378440e8293ce7 diff --git a/recipes/aws-libfabric/all/conanfile.py b/recipes/aws-libfabric/all/conanfile.py new file mode 100644 index 0000000000000..134b19e72fb91 --- /dev/null +++ b/recipes/aws-libfabric/all/conanfile.py @@ -0,0 +1,116 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.35.0" + +class LibfabricConan(ConanFile): + name = "aws-libfabric" + description = "AWS Libfabric" + topics = ("fabric", "communication", "framework", "service") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aws/libfabric" + license = "BSD-2-Clause", "GPL-2.0-or-later" + settings = "os", "arch", "compiler", "build_type" + _providers = ["gni", "psm", "psm2", "sockets", "rxm", "tcp", "udp", "usnic", "verbs", "bgq", "shm", "efa", "rxd", "mrail", "rstream", "perf", "hook_debug"] + options = { + **{ p: [True, False, "shared"] for p in _providers }, + **{ + "shared": [True, False], + "fPIC": [True, False], + "with_libnl": [True, False], + "bgq_progress": ["auto", "manual"], + "bgq_mr": ["basic", "scalable"] + } + } + default_options = { + **{ p: False for p in _providers }, + **{ + "shared": False, + "fPIC": True, + "tcp": True, + "with_libnl": False, + "bgq_progress": "manual", + "bgq_mr": "basic" + } + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + _autotools = None + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + elif self.settings.os == "Linux": + self.options.efa = True + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_libnl: + self.requires("libnl/3.2.25") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("The libfabric package cannot be built on Windows.") + + 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) + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + + yes_no_dl = lambda v: {"True": "yes", "False": "no", "shared": "dl"}[str(v)] + 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-bgq-progress={}".format(self.options.bgq_progress), + "--with-bgq-mr={}".format(self.options.bgq_mr), + ] + for p in self._providers: + args.append("--enable-{}={}".format(p, yes_no_dl(getattr(self.options, p)))) + if self.options.with_libnl: + args.append("--with-libnl={}".format(tools.unix_path(self.deps_cpp_info["libnl"].rootpath))), + else: + args.append("--with-libnl=no") + if self.settings.build_type == "Debug": + args.append("--enable-debug") + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libfabric" + self.cpp_info.libs = self.collect_libs() + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "m"] + if not self.options.shared: + self.cpp_info.system_libs.extend(["dl", "rt"]) diff --git a/recipes/aws-libfabric/all/test_package/CMakeLists.txt b/recipes/aws-libfabric/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/aws-libfabric/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/aws-libfabric/all/test_package/conanfile.py b/recipes/aws-libfabric/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/aws-libfabric/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-libfabric/all/test_package/test_package.c b/recipes/aws-libfabric/all/test_package/test_package.c new file mode 100644 index 0000000000000..36566af74b311 --- /dev/null +++ b/recipes/aws-libfabric/all/test_package/test_package.c @@ -0,0 +1,11 @@ +/* example was taken from https://www.gnu.org/ghm/2011/paris/slides/andreas-enge-mpc.pdf */ + +#include +#include +#include + +int main () { + const uint32_t version = fi_version(); + printf("hello libfabric version %d.%d\n", FI_MAJOR(version), FI_MINOR(version)); + return EXIT_SUCCESS; +} diff --git a/recipes/aws-libfabric/config.yml b/recipes/aws-libfabric/config.yml new file mode 100644 index 0000000000000..f256ec26c29cc --- /dev/null +++ b/recipes/aws-libfabric/config.yml @@ -0,0 +1,3 @@ +versions: + "1.9.1amzncdi1.0": + folder: all diff --git a/recipes/aws-sdk-cpp/all/CMakeLists.txt b/recipes/aws-sdk-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..d19ff91050d95 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(MSVC) + add_definitions(-D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/aws-sdk-cpp/all/conandata.yml b/recipes/aws-sdk-cpp/all/conandata.yml new file mode 100644 index 0000000000000..8abd96ad2e0be --- /dev/null +++ b/recipes/aws-sdk-cpp/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "1.9.234": + url: "https://github.com/aws/aws-sdk-cpp/archive/1.9.234.tar.gz" + sha256: "52e36cf568fe0b2a0fc82a9333c0b31ba843db16670f4ccbb7b9fd142f1b00a5" + "1.9.100": + url: "https://github.com/aws/aws-sdk-cpp/archive/1.9.100.tar.gz" + sha256: "f0930d14ec92b9ddf1e3c966d9a3fe70d2a01b80e79e3e76da78d108bb81e5c4" + "1.8.130": + url: "https://github.com/aws/aws-sdk-cpp/archive/1.8.130.tar.gz" + sha256: "5dd09baa28d3f6f4fb03fbba1a4269724d79bcca3d47752cd3e15caf97276bda" +patches: + "1.9.234": + - base_path: source_subfolder + patch_file: patches/1.9.234-0001-issue-1816.patch + - base_path: source_subfolder + patch_file: patches/1.9.234-0002-disable-sort-links.patch + - base_path: source_subfolder + patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + "1.9.100": + - base_path: source_subfolder + patch_file: patches/1.9.100-0001-disable-sort-links.patch + - base_path: source_subfolder + patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - base_path: source_subfolder + patch_file: patches/1.9.100-0003-issue-1816.patch + "1.8.130": + - base_path: source_subfolder + patch_file: patches/1.8.130-0001-disable-sort-links.patch + - base_path: source_subfolder + patch_file: patches/1.8.130-0002-force-archive-directory-to-library-directory.patch + - base_path: source_subfolder + patch_file: patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch + - base_path: source_subfolder + patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch + - base_path: source_subfolder + patch_file: patches/1.8.130-0005-aws-plugin-conf.patch + - base_path: source_subfolder + patch_file: patches/1.8.130-0006-issue-1816.patch diff --git a/recipes/aws-sdk-cpp/all/conanfile.py b/recipes/aws-sdk-cpp/all/conanfile.py new file mode 100644 index 0000000000000..91c2066868882 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/conanfile.py @@ -0,0 +1,553 @@ +import os + +from conan.tools.files import rename +from conan.tools.microsoft import msvc_runtime_flag +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + + +class AwsSdkCppConan(ConanFile): + name = "aws-sdk-cpp" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aws/aws-sdk-cpp" + description = "AWS SDK for C++" + topics = ("aws", "cpp", "cross-platform", "amazon", "cloud") + + settings = "os", "arch", "compiler", "build_type" + _sdks = ( + "access-management", + "accessanalyzer", + "acm", + "acm-pca", + "alexaforbusiness", + "amp", + "amplify", + "amplifybackend", + "apigateway", + "apigatewaymanagementapi", + "apigatewayv2", + "appconfig", + "appflow", + "appintegrations", + "application-autoscaling", + "application-insights", + "appmesh", + "appstream", + "appsync", + "athena", + "auditmanager", + "autoscaling", + "autoscaling-plans", + "awstransfer", + "backup", + "batch", + "braket", + "budgets", + "ce", + "chime", + "cloud9", + "clouddirectory", + "cloudformation", + "cloudfront", + "cloudhsm", + "cloudhsmv2", + "cloudsearch", + "cloudsearchdomain", + "cloudtrail", + "codeartifact", + "codebuild", + "codecommit", + "codedeploy", + "codeguru-reviewer", + "codeguruprofiler", + "codepipeline", + "codestar", + "codestar-connections", + "codestar-notifications", + "cognito-identity", + "cognito-idp", + "cognito-sync", + "comprehend", + "comprehendmedical", + "compute-optimizer", + "config", + "connect", + "connect-contact-lens", + "connectparticipant", + "cur", + "customer-profiles", + "databrew", + "dataexchange", + "datapipeline", + "datasync", + "dax", + "detective", + "devicefarm", + "devops-guru", + "directconnect", + "discovery", + "dlm", + "dms", + "docdb", + "ds", + "dynamodb", + "dynamodbstreams", + "ebs", + "ec2", + "ec2-instance-connect", + "ecr", + "ecr-public", + "ecs", + "eks", + "elastic-inference", + "elasticache", + "elasticbeanstalk", + "elasticfilesystem", + "elasticloadbalancing", + "elasticloadbalancingv2", + "elasticmapreduce", + "elastictranscoder", + "email", + "emr-containers", + "es", + "eventbridge", + "events", + "firehose", + "fms", + "forecast", + "forecastquery", + "frauddetector", + "fsx", + "gamelift", + "glacier", + "globalaccelerator", + "glue", + "greengrass", + "greengrassv2", + "groundstation", + "guardduty", + "health", + "healthlake", + "honeycode", + "iam", + "identity-management", + "identitystore", + "imagebuilder", + "importexport", + "inspector", + "iot", + "iot-data", + "iot-jobs-data", + "iot1click-devices", + "iot1click-projects", + "iotanalytics", + "iotdeviceadvisor", + "iotevents", + "iotevents-data", + "iotfleethub", + "iotsecuretunneling", + "iotsitewise", + "iotthingsgraph", + "iotwireless", + "ivs", + "kafka", + "kendra", + "kinesis", + "kinesis-video-archived-media", + "kinesis-video-media", + "kinesis-video-signaling", + "kinesisanalytics", + "kinesisanalyticsv2", + "kinesisvideo", + "kms", + "lakeformation", + "lambda", + "lex", + "lex-models", + "lexv2-models", + "lexv2-runtime", + "license-manager", + "lightsail", + "location", + "logs", + "lookoutvision", + "machinelearning", + "macie", + "macie2", + "managedblockchain", + "marketplace-catalog", + "marketplace-entitlement", + "marketplacecommerceanalytics", + "mediaconnect", + "mediaconvert", + "medialive", + "mediapackage", + "mediapackage-vod", + "mediastore", + "mediastore-data", + "mediatailor", + "meteringmarketplace", + "migrationhub-config", + "mobile", + "mobileanalytics", + "monitoring", + "mq", + "mturk-requester", + "mwaa", + "neptune", + "network-firewall", + "networkmanager", + "opsworks", + "opsworkscm", + "organizations", + "outposts", + "personalize", + "personalize-events", + "personalize-runtime", + "pi", + "pinpoint", + "pinpoint-email", + "polly", + "polly-sample", + "pricing", + "qldb", + "qldb-session", + "queues", + "quicksight", + "ram", + "rds", + "rds-data", + "redshift", + "redshift-data", + "rekognition", + "resource-groups", + "resourcegroupstaggingapi", + "robomaker", + "route53", + "route53domains", + "route53resolver", + "s3", + "s3-crt", + "s3-encryption", + "s3control", + "s3outposts", + "sagemaker", + "sagemaker-a2i-runtime", + "sagemaker-edge", + "sagemaker-featurestore-runtime", + "sagemaker-runtime", + "savingsplans", + "schemas", + "sdb", + "secretsmanager", + "securityhub", + "serverlessrepo", + "service-quotas", + "servicecatalog", + "servicecatalog-appregistry", + "servicediscovery", + "sesv2", + "shield", + "signer", + "sms", + "sms-voice", + "snowball", + "sns", + "sqs", + "ssm", + "sso", + "sso-admin", + "sso-oidc", + "states", + "storagegateway", + "sts", + "support", + "swf", + "synthetics", + "text-to-speech", + "textract", + "timestream-query", + "timestream-write", + "transcribe", + "transcribestreaming", + "transfer", + "translate", + "waf", + "waf-regional", + "wafv2", + "wellarchitected", + "workdocs", + "worklink", + "workmail", + "workmailmessageflow", + "workspaces", + "xray", + ) + options = { + **{ + "shared": [True, False], + "fPIC": [True, False], + "min_size": [True, False], + }, + **{ x: [True, False] for x in _sdks}, + } + default_options = {key: False for key in options.keys()} + default_options["fPIC"] = True + default_options["access-management"] = True + default_options["identity-management"] = True + default_options["monitoring"] = True + default_options["queues"] = True + default_options["s3-encryption"] = True + default_options["transfer"] = True + default_options["text-to-speech"] = True + + generators = "cmake", "cmake_find_package" + short_paths = True + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + @property + def _internal_requirements(self): + return { + "access-management": ["iam", "cognito-identity"], + "identity-management": ["cognito-identity", "sts"], + "queues": ["sqs"], + "s3-encryption": ["s3", "kms"], + "text-to-speech": ["polly"], + "transfer": ["s3"], + } + + @property + def _use_aws_crt_cpp(self): + return tools.Version(self.version) >= "1.9" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if tools.Version(self.version) < "1.9": + delattr(self.options, "s3-crt") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("aws-c-common/0.6.19") + if self._use_aws_crt_cpp: + self.requires("aws-c-cal/0.5.13") + self.requires("aws-c-http/0.6.13") + self.requires("aws-c-io/0.10.20") + self.requires("aws-crt-cpp/0.17.23") + else: + self.requires("aws-c-event-stream/0.2.7") + if self.settings.os != "Windows": + self.requires("openssl/1.1.1n") + self.requires("libcurl/7.80.0") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.get_safe("text-to-speech"): + self.requires("pulseaudio/14.2") + + def validate(self): + if (self.options.shared + and self.settings.compiler == "gcc" + and tools.Version(self.settings.compiler.version) < "6.0"): + raise ConanInvalidConfiguration( + "Doesn't support gcc5 / shared. " + "See https://github.com/conan-io/conan-center-index/pull/4401#issuecomment-802631744" + ) + if (tools.Version(self.version) < "1.9.234" + and self.settings.compiler == "gcc" + and tools.Version(self.settings.compiler.version) >= "11.0" + and self.settings.build_type == "Release"): + raise ConanInvalidConfiguration( + "Versions prior to 1.9.234 don't support release builds on >= gcc 11 " + "See https://github.com/aws/aws-sdk-cpp/issues/1505" + ) + if self._use_aws_crt_cpp: + if self._is_msvc and "MT" in msvc_runtime_flag(self): + raise ConanInvalidConfiguration("Static runtime is not working for more recent releases") + else: + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration( + "This version doesn't support arm8. " + "See https://github.com/aws/aws-sdk-cpp/issues/1542" + ) + + def package_id(self): + for hl_comp in self._internal_requirements.keys(): + if getattr(self.options, hl_comp): + for internal_requirement in self._internal_requirements[hl_comp]: + setattr(self.info.options, internal_requirement, True) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + build_only = ["core"] + for sdk in self._sdks: + if self.options.get_safe(sdk): + build_only.append(sdk) + self._cmake.definitions["BUILD_ONLY"] = ";".join(build_only) + + self._cmake.definitions["ENABLE_UNITY_BUILD"] = True + self._cmake.definitions["ENABLE_TESTING"] = False + self._cmake.definitions["AUTORUN_UNIT_TESTS"] = False + self._cmake.definitions["BUILD_DEPS"] = False + if self.settings.os != "Windows": + self._cmake.definitions["ENABLE_OPENSSL_ENCRYPTION"] = True + + self._cmake.definitions["MINIMIZE_SIZE"] = self.options.min_size + if self._is_msvc and not self._use_aws_crt_cpp: + self._cmake.definitions["FORCE_SHARED_CRT"] = "MD" in msvc_runtime_flag(self) + + if tools.cross_building(self): + self._cmake.definitions["CURL_HAS_H2_EXITCODE"] = "0" + self._cmake.definitions["CURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT"] = "" + self._cmake.definitions["CURL_HAS_TLS_PROXY_EXITCODE"] = "0" + self._cmake.definitions["CURL_HAS_TLS_PROXY_EXITCODE__TRYRUN_OUTPUT"] = "" + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + @property + def _res_folder(self): + return "res" + + def _create_project_cmake_module(self): + # package files needed to build other components (e.g. aws-cdi-sdk) with this SDK + for file in [ + "cmake/compiler_settings.cmake", + "cmake/initialize_project_version.cmake", + "cmake/utilities.cmake", + "cmake/sdk_plugin_conf.cmake", + "toolchains/cmakeProjectConfig.cmake", + "toolchains/pkg-config.pc.in", + "aws-cpp-sdk-core/include/aws/core/VersionConfig.h" + ]: + self.copy(file, src=self._source_subfolder, dst=self._res_folder) + tools.replace_in_file(os.path.join(self.package_folder, self._res_folder, file), "CMAKE_CURRENT_SOURCE_DIR", "AWS_NATIVE_SDK_ROOT", strict=False) + + # avoid getting error from hook + with tools.chdir(os.path.join(self.package_folder, self._res_folder)): + rename(self, os.path.join("toolchains", "cmakeProjectConfig.cmake"), os.path.join("toolchains", "cmakeProjectConf.cmake")) + tools.replace_in_file(os.path.join("cmake", "utilities.cmake"), "cmakeProjectConfig.cmake", "cmakeProjectConf.cmake") + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + if self._is_msvc: + self.copy(pattern="*.lib", dst="lib", keep_path=False) + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.lib") + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + self._create_project_cmake_module() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "AWSSDK") + + # core component + self.cpp_info.components["core"].set_property("cmake_target_name", "AWS::aws-sdk-cpp-core") + self.cpp_info.components["core"].set_property("pkg_config_name", "aws-sdk-cpp-core") + self.cpp_info.components["core"].libs = ["aws-cpp-sdk-core"] + self.cpp_info.components["core"].requires = ["aws-c-common::aws-c-common-lib"] + if self._use_aws_crt_cpp: + self.cpp_info.components["core"].requires.extend([ + "aws-c-cal::aws-c-cal-lib", + "aws-c-http::aws-c-http-lib", + "aws-c-io::aws-c-io-lib", + "aws-crt-cpp::aws-crt-cpp-lib", + ]) + else: + self.cpp_info.components["core"].requires.append("aws-c-event-stream::aws-c-event-stream-lib") + + # other components + enabled_sdks = [sdk for sdk in self._sdks if self.options.get_safe(sdk)] + for hl_comp in self._internal_requirements.keys(): + if getattr(self.options, hl_comp): + for internal_requirement in self._internal_requirements[hl_comp]: + if internal_requirement not in enabled_sdks: + enabled_sdks.append(internal_requirement) + + for sdk in enabled_sdks: + # TODO: there is no way to properly emulate COMPONENTS names for + # find_package(AWSSDK COMPONENTS ) in set_property() + # right now: see https://github.com/conan-io/conan/issues/10258 + self.cpp_info.components[sdk].set_property("cmake_target_name", "AWS::aws-sdk-cpp-{}".format(sdk)) + self.cpp_info.components[sdk].set_property("pkg_config_name", "aws-sdk-cpp-{}".format(sdk)) + self.cpp_info.components[sdk].requires = ["core"] + if sdk in self._internal_requirements: + self.cpp_info.components[sdk].requires.extend(self._internal_requirements[sdk]) + self.cpp_info.components[sdk].libs = ["aws-cpp-sdk-" + sdk] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components[sdk].names["cmake_find_package"] = "aws-sdk-cpp-" + sdk + self.cpp_info.components[sdk].names["cmake_find_package_multi"] = "aws-sdk-cpp-" + sdk + component_alias = "aws-sdk-cpp-{}_alias".format(sdk) # to emulate COMPONENTS names for find_package() + self.cpp_info.components[component_alias].names["cmake_find_package"] = sdk + self.cpp_info.components[component_alias].names["cmake_find_package_multi"] = sdk + self.cpp_info.components[component_alias].requires = [sdk] + + # specific system_libs, frameworks and requires of components + if self.settings.os == "Windows": + self.cpp_info.components["core"].system_libs.extend([ + "winhttp", "wininet", "bcrypt", "userenv", "version", "ws2_32" + ]) + if self.options.get_safe("text-to-speech"): + self.cpp_info.components["text-to-speech"].system_libs.append("winmm") + else: + self.cpp_info.components["core"].requires.extend(["libcurl::curl", "openssl::openssl"]) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["core"].system_libs.append("atomic") + if self.options.get_safe("text-to-speech"): + self.cpp_info.components["text-to-speech"].requires.append("pulseaudio::pulseaudio") + + if self.settings.os == "Macos": + if self.options.get_safe("text-to-speech"): + self.cpp_info.components["text-to-speech"].frameworks.append("CoreAudio") + + lib_stdcpp = tools.stdcpp_library(self) + if lib_stdcpp: + self.cpp_info.components["core"].system_libs.append(lib_stdcpp) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "AWSSDK" + self.cpp_info.filenames["cmake_find_package_multi"] = "AWSSDK" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["core"].names["cmake_find_package"] = "aws-sdk-cpp-core" + self.cpp_info.components["core"].names["cmake_find_package_multi"] = "aws-sdk-cpp-core" + + self.cpp_info.components["plugin_scripts"].requires = ["core"] + self.cpp_info.components["plugin_scripts"].builddirs.extend([ + os.path.join(self._res_folder, "cmake"), + os.path.join(self._res_folder, "toolchains")]) + self.cpp_info.components["plugin_scripts"].build_modules.append(os.path.join(self._res_folder, "cmake", "sdk_plugin_conf.cmake")) diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch new file mode 100644 index 0000000000000..bd8fbce5589dc --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/sdks.cmake b/cmake/sdks.cmake +index 975281faaa..ebedbcc6e5 100644 +--- a/cmake/sdks.cmake ++++ b/cmake/sdks.cmake +@@ -236,7 +236,7 @@ function(add_sdks) + + # the catch-all config needs to list all the targets in a dependency-sorted order + include(dependencies) +- sort_links(EXPORTS) ++ # sort_links(EXPORTS) + + # make an everything config by just including all the individual configs + file(WRITE ${CMAKE_BINARY_DIR}/aws-sdk-cpp-config.cmake "") diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch new file mode 100644 index 0000000000000..ae9310e5bb684 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a653e38628..6761052856 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -295,11 +295,7 @@ if (CMAKE_INSTALL_INCLUDEDIR) + set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") + endif() + +-if(BUILD_SHARED_LIBS) +- set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") +-else() +- set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") +-endif() ++set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") + + if (ENABLE_ADDRESS_SANITIZER) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g -fno-omit-frame-pointer") diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch new file mode 100644 index 0000000000000..6f85ba392127f --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a653e38628..4aac800fde 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -142,7 +142,7 @@ else() + endif() + + # Add Linker search paths to RPATH so as to fix the problem where some linkers can't find cross-compiled dependent libraries in customer paths when linking executables. +-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) ++# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) + + # build third-party targets + if (BUILD_DEPS) diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch new file mode 100644 index 0000000000000..5a47717a4552a --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch @@ -0,0 +1,30 @@ +diff --git a/aws-cpp-sdk-text-to-speech/CMakeLists.txt b/aws-cpp-sdk-text-to-speech/CMakeLists.txt +index b1054515d5..d1a34ddfc5 100644 +--- a/aws-cpp-sdk-text-to-speech/CMakeLists.txt ++++ b/aws-cpp-sdk-text-to-speech/CMakeLists.txt +@@ -9,8 +9,6 @@ file( GLOB TEXT_TO_SPEECH_HEADERS "include/aws/text-to-speech/*.h" ) + + set(PLATFORM_LIBS "") + +-check_include_files("pulse/simple.h" HAVE_PULSE) +- + if(PLATFORM_WINDOWS) + file( GLOB TEXT_TO_SPEECH_PLATFORM_HEADERS "include/aws/text-to-speech/windows/*.h" ) + file( GLOB TEXT_TO_SPEECH_PLATFORM_SOURCE "source/text-to-speech/windows/*.cpp" ) +@@ -20,13 +18,14 @@ if(PLATFORM_WINDOWS) + endif() + + if (PLATFORM_LINUX) +- if(HAVE_PULSE) ++ find_package(pulseaudio) ++ if (1) + file( GLOB TEXT_TO_SPEECH_PLATFORM_HEADERS "include/aws/text-to-speech/linux/*.h" ) + file( GLOB TEXT_TO_SPEECH_PLATFORM_SOURCE "source/text-to-speech/linux/*.cpp" ) + + message(STATUS "Pulse audio header files have been detected, included pulse audio as a possible sound driver implementation.") + add_definitions("-DPULSE") +- set(PLATFORM_LIBS ${PLATFORM_LIBS} pulse pulse-simple) ++ set(PLATFORM_LIBS ${PLATFORM_LIBS} "CONAN_PKG::pulseaudio") + else() + message(WARNING "We've detected that you are building on linux, but the header files for pulseaudio are not available.\ + If you are providing your own audio implementation or you will not be using the text-to-speech library, this is fine.\ diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch new file mode 100644 index 0000000000000..b3eccfe69cc45 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch @@ -0,0 +1,44 @@ +commit 1179cb040d6b9292d30eb7d444298cd286f9f574 +Author: dvirtz +Date: Tue Nov 16 21:38:45 2021 +0200 + + add a file to configure SDK plugins + +diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake +new file mode 100644 +index 0000000000..474ead75bd +--- /dev/null ++++ b/cmake/sdk_plugin_conf.cmake +@@ -0,0 +1,32 @@ ++get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) ++set(SIMPLE_INSTALL TRUE) ++ ++if (CMAKE_INSTALL_BINDIR) ++ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}") ++endif() ++ ++if (CMAKE_INSTALL_LIBDIR) ++ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") ++endif() ++ ++if (CMAKE_INSTALL_INCLUDEDIR) ++ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") ++endif() ++ ++if(BUILD_SHARED_LIBS) ++ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") ++else() ++ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") ++endif() ++ ++if(DEFINED CMAKE_CXX_STANDARD) ++ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD}) ++else() ++ set(STANDARD_DEFAULT "11") ++endif() ++set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.") ++ ++include(CMakePackageConfigHelpers) ++include(initialize_project_version) ++include(utilities) ++include(compiler_settings) diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch new file mode 100644 index 0000000000000..6abce1b705a47 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch @@ -0,0 +1,20 @@ +diff --git aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp +index c633f3fabe..abb1ab7332 100644 +--- aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp ++++ aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp +@@ -146,7 +146,6 @@ namespace Aws + AWS_LOGSTREAM_TRACE(CLASS_TAG, "Audio retrieved from Polly. " << result.GetContentType() << " with " + << result.GetRequestCharacters() << " characters syntesized"); + +- std::streamsize amountRead(0); + unsigned char buffer[BUFF_SIZE]; + + std::lock_guard m(m_driverLock); +@@ -159,7 +158,6 @@ namespace Aws + AWS_LOGSTREAM_TRACE(CLASS_TAG, "Writing " << read << " bytes to device."); + + successfullyPlayed = m_activeDriver->WriteBufferToDevice(buffer, (std::size_t)read); +- amountRead += read; + played = successfullyPlayed; + } + diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch b/recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch new file mode 100644 index 0000000000000..6e93f7675b327 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/sdks.cmake b/cmake/sdks.cmake +index 0ec9981ddf..d86a9f4874 100644 +--- a/cmake/sdks.cmake ++++ b/cmake/sdks.cmake +@@ -250,7 +250,7 @@ function(add_sdks) + + # the catch-all config needs to list all the targets in a dependency-sorted order + include(dependencies) +- sort_links(EXPORTS) ++ #sort_links(EXPORTS) + + # make an everything config by just including all the individual configs + file(WRITE ${CMAKE_BINARY_DIR}/aws-sdk-cpp-config.cmake "") diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.100-0002-aws-plugin-conf.patch b/recipes/aws-sdk-cpp/all/patches/1.9.100-0002-aws-plugin-conf.patch new file mode 100644 index 0000000000000..b3eccfe69cc45 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.9.100-0002-aws-plugin-conf.patch @@ -0,0 +1,44 @@ +commit 1179cb040d6b9292d30eb7d444298cd286f9f574 +Author: dvirtz +Date: Tue Nov 16 21:38:45 2021 +0200 + + add a file to configure SDK plugins + +diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake +new file mode 100644 +index 0000000000..474ead75bd +--- /dev/null ++++ b/cmake/sdk_plugin_conf.cmake +@@ -0,0 +1,32 @@ ++get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) ++set(SIMPLE_INSTALL TRUE) ++ ++if (CMAKE_INSTALL_BINDIR) ++ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}") ++endif() ++ ++if (CMAKE_INSTALL_LIBDIR) ++ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") ++endif() ++ ++if (CMAKE_INSTALL_INCLUDEDIR) ++ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") ++endif() ++ ++if(BUILD_SHARED_LIBS) ++ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") ++else() ++ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") ++endif() ++ ++if(DEFINED CMAKE_CXX_STANDARD) ++ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD}) ++else() ++ set(STANDARD_DEFAULT "11") ++endif() ++set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.") ++ ++include(CMakePackageConfigHelpers) ++include(initialize_project_version) ++include(utilities) ++include(compiler_settings) diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch b/recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch new file mode 100644 index 0000000000000..6abce1b705a47 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch @@ -0,0 +1,20 @@ +diff --git aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp +index c633f3fabe..abb1ab7332 100644 +--- aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp ++++ aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp +@@ -146,7 +146,6 @@ namespace Aws + AWS_LOGSTREAM_TRACE(CLASS_TAG, "Audio retrieved from Polly. " << result.GetContentType() << " with " + << result.GetRequestCharacters() << " characters syntesized"); + +- std::streamsize amountRead(0); + unsigned char buffer[BUFF_SIZE]; + + std::lock_guard m(m_driverLock); +@@ -159,7 +158,6 @@ namespace Aws + AWS_LOGSTREAM_TRACE(CLASS_TAG, "Writing " << read << " bytes to device."); + + successfullyPlayed = m_activeDriver->WriteBufferToDevice(buffer, (std::size_t)read); +- amountRead += read; + played = successfullyPlayed; + } + diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.234-0001-issue-1816.patch b/recipes/aws-sdk-cpp/all/patches/1.9.234-0001-issue-1816.patch new file mode 100644 index 0000000000000..9d0a2e810a0ee --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.9.234-0001-issue-1816.patch @@ -0,0 +1,21 @@ +# https://github.com/aws/aws-sdk-cpp/issues/1816 +diff --git aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp +index 82a298f5a4..f995fcfd4a 100644 +--- aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp ++++ aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp +@@ -152,7 +152,6 @@ namespace Aws + AWS_LOGSTREAM_TRACE(CLASS_TAG, "Audio retrieved from Polly. " << result.GetContentType() << " with " + << result.GetRequestCharacters() << " characters syntesized"); + +- std::streamsize amountRead(0); + unsigned char buffer[BUFF_SIZE]; + + std::lock_guard m(m_driverLock); +@@ -165,7 +164,6 @@ namespace Aws + AWS_LOGSTREAM_TRACE(CLASS_TAG, "Writing " << read << " bytes to device."); + + successfullyPlayed = m_activeDriver->WriteBufferToDevice(buffer, (std::size_t)read); +- amountRead += read; + played = successfullyPlayed; + } + diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.234-0002-disable-sort-links.patch b/recipes/aws-sdk-cpp/all/patches/1.9.234-0002-disable-sort-links.patch new file mode 100644 index 0000000000000..635bfcae92b8f --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.9.234-0002-disable-sort-links.patch @@ -0,0 +1,18 @@ +# Fix errors like below in older cmake versions: +# CMake Error at source_subfolder/cmake/dependencies.cmake:34 (get_target_property): +# INTERFACE_LIBRARY targets may only have whitelisted properties. The +# property "LINK_LIBRARIES_ALL" is not allowed. + +diff --git cmake/sdks.cmake cmake/sdks.cmake +index 68ccc88ec8..91e3295e1d 100644 +--- cmake/sdks.cmake ++++ cmake/sdks.cmake +@@ -269,7 +269,7 @@ function(add_sdks) + + # the catch-all config needs to list all the targets in a dependency-sorted order + include(dependencies) +- sort_links(EXPORTS) ++ #sort_links(EXPORTS) + + # make an everything config by just including all the individual configs + file(WRITE ${CMAKE_BINARY_DIR}/aws-sdk-cpp-config.cmake "") diff --git a/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..efb9a3d957583 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(AWSSDK REQUIRED CONFIG) + +add_subdirectory(aws-sdk-cpp-plugin) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} aws-sdk-cpp-plugin) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp new file mode 100644 index 0000000000000..6171e1633708e --- /dev/null +++ b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp @@ -0,0 +1,16 @@ +#include "AwsSdkCppPlugin.h" +#include +#include +#include +#include + +AwsSdkCppPlugin::AwsSdkCppPlugin() { + using namespace Aws; + using namespace Auth; + using namespace Client; + using namespace S3; + ClientConfiguration config; + auto client = MakeShared("S3Client", + MakeShared("S3Client"), config, + AWSAuthV4Signer::PayloadSigningPolicy::Never /*signPayloads*/, true /*useVirtualAddressing*/, US_EAST_1_REGIONAL_ENDPOINT_OPTION::LEGACY); +} diff --git a/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.h b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.h new file mode 100644 index 0000000000000..e05192e725523 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.h @@ -0,0 +1,7 @@ +#include + +class AWS_SDK_CPP_PLUGIN_EXPORT AwsSdkCppPlugin +{ +public: + AwsSdkCppPlugin(); +}; diff --git a/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt new file mode 100644 index 0000000000000..dddf745d2e408 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) + +add_project(aws-sdk-cpp-plugin "C++ AWS SDK plugin" AWS::aws-sdk-cpp-s3) + +add_library(${PROJECT_NAME} AwsSdkCppPlugin.cpp) + +include(GenerateExportHeader) +generate_export_header(${PROJECT_NAME} BASE_NAME aws_sdk_cpp_plugin) +target_include_directories(${PROJECT_NAME} PUBLIC $ $) +target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) + +setup_install() + +do_packaging() diff --git a/recipes/aws-sdk-cpp/all/test_package/conanfile.py b/recipes/aws-sdk-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/test_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/aws-sdk-cpp/all/test_package/test_package.cpp b/recipes/aws-sdk-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f66fb046b91dc --- /dev/null +++ b/recipes/aws-sdk-cpp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + + +int main() { + using namespace Aws; + SDKOptions options; + InitAPI(options); + AwsSdkCppPlugin Plugin; + ShutdownAPI(options); + return 0; +} + diff --git a/recipes/aws-sdk-cpp/config.yml b/recipes/aws-sdk-cpp/config.yml new file mode 100644 index 0000000000000..3af57130465e4 --- /dev/null +++ b/recipes/aws-sdk-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "1.9.234": + folder: "all" + "1.9.100": + folder: "all" + "1.8.130": + folder: "all" diff --git a/recipes/azure-storage-cpp/all/CMakeLists.txt b/recipes/azure-storage-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..82ba25e8c2576 --- /dev/null +++ b/recipes/azure-storage-cpp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder/Microsoft.WindowsAzure.Storage") diff --git a/recipes/azure-storage-cpp/all/conandata.yml b/recipes/azure-storage-cpp/all/conandata.yml new file mode 100644 index 0000000000000..ccef8ba8c5bd6 --- /dev/null +++ b/recipes/azure-storage-cpp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "7.5.0": + url: "https://github.com/Azure/azure-storage-cpp/archive/refs/tags/v7.5.0.tar.gz" + sha256: "446a821d115949f6511b7eb01e6a0e4f014b17bfeba0f3dc33a51750a9d5eca5" +patches: + "7.5.0": + - base_path: source_subfolder + patch_file: patches/0001-cmake-fixes.patch diff --git a/recipes/azure-storage-cpp/all/conanfile.py b/recipes/azure-storage-cpp/all/conanfile.py new file mode 100644 index 0000000000000..692bc2ab703fe --- /dev/null +++ b/recipes/azure-storage-cpp/all/conanfile.py @@ -0,0 +1,123 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class AzureStorageCppConan(ConanFile): + name = "azure-storage-cpp" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Azure/azure-storage-cpp" + description = "Microsoft Azure Storage Client Library for C++" + topics = ("azure", "cpp", "cross-platform", "microsoft", "cloud") + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + exports_sources = ["CMakeLists.txt", "patches/**"] + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + short_paths = True + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _minimum_cpp_standard(self): + return 11 + + @property + def _minimum_compiler_version(self): + return { + "gcc": "5", + "Visual Studio": "14", + "clang": "3.4", + "apple-clang": "5.1", + } + + def requirements(self): + self.requires("cpprestsdk/2.10.18") + if self.settings.os != "Windows": + self.requires("boost/1.76.0") + self.requires("libxml2/2.9.10") + self.requires("libuuid/1.0.3") + if self.settings.os == "Macos": + self.requires("libgettext/0.20.1") + + 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["CMAKE_FIND_FRAMEWORK"] = "LAST" + self._cmake.definitions["BUILD_TESTS"] = False + self._cmake.definitions["BUILD_SAMPLES"] = False + if not self.settings.compiler.cppstd: + self._cmake.definitions["CMAKE_CXX_STANDARD"] = self._minimum_cpp_standard + + if self.settings.os == "Macos": + self._cmake.definitions["GETTEXT_LIB_DIR"] = self.deps_cpp_info["libgettext"].lib_paths[0] + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compiler_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)) + + # FIXME: Visual Studio 2015 & 2017 are supported but CI of CCI lacks several Win SDK components + # https://github.com/conan-io/conan-center-index/issues/4195 + if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < "16": + raise ConanInvalidConfiguration("Visual Studio < 2019 not yet supported in this recipe") + if self.settings.compiler == "Visual Studio" and self.options.shared and "MT" in self.settings.compiler.runtime: + raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "rpcrt4", "xmllite", "bcrypt"] + if not self.options.shared: + self.cpp_info.defines = ["_NO_WASTORAGE_API"] diff --git a/recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch b/recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch new file mode 100644 index 0000000000000..c775329eb84fe --- /dev/null +++ b/recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch @@ -0,0 +1,72 @@ +diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt +index ac9e65d..f5988f6 100644 +--- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt ++++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt +@@ -46,9 +46,9 @@ if(UNIX) + find_package(OpenSSL 1.0.0 REQUIRED) + + +- find_package(UUID REQUIRED) +- find_package(Casablanca REQUIRED) +- find_package(LibXML2 REQUIRED) ++ find_package(libuuid REQUIRED) ++ find_package(cpprestsdk REQUIRED) ++ find_package(LibXml2 REQUIRED) + + if(BUILD_TESTS) + find_package(UnitTest++ REQUIRED) +@@ -57,7 +57,7 @@ if(UNIX) + + elseif(WIN32) + message("-- Setting WIN32 options") +- find_package(Casablanca REQUIRED) ++ find_package(cpprestsdk REQUIRED) + add_definitions(-DUNICODE -D_UNICODE -D_WIN32) + else() + message("-- Unsupported Build Platform.") +@@ -85,13 +85,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + + set(LD_FLAGS "${LD_FLAGS} -Wl,-z,defs") + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") + + set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic") + +- if (BUILD_SHARED_LIBS) +- add_definitions(-DBOOST_LOG_DYN_LINK) +- endif() + add_definitions(-D_TURN_OFF_PLATFORM_STRING) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + message("-- Setting clang options") +@@ -100,14 +97,11 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(OSX_SUPPRESSIONS "-Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-reorder -Wno-unused-local-typedefs") + set(WARNINGS "${WARNINGS} ${OSX_SUPPRESSIONS}") + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") +- if (BUILD_SHARED_LIBS) +- add_definitions(-DBOOST_LOG_DYN_LINK) +- endif() ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") + add_definitions(-D_TURN_OFF_PLATFORM_STRING) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + message("-- Setting MSVC options") +@@ -142,11 +136,11 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) + + set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) +-set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${LibXML2_INCLUDE_DIR}) ++set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${cpprestsdk_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OpenSSL_INCLUDE_DIRS} ${libuuid_INCLUDE_DIRS} ${LibXml2_INCLUDE_DIR}) + + + set(AZURESTORAGE_LIBRARY azurestorage) +-set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${UUID_LIBRARIES} ${LibXML2_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) ++set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${cpprestsdk_LIBRARIES} ${Boost_LIBRARIES} ${OpenSSL_LIBRARIES} ${libuuid_LIBRARIES} ${LibXml2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + + # Set version numbers centralized + set (AZURESTORAGE_VERSION_MAJOR 7) diff --git a/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt b/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1c789ba4ceba1 --- /dev/null +++ b/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(azure-storage-cpp REQUIRED CONFIG) + +add_executable(example example.cpp) +target_link_libraries(example azure-storage-cpp::azure-storage-cpp) diff --git a/recipes/azure-storage-cpp/all/test_package/conanfile.py b/recipes/azure-storage-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..33fb4c0ecc216 --- /dev/null +++ b/recipes/azure-storage-cpp/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class AwsSdkCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/azure-storage-cpp/all/test_package/example.cpp b/recipes/azure-storage-cpp/all/test_package/example.cpp new file mode 100644 index 0000000000000..632507089345a --- /dev/null +++ b/recipes/azure-storage-cpp/all/test_package/example.cpp @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +int main() +{ + // Define the connection-string with your values.// Define the connection-string with Azurite. + const utility::string_t storage_connection_string(U("UseDevelopmentStorage=true;")); + // Retrieve storage account from connection string. + azure::storage::cloud_storage_account storage_account = azure::storage::cloud_storage_account::parse(storage_connection_string); +} diff --git a/recipes/azure-storage-cpp/config.yml b/recipes/azure-storage-cpp/config.yml new file mode 100644 index 0000000000000..c51af1b34b117 --- /dev/null +++ b/recipes/azure-storage-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "7.5.0": + folder: "all" diff --git a/recipes/b2/config.yml b/recipes/b2/config.yml new file mode 100644 index 0000000000000..8b6a9f5076283 --- /dev/null +++ b/recipes/b2/config.yml @@ -0,0 +1,49 @@ +versions: + "4.0.0": + folder: standard + "4.0.1": + folder: standard + "4.1.0": + folder: standard + "4.2.0": + folder: standard + "4.3.0": + folder: portable + "4.4.0": + folder: portable + "4.4.1": + folder: portable + "4.4.2": + folder: portable + "4.5.0": + folder: portable + "4.6.0": + folder: portable + "4.6.1": + folder: portable + "4.7.0": + folder: portable + "4.7.1": + folder: portable + "4.7.2": + folder: portable + "4.8.0": + folder: portable + "4.8.1": + folder: portable + "4.8.2": + folder: portable + "4.9.0": + folder: portable + "4.9.1": + folder: portable + "4.9.2": + folder: portable + "4.9.3": + folder: portable + "4.9.4": + folder: portable + "4.9.5": + folder: portable + "4.9.6": + folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml new file mode 100644 index 0000000000000..00c3852f57248 --- /dev/null +++ b/recipes/b2/portable/conandata.yml @@ -0,0 +1,61 @@ +sources: + "4.3.0": + sha256: 138c90b66edb0a28e225705a2cbf897a8cef5f87e68befc748f8e6808e21628a + url: https://github.com/bfgroup/b2/archive/4.3.0.tar.gz + "4.4.0": + sha256: fa4079370644110604895ff08057fe2eff3289bcffdaec55fcdf43ea33ff25a8 + url: https://github.com/bfgroup/b2/archive/4.4.0.tar.gz + "4.4.1": + sha256: 4fb15abd994968a24868c13502f080c4a28b20f59831acf9eabd64a3b257554f + url: https://github.com/bfgroup/b2/archive/4.4.1.tar.gz + "4.4.2": + sha256: 575e59b89191a6a6780d7165cae3222b8a7a1e7d5e8165b3524eefe32fc3de46 + url: https://github.com/bfgroup/b2/archive/4.4.2.tar.gz + "4.5.0": + url: "https://github.com/bfgroup/b2/archive/4.5.0.tar.gz" + sha256: "39c3b51bf9c5f32b1c249d2d405274976b166e1bdca1fc5205b595f1cb5dbac3" + "4.6.0": + url: "https://github.com/bfgroup/b2/archive/4.6.0.tar.gz" + sha256: "3a308e0f79a039d8a9495b375f3292f5163000c19caa79c5687e4cb5b1938b49" + "4.6.1": + url: "https://github.com/bfgroup/b2/archive/4.6.1.tar.gz" + sha256: "a3f3323eaeb2c27d7a3ca86842665c6c3bc3d93cc626ba362ae6d0c5a7bfbe2c" + "4.7.0": + url: "https://github.com/bfgroup/b2/archive/4.7.0.tar.gz" + sha256: "82c2eb92d6ab2bd447646568ac8430c316cbd2a1819c108136224498c0abed84" + "4.7.1": + url: "https://github.com/bfgroup/b2/archive/4.7.1.tar.gz" + sha256: "30844184ded3217c090b76e6e051c3ac663ea63bd19e1b727b05c54411cac867" + "4.7.2": + url: "https://github.com/bfgroup/b2/archive/4.7.2.tar.gz" + sha256: "70883f8ed82efc49f425f1961a82e961cefdbca3a28581cb57b405bd7516677f" + "4.8.0": + url: "https://github.com/bfgroup/b2/archive/4.8.0.tar.gz" + sha256: "2f18951d4cc267a810e44fc483b747d489e30ed42ee6d9e7c5e19de750ee5cd2" + "4.8.1": + url: "https://github.com/bfgroup/b2/archive/4.8.1.tar.gz" + sha256: "8ecff1025df9473d91a0d116af3e32be6fba6e57d4ea962e033ff1678609d668" + "4.8.2": + url: "https://github.com/bfgroup/b2/archive/4.8.2.tar.gz" + sha256: "220edfbd5022394c5dc264dfdd8bf6d3ec53b784db87461026bb23ea9d9ec4bd" + "4.9.0": + url: "https://github.com/bfgroup/b2/archive/4.9.0.tar.gz" + sha256: "7c614e41f10e004c7539c75c60f7b2df26a61fe35058e9021f8fd5049c97a255" + "4.9.1": + url: "https://github.com/bfgroup/b2/archive/4.9.1.tar.gz" + sha256: "81e49dc85e956c3e708bdd02fcfe0b9f406fca8edca54c75c94ebd6c322ed587" + "4.9.2": + url: "https://github.com/bfgroup/b2/archive/4.9.2.tar.gz" + sha256: "7e1a135b308999d2a65fce3eba8f4ffb41ca82ae133f8494cc42cbca63c890de" + "4.9.3": + url: "https://github.com/bfgroup/b2/archive/4.9.3.tar.gz" + sha256: "4524b8ecf138a9087aa24b8889c44ea7ae9f2d373acc9535d72fb048c213e1b9" + "4.9.4": + url: "https://github.com/bfgroup/b2/releases/download/4.9.4/b2-4.9.4.tar.bz2" + sha256: "1996d8098955ad3fdecab242d784afaef0fba80dd5d2ef0b3a41592e26772312" + "4.9.5": + url: "https://github.com/bfgroup/b2/releases/download/4.9.5/b2-4.9.5.tar.bz2" + sha256: "f81bea44601613f633d3311341f3f63594608537bf38d7073b877ec1edb2760a" + "4.9.6": + url: "https://github.com/bfgroup/b2/releases/download/4.9.6/b2-4.9.6.tar.bz2" + sha256: "10c1344c751fcf5a1f9ec6f52c02626cfbf78a4806f7817949b115e107bbbc5f" diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py new file mode 100644 index 0000000000000..dad95965dea31 --- /dev/null +++ b/recipes/b2/portable/conanfile.py @@ -0,0 +1,180 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.files import chdir, copy, get +from conan.tools.layout import basic_layout + +from contextlib import contextmanager +import os +from io import StringIO + +required_conan_version = ">=1.47.0" + + +class B2Conan(ConanFile): + name = "b2" + homepage = "https://www.bfgroup.xyz/b2/" + description = "B2 makes it easy to build C++ projects, everywhere." + topics = ("installer", "builder", "build", "build-system") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch" + ''' + * use_cxx_env: False, True + + Indicates if the build will use the CXX and + CXXFLAGS environment variables. The common use is to add additional flags + for building on specific platforms or for additional optimization options. + + * toolset: 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143' + + Specifies the toolset to use for building. The default of 'auto' detects + a usable compiler for building and should be preferred. The 'cxx' toolset + uses the 'CXX' and 'CXXFLAGS' solely for building. Using the 'cxx' + toolset will also turn on the 'use_cxx_env' option. And the 'cross-cxx' + toolset uses the 'BUILD_CXX' and 'BUILD_CXXFLAGS' vars. This frees the + 'CXX' and 'CXXFLAGS' variables for use in subprocesses. + ''' + options = { + 'use_cxx_env': [False, True], + 'toolset': [ + 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143', + ] + } + default_options = { + 'use_cxx_env': False, + 'toolset': 'auto' + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.use_cxx_env + del self.info.options.toolset + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} recipe doesn't support cross-build yet") + + if (self.options.toolset == 'cxx' or self.options.toolset == 'cross-cxx') and not self.options.use_cxx_env: + raise ConanInvalidConfiguration( + "Option toolset 'cxx' and 'cross-cxx' requires 'use_cxx_env=True'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _b2_dir(self): + return self.source_folder + + @property + def _b2_engine_dir(self): + return os.path.join(self._b2_dir, "src", "engine") + + @property + def _b2_output_dir(self): + return os.path.join(self.build_folder, "output") + + @property + def _pkg_bin_dir(self): + return os.path.join(self.package_folder, "bin") + + @contextmanager + def _bootstrap_env(self): + saved_env = dict(os.environ) + # Vcvars will change the directory after it runs in the situation when + # the user has previously run the VS command console inits. In that + # context it remembers the dir and resets it at each vcvars invocation. + os.environ.update({"VSCMD_START_DIR": os.getcwd()}) + if not self.options.use_cxx_env: + # To avoid using the CXX env vars we clear them out for the build. + os.environ.update({ + "CXX": "", + "CXXFLAGS": ""}) + try: + yield + finally: + os.environ.clear() + os.environ.update(saved_env) + + def build(self): + # The order of the with:with: below is important. The first one changes + # the current dir. While the second does env changes that guarantees + # that dir doesn't change if/when vsvars runs to set the msvc compile + # env. + self.output.info("Build engine..") + command = "" + b2_toolset = self.options.toolset + use_windows_commands = os.name == 'nt' + if b2_toolset == 'auto': + if use_windows_commands: + # For windows auto detection it can evaluate to a msvc version + # that it's not aware of. Most likely because it's a future one + # that didn't exist when the build was written. This turns that + # into a generic msvc toolset build assuming it could work, + # since it's a better version. + with chdir(self, self._b2_engine_dir): + with self._bootstrap_env(): + buf = StringIO() + self.run('guess_toolset && set', buf) + guess_vars = map( + lambda x: x.strip(), buf.getvalue().split("\n")) + if "B2_TOOLSET=vcunk" in guess_vars: + b2_toolset = 'msvc' + for kv in guess_vars: + if kv.startswith("B2_TOOLSET_ROOT="): + b2_vcvars = os.path.join( + kv.split('=')[1].strip(), 'Auxiliary', 'Build', 'vcvars32.bat') + command += '"'+b2_vcvars+'" && ' + command += "build" if use_windows_commands else "./build.sh" + + if self.options.use_cxx_env: + cxx = os.environ.get("CXX") + if cxx: + command += f" --cxx={cxx}" + cxxflags = os.environ.get("CXXFLAGS") + if cxxflags: + command += f" --cxxflags={cxxflags}" + + if b2_toolset != 'auto': + command += " "+str(b2_toolset) + with chdir(self, self._b2_engine_dir): + with self._bootstrap_env(): + self.run(command) + + self.output.info("Install..") + command = os.path.join( + self._b2_engine_dir, "b2.exe" if use_windows_commands else "b2") + if b2_toolset not in ["auto", "cxx", "cross-cxx"]: + command += " toolset=" + str(b2_toolset) + full_command = \ + (f"{command} --ignore-site-config " + + f"--prefix={self._b2_output_dir} " + + "--abbreviate-paths " + + "install " + + "b2-install-layout=portable") + with chdir(self, self._b2_dir): + self.run(full_command) + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*b2", dst=self._pkg_bin_dir, src=self._b2_output_dir) + copy(self, "*b2.exe", dst=self._pkg_bin_dir, src=self._b2_output_dir) + copy(self, "*.jam", dst=self._pkg_bin_dir, src=self._b2_output_dir) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(self._pkg_bin_dir) diff --git a/recipes/b2/portable/test_package/conanfile.py b/recipes/b2/portable/test_package/conanfile.py new file mode 100644 index 0000000000000..270c3bedc31a3 --- /dev/null +++ b/recipes/b2/portable/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("b2 -v") diff --git a/recipes/b2/portable/test_v1_package/conanfile.py b/recipes/b2/portable/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..53ed1a9a77b8b --- /dev/null +++ b/recipes/b2/portable/test_v1_package/conanfile.py @@ -0,0 +1,8 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + self.run("b2 -v", run_environment=True) diff --git a/recipes/b2/standard/conandata.yml b/recipes/b2/standard/conandata.yml new file mode 100644 index 0000000000000..574decae59105 --- /dev/null +++ b/recipes/b2/standard/conandata.yml @@ -0,0 +1,13 @@ +sources: + "4.0.0": + sha256: f59bd90bd4d68b44005a83a60d3d933d3768fc5a5b51e45a0462e6f4b81caa8a + url: https://github.com/bfgroup/b2/archive/4.0.0.tar.gz + "4.0.1": + sha256: ebdfb38b3938dba4c2548b2b7f4ca48e209beef9a376a78742bcd75769a9d68f + url: https://github.com/bfgroup/b2/archive/4.0.1.tar.gz + "4.1.0": + sha256: eb562b14677e3ad3619bb67e6be6ea97d5dbe34780bbc47bed4cdda3177835c8 + url: https://github.com/bfgroup/b2/archive/4.1.0.tar.gz + "4.2.0": + sha256: 00e3425e0419688ea61ecbbcd106ce168e334f0acdcc2f4a4ead084f03cd4b60 + url: https://github.com/bfgroup/b2/archive/4.2.0.tar.gz diff --git a/recipes/b2/standard/conanfile.py b/recipes/b2/standard/conanfile.py new file mode 100644 index 0000000000000..6eac8be0f9018 --- /dev/null +++ b/recipes/b2/standard/conanfile.py @@ -0,0 +1,101 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class B2Conan(ConanFile): + name = "b2" + homepage = "https://www.bfgroup.xyz/b2/" + description = "B2 makes it easy to build C++ projects, everywhere." + topics = ("conan", "installer", "builder") + license = "BSL-1.0" + settings = "os", "arch" + url = "https://github.com/conan-io/conan-center-index" + + ''' + * use_cxx_env: False, True + + Indicates if the build will use the CXX and + CXXFLAGS environment variables. The common use is to add additional flags + for building on specific platforms or for additional optimization options. + + * toolset: 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143' + + Specifies the toolset to use for building. The default of 'auto' detects + a usable compiler for building and should be preferred. The 'cxx' toolset + uses the 'CXX' and 'CXXFLAGS' solely for building. Using the 'cxx' + toolset will also turn on the 'use_cxx_env' option. And the 'cross-cxx' + toolset uses the 'BUILD_CXX' and 'BUILD_CXXFLAGS' vars. This frees the + 'CXX' and 'CXXFLAGS' variables for use in subprocesses. + ''' + options = { + 'use_cxx_env': [False, True], + 'toolset': [ + 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143'] + } + default_options = { + 'use_cxx_env': False, + 'toolset': 'auto' + } + + def configure(self): + if (self.options.toolset == 'cxx' or self.options.toolset == 'cross-cxx') and not self.options.use_cxx_env: + raise ConanInvalidConfiguration( + "Option toolset 'cxx' and 'cross-cxx' requires 'use_cxx_env=True'") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination="source") + + def build(self): + use_windows_commands = os.name == 'nt' + command = "build" if use_windows_commands else "./build.sh" + if self.options.toolset != 'auto': + command += " "+str(self.options.toolset) + build_dir = os.path.join(self.source_folder, "source") + engine_dir = os.path.join(build_dir, "src", "engine") + os.chdir(engine_dir) + with tools.environment_append({"VSCMD_START_DIR": os.curdir}): + if self.options.use_cxx_env: + # Allow use of CXX env vars. + self.run(command) + else: + # To avoid using the CXX env vars we clear them out for the build. + with tools.environment_append({"CXX": "", "CXXFLAGS": ""}): + self.run(command) + os.chdir(build_dir) + command = os.path.join( + engine_dir, "b2.exe" if use_windows_commands else "b2") + if self.options.toolset != 'auto': + full_command = "{0} --ignore-site-config --prefix=../output --abbreviate-paths" \ + " toolset={1} install".format(command, self.options.toolset) + else: + full_command = "{0} --ignore-site-config --prefix=../output --abbreviate-paths" \ + " install".format(command) + self.run(full_command) + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src="source") + self.copy(pattern="*b2", dst="bin", src="output/bin") + self.copy(pattern="*b2.exe", dst="bin", src="output/bin") + self.copy(pattern="*.jam", dst="bin/b2_src", + src="output/share/boost-build") + + def package_info(self): + self.cpp_info.bindirs = ["bin"] + self.env_info.path = [os.path.join( + self.package_folder, "bin")] + self.env_info.BOOST_BUILD_PATH = os.path.join( + self.package_folder, "bin", "b2_src", "src", "kernel") + + def package_id(self): + del self.info.options.use_cxx_env + del self.info.options.toolset diff --git a/recipes/b2/standard/test_package/conanfile.py b/recipes/b2/standard/test_package/conanfile.py new file mode 100644 index 0000000000000..24d8a018c8f84 --- /dev/null +++ b/recipes/b2/standard/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools +import os + + +class TestPackgeConan(ConanFile): + settings = "os", "arch" + + def test(self): + self.run("b2 -v", run_environment=True) diff --git a/recipes/b64/all/CMakeLists.txt b/recipes/b64/all/CMakeLists.txt new file mode 100644 index 0000000000000..86ec29f0103b2 --- /dev/null +++ b/recipes/b64/all/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.15) +project(b64 LANGUAGES C CXX) + +file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/include/b64/*.h") +add_library(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/src/cdecode.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/src/cencode.c" ${HEADER_FILES}) +target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/include") +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}" WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/b64" +) + +set(BASE64_APP base64) +add_executable(${BASE64_APP} "${CMAKE_CURRENT_SOURCE_DIR}/src/base64/base64.cc" ${HEADER_FILES}) +target_link_libraries(${BASE64_APP} PRIVATE ${PROJECT_NAME}) +target_include_directories(${BASE64_APP} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/include") +target_compile_definitions(${BASE64_APP} PRIVATE BUFFERSIZE=16777216) +set_target_properties(${BASE64_APP} PROPERTIES LINKER_LANGUAGE CXX) +install(TARGETS ${BASE64_APP} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/b64/all/conandata.yml b/recipes/b64/all/conandata.yml new file mode 100644 index 0000000000000..6f62323cd1501 --- /dev/null +++ b/recipes/b64/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "2.0.0.1": + url: "https://github.com/libb64/libb64/archive/refs/tags/v2.0.0.1.tar.gz" + sha256: "ce8e578a953a591bd4a6f157eec310b9a4c2e6f10ade2fdda6ae6bafaf798b98" +patches: + "2.0.0.1": + - patch_file: "patches/0001-windows-elseif.patch" + patch_description: "Replace elseif definition by elif to make it work on Windows" + patch_type: "portability" + patch_source: "https://github.com/libb64/libb64/commit/b5edeafc89853c48fa41a4c16393a1fdc8638ab6" + - patch_file: "patches/0002-extern-c.patch" + patch_description: "Move extern C from C++ headers to C headers" + patch_type: "portability" + patch_source: "https://github.com/libb64/libb64/pull/6/commits/502573666a61317aa6bee2ff9ab74e65a7c25f63" + - patch_file: "patches/0003-stdlib-exit.patch" + patch_description: "Use cstdlib instead of stdlib.h for exit() - needed for GCC5" + patch_type: "conan" + - patch_file: "patches/0004-include-order.patch" + patch_description: "Include C headers first, than C++ headers, and project headers" + patch_type: "conan" diff --git a/recipes/b64/all/conanfile.py b/recipes/b64/all/conanfile.py new file mode 100755 index 0000000000000..bdc200c525d02 --- /dev/null +++ b/recipes/b64/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake +import os + + +required_conan_version = ">=1.53.0" + + +class B64Conan(ConanFile): + name = "b64" + description = "A library of ANSI C routines for fast encoding/decoding data into and from a base64-encoded format." + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libb64.sourceforge.net/" + topics = ("base64", "codec", "encoder", "decoder") + 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) + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", 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 = ["b64"] + + # TODO: Only for Conan 1.x legacy - Remove after running Conan 2.x only + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/b64/all/patches/0001-windows-elseif.patch b/recipes/b64/all/patches/0001-windows-elseif.patch new file mode 100644 index 0000000000000..ab8677906ac76 --- /dev/null +++ b/recipes/b64/all/patches/0001-windows-elseif.patch @@ -0,0 +1,13 @@ +diff --git a/include/b64/ccommon.h b/include/b64/ccommon.h +index 2b614df..28a9936 100644 +--- a/include/b64/ccommon.h ++++ b/include/b64/ccommon.h +@@ -14,7 +14,7 @@ For details, see http://sourceforge.net/projects/libb64 + #ifndef HAVE_SIZE_T + #ifdef _WIN32 + #include +- #elseif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) ++ #elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) + #include + #else + typedef unsigned long size_t; diff --git a/recipes/b64/all/patches/0002-extern-c.patch b/recipes/b64/all/patches/0002-extern-c.patch new file mode 100644 index 0000000000000..ad69b157b0f90 --- /dev/null +++ b/recipes/b64/all/patches/0002-extern-c.patch @@ -0,0 +1,117 @@ +diff --git a/include/b64/cdecode.h b/include/b64/cdecode.h +index d6ff24c..889614f 100644 +--- a/include/b64/cdecode.h ++++ b/include/b64/cdecode.h +@@ -13,6 +13,11 @@ For details, see http://sourceforge.net/projects/libb64 + #define BASE64_CDEC_VER_MAJOR 2 + #define BASE64_CDEC_VER_MINOR 0 + ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ + typedef enum + { + step_a, step_b, step_c, step_d +@@ -24,11 +29,15 @@ typedef struct + char plainchar; + } base64_decodestate; + +-extern void base64_init_decodestate(base64_decodestate* state_in); ++void base64_init_decodestate(base64_decodestate* state_in); ++ ++size_t base64_decode_maxlength(size_t encode_len); + +-extern size_t base64_decode_maxlength(size_t encode_len); ++int base64_decode_value(signed char value_in); ++size_t base64_decode_block(const char* code_in, const size_t length_in, void* plaintext_out, base64_decodestate* state_in); + +-extern int base64_decode_value(signed char value_in); +-extern size_t base64_decode_block(const char* code_in, const size_t length_in, void* plaintext_out, base64_decodestate* state_in); ++#ifdef __cplusplus ++} ++#endif + + #endif /* BASE64_CDECODE_H */ +diff --git a/include/b64/cencode.h b/include/b64/cencode.h +index 96b0cdb..9b70877 100644 +--- a/include/b64/cencode.h ++++ b/include/b64/cencode.h +@@ -13,6 +13,11 @@ For details, see http://sourceforge.net/projects/libb64 + #define BASE64_CENC_VER_MAJOR 2 + #define BASE64_CENC_VER_MINOR 0 + ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ + typedef enum + { + step_A, step_B, step_C +@@ -31,12 +36,16 @@ typedef struct + char result; + } base64_encodestate; + +-extern void base64_init_encodestate(base64_encodestate* state_in); ++void base64_init_encodestate(base64_encodestate* state_in); ++ ++size_t base64_encode_length(size_t plain_len, base64_encodestate* state_in); + +-extern size_t base64_encode_length(size_t plain_len, base64_encodestate* state_in); ++char base64_encode_value(signed char value_in); ++size_t base64_encode_block(const void* plaintext_in, const size_t length_in, char* code_out, base64_encodestate* state_in); ++size_t base64_encode_blockend(char* code_out, base64_encodestate* state_in); + +-extern char base64_encode_value(signed char value_in); +-extern size_t base64_encode_block(const void* plaintext_in, const size_t length_in, char* code_out, base64_encodestate* state_in); +-extern size_t base64_encode_blockend(char* code_out, base64_encodestate* state_in); ++#ifdef __cplusplus ++} ++#endif + + #endif /* BASE64_CENCODE_H */ +diff --git a/include/b64/decode.h b/include/b64/decode.h +index b2362e5..bfff27c 100644 +--- a/include/b64/decode.h ++++ b/include/b64/decode.h +@@ -12,10 +12,8 @@ For details, see http://sourceforge.net/projects/libb64 + + namespace base64 + { +- extern "C" +- { +- #include "cdecode.h" +- } ++ ++#include "cdecode.h" + + struct decoder + { +@@ -69,4 +67,3 @@ namespace base64 + + + #endif // BASE64_DECODE_H +- +diff --git a/include/b64/encode.h b/include/b64/encode.h +index c1a5f88..c1c2ead 100644 +--- a/include/b64/encode.h ++++ b/include/b64/encode.h +@@ -12,10 +12,8 @@ For details, see http://sourceforge.net/projects/libb64 + + namespace base64 + { +- extern "C" +- { ++ + #include "cencode.h" +- } + + struct encoder + { +@@ -75,4 +73,3 @@ namespace base64 + } // namespace base64 + + #endif // BASE64_ENCODE_H +- diff --git a/recipes/b64/all/patches/0003-stdlib-exit.patch b/recipes/b64/all/patches/0003-stdlib-exit.patch new file mode 100644 index 0000000000000..0ccb585ce887e --- /dev/null +++ b/recipes/b64/all/patches/0003-stdlib-exit.patch @@ -0,0 +1,57 @@ +diff --git a/base64/base64.cc b/base64/base64.cc +index acab416..f952dc6 100644 +--- a/base64/base64.cc ++++ b/base64/base64.cc +@@ -12,7 +12,7 @@ For details, see http://sourceforge.net/projects/libb64 + #include + #include + +-#include ++#include + + // Function which prints the usage of this executable + void usage() +@@ -38,14 +38,14 @@ int main(int argc, char** argv) + if (argc == 1) + { + usage(); +- exit(-1); ++ std::exit(-1); + } + if (argc != 4) + { + usage("Wrong number of arguments!"); +- exit(-1); ++ std::exit(-1); + } +- ++ + // So far so good; try to open the input file + std::string input = argv[2]; + // Note that we have to open the input in binary mode. +@@ -56,9 +56,9 @@ int main(int argc, char** argv) + if (!instream.is_open()) + { + usage("Could not open input file!"); +- exit(-1); ++ std::exit(-1); + } +- ++ + // Now try to open the output file + std::string output = argv[3]; + // Again, note that we have to open the ouput in binary mode. +@@ -68,7 +68,7 @@ int main(int argc, char** argv) + if (!outstream.is_open()) + { + usage("Could not open output file!"); +- exit(-1); ++ std::exit(-1); + } + + // determine whether we need to encode or decode: +@@ -91,4 +91,3 @@ int main(int argc, char** argv) + + return 0; + } +- diff --git a/recipes/b64/all/patches/0004-include-order.patch b/recipes/b64/all/patches/0004-include-order.patch new file mode 100644 index 0000000000000..b509bb64fb543 --- /dev/null +++ b/recipes/b64/all/patches/0004-include-order.patch @@ -0,0 +1,22 @@ +diff --git a/base64/base64.cc b/base64/base64.cc +index f952dc6..e22abd0 100644 +--- a/base64/base64.cc ++++ b/base64/base64.cc +@@ -5,14 +5,14 @@ This is part of the libb64 project, and has been placed in the public domain. + For details, see http://sourceforge.net/projects/libb64 + */ + +-#include +-#include ++#include + + #include + #include + #include + +-#include ++#include ++#include + + // Function which prints the usage of this executable + void usage() diff --git a/recipes/b64/all/test_package/CMakeLists.txt b/recipes/b64/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..21db2d93d4c6c --- /dev/null +++ b/recipes/b64/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(b64 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE b64::b64) diff --git a/recipes/b64/all/test_package/conanfile.py b/recipes/b64/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/b64/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/b64/all/test_package/test_package.cpp b/recipes/b64/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..32696bbbcfe1a --- /dev/null +++ b/recipes/b64/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include + +extern "C" { + #include "b64/cencode.h" + #include "b64/cdecode.h" +} + +int main() { + const char str[] = "Hello world!"; + const unsigned len = sizeof(str); + char out[len*2] = {0}, rev[len*2] = {0}; + + base64_encodestate E; + base64_init_encodestate(&E); + base64_decodestate D; + base64_init_decodestate(&D); + + const unsigned out_len = base64_encode_block(str, len, out, &E); + base64_decode_block(out, out_len, rev, &D); + + std::cout << "input: " << str << std::endl; + std::cout << "base64: " << out << std::endl; + std::cout << "reversed: " << rev << std::endl; + + return 0; +} diff --git a/recipes/b64/all/test_v1_package/CMakeLists.txt b/recipes/b64/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/b64/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/b64/all/test_v1_package/conanfile.py b/recipes/b64/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/b64/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/b64/config.yml b/recipes/b64/config.yml new file mode 100644 index 0000000000000..db58b29f8bd29 --- /dev/null +++ b/recipes/b64/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0.1": + folder: all diff --git a/recipes/backport-cpp/all/conandata.yml b/recipes/backport-cpp/all/conandata.yml new file mode 100644 index 0000000000000..517d7fc6ceb05 --- /dev/null +++ b/recipes/backport-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.0": + url: "https://github.com/bitwizeshift/BackportCpp/archive/v1.2.0.tar.gz" + sha256: "8efded40a1d0e6674824336499d8706043a62bd8ae8aef62210c8c215f710b84" diff --git a/recipes/backport-cpp/all/conanfile.py b/recipes/backport-cpp/all/conanfile.py new file mode 100644 index 0000000000000..a114a54bf9ff4 --- /dev/null +++ b/recipes/backport-cpp/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BackportCppRecipe(ConanFile): + name = "backport-cpp" + description = "An ongoing effort to bring modern C++ utilities to be compatible with C++11" + topics = ("backport-cpp", "header-only", "backport") + homepage = "https://github.com/bitwizeshift/BackportCpp" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source=True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, os.path.join("include", "**", "*.hpp"), src=self.source_folder, dst=self.package_folder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Backport") + self.cpp_info.set_property("cmake_target_name", "Backport::Backport") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Backport" + self.cpp_info.names["cmake_find_package_multi"] = "Backport" diff --git a/recipes/backport-cpp/all/test_package/CMakeLists.txt b/recipes/backport-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2b33b3fe58289 --- /dev/null +++ b/recipes/backport-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Backport REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Backport::Backport) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/backport-cpp/all/test_package/conanfile.py b/recipes/backport-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/backport-cpp/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/backport-cpp/all/test_package/test_package.cpp b/recipes/backport-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fce99b2771aea --- /dev/null +++ b/recipes/backport-cpp/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main() { + bpstd::optional optional{}; + std::cout << std::boolalpha; + std::cout << "default optional: " << optional.has_value() << std::endl; + optional.emplace(42); + std::cout << "set optional: " << optional.has_value() << ", " << optional.value() << std::endl; + optional.reset(); + std::cout << "reset optional: " << optional.has_value() << std::endl; + return 0; +} diff --git a/recipes/backport-cpp/all/test_v1_package/CMakeLists.txt b/recipes/backport-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c4264b0a6d02 --- /dev/null +++ b/recipes/backport-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Backport REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Backport::Backport) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/backport-cpp/all/test_v1_package/conanfile.py b/recipes/backport-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/backport-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/backport-cpp/config.yml b/recipes/backport-cpp/config.yml new file mode 100644 index 0000000000000..b8ea8afb5a353 --- /dev/null +++ b/recipes/backport-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.0": + folder: "all" diff --git a/recipes/backward-cpp/all/conandata.yml b/recipes/backward-cpp/all/conandata.yml new file mode 100644 index 0000000000000..56d588551a507 --- /dev/null +++ b/recipes/backward-cpp/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.6": + url: "https://github.com/bombela/backward-cpp/archive/v1.6.tar.gz" + sha256: "c654d0923d43f1cea23d086729673498e4741fb2457e806cfaeaea7b20c97c10" + "1.5": + url: "https://github.com/bombela/backward-cpp/archive/v1.5.tar.gz" + sha256: "faf7d4fe7ca65117ed4fe7be9bff9628927bd95b49f71df63d5f99af233d1915" + "1.4": + url: "https://github.com/bombela/backward-cpp/archive/v1.4.tar.gz" + sha256: "ad73be31c5cfcbffbde7d34dba18158a42043a109e7f41946f0b0abd589ed55e" +patches: + "1.6": + - patch_file: "patches/backward-cpp-1.5.patch" + "1.5": + - patch_file: "patches/backward-cpp-1.5.patch" + - patch_file: "patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch" + patch_source: "https://github.com/bombela/backward-cpp/commit/74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch" + - patch_file: "patches/backward-cpp-1.5-add-iterator-include.patch" + - patch_file: "patches/backward-cpp-1.5-mingw.patch" + "1.4": + - patch_file: "patches/backward-cpp-1.4.patch" + - patch_file: "patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch" + patch_source: "https://github.com/bombela/backward-cpp/commit/7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch" + - patch_file: "patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch" + patch_source: "https://github.com/bombela/backward-cpp/commit/b7ffd640ec48ada93045f8c46fc65f823490819b.patch" diff --git a/recipes/backward-cpp/all/conanfile.py b/recipes/backward-cpp/all/conanfile.py new file mode 100644 index 0000000000000..6f744e6d9f6c3 --- /dev/null +++ b/recipes/backward-cpp/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, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class BackwardCppConan(ConanFile): + name = "backward-cpp" + description = "A beautiful stack trace pretty printer for C++" + homepage = "https://github.com/bombela/backward-cpp" + url = "https://github.com/conan-io/conan-center-index" + topics = ("backward-cpp", "stack-trace") + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "stack_walking" : ["unwind", "backtrace"], + "stack_details" : ["dw", "bfd", "dwarf", "backtrace_symbol"], + } + default_options = { + "shared": False, + "fPIC": True, + "stack_walking": "unwind", + "stack_details": "dwarf", + } + + @property + def _supported_os(self): + supported_os = ["Linux", "Macos", "Android"] + if Version(self.version) >= "1.5": + supported_os.append("Windows") + return supported_os + + def _has_stack_walking(self, type): + return self.options.stack_walking == type + + def _has_stack_details(self, type): + return False if self.settings.os == "Windows" else self.options.stack_details == type + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.stack_details + # default option + if self.settings.os == "Macos": + self.options.stack_details = "backtrace_symbol" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os in ["Linux", "Android"]: + if self._has_stack_details("dwarf"): + self.requires("libdwarf/20191104", transitive_headers=True, transitive_libs=True) + self.requires("libelf/0.8.13") + if self._has_stack_details("dw"): + self.requires("elfutils/0.186", transitive_headers=True, transitive_libs=True) + if self._has_stack_details("bfd"): + self.requires("binutils/2.38", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.os not in self._supported_os: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.os == "Macos": + if self.settings.arch == "armv8": + raise ConanInvalidConfiguration("Macos M1 not supported yet") + if not self._has_stack_details("backtrace_symbol"): + raise ConanInvalidConfiguration("only stack_details=backtrace_symbol" + " is supported on Macos") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["STACK_WALKING_UNWIND"] = self._has_stack_walking("unwind") + tc.variables["STACK_WALKING_BACKTRACE"] = self._has_stack_walking("backtrace") + tc.variables["STACK_DETAILS_AUTO_DETECT"] = False + tc.variables["STACK_DETAILS_BACKTRACE_SYMBOL"] = self._has_stack_details("backtrace_symbol") + tc.variables["STACK_DETAILS_DW"] = self._has_stack_details("dw") + tc.variables["STACK_DETAILS_BFD"] = self._has_stack_details("bfd") + tc.variables["STACK_DETAILS_DWARF"] = self._has_stack_details("dwarf") + tc.variables["BACKWARD_SHARED"] = self.options.shared + tc.variables["BACKWARD_TESTS"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "backward")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Backward") + self.cpp_info.set_property("cmake_target_name", "Backward::Backward") + + self.cpp_info.defines.append("BACKWARD_HAS_UNWIND={}".format(int(self._has_stack_walking("unwind")))) + self.cpp_info.defines.append("BACKWARD_HAS_BACKTRACE={}".format(int(self._has_stack_walking("backtrace")))) + + self.cpp_info.defines.append("BACKWARD_HAS_BACKTRACE_SYMBOL={}".format(int(self._has_stack_details("backtrace_symbol")))) + self.cpp_info.defines.append("BACKWARD_HAS_DW={}".format(int(self._has_stack_details("dw")))) + self.cpp_info.defines.append("BACKWARD_HAS_BFD={}".format(int(self._has_stack_details("bfd")))) + self.cpp_info.defines.append("BACKWARD_HAS_DWARF={}".format(int(self._has_stack_details("dwarf")))) + self.cpp_info.defines.append("BACKWARD_HAS_PDB_SYMBOL={}".format(int(self.settings.os == "Windows"))) + + self.cpp_info.libs = ["backward"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["dl"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["psapi", "dbghelp"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Backward" + self.cpp_info.names["cmake_find_package_multi"] = "Backward" diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch new file mode 100644 index 0000000000000..9a711c38acf32 --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch @@ -0,0 +1,28 @@ +From 7539d53b54f08f056dc9366c8d5c24c5d749cfce Mon Sep 17 00:00:00 2001 +From: Michael Truog +Date: Sat, 22 Sep 2018 19:10:56 -0700 +Subject: [PATCH] Fix compilation for GCC (tested with 5.4.0) + +--- + backward.hpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/backward.hpp b/backward.hpp +index c9a922f..69d5dba 100644 +--- a/backward.hpp ++++ b/backward.hpp +@@ -3704,10 +3704,14 @@ class SignalHandling { + SA_RESETHAND); + sigfillset(&action.sa_mask); + sigdelset(&action.sa_mask, posix_signals[i]); ++#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdisabled-macro-expansion" ++#endif + action.sa_sigaction = &sig_handler; ++#if defined(__clang__) + #pragma clang diagnostic pop ++#endif + + int r = sigaction(posix_signals[i], &action, nullptr); + if (r < 0) success = false; diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch new file mode 100644 index 0000000000000..4ac5728e876bb --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch @@ -0,0 +1,35 @@ +From b7ffd640ec48ada93045f8c46fc65f823490819b Mon Sep 17 00:00:00 2001 +From: Nikos Skalkotos +Date: Tue, 6 Nov 2018 14:01:13 +0200 +Subject: [PATCH] Fix unknown pragma warning in gcc + +Check if the compiler is clang before using clang only pragma statements. +--- + backward.hpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/backward.hpp b/backward.hpp +index 69d5dba..53eea4f 100644 +--- a/backward.hpp ++++ b/backward.hpp +@@ -1250,8 +1250,10 @@ class TraceResolverLinuxImpl: + } + } + ++#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" ++#endif + if (!result.found && fobj.symtab) { + result.found = bfd_find_nearest_line(fobj.handle.get(), section, + fobj.symtab.get(), addr - sec_addr, &result.filename, +@@ -1263,7 +1265,9 @@ class TraceResolverLinuxImpl: + fobj.dynamic_symtab.get(), addr - sec_addr, + &result.filename, &result.funcname, &result.line); + } ++#if defined(__clang__) + #pragma clang diagnostic pop ++#endif + + } + diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch new file mode 100644 index 0000000000000..f0e6e425a176f --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch @@ -0,0 +1,95 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,7 @@ + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + # SOFTWARE. + +-cmake_minimum_required(VERSION 2.8.12) ++cmake_minimum_required(VERSION 3.8) + project(backward CXX) + + include(BackwardConfig.cmake) +@@ -33,8 +33,6 @@ if (COMPILER_NAME MATCHES "^nvcc") + endif() + + # set CXX standard +-set(CMAKE_CXX_STANDARD_REQUIRED True) +-set(CMAKE_CXX_STANDARD 11) + if (${COMPILER_IS_NVCC}) + # GNU CXX extensions are not supported by nvcc + set(CMAKE_CXX_EXTENSIONS OFF) +@@ -47,7 +45,7 @@ endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + if (NOT ${COMPILER_IS_NVCC}) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + endif() +@@ -56,11 +54,13 @@ endif() + # BACKWARD OBJECT + ############################################################################### + ++if(0) + add_library(backward_object OBJECT backward.cpp) + target_compile_definitions(backward_object PRIVATE ${BACKWARD_DEFINITIONS}) + target_include_directories(backward_object PRIVATE ${BACKWARD_INCLUDE_DIRS}) + set(BACKWARD_ENABLE $ CACHE STRING + "Link with this object to setup backward automatically") ++endif() + + + ############################################################################### +@@ -74,6 +74,19 @@ endif() + add_library(backward ${libtype} backward.cpp) + target_compile_definitions(backward PUBLIC ${BACKWARD_DEFINITIONS}) + target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS}) ++target_compile_features(backward PUBLIC cxx_std_11) ++if(STACK_DETAILS_DW) ++ find_package(elfutils REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC elfutils::libdw) ++endif() ++if(STACK_DETAILS_BFD) ++ find_package(binutils REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC binutils::binutils) ++endif() ++if(STACK_DETAILS_DWARF) ++ find_package(libdwarf REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC libdwarf::libdwarf) ++endif() + + ############################################################################### + # TESTS +@@ -117,11 +130,18 @@ if(BACKWARD_TESTS) + endforeach() + endif() + ++include(GNUInstallDirs) + install( + FILES "backward.hpp" +- DESTINATION ${CMAKE_INSTALL_PREFIX}/include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + install( + FILES "BackwardConfig.cmake" +- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/backward ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/backward ++) ++install( ++ TARGETS backward ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +--- a/backward.hpp ++++ b/backward.hpp +@@ -1922,7 +1922,7 @@ private: + + dwarf_file_t file_handle; + file_handle.reset(open(filename_object.c_str(), O_RDONLY)); +- if (file_handle < 0) { ++ if (file_handle < (void*)0) { + return r; + } + diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch new file mode 100644 index 0000000000000..64af88b598b8c --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch @@ -0,0 +1,79 @@ +From 74dd7d6733d1ab6b79994f4acbc1ad86ba950d23 Mon Sep 17 00:00:00 2001 +From: Michael Truog +Date: Tue, 14 Apr 2020 13:28:11 -0700 +Subject: [PATCH] Fix for C++ compilers without C++11 + +--- + backward.hpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/backward.hpp b/backward.hpp +index 6efa46d..1fa0bdc 100644 +--- a/backward.hpp ++++ b/backward.hpp +@@ -481,7 +481,7 @@ template struct default_delete { + void operator()(T &ptr) const { delete ptr; } + }; + +-template > ++template > + class handle { + struct dummy; + T _val; +@@ -1262,7 +1262,7 @@ class TraceResolverLinuxImpl + bool _bfd_loaded; + + typedef details::handle> ++ details::deleter > + bfd_handle_t; + + typedef details::handle bfd_symtab_t; +@@ -1636,9 +1636,9 @@ class TraceResolverLinuxImpl + } + + private: +- typedef details::handle> ++ typedef details::handle > + dwfl_handle_t; +- details::handle> ++ details::handle > + _dwfl_cb; + dwfl_handle_t _dwfl_handle; + bool _dwfl_handle_initialized; +@@ -1962,14 +1962,14 @@ class TraceResolverLinuxImpl + private: + bool _dwarf_loaded; + +- typedef details::handle> ++ typedef details::handle > + dwarf_file_t; + +- typedef details::handle> ++ typedef details::handle > + dwarf_elf_t; + + typedef details::handle> ++ details::deleter > + dwarf_handle_t; + + typedef std::map die_linemap_t; +@@ -3403,7 +3403,7 @@ class TraceResolver : public TraceResolverImpl {}; + + class SourceFile { + public: +- typedef std::vector> lines_t; ++ typedef std::vector > lines_t; + + SourceFile() {} + SourceFile(const std::string &path) { +@@ -3514,7 +3514,7 @@ class SourceFile { + #endif + + private: +- details::handle> ++ details::handle > + _file; + + std::vector get_paths_from_env_variable_impl() { diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch new file mode 100644 index 0000000000000..b8743d5496f52 --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch @@ -0,0 +1,10 @@ +--- backward.hpp.old 2020-05-05 20:37:23.473359490 +0200 ++++ backward.hpp 2020-05-05 20:38:57.019308525 +0200 +@@ -309,6 +309,6 @@ + #include + #include + #include ++#include +- + #include + typedef SSIZE_T ssize_t; diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5-mingw.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5-mingw.patch new file mode 100644 index 0000000000000..e274749027f9c --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5-mingw.patch @@ -0,0 +1,16 @@ +--- backward.hpp ++++ backward.hpp +@@ -313,1 +313,1 @@ +-#include ++#include +@@ -317,1 +317,1 @@ +-#include ++#include +@@ -320,1 +320,1 @@ +-#include ++#include +@@ -4017,2 +4017,2 @@ +- set_terminate(&terminator); +- set_unexpected(&terminator); ++ std::set_terminate(&terminator); ++ std::set_unexpected(&terminator); diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch new file mode 100644 index 0000000000000..2fa198687d928 --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch @@ -0,0 +1,73 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,7 @@ + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + # SOFTWARE. + +-cmake_minimum_required(VERSION 3.0) ++cmake_minimum_required(VERSION 3.8) + project(backward CXX) + + # Introduce variables: +@@ -45,8 +45,6 @@ if (DEFINED ENV{OMPI_CXX} OR DEFINED ENV{MPICH_CXX}) + endif() + + # set CXX standard +-set(CMAKE_CXX_STANDARD_REQUIRED True) +-set(CMAKE_CXX_STANDARD 11) + if (${COMPILER_IS_NVCC}) + # GNU CXX extensions are not supported by nvcc + set(CMAKE_CXX_EXTENSIONS OFF) +@@ -59,7 +57,7 @@ endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + if (NOT ${COMPILER_IS_NVCC}) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + endif() +@@ -68,11 +66,13 @@ endif() + # BACKWARD OBJECT + ############################################################################### + ++if(0) + add_library(backward_object OBJECT backward.cpp) + target_compile_definitions(backward_object PRIVATE ${BACKWARD_DEFINITIONS}) + target_include_directories(backward_object PRIVATE ${BACKWARD_INCLUDE_DIRS}) + set(BACKWARD_ENABLE $ CACHE STRING + "Link with this object to setup backward automatically") ++endif() + + + ############################################################################### +@@ -86,6 +86,19 @@ endif() + add_library(backward ${libtype} backward.cpp) + target_compile_definitions(backward PUBLIC ${BACKWARD_DEFINITIONS}) + target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS}) ++target_compile_features(backward PUBLIC cxx_std_11) ++if(STACK_DETAILS_DW) ++ find_package(elfutils REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC elfutils::libdw) ++endif() ++if(STACK_DETAILS_BFD) ++ find_package(binutils REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC binutils::binutils) ++endif() ++if(STACK_DETAILS_DWARF) ++ find_package(libdwarf REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC libdwarf::libdwarf) ++endif() + + ############################################################################### + # TESTS +@@ -137,3 +150,9 @@ install( + FILES "BackwardConfig.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/backward + ) ++install( ++ TARGETS backward ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) diff --git a/recipes/backward-cpp/all/test_package/CMakeLists.txt b/recipes/backward-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9950bd34800a4 --- /dev/null +++ b/recipes/backward-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Backward REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Backward::Backward) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/backward-cpp/all/test_package/conanfile.py b/recipes/backward-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/backward-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/backward-cpp/all/test_package/test_package.cpp b/recipes/backward-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b27499ff97339 --- /dev/null +++ b/recipes/backward-cpp/all/test_package/test_package.cpp @@ -0,0 +1,45 @@ +/* + * test/stacktrace.cpp + * Copyright 2013 Google Inc. All Rights Reserved. + * + * 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 + +using namespace backward; + +void d(StackTrace& st) { st.load_here(); } +void c(StackTrace& st) { return d(st); } +void b(StackTrace& st) { return c(st); } +void a(StackTrace& st) { return b(st); } + +int main() +{ + Printer printer; + + StackTrace st; + a(st); + + printer.print(st, std::cout); + + return 0; +} diff --git a/recipes/backward-cpp/all/test_v1_package/CMakeLists.txt b/recipes/backward-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/backward-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/backward-cpp/all/test_v1_package/conanfile.py b/recipes/backward-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/backward-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/backward-cpp/config.yml b/recipes/backward-cpp/config.yml new file mode 100644 index 0000000000000..2379ce6b78062 --- /dev/null +++ b/recipes/backward-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "1.6": + folder: all + "1.5": + folder: all + "1.4": + folder: all diff --git a/recipes/bacnet-stack/all/conandata.yml b/recipes/bacnet-stack/all/conandata.yml new file mode 100644 index 0000000000000..d44111989de5e --- /dev/null +++ b/recipes/bacnet-stack/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.0": + url: "https://github.com/bacnet-stack/bacnet-stack/archive/refs/tags/bacnet-stack-1.0.0.tar.gz" + sha256: "8dad24decb3870bc8147a1ea5eecd5c6f8c1205ec48d5ae4d454085427122658" +patches: + "1.0.0": + - patch_file: "patches/0001-fix-dll-install.patch" + patch_description: "Fix installation of dll" + patch_type: "portability" + patch_source: "https://github.com/bacnet-stack/bacnet-stack/pull/351" diff --git a/recipes/bacnet-stack/all/conanfile.py b/recipes/bacnet-stack/all/conanfile.py new file mode 100644 index 0000000000000..69ae62a1c72de --- /dev/null +++ b/recipes/bacnet-stack/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class BacnetStackConan(ConanFile): + name = "bacnet-stack" + license = "GPL-2.0-or-later" + homepage = "https://github.com/bacnet-stack/bacnet-stack/" + url = "https://github.com/conan-io/conan-center-index" + description = """ + BACnet Protocol Stack library provides a BACnet application layer, + network layer and media access (MAC) layer communications services.""" + topics = ("bacnet") + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BACNET_STACK_BUILD_APPS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="gpl-2.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "license")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "bacnet-stack", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["bacnet-stack"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + if not self.options.shared: + self.cpp_info.defines = ["BACNET_STACK_STATIC_DEFINE"] + self.cpp_info.set_property("cmake_file_name", "bacnet-stack") + self.cpp_info.set_property("cmake_target_name", "bacnet-stack::bacnet-stack") diff --git a/recipes/bacnet-stack/all/patches/0001-fix-dll-install.patch b/recipes/bacnet-stack/all/patches/0001-fix-dll-install.patch new file mode 100644 index 0000000000000..b15286bcdd1e5 --- /dev/null +++ b/recipes/bacnet-stack/all/patches/0001-fix-dll-install.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -659,6 +659,7 @@ set(BACNET_STACK_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME + install( + TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}Targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib) + diff --git a/recipes/bacnet-stack/all/test_package/CMakeLists.txt b/recipes/bacnet-stack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ad98c1486c8f3 --- /dev/null +++ b/recipes/bacnet-stack/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(bacnet-stack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE bacnet-stack::bacnet-stack) diff --git a/recipes/bacnet-stack/all/test_package/conanfile.py b/recipes/bacnet-stack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a60b6fe8a1512 --- /dev/null +++ b/recipes/bacnet-stack/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 + + +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/bacnet-stack/all/test_package/test_package.c b/recipes/bacnet-stack/all/test_package/test_package.c new file mode 100644 index 0000000000000..317c15cde5c25 --- /dev/null +++ b/recipes/bacnet-stack/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include "bacnet/basic/object/device.h" +#include "bacnet/basic/service/h_apdu.h" +#include "bacnet/basic/binding/address.h" +#include "bacnet/bacdef.h" +#include "bacnet/basic/services.h" + +static void Init_Service_Handlers(void) +{ + Device_Init(NULL); + apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS, handler_who_is); + apdu_set_unrecognized_service_handler_handler(handler_unrecognized_service); + apdu_set_confirmed_handler( + SERVICE_CONFIRMED_READ_PROPERTY, handler_read_property); + apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_I_AM, handler_i_am_add); +} + +int main(int argc, char *argv[]) +{ + address_init(); + Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE); + Init_Service_Handlers(); + + return 0; +} diff --git a/recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt b/recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/bacnet-stack/all/test_v1_package/conanfile.py b/recipes/bacnet-stack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6005bae433a02 --- /dev/null +++ b/recipes/bacnet-stack/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestConan(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") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/bacnet-stack/config.yml b/recipes/bacnet-stack/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/bacnet-stack/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/baical-p7/all/conandata.yml b/recipes/baical-p7/all/conandata.yml new file mode 100644 index 0000000000000..7bc581c047835 --- /dev/null +++ b/recipes/baical-p7/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "5.6": + url: "http://baical.net/files/libP7Client_v5.6.zip" + sha256: "7503bdf739b9c2aea297b49fa0aa0162b7090830aee1cbd4cf7be5d3c75600de" +patches: + "5.6": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "Fix CMakeLists" + patch_type: "conan" diff --git a/recipes/baical-p7/all/conanfile.py b/recipes/baical-p7/all/conanfile.py new file mode 100644 index 0000000000000..d193b92014a9d --- /dev/null +++ b/recipes/baical-p7/all/conanfile.py @@ -0,0 +1,72 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class BaicalP7Conan(ConanFile): + name = "baical-p7" + license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://baical.net/p7.html" + topics = ("p7", "baical", "logging", "telemetry") + description = "Baical P7 client" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os not in ["Linux", "Windows"]: + raise ConanInvalidConfiguration("P7 only supports Windows and Linux at this time") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["P7_TESTS_BUILD"] = False + tc.cache_variables["P7_BUILD_SHARED"] = self.options.shared + tc.variables["P7_EXAMPLES_BUILD"] = False + tc.generate() + + 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 = ["p7-shared" if self.options.shared else "p7"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "rt", "pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/baical-p7/all/patches/0001-fix-cmake.patch b/recipes/baical-p7/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..dbedad975e252 --- /dev/null +++ b/recipes/baical-p7/all/patches/0001-fix-cmake.patch @@ -0,0 +1,86 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ + cmake_minimum_required(VERSION 3.0 FATAL_ERROR) + +-#project(p7lib) ++project(p7lib) + + #>>Build options ********************************************************************** + option(P7_TESTS_BUILD "Build test" OFF) +@@ -25,7 +25,6 @@ if(NOT DEFINED ROOT_P7_PATH) + set(ROOT_P7_PATH ${PROJECT_SOURCE_DIR} CACHE INTERNAL "") + set(PATH_P7 ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "") + set(PATH_P7_API "${PROJECT_SOURCE_DIR}/Headers" CACHE INTERNAL "") +-else(expression) + endif(NOT DEFINED ROOT_P7_PATH) + + if(MSVC) +--- a/Sources/CMakeLists.txt ++++ b/Sources/CMakeLists.txt +@@ -7,7 +7,7 @@ include_directories(${PATH_SHARED_PLATFORM}) + include_directories(${PATH_P7_API}) + + if(WIN32) +- set(P7_PLATFORM_LIBS Ws2_32) ++ set(P7_PLATFORM_LIBS ws2_32) + elseif(UNIX) + set(P7_PLATFORM_LIBS rt pthread) + else() +@@ -16,29 +16,38 @@ endif() + + aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} P7_SOURCES) + ++if(NOT P7_BUILD_SHARED) + add_library(${PROJECT_NAME} STATIC ${P7_SOURCES}) + target_link_libraries(${PROJECT_NAME} PUBLIC ${P7_PLATFORM_LIBS}) ++endif() + + if(P7_BUILD_SHARED) + add_library(${PROJECT_NAME}-shared SHARED ${P7_SOURCES}) + target_link_libraries(${PROJECT_NAME}-shared ${P7_PLATFORM_LIBS}) + endif() + ++if(NOT P7_BUILD_SHARED) + set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) ++endif() + + if(P7_BUILD_SHARED) + set_property(TARGET ${PROJECT_NAME}-shared PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() + + ++if(NOT P7_BUILD_SHARED) + target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../Headers/") ++endif() + if(P7_BUILD_SHARED) + target_include_directories(${PROJECT_NAME}-shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../Headers/") + endif() + ++if(NOT P7_BUILD_SHARED) + target_include_directories(${PROJECT_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/../Headers/") + target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../Shared/") ++endif() + ++if(NOT P7_BUILD_SHARED) + if(WIN32) + target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../Shared/Platforms/Windows_x86/") + elseif(UNIX) +@@ -51,14 +60,15 @@ install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin + ) + +-if(P7_BUILD_SHARED) ++else() + install(TARGETS ${PROJECT_NAME}-shared + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) + endif() ++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../Headers/ DESTINATION include FILES_MATCHING PATTERN "*.h") + +-if(COMMAND set_ide_folder) ++if(0) + set_ide_folder(${PROJECT_NAME}) + if(P7_BUILD_SHARED) + set_ide_folder(${PROJECT_NAME}-shared) diff --git a/recipes/baical-p7/all/test_package/CMakeLists.txt b/recipes/baical-p7/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8eba5be9b5dc9 --- /dev/null +++ b/recipes/baical-p7/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(baical-p7 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE baical-p7::baical-p7) diff --git a/recipes/baical-p7/all/test_package/conanfile.py b/recipes/baical-p7/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/baical-p7/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/baical-p7/all/test_package/test_package.cpp b/recipes/baical-p7/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..97afb0859588b --- /dev/null +++ b/recipes/baical-p7/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +#include "P7_Trace.h" + +// Test to validate Conan package generated + +int main(int /*argc*/, const char * /*argv*/ []) { + + IP7_Client *l_pClient = NULL; + //create P7 client object + l_pClient = P7_Create_Client(TM("/P7.Pool=32768")); + if (l_pClient == NULL) { + std::cout << "Client is null.\n"; + return EXIT_FAILURE; + } + std::cout << "Created client successfully.\n"; + if (l_pClient) + { + l_pClient->Release(); + l_pClient = NULL; + } + return EXIT_SUCCESS; +} diff --git a/recipes/baical-p7/all/test_v1_package/CMakeLists.txt b/recipes/baical-p7/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/baical-p7/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/baical-p7/all/test_v1_package/conanfile.py b/recipes/baical-p7/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/baical-p7/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/baical-p7/config.yml b/recipes/baical-p7/config.yml new file mode 100644 index 0000000000000..4b1b737e38a01 --- /dev/null +++ b/recipes/baical-p7/config.yml @@ -0,0 +1,3 @@ +versions: + "5.6": + folder: all diff --git a/recipes/bandit/all/conandata.yml b/recipes/bandit/all/conandata.yml new file mode 100644 index 0000000000000..f6a1c1fc0eaad --- /dev/null +++ b/recipes/bandit/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20210618": + url: "https://github.com/banditcpp/bandit/archive/77f50861c09d794af9ae5f65111b330d9b721054.tar.gz" + sha256: "4fe2eeb623e16a09b56f7a4e3d8fde864a5a4a67226cb514945fa7e9a1ae216a" +patches: + "cci.20210618": + - patch_file: "patches/0001-change-snowhouse-path.patch" + patch_description: "Fix snowhouse.h include path" + patch_type: "conan" diff --git a/recipes/bandit/all/conanfile.py b/recipes/bandit/all/conanfile.py new file mode 100644 index 0000000000000..31fd2c6978fa4 --- /dev/null +++ b/recipes/bandit/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.3" + + +class BanditConan(ConanFile): + name = "bandit" + description = "Human-friendly unit testing for C++11" + topics = ("testing", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/banditcpp/bandit" + license = "MIT" + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def requirements(self): + self.requires("snowhouse/5.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def layout(self): + basic_layout(self) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, "docs"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include", "bandit"), src=os.path.join(self.source_folder, "bandit")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + diff --git a/recipes/bandit/all/patches/0001-change-snowhouse-path.patch b/recipes/bandit/all/patches/0001-change-snowhouse-path.patch new file mode 100644 index 0000000000000..1df54a4f04d5b --- /dev/null +++ b/recipes/bandit/all/patches/0001-change-snowhouse-path.patch @@ -0,0 +1,13 @@ +diff --git a/bandit/adapters/snowhouse.h b/bandit/adapters/snowhouse.h +index f3d9fde..ee3844c 100644 +--- a/bandit/adapters/snowhouse.h ++++ b/bandit/adapters/snowhouse.h +@@ -3,7 +3,7 @@ + + #include + #include +-#include ++#include + + namespace bandit { + namespace adapter { diff --git a/recipes/bandit/all/test_package/CMakeLists.txt b/recipes/bandit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..58ffec4a070b7 --- /dev/null +++ b/recipes/bandit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(bandit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} bandit::bandit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bandit/all/test_package/conanfile.py b/recipes/bandit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..40f70f535b209 --- /dev/null +++ b/recipes/bandit/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + 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/bandit/all/test_package/test_package.cpp b/recipes/bandit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..764be0a694402 --- /dev/null +++ b/recipes/bandit/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +using namespace snowhouse; +using namespace bandit; + +go_bandit([]() { + describe("context", []() { + bool b; + + before_each([&]() { + b = true; + }); + + it("is true", [&]() { + AssertThat(b, IsTrue()); + }); + }); +}); + +int main(int argc, char** argv) { + return bandit::run(argc, argv); +} + diff --git a/recipes/bandit/all/test_v1_package/CMakeLists.txt b/recipes/bandit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..08111eba078e8 --- /dev/null +++ b/recipes/bandit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bandit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bandit::bandit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bandit/all/test_v1_package/conanfile.py b/recipes/bandit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/bandit/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/bandit/config.yml b/recipes/bandit/config.yml new file mode 100644 index 0000000000000..5cbf4c1d7cb53 --- /dev/null +++ b/recipes/bandit/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210618": + folder: "all" diff --git a/recipes/base64/all/conandata.yml b/recipes/base64/all/conandata.yml new file mode 100644 index 0000000000000..6ebaff03fb45d --- /dev/null +++ b/recipes/base64/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.5.0": + url: "https://github.com/aklomp/base64/archive/v0.5.0.tar.gz" + sha256: "b21be58a90d31302ba86056db7ef77a481393b9359c505be5337d7d54e8a0559" + "0.4.0": + url: "https://github.com/aklomp/base64/archive/v0.4.0.tar.gz" + sha256: "1fce54059c504b2604c22c20cd930444a71b3340fc81334c037da63976d92002" +patches: + "0.5.0": + - patch_file: "patches/0.5.0-0001-make.patch" + patch_description: "add library taget" + patch_type: "conan" + "0.4.0": + - patch_file: "patches/0.4.0-0001-make.patch" + patch_description: "add library taget" + patch_type: "conan" + - patch_file: "patches/0.4.0-0002-cmake.patch" + patch_description: "provide CMakeLists.txt for MSVC" + patch_type: "conan" diff --git a/recipes/base64/all/conanfile.py b/recipes/base64/all/conanfile.py new file mode 100644 index 0000000000000..d56ae8c5bcf10 --- /dev/null +++ b/recipes/base64/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import Environment +from conan.tools.files import copy, get, apply_conandata_patches, chdir, export_conandata_patches, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +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 + +import os + +required_conan_version = ">=1.52.0" + +class Base64Conan(ConanFile): + name = "base64" + description = "Fast Base64 stream encoder/decoder" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aklomp/base64" + topics = ("base64", "codec", "encoder", "decoder") + 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: + 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 + + def layout(self): + if self._use_cmake: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def validate(self): + if Version(self.version) < "0.5.0" and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support build shared.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + @property + def _use_cmake(self): + return is_msvc(self) or Version(self.version) >= "0.5.0" + + def generate(self): + if self._use_cmake: + tc = CMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if self._use_cmake: + cmake = CMake(self) + cmake.configure() + if Version(self.version) >= "0.5.0": + cmake.build() + else: + cmake.build(target="base64") + else: + env = Environment() + if self.settings.arch == "x86" or self.settings.arch == "x86_64": + env.append("AVX2_CFLAGS", "-mavx2") + env.append("SSSE3_CFLAGS", "-mssse3") + env.append("SSE41_CFLAGS", "-msse4.1") + env.append("SSE42_CFLAGS", "-msse4.2") + env.append("AVX_CFLAGS", "-mavx") + else: + # ARM-specific instructions can be enabled here + pass + with env.vars(self).apply(), \ + chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(target="lib/libbase64.a") + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self._use_cmake: + cmake = CMake(self) + cmake.install() + if Version(self.version) >= "0.5.0": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib")) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + else: + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["base64"] + + if Version(self.version) >= "0.5.0" and not self.options.shared: + self.cpp_info.defines.append("BASE64_STATIC_DEFINE") diff --git a/recipes/base64/all/patches/0.4.0-0001-make.patch b/recipes/base64/all/patches/0.4.0-0001-make.patch new file mode 100644 index 0000000000000..4d2ccdeaaf51c --- /dev/null +++ b/recipes/base64/all/patches/0.4.0-0001-make.patch @@ -0,0 +1,12 @@ +--- a/Makefile 2019-11-20 12:30:15.000000000 +0300 ++++ b/Makefile 2020-12-02 10:27:54.156848500 +0300 +@@ -68,6 +68,9 @@ + $(LD) -r -o $@ $^ + $(OBJCOPY) --keep-global-symbols=lib/exports.txt $@ + ++lib/libbase64.a: $(OBJS) ++ $(AR) rc $@ $^ ++ + lib/config.h: + @echo "#define HAVE_AVX2 $(HAVE_AVX2)" > $@ + @echo "#define HAVE_NEON32 $(HAVE_NEON32)" >> $@ diff --git a/recipes/base64/all/patches/0.4.0-0002-cmake.patch b/recipes/base64/all/patches/0.4.0-0002-cmake.patch new file mode 100644 index 0000000000000..4b833cc2f77c3 --- /dev/null +++ b/recipes/base64/all/patches/0.4.0-0002-cmake.patch @@ -0,0 +1,388 @@ +--- a/CMakeLists.txt 1970-01-01 03:00:00.000000000 +0300 ++++ b/CMakeLists.txt 2018-04-11 15:19:34.000000000 +0300 +@@ -0,0 +1,202 @@ ++# Written in 2016-2017 by Henrik Steffen Gaßmann henrik@gassmann.onl ++# ++# To the extent possible under law, the author(s) have dedicated all ++# copyright and related and neighboring rights to this software to the ++# public domain worldwide. This software is distributed without any warranty. ++# ++# You should have received a copy of the CC0 Public Domain Dedication ++# along with this software. If not, see ++# ++# http://creativecommons.org/publicdomain/zero/1.0/ ++# ++######################################################################## ++cmake_minimum_required(VERSION 3.1) ++ ++project(base64 LANGUAGES C VERSION 0.3.0) ++ ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") ++ ++####################################################################### ++# platform detection ++include(TargetArch) ++detect_target_architecture(_TARGET_ARCH) ++ ++ ++######################################################################## ++# Compilation options ++option(BASE64_INSTALL_TARGET "add an install target" ON) ++option(BASE64_BUILD_TESTS "add test projects" ON) ++option(BASE64_WITH_OPENMP "use openmp" OFF) ++ ++if (_TARGET_ARCH STREQUAL "x86" OR _TARGET_ARCH STREQUAL "x64") ++ option(BASE64_WITH_FAST_UNALIGNED_ACCESS "vectorization: unaligned access enabled" ON) ++ option(BASE64_WITH_SSSE3 "add SSSE 3 codepath" ON) ++ option(BASE64_WITH_SSE41 "add SSE 4.1 codepath" ON) ++ option(BASE64_WITH_SSE42 "add SSE 4.2 codepath" ON) ++ option(BASE64_WITH_AVX "add AVX codepath" ON) ++ option(BASE64_WITH_AVX2 "add AVX 2 codepath" ON) ++ ++elseif (_TARGET_ARCH STREQUAL "arm") ++ option(BASE64_WITH_NEON32 "add NEON32 codepath" OFF) ++ ++elseif (_TARGET_ARCH STREQUAL "arm64") ++ option(BASE64_WITH_NEON64 "add NEON64 codepath" ON) ++ ++endif() ++ ++################################################################### ++# OpenMP ++if(BASE64_WITH_OPENMP) ++ find_package(OpenMP) ++ if (OPENMP_FOUND) ++ option(BASE64_USE_OpenMP "Utilize OpenMP to parallelize encoding and decoding." ON) ++ endif() ++endif() ++ ++######################################################################## ++# library project ++add_library(base64 STATIC ++ # library files ++ lib/lib.c ++ lib/codec_choose.c ++ include/libbase64.h ++ ++ # codec implementations ++ lib/arch/generic/codec.c ++ ++ lib/arch/ssse3/codec.c ++ lib/arch/sse41/codec.c ++ lib/arch/sse42/codec.c ++ lib/arch/avx/codec.c ++ lib/arch/avx2/codec.c ++ ++ lib/arch/neon32/codec.c ++ lib/arch/neon64/codec.c ++) ++ ++if (NOT BASE64_STANDALONE_PROJECT) ++ # export inlucde path if base64 added as subdirectory ++ target_include_directories(base64 INTERFACE ++ $ ++ ) ++endif() ++ ++#################################################################### ++# platform/compiler specific configuration ++set_target_properties(base64 PROPERTIES ++ C_STANDARD 99 ++ C_STANDARD_REQUIRED YES ++ C_EXTENSIONS OFF ++) ++ ++target_compile_options(base64 PRIVATE ++ $<$: ++ /W4 ++ /WX # All warnings as error ++ /we4013 # Error warning C4013: 'function' undefined; assuming extern returning int ++ /we4700 # Error warning C4700: uninitialized local variable ++ /we4715 # not all control paths return a value ++ /we4003 # not enough actual parameters for macro ++ /wd4456 # disable warning C4456: declaration of 'xxx' hides previous local declaration ++ > ++ $<$>: ++ -Wall ++ -Wextra ++ -Wpedantic ++ > ++) ++ ++target_compile_definitions(base64 PRIVATE ++ $<$: ++ # remove unnecessary warnings about unchecked iterators ++ _SCL_SECURE_NO_WARNINGS ++ > ++) ++ ++######################################################################## ++# SIMD settings ++include(TargetSIMDInstructionSet) ++define_SIMD_compile_flags() ++ ++if (_TARGET_ARCH STREQUAL "x86" OR _TARGET_ARCH STREQUAL "x64") ++ macro(configure_codec _TYPE) ++ if (BASE64_WITH_${_TYPE}) ++ message(STATUS "Add codec: lib/arch/${_DIR}/codec.c") ++ string(TOLOWER "${_TYPE}" _DIR) ++ set_source_files_properties("lib/arch/${_DIR}/codec.c" PROPERTIES ++ COMPILE_FLAGS "${COMPILE_FLAGS_${_TYPE}}" ++ ) ++ ++ if (${ARGC} GREATER 1 AND MSVC) ++ set_source_files_properties("lib/arch/${_DIR}/codec.c" PROPERTIES ++ COMPILE_DEFINITIONS ${ARGV1} ++ ) ++ endif() ++ endif() ++ endmacro() ++ ++ configure_codec(SSSE3 __SSSE3__) ++ configure_codec(SSE41 __SSSE4_1__) ++ configure_codec(SSE42 __SSSE4_2__) ++ configure_codec(AVX) ++ configure_codec(AVX2) ++ ++elseif (_TARGET_ARCH STREQUAL "arm") ++ set(BASE64_NEON32_CFLAGS "${COMPILE_FLAGS_NEON32}" CACHE STRING "the NEON32 compile flags (for 'lib/arch/neon32/codec.c')") ++ mark_as_advanced(BASE64_NEON32_CFLAGS) ++ ++ if (BASE64_WITH_NEON32) ++ set_source_files_properties("lib/arch/neon32/codec.c" PROPERTIES ++ COMPILE_FLAGS "${BASE64_NEON32_CFLAGS} " ++ ) ++ endif() ++ ++#elseif (_TARGET_ARCH STREQUAL "arm64" AND BASE64_WITH_NEON64) ++ ++endif() ++ ++configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) ++target_include_directories(base64 PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") ++ ++######################################################################## ++# OpenMP Settings ++if (BASE64_USE_OpenMP) ++ target_compile_options(base64 ++ PRIVATE ++ ${OpenMP_C_FLAGS} ++ ) ++endif() ++ ++######################################################################## ++if (BASE64_BUILD_TESTS) ++ enable_testing() ++ add_subdirectory(test) ++endif() ++ ++######################################################################## ++# install target ++if (BASE64_INSTALL_TARGET) ++ install(TARGETS base64 EXPORT base64-targets ++ RUNTIME DESTINATION bin/$ ++ LIBRARY DESTINATION lib/$ ++ ARCHIVE DESTINATION lib/$ ++ INCLUDES DESTINATION include ++ ) ++ install(FILES include/libbase64.h DESTINATION include) ++ ++ include(CMakePackageConfigHelpers) ++ write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/base64-config-version.cmake" ++ VERSION ${BASE64_VERSION} ++ COMPATIBILITY ExactVersion ++ ) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/base64-config-version.cmake" DESTINATION cmake) ++ ++ configure_file(cmake/base64-config.cmake ++ "${CMAKE_CURRENT_BINARY_DIR}/base64-config.cmake" ++ COPYONLY ++ ) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/base64-config.cmake" DESTINATION cmake) ++ ++ install(EXPORT base64-targets DESTINATION cmake) ++endif() +--- a/cmake/base64-config.cmake 1970-01-01 03:00:00.000000000 +0300 ++++ b/cmake/base64-config.cmake 2020-12-02 10:29:31.014613200 +0300 +@@ -0,0 +1 @@ ++include("${CMAKE_CURRENT_LIST_DIR}/base64-targets.cmake") +--- a/cmake/config.h.in 1970-01-01 03:00:00.000000000 +0300 ++++ b/cmake/config.h.in 2018-04-11 15:19:34.000000000 +0300 +@@ -0,0 +1,28 @@ ++#ifndef BASE64_CONFIG_H ++#define BASE64_CONFIG_H ++ ++#cmakedefine01 BASE64_WITH_SSSE3 ++#define HAVE_SSSE3 BASE64_WITH_SSSE3 ++ ++#cmakedefine01 BASE64_WITH_SSE41 ++#define HAVE_SSE41 BASE64_WITH_SSE41 ++ ++#cmakedefine01 BASE64_WITH_SSE42 ++#define HAVE_SSE42 BASE64_WITH_SSE42 ++ ++#cmakedefine01 BASE64_WITH_AVX ++#define HAVE_AVX BASE64_WITH_AVX ++ ++#cmakedefine01 BASE64_WITH_AVX2 ++#define HAVE_AVX2 BASE64_WITH_AVX2 ++ ++#cmakedefine01 BASE64_WITH_NEON32 ++#define HAVE_NEON32 BASE64_WITH_NEON32 ++ ++#cmakedefine01 BASE64_WITH_NEON64 ++#define HAVE_NEON64 BASE64_WITH_NEON64 ++ ++#cmakedefine01 BASE64_WITH_FAST_UNALIGNED_ACCESS ++#define HAVE_FAST_UNALIGNED_ACCESS BASE64_WITH_FAST_UNALIGNED_ACCESS ++ ++#endif // BASE64_CONFIG_H +--- a/cmake/Modules/TargetArch.cmake 1970-01-01 03:00:00.000000000 +0300 ++++ b/cmake/Modules/TargetArch.cmake 2018-04-11 15:19:34.000000000 +0300 +@@ -0,0 +1,29 @@ ++# Written in 2017 by Henrik Steffen Gaßmann henrik@gassmann.onl ++# ++# To the extent possible under law, the author(s) have dedicated all ++# copyright and related and neighboring rights to this software to the ++# public domain worldwide. This software is distributed without any warranty. ++# ++# You should have received a copy of the CC0 Public Domain Dedication ++# along with this software. If not, see ++# ++# http://creativecommons.org/publicdomain/zero/1.0/ ++# ++######################################################################## ++ ++set(TARGET_ARCHITECTURE_TEST_FILE "${CMAKE_CURRENT_LIST_DIR}/../test-arch.c") ++ ++function(detect_target_architecture OUTPUT_VARIABLE) ++ message(STATUS "${CMAKE_CURRENT_LIST_DIR}") ++ try_compile(_IGNORED "${CMAKE_CURRENT_BINARY_DIR}" ++ "${TARGET_ARCHITECTURE_TEST_FILE}" ++ OUTPUT_VARIABLE _LOG ++ ) ++ ++ string(REGEX MATCH "##arch=([^#]+)##" _IGNORED "${_LOG}") ++ ++ set(${OUTPUT_VARIABLE} "${CMAKE_MATCH_1}" PARENT_SCOPE) ++ if (CMAKE_MATCH_1 STREQUAL "unknown") ++ message(WARNING "could not detect the target architecture.") ++ endif() ++endfunction() +--- a/cmake/Modules/TargetSIMDInstructionSet.cmake 1970-01-01 03:00:00.000000000 +0300 ++++ b/cmake/Modules/TargetSIMDInstructionSet.cmake 2018-04-11 15:19:34.000000000 +0300 +@@ -0,0 +1,34 @@ ++# Written in 2016-2017 by Henrik Steffen Gaßmann henrik@gassmann.onl ++# ++# To the extent possible under law, the author(s) have dedicated all ++# copyright and related and neighboring rights to this software to the ++# public domain worldwide. This software is distributed without any warranty. ++# ++# You should have received a copy of the CC0 Public Domain Dedication ++# along with this software. If not, see ++# ++# http://creativecommons.org/publicdomain/zero/1.0/ ++# ++######################################################################## ++ ++######################################################################## ++# compiler flags definition ++macro(define_SIMD_compile_flags) ++ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") ++ # x86 ++ set(COMPILE_FLAGS_SSSE3 "-mssse3") ++ set(COMPILE_FLAGS_SSE41 "-msse4.1") ++ set(COMPILE_FLAGS_SSE42 "-msse4.2") ++ set(COMPILE_FLAGS_AVX "-mavx") ++ set(COMPILE_FLAGS_AVX2 "-mavx2") ++ ++ #arm ++ set(COMPILE_FLAGS_NEON32 "-mfpu=neon") ++ elseif(MSVC) ++ set(COMPILE_FLAGS_SSSE3 " ") ++ set(COMPILE_FLAGS_SSE41 " ") ++ set(COMPILE_FLAGS_SSE42 " ") ++ set(COMPILE_FLAGS_AVX "/arch:AVX2") ++ set(COMPILE_FLAGS_AVX2 "/arch:AVX2") ++ endif() ++endmacro(define_SIMD_compile_flags) +--- a/cmake/test-arch.c 1970-01-01 03:00:00.000000000 +0300 ++++ b/cmake/test-arch.c 2018-04-11 15:19:34.000000000 +0300 +@@ -0,0 +1,35 @@ ++// Written in 2017 by Henrik Steffen Gaßmann henrik@gassmann.onl ++// ++// To the extent possible under law, the author(s) have dedicated all ++// copyright and related and neighboring rights to this software to the ++// public domain worldwide. This software is distributed without any warranty. ++// ++// You should have received a copy of the CC0 Public Domain Dedication ++// along with this software. If not, see ++// ++// http://creativecommons.org/publicdomain/zero/1.0/ ++// ++//////////////////////////////////////////////////////////////////////////////// ++ ++// ARM 64-Bit ++#if defined(__aarch64__) ++#error ##arch=arm64## ++ ++// ARM 32-Bit ++#elif defined(__arm__) \ ++ || defined(_M_ARM) ++#error ##arch=arm## ++ ++// x86 64-Bit ++#elif defined(__x86_64__) \ ++ || defined(_M_X64) ++#error ##arch=x64## ++ ++// x86 32-Bit ++#elif defined(__i386__) \ ++ || defined(_M_IX86) ++#error ##arch=x86## ++ ++#else ++#error ##arch=unknown## ++#endif +--- a/test/CMakeLists.txt 1970-01-01 03:00:00.000000000 +0300 ++++ b/test/CMakeLists.txt 2020-12-01 13:59:57.970624200 +0300 +@@ -0,0 +1,38 @@ ++# Written in 2016 by Henrik Steffen Gaßmann henrik@gassmann.onl ++# ++# To the extent possible under law, the author(s) have dedicated all ++# copyright and related and neighboring rights to this software to the ++# public domain worldwide. This software is distributed without any warranty. ++# ++# You should have received a copy of the CC0 Public Domain Dedication ++# along with this software. If not, see ++# ++# http://creativecommons.org/publicdomain/zero/1.0/ ++# ++######################################################################## ++cmake_minimum_required(VERSION 3.1) ++ ++function(add_base64_test TEST_NAME) ++ unset(SRC_FILE) ++ foreach(SRC_FILE ${ARGN}) ++ list(APPEND SRC_FILES "${SRC_FILE}") ++ endforeach() ++ ++ add_executable(${TEST_NAME} ${SRC_FILES}) ++ target_link_libraries(${TEST_NAME} base64) ++ ++ add_test(NAME ${TEST_NAME} ++ COMMAND ${TEST_NAME} ++ ) ++endfunction() ++ ++ ++add_base64_test(test_base64 ++ codec_supported.c ++ test_base64.c ++) ++ ++add_base64_test(benchmark ++ codec_supported.c ++ benchmark.c ++) diff --git a/recipes/base64/all/patches/0.5.0-0001-make.patch b/recipes/base64/all/patches/0.5.0-0001-make.patch new file mode 100644 index 0000000000000..f20d7ff2ec119 --- /dev/null +++ b/recipes/base64/all/patches/0.5.0-0001-make.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile b/Makefile +index 2bb01e2..200ca73 100644 +--- a/Makefile ++++ b/Makefile +@@ -63,6 +63,9 @@ lib/libbase64.o: $(OBJS) + $(LD) -r -o $@ $^ + $(OBJCOPY) --keep-global-symbols=lib/exports.txt $@ + ++lib/libbase64.a: $(OBJS) ++ $(AR) rc $@ $^ ++ + lib/config.h: + @echo "#define HAVE_AVX2 $(HAVE_AVX2)" > $@ + @echo "#define HAVE_NEON32 $(HAVE_NEON32)" >> $@ diff --git a/recipes/base64/all/test_package/CMakeLists.txt b/recipes/base64/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..195fdf269b250 --- /dev/null +++ b/recipes/base64/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +find_package(base64 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE base64::base64) diff --git a/recipes/base64/all/test_package/conanfile.py b/recipes/base64/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/base64/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/base64/all/test_package/test_package.c b/recipes/base64/all/test_package/test_package.c new file mode 100644 index 0000000000000..799e690b3b129 --- /dev/null +++ b/recipes/base64/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include +#include +#include + +int main() { + int flags = 0; + const char * src = "YW55IGNhcm5hbCBwbGVhc3VyZQ=="; + char enc[128], dec[128]; + size_t srclen = strlen(src); + size_t enclen, declen; + + base64_decode(src, srclen, enc, &enclen, flags); + enc[enclen] = '\0'; + printf("decoded size (\"any carnal pleasure\"): %zu\n", enclen); + base64_encode(enc, enclen, dec, &declen, flags); + dec[declen] = '\0'; + printf("%s\n", dec); + return 0; +} + diff --git a/recipes/base64/all/test_v1_package/CMakeLists.txt b/recipes/base64/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c32de99d28f7 --- /dev/null +++ b/recipes/base64/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(base64 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE base64::base64) diff --git a/recipes/base64/all/test_v1_package/conanfile.py b/recipes/base64/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/base64/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/base64/config.yml b/recipes/base64/config.yml new file mode 100644 index 0000000000000..d13fcfd021b7b --- /dev/null +++ b/recipes/base64/config.yml @@ -0,0 +1,5 @@ +versions: + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/bazel/all/conandata.yml b/recipes/bazel/all/conandata.yml new file mode 100644 index 0000000000000..00f7c7d9a52af --- /dev/null +++ b/recipes/bazel/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.0.0": + - url: "https://raw.githubusercontent.com/bazelbuild/bazel/4.0.0/LICENSE" + sha256: cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 + - url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-darwin-x86_64" + sha256: "349f3c9dd24191369c1073c57cc1386fc3c2d4ad7d44135c3d873c9dc67fae1f" + - url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-linux-x86_64" + sha256: "7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901" + - url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-windows-x86_64.exe" + sha256: "43930bbbc8b5d618884ee8145e1ec181760bf9eea42d16217a30381d176e4cf6" diff --git a/recipes/bazel/all/conanfile.py b/recipes/bazel/all/conanfile.py new file mode 100644 index 0000000000000..710635dca3f71 --- /dev/null +++ b/recipes/bazel/all/conanfile.py @@ -0,0 +1,53 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class BazelConan(ConanFile): + name = "bazel" + description = "Bazel is a fast, scalable, multi-language and extensible build system." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bazel.build/" + topics = ("test", "build", "automation") + settings = "os", "arch" + no_copy_source = True + + @property + def _program_suffix(self): + return ".exe" if self.settings.os == "Windows" else "" + + def _chmod_plus_x(self, name): + os.chmod(name, os.stat(name).st_mode | 0o111) + + @property + def _bazel_filename(self): + platform = "darwin" if self.settings.os == "Macos" else str(self.settings.os).lower() + return "bazel-{}-{}-{}{}".format(self.version, platform, self.settings.arch, self._program_suffix) + + def validate(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Only amd64 is supported for this package.") + if self.settings.os not in ["Linux", "Macos", "Windows"]: + raise ConanInvalidConfiguration("Only Linux, Windows and OSX are supported for this package.") + + def build(self): + for source in self.conan_data["sources"][self.version]: + url = source["url"] + filename = url[url.rfind("/") + 1:] + if filename in ["LICENSE", self._bazel_filename]: + tools.download(url, filename) + tools.check_sha256(filename, source["sha256"]) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses") + self.copy(pattern=self._bazel_filename, dst="bin") + old_target_filename = os.path.join(self.package_folder, "bin", self._bazel_filename) + new_target_filename = os.path.join(self.package_folder, "bin", "bazel" + self._program_suffix) + tools.rename(old_target_filename, new_target_filename) + self._chmod_plus_x(new_target_filename) + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable with : {0}".format(bin_path)) + self.env_info.path.append(bin_path) diff --git a/recipes/bazel/all/test_package/conanfile.py b/recipes/bazel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..829753e7fee0f --- /dev/null +++ b/recipes/bazel/all/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile + + +class TestPackage(ConanFile): + settings = "os", "arch" + + def test(self): + self.run("bazel --version", run_environment=True) + diff --git a/recipes/bazel/config.yml b/recipes/bazel/config.yml new file mode 100644 index 0000000000000..d2be8f453d7c0 --- /dev/null +++ b/recipes/bazel/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.0": + folder: all diff --git a/recipes/bdwgc/all/conandata.yml b/recipes/bdwgc/all/conandata.yml new file mode 100644 index 0000000000000..97d6a0b86b6e9 --- /dev/null +++ b/recipes/bdwgc/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "8.0.4": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz" + sha256: "436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d" + "8.0.6": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.0.6/gc-8.0.6.tar.gz" + sha256: "3b4914abc9fa76593596773e4da671d7ed4d5390e3d46fbf2e5f155e121bea11" + "8.2.2": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.2/gc-8.2.2.tar.gz" + sha256: "f30107bcb062e0920a790ffffa56d9512348546859364c23a14be264b38836a0" +patches: + "8.0.4": + - patch_file: "patches/update-cmake-8_0_4.patch" + "8.0.6": + - patch_file: "patches/update-cmake-8_0_6.patch" + "8.2.2": + - patch_file: "patches/update-cmake-8_2_2.patch" diff --git a/recipes/bdwgc/all/conanfile.py b/recipes/bdwgc/all/conanfile.py new file mode 100644 index 0000000000000..925a47c27595c --- /dev/null +++ b/recipes/bdwgc/all/conanfile.py @@ -0,0 +1,169 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, get, save, rmdir, copy, load +from conan.errors import ConanException +import os + +required_conan_version = ">=1.50.0" + + +class BdwGcConan(ConanFile): + name = "bdwgc" + homepage = "https://www.hboehm.info/gc/" + description = "The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (libgc, bdwgc, boehm-gc)" + topics = ("gc", "garbage", "collector") + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "compiler", "build_type", "arch" + + _autotools_options_defaults = ( + ("cplusplus", False,), + ("throw_bad_alloc_library", True,), + ("cord", True,), + ("threads", True,), + ("parallel_mark", True,), + ("handle_fork", True,), + ("thread_local_alloc", True,), + ("threads_discovery", True,), + ("gcj_support", True,), + ("java_finalization", True,), + ("sigrt_signals", False,), + ("atomic_uncollectable", True,), + ("gc_debug", False,), + ("redirect_malloc", False,), + ("disclaim", True,), + ("large_config", True,), + ("gc_assertions", False,), + ("mmap", False,), + ("munmap", True,), + ("dynamic_loading", True,), + ("register_main_static_data", True,), + ("checksums", False,), + ("single_obj_compilation", False,), + ) + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + } + for option, default in _autotools_options_defaults: + options[option] = [True, False] + default_options[option] = default + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def 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 + if Version(self.version) < "8.2.0": + del self.options.throw_bad_alloc_library + if not self.options.cplusplus: + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os == "Windows": + self.requires("libatomic_ops/7.6.14") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + for option, _ in self._autotools_options_defaults: + if option == "cord": + tc.variables["build_cord"] = self.options.get_safe(option) + elif option == "cplusplus": + tc.cache_variables["enable_cplusplus"] = str(self.options.get_safe(option)) + else: + tc.variables["enable_{}".format(option)] = self.options.get_safe(option) + tc.variables["disable_gc_debug"] = not self.options.gc_debug + tc.variables["disable_handle_fork"] = not self.options.handle_fork + tc.variables["install_headers"] = True + tc.variables["enable_docs"] = False + tc.variables["build_tests"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _extract_copyright(self): + readme_md = load(self, os.path.join(self.source_folder, "README.md")) + copyright_header = "## Copyright & Warranty\n" + index = readme_md.find(copyright_header) + if index == -1: + raise ConanException("Could not extract license from README file.") + return readme_md[index+len(copyright_header):] + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "COPYRIGHT"), self._extract_copyright()) + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "BDWgc") + self.cpp_info.set_property("cmake_target_name", "BDWgc::BDWgc") + + # TODO: Remove on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "BDWgc" + self.cpp_info.names["cmake_find_package_multi"] = "BDWgc" + + self.cpp_info.components["gc"].set_property("cmake_target_name", "BDWgc::gc") + self.cpp_info.components["gc"].set_property("pkg_config_name", "bdw-gc") + self.cpp_info.components["gc"].libs = ["gc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["gc"].system_libs = ["pthread", "dl"] + self.cpp_info.components["gc"].defines = ["GC_DLL" if self.options.shared else "GC_NOT_DLL"] + if self.options.gc_debug: + self.cpp_info.components["gc"].defines.append("GC_DEBUG") + if self.settings.os == "Windows": + self.cpp_info.components["gc"].requires = ["libatomic_ops::atomic_ops"] + + if self.options.cplusplus and self.options.get_safe("throw_bad_alloc_library"): + self.cpp_info.components["gctba"].set_property("cmake_target_name", "BDWgc::gctba") + self.cpp_info.components["gctba"].libs = ["gctba"] + self.cpp_info.components["gctba"].requires = ["gc"] + + if self.options.cplusplus: + self.cpp_info.components["gccpp"].set_property("cmake_target_name", "BDWgc::gccpp") + self.cpp_info.components["gccpp"].libs = ["gccpp"] + self.cpp_info.components["gccpp"].requires = ["gc"] + + if self.options.cord: + self.cpp_info.components["cord"].set_property("cmake_target_name", "BDWgc::cord") + self.cpp_info.components["cord"].libs = ["cord"] + self.cpp_info.components["cord"].requires = ["gc"] diff --git a/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch b/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch new file mode 100644 index 0000000000000..1af6e770494fc --- /dev/null +++ b/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch @@ -0,0 +1,841 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -21,241 +21,603 @@ + # this will generate gc.sln + # + +-SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required +- +-PROJECT(gc) +- +-INCLUDE(CTest) +- +-CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +- +-ADD_DEFINITIONS("-D_CRT_SECURE_NO_DEPRECATE +- -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION") +- +-IF(APPLE) +- IF("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "") +- SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;x86_64" CACHE STRING "Build architectures for Mac OS X" FORCE) +- ENDIF() +-ENDIF(APPLE) +- +-#LIBATOMIC #TODO +-#ADD_LIBRARY(atomic_ops STATIC ) +-#SET_TARGET_PROPERTIES(atomic_ops PROPERTIES COMPILE_FLAGS -DNO_DEBUGGING) +- +- +-#LIBGC +- +-INCLUDE_DIRECTORIES(include) +-INCLUDE_DIRECTORIES(libatomic_ops/src) +- +-SET(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c ++cmake_minimum_required(VERSION 3.1) ++ ++option(enable_cplusplus "C++ support" OFF) ++if (enable_cplusplus) ++ project(gc) ++else() ++ project(gc C) ++endif() ++ ++include(CheckCCompilerFlag) ++include(CheckCSourceCompiles) ++include(CheckFunctionExists) ++include(CheckIncludeFile) ++include(CheckSymbolExists) ++include(CTest) ++ ++# Customize the build by passing "-D=ON|OFF" in the command line. ++option(BUILD_SHARED_LIBS "Build shared libraries" ON) ++option(build_cord "Build cord library" ON) ++option(build_tests "Build tests" OFF) ++option(enable_threads "Support threads" ON) ++option(enable_parallel_mark "Parallelize marking and free list construction" ON) ++option(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON) ++option(enable_threads_discovery "Enable threads discovery in GC" ON) ++option(enable_gcj_support "Support for gcj" ON) ++option(enable_sigrt_signals "Use SIGRTMIN-based signals for thread suspend/resume" OFF) ++option(enable_gc_debug "Support for pointer back-tracing" OFF) ++option(disable_gc_debug "Disable debugging like GC_dump and its callees" OFF) ++option(enable_java_finalization "Support for java finalization" ON) ++option(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON) ++option(enable_redirect_malloc "Redirect malloc and friends to GC routines" OFF) ++option(enable_disclaim "Support alternative finalization interface" ON) ++option(enable_large_config "Optimize for large heap or root set" OFF) ++option(enable_gc_assertions "Enable collector-internal assertion checking" OFF) ++option(enable_mmap "Use mmap instead of sbrk to expand the heap" OFF) ++option(enable_munmap "Return page to the OS if empty for N collections" ON) ++option(enable_dynamic_loading "Enable tracing of dynamic library data roots" ON) ++option(enable_register_main_static_data "Perform the initial guess of data root sets" ON) ++option(enable_checksums "Report erroneously cleared dirty bits" OFF) ++option(enable_werror "Pass -Werror to the C compiler (treat warnings as errors)" OFF) ++option(enable_single_obj_compilation "Compile all libgc source files into single .o" OFF) ++option(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON) ++option(disable_handle_fork "Prohibit installation of pthread_atfork() handlers" OFF) ++option(install_headers "Install header files" ON) ++ ++add_definitions("-DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION") ++ ++if (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")) ++ set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" ++ CACHE STRING "Build architectures for Mac OS X" FORCE) ++endif() ++ ++# Set struct packing alignment to word (instead of 1-byte). ++if (BORLAND) ++ add_compile_options(/a4) ++elseif (WATCOM) ++ add_compile_options(/zp4) ++endif() ++ ++# Output all warnings. ++if (BORLAND) ++ # All warnings except for particular ones. ++ add_compile_options(/w /w-pro /w-aus /w-par /w-ccc /w-inl /w-rch) ++elseif (MSVC) ++ # All warnings but ignoring "unreferenced formal parameter" and ++ # "conditional expression is constant" ones. ++ add_compile_options(/W4 /wd4100 /wd4127) ++ # Disable crt security warnings, since unfortunately they warn about all ++ # sorts of safe uses of strncpy. ++ add_definitions("-D_CRT_SECURE_NO_DEPRECATE") ++elseif (WATCOM) ++ add_compile_options(/wx) ++else() ++ # TODO add -[W]pedantic -Wno-long-long ++ add_compile_options(-Wall -Wextra) ++endif() ++ ++include_directories(include) ++ ++set(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c + mark_rts.c headers.c mark.c obj_map.c blacklst.c finalize.c + new_hblk.c dbg_mlc.c malloc.c dyn_load.c typd_mlc.c ptr_chck.c + mallocx.c) +-SET(LIBS) +-OPTION(enable_threads "TODO" NO) +-IF(enable_threads) +- FIND_PACKAGE(Threads REQUIRED) +- MESSAGE("Thread Model: ${CMAKE_THREAD_LIBS_INIT}" ) +- INCLUDE_DIRECTORIES(${Threads_INCLUDE_DIR}) +- SET(LIBS ${LIBS} ${Threads_LIBRARIES}) +-ENDIF(enable_threads) +- +-OPTION(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON) +- +-OPTION(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON) +- +-OPTION(enable_parallel_mark "Parallelize marking and free list construction" ON) +- +-#IF(Threads_FOUND) +-# ADD_DEFINITIONS("") +-#ELSE +-# MESSAGE("Parallel mark requires enable_threads ON" ) +-#ENDIF(Threads_FOUND) +- +-#OPTION(enable_cplusplus "install C++ support" ON) +-SET(SRC ${SRC} gc_cpp.cc) +- +-SET(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM}) #FIXME missing the vendor field. +-STRING(TOLOWER ${_HOST} HOST) +-MESSAGE("HOST = ${HOST}") +- +-# Thread Detection. Relying on cmake for lib and includes. +-#TODO check cmake detection +-IF(CMAKE_USE_PTHREADS_INIT) +- SET(SRC ${SRC} pthread_start.c pthread_support.c pthread_stop_world.c) +- # Common defines for most POSIX platforms. +- IF( HOST MATCHES .*-.*-aix.*|.*-.*-android.*|.*-.*-cygwin.*|.*-.*-darwin.*|.*-.*-.*freebsd.*|.*-.*-haiku.*|.*-.*-gnu.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-.*linux.*|.*-.*-nacl.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*) +- ADD_DEFINITIONS("-DGC_THREADS -D_REENTRANT") +- IF(enable_parallel_mark) +- ADD_DEFINITIONS("-DPARALLEL_MARK") +- ENDIF(enable_parallel_mark) +- IF(enable_thread_local_alloc) +- ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC") +- SET(SRC ${SRC} thread_local_alloc.c) +- ENDIF(enable_thread_local_alloc) +- MESSAGE("Explicit GC_INIT() calls may be required.") +- ENDIF() +- IF ( HOST MATCHES .*-.*-hpux11.*) +- MESSAGE("Only HP/UX 11 POSIX threads are supported.") +- ADD_DEFINITIONS("-D_POSIX_C_SOURCE=199506L") #TODO test -DVAR=value. Alternative is COMPILE_DEFINITIONS property +- ENDIF() +- IF ( HOST MATCHES .*-.*-hpux10.*) +- MESSAGE("HP/UX 10 POSIX threads are not supported.") +- ENDIF() +- IF ( HOST MATCHES .*-.*-netbsd.*) +- MESSAGE("Only on NetBSD 2.0 or later.") +- ADD_DEFINITIONS("-D_PTHREADS") +- ENDIF() +- IF( HOST MATCHES .*-.*-android.*) +- # Android NDK does not provide pthread_atfork. +- ELSEIF( HOST MATCHES .*-.*-aix.*|.*-.*-cygwin.*|.*-.*-freebsd.*|.*-.*-haiku.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-kfreebsd.*-gnu|.*-.*-.*linux.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*) +- IF(enable_handle_fork) +- ADD_DEFINITIONS("-DHANDLE_FORK") +- ENDIF(enable_handle_fork) +- ENDIF() +- IF ( HOST MATCHES .*-.*-cygwin.*) +- SET(SRC ${SRC} win32_threads.c) +- ENDIF() +- IF ( HOST MATCHES .*-.*-darwin.*) +- IF(enable_handle_fork) +- # The incremental mode conflicts with fork handling. +- IF(enable_parallel_mark) +- ADD_DEFINITIONS("-DHANDLE_FORK") +- ENDIF(enable_parallel_mark) +- ENDIF(enable_handle_fork) +- SET(SRC ${SRC} darwin_stop_world.c) +- #TODO +- #darwin_threads=true +- ENDIF() +-ENDIF(CMAKE_USE_PTHREADS_INIT) +- +-IF(CMAKE_USE_WIN32_THREADS_INIT) +- ADD_DEFINITIONS("-DGC_THREADS") +- IF(enable_parallel_mark) +- ADD_DEFINITIONS("-DPARALLEL_MARK") +- IF(enable_thread_local_alloc) +- ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC") +- SET(SRC ${SRC} thread_local_alloc.c) +- ENDIF(enable_thread_local_alloc) +- ENDIF() +- ADD_DEFINITIONS("-DEMPTY_GETENV_RESULTS") #TODO test +- SET(SRC ${SRC} win32_threads.c) +-ENDIF(CMAKE_USE_WIN32_THREADS_INIT) +- +-OPTION(enable_gcj_support "Support for gcj" ON) +-IF(enable_gcj_support) +- ADD_DEFINITIONS("-DGC_GCJ_SUPPORT") +- IF(enable_threads) +- ADD_DEFINITIONS("-DGC_ENABLE_SUSPEND_THREAD") +- ENDIF(enable_threads) +- SET(SRC ${SRC} gcj_mlc.c) +-ENDIF(enable_gcj_support) +- +-OPTION(enable_disclaim "Support alternative finalization interface" ON) +-IF(enable_disclaim) +- ADD_DEFINITIONS("-DENABLE_DISCLAIM") +- SET(SRC ${SRC} fnlz_mlc.c) +-ENDIF(enable_disclaim) +- +-OPTION(enable_java_finalization "Support for java finalization" ON) +-IF(enable_java_finalization) +- ADD_DEFINITIONS("-DJAVA_FINALIZATION") +-ENDIF(enable_java_finalization) +- +-OPTION(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON) +-IF(enable_atomic_uncollectable) +- ADD_DEFINITIONS("-DGC_ATOMIC_UNCOLLECTABLE") +-ENDIF(enable_atomic_uncollectable) +- +-OPTION(enable_gc_debug "Support for pointer back-tracing" NO) +-IF(enable_gc_debug) +- ADD_DEFINITIONS("-DDBG_HDRS_ALL -DKEEP_BACK_PTRS") +- IF (HOST MATCHES ia64-.*-linux.*|i586-.*-linux.*|i686-.*-linux.*|x86-.*-linux.*|x86_64-.*-linux.*) +- ADD_DEFINITIONS("-DMAKE_BACK_GRAPH") +- ADD_DEFINITIONS("-DSAVE_CALL_COUNT=8") +- SET(SRC ${SRC} backgraph.c) +- ENDIF() +- IF (HOST MATCHES i.86-.*-dgux.*) +- ADD_DEFINITIONS("-DMAKE_BACK_GRAPH") +- SET(SRC ${SRC} backgraph.c) +- ENDIF() +-ENDIF(enable_gc_debug) +- +-OPTION(enable_redirect_malloc "Redirect malloc and friends to GC routines" NO) +-IF(enable_redirect_malloc) +- IF(enable_gc_debug) +- ADD_DEFINITIONS("-DREDIRECT_MALLOC=GC_debug_malloc_replacement") +- ADD_DEFINITIONS("-DREDIRECT_REALLOC=GC_debug_realloc_replacement") +- ADD_DEFINITIONS("-DREDIRECT_FREE=GC_debug_free") +- ELSE(enable_gc_debug) +- ADD_DEFINITIONS("-DREDIRECT_MALLOC=GC_malloc") +- ENDIF(enable_gc_debug) +- ADD_DEFINITIONS("-DGC_USE_DLOPEN_WRAP") +-ENDIF(enable_redirect_malloc) +- +-OPTION(enable_mmap "Use mmap instead of sbrk to expand the heap" NO) +- +-OPTION(enable_munmap "Return page to the OS if empty for N collections" ON) +-IF(enable_munmap) +- ADD_DEFINITIONS("-DUSE_MMAP -DUSE_MUNMAP") +-ELSEIF(enable_mmap) +- ADD_DEFINITIONS("-DUSE_MMAP") +-ENDIF() +- +-OPTION(enable_dynamic_loading "Enable tracing of dynamic library data roots" ON) +-IF(NOT enable_dynamic_loading) +- ADD_DEFINITIONS("-DIGNORE_DYNAMIC_LOADING") +-ENDIF() +- +-OPTION(enable_register_main_static_data "Perform the initial guess of data root sets" ON) +-IF(NOT enable_register_main_static_data) +- ADD_DEFINITIONS("-DGC_DONT_REGISTER_MAIN_STATIC_DATA") +-ENDIF() +- +-OPTION(enable_large_config "Optimize for large heap or root set" NO) +-IF(enable_large_config) +- ADD_DEFINITIONS("-DLARGE_CONFIG") +-ENDIF(enable_large_config) +- +-OPTION(enable_gc_assertions "Enable collector-internal assertion checking" NO) +-IF(enable_gc_assertions) +- ADD_DEFINITIONS("-DGC_ASSERTIONS") +-ENDIF(enable_gc_assertions) +- +-OPTION(enable_threads_discovery "Enable threads discovery in GC" ON) +-IF(NOT enable_threads_discovery) +- ADD_DEFINITIONS("-DGC_NO_THREADS_DISCOVERY") +-ENDIF() +- +-OPTION(enable_checksums "Report erroneously cleared dirty bits" NO) +-IF(enable_checksums) +- IF(enable_munmap OR enable_threads) +- MESSAGE("CHECKSUMS not compatible with USE_MUNMAP or threads") +- ENDIF() +- ADD_DEFINITIONS("-DCHECKSUMS") +- SET(SRC ${SRC} checksums.c) +-ENDIF(enable_checksums) +- +-ADD_LIBRARY( gc-lib STATIC ${SRC}) +-SET_TARGET_PROPERTIES(gc-lib PROPERTIES +- COMPILE_DEFINITIONS GC_NOT_DLL) +-#TODO TARGET_LINK_LIBRARIES(... ... ${LIBS}) +- +-ADD_LIBRARY( gcmt-lib STATIC ${SRC}) +-SET_TARGET_PROPERTIES(gcmt-lib PROPERTIES +- COMPILE_DEFINITIONS GC_NOT_DLL) +- +-ADD_LIBRARY( gcmt-dll SHARED ${SRC}) +- +-IF(WIN32) +- ADD_EXECUTABLE(cord cord/cordbscs.c cord/cordxtra.c +- cord/tests/de.c cord/tests/de_win.c) +- SET_TARGET_PROPERTIES(cord PROPERTIES WIN32_EXECUTABLE TRUE) +- SET_TARGET_PROPERTIES(cord PROPERTIES +- COMPILE_DEFINITIONS GC_NOT_DLL) +- TARGET_LINK_LIBRARIES(cord gc-lib) +- TARGET_LINK_LIBRARIES(cord gdi32) +-ENDIF(WIN32) +- +-ADD_SUBDIRECTORY(tests) ++set(THREADDLLIBS) ++ ++set(_HOST ${CMAKE_SYSTEM_PROCESSOR}-unknown-${CMAKE_SYSTEM}) ++string(TOLOWER ${_HOST} HOST) ++message(STATUS "TARGET = ${HOST}") ++ ++if (enable_threads) ++ if(NOT APPLE) ++ find_package(Threads REQUIRED) ++ message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") ++ include_directories(${Threads_INCLUDE_DIR}) ++ set(THREADDLLIBS ${CMAKE_THREAD_LIBS_INIT}) ++ endif() ++ if (MSVC) ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() ++ endif() ++ if (NOT (APPLE OR CYGWIN OR MSYS OR WIN32 OR HOST MATCHES mips-.*-irix6.*)) ++ set(THREADDLLIBS ${THREADDLLIBS} -ldl) ++ # The predefined CMAKE_DL_LIBS may be broken. ++ endif() ++endif(enable_threads) ++ ++# Thread support detection. ++if (CMAKE_USE_PTHREADS_INIT) ++ set(SRC ${SRC} pthread_start.c pthread_support.c pthread_stop_world.c) ++ if (HOST MATCHES .*-.*-hpux10.*) ++ message(FATAL_ERROR "HP/UX 10 POSIX threads are not supported.") ++ endif() ++ # Assume the compiler supports C11 (GCC) atomic intrinsics. ++ add_definitions("-DGC_BUILTIN_ATOMIC") ++ # Common defines for POSIX platforms. ++ add_definitions("-DGC_THREADS -D_REENTRANT") ++ if (enable_parallel_mark) ++ add_definitions("-DPARALLEL_MARK") ++ endif() ++ if (enable_thread_local_alloc) ++ add_definitions("-DTHREAD_LOCAL_ALLOC") ++ set(SRC ${SRC} thread_local_alloc.c) ++ endif() ++ message("Explicit GC_INIT() calls may be required.") ++ if (HOST MATCHES .*-.*-hpux11.*) ++ message("Only HP/UX 11 POSIX threads are supported.") ++ add_definitions("-D_POSIX_C_SOURCE=199506L") ++ elseif (HOST MATCHES .*-.*-netbsd.*) ++ message("Only on NetBSD 2.0 or later.") ++ add_definitions("-D_PTHREADS") ++ endif() ++ if (ANDROID OR MSYS) # ANDROID variable is defined by CMake v3.7.0+. ++ # Android NDK does not provide pthread_atfork. ++ elseif (APPLE) ++ if (enable_handle_fork AND NOT disable_handle_fork) ++ # The incremental mode conflicts with fork handling. ++ if (enable_parallel_mark) ++ add_definitions("-DHANDLE_FORK") ++ endif(enable_parallel_mark) ++ endif() ++ set(SRC ${SRC} darwin_stop_world.c) ++ elseif (enable_handle_fork AND NOT disable_handle_fork) ++ add_definitions("-DHANDLE_FORK") ++ endif() ++ if (enable_sigrt_signals) ++ add_definitions("-DGC_USESIGRT_SIGNALS") ++ endif() ++ if (CYGWIN OR MSYS) ++ set(SRC ${SRC} win32_threads.c) ++ endif() ++elseif (CMAKE_USE_WIN32_THREADS_INIT) ++ add_definitions("-DGC_THREADS") ++ if (enable_parallel_mark) ++ add_definitions("-DPARALLEL_MARK") ++ endif() ++ if (enable_thread_local_alloc AND (enable_parallel_mark OR NOT BUILD_SHARED_LIBS)) ++ # Imply THREAD_LOCAL_ALLOC unless GC_DLL. ++ add_definitions("-DTHREAD_LOCAL_ALLOC") ++ set(SRC ${SRC} thread_local_alloc.c) ++ endif() ++ add_definitions("-DEMPTY_GETENV_RESULTS") ++ set(SRC ${SRC} win32_threads.c) ++elseif (CMAKE_HP_PTHREADS_INIT OR CMAKE_USE_SPROC_INIT) ++ message(FATAL_ERROR "Unsupported thread package") ++endif() ++ ++if (disable_handle_fork) ++ add_definitions("-DNO_HANDLE_FORK") ++endif() ++ ++if (enable_gcj_support) ++ add_definitions("-DGC_GCJ_SUPPORT") ++ if (enable_threads AND NOT (enable_thread_local_alloc AND HOST MATCHES .*-.*-kfreebsd.*-gnu)) ++ # FIXME: For a reason, gctest hangs up on kFreeBSD if both of ++ # THREAD_LOCAL_ALLOC and GC_ENABLE_SUSPEND_THREAD are defined. ++ add_definitions("-DGC_ENABLE_SUSPEND_THREAD") ++ endif() ++ set(SRC ${SRC} gcj_mlc.c) ++endif(enable_gcj_support) ++ ++if (enable_disclaim) ++ add_definitions("-DENABLE_DISCLAIM") ++ set(SRC ${SRC} fnlz_mlc.c) ++endif() ++ ++if (enable_java_finalization) ++ add_definitions("-DJAVA_FINALIZATION") ++endif() ++ ++if (enable_atomic_uncollectable) ++ add_definitions("-DGC_ATOMIC_UNCOLLECTABLE") ++endif() ++ ++if (enable_gc_debug) ++ add_definitions("-DDBG_HDRS_ALL -DKEEP_BACK_PTRS") ++ if (HOST MATCHES i.86-.*-dgux.*|ia64-.*-linux.*|i586-.*-linux.*|i686-.*-linux.*|x86-.*-linux.*|x86_64-.*-linux.*) ++ add_definitions("-DMAKE_BACK_GRAPH") ++ if (HOST MATCHES .*-.*-.*linux.*) ++ add_definitions("-DSAVE_CALL_COUNT=8") ++ endif() ++ set(SRC ${SRC} backgraph.c) ++ endif() ++endif(enable_gc_debug) ++ ++if (disable_gc_debug) ++ add_definitions("-DNO_DEBUGGING") ++elseif (WINCE) ++ # Read environment variables from ".gc.env" file. ++ add_definitions("-DGC_READ_ENV_FILE") ++endif() ++ ++if (enable_redirect_malloc) ++ if (enable_gc_debug) ++ add_definitions("-DREDIRECT_MALLOC=GC_debug_malloc_replacement") ++ add_definitions("-DREDIRECT_REALLOC=GC_debug_realloc_replacement") ++ add_definitions("-DREDIRECT_FREE=GC_debug_free") ++ else() ++ add_definitions("-DREDIRECT_MALLOC=GC_malloc") ++ endif() ++ add_definitions("-DGC_USE_DLOPEN_WRAP") ++endif(enable_redirect_malloc) ++ ++if (enable_munmap) ++ add_definitions("-DUSE_MMAP -DUSE_MUNMAP") ++elseif (enable_mmap) ++ add_definitions("-DUSE_MMAP") ++endif() ++ ++if (NOT enable_dynamic_loading) ++ add_definitions("-DIGNORE_DYNAMIC_LOADING") ++endif() ++ ++if (NOT enable_register_main_static_data) ++ add_definitions("-DGC_DONT_REGISTER_MAIN_STATIC_DATA") ++endif() ++ ++if (enable_large_config) ++ add_definitions("-DLARGE_CONFIG") ++endif() ++ ++if (enable_gc_assertions) ++ add_definitions("-DGC_ASSERTIONS") ++endif() ++ ++if (NOT enable_threads_discovery) ++ add_definitions("-DGC_NO_THREADS_DISCOVERY") ++endif() ++ ++if (enable_checksums) ++ if (enable_munmap OR enable_threads) ++ message(FATAL_ERROR "CHECKSUMS not compatible with USE_MUNMAP or threads") ++ endif() ++ add_definitions("-DCHECKSUMS") ++ set(SRC ${SRC} checksums.c) ++endif(enable_checksums) ++ ++if (enable_werror) ++ if (BORLAND) ++ add_compile_options(/w!) ++ elseif (MSVC) ++ add_compile_options(/WX) ++ # Workaround "typedef ignored on left of ..." warning reported in ++ # imagehlp.h of e.g. Windows Kit 8.1. ++ add_compile_options(/wd4091) ++ elseif (WATCOM) ++ add_compile_options(/we) ++ else() ++ add_compile_options(-Werror) ++ if (APPLE) ++ # _dyld_bind_fully_image_containing_address is deprecated in OS X 10.5+ ++ add_compile_options(-Wno-deprecated-declarations) ++ endif() ++ endif() ++endif(enable_werror) ++ ++if (enable_single_obj_compilation OR BUILD_SHARED_LIBS) ++ set(SRC extra/gc.c) # override SRC ++ if (CMAKE_USE_PTHREADS_INIT) ++ add_definitions("-DGC_PTHREAD_START_STANDALONE") ++ set(SRC ${SRC} pthread_start.c) ++ endif(CMAKE_USE_PTHREADS_INIT) ++elseif (BORLAND) ++ # Suppress "GC_push_contents_hdr() is declared but never used" warning. ++ add_compile_options(/w-use) ++endif() ++ ++# Add implementation of backtrace() and backtrace_symbols(). ++if (MSVC) ++ set(SRC ${SRC} extra/msvc_dbg.c) ++endif() ++ ++# Instruct check_c_source_compiles and similar CMake checks not to ignore ++# compiler warnings (like "implicit declaration of function"). ++if (NOT BORLAND AND NOT MSVC AND NOT WATCOM) ++ check_c_compiler_flag(-Werror HAVE_FLAG_WERROR) ++ if (HAVE_FLAG_WERROR) ++ SET(CMAKE_REQUIRED_FLAGS "-Werror") ++ endif(HAVE_FLAG_WERROR) ++endif() ++ ++if (BUILD_SHARED_LIBS) ++ add_definitions("-DGC_DLL") ++ # Pass -fvisibility=hidden option if supported. ++ check_c_compiler_flag(-fvisibility=hidden HAVE_FLAG_F_VISIBILITY_HIDDEN) ++ if (HAVE_FLAG_F_VISIBILITY_HIDDEN) ++ add_definitions("-DGC_VISIBILITY_HIDDEN_SET") ++ add_compile_options(-fvisibility=hidden) ++ else() ++ add_definitions("-DGC_NO_VISIBILITY") ++ endif() ++ check_c_compiler_flag(-Wl,--no-undefined HAVE_FLAG_WL_NO_UNDEFINED) ++else() ++ add_definitions("-DGC_NOT_DLL") ++ if (WIN32) ++ # Do not require the clients to link with "user32" system library. ++ add_definitions("-DDONT_USE_USER32_DLL") ++ endif(WIN32) ++endif() ++ ++# Disable strict aliasing optimizations. ++# It could re-enabled back by a flag passed in CFLAGS_EXTRA. ++check_c_compiler_flag(-fno-strict-aliasing HAVE_FLAG_F_NO_STRICT_ALIASING) ++if (HAVE_FLAG_F_NO_STRICT_ALIASING) ++ add_compile_options(-fno-strict-aliasing) ++endif() ++ ++# Extra user-defined flags to pass both to C and C++ compilers. ++if (DEFINED CFLAGS_EXTRA) ++ add_compile_options(${CFLAGS_EXTRA}) ++endif() ++ ++# Check whether execinfo.h header file is present. ++check_include_file(execinfo.h HAVE_EXECINFO_H) ++if (NOT HAVE_EXECINFO_H) ++ add_definitions("-DGC_MISSING_EXECINFO_H") ++endif() ++ ++# Check for getcontext (uClibc can be configured without it, for example). ++check_function_exists(getcontext HAVE_GETCONTEXT) ++if (NOT HAVE_GETCONTEXT) ++ add_definitions("-DNO_GETCONTEXT") ++endif() ++ ++# Check whether dl_iterate_phdr exists (as a strong symbol). ++check_function_exists(dl_iterate_phdr HAVE_DL_ITERATE_PHDR) ++if (HAVE_DL_ITERATE_PHDR) ++ add_definitions("-DHAVE_DL_ITERATE_PHDR") ++endif() ++ ++check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP) ++if (NOT HAVE_SIGSETJMP) ++ add_definitions("-DGC_NO_SIGSETJMP") ++endif() ++ ++# pthread_setname_np, if available, may have 1, 2 or 3 arguments. ++if (CMAKE_USE_PTHREADS_INIT) ++ check_c_source_compiles(" ++#include \n ++int main(void) { (void)pthread_setname_np(\"thread-name\"); return 0; }" ++ HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) ++ if (HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) ++ # Define to use 'pthread_setname_np(const char*)' function. ++ add_definitions("-DHAVE_PTHREAD_SETNAME_NP_WITHOUT_TID") ++ else() ++ check_c_source_compiles(" ++#include \n ++int main(void) {\n ++ (void)pthread_setname_np(pthread_self(), \"thread-name-%u\", 0); return 0; }" ++ HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG) ++ if (HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG) ++ # Define to use 'pthread_setname_np(pthread_t, const char*, void *)'. ++ add_definitions("-DHAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG") ++ else() ++ check_c_source_compiles(" ++#if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) || defined(__CYGWIN__)\n ++#define _GNU_SOURCE 1\n ++#endif\n ++#include \n ++int main(void) {\n ++ (void)pthread_setname_np(pthread_self(), \"thread-name\"); return 0; }" ++ HAVE_PTHREAD_SETNAME_NP_WITH_TID) ++ if (HAVE_PTHREAD_SETNAME_NP_WITH_TID) ++ # Define to use 'pthread_setname_np(pthread_t, const char*)' function. ++ add_definitions("-DHAVE_PTHREAD_SETNAME_NP_WITH_TID") ++ endif() ++ endif(HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG) ++ endif (HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) ++endif() ++ ++# Check for dladdr (used for debugging). ++check_c_source_compiles(" ++#define _GNU_SOURCE 1\n ++#include \n ++int main(void) { Dl_info info; (void)dladdr(\"\", &info); return 0; }" ++ HAVE_DLADDR) ++if (HAVE_DLADDR) ++ # Define to use 'dladdr' function. ++ add_definitions("-DHAVE_DLADDR") ++endif() ++ ++add_library(gc ${SRC}) ++if (enable_threads) ++ target_link_libraries(gc PRIVATE ${THREADDLLIBS}) ++endif() ++ ++if (enable_cplusplus) ++ add_library(gccpp gc_cpp.cc) ++ target_link_libraries(gccpp PRIVATE gc) ++endif() ++ ++if (build_cord) ++ set(CORD_SRC cord/cordbscs.c cord/cordprnt.c cord/cordxtra.c) ++ add_library(cord ${CORD_SRC}) ++ target_link_libraries(cord PRIVATE gc) ++ install(TARGETS cord EXPORT cordExports ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ INCLUDES DESTINATION include) ++endif() ++ ++if (BUILD_SHARED_LIBS AND HAVE_FLAG_WL_NO_UNDEFINED) ++ # Declare that the libraries do not refer to external symbols. ++ # TODO: use add_link_options() when cmake_minimum_required > 3.13 ++ target_link_libraries(gc PRIVATE -Wl,--no-undefined) ++ if (enable_cplusplus) ++ target_link_libraries(gccpp PRIVATE -Wl,--no-undefined) ++ endif(enable_cplusplus) ++ if (build_cord) ++ target_link_libraries(cord PRIVATE -Wl,--no-undefined) ++ endif(build_cord) ++endif() ++ ++install(TARGETS gc EXPORT gcExports ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ INCLUDES DESTINATION include) ++ ++if (enable_cplusplus) ++ install(TARGETS gccpp EXPORT gccppExports ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ INCLUDES DESTINATION include) ++endif() ++ ++if (install_headers) ++ install(FILES include/gc.h ++ include/gc_backptr.h ++ include/gc_config_macros.h ++ include/gc_gcj.h ++ include/gc_inline.h ++ include/gc_mark.h ++ include/gc_pthread_redirects.h ++ include/gc_tiny_fl.h ++ include/gc_typed.h ++ include/gc_version.h ++ include/javaxfc.h ++ include/leak_detector.h ++ DESTINATION include/gc) ++ install(FILES include/extra/gc.h DESTINATION include) ++ if (enable_cplusplus) ++ install(FILES include/gc_allocator.h ++ include/gc_cpp.h ++ DESTINATION include/gc) ++ install(FILES include/extra/gc_cpp.h DESTINATION include) ++ endif() ++ if (enable_disclaim) ++ install(FILES include/gc_disclaim.h DESTINATION include/gc) ++ endif() ++ if (build_cord) ++ install(FILES include/cord.h ++ include/cord_pos.h ++ include/ec.h ++ DESTINATION include/gc) ++ endif() ++endif(install_headers) ++ ++if (build_tests) ++ if (build_cord) ++ add_executable(cordtest cord/tests/cordtest.c) ++ target_link_libraries(cordtest PRIVATE cord gc) ++ add_test(NAME cordtest COMMAND cordtest) ++ ++ if (WIN32 AND NOT CYGWIN) ++ add_executable(de cord/tests/de.c cord/tests/de_win.c ++ cord/tests/de_win.rc) ++ set_target_properties(de PROPERTIES WIN32_EXECUTABLE TRUE) ++ target_link_libraries(de PRIVATE cord gc gdi32) ++ endif() ++ endif(build_cord) ++ ++ # Compile some tests as C++ to test extern "C" in header files. ++ if (enable_cplusplus) ++ set_source_files_properties(tests/leak_test.c tests/test.c ++ PROPERTIES LANGUAGE CXX) ++ # To avoid "treating 'c' input as 'c++' when in C++ mode" Clang warning. ++ if (NOT (BORLAND OR MSVC OR WATCOM)) ++ add_compile_options(-x c++) ++ endif() ++ endif(enable_cplusplus) ++ ++ add_executable(gctest WIN32 tests/test.c) ++ target_link_libraries(gctest PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME gctest COMMAND gctest) ++ if (WATCOM) ++ # Suppress "conditional expression in if statement is always true/false" ++ # and "unreachable code" warnings in GC_MALLOC_[ATOMIC_]WORDS. ++ target_compile_options(gctest PRIVATE ++ /wcd=13 /wcd=201 /wcd=367 /wcd=368 /wcd=726) ++ endif() ++ ++ add_executable(hugetest tests/huge_test.c) ++ target_link_libraries(hugetest PRIVATE gc) ++ add_test(NAME hugetest COMMAND hugetest) ++ ++ add_executable(leaktest tests/leak_test.c) ++ target_link_libraries(leaktest PRIVATE gc) ++ add_test(NAME leaktest COMMAND leaktest) ++ ++ add_executable(middletest tests/middle.c) ++ target_link_libraries(middletest PRIVATE gc) ++ add_test(NAME middletest COMMAND middletest) ++ ++ add_executable(realloc_test tests/realloc_test.c) ++ target_link_libraries(realloc_test PRIVATE gc) ++ add_test(NAME realloc_test COMMAND realloc_test) ++ ++ add_executable(smashtest tests/smash_test.c) ++ target_link_libraries(smashtest PRIVATE gc) ++ add_test(NAME smashtest COMMAND smashtest) ++ ++ if (NOT (BUILD_SHARED_LIBS AND WIN32)) ++ add_library(staticrootslib_test tests/staticrootslib.c) ++ target_link_libraries(staticrootslib_test PRIVATE gc) ++ add_library(staticrootslib2_test tests/staticrootslib.c) ++ target_compile_options(staticrootslib2_test PRIVATE "-DSTATICROOTSLIB2") ++ target_link_libraries(staticrootslib2_test PRIVATE gc) ++ add_executable(staticrootstest tests/staticrootstest.c) ++ target_compile_options(staticrootstest PRIVATE "-DSTATICROOTSLIB2") ++ target_link_libraries(staticrootstest PRIVATE ++ gc staticrootslib_test staticrootslib2_test) ++ add_test(NAME staticrootstest COMMAND staticrootstest) ++ endif() ++ ++ if (enable_gc_debug) ++ add_executable(tracetest tests/trace_test.c) ++ target_link_libraries(tracetest PRIVATE gc) ++ add_test(NAME tracetest COMMAND tracetest) ++ endif() ++ ++ if (enable_threads) ++ add_executable(test_atomic_ops tests/test_atomic_ops.c) ++ target_link_libraries(test_atomic_ops PRIVATE gc) ++ add_test(NAME test_atomic_ops COMMAND test_atomic_ops) ++ ++ add_executable(threadleaktest tests/thread_leak_test.c) ++ target_link_libraries(threadleaktest PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME threadleaktest COMMAND threadleaktest) ++ ++ if (NOT WIN32) ++ add_executable(threadkey_test tests/threadkey_test.c) ++ target_link_libraries(threadkey_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME threadkey_test COMMAND threadkey_test) ++ endif() ++ ++ add_executable(subthreadcreate_test tests/subthread_create.c) ++ target_link_libraries(subthreadcreate_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME subthreadcreate_test COMMAND subthreadcreate_test) ++ ++ add_executable(initsecondarythread_test tests/initsecondarythread.c) ++ target_link_libraries(initsecondarythread_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME initsecondarythread_test COMMAND initsecondarythread_test) ++ endif(enable_threads) ++ ++ if (enable_cplusplus) ++ add_executable(test_cpp WIN32 tests/test_cpp.cc) ++ target_link_libraries(test_cpp PRIVATE gc gccpp) ++ add_test(NAME test_cpp COMMAND test_cpp) ++ endif() ++ ++ if (enable_disclaim) ++ add_executable(disclaim_bench tests/disclaim_bench.c) ++ target_link_libraries(disclaim_bench PRIVATE gc) ++ add_test(NAME disclaim_bench COMMAND disclaim_bench) ++ ++ add_executable(disclaim_test tests/disclaim_test.c) ++ target_link_libraries(disclaim_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME disclaim_test COMMAND disclaim_test) ++ ++ add_executable(disclaim_weakmap_test tests/disclaim_weakmap_test.c) ++ target_link_libraries(disclaim_weakmap_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME disclaim_weakmap_test COMMAND disclaim_weakmap_test) ++ endif() ++endif(build_tests) diff --git a/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch b/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch new file mode 100644 index 0000000000000..10451ed429544 --- /dev/null +++ b/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch @@ -0,0 +1,828 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -21,232 +21,599 @@ + # this will generate gc.sln + # + +-SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required +- +-PROJECT(gc) +- +-INCLUDE(CTest) +- +-CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +- +-ADD_DEFINITIONS("-D_CRT_SECURE_NO_DEPRECATE +- -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION") +- +-#LIBATOMIC #TODO +-#ADD_LIBRARY(atomic_ops STATIC ) +-#SET_TARGET_PROPERTIES(atomic_ops PROPERTIES COMPILE_FLAGS -DNO_DEBUGGING) +- +- +-#LIBGC +- +-INCLUDE_DIRECTORIES(include) +-INCLUDE_DIRECTORIES(libatomic_ops/src) +- +-SET(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c ++cmake_minimum_required(VERSION 3.1) ++ ++option(enable_cplusplus "C++ support" OFF) ++if (enable_cplusplus) ++ project(gc) ++else() ++ project(gc C) ++endif() ++ ++include(CheckCCompilerFlag) ++include(CheckCSourceCompiles) ++include(CheckFunctionExists) ++include(CheckIncludeFile) ++include(CheckSymbolExists) ++include(CTest) ++ ++# Customize the build by passing "-D=ON|OFF" in the command line. ++option(BUILD_SHARED_LIBS "Build shared libraries" ON) ++option(build_cord "Build cord library" ON) ++option(build_tests "Build tests" OFF) ++option(enable_threads "Support threads" ON) ++option(enable_parallel_mark "Parallelize marking and free list construction" ON) ++option(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON) ++option(enable_threads_discovery "Enable threads discovery in GC" ON) ++option(enable_gcj_support "Support for gcj" ON) ++option(enable_sigrt_signals "Use SIGRTMIN-based signals for thread suspend/resume" OFF) ++option(enable_gc_debug "Support for pointer back-tracing" OFF) ++option(disable_gc_debug "Disable debugging like GC_dump and its callees" OFF) ++option(enable_java_finalization "Support for java finalization" ON) ++option(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON) ++option(enable_redirect_malloc "Redirect malloc and friends to GC routines" OFF) ++option(enable_disclaim "Support alternative finalization interface" ON) ++option(enable_large_config "Optimize for large heap or root set" OFF) ++option(enable_gc_assertions "Enable collector-internal assertion checking" OFF) ++option(enable_mmap "Use mmap instead of sbrk to expand the heap" OFF) ++option(enable_munmap "Return page to the OS if empty for N collections" ON) ++option(enable_dynamic_loading "Enable tracing of dynamic library data roots" ON) ++option(enable_register_main_static_data "Perform the initial guess of data root sets" ON) ++option(enable_checksums "Report erroneously cleared dirty bits" OFF) ++option(enable_werror "Pass -Werror to the C compiler (treat warnings as errors)" OFF) ++option(enable_single_obj_compilation "Compile all libgc source files into single .o" OFF) ++option(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON) ++option(disable_handle_fork "Prohibit installation of pthread_atfork() handlers" OFF) ++option(install_headers "Install header files" ON) ++ ++add_definitions("-DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION") ++ ++# Set struct packing alignment to word (instead of 1-byte). ++if (BORLAND) ++ add_compile_options(/a4) ++elseif (WATCOM) ++ add_compile_options(/zp4) ++endif() ++ ++# Output all warnings. ++if (BORLAND) ++ # All warnings except for particular ones. ++ add_compile_options(/w /w-pro /w-aus /w-par /w-ccc /w-inl /w-rch) ++elseif (MSVC) ++ # All warnings but ignoring "unreferenced formal parameter" and ++ # "conditional expression is constant" ones. ++ add_compile_options(/W4 /wd4100 /wd4127) ++ # Disable crt security warnings, since unfortunately they warn about all ++ # sorts of safe uses of strncpy. ++ add_definitions("-D_CRT_SECURE_NO_DEPRECATE") ++elseif (WATCOM) ++ add_compile_options(/wx) ++else() ++ # TODO add -[W]pedantic -Wno-long-long ++ add_compile_options(-Wall -Wextra) ++endif() ++ ++include_directories(include) ++ ++set(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c + mark_rts.c headers.c mark.c obj_map.c blacklst.c finalize.c + new_hblk.c dbg_mlc.c malloc.c dyn_load.c typd_mlc.c ptr_chck.c + mallocx.c) +-SET(LIBS) +-OPTION(enable_threads "TODO" NO) +-IF(enable_threads) +- FIND_PACKAGE(Threads REQUIRED) +- MESSAGE("Thread Model: ${CMAKE_THREAD_LIBS_INIT}" ) +- INCLUDE_DIRECTORIES(${Threads_INCLUDE_DIR}) +- SET(LIBS ${LIBS} ${Threads_LIBRARIES}) +-ENDIF(enable_threads) +- +-OPTION(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON) +- +-OPTION(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON) +- +-OPTION(enable_parallel_mark "Parallelize marking and free list construction" ON) +- +-#IF(Threads_FOUND) +-# ADD_DEFINITIONS("") +-#ELSE +-# MESSAGE("Parallel mark requires enable_threads ON" ) +-#ENDIF(Threads_FOUND) +- +-#OPTION(enable_cplusplus "install C++ support" ON) +-SET(SRC ${SRC} gc_cpp.cc) +- +-SET(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM}) #FIXME missing the vendor field. +-STRING(TOLOWER ${_HOST} HOST) +-MESSAGE("HOST = ${HOST}") +- +-# Thread Detection. Relying on cmake for lib and includes. +-#TODO check cmake detection +-IF(CMAKE_USE_PTHREADS_INIT) +- SET(SRC ${SRC} gc_dlopen.c pthread_start.c pthread_stop_world.c +- pthread_support.c) +- # Common defines for most POSIX platforms. +- IF( HOST MATCHES .*-.*-aix.*|.*-.*-android.*|.*-.*-cygwin.*|.*-.*-darwin.*|.*-.*-.*freebsd.*|.*-.*-haiku.*|.*-.*-gnu.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-.*linux.*|.*-.*-msys.*|.*-.*-nacl.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*) +- ADD_DEFINITIONS("-DGC_THREADS -D_REENTRANT") +- IF(enable_parallel_mark) +- ADD_DEFINITIONS("-DPARALLEL_MARK") +- ENDIF(enable_parallel_mark) +- IF(enable_thread_local_alloc) +- ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC") +- SET(SRC ${SRC} specific.c thread_local_alloc.c) +- ENDIF(enable_thread_local_alloc) +- MESSAGE("Explicit GC_INIT() calls may be required.") +- ENDIF() +- IF ( HOST MATCHES .*-.*-hpux11.*) +- MESSAGE("Only HP/UX 11 POSIX threads are supported.") +- ADD_DEFINITIONS("-D_POSIX_C_SOURCE=199506L") #TODO test -DVAR=value. Alternative is COMPILE_DEFINITIONS property +- ENDIF() +- IF ( HOST MATCHES .*-.*-hpux10.*) +- MESSAGE("HP/UX 10 POSIX threads are not supported.") +- ENDIF() +- IF ( HOST MATCHES .*-.*-netbsd.*) +- MESSAGE("Only on NetBSD 2.0 or later.") +- ADD_DEFINITIONS("-D_PTHREADS") +- ENDIF() +- IF( HOST MATCHES .*-.*-android.*) +- # Android NDK does not provide pthread_atfork. +- ELSEIF( HOST MATCHES .*-.*-aix.*|.*-.*-cygwin.*|.*-.*-freebsd.*|.*-.*-haiku.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-kfreebsd.*-gnu|.*-.*-.*linux.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*) +- IF(enable_handle_fork) +- ADD_DEFINITIONS("-DHANDLE_FORK") +- ENDIF(enable_handle_fork) +- ENDIF() +- IF ( HOST MATCHES .*-.*-cygwin.*|.*-.*-msys.*) +- SET(SRC ${SRC} win32_threads.c) +- ENDIF() +- IF ( HOST MATCHES .*-.*-darwin.*) +- IF(enable_handle_fork) +- # The incremental mode conflicts with fork handling. +- IF(enable_parallel_mark) +- ADD_DEFINITIONS("-DHANDLE_FORK") +- ENDIF(enable_parallel_mark) +- ENDIF(enable_handle_fork) +- SET(SRC ${SRC} darwin_stop_world.c) +- #TODO +- #darwin_threads=true +- ENDIF() +-ENDIF(CMAKE_USE_PTHREADS_INIT) +- +-IF(CMAKE_USE_WIN32_THREADS_INIT) +- ADD_DEFINITIONS("-DGC_THREADS") +- IF(enable_parallel_mark) +- ADD_DEFINITIONS("-DPARALLEL_MARK") +- IF(enable_thread_local_alloc) +- ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC") +- SET(SRC ${SRC} thread_local_alloc.c) +- ENDIF(enable_thread_local_alloc) +- ENDIF() +- ADD_DEFINITIONS("-DEMPTY_GETENV_RESULTS") #TODO test +- SET(SRC ${SRC} win32_threads.c) +-ENDIF(CMAKE_USE_WIN32_THREADS_INIT) +- +-OPTION(enable_gcj_support "Support for gcj" ON) +-IF(enable_gcj_support) +- ADD_DEFINITIONS("-DGC_GCJ_SUPPORT") +- IF(enable_threads) +- ADD_DEFINITIONS("-DGC_ENABLE_SUSPEND_THREAD") +- ENDIF(enable_threads) +- SET(SRC ${SRC} gcj_mlc.c) +-ENDIF(enable_gcj_support) +- +-OPTION(enable_disclaim "Support alternative finalization interface" ON) +-IF(enable_disclaim) +- ADD_DEFINITIONS("-DENABLE_DISCLAIM") +- SET(SRC ${SRC} fnlz_mlc.c) +-ENDIF(enable_disclaim) +- +-OPTION(enable_java_finalization "Support for java finalization" ON) +-IF(enable_java_finalization) +- ADD_DEFINITIONS("-DJAVA_FINALIZATION") +-ENDIF(enable_java_finalization) +- +-OPTION(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON) +-IF(enable_atomic_uncollectable) +- ADD_DEFINITIONS("-DGC_ATOMIC_UNCOLLECTABLE") +-ENDIF(enable_atomic_uncollectable) +- +-OPTION(enable_gc_debug "Support for pointer back-tracing" NO) +-IF(enable_gc_debug) +- ADD_DEFINITIONS("-DDBG_HDRS_ALL -DKEEP_BACK_PTRS") +- IF (HOST MATCHES ia64-.*-linux.*|i586-.*-linux.*|i686-.*-linux.*|x86-.*-linux.*|x86_64-.*-linux.*) +- ADD_DEFINITIONS("-DMAKE_BACK_GRAPH") +- ADD_DEFINITIONS("-DSAVE_CALL_COUNT=8") +- SET(SRC ${SRC} backgraph.c) +- ENDIF() +- IF (HOST MATCHES i.86-.*-dgux.*) +- ADD_DEFINITIONS("-DMAKE_BACK_GRAPH") +- SET(SRC ${SRC} backgraph.c) +- ENDIF() +-ENDIF(enable_gc_debug) +- +-OPTION(enable_redirect_malloc "Redirect malloc and friends to GC routines" NO) +-IF(enable_redirect_malloc) +- IF(enable_gc_debug) +- ADD_DEFINITIONS("-DREDIRECT_MALLOC=GC_debug_malloc_replacement") +- ADD_DEFINITIONS("-DREDIRECT_REALLOC=GC_debug_realloc_replacement") +- ADD_DEFINITIONS("-DREDIRECT_FREE=GC_debug_free") +- ELSE(enable_gc_debug) +- ADD_DEFINITIONS("-DREDIRECT_MALLOC=GC_malloc") +- ENDIF(enable_gc_debug) +- ADD_DEFINITIONS("-DGC_USE_DLOPEN_WRAP") +-ENDIF(enable_redirect_malloc) +- +-OPTION(enable_mmap "Use mmap instead of sbrk to expand the heap" NO) +- +-OPTION(enable_munmap "Return page to the OS if empty for N collections" ON) +-IF(enable_munmap) +- ADD_DEFINITIONS("-DUSE_MMAP -DUSE_MUNMAP") +-ELSEIF(enable_mmap) +- ADD_DEFINITIONS("-DUSE_MMAP") +-ENDIF() +- +-OPTION(enable_dynamic_loading "Enable tracing of dynamic library data roots" ON) +-IF(NOT enable_dynamic_loading) +- ADD_DEFINITIONS("-DIGNORE_DYNAMIC_LOADING") +-ENDIF() +- +-OPTION(enable_register_main_static_data "Perform the initial guess of data root sets" ON) +-IF(NOT enable_register_main_static_data) +- ADD_DEFINITIONS("-DGC_DONT_REGISTER_MAIN_STATIC_DATA") +-ENDIF() +- +-OPTION(enable_large_config "Optimize for large heap or root set" NO) +-IF(enable_large_config) +- ADD_DEFINITIONS("-DLARGE_CONFIG") +-ENDIF(enable_large_config) +- +-OPTION(enable_gc_assertions "Enable collector-internal assertion checking" NO) +-IF(enable_gc_assertions) +- ADD_DEFINITIONS("-DGC_ASSERTIONS") +-ENDIF(enable_gc_assertions) +- +-OPTION(enable_threads_discovery "Enable threads discovery in GC" ON) +-IF(NOT enable_threads_discovery) +- ADD_DEFINITIONS("-DGC_NO_THREADS_DISCOVERY") +-ENDIF() +- +-OPTION(enable_checksums "Report erroneously cleared dirty bits" NO) +-IF(enable_checksums) +- IF(enable_munmap OR enable_threads) +- MESSAGE("CHECKSUMS not compatible with USE_MUNMAP or threads") +- ENDIF() +- ADD_DEFINITIONS("-DCHECKSUMS") +- SET(SRC ${SRC} checksums.c) +-ENDIF(enable_checksums) +- +-ADD_LIBRARY( gc-lib STATIC ${SRC}) +-SET_TARGET_PROPERTIES(gc-lib PROPERTIES +- COMPILE_DEFINITIONS GC_NOT_DLL) +-#TODO TARGET_LINK_LIBRARIES(... ... ${LIBS}) +- +-ADD_LIBRARY( gcmt-dll SHARED ${SRC}) +- +-IF(WIN32) +- ADD_EXECUTABLE(cord cord/cordbscs.c cord/cordxtra.c +- cord/tests/de.c cord/tests/de_win.c) +- SET_TARGET_PROPERTIES(cord PROPERTIES WIN32_EXECUTABLE TRUE) +- SET_TARGET_PROPERTIES(cord PROPERTIES +- COMPILE_DEFINITIONS GC_NOT_DLL) +- TARGET_LINK_LIBRARIES(cord gc-lib) +- TARGET_LINK_LIBRARIES(cord gdi32) +-ENDIF(WIN32) +- +-ADD_SUBDIRECTORY(tests) ++set(THREADDLLIBS) ++ ++set(_HOST ${CMAKE_SYSTEM_PROCESSOR}-unknown-${CMAKE_SYSTEM}) ++string(TOLOWER ${_HOST} HOST) ++message(STATUS "TARGET = ${HOST}") ++ ++if (enable_threads) ++ if(NOT APPLE) ++ find_package(Threads REQUIRED) ++ message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") ++ include_directories(${Threads_INCLUDE_DIR}) ++ set(THREADDLLIBS ${CMAKE_THREAD_LIBS_INIT}) ++ endif() ++ if (MSVC) ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() ++ endif() ++ if (NOT (APPLE OR CYGWIN OR MSYS OR WIN32 OR HOST MATCHES mips-.*-irix6.*)) ++ set(THREADDLLIBS ${THREADDLLIBS} -ldl) ++ # The predefined CMAKE_DL_LIBS may be broken. ++ endif() ++endif(enable_threads) ++ ++# Thread support detection. ++if (CMAKE_USE_PTHREADS_INIT) ++ set(SRC ${SRC} gc_dlopen.c pthread_start.c pthread_stop_world.c ++ pthread_support.c) ++ if (HOST MATCHES .*-.*-hpux10.*) ++ message(FATAL_ERROR "HP/UX 10 POSIX threads are not supported.") ++ endif() ++ # Assume the compiler supports GCC atomic intrinsics. ++ add_definitions("-DGC_BUILTIN_ATOMIC") ++ # Common defines for POSIX platforms. ++ add_definitions("-DGC_THREADS -D_REENTRANT") ++ if (enable_parallel_mark) ++ add_definitions("-DPARALLEL_MARK") ++ endif() ++ if (enable_thread_local_alloc) ++ add_definitions("-DTHREAD_LOCAL_ALLOC") ++ set(SRC ${SRC} specific.c thread_local_alloc.c) ++ endif() ++ message("Explicit GC_INIT() calls may be required.") ++ if (HOST MATCHES .*-.*-hpux11.*) ++ message("Only HP/UX 11 POSIX threads are supported.") ++ add_definitions("-D_POSIX_C_SOURCE=199506L") ++ elseif (HOST MATCHES .*-.*-netbsd.*) ++ message("Only on NetBSD 2.0 or later.") ++ add_definitions("-D_PTHREADS") ++ endif() ++ if (ANDROID OR MSYS) # ANDROID variable is defined by CMake v3.7.0+. ++ # Android NDK does not provide pthread_atfork. ++ elseif (APPLE) ++ if (enable_handle_fork AND NOT disable_handle_fork) ++ # The incremental mode conflicts with fork handling. ++ if (enable_parallel_mark) ++ add_definitions("-DHANDLE_FORK") ++ endif(enable_parallel_mark) ++ endif() ++ set(SRC ${SRC} darwin_stop_world.c) ++ elseif (enable_handle_fork AND NOT disable_handle_fork) ++ add_definitions("-DHANDLE_FORK") ++ endif() ++ if (enable_sigrt_signals) ++ add_definitions("-DGC_USESIGRT_SIGNALS") ++ endif() ++ if (CYGWIN OR MSYS) ++ set(SRC ${SRC} win32_threads.c) ++ endif() ++elseif (CMAKE_USE_WIN32_THREADS_INIT) ++ add_definitions("-DGC_THREADS") ++ if (enable_parallel_mark) ++ add_definitions("-DPARALLEL_MARK") ++ endif() ++ if (enable_thread_local_alloc AND (enable_parallel_mark OR NOT BUILD_SHARED_LIBS)) ++ # Imply THREAD_LOCAL_ALLOC unless GC_DLL. ++ add_definitions("-DTHREAD_LOCAL_ALLOC") ++ set(SRC ${SRC} thread_local_alloc.c) ++ endif() ++ add_definitions("-DEMPTY_GETENV_RESULTS") ++ set(SRC ${SRC} win32_threads.c) ++elseif (CMAKE_HP_PTHREADS_INIT OR CMAKE_USE_SPROC_INIT) ++ message(FATAL_ERROR "Unsupported thread package") ++endif() ++ ++if (disable_handle_fork) ++ add_definitions("-DNO_HANDLE_FORK") ++endif() ++ ++if (enable_gcj_support) ++ add_definitions("-DGC_GCJ_SUPPORT") ++ if (enable_threads AND NOT (enable_thread_local_alloc AND HOST MATCHES .*-.*-kfreebsd.*-gnu)) ++ # FIXME: For a reason, gctest hangs up on kFreeBSD if both of ++ # THREAD_LOCAL_ALLOC and GC_ENABLE_SUSPEND_THREAD are defined. ++ add_definitions("-DGC_ENABLE_SUSPEND_THREAD") ++ endif() ++ set(SRC ${SRC} gcj_mlc.c) ++endif(enable_gcj_support) ++ ++if (enable_disclaim) ++ add_definitions("-DENABLE_DISCLAIM") ++ set(SRC ${SRC} fnlz_mlc.c) ++endif() ++ ++if (enable_java_finalization) ++ add_definitions("-DJAVA_FINALIZATION") ++endif() ++ ++if (enable_atomic_uncollectable) ++ add_definitions("-DGC_ATOMIC_UNCOLLECTABLE") ++endif() ++ ++if (enable_gc_debug) ++ add_definitions("-DDBG_HDRS_ALL -DKEEP_BACK_PTRS") ++ if (HOST MATCHES i.86-.*-dgux.*|ia64-.*-linux.*|i586-.*-linux.*|i686-.*-linux.*|x86-.*-linux.*|x86_64-.*-linux.*) ++ add_definitions("-DMAKE_BACK_GRAPH") ++ if (HOST MATCHES .*-.*-.*linux.*) ++ add_definitions("-DSAVE_CALL_COUNT=8") ++ endif() ++ set(SRC ${SRC} backgraph.c) ++ endif() ++endif(enable_gc_debug) ++ ++if (disable_gc_debug) ++ add_definitions("-DNO_DEBUGGING") ++elseif (WINCE) ++ # Read environment variables from ".gc.env" file. ++ add_definitions("-DGC_READ_ENV_FILE") ++endif() ++ ++if (enable_redirect_malloc) ++ if (enable_gc_debug) ++ add_definitions("-DREDIRECT_MALLOC=GC_debug_malloc_replacement") ++ add_definitions("-DREDIRECT_REALLOC=GC_debug_realloc_replacement") ++ add_definitions("-DREDIRECT_FREE=GC_debug_free") ++ else() ++ add_definitions("-DREDIRECT_MALLOC=GC_malloc") ++ endif() ++ add_definitions("-DGC_USE_DLOPEN_WRAP") ++endif(enable_redirect_malloc) ++ ++if (enable_munmap) ++ add_definitions("-DUSE_MMAP -DUSE_MUNMAP") ++elseif (enable_mmap) ++ add_definitions("-DUSE_MMAP") ++endif() ++ ++if (NOT enable_dynamic_loading) ++ add_definitions("-DIGNORE_DYNAMIC_LOADING") ++endif() ++ ++if (NOT enable_register_main_static_data) ++ add_definitions("-DGC_DONT_REGISTER_MAIN_STATIC_DATA") ++endif() ++ ++if (enable_large_config) ++ add_definitions("-DLARGE_CONFIG") ++endif() ++ ++if (enable_gc_assertions) ++ add_definitions("-DGC_ASSERTIONS") ++endif() ++ ++if (NOT enable_threads_discovery) ++ add_definitions("-DGC_NO_THREADS_DISCOVERY") ++endif() ++ ++if (enable_checksums) ++ if (enable_munmap OR enable_threads) ++ message(FATAL_ERROR "CHECKSUMS not compatible with USE_MUNMAP or threads") ++ endif() ++ add_definitions("-DCHECKSUMS") ++ set(SRC ${SRC} checksums.c) ++endif(enable_checksums) ++ ++if (enable_werror) ++ if (BORLAND) ++ add_compile_options(/w!) ++ elseif (MSVC) ++ add_compile_options(/WX) ++ # Workaround "typedef ignored on left of ..." warning reported in ++ # imagehlp.h of e.g. Windows Kit 8.1. ++ add_compile_options(/wd4091) ++ elseif (WATCOM) ++ add_compile_options(/we) ++ else() ++ add_compile_options(-Werror) ++ if (APPLE) ++ # _dyld_bind_fully_image_containing_address is deprecated in OS X 10.5+ ++ add_compile_options(-Wno-deprecated-declarations) ++ endif() ++ endif() ++endif(enable_werror) ++ ++if (enable_single_obj_compilation OR BUILD_SHARED_LIBS) ++ set(SRC extra/gc.c) # override SRC ++ if (CMAKE_USE_PTHREADS_INIT) ++ add_definitions("-DGC_PTHREAD_START_STANDALONE") ++ set(SRC ${SRC} pthread_start.c) ++ endif(CMAKE_USE_PTHREADS_INIT) ++elseif (BORLAND) ++ # Suppress "GC_push_contents_hdr() is declared but never used" warning. ++ add_compile_options(/w-use) ++endif() ++ ++# Add implementation of backtrace() and backtrace_symbols(). ++if (MSVC) ++ set(SRC ${SRC} extra/msvc_dbg.c) ++endif() ++ ++# Instruct check_c_source_compiles and similar CMake checks not to ignore ++# compiler warnings (like "implicit declaration of function"). ++if (NOT BORLAND AND NOT MSVC AND NOT WATCOM) ++ check_c_compiler_flag(-Werror HAVE_FLAG_WERROR) ++ if (HAVE_FLAG_WERROR) ++ SET(CMAKE_REQUIRED_FLAGS "-Werror") ++ endif(HAVE_FLAG_WERROR) ++endif() ++ ++if (BUILD_SHARED_LIBS) ++ add_definitions("-DGC_DLL") ++ # Pass -fvisibility=hidden option if supported. ++ check_c_compiler_flag(-fvisibility=hidden HAVE_FLAG_F_VISIBILITY_HIDDEN) ++ if (HAVE_FLAG_F_VISIBILITY_HIDDEN) ++ add_definitions("-DGC_VISIBILITY_HIDDEN_SET") ++ add_compile_options(-fvisibility=hidden) ++ else() ++ add_definitions("-DGC_NO_VISIBILITY") ++ endif() ++ check_c_compiler_flag(-Wl,--no-undefined HAVE_FLAG_WL_NO_UNDEFINED) ++else() ++ add_definitions("-DGC_NOT_DLL") ++ if (WIN32) ++ # Do not require the clients to link with "user32" system library. ++ add_definitions("-DDONT_USE_USER32_DLL") ++ endif(WIN32) ++endif() ++ ++# Disable strict aliasing optimizations. ++# It could re-enabled back by a flag passed in CFLAGS_EXTRA. ++check_c_compiler_flag(-fno-strict-aliasing HAVE_FLAG_F_NO_STRICT_ALIASING) ++if (HAVE_FLAG_F_NO_STRICT_ALIASING) ++ add_compile_options(-fno-strict-aliasing) ++endif() ++ ++# Extra user-defined flags to pass both to C and C++ compilers. ++if (DEFINED CFLAGS_EXTRA) ++ add_compile_options(${CFLAGS_EXTRA}) ++endif() ++ ++# Check whether execinfo.h header file is present. ++check_include_file(execinfo.h HAVE_EXECINFO_H) ++if (NOT HAVE_EXECINFO_H) ++ add_definitions("-DGC_MISSING_EXECINFO_H") ++endif() ++ ++# Check for getcontext (uClibc can be configured without it, for example). ++check_function_exists(getcontext HAVE_GETCONTEXT) ++if (NOT HAVE_GETCONTEXT) ++ add_definitions("-DNO_GETCONTEXT") ++endif() ++ ++# Check whether dl_iterate_phdr exists (as a strong symbol). ++check_function_exists(dl_iterate_phdr HAVE_DL_ITERATE_PHDR) ++if (HAVE_DL_ITERATE_PHDR) ++ add_definitions("-DHAVE_DL_ITERATE_PHDR") ++endif() ++ ++check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP) ++if (NOT HAVE_SIGSETJMP) ++ add_definitions("-DGC_NO_SIGSETJMP") ++endif() ++ ++# pthread_setname_np, if available, may have 1, 2 or 3 arguments. ++if (CMAKE_USE_PTHREADS_INIT) ++ check_c_source_compiles(" ++#include \n ++int main(void) { (void)pthread_setname_np(\"thread-name\"); return 0; }" ++ HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) ++ if (HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) ++ # Define to use 'pthread_setname_np(const char*)' function. ++ add_definitions("-DHAVE_PTHREAD_SETNAME_NP_WITHOUT_TID") ++ else() ++ check_c_source_compiles(" ++#include \n ++int main(void) {\n ++ (void)pthread_setname_np(pthread_self(), \"thread-name-%u\", 0); return 0; }" ++ HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG) ++ if (HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG) ++ # Define to use 'pthread_setname_np(pthread_t, const char*, void *)'. ++ add_definitions("-DHAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG") ++ else() ++ check_c_source_compiles(" ++#if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) || defined(__CYGWIN__)\n ++#define _GNU_SOURCE 1\n ++#endif\n ++#include \n ++int main(void) {\n ++ (void)pthread_setname_np(pthread_self(), \"thread-name\"); return 0; }" ++ HAVE_PTHREAD_SETNAME_NP_WITH_TID) ++ if (HAVE_PTHREAD_SETNAME_NP_WITH_TID) ++ # Define to use 'pthread_setname_np(pthread_t, const char*)' function. ++ add_definitions("-DHAVE_PTHREAD_SETNAME_NP_WITH_TID") ++ endif() ++ endif(HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG) ++ endif (HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) ++endif() ++ ++# Check for dladdr (used for debugging). ++check_c_source_compiles(" ++#define _GNU_SOURCE 1\n ++#include \n ++int main(void) { Dl_info info; (void)dladdr(\"\", &info); return 0; }" ++ HAVE_DLADDR) ++if (HAVE_DLADDR) ++ # Define to use 'dladdr' function. ++ add_definitions("-DHAVE_DLADDR") ++endif() ++ ++add_library(gc ${SRC}) ++if (enable_threads) ++ target_link_libraries(gc PRIVATE ${THREADDLLIBS}) ++endif() ++ ++if (enable_cplusplus) ++ add_library(gccpp gc_cpp.cc) ++ target_link_libraries(gccpp PRIVATE gc) ++endif() ++ ++if (build_cord) ++ set(CORD_SRC cord/cordbscs.c cord/cordprnt.c cord/cordxtra.c) ++ add_library(cord ${CORD_SRC}) ++ target_link_libraries(cord PRIVATE gc) ++ install(TARGETS cord EXPORT cordExports ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ INCLUDES DESTINATION include) ++endif() ++ ++if (BUILD_SHARED_LIBS AND HAVE_FLAG_WL_NO_UNDEFINED) ++ # Declare that the libraries do not refer to external symbols. ++ # TODO: use add_link_options() when cmake_minimum_required > 3.13 ++ target_link_libraries(gc PRIVATE -Wl,--no-undefined) ++ if (enable_cplusplus) ++ target_link_libraries(gccpp PRIVATE -Wl,--no-undefined) ++ endif(enable_cplusplus) ++ if (build_cord) ++ target_link_libraries(cord PRIVATE -Wl,--no-undefined) ++ endif(build_cord) ++endif() ++ ++install(TARGETS gc EXPORT gcExports ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ INCLUDES DESTINATION include) ++ ++if (enable_cplusplus) ++ install(TARGETS gccpp EXPORT gccppExports ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ INCLUDES DESTINATION include) ++endif() ++ ++if (install_headers) ++ install(FILES include/gc.h ++ include/gc_backptr.h ++ include/gc_config_macros.h ++ include/gc_gcj.h ++ include/gc_inline.h ++ include/gc_mark.h ++ include/gc_pthread_redirects.h ++ include/gc_tiny_fl.h ++ include/gc_typed.h ++ include/gc_version.h ++ include/javaxfc.h ++ include/leak_detector.h ++ DESTINATION include/gc) ++ install(FILES include/extra/gc.h DESTINATION include) ++ if (enable_cplusplus) ++ install(FILES include/gc_allocator.h ++ include/gc_cpp.h ++ DESTINATION include/gc) ++ install(FILES include/extra/gc_cpp.h DESTINATION include) ++ endif() ++ if (enable_disclaim) ++ install(FILES include/gc_disclaim.h DESTINATION include/gc) ++ endif() ++ if (build_cord) ++ install(FILES include/cord.h ++ include/cord_pos.h ++ include/ec.h ++ DESTINATION include/gc) ++ endif() ++endif(install_headers) ++ ++if (build_tests) ++ if (build_cord) ++ add_executable(cordtest cord/tests/cordtest.c) ++ target_link_libraries(cordtest PRIVATE cord gc) ++ add_test(NAME cordtest COMMAND cordtest) ++ ++ if (WIN32 AND NOT CYGWIN) ++ add_executable(de cord/tests/de.c cord/tests/de_win.c ++ cord/tests/de_win.rc) ++ set_target_properties(de PROPERTIES WIN32_EXECUTABLE TRUE) ++ target_link_libraries(de PRIVATE cord gc gdi32) ++ endif() ++ endif(build_cord) ++ ++ # Compile some tests as C++ to test extern "C" in header files. ++ if (enable_cplusplus) ++ set_source_files_properties(tests/leak_test.c tests/test.c ++ PROPERTIES LANGUAGE CXX) ++ # To avoid "treating 'c' input as 'c++' when in C++ mode" Clang warning. ++ if (NOT (BORLAND OR MSVC OR WATCOM)) ++ add_compile_options(-x c++) ++ endif() ++ endif(enable_cplusplus) ++ ++ add_executable(gctest WIN32 tests/test.c) ++ target_link_libraries(gctest PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME gctest COMMAND gctest) ++ if (WATCOM) ++ # Suppress "conditional expression in if statement is always true/false" ++ # and "unreachable code" warnings in GC_MALLOC_[ATOMIC_]WORDS. ++ target_compile_options(gctest PRIVATE ++ /wcd=13 /wcd=201 /wcd=367 /wcd=368 /wcd=726) ++ endif() ++ ++ add_executable(hugetest tests/huge_test.c) ++ target_link_libraries(hugetest PRIVATE gc) ++ add_test(NAME hugetest COMMAND hugetest) ++ ++ add_executable(leaktest tests/leak_test.c) ++ target_link_libraries(leaktest PRIVATE gc) ++ add_test(NAME leaktest COMMAND leaktest) ++ ++ add_executable(middletest tests/middle.c) ++ target_link_libraries(middletest PRIVATE gc) ++ add_test(NAME middletest COMMAND middletest) ++ ++ add_executable(realloc_test tests/realloc_test.c) ++ target_link_libraries(realloc_test PRIVATE gc) ++ add_test(NAME realloc_test COMMAND realloc_test) ++ ++ add_executable(smashtest tests/smash_test.c) ++ target_link_libraries(smashtest PRIVATE gc) ++ add_test(NAME smashtest COMMAND smashtest) ++ ++ if (NOT (BUILD_SHARED_LIBS AND WIN32)) ++ add_library(staticrootslib_test tests/staticrootslib.c) ++ target_link_libraries(staticrootslib_test PRIVATE gc) ++ add_library(staticrootslib2_test tests/staticrootslib.c) ++ target_compile_options(staticrootslib2_test PRIVATE "-DSTATICROOTSLIB2") ++ target_link_libraries(staticrootslib2_test PRIVATE gc) ++ add_executable(staticrootstest tests/staticrootstest.c) ++ target_compile_options(staticrootstest PRIVATE "-DSTATICROOTSLIB2") ++ target_link_libraries(staticrootstest PRIVATE ++ gc staticrootslib_test staticrootslib2_test) ++ add_test(NAME staticrootstest COMMAND staticrootstest) ++ endif() ++ ++ if (enable_gc_debug) ++ add_executable(tracetest tests/trace_test.c) ++ target_link_libraries(tracetest PRIVATE gc) ++ add_test(NAME tracetest COMMAND tracetest) ++ endif() ++ ++ if (enable_threads) ++ add_executable(test_atomic_ops tests/test_atomic_ops.c) ++ target_link_libraries(test_atomic_ops PRIVATE gc) ++ add_test(NAME test_atomic_ops COMMAND test_atomic_ops) ++ ++ add_executable(threadleaktest tests/thread_leak_test.c) ++ target_link_libraries(threadleaktest PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME threadleaktest COMMAND threadleaktest) ++ ++ if (NOT WIN32) ++ add_executable(threadkey_test tests/threadkey_test.c) ++ target_link_libraries(threadkey_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME threadkey_test COMMAND threadkey_test) ++ endif() ++ ++ add_executable(subthreadcreate_test tests/subthread_create.c) ++ target_link_libraries(subthreadcreate_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME subthreadcreate_test COMMAND subthreadcreate_test) ++ ++ add_executable(initsecondarythread_test tests/initsecondarythread.c) ++ target_link_libraries(initsecondarythread_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME initsecondarythread_test COMMAND initsecondarythread_test) ++ endif(enable_threads) ++ ++ if (enable_cplusplus) ++ add_executable(test_cpp WIN32 tests/test_cpp.cc) ++ target_link_libraries(test_cpp PRIVATE gc gccpp) ++ add_test(NAME test_cpp COMMAND test_cpp) ++ endif() ++ ++ if (enable_disclaim) ++ add_executable(disclaim_bench tests/disclaim_bench.c) ++ target_link_libraries(disclaim_bench PRIVATE gc) ++ add_test(NAME disclaim_bench COMMAND disclaim_bench) ++ ++ add_executable(disclaim_test tests/disclaim_test.c) ++ target_link_libraries(disclaim_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME disclaim_test COMMAND disclaim_test) ++ ++ add_executable(disclaim_weakmap_test tests/disclaim_weakmap_test.c) ++ target_link_libraries(disclaim_weakmap_test PRIVATE gc ${THREADDLLIBS}) ++ add_test(NAME disclaim_weakmap_test COMMAND disclaim_weakmap_test) ++ endif() ++endif(build_tests) diff --git a/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch b/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch new file mode 100644 index 0000000000000..3d721c976bf45 --- /dev/null +++ b/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -161,6 +161,12 @@ if (enable_threads) + message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") + if (without_libatomic_ops OR BORLAND OR MSVC OR WATCOM) + include_directories(libatomic_ops/src) ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() + # Note: alternatively, use CFLAGS_EXTRA to pass -I<...>/libatomic_ops/src. + else() + # Assume the compiler supports GCC atomic intrinsics. diff --git a/recipes/bdwgc/all/test_package/CMakeLists.txt b/recipes/bdwgc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b8623ba2be96 --- /dev/null +++ b/recipes/bdwgc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(BDWgc CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BDWgc::gc) diff --git a/recipes/bdwgc/all/test_package/conanfile.py b/recipes/bdwgc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fde7967ed16f1 --- /dev/null +++ b/recipes/bdwgc/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run + + +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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/bdwgc/all/test_package/test_package.c b/recipes/bdwgc/all/test_package/test_package.c new file mode 100644 index 0000000000000..b2df5018e2c03 --- /dev/null +++ b/recipes/bdwgc/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include "gc.h" + +#include +#include + +int main() +{ + int i; + + GC_INIT(); /* Optional on Linux/X86; see below. */ + for (i = 0; i < 10000000; ++i) + { + int **p = (int **) GC_MALLOC(sizeof(int *)); + int *q = (int *) GC_MALLOC_ATOMIC(sizeof(int)); + assert(*p == 0); + *p = (int *) GC_REALLOC(q, 2 * sizeof(int)); + if (i % 100000 == 0) + printf("Heap size = %u\n", (unsigned) GC_get_heap_size()); + } + return 0; +} diff --git a/recipes/bdwgc/all/test_v1_package/CMakeLists.txt b/recipes/bdwgc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ab3169f9e927 --- /dev/null +++ b/recipes/bdwgc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(BDWgc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BDWgc::gc) diff --git a/recipes/bdwgc/all/test_v1_package/conanfile.py b/recipes/bdwgc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..dfe389167a895 --- /dev/null +++ b/recipes/bdwgc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake +from conan.tools.build import cross_building + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/bdwgc/config.yml b/recipes/bdwgc/config.yml new file mode 100644 index 0000000000000..a32355f74df3f --- /dev/null +++ b/recipes/bdwgc/config.yml @@ -0,0 +1,7 @@ +versions: + "8.0.4": + folder: all + "8.0.6": + folder: all + "8.2.2": + folder: all diff --git a/recipes/bear/all/conandata.yml b/recipes/bear/all/conandata.yml new file mode 100644 index 0000000000000..4328506e20e22 --- /dev/null +++ b/recipes/bear/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.0.21": + url: "https://github.com/rizsotto/Bear/archive/refs/tags/3.0.21.tar.gz" + sha256: "0c949a6a907bc61a1284661f8d9dab1788a62770c265f6142602669b6e5c389d" +patches: + "3.0.21": + - patch_file: "patches/7de12540948cd5e0ee5f966b5cc383bc0c0e5fe9.diff" diff --git a/recipes/bear/all/conanfile.py b/recipes/bear/all/conanfile.py new file mode 100644 index 0000000000000..edeff717d1616 --- /dev/null +++ b/recipes/bear/all/conanfile.py @@ -0,0 +1,111 @@ +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 apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class BearConan(ConanFile): + name = "bear" + description = "Bear is a tool that generates a compilation database for clang tooling" + license = "GPL-3.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rizsotto/Bear" + topics = ("clang", "compilation", "database", "llvm") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "12", + "apple-clang": "12", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("grpc/1.50.1") + self.requires("fmt/9.1.0") + self.requires("spdlog/1.11.0") + self.requires("nlohmann_json/3.11.2") + + def build_requirements(self): + self.tool_requires("grpc/1.50.1") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + 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": + raise ConanInvalidConfiguration(f"{self.ref} can not be built on windows.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_UNIT_TESTS"] = False + tc.variables["ENABLE_FUNC_TESTS"] = False + tc.generate() + # In case there are dependencies listed on requirements, CMakeDeps should be used + tc = CMakeDeps(self) + tc.generate() + + pc = PkgConfigDeps(self) + pc.generate() + + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + 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.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 + bin_folder = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_folder) diff --git a/recipes/bear/all/patches/7de12540948cd5e0ee5f966b5cc383bc0c0e5fe9.diff b/recipes/bear/all/patches/7de12540948cd5e0ee5f966b5cc383bc0c0e5fe9.diff new file mode 100644 index 0000000000000..445f363e4f1c3 --- /dev/null +++ b/recipes/bear/all/patches/7de12540948cd5e0ee5f966b5cc383bc0c0e5fe9.diff @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9de55a32..1f29f972 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,12 +106,6 @@ endif () + + # Install the project artifacts from the staged directory + include(GNUInstallDirs) +-install(DIRECTORY +- ${STAGED_INSTALL_PREFIX}/ +- DESTINATION +- . +- USE_SOURCE_PERMISSIONS +-) + install(FILES + COPYING README.md INSTALL.md CONTRIBUTING.md CODE_OF_CONDUCT.md + DESTINATION diff --git a/recipes/bear/all/test_package/conanfile.py b/recipes/bear/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bc7a59b9b90d0 --- /dev/null +++ b/recipes/bear/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("bear --version") diff --git a/recipes/bear/all/test_v1_package/conanfile.py b/recipes/bear/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..bd3d11c7c6e42 --- /dev/null +++ b/recipes/bear/all/test_v1_package/conanfile.py @@ -0,0 +1,11 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if can_run(self): + self.run("bear --version", run_environment=True) diff --git a/recipes/bear/config.yml b/recipes/bear/config.yml new file mode 100644 index 0000000000000..b08adc3d32b8b --- /dev/null +++ b/recipes/bear/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.21": + folder: all diff --git a/recipes/beauty/all/conandata.yml b/recipes/beauty/all/conandata.yml new file mode 100644 index 0000000000000..67db3d5af7757 --- /dev/null +++ b/recipes/beauty/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.0-rc1": + url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.0-rc1.tar.gz" + sha256: "e5c0cdffd9324ed0cbe771a4aaff3a572ec553dc0275bbaf4db754ce043ecf49" +patches: + "1.0.0-rc1": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/beauty/all/conanfile.py b/recipes/beauty/all/conanfile.py new file mode 100644 index 0000000000000..db4a11b8cb724 --- /dev/null +++ b/recipes/beauty/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class BeautyConan(ConanFile): + name = "beauty" + homepage = "https://github.com/dfleury2/beauty" + description = "HTTP Server above Boost.Beast" + topics = ("http", "server", "boost.beast") + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + + 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": "8", + "clang": "11", + "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.79.0"), + self.requires("openssl/1.1.1s") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": + raise ConanInvalidConfiguration("Only libc++ is supported for clang") + + if self.settings.compiler == "apple-clang" and self.options.shared: + raise ConanInvalidConfiguration("shared is not supported on apple-clang") + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("shared is not supported on Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build(target="beauty") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "beauty") + self.cpp_info.set_property("cmake_target_name", "beauty::beauty") + self.cpp_info.libs = ["beauty"] + self.cpp_info.requires = ["boost::headers", "openssl::openssl"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/beauty/all/patches/0001-fix-cmake.patch b/recipes/beauty/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..6bdf75a96f54e --- /dev/null +++ b/recipes/beauty/all/patches/0001-fix-cmake.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.15) + project(Beauty) + set(VERSION 0.1-rc) + ++if(0) + if (CONAN_EXPORTED) + else() + if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake) +@@ -20,6 +21,7 @@ else() + endif() + + include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake) ++endif() + + # C++ + set(CMAKE_CXX_STANDARD 20) diff --git a/recipes/beauty/all/test_package/CMakeLists.txt b/recipes/beauty/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8673671fd5aab --- /dev/null +++ b/recipes/beauty/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +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) diff --git a/recipes/beauty/all/test_package/conanfile.py b/recipes/beauty/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/beauty/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/beauty/all/test_package/test_package.cpp b/recipes/beauty/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..60288e6673e4c --- /dev/null +++ b/recipes/beauty/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + // Create a server + beauty::server server; +} diff --git a/recipes/beauty/all/test_v1_package/CMakeLists.txt b/recipes/beauty/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/beauty/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/beauty/all/test_v1_package/conanfile.py b/recipes/beauty/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/beauty/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/beauty/config.yml b/recipes/beauty/config.yml new file mode 100644 index 0000000000000..ca2cfd0e152c6 --- /dev/null +++ b/recipes/beauty/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0-rc1": + folder: all diff --git a/recipes/behaviortree.cpp/all/conandata.yml b/recipes/behaviortree.cpp/all/conandata.yml new file mode 100644 index 0000000000000..8e188b3097d43 --- /dev/null +++ b/recipes/behaviortree.cpp/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "4.0.1": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.0.1.tar.gz" + sha256: "71544f72abea8e8c246b016b7e8d87d96f731c8aa96698058d8e69d40e56f9b9" + "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 new file mode 100644 index 0000000000000..54f5ae5ad8322 --- /dev/null +++ b/recipes/behaviortree.cpp/all/conanfile.py @@ -0,0 +1,165 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + +class BehaviorTreeCPPConan(ConanFile): + name = "behaviortree.cpp" + description = "This C++ library provides a framework to create BehaviorTrees" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/BehaviorTree/BehaviorTree.CPP" + topics = ("ai", "robotics", "games", "coordination") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tools": [True, False], + "with_coroutines": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tools": False, + "with_coroutines": False, + } + + @property + def _minimum_cppstd_required(self): + return 14 if Version(self.version) < "4.0" else 17 + + @property + def _minimum_compilers_version(self): + if Version(self.version) < "4.0": + return { + "gcc": "5", + "clang": "5", + "apple-clang": "12", + } + else: + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + 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): + 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") + + 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)) + + 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++") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if 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 + 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.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "BehaviorTreeV3")) + 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") + else: + self.cpp_info.set_property("cmake_file_name", "BehaviorTree") + + libname = "behaviortree_cpp_v3" if Version(self.version) < "4.0" else "behaviortree_cpp" + self.cpp_info.set_property("cmake_target_name", f"BT::{libname}") + + 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") + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components[libname].system_libs.append("pthread") + 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.names["cmake_find_package"] = "BT" + self.cpp_info.names["cmake_find_package_multi"] = "BT" + self.cpp_info.components[libname].names["cmake_find_package"] = libname + self.cpp_info.components[libname].names["cmake_find_package_multi"] = libname + self.cpp_info.components[libname].set_property("cmake_target_name", f"BT::{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 new file mode 100644 index 0000000000000..7cb2daad955aa --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000000..c717020c8e00a --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch @@ -0,0 +1,68 @@ +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 new file mode 100644 index 0000000000000..4996714060f93 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000000000..75f9c74e55e10 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000000..d1b1b47051f32 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000000..b1bd9fd89538c --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000000..7290476cc8726 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch @@ -0,0 +1,68 @@ +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 new file mode 100644 index 0000000000000..5bf8893db1770 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000000..23931bd446392 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000000..6753b06f564d0 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch @@ -0,0 +1,57 @@ +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 new file mode 100644 index 0000000000000..b69541449eb87 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch @@ -0,0 +1,13 @@ +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/all/test_package/CMakeLists.txt b/recipes/behaviortree.cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d710fc297db68 --- /dev/null +++ b/recipes/behaviortree.cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(BehaviorTreeV3 CONFIG) +if(TARGET BT::behaviortree_cpp_v3) + target_link_libraries(${PROJECT_NAME} PRIVATE BT::behaviortree_cpp_v3) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DBEHAVIORTREE_CPP_VERSION=3) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + find_package(BehaviorTree REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE BT::behaviortree_cpp) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DBEHAVIORTREE_CPP_VERSION=4) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/behaviortree.cpp/all/test_package/conanfile.py b/recipes/behaviortree.cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/behaviortree.cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/behaviortree.cpp/all/test_package/test_package.cpp b/recipes/behaviortree.cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d5a7ae6ffc770 --- /dev/null +++ b/recipes/behaviortree.cpp/all/test_package/test_package.cpp @@ -0,0 +1,106 @@ +#if BEHAVIORTREE_CPP_VERSION < 4 +#include "behaviortree_cpp_v3/bt_factory.h" +#else +#include "behaviortree_cpp/bt_factory.h" +#endif + +using namespace BT; + +struct Position2D { double x,y; }; + +namespace BT{ + template <> inline Position2D convertFromString(StringView str) { + printf("Converting string: \"%s\"\n", str.data() ); + + // real numbers separated by semicolons + auto parts = splitString(str, ';'); + if (parts.size() != 2) + { + throw RuntimeError("invalid input)"); + } + else{ + Position2D output; + output.x = convertFromString(parts[0]); + output.y = convertFromString(parts[1]); + return output; + } + } +} + +class CalculateGoal: public SyncActionNode{ +public: +#if BEHAVIORTREE_CPP_VERSION < 4 + CalculateGoal(const std::string& name, const NodeConfiguration& config): + SyncActionNode(name,config) {} +#else + CalculateGoal(const std::string& name, const NodeConfig& config): + SyncActionNode(name,config) {} +#endif + + NodeStatus tick() override{ + Position2D mygoal = {1.1, 2.3}; + setOutput("goal", mygoal); + return NodeStatus::SUCCESS; + } + static PortsList providedPorts(){ + return { OutputPort("goal") }; + } +}; + + +class PrintTarget: public SyncActionNode { +public: +#if BEHAVIORTREE_CPP_VERSION < 4 + PrintTarget(const std::string& name, const NodeConfiguration& config): + SyncActionNode(name,config) {} +#else + PrintTarget(const std::string& name, const NodeConfig& config): + SyncActionNode(name,config) {} +#endif + + NodeStatus tick() override { + auto res = getInput("target"); + if( !res ){ + throw RuntimeError("error reading port [target]:", res.error() ); + } + Position2D goal = res.value(); + printf("Target positions: [ %.1f, %.1f ]\n", goal.x, goal.y ); + return NodeStatus::SUCCESS; + } + + static PortsList providedPorts() { + // Optionally, a port can have a human readable description + const char* description = "Simply print the target on console..."; + return { InputPort("target", description) }; + } +}; + +static const char* xml_text = R"( + + + + + + + + + + + )"; + + +int main() { + using namespace BT; + + BehaviorTreeFactory factory; + factory.registerNodeType("CalculateGoal"); + factory.registerNodeType("PrintTarget"); + + auto tree = factory.createTreeFromText(xml_text); +#if BEHAVIORTREE_CPP_VERSION < 4 + tree.tickRoot(); +#else + tree.tickWhileRunning(); +#endif + return 0; +} diff --git a/recipes/behaviortree.cpp/all/test_v1_package/CMakeLists.txt b/recipes/behaviortree.cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/behaviortree.cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/behaviortree.cpp/all/test_v1_package/conanfile.py b/recipes/behaviortree.cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/behaviortree.cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/behaviortree.cpp/config.yml b/recipes/behaviortree.cpp/config.yml new file mode 100644 index 0000000000000..e1234d5535a8c --- /dev/null +++ b/recipes/behaviortree.cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "4.0.1": + folder: all + "3.7.0": + folder: all + "3.5.6": + folder: all diff --git a/recipes/benchmark/all/conandata.yml b/recipes/benchmark/all/conandata.yml new file mode 100644 index 0000000000000..b417e78a3f997 --- /dev/null +++ b/recipes/benchmark/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.8.0": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.0.tar.gz" + sha256: "ea2e94c24ddf6594d15c711c06ccd4486434d9cf3eca954e2af8a20c88f9f172" + "1.7.1": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.1.tar.gz" + sha256: "6430e4092653380d9dc4ccb45a1e2dc9259d581f4866dc0759713126056bc1d7" + "1.7.0": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.0.tar.gz" + sha256: "3aff99169fa8bdee356eaa1f691e835a6e57b1efeadb8a0f9f228531158246ac" + "1.6.2": + url: "https://github.com/google/benchmark/archive/v1.6.2.tar.gz" + sha256: "a9f77e6188c1cd4ebedfa7538bf5176d6acc72ead6f456919e5f464ef2f06158" + "1.6.1": + url: "https://github.com/google/benchmark/archive/v1.6.1.tar.gz" + sha256: "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4" + "1.6.0": + url: "https://github.com/google/benchmark/archive/v1.6.0.tar.gz" + sha256: "1f71c72ce08d2c1310011ea6436b31e39ccab8c2db94186d26657d41747c85d6" + "1.5.6": + url: "https://github.com/google/benchmark/archive/v1.5.6.tar.gz" + sha256: "789f85b4810d13ff803834ea75999e41b326405d83d6a538baf01499eda96102" diff --git a/recipes/benchmark/all/conanfile.py b/recipes/benchmark/all/conanfile.py new file mode 100644 index 0000000000000..de0392e20c566 --- /dev/null +++ b/recipes/benchmark/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class BenchmarkConan(ConanFile): + name = "benchmark" + description = "A microbenchmark support library." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://github.com/google/benchmark" + topics = ("google", "microbenchmark") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_lto": [True, False], + "enable_exceptions": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_lto": False, + "enable_exceptions": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "190") + if Version(self.version) < "1.7.0" and is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support msvc shared builds") + + def build_requirements(self): + if Version(self.version) >= "1.7.1": + self.tool_requires("cmake/[>=3.16.3 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BENCHMARK_ENABLE_TESTING"] = "OFF" + tc.variables["BENCHMARK_ENABLE_GTEST_TESTS"] = "OFF" + tc.variables["BENCHMARK_ENABLE_LTO"] = self.options.enable_lto + tc.variables["BENCHMARK_ENABLE_EXCEPTIONS"] = self.options.enable_exceptions + if Version(self.version) >= "1.6.1": + tc.variables["BENCHMARK_ENABLE_WERROR"] = False + tc.variables["BENCHMARK_FORCE_WERROR"] = False + if self.settings.os != "Windows": + if cross_building(self): + tc.variables["HAVE_STD_REGEX"] = False + tc.variables["HAVE_POSIX_REGEX"] = False + tc.variables["HAVE_STEADY_CLOCK"] = False + tc.variables["BENCHMARK_USE_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++" + else: + tc.variables["BENCHMARK_USE_LIBCXX"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "benchmark") + self.cpp_info.set_property("pkg_config_name", "benchmark") + + self.cpp_info.components["_benchmark"].set_property("cmake_target_name", "benchmark::benchmark") + self.cpp_info.components["_benchmark"].libs = ["benchmark"] + if Version(self.version) >= "1.7.0" and not self.options.shared: + self.cpp_info.components["_benchmark"].defines.append("BENCHMARK_STATIC_DEFINE") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["_benchmark"].system_libs.extend(["pthread", "rt", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.components["_benchmark"].system_libs.append("shlwapi") + elif self.settings.os == "SunOS": + self.cpp_info.components["_benchmark"].system_libs.append("kstat") + + self.cpp_info.components["benchmark_main"].set_property("cmake_target_name", "benchmark::benchmark_main") + self.cpp_info.components["benchmark_main"].libs = ["benchmark_main"] + self.cpp_info.components["benchmark_main"].requires = ["_benchmark"] + + # workaround to have all components in CMakeDeps of downstream recipes + self.cpp_info.set_property("cmake_target_name", "benchmark::benchmark_main") diff --git a/recipes/benchmark/all/test_package/CMakeLists.txt b/recipes/benchmark/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..58358ea09a5db --- /dev/null +++ b/recipes/benchmark/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(benchmark REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark benchmark::benchmark_main) diff --git a/recipes/benchmark/all/test_package/conanfile.py b/recipes/benchmark/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/benchmark/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/benchmark/all/test_package/test_package.cpp b/recipes/benchmark/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4fa7ec0bf9d3c --- /dev/null +++ b/recipes/benchmark/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include "benchmark/benchmark.h" + +void BM_StringCreation(benchmark::State& state) { + while (state.KeepRunning()) + std::string empty_string; +} + +BENCHMARK(BM_StringCreation); + +void BM_StringCopy(benchmark::State& state) { + std::string x = "hello"; + while (state.KeepRunning()) + std::string copy(x); +} + +BENCHMARK(BM_StringCopy); + +BENCHMARK_MAIN(); diff --git a/recipes/benchmark/all/test_v1_package/CMakeLists.txt b/recipes/benchmark/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/benchmark/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/benchmark/all/test_v1_package/conanfile.py b/recipes/benchmark/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/benchmark/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml new file mode 100644 index 0000000000000..c75e2eaab25cc --- /dev/null +++ b/recipes/benchmark/config.yml @@ -0,0 +1,15 @@ +versions: + "1.8.0": + folder: all + "1.7.1": + folder: all + "1.7.0": + folder: all + "1.6.2": + folder: all + "1.6.1": + folder: all + "1.6.0": + folder: all + "1.5.6": + folder: all diff --git a/recipes/bertrand/all/conandata.yml b/recipes/bertrand/all/conandata.yml new file mode 100644 index 0000000000000..78b4e7eb868bb --- /dev/null +++ b/recipes/bertrand/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.013": + url: "https://github.com/bernedom/bertrand/archive/0.013.tar.gz" + sha256: "f2f071006d3a9b31382957b84e81405adba44cbf1a9bb8242ad4d0f44d7af7fb" + "0.0.17": + url: https://github.com/bernedom/bertrand/archive/0.0.17.tar.gz + sha256: 72e59971bd8ae48d95da9337ad78004b99ba4e8d0eeb3b613ce17b577ca41012 + "0.0.15": + url: https://github.com/bernedom/bertrand/archive/0.0.15.tar.gz + sha256: 5ad481c2fc3d3166d8660ab3013b4513c5b425c9f13c8925b3cfb40f988d8e9b + "0.0.14": + url: https://github.com/bernedom/bertrand/archive/0.0.14.tar.gz + sha256: f6ba82e715f9371f06a0d0bd6b7f017c3ff0709e8e5142d8fd4ba00aec1228ba + "0.0.12": + url: https://github.com/bernedom/bertrand/archive/0.0.12.tar.gz + sha256: 0648edbb9ea39a918f718a672e14b26c614d8409f146c1550becd45d881cfcf4 diff --git a/recipes/bertrand/all/conanfile.py b/recipes/bertrand/all/conanfile.py new file mode 100644 index 0000000000000..3e410daba2d59 --- /dev/null +++ b/recipes/bertrand/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.50.0" + + +class BertrandConan(ConanFile): + name = "bertrand" + license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bernedom/bertrand" + description = "A C++ header only library providing a trivial implementation for design by contract." + topics = ("design by contract", "dbc", "cplusplus-library", "cplusplus-17") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + 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["BERTRAND_BUILD_TESTING"] = False + tc.variables["BERTRAND_INSTALL_LIBRARY"] = 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, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bertrand") + self.cpp_info.set_property("cmake_target_name", "bertrand::bertrand") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/bertrand/all/test_package/CMakeLists.txt b/recipes/bertrand/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8d8eab3e4ede9 --- /dev/null +++ b/recipes/bertrand/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(bertrand REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_link_libraries(${PROJECT_NAME} PRIVATE bertrand::bertrand) diff --git a/recipes/bertrand/all/test_package/conanfile.py b/recipes/bertrand/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/bertrand/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/bertrand/all/test_package/test_package.cpp b/recipes/bertrand/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cf38455375e78 --- /dev/null +++ b/recipes/bertrand/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ + +#include + +int main(int, char **) { + Require(true, "A non-failing contract"); + return 0; +} diff --git a/recipes/bertrand/all/test_v1_package/CMakeLists.txt b/recipes/bertrand/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4b58a4f48ada0 --- /dev/null +++ b/recipes/bertrand/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bertrand 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} PRIVATE bertrand::bertrand) diff --git a/recipes/bertrand/all/test_v1_package/conanfile.py b/recipes/bertrand/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bertrand/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/bertrand/config.yml b/recipes/bertrand/config.yml new file mode 100644 index 0000000000000..f342735d8a8f8 --- /dev/null +++ b/recipes/bertrand/config.yml @@ -0,0 +1,11 @@ +versions: + "0.013": + folder: all + "0.0.17": + folder: all + "0.0.15": + folder: all + "0.0.14": + folder: all + "0.0.12": + folder: all diff --git a/recipes/bigint/all/CMakeLists.txt b/recipes/bigint/all/CMakeLists.txt new file mode 100644 index 0000000000000..acc15b2e4f05f --- /dev/null +++ b/recipes/bigint/all/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.4) +project(bigint LANGUAGES CXX) + +include(GNUInstallDirs) + +add_library(bigint + ${BIGINT_SRC_DIR}/BigUnsigned.cc + ${BIGINT_SRC_DIR}/BigInteger.cc + ${BIGINT_SRC_DIR}/BigIntegerAlgorithms.cc + ${BIGINT_SRC_DIR}/BigUnsignedInABase.cc + ${BIGINT_SRC_DIR}/BigIntegerUtils.cc +) + +set(BIGINT_PUBLIC_HEADERS + ${BIGINT_SRC_DIR}/BigIntegerLibrary.hh + ${BIGINT_SRC_DIR}/NumberlikeArray.hh + ${BIGINT_SRC_DIR}/BigUnsigned.hh + ${BIGINT_SRC_DIR}/BigInteger.hh + ${BIGINT_SRC_DIR}/BigIntegerAlgorithms.hh + ${BIGINT_SRC_DIR}/BigUnsignedInABase.hh + ${BIGINT_SRC_DIR}/BigIntegerUtils.hh +) + +set_target_properties(bigint PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + PUBLIC_HEADER "${BIGINT_PUBLIC_HEADERS}" +) + +install( + TARGETS bigint + 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/bigint/all/conandata.yml b/recipes/bigint/all/conandata.yml new file mode 100644 index 0000000000000..d95cb78607454 --- /dev/null +++ b/recipes/bigint/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2010.04.30": + url: "https://mattmccutchen.net/bigint/bigint-2010.04.30.tar.bz2" + sha256: "05fb838472b8f06c30cd11d58e6d911dd54d8413338c4d3d77dd4e52fed6dacc" +patches: + "2010.04.30": + - patch_file: "patches/0001-deprecation-wanings.patch" diff --git a/recipes/bigint/all/conanfile.py b/recipes/bigint/all/conanfile.py new file mode 100644 index 0000000000000..5c6ea127ba6bd --- /dev/null +++ b/recipes/bigint/all/conanfile.py @@ -0,0 +1,69 @@ +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class BigintConan(ConanFile): + name = "bigint" + description = "C++ Big Integer Library" + license = "Unlicense" + topics = ("bigint", "integer") + homepage = "https://mattmccutchen.net/bigint" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + 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.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("shared with static runtime not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BIGINT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "README", 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 = ["bigint"] diff --git a/recipes/bigint/all/patches/0001-deprecation-wanings.patch b/recipes/bigint/all/patches/0001-deprecation-wanings.patch new file mode 100644 index 0000000000000..2902ef801709e --- /dev/null +++ b/recipes/bigint/all/patches/0001-deprecation-wanings.patch @@ -0,0 +1,35 @@ +--- a/BigUnsigned.hh ++++ b/BigUnsigned.hh +@@ -20,7 +20,7 @@ public: + typedef unsigned long Blk; + + typedef NumberlikeArray::Index Index; +- NumberlikeArray::N; ++ using NumberlikeArray::N; + + protected: + // Creates a BigUnsigned with a capacity; for internal use. +@@ -84,8 +84,8 @@ public: + // BIT/BLOCK ACCESSORS + + // Expose these from NumberlikeArray directly. +- NumberlikeArray::getCapacity; +- NumberlikeArray::getLength; ++ using NumberlikeArray::getCapacity; ++ using NumberlikeArray::getLength; + + /* Returns the requested block, or 0 if it is beyond the length (as if + * the number had 0s infinitely to the left). */ +--- a/BigUnsignedInABase.hh ++++ b/BigUnsignedInABase.hh +@@ -100,8 +100,8 @@ public: + Base getBase() const { return base; } + + // Expose these from NumberlikeArray directly. +- NumberlikeArray::getCapacity; +- NumberlikeArray::getLength; ++ using NumberlikeArray::getCapacity; ++ using NumberlikeArray::getLength; + + /* Returns the requested digit, or 0 if it is beyond the length (as if + * the number had 0s infinitely to the left). */ diff --git a/recipes/bigint/all/test_package/CMakeLists.txt b/recipes/bigint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..301bd00b111ce --- /dev/null +++ b/recipes/bigint/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(bigint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bigint::bigint) diff --git a/recipes/bigint/all/test_package/conanfile.py b/recipes/bigint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/bigint/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/bigint/all/test_package/test_package.cpp b/recipes/bigint/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5ce60fe98277 --- /dev/null +++ b/recipes/bigint/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + BigInteger a = 65536; + std::cout << a << "^8 = " << a * a * a * a * a * a * a * a << std::endl; + return 0; +} diff --git a/recipes/bigint/all/test_v1_package/CMakeLists.txt b/recipes/bigint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bigint/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bigint/all/test_v1_package/conanfile.py b/recipes/bigint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bigint/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/bigint/config.yml b/recipes/bigint/config.yml new file mode 100644 index 0000000000000..03ea2082495cf --- /dev/null +++ b/recipes/bigint/config.yml @@ -0,0 +1,3 @@ +versions: + "2010.04.30": + folder: all diff --git a/recipes/bimg/all/conandata.yml b/recipes/bimg/all/conandata.yml new file mode 100644 index 0000000000000..b65f46ed5223b --- /dev/null +++ b/recipes/bimg/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230114": + url: "https://github.com/bkaradzic/bimg/archive/7afa2419254fd466c013a51bdeb0bee3022619c4.tar.gz" + sha256: "664D2DB41B60E1BEA473898427CD71D43CD33397A24596F1A2CF269D324A305D" diff --git a/recipes/bimg/all/conanfile.py b/recipes/bimg/all/conanfile.py new file mode 100644 index 0000000000000..83eb227558d62 --- /dev/null +++ b/recipes/bimg/all/conanfile.py @@ -0,0 +1,246 @@ +from conan import ConanFile +from conan.tools.files import copy, get, rename +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs, is_msvc_static_runtime +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import MSBuild, VCVars +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualBuildEnv +from pathlib import Path +import os + +required_conan_version = ">=1.50.0" + + +class bimgConan(ConanFile): + name = "bimg" + license = "BSD-2-Clause" + homepage = "https://github.com/bkaradzic/bimg" + url = "https://github.com/conan-io/conan-center-index" + description = "Image library providing loading, saving, conversions and other utilities." + topics = ("image", "graphics") + settings = "os", "compiler", "arch", "build_type" + options = {"tools": [True, False]} + default_options = {"tools": False} + + @property + def _bx_folder(self): + return "bx" + + @property + def _bimg_folder(self): + return "bimg" + + @property + def _bimg_path(self): + return os.path.join(self.source_folder, self._bimg_folder) + + @property + def _genie_extra(self): + genie_extra = "" + if is_msvc(self) and not is_msvc_static_runtime(self): + genie_extra += " --with-dynamic-runtime" + if self.options.tools: + genie_extra += " --with-tools" + return genie_extra + + @property + def _lib_target_prefix(self): + if self.settings.os == "Windows": + return "libs\\" + else: + return "" + + @property + def _tool_target_prefix(self): + if self.settings.os == "Windows": + return "tools\\" + else: + return "" + + @property + def _projs(self): + projs = [f"{self._lib_target_prefix}bimg", f"{self._lib_target_prefix}bimg_decode", f"{self._lib_target_prefix}bimg_encode"] + if self.options.tools: + projs.extend([f"{self._lib_target_prefix}texturec"]) + return projs + + @property + def _compiler_required(self): + return { + "gcc": "8", + "clang": "3.3", + "apple-clang": "5", + } + + @property + def _bx_version(self): #mapping of bimg version to required/used bx version + return {"cci.20230114": "cci.20221116"} + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires(f"bx/{self._bx_version[self.version]}") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + check_min_vs(self, 191) + if not is_msvc(self): + try: + minimum_required_compiler_version = self._compiler_required[str(self.settings.compiler)] + if Version(self.settings.compiler.version) < minimum_required_compiler_version: + raise ConanInvalidConfiguration("This package requires C++14 support. The current compiler does not support it.") + except KeyError: + self.output.warn("This recipe has no checking for the current compiler. Please consider adding it.") + + def build_requirements(self): + self.tool_requires("genie/1170") + if not is_msvc(self) and 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, + destination=os.path.join(self.source_folder, self._bimg_folder)) + # bimg's genie project, and the projects generated by it, expect bx source to be present on the same relative root as bimg's in order to build + # usins a pre-built bx instead would require significant changes to the genie project but may be worth looking into in the future + get(self, **self.dependencies["bx"].conan_data["sources"][self._bx_version[self.version]], strip_root=True, + destination=os.path.join(self.source_folder, self._bx_folder)) + + def generate(self): + vbe = VirtualBuildEnv(self) + vbe.generate() + if is_msvc(self): + tc = VCVars(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if is_msvc(self): + # Conan to Genie translation maps + vs_ver_to_genie = {"17": "2022", "16": "2019", "15": "2017", + "193": "2022", "192": "2019", "191": "2017"} + + # Use genie directly, then msbuild on specific projects based on requirements + genie_VS = f"vs{vs_ver_to_genie[str(self.settings.compiler.version)]}" + genie_gen = f"{self._genie_extra} {genie_VS}" + self.run(f"genie {genie_gen}", cwd=self._bimg_path) + + msbuild = MSBuild(self) + # customize to Release when RelWithDebInfo + msbuild.build_type = "Debug" if self.settings.build_type == "Debug" else "Release" + # use Win32 instead of the default value when building x86 + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(self._bimg_path, ".build", "projects", genie_VS, "bimg.sln"), targets=self._projs) + else: + # Not sure if XCode can be spefically handled by conan for building through, so assume everything not VS is make + # gcc-multilib and g++-multilib required for 32bit cross-compilation, should see if we can check and install through conan + + # Conan to Genie translation maps + compiler_str = str(self.settings.compiler) + compiler_and_os_to_genie = {"Windows": f"--gcc=mingw-{compiler_str}", "Linux": f"--gcc=linux-{compiler_str}", + "FreeBSD": "--gcc=freebsd", "Macos": "--gcc=osx", + "Android": "--gcc=android", "iOS": "--gcc=ios"} + gmake_os_to_proj = {"Windows": "mingw", "Linux": "linux", "FreeBSD": "freebsd", "Macos": "osx", "Android": "android", "iOS": "ios"} + gmake_arch_to_genie_suffix = {"x86": "-x86", "x86_64": "-x64", "armv8": "-arm64", "armv7": "-arm"} + os_to_use_arch_config_suffix = {"Windows": False, "Linux": False, "FreeBSD": False, "Macos": True, "Android": True, "iOS": True} + + build_type_to_make_config = {"Debug": "config=debug", "Release": "config=release"} + arch_to_make_config_suffix = {"x86": "32", "x86_64": "64"} + os_to_use_make_config_suffix = {"Windows": True, "Linux": True, "FreeBSD": True, "Macos": False, "Android": False, "iOS": False} + + # Generate projects through genie + genieGen = f"{self._genie_extra} {compiler_and_os_to_genie[str(self.settings.os)]}" + if os_to_use_arch_config_suffix[str(self.settings.os)]: + genieGen += f"{gmake_arch_to_genie_suffix[str(self.settings.arch)]}" + genieGen += " gmake" + self.run(f"genie {genieGen}", cwd=self._bimg_path) + + # Build project folder and path from given settings + projFolder = f"gmake-{gmake_os_to_proj[str(self.settings.os)]}" + if self.settings.os == "Windows" or compiler_str not in ["gcc", "apple-clang"]: + projFolder += f"-{compiler_str}" #mingw-gcc or mingw-clang for windows; -clang for linux (where gcc on linux has no extra) + if os_to_use_arch_config_suffix[str(self.settings.os)]: + projFolder += gmake_arch_to_genie_suffix[str(self.settings.arch)] + proj_path = os.path.sep.join([self._bimg_path, ".build", "projects", projFolder]) + + # Build make args from settings + conf = build_type_to_make_config[str(self.settings.build_type)] + if os_to_use_make_config_suffix[str(self.settings.os)]: + conf += arch_to_make_config_suffix[str(self.settings.arch)] + if self.settings.os == "Windows": + mingw = "MINGW=$MINGW_PREFIX" + proj_path = proj_path.replace("\\", "/") # Fix path for msys... + else: + mingw = "" + autotools = Autotools(self) + # Build with make + for proj in self._projs: + autotools.make(target=proj, args=["-R", f"-C {proj_path}", mingw, conf]) + + def package(self): + # Set platform suffixes and prefixes + if self.settings.os == "Windows": + lib_pat = "*bimg*.lib" + package_lib_prefix = "" + elif self.settings.os in ["Linux", "FreeBSD"]: + lib_pat = "*bimg*.a" + package_lib_prefix = "lib" + elif self.settings.os == "Macos": + lib_pat = "*bimg*.a" + package_lib_prefix = "lib" + + # Get build bin folder + for bimg_out_dir in os.listdir(os.path.join(self._bimg_path, ".build")): + if not bimg_out_dir=="projects": + build_bin = os.path.join(self._bimg_path, ".build", bimg_out_dir, "bin") + break + + # Copy license + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._bimg_path) + # Copy includes + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._bimg_path, "include")) + # Copy libs + copy(self, pattern=lib_pat, dst=os.path.join(self.package_folder, "lib"), src=build_bin, keep_path=False) + # Copy tools + if self.options.tools: + copy(self, pattern="texturec*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + + # Rename for consistency across platforms and configs + for bimg_file in Path(os.path.join(self.package_folder, "lib")).glob("*bimg*"): + fExtra = "" + if bimg_file.name.find("encode") >= 0: + fExtra = "_encode" + elif bimg_file.name.find("decode") >= 0: + fExtra = "_decode" + rename(self, os.path.join(self.package_folder, "lib", bimg_file.name), + os.path.join(self.package_folder, "lib", f"{package_lib_prefix}bimg{fExtra}{bimg_file.suffix}")) + if self.options.tools: + for bimg_file in Path(os.path.join(self.package_folder, "bin")).glob("*texturec*"): + rename(self, os.path.join(self.package_folder, "bin", bimg_file.name), + os.path.join(self.package_folder, "bin", f"texturec{bimg_file.suffix}")) + + def package_info(self): + self.cpp_info.includedirs = ["include"] + self.cpp_info.libs = ["bimg_encode", "bimg_decode", "bimg"] + + self.cpp_info.set_property("cmake_file_name", "bimg") + self.cpp_info.set_property("cmake_target_name", "bimg::bimg") + self.cpp_info.set_property("pkg_config_name", "bimg") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "bimg" + self.cpp_info.filenames["cmake_find_package_multi"] = "bimg" + self.cpp_info.names["cmake_find_package"] = "bimg" + self.cpp_info.names["cmake_find_package_multi"] = "bimg" diff --git a/recipes/bimg/all/test_package/CMakeLists.txt b/recipes/bimg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ffa49fe136f63 --- /dev/null +++ b/recipes/bimg/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(bimg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} bimg::bimg) diff --git a/recipes/bimg/all/test_package/conanfile.py b/recipes/bimg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4100c3ff4959c --- /dev/null +++ b/recipes/bimg/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake +import os + +required_conan_version = ">=1.50.0" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + if can_run(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/bimg/all/test_package/test_package.cpp b/recipes/bimg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8869b9884eaf4 --- /dev/null +++ b/recipes/bimg/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +//An embedded 2x2 PNG image in RGB8 format with a red pixel, a green pixel, a blue pixel and a white pixel +const unsigned char img[129] ={0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, +0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x02, +0x00, 0x00, 0x00, 0x02, 0x08, 0x02, 0x00, 0x00, 0x00, 0xfd, 0xd4, 0x9a, +0x73, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, +0x1c, 0xe9, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, +0xb1, 0x8f, 0x0b, 0xfc, 0x61, 0x05, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, +0x59, 0x73, 0x00, 0x00, 0x0e, 0xc3, 0x00, 0x00, 0x0e, 0xc3, 0x01, 0xc7, +0x6f, 0xa8, 0x64, 0x00, 0x00, 0x00, 0x16, 0x49, 0x44, 0x41, 0x54, 0x18, +0x57, 0x63, 0x78, 0x2b, 0xa3, 0xa2, 0xb4, 0xd1, 0x87, 0xc1, 0xde, 0xe3, +0xcc, 0xff, 0xff, 0xff, 0x01, 0x24, 0xec, 0x06, 0x9d, 0x64, 0xf4, 0x18, +0xdc, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82}; + +int main() { + bx::DefaultAllocator defAlloc; + bimg::ImageContainer* imageContainer = nullptr; + imageContainer = bimg::imageParse(&defAlloc, (const void*) img, 129 * sizeof(char)); + BX_ASSERT(imageContainer->m_format == bimg::TextureFormat::RGB8, "Image incorrectly decoded.") + bimg::imageFree(imageContainer); + return 0; +} diff --git a/recipes/bimg/all/test_v1_package/CMakeLists.txt b/recipes/bimg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..667976629550a --- /dev/null +++ b/recipes/bimg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/bimg/all/test_v1_package/conanfile.py b/recipes/bimg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..056e75eddb91c --- /dev/null +++ b/recipes/bimg/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class BimgTestPackageConan(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/bimg/config.yml b/recipes/bimg/config.yml new file mode 100644 index 0000000000000..7f66042e6618c --- /dev/null +++ b/recipes/bimg/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230114": + folder: all diff --git a/recipes/binutils/all/conandata.yml b/recipes/binutils/all/conandata.yml new file mode 100644 index 0000000000000..a4c3a01e317b2 --- /dev/null +++ b/recipes/binutils/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "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" +patches: + "2.38": + - patch_file: "patches/2.38-0001-no-texinfo.patch" + patch_type: conan + patch_description: "disable texinfo" diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py new file mode 100644 index 0000000000000..142067bea696e --- /dev/null +++ b/recipes/binutils/all/conanfile.py @@ -0,0 +1,529 @@ +import os +import re +import typing +import unittest + +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, 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.54.0" + +# This recipe includes a selftest to test conversion of os/arch to triplets (and vice verse) +# Run it using `python -m unittest conanfile.py` + + +class BinutilsConan(ConanFile): + name = "binutils" + description = "The GNU Binutils are a collection of binary tools." + package_type = "application" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://www.gnu.org/software/binutils" + topics = ("gnu", "ld", "linker", "as", "assembler", "objcopy", "objdump") + settings = "os", "arch", "compiler", "build_type" + + options = { + "multilib": [True, False], + "with_libquadmath": [True, False], + "target_arch": [None, "ANY"], + "target_os": [None, "ANY"], + "target_triplet": [None, "ANY"], + "prefix": [None, "ANY"], + } + + default_options = { + "multilib": True, + "with_libquadmath": True, + "target_arch": None, # Initialized in configure, checked in validate + "target_os": None, # Initialized in configure, checked in validate + "target_triplet": None, # Initialized in configure, checked in validate + "prefix": None, # Initialized in configure (NOT config_options, because it depends on target_{arch,os}) + } + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _settings_target(self): + return getattr(self, "settings_target", None) or self.settings + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + if not self.options.target_triplet: + if not self.options.target_arch: + # If target triplet and target arch are not set, initialize it from the target settings + self.options.target_arch = str(self._settings_target.arch) + if not self.options.target_os: + # If target triplet and target os are not set, initialize it from the target settings + self.options.target_os = str(self._settings_target.os) + # Initialize the target_triplet from the target arch and target os + self.options.target_triplet = _GNUTriplet.from_archos(_ArchOs( + arch=str(self.options.target_arch), + os=str(self.options.target_os), + extra=dict(self._settings_target.values_list))).triplet + else: + gnu_triplet_obj = _GNUTriplet.from_text(str(self.options.target_triplet)) + archos = _ArchOs.from_triplet(gnu_triplet_obj) + if not self.options.target_arch: + # If target arch is not set, deduce it from the target triplet + self.options.target_arch = archos.arch + if not self.options.target_os: + # If target arch is not set, deduce it from the target triplet + self.options.target_os = archos.os + + if not self.options.prefix: + self.options.prefix = f"{self.options.target_triplet}-" + + self.output.info(f"binutils:target_arch={self.options.target_arch}") + self.output.info(f"binutils:target_os={self.options.target_os}") + self.output.info(f"binutils:target_triplet={self.options.target_triplet}") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("This recipe does not support building binutils by this compiler") + + if self.options.target_os == "Macos": + raise ConanInvalidConfiguration("cci does not support building binutils for Macos since binutils is degraded there (no as/ld + armv8 does not build)") + + # Check whether the actual target_arch and target_os option are valid (they should be in settings.yml) + # FIXME: does there exist a stable Conan API to accomplish this? + if str(self.options.target_arch) not in self.settings.arch.values_range: + raise ConanInvalidConfiguration(f"target_arch={self.options.target_arch} is invalid (possibilities={self.settings.arch.values_range})") + if str(self.options.target_os) not in self.settings.os.values_range: + raise ConanInvalidConfiguration(f"target_os={self.options.target_os} is invalid (possibilities={self.settings.os.values_range})") + + target_archos = _ArchOs(str(self.options.target_arch), str(self.options.target_os)) + target_gnu_triplet = _GNUTriplet.from_text(str(self.options.target_triplet)) + if not target_archos.is_compatible(target_gnu_triplet): + suggested_gnu_triplet = _GNUTriplet.from_archos(target_archos) + suggested_archos = _ArchOs.from_triplet(target_gnu_triplet) + raise ConanInvalidConfiguration(f"target_arch={target_archos.arch}/target_os={target_archos.os} is not compatible with {target_gnu_triplet.triplet}. Change target triplet to {suggested_gnu_triplet.triplet}, or change target_arch/target_os to {suggested_archos.arch}/{suggested_archos.os}.") + + # Check, when used as build requirement in a cross build, whether the target arch/os agree + settings_target = getattr(self, "settings_target", None) + if settings_target is not None: + if self.options.target_arch != settings_target.arch: + raise ConanInvalidConfiguration(f"binutils:target_arch={self.options.target_arch} does not match target architecture={settings_target.arch}") + if self.options.target_os != settings_target.os: + raise ConanInvalidConfiguration(f"binutils:target_os={self.options.target_os} does not match target os={settings_target.os}") + + def package_id(self): + del self.info.settings.compiler + + def _raise_unsupported_configuration(self, key, value): + raise ConanInvalidConfiguration(f"This configuration is unsupported by this conan recip. Please consider adding support. ({key}={value})") + + 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 self.version >= "2.39": + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + + def requirements(self): + self.requires("zlib/1.2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _exec_prefix(self): + return os.path.join("bin", "exec_prefix") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + def yes_no(opt): return "yes" if opt else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-nls") + tc.configure_args.append(f"--target={self.options.target_triplet}") + tc.configure_args.append(f"--enable-multilib={yes_no(self.options.multilib)}") + tc.configure_args.append(f"--with-zlib={unix_path(self, self.dependencies['zlib'].package_folder)}") + tc.configure_args.append(f"--program-prefix={self.options.prefix}") + tc.configure_args.append("--exec_prefix=/bin/exec_prefix") + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + copy( + self, + pattern="COPYING*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + keep_path=False, + ) + + def package_info(self): + target_bindir = os.path.join(self._exec_prefix, str(self.options.target_triplet), "bin") + self.cpp_info.bindirs = ["bin", target_bindir] + + absolute_target_bindir = os.path.join(self.package_folder, target_bindir) + + # v1 exports + bindir = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bindir) + self.env_info.PATH.append(absolute_target_bindir) + self.output.info(f"GNU triplet={self.options.target_triplet}") + self.user_info.gnu_triplet = self.options.target_triplet + self.user_info.prefix = self.options.prefix + self.output.info(f"executable prefix={self.options.prefix}") + + # 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. + self.user_info.recipe_path = os.path.realpath(__file__) + + +class _ArchOs: + def __init__(self, arch: str, os: str, extra: typing.Optional[typing.Dict[str, str]] = None): + self.arch = arch + self.os = os + self.extra = extra if extra is not None else {} + + def is_compatible(self, triplet: "_GNUTriplet") -> bool: + return self.arch in self.calculate_archs(triplet) and self.os == self.calculate_os(triplet) + + _MACHINE_TO_ARCH_LUT = { + "arm": "armv7", + "aarch64": ("armv8", "armv9"), + "i386": "x86", + "i486": "x86", + "i586": "x86", + "i686": "x86", + "x86_64": "x86_64", + "riscv32": "riscv32", + "riscv64": "riscv64", + } + + @classmethod + def calculate_archs(cls, triplet: "_GNUTriplet") -> typing.Tuple[str]: + if triplet.machine == "arm": + archs = "armv7" + ("hf" if "hf" in triplet.abi else "") + else: + archs = cls._MACHINE_TO_ARCH_LUT[triplet.machine] + if isinstance(archs, str): + archs = (archs, ) + return archs + + _GNU_OS_TO_OS_LUT = { + None: "baremetal", + "android": "Android", + "mingw32": "Windows", + "linux": "Linux", + "freebsd": "FreeBSD", + "darwin": "Macos", + "none": "baremetal", + "unknown": "baremetal", + } + + @classmethod + def calculate_os(cls, triplet: "_GNUTriplet") -> str: + if triplet.abi and "android" in triplet.abi: + return "Android" + return cls._GNU_OS_TO_OS_LUT[triplet.os] + + @classmethod + def from_triplet(cls, triplet: "_GNUTriplet") -> "_ArchOs": + archs = cls.calculate_archs(triplet) + _os = cls.calculate_os(triplet) + extra = {} + + if _os == "Android" and triplet.abi: + m = re.match(".*([0-9]+)", triplet.abi) + if m: + extra["os.api_level"] = m.group(1) + + # Assume first architecture + return cls(arch=archs[0], os=_os, extra=extra) + + def __eq__(self, other) -> bool: + if type(self) != type(other): + return False + if not (self.arch == other.arch and self.os == other.os): + return False + self_extra_keys = set(self.extra.keys()) + other_extra_keys = set(other.extra.keys()) + if (self_extra_keys - other_extra_keys) or (other_extra_keys - self_extra_keys): + return False + return True + + def __repr__(self) -> str: + return f"<{type(self).__name__}:arch='{self.arch}',os='{self.os}',extra={self.extra}>" + + +class _GNUTriplet: + def __init__(self, machine: str, vendor: typing.Optional[str], os: typing.Optional[str], abi: typing.Optional[str]): + self.machine = machine + self.vendor = vendor + self.os = os + self.abi = abi + + @property + def triplet(self) -> str: + return "-".join(p for p in (self.machine, self.vendor, self.os, self.abi) if p) + + @classmethod + def from_archos(cls, archos: _ArchOs) -> "_GNUTriplet": + gnu_machine = cls.calculate_gnu_machine(archos) + gnu_vendor = cls.calculate_gnu_vendor(archos) + gnu_os = cls.calculate_gnu_os(archos) + gnu_abi = cls.calculate_gnu_abi(archos) + + return cls(gnu_machine, gnu_vendor, gnu_os, gnu_abi) + + @classmethod + def from_text(cls, text: str) -> "_GNUTriplet": + gnu_machine: str + gnu_vendor: typing.Optional[str] + gnu_os: typing.Optional[str] + gnu_abi: typing.Optional[str] + + parts = text.split("-") + if not 2 <= len(parts) <= 4: + raise ValueError("Wrong number of GNU triplet components. Count must lie in range [2, 4]. format=$machine(-$vendor)?(-$os)?(-$abi)?") + + gnu_machine = parts[0] + parts = parts[1:] + if any(v in parts[-1] for v in cls.KNOWN_GNU_ABIS): + gnu_abi = parts[-1] + parts = parts[:-1] + else: + gnu_abi = None + + if len(parts) == 2: + gnu_vendor = parts[0] + gnu_os = parts[1] + elif len(parts) == 1: + if parts[0] in _GNUTriplet.UNKNOWN_OS_ALIASES: + gnu_vendor = None + gnu_os = parts[0] + elif parts[0] in cls.OS_TO_GNU_OS_LUT.values(): + gnu_vendor = None + gnu_os = parts[0] + else: + gnu_vendor = parts[0] + gnu_os = None + else: + gnu_vendor = None + gnu_os = None + + return cls(gnu_machine, gnu_vendor, gnu_os, gnu_abi) + + ARCH_TO_GNU_MACHINE_LUT = { + "x86": "i686", + "x86_64": "x86_64", + "armv7": "arm", + "armv7hf": "arm", + "armv8": "aarch64", + "riscv32": "riscv32", + "riscv64": "riscv64", + } + + @classmethod + def calculate_gnu_machine(cls, archos: _ArchOs) -> str: + return cls.ARCH_TO_GNU_MACHINE_LUT[archos.arch] + + UNKNOWN_OS_ALIASES = ( + "unknown", + "none", + ) + + OS_TO_GNU_OS_LUT = { + "baremetal": "none", + "Android": "linux", + "FreeBSD": "freebsd", + "Linux": "linux", + "Macos": "darwin", + "Windows": "mingw32", + } + + @classmethod + def calculate_gnu_os(cls, archos: _ArchOs) -> typing.Optional[str]: + if archos.os in ("baremetal", ): + if archos.arch in ("x86", "x86_64", ): + return None + elif archos.arch in ("riscv32", "riscv64"): + return "unknown" + return cls.OS_TO_GNU_OS_LUT[archos.os] + + OS_TO_GNU_VENDOR_LUT = { + "Windows": "w64", + "baremetal": None, + } + + @classmethod + def calculate_gnu_vendor(cls, archos: _ArchOs) -> typing.Optional[str]: + if archos.os in ("baremetal", "Android"): + return None + if archos.os in ("Macos", "iOS", "tvOS", "watchOS"): + return "apple" + return cls.OS_TO_GNU_VENDOR_LUT.get(archos.os, "pc") + + @classmethod + def calculate_gnu_abi(self, archos: _ArchOs) -> typing.Optional[str]: + if archos.os in ("baremetal", ): + if archos.arch in ("armv7",): + return "eabi" + else: + return "elf" + abi_start = None + if archos.os in ("Linux", ): + abi_start = "gnu" + elif archos.os in ("Android", ): + abi_start = "android" + else: + return None + if archos.arch in ("armv7",): + abi_suffix = "eabi" + elif archos.arch in ("armv7hf",): + abi_suffix = "eabihf" + else: + abi_suffix = "" + if archos.os in ("Android", ): + abi_suffix += str(archos.extra.get("os.api_level", "")) + + return abi_start + abi_suffix + + KNOWN_GNU_ABIS = ( + "android", + "gnu", + "eabi", + "elf", + ) + + def __eq__(self, other: object) -> bool: + if type(self) != type(other): + return False + other: "_GNUTriplet" + return self.machine == other.machine and self.vendor == other.vendor and self.os == other.os and self.abi == other.abi + + def __repr__(self) -> str: + def x(v): + if v is None: + return None + return f"'{v}'" + return f"<{type(self).__name__}:machine={x(self.machine)},vendor={x(self.vendor)},os={x(self.os)},abi={x(self.abi)}>" + + +class _TestOsArch2GNUTriplet(unittest.TestCase): + def test_linux_x86(self): + archos = _ArchOs(arch="x86", os="Linux") + self._test_osarch_to_gnutriplet(archos, _GNUTriplet(machine="i686", vendor="pc", os="linux", abi="gnu"), "i686-pc-linux-gnu") + self.assertEqual(_ArchOs("x86", "Linux"), _ArchOs.from_triplet(_GNUTriplet.from_text("i386-linux"))) + self.assertEqual(_ArchOs("x86", "Linux"), _ArchOs.from_triplet(_GNUTriplet.from_text("i686-linux"))) + self.assertEqual(_GNUTriplet("i486", None, "linux", None), _GNUTriplet.from_text("i486-linux")) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("i486-linux"))) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("i486-linux-gnu"))) + + def test_linux_x86_64(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86_64", os="Linux"), _GNUTriplet(machine="x86_64", vendor="pc", os="linux", abi="gnu"), "x86_64-pc-linux-gnu") + + def test_linux_armv7(self): + archos = _ArchOs(arch="armv7", os="Linux") + self._test_osarch_to_gnutriplet(archos, _GNUTriplet(machine="arm", vendor="pc", os="linux", abi="gnueabi"), "arm-pc-linux-gnueabi") + self.assertEqual(_GNUTriplet("arm", "pc", None, "gnueabi"), _GNUTriplet.from_text("arm-pc-gnueabi")) + self.assertEqual(_GNUTriplet("arm", "pc", None, "eabi"), _GNUTriplet.from_text("arm-pc-eabi")) + self.assertEqual(_ArchOs("armv7hf", "baremetal"), _ArchOs.from_triplet(_GNUTriplet.from_text("arm-pc-gnueabihf"))) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("arm-linux-gnueabi"))) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("arm-linux-eabi"))) + self.assertFalse(archos.is_compatible(_GNUTriplet.from_text("arm-pc-linux-gnueabihf"))) + self.assertFalse(archos.is_compatible(_GNUTriplet.from_text("arm-pc-gnueabihf"))) + + def test_linux_armv7hf(self): + archos = _ArchOs(arch="armv7hf", os="Linux") + self._test_osarch_to_gnutriplet(archos, _GNUTriplet(machine="arm", vendor="pc", os="linux", abi="gnueabihf"), "arm-pc-linux-gnueabihf") + self.assertEqual(_GNUTriplet("arm", "pc", None, "gnueabihf"), _GNUTriplet.from_text("arm-pc-gnueabihf")) + self.assertEqual(_ArchOs("armv7", "baremetal"), _ArchOs.from_triplet(_GNUTriplet.from_text("arm-pc-gnueabi"))) + self.assertFalse(archos.is_compatible(_GNUTriplet.from_text("arm-linux-gnueabi"))) + self.assertFalse(archos.is_compatible(_GNUTriplet.from_text("arm-linux-eabi"))) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("arm-pc-linux-gnueabihf"))) + self.assertFalse(archos.is_compatible(_GNUTriplet.from_text("arm-pc-gnueabihf"))) + + def test_windows_x86(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86", os="Windows"), _GNUTriplet(machine="i686", vendor="w64", os="mingw32", abi=None), "i686-w64-mingw32") + + def test_windows_x86_64(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86_64", os="Windows"), _GNUTriplet(machine="x86_64", vendor="w64", os="mingw32", abi=None), "x86_64-w64-mingw32") + + def test_macos_x86_64(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86_64", os="Macos"), _GNUTriplet(machine="x86_64", vendor="apple", os="darwin", abi=None), "x86_64-apple-darwin") + + def test_freebsd_x86_64(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86_64", os="FreeBSD"), _GNUTriplet(machine="x86_64", vendor="pc", os="freebsd", abi=None), "x86_64-pc-freebsd") + + def test_baremetal_x86(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86", os="baremetal"), _GNUTriplet(machine="i686", vendor=None, os=None, abi="elf"), "i686-elf") + + def test_baremetal_x86_64(self): + archos = _ArchOs(arch="x86_64", os="baremetal") + self._test_osarch_to_gnutriplet(archos, _GNUTriplet(machine="x86_64", vendor=None, os=None, abi="elf"), "x86_64-elf") + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("x86_64-elf"))) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("x86_64-none-elf"))) + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("x86_64-unknown-elf"))) + + def test_baremetal_armv7(self): + archos = _ArchOs(arch="armv7", os="baremetal") + self._test_osarch_to_gnutriplet(archos, _GNUTriplet(machine="arm", vendor=None, os="none", abi="eabi"), "arm-none-eabi") + self.assertTrue(archos.is_compatible(_GNUTriplet.from_text("arm-none-eabi"))) + + def test_baremetal_armv8(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="armv8", os="baremetal"), _GNUTriplet(machine="aarch64", vendor=None, os="none", abi="elf"), "aarch64-none-elf") + + def test_baremetal_riscv32(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="riscv32", os="baremetal"), _GNUTriplet(machine="riscv32", vendor=None, os="unknown", abi="elf"), "riscv32-unknown-elf") + + def test_baremetal_riscv64(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="riscv64", os="baremetal"), _GNUTriplet(machine="riscv64", vendor=None, os="unknown", abi="elf"), "riscv64-unknown-elf") + + def test_android_armv7(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="armv7", os="Android", extra={"os.api_level": "31"}), _GNUTriplet(machine="arm", vendor=None, os="linux", abi="androideabi31"), "arm-linux-androideabi31") + + def test_android_armv8(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="armv8", os="Android", extra={"os.api_level": "24"}), _GNUTriplet(machine="aarch64", vendor=None, os="linux", abi="android24"), "aarch64-linux-android24") + + def test_android_x86(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86", os="Android", extra={"os.api_level": "16"}), _GNUTriplet(machine="i686", vendor=None, os="linux", abi="android16"), "i686-linux-android16") + + def test_android_x86_64(self): + self._test_osarch_to_gnutriplet(_ArchOs(arch="x86_64", os="Android", extra={"os.api_level": "29"}), _GNUTriplet(machine="x86_64", vendor=None, os="linux", abi="android29"), "x86_64-linux-android29") + self.assertEqual(_ArchOs(arch="x86_64", os="Android", extra={"os.api_level": "25"}), _ArchOs.from_triplet(_GNUTriplet.from_text("x86_64-linux-android29"))) + + def _test_osarch_to_gnutriplet(self, archos: _ArchOs, gnuobj_ref: _GNUTriplet, triplet_ref: str): + gnuobj = _GNUTriplet.from_archos(archos) + self.assertEqual(gnuobj_ref, gnuobj) + self.assertEqual(triplet_ref, gnuobj.triplet) + self.assertEqual(gnuobj_ref, _GNUTriplet.from_text(triplet_ref)) + # self.assertEqual(triplet_ref, tools.get_gnu_triplet(archos.os, archos.arch, compiler="gcc")) diff --git a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch new file mode 100644 index 0000000000000..1e0698965c0de --- /dev/null +++ b/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch @@ -0,0 +1,20 @@ +--- 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/test_package/conanfile.py b/recipes/binutils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f4ceaa413255 --- /dev/null +++ b/recipes/binutils/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _has_as(self): + return self._settings_build.os not in ("Macos",) + + @property + def _has_ld(self): + return self._settings_build.os not in ("Macos",) + + def test(self): + binaries = ["ar", "nm", "objcopy", "objdump", "ranlib", "readelf", "strip"] + if self._has_as: + binaries.append("as") + if self._has_ld: + binaries.append("ld") + + for binary in binaries: + self.run(f"{binary} --version", env="conanbuild") diff --git a/recipes/binutils/all/test_v1_package/Linux-armv7.s b/recipes/binutils/all/test_v1_package/Linux-armv7.s new file mode 100644 index 0000000000000..88c05d0d0aac9 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Linux-armv7.s @@ -0,0 +1,23 @@ + .arm + .arch armv7-a + + .global _start + + .text +_start: + # write(1, message, 14) + mov r7, #4 // system call 4 is write + mov r0, #1 // file handle 1 is stdout + adr r1, message // address of string to output + mov r2, #14 // number of bytes + swi #0 // do syscall into os (supervisor call) + + # exit(0) + mov r7, #1 // system call 1 is exit + mov r0, #0 // we want return code 0 + swi #0 // do syscall into os (supervisor call) + + .align 2 + +message: + .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-armv8.s b/recipes/binutils/all/test_v1_package/Linux-armv8.s new file mode 100644 index 0000000000000..c744b1ba7ea47 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Linux-armv8.s @@ -0,0 +1,19 @@ + .global _start + + .text +_start: + # write(1, message, 14) + mov x8, 64 // system call 64 is write + mov x0, 1 // file handle 1 is stdout + mov x1, message // address of string to output + mov x2, 14 // number of bytes + svc 0 // do syscall into os (supervisor call) + + # exit(0) + mov x8, 93 // system call 93 is exit + mov x0, 0 // we want return code 0 + svc 0 // do syscall into os (supervisor call) + + .section .rodata +message: + .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-riscv.s b/recipes/binutils/all/test_v1_package/Linux-riscv.s new file mode 100644 index 0000000000000..21d80984c1b16 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Linux-riscv.s @@ -0,0 +1,19 @@ + .global _start + + .text +_start: + # write(1, message, 14) + addi a7, x0, 64 # system call 64 is write + addi a0, x0, 1 # file handle 1 is stdout + la a1, message # address of string to output + addi a2, x0, 14 # number of bytes + ecall # do syscall into os (environment call) + + # exit(0) + addi a7, x0, 93 # system call 93 is exit + addi a0, x0, 0 # we want return code 0 + ecall # do syscall into os (environment call) + + .data +message: + .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-x86.s b/recipes/binutils/all/test_v1_package/Linux-x86.s new file mode 100644 index 0000000000000..b932e52148e99 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Linux-x86.s @@ -0,0 +1,20 @@ + .global _start + + .text +_start: + # write(1, message, 14) + mov $4, %eax # system call 4 is write + mov $1, %ebx # file handle 1 is stdout + mov $message, %ecx # address of string to output + mov $14, %edx # number of bytes + int $0x80 # do syscall into os + + # exit(0) + mov $1, %eax # system call 1 is exit + xor %ebx, %ebx # we want return code 0 + int $0x80 # do syscall into os + + .data + +message: + .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-x86_64.s b/recipes/binutils/all/test_v1_package/Linux-x86_64.s new file mode 100644 index 0000000000000..b2bcbb46dbc56 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Linux-x86_64.s @@ -0,0 +1,20 @@ + .global _start + + .text +_start: + # write(1, message, 14) + mov $1, %rax # system call 1 is write + mov $1, %rdi # file handle 1 is stdout + mov $message, %rsi # address of string to output + mov $14, %rdx # number of bytes + syscall # do syscall into os + + # exit(0) + mov $60, %eax # system call 60 is exit + xor %rdi, %rdi # we want return code 0 + syscall # do syscall into os + + .section .data + +message: + .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Windows-kernel32.def b/recipes/binutils/all/test_v1_package/Windows-kernel32.def new file mode 100644 index 0000000000000..88e93c499b32b --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Windows-kernel32.def @@ -0,0 +1,7 @@ +; The Windows test_package needs the following symbols from kernel32.dll + +LIBRARY kernel32 +EXPORTS + GetStdHandle + WriteConsoleA + ExitProcess diff --git a/recipes/binutils/all/test_v1_package/Windows-x86.s b/recipes/binutils/all/test_v1_package/Windows-x86.s new file mode 100644 index 0000000000000..8b6b27e91288f --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Windows-x86.s @@ -0,0 +1,23 @@ + .section .rdata,"dr" + +output: .ascii "Hello, world!\n" + + .text + .globl _start + +_start: + # GetStdHandle(STD_OUTPUT_HANDLE) + pushl $-11 # STD_OUTPUT_HANDLE (=COUNOUT$) + call _GetStdHandle # Retrieve console handle + + # WriteConsoleA($handle, output, 14, NULL, 0) + pushl $0 # lpReserved + pushl $0 # lpNumberOfCharsWritten (optional) + pushl $14 # nNumberOfCharsToWrite + pushl $output # lpBuffer + pushl %eax # hConsoleOutput + call _WriteConsoleA # Write to console + + # ExitProcess(0) + pushl $0 # Return 0 errorcode + call _ExitProcess # Exit process diff --git a/recipes/binutils/all/test_v1_package/Windows-x86_64.s b/recipes/binutils/all/test_v1_package/Windows-x86_64.s new file mode 100644 index 0000000000000..9d17a6a37a336 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/Windows-x86_64.s @@ -0,0 +1,26 @@ + .section .rdata,"dr" + +output: .ascii "Hello, world!\n" + + .text + .globl _start + +_start: + # GetStdHandle(STD_OUTPUT_HANDLE) + mov $-11, %rcx # STD_OUTPUT_HANDLE (=COUNOUT$) + movq __imp_GetStdHandle(%rip), %rax # Get relocatable address of __imp_GetStdHandle + call *%rax # Retrieve console handle + + # WriteConsoleA($handle, "Hello world!\n", 14, NULL, 0) + pushq $0 # lpReserved + movq $0, %r9 # lpNumberOfCharsWritten (optional) + movq $14, %r8 # nNumberOfCharsToWrite + leaq output(%rip), %rdx # lpBuffer + movq %rax, %rcx # hConsoleOutput + movq __imp_WriteConsoleA(%rip), %rax # Get relocatable address of __imp_WriteConsoleA + call *%rax # Write to console + + # ExitProcess(0) + xorq %rcx, %rcx # Return 0 errorcode + movq __imp_ExitProcess(%rip), %rax # Get relocatable address of __imp__ExitProcess + call *%rax # Exit process diff --git a/recipes/binutils/all/test_v1_package/conanfile.py b/recipes/binutils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6b7ddeed01c09 --- /dev/null +++ b/recipes/binutils/all/test_v1_package/conanfile.py @@ -0,0 +1,113 @@ +from conans import ConanFile, tools +from io import StringIO +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _target_arch(self): + return str(self.options["binutils"].target_arch) + + @property + def _target_os(self): + return str(self.options["binutils"].target_os) + + @property + def _test_linker_args(self): + args = [] + if self._target_os == "Windows": + args.extend(["--subsystem", "console", f"{self.build_folder}/lib/libkernel32.a"]) + return args + + @property + def _test_package_assembly_source(self): + part_arch = self._target_arch + if "armv7" in part_arch: + part_arch = "armv7" + elif part_arch in ("riscv32", "riscv64"): + part_arch = "riscv" + return os.path.join(self.source_folder, f"{self._target_os}-{part_arch}.s") + + def _append_gnu_triplet(self, exe): + return f"{self.deps_user_info['binutils'].prefix}{exe}" + + def build(self): + if not tools.cross_building(self): + + if not os.path.isfile(self._test_package_assembly_source): + self.output.warn(f"Missing {self._test_package_assembly_source}.\ntest_package does not support this target os/arch. Please consider adding it. (It's a great learning experience)") + else: + tools.mkdir(os.path.join(self.build_folder, "bin")) + tools.mkdir(os.path.join(self.build_folder, "lib")) + + gas = self._append_gnu_triplet("as") + ld = self._append_gnu_triplet("ld") + extension = "" + if self._target_os == "Windows": + extension = ".exe" + + # Create minimum import library for kernel32.dll + dlltool = f"{self.deps_user_info['binutils'].gnu_triplet}-dlltool" + + dlltool_args = [dlltool, "--input-def", f"{self.source_folder}/Windows-kernel32.def", "--output-lib", f"{self.build_folder}/lib/libkernel32.a"] + self.run(" ".join(dlltool_args)) + + + assembler_args = [gas, self._test_package_assembly_source, "-o", f"{self.build_folder}/object.o"] + linker_args = [ld, f"{self.build_folder}/object.o", "-o", f"{self.build_folder}/bin/test_package{extension}"] + self._test_linker_args + + self.run(" ".join(assembler_args)) + self.run(" ".join(linker_args)) + + def _can_run_target(self): + if self._settings_build.os != self._target_os: + return False + if self._settings_build.arch == "x86_64": + return self._target_arch in ("x86", "x86_64") + return self._settings_build.arch == self._target_arch + + def _has_as(self): + if self._target_os in ("Macos"): + return False + return True + + def _has_ld(self): + if self._target_os in ("Macos"): + return False + return True + + def test(self): + # Run selftest (conversion between conan os/arch <=> gnu triplet) + with tools.chdir(os.path.dirname(self.deps_user_info["binutils"].recipe_path)): + self.run(f"python -m unittest {os.path.basename(self.deps_user_info['binutils'].recipe_path)} --verbose") + + if not tools.cross_building(self): + if self._can_run_target() and os.path.isfile(self._test_package_assembly_source): + output = StringIO() + self.run(os.path.join("bin", "test_package"), output=output) + text = output.getvalue() + print(text) + assert "Hello, world!" in text + + bins = ["ar", "nm", "objcopy", "objdump", "ranlib", "readelf", "strip"] + if self._has_as(): + bins.append("as") + if self._has_ld(): + bins.append("ld") + + for bin in bins: + bin_path = os.path.realpath(tools.which(bin)) + self.output.info(f"Found {bin} at {bin_path}") + assert bin_path.startswith(self.deps_cpp_info["binutils"].rootpath) + + output = StringIO() + self.run("{} --version".format(bin_path), run_environment=True, output=output) + text = output.getvalue() + print(text) + assert str(self.requires["binutils"].ref.version) in text diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml new file mode 100644 index 0000000000000..f7cce7c207880 --- /dev/null +++ b/recipes/binutils/config.yml @@ -0,0 +1,5 @@ +versions: + "2.38": + folder: all + "2.37": + folder: all diff --git a/recipes/bison/all/conandata.yml b/recipes/bison/all/conandata.yml new file mode 100644 index 0000000000000..5b0419bb8cd0b --- /dev/null +++ b/recipes/bison/all/conandata.yml @@ -0,0 +1,63 @@ +sources: + "3.8.2": + url: "https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.gz" + sha256: "06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb" + "3.7.6": + url: "https://ftp.gnu.org/gnu/bison/bison-3.7.6.tar.gz" + sha256: "69dc0bb46ea8fc307d4ca1e0b61c8c355eb207d0b0c69f4f8462328e74d7b9ea" + "3.7.1": + url: "https://ftp.gnu.org/gnu/bison/bison-3.7.1.tar.gz" + sha256: "1dd952839cf0d5a8178c691eeae40dc48fa50d18dcce648b1ad9ae0195367d13" + "3.5.3": + url: "https://ftp.gnu.org/gnu/bison/bison-3.5.3.tar.gz" + sha256: "34e201d963156618a0ea5bc87220f660a1e08403dd3c7c7903d4f38db3f40039" +patches: + "3.8.2": + - patch_file: "patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + "3.7.6": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + "3.7.1": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + - patch_file: "patches/0006-dont-link-bison-against-libreadline.patch" + patch_description: "Don't link bison against libreadline" + patch_type: "portability" + "3.5.3": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0003-3.5.3-msvc-changes.patch" + patch_description: "windows: fix build" + patch_type: "portability" + - patch_file: "patches/0004-3.5.3-relocatable.patch" + patch_description: "Relocatable" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" diff --git a/recipes/bison/all/conanfile.py b/recipes/bison/all/conanfile.py new file mode 100644 index 0000000000000..9a5645894b97c --- /dev/null +++ b/recipes/bison/all/conanfile.py @@ -0,0 +1,171 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class BisonConan(ConanFile): + name = "bison" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/bison/" + description = "Bison is a general-purpose parser generator" + topics = ("bison", "parser") + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("m4/1.4.19") + + def validate(self): + if is_msvc(self) and self.version == "3.8.2": + raise ConanInvalidConfiguration( + f"{self.ref} is not yet ready for Visual Studio, use previous version " + "or open a pull request on https://github.com/conan-io/conan-center-index/pulls" + ) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + if self.settings.os != "Windows": + self.tool_requires("flex/2.6.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--enable-relocatable", + "--disable-nls", + "--datarootdir=${prefix}/res", + ]) + if self.settings.compiler == "apple-clang": + tc.configure_args.append("gl_cv_compiler_check_decl_option=") + if is_msvc(self): + # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug + # Visual Studio does not support the %n format flag: + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions + # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, + # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self._user_info_build["automake"].compile) + ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + + makefile = os.path.join(self.source_folder, "Makefile.in") + yacc = os.path.join(self.source_folder, "src", "yacc.in") + + if self.settings.os == "Windows": + # replace embedded unix paths by windows paths + replace_in_file(self, makefile, + "echo '#define BINDIR \"$(bindir)\"';", + "echo '#define BINDIR \"$(shell cygpath -m \"$(bindir)\")\"';") + replace_in_file(self, makefile, + "echo '#define PKGDATADIR \"$(pkgdatadir)\"';", + "echo '#define PKGDATADIR \"$(shell cygpath -m \"$(pkgdatadir)\")\"';") + replace_in_file(self, makefile, + "echo '#define DATADIR \"$(datadir)\"';", + "echo '#define DATADIR \"$(shell cygpath -m \"$(datadir)\")\"';") + replace_in_file(self, makefile, + "echo '#define DATAROOTDIR \"$(datarootdir)\"';", + "echo '#define DATAROOTDIR \"$(shell cygpath -m \"$(datarootdir)\")\"';") + + replace_in_file(self, makefile, + "dist_man_MANS = $(top_srcdir)/doc/bison.1", + "dist_man_MANS =") + replace_in_file(self, yacc, "@prefix@", "$CONAN_BISON_ROOT") + replace_in_file(self, yacc, "@bindir@", "$CONAN_BISON_ROOT/bin") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.install() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + if is_msvc(self): + rename(self, os.path.join(self.package_folder, "lib", "liby.a"), + os.path.join(self.package_folder, "lib", "y.lib")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libs = ["y"] + self.cpp_info.resdirs = ["res"] + + bison_root = self.package_folder.replace("\\", "/") + self.buildenv_info.define_path("CONAN_BISON_ROOT", bison_root) + + pkgdir = os.path.join(self.package_folder, "res", "bison") + self.buildenv_info.define_path("BISON_PKGDATADIR", pkgdir) + + # yacc is a shell script, so requires a shell (such as bash) + yacc = os.path.join(self.package_folder, "bin", "yacc").replace("\\", "/") + self.conf_info.define("user.bison:yacc", yacc) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.CONAN_BISON_ROOT = self.package_folder.replace("\\", "/") + self.env_info.BISON_PKGDATADIR = pkgdir + self.user_info.YACC = yacc diff --git a/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000000000..b40517e5083c9 --- /dev/null +++ b/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -213,10 +213,10 @@ create_pipe (const char *progname, + xalloc_die (); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000000000..9f229b7ee3cbb --- /dev/null +++ b/recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -137,10 +137,10 @@ create_pipe (const char *progname, + prog_argv = prepare_spawn (prog_argv); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000000000..faa2c494ab322 --- /dev/null +++ b/recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -268,6 +268,14 @@ caret_free (void) + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -278,7 +278,7 @@ caret_set_file (const char *file) + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000000000..9737127831982 --- /dev/null +++ b/recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -256,6 +256,14 @@ caret_free (void) + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -266,7 +266,7 @@ caret_set_file (const char *file) + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000000000..2310d29a3ca9e --- /dev/null +++ b/recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -258,6 +258,14 @@ + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -268,7 +268,7 @@ + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch b/recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch new file mode 100644 index 0000000000000..56aeeebbeb7df --- /dev/null +++ b/recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch @@ -0,0 +1,261 @@ +src/parse-gram.y and src/scan-gram.l should be modified as well, +but aren't to avoid a dependency on a already-built flex and bison. + +--- src/location.c ++++ src/location.c +@@ -25,9 +25,13 @@ + #include + #include + #include /* fileno */ ++#ifndef _WIN32 + #include ++#endif + #include /* fstat */ ++#ifndef _WIN32 + #include ++#endif + + #ifdef WINSIZE_IN_PTEM + # include +--- src/parse-gram.c ++++ src/parse-gram.c +@@ -991,7 +991,7 @@ tron (yyo); + + case 43: /* "character literal" */ + #line 217 "src/parse-gram.y" +- { fputs (char_name (((*yyvaluep).CHAR)), yyo); } ++ { fputs (char_name (((*yyvaluep).CHAR_LITERAL)), yyo); } + #line 996 "src/parse-gram.c" + break; + +@@ -1027,7 +1027,7 @@ tron (yyo); + + case 56: /* "integer" */ + #line 234 "src/parse-gram.y" +- { fprintf (yyo, "%d", ((*yyvaluep).INT)); } ++ { fprintf (yyo, "%d", ((*yyvaluep).INTEGER)); } + #line 1032 "src/parse-gram.c" + break; + +@@ -2216,13 +2216,13 @@ yyreduce: + + case 12: + #line 330 "src/parse-gram.y" +- { expected_sr_conflicts = (yyvsp[0].INT); } ++ { expected_sr_conflicts = (yyvsp[0].INTEGER); } + #line 2221 "src/parse-gram.c" + break; + + case 13: + #line 331 "src/parse-gram.y" +- { expected_rr_conflicts = (yyvsp[0].INT); } ++ { expected_rr_conflicts = (yyvsp[0].INTEGER); } + #line 2227 "src/parse-gram.c" + break; + +@@ -2775,7 +2775,7 @@ yyreduce: + + case 102: + #line 679 "src/parse-gram.y" +- { grammar_current_rule_dprec_set ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_dprec_set ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2780 "src/parse-gram.c" + break; + +@@ -2787,13 +2787,13 @@ yyreduce: + + case 104: + #line 683 "src/parse-gram.y" +- { grammar_current_rule_expect_sr ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_expect_sr ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2792 "src/parse-gram.c" + break; + + case 105: + #line 685 "src/parse-gram.y" +- { grammar_current_rule_expect_rr ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_expect_rr ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2798 "src/parse-gram.c" + break; + +@@ -2860,9 +2860,9 @@ yyreduce: + complain_indent (&loc, complaint, &indent, + _("definition of %s"), var); + } +- (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR)), (yylsp[0])); ++ (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR_LITERAL)), (yylsp[0])); + symbol_class_set ((yyval.id), token_sym, (yylsp[0]), false); +- symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR), (yylsp[0])); ++ symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR_LITERAL), (yylsp[0])); + } + #line 2868 "src/parse-gram.c" + break; +--- src/parse-gram.h ++++ src/parse-gram.h +@@ -122,7 +122,7 @@ extern int gram_debug; + BRACED_CODE = 40, + BRACED_PREDICATE = 41, + BRACKETED_ID = 42, +- CHAR = 43, ++ CHAR_LITERAL = 43, + COLON = 44, + EPILOGUE = 45, + EQUAL = 46, +@@ -135,7 +135,7 @@ extern int gram_debug; + TAG = 53, + TAG_ANY = 54, + TAG_NONE = 55, +- INT = 56, ++ INTEGER = 56, + PERCENT_PARAM = 57, + PERCENT_UNION = 58, + PERCENT_EMPTY = 59 +@@ -162,7 +162,7 @@ union GRAM_STYPE + /* code_props_type */ + code_props_type code_props_type; + /* "integer" */ +- int INT; ++ int INTEGER; + /* int.opt */ + int yytype_81; + /* named_ref.opt */ +@@ -226,7 +226,7 @@ union GRAM_STYPE + /* variable */ + uniqstr variable; + /* "character literal" */ +- unsigned char CHAR; ++ unsigned char CHAR_LITERAL; + /* value */ + value_type value; + #line 233 "src/parse-gram.h" +--- src/reader.c ++++ src/reader.c +@@ -803,7 +803,7 @@ check_and_convert_grammar (void) + + $accept: %start $end. */ + { +- symbol_list *p = symbol_list_sym_new (accept, empty_loc); ++ symbol_list *p = symbol_list_sym_new (bison_accept, empty_loc); + p->rhs_loc = grammar->rhs_loc; + p->next = symbol_list_sym_new (startsymbol, empty_loc); + p->next->next = symbol_list_sym_new (endtoken, empty_loc); +--- src/reduce.c ++++ src/reduce.c +@@ -160,9 +160,9 @@ inaccessable_symbols (void) + bitset Pp = bitset_create (nrules, BITSET_FIXED); + + /* If the start symbol isn't useful, then nothing will be useful. */ +- if (bitset_test (N, accept->content->number - ntokens)) ++ if (bitset_test (N, bison_accept->content->number - ntokens)) + { +- bitset_set (V, accept->content->number); ++ bitset_set (V, bison_accept->content->number); + + while (1) + { +@@ -301,7 +301,7 @@ nonterminals_reduce (void) + for (item_number *rhsp = rules[r].rhs; 0 <= *rhsp; ++rhsp) + if (ISVAR (*rhsp)) + *rhsp = symbol_number_as_item_number (nterm_map[*rhsp - ntokens]); +- accept->content->number = nterm_map[accept->content->number - ntokens]; ++ bison_accept->content->number = nterm_map[bison_accept->content->number - ntokens]; + } + + nsyms -= nuseless_nonterminals; +@@ -381,7 +381,7 @@ reduce_grammar (void) + { + reduce_print (); + +- if (!bitset_test (N, accept->content->number - ntokens)) ++ if (!bitset_test (N, bison_accept->content->number - ntokens)) + complain (&startsymbol_loc, fatal, + _("start symbol %s does not derive any sentence"), + startsymbol->tag); +--- src/scan-gram.c ++++ src/scan-gram.c +@@ -2223,12 +2223,12 @@ YY_RULE_SETUP + case 65: + YY_RULE_SETUP + #line 308 "/Users/akim/src/gnu/bison/src/scan-gram.l" +-RETURN_VALUE (INT, scan_integer (yytext, 10, *loc)); ++RETURN_VALUE (INTEGER, scan_integer (yytext, 10, *loc)); + YY_BREAK + case 66: + YY_RULE_SETUP + #line 309 "/Users/akim/src/gnu/bison/src/scan-gram.l" +-RETURN_VALUE (INT, scan_integer (yytext, 16, *loc)); ++RETURN_VALUE (INTEGER, scan_integer (yytext, 16, *loc)); + YY_BREAK + /* Identifiers may not start with a digit. Yet, don't silently + accept "1FOO" as "1 FOO". */ +@@ -2575,21 +2575,21 @@ YY_RULE_SETUP + { + STRING_FINISH; + loc->start = token_start; +- val->CHAR = last_string[0]; ++ val->CHAR_LITERAL = last_string[0]; + + /* FIXME: Eventually, make these errors. */ + if (last_string[0] == '\0') + { + complain (loc, Wother, _("empty character literal")); + /* '\0' seems dangerous even if we are about to complain. */ +- val->CHAR = '\''; ++ val->CHAR_LITERAL = '\''; + } + else if (last_string[1] != '\0') + complain (loc, Wother, + _("extra characters in character literal")); + STRING_FREE; + BEGIN INITIAL; +- return CHAR; ++ return CHAR_LITERAL; + } + YY_BREAK + case 95: +--- src/symtab.c ++++ src/symtab.c +@@ -52,7 +52,7 @@ static semantic_type **semantic_types_sorted = NULL; + symbol *errtoken = NULL; + symbol *undeftoken = NULL; + symbol *endtoken = NULL; +-symbol *accept = NULL; ++symbol *bison_accept = NULL; + symbol *startsymbol = NULL; + location startsymbol_loc; + +@@ -843,9 +843,9 @@ symbols_new (void) + symbol_free); + + /* Construct the accept symbol. */ +- accept = symbol_get ("$accept", empty_loc); +- accept->content->class = nterm_sym; +- accept->content->number = nvars++; ++ bison_accept = symbol_get ("$accept", empty_loc); ++ bison_accept->content->class = nterm_sym; ++ bison_accept->content->number = nvars++; + + /* Construct the error token */ + errtoken = symbol_get ("error", empty_loc); +--- src/symtab.h ++++ src/symtab.h +@@ -248,7 +248,7 @@ extern symbol *endtoken; + /** The genuine start symbol. + + $accept: start-symbol $end */ +-extern symbol *accept; ++extern symbol *bison_accept; + + /** The user start symbol. */ + extern symbol *startsymbol; +--- src/ielr.c ++++ src/ielr.c +@@ -429,7 +429,7 @@ + check all predecessors' goto follows for the LHS. */ + if (item_number_is_rule_number (ritem[s->items[item] - 2])) + { +- aver (lhs != accept->content->number); ++ aver (lhs != bison_accept->content->number); + for (state **predecessor = predecessors[s->number]; + *predecessor; + ++predecessor) diff --git a/recipes/bison/all/patches/0004-3.5.3-relocatable.patch b/recipes/bison/all/patches/0004-3.5.3-relocatable.patch new file mode 100644 index 0000000000000..991f41c92b3d6 --- /dev/null +++ b/recipes/bison/all/patches/0004-3.5.3-relocatable.patch @@ -0,0 +1,753 @@ +--- Makefile.in ++++ Makefile.in +@@ -637,10 +637,10 @@ am_src_bison_OBJECTS = src/bison-AnnotationList.$(OBJEXT) \ + src/bison-main.$(OBJEXT) src/bison-muscle-tab.$(OBJEXT) \ + src/bison-named-ref.$(OBJEXT) src/bison-nullable.$(OBJEXT) \ + src/bison-output.$(OBJEXT) src/bison-parse-gram.$(OBJEXT) \ +- src/bison-print-graph.$(OBJEXT) src/bison-print-xml.$(OBJEXT) \ +- src/bison-print.$(OBJEXT) src/bison-reader.$(OBJEXT) \ +- src/bison-reduce.$(OBJEXT) src/bison-relation.$(OBJEXT) \ +- src/bison-scan-code-c.$(OBJEXT) \ ++ src/bison-pathtools.$(OBJEXT) src/bison-print-graph.$(OBJEXT) \ ++ src/bison-print-xml.$(OBJEXT) src/bison-print.$(OBJEXT) \ ++ src/bison-reader.$(OBJEXT) src/bison-reduce.$(OBJEXT) \ ++ src/bison-relation.$(OBJEXT) src/bison-scan-code-c.$(OBJEXT) \ + src/bison-scan-gram-c.$(OBJEXT) \ + src/bison-scan-skel-c.$(OBJEXT) src/bison-state.$(OBJEXT) \ + src/bison-symlist.$(OBJEXT) src/bison-symtab.$(OBJEXT) \ +@@ -878,6 +878,7 @@ am__depfiles_remade = examples/c++/$(DEPDIR)/simple-simple.Po \ + src/$(DEPDIR)/bison-named-ref.Po \ + src/$(DEPDIR)/bison-nullable.Po src/$(DEPDIR)/bison-output.Po \ + src/$(DEPDIR)/bison-parse-gram.Po \ ++ src/$(DEPDIR)/bison-pathtools.Po \ + src/$(DEPDIR)/bison-print-graph.Po \ + src/$(DEPDIR)/bison-print-xml.Po src/$(DEPDIR)/bison-print.Po \ + src/$(DEPDIR)/bison-reader.Po src/$(DEPDIR)/bison-reduce.Po \ +@@ -3169,6 +3170,8 @@ src_bison_SOURCES = \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ ++ src/pathtools.c \ ++ src/pathtools.h \ + src/print-graph.c \ + src/print-graph.h \ + src/print-xml.c \ +@@ -3992,6 +3995,8 @@ src/bison-output.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + src/bison-parse-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) ++src/bison-pathtools.$(OBJEXT): src/$(am__dirstamp) \ ++ src/$(DEPDIR)/$(am__dirstamp) + src/bison-print-graph.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + src/bison-print-xml.$(OBJEXT): src/$(am__dirstamp) \ +@@ -4317,6 +4322,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-nullable.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-output.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-parse-gram.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-pathtools.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-graph.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-xml.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print.Po@am__quote@ # am--include-marker +@@ -7283,6 +7289,20 @@ src/bison-parse-gram.obj: src/parse-gram.c + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` + ++src/bison-pathtools.o: src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-pathtools.o -MD -MP -MF src/$(DEPDIR)/bison-pathtools.Tpo -c -o src/bison-pathtools.o `test -f 'src/pathtools.c' || echo '$(srcdir)/'`src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-pathtools.Tpo src/$(DEPDIR)/bison-pathtools.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pathtools.c' object='src/bison-pathtools.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-pathtools.o `test -f 'src/pathtools.c' || echo '$(srcdir)/'`src/pathtools.c ++ ++src/bison-pathtools.obj: src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-pathtools.obj -MD -MP -MF src/$(DEPDIR)/bison-pathtools.Tpo -c -o src/bison-pathtools.obj `if test -f 'src/pathtools.c'; then $(CYGPATH_W) 'src/pathtools.c'; else $(CYGPATH_W) '$(srcdir)/src/pathtools.c'; fi` ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-pathtools.Tpo src/$(DEPDIR)/bison-pathtools.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pathtools.c' object='src/bison-pathtools.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-pathtools.obj `if test -f 'src/pathtools.c'; then $(CYGPATH_W) 'src/pathtools.c'; else $(CYGPATH_W) '$(srcdir)/src/pathtools.c'; fi` ++ + src/bison-print-graph.o: src/print-graph.c + @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-graph.o -MD -MP -MF src/$(DEPDIR)/bison-print-graph.Tpo -c -o src/bison-print-graph.o `test -f 'src/print-graph.c' || echo '$(srcdir)/'`src/print-graph.c + @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-graph.Tpo src/$(DEPDIR)/bison-print-graph.Po +@@ -9079,6 +9099,7 @@ distclean: distclean-recursive + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po ++ -rm -f src/$(DEPDIR)/bison-pathtools.Po + -rm -f src/$(DEPDIR)/bison-print-graph.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po +@@ -9464,6 +9485,7 @@ maintainer-clean: maintainer-clean-recursive + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po ++ -rm -f src/$(DEPDIR)/bison-pathtools.Po + -rm -f src/$(DEPDIR)/bison-print-graph.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po +--- src/files.c ++++ src/files.c +@@ -1,4 +1,5 @@ + /* Open and close files for Bison. ++ rse-gram.Po + + Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2020 Free + Software Foundation, Inc. +@@ -35,6 +36,7 @@ + #include "files.h" + #include "getargs.h" + #include "gram.h" ++#include "pathtools.h" + + /* Initializing some values below (such SPEC_NAME_PREFIX to 'yy') is + tempting, but don't do that: for the time being our handling of the +@@ -417,7 +419,11 @@ pkgdatadir (void) + else + { + char const *cp = getenv ("BISON_PKGDATADIR"); +- return cp ? cp : relocate2 (PKGDATADIR, &relocate_buffer); ++ if (cp) { ++ return cp; ++ } ++ const char *_dir = single_path_relocation(BINDIR, PKGDATADIR); ++ return _dir; + } + } + +--- src/local.mk ++++ src/local.mk +@@ -71,6 +71,8 @@ src_bison_SOURCES = \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ ++ src/pathtools.c \ ++ src/pathtools.h \ + src/print-graph.c \ + src/print-graph.h \ + src/print-xml.c \ +--- src/output.c ++++ src/output.c +@@ -21,6 +21,7 @@ + #include + #include "system.h" + ++#include + #include /* IS_PATH_WITH_DIR */ + #include + #include +@@ -41,6 +42,7 @@ + #include "scan-skel.h" + #include "symtab.h" + #include "tables.h" ++#include "pathtools.h" + + static struct obstack format_obstack; + +@@ -573,7 +575,7 @@ static void + output_skeleton (void) + { + /* Compute the names of the package data dir and skeleton files. */ +- char const *m4 = (m4 = getenv ("M4")) ? m4 : M4; ++ char const *m4 = (m4 = getenv ("M4")) ? m4 : "m4" EXEEXT; //single_path_relocation(BINDIR, M4); + char const *datadir = pkgdatadir (); + char *skeldir = xpath_join (datadir, "skeletons"); + char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4"); +--- /dev/null ++++ src/pathtools.c +@@ -0,0 +1,536 @@ ++/* ++ .Some useful path tools. ++ .ASCII only for now. ++ .Written by Ray Donnelly in 2014. ++ .Licensed under CC0 (and anything. ++ .else you need to license it under). ++ .No warranties whatsoever. ++ .email: . ++ */ ++ ++#include "config.h" ++#if defined(__APPLE__) ++#include ++#else ++#include ++#include ++#endif ++#include ++#include ++#include ++#if defined(__linux__) ++#include ++#endif ++#include ++ ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ ++/* If you don't define this, then get_executable_path() ++ can only use argv[0] which will often not work well */ ++#define IMPLEMENT_SYS_GET_EXECUTABLE_PATH ++ ++#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) ++#if defined(__linux__) ++/* Nothing needed, unistd.h is enough. */ ++#elif defined(__APPLE__) ++#include ++#elif defined(_WIN32) ++#define WIN32_MEAN_AND_LEAN ++#include ++#include ++#endif ++#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ ++ ++#include "pathtools.h" ++ ++char * ++malloc_copy_string(char const * original) ++{ ++ char * result = (char *) malloc (sizeof (char*) * strlen (original)+1); ++ if (result != NULL) ++ { ++ strcpy (result, original); ++ } ++ return result; ++} ++ ++void ++sanitise_path(char * path) ++{ ++ size_t path_size = strlen (path); ++ ++ /* Replace any '\' with '/' */ ++ char * path_p = path; ++ while ((path_p = strchr (path_p, '\\')) != NULL) ++ { ++ *path_p = '/'; ++ } ++ /* Replace any '//' with '/' */ ++ path_p = path; ++ while ((path_p = strstr (path_p, "//")) != NULL) ++ { ++ memmove (path_p, path_p + 1, path_size--); ++ } ++ return; ++} ++ ++char * ++get_relative_path(char const * from_in, char const * to_in) ++{ ++ size_t from_size = (from_in == NULL) ? 0 : strlen (from_in); ++ size_t to_size = (to_in == NULL) ? 0 : strlen (to_in); ++ size_t max_size = (from_size + to_size) * 2 + 4; ++ char * scratch_space = (char *) alloca (from_size + 1 + to_size + 1 + max_size + max_size); ++ char * from; ++ char * to; ++ char * common_part; ++ char * result; ++ size_t count; ++ ++ /* No to, return "./" */ ++ if (to_in == NULL) ++ { ++ return malloc_copy_string ("./"); ++ } ++ ++ /* If alloca failed or no from was given return a copy of to */ ++ if ( from_in == NULL ++ || scratch_space == NULL ) ++ { ++ return malloc_copy_string (to_in); ++ } ++ ++ from = scratch_space; ++ strcpy (from, from_in); ++ to = from + from_size + 1; ++ strcpy (to, to_in); ++ common_part = to + to_size + 1; ++ result = common_part + max_size; ++ simplify_path (from); ++ simplify_path (to); ++ ++ result[0] = '\0'; ++ ++ size_t match_size_dirsep = 0; /* The match size up to the last /. Always wind back to this - 1 */ ++ size_t match_size = 0; /* The running (and final) match size. */ ++ size_t largest_size = (from_size > to_size) ? from_size : to_size; ++ int to_final_is_slash = (to[to_size-1] == '/') ? 1 : 0; ++ char from_c; ++ char to_c; ++ for (match_size = 0; match_size < largest_size; ++match_size) ++ { ++ /* To simplify the logic, always pretend the strings end with '/' */ ++ from_c = (match_size < from_size) ? from[match_size] : '/'; ++ to_c = (match_size < to_size) ? to[match_size] : '/'; ++ ++ if (from_c != to_c) ++ { ++ if (from_c != '\0' || to_c != '\0') ++ { ++ match_size = match_size_dirsep; ++ } ++ break; ++ } ++ else if (from_c == '/') ++ { ++ match_size_dirsep = match_size; ++ } ++ } ++ strncpy (common_part, from, match_size); ++ common_part[match_size] = '\0'; ++ from += match_size; ++ to += match_size; ++ size_t ndotdots = 0; ++ char const* from_last = from + strlen(from) - 1; ++ while ((from = strchr (from, '/')) && from != from_last) ++ { ++ ++ndotdots; ++ ++from; ++ } ++ for (count = 0; count < ndotdots; ++count) ++ { ++ strcat(result, "../"); ++ } ++ if (strlen(to) > 0) ++ { ++ strcat(result, to+1); ++ } ++ /* Make sure that if to ends with '/' result does the same, and ++ vice-versa. */ ++ size_t size_result = strlen(result); ++ if ((to_final_is_slash == 1) ++ && (!size_result || result[size_result-1] != '/')) ++ { ++ strcat (result, "/"); ++ } ++ else if (!to_final_is_slash ++ && size_result && result[size_result-1] == '/') ++ { ++ result[size_result-1] = '\0'; ++ } ++ ++ return malloc_copy_string (result); ++} ++ ++void ++simplify_path(char * path) ++{ ++ ssize_t n_toks = 1; /* in-case we need an empty initial token. */ ++ ssize_t i, j; ++ size_t tok_size; ++ size_t in_size = strlen (path); ++ int it_ended_with_a_slash = (path[in_size - 1] == '/') ? 1 : 0; ++ char * result = path; ++ sanitise_path(result); ++ char * result_p = result; ++ ++ do ++ { ++ ++n_toks; ++ ++result_p; ++ } while ((result_p = strchr (result_p, '/')) != NULL); ++ ++ result_p = result; ++ char ** toks = (char **) alloca (sizeof (char const*) * n_toks); ++ n_toks = 0; ++ do ++ { ++ if (result_p > result) ++ { ++ *result_p++ = '\0'; ++ } ++ else if (*result_p == '/') ++ { ++ /* A leading / creates an empty initial token. */ ++ toks[n_toks++] = result_p; ++ *result_p++ = '\0'; ++ } ++ toks[n_toks++] = result_p; ++ } while ((result_p = strchr (result_p, '/')) != NULL); ++ ++ /* Remove all non-leading '.' and any '..' we can match ++ with an earlier forward path (i.e. neither '.' nor '..') */ ++ for (i = 1; i < n_toks; ++i) ++ { ++ int removals[2] = { -1, -1 }; ++ if ( strcmp (toks[i], "." ) == 0) ++ { ++ removals[0] = i; ++ } ++ else if ( strcmp (toks[i], ".." ) == 0) ++ { ++ /* Search backwards for a forward path to collapse. ++ If none are found then the .. also stays. */ ++ for (j = i - 1; j > -1; --j) ++ { ++ if ( strcmp (toks[j], "." ) ++ && strcmp (toks[j], ".." ) ) ++ { ++ removals[0] = j; ++ removals[1] = i; ++ break; ++ } ++ } ++ } ++ for (j = 0; j < 2; ++j) ++ { ++ if (removals[j] >= 0) /* Can become -2 */ ++ { ++ --n_toks; ++ memmove (&toks[removals[j]], &toks[removals[j]+1], (n_toks - removals[j])*sizeof (char*)); ++ --i; ++ if (!j) ++ { ++ --removals[1]; ++ } ++ } ++ } ++ } ++ result_p = result; ++ for (i = 0; i < n_toks; ++i) ++ { ++ tok_size = strlen(toks[i]); ++ memcpy (result_p, toks[i], tok_size); ++ result_p += tok_size; ++ if ((!i || tok_size) && ((i < n_toks - 1) || it_ended_with_a_slash == 1)) ++ { ++ *result_p = '/'; ++ ++result_p; ++ } ++ } ++ *result_p = '\0'; ++} ++ ++/* Returns actual_to by calculating the relative path from -> to and ++ applying that to actual_from. An assumption that actual_from is a ++ dir is made, and it may or may not end with a '/' */ ++char const * ++get_relocated_path (char const * from, char const * to, char const * actual_from) ++{ ++ char const * relative_from_to = get_relative_path (from, to); ++ char * actual_to = (char *) malloc (strlen(actual_from) + 2 + strlen(relative_from_to)); ++ return actual_to; ++} ++ ++int ++get_executable_path(char const * argv0, char * result, ssize_t max_size) ++{ ++ char * system_result = (char *) alloca (max_size); ++ ssize_t system_result_size = -1; ++ ssize_t result_size = -1; ++ ++ if (system_result != NULL) ++ { ++#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) ++#if defined(__linux__) ++ system_result_size = readlink("/proc/self/exe", system_result, max_size); ++#elif defined(__APPLE__) ++ uint32_t bufsize = (uint32_t)max_size; ++ if (_NSGetExecutablePath(system_result, &bufsize) == 0) ++ { ++ system_result_size = (ssize_t)bufsize; ++ } ++#elif defined(_WIN32) ++ unsigned long bufsize = (unsigned long)max_size; ++ system_result_size = GetModuleFileNameA(NULL, system_result, bufsize); ++ if (system_result_size == 0 || system_result_size == (ssize_t)bufsize) ++ { ++ /* Error, possibly not enough space. */ ++ system_result_size = -1; ++ } ++ else ++ { ++ /* Early conversion to unix slashes instead of more changes ++ everywhere else .. */ ++ char * winslash; ++ system_result[system_result_size] = '\0'; ++ while ((winslash = strchr (system_result, '\\')) != NULL) ++ { ++ *winslash = '/'; ++ } ++ } ++#else ++#warning "Don't know how to get executable path on this system" ++#endif ++#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ ++ } ++ /* Use argv0 as a default in-case of failure */ ++ if (system_result_size != -1) ++ { ++ strncpy (result, system_result, system_result_size); ++ result[system_result_size] = '\0'; ++ } ++ else ++ { ++ if (argv0 != NULL) ++ { ++ strncpy (result, argv0, max_size); ++ result[max_size-1] = '\0'; ++ } ++ else ++ { ++ result[0] = '\0'; ++ } ++ } ++ result_size = strlen (result); ++ return result_size; ++} ++ ++char const * ++strip_n_prefix_folders(char const * path, size_t n) ++{ ++ if (path == NULL) ++ { ++ return NULL; ++ } ++ ++ if (path[0] != '/') ++ { ++ return path; ++ } ++ ++ char const * last = path; ++ while (n-- && path != NULL) ++ { ++ last = path; ++ path = strchr (path + 1, '/'); ++ } ++ return (path == NULL) ? last : path; ++} ++ ++void ++strip_n_suffix_folders(char * path, size_t n) ++{ ++ if (path == NULL) ++ { ++ return; ++ } ++ while (n--) ++ { ++ if (strrchr (path + 1, '/')) ++ { ++ *strrchr (path + 1, '/') = '\0'; ++ } ++ else ++ { ++ return; ++ } ++ } ++ return; ++} ++ ++size_t ++split_path_list(char const * path_list, char split_char, char *** arr) ++{ ++ size_t path_count; ++ size_t path_list_size; ++ char const * path_list_p; ++ ++ path_list_p = path_list; ++ if (path_list == NULL || path_list[0] == '\0') ++ { ++ return 0; ++ } ++ path_list_size = strlen (path_list); ++ ++ path_count = 0; ++ do ++ { ++ ++path_count; ++ ++path_list_p; ++ } ++ while ((path_list_p = strchr (path_list_p, split_char)) != NULL); ++ ++ /* allocate everything in one go. */ ++ char * all_memory = (char *) malloc (sizeof (char *) * path_count + strlen(path_list) + 1); ++ if (all_memory == NULL) ++ return 0; ++ *arr = (char **)all_memory; ++ all_memory += sizeof (char *) * path_count; ++ ++ path_count = 0; ++ path_list_p = path_list; ++ char const * next_path_list_p = 0; ++ do ++ { ++ next_path_list_p = strchr (path_list_p, split_char); ++ if (next_path_list_p != NULL) ++ { ++ ++next_path_list_p; ++ } ++ size_t this_size = (next_path_list_p != NULL) ++ ? next_path_list_p - path_list_p - 1 ++ : &path_list[path_list_size] - path_list_p; ++ memcpy (all_memory, path_list_p, this_size); ++ all_memory[this_size] = '\0'; ++ (*arr)[path_count++] = all_memory; ++ all_memory += this_size + 1; ++ } while ((path_list_p = next_path_list_p) != NULL); ++ ++ return path_count; ++} ++ ++char * ++get_relocated_path_list(char const * from, char const * to_path_list) ++{ ++ char exe_path[32768]; ++ char * temp; ++ get_executable_path (NULL, &exe_path[0], sizeof (exe_path) / sizeof (exe_path[0])); ++ if ((temp = strrchr (exe_path, '/')) != NULL) ++ { ++ temp[1] = '\0'; ++ } ++ ++ char **arr = NULL; ++ /* Ask Alexey why he added this. Are we not 100% sure ++ that we're dealing with unix paths here? */ ++ char split_char = ':'; ++ if (strchr (to_path_list, ';')) ++ { ++ split_char = ';'; ++ } ++ size_t count = split_path_list (to_path_list, split_char, &arr); ++ int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */ ++ size_t exe_path_size = strlen (exe_path); ++ size_t i; ++ /* Space required is: ++ count * (exe_path_size + strlen (rel_to_datadir)) ++ rel_to_datadir upper bound is: ++ (count * strlen (from)) + (3 * num_slashes (from)) ++ + strlen(arr[i]) + 1. ++ .. pathalogically num_slashes (from) is strlen (from) ++ (from = ////////) */ ++ size_t space_required = (count * (exe_path_size + 4 * strlen (from))) + count - 1; ++ for (i = 0; i < count; ++i) ++ { ++ space_required += strlen (arr[i]); ++ } ++ char * scratch = (char *) alloca (space_required); ++ if (scratch == NULL) ++ return NULL; ++ for (i = 0; i < count; ++i) ++ { ++ char * rel_to_datadir = get_relative_path (from, arr[i]); ++ scratch[0] = '\0'; ++ arr[i] = scratch; ++ strcat (scratch, exe_path); ++ strcat (scratch, rel_to_datadir); ++ simplify_path (arr[i]); ++ size_t arr_i_size = strlen (arr[i]); ++ result_size += arr_i_size; ++ scratch = arr[i] + arr_i_size + 1; ++ } ++ char * result = (char *) malloc (result_size); ++ if (result == NULL) ++ { ++ return NULL; ++ } ++ result[0] = '\0'; ++ for (i = 0; i < count; ++i) ++ { ++ strcat (result, arr[i]); ++ if (i != count-1) ++ { ++#if defined(_WIN32) ++ strcat (result, ";"); ++#else ++ strcat (result, ":"); ++#endif ++ } ++ } ++ free ((void*)arr); ++ return result; ++} ++ ++char * ++single_path_relocation(const char *from, const char *to) ++{ ++ char exe_path[PATH_MAX]; ++ get_executable_path (NULL, &exe_path[0], sizeof(exe_path)/sizeof(exe_path[0])); ++ if (strrchr (exe_path, '/') != NULL) ++ { ++ strrchr (exe_path, '/')[1] = '\0'; ++ } ++ char * rel_to_datadir = get_relative_path (from, to); ++ strcat (exe_path, rel_to_datadir); ++ simplify_path (&exe_path[0]); ++ return malloc_copy_string(exe_path); ++} ++ ++char * ++pathlist_relocation(const char *from_path, const char *to_path_list) ++{ ++ static char stored_path[PATH_MAX]; ++ static int stored = 0; ++ if (stored == 0) ++ { ++ char const * relocated = get_relocated_path_list(from_path, to_path_list); ++ strncpy (stored_path, relocated, PATH_MAX); ++ stored_path[PATH_MAX-1] = '\0'; ++ free ((void *)relocated); ++ stored = 1; ++ } ++ return stored_path; ++} +--- /dev/null ++++ src/pathtools.h +@@ -0,0 +1,53 @@ ++/* ++ .Some useful path tools. ++ .ASCII only for now. ++ .Written by Ray Donnelly in 2014. ++ .Licensed under CC0 (and anything. ++ .else you need to license it under). ++ .No warranties whatsoever. ++ .email: . ++ */ ++ ++#ifndef PATHTOOLS_H ++#define PATHTOOLS_H ++ ++#include ++#if defined(__APPLE__) ++#include ++#else ++#include ++#endif ++#include ++ ++char * malloc_copy_string(char const * original); ++ ++/* In-place replaces any '\' with '/' and any '//' with '/' */ ++void sanitise_path(char * path); ++ ++/* Uses a host OS specific function to determine the path of the executable, ++ if IMPLEMENT_SYS_GET_EXECUTABLE_PATH is defined, otherwise uses argv0. */ ++int get_executable_path(char const * argv0, char * result, ssize_t max_size); ++ ++/* Where possible, in-place removes occourances of '.' and 'path/..' */ ++void simplify_path(char * path); ++ ++/* Allocates (via malloc) and returns the path to get from from to to. */ ++char * get_relative_path(char const * from, char const * to); ++ ++size_t split_path_list(char const * path_list, char split_char, char *** arr); ++ ++/* Advances path along by the amount that removes n prefix folders. */ ++char const * ++strip_n_prefix_folders(char const * path, size_t n); ++ ++/* NULL terminates path to remove n suffix folders. */ ++void ++strip_n_suffix_folders(char * path, size_t n); ++ ++char const * get_relocated_path (char const * from, char const * to, char const * actual_from); ++char * get_relocated_path_list(char const * from, char const * to_path_list); ++ ++char * single_path_relocation(const char *from, const char *to); ++char * pathlist_relocation(const char *from_path, const char *to_path_list); ++ ++#endif /* PATHTOOLS_H */ +-- +2.21.1 + diff --git a/recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch b/recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch new file mode 100644 index 0000000000000..be69712e62b8c --- /dev/null +++ b/recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch @@ -0,0 +1,38 @@ +This avoid showing a `Assertion Failed Dialog Box` during configure and running bison with the assertion failur: + +``` +Expression: new_maximum >= _IOB_ENTRIES && new_maximum <= _NHANDLE_ +``` + +msdn documentation of _setmaxstdio at +https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio + +Summary: +maximum of 8192 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library. + +Kudos to @SSE4 for finding the rootcause at +https://github.com/conan-io/conan-center-index/pull/2334#issuecomment-668171405 + + +--- lib/getdtablesize.c ++++ lib/getdtablesize.c +@@ -79,12 +79,18 @@ getdtablesize (void) + freed when we call _setmaxstdio with the original value. */ + int orig_max_stdio = _getmaxstdio (); + unsigned int bound; +- for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) ++#ifdef _MSC_VER ++# define BOUND_START 0x2000 ++#else ++# define BOUND_START 0x10000 ++#endif ++ for (bound = BOUND_START; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) + ; + _setmaxstdio_nothrow (orig_max_stdio); + dtablesize = bound; + } + return dtablesize; ++#undef BOUND_START + } + + #else diff --git a/recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch b/recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch new file mode 100644 index 0000000000000..377c9d47a6ad1 --- /dev/null +++ b/recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch @@ -0,0 +1,14 @@ +build: don't link bison against libreadline +Reported by Paul Smith . +https://lists.gnu.org/r/bug-bison/2020-10/msg00001.html + +--- a/Makefile.in ++++ b/Makefile.in +@@ -3456,7 +3456,6 @@ + $(LIB_SETLOCALE_NULL) \ + $(LIBICONV) \ + $(LIBINTL) \ +- $(LIBREADLINE) \ + $(LIBTEXTSTYLE) + + @ENABLE_YACC_TRUE@nodist_bin_SCRIPTS = src/yacc diff --git a/recipes/bison/all/test_package/CMakeLists.txt b/recipes/bison/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..569311ba35a62 --- /dev/null +++ b/recipes/bison/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(BISON REQUIRED) + +set(BISON_VARS + BISON_FOUND + BISON_EXECUTABLE + BISON_VERSION +) + +foreach(BISON_VAR ${BISON_VARS}) + message("${BISON_VAR}: ${${BISON_VAR}}") + if(NOT ${BISON_VAR}) + message(FATAL_ERROR "${BISON_VAR} NOT FOUND") + endif() +endforeach() + +bison_target(McParser mc_parser.yy "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp") +add_library(${PROJECT_NAME} STATIC ${BISON_McParser_OUTPUTS}) diff --git a/recipes/bison/all/test_package/conanfile.py b/recipes/bison/all/test_package/conanfile.py new file mode 100644 index 0000000000000..dd177dd578622 --- /dev/null +++ b/recipes/bison/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.microsoft import unix_path +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _mc_parser_source(self): + return os.path.join(self.source_folder, "mc_parser.yy") + + def test(self): + self.run("bison --version") + self.run("yacc --version") + self.run(f"bison -d {unix_path(self, self._mc_parser_source)}") diff --git a/recipes/bison/all/test_package/mc_parser.yy b/recipes/bison/all/test_package/mc_parser.yy new file mode 100644 index 0000000000000..f09b5cc80778a --- /dev/null +++ b/recipes/bison/all/test_package/mc_parser.yy @@ -0,0 +1,42 @@ +%{ +#include +#include +#include +#include //-- I need this for atoi +using namespace std; + +int yylex(); +int yyerror(const char *p) { cerr << "Error!" << endl; return 42; } +%} + +%union { + int val; + char sym; +}; +%token NUM +%token OPA OPM LP RP STOP +%type exp term sfactor factor res + +%% +run: res run | res /* forces bison to process many stmts */ + +res: exp STOP { cout << $1 << endl; } + +exp: exp OPA term { $$ = ($2 == '+' ? $1 + $3 : $1 - $3); } +| term { $$ = $1; } + +term: term OPM factor { $$ = ($2 == '*' ? $1 * $3 : $1 / $3); } +| sfactor { $$ = $1; } + +sfactor: OPA factor { $$ = ($1 == '+' ? $2 : -$2); } +| factor { $$ = $1; } + +factor: NUM { $$ = $1; } +| LP exp RP { $$ = $2; } + +%% +int main() +{ + yyparse(); + return 0; +} diff --git a/recipes/bison/all/test_v1_package/CMakeLists.txt b/recipes/bison/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bison/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bison/all/test_v1_package/conanfile.py b/recipes/bison/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..99ccbfcae8665 --- /dev/null +++ b/recipes/bison/all/test_v1_package/conanfile.py @@ -0,0 +1,31 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _mc_parser_source(self): + return os.path.join(self.source_folder, os.pardir, "test_package", "mc_parser.yy") + + def test(self): + self.run("bison --version") + self.run("yacc --version", win_bash=tools.os_info.is_windows) + self.run(f"bison -d {self._mc_parser_source}") diff --git a/recipes/bison/config.yml b/recipes/bison/config.yml new file mode 100644 index 0000000000000..7e22e455ae51e --- /dev/null +++ b/recipes/bison/config.yml @@ -0,0 +1,9 @@ +versions: + "3.8.2": + folder: all + "3.7.6": + folder: all + "3.7.1": + folder: all + "3.5.3": + folder: all diff --git a/recipes/bit-lite/all/conandata.yml b/recipes/bit-lite/all/conandata.yml new file mode 100644 index 0000000000000..66d3baa2acd92 --- /dev/null +++ b/recipes/bit-lite/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: https://github.com/martinmoene/bit-lite/archive/0.1.0.zip + sha256: efb1c1fa3620c3b145e58ebf8ba2cbc9c1213a391e600c7bcd1e946f2ed16ffd diff --git a/recipes/bit-lite/all/conanfile.py b/recipes/bit-lite/all/conanfile.py new file mode 100644 index 0000000000000..b0529cb7abe9a --- /dev/null +++ b/recipes/bit-lite/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BitLiteConan(ConanFile): + name = "bit-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/bit-lite" + description = ("bit is a C++20 bit operations for C++98 and later \ + in a single-file header-only library.") + topics = ("bit-lite", "bit", "manipulation", ) + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bit-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::bit-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "bit-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "bit-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["bitlite"].names["cmake_find_package"] = "bit-lite" + self.cpp_info.components["bitlite"].names["cmake_find_package_multi"] = "bit-lite" + self.cpp_info.components["bitlite"].set_property("cmake_target_name", "nonstd::bit-lite") diff --git a/recipes/bit-lite/all/test_package/CMakeLists.txt b/recipes/bit-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed13431c56a28 --- /dev/null +++ b/recipes/bit-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(bit-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::bit-lite) diff --git a/recipes/bit-lite/all/test_package/conanfile.py b/recipes/bit-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/bit-lite/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/bit-lite/all/test_package/test_package.cpp b/recipes/bit-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d0af3714d8926 --- /dev/null +++ b/recipes/bit-lite/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include "nonstd/bit.hpp" +#include + +using namespace nonstd; + +int main() +{ + // Consecutive ones at the right in 0x17: + if ( countr_one( 0x17u ) != 3 ) + throw std::exception(); + + // Bit width of 0x13: + if ( bit_width( 0x13u ) != 5 ) + throw std::exception(); +} diff --git a/recipes/bit-lite/all/test_v1_package/CMakeLists.txt b/recipes/bit-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a2c6ae82d037d --- /dev/null +++ b/recipes/bit-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bit-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::bit-lite) diff --git a/recipes/bit-lite/all/test_v1_package/conanfile.py b/recipes/bit-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bit-lite/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/bit-lite/config.yml b/recipes/bit-lite/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/bit-lite/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/bitflags/all/conandata.yml b/recipes/bitflags/all/conandata.yml new file mode 100644 index 0000000000000..2abe2034e3c41 --- /dev/null +++ b/recipes/bitflags/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5.0": + url: "https://github.com/m-peko/bitflags/archive/refs/tags/v1.5.0.tar.gz" + sha256: 1ea19e03e05e8e78faf0126a1a100e591467828bc816224e9cda330b104e69b5 diff --git a/recipes/bitflags/all/conanfile.py b/recipes/bitflags/all/conanfile.py new file mode 100644 index 0000000000000..dc6d3239bb416 --- /dev/null +++ b/recipes/bitflags/all/conanfile.py @@ -0,0 +1,65 @@ +import os + +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 + +required_conan_version = ">=1.50.0" + + +class BitFlags(ConanFile): + name = "bitflags" + description = "Single-header header-only C++11 / C++14 / C++17 library for easily managing set of auto-generated type-safe flags" + topics = ("bits", "bitflags", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/m-peko/bitflags" + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "11" + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "5", + "clang": "5", + "gcc": "7", + "Visual Studio": "14", + "msvc": "190", + } + + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bitflags") + self.cpp_info.set_property("cmake_target_name", "bitflags::bitflags") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/bitflags/all/test_package/CMakeLists.txt b/recipes/bitflags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..51b69634fef26 --- /dev/null +++ b/recipes/bitflags/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(bitflags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bitflags::bitflags) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bitflags/all/test_package/conanfile.py b/recipes/bitflags/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e506c322ce801 --- /dev/null +++ b/recipes/bitflags/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 + +required_conan_version = ">=1.50.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/bitflags/all/test_package/test_package.cpp b/recipes/bitflags/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..91a9730c23c5a --- /dev/null +++ b/recipes/bitflags/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include "bitflags/bitflags.hpp" +#include +#include + +BEGIN_BITFLAGS(Flags) +FLAG(none) +FLAG(flag_a) +FLAG(flag_b) +FLAG(flag_c) +END_BITFLAGS(Flags) + +DEFINE_FLAG(Flags, none) +DEFINE_FLAG(Flags, flag_a) +DEFINE_FLAG(Flags, flag_b) +DEFINE_FLAG(Flags, flag_c) + +int main() { + std::cout << +Flags::none.bits << " - " << Flags::none.name << '\n'; + std::cout << +Flags::flag_a.bits << " - " << Flags::flag_a.name << '\n'; + std::cout << +Flags::flag_b.bits << " - " << Flags::flag_b.name << '\n'; + std::cout << +Flags::flag_c.bits << " - " << Flags::flag_c.name << '\n'; + + const auto flags = Flags::flag_a | Flags::flag_b; + + assert(flags & Flags::flag_a); + assert(!(flags & Flags::flag_c)); +} diff --git a/recipes/bitflags/all/test_v1_package/CMakeLists.txt b/recipes/bitflags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bitflags/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bitflags/all/test_v1_package/conanfile.py b/recipes/bitflags/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/bitflags/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/bitflags/config.yml b/recipes/bitflags/config.yml new file mode 100644 index 0000000000000..16b5c7979d806 --- /dev/null +++ b/recipes/bitflags/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.0": + folder: "all" diff --git a/recipes/bitmagic/all/conandata.yml b/recipes/bitmagic/all/conandata.yml new file mode 100644 index 0000000000000..be5ff4fa07b8e --- /dev/null +++ b/recipes/bitmagic/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "7.12.3": + url: "https://github.com/tlk00/BitMagic/archive/refs/tags/v7.12.3.tar.gz" + sha256: "5e59507a01a8295bb57aebcf557a4a25b992244736f7924300cdb9635f1b2780" + "7.11.2": + url: "https://github.com/tlk00/BitMagic/archive/refs/tags/v7.11.2.tar.gz" + sha256: "09faf5b9da4e0cee4947e05b7af0bd834e63e90c8877c115b719b4f390709a6f" + "7.10.3": + url: "https://github.com/tlk00/BitMagic/archive/v7.10.3.tar.gz" + sha256: "164aae4f52f35f3a0e4a596611efcd1494a9be5489be494c6a440e5a83f17460" + "7.9.3": + url: "https://github.com/tlk00/BitMagic/archive/v7.9.3.tar.gz" + sha256: "fa1799f702dac47148dc8e2672957b1fc5be440d043ef2c4d275c04b434182e1" + "7.8.0": + url: "https://github.com/tlk00/BitMagic/archive/v7.8.0.tar.gz" + sha256: "78e1d2ba81ad14595c976ecb0e8d18a9b652dfe8e394964f94bd98cc8164391b" + "7.7.7": + url: "https://github.com/tlk00/BitMagic/archive/v7.7.7.tar.gz" + sha256: "9f645a2aa18566462733d592f8f44c9bb283a2df52701474f620d20cee4c9e92" + "7.6.0": + url: "https://github.com/tlk00/BitMagic/archive/v7.6.0.tar.gz" + sha256: "eebe39e15fc7c14d2c5aad5f07bf2c8ddf79bffafef2e748470f35d3555cf6a9" + "7.5.0": + url: "https://github.com/tlk00/BitMagic/archive/refs/tags/v7.5.0.tar.gz" + sha256: "dec7d316baf3be9cb058d9da302a7e4cb694ac429d4bd29138c24b1b0157a9e8" diff --git a/recipes/bitmagic/all/conanfile.py b/recipes/bitmagic/all/conanfile.py new file mode 100644 index 0000000000000..8a5d321f046d1 --- /dev/null +++ b/recipes/bitmagic/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class BitmagicConan(ConanFile): + name = "bitmagic" + description = "BitMagic Library helps to develop high-throughput intelligent search systems, " \ + "promote combination of hardware optimizations and on the fly compression to fit " \ + "inverted indexes and binary fingerprints into memory, minimize disk and network footprint." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://bitmagic.io" + topics = ("information-retrieval", "algorithm", "bit-manipulation", + "integer-compression", "sparse-vector", "sparse-matrix", "bit-array", + "bit-vector", "indexing-engine", "adjacency-matrix", "associative-array") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 17) + 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.name} requires C++17, which your compiler does not support.") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + 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=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/bitmagic/all/test_package/CMakeLists.txt b/recipes/bitmagic/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a756218c12bb7 --- /dev/null +++ b/recipes/bitmagic/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(bitmagic REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bitmagic::bitmagic) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/bitmagic/all/test_package/conanfile.py b/recipes/bitmagic/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/bitmagic/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/bitmagic/all/test_package/test_package.cpp b/recipes/bitmagic/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b633db7b8c598 --- /dev/null +++ b/recipes/bitmagic/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + bm::bvector<> bv_A{1, 2, 3}; + bm::bvector<> bv_B{1, 2, 4}; + bv_A.combine_operation(bv_B, bm::BM_OR); + return 0; +} diff --git a/recipes/bitmagic/all/test_v1_package/CMakeLists.txt b/recipes/bitmagic/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a1f535ce8930b --- /dev/null +++ b/recipes/bitmagic/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bitmagic REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bitmagic::bitmagic) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/bitmagic/all/test_v1_package/conanfile.py b/recipes/bitmagic/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bitmagic/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/bitmagic/config.yml b/recipes/bitmagic/config.yml new file mode 100644 index 0000000000000..34c9a540c22c6 --- /dev/null +++ b/recipes/bitmagic/config.yml @@ -0,0 +1,17 @@ +versions: + "7.12.3": + folder: all + "7.11.2": + folder: all + "7.10.3": + folder: all + "7.9.3": + folder: all + "7.8.0": + folder: all + "7.7.7": + folder: all + "7.6.0": + folder: all + "7.5.0": + folder: all diff --git a/recipes/bitserializer/all/conandata.yml b/recipes/bitserializer/all/conandata.yml new file mode 100644 index 0000000000000..9b5b2264c84bb --- /dev/null +++ b/recipes/bitserializer/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.50": + url: "https://bitbucket.com/Pavel_Kisliak/BitSerializer/get/0.50.tar.gz" + sha256: "dc000b6516db60337d5dd56fb1b60e29ce700bd2e6f4e609ca548b84d1f1dcee" + "0.44": + url: "https://bitbucket.com/Pavel_Kisliak/BitSerializer/get/0.44.tar.gz" + sha256: "39ee0b038c9f38a012f96913c9738a68514d2e923431fbd83ddf3f454e02bc6c" + "0.10": + url: "https://bitbucket.com/Pavel_Kisliak/BitSerializer/get/0.10.tar.gz" + sha256: "d5ae211aead17acb91d9fb7df7e72a30202f39412159dd0b46fe0e5046b29f94" diff --git a/recipes/bitserializer/all/conanfile.py b/recipes/bitserializer/all/conanfile.py new file mode 100644 index 0000000000000..e4f6815698c02 --- /dev/null +++ b/recipes/bitserializer/all/conanfile.py @@ -0,0 +1,221 @@ +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, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.1" + + +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") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bitbucket.org/Pavel_Kisliak/bitserializer" + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_cpprestsdk": [True, False], + "with_rapidjson": [True, False], + "with_pugixml": [True, False], + "with_rapidyaml": [True, False], + "with_csv": [True, False], + } + default_options = { + "fPIC": True, + "with_cpprestsdk": False, + "with_rapidjson": False, + "with_pugixml": False, + "with_rapidyaml": False, + "with_csv": False, + } + + no_copy_source = True + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7" if Version(self.version) < "0.44" else "8", + "Visual Studio": "15", + "msvc": "191", + "apple-clang": "12", + } + + 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 + options = self.info.options if info else self.options + return not options.with_csv + + def config_options(self): + if self.settings.os == "Windows" or Version(self.version) < "0.50": + del self.options.fPIC + if Version(self.version) < "0.50": + del self.options.with_rapidyaml + del self.options.with_csv + + def configure(self): + if self._is_header_only(): + self.options.rm_safe("fPIC") + else: + self.package_type = "static-library" + + def layout(self): + if self._is_header_only(): + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_cpprestsdk: + self.requires("cpprestsdk/2.10.18", transitive_headers=True, transitive_libs=True) + if self.options.with_rapidjson: + self.requires("rapidjson/cci.20220822", transitive_headers=True, transitive_libs=True) + if self.options.with_pugixml: + self.requires("pugixml/1.13", 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) + + def package_id(self): + if self._is_header_only(info=True): + 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.", + ) + + # Check stdlib ABI compatibility + compiler_name = str(self.settings.compiler) + if compiler_name == "gcc" and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration(f'Using {self.ref} with GCC requires "compiler.libcxx=libstdc++11"') + elif compiler_name == "clang" and self.settings.compiler.libcxx not in ["libstdc++11", "libc++"]: + raise ConanInvalidConfiguration(f'Using {self.ref} with Clang requires either "compiler.libcxx=libstdc++11"' + ' or "compiler.libcxx=libc++"') + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not self._is_header_only(): + tc = CMakeToolchain(self) + tc.variables["BUILD_CPPRESTJSON_ARCHIVE"] = self.options.with_cpprestsdk + tc.variables["BUILD_RAPIDJSON_ARCHIVE"] = self.options.with_rapidjson + 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.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + if Version(self.version) >= "0.50": + # Remove 'ryml' subdirectory from #include + replace_in_file( + self, os.path.join(self.source_folder, "include", "bitserializer", "rapidyaml_archive.h"), + "#include :BitSerializer::cpprestjson-archive> + $<$:BitSerializer::rapidjson-archive> + $<$:BitSerializer::pugixml-archive> + $<$:BitSerializer::rapidyaml-archive> + $<$:BitSerializer::csv-archive> +) +target_compile_definitions(${PROJECT_NAME} PRIVATE + $<$:"WITH_CPPRESTSDK"> + $<$:"WITH_RAPIDJSON"> + $<$:"WITH_PUGIXML"> + $<$:"WITH_RAPIDYAML"> + $<$:"WITH_CSV"> +) diff --git a/recipes/bitserializer/all/test_package/conanfile.py b/recipes/bitserializer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..abab9f750547c --- /dev/null +++ b/recipes/bitserializer/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + bitserializerOptions = self.dependencies[self.tested_reference_str].options + tc.variables["WITH_CPPRESTSDK"] = bitserializerOptions.with_cpprestsdk + tc.variables["WITH_RAPIDJSON"] = bitserializerOptions.with_rapidjson + 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.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/bitserializer/all/test_package/test_package.cpp b/recipes/bitserializer/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aba11c808ba19 --- /dev/null +++ b/recipes/bitserializer/all/test_package/test_package.cpp @@ -0,0 +1,81 @@ +// Define for suppress warning STL4015 : The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. +// ToDo: Remove when new version of RapidJson will be available +#define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING + +#include +#ifdef WITH_CPPRESTSDK +#include +#endif +#ifdef WITH_RAPIDJSON +#include +#endif +#ifdef WITH_PUGIXML +#include +#endif +#ifdef WITH_RAPIDYAML +#include +#endif +#ifdef WITH_CSV +#include +#endif + +#include +#include +#include + +class CTest +{ +public: + CTest(std::string message) + : mMessage(std::move(message)) + { } + + template + void Serialize(TArchive& archive) + { + archive << BitSerializer::MakeAutoKeyValue("Message", mMessage); + } + + std::string mMessage; +}; + +template +void TestArchive(const std::string& message) +{ + std::cout << "Testing " << BitSerializer::Convert::ToString(TArchive::archive_type) << " archive: "; + + BitSerializer::SerializationOptions serializationOptions; + serializationOptions.streamOptions.writeBom = false; + + CTest testObj[1] = { message }; + std::stringstream outputStream; + BitSerializer::SaveObject(testObj, outputStream, serializationOptions); + std::cout << outputStream.str() << std::endl; +} + +int main() { + std::cout << "BitSerializer version: " + << BitSerializer::Convert::To(BitSerializer::Version::Major) << "." + << BitSerializer::Convert::To(BitSerializer::Version::Minor) << "." + << BitSerializer::Convert::To(BitSerializer::Version::Maintenance) + << std::endl; + + // Some compilers does not link filesystem automatically + std::cout << "Testing the link of C++17 filesystem: " << std::filesystem::temp_directory_path() << std::endl; + +#ifdef WITH_CPPRESTSDK + TestArchive("Implementation based on cpprestsdk"); +#endif +#ifdef WITH_RAPIDJSON + TestArchive("Implementation based on RapidJson"); +#endif +#ifdef WITH_PUGIXML + TestArchive("Implementation based on pugixml"); +#endif +#ifdef WITH_RAPIDYAML + TestArchive("Implementation based on RapidYaml"); +#endif +#ifdef WITH_CSV + TestArchive("CSV archive (built-in implementation)"); +#endif +} diff --git a/recipes/bitserializer/all/test_v1_package/CMakeLists.txt b/recipes/bitserializer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bitserializer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bitserializer/all/test_v1_package/conanfile.py b/recipes/bitserializer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..599ba5557b9dc --- /dev/null +++ b/recipes/bitserializer/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def _bitserializer_option(self, name, default=None): + try: + return getattr(self.options["bitserializer"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_CPPRESTSDK"] = self.options["bitserializer"].with_cpprestsdk + cmake.definitions["WITH_RAPIDJSON"] = self.options["bitserializer"].with_rapidjson + 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.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/bitserializer/config.yml b/recipes/bitserializer/config.yml new file mode 100644 index 0000000000000..31b1805864308 --- /dev/null +++ b/recipes/bitserializer/config.yml @@ -0,0 +1,7 @@ +versions: + "0.50": + folder: "all" + "0.44": + folder: "all" + "0.10": + folder: "all" diff --git a/recipes/bitsery/all/conandata.yml b/recipes/bitsery/all/conandata.yml new file mode 100644 index 0000000000000..6d53e1633d5bf --- /dev/null +++ b/recipes/bitsery/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "5.2.3": + url: "https://github.com/fraillt/bitsery/archive/v5.2.3.tar.gz" + sha256: "896d82ab4ccea9899ff2098aa69ad6d25e524ee1d4c747ce3232d0afe3cd05a5" + "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 new file mode 100644 index 0000000000000..dd2f676b3757f --- /dev/null +++ b/recipes/bitsery/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BitseryConan(ConanFile): + name = "bitsery" + description = ( + "Header only C++ binary serialization library. It is designed around " + "the networking requirements for real-time data delivery, especially for games." + ) + topics = ("serialization", "binary", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fraillt/bitsery" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + 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 = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Bitsery" + self.cpp_info.names["cmake_find_package_multi"] = "Bitsery" + 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") diff --git a/recipes/bitsery/all/test_package/CMakeLists.txt b/recipes/bitsery/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ae7a2f24744c3 --- /dev/null +++ b/recipes/bitsery/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Bitsery REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Bitsery::bitsery) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bitsery/all/test_package/conanfile.py b/recipes/bitsery/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/bitsery/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/bitsery/all/test_package/test_package.cpp b/recipes/bitsery/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8f5a23b07e60d --- /dev/null +++ b/recipes/bitsery/all/test_package/test_package.cpp @@ -0,0 +1,46 @@ +// directly taken from https://github.com/fraillt/bitsery/blob/master/examples/basic_usage.cpp and removed the asserts at the end +//include bitsery.h to get serialization and deserialization classes +#include +//in ordered to serialize/deserialize data to buffer, include buffer adapter +#include +//bitsery itself doesn't is lightweight, and doesnt include any unnessessary files, +//traits helps library to know how to use types correctly, +//in this case we'll be using vector both, to serialize/deserialize data and to store use as a buffer. +#include + +enum class MyEnum:uint16_t { V1,V2,V3 }; +struct MyStruct { + uint32_t i; + MyEnum e; + std::vector fs; +}; + +//define how object should be serialized/deserialized +template +void serialize(S& s, MyStruct& o) { + s.value4b(o.i);//fundamental types (ints, floats, enums) of size 4b + s.value2b(o.e); + s.container4b(o.fs, 10);//resizable containers also requires maxSize, to make it safe from buffer-overflow attacks +} + +//some helper types +using Buffer = std::vector; +using OutputAdapter = bitsery::OutputBufferAdapter; +using InputAdapter = bitsery::InputBufferAdapter; + +int main() { + //set some random data + MyStruct data{8941, MyEnum::V2, {15.0f, -8.5f, 0.045f}}; + MyStruct res{}; + + //create buffer to store data + Buffer buffer; + //use quick serialization function, + //it will use default configuration to setup all the nesessary steps + //and serialize data to container + auto writtenSize = bitsery::quickSerialization(buffer, data); + + //same as serialization, but returns deserialization state as a pair + //first = error code, second = is buffer was successfully read from begin to the end. + auto state = bitsery::quickDeserialization({buffer.begin(), writtenSize}, res); +} diff --git a/recipes/bitsery/all/test_v1_package/CMakeLists.txt b/recipes/bitsery/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be90dcf1b4730 --- /dev/null +++ b/recipes/bitsery/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Bitsery REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Bitsery::bitsery) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bitsery/all/test_v1_package/conanfile.py b/recipes/bitsery/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bitsery/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/bitsery/config.yml b/recipes/bitsery/config.yml new file mode 100644 index 0000000000000..07e67c2710fe5 --- /dev/null +++ b/recipes/bitsery/config.yml @@ -0,0 +1,11 @@ +versions: + "5.2.3": + 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/blaze/all/conandata.yml b/recipes/blaze/all/conandata.yml new file mode 100644 index 0000000000000..a6e5a6aa09753 --- /dev/null +++ b/recipes/blaze/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.8": + url: "https://bitbucket.org/blaze-lib/blaze/downloads/blaze-3.8.tar.gz" + sha256: "dfaae1a3a9fea0b3cc92e78c9858dcc6c93301d59f67de5d388a3a41c8a629ae" + "3.7": + url: "https://bitbucket.org/blaze-lib/blaze/downloads/blaze-3.7.tar.gz" + sha256: "ef3cbc5db7d62dcdde0af88d3c951051254afd750d26773406fddb6afc5ad890" diff --git a/recipes/blaze/all/conanfile.py b/recipes/blaze/all/conanfile.py new file mode 100644 index 0000000000000..a5d62edf842a5 --- /dev/null +++ b/recipes/blaze/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import chdir, copy, get, rename, rmdir +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BlazeConan(ConanFile): + name = "blaze" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bitbucket.org/blaze-lib/blaze" + description = "open-source, high-performance C++ math library for dense and sparse arithmetic" + topics = ("blaze", "math", "algebra", "linear algebra", "high-performance") + license = "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + base_source_dir = os.path.join(self.source_folder, os.pardir) + get(self, **self.conan_data["sources"][self.version], + destination=base_source_dir, strip_root=True) + with chdir(self, base_source_dir): + rmdir(self, self.source_folder) + rename(self, src=f"blaze-{self.version}", dst=self.source_folder) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "blaze/*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "blaze") + self.cpp_info.set_property("cmake_target_name", "blaze::blaze") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/blaze/all/test_package/CMakeLists.txt b/recipes/blaze/all/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..1b0a92218a093 --- /dev/null +++ b/recipes/blaze/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(blaze REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE blaze::blaze) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/blaze/all/test_package/conanfile.py b/recipes/blaze/all/test_package/conanfile.py new file mode 100755 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/blaze/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/blaze/all/test_package/test_package.cpp b/recipes/blaze/all/test_package/test_package.cpp new file mode 100755 index 0000000000000..56d4a3951c395 --- /dev/null +++ b/recipes/blaze/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + + +int main() +{ + using blaze::StaticVector; + using blaze::DynamicVector; + + // Instantiation of a static 3D column vector. The vector is directly initialized as + // ( 4 -2 5 ) + StaticVector a{ 4, -2, 5 }; + + // Instantiation of a dynamic 3D column vector. Via the subscript operator the values are set to + // ( 2 5 -3 ) + DynamicVector b( 3UL ); + b[0] = 2; + b[1] = 5; + b[2] = -3; + + // Adding the vectors a and b + DynamicVector c = a + b; + + // Printing the result of the vector addition + std::cout << "c =\n" << c << "\n"; +} diff --git a/recipes/blaze/all/test_v1_package/CMakeLists.txt b/recipes/blaze/all/test_v1_package/CMakeLists.txt new file mode 100755 index 0000000000000..ec8caed27fa90 --- /dev/null +++ b/recipes/blaze/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(blaze REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE blaze::blaze) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/blaze/all/test_v1_package/conanfile.py b/recipes/blaze/all/test_v1_package/conanfile.py new file mode 100755 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/blaze/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/blaze/config.yml b/recipes/blaze/config.yml new file mode 100644 index 0000000000000..df754600895a3 --- /dev/null +++ b/recipes/blaze/config.yml @@ -0,0 +1,5 @@ +versions: + "3.8": + folder: all + "3.7": + folder: all diff --git a/recipes/blend2d/all/conandata.yml b/recipes/blend2d/all/conandata.yml new file mode 100644 index 0000000000000..bf96e03acb1d2 --- /dev/null +++ b/recipes/blend2d/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "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" +patches: + "0.8": + - 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 new file mode 100644 index 0000000000000..4c280dceae1ea --- /dev/null +++ b/recipes/blend2d/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.53.0" + + +class Blend2dConan(ConanFile): + name = "blend2d" + description = "2D Vector Graphics Engine Powered by a JIT Compiler" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://blend2d.com/" + topics = ("2d-graphics", "rasterization", "asmjit", "jit") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("asmjit/cci.20230325") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + if Version(self.version) < "0.8": + # In Visual Studio < 16, there are compilation error. patch is already provided. + # https://github.com/blend2d/blend2d/commit/63db360c7eb2c1c3ca9cd92a867dbb23dc95ca7d + check_min_vs(self, 192) + + 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["BLEND2D_TEST"] = False + tc.variables["BLEND2D_EMBED"] = False + tc.variables["BLEND2D_STATIC"] = not self.options.shared + tc.variables["BLEND2D_NO_STDCXX"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = 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.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.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): + self.cpp_info.set_property("cmake_file_name", "blend2d") + self.cpp_info.set_property("cmake_target_name", "blend2d::blend2d") + self.cpp_info.libs = ["blend2d"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "rt",]) + if not self.options.shared: + self.cpp_info.defines.append("BL_STATIC") 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 new file mode 100644 index 0000000000000..6a3ccd1e255b1 --- /dev/null +++ b/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000000000..b089c5a2e867f --- /dev/null +++ b/recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch @@ -0,0 +1,39 @@ +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/all/patches/0.8-0001-disable-embed-asmjit.patch b/recipes/blend2d/all/patches/0.8-0001-disable-embed-asmjit.patch new file mode 100644 index 0000000000000..94ad4abda7f9c --- /dev/null +++ b/recipes/blend2d/all/patches/0.8-0001-disable-embed-asmjit.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 47e4926..98c53f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -392,7 +392,7 @@ endif() + + # Find asmjit dependency if building with JIT support. + if (NOT BLEND2D_NO_JIT) +- if (NOT DEFINED ASMJIT_DIR) ++ if (0) + foreach(dir "${BLEND2D_DIR}/3rdparty/asmjit" + "${CMAKE_CURRENT_LIST_DIR}/../asmjit") + if (EXISTS ${dir}/CMakeLists.txt) +@@ -409,10 +409,9 @@ 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/test_package/CMakeLists.txt b/recipes/blend2d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ac05ac9286e7 --- /dev/null +++ b/recipes/blend2d/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(blend2d CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE blend2d::blend2d) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/blend2d/all/test_package/conanfile.py b/recipes/blend2d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/blend2d/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/blend2d/all/test_package/test_package.cpp b/recipes/blend2d/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7bc7acd9b0bd1 --- /dev/null +++ b/recipes/blend2d/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include "blend2d.h" + +int main() { + auto img = BLImage(480, 480, BL_FORMAT_PRGB32); + return 0; +} diff --git a/recipes/blend2d/all/test_v1_package/CMakeLists.txt b/recipes/blend2d/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/blend2d/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/blend2d/all/test_v1_package/conanfile.py b/recipes/blend2d/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/blend2d/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/blend2d/config.yml b/recipes/blend2d/config.yml new file mode 100644 index 0000000000000..21fbadf20d447 --- /dev/null +++ b/recipes/blend2d/config.yml @@ -0,0 +1,7 @@ +versions: + "0.8": + folder: all + "0.0.18": + folder: all + "0.0.17": + folder: all diff --git a/recipes/bliss/all/conandata.yml b/recipes/bliss/all/conandata.yml new file mode 100644 index 0000000000000..f309295ccece6 --- /dev/null +++ b/recipes/bliss/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.77": + url: "https://users.aalto.fi/~tjunttil/bliss/downloads/bliss-0.77.zip" + sha256: "acc8b98034f30fad24c897f365abd866c13d9f1bb207e398d0caf136875972a4" +patches: + "0.77": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-no-assert-non-existent-member-variable.patch" diff --git a/recipes/bliss/all/conanfile.py b/recipes/bliss/all/conanfile.py new file mode 100644 index 0000000000000..620c98547a190 --- /dev/null +++ b/recipes/bliss/all/conanfile.py @@ -0,0 +1,93 @@ +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 check_min_vs, is_msvc +import os + +required_conan_version = ">=1.55.0" + + +class BlissConan(ConanFile): + name = "bliss" + description = "bliss is an open source tool for computing automorphism groups and canonical forms of graphs." + topics = ("automorphism", "group", "graph") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://users.aalto.fi/~tjunttil/bliss" + license = "GPL-3-or-later", "LGPL-3-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_exact_int": [False, "gmp", "mpir"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_exact_int": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_exact_int == "gmp": + # gmp is fully transitive through bignum.hh public header of bliss + self.requires("gmp/6.2.1", transitive_headers=True, transitive_libs=True) + elif self.options.with_exact_int == "mpir": + self.requires("mpir/3.0.0", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + check_min_vs(self, "191") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_GMP"] = self.options.with_exact_int != False + tc.generate() + if bool(self.options.with_exact_int): + deps = CMakeDeps(self) + deps.set_property(self.options.with_exact_int, "cmake_file_name", "gmp") + deps.set_property(self.options.with_exact_int, "cmake_target_name", "gmp::gmp") + deps.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")) + copy(self, "COPYING.LESSER", 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 = ["bliss" if self.options.shared else "bliss_static"] + self.cpp_info.includedirs.append(os.path.join("include", "bliss")) + if bool(self.options.with_exact_int): + self.cpp_info.defines = ["BLISS_USE_GMP"] + if is_msvc(self): + self.cpp_info.cxxflags.append("/permissive-") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/bliss/all/patches/0001-fix-cmake.patch b/recipes/bliss/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..54dd5109f3444 --- /dev/null +++ b/recipes/bliss/all/patches/0001-fix-cmake.patch @@ -0,0 +1,52 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,17 +14,12 @@ if (MSVC) + add_compile_options(/permissive-) + else() + # Warnings, optimization, no assertions +- add_compile_options(-Wall -pedantic -O3 -DNDEBUG) #-Wextra -Werror + endif() + + if(USE_GMP) +- find_path(GMP_INCLUDE_DIR NAMES gmp.h) +- find_library(GMP_LIBRARIES NAMES gmp libgmp mpir REQUIRED) +- if (MSVC) +- add_compile_options(/DBLISS_USE_GMP /I${GMP_INCLUDE_DIR}) +- else() +- add_compile_options(-DBLISS_USE_GMP -I${GMP_INCLUDE_DIR}) +- endif() ++ find_package(gmp REQUIRED CONFIG) ++ link_libraries(gmp::gmp) ++ add_definitions(-DBLISS_USE_GMP) + endif(USE_GMP) + + set( +@@ -50,7 +44,7 @@ endif(MSVC) + + # Add the shared library + add_library(bliss SHARED ${BLISS_SOURCE_FILES}) +-set_property(TARGET bliss PROPERTY POSITION_INDEPENDENT_CODE 1) ++set_property(TARGET bliss PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # Add the static library + add_library(bliss_static STATIC ${BLISS_SOURCE_FILES}) +@@ -59,6 +53,18 @@ add_library(bliss_static STATIC ${BLISS_SOURCE_FILES}) + add_executable(bliss-executable src/bliss.cc) + target_link_libraries(bliss-executable bliss_static) + if(USE_GMP) +- target_link_libraries(bliss-executable ${GMP_LIBRARIES}) + endif(USE_GMP) + set_target_properties(bliss-executable PROPERTIES OUTPUT_NAME bliss) ++ ++install(TARGETS bliss-executable DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ ++file(GLOB BLISS_HEADERS src/*.h src/*.hh) ++install(FILES ${BLISS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bliss) ++if(BUILD_SHARED_LIBS) ++ install(TARGETS bliss ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++else() ++ install(TARGETS bliss_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() diff --git a/recipes/bliss/all/patches/0002-no-assert-non-existent-member-variable.patch b/recipes/bliss/all/patches/0002-no-assert-non-existent-member-variable.patch new file mode 100644 index 0000000000000..ac4d2de7b66ff --- /dev/null +++ b/recipes/bliss/all/patches/0002-no-assert-non-existent-member-variable.patch @@ -0,0 +1,10 @@ +--- a/src/graph.cc ++++ b/src/graph.cc +@@ -748,7 +748,6 @@ Graph::split_neighbourhood_of_cell(Partition::Cell* const cell) + + + Partition::Cell* const last_new_cell = p.zplit_cell(neighbour_cell, true); +- assert(neighbour_cell->nof_nonzeros == 0); + + /* Update certificate and hash if needed */ + const Partition::Cell* c = neighbour_cell; diff --git a/recipes/bliss/all/test_package/CMakeLists.txt b/recipes/bliss/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ec1e7802e63f --- /dev/null +++ b/recipes/bliss/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(bliss REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bliss::bliss) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bliss/all/test_package/conanfile.py b/recipes/bliss/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ff0f98fff8256 --- /dev/null +++ b/recipes/bliss/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + cnf_file = os.path.join(self.source_folder, "graph.cnf") + self.run(f"bliss {cnf_file}", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bliss/all/test_package/graph.cnf b/recipes/bliss/all/test_package/graph.cnf new file mode 100644 index 0000000000000..2f93e25c37da7 --- /dev/null +++ b/recipes/bliss/all/test_package/graph.cnf @@ -0,0 +1,8 @@ +c An example graph. +p edge 4 5 +n 2 1 +e 1 2 +e 4 1 +e 2 3 +e 2 4 +e 3 4 diff --git a/recipes/bliss/all/test_package/test_package.cpp b/recipes/bliss/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b06e698ccf141 --- /dev/null +++ b/recipes/bliss/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include + +#include +#include + +int main() { + bliss::Graph graph(4); + + graph.change_color(1, 1); + + graph.add_edge(0, 1); + graph.add_edge(3, 0); + graph.add_edge(1, 2); + graph.add_edge(1, 3); + graph.add_edge(2, 3); + + graph.write_dot("dot_output.txt"); + std::ifstream ifs("dot_output.txt", std::ios::binary); + std::cout << ifs.rdbuf() << std::endl; + + return 0; +} diff --git a/recipes/bliss/all/test_v1_package/CMakeLists.txt b/recipes/bliss/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bliss/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bliss/all/test_v1_package/conanfile.py b/recipes/bliss/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..44c5939c51bc9 --- /dev/null +++ b/recipes/bliss/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + cnf_file = os.path.join(self.source_folder, os.pardir, "test_package", "graph.cnf") + self.run(f"bliss {cnf_file}", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/bliss/config.yml b/recipes/bliss/config.yml new file mode 100644 index 0000000000000..ef686fd171068 --- /dev/null +++ b/recipes/bliss/config.yml @@ -0,0 +1,3 @@ +versions: + "0.77": + folder: all diff --git a/recipes/boolean-lite/all/conandata.yml b/recipes/boolean-lite/all/conandata.yml new file mode 100644 index 0000000000000..0fb54f08285a9 --- /dev/null +++ b/recipes/boolean-lite/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/martinmoene/boolean-lite/archive/v0.1.0.tar.gz" + sha256: "30687455c55877464b61b87b66798af8bce45b6f90f1709c030f263fdcb5d97d" diff --git a/recipes/boolean-lite/all/conanfile.py b/recipes/boolean-lite/all/conanfile.py new file mode 100644 index 0000000000000..312d87af87164 --- /dev/null +++ b/recipes/boolean-lite/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BooleanLiteConan(ConanFile): + name = "boolean-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/boolean-lite" + description = "boolean lite - A strong boolean type for C++98 and later in a single-file header-only library" + topics = ("boolean-lite", "strong bool", "cpp98/11/17") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "boolean-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::boolean-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "boolean-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "boolean-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["booleanlite"].names["cmake_find_package"] = "boolean-lite" + self.cpp_info.components["booleanlite"].names["cmake_find_package_multi"] = "boolean-lite" + self.cpp_info.components["booleanlite"].set_property("cmake_target_name", "nonstd::boolean-lite") diff --git a/recipes/boolean-lite/all/test_package/CMakeLists.txt b/recipes/boolean-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3c97278b05cc2 --- /dev/null +++ b/recipes/boolean-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(boolean-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::boolean-lite) diff --git a/recipes/boolean-lite/all/test_package/conanfile.py b/recipes/boolean-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/boolean-lite/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/boolean-lite/all/test_package/test_package.cpp b/recipes/boolean-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3a3cc510a6690 --- /dev/null +++ b/recipes/boolean-lite/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include "nonstd/boolean.hpp" +#include + +using nonstd::boolean_; + +void eat_cookies( int count, boolean_ leave_crumbs ) +{ + std::cout << "Eat " << count << " cookies and leave " << (leave_crumbs ? "" : "no ") << "crumbs\n"; +} + +void santa( int num_cookies ) +{ + const boolean_ leave_crumbs( num_cookies > 4 ); + +// eat_cookies( leave_crumbs, num_cookies ); // Does not compile: wrong argument order + eat_cookies( num_cookies, leave_crumbs ); // Ok +} + +int main() +{ + santa( 3 ); + santa( 5 ); +} diff --git a/recipes/boolean-lite/all/test_v1_package/CMakeLists.txt b/recipes/boolean-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b87d5ceee70b7 --- /dev/null +++ b/recipes/boolean-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(boolean-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::boolean-lite) diff --git a/recipes/boolean-lite/all/test_v1_package/conanfile.py b/recipes/boolean-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/boolean-lite/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/boolean-lite/config.yml b/recipes/boolean-lite/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/boolean-lite/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/boolinq/all/conandata.yml b/recipes/boolinq/all/conandata.yml new file mode 100644 index 0000000000000..750c8265f0482 --- /dev/null +++ b/recipes/boolinq/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.0.4": + url: "https://github.com/k06a/boolinq/archive/3.0.4.tar.gz" + sha256: "3cbee2b5f70ad98a8dfd1332dad0554a60628b69acb2477b5f035155fb9aed45" + "3.0.3": + url: "https://github.com/k06a/boolinq/archive/refs/tags/3.0.3.tar.gz" + sha256: "29e9233c07d234f442d58fa5c78a8187b5c28bbb938e38dd805a87ba0e762ed3" + "3.0.2": + url: "https://github.com/k06a/boolinq/archive/3.0.2.tar.gz" + sha256: "ad4c1bac9f4897262564e183d60adb784b86c8d407d7444ce8ac07b5db898356" + "3.0.1": + url: "https://github.com/k06a/boolinq/archive/3.0.1.tar.gz" + sha256: "c72314aed7e43d1c35bf469057d264321599e358f5171d922924873c67b7f1ab" diff --git a/recipes/boolinq/all/conanfile.py b/recipes/boolinq/all/conanfile.py new file mode 100644 index 0000000000000..b9eaad3c63e47 --- /dev/null +++ b/recipes/boolinq/all/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BoolinqConan(ConanFile): + name = "boolinq" + description = "Super tiny C++11 single-file header-only LINQ template library" + topics = ("boolinq", "linq", "header-only") + license = "MIT" + homepage = "https://github.com/k06a/boolinq" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + def build(self): + pass + + 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.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/boolinq/all/test_package/CMakeLists.txt b/recipes/boolinq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bb2f73e7d69ee --- /dev/null +++ b/recipes/boolinq/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(boolinq REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE boolinq::boolinq) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/boolinq/all/test_package/conanfile.py b/recipes/boolinq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/boolinq/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/boolinq/all/test_package/test_package.cpp b/recipes/boolinq/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c8347690765b4 --- /dev/null +++ b/recipes/boolinq/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +int main() { + int src[] = {1,2,3,4,5,6,7,8}; + auto dst = boolinq::from(src).where( [](int a) { return a % 2 == 1; }) + .select([](int a) { return a * 2; }) + .where( [](int a) { return a > 2 && a < 12; }) + .toStdVector(); + + return 0; +} diff --git a/recipes/boolinq/all/test_v1_package/CMakeLists.txt b/recipes/boolinq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cdc0bcf4354a1 --- /dev/null +++ b/recipes/boolinq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(boolinq REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE boolinq::boolinq) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/boolinq/all/test_v1_package/conanfile.py b/recipes/boolinq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/boolinq/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/boolinq/config.yml b/recipes/boolinq/config.yml new file mode 100644 index 0000000000000..ddaa431bd89d8 --- /dev/null +++ b/recipes/boolinq/config.yml @@ -0,0 +1,9 @@ +versions: + "3.0.4": + folder: all + "3.0.3": + folder: all + "3.0.2": + folder: all + "3.0.1": + folder: all diff --git a/recipes/boost-ext-ut/all/conandata.yml b/recipes/boost-ext-ut/all/conandata.yml new file mode 100644 index 0000000000000..81ce02efd2b42 --- /dev/null +++ b/recipes/boost-ext-ut/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.1.8": + url: "https://github.com/boost-ext/ut/archive/v1.1.8.tar.gz" + sha256: "3cc426dcf38397637e889efd9567b06d55dd23fb4e65cc0381eb8103a411d104" + "1.1.9": + url: "https://github.com/boost-ext/ut/archive/v1.1.9.tar.gz" + sha256: "1a666513157905aa0e53a13fac602b5673dcafb04a869100a85cd3f000c2ed0d" +patches: + "1.1.8": + - patch_file: "patches/license.patch" + "1.1.9": + - patch_file: "patches/1.1.9_cmake_project_version.patch" diff --git a/recipes/boost-ext-ut/all/conanfile.py b/recipes/boost-ext-ut/all/conanfile.py new file mode 100644 index 0000000000000..bce6579a06de7 --- /dev/null +++ b/recipes/boost-ext-ut/all/conanfile.py @@ -0,0 +1,120 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.52.0" + + +class UTConan(ConanFile): + name = "boost-ext-ut" + description = ("C++20 single header/single module, " + "macro-free micro Unit Testing Framework") + topics = ("ut", "header-only", "unit-test", "test", "tdd", "bdd") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://boost-ext.github.io/ut/" + license = "BSL-1.0" + settings = "os", "compiler", "arch", "build_type" + no_copy_source = True + options = { "disable_module": [True, False], } + default_options = { "disable_module": False, } + + @property + def _minimum_cpp_standard(self): + return 17 if self.settings.compiler in ["clang", "gcc"] and Version(self.version) <= "1.1.8" else 20 + + @property + def _minimum_compilers_version(self): + return { + "apple-clang": "11" if Version(self.version) < "1.1.8" else "12", + "clang": "9", + "gcc": "9", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if Version(self.version) <= "1.1.8": + del self.options.disable_module + elif is_msvc(self): + self.options.disable_module = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + if Version(self.version) <= "1.1.8" and is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} may not be built with MSVC. " + "Please use at least version 1.1.9 with MSVC.") + + if is_msvc(self): + check_min_vs(self, "192") + if not self.options.get_safe("disable_module", True): + self.output.warn("The 'disable_module' option must be enabled when using MSVC.") + if not is_msvc(self): + min_version = self._minimum_compilers_version.get( + str(self.settings.compiler)) + if not min_version: + self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} " + "compiler support.") + else: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard} support. " + f"The current compiler {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): + tc = CMakeToolchain(self) + tc.cache_variables["BOOST_UT_BUILD_BENCHMARKS"] = False + tc.cache_variables["BOOST_UT_BUILD_EXAMPLES"] = False + tc.cache_variables["BOOST_UT_BUILD_TESTS"] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.cache_variables["PROJECT_DISABLE_VERSION_SUFFIX"] = True + disable_module = self.options.get_safe("disable_module") + if disable_module: + tc.cache_variables["BOOST_UT_DISABLE_MODULE"] = disable_module + 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", "cmake")) + + def package_id(self): + self.info.clear() + + def package_info(self): + newer_than_1_1_8 = Version(self.version) > "1.1.8" + namespace = "Boost" if newer_than_1_1_8 else "boost" + self.cpp_info.set_property("cmake_file_name", "ut") + self.cpp_info.set_property("cmake_target_name", f"{namespace}::ut") + + self.cpp_info.names["cmake_find_package"] = namespace + self.cpp_info.names["cmake_find_package_multi"] = namespace + self.cpp_info.filenames["cmake_find_package"] = "ut" + self.cpp_info.filenames["cmake_find_package_multi"] = "ut" + self.cpp_info.components["ut"].names["cmake_find_package"] = "ut" + self.cpp_info.components["ut"].names["cmake_find_package_multi"] = "ut" + + if newer_than_1_1_8: + self.cpp_info.components["ut"].includedirs = [os.path.join("include", "ut-" + self.version, "include")] + + if self.options.get_safe("disable_module"): + self.cpp_info.components["ut"].defines = ["BOOST_UT_DISABLE_MODULE=1"] diff --git a/recipes/boost-ext-ut/all/patches/1.1.9_cmake_project_version.patch b/recipes/boost-ext-ut/all/patches/1.1.9_cmake_project_version.patch new file mode 100644 index 0000000000000..8d99306e9fb42 --- /dev/null +++ b/recipes/boost-ext-ut/all/patches/1.1.9_cmake_project_version.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b9e94ab..ea96425 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,7 +7,7 @@ + cmake_minimum_required(VERSION 3.12...3.20) + project( + ut +- VERSION 1.1.8 ++ VERSION 1.1.9 + LANGUAGES CXX + ) + diff --git a/recipes/boost-ext-ut/all/patches/license.patch b/recipes/boost-ext-ut/all/patches/license.patch new file mode 100644 index 0000000000000..6a8a3069a851f --- /dev/null +++ b/recipes/boost-ext-ut/all/patches/license.patch @@ -0,0 +1,29 @@ +diff --git a/LICENSE_1_0.txt b/LICENSE_1_0.txt +new file mode 100644 +index 0000000..36b7cd9 +--- /dev/null ++++ b/LICENSE_1_0.txt +@@ -0,0 +1,23 @@ ++Boost Software License - Version 1.0 - August 17th, 2003 ++ ++Permission is hereby granted, free of charge, to any person or organization ++obtaining a copy of the software and accompanying documentation covered by ++this license (the "Software") to use, reproduce, display, distribute, ++execute, and transmit the Software, and to prepare derivative works of the ++Software, and to permit third-parties to whom the Software is furnished to ++do so, all subject to the following: ++ ++The copyright notices in the Software and this entire statement, including ++the above license grant, this restriction and the following disclaimer, ++must be included in all copies of the Software, in whole or in part, and ++all derivative works of the Software, unless such copies or derivative ++works are solely in the form of machine-executable object code generated by ++a source language processor. ++ ++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, TITLE AND NON-INFRINGEMENT. IN NO EVENT ++SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE ++FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ++ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. diff --git a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1f234990a3bc2 --- /dev/null +++ b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(ut REQUIRED CONFIG) + +set(namespace Boost) +if(ut_VERSION VERSION_LESS "1.1.9") + set(namespace boost) +endif() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE "${namespace}::ut") +target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/boost-ext-ut/all/test_package/conanfile.py b/recipes/boost-ext-ut/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cb68885270b30 --- /dev/null +++ b/recipes/boost-ext-ut/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/boost-ext-ut/all/test_package/test_package.cpp b/recipes/boost-ext-ut/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..022560cac7104 --- /dev/null +++ b/recipes/boost-ext-ut/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "boost/ut.hpp" + +int main() { + boost::ut::expect(true); + return 0; +} diff --git a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b3e2caed93a69 --- /dev/null +++ b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ut REQUIRED CONFIG) + +set(namespace Boost) +if(ut_VERSION VERSION_LESS "1.1.9") + set(namespace boost) +endif() + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE "${namespace}::ut") +target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/boost-ext-ut/all/test_v1_package/conanfile.py b/recipes/boost-ext-ut/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..37ada808989d9 --- /dev/null +++ b/recipes/boost-ext-ut/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/boost-ext-ut/config.yml b/recipes/boost-ext-ut/config.yml new file mode 100644 index 0000000000000..968159344a038 --- /dev/null +++ b/recipes/boost-ext-ut/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.8": + folder: "all" + "1.1.9": + folder: "all" diff --git a/recipes/boost-leaf/all/conandata.yml b/recipes/boost-leaf/all/conandata.yml new file mode 100644 index 0000000000000..42c2ccab24961 --- /dev/null +++ b/recipes/boost-leaf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.81.0": + url: "https://github.com/boostorg/leaf/archive/refs/tags/1.81.0.tar.gz" + sha256: "6a2bfa8727891e844f1f95c9c68af192f4c5f53b1707acce54290932118b48c0" diff --git a/recipes/boost-leaf/all/conanfile.py b/recipes/boost-leaf/all/conanfile.py new file mode 100644 index 0000000000000..e655329412639 --- /dev/null +++ b/recipes/boost-leaf/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.50.0" + + +class BoostLEAFConan(ConanFile): + name = "boost-leaf" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/boostorg/leaf" + description = ("Lightweight Error Augmentation Framework") + topics = ("multi-platform", "multi-threading", "cpp11", "error-handling", + "header-only", "low-latency", "no-dependencies", "single-header") + settings = "os", "compiler", "arch", "build_type" + no_copy_source = True + deprecated = "boost" + + def package_id(self): + self.info.clear() + + @property + def _min_cppstd(self): + return "11" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.8", + "Visual Studio": "17", + "msvc": "141", + "clang": "3.9", + "apple-clang": "10.0.0" + } + + def requirements(self): + pass + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + minimum_version = self._compilers_minimum_version.get(compiler, False) + + if minimum_version and lazy_lt_semver(version, minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE_1_0.txt", dst=os.path.join( + self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.hpp", dst=os.path.join(self.package_folder, + "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "boost-leaf") + self.cpp_info.set_property("cmake_target_name", "boost::leaf") + + self.cpp_info.names["cmake_find_package"] = "boost" + self.cpp_info.names["cmake_find_package_multi"] = "boost" + self.cpp_info.filenames["cmake_find_package"] = "boost-leaf" + self.cpp_info.filenames["cmake_find_package_multi"] = "boost-leaf" + self.cpp_info.components["leaf"].names["cmake_find_package"] = "leaf" + self.cpp_info.components["leaf"].names["cmake_find_package_multi"] = "leaf" + + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/boost-leaf/all/test_package/CMakeLists.txt b/recipes/boost-leaf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ca3f81cb32f1b --- /dev/null +++ b/recipes/boost-leaf/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(boost-leaf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} PRIVATE boost::leaf) diff --git a/recipes/boost-leaf/all/test_package/conanfile.py b/recipes/boost-leaf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/boost-leaf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/boost-leaf/all/test_package/main.cpp b/recipes/boost-leaf/all/test_package/main.cpp new file mode 100644 index 0000000000000..b6cf03bce1653 --- /dev/null +++ b/recipes/boost-leaf/all/test_package/main.cpp @@ -0,0 +1,64 @@ +#include +#include + +using namespace boost; + +enum custom_error_t +{ + err1, + err2, + err3, +}; + +leaf::result f1() +{ + return 5; +} + +leaf::result f2() +{ + return 15; +} + +leaf::result g(int a, int b) +{ + int sum = a + b; + if (sum == 20) + { + return leaf::new_error(custom_error_t::err2); + } + return sum; +} + +int main() +{ + leaf::result r = leaf::try_handle_some( + []() -> leaf::result + { + BOOST_LEAF_AUTO(v1, f1()); + BOOST_LEAF_AUTO(v2, f2()); + + return g(v1, v2); + }, + [](leaf::match) -> leaf::result + { + exit(1); + return -1; + }, + [](custom_error_t e) -> leaf::result + { + printf("Error value [%d] handled\n", static_cast(e)); + return 17; + }); + + if (r) + { + printf("value of r = %d\n", r.value()); + } + else + { + printf("r contains an error!\n"); + } + + return 0; +} diff --git a/recipes/boost-leaf/all/test_v1_package/CMakeLists.txt b/recipes/boost-leaf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3b99781525c3c --- /dev/null +++ b/recipes/boost-leaf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(boost-leaf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/main.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} PRIVATE boost::leaf) diff --git a/recipes/boost-leaf/all/test_v1_package/conanfile.py b/recipes/boost-leaf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..25bed518a9fa8 --- /dev/null +++ b/recipes/boost-leaf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class LibhalTestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = ("cmake", "cmake_find_package_multi") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.build_folder, "bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/boost-leaf/config.yml b/recipes/boost-leaf/config.yml new file mode 100644 index 0000000000000..80eea4560f825 --- /dev/null +++ b/recipes/boost-leaf/config.yml @@ -0,0 +1,3 @@ +versions: + "1.81.0": + folder: "all" diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml new file mode 100644 index 0000000000000..2be1304335523 --- /dev/null +++ b/recipes/boost/all/conandata.yml @@ -0,0 +1,325 @@ +sources: + "1.81.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.bz2" + sha256: "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa" + "1.80.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.80.0/boost_1_80_0.tar.bz2" + sha256: "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0" + "1.79.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" + sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" + "1.78.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" + sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc" + "1.77.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" + sha256: "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" + "1.76.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" + sha256: "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41" + "1.75.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2" + sha256: "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb" + "1.74.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" + sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1" + "1.73.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2" + sha256: "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402" + "1.72.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2" + sha256: "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722" + "1.71.0": + url: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" + sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" +patches: + "1.81.0": + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.81.0-locale-fail-on-missing-backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + "1.80.0": + - patch_file: "patches/1.80.0-locale-fail-on-missing-backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch" + patch_description: "Directory iterators may fail to construct for a network share on Windows prior to 10" + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/245" + - patch_file: "patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch" + patch_description: 'On Windows, weakly_canonical fails to process paths that start with the "\\?\" prefix' + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/247" + - patch_file: "patches/1.80.0-0003-unordered-valid-after-move.patch" + patch_description: "Containers are not in a valid state after moving" + patch_type: "official" + patch_source: "https://github.com/boostorg/unordered/issues/139" + - patch_file: "patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch" + patch_description: "On POSIX systems that don't support *at APIs, compilation fails due to a missing include" + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/250" + - patch_file: "patches/1.80.0-0005-config-libcpp15.patch" + patch_description: "Support for libcpp15 which removes std::unary_function and std::binary_function." + patch_type: "portability" + patch_source: "https://www.boost.org/patches/1_80_0/0005-config-libcpp15.patch" + - patch_file: "patches/1.80.0-0006-unordered-msvc-rtcc.patch" + patch_description: "Fix MSVC /RTCc build runtime failures." + patch_type: "official" + patch_source: "https://www.boost.org/patches/1_80_0/0006-unordered-msvc-rtcc.patch" + "1.79.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" + - patch_file: "patches/1.79.0-0001-json-array-erase-relocate.patch" + patch_description: "json::array::erase(it) seg fault on linux" + patch_type: "official" + patch_source: "https://github.com/boostorg/json/issues/692" + - patch_file: "patches/1.79.0-smart_ptr_cw_ppc_msync.patch" + patch_description: "Use msync for PowerPC architectures" + patch_type: "portability" + - patch_file: "patches/1.79.0-geometry_no_rtti.patch" + patch_description: "Fix access specifier preventing use of experimental iterators. Allow more granular control over enabled experimental features." + patch_type: "portability" + patch_source: "https://github.com/boostorg/geometry/discussions/1041" + "1.78.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" + - patch_file: "patches/1.78.0-b2-fix-install.patch" + patch_description: "Don't skip install targets if there's no in ureqs" + patch_type: "official" + patch_source: "https://github.com/boostorg/build/pull/113" + "1.77.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" + - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.76.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.76.0-0001-fix-include-inside-boost-namespace.patch" + patch_description: "Fix #include inside boost namespace" + patch_type: "bugfix" + patch_source: "https://github.com/boostorg/math/pull/670" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.75.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.74.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.73.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.72.0": + - patch_file: "patches/bcp_namespace_issues_1_72.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/0001-revert-cease-dependence-on-range.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_log_filesystem_no_deprecated_1_72.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.71.0": + - patch_file: "patches/bcp_namespace_issues_1_71.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-contract-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py new file mode 100644 index 0000000000000..d845fca4e54da --- /dev/null +++ b/recipes/boost/all/conanfile.py @@ -0,0 +1,1768 @@ +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, to_apple_arch, XCRun +from conan.tools.build import build_jobs, check_min_cppstd, cross_building, valid_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, + get, mkdir, rename, replace_in_file, rm, rmdir, save +) +from conan.tools.gnu import AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuildToolchain, msvc_runtime_flag, VCVars +from conan.tools.scm import Version + +import glob +from io import StringIO +import os +import re +import shlex +import shutil +import sys +import yaml + +required_conan_version = ">=1.53.0" + + +# When adding (or removing) an option, also add this option to the list in +# `rebuild-dependencies.yml` and re-run that script. +CONFIGURE_OPTIONS = ( + "atomic", + "chrono", + "container", + "context", + "contract", + "coroutine", + "date_time", + "exception", + "fiber", + "filesystem", + "graph", + "graph_parallel", + "iostreams", + "json", + "locale", + "log", + "math", + "mpi", + "nowide", + "program_options", + "python", + "random", + "regex", + "serialization", + "stacktrace", + "system", + "test", + "thread", + "timer", + "type_erasure", + "url", + "wave", +) + + +class BoostConan(ConanFile): + name = "boost" + description = "Boost provides free peer-reviewed portable C++ source libraries" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.boost.org" + license = "BSL-1.0" + topics = ("libraries", "cpp") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "error_code_header_only": [True, False], + "system_no_deprecated": [True, False], + "asio_no_deprecated": [True, False], + "filesystem_no_deprecated": [True, False], + "filesystem_use_std_fs": [True, False], + "filesystem_version": [None, "3", "4"], + "layout": ["system", "versioned", "tagged", "b2-default"], + "magic_autolink": [True, False], # enables BOOST_ALL_NO_LIB + "diagnostic_definitions": [True, False], # enables BOOST_LIB_DIAGNOSTIC + "python_executable": [None, "ANY"], # system default python installation is used, if None + "python_version": [None, "ANY"], # major.minor; computed automatically, if None + "namespace": ["ANY"], # custom boost namespace for bcp, e.g. myboost + "namespace_alias": [True, False], # enable namespace alias for bcp, boost=myboost + "multithreading": [True, False], # enables multithreading support + "numa": [True, False], + "zlib": [True, False], + "bzip2": [True, False], + "lzma": [True, False], + "zstd": [True, False], + "segmented_stacks": [True, False], + "debug_level": list(range(0, 14)), + "pch": [True, False], + "extra_b2_flags": [None, "ANY"], # custom b2 flags + "i18n_backend": ["iconv", "icu", None, "deprecated"], + "i18n_backend_iconv": ["libc", "libiconv", "off"], + "i18n_backend_icu": [True, False], + "visibility": ["global", "protected", "hidden"], + "addr2line_location": ["ANY"], + "with_stacktrace_backtrace": [True, False], + "buildid": [None, "ANY"], + "python_buildid": [None, "ANY"], + "system_use_utf8": [True, False], + } + options.update({f"without_{_name}": [True, False] for _name in CONFIGURE_OPTIONS}) + + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "error_code_header_only": False, + "system_no_deprecated": False, + "asio_no_deprecated": False, + "filesystem_no_deprecated": False, + "filesystem_use_std_fs": False, + "filesystem_version": None, + "layout": "system", + "magic_autolink": False, + "diagnostic_definitions": False, + "python_executable": None, + "python_version": None, + "namespace": "boost", + "namespace_alias": False, + "multithreading": True, + "numa": True, + "zlib": True, + "bzip2": True, + "lzma": False, + "zstd": False, + "segmented_stacks": False, + "debug_level": 0, + "pch": True, + "extra_b2_flags": None, + "i18n_backend": "deprecated", + "i18n_backend_iconv": "libc", + "i18n_backend_icu": False, + "visibility": "hidden", + "addr2line_location": "/usr/bin/addr2line", + "with_stacktrace_backtrace": True, + "buildid": None, + "python_buildid": None, + "system_use_utf8": False, + } + default_options.update({f"without_{_name}": False for _name in CONFIGURE_OPTIONS}) + default_options.update({f"without_{_name}": True for _name in ("graph_parallel", "mpi", "python")}) + + short_paths = True + no_copy_source = True + _cached_dependencies = None + + def export(self): + copy(self, f"dependencies/{self._dependency_filename}", src=self.recipe_folder, dst=self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + @property + def _min_compiler_version_default_cxx11(self): + # Minimum compiler version having c++ standard >= 11 + if self.settings.compiler == "apple-clang": + # For now, assume apple-clang will enable c++11 in the distant future + return 99 + return { + "gcc": 6, + "clang": 6, + "Visual Studio": 14, # guess + "msvc": 190, # guess + }.get(str(self.settings.compiler)) + + @property + def _min_compiler_version_nowide(self): + # Nowide needs c++11 + swappable std::fstream + return { + "gcc": 5, + "clang": 5, + "Visual Studio": 14, # guess + "msvc": 190, # guess + }.get(str(self.settings.compiler)) + + @property + def _dependency_filename(self): + return f"dependencies-{self.version}.yml" + + @property + def _dependencies(self): + if self._cached_dependencies is None: + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependency_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException(f"Cannot find {dependencies_filepath}") + with open(dependencies_filepath, encoding='utf-8') as f: + self._cached_dependencies = yaml.safe_load(f) + return self._cached_dependencies + + def _all_dependent_modules(self, name): + dependencies = {name} + while True: + new_dependencies = set() + for dependency in dependencies: + new_dependencies.update(set(self._dependencies["dependencies"][dependency])) + new_dependencies.update(dependencies) + if len(new_dependencies) > len(dependencies): + dependencies = new_dependencies + else: + break + return dependencies + + def _all_super_modules(self, name): + dependencies = {name} + while True: + new_dependencies = set(dependencies) + for module in self._dependencies["dependencies"]: + if dependencies.intersection(set(self._dependencies["dependencies"][module])): + new_dependencies.add(module) + if len(new_dependencies) > len(dependencies): + dependencies = new_dependencies + else: + break + return dependencies + + @property + def _bcp_dir(self): + return "custom-boost" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + @property + def _python_executable(self): + """ + obtain full path to the python interpreter executable + :return: path to the python interpreter executable, either set by option, or system default + """ + exe = self.options.python_executable if self.options.python_executable else sys.executable + return str(exe).replace("\\", "/") + + @property + def _is_windows_platform(self): + return self.settings.os in ["Windows", "WindowsStore", "WindowsCE"] + + @property + def _is_apple_embedded_platform(self): + return self.settings.os in ["iOS", "watchOS", "tvOS"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + # Test whether all config_options from the yml are available in CONFIGURE_OPTIONS + for opt_name in self._configure_options: + if f"without_{opt_name}" not in self.options: + raise ConanException(f"{self._dependency_filename} has the configure options {opt_name} which is not available in conanfile.py") + + # stacktrace_backtrace not supported on Windows + if self.settings.os == "Windows": + del self.options.with_stacktrace_backtrace + + # nowide requires a c++11-able compiler + movable std::fstream: change default to not build on compiler with too old default c++ standard or too low compiler.cppstd + # json requires a c++11-able compiler: change default to not build on compiler with too old default c++ standard or too low compiler.cppstd + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + self.options.without_fiber = True + self.options.without_nowide = True + self.options.without_json = True + self.options.without_url = True + else: + version_cxx11_standard_json = self._min_compiler_version_default_cxx11 + if version_cxx11_standard_json: + if Version(self.settings.compiler.version) < version_cxx11_standard_json: + self.options.without_fiber = True + self.options.without_json = True + self.options.without_nowide = True + self.options.without_url = True + else: + self.options.without_fiber = True + self.options.without_json = True + self.options.without_nowide = True + self.options.without_url = True + + # iconv is off by default on Windows and Solaris + if self._is_windows_platform or self.settings.os == "SunOS": + self.options.i18n_backend_iconv = "off" + elif is_apple_os(self): + self.options.i18n_backend_iconv = "libiconv" + elif self.settings.os == "Android": + # bionic provides iconv since API level 28 + api_level = self.settings.get_safe("os.api_level") + if api_level and Version(api_level) < "28": + self.options.i18n_backend_iconv = "libiconv" + + # Remove options not supported by this version of boost + for dep_name in CONFIGURE_OPTIONS: + if dep_name not in self._configure_options: + delattr(self.options, f"without_{dep_name}") + + 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() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif Version(self.settings.compiler.version) < min_compiler_version: + disable_math() + + if Version(self.version) >= "1.79.0": + # Starting from 1.79.0, Boost.Wave requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_wave(): + super_modules = self._all_super_modules("wave") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_wave() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif Version(self.settings.compiler.version) < min_compiler_version: + disable_wave() + + if Version(self.version) >= "1.81.0": + # Starting from 1.81.0, Boost.Locale requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_locale(): + super_modules = self._all_super_modules("locale") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_locale() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif Version(self.settings.compiler.version) < min_compiler_version: + disable_locale() + + @property + def _configure_options(self): + return self._dependencies["configure_options"] + + @property + def _fPIC(self): + return self.options.get_safe("fPIC", self.default_options["fPIC"]) + + @property + def _shared(self): + return self.options.get_safe("shared", self.default_options["shared"]) + + @property + def _stacktrace_addr2line_available(self): + if (self._is_apple_embedded_platform or self.settings.get_safe("os.subsystem") == "catalyst"): + # sandboxed environment - cannot launch external processes (like addr2line), system() function is forbidden + return False + return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + + def configure(self): + if self.options.header_only: + self.options.rm_safe("shared") + self.options.rm_safe("fPIC") + elif self.options.shared: + self.options.rm_safe("fPIC") + + if self.options.i18n_backend != "deprecated": + self.output.warning("i18n_backend option is deprecated, do not use anymore.") + if self.options.i18n_backend == "iconv": + self.options.i18n_backend_iconv = "libiconv" + self.options.i18n_backend_icu = False + if self.options.i18n_backend == "icu": + self.options.i18n_backend_iconv = "off" + self.options.i18n_backend_icu = True + if self.options.i18n_backend == "None": + self.options.i18n_backend_iconv = "off" + self.options.i18n_backend_icu = False + if self.options.without_locale: + self.options.rm_safe("i18n_backend_iconv") + self.options.rm_safe("i18n_backend_icu") + + if not self.options.without_python: + if not self.options.python_version: + self.options.python_version = self._detect_python_version() + self.options.python_executable = self._python_executable + else: + self.options.rm_safe("python_buildid") + + if not self._stacktrace_addr2line_available: + self.options.rm_safe("addr2line_location") + + if self.options.get_safe("without_stacktrace", True): + self.options.rm_safe("with_stacktrace_backtrace") + + if self.options.layout == "b2-default": + self.options.layout = "versioned" if self.settings.os == "Windows" else "system" + + if self.options.without_fiber: + self.options.rm_safe("numa") + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _cxx11_boost_libraries(self): + libraries = ["fiber", "json", "nowide", "url"] + if Version(self.version) >= "1.76.0": + libraries.append("math") + if Version(self.version) >= "1.79.0": + libraries.append("wave") + if Version(self.version) >= "1.81.0": + libraries.append("locale") + libraries.sort() + return filter(lambda library: f"without_{library}" in self.options, libraries) + + def validate(self): + if not self.options.multithreading: + # * For the reason 'thread' is deactivate look at https://stackoverflow.com/a/20991533 + # Look also on the comments of the answer for more details + # * Although the 'context' and 'atomic' library does not mention anything about threading, + # when being build the compiler uses the -pthread flag, which makes it quite dangerous + for lib in ["locale", "coroutine", "wave", "type_erasure", "fiber", "thread", "context", "atomic"]: + if not self.options.get_safe(f"without_{lib}"): + raise ConanInvalidConfiguration(f"Boost '{lib}' library requires multi threading") + + if is_msvc(self) and self._shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Boost can not be built as shared library with MT runtime.") + + if not self.options.without_locale and self.options.i18n_backend_iconv == "off" and \ + not self.options.i18n_backend_icu and not self._is_windows_platform: + raise ConanInvalidConfiguration( + "Boost.Locale library needs either iconv or ICU library to be built on non windows platforms" + ) + + if self._stacktrace_addr2line_available: + if not os.path.isabs(str(self.options.addr2line_location)): + raise ConanInvalidConfiguration("addr2line_location must be an absolute path to addr2line") + + # Check, when a boost module is enabled, whether the boost modules it depends on are enabled as well. + for mod_name, mod_deps in self._dependencies["dependencies"].items(): + if not self.options.get_safe(f"without_{mod_name}", True): + for mod_dep in mod_deps: + if self.options.get_safe(f"without_{mod_dep}", False): + raise ConanInvalidConfiguration(f"{mod_name} requires {mod_deps}: {mod_dep} is disabled") + + if not self.options.get_safe("without_nowide", True): + # nowide require a c++11-able compiler with movable std::fstream + mincompiler_version = self._min_compiler_version_nowide + if mincompiler_version and Version(self.settings.compiler.version) < mincompiler_version: + raise ConanInvalidConfiguration("This compiler is too old to build Boost.nowide.") + + 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: + version_cxx11_standard = self._min_compiler_version_default_cxx11 + if version_cxx11_standard and Version(self.settings.compiler.version) < version_cxx11_standard: + raise ConanInvalidConfiguration( + f"Boost.{{{','.join(self._cxx11_boost_libraries)}}} requires a c++11 compiler " + "(please set compiler.cppstd or use a newer compiler)" + ) + + def _with_dependency(self, dependency): + """ + Return true when dependency is required according to the dependencies-x.y.z.yml file + """ + for name, reqs in self._dependencies["requirements"].items(): + if dependency in reqs: + if not self.options.get_safe(f"without_{name}", True): + return True + return False + + @property + def _with_zlib(self): + return not self.options.header_only and self._with_dependency("zlib") and self.options.zlib + + @property + def _with_bzip2(self): + return not self.options.header_only and self._with_dependency("bzip2") and self.options.bzip2 + + @property + def _with_lzma(self): + return not self.options.header_only and self._with_dependency("lzma") and self.options.lzma + + @property + def _with_zstd(self): + return not self.options.header_only and self._with_dependency("zstd") and self.options.zstd + + @property + def _with_icu(self): + return not self.options.header_only and self._with_dependency("icu") and self.options.get_safe("i18n_backend_icu") + + @property + def _with_iconv(self): + return not self.options.header_only and self._with_dependency("iconv") and self.options.get_safe("i18n_backend_iconv") == "libiconv" + + @property + def _with_stacktrace_backtrace(self): + return not self.options.header_only and self.options.get_safe("with_stacktrace_backtrace", False) + + def requirements(self): + if self._with_zlib: + self.requires("zlib/1.2.13") + if self._with_bzip2: + self.requires("bzip2/1.0.8") + if self._with_lzma: + self.requires("xz_utils/5.4.2") + if self._with_zstd: + self.requires("zstd/1.5.5") + if self._with_stacktrace_backtrace: + self.requires("libbacktrace/cci.20210118", transitive_headers=True, transitive_libs=True) + + if self._with_icu: + self.requires("icu/72.1") + if self._with_iconv: + self.requires("libiconv/1.17") + + def package_id(self): + del self.info.options.i18n_backend + + if self.info.options.header_only: + self.info.clear() + else: + del self.info.options.debug_level + del self.info.options.filesystem_version + del self.info.options.pch + del self.info.options.python_executable # PATH to the interpreter is not important, only version matters + if self.info.options.without_python: + del self.info.options.python_version + + def build_requirements(self): + if not self.options.header_only: + self.tool_requires("b2/4.9.6") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + apply_conandata_patches(self) + + def generate(self): + if not self.options.header_only: + env = VirtualBuildEnv(self) + env.generate() + vc = VCVars(self) + vc.generate() + + ##################### BUILDING METHODS ########################### + + def _run_python_script(self, script): + """ + execute python one-liner script and return its output + :param script: string containing python script to be executed + :return: output of the python script execution, or None, if script has failed + """ + output = StringIO() + command = f'"{self._python_executable}" -c "{script}"' + self.output.info(f"running {command}") + try: + self.run(command, output, scope="run") + except ConanException: + self.output.info("(failed)") + return None + output = output.getvalue() + # Conan is broken when run_to_output = True + if "\n-----------------\n" in output: + output = output.split("\n-----------------\n", 1)[1] + output = output.strip() + return output if output != "None" else None + + def _get_python_path(self, name): + """ + obtain path entry for the python installation + :param name: name of the python config entry for path to be queried (such as "include", "platinclude", etc.) + :return: path entry from the sysconfig + """ + # https://docs.python.org/3/library/sysconfig.html + # https://docs.python.org/2.7/library/sysconfig.html + return self._run_python_script("from __future__ import print_function; " + "import sysconfig; " + f"print(sysconfig.get_path('{name}'))") + + def _get_python_sc_var(self, name): + """ + obtain value of python sysconfig variable + :param name: name of variable to be queried (such as LIBRARY or LDLIBRARY) + :return: value of python sysconfig variable + """ + return self._run_python_script("from __future__ import print_function; " + "import sysconfig; " + f"print(sysconfig.get_config_var('{name}'))") + + def _get_python_du_var(self, name): + """ + obtain value of python distutils sysconfig variable + (sometimes sysconfig returns empty values, while python.sysconfig provides correct values) + :param name: name of variable to be queried (such as LIBRARY or LDLIBRARY) + :return: value of python sysconfig variable + """ + return self._run_python_script("from __future__ import print_function; " + "import distutils.sysconfig as du_sysconfig; " + f"print(du_sysconfig.get_config_var('{name}'))") + + def _get_python_var(self, name): + """ + obtain value of python variable, either by sysconfig, or by distutils.sysconfig + :param name: name of variable to be queried (such as LIBRARY or LDLIBRARY) + :return: value of python sysconfig variable + + NOTE: distutils is deprecated and breaks the recipe since Python 3.10 + """ + python_version_parts = str(self.info.options.python_version).split('.') + python_major = int(python_version_parts[0]) + python_minor = int(python_version_parts[1]) + if(python_major >= 3 and python_minor >= 10): + return self._get_python_sc_var(name) + + return self._get_python_sc_var(name) or self._get_python_du_var(name) + + def _detect_python_version(self): + """ + obtain version of python interpreter + :return: python interpreter version, in format major.minor + """ + return self._run_python_script("from __future__ import print_function; " + "import sys; " + "print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))") + + @property + def _python_version(self): + version = self._detect_python_version() + if self.options.python_version and version != self.options.python_version: + raise ConanInvalidConfiguration(f"detected python version {version} doesn't match conan option {self.options.python_version}") + return version + + @property + def _python_inc(self): + """ + obtain the result of the "sysconfig.get_python_inc()" call + :return: result of the "sysconfig.get_python_inc()" execution + """ + return self._run_python_script("from __future__ import print_function; " + "import sysconfig; " + "print(sysconfig.get_python_inc())") + + @property + def _python_abiflags(self): + """ + obtain python ABI flags, see https://www.python.org/dev/peps/pep-3149/ for the details + :return: the value of python ABI flags + """ + return self._run_python_script("from __future__ import print_function; " + "import sys; " + "print(getattr(sys, 'abiflags', ''))") + + @property + def _python_includes(self): + """ + attempt to find directory containing Python.h header file + :return: the directory with python includes + """ + include = self._get_python_path("include") + plat_include = self._get_python_path("platinclude") + include_py = self._get_python_var("INCLUDEPY") + include_dir = self._get_python_var("INCLUDEDIR") + python_inc = self._python_inc + + candidates = [include, + plat_include, + include_py, + include_dir, + python_inc] + for candidate in candidates: + if candidate: + python_h = os.path.join(candidate, 'Python.h') + self.output.info(f"checking {python_h}") + if os.path.isfile(python_h): + self.output.info(f"found Python.h: {python_h}") + return candidate.replace("\\", "/") + raise Exception("couldn't locate Python.h - make sure you have installed python development files") + + @property + def _python_library_dir(self): + """ + attempt to find python development library + :return: the full path to the python library to be linked with + """ + library = self._get_python_var("LIBRARY") + ldlibrary = self._get_python_var("LDLIBRARY") + libdir = self._get_python_var("LIBDIR") + multiarch = self._get_python_var("MULTIARCH") + masd = self._get_python_var("multiarchsubdir") + with_dyld = self._get_python_var("WITH_DYLD") + if libdir and multiarch and masd and not libdir.endswith(masd): + if masd.startswith(os.sep): + masd = masd[len(os.sep):] + self.output.warning(f"Python libdir candidate thingy: {libdir}") + libdir = os.path.join(libdir, masd) + + if not libdir: + libdest = self._get_python_var("LIBDEST") + libdir = os.path.join(os.path.dirname(libdest), "libs") + + candidates = [ldlibrary, library] + library_prefixes = [""] if is_msvc(self) else ["", "lib"] + library_suffixes = [".lib"] if is_msvc(self) else [".so", ".dll.a", ".a"] + if with_dyld: + library_suffixes.insert(0, ".dylib") + + python_version = self._python_version + python_version_no_dot = python_version.replace(".", "") + versions = ["", python_version, python_version_no_dot] + abiflags = self._python_abiflags + + for prefix in library_prefixes: + for suffix in library_suffixes: + for version in versions: + candidates.append(f"{prefix}python{version}{abiflags}{suffix}") + + for candidate in candidates: + if candidate: + python_lib = os.path.join(libdir, candidate) + self.output.info(f"checking {python_lib}") + if os.path.isfile(python_lib): + self.output.info(f"found python library: {python_lib}") + return libdir.replace("\\", "/") + raise ConanInvalidConfiguration("couldn't locate python libraries - make sure you have installed python development files") + + def _clean(self): + clean_dirs = [ + os.path.join(self.build_folder, "bin.v2"), + os.path.join(self.build_folder, "architecture"), + os.path.join(self.source_folder, self._bcp_dir), + os.path.join(self.source_folder, "dist", "bin"), + os.path.join(self.source_folder, "stage"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bootstrap"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bin.ntx86"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bin.ntx86_64"), + ] + for d in clean_dirs: + if os.path.isdir(d): + self.output.warning(f"removing '{d}'") + shutil.rmtree(d) + + @property + def _b2_exe(self): + return "b2" + + @property + def _bcp_exe(self): + folder = os.path.join(self.source_folder, "dist", "bin") + return os.path.join(folder, "bcp") + + @property + def _use_bcp(self): + return self.options.namespace != "boost" + + @property + def _boost_build_dir(self): + return os.path.join(self.source_folder, "tools", "build") + + def _build_bcp(self): + folder = os.path.join(self.source_folder, "tools", "bcp") + with chdir(self, folder): + command = f"{self._b2_exe} -j{build_jobs(self)} --abbreviate-paths toolset={self._toolset}" + command += f" -d{self.options.debug_level}" + self.output.warning(command) + self.run(command) + + def _run_bcp(self): + with chdir(self, self.source_folder): + mkdir(self, self._bcp_dir) + namespace = f"--namespace={self.options.namespace}" + alias = "--namespace-alias" if self.options.namespace_alias else "" + boostdir = f"--boost={self.source_folder}" + libraries = {"build", "boost-build.jam", "boostcpp.jam", "boost_install", "headers"} + for d in os.listdir(os.path.join(self.source_folder, "boost")): + if os.path.isdir(os.path.join(self.source_folder, "boost", d)): + libraries.add(d) + for d in os.listdir(os.path.join(self.source_folder, "libs")): + if os.path.isdir(os.path.join(self.source_folder, "libs", d)): + libraries.add(d) + libraries = " ".join(libraries) + command = f"{self._bcp_exe} {namespace} {alias} {boostdir} {libraries} {self._bcp_dir}" + self.output.warning(command) + self.run(command) + + def build(self): + stacktrace_jamfile = os.path.join(self.source_folder, "libs", "stacktrace", "build", "Jamfile.v2") + if cross_building(self, skip_x64_x86=True): + # When cross building, do not attempt to run the test-executable (assume they work) + replace_in_file(self, stacktrace_jamfile, "$(>) > $(<)", "echo \"\" > $(<)", strict=False) + if self._with_stacktrace_backtrace and self.settings.os != "Windows" and not cross_building(self): + # When libbacktrace is shared, give extra help to the test-executable + linker_var = "DYLD_LIBRARY_PATH" if self.settings.os == "Macos" else "LD_LIBRARY_PATH" + libbacktrace_libdir = self.dependencies["libbacktrace"].cpp_info.aggregated_components().libdirs[0] + patched_run_rule = f"{linker_var}={libbacktrace_libdir} $(>) > $(<)" + replace_in_file(self, stacktrace_jamfile, "$(>) > $(<)", patched_run_rule, strict=False) + if self.dependencies["libbacktrace"].options.shared: + replace_in_file(self, stacktrace_jamfile, "static", "shared", strict=False) + + # Older clang releases require a thread_local variable to be initialized by a constant value + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "/* thread_local */", "thread_local", strict=False) + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "/* static __thread */", "static __thread", strict=False) + if self.settings.compiler == "apple-clang" or (self.settings.compiler == "clang" and Version(self.settings.compiler.version) < 6): + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "thread_local", "/* thread_local */") + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "static __thread", "/* static __thread */") + replace_in_file(self, os.path.join(self.source_folder, "tools", "build", "src", "tools", "gcc.jam"), + "local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;", + "local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux iphone appletv ] ;", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "tools", "build", "src", "tools", "gcc.jam"), + "local no-threading = android beos haiku sgi darwin vxworks ;", + "local no-threading = android beos haiku sgi darwin vxworks iphone appletv ;", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "libs", "fiber", "build", "Jamfile.v2"), + " @numa", + " shared:.//boost_fiber : @numa", + strict=False) + if self.settings.os == "Android": + # force versionless soname from boostorg/boost#206 + # this can be applied to all versions and it's easier with a replace + replace_in_file(self, os.path.join(self.source_folder, "boostcpp.jam"), + "! [ $(property-set).get ] in windows cygwin darwin aix &&", + "! [ $(property-set).get ] in windows cygwin darwin aix android &&", + strict=False) + + if self.options.header_only: + self.output.warning("Header only package, skipping build") + return + + self._clean() + + if self._use_bcp: + self._build_bcp() + self._run_bcp() + + self._create_user_config_jam(self._boost_build_dir) + + # JOIN ALL FLAGS + b2_flags = " ".join(self._build_flags) + full_command = f"{self._b2_exe} {b2_flags}" + # -d2 is to print more debug info and avoid travis timing out without output + sources = os.path.join(self.source_folder, self._bcp_dir) if self._use_bcp else self.source_folder + full_command += f' --debug-configuration --build-dir="{self.build_folder}"' + self.output.warning(full_command) + + # If sending a user-specified toolset to B2, setting the vcvars + # interferes with the compiler selection. + with chdir(self, sources): + # To show the libraries *1 + # self.run("%s --show-libraries" % b2_exe) + self.run(full_command) + + @property + def _b2_os(self): + return { + "Windows": "windows", + "WindowsStore": "windows", + "Linux": "linux", + "Android": "android", + "Macos": "darwin", + "iOS": "iphone", + "watchOS": "iphone", + "tvOS": "appletv", + "FreeBSD": "freebsd", + "SunOS": "solaris", + }.get(str(self.settings.os)) + + @property + def _b2_address_model(self): + if self.settings.arch in ("x86_64", "ppc64", "ppc64le", "mips64", "armv8", "armv8.3", "sparcv9"): + return "64" + + return "32" + + @property + def _b2_binary_format(self): + return { + "Windows": "pe", + "WindowsStore": "pe", + "Linux": "elf", + "Android": "elf", + "Macos": "mach-o", + "iOS": "mach-o", + "watchOS": "mach-o", + "tvOS": "mach-o", + "FreeBSD": "elf", + "SunOS": "elf", + }.get(str(self.settings.os)) + + @property + def _b2_architecture(self): + if str(self.settings.arch).startswith("x86"): + return "x86" + if str(self.settings.arch).startswith("ppc"): + return "power" + if str(self.settings.arch).startswith("arm"): + return "arm" + if str(self.settings.arch).startswith("sparc"): + return "sparc" + if str(self.settings.arch).startswith("mips64"): + return "mips64" + if str(self.settings.arch).startswith("mips"): + return "mips1" + if str(self.settings.arch).startswith("s390"): + return "s390x" + + return None + + @property + def _b2_abi(self): + if str(self.settings.arch).startswith("x86"): + return "ms" if str(self.settings.os) in ["Windows", "WindowsStore"] else "sysv" + if str(self.settings.arch).startswith("ppc"): + return "sysv" + if str(self.settings.arch).startswith("arm"): + return "aapcs" + if str(self.settings.arch).startswith("mips"): + return "o32" + + return None + + @property + def _gnu_cxx11_abi(self): + """Checks libcxx setting and returns value for the GNU C++11 ABI flag + _GLIBCXX_USE_CXX11_ABI= . Returns None if C++ library cannot be + determined. + """ + try: + if str(self.settings.compiler.libcxx) == "libstdc++": + return "0" + if str(self.settings.compiler.libcxx) == "libstdc++11": + return "1" + except ConanException: + pass + return None + + @property + def _build_flags(self): + flags = self._build_cross_flags + + # Stop at the first error. No need to continue building. + flags.append("-q") + + if self.options.get_safe("numa"): + flags.append("numa=on") + + # https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/architectures.html + if not self._is_apple_embedded_platform and self._b2_os: + flags.append(f"target-os={self._b2_os}") + if self._b2_architecture: + flags.append(f"architecture={self._b2_architecture}") + if self._b2_address_model: + flags.append(f"address-model={self._b2_address_model}") + if self._b2_binary_format: + flags.append(f"binary-format={self._b2_binary_format}") + if self._b2_abi: + flags.append(f"abi={self._b2_abi}") + + flags.append(f"--layout={self.options.layout}") + flags.append(f"--user-config={os.path.join(self._boost_build_dir, 'user-config.jam')}") + flags.append(f"-sNO_ZLIB={'0' if self._with_zlib else '1'}") + flags.append(f"-sNO_BZIP2={'0' if self._with_bzip2 else '1'}") + flags.append(f"-sNO_LZMA={'0' if self._with_lzma else '1'}") + flags.append(f"-sNO_ZSTD={'0' if self._with_zstd else '1'}") + + if self.options.get_safe("i18n_backend_icu"): + flags.append("boost.locale.icu=on") + else: + flags.append("boost.locale.icu=off") + flags.append("--disable-icu") + if self.options.get_safe("i18n_backend_iconv") in ["libc", "libiconv"]: + flags.append("boost.locale.iconv=on") + if self.options.get_safe("i18n_backend_iconv") == "libc": + flags.append("boost.locale.iconv.lib=libc") + else: + flags.append("boost.locale.iconv.lib=libiconv") + else: + flags.append("boost.locale.iconv=off") + flags.append("--disable-iconv") + + def add_defines(library): + for define in self.dependencies[library].cpp_info.aggregated_components().defines: + flags.append(f"define={define}") + + if self._with_zlib: + add_defines("zlib") + if self._with_bzip2: + add_defines("bzip2") + if self._with_lzma: + add_defines("xz_utils") + if self._with_zstd: + add_defines("zstd") + + if is_msvc(self): + flags.append(f"runtime-link={'static' if is_msvc_static_runtime(self) else 'shared'}") + flags.append(f"runtime-debugging={'on' if 'd' in msvc_runtime_flag(self) else 'off'}") + + # For details https://boostorg.github.io/build/manual/master/index.html + flags.append(f"threading={'single' if not self.options.multithreading else 'multi'}") + flags.append(f"visibility={self.options.visibility}") + + flags.append(f"link={'shared' if self._shared else 'static'}") + if self.settings.build_type == "Debug": + flags.append("variant=debug") + else: + flags.append("variant=release") + + for libname in self._configure_options: + if not getattr(self.options, f"without_{libname}"): + flags.append(f"--with-{libname}") + + flags.append(f"toolset={self._toolset}") + + if self.settings.get_safe("compiler.cppstd"): + cppstd_flag = AutotoolsToolchain(self).cppstd + flags.append(f"cxxflags={cppstd_flag}") + + # LDFLAGS + link_flags = [] + + # CXX FLAGS + cxx_flags = [] + # fPIC DEFINITION + if self._fPIC: + cxx_flags.append("-fPIC") + if self.settings.build_type == "RelWithDebInfo": + if self.settings.compiler == "gcc" or "clang" in str(self.settings.compiler): + cxx_flags.append("-g") + elif is_msvc(self): + cxx_flags.append("/Z7") + + # Standalone toolchain fails when declare the std lib + if self.settings.os not in ("Android", "Emscripten"): + try: + if self._gnu_cxx11_abi: + flags.append(f"define=_GLIBCXX_USE_CXX11_ABI={self._gnu_cxx11_abi}") + + if self.settings.compiler in ("clang", "apple-clang"): + libcxx = { + "libstdc++11": "libstdc++", + }.get(str(self.settings.compiler.libcxx), str(self.settings.compiler.libcxx)) + cxx_flags.append(f"-stdlib={libcxx}") + link_flags.append(f"-stdlib={libcxx}") + except ConanException: + pass + + if self.options.error_code_header_only: + flags.append("define=BOOST_ERROR_CODE_HEADER_ONLY=1") + if self.options.system_no_deprecated: + flags.append("define=BOOST_SYSTEM_NO_DEPRECATED=1") + if self.options.asio_no_deprecated: + flags.append("define=BOOST_ASIO_NO_DEPRECATED=1") + if self.options.filesystem_no_deprecated: + flags.append("define=BOOST_FILESYSTEM_NO_DEPRECATED=1") + if self.options.filesystem_use_std_fs: + flags.append("define=BOOST_DLL_USE_STD_FS=1") + if self.options.system_use_utf8: + flags.append("define=BOOST_SYSTEM_USE_UTF8=1") + if self.options.segmented_stacks: + flags.extend(["segmented-stacks=on", + "define=BOOST_USE_SEGMENTED_STACKS=1", + "define=BOOST_USE_UCONTEXT=1"]) + flags.append("pch=on" if self.options.pch else "pch=off") + + if is_apple_os(self): + apple_min_version_flag = AutotoolsToolchain(self).apple_min_version_flag + if apple_min_version_flag: + cxx_flags.append(apple_min_version_flag) + link_flags.append(apple_min_version_flag) + os_subsystem = self.settings.get_safe("os.subsystem") + if os_subsystem == "catalyst": + cxx_flags.append("--target=arm64-apple-ios-macabi") + link_flags.append("--target=arm64-apple-ios-macabi") + + if self.settings.os == "iOS": + if self.options.multithreading: + cxx_flags.append("-DBOOST_SP_USE_SPINLOCK") + + if self.conf.get("tools.apple:enable_bitcode", check_type=bool): + cxx_flags.append("-fembed-bitcode") + if self._with_stacktrace_backtrace: + flags.append(f"-sLIBBACKTRACE_PATH={self.dependencies['libbacktrace'].package_folder}") + if self._with_iconv: + flags.append(f"-sICONV_PATH={self.dependencies['libiconv'].package_folder}") + if self._with_icu: + flags.append(f"-sICU_PATH={self.dependencies['icu'].package_folder}") + if not self.dependencies["icu"].options.shared: + # Using ICU_OPTS to pass ICU system libraries is not possible due to Boost.Regex disallowing it. + icu_system_libs = self.dependencies["icu"].cpp_info.aggregated_components().system_libs + if is_msvc(self): + icu_ldflags = " ".join(f"{l}.lib" for l in icu_system_libs) + else: + icu_ldflags = " ".join(f"-l{l}" for l in icu_system_libs) + link_flags.append(icu_ldflags) + + link_flags = f'linkflags="{" ".join(link_flags)}"' + flags.append(link_flags) + + if self.options.get_safe("addr2line_location"): + cxx_flags.append(f"-DBOOST_STACKTRACE_ADDR2LINE_LOCATION={self.options.addr2line_location}") + + cxx_flags = f'cxxflags="{" ".join(cxx_flags)}"' + flags.append(cxx_flags) + + if self.options.buildid: + flags.append(f"--buildid={self.options.buildid}") + if not self.options.without_python and self.options.python_buildid: + flags.append(f"--python-buildid={self.options.python_buildid}") + + if self.options.extra_b2_flags: + flags.extend(shlex.split(str(self.options.extra_b2_flags))) + + flags.extend([ + "install", + f"--prefix={self.package_folder}", + f"-j{build_jobs(self)}", + "--abbreviate-paths", + f"-d{self.options.debug_level}", + ]) + return flags + + @property + def _build_cross_flags(self): + flags = [] + if not cross_building(self): + return flags + arch = self.settings.get_safe("arch") + self.output.info("Cross building, detecting compiler...") + + if arch.startswith("arm"): + if "hf" in arch: + flags.append("-mfloat-abi=hard") + elif self.settings.os == "Emscripten": + pass + elif arch in ["x86", "x86_64"]: + pass + elif arch.startswith("ppc"): + pass + elif arch.startswith("mips"): + pass + else: + self.output.warning(f"Unable to detect the appropriate ABI for {arch} architecture.") + self.output.info(f"Cross building flags: {flags}") + + return flags + + @property + def _ar(self): + ar = VirtualBuildEnv(self).vars().get("AR") + if ar: + return ar + if is_apple_os(self) and self.settings.compiler == "apple-clang": + return XCRun(self).ar + return None + + @property + def _ranlib(self): + ranlib = VirtualBuildEnv(self).vars().get("RANLIB") + if ranlib: + return ranlib + if is_apple_os(self) and self.settings.compiler == "apple-clang": + return XCRun(self).ranlib + return None + + @property + def _cxx(self): + compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + cxx = compilers_by_conf.get("cpp") or VirtualBuildEnv(self).vars().get("CXX") + if cxx: + return cxx + if is_apple_os(self) and self.settings.compiler == "apple-clang": + return XCRun(self).cxx + compiler_version = str(self.settings.compiler.version) + major = compiler_version.split(".", maxsplit=1)[0] + if self.settings.compiler == "gcc": + return shutil.which(f"g++-{compiler_version}") or shutil.which(f"g++-{major}") or shutil.which("g++") or "" + if self.settings.compiler == "clang": + return shutil.which(f"clang++-{compiler_version}") or shutil.which(f"clang++-{major}") or shutil.which("clang++") or "" + return "" + + def _create_user_config_jam(self, folder): + self.output.warning("Patching user-config.jam") + + def create_library_config(deps_name, name): + aggregated_cpp_info = self.dependencies[deps_name].cpp_info.aggregated_components() + includedir = aggregated_cpp_info.includedirs[0].replace("\\", "/") + includedir = f"\"{includedir}\"" + libdir = aggregated_cpp_info.libdirs[0].replace("\\", "/") + libdir = f"\"{libdir}\"" + lib = aggregated_cpp_info.libs[0] + version = self.dependencies[deps_name].ref.version + return f"\nusing {name} : {version} : " \ + f"{includedir} " \ + f"{libdir} " \ + f"{lib} ;" + + contents = "" + + if self._with_zlib: + contents += create_library_config("zlib", "zlib") + if self._with_bzip2: + contents += create_library_config("bzip2", "bzip2") + if self._with_lzma: + contents += create_library_config("xz_utils", "lzma") + if self._with_zstd: + contents += create_library_config("zstd", "zstd") + + if not self.options.without_python: + # https://www.boost.org/doc/libs/1_70_0/libs/python/doc/html/building/configuring_boost_build.html + contents += f'\nusing python : {self._python_version} : "{self._python_executable}" : "{self._python_includes}" : "{self._python_library_dir}" ;' + + if not self.options.without_mpi: + # https://www.boost.org/doc/libs/1_72_0/doc/html/mpi/getting_started.html + contents += "\nusing mpi ;" + + # Specify here the toolset with the binary if present if don't empty parameter : + contents += f'\nusing "{self._toolset}" : {self._toolset_version} : ' + + cxx_fwd_slahes = self._cxx.replace("\\", "/") + if cxx_fwd_slahes: + contents += f" \"{cxx_fwd_slahes}\"" + + if is_apple_os(self): + if self.settings.compiler == "apple-clang": + contents += f" -isysroot {XCRun(self).sdk_path}" + if self.settings.get_safe("arch"): + contents += f" -arch {to_apple_arch(self)}" + + contents += " : \n" + if self._ar: + ar_path = self._ar.replace("\\", "/") + contents += f'"{ar_path}" ' + if self._ranlib: + ranlib_path = self._ranlib.replace("\\", "/") + contents += f'"{ranlib_path}" ' + cxxflags = " ".join(self.conf.get("tools.build:cxxflags", default=[], check_type=list)) + " " + cflags = " ".join(self.conf.get("tools.build:cflags", default=[], check_type=list)) + " " + buildenv_vars = VirtualBuildEnv(self).vars() + cppflags = buildenv_vars.get("CPPFLAGS", "") + " " + ldflags = " ".join(self.conf.get("tools.build:sharedlinkflags", default=[], check_type=list)) + " " + asflags = buildenv_vars.get("ASFLAGS", "") + " " + + sysroot = self.conf.get("tools.build:sysroot") + if sysroot and not is_msvc(self): + sysroot = sysroot.replace("\\", "/") + sysroot = f'"{sysroot}"' if ' ' in sysroot else sysroot + cppflags += f"--sysroot={sysroot} " + ldflags += f"--sysroot={sysroot} " + + if self._with_stacktrace_backtrace: + backtrace_aggregated_cpp_info = self.dependencies["libbacktrace"].cpp_info.aggregated_components() + cppflags += " ".join(f"-I{p}" for p in backtrace_aggregated_cpp_info.includedirs) + " " + ldflags += " ".join(f"-L{p}" for p in backtrace_aggregated_cpp_info.libdirs) + " " + + if cxxflags.strip(): + contents += f'"{cxxflags.strip()}" ' + if cflags.strip(): + contents += f'"{cflags.strip()}" ' + if cppflags.strip(): + contents += f'"{cppflags.strip()}" ' + if ldflags.strip(): + contents += f'"{ldflags.strip()}" ' + if asflags.strip(): + contents += f'"{asflags.strip()}" ' + + if self._is_apple_embedded_platform: + contents += f'"{self._b2_os}" ' + + contents += " ;" + + self.output.warning(contents) + filename = f"{folder}/user-config.jam" + save(self, filename, contents) + + @property + def _toolset_version(self): + toolset = MSBuildToolchain(self).toolset + if toolset: + match = re.match(r"v(\d+)(\d)$", toolset) + if match: + return f"{match.group(1)}.{match.group(2)}" + return "" + + @property + def _toolset(self): + if is_msvc(self): + return "clang-win" if self.settings.compiler.get_safe("toolset") == "ClangCL" else "msvc" + if self.settings.os == "Windows" and self.settings.compiler == "clang": + return "clang-win" + if self.settings.os == "Emscripten" and self.settings.compiler == "clang": + return "emscripten" + if self.settings.compiler == "gcc" and is_apple_os(self): + return "darwin" + if self.settings.compiler == "apple-clang": + return "clang-darwin" + if self.settings.os == "Android" and self.settings.compiler == "clang": + return "clang-linux" + if self.settings.compiler in ["clang", "gcc"]: + return str(self.settings.compiler) + if self.settings.compiler == "sun-cc": + return "sunpro" + if self.settings.compiler == "intel": + return { + "Macos": "intel-darwin", + "Windows": "intel-win", + "Linux": "intel-linux", + }[str(self.settings.os)] + + return str(self.settings.compiler) + + @property + def _toolset_tag(self): + # compiler | compiler.version | os | toolset_tag | remark + # ---------------+------------------+-------------+----------------+----------------------------- + # apple-clang | 12 | Macos | darwin12 | + # clang | 12 | Macos | clang-darwin12 | + # gcc | 11 | Linux | gcc8 | + # gcc | 8 | Windows | mgw8 | + # Visual Studio | 17 | Windows | vc142 | depends on compiler.toolset + compiler = { + "apple-clang": "", + "Visual Studio": "vc", + "msvc": "vc", + }.get(str(self.settings.compiler), str(self.settings.compiler)) + if (self.settings.compiler, self.settings.os) == ("gcc", "Windows"): + compiler = "mgw" + os_ = "" + if self.settings.os == "Macos": + os_ = "darwin" + if is_msvc(self): + toolset_version = self._toolset_version.replace(".", "") + else: + toolset_version = str(Version(self.settings.compiler.version).major) + + toolset_parts = [compiler, os_] + toolset_tag = "-".join(part for part in toolset_parts if part) + toolset_version + return toolset_tag + + #################################################################### + + def package(self): + # This stage/lib is in source_folder... Face palm, looks like it builds in build but then + # copy to source with the good lib name + copy(self, "LICENSE_1_0.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + if self.options.header_only: + copy(self, "*", src=os.path.join(self.source_folder, "boost"), + dst=os.path.join(self.package_folder, "include", "boost")) + + if self.settings.os == "Emscripten" and not self.options.header_only: + self._create_emscripten_libs() + + if is_msvc(self) and self._shared: + # Some boost releases contain both static and shared variants of some libraries (if shared=True) + all_libs = set(collect_libs(self, "lib")) + static_libs = set(l for l in all_libs if l.startswith("lib")) + shared_libs = all_libs.difference(static_libs) + static_libs = set(l[3:] for l in static_libs) + common_libs = static_libs.intersection(shared_libs) + for common_lib in common_libs: + common_lib_fullname = f"lib{common_lib}.lib" + self.output.info(f'Unlinking static duplicate library: {os.path.join(self.package_folder, "lib", common_lib_fullname)}') + os.unlink(os.path.join(self.package_folder, "lib", common_lib_fullname)) + + dll_pdbs = glob.glob(os.path.join(self.package_folder, "lib", "*.dll")) + \ + glob.glob(os.path.join(self.package_folder, "lib", "*.pdb")) + if dll_pdbs: + mkdir(self, os.path.join(self.package_folder, "bin")) + for bin_file in dll_pdbs: + rename(self, bin_file, os.path.join(self.package_folder, "bin", os.path.basename(bin_file))) + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def _create_emscripten_libs(self): + # Boost Build doesn't create the libraries, but it gets close, + # leaving .bc files where the libraries would be. + staged_libs = os.path.join( + self.package_folder, "lib" + ) + if not os.path.exists(staged_libs): + self.output.warning(f"Lib folder doesn't exist, can't collect libraries: {staged_libs}") + return + for bc_file in os.listdir(staged_libs): + if bc_file.startswith("lib") and bc_file.endswith(".bc"): + a_file = bc_file[:-3] + ".a" + cmd = f"emar q {os.path.join(staged_libs, a_file)} {os.path.join(staged_libs, bc_file)}" + self.output.info(cmd) + self.run(cmd) + + @staticmethod + def _option_to_conan_requirement(name): + return { + "lzma": "xz_utils", + "iconv": "libiconv", + "python": None, # FIXME: change to cpython when it becomes available + }.get(name, name) + + def package_info(self): + self.env_info.BOOST_ROOT = self.package_folder + + self.cpp_info.set_property("cmake_file_name", "Boost") + self.cpp_info.filenames["cmake_find_package"] = "Boost" + self.cpp_info.filenames["cmake_find_package_multi"] = "Boost" + self.cpp_info.names["cmake_find_package"] = "Boost" + self.cpp_info.names["cmake_find_package_multi"] = "Boost" + + # - Use 'headers' component for all includes + defines + # - Use '_libboost' component to attach extra system_libs, ... + + self.cpp_info.components["headers"].libs = [] + self.cpp_info.components["headers"].set_property("cmake_target_name", "Boost::headers") + self.cpp_info.components["headers"].names["cmake_find_package"] = "headers" + self.cpp_info.components["headers"].names["cmake_find_package_multi"] = "headers" + self.cpp_info.components["headers"].names["pkg_config"] = "boost" + + if self.options.system_no_deprecated: + self.cpp_info.components["headers"].defines.append("BOOST_SYSTEM_NO_DEPRECATED") + + if self.options.asio_no_deprecated: + self.cpp_info.components["headers"].defines.append("BOOST_ASIO_NO_DEPRECATED") + + if self.options.filesystem_no_deprecated: + self.cpp_info.components["headers"].defines.append("BOOST_FILESYSTEM_NO_DEPRECATED") + + if self.options.filesystem_use_std_fs: + self.cpp_info.components["headers"].defines.append("BOOST_DLL_USE_STD_FS") + + if self.options.filesystem_version: + self.cpp_info.components["headers"].defines.append(f"BOOST_FILESYSTEM_VERSION={self.options.filesystem_version}") + + if self.options.segmented_stacks: + self.cpp_info.components["headers"].defines.extend(["BOOST_USE_SEGMENTED_STACKS", "BOOST_USE_UCONTEXT"]) + + if self.options.system_use_utf8: + self.cpp_info.components["headers"].defines.append("BOOST_SYSTEM_USE_UTF8") + + if self.options.buildid: + # If you built Boost using the --buildid option then set this macro to the same value + # as you passed to bjam. + # For example if you built using bjam address-model=64 --buildid=amd64 then compile your code with + # -DBOOST_LIB_BUILDID=amd64 to ensure the correct libraries are selected at link time. + self.cpp_info.components["headers"].defines.append(f"BOOST_LIB_BUILDID={self.options.buildid}") + + if not self.options.header_only: + if self.options.error_code_header_only: + self.cpp_info.components["headers"].defines.append("BOOST_ERROR_CODE_HEADER_ONLY") + + if self.options.layout == "versioned": + version = Version(self.version) + self.cpp_info.components["headers"].includedirs.append(os.path.join("include", f"boost-{version.major}_{version.minor}")) + + # Boost::boost is an alias of Boost::headers + self.cpp_info.components["_boost_cmake"].requires = ["headers"] + self.cpp_info.components["_boost_cmake"].set_property("cmake_target_name", "Boost::boost") + self.cpp_info.components["_boost_cmake"].names["cmake_find_package"] = "boost" + self.cpp_info.components["_boost_cmake"].names["cmake_find_package_multi"] = "boost" + + if not self.options.header_only: + self.cpp_info.components["_libboost"].requires = ["headers"] + + self.cpp_info.components["diagnostic_definitions"].libs = [] + self.cpp_info.components["diagnostic_definitions"].set_property("cmake_target_name", "Boost::diagnostic_definitions") + self.cpp_info.components["diagnostic_definitions"].names["cmake_find_package"] = "diagnostic_definitions" + self.cpp_info.components["diagnostic_definitions"].names["cmake_find_package_multi"] = "diagnostic_definitions" + self.cpp_info.components["diagnostic_definitions"].names["pkg_config"] = "boost_diagnostic_definitions" # FIXME: disable on pkg_config + # I would assume headers also need the define BOOST_LIB_DIAGNOSTIC, as a header can trigger an autolink, + # and this definition triggers a print out of the library selected. See notes below on autolink and headers. + self.cpp_info.components["headers"].requires.append("diagnostic_definitions") + if self.options.diagnostic_definitions: + self.cpp_info.components["diagnostic_definitions"].defines = ["BOOST_LIB_DIAGNOSTIC"] + + self.cpp_info.components["disable_autolinking"].libs = [] + self.cpp_info.components["disable_autolinking"].set_property("cmake_target_name", "Boost::disable_autolinking") + self.cpp_info.components["disable_autolinking"].names["cmake_find_package"] = "disable_autolinking" + self.cpp_info.components["disable_autolinking"].names["cmake_find_package_multi"] = "disable_autolinking" + self.cpp_info.components["disable_autolinking"].names["pkg_config"] = "boost_disable_autolinking" # FIXME: disable on pkg_config + + # Even headers needs to know the flags for disabling autolinking ... + # magic_autolink is an option in the recipe, so if a consumer wants this version of boost, + # then they should not get autolinking. + # Note that autolinking can sneak in just by some file #including a header with (eg) boost/atomic.hpp, + # even if it doesn't use any part that requires linking with libboost_atomic in order to compile. + # So a boost-header-only library that links to Boost::headers needs to see BOOST_ALL_NO_LIB + # in order to avoid autolinking to libboost_atomic + + # This define is already imported into all of the _libboost libraries from this recipe anyway, + # so it would be better to be consistent and ensure ANYTHING using boost (headers or libs) has consistent #defines. + + # Same applies for for BOOST_AUTO_LINK_{layout}: + # consumer libs that use headers also need to know what is the layout/filename of the libraries. + # + # eg, if using the "tagged" naming scheme, and a header triggers an autolink, + # then that header's autolink request had better be configured to request the "tagged" library name. + # Otherwise, the linker will be looking for a (eg) "versioned" library name, and there will be a link error. + + # Note that "_libboost" requires "headers" so these defines will be applied to all the libraries too. + self.cpp_info.components["headers"].requires.append("disable_autolinking") + if is_msvc(self) or self._is_clang_cl: + if self.options.magic_autolink: + if self.options.layout == "system": + self.cpp_info.components["headers"].defines.append("BOOST_AUTO_LINK_SYSTEM") + elif self.options.layout == "tagged": + self.cpp_info.components["headers"].defines.append("BOOST_AUTO_LINK_TAGGED") + self.output.info("Enabled magic autolinking (smart and magic decisions)") + else: + # DISABLES AUTO LINKING! NO SMART AND MAGIC DECISIONS THANKS! + self.cpp_info.components["disable_autolinking"].defines = ["BOOST_ALL_NO_LIB"] + self.output.info("Disabled magic autolinking (smart and magic decisions)") + + self.cpp_info.components["dynamic_linking"].libs = [] + self.cpp_info.components["dynamic_linking"].set_property("cmake_target_name", "Boost::dynamic_linking") + self.cpp_info.components["dynamic_linking"].names["cmake_find_package"] = "dynamic_linking" + self.cpp_info.components["dynamic_linking"].names["cmake_find_package_multi"] = "dynamic_linking" + self.cpp_info.components["dynamic_linking"].names["pkg_config"] = "boost_dynamic_linking" # FIXME: disable on pkg_config + # A library that only links to Boost::headers can be linked into another library that links a Boost::library, + # so for this reasons, the header-only library should know the BOOST_ALL_DYN_LINK definition as it will likely + # change some important part of the boost code and cause linking errors downstream. + # This is in the same theme as the notes above, re autolinking. + self.cpp_info.components["headers"].requires.append("dynamic_linking") + if self._shared: + # A Boost::dynamic_linking cmake target does only make sense for a shared boost package + self.cpp_info.components["dynamic_linking"].defines = ["BOOST_ALL_DYN_LINK"] + + # https://www.boost.org/doc/libs/1_73_0/more/getting_started/windows.html#library-naming + # libsuffix for MSVC: + # - system: "" + # - versioned: "-vc142-mt-d-x64-1_74" + # - tagged: "-mt-d-x64" + libsuffix_lut = { + "system": "", + "versioned": "{toolset}{threading}{abi}{arch}{version}", + "tagged": "{threading}{abi}{arch}", + } + libsuffix_data = { + "toolset": f"-{self._toolset_tag}", + "threading": "-mt" if self.options.multithreading else "", + "abi": "", + "ach": "", + "version": "", + } + if is_msvc(self): # FIXME: mingw? + # FIXME: add 'y' when using cpython cci package and when python is built in debug mode + static_runtime_key = "s" if is_msvc_static_runtime(self) else "" + debug_runtime_key = "g" if "d" in msvc_runtime_flag(self) else "" + debug_key = "d" if self.settings.build_type == "Debug" else "" + abi = static_runtime_key + debug_runtime_key + debug_key + if abi: + libsuffix_data["abi"] = f"-{abi}" + else: + debug_tag = "d" if self.settings.build_type == "Debug" else "" + abi = debug_tag + if abi: + libsuffix_data["abi"] = f"-{abi}" + + if self._b2_architecture: + libsuffix_data["arch"] = f"-{self._b2_architecture[0]}{self._b2_address_model}" + version = Version(self.version) + if not version.patch or version.patch == "0": + libsuffix_data["version"] = f"-{version.major}_{version.minor}" + else: + libsuffix_data["version"] = f"-{version.major}_{version.minor}_{version.patch}" + libsuffix = libsuffix_lut[str(self.options.layout)].format(**libsuffix_data) + if libsuffix: + self.output.info(f"Library layout suffix: {repr(libsuffix)}") + + libformatdata = {} + if not self.options.without_python: + pyversion = Version(self._python_version) + libformatdata["py_major"] = pyversion.major + libformatdata["py_minor"] = pyversion.minor + + def add_libprefix(n): + """ On MSVC, static libraries are built with a 'lib' prefix. Some libraries do not support shared, so are always built as a static library. """ + libprefix = "" + if is_msvc(self) and (not self._shared or n in self._dependencies["static_only"]): + libprefix = "lib" + return libprefix + n + + all_detected_libraries = set(l[:-4] if l.endswith(".dll") else l for l in collect_libs(self)) + all_expected_libraries = set() + incomplete_components = [] + + def filter_transform_module_libraries(names): + libs = [] + for name in names: + if name in ("boost_stacktrace_windbg", "boost_stacktrace_windbg_cached") and self.settings.os != "Windows": + continue + if name in ("boost_stacktrace_addr2line", "boost_stacktrace_backtrace", "boost_stacktrace_basic",) and self.settings.os == "Windows": + continue + if name == "boost_stacktrace_addr2line" and not self._stacktrace_addr2line_available: + continue + if name == "boost_stacktrace_backtrace" and self.options.get_safe("with_stacktrace_backtrace") == False: + continue + if not self.options.get_safe("numa") and "_numa" in name: + continue + new_name = add_libprefix(name.format(**libformatdata)) + libsuffix + if self.options.namespace != 'boost': + new_name = new_name.replace("boost_", str(self.options.namespace) + "_") + if name.startswith("boost_python") or name.startswith("boost_numpy"): + if self.options.python_buildid: + new_name += f"-{self.options.python_buildid}" + if self.options.buildid: + new_name += f"-{self.options.buildid}" + libs.append(new_name) + return libs + + for module in self._dependencies["dependencies"].keys(): + missing_depmodules = list(depmodule for depmodule in self._all_dependent_modules(module) if self.options.get_safe(f"without_{depmodule}", False)) + if missing_depmodules: + continue + + module_libraries = filter_transform_module_libraries(self._dependencies["libs"][module]) + + # Don't create components for modules that should have libraries, but don't have (because of filter) + if self._dependencies["libs"][module] and not module_libraries: + continue + + all_expected_libraries = all_expected_libraries.union(module_libraries) + if set(module_libraries).difference(all_detected_libraries): + incomplete_components.append(module) + + # Starting v1.69.0 Boost.System is header-only. A stub library is + # still built for compatibility, but linking to it is no longer + # necessary. + # https://www.boost.org/doc/libs/1_75_0/libs/system/doc/html/system.html#changes_in_boost_1_69 + if module == "system": + module_libraries = [] + + self.cpp_info.components[module].libs = module_libraries + + self.cpp_info.components[module].requires = self._dependencies["dependencies"][module] + ["_libboost"] + self.cpp_info.components[module].set_property("cmake_target_name", "Boost::" + module) + self.cpp_info.components[module].names["cmake_find_package"] = module + self.cpp_info.components[module].names["cmake_find_package_multi"] = module + self.cpp_info.components[module].names["pkg_config"] = f"boost_{module}" + + # extract list of names of direct host dependencies to check for dependencies + # of components that exist in other packages + dependencies = [d.ref.name for d, _ in self.dependencies.direct_host.items()] + + for requirement in self._dependencies.get("requirements", {}).get(module, []): + if self.options.get_safe(requirement, None) == False: + continue + conan_requirement = self._option_to_conan_requirement(requirement) + if conan_requirement not in dependencies: + continue + if module == "locale" and requirement in ("icu", "iconv"): + if requirement == "icu" and not self._with_icu: + continue + if requirement == "iconv" and not self._with_iconv: + continue + self.cpp_info.components[module].requires.append(f"{conan_requirement}::{conan_requirement}") + + for incomplete_component in incomplete_components: + self.output.warning(f"Boost component '{incomplete_component}' is missing libraries. Try building boost with '-o boost:without_{incomplete_component}'. (Option is not guaranteed to exist)") + + non_used = all_detected_libraries.difference(all_expected_libraries) + if non_used: + raise ConanException(f"These libraries were built, but were not used in any boost module: {non_used}") + + non_built = all_expected_libraries.difference(all_detected_libraries) + if non_built: + raise ConanException(f"These libraries were expected to be built, but were not built: {non_built}") + + if not self.options.without_stacktrace: + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["stacktrace_basic"].system_libs.append("dl") + if self._stacktrace_addr2line_available: + self.cpp_info.components["stacktrace_addr2line"].system_libs.append("dl") + if self._with_stacktrace_backtrace: + self.cpp_info.components["stacktrace_backtrace"].system_libs.append("dl") + + if self._stacktrace_addr2line_available: + self.cpp_info.components["stacktrace_addr2line"].defines.extend([ + f"BOOST_STACKTRACE_ADDR2LINE_LOCATION=\"{self.options.addr2line_location}\"", + "BOOST_STACKTRACE_USE_ADDR2LINE", + ]) + + if self._with_stacktrace_backtrace: + self.cpp_info.components["stacktrace_backtrace"].defines.append("BOOST_STACKTRACE_USE_BACKTRACE") + self.cpp_info.components["stacktrace_backtrace"].requires.append("libbacktrace::libbacktrace") + + self.cpp_info.components["stacktrace_noop"].defines.append("BOOST_STACKTRACE_USE_NOOP") + + if self.settings.os == "Windows": + self.cpp_info.components["stacktrace_windbg"].defines.append("BOOST_STACKTRACE_USE_WINDBG") + self.cpp_info.components["stacktrace_windbg"].system_libs.extend(["ole32", "dbgeng"]) + self.cpp_info.components["stacktrace_windbg_cached"].defines.append("BOOST_STACKTRACE_USE_WINDBG_CACHED") + self.cpp_info.components["stacktrace_windbg_cached"].system_libs.extend(["ole32", "dbgeng"]) + elif is_apple_os(self) or self.settings.os == "FreeBSD": + self.cpp_info.components["stacktrace"].defines.append("BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED") + + if not self.options.without_python: + pyversion = Version(self._python_version) + self.cpp_info.components[f"python{pyversion.major}{pyversion.minor}"].requires = ["python"] + if not self._shared: + self.cpp_info.components["python"].defines.append("BOOST_PYTHON_STATIC_LIB") + + self.cpp_info.components[f"numpy{pyversion.major}{pyversion.minor}"].requires = ["numpy"] + + if is_msvc(self) or self._is_clang_cl: + # https://github.com/conan-community/conan-boost/issues/127#issuecomment-404750974 + self.cpp_info.components["_libboost"].system_libs.append("bcrypt") + elif self.settings.os == "Linux": + # https://github.com/conan-community/community/issues/135 + self.cpp_info.components["_libboost"].system_libs.append("rt") + if self.options.multithreading: + self.cpp_info.components["_libboost"].system_libs.append("pthread") + elif self.settings.os == "Emscripten": + if self.options.multithreading: + arch = str(self.settings.arch) + # https://emscripten.org/docs/porting/pthreads.html + # The documentation mentions that we should be using the "-s USE_PTHREADS=1" + # but it was causing problems with the target based configurations in conan + # So instead we are using the raw compiler flags (that are being activated + # from the aforementioned flag) + if arch.startswith("x86") or arch.startswith("wasm"): + self.cpp_info.components["_libboost"].cxxflags.append("-pthread") + self.cpp_info.components["_libboost"].sharedlinkflags.extend(["-pthread","--shared-memory"]) + self.cpp_info.components["_libboost"].exelinkflags.extend(["-pthread","--shared-memory"]) + elif self.settings.os == "iOS": + if self.options.multithreading: + # https://github.com/conan-io/conan-center-index/issues/3867 + # runtime crashes occur when using the default platform-specific reference counter/atomic + # https://github.com/boostorg/filesystem/issues/147 + # iOS should use spinlocks to avoid filesystem crashes + self.cpp_info.components["headers"].defines.append("BOOST_SP_USE_SPINLOCK") + else: + self.cpp_info.components["headers"].defines.extend(["BOOST_AC_DISABLE_THREADS", "BOOST_SP_DISABLE_THREADS"]) + #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.71.0.yml b/recipes/boost/all/dependencies/dependencies-1.71.0.yml new file mode 100644 index 0000000000000..9c2d0a8c22410 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.71.0.yml @@ -0,0 +1,269 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: + - serialization + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.71.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.72.0.yml b/recipes/boost/all/dependencies/dependencies-1.72.0.yml new file mode 100644 index 0000000000000..f0213a24374bb --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.72.0.yml @@ -0,0 +1,270 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: + - serialization + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + - chrono + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.72.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.73.0.yml b/recipes/boost/all/dependencies/dependencies-1.73.0.yml new file mode 100644 index 0000000000000..d26d67c9c338d --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.73.0.yml @@ -0,0 +1,274 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: + - serialization + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.73.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.74.0.yml b/recipes/boost/all/dependencies/dependencies-1.74.0.yml new file mode 100644 index 0000000000000..679e8d616f324 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.74.0.yml @@ -0,0 +1,273 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.74.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.75.0.yml b/recipes/boost/all/dependencies/dependencies-1.75.0.yml new file mode 100644 index 0000000000000..4d24ca98d6337 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.75.0.yml @@ -0,0 +1,280 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.75.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.76.0.yml b/recipes/boost/all/dependencies/dependencies-1.76.0.yml new file mode 100644 index 0000000000000..b404c36315ae1 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.76.0.yml @@ -0,0 +1,279 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.76.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.77.0.yml b/recipes/boost/all/dependencies/dependencies-1.77.0.yml new file mode 100644 index 0000000000000..921d8f4f45b12 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.77.0.yml @@ -0,0 +1,277 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.77.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.78.0.yml b/recipes/boost/all/dependencies/dependencies-1.78.0.yml new file mode 100644 index 0000000000000..dd3207297bf16 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.78.0.yml @@ -0,0 +1,276 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.78.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.79.0.yml b/recipes/boost/all/dependencies/dependencies-1.79.0.yml new file mode 100644 index 0000000000000..ddef536e6ff01 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.79.0.yml @@ -0,0 +1,276 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.79.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.80.0.yml b/recipes/boost/all/dependencies/dependencies-1.80.0.yml new file mode 100644 index 0000000000000..4cabd8ca5c44d --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.80.0.yml @@ -0,0 +1,275 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.80.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.81.0.yml b/recipes/boost/all/dependencies/dependencies-1.81.0.yml new file mode 100644 index 0000000000000..838c68bc7e432 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.81.0.yml @@ -0,0 +1,280 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.81.0 diff --git a/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch new file mode 100644 index 0000000000000..fd069197a95a0 --- /dev/null +++ b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch @@ -0,0 +1,49 @@ +From 188eac4acf37313fcec27d7b266c6517b99ed23d Mon Sep 17 00:00:00 2001 +From: Oliver Kowalke +Date: Sun, 1 Dec 2019 20:40:28 +0100 +Subject: [PATCH] Revert "Cease dependence on Range" + +This reverts commit 0c556bb59241e682bbcd3f572815149c5a9b17db. + +see #44 (One test fails to compile after boostorg/coroutine submodule updated) +--- + boost/coroutine/asymmetric_coroutine.hpp | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp +index f2ae16f..78b1842 100644 +--- a/boost/coroutine/asymmetric_coroutine.hpp ++++ b/boost/coroutine/asymmetric_coroutine.hpp +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -2390,19 +2391,12 @@ end( push_coroutine< R > & c) + + } + +-// forward declaration of Boost.Range traits to break dependency on it +-template +-struct range_mutable_iterator; +- +-template +-struct range_const_iterator; +- + template< typename Arg > +-struct range_mutable_iterator< coroutines::push_coroutine< Arg >, void > ++struct range_mutable_iterator< coroutines::push_coroutine< Arg > > + { typedef typename coroutines::push_coroutine< Arg >::iterator type; }; + + template< typename R > +-struct range_mutable_iterator< coroutines::pull_coroutine< R >, void > ++struct range_mutable_iterator< coroutines::pull_coroutine< R > > + { typedef typename coroutines::pull_coroutine< R >::iterator type; }; + + } +-- +2.21.0 + diff --git a/recipes/boost/all/patches/1.69.0-contract-no-system.patch b/recipes/boost/all/patches/1.69.0-contract-no-system.patch new file mode 100644 index 0000000000000..d98fe7b2f7e3e --- /dev/null +++ b/recipes/boost/all/patches/1.69.0-contract-no-system.patch @@ -0,0 +1,11 @@ +This library links to boost_system, even though that library is header-only. +--- libs/contract/build/Jamfile.v2 ++++ libs/contract/build/Jamfile.v2 +@@ -18,5 +18,5 @@ + ; + + # If lib as header-only, none of following will be used. +-lib boost_contract : contract.cpp : shared /boost//system ; +-lib boost_contract : contract.cpp : static /boost//system ; ++lib boost_contract : contract.cpp : shared ; ++lib boost_contract : contract.cpp : static ; diff --git a/recipes/boost/all/patches/1.69.0-locale-no-system.patch b/recipes/boost/all/patches/1.69.0-locale-no-system.patch new file mode 100644 index 0000000000000..a2ca64eb92300 --- /dev/null +++ b/recipes/boost/all/patches/1.69.0-locale-no-system.patch @@ -0,0 +1,12 @@ +This library links to boost_system, even though that library is header-only. +--- libs/locale/build/Jamfile.v2 ++++ libs/locale/build/Jamfile.v2 +@@ -410,7 +410,7 @@ + result += util/gregorian.cpp ; + } + +- result += ../../system/build//boost_system ; ++ + + + if "$(flags-only)" = "flags" diff --git a/recipes/boost/all/patches/1.69.0-random-no-system.patch b/recipes/boost/all/patches/1.69.0-random-no-system.patch new file mode 100644 index 0000000000000..ad03e39931654 --- /dev/null +++ b/recipes/boost/all/patches/1.69.0-random-no-system.patch @@ -0,0 +1,11 @@ +This library links to boost_system, even though that library is header-only. +--- libs/random/build/Jamfile.v2 ++++ libs/random/build/Jamfile.v2 +@@ -13,6 +13,6 @@ + : usage-requirements shared:BOOST_RANDOM_DYN_LINK + ; + +-lib boost_random : [ glob *.cpp ] /boost//system ; ++lib boost_random : [ glob *.cpp ] ; + + boost-install boost_random ; diff --git a/recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch b/recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch new file mode 100644 index 0000000000000..c3b7cde662175 --- /dev/null +++ b/recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch @@ -0,0 +1,9 @@ +This library links to boost_system, even though that library is header-only. +--- libs/type_erasure/build/Jamfile.v2 ++++ libs/type_erasure/build/Jamfile.v2 +@@ -12,4 +12,4 @@ + : usage-requirements shared:BOOST_TYPE_ERASURE_DYN_LINK + ; + +-lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ; ++lib boost_type_erasure : dynamic_binding.cpp /boost//thread ; diff --git a/recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch b/recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch new file mode 100644 index 0000000000000..4c22c748fe894 --- /dev/null +++ b/recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch @@ -0,0 +1,51 @@ +--- tools/build/src/build/configure.jam.orig 2020-12-03 00:02:49.000000000 -0500 ++++ tools/build/src/build/configure.jam 2022-01-28 20:32:41.260634800 -0500 +@@ -454,7 +454,7 @@ + return [ find-builds-raw $(p) : $(ps) : $(what) : + $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : + $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : +- $(16) : $(17) : $(18) : $(19) ] ; ++ $(16) : $(17) : $(18) ] ; + } + + +@@ -518,7 +518,7 @@ + { + local project = [ project.current ] ; + self.message = $(message) ; +- for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ++ for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + { + local name = [ CALC $(i) - 1 ] ; + self.targets.$(name) = $($(i)[1]) ; +@@ -537,7 +537,7 @@ + } + rule all-properties ( ) + { +- local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; ++ local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; + return $(self.props.$(i)) ; + } + rule check ( properties * ) +@@ -559,9 +559,7 @@ + : $(self.targets.14) $(self.what.14) + : $(self.targets.15) $(self.what.15) + : $(self.targets.16) $(self.what.16) +- : $(self.targets.17) $(self.what.17) +- : $(self.targets.18) $(self.what.18) +- : $(self.targets.19) $(self.what.19) ] ; ++ : $(self.targets.17) $(self.what.17) ] ; + if $(self.props.$(i)) + { + return [ property.evaluate-conditionals-in-context $(self.props.$(i)) : $(properties) ] ; +--- tools/build/src/util/indirect.jam.orig 2020-12-03 00:02:49.000000000 -0500 ++++ tools/build/src/util/indirect.jam 2022-01-28 20:32:41.249509200 -0500 +@@ -102,7 +102,7 @@ + { + return [ modules.call-in [ get-module $(r) ] : [ get-rule $(r) ] $(args) : + $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : $(10) : $(11) : +- $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) : $(19) ] ; ++ $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) ] ; + } + + diff --git a/recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch b/recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch new file mode 100644 index 0000000000000..c06566b5a75fb --- /dev/null +++ b/recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch @@ -0,0 +1,33 @@ +From 1ec5c98d80de97f9e962c5627e1a0e6096099894 Mon Sep 17 00:00:00 2001 +From: Daniel Scharrer +Date: Wed, 28 Jul 2021 19:56:31 +0200 +Subject: [PATCH] Fix #include inside boost namespace + +The existing code fails to build if was not already included. +--- + boost/math/tools/mp.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/math/tools/mp.hpp b/boost/math/tools/mp.hpp +index 35565646f..dc8440988 100644 +--- a/boost/math/tools/mp.hpp ++++ b/boost/math/tools/mp.hpp +@@ -13,6 +13,7 @@ + + #include + #include ++#include + + namespace boost { namespace math { namespace tools { namespace meta_programming { + +@@ -338,7 +339,6 @@ using mp_remove_if_q = mp_remove_if; + // Index sequence + // Use C++14 index sequence if available + #if defined(__cpp_lib_integer_sequence) && (__cpp_lib_integer_sequence >= 201304) +-#include + template + using index_sequence = std::index_sequence; + +-- +2.39.1 + diff --git a/recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch b/recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch new file mode 100644 index 0000000000000..bdc7476f27137 --- /dev/null +++ b/recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch @@ -0,0 +1,51 @@ +--- tools/build/src/build/configure.jam.orig 2021-08-05 05:42:46.000000000 -0400 ++++ tools/build/src/build/configure.jam 2022-01-28 19:55:37.960877600 -0500 +@@ -467,7 +467,7 @@ + return [ find-builds-raw $(p) : $(ps) : $(what) : + $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : + $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : +- $(16) : $(17) : $(18) : $(19) ] ; ++ $(16) : $(17) : $(18) ] ; + } + + +@@ -531,7 +531,7 @@ + { + local project = [ project.current ] ; + self.message = $(message) ; +- for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ++ for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + { + local name = [ CALC $(i) - 1 ] ; + self.targets.$(name) = $($(i)[1]) ; +@@ -550,7 +550,7 @@ + } + rule all-properties ( ) + { +- local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; ++ local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; + return $(self.props.$(i)) ; + } + rule check ( properties * ) +@@ -572,9 +572,7 @@ + : $(self.targets.14) $(self.what.14) + : $(self.targets.15) $(self.what.15) + : $(self.targets.16) $(self.what.16) +- : $(self.targets.17) $(self.what.17) +- : $(self.targets.18) $(self.what.18) +- : $(self.targets.19) $(self.what.19) ] ; ++ : $(self.targets.17) $(self.what.17) ] ; + if $(self.props.$(i)) + { + return [ property.evaluate-conditionals-in-context $(self.props.$(i)) : $(properties) ] ; +--- tools/build/src/util/indirect.jam.orig 2021-08-05 05:42:46.000000000 -0400 ++++ tools/build/src/util/indirect.jam 2021-12-02 01:48:03.000000000 -0500 +@@ -102,7 +102,7 @@ + { + return [ modules.call-in [ get-module $(r) ] : [ get-rule $(r) ] $(args) : + $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : $(10) : $(11) : +- $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) : $(19) ] ; ++ $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) ] ; + } + + .parts_regex = "^([^@]*)@" "([^%]*)%" "([^%]+)$" ; diff --git a/recipes/boost/all/patches/1.77.0-fiber-mingw.patch b/recipes/boost/all/patches/1.77.0-fiber-mingw.patch new file mode 100644 index 0000000000000..5bf38006a4213 --- /dev/null +++ b/recipes/boost/all/patches/1.77.0-fiber-mingw.patch @@ -0,0 +1,20 @@ +--- libs/fiber/src/numa/windows/pin_thread.cpp ++++ libs/fiber/src/numa/windows/pin_thread.cpp +@@ -23,7 +23,7 @@ + + BOOST_FIBERS_DECL + void pin_thread( std::uint32_t cpuid) { +- pin_thread( cpuid, ::GetCurrentThread() ); ++ pin_thread( cpuid, reinterpret_cast< std::thread::native_handle_type >(::GetCurrentThread())); + } + + BOOST_FIBERS_DECL +@@ -37,7 +37,7 @@ + uint32_t id = cpuid % 64; + // set the bit mask of the logical CPU + affinity.Mask = static_cast< KAFFINITY >( 1) << id; +- if ( BOOST_UNLIKELY( 0 == ::SetThreadGroupAffinity( h, & affinity, nullptr) ) ) { ++ if ( BOOST_UNLIKELY( 0 == ::SetThreadGroupAffinity( reinterpret_cast< HANDLE >(h), & affinity, nullptr) ) ) { + throw std::system_error( + std::error_code( ::GetLastError(), std::system_category() ), + "::SetThreadiGroupAffinity() failed"); diff --git a/recipes/boost/all/patches/1.77.0-type_erasure-no-system.patch b/recipes/boost/all/patches/1.77.0-type_erasure-no-system.patch new file mode 100644 index 0000000000000..71aac779a339f --- /dev/null +++ b/recipes/boost/all/patches/1.77.0-type_erasure-no-system.patch @@ -0,0 +1,11 @@ +This library links to boost_system, even though that library is header-only. +--- libs/type_erasure/build/Jamfile.v2 ++++ libs/type_erasure/build/Jamfile.v2 +@@ -12,6 +12,6 @@ + : usage-requirements shared:BOOST_TYPE_ERASURE_DYN_LINK + ; + +-lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ; ++lib boost_type_erasure : dynamic_binding.cpp /boost//thread ; + + boost-install boost_type_erasure ; diff --git a/recipes/boost/all/patches/1.78.0-b2-fix-install.patch b/recipes/boost/all/patches/1.78.0-b2-fix-install.patch new file mode 100644 index 0000000000000..ac0ed81a3e85c --- /dev/null +++ b/recipes/boost/all/patches/1.78.0-b2-fix-install.patch @@ -0,0 +1,62 @@ +--- tools/build/src/tools/stage.jam 2021-12-09 16:30:45.956457531 +0300 ++++ tools/build/src/tools/stage.jam 2021-12-09 16:30:45.952457519 +0300 +@@ -476,10 +476,14 @@ class install-target-class : basic-targe + } + DELETE_MODULE $(result) ; + return [ sequence.unique $(result2) ] ; + } + ++ rule skip-from-usage-requirements ( ) ++ { ++ } ++ + # Returns true iff 'type' is subtype of some element of 'types-to-include'. + # + local rule include-type ( type : types-to-include * ) + { + local found ; + +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ tools/build/test/install_build_no.py 2021-12-09 16:30:45.953457522 +0300 +@@ -0,0 +1,26 @@ ++#!/usr/bin/python ++ ++# Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com) ++# Distributed under the Boost Software License, Version 1.0. ++# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) ++ ++# Check that no in usage-requirements of dependencies does not affect ++# install rule, i.e. a skipped installed target does not affect insallation of ++# other targets. ++ ++import BoostBuild ++ ++t = BoostBuild.Tester() ++ ++t.write("a.cpp", "int main() {}\n") ++ ++t.write("jamroot.jam", """ ++make x : : maker : no ; ++exe a : a.cpp ; ++install install : x a ; ++""") ++ ++t.run_build_system() ++t.expect_addition("install/a.exe") ++ ++t.cleanup() + +--- tools/build/test/test_all.py 2021-12-09 16:30:45.956457531 +0300 ++++ tools/build/test/test_all.py 2021-12-09 16:30:45.953457522 +0300 +@@ -248,10 +248,11 @@ tests = ["abs_workdir", + "implicit_dependency", + "indirect_conditional", + "inherit_toolset", + "inherited_dependency", + "inline", ++ "install_build_no", + "libjpeg", + "liblzma", + "libpng", + "libtiff", + "libzstd", diff --git a/recipes/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch b/recipes/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch new file mode 100644 index 0000000000000..d322b64f4477d --- /dev/null +++ b/recipes/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch @@ -0,0 +1,49 @@ +diff -ur boost/json/impl/array.ipp boost/json/impl/array.ipp +--- boost/json/impl/array.ipp 2022-04-06 17:02:43.000000000 -0400 ++++ boost/json/impl/array.ipp 2022-04-13 20:55:20.464359478 -0400 +@@ -491,8 +491,11 @@ + auto const p = &(*t_)[0] + + (pos - &(*t_)[0]); + destroy(p, p + 1); +- relocate(p, p + 1, 1); + --t_->size; ++ if(t_->size > 0) ++ relocate(p, p + 1, ++ t_->size - (p - ++ &(*t_)[0])); + return p; + } + +diff -ur libs/json/test/array.cpp libs/json/test/array.cpp +--- libs/json/test/array.cpp 2022-04-06 17:02:43.000000000 -0400 ++++ libs/json/test/array.cpp 2022-04-13 20:53:32.671782680 -0400 +@@ -1270,6 +1270,21 @@ + } + + void ++ testIssue692() ++ { ++ array a; ++ object obj; ++ obj["test1"] = "hello"; ++ a.push_back(obj); ++ a.push_back(obj); ++ a.push_back(obj); ++ a.push_back(obj); ++ a.push_back(obj); ++ while(a.size()) ++ a.erase(a.begin()); ++ } ++ ++ void + run() + { + testDestroy(); +@@ -1283,6 +1298,7 @@ + testExceptions(); + testEquality(); + testHash(); ++ testIssue692(); + } + }; + diff --git a/recipes/boost/all/patches/1.79.0-geometry_no_rtti.patch b/recipes/boost/all/patches/1.79.0-geometry_no_rtti.patch new file mode 100644 index 0000000000000..15e7b06f56835 --- /dev/null +++ b/recipes/boost/all/patches/1.79.0-geometry_no_rtti.patch @@ -0,0 +1,169 @@ +From 379f0c364a5ef3e6d57021ab815ea603ab3f1178 Mon Sep 17 00:00:00 2001 +From: Adam Wulkiewicz +Date: Tue, 19 Jul 2022 22:52:09 +0200 +Subject: [PATCH] [index] Fix and improve rtree experimental features + +Fix access specifier preventing use of experimental iterators. +Allow more granular control over enabled experimental features. +--- + .../geometry/index/distance_predicates.hpp | 12 +++++++++--- + include/boost/geometry/index/predicates.hpp | 16 +++++++++++----- + include/boost/geometry/index/rtree.hpp | 18 ++++++++++++++---- + 3 files changed, 34 insertions(+), 12 deletions(-) + +diff --git a/boost/geometry/index/distance_predicates.hpp b/boost/geometry/index/distance_predicates.hpp +index 59b32af4753..00fc663cb38 100644 +--- a/boost/geometry/index/distance_predicates.hpp ++++ b/boost/geometry/index/distance_predicates.hpp +@@ -2,7 +2,7 @@ + // + // Spatial index distance predicates, calculators and checkers used in nearest neighbor query + // +-// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. ++// Copyright (c) 2011-2022 Adam Wulkiewicz, Lodz, Poland. + // + // Use, modification and distribution is subject to the Boost Software License, + // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +@@ -11,6 +11,12 @@ + #ifndef BOOST_GEOMETRY_INDEX_DISTANCE_PREDICATES_HPP + #define BOOST_GEOMETRY_INDEX_DISTANCE_PREDICATES_HPP + ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#endif ++#endif ++ + #include + + /*! +@@ -21,7 +27,7 @@ namespace boost { namespace geometry { namespace index { + + // relations generators + +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate to_nearest() relationship. +@@ -91,7 +97,7 @@ detail::to_furthest to_furthest(T const& v) + return detail::to_furthest(v); + } + +-#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + // distance predicates generators + +diff --git a/boost/geometry/index/predicates.hpp b/boost/geometry/index/predicates.hpp +index 6da0d0ec5d0..3678188dcd1 100644 +--- a/boost/geometry/index/predicates.hpp ++++ b/boost/geometry/index/predicates.hpp +@@ -2,7 +2,7 @@ + // + // Spatial query predicates + // +-// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland. ++// Copyright (c) 2011-2022 Adam Wulkiewicz, Lodz, Poland. + // + // This file was modified by Oracle on 2019-2021. + // Modifications copyright (c) 2019-2021 Oracle and/or its affiliates. +@@ -15,6 +15,12 @@ + #ifndef BOOST_GEOMETRY_INDEX_PREDICATES_HPP + #define BOOST_GEOMETRY_INDEX_PREDICATES_HPP + ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#endif ++#endif ++ + #include + #include + +@@ -212,7 +218,7 @@ overlaps(Geometry const& g) + >(g); + } + +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate \c touches() predicate. +@@ -240,7 +246,7 @@ touches(Geometry const& g) + >(g); + } + +-#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate \c within() predicate. +@@ -343,7 +349,7 @@ nearest(Geometry const& geometry, std::size_t k) + return detail::predicates::nearest(geometry, k); + } + +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate path() predicate. +@@ -373,7 +379,7 @@ path(SegmentOrLinestring const& linestring, std::size_t k) + return detail::predicates::path(linestring, k); + } + +-#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + namespace detail { namespace predicates { + +diff --git a/boost/geometry/index/rtree.hpp b/boost/geometry/index/rtree.hpp +index af3b6f4ee07..6bb34faf6e9 100644 +--- a/boost/geometry/index/rtree.hpp ++++ b/boost/geometry/index/rtree.hpp +@@ -3,7 +3,7 @@ + // R-tree implementation + // + // Copyright (c) 2008 Federico J. Fernandez. +-// Copyright (c) 2011-2019 Adam Wulkiewicz, Lodz, Poland. ++// Copyright (c) 2011-2022 Adam Wulkiewicz, Lodz, Poland. + // Copyright (c) 2020 Caian Benedicto, Campinas, Brazil. + // + // This file was modified by Oracle on 2019-2021. +@@ -90,7 +90,15 @@ + #include + + #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +-// serialization ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION ++#endif ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_ITERATORS ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_ITERATORS ++#endif ++#endif ++ ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION + #include + #endif + +@@ -312,7 +320,7 @@ class rtree + typedef typename members_holder::allocator_traits_type allocator_traits_type; + + friend class detail::rtree::utilities::view; +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION + friend class detail::rtree::private_view; + friend class detail::rtree::const_private_view; + #endif +@@ -1184,7 +1192,9 @@ class rtree + detail::rtree::iterators::distance_query_iterator + >; + +-#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_ITERATORS ++public: ++#else + private: + #endif + /*! diff --git a/recipes/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch b/recipes/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch new file mode 100644 index 0000000000000..61770f8c8863f --- /dev/null +++ b/recipes/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch @@ -0,0 +1,25 @@ +diff --git a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +index 81387ce..58a69e6 100644 +--- a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp ++++ b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +@@ -35,8 +35,6 @@ BOOST_PRAGMA_MESSAGE("Using CodeWarrior/PowerPC sp_counted_base") + + #endif + +-BOOST_SP_OBSOLETE() +- + namespace boost + { + +@@ -64,7 +62,11 @@ inline long atomic_decrement( register long * pw ) + + asm + { ++#if defined(__PPCZen__) || defined(__PPCe500__) || defined(__PPCe500v2__) ++ msync ++#else + sync ++#endif + + loop: + diff --git a/recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch b/recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch new file mode 100644 index 0000000000000..0d28b86bb670c --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch @@ -0,0 +1,31 @@ +commit 9c9d127bddc2b72187c57f4933c49666255d7a4f +Author: Olavo Belloc +Date: Mon Aug 8 10:54:02 2022 +0200 + + Limit the buffer size for compatibility with previous versions of Windows + + The reported error was reproduced on Windows 7 and 8.1, but not on an early + version of Windows 10 (2004). + + Closes https://github.com/boostorg/filesystem/pull/246. + Likely fixes https://github.com/boostorg/filesystem/issues/245. + +diff --git a/libs/filesystem/src/directory.cpp b/libs/filesystem/src/directory.cpp +index 6a3e1dc..9334893 100644 +--- a/libs/filesystem/src/directory.cpp ++++ b/libs/filesystem/src/directory.cpp +@@ -599,9 +599,12 @@ extra_data_format g_extra_data_format = file_directory_information_format; + * \brief Extra buffer size for GetFileInformationByHandleEx-based or NtQueryDirectoryFile-based directory iterator. + * + * Must be large enough to accommodate at least one FILE_DIRECTORY_INFORMATION or *_DIR_INFO struct and one filename. +- * NTFS, VFAT, exFAT support filenames up to 255 UTF-16/UCS-2 characters. ReFS supports filenames up to 32768 UTF-16 characters. ++ * NTFS, VFAT, exFAT and ReFS support filenames up to 255 UTF-16/UCS-2 characters. (For ReFS, there is no information ++ * on the on-disk format, and it is possible that it supports longer filenames, up to 32768 UTF-16/UCS-2 characters.) ++ * The buffer cannot be larger than 64k, because up to Windows 8.1, NtQueryDirectoryFile and GetFileInformationByHandleEx ++ * fail with ERROR_INVALID_PARAMETER when trying to retrieve the filenames from a network share. + */ +-BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = sizeof(file_id_extd_dir_info) + 65536u; ++BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = 65536u; + + inline system::error_code dir_itr_close(dir_itr_imp& imp) BOOST_NOEXCEPT + { diff --git a/recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch b/recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch new file mode 100644 index 0000000000000..9312059a60000 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch @@ -0,0 +1,171 @@ +commit 476ca7b6c1d37a5d796f8525813a9a64c9e54ffc +Author: Andrey Semashev +Date: Wed Aug 10 04:57:21 2022 +0300 + + Fix weakly_canonical on Windows with long paths prefix. + + During its operation, weakly_canonical would call status() on the path + consisting only from the root name of the input path. This would fail + with ERROR_INVALID_FUNCTION if the root name starts with the "\\?\" prefix, + as the root name path is not absolute. + + To fix this, we don't check the status of the root name path (which is + not the correct check anyways as it tests the current directory on the + corresponding drive for existence, which is not what we want). Additionally, + avoid calling status() on the paths containing dot and dot-dot elements + during the weakly_canonical execution for the same reason - the "\\?\" + prefix disables most of the path processing in Windows APIs, including + dot and dot-dot elements resolution. + + Fixes https://github.com/boostorg/filesystem/issues/247. + +diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp +index dd636e9..ca2fff3 100644 +--- a/libs/filesystem/src/operations.cpp ++++ b/libs/filesystem/src/operations.cpp +@@ -4434,7 +4434,7 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + path head(p); + for (; !head.empty(); --itr) + { +- file_status head_status = detail::status_impl(head, &local_ec); ++ file_status head_status(detail::status_impl(head, &local_ec)); + if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { + if (!ec) +@@ -4450,32 +4450,83 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + head.remove_filename(); + } + ++ if (head.empty()) ++ return p.lexically_normal(); ++ ++ path const& dot_p = dot_path(); ++ path const& dot_dot_p = dot_dot_path(); ++ + #else + +- // On Windows, filesystem APIs such as GetFileAttributesW perform lexical path normalization internally. +- // As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would break +- // canonical, as symlink_status that it calls internally would report an error that the file at the intermediate +- // path does not exist. To avoid this, scan the initial path in the forward direction. +- // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW, +- // which is called in status() may return "file not found" for paths to network shares and mounted cloud +- // storages that have forward slashes as separators. ++ // On Windows, filesystem APIs such as GetFileAttributesW and CreateFileW perform lexical path normalization ++ // internally. As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would ++ // break canonical, as symlink_status that it calls internally would report an error that the file at the ++ // intermediate path does not exist. To avoid this, scan the initial path in the forward direction. ++ // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW ++ // or CreateFileW, which is called in status() may return "file not found" for paths to network shares and ++ // mounted cloud storages that have forward slashes as separators. ++ // Also, avoid querying status of the root name such as \\?\c: as CreateFileW returns ERROR_INVALID_FUNCTION for ++ // such path. Querying the status of a root name such as c: is also not right as this path refers to the current ++ // directory on drive C:, which is not what we want to test for existence anyway. + path::iterator itr(p.begin()); + path head; +- for (; itr != p_end; ++itr) ++ if (p.has_root_name()) + { +- path const& p_elem = *itr; +- if (p_elem.size() == 1u && detail::is_directory_separator(p_elem.native()[0])) ++ BOOST_ASSERT(itr != p_end); ++ head = *itr; ++ ++itr; ++ } ++ ++ if (p.has_root_directory()) ++ { ++ BOOST_ASSERT(itr != p_end); ++ // Convert generic separator returned by the iterator for the root directory to ++ // the preferred separator. ++ head += path::preferred_separator; ++ ++itr; ++ } ++ ++ if (!head.empty()) ++ { ++ file_status head_status(detail::status_impl(head, &local_ec)); ++ if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { +- // Convert generic separator returned by the iterator for the root directory to +- // the preferred separator. +- head += path::preferred_separator; ++ if (!ec) ++ BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::weakly_canonical", head, local_ec)); ++ ++ *ec = local_ec; ++ return path(); + } +- else ++ ++ if (head_status.type() == fs::file_not_found) ++ { ++ // If the root path does not exist then no path element exists ++ return p.lexically_normal(); ++ } ++ } ++ ++ path const& dot_p = dot_path(); ++ path const& dot_dot_p = dot_dot_path(); ++ for (; itr != p_end; ++itr) ++ { ++ path const& p_elem = *itr; ++ ++ // Avoid querying status of paths containing dot and dot-dot elements, as this will break ++ // if the root name starts with "\\?\". ++ if (p_elem == dot_p) ++ continue; ++ ++ if (p_elem == dot_dot_p) + { +- head /= p_elem; ++ if (head.has_relative_path()) ++ head.remove_filename(); ++ ++ continue; + } + +- file_status head_status = detail::status_impl(head, &local_ec); ++ head /= p_elem; ++ ++ file_status head_status(detail::status_impl(head, &local_ec)); + if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { + if (!ec) +@@ -4492,33 +4543,22 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + } + } + ++ if (head.empty()) ++ return p.lexically_normal(); ++ + #endif + +- path const& dot_p = dot_path(); +- path const& dot_dot_p = dot_dot_path(); + path tail; + bool tail_has_dots = false; + for (; itr != p_end; ++itr) + { + path const& tail_elem = *itr; +-#if defined(BOOST_WINDOWS_API) +- if (tail_elem.size() == 1u && detail::is_directory_separator(tail_elem.native()[0])) +- { +- // Convert generic separator returned by the iterator for the root directory to +- // the preferred separator. +- tail += path::preferred_separator; +- continue; +- } +-#endif + tail /= tail_elem; + // for a later optimization, track if any dot or dot-dot elements are present + if (!tail_has_dots && (tail_elem == dot_p || tail_elem == dot_dot_p)) + tail_has_dots = true; + } + +- if (head.empty()) +- return p.lexically_normal(); +- + head = detail::canonical(head, base, &local_ec); + if (BOOST_UNLIKELY(!!local_ec)) + { diff --git a/recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch b/recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch new file mode 100644 index 0000000000000..4245f23e76299 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch @@ -0,0 +1,175 @@ +diff -urN a/boost/unordered/detail/fca.hpp b/boost/unordered/detail/fca.hpp +--- a/boost/unordered/detail/fca.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/fca.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -646,7 +646,7 @@ + + size_type bucket_count() const { return size_; } + +- iterator begin() const { return ++at(size_); } ++ iterator begin() const { return size_ == 0 ? end() : ++at(size_); } + + iterator end() const + { +@@ -660,6 +660,10 @@ + + local_iterator begin(size_type n) const + { ++ if (size_ == 0) { ++ return this->end(n); ++ } ++ + return local_iterator( + (buckets + static_cast(n))->next); + } +@@ -670,12 +674,16 @@ + + iterator at(size_type n) const + { +- std::size_t const N = group::N; ++ if (size_ > 0) { ++ std::size_t const N = group::N; + +- iterator pbg(buckets + static_cast(n), +- groups + static_cast(n / N)); ++ iterator pbg(buckets + static_cast(n), ++ groups + static_cast(n / N)); + +- return pbg; ++ return pbg; ++ } else { ++ return this->end(); ++ } + } + + span raw() +diff -urN a/boost/unordered/detail/implementation.hpp b/boost/unordered/detail/implementation.hpp +--- a/boost/unordered/detail/implementation.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/implementation.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -2054,12 +2054,14 @@ + + std::size_t bucket_size(std::size_t index) const + { +- bucket_iterator itb = buckets_.at(index); +- node_pointer n = itb->next; + std::size_t count = 0; +- while (n) { +- ++count; +- n = n->next; ++ if (size_ > 0) { ++ bucket_iterator itb = buckets_.at(index); ++ node_pointer n = itb->next; ++ while (n) { ++ ++count; ++ n = n->next; ++ } + } + return count; + } +@@ -2420,11 +2422,14 @@ + node_pointer find_node_impl( + Key const& x, bucket_iterator itb) const + { +- key_equal const& pred = this->key_eq(); +- node_pointer p = itb->next; +- for (; p; p = p->next) { +- if (pred(x, extractor::extract(p->value()))) { +- break; ++ node_pointer p = node_pointer(); ++ if (itb != buckets_.end()) { ++ key_equal const& pred = this->key_eq(); ++ p = itb->next; ++ for (; p; p = p->next) { ++ if (pred(x, extractor::extract(p->value()))) { ++ break; ++ } + } + } + return p; +@@ -2453,11 +2458,13 @@ + inline iterator transparent_find( + Key const& k, Hash const& h, Pred const& pred) const + { +- std::size_t const key_hash = h(k); +- bucket_iterator itb = buckets_.at(buckets_.position(key_hash)); +- for (node_pointer p = itb->next; p; p = p->next) { +- if (BOOST_LIKELY(pred(k, extractor::extract(p->value())))) { +- return iterator(p, itb); ++ if (size_ > 0) { ++ std::size_t const key_hash = h(k); ++ bucket_iterator itb = buckets_.at(buckets_.position(key_hash)); ++ for (node_pointer p = itb->next; p; p = p->next) { ++ if (BOOST_LIKELY(pred(k, extractor::extract(p->value())))) { ++ return iterator(p, itb); ++ } + } + } + +@@ -2467,11 +2474,13 @@ + template + node_pointer* find_prev(Key const& key, bucket_iterator itb) + { +- key_equal pred = this->key_eq(); +- for (node_pointer* pp = boost::addressof(itb->next); *pp; +- pp = boost::addressof((*pp)->next)) { +- if (pred(key, extractor::extract((*pp)->value()))) { +- return pp; ++ if (size_ > 0) { ++ key_equal pred = this->key_eq(); ++ for (node_pointer* pp = boost::addressof(itb->next); *pp; ++ pp = boost::addressof((*pp)->next)) { ++ if (pred(key, extractor::extract((*pp)->value()))) { ++ return pp; ++ } + } + } + typedef node_pointer* node_pointer_pointer; +diff -urN a/boost/unordered/unordered_map.hpp b/boost/unordered/unordered_map.hpp +--- a/boost/unordered/unordered_map.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/unordered_map.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -2069,6 +2069,10 @@ + template + float unordered_map::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +@@ -2506,6 +2510,10 @@ + template + float unordered_multimap::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +diff -urN a/boost/unordered/unordered_set.hpp b/boost/unordered/unordered_set.hpp +--- a/boost/unordered/unordered_set.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/unordered_set.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -1586,6 +1586,10 @@ + template + float unordered_set::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +@@ -1986,6 +1990,10 @@ + template + float unordered_multiset::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); diff --git a/recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch b/recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch new file mode 100644 index 0000000000000..dfa4438d93acd --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch @@ -0,0 +1,21 @@ +commit 5864f397ccad30f6e73221b90bdac57a303b9752 +Author: Andrey Semashev +Date: Fri Aug 12 12:59:56 2022 +0300 + + Fixed a missing include on POSIX systems that don't support *at APIs. + + Fixes https://github.com/boostorg/filesystem/issues/250. + +diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp +index ca2fff3..e22967e 100644 +--- a/libs/filesystem/src/operations.cpp ++++ b/libs/filesystem/src/operations.cpp +@@ -70,7 +70,7 @@ + + #include + #include +-#if _POSIX_C_SOURCE < 200809L ++#if !defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS) + #include + #endif + #include diff --git a/recipes/boost/all/patches/1.80.0-0005-config-libcpp15.patch b/recipes/boost/all/patches/1.80.0-0005-config-libcpp15.patch new file mode 100644 index 0000000000000..1e84702f8b06b --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0005-config-libcpp15.patch @@ -0,0 +1,16 @@ +--- a/boost/config/stdlib/libcpp.hpp 2022-08-03 22:47:07.000000000 -0400 ++++ b/boost/config/stdlib/libcpp.hpp 2022-09-16 22:16:17.044119011 -0400 +@@ -168,4 +168,13 @@ + # define BOOST_NO_CXX14_HDR_SHARED_MUTEX + #endif + ++#if _LIBCPP_VERSION >= 15000 ++// ++// Unary function is now deprecated in C++11 and later: ++// ++#if __cplusplus >= 201103L ++#define BOOST_NO_CXX98_FUNCTION_BASE ++#endif ++#endif ++ + // --- end --- diff --git a/recipes/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch b/recipes/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch new file mode 100644 index 0000000000000..ff133016a2022 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch @@ -0,0 +1,18 @@ +--- a/boost/unordered/detail/prime_fmod.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/prime_fmod.hpp 2022-12-14 01:45:27.368620146 -0500 +@@ -117,9 +117,15 @@ + #if defined(BOOST_UNORDERED_FCA_HAS_64B_SIZE_T) + std::size_t sizes_under_32bit = inv_sizes32_len; + if (BOOST_LIKELY(size_index < sizes_under_32bit)) { ++#if defined(__MSVC_RUNTIME_CHECKS) ++ return fast_modulo( ++ boost::uint32_t(hash & 0xffffffffu) + boost::uint32_t(hash >> 32), ++ inv_sizes32[size_index], boost::uint32_t(sizes[size_index])); ++#else + return fast_modulo( + boost::uint32_t(hash) + boost::uint32_t(hash >> 32), + inv_sizes32[size_index], boost::uint32_t(sizes[size_index])); ++#endif + } else { + return positions[size_index - sizes_under_32bit](hash); + } diff --git a/recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch b/recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch new file mode 100644 index 0000000000000..e352396226710 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch @@ -0,0 +1,84 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 3c517c884..0f521dbcf 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -20,6 +20,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; +@@ -29,7 +30,8 @@ feature.feature boost.locale.winapi : on off : optional propagated ; + + ## iconv + +-exe has_iconv : $(TOP)/build/has_iconv.cpp ; ++obj has_iconv_libc_obj : $(TOP)/build/has_iconv.cpp ; ++exe has_iconv : has_iconv_libc_obj ; + explicit has_iconv ; + + ICONV_PATH = [ modules.peek : ICONV_PATH ] ; +@@ -43,7 +45,8 @@ lib iconv + + explicit iconv ; + +-exe has_external_iconv : $(TOP)/build/has_iconv.cpp iconv ; ++obj has_iconv_libc_ext : $(TOP)/build/has_iconv.cpp iconv ; ++exe has_external_iconv : has_iconv_libc_ext iconv ; + explicit has_external_iconv ; + + exe accepts_shared_option : $(TOP)/build/option.cpp +@@ -230,10 +233,37 @@ rule configure-full ( properties * : flags-only ) + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; +- } else if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ if libiconv in $(properties) ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ result += iconv ; ++ } ++ else ++ { ++ EXIT "- Boost.Locale found iconv (libc) instead of iconv (separate) library to be built." ; ++ } ++ } ++ } ++ else if libc in $(properties) + { +- found-iconv = true ; +- result += iconv ; ++ EXIT "- Boost.Locale failed to find iconv (libc) library to be built." ; ++ } ++ else ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ found-iconv = true ; ++ result += iconv ; ++ } ++ else if libiconv in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (separate) library to be built." ; ++ } ++ } ++ if ! $(found-iconv) ++ { ++ EXIT "- Boost.Locale failed to find iconv library to be built." ; + } + } + if $(found-iconv) +@@ -273,6 +303,10 @@ rule configure-full ( properties * : flags-only ) + /boost/thread//boost_thread + ; + } ++ else ++ { ++ EXIT "- Boost.Locale failed to find ICU library to be built." ; ++ } + } + + if ! $(found-iconv) && ! $(found-icu) && ! windows in $(properties) && ! cygwin in $(properties) diff --git a/recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch b/recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch new file mode 100644 index 0000000000000..80b22dd54b0e1 --- /dev/null +++ b/recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch @@ -0,0 +1,12 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index f1321db3..36899cdc 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -22,6 +22,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; diff --git a/recipes/boost/all/patches/bcp_namespace_issues_1_71.patch b/recipes/boost/all/patches/bcp_namespace_issues_1_71.patch new file mode 100644 index 0000000000000..94e748ef55f4b --- /dev/null +++ b/recipes/boost/all/patches/bcp_namespace_issues_1_71.patch @@ -0,0 +1,33 @@ +From d0586e88122f41cd5ac9666db70c37d6f0fc7480 Mon Sep 17 00:00:00 2001 +From: Peter Dimov +Date: Sun, 26 May 2019 18:49:12 +0300 +Subject: [PATCH] Fix `bcp --namespace` issues + +--- + Jamroot | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Jamroot b/Jamroot +index e0d7c90f51d..4e913c2b3f3 100644 +--- a/Jamroot ++++ b/Jamroot +@@ -140,7 +140,8 @@ import "class" : new ; + import property-set ; + import threadapi-feature ; + import option ; +-import tools/boost_install/boost-install ; ++# Backslash because of `bcp --namespace` ++import tools/boost\_install/boost-install ; + + path-constant BOOST_ROOT : . ; + constant BOOST_VERSION : 1.71.0 ; +@@ -311,8 +312,8 @@ rule boost-install ( libraries * ) + # stage and install targets via boost-install, above. + rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * ) + { ++ autolink = shared:BOOST_$(name:U)_DYN_LINK=1 ; + name = boost_$(name) ; +- autolink = shared:$(name:U)_DYN_LINK=1 ; + lib $(name) + : $(sources) + : $(requirements) $(autolink) diff --git a/recipes/boost/all/patches/bcp_namespace_issues_1_72.patch b/recipes/boost/all/patches/bcp_namespace_issues_1_72.patch new file mode 100644 index 0000000000000..5ffe1ec157b19 --- /dev/null +++ b/recipes/boost/all/patches/bcp_namespace_issues_1_72.patch @@ -0,0 +1,33 @@ +From d0586e88122f41cd5ac9666db70c37d6f0fc7480 Mon Sep 17 00:00:00 2001 +From: Peter Dimov +Date: Sun, 26 May 2019 18:49:12 +0300 +Subject: [PATCH] Fix `bcp --namespace` issues + +--- + Jamroot | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Jamroot b/Jamroot +index e0d7c90f51d..4e913c2b3f3 100644 +--- a/Jamroot ++++ b/Jamroot +@@ -140,7 +140,8 @@ import "class" : new ; + import property-set ; + import threadapi-feature ; + import option ; +-import tools/boost_install/boost-install ; ++# Backslash because of `bcp --namespace` ++import tools/boost\_install/boost-install ; + + path-constant BOOST_ROOT : . ; + constant BOOST_VERSION : 1.72.0 ; +@@ -311,8 +312,8 @@ rule boost-install ( libraries * ) + # stage and install targets via boost-install, above. + rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * ) + { ++ autolink = shared:BOOST_$(name:U)_DYN_LINK=1 ; + name = boost_$(name) ; +- autolink = shared:$(name:U)_DYN_LINK=1 ; + lib $(name) + : $(sources) + : $(requirements) $(autolink) diff --git a/recipes/boost/all/patches/boost_1_77_mpi_check.patch b/recipes/boost/all/patches/boost_1_77_mpi_check.patch new file mode 100644 index 0000000000000..59e5030464cca --- /dev/null +++ b/recipes/boost/all/patches/boost_1_77_mpi_check.patch @@ -0,0 +1,24 @@ +diff -ru a/tools/build/src/tools/mpi.jam b/tools/build/src/tools/mpi.jam +--- a/tools/build/src/tools/mpi.jam 2019-12-10 01:20:16.000000000 +0100 ++++ b/tools/build/src/tools/mpi.jam 2020-09-02 13:17:22.942349254 +0200 +@@ -66,6 +66,8 @@ + import type ; + import path ; + ++import errors ; ++ + # Make this module a project + project.initialize $(__name__) ; + project mpi ; +@@ -538,6 +540,11 @@ + # Set up the "mpi" alias + alias mpi : : : : $(options) ; + } ++ ++ if ! $(.configured) ++ { ++ errors.user-error "MPI not configured" ; ++ } + } + + # States whether MPI has bee configured diff --git a/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch b/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch new file mode 100644 index 0000000000000..5e6c660ee96c2 --- /dev/null +++ b/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch @@ -0,0 +1,22 @@ +diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam +index 155b1ac3..64274e65 100644 +--- a/tools/build/src/tools/qcc.jam ++++ b/tools/build/src/tools/qcc.jam +@@ -48,7 +48,7 @@ generators.register-c-compiler qcc.compile.asm : ASM : OBJ : qcc ; + + + # Declare flags for compilation. +-toolset.flags qcc.compile OPTIONS on : -gstabs+ ; ++toolset.flags qcc.compile OPTIONS on : -g ; + + # Declare flags and action for compilation. + toolset.flags qcc.compile OPTIONS off : -O0 ; +@@ -164,7 +164,7 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; + + # Declare flags for linking. + # First, the common flags. +-toolset.flags qcc.link OPTIONS on : -gstabs+ ; ++toolset.flags qcc.link OPTIONS on : -g ; + toolset.flags qcc.link OPTIONS on : -p ; + toolset.flags qcc.link OPTIONS ; + toolset.flags qcc.link LINKPATH ; diff --git a/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch b/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch new file mode 100644 index 0000000000000..29b744e9667d3 --- /dev/null +++ b/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch @@ -0,0 +1,22 @@ +diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam +index 740e907..b0653f1 100644 +--- a/tools/build/src/tools/qcc.jam ++++ b/tools/build/src/tools/qcc.jam +@@ -86,7 +86,7 @@ local rule check-target-platform + } + + # Declare flags for compilation. +-toolset.flags qcc.compile OPTIONS on : -gstabs+ ; ++toolset.flags qcc.compile OPTIONS on : -g ; + + # Declare flags and action for compilation. + toolset.flags qcc.compile OPTIONS off : -O0 ; +@@ -216,7 +216,7 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; + + # Declare flags for linking. + # First, the common flags. +-toolset.flags qcc.link OPTIONS on : -gstabs+ ; ++toolset.flags qcc.link OPTIONS on : -g ; + toolset.flags qcc.link OPTIONS on : -p ; + toolset.flags qcc.link OPTIONS ; + toolset.flags qcc.link LINKPATH ; diff --git a/recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch b/recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch new file mode 100644 index 0000000000000..dffef671e7992 --- /dev/null +++ b/recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch @@ -0,0 +1,20 @@ +diff --git a/boost/core/uncaught_exceptions.hpp b/boost/core/uncaught_exceptions.hpp +index c39120b..436717f 100644 +--- a/boost/core/uncaught_exceptions.hpp ++++ b/boost/core/uncaught_exceptions.hpp +@@ -56,10 +56,15 @@ + // On Linux with clang and libc++ and on OS X, there is a version of cxxabi.h from libc++abi that doesn't declare __cxa_get_globals, but provides __cxa_uncaught_exceptions. + // The function only appeared in version _LIBCPPABI_VERSION >= 1002 of the library. Unfortunately, there are linking errors about undefined reference to __cxa_uncaught_exceptions + // on Ubuntu Trusty and OS X, so we avoid using it and forward-declare __cxa_get_globals instead. ++// On QNX SDP 7.0 (QCC 5.4.0), there are multiple cxxabi.h, one from glibcxx from gcc and another from libc++abi from LLVM. Which one is included will be determined by the qcc ++// command line arguments (-V and/or -Y; http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html). The LLVM libc++abi is missing the declaration ++// of __cxa_get_globals but it is also patched by QNX developers to not define _LIBCPPABI_VERSION. Older QNX SDP versions, up to and including 6.6, don't provide LLVM and libc++abi. ++// See https://github.com/boostorg/core/issues/59. + #if !defined(__FreeBSD__) && \ + ( \ + (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 407) || \ + defined(__OpenBSD__) || \ ++ (defined(__QNXNTO__) && !defined(__GLIBCXX__) && !defined(__GLIBCPP__)) || \ + defined(_LIBCPPABI_VERSION) \ + ) + namespace __cxxabiv1 { diff --git a/recipes/boost/all/patches/boost_locale_fail_on_missing_backend.patch b/recipes/boost/all/patches/boost_locale_fail_on_missing_backend.patch new file mode 100644 index 0000000000000..f1a0b7958449e --- /dev/null +++ b/recipes/boost/all/patches/boost_locale_fail_on_missing_backend.patch @@ -0,0 +1,60 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 578e722..b715f59 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -17,6 +17,7 @@ import feature ; + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; +@@ -217,6 +217,21 @@ rule configure-full ( properties * : flags-only ) + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; ++ if libiconv in $(properties) ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ result += iconv ; ++ } ++ else ++ { ++ EXIT "- Boost.Locale found iconv (libc) instead of iconv (separate) library to be built." ; ++ } ++ } ++ } ++ else if libc in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (libc) library to be built." ; + } + else + { +@@ -225,6 +234,14 @@ rule configure-full ( properties * : flags-only ) + found-iconv = true ; + result += iconv ; + } ++ else if libiconv in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (separate) library to be built." ; ++ } ++ } ++ if ! $(found-iconv) ++ { ++ EXIT "- Boost.Locale failed to find iconv library to be built." ; + } + } + if $(found-iconv) +@@ -265,6 +282,10 @@ rule configure-full ( properties * : flags-only ) + ../../thread/build//boost_thread + ; + } ++ else ++ { ++ EXIT "- Boost.Locale failed to find ICU library to be built." ; ++ } + + } + diff --git a/recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch b/recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch new file mode 100644 index 0000000000000..bb010943f2bde --- /dev/null +++ b/recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch @@ -0,0 +1,13 @@ +diff --git a/libs/log/src/text_file_backend.cpp b/libs/log/src/text_file_backend.cpp +index 50cef3b..d5fd02e 100644 +--- a/libs/log/src/text_file_backend.cpp ++++ b/libs/log/src/text_file_backend.cpp +@@ -39,6 +39,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include diff --git a/recipes/boost/all/patches/boost_mpi_check.patch b/recipes/boost/all/patches/boost_mpi_check.patch new file mode 100644 index 0000000000000..af7e45f610510 --- /dev/null +++ b/recipes/boost/all/patches/boost_mpi_check.patch @@ -0,0 +1,24 @@ +diff -ru a/tools/build/src/tools/mpi.jam b/tools/build/src/tools/mpi.jam +--- a/tools/build/src/tools/mpi.jam 2019-12-10 01:20:16.000000000 +0100 ++++ b/tools/build/src/tools/mpi.jam 2020-09-02 13:17:22.942349254 +0200 +@@ -66,6 +66,8 @@ + import type ; + import path ; + ++import errors ; ++ + # Make this module a project + project.initialize $(__name__) ; + project mpi ; +@@ -539,6 +541,11 @@ + # Set up the "mpi" alias + alias mpi : : : : $(options) ; + } ++ ++ if ! $(.configured) ++ { ++ errors.user-error "MPI not configured" ; ++ } + } + + # States whether MPI has bee configured diff --git a/recipes/boost/all/patches/python_base_prefix.patch b/recipes/boost/all/patches/python_base_prefix.patch new file mode 100644 index 0000000000000..47371cba773df --- /dev/null +++ b/recipes/boost/all/patches/python_base_prefix.patch @@ -0,0 +1,25 @@ +diff -ru a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +--- a/tools/build/src/tools/python.jam ++++ b/tools/build/src/tools/python.jam +@@ -746,7 +746,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + # Values to be extracted from python's sys module. These will be set by + # the probe rule, above, using Jam's dynamic scoping. +- local sys-elements = version platform prefix exec_prefix executable ; ++ local sys-elements = version platform base_prefix base_exec_prefix executable ; + local sys.$(sys-elements) ; + + # Compute the string Python's sys.platform needs to match. If not +@@ -786,10 +786,10 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + debug-message ...requested configuration matched! ; + +- exec-prefix = $(sys.exec_prefix) ; ++ exec-prefix = $(sys.base_exec_prefix) ; + + compute-default-paths $(target-os) : $(sys.version) : +- $(sys.prefix) : $(sys.exec_prefix) ; ++ $(sys.base_prefix) : $(sys.base_exec_prefix) ; + + version = $(sys.version) ; + interpreter-cmd ?= $(cmd) ; diff --git a/recipes/boost/all/patches/python_base_prefix_since_1_74.patch b/recipes/boost/all/patches/python_base_prefix_since_1_74.patch new file mode 100644 index 0000000000000..2267fe4762dc8 --- /dev/null +++ b/recipes/boost/all/patches/python_base_prefix_since_1_74.patch @@ -0,0 +1,26 @@ +diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +index cf8c379..3e3f095 100644 +--- a/tools/build/src/tools/python.jam ++++ b/tools/build/src/tools/python.jam +@@ -749,7 +749,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + # Values to be extracted from python's sys module. These will be set by + # the probe rule, above, using Jam's dynamic scoping. +- local sys-elements = version platform prefix exec_prefix executable ; ++ local sys-elements = version platform base_prefix base_exec_prefix executable ; + local sys.$(sys-elements) ; + + # Compute the string Python's sys.platform needs to match. If not +@@ -789,10 +789,10 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + debug-message ...requested configuration matched! ; + +- exec-prefix = $(sys.exec_prefix) ; ++ exec-prefix = $(sys.base_exec_prefix) ; + + compute-default-paths $(target-os) : $(sys.version) : +- $(sys.prefix) : $(sys.exec_prefix) ; ++ $(sys.base_prefix) : $(sys.base_exec_prefix) ; + + version = $(sys.version) ; + interpreter-cmd ?= $(cmd) ; diff --git a/recipes/boost/all/patches/solaris_pthread_data.patch b/recipes/boost/all/patches/solaris_pthread_data.patch new file mode 100644 index 0000000000000..ea5e4d7048d4e --- /dev/null +++ b/recipes/boost/all/patches/solaris_pthread_data.patch @@ -0,0 +1,13 @@ +diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp +index aefbeb4..bc9b136 100644 +--- a/boost/thread/pthread/thread_data.hpp ++++ b/boost/thread/pthread/thread_data.hpp +@@ -57,7 +57,7 @@ namespace boost + #else + std::size_t page_size = ::sysconf( _SC_PAGESIZE); + #endif +-#if PTHREAD_STACK_MIN > 0 ++#ifdef PTHREAD_STACK_MIN + if (size Path: + return self.tmppath / "boost" + + def do_git_update(self) -> None: + if not self.boost_path.exists(): + with tools.chdir(str(self.tmppath)): + print("Cloning boost git") + subprocess.check_call(["git", "clone", "--", self.git_url, "boost"]) + with tools.chdir(str(self.boost_path)): + print("Checking out current master") + subprocess.check_call(["git", "checkout", "origin/master"]) + print("Removing master branch") + subprocess.check_call(["git", "branch", "-D", "master"]) + else: + with tools.chdir(str(self.boost_path)): + print("Updating git repo") + subprocess.check_call(["git", "fetch", "origin"]) + print("Removing all local changes to git repo") + subprocess.check_call(["git", "reset", "--hard", "HEAD"]) + print("Checking out current master") + subprocess.check_call(["git", "checkout", "origin/master"]) + + def do_git_submodule_update(self): + with tools.chdir(str(self.boost_path)): + if not self.unsafe: + # De-init + init to make sure that boostdep won't detect a new or removed boost library + print("De-init git submodules") + subprocess.check_call(["git", "submodule", "deinit", "--all", "-f"]) + + try: + print("Checking out version {}".format(self.boost_version)) + subprocess.check_call(["git", "checkout", "boost-{}".format(self.boost_version)]) + except subprocess.CalledProcessError: + print("version {} does not exist".format(self.boost_version)) + raise + + print("Re-init git submodules") + subprocess.check_call(["git", "submodule", "update", "--init"]) + + print("Removing unknown files/directories") + subprocess.check_call(["git", "clean", "-d", "-f"]) + + def do_install_boostdep(self): + with tools.chdir(str(self.boost_path)): + print("Installing boostdep/{}".format(self.boostdep_version)) + subprocess.check_call(["conan", "install", "boostdep/{}@".format(self.boostdep_version), "-g", "json"]) + + @property + def _bin_paths(self): + with tools.chdir(str(self.boost_path)): + data = json.loads(open("conanbuildinfo.json").read()) + return data["dependencies"][0]["bin_paths"] + + _GREP_IGNORE_PREFIX = ("#", "\"") + _GREP_IGNORE_PARTS = ("boost", "<", ">") + + @classmethod + def _grep_libs(cls, regex, text): + res = set() + for m in re.finditer(regex, text, flags=re.MULTILINE): + # If text before main capture group contains a string or a comment => ignore + ignore = False + for ign in cls._GREP_IGNORE_PREFIX: + if ign in m.group(1): + ignore = True + if ignore: + continue + l = m.group(2).lower() + ignore = False + for ign in cls._GREP_IGNORE_PARTS: + if ign in l: + ignore = True + if ignore: + continue + res.add(l) + return list(res) + + def _grep_requirements(self, component: str) -> List[str]: + jam = self.boost_path / "libs" / component / "build" / "Jamfile.v2" + if not jam.is_file(): + jam = self.boost_path / "libs" / component / "build" / "Jamfile" + if not jam.is_file(): + log.warning("Can't find Jamfile for %s. Unable to determine dependencies.", component) + return [] + contents = jam.open().read() + + using = self._grep_libs("\n(.*)using\\s+([^ ;:]+)\\s*", contents) + libs = self._grep_libs("\n(.*)\\s(?:searched-)?lib\\s+([^ \t\n;:]+)", contents) + + requirements = using + libs + return requirements + + def _sort_requirements(self, requirements: List[str]) -> Tuple[List[str], Dict[str, List[str]], List[str]]: + conan_requirements = set() + system_libs = {} + unknown_libs = set() + + for req in requirements: + if req in LINUX_SYSTEM_LIBS: + system_libs.setdefault("linux", []).append(req) + continue + if req in WINDOWS_SYSTEM_LIBS: + system_libs.setdefault("windows", []).append(req) + continue + added = False + for conan_req in CONAN_REQUIREMENTS: + if conan_req in req: + conan_requirements.add(conan_req) + added = True + if added: + continue + unknown_libs.add(req) + return list(conan_requirements), system_libs, list(unknown_libs) + + def do_boostdep_collect(self) -> BoostDependencies: + with tools.chdir(str(self.boost_path)): + with tools.environment_append({"PATH": self._bin_paths}): + buildables = subprocess.check_output(["boostdep", "--list-buildable"], text=True) + buildables = buildables.splitlines() + log.debug("`boostdep --list--buildable` returned these buildables: %s", buildables) + + # modules = subprocess.check_output(["boostdep", "--list-modules"]) + # modules = modules.decode().splitlines() + + dep_modules = buildables + + dependency_tree = {} + buildable_dependencies = subprocess.check_output(["boostdep", "--list-buildable-dependencies"], text=True) + log.debug("boostdep --list-buildable-dependencies returns: %s", buildable_dependencies) + for line in buildable_dependencies.splitlines(): + if re.match(r"^[\s]*#.*", line): + continue + match = re.match(r"([\S]+)\s*=\s*([^;]+)\s*;\s*", line) + if not match: + continue + master = match.group(1) + dependencies = re.split(r"\s+", match.group(2).strip()) + dependency_tree[master] = dependencies + + log.debug("Using `boostdep --track-sources`, the following dependency tree was calculated:") + log.debug(pprint.pformat(dependency_tree)) + + filtered_dependency_tree = {k: [d for d in v if d in buildables] for k, v in dependency_tree.items() if k in buildables} + + configure_options = [] + for conf_option in CONFIGURE_OPTIONS: + if conf_option in filtered_dependency_tree: + configure_options.append(conf_option) + else: + log.warning("option %s not available in %s", conf_option, self.boost_version) + + log.debug("Following config_options remain: %s", configure_options) + + requirements = {} + for conf_option in configure_options: + reqs = self._grep_requirements(conf_option) + conan_requirements, system_libs, unknown_libs = self._sort_requirements(reqs) + if system_libs: + log.warning("Module '%s' (%s) has system libraries: %s", conf_option, self.boost_version, system_libs) + if unknown_libs: + log.warning("Module '%s' (%s) has unknown libs: %s", conf_option, self.boost_version, unknown_libs) + if conan_requirements: + requirements[conf_option] = conan_requirements + + boost_dependencies = BoostDependencies( + export=BoostDependenciesExport( + version=self.boost_version, + configure_options=configure_options, + dependencies=filtered_dependency_tree, + requirements=requirements, + static_only=[], + ), + buildables=buildables, + ) + + return boost_dependencies + + @staticmethod + def detect_cycles(tree: Dict[str, List[str]]) -> Dict[str, List[str]]: + tree = {k: v[:] for k, v in tree.items()} + while tree: + nodeps = set(k for k, v in tree.items() if not v) + if not nodeps: + return tree + tree = {k: [d for d in v if d not in nodeps] for k, v in tree.items() if k not in nodeps} + return {} + + def _fix_dependencies(self, deptree: Dict[str, List[str]]) -> Dict[str, List[str]]: + try: + # python does not depend on graph + deptree["python"].remove("graph") + except (KeyError, ValueError): + pass + + try: + # graph does not depend on graph_parallel + deptree["graph"].remove("graph_parallel") + except (KeyError, ValueError): + pass + + try: + # mpi does not depend on python + deptree["mpi"].remove("python") + except (KeyError, ValueError): + pass + + if "mpi_python" in deptree and "python" not in deptree["mpi_python"]: + deptree["mpi_python"].append("python") + + # Break random/math dependency cycle + try: + deptree["math"].remove("random") + except ValueError: + pass + + remaining_tree = self.detect_cycles(deptree) + if remaining_tree: + raise Exception("Dependency cycle detected. Remaining tree: {}".format(remaining_tree)) + return deptree + + @staticmethod + def _boostify_library(lib: str) -> str: + return "boost_{}".format(lib) + + def do_create_libraries(self, boost_dependencies: BoostDependencies): + libraries = {} + module_provides_extra = {} + + # Look for the names of libraries in Jam build files + for buildable in boost_dependencies.buildables: + construct_jam = lambda jam_ext : self.boost_path / "libs" / buildable / "build" / "Jamfile{}".format(jam_ext) + try: + buildable_jam = next(construct_jam(jam_ext) for jam_ext in ("", ".v2") if construct_jam(jam_ext).is_file()) + except StopIteration: + raise Exception("Cannot find jam build file for {}".format(buildable)) + jam_text = buildable_jam.read_text() + buildable_libs = re.findall("[ \n](boost-)?lib ([a-zA-Z0-9_]+)[ \n]", jam_text) + buildable_libs = set("boost_{}".format(lib) if lib_prefix else lib for lib_prefix, lib in buildable_libs) + buildable_libs = set(l[len("boost_"):] for l in buildable_libs if l.startswith("boost_")) # list(filter(lambda l: l.startswith("boost"), buildable_libs)) + + if not buildable_libs: + # Some boost releases support multiple python versions + if buildable == "python": + buildable_libs.add("python") + if not buildable_libs: + raise Exception("Cannot find any library for buildable {}".format(buildable)) + + if buildable in buildable_libs: + libraries[buildable] = ["boost_{}".format(buildable)] + buildable_libs.remove(buildable) + else: + libraries[buildable] = [] + module_provides_extra[buildable] = buildable_libs + for buildable_dep in buildable_libs: + boost_dependencies.export.dependencies[buildable_dep] = [buildable] + libraries[buildable_dep] = ["boost_{}".format(buildable_dep)] + + # Boost.Test: unit_test_framework depends on all libraries of Boost.Test + if "unit_test_framework" in boost_dependencies.export.dependencies and "test" in module_provides_extra: + boost_dependencies.export.dependencies["unit_test_framework"].extend(module_provides_extra["test"].difference({"unit_test_framework"})) + + # python and numpy have a version suffix. Add it here. + if "python" in libraries: + if len(libraries["python"]) != 1: + raise Exception("Boost.Python should provide exactly one library") + libraries["python"][0] += "{py_major}{py_minor}" + if "numpy" in libraries: + if len(libraries["numpy"]) != 1: + raise Exception("Boost.Numpy should provide exactly one library") + libraries["numpy"][0] += "{py_major}{py_minor}" + + boost_dependencies.export.libs = libraries + boost_dependencies.export.static_only = [ + "boost_exception", + "boost_test_exec_monitor", + ] + + return boost_dependencies + + @property + def _outputpath(self) -> Path: + return self.outputdir / "dependencies-{}.yml".format(self.boost_version) + + @classmethod + def _sort_item(cls, item): + if isinstance(item, dict): + items = sorted(item.items()) + new_items = [] + for item in sorted(items): + new_items.append((item[0], cls._sort_item(item[1]))) + return dict(new_items) + elif isinstance(item, tuple): + return tuple(cls._sort_item(e) for e in sorted(item)) + elif isinstance(item, list): + return list(cls._sort_item(e) for e in sorted(item)) + else: + return item + + def do_create_dependency_file(self) -> None: + tree = self.do_boostdep_collect() + tree = self.do_create_libraries(tree) + + tree.export.dependencies = self._fix_dependencies(tree.export.dependencies) + + data = dataclasses.asdict(tree.export) + if self.unsafe: + data["UNSAFE"] = "!DO NOT COMMIT! !THIS FILE IS GENERATED WITH THE UNSAFE OPTION ENABLED!" + + data = self._sort_item(data) + + print("Creating {}".format(self.outputdir)) + with self._outputpath.open("w") as fout: + yaml.dump(data, fout) + + +def main(args=None) -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--verbose", dest="verbose", action="store_true", help="verbose output") + parser.add_argument("-t", dest="tmppath", help="temporary folder where to clone boost (default is system temporary folder)") + parser.add_argument("-d", dest="boostdep_version", default="1.75.0", type=str, help="boostdep version") + parser.add_argument("-u", dest="git_url", default=BOOST_GIT_URL, help="boost git url") + parser.add_argument("-U", dest="git_update", action="store_true", help="update the git repo") + parser.add_argument("-o", dest="outputdir", default=None, type=Path, help="output dependency dir") + parser.add_argument("-x", dest="unsafe", action="store_true", help="unsafe fast(er) operation") + + version_group = parser.add_mutually_exclusive_group(required=True) + version_group.add_argument("-v", dest="boost_version", help="boost version") + version_group.add_argument("-A", dest="boost_version", action="store_const", const=None, help="All boost versions") + ns = parser.parse_args(args) + + logging.basicConfig(format="[%(levelname)s] %(message)s") + if ns.verbose: + log.setLevel(logging.DEBUG) + + if not ns.tmppath: + ns.tmppath = Path(tempfile.gettempdir()) + print("Temporary folder is {}".format(ns.tmppath)) + if not ns.outputdir: + ns.outputdir = Path("dependencies") + print("Dependencies folder is {}".format(ns.outputdir)) + + ns.outputdir.mkdir(exist_ok=True) + + git_update_done = False + + if ns.boost_version is None: + conan_data = yaml.safe_load(Path("conandata.yml").open()) + boost_versions = list(conan_data["sources"].keys()) + else: + boost_versions = [ns.boost_version] + + for boost_version in boost_versions: + print("Starting {}".format(boost_version)) + boost_collector = BoostDependencyBuilder( + boost_version=boost_version, + boostdep_version=ns.boostdep_version, + git_url=ns.git_url, + outputdir=ns.outputdir, + tmppath=ns.tmppath, + unsafe=ns.unsafe, + ) + + if not ns.git_update and not boost_collector.boost_path.exists(): + log.error("Boost directory does not exist. Re-execute this script with -U to run 'git update'.") + return 1 + + if ns.git_update and not git_update_done: + boost_collector.do_git_update() + git_update_done = True + + boost_collector.do_git_submodule_update() + + boost_collector.do_install_boostdep() + + boost_collector.do_create_dependency_file() + return 0 + + +if __name__ == "__main__": + import sys + sys.exit(main()) diff --git a/recipes/boost/all/test_package/CMakeLists.txt b/recipes/boost/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d3d62d560560c --- /dev/null +++ b/recipes/boost/all/test_package/CMakeLists.txt @@ -0,0 +1,159 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +if(UNIX AND NOT APPLE) + # use RPATH instead of RUNPATH so that + # transitive dependencies can be located + add_link_options("LINKER:--disable-new-dtags") +endif() + +include(CTest) +enable_testing() + +if(BOOST_NAMESPACE) + add_definitions("-DBOOST_NAMESPACE=${BOOST_NAMESPACE}") +endif() + +if(NOT HEADER_ONLY) + if(WITH_RANDOM) + find_package(Boost COMPONENTS random REQUIRED) + add_executable(random_exe random.cpp) + target_link_libraries(random_exe PRIVATE Boost::random) + add_test(NAME boost_random COMMAND random_exe) + endif() + + if(WITH_REGEX) + find_package(Boost COMPONENTS regex REQUIRED) + add_executable(regex_exe regex.cpp) + target_link_libraries(regex_exe PRIVATE Boost::regex) + add_test(NAME boost_regex COMMAND regex_exe) + endif() + + if(WITH_TEST) + find_package(Boost COMPONENTS unit_test_framework REQUIRED) + add_executable(test_exe test.cpp) + target_link_libraries(test_exe PRIVATE Boost::unit_test_framework) + add_test(NAME boost_test COMMAND test_exe) + endif() + + if(WITH_COROUTINE) + find_package(Boost COMPONENTS coroutine REQUIRED) + add_executable(coroutine_exe coroutine.cpp) + target_link_libraries(coroutine_exe PRIVATE Boost::coroutine) + add_test(NAME coroutine_test COMMAND coroutine_exe) + endif() + + if(WITH_CHRONO) + find_package(Boost COMPONENTS chrono REQUIRED) + add_executable(chrono_exe chrono.cpp) + target_link_libraries(chrono_exe PRIVATE Boost::chrono) + add_test(NAME chrono_test COMMAND chrono_exe) + endif() + + if(WITH_FIBER) + find_package(Boost COMPONENTS fiber REQUIRED) + add_executable(fiber_exe fiber.cpp) + target_link_libraries(fiber_exe PRIVATE Boost::fiber) + set_property(TARGET fiber_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_fiber COMMAND fiber_exe) + endif() + + if(WITH_JSON) + find_package(Boost COMPONENTS json REQUIRED) + add_executable(json_exe json.cpp) + target_link_libraries(json_exe PRIVATE Boost::json) + set_property(TARGET json_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_json COMMAND json_exe) + endif() + + if(WITH_NOWIDE) + find_package(Boost COMPONENTS nowide REQUIRED) + add_executable(nowide_exe nowide.cpp) + target_link_libraries(nowide_exe PRIVATE Boost::nowide) + set_property(TARGET nowide_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_nowide COMMAND nowide_exe ${CMAKE_CURRENT_SOURCE_DIR}/conanfile.py) + endif() + + if(WITH_LOCALE) + find_package(Boost COMPONENTS locale REQUIRED) + add_executable(locale_exe locale.cpp) + target_link_libraries(locale_exe PRIVATE Boost::locale) + add_test(NAME boost_locale COMMAND locale_exe) + endif() + + if(WITH_STACKTRACE_ADDR2LINE) + find_package(Boost COMPONENTS stacktrace REQUIRED) + add_executable(stacktrace_addr2line_exe stacktrace.cpp) + target_compile_definitions(stacktrace_addr2line_exe PRIVATE TEST_STACKTRACE_IMPL=1) + target_link_libraries(stacktrace_addr2line_exe PRIVATE Boost::stacktrace_addr2line) + add_test(NAME boost_stacktrace_addr2line COMMAND stacktrace_addr2line_exe) + endif() + + if(WITH_STACKTRACE_BACKTRACE) + add_executable(stacktrace_backtrace_exe stacktrace.cpp) + target_compile_definitions(stacktrace_backtrace_exe PRIVATE TEST_STACKTRACE_IMPL=2) + target_link_libraries(stacktrace_backtrace_exe PRIVATE Boost::stacktrace_backtrace) + add_test(NAME boost_stacktrace_backtrace COMMAND stacktrace_backtrace_exe) + endif() + + if(WITH_STACKTRACE) + find_package(Boost COMPONENTS stacktrace REQUIRED) + + add_executable(stacktrace_noop_exe stacktrace.cpp) + target_compile_definitions(stacktrace_noop_exe PRIVATE TEST_STACKTRACE_IMPL=4) + target_link_libraries(stacktrace_noop_exe PRIVATE Boost::stacktrace_noop) + add_test(NAME boost_stacktrace_noop COMMAND stacktrace_noop_exe) + + if(WIN32) + add_executable(stacktrace_windbg_exe stacktrace.cpp) + target_compile_definitions(stacktrace_windbg_exe PRIVATE TEST_STACKTRACE_IMPL=5) + target_link_libraries(stacktrace_windbg_exe PRIVATE Boost::stacktrace_windbg) + add_test(NAME boost_stacktrace_windbg COMMAND stacktrace_windbg_exe) + + add_executable(stacktrace_windbg_cached_exe stacktrace.cpp) + target_compile_definitions(stacktrace_windbg_cached_exe PRIVATE TEST_STACKTRACE_IMPL=6) + target_link_libraries(stacktrace_windbg_cached_exe PRIVATE Boost::stacktrace_windbg_cached) + add_test(NAME boost_stacktrace_windbg_cached COMMAND stacktrace_windbg_cached_exe) + else() + add_executable(stacktrace_basic_exe stacktrace.cpp) + target_compile_definitions(stacktrace_basic_exe PRIVATE TEST_STACKTRACE_IMPL=3) + target_link_libraries(stacktrace_basic_exe PRIVATE Boost::stacktrace_basic) + add_test(NAME boost_stacktrace_basic COMMAND stacktrace_basic_exe) + endif() + endif() + + if(WITH_PYTHON) + find_package(Boost COMPONENTS python REQUIRED) + add_library(hello_ext MODULE python.cpp) + set_property(TARGET hello_ext PROPERTY PREFIX "") + + find_package(Python ${PYTHON_VERSION_TO_SEARCH} COMPONENTS Interpreter Development NumPy REQUIRED) + + target_link_libraries(hello_ext PRIVATE Boost::python Python::Python) + if(WIN32) + set_target_properties(hello_ext PROPERTIES SUFFIX ".pyd") + endif() + add_test(NAME boost_python COMMAND Python::Interpreter "${CMAKE_CURRENT_SOURCE_DIR}/python.py") + set_property(TEST boost_python PROPERTY ENVIRONMENT "PYTHONPATH=$") + + add_executable(numpy_exe numpy.cpp) + target_link_libraries(numpy_exe PRIVATE Boost::numpy Python::Python Python::NumPy) + add_test(NAME boost_numpy COMMAND numpy_exe) + set_property(TEST boost_numpy PROPERTY ENVIRONMENT "PYTHONPATH=${Python_SITELIB}") + endif() + + if(WITH_URL) + find_package(Boost COMPONENTS url REQUIRED) + add_executable(url_exe url.cpp) + target_link_libraries(url_exe PRIVATE Boost::url) + set_property(TARGET url_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_url COMMAND url_exe) + endif() + +endif() + +# Test header-only target +find_package(Boost REQUIRED) +add_executable(lambda_exe lambda.cpp) +target_link_libraries(lambda_exe PRIVATE Boost::headers) +add_test(NAME boost_boost COMMAND lambda_exe) diff --git a/recipes/boost/all/test_package/chrono.cpp b/recipes/boost/all/test_package/chrono.cpp new file mode 100644 index 0000000000000..0127868cfeca9 --- /dev/null +++ b/recipes/boost/all/test_package/chrono.cpp @@ -0,0 +1,21 @@ +// This comes from the following Boost example: +// https://www.boost.org/doc/libs/1_72_0/doc/html/chrono/users_guide.html#chrono.users_guide.examples +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main() +{ + boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); + + for ( long i = 0; i < 10000000; ++i ) + std::sqrt( 123.456L ); // burn some time + + boost::chrono::duration sec = boost::chrono::system_clock::now() - start; + std::cout << "took " << sec.count() << " seconds\n"; + return 0; +} diff --git a/recipes/boost/all/test_package/conanfile.py b/recipes/boost/all/test_package/conanfile.py new file mode 100644 index 0000000000000..de19d7acf2aa4 --- /dev/null +++ b/recipes/boost/all/test_package/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def _boost_option(self, name, default): + try: + return getattr(self.dependencies["boost"].options, name, default) + except (AttributeError, ConanException): + return default + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["HEADER_ONLY"] = self.dependencies["boost"].options.header_only + if not self.dependencies["boost"].options.header_only: + tc.cache_variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.cache_variables["WITH_PYTHON"] = not self.dependencies["boost"].options.without_python + if not self.dependencies["boost"].options.without_python: + pyversion = self.dependencies["boost"].options.python_version + tc.cache_variables["PYTHON_VERSION_TO_SEARCH"] = pyversion + tc.cache_variables["Python_EXECUTABLE"] = self.dependencies["boost"].options.python_executable + tc.cache_variables["WITH_RANDOM"] = not self.dependencies["boost"].options.without_random + tc.cache_variables["WITH_REGEX"] = not self.dependencies["boost"].options.without_regex + tc.cache_variables["WITH_TEST"] = not self.dependencies["boost"].options.without_test + tc.cache_variables["WITH_COROUTINE"] = not self.dependencies["boost"].options.without_coroutine + tc.cache_variables["WITH_CHRONO"] = not self.dependencies["boost"].options.without_chrono + tc.cache_variables["WITH_FIBER"] = not self.dependencies["boost"].options.without_fiber + tc.cache_variables["WITH_LOCALE"] = not self.dependencies["boost"].options.without_locale + tc.cache_variables["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) + tc.cache_variables["WITH_JSON"] = not self._boost_option("without_json", True) + tc.cache_variables["WITH_STACKTRACE"] = not self.dependencies["boost"].options.without_stacktrace + tc.cache_variables["WITH_STACKTRACE_ADDR2LINE"] = self.dependencies["boost"].conf_info.get("user.boost:stacktrace_addr2line_available") + tc.cache_variables["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) + tc.cache_variables["WITH_URL"] = not self._boost_option("without_url", True) + if self.dependencies["boost"].options.namespace != 'boost' and not self.dependencies["boost"].options.namespace_alias: + tc.cache_variables['BOOST_NAMESPACE'] = self.dependencies["boost"].options.namespace + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not can_run(self): + return + with chdir(self, self.folders.build_folder): + # When boost and its dependencies are built as shared libraries, + # the test executables need to locate them. Typically the + # `conanrun` env should be enough, but this may cause problems on macOS + # where the CMake installation has dependencies on Apple-provided + # system libraries that are incompatible with Conan-provided ones. + # When `conanrun` is enabled, DYLD_LIBRARY_PATH will also apply + # to ctest itself. Given that CMake already embeds RPATHs by default, + # we can bypass this by using the `conanbuild` environment on + # non-Windows platforms, while still retaining the correct behaviour. + env = "conanrun" if self.settings.os == "Windows" else "conanbuild" + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env=env) diff --git a/recipes/boost/all/test_package/coroutine.cpp b/recipes/boost/all/test_package/coroutine.cpp new file mode 100644 index 0000000000000..06e901c78b82b --- /dev/null +++ b/recipes/boost/all/test_package/coroutine.cpp @@ -0,0 +1,23 @@ +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +using namespace boost::coroutines; + +void cooperative(coroutine::push_type &sink) +{ + std::cout << "Hello"; + sink(); + std::cout << "world"; +} + +int main() +{ + coroutine::pull_type source(cooperative); + std::cout << ", "; + source(); + std::cout << "!\n"; +} diff --git a/recipes/boost/all/test_package/fiber.cpp b/recipes/boost/all/test_package/fiber.cpp new file mode 100644 index 0000000000000..6a0165c129269 --- /dev/null +++ b/recipes/boost/all/test_package/fiber.cpp @@ -0,0 +1,134 @@ +// Copyright Nat Goodspeed + Oliver Kowalke 2015. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +static std::size_t fiber_count{ 0 }; +static std::mutex mtx_count{}; +static boost::fibers::condition_variable_any cnd_count{}; +typedef std::unique_lock< std::mutex > lock_type; + +/***************************************************************************** + * example fiber function + *****************************************************************************/ +//[fiber_fn_ws +void whatevah( char me) { + try { + std::thread::id my_thread = std::this_thread::get_id(); /**< get ID of initial thread >*/ + { + std::ostringstream buffer; + buffer << "fiber " << me << " started on thread " << my_thread << '\n'; + std::cout << buffer.str() << std::flush; + } + for ( unsigned i = 0; i < 10; ++i) { /**< loop ten times >*/ + boost::this_fiber::yield(); /**< yield to other fibers >*/ + std::thread::id new_thread = std::this_thread::get_id(); /**< get ID of current thread >*/ + if ( new_thread != my_thread) { /**< test if fiber was migrated to another thread >*/ + my_thread = new_thread; + std::ostringstream buffer; + buffer << "fiber " << me << " switched to thread " << my_thread << '\n'; + std::cout << buffer.str() << std::flush; + } + } + } catch ( ... ) { + } + lock_type lk( mtx_count); + if ( 0 == --fiber_count) { /**< Decrement fiber counter for each completed fiber. >*/ + lk.unlock(); + cnd_count.notify_all(); /**< Notify all fibers waiting on `cnd_count`. >*/ + } +} +//] + +/***************************************************************************** + * example thread function + *****************************************************************************/ +//[thread_fn_ws +void thread( boost::fibers::detail::thread_barrier * b) { + std::ostringstream buffer; + buffer << "thread started " << std::this_thread::get_id() << std::endl; + std::cout << buffer.str() << std::flush; + boost::fibers::use_scheduling_algorithm< boost::fibers::algo::shared_work >(); /**< + Install the scheduling algorithm `boost::fibers::algo::shared_work` in order to + join the work sharing. + >*/ + b->wait(); /**< sync with other threads: allow them to start processing >*/ + lock_type lk( mtx_count); + cnd_count.wait( lk, [](){ return 0 == fiber_count; } ); /**< + Suspend main fiber and resume worker fibers in the meanwhile. + Main fiber gets resumed (e.g returns from `condition_variable_any::wait()`) + if all worker fibers are complete. + >*/ + BOOST_ASSERT( 0 == fiber_count); +} +//] + +/***************************************************************************** + * main() + *****************************************************************************/ +int main( int argc, char *argv[]) { + std::cout << "main thread started " << std::this_thread::get_id() << std::endl; + //[main_ws + boost::fibers::use_scheduling_algorithm< boost::fibers::algo::shared_work >(); /*< + Install the scheduling algorithm `boost::fibers::algo::shared_work` in the main thread + too, so each new fiber gets launched into the shared pool. + >*/ + + for ( char c : std::string("abcdefghijklmnopqrstuvwxyz")) { /*< + Launch a number of worker fibers; each worker fiber picks up a character + that is passed as parameter to fiber-function `whatevah`. + Each worker fiber gets detached. + >*/ + boost::fibers::fiber([c](){ whatevah( c); }).detach(); + ++fiber_count; /*< Increment fiber counter for each new fiber. >*/ + } + boost::fibers::detail::thread_barrier b( 4); + std::thread threads[] = { /*< + Launch a couple of threads that join the work sharing. + >*/ + std::thread( thread, & b), + std::thread( thread, & b), + std::thread( thread, & b) + }; + b.wait(); /*< sync with other threads: allow them to start processing >*/ + { + lock_type/*< `lock_type` is typedef'ed as __unique_lock__< [@http://en.cppreference.com/w/cpp/thread/mutex `std::mutex`] > >*/ lk( mtx_count); + cnd_count.wait( lk, [](){ return 0 == fiber_count; } ); /*< + Suspend main fiber and resume worker fibers in the meanwhile. + Main fiber gets resumed (e.g returns from `condition_variable_any::wait()`) + if all worker fibers are complete. + >*/ + } /*< + Releasing lock of mtx_count is required before joining the threads, otherwise + the other threads would be blocked inside condition_variable::wait() and + would never return (deadlock). + >*/ + BOOST_ASSERT( 0 == fiber_count); + for ( std::thread & t : threads) { /*< wait for threads to terminate >*/ + t.join(); + } + //] + std::cout << "done." << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/boost/all/test_package/json.cpp b/recipes/boost/all/test_package/json.cpp new file mode 100644 index 0000000000000..3670a3ddb4ff2 --- /dev/null +++ b/recipes/boost/all/test_package/json.cpp @@ -0,0 +1,23 @@ +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +using namespace boost::json; + +#include +#include + +int main() { + object obj; + obj[ "pi" ] = 3.141; + obj[ "happy" ] = true; + obj[ "name" ] = "Boost"; + obj[ "nothing" ] = nullptr; + obj[ "answer" ].emplace_object()["everything"] = 42; + obj[ "list" ] = { 1, 0, 2 }; + obj[ "object" ] = { {"currency", "USD"}, {"value", 42.99} }; + std::string s = serialize(obj); + std::cout << s << '\n'; +} diff --git a/recipes/boost/all/test_package/lambda.cpp b/recipes/boost/all/test_package/lambda.cpp new file mode 100644 index 0000000000000..0b35eec20eaeb --- /dev/null +++ b/recipes/boost/all/test_package/lambda.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main(int argc, const char * const argv[]) +{ + using namespace boost::lambda; + + std::vector values; + for (int i = 1; i < argc; ++i) + values.push_back(atoi(argv[i])); + + std::for_each(values.begin(), values.end(), std::cout << _1 * 3 << " " ); + + return 0; +} diff --git a/recipes/boost/all/test_package/locale.cpp b/recipes/boost/all/test_package/locale.cpp new file mode 100644 index 0000000000000..b21f16247bcfc --- /dev/null +++ b/recipes/boost/all/test_package/locale.cpp @@ -0,0 +1,61 @@ +// +// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +#include +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main() +{ + using namespace boost::locale; + generator gen; + std::locale::global(gen("")); + std::cout.imbue(std::locale()); + // Setup environment + boost::locale::date_time now; + date_time start=now; + // Set the first day of the first month of this year + start.set(period::month(),now.minimum(period::month())); + start.set(period::day(),start.minimum(period::day())); + int current_year = period::year(now); + // Display current year + std::cout << format("{1,ftime='%Y'}") % now << std::endl; + // + // Run forward untill current year is the date + // + for(now=start; period::year(now) == current_year;) { + // Print heading of month + if(calendar().is_gregorian()) + std::cout << format("{1,ftime='%B'}") % now <>' +#include + +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main(int argc,char **argv) +{ + boost::nowide::args a(argc,argv); // Fix arguments - make them UTF-8 + if(argc!=2) { + boost::nowide::cerr << "Usage: file_name" << std::endl; // Unicode aware console + return 1; + } + boost::nowide::ifstream f(argv[1]); // argv[1] - is UTF-8 + if(!f) { + // the console can display UTF-8 + boost::nowide::cerr << "Can't open " << argv[1] << std::endl; + return 1; + } + int total_lines = 0; + while(f) { + if(f.get() == '\n') + total_lines++; + } + f.close(); + // the console can display UTF-8 + boost::nowide::cout << "File " << argv[1] << " has " << total_lines << " lines" << std::endl; + return 0; +} diff --git a/recipes/boost/all/test_package/numpy.cpp b/recipes/boost/all/test_package/numpy.cpp new file mode 100644 index 0000000000000..184d107a28096 --- /dev/null +++ b/recipes/boost/all/test_package/numpy.cpp @@ -0,0 +1,28 @@ +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +namespace p = boost::python; +namespace np = boost::python::numpy; + +int main(int argc, char **argv) +{ + Py_Initialize(); + np::initialize(); + + p::tuple shape = p::make_tuple(3, 3); + np::dtype dtype = np::dtype::get_builtin(); + np::ndarray a = np::zeros(shape, dtype); + + np::ndarray b = np::empty(shape,dtype); + + std::cout << "Original array:\n" << p::extract(p::str(a)) << std::endl; + + // Reshape the array into a 1D array + a = a.reshape(p::make_tuple(9)); + // Print it again. + std::cout << "Reshaped array:\n" << p::extract(p::str(a)) << std::endl; +} diff --git a/recipes/boost/all/test_package/python.cpp b/recipes/boost/all/test_package/python.cpp new file mode 100644 index 0000000000000..f10411c1a309b --- /dev/null +++ b/recipes/boost/all/test_package/python.cpp @@ -0,0 +1,16 @@ +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +char const* greet() +{ + return "hello, world!!!!!"; +} + +BOOST_PYTHON_MODULE(hello_ext) +{ + using namespace boost::python; + def("greet", greet); +} diff --git a/recipes/boost/all/test_package/python.py b/recipes/boost/all/test_package/python.py new file mode 100644 index 0000000000000..f2e0911e7d793 --- /dev/null +++ b/recipes/boost/all/test_package/python.py @@ -0,0 +1,8 @@ +import hello_ext + +txt = hello_ext.greet() +print(txt) + +if txt != "hello, world!!!!!": + raise Exception("did not expect this!") + diff --git a/recipes/boost/all/test_package/random.cpp b/recipes/boost/all/test_package/random.cpp new file mode 100644 index 0000000000000..c78d082b8d033 --- /dev/null +++ b/recipes/boost/all/test_package/random.cpp @@ -0,0 +1,24 @@ +// This comes from the following Boost example: +// https://www.boost.org/doc/libs/1_71_0/doc/html/boost_random/tutorial.html +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main() { + std::string chars( + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "1234567890" + "!@#$%^&*()" + "`~-_=+[{]}\\|;:'\",<.>/? "); + boost::random::random_device rng; + boost::random::uniform_int_distribution<> index_dist(0, chars.size() - 1); + for(int i = 0; i < 8; ++i) { + std::cout << chars[index_dist(rng)]; + } + std::cout << std::endl; +} diff --git a/recipes/boost/all/test_package/regex.cpp b/recipes/boost/all/test_package/regex.cpp new file mode 100644 index 0000000000000..416c10ba741c5 --- /dev/null +++ b/recipes/boost/all/test_package/regex.cpp @@ -0,0 +1,20 @@ +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main(int argc, const char * const argv[]) +{ + std::string line; + boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" ); + + std::vector values; + for (int i = 1; i < argc; ++i) { + const std::string word(argv[i]); + boost::smatch matches; + if (boost::regex_match(line, matches, pat)) + std::cout << matches[2] << std::endl; + } +} diff --git a/recipes/boost/all/test_package/stacktrace.cpp b/recipes/boost/all/test_package/stacktrace.cpp new file mode 100644 index 0000000000000..4ff17e101e644 --- /dev/null +++ b/recipes/boost/all/test_package/stacktrace.cpp @@ -0,0 +1,130 @@ +#include + +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +void f3() { + std::cout << "==start stacktrace==\n" << boost::stacktrace::stacktrace() << "==end stacktrace==\n"; +} + +void f2() { + f3(); +} + +void f1() { + f2(); +} + +#define TEST_STACKTRACE_ADDR2LINE 1 +#define TEST_STACKTRACE_BACKTRACE 2 +#define TEST_STACKTRACE_BASIC 3 +#define TEST_STACKTRACE_NOOP 4 +#define TEST_STACKTRACE_WINDBG 5 +#define TEST_STACKTRACE_WINDBG_CACHED 6 + +static const char *stacktrace_impls[] = { + "addr2line", + "backtrace", + "basic", + "noop", + "windbg", + "windbg_cached", +}; + +bool check_used_defined() +{ + bool success = true; +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_ADDR2LINE +# if !defined(BOOST_STACKTRACE_USE_ADDR2LINE) + std::cerr << "testing stacktrace_addr2line but BOOST_STACKTRACE_USE_ADDR2LINE not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_BACKTRACE +# if !defined(BOOST_STACKTRACE_USE_BACKTRACE) + std::cerr << "testing stacktrace_backtrace but BOOST_STACKTRACE_USE_BACKTRACE not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_NOOP +# if !defined(BOOST_STACKTRACE_USE_NOOP) + std::cerr << "testing stacktrace_noop but BOOST_STACKTRACE_USE_NOOP not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_WINDBG +# if !defined(BOOST_STACKTRACE_USE_WINDBG) + std::cerr << "testing stacktrace_windbg but BOOST_STACKTRACE_USE_WINDBG not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_WINDBG_CACHED +# if !defined(BOOST_STACKTRACE_USE_WINDBG_CACHED) + std::cerr << "testing stacktrace_windbg_cached but BOOST_STACKTRACE_USE_WINDBG_CACHED not defined\n"; + success = false; +# endif +#endif + return success; +} + +bool check_unused_undefined() +{ + bool success = true; +# if defined(BOOST_STACKTRACE_USE_ADDR2LINE) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_ADDR2LINE + std::cerr << "BOOST_STACKTRACE_USE_ADDR2LINE defined but not testing stacktrace_addr2line\n"; + success = false; +# endif +# if !defined(BOOST_STACKTRACE_ADDR2LINE_LOCATION) + std::cerr << "error: BOOST_STACKTRACE_ADDR2LINE_LOCATION not defined\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_BACKTRACE) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_BACKTRACE + std::cerr << "BOOST_STACKTRACE_USE_BACKTRACE defined but not testing stacktrace_backtrace\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_NOOP) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_NOOP + std::cerr << "BOOST_STACKTRACE_USE_NOOP defined but not testing stacktrace_noop\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_WINDBG) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_WINDBG + std::cerr << "BOOST_STACKTRACE_USE_WINDBG defined but not testing stacktrace_windbg\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_WINDBG_CACHED) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_WINDBG_CACHED + std::cerr << "BOOST_STACKTRACE_USE_WINDBG_CACHED defined but not testing stacktrace_windbg_cached\n"; + success = false; +# endif +# endif + return success; +} + +int main() { + int res = 0; + +#if !defined TEST_STACKTRACE_IMPL + std::cerr << "TEST_STACKTRACE_IMPL not defined!\n"; + res = 1; +#else + std::cerr << "Testing stacktrace_" << stacktrace_impls[TEST_STACKTRACE_IMPL-1] << "...\n"; + if (!check_unused_undefined()) { + res = 1; + } + if (!check_used_defined()) { + res = 1; + } +#endif + f1(); + return res; +} diff --git a/recipes/boost/all/test_package/test.cpp b/recipes/boost/all/test_package/test.cpp new file mode 100644 index 0000000000000..764730e3fa8c8 --- /dev/null +++ b/recipes/boost/all/test_package/test.cpp @@ -0,0 +1,7 @@ +#define BOOST_TEST_MODULE Test +#include "boost/test/unit_test.hpp" + +BOOST_AUTO_TEST_CASE( free_test_function ) +{ + BOOST_TEST( true /* test assertion */ ); +} diff --git a/recipes/boost/all/test_package/url.cpp b/recipes/boost/all/test_package/url.cpp new file mode 100644 index 0000000000000..dd65390f85c35 --- /dev/null +++ b/recipes/boost/all/test_package/url.cpp @@ -0,0 +1,14 @@ +// +// Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com) +// +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt +// + +#include +#include + +int main() { + assert(sizeof(boost::urls::url) > 0); + return 0; +} diff --git a/recipes/boost/all/test_v1_package/CMakeLists.txt b/recipes/boost/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/boost/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/boost/all/test_v1_package/conanfile.py b/recipes/boost/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4bdbddf498bcc --- /dev/null +++ b/recipes/boost/all/test_v1_package/conanfile.py @@ -0,0 +1,52 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def _boost_option(self, name, default): + try: + return getattr(self.options["boost"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + # FIXME: tools.vcvars added for clang-cl. Remove once conan supports clang-cl properly. (https://github.com/conan-io/conan-center-index/pull/1453) + with tools.vcvars(self.settings) if (self.settings.os == "Windows" and self.settings.compiler == "clang") else tools.no_op(): + cmake = CMake(self) + cmake.definitions["HEADER_ONLY"] = self.options["boost"].header_only + if not self.options["boost"].header_only: + cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared + cmake.definitions["WITH_PYTHON"] = not self.options["boost"].without_python + if not self.options["boost"].without_python: + pyversion = tools.Version(self.options["boost"].python_version) + cmake.definitions["PYTHON_VERSION_TO_SEARCH"] = pyversion + cmake.definitions["Python_EXECUTABLE"] = self.options["boost"].python_executable + cmake.definitions["WITH_RANDOM"] = not self.options["boost"].without_random + cmake.definitions["WITH_REGEX"] = not self.options["boost"].without_regex + cmake.definitions["WITH_TEST"] = not self.options["boost"].without_test + cmake.definitions["WITH_COROUTINE"] = not self.options["boost"].without_coroutine + cmake.definitions["WITH_CHRONO"] = not self.options["boost"].without_chrono + cmake.definitions["WITH_FIBER"] = not self.options["boost"].without_fiber + cmake.definitions["WITH_LOCALE"] = not self.options["boost"].without_locale + cmake.definitions["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) + cmake.definitions["WITH_JSON"] = not self._boost_option("without_json", True) + cmake.definitions["WITH_STACKTRACE"] = not self.options["boost"].without_stacktrace + cmake.definitions["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available + cmake.definitions["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) + cmake.definitions["WITH_URL"] = not self._boost_option("without_url", True) + if self.options["boost"].namespace != 'boost' and not self.options["boost"].namespace_alias: + cmake.definitions['BOOST_NAMESPACE'] = self.options["boost"].namespace + cmake.configure() + # Disable parallel builds because c3i (=conan-center's test/build infrastructure) seems to choke here + cmake.parallel = False + cmake.build() + + def test(self): + if tools.cross_building(self): + return + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) + diff --git a/recipes/boost/config.yml b/recipes/boost/config.yml new file mode 100644 index 0000000000000..2ce47c1e59d7e --- /dev/null +++ b/recipes/boost/config.yml @@ -0,0 +1,23 @@ +versions: + "1.81.0": + folder: all + "1.80.0": + folder: all + "1.79.0": + folder: all + "1.78.0": + folder: all + "1.77.0": + folder: all + "1.76.0": + folder: all + "1.75.0": + folder: all + "1.74.0": + folder: all + "1.73.0": + folder: all + "1.72.0": + folder: all + "1.71.0": + folder: all diff --git a/recipes/boostdep/all/CMakeLists.txt b/recipes/boostdep/all/CMakeLists.txt new file mode 100644 index 0000000000000..5e53cb70bdf38 --- /dev/null +++ b/recipes/boostdep/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/boostdep/all/conandata.yml b/recipes/boostdep/all/conandata.yml new file mode 100644 index 0000000000000..3831a32bc89c9 --- /dev/null +++ b/recipes/boostdep/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + 1.75.0: + - url: "https://github.com/boostorg/boostdep/archive/boost-1.75.0.tar.gz" + sha256: "7eecd835eb5b0fd602ff3615a6b663b45917689386d11073d961b86710f428af" + - url: "http://www.boost.org/LICENSE_1_0.txt" + sha256: "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566" diff --git a/recipes/boostdep/all/conanfile.py b/recipes/boostdep/all/conanfile.py new file mode 100644 index 0000000000000..01a84ccc90d69 --- /dev/null +++ b/recipes/boostdep/all/conanfile.py @@ -0,0 +1,58 @@ +from conans import CMake, ConanFile, tools +import os + + +class BoostDepConan(ConanFile): + name = "boostdep" + settings = "os", "arch", "compiler", "build_type" + description = "A tool to create Boost module dependency reports" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/boostorg/boostdep" + license = "BSL-1.0" + topics = ("conan", "boostdep", "dependency", "tree") + exports_sources = "CMakeLists.txt" + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + self.requires("boost/1.75.0") + + def package_id(self): + del self.info.settings.compiler + + def source(self): + tools.get(**self.conan_data["sources"][self.version][0]) + os.rename("boostdep-boost-{}".format(self.version), self._source_subfolder) + license_info = self.conan_data["sources"][self.version][1] + tools.download(filename=os.path.basename(license_info["url"]), **license_info) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE*", dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.deps_env_info.PATH.append(bin_path) diff --git a/recipes/boostdep/all/test_package/conanfile.py b/recipes/boostdep/all/test_package/conanfile.py new file mode 100644 index 0000000000000..190cc18502e11 --- /dev/null +++ b/recipes/boostdep/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools +import os + + +class DefaultNameConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + + def build(self): + pass + + def test(self): + if tools.cross_building(self.settings): + return + tools.mkdir("libs") + tools.save("Jamroot", "") + with tools.environment_append({"BOOST_ROOT": self.build_folder}): + self.run("boostdep --list-modules", run_environment=True) diff --git a/recipes/boostdep/config.yml b/recipes/boostdep/config.yml new file mode 100644 index 0000000000000..640761587c2ae --- /dev/null +++ b/recipes/boostdep/config.yml @@ -0,0 +1,3 @@ +versions: + "1.75.0": + folder: "all" diff --git a/recipes/botan/all/conandata.yml b/recipes/botan/all/conandata.yml new file mode 100644 index 0000000000000..b4fd5502f1bd3 --- /dev/null +++ b/recipes/botan/all/conandata.yml @@ -0,0 +1,58 @@ +sources: + "2.12.1": + url: "https://github.com/randombit/botan/archive/2.12.1.tar.gz" + sha256: "61d27332f053b0b1169659dc0fceb7de7d16cade230df3a14dfaa2c091888b98" + "2.13.0": + url: "https://github.com/randombit/botan/archive/2.13.0.tar.gz" + sha256: "29a57d8efd6ab297eab67cbf489a5a423b06e120e0520aff2583074e8aea151c" + "2.14.0": + url: "https://github.com/randombit/botan/archive/2.14.0.tar.gz" + sha256: "38e34b8ef7652e811382744425b82da1b1a7fb5f14cc281a7d3a18543eaf72f7" + "2.15.0": + url: "https://github.com/randombit/botan/archive/2.15.0.tar.gz" + sha256: "9a86b1a8adbac37fdff9cf5745b3a313020c33579d8fc51cb996c47d3adf5585" + "2.16.0": + url: "https://github.com/randombit/botan/archive/2.16.0.tar.gz" + sha256: "8f448b97120e884d755b946045753876d688b01f48f5e6a1cf37aebd5afecbe5" + "2.17.0": + url: "https://github.com/randombit/botan/archive/2.17.0.tar.gz" + sha256: "32874e4e14bf11428e1bc4919e5ee174a68e2f480d37bc79ed015b2b5ef87fef" + "2.17.1": + url: "https://github.com/randombit/botan/archive/2.17.1.tar.gz" + sha256: "ca562c00e61663c418bd9fdc6c70bdeaedafba8bef328cb6046a1d6390d39a71" + "2.17.2": + url: "https://github.com/randombit/botan/archive/2.17.2.tar.gz" + sha256: "3d99da64573abab6d6e8036a45f8c567a57721c8f23850e05aadd84fc2e0075c" + "2.17.3": + url: "https://github.com/randombit/botan/archive/2.17.3.tar.gz" + sha256: "544c62e43be0c60fff7ac8707ee99fe134c75bef06bded217d04f0a4b333519a" + "2.18.0": + url: "https://github.com/randombit/botan/archive/2.18.0.tar.gz" + sha256: "8556991402f9ecf5f84f1f2c4de20ca3fd14a5ebd775f065ea6676b36646a77d" + "2.18.1": + url: "https://github.com/randombit/botan/archive/2.18.1.tar.gz" + sha256: "4afebf2dbfa2f047d161437dcc544003d5822f47ceac97ada6a24948297bd3ed" + "2.18.2": + url: "https://github.com/randombit/botan/archive/2.18.2.tar.gz" + sha256: "10ded69c4fd4ade9d87527b394787beefa190b4ecb65ed04535bdd00e088cd96" + "2.19.1": + url: "https://github.com/randombit/botan/archive/2.19.1.tar.gz" + sha256: "eb5eaac0d8bf1dcf64b7ae39736d928fca8be1b24c27787873106e41a6c36725" + "2.19.2": + url: "https://github.com/randombit/botan/archive/2.19.2.tar.gz" + sha256: "47bb0330255cf1a439db3f2bc91894b2f41788e58eb71d27e0abf36038d93f1e" + "2.19.3": + url: "https://github.com/randombit/botan/archive/2.19.3.tar.gz" + sha256: "8f568bf74c2e476d92ac8a1cfc2ba8407ec038fe9458bd0a11e7da827a9b8199" +patches: + "2.12.1": + - patch_file: "patches/dll-dir.patch" + base_path: "sources" + - patch_file: "patches/fix-unrecognized-linker-flag.patch" + base_path: "sources" + "2.17.2": + - patch_file: "patches/vs2015-install-fix.patch" + base_path: "sources" + "2.18.2": + - patch_file: "patches/fix-amalgamation-build.patch" + base_path: "sources" diff --git a/recipes/botan/all/conanfile.py b/recipes/botan/all/conanfile.py new file mode 100644 index 0000000000000..e8599f32dde75 --- /dev/null +++ b/recipes/botan/all/conanfile.py @@ -0,0 +1,447 @@ +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.45.0" + + +class BotanConan(ConanFile): + name = "botan" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/randombit/botan" + license = "BSD-2-Clause" + description = "Botan is a cryptography library written in C++11." + topics = ("cryptography", "crypto", "C++11", "tls") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "amalgamation": [True, False], + "with_bzip2": [True, False], + "with_openssl": [True, False], + "single_amalgamation": [True, False], + "with_sqlite3": [True, False], + "with_zlib": [True, False], + "with_boost": [True, False], + "with_sse2": [True, False], + "with_ssse3": [True, False], + "with_sse4_1": [True, False], + "with_sse4_2": [True, False], + "with_avx2": [True, False], + "with_bmi2": [True, False], + "with_rdrand": [True, False], + "with_rdseed": [True, False], + "with_aes_ni": [True, False], + "with_sha_ni": [True, False], + "with_altivec": [True, False], + "with_neon": [True, False], + "with_armv8crypto": [True, False], + "with_powercrypto": [True, False], + "enable_modules": "ANY", + "system_cert_bundle": "ANY", + "module_policy": [None, "bsi", "modern", "nist"], + } + default_options = { + "shared": False, + "fPIC": True, + "amalgamation": True, + "with_bzip2": False, + "with_openssl": False, + "single_amalgamation": False, + "with_sqlite3": False, + "with_zlib": False, + "with_boost": False, + "with_sse2": True, + "with_ssse3": True, + "with_sse4_1": True, + "with_sse4_2": True, + "with_avx2": True, + "with_bmi2": True, + "with_rdrand": True, + "with_rdseed": True, + "with_aes_ni": True, + "with_sha_ni": True, + "with_altivec": True, + "with_neon": True, + "with_armv8crypto": True, + "with_powercrypto": True, + "enable_modules": None, + "system_cert_bundle": None, + "module_policy": None, + } + + @property + def _is_x86(self): + return str(self.settings.arch) in ['x86', 'x86_64'] + + @property + def _is_ppc(self): + return 'ppc' in str(self.settings.arch) + + @property + def _is_arm(self): + return 'arm' in str(self.settings.arch) + + @property + def _source_subfolder(self): + # Required to build at least 2.12.1 + return "sources" + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + if not self._is_x86: + del self.options.with_sse2 + del self.options.with_ssse3 + del self.options.with_sse4_1 + del self.options.with_sse4_2 + del self.options.with_avx2 + del self.options.with_bmi2 + del self.options.with_rdrand + del self.options.with_rdseed + del self.options.with_aes_ni + del self.options.with_sha_ni + if not self._is_arm: + del self.options.with_neon + del self.options.with_armv8crypto + if not self._is_ppc: + del self.options.with_altivec + del self.options.with_powercrypto + + # --single-amalgamation option is no longer available + # See also https://github.com/randombit/botan/pull/2246 + if tools.Version(self.version) >= '2.14.0': + del self.options.single_amalgamation + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.with_openssl: + self.requires("openssl/1.1.1o") + if self.options.with_zlib: + self.requires("zlib/1.2.12") + if self.options.with_sqlite3: + self.requires("sqlite3/3.38.5") + if self.options.with_boost: + self.requires("boost/1.79.0") + + @property + def _required_boost_components(self): + return ['coroutine', 'system'] + + def validate(self): + if self.options.with_boost: + 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 self.options['boost'].shared or self.options['boost'].magic_autolink or miss_boost_required_comp: + raise ConanInvalidConfiguration('{0} requires non-header-only static boost, without magic_autolink, and with these components: {1}'.format(self.name, ', '.join(self._required_boost_components))) + + compiler = self.settings.compiler + version = tools.Version(self.settings.compiler.version) + + if compiler == 'Visual Studio' and version < '14': + raise ConanInvalidConfiguration("Botan doesn't support MSVC < 14") + + elif compiler == 'gcc' and version >= '5' and compiler.libcxx != 'libstdc++11': + raise ConanInvalidConfiguration( + 'Using Botan with GCC >= 5 on Linux requires "compiler.libcxx=libstdc++11"') + + elif compiler == 'clang' and compiler.libcxx not in ['libstdc++11', 'libc++']: + raise ConanInvalidConfiguration( + 'Using Botan with Clang on Linux requires either "compiler.libcxx=libstdc++11" ' \ + 'or "compiler.libcxx=libc++"') + + # Some older compilers cannot handle the amalgamated build anymore + # See also https://github.com/randombit/botan/issues/2328 + if tools.Version(self.version) >= '2.14.0' and self.options.amalgamation: + if (compiler == 'apple-clang' and version < '10') or \ + (compiler == 'gcc' and version < '8') or \ + (compiler == 'clang' and version < '7'): + raise ConanInvalidConfiguration( + 'botan amalgamation is not supported for {}/{}'.format(compiler, version)) + + if self.options.get_safe("single_amalgamation", False) and not self.options.amalgamation: + raise ConanInvalidConfiguration("botan:single_amalgamation=True requires botan:amalgamation=True") + + def source(self): + tools.get(**self.conan_data['sources'][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + for patch in self.conan_data.get('patches', {}).get(self.version, []): + tools.patch(**patch) + with tools.chdir(self._source_subfolder): + self.run(self._configure_cmd) + self.run(self._make_cmd) + + def package(self): + self.copy(pattern='license.txt', dst='licenses', src=self._source_subfolder) + with tools.chdir(self._source_subfolder): + self.run(self._make_install_cmd) + + def package_info(self): + major_version = tools.Version(self.version).major + self.cpp_info.set_property("pkg_config_name", f"botan-{major_version}") + self.cpp_info.names["pkg_config"] = f"botan-{major_version}" + self.cpp_info.libs = ["botan" if is_msvc(self) else f"botan-{major_version}"] + if self.settings.os == 'Linux': + self.cpp_info.system_libs.extend(['dl', 'rt', 'pthread']) + if self.settings.os == 'Macos': + self.cpp_info.frameworks = ['Security', 'CoreFoundation'] + if self.settings.os == 'Windows': + self.cpp_info.system_libs.extend(['ws2_32', 'crypt32']) + + self.cpp_info.includedirs = [os.path.join("include", f"botan-{major_version}")] + + @property + def _is_mingw_windows(self): + return self.settings.os == 'Windows' and self.settings.compiler == 'gcc' + + @property + def _botan_os(self): + if self._is_mingw_windows: + return 'mingw' + return {'Windows': 'windows', + 'Linux': 'linux', + 'Macos': 'darwin', + 'Android': 'linux', + 'baremetal': 'none', + 'iOS': 'ios'}.get(str(self.settings.os)) + + def _dependency_build_flags(self, dependency): + # Since botan has a custom build system, we need to specifically inject + # these build parameters so that it picks up the correct dependencies. + dep_cpp_info = self.deps_cpp_info[dependency] + return \ + ['--with-external-includedir={}'.format(include_path) for include_path in dep_cpp_info.include_paths] + \ + ['--with-external-libdir={}'.format(lib_path) for lib_path in dep_cpp_info.lib_paths] + \ + ['--define-build-macro={}'.format(define) for define in dep_cpp_info.defines] + + @property + def _configure_cmd(self): + if self.settings.compiler in ('clang', 'apple-clang'): + botan_compiler = 'clang' + elif self.settings.compiler == 'gcc': + botan_compiler = 'gcc' + else: + botan_compiler = 'msvc' + + botan_abi_flags = [] + botan_extra_cxx_flags = [] + build_flags = [] + + if self._is_linux_clang_libcxx: + botan_abi_flags.extend(['-stdlib=libc++', '-lc++abi']) + + if self.settings.compiler in ['clang', 'apple-clang', 'gcc']: + if self.settings.arch == 'x86': + botan_abi_flags.append('-m32') + elif self.settings.arch == 'x86_64': + botan_abi_flags.append('-m64') + + if self.settings.compiler in ['apple-clang']: + if self.settings.arch in ['armv7']: + botan_abi_flags.append('-arch armv7') + elif self.settings.arch in ['armv8']: + botan_abi_flags.append('-arch arm64') + elif self.settings.arch in ['x86_64']: + botan_abi_flags.append('-arch x86_64') + + if self.options.get_safe('fPIC', True): + botan_extra_cxx_flags.append('-fPIC') + + if tools.is_apple_os(self.settings.os): + if self.settings.get_safe('os.version'): + # Required, see https://github.com/conan-io/conan-center-index/pull/3456 + macos_min_version = tools.apple_deployment_target_flag(self.settings.os, + self.settings.get_safe('os.version'), + self.settings.get_safe('os.sdk'), + self.settings.get_safe('os.subsystem'), + self.settings.get_safe('arch')) + botan_extra_cxx_flags.append(macos_min_version) + macos_sdk_path = '-isysroot {}'.format(tools.XCRun(self.settings).sdk_path) + botan_extra_cxx_flags.append(macos_sdk_path) + + # This is to work around botan's configure script that *replaces* its + # standard (platform dependent) flags in presence of an environment + # variable ${CXXFLAGS}. Most notably, this would build botan with + # disabled compiler optimizations. + environment_cxxflags = tools.get_env('CXXFLAGS') + if environment_cxxflags: + del os.environ['CXXFLAGS'] + botan_extra_cxx_flags.append(environment_cxxflags) + + if self.options.enable_modules: + build_flags.append('--minimized-build') + build_flags.append('--enable-modules={}'.format(self.options.enable_modules)) + + if self.options.amalgamation: + build_flags.append('--amalgamation') + + if self.options.get_safe('single_amalgamation'): + build_flags.append('--single-amalgamation-file') + + if self.options.system_cert_bundle: + build_flags.append('--system-cert-bundle={}'.format(self.options.system_cert_bundle)) + + if self.options.with_bzip2: + build_flags.append('--with-bzip2') + build_flags.extend(self._dependency_build_flags('bzip2')) + + if self.options.with_openssl: + build_flags.append('--with-openssl') + build_flags.extend(self._dependency_build_flags('openssl')) + + if self.options.with_sqlite3: + build_flags.append('--with-sqlite3') + build_flags.extend(self._dependency_build_flags('sqlite3')) + + if self.options.with_zlib: + build_flags.append('--with-zlib') + build_flags.extend(self._dependency_build_flags('zlib')) + + if self.options.with_boost: + build_flags.append('--with-boost') + build_flags.extend(self._dependency_build_flags('boost')) + + if self.options.module_policy: + build_flags.append('--module-policy={}'.format(self.options.module_policy)) + + if self.settings.build_type == 'RelWithDebInfo': + build_flags.append('--with-debug-info') + + if self._is_x86: + if not self.options.with_sse2: + build_flags.append('--disable-sse2') + + if not self.options.with_ssse3: + build_flags.append('--disable-ssse3') + + if not self.options.with_sse4_1: + build_flags.append('--disable-sse4.1') + + if not self.options.with_sse4_2: + build_flags.append('--disable-sse4.2') + + if not self.options.with_avx2: + build_flags.append('--disable-avx2') + + if not self.options.with_bmi2: + build_flags.append('--disable-bmi2') + + if not self.options.with_rdrand: + build_flags.append('--disable-rdrand') + + if not self.options.with_rdseed: + build_flags.append('--disable-rdseed') + + if not self.options.with_aes_ni: + build_flags.append('--disable-aes-ni') + + if not self.options.with_sha_ni: + build_flags.append('--disable-sha-ni') + + if self._is_ppc: + if not self.options.with_powercrypto: + build_flags.append('--disable-powercrypto') + + if not self.options.with_altivec: + build_flags.append('--disable-altivec') + + if self._is_arm: + if not self.options.with_neon: + build_flags.append('--disable-neon') + + if not self.options.with_armv8crypto: + build_flags.append('--disable-armv8crypto') + + if str(self.settings.build_type).lower() == 'debug': + build_flags.append('--debug-mode') + + build_targets = ['shared'] if self.options.shared else ['static'] + + if self._is_mingw_windows: + build_flags.append('--without-stack-protector') + + if is_msvc(self): + build_flags.append(f"--msvc-runtime={msvc_runtime_flag(self)}") + + build_flags.append('--without-pkg-config') + + call_python = 'python' if self.settings.os == 'Windows' else '' + + prefix = tools.unix_path(self.package_folder) if self._is_mingw_windows else self.package_folder + + botan_abi = ' '.join(botan_abi_flags) if botan_abi_flags else ' ' + botan_cxx_extras = ' '.join(botan_extra_cxx_flags) if botan_extra_cxx_flags else ' ' + + configure_cmd = ('{python_call} ./configure.py' + ' --build-targets={targets}' + ' --distribution-info="Conan"' + ' --without-documentation' + ' --cc-abi-flags="{abi}"' + ' --extra-cxxflags="{cxxflags}"' + ' --cc={compiler}' + ' --cpu={cpu}' + ' --prefix={prefix}' + ' --os={os}' + ' {build_flags}').format( + python_call=call_python, + targets=','.join(build_targets), + abi=botan_abi, + cxxflags=botan_cxx_extras, + compiler=botan_compiler, + cpu=self.settings.arch, + prefix=prefix, + os=self._botan_os, + build_flags=' '.join(build_flags)) + + return configure_cmd + + @property + def _make_cmd(self): + return self._nmake_cmd if is_msvc(self) else self._gnumake_cmd + + @property + def _make_program(self): + return tools.get_env('CONAN_MAKE_PROGRAM', tools.which('make') or tools.which('mingw32-make')) + + @property + def _gnumake_cmd(self): + make_ldflags = 'LDFLAGS=-lc++abi' if self._is_linux_clang_libcxx else '' + + make_cmd = ('{ldflags}' ' {make}' ' -j{cpucount}').format( + ldflags=make_ldflags, make=self._make_program, cpucount=tools.cpu_count()) + return make_cmd + + @property + def _nmake_cmd(self): + vcvars = tools.vcvars_command(self.settings) + make_cmd = vcvars + ' && nmake' + return make_cmd + + @property + def _make_install_cmd(self): + if is_msvc(self): + vcvars = tools.vcvars_command(self.settings) + make_install_cmd = vcvars + ' && nmake install' + else: + make_install_cmd = '{make} install'.format(make=self._make_program) + return make_install_cmd + + @property + def _is_linux_clang_libcxx(self): + return ( + self.settings.os == 'Linux' and + self.settings.compiler == 'clang' and + self.settings.compiler.libcxx == 'libc++' + ) diff --git a/recipes/botan/all/patches/dll-dir.patch b/recipes/botan/all/patches/dll-dir.patch new file mode 100644 index 0000000000000..d0cda481f6695 --- /dev/null +++ b/recipes/botan/all/patches/dll-dir.patch @@ -0,0 +1,13 @@ +diff --git a/src/scripts/install.py b/src/scripts/install.py +index 4cbce5a8e..ed6fe897f 100755 +--- a/src/scripts/install.py ++++ b/src/scripts/install.py +@@ -191,7 +191,7 @@ def main(args): + libname = cfg['libname'] + soname_base = libname + '.dll' + copy_executable(os.path.join(out_dir, soname_base), +- prepend_destdir(os.path.join(lib_dir, soname_base))) ++ prepend_destdir(os.path.join(bin_dir, soname_base))) + else: + soname_patch = cfg['soname_patch'] + soname_abi = cfg['soname_abi'] diff --git a/recipes/botan/all/patches/fix-amalgamation-build.patch b/recipes/botan/all/patches/fix-amalgamation-build.patch new file mode 100644 index 0000000000000..4654ba32c6140 --- /dev/null +++ b/recipes/botan/all/patches/fix-amalgamation-build.patch @@ -0,0 +1,22 @@ +diff --git a/src/lib/hash/sha3/sha3_bmi2/sha3_bmi2.cpp b/src/lib/hash/sha3/sha3_bmi2/sha3_bmi2.cpp +index c7f1914a3..620b83eaa 100644 +--- a/src/lib/hash/sha3/sha3_bmi2/sha3_bmi2.cpp ++++ b/src/lib/hash/sha3/sha3_bmi2/sha3_bmi2.cpp +@@ -28,7 +28,7 @@ namespace { + #endif + + BOTAN_WORKAROUND_MAYBE_INLINE std::tuple +- xor_CNs(const uint64_t A[25]) ++ xor_CNs_BMI2(const uint64_t A[25]) + { + return { + A[0] ^ A[5] ^ A[10] ^ A[15] ^ A[20], +@@ -42,7 +42,7 @@ BOTAN_WORKAROUND_MAYBE_INLINE std::tuple(std::get<0>(Cs)) ^ std::get<3>(Cs); + const uint64_t D1 = rotl<1>(std::get<1>(Cs)) ^ std::get<4>(Cs); diff --git a/recipes/botan/all/patches/fix-unrecognized-linker-flag.patch b/recipes/botan/all/patches/fix-unrecognized-linker-flag.patch new file mode 100644 index 0000000000000..d70cce86690b9 --- /dev/null +++ b/recipes/botan/all/patches/fix-unrecognized-linker-flag.patch @@ -0,0 +1,17 @@ +diff --git a/configure.py b/configure.py +index 8b413db57..46331e78c 100755 +--- a/configure.py ++++ b/configure.py +@@ -2147,6 +2147,12 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, + 'mod_list': sorted([m.basename for m in modules]) + } + ++ if cc.basename == 'msvc' and variables['cxx_abi_flags'] != '': ++ # MSVC linker doesn't support/need the ABI options, ++ # just transfer them over to just the compiler invocations ++ variables['cc_compile_flags'] = '%s %s' % (variables['cxx_abi_flags'], variables['cc_compile_flags']) ++ variables['cxx_abi_flags'] = '' ++ + variables['lib_flags'] = cc.gen_lib_flags(options, variables) + variables['cmake_lib_flags'] = cmake_escape(variables['lib_flags']) + diff --git a/recipes/botan/all/patches/vs2015-install-fix.patch b/recipes/botan/all/patches/vs2015-install-fix.patch new file mode 100644 index 0000000000000..c53e1a6c17844 --- /dev/null +++ b/recipes/botan/all/patches/vs2015-install-fix.patch @@ -0,0 +1,56 @@ +From 42317bbcc7fe715b0a9f066bb52ed3c59dcc257e Mon Sep 17 00:00:00 2001 +From: Hannes Rantzsch +Date: Tue, 1 Dec 2020 09:40:38 +0100 +Subject: [PATCH] Backport a fix for a build issue in VS 2015 + +See https://github.com/randombit/botan/pull/2526 for details +--- + configure.py | 2 +- + src/build-data/makefile.in | 10 +++++----- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/configure.py b/configure.py +index 88eeaa575..f7affad72 100755 +--- a/configure.py ++++ b/configure.py +@@ -1994,7 +1994,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, + def choose_python_exe(): + exe = sys.executable + +- if exe[1] == ':': # Windows style paths ++ if options.os == 'mingw': # mingw doesn't handle the backslashes in the absolute path well + return exe.replace('\\', '/') + + return exe +diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in +index 4d68ab1ec..b215bebb5 100644 +--- a/src/build-data/makefile.in ++++ b/src/build-data/makefile.in +@@ -48,19 +48,19 @@ docs: %{doc_stamp_file} + %{endif} + + %{doc_stamp_file}: %{doc_dir}/*.rst %{doc_dir}/api_ref/*.rst %{doc_dir}/dev_ref/*.rst +- $(PYTHON_EXE) $(SCRIPTS_DIR)/build_docs.py --build-dir="%{build_dir}" ++ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/build_docs.py" --build-dir="%{build_dir}" + + clean: +- $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}" ++ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="%{build_dir}" + + distclean: +- $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}" --distclean ++ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="%{build_dir}" --distclean + + install: %{install_targets} +- $(PYTHON_EXE) $(SCRIPTS_DIR)/install.py --prefix="%{prefix}" --build-dir="%{build_dir}" --bindir=%{bindir} --libdir=%{libdir} --docdir=%{docdir} --includedir=%{includedir} ++ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/install.py" --prefix="%{prefix}" --build-dir="%{build_dir}" --bindir="%{bindir}" --libdir="%{libdir}" --docdir="%{docdir}" --includedir="%{includedir}" + + check: tests +- $(PYTHON_EXE) $(SCRIPTS_DIR)/check.py --build-dir="%{build_dir}" ++ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/check.py" --build-dir="%{build_dir}" + + # Object Files + LIBOBJS = %{join lib_objs} +-- +2.29.2 + diff --git a/recipes/botan/all/test_package/CMakeLists.txt b/recipes/botan/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5021b4e27691a --- /dev/null +++ b/recipes/botan/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(botan REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} botan::botan) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/botan/all/test_package/conanfile.py b/recipes/botan/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f4b0754b85efb --- /dev/null +++ b/recipes/botan/all/test_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, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/botan/all/test_package/test_package.cpp b/recipes/botan/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d8ace17201cc0 --- /dev/null +++ b/recipes/botan/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + std::vector key = Botan::hex_decode("000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"); + return 0; +} diff --git a/recipes/botan/config.yml b/recipes/botan/config.yml new file mode 100644 index 0000000000000..7fdc77ee53c3b --- /dev/null +++ b/recipes/botan/config.yml @@ -0,0 +1,31 @@ +versions: + "2.12.1": + folder: all + "2.13.0": + folder: all + "2.14.0": + folder: all + "2.15.0": + folder: all + "2.16.0": + folder: all + "2.17.0": + folder: all + "2.17.1": + folder: all + "2.17.2": + folder: all + "2.17.3": + folder: all + "2.18.0": + folder: all + "2.18.1": + folder: all + "2.18.2": + folder: all + "2.19.1": + folder: all + "2.19.2": + folder: all + "2.19.3": + folder: all diff --git a/recipes/box2d/2.4.x/conandata.yml b/recipes/box2d/2.4.x/conandata.yml new file mode 100644 index 0000000000000..c7372e2a8f037 --- /dev/null +++ b/recipes/box2d/2.4.x/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.4.0": + url: "https://github.com/erincatto/Box2D/archive/v2.4.0.zip" + sha256: "6aebbc54c93e367c97e382a57ba12546731dcde51526964c2ab97dec2050f8b9" + "2.4.1": + url: "https://github.com/erincatto/box2d/archive/refs/tags/v2.4.1.tar.gz" + sha256: "d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2" +patches: + "2.4.0": + - patch_file: "patches/0001-install-and-allow-shared.patch" diff --git a/recipes/box2d/2.4.x/conanfile.py b/recipes/box2d/2.4.x/conanfile.py new file mode 100644 index 0000000000000..ae09ce435deda --- /dev/null +++ b/recipes/box2d/2.4.x/conanfile.py @@ -0,0 +1,71 @@ +import os +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class Box2dConan(ConanFile): + name = "box2d" + license = "Zlib" + description = "Box2D is a 2D physics engine for games" + homepage = "http://box2d.org/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("physics-engine", "graphic", "2d", "collision") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True,} + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + try: + del self.options.fPIC + except Exception: + pass + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + 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.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.variables["BOX2D_BUILD_TESTBED"] = False + tc.variables["BOX2D_BUILD_UNIT_TESTS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + 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, "lib", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "box2d" + self.cpp_info.names["cmake_find_package_multi"] = "box2d" + self.cpp_info.libs = ["box2d"] + if Version(self.version) >= "2.4.1" and self.options.shared: + self.cpp_info.defines.append("B2_SHARED") diff --git a/recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch b/recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch new file mode 100644 index 0000000000000..6bd99f9d1d993 --- /dev/null +++ b/recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch @@ -0,0 +1,37 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,3 +39,8 @@ if (BOX2D_BUILD_TESTBED) + set_property(TARGET testbed PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/testbed") + endif() + endif() ++ ++install( ++ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/box2d" ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -95,14 +95,22 @@ set(BOX2D_HEADER_FILES + ../include/box2d/b2_world_callbacks.h + ../include/box2d/box2d.h) + +-add_library(box2d STATIC ${BOX2D_SOURCE_FILES} ${BOX2D_HEADER_FILES}) ++add_library(box2d ${BOX2D_SOURCE_FILES} ${BOX2D_HEADER_FILES}) + target_include_directories(box2d PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) + target_include_directories(box2d PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + set_target_properties(box2d PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED YES + CXX_EXTENSIONS NO + ) + ++install( ++ TARGETS box2d ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++ + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "src" FILES ${BOX2D_SOURCE_FILES}) + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/../include" PREFIX "include" FILES ${BOX2D_HEADER_FILES}) diff --git a/recipes/box2d/2.4.x/test_package/CMakeLists.txt b/recipes/box2d/2.4.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fb4d8d7f5888a --- /dev/null +++ b/recipes/box2d/2.4.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(box2d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} box2d::box2d) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/box2d/2.4.x/test_package/conanfile.py b/recipes/box2d/2.4.x/test_package/conanfile.py new file mode 100644 index 0000000000000..d1ce1a2cbc477 --- /dev/null +++ b/recipes/box2d/2.4.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class Box2DTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/box2d/2.4.x/test_package/test_package.cpp b/recipes/box2d/2.4.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..7dfa813bc1d2e --- /dev/null +++ b/recipes/box2d/2.4.x/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include "box2d/box2d.h" + +int main(void) { + b2Vec2 gravity(0.0f, -10.0f); + b2World world(gravity); + + b2BodyDef groundBodyDef; + groundBodyDef.position.Set(0.0f, -10.0f); + + b2Body* groundBody = world.CreateBody(&groundBodyDef); + b2PolygonShape groundBox; + groundBox.SetAsBox(50.0f, 10.0f); + + return 0; +} diff --git a/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt b/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..373fb5bb61846 --- /dev/null +++ b/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(box2d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} box2d::box2d) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/box2d/2.4.x/test_v1_package/conanfile.py b/recipes/box2d/2.4.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7513484720425 --- /dev/null +++ b/recipes/box2d/2.4.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class Box2DTestConan(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/box2d/2.4.x/test_v1_package/test_package.cpp b/recipes/box2d/2.4.x/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..7dfa813bc1d2e --- /dev/null +++ b/recipes/box2d/2.4.x/test_v1_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include "box2d/box2d.h" + +int main(void) { + b2Vec2 gravity(0.0f, -10.0f); + b2World world(gravity); + + b2BodyDef groundBodyDef; + groundBodyDef.position.Set(0.0f, -10.0f); + + b2Body* groundBody = world.CreateBody(&groundBodyDef); + b2PolygonShape groundBox; + groundBox.SetAsBox(50.0f, 10.0f); + + return 0; +} diff --git a/recipes/box2d/all/conandata.yml b/recipes/box2d/all/conandata.yml new file mode 100644 index 0000000000000..857c8f5d17268 --- /dev/null +++ b/recipes/box2d/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.1": + url: "https://github.com/erincatto/Box2D/archive/v2.3.1.zip" + sha256: "8ddd947400c59bcf09774bd75787e6253098a0bd337f5c61dae38b91aea678cf" diff --git a/recipes/box2d/all/conanfile.py b/recipes/box2d/all/conanfile.py new file mode 100644 index 0000000000000..e5adde1f2b06a --- /dev/null +++ b/recipes/box2d/all/conanfile.py @@ -0,0 +1,68 @@ +import os +from conan import ConanFile, tools +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout + +required_conan_version = ">=1.46.0" + + +class Box2dConan(ConanFile): + name = "box2d" + license = "Zlib" + description = "Box2D is a 2D physics engine for games" + topics = ("physics", "engine", "game development") + homepage = "http://box2d.org/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True,} + + def config_options(self): + if self.settings.os == "Windows": + try: + del self.options.fPIC + except Exception: + pass + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="Box2D") + + def source(self): + tools.files.get(self, + **self.conan_data["sources"][self.version], + strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BOX2D_BUILD_SHARED"] = self.options.shared + tc.variables["BOX2D_BUILD_STATIC"] = not self.options.shared + if self.settings.os == "Windows" and self.options.shared: + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BOX2D_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder="Box2D") + cmake.build() + + def package(self): + tools.files.copy(self, "License.txt", src=os.path.join(self.source_folder, "Box2D"), dst=os.path.join(self.package_folder,"licenses")) + tools.files.copy(self, os.path.join("Box2D", "*.h"), src=os.path.join(self.source_folder, "Box2D"), dst=os.path.join(self.package_folder, "include")) + tools.files.copy(self, "*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + tools.files.copy(self, "*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + tools.files.copy(self, "*.so*", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + tools.files.copy(self, "*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + tools.files.copy(self, "*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["Box2D"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] diff --git a/recipes/box2d/all/test_package/CMakeLists.txt b/recipes/box2d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..22c1118333f4f --- /dev/null +++ b/recipes/box2d/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package) + +find_package(box2d) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package box2d::box2d) diff --git a/recipes/box2d/all/test_package/conanfile.py b/recipes/box2d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a3a0294a68898 --- /dev/null +++ b/recipes/box2d/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +import os +from conan import ConanFile, tools +from conan.tools.cmake import CMake, cmake_layout + + +class Box2DTestConan(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 not tools.build.cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/box2d/all/test_package/test_package.cpp b/recipes/box2d/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..045f0bf063169 --- /dev/null +++ b/recipes/box2d/all/test_package/test_package.cpp @@ -0,0 +1,88 @@ +#include +#include + +#include + +// This is a simple example of building and running a simulation +// using Box2D. Here we create a large ground box and a small dynamic +// box. +// There are no graphics for this example. Box2D is meant to be used +// with your rendering engine in your game engine. +int main(int argc, char **argv) +{ + B2_NOT_USED(argc); + B2_NOT_USED(argv); + + // Define the gravity vector. + b2Vec2 gravity(0.0f, -10.0f); + + // Construct a world object, which will hold and simulate the rigid bodies. + b2World world(gravity); + + // Define the ground body. + b2BodyDef groundBodyDef; + groundBodyDef.position.Set(0.0f, -10.0f); + + // Call the body factory which allocates memory for the ground body + // from a pool and creates the ground box shape (also from a pool). + // The body is also added to the world. + b2Body *groundBody = world.CreateBody(&groundBodyDef); + + // Define the ground box shape. + b2PolygonShape groundBox; + + // The extents are the half-widths of the box. + groundBox.SetAsBox(50.0f, 10.0f); + + // Add the ground fixture to the ground body. + groundBody->CreateFixture(&groundBox, 0.0f); + + // Define the dynamic body. We set its position and call the body factory. + b2BodyDef bodyDef; + bodyDef.type = b2_dynamicBody; + bodyDef.position.Set(0.0f, 4.0f); + b2Body *body = world.CreateBody(&bodyDef); + + // Define another box shape for our dynamic body. + b2PolygonShape dynamicBox; + dynamicBox.SetAsBox(1.0f, 1.0f); + + // Define the dynamic body fixture. + b2FixtureDef fixtureDef; + fixtureDef.shape = &dynamicBox; + + // Set the box density to be non-zero, so it will be dynamic. + fixtureDef.density = 1.0f; + + // Override the default friction. + fixtureDef.friction = 0.3f; + + // Add the shape to the body. + body->CreateFixture(&fixtureDef); + + // Prepare for simulation. Typically we use a time step of 1/60 of a + // second (60Hz) and 10 iterations. This provides a high quality simulation + // in most game scenarios. + float32 timeStep = 1.0f / 60.0f; + int32 velocityIterations = 6; + int32 positionIterations = 2; + + // This is our little game loop. + for (int32 i = 0; i < 60; ++i) + { + // Instruct the world to perform a single step of simulation. + // It is generally best to keep the time step and iterations fixed. + world.Step(timeStep, velocityIterations, positionIterations); + + // Now print the position and angle of the body. + b2Vec2 position = body->GetPosition(); + float32 angle = body->GetAngle(); + + printf("%4.2f %4.2f %4.2f\n", position.x, position.y, angle); + } + + // When the world destructor is called, all bodies and joints are freed. This can + // create orphaned pointers, so be careful about your world management. + + return 0; +} diff --git a/recipes/box2d/all/test_v1_package/CMakeLists.txt b/recipes/box2d/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..458981ad5eb24 --- /dev/null +++ b/recipes/box2d/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/box2d/all/test_v1_package/conanfile.py b/recipes/box2d/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..133228fb54665 --- /dev/null +++ b/recipes/box2d/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class Box2DTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/box2d/config.yml b/recipes/box2d/config.yml new file mode 100644 index 0000000000000..1922ed59d887d --- /dev/null +++ b/recipes/box2d/config.yml @@ -0,0 +1,7 @@ +versions: + "2.3.1": + folder: "all" + "2.4.0": + folder: "2.4.x" + "2.4.1": + folder: "2.4.x" diff --git a/recipes/breakpad/all/conandata.yml b/recipes/breakpad/all/conandata.yml new file mode 100644 index 0000000000000..0037ecfc65960 --- /dev/null +++ b/recipes/breakpad/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20210521": + url: "https://github.com/google/breakpad/archive/f7428bc.tar.gz" + sha256: "55a688a49ffc476d94d92c3fd73f9264c974c25af8d6371c3901bd3451081e47" +patches: + "cci.20210521": + - patch_file: "patches/0001-Use_conans_lss.patch" + - patch_file: "patches/0002-Remove-hardcoded-fpic.patch" diff --git a/recipes/breakpad/all/conanfile.py b/recipes/breakpad/all/conanfile.py new file mode 100644 index 0000000000000..f4cdf5d9940e4 --- /dev/null +++ b/recipes/breakpad/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + +required_conan_version = ">=1.52.0" + + +class BreakpadConan(ConanFile): + name = "breakpad" + description = "A set of client and server components which implement a crash-reporting system" + topics = ["crash", "report", "breakpad"] + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://chromium.googlesource.com/breakpad/breakpad/" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("linux-syscall-support/cci.20200813") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("Breakpad can only be built on Linux. For other OSs check sentry-breakpad") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + # see https://github.com/conan-io/conan/issues/12020 + tc.configure_args.append("--libexecdir=${prefix}/bin") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.components["libbreakpad"].set_property("pkg_config_name", "breakpad") + self.cpp_info.components["libbreakpad"].libs = ["breakpad"] + self.cpp_info.components["libbreakpad"].includedirs.append(os.path.join("include", "breakpad")) + self.cpp_info.components["libbreakpad"].system_libs.append("pthread") + self.cpp_info.components["libbreakpad"].requires.append("linux-syscall-support::linux-syscall-support") + + self.cpp_info.components["client"].set_property("pkg_config_name", "breakpad-client") + self.cpp_info.components["client"].libs = ["breakpad_client"] + self.cpp_info.components["client"].includedirs.append(os.path.join("include", "breakpad")) + self.cpp_info.components["client"].system_libs.append("pthread") + self.cpp_info.components["client"].requires.append("linux-syscall-support::linux-syscall-support") + + # workaround to always produce a global pkgconfig file for PkgConfigDeps + self.cpp_info.set_property("pkg_config_name", "breakpad-do-not-use") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/breakpad/all/patches/0001-Use_conans_lss.patch b/recipes/breakpad/all/patches/0001-Use_conans_lss.patch new file mode 100644 index 0000000000000..abe15dd4f2ace --- /dev/null +++ b/recipes/breakpad/all/patches/0001-Use_conans_lss.patch @@ -0,0 +1,258 @@ +diff --color -ur Makefile.in Makefile.in +--- Makefile.in 2021-05-21 15:56:41.000000000 -0300 ++++ Makefile.in 2021-05-27 18:57:23.986912433 -0300 +@@ -2082,7 +2082,7 @@ + HEADERS = $(includec_HEADERS) $(includecl_HEADERS) \ + $(includeclc_HEADERS) $(includecldwc_HEADERS) \ + $(includeclh_HEADERS) $(includeclm_HEADERS) \ +- $(includegbc_HEADERS) $(includelss_HEADERS) \ ++ $(includegbc_HEADERS) \ + $(includep_HEADERS) + am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) + # Read a list of newline-separated strings from the standard input, +@@ -9718,7 +9718,7 @@ + install-includeclHEADERS install-includeclcHEADERS \ + install-includecldwcHEADERS install-includeclhHEADERS \ + install-includeclmHEADERS install-includegbcHEADERS \ +- install-includelssHEADERS install-includepHEADERS \ ++ iinstall-includepHEADERS \ + install-pkgconfigDATA + + install-dvi: install-dvi-am +@@ -10084,7 +10084,7 @@ + install-includeclHEADERS install-includeclcHEADERS \ + install-includecldwcHEADERS install-includeclhHEADERS \ + install-includeclmHEADERS install-includegbcHEADERS \ +- install-includelssHEADERS install-includepHEADERS install-info \ ++ iinstall-includepHEADERS install-info \ + install-info-am install-libLIBRARIES install-libexecPROGRAMS \ + install-man install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ +diff --color -ur src/client/linux/crash_generation/crash_generation_client.cc src/client/linux/crash_generation/crash_generation_client.cc +--- src/client/linux/crash_generation/crash_generation_client.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/crash_generation/crash_generation_client.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -37,7 +37,7 @@ + + #include "common/linux/eintr_wrapper.h" + #include "common/linux/ignore_ret.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/client/linux/handler/exception_handler.cc src/client/linux/handler/exception_handler.cc +--- src/client/linux/handler/exception_handler.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/handler/exception_handler.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -95,7 +95,7 @@ + #include "client/linux/minidump_writer/linux_dumper.h" + #include "client/linux/minidump_writer/minidump_writer.h" + #include "common/linux/eintr_wrapper.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + #if defined(__ANDROID__) + #include "linux/sched.h" +diff --color -ur src/client/linux/handler/exception_handler_unittest.cc src/client/linux/handler/exception_handler_unittest.cc +--- src/client/linux/handler/exception_handler_unittest.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/handler/exception_handler_unittest.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -50,7 +50,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/tests/auto_tempdir.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + #include "google_breakpad/processor/minidump.h" + + using namespace google_breakpad; +diff --color -ur src/client/linux/log/log.cc src/client/linux/log/log.cc +--- src/client/linux/log/log.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/log/log.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -33,7 +33,7 @@ + #include + #include + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include + #endif + + namespace logger { +diff --color -ur src/client/linux/minidump_writer/cpu_set.h src/client/linux/minidump_writer/cpu_set.h +--- src/client/linux/minidump_writer/cpu_set.h 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/cpu_set.h 2021-05-27 18:57:23.990912414 -0300 +@@ -35,7 +35,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/client/linux/minidump_writer/directory_reader.h src/client/linux/minidump_writer/directory_reader.h +--- src/client/linux/minidump_writer/directory_reader.h 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/directory_reader.h 2021-05-27 18:57:23.990912414 -0300 +@@ -38,7 +38,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/client/linux/minidump_writer/line_reader.h src/client/linux/minidump_writer/line_reader.h +--- src/client/linux/minidump_writer/line_reader.h 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/line_reader.h 2021-05-27 18:57:23.990912414 -0300 +@@ -35,7 +35,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/client/linux/minidump_writer/linux_dumper.cc src/client/linux/minidump_writer/linux_dumper.cc +--- src/client/linux/minidump_writer/linux_dumper.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/linux_dumper.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -51,7 +51,7 @@ + #include "common/linux/memory_mapped_file.h" + #include "common/linux/safe_readlink.h" + #include "google_breakpad/common/minidump_exception_linux.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + #if defined(__ANDROID__) + +diff --color -ur src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +--- src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -39,7 +39,7 @@ + #include + + #include "common/scoped_ptr.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + #if defined(__ARM_EABI__) + #define TID_PTR_REGISTER "r3" +diff --color -ur src/client/linux/minidump_writer/linux_ptrace_dumper.cc src/client/linux/minidump_writer/linux_ptrace_dumper.cc +--- src/client/linux/minidump_writer/linux_ptrace_dumper.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/linux_ptrace_dumper.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -57,7 +57,7 @@ + #include "client/linux/minidump_writer/directory_reader.h" + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + // Suspends a thread by attaching to it. + static bool SuspendThread(pid_t pid) { +diff --color -ur src/client/linux/minidump_writer/minidump_writer.cc src/client/linux/minidump_writer/minidump_writer.cc +--- src/client/linux/minidump_writer/minidump_writer.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/minidump_writer.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -77,7 +77,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/minidump_type_helper.h" + #include "google_breakpad/common/minidump_format.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace { + +diff --color -ur src/client/linux/minidump_writer/proc_cpuinfo_reader.h src/client/linux/minidump_writer/proc_cpuinfo_reader.h +--- src/client/linux/minidump_writer/proc_cpuinfo_reader.h 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/linux/minidump_writer/proc_cpuinfo_reader.h 2021-05-27 18:57:23.990912414 -0300 +@@ -36,7 +36,7 @@ + + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/client/minidump_file_writer.cc src/client/minidump_file_writer.cc +--- src/client/minidump_file_writer.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/client/minidump_file_writer.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -41,7 +41,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/string_conversion.h" + #if defined(__linux__) && __linux__ +-#include "third_party/lss/linux_syscall_support.h" ++#include + #endif + + #if defined(__ANDROID__) +diff --color -ur src/common/linux/file_id.cc src/common/linux/file_id.cc +--- src/common/linux/file_id.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/common/linux/file_id.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -46,7 +46,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/linux/memory_mapped_file.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/common/linux/memory_mapped_file.cc src/common/linux/memory_mapped_file.cc +--- src/common/linux/memory_mapped_file.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/common/linux/memory_mapped_file.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -40,7 +40,7 @@ + #include + + #include "common/memory_range.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/common/linux/safe_readlink.cc src/common/linux/safe_readlink.cc +--- src/common/linux/safe_readlink.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/common/linux/safe_readlink.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -32,7 +32,7 @@ + + #include + +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace google_breakpad { + +diff --color -ur src/common/memory_allocator.h src/common/memory_allocator.h +--- src/common/memory_allocator.h 2021-05-21 15:56:41.000000000 -0300 ++++ src/common/memory_allocator.h 2021-05-27 18:57:23.990912414 -0300 +@@ -47,7 +47,7 @@ + #define sys_munmap munmap + #define MAP_ANONYMOUS MAP_ANON + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include + #endif + + namespace google_breakpad { +diff --color -ur src/processor/testdata/linux_test_app.cc src/processor/testdata/linux_test_app.cc +--- src/processor/testdata/linux_test_app.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/processor/testdata/linux_test_app.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -46,7 +46,7 @@ + #include + + #include "client/linux/handler/exception_handler.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + + namespace { + +diff --color -ur src/tools/linux/md2core/minidump-2-core.cc src/tools/linux/md2core/minidump-2-core.cc +--- src/tools/linux/md2core/minidump-2-core.cc 2021-05-21 15:56:41.000000000 -0300 ++++ src/tools/linux/md2core/minidump-2-core.cc 2021-05-27 18:57:23.990912414 -0300 +@@ -52,7 +52,7 @@ + #include "common/using_std_string.h" + #include "google_breakpad/common/breakpad_types.h" + #include "google_breakpad/common/minidump_format.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include + #include "tools/linux/md2core/minidump_memory_range.h" + + #if ULONG_MAX == 0xffffffffffffffff diff --git a/recipes/breakpad/all/patches/0002-Remove-hardcoded-fpic.patch b/recipes/breakpad/all/patches/0002-Remove-hardcoded-fpic.patch new file mode 100644 index 0000000000000..e0ca688e693a5 --- /dev/null +++ b/recipes/breakpad/all/patches/0002-Remove-hardcoded-fpic.patch @@ -0,0 +1,13 @@ +diff --color -ur a/Makefile.in b/Makefile.in +--- Makefile.in 2021-05-21 15:56:41.000000000 -0300 ++++ Makefile.in 2021-05-27 19:01:06.857704652 -0300 +@@ -130,8 +130,7 @@ + @ANDROID_HOST_TRUE@ -I$(top_srcdir)/src/common/android/testing/include + + # Build as PIC on Linux, for linux_client_unittest_shlib +-@LINUX_HOST_TRUE@am__append_2 = -fPIC +-@LINUX_HOST_TRUE@am__append_3 = -fPIC ++ + libexec_PROGRAMS = $(am__EXEEXT_10) + bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) + check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ diff --git a/recipes/breakpad/all/test_package/CMakeLists.txt b/recipes/breakpad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..65d0c4df5bef2 --- /dev/null +++ b/recipes/breakpad/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(breakpad REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE breakpad::breakpad) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/breakpad/all/test_package/conanfile.py b/recipes/breakpad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/breakpad/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/breakpad/all/test_package/test_package.cpp b/recipes/breakpad/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..83fc0946bdb6c --- /dev/null +++ b/recipes/breakpad/all/test_package/test_package.cpp @@ -0,0 +1,35 @@ +#include "client/linux/handler/exception_handler.h" + +#include + +using namespace google_breakpad; + +namespace { + +bool callback(const MinidumpDescriptor &descriptor, + void *context, + bool succeeded) { + // if succeeded is true, descriptor.path() contains a path + // to the minidump file. Context is the context passed to + // the exception handler's constructor. + return succeeded; +} + +} + +int main(int argc, char *argv[]) { + std::cout << "Breakpad test_package\n"; + + MinidumpDescriptor descriptor("path/to/cache"); + ExceptionHandler eh( + descriptor, + /* filter */ nullptr, + callback, + /* context */ nullptr, + /* install handler */ true, + /* server FD */ -1 + ); + + // run your program here + return 0; +} diff --git a/recipes/breakpad/all/test_v1_package/CMakeLists.txt b/recipes/breakpad/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/breakpad/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/breakpad/all/test_v1_package/conanfile.py b/recipes/breakpad/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/breakpad/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/breakpad/config.yml b/recipes/breakpad/config.yml new file mode 100644 index 0000000000000..f9fbb96c7dd28 --- /dev/null +++ b/recipes/breakpad/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210521": + folder: all diff --git a/recipes/brigand/all/conandata.yml b/recipes/brigand/all/conandata.yml new file mode 100644 index 0000000000000..9a62d14168e32 --- /dev/null +++ b/recipes/brigand/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cpp11-1.3.0": + url: "https://github.com/edouarda/brigand/archive/refs/tags/cpp11-1.3.0.tar.gz" + sha256: "33c8fc780d2f2c9c0d21cbea909429ae9a64765496f66f6ab2f1e978502aa295" diff --git a/recipes/brigand/all/conanfile.py b/recipes/brigand/all/conanfile.py new file mode 100644 index 0000000000000..d205988b4830f --- /dev/null +++ b/recipes/brigand/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BrigandConan(ConanFile): + name = "brigand" + url = "https://github.com/conan-io/conan-center-index" + description = "A light-weight, fully functional, instant-compile time meta-programming library." + topics = ("meta-programming", "boost", "runtime", "header-only") + homepage = "https://github.com/edouarda/brigand" + license = "BSL-1.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_boost": [True, False], + } + default_options = { + "with_boost": True, + } + + no_copy_source = True + + def requirements(self): + if self.options.with_boost: + # TODO: add transitive_headers=True & bump required_conan_version to >=1.52.0 + self.requires("boost/1.79.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + include_path = os.path.join("include", "brigand") + copy(self, "*.hpp", src=os.path.join(self.source_folder, include_path), dst=os.path.join(self.package_folder, include_path)) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libbrigand") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.options.with_boost: + self.cpp_info.requires = ["boost::headers"] + else: + self.cpp_info.defines.append("BRIGAND_NO_BOOST_SUPPORT") diff --git a/recipes/brigand/all/test_package/CMakeLists.txt b/recipes/brigand/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..edca2f720d504 --- /dev/null +++ b/recipes/brigand/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(brigand REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE brigand::brigand) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/brigand/all/test_package/conanfile.py b/recipes/brigand/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/brigand/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/brigand/all/test_package/test_package.cpp b/recipes/brigand/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..08cb16ff0036d --- /dev/null +++ b/recipes/brigand/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +using list1 = brigand::list; +using list2 = brigand::list; +using flat_list = brigand::flatten>>>; + + +int main() { + + static_assert( + std::is_same>::value, + "failed to compile brigand::flatten example"); + + return 0; +} diff --git a/recipes/brigand/all/test_v1_package/CMakeLists.txt b/recipes/brigand/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c08f269548f6a --- /dev/null +++ b/recipes/brigand/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(brigand REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE brigand::brigand) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/brigand/all/test_v1_package/conanfile.py b/recipes/brigand/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/brigand/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/brigand/config.yml b/recipes/brigand/config.yml new file mode 100644 index 0000000000000..d48deae849e10 --- /dev/null +++ b/recipes/brigand/config.yml @@ -0,0 +1,3 @@ +versions: + "cpp11-1.3.0": + folder: all diff --git a/recipes/brotli/all/conandata.yml b/recipes/brotli/all/conandata.yml new file mode 100644 index 0000000000000..c664dae35678e --- /dev/null +++ b/recipes/brotli/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.0.9": + url: https://github.com/google/brotli/archive/v1.0.9.tar.gz + sha256: f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46 + "1.0.7": + url: https://github.com/google/brotli/archive/v1.0.7.tar.gz + sha256: 4c61bfb0faca87219ea587326c467b95acb25555b53d1a421ffa3c8a9296ee2c +patches: + "1.0.9": + - patch_file: "patches/0002-target-props.patch" + "1.0.7": + - patch_file: "patches/0001-target-props.patch" diff --git a/recipes/brotli/all/conanfile.py b/recipes/brotli/all/conanfile.py new file mode 100644 index 0000000000000..5ba9ac6bd939f --- /dev/null +++ b/recipes/brotli/all/conanfile.py @@ -0,0 +1,130 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class BrotliConan(ConanFile): + name = "brotli" + description = "Brotli compression format" + topics = ("brotli", "compression") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/brotli" + license = "MIT", + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "target_bits": [64, 32, None], + "endianness": ["big", "little", "neutral", None], + "enable_portable": [True, False], + "enable_rbit": [True, False], + "enable_debug": [True, False], + "enable_log": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "target_bits": None, + "endianness": None, + "enable_portable": False, + "enable_rbit": True, + "enable_debug": False, + "enable_log": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BROTLI_BUNDLED_MODE"] = False + tc.variables["BROTLI_DISABLE_TESTS"] = True + if self.options.get_safe("target_bits") == 32: + tc.preprocessor_definitions["BROTLI_BUILD_32_BIT"] = 1 + elif self.options.get_safe("target_bits") == 64: + tc.preprocessor_definitions["BROTLI_BUILD_64_BIT"] = 1 + if self.options.get_safe("endianness") == "big": + tc.preprocessor_definitions["BROTLI_BUILD_BIG_ENDIAN"] = 1 + elif self.options.get_safe("endianness") == "neutral": + tc.preprocessor_definitions["BROTLI_BUILD_ENDIAN_NEUTRAL"] = 1 + elif self.options.get_safe("endianness") == "little": + tc.preprocessor_definitions["BROTLI_BUILD_LITTLE_ENDIAN"] = 1 + if self.options.enable_portable: + tc.preprocessor_definitions["BROTLI_BUILD_PORTABLE"] = 1 + if not self.options.enable_rbit: + tc.preprocessor_definitions["BROTLI_BUILD_NO_RBIT"] = 1 + if self.options.enable_debug: + tc.preprocessor_definitions["BROTLI_DEBUG"] = 1 + if self.options.enable_log: + tc.preprocessor_definitions["BROTLI_ENABLE_LOG"] = 1 + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + includedir = os.path.join("include", "brotli") + # brotlicommon + self.cpp_info.components["brotlicommon"].set_property("pkg_config_name", "libbrotlicommon") + self.cpp_info.components["brotlicommon"].includedirs.append(includedir) + self.cpp_info.components["brotlicommon"].libs = [self._get_decorated_lib("brotlicommon")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["brotlicommon"].defines.append("BROTLI_SHARED_COMPILATION") + # brotlidec + self.cpp_info.components["brotlidec"].set_property("pkg_config_name", "libbrotlidec") + self.cpp_info.components["brotlidec"].includedirs.append(includedir) + self.cpp_info.components["brotlidec"].libs = [self._get_decorated_lib("brotlidec")] + self.cpp_info.components["brotlidec"].requires = ["brotlicommon"] + # brotlienc + self.cpp_info.components["brotlienc"].set_property("pkg_config_name", "libbrotlienc") + self.cpp_info.components["brotlienc"].includedirs.append(includedir) + self.cpp_info.components["brotlienc"].libs = [self._get_decorated_lib("brotlienc")] + self.cpp_info.components["brotlienc"].requires = ["brotlicommon"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["brotlienc"].system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed. + # do not set this target in CMakeDeps, it was a mistake, there is no official brotil config file, nor Find module file + self.cpp_info.names["cmake_find_package"] = "Brotli" + self.cpp_info.names["cmake_find_package_multi"] = "Brotli" + self.cpp_info.components["brotlicommon"].names["pkg_config"] = "libbrotlicommon" + self.cpp_info.components["brotlidec"].names["pkg_config"] = "libbrotlidec" + self.cpp_info.components["brotlienc"].names["pkg_config"] = "libbrotlienc" + + def _get_decorated_lib(self, name): + libname = name + if not self.options.shared: + libname += "-static" + return libname diff --git a/recipes/brotli/all/patches/0001-target-props.patch b/recipes/brotli/all/patches/0001-target-props.patch new file mode 100644 index 0000000000000..8ee7cdd7c6642 --- /dev/null +++ b/recipes/brotli/all/patches/0001-target-props.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fc45f80..e3b0dbf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -152,15 +152,24 @@ foreach(lib brotlicommon brotlidec brotlienc) + target_compile_definitions(${lib} PUBLIC "BROTLI_SHARED_COMPILATION" ) + string(TOUPPER "${lib}" LIB) + set_target_properties (${lib} PROPERTIES DEFINE_SYMBOL "${LIB}_SHARED_COMPILATION" ) ++ if (NOT BUILD_SHARED_LIBS) ++ set_target_properties(${lib} PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) ++ endif() + endforeach() + ++if (BUILD_SHARED_LIBS) ++ foreach(lib brotlienc-static brotlidec-static brotlicommon-static) ++ set_target_properties(${lib} PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) ++ endforeach() ++endif() ++ + foreach(lib brotlicommon brotlidec brotlienc brotlicommon-static brotlidec-static brotlienc-static) + target_link_libraries(${lib} ${LIBM_LIBRARY}) + set_property(TARGET ${lib} APPEND PROPERTY INCLUDE_DIRECTORIES ${BROTLI_INCLUDE_DIRS}) + set_target_properties(${lib} PROPERTIES + VERSION "${BROTLI_ABI_COMPATIBILITY}.${BROTLI_ABI_AGE}.${BROTLI_ABI_REVISION}" + SOVERSION "${BROTLI_ABI_COMPATIBILITY}" +- POSITION_INDEPENDENT_CODE TRUE) ++ ) + set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}") + endforeach() + +@@ -184,27 +193,33 @@ endif() + # Build the brotli executable + add_executable(brotli ${BROTLI_CLI_C}) + target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC}) ++set_target_properties(brotli PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) ++ + + # Installation + if(NOT BROTLI_BUNDLED_MODE) ++ if (NOT) + install( + TARGETS brotli + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) ++ endif() + ++ if (BUILD_SHARED_LIBS) + install( + TARGETS ${BROTLI_LIBRARIES_CORE} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) +- ++ else() + install( + TARGETS ${BROTLI_LIBRARIES_CORE_STATIC} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) ++ endif() + + install( + DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli diff --git a/recipes/brotli/all/patches/0002-target-props.patch b/recipes/brotli/all/patches/0002-target-props.patch new file mode 100644 index 0000000000000..3647649bb1e14 --- /dev/null +++ b/recipes/brotli/all/patches/0002-target-props.patch @@ -0,0 +1,67 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -183,6 +183,16 @@ + set_target_properties (${lib} PROPERTIES DEFINE_SYMBOL "${LIB}_SHARED_COMPILATION") + endforeach() + ++if(BUILD_SHARED_LIBS) ++ foreach(lib IN LISTS BROTLI_STATIC_LIBS) ++ set_target_properties(${lib} PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) ++ endforeach() ++else() ++ foreach(lib IN LISTS BROTLI_SHARED_LIBS) ++ set_target_properties(${lib} PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) ++ endforeach() ++endif() ++ + foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS) + target_link_libraries(${lib} ${LIBM_LIBRARY}) + set_property(TARGET ${lib} APPEND PROPERTY INCLUDE_DIRECTORIES ${BROTLI_INCLUDE_DIRS}) +@@ -190,7 +200,6 @@ + VERSION "${BROTLI_ABI_COMPATIBILITY}.${BROTLI_ABI_AGE}.${BROTLI_ABI_REVISION}" + SOVERSION "${BROTLI_ABI_COMPATIBILITY}") + if(NOT BROTLI_EMSCRIPTEN) +- set_target_properties(${lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + endif() + set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}") + endforeach() +@@ -217,15 +226,12 @@ + # Build the brotli executable + add_executable(brotli ${BROTLI_CLI_C}) + target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC}) ++set_target_properties(brotli PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) + + # Installation +-if(NOT BROTLI_EMSCRIPTEN) + if(NOT BROTLI_BUNDLED_MODE) +- install( +- TARGETS brotli +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +- ) + ++ if(BUILD_SHARED_LIBS) + install( + TARGETS ${BROTLI_LIBRARIES_CORE} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +@@ -233,19 +239,20 @@ + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + ++ else() + install( + TARGETS ${BROTLI_LIBRARIES_CORE_STATIC} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) ++ endif() + + install( + DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + endif() # BROTLI_BUNDLED_MODE +-endif() # BROTLI_EMSCRIPTEN + + # Tests + diff --git a/recipes/brotli/all/test_package/CMakeLists.txt b/recipes/brotli/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8339b11b6d1f4 --- /dev/null +++ b/recipes/brotli/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(brotli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE brotli::brotli) diff --git a/recipes/brotli/all/test_package/conanfile.py b/recipes/brotli/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/brotli/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/brotli/all/test_package/test_package.cpp b/recipes/brotli/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0e1d491213b2e --- /dev/null +++ b/recipes/brotli/all/test_package/test_package.cpp @@ -0,0 +1,51 @@ +#include +#include + +#include +#include +#include +#include + +int main() { + std::string input = "some long text that we would like to compress if possible...."; + uint8_t buffer[128]; + size_t outputsize = sizeof(buffer); + BROTLI_BOOL result = BrotliEncoderCompress( + BROTLI_DEFAULT_QUALITY, + BROTLI_DEFAULT_WINDOW, + BROTLI_DEFAULT_MODE, + input.size(), + reinterpret_cast(input.c_str()), + &outputsize, + buffer); + if (result != BROTLI_TRUE) { + std::cout << "BrotliEncoderCompress failed\n"; + return EXIT_FAILURE; + } + std::cout << "string went from " << input.size() << " bytes to " << outputsize << " bytes.\n"; + + char buffer2[128]; + size_t reconstructedSize = sizeof(buffer2); + result = BrotliDecoderDecompress( + outputsize, + buffer, + &reconstructedSize, + reinterpret_cast(buffer2)); + if (result != BROTLI_TRUE) { + std::cout << "BrotliDecoderDecompress failed\n"; + return EXIT_FAILURE; + } + if (reconstructedSize != input.size()) { + std::cout << "Size of input (" << input.size() << ") and output (" << reconstructedSize << ") do not match\n"; + return EXIT_FAILURE; + } + if (strncmp(input.c_str(), buffer2, input.size())) { + std::cout << "The original string could not be reconstructed\n"; + return EXIT_FAILURE; + } + std::cout << "String was correctly reconstructed\n"; + std::cout << "Input: \"" << input << "\"\n"; + std::cout << "Output: \"" << buffer2 << "\"\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/brotli/all/test_v1_package/CMakeLists.txt b/recipes/brotli/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c67747eec972a --- /dev/null +++ b/recipes/brotli/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Brotli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Brotli::Brotli) diff --git a/recipes/brotli/all/test_v1_package/conanfile.py b/recipes/brotli/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/brotli/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/brotli/config.yml b/recipes/brotli/config.yml new file mode 100644 index 0000000000000..39d54f0009ed0 --- /dev/null +++ b/recipes/brotli/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.9": + folder: all + "1.0.7": + folder: all diff --git a/recipes/brynet/all/conandata.yml b/recipes/brynet/all/conandata.yml new file mode 100644 index 0000000000000..032ce7485ea1d --- /dev/null +++ b/recipes/brynet/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.12.2": + url: "https://github.com/IronsDu/brynet/archive/v1.12.2.tar.gz" + sha256: "b8b740cae39804d1e7037866046321065856c0ea9f565d26f67aeccc7ccd3d51" + "1.12.1": + url: "https://github.com/IronsDu/brynet/archive/v1.12.1.tar.gz" + sha256: "bcd7ce9b1c3a8dd900f34e50e7ac23013226b3c78b1e22b079d781fbc698122d" + "1.11.1": + url: "https://github.com/IronsDu/brynet/archive/v1.11.1.tar.gz" + sha256: "780f7e1be5e16a202b75661178209a9dd572d07d548a7f30e9bcc7f4a768c61d" + "1.11.0": + url: "https://github.com/IronsDu/brynet/archive/refs/tags/v1.11.0.tar.gz" + sha256: "e446c5616a5353f6d29510d30eaa852c69bda9aecd1f74b8cc9c6ae8f1fd6485" diff --git a/recipes/brynet/all/conanfile.py b/recipes/brynet/all/conanfile.py new file mode 100644 index 0000000000000..e7c1a89c1701b --- /dev/null +++ b/recipes/brynet/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class BrynetConan(ConanFile): + name = "brynet" + description = "Header Only Cross platform high performance TCP network library using C++ 11." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/IronsDu/brynet" + topics = ("networking", "tcp", "websocket") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_openssl": [True, False], + } + default_options = { + "with_openssl": True, + } + + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + + 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 build(self): + pass + + 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.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.with_openssl: + self.cpp_info.defines.append("BRYNET_USE_OPENSSL") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/brynet/all/test_package/CMakeLists.txt b/recipes/brynet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a89c4946c1650 --- /dev/null +++ b/recipes/brynet/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(brynet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE brynet::brynet) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(brynet_VERSION VERSION_GREATER_EQUAL "1.11.2") + target_compile_definitions(${PROJECT_NAME} PRIVATE BRYNET_EVENTLOOP_TCPSERVICE) +endif() diff --git a/recipes/brynet/all/test_package/conanfile.py b/recipes/brynet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/brynet/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/brynet/all/test_package/test_package.cpp b/recipes/brynet/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..abfd618f6e876 --- /dev/null +++ b/recipes/brynet/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +int main() { +#ifdef BRYNET_EVENTLOOP_TCPSERVICE + // brynet >= 1.11.2 provides IOThreadTcpService and EventLoopTcpService instead of TcpService + auto service = brynet::net::IOThreadTcpService::Create(); +#else + auto service = brynet::net::TcpService::Create(); +#endif + return 0; +} diff --git a/recipes/brynet/all/test_v1_package/CMakeLists.txt b/recipes/brynet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/brynet/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/brynet/all/test_v1_package/conanfile.py b/recipes/brynet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/brynet/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/brynet/config.yml b/recipes/brynet/config.yml new file mode 100644 index 0000000000000..dd64cd4c4992b --- /dev/null +++ b/recipes/brynet/config.yml @@ -0,0 +1,9 @@ +versions: + "1.12.2": + folder: all + "1.12.1": + folder: all + "1.11.1": + folder: all + "1.11.0": + folder: all diff --git a/recipes/bshoshany-thread-pool/all/conandata.yml b/recipes/bshoshany-thread-pool/all/conandata.yml new file mode 100644 index 0000000000000..34ca195ae9b51 --- /dev/null +++ b/recipes/bshoshany-thread-pool/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.4.0": + sha256: "b282149693534934d29c3e6eb563a668b04d6abc53ff013bbe608d96741eddb2" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.4.0.tar.gz" + "3.3.0": + sha256: "b76c0103c7ed07c137bd5b1988b9c09da280bbbad37588a096d2954c8d996e0f" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.3.0.tar.gz" + "3.2.0": + sha256: "0604e5978fb65d5b27868892c931902cdd320ca6d623b555141060a715394453" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.2.0.tar.gz" + "3.1.0": + sha256: "c8b70ee63822ee21f25c201806e464100686b1faca5aeabeee96378d2a2c3be8" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.1.0.tar.gz" + "3.0.0": + sha256: "c36052b28b4f28698a6d6f3ad988d7979f6bf6823ebf2af2074714fde15dc19c" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.0.0.tar.gz" diff --git a/recipes/bshoshany-thread-pool/all/conanfile.py b/recipes/bshoshany-thread-pool/all/conanfile.py new file mode 100644 index 0000000000000..ee5a622fcbc1c --- /dev/null +++ b/recipes/bshoshany-thread-pool/all/conanfile.py @@ -0,0 +1,56 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + + +class BShoshanyThreadPoolConan(ConanFile): + description = "BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library" + homepage = "https://github.com/bshoshany/thread-pool" + license = "MIT" + name = "bshoshany-thread-pool" + no_copy_source = True + settings = "arch", "build_type", "compiler", "os" + topics = ("concurrency", "cpp17", "header-only", "library", "multi-threading", "parallel-computing", "thread-pool", "threads") + url = "https://github.com/conan-io/conan-center-index" + + @property + def _minimum_compilers_version(self): + return {"apple-clang": "10", "clang": "5", "gcc": "8", "Visual Studio": "16"} + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package(self): + copy(self, "*.hpp", self.source_folder, os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + + def package_id(self): + self.info.clear() + + def package_info(self): + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] + self.cpp_info.names["cmake_find_package"] = "bshoshany-thread-pool" + self.cpp_info.names["cmake_find_package_multi"] = "bshoshany-thread-pool" + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + try: + if Version(self.settings.compiler.version) < self._minimum_compilers_version[str(self.settings.compiler)]: + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports C++{self._minimum_cpp_standard}. {self.settings.compiler}, {self.settings.compiler.version}") + except KeyError: + self.output.warn("Unknown compiler encountered. Assuming it supports C++17.") diff --git a/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt b/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e58c83ea5f16f --- /dev/null +++ b/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bshoshany-thread-pool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} bshoshany-thread-pool::bshoshany-thread-pool) diff --git a/recipes/bshoshany-thread-pool/all/test_package/conanfile.py b/recipes/bshoshany-thread-pool/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d52de022aa2ac --- /dev/null +++ b/recipes/bshoshany-thread-pool/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "arch", "build_type", "compiler", "os" + 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/bshoshany-thread-pool/all/test_package/test_package.cpp b/recipes/bshoshany-thread-pool/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bbde93d5eba55 --- /dev/null +++ b/recipes/bshoshany-thread-pool/all/test_package/test_package.cpp @@ -0,0 +1,59 @@ +#include "BS_thread_pool.hpp" + +BS::synced_stream sync_out; +BS::thread_pool pool; + +std::condition_variable ID_cv, total_cv; +std::mutex ID_mutex, total_mutex; +BS::concurrency_t count_unique_threads() +{ + const BS::concurrency_t num_tasks = pool.get_thread_count() * 2; + std::vector thread_IDs(num_tasks); + std::unique_lock total_lock(total_mutex); + BS::concurrency_t total_count = 0; + bool ID_release = false; + pool.wait_for_tasks(); + for (std::thread::id& id : thread_IDs) + pool.push_task( + [&total_count, &id, &ID_release] + { + id = std::this_thread::get_id(); + { + const std::scoped_lock total_lock_local(total_mutex); + ++total_count; + } + total_cv.notify_one(); + std::unique_lock ID_lock_local(ID_mutex); + ID_cv.wait(ID_lock_local, [&ID_release] { return ID_release; }); + }); + total_cv.wait(total_lock, [&total_count] { return total_count == pool.get_thread_count(); }); + { + const std::scoped_lock ID_lock(ID_mutex); + ID_release = true; + } + ID_cv.notify_all(); + total_cv.wait(total_lock, [&total_count, &num_tasks] { return total_count == num_tasks; }); + pool.wait_for_tasks(); + std::sort(thread_IDs.begin(), thread_IDs.end()); + return static_cast(std::unique(thread_IDs.begin(), thread_IDs.end()) - thread_IDs.begin()); +} + +int main() +{ + const char* line = "------------------------------------------"; + sync_out.println(line); + sync_out.println("Testing thread pool..."); + BS::concurrency_t unique_threads = count_unique_threads(); + if (pool.get_thread_count() == unique_threads) + { + sync_out.println("SUCCESS: Created ", unique_threads, " unique threads!"); + sync_out.println(line); + return EXIT_SUCCESS; + } + else + { + sync_out.println("ERROR: Failed to create ", unique_threads, " unique threads!"); + sync_out.println(line); + return EXIT_FAILURE; + } +} diff --git a/recipes/bshoshany-thread-pool/config.yml b/recipes/bshoshany-thread-pool/config.yml new file mode 100644 index 0000000000000..1bf5f1f671b5c --- /dev/null +++ b/recipes/bshoshany-thread-pool/config.yml @@ -0,0 +1,11 @@ +versions: + "3.4.0": + folder: all + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all diff --git a/recipes/btyacc/all/CMakeLists.txt b/recipes/btyacc/all/CMakeLists.txt new file mode 100644 index 0000000000000..b598faf845d1a --- /dev/null +++ b/recipes/btyacc/all/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.2) + +project(btyacc_wrapper C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/btyacc/all/conandata.yml b/recipes/btyacc/all/conandata.yml new file mode 100644 index 0000000000000..f0142fff4add4 --- /dev/null +++ b/recipes/btyacc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0": + sha256: "ce89b9121895aa29e9fd609f23eb8e0727912745a4d41aa7ad42984ef83f05c7" + url: https://github.com/ChrisDodd/btyacc/archive/0256b69f36f01877f1f4e76f80a5f561beabcfef.zip diff --git a/recipes/btyacc/all/conanfile.py b/recipes/btyacc/all/conanfile.py new file mode 100644 index 0000000000000..392605b08cf53 --- /dev/null +++ b/recipes/btyacc/all/conanfile.py @@ -0,0 +1,80 @@ +import functools +import os +import textwrap + +from conans import CMake, ConanFile, tools + +required_conan_version = ">=1.43.0" + + +class BtyaccConan(ConanFile): + name = "btyacc" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ChrisDodd/btyacc" + description = "Backtracking yacc" + topics = "yacc", "parser" + license = "Unlicense" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + generators = "cmake" + exports_sources = "CMakeLists.txt" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + root = self._source_subfolder + get_args = self.conan_data["sources"][self.version] + tools.get(**get_args, destination=root, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + self._configure_cmake().build() + + @property + def _variables(self): + return os.path.join("bin", "conan-official-btyacc-variables.cmake") + + def package(self): + self.copy("README", "licenses", self._source_subfolder) + self.copy("README.BYACC", "licenses", self._source_subfolder) + self._configure_cmake().install() + tools.rmdir(os.path.join(self.package_folder, "share")) + variables = os.path.join(self.package_folder, self._variables) + content = textwrap.dedent("""\ + set(BTYACC_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/btyacc") + if(NOT EXISTS "${BTYACC_EXECUTABLE}") + set(BTYACC_EXECUTABLE "${BTYACC_EXECUTABLE}.exe") + endif() + """) + tools.save(variables, content) + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) + self.cpp_info.build_modules["cmake"] = [self._variables] + self.cpp_info.build_modules["cmake_find_package"] = [self._variables] + self.cpp_info.build_modules["cmake_find_package_multi"] = \ + [self._variables] + self.cpp_info.builddirs = ["bin"] diff --git a/recipes/btyacc/all/test_package/CMakeLists.txt b/recipes/btyacc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..80f7ff14861ac --- /dev/null +++ b/recipes/btyacc/all/test_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +find_package(btyacc REQUIRED CONFIG) +if(NOT DEFINED BTYACC_EXECUTABLE) + message(FATAL_ERROR "BTYACC_EXECUTABLE is not defined") +endif() + +set(bin "${PROJECT_BINARY_DIR}") +add_custom_command( + OUTPUT main.c + COMMAND "${BTYACC_EXECUTABLE}" -b y "${PROJECT_SOURCE_DIR}/test.y" + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${bin}/y.tab.c" "${bin}/main.c" + COMMAND "${CMAKE_COMMAND}" -E remove "${bin}/y.tab.c" + MAIN_DEPENDENCY test.y + WORKING_DIRECTORY "${bin}" + COMMENT "Generating main.c" + VERBATIM +) + +add_executable(test_package "${bin}/main.c") + +enable_testing() +add_test( + NAME main + COMMAND "${CMAKE_COMMAND}" -E echo "(())()(())" | test_package +) diff --git a/recipes/btyacc/all/test_package/conanfile.py b/recipes/btyacc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..84bba6ad911d3 --- /dev/null +++ b/recipes/btyacc/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +import functools +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + if not tools.cross_building(self): + self._configure_cmake().build() + + def test(self): + if not tools.cross_building(self): + self._configure_cmake().test() diff --git a/recipes/btyacc/all/test_package/test.y b/recipes/btyacc/all/test_package/test.y new file mode 100644 index 0000000000000..57215a5ad5dde --- /dev/null +++ b/recipes/btyacc/all/test_package/test.y @@ -0,0 +1,43 @@ +%{ +/* first section */ +%} +/* + * [test] btyacc + * [test] cc + * [test] input (())()(()) + * [test] input-fail (())(*)(()) + * [test] btyacc -DABC + * [test] cc + * [test] input (())(*)(()) + */ +%% +%{ +/* second section */ +%} +S : /* empty */ { printf("S -> epsilon\n"); } + | '(' S ')' S { printf("S -> ( S ) S\n"); } +%ifdef ABC + /* see how preprocessor can be used */ + | '*' { printf("S -> *\n"); } +%endif + ; +%% +#include + +int main() { + int rv; + printf("yyparse() = %d\n", (rv=yyparse())); + return rv; +} + +yylex() { + int ch; + + do { ch = getchar(); } while (ch == ' ' || ch == '\n' || ch == '\t'); + if (ch == EOF) return 0; + return ch; +} + +void yyerror(const char *s, ...) { + printf("%s\n",s); +} diff --git a/recipes/btyacc/config.yml b/recipes/btyacc/config.yml new file mode 100644 index 0000000000000..fdd08f532337f --- /dev/null +++ b/recipes/btyacc/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0": + folder: all diff --git a/recipes/bullet3/all/conandata.yml b/recipes/bullet3/all/conandata.yml new file mode 100644 index 0000000000000..d8a0753661706 --- /dev/null +++ b/recipes/bullet3/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "3.25": + url: "https://github.com/bulletphysics/bullet3/archive/refs/tags/3.25.tar.gz" + sha256: "c45afb6399e3f68036ddb641c6bf6f552bf332d5ab6be62f7e6c54eda05ceb77" + "3.24": + url: "https://github.com/bulletphysics/bullet3/archive/refs/tags/3.24.tar.gz" + sha256: "6b1e987d6f8156fa8a6468652f4eaad17b3e11252c9870359e5bca693e35780b" + "3.22a": + url: "https://github.com/bulletphysics/bullet3/archive/refs/tags/3.22a.tar.gz" + sha256: "c40a0e832751c1590474cf21679972d2938e0705a45c29fed846ddb523d82b03" + "3.21": + url: "https://github.com/bulletphysics/bullet3/archive/3.21.tar.gz" + sha256: "49d1ee47aa8cbb0bc6bb459f0a4cfb9579b40e28f5c7d9a36c313e3031fb3965" + "3.17": + url: "https://github.com/bulletphysics/bullet3/archive/3.17.tar.gz" + sha256: "baa642c906576d4d98d041d0acb80d85dd6eff6e3c16a009b1abf1ccd2bc0a61" + "3.09": + url: "https://github.com/bulletphysics/bullet3/archive/3.09.tar.gz" + sha256: "f2feef9322329c0571d9066fede2db0ede92b19f7f7fdf54def3b4651f02af03" + "3.08": + url: "https://github.com/bulletphysics/bullet3/archive/3.08.tar.gz" + sha256: "05826c104b842bcdd1339b86894cb44c84ac2525ac296689d34b38a14bbba0dd" + "3.07": + url: "https://github.com/bulletphysics/bullet3/archive/3.07.tar.gz" + sha256: "068ecf8acbf256d3976eebee75d7d6f5af16c049f10f6b2d8ba28bb638bef3b0" + "3.06": + url: "https://github.com/bulletphysics/bullet3/archive/3.06.tar.gz" + sha256: "217c1d198ee00be7e40d4cb4d79882e37ef4a06cbfbe11f5fbc207c347a57020" + "2.89": + url: "https://github.com/bulletphysics/bullet3/archive/2.89.tar.gz" + sha256: "621b36e91c0371933f3c2156db22c083383164881d2a6b84636759dc4cbb0bb8" diff --git a/recipes/bullet3/all/conanfile.py b/recipes/bullet3/all/conanfile.py new file mode 100644 index 0000000000000..7924535e0be65 --- /dev/null +++ b/recipes/bullet3/all/conanfile.py @@ -0,0 +1,198 @@ +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, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import glob +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class Bullet3Conan(ConanFile): + name = "bullet3" + description = ( + "Bullet Physics SDK: real-time collision detection and multi-physics " + "simulation for VR, games, visual effects, robotics, machine learning etc." + ) + homepage = "https://github.com/bulletphysics/bullet3" + topics = ("bullet", "physics", "simulation", "robotics", "kinematics", "engine") + license = "ZLIB" + 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], + "bullet3": [True, False], + "graphical_benchmark": [True, False], + "double_precision": [True, False], + "bt2_thread_locks": [True, False], + "soft_body_multi_body_dynamics_world": [True, False], + "network_support": [True, False], + "extras": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "bullet3": True, + "graphical_benchmark": False, + "double_precision": False, + "bt2_thread_locks": False, + "soft_body_multi_body_dynamics_world": False, + "network_support": False, + "extras": False, + } + + short_paths = True + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("Shared libraries on Visual Studio not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BULLET3"] = self.options.bullet3 + tc.variables["INSTALL_LIBS"] = True + tc.variables["USE_GRAPHICAL_BENCHMARK"] = self.options.graphical_benchmark + tc.variables["USE_DOUBLE_PRECISION"] = self.options.double_precision + tc.variables["BULLET2_MULTITHREADING"] = self.options.bt2_thread_locks + tc.variables["USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD"] = self.options.soft_body_multi_body_dynamics_world + tc.variables["BUILD_ENET"] = self.options.network_support + tc.variables["BUILD_CLSOCKET"] = self.options.network_support + tc.variables["BUILD_CPU_DEMOS"] = False + tc.variables["BUILD_OPENGL3_DEMOS"] = False + tc.variables["BUILD_BULLET2_DEMOS"] = False + tc.variables["BUILD_EXTRAS"] = self.options.extras + tc.variables["BUILD_UNIT_TESTS"] = False + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + if Version(self.version) < "3.21": + # silence warning + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0115"] = "OLD" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + for cmake_file in glob.glob(os.path.join(self.package_folder, self._module_subfolder, "*.cmake")): + if os.path.basename(cmake_file) != "UseBullet.cmake": + os.remove(cmake_file) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(BULLET_FOUND 1) + set(BULLET_USE_FILE "lib/cmake/bullet/UseBullet.cmake") + set(BULLET_DEFINITIONS {" ".join(self._bullet_definitions)}) + set(BULLET_INCLUDE_DIR ${{Bullet_INCLUDE_DIR}} + ${{Bullet_INCLUDE_DIR_RELEASE}} + ${{Bullet_INCLUDE_DIR_RELWITHDEBINFO}} + ${{Bullet_INCLUDE_DIR_MINSIZEREL}} + ${{Bullet_INCLUDE_DIR_DEBUG}}) + set(BULLET_INCLUDE_DIRS ${{BULLET_INCLUDE_DIR}}) + set(BULLET_LIBRARIES Bullet::Bullet) + set(BULLET_LIBRARY_DIRS ${{Bullet_LIB_DIRS}} + ${{Bullet_LIB_DIRS_RELEASE}} + ${{Bullet_LIB_DIRS_RELWITHDEBINFO}} + ${{Bullet_LIB_DIRS_MINSIZEREL}} + ${{Bullet_LIB_DIRS_DEBUG}}) + set(BULLET_ROOT_DIR "${{CMAKE_CURRENT_LIST_DIR}}/../../..") + set(BULLET_VERSION_STRING {self.version}) + """) + save(self, module_file, content) + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake", "bullet") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + f"conan-official-{self.name}-variables.cmake") + + @property + def _bullet_definitions(self): + defines = [] + if self.options.double_precision: + defines.append("BT_USE_DOUBLE_PRECISION") + return defines + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Bullet") + self.cpp_info.set_property("cmake_target_name", "Bullet::Bullet") # not official + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "bullet") + libs = [] + if self.options.bullet3: + libs.extend([ + "Bullet3OpenCL_clew", # depends on LinearMath Bullet3Dynamics (and libdl on Linux) + "Bullet3Dynamics", # depends on Bullet3Collision + "Bullet3Collision", # depends on Bullet3Geometry + "Bullet3Geometry", + "Bullet2FileLoader", # depends on Bullet3Common + ]) + if self.options.extras: + libs.extend([ + "BulletRobotics", # depends on BulletInverseDynamicsUtils BulletWorldImporter BulletFileLoader BulletSoftBody BulletDynamics BulletCollision BulletInverseDynamics LinearMath Bullet3Common + "BulletInverseDynamicsUtils", # depends on BulletInverseDynamics BulletDynamics BulletCollision Bullet3Common LinearMath + "BulletXmlWorldImporter", # depends on BulletWorldImporter BulletDynamics BulletCollision BulletFileLoader LinearMath + "BulletWorldImporter", # depends on BulletDynamics BulletCollision BulletFileLoader LinearMath + "BulletFileLoader", # depends on LinearMath + "GIMPACTUtils", # depends on ConvexDecomposition BulletCollision + "ConvexDecomposition", # depends on BulletCollision LinearMath + "HACD", + ]) + libs.extend([ + "BulletSoftBody", # depends on BulletDynamics + "BulletDynamics", # depends on BulletCollision & LinearMath + "BulletCollision", # depends on LinearMath + "BulletInverseDynamics", # depends on Bullet3Common & LinearMath + "LinearMath", + "Bullet3Common", + ]) + if self.settings.os == "Windows" and self.settings.build_type in ("Debug", "MinSizeRel", "RelWithDebInfo"): + lib_suffix = "RelWithDebugInfo" if self.settings.build_type == "RelWithDebInfo" else self.settings.build_type + libs = [f"{lib}_{lib_suffix}" for lib in libs] + + self.cpp_info.libs = libs + self.cpp_info.includedirs = ["include", os.path.join("include", "bullet")] + if self.options.extras: + self.cpp_info.includedirs.append(os.path.join("include", "bullet_robotics")) + self.cpp_info.defines = self._bullet_definitions + if self.options.bt2_thread_locks and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Bullet" + self.cpp_info.names["cmake_find_package_multi"] = "Bullet" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "bullet" diff --git a/recipes/bullet3/all/test_package/CMakeLists.txt b/recipes/bullet3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..35fb321995112 --- /dev/null +++ b/recipes/bullet3/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(Bullet REQUIRED CONFIG) +include(${BULLET_ROOT_DIR}/${BULLET_USE_FILE}) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${BULLET_LIBRARIES}) diff --git a/recipes/bullet3/all/test_package/conanfile.py b/recipes/bullet3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/bullet3/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/bullet3/all/test_package/test_package.cpp b/recipes/bullet3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..95092c6eab025 --- /dev/null +++ b/recipes/bullet3/all/test_package/test_package.cpp @@ -0,0 +1,177 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2007 Erwin Coumans http://continuousphysics.com/Bullet/ +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +///-----includes_start----- +#include +#include + +/// This is a Hello World program for running a basic Bullet physics simulation + +int main(int argc, char **argv) +{ + ///-----includes_end----- + + int i; + ///-----initialization_start----- + + ///collision configuration contains default setup for memory, collision setup. Advanced users can create their own configuration. + btDefaultCollisionConfiguration *collisionConfiguration = new btDefaultCollisionConfiguration(); + + ///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded) + btCollisionDispatcher *dispatcher = new btCollisionDispatcher(collisionConfiguration); + + ///btDbvtBroadphase is a good general purpose broadphase. You can also try out btAxis3Sweep. + btBroadphaseInterface *overlappingPairCache = new btDbvtBroadphase(); + + ///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded) + btSequentialImpulseConstraintSolver *solver = new btSequentialImpulseConstraintSolver; + + btDiscreteDynamicsWorld *dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfiguration); + + dynamicsWorld->setGravity(btVector3(0, -10, 0)); + + ///-----initialization_end----- + + //keep track of the shapes, we release memory at exit. + //make sure to re-use collision shapes among rigid bodies whenever possible! + btAlignedObjectArray collisionShapes; + + ///create a few basic rigid bodies + + //the ground is a cube of side 100 at position y = -56. + //the sphere will hit it at y = -6, with center at -5 + { + btCollisionShape *groundShape = new btBoxShape(btVector3(btScalar(50.), btScalar(50.), btScalar(50.))); + + collisionShapes.push_back(groundShape); + + btTransform groundTransform; + groundTransform.setIdentity(); + groundTransform.setOrigin(btVector3(0, -56, 0)); + + btScalar mass(0.); + + //rigidbody is dynamic if and only if mass is non zero, otherwise static + bool isDynamic = (mass != 0.f); + + btVector3 localInertia(0, 0, 0); + if (isDynamic) + groundShape->calculateLocalInertia(mass, localInertia); + + //using motionstate is optional, it provides interpolation capabilities, and only synchronizes 'active' objects + btDefaultMotionState *myMotionState = new btDefaultMotionState(groundTransform); + btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, groundShape, localInertia); + btRigidBody *body = new btRigidBody(rbInfo); + + //add the body to the dynamics world + dynamicsWorld->addRigidBody(body); + } + + { + //create a dynamic rigidbody + + //btCollisionShape* colShape = new btBoxShape(btVector3(1,1,1)); + btCollisionShape *colShape = new btSphereShape(btScalar(1.)); + collisionShapes.push_back(colShape); + + /// Create Dynamic Objects + btTransform startTransform; + startTransform.setIdentity(); + + btScalar mass(1.f); + + //rigidbody is dynamic if and only if mass is non zero, otherwise static + bool isDynamic = (mass != 0.f); + + btVector3 localInertia(0, 0, 0); + if (isDynamic) + colShape->calculateLocalInertia(mass, localInertia); + + startTransform.setOrigin(btVector3(2, 10, 0)); + + //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects + btDefaultMotionState *myMotionState = new btDefaultMotionState(startTransform); + btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, colShape, localInertia); + btRigidBody *body = new btRigidBody(rbInfo); + + dynamicsWorld->addRigidBody(body); + } + + /// Do some simulation + + ///-----stepsimulation_start----- + for (i = 0; i < 150; i++) + { + dynamicsWorld->stepSimulation(1.f / 60.f, 10); + + //print positions of all objects + for (int j = dynamicsWorld->getNumCollisionObjects() - 1; j >= 0; j--) + { + btCollisionObject *obj = dynamicsWorld->getCollisionObjectArray()[j]; + btRigidBody *body = btRigidBody::upcast(obj); + btTransform trans; + if (body && body->getMotionState()) + { + body->getMotionState()->getWorldTransform(trans); + } + else + { + trans = obj->getWorldTransform(); + } + } + } + + ///-----stepsimulation_end----- + + //cleanup in the reverse order of creation/initialization + + ///-----cleanup_start----- + + //remove the rigidbodies from the dynamics world and delete them + for (i = dynamicsWorld->getNumCollisionObjects() - 1; i >= 0; i--) + { + btCollisionObject *obj = dynamicsWorld->getCollisionObjectArray()[i]; + btRigidBody *body = btRigidBody::upcast(obj); + if (body && body->getMotionState()) + { + delete body->getMotionState(); + } + dynamicsWorld->removeCollisionObject(obj); + delete obj; + } + + //delete collision shapes + for (int j = 0; j < collisionShapes.size(); j++) + { + btCollisionShape *shape = collisionShapes[j]; + collisionShapes[j] = 0; + delete shape; + } + + //delete dynamics world + delete dynamicsWorld; + + //delete solver + delete solver; + + //delete broadphase + delete overlappingPairCache; + + //delete dispatcher + delete dispatcher; + + delete collisionConfiguration; + + //next line is optional: it will be cleared by the destructor when the array goes out of scope + collisionShapes.clear(); +} diff --git a/recipes/bullet3/all/test_v1_package/CMakeLists.txt b/recipes/bullet3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bullet3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bullet3/all/test_v1_package/conanfile.py b/recipes/bullet3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bullet3/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/bullet3/config.yml b/recipes/bullet3/config.yml new file mode 100644 index 0000000000000..dca6debe05137 --- /dev/null +++ b/recipes/bullet3/config.yml @@ -0,0 +1,21 @@ +versions: + "3.25": + folder: all + "3.24": + folder: all + "3.22a": + folder: all + "3.21": + folder: all + "3.17": + folder: all + "3.09": + folder: all + "3.08": + folder: all + "3.07": + folder: all + "3.06": + folder: all + "2.89": + folder: all diff --git a/recipes/butteraugli/all/CMakeLists.txt b/recipes/butteraugli/all/CMakeLists.txt new file mode 100644 index 0000000000000..d92428ae1ee9a --- /dev/null +++ b/recipes/butteraugli/all/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.8) +project(butteraugli LANGUAGES CXX) + +option(BUTTERAUGLI_TOOL "Build comparison tool" ON) + +add_library(butteraugli_lib ${BUTTERAUGLI_SRC_DIR}/butteraugli/butteraugli.cc) +target_include_directories(butteraugli_lib PUBLIC ${BUTTERAUGLI_SRC_DIR}) +set_target_properties(butteraugli_lib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_compile_features(butteraugli_lib PUBLIC cxx_std_11) + +install( + TARGETS butteraugli_lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install( + FILES ${BUTTERAUGLI_SRC_DIR}/butteraugli/butteraugli.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/butteraugli +) + +if(BUTTERAUGLI_TOOL) + find_package(JPEG REQUIRED) + find_package(PNG REQUIRED) + + add_executable(butteraugli ${BUTTERAUGLI_SRC_DIR}/butteraugli/butteraugli_main.cc) + target_link_libraries(butteraugli PRIVATE butteraugli_lib JPEG::JPEG PNG::PNG) + target_compile_features(butteraugli PRIVATE cxx_std_11) + + install(TARGETS butteraugli DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/butteraugli/all/conandata.yml b/recipes/butteraugli/all/conandata.yml new file mode 100644 index 0000000000000..bcd4f7dd9d272 --- /dev/null +++ b/recipes/butteraugli/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20190319": + url: "https://github.com/google/butteraugli/archive/71b18b636b9c7d1ae0c1d3730b85b3c127eb4511.tar.gz" + sha256: "f5ca65335c69689d74a52c6e1338256587326d4326c257aa46e659cb4986e9ca" +patches: + "cci.20190319": + - patch_file: "patches/0001-compilation-fixes-for-vs2015.patch" diff --git a/recipes/butteraugli/all/conanfile.py b/recipes/butteraugli/all/conanfile.py new file mode 100644 index 0000000000000..35cd9c65cf914 --- /dev/null +++ b/recipes/butteraugli/all/conanfile.py @@ -0,0 +1,84 @@ +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.53.0" + + +class ButteraugliConan(ConanFile): + name = "butteraugli" + description = "A tool for measuring perceived differences between images" + license = "Apache-2.0" + topics = ("image", "diff") + homepage = "https://github.com/google/butteraugli" + 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], + "tool": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tool": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.tool: + self.requires("libpng/1.6.39") + self.requires("libjpeg/9e") + + 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["BUTTERAUGLI_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BUTTERAUGLI_TOOL"] = self.options.tool + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["butteraugli_lib"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + if self.options.tool: + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/butteraugli/all/patches/0001-compilation-fixes-for-vs2015.patch b/recipes/butteraugli/all/patches/0001-compilation-fixes-for-vs2015.patch new file mode 100644 index 0000000000000..b4292adb67a30 --- /dev/null +++ b/recipes/butteraugli/all/patches/0001-compilation-fixes-for-vs2015.patch @@ -0,0 +1,59 @@ +--- butteraugli/butteraugli.cc ++++ butteraugli/butteraugli.cc +@@ -107,7 +107,7 @@ static inline void CheckImage(const ImageF &image, const char *name) { + const float * const BUTTERAUGLI_RESTRICT row = image.Row(y); + for (size_t x = 0; x < image.xsize(); ++x) { + if (IsNan(row[x])) { +- printf("Image %s @ %lu,%lu (of %lu,%lu)\n", name, x, y, image.xsize(), ++ printf("Image %s @ %zu,%zu (of %zu,%zu)\n", name, x, y, image.xsize(), + image.ysize()); + exit(1); + } +--- butteraugli/butteraugli.h ++++ butteraugli/butteraugli.h +@@ -216,7 +216,7 @@ class Image { + public: + using T = ComponentType; + +- Image() : xsize_(0), ysize_(0), bytes_per_row_(0), bytes_(nullptr, Ignore) {} ++ Image() : xsize_(0), ysize_(0), bytes_per_row_(0), bytes_(static_cast(nullptr), Ignore) {} + + Image(const size_t xsize, const size_t ysize) + : xsize_(xsize), +--- butteraugli/butteraugli_main.cc ++++ butteraugli/butteraugli_main.cc +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include "butteraugli/butteraugli.h" + + extern "C" { +@@ -378,7 +379,7 @@ int Run(int argc, char* argv[]) { + // Adding a missing alpha channel to one of the images. + rgb2.push_back(Image8(rgb2[0].xsize(), rgb2[0].ysize(), 255)); + } else if (rgb1.size() != rgb2.size()) { +- fprintf(stderr, "Different number of channels: %lu vs %lu\n", rgb1.size(), ++ fprintf(stderr, "Different number of channels: %zu vs %zu\n", rgb1.size(), + rgb2.size()); + exit(1); + } +@@ -387,7 +388,7 @@ int Run(int argc, char* argv[]) { + if (rgb1[c].xsize() != rgb2[c].xsize() || + rgb1[c].ysize() != rgb2[c].ysize()) { + fprintf( +- stderr, "The images are not equal in size: (%lu,%lu) vs (%lu,%lu)\n", ++ stderr, "The images are not equal in size: (%zu,%zu) vs (%zu,%zu)\n", + rgb1[c].xsize(), rgb2[c].xsize(), rgb1[c].ysize(), rgb2[c].ysize()); + return 1; + } +@@ -439,7 +440,7 @@ int Run(int argc, char* argv[]) { + return 1; + } + bool ok = true; +- if (fprintf(fmap, "P6\n%lu %lu\n255\n", ++ if (fprintf(fmap, "P6\n%zu %zu\n255\n", + rgb1[0].xsize(), rgb1[0].ysize()) < 0){ + perror("fprintf"); + ok = false; diff --git a/recipes/butteraugli/all/test_package/CMakeLists.txt b/recipes/butteraugli/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7f874ff8ee8e1 --- /dev/null +++ b/recipes/butteraugli/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(butteraugli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE butteraugli::butteraugli) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/butteraugli/all/test_package/conanfile.py b/recipes/butteraugli/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/butteraugli/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/butteraugli/all/test_package/test_package.cpp b/recipes/butteraugli/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..02ab22e0ddae9 --- /dev/null +++ b/recipes/butteraugli/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "butteraugli/butteraugli.h" + +int main() +{ + butteraugli::ButteraugliFuzzyClass(1.0f); + return 0; +} diff --git a/recipes/butteraugli/all/test_v1_package/CMakeLists.txt b/recipes/butteraugli/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/butteraugli/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/butteraugli/all/test_v1_package/conanfile.py b/recipes/butteraugli/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/butteraugli/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/butteraugli/config.yml b/recipes/butteraugli/config.yml new file mode 100644 index 0000000000000..22f42b88af597 --- /dev/null +++ b/recipes/butteraugli/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190319": + folder: all diff --git a/recipes/bvdberg-ctest/all/conandata.yml b/recipes/bvdberg-ctest/all/conandata.yml new file mode 100644 index 0000000000000..c756f17b12c18 --- /dev/null +++ b/recipes/bvdberg-ctest/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + sha256: 80c5899f529dc57c1eb44113fe452cd90fd69cd1ab3a0431635282f56837205c + url: https://github.com/bvdberg/ctest/archive/1.0.0.tar.gz diff --git a/recipes/bvdberg-ctest/all/conanfile.py b/recipes/bvdberg-ctest/all/conanfile.py new file mode 100644 index 0000000000000..ac8c63a98f38c --- /dev/null +++ b/recipes/bvdberg-ctest/all/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class BvdbergCtestConan(ConanFile): + name = "bvdberg-ctest" + 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") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows not supported") + + 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 + + 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt b/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..85fca601d8ec2 --- /dev/null +++ b/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(bvdberg-ctest REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE bvdberg-ctest::bvdberg-ctest) diff --git a/recipes/bvdberg-ctest/all/test_package/conanfile.py b/recipes/bvdberg-ctest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/bvdberg-ctest/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/bvdberg-ctest/all/test_package/test_package.c b/recipes/bvdberg-ctest/all/test_package/test_package.c new file mode 100644 index 0000000000000..9dbb89c050698 --- /dev/null +++ b/recipes/bvdberg-ctest/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include + +#define CTEST_MAIN + +#include "ctest.h" + +int main(int argc, const char *argv[]) +{ + int result = ctest_main(argc, argv); + + if (result == 0) + { + printf("\nNOTE: all tests passed, it works! ;)\n"); + } + + return result; +} + +CTEST(suite1, test2) +{ + ASSERT_EQUAL(1, 1); +} diff --git a/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt b/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd0d83ce8ad41 --- /dev/null +++ b/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(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 new file mode 100644 index 0000000000000..f2243371b7f1d --- /dev/null +++ b/recipes/bvdberg-ctest/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") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/bvdberg-ctest/config.yml b/recipes/bvdberg-ctest/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/bvdberg-ctest/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/bx/all/conandata.yml b/recipes/bx/all/conandata.yml new file mode 100644 index 0000000000000..f4ae1ed020baa --- /dev/null +++ b/recipes/bx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221116": + url: "https://github.com/bkaradzic/bx/archive/aed1086c48884b1b4f1c2f9af34c5198624263f6.tar.gz" + sha256: "6867CF7ABD2BB53A1A92C7B70CBC7F424B97D3AE3A8183F284C6A6507EFE4517" diff --git a/recipes/bx/all/conanfile.py b/recipes/bx/all/conanfile.py new file mode 100644 index 0000000000000..c1e1bfa91952f --- /dev/null +++ b/recipes/bx/all/conanfile.py @@ -0,0 +1,247 @@ +from conan import ConanFile +from conan.tools.files import copy, get, rename +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs, is_msvc_static_runtime +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import MSBuild, VCVars +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualBuildEnv +from pathlib import Path +import os + +required_conan_version = ">=1.50.0" + + +class bxConan(ConanFile): + name = "bx" + license = "BSD-2-Clause" + homepage = "https://github.com/bkaradzic/bx" + url = "https://github.com/conan-io/conan-center-index" + description = "Base library providing utility functions and macros." + topics = ("general", "utility") + settings = "os", "compiler", "arch", "build_type" + options = {"fPIC": [True, False], "tools": [True, False]} + default_options = {"fPIC": True, "tools": False} + + @property + def _bx_folder(self): + return "bx" + + @property + def _bx_path(self): + return os.path.join(self.source_folder, self._bx_folder) + + @property + def _genie_extra(self): + genie_extra = "" + if is_msvc(self) and not is_msvc_static_runtime(self): + genie_extra += " --with-dynamic-runtime" + return genie_extra + + @property + def _projs(self): + projs = ["bx"] + if self.options.tools: + projs.extend(["bin2c", "lemon"]) + return projs + + @property + def _compiler_required(self): + return { + "gcc": "8", + "clang": "3.3", + "apple-clang": "5", + } + + @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 layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if not self.options.get_safe("fPIC", True): + raise ConanInvalidConfiguration("This package does not support builds without fPIC.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + check_min_vs(self, 191) + if not is_msvc(self): + try: + minimum_required_compiler_version = self._compiler_required[str(self.settings.compiler)] + if Version(self.settings.compiler.version) < minimum_required_compiler_version: + raise ConanInvalidConfiguration("This package requires C++14 support. The current compiler does not support it.") + except KeyError: + self.output.warn("This recipe has no checking for the current compiler. Please consider adding it.") + + def build_requirements(self): + self.tool_requires("genie/1170") + if not is_msvc(self) and 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, + destination=os.path.join(self.source_folder, self._bx_folder)) + + def generate(self): + vbe = VirtualBuildEnv(self) + vbe.generate() + if is_msvc(self): + tc = VCVars(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if is_msvc(self): + # Conan to Genie translation maps + vs_ver_to_genie = {"17": "2022", "16": "2019", "15": "2017", + "193": "2022", "192": "2019", "191": "2017"} + + # Use genie directly, then msbuild on specific projects based on requirements + genie_VS = f"vs{vs_ver_to_genie[str(self.settings.compiler.version)]}" + genie_gen = f"{self._genie_extra} {genie_VS}" + self.run(f"genie {genie_gen}", cwd=self._bx_path) + + msbuild = MSBuild(self) + # customize to Release when RelWithDebInfo + msbuild.build_type = "Debug" if self.settings.build_type == "Debug" else "Release" + # use Win32 instead of the default value when building x86 + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(self._bx_path, ".build", "projects", genie_VS, "bx.sln"), targets=self._projs) + else: + # Not sure if XCode can be spefically handled by conan for building through, so assume everything not VS is make + # gcc-multilib and g++-multilib required for 32bit cross-compilation, should see if we can check and install through conan + + # Conan to Genie translation maps + compiler_str = str(self.settings.compiler) + compiler_and_os_to_genie = {"Windows": f"--gcc=mingw-{compiler_str}", "Linux": f"--gcc=linux-{compiler_str}", + "FreeBSD": "--gcc=freebsd", "Macos": "--gcc=osx", + "Android": "--gcc=android", "iOS": "--gcc=ios"} + gmake_os_to_proj = {"Windows": "mingw", "Linux": "linux", "FreeBSD": "freebsd", "Macos": "osx", "Android": "android", "iOS": "ios"} + gmake_arch_to_genie_suffix = {"x86": "-x86", "x86_64": "-x64", "armv8": "-arm64", "armv7": "-arm"} + os_to_use_arch_config_suffix = {"Windows": False, "Linux": False, "FreeBSD": False, "Macos": True, "Android": True, "iOS": True} + + build_type_to_make_config = {"Debug": "config=debug", "Release": "config=release"} + arch_to_make_config_suffix = {"x86": "32", "x86_64": "64"} + os_to_use_make_config_suffix = {"Windows": True, "Linux": True, "FreeBSD": True, "Macos": False, "Android": False, "iOS": False} + + # Generate projects through genie + genieGen = f"{self._genie_extra} {compiler_and_os_to_genie[str(self.settings.os)]}" + if os_to_use_arch_config_suffix[str(self.settings.os)]: + genieGen += f"{gmake_arch_to_genie_suffix[str(self.settings.arch)]}" + genieGen += " gmake" + self.run(f"genie {genieGen}", cwd=self._bx_path) + + # Build project folder and path from given settings + projFolder = f"gmake-{gmake_os_to_proj[str(self.settings.os)]}" + if self.settings.os == "Windows" or compiler_str not in ["gcc", "apple-clang"]: + projFolder += f"-{compiler_str}" #mingw-gcc or mingw-clang for windows; -clang for linux (where gcc on linux has no extra) + if os_to_use_arch_config_suffix[str(self.settings.os)]: + projFolder += gmake_arch_to_genie_suffix[str(self.settings.arch)] + proj_path = os.path.sep.join([self._bx_path, ".build", "projects", projFolder]) + + # Build make args from settings + conf = build_type_to_make_config[str(self.settings.build_type)] + if os_to_use_make_config_suffix[str(self.settings.os)]: + conf += arch_to_make_config_suffix[str(self.settings.arch)] + if self.settings.os == "Windows": + mingw = "MINGW=$MINGW_PREFIX" + proj_path = proj_path.replace("\\", "/") # Fix path for msys... + else: + mingw = "" + autotools = Autotools(self) + # Build with make + for proj in self._projs: + autotools.make(target=proj, args=["-R", f"-C {proj_path}", mingw, conf]) + + def package(self): + # Set platform suffixes and prefixes + if self.settings.os == "Windows": + lib_ext = "*.lib" + package_lib_prefix = "" + elif self.settings.os in ["Linux", "FreeBSD"]: + lib_ext = "*.a" + package_lib_prefix = "lib" + elif self.settings.os == "Macos": + lib_ext = "*.a" + package_lib_prefix = "lib" + + # Get build bin folder + for bx_out_dir in os.listdir(os.path.join(self._bx_path, ".build")): + if not bx_out_dir=="projects": + build_bin = os.path.join(self._bx_path, ".build", bx_out_dir, "bin") + break + + # Copy license + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._bx_path) + # Copy includes + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._bx_path, "include")) + copy(self, pattern="*.inl", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._bx_path, "include")) + # Copy libs + copy(self, pattern=lib_ext, dst=os.path.join(self.package_folder, "lib"), src=build_bin, keep_path=False) + # Copy tools + if self.options.tools: + copy(self, pattern="bin2c*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + copy(self, pattern="lemon*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + + # Rename for consistency across platforms and configs + for bx_file in Path(os.path.join(self.package_folder, "lib")).glob("*bx*"): + rename(self, os.path.join(self.package_folder, "lib", bx_file.name), + os.path.join(self.package_folder, "lib", f"{package_lib_prefix}bx{bx_file.suffix}")) + if self.options.tools: + for bx_file in Path(os.path.join(self.package_folder, "bin")).glob("*bin2c*"): + rename(self, os.path.join(self.package_folder, "bin", bx_file.name), + os.path.join(self.package_folder, "bin", f"bin2c{bx_file.suffix}")) + for bx_file in Path(os.path.join(self.package_folder, "bin")).glob("*lemon*"): + rename(self, os.path.join(self.package_folder, "bin", bx_file.name), + os.path.join(self.package_folder, "bin", f"lemon{bx_file.suffix}")) + + def package_info(self): + self.cpp_info.includedirs = ["include"] + self.cpp_info.libs = ["bx"] + + self.cpp_info.set_property("cmake_file_name", "bx") + self.cpp_info.set_property("cmake_target_name", "bx::bx") + self.cpp_info.set_property("pkg_config_name", "bx") + + if self.settings.build_type == "Debug": + self.cpp_info.defines.extend(["BX_CONFIG_DEBUG=1"]) + else: + self.cpp_info.defines.extend(["BX_CONFIG_DEBUG=0"]) + + if self.settings.os == "Windows": + if self.settings.arch == "x86": + self.cpp_info.system_libs.extend(["psapi"]) + if is_msvc(self): + self.cpp_info.includedirs.extend(["include/compat/msvc"]) + self.cpp_info.cxxflags.extend(["/Zc:__cplusplus"]) + else: + self.cpp_info.includedirs.extend(["include/compat/mingw"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "pthread"]) + if self.settings.os == "Linux": + self.cpp_info.includedirs.extend(["include/compat/linux"]) + else: + self.cpp_info.includedirs.extend(["include/compat/freebsd"]) + elif self.settings.os in ["Macos", "iOS"]: + self.cpp_info.frameworks.extend(["Foundation", "Cocoa"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "bx" + self.cpp_info.filenames["cmake_find_package_multi"] = "bx" + self.cpp_info.names["cmake_find_package"] = "bx" + self.cpp_info.names["cmake_find_package_multi"] = "bx" diff --git a/recipes/bx/all/test_package/CMakeLists.txt b/recipes/bx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..71a1766827d58 --- /dev/null +++ b/recipes/bx/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(bx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} bx::bx) diff --git a/recipes/bx/all/test_package/conanfile.py b/recipes/bx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7914baa434398 --- /dev/null +++ b/recipes/bx/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake +import os + +required_conan_version = ">=1.50.0" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + 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/bx/all/test_package/test_package.cpp b/recipes/bx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e62d29351461a --- /dev/null +++ b/recipes/bx/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + float tLerp = bx::lerp(0.0f, 10.0f, 0.5f); + BX_TRACE("Lerped 0.0f to 10.0f at 0.5f, result %f", tLerp); + BX_ASSERT(bx::isEqual(tLerp, 5.0f, 0.1f), "isEqual failed"); + return 0; +} diff --git a/recipes/bx/all/test_v1_package/CMakeLists.txt b/recipes/bx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a070c42e7447 --- /dev/null +++ b/recipes/bx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} bx::bx) diff --git a/recipes/bx/all/test_v1_package/conanfile.py b/recipes/bx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d2959af78862a --- /dev/null +++ b/recipes/bx/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class BxTestPackageConan(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/bx/all/test_v1_package/test_package.cpp b/recipes/bx/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..e62d29351461a --- /dev/null +++ b/recipes/bx/all/test_v1_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + float tLerp = bx::lerp(0.0f, 10.0f, 0.5f); + BX_TRACE("Lerped 0.0f to 10.0f at 0.5f, result %f", tLerp); + BX_ASSERT(bx::isEqual(tLerp, 5.0f, 0.1f), "isEqual failed"); + return 0; +} diff --git a/recipes/bx/config.yml b/recipes/bx/config.yml new file mode 100644 index 0000000000000..1156867d3e651 --- /dev/null +++ b/recipes/bx/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221116": + folder: all diff --git a/recipes/byte-lite/all/conandata.yml b/recipes/byte-lite/all/conandata.yml new file mode 100644 index 0000000000000..8e855d258eebe --- /dev/null +++ b/recipes/byte-lite/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.0": + url: https://github.com/martinmoene/byte-lite/archive/v0.3.0.tar.gz + sha256: 1a19e237b12bb098297232b0a74ec08c18ac07ac5ac6e659c1d5d8a4ed0e4813 diff --git a/recipes/byte-lite/all/conanfile.py b/recipes/byte-lite/all/conanfile.py new file mode 100644 index 0000000000000..67d695dbd0333 --- /dev/null +++ b/recipes/byte-lite/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class ByteLiteConan(ConanFile): + name = "byte-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/byte-lite" + description = ("byte lite - A single-file header-only C++17-like byte type for \ + C++98, C++11 and later") + topics = ("cpp11", "cpp14", "cpp17", "byte", "byte-implementations") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "byte-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::byte-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "byte-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "byte-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["bytelite"].names["cmake_find_package"] = "byte-lite" + self.cpp_info.components["bytelite"].names["cmake_find_package_multi"] = "byte-lite" + self.cpp_info.components["bytelite"].set_property("cmake_target_name", "nonstd::byte-lite") + self.cpp_info.components["bytelite"].bindirs = [] + self.cpp_info.components["bytelite"].frameworkdirs = [] + self.cpp_info.components["bytelite"].libdirs = [] + self.cpp_info.components["bytelite"].resdirs = [] diff --git a/recipes/byte-lite/all/test_package/CMakeLists.txt b/recipes/byte-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2c4833803c8c9 --- /dev/null +++ b/recipes/byte-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(byte-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::byte-lite) diff --git a/recipes/byte-lite/all/test_package/conanfile.py b/recipes/byte-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/byte-lite/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/byte-lite/all/test_package/test_package.cpp b/recipes/byte-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bf423f8963b2a --- /dev/null +++ b/recipes/byte-lite/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include "nonstd/byte.hpp" + +#include + +using namespace nonstd; + +int main() +{ + byte b1 = to_byte( 0x5a ); // to_byte() is non-standard, needed for pre-C++17 + byte b2 = to_byte( 0xa5 ); + + byte r1 = b1 ^ b2; if( 0xff != to_integer( r1 ) ) throw std::exception(); // not (yet) standard, needs C++11 + byte r2 = b1 ^ b2; if( 0xff != to_integer( r2 ) ) throw std::exception(); +} diff --git a/recipes/byte-lite/all/test_v1_package/CMakeLists.txt b/recipes/byte-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..65ad56138429f --- /dev/null +++ b/recipes/byte-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(byte-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::byte-lite) diff --git a/recipes/byte-lite/all/test_v1_package/conanfile.py b/recipes/byte-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/byte-lite/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/byte-lite/config.yml b/recipes/byte-lite/config.yml new file mode 100644 index 0000000000000..d126790212e0c --- /dev/null +++ b/recipes/byte-lite/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.0": + folder: all diff --git a/recipes/bzip2/all/CMakeLists.txt b/recipes/bzip2/all/CMakeLists.txt new file mode 100644 index 0000000000000..cce959a4a45c5 --- /dev/null +++ b/recipes/bzip2/all/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.4) +project(bzip2 LANGUAGES C) + +include(GNUInstallDirs) + +option(BZ2_BUILD_EXE "Build bzip2 command-line utility" ON) + +add_library( + bz2 + ${BZ2_SRC_DIR}/blocksort.c + ${BZ2_SRC_DIR}/bzlib.c + ${BZ2_SRC_DIR}/compress.c + ${BZ2_SRC_DIR}/crctable.c + ${BZ2_SRC_DIR}/decompress.c + ${BZ2_SRC_DIR}/huffman.c + ${BZ2_SRC_DIR}/randtable.c +) + +target_include_directories(bz2 PUBLIC ${BZ2_SRC_DIR}) +set_target_properties( + bz2 + PROPERTIES + PUBLIC_HEADER "${BZ2_SRC_DIR}/bzlib.h" + SOVERSION ${BZ2_VERSION_MAJOR} + VERSION ${BZ2_VERSION_STRING} + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +install( + TARGETS bz2 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +if(BZ2_BUILD_EXE) + add_executable(bzip2 ${BZ2_SRC_DIR}/bzip2.c) + target_link_libraries(bzip2 PRIVATE bz2) + install(TARGETS bzip2 DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/bzip2/all/conandata.yml b/recipes/bzip2/all/conandata.yml new file mode 100644 index 0000000000000..01ba013179e10 --- /dev/null +++ b/recipes/bzip2/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.8": + url: "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" + sha256: "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" + "1.0.6": + url: "https://sourceware.org/pub/bzip2/bzip2-1.0.6.tar.gz" + sha256: "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd" +patches: + "1.0.6": + - patch_file: "patches/0001-fix-sys-stat-include.patch" diff --git a/recipes/bzip2/all/conanfile.py b/recipes/bzip2/all/conanfile.py new file mode 100644 index 0000000000000..9bba05c82a828 --- /dev/null +++ b/recipes/bzip2/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Bzip2Conan(ConanFile): + name = "bzip2" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.bzip.org" + license = "bzip2-1.0.8" + description = "bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm." + topics = ("data-compressor", "file-compression") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_executable": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executable": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.license = f"bzip2-{self.version}" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BZ2_BUILD_EXE"] = self.options.build_executable + tc.variables["BZ2_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BZ2_VERSION_MAJOR"] = Version(self.version).major + tc.variables["BZ2_VERSION_STRING"] = self.version + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(BZIP2_NEED_PREFIX TRUE) + set(BZIP2_FOUND TRUE) + if(NOT DEFINED BZIP2_INCLUDE_DIRS AND DEFINED BZip2_INCLUDE_DIRS) + set(BZIP2_INCLUDE_DIRS ${{BZip2_INCLUDE_DIRS}}) + endif() + if(NOT DEFINED BZIP2_INCLUDE_DIR AND DEFINED BZip2_INCLUDE_DIR) + set(BZIP2_INCLUDE_DIR ${{BZip2_INCLUDE_DIR}}) + endif() + if(NOT DEFINED BZIP2_LIBRARIES AND DEFINED BZip2_LIBRARIES) + set(BZIP2_LIBRARIES ${{BZip2_LIBRARIES}}) + endif() + set(BZIP2_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "BZip2") + self.cpp_info.set_property("cmake_target_name", "BZip2::BZip2") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.libs = ["bz2"] + + self.cpp_info.names["cmake_find_package"] = "BZip2" + self.cpp_info.names["cmake_find_package_multi"] = "BZip2" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + if self.options.build_executable: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/bzip2/all/patches/0001-fix-sys-stat-include.patch b/recipes/bzip2/all/patches/0001-fix-sys-stat-include.patch new file mode 100644 index 0000000000000..6c79502b81348 --- /dev/null +++ b/recipes/bzip2/all/patches/0001-fix-sys-stat-include.patch @@ -0,0 +1,11 @@ +--- a/bzip2.c ++++ b/bzip2.c +@@ -128,7 +128,7 @@ + #if BZ_LCCWIN32 + # include + # include +-# include ++# include + + # define NORETURN /**/ + # define PATH_SEP '\\' diff --git a/recipes/bzip2/all/test_package/CMakeLists.txt b/recipes/bzip2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..364bed2972661 --- /dev/null +++ b/recipes/bzip2/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(BZip2 REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE BZip2::BZip2) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindBZip2.html are properly defined +set(_custom_vars + BZIP2_FOUND + BZIP2_NEED_PREFIX + BZIP2_INCLUDE_DIRS + BZIP2_INCLUDE_DIR + BZIP2_LIBRARIES + BZIP2_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/bzip2/all/test_package/conanfile.py b/recipes/bzip2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/bzip2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bzip2/all/test_package/test_package.c b/recipes/bzip2/all/test_package/test_package.c new file mode 100644 index 0000000000000..fb91334dfae69 --- /dev/null +++ b/recipes/bzip2/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include +#include "bzlib.h" + + +int main(void) { + char buffer [256] = {0}; + unsigned int size = 256; + const char* version = BZ2_bzlibVersion(); + printf("Bzip2 version: %s\n", version); + BZ2_bzBuffToBuffCompress(buffer, &size, "conan-package-manager", 21, 1, 0, 1); + printf("Bzip2 compressed: %s\n", buffer); + return EXIT_SUCCESS; +} diff --git a/recipes/bzip2/all/test_v1_package/CMakeLists.txt b/recipes/bzip2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bzip2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bzip2/all/test_v1_package/conanfile.py b/recipes/bzip2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/bzip2/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/bzip2/config.yml b/recipes/bzip2/config.yml new file mode 100644 index 0000000000000..09dfd19800bb5 --- /dev/null +++ b/recipes/bzip2/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.8": + folder: all + "1.0.6": + folder: all diff --git a/recipes/bzip3/all/CMakeLists.txt b/recipes/bzip3/all/CMakeLists.txt new file mode 100644 index 0000000000000..f58db5b429ac9 --- /dev/null +++ b/recipes/bzip3/all/CMakeLists.txt @@ -0,0 +1,68 @@ +cmake_minimum_required(VERSION 3.4) +project(bzip3 LANGUAGES C) + +option(BZIP3_WITH_THREAD "enable thread" OFF) +option(BZIP3_WITH_UTIL "build and install utility" OFF) + +set(BZIP3_INC + ${BZIP3_SRC_DIR}/include/libbz3.h +) + +add_library(bzip3) + +if (BZIP3_VERSION VERSION_GREATER_EQUAL "1.1.5") +target_sources(bzip3 PRIVATE + ${BZIP3_SRC_DIR}/src/libbz3.c +) +else() +target_sources(bzip3 PRIVATE + ${BZIP3_SRC_DIR}/src/cm.c + ${BZIP3_SRC_DIR}/src/crc32.c + ${BZIP3_SRC_DIR}/src/libbz3.c + ${BZIP3_SRC_DIR}/src/libsais.c + ${BZIP3_SRC_DIR}/src/lzp.c + ${BZIP3_SRC_DIR}/src/rle.c +) +endif() +target_include_directories(bzip3 PUBLIC ${BZIP3_SRC_DIR}/include) +set_target_properties(bzip3 PROPERTIES + PUBLIC_HEADER "${BZIP3_INC}" + C_VISIBILITY_PRESET hidden + C_EXTENSIONS OFF +) +if (BZIP3_VERSION VERSION_GREATER_EQUAL "1.1.6" AND (MSVC OR MSVC90 OR MSVC10) AND BUILD_SHARED_LIBS) + target_compile_definitions(bzip3 PRIVATE "BZIP3_DLL_EXPORT=1") +endif() + +if (BZIP3_VERSION VERSION_GREATER_EQUAL "1.1.7") + target_compile_definitions(bzip3 PRIVATE "VERSION=\"${BZIP3_VERSION}\"") +endif() + +if (BZIP3_WITH_THREAD) + find_package(Threads REQUIRED) + target_link_libraries(bzip3 PRIVATE Threads::Threads) + target_compile_definitions(bzip3 PRIVATE "PTHREAD") +endif() + +if (BZIP3_WITH_UTIL) + add_executable(bzip3_cmd ${BZIP3_SRC_DIR}/src/main.c) + target_link_libraries(bzip3_cmd bzip3) + target_compile_definitions(bzip3_cmd PRIVATE "VERSION=\"${BZIP3_VERSION}\"") + set_target_properties(bzip3_cmd PROPERTIES OUTPUT_NAME "bzip3") +endif() + +find_library(LIBM m) +target_link_libraries(bzip3 PRIVATE $<$:${LIBM}>) + +include(GNUInstallDirs) +install( + TARGETS bzip3 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +if (BZIP3_WITH_UTIL) + install(TARGETS bzip3_cmd DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/bzip3/all/conandata.yml b/recipes/bzip3/all/conandata.yml new file mode 100644 index 0000000000000..4bb5f34796c3f --- /dev/null +++ b/recipes/bzip3/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "1.3.0": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.3.0/bzip3-1.3.0.tar.xz" + sha256: "72fca01d9030e9c260e2ff8fe9d2e9f6261ea28e86adabeb6a8af3300ec390ef" + "1.2.3": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.2.3/bzip3-1.2.3.tar.xz" + sha256: "a6a4fa418bdff6f15be3604e8e85b5b73bf0f20e31de9603d55dc100914a111f" + "1.2.2": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.2.2/bzip3-1.2.2.tar.xz" + sha256: "2b82d0adcea762ac090cf9e791159894e633a37b34696bcd8c66202b23c4130b" + "1.2.1": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.2.1/bzip3-1.2.1.tar.xz" + sha256: "4ad3aea9b9c28be102dbfeb3aec89281116784bf41b97331da88aa137bd91a27" + "1.2.0": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.2.0/bzip3-1.2.0.tar.xz" + sha256: "f0441519321070e03708638b37bdeb9105aff8f0a5c838e45aff1b0cbe752572" + "1.1.8": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.8/bzip3-1.1.8.tar.bz2" + sha256: "bc15d0e4599aad18d9ed71ee0f7e859af89051bf5105b0751e8ca3a26117567d" + "1.1.7": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.7/bzip3-1.1.7.tar.bz2" + sha256: "1f74768dd1a76c45417f84779cc04d8d8b1f595ac564a2ea2aeb0248defca803" + "1.1.6": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.6/bzip3-1.1.6.tar.bz2" + sha256: "2bfd35dd57ab80b35b25e3ad628e0ff8f1f5e6dea02a8d472914823ea2e07e96" + "1.1.5": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.5/bzip3-1.1.5.tar.bz2" + sha256: "2f5012b0004b6c23d5f606deed9191fdce44849234edbcf26e0316bf7856d114" + "1.1.4": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.4/bzip3-1.1.4.tar.bz2" + sha256: "e23a06ae17fc36192e79d0151950b3bbd4e26381af50ba4b4fd7a2d9797e498f" +patches: + "1.1.5": + - patch_file: "patches/1.1.5-0002-export-symbols.patch" + "1.1.4": + - patch_file: "patches/1.1.4-0001-make-restrict-alias.patch" + - patch_file: "patches/1.1.4-0002-export-symbols.patch" diff --git a/recipes/bzip3/all/conanfile.py b/recipes/bzip3/all/conanfile.py new file mode 100644 index 0000000000000..484c139e122f3 --- /dev/null +++ b/recipes/bzip3/all/conanfile.py @@ -0,0 +1,81 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class BZip3Conan(ConanFile): + name = "bzip3" + description = "A better and stronger spiritual successor to BZip2." + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kspalaiologos/bzip3" + topics = ("bzip2", "lzma", "compression") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_thread": [True, False], + "with_util": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_thread": True, + "with_util": False, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # FIXME: could be supported on Windows: + # - MinGW with posix thread supports it out of the box + # - otherwise, add pthreads4w to requirements and link it in CMakeLists + if self.settings.os == "Windows": + del self.options.with_thread + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BZIP3_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BZIP3_WITH_PTHREAD"] = self.options.get_safe("with_thread", False) + tc.variables["BZIP3_WITH_UTIL"] = self.options.with_util + tc.variables["BZIP3_VERSION"] = self.version + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "bzip3") + self.cpp_info.libs = ["bzip3"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.options.get_safe("with_thread", False): + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch b/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch new file mode 100644 index 0000000000000..20195b834da7b --- /dev/null +++ b/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch @@ -0,0 +1,114 @@ +diff --git a/src/crc32.c b/src/crc32.c +index 856fcd4..d9fb87a 100644 +--- a/src/crc32.c ++++ b/src/crc32.c +@@ -19,6 +19,14 @@ + + #include "crc32.h" + ++#if defined(__GNUC__) || defined(__clang__) ++ #define RESTRICT __restrict__ ++#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) ++ #define RESTRICT __restrict ++#else ++ #error Your compiler, configuration or platform is not supported. ++#endif ++ + static const u32 crc32Table[256] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, + 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, 0x105EC76FL, 0xE235446CL, +@@ -51,7 +59,7 @@ static const u32 crc32Table[256] = { + 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L + }; + +-u32 crc32sum(u32 crc, u8 * restrict buf, size_t size) { ++u32 crc32sum(u32 crc, u8 * RESTRICT buf, size_t size) { + while (size--) crc = crc32Table[(crc ^ *(buf++)) & 0xff] ^ (crc >> 8); + return crc; + } +diff --git a/src/lzp.c b/src/lzp.c +index c19580d..2206673 100644 +--- a/src/lzp.c ++++ b/src/lzp.c +@@ -11,8 +11,16 @@ + + #define MATCH 0xf2 + +-static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * restrict out, u8 * out_end, +- s32 * restrict lut, s32 mask, s32 m_len) { ++#if defined(__GNUC__) || defined(__clang__) ++ #define RESTRICT __restrict__ ++#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) ++ #define RESTRICT __restrict ++#else ++ #error Your compiler, configuration or platform is not supported. ++#endif ++ ++static s32 lzp_encode_block(const u8 * RESTRICT in, const u8 * in_end, u8 * RESTRICT out, u8 * out_end, ++ s32 * RESTRICT lut, s32 mask, s32 m_len) { + const u8 *ins = in, *outs = out; + const u8 * out_eob = out_end - 8; + const u8 * heur = in; +@@ -28,7 +36,7 @@ static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * rest + s32 val = lut[idx]; + lut[idx] = in - ins; + if (val > 0) { +- const u8 * restrict ref = ins + val; ++ const u8 * RESTRICT ref = ins + val; + if (memcmp(in + m_len - 4, ref + m_len - 4, sizeof(u32)) == 0 && memcmp(in, ref, sizeof(u32)) == 0) { + if (heur > in && *(u32 *)heur != *(u32 *)(ref + (heur - in))) goto not_found; + +@@ -85,7 +93,7 @@ static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * rest + return out >= out_eob ? -1 : (s32)(out - outs); + } + +-static s32 lzp_decode_block(const u8 * restrict in, const u8 * in_end, s32 * restrict lut, u8 * restrict out, s32 hash, ++static s32 lzp_decode_block(const u8 * RESTRICT in, const u8 * in_end, s32 * RESTRICT lut, u8 * RESTRICT out, s32 hash, + s32 m_len) { + if (in_end - in < 4) return -1; + +@@ -129,7 +137,7 @@ static s32 lzp_decode_block(const u8 * restrict in, const u8 * in_end, s32 * res + return out - outs; + } + +-s32 lzp_compress(const u8 * restrict in, u8 * restrict out, s32 n, s32 hash, s32 m_len, s32 * restrict lut) { ++s32 lzp_compress(const u8 * RESTRICT in, u8 * RESTRICT out, s32 n, s32 hash, s32 m_len, s32 * RESTRICT lut) { + if (n - m_len < 32) return -1; + + memset(lut, 0, sizeof(s32) * (1 << hash)); +@@ -137,6 +145,6 @@ s32 lzp_compress(const u8 * restrict in, u8 * restrict out, s32 n, s32 hash, s32 + return lzp_encode_block(in, in + n, out, out + n, lut, (s32)(1 << hash) - 1, m_len); + } + +-s32 lzp_decompress(const u8 * restrict in, u8 * restrict out, s32 n, s32 hash, s32 m_len, s32 * restrict lut) { ++s32 lzp_decompress(const u8 * RESTRICT in, u8 * RESTRICT out, s32 n, s32 hash, s32 m_len, s32 * RESTRICT lut) { + return lzp_decode_block(in, in + n, lut, out, hash, m_len); + } +diff --git a/src/rle.c b/src/rle.c +index b1f0340..2cb2e53 100644 +--- a/src/rle.c ++++ b/src/rle.c +@@ -19,6 +19,14 @@ + + #include "rle.h" + ++#if defined(__GNUC__) || defined(__clang__) ++ #define RESTRICT __restrict__ ++#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) ++ #define RESTRICT __restrict ++#else ++ #error Your compiler, configuration or platform is not supported. ++#endif ++ + s32 mrlec(u8 * in, s32 inlen, u8 * out) { + u8 *ip = in, *in_end = in + inlen; + s32 op = 0; +@@ -57,7 +65,7 @@ s32 mrlec(u8 * in, s32 inlen, u8 * out) { + return op; + } + +-void mrled(u8 * restrict in, u8 * restrict out, s32 outlen) { ++void mrled(u8 * RESTRICT in, u8 * RESTRICT out, s32 outlen) { + s32 op = 0, ip = 0; + + s32 c, pc = -1; diff --git a/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch b/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch new file mode 100644 index 0000000000000..3bdf13582cc59 --- /dev/null +++ b/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch @@ -0,0 +1,95 @@ +--- a/include/common.h ++++ b/include/common.h +@@ -46,10 +46,6 @@ static void write_neutral_s32(u8 * data, s32 value) { + data[3] = (value >> 24) & 0xFF; + } + +-#ifdef __MINGW32__ +- #define PUBLIC_API __declspec(dllexport) +-#else +- #define PUBLIC_API +-#endif ++#define PUBLIC_API + + #endif +--- a/include/libbz3.h ++++ b/include/libbz3.h +@@ -22,6 +22,16 @@ + + #include + ++#ifdef bzip3_EXPORTS ++#ifdef _WIN32 ++ #define BZIP3_API __declspec(dllexport) ++#else ++ #define BZIP3_API __attribute__((visibility("default"))) ++#endif ++#else ++ #define BZIP3_API ++#endif ++ + #define BZ3_OK 0 + #define BZ3_ERR_OUT_OF_BOUNDS -1 + #define BZ3_ERR_BWT -2 +@@ -35,31 +45,31 @@ struct bz3_state; + /** + * @brief Get the last error number associated with a given state. + */ +-int8_t bz3_last_error(struct bz3_state * state); ++BZIP3_API int8_t bz3_last_error(struct bz3_state * state); + + /** + * @brief Return a user-readable message explaining the cause of the last error. + */ +-const char * bz3_strerror(struct bz3_state * state); ++BZIP3_API const char * bz3_strerror(struct bz3_state * state); + + /** + * @brief Construct a new block encoder state, which will encode blocks as big as the given block size. + * The decoder will be able to decode blocks at most as big as the given block size. + * Returns NULL in case allocation fails or the block size is not between 65K and 511M + */ +-struct bz3_state * bz3_new(int32_t block_size); ++BZIP3_API struct bz3_state * bz3_new(int32_t block_size); + + /** + * @brief Free the memory occupied by a block encoder state. + */ +-void bz3_free(struct bz3_state * state); ++BZIP3_API void bz3_free(struct bz3_state * state); + + /** + * @brief Encode a single block. Returns the amount of bytes written to `buffer'. + * `buffer' must be able to hold at least `size + size / 50 + 32' bytes. The size must not + * exceed the block size associated with the state. + */ +-int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); ++BZIP3_API int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); + + /** + * @brief Decode a single block. +@@ -68,7 +78,7 @@ int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz + * @param size The size of the compressed data in `buffer' + * @param orig_size The original size of the data before compression. + */ +-int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); ++BZIP3_API int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); + + /** + * @brief Encode `n' blocks, all in parallel. +@@ -80,13 +90,13 @@ int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz + * + * Present in the shared library only if -lpthread was present during building. + */ +-void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); ++BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); + + /** + * @brief Decode `n' blocks, all in parallel. + * Same specifics as `bz3_encode_blocks', but doesn't overwrite `sizes'. + */ +-void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], ++BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], + int32_t n); + + #endif diff --git a/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch b/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch new file mode 100644 index 0000000000000..e76dc6e0d184e --- /dev/null +++ b/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch @@ -0,0 +1,83 @@ +diff --git a/include/libbz3.h b/include/libbz3.h +index a5ac58a..a9b13fd 100644 +--- a/include/libbz3.h ++++ b/include/libbz3.h +@@ -22,6 +22,16 @@ + + #include + ++#ifdef bzip3_EXPORTS ++#ifdef _WIN32 ++ #define BZIP3_API __declspec(dllexport) ++#else ++ #define BZIP3_API __attribute__((visibility("default"))) ++#endif ++#else ++ #define BZIP3_API ++#endif ++ + #define BZ3_OK 0 + #define BZ3_ERR_OUT_OF_BOUNDS -1 + #define BZ3_ERR_BWT -2 +@@ -35,31 +45,31 @@ struct bz3_state; + /** + * @brief Get the last error number associated with a given state. + */ +-int8_t bz3_last_error(struct bz3_state * state); ++BZIP3_API int8_t bz3_last_error(struct bz3_state * state); + + /** + * @brief Return a user-readable message explaining the cause of the last error. + */ +-const char * bz3_strerror(struct bz3_state * state); ++BZIP3_API const char * bz3_strerror(struct bz3_state * state); + + /** + * @brief Construct a new block encoder state, which will encode blocks as big as the given block size. + * The decoder will be able to decode blocks at most as big as the given block size. + * Returns NULL in case allocation fails or the block size is not between 65K and 511M + */ +-struct bz3_state * bz3_new(int32_t block_size); ++BZIP3_API struct bz3_state * bz3_new(int32_t block_size); + + /** + * @brief Free the memory occupied by a block encoder state. + */ +-void bz3_free(struct bz3_state * state); ++BZIP3_API void bz3_free(struct bz3_state * state); + + /** + * @brief Encode a single block. Returns the amount of bytes written to `buffer'. + * `buffer' must be able to hold at least `size + size / 50 + 32' bytes. The size must not + * exceed the block size associated with the state. + */ +-int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); ++BZIP3_API int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); + + /** + * @brief Decode a single block. +@@ -68,7 +78,7 @@ int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz + * @param size The size of the compressed data in `buffer' + * @param orig_size The original size of the data before compression. + */ +-int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); ++BZIP3_API int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); + + /** + * @brief Encode `n' blocks, all in parallel. +@@ -80,13 +90,13 @@ int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz + * + * Present in the shared library only if -lpthread was present during building. + */ +-void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); ++BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); + + /** + * @brief Decode `n' blocks, all in parallel. + * Same specifics as `bz3_encode_blocks', but doesn't overwrite `sizes'. + */ +-void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], ++BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], + int32_t n); + + #endif diff --git a/recipes/bzip3/all/test_package/CMakeLists.txt b/recipes/bzip3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e47e03f4174fe --- /dev/null +++ b/recipes/bzip3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(bzip3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE bzip3::bzip3) diff --git a/recipes/bzip3/all/test_package/conanfile.py b/recipes/bzip3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/bzip3/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/bzip3/all/test_package/test_package.c b/recipes/bzip3/all/test_package/test_package.c new file mode 100644 index 0000000000000..a93ba92b22e72 --- /dev/null +++ b/recipes/bzip3/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +#include "libbz3.h" + +int main() { + const unsigned int block_size = 8 * 1024 * 1024; + struct bz3_state * state = bz3_new(block_size); + + bz3_free(state); + + return 0; +} diff --git a/recipes/bzip3/all/test_v1_package/CMakeLists.txt b/recipes/bzip3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/bzip3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/bzip3/all/test_v1_package/conanfile.py b/recipes/bzip3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/bzip3/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/bzip3/config.yml b/recipes/bzip3/config.yml new file mode 100644 index 0000000000000..8395bf34db523 --- /dev/null +++ b/recipes/bzip3/config.yml @@ -0,0 +1,21 @@ +versions: + "1.3.0": + folder: all + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.2.1": + folder: all + "1.2.0": + folder: all + "1.1.8": + folder: all + "1.1.7": + folder: all + "1.1.6": + folder: all + "1.1.5": + folder: all + "1.1.4": + folder: all diff --git a/recipes/c-ares/all/conandata.yml b/recipes/c-ares/all/conandata.yml new file mode 100644 index 0000000000000..a2f22979a5926 --- /dev/null +++ b/recipes/c-ares/all/conandata.yml @@ -0,0 +1,47 @@ +sources: + "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" + "1.17.2": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_17_2/c-ares-1.17.2.tar.gz" + sha256: "4803c844ce20ce510ef0eb83f8ea41fa24ecaae9d280c468c582d2bb25b3913d" + "1.17.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_17_1/c-ares-1.17.1.tar.gz" + sha256: "d73dd0f6de824afd407ce10750ea081af47eba52b8a6cb307d220131ad93fc40" + "1.16.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_16_1/c-ares-1.16.1.tar.gz" + sha256: "d08312d0ecc3bd48eee0a4cc0d2137c9f194e0a28de2028928c0f6cae85f86ce" + "1.15.0": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-1.15.0.tar.gz" + sha256: "6cdb97871f2930530c97deb7cf5c8fa4be5a0b02c7cea6e7c7667672a39d6852" + "1.14.0": + url: "https://github.com/c-ares/c-ares/files/1731591/c-ares-1.14.0.tar.gz" + sha256: "45d3c1fd29263ceec2afc8ff9cd06d5f8f889636eb4e80ce3cc7f0eaf7aadc6e" +patches: + "1.17.1": + - patch_file: "patches/upstream-pr-395-bundle-destination-v16-17.patch" + patch_description: "add `BUNDLE DESTINATION` to install" + patch_type: "portability" + patch_source: "https://github.com/c-ares/c-ares/pull/395" + "1.16.1": + - patch_file: "patches/upstream-pr-395-bundle-destination-v16-17.patch" + patch_description: "add `BUNDLE DESTINATION` to install" + patch_type: "portability" + patch_source: "https://github.com/c-ares/c-ares/pull/395" + "1.15.0": + - patch_file: "patches/upstream-pr-395-bundle-destination-v15.patch" + patch_description: "add `BUNDLE DESTINATION` to install" + patch_type: "portability" + patch_source: "https://github.com/c-ares/c-ares/pull/395" + "1.14.0": + - patch_file: "patches/option-tools.patch" + patch_description: "add `CARES_BUILD_TOOLS` option" + patch_type: "conan" + patch_source: "https://github.com/c-ares/c-ares/pull/214" + - patch_file: "patches/upstream-pr-395-bundle-destination-v14.patch" + patch_description: "add `BUNDLE DESTINATION` to install" + patch_type: "portability" + patch_source: "https://github.com/c-ares/c-ares/pull/395" diff --git a/recipes/c-ares/all/conanfile.py b/recipes/c-ares/all/conanfile.py new file mode 100644 index 0000000000000..7eea8faebb9ed --- /dev/null +++ b/recipes/c-ares/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CAresConan(ConanFile): + name = "c-ares" + 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/" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CARES_STATIC"] = not self.options.shared + tc.variables["CARES_SHARED"] = self.options.shared + tc.variables["CARES_BUILD_TESTS"] = False + tc.variables["CARES_MSVC_STATIC_RUNTIME"] = False + tc.variables["CARES_BUILD_TOOLS"] = self.options.tools + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "*LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "c-ares") + self.cpp_info.set_property("cmake_target_name", "c-ares::cares") + self.cpp_info.set_property("pkg_config_name", "libcares") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["cares"].libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.components["cares"].defines.append("CARES_STATICLIB") + if self.settings.os == "Linux": + self.cpp_info.components["cares"].system_libs.append("rt") + 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") + elif is_apple_os(self): + self.cpp_info.components["cares"].system_libs.append("resolv") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["pkg_config"] = "libcares" + self.cpp_info.components["cares"].names["cmake_find_package"] = "cares" + self.cpp_info.components["cares"].names["cmake_find_package_multi"] = "cares" + self.cpp_info.components["cares"].names["pkg_config"] = "libcares" + self.cpp_info.components["cares"].set_property("cmake_target_name", "c-ares::cares") + self.cpp_info.components["cares"].set_property("pkg_config_name", "libcares") + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/c-ares/all/patches/option-tools.patch b/recipes/c-ares/all/patches/option-tools.patch new file mode 100644 index 0000000000000..650eca0948612 --- /dev/null +++ b/recipes/c-ares/all/patches/option-tools.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -670,6 +670,8 @@ SET (CARES_FOUND 1 CACHE INTERNAL "CARES LIBRARY FOUND") + SET (CARES_LIBRARIES ${PROJECT_NAME}::cares CACHE INTERNAL "CARES LIBRARIES") + + ++OPTION (CARES_BUILD_TOOLS "Build tools" ON) ++IF(CARES_BUILD_TOOLS) + # Build ahost + ADD_EXECUTABLE (ahost ahost.c ${SAMPLESOURCES}) + TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1) +@@ -695,3 +697,4 @@ TARGET_LINK_LIBRARIES (acountry PRIVATE ${PROJECT_NAME}) + IF (CARES_INSTALL) + INSTALL (TARGETS acountry ${TARGETS_INST_DEST}) + ENDIF () ++ENDIF() diff --git a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch new file mode 100644 index 0000000000000..14536414d1c00 --- /dev/null +++ b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,6 +65,7 @@ SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) + # Destinations for installing different kinds of targets (pass to install command). + SET (TARGETS_INST_DEST + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch new file mode 100644 index 0000000000000..5049967cdd9a6 --- /dev/null +++ b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,6 +66,7 @@ SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) + # Destinations for installing different kinds of targets (pass to install command). + SET (TARGETS_INST_DEST + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch new file mode 100644 index 0000000000000..ca07d535842b0 --- /dev/null +++ b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,6 +74,7 @@ SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) + # Destinations for installing different kinds of targets (pass to install command). + SET (TARGETS_INST_DEST + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) diff --git a/recipes/c-ares/all/test_package/CMakeLists.txt b/recipes/c-ares/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18c37b0445afc --- /dev/null +++ b/recipes/c-ares/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(c-ares REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE c-ares::cares) diff --git a/recipes/c-ares/all/test_package/conanfile.py b/recipes/c-ares/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/c-ares/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/c-ares/all/test_package/test_package.c b/recipes/c-ares/all/test_package/test_package.c new file mode 100644 index 0000000000000..0023e9dae2282 --- /dev/null +++ b/recipes/c-ares/all/test_package/test_package.c @@ -0,0 +1,111 @@ +#include +#include +#include +#include +#include +#include + + +#if !defined(WIN32) || defined(WATT32) + #include + #include + #include + #include + #include +#else + #include +#endif + +#ifdef __MINGW32__ + const char* inet_ntop(int af, const void* src, char* dst, int cnt) { + struct sockaddr_in srcaddr; + memset(&srcaddr, 0, sizeof(struct sockaddr_in)); + memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr)); + + srcaddr.sin_family = af; + if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) { + DWORD rv = WSAGetLastError(); + return NULL; + } + return dst; + } +#endif // __MINGW32__ + +static void +state_cb(void *data, int s, int read, int write) +{ + printf("Change state fd %d read:%d write:%d\n", s, read, write); +} + + +static void +callback(void *arg, int status, int timeouts, struct hostent *host) +{ + + if(!host || status != ARES_SUCCESS){ + printf("Failed to lookup %s\n", ares_strerror(status)); + return; + } + + printf("Found address name %s\n", host->h_name); + char ip[INET6_ADDRSTRLEN]; + int i = 0; + + for (i = 0; host->h_addr_list[i]; ++i) { + inet_ntop(host->h_addrtype, host->h_addr_list[i], ip, sizeof(ip)); + printf("%s\n", ip); + } +} + +static void +wait_ares(ares_channel channel) +{ + for(;;){ + struct timeval *tvp, tv; + fd_set read_fds, write_fds; + int nfds; + + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + nfds = ares_fds(channel, &read_fds, &write_fds); + if(nfds == 0){ + break; + } + tvp = ares_timeout(channel, NULL, &tv); + select(nfds, &read_fds, &write_fds, NULL, tvp); + ares_process(channel, &read_fds, &write_fds); + } +} + +int +main(void) +{ + ares_channel channel; + int status; + struct ares_options options; + int optmask = 0; + + #ifdef WIN32 + WORD wVersionRequested = MAKEWORD(2, 2); + WSADATA wsaData; + WSAStartup(wVersionRequested, &wsaData); + #endif + + status = ares_library_init(ARES_LIB_INIT_ALL); + if (status != ARES_SUCCESS){ + printf("ares_library_init: %s\n", ares_strerror(status)); + return 1; + } + + status = ares_init_options(&channel, &options, optmask); + if(status != ARES_SUCCESS) { + printf("ares_init_options: %s\n", ares_strerror(status)); + return 1; + } + + ares_gethostbyname(channel, "google.com", AF_INET, callback, NULL); + wait_ares(channel); + ares_destroy(channel); + ares_library_cleanup(); + return 0; +} diff --git a/recipes/c-ares/all/test_v1_package/CMakeLists.txt b/recipes/c-ares/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/c-ares/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/c-ares/all/test_v1_package/conanfile.py b/recipes/c-ares/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/c-ares/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/c-ares/config.yml b/recipes/c-ares/config.yml new file mode 100644 index 0000000000000..ec5c9c9aa795e --- /dev/null +++ b/recipes/c-ares/config.yml @@ -0,0 +1,15 @@ +versions: + "1.19.0": + folder: all + "1.18.1": + folder: all + "1.17.2": + folder: all + "1.17.1": + folder: all + "1.16.1": + folder: all + "1.15.0": + folder: all + "1.14.0": + folder: all diff --git a/recipes/c-blosc/all/conandata.yml b/recipes/c-blosc/all/conandata.yml new file mode 100644 index 0000000000000..c8c0ea232bc21 --- /dev/null +++ b/recipes/c-blosc/all/conandata.yml @@ -0,0 +1,58 @@ +sources: + "1.21.3": + url: "https://github.com/Blosc/c-blosc/archive/v1.21.3.tar.gz" + sha256: "941016c4564bca662080bb01aea74f06630bd665e598c6f6967fd91b2e2e0bb6" + "1.21.1": + url: "https://github.com/Blosc/c-blosc/archive/v1.21.1.tar.gz" + sha256: "f387149eab24efa01c308e4cba0f59f64ccae57292ec9c794002232f7903b55b" + "1.21.0": + url: "https://github.com/Blosc/c-blosc/archive/v1.21.0.tar.gz" + sha256: "b0ef4fda82a1d9cbd11e0f4b9685abf14372db51703c595ecd4d76001a8b342d" + "1.20.1": + url: "https://github.com/Blosc/c-blosc/archive/v1.20.1.tar.gz" + sha256: "42c4d3fcce52af9f8e2078f8f57681bfc711706a3330cb72b9b39e05ae18a413" + "1.20.0": + url: "https://github.com/Blosc/c-blosc/archive/v1.20.0.tar.gz" + sha256: "992ab5b475b7ba94f91c5ce58359ff0d6069fc65ba0c5bee373db8daecb17ce0" + "1.19.0": + url: "https://github.com/Blosc/c-blosc/archive/v1.19.0.tar.gz" + sha256: "cf3d6193fece9becddb62248b9981bf78cf1c7faf58150fd520d4755cd622488" + "1.18.1": + url: "https://github.com/Blosc/c-blosc/archive/v1.18.1.tar.gz" + sha256: "18730e3d1139aadf4002759ef83c8327509a9fca140661deb1d050aebba35afb" + "1.17.1": + url: "https://github.com/Blosc/c-blosc/archive/v1.17.1.tar.gz" + sha256: "19a6948b579c27e8ac440b4f077f99fc90e7292b1d9cb896bec0fd781d68fba2" +patches: + "1.21.3": + - patch_file: "patches/cmake-dependencies-1.21.2+.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.21.1": + - patch_file: "patches/cmake-dependencies-1.21.1+.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.21.0": + - patch_file: "patches/cmake-dependencies-1.20.0+.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.20.1": + - patch_file: "patches/cmake-dependencies-1.20.0+.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.20.0": + - patch_file: "patches/cmake-dependencies-1.20.0+.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.19.0": + - patch_file: "patches/cmake-dependencies-1.19.0.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.18.1": + - patch_file: "patches/cmake-dependencies-1.18.1-.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.17.1": + - patch_file: "patches/cmake-dependencies-1.18.1-.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/recipes/c-blosc/all/conanfile.py b/recipes/c-blosc/all/conanfile.py new file mode 100644 index 0000000000000..a349a37babbd2 --- /dev/null +++ b/recipes/c-blosc/all/conanfile.py @@ -0,0 +1,124 @@ +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.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CbloscConan(ConanFile): + name = "c-blosc" + description = "An extremely fast, multi-threaded, meta-compressor library." + license = "BSD-3-Clause" + topics = ("c-blosc", "blosc", "compression") + homepage = "https://github.com/Blosc/c-blosc" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "simd_intrinsics": [None, "sse2", "avx2"], + "with_lz4": [True, False], + "with_snappy": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "simd_intrinsics": "sse2", + "with_lz4": True, + "with_snappy": True, + "with_zlib": True, + "with_zstd": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.simd_intrinsics + + 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_lz4: + self.requires("lz4/1.9.4") + if self.options.with_snappy: + self.requires("snappy/1.1.9") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + + 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["BLOSC_INSTALL"] = True + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_TESTS"] = False + if Version(self.version) >= "1.20.0": + tc.variables["BUILD_FUZZERS"] = False + tc.variables["BUILD_BENCHMARKS"] = False + simd_intrinsics = self.options.get_safe("simd_intrinsics", False) + tc.variables["DEACTIVATE_SSE2"] = simd_intrinsics not in ["sse2", "avx2"] + tc.variables["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" + tc.variables["DEACTIVATE_LZ4"] = not self.options.with_lz4 + tc.variables["DEACTIVATE_SNAPPY"] = not self.options.with_snappy + tc.variables["DEACTIVATE_ZLIB"] = not self.options.with_zlib + tc.variables["DEACTIVATE_ZSTD"] = not self.options.with_zstd + tc.variables["DEACTIVATE_SYMBOLS_CHECK"] = True + tc.variables["PREFER_EXTERNAL_LZ4"] = True + if Version(self.version) < "1.19.0": + tc.variables["PREFER_EXTERNAL_SNAPPY"] = True + tc.variables["PREFER_EXTERNAL_ZLIB"] = True + tc.variables["PREFER_EXTERNAL_ZSTD"] = True + tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "cmake")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + licenses = ["BLOSC.txt", "BITSHUFFLE.txt", "FASTLZ.txt"] + for license_file in licenses: + copy(self, license_file, src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "blosc") + prefix = "lib" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}blosc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch new file mode 100644 index 0000000000000..d4a2354fd9ed0 --- /dev/null +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch @@ -0,0 +1,72 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,12 +122,12 @@ option(PREFER_EXTERNAL_ZLIB + option(PREFER_EXTERNAL_ZSTD + "Find and use external Zstd library instead of included sources." OFF) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND TRUE) + else() + message(STATUS "Using LZ4 internal sources.") + endif(PREFER_EXTERNAL_LZ4) +@@ -150,7 +149,6 @@ endif(NOT DEACTIVATE_SNAPPY) + if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) +- set(ZLIB_ROOT $ENV{ZLIB_ROOT}) + find_package(ZLIB) + if (NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") +@@ -165,7 +163,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd REQUIRED CONFIG) + else () + message(STATUS "Using ZSTD internal sources.") + endif (PREFER_EXTERNAL_ZSTD) +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -82,7 +82,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -91,7 +91,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} "Snappy::snappy") + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -100,7 +100,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} "ZLIB::ZLIB") + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -109,7 +109,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + else (ZSTD_FOUND) + file(GLOB ZSTD_FILES + ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch new file mode 100644 index 0000000000000..3f5a9b46096f3 --- /dev/null +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch @@ -0,0 +1,72 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -117,12 +117,12 @@ option(PREFER_EXTERNAL_ZLIB + option(PREFER_EXTERNAL_ZSTD + "Find and use external Zstd library instead of included sources." OFF) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND TRUE) + else() + message(STATUS "Using LZ4 internal sources.") + endif(PREFER_EXTERNAL_LZ4) +@@ -144,7 +143,6 @@ endif(NOT DEACTIVATE_SNAPPY) + if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) +- set(ZLIB_ROOT $ENV{ZLIB_ROOT}) + find_package(ZLIB) + if (NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") +@@ -159,7 +157,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd REQUIRED CONFIG) + else () + message(STATUS "Using ZSTD internal sources.") + endif (PREFER_EXTERNAL_ZSTD) +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -82,7 +82,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -91,7 +91,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} "Snappy::snappy") + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -100,7 +100,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} "ZLIB::ZLIB") + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -109,7 +109,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + else (ZSTD_FOUND) + file(GLOB ZSTD_FILES + ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch new file mode 100644 index 0000000000000..428ddd7762cfb --- /dev/null +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch @@ -0,0 +1,72 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -121,12 +121,12 @@ option(PREFER_EXTERNAL_ZLIB + option(PREFER_EXTERNAL_ZSTD + "Find and use external Zstd library instead of included sources." OFF) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND TRUE) + else() + message(STATUS "Using LZ4 internal sources.") + endif(PREFER_EXTERNAL_LZ4) +@@ -148,7 +147,6 @@ endif(NOT DEACTIVATE_SNAPPY) + if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) +- set(ZLIB_ROOT $ENV{ZLIB_ROOT}) + find_package(ZLIB) + if (NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") +@@ -163,7 +161,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd REQUIRED CONFIG) + else () + message(STATUS "Using ZSTD internal sources.") + endif (PREFER_EXTERNAL_ZSTD) +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -82,7 +82,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -92,7 +92,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} "Snappy::snappy") + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -102,7 +102,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} "ZLIB::ZLIB") + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -112,7 +112,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + else (ZSTD_FOUND) + file(GLOB ZSTD_FILES + ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch new file mode 100644 index 0000000000000..fb62441ddd89b --- /dev/null +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch @@ -0,0 +1,72 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -121,12 +121,12 @@ option(PREFER_EXTERNAL_ZLIB + option(PREFER_EXTERNAL_ZSTD + "Find and use external Zstd library instead of included sources." OFF) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND TRUE) + else() + message(STATUS "Using LZ4 internal sources.") + endif(PREFER_EXTERNAL_LZ4) +@@ -148,7 +148,6 @@ endif(NOT DEACTIVATE_SNAPPY) + if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) +- set(ZLIB_ROOT $ENV{ZLIB_ROOT}) + find_package(ZLIB) + if (NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") +@@ -163,7 +162,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd REQUIRED CONFIG) + else () + message(STATUS "Using ZSTD internal sources.") + endif (PREFER_EXTERNAL_ZSTD) +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -91,7 +91,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -101,7 +101,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} "Snappy::snappy") + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -111,7 +111,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} "ZLIB::ZLIB") + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -121,7 +121,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + else (ZSTD_FOUND) + file(GLOB ZSTD_FILES + ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.21.2+.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.2+.patch new file mode 100644 index 0000000000000..09a5a7401237e --- /dev/null +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.2+.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54d4817..2ba937d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,7 +134,8 @@ include(GNUInstallDirs) + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND TRUE) + else() + message(STATUS "Using LZ4 internal sources.") + endif() +@@ -156,7 +157,6 @@ endif() + if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) +- set(ZLIB_ROOT $ENV{ZLIB_ROOT}) + find_package(ZLIB) + if(NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") +@@ -171,7 +171,7 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd REQUIRED CONFIG) + else() + message(STATUS "Using ZSTD internal sources.") + endif() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index fd6d695..8ef909d 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -88,7 +88,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -98,7 +98,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} "Snappy::snappy") + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -108,7 +108,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} "ZLIB::ZLIB") + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -118,7 +118,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + else (ZSTD_FOUND) + # 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-blosc/all/test_package/CMakeLists.txt b/recipes/c-blosc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e73da46b32d37 --- /dev/null +++ b/recipes/c-blosc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(c-blosc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE c-blosc::c-blosc) diff --git a/recipes/c-blosc/all/test_package/conanfile.py b/recipes/c-blosc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/c-blosc/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/c-blosc/all/test_package/test_package.c b/recipes/c-blosc/all/test_package/test_package.c new file mode 100644 index 0000000000000..9d87c11ac18be --- /dev/null +++ b/recipes/c-blosc/all/test_package/test_package.c @@ -0,0 +1,79 @@ +/* + Copyright (C) 2014 Francesc Alted + http://blosc.org + License: MIT (see LICENSE.txt) + Example program demonstrating use of the Blosc filter from C code. + To compile this program: + $ gcc simple.c -o simple -lblosc + or, if you don't have the blosc library installed: + $ gcc -O3 -msse2 simple.c -I../blosc -o simple -L../build/blosc + Using MSVC on Windows: + $ cl /arch:SSE2 /Ox /Fesimple.exe /Iblosc examples\simple.c blosc\blosc.c blosc\blosclz.c blosc\shuffle.c blosc\shuffle-sse2.c blosc\shuffle-generic.c blosc\bitshuffle-generic.c blosc\bitshuffle-sse2.c + To run: + $ ./simple + Blosc version info: 1.4.2.dev ($Date:: 2014-07-08 #$) + Compression: 4000000 -> 158494 (25.2x) + Decompression succesful! + Succesful roundtrip! +*/ + +#include + +#include + +#define SIZE 100*100*100 + +int main(){ + static float data[SIZE]; + static float data_out[SIZE]; + static float data_dest[SIZE]; + int isize = SIZE*sizeof(float), osize = SIZE*sizeof(float); + int dsize = SIZE*sizeof(float), csize; + int i; + + for(i=0; i %d (%.1fx)\n", isize, csize, (1.*isize) / csize); + + /* Decompress */ + dsize = blosc_decompress(data_out, data_dest, dsize); + if (dsize < 0) { + printf("Decompression error. Error code: %d\n", dsize); + return dsize; + } + + printf("Decompression succesful!\n"); + + /* After using it, destroy the Blosc environment */ + blosc_destroy(); + + for(i=0;i= "2.4.1": + self.tool_requires("cmake/[>=3.16.3 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["BLOSC_IS_SUBPROJECT"] = False + tc.cache_variables["BLOSC_INSTALL"] = True + tc.cache_variables["BUILD_STATIC"] = not bool(self.options.shared) + tc.cache_variables["BUILD_SHARED"] = bool(self.options.shared) + tc.cache_variables["BUILD_TESTS"] = False + tc.cache_variables["BUILD_FUZZERS"] = False + tc.cache_variables["BUILD_BENCHMARKS"] = False + tc.cache_variables["BUILD_EXAMPLES"] = False + simd_intrinsics = self.options.get_safe("simd_intrinsics", False) + tc.cache_variables["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" + tc.cache_variables["DEACTIVATE_LZ4"] = not bool(self.options.with_lz4) + tc.cache_variables["PREFER_EXTERNAL_LZ4"] = True + tc.cache_variables["DEACTIVATE_ZLIB"] = self.options.with_zlib is None + tc.cache_variables["PREFER_EXTERNAL_ZLIB"] = True + tc.cache_variables["DEACTIVATE_ZSTD"] = not bool(self.options.with_zstd) + tc.cache_variables["PREFER_EXTERNAL_ZSTD"] = True + tc.cache_variables["BUILD_PLUGINS"] = bool(self.options.with_plugins) + if self.options.with_zlib == "zlib-ng-compat": + tc.preprocessor_definitions["ZLIB_COMPAT"] = "1" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + for filename in glob.glob(os.path.join(self.source_folder, "cmake", "Find*.cmake")): + if os.path.basename(filename) not in [ + "FindSIMD.cmake", + ]: + rm(self, os.path.basename(filename), os.path.join(self.source_folder, "cmake")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + licenses = ["BLOSC.txt", "BITSHUFFLE.txt", "FASTLZ.txt", "LZ4.txt", "ZLIB.txt", "STDINT.txt"] + for license_file in licenses: + copy(self, pattern=license_file, dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) + + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # Remove MS runtime files + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, pattern=dll_pattern_to_remove, folder=os.path.join(self.package_folder, "bin"), recursive=True) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "blosc2") + + prefix = "lib" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}blosc2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["rt", "m", "pthread"] diff --git a/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..cef3c154b1ab2 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch @@ -0,0 +1,127 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bd8cb34..9c4cfe0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,7 +68,8 @@ if(NOT WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + endif() + +-cmake_minimum_required(VERSION 3.16.3) ++## TODO: dirty fix. ++cmake_minimum_required(VERSION 3.15) + if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.4) + cmake_policy(SET CMP0063 NEW) + endif() +@@ -144,26 +145,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) +@@ -184,7 +185,7 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(ZSTD) ++ find_package(zstd) + if(NOT ZSTD_FOUND) + message(STATUS "No ZSTD library found. Using internal sources.") + endif() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index 7f3eac6..c7afecd 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.3) + 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.4.1-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..565d775f0be52 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch @@ -0,0 +1,119 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 866c7f6..c2e2501 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) ++ 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,8 +184,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 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.6.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..5c30c1a180c48 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch @@ -0,0 +1,122 @@ +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 new file mode 100644 index 0000000000000..4ca392bba22b4 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch @@ -0,0 +1,119 @@ +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/all/test_package/CMakeLists.txt b/recipes/c-blosc2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4e3319b05a4f0 --- /dev/null +++ b/recipes/c-blosc2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package LANGUAGES C) + +find_package(c-blosc2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE c-blosc2::c-blosc2) diff --git a/recipes/c-blosc2/all/test_package/conanfile.py b/recipes/c-blosc2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/c-blosc2/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/c-blosc2/all/test_package/test_package.c b/recipes/c-blosc2/all/test_package/test_package.c new file mode 100644 index 0000000000000..754d85bde8768 --- /dev/null +++ b/recipes/c-blosc2/all/test_package/test_package.c @@ -0,0 +1,114 @@ +/* + Copyright (C) 2014 Francesc Alted + http://blosc.org + License: MIT (see LICENSE.txt) + Example program demonstrating use of the Blosc filter from C code. + To compile this program: + $ gcc simple.c -o simple -lblosc + or, if you don't have the blosc library installed: + $ gcc -O3 -msse2 simple.c -I../blosc -o simple -L../build/blosc + Using MSVC on Windows: + $ cl /arch:SSE2 /Ox /Fesimple.exe /Iblosc examples\simple.c blosc\blosc.c blosc\blosclz.c blosc\shuffle.c blosc\shuffle-sse2.c blosc\shuffle-generic.c blosc\bitshuffle-generic.c blosc\bitshuffle-sse2.c + To run: + $ ./simple + Blosc version info: 1.4.2.dev ($Date:: 2014-07-08 #$) + Compression: 4000000 -> 158494 (25.2x) + Decompression succesful! + Succesful roundtrip! +*/ + +#include "blosc2.h" + +#include + +#define SIZE 100*100*100 + +int main(){ + static float data[SIZE]; + static float data_out[SIZE]; + static float data_dest[SIZE]; + int isize = SIZE*sizeof(float), osize = SIZE*sizeof(float); + int dsize = SIZE*sizeof(float), csize; + int i; + + for(i=0; i %d (%.1fx)\n", isize, csize, (1.*isize) / csize); + + /* Decompress */ + dsize = blosc_decompress(data_out, data_dest, dsize); + if (dsize < 0) { + printf("Decompression error. Error code: %d\n", dsize); + return dsize; + } + + printf("Decompression succesful!\n"); + + /* After using it, destroy the Blosc environment */ + blosc_destroy(); +#else + /* Register the filter with the library */ + printf("Blosc version info: %s (%s)\n", + BLOSC2_VERSION_STRING, BLOSC2_VERSION_DATE); + + /* Initialize the Blosc compressor */ + blosc2_init(); + + /* Compress with clevel=5 and shuffle active */ + csize = blosc2_compress(5, 1, sizeof(float), data, isize, data_out, osize); + if (csize == 0) { + printf("Buffer is uncompressible. Giving up.\n"); + return 1; + } + else if (csize < 0) { + printf("Compression error. Error code: %d\n", csize); + return csize; + } + + printf("Compression: %d -> %d (%.1fx)\n", isize, csize, (1.*isize) / csize); + + /* Decompress */ + dsize = blosc2_decompress(data_out, osize, data_dest, dsize); + if (dsize < 0) { + printf("Decompression error. Error code: %d\n", dsize); + return dsize; + } + + printf("Decompression succesful!\n"); + + /* After using it, destroy the Blosc environment */ + blosc2_destroy(); +#endif + + + for(i=0;i\n#include ", + "#include \n#include " + ) + target = "osx" if self.settings.os == "Macos" else "slx" + # NOTE: only one job is used, because there are issues with dependency + # tracking in parallel builds + args = ["IP=6", "-j1"] + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make(target=target, args=args) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + self._build_unix() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # Install headers (headers in build tree are symlinks) + include_folder = os.path.join(self.package_folder, "include", "c-client") + mkdir(self, include_folder) + for header_path in glob.glob(os.path.join(self.source_folder, "c-client", "*.h")): + # conan.tools.files.copy can't be used because it copies symlinks instead of real files + shutil.copy(src=header_path, dst=os.path.join(include_folder, os.path.basename(header_path))) + # Install libs + for lib in ("*.a", "*.lib"): + copy(self, lib, src=os.path.join(self.source_folder, "c-client"), dst=os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["cclient" if is_msvc(self) else "c-client"] + if self.settings.os != "Windows": + self.cpp_info.defines = ["_DEFAULT_SOURCE"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["winmm", "ws2_32", "secur32", "crypt32"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["crypt"] diff --git a/recipes/c-client/all/patches/0001-fix-yunchan-tempfile.patch b/recipes/c-client/all/patches/0001-fix-yunchan-tempfile.patch new file mode 100644 index 0000000000000..043b44a640ead --- /dev/null +++ b/recipes/c-client/all/patches/0001-fix-yunchan-tempfile.patch @@ -0,0 +1,68 @@ +--- src/osdep/nt/yunchan.c ++++ src/osdep/nt/yunchan.c +@@ -219,6 +219,34 @@ + * I would be delighted to have a better alternative. + */ + ++/* Fixes the above regret :-) */ ++static FILE *win_create_tempfile (char *name) ++{ ++ HANDLE handle = INVALID_HANDLE_VALUE; ++ int descriptor = -1; ++ FILE *result = NIL; ++ ++ handle = CreateFileA (name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_DELETE, ++ NIL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NIL); ++ if (handle == INVALID_HANDLE_VALUE) return NIL; ++ ++ descriptor = _open_osfhandle ((intptr_t) handle, 0); ++ if (descriptor == -1) goto cleanup_handle; ++ ++ result = _fdopen (descriptor, "w+b"); ++ if (result == NIL) goto cleanup_descriptor; ++ ++ return result; ++ ++cleanup_descriptor: ++ _close (descriptor); ++ return NIL; ++ ++cleanup_handle: ++ CloseHandle (handle); ++ return NIL; ++} ++ + #undef fclose /* use the real fclose() in close_file() */ + + /* Substitute for Microsoft's tmpfile() that uses the real temporary directory +@@ -229,11 +257,8 @@ + { + FILE *ret = NIL; + char *s = _tempnam (getenv ("TEMP"),"msg"); +- if (s) { /* if got temporary name... */ +- /* open file, and stash name on _tmpfname */ +- if (ret = fopen (s,"w+b")) ret->_tmpfname = s; +- else fs_give ((void **) &s);/* flush temporary string */ +- } ++ if (s) ret = win_create_tempfile (s); ++ fs_give ((void **) &s); + return ret; + } + +@@ -244,15 +269,7 @@ + + int close_file (FILE *stream) + { +- int ret; +- char *s = stream->_tmpfname; +- stream->_tmpfname = NIL; /* just in case fclose() tries to delete it */ +- ret = fclose (stream); /* close the file */ +- if (s) { /* was there a _tmpfname? */ +- unlink (s); /* yup, delete it */ +- fs_give ((void **) &s); /* and flush the name */ +- } +- return ret; ++ return fclose (stream); + } + + /* Get password from console diff --git a/recipes/c-client/all/patches/0002-fix-makefile-w2k.patch b/recipes/c-client/all/patches/0002-fix-makefile-w2k.patch new file mode 100644 index 0000000000000..54dbc5e5b71af --- /dev/null +++ b/recipes/c-client/all/patches/0002-fix-makefile-w2k.patch @@ -0,0 +1,13 @@ +--- src/osdep/nt/makefile.w2k ++++ src/osdep/nt/makefile.w2k +@@ -33,8 +33,8 @@ + CREATEDRIVER = mbx + APPENDDRIVER = unix + OSCOMPAT = /DWIN32 +-VSCOMPAT = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE +-CFLAGS = /MT /W3 /Ox /DCHUNKSIZE=65536 $(OSCOMPAT) $(VSCOMPAT) -nologo /I.. $(EXTRACFLAGS) ++VSCOMPAT = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /D_WINSOCK_DEPRECATED_NO_WARNINGS ++CFLAGS = /DCHUNKSIZE=65536 $(OSCOMPAT) $(VSCOMPAT) /nologo /I.. $(EXTRACFLAGS) + CC = cl + CCLIENTLIB = cclient.lib + diff --git a/recipes/c-client/all/patches/0003-fix-env-nt.patch b/recipes/c-client/all/patches/0003-fix-env-nt.patch new file mode 100644 index 0000000000000..e7df6e1290fb8 --- /dev/null +++ b/recipes/c-client/all/patches/0003-fix-env-nt.patch @@ -0,0 +1,11 @@ +--- src/osdep/nt/env_nt.c ++++ src/osdep/nt/env_nt.c +@@ -167,7 +167,7 @@ + if (suffix) { /* append timezone suffix if desired */ + char *tz; + tzset (); /* get timezone from TZ environment stuff */ +- tz = tzname[daylight ? (((struct tm *) t)->tm_isdst > 0) : 0]; ++ tz = _tzname[_daylight ? (((struct tm *) t)->tm_isdst > 0) : 0]; + if (tz && tz[0]) { + char *s; + for (s = tz; *s; s++) if (*s & 0x80) return; diff --git a/recipes/c-client/all/patches/0004-fix-makefile.patch b/recipes/c-client/all/patches/0004-fix-makefile.patch new file mode 100644 index 0000000000000..85d9ff7b5f18e --- /dev/null +++ b/recipes/c-client/all/patches/0004-fix-makefile.patch @@ -0,0 +1,55 @@ +--- Makefile ++++ Makefile +@@ -422,10 +422,8 @@ + EXTRACFLAGS="$(EXTRACFLAGS) -DMAC_OSX_KLUDGE=1" \ + SPECIALS="SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLCERTS=/System/Library/OpenSSL/certs SSLKEYS=/System/Library/OpenSSL/private GSSINCLUDE=/usr/include GSSLIB=/usr/lib PAMDLFLAGS=-lpam" + +-osx: osxok an +- $(TOUCH) ip6 +- $(BUILD) BUILDTYPE=$@ IP=$(IP6) EXTRAAUTHENTICATORS="$(EXTRAAUTHENTICATORS) gss" \ +- SPECIALS="SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLCERTS=/System/Library/OpenSSL/certs SSLKEYS=/System/Library/OpenSSL/private GSSINCLUDE=/usr/include GSSLIB=/usr/lib" ++osx: an ++ $(BUILD) BUILDTYPE=$@ IP=$(IP6) + + osxok: + @$(SH) -c '(test ! -f /usr/include/pam/pam_appl.h ) || make osxwarn' +@@ -678,7 +676,7 @@ + $(TOOLS)/$@ "$(LN)" src/tmail tmail + $(LN) $(TOOLS)/$@ . + +-build: OSTYPE rebuild rebuildclean bundled ++build: OSTYPE rebuild rebuildclean + + OSTYPE: + @$(MAKE) ip$(IP) +@@ -695,8 +693,8 @@ + $(TOUCH) rebuild + + rebuild: +- @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' +- @echo Rebuilding c-client for `$(CAT) OSTYPE`... ++ @$(SH) -c '(test $(BUILDTYPE) = rebuild) || (echo Already built for $(BUILDTYPE) -- you must do \"make clean\" first && exit 1)' ++ @echo Rebuilding c-client for $(BUILDTYPE)... + @$(TOUCH) SPECIALS + $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \ + CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` +--- src/osdep/unix/Makefile ++++ src/osdep/unix/Makefile +@@ -149,7 +149,7 @@ + + # Normally no need to change any of these + +-ARCHIVE=c-client.a ++ARCHIVE=libc-client.a + BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o \ + dummy.o pseudo.o netmsg.o flstring.o fdstring.o \ + rfc822.o nntp.o smtp.o imap4r1.o pop3.o \ +@@ -935,7 +935,7 @@ + @echo If you get No such file error messages for files x509.h, ssl.h, + @echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL + @echo is not installed on your system. Either install OpenSSL first +- @echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none ++ @echo or build with command: make $(OS) SSLTYPE=none + @echo ======================================================================== + + osdep.so: $(OSDEPS) diff --git a/recipes/c-client/all/patches/2014_openssl1.1.1_sni.patch b/recipes/c-client/all/patches/2014_openssl1.1.1_sni.patch new file mode 100644 index 0000000000000..2f58b0af15099 --- /dev/null +++ b/recipes/c-client/all/patches/2014_openssl1.1.1_sni.patch @@ -0,0 +1,42 @@ +Bug-Debian: https://bugs.debian.org/916041 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1834340 +Description: + Google IMAP servers require SNI if TLSv1.3 is used, + otherwise it sends a self-signed certificate which + fails validation. + + OpenSSL support/versions: + - TLSv1.3 on 1.1.1, + - a2i_IPADDRESS() on 0.9.8'ish, + - SSL_set_tlsext_host_name() on 0.9.8'ish/1.0.0; + per 'git blame/describe' and the CHANGES file. + + So check for TLSv1.3 support / OpenSSL 1.1.1 + not to incur behavior changes on pre-TLSv1.3, + and set host_name to 'host' (ssl_open_verify() + validates this, via 'ssl_last_host' variable) + + This patch just combines these two patches: + - BTS#916041 (message #5) by Ed Spiridonov, + - LP#1834340 (comment #6) by David Zuelke. +Author: Mauricio Faria de Oliveira + +Index: uw-imap-2007f~dfsg/src/osdep/unix/ssl_unix.c +=================================================================== +--- src/osdep/unix/ssl_unix.c ++++ src/osdep/unix/ssl_unix.c +@@ -266,6 +266,14 @@ static char *ssl_start_work (SSLSTREAM * + /* create connection */ + if (!(stream->con = (SSL *) SSL_new (stream->context))) + return "SSL connection failed"; ++#if OPENSSL_VERSION_NUMBER >= 0x10101000 ++ /* Use SNI in case server requires it with TLSv1.3. ++ * Literal IP addresses not permitted per RFC 6066. */ ++ if (!a2i_IPADDRESS(host)) { ++ ERR_clear_error(); ++ SSL_set_tlsext_host_name(stream->con,host); ++ } ++#endif + bio = BIO_new_socket (stream->tcpstream->tcpsi,BIO_NOCLOSE); + SSL_set_bio (stream->con,bio,bio); + SSL_set_connect_state (stream->con); diff --git a/recipes/c-client/all/test_package/CMakeLists.txt b/recipes/c-client/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0ae631dc1d0fb --- /dev/null +++ b/recipes/c-client/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(c-client REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE c-client::c-client) diff --git a/recipes/c-client/all/test_package/conanfile.py b/recipes/c-client/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/c-client/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/c-client/all/test_package/test_package.c b/recipes/c-client/all/test_package/test_package.c new file mode 100644 index 0000000000000..0edeebbf26ec6 --- /dev/null +++ b/recipes/c-client/all/test_package/test_package.c @@ -0,0 +1,34 @@ +#include +#include + +/* These symbols are left undefined in the library and are expected to be + * defined by a consumer */ +void mm_searched(MAILSTREAM* stream, unsigned long number) {} +void mm_exists(MAILSTREAM* stream, unsigned long number) {} +void mm_expunged(MAILSTREAM* stream, unsigned long number) {} +void mm_flags(MAILSTREAM* stream, unsigned long number) {} +void mm_notify(MAILSTREAM* stream, char* string, long errflg) {} +void mm_list(MAILSTREAM* stream, int delimiter, char* name, long attributes) {} +void mm_lsub(MAILSTREAM* stream, int delimiter, char* name, long attributes) {} +void mm_status(MAILSTREAM* stream, char* mailbox, MAILSTATUS* status) {} +void mm_log(char* string, long errflg) {} +void mm_dlog(char* string) {} +void mm_login(NETMBX* mb, char* user, char* pwd, long trial) {} +void mm_critical(MAILSTREAM* stream) {} +void mm_nocritical(MAILSTREAM* stream) {} +long mm_diskerror(MAILSTREAM* stream, long errcode, long serious) +{ + return 0; +} +void mm_fatal(char* string) {} + +int main(int argc, char const* argv[]) +{ + (void)argc; + (void)argv; + + MAILHANDLE* dummy = NULL; + mail_free_handle(&dummy); + + return 0; +} diff --git a/recipes/c-client/all/test_v1_package/CMakeLists.txt b/recipes/c-client/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/c-client/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/c-client/all/test_v1_package/conanfile.py b/recipes/c-client/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/c-client/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/c-client/config.yml b/recipes/c-client/config.yml new file mode 100644 index 0000000000000..d5b2e9f3dbe4f --- /dev/null +++ b/recipes/c-client/config.yml @@ -0,0 +1,3 @@ +versions: + "2007f": + folder: all diff --git a/recipes/c-dbg-macro/all/conandata.yml b/recipes/c-dbg-macro/all/conandata.yml new file mode 100644 index 0000000000000..996d14e84ce29 --- /dev/null +++ b/recipes/c-dbg-macro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.12.1": + url: https://github.com/eerimoq/dbg-macro/archive/0.12.1.tar.gz + sha256: 8567730747c8f18cf01748819ebd178bcd9f9ca54431e124b9fda9f0616db751 diff --git a/recipes/c-dbg-macro/all/conanfile.py b/recipes/c-dbg-macro/all/conanfile.py new file mode 100644 index 0000000000000..d30bb72e433f7 --- /dev/null +++ b/recipes/c-dbg-macro/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.46.0" + +class DbgMacroConan(ConanFile): + name = "c-dbg-macro" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eerimoq/dbg-macro" + license = "MIT" + description = "A dbg(...) macro for C" + topics = ("debugging", "macro", "pretty-printing", "header-only") + settings = ("compiler", "build_type", "os", "arch") + no_copy_source = True + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("This library is not compatible with Windows") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "dbg.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + + + def package_id(self): + self.info.clear() diff --git a/recipes/c-dbg-macro/all/test_package/CMakeLists.txt b/recipes/c-dbg-macro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c764c0709047b --- /dev/null +++ b/recipes/c-dbg-macro/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(c-dbg-macro REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE c-dbg-macro::c-dbg-macro) diff --git a/recipes/c-dbg-macro/all/test_package/conanfile.py b/recipes/c-dbg-macro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/c-dbg-macro/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/c-dbg-macro/all/test_package/test_package.c b/recipes/c-dbg-macro/all/test_package/test_package.c new file mode 100644 index 0000000000000..8319756f0fcce --- /dev/null +++ b/recipes/c-dbg-macro/all/test_package/test_package.c @@ -0,0 +1,30 @@ +#include +#include + +static int factorial(int n) +{ + if (dbgb(n <= 1)) { + return dbg(1); + } else { + return dbg(n * factorial(n - 1)); + } +} + +int main() +{ + char message[] = "hello"; + dbg(message); // main.c:15: message = "hello" + dbgh(message, sizeof(message)); + + const int a = 2; + const int b = dbg(3 * a) + 1; // main.c:19: 3 * a = 6 (0x6) + + int numbers[2] = { b, 13 }; + dbga(numbers, 2); // main.c:22: numbers = [7, 13] (length: 2) + + dbg(factorial(4)); + dbge(-EINVAL); + dbgbt(); + + return 0; +} diff --git a/recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt b/recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c9e7ffdd2a28 --- /dev/null +++ b/recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package ../test_package/test_package.c) diff --git a/recipes/c-dbg-macro/all/test_v1_package/conanfile.py b/recipes/c-dbg-macro/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c795b378cca50 --- /dev/null +++ b/recipes/c-dbg-macro/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" + + 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/c-dbg-macro/config.yml b/recipes/c-dbg-macro/config.yml new file mode 100644 index 0000000000000..f7f11eb2dea71 --- /dev/null +++ b/recipes/c-dbg-macro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12.1": + folder: "all" diff --git a/recipes/c4core/all/conandata.yml b/recipes/c4core/all/conandata.yml new file mode 100644 index 0000000000000..ab9592ebfbdbe --- /dev/null +++ b/recipes/c4core/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "0.1.11": + url: "https://github.com/biojppm/c4core/releases/download/v0.1.11/c4core-0.1.11-src.tgz" + sha256: "67f4443f3742424f42453594e26e656f616dddfcf225a1d810e00473a741408c" + "0.1.10": + url: "https://github.com/biojppm/c4core/releases/download/v0.1.10/c4core-0.1.10-src.tgz" + sha256: "e8ab4dedd0e20f86af7c69527cfbe8bc1cf72c84b7fbc0cfd420656f28ae20b2" + "0.1.9": + url: "https://github.com/biojppm/c4core/releases/download/v0.1.9/c4core-0.1.9-src.tgz" + sha256: "818d82456b640d88527fe517e1fef88fe45d8fffb414492eddf54480ee222449" + "0.1.8": + url: "https://github.com/biojppm/c4core/releases/download/v0.1.8/c4core-0.1.8-src.tgz" + sha256: "95c0663192c6bff7a098b50afcb05d22a34dd0fd8e6be2e1b61edad2b9675fde" +patches: + "0.1.11": + - patch_file: "patches/0.1.11-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.1.10": + - patch_file: "patches/0.1.10-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.1.9": + - patch_file: "patches/0.1.9-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.1.8": + - patch_file: "patches/0.1.8-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" diff --git a/recipes/c4core/all/conanfile.py b/recipes/c4core/all/conanfile.py new file mode 100644 index 0000000000000..08b0f78e6b940 --- /dev/null +++ b/recipes/c4core/all/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir, apply_conandata_patches, export_conandata_patches +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 C4CoreConan(ConanFile): + name = "c4core" + description = ( + "c4core is a library of low-level C++ utilities, written with " + "low-latency projects in mind." + ) + license = "MIT", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/biojppm/c4core" + topics = ("utilities", "low-latency", ) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_fast_float": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_fast_float": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_fast_float: + self.requires("fast_float/4.0.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + + ## clang with libc++ is not supported. It is already fixed since 0.1.9. + if Version(self.version) <= "0.1.8": + if self.settings.compiler in ["clang", "apple-clang"] and \ + self.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang with libc++") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["C4CORE_WITH_FASTFLOAT"] = bool(self.options.with_fast_float) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.natvis", os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.libs = ["c4core"] + if not self.options.with_fast_float: + self.cpp_info.defines.append("C4CORE_NO_FAST_FLOAT") + + self.cpp_info.set_property("cmake_file_name", "c4core") + self.cpp_info.set_property("cmake_target_name", "c4core::c4core") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..a530b3907baca --- /dev/null +++ b/recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2450e1..3f52516 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -72,7 +72,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -92,7 +91,10 @@ c4_add_library(c4core + 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() + +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-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/all/patches/0.1.11-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..7532d129ab080 --- /dev/null +++ b/recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 1207d1b..20ffe96 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -73,7 +73,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -92,7 +91,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/a/src/c4/ext/fast_float.hpp b/b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/a/src/c4/ext/fast_float.hpp ++++ b/b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-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/all/patches/0.1.8-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..1e139fba70445 --- /dev/null +++ b/recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5bc4b09..ee7a0d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,7 +69,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -89,7 +88,10 @@ c4_add_library(c4core + 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() + +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-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/all/patches/0.1.9-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..ae4e2acd03d15 --- /dev/null +++ b/recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index e9412de..7d11193 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -72,7 +72,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -92,7 +91,10 @@ c4_add_library(c4core + 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() + +diff --git a/a/src/c4/ext/fast_float.hpp b/b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/a/src/c4/ext/fast_float.hpp ++++ b/b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-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/all/test_package/CMakeLists.txt b/recipes/c4core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e0b34e28e562b --- /dev/null +++ b/recipes/c4core/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(c4core REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE c4core::c4core) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/c4core/all/test_package/conanfile.py b/recipes/c4core/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/c4core/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/c4core/all/test_package/test_package.cpp b/recipes/c4core/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0859f030295f4 --- /dev/null +++ b/recipes/c4core/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "c4/std/std.hpp" +#include "c4/charconv.hpp" + +#include + +auto main( int argc, char* argv[]) -> int { + double value; + c4::from_chars("52.4354", &value); + + std::cout << value << std::endl; + + return 0; +} diff --git a/recipes/c4core/all/test_v1_package/CMakeLists.txt b/recipes/c4core/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/c4core/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/c4core/all/test_v1_package/conanfile.py b/recipes/c4core/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/c4core/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/c4core/config.yml b/recipes/c4core/config.yml new file mode 100644 index 0000000000000..b3f909b6c9664 --- /dev/null +++ b/recipes/c4core/config.yml @@ -0,0 +1,9 @@ +versions: + "0.1.11": + folder: all + "0.1.10": + folder: all + "0.1.9": + folder: all + "0.1.8": + folder: all diff --git a/recipes/caf/all/conandata.yml b/recipes/caf/all/conandata.yml new file mode 100644 index 0000000000000..71354ad6bae80 --- /dev/null +++ b/recipes/caf/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.18.6": + url: "https://github.com/actor-framework/actor-framework/archive/0.18.6.tar.gz" + sha256: "c2ead63a0322d992fea8813a7f7d15b4d16cbb8bbe026722f2616a79109b91cc" + "0.18.5": + url: "https://github.com/actor-framework/actor-framework/archive/0.18.5.tar.gz" + sha256: "4c96f896f000218bb65890b4d7175451834add73750d5f33b0c7fe82b7d5a679" + "0.18.2": + url: "https://github.com/actor-framework/actor-framework/archive/0.18.2.tar.gz" + sha256: "03837dbef73a13c3e4cac76c009d018f48d1d97b182277230f204984c9542ccc" + "0.18.0": + url: "https://github.com/actor-framework/actor-framework/archive/0.18.0.tar.gz" + sha256: "df765fa78861e67d44e2587c0ac0c1c662d8c93fe5ffc8757f552fc7ac15941f" diff --git a/recipes/caf/all/conanfile.py b/recipes/caf/all/conanfile.py new file mode 100644 index 0000000000000..7a5cb98c5ded6 --- /dev/null +++ b/recipes/caf/all/conanfile.py @@ -0,0 +1,140 @@ +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.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class CAFConan(ConanFile): + name = "caf" + description = "An open source implementation of the Actor Model in C++" + 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" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "log_level": ["error", "warning", "info", "debug", "trace", "quiet"], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "log_level": "quiet", + "with_openssl": True, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "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", + } + + 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 self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) > "10.0" and \ + self.settings.arch == "x86": + raise ConanInvalidConfiguration("clang >= 11.0 does not support x86") + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Shared libraries are not supported on Windows") + if self.options.with_openssl and self.settings.os == "Windows" and self.settings.arch == "x86": + raise ConanInvalidConfiguration("OpenSSL is not supported for Windows x86") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.variables["CAF_ENABLE_OPENSSL_MODULE"] = self.options.with_openssl + tc.variables["CAF_ENABLE_EXAMPLES"] = False + tc.variables["CAF_ENABLE_TOOLS"] = False + tc.variables["CAF_ENABLE_TESTING"] = False + tc.variables["CAF_LOG_LEVEL"] = self.options.log_level.value.upper() + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CAF") + + self.cpp_info.components["caf_core"].set_property("cmake_target_name", "CAF::core") + self.cpp_info.components["caf_core"].libs = ["caf_core"] + if self.settings.os == "Windows": + self.cpp_info.components["caf_core"].system_libs = ["iphlpapi"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["caf_core"].system_libs = ["pthread", "m"] + + self.cpp_info.components["caf_io"].set_property("cmake_target_name", "CAF::io") + self.cpp_info.components["caf_io"].libs = ["caf_io"] + self.cpp_info.components["caf_io"].requires = ["caf_core"] + if self.settings.os == "Windows": + self.cpp_info.components["caf_io"].system_libs = ["ws2_32"] + + if self.options.with_openssl: + self.cpp_info.components["caf_openssl"].set_property("cmake_target_name", "CAF::openssl") + self.cpp_info.components["caf_openssl"].libs = ["caf_openssl"] + self.cpp_info.components["caf_openssl"].requires = ["caf_io", "openssl::openssl"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "CAF" + self.cpp_info.names["cmake_find_package_multi"] = "CAF" + self.cpp_info.components["caf_core"].names["cmake_find_package"] = "core" + self.cpp_info.components["caf_core"].names["cmake_find_package_multi"] = "core" + self.cpp_info.components["caf_io"].names["cmake_find_package"] = "io" + self.cpp_info.components["caf_io"].names["cmake_find_package_multi"] = "io" + if self.options.with_openssl: + self.cpp_info.components["caf_openssl"].names["cmake_find_package"] = "openssl" + self.cpp_info.components["caf_openssl"].names["cmake_find_package_multi"] = "openssl" diff --git a/recipes/caf/all/test_package/CMakeLists.txt b/recipes/caf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ef7e73d1a37d --- /dev/null +++ b/recipes/caf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(CAF REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CAF::core CAF::io CAF::openssl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/caf/all/test_package/conanfile.py b/recipes/caf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/caf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/caf/all/test_package/test_package.cpp b/recipes/caf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d0e4b736bca46 --- /dev/null +++ b/recipes/caf/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +#include +#include + +#include "caf/all.hpp" +#include "caf/io/middleman.hpp" +#include "caf/openssl/manager.hpp" + +using namespace caf; + +behavior mirror(event_based_actor* self) { + // return the (initial) actor behavior + return { + // a handler for messages containing a single string + // that replies with a string + [=](const std::string& what) -> std::string { + // prints "Hello World!" via aout (thread-safe cout wrapper) + aout(self) << what << std::endl; + // reply "!dlroW olleH" + return std::string{what.rbegin(), what.rend()}; + }, + }; +} + +void hello_world(event_based_actor* self, const actor& buddy) { + // send "Hello World!" to our buddy ... + self->request(buddy, std::chrono::seconds(10), "Hello World!") + .then( + // ... wait up to 10s for a response ... + [=](const std::string& what) { + // ... and print it + aout(self) << what << std::endl; + }); +} + +void caf_main(actor_system& sys) { + // create a new actor that calls 'mirror()' + auto mirror_actor = sys.spawn(mirror); + // create another actor that calls 'hello_world(mirror_actor)'; + sys.spawn(hello_world, mirror_actor); + // the system will wait until both actors are done before exiting the program +} + +// creates a main function for us that calls our caf_main +CAF_MAIN(caf::io::middleman, caf::openssl::manager) diff --git a/recipes/caf/all/test_v1_package/CMakeLists.txt b/recipes/caf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/caf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/caf/all/test_v1_package/conanfile.py b/recipes/caf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/caf/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/caf/config.yml b/recipes/caf/config.yml new file mode 100644 index 0000000000000..1e73f6993a454 --- /dev/null +++ b/recipes/caf/config.yml @@ -0,0 +1,9 @@ +versions: + "0.18.6": + folder: all + "0.18.5": + folder: all + "0.18.2": + folder: all + "0.18.0": + folder: all diff --git a/recipes/cairo/all/conandata.yml b/recipes/cairo/all/conandata.yml new file mode 100644 index 0000000000000..a2d821e85845f --- /dev/null +++ b/recipes/cairo/all/conandata.yml @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000000000..1ee19505ae145 --- /dev/null +++ b/recipes/cairo/all/conanfile.py @@ -0,0 +1,340 @@ +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 = ("cairo", "graphics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cairographics.org/" + license = ("LGPL-2.1-only", "MPL-1.1") + 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.13.93") + if self.settings.os == "Linux": + if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: + self.requires("xorg/system") + if self.options.get_safe("with_glib", True): + self.requires("glib/2.76.1") + self.requires("zlib/1.2.13") + self.requires("pixman/0.40.0") + self.requires("libpng/1.6.39") + + 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 new file mode 100644 index 0000000000000..1554d7bb38ba6 --- /dev/null +++ b/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch @@ -0,0 +1,155 @@ +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 new file mode 100644 index 0000000000000..197f3fbc3cad0 --- /dev/null +++ b/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch @@ -0,0 +1,43 @@ +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 new file mode 100644 index 0000000000000..4f33d55898eb2 --- /dev/null +++ b/recipes/cairo/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..e904c93b97465 --- /dev/null +++ b/recipes/cairo/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 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 new file mode 100644 index 0000000000000..5854291cea177 --- /dev/null +++ b/recipes/cairo/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#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 new file mode 100644 index 0000000000000..692a4909c85a7 --- /dev/null +++ b/recipes/cairo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000000000..24f9e474d6cd2 --- /dev/null +++ b/recipes/cairo/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, 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 new file mode 100644 index 0000000000000..248b8521fe8ea --- /dev/null +++ b/recipes/cairo/config.yml @@ -0,0 +1,9 @@ +versions: + "1.17.6": + folder: meson + "1.17.4": + folder: meson + "1.17.2": + folder: all + "1.16.0": + folder: all diff --git a/recipes/cairo/meson/conandata.yml b/recipes/cairo/meson/conandata.yml new file mode 100644 index 0000000000000..da5f931250975 --- /dev/null +++ b/recipes/cairo/meson/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.17.6": + sha256: "90496d135c9ef7612c98f8ee358390cdec0825534573778a896ea021155599d2" + url: "https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.17.6/cairo-1.17.6.tar.bz2" + "1.17.4": + url: + - "https://www.cairographics.org/snapshots/cairo-1.17.4.tar.xz" + - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.17.4.tar.xz" + sha256: "74b24c1ed436bbe87499179a3b27c43f4143b8676d8ad237a6fa787401959705" +patches: + "1.17.4": + - patch_file: "patches/binutils-2.34-libbfd-fix.patch" + patch_type: "backport" + patch_description: "fix build with newer versions of bfd" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e30259f6237571c61992433c110bc6e1ef900244" + base_path: "util/cairo-trace" + - patch_file: "patches/cairo-1.17.4-trace-cflags-fix.patch" + patch_type: "conan" + patch_description: | + Add missing 'PACKAGE' and 'PACKAGE_VERSION' defines for libbfd headers included by 'lookup-symbol.c'. + base_path: "util/cairo-trace" + - patch_file: "patches/cairo-1.17.4-xlib-xrender-option.patch" + patch_type: "conan" + patch_description: >- + This patch adds option to enable or disable xlib-xrender component. + Without it 'xrender' is always required when 'xlib' option is enabled. @sh0 + - patch_file: "patches/cairo-1.17.4-symbol-lookup-backport.patch" + patch_type: "backport" + patch_description: "add symbol-lookup option to allow disabling bfd/libiberty usage" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e0cf7b869fb1c6b73cf4a9aad2fc8aea4ff1f6ee" + - patch_file: "patches/cairo-1.17.4-encoding-backport.patch" + patch_type: "backport" + patch_description: "use encoding=utf-8 when reading/writing files in helper script" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/9732f4e80f906fab85b97ae55ee44bfd3ee4945e" diff --git a/recipes/cairo/meson/conanfile.py b/recipes/cairo/meson/conanfile.py new file mode 100644 index 0000000000000..9eb330e00f07b --- /dev/null +++ b/recipes/cairo/meson/conanfile.py @@ -0,0 +1,360 @@ +import glob +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.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rename, + replace_in_file, + rm, + rmdir) +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import MesonToolchain, Meson +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class CairoConan(ConanFile): + name = "cairo" + description = "Cairo is a 2D graphics library with support for multiple output devices" + topics = ("cairo", "graphics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cairographics.org/" + license = ("LGPL-2.1-only", "MPL-1.1") + 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], + "with_lzo": [True, False], + "with_zlib": [True, False], + "with_png": [True, False], + "with_opengl": [False, "desktop", "gles2", "gles3"], + "with_symbol_lookup": [True, False], + "tee": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_freetype": True, + "with_fontconfig": True, + "with_xlib": True, + "with_xlib_xrender": True, + "with_xcb": True, + "with_glib": True, + "with_lzo": True, + "with_zlib": True, + "with_png": True, + "with_opengl": "desktop", + "with_symbol_lookup": False, + "tee": False, + } + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.with_xlib + del self.options.with_xlib_xrender + del self.options.with_xcb + del self.options.with_symbol_lookup + if self.settings.os in ["Macos", "Windows"]: + del self.options.with_opengl + + 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_glib and self.options.shared: + self.options["glib"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("pixman/0.40.0") + if self.options.with_zlib and self.options.with_png: + self.requires("expat/2.5.0") + if self.options.with_lzo: + self.requires("lzo/2.10") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_freetype: + self.requires("freetype/2.13.0") + if self.options.with_fontconfig: + self.requires("fontconfig/2.13.93") + if self.options.with_png: + self.requires("libpng/1.6.39") + if self.options.with_glib: + self.requires("glib/2.76.1") + 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_opengl") == "desktop": + self.requires("opengl/system") + if self.settings.os == "Windows": + self.requires("glext/cci.20210420") + self.requires("wglext/cci.20200813") + self.requires("khrplatform/cci.20200529") + if self.options.get_safe("with_opengl") and self.settings.os in ["Linux", "FreeBSD"]: + self.requires("egl/system") + + def package_id(self): + if self.info.options.with_glib and not self.dependencies["glib"].options.shared: + self.info.requires["glib"].full_package_mode() + + def validate(self): + if self.options.get_safe("with_xlib_xrender") and not self.options.get_safe("with_xlib"): + raise ConanInvalidConfiguration("'with_xlib_xrender' option requires 'with_xlib' option to be enabled as well!") + if self.options.with_glib: + if self.dependencies["glib"].options.shared: + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + elif self.options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + def is_enabled(value): + return "enabled" if value else "disabled" + + env = VirtualBuildEnv(self) + env.generate() + + pkg_deps = PkgConfigDeps(self) + pkg_deps.generate() + + options = dict() + options["tests"] = "disabled" + options["zlib"] = is_enabled(self.options.with_zlib) + options["png"] = is_enabled(self.options.with_png) + options["freetype"] = is_enabled(self.options.with_freetype) + options["fontconfig"] = is_enabled(self.options.with_fontconfig) + if self.settings.os == "Linux": + options["xcb"] = is_enabled(self.options.with_xcb) + options["xlib"] = is_enabled(self.options.with_xlib) + else: + options["xcb"] = "disabled" + options["xlib"] = "disabled" + if self.options.get_safe("with_opengl") == "desktop": + options["gl-backend"] = "gl" + elif self.options.get_safe("with_opengl") == "gles2": + options["gl-backend"] = "glesv2" + elif self.options.get_safe("with_opengl") == "gles3": + options["gl-backend"] = "glesv3" + else: + options["gl-backend"] = "disabled" + options["glesv2"] = is_enabled(self.options.get_safe("with_opengl") == "gles2") + options["glesv3"] = is_enabled(self.options.get_safe("with_opengl") == "gles3") + options["tee"] = is_enabled(self.options.tee) + options["symbol-lookup"] = is_enabled(self.options.get_safe("with_symbol_lookup")) + + # future options to add, see meson_options.txt. + # for now, disabling explicitly, to avoid non-reproducible auto-detection of system libs + + version = Version(self.version) + if version < "1.17.6": + options["cogl"] = "disabled" # https://gitlab.gnome.org/GNOME/cogl + options["directfb"] = "disabled" + options["drm"] = "disabled" # not yet compilable in cairo 1.17.4 + options["openvg"] = "disabled" # https://www.khronos.org/openvg/ + options["qt"] = "disabled" # not yet compilable in cairo 1.17.4 + if self.settings.os == "Linux": + options["xlib-xrender"] = is_enabled(self.options.with_xlib_xrender) + + options["gtk2-utils"] = "disabled" + options["spectre"] = "disabled" # https://www.freedesktop.org/wiki/Software/libspectre/ + + meson = MesonToolchain(self) + meson.project_options.update(options) + + if is_apple_os(self) and Version(self.version) < "1.17.6": + # This was fixed in the meson build from 1.17.6 + meson.c_link_args += ["-framework", "ApplicationServices", "-framework", "CoreFoundation"] + + if not self.options.shared: + meson.c_args.append("-DCAIRO_WIN32_STATIC_BUILD") + + meson.generate() + + def build(self): + apply_conandata_patches(self) + + # Dependency freetype2 found: NO found 2.11.0 but need: '>= 9.7.3' + if self.options.with_freetype: + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "freetype_required_version = '>= 9.7.3'", + f"freetype_required_version = '>= {self.dependencies['freetype'].ref.version}'") + meson = Meson(self) + meson.configure() + meson.build() + + def _fix_library_names(self, path): + if is_msvc(self): + for filename_old in glob.glob(os.path.join(path, "*.a")): + root, _ = os.path.splitext(filename_old) + folder, basename = os.path.split(root) + rename(self, filename_old, os.path.join(folder, basename.replace("lib", "") + ".lib")) + + def package(self): + meson = Meson(self) + meson.install() + self._fix_library_names(os.path.join(self.package_folder, "lib")) + copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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) + + def package_info(self): + base_requirements = {"pixman::pixman"} + base_system_libs = {} + + def add_component_and_base_requirements(component, requirements, system_libs=None): + self.cpp_info.components[component].set_property("pkg_config_name", component) + self.cpp_info.components[component].requires += ["cairo_"] + requirements + base_requirements.update(set(requirements)) + if system_libs is not None: + self.cpp_info.components[component].system_libs += system_libs + base_system_libs.update(set(system_libs)) + + 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")) + + if self.settings.os == "Linux": + self.cpp_info.components["cairo_"].system_libs.extend(["m", "dl", "pthread"]) + if self.options.get_safe("with_symbol_lookup"): + self.cpp_info.components["cairo_"].system_libs.append("bfd") + self.cpp_info.components["cairo_"].cflags = ["-pthread"] + self.cpp_info.components["cairo_"].cxxflags = ["-pthread"] + + if self.options.with_lzo: + self.cpp_info.components["cairo_"].requires.append("lzo::lzo") + + if self.options.with_zlib: + self.cpp_info.components["cairo_"].requires.append("zlib::zlib") + + if self.options.with_png: + add_component_and_base_requirements("cairo-png", ["libpng::libpng"]) + add_component_and_base_requirements("cairo-svg", ["libpng::libpng"]) + + if self.options.with_fontconfig: + add_component_and_base_requirements("cairo-fc", ["fontconfig::fontconfig"]) + + if self.options.with_freetype: + add_component_and_base_requirements("cairo-ft", ["freetype::freetype"]) + + if self.options.get_safe("with_xlib"): + add_component_and_base_requirements("cairo-xlib", ["xorg::x11", "xorg::xext"]) + + if self.options.get_safe("with_xlib_xrender"): + add_component_and_base_requirements("cairo-xlib-xrender", ["xorg::xrender"]) + + if self.options.get_safe("with_xcb"): + add_component_and_base_requirements("cairo-xcb", ["xorg::xcb", "xorg::xcb-render"]) + add_component_and_base_requirements("cairo-xcb-shm", ["xorg::xcb", "xorg::xcb-shm"]) + + if self.options.get_safe("with_xlib"): + add_component_and_base_requirements("cairo-xlib-xcb", ["xorg::x11-xcb"]) + + 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-image"].set_property("pkg_config_name", "cairo-quartz-image") + self.cpp_info.components["cairo-quartz-image"].requires = ["cairo_"] + + self.cpp_info.components["cairo-quartz-font"].set_property("pkg_config_name", "cairo-quartz-font") + self.cpp_info.components["cairo-quartz-font"].requires = ["cairo_"] + + self.cpp_info.components["cairo_"].frameworks += ["ApplicationServices", "CoreFoundation", "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_"] + + self.cpp_info.components["cairo-win32-font"].set_property("pkg_config_name", "cairo-win32-font") + self.cpp_info.components["cairo-win32-font"].requires = ["cairo_"] + + 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") + + if self.options.get_safe("with_opengl"): + if self.options.with_opengl == "desktop": + add_component_and_base_requirements("cairo-gl", ["opengl::opengl"]) + + if self.settings.os == "Linux": + add_component_and_base_requirements("cairo-glx", ["opengl::opengl"]) + + if self.settings.os == "Windows": + add_component_and_base_requirements("cairo-wgl", ["glext::glext", "wglext::wglext", "khrplatform::khrplatform"]) + + elif self.options.with_opengl == "gles3": + add_component_and_base_requirements("cairo-glesv3", [], ["GLESv2"]) + elif self.options.with_opengl == "gles2": + add_component_and_base_requirements("cairo-glesv2", [], ["GLESv2"]) + if self.settings.os in ["Linux", "FreeBSD"]: + add_component_and_base_requirements("cairo-egl", ["egl::egl"]) + + if self.options.with_zlib: + add_component_and_base_requirements("cairo-script", ["zlib::zlib"]) + add_component_and_base_requirements("cairo-ps", ["zlib::zlib"]) + add_component_and_base_requirements("cairo-pdf", ["zlib::zlib"]) + self.cpp_info.components["cairo-script-interpreter"].set_property("pkg_config_name", "cairo-script-interpreter") + self.cpp_info.components["cairo-script-interpreter"].libs = ["cairo-script-interpreter"] + self.cpp_info.components["cairo-script-interpreter"].requires = ["cairo_"] + + if self.options.with_png: + add_component_and_base_requirements("cairo-xml", ["zlib::zlib"]) + add_component_and_base_requirements("cairo-util_", ["expat::expat"]) + + if self.options.tee: + self.cpp_info.components["cairo-tee"].set_property("pkg_config_name", "cairo-tee") + self.cpp_info.components["cairo-tee"].requires = ["cairo_"] + + # util directory + if self.options.with_glib: + 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"] + + self.cpp_info.components["cairo_"].requires += list(base_requirements) + self.cpp_info.components["cairo_"].system_libs += list(base_system_libs) diff --git a/recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch b/recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch new file mode 100644 index 0000000000000..197f3fbc3cad0 --- /dev/null +++ b/recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch @@ -0,0 +1,43 @@ +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/meson/patches/cairo-1.17.4-encoding-backport.patch b/recipes/cairo/meson/patches/cairo-1.17.4-encoding-backport.patch new file mode 100644 index 0000000000000..cd4f55bc86ffa --- /dev/null +++ b/recipes/cairo/meson/patches/cairo-1.17.4-encoding-backport.patch @@ -0,0 +1,40 @@ +From 9732f4e80f906fab85b97ae55ee44bfd3ee4945e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= +Date: Tue, 23 Feb 2021 23:42:11 +0000 +Subject: meson: use encoding=utf-8 when reading/writing files in helper script + +Fixes errors such as + +Traceback (most recent call last): + File "C:\Users\...\cairo\test\make-cairo-test-constructors.py", line 19, in + for l in f.readlines(): + File "c:\python39\lib\encodings\cp1253.py", line 23, in decode + return codecs.charmap_decode(input,self.errors,decoding_table)[0] +UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 6694: character maps to + +on non-English-language Windows locales/installations. +--- + boilerplate/make-cairo-boilerplate-constructors.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +(limited to 'boilerplate/make-cairo-boilerplate-constructors.py') + +diff --git a/boilerplate/make-cairo-boilerplate-constructors.py b/boilerplate/make-cairo-boilerplate-constructors.py +index 8e02fa500..40198ed1a 100644 +--- a/boilerplate/make-cairo-boilerplate-constructors.py ++++ b/boilerplate/make-cairo-boilerplate-constructors.py +@@ -16,12 +16,12 @@ if __name__=='__main__': + match_boilerplate_name = re.compile(r'^CAIRO_BOILERPLATE.*\((.*),.*') + + for fname in args.input: +- with open(fname, 'r') as f: ++ with open(fname, 'r', encoding='utf-8') as f: + for l in f.readlines(): + if match_boilerplate_line.match(l): + boilerplate_names.append(match_boilerplate_name.match(l).group(1)) + +- with open(args.output, 'w') as f: ++ with open(args.output, 'w', encoding='utf-8') as f: + f.write('/* WARNING: Autogenerated file - see %s! */\n\n' % sys.argv[0]) + f.write('#include "cairo-boilerplate-private.h"\n\n') + f.write('void _cairo_boilerplate_register_all (void);\n\n') diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-symbol-lookup-backport.patch b/recipes/cairo/meson/patches/cairo-1.17.4-symbol-lookup-backport.patch new file mode 100644 index 0000000000000..a63f6e5638529 --- /dev/null +++ b/recipes/cairo/meson/patches/cairo-1.17.4-symbol-lookup-backport.patch @@ -0,0 +1,25 @@ +Backport new 'symbol-lookup' meson option from git master to cairo 1.17.4. +This option is needed to turn linking with libbfd deterministically on or off. @sh0 + +--- meson.build 2021-12-01 03:56:33.290547341 +0200 ++++ meson.build 2021-12-01 03:58:17.955355490 +0200 +@@ -659,7 +659,7 @@ + + # Untested, libiberty.h is in a libiberty subfolder for me + # FIXME: automagic +-bfd_dep = cc.find_library('bfd', required: false) ++bfd_dep = cc.find_library('bfd', has_headers: ['bfd.h'], required: get_option('symbol-lookup')) + if bfd_dep.found() and cc.has_function('bfd_openr', dependencies: [bfd_dep]) + if cc.has_header('libiberty.h') + conf.set('HAVE_BFD', 1) +--- meson_options.txt 2021-12-01 03:56:33.290547341 +0200 ++++ meson_options.txt 2021-12-01 03:57:29.498907256 +0200 +@@ -30,6 +30,8 @@ + # Misc deps + option('glib', type : 'feature', value : 'auto') + option('spectre', type : 'feature', value : 'auto') ++option('symbol-lookup', type: 'feature', value : 'auto', ++ description: 'Symbol lookup in debug utils via binutils/bfd') + + # FIXME: implement these to avoid automagic + #option('egl', type : 'feature', value : 'auto') diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-trace-cflags-fix.patch b/recipes/cairo/meson/patches/cairo-1.17.4-trace-cflags-fix.patch new file mode 100644 index 0000000000000..83876c84ca34f --- /dev/null +++ b/recipes/cairo/meson/patches/cairo-1.17.4-trace-cflags-fix.patch @@ -0,0 +1,20 @@ +Add missing 'PACKAGE' and 'PACKAGE_VERSION' defines for libbfd headers included by 'lookup-symbol.c'. +Offending lines in 'bfd.h': + + #if !defined PACKAGE && !defined PACKAGE_VERSION + #error config.h must be included before this header + #endif + +Previously autotools provided those defines for Cairo, but they are no longer generated with meson. @sh0 + +--- meson.build 2020-11-27 01:20:59.000000000 +0200 ++++ meson.build 2021-12-01 00:42:26.798320019 +0200 +@@ -12,7 +12,7 @@ + include_directories: [incbase, incsrc], + dependencies: deps, + link_args: extra_link_args, +- c_args: ['-DSHARED_LIB_EXT="@0@"'.format(shared_lib_ext), '-DHAVE_CONFIG_H'] + pthread_c_args, ++ c_args: ['-DPACKAGE', '-DPACKAGE_VERSION', '-DSHARED_LIB_EXT="@0@"'.format(shared_lib_ext), '-DHAVE_CONFIG_H'] + pthread_c_args, + install: true, + install_dir: join_paths(get_option('prefix'), get_option('libdir'), 'cairo'), + ) diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-xlib-xrender-option.patch b/recipes/cairo/meson/patches/cairo-1.17.4-xlib-xrender-option.patch new file mode 100644 index 0000000000000..55d7c984f8406 --- /dev/null +++ b/recipes/cairo/meson/patches/cairo-1.17.4-xlib-xrender-option.patch @@ -0,0 +1,26 @@ +This patch adds option to enable or disable xlib-xrender component. +Without it 'xrender' is always required when 'xlib' option is enabled. @sh0 + +--- meson.build 2020-11-27 01:20:59.000000000 +0200 ++++ meson.build 2021-12-01 00:34:50.366334030 +0200 +@@ -273,8 +273,8 @@ + endif + endif + +-if feature_conf.get('CAIRO_HAS_XLIB_SURFACE', 0) == 1 +- xrender_dep = dependency('xrender', required: get_option('xlib'), ++if feature_conf.get('CAIRO_HAS_XLIB_SURFACE', 0) == 1 and get_option('xlib-xrender').enabled() ++ xrender_dep = dependency('xrender', required: true, + version: xrender_required_version) + + if xrender_dep.found() +--- meson_options.txt 2020-11-27 01:20:59.000000000 +0200 ++++ meson_options.txt 2021-12-01 00:32:43.480337924 +0200 +@@ -17,6 +17,7 @@ + option('tee', type : 'feature', value : 'disabled') + option('xcb', type : 'feature', value : 'auto') + option('xlib', type : 'feature', value : 'auto') ++option('xlib-xrender', type : 'feature', value : 'disabled') + #option('xml', type : 'feature', value : 'disabled') + option('zlib', type : 'feature', value : 'auto') # script, ps, pdf, xml surfaces + diff --git a/recipes/cairo/meson/test_package/CMakeLists.txt b/recipes/cairo/meson/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4f33d55898eb2 --- /dev/null +++ b/recipes/cairo/meson/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +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/meson/test_package/conanfile.py b/recipes/cairo/meson/test_package/conanfile.py new file mode 100644 index 0000000000000..e904c93b97465 --- /dev/null +++ b/recipes/cairo/meson/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 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/meson/test_package/test_package.c b/recipes/cairo/meson/test_package/test_package.c new file mode 100644 index 0000000000000..5854291cea177 --- /dev/null +++ b/recipes/cairo/meson/test_package/test_package.c @@ -0,0 +1,36 @@ +#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/meson/test_v1_package/CMakeLists.txt b/recipes/cairo/meson/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..692a4909c85a7 --- /dev/null +++ b/recipes/cairo/meson/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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/meson/test_v1_package/conanfile.py b/recipes/cairo/meson/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..24f9e474d6cd2 --- /dev/null +++ b/recipes/cairo/meson/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/cairomm/all/conandata.yml b/recipes/cairomm/all/conandata.yml new file mode 100644 index 0000000000000..e9529d1b4235f --- /dev/null +++ b/recipes/cairomm/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.16.1": + url: "https://cairographics.org/releases/cairomm-1.16.1.tar.xz" + sha256: "6f6060d8e98dd4b8acfee2295fddbdd38cf487c07c26aad8d1a83bb9bff4a2c6" + "1.14.3": + url: "https://cairographics.org/releases/cairomm-1.14.3.tar.xz" + sha256: "0d37e067c5c4ca7808b7ceddabfe1932c5bd2a750ad64fb321e1213536297e78" + +patches: + "1.16.1": + - patch_file: "patches/enable_static_lib_1_16_1.patch" + base_path: "source_subfolder" + "1.14.3": + - patch_file: "patches/enable_static_lib_1_14_3.patch" + base_path: "source_subfolder" diff --git a/recipes/cairomm/all/conanfile.py b/recipes/cairomm/all/conanfile.py new file mode 100644 index 0000000000000..8a403a49b992b --- /dev/null +++ b/recipes/cairomm/all/conanfile.py @@ -0,0 +1,194 @@ +from conans import ConanFile, Meson, tools +from conan.tools.files import rename +from conan.tools.microsoft import is_msvc +from conans.errors import ConanInvalidConfiguration +import glob +import os +import shutil + + +class CairommConan(ConanFile): + name = "cairomm" + homepage = "https://github.com/freedesktop/cairomm" + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-2.0" + description = "cairomm is a C++ wrapper for the cairo graphics library." + topics = ["cairo", "wrapper", "graphics"] + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "pkg_config" + exports_sources = "patches/**" + short_paths = True + + def _abi_version(self): + return "1.16" if tools.Version(self.version) >= "1.16.0" else "1.0" + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + if self.settings.compiler.get_safe("cppstd"): + if self._abi_version() == "1.16": + tools.check_min_cppstd(self, 17) + else: + tools.check_min_cppstd(self, 11) + if self.options.shared and not self.options["cairo"].shared: + raise ConanInvalidConfiguration( + "Linking against static cairo would cause shared cairomm to link " + "against static glib which can cause problems." + ) + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + if is_msvc(self): + # when using cpp_std=c++11 the /permissive- flag is added which + # attempts enforcing standard conformant c++ code + # the problem is that older versions of Windows SDK is not standard + # conformant! see: + # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 + tools.replace_in_file( + os.path.join(self._source_subfolder, "meson.build"), + "cpp_std=c++", "cpp_std=vc++") + + 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.shared: + self.options["cairo"].shared = True + + def build_requirements(self): + self.build_requires("meson/0.59.1") + self.build_requires("pkgconf/1.7.4") + + def requirements(self): + self.requires("cairo/1.17.4") + + if self._abi_version() == "1.16": + self.requires("libsigcpp/3.0.7") + else: + self.requires("libsigcpp/2.10.8") + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + strip_root=True, + destination=self._source_subfolder, + ) + + def build(self): + self._patch_sources() + with tools.environment_append(tools.RunEnvironment(self).vars): + meson = self._configure_meson() + meson.build() + + def _configure_meson(self): + meson = Meson(self) + defs = { + "build-examples": "false", + "build-documentation": "false", + "build-tests": "false", + "msvc14x-parallel-installable": "false", + "default_library": "shared" if self.options.shared else "static", + } + meson.configure( + defs=defs, + build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + pkg_config_paths=[self.install_folder], + ) + return meson + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + meson.install() + if is_msvc(self): + tools.remove_files_by_mask( + os.path.join(self.package_folder, "bin"), "*.pdb") + if not self.options.shared: + rename( + self, + os.path.join( + self.package_folder, + "lib", + f"libcairomm-{self._abi_version()}.a", + ), + os.path.join(self.package_folder, "lib", + f"cairomm-{self._abi_version()}.lib"), + ) + + for header_file in glob.glob( + os.path.join( + self.package_folder, + "lib", + f"cairomm-{self._abi_version()}", + "include", + "*.h", + )): + shutil.move( + header_file, + os.path.join( + self.package_folder, + "include", + f"cairomm-{self._abi_version()}", + os.path.basename(header_file), + ), + ) + + for dir_to_remove in ["pkgconfig", f"cairomm-{self._abi_version()}"]: + tools.rmdir(os.path.join(self.package_folder, "lib", + dir_to_remove)) + + def package_info(self): + if self._abi_version() == "1.16": + self.cpp_info.components["cairomm-1.16"].names[ + "pkg_config"] = "cairomm-1.16" + self.cpp_info.components["cairomm-1.16"].includedirs = [ + os.path.join("include", "cairomm-1.16") + ] + self.cpp_info.components["cairomm-1.16"].libs = ["cairomm-1.16"] + self.cpp_info.components["cairomm-1.16"].requires = [ + "libsigcpp::sigc++", "cairo::cairo_" + ] + if tools.is_apple_os(self.settings.os): + self.cpp_info.components["cairomm-1.16"].frameworks = [ + "CoreFoundation" + ] + else: + self.cpp_info.components["cairomm-1.0"].names[ + "pkg_config"] = "cairomm-1.0" + self.cpp_info.components["cairomm-1.0"].includedirs = [ + os.path.join("include", "cairomm-1.0") + ] + self.cpp_info.components["cairomm-1.0"].libs = ["cairomm-1.0"] + self.cpp_info.components["cairomm-1.0"].requires = [ + "libsigcpp::sigc++-2.0", "cairo::cairo_" + ] + if tools.is_apple_os(self.settings.os): + self.cpp_info.components["cairomm-1.0"].frameworks = [ + "CoreFoundation" + ] + + def package_id(self): + self.info.requires["cairo"].full_package_mode() diff --git a/recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch b/recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch new file mode 100644 index 0000000000000..f5fcae443d2f0 --- /dev/null +++ b/recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch @@ -0,0 +1,37 @@ +commit 04b20b02cc0ff18f71da693cf2d89709adabd297 +Author: Hesham Essam +Date: Fri May 6 21:26:01 2022 +0200 + + Enable static builds with msvc + + Cairomm exports dll symbols if the macro CAIROMM_STATIC_LIB is not + defined. This patch defines this macro in case of static builds. + +diff --git a/cairommconfig.h.meson b/cairommconfig.h.meson +index 2988edc..b9e5c21 100644 +--- a/cairommconfig.h.meson ++++ b/cairommconfig.h.meson +@@ -18,6 +18,9 @@ + /* Micro version number of cairomm. */ + #mesondefine CAIROMM_MICRO_VERSION + ++/* Define if cairomm is built as a static library */ ++#mesondefine CAIROMM_STATIC_LIB ++ + /* Enable DLL-specific stuff only when not building a static library */ + #if !defined(__CYGWIN__) && \ + (defined(__MINGW32__) || defined (_MSC_VER)) && \ +diff --git a/meson.build b/meson.build +index e130814..54c8d4f 100644 +--- a/meson.build ++++ b/meson.build +@@ -244,6 +244,9 @@ endif + if build_exceptions_api + mm_conf_data.set('CAIROMM_EXCEPTIONS_ENABLED', 1) + endif ++if get_option('default_library') == 'static' ++ mm_conf_data.set('CAIROMM_STATIC_LIB', 1) ++endif + mm_conf_data.set('CAIROMM_MAJOR_VERSION', cairomm_major_version) + mm_conf_data.set('CAIROMM_MINOR_VERSION', cairomm_minor_version) + mm_conf_data.set('CAIROMM_MICRO_VERSION', cairomm_micro_version) diff --git a/recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch b/recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch new file mode 100644 index 0000000000000..5d6cd671de960 --- /dev/null +++ b/recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch @@ -0,0 +1,38 @@ +commit cd43f2e55de6db57e561989e7f6ad3765e1d4971 +Author: Hesham Essam +Date: Fri May 6 21:35:47 2022 +0200 + + Enable static builds with msvc + + Cairomm exports dll symbols if the macro CAIROMM_STATIC_LIB is not + defined. This patch defines this macro in case of static builds. + +diff --git a/cairommconfig.h.meson b/cairommconfig.h.meson +index 2988edc..b9e5c21 100644 +--- a/cairommconfig.h.meson ++++ b/cairommconfig.h.meson +@@ -18,6 +18,9 @@ + /* Micro version number of cairomm. */ + #mesondefine CAIROMM_MICRO_VERSION + ++/* Define if cairomm is built as a static library */ ++#mesondefine CAIROMM_STATIC_LIB ++ + /* Enable DLL-specific stuff only when not building a static library */ + #if !defined(__CYGWIN__) && \ + (defined(__MINGW32__) || defined (_MSC_VER)) && \ +diff --git a/meson.build b/meson.build +index 2c0c8bb..5259409 100644 +--- a/meson.build ++++ b/meson.build +@@ -247,6 +247,10 @@ endif + if build_exceptions_api + mm_conf_data.set('CAIROMM_EXCEPTIONS_ENABLED', 1) + endif ++if get_option('default_library') == 'static' ++ mm_conf_data.set('CAIROMM_STATIC_LIB', 1) ++endif ++ + mm_conf_data.set('CAIROMM_MAJOR_VERSION', cairomm_major_version) + mm_conf_data.set('CAIROMM_MINOR_VERSION', cairomm_minor_version) + mm_conf_data.set('CAIROMM_MICRO_VERSION', cairomm_micro_version) diff --git a/recipes/cairomm/all/test_package/CMakeLists.txt b/recipes/cairomm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..366e829c2704c --- /dev/null +++ b/recipes/cairomm/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGET) + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(cairomm REQUIRED CONFIG) +if (TARGET cairomm::cairomm-1.16) + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + target_link_libraries(${PROJECT_NAME} cairomm::cairomm-1.16) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + target_link_libraries(${PROJECT_NAME} cairomm::cairomm-1.0) +endif() diff --git a/recipes/cairomm/all/test_package/conanfile.py b/recipes/cairomm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a691174f8ed16 --- /dev/null +++ b/recipes/cairomm/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/cairomm/all/test_package/test_package.cpp b/recipes/cairomm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d802e56f01bd2 --- /dev/null +++ b/recipes/cairomm/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#define _USE_MATH_DEFINES + +#include +#include +#include + +int main() { +#if CAIROMM_MINOR_VERSION == 16 + auto surface = + Cairo::ImageSurface::create(Cairo::Surface::Format::ARGB32, 600, 400); +#else + auto surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, 600, 400); +#endif + + auto cr = Cairo::Context::create(surface); + cr->save(); // save the state of the context + cr->set_source_rgb(0.86, 0.85, 0.47); + cr->paint(); // fill image with the color + cr->restore(); // color is back to black now + cr->save(); + // draw a border around the image + cr->set_line_width(20.0); // make the line wider + cr->rectangle(0.0, 0.0, surface->get_width(), surface->get_height()); + cr->stroke(); + cr->set_source_rgba(0.0, 0.0, 0.0, 0.7); + // draw a circle in the center of the image + cr->arc(surface->get_width() / 2.0, surface->get_height() / 2.0, + surface->get_height() / 4.0, 0.0, 2.0 * M_PI); + cr->stroke(); + // draw a diagonal line + cr->move_to(surface->get_width() / 4.0, surface->get_height() / 4.0); + cr->line_to(surface->get_width() * 3.0 / 4.0, + surface->get_height() * 3.0 / 4.0); + cr->stroke(); + cr->restore(); +} diff --git a/recipes/cairomm/config.yml b/recipes/cairomm/config.yml new file mode 100644 index 0000000000000..cc2573070ee79 --- /dev/null +++ b/recipes/cairomm/config.yml @@ -0,0 +1,5 @@ +versions: + "1.16.1": + folder: "all" + "1.14.3": + folder: "all" diff --git a/recipes/cajun-jsonapi/all/conandata.yml b/recipes/cajun-jsonapi/all/conandata.yml new file mode 100644 index 0000000000000..2dc8730667a35 --- /dev/null +++ b/recipes/cajun-jsonapi/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.3": + url: https://github.com/cajun-jsonapi/cajun-jsonapi/archive/2.0.3.tar.gz + sha256: b47f9338f1fbaee5ffc7247a94219e767d22d02fb6cdd37a51a9367700b72f34 + "2.1.1": + url: https://github.com/cajun-jsonapi/cajun-jsonapi/archive/refs/tags/2.1.1.tar.gz + sha256: 88f1eecf105e7ea337cd4142d1ea1bd165e84b0fa91cdaa098437b2e153a234c diff --git a/recipes/cajun-jsonapi/all/conanfile.py b/recipes/cajun-jsonapi/all/conanfile.py new file mode 100644 index 0000000000000..55cd07447203f --- /dev/null +++ b/recipes/cajun-jsonapi/all/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, load, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CajunJsonApiConan(ConanFile): + name = "cajun-jsonapi" + description = "CAJUN* is a C++ API for the JSON object interchange format." + topics = ("conan", "cajun", "json") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cajun-jsonapi/cajun-jsonapi" + license = "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + strip_root=True + ) + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + + def _extract_license(self): + file_content = load(self, os.path.join(self.source_folder, "test.cpp")) + return ( + file_content[: file_content.find("*/")] + .split("\n", 2)[-1] + .rsplit("\n", 1)[0] + ) + + def package(self): + package_version = Version(self.version) + if package_version < "2.1.0": + # No dedicated LICENSE file in older versions, extracting license text from comments + save( + self, + os.path.join(self.package_folder, "licenses", "LICENSE"), + self._extract_license(), + ) + # Prior to v2.1.0 there was no "cajun" subfolder in sources but it was present in RPM packages + # (e.g. https://centos.pkgs.org/7/epel-x86_64/cajun-jsonapi-devel-2.0.3-2.el7.noarch.rpm.html) + # For ease of migration from RPM dependencies to Conan creating intermediate "cajun" folder + # so that '#include "cajun/json/..."' statements worked correctly + copy( + self, + "*.h", + dst=os.path.join(self.package_folder, "include", "cajun", "json"), + src=os.path.join(self.source_folder, "json"), + ) + copy( + self, + "*.inl", + dst=os.path.join(self.package_folder, "include", "cajun", "json"), + src=os.path.join(self.source_folder, "json"), + ) + else: + copy( + self, + "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + "*.inl", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "cajun")) diff --git a/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt b/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6361de2a69cab --- /dev/null +++ b/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(cajun-jsonapi REQUIRED) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cajun-jsonapi::cajun-jsonapi) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/cajun-jsonapi/all/test_package/conanfile.py b/recipes/cajun-jsonapi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/cajun-jsonapi/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cajun-jsonapi/all/test_package/main.cpp b/recipes/cajun-jsonapi/all/test_package/main.cpp new file mode 100644 index 0000000000000..a061fd3b751d9 --- /dev/null +++ b/recipes/cajun-jsonapi/all/test_package/main.cpp @@ -0,0 +1,43 @@ +#include // Recommended include path as of v2.1.0 +#include +#include // Shortened include path used prior to v2.1.0 + +#include +#include + +int main() +{ + using namespace json; + + Object objAPA; + objAPA["Name"] = String("Schlafly American Pale Ale"); + objAPA["Origin"] = String("St. Louis, MO, USA"); + objAPA["ABV"] = Number(3.8); + objAPA["BottleConditioned"] = Boolean(true); + + Array arrayBeer; + arrayBeer.Insert(objAPA); + + Object objDocument; + objDocument["Delicious Beers"] = arrayBeer; + + Number numDeleteThis = objDocument["AnotherMember"]; + + objDocument["Delicious Beers"][1]["Name"] = String("John Smith's Extra Smooth"); + objDocument["Delicious Beers"][1]["Origin"] = String("Tadcaster, Yorkshire, UK"); + objDocument["Delicious Beers"][1]["ABV"] = Number(3.8); + objDocument["Delicious Beers"][1]["BottleConditioned"] = Boolean(false); + + const Object &objRoot = objDocument; + + const Array &arrayBeers = objRoot["Delicious Beers"]; + const Object &objBeer0 = arrayBeers[0]; + const String &strName0 = objBeer0["Name"]; + + const Number numAbv1 = objRoot["Delicious Beers"][1]["ABV"]; + + std::cout << "First beer name: " << strName0.Value() << std::endl; + std::cout << "First beer ABV: " << numAbv1.Value() << std::endl; + + return 0; +} diff --git a/recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt b/recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ea0378c83fe1 --- /dev/null +++ b/recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package 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/cajun-jsonapi/all/test_v1_package/conanfile.py b/recipes/cajun-jsonapi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e065617c053bc --- /dev/null +++ b/recipes/cajun-jsonapi/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools, RunEnvironment +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + 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/cajun-jsonapi/config.yml b/recipes/cajun-jsonapi/config.yml new file mode 100644 index 0000000000000..84cd2c74fdbc1 --- /dev/null +++ b/recipes/cajun-jsonapi/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.3": + folder: "all" + "2.1.1": + folder: "all" diff --git a/recipes/calceph/all/conandata.yml b/recipes/calceph/all/conandata.yml new file mode 100644 index 0000000000000..f4d850c349cf0 --- /dev/null +++ b/recipes/calceph/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.5.1": + url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.5.1.tar.gz" + sha256: "33cc0be1b8ffb647aff9d3ac1cf025e460451e00144050d3bbc4f13bceb11c1d" + "3.5.0": + url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.5.0.tar.gz" + sha256: "2aa9ba47af6a73ab74ae10d1c8efbcfab9068d9d05f016a8a5fe695df7b52e00" + "3.4.7": + url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.4.7.tar.gz" + sha256: "99ff6c153c888cc514d9c4e8acfb99448ab0bdaff8ef5aaa398a1d4f00c8579f" + "3.4.6": + url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.4.6.tar.gz" + sha256: "fc2c0d899c32ddee2d484159c6fda5ae1ee7d8beae517029b776e5250b5fda27" + "3.4.5": + url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.4.5.tar.gz" + sha256: "e1b9076b49fee51f7efda22194c8b66aaeebedbdb41d731c5af2cd0b16b39b56" diff --git a/recipes/calceph/all/conanfile.py b/recipes/calceph/all/conanfile.py new file mode 100644 index 0000000000000..fda6184d24ab9 --- /dev/null +++ b/recipes/calceph/all/conanfile.py @@ -0,0 +1,132 @@ +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, copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain +import os + +required_conan_version = ">=1.55.0" + + +class CalcephConan(ConanFile): + name = "calceph" + description = "C Library designed to access the binary planetary ephemeris " \ + "files, such INPOPxx, JPL DExxx and SPICE ephemeris files." + license = ["CECILL-C", "CECILL-B", "CECILL-2.1"] + topics = ("ephemeris", "astronomy", "space", "planet") + homepage = "https://www.imcce.fr/inpop/calceph" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threadsafe": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": False, + } + + @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 + if is_msvc(self): + del self.options.threadsafe + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared builds with Visual Studio yet") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-thread={yes_no(self.options.threadsafe)}", + "--disable-fortran", + "--disable-python", + "--disable-python-package-system", + "--disable-python-package-user", + "--disable-mex-octave", + ]) + tc.generate() + + @property + def _nmake_args(self): + return " ".join([ + f"DESTDIR=\"{self.package_folder}\"", + "ENABLEF2003=0", + "ENABLEF77=0", + ]) + + def build(self): + if is_msvc(self): + replace_in_file( + self, os.path.join(self.source_folder, "Makefile.vc"), + "CFLAGS = /O2 /GR- /MD /nologo /EHs", + "CFLAGS = /nologo /EHs", + ) + with chdir(self, self.source_folder): + self.run(f"nmake -f Makefile.vc {self._nmake_args}") + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + with chdir(self, self.source_folder): + self.run(f"nmake -f Makefile.vc install {self._nmake_args}") + rmdir(self, os.path.join(self.package_folder, "doc")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "libexec")) + + def package_info(self): + prefix = "lib" if is_msvc(self) else "" + self.cpp_info.libs = [f"{prefix}calceph"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.options.threadsafe: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 + if not is_msvc(self): + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/calceph/all/test_package/CMakeLists.txt b/recipes/calceph/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5c6dc64f12782 --- /dev/null +++ b/recipes/calceph/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(calceph REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE calceph::calceph) diff --git a/recipes/calceph/all/test_package/conanfile.py b/recipes/calceph/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/calceph/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/calceph/all/test_package/test_package.c b/recipes/calceph/all/test_package/test_package.c new file mode 100644 index 0000000000000..80ca63accbbf5 --- /dev/null +++ b/recipes/calceph/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main(void) { + char calceph_version[CALCEPH_MAX_CONSTANTNAME]; + calceph_getversion_str(calceph_version); + printf("CALCEPH version %s\n", calceph_version); + return 0; +} diff --git a/recipes/calceph/all/test_v1_package/CMakeLists.txt b/recipes/calceph/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/calceph/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/calceph/all/test_v1_package/conanfile.py b/recipes/calceph/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/calceph/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/calceph/config.yml b/recipes/calceph/config.yml new file mode 100644 index 0000000000000..8843656f63225 --- /dev/null +++ b/recipes/calceph/config.yml @@ -0,0 +1,11 @@ +versions: + "3.5.1": + folder: all + "3.5.0": + folder: all + "3.4.7": + folder: all + "3.4.6": + folder: all + "3.4.5": + folder: all diff --git a/recipes/canary/all/conandata.yml b/recipes/canary/all/conandata.yml new file mode 100644 index 0000000000000..a5b79d2d07ace --- /dev/null +++ b/recipes/canary/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "v1": + url: "https://github.com/djarek/canary/archive/refs/tags/v1.tar.gz" + sha256: "f3e2e80f5c01b4d60aed4b5ec73663158b495caa4f9324a10d05e55ea8f3938c" diff --git a/recipes/canary/all/conanfile.py b/recipes/canary/all/conanfile.py new file mode 100644 index 0000000000000..1a102a8feb035 --- /dev/null +++ b/recipes/canary/all/conanfile.py @@ -0,0 +1,61 @@ +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 +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.53.0" + + +class SocketcanCanaryConan(ConanFile): + name = "canary" + description = "A lightweight implementation of Linux SocketCAN bindings for ASIO/Boost.ASIO" + url = "https://github.com/conan-io/conan-center-index" + license = "BSL-1.0" + homepage = "https://github.com/djarek/canary" + topics = ("socketcan", "can-bus", "can") + + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def requirements(self): + self.requires("boost/1.74.0", transitive_headers=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.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + pass + + def package(self): + copy(self, "LICENSE_1_0.txt", 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, "lib")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.requires = ["boost::headers", "boost::system"] + self.cpp_info.set_property("cmake_file_name", "canary") + self.cpp_info.set_property("cmake_target_name", "canary::canary") diff --git a/recipes/canary/all/test_package/CMakeLists.txt b/recipes/canary/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..81f2b230ac92c --- /dev/null +++ b/recipes/canary/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(canary REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PUBLIC canary::canary) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/canary/all/test_package/conanfile.py b/recipes/canary/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d94ba2fb11ca8 --- /dev/null +++ b/recipes/canary/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 TestPackage(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/canary/all/test_package/test_package.cpp b/recipes/canary/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ccec8d0783be7 --- /dev/null +++ b/recipes/canary/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + try { + auto index = canary::get_interface_index("vcan0"); + std::cout << "vcan0 interface index: " << index << "\n"; + } + catch (std::exception& exc) { + std::cout << "unable to find vcan0: " << exc.what() << "\n"; + } + + return 0; +} diff --git a/recipes/canary/all/test_v1_package/CMakeLists.txt b/recipes/canary/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..81f2b230ac92c --- /dev/null +++ b/recipes/canary/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(canary REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PUBLIC canary::canary) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/canary/all/test_v1_package/conanfile.py b/recipes/canary/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f8bae5c00ce0a --- /dev/null +++ b/recipes/canary/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import CMake, ConanFile, tools + + +class TestPackage(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(".", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/canary/all/test_v1_package/test_package.cpp b/recipes/canary/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..ccec8d0783be7 --- /dev/null +++ b/recipes/canary/all/test_v1_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + try { + auto index = canary::get_interface_index("vcan0"); + std::cout << "vcan0 interface index: " << index << "\n"; + } + catch (std::exception& exc) { + std::cout << "unable to find vcan0: " << exc.what() << "\n"; + } + + return 0; +} diff --git a/recipes/canary/config.yml b/recipes/canary/config.yml new file mode 100644 index 0000000000000..96340c06c871e --- /dev/null +++ b/recipes/canary/config.yml @@ -0,0 +1,3 @@ +versions: + "v1": + folder: all diff --git a/recipes/canvas_ity/all/conandata.yml b/recipes/canvas_ity/all/conandata.yml new file mode 100644 index 0000000000000..4bd2a5a6b3481 --- /dev/null +++ b/recipes/canvas_ity/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.00": + url: "https://github.com/a-e-k/canvas_ity/archive/f32fbb37e2fe7c0fcaee6ebdc02d3e5385603fd5.tar.gz" + sha256: "be0d9ef9a023ba732e403fe8c1ec9e1cd8f02c75777c09562067c9270612a3ed" diff --git a/recipes/canvas_ity/all/conanfile.py b/recipes/canvas_ity/all/conanfile.py new file mode 100644 index 0000000000000..b4527ac4677c7 --- /dev/null +++ b/recipes/canvas_ity/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.files import get, copy, load, save +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.50.0" + + +class CanvasItyConan(ConanFile): + name = "canvas_ity" + description = "A tiny, single-header -like 2D rasterizer for C++" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/a-e-k/canvas_ity" + topics = ("rasterizer", "canvas", "2d", "header-only") + 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) + + def build(self): + pass + + def package(self): + filename = os.path.join(self.source_folder, "src", "canvas_ity.hpp") + file_content = load(self, filename) + license_end = "// ======== ABOUT ========" + license_contents = file_content[:file_content.find(license_end)].replace("//", "") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/canvas_ity/all/test_package/CMakeLists.txt b/recipes/canvas_ity/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d050dc832dd0b --- /dev/null +++ b/recipes/canvas_ity/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(canvas_ity REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE canvas_ity::canvas_ity) diff --git a/recipes/canvas_ity/all/test_package/conanfile.py b/recipes/canvas_ity/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/canvas_ity/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/canvas_ity/all/test_package/test_package.cpp b/recipes/canvas_ity/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..84a5a4297d714 --- /dev/null +++ b/recipes/canvas_ity/all/test_package/test_package.cpp @@ -0,0 +1,71 @@ +#include +#include + +#define CANVAS_ITY_IMPLEMENTATION +#include "canvas_ity.hpp" + +int main() { + // Construct the canvas. + static int const width = 256, height = 256; + canvas_ity::canvas context( width, height ); + + // Build a star path. + context.move_to( 128.0f, 28.0f ); context.line_to( 157.0f, 87.0f ); + context.line_to( 223.0f, 97.0f ); context.line_to( 175.0f, 143.0f ); + context.line_to( 186.0f, 208.0f ); context.line_to( 128.0f, 178.0f ); + context.line_to( 69.0f, 208.0f ); context.line_to( 80.0f, 143.0f ); + context.line_to( 32.0f, 97.0f ); context.line_to( 98.0f, 87.0f ); + context.close_path(); + + // Set up the drop shadow. + context.set_shadow_blur( 8.0f ); + context.shadow_offset_y = 4.0f; + context.set_shadow_color( 0.0f, 0.0f, 0.0f, 0.5f ); + + // Fill the star with yellow. + context.set_color( canvas_ity::fill_style, 1.0f, 0.9f, 0.2f, 1.0f ); + context.fill(); + + // Draw the star with a thick red stroke and rounded points. + context.line_join = canvas_ity::rounded; + context.set_line_width( 12.0f ); + context.set_color( canvas_ity::stroke_style, 0.9f, 0.0f, 0.5f, 1.0f ); + context.stroke(); + + // Draw the star again with a dashed thinner orange stroke. + float segments[] = { 21.0f, 9.0f, 1.0f, 9.0f, 7.0f, 9.0f, 1.0f, 9.0f }; + context.set_line_dash( segments, 8 ); + context.line_dash_offset = 10.0f; + context.line_cap = canvas_ity::circle; + context.set_line_width( 6.0f ); + context.set_color( canvas_ity::stroke_style, 0.95f, 0.65f, 0.15f, 1.0f ); + context.stroke(); + + // Turn off the drop shadow. + context.set_shadow_color( 0.0f, 0.0f, 0.0f, 0.0f ); + + // Add a shine layer over the star. + context.set_linear_gradient( canvas_ity::fill_style, 64.0f, 0.0f, 192.0f, 256.0f ); + context.add_color_stop( canvas_ity::fill_style, 0.30f, 1.0f, 1.0f, 1.0f, 0.0f ); + context.add_color_stop( canvas_ity::fill_style, 0.35f, 1.0f, 1.0f, 1.0f, 0.8f ); + context.add_color_stop( canvas_ity::fill_style, 0.45f, 1.0f, 1.0f, 1.0f, 0.8f ); + context.add_color_stop( canvas_ity::fill_style, 0.50f, 1.0f, 1.0f, 1.0f, 0.0f ); + + context.global_composite_operation = canvas_ity::source_atop; + context.fill_rectangle( 0.0f, 0.0f, 256.0f, 256.0f ); + + // Fetch the rendered RGBA pixels from the entire canvas. + unsigned char *image = new unsigned char[ height * width * 4 ]; + context.get_image_data( image, width, height, width * 4, 0, 0 ); + // Write them out to a TGA image file (TGA uses BGRA order). + unsigned char header[] = { 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + width & 255, width >> 8, height & 255, height >> 8, 32, 40 }; + for ( int pixel = 0; pixel < height * width; ++pixel ) + std::swap( image[ pixel * 4 + 0 ], image[ pixel * 4 + 2 ] ); + std::ofstream stream( "example.tga", std::ios::binary ); + stream.write( reinterpret_cast< char * >( header ), sizeof( header ) ); + stream.write( reinterpret_cast< char * >( image ), height * width * 4 ); + delete[] image; + + return 0; +} diff --git a/recipes/canvas_ity/all/test_v1_package/CMakeLists.txt b/recipes/canvas_ity/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/canvas_ity/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/canvas_ity/all/test_v1_package/conanfile.py b/recipes/canvas_ity/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/canvas_ity/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/canvas_ity/config.yml b/recipes/canvas_ity/config.yml new file mode 100644 index 0000000000000..5ec3e5033421a --- /dev/null +++ b/recipes/canvas_ity/config.yml @@ -0,0 +1,3 @@ +versions: + "1.00": + folder: all diff --git a/recipes/capnproto/all/conandata.yml b/recipes/capnproto/all/conandata.yml new file mode 100644 index 0000000000000..8a6eeaab5a8d1 --- /dev/null +++ b/recipes/capnproto/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "0.10.3": + url: "https://github.com/capnproto/capnproto/archive/v0.10.3.tar.gz" + sha256: "e07446f56043c983e009038e69d18ff86a2924909f0b518ccf47eccf5ac03919" + "0.10.1": + url: "https://github.com/capnproto/capnproto/archive/v0.10.1.tar.gz" + sha256: "2e9c918f02c198557c75ca7c635fe281337c9755b752a6ab3a841bcc1cf5176b" + "0.10.0": + url: "https://github.com/capnproto/capnproto/archive/v0.10.0.tar.gz" + sha256: "0e46a72d086830762c001116c0a146098fbdce3cd40665a0ffd4742962d42bfd" + "0.9.1": + url: "https://github.com/capnproto/capnproto/archive/v0.9.1.tar.gz" + sha256: "daf49f794560f715e2f4651c842aaece2d065d4216834c5c3d3254962e35b535" + "0.8.0": + url: "https://github.com/capnproto/capnproto/archive/v0.8.0.tar.gz" + sha256: "6d8b43a7ec2a764b4dfe4139a7cdd070ad9057f106898050d9f4db3754b98820" + "0.7.0": + url: "https://github.com/capnproto/capnproto/archive/v0.7.0.tar.gz" + sha256: 76c7114a3d142ad08b7208b3964a26e72a6320ee81331d3f0b87569fc9c47a28 +patches: + "0.10.3": + - patch_file: patches/0014-disable-tests-for-0.10.1.patch + "0.10.1": + - patch_file: patches/0014-disable-tests-for-0.10.1.patch + "0.10.0": + - patch_file: patches/0013-disable-tests-for-0.10.0.patch + "0.9.1": + - patch_file: patches/0010-disable-tests-for-0.9.1.patch + - patch_file: patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch + - patch_file: patches/0012-msvc-nogdi-fix-0.9.1.patch + "0.8.0": + - patch_file: patches/0001-disable-tests.patch + - patch_file: patches/0002-cmake-compat-header-install.patch + - patch_file: patches/0003-kj-tls-windows.patch + - patch_file: patches/0004-cmake-module-path.patch + - patch_file: patches/0005-msvc-16.7-ice-workaround.patch + - patch_file: patches/0009-windows-symlink-fix-0.8.0.patch + "0.7.0": + - patch_file: patches/0006-symlink.patch + - patch_file: patches/0007-cmake-module-path.patch + - patch_file: patches/0008-disable-tests.patch diff --git a/recipes/capnproto/all/conanfile.py b/recipes/capnproto/all/conanfile.py new file mode 100644 index 0000000000000..f101073a53368 --- /dev/null +++ b/recipes/capnproto/all/conanfile.py @@ -0,0 +1,241 @@ +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, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import glob +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class CapnprotoConan(ConanFile): + name = "capnproto" + description = "Cap'n Proto serialization/RPC system." + license = "MIT" + topics = ("serialization", "rpc") + homepage = "https://capnproto.org" + 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_openssl": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": True, + "with_zlib": True, + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + @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 + if Version(self.version) < "0.8.0": + del self.options.with_zlib + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.get_safe("with_zlib"): + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared libraries for Visual Studio") + if self.settings.os == "Windows" and Version(self.version) < "0.8.0" and self.options.with_openssl: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support OpenSSL on Windows pre 0.8.0") + + def build_requirements(self): + if self.settings.os != "Windows": + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["EXTERNAL_CAPNP"] = False + tc.variables["CAPNP_LITE"] = False + tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.generate() + deps = CMakeDeps(self) + deps.generate() + else: + 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"--with-openssl={yes_no(self.options.with_openssl)}", + "--enable-reflection", + ]) + if Version(self.version) >= "0.8.0": + tc.configure_args.append(f"--with-zlib={yes_no(self.options.with_zlib)}") + # Fix rpath on macOS + if self.settings.os == "Macos": + tc.extra_ldflags.append("-Wl,-rpath,@loader_path/../lib") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + with chdir(self, os.path.join(self.source_folder, "c++")): + autotools = Autotools(self) + # TODO: replace by a call to autootols.autoreconf() in c++ folder once https://github.com/conan-io/conan/issues/12103 implemented + self.run("autoreconf --force --install") + autotools.configure(build_script_folder=os.path.join(self.source_folder, "c++")) + autotools.make() + + @property + def _cmake_folder(self): + return os.path.join("lib", "cmake", "CapnProto") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + with chdir(self, os.path.join(self.source_folder, "c++")): + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + for cmake_file in glob.glob(os.path.join(self.package_folder, self._cmake_folder, "*")): + if os.path.basename(cmake_file) != "CapnProtoMacros.cmake": + os.remove(cmake_file) + # inject mandatory variables so that CAPNP_GENERATE_CPP function can + # work in a robust way (build from source or from pre build package) + find_execs = textwrap.dedent("""\ + if(CMAKE_CROSSCOMPILING) + find_program(CAPNP_EXECUTABLE capnp PATHS ENV PATH NO_DEFAULT_PATH) + find_program(CAPNPC_CXX_EXECUTABLE capnpc-c++ PATHS ENV PATH NO_DEFAULT_PATH) + endif() + if(NOT CAPNP_EXECUTABLE) + set(CAPNP_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../../bin/capnp${CMAKE_EXECUTABLE_SUFFIX}") + endif() + if(NOT CAPNPC_CXX_EXECUTABLE) + set(CAPNPC_CXX_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../../bin/capnpc-c++${CMAKE_EXECUTABLE_SUFFIX}") + endif() + set(CAPNP_INCLUDE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../../../include") + function(CAPNP_GENERATE_CPP SOURCES HEADERS) + """) + replace_in_file(self, os.path.join(self.package_folder, self._cmake_folder, "CapnProtoMacros.cmake"), + "function(CAPNP_GENERATE_CPP SOURCES HEADERS)", + find_execs) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CapnProto") + capnprotomacros = os.path.join(self._cmake_folder, "CapnProtoMacros.cmake") + self.cpp_info.set_property("cmake_build_modules", [capnprotomacros]) + + components = [ + {"name": "capnp", "requires": ["kj"]}, + {"name": "capnp-json", "requires": ["capnp", "kj"]}, + {"name": "capnp-rpc", "requires": ["capnp", "kj", "kj-async"]}, + {"name": "capnpc", "requires": ["capnp", "kj"]}, + {"name": "kj", "requires": []}, + {"name": "kj-async", "requires": ["kj"]}, + {"name": "kj-http", "requires": ["kj", "kj-async"]}, + {"name": "kj-test", "requires": ["kj"]}, + ] + if self.options.get_safe("with_zlib"): + components.append({"name": "kj-gzip", "requires": ["kj", "kj-async", "zlib::zlib"]}) + if self.options.with_openssl: + components.append({"name": "kj-tls", "requires": ["kj", "kj-async", "openssl::openssl"]}) + if Version(self.version) >= "0.9.0": + components.append({ + "name": "capnp-websocket", + "requires": ["capnp", "capnp-rpc", "kj-http", "kj-async", "kj"], + }) + + for component in components: + self._register_component(component) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["capnpc"].system_libs = ["pthread"] + self.cpp_info.components["kj"].system_libs = ["pthread"] + self.cpp_info.components["kj-async"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["kj-async"].system_libs = ["ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "CapnProto" + self.cpp_info.names["cmake_find_package_multi"] = "CapnProto" + self.cpp_info.components["kj"].build_modules = [capnprotomacros] + 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) + + def _register_component(self, component): + name = component["name"] + self.cpp_info.components[name].set_property("cmake_target_name", f"CapnProto::{name}") + self.cpp_info.components[name].builddirs.append(self._cmake_folder) + self.cpp_info.components[name].set_property("pkg_config_name", name) + self.cpp_info.components[name].libs = [name] + self.cpp_info.components[name].requires = component["requires"] diff --git a/recipes/capnproto/all/patches/0001-disable-tests.patch b/recipes/capnproto/all/patches/0001-disable-tests.patch new file mode 100644 index 0000000000000..2894874cefb82 --- /dev/null +++ b/recipes/capnproto/all/patches/0001-disable-tests.patch @@ -0,0 +1,161 @@ +--- a/c++/Makefile.am ++++ b/c++/Makefile.am +@@ -425,158 +425,3 @@ endif LITE_MODE + # src/capnp/serialize-snappy* + # src/capnp/benchmark/... + # src/capnp/compiler/... +- +-# Tests ============================================================== +- +-test_capnpc_inputs = \ +- src/capnp/test.capnp \ +- src/capnp/test-import.capnp \ +- src/capnp/test-import2.capnp \ +- src/capnp/compat/json-test.capnp +- +-test_capnpc_outputs = \ +- src/capnp/test.capnp.c++ \ +- src/capnp/test.capnp.h \ +- src/capnp/test-import.capnp.c++ \ +- src/capnp/test-import.capnp.h \ +- src/capnp/test-import2.capnp.c++ \ +- src/capnp/test-import2.capnp.h \ +- src/capnp/compat/json-test.capnp.c++ \ +- src/capnp/compat/json-test.capnp.h +- +-if USE_EXTERNAL_CAPNP +- +-test_capnpc_middleman: $(test_capnpc_inputs) +- @$(MKDIR_P) src +- $(CAPNP) compile --src-prefix=$(srcdir)/src -o$(CAPNPC_CXX):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-else +- +-test_capnpc_middleman: capnp$(EXEEXT) capnpc-c++$(EXEEXT) $(test_capnpc_inputs) +- @$(MKDIR_P) src +- ./capnp$(EXEEXT) compile --src-prefix=$(srcdir)/src -o./capnpc-c++$(EXEEXT):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-endif +- +-$(test_capnpc_outputs): test_capnpc_middleman +- +-BUILT_SOURCES = $(test_capnpc_outputs) +- +-check_LIBRARIES = libcapnp-test.a +-libcapnp_test_a_SOURCES = \ +- src/capnp/test-util.c++ \ +- src/capnp/test-util.h +-nodist_libcapnp_test_a_SOURCES = $(test_capnpc_outputs) +- +-if LITE_MODE +- +-check_PROGRAMS = capnp-test +-compiler_tests = +-capnp_test_LDADD = libcapnp-test.a libcapnp.la libkj-test.la libkj.la +- +-else !LITE_MODE +- +-check_PROGRAMS = capnp-test capnp-evolution-test capnp-afl-testcase +-heavy_tests = \ +- src/kj/async-test.c++ \ +- src/kj/async-xthread-test.c++ \ +- src/kj/async-unix-test.c++ \ +- src/kj/async-unix-xthread-test.c++ \ +- src/kj/async-win32-test.c++ \ +- src/kj/async-win32-xthread-test.c++ \ +- src/kj/async-io-test.c++ \ +- src/kj/parse/common-test.c++ \ +- src/kj/parse/char-test.c++ \ +- src/kj/std/iostream-test.c++ \ +- src/kj/compat/url-test.c++ \ +- src/kj/compat/http-test.c++ \ +- $(MAYBE_KJ_GZIP_TESTS) \ +- $(MAYBE_KJ_TLS_TESTS) \ +- src/capnp/canonicalize-test.c++ \ +- src/capnp/capability-test.c++ \ +- src/capnp/membrane-test.c++ \ +- src/capnp/schema-test.c++ \ +- src/capnp/schema-loader-test.c++ \ +- src/capnp/schema-parser-test.c++ \ +- src/capnp/dynamic-test.c++ \ +- src/capnp/stringify-test.c++ \ +- src/capnp/serialize-async-test.c++ \ +- src/capnp/serialize-text-test.c++ \ +- src/capnp/rpc-test.c++ \ +- src/capnp/rpc-twoparty-test.c++ \ +- src/capnp/ez-rpc-test.c++ \ +- src/capnp/compat/json-test.c++ \ +- src/capnp/compiler/lexer-test.c++ \ +- src/capnp/compiler/type-id-test.c++ +-capnp_test_LDADD = \ +- libcapnp-test.a \ +- libcapnpc.la \ +- libcapnp-rpc.la \ +- libcapnp-json.la \ +- libcapnp.la \ +- libkj-http.la \ +- $(MAYBE_KJ_GZIP_LA) \ +- $(MAYBE_KJ_TLS_LA) \ +- libkj-async.la \ +- libkj-test.la \ +- libkj.la \ +- $(ASYNC_LIBS) \ +- $(PTHREAD_LIBS) +- +-endif !LITE_MODE +- +-capnp_test_CPPFLAGS = -Wno-deprecated-declarations +-capnp_test_SOURCES = \ +- src/kj/common-test.c++ \ +- src/kj/memory-test.c++ \ +- src/kj/refcount-test.c++ \ +- src/kj/array-test.c++ \ +- src/kj/string-test.c++ \ +- src/kj/string-tree-test.c++ \ +- src/kj/table-test.c++ \ +- src/kj/map-test.c++ \ +- src/kj/encoding-test.c++ \ +- src/kj/exception-test.c++ \ +- src/kj/debug-test.c++ \ +- src/kj/arena-test.c++ \ +- src/kj/units-test.c++ \ +- src/kj/tuple-test.c++ \ +- src/kj/one-of-test.c++ \ +- src/kj/function-test.c++ \ +- src/kj/io-test.c++ \ +- src/kj/mutex-test.c++ \ +- src/kj/time-test.c++ \ +- src/kj/threadlocal-test.c++ \ +- src/kj/filesystem-test.c++ \ +- src/kj/filesystem-disk-test.c++ \ +- src/kj/test-test.c++ \ +- src/capnp/common-test.c++ \ +- src/capnp/blob-test.c++ \ +- src/capnp/endian-test.c++ \ +- src/capnp/endian-fallback-test.c++ \ +- src/capnp/endian-reverse-test.c++ \ +- src/capnp/layout-test.c++ \ +- src/capnp/any-test.c++ \ +- src/capnp/message-test.c++ \ +- src/capnp/encoding-test.c++ \ +- src/capnp/orphan-test.c++ \ +- src/capnp/serialize-test.c++ \ +- src/capnp/serialize-packed-test.c++ \ +- src/capnp/fuzz-test.c++ \ +- $(heavy_tests) +- +-if !LITE_MODE +-capnp_evolution_test_LDADD = libcapnpc.la libcapnp.la libkj.la +-capnp_evolution_test_SOURCES = src/capnp/compiler/evolution-test.c++ +- +-capnp_afl_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +-capnp_afl_testcase_SOURCES = src/capnp/afl-testcase.c++ +-endif !LITE_MODE +- +-if LITE_MODE +-TESTS = capnp-test +-else !LITE_MODE +-TESTS = capnp-test capnp-evolution-test src/capnp/compiler/capnp-test.sh +-endif !LITE_MODE diff --git a/recipes/capnproto/all/patches/0002-cmake-compat-header-install.patch b/recipes/capnproto/all/patches/0002-cmake-compat-header-install.patch new file mode 100644 index 0000000000000..8a3387f008dbf --- /dev/null +++ b/recipes/capnproto/all/patches/0002-cmake-compat-header-install.patch @@ -0,0 +1,28 @@ +--- a/c++/src/capnp/CMakeLists.txt ++++ b/c++/src/capnp/CMakeLists.txt +@@ -29,7 +29,6 @@ endif() + set(capnp_headers + c++.capnp.h + common.h +- compat/std-iterator.h + blob.h + endian.h + layout.h +@@ -55,6 +54,9 @@ set(capnp_headers + generated-header-support.h + raw-schema.h + ) ++set(capnp_compat_headers ++ compat/std-iterator.h ++) + set(capnp_schemas + c++.capnp + schema.capnp +@@ -72,6 +74,7 @@ target_include_directories(capnp INTERFACE + set_target_properties(capnp PROPERTIES VERSION ${VERSION}) + install(TARGETS capnp ${INSTALL_TARGETS_DEFAULT_ARGS}) + install(FILES ${capnp_headers} ${capnp_schemas} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/capnp") ++install(FILES ${capnp_compat_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/capnp/compat") + + set(capnp-rpc_sources + serialize-async.c++ diff --git a/recipes/capnproto/all/patches/0003-kj-tls-windows.patch b/recipes/capnproto/all/patches/0003-kj-tls-windows.patch new file mode 100644 index 0000000000000..b9ff8b3ee5003 --- /dev/null +++ b/recipes/capnproto/all/patches/0003-kj-tls-windows.patch @@ -0,0 +1,75 @@ +--- a/c++/CMakeLists.txt ++++ b/c++/CMakeLists.txt +@@ -41,6 +41,29 @@ else() + set(CAPNP_LITE_FLAG) + endif() + ++set(WITH_OPENSSL "AUTO" CACHE STRING ++ "Whether or not to build libkj-tls by linking against openssl") ++# define list of values GUI will offer for the variable ++set_property(CACHE WITH_OPENSSL PROPERTY STRINGS AUTO ON OFF) ++ ++# shadow cache variable original value with ON/OFF, ++# so from now on OpenSSL-specific code just has to check: ++# if (WITH_OPENSSL) ++# ... ++# endif() ++if (CAPNP_LITE) ++ set(WITH_OPENSSL OFF) ++elseif (WITH_OPENSSL STREQUAL "AUTO") ++ find_package(OpenSSL COMPONENTS Crypto SSL) ++ if (OPENSSL_FOUND) ++ set(WITH_OPENSSL ON) ++ else() ++ set(WITH_OPENSSL OFF) ++ endif() ++elseif (WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED COMPONENTS Crypto SSL) ++endif() ++ + if(MSVC) + # TODO(cleanup): Enable higher warning level in MSVC, but make sure to test + # build with that warning level and clean out false positives. +--- a/c++/src/kj/CMakeLists.txt ++++ b/c++/src/kj/CMakeLists.txt +@@ -163,6 +163,29 @@ if(NOT CAPNP_LITE) + install(FILES ${kj-http_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/compat") + endif() + ++# kj-tls ====================================================================== ++set(kj-tls_sources ++ compat/readiness-io.c++ ++ compat/tls.c++ ++) ++set(kj-tls_headers ++ compat/readiness-io.h ++ compat/tls.h ++) ++if(NOT CAPNP_LITE) ++ add_library(kj-tls ${kj-tls_sources}) ++ add_library(CapnProto::kj-tls ALIAS kj-tls) ++ target_link_libraries(kj-tls PUBLIC kj-async) ++ if (WITH_OPENSSL) ++ target_compile_definitions(kj-tls PRIVATE KJ_HAS_OPENSSL) ++ target_link_libraries(kj-tls PRIVATE OpenSSL::SSL OpenSSL::Crypto) ++ endif() ++ # Ensure the library has a version set to match autotools build ++ set_target_properties(kj-tls PROPERTIES VERSION ${VERSION}) ++ install(TARGETS kj-tls ${INSTALL_TARGETS_DEFAULT_ARGS}) ++ install(FILES ${kj-tls_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/compat") ++endif() ++ + # kj-gzip ====================================================================== + + set(kj-gzip_sources +--- a/c++/src/kj/compat/tls.c++ ++++ b/c++/src/kj/compat/tls.c++ +@@ -266,7 +266,7 @@ private: + kj::Promise sslCall(Func&& func) { + if (disconnected) return size_t(0); + +- ssize_t result = func(); ++ auto result = func(); + + if (result > 0) { + return result; diff --git a/recipes/capnproto/all/patches/0004-cmake-module-path.patch b/recipes/capnproto/all/patches/0004-cmake-module-path.patch new file mode 100644 index 0000000000000..712b8373a146c --- /dev/null +++ b/recipes/capnproto/all/patches/0004-cmake-module-path.patch @@ -0,0 +1,11 @@ +--- a/c++/CMakeLists.txt ++++ b/c++/CMakeLists.txt +@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1) + project("Cap'n Proto" CXX) + set(VERSION 0.8.0) + +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + include(CheckIncludeFileCXX) + include(GNUInstallDirs) diff --git a/recipes/capnproto/all/patches/0005-msvc-16.7-ice-workaround.patch b/recipes/capnproto/all/patches/0005-msvc-16.7-ice-workaround.patch new file mode 100644 index 0000000000000..5516d55443deb --- /dev/null +++ b/recipes/capnproto/all/patches/0005-msvc-16.7-ice-workaround.patch @@ -0,0 +1,28 @@ +Workaround for internal compiler error with msvc 16.7.x +patch from https://github.com/capnproto/capnproto/pull/1058 +--- a/c++/src/kj/one-of.h ++++ b/c++/src/kj/one-of.h +@@ -347,11 +347,23 @@ void OneOf::allHandled() { + auto _kj_switch_subject = (value)._switchSubject(); \ + switch (_kj_switch_subject->which()) + #endif ++#if !_MSC_VER || defined(__clang__) + #define KJ_CASE_ONEOF(name, ...) \ + break; \ + case ::kj::Decay::template tagFor<__VA_ARGS__>(): \ + for (auto& name = _kj_switch_subject->template get<__VA_ARGS__>(), *_kj_switch_done = &name; \ + _kj_switch_done; _kj_switch_done = nullptr) ++#else ++// TODO(msvc): The latest MSVC which ships with VS2019 now ICEs on the implementation above. It ++// appears we can hack around the problem by moving the `->template get<>()` syntax to an outer ++// `if`. (This unfortunately allows wonky syntax like `KJ_CASE_ONEOF(a, B) { } else { }`.) ++// https://developercommunity.visualstudio.com/content/problem/1143733/internal-compiler-error-on-v1670.html ++#define KJ_CASE_ONEOF(name, ...) \ ++ break; \ ++ case ::kj::Decay::template tagFor<__VA_ARGS__>(): \ ++ if (auto* _kj_switch_done = &_kj_switch_subject->template get<__VA_ARGS__>()) \ ++ for (auto& name = *_kj_switch_done; _kj_switch_done; _kj_switch_done = nullptr) ++#endif + #define KJ_CASE_ONEOF_DEFAULT break; default: + // Allows switching over a OneOf. + // diff --git a/recipes/capnproto/all/patches/0006-symlink.patch b/recipes/capnproto/all/patches/0006-symlink.patch new file mode 100644 index 0000000000000..ddf7b7ec382ec --- /dev/null +++ b/recipes/capnproto/all/patches/0006-symlink.patch @@ -0,0 +1,38 @@ +From fdbf035619ab2f9e25173bb7361e7e19a52e0fa1 Mon Sep 17 00:00:00 2001 +From: Thomas Arcila +Date: Sat, 9 Mar 2019 19:00:24 -0500 +Subject: [PATCH] Fix capnpc extension handling on Windows + +On Windows executables needs to end with .exe. +Fix this in CMakeLists.txt and update capnp detection code accordingly. +--- + c++/src/capnp/CMakeLists.txt | 2 +- + c++/src/capnp/compiler/capnp.c++ | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/c++/src/capnp/CMakeLists.txt b/c++/src/capnp/CMakeLists.txt +index 11cbf5afa..041697466 100644 +--- a/c++/src/capnp/CMakeLists.txt ++++ b/c++/src/capnp/CMakeLists.txt +@@ -182,7 +182,7 @@ if(NOT CAPNP_LITE) + install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS}) + + # Symlink capnpc -> capnp +- install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc\")") ++ install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp${CMAKE_EXECUTABLE_SUFFIX} \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc${CMAKE_EXECUTABLE_SUFFIX}\")") + endif() # NOT CAPNP_LITE + + # Tests ======================================================================== +diff --git a/c++/src/capnp/compiler/capnp.c++ b/c++/src/capnp/compiler/capnp.c++ +index 8e8c459b2..d252fb12b 100644 +--- a/c++/src/capnp/compiler/capnp.c++ ++++ b/c++/src/capnp/compiler/capnp.c++ +@@ -78,7 +78,7 @@ public: + : context(context), disk(kj::newDiskFilesystem()), loader(*this) {} + + kj::MainFunc getMain() { +- if (context.getProgramName().endsWith("capnpc")) { ++ if (context.getProgramName().endsWith("capnpc") || context.getProgramName().endsWith("capnpc.exe")) { + kj::MainBuilder builder(context, VERSION_STRING, + "Compiles Cap'n Proto schema files and generates corresponding source code in one or " + "more languages."); diff --git a/recipes/capnproto/all/patches/0007-cmake-module-path.patch b/recipes/capnproto/all/patches/0007-cmake-module-path.patch new file mode 100644 index 0000000000000..7ee7d0eb8de70 --- /dev/null +++ b/recipes/capnproto/all/patches/0007-cmake-module-path.patch @@ -0,0 +1,11 @@ +--- a/c++/CMakeLists.txt ++++ b/c++/CMakeLists.txt +@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1) + project("Cap'n Proto" CXX) + set(VERSION 0.7.0) + +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + include(CheckIncludeFileCXX) + include(GNUInstallDirs) diff --git a/recipes/capnproto/all/patches/0008-disable-tests.patch b/recipes/capnproto/all/patches/0008-disable-tests.patch new file mode 100644 index 0000000000000..dee1e36a10227 --- /dev/null +++ b/recipes/capnproto/all/patches/0008-disable-tests.patch @@ -0,0 +1,157 @@ +--- a/c++/Makefile.am ++++ b/c++/Makefile.am +@@ -403,154 +407,3 @@ endif LITE_MODE + # src/capnp/serialize-snappy* + # src/capnp/benchmark/... + # src/capnp/compiler/... +- +-# Tests ============================================================== +- +-test_capnpc_inputs = \ +- src/capnp/test.capnp \ +- src/capnp/test-import.capnp \ +- src/capnp/test-import2.capnp \ +- src/capnp/compat/json-test.capnp +- +-test_capnpc_outputs = \ +- src/capnp/test.capnp.c++ \ +- src/capnp/test.capnp.h \ +- src/capnp/test-import.capnp.c++ \ +- src/capnp/test-import.capnp.h \ +- src/capnp/test-import2.capnp.c++ \ +- src/capnp/test-import2.capnp.h \ +- src/capnp/compat/json-test.capnp.c++ \ +- src/capnp/compat/json-test.capnp.h +- +-if USE_EXTERNAL_CAPNP +- +-test_capnpc_middleman: $(test_capnpc_inputs) +- @$(MKDIR_P) src +- $(CAPNP) compile --src-prefix=$(srcdir)/src -o$(CAPNPC_CXX):src -I$(srcdir)/src $^ +- touch test_capnpc_middleman +- +-else +- +-test_capnpc_middleman: capnp$(EXEEXT) capnpc-c++$(EXEEXT) $(test_capnpc_inputs) +- @$(MKDIR_P) src +- echo $^ | (read CAPNP CAPNPC_CXX SOURCES && ./$$CAPNP compile --src-prefix=$(srcdir)/src -o./$$CAPNPC_CXX:src -I$(srcdir)/src $$SOURCES) +- touch test_capnpc_middleman +- +-endif +- +-$(test_capnpc_outputs): test_capnpc_middleman +- +-BUILT_SOURCES = $(test_capnpc_outputs) +- +-check_LIBRARIES = libcapnp-test.a +-libcapnp_test_a_SOURCES = \ +- src/capnp/test-util.c++ \ +- src/capnp/test-util.h +-nodist_libcapnp_test_a_SOURCES = $(test_capnpc_outputs) +- +-if LITE_MODE +- +-check_PROGRAMS = capnp-test +-compiler_tests = +-capnp_test_LDADD = libcapnp-test.a libcapnp.la libkj-test.la libkj.la +- +-else !LITE_MODE +- +-check_PROGRAMS = capnp-test capnp-evolution-test capnp-afl-testcase +-heavy_tests = \ +- src/kj/async-test.c++ \ +- src/kj/async-unix-test.c++ \ +- src/kj/async-win32-test.c++ \ +- src/kj/async-io-test.c++ \ +- src/kj/parse/common-test.c++ \ +- src/kj/parse/char-test.c++ \ +- src/kj/std/iostream-test.c++ \ +- src/kj/compat/url-test.c++ \ +- src/kj/compat/http-test.c++ \ +- src/kj/compat/gzip-test.c++ \ +- $(MAYBE_KJ_TLS_TESTS) \ +- src/capnp/canonicalize-test.c++ \ +- src/capnp/capability-test.c++ \ +- src/capnp/membrane-test.c++ \ +- src/capnp/schema-test.c++ \ +- src/capnp/schema-loader-test.c++ \ +- src/capnp/schema-parser-test.c++ \ +- src/capnp/dynamic-test.c++ \ +- src/capnp/stringify-test.c++ \ +- src/capnp/serialize-async-test.c++ \ +- src/capnp/serialize-text-test.c++ \ +- src/capnp/rpc-test.c++ \ +- src/capnp/rpc-twoparty-test.c++ \ +- src/capnp/ez-rpc-test.c++ \ +- src/capnp/compat/json-test.c++ \ +- src/capnp/compiler/lexer-test.c++ \ +- src/capnp/compiler/type-id-test.c++ +-capnp_test_LDADD = \ +- libcapnp-test.a \ +- libcapnpc.la \ +- libcapnp-rpc.la \ +- libcapnp-json.la \ +- libcapnp.la \ +- libkj-http.la \ +- $(MAYBE_KJ_TLS_LA) \ +- libkj-async.la \ +- libkj-test.la \ +- libkj.la \ +- $(ASYNC_LIBS) \ +- $(PTHREAD_LIBS) +- +-endif !LITE_MODE +- +-capnp_test_CPPFLAGS = -Wno-deprecated-declarations +-capnp_test_SOURCES = \ +- src/kj/common-test.c++ \ +- src/kj/memory-test.c++ \ +- src/kj/refcount-test.c++ \ +- src/kj/array-test.c++ \ +- src/kj/string-test.c++ \ +- src/kj/string-tree-test.c++ \ +- src/kj/table-test.c++ \ +- src/kj/map-test.c++ \ +- src/kj/encoding-test.c++ \ +- src/kj/exception-test.c++ \ +- src/kj/debug-test.c++ \ +- src/kj/arena-test.c++ \ +- src/kj/units-test.c++ \ +- src/kj/tuple-test.c++ \ +- src/kj/one-of-test.c++ \ +- src/kj/function-test.c++ \ +- src/kj/io-test.c++ \ +- src/kj/mutex-test.c++ \ +- src/kj/threadlocal-test.c++ \ +- src/kj/threadlocal-pthread-test.c++ \ +- src/kj/filesystem-test.c++ \ +- src/kj/filesystem-disk-test.c++ \ +- src/kj/test-test.c++ \ +- src/capnp/common-test.c++ \ +- src/capnp/blob-test.c++ \ +- src/capnp/endian-test.c++ \ +- src/capnp/endian-fallback-test.c++ \ +- src/capnp/endian-reverse-test.c++ \ +- src/capnp/layout-test.c++ \ +- src/capnp/any-test.c++ \ +- src/capnp/message-test.c++ \ +- src/capnp/encoding-test.c++ \ +- src/capnp/orphan-test.c++ \ +- src/capnp/serialize-test.c++ \ +- src/capnp/serialize-packed-test.c++ \ +- src/capnp/fuzz-test.c++ \ +- $(heavy_tests) +- +-if !LITE_MODE +-capnp_evolution_test_LDADD = libcapnpc.la libcapnp.la libkj.la +-capnp_evolution_test_SOURCES = src/capnp/compiler/evolution-test.c++ +- +-capnp_afl_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +-capnp_afl_testcase_SOURCES = src/capnp/afl-testcase.c++ +-endif !LITE_MODE +- +-if LITE_MODE +-TESTS = capnp-test +-else !LITE_MODE +-TESTS = capnp-test capnp-evolution-test src/capnp/compiler/capnp-test.sh +-endif !LITE_MODE diff --git a/recipes/capnproto/all/patches/0009-windows-symlink-fix-0.8.0.patch b/recipes/capnproto/all/patches/0009-windows-symlink-fix-0.8.0.patch new file mode 100644 index 0000000000000..47da876301b50 --- /dev/null +++ b/recipes/capnproto/all/patches/0009-windows-symlink-fix-0.8.0.patch @@ -0,0 +1,20 @@ +Workaround for install step on Windows where symlinks might be not supported. +This leads to the following error: +CMake error : failed to create symbolic link ... : operation not permitted +--- a/c++/src/capnp/CMakeLists.txt ++++ b/c++/src/capnp/CMakeLists.txt +@@ -188,8 +188,12 @@ if(NOT CAPNP_LITE) + + install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS}) + +- # Symlink capnpc -> capnp +- install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp${CMAKE_EXECUTABLE_SUFFIX} \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc${CMAKE_EXECUTABLE_SUFFIX}\")") ++ if(WIN32) ++ install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnp${CMAKE_EXECUTABLE_SUFFIX}\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc${CMAKE_EXECUTABLE_SUFFIX}\")") ++ else() ++ # Symlink capnpc -> capnp ++ install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp${CMAKE_EXECUTABLE_SUFFIX} \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc${CMAKE_EXECUTABLE_SUFFIX}\")") ++ endif() + endif() # NOT CAPNP_LITE + + # Tests ======================================================================== diff --git a/recipes/capnproto/all/patches/0010-disable-tests-for-0.9.1.patch b/recipes/capnproto/all/patches/0010-disable-tests-for-0.9.1.patch new file mode 100644 index 0000000000000..d421b4b60ddcc --- /dev/null +++ b/recipes/capnproto/all/patches/0010-disable-tests-for-0.9.1.patch @@ -0,0 +1,185 @@ +Disable tests for 0.9.1 + +--- + c++/Makefile.am | 168 ------------------------------------------------ + 1 file changed, 168 deletions(-) + +diff --git a/c++/Makefile.am b/c++/Makefile.am +index 1e3fd8e9..488e54d5 100644 +--- a/c++/Makefile.am ++++ b/c++/Makefile.am +@@ -444,171 +444,3 @@ endif LITE_MODE + # src/capnp/serialize-snappy* + # src/capnp/benchmark/... + # src/capnp/compiler/... +- +-# Tests ============================================================== +- +-test_capnpc_inputs = \ +- src/capnp/test.capnp \ +- src/capnp/test-import.capnp \ +- src/capnp/test-import2.capnp \ +- src/capnp/compat/json-test.capnp +- +-test_capnpc_outputs = \ +- src/capnp/test.capnp.c++ \ +- src/capnp/test.capnp.h \ +- src/capnp/test-import.capnp.c++ \ +- src/capnp/test-import.capnp.h \ +- src/capnp/test-import2.capnp.c++ \ +- src/capnp/test-import2.capnp.h \ +- src/capnp/compat/json-test.capnp.c++ \ +- src/capnp/compat/json-test.capnp.h +- +-if USE_EXTERNAL_CAPNP +- +-test_capnpc_middleman: $(test_capnpc_inputs) +- @$(MKDIR_P) src +- $(CAPNP) compile --src-prefix=$(srcdir)/src -o$(CAPNPC_CXX):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-else +- +-test_capnpc_middleman: capnp$(EXEEXT) capnpc-c++$(EXEEXT) $(test_capnpc_inputs) +- @$(MKDIR_P) src +- ./capnp$(EXEEXT) compile --src-prefix=$(srcdir)/src -o./capnpc-c++$(EXEEXT):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-endif +- +-$(test_capnpc_outputs): test_capnpc_middleman +- +-BUILT_SOURCES = $(test_capnpc_outputs) +- +-check_LIBRARIES = libcapnp-test.a +-libcapnp_test_a_SOURCES = \ +- src/capnp/test-util.c++ \ +- src/capnp/test-util.h +-nodist_libcapnp_test_a_SOURCES = $(test_capnpc_outputs) +- +-if LITE_MODE +- +-check_PROGRAMS = capnp-test +-compiler_tests = +-capnp_test_LDADD = libcapnp-test.a libcapnp.la libkj-test.la libkj.la +- +-else !LITE_MODE +- +-check_PROGRAMS = capnp-test capnp-evolution-test capnp-afl-testcase +-if HAS_FUZZING_ENGINE +- check_PROGRAMS += capnp-llvm-fuzzer-testcase +-endif +-heavy_tests = \ +- src/kj/async-test.c++ \ +- src/kj/async-xthread-test.c++ \ +- src/kj/async-unix-test.c++ \ +- src/kj/async-unix-xthread-test.c++ \ +- src/kj/async-win32-test.c++ \ +- src/kj/async-win32-xthread-test.c++ \ +- src/kj/async-io-test.c++ \ +- src/kj/async-queue-test.c++ \ +- src/kj/parse/common-test.c++ \ +- src/kj/parse/char-test.c++ \ +- src/kj/std/iostream-test.c++ \ +- src/kj/compat/url-test.c++ \ +- src/kj/compat/http-test.c++ \ +- $(MAYBE_KJ_GZIP_TESTS) \ +- $(MAYBE_KJ_TLS_TESTS) \ +- src/capnp/canonicalize-test.c++ \ +- src/capnp/capability-test.c++ \ +- src/capnp/membrane-test.c++ \ +- src/capnp/schema-test.c++ \ +- src/capnp/schema-loader-test.c++ \ +- src/capnp/schema-parser-test.c++ \ +- src/capnp/dynamic-test.c++ \ +- src/capnp/stringify-test.c++ \ +- src/capnp/serialize-async-test.c++ \ +- src/capnp/serialize-text-test.c++ \ +- src/capnp/rpc-test.c++ \ +- src/capnp/rpc-twoparty-test.c++ \ +- src/capnp/ez-rpc-test.c++ \ +- src/capnp/compat/json-test.c++ \ +- src/capnp/compat/websocket-rpc-test.c++ \ +- src/capnp/compiler/lexer-test.c++ \ +- src/capnp/compiler/type-id-test.c++ +-capnp_test_LDADD = \ +- libcapnp-test.a \ +- libcapnpc.la \ +- libcapnp-rpc.la \ +- libcapnp-websocket.la \ +- libcapnp-json.la \ +- libcapnp.la \ +- libkj-http.la \ +- $(MAYBE_KJ_GZIP_LA) \ +- $(MAYBE_KJ_TLS_LA) \ +- libkj-async.la \ +- libkj-test.la \ +- libkj.la \ +- $(ASYNC_LIBS) \ +- $(PTHREAD_LIBS) +- +-endif !LITE_MODE +- +-capnp_test_CPPFLAGS = -Wno-deprecated-declarations +-capnp_test_SOURCES = \ +- src/kj/common-test.c++ \ +- src/kj/memory-test.c++ \ +- src/kj/refcount-test.c++ \ +- src/kj/array-test.c++ \ +- src/kj/list-test.c++ \ +- src/kj/string-test.c++ \ +- src/kj/string-tree-test.c++ \ +- src/kj/table-test.c++ \ +- src/kj/map-test.c++ \ +- src/kj/encoding-test.c++ \ +- src/kj/exception-test.c++ \ +- src/kj/debug-test.c++ \ +- src/kj/arena-test.c++ \ +- src/kj/units-test.c++ \ +- src/kj/tuple-test.c++ \ +- src/kj/one-of-test.c++ \ +- src/kj/function-test.c++ \ +- src/kj/io-test.c++ \ +- src/kj/mutex-test.c++ \ +- src/kj/time-test.c++ \ +- src/kj/threadlocal-test.c++ \ +- src/kj/filesystem-test.c++ \ +- src/kj/filesystem-disk-test.c++ \ +- src/kj/test-test.c++ \ +- src/capnp/common-test.c++ \ +- src/capnp/blob-test.c++ \ +- src/capnp/endian-test.c++ \ +- src/capnp/endian-fallback-test.c++ \ +- src/capnp/endian-reverse-test.c++ \ +- src/capnp/layout-test.c++ \ +- src/capnp/any-test.c++ \ +- src/capnp/message-test.c++ \ +- src/capnp/encoding-test.c++ \ +- src/capnp/orphan-test.c++ \ +- src/capnp/serialize-test.c++ \ +- src/capnp/serialize-packed-test.c++ \ +- src/capnp/fuzz-test.c++ \ +- $(heavy_tests) +- +-if !LITE_MODE +-capnp_evolution_test_LDADD = libcapnpc.la libcapnp.la libkj.la +-capnp_evolution_test_SOURCES = src/capnp/compiler/evolution-test.c++ +- +-capnp_afl_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +-capnp_afl_testcase_SOURCES = src/capnp/afl-testcase.c++ +- +-if HAS_FUZZING_ENGINE +- capnp_llvm_fuzzer_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +- capnp_llvm_fuzzer_testcase_SOURCES = src/capnp/llvm-fuzzer-testcase.c++ +- capnp_llvm_fuzzer_testcase_LDFLAGS = $(LIB_FUZZING_ENGINE) +-endif +-endif !LITE_MODE +- +-if LITE_MODE +-TESTS = capnp-test +-else !LITE_MODE +-TESTS = capnp-test capnp-evolution-test src/capnp/compiler/capnp-test.sh +-endif !LITE_MODE +-- +2.31.1 + diff --git a/recipes/capnproto/all/patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch b/recipes/capnproto/all/patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch new file mode 100644 index 0000000000000..53ed03419e21d --- /dev/null +++ b/recipes/capnproto/all/patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch @@ -0,0 +1,39 @@ +From 509d27117c4e794f566ad37b1fdabb4b78be51ce Mon Sep 17 00:00:00 2001 +From: nyanpasu64 +Date: Sun, 19 Sep 2021 10:24:56 -0700 +Subject: [PATCH] Fix building test-helpers.c++ hasSubstring() on Windows C++17 + +The std::boyer_moore_horspool_searcher() codepath is complex and +untested, and was broken without being caught on CI, so remove it since +hasSubstring() isn't performance-critical. + +Partly reverts bd88a9157e81000168e03e281172da4fb04e5e45. +#include was added in that commit, so I assume it's unused +in the rest of this file and can safely be removed. +--- + c++/src/kj/test-helpers.c++ | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/c++/src/kj/test-helpers.c++ b/c++/src/kj/test-helpers.c++ +index c4fcbc19f..cd480a450 100644 +--- a/c++/src/kj/test-helpers.c++ ++++ b/c++/src/kj/test-helpers.c++ +@@ -34,8 +34,6 @@ + #include + #endif + +-#include +- + namespace kj { + namespace _ { // private + +@@ -49,9 +47,6 @@ bool hasSubstring(StringPtr haystack, StringPtr needle) { + + #if !defined(_WIN32) + return memmem(haystack.begin(), haystack.size(), needle.begin(), needle.size()) != nullptr; +-#elif defined(__cpp_lib_boyer_moore_searcher) +- std::boyer_moore_horspool_searcher searcher{needle.begin(), needle.size()}; +- return std::search(haystack.begin(), haystack.end(), searcher) != haystack.end(); + #else + // TODO(perf): This is not the best algorithm for substring matching. strstr can't be used + // because this is supposed to be safe to call on strings with embedded nulls. diff --git a/recipes/capnproto/all/patches/0012-msvc-nogdi-fix-0.9.1.patch b/recipes/capnproto/all/patches/0012-msvc-nogdi-fix-0.9.1.patch new file mode 100644 index 0000000000000..9c32cf5857633 --- /dev/null +++ b/recipes/capnproto/all/patches/0012-msvc-nogdi-fix-0.9.1.patch @@ -0,0 +1,29 @@ +--- c++/src/kj/windows-sanity.h ++++ c++/src/kj/windows-sanity.h +@@ -48,10 +48,13 @@ + // now, we use `#pragma once` to tell the compiler never to include this file again. + #pragma once + +-namespace win32 { +- const auto ERROR_ = ERROR; ++namespace kj_win32_workarounds { ++ // Namespace containing constant definitions intended to replace constants that are defined as ++ // macros in the Windows headers. Do not refer to this namespace directly, we'll import it into ++ // the global scope below. + + #ifdef ERROR // This could be absent if e.g. NOGDI was used. ++ const auto ERROR_ = ERROR; + #undef ERROR + const auto ERROR = ERROR_; + #endif +@@ -61,7 +64,8 @@ + typedef VOID_ VOID; + } + +-using win32::ERROR; +-using win32::VOID; ++// Pull our constant definitions into the global namespace -- but only if they don't already exist ++// in the global namespace. ++using namespace kj_win32_workarounds; + + #endif diff --git a/recipes/capnproto/all/patches/0013-disable-tests-for-0.10.0.patch b/recipes/capnproto/all/patches/0013-disable-tests-for-0.10.0.patch new file mode 100644 index 0000000000000..75da52bf1bbac --- /dev/null +++ b/recipes/capnproto/all/patches/0013-disable-tests-for-0.10.0.patch @@ -0,0 +1,177 @@ +diff --git a/c++/Makefile.am b/c++/Makefile.am +index b67b6b1..488e54d 100644 +--- a/c++/Makefile.am ++++ b/c++/Makefile.am +@@ -444,172 +444,3 @@ endif LITE_MODE + # src/capnp/serialize-snappy* + # src/capnp/benchmark/... + # src/capnp/compiler/... +- +-# Tests ============================================================== +- +-test_capnpc_inputs = \ +- src/capnp/test.capnp \ +- src/capnp/test-import.capnp \ +- src/capnp/test-import2.capnp \ +- src/capnp/compat/json-test.capnp +- +-test_capnpc_outputs = \ +- src/capnp/test.capnp.c++ \ +- src/capnp/test.capnp.h \ +- src/capnp/test-import.capnp.c++ \ +- src/capnp/test-import.capnp.h \ +- src/capnp/test-import2.capnp.c++ \ +- src/capnp/test-import2.capnp.h \ +- src/capnp/compat/json-test.capnp.c++ \ +- src/capnp/compat/json-test.capnp.h +- +-if USE_EXTERNAL_CAPNP +- +-test_capnpc_middleman: $(test_capnpc_inputs) +- @$(MKDIR_P) src +- $(CAPNP) compile --src-prefix=$(srcdir)/src -o$(CAPNPC_CXX):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-else +- +-test_capnpc_middleman: capnp$(EXEEXT) capnpc-c++$(EXEEXT) $(test_capnpc_inputs) +- @$(MKDIR_P) src +- ./capnp$(EXEEXT) compile --src-prefix=$(srcdir)/src -o./capnpc-c++$(EXEEXT):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-endif +- +-$(test_capnpc_outputs): test_capnpc_middleman +- +-BUILT_SOURCES = $(test_capnpc_outputs) +- +-check_LIBRARIES = libcapnp-test.a +-libcapnp_test_a_SOURCES = \ +- src/capnp/test-util.c++ \ +- src/capnp/test-util.h +-nodist_libcapnp_test_a_SOURCES = $(test_capnpc_outputs) +- +-if LITE_MODE +- +-check_PROGRAMS = capnp-test +-compiler_tests = +-capnp_test_LDADD = libcapnp-test.a libcapnp.la libkj-test.la libkj.la +- +-else !LITE_MODE +- +-check_PROGRAMS = capnp-test capnp-evolution-test capnp-afl-testcase +-if HAS_FUZZING_ENGINE +- check_PROGRAMS += capnp-llvm-fuzzer-testcase +-endif +-heavy_tests = \ +- src/kj/async-test.c++ \ +- src/kj/async-xthread-test.c++ \ +- src/kj/async-coroutine-test.c++ \ +- src/kj/async-unix-test.c++ \ +- src/kj/async-unix-xthread-test.c++ \ +- src/kj/async-win32-test.c++ \ +- src/kj/async-win32-xthread-test.c++ \ +- src/kj/async-io-test.c++ \ +- src/kj/async-queue-test.c++ \ +- src/kj/parse/common-test.c++ \ +- src/kj/parse/char-test.c++ \ +- src/kj/std/iostream-test.c++ \ +- src/kj/compat/url-test.c++ \ +- src/kj/compat/http-test.c++ \ +- $(MAYBE_KJ_GZIP_TESTS) \ +- $(MAYBE_KJ_TLS_TESTS) \ +- src/capnp/canonicalize-test.c++ \ +- src/capnp/capability-test.c++ \ +- src/capnp/membrane-test.c++ \ +- src/capnp/schema-test.c++ \ +- src/capnp/schema-loader-test.c++ \ +- src/capnp/schema-parser-test.c++ \ +- src/capnp/dynamic-test.c++ \ +- src/capnp/stringify-test.c++ \ +- src/capnp/serialize-async-test.c++ \ +- src/capnp/serialize-text-test.c++ \ +- src/capnp/rpc-test.c++ \ +- src/capnp/rpc-twoparty-test.c++ \ +- src/capnp/ez-rpc-test.c++ \ +- src/capnp/compat/json-test.c++ \ +- src/capnp/compat/websocket-rpc-test.c++ \ +- src/capnp/compiler/lexer-test.c++ \ +- src/capnp/compiler/type-id-test.c++ +-capnp_test_LDADD = \ +- libcapnp-test.a \ +- libcapnpc.la \ +- libcapnp-rpc.la \ +- libcapnp-websocket.la \ +- libcapnp-json.la \ +- libcapnp.la \ +- libkj-http.la \ +- $(MAYBE_KJ_GZIP_LA) \ +- $(MAYBE_KJ_TLS_LA) \ +- libkj-async.la \ +- libkj-test.la \ +- libkj.la \ +- $(ASYNC_LIBS) \ +- $(PTHREAD_LIBS) +- +-endif !LITE_MODE +- +-capnp_test_CPPFLAGS = -Wno-deprecated-declarations +-capnp_test_SOURCES = \ +- src/kj/common-test.c++ \ +- src/kj/memory-test.c++ \ +- src/kj/refcount-test.c++ \ +- src/kj/array-test.c++ \ +- src/kj/list-test.c++ \ +- src/kj/string-test.c++ \ +- src/kj/string-tree-test.c++ \ +- src/kj/table-test.c++ \ +- src/kj/map-test.c++ \ +- src/kj/encoding-test.c++ \ +- src/kj/exception-test.c++ \ +- src/kj/debug-test.c++ \ +- src/kj/arena-test.c++ \ +- src/kj/units-test.c++ \ +- src/kj/tuple-test.c++ \ +- src/kj/one-of-test.c++ \ +- src/kj/function-test.c++ \ +- src/kj/io-test.c++ \ +- src/kj/mutex-test.c++ \ +- src/kj/time-test.c++ \ +- src/kj/threadlocal-test.c++ \ +- src/kj/filesystem-test.c++ \ +- src/kj/filesystem-disk-test.c++ \ +- src/kj/test-test.c++ \ +- src/capnp/common-test.c++ \ +- src/capnp/blob-test.c++ \ +- src/capnp/endian-test.c++ \ +- src/capnp/endian-fallback-test.c++ \ +- src/capnp/endian-reverse-test.c++ \ +- src/capnp/layout-test.c++ \ +- src/capnp/any-test.c++ \ +- src/capnp/message-test.c++ \ +- src/capnp/encoding-test.c++ \ +- src/capnp/orphan-test.c++ \ +- src/capnp/serialize-test.c++ \ +- src/capnp/serialize-packed-test.c++ \ +- src/capnp/fuzz-test.c++ \ +- $(heavy_tests) +- +-if !LITE_MODE +-capnp_evolution_test_LDADD = libcapnpc.la libcapnp.la libkj.la +-capnp_evolution_test_SOURCES = src/capnp/compiler/evolution-test.c++ +- +-capnp_afl_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +-capnp_afl_testcase_SOURCES = src/capnp/afl-testcase.c++ +- +-if HAS_FUZZING_ENGINE +- capnp_llvm_fuzzer_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +- capnp_llvm_fuzzer_testcase_SOURCES = src/capnp/llvm-fuzzer-testcase.c++ +- capnp_llvm_fuzzer_testcase_LDFLAGS = $(LIB_FUZZING_ENGINE) +-endif +-endif !LITE_MODE +- +-if LITE_MODE +-TESTS = capnp-test +-else !LITE_MODE +-TESTS = capnp-test capnp-evolution-test src/capnp/compiler/capnp-test.sh +-endif !LITE_MODE diff --git a/recipes/capnproto/all/patches/0014-disable-tests-for-0.10.1.patch b/recipes/capnproto/all/patches/0014-disable-tests-for-0.10.1.patch new file mode 100644 index 0000000000000..218e656c58716 --- /dev/null +++ b/recipes/capnproto/all/patches/0014-disable-tests-for-0.10.1.patch @@ -0,0 +1,176 @@ +diff --git a/c++/Makefile.am b/c++/Makefile.am +index 40a1d95..08f6eda 100644 +--- a/c++/Makefile.am ++++ b/c++/Makefile.am +@@ -446,171 +446,3 @@ endif LITE_MODE + # src/capnp/benchmark/... + # src/capnp/compiler/... + +-# Tests ============================================================== +- +-test_capnpc_inputs = \ +- src/capnp/test.capnp \ +- src/capnp/test-import.capnp \ +- src/capnp/test-import2.capnp \ +- src/capnp/compat/json-test.capnp +- +-test_capnpc_outputs = \ +- src/capnp/test.capnp.c++ \ +- src/capnp/test.capnp.h \ +- src/capnp/test-import.capnp.c++ \ +- src/capnp/test-import.capnp.h \ +- src/capnp/test-import2.capnp.c++ \ +- src/capnp/test-import2.capnp.h \ +- src/capnp/compat/json-test.capnp.c++ \ +- src/capnp/compat/json-test.capnp.h +- +-if USE_EXTERNAL_CAPNP +- +-test_capnpc_middleman: $(test_capnpc_inputs) +- @$(MKDIR_P) src +- $(CAPNP) compile --src-prefix=$(srcdir)/src -o$(CAPNPC_CXX):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-else +- +-test_capnpc_middleman: capnp$(EXEEXT) capnpc-c++$(EXEEXT) $(test_capnpc_inputs) +- @$(MKDIR_P) src +- ./capnp$(EXEEXT) compile --src-prefix=$(srcdir)/src -o./capnpc-c++$(EXEEXT):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-endif +- +-$(test_capnpc_outputs): test_capnpc_middleman +- +-BUILT_SOURCES = $(test_capnpc_outputs) +- +-check_LIBRARIES = libcapnp-test.a +-libcapnp_test_a_SOURCES = \ +- src/capnp/test-util.c++ \ +- src/capnp/test-util.h +-nodist_libcapnp_test_a_SOURCES = $(test_capnpc_outputs) +- +-if LITE_MODE +- +-check_PROGRAMS = capnp-test +-compiler_tests = +-capnp_test_LDADD = libcapnp-test.a libcapnp.la libkj-test.la libkj.la +- +-else !LITE_MODE +- +-check_PROGRAMS = capnp-test capnp-evolution-test capnp-afl-testcase +-if HAS_FUZZING_ENGINE +- check_PROGRAMS += capnp-llvm-fuzzer-testcase +-endif +-heavy_tests = \ +- src/kj/async-test.c++ \ +- src/kj/async-xthread-test.c++ \ +- src/kj/async-coroutine-test.c++ \ +- src/kj/async-unix-test.c++ \ +- src/kj/async-unix-xthread-test.c++ \ +- src/kj/async-win32-test.c++ \ +- src/kj/async-win32-xthread-test.c++ \ +- src/kj/async-io-test.c++ \ +- src/kj/async-queue-test.c++ \ +- src/kj/parse/common-test.c++ \ +- src/kj/parse/char-test.c++ \ +- src/kj/std/iostream-test.c++ \ +- src/kj/compat/url-test.c++ \ +- src/kj/compat/http-test.c++ \ +- $(MAYBE_KJ_GZIP_TESTS) \ +- $(MAYBE_KJ_TLS_TESTS) \ +- src/capnp/canonicalize-test.c++ \ +- src/capnp/capability-test.c++ \ +- src/capnp/membrane-test.c++ \ +- src/capnp/schema-test.c++ \ +- src/capnp/schema-loader-test.c++ \ +- src/capnp/schema-parser-test.c++ \ +- src/capnp/dynamic-test.c++ \ +- src/capnp/stringify-test.c++ \ +- src/capnp/serialize-async-test.c++ \ +- src/capnp/serialize-text-test.c++ \ +- src/capnp/rpc-test.c++ \ +- src/capnp/rpc-twoparty-test.c++ \ +- src/capnp/ez-rpc-test.c++ \ +- src/capnp/compat/json-test.c++ \ +- src/capnp/compat/websocket-rpc-test.c++ \ +- src/capnp/compiler/lexer-test.c++ \ +- src/capnp/compiler/type-id-test.c++ +-capnp_test_LDADD = \ +- libcapnp-test.a \ +- libcapnpc.la \ +- libcapnp-rpc.la \ +- libcapnp-websocket.la \ +- libcapnp-json.la \ +- libcapnp.la \ +- libkj-http.la \ +- $(MAYBE_KJ_GZIP_LA) \ +- $(MAYBE_KJ_TLS_LA) \ +- libkj-async.la \ +- libkj-test.la \ +- libkj.la \ +- $(ASYNC_LIBS) \ +- $(PTHREAD_LIBS) +- +-endif !LITE_MODE +- +-capnp_test_CPPFLAGS = -Wno-deprecated-declarations +-capnp_test_SOURCES = \ +- src/kj/common-test.c++ \ +- src/kj/memory-test.c++ \ +- src/kj/refcount-test.c++ \ +- src/kj/array-test.c++ \ +- src/kj/list-test.c++ \ +- src/kj/string-test.c++ \ +- src/kj/string-tree-test.c++ \ +- src/kj/table-test.c++ \ +- src/kj/map-test.c++ \ +- src/kj/encoding-test.c++ \ +- src/kj/exception-test.c++ \ +- src/kj/debug-test.c++ \ +- src/kj/arena-test.c++ \ +- src/kj/units-test.c++ \ +- src/kj/tuple-test.c++ \ +- src/kj/one-of-test.c++ \ +- src/kj/function-test.c++ \ +- src/kj/io-test.c++ \ +- src/kj/mutex-test.c++ \ +- src/kj/time-test.c++ \ +- src/kj/threadlocal-test.c++ \ +- src/kj/filesystem-test.c++ \ +- src/kj/filesystem-disk-test.c++ \ +- src/kj/test-test.c++ \ +- src/capnp/common-test.c++ \ +- src/capnp/blob-test.c++ \ +- src/capnp/endian-test.c++ \ +- src/capnp/endian-fallback-test.c++ \ +- src/capnp/endian-reverse-test.c++ \ +- src/capnp/layout-test.c++ \ +- src/capnp/any-test.c++ \ +- src/capnp/message-test.c++ \ +- src/capnp/encoding-test.c++ \ +- src/capnp/orphan-test.c++ \ +- src/capnp/serialize-test.c++ \ +- src/capnp/serialize-packed-test.c++ \ +- src/capnp/fuzz-test.c++ \ +- $(heavy_tests) +- +-if !LITE_MODE +-capnp_evolution_test_LDADD = libcapnpc.la libcapnp.la libkj.la +-capnp_evolution_test_SOURCES = src/capnp/compiler/evolution-test.c++ +- +-capnp_afl_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +-capnp_afl_testcase_SOURCES = src/capnp/afl-testcase.c++ +- +-if HAS_FUZZING_ENGINE +- capnp_llvm_fuzzer_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +- capnp_llvm_fuzzer_testcase_SOURCES = src/capnp/llvm-fuzzer-testcase.c++ +- capnp_llvm_fuzzer_testcase_LDFLAGS = $(LIB_FUZZING_ENGINE) +-endif +-endif !LITE_MODE +- +-if LITE_MODE +-TESTS = capnp-test +-else !LITE_MODE +-TESTS = capnp-test capnp-evolution-test src/capnp/compiler/capnp-test.sh +-endif !LITE_MODE diff --git a/recipes/capnproto/all/test_package/CMakeLists.txt b/recipes/capnproto/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ffc65e9ffa4b --- /dev/null +++ b/recipes/capnproto/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +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}) +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++ new file mode 100644 index 0000000000000..b2bece9472b88 --- /dev/null +++ b/recipes/capnproto/all/test_package/addressbook.c++ @@ -0,0 +1,288 @@ +// 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 new file mode 100644 index 0000000000000..1a6c60937e8af --- /dev/null +++ b/recipes/capnproto/all/test_package/addressbook.capnp @@ -0,0 +1,55 @@ +# 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++ new file mode 100644 index 0000000000000..5d8452921cde9 --- /dev/null +++ b/recipes/capnproto/all/test_package/calculator-client.c++ @@ -0,0 +1,367 @@ +// 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++ new file mode 100644 index 0000000000000..c2593be3a9064 --- /dev/null +++ b/recipes/capnproto/all/test_package/calculator-server.c++ @@ -0,0 +1,215 @@ +// 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 new file mode 100644 index 0000000000000..adc8294e57578 --- /dev/null +++ b/recipes/capnproto/all/test_package/calculator.capnp @@ -0,0 +1,118 @@ +# 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 new file mode 100644 index 0000000000000..d4d32590a51cc --- /dev/null +++ b/recipes/capnproto/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps" + test_type = "explicit" + + 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) + + def generate(self): + VirtualRunEnv(self).generate() + if hasattr(self, "settings_build") and cross_building(self): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "addressbook") + self.run(f"{bin_path} write", env="conanrun") diff --git a/recipes/capnproto/all/test_v1_package/CMakeLists.txt b/recipes/capnproto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/capnproto/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/capnproto/all/test_v1_package/conanfile.py b/recipes/capnproto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9c7aa58ab8868 --- /dev/null +++ b/recipes/capnproto/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000000000..89d97bce3d850 --- /dev/null +++ b/recipes/capnproto/config.yml @@ -0,0 +1,13 @@ +versions: + "0.10.3": + folder: all + "0.10.1": + folder: all + "0.10.0": + folder: all + "0.9.1": + folder: all + "0.8.0": + folder: all + "0.7.0": + folder: all diff --git a/recipes/capstone/all/conandata.yml b/recipes/capstone/all/conandata.yml new file mode 100644 index 0000000000000..7e93927333e67 --- /dev/null +++ b/recipes/capstone/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.0.2": + url: "https://github.com/capstone-engine/capstone/archive/refs/tags/4.0.2.tar.gz" + sha256: "7c81d798022f81e7507f1a60d6817f63aa76e489aa4e7055255f21a22f5e526a" diff --git a/recipes/capstone/all/conanfile.py b/recipes/capstone/all/conanfile.py new file mode 100644 index 0000000000000..148a51bb1323b --- /dev/null +++ b/recipes/capstone/all/conanfile.py @@ -0,0 +1,86 @@ +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, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class CapstoneConan(ConanFile): + name = "capstone" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.capstone-engine.org" + description = ( + "Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, " + "EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, " + "TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings." + ) + topics = ( + "reverse-engineering", "disassembler", "security", "framework", "arm", "arm64", + "x86", "sparc", "powerpc", "mips", "x86-64", "ethereum", "systemz", + "webassembly", "m68k", "m0s65xx", "m680x", "tms320c64x", "bpf", "riscv", + ) + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_default_alloc": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_default_alloc": True, + } + + _archs = ["arm", "m68k", "mips", "ppc", "sparc", "sysz", "xcore", "x86", "tms320c64x", "m680x", "evm"] + options.update({a: [True, False] for a in _archs}) + default_options.update({a: True for a in _archs}) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CAPSTONE_BUILD_STATIC"] = not self.options.shared + tc.variables["CAPSTONE_BUILD_SHARED"] = self.options.shared + tc.variables["CAPSTONE_BUILD_TESTS"] = False + tc.variables["CAPSTONE_BUILD_CSTOOL"] = False + tc.variables["CAPSTONE_ARCHITECUTRE_DEFAULT"] = False + tc.variables["CAPSTONE_USE_SYS_DYN_MEM"] = self.options.use_default_alloc + for a in self._archs: + tc.variables[f"CAPSTONE_{a.upper()}_SUPPORT"] = self.options.get_safe(a) + tc.variables["CAPSTONE_BUILD_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + + def build(self): + 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): + suffix = "_dll" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"capstone{suffix}"] + if self.options.shared: + self.cpp_info.defines.append("CAPSTONE_SHARED") diff --git a/recipes/capstone/all/test_package/CMakeLists.txt b/recipes/capstone/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c02e4fe66493 --- /dev/null +++ b/recipes/capstone/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(capstone REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE capstone::capstone) diff --git a/recipes/capstone/all/test_package/conanfile.py b/recipes/capstone/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/capstone/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/capstone/all/test_package/test_package.c b/recipes/capstone/all/test_package/test_package.c new file mode 100644 index 0000000000000..d4eb7c1056875 --- /dev/null +++ b/recipes/capstone/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int main() +{ + int major = 0, minor = 0; + cs_version(&major, &minor); + printf("capstone version %d.%d\n", major, minor); + return EXIT_SUCCESS; +} diff --git a/recipes/capstone/all/test_v1_package/CMakeLists.txt b/recipes/capstone/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/capstone/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/capstone/all/test_v1_package/conanfile.py b/recipes/capstone/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/capstone/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/capstone/config.yml b/recipes/capstone/config.yml new file mode 100644 index 0000000000000..6ce0808b6e1f0 --- /dev/null +++ b/recipes/capstone/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.2": + folder: "all" diff --git a/recipes/cargs/all/CMakeLists.txt b/recipes/cargs/all/CMakeLists.txt new file mode 100644 index 0000000000000..42d6e7408fb33 --- /dev/null +++ b/recipes/cargs/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.9.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/cargs/all/conandata.yml b/recipes/cargs/all/conandata.yml new file mode 100644 index 0000000000000..21e38ee9fe720 --- /dev/null +++ b/recipes/cargs/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.3": + url: "https://github.com/likle/cargs/archive/v1.0.3.tar.gz" + sha256: "ddba25bd35e9c6c75bc706c126001b8ce8e084d40ef37050e6aa6963e836eb8b" + "1.0.1": + url: "https://github.com/likle/cargs/archive/v1.0.1.tar.gz" + sha256: "1ff43742857e1ae8f6d76a98c92631ca2095f121a0d7b566f8c4d1f811c3387b" + "1.0.0": + url: "https://github.com/likle/cargs/archive/v1.0.0.zip" + sha256: "c9fc3fa6086ea1086ef89ac688508579a4f7e59730bd2a1fd1646d97a05078ba" diff --git a/recipes/cargs/all/conanfile.py b/recipes/cargs/all/conanfile.py new file mode 100644 index 0000000000000..6aeeae1d3b488 --- /dev/null +++ b/recipes/cargs/all/conanfile.py @@ -0,0 +1,68 @@ +import os +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + + +class CargsConan(ConanFile): + name = "cargs" + description = "A lightweight getopt replacement that works on Linux, " \ + "Windows and macOS. Command line argument parser library" \ + " for C/C++. Can be used to parse argv and argc parameters." + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://likle.github.io/cargs/" + topics = ("cargs", "cross-platform", "windows", "macos", "osx", "linux", + "getopt", "getopt-long", "command-line-parser", "command-line", + "arguments", "argument-parser") + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + 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" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + cmake = CMake(self) + cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared and self.settings.os == "Windows" + cmake.configure(build_folder=self._build_subfolder) + cmake.build(target="cargs") + + def package(self): + include_dir = os.path.join(self._source_subfolder, 'include') + lib_dir = os.path.join(self._build_subfolder, "lib") + bin_dir = os.path.join(self._build_subfolder, "bin") + + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + self.copy("cargs.h", dst="include", src=include_dir) + self.copy(pattern="*.a", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*.lib", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*.dylib", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*.so*", dst="lib", src=lib_dir, keep_path=False, + symlinks=True) + self.copy(pattern="*.dll", dst="bin", src=bin_dir, keep_path=False) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/cargs/all/test_package/CMakeLists.txt b/recipes/cargs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f6bb6f79f518f --- /dev/null +++ b/recipes/cargs/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11) diff --git a/recipes/cargs/all/test_package/conanfile.py b/recipes/cargs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4903f1a7e8fa0 --- /dev/null +++ b/recipes/cargs/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/cargs/all/test_package/test_package.c b/recipes/cargs/all/test_package/test_package.c new file mode 100644 index 0000000000000..c8e7d199c514f --- /dev/null +++ b/recipes/cargs/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include + +static struct cag_option options[] = {{.identifier = 's', + .access_letters = "s", + .access_name = NULL, + .value_name = NULL, + .description = "Simple flag"}}; + +int main(int argc, char *argv[]) { + cag_option_context context; + cag_option_prepare(&context, options, CAG_ARRAY_SIZE(options), argc, argv); + + return EXIT_SUCCESS; +} diff --git a/recipes/cargs/config.yml b/recipes/cargs/config.yml new file mode 100644 index 0000000000000..63312af6d65c1 --- /dev/null +++ b/recipes/cargs/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.3": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all diff --git a/recipes/cassandra-cpp-driver/all/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/CMakeLists.txt new file mode 100644 index 0000000000000..7f03984bd9149 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cassandra C CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/cassandra-cpp-driver/all/conandata.yml b/recipes/cassandra-cpp-driver/all/conandata.yml new file mode 100644 index 0000000000000..0ca8371b0b30f --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.15.3": + url: "https://github.com/datastax/cpp-driver/archive/2.15.3.zip" + sha256: "494b35418f1eaa86d80572a4254b7fae88a1341dcda83788ed038ce4f39117cb" +patches: + "2.15.3": + - base_path: "source_subfolder" + patch_file: "patches/2.15.3/fix-cmake.patch" + - base_path: "source_subfolder" + patch_file: "patches/2.15.3/fix-rapidjson.patch" diff --git a/recipes/cassandra-cpp-driver/all/conanfile.py b/recipes/cassandra-cpp-driver/all/conanfile.py new file mode 100644 index 0000000000000..76b1d99adf12b --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/conanfile.py @@ -0,0 +1,155 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class CassandraCppDriverConan(ConanFile): + name = "cassandra-cpp-driver" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://docs.datastax.com/en/developer/cpp-driver/" + description = "DataStax C/C++ Driver for Apache Cassandra and DataStax Products" + topics = ("cassandra", "cpp-driver", "database", "conan-recipe") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "install_header_in_subdir": [True, False], + "use_atomic": [None, "boost", "std"], + "with_openssl": [True, False], + "with_zlib": [True, False], + "with_kerberos": [True, False], + "use_timerfd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "install_header_in_subdir": False, + "use_atomic": None, + "with_openssl": True, + "with_zlib": True, + "with_kerberos": False, + "use_timerfd": True, + } + + short_paths = True + generators = "cmake" + exports_sources = [ + "CMakeLists.txt", + "patches/*" + ] + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.use_timerfd + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("libuv/1.44.1") + self.requires("http_parser/2.9.4") + self.requires("rapidjson/cci.20211112") + + if self.options.with_openssl: + self.requires("openssl/1.1.1q") + + if self.options.with_zlib: + self.requires("minizip/1.2.12") + self.requires("zlib/1.2.12") + + if self.options.use_atomic == "boost": + self.requires("boost/1.79.0") + + def validate(self): + if self.options.use_atomic == "boost": + # Compilation error on Linux + if self.settings.os == "Linux": + raise ConanInvalidConfiguration( + "Boost.Atomic is not supported on Linux at the moment") + + if self.options.with_kerberos: + raise ConanInvalidConfiguration( + "Kerberos is not supported at the moment") + + 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) + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"", + "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"AppleClang\"") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["VERSION"] = self.version + self._cmake.definitions["CASS_BUILD_EXAMPLES"] = False + self._cmake.definitions["CASS_BUILD_INTEGRATION_TESTS"] = False + self._cmake.definitions["CASS_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["CASS_BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["CASS_BUILD_TESTS"] = False + self._cmake.definitions["CASS_BUILD_UNIT_TESTS"] = False + self._cmake.definitions["CASS_DEBUG_CUSTOM_ALLOC"] = False + self._cmake.definitions["CASS_INSTALL_HEADER_IN_SUBDIR"] = self.options.install_header_in_subdir + self._cmake.definitions["CASS_INSTALL_PKG_CONFIG"] = False + + if self.options.use_atomic == "boost": + self._cmake.definitions["CASS_USE_BOOST_ATOMIC"] = True + self._cmake.definitions["CASS_USE_STD_ATOMIC"] = False + + elif self.options.use_atomic == "std": + self._cmake.definitions["CASS_USE_BOOST_ATOMIC"] = False + self._cmake.definitions["CASS_USE_STD_ATOMIC"] = True + else: + self._cmake.definitions["CASS_USE_BOOST_ATOMIC"] = False + self._cmake.definitions["CASS_USE_STD_ATOMIC"] = False + + self._cmake.definitions["CASS_USE_OPENSSL"] = self.options.with_openssl + self._cmake.definitions["CASS_USE_STATIC_LIBS"] = False + self._cmake.definitions["CASS_USE_ZLIB"] = self.options.with_zlib + self._cmake.definitions["CASS_USE_LIBSSH2"] = False + + # FIXME: To use kerberos, its conan package is needed. Uncomment this when kerberos conan package is ready. + # self._cmake.definitions["CASS_USE_KERBEROS"] = self.options.with_kerberos + + if self.settings.os == "Linux": + self._cmake.definitions["CASS_USE_TIMERFD"] = self.options.use_timerfd + + self._cmake.configure() + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["iphlpapi", "psapi", "wsock32", + "crypt32", "ws2_32", "userenv", "version"]) + if not self.options.shared: + self.cpp_info.defines = ["CASS_STATIC"] diff --git a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch new file mode 100644 index 0000000000000..191d2eb7e8174 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch @@ -0,0 +1,159 @@ + CMakeLists.txt | 4 --- + src/CMakeLists.txt | 84 ++++++++++++++++++++++++++++++++++++------------------ + 2 files changed, 57 insertions(+), 31 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6150948b..669eb086e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,3 @@ +-cmake_minimum_required(VERSION 2.8.12) +-project(cassandra C CXX) +- + set(CASS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + set(CASS_SRC_DIR "${CASS_ROOT_DIR}/src") + set(CASS_INCLUDE_DIR "${CASS_ROOT_DIR}/include") +@@ -81,7 +78,6 @@ endif() + # Dependencies + #------------------------ + +-include(Dependencies) + include(ClangFormat) + + #------------------------ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 06b84b759..7e81b2a06 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,6 +1,50 @@ + include(CheckSymbolExists) + include(CheckCXXSourceCompiles) + ++#------------------------ ++# Windows libraries ++#------------------------ ++ ++if(WIN32) ++ # Assign additional library requirements for Windows ++ set(CASS_LIBS iphlpapi psapi wsock32 crypt32 ws2_32 userenv version) ++endif() ++ ++#------------------------ ++# Libuv ++#------------------------ ++ ++if(NOT WIN32) ++ set(CMAKE_THREAD_PREFER_PTHREAD 1) ++ set(THREADS_PREFER_PTHREAD_FLAG 1) ++endif() ++ ++find_package(Threads REQUIRED) ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") ++if(NOT WIN32 AND ${CMAKE_VERSION} VERSION_LESS "3.1.0") ++ # FindThreads in CMake versions < v3.1.0 do not have the THREADS_PREFER_PTHREAD_FLAG to prefer -pthread ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") ++endif() ++ ++#------------------------ ++# Boost ++#------------------------ ++ ++if(CASS_USE_BOOST_ATOMIC) ++ # Ensure Boost auto linking is disabled (defaults to auto linking on Windows) ++ if(WIN32) ++ add_definitions(-DBOOST_ALL_NO_LIB) ++ endif() ++ ++ # Determine if additional Boost definitions are required for driver/executables ++ if(NOT WIN32) ++ # Handle explicit initialization warning in atomic/details/casts ++ add_definitions(-Wno-missing-field-initializers) ++ endif() ++endif() ++ + file(GLOB SOURCES *.cpp *.hpp) + + if(APPLE) +@@ -38,18 +82,14 @@ endif() + + add_subdirectory(third_party/curl) + add_subdirectory(third_party/hdr_histogram) +-add_subdirectory(third_party/http-parser) +-add_subdirectory(third_party/minizip) + add_subdirectory(third_party/sparsehash) + + list(APPEND INCLUDE_DIRS +- third_party/curl +- third_party/hdr_histogram +- third_party/http-parser +- third_party/minizip +- third_party/mt19937_64 ++ third_party/curl # FIXME: Use conan package ++ third_party/hdr_histogram # FIXME: Use conan package ++ third_party/mt19937_64 # FIXME: Use conan package ++ third_party/sparsehash/src) # FIXME: Use conan package + third_party/rapidjson/rapidjson +- third_party/sparsehash/src) + + list(APPEND INCLUDE_DIRS ${CASS_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +@@ -69,12 +109,6 @@ if(WIN32) + endif() + endif() + +-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion -Wno-sign-conversion -Wno-shorten-64-to-32 -Wno-undefined-var-template -Werror") +-elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # To many superfluous warnings generated with GCC when using -Wconversion (see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +-endif() +- + #------------------------------ + # Build configured header + #------------------------------ +@@ -130,11 +164,11 @@ if(CASS_BUILD_SHARED) + add_library(cassandra SHARED + ${SOURCES} + $ +- $ +- $ +- $) ++ $) + target_link_libraries(cassandra ${CASS_LIBS}) +- target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) ++ target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS}) ++ ++ conan_target_link_libraries(cassandra) + + set_target_properties(cassandra PROPERTIES OUTPUT_NAME cassandra) + set_target_properties(cassandra PROPERTIES VERSION ${PROJECT_VERSION_STRING} SOVERSION ${PROJECT_VERSION_MAJOR}) +@@ -167,11 +201,12 @@ if(CASS_BUILD_STATIC) + add_library(cassandra_static STATIC + ${SOURCES} + $ +- $ +- $ +- $) ++ $) ++ + target_link_libraries(cassandra_static ${CASS_LIBS}) +- target_include_directories(cassandra_static PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) ++ target_include_directories(cassandra_static PRIVATE ${INCLUDE_DIRS}) ++ ++ conan_target_link_libraries(cassandra_static) + + set_target_properties(cassandra_static PROPERTIES OUTPUT_NAME cassandra_static) + set_target_properties(cassandra_static PROPERTIES VERSION ${PROJECT_VERSION_STRING} SOVERSION ${PROJECT_VERSION_MAJOR}) +@@ -274,11 +309,6 @@ if(CASS_BUILD_SHARED) + endif() + endif() + endif() +- if(WIN32) +- install(FILES $ +- DESTINATION "${INSTALL_DLL_EXE_DIR}" +- OPTIONAL) +- endif() + endif() + + if(CASS_BUILD_STATIC) diff --git a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch new file mode 100644 index 0000000000000..7c7b5d16994d7 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch @@ -0,0 +1,38 @@ + src/CMakeLists.txt | 1 - + src/json.hpp | 8 ++++---- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7e81b2a06..2f3229292 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -89,7 +89,6 @@ list(APPEND INCLUDE_DIRS + third_party/hdr_histogram # FIXME: Use conan package + third_party/mt19937_64 # FIXME: Use conan package + third_party/sparsehash/src) # FIXME: Use conan package +- third_party/rapidjson/rapidjson + + list(APPEND INCLUDE_DIRS ${CASS_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +diff --git a/src/json.hpp b/src/json.hpp +index 620536e55..6003f2521 100644 +--- a/src/json.hpp ++++ b/src/json.hpp +@@ -48,13 +48,13 @@ static void delete_(T* ptr) { + #define RAPIDJSON_NEW(x) ::datastax::internal::json::new_ + #define RAPIDJSON_DELETE(x) ::datastax::internal::json::delete_(x) + +-#include "third_party/rapidjson/rapidjson/document.h" +-#include "third_party/rapidjson/rapidjson/stringbuffer.h" ++#include ++#include + #ifndef JSON_DEBUG +-#include "third_party/rapidjson/rapidjson/writer.h" ++#include + #define JSON_WRITE_TYPE Writer + #else +-#include "third_party/rapidjson/rapidjson/prettywriter.h" ++#include + #define JSON_WRITE_TYPE PrettyWriter + #endif + diff --git a/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1a95218e3d7a5 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} main.cpp) + +conan_target_link_libraries(${PROJECT_NAME}) diff --git a/recipes/cassandra-cpp-driver/all/test_package/conanfile.py b/recipes/cassandra-cpp-driver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0399475aec987 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os.path +from conans import ConanFile, CMake, tools + + +class CassandraCppDriverTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cassandra-cpp-driver/all/test_package/main.cpp b/recipes/cassandra-cpp-driver/all/test_package/main.cpp new file mode 100644 index 0000000000000..00efd3f961bc4 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/test_package/main.cpp @@ -0,0 +1,18 @@ +#include +/* Use "#include " when connecting to DataStax Enterpise */ +#include + +int main(int argc, char* argv[]) { + CassUuid uuid; + cass_uuid_from_string("550e8400-e29b-41d4-a716-446655440000", &uuid); + + cass_uint64_t timestamp = cass_uuid_timestamp(uuid); + + char uuid_str[CASS_UUID_STRING_LENGTH]; + cass_uuid_string(uuid, uuid_str); + + std::cout<<"timestamp: " << timestamp << std::endl; + std::cout<<"uuid_str: " << uuid_str << std::endl; + + return 0; +} diff --git a/recipes/cassandra-cpp-driver/config.yml b/recipes/cassandra-cpp-driver/config.yml new file mode 100644 index 0000000000000..9792bd17fcc93 --- /dev/null +++ b/recipes/cassandra-cpp-driver/config.yml @@ -0,0 +1,3 @@ +versions: + "2.15.3": + folder: all diff --git a/recipes/catch2/2.x.x/conandata.yml b/recipes/catch2/2.x.x/conandata.yml new file mode 100644 index 0000000000000..9e23bc009801d --- /dev/null +++ b/recipes/catch2/2.x.x/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.13.10": + url: "https://github.com/catchorg/Catch2/archive/v2.13.10.tar.gz" + sha256: "d54a712b7b1d7708bc7a819a8e6e47b2fde9536f487b89ccbca295072a7d9943" + "2.13.9": + url: "https://github.com/catchorg/Catch2/archive/v2.13.9.tar.gz" + sha256: "06dbc7620e3b96c2b69d57bf337028bf245a211b3cddb843835bfe258f427a52" + "2.13.8": + url: "https://github.com/catchorg/Catch2/archive/v2.13.8.tar.gz" + sha256: "b9b592bd743c09f13ee4bf35fc30eeee2748963184f6bea836b146e6cc2a585a" + "2.13.7": + url: "https://github.com/catchorg/Catch2/archive/v2.13.7.tar.gz" + sha256: "3cdb4138a072e4c0290034fe22d9f0a80d3bcfb8d7a8a5c49ad75d3a5da24fae" + "2.12.4": + url: "https://github.com/catchorg/Catch2/archive/v2.12.4.tar.gz" + sha256: "5436725bbc6ee131a0bc9545bef31f0adabbb21fbc39fb6f1b2a42c12e4f8107" + "2.11.3": + url: "https://github.com/catchorg/Catch2/archive/v2.11.3.tar.gz" + sha256: "9a6967138062688f04374698fce4ce65908f907d8c0fe5dfe8dc33126bd46543" diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py new file mode 100644 index 0000000000000..15b01852024f5 --- /dev/null +++ b/recipes/catch2/2.x.x/conanfile.py @@ -0,0 +1,133 @@ +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, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class Catch2Conan(ConanFile): + name = "catch2" + description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" + topics = ("header-only", "unit-test", "tdd", "bdd") + homepage = "https://github.com/catchorg/Catch2" + url = "https://github.com/conan-io/conan-center-index" + license = "BSL-1.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_main": [True, False], + "with_benchmark": [True, False], + "with_prefix": [True, False], + "default_reporter": [None, "ANY"], + } + default_options = { + "fPIC": True, + "with_main": False, + "with_benchmark": False, + "with_prefix": False, + "default_reporter": None, + } + + @property + def _default_reporter_str(self): + return str(self.options.default_reporter).strip('"') + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if not self.options.with_main: + self.options.rm_safe("fPIC") + self.options.rm_safe("with_benchmark") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if not self.info.options.with_main: + self.info.clear() + + def validate(self): + if Version(self.version) < "2.13.1" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("ARMv8 is not supported by versions < 2.13.1+") + if self.options.get_safe("with_main") and Version(self.version) < "2.13.4": + raise ConanInvalidConfiguration("Option with_main not supported by versions < 2.13.4") + + 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.cache_variables["CATCH_INSTALL_DOCS"] = False # these are cmake options, so use cache_variables + tc.cache_variables["CATCH_INSTALL_HELPERS"] = "ON" # these are cmake options, so use cache_variables + tc.cache_variables["CATCH_BUILD_STATIC_LIBRARY"] = str(self.options.with_main) # these are cmake options, so use cache_variables (str() is required for conan 1.52) + if self.options.with_prefix: + tc.preprocessor_definitions["CATCH_CONFIG_PREFIX_ALL"] = 1 + if self.options.get_safe("with_benchmark", False): + tc.preprocessor_definitions["CATCH_CONFIG_ENABLE_BENCHMARKING"] = 1 + if self.options.default_reporter: + tc.variables["CATCH_CONFIG_DEFAULT_REPORTER"] = self._default_reporter_str + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + if self.options.with_main: + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + for cmake_file in ["ParseAndAddCatchTests.cmake", "Catch.cmake", "CatchAddTests.cmake"]: + copy(self, + cmake_file, + src=os.path.join(self.source_folder, "contrib"), + dst=os.path.join(self.package_folder, "lib", "cmake", "Catch2"), + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Catch2") + self.cpp_info.set_property("cmake_target_name", "Catch2::Catch2{}".format("WithMain" if self.options.with_main else "")) + self.cpp_info.set_property("pkg_config_name", "catch2{}".format("-with-main" if self.options.with_main else "")) + + defines = [] + if self.options.get_safe("with_benchmark", False): + defines.append("CATCH_CONFIG_ENABLE_BENCHMARKING") + if self.options.with_prefix: + defines.append("CATCH_CONFIG_PREFIX_ALL") + if self.options.default_reporter: + defines.append(f"CATCH_CONFIG_DEFAULT_REPORTER={self._default_reporter_str}") + + if self.options.with_main: + self.cpp_info.components["_catch2"].set_property("cmake_target_name", "Catch2::Catch2") + self.cpp_info.components["_catch2"].set_property("pkg_config_name", "catch2") + self.cpp_info.components["_catch2"].defines = defines + + self.cpp_info.components["catch2_with_main"].builddirs.append(os.path.join("lib", "cmake", "Catch2")) + self.cpp_info.components["catch2_with_main"].libs = ["Catch2WithMain"] + self.cpp_info.components["catch2_with_main"].system_libs = ["log"] if self.settings.os == "Android" else [] + self.cpp_info.components["catch2_with_main"].set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.components["catch2_with_main"].set_property("pkg_config_name", "catch2-with-main") + self.cpp_info.components["catch2_with_main"].defines = defines + else: + self.cpp_info.builddirs = [os.path.join("lib", "cmake", "Catch2")] + self.cpp_info.system_libs = ["log"] if self.settings.os == "Android" else [] + self.cpp_info.defines = defines + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "Catch2" + self.cpp_info.names["cmake_find_package_multi"] = "Catch2" + if self.options.with_main: + self.cpp_info.components["_catch2"].names["cmake_find_package"] = "Catch2" + self.cpp_info.components["_catch2"].names["cmake_find_package_multi"] = "Catch2" + self.cpp_info.components["catch2_with_main"].names["cmake_find_package"] = "Catch2WithMain" + self.cpp_info.components["catch2_with_main"].names["cmake_find_package_multi"] = "Catch2WithMain" diff --git a/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp b/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp new file mode 100644 index 0000000000000..f481b16fe25e9 --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp @@ -0,0 +1,3 @@ +#define CATCH_CONFIG_MAIN + +#include diff --git a/recipes/catch2/2.x.x/test_package/100-standalone.cpp b/recipes/catch2/2.x.x/test_package/100-standalone.cpp new file mode 100644 index 0000000000000..d330a979c68b7 --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/100-standalone.cpp @@ -0,0 +1,5 @@ +#include + +TEST_CASE( "compiles and runs" ) { + REQUIRE( true == !false ); +} diff --git a/recipes/catch2/2.x.x/test_package/200-benchmark.cpp b/recipes/catch2/2.x.x/test_package/200-benchmark.cpp new file mode 100644 index 0000000000000..147c743b7e14d --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/200-benchmark.cpp @@ -0,0 +1,11 @@ +#include + +unsigned int Factorial( unsigned int number ) { + return number > 1 ? Factorial(number-1)*number : 1; +} + +TEST_CASE( "compiles and runs" ) { + BENCHMARK("factorial 25"){ + return Factorial(25); + }; +} diff --git a/recipes/catch2/2.x.x/test_package/300-standalone-with-prefix.cpp b/recipes/catch2/2.x.x/test_package/300-standalone-with-prefix.cpp new file mode 100644 index 0000000000000..6340e09f840a9 --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/300-standalone-with-prefix.cpp @@ -0,0 +1,5 @@ +#include + +CATCH_TEST_CASE( "compiles and runs" ) { + CATCH_REQUIRE( true == !false ); +} diff --git a/recipes/catch2/2.x.x/test_package/400-benchmark-with-prefix.cpp b/recipes/catch2/2.x.x/test_package/400-benchmark-with-prefix.cpp new file mode 100644 index 0000000000000..147c743b7e14d --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/400-benchmark-with-prefix.cpp @@ -0,0 +1,11 @@ +#include + +unsigned int Factorial( unsigned int number ) { + return number > 1 ? Factorial(number-1)*number : 1; +} + +TEST_CASE( "compiles and runs" ) { + BENCHMARK("factorial 25"){ + return Factorial(25); + }; +} diff --git a/recipes/catch2/2.x.x/test_package/CMakeLists.txt b/recipes/catch2/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7cf72543951f1 --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +enable_testing() + +find_package(Catch2 REQUIRED CONFIG) + +if(WITH_PREFIX) + set(SRC_STANDALONE 300-standalone-with-prefix.cpp) + set(SRC_BENCHMARK 400-benchmark-with-prefix.cpp) +else() + set(SRC_STANDALONE 100-standalone.cpp) + set(SRC_BENCHMARK 200-benchmark.cpp) +endif() + +add_executable(standalone 000-CatchMain.cpp ${SRC_STANDALONE}) +target_link_libraries(standalone PRIVATE Catch2::Catch2) +target_compile_features(standalone PRIVATE cxx_std_11) +add_test(NAME standalone COMMAND standalone) +if(WITH_MAIN) + add_executable(standalone_with_main ${SRC_STANDALONE}) + target_link_libraries(standalone_with_main PRIVATE Catch2::Catch2WithMain) + target_compile_features(standalone_with_main PRIVATE cxx_std_11) + add_test(NAME standalone_with_main COMMAND standalone_with_main) +endif() +if(WITH_BENCHMARK) + add_executable(benchmark ${SRC_BENCHMARK}) + target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) + target_compile_features(benchmark PRIVATE cxx_std_11) + add_test(NAME benchmark COMMAND benchmark) +endif() diff --git a/recipes/catch2/2.x.x/test_package/conanfile.py b/recipes/catch2/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..cab6586354346 --- /dev/null +++ b/recipes/catch2/2.x.x/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.build import build_jobs, can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_MAIN"] = self.dependencies["catch2"].options.with_main + tc.variables["WITH_BENCHMARK"] = self.dependencies["catch2"].options.get_safe("with_benchmark", False) + tc.variables["WITH_PREFIX"] = self.dependencies["catch2"].options.with_prefix + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/catch2/2.x.x/test_v1_package/conanfile.py b/recipes/catch2/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2ee47800e04e6 --- /dev/null +++ b/recipes/catch2/2.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_MAIN"] = self.options["catch2"].with_main + cmake.definitions["WITH_BENCHMARK"] = self.options["catch2"].with_main and self.options["catch2"].with_benchmark + cmake.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml new file mode 100644 index 0000000000000..27ebedcdcb791 --- /dev/null +++ b/recipes/catch2/3.x.x/conandata.yml @@ -0,0 +1,41 @@ +sources: + "3.3.2": + url: "https://github.com/catchorg/Catch2/archive/v3.3.2.tar.gz" + sha256: "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2" + "3.3.1": + url: "https://github.com/catchorg/Catch2/archive/v3.3.1.tar.gz" + sha256: "d90351cdc55421f640c553cfc0875a8c834428679444e8062e9187d05b18aace" + "3.3.0": + url: "https://github.com/catchorg/Catch2/archive/v3.3.0.tar.gz" + sha256: "fe2f29a54ca775c2dd04bb97ffb79d398e6210e3caa174348b5cd3b7e4ca887d" + "3.2.1": + url: "https://github.com/catchorg/Catch2/archive/v3.2.1.tar.gz" + sha256: "4613d3e8142b672159fcae252a4860d72c8cf8e2df5043b1ae3541db9ef5d73c" + "3.2.0": + url: "https://github.com/catchorg/Catch2/archive/v3.2.0.tar.gz" + sha256: "feee04647e28ac3cbeff46cb42abc8ee2d8d5f646d36e3fb3ba274b8c69a58ea" + "3.1.0": + url: "https://github.com/catchorg/Catch2/archive/v3.1.0.tar.gz" + sha256: "c252b2d9537e18046d8b82535069d2567f77043f8e644acf9a9fffc22ea6e6f7" + "3.0.1": + url: "https://github.com/catchorg/Catch2/archive/v3.0.1.tar.gz" + sha256: "8c4173c68ae7da1b5b505194a0c2d6f1b2aef4ec1e3e7463bde451f26bbaf4e7" +patches: + "3.1.0": + - patch_file: "patches/3.1.0-0001-fix-dll-install.patch" + patch_description: "Install dll in bin folder" + patch_type: "portability" + patch_source: "https://github.com/catchorg/Catch2/pull/2485" + - patch_file: "patches/3.1.0-0002-dllimport-global-symbols-msvc.patch" + patch_description: "Fix import of global symbols for msvc shared" + patch_type: "portability" + patch_source: "https://github.com/catchorg/Catch2/pull/2527" + "3.0.1": + - patch_file: "patches/3.0.1-0001-allow-shared.patch" + patch_description: "Allow to build catch2 as a shared library" + patch_type: "portability" + patch_source: "https://github.com/catchorg/Catch2/commit/bea58bf8bbfca887f871c3aa2d720ba62c01f855" + - patch_file: "patches/3.0.1-0002-dllimport-global-symbols-msvc.patch" + patch_description: "Fix import of global symbols for msvc shared" + patch_type: "portability" + patch_source: "https://github.com/catchorg/Catch2/pull/2527" diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py new file mode 100644 index 0000000000000..9cc83f41b1e3a --- /dev/null +++ b/recipes/catch2/3.x.x/conanfile.py @@ -0,0 +1,184 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Catch2Conan(ConanFile): + name = "catch2" + description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" + topics = ("catch2", "unit-test", "tdd", "bdd") + license = "BSL-1.0" + homepage = "https://github.com/catchorg/Catch2" + 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_prefix": [True, False], + "default_reporter": [None, "ANY"], + "console_width": [None, "ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_prefix": False, + "default_reporter": None, + "console_width": "80", + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _min_console_width(self): + # Catch2 doesn't build if less than this value + return 46 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } + + @property + def _default_reporter_str(self): + return str(self.options.default_reporter).strip('"') + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 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 doesn't support", + ) + + try: + if int(self.options.console_width) < self._min_console_width: + raise ConanInvalidConfiguration( + f"option 'console_width' must be >= {self._min_console_width}, " + f"got {self.options.console_width}. Contributions welcome if this should work!") + except ValueError as e: + raise ConanInvalidConfiguration(f"option 'console_width' must be an integer, " + f"got '{self.options.console_width}'") from e + + 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.cache_variables["CATCH_INSTALL_DOCS"] = False + tc.cache_variables["CATCH_INSTALL_EXTRAS"] = True + tc.cache_variables["CATCH_DEVELOPMENT_BUILD"] = False + tc.variables["CATCH_CONFIG_PREFIX_ALL"] = self.options.with_prefix + tc.variables["CATCH_CONFIG_CONSOLE_WIDTH"] = self.options.console_width + if self.options.default_reporter: + tc.variables["CATCH_CONFIG_DEFAULT_REPORTER"] = self._default_reporter_str + tc.generate() + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + for cmake_file in ["ParseAndAddCatchTests.cmake", "Catch.cmake", "CatchAddTests.cmake"]: + copy( + self, + cmake_file, + src=os.path.join(self.source_folder, "extras"), + dst=os.path.join(self.package_folder, "lib", "cmake", "Catch2"), + ) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "Catch2::Catch2": "catch2::_catch2", + "Catch2::Catch2WithMain": "catch2::catch2_with_main", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Catch2") + self.cpp_info.set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.set_property("pkg_config_name", "catch2-with-main") + + lib_suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.components["_catch2"].set_property("cmake_target_name", "Catch2::Catch2") + self.cpp_info.components["_catch2"].set_property("pkg_config_name", "catch2") + self.cpp_info.components["_catch2"].libs = ["Catch2" + lib_suffix] + + self.cpp_info.components["catch2_with_main"].builddirs.append(os.path.join("lib", "cmake", "Catch2")) + self.cpp_info.components["catch2_with_main"].libs = ["Catch2Main" + lib_suffix] + self.cpp_info.components["catch2_with_main"].requires = ["_catch2"] + self.cpp_info.components["catch2_with_main"].system_libs = ["log"] if self.settings.os == "Android" else [] + self.cpp_info.components["catch2_with_main"].set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.components["catch2_with_main"].set_property("pkg_config_name", "catch2-with-main") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["catch2_with_main"].system_libs.append("m") + defines = [] + if self.options.with_prefix: + defines.append("CATCH_CONFIG_PREFIX_ALL") + if self.options.default_reporter: + defines.append(f"CATCH_CONFIG_DEFAULT_REPORTER={self._default_reporter_str}") + self.cpp_info.components["catch2_with_main"].defines = defines + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "Catch2" + self.cpp_info.filenames["cmake_find_package_multi"] = "Catch2" + self.cpp_info.names["cmake_find_package"] = "catch2" + self.cpp_info.names["cmake_find_package_multi"] = "catch2" + self.cpp_info.components["_catch2"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["_catch2"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["catch2_with_main"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["catch2_with_main"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch b/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch new file mode 100644 index 0000000000000..38c31d266b121 --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch @@ -0,0 +1,64 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -263,9 +263,7 @@ set(REPORTER_SOURCES + ) + set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES}) + +-# Fixme: STATIC because for dynamic, we would need to handle visibility +-# and I don't want to do the annotations right now +-add_library(Catch2 STATIC ++add_library(Catch2 + ${REPORTER_FILES} + ${INTERNAL_FILES} + ${BENCHMARK_HEADERS} +@@ -318,7 +316,7 @@ target_include_directories(Catch2 + ) + + +-add_library(Catch2WithMain STATIC ++add_library(Catch2WithMain + ${SOURCES_DIR}/internal/catch_main.cpp + ) + add_build_reproducibility_settings(Catch2WithMain) +@@ -338,8 +336,12 @@ if (NOT_SUBPROJECT) + Catch2WithMain + EXPORT + Catch2Targets +- DESTINATION ++ LIBRARY DESTINATION ++ ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION + ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ++ ${CMAKE_INSTALL_BINDIR} + ) + + +@@ -409,3 +411,27 @@ endif() + + list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain) + set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE) ++ ++ ++# We still do not support building dynamic library with hidden visibility ++# so we want to check & warn users if they do this. However, we won't abort ++# the configuration step so that we don't have to also provide an override. ++if (BUILD_SHARED_LIBS) ++ if (MSVC) ++ set_target_properties(Catch2 Catch2WithMain ++ PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++ ) ++ endif() ++ ++ get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET) ++ if (NOT MSVC AND _VisPreset STREQUAL "hidden") ++ set_target_properties(Catch2 Catch2WithMain ++ PROPERTIES ++ CXX_VISIBILITY_PRESET "default" ++ VISIBILITY_INLINES_HIDDEN OFF ++ ) ++ message(WARNING "Setting Catch2's visibility to default." ++ " Hidden visibility is not supported.") ++ endif() ++endif() diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch b/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch new file mode 100644 index 0000000000000..c797f9d544f0c --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch @@ -0,0 +1,77 @@ +--- a/CMake/CatchConfigOptions.cmake ++++ b/CMake/CatchConfigOptions.cmake +@@ -45,6 +45,7 @@ set(_OverridableOptions + foreach(OptionName ${_OverridableOptions}) + AddOverridableConfigOption(${OptionName}) + endforeach() ++set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) + + set(_OtherConfigOptions + "DISABLE_EXCEPTIONS" +--- a/src/catch2/catch_tostring.hpp ++++ b/src/catch2/catch_tostring.hpp +@@ -296,13 +296,13 @@ namespace Catch { + template<> + struct StringMaker { + static std::string convert(float value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template<> + struct StringMaker { + static std::string convert(double value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template +--- a/src/catch2/catch_user_config.hpp.in ++++ b/src/catch2/catch_user_config.hpp.in +@@ -181,6 +181,8 @@ + #cmakedefine CATCH_CONFIG_PREFIX_ALL + #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG + ++#cmakedefine CATCH_CONFIG_SHARED_LIBRARY ++ + + // ------ + // "Variable" defines, these have actual values +--- a/src/catch2/internal/catch_compiler_capabilities.hpp ++++ b/src/catch2/internal/catch_compiler_capabilities.hpp +@@ -364,5 +364,15 @@ + # define CATCH_CONFIG_COLOUR_WIN32 + #endif + ++#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ ++ !defined( CATCH_CONFIG_STATIC ) ++# ifdef Catch2_EXPORTS ++# define CATCH_EXPORT //__declspec( dllexport ) // not needed ++# else ++# define CATCH_EXPORT __declspec( dllimport ) ++# endif ++#else ++# define CATCH_EXPORT ++#endif + + #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED +--- a/src/catch2/internal/catch_context.hpp ++++ b/src/catch2/internal/catch_context.hpp +@@ -8,6 +8,8 @@ + #ifndef CATCH_CONTEXT_HPP_INCLUDED + #define CATCH_CONTEXT_HPP_INCLUDED + ++#include ++ + namespace Catch { + + class IResultCapture; +@@ -28,7 +30,7 @@ namespace Catch { + virtual void setConfig( IConfig const* config ) = 0; + + private: +- static IMutableContext *currentContext; ++ CATCH_EXPORT static IMutableContext *currentContext; + friend IMutableContext& getCurrentMutableContext(); + friend void cleanUpContext(); + static void createContext(); diff --git a/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch b/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch new file mode 100644 index 0000000000000..c7027940432a6 --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch @@ -0,0 +1,16 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -359,8 +359,12 @@ if (NOT_SUBPROJECT) + Catch2WithMain + EXPORT + Catch2Targets +- DESTINATION ++ LIBRARY DESTINATION ++ ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION + ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ++ ${CMAKE_INSTALL_BINDIR} + ) + + diff --git a/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch b/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch new file mode 100644 index 0000000000000..63e221c1fb44c --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch @@ -0,0 +1,77 @@ +--- a/CMake/CatchConfigOptions.cmake ++++ b/CMake/CatchConfigOptions.cmake +@@ -45,6 +45,7 @@ set(_OverridableOptions + foreach(OptionName ${_OverridableOptions}) + AddOverridableConfigOption(${OptionName}) + endforeach() ++set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) + + set(_OtherConfigOptions + "DISABLE_EXCEPTIONS" +--- a/src/catch2/catch_tostring.hpp ++++ b/src/catch2/catch_tostring.hpp +@@ -296,13 +296,13 @@ namespace Catch { + template<> + struct StringMaker { + static std::string convert(float value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template<> + struct StringMaker { + static std::string convert(double value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template +--- a/src/catch2/catch_user_config.hpp.in ++++ b/src/catch2/catch_user_config.hpp.in +@@ -181,6 +181,8 @@ + #cmakedefine CATCH_CONFIG_PREFIX_ALL + #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG + ++#cmakedefine CATCH_CONFIG_SHARED_LIBRARY ++ + + // ------ + // "Variable" defines, these have actual values +--- a/src/catch2/internal/catch_compiler_capabilities.hpp ++++ b/src/catch2/internal/catch_compiler_capabilities.hpp +@@ -376,5 +376,15 @@ + # define CATCH_CONFIG_COLOUR_WIN32 + #endif + ++#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ ++ !defined( CATCH_CONFIG_STATIC ) ++# ifdef Catch2_EXPORTS ++# define CATCH_EXPORT //__declspec( dllexport ) // not needed ++# else ++# define CATCH_EXPORT __declspec( dllimport ) ++# endif ++#else ++# define CATCH_EXPORT ++#endif + + #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED +--- a/src/catch2/internal/catch_context.hpp ++++ b/src/catch2/internal/catch_context.hpp +@@ -8,6 +8,8 @@ + #ifndef CATCH_CONTEXT_HPP_INCLUDED + #define CATCH_CONTEXT_HPP_INCLUDED + ++#include ++ + namespace Catch { + + class IResultCapture; +@@ -28,7 +30,7 @@ namespace Catch { + virtual void setConfig( IConfig const* config ) = 0; + + private: +- static IMutableContext *currentContext; ++ CATCH_EXPORT static IMutableContext *currentContext; + friend IMutableContext& getCurrentMutableContext(); + friend void cleanUpContext(); + static void createContext(); diff --git a/recipes/catch2/3.x.x/test_package/100-standalone.cpp b/recipes/catch2/3.x.x/test_package/100-standalone.cpp new file mode 100644 index 0000000000000..4930209c907a2 --- /dev/null +++ b/recipes/catch2/3.x.x/test_package/100-standalone.cpp @@ -0,0 +1,5 @@ +#include + +TEST_CASE( "compiles and runs" ) { + REQUIRE( true == !false ); +} diff --git a/recipes/catch2/3.x.x/test_package/200-benchmark.cpp b/recipes/catch2/3.x.x/test_package/200-benchmark.cpp new file mode 100644 index 0000000000000..a109712183d7c --- /dev/null +++ b/recipes/catch2/3.x.x/test_package/200-benchmark.cpp @@ -0,0 +1,12 @@ +#include +#include + +unsigned int Factorial( unsigned int number ) { + return number > 1 ? Factorial(number-1)*number : 1; +} + +TEST_CASE( "compiles and runs" ) { + BENCHMARK("factorial 25"){ + return Factorial(25); + }; +} diff --git a/recipes/catch2/3.x.x/test_package/300-standalone-with-prefix.cpp b/recipes/catch2/3.x.x/test_package/300-standalone-with-prefix.cpp new file mode 100644 index 0000000000000..1f26b184ca151 --- /dev/null +++ b/recipes/catch2/3.x.x/test_package/300-standalone-with-prefix.cpp @@ -0,0 +1,5 @@ +#include + +CATCH_TEST_CASE( "compiles and runs" ) { + CATCH_REQUIRE( true == !false ); +} diff --git a/recipes/catch2/3.x.x/test_package/400-benchmark-with-prefix.cpp b/recipes/catch2/3.x.x/test_package/400-benchmark-with-prefix.cpp new file mode 100644 index 0000000000000..a496560fe3440 --- /dev/null +++ b/recipes/catch2/3.x.x/test_package/400-benchmark-with-prefix.cpp @@ -0,0 +1,12 @@ +#include +#include + +unsigned int Factorial( unsigned int number ) { + return number > 1 ? Factorial(number-1)*number : 1; +} + +CATCH_TEST_CASE( "compiles and runs" ) { + CATCH_BENCHMARK("factorial 25"){ + return Factorial(25); + }; +} diff --git a/recipes/catch2/3.x.x/test_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1e2b06644735c --- /dev/null +++ b/recipes/catch2/3.x.x/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Catch2 REQUIRED CONFIG) + +if(WITH_PREFIX) + add_executable(standalone 300-standalone-with-prefix.cpp) + add_executable(benchmark 400-benchmark-with-prefix.cpp) +else() + add_executable(standalone 100-standalone.cpp) + add_executable(benchmark 200-benchmark.cpp) +endif() +target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) +target_compile_features(standalone PRIVATE cxx_std_14) +target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +target_compile_features(benchmark PRIVATE cxx_std_14) diff --git a/recipes/catch2/3.x.x/test_package/conanfile.py b/recipes/catch2/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..259cc3545b24c --- /dev/null +++ b/recipes/catch2/3.x.x/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_PREFIX"] = self.dependencies[self.tested_reference_str].options.with_prefix + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "standalone"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindirs[0], "benchmark"), env="conanrun") diff --git a/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/catch2/3.x.x/test_v1_package/conanfile.py b/recipes/catch2/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b62a348e1044b --- /dev/null +++ b/recipes/catch2/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "standalone"), run_environment=True) + self.run(os.path.join("bin", "benchmark"), run_environment=True) diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml new file mode 100644 index 0000000000000..5cab4a772bfb6 --- /dev/null +++ b/recipes/catch2/config.yml @@ -0,0 +1,27 @@ +versions: + "3.3.2": + folder: 3.x.x + "3.3.1": + folder: 3.x.x + "3.3.0": + folder: 3.x.x + "3.2.1": + folder: 3.x.x + "3.2.0": + folder: 3.x.x + "3.1.0": + folder: 3.x.x + "3.0.1": + folder: 3.x.x + "2.13.10": + folder: 2.x.x + "2.13.9": + folder: 2.x.x + "2.13.8": + folder: 2.x.x + "2.13.7": + folder: 2.x.x + "2.12.4": + folder: 2.x.x + "2.11.3": + folder: 2.x.x diff --git a/recipes/cc65/all/conandata.yml b/recipes/cc65/all/conandata.yml new file mode 100644 index 0000000000000..0c7a25432a083 --- /dev/null +++ b/recipes/cc65/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.18": + url: "https://github.com/cc65/cc65/archive/V2.18.tar.gz" + sha256: "d14a22fb87c7bcbecd8a83d5362d5d317b19c6ce2433421f2512f28293a6eaab" + "2.19": + url: "https://github.com/cc65/cc65/archive/V2.19.tar.gz" + sha256: "157b8051aed7f534e5093471e734e7a95e509c577324099c3c81324ed9d0de77" +patches: + "2.18": + - patch_file: "patches/2.18-0001-no-embedded-paths-makefile.patch" + base_path: "source_subfolder" + - patch_file: "patches/2.18-0002-libsrc-use-extension.patch" + base_path: "source_subfolder" + "2.19": + - patch_file: "patches/2.19-0001-no-embedded-paths-makefile.patch" + base_path: "source_subfolder" + - patch_file: "patches/2.19-0002-libsrc-use-extension.patch" + base_path: "source_subfolder" diff --git a/recipes/cc65/all/conanfile.py b/recipes/cc65/all/conanfile.py new file mode 100644 index 0000000000000..242c1cf9eee44 --- /dev/null +++ b/recipes/cc65/all/conanfile.py @@ -0,0 +1,163 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class Cc65Conan(ConanFile): + name = "cc65" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cc65.github.io/" + description = "A freeware C compiler for 6502 based systems" + license = "Zlib" + topics = ("conan", "cc65", "compiler", "cmos", "6502", "8bit") + exports_sources = "patches/**" + + settings = "os", "arch", "compiler", "build_type" + + _autotools = None + _source_subfolder = "source_subfolder" + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.settings.compiler == "Visual Studio": + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("Invalid arch") + if self.settings.arch == "x86_64": + self.output.info("This recipe will build x86 instead of x86_64 (the binaries are compatible)") + + def build_requirements(self): + if self.settings.compiler == "Visual Studio" and not tools.which("make"): + self.build_requires("make/4.2.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + @property + def _datadir(self): + return os.path.join(self.package_folder, "bin", "share", "cc65") + + @property + def _samplesdir(self): + return os.path.join(self.package_folder, "samples") + + def _build_msvc(self): + msbuild = MSBuild(self) + msvc_platforms = { + "x86": "Win32", + } + arch = str(self.settings.arch) + if arch != "x86": + self.output.warn("{} detected: building x86 instead".format(self.settings.arch)) + arch = "x86" + + msbuild.build(os.path.join(self._source_subfolder, "src", "cc65.sln"), + build_type="Debug" if self.settings.build_type == "Debug" else "Release", + arch=arch, platforms=msvc_platforms) + autotools = self._configure_autotools() + with tools.chdir(os.path.join(self._source_subfolder, "libsrc")): + autotools.make() + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + return self._autotools + + @property + def _make_args(self): + datadir = self._datadir + prefix = self.package_folder + samplesdir = self._samplesdir + if tools.os_info.is_windows: + datadir = tools.unix_path(datadir) + prefix = tools.unix_path(prefix) + samplesdir = tools.unix_path(samplesdir) + args = [ + "PREFIX={}".format(prefix), + "datadir={}".format(datadir), + "samplesdir={}".format(samplesdir), + ] + if self.settings.os == "Windows": + args.append("EXE_SUFFIX=.exe") + return args + + def _build_autotools(self): + autotools = self._configure_autotools() + with tools.chdir(os.path.join(self._source_subfolder)): + autotools.make(args=self._make_args) + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + if self.settings.compiler == "Visual Studio": + with tools.chdir(os.path.join(self._source_subfolder, "src")): + for fn in os.listdir("."): + if not fn.endswith(".vcxproj"): + continue + tools.replace_in_file(fn, "v141", tools.msvs_toolset(self)) + tools.replace_in_file(fn, "10.0.16299.0", "") + if self.settings.os == "Windows": + # Add ".exe" suffix to calls from cl65 to other utilities + for fn, var in (("cc65", "CC65"), ("ca65", "CA65"), ("co65", "CO65"), ("ld65", "LD65"), ("grc65", "GRC")): + v = "{},".format(var).ljust(5) + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "cl65", "main.c"), + "CmdInit (&{v} CmdPath, \"{n}\");".format(v=v, n=fn), + "CmdInit (&{v} CmdPath, \"{n}.exe\");".format(v=v, n=fn)) + + def build(self): + self._patch_sources() + if self.settings.compiler == "Visual Studio": + self._build_msvc() + else: + self._build_autotools() + + def _package_msvc(self): + self.copy("*.exe", src=os.path.join(self._source_subfolder, "bin"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) + for dir in ("asminc", "cfg", "include", "lib", "target"): + self.copy("*", src=os.path.join(self._source_subfolder, dir), dst=os.path.join(self._datadir, dir)) + + def _package_autotools(self): + autotools = self._configure_autotools() + with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): + autotools.install(args=self._make_args) + + tools.rmdir(self._samplesdir) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + if self.settings.compiler == "Visual Studio": + self._package_msvc() + else: + self._package_autotools() + + def package_id(self): + del self.info.settings.compiler + if self.settings.compiler == "Visual Studio": + if self.settings.arch == "x86_64": + self.info.settings.arch = "x86" + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: %s" % bindir) + self.env_info.PATH.append(bindir) + + self.output.info("Seting CC65_HOME environment variable: %s" % self._datadir) + self.env_info.CC65_HOME = self._datadir + + bin_ext = ".exe" if self.settings.os == "Windows" else "" + + cc65_cc = os.path.join(bindir, "cc65" + bin_ext) + self.output.info("Seting CC65 environment variable: {}".format(cc65_cc)) + self.env_info.CC65 = cc65_cc + + cc65_as = os.path.join(bindir, "ca65" + bin_ext) + self.output.info("Seting AS65 environment variable: {}".format(cc65_as)) + self.env_info.AS65 = cc65_as + + cc65_ld = os.path.join(bindir, "cl65" + bin_ext) + self.output.info("Seting LD65 environment variable: {}".format(cc65_ld)) + self.env_info.LD65 = cc65_ld diff --git a/recipes/cc65/all/patches/2.18-0001-no-embedded-paths-makefile.patch b/recipes/cc65/all/patches/2.18-0001-no-embedded-paths-makefile.patch new file mode 100644 index 0000000000000..bc78aec503b32 --- /dev/null +++ b/recipes/cc65/all/patches/2.18-0001-no-embedded-paths-makefile.patch @@ -0,0 +1,11 @@ +--- src/Makefile ++++ src/Makefile +@@ -64,8 +64,6 @@ + + CFLAGS += -MMD -MP -O3 -I common \ + -Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \ +- -DCA65_INC="$(CA65_INC)" -DCC65_INC="$(CC65_INC)" -DCL65_TGT="$(CL65_TGT)" \ +- -DLD65_LIB="$(LD65_LIB)" -DLD65_OBJ="$(LD65_OBJ)" -DLD65_CFG="$(LD65_CFG)" \ + -DGIT_SHA=$(GIT_SHA) + + LDLIBS += -lm diff --git a/recipes/cc65/all/patches/2.18-0002-libsrc-use-extension.patch b/recipes/cc65/all/patches/2.18-0002-libsrc-use-extension.patch new file mode 100644 index 0000000000000..6e126cdafef9c --- /dev/null +++ b/recipes/cc65/all/patches/2.18-0002-libsrc-use-extension.patch @@ -0,0 +1,17 @@ +--- libsrc/Makefile ++++ libsrc/Makefile +@@ -253,10 +253,10 @@ + + $(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype)))) + +-AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65) +-CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65) +-CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65) +-LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65) ++AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)$(EXE_SUFFIX) ++CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)$(EXE_SUFFIX) ++CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)$(EXE_SUFFIX) ++LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)$(EXE_SUFFIX) + + export CC65_HOME := $(abspath ..) + diff --git a/recipes/cc65/all/patches/2.19-0001-no-embedded-paths-makefile.patch b/recipes/cc65/all/patches/2.19-0001-no-embedded-paths-makefile.patch new file mode 100644 index 0000000000000..7ae457b7cf099 --- /dev/null +++ b/recipes/cc65/all/patches/2.19-0001-no-embedded-paths-makefile.patch @@ -0,0 +1,11 @@ +--- src/Makefile ++++ src/Makefile +@@ -62,8 +62,6 @@ + + CFLAGS += -MMD -MP -O3 -I common \ + -Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \ +- -DCA65_INC="$(CA65_INC)" -DCC65_INC="$(CC65_INC)" -DCL65_TGT="$(CL65_TGT)" \ +- -DLD65_LIB="$(LD65_LIB)" -DLD65_OBJ="$(LD65_OBJ)" -DLD65_CFG="$(LD65_CFG)" \ + -DBUILD_ID="$(BUILD_ID)" + + LDLIBS += -lm diff --git a/recipes/cc65/all/patches/2.19-0002-libsrc-use-extension.patch b/recipes/cc65/all/patches/2.19-0002-libsrc-use-extension.patch new file mode 100644 index 0000000000000..9c09d6c1b2528 --- /dev/null +++ b/recipes/cc65/all/patches/2.19-0002-libsrc-use-extension.patch @@ -0,0 +1,17 @@ +--- libsrc/Makefile ++++ libsrc/Makefile +@@ -254,10 +254,10 @@ + + $(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype)))) + +-AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65) +-CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65) +-CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65) +-LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65) ++AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)$(EXE_SUFFIX) ++CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)$(EXE_SUFFIX) ++CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)$(EXE_SUFFIX) ++LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)$(EXE_SUFFIX) + + export CC65_HOME := $(abspath ..) + diff --git a/recipes/cc65/all/test_package/conanfile.py b/recipes/cc65/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b930a6b2cce7f --- /dev/null +++ b/recipes/cc65/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conans import ConanFile, tools +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + exports_sources = "hello.c", "text.s" + + _targets = ("c64", "apple2") + + def build(self): + if not tools.cross_building(self.settings): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), os.path.join(self.build_folder, src)) + for target in self._targets: + output = "hello_{}".format(target) + tools.mkdir(target) + try: + # Try removing the output file to give confidence it is created by cc65 + os.unlink(output) + except FileNotFoundError: + pass + self.run("{p} -O -t {t} hello.c -o {t}/hello.s".format(p=os.environ["CC65"], t=target)) + self.run("{p} -t {t} {t}/hello.s -o {t}/hello.o".format(p=os.environ["AS65"], t=target)) + self.run("{p} -t {t} text.s -o {t}/text.o".format(p=os.environ["AS65"], t=target)) + self.run("{p} -o {o} -t {t} {t}/hello.o {t}/text.o {t}.lib".format(o=output, p=os.environ["LD65"], t=target)) + + def test(self): + if not tools.cross_building(self.settings): + for target in self._targets: + assert os.path.isfile("hello_{}".format(target)) diff --git a/recipes/cc65/all/test_package/hello.c b/recipes/cc65/all/test_package/hello.c new file mode 100644 index 0000000000000..8c865092ff566 --- /dev/null +++ b/recipes/cc65/all/test_package/hello.c @@ -0,0 +1,10 @@ +#include +#include + +extern const char text[]; /* In text.s */ + +int main (void) +{ + printf ("%s\n", text); + return EXIT_SUCCESS; +} diff --git a/recipes/cc65/all/test_package/text.s b/recipes/cc65/all/test_package/text.s new file mode 100644 index 0000000000000..5a55d5dcf8e58 --- /dev/null +++ b/recipes/cc65/all/test_package/text.s @@ -0,0 +1,2 @@ +.export _text +_text: .asciiz "Hello world!" diff --git a/recipes/cc65/config.yml b/recipes/cc65/config.yml new file mode 100644 index 0000000000000..30626025fdc14 --- /dev/null +++ b/recipes/cc65/config.yml @@ -0,0 +1,5 @@ +versions: + "2.18": + folder: "all" + "2.19": + folder: "all" diff --git a/recipes/ccache/all/conandata.yml b/recipes/ccache/all/conandata.yml new file mode 100644 index 0000000000000..f619a4b106905 --- /dev/null +++ b/recipes/ccache/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "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.8": + - patch_file: "patches/4.8-cmake-msvc-runtime.patch" + patch_description: "fixup MSVC runtime" + patch_type: "conan" + "4.7.4": + - patch_file: "patches/4.7.4-cmake-msvc-runtime.patch" + patch_description: "fixup MSVC runtime" + patch_type: "conan" diff --git a/recipes/ccache/all/conanfile.py b/recipes/ccache/all/conanfile.py new file mode 100644 index 0000000000000..d2852b89b924b --- /dev/null +++ b/recipes/ccache/all/conanfile.py @@ -0,0 +1,105 @@ +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.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import check_min_vs, is_msvc +import os + +required_conan_version = ">=1.55.0" + + +class CcacheConan(ConanFile): + name = "ccache" + description = ( + "Ccache (or “ccache”) is a compiler cache. It speeds up recompilation " + "by caching previous compilations and detecting when the same " + "compilation is being done again." + ) + license = "GPL-3.0-or-later" + topics = ("compiler-cache", "recompilation", "cache", "compiler") + homepage = "https://ccache.dev" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "redis_storage_backend": [True, False], + } + default_options = { + "redis_storage_backend": True, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "9", + "apple-clang": "11", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zstd/1.5.2") + if self.options.redis_storage_backend: + self.requires("hiredis/1.1.0") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if 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, that is not supported by Clang 11 + libstdc++.") + + def build_requirements(self): + self.tool_requires("cmake/3.25.3") + + 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["REDIS_STORAGE_BACKEND"] = self.options.redis_storage_backend + tc.variables["HIREDIS_FROM_INTERNET"] = False + tc.variables["ENABLE_DOCUMENTATION"] = False + tc.variables["ENABLE_TESTING"] = False + 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") + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "*GPL-*.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + 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 new file mode 100644 index 0000000000000..0bc4c5ce8f995 --- /dev/null +++ b/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch @@ -0,0 +1,11 @@ +--- 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.8-cmake-msvc-runtime.patch b/recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch new file mode 100644 index 0000000000000..0bc4c5ce8f995 --- /dev/null +++ b/recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch @@ -0,0 +1,11 @@ +--- 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/test_package/conanfile.py b/recipes/ccache/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2239cf70535aa --- /dev/null +++ b/recipes/ccache/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("ccache --version") diff --git a/recipes/ccache/all/test_v1_package/conanfile.py b/recipes/ccache/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e357214905abd --- /dev/null +++ b/recipes/ccache/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("ccache --version", run_environment=True) diff --git a/recipes/ccache/config.yml b/recipes/ccache/config.yml new file mode 100644 index 0000000000000..f0dd21774402e --- /dev/null +++ b/recipes/ccache/config.yml @@ -0,0 +1,5 @@ +versions: + "4.8": + folder: all + "4.7.4": + folder: all diff --git a/recipes/cccl/all/conandata.yml b/recipes/cccl/all/conandata.yml new file mode 100644 index 0000000000000..20725ee2a4b27 --- /dev/null +++ b/recipes/cccl/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1": + url: https://github.com/swig/cccl/archive/cccl-1.1.tar.gz + sha256: 03ed67d04e8b1e165b8f8d42546ab62ff6c42b3623a2358a7c8255ced144ce28 + "1.3": + url: https://github.com/swig/cccl/archive/cccl-1.3.tar.gz + sha256: 1E34E315CE3AB890D39A75FFABAACCE2E55FE5ED21591F036A45AFDA43A3E989 diff --git a/recipes/cccl/all/conanfile.py b/recipes/cccl/all/conanfile.py new file mode 100644 index 0000000000000..3d0509b8a7502 --- /dev/null +++ b/recipes/cccl/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.tools.files import get, replace_in_file, copy +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +import os + + +class CcclConan(ConanFile): + name = "cccl" + description = "Unix cc compiler to Microsoft's cl compiler wrapper" + topics = ("msvc", "visual studio", "wrapper", "gcc") + homepage = "https://github.com/swig/cccl/" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "muffle": [True, False], + "verbose": [True, False], + } + default_options = { + "muffle": True, + "verbose": False, + } + + @property + def _cccl_dir(self): + return os.path.join(self.package_folder, "bin") + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if not is_msvc(self): + raise ConanInvalidConfiguration("This recipe only supports msvc/Visual Studio.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self.source_folder) + + def build(self): + cccl_path = os.path.join(self.source_folder, self.source_folder, "cccl") + replace_in_file(self, cccl_path, + " --help)", + " *.lib)\n" + " linkopt+=(\"$lib\")" + " ;;\n\n" + " --help)") + replace_in_file(self, cccl_path, + "clopt+=(\"$lib\")", + "linkopt+=(\"$lib\")") + replace_in_file(self, cccl_path, + " -L*)", + " -LIBPATH:*)\n" + " linkopt+=(\"$1\")\n" + " ;;\n\n" + " -L*)") + + def package(self): + copy(self, pattern="cccl", src=os.path.join(self.source_folder, self.source_folder), dst=self._cccl_dir) + copy(self, pattern="COPYING", src=os.path.join(self.source_folder, self.source_folder), dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + cccl_args = [ + "sh", + os.path.join(self.package_folder, "bin", "cccl"), + ] + if self.options.muffle: + cccl_args.append("--cccl-muffle") + if self.options.verbose: + cccl_args.append("--cccl-verbose") + cccl = " ".join(cccl_args) + + self.buildenv_info.define("CC", cccl) + self.buildenv_info.define("CXX", cccl) + self.buildenv_info.define("LD", cccl) + + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(self._cccl_dir) + + self.output.info(f"Setting CC to '{cccl}'") + self.env_info.CC = cccl + self.output.info(f"Setting CXX to '{cccl}'") + self.env_info.CXX = cccl + self.output.info(f"Setting LD to '{cccl}'") + self.env_info.LD = cccl diff --git a/recipes/cccl/all/test_package/conanfile.py b/recipes/cccl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b0e11ede43362 --- /dev/null +++ b/recipes/cccl/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.build import can_run +import os + + +class CcclTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VCVars", "VirtualBuildEnv" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + # TODO: Remove for Conan v2 + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + + def build(self): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + return # cccl needs a bash if there isn't a bash we can't build + cxx = "cccl " + src = os.path.join(self.source_folder, "example.cpp").replace("\\", "/") + self.run(f"{cxx} {src} -o example", cwd=self.build_folder) + + def test(self): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + return # cccl needs a bash if there isn't a bash we can't build + if can_run(self): + self.run("./example") #test self.run still runs in bash, so it needs "./"; seems weird but okay... diff --git a/recipes/cccl/all/test_package/example.cpp b/recipes/cccl/all/test_package/example.cpp new file mode 100644 index 0000000000000..ef5068e37c8cc --- /dev/null +++ b/recipes/cccl/all/test_package/example.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello world\n"; + return 0; +} diff --git a/recipes/cccl/all/test_v1_package/conanfile.py b/recipes/cccl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38669b537fb21 --- /dev/null +++ b/recipes/cccl/all/test_v1_package/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, tools +from conan.tools.microsoft import is_msvc +import os + + +class CcclTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def build(self): + environment = {} + if is_msvc(self): + environment.update(tools.vcvars_dict(self.settings)) + #for k in environment.keys(): + #self.output.highlight(k) + #self.output.highlight(environment[k]) + with tools.environment_append(environment): + cxxTest = tools.get_env("CXX") + #cxxB = self.buildenv_info.vars["CXX"] + self.output.highlight(f"tools.get_env(\"CXX\") = {cxxTest}") + #self.output.highlight(f"self.buildenv_info.vars[\"CXX\"] = {cxxB}") + cxx = "sh cccl " + self.run("{cxx} {src} -o example".format( + cxx=cxx, src=os.path.join(self.source_folder, "example.cpp")), win_bash=self.settings.os is "Windows", run_environment=True) + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join(self.build_folder, "example")) diff --git a/recipes/cccl/all/test_v1_package/example.cpp b/recipes/cccl/all/test_v1_package/example.cpp new file mode 100644 index 0000000000000..ef5068e37c8cc --- /dev/null +++ b/recipes/cccl/all/test_v1_package/example.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello world\n"; + return 0; +} diff --git a/recipes/cccl/config.yml b/recipes/cccl/config.yml new file mode 100644 index 0000000000000..8bade519ff028 --- /dev/null +++ b/recipes/cccl/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1": + folder: all + "1.3": + folder: all diff --git a/recipes/ccfits/all/conandata.yml b/recipes/ccfits/all/conandata.yml new file mode 100644 index 0000000000000..010d52b6753b2 --- /dev/null +++ b/recipes/ccfits/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.6": + url: "https://heasarc.gsfc.nasa.gov/fitsio/CCfits-2.6/CCfits-2.6.tar.gz" + sha256: "c8395e80379df4e2a63b0890166fb47be4b96dff977214e7ed10ea9d3e9e9a9e" + "2.5": + url: "https://heasarc.gsfc.nasa.gov/fitsio/CCfits-2.5/CCfits-2.5.tar.gz" + sha256: "e542f39fa496417c401be7fbca715d566462cf4c56c83e3d43b6df3cb8d92105" +patches: + "2.6": + - patch_file: "patches/0001-adapt-cmakelists-for-conan-2.6.patch" + "2.5": + - patch_file: "patches/0001-adapt-cmakelists-for-conan-2.5.patch" diff --git a/recipes/ccfits/all/conanfile.py b/recipes/ccfits/all/conanfile.py new file mode 100644 index 0000000000000..c9d53caa2f748 --- /dev/null +++ b/recipes/ccfits/all/conanfile.py @@ -0,0 +1,81 @@ +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.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class CcfitsConan(ConanFile): + name = "ccfits" + description = "CCfits is an object oriented interface to the cfitsio library." + license = "ISC" + topics = ("ccfits", "fits", "image", "nasa", "astronomy", "astrophysics", "space") + homepage = "https://heasarc.gsfc.nasa.gov/fitsio/ccfits" + 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, + } + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("cfitsio/4.1.0") + + def validate_build(self): + if Version(self.version) >= "2.6": + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Export symbols for msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + 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.set_property("pkg_config_name", "CCfits") + self.cpp_info.libs = ["CCfits"] diff --git a/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch new file mode 100644 index 0000000000000..76929726440b1 --- /dev/null +++ b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch @@ -0,0 +1,44 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(CCfits) +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) + + # Allow the developer to select if Dynamic or Static libraries are built + OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +@@ -22,8 +22,7 @@ ENDIF() + + #add_subdirectory (src) + +-find_package(CFITSIO REQUIRED) +-INCLUDE_DIRECTORIES(${CFITSIO_INCLUDE_DIR}) ++find_package(cfitsio REQUIRED CONFIG) + + SET (LIB_TYPE STATIC) + IF (BUILD_SHARED_LIBS) +@@ -55,15 +53,16 @@ SET(SRC_FILES + ) + + ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) +-TARGET_LINK_LIBRARIES(${LIB_NAME} ${CFITSIO_LIBRARY} ++TARGET_LINK_LIBRARIES(${LIB_NAME} cfitsio::cfitsio + ) + + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES + VERSION ${${PROJECT_NAME}_VERSION} + ) +-install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) ++install(TARGETS ${LIB_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR}) + ++if(0) + ENABLE_TESTING() + + SET(TEST_FILES file1.pha) +@@ -72,4 +71,5 @@ ADD_EXECUTABLE(cookbook cookbook.cxx) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/../") + TARGET_LINK_LIBRARIES(cookbook ${LIB_NAME} ${CFITSIO_LIBRARY}) + ADD_TEST(cookbook cookbook) ++endif() + diff --git a/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch new file mode 100644 index 0000000000000..7d13bff3f3252 --- /dev/null +++ b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch @@ -0,0 +1,47 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,8 +1,6 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.8) + PROJECT(CCfits) +-CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + +-set (CMAKE_CXX_STANDARD_REQUIRED on) +-set (CMAKE_CXX_STANDARD 11) + + # Allow the developer to select whether to build Dynamic or Static libraries + OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +@@ -25,8 +23,7 @@ ENDIF() + + #add_subdirectory (src) + +-find_package(CFITSIO REQUIRED) +-INCLUDE_DIRECTORIES(${CFITSIO_INCLUDE_DIR}) ++find_package(cfitsio REQUIRED CONFIG) + + SET (LIB_TYPE STATIC) + IF (BUILD_SHARED_LIBS) +@@ -58,15 +55,17 @@ SET(SRC_FILES + ) + + ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) +-TARGET_LINK_LIBRARIES(${LIB_NAME} ${CFITSIO_LIBRARY} ++TARGET_LINK_LIBRARIES(${LIB_NAME} cfitsio::cfitsio + ) ++TARGET_COMPILE_FEATURES(${LIB_NAME} PRIVATE cxx_std_11) + + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES + VERSION ${${PROJECT_NAME}_VERSION} + ) +-install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) ++install(TARGETS ${LIB_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR}) + ++if(0) + ENABLE_TESTING() + + SET(TEST_FILES file1.pha) +@@ -75,3 +74,4 @@ ADD_EXECUTABLE(cookbook cookbook.cxx) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/../") + TARGET_LINK_LIBRARIES(cookbook ${LIB_NAME} ${CFITSIO_LIBRARY}) + ADD_TEST(cookbook cookbook) ++endif() diff --git a/recipes/ccfits/all/test_package/CMakeLists.txt b/recipes/ccfits/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2112b47f62dd2 --- /dev/null +++ b/recipes/ccfits/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(ccfits REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ccfits::ccfits) diff --git a/recipes/ccfits/all/test_package/conanfile.py b/recipes/ccfits/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ccfits/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/ccfits/all/test_package/test_package.cpp b/recipes/ccfits/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d90b0da45c1bf --- /dev/null +++ b/recipes/ccfits/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + long naxis = 2; + long naxes[2] = {10, 20}; + CCfits::FITS fits("test.fit", USHORT_IMG, naxis, naxes); + return 0; +} diff --git a/recipes/ccfits/all/test_v1_package/CMakeLists.txt b/recipes/ccfits/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..20c81e8e8eb12 --- /dev/null +++ b/recipes/ccfits/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ccfits REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ccfits::ccfits) diff --git a/recipes/ccfits/all/test_v1_package/conanfile.py b/recipes/ccfits/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ccfits/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/ccfits/config.yml b/recipes/ccfits/config.yml new file mode 100644 index 0000000000000..190484bc6f800 --- /dev/null +++ b/recipes/ccfits/config.yml @@ -0,0 +1,5 @@ +versions: + "2.6": + folder: all + "2.5": + folder: all diff --git a/recipes/cctag/all/conandata.yml b/recipes/cctag/all/conandata.yml new file mode 100644 index 0000000000000..13ba480ba9f39 --- /dev/null +++ b/recipes/cctag/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.1": + url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.1.tar.gz" + sha256: "ae8a819bc978eb13bb1061a204c214da835e56c9b7dc775237ed6b2191011dec" +patches: + "1.0.1": + - patch_file: "patches/0001-honor-vc-runtime.patch" + patch_description: "Honor vc runtime" + patch_type: "conan" diff --git a/recipes/cctag/all/conanfile.py b/recipes/cctag/all/conanfile.py new file mode 100644 index 0000000000000..773c86527b19a --- /dev/null +++ b/recipes/cctag/all/conanfile.py @@ -0,0 +1,155 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class CCTagConan(ConanFile): + name = "cctag" + description = "Detection of CCTag markers made up of concentric circles." + license = "MPL-2.0" + topics = ("cctag", "computer-vision", "detection", "image-processing", + "markers", "fiducial-markers", "concentric-circles") + homepage = "https://github.com/alicevision/CCTag" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "serialize": [True, False], + "visual_debug": [True, False], + "no_cout": [True, False], + "with_cuda": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "serialize": False, + "visual_debug": False, + "no_cout": True, + "with_cuda": 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") + + 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") + + @property + def _required_boost_components(self): + return [ + "atomic", "chrono", "date_time", "exception", "filesystem", + "math", "serialization", "stacktrace", "system", "thread", "timer", + ] + + 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) + 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: + 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) + + def generate(self): + tc = CMakeToolchain(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.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Cleanup RPATH if Apple in shared lib of install tree + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", + "") + # Link to OpenCV targets + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "${OpenCV_LIBS}", + "opencv_core opencv_videoio opencv_imgproc opencv_imgcodecs") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CCTag") + self.cpp_info.set_property("cmake_target_name", "CCTag::CCTag") + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"CCTag{suffix}"] + 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", + ] + if self.settings.os == "Windows": + self.cpp_info.requires.append("boost::stacktrace_windbg") + else: + self.cpp_info.requires.append("boost::stacktrace_basic") + + # 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/0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..ee5d7ef70c107 --- /dev/null +++ b/recipes/cctag/all/patches/0001-honor-vc-runtime.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,6 +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") +@@ -64,6 +65,7 @@ if(MSVC AND CMAKE_GENERATOR MATCHES "Ninja") + endif() + list(APPEND CUDA_NVCC_FLAGS -Xcompiler ${CCTAG_MVSC_LINKER}) + endif() ++endif() + + set(CCTAG_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD ${CCTAG_CXX_STANDARD}) diff --git a/recipes/cctag/all/test_package/CMakeLists.txt b/recipes/cctag/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..726cfa83f1842 --- /dev/null +++ b/recipes/cctag/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(CCTag REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CCTag::CCTag) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cctag/all/test_package/conanfile.py b/recipes/cctag/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cctag/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/cctag/all/test_package/test_package.cpp b/recipes/cctag/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f4cc8324c2330 --- /dev/null +++ b/recipes/cctag/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + cctag::EdgePointCollection(1024, 1024); + return 0; +} diff --git a/recipes/cctag/all/test_v1_package/CMakeLists.txt b/recipes/cctag/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cctag/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cctag/all/test_v1_package/conanfile.py b/recipes/cctag/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cctag/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/cctag/config.yml b/recipes/cctag/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/cctag/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/cctz/all/conandata.yml b/recipes/cctz/all/conandata.yml new file mode 100644 index 0000000000000..112fd00e61958 --- /dev/null +++ b/recipes/cctz/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.3": + url: "https://github.com/google/cctz/archive/v2.3.tar.gz" + sha256: "8615b20d4e33e02a271c3b93a3b208e3d7d5d66880f5f6208b03426e448f32db" +patches: + "2.3": + - patch_file: "patches/0001-fix-installation.patch" + - patch_file: "patches/0002-fix-frameworks-apple.patch" diff --git a/recipes/cctz/all/conanfile.py b/recipes/cctz/all/conanfile.py new file mode 100644 index 0000000000000..f4eb7ecd52b25 --- /dev/null +++ b/recipes/cctz/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.53.0" + + +class CCTZConan(ConanFile): + name = "cctz" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/cctz" + description = "C++ library for translating between absolute and civil times" + topics = ("time", "timezones") + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + "build_tools" : [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "build_tools": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "190") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TOOLS"] = self.options.build_tools + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTING"] = False + # For shared msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cctz") + self.cpp_info.set_property("cmake_target_name", "cctz::cctz") + self.cpp_info.libs = ["cctz"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") + + # TODO: to remove in conan v2 + if self.options.build_tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cctz/all/patches/0001-fix-installation.patch b/recipes/cctz/all/patches/0001-fix-installation.patch new file mode 100644 index 0000000000000..f4f161a168e17 --- /dev/null +++ b/recipes/cctz/all/patches/0001-fix-installation.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -159,13 +159,14 @@ include(GNUInstallDirs) + install(TARGETS cctz + EXPORT ${PROJECT_NAME}-targets + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cctz ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + if (BUILD_TOOLS) + install(TARGETS time_tool + EXPORT ${PROJECT_NAME}-targets +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + endif() + set(CMAKE_INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) diff --git a/recipes/cctz/all/patches/0002-fix-frameworks-apple.patch b/recipes/cctz/all/patches/0002-fix-frameworks-apple.patch new file mode 100644 index 0000000000000..d7c764fd33efe --- /dev/null +++ b/recipes/cctz/all/patches/0002-fix-frameworks-apple.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -96,7 +96,9 @@ target_include_directories(cctz PUBLIC + set_target_properties(cctz PROPERTIES + PUBLIC_HEADER "${CCTZ_HDRS}" + ) +-target_link_libraries(cctz PUBLIC $<$:${CoreFoundation}>) ++if(APPLE) ++ target_link_libraries(cctz PUBLIC ${CoreFoundation}) ++endif() + add_library(cctz::cctz ALIAS cctz) + + if (BUILD_TOOLS) diff --git a/recipes/cctz/all/test_package/CMakeLists.txt b/recipes/cctz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed91192a576a9 --- /dev/null +++ b/recipes/cctz/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cctz REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cctz::cctz) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cctz/all/test_package/conanfile.py b/recipes/cctz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cctz/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/cctz/all/test_package/test_package.cpp b/recipes/cctz/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c7997fb79c760 --- /dev/null +++ b/recipes/cctz/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +// cctz upstream example, from: +// https://github.com/google/cctz/blob/master/examples/example1.cc + + +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "cctz/civil_time.h" +#include "cctz/time_zone.h" + +int main() { + cctz::time_zone lax; + load_time_zone("America/Los_Angeles", &lax); + + // Time Programming Fundamentals @cppcon + const auto tp = cctz::convert(cctz::civil_second(2015, 9, 22, 9, 0, 0), lax); + + cctz::time_zone nyc; + load_time_zone("America/New_York", &nyc); + + std::cout << cctz::format("Talk starts at %H:%M:%S %z (%Z)\n", tp, lax); + std::cout << cctz::format("Talk starts at %H:%M:%S %z (%Z)\n", tp, nyc); + + return EXIT_SUCCESS; +} + diff --git a/recipes/cctz/all/test_v1_package/CMakeLists.txt b/recipes/cctz/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cctz/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cctz/all/test_v1_package/conanfile.py b/recipes/cctz/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cctz/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/cctz/config.yml b/recipes/cctz/config.yml new file mode 100644 index 0000000000000..3b05bfcc11215 --- /dev/null +++ b/recipes/cctz/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3": + folder: all diff --git a/recipes/cd3-boost-unit-definitions/all/conandata.yml b/recipes/cd3-boost-unit-definitions/all/conandata.yml new file mode 100644 index 0000000000000..c911db51da07b --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + # Newer versions at the top + "0.2.2": + url: + - "https://github.com/CD3/BoostUnitDefinitions/archive/refs/tags/0.2.2.tar.gz" + sha256: "84b374ce94bd4792994205a40e3a92b4d70694203f596c18f00de2520ba55db3" diff --git a/recipes/cd3-boost-unit-definitions/all/conanfile.py b/recipes/cd3-boost-unit-definitions/all/conanfile.py new file mode 100644 index 0000000000000..23bdb146d0b4e --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/conanfile.py @@ -0,0 +1,96 @@ +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 PackageConan(ConanFile): + name = "cd3-boost-unit-definitions" + description = "A collection of pre-defined types and unit instances for working with Boost.Units quantities." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CD3/BoostUnitDefinitions" + topics = ("physical dimensions", "header-only") + 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": "19.0", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + def export_sources(self): + pass + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires("boost/1.80.0", transitive_headers=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." + ) + + 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.md", + 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, "src"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "BoostUnitDefinitions") + self.cpp_info.set_property( + "cmake_target_name", "BoostUnitDefinitions::BoostUnitDefinitions" + ) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "BoostUnitDefinitions" + self.cpp_info.filenames["cmake_find_package_multi"] = "BoostUnitDefinitions" + self.cpp_info.names["cmake_find_package"] = "BoostUnitDefinitions" + self.cpp_info.names["cmake_find_package_multi"] = "BoostUnitDefinitions" diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4bbd419ef9db --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(BoostUnitDefinitions REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE BoostUnitDefinitions::BoostUnitDefinitions) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py b/recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp b/recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a8708b60bd5f7 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +using namespace boost; +using namespace boost::units; + + +int main(void) { + + quantity x = 2.5*i::m; + std::cout << x << " == " << quantity(x) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5b37b01b534c --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) + diff --git a/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py b/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cd3-boost-unit-definitions/config.yml b/recipes/cd3-boost-unit-definitions/config.yml new file mode 100644 index 0000000000000..bb62e39821ff5 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "0.2.2": + folder: all diff --git a/recipes/celero/all/conandata.yml b/recipes/celero/all/conandata.yml new file mode 100644 index 0000000000000..5c189657151ee --- /dev/null +++ b/recipes/celero/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.8.2": + url: "https://github.com/DigitalInBlue/Celero/archive/v2.8.2.tar.gz" + sha256: "7d2131ba27ca5343b31f1e04777ed3e666e2ad7f785e79c960c872fc48cd5f88" + "2.6.0": + url: "https://github.com/DigitalInBlue/Celero/archive/v2.6.0.tar.gz" + sha256: "a5b72da254f81d42369382ba3157229b6b32ebbb670a22b185f80db95535e66e" +patches: + "2.8.2": + - patch_file: "patches/0004-2.8.2-missing-include.patch" + - patch_file: "patches/0005-drop-runtime.patch" + "2.6.0": + - patch_file: "patches/0001-cmake-install-pic-cxx-standard-sytem-libs.patch" + - patch_file: "patches/0002-lowercase-include-system-libs-windows.patch" + - patch_file: "patches/0003-typo-declspec.patch" + - patch_file: "patches/0004-2.6.0-missing-include.patch" diff --git a/recipes/celero/all/conanfile.py b/recipes/celero/all/conanfile.py new file mode 100644 index 0000000000000..d919314d7d0cb --- /dev/null +++ b/recipes/celero/all/conanfile.py @@ -0,0 +1,132 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class CeleroConan(ConanFile): + name = "celero" + description = "C++ Benchmarking Library" + license = "Apache-2.0" + topics = ("benchmark", "benchmark-tests", "measurements", "microbenchmarks") + homepage = "https://github.com/DigitalInBlue/Celero" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.4", + "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 + + 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) + 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["CELERO_COMPILE_DYNAMIC_LIBRARIES"] = self.options.shared + tc.variables["CELERO_COMPILE_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["CELERO_ENABLE_EXPERIMENTS"] = False + tc.variables["CELERO_ENABLE_FOLDERS"] = False + tc.variables["CELERO_ENABLE_TESTS"] = False + tc.variables["CELERO_TREAT_WARNINGS_AS_ERRORS"] = False + tc.generate() + + 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() + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"celero": "celero::celero"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Celero") + self.cpp_info.set_property("cmake_target_name", "celero") + self.cpp_info.libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.defines = ["CELERO_STATIC"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["powrprof", "psapi"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Celero" + self.cpp_info.filenames["cmake_find_package_multi"] = "Celero" + self.cpp_info.names["cmake_find_package"] = "celero" + self.cpp_info.names["cmake_find_package_multi"] = "celero" + 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/celero/all/patches/0001-cmake-install-pic-cxx-standard-sytem-libs.patch b/recipes/celero/all/patches/0001-cmake-install-pic-cxx-standard-sytem-libs.patch new file mode 100644 index 0000000000000..a37292eb1137b --- /dev/null +++ b/recipes/celero/all/patches/0001-cmake-install-pic-cxx-standard-sytem-libs.patch @@ -0,0 +1,86 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,9 @@ + CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) + + macro(CeleroSetDefaultCompilerOptions) ++ set_target_properties(${PROJECT_NAME} PROPERTIES ++ POSITION_INDEPENDENT_CODE "${CELERO_COMPILE_PIC}" ++ ) + if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /D_VARIADIC_MAX=10 ) + target_compile_options(${PROJECT_NAME} PRIVATE /D_CRT_SECURE_NO_WARNINGS) +@@ -31,7 +34,6 @@ macro(CeleroSetDefaultCompilerOptions) + target_compile_options(${PROJECT_NAME} PRIVATE /MP) + target_compile_options(${PROJECT_NAME} PRIVATE /D_SCL_SECURE_NO_WARNINGS) + target_compile_options(${PROJECT_NAME} PRIVATE /permissive-) +- target_compile_options(${PROJECT_NAME} PRIVATE /std:c++14) + + if(CELERO_TREAT_WARNINGS_AS_ERRORS) + target_compile_options(${PROJECT_NAME} PRIVATE /WX) +@@ -39,12 +41,10 @@ macro(CeleroSetDefaultCompilerOptions) + + elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) + target_compile_options(${PROJECT_NAME} PRIVATE -Wall) +- target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) +- target_compile_options(${PROJECT_NAME} PRIVATE -std=c++14) + + elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) + if(${CMAKE_SYSTEM_NAME} STREQUAL Windows) +- target_compile_options(${PROJECT_NAME} PRIVATE -Xclang -std=c++14) ++ target_compile_options(${PROJECT_NAME} PRIVATE -Xclang) + target_compile_options(${PROJECT_NAME} PRIVATE -Wno-c++98-compat) + target_compile_options(${PROJECT_NAME} PRIVATE -Wno-c++98-compat-pedantic) + target_compile_options(${PROJECT_NAME} PRIVATE -Wno-reserved-id-macro) +@@ -53,8 +53,6 @@ macro(CeleroSetDefaultCompilerOptions) + endif() + else() + target_compile_options(${PROJECT_NAME} PRIVATE -Wall) +- target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) +- target_compile_options(${PROJECT_NAME} PRIVATE -std=c++14) + if(CELERO_TREAT_WARNINGS_AS_ERRORS) + target_compile_options(${PROJECT_NAME} PRIVATE -Werror) + endif() +@@ -62,8 +60,6 @@ macro(CeleroSetDefaultCompilerOptions) + + elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang) + target_compile_options(${PROJECT_NAME} PRIVATE -Wall) +- target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) +- target_compile_options(${PROJECT_NAME} PRIVATE -std=c++14) + + if(CELERO_TREAT_WARNINGS_AS_ERRORS) + target_compile_options(${PROJECT_NAME} PRIVATE -Werror) +@@ -83,6 +79,7 @@ include(CheckIncludeFile) + # + + option(CELERO_COMPILE_DYNAMIC_LIBRARIES "Set to ON to build Celero for dynamic linking. Use OFF for static." ON) ++option(CELERO_COMPILE_PIC "Set to ON to build Celero as a position-independent library." ON) + option(CELERO_ENABLE_EXPERIMENTS "Set to ON to automatically build all examples." OFF) + option(CELERO_ENABLE_FOLDERS "Enable to put Celero in its own solution folder under Visual Studio" ON) + option(CELERO_ENABLE_TESTS "Enable building and running unit tests." OFF) +@@ -101,6 +98,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + # + + set(CMAKE_CXX_STANDARD 14) ++set(CMAKE_CXX_EXTENSIONS OFF) + + set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows") + set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows") +@@ -178,7 +176,7 @@ target_sources(${PROJECT_NAME} PRIVATE + + if(MSVC) + set(SYSLIBS +- PowrProf.lib ++ powrprof psapi + ) + else() + #pthread is required for std::thread to work. +@@ -204,7 +202,7 @@ install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}-target + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib +- ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/static ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ) + + install(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/recipes/celero/all/patches/0002-lowercase-include-system-libs-windows.patch b/recipes/celero/all/patches/0002-lowercase-include-system-libs-windows.patch new file mode 100644 index 0000000000000..a3505a3c88354 --- /dev/null +++ b/recipes/celero/all/patches/0002-lowercase-include-system-libs-windows.patch @@ -0,0 +1,61 @@ +--- a/src/Console.cpp ++++ b/src/Console.cpp +@@ -21,7 +21,7 @@ + using namespace celero; + + #ifdef WIN32 +-#include ++#include + #include + #else + #include +--- a/src/Exceptions.cpp ++++ b/src/Exceptions.cpp +@@ -22,7 +22,7 @@ + #include + + #ifdef WIN32 +-#include ++#include + #endif // WIN32 + + #include +--- a/src/Memory.cpp ++++ b/src/Memory.cpp +@@ -20,9 +20,9 @@ + #include + + #ifdef WIN32 +-#include ++#include + +-#include ++#include + #elif defined(__APPLE__) + #include + #include +--- a/src/Timer.cpp ++++ b/src/Timer.cpp +@@ -21,7 +21,7 @@ + #include + + #ifdef WIN32 +-#include ++#include + LARGE_INTEGER QPCFrequency; + #else + #include +--- a/src/Utilities.cpp ++++ b/src/Utilities.cpp +@@ -20,9 +20,9 @@ + #include + + #ifdef WIN32 +-#include ++#include + +-#include ++#include + #endif + + #ifdef max diff --git a/recipes/celero/all/patches/0003-typo-declspec.patch b/recipes/celero/all/patches/0003-typo-declspec.patch new file mode 100644 index 0000000000000..0574c307bc501 --- /dev/null +++ b/recipes/celero/all/patches/0003-typo-declspec.patch @@ -0,0 +1,18 @@ +--- a/include/celero/Export.h ++++ b/include/celero/Export.h +@@ -25,11 +25,11 @@ + #else + #ifdef WIN32 + #if defined CELERO_EXPORTS +-#define CELERO_EXPORT _declspec(dllexport) +-#define CELERO_EXPORT_C extern "C" _declspec(dllexport) ++#define CELERO_EXPORT __declspec(dllexport) ++#define CELERO_EXPORT_C extern "C" __declspec(dllexport) + #else +-#define CELERO_EXPORT _declspec(dllimport) +-#define CELERO_EXPORT_C extern "C" _declspec(dllimport) ++#define CELERO_EXPORT __declspec(dllimport) ++#define CELERO_EXPORT_C extern "C" __declspec(dllimport) + #endif + #else + #define CELERO_EXPORT diff --git a/recipes/celero/all/patches/0004-2.6.0-missing-include.patch b/recipes/celero/all/patches/0004-2.6.0-missing-include.patch new file mode 100644 index 0000000000000..60589414f6eb6 --- /dev/null +++ b/recipes/celero/all/patches/0004-2.6.0-missing-include.patch @@ -0,0 +1,10 @@ +--- a/include/celero/TestFixture.h ++++ b/include/celero/TestFixture.h +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/celero/all/patches/0004-2.8.2-missing-include.patch b/recipes/celero/all/patches/0004-2.8.2-missing-include.patch new file mode 100644 index 0000000000000..00155b6e65a62 --- /dev/null +++ b/recipes/celero/all/patches/0004-2.8.2-missing-include.patch @@ -0,0 +1,10 @@ +--- a/include/celero/TestFixture.h ++++ b/include/celero/TestFixture.h +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/celero/all/patches/0005-drop-runtime.patch b/recipes/celero/all/patches/0005-drop-runtime.patch new file mode 100644 index 0000000000000..0559d5d36c265 --- /dev/null +++ b/recipes/celero/all/patches/0005-drop-runtime.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a8e771a..ff89a66 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,18 +35,6 @@ macro(CeleroSetDefaultCompilerOptions) + target_compile_options(${PROJECT_NAME} PRIVATE /D_SCL_SECURE_NO_WARNINGS) + target_compile_options(${PROJECT_NAME} PRIVATE /permissive-) + +- if (NOT CELERO_COMPILE_DYNAMIC_LIBRARIES) +- if(VCPKG_CRT_LINKAGE) +- if(VCPKG_CRT_LINKAGE STREQUAL "static") +- target_compile_options(${PROJECT_NAME} PRIVATE /MT$<$:d>) +- else() +- target_compile_options(${PROJECT_NAME} PRIVATE /MD$<$:d>) +- endif() +- else() +- target_compile_options(${PROJECT_NAME} PRIVATE /MD$<$:d>) +- endif() +- endif() +- + if(CELERO_TREAT_WARNINGS_AS_ERRORS) + target_compile_options(${PROJECT_NAME} PRIVATE /WX) + endif() diff --git a/recipes/celero/all/test_package/CMakeLists.txt b/recipes/celero/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0a511951ebd5f --- /dev/null +++ b/recipes/celero/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Celero REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE celero) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/celero/all/test_package/conanfile.py b/recipes/celero/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/celero/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/celero/all/test_package/test_package.cpp b/recipes/celero/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ac63ab21c696d --- /dev/null +++ b/recipes/celero/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include + +#include +#include + +/// +/// This is the main(int argc, char** argv) for the entire celero program. +/// You can write your own, or use this macro to insert the standard one into the project. +/// +CELERO_MAIN + +std::random_device RandomDevice; +std::uniform_int_distribution UniformDistribution(0, 1024); + +/// +/// In reality, all of the "Complex" cases take the same amount of time to run. +/// The difference in the results is a product of measurement error. +/// +/// Interestingly, taking the sin of a constant number here resulted in a +/// great deal of optimization in clang and gcc. +/// +BASELINE(DemoSimple, Baseline, 10, 100000) +{ + celero::DoNotOptimizeAway(static_cast(std::sin(UniformDistribution(RandomDevice)))); +} + +/// +/// Run a test consisting of 1 sample of 710000 operations per measurement. +/// There are not enough samples here to likely get a meaningful result. +/// +BENCHMARK(DemoSimple, Complex1, 1, 710000) +{ + celero::DoNotOptimizeAway(static_cast(std::sin(std::fmod(UniformDistribution(RandomDevice), 3.14159265)))); +} diff --git a/recipes/celero/all/test_v1_package/CMakeLists.txt b/recipes/celero/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/celero/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/celero/all/test_v1_package/conanfile.py b/recipes/celero/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/celero/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/celero/config.yml b/recipes/celero/config.yml new file mode 100644 index 0000000000000..3f32427faf7d1 --- /dev/null +++ b/recipes/celero/config.yml @@ -0,0 +1,5 @@ +versions: + "2.8.2": + folder: all + "2.6.0": + folder: all diff --git a/recipes/cereal/all/conandata.yml b/recipes/cereal/all/conandata.yml new file mode 100644 index 0000000000000..885e23f3a294b --- /dev/null +++ b/recipes/cereal/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.3.2": + url: "https://github.com/USCiLab/cereal/archive/v1.3.2.tar.gz" + sha256: "16a7ad9b31ba5880dac55d62b5d6f243c3ebc8d46a3514149e56b5e7ea81f85f" + "1.3.1": + url: "https://github.com/USCiLab/cereal/archive/v1.3.1.tar.gz" + sha256: "65ea6ddda98f4274f5c10fb3e07b2269ccdd1e5cbb227be6a2fd78b8f382c976" + "1.3.0": + url: "https://github.com/USCiLab/cereal/archive/v1.3.0.tar.gz" + sha256: "329ea3e3130b026c03a4acc50e168e7daff4e6e661bc6a7dfec0d77b570851d5" diff --git a/recipes/cereal/all/conanfile.py b/recipes/cereal/all/conanfile.py new file mode 100644 index 0000000000000..7523bebc550cf --- /dev/null +++ b/recipes/cereal/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class CerealConan(ConanFile): + name = "cereal" + description = "Serialization header-only library for C++11." + license = "BSD-3-Clause" + topics = ("cereal", "header-only", "serialization", "cpp11") + homepage = "https://github.com/USCiLab/cereal" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "thread_safe": [True, False], + } + default_options = { + "thread_safe": False, + } + + def package_id(self): + self.info.clear() + + 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["JUST_INSTALL_CEREAL"] = True + tc.variables["CEREAL_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() + + # The "share" folder was being removed up to and including version 1.3.0. + # The module files were moved to lib/cmake from 1.3.1 on, so now removing both + # as to avoid breaking versions < 1.3.1 + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"cereal": "cereal::cereal"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cereal") + self.cpp_info.set_property("cmake_target_name", "cereal::cereal") + self.cpp_info.set_property("cmake_target_aliases", ["cereal"]) # target before 1.3.1 + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.options.thread_safe: + self.cpp_info.defines = ["CEREAL_THREAD_SAFE=1"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.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/cereal/all/test_package/CMakeLists.txt b/recipes/cereal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..70514b278957b --- /dev/null +++ b/recipes/cereal/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cereal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cereal::cereal) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cereal/all/test_package/conanfile.py b/recipes/cereal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/cereal/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/cereal/all/test_package/test_package.cpp b/recipes/cereal/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fc970fbdc0d14 --- /dev/null +++ b/recipes/cereal/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include + + +struct Data +{ + int x, y, z; + template + void serialize(Archive & archive) { archive( x, y, z ); } +}; + + +int main() { + std::cout << "Serialized data: "; + { + cereal::BinaryOutputArchive oarchive(std::cout); + Data d1{42, 12, 52}; + Data d2{33, 34, 35}; + Data d3{74, 34, 45}; + oarchive(d1, d2, d3); + } + std::cout << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/cereal/all/test_v1_package/CMakeLists.txt b/recipes/cereal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3bc0d9666049d --- /dev/null +++ b/recipes/cereal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cereal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cereal::cereal) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cereal/all/test_v1_package/conanfile.py b/recipes/cereal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cereal/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/cereal/config.yml b/recipes/cereal/config.yml new file mode 100644 index 0000000000000..b558b881f2cfe --- /dev/null +++ b/recipes/cereal/config.yml @@ -0,0 +1,7 @@ +versions: + "1.3.2": + folder: all + "1.3.1": + folder: all + "1.3.0": + folder: all diff --git a/recipes/ceres-solver/all/conandata.yml b/recipes/ceres-solver/all/conandata.yml new file mode 100644 index 0000000000000..47afe48e93634 --- /dev/null +++ b/recipes/ceres-solver/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "2.1.0": + url: "http://ceres-solver.org/ceres-solver-2.1.0.tar.gz" + sha256: "f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6" + "2.0.0": + url: "http://ceres-solver.org/ceres-solver-2.0.0.tar.gz" + sha256: "10298a1d75ca884aa0507d1abb0e0f04800a92871cd400d4c361b56a777a7603" + "1.14.0": + url: "http://ceres-solver.org/ceres-solver-1.14.0.tar.gz" + sha256: "4744005fc3b902fed886ea418df70690caa8e2ff6b5a90f3dd88a3d291ef8e8e" +patches: + "2.1.0": + - patch_file: "patches/2.1.0-0001-find-libraries-conan.patch" + patch_description: "Robust dependencies handling" + patch_type: "conan" + - patch_file: "patches/2.1.0-0002-fix-mingw-build.patch" + patch_description: "Fix MinGW build" + patch_type: "portability" + "2.0.0": + - patch_file: "patches/2.0.0-0001-find-libraries-conan.patch" + patch_description: "Robust dependencies handling" + patch_type: "conan" + - patch_file: "patches/2.0.0-0002-fix-mingw-build.patch" + patch_description: "Fix MinGW build" + patch_type: "portability" + "1.14.0": + - patch_file: "patches/1.14.0-0001-find-libraries-conan.patch" + patch_description: "Robust dependencies handling" + patch_type: "conan" + - patch_file: "patches/1.14.0-0002-fix-msvc-c++17.patch" + patch_description: "Fix compilation with C++17 standard and above" + patch_type: "portability" + patch_source: "https://github.com/ceres-solver/ceres-solver/commit/1e8e9452d0a7dfaf5697b544810798a58e35443e" diff --git a/recipes/ceres-solver/all/conanfile.py b/recipes/ceres-solver/all/conanfile.py new file mode 100644 index 0000000000000..e4ca7cba349d0 --- /dev/null +++ b/recipes/ceres-solver/all/conanfile.py @@ -0,0 +1,189 @@ +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, 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.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class CeressolverConan(ConanFile): + name = "ceres-solver" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://ceres-solver.org/" + description = ( + "Ceres Solver is an open source C++ library for modeling " + "and solving large, complicated optimization problems" + ) + topics = ("optimization", "non-linear least squares") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_glog": [True, False], #TODO Set to true once gflags with nothreads=False binaries are available. Using MINILOG has a big performance drawback. + "use_gflags": [True, False, "deprecated"], + "use_custom_blas": [True, False], + "use_eigen_sparse": [True, False], + "use_TBB": [True, False], + "use_CXX11_threads": [True, False], + "use_CXX11": [True, False], + "use_schur_specializations": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_glog": False, + "use_gflags": "deprecated", + "use_custom_blas": True, + "use_eigen_sparse": True, + "use_TBB": False, + "use_CXX11_threads": False, + "use_CXX11": False, + "use_schur_specializations": True, + } + + @property + def _min_cppstd(self): + return "98" if Version(self.version) < "2.0.0" else "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "apple-clang": "5", + "clang": "5", + "gcc": "5", + "msvc": "190", + "Visual Studio": "14", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "2.0": + del self.options.use_TBB + del self.options.use_CXX11_threads + del self.options.use_CXX11 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.use_gflags != "deprecated": + self.output.warning("use_gflags option is deprecated") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0", transitive_headers=True) + if self.options.use_glog: + self.requires("glog/0.6.0", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("use_TBB"): + self.requires("onetbb/2020.3") + + def package_id(self): + del self.info.options.use_gflags + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MINIGLOG"] = not self.options.use_glog + tc.variables["GFLAGS"] = False # useless for the lib itself, gflags is not a direct dependency + tc.variables["SUITESPARSE"] = False + tc.variables["CXSPARSE"] = False + tc.variables["LAPACK"] = False + tc.variables["SCHUR_SPECIALIZATIONS"] = self.options.use_schur_specializations + tc.variables["CUSTOM_BLAS"] = self.options.use_custom_blas + tc.variables["EIGENSPARSE"] = self.options.use_eigen_sparse + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_BENCHMARKS"] = False + if is_msvc(self): + tc.variables["MSVC_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + if Version(self.version) >= "2.1.0": + tc.variables["CUDA"] = False + if Version(self.version) >= "2.0.0": + tc.variables["PROVIDE_UNINSTALL_TARGET"] = False + if is_apple_os(self): + tc.variables["ACCELERATESPARSE"] = True + if Version(self.version) < "2.1.0": + tc.variables["LIB_SUFFIX"] = "" + if Version(self.version) < "2.0": + tc.variables["CXX11"] = self.options.use_CXX11 + tc.variables["OPENMP"] = False + tc.variables["TBB"] = self.options.use_TBB + tc.variables["CXX11_THREADS"] = self.options.use_CXX11_threads + tc.generate() + + CMakeDeps(self).generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Ceres") + self.cpp_info.set_property("cmake_target_name", "Ceres::ceres") + + libsuffix = "" + if self.settings.build_type == "Debug": + libsuffix = "-debug" + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["ceres"].libs = [f"ceres{libsuffix}"] + self.cpp_info.components["ceres"].includedirs.append(os.path.join("include", "ceres")) + if not self.options.use_glog: + self.cpp_info.components["ceres"].includedirs.append(os.path.join("include", "ceres", "internal", "miniglog")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ceres"].system_libs.append("m") + if self.options.get_safe("use_CXX11_threads", True): + self.cpp_info.components["ceres"].system_libs.append("pthread") + elif is_apple_os(self): + if Version(self.version) >= "2": + self.cpp_info.components["ceres"].frameworks.append("Accelerate") + self.cpp_info.components["ceres"].requires = ["eigen::eigen"] + if self.options.use_glog: + self.cpp_info.components["ceres"].requires.append("glog::glog") + if self.options.get_safe("use_TBB"): + self.cpp_info.components["ceres"].requires.append("onetbb::onetbb") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["ceres"].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Ceres" + self.cpp_info.names["cmake_find_package_multi"] = "Ceres" + self.cpp_info.components["ceres"].set_property("cmake_target_name", "Ceres::ceres") diff --git a/recipes/ceres-solver/all/patches/1.14.0-0001-find-libraries-conan.patch b/recipes/ceres-solver/all/patches/1.14.0-0001-find-libraries-conan.patch new file mode 100644 index 0000000000000..6518cb4c5d884 --- /dev/null +++ b/recipes/ceres-solver/all/patches/1.14.0-0001-find-libraries-conan.patch @@ -0,0 +1,148 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -209,40 +209,40 @@ endif (IOS) + unset(CERES_COMPILE_OPTIONS) + + # Eigen. +-find_package(Eigen REQUIRED) +-if (EIGEN_FOUND) +- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") +- if (EIGEN_VERSION VERSION_LESS 3.1.0) ++find_package(Eigen3 REQUIRED CONFIG) ++if (1) ++ message("-- Found Eigen version ${Eigen3_VERSION}: ${Eigen3_INCLUDE_DIRS}") ++ if (Eigen3_VERSION VERSION_LESS 3.1.0) + message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.1.0 in order " + "that Eigen/SparseCore be available, detected version of Eigen is: " +- "${EIGEN_VERSION}") +- endif (EIGEN_VERSION VERSION_LESS 3.1.0) ++ "${Eigen3_VERSION}") ++ endif () + + if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" AND +- EIGEN_VERSION VERSION_LESS 3.3.4) ++ Eigen3_VERSION VERSION_LESS 3.3.4) + # As per issue #289: https://github.com/ceres-solver/ceres-solver/issues/289 + # the bundle_adjustment_test will fail for Eigen < 3.3.4 on aarch64. + message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.3.4 on aarch64. " +- "Detected version of Eigen is: ${EIGEN_VERSION}.") ++ "Detected version of Eigen is: ${Eigen3_VERSION}.") + endif() + + if (EIGENSPARSE) + message("-- Enabling use of Eigen as a sparse linear algebra library.") + list(APPEND CERES_COMPILE_OPTIONS CERES_USE_EIGEN_SPARSE) +- if (EIGEN_VERSION VERSION_LESS 3.2.2) ++ if (Eigen3_VERSION VERSION_LESS 3.2.2) + message(" WARNING:") + message("") +- message(" Your version of Eigen (${EIGEN_VERSION}) is older than ") ++ message(" Your version of Eigen (${Eigen3_VERSION}) is older than ") + message(" version 3.2.2. The performance of SPARSE_NORMAL_CHOLESKY ") + message(" and SPARSE_SCHUR linear solvers will suffer.") +- endif (EIGEN_VERSION VERSION_LESS 3.2.2) ++ endif () + else (EIGENSPARSE) + message("-- Disabling use of Eigen as a sparse linear algebra library.") + message(" This does not affect the covariance estimation algorithm ") + message(" which can still use the EIGEN_SPARSE_QR algorithm.") + add_definitions(-DEIGEN_MPL2_ONLY) + endif (EIGENSPARSE) +-endif (EIGEN_FOUND) ++endif () + + if (LAPACK) + find_package(LAPACK QUIET) +@@ -376,13 +376,14 @@ else (MINIGLOG) + unset(MINIGLOG_MAX_LOG_LEVEL CACHE) + # Don't search with REQUIRED so that configuration continues if not found and + # we can output an error messages explaining MINIGLOG option. +- find_package(Glog) +- if (NOT GLOG_FOUND) ++ find_package(glog REQUIRED CONFIG) ++ if (0) + message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " + "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " + "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " + "implementation.") +- endif(NOT GLOG_FOUND) ++ endif() ++ if(0) + # By default, assume gflags was found, updating the message if it was not. + set(GLOG_GFLAGS_DEPENDENCY_MESSAGE + " Assuming glog was built with gflags support as gflags was found. " +@@ -395,7 +396,8 @@ else (MINIGLOG) + "Otherwise, Ceres may fail to link due to missing gflags symbols.") + endif(NOT GFLAGS_FOUND) + message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) +-endif (MINIGLOG) ++ endif() ++endif () + + if (NOT SCHUR_SPECIALIZATIONS) + list(APPEND CERES_COMPILE_OPTIONS CERES_RESTRICT_SCHUR_SPECIALIZATION) +@@ -526,7 +528,7 @@ if (CXX11 AND (TBB OR CXX11_THREADS)) + endif() + + if (CXX11 AND TBB) +- find_package(TBB QUIET) ++ find_package(TBB REQUIRED CONFIG) + if (TBB_FOUND) + message("-- Building with TBB (version: ${TBB_VERSION}).") + list(APPEND CERES_COMPILE_OPTIONS CERES_USE_TBB) +--- a/internal/ceres/CMakeLists.txt ++++ b/internal/ceres/CMakeLists.txt +@@ -152,9 +152,10 @@ else (SCHUR_SPECIALIZATIONS) + endif (SCHUR_SPECIALIZATIONS) + + # Build the list of dependencies for Ceres based on the current configuration. +-if (NOT MINIGLOG AND GLOG_FOUND) +- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES}) +- if (GFLAGS_FOUND) ++list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Eigen3::Eigen) ++if (NOT MINIGLOG) ++ list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES glog::glog) ++ if (0) + # If glog & gflags are both found, we assume that glog was built with + # gflags, as it is awkward to perform a try_compile() to verify this + # when gflags is an imported target (as it is in newer versions). +@@ -162,7 +163,7 @@ if (NOT MINIGLOG AND GLOG_FOUND) + # gflags, it is thus a public dependency for Ceres in this case. + list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GFLAGS_LIBRARIES}) + endif() +-endif (NOT MINIGLOG AND GLOG_FOUND) ++endif () + + if (SUITESPARSE AND SUITESPARSE_FOUND) + # Define version information for use in Solver::FullReport. +@@ -191,7 +192,7 @@ if (OPENMP_FOUND) + endif (OPENMP_FOUND) + + if (TBB_FOUND) +- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES ${TBB_LIBRARIES}) ++ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES TBB::tbb) + if (NOT MSVC) + list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES ${CMAKE_THREAD_LIBS_INIT}) + endif (NOT MSVC) +@@ -241,8 +242,8 @@ if (BUILD_SHARED_LIBS) + # When building a shared library, mark all external libraries as + # PRIVATE so they don't show up as a dependency. + target_link_libraries(ceres +- LINK_PUBLIC ${CERES_LIBRARY_PUBLIC_DEPENDENCIES} +- LINK_PRIVATE ${CERES_LIBRARY_PRIVATE_DEPENDENCIES}) ++ PUBLIC ${CERES_LIBRARY_PUBLIC_DEPENDENCIES} ++ PRIVATE ${CERES_LIBRARY_PRIVATE_DEPENDENCIES}) + else (BUILD_SHARED_LIBS) + # When building a static library, all external libraries are + # PUBLIC(default) since the user needs to link to them. +@@ -250,7 +251,9 @@ else (BUILD_SHARED_LIBS) + set(CERES_LIBRARY_DEPENDENCIES + ${CERES_LIBRARY_PUBLIC_DEPENDENCIES} + ${CERES_LIBRARY_PRIVATE_DEPENDENCIES}) +- target_link_libraries(ceres ${CERES_LIBRARY_DEPENDENCIES}) ++ target_link_libraries(ceres ++ PUBLIC ${CERES_LIBRARY_PUBLIC_DEPENDENCIES} ++ PRIVATE ${CERES_LIBRARY_PRIVATE_DEPENDENCIES}) + endif (BUILD_SHARED_LIBS) + + install(TARGETS ceres diff --git a/recipes/ceres-solver/all/patches/1.14.0-0002-fix-msvc-c++17.patch b/recipes/ceres-solver/all/patches/1.14.0-0002-fix-msvc-c++17.patch new file mode 100644 index 0000000000000..40f5d847170fc --- /dev/null +++ b/recipes/ceres-solver/all/patches/1.14.0-0002-fix-msvc-c++17.patch @@ -0,0 +1,36 @@ +Based on upstream commit 1e8e9452d0a7dfaf5697b544810798a58e35443e. +Fixes conan-io/conan-center-index#2678 + +From 1e8e9452d0a7dfaf5697b544810798a58e35443e Mon Sep 17 00:00:00 2001 +From: Norbert Wenzel +Date: Tue, 22 May 2018 16:45:46 +0200 +Subject: [PATCH] Remove chunk shuffle in multithreaded SchurEliminator + +std::random_shuffle() is deprecated since C++14 and was removed in +C++17. At least MSVC with C++17 fails to compile this code, I assume +other compilers fail as well. + +In a Github discussion (#373) Sameer Agarwal states this line can +likely be dropped and asks for a PR/CL. + +https://github.com/ceres-solver/ceres-solver/issues/373 + +Change-Id: I78e04f36cba398769b8f90916edbdaf33884e7e1 +--- + internal/ceres/schur_eliminator_impl.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/internal/ceres/schur_eliminator_impl.h b/internal/ceres/schur_eliminator_impl.h +index 203dcc9ef..06d0983b9 100644 +--- a/internal/ceres/schur_eliminator_impl.h ++++ b/internal/ceres/schur_eliminator_impl.h +@@ -154,9 +154,6 @@ void SchurEliminator::Init( + const Chunk& chunk = chunks_.back(); + + uneliminated_row_begins_ = chunk.start + chunk.size; +- if (num_threads_ > 1) { +- random_shuffle(chunks_.begin(), chunks_.end()); +- } + + buffer_.reset(new double[buffer_size_ * num_threads_]); + diff --git a/recipes/ceres-solver/all/patches/2.0.0-0001-find-libraries-conan.patch b/recipes/ceres-solver/all/patches/2.0.0-0001-find-libraries-conan.patch new file mode 100644 index 0000000000000..01e9ab9314b97 --- /dev/null +++ b/recipes/ceres-solver/all/patches/2.0.0-0001-find-libraries-conan.patch @@ -0,0 +1,82 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -239,14 +239,14 @@ message("-- Building with C++${CMAKE_CXX_STANDARD}") + # Eigen. + # Eigen delivers Eigen3Config.cmake since v3.3.3 + find_package(Eigen3 3.3 REQUIRED) +-if (EIGEN3_FOUND) +- message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") ++if (1) ++ message("-- Found Eigen version ${Eigen3_VERSION}: ${Eigen3_INCLUDE_DIRS}") + if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" AND +- EIGEN3_VERSION_STRING VERSION_LESS 3.3.4) ++ Eigen3_VERSION VERSION_LESS 3.3.4) + # As per issue #289: https://github.com/ceres-solver/ceres-solver/issues/289 + # the bundle_adjustment_test will fail for Eigen < 3.3.4 on aarch64. + message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.3.4 on aarch64. " +- "Detected version of Eigen is: ${EIGEN3_VERSION_STRING}.") ++ "Detected version of Eigen is: ${Eigen3_VERSION}.") + endif() + + if (EIGENSPARSE) +@@ -258,7 +258,7 @@ if (EIGEN3_FOUND) + message(" which can still use the EIGEN_SPARSE_QR algorithm.") + add_definitions(-DEIGEN_MPL2_ONLY) + endif (EIGENSPARSE) +-endif (EIGEN3_FOUND) ++endif () + + if (LAPACK) + find_package(LAPACK QUIET) +@@ -427,13 +427,14 @@ else (MINIGLOG) + unset(MINIGLOG_MAX_LOG_LEVEL CACHE) + # Don't search with REQUIRED so that configuration continues if not found and + # we can output an error messages explaining MINIGLOG option. +- find_package(Glog) +- if (NOT GLOG_FOUND) ++ find_package(glog REQUIRED CONFIG) ++ if (0) + message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " + "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " + "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " + "implementation.") +- endif(NOT GLOG_FOUND) ++ endif() ++ if(0) + # By default, assume gflags was found, updating the message if it was not. + set(GLOG_GFLAGS_DEPENDENCY_MESSAGE + " Assuming glog was built with gflags support as gflags was found. " +@@ -446,7 +447,8 @@ else (MINIGLOG) + "Otherwise, Ceres may fail to link due to missing gflags symbols.") + endif(NOT gflags_FOUND) + message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) +-endif (MINIGLOG) ++ endif() ++endif () + + if (NOT SCHUR_SPECIALIZATIONS) + list(APPEND CERES_COMPILE_OPTIONS CERES_RESTRICT_SCHUR_SPECIALIZATION) +--- a/internal/ceres/CMakeLists.txt ++++ b/internal/ceres/CMakeLists.txt +@@ -174,9 +174,9 @@ endif (SCHUR_SPECIALIZATIONS) + find_package(Threads QUIET) + list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Threads::Threads) + +-if (NOT MINIGLOG AND GLOG_FOUND) +- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES}) +- if (gflags_FOUND) ++if (NOT MINIGLOG) ++ list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES glog::glog) ++ if (0) + # If glog & gflags are both found, we assume that glog was built with + # gflags, as it is awkward to perform a try_compile() to verify this + # when gflags is an imported target (as it is in newer versions). +@@ -184,7 +184,7 @@ if (NOT MINIGLOG AND GLOG_FOUND) + # gflags, it is thus a public dependency for Ceres in this case. + list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES gflags) + endif() +-endif (NOT MINIGLOG AND GLOG_FOUND) ++endif () + + if (SUITESPARSE AND SUITESPARSE_FOUND) + # Define version information for use in Solver::FullReport. diff --git a/recipes/ceres-solver/all/patches/2.0.0-0002-fix-mingw-build.patch b/recipes/ceres-solver/all/patches/2.0.0-0002-fix-mingw-build.patch new file mode 100644 index 0000000000000..2978c914e5d8d --- /dev/null +++ b/recipes/ceres-solver/all/patches/2.0.0-0002-fix-mingw-build.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -514,6 +514,9 @@ if (MINGW) + "to a MinGW bug: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556") + string(REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + update_cache_variable(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") ++ # Add the equivalent of /bigobj for MSVC for MinGW to fix 'too many sections' ++ # compile errors due to extensive use of templates. ++ add_compile_options(-Wa,-mbig-obj) + endif (MINGW) + + # After the tweaks for the compile settings, disable some warnings on MSVC. diff --git a/recipes/ceres-solver/all/patches/2.1.0-0001-find-libraries-conan.patch b/recipes/ceres-solver/all/patches/2.1.0-0001-find-libraries-conan.patch new file mode 100644 index 0000000000000..e37860d53493e --- /dev/null +++ b/recipes/ceres-solver/all/patches/2.1.0-0001-find-libraries-conan.patch @@ -0,0 +1,54 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -405,13 +405,14 @@ else (MINIGLOG) + unset(MINIGLOG_MAX_LOG_LEVEL CACHE) + # Don't search with REQUIRED so that configuration continues if not found and + # we can output an error messages explaining MINIGLOG option. +- find_package(Glog) +- if (NOT GLOG_FOUND) ++ find_package(glog REQUIRED CONFIG) ++ if (0) + message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " + "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " + "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " + "implementation.") +- endif(NOT GLOG_FOUND) ++ endif() ++ if(0) + # By default, assume gflags was found, updating the message if it was not. + set(GLOG_GFLAGS_DEPENDENCY_MESSAGE + " Assuming glog was built with gflags support as gflags was found. " +@@ -424,7 +425,8 @@ else (MINIGLOG) + "Otherwise, Ceres may fail to link due to missing gflags symbols.") + endif(NOT gflags_FOUND) + message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) +-endif (MINIGLOG) ++ endif() ++endif () + + if (NOT SCHUR_SPECIALIZATIONS) + list(APPEND CERES_COMPILE_OPTIONS CERES_RESTRICT_SCHUR_SPECIALIZATION) +--- a/internal/ceres/CMakeLists.txt ++++ b/internal/ceres/CMakeLists.txt +@@ -101,9 +101,9 @@ endif() + find_package(Threads QUIET) + list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Threads::Threads) + +-if (NOT MINIGLOG AND GLOG_FOUND) +- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES}) +- if (gflags_FOUND) ++if (NOT MINIGLOG) ++ list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES glog::glog) ++ if (0) + # If glog & gflags are both found, we assume that glog was built with + # gflags, as it is awkward to perform a try_compile() to verify this + # when gflags is an imported target (as it is in newer versions). +@@ -111,7 +111,7 @@ if (NOT MINIGLOG AND GLOG_FOUND) + # gflags, it is thus a public dependency for Ceres in this case. + list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES gflags) + endif() +-endif (NOT MINIGLOG AND GLOG_FOUND) ++endif () + + if (SUITESPARSE AND SuiteSparse_FOUND) + # Define version information for use in Solver::FullReport. diff --git a/recipes/ceres-solver/all/patches/2.1.0-0002-fix-mingw-build.patch b/recipes/ceres-solver/all/patches/2.1.0-0002-fix-mingw-build.patch new file mode 100644 index 0000000000000..0fb8a2b83b2c4 --- /dev/null +++ b/recipes/ceres-solver/all/patches/2.1.0-0002-fix-mingw-build.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -488,6 +488,9 @@ if (MINGW) + "to a MinGW bug: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556") + string(REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + update_cache_variable(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") ++ # Add the equivalent of /bigobj for MSVC for MinGW to fix 'too many sections' ++ # compile errors due to extensive use of templates. ++ add_compile_options(-Wa,-mbig-obj) + endif (MINGW) + + # After the tweaks for the compile settings, disable some warnings on MSVC. diff --git a/recipes/ceres-solver/all/test_package/CMakeLists.txt b/recipes/ceres-solver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f3987035886ae --- /dev/null +++ b/recipes/ceres-solver/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Ceres REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Ceres::ceres) diff --git a/recipes/ceres-solver/all/test_package/conanfile.py b/recipes/ceres-solver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ceres-solver/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/ceres-solver/all/test_package/test_package.c b/recipes/ceres-solver/all/test_package/test_package.c new file mode 100644 index 0000000000000..c25d8f94f1975 --- /dev/null +++ b/recipes/ceres-solver/all/test_package/test_package.c @@ -0,0 +1,188 @@ +/* Ceres Solver - A fast non-linear least squares minimizer + * Copyright 2015 Google Inc. All rights reserved. + * http://ceres-solver.org/ + * + * 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. + * - Neither the name of Google Inc. nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED 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. + * + * Author: mierle@gmail.com (Keir Mierle) + * + * This is a port of curve_fitting.cc to the minimal C API for Ceres. + */ + +#include "ceres/c_api.h" + +#include +#include +#include // For NULL + +/* Data generated using the following octave code. + * + * randn('seed', 23497); + * m = 0.3; + * c = 0.1; + * x=[0:0.075:5]; + * y = exp(m * x + c); + * noise = randn(size(x)) * 0.2; + * y_observed = y + noise; + * data = [x', y_observed']; + * + */ + +int num_observations = 67; +double data[] = { + 0.000000e+00, 1.133898e+00, + 7.500000e-02, 1.334902e+00, + 1.500000e-01, 1.213546e+00, + 2.250000e-01, 1.252016e+00, + 3.000000e-01, 1.392265e+00, + 3.750000e-01, 1.314458e+00, + 4.500000e-01, 1.472541e+00, + 5.250000e-01, 1.536218e+00, + 6.000000e-01, 1.355679e+00, + 6.750000e-01, 1.463566e+00, + 7.500000e-01, 1.490201e+00, + 8.250000e-01, 1.658699e+00, + 9.000000e-01, 1.067574e+00, + 9.750000e-01, 1.464629e+00, + 1.050000e+00, 1.402653e+00, + 1.125000e+00, 1.713141e+00, + 1.200000e+00, 1.527021e+00, + 1.275000e+00, 1.702632e+00, + 1.350000e+00, 1.423899e+00, + 1.425000e+00, 1.543078e+00, + 1.500000e+00, 1.664015e+00, + 1.575000e+00, 1.732484e+00, + 1.650000e+00, 1.543296e+00, + 1.725000e+00, 1.959523e+00, + 1.800000e+00, 1.685132e+00, + 1.875000e+00, 1.951791e+00, + 1.950000e+00, 2.095346e+00, + 2.025000e+00, 2.361460e+00, + 2.100000e+00, 2.169119e+00, + 2.175000e+00, 2.061745e+00, + 2.250000e+00, 2.178641e+00, + 2.325000e+00, 2.104346e+00, + 2.400000e+00, 2.584470e+00, + 2.475000e+00, 1.914158e+00, + 2.550000e+00, 2.368375e+00, + 2.625000e+00, 2.686125e+00, + 2.700000e+00, 2.712395e+00, + 2.775000e+00, 2.499511e+00, + 2.850000e+00, 2.558897e+00, + 2.925000e+00, 2.309154e+00, + 3.000000e+00, 2.869503e+00, + 3.075000e+00, 3.116645e+00, + 3.150000e+00, 3.094907e+00, + 3.225000e+00, 2.471759e+00, + 3.300000e+00, 3.017131e+00, + 3.375000e+00, 3.232381e+00, + 3.450000e+00, 2.944596e+00, + 3.525000e+00, 3.385343e+00, + 3.600000e+00, 3.199826e+00, + 3.675000e+00, 3.423039e+00, + 3.750000e+00, 3.621552e+00, + 3.825000e+00, 3.559255e+00, + 3.900000e+00, 3.530713e+00, + 3.975000e+00, 3.561766e+00, + 4.050000e+00, 3.544574e+00, + 4.125000e+00, 3.867945e+00, + 4.200000e+00, 4.049776e+00, + 4.275000e+00, 3.885601e+00, + 4.350000e+00, 4.110505e+00, + 4.425000e+00, 4.345320e+00, + 4.500000e+00, 4.161241e+00, + 4.575000e+00, 4.363407e+00, + 4.650000e+00, 4.161576e+00, + 4.725000e+00, 4.619728e+00, + 4.800000e+00, 4.737410e+00, + 4.875000e+00, 4.727863e+00, + 4.950000e+00, 4.669206e+00, +}; + +/* This is the equivalent of a use-defined CostFunction in the C++ Ceres API. + * This is passed as a callback to the Ceres C API, which internally converts + * the callback into a CostFunction. */ +int exponential_residual(void* user_data, + double** parameters, + double* residuals, + double** jacobians) { + double* measurement = (double*) user_data; + double x = measurement[0]; + double y = measurement[1]; + double m = parameters[0][0]; + double c = parameters[1][0]; + + residuals[0] = y - exp(m * x + c); + if (jacobians == NULL) { + return 1; + } + if (jacobians[0] != NULL) { + jacobians[0][0] = - x * exp(m * x + c); /* dr/dm */ + } + if (jacobians[1] != NULL) { + jacobians[1][0] = - exp(m * x + c); /* dr/dc */ + } + return 1; +} + +int main(int argc, char** argv) { + /* Note: Typically it is better to compact m and c into one block, + * but in this case use separate blocks to illustrate the use of + * multiple parameter blocks. */ + double m = 0.0; + double c = 0.0; + + double *parameter_pointers[] = { &m, &c }; + int parameter_sizes[] = { 1, 1 }; + int i; + + ceres_problem_t* problem; + + /* Ceres has some internal stuff that needs to get initialized. */ + ceres_init(); + + problem = ceres_create_problem(); + + /* Add all the residuals. */ + for (i = 0; i < num_observations; ++i) { + ceres_problem_add_residual_block( + problem, + exponential_residual, /* Cost function */ + &data[2 * i], /* Points to the (x,y) measurement */ + NULL, /* No loss function */ + NULL, /* No loss function user data */ + 1, /* Number of residuals */ + 2, /* Number of parameter blocks */ + parameter_sizes, + parameter_pointers); + } + + ceres_solve(problem); + ceres_free_problem(problem); + + printf("Initial m: 0.0, c: 0.0\n"); + printf("Final m: %g, c: %g\n", m, c); + return 0; +} diff --git a/recipes/ceres-solver/all/test_v1_package/CMakeLists.txt b/recipes/ceres-solver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ceres-solver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ceres-solver/all/test_v1_package/conanfile.py b/recipes/ceres-solver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ceres-solver/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/ceres-solver/config.yml b/recipes/ceres-solver/config.yml new file mode 100644 index 0000000000000..95ff77359ef24 --- /dev/null +++ b/recipes/ceres-solver/config.yml @@ -0,0 +1,7 @@ +versions: + "2.1.0": + folder: all + "2.0.0": + folder: all + "1.14.0": + folder: all diff --git a/recipes/cern-root/all/conandata.yml b/recipes/cern-root/all/conandata.yml new file mode 100644 index 0000000000000..ea1780c15b67b --- /dev/null +++ b/recipes/cern-root/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "v6-22-06": + url: "https://github.com/root-project/root/archive/v6-22-06.zip" + sha256: "125e056f315fb280b13e154d4b73d3b302ac1f5775062e89681edb86c1447a62" +patches: + "v6-22-06": + - patch_file: "patches/0001-add-missing-includes.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-cmake-missing-link-libraries.patch" + base_path: "source_subfolder" diff --git a/recipes/cern-root/all/conanfile.py b/recipes/cern-root/all/conanfile.py new file mode 100644 index 0000000000000..be3871ebefe4c --- /dev/null +++ b/recipes/cern-root/all/conanfile.py @@ -0,0 +1,332 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import glob +import os +import shutil +import stat +import textwrap + + +class PythonOption: + OFF = "off" + SYSTEM = "system" + # in future we may allow the user to specify a version when + # libPython is available in Conan Center Index. + # FIXME: add option to use CCI Python package when it is available + ALL = [OFF, SYSTEM] + + +required_conan_version = ">=1.33.0" + + +class CernRootConan(ConanFile): + name = "cern-root" + # version format is intentional, ROOT does not follow strict SemVer. + # see: https://root.cern/about/versioning/ + license = "LGPL-2.1-or-later" # of ROOT itself, the recipe is under MIT license. + homepage = "https://root.cern/" + # ROOT itself is located at: https://github.com/root-project/root + url = "https://github.com/conan-io/conan-center-index" + description = "CERN ROOT data analysis framework." + topics = ("data-analysis", "physics") + settings = ("os", "compiler", "build_type", "arch") + options = { + # Don't allow static build as it is not supported + # see: https://sft.its.cern.ch/jira/browse/ROOT-6446 + # FIXME: shared option should be reinstated when hooks issue is resolved + # (see: https://github.com/conan-io/hooks/issues/252) + # "shared": [True], + "fPIC": [True, False], + "python": PythonOption.ALL, + } + default_options = { + # "shared": True, + "fPIC": True, + # default python=off as there is currently no libpython in Conan center + "python": PythonOption.OFF, + } + + exports_sources = "patches/*" + 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 _minimum_cpp_standard(self): + return 11 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16.1", + "gcc": "4.8", + "clang": "3.4", + "apple-clang": "5.1", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def requirements(self): + self.requires("cfitsio/4.0.0") + self.requires("fftw/3.3.9") + self.requires("giflib/5.2.1") + self.requires("glew/2.2.0") + self.requires("glu/system") + self.requires("libcurl/7.78.0") + self.requires("libjpeg/9d") + self.requires("libpng/1.6.37") + self.requires("libxml2/2.9.12") + self.requires("lz4/1.9.3") + self.requires("opengl/system") + self.requires("openssl/1.1.1l") + self.requires("pcre/8.44") + self.requires("sqlite3/3.36.0") + self.requires("tbb/2020.3") + self.requires("xorg/system") + self.requires("xxhash/0.8.0") + self.requires("xz_utils/5.2.5") + self.requires("zstd/1.5.0") + + def validate(self): + self._enforce_minimum_compiler_version() + self._enforce_libcxx_requirements() + + def _enforce_minimum_compiler_version(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, + ) + ) + + def _enforce_libcxx_requirements(self): + compiler = self.settings.compiler + libcxx = compiler.get_safe("libcxx") + # ROOT doesn't currently build with libc++. + # This restriction may be lifted in future if the problems are fixed upstream + if libcxx and libcxx == "libc++": + raise ConanInvalidConfiguration( + '{} is incompatible with libc++".'.format(self.name) + ) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_source_cmake(self): + try: + os.remove(os.path.join(self._source_subfolder, "cmake", "modules", "FindTBB.cmake")) + except OSError: + pass + # Conan generated cmake_find_packages names differ from + # names ROOT expects (usually only due to case differences) + # There is currently no way to change these names + # see: https://github.com/conan-io/conan/issues/4430 + # Patch ROOT CMake to use Conan dependencies + tools.replace_in_file( + os.path.join(self.source_folder, self._source_subfolder, "CMakeLists.txt"), + "project(ROOT)", + textwrap.dedent("""\ + project(ROOT) + # sets the current C runtime on MSVC (MT vs MD vd MTd vs MDd) + include("{install_folder}/conanbuildinfo.cmake") + conan_basic_setup(NO_OUTPUT_DIRS) + find_package(OpenSSL REQUIRED) + set(OPENSSL_VERSION ${{OpenSSL_VERSION}}) + find_package(LibXml2 REQUIRED) + set(LIBXML2_INCLUDE_DIR ${{LibXml2_INCLUDE_DIR}}) + set(LIBXML2_LIBRARIES ${{LibXml2_LIBRARIES}}) + find_package(SQLite3 REQUIRED) + set(SQLITE_INCLUDE_DIR ${{SQLITE3_INCLUDE_DIRS}}) + set(SQLITE_LIBRARIES SQLite::SQLite3) + """).format(install_folder=self.install_folder.replace("\\", "/")) + ) + tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "CMakeLists.txt"), + "set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)", + "list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)") + + def _fix_source_permissions(self): + # Fix execute permissions on scripts + scripts = [ + filename + for pattern in ( + os.path.join("**", "configure"), + os.path.join("**", "*.sh"), + os.path.join("**", "*.csh"), + os.path.join("**", "*.bat"), + ) + for filename in glob.glob(os.path.join(self.source_folder, pattern), recursive=True) + ] + for s in scripts: + self._make_file_executable(s) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + self._patch_source_cmake() + self._fix_source_permissions() + + @staticmethod + def _make_file_executable(filename): + st = os.stat(filename) + os.chmod(filename, st.st_mode | stat.S_IEXEC) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + cmakelibpath = ";".join(self.deps_cpp_info.lib_paths) + cmakeincludepath = ";".join(self.deps_cpp_info.include_paths) + self._cmake.definitions.update({ + "BUILD_SHARED_LIBS": True, + "fail-on-missing": True, + "CMAKE_CXX_STANDARD": self._cmake_cxx_standard, + "gnuinstall": True, + "soversion": True, + # Disable builtins and use Conan deps where available + "builtin_cfitsio": False, + "builtin_davix": False, + "builtin_fftw3": False, + "builtin_freetype": False, + "builtin_glew": False, + "builtin_lz4": False, + "builtin_lzma": False, + "builtin_openssl": False, + "builtin_pcre": False, + "builtin_tbb": False, + "builtin_xxhash": False, + "builtin_zlib": False, + "builtin_zstd": False, + # Enable builtins where there is no Conan package + "builtin_afterimage": True, # FIXME : replace with afterimage CCI package when available + "builtin_gsl": True, # FIXME : replace with gsl CCI package when available + "builtin_gl2ps": True, # FIXME : replace with gl2ps CCI package when available + "builtin_ftgl": True, # FIXME : replace with ftgl CCI package when available + "builtin_vdt": True, # FIXME : replace with vdt CCI package when available + # No Conan packages available for these dependencies yet + "davix": False, # FIXME : switch on if davix CCI package available + "pythia6": False, # FIXME : switch on if pythia6 CCI package available + "pythia8": False, # FIXME : switch on if pythia8 CCI package available + "mysql": False, # FIXME : switch on if mysql CCI package available + "oracle": False, + "pgsql": False, # FIXME: switch on if PostgreSQL CCI package available + "gfal": False, # FIXME: switch on if gfal CCI package available + "tmva-pymva": False, # FIXME: switch on if Python CCI package available + "xrootd": False, # FIXME: switch on if xrootd CCI package available + "pyroot": self._cmake_pyrootopt, + # clad is built with ExternalProject_Add and its + # COMPILE_DEFINITIONS property is not propagated causing the build to + # fail on some systems if libcxx != libstdc++11 + "clad": False, + # Tell CMake where to look for Conan provided depedencies + "CMAKE_LIBRARY_PATH": cmakelibpath.replace("\\", "/"), + "CMAKE_INCLUDE_PATH": cmakeincludepath.replace("\\", "/"), + # Configure install directories + # Conan CCI hooks restrict the allowed install directory + # names but ROOT is very picky about where build/runtime + # resources get installed. + # Set install prefix to work around these limitations + # Following: https://github.com/conan-io/conan/issues/3695 + "CMAKE_INSTALL_CMAKEDIR": "lib/cmake", + "CMAKE_INSTALL_DATAROOTDIR": "res/share", + "CMAKE_INSTALL_SYSCONFDIR": "res/etc", + # Fix some Conan-ROOT CMake variable naming differences + "PNG_PNG_INCLUDE_DIR": ";".join(self.deps_cpp_info["libpng"].include_paths).replace("\\", "/"), + "LIBLZMA_INCLUDE_DIR": ";".join(self.deps_cpp_info["xz_utils"].include_paths).replace("\\", "/"), + }) + self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) + return self._cmake + + def _move_findcmake_conan_to_root_dir(self): + for f in ["opengl_system", "GLEW", "glu", "TBB", "LibXml2", "ZLIB", "SQLite3"]: + shutil.copy( + "Find{}.cmake".format(f), + os.path.join( + self.source_folder, self._source_subfolder, "cmake", "modules" + ), + ) + + @property + def _cmake_cxx_standard(self): + return str(self.settings.compiler.get_safe("cppstd", "11")) + + @property + def _cmake_pyrootopt(self): + if self.options.python == PythonOption.OFF: + return False + else: + return True + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + # Fix for CMAKE-MODULES-CONFIG-FILES (KB-H016) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib", "cmake"), "*Config*.cmake") + tools.rmdir(os.path.join(self.package_folder, "res", "README")) + tools.rmdir(os.path.join(self.package_folder, "res", "share", "man")) + tools.rmdir(os.path.join(self.package_folder, "res", "share", "doc")) + tools.rmdir(os.path.join(self.package_folder, "res", "tutorials")) + + def package_info(self): + # FIXME: ROOT generates multiple CMake files + self.cpp_info.names["cmake_find_package"] = "ROOT" + self.cpp_info.names["cmake_find_package_multi"] = "ROOT" + # See root-config --libs for a list of ordered libs + self.cpp_info.libs = [ + "Core", + "Imt", + "RIO", + "Net", + "Hist", + "Graf", + "Graf3d", + "Gpad", + "ROOTVecOps", + "Tree", + "TreePlayer", + "Rint", + "Postscript", + "Matrix", + "Physics", + "MathCore", + "Thread", + "MultiProc", + "ROOTDataFrame", + ] + self.cpp_info.builddirs = [os.path.join("lib", "cmake")] + self.cpp_info.build_modules.extend( + [ + os.path.join("lib", "cmake", "RootMacros.cmake"), + # os.path.join("lib", "cmake", "ROOTUseFile.cmake"), + ] + ) + self.cpp_info.resdirs = ["res"] diff --git a/recipes/cern-root/all/patches/0001-add-missing-includes.patch b/recipes/cern-root/all/patches/0001-add-missing-includes.patch new file mode 100644 index 0000000000000..ce959e107ffeb --- /dev/null +++ b/recipes/cern-root/all/patches/0001-add-missing-includes.patch @@ -0,0 +1,11 @@ +--- core/foundation/inc/ROOT/libcpp_string_view.h ++++ core/foundation/inc/ROOT/libcpp_string_view.h +@@ -10,7 +10,7 @@ + + #ifndef _LIBCPP_LFTS_STRING_VIEW + #define _LIBCPP_LFTS_STRING_VIEW +- ++#include + #ifndef RWrap_libcpp_string_view_h + #error "Do not use libcpp_string_view.h directly. #include \"RWrap_libcpp_string_view.h\" instead." + #endif // RWrap_libcpp_string_view_h diff --git a/recipes/cern-root/all/patches/0002-cmake-missing-link-libraries.patch b/recipes/cern-root/all/patches/0002-cmake-missing-link-libraries.patch new file mode 100644 index 0000000000000..a979ced9370fa --- /dev/null +++ b/recipes/cern-root/all/patches/0002-cmake-missing-link-libraries.patch @@ -0,0 +1,9 @@ +--- interpreter/llvm/src/lib/Support/CMakeLists.txt ++++ interpreter/llvm/src/lib/Support/CMakeLists.txt +@@ -148,5 +148,5 @@ + ${Backtrace_INCLUDE_DIRS} + LINK_LIBS ${system_libs} + ) +- ++target_link_libraries(LLVMSupport PRIVATE ZLIB::ZLIB) + set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}") diff --git a/recipes/cern-root/all/test_package/CMakeLists.txt b/recipes/cern-root/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d6093677e3757 --- /dev/null +++ b/recipes/cern-root/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.13) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS NO_OUTPUT_DIRS) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY bin) + +find_package(ROOT REQUIRED) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +root_generate_dictionary(G__Event Event.hpp OPTIONS -inlineInputHeader LINKDEF EventLinkDef.h ) + +add_library(Event SHARED Event.cpp G__Event.cxx) +target_link_libraries(Event PRIVATE ROOT::ROOT) + +add_executable(testrootdictionaries testrootdictionaries.cpp) +target_link_libraries(testrootdictionaries PRIVATE Event ROOT::ROOT) diff --git a/recipes/cern-root/all/test_package/Event.cpp b/recipes/cern-root/all/test_package/Event.cpp new file mode 100644 index 0000000000000..4d53e76245d75 --- /dev/null +++ b/recipes/cern-root/all/test_package/Event.cpp @@ -0,0 +1,18 @@ +#include "Event.hpp" + +Event::Event() {} +Event::~Event() {} + +Particle::Particle() {} + +Particle::Particle(int _id, TLorentzVector _p4) : id(_id), p4(_p4) {} + +Particle::~Particle() {} + +int Particle::getID() { return id; } + +void Particle::setID(int _id) { id = _id; } + +TLorentzVector Particle::getP4() { return p4; } + +void Particle::setP4(TLorentzVector _p4) { p4 = _p4; } diff --git a/recipes/cern-root/all/test_package/Event.hpp b/recipes/cern-root/all/test_package/Event.hpp new file mode 100644 index 0000000000000..bcb5fa69f9a0a --- /dev/null +++ b/recipes/cern-root/all/test_package/Event.hpp @@ -0,0 +1,29 @@ +#ifndef TEST_PACKAGE_EVENT_HPP +#define TEST_PACKAGE_EVENT_HPP + +#include "TLorentzVector.h" + +class Particle { + public: + Particle(); + Particle(int _id, TLorentzVector _p4); + ~Particle(); + + int getID(); + void setID(int); + + TLorentzVector getP4(); + void setP4(TLorentzVector); + private: + int id; + TLorentzVector p4; +}; + +class Event { + public: + Event(); + ~Event(); + std::vector particles; +}; + +#endif diff --git a/recipes/cern-root/all/test_package/EventLinkDef.h b/recipes/cern-root/all/test_package/EventLinkDef.h new file mode 100644 index 0000000000000..9346904829603 --- /dev/null +++ b/recipes/cern-root/all/test_package/EventLinkDef.h @@ -0,0 +1,7 @@ +#include "Event.hpp" + +#ifdef __CLING__ +#pragma link C++ class Event+; +#pragma link C++ class Particle+; +#pragma link C++ class std::vector+; +#endif diff --git a/recipes/cern-root/all/test_package/conanfile.py b/recipes/cern-root/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9fcab707edbee --- /dev/null +++ b/recipes/cern-root/all/test_package/conanfile.py @@ -0,0 +1,46 @@ +from conans import CMake, ConanFile, RunEnvironment, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def configure(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + + @property + def _minimum_cpp_standard(self): + return 11 + + def build(self): + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self) + cmake.configure( + defs={ + "CMAKE_CXX_STANDARD": self._cmake_cxx_standard, + } + ) + cmake.build() + + @property + def _cmake_cxx_standard(self): + compileropt = self.settings.compiler.get_safe("cppstd") + if compileropt: + return str(compileropt) + else: + return "11" + + def test(self): + if not tools.cross_building(self): + self._check_binaries_are_found() + self._check_root_dictionaries() + + def _check_binaries_are_found(self): + self.run("root -q", run_environment=True) + + def _check_root_dictionaries(self): + bin_path = os.path.join("bin", "testrootdictionaries") + self.run(bin_path, run_environment=True) diff --git a/recipes/cern-root/all/test_package/testrootdictionaries.cpp b/recipes/cern-root/all/test_package/testrootdictionaries.cpp new file mode 100644 index 0000000000000..ef52e64f2d077 --- /dev/null +++ b/recipes/cern-root/all/test_package/testrootdictionaries.cpp @@ -0,0 +1,63 @@ +#include +#include +#include "TFile.h" +#include "TTree.h" +#include "TTreeReader.h" +#include "Event.hpp" + + +void check(bool result, std::string message) { + if (!result) { throw std::runtime_error("ERROR : testrootdictionaries failed : " + message); } +} + + +void create_test_file(std::string name, const int Nevent, const int Npart) { + auto tfile = TFile::Open(name.c_str(), "RECREATE"); + auto tree = new TTree("tree", "tree"); + Event* event = 0; + tree->Branch("events", "Event", &event, 32000, 99); + for(int eventnum = 0; eventnum < Nevent; ++eventnum) { + event = new Event(); + for (int id = 0; id < Npart; ++id) { + event->particles.push_back(Particle(id, {1.0, 2.0, 3.0, 4.0})); + } + tree->Fill(); + delete event; + event = 0; + } + tree->Write(); + tfile->Close(); + delete tfile; +} + + +void read_test_file(std::string name, const int Nevent, const int Npart) { + auto tfile = TFile::Open(name.c_str(), "READ"); + auto tree = tfile->Get("tree"); + Event* event = 0; + tree->SetBranchAddress("events", &event); + check (tree->GetEntries() == Nevent, "event count mismatch"); + for(int eventnum = 0; eventnum < Nevent; ++eventnum) { + check(tree->GetEntry(eventnum)>0, "read zero event size"); + check(event->particles.size() == Npart, "read no particles"); + for(int index = 0; index < Npart; ++index) { + auto& p = event->particles.at(index); + check(p.getID() == index, "read bad index"); + check(p.getP4().X() == 1.0, "read bad 4-vector"); + } + } +} + + +int main() { + std::cout << "--- testrootdictionaries " << std::endl; + const std::string fname = "testevents.root"; + const int Nevent = 3; + const int Npart = 3; + create_test_file(fname, Nevent, Npart); + read_test_file(fname, Nevent, Npart); + std::cout << "--- testrootdictionaries... ok." << std::endl; + return 0; +} + + diff --git a/recipes/cern-root/config.yml b/recipes/cern-root/config.yml new file mode 100644 index 0000000000000..3c99ceb0349d4 --- /dev/null +++ b/recipes/cern-root/config.yml @@ -0,0 +1,3 @@ +versions: + "v6-22-06": + folder: all diff --git a/recipes/certify/all/conandata.yml b/recipes/certify/all/conandata.yml new file mode 100644 index 0000000000000..6772243589218 --- /dev/null +++ b/recipes/certify/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20201114": + url: "https://github.com/djarek/certify/archive/a1bd27f2e86ba73d6a64f289f030ec65250edceb.zip" + sha256: f9606583c29bea5537427e5c37a8c67874e64bea7e49b30c03b80b0ac60f66e4 diff --git a/recipes/certify/all/conanfile.py b/recipes/certify/all/conanfile.py new file mode 100644 index 0000000000000..86be0e74f0cf1 --- /dev/null +++ b/recipes/certify/all/conanfile.py @@ -0,0 +1,76 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class CertifyConan(ConanFile): + name = "certify" + description = "Platform-specific TLS keystore abstraction for use with Boost.ASIO and OpenSSL" + topics = ("boost", "asio", "tls", "ssl", "https") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/djarek/certify" + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "clang": "7", + "apple-clang": "11", + } + + @property + def _min_cppstd(self): + return "17" + + def requirements(self): + self.requires("boost/1.79.0") + self.requires("openssl/1.1.1q") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._min_cppstd) + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE_1_0.txt", dst="licenses", + src=self._source_subfolder) + self.copy(pattern="*", dst="include", + src=os.path.join(self._source_subfolder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "certify") + self.cpp_info.set_property("cmake_target_name", "certify::core") + self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] + + self.cpp_info.components["_certify"].names["cmake_find_package"] = "core" + self.cpp_info.components["_certify"].names["cmake_find_package_multi"] = "core" + self.cpp_info.names["cmake_find_package"] = "certify" + self.cpp_info.names["cmake_find_package_multi"] = "certify" diff --git a/recipes/certify/all/test_package/CMakeLists.txt b/recipes/certify/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..37373018e655a --- /dev/null +++ b/recipes/certify/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(certify REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE certify::core) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/certify/all/test_package/conanfile.py b/recipes/certify/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/certify/all/test_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/certify/all/test_package/test_package.cpp b/recipes/certify/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..28f4c97339bb8 --- /dev/null +++ b/recipes/certify/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#include + +int main() { + boost::asio::io_context ioc{1}; + boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; + boost::asio::ssl::stream stream(ioc, context); + constexpr auto hostname = "example.com"; + + BOOST_TEST(boost::certify::sni_hostname(stream).empty()); + boost::certify::sni_hostname(stream, hostname); + BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); + std::cout << boost::report_errors(); + + return 0; +} diff --git a/recipes/certify/config.yml b/recipes/certify/config.yml new file mode 100644 index 0000000000000..220885d7229f9 --- /dev/null +++ b/recipes/certify/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201114": + folder: "all" diff --git a/recipes/cfgfile/all/conandata.yml b/recipes/cfgfile/all/conandata.yml new file mode 100644 index 0000000000000..16ce1e88dfbb6 --- /dev/null +++ b/recipes/cfgfile/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.2.11": + url: "https://github.com/igormironchik/cfgfile/archive/refs/tags/0.2.11.tar.gz" + sha256: "fdf76baf157f86acc048fdcaa7e3ed534817026710866265706978a76a8e8238" + "0.2.10": + url: "https://github.com/igormironchik/cfgfile/archive/refs/tags/0.2.10.tar.gz" + sha256: "bfab4deb8c9d71872a62a4f2a06056b56c93faf70b36ebb3bab5f207c8fe2c3f" + "0.2.9.1": + url: "https://github.com/igormironchik/cfgfile/archive/refs/tags/0.2.9.1.tar.gz" + sha256: "b5c8aa2ab148404325e817dc059dd6af81e96d7d831f137c93fe9dd79bbe3c7b" + "0.2.9.0": + url: "https://github.com/igormironchik/cfgfile/archive/refs/tags/0.2.9.0.tar.gz" + sha256: "4f42899849e87779089aab1db519ad7977c65cc40315c15515d7e29b0a3088c8" + "0.2.8.2.1": + url: "https://github.com/igormironchik/cfgfile/releases/download/0.2.8.2.1/cfgfile-0.2.8.2.1-full.tar.gz" + sha256: "6b0fe28323904ceb4567c5f3d450ab6eec6cca5eebad7ad0b77b1967f9e2772d" diff --git a/recipes/cfgfile/all/conanfile.py b/recipes/cfgfile/all/conanfile.py new file mode 100644 index 0000000000000..84a0a1cacbb3d --- /dev/null +++ b/recipes/cfgfile/all/conanfile.py @@ -0,0 +1,92 @@ +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, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class CfgfileConan(ConanFile): + name = "cfgfile" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/igormironchik/cfgfile.git" + license = "MIT" + description = "Header-only library for reading/saving configuration files with schema defined in sources." + topics = ("configuration", "file") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "3.5", + "apple-clang": "10", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.version == "0.2.9.1" or Version(self.version) >= "0.2.10": + self.requires("args-parser/6.2.0.1") + elif self.version == "0.2.9.0": + self.requires("args-parser/6.0.1.0") + + def package_id(self): + del self.info.settings.compiler + + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.19 <4]") + + 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.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables["BUILD_TESTS"] = False + if Version(self.version) >= "0.2.9": + tc.variables["USE_INTERNAL_ARGS_PARSER"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_folder) + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cfgfile") + self.cpp_info.set_property("cmake_target_name", "cfgfile::cfgfile") + self.cpp_info.includedirs.append(os.path.join("include", "cfgfile")) + + # TODO: to remove once conan v1 support dropped + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cfgfile/all/test_package/CMakeLists.txt b/recipes/cfgfile/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..678ffe7224c31 --- /dev/null +++ b/recipes/cfgfile/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cfgfile REQUIRED CONFIG) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cfg.hpp" + COMMAND cfgfile.generator -i "${CMAKE_CURRENT_SOURCE_DIR}/session_cfg.conf" -o "${CMAKE_CURRENT_BINARY_DIR}/cfg.hpp" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/session_cfg.conf" +) + +add_executable(${PROJECT_NAME} test_package.cpp "${CMAKE_CURRENT_BINARY_DIR}/cfg.hpp") +target_link_libraries(${PROJECT_NAME} PRIVATE cfgfile::cfgfile) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/recipes/cfgfile/all/test_package/conanfile.py b/recipes/cfgfile/all/test_package/conanfile.py new file mode 100644 index 0000000000000..edcafc68a3a25 --- /dev/null +++ b/recipes/cfgfile/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +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_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + if not cross_building(self, skip_x64_x86=True): + 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") + cfg_path = os.path.join(self.source_folder, "test.cfg") + self.run("{} \"{}\"".format(bin_path, cfg_path), env="conanrun") + diff --git a/recipes/cfgfile/all/test_package/session_cfg.conf b/recipes/cfgfile/all/test_package/session_cfg.conf new file mode 100644 index 0000000000000..bb573d645884f --- /dev/null +++ b/recipes/cfgfile/all/test_package/session_cfg.conf @@ -0,0 +1,19 @@ + +{forGeneration SESSION_CFG_HPP + + {namespace Cfg + + |# + Session. + #| + {class Session + {tagScalar + {valueType std::string} + {name project} + {required} + } + } + + } || namespace Cfg + +} diff --git a/recipes/cfgfile/all/test_package/test.cfg b/recipes/cfgfile/all/test_package/test.cfg new file mode 100644 index 0000000000000..695b398b2d314 --- /dev/null +++ b/recipes/cfgfile/all/test_package/test.cfg @@ -0,0 +1,3 @@ +{Session + {project 123} +} diff --git a/recipes/cfgfile/all/test_package/test_package.cpp b/recipes/cfgfile/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c81d9439b69a7 --- /dev/null +++ b/recipes/cfgfile/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +#include +#include + +#include + +#include + +int main(int argc, char ** argv) +{ + if (argc < 2) { + std::cerr << "Need an argument\n"; + return 1; + } + + Cfg::Session cfg; + + std::ifstream stream( argv[1] ); + + try { + Cfg::tag_Session< cfgfile::string_trait_t > s; + + cfgfile::read_cfgfile( s, stream, "test.cfg" ); + + stream.close(); + + cfg = s.get_cfg(); + } + catch( const cfgfile::exception_t<> & x ) + { + stream.close(); + + std::cout << x.desc() << std::endl; + + return 1; + } + + if( cfg.project() == "123" ) + return 0; + else + return 1; +} diff --git a/recipes/cfgfile/all/test_v1_package/CMakeLists.txt b/recipes/cfgfile/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8af52c8273805 --- /dev/null +++ b/recipes/cfgfile/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,6 @@ +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/cfgfile/all/test_v1_package/conanfile.py b/recipes/cfgfile/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..54b7d470785a9 --- /dev/null +++ b/recipes/cfgfile/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +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): + if not tools.cross_building(self, skip_x64_x86=True): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.build_requires(str(self.requires["cfgfile"])) + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + cfg_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.cfg") + self.run("{} \"{}\"".format(bin_path, cfg_path), run_environment=True) diff --git a/recipes/cfgfile/config.yml b/recipes/cfgfile/config.yml new file mode 100644 index 0000000000000..5f9aabdfbd6d9 --- /dev/null +++ b/recipes/cfgfile/config.yml @@ -0,0 +1,11 @@ +versions: + "0.2.11": + folder: all + "0.2.10": + folder: all + "0.2.9.1": + folder: all + "0.2.9.0": + folder: all + "0.2.8.2.1": + folder: all diff --git a/recipes/cfitsio/all/conandata.yml b/recipes/cfitsio/all/conandata.yml new file mode 100644 index 0000000000000..4b0ca8e449091 --- /dev/null +++ b/recipes/cfitsio/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "4.2.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.2.0.tar.gz" + sha256: "ef9881973ecb9fe55732a4c1bb5ca96e63b624728f6319556939e0fe25f495e8" + "4.1.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.1.0.tar.gz" + sha256: "748994dd1c819b88567e3539ea1f0ec2dd39fc0ed2884c033afa3da66efb5f4e" + "4.0.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.0.0.tar.gz" + sha256: "88735b69bb017ee92823b9e7ee14efeae2e57fb6c00503ed3aa2820e850a7b5e" + "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.2.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.2.0.patch" + "4.1.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.1.0.patch" + "4.0.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.0.0.patch" + "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 new file mode 100644 index 0000000000000..b5849b0ae2946 --- /dev/null +++ b/recipes/cfitsio/all/conanfile.py @@ -0,0 +1,121 @@ +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" + + +class CfitsioConan(ConanFile): + name = "cfitsio" + description = "C library for reading and writing data files in FITS " \ + "(Flexible Image Transport System) data format" + license = "ISC" + topics = ("fits", "image", "nasa", "astronomy", "astrophysics", "space") + homepage = "https://heasarc.gsfc.nasa.gov/fitsio/" + 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], + "threadsafe": [True, False], + "simd_intrinsics": [None, "sse2", "ssse3"], + "with_bzip2": [True, False], + "with_curl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": False, + "simd_intrinsics": None, + "with_bzip2": False, + "with_curl": False, + } + + 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_curl + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.simd_intrinsics + + 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.13") + if self.options.threadsafe and self.settings.os == "Windows" and \ + self.settings.compiler.get_safe("threads") != "posix": + self.requires("pthreads4w/3.0.0") + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.get_safe("with_curl"): + self.requires("libcurl/8.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_PTHREADS"] = self.options.threadsafe + if Version(self.version) >= "4.1.0": + tc.variables["USE_SSE2"] = self.options.get_safe("simd_intrinsics") == "sse2" + tc.variables["USE_SSSE3"] = self.options.get_safe("simd_intrinsics") == "ssse3" + tc.variables["USE_BZIP2"] = self.options.with_bzip2 + else: + tc.variables["CFITSIO_USE_SSE2"] = self.options.get_safe("simd_intrinsics") == "sse2" + tc.variables["CFITSIO_USE_SSSE3"] = self.options.get_safe("simd_intrinsics") == "ssse3" + tc.variables["CFITSIO_USE_BZIP2"] = self.options.with_bzip2 + if Version(self.version) >= "4.0.0": + tc.variables["USE_CURL"] = self.options.get_safe("with_curl", False) + tc.variables["TESTS"] = False + tc.variables["UTILS"] = False + else: + tc.variables["UseCurl"] = self.options.get_safe("with_curl", False) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) < "4.0.0": + # Remove embedded zlib files + for zlib_file in glob.glob(os.path.join(self.source_folder, "zlib", "*")): + if not zlib_file.endswith(("zcompress.c", "zuncompress.c")): + os.remove(zlib_file) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", f"cfitsio-{self.version}")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cfitsio") + self.cpp_info.set_property("cmake_target_name", "cfitsio::cfitsio") + self.cpp_info.set_property("pkg_config_name", "cfitsio") + self.cpp_info.libs = ["cfitsio"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.options.threadsafe: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch b/recipes/cfitsio/all/patches/fix-cmake-3.470.patch new file mode 100644 index 0000000000000..46df9c1140c70 --- /dev/null +++ b/recipes/cfitsio/all/patches/fix-cmake-3.470.patch @@ -0,0 +1,223 @@ +--- 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/all/patches/fix-cmake-3.490.patch b/recipes/cfitsio/all/patches/fix-cmake-3.490.patch new file mode 100644 index 0000000000000..534d72e453ee6 --- /dev/null +++ b/recipes/cfitsio/all/patches/fix-cmake-3.490.patch @@ -0,0 +1,222 @@ +--- 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) + + # Allow curl dependency to be disabled using "-DUseCurl=OFF": + OPTION(UseCurl "UseCurl" ON) +@@ -58,12 +60,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) +@@ -74,29 +83,27 @@ 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: + IF (UseCurl) + FIND_PACKAGE(CURL) + IF (CURL_FOUND) +- INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) ++ LIST(APPEND LINK_LIBS "CURL::libcurl") + ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) + ENDIF() + ENDIF() +@@ -104,7 +111,7 @@ 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 +@@ -128,30 +135,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}) +-IF (CURL_FOUND) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBRARIES}) +-ENDIF(CURL_FOUND) ++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() + +@@ -181,7 +257,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/all/patches/fix-cmake-4.0.0.patch b/recipes/cfitsio/all/patches/fix-cmake-4.0.0.patch new file mode 100644 index 0000000000000..11bf2a97188e8 --- /dev/null +++ b/recipes/cfitsio/all/patches/fix-cmake-4.0.0.patch @@ -0,0 +1,90 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -71,7 +71,7 @@ ELSE() + SET (LIB_TYPE STATIC) + ENDIF(BUILD_SHARED_LIBS) + +-IF(NOT MSVC) ++IF(NOT WIN32) + # Find curl library, for HTTPS support: + IF(USE_CURL) + FIND_PACKAGE(CURL) +@@ -79,11 +79,12 @@ IF(NOT MSVC) + ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) + ENDIF() + ENDIF() +-ENDIF(NOT MSVC) ++ENDIF() + + IF(USE_PTHREADS) ++ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) ++ SET(THREADS_PREFER_PTHREAD_FLAG TRUE) + FIND_PACKAGE(Threads REQUIRED) +- ADD_DEFINITIONS(-D_REENTRANT) + ENDIF(USE_PTHREADS) + + IF(CFITSIO_USE_BZIP2) +@@ -99,19 +100,13 @@ 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) +@@ -256,26 +251,27 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) + TARGET_LINK_LIBRARIES(${LIB_NAME} ${M_LIB}) + # zlib: + IF (ZLIB_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${ZLIB_INCLUDE_DIR}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${ZLIB_LIBRARIES}) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} ZLIB::ZLIB) + ENDIF(ZLIB_FOUND) + # cURL: +-IF (CURL_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${CURL_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBRARIES}) +-ENDIF(CURL_FOUND) ++IF (USE_CURL) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} CURL::libcurl) ++ENDIF() + # PThreads: +-IF (THREADS_FOUND) ++IF (USE_PTHREADS) ++ IF(CMAKE_USE_PTHREADS_INIT) + TARGET_LINK_LIBRARIES(${LIB_NAME} Threads::Threads) +-ENDIF(THREADS_FOUND) ++ ELSE() ++ find_package(pthreads4w REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} pthreads4w::pthreads4w) ++ ENDIF() ++ENDIF() + # BZip2: +-IF (BZIP2_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${BZIP2_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${BZIP2_LIBRARIES}) +-ENDIF(BZIP2_FOUND) ++IF (CFITSIO_USE_BZIP2) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} BZip2::BZip2) ++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 diff --git a/recipes/cfitsio/all/patches/fix-cmake-4.1.0.patch b/recipes/cfitsio/all/patches/fix-cmake-4.1.0.patch new file mode 100644 index 0000000000000..fdb577f16de6d --- /dev/null +++ b/recipes/cfitsio/all/patches/fix-cmake-4.1.0.patch @@ -0,0 +1,79 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,8 +82,9 @@ IF(NOT WIN32) + ENDIF(NOT WIN32) + + IF(USE_PTHREADS) ++ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) ++ SET(THREADS_PREFER_PTHREAD_FLAG TRUE) + FIND_PACKAGE(Threads REQUIRED) +- ADD_DEFINITIONS(-D_REENTRANT) + ENDIF(USE_PTHREADS) + + IF(USE_BZIP2) +@@ -99,19 +100,13 @@ 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) +@@ -256,28 +251,30 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) + TARGET_LINK_LIBRARIES(${LIB_NAME} ${M_LIB}) + # zlib: + IF (ZLIB_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${ZLIB_INCLUDE_DIR}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${ZLIB_LIBRARIES}) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} ZLIB::ZLIB) + # For cfitsio.pc.cmake: + SET (PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lz") + ENDIF(ZLIB_FOUND) + # cURL: +-IF (CURL_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${CURL_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBRARIES}) ++IF (USE_CURL) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} CURL::libcurl) + # For cfitsio.pc.cmake: + SET (PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lcurl") +-ENDIF(CURL_FOUND) ++ENDIF() + # PThreads: +-IF (THREADS_FOUND) ++IF (USE_PTHREADS) ++ IF(CMAKE_USE_PTHREADS_INIT) + TARGET_LINK_LIBRARIES(${LIB_NAME} Threads::Threads) +-ENDIF(THREADS_FOUND) ++ ELSE() ++ find_package(pthreads4w REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} pthreads4w::pthreads4w) ++ ENDIF() ++ENDIF() + # BZip2: +-IF (BZIP2_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${BZIP2_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${BZIP2_LIBRARIES}) ++IF (USE_BZIP2) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} BZip2::BZip2) + SET (PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lbz2") +-ENDIF(BZIP2_FOUND) ++ENDIF() + + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR}) + include(GNUInstallDirs) diff --git a/recipes/cfitsio/all/patches/fix-cmake-4.2.0.patch b/recipes/cfitsio/all/patches/fix-cmake-4.2.0.patch new file mode 100644 index 0000000000000..c879f08adda8b --- /dev/null +++ b/recipes/cfitsio/all/patches/fix-cmake-4.2.0.patch @@ -0,0 +1,79 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,8 +82,9 @@ IF(NOT WIN32) + ENDIF(NOT WIN32) + + IF(USE_PTHREADS) ++ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) ++ SET(THREADS_PREFER_PTHREAD_FLAG TRUE) + FIND_PACKAGE(Threads REQUIRED) +- ADD_DEFINITIONS(-D_REENTRANT) + ENDIF(USE_PTHREADS) + + IF(USE_BZIP2) +@@ -99,19 +100,13 @@ 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) +@@ -265,28 +260,30 @@ TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC + TARGET_LINK_LIBRARIES(${LIB_NAME} ${M_LIB}) + # zlib: + IF (ZLIB_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${ZLIB_INCLUDE_DIR}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${ZLIB_LIBRARIES}) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} ZLIB::ZLIB) + # For cfitsio.pc.cmake: + SET (PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lz") + ENDIF(ZLIB_FOUND) + # cURL: +-IF (CURL_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${CURL_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBRARIES}) ++IF (USE_CURL) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} CURL::libcurl) + # For cfitsio.pc.cmake: + SET (PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lcurl") +-ENDIF(CURL_FOUND) ++ENDIF() + # PThreads: +-IF (THREADS_FOUND) ++IF (USE_PTHREADS) ++ IF(CMAKE_USE_PTHREADS_INIT) + TARGET_LINK_LIBRARIES(${LIB_NAME} Threads::Threads) +-ENDIF(THREADS_FOUND) ++ ELSE() ++ find_package(pthreads4w REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} pthreads4w::pthreads4w) ++ ENDIF() ++ENDIF() + # BZip2: +-IF (BZIP2_FOUND) +- TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${BZIP2_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${BZIP2_LIBRARIES}) ++IF (USE_BZIP2) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} BZip2::BZip2) + SET (PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lbz2") +-ENDIF(BZIP2_FOUND) ++ENDIF() + + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR}) + diff --git a/recipes/cfitsio/all/patches/windows-use-strtok_s.patch b/recipes/cfitsio/all/patches/windows-use-strtok_s.patch new file mode 100644 index 0000000000000..a78aa6b38c32e --- /dev/null +++ b/recipes/cfitsio/all/patches/windows-use-strtok_s.patch @@ -0,0 +1,14 @@ +--- a/fitsio2.h ++++ b/fitsio2.h +@@ -26,7 +26,11 @@ extern int Fitsio_Pthread_Status; + #define FFUNLOCK1(lockname) (Fitsio_Pthread_Status = pthread_mutex_unlock(&lockname)) + #define FFLOCK FFLOCK1(Fitsio_Lock) + #define FFUNLOCK FFUNLOCK1(Fitsio_Lock) ++#ifdef _WIN32 ++#define ffstrtok(str, tok, save) strtok_s(str, tok, save) ++#else + #define ffstrtok(str, tok, save) strtok_r(str, tok, save) ++#endif + + #else + #define FFLOCK diff --git a/recipes/cfitsio/all/test_package/CMakeLists.txt b/recipes/cfitsio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..15673258662b0 --- /dev/null +++ b/recipes/cfitsio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cfitsio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cfitsio::cfitsio) diff --git a/recipes/cfitsio/all/test_package/conanfile.py b/recipes/cfitsio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7848c0589b0c7 --- /dev/null +++ b/recipes/cfitsio/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + 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") + fits_name = os.path.join(self.source_folder, "file011.fits") + self.run(f"{bin_path} \"{fits_name}\"", env="conanrun") diff --git a/recipes/cfitsio/all/test_package/file011.fits b/recipes/cfitsio/all/test_package/file011.fits new file mode 100644 index 0000000000000000000000000000000000000000..3b7f37eae8269d5f24f8717f5ff0a46467be6b91 GIT binary patch literal 37440 zcmeI4%aR?(bwxpf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O z=l}Jj|2KcUyaSBo#5mL=uhAf<6){b!nV!c|g<`S;A>dCn-gORU=SNSm@hLvL_;amN zpD@`0p9aqU2U`cwPd5K1&<@VC0PDEY8x$L54KmG!k#p}v@il#s>-2$)!7gs_)=o4x zo0ybula~%zxbK6)`G0@Y&tCvNpSSma58{2`7jH@U!K?p;?O_Gefg0#c~Hn?`m~ES5QD^kKJe1{Pg$#v4%bn!@qlS5?G_x9`KH&j@fYY z>{#3Ny2sc-t~;kJ&D-32O?x&gW@Xw9n5leKI#JACKI|(z`nv@dlzzM+f4nJ0F?-J& zfi){WAMyY0tq(4o0J1*X?Cz1g{0v18+%Ngt6Xx1w-_@>km4Ew`nu!g!&JZy+=j%Fz z?jX_k{_PV@>Ow2}QFdqhNx<9i!)1UfZl%X7k?67Bo6VN%OJN`dA(G7QtcomN&ba&5{L{cAPeA6#h zsGNRGuCvzNK{fyT{lvU_z_p*}==JA6Pd{ID0dBlCd~fl z`t`8loA*c_PmSt{%Fg_6eWbek-@4w*`q=S)I{ZED{^f4`eLVr+*MqnAw;g!ffwvua O+kv+oc-w(P2mTMWzLM1d literal 0 HcmV?d00001 diff --git a/recipes/cfitsio/all/test_package/test_package.c b/recipes/cfitsio/all/test_package/test_package.c new file mode 100644 index 0000000000000..03519a40ba8f0 --- /dev/null +++ b/recipes/cfitsio/all/test_package/test_package.c @@ -0,0 +1,29 @@ +/* +Example from https://heasarc.gsfc.nasa.gov/docs/software/fitsio/quick/node4.html +*/ + +#include + +#include +#include + +int main(int argc, char **argv) { + fitsfile *fptr; + char card[FLEN_CARD]; + int status = 0, nkeys, ii; /* MUST initialize status */ + + fits_open_file(&fptr, argv[1], READONLY, &status); + fits_get_hdrspace(fptr, &nkeys, NULL, &status); + + for (ii = 1; ii <= nkeys; ii++) { + fits_read_record(fptr, ii, card, &status); /* read keyword */ + printf("%s\n", card); + } + printf("END\n\n"); /* terminate listing with END */ + fits_close_file(fptr, &status); + + if (status) { /* print any error messages */ + fits_report_error(stderr, status); + } + return(status); +} diff --git a/recipes/cfitsio/all/test_v1_package/CMakeLists.txt b/recipes/cfitsio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cfitsio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cfitsio/all/test_v1_package/conanfile.py b/recipes/cfitsio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6fb307c712d29 --- /dev/null +++ b/recipes/cfitsio/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + fits_name = os.path.join(self.source_folder, os.pardir, "test_package", "file011.fits") + self.run(f"{bin_path} \"{fits_name}\"", run_environment=True) diff --git a/recipes/cfitsio/config.yml b/recipes/cfitsio/config.yml new file mode 100644 index 0000000000000..cfbf4d00aea10 --- /dev/null +++ b/recipes/cfitsio/config.yml @@ -0,0 +1,13 @@ +versions: + "4.2.0": + folder: all + "4.1.0": + folder: all + "4.0.0": + folder: all + "3.490": + folder: all + "3.480": + folder: all + "3.470": + folder: all diff --git a/recipes/cgal/all/CMakeLists.txt b/recipes/cgal/all/CMakeLists.txt new file mode 100644 index 0000000000000..2d804c96d2829 --- /dev/null +++ b/recipes/cgal/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1.4) +project(conan_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/cgal/all/conandata.yml b/recipes/cgal/all/conandata.yml new file mode 100644 index 0000000000000..a9e86a3361343 --- /dev/null +++ b/recipes/cgal/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "5.0.4": + sha256: e82096c03ccb31200f02a5b9bd0a5e9ea07840351987dca55aae99a8d5823f59 + url: https://github.com/CGAL/cgal/releases/download/v5.0.4/CGAL-5.0.4.tar.xz + "5.1.5": + sha256: b1bb8a6053aa12baa5981aef20a542cd3e617a86826963fb8fb6852b1a0da97c + url: https://github.com/CGAL/cgal/releases/download/v5.1.5/CGAL-5.1.5.tar.xz + "5.2.4": + sha256: 7f792c59d067e41a073bcee5d615f4276f9ccd2b5e7d359093cc36149fda14c3 + url: https://github.com/CGAL/cgal/releases/download/v5.2.4/CGAL-5.2.4.tar.xz + "5.3.2": + sha256: af917dbc550388ebcb206f774e610fbdb914d95a4b2932fa952279129103852b + url: https://github.com/CGAL/cgal/releases/download/v5.3.2/CGAL-5.3.2.tar.xz + "5.5": + sha256: 98ac395ca08aacf38b7a8170a822b650aedf10355df41dd0e4bfb238408e08a6 + url: https://github.com/CGAL/cgal/releases/download/v5.5/CGAL-5.5.tar.xz + "5.5.1": + sha256: 091630def028facdcaf00eb5b68ad79eddac1b855cca6e87eef18a031566edfc + url: https://github.com/CGAL/cgal/releases/download/v5.5.1/CGAL-5.5.1.tar.xz diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py new file mode 100644 index 0000000000000..47cc7c6fa95ce --- /dev/null +++ b/recipes/cgal/all/conanfile.py @@ -0,0 +1,76 @@ +import os +from conan import ConanFile +from conan.tools import files +from conan.tools import scm +from conans import CMake + +required_conan_version = ">=1.50.0" + +class CgalConan(ConanFile): + name = "cgal" + license = "GPL-3.0-or-later", "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CGAL/cgal" + description = "C++ library that provides easy access to efficient and reliable algorithms"\ + " in computational geometry." + topics = ("cgal", "geometry", "algorithms") + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + exports_sources = "CMakeLists.txt" + short_paths = True + + _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.definitions["CGAL_HEADER_ONLY"] = "TRUE" + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def _patch_sources(self): + if scm.Version(self.version) < "5.3": + files.replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + "CMAKE_SOURCE_DIR", "CMAKE_CURRENT_SOURCE_DIR") + else: + files.replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + "if(NOT PROJECT_NAME)", "if(TRUE)") + + def requirements(self): + self.requires("boost/1.75.0") + self.requires("eigen/3.3.9") + self.requires("mpfr/4.1.0") + + def package_id(self): + self.info.clear() + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + files.rmdir(self, os.path.join(self.package_folder, "share")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "CGAL" + self.cpp_info.names["cmake_find_package_multi"] = "CGAL" + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.defines.append("CGAL_HEADER_ONLY=1") diff --git a/recipes/cgal/all/test_package/CMakeLists.txt b/recipes/cgal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c5080a4f875bc --- /dev/null +++ b/recipes/cgal/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/cgal/all/test_package/conanfile.py b/recipes/cgal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2b959f9f04238 --- /dev/null +++ b/recipes/cgal/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +import os + +from conan import ConanFile +from conan.tools import build +from conans import CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not build.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cgal/all/test_package/test_package.cpp b/recipes/cgal/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..21e75435caca3 --- /dev/null +++ b/recipes/cgal/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include +#include + +int main() +{ + double pointsIn[][7] = { + { 42.89, 0, 60.55, 30.72, 0, 0, 0 }, + { 45.65, 50.83, 50.37, 16.13, 0, 0, 0 }, + { 79.06, 57.84, 61.59, 2.52, 0, 0, 0 }, + { 44.47, 39.46, 39.53, 28.72, 0, 0, 0 }, + { 0, 100, 0, 0, 100, 0, 53.47 }, + { 66.95, 100, 33.6, 0, 0, 0, 0 }, + { 42.89, 0, 0, 30.72, 100, 0, 53.47 }, + { 100, 100, 100, 100, 100, 100, 100 } + }; + + typedef CGAL::Delaunay_triangulation > > T; + T dt(7); + + std::vector points; + points.reserve(8); + for (int j = 0; j < 8; ++j) { + T::Point p(&pointsIn[j][0], &pointsIn[j][7]); + points.push_back(p); + } + + T::Vertex_handle hint; + int i = 0; + for (std::vector::iterator it = points.begin(); it != points.end(); ++it) { + if (T::Vertex_handle() != hint) { + hint = dt.insert(*it, hint); + } + else { + hint = dt.insert(*it); + } + printf("Processing: %d/%d\n", ++i, (int)points.size()); + } + return 0; +} diff --git a/recipes/cgal/config.yml b/recipes/cgal/config.yml new file mode 100644 index 0000000000000..72209e170658c --- /dev/null +++ b/recipes/cgal/config.yml @@ -0,0 +1,13 @@ +versions: + "5.0.4": + folder: all + "5.1.5": + folder: all + "5.2.4": + folder: all + "5.3.2": + folder: all + "5.5": + folder: all + "5.5.1": + folder: all diff --git a/recipes/cgif/all/conandata.yml b/recipes/cgif/all/conandata.yml new file mode 100644 index 0000000000000..f6abd559f85fb --- /dev/null +++ b/recipes/cgif/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.0": + url: "https://github.com/dloebl/cgif/archive/refs/tags/V0.3.0.tar.gz" + sha256: "c4f70bbae4c6afee3a524e65be31ae495201fd26687cb8429d7aded8be96306a" diff --git a/recipes/cgif/all/conanfile.py b/recipes/cgif/all/conanfile.py new file mode 100644 index 0000000000000..ef47a850d95dc --- /dev/null +++ b/recipes/cgif/all/conanfile.py @@ -0,0 +1,93 @@ +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 copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class CgifConan(ConanFile): + name = "cgif" + description = "GIF encoder written in C" + license = "MIT" + topics = ("gif", "encoder", "image") + homepage = "https://github.com/dloebl/cgif" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared build with Visual Studio") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["tests"] = "false" + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "cgif") + self.cpp_info.libs = ["cgif"] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/cgif/all/test_package/CMakeLists.txt b/recipes/cgif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8bd0525b16741 --- /dev/null +++ b/recipes/cgif/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(cgif REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cgif::cgif) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/cgif/all/test_package/conanfile.py b/recipes/cgif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cgif/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/cgif/all/test_package/test_package.c b/recipes/cgif/all/test_package/test_package.c new file mode 100644 index 0000000000000..98fcceb5d13b6 --- /dev/null +++ b/recipes/cgif/all/test_package/test_package.c @@ -0,0 +1,53 @@ +#include + +#include +#include +#include + +#define WIDTH 1024 +#define HEIGHT 1024 + +static void initGIFConfig(CGIF_Config *pConfig, char *path, uint16_t width, + uint16_t height, uint8_t *pPalette, + uint16_t numColors) +{ + memset(pConfig, 0, sizeof(CGIF_Config)); + pConfig->width = width; + pConfig->height = height; + pConfig->pGlobalPalette = pPalette; + pConfig->numGlobalPaletteEntries = numColors; + pConfig->path = path; +} + +static void initFrameConfig(CGIF_FrameConfig *pConfig, uint8_t *pImageData) +{ + memset(pConfig, 0, sizeof(CGIF_FrameConfig)); + pConfig->pImageData = pImageData; +} + +int main() +{ + CGIF *pGIF; + CGIF_Config gConfig; + CGIF_FrameConfig fConfig; + uint8_t *pImageData; + uint8_t aPalette[] = {0xFF, 0x00, 0x00, + 0x00, 0xFF, 0x00, + 0x00, 0x00, 0xFF}; + uint16_t numColors = 3; + + initGIFConfig(&gConfig, "example_cgif.gif", WIDTH, HEIGHT, aPalette, numColors); + pGIF = cgif_newgif(&gConfig); + + pImageData = malloc(WIDTH * HEIGHT); + for (int i = 0; i < (WIDTH * HEIGHT); ++i) { + pImageData[i] = (unsigned char)((i % WIDTH) / 4 % numColors); + } + + initFrameConfig(&fConfig, pImageData); + cgif_addframe(pGIF, &fConfig); + free(pImageData); + + cgif_close(pGIF); + return 0; +} diff --git a/recipes/cgif/all/test_v1_package/CMakeLists.txt b/recipes/cgif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cgif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cgif/all/test_v1_package/conanfile.py b/recipes/cgif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cgif/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/cgif/config.yml b/recipes/cgif/config.yml new file mode 100644 index 0000000000000..d126790212e0c --- /dev/null +++ b/recipes/cgif/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.0": + folder: all diff --git a/recipes/cglm/all/CMakeLists.txt b/recipes/cglm/all/CMakeLists.txt new file mode 100644 index 0000000000000..3a14ce35d533b --- /dev/null +++ b/recipes/cglm/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory("source_subfolder") diff --git a/recipes/cglm/all/conandata.yml b/recipes/cglm/all/conandata.yml new file mode 100644 index 0000000000000..d63882c55fca8 --- /dev/null +++ b/recipes/cglm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.5": + url: "https://github.com/recp/cglm/archive/refs/tags/v0.8.5.tar.gz" + sha256: "baefa21342d228a83c90708459a745d5aa9b0ebb381555eea42db1f37fdf7a5a" diff --git a/recipes/cglm/all/conanfile.py b/recipes/cglm/all/conanfile.py new file mode 100644 index 0000000000000..023c54a31f51b --- /dev/null +++ b/recipes/cglm/all/conanfile.py @@ -0,0 +1,101 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.29.1" + + +class CglmConan(ConanFile): + name = "cglm" + description = "Highly Optimized Graphics Math (glm) for C " + topics = ("cglm", "graphics", "opengl", "simd", "vector", "glm") + homepage = "https://github.com/recp/cglm" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ("CMakeLists.txt", ) + generators = "cmake" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + } + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.header_only: + del self.settings.arch + del self.settings.build_type + del self.settings.compiler + del self.settings.os + + 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["CGLM_STATIC"] = not self.options.shared + self._cmake.definitions["CGLM_SHARED"] = self.options.shared + self._cmake.definitions["CGLM_USE_TEST"] = False + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + if not self.options.header_only: + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + + if self.options.header_only: + self.copy("*", src=os.path.join(self._source_subfolder, "include"), dst="include") + else: + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cglm") + self.cpp_info.set_property("cmake_target_name", "cglm::cglm") + self.cpp_info.set_property("pkg_config_name", "cglm") + + if not self.options.header_only: + self.cpp_info.libs = ["cglm"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") + + # backward support of cmake_find_package, cmake_find_package_multi & pkg_config generators + self.cpp_info.names["pkg_config"] = "cglm" + self.cpp_info.names["cmake_find_package"] = "cglm" + self.cpp_info.names["cmake_find_package_multi"] = "cglm" diff --git a/recipes/cglm/all/test_package/CMakeLists.txt b/recipes/cglm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..511cf63c2b9e2 --- /dev/null +++ b/recipes/cglm/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cglm REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE cglm::cglm) diff --git a/recipes/cglm/all/test_package/conanfile.py b/recipes/cglm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cglm/all/test_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/cglm/all/test_package/test_package.c b/recipes/cglm/all/test_package/test_package.c new file mode 100644 index 0000000000000..9e263a8afc8ed --- /dev/null +++ b/recipes/cglm/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include +#include + +int main() { + mat4 matrix = { + { 0.20138f, 0.82993f, 0.28319, 0.29518f }, + { 0.99043f, 0.88820f, 0.62279, 0.33396f }, + { 0.48144f, 0.36351f, 0.70723, 0.65915f }, + { 0.64711f, 0.69593f, 0.80561, 0.62619f }, + }; + vec4 vector = { 0.023048f, 0.243715f, 0.125258f, 0.699470 }; + vec4 result; + + float det = glm_mat4_det(matrix); + glm_mat4_mulv(matrix, vector, result); + + printf("determinant is %f\n", det); + printf("result of multiplication is: { %f, %f, %f, %f }\n", result[0], result[1], result[2], result[3]); + + return 0; +} diff --git a/recipes/cglm/config.yml b/recipes/cglm/config.yml new file mode 100644 index 0000000000000..dacc103c54543 --- /dev/null +++ b/recipes/cglm/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.5": + folder: all diff --git a/recipes/cgltf/all/CMakeLists.txt b/recipes/cgltf/all/CMakeLists.txt new file mode 100644 index 0000000000000..083b3a7d15fec --- /dev/null +++ b/recipes/cgltf/all/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.4) +project(cgltf C) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(SRC_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf.c + ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf_write.c +) +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf.h + ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf_write.h +) + +add_library(${PROJECT_NAME} ${SRC_FILES}) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +if(MSVC AND BUILD_SHARED_LIBS) + set_property(TARGET ${PROJECT_NAME} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +include(GNUInstallDirs) +install( + TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/cgltf/all/conandata.yml b/recipes/cgltf/all/conandata.yml new file mode 100644 index 0000000000000..e54cb4331e847 --- /dev/null +++ b/recipes/cgltf/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "1.13": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.13.tar.gz" + sha256: "053d5320097334767486c6e33d01dd1b1c6224eac82aac2d720f4ec456d8c50b" + "1.12": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.12.tar.gz" + sha256: "2c429bb26256b49bfed2510aef1e5fa9321b27fe4cf226c9ece9a5867150974f" + "1.11": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.11.tar.gz" + sha256: "e086c9e886cf786a091f5aac05250f9ea836488bd799f327f87e95c8f4247cc6" + "1.10": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.10.tar.gz" + sha256: "13047916886298c11fb97a4145e24753847f4dd674423cd5e3c572ccc34fad22" + "1.9": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.9.tar.gz" + sha256: "dcbe3f35b6447a4b867d1acc9c64545b8d4483c9f7df390035489fa41f145b80" + "1.8": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.8.tar.gz" + sha256: "65f4b00c234bc526c3143bb93ed811803fb761cdf25370a378632c8478375938" + "1.7": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.7.tar.gz" + sha256: "a2c16bbfbc3efcddd004e6fb2dd86e664966163b3f70a030b2bb70a89015130b" + "1.6": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.6.tar.gz" + sha256: "d0856911ab0a36b4c7ceba254c39651bbe5b8daec5127a03634e16434bb5e583" + "1.5": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.5.tar.gz" + sha256: "66c09ed6539e64cc8b7a5130172e33605ae42ee57be26bd523e7d820b230bbd1" diff --git a/recipes/cgltf/all/conanfile.py b/recipes/cgltf/all/conanfile.py new file mode 100644 index 0000000000000..bc0e435d4c8c5 --- /dev/null +++ b/recipes/cgltf/all/conanfile.py @@ -0,0 +1,89 @@ +from conans import ConanFile, CMake, tools +import os + + +class CgltfConan(ConanFile): + name = "cgltf" + description = "Single-file glTF 2.0 loader and writer written in C99." + license = "MIT" + topics = ("conan", "cgltf", "gltf", "header-only") + homepage = "https://github.com/jkuhlmann/cgltf" + 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} + + exports_sources = "CMakeLists.txt" + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def _create_source_files(self): + cgltf_c = ( + "#define CGLTF_IMPLEMENTATION\n" + "#include \"cgltf.h\"\n" + ) + cgltf_write_c = ( + "#define CGLTF_WRITE_IMPLEMENTATION\n" + "#include \"cgltf_write.h\"\n" + ) + tools.save(os.path.join(self.build_folder, self._source_subfolder, "cgltf.c"), cgltf_c) + tools.save(os.path.join(self.build_folder, self._source_subfolder, "cgltf_write.c"), cgltf_write_c) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + self._create_source_files() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + for header_file in ["cgltf.h", "cgltf_write.h"]: + header_fullpath = os.path.join(self.package_folder, "include", header_file) + self._remove_implementation(header_fullpath) + + @staticmethod + def _remove_implementation(header_fullpath): + header_content = tools.load(header_fullpath) + begin = header_content.find("/*\n *\n * Stop now, if you are only interested in the API.") + end = header_content.find("/* cgltf is distributed under MIT license:", begin) + implementation = header_content[begin:end] + tools.replace_in_file( + header_fullpath, + implementation, + ( + "/**\n" + " * Implementation removed by conan during packaging.\n" + " * Don't forget to link libs provided in this package.\n" + " */\n\n" + ) + ) + + def package_info(self): + self.cpp_info.libs = ["cgltf"] diff --git a/recipes/cgltf/all/test_package/CMakeLists.txt b/recipes/cgltf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5f056d0a34a03 --- /dev/null +++ b/recipes/cgltf/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +if(MSVC) + target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() diff --git a/recipes/cgltf/all/test_package/conanfile.py b/recipes/cgltf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/cgltf/all/test_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" + + 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/cgltf/all/test_package/test_package.cpp b/recipes/cgltf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d356cb14c6da6 --- /dev/null +++ b/recipes/cgltf/all/test_package/test_package.cpp @@ -0,0 +1,54 @@ +#define CGLTF_IMPLEMENTATION // can be defined or not +#include + +#include +#include + +// Performs matrix-vector multiplication, as in (4x4) * (4x1) = (4x1) +static void transform(const cgltf_float matrix[16], const cgltf_float source[4], cgltf_float target[4]) { + target[0] = matrix[0] * source[0] + matrix[4] * source[1] + matrix[ 8] * source[2] + matrix[12] * source[3]; + target[1] = matrix[1] * source[0] + matrix[5] * source[1] + matrix[ 9] * source[2] + matrix[13] * source[3]; + target[2] = matrix[2] * source[0] + matrix[6] * source[1] + matrix[10] * source[2] + matrix[14] * source[3]; + target[3] = matrix[3] * source[0] + matrix[7] * source[1] + matrix[11] * source[2] + matrix[15] * source[3]; +} + +static void set(cgltf_float target[3], float x, float y, float z) { + target[0] = x; + target[1] = y; + target[2] = z; +} + +static void check(cgltf_float target[3], float x, float y, float z) { + if (target[0] != x || target[1] != y || target[2] != z) { + std::fprintf(stderr, "Mismatch detected.\n"); + exit(1); + } +} + +int main() { + cgltf_node node = {}; + + cgltf_float matrix[16]; + cgltf_float source[4] = {1, 2, 3, 1}; + cgltf_float target[4]; + + set(node.scale, 1, 1, 1); + set(node.translation, 1, 0, 0); + cgltf_node_transform_local(&node, matrix); + transform(matrix, source, target); + check(target, 2, 2, 3); + + set(node.scale, 3, 1, 1); + set(node.translation, 0, 0, 0); + cgltf_node_transform_local(&node, matrix); + transform(matrix, source, target); + check(target, 3, 2, 3); + + set(node.scale, 1, 3, 1); + set(node.translation, 1, 0, 0); + cgltf_node_transform_local(&node, matrix); + transform(matrix, source, target); + check(target, 2, 6, 3); + + return 0; +} diff --git a/recipes/cgltf/config.yml b/recipes/cgltf/config.yml new file mode 100644 index 0000000000000..9f334f27c89c6 --- /dev/null +++ b/recipes/cgltf/config.yml @@ -0,0 +1,19 @@ +versions: + "1.13": + folder: all + "1.12": + folder: all + "1.11": + folder: all + "1.10": + folder: all + "1.9": + folder: all + "1.8": + folder: all + "1.7": + folder: all + "1.6": + folder: all + "1.5": + folder: all diff --git a/recipes/cgns/all/conandata.yml b/recipes/cgns/all/conandata.yml new file mode 100644 index 0000000000000..bbbd27b41a558 --- /dev/null +++ b/recipes/cgns/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "4.3.0": + url: "https://github.com/CGNS/CGNS/archive/v4.3.0.tar.gz" + sha256: "7709eb7d99731dea0dd1eff183f109eaef8d9556624e3fbc34dc5177afc0a032" +patches: + "4.3.0": + - patch_file: "patches/4.3.0-fix_find_hdf5.patch" + - patch_file: "patches/4.3.0-fix_static_or_shared.patch" diff --git a/recipes/cgns/all/conanfile.py b/recipes/cgns/all/conanfile.py new file mode 100644 index 0000000000000..0f06c2e7f30d9 --- /dev/null +++ b/recipes/cgns/all/conanfile.py @@ -0,0 +1,128 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +import os + + +required_conan_version = ">=1.52.0" + +class CgnsConan(ConanFile): + name = "cgns" + description = "Standard for data associated with the numerical solution " \ + "of fluid dynamics equations." + topics = "data", "cfd", "fluids" + homepage = "http://cgns.org/" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_hdf5": [True, False], + "parallel": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_hdf5": True, + "parallel": 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_hdf5: + self.requires("hdf5/1.14.0") + + def validate(self): + if self.info.options.parallel and not (self.info.options.with_hdf5 and self.dependencies["hdf5"].options.parallel): + raise ConanInvalidConfiguration("The option 'parallel' requires HDF5 with parallel=True") + if self.info.options.parallel and self.info.options.with_hdf5 and self.dependencies["hdf5"].options.enable_cxx: + raise ConanInvalidConfiguration("The option 'parallel' requires HDF5 with enable_cxx=False") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + cmake = CMakeDeps(self) + cmake.generate() + + tc = CMakeToolchain(self) + tc.variables["CGNS_ENABLE_TESTS"] = False + tc.variables["CGNS_BUILD_TESTING"] = False + tc.variables["CGNS_ENABLE_FORTRAN"] = False + tc.variables["CGNS_ENABLE_HDF5"] = self.options.with_hdf5 + tc.variables["CGNS_BUILD_SHARED"] = self.options.shared + tc.variables["CGNS_USE_SHARED"] = self.options.shared + tc.variables["CGNS_ENABLE_PARALLEL"] = self.options.parallel + tc.variables["CGNS_BUILD_CGNSTOOLS"] = False + tc.generate() + + # Other flags, seen in appveyor.yml in source code, not currently managed. + # CGNS_ENABLE_LFS:BOOL=OFF --- note in code: needed on 32 bit systems + # CGNS_ENABLE_SCOPING:BOOL=OFF --- disabled in VTK's bundle + # HDF5_NEED_ZLIB:BOOL=ON -- should be dealt with by cmake auto dependency management or something? + + def build(self): + apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure() + cmake.build(target="cgns_shared" if self.options.shared else "cgns_static") + + def package(self): + copy(self, "license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) + cmake.install() + + rm(self, "cgnsBuild.defs", os.path.join(self.package_folder, "include")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CGNS") + self.cpp_info.set_property("cmake_target_name", "CGNS::CGNS") + + if self.options.shared: + self.cpp_info.components["cgns_shared"].set_property("cmake_target_name", "CGNS::cgns_shared") + self.cpp_info.components["cgns_shared"].libs = ["cgnsdll" if self.settings.os == "Windows" else "cgns"] + self.cpp_info.components["cgns_shared"].libdirs = ["lib"] + if self.options.with_hdf5: + self.cpp_info.components["cgns_shared"].requires = ["hdf5::hdf5"] + if self.settings.os == "Windows": + # we could instead define USE_DLL but it's too generic + self.cpp_info.components["cgns_shared"].defines = ["CGNSDLL=__declspec(dllimport)"] + else: + self.cpp_info.components["cgns_static"].set_property("cmake_target_name", "CGNS::cgns_static") + self.cpp_info.components["cgns_static"].libs = ["cgns"] + self.cpp_info.components["cgns_static"].libdirs = ["lib"] + if self.options.with_hdf5: + self.cpp_info.components["cgns_static"].requires = ["hdf5::hdf5"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "CGNS" + self.cpp_info.names["cmake_find_package_multi"] = "CGNS" diff --git a/recipes/cgns/all/patches/4.3.0-fix_find_hdf5.patch b/recipes/cgns/all/patches/4.3.0-fix_find_hdf5.patch new file mode 100644 index 0000000000000..2863a2571c6d2 --- /dev/null +++ b/recipes/cgns/all/patches/4.3.0-fix_find_hdf5.patch @@ -0,0 +1,23 @@ +diff -r -u a/src/CMakeLists.txt b/src/CMakeLists.txt +--- a/src/CMakeLists.txt 2022-05-31 16:13:29.855723400 +0800 ++++ b/src/CMakeLists.txt 2022-05-31 16:40:39.332447379 +0800 +@@ -576,7 +576,7 @@ + add_library(CGNS::cgns-static ALIAS cgns_static) + # Needed to work around a CMake > 3.8 bug on Windows with MSVS and Intel Fortran + set_property(TARGET cgns_static PROPERTY LINKER_LANGUAGE C) +-target_link_libraries(cgns_static PRIVATE $<$:hdf5::hdf5-${CG_HDF5_LINK_TYPE}>) ++target_link_libraries(cgns_static PRIVATE $<$:HDF5::HDF5>) + + # Build a shared version of the library + if(CGNS_BUILD_SHARED) +@@ -592,8 +592,8 @@ + target_compile_definitions(cgns_shared PRIVATE -DBUILD_DLL) + target_compile_definitions(cgns_shared INTERFACE -DUSE_DLL) + endif () +- if (CGNS_ENABLE_HDF5 AND HDF5_LIBRARY) +- target_link_libraries(cgns_shared PUBLIC hdf5::hdf5-${CG_HDF5_LINK_TYPE} $<$>:${CMAKE_DL_LIBS}>) ++ if (CGNS_ENABLE_HDF5) ++ target_link_libraries(cgns_shared PUBLIC HDF5::HDF5 $<$>:${CMAKE_DL_LIBS}>) + if(HDF5_NEED_ZLIB AND ZLIB_LIBRARY) + target_link_libraries(cgns_shared PUBLIC ${ZLIB_LIBRARY}) + endif() diff --git a/recipes/cgns/all/patches/4.3.0-fix_static_or_shared.patch b/recipes/cgns/all/patches/4.3.0-fix_static_or_shared.patch new file mode 100644 index 0000000000000..8d07a513f10d2 --- /dev/null +++ b/recipes/cgns/all/patches/4.3.0-fix_static_or_shared.patch @@ -0,0 +1,24 @@ +Enforces that either static or dynamic libs are built + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 103cb1f..aae21a7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -674,7 +674,9 @@ if(CGNS_BUILD_SHARED) + endif() + + ++if(NOT CGNS_BUILD_SHARED) + set (install_targets cgns_static) ++endif() + if(CGNS_BUILD_SHARED) + set(install_targets ${install_targets} cgns_shared) + endif () +@@ -738,7 +740,6 @@ install(EXPORT cgns-targets + # Tools # + ######### + +-add_subdirectory(tools) + + ######### + # Tests # diff --git a/recipes/cgns/all/test_package/CMakeLists.txt b/recipes/cgns/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bb8b97918cf4b --- /dev/null +++ b/recipes/cgns/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(CGNS CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package CGNS::CGNS) diff --git a/recipes/cgns/all/test_package/conanfile.py b/recipes/cgns/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7fa7076884d60 --- /dev/null +++ b/recipes/cgns/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + +required_conan_version = ">=1.52.0" + +class CgnsTestConan(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/cgns/all/test_package/test_package.cpp b/recipes/cgns/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..89b847fc14ad8 --- /dev/null +++ b/recipes/cgns/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +#include + +int main() { + int indexFile; + int indexBase; + + cg_open("test.cgns", CG_MODE_WRITE, &indexFile); + + cg_base_write(indexFile, "Base2D", 2, 3, &indexBase); + + // test a global variable + printf("MassUnits: "); + for (unsigned i = 0; i < NofValidMassUnits; ++i) { + printf("%s ", MassUnitsName[i]); + } + printf("\n"); + + return 0; +} diff --git a/recipes/cgns/all/test_v1_package/CMakeLists.txt b/recipes/cgns/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a7c9449fc2eb1 --- /dev/null +++ b/recipes/cgns/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/cgns/all/test_v1_package/conanfile.py b/recipes/cgns/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b4c9865828e62 --- /dev/null +++ b/recipes/cgns/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class CgnsTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cgns/config.yml b/recipes/cgns/config.yml new file mode 100644 index 0000000000000..fefa3b794940e --- /dev/null +++ b/recipes/cgns/config.yml @@ -0,0 +1,3 @@ +versions: + "4.3.0": + folder: all diff --git a/recipes/chaiscript/all/CMakeLists.txt b/recipes/chaiscript/all/CMakeLists.txt new file mode 100644 index 0000000000000..a7a84f24be646 --- /dev/null +++ b/recipes/chaiscript/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if (WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif(WIN32 AND BUILD_SHARED_LIBS) + +add_subdirectory("source_subfolder") diff --git a/recipes/chaiscript/all/conandata.yml b/recipes/chaiscript/all/conandata.yml new file mode 100644 index 0000000000000..f00f973637251 --- /dev/null +++ b/recipes/chaiscript/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "6.1.0": + sha256: 3ca9ba6434b4f0123b5ab56433e3383b01244d9666c85c06cc116d7c41e8f92a + url: https://github.com/ChaiScript/ChaiScript/archive/v6.1.0.tar.gz diff --git a/recipes/chaiscript/all/conanfile.py b/recipes/chaiscript/all/conanfile.py new file mode 100644 index 0000000000000..00f73ebe996c7 --- /dev/null +++ b/recipes/chaiscript/all/conanfile.py @@ -0,0 +1,80 @@ +from conans import ConanFile, CMake, tools +import os + + +class ChaiScriptConan(ConanFile): + name = "chaiscript" + homepage = "https://github.com/ChaiScript/ChaiScript" + description = "Embedded Scripting Language Designed for C++." + topics = ("conan", "embedded-scripting-language", "language") + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False], "dyn_load": [True, False], "use_std_make_shared": [True, False], + "multithread_support": [True, False], + "header_only": [True, False]} + default_options = {"fPIC": True, "dyn_load": True, + "use_std_make_shared": True, + "multithread_support": True, + "header_only": True} + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "ChaiScript-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_TESTING"] = False + cmake.definitions["BUILD_SAMPLES"] = False + cmake.definitions["BUILD_MODULES"] = True + cmake.definitions["USE_STD_MAKE_SHARED"] = self.options.use_std_make_shared + cmake.definitions["DYNLOAD_ENABLED"] = self.options.dyn_load + cmake.definitions["MULTITHREAD_SUPPORT_ENABLED"] = self.options.multithread_support + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + if not self.options.header_only: + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + if self.options.header_only: + self.copy(pattern="*.hpp", dst="include", + src=os.path.join(self._source_subfolder, 'include')) + else: + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_id(self): + if self.options.header_only: + self.info.header_only() + + def package_info(self): + if not self.options.header_only: + self.cpp_info.libs = tools.collect_libs(self) + if self.options.use_std_make_shared: + self.cpp_info.defines.append("CHAISCRIPT_USE_STD_MAKE_SHARED") + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] + if self.options.multithread_support: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/chaiscript/all/test_package/CMakeLists.txt b/recipes/chaiscript/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ff036c8cd891 --- /dev/null +++ b/recipes/chaiscript/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(chaiscript REQUIRED CONFIG) + +# TEST_PACKAGE ################################################################# + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} CONAN_PKG::chaiscript) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/chaiscript/all/test_package/conanfile.py b/recipes/chaiscript/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4d0099777a2a9 --- /dev/null +++ b/recipes/chaiscript/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +import os +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/chaiscript/all/test_package/test_package.cpp b/recipes/chaiscript/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4dc5f93e03a5a --- /dev/null +++ b/recipes/chaiscript/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include +#include + +double chai_add(double i, double j) +{ + return i + j; +} + +int main() +{ + chaiscript::ChaiScript chai; + chai.add(chaiscript::fun(&chai_add), "add"); + const auto answer = chai.eval("add(38.8, 3.2);"); + assert(static_cast(answer) == 42); + std::cout << "The answer is: " << answer << '\n'; +} diff --git a/recipes/chaiscript/config.yml b/recipes/chaiscript/config.yml new file mode 100644 index 0000000000000..6acad5b8e7fd8 --- /dev/null +++ b/recipes/chaiscript/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "6.1.0": + folder: all diff --git a/recipes/charls/all/conandata.yml b/recipes/charls/all/conandata.yml new file mode 100644 index 0000000000000..44bdf87dad81c --- /dev/null +++ b/recipes/charls/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.4.1": + url: "https://github.com/team-charls/charls/archive/2.4.1.tar.gz" + sha256: "f313f556b5acb9215961d9718c21235aafcd43bce6b357bf66f772e5692bba75" + "2.4.0": + url: "https://github.com/team-charls/charls/archive/2.4.0.tar.gz" + sha256: "721f4fd6a8dc3ec6a334d1c3c15d1cb9faa149afddd0eff703466c20e775c294" + "2.3.4": + url: "https://github.com/team-charls/charls/archive/2.3.4.tar.gz" + sha256: "28e895a6e22daee76c24cf4d36c62bb20fd60fad0c9cfefc2eb8fa9b6045ae84" + "2.2.0": + url: "https://github.com/team-charls/charls/archive/2.2.0.tar.gz" + sha256: "e1d7dd70cd9d6d46de5abbf22278dc8169707995a21e8bf705f5746c04c76891" + "2.1.0": + url: "https://github.com/team-charls/charls/archive/2.1.0.tar.gz" + sha256: "0d6af23928ba4f1205b1b74754111e5f5f6b47d192199ffa7a70d14b824ad97d" +patches: + "2.1.0": + - patch_file: "patches/def-and-rc-for-msvc-only.patch" + - patch_file: "patches/fix-missing-includes-for-clang5-stdc++.patch" + - patch_file: "patches/enum-name-lookup-for-gcc5.patch" + - patch_file: "patches/constexpr-msvc2015.patch" diff --git a/recipes/charls/all/conanfile.py b/recipes/charls/all/conanfile.py new file mode 100644 index 0000000000000..97d9f69aa36d4 --- /dev/null +++ b/recipes/charls/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class CharlsConan(ConanFile): + name = "charls" + description = "C++ implementation of the JPEG-LS standard for lossless " \ + "and near-lossless image compression and decompression." + license = "BSD-3-Clause" + topics = ("jpeg", "JPEG-LS", "compression", "decompression", ) + homepage = "https://github.com/team-charls/charls" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + # brace initialization issue for gcc < 5 + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("CharLS can't be compiled by {0} {1}".format(self.settings.compiler, + self.settings.compiler.version)) + + # name lookup issue for gcc == 5 in charls/2.2.0 + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "5" and Version(self.version) >= "2.2.0": + raise ConanInvalidConfiguration("CharLS can't be compiled by {0} {1}".format(self.settings.compiler, + self.settings.compiler.version)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CHARLS_INSTALL"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"charls": "charls::charls"} + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "charls") + self.cpp_info.set_property("cmake_target_name", "charls") + self.cpp_info.set_property("pkg_config_name", "charls") + self.cpp_info.libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.defines.append("CHARLS_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/charls/all/patches/constexpr-msvc2015.patch b/recipes/charls/all/patches/constexpr-msvc2015.patch new file mode 100644 index 0000000000000..dcb269d191d5e --- /dev/null +++ b/recipes/charls/all/patches/constexpr-msvc2015.patch @@ -0,0 +1,48 @@ +--- a/src/scan.h ++++ b/src/scan.h +@@ -77,13 +77,13 @@ inline int32_t GetPredictedValue(int32_t Ra, int32_t Rb, int32_t Rc) noexcept + + #endif + +-constexpr int32_t UnMapErrVal(int32_t mappedError) noexcept ++CONSTEXPR int32_t UnMapErrVal(int32_t mappedError) noexcept + { + const int32_t sign = mappedError << (int32_t_bit_count - 1) >> (int32_t_bit_count - 1); + return sign ^ (mappedError >> 1); + } + +-constexpr int32_t GetMappedErrVal(int32_t errorValue) noexcept ++CONSTEXPR int32_t GetMappedErrVal(int32_t errorValue) noexcept + { + const int32_t mappedError = (errorValue >> (int32_t_bit_count - 2)) ^ (2 * errorValue); + return mappedError; +--- a/src/util.h ++++ b/src/util.h +@@ -34,9 +34,18 @@ + __pragma(warning(disable \ + : x)) // NOLINT(misc-macro-parentheses, bugprone-macro-parentheses) + #define MSVC_WARNING_UNSUPPRESS() __pragma(warning(pop)) ++ ++// Visual Studio 2015 supports C++14, but not all constexpr scenarios. VS 2017 has full C++14 support. ++#if _MSC_VER >= 1910 ++#define CONSTEXPR constexpr ++#else ++#define CONSTEXPR inline ++#endif ++ + #else + #define MSVC_WARNING_SUPPRESS(x) + #define MSVC_WARNING_UNSUPPRESS() ++#define CONSTEXPR constexpr + #endif + + namespace charls { +@@ -116,7 +125,7 @@ inline void push_back(std::vector& values, uint32_t value) + } + + +-constexpr int32_t log_2(int32_t n) noexcept ++CONSTEXPR int32_t log_2(int32_t n) noexcept + { + int32_t x = 0; + while (n > (1 << x)) diff --git a/recipes/charls/all/patches/def-and-rc-for-msvc-only.patch b/recipes/charls/all/patches/def-and-rc-for-msvc-only.patch new file mode 100644 index 0000000000000..f1e633908cba4 --- /dev/null +++ b/recipes/charls/all/patches/def-and-rc-for-msvc-only.patch @@ -0,0 +1,30 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -66,10 +66,25 @@ target_sources(charls + "${CMAKE_CURRENT_LIST_DIR}/scan.h" + "${CMAKE_CURRENT_LIST_DIR}/util.h" + "${CMAKE_CURRENT_LIST_DIR}/version.cpp" +- "${CMAKE_CURRENT_LIST_DIR}/charls.def" +- "${CMAKE_CURRENT_LIST_DIR}/charls.rc" + ) + ++if(MSVC AND BUILD_SHARED_LIBS) ++ # Only add the Win32 resource script file when building a DLL ++ target_sources(charls ++ PRIVATE ++ "${CMAKE_CURRENT_LIST_DIR}/charls.rc" ++ ) ++ ++ # Only add the definition file when building a x86 DLL ++ # The definition file is needed to ensure the legacy functions are exported with the correct name ++ if(CMAKE_SIZEOF_VOID_P EQUAL 4) ++ target_sources(charls ++ PRIVATE ++ "${CMAKE_CURRENT_LIST_DIR}/charls.def" ++ ) ++ endif() ++endif() ++ + if(CHARLS_INSTALL) + include(GNUInstallDirs) + diff --git a/recipes/charls/all/patches/enum-name-lookup-for-gcc5.patch b/recipes/charls/all/patches/enum-name-lookup-for-gcc5.patch new file mode 100644 index 0000000000000..8e73040d864df --- /dev/null +++ b/recipes/charls/all/patches/enum-name-lookup-for-gcc5.patch @@ -0,0 +1,17 @@ +--- a/src/charls_jpegls_decoder.cpp ++++ b/src/charls_jpegls_decoder.cpp +@@ -103,11 +103,11 @@ struct charls_jpegls_decoder final + + switch (interleave_mode()) + { +- case interleave_mode::none: ++ case charls::interleave_mode::none: + return static_cast(stride) * info.height * info.component_count; + +- case interleave_mode::line: +- case interleave_mode::sample: ++ case charls::interleave_mode::line: ++ case charls::interleave_mode::sample: + return static_cast(stride) * info.height; + } + diff --git a/recipes/charls/all/patches/fix-missing-includes-for-clang5-stdc++.patch b/recipes/charls/all/patches/fix-missing-includes-for-clang5-stdc++.patch new file mode 100644 index 0000000000000..23fb35dc2321b --- /dev/null +++ b/recipes/charls/all/patches/fix-missing-includes-for-clang5-stdc++.patch @@ -0,0 +1,12 @@ +--- a/src/jpegls_error.cpp ++++ b/src/jpegls_error.cpp +@@ -3,6 +3,9 @@ + + #include + ++#include ++#include ++ + using std::string; + using std::error_category; + diff --git a/recipes/charls/all/test_package/CMakeLists.txt b/recipes/charls/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a05d57b66979e --- /dev/null +++ b/recipes/charls/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) + +find_package(charls CONFIG REQUIRED) + +add_executable(test_package_c test_package.c) +target_link_libraries(test_package_c PRIVATE charls) +set_target_properties(test_package_c PROPERTIES LINKER_LANGUAGE CXX) + +add_executable(test_package_cpp test_package.cpp) +target_link_libraries(test_package_cpp PRIVATE charls) +target_compile_features(test_package_cpp PRIVATE cxx_std_14) diff --git a/recipes/charls/all/test_package/conanfile.py b/recipes/charls/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0b0b6a29cc68f --- /dev/null +++ b/recipes/charls/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_c_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_c_path, env="conanrun") + bin_cpp_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_cpp_path, env="conanrun") diff --git a/recipes/charls/all/test_package/test_package.c b/recipes/charls/all/test_package/test_package.c new file mode 100644 index 0000000000000..6275dcfa6a061 --- /dev/null +++ b/recipes/charls/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + printf("%s\n", charls_get_version_string()); + + return 0; +} diff --git a/recipes/charls/all/test_package/test_package.cpp b/recipes/charls/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..52961a4cfaf84 --- /dev/null +++ b/recipes/charls/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + std::cout << charls_get_version_string() << '\n'; + + return 0; +} diff --git a/recipes/charls/all/test_v1_package/CMakeLists.txt b/recipes/charls/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/charls/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/charls/all/test_v1_package/conanfile.py b/recipes/charls/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4e87a21d76c99 --- /dev/null +++ b/recipes/charls/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_c_path = os.path.join("bin", "test_package_c") + self.run(bin_c_path, run_environment=True) + bin_cpp_path = os.path.join("bin", "test_package_cpp") + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/charls/config.yml b/recipes/charls/config.yml new file mode 100644 index 0000000000000..96f2c11fde345 --- /dev/null +++ b/recipes/charls/config.yml @@ -0,0 +1,11 @@ +versions: + "2.4.1": + folder: all + "2.4.0": + folder: all + "2.3.4": + folder: all + "2.2.0": + folder: all + "2.1.0": + folder: all diff --git a/recipes/chef-fun/all/conandata.yml b/recipes/chef-fun/all/conandata.yml new file mode 100644 index 0000000000000..b1d88fa4a923c --- /dev/null +++ b/recipes/chef-fun/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + # Newer versions at the top + "1.0.1": + url: + - "https://gitlab.com/libchef/chef-fun/-/archive/1.0.1/chef-fun-1.0.1.tar.gz" + sha256: "52a4facb3b1de9f1a8ed4f3314fc5e2190fab1f5564c04c7071361fb08ca837e" diff --git a/recipes/chef-fun/all/conanfile.py b/recipes/chef-fun/all/conanfile.py new file mode 100644 index 0000000000000..e764b383caf1b --- /dev/null +++ b/recipes/chef-fun/all/conanfile.py @@ -0,0 +1,117 @@ +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 ChefFunConan(ConanFile): + name = "chef-fun" + homepage = "https://gitlab.com/libchef/chef-fun" + description = "C++ Functional programming support library" + topics = ("functional programming", "cpp", "library" ) + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + settings = "os", "arch", "compiler", "build_type" + # Keep these or explain why it's not required for this particular case + # Do not copy sources to build folder for header only projects, unless you need to apply patches + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + # In case the project requires C++14/17/20/... the minimum compiler version should be listed + # Not tested on "msvc", "clang", and "apple-clang". Possibly it works there + # given a sufficient recent version + @property + def _compilers_minimum_version(self): + return { + "gcc": "9.4.0", + } + + # Use the export_sources(self) method instead of the exports_sources attribute. + # This allows finer grain exportation of patches per version + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + # src_folder must use the same source folder name than the project + basic_layout(self, src_folder="src") + + # same package ID for any package + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + # Validate the minimum cpp standard supported when installing the package. For C++ projects only + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + +# def requirements(self): +# # Prefer self.requires method instead of requires attribute +# # Direct dependencies of header only libs are always transitive since they are included in public headers +# self.requires("dependency/0.8.1", transitive_headers=True) + + def source(self): + # Download source package and extract to source folder + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + # Not mandatory when there is no patch, but will suppress warning message about missing build() method + def build(self): + # The attribute no_copy_source should not be used when applying patches in build + apply_conandata_patches(self) + + # Copy all files to the package folder + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hh", + 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): + # Folders not used for header-only + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # Set these to the appropriate values if the package has an official FindPACKAGE.cmake + # listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules + # examples: bzip2, freetype, gdal, icu, libcurl, libjpeg, libpng, libtiff, openssl, sqlite3, zlib... + self.cpp_info.set_property("cmake_module_file_name", "ChefFun") + self.cpp_info.set_property("cmake_module_target_name", "ChefFun::ChefFun") + # Set these to the appropriate values if package provides a CMake config file + # (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) + self.cpp_info.set_property("cmake_file_name", "chef-fun") + self.cpp_info.set_property("cmake_target_name", "chef-fun::chef-fun") + # Set this to the appropriate value if the package provides a pkgconfig file + # (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "chef-fun") + + ## Add m, pthread and dl if needed in Linux/FreeBSD + #if self.settings.os in ["Linux", "FreeBSD"]: + # self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "chef-fun" + self.cpp_info.names["cmake_find_package_multi"] = "chef-fun" + self.cpp_info.filenames["cmake_find_package"] = "chef-fun" + self.cpp_info.filenames["cmake_find_package_multi"] = "chef-fun" diff --git a/recipes/chef-fun/all/test_package/CMakeLists.txt b/recipes/chef-fun/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b9b67b1de88f --- /dev/null +++ b/recipes/chef-fun/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(chef-fun REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +target_link_libraries(${PROJECT_NAME} PRIVATE chef-fun::chef-fun) + + diff --git a/recipes/chef-fun/all/test_package/conanfile.py b/recipes/chef-fun/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/chef-fun/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/chef-fun/all/test_package/test_package.cpp b/recipes/chef-fun/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62c5785b04be8 --- /dev/null +++ b/recipes/chef-fun/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include +#include "ChefFun/Option.hh" +#include "ChefFun/Either.hh" + +using namespace ChefFun; + +int main() { + Option os = Option::Some( "abc" ); + auto mapped = os.map( []( auto&& n ){ return 2*n.size(); }); + + Either es = Either::Right( "abc" ); + + + auto n = es + .matchRight( []( auto&& ss ) -> int { return ss.size(); } ) + .matchLeft( []( auto&& ii ) -> int { return 2*ii; } ); + + return EXIT_SUCCESS; +} diff --git a/recipes/chef-fun/all/test_v1_package/CMakeLists.txt b/recipes/chef-fun/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a8d0c7626a3cb --- /dev/null +++ b/recipes/chef-fun/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) # if the project uses 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/chef-fun/all/test_v1_package/conanfile.py b/recipes/chef-fun/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/chef-fun/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/chef-fun/config.yml b/recipes/chef-fun/config.yml new file mode 100644 index 0000000000000..d8a13868268e6 --- /dev/null +++ b/recipes/chef-fun/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0.1": + folder: all diff --git a/recipes/chipmunk2d/all/conandata.yml b/recipes/chipmunk2d/all/conandata.yml new file mode 100644 index 0000000000000..0fcc6c23d2ed4 --- /dev/null +++ b/recipes/chipmunk2d/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "7.0.3": + url: "https://chipmunk-physics.net/release/Chipmunk-7.x/Chipmunk-7.0.3.tgz" + sha256: "048b0c9eff91c27bab8a54c65ad348cebd5a982ac56978e8f63667afbb63491a" diff --git a/recipes/chipmunk2d/all/conanfile.py b/recipes/chipmunk2d/all/conanfile.py new file mode 100644 index 0000000000000..72a9a9cadd3ff --- /dev/null +++ b/recipes/chipmunk2d/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class Chipmunk2DConan(ConanFile): + name = "chipmunk2d" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://chipmunk-physics.net" + topics = ("physics", "engine", "game development") + description = "Chipmunk2D is a simple, lightweight, fast and portable 2D "\ + "rigid body physics library written in C." + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DEMOS"] = False + tc.variables["INSTALL_DEMOS"] = False + tc.variables["INSTALL_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.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 = ["chipmunk"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/chipmunk2d/all/test_package/CMakeLists.txt b/recipes/chipmunk2d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b51652c38fd2b --- /dev/null +++ b/recipes/chipmunk2d/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(chipmunk2d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE chipmunk2d::chipmunk2d) diff --git a/recipes/chipmunk2d/all/test_package/conanfile.py b/recipes/chipmunk2d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/chipmunk2d/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/chipmunk2d/all/test_package/test_package.c b/recipes/chipmunk2d/all/test_package/test_package.c new file mode 100644 index 0000000000000..d4ff40c785713 --- /dev/null +++ b/recipes/chipmunk2d/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "chipmunk/chipmunk.h" + +int main() +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetGravity(space, cpv(0, -600)); + cpSpaceFree(space); + return 0; +} diff --git a/recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt b/recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/chipmunk2d/all/test_v1_package/conanfile.py b/recipes/chipmunk2d/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/chipmunk2d/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/chipmunk2d/config.yml b/recipes/chipmunk2d/config.yml new file mode 100644 index 0000000000000..99051ffb19004 --- /dev/null +++ b/recipes/chipmunk2d/config.yml @@ -0,0 +1,3 @@ +versions: + "7.0.3": + folder: "all" diff --git a/recipes/cimg/all/conandata.yml b/recipes/cimg/all/conandata.yml new file mode 100644 index 0000000000000..eea92963062f7 --- /dev/null +++ b/recipes/cimg/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.2.0": + url: "https://cimg.eu/files/CImg_3.2.0.zip" + sha256: "7a923357c3127d8839696c7b0f4eb4c23982c090d3f49fb133f2c8556ca74a88" + "3.0.2": + url: "https://cimg.eu/files/CImg_3.0.2.zip" + sha256: "ee55a37c33d503a64ff264b53952e502ba7c2887b59ded47c47c86ea52ac5c31" + "3.0.0": + url: "https://cimg.eu/files/CImg_3.0.0.zip" + sha256: "8ec6e9d87459a3cb85bddcd5ae8a4891bc734957ea4aa3089dcf1d234e8d0525" + "2.9.9": + url: "https://cimg.eu/files/CImg_2.9.9.zip" + sha256: "c94412f26800ea318fa79410c58da1cf3df71771d07e515c39b16ee743f68e92" + "2.9.4": + url: "https://cimg.eu/files/CImg_2.9.4.zip" + sha256: "455945dc035d50bbc042450e2dc81b2ca19ea74cd3bc38b46ac623df6997dfff" + "2.9.2": + url: "https://cimg.eu/files/CImg_2.9.2.zip" + sha256: "58ffe77bfc25bd90bb3f8185cd7ed8427e2e4f95ce5b748ae2f6291d026b5e90" + "2.8.3": + url: "https://cimg.eu/files/CImg_2.8.3.zip" + sha256: "8d92e4cc271568c5aeca6e6b1f28f620fcf161ef99ce9d070ed1905d92caec4c" diff --git a/recipes/cimg/all/conanfile.py b/recipes/cimg/all/conanfile.py new file mode 100644 index 0000000000000..4c4d65c0ab3d8 --- /dev/null +++ b/recipes/cimg/all/conanfile.py @@ -0,0 +1,119 @@ +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 +import os + +required_conan_version = ">=1.51.1" + + +class CImgConan(ConanFile): + name = "cimg" + description = "The CImg Library is a small and open-source C++ toolkit for image processing" + homepage = "http://cimg.eu" + topics = ("physics", "simulation", "robotics", "kinematics", "engine") + license = "CeCILL V2" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "enable_fftw": [True, False], + "enable_jpeg": [True, False], + "enable_openexr": [True, False], + "enable_png": [True, False], + "enable_tiff": [True, False], + "enable_ffmpeg": [True, False], + "enable_opencv": [True, False], + "enable_magick": [True, False], + "enable_xrandr": [True, False], + "enable_xshm": [True, False], + } + default_options = { + "enable_fftw": False, + "enable_jpeg": False, + "enable_openexr": False, + "enable_png": False, + "enable_tiff": False, + "enable_ffmpeg": False, + "enable_opencv": False, + "enable_magick": False, + "enable_xrandr": False, + "enable_xshm": False, + } + + no_copy_source = True + + @property + def _cimg_defines(self): + return [ + ("enable_fftw", "cimg_use_fftw"), + ("enable_jpeg", "cimg_use_jpeg"), + ("enable_openexr", "cimg_use_openexr"), + ("enable_png", "cimg_use_png"), + ("enable_tiff", "cimg_use_tiff"), + ("enable_ffmpeg", "cimg_use_ffmpeg"), + ("enable_opencv", "cimg_use_opencv"), + ("enable_magick", "cimg_use_magick"), + ("enable_xrandr", "cimg_use_xrandr"), + ("enable_xshm", "cimg_use_xshm"), + ] + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.enable_fftw: + self.requires("fftw/3.3.9") + if self.options.enable_jpeg: + self.requires("libjpeg/9e") + if self.options.enable_openexr: + self.requires("openexr/2.5.7") + if self.options.enable_png: + self.requires("libpng/1.6.39") + if self.options.enable_tiff: + self.requires("libtiff/4.4.0") + if self.options.enable_ffmpeg: + self.requires("ffmpeg/5.0") + if self.options.enable_opencv: + self.requires("opencv/4.5.5") + if self.options.enable_magick: + self.requires("imagemagick/7.0.11-14") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + # TODO: Update requirements when available in CCI + if self.options.enable_xrandr: + raise ConanInvalidConfiguration("xrandr not available in CCI yet") + if self.options.enable_xshm: + raise ConanInvalidConfiguration("xshm not available in CCI yet") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "Licence*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "CImg.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "*", os.path.join(self.source_folder, "plugins"), + os.path.join(self.package_folder, "include", "plugins")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "CImg") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + for option, define in self._cimg_defines: + if getattr(self.options, option): + self.cpp_info.defines.append(define) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + # do not use this name in CMakeDeps, it was a mistake, there is no offical CMake config file + self.cpp_info.names["cmake_find_package"] = "CImg" + self.cpp_info.names["cmake_find_package_multi"] = "CImg" diff --git a/recipes/cimg/all/test_package/CMakeLists.txt b/recipes/cimg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..449f2a9e10e69 --- /dev/null +++ b/recipes/cimg/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cimg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cimg::cimg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cimg/all/test_package/conanfile.py b/recipes/cimg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cimg/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/cimg/all/test_package/test_package.cpp b/recipes/cimg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..119c4760a1373 --- /dev/null +++ b/recipes/cimg/all/test_package/test_package.cpp @@ -0,0 +1,157 @@ +/* + # + # File : image2ascii.cpp + # ( C++ source file ) + # + # Description : A basic image to ASCII-art converter. + # This file is a part of the CImg Library project. + # ( http://cimg.eu ) + # + # Copyright : David Tschumperle + # ( http://tschumperle.users.greyc.fr/ ) + # + # License : CeCILL v2.0 + # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) + # + # This software is governed by the CeCILL license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL + # license as circulated by CEA, CNRS and INRIA at the following URL + # "http://www.cecill.info". + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # In this respect, the user's attention is drawn to the risks associated + # with loading, using, modifying and/or developing or reproducing the + # software by the user in light of its specific status of free software, + # that may mean that it is complicated to manipulate, and that also + # therefore means that it is reserved for developers and experienced + # professionals having in-depth computer knowledge. Users are therefore + # encouraged to load and test the software's suitability as regards their + # requirements in conditions enabling the security of their systems and/or + # data to be ensured and, more generally, to use and operate it in the + # same conditions as regards security. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL license and that you accept its terms. + # +*/ + +// Tell CImg not to use display capabilities. +#undef cimg_display +#define cimg_display 0 +#include "CImg.h" +using namespace cimg_library; + +/*--------------------------- + + Main procedure + + --------------------------*/ +int main(int argc,char **argv) { + cimg_usage("A simple image to ASCII-art converter.\n\nUsage : image2ascii [options] image"); + + // Read command line parameters + const char *const file_i = cimg_option("-i",(char*)0,"Input image"); + const char *const geom = cimg_option("-g","79x40","Output size"); + const int alphabet = cimg_option("-a",0,"Alphabet type (0=full, 1=numbers, 2=letters, 3=signs, 4=minimal"); + const bool invert = cimg_option("-invert",false,"Invert image intensities"); + const float contour = (float)cimg_option("-contour",0.0f,"Use image contours higher than specified threshold"); + const float blur = (float)cimg_option("-blur",0.8f,"Image pre-blur"); + const float sigma = (float)cimg_option("-sigma",10.0f,"Font pre-blur"); + + int w = 79, h = 40; + std::sscanf(geom,"%d%*c%d",&w,&h); + if (cimg_option("-h",false,0)) std::exit(0); + + // Init fonts + CImgList<> font_full = CImgList<>::font(13,false); + font_full.remove(0,255); + const int fw = font_full[(int)'A'].width(), fh = font_full[(int)'A'].height(); + CImgList<> font, font_blur; + CImgList font_code; + + switch (alphabet) { + case 1: { + font_code.insert(CImg<>::vector(' ')); + for (unsigned char l='0'; l<='9'; l++) font_code.insert(CImg<>::vector(l)); + } break; + case 2: { + font_code.insert(CImg<>::vector(' ')); + for (unsigned char l='A'; l<='Z'; l++) font_code.insert(CImg<>::vector(l)); + } break; + case 3: { + font_code.insert(CImg<>::vector(' ')); + font_code.insert(CImg<>::vector('-')); + font_code.insert(CImg<>::vector('_')); + font_code.insert(CImg<>::vector('|')); + font_code.insert(CImg<>::vector('/')); + font_code.insert(CImg<>::vector('\\')); + font_code.insert(CImg<>::vector('+')); + font_code.insert(CImg<>::vector('.')); + font_code.insert(CImg<>::vector('*')); + font_code.insert(CImg<>::vector('=')); + font_code.insert(CImg<>::vector(']')); + font_code.insert(CImg<>::vector('[')); + font_code.insert(CImg<>::vector('(')); + font_code.insert(CImg<>::vector(')')); + font_code.insert(CImg<>::vector('{')); + font_code.insert(CImg<>::vector('}')); + font_code.insert(CImg<>::vector('"')); + font_code.insert(CImg<>::vector('!')); + font_code.insert(CImg<>::vector('$')); + } break; + case 4: { + font_code.insert(CImg<>::vector(' ')); + font_code.insert(CImg<>::vector('.')); + font_code.insert(CImg<>::vector('/')); + font_code.insert(CImg<>::vector('\\')); + font_code.insert(CImg<>::vector('_')); + font_code.insert(CImg<>::vector('_')); + font_code.insert(CImg<>::vector('|')); + } break; + default: { for (unsigned char l=' '; l<='~'; l++) font_code.insert(CImg<>::vector(l)); } break; + } + cimglist_for(font_code,l) { + font.insert(font_full(font_code[l](0))); + font_blur.insert(font[l].get_resize(fw,fh,1,1).blur(sigma).normalize(0,255)); + } + + // Init images + CImg<> img; + if (!file_i) { float white[3] = { 255,255,255 }; img.assign().draw_text(0,0," Conan\nRocks !",white); } + else img.assign(file_i); + img.norm().resize(fw*w,fh*h); + if (blur) img.blur(blur); + if (contour>0) { + CImgList<> grad = img.get_gradient("xy",4); + img = (grad[0].pow(2) + grad[1].pow(2)).sqrt().normalize(0,100).threshold(contour); + } + img.normalize(0,255); + if (invert) img = 255.0f - img; + CImg dest(w,h,1,1,0); + + // Render ASCII-art image, using a simple correlation method. + CImg<> neigh; + cimg_forY(dest,y) { cimg_forX(dest,x) { + neigh = img.get_crop(x*fw,y*fh,(x + 1)*fw,(y + 1)*fh); + float scoremin = 2e28f; + unsigned int best = 0; + cimglist_for(font_code,l) { + const CImg<>& letter = font_blur[l]; + const float score = (float)((letter - neigh).pow(2).sum()); + if (score + +int main() { + CircularBuffer buffer; + + buffer.push(5); + buffer.unshift(1); + + return 0; +} diff --git a/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt b/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3ddfb18ba1fed --- /dev/null +++ b/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ + +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(CircularBuffer CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CircularBuffer::CircularBuffer) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/circularbuffer/all/test_v1_package/conanfile.py b/recipes/circularbuffer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0a93a273ba575 --- /dev/null +++ b/recipes/circularbuffer/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(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/circularbuffer/all/test_v1_package/test_package.cpp b/recipes/circularbuffer/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..c9d59e4b258c6 --- /dev/null +++ b/recipes/circularbuffer/all/test_v1_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +int main() { + CircularBuffer buffer; + + buffer.push(5); + buffer.unshift(1); + + return 0; +} diff --git a/recipes/circularbuffer/config.yml b/recipes/circularbuffer/config.yml new file mode 100644 index 0000000000000..3abfca40293f6 --- /dev/null +++ b/recipes/circularbuffer/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.3": + folder: all diff --git a/recipes/cista/all/conandata.yml b/recipes/cista/all/conandata.yml new file mode 100644 index 0000000000000..1547b3bc2b229 --- /dev/null +++ b/recipes/cista/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "0.11": + - url: "https://github.com/felixguendling/cista/releases/download/v0.11/cista.h" + sha256: "e2e37fa1f7278e7f1a8dab7d84b6b00f5a0a4fb48f42fbe5761b7ddd0d07314c" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.11/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" + "0.10": + - url: "https://github.com/felixguendling/cista/releases/download/v0.10/cista.h" + sha256: "c06162c73c0fb034170198d79940d2eeecc233140797ab7e3b66053d61a0169b" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.10/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" + "0.9": + - url: "https://github.com/felixguendling/cista/releases/download/v0.9/cista.h" + sha256: "e5401638eeb6d4bdaba6448de90663d9cc2c8d41d4e30c48c1fac4663e01f96d" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.9/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" + "0.8": + - url: "https://github.com/felixguendling/cista/releases/download/0.8/cista.h" + sha256: "1fc202033f3e33dc25bed3b75e8f6dc346f7c3b0a182ea675fc519d057d48777" + - url: "https://raw.githubusercontent.com/felixguendling/cista/0.8/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" + "0.7": + - url: "https://github.com/felixguendling/cista/releases/download/v0.7/cista.h" + sha256: "10da0a23c4dd18fab87fa7c49cf6aa86cd8f17918930cad0331996f406719fae" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.7/LICENSE" + sha256: "5db66757f5d9e791a8dcdca16dd59ad499dcfd9c245083bb7df93b20caa2bd55" diff --git a/recipes/cista/all/conanfile.py b/recipes/cista/all/conanfile.py new file mode 100644 index 0000000000000..a5a461c964a04 --- /dev/null +++ b/recipes/cista/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, download +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class CistaConan(ConanFile): + name = "cista" + description = ( + "Cista++ is a simple, open source (MIT license) C++17 " + "compatible way of (de-)serializing C++ data structures." + ) + license = "MIT" + topics = ("cista", "serialization", "deserialization", "reflection") + homepage = "https://github.com/felixguendling/cista" + url = "https://github.com/conan-io/conan-center-index" + 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.7" if Version(self.version) < "0.11" else "16", + "msvc": "191" if Version(self.version) < "0.11" else "192", + "gcc": "8", + "clang": "6", + "apple-clang": "9.1" + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), None) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + 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 source(self): + for file in self.conan_data["sources"][self.version]: + filename = os.path.basename(file["url"]) + download(self, filename=filename, **file) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "cista.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cista") + self.cpp_info.set_property("cmake_target_name", "cista::cista") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cista/all/test_package/CMakeLists.txt b/recipes/cista/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..17a27c55f0b49 --- /dev/null +++ b/recipes/cista/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cista REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cista::cista) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cista/all/test_package/conanfile.py b/recipes/cista/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/cista/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/cista/all/test_package/test_package.cpp b/recipes/cista/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..87833458476bb --- /dev/null +++ b/recipes/cista/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +struct pos { + int x; + int y; +}; + +namespace data = cista::offset; +using pos_map = data::hash_map, data::hash_set>; + +int main() { + constexpr auto const MODE = cista::mode::WITH_VERSION | cista::mode::WITH_INTEGRITY; + + { // Serialize + auto positions = pos_map{ + {{{1, 2}, {3, 4}}, {"hello", "cista"}}, + {{{5, 6}, {7, 8}}, {"hello", "world"}}, + }; + cista::buf mmap{cista::mmap{"data"}}; + cista::serialize(mmap, positions); + } + + // Deserialize. + auto b = cista::mmap("data", cista::mmap::protection::READ); + auto positions = cista::deserialize(b); + + return 0; +} diff --git a/recipes/cista/all/test_v1_package/CMakeLists.txt b/recipes/cista/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/cista/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cista/all/test_v1_package/conanfile.py b/recipes/cista/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cista/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/cista/config.yml b/recipes/cista/config.yml new file mode 100644 index 0000000000000..ac2c19b16c278 --- /dev/null +++ b/recipes/cista/config.yml @@ -0,0 +1,11 @@ +versions: + "0.11": + folder: all + "0.10": + folder: all + "0.9": + folder: all + "0.8": + folder: all + "0.7": + folder: all diff --git a/recipes/cityhash/all/conandata.yml b/recipes/cityhash/all/conandata.yml new file mode 100644 index 0000000000000..77c6f2317b0e8 --- /dev/null +++ b/recipes/cityhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20130801": + url: "https://github.com/google/cityhash/archive/8af9b8c2b889d80c22d6bc26ba0df1afb79a30db.zip" + sha256: "3524f5ed43143974a29fddeeece29c8b6348f05db08dd180452da01a2837ddce" diff --git a/recipes/cityhash/all/conanfile.py b/recipes/cityhash/all/conanfile.py new file mode 100644 index 0000000000000..75f708b33af3e --- /dev/null +++ b/recipes/cityhash/all/conanfile.py @@ -0,0 +1,101 @@ +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 copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class CityhashConan(ConanFile): + name = "cityhash" + description = "CityHash, a family of hash functions for strings." + license = "MIT" + topics = ("hash",) + homepage = "https://github.com/google/cityhash" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @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") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("cityhash does not support shared builds with Visual Studio") + + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + ar_wrapper = unix_path(self, self.dependencies.build["automake"].conf_info.get("user.automake:lib-wrapper")) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def build(self): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["cityhash"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/cityhash/all/test_package/CMakeLists.txt b/recipes/cityhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9fbe304115d9e --- /dev/null +++ b/recipes/cityhash/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(cityhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cityhash::cityhash) diff --git a/recipes/cityhash/all/test_package/conanfile.py b/recipes/cityhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cityhash/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/cityhash/all/test_package/test_package.cpp b/recipes/cityhash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..158134bbe3214 --- /dev/null +++ b/recipes/cityhash/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << CityHash64("conan-center-index", 18) << std::endl; + return 0; +} diff --git a/recipes/cityhash/all/test_v1_package/CMakeLists.txt b/recipes/cityhash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cityhash/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cityhash/all/test_v1_package/conanfile.py b/recipes/cityhash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cityhash/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/cityhash/config.yml b/recipes/cityhash/config.yml new file mode 100644 index 0000000000000..489bded5765de --- /dev/null +++ b/recipes/cityhash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20130801": + folder: all diff --git a/recipes/civetweb/all/conandata.yml b/recipes/civetweb/all/conandata.yml new file mode 100644 index 0000000000000..a9f81795c04f4 --- /dev/null +++ b/recipes/civetweb/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "1.16": + url: "https://github.com/civetweb/civetweb/archive/v1.16.tar.gz" + sha256: "f0e471c1bf4e7804a6cfb41ea9d13e7d623b2bcc7bc1e2a4dd54951a24d60285" + "1.15": + url: "https://github.com/civetweb/civetweb/archive/v1.15.tar.gz" + sha256: "90a533422944ab327a4fbb9969f0845d0dba05354f9cacce3a5005fa59f593b9" + "1.14": + url: "https://github.com/civetweb/civetweb/archive/v1.14.tar.gz" + sha256: "d02d7ab091c8b4edf21fc13a03c6db08a8a8b8605e35e0073251b9d88443c653" + "1.13": + url: "https://github.com/civetweb/civetweb/archive/v1.13.tar.gz" + sha256: "a7ccc76c2f1b5f4e8d855eb328ed542f8fe3b882a6da868781799a98f4acdedc" +patches: + "1.14": + - patch_file: "patches/0001-fix-install-bundle.patch" + "1.13": + - patch_file: "patches/0001-fix-install-bundle.patch" diff --git a/recipes/civetweb/all/conanfile.py b/recipes/civetweb/all/conanfile.py new file mode 100644 index 0000000000000..4d048e6a27d5b --- /dev/null +++ b/recipes/civetweb/all/conanfile.py @@ -0,0 +1,191 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, 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.53.0" + + +class CivetwebConan(ConanFile): + name = "civetweb" + license = "MIT" + homepage = "https://github.com/civetweb/civetweb" + url = "https://github.com/conan-io/conan-center-index" + description = "Embedded C/C++ web server" + topics = ("web-server", "embedded") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + "ssl_dynamic_loading": [True, False], + "with_caching": [True, False], + "with_cgi": [True, False], + "with_cxx": [True, False], + "with_duktape": [True, False], + "with_ipv6": [True, False], + "with_lua": [True, False], + "with_server_stats": [True, False], + "with_ssl": [True, False], + "with_static_files": [True, False], + "with_third_party_output": [True, False], + "with_websockets": [True, False], + "with_zlib": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "ssl_dynamic_loading": False, + "with_caching": True, + "with_cgi": True, + "with_cxx": True, + "with_duktape": False, + "with_ipv6": True, + "with_lua": False, + "with_server_stats": False, + "with_ssl": True, + "with_static_files": True, + "with_third_party_output": False, + "with_websockets": True, + "with_zlib": False, + } + + no_copy_source = True + + @property + def _has_zlib_option(self): + return Version(self.version) >= "1.15" + + 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_zlib_option: + del self.options.with_zlib + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.with_cxx: + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.with_ssl: + del self.options.ssl_dynamic_loading + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_ssl: + if Version(self.version) < "1.16": + self.requires("openssl/1.1.1t") + else: + self.requires("openssl/[>=1 <4]") + if self.options.get_safe("with_zlib"): + self.requires("zlib/1.2.13") + + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + + if self.options.with_ssl: + openssl_version = Version(self.dependencies["openssl"].ref.version) + tc.variables["CIVETWEB_ENABLE_SSL"] = self.options.with_ssl + tc.variables["CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING"] = self.options.ssl_dynamic_loading + tc.variables["CIVETWEB_SSL_OPENSSL_API_1_0"] = openssl_version.major == "1" and openssl_version.minor == "0" + tc.variables["CIVETWEB_SSL_OPENSSL_API_1_1"] = openssl_version.major == "1" and openssl_version.minor == "1" + if Version(self.version) >= "1.16": + tc.variables["CIVETWEB_SSL_OPENSSL_API_3_0"] = openssl_version.major == "3" + + tc.variables["CIVETWEB_BUILD_TESTING"] = False + tc.variables["CIVETWEB_CXX_ENABLE_LTO"] = False + tc.variables["CIVETWEB_ENABLE_ASAN"] = False + + tc.variables["CIVETWEB_DISABLE_CACHING"] = not self.options.with_caching + tc.variables["CIVETWEB_DISABLE_CGI"] = not self.options.with_cgi + tc.variables["CIVETWEB_ENABLE_CXX"] = self.options.with_cxx + tc.variables["CIVETWEB_ENABLE_DUKTAPE"] = self.options.with_duktape + tc.variables["CIVETWEB_ENABLE_IPV6"] = self.options.with_ipv6 + tc.variables["CIVETWEB_ENABLE_LUA"] = self.options.with_lua + tc.variables["CIVETWEB_ENABLE_SERVER_STATS"] = self.options.with_server_stats + 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._has_zlib_option: + tc.variables["CIVETWEB_ENABLE_ZLIB"] = self.options.with_zlib + + 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, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure() + 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")) + bin_folder = os.path.join(self.package_folder, "bin") + for bin_file in os.listdir(bin_folder): + if not bin_file.startswith("civetweb"): + os.remove(os.path.join(bin_folder, bin_file)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "civetweb") + self.cpp_info.set_property("cmake_target_name", "civetweb::civetweb-cpp" if self.options.with_cxx else "civetweb::civetweb") + self.cpp_info.set_property("pkg_config_name", "civetweb") + + self.cpp_info.components["_civetweb"].set_property("cmake_target_name", "civetweb::civetweb") + self.cpp_info.components["_civetweb"].libs = ["civetweb"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_civetweb"].system_libs.extend(["rt", "pthread"]) + if self.options.get_safe("ssl_dynamic_loading"): + self.cpp_info.components["_civetweb"].system_libs.append("dl") + elif self.settings.os == "Macos": + self.cpp_info.components["_civetweb"].frameworks.append("Cocoa") + elif self.settings.os == "Windows": + self.cpp_info.components["_civetweb"].system_libs.append("ws2_32") + if self.options.shared: + self.cpp_info.components["_civetweb"].defines.append("CIVETWEB_DLL_IMPORTS") + if self.options.with_ssl: + self.cpp_info.components["_civetweb"].requires.append("openssl::openssl") + if self.options.get_safe("with_zlib"): + self.cpp_info.components["_civetweb"].requires.append("zlib::zlib") + + if self.options.with_cxx: + self.cpp_info.components["civetweb-cpp"].set_property("cmake_target_name", "civetweb::civetweb-cpp") + self.cpp_info.components["civetweb-cpp"].libs = ["civetweb-cpp"] + self.cpp_info.components["civetweb-cpp"].requires = ["_civetweb"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["civetweb-cpp"].system_libs.append("m") + elif self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["civetweb-cpp"].defines.append("CIVETWEB_CXX_DLL_IMPORTS") + + # TODO: to remove once conan v1 support dropped + self.cpp_info.components["_civetweb"].names["cmake_find_package"] = "civetweb" + self.cpp_info.components["_civetweb"].names["cmake_find_package_multi"] = "civetweb" + if self.options.with_cxx: + self.cpp_info.components["civetweb-cpp"].names["cmake_find_package"] = "civetweb-cpp" + self.cpp_info.components["civetweb-cpp"].names["cmake_find_package_multi"] = "civetweb-cpp" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/civetweb/all/patches/0001-fix-install-bundle.patch b/recipes/civetweb/all/patches/0001-fix-install-bundle.patch new file mode 100644 index 0000000000000..0dcd4902b8e19 --- /dev/null +++ b/recipes/civetweb/all/patches/0001-fix-install-bundle.patch @@ -0,0 +1,13 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -257,9 +257,7 @@ if (CIVETWEB_ENABLE_SERVER_EXECUTABLE) + install( + TARGETS civetweb-c-executable + EXPORT ${PROJECT_NAME}-targets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT server) + endif() + target_include_directories( diff --git a/recipes/civetweb/all/test_package/CMakeLists.txt b/recipes/civetweb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ec3a0b53c970 --- /dev/null +++ b/recipes/civetweb/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(civetweb REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} civetweb::civetweb) diff --git a/recipes/civetweb/all/test_package/conanfile.py b/recipes/civetweb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4e578144a798a --- /dev/null +++ b/recipes/civetweb/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/civetweb/all/test_package/test_package.cpp b/recipes/civetweb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a8f94d139a8db --- /dev/null +++ b/recipes/civetweb/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "civetweb.h" + +int main(int argc, char *argv[]) +{ + mg_init_library(0); + return 0; +} diff --git a/recipes/civetweb/all/test_v1_package/CMakeLists.txt b/recipes/civetweb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/civetweb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/civetweb/all/test_v1_package/conanfile.py b/recipes/civetweb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6f09f10193d23 --- /dev/null +++ b/recipes/civetweb/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, tools, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/civetweb/config.yml b/recipes/civetweb/config.yml new file mode 100644 index 0000000000000..8581197592553 --- /dev/null +++ b/recipes/civetweb/config.yml @@ -0,0 +1,9 @@ +versions: + "1.16": + folder: all + "1.15": + folder: all + "1.14": + folder: all + "1.13": + folder: all diff --git a/recipes/cjson/all/conandata.yml b/recipes/cjson/all/conandata.yml new file mode 100644 index 0000000000000..397bb216165bb --- /dev/null +++ b/recipes/cjson/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.7.15": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.15.tar.gz" + sha256: "5308fd4bd90cef7aa060558514de6a1a4a0819974a26e6ed13973c5f624c24b2" + "1.7.14": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.14.tar.gz" + sha256: "fb50a663eefdc76bafa80c82bc045af13b1363e8f45cec8b442007aef6a41343" + "1.7.13": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz" + sha256: "d4e77a38f540f2c37f55758f2666655314f1f51c716fea5f279659940efdcf04" + "1.7.12": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.12.tar.gz" + sha256: "760687665ab41a5cff9c40b1053c19572bcdaadef1194e5cba1b5e6f824686e7" +patches: + "1.7.12": + - patch_file: "patches/fix-cmake-install.patch" diff --git a/recipes/cjson/all/conanfile.py b/recipes/cjson/all/conanfile.py new file mode 100644 index 0000000000000..e715bfc8ad197 --- /dev/null +++ b/recipes/cjson/all/conanfile.py @@ -0,0 +1,141 @@ +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, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +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" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "utils": [True, False], + "use_locales": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "utils": False, + "use_locales": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("shared cjson is not supported with MT runtime") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_SANITIZERS"] = False + tc.variables["ENABLE_SAFE_STACK"] = False + tc.variables["ENABLE_PUBLIC_SYMBOLS"] = True + tc.variables["ENABLE_HIDDEN_SYMBOLS"] = False + tc.variables["ENABLE_TARGET_EXPORT"] = False + tc.variables["BUILD_SHARED_AND_STATIC_LIBS"] = False + tc.variables["CJSON_OVERRIDE_BUILD_SHARED_LIBS"] = False + tc.variables["ENABLE_CJSON_UTILS"] = self.options.utils + tc.variables["ENABLE_CJSON_TEST"] = False + tc.variables["ENABLE_LOCALES"] = self.options.use_locales + tc.variables["ENABLE_FUZZING"] = False + tc.variables["ENABLE_CUSTOM_COMPILER_FLAGS"] = False + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + targets = {"cjson": "cJSON::cjson"} + if self.options.utils: + targets.update({"cjson_utils": "cJSON::cjson_utils"}) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + targets + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cJSON") + + self.cpp_info.components["_cjson"].set_property("cmake_target_name", "cjson") + self.cpp_info.components["_cjson"].set_property("pkg_config_name", "libcjson") + self.cpp_info.components["_cjson"].libs = ["cjson"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_cjson"].system_libs = ["m"] + + if self.options.utils: + self.cpp_info.components["cjson_utils"].set_property("cmake_target_name", "cjson_utils") + self.cpp_info.components["cjson_utils"].set_property("pkg_config_name", "libcjson_utils") + self.cpp_info.components["cjson_utils"].libs = ["cjson_utils"] + self.cpp_info.components["cjson_utils"].requires = ["_cjson"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "cJSON" + self.cpp_info.names["cmake_find_package_multi"] = "cJSON" + self.cpp_info.components["_cjson"].names["cmake_find_package"] = "cjson" + self.cpp_info.components["_cjson"].names["cmake_find_package_multi"] = "cjson" + self.cpp_info.components["_cjson"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["_cjson"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["_cjson"].names["pkg_config"] = "libcjson" + if self.options.utils: + self.cpp_info.components["cjson_utils"].names["cmake_find_package"] = "cjson_utils" + self.cpp_info.components["cjson_utils"].names["cmake_find_package_multi"] = "cjson_utils" + self.cpp_info.components["cjson_utils"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["cjson_utils"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["cjson_utils"].names["pkg_config"] = "libcjson_utils" diff --git a/recipes/cjson/all/patches/fix-cmake-install.patch b/recipes/cjson/all/patches/fix-cmake-install.patch new file mode 100644 index 0000000000000..9d3b305ebe4d0 --- /dev/null +++ b/recipes/cjson/all/patches/fix-cmake-install.patch @@ -0,0 +1,32 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,7 +149,13 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/library_config/libcjson.pc.in" + + install(FILES cJSON.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/cjson") + install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcjson.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") +-install(TARGETS "${CJSON_LIB}" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" EXPORT "${CJSON_LIB}") ++install(TARGETS "${CJSON_LIB}" ++ EXPORT "${CJSON_LIB}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" ++ INCLUDES DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}" ++) + if (BUILD_SHARED_AND_STATIC_LIBS) + install(TARGETS "${CJSON_LIB}-static" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") + endif() +@@ -186,7 +192,13 @@ if(ENABLE_CJSON_UTILS) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/library_config/libcjson_utils.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/libcjson_utils.pc" @ONLY) + +- install(TARGETS "${CJSON_UTILS_LIB}" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" EXPORT "${CJSON_UTILS_LIB}") ++ install(TARGETS "${CJSON_UTILS_LIB}" ++ EXPORT "${CJSON_UTILS_LIB}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" ++ INCLUDES DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}" ++ ) + if (BUILD_SHARED_AND_STATIC_LIBS) + install(TARGETS "${CJSON_UTILS_LIB}-static" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") + endif() diff --git a/recipes/cjson/all/test_package/CMakeLists.txt b/recipes/cjson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..84258514da5b3 --- /dev/null +++ b/recipes/cjson/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cJSON REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cjson) diff --git a/recipes/cjson/all/test_package/conanfile.py b/recipes/cjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cjson/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/cjson/all/test_package/test_package.c b/recipes/cjson/all/test_package/test_package.c new file mode 100644 index 0000000000000..918d6f464ad71 --- /dev/null +++ b/recipes/cjson/all/test_package/test_package.c @@ -0,0 +1,57 @@ +#include + +#include +#include + +char *create_monitor_with_helpers() { + const unsigned int resolution_numbers[3][2] = { + {1280, 720}, + {1920, 1080}, + {3840, 2160} + }; + char *string = NULL; + cJSON *resolutions = NULL; + size_t index = 0; + + cJSON *monitor = cJSON_CreateObject(); + + if (cJSON_AddStringToObject(monitor, "name", "Awesome 4K") == NULL) { + goto end; + } + + resolutions = cJSON_AddArrayToObject(monitor, "resolutions"); + if (resolutions == NULL) { + goto end; + } + + for (index = 0; index < (sizeof(resolution_numbers) / (2 * sizeof(int))); ++index) { + cJSON *resolution = cJSON_CreateObject(); + + if (cJSON_AddNumberToObject(resolution, "width", resolution_numbers[index][0]) == NULL) { + goto end; + } + + if (cJSON_AddNumberToObject(resolution, "height", resolution_numbers[index][1]) == NULL) { + goto end; + } + + cJSON_AddItemToArray(resolutions, resolution); + } + + string = cJSON_Print(monitor); + if (string == NULL) { + fprintf(stderr, "Failed to print monitor.\n"); + } + +end: + cJSON_Delete(monitor); + return string; +} + +int main() { + char *json = create_monitor_with_helpers(); + printf("%s\n", json); + free(json); + + return 0; +} diff --git a/recipes/cjson/all/test_v1_package/CMakeLists.txt b/recipes/cjson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cjson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cjson/all/test_v1_package/conanfile.py b/recipes/cjson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cjson/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/cjson/config.yml b/recipes/cjson/config.yml new file mode 100644 index 0000000000000..894ac0453b1d4 --- /dev/null +++ b/recipes/cjson/config.yml @@ -0,0 +1,9 @@ +versions: + "1.7.15": + folder: all + "1.7.14": + folder: all + "1.7.13": + folder: all + "1.7.12": + folder: all diff --git a/recipes/clara/all/conandata.yml b/recipes/clara/all/conandata.yml new file mode 100644 index 0000000000000..a3a9d50c8b9f0 --- /dev/null +++ b/recipes/clara/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.5": + url: "https://github.com/catchorg/clara/archive/v1.1.5.tar.gz" + sha256: "767dc1718e53678cbea00977adcd0a8a195802a505aec3c537664cf25a173142" diff --git a/recipes/clara/all/conanfile.py b/recipes/clara/all/conanfile.py new file mode 100644 index 0000000000000..8e0af90e17b97 --- /dev/null +++ b/recipes/clara/all/conanfile.py @@ -0,0 +1,33 @@ +import os +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.46.0" + +class ClaraConan(ConanFile): + name = "clara" + description = "A simple to use, composable, command line parser for C++ 11 and beyond" + homepage = "https://github.com/catchorg/Clara" + topics = ("clara", "cli", "cpp11", "command-parser") + settings = "os", "arch", "compiler", "build_type" + url = "https://github.com/conan-io/conan-center-index" + license = "BSL-1.0" + no_copy_source = True + deprecated = "lyra" + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include"), keep_path=True) + + def package_id(self): + self.info.clear() diff --git a/recipes/clara/all/test_package/CMakeLists.txt b/recipes/clara/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1f340c9983632 --- /dev/null +++ b/recipes/clara/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(clara REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE clara::clara) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/clara/all/test_package/conanfile.py b/recipes/clara/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9ff0633c99a01 --- /dev/null +++ b/recipes/clara/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 + + +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("{} --width 640".format(bin_path), env="conanrun") + self.run("{} --help".format(bin_path), env="conanrun") diff --git a/recipes/clara/all/test_package/test_package.cpp b/recipes/clara/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..52db823717fe3 --- /dev/null +++ b/recipes/clara/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include "clara.hpp" + +#include + +static void printHelp(const clara::Parser &cli) { + auto columns = cli.getHelpColumns(); + for (const auto &column : columns) { + std::cout << column.left << '\t' << column.right << '\n'; + } +} + +int main(int argc, const char * argv []) { + int width = 0; + bool help = false; + auto cli = clara::Opt( width, "width" ) + ["-w"]["--width"] + ("How wide should it be?") + | clara::Help(help); + auto result = cli.parse( clara::Args( argc, argv ) ); + if (!result) { + std::cerr << "Error in command line: " << result.errorMessage() << std::endl; + printHelp(cli); + return 1; + } + if (help) { + printHelp(cli); + return 0; + } + std::cout << "width is " << width << '\n'; + return 0; +} diff --git a/recipes/clara/all/test_v1_package/CMakeLists.txt b/recipes/clara/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/clara/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/clara/all/test_v1_package/conanfile.py b/recipes/clara/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2489ddc6e36c1 --- /dev/null +++ b/recipes/clara/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run("{} --width 640".format(bin_path), run_environment=True) + self.run("{} --help".format(bin_path), run_environment=True) diff --git a/recipes/clara/config.yml b/recipes/clara/config.yml new file mode 100644 index 0000000000000..e48685771bd64 --- /dev/null +++ b/recipes/clara/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.5": + folder: all diff --git a/recipes/clhep/all/conandata.yml b/recipes/clhep/all/conandata.yml new file mode 100644 index 0000000000000..2745e50b6c689 --- /dev/null +++ b/recipes/clhep/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.4.1.3": + url: "https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-2.4.1.3.tgz" + sha256: "27c257934929f4cb1643aa60aeaad6519025d8f0a1c199bc3137ad7368245913" +patches: + "2.4.1.3": + - patch_file: "patches/fix-cmake.patch" + - patch_file: "patches/mingw-support.patch" + - patch_file: "patches/msvc-2015-no-SFINAE.patch" diff --git a/recipes/clhep/all/conanfile.py b/recipes/clhep/all/conanfile.py new file mode 100644 index 0000000000000..693c03e14c222 --- /dev/null +++ b/recipes/clhep/all/conanfile.py @@ -0,0 +1,130 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class ClhepConan(ConanFile): + name = "clhep" + description = "Class Library for High Energy Physics." + license = "LGPL-3.0-only" + topics = ("cern", "hep", "high energy", "physics", "geometry", "algebra") + homepage = "http://proj-clhep.web.cern.ch/proj-clhep" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("CLHEP doesn't properly build its shared libs with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CLHEP_SINGLE_THREAD"] = False + tc.variables["CLHEP_BUILD_DOCS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "CLHEP")) + cmake.build() + + def package(self): + copy(self, "COPYING*", src=os.path.join(self.source_folder, "CLHEP"), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + @property + def _clhep_components(self): + def libm(): + return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def pthread(): + return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + return [ + {"name": "Vector", "system_libs": libm() + pthread()}, + {"name": "Evaluator", "system_libs": libm() + pthread()}, + {"name": "GenericFunctions", "system_libs": libm() + pthread()}, + {"name": "Geometry", "system_libs": libm() + pthread(), "requires": ["vector"]}, + {"name": "Random", "system_libs": libm() + pthread()}, + {"name": "Matrix", "system_libs": libm() + pthread(), "requires": ["random", "vector"]}, + {"name": "RandomObjects", "system_libs": libm(), "requires": ["random", "matrix", "vector"]}, + {"name": "Cast", "system_libs": pthread()}, + {"name": "RefCount", "system_libs": pthread()}, + {"name": "Exceptions", "requires": ["cast", "refcount"]}, + ] + + def package_info(self): + suffix = "" if self.options.shared else "S" + + self.cpp_info.set_property("cmake_file_name", "CLHEP") + self.cpp_info.set_property("cmake_target_name", f"CLHEP::CLHEP{suffix}") + self.cpp_info.set_property("pkg_config_name", "clhep") + + for component in self._clhep_components: + name = component["name"] + conan_comp = name.lower() + cmake_target = f"{name}{suffix}" + pkg_config_name = f"clhep-{name.lower()}" + lib_name = f"CLHEP-{name}-{self.version}" + system_libs = component.get("system_libs", []) + requires = component.get("requires", []) + + self.cpp_info.components[conan_comp].set_property("cmake_target_name", f"CLHEP::{cmake_target}") + self.cpp_info.components[conan_comp].set_property("pkg_config_name", pkg_config_name) + self.cpp_info.components[conan_comp].libs = [lib_name] + self.cpp_info.components[conan_comp].system_libs = system_libs + self.cpp_info.components[conan_comp].requires = requires + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[conan_comp].names["cmake_find_package"] = cmake_target + self.cpp_info.components[conan_comp].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components[conan_comp].names["pkg_config"] = pkg_config_name + self.cpp_info.components["clheplib"].requires.append(conan_comp) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "CLHEP" + self.cpp_info.names["cmake_find_package_multi"] = "CLHEP" + self.cpp_info.names["pkg_config"] = "clhep" + self.cpp_info.components["clheplib"].names["cmake_find_package"] = f"CLHEP{suffix}" + self.cpp_info.components["clheplib"].names["cmake_find_package_multi"] = f"CLHEP{suffix}" + self.cpp_info.components["clheplib"].set_property("cmake_target_name", f"CLHEP::CLHEP{suffix}") + self.cpp_info.components["clheplib"].names["pkg_config"] = "clhep" + self.cpp_info.components["clheplib"].set_property("pkg_config_name", "clhep") diff --git a/recipes/clhep/all/patches/fix-cmake.patch b/recipes/clhep/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..9134806fa720d --- /dev/null +++ b/recipes/clhep/all/patches/fix-cmake.patch @@ -0,0 +1,65 @@ +--- a/CLHEP/CMakeLists.txt ++++ b/CLHEP/CMakeLists.txt +@@ -117,10 +117,8 @@ add_subdirectory(RefCount) + add_subdirectory(Exceptions) + + # libCLHEP.a and libCLHEP.so +-clhep_build_libclhep( ${CLHEP_libraries} ) + + # provide tools for other packages to include CLHEP easily +-clhep_toolchain() + + # - Build docucumentation if required + if(CLHEP_BUILD_DOCS) +@@ -147,4 +145,3 @@ if(CLHEP_BUILD_DOCS) + endif() + + # Custom Packaging +-include(ClhepPackaging) +--- a/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake ++++ b/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake +@@ -30,22 +30,19 @@ macro(clhep_build_library package) + endif() + + # Add the libraries and set properties +- ADD_LIBRARY(${package} SHARED ${CLHEP_${package}_SOURCES}) +- ADD_LIBRARY(${package}S STATIC ${CLHEP_${package}_SOURCES}) ++ # Build shared or static, not both, because: ++ # - slower build ++ # - lot of issues because output names are the same + msvc shared is broken ++ ADD_LIBRARY(${package} ${CLHEP_${package}_SOURCES}) + SET_TARGET_PROPERTIES (${package} + PROPERTIES + OUTPUT_NAME CLHEP-${package}-${VERSION} + ) +- SET_TARGET_PROPERTIES(${package}S +- PROPERTIES +- OUTPUT_NAME CLHEP-${package}-${VERSION} +- ) + + target_link_libraries(${package} ${package_library_list} ) +- target_link_libraries(${package}S ${package_library_list_static} ) + + # Install the libraries +- INSTALL (TARGETS ${package} ${package}S ++ INSTALL (TARGETS ${package} + EXPORT CLHEPLibraryDepends + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib${LIB_SUFFIX} +--- a/CLHEP/cmake/Modules/ClhepBuildTest.cmake ++++ b/CLHEP/cmake/Modules/ClhepBuildTest.cmake +@@ -17,6 +17,8 @@ include(ClhepParseArgs) + + + macro( clhep_test testname ) ++# disable tests ++if(FALSE) + clhep_parse_args( CTST "LIBS;DEPENDS" "SIMPLE;FAIL;NOLIB" ${ARGN}) + + # automake/autoconf variables for ${testname}.sh.in +@@ -68,4 +70,5 @@ macro( clhep_test testname ) + endif() + endif() + ++endif() + endmacro( clhep_test ) diff --git a/recipes/clhep/all/patches/mingw-support.patch b/recipes/clhep/all/patches/mingw-support.patch new file mode 100644 index 0000000000000..733f1ca08915e --- /dev/null +++ b/recipes/clhep/all/patches/mingw-support.patch @@ -0,0 +1,42 @@ +--- a/CLHEP/GenericFunctions/src/AnalyticConvolution.cc ++++ b/CLHEP/GenericFunctions/src/AnalyticConvolution.cc +@@ -4,7 +4,7 @@ + #include "CLHEP/GenericFunctions/Gaussian.hh" + #include "CLHEP/GenericFunctions/Exponential.hh" + #include // for isfinite +-#if (defined _WIN32) ++#ifdef _MSC_VER + #include // Visual C++ _finite + #endif + namespace Genfun { +@@ -78,7 +78,7 @@ double AnalyticConvolution::operator() (double argument) const { + if (_type==SMEARED_NEG_EXP) { + expG = exp((xsigma*xsigma +2*tau*(/*xoffset*/x))/(2.0*tau*tau)) * + erfc((xsigma*xsigma+tau*(/*xoffset*/x))/(sqrtTwo*xsigma*tau))/(2.0*tau); +-#if (defined _WIN32) ++#ifdef _MSC_VER + if (!_finite(expG)) { + expG=0.0; + } +@@ -96,7 +96,7 @@ double AnalyticConvolution::operator() (double argument) const { + + // Both sign distribution=> return smeared exponential: + if (_type==SMEARED_EXP) { +-#if (defined _WIN32) ++#ifdef _MSC_VER + if (!_finite(expG)) { + expG=0.0; + } +--- a/CLHEP/Random/src/DRand48Engine.cc ++++ b/CLHEP/Random/src/DRand48Engine.cc +@@ -38,6 +38,10 @@ + #include // for strcmp + #include // for std::abs(int) + ++#if !defined(HAVE_DRAND48) && defined(__MINGW32__) ++#include "drand48.src" ++#endif ++ + //#define TRACE_IO + + namespace CLHEP { diff --git a/recipes/clhep/all/patches/msvc-2015-no-SFINAE.patch b/recipes/clhep/all/patches/msvc-2015-no-SFINAE.patch new file mode 100644 index 0000000000000..be0eaf20ead86 --- /dev/null +++ b/recipes/clhep/all/patches/msvc-2015-no-SFINAE.patch @@ -0,0 +1,67 @@ +--- a/CLHEP/Geometry/Geometry/BasicVector3D.h ++++ b/CLHEP/Geometry/Geometry/BasicVector3D.h +@@ -52,6 +52,7 @@ namespace HepGeom { + * Constructor from three numbers. */ + BasicVector3D(T x1, T y1, T z1) { v_[0] = x1; v_[1] = y1; v_[2] = z1; } + ++#if !defined(_MSC_VER) || _MSC_VER >= 1910 + /** + * Copy constructor. */ + BasicVector3D(const BasicVector3D &) = default; +@@ -67,6 +68,11 @@ namespace HepGeom { + /** + * Move constructor. */ + BasicVector3D(BasicVector3D &&) = default; ++#else ++ BasicVector3D(const BasicVector3D & v) { ++ v_[0] = v.x(); v_[1] = v.y(); v_[2] = v.z(); ++ } ++#endif + + /** + * Destructor. */ +@@ -98,9 +104,11 @@ namespace HepGeom { + /** + * Assignment. */ + BasicVector3D & operator= (const BasicVector3D &) = default; ++#if !defined(_MSC_VER) || _MSC_VER >= 1910 + /** + * Move assignment. */ + BasicVector3D & operator= (BasicVector3D &&) = default; ++#endif + /** + * Addition. */ + BasicVector3D & operator+=(const BasicVector3D & v) { +--- a/CLHEP/Geometry/Geometry/Plane3D.h ++++ b/CLHEP/Geometry/Geometry/Plane3D.h +@@ -54,6 +54,7 @@ namespace HepGeom { + a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1; + } + ++#if !defined(_MSC_VER) || _MSC_VER >= 1910 + /** + * Copy constructor. */ + Plane3D(const Plane3D &) = default; +@@ -68,6 +69,10 @@ namespace HepGeom { + /** + * Move constructor. */ + Plane3D(Plane3D &&) = default; ++#else ++ Plane3D(const Plane3D & p) ++ : a_(p.a_), b_(p.b_), c_(p.c_), d_(p.d_) {} ++#endif + + /** + * Destructor. */ +@@ -77,9 +82,11 @@ namespace HepGeom { + * Assignment. */ + Plane3D & operator=(const Plane3D &) = default; + ++#if !defined(_MSC_VER) || _MSC_VER >= 1910 + /** + * Move assignment. */ + Plane3D & operator=(Plane3D &&) = default; ++#endif + + /** + * Returns the a-coefficient in the plane equation: a*x+b*y+c*z+d=0. */ diff --git a/recipes/clhep/all/test_package/CMakeLists.txt b/recipes/clhep/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a757fede3cd0c --- /dev/null +++ b/recipes/clhep/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(CLHEP REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET CLHEP::CLHEPS) + target_link_libraries(${PROJECT_NAME} PRIVATE CLHEP::CLHEPS) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE CLHEP::CLHEP) +endif() diff --git a/recipes/clhep/all/test_package/conanfile.py b/recipes/clhep/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/clhep/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/clhep/all/test_package/test_package.cpp b/recipes/clhep/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f344579c0dc4d --- /dev/null +++ b/recipes/clhep/all/test_package/test_package.cpp @@ -0,0 +1,85 @@ +#include "CLHEP/Matrix/Matrix.h" + +#include +#include +#include +#include +#include + +#include + +void check_matrix_component() { + std::cout << "======================" << std::endl; + std::cout << "Check Matrix component" << std::endl; + std::cout << "======================" << std::endl; + + CLHEP::HepMatrix mtr(7, 7, 0); + for (int i = 1; i < 8; ++i) { + for (int j = 1; j < 8; ++j) { + if (i <= j) { + mtr(i, j) = 10 * i + j; + mtr(j, i) = 10 * j + i; + } + } + } + + std::cout << "Initial matrix " << mtr << std::endl; + std::cout << "Sub (1,4,1,4)" << mtr.sub(1, 4, 1, 4) << std::endl; +} + +void check_random_component() { + std::cout << "======================" << std::endl; + std::cout << "Check Random component" << std::endl; + std::cout << "======================" << std::endl; + + int ntest = 10; + + std::cout << "DEBUG: ntest=" << ntest << std::endl; + + double sum_rnd1 = 0; + for (int i = 0; i < ntest; ++i) { + double g = CLHEP::RandGauss::shoot(); + sum_rnd1 += g; + } + sum_rnd1 /= ntest; + std::cout << "DEBUG: avg RandGauss=" << sum_rnd1 << std::endl; + + double sum_rnd2 = 0; + for (int i = 0; i < ntest; ++i) { + double g = CLHEP::RandGaussQ::shoot(); + sum_rnd2 += g; + } + sum_rnd2 /= ntest; + std::cout << "DEBUG: avg RandGaussQ=" << sum_rnd2 << std::endl; + + double sum_zig = 0; + for(int i = 0; i < ntest; ++i) { + double g = CLHEP::RandGaussZiggurat::shoot(); + sum_zig += g; + } + sum_zig /= ntest; + std::cout << "DEBUG: avg RandGaussZiggurat=" << sum_zig << std::endl; + + double sum_exp = 0; + for (int i = 0; i < ntest; ++i) { + double g = CLHEP::RandExponential::shoot(); + sum_exp += g; + } + sum_exp /= ntest; + std::cout << "DEBUG: avg RandExponential=" << sum_exp << std::endl; + + double sum_expZ = 0; + for (int i = 0; i < ntest; ++i) { + double g = CLHEP::RandExpZiggurat::shoot(); + sum_expZ += g; + } + sum_expZ /= ntest; + std::cout << "DEBUG: avg RandExpZiggurat=" << sum_expZ << std::endl; +} + +int main() { + check_matrix_component(); + check_random_component(); + + return 0; +} diff --git a/recipes/clhep/all/test_v1_package/CMakeLists.txt b/recipes/clhep/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/clhep/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/clhep/all/test_v1_package/conanfile.py b/recipes/clhep/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/clhep/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/clhep/config.yml b/recipes/clhep/config.yml new file mode 100644 index 0000000000000..e3d64184919ef --- /dev/null +++ b/recipes/clhep/config.yml @@ -0,0 +1,3 @@ +versions: + "2.4.1.3": + folder: all diff --git a/recipes/cli11/all/conandata.yml b/recipes/cli11/all/conandata.yml new file mode 100644 index 0000000000000..fb856253269aa --- /dev/null +++ b/recipes/cli11/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "2.3.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.2.tar.gz" + sha256: "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22" + "2.3.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.1.tar.gz" + sha256: "378da73d2d1d9a7b82ad6ed2b5bda3e7bc7093c4034a1d680a2e009eb067e7b2" + "2.3.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.0.tar.gz" + sha256: "b6e116ca1555e2b7f2743fd41e3bd18149baae791acd98eb653e5b07e0f20561" + "2.2.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.2.0.tar.gz" + sha256: "d60440dc4d43255f872d174e416705f56ba40589f6eb07727f76376fb8378fd6" + "2.1.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.1.2.tar.gz" + sha256: "26291377e892ba0e5b4972cdfd4a2ab3bf53af8dac1f4ea8fe0d1376b625c8cb" + "2.1.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.1.1.tar.gz" + sha256: "d69023d1d0ab6a22be86b4f59d449422bc5efd9121868f4e284d6042e52f682e" + "2.0.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.0.0.tar.gz" + sha256: "2c672f17bf56e8e6223a3bfb74055a946fa7b1ff376510371902adb9cb0ab6a3" + "1.9.1": + url: "https://github.com/CLIUtils/CLI11/archive/v1.9.1.tar.gz" + sha256: "c780cf8cf3ba5ec2648a7eeb20a47e274493258f38a9b417628e0576f473a50b" diff --git a/recipes/cli11/all/conanfile.py b/recipes/cli11/all/conanfile.py new file mode 100644 index 0000000000000..6ccc240eeda4f --- /dev/null +++ b/recipes/cli11/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.52.0" + +class CLI11Conan(ConanFile): + name = "cli11" + homepage = "https://github.com/CLIUtils/CLI11" + description = "A command line parser for C++11 and beyond." + topics = "cli-parser", "cpp11", "no-dependencies", "cli", "header-only" + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + settings = "os", "compiler", "build_type", "arch" + + @property + def _min_cppstd(self): + return "11" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def layout(self): + 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["CLI11_BUILD_EXAMPLES"] = False + tc.variables["CLI11_BUILD_TESTS"] = False + tc.variables["CLI11_BUILD_DOCS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + # since 2.1.1 + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CLI11") + self.cpp_info.set_property("cmake_target_name", "CLI11::CLI11") + self.cpp_info.set_property("pkg_config_name", "CLI11") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "CLI11" + self.cpp_info.names["cmake_find_package_multi"] = "CLI11" + self.cpp_info.names["pkg_config"] = "CLI11" diff --git a/recipes/cli11/all/test_package/CMakeLists.txt b/recipes/cli11/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b06b681b8997 --- /dev/null +++ b/recipes/cli11/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(CLI11 REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE CLI11::CLI11) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cli11/all/test_package/conanfile.py b/recipes/cli11/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/cli11/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/cli11/all/test_package/test_package.cpp b/recipes/cli11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..16755e51f85ad --- /dev/null +++ b/recipes/cli11/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include + +int main(int argc, char **argv) { + int count{0}; + int v{0}; + double value{0.0}; // = 3.14; + std::string file; + CLI::App app("K3Pi goofit fitter"); + + CLI::Option *opt = app.add_option("-f,--file,file", file, "File name"); + CLI::Option *copt = app.add_option("-c,--count", count, "Counter"); + CLI::Option *flag = app.add_flag("--flag", v, "Some flag that can be passed multiple times"); + + app.add_option("-d,--double", value, "Some Value"); + CLI11_PARSE(app, argc, argv); + + std::cout << "Working on file: " << file << ", direct count: " << app.count("--file") + << ", opt count: " << opt->count() << std::endl; + std::cout << "Working on count: " << count << ", direct count: " << app.count("--count") + << ", opt count: " << copt->count() << std::endl; + std::cout << "Received flag: " << v << " (" << flag->count() << ") times\n"; + std::cout << "Some value: " << value << std::endl; + + return 0; +} diff --git a/recipes/cli11/all/test_v1_package/CMakeLists.txt b/recipes/cli11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..145dcc03e0f3d --- /dev/null +++ b/recipes/cli11/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cli11/all/test_v1_package/conanfile.py b/recipes/cli11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b30e638816fc5 --- /dev/null +++ b/recipes/cli11/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_find_package_multi", "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/cli11/config.yml b/recipes/cli11/config.yml new file mode 100644 index 0000000000000..37bc8ba7326b9 --- /dev/null +++ b/recipes/cli11/config.yml @@ -0,0 +1,17 @@ +versions: + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.1.2": + folder: all + "2.1.1": + folder: all + "2.0.0": + folder: all + "1.9.1": + folder: all diff --git a/recipes/clipp/all/conandata.yml b/recipes/clipp/all/conandata.yml new file mode 100644 index 0000000000000..0301641061f49 --- /dev/null +++ b/recipes/clipp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.3": + url: "https://github.com/muellan/clipp/archive/v1.2.3.tar.gz" + sha256: 73DA8E3D354FECECDEA99F7DEB79D0343647349563ACE3EAFB7F4CCA6E86E90B diff --git a/recipes/clipp/all/conanfile.py b/recipes/clipp/all/conanfile.py new file mode 100644 index 0000000000000..2a4b7c31a6543 --- /dev/null +++ b/recipes/clipp/all/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile, tools + + +required_conan_version = ">=1.50.0" + +class ClippConan(ConanFile): + name = "clipp" + description = """Easy to use, powerful & expressive command line argument parsing for modern C++ / single header / usage & doc generation.""" + topics = ("clipp", "argparse", "cli", "usage", "options", "subcommands") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/muellan/clipp" + license = "MIT" + no_copy_source = True + + def source(self): + tools.files.get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + tools.files.copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + tools.files.copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_id(self): + self.info.clear() diff --git a/recipes/clipp/all/test_package/CMakeLists.txt b/recipes/clipp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..829b5ca81b9ce --- /dev/null +++ b/recipes/clipp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/clipp/all/test_package/conanfile.py b/recipes/clipp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..70924c438164e --- /dev/null +++ b/recipes/clipp/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +import os +from conans import CMake +from conan import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.build.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/clipp/all/test_package/test_package.cpp b/recipes/clipp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ad416dc114b00 --- /dev/null +++ b/recipes/clipp/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include "clipp.h" +using namespace clipp; using std::cout; using std::string; + +int main(int argc, char* argv[]) { + bool rec = false, utf16 = false; + string infile = "", fmt = "csv"; + + auto cli = ( + value("input file", infile), + option("-r", "--recursive").set(rec).doc("convert files recursively"), + option("-o") & value("output format", fmt), + option("-utf16").set(utf16).doc("use UTF-16 encoding") + ); + + if(!parse(argc, argv, cli)) cout << make_man_page(cli, argv[0]); +} diff --git a/recipes/clipp/config.yml b/recipes/clipp/config.yml new file mode 100644 index 0000000000000..81ff4bc37c872 --- /dev/null +++ b/recipes/clipp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.3": + folder: "all" diff --git a/recipes/clipper/all/conandata.yml b/recipes/clipper/all/conandata.yml new file mode 100644 index 0000000000000..00528d6271889 --- /dev/null +++ b/recipes/clipper/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "6.4.2": + url: "https://sourceforge.net/projects/polyclipping/files/clipper_ver6.4.2.zip" + sha256: "a14320d82194807c4480ce59c98aa71cd4175a5156645c4e2b3edd330b930627" + "4.10.0": + url: "https://sourceforge.net/projects/polyclipping/files/Older%20versions/clipper_ver4.10.0.zip" + sha256: "4530e01006d02507a41f7eeaefa758c8067a94a7a0d6e0381fadfa40bc0cf248" +patches: + "6.4.2": + - patch_file: "patches/0001-include-install-directory-6.x.patch" + "4.10.0": + - patch_file: "patches/0001-include-install-directory-4.x.patch" diff --git a/recipes/clipper/all/conanfile.py b/recipes/clipper/all/conanfile.py new file mode 100644 index 0000000000000..7b0a2de7fb05b --- /dev/null +++ b/recipes/clipper/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class ClipperConan(ConanFile): + name = "clipper" + description = "Clipper is an open source freeware polygon clipping library" + license = "BSL-1.0" + topics = ("clipping", "polygon") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.angusj.com/delphi/clipper.php" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + # Export symbols for msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cpp")) + cmake.build() + + def package(self): + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "polyclipping") + self.cpp_info.libs = ["polyclipping"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed. + # Do not use these CMake names in CMakeDeps, it was a mistake, + # clipper doesn't provide CMake config file + self.cpp_info.names["cmake_find_package"] = "polyclipping" + self.cpp_info.names["cmake_find_package_multi"] = "polyclipping" diff --git a/recipes/clipper/all/patches/0001-include-install-directory-4.x.patch b/recipes/clipper/all/patches/0001-include-install-directory-4.x.patch new file mode 100644 index 0000000000000..6a1c973c90a92 --- /dev/null +++ b/recipes/clipper/all/patches/0001-include-install-directory-4.x.patch @@ -0,0 +1,9 @@ +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -10,4 +10,4 @@ + + # The header name clipper.hpp is too generic, so install in a subdirectory + INSTALL (FILES clipper.hpp DESTINATION include/polyclipping) +-INSTALL (TARGETS polyclipping LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + diff --git a/recipes/clipper/all/patches/0001-include-install-directory-6.x.patch b/recipes/clipper/all/patches/0001-include-install-directory-6.x.patch new file mode 100644 index 0000000000000..08039ddb3ddd0 --- /dev/null +++ b/recipes/clipper/all/patches/0001-include-install-directory-6.x.patch @@ -0,0 +1,13 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 32293cb..9382d3e 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -15,7 +15,7 @@ ADD_LIBRARY(polyclipping clipper.cpp) + CONFIGURE_FILE (polyclipping.pc.cmakein "${PCFILE}" @ONLY) + + INSTALL (FILES clipper.hpp DESTINATION "${CMAKE_INSTALL_INCDIR}") +-INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + INSTALL (FILES "${PCFILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}") + + SET_TARGET_PROPERTIES(polyclipping PROPERTIES VERSION 22.0.0 SOVERSION 22 ) diff --git a/recipes/clipper/all/test_package/CMakeLists.txt b/recipes/clipper/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb269d6010aa1 --- /dev/null +++ b/recipes/clipper/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(clipper REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE clipper::clipper) +target_compile_definitions(${PROJECT_NAME} PRIVATE CLIPPER_MAJOR_VERSION=${CLIPPER_MAJOR_VERSION}) diff --git a/recipes/clipper/all/test_package/conanfile.py b/recipes/clipper/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3238612bed7d0 --- /dev/null +++ b/recipes/clipper/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CLIPPER_MAJOR_VERSION"] = Version(self.dependencies["clipper"].ref.version).major + 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/clipper/all/test_package/test_package.cpp b/recipes/clipper/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..df4f8a3365269 --- /dev/null +++ b/recipes/clipper/all/test_package/test_package.cpp @@ -0,0 +1,67 @@ +#include "polyclipping/clipper.hpp" +#include + +using namespace ClipperLib; + +int main() { + +#if CLIPPER_MAJOR_VERSION == 6 + + //from clipper.hpp ... + //typedef signed long long cInt; + //struct IntPoint {cInt X; cInt Y;}; + //typedef std::vector Path; + //typedef std::vector Paths; + + Paths subj(2), clip(1), solution; + + //define outer blue 'subject' polygon + subj[0] << + IntPoint(180,200) << IntPoint(260,200) << + IntPoint(260,150) << IntPoint(180,150); + + //define subject's inner triangular 'hole' (with reverse orientation) + subj[1] << + IntPoint(215,160) << IntPoint(230,190) << IntPoint(200,190); + + //define orange 'clipping' polygon + clip[0] << + IntPoint(190,210) << IntPoint(240,210) << + IntPoint(240,130) << IntPoint(190,130); + + //perform intersection ... + Clipper c; + c.AddPaths(subj, ptSubject, true); + c.AddPaths(clip, ptClip, true); + c.Execute(ctIntersection, solution, pftNonZero, pftNonZero); + +#else + + Polygons subj(2), clip(1), solution; + return 0; + + //define outer blue 'subject' polygon + subj[0].push_back(IntPoint(180,200)); + subj[0].push_back(IntPoint(260,200)); + subj[0].push_back(IntPoint(260,150)); + subj[0].push_back(IntPoint(180,150)); + + //define subject's inner triangular 'hole' (with reverse orientation) + subj[1].push_back(IntPoint(215,160)); + subj[1].push_back(IntPoint(230,190)); + subj[1].push_back(IntPoint(200,190)); + + //define orange 'clipping' polygon + clip[0].push_back(IntPoint(190,210)); + clip[0].push_back(IntPoint(240,210)); + clip[0].push_back(IntPoint(240,130)); + clip[0].push_back(IntPoint(190,130)); + + Clipper c; + c.AddPolygons(subj, ptSubject); + c.AddPolygons(clip, ptClip); + c.Execute(ctIntersection, solution, pftNonZero, pftNonZero); + +#endif + +} diff --git a/recipes/clipper/all/test_v1_package/CMakeLists.txt b/recipes/clipper/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5a89ce2e8d32a --- /dev/null +++ b/recipes/clipper/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(polyclipping REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE polyclipping::polyclipping) +target_compile_definitions(${PROJECT_NAME} PRIVATE CLIPPER_MAJOR_VERSION=${CLIPPER_MAJOR_VERSION}) diff --git a/recipes/clipper/all/test_v1_package/conanfile.py b/recipes/clipper/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d963e4448d15a --- /dev/null +++ b/recipes/clipper/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["CLIPPER_MAJOR_VERSION"] = tools.Version(self.deps_cpp_info["clipper"].version).major + 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/clipper/config.yml b/recipes/clipper/config.yml new file mode 100644 index 0000000000000..b53e32183cb28 --- /dev/null +++ b/recipes/clipper/config.yml @@ -0,0 +1,5 @@ +versions: + "6.4.2": + folder: all + "4.10.0": + folder: all diff --git a/recipes/clove-unit/all/conandata.yml b/recipes/clove-unit/all/conandata.yml new file mode 100644 index 0000000000000..8be6c1dd9a952 --- /dev/null +++ b/recipes/clove-unit/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.4.0": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.0.tar.gz" + sha256: d5005854d7b3b6ed1b470c2df353fadd80a2ed5a80bb85efc074b9d55315e78d + "2.3.0": + url: "https://github.com/fdefelici/clove-unit/archive/v2.3.0.tar.gz" + sha256: ca94d33643bbe1ff2205f7e6405f3e9c5a95d2f3a076a126814e64b46e3cce8e + "2.2.4": + url: "https://github.com/fdefelici/clove-unit/archive/v2.2.4.tar.gz" + sha256: 0341f13b3e897952f1643eea2ca70cf014c4a086cf83375270980ac05f9d51aa + "2.2.3": + url: "https://github.com/fdefelici/clove-unit/archive/v2.2.3.tar.gz" + sha256: 65f80d600ddec35f7ba70370f10e2df268d68c589e5cddbdcad815b6dbb61dfd diff --git a/recipes/clove-unit/all/conanfile.py b/recipes/clove-unit/all/conanfile.py new file mode 100644 index 0000000000000..630528ab512d9 --- /dev/null +++ b/recipes/clove-unit/all/conanfile.py @@ -0,0 +1,37 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + +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") + homepage = "https://github.com/fdefelici/clove-unit" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + no_copy_source = True + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "clove-unit.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/clove-unit/all/test_package/CMakeLists.txt b/recipes/clove-unit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b669b3ad30d6 --- /dev/null +++ b/recipes/clove-unit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(clove-unit CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE clove-unit::clove-unit) + diff --git a/recipes/clove-unit/all/test_package/conanfile.py b/recipes/clove-unit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fb5d7dc241b5a --- /dev/null +++ b/recipes/clove-unit/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/clove-unit/all/test_package/test_package.cpp b/recipes/clove-unit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4d57d1c55fccb --- /dev/null +++ b/recipes/clove-unit/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + const char* version = __CLOVE_VERSION; + if (version) return 0; + return 1; +} + + diff --git a/recipes/clove-unit/all/test_v1_package/CMakeLists.txt b/recipes/clove-unit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e4401df6124d --- /dev/null +++ b/recipes/clove-unit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) + diff --git a/recipes/clove-unit/all/test_v1_package/conanfile.py b/recipes/clove-unit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e264aad8e8ec --- /dev/null +++ b/recipes/clove-unit/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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/clove-unit/config.yml b/recipes/clove-unit/config.yml new file mode 100644 index 0000000000000..48ff824f79074 --- /dev/null +++ b/recipes/clove-unit/config.yml @@ -0,0 +1,9 @@ +versions: + "2.4.0": + folder: "all" + "2.3.0": + folder: "all" + "2.2.4": + folder: "all" + "2.2.3": + folder: "all" diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml new file mode 100644 index 0000000000000..54adb8af58aa6 --- /dev/null +++ b/recipes/cmake/3.x.x/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.19.8": + url: https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8.tar.gz + sha256: 09b4fa4837aae55c75fb170f6a6e2b44818deba48335d1969deddfbb34e30369 + "3.20.6": + url: https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6.tar.gz + sha256: a0bd485e1a38dd13c0baec89d5f4adbf61c7fd32fddb38eabc69a75bc0b65d72 + "3.21.7": + url: https://github.com/Kitware/CMake/releases/download/v3.21.7/cmake-3.21.7.tar.gz + sha256: 3523c4a5afc61ac3d7c92835301cdf092129c9b672a6ee17e68c92e928c1375a + "3.22.6": + url: https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6.tar.gz + sha256: 73933163670ea4ea95c231549007b0c7243282293506a2cf4443714826ad5ec3 + "3.23.5": + url: "https://github.com/Kitware/CMake/releases/download/v3.23.5/cmake-3.23.5.tar.gz" + sha256: "f2944cde7a140b992ba5ccea2009a987a92413762250de22ebbace2319a0f47d" + "3.24.3": + url: "https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3.tar.gz" + sha256: "b53aa10fa82bff84ccdb59065927b72d3bee49f4d86261249fc0984b3b367291" + "3.25.2": + url: "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz" + sha256: "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c" diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py new file mode 100644 index 0000000000000..f6de583315097 --- /dev/null +++ b/recipes/cmake/3.x.x/conanfile.py @@ -0,0 +1,166 @@ +from conan import ConanFile +from conan.tools.files import chdir, copy, rmdir, get, save, load +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.build import build_jobs, cross_building, check_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +import os +import json + +required_conan_version = ">=1.51.0" + +class CMakeConan(ConanFile): + name = "cmake" + package_type = "application" + description = "Conan installer for CMake" + topics = ("cmake", "build", "installer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Kitware/CMake" + license = "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + + options = { + "with_openssl": [True, False], + "bootstrap": [True, False], + } + default_options = { + "with_openssl": True, + "bootstrap": False, + } + + def config_options(self): + if self.settings.os == "Windows": + self.options.with_openssl = False + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/1.1.1t") + + def validate_build(self): + if self.settings.os == "Windows" and self.options.bootstrap: + raise ConanInvalidConfiguration("CMake does not support bootstrapping on Windows") + + minimal_cpp_standard = "11" + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + + minimal_version = { + "gcc": "4.8", + "clang": "3.3", + "apple-clang": "9", + "Visual Studio": "14", + "msvc": "190", + } + + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warning( + f"{self.name} recipe lacks information about the {compiler} compiler standard version support") + self.output.warning( + f"{self.name} requires a compiler that supports at least C++{minimal_cpp_standard}") + return + + version = Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++{minimal_cpp_standard}") + + def validate(self): + if self.settings.os == "Macos" and self.settings.arch == "x86": + raise ConanInvalidConfiguration("CMake does not support x86 for macOS") + + def layout(self): + if self.options.bootstrap: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + rmdir(self, os.path.join(self.source_folder, "Tests", "RunCMake", "find_package")) + + def generate(self): + if self.options.bootstrap: + tc = AutotoolsToolchain(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + bootstrap_cmake_options = ["--"] + bootstrap_cmake_options.append(f'-DCMAKE_CXX_STANDARD={"11" if not self.settings.compiler.cppstd else self.settings.compiler.cppstd}') + if self.settings.os == "Linux": + if self.options.with_openssl: + openssl = self.dependencies["openssl"] + bootstrap_cmake_options.append("-DCMAKE_USE_OPENSSL=ON") + bootstrap_cmake_options.append(f'-DOPENSSL_USE_STATIC_LIBS={"FALSE" if openssl.options.shared else "TRUE"}') + bootstrap_cmake_options.append(f'-DOPENSSL_ROOT_DIR={openssl.package_path}') + else: + bootstrap_cmake_options.append("-DCMAKE_USE_OPENSSL=OFF") + save(self, "bootstrap_args", json.dumps({"bootstrap_cmake_options": ' '.join(arg for arg in bootstrap_cmake_options)})) + else: + tc = CMakeToolchain(self) + # Disabling testing because CMake tests build can fail in Windows in some cases + tc.variables["BUILD_TESTING"] = False + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.variables["CMAKE_BOOTSTRAP"] = False + if self.settings.os == "Linux": + tc.variables["CMAKE_USE_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + openssl = self.dependencies["openssl"] + tc.variables["OPENSSL_USE_STATIC_LIBS"] = not openssl.options.shared + if cross_building(self): + tc.variables["HAVE_POLL_FINE_EXITCODE"] = '' + tc.variables["HAVE_POLL_FINE_EXITCODE__TRYRUN_OUTPUT"] = '' + # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 + # C3I workaround to force CMake to choose the highest version of + # the windows SDK available in the system + if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + tc.generate() + tc = CMakeDeps(self) + # CMake try_compile failure: https://github.com/conan-io/conan-center-index/pull/16073#discussion_r1110037534 + tc.set_property("openssl", "cmake_find_mode", "module") + tc.generate() + + + def build(self): + if self.options.bootstrap: + toolchain_file_content = json.loads(load(self, os.path.join(self.generators_folder, "bootstrap_args"))) + bootstrap_cmake_options = toolchain_file_content.get("bootstrap_cmake_options") + with chdir(self, self.source_folder): + self.run(f'./bootstrap --prefix="" --parallel={build_jobs(self)} {bootstrap_cmake_options}') + autotools = Autotools(self) + autotools.make() + else: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "Copyright.txt", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False) + if self.options.bootstrap: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) + + def package_id(self): + del self.info.settings.compiler + del self.info.options.bootstrap + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # Needed for compatibility with v1.x - Remove when 2.0 becomes the default + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/recipes/cmake/3.x.x/test_package/conanfile.py b/recipes/cmake/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..df50a01c37d6f --- /dev/null +++ b/recipes/cmake/3.x.x/test_package/conanfile.py @@ -0,0 +1,24 @@ +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + # Third arg to self.run renamed "stdout" in Conan 2.0 but 1.x linter doesn't like it + self.run("cmake --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/3.x.x/test_v1_package/conanfile.py b/recipes/cmake/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df9415b7cf880 --- /dev/null +++ b/recipes/cmake/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output=output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml new file mode 100644 index 0000000000000..00a43300159e0 --- /dev/null +++ b/recipes/cmake/binary/conandata.yml @@ -0,0 +1,138 @@ +sources: + "3.26.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-aarch64.tar.gz" + sha256: "7a4fbe374475db1a098b632b54e3c9180973e8a791c700deabe5408ae23ea3ce" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-x86_64.tar.gz" + sha256: "28d4d1d0db94b47d8dfd4f7dec969a3c747304f4a28ddd6fd340f553f2384dc2" + Macos: + universal: + url: "https://cmake.org/files/v3.26/cmake-3.26.3-macos10.10-universal.tar.gz" + sha256: "b0d39ae9ddec3f193f50ff549edb30d0b35acb6c95c12f7611dbc8afc52c8ab6" + Windows: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-arm64.zip" + sha256: "fd1d908ea54a081a092bc7f9dad0a6ba90fc5aa2644ee5cef901e3f925fce3d8" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-x86_64.zip" + sha256: "91a418595cc9a97d5f679e36728dfec79ee52980f51e8814ec7b05b890708523" + "3.25.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-linux-aarch64.tar.gz" + sha256: "cd6e853639f858569e22e6298f009eb24b4702c51c0d5bc1cb36c688f7ce246d" + x86_64: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-linux-x86_64.tar.gz" + sha256: "d4d2ba83301b215857d3b6590cd4434a414fa151c5807693abe587bd6c03581e" + Macos: + universal: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-macos10.10-universal.tar.gz" + sha256: "ea37a83cd329224c38a1938d2cf7b2656ad971dea9cf759238652746213661f8" + Windows: + armv8: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-windows-arm64.zip" + sha256: "3498fea26257eebfbfc89ed17963f3d8d83c19362b90fb23517842de777a522a" + x86_64: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-windows-x86_64.zip" + sha256: "d129425d569140b729210f3383c246dec19c4183f7d0afae1837044942da3b4b" + "3.24.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-linux-aarch64.tar.gz" + sha256: "86f823f2636bf715af89da10e04daa476755a799d451baee66247846e95d7bee" + x86_64: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-linux-x86_64.tar.gz" + sha256: "cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19" + Macos: + universal: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-macos10.10-universal.tar.gz" + sha256: "3cda3995d6ea06a9d05dfaac633006754d6df5d80cd3d08bf4c284507a550496" + Windows: + armv8: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-windows-arm64.zip" + sha256: "55e81f0c95b06a4435b708cdee7d5739e38cc29c909d3d3134c1a3117e09b965" + x86_64: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-windows-x86_64.zip" + sha256: "c135c7ab78143c46e6686b1e9652bc1dd07e0cf71fd4decee777cdca77019c39" + "3.23.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-linux-aarch64.tar.gz" + sha256: "dcf25a81de6bd4e646389a0635b050ed04d0f27e4f07ae22d975391f38f3c4b8" + x86_64: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-linux-x86_64.tar.gz" + sha256: "bbd7ad93d2a14ed3608021a9466ae63db76a24efd1fae7a5f7798c1de7ab9344" + Macos: + universal: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-macos10.10-universal.tar.gz" + sha256: "d3b44c59e72ef9cc13f7a4642de56e69b1b33fc3a6bb003b59b7f2036ace7e03" + Windows: + x86_64: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-windows-x86_64.zip" + sha256: "51c75f93ebfe295701df205e5e78808b1e707996b26b5c26c3f680ab7b543881" + "3.22.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-linux-aarch64.tar.gz" + sha256: "79be85d3e76565faacd60695cee11d030f7e7dd8691476144fa25eb93dbd0397" + x86_64: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.tar.gz" + sha256: "09e1b34026c406c5bf4d1b053eadb3a8519cb360e37547ebf4b70ab766d94fbc" + Macos: + universal: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-macos10.10-universal.tar.gz" + sha256: "873d296000b2fbd5cd306a3455fddc254b485cad988c67bf4ee0ba4fd7a1e057" + Windows: + x86_64: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-windows-x86_64.zip" + sha256: "48bcc3e71e918b72e2682f9ca9d44dd6c416379071c1ecb530d0633374f91f15" + "3.21.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-linux-aarch64.tar.gz" + sha256: "fa7e82170391c71dcc958ff57a63e9d6be9742a8b85a8b1386da9e571980474a" + x86_64: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-linux-x86_64.tar.gz" + sha256: "f84e209d903a96e54f398bb8760693969b13fc50bce2f8278a9ee9dca01406b2" + Macos: + universal: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-macos10.10-universal.tar.gz" + sha256: "d79775e35efca40ff1d213155c2d5e2e028d0ce376c5089c97f2fe3c6133af1d" + Windows: + x86_64: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-windows-x86_64.zip" + sha256: "4c4840e2dc2bf82e8a16081ff506bba54f3a228b91ce36317129fed4035ef2e3" + "3.20.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-linux-aarch64.tar.gz" + sha256: "9ac2035174d3c62827c85fb052372d70cf35fb565e8d47b8241fbe451c29b2f2" + x86_64: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-linux-x86_64.tar.gz" + sha256: "458777097903b0f35a0452266b923f0a2f5b62fe331e636e2dcc4b636b768e36" + Macos: + universal: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-macos10.10-universal.tar.gz" + sha256: "e75e95c10089b54fe0a7dfb369a87214e8a0ffb46d0fcf6a9678b38140dba983" + Windows: + x86_64: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-windows-x86_64.zip" + sha256: "f240a38c964712aac474644b3ba21bdc2b4e8d5e31179f67bd2e6f45fa349419" + "3.19.8": + Linux: + armv8: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-Linux-aarch64.tar.gz" + sha256: "807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1" + x86_64: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.tar.gz" + sha256: "db0d7d225150dd6e08ce54995e671f9b4801b8e93e22df1eef52339f6bbbecd9" + Macos: + universal: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-macos10.10-universal.tar.gz" + sha256: "ea82f1a7c77d4d2a09ae6c80cbb5e419560bfe371f40b605d13ff1a861d7d6e1" + Windows: + x86_64: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-win64-x64.zip" + sha256: "2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380" diff --git a/recipes/cmake/binary/conanfile.py b/recipes/cmake/binary/conanfile.py new file mode 100644 index 0000000000000..13c7ebecd34ef --- /dev/null +++ b/recipes/cmake/binary/conanfile.py @@ -0,0 +1,66 @@ +import os + +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.51.0" + +class CMakeConan(ConanFile): + name = "cmake" + package_type = "application" + description = "CMake, the cross-platform, open-source build system." + topics = ("build", "installer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Kitware/CMake" + license = "BSD-3-Clause" + settings = "os", "arch" + + def validate(self): + if self.settings.arch not in ["x86_64", "armv8"]: + raise ConanInvalidConfiguration("CMake binaries are only provided for x86_64 and armv8 architectures") + + if self.settings.os == "Windows" and self.settings.arch == "armv8" and Version(self.version) < "3.24": + raise ConanInvalidConfiguration("CMake only supports ARM64 binaries on Windows starting from 3.24") + + def build(self): + arch = str(self.settings.arch) if self.settings.os != "Macos" else "universal" + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][arch], + destination=self.source_folder, strip_root=True) + + def package_id(self): + if self.info.settings.os == "Macos": + del self.info.settings.arch + + def package(self): + copy(self, "*", src=self.build_folder, dst=self.package_folder) + + if self.settings.os == "Macos": + docs_folder = os.path.join(self.build_folder, "CMake.app", "Contents", "doc", "cmake") + else: + docs_folder = os.path.join(self.build_folder, "doc", "cmake") + + copy(self, "Copyright.txt", src=docs_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + + if self.settings.os != "Macos": + # Remove unneeded folders (also cause long paths on Windows) + # Note: on macOS we don't want to modify the bundle contents + # to preserve signature validation + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "man")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Macos": + bindir = os.path.join(self.package_folder, "CMake.app", "Contents", "bin") + self.cpp_info.bindirs = [bindir] + else: + bindir = os.path.join(self.package_folder, "bin") + + # Needed for compatibility with v1.x - Remove when 2.0 becomes the default + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/recipes/cmake/binary/test_package/conanfile.py b/recipes/cmake/binary/test_package/conanfile.py new file mode 100644 index 0000000000000..1c9cda0539d32 --- /dev/null +++ b/recipes/cmake/binary/test_package/conanfile.py @@ -0,0 +1,23 @@ +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/binary/test_v1_package/conanfile.py b/recipes/cmake/binary/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df9415b7cf880 --- /dev/null +++ b/recipes/cmake/binary/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output=output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml new file mode 100644 index 0000000000000..a504377b77d5d --- /dev/null +++ b/recipes/cmake/config.yml @@ -0,0 +1,17 @@ +versions: + "3.19.8": + folder: "binary" + "3.20.6": + folder: "binary" + "3.21.7": + folder: "binary" + "3.22.6": + folder: "binary" + "3.23.5": + folder: "binary" + "3.24.4": + folder: "binary" + "3.25.3": + folder: "binary" + "3.26.3": + folder: "binary" diff --git a/recipes/cminpack/all/conandata.yml b/recipes/cminpack/all/conandata.yml new file mode 100644 index 0000000000000..114fe2eaf9bb8 --- /dev/null +++ b/recipes/cminpack/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.8": + sha256: "3ea7257914ad55eabc43a997b323ba0dfee0a9b010d648b6d5b0c96425102d0e" + url: "https://github.com/devernay/cminpack/archive/refs/tags/v1.3.8.tar.gz" diff --git a/recipes/cminpack/all/conanfile.py b/recipes/cminpack/all/conanfile.py new file mode 100644 index 0000000000000..a1da35f69dd6a --- /dev/null +++ b/recipes/cminpack/all/conanfile.py @@ -0,0 +1,116 @@ +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools import files +from conan import ConanFile +import os + +required_conan_version = ">=1.45.0" + + +class CMinpackConan(ConanFile): + name = "cminpack" + url = "https://github.com/conan-io/conan-center-index" + description = "About A C/C++ rewrite of the MINPACK software (originally in FORTRAN)" \ + "for solving nonlinear equations and nonlinear least squares problems" + topics = ("nonlinear", "solver") + homepage = "http://devernay.free.fr/hacks/cminpack/" + license = "LicenseRef-CopyrightMINPACK.txt" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = "OFF" + tc.variables["CMINPACK_LIB_INSTALL_DIR"] = "lib" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def layout(self): + cmake_layout(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 + + # cminpack is a c library + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + 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", "pkgconfig")) + files.copy(self, "CopyrightMINPACK.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + files.rmdir(self, os.path.join(self.package_folder, "share")) # contains cmake config files + + def _library_postfix(self): + postfix = "" + if not self.options.shared: + postfix += "_s" # for static + if self.settings.build_type == "Debug": + postfix += "_d" + + return postfix + + def package_info(self): + minpack_include_dir = os.path.join("include", "cminpack-1") + self.cpp_info.set_property("cmake_target_name", "cminpack") + # the double precision version + self.cpp_info.components['cminpack-double'].libs = ['cminpack' + self._library_postfix()] + self.cpp_info.components['cminpack-double'].includedirs.append(minpack_include_dir) + self.cpp_info.components["cminpack-double"].set_property("cmake_target_name", "cminpack::cminpack") + self.cpp_info.components["cminpack-double"].names["cmake_find_package"] = "cminpack" + self.cpp_info.components["cminpack-double"].names["cmake_find_package_multi"] = "cminpack" + self.cpp_info.components["cminpack-double"].names["pkg_config"] = "cminpack" + + # the single precision version + self.cpp_info.components['cminpack-single'].libs = ['cminpacks' + self._library_postfix()] + self.cpp_info.components['cminpack-single'].includedirs.append(minpack_include_dir) + self.cpp_info.components['cminpack-single'].defines.append("__cminpack_float__") + self.cpp_info.components["cminpack-single"].set_property("cmake_target_name", "cminpack::cminpacks") + self.cpp_info.components["cminpack-single"].names["cmake_find_package"] = "cminpacks" + self.cpp_info.components["cminpack-single"].names["cmake_find_package_multi"] = "cminpacks" + self.cpp_info.components["cminpack-single"].names["pkg_config"] = "cminpacks" + + + if self.settings.os != "Windows": + self.cpp_info.components['cminpack-double'].system_libs.append("m") + self.cpp_info.components['cminpack-single'].system_libs.append("m") + + # required apple frameworks + self.cpp_info.components['cminpack-double'].frameworks.append("Accelerate") + self.cpp_info.components['cminpack-single'].frameworks.append("Accelerate") + + if not self.options.shared and self.settings.os == "Windows": + self.cpp_info.components['cminpack-double'].defines.append("CMINPACK_NO_DLL") + self.cpp_info.components['cminpack-single'].defines.append("CMINPACK_NO_DLL") diff --git a/recipes/cminpack/all/test_package/CMakeLists.txt b/recipes/cminpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fa33c20512fe4 --- /dev/null +++ b/recipes/cminpack/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.12) +project(CMinPack-Conan-TestPackage C) + +find_package(CMinpack REQUIRED) + +# This builds one of the original cminpack examples against +# both types of the library + +add_executable(cminpack_test_double tchkderc.c) +target_link_libraries(cminpack_test_double PRIVATE cminpack::cminpack) + +add_executable(cminpack_test_float tchkderc.c) +target_link_libraries(cminpack_test_float PRIVATE cminpack::cminpacks) diff --git a/recipes/cminpack/all/test_package/conanfile.py b/recipes/cminpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..db7d5f7ac5bc3 --- /dev/null +++ b/recipes/cminpack/all/test_package/conanfile.py @@ -0,0 +1,25 @@ + +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" + + 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], "cminpack_test_double") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "cminpack_test_float") + self.run(bin_path, env="conanrun") diff --git a/recipes/cminpack/all/test_package/tchkderc.c b/recipes/cminpack/all/test_package/tchkderc.c new file mode 100644 index 0000000000000..8f6a3f0f741b8 --- /dev/null +++ b/recipes/cminpack/all/test_package/tchkderc.c @@ -0,0 +1,159 @@ +/* driver for chkder example. */ + +#include +#include +#include +#include +#define real __cminpack_real__ + +/* the following struct defines the data points */ +typedef struct { + int m; + real *y; +#ifdef BOX_CONSTRAINTS + real *xmin; + real *xmax; +#endif +} fcndata_t; + +int fcn(void *p, int m, int n, const real *x, real *fvec, + real *fjac, int ldfjac, int iflag); + +int main() +{ +#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER < 1900)) + _set_output_format(_TWO_DIGIT_EXPONENT); +#endif + int i, ldfjac; + real x[3], fvec[15], fjac[15*3], xp[3], fvecp[15], + err[15]; + const int m = 15; + const int n = 3; + /* auxiliary data (e.g. measurements) */ + real y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, + 3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39}; +#ifdef BOX_CONSTRAINTS + real xmin[3] = {0., 0.1, 0.5}; + real xmax[3] = {2., 1.5, 2.3}; +#endif + fcndata_t data; + data.m = m; + data.y = y; +#ifdef BOX_CONSTRAINTS + data.xmin = xmin; + data.xmax = xmax; +#endif + + /* the following values should be suitable for */ + /* checking the jacobian matrix. */ + + x[0] = 9.2e-1; + x[1] = 1.3e-1; + x[2] = 5.4e-1; + + ldfjac = 15; + + /* compute xp from x */ + __cminpack_func__(chkder)(m, n, x, NULL, NULL, ldfjac, xp, NULL, 1, NULL); + /* compute fvec at x (all components of fvec should be != 0).*/ + fcn(&data, m, n, x, fvec, NULL, ldfjac, 1); + /* compute fjac at x */ + fcn(&data, m, n, x, NULL, fjac, ldfjac, 2); + /* compute fvecp at xp (all components of fvecp should be != 0)*/ + fcn(&data, m, n, xp, fvecp, NULL, ldfjac, 1); + /* check Jacobian, put the result in err */ + __cminpack_func__(chkder)(m, n, x, fvec, fjac, ldfjac, NULL, fvecp, 2, err); + /* Output values: + err[i] = 1.: i-th gradient is correct + err[i] = 0.: i-th gradient is incorrect + err[I] > 0.5: i-th gradient is probably correct + */ + + for (i=0; iy; +#ifdef BOX_CONSTRAINTS + const real *xmin = ((fcndata_t*)p)->xmin; + const real *xmax = ((fcndata_t*)p)->xmax; + int j; + real xb[3]; + real jacfac[3]; + + for (j = 0; j < 3; ++j) { + real xmiddle = (xmin[j]+xmax[j])/2.; + real xwidth = (xmax[j]-xmin[j])/2.; + real th = tanh((x[j]-xmiddle)/xwidth); + xb[j] = xmiddle + th * xwidth; + jacfac[j] = 1. - th * th; + } + x = xb; +#endif + + if (iflag == 0) { + /* insert print statements here when nprint is positive. */ + /* if the nprint parameter to lmder is positive, the function is + called every nprint iterations with iflag=0, so that the + function may perform special operations, such as printing + residuals. */ + return 0; + } + + if (iflag != 2) { + /* compute residuals */ + for (i=0; i < 15; ++i) { + tmp1 = i + 1; + tmp2 = 15 - i; + tmp3 = (i > 7) ? tmp2 : tmp1; + fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3)); + } + } else { + /* compute Jacobian */ + for (i=0; i < 15; ++i) { + tmp1 = i + 1; + tmp2 = 15 - i; +# ifdef TCHKDER_FIXED + tmp3 = (i > 7) ? tmp2 : tmp1; +# else + /* error introduced into next statement for illustration. */ + /* corrected statement should read tmp3 = (i > 7) ? tmp2 : tmp1 . */ + tmp3 = (i > 7) ? tmp2 : tmp2; +# endif + tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4 = tmp4*tmp4; + fjac[i + ldfjac*0] = -1.; + fjac[i + ldfjac*1] = tmp1*tmp2/tmp4; + fjac[i + ldfjac*2] = tmp1*tmp3/tmp4; + } +# ifdef BOX_CONSTRAINTS + for (j = 0; j < 3; ++j) { + for (i=0; i < 15; ++i) { + fjac[i + ldfjac*j] *= jacfac[j]; + } + } +# endif + } + return 0; +} diff --git a/recipes/cminpack/all/test_v1_package/CMakeLists.txt b/recipes/cminpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..124290cb0ab4b --- /dev/null +++ b/recipes/cminpack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1.2) +project(CMinPack-ConanV1-TestPackage C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(CMinpack REQUIRED CONFIG) + +# This builds one of the original cminpack examples against +# both types of the library + +add_executable(cminpack_test_double ../test_package/tchkderc.c) +target_link_libraries(cminpack_test_double PRIVATE cminpack::cminpack) + +add_executable(cminpack_test_float ../test_package/tchkderc.c) +target_link_libraries(cminpack_test_float PRIVATE cminpack::cminpacks) diff --git a/recipes/cminpack/all/test_v1_package/conanfile.py b/recipes/cminpack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0cdc195d14862 --- /dev/null +++ b/recipes/cminpack/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_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", "cminpack_test_double") + self.run(bin_path, run_environment=True) + bin_path = os.path.join("bin", "cminpack_test_float") + self.run(bin_path, run_environment=True) diff --git a/recipes/cminpack/config.yml b/recipes/cminpack/config.yml new file mode 100644 index 0000000000000..859ab74128907 --- /dev/null +++ b/recipes/cminpack/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.8": + folder: all diff --git a/recipes/cmocka/all/conandata.yml b/recipes/cmocka/all/conandata.yml new file mode 100644 index 0000000000000..d9ca5bcc54526 --- /dev/null +++ b/recipes/cmocka/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.5": + url: "https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz" + sha256: "f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6" +patches: + "1.1.5": + - patch_file: "patches/build_either_static_or_shared.patch" diff --git a/recipes/cmocka/all/conanfile.py b/recipes/cmocka/all/conanfile.py new file mode 100644 index 0000000000000..2c0c2ed7806b8 --- /dev/null +++ b/recipes/cmocka/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class CmockaConan(ConanFile): + name = "cmocka" + license = "Apache-2.0" + homepage = "https://cmocka.org" + url = "https://github.com/conan-io/conan-center-index" + description = "A unit testing framework for C" + topics = ("unit_test", "unittest", "test", "testing", "mock", "mocking") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_STATIC_LIB"] = not self.options.shared + tc.variables["WITH_EXAMPLES"] = 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")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent("""\ + if(NOT DEFINED CMOCKA_INCLUDE_DIR) + set(CMOCKA_INCLUDE_DIR ${cmocka_INCLUDE_DIRS} + ${cmocka_INCLUDE_DIRS_RELEASE} + ${cmocka_INCLUDE_DIRS_RELWITHDEBINFO} + ${cmocka_INCLUDE_DIRS_MINSIZEREL} + ${cmocka_INCLUDE_DIRS_DEBUG}) + endif() + if(TARGET cmocka::cmocka) + if(NOT DEFINED CMOCKA_LIBRARY) + set(CMOCKA_LIBRARY cmocka::cmocka) + endif() + if(NOT DEFINED CMOCKA_LIBRARIES) + set(CMOCKA_LIBRARIES cmocka::cmocka) + endif() + endif() + """) + 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_file_name", "cmocka") + self.cpp_info.set_property("pkg_config_name", "cmocka") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.libs = ["cmocka{}".format("" if self.options.shared else "-static")] + + # 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/cmocka/all/patches/build_either_static_or_shared.patch b/recipes/cmocka/all/patches/build_either_static_or_shared.patch new file mode 100644 index 0000000000000..20ce61e8e4a7c --- /dev/null +++ b/recipes/cmocka/all/patches/build_either_static_or_shared.patch @@ -0,0 +1,20 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5684685..5f0fc81 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -31,6 +31,7 @@ if (WIN32) + ) + endif (WIN32) + ++if (NOT BUILD_STATIC_LIB) + add_library(${CMOCKA_SHARED_LIBRARY} SHARED ${cmocka_SRCS}) + + target_include_directories(${CMOCKA_SHARED_LIBRARY} +@@ -82,6 +83,7 @@ install(TARGETS + ${CMAKE_INSTALL_BINDIR} + COMPONENT + ${PROJECT_NAME}) ++endif (NOT BUILD_STATIC_LIB) + + if (BUILD_STATIC_LIB) + add_library(${CMOCKA_STATIC_LIBRARY} STATIC ${cmocka_SRCS}) diff --git a/recipes/cmocka/all/test_package/CMakeLists.txt b/recipes/cmocka/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..23601e264af84 --- /dev/null +++ b/recipes/cmocka/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cmocka REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMOCKA_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${CMOCKA_LIBRARY}) diff --git a/recipes/cmocka/all/test_package/conanfile.py b/recipes/cmocka/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cmocka/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/cmocka/all/test_package/test_package.c b/recipes/cmocka/all/test_package/test_package.c new file mode 100644 index 0000000000000..4b9fbf9e29998 --- /dev/null +++ b/recipes/cmocka/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include "cmocka.h" + +/* A test case that does nothing and succeeds. */ +static void null_test_success(void **state) { + (void) state; /* unused */ +} + +int main(void) { + const struct CMUnitTest tests[] = { + cmocka_unit_test(null_test_success), + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/recipes/cmocka/all/test_v1_package/CMakeLists.txt b/recipes/cmocka/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cmocka/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cmocka/all/test_v1_package/conanfile.py b/recipes/cmocka/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cmocka/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/cmocka/config.yml b/recipes/cmocka/config.yml new file mode 100644 index 0000000000000..e48685771bd64 --- /dev/null +++ b/recipes/cmocka/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.5": + folder: all diff --git a/recipes/cmp/all/CMakeLists.txt b/recipes/cmp/all/CMakeLists.txt new file mode 100644 index 0000000000000..cc7e397ad25e6 --- /dev/null +++ b/recipes/cmp/all/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.4) +project(cmp LANGUAGES C) + +include(GNUInstallDirs) + +add_library(cmp ${CMP_SRC_DIR}/cmp.c) +set_target_properties(cmp PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + PUBLIC_HEADER ${CMP_SRC_DIR}/cmp.h +) + +install(TARGETS cmp + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/cmp/all/conandata.yml b/recipes/cmp/all/conandata.yml new file mode 100644 index 0000000000000..c3d249aab079b --- /dev/null +++ b/recipes/cmp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20": + url: "https://github.com/camgunz/cmp/archive/v20.tar.gz" + sha256: "cde6db84cb04913d4ce4880c4db665555f92c163f362de151e350d8f30113362" + "19": + url: "https://github.com/camgunz/cmp/archive/refs/tags/v19.tar.gz" + sha256: "afa23e1961027c0146bda73f892726f3cdf0a85579a9813077890a51aec99916" diff --git a/recipes/cmp/all/conanfile.py b/recipes/cmp/all/conanfile.py new file mode 100644 index 0000000000000..6c5ef2cd5e0c4 --- /dev/null +++ b/recipes/cmp/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class CmpConan(ConanFile): + name = "cmp" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://msgpack.org" + description = "An implementation of the MessagePack serialization format in C / msgpack.org[C]" + topics = ("msgpack", "serialization") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMP_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 = ["cmp"] diff --git a/recipes/cmp/all/test_package/CMakeLists.txt b/recipes/cmp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..059b67a026f33 --- /dev/null +++ b/recipes/cmp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cmp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cmp::cmp) diff --git a/recipes/cmp/all/test_package/conanfile.py b/recipes/cmp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cmp/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/cmp/all/test_package/test_package.c b/recipes/cmp/all/test_package/test_package.c new file mode 100644 index 0000000000000..b3d7579a14f99 --- /dev/null +++ b/recipes/cmp/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include +#include + +int main() +{ + printf("cmp version: %u\n", cmp_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/cmp/all/test_v1_package/CMakeLists.txt b/recipes/cmp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cmp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cmp/all/test_v1_package/conanfile.py b/recipes/cmp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cmp/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/cmp/config.yml b/recipes/cmp/config.yml new file mode 100644 index 0000000000000..87cab3dd1a538 --- /dev/null +++ b/recipes/cmp/config.yml @@ -0,0 +1,5 @@ +versions: + "20": + folder: "all" + "19": + folder: "all" diff --git a/recipes/cn-cbor/all/CMakeLists.txt b/recipes/cn-cbor/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/cn-cbor/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/cn-cbor/all/conandata.yml b/recipes/cn-cbor/all/conandata.yml new file mode 100644 index 0000000000000..4de861bba88a9 --- /dev/null +++ b/recipes/cn-cbor/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + sha256: eca2bcc15b8400037fd95748724287afbb966e34d4d0275a496b4872bcea9d77 + url: https://github.com/jimsch/cn-cbor/archive/1.0.0.zip diff --git a/recipes/cn-cbor/all/conanfile.py b/recipes/cn-cbor/all/conanfile.py new file mode 100644 index 0000000000000..74e90a06cc919 --- /dev/null +++ b/recipes/cn-cbor/all/conanfile.py @@ -0,0 +1,82 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class CnCborStackConan(ConanFile): + name = "cn-cbor" + license = "MIT" + homepage = "https://github.com/jimsch/cn-cbor/" + url = "https://github.com/conan-io/conan-center-index" + description = "A constrained node implementation of CBOR in C" + topics = "cbor", "nodes", "messaging" + exports_sources = ['CMakeLists.txt'] + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True + } + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Windows shared builds are not supported right now") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["fatal_warnings"] = False + self._cmake.definitions["coveralls"] = False + self._cmake.definitions["build_tests"] = False + self._cmake.definitions["build_docs"] = False + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + os.remove(os.path.join(self.package_folder, "README.md")) + os.remove(os.path.join(self.package_folder, "LICENSE")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cn-cbor", "cmake")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/cn-cbor/all/test_package/CMakeLists.txt b/recipes/cn-cbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/cn-cbor/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/cn-cbor/all/test_package/conanfile.py b/recipes/cn-cbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..933dbf96533ae --- /dev/null +++ b/recipes/cn-cbor/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/cn-cbor/all/test_package/test_package.cpp b/recipes/cn-cbor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6443f4e43a05a --- /dev/null +++ b/recipes/cn-cbor/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include "cn-cbor/cn-cbor.h" +#include + +#ifdef USE_CBOR_CONTEXT +#define CBOR_CONTEXT_PARAM , NULL +#else +#define CBOR_CONTEXT_PARAM +#endif + +int main(int argc, char *argv[]) { + + struct cn_cbor_errback back; + const char *buf = "asdf"; + const int len = 4; + const cn_cbor *ret = cn_cbor_decode((const uint8_t *)buf, len CBOR_CONTEXT_PARAM, &back); + if (ret) { + printf("oops 1"); + } + + return 0; +} diff --git a/recipes/cn-cbor/config.yml b/recipes/cn-cbor/config.yml new file mode 100644 index 0000000000000..8f50af2b049ed --- /dev/null +++ b/recipes/cn-cbor/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "1.0.0": + folder: "all" diff --git a/recipes/cnpy/all/conandata.yml b/recipes/cnpy/all/conandata.yml new file mode 100644 index 0000000000000..a4b4bcd8ca10b --- /dev/null +++ b/recipes/cnpy/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20180601": + url: "https://github.com/rogersce/cnpy/archive/4e8810b1a8637695171ed346ce68f6984e585ef4.tar.gz" + sha256: "5120abc54a564efa92c642cc0199cc4fd3f345901157de9fbbdcedbb34d28d8a" +patches: + "cci.20180601": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/cnpy/all/conanfile.py b/recipes/cnpy/all/conanfile.py new file mode 100644 index 0000000000000..93cc4c7d5cadc --- /dev/null +++ b/recipes/cnpy/all/conanfile.py @@ -0,0 +1,71 @@ +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.53.0" + + +class CnpyConan(ConanFile): + name = "cnpy" + description = "library to read/write .npy and .npz files in C/C++" + license = "MIT" + topics = ("numpy", "npy", "npz") + homepage = "https://github.com/rogersce/cnpy" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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("zlib/1.2.13", transitive_headers=True, transitive_libs=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.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", 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 = ["cnpy"] diff --git a/recipes/cnpy/all/patches/0001-fix-cmake.patch b/recipes/cnpy/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..b3ee3550b104d --- /dev/null +++ b/recipes/cnpy/all/patches/0001-fix-cmake.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,30 +1,18 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.0 FATAL_ERROR) +-if(COMMAND cmake_policy) +- cmake_policy(SET CMP0003 NEW) +-endif(COMMAND cmake_policy) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.8) + +-project(CNPY) ++project(CNPY LANGUAGES CXX) + +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + +-option(ENABLE_STATIC "Build static (.a) library" ON) + + find_package(ZLIB REQUIRED) + +-include_directories(${ZLIB_INCLUDE_DIRS}) + +-add_library(cnpy SHARED "cnpy.cpp") +-target_link_libraries(cnpy ${ZLIB_LIBRARIES}) +-install(TARGETS "cnpy" LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ++add_library(cnpy "cnpy.cpp") ++target_compile_features(cnpy PUBLIC cxx_std_11) ++set_target_properties(cnpy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++target_link_libraries(cnpy PUBLIC ZLIB::ZLIB) ++install(TARGETS "cnpy" LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + +-if(ENABLE_STATIC) +- add_library(cnpy-static STATIC "cnpy.cpp") +- set_target_properties(cnpy-static PROPERTIES OUTPUT_NAME "cnpy") +- install(TARGETS "cnpy-static" ARCHIVE DESTINATION lib) +-endif(ENABLE_STATIC) + + install(FILES "cnpy.h" DESTINATION include) +-install(FILES "mat2npz" "npy2mat" "npz2mat" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + +-add_executable(example1 example1.cpp) +-target_link_libraries(example1 cnpy) diff --git a/recipes/cnpy/all/test_package/CMakeLists.txt b/recipes/cnpy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18d71adb9d0d4 --- /dev/null +++ b/recipes/cnpy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cnpy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cnpy::cnpy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cnpy/all/test_package/conanfile.py b/recipes/cnpy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cnpy/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/cnpy/all/test_package/test_package.cpp b/recipes/cnpy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..99a4af4d04a9a --- /dev/null +++ b/recipes/cnpy/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include"cnpy.h" + +int main() { + const size_t Nx = 16; + const size_t Ny = 16; + const size_t Nz = 16; + + std::vector data(Nx*Ny*Nz); + for(int i = 0;i < Nx*Ny*Nz;i++) data[i] = rand(); + cnpy::npy_save("arr1.npy",&data[0],{Nz,Ny,Nx},"w"); + cnpy::NpyArray arr = cnpy::npy_load("arr1.npy"); + return 0; +} diff --git a/recipes/cnpy/all/test_v1_package/CMakeLists.txt b/recipes/cnpy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cnpy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cnpy/all/test_v1_package/conanfile.py b/recipes/cnpy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cnpy/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/cnpy/config.yml b/recipes/cnpy/config.yml new file mode 100644 index 0000000000000..6a02f84aa19d5 --- /dev/null +++ b/recipes/cnpy/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20180601": + folder: all diff --git a/recipes/co/all/CMakeLists.txt b/recipes/co/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/co/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/co/all/conandata.yml b/recipes/co/all/conandata.yml new file mode 100644 index 0000000000000..e71aeda87ca26 --- /dev/null +++ b/recipes/co/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.0.2": + url: "https://github.com/idealvin/co/archive/refs/tags/v2.0.2.tar.gz" + sha256: "5dbb90e18627ebe563a6a437e8e28329a6bfc07f266718318bd3adf26027d156" +patches: + "2.0.2": + - patch_file: "patches/001-install-dll.patch" + base_path: "source_subfolder" diff --git a/recipes/co/all/conanfile.py b/recipes/co/all/conanfile.py new file mode 100644 index 0000000000000..5be88f24e0ce3 --- /dev/null +++ b/recipes/co/all/conanfile.py @@ -0,0 +1,104 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class CoConan(ConanFile): + name = "co" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/idealvin/co" + license = "MIT" + description = "A go-style coroutine library in C++11 and more." + topics = ("co", "coroutine", "c++11") + + deprecated = "cocoyaxi" + + exports_sources = "CMakeLists.txt", "patches/*" + generators = "cmake", "cmake_find_package" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcurl": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcurl": False, + "with_openssl": False, + } + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_libcurl: + self.requires("libcurl/7.79.1") + if self.options.with_openssl: + self.requires("openssl/1.1.1l") + + def build_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # The OSX_ARCHITECTURES target property is now respected for the ASM language + self.build_requires("cmake/3.20.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + if not self.options.shared: + self._cmake.definitions["FPIC"] = self.options.get_safe("fPIC", False) + runtime = self.settings.get_safe("compiler.runtime") + if runtime: + self._cmake.definitions["STATIC_VS_CRT"] = "MT" in runtime + self._cmake.definitions["WITH_LIBCURL"] = self.options.with_libcurl + self._cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["co"] + self.cpp_info.names["cmake_find_package"] = "co" + self.cpp_info.names["cmake_find_package_multi"] = "co" + + def validate(self): + if self.options.with_libcurl: + if not self.options.with_openssl: + raise ConanInvalidConfiguration(f"{self.name} requires with_openssl=True when using with_libcurl=True") + if self.options["libcurl"].with_ssl != "openssl": + raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_ssl='openssl' to be enabled") + if not self.options["libcurl"].with_zlib: + raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_zlib=True to be enabled") diff --git a/recipes/co/all/patches/001-install-dll.patch b/recipes/co/all/patches/001-install-dll.patch new file mode 100644 index 0000000000000..9332f3296762e --- /dev/null +++ b/recipes/co/all/patches/001-install-dll.patch @@ -0,0 +1,10 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9e03c9a..499b550 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -112,4 +112,5 @@ install( + TARGETS co + LIBRARY DESTINATION lib # shared lib installed to ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION lib # static lib installed to ${CMAKE_INSTALL_PREFIX}/lib ++ RUNTIME DESTINATION bin + ) diff --git a/recipes/co/all/patches/002-fix-event-destruct.patch b/recipes/co/all/patches/002-fix-event-destruct.patch new file mode 100644 index 0000000000000..7949dbdca3146 --- /dev/null +++ b/recipes/co/all/patches/002-fix-event-destruct.patch @@ -0,0 +1,13 @@ +diff --git a/src/co/co.cc b/src/co/co.cc +index 8921296..838ac16 100644 +--- a/src/co/co.cc ++++ b/src/co/co.cc +@@ -8,7 +8,7 @@ namespace co { + class EventImpl { + public: + EventImpl() : _counter(0), _signaled(false), _has_cond(false) {} +- ~EventImpl() { co::xx::cond_destroy(&_cond); } ++ ~EventImpl() { if (_has_cond) co::xx::cond_destroy(&_cond); } + + bool wait(uint32 ms); + diff --git a/recipes/co/all/test_package/CMakeLists.txt b/recipes/co/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d9ea9b93dcee7 --- /dev/null +++ b/recipes/co/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 11) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(co REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cc) +target_link_libraries(${PROJECT_NAME} co::co) diff --git a/recipes/co/all/test_package/conanfile.py b/recipes/co/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5493d58611803 --- /dev/null +++ b/recipes/co/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/co/all/test_package/test_package.cc b/recipes/co/all/test_package/test_package.cc new file mode 100644 index 0000000000000..46b92d23f6830 --- /dev/null +++ b/recipes/co/all/test_package/test_package.cc @@ -0,0 +1,7 @@ +#include "co/str.h" +#include + +int main() { + std::cout << str::from(123) << std::endl; + return 0; +} diff --git a/recipes/co/config.yml b/recipes/co/config.yml new file mode 100644 index 0000000000000..5df97e2cc232e --- /dev/null +++ b/recipes/co/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.2": + folder: all diff --git a/recipes/cocoyaxi/all/conandata.yml b/recipes/cocoyaxi/all/conandata.yml new file mode 100644 index 0000000000000..535de47c89a52 --- /dev/null +++ b/recipes/cocoyaxi/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.3": + url: "https://github.com/idealvin/coost/archive/refs/tags/v2.0.3.tar.gz" + sha256: "afb5219e56cbcfae1211590e01ad9d9d7f61287e76d9dea5c5f68c432f85bf30" diff --git a/recipes/cocoyaxi/all/conanfile.py b/recipes/cocoyaxi/all/conanfile.py new file mode 100644 index 0000000000000..217d2d1b7c4e1 --- /dev/null +++ b/recipes/cocoyaxi/all/conanfile.py @@ -0,0 +1,97 @@ +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.50.0" + + +class CocoyaxiConan(ConanFile): + name = "cocoyaxi" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/idealvin/cocoyaxi" + license = "MIT" + description = "A go-style coroutine library in C++11 and more." + topics = ("cocoyaxi", "coroutine", "c++11") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcurl": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcurl": False, + "with_openssl": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_libcurl: + self.requires("libcurl/7.80.0") + if self.options.with_libcurl or self.options.with_openssl: + self.requires("openssl/1.1.1q") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if self.info.options.with_libcurl: + if not self.info.options.with_openssl: + raise ConanInvalidConfiguration(f"{self.name} requires with_openssl=True when using with_libcurl=True") + if self.dependencies["libcurl"].options.with_ssl != "openssl": + raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_ssl='openssl' to be enabled") + if not self.dependencies["libcurl"].options.with_zlib: + raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_zlib=True to be enabled") + + 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) + if is_msvc(self): + tc.variables["STATIC_VS_CRT"] = is_msvc_static_runtime(self) + tc.variables["WITH_LIBCURL"] = self.options.with_libcurl + tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cocoyaxi") + self.cpp_info.set_property("cmake_target_name", "cocoyaxi::co") + # TODO: back to global scope in conan v2 once legacy generators removed + self.cpp_info.components["co"].libs = ["co"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.components["co"].set_property("cmake_target_name", "cocoyaxi::co") + if self.options.with_libcurl: + self.cpp_info.components["co"].requires.append("libcurl::libcurl") + if self.options.with_libcurl or self.options.with_openssl: + self.cpp_info.components["co"].requires.append("openssl::openssl") diff --git a/recipes/cocoyaxi/all/test_package/CMakeLists.txt b/recipes/cocoyaxi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2d0878488574e --- /dev/null +++ b/recipes/cocoyaxi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cocoyaxi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cocoyaxi::co) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cocoyaxi/all/test_package/conanfile.py b/recipes/cocoyaxi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/cocoyaxi/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cocoyaxi/all/test_package/test_package.cpp b/recipes/cocoyaxi/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..46b92d23f6830 --- /dev/null +++ b/recipes/cocoyaxi/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "co/str.h" +#include + +int main() { + std::cout << str::from(123) << std::endl; + return 0; +} diff --git a/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt b/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..882cedffb12e9 --- /dev/null +++ b/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cocoyaxi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cocoyaxi::co) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cocoyaxi/all/test_v1_package/conanfile.py b/recipes/cocoyaxi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cocoyaxi/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/cocoyaxi/config.yml b/recipes/cocoyaxi/config.yml new file mode 100644 index 0000000000000..7f57148a20478 --- /dev/null +++ b/recipes/cocoyaxi/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.3": + folder: all diff --git a/recipes/coin-cbc/all/conandata.yml b/recipes/coin-cbc/all/conandata.yml new file mode 100644 index 0000000000000..99a9ed92100b1 --- /dev/null +++ b/recipes/coin-cbc/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.10.5": + url: "https://github.com/coin-or/Cbc/archive/releases/2.10.5.tar.gz" + sha256: "cc44c1950ff4615e7791d7e03ea34318ca001d3cac6dc3f7f5ee392459ce6719" +patches: + "2.10.5": + - patch_file: "patches/0001-no-pkg-config-check.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-pthreads4w.patch" + base_path: "source_subfolder" diff --git a/recipes/coin-cbc/all/conanfile.py b/recipes/coin-cbc/all/conanfile.py new file mode 100644 index 0000000000000..ffea985fa3a7d --- /dev/null +++ b/recipes/coin-cbc/all/conanfile.py @@ -0,0 +1,172 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import rename, get, apply_conandata_patches, rmdir, mkdir +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools +from contextlib import contextmanager +import os +import shutil + +required_conan_version = ">=1.47.0" + +class CoinCbcConan(ConanFile): + name = "coin-cbc" + description = "COIN-OR Branch-and-Cut solver" + topics = ("clp", "simplex", "solver", "linear", "programming") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin-or/Clp" + license = ("EPL-2.0",) + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + "parallel": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "parallel": False, + } + generators = "pkg_config" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("coin-utils/2.11.4") + self.requires("coin-osi/0.108.6") + self.requires("coin-clp/1.17.6") + self.requires("coin-cgl/0.60.3") + if self.settings.compiler == "Visual Studio" and self.options.parallel: + self.requires("pthreads4w/3.0.0") + + @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 build_requirements(self): + self.tool_requires("gnu-config/cci.20201022") + self.tool_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.tool_requires("msys2/cci.latest") + if self.settings.compiler == "Visual Studio": + self.tool_requires("automake/1.16.5") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("coin-cbc does not support shared builds on Windows") + # FIXME: This issue likely comes from very old autotools versions used to produce configure. + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: + raise ConanInvalidConfiguration("coin-cbc shared not supported yet when cross-building") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + @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._user_info_build["automake"].compile)), + "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "LD": "{} link -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), + } + with tools.environment_append(env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + yes_no = lambda v: "yes" if v else "no" + configure_args = [ + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-cbc-parallel={}".format(yes_no(self.options.parallel)), + "--without-blas", + "--without-lapack", + ] + if self.settings.compiler == "Visual Studio": + self._autotools.cxx_flags.append("-EHsc") + configure_args.append(f"--enable-msvc={self.settings.compiler.runtime}") + if Version(self.settings.compiler.version) >= 12: + self._autotools.flags.append("-FS") + if self.options.parallel: + configure_args.append("--with-pthreadsw32-lib={}".format(tools.unix_path(os.path.join(self.deps_cpp_info["pthreads4w"].lib_paths[0], self.deps_cpp_info["pthreads4w"].libs[0] + ".lib")))) + configure_args.append("--with-pthreadsw32-incdir={}".format(tools.unix_path(self.deps_cpp_info["pthreads4w"].include_paths[0]))) + self._autotools.configure(configure_dir=os.path.join(self.source_folder, self._source_subfolder), args=configure_args) + return self._autotools + + def build(self): + apply_conandata_patches(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")) + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + # Installation script expects include/coin to already exist + mkdir(self, os.path.join(self.package_folder, "include", "coin")) + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + + for l in ("CbcSolver", "Cbc", "OsiCbc"): + os.unlink(f"{self.package_folder}/lib/lib{l}.la") + if self.settings.compiler == "Visual Studio": + rename(self, + f"{self.package_folder}/lib/lib{l}.a", + f"{self.package_folder}/lib/{l}.lib") + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.components["libcbc"].libs = ["CbcSolver", "Cbc"] + self.cpp_info.components["libcbc"].includedirs.append(os.path.join("include", "coin")) + self.cpp_info.components["libcbc"].requires = ["coin-clp::osi-clp", "coin-utils::coin-utils", "coin-osi::coin-osi", "coin-cgl::coin-cgl"] + self.cpp_info.components["libcbc"].names["pkg_config"] = "cbc" + if self.settings.os in ["Linux", "FreeBSD"] and self.options.parallel: + self.cpp_info.components["libcbc"].system_libs.append("pthread") + if self.settings.os in ["Windows"] and self.options.parallel: + self.cpp_info.components["libcbc"].requires.append("pthreads4w::pthreads4w") + + self.cpp_info.components["osi-cbc"].libs = ["OsiCbc"] + self.cpp_info.components["osi-cbc"].requires = ["libcbc"] + self.cpp_info.components["osi-cbc"].names["pkg_config"] = "osi-cbc" + + 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/coin-cbc/all/patches/0001-no-pkg-config-check.patch b/recipes/coin-cbc/all/patches/0001-no-pkg-config-check.patch new file mode 100644 index 0000000000000..4bca55095a1b7 --- /dev/null +++ b/recipes/coin-cbc/all/patches/0001-no-pkg-config-check.patch @@ -0,0 +1,13 @@ +--- Cbc/Makefile.in ++++ Cbc/Makefile.in +@@ -1012,8 +1012,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs cbc > $(addlibsdir)/cbc_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #$(PKG_CONFIG) --libs cbc > $(addlibsdir)/cbc_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libCbc.lib @CBCLIB_LIBS_INSTALLED@" > $(addlibsdir)/cbc_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lCbcSolver -lCbc @CBCLIB_LIBS_INSTALLED@ > $(addlibsdir)/cbc_addlibs.txt + diff --git a/recipes/coin-cbc/all/patches/0002-pthreads4w.patch b/recipes/coin-cbc/all/patches/0002-pthreads4w.patch new file mode 100644 index 0000000000000..e5211957dfea0 --- /dev/null +++ b/recipes/coin-cbc/all/patches/0002-pthreads4w.patch @@ -0,0 +1,11 @@ +--- a/Cbc/configure ++++ b/Cbc/configure +@@ -30970,7 +30970,7 @@ cat >>confdefs.h <<\_ACEOF + #define CBC_THREAD 1 + _ACEOF + +- if test $coin_cxx_is_cl = true ; ++ if test "${with_pthreadsw32_lib+set}" = set ; + then + # TODO we should check whether the library works and pthread.h is indeed there + diff --git a/recipes/coin-cbc/all/test_package/CMakeLists.txt b/recipes/coin-cbc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18c2470c6a65f --- /dev/null +++ b/recipes/coin-cbc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +include(FindPkgConfig) + +pkg_check_modules(OsiCbc REQUIRED IMPORTED_TARGET osi-cbc) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::OsiCbc) diff --git a/recipes/coin-cbc/all/test_package/conanfile.py b/recipes/coin-cbc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9ade272b0a40d --- /dev/null +++ b/recipes/coin-cbc/all/test_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", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + + 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/coin-cbc/all/test_package/test_package.cpp b/recipes/coin-cbc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e30a73cd59b70 --- /dev/null +++ b/recipes/coin-cbc/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include "OsiCbcSolverInterface.hpp" + +#include +#include + +int main(int argc, char *argv[]) +{ + OsiCbcSolverInterface im; + if (im.getNumCols() != 0) { + fprintf(stderr, "Wrong #columns\n"); + return 1; + } + if (im.getModelPtr() == NULL) { + fprintf(stderr, "Bad model ointer\n"); + return 1; + } + return 0; +} diff --git a/recipes/coin-cbc/config.yml b/recipes/coin-cbc/config.yml new file mode 100644 index 0000000000000..339963dc57456 --- /dev/null +++ b/recipes/coin-cbc/config.yml @@ -0,0 +1,3 @@ +versions: + "2.10.5": + folder: "all" diff --git a/recipes/coin-cgl/all/conandata.yml b/recipes/coin-cgl/all/conandata.yml new file mode 100644 index 0000000000000..5fc7e9f24039c --- /dev/null +++ b/recipes/coin-cgl/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.60.6": + url: "https://github.com/coin-or/Cgl/archive/refs/tags/releases/0.60.6.tar.gz" + sha256: "9e2c51ffad816ab408763d6b931e2a3060482ee4bf1983148969de96d4b2c9ce" + "0.60.3": + url: "https://github.com/coin-or/Cgl/archive/refs/tags/releases/0.60.3.tar.gz" + sha256: "cfeeedd68feab7c0ce377eb9c7b61715120478f12c4dd0064b05ad640e20f3fb" +patches: + "0.60.6": + - patch_file: "patches/0.60.6-0001-no-pkg-config-check.patch" + "0.60.3": + - patch_file: "patches/0.60.3-0001-no-pkg-config-check.patch" diff --git a/recipes/coin-cgl/all/conanfile.py b/recipes/coin-cgl/all/conanfile.py new file mode 100644 index 0000000000000..8da58a4cb0487 --- /dev/null +++ b/recipes/coin-cgl/all/conanfile.py @@ -0,0 +1,143 @@ +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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, msvc_runtime_flag, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class CoinCglConan(ConanFile): + name = "coin-cgl" + description = "COIN-OR Cut Generator Library" + topics = ("cgl", "simplex", "solver", "linear", "programming") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin-or/Cgl" + license = "EPL-2.0" + package_type = "library" + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("coin-utils/2.11.6") + self.requires("coin-osi/0.108.7") + self.requires("coin-clp/1.17.7") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("coin-cgl does not support shared builds on Windows") + # FIXME: This issue likely comes from very old autotools versions used to produce configure. + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: + raise ConanInvalidConfiguration("coin-cgl shared not supported yet when cross-building") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--without-blas", + "--without-lapack", + ]) + if is_msvc(self): + tc.extra_cxxflags.append("-EHsc") + tc.configure_args.append(f"--enable-msvc={msvc_runtime_flag(self)}") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", f"{compile_wrapper} link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + if self._settings_build.os == "Windows": + # TODO: Something to fix in conan client or pkgconf recipe? + # This is a weird workaround when build machine is Windows. Here we have to inject regular + # Windows path to pc files folder instead of unix path flavor injected by AutotoolsToolchain... + env.define("PKG_CONFIG_PATH", self.generators_folder) + tc.generate(env) + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if not is_msvc(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(args=["-j1"]) + 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) + if is_msvc(self): + rename(self, + os.path.join(self.package_folder, "lib", "libCgl.a"), + os.path.join(self.package_folder, "lib", "Cgl.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "cgl") + self.cpp_info.libs = ["Cgl"] + self.cpp_info.includedirs.append(os.path.join("include", "coin")) diff --git a/recipes/coin-cgl/all/patches/0.60.3-0001-no-pkg-config-check.patch b/recipes/coin-cgl/all/patches/0.60.3-0001-no-pkg-config-check.patch new file mode 100644 index 0000000000000..8e86185392524 --- /dev/null +++ b/recipes/coin-cgl/all/patches/0.60.3-0001-no-pkg-config-check.patch @@ -0,0 +1,13 @@ +--- Cgl/Makefile.in ++++ Cgl/Makefile.in +@@ -886,8 +886,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs cgl > $(addlibsdir)/cgl_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #$(PKG_CONFIG) --libs cgl > $(addlibsdir)/cgl_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libCgl.lib @CGLLIB_LIBS_INSTALLED@" > $(addlibsdir)/cgl_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lCgl @CGLLIB_LIBS_INSTALLED@ > $(addlibsdir)/cgl_addlibs.txt + diff --git a/recipes/coin-cgl/all/patches/0.60.6-0001-no-pkg-config-check.patch b/recipes/coin-cgl/all/patches/0.60.6-0001-no-pkg-config-check.patch new file mode 100644 index 0000000000000..4e3b6ea5ea929 --- /dev/null +++ b/recipes/coin-cgl/all/patches/0.60.6-0001-no-pkg-config-check.patch @@ -0,0 +1,13 @@ +--- Cgl/Makefile.in ++++ Cgl/Makefile.in +@@ -894,8 +894,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs cgl > $(addlibsdir)/cgl_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #$(PKG_CONFIG) --libs cgl > $(addlibsdir)/cgl_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libCgl.lib @CGLLIB_LIBS_INSTALLED@" > $(addlibsdir)/cgl_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lCgl @CGLLIB_LIBS_INSTALLED@ > $(addlibsdir)/cgl_addlibs.txt + diff --git a/recipes/coin-cgl/all/test_package/CMakeLists.txt b/recipes/coin-cgl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c4558f1caa45 --- /dev/null +++ b/recipes/coin-cgl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(Cgl REQUIRED IMPORTED_TARGET cgl) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::Cgl) diff --git a/recipes/coin-cgl/all/test_package/conanfile.py b/recipes/coin-cgl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..af1af0ebb3d7f --- /dev/null +++ b/recipes/coin-cgl/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 +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "PkgConfigDeps", "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 not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + 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/coin-cgl/all/test_package/test_package.cpp b/recipes/coin-cgl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5e2587f5b3e6 --- /dev/null +++ b/recipes/coin-cgl/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "CglProbing.hpp" + +int main(int argc, char *argv[]) +{ + CglProbing probing; + probing.setLogLevel(0); + probing.setUsingObjective(1); + return probing.getUsingObjective() == 1 ? 0 : 1; +} diff --git a/recipes/coin-cgl/all/test_v1_package/CMakeLists.txt b/recipes/coin-cgl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/coin-cgl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/coin-cgl/all/test_v1_package/conanfile.py b/recipes/coin-cgl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/coin-cgl/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/coin-cgl/config.yml b/recipes/coin-cgl/config.yml new file mode 100644 index 0000000000000..c588b8cdfa767 --- /dev/null +++ b/recipes/coin-cgl/config.yml @@ -0,0 +1,5 @@ +versions: + "0.60.6": + folder: "all" + "0.60.3": + folder: "all" diff --git a/recipes/coin-clp/all/conandata.yml b/recipes/coin-clp/all/conandata.yml new file mode 100644 index 0000000000000..2ffc096e1d90a --- /dev/null +++ b/recipes/coin-clp/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.17.7": + url: "https://github.com/coin-or/Clp/archive/refs/tags/releases/1.17.7.tar.gz" + sha256: "c4c2c0e014220ce8b6294f3be0f3a595a37bef58a14bf9bac406016e9e73b0f5" + "1.17.6": + url: "https://github.com/coin-or/Clp/archive/refs/tags/releases/1.17.6.tar.gz" + sha256: "afff465b1620cfcbb7b7c17b5d331d412039650ff471c4160c7eb24ae01284c9" +patches: + "1.17.7": + - patch_file: "patches/1.17.7-0001-no-pkg-config-check.patch" + "1.17.6": + - patch_file: "patches/1.17.6-0001-no-pkg-config-check.patch" diff --git a/recipes/coin-clp/all/conanfile.py b/recipes/coin-clp/all/conanfile.py new file mode 100644 index 0000000000000..94e548dfba655 --- /dev/null +++ b/recipes/coin-clp/all/conanfile.py @@ -0,0 +1,146 @@ +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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class CoinClpConan(ConanFile): + name = "coin-clp" + description = "COIN-OR Linear Programming Solver" + topics = ("clp", "simplex", "solver", "linear", "programming") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin-or/Clp" + license = "EPL-2.0" + package_type = "library" + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # Symbols are exposed https://github.com/conan-io/conan-center-index/pull/16053#issuecomment-1512637106 + self.requires("coin-utils/2.11.6", transitive_headers=True, transitive_libs=True) + self.requires("coin-osi/0.108.7", transitive_headers=True) + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("coin-clp does not support shared builds on Windows") + # FIXME: This issue likely comes from very old autotools versions used to produce configure. + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: + raise ConanInvalidConfiguration("coin-clp shared not supported yet when cross-building") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", f"{compile_wrapper} link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + if self._settings_build.os == "Windows": + # TODO: Something to fix in conan client or pkgconf recipe? + # This is a weird workaround when build machine is Windows. Here we have to inject regular + # Windows path to pc files folder instead of unix path flavor injected by AutotoolsToolchain... + env.define("PKG_CONFIG_PATH", self.generators_folder) + tc.generate(env) + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if not is_msvc(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # Installation script expects include/coin to already exist + mkdir(self, os.path.join(self.package_folder, "include", "coin")) + autotools = Autotools(self) + autotools.install(args=["-j1"]) + 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) + if is_msvc(self): + for l in ("Clp", "ClpSolver", "OsiClp"): + rename(self, os.path.join(self.package_folder, "lib", f"lib{l}.a"), + os.path.join(self.package_folder, "lib", f"{l}.lib")) + + def package_info(self): + self.cpp_info.components["clp"].set_property("pkg_config_name", "clp") + self.cpp_info.components["clp"].libs = ["ClpSolver", "Clp"] + self.cpp_info.components["clp"].includedirs.append(os.path.join("include", "coin")) + self.cpp_info.components["clp"].requires = ["coin-utils::coin-utils"] + + self.cpp_info.components["osi-clp"].set_property("pkg_config_name", "osi-clp") + self.cpp_info.components["osi-clp"].libs = ["OsiClp"] + self.cpp_info.components["osi-clp"].requires = ["clp", "coin-osi::coin-osi"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/coin-clp/all/patches/1.17.6-0001-no-pkg-config-check.patch b/recipes/coin-clp/all/patches/1.17.6-0001-no-pkg-config-check.patch new file mode 100644 index 0000000000000..b98c77f27f291 --- /dev/null +++ b/recipes/coin-clp/all/patches/1.17.6-0001-no-pkg-config-check.patch @@ -0,0 +1,13 @@ +--- Clp/Makefile.in ++++ Clp/Makefile.in +@@ -925,8 +925,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs clp > $(addlibsdir)/clp_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #$(PKG_CONFIG) --libs clp > $(addlibsdir)/clp_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libClpSolver.lib libClp.lib @CLPLIB_LIBS_INSTALLED@" > $(addlibsdir)/clp_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lClp @CLPLIB_LIBS_INSTALLED@ > $(addlibsdir)/clp_addlibs.txt + diff --git a/recipes/coin-clp/all/patches/1.17.7-0001-no-pkg-config-check.patch b/recipes/coin-clp/all/patches/1.17.7-0001-no-pkg-config-check.patch new file mode 100644 index 0000000000000..62070411f384d --- /dev/null +++ b/recipes/coin-clp/all/patches/1.17.7-0001-no-pkg-config-check.patch @@ -0,0 +1,13 @@ +--- Clp/Makefile.in ++++ Clp/Makefile.in +@@ -924,8 +924,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs clp > $(addlibsdir)/clp_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #$(PKG_CONFIG) --libs clp > $(addlibsdir)/clp_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libClpSolver.lib libClp.lib @CLPLIB_LIBS_INSTALLED@" > $(addlibsdir)/clp_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lClp @CLPLIB_LIBS_INSTALLED@ > $(addlibsdir)/clp_addlibs.txt + diff --git a/recipes/coin-clp/all/test_package/CMakeLists.txt b/recipes/coin-clp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..be407d0b8fd6f --- /dev/null +++ b/recipes/coin-clp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(OsiClp REQUIRED IMPORTED_TARGET osi-clp) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::OsiClp) diff --git a/recipes/coin-clp/all/test_package/conanfile.py b/recipes/coin-clp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..160bdaf5610e0 --- /dev/null +++ b/recipes/coin-clp/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "PkgConfigDeps", "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 not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + 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") + mps = os.path.join(self.source_folder, "sample.mps") + self.run(f"{bin_path} {mps}", env="conanrun") diff --git a/recipes/coin-clp/all/test_package/sample.mps b/recipes/coin-clp/all/test_package/sample.mps new file mode 100644 index 0000000000000..199562440cd64 --- /dev/null +++ b/recipes/coin-clp/all/test_package/sample.mps @@ -0,0 +1,21 @@ +NAME TESTPROB +ROWS + N COST + L LIM1 + G LIM2 + E MYEQN +COLUMNS + XONE COST 1 LIM1 1 + XONE LIM2 1 + YTWO COST 4 LIM1 1 + YTWO MYEQN -1 + ZTHREE COST 9 LIM2 1 + ZTHREE MYEQN 1 +RHS + RHS1 LIM1 5 LIM2 10 + RHS1 MYEQN 7 +BOUNDS + UP BND1 XONE 4 + LO BND1 YTWO -1 + UP BND1 YTWO 1 +ENDATA diff --git a/recipes/coin-clp/all/test_package/test_package.cpp b/recipes/coin-clp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1886a8f2dfb59 --- /dev/null +++ b/recipes/coin-clp/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "ClpSimplex.hpp" + +#include + +int main (int argc, const char *argv[]) +{ + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + ClpSimplex model; + int status = model.readMps(argv[1]); + if (status != 0) { + model.primal(); + } + return 0; +} diff --git a/recipes/coin-clp/all/test_v1_package/CMakeLists.txt b/recipes/coin-clp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/coin-clp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/coin-clp/all/test_v1_package/conanfile.py b/recipes/coin-clp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9b15feda1ca30 --- /dev/null +++ b/recipes/coin-clp/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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") + mps = os.path.join(self.source_folder, os.pardir, "test_package", "sample.mps") + self.run(f"{bin_path} {mps}", run_environment=True) diff --git a/recipes/coin-clp/config.yml b/recipes/coin-clp/config.yml new file mode 100644 index 0000000000000..0ed5056bc7c44 --- /dev/null +++ b/recipes/coin-clp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.17.7": + folder: "all" + "1.17.6": + folder: "all" diff --git a/recipes/coin-lemon/all/conandata.yml b/recipes/coin-lemon/all/conandata.yml new file mode 100644 index 0000000000000..f00f950c896c3 --- /dev/null +++ b/recipes/coin-lemon/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.3.1": + url: "http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz" + sha256: "71b7c725f4c0b4a8ccb92eb87b208701586cf7a96156ebd821ca3ed855bad3c8" +patches: + "1.3.1": + - patch_file: "patches/cmake-add-runtime-destination_1.3.1.patch" + - patch_file: "patches/0001-remove-register-keyword.patch" diff --git a/recipes/coin-lemon/all/conanfile.py b/recipes/coin-lemon/all/conanfile.py new file mode 100644 index 0000000000000..2ea80d94c93ce --- /dev/null +++ b/recipes/coin-lemon/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class CoinLemonConan(ConanFile): + name = "coin-lemon" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://lemon.cs.elte.hu" + description = "LEMON stands for Library for Efficient Modeling and Optimization in Networks." + topics = ("data structures", "algorithms", "graphs", "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): + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LEMON_ENABLE_GLPK"] = False + tc.variables["LEMON_ENABLE_ILOG"] = False + tc.variables["LEMON_ENABLE_COIN"] = False + tc.variables["LEMON_ENABLE_SOPLEX"] = False + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # For Ninja generator + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0058"] = "NEW" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable demo, tools, doc & test + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})", + "if(0)", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LEMON") + self.cpp_info.set_property("cmake_target_name", "LEMON::LEMON") # no official target name actually + self.cpp_info.set_property("pkg_config_name", "lemon") + self.cpp_info.libs = ["lemon" if self.settings.os == "Windows" else "emon"] + self.cpp_info.defines.append("LEMON_ONLY_TEMPLATES") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "LEMON" + self.cpp_info.names["cmake_find_package_multi"] = "LEMON" + self.cpp_info.names["pkg_config"] = "lemon" diff --git a/recipes/coin-lemon/all/patches/0001-remove-register-keyword.patch b/recipes/coin-lemon/all/patches/0001-remove-register-keyword.patch new file mode 100644 index 0000000000000..dc78f03fdb7cc --- /dev/null +++ b/recipes/coin-lemon/all/patches/0001-remove-register-keyword.patch @@ -0,0 +1,15 @@ +diff --git a/lemon/random.h b/lemon/random.h +index 8de74ed..f9861f3 100644 +--- a/lemon/random.h ++++ b/lemon/random.h +@@ -249,8 +249,8 @@ namespace lemon { + + current = state + length; + +- register Word *curr = state + length - 1; +- register long num; ++ Word *curr = state + length - 1; ++ long num; + + num = length - shift; + while (num--) { diff --git a/recipes/coin-lemon/all/patches/cmake-add-runtime-destination_1.3.1.patch b/recipes/coin-lemon/all/patches/cmake-add-runtime-destination_1.3.1.patch new file mode 100644 index 0000000000000..310c19587e5ba --- /dev/null +++ b/recipes/coin-lemon/all/patches/cmake-add-runtime-destination_1.3.1.patch @@ -0,0 +1,12 @@ +diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt +index 4e6567e..dec0513 100644 +--- a/lemon/CMakeLists.txt ++++ b/lemon/CMakeLists.txt +@@ -68,6 +68,7 @@ INSTALL( + TARGETS lemon + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT library + ) + diff --git a/recipes/coin-lemon/all/test_package/CMakeLists.txt b/recipes/coin-lemon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5343530b3b283 --- /dev/null +++ b/recipes/coin-lemon/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(LEMON CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LEMON::LEMON) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/coin-lemon/all/test_package/conanfile.py b/recipes/coin-lemon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/coin-lemon/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/coin-lemon/all/test_package/test_package.cpp b/recipes/coin-lemon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7c329ab87f4a2 --- /dev/null +++ b/recipes/coin-lemon/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include "lemon/list_graph.h" + +using namespace lemon; +using namespace std; + +int main() +{ + ListDigraph g; + ListDigraph::Node u = g.addNode(); + ListDigraph::Node v = g.addNode(); + ListDigraph::Arc a = g.addArc(u, v); + cout << "Hello World! This is LEMON library here." << endl; + cout << "We have a directed graph with " << countNodes(g) << " nodes " + << "and " << countArcs(g) << " arc." << endl; + return 0; +} diff --git a/recipes/coin-lemon/all/test_v1_package/CMakeLists.txt b/recipes/coin-lemon/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/coin-lemon/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/coin-lemon/all/test_v1_package/conanfile.py b/recipes/coin-lemon/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/coin-lemon/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/coin-lemon/config.yml b/recipes/coin-lemon/config.yml new file mode 100644 index 0000000000000..71bf3f0e1bada --- /dev/null +++ b/recipes/coin-lemon/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.1": + folder: "all" diff --git a/recipes/coin-osi/all/conandata.yml b/recipes/coin-osi/all/conandata.yml new file mode 100644 index 0000000000000..0838e4d392f2d --- /dev/null +++ b/recipes/coin-osi/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "0.108.7": + url: "https://github.com/coin-or/Osi/archive/releases/0.108.7.tar.gz" + sha256: "f1bc53a498585f508d3f8d74792440a30a83c8bc934d0c8ecf8cd8bc0e486228" + "0.108.6": + url: "https://github.com/coin-or/Osi/archive/releases/0.108.6.tar.gz" + sha256: "984a5886825e2da9bf44d8a665f4b92812f0700e451c12baf9883eaa2315fad5" +patches: + "0.108.7": + - patch_file: "patches/0.108.6-0001-no-pkg-config-check.patch" + - patch_file: "patches/0.108.6-0002-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/coin-or/Osi/pull/177" + "0.108.6": + - patch_file: "patches/0.108.6-0001-no-pkg-config-check.patch" + - patch_file: "patches/0.108.6-0002-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/coin-or/Osi/pull/177" diff --git a/recipes/coin-osi/all/conanfile.py b/recipes/coin-osi/all/conanfile.py new file mode 100644 index 0000000000000..af104a9d3fcbb --- /dev/null +++ b/recipes/coin-osi/all/conanfile.py @@ -0,0 +1,137 @@ +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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, msvc_runtime_flag +import os + +required_conan_version = ">=1.57.0" + + +class CoinOsiConan(ConanFile): + name = "coin-osi" + description = "COIN-OR Linear Programming Solver" + topics = ("clp", "simplex", "solver", "linear", "programming") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin-or/Osi" + license = "EPL-2.0" + package_type = "library" + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("coin-utils/2.11.6") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("coin-osi does not support shared builds on Windows") + # FIXME: This issue likely comes from very old autotools versions used to produce configure. + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: + raise ConanInvalidConfiguration("coin-osi shared not supported yet when cross-building") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--without-blas", + "--without-lapack", + ]) + if is_msvc(self): + tc.extra_cxxflags.append("-EHsc") + tc.configure_args.append(f"--enable-msvc={msvc_runtime_flag(self)}") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", "lib -nologo") + if self._settings_build.os == "Windows": + # TODO: Something to fix in conan client or pkgconf recipe? + # This is a weird workaround when build machine is Windows. Here we have to inject regular + # Windows path to pc files folder instead of unix path flavor injected by AutotoolsToolchain... + env.define("PKG_CONFIG_PATH", self.generators_folder) + tc.generate(env) + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(args=["-j1"]) + 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) + if is_msvc(self): + for l in ("Osi", "OsiCommonTests"): + rename(self, os.path.join(self.package_folder, "lib", f"lib{l}.lib"), + os.path.join(self.package_folder, "lib", f"{l}.lib")) + + def package_info(self): + self.cpp_info.components["libosi"].set_property("pkg_config_name", "osi") + self.cpp_info.components["libosi"].libs = ["Osi"] + self.cpp_info.components["libosi"].includedirs = [os.path.join("include", "coin")] + self.cpp_info.components["libosi"].requires = ["coin-utils::coin-utils"] + + self.cpp_info.components["osi-unittests"].set_property("pkg_config_name", "osi-unittests") + self.cpp_info.components["osi-unittests"].libs = ["OsiCommonTests"] + self.cpp_info.components["osi-unittests"].requires = ["libosi"] diff --git a/recipes/coin-osi/all/patches/0.108.6-0001-no-pkg-config-check.patch b/recipes/coin-osi/all/patches/0.108.6-0001-no-pkg-config-check.patch new file mode 100644 index 0000000000000..1184cd58e52ba --- /dev/null +++ b/recipes/coin-osi/all/patches/0.108.6-0001-no-pkg-config-check.patch @@ -0,0 +1,13 @@ +--- Osi/Makefile.in ++++ Osi/Makefile.in +@@ -938,8 +938,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs osi > $(addlibsdir)/osi_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #$(PKG_CONFIG) --libs osi > $(addlibsdir)/osi_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libOsi.lib @OSILIB_LIBS_INSTALLED@" > $(addlibsdir)/osi_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lOsi @OSILIB_LIBS_INSTALLED@ > $(addlibsdir)/osi_addlibs.txt + diff --git a/recipes/coin-osi/all/patches/0.108.6-0002-cpp17-compat.patch b/recipes/coin-osi/all/patches/0.108.6-0002-cpp17-compat.patch new file mode 100644 index 0000000000000..959cc7915fe50 --- /dev/null +++ b/recipes/coin-osi/all/patches/0.108.6-0002-cpp17-compat.patch @@ -0,0 +1,28 @@ +--- a/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp ++++ b/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp +@@ -1317,8 +1317,9 @@ bool test16SebastianNowozin(OsiSolverInterface *si) + int rows_to_delete_arr[] = { 0 }; + si->deleteRows(1, rows_to_delete_arr); + +- std::transform(objective, objective + 4, objective, +- std::bind2nd(std::plus< double >(), 0.15)); ++ for (int i = 0; i < 4; ++i) { ++ objective[i] += 0.15; ++ } + si->setObjective(objective); + si->resolve(); + OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return false, *si, "test16SebastianNowozin second resolve"); +--- a/Osi/test/OsiTestSolverInterface.cpp ++++ b/Osi/test/OsiTestSolverInterface.cpp +@@ -464,8 +464,9 @@ OsiTestSolverInterface::resolve() + // Set the dual starting point + VOL_dvector& dsol = volprob_.dsol; + dsol.allocate(dsize); +- std::transform(rowprice_, rowprice_+dsize, dsol.v, +- std::bind2nd(std::multiplies(), objsense_)); ++ for (int i = 0; i < dsize; ++i) { ++ dsol.v[i] = rowprice_[i] * objsense_; ++ } + + // adjust the dual vector (if necessary) to be sure it's feasible + double * dv = dsol.v; diff --git a/recipes/coin-osi/all/test_package/CMakeLists.txt b/recipes/coin-osi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d49eef53308a3 --- /dev/null +++ b/recipes/coin-osi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(OsiUnitTests REQUIRED IMPORTED_TARGET osi-unittests) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::OsiUnitTests) diff --git a/recipes/coin-osi/all/test_package/conanfile.py b/recipes/coin-osi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..af1af0ebb3d7f --- /dev/null +++ b/recipes/coin-osi/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 +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "PkgConfigDeps", "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 not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + 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/coin-osi/all/test_package/test_package.cpp b/recipes/coin-osi/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f5c5b39ba2c84 --- /dev/null +++ b/recipes/coin-osi/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "OsiUnitTests.hpp" + +int main(int argc, char *argv[]) +{ + OsiCutsUnitTest(); + return 0; +} diff --git a/recipes/coin-osi/all/test_v1_package/CMakeLists.txt b/recipes/coin-osi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/coin-osi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/coin-osi/all/test_v1_package/conanfile.py b/recipes/coin-osi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/coin-osi/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/coin-osi/config.yml b/recipes/coin-osi/config.yml new file mode 100644 index 0000000000000..aca1ba23ffa90 --- /dev/null +++ b/recipes/coin-osi/config.yml @@ -0,0 +1,5 @@ +versions: + "0.108.7": + folder: "all" + "0.108.6": + folder: "all" diff --git a/recipes/coin-utils/all/conandata.yml b/recipes/coin-utils/all/conandata.yml new file mode 100644 index 0000000000000..d4916f7c0bcc0 --- /dev/null +++ b/recipes/coin-utils/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.11.6": + url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.6.tar.gz" + sha256: "6ea31d5214f7eb27fa3ffb2bdad7ec96499dd2aaaeb4a7d0abd90ef852fc79ca" + "2.11.4": + url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.4.tar.gz" + sha256: "d4effff4452e73356eed9f889efd9c44fe9cd68bd37b608a5ebb2c58bd45ef81" +patches: + "2.11.6": + - patch_file: "patches/0001-no-check-pkgconfig.patch" + - patch_file: "patches/0002-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" + "2.11.4": + - patch_file: "patches/0001-no-check-pkgconfig.patch" + - patch_file: "patches/0002-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" diff --git a/recipes/coin-utils/all/conanfile.py b/recipes/coin-utils/all/conanfile.py new file mode 100644 index 0000000000000..e953f7c06f675 --- /dev/null +++ b/recipes/coin-utils/all/conanfile.py @@ -0,0 +1,173 @@ +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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class CoinUtilsConan(ConanFile): + name = "coin-utils" + description = ( + "CoinUtils is an open-source collection of classes and helper " + "functions that are generally useful to multiple COIN-OR projects." + ) + topics = ("coin", "sparse", "matrix", "helper", "parsing", "representation") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin-or/CoinUtils" + license = "EPL-2.0" + + package_type = "library" + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("bzip2/1.0.8") + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("coin-utils does not provide a shared library on Windows") + # FIXME: This issue likely comes from very old autotools versions used to produce configure. + # It might be fixed by calling autoreconf, but https://github.com/coin-or-tools/BuildTools + # should be packaged and added to build requirements. + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: + raise ConanInvalidConfiguration("coin-utils shared not supported yet when cross-building") + + def build_requirements(self): + if is_msvc(self): + self.tool_requires("automake/1.16.5") + else: + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + 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.configure_args.append(f"--enable-msvc={self.settings.compiler.runtime}") + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + 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 build(self): + apply_conandata_patches(self) + if not is_msvc(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(args=["-j1"]) + 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) + if is_msvc(self): + rename(self, os.path.join(self.package_folder, "lib", "libCoinUtils.a"), + os.path.join(self.package_folder, "lib", "CoinUtils.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "coinutils") + self.cpp_info.libs = ["CoinUtils"] + self.cpp_info.includedirs.append(os.path.join("include", "coin")) + if not self.options.shared: + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] + if is_apple_os(self): + self.cpp_info.frameworks.append("Accelerate") diff --git a/recipes/coin-utils/all/patches/0001-no-check-pkgconfig.patch b/recipes/coin-utils/all/patches/0001-no-check-pkgconfig.patch new file mode 100644 index 0000000000000..bb060ee6642bb --- /dev/null +++ b/recipes/coin-utils/all/patches/0001-no-check-pkgconfig.patch @@ -0,0 +1,13 @@ +--- CoinUtils/Makefile.in ++++ CoinUtils/Makefile.in +@@ -842,8 +842,8 @@ + + install-data-hook: + @$(mkdir_p) "$(addlibsdir)" +-@COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ +-@COIN_HAS_PKGCONFIG_TRUE@ "$(PKG_CONFIG)" --libs coinutils > $(addlibsdir)/coinutils_addlibs.txt ++@COIN_HAS_PKGCONFIG_TRUE@ #PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@:$(DESTDIR)$(pkgconfiglibdir) \ ++@COIN_HAS_PKGCONFIG_TRUE@ #"$(PKG_CONFIG)" --libs coinutils > $(addlibsdir)/coinutils_addlibs.txt + @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libCoinUtils.lib @COINUTILSLIB_LIBS_INSTALLED@" > $(addlibsdir)/coinutils_addlibs.txt + @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lCoinUtils @COINUTILSLIB_LIBS_INSTALLED@ > $(addlibsdir)/coinutils_addlibs.txt + diff --git a/recipes/coin-utils/all/patches/0002-cpp17-compat.patch b/recipes/coin-utils/all/patches/0002-cpp17-compat.patch new file mode 100644 index 0000000000000..4e3f9a995048c --- /dev/null +++ b/recipes/coin-utils/all/patches/0002-cpp17-compat.patch @@ -0,0 +1,75 @@ +--- a/CoinUtils/src/CoinOslC.h ++++ b/CoinUtils/src/CoinOslC.h +@@ -34,30 +34,30 @@ + extern "C" { + #endif + +-int c_ekkbtrn(register const EKKfactinfo *fact, ++int c_ekkbtrn(const EKKfactinfo *fact, + double *dwork1, + int *mpt, int first_nonzero); +-int c_ekkbtrn_ipivrw(register const EKKfactinfo *fact, ++int c_ekkbtrn_ipivrw(const EKKfactinfo *fact, + double *dwork1, + int *mpt, int ipivrw, int *spare); + +-int c_ekketsj(register /*const*/ EKKfactinfo *fact, ++int c_ekketsj(/*const*/ EKKfactinfo *fact, + double *dwork1, + int *mpt2, double dalpha, int orig_nincol, + int npivot, int *nuspikp, + const int ipivrw, int *spare); +-int c_ekkftrn(register const EKKfactinfo *fact, ++int c_ekkftrn(const EKKfactinfo *fact, + double *dwork1, + double *dpermu, int *mpt, int numberNonZero); + +-int c_ekkftrn_ft(register EKKfactinfo *fact, ++int c_ekkftrn_ft(EKKfactinfo *fact, + double *dwork1, int *mpt, int *nincolp); +-void c_ekkftrn2(register EKKfactinfo *fact, double *dwork1, ++void c_ekkftrn2(EKKfactinfo *fact, double *dwork1, + double *dpermu1, int *mpt1, int *nincolp, + double *dwork1_ft, int *mpt_ft, int *nincolp_ft); + +-int c_ekklfct(register EKKfactinfo *fact); +-int c_ekkslcf(register const EKKfactinfo *fact); ++int c_ekklfct(EKKfactinfo *fact); ++int c_ekkslcf(const EKKfactinfo *fact); + inline void c_ekkscpy(int n, const int *marr1, int *marr2) + { + CoinMemcpyN(marr1, n, marr2); +--- a/CoinUtils/src/CoinOslFactorization2.cpp ++++ b/CoinUtils/src/CoinOslFactorization2.cpp +@@ -21,9 +21,9 @@ + extern int ets_count; + extern int ets_check; + #endif +-#define COIN_REGISTER register ++#define COIN_REGISTER + #define COIN_REGISTER2 +-#define COIN_REGISTER3 register ++#define COIN_REGISTER3 + #ifdef COIN_USE_RESTRICT + #define COIN_RESTRICT2 __restrict + #else +--- a/CoinUtils/src/CoinOslFactorization3.cpp ++++ b/CoinUtils/src/CoinOslFactorization3.cpp +@@ -1362,7 +1362,7 @@ static void c_ekkmltf(const EKKfactinfo *fact, double *dluval, int *hcoli, + } + } + } /* c_ekkmltf */ +-int c_ekklfct(register EKKfactinfo *fact) ++int c_ekklfct(EKKfactinfo *fact) + { + const int nrow = fact->nrow; + int ninbas = fact->xcsadr[nrow + 1] - 1; +@@ -2591,7 +2591,7 @@ inline void c_ekkclcp2(const int *hcol, const double *dels, const int *mrstrt, + } + } + } /* c_ekkclcp */ +-int c_ekkslcf(register const EKKfactinfo *fact) ++int c_ekkslcf(const EKKfactinfo *fact) + { + int *hrow = fact->xeradr; + int *hcol = fact->xecadr; diff --git a/recipes/coin-utils/all/test_package/CMakeLists.txt b/recipes/coin-utils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..761c9f0a9c670 --- /dev/null +++ b/recipes/coin-utils/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(CoinUtils REQUIRED IMPORTED_TARGET coinutils) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::CoinUtils) diff --git a/recipes/coin-utils/all/test_package/conanfile.py b/recipes/coin-utils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..af1af0ebb3d7f --- /dev/null +++ b/recipes/coin-utils/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 +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "PkgConfigDeps", "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 not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + 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/coin-utils/all/test_package/test_package.cpp b/recipes/coin-utils/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c17f18b7e9aef --- /dev/null +++ b/recipes/coin-utils/all/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#include "CoinPackedVector.hpp" + +#include +#include + +static void check(const char *s, int v) { + if (!v) { + fprintf(stderr, "FAIL: %s\n", s); + exit(1); + } +} + +#define STR(V) #V +#define CHECK(V) check(STR(V), (V)) + +int main () { + const int ne = 4; + const int inx[ne] = { 1, 4, 0, 2 }; + const double el[ne] = { 10., 40., 1., 50. }; + + CoinPackedVector r(ne, inx, el); + + CHECK(r.getIndices()[0] == 1); + CHECK(r.getIndices()[1] == 4); + CHECK(r.getIndices()[2] == 0); + + r.sortIncrElement(); + + CHECK(r.getIndices()[0] == 0); + CHECK(r.getIndices()[1] == 1); + CHECK(r.getIndices()[2] == 4); + + r.sortOriginalOrder(); + + CHECK(r.getIndices()[0] == 1); + CHECK(r.getIndices()[1] == 4); + CHECK(r.getIndices()[2] == 0); + + return 0; +} diff --git a/recipes/coin-utils/all/test_v1_package/CMakeLists.txt b/recipes/coin-utils/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/coin-utils/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/coin-utils/all/test_v1_package/conanfile.py b/recipes/coin-utils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/coin-utils/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/coin-utils/config.yml b/recipes/coin-utils/config.yml new file mode 100644 index 0000000000000..a116e38afc5df --- /dev/null +++ b/recipes/coin-utils/config.yml @@ -0,0 +1,5 @@ +versions: + "2.11.6": + folder: "all" + "2.11.4": + folder: "all" diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml new file mode 100644 index 0000000000000..d18c4f077249e --- /dev/null +++ b/recipes/commata/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.4": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.4.tar.gz" + sha256: "2d154c1ed7bbf6551729bcc5baf581613f6605df080ada35a9e107648d255e2e" + "0.2.3": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.3.tar.gz" + sha256: "47521aa27b26fe650bd985c4e07df44453f9d09ab0d61ee98dd6877afe4c25a0" diff --git a/recipes/commata/all/conanfile.py b/recipes/commata/all/conanfile.py new file mode 100644 index 0000000000000..bde274af4ceeb --- /dev/null +++ b/recipes/commata/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 get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class CommataConan(ConanFile): + name = "commata" + description = "Just another header-only C++17 CSV parser" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/furfurylic/commata" + topics = ("csv", "parser", "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": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/commata/all/test_package/CMakeLists.txt b/recipes/commata/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f69f5f2677dd5 --- /dev/null +++ b/recipes/commata/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(commata REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE commata::commata) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/commata/all/test_package/conanfile.py b/recipes/commata/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/commata/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/commata/all/test_package/test_package.cpp b/recipes/commata/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5221c81aef901 --- /dev/null +++ b/recipes/commata/all/test_package/test_package.cpp @@ -0,0 +1,58 @@ +#include +#include + +#include "commata/parse_csv.hpp" + +template +class test_collector +{ + std::vector>>* field_values_; + std::basic_string field_value_; + +public: + using char_type = Ch; + + explicit test_collector( + std::vector>>& field_values) : + field_values_(&field_values) + {} + + void start_record(const Ch* /*record_begin*/) + { + field_values_->emplace_back(); + } + + void update(const Ch* first, const Ch* last) + { + field_value_.append(first, last); + } + + void finalize(const Ch* first, const Ch* last) + { + field_value_.append(first, last); + field_values_->back().emplace_back(); + field_values_->back().back().swap(field_value_); + // field_value_ is cleared here + } + + void end_record(const Ch* /*record_end*/) + {} +}; + +int main(void) { + std::string s = R"(,"col1", col2 ,col3,)" "\r\n" + "\n" + R"( cell10 ,,"cell)" "\r\n" + R"(12","cell""13""","")" "\n"; + + std::stringbuf buf(s); + + std::vector> field_values; + + test_collector collector(field_values); + commata::parse_csv(&buf, collector); + + std::cout << field_values.size() << '\n'; + + return 0; +} diff --git a/recipes/commata/all/test_v1_package/CMakeLists.txt b/recipes/commata/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/commata/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/commata/all/test_v1_package/conanfile.py b/recipes/commata/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/commata/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml new file mode 100644 index 0000000000000..199edf0f60679 --- /dev/null +++ b/recipes/commata/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.4": + folder: all + "0.2.3": + folder: all diff --git a/recipes/concurrencpp/all/conandata.yml b/recipes/concurrencpp/all/conandata.yml new file mode 100644 index 0000000000000..10f8a2f01e821 --- /dev/null +++ b/recipes/concurrencpp/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "0.1.6": + url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.6.tar.gz" + sha256: "e7d5c23a73ff1d7199d361d3402ad2a710dfccf7630b622346df94a7532b4221" + "0.1.5": + url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.5.tar.gz" + sha256: "330150ebe11b3d30ffcb3efdecc184a34cf50a6bd43b68e294a496225d286651" + "0.1.4": + url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.4.tar.gz" + sha256: "3ad9424f975b766accc6eaedf4acfe1a20b5fdbb57fa3ae71f400e13d471e86f" +patches: + "0.1.6": + - patch_file: "patches/cmake-min-version.patch" + - patch_file: "patches/directory-name-0.1.6.patch" + "0.1.5": + - patch_file: "patches/cmake-min-version.patch" + - patch_file: "patches/directory-name-0.1.5.patch" + "0.1.4": + - patch_file: "patches/cmake-min-version.patch" + - patch_file: "patches/directory-name.patch" diff --git a/recipes/concurrencpp/all/conanfile.py b/recipes/concurrencpp/all/conanfile.py new file mode 100644 index 0000000000000..64da9a5493cb8 --- /dev/null +++ b/recipes/concurrencpp/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ConcurrencppConan(ConanFile): + name = "concurrencpp" + description = "Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all." + homepage = "https://github.com/David-Haim/concurrencpp" + topics = ("scheduler", "coroutines", "concurrency", "tasks", "executors", "timers", "await", "multithreading") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "20" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "clang": "11", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if Version(self.version) <= "0.1.5" and self.options.shared and is_msvc(self): + # see https://github.com/David-Haim/concurrencpp/issues/75 + raise ConanInvalidConfiguration(f"{self.ref} does not support shared builds with Visual Studio") + if self.settings.compiler == "gcc": + raise ConanInvalidConfiguration("gcc is not supported by concurrencpp") + if Version(self.version) >= "0.1.5" and self.settings.compiler == "apple-clang": + # apple-clang does not seem to support the C++20 synchronization library which concurrencpp 0.1.5 depends on + raise ConanInvalidConfiguration("apple-clang is not supported by concurrencpp 0.1.5 and higher") + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": + raise ConanInvalidConfiguration("libc++ required") + + 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): + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "concurrencpp") + self.cpp_info.set_property("cmake_target_name", "concurrencpp::concurrencpp") + self.cpp_info.libs = ["concurrencpp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread", "rt"] diff --git a/recipes/concurrencpp/all/patches/cmake-min-version.patch b/recipes/concurrencpp/all/patches/cmake-min-version.patch new file mode 100644 index 0000000000000..382d5c856d005 --- /dev/null +++ b/recipes/concurrencpp/all/patches/cmake-min-version.patch @@ -0,0 +1,8 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,3 @@ +-cmake_minimum_required(VERSION 3.16) ++cmake_minimum_required(VERSION 3.15) + + project(concurrencpp diff --git a/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch b/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch new file mode 100644 index 0000000000000..73d77806a9b8a --- /dev/null +++ b/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -104,8 +104,8 @@ include(CMakePackageConfigHelpers) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + +-set(concurrencpp_directory "concurrencpp-${PROJECT_VERSION}") +-set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${concurrencpp_directory}") ++set(concurrencpp_directory "concurrencpp") ++set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") + + install(TARGETS concurrencpp + EXPORT concurrencppTargets diff --git a/recipes/concurrencpp/all/patches/directory-name-0.1.6.patch b/recipes/concurrencpp/all/patches/directory-name-0.1.6.patch new file mode 100644 index 0000000000000..8a56c4af6669b --- /dev/null +++ b/recipes/concurrencpp/all/patches/directory-name-0.1.6.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -116,8 +116,8 @@ include(CMakePackageConfigHelpers) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + +-set(concurrencpp_directory "concurrencpp-${PROJECT_VERSION}") +-set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${concurrencpp_directory}") ++set(concurrencpp_directory "concurrencpp") ++set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") + + install( + TARGETS concurrencpp diff --git a/recipes/concurrencpp/all/patches/directory-name.patch b/recipes/concurrencpp/all/patches/directory-name.patch new file mode 100644 index 0000000000000..b79525132cfac --- /dev/null +++ b/recipes/concurrencpp/all/patches/directory-name.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -99,8 +99,8 @@ include(CMakePackageConfigHelpers) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + +-set(concurrencpp_directory "concurrencpp-${PROJECT_VERSION}") +-set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${concurrencpp_directory}") ++set(concurrencpp_directory "concurrencpp") ++set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") + + install(TARGETS concurrencpp + EXPORT concurrencppTargets diff --git a/recipes/concurrencpp/all/test_package/CMakeLists.txt b/recipes/concurrencpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a9efdb5e56ab --- /dev/null +++ b/recipes/concurrencpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(concurrencpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE concurrencpp::concurrencpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/concurrencpp/all/test_package/conanfile.py b/recipes/concurrencpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/concurrencpp/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/concurrencpp/all/test_package/test_package.cpp b/recipes/concurrencpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c34af08342f09 --- /dev/null +++ b/recipes/concurrencpp/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "concurrencpp/concurrencpp.h" +#include + +int main() { + concurrencpp::runtime runtime; + auto result = runtime.thread_executor()->submit([] { + std::cout << "hello world" << std::endl; + }); + + result.get(); + return 0; +} diff --git a/recipes/concurrencpp/all/test_v1_package/CMakeLists.txt b/recipes/concurrencpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/concurrencpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/concurrencpp/all/test_v1_package/conanfile.py b/recipes/concurrencpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/concurrencpp/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/concurrencpp/config.yml b/recipes/concurrencpp/config.yml new file mode 100644 index 0000000000000..8388e594bacff --- /dev/null +++ b/recipes/concurrencpp/config.yml @@ -0,0 +1,7 @@ +versions: + "0.1.6": + folder: all + "0.1.5": + folder: all + "0.1.4": + folder: all diff --git a/recipes/concurrentqueue/all/conandata.yml b/recipes/concurrentqueue/all/conandata.yml new file mode 100644 index 0000000000000..4a3b84f1e1032 --- /dev/null +++ b/recipes/concurrentqueue/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.3": + url: https://github.com/cameron314/concurrentqueue/archive/v1.0.3.zip + sha256: 5e9e229a1791e8299dcd4bd73ac1be1953424a903818feb7afd929eb16094ef5 + "1.0.2": + url: https://github.com/cameron314/concurrentqueue/archive/v1.0.2.zip + sha256: 6dc85de0e38a014471fe3c653e3e21dc38a5f069cfc031a90fa59f0a45f7584f + "1.0.1": + url: https://github.com/cameron314/concurrentqueue/archive/v1.0.1.zip + sha256: b31dca11745ef331756109af838e3689462fbbc2c52dda9f7e1c416778f1f35b diff --git a/recipes/concurrentqueue/all/conanfile.py b/recipes/concurrentqueue/all/conanfile.py new file mode 100644 index 0000000000000..866dbaf480b38 --- /dev/null +++ b/recipes/concurrentqueue/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class ConcurrentqueueConan(ConanFile): + name = "concurrentqueue" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cameron314/concurrentqueue" + description = "A fast multi-producer, multi-consumer lock-free concurrent queue for C++11" + topics = ("cpp11", "cpp14", "cpp17", "queue", "lock-free") + license = ["BSD-2-Clause", "BSL-1.0"] + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + for file in ["blockingconcurrentqueue.h", "concurrentqueue.h", "lightweightsemaphore.h"]: + copy(self, file, src=self.source_folder, dst=os.path.join(self.package_folder, "include", "moodycamel")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "concurrentqueue") + self.cpp_info.set_property("cmake_target_name", "concurrentqueue::concurrentqueue") + self.cpp_info.includedirs.append(os.path.join("include", "moodycamel")) + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/concurrentqueue/all/test_package/CMakeLists.txt b/recipes/concurrentqueue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a0355afc44419 --- /dev/null +++ b/recipes/concurrentqueue/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(concurrentqueue REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE concurrentqueue::concurrentqueue) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/concurrentqueue/all/test_package/conanfile.py b/recipes/concurrentqueue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/concurrentqueue/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/concurrentqueue/all/test_package/test_package.cpp b/recipes/concurrentqueue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e841e6bc3bd22 --- /dev/null +++ b/recipes/concurrentqueue/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + moodycamel::ConcurrentQueue q; + return 0; +} diff --git a/recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt b/recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f4b988bcfd06 --- /dev/null +++ b/recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(concurrentqueue REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE concurrentqueue::concurrentqueue) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/concurrentqueue/all/test_v1_package/conanfile.py b/recipes/concurrentqueue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/concurrentqueue/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/concurrentqueue/config.yml b/recipes/concurrentqueue/config.yml new file mode 100644 index 0000000000000..df27cd90727cc --- /dev/null +++ b/recipes/concurrentqueue/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.3": + folder: all + "1.0.2": + folder: all + "1.0.1": + folder: all diff --git a/recipes/confu_json/all/conandata.yml b/recipes/confu_json/all/conandata.yml new file mode 100644 index 0000000000000..5d78ae9d25a41 --- /dev/null +++ b/recipes/confu_json/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.0": + url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.0.0.tar.gz" + sha256: "f165172220b440d37a7a8301e490cf791b3b25b0cc3f2a08b355609c5f777db0" + "0.0.10": + url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.10.tar.gz" + sha256: "b31aab1bce952c0dc0bfc1f955a7b88be5103350b5a5eee1a4586ccec0e51fc1" + "0.0.9": + url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.9.tar.gz" + sha256: "29b2940b939cb04f11fdab4964c86bcb23ac75c588550bf54048e024444d2718" + "0.0.5": + url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.5.tar.gz" + sha256: "bc506d4b7836a7689b1c6a2d89bb0c3441f774c8f845fef79d85c71099df5bf9" diff --git a/recipes/confu_json/all/conanfile.py b/recipes/confu_json/all/conanfile.py new file mode 100644 index 0000000000000..3137417ca016a --- /dev/null +++ b/recipes/confu_json/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.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.1" + + +class ConfuJson(ConanFile): + name = "confu_json" + homepage = "https://github.com/werto87/confu_json" + description = "uses boost::fusion to help with serialization; json <-> user defined type" + topics = ("json parse", "serialization", "user defined type") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" if Version(self.version) < "1.0.0" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "Visual Studio": "17", + "msvc": "193", + "gcc": "7", + "clang": "7", + }, + "20": { + "Visual Studio": "17", + "msvc": "193", + "gcc": "10", + "clang": "10", + }, + }.get(self._min_cppstd, {}) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0") + self.requires("magic_enum/0.8.2") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("apple-clang is not supported. Pull request welcome") + + if self.settings.compiler == "gcc" and Version(self.version) < "1.0.0": + raise ConanInvalidConfiguration("gcc is only supported in versions greater than or equal 1.0.0.") + + if is_msvc(self) and Version(self.version) < "0.0.9": + raise ConanInvalidConfiguration("Visual Studio is not supported in versions before confu_json/0.0.9") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h*", src=os.path.join(self.source_folder, "confu_json"), + dst=os.path.join(self.package_folder, "include", "confu_json")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/confu_json/all/test_package/CMakeLists.txt b/recipes/confu_json/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cbb13e9d5f0af --- /dev/null +++ b/recipes/confu_json/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(confu_json REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE confu_json::confu_json) +if(confu_json_VERSION VERSION_LESS "1.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/confu_json/all/test_package/conanfile.py b/recipes/confu_json/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/confu_json/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/confu_json/all/test_package/test_package.cpp b/recipes/confu_json/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e1edc3931571a --- /dev/null +++ b/recipes/confu_json/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include "confu_json/confu_json.hxx" +#include // this file should be included only in one translation unit + +BOOST_FUSION_DEFINE_STRUCT((shared_class), Nested, + (long, answer)) // used to define a struct + +int main() { + using namespace confu_json; + auto nested = shared_class::Nested{}; + nested.answer = 42; + std::cout << to_json(nested) + << std::endl; // converts the struct into json and prints it + auto nestedTest = to_object( + to_json(nested)); // converts the struct into json and back into an object + assert(nested.answer == nestedTest.answer); +} diff --git a/recipes/confu_json/all/test_v1_package/CMakeLists.txt b/recipes/confu_json/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/confu_json/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/confu_json/all/test_v1_package/conanfile.py b/recipes/confu_json/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/confu_json/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/confu_json/config.yml b/recipes/confu_json/config.yml new file mode 100644 index 0000000000000..337baede02ad0 --- /dev/null +++ b/recipes/confu_json/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.0": + folder: all + "0.0.10": + folder: all + "0.0.9": + folder: all + "0.0.5": + folder: all diff --git a/recipes/continuable/all/conandata.yml b/recipes/continuable/all/conandata.yml new file mode 100644 index 0000000000000..13887549bde39 --- /dev/null +++ b/recipes/continuable/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.2.1": + url: "https://github.com/Naios/continuable/archive/4.2.1.tar.gz" + sha256: "19c7c2371c94ec759eac8169dea593703b54057551322b5d682643548c9c0146" + "4.2.0": + url: "https://github.com/Naios/continuable/archive/4.2.0.tar.gz" + sha256: "d85bed930ac19d4b36b23778ad9ae943c2981f7492982bd51dadb89e8908d53f" + "4.1.0": + sha256: "CBCF50B1B73D8B4EB54734C827D6736CD038960E13F80699958DBB87F1827650" + url: "https://github.com/Naios/continuable/archive/4.1.0.tar.gz" diff --git a/recipes/continuable/all/conanfile.py b/recipes/continuable/all/conanfile.py new file mode 100644 index 0000000000000..7a8754a12145a --- /dev/null +++ b/recipes/continuable/all/conanfile.py @@ -0,0 +1,92 @@ +import os + +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.28.0" + + +class ContinuableConan(ConanFile): + name = "continuable" + description = "C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)" + topics = "asynchronous", "future", "coroutines", "header-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Naios/continuable" + license = "MIT" + settings = "os", "compiler" + no_copy_source = True + requires = ( + "function2/4.1.0", + ) + options = { + # Exceptions are disabled and `std::error_condition` is used as error_type. See tutorial-chaining-continuables-fail for details. + "no_exceptions": [True, False], + # Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` is used as error_type. + # See tutorial-chaining-continuables-fail for details. + "custom_error_type": [True, False], + # Allows unhandled exceptions in asynchronous call hierarchies. See tutorial-chaining-continuables-fail for details. + "unhandled_exceptions": [True, False], + # Allows to customize the final callback which can be used to implement custom unhandled asynchronous exception handlers. + "custom_final_callback": [True, False], + # Don"t decorate the used type erasure, which is done to keep type names minimal for better error messages in debug builds. + "immediate_types": [True, False], + } + default_options = { + "no_exceptions": False, + "custom_error_type": False, + "unhandled_exceptions": False, + "custom_final_callback": False, + "immediate_types": False + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + minimal_cpp_standard = "14" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warn( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "continuable-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst=os.path.join("include", "continuable"), src=os.path.join(self._source_subfolder, "include", "continuable")) + + def package_info(self): + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") + if self.options.no_exceptions: + self.cpp_info.defines.append("CONTINUABLE_WITH_NO_EXCEPTIONS") + if self.options.custom_error_type: + self.cpp_info.defines.append("CONTINUABLE_WITH_CUSTOM_ERROR_TYPE") + if self.options.unhandled_exceptions: + self.cpp_info.defines.append("CONTINUABLE_WITH_UNHANDLED_EXCEPTIONS") + if self.options.custom_final_callback: + self.cpp_info.defines.append("CONTINUABLE_WITH_CUSTOM_FINAL_CALLBACK") + if self.options.immediate_types: + self.cpp_info.defines.append("CONTINUABLE_WITH_IMMEDIATE_TYPES") + + def package_id(self): + self.info.header_only() diff --git a/recipes/continuable/all/test_package/CMakeLists.txt b/recipes/continuable/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7dd0ea22e1254 --- /dev/null +++ b/recipes/continuable/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +set_target_properties( + ${PROJECT_NAME} PROPERTIES + + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON +) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/continuable/all/test_package/conanfile.py b/recipes/continuable/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/continuable/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/continuable/all/test_package/test_package.cpp b/recipes/continuable/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b26567acd4b10 --- /dev/null +++ b/recipes/continuable/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include "continuable/continuable.hpp" + +int main(int, char**) { + cti::make_ready_continuable("..."); + + return 0; +} diff --git a/recipes/continuable/config.yml b/recipes/continuable/config.yml new file mode 100644 index 0000000000000..52fa67bcd41e8 --- /dev/null +++ b/recipes/continuable/config.yml @@ -0,0 +1,7 @@ +versions: + "4.2.1": + folder: all + "4.2.0": + folder: all + "4.1.0": + folder: all diff --git a/recipes/corrade/all/CMakeLists.txt b/recipes/corrade/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/corrade/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/corrade/all/cmake/conan-corrade-vars.cmake b/recipes/corrade/all/cmake/conan-corrade-vars.cmake new file mode 100644 index 0000000000000..c098a20adb237 --- /dev/null +++ b/recipes/corrade/all/cmake/conan-corrade-vars.cmake @@ -0,0 +1,61 @@ + +# Here we are reproducing the variables and call performed by the FindCorrade.cmake provided by the library + +# Read flags from configuration +file(READ "${CMAKE_CURRENT_LIST_DIR}/../../include/Corrade/configure.h" _corradeConfigure) +string(REGEX REPLACE ";" "\\\\;" _corradeConfigure "${_corradeConfigure}") +string(REGEX REPLACE "\n" ";" _corradeConfigure "${_corradeConfigure}") +set(_corradeFlags + MSVC2015_COMPATIBILITY + MSVC2017_COMPATIBILITY + MSVC2019_COMPATIBILITY + BUILD_DEPRECATED + BUILD_STATIC + BUILD_STATIC_UNIQUE_GLOBALS + BUILD_MULTITHREADED + TARGET_UNIX + TARGET_APPLE + TARGET_IOS + TARGET_IOS_SIMULATOR + TARGET_WINDOWS + TARGET_WINDOWS_RT + TARGET_EMSCRIPTEN + TARGET_ANDROID + # TARGET_X86 etc and TARGET_LIBCXX are not exposed to CMake as the meaning + # is unclear on platforms with multi-arch binaries or when mixing different + # STL implementations. TARGET_GCC etc are figured out via UseCorrade.cmake, + # as the compiler can be different when compiling the lib & when using it. + PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT + TESTSUITE_TARGET_XCTEST + UTILITY_USE_ANSI_COLORS) +foreach(_corradeFlag ${_corradeFlags}) + list(FIND _corradeConfigure "#define CORRADE_${_corradeFlag}" _corrade_${_corradeFlag}) + if(NOT _corrade_${_corradeFlag} EQUAL -1) + set(CORRADE_${_corradeFlag} 1) + endif() +endforeach() + + +# Corrade::rc, a target with just an executable +if(NOT TARGET Corrade::rc) + if(CMAKE_CROSSCOMPILING) + find_program(CORRADE_RC_PROGRAM + NAMES corrade-rc + PATHS ENV + PATH NO_DEFAULT_PATH) + else() + find_program(CORRADE_RC_PROGRAM + NAMES corrade-rc + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH) + endif() + + get_filename_component(CORRADE_RC_PROGRAM "${CORRADE_RC_PROGRAM}" ABSOLUTE) + + add_executable(Corrade::rc IMPORTED) + set_property(TARGET Corrade::rc PROPERTY IMPORTED_LOCATION ${CORRADE_RC_PROGRAM}) +endif() + +# Include and declare other build modules +include("${CMAKE_CURRENT_LIST_DIR}/UseCorrade.cmake") +set(CORRADE_LIB_SUFFIX_MODULE "${CMAKE_CURRENT_LIST_DIR}/CorradeLibSuffix.cmake") diff --git a/recipes/corrade/all/conandata.yml b/recipes/corrade/all/conandata.yml new file mode 100644 index 0000000000000..4b0cd1b7fd3fb --- /dev/null +++ b/recipes/corrade/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "2020.06": + sha256: 2a62492ccc717422b72f2596a3e1a6a105b9574aa9467917f12d19ef3aab1341 + url: https://github.com/mosra/corrade/archive/v2020.06.tar.gz + "2019.10": + sha256: 19dbf3c0b28a06a7017d627ee7b84c23b994c469198c1134a8aeba9cfbff7ec3 + url: https://github.com/mosra/corrade/archive/v2019.10.tar.gz +patches: + "2020.06": + - base_path: "source_subfolder" + patch_file: "patches/2020.06/0001-emscripten-toolchain.patch" + # patch_type: "portability" + # description: "Remove unnecessary dependency on UseEmscripten" + # source: "https://github.com/mosra/corrade/issues/104" diff --git a/recipes/corrade/all/conanfile.py b/recipes/corrade/all/conanfile.py new file mode 100644 index 0000000000000..dcff18b711642 --- /dev/null +++ b/recipes/corrade/all/conanfile.py @@ -0,0 +1,189 @@ +from conan.tools.microsoft import is_msvc +from conan.tools.microsoft.visual import vs_ide_version +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.45.0" + + +class CorradeConan(ConanFile): + name = "corrade" + description = "Corrade is a multiplatform utility library written in C++11/C++14." + topics = ("corrade", "magnum", "filesystem", "console", "environment", "os") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://magnum.graphics/corrade" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_deprecated": [True, False], + "with_interconnect": [True, False], + "with_main": [True, False], + "with_pluginmanager": [True, False], + "with_testsuite": [True, False], + "with_utility": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_deprecated": True, + "with_interconnect": True, + "with_main": True, + "with_pluginmanager": True, + "with_testsuite": True, + "with_utility": True, + } + + generators = "cmake" + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + self.copy("cmake/*") + 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 + + def validate(self): + if is_msvc(self) and tools.Version(vs_ide_version(self)) < 14: + raise ConanInvalidConfiguration("Corrade requires Visual Studio version 14 or greater") + + if not self.options.with_utility and (self.options.with_testsuite or self.options.with_interconnect or self.options.with_pluginmanager): + raise ConanInvalidConfiguration("Component 'utility' is required for 'test_suite', 'interconnect' and 'plugin_manager'") + + def build_requirements(self): + if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): + self.build_requires("corrade/{}".format(self.version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_STATIC"] = not self.options.shared + cmake.definitions["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False) + + cmake.definitions["BUILD_DEPRECATED"] = self.options.build_deprecated + cmake.definitions["WITH_INTERCONNECT"] = self.options.with_interconnect + cmake.definitions["WITH_MAIN"] = self.options.with_main + cmake.definitions["WITH_PLUGINMANAGER"] = self.options.with_pluginmanager + cmake.definitions["WITH_TESTSUITE"] = self.options.with_testsuite + cmake.definitions["WITH_UTILITY"] = self.options.with_utility + cmake.definitions["WITH_RC"] = self.options.with_utility + + # Corrade uses suffix on the resulting "lib"-folder when running cmake.install() + # Set it explicitly to empty, else Corrade might set it implicitly (eg. to "64") + cmake.definitions["LIB_SUFFIX"] = "" + + if is_msvc(self): + cmake.definitions["MSVC2015_COMPATIBILITY"] = vs_ide_version(self) == "14" + cmake.definitions["MSVC2017_COMPATIBILITY"] = vs_ide_version(self) == "15" + cmake.definitions["MSVC2019_COMPATIBILITY"] = vs_ide_version(self) == "16" + + cmake.configure(build_folder=self._build_subfolder) + + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + share_cmake = os.path.join(self.package_folder, "share", "cmake", "Corrade") + self.copy("UseCorrade.cmake", src=share_cmake, dst=os.path.join(self.package_folder, "lib", "cmake")) + self.copy("CorradeLibSuffix.cmake", src=share_cmake, dst=os.path.join(self.package_folder, "lib", "cmake")) + self.copy("*.cmake", src=os.path.join(self.source_folder, "cmake"), dst=os.path.join("lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Corrade") + self.cpp_info.names["cmake_find_package"] = "Corrade" + self.cpp_info.names["cmake_find_package_multi"] = "Corrade" + + suffix = "-d" if self.settings.build_type == "Debug" else "" + + # The FindCorrade.cmake file provided by the library populates some extra stuff + self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "conan-corrade-vars.cmake")]) + self.cpp_info.components["_corrade"].build_modules.append(os.path.join("lib", "cmake", "conan-corrade-vars.cmake")) + + if self.options.with_main: + self.cpp_info.components["main"].set_property("cmake_target_name", "Corrade::Main") + self.cpp_info.components["main"].names["cmake_find_package"] = "Main" + self.cpp_info.components["main"].names["cmake_find_package_multi"] = "Main" + if self.settings.os == "Windows": + self.cpp_info.components["main"].libs = ["CorradeMain" + suffix] + self.cpp_info.components["main"].requires = ["_corrade"] + + if self.options.with_utility: + self.cpp_info.components["utility"].set_property("cmake_target_name", "Corrade::Utility") + self.cpp_info.components["utility"].names["cmake_find_package"] = "Utility" + self.cpp_info.components["utility"].names["cmake_find_package_multi"] = "Utility" + self.cpp_info.components["utility"].libs = ["CorradeUtility" + suffix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["utility"].system_libs = ["m", "dl"] + self.cpp_info.components["utility"].requires = ["_corrade"] + + # This one is statically linked into utility + #self.cpp_info.components["containers"].set_property("cmake_target_name", "Corrade::Containers") + #self.cpp_info.components["containers"].names["cmake_find_package"] = "Containers" + #self.cpp_info.components["containers"].names["cmake_find_package_multi"] = "Containers" + #self.cpp_info.components["containers"].libs = ["CorradeContainers" + suffix] + + if self.options.with_interconnect: + self.cpp_info.components["interconnect"].set_property("cmake_target_name", "Corrade::Interconnect") + self.cpp_info.components["interconnect"].names["cmake_find_package"] = "Interconnect" + self.cpp_info.components["interconnect"].names["cmake_find_package_multi"] = "Interconnect" + self.cpp_info.components["interconnect"].libs = ["CorradeInterconnect" + suffix] + self.cpp_info.components["interconnect"].requires = ["utility"] + + if self.options.with_pluginmanager: + self.cpp_info.components["plugin_manager"].set_property("cmake_target_name", "Corrade::PluginManager") + self.cpp_info.components["plugin_manager"].names["cmake_find_package"] = "PluginManager" + self.cpp_info.components["plugin_manager"].names["cmake_find_package_multi"] = "PluginManager" + self.cpp_info.components["plugin_manager"].libs = ["CorradePluginManager" + suffix] + self.cpp_info.components["plugin_manager"].requires = ["utility"] + + if self.options.with_testsuite: + self.cpp_info.components["test_suite"].set_property("cmake_target_name", "Corrade::TestSuite") + self.cpp_info.components["test_suite"].names["cmake_find_package"] = "TestSuite" + self.cpp_info.components["test_suite"].names["cmake_find_package_multi"] = "TestSuite" + self.cpp_info.components["test_suite"].libs = ["CorradeTestSuite" + suffix] + self.cpp_info.components["test_suite"].requires = ["utility"] + + if self.options.with_utility: + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + # pkg_config: Add more explicit naming to generated files (avoid filesystem collision). + for key, cmp in self.cpp_info.components.items(): + self.cpp_info.components[key].names["pkg_config"] = "{}_{}".format(self.name, key) diff --git a/recipes/corrade/all/patches/2020.06/0001-emscripten-toolchain.patch b/recipes/corrade/all/patches/2020.06/0001-emscripten-toolchain.patch new file mode 100644 index 0000000000000..0ed74b13960f9 --- /dev/null +++ b/recipes/corrade/all/patches/2020.06/0001-emscripten-toolchain.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e0cc288..81e919e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -223,9 +223,6 @@ if(TESTSUITE_TARGET_XCTEST) + endif() + + include(UseCorrade) +-if(CORRADE_TARGET_EMSCRIPTEN) +- include(UseEmscripten) +-endif() + + # Installation paths + include(CorradeLibSuffix) +diff --git a/modules/UseCorrade.cmake b/modules/UseCorrade.cmake +index 8276c71..d0800a0 100644 +--- a/modules/UseCorrade.cmake ++++ b/modules/UseCorrade.cmake +@@ -319,11 +319,6 @@ if(CORRADE_TESTSUITE_TARGET_XCTEST) + endif() + endif() + +-if(CORRADE_TARGET_EMSCRIPTEN) +- # For bundling files to the tests +- include(UseEmscripten) +-endif() +- + if(CORRADE_TARGET_IOS AND NOT CORRADE_TESTSUITE_TARGET_XCTEST) + set(CORRADE_TESTSUITE_BUNDLE_IDENTIFIER_PREFIX ${PROJECT_NAME} CACHE STRING + "Bundle identifier prefix for tests ran on iOS device") +@@ -434,7 +429,17 @@ function(corrade_add_test test_name) + string(REGEX REPLACE ${_corrade_file_pair_match} "${_corrade_file_pair_replace}" file_pair ${file}) + list(GET file_pair 0 input_filename) + list(GET file_pair 1 output_filename) +- emscripten_embed_file(${test_name} ${input_filename} "/${output_filename}") ++ ++ # This is a verbatim copy of emscripten_embed_file() from ++ # UseEmscripten inside the toolchains submodule. It's not ++ # included in order to avoid a dependency on the toolchains and ++ # thus allow 3rd party toolchains to be used instead. ++ get_filename_component(absolute_file ${input_filename} ABSOLUTE) ++ get_target_property(${test_name}_LINK_FLAGS ${test_name} LINK_FLAGS) ++ if(NOT ${test_name}_LINK_FLAGS) ++ set(${test_name}_LINK_FLAGS ) ++ endif() ++ set_target_properties(${test_name} PROPERTIES LINK_FLAGS "${${test_name}_LINK_FLAGS} --embed-file ${absolute_file}@/${output_filename}") + endforeach() + + # Generate the runner file, first replacing ${test_name} with diff --git a/recipes/corrade/all/test_package/CMakeLists.txt b/recipes/corrade/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e4c1f34b721de --- /dev/null +++ b/recipes/corrade/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Corrade REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} Corrade::Main) +if(VERSION_2019_10) + target_compile_definitions(${PROJECT_NAME} PRIVATE VERSION_2019_10) +endif() +if(WITH_UTILITY) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_UTILITY) + target_link_libraries(${PROJECT_NAME} Corrade::Utility) +endif() + +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) diff --git a/recipes/corrade/all/test_package/conanfile.py b/recipes/corrade/all/test_package/conanfile.py new file mode 100644 index 0000000000000..be914f107e121 --- /dev/null +++ b/recipes/corrade/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_UTILITY"] = self.options["corrade"].with_utility + if self.deps_cpp_info["corrade"].version == "2019.10": + cmake.definitions["VERSION_2019_10"] = True + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + + if self.options["corrade"].with_utility: + # Run corrade-rc + self.run("corrade-rc --help", run_environment=True) + + if self.settings.os == "Emscripten": + bin_path = os.path.join("bin", "test_package.js") + self.run("node {}".format(bin_path), run_environment=True) diff --git a/recipes/corrade/all/test_package/test_package.cpp b/recipes/corrade/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8f5dc321a44de --- /dev/null +++ b/recipes/corrade/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include // Here it is 'nothing' + +#ifndef VERSION_2019_10 + #include +#endif + +#ifdef WITH_UTILITY + #include +#endif + + +int main() { + std::cout << "Test package for Corrade\n"; + + #ifndef VERSION_2019_10 + std::cout << "Corrade " << CORRADE_VERSION_YEAR << "." << CORRADE_VERSION_MONTH << std::endl; + #endif + + #ifdef WITH_UTILITY + Corrade::Utility::Debug{} << "Success"; + #endif +} diff --git a/recipes/corrade/config.yml b/recipes/corrade/config.yml new file mode 100644 index 0000000000000..5457983d744c1 --- /dev/null +++ b/recipes/corrade/config.yml @@ -0,0 +1,5 @@ +versions: + "2020.06": + folder: all + "2019.10": + folder: all diff --git a/recipes/cose-c/all/CMakeLists.txt b/recipes/cose-c/all/CMakeLists.txt new file mode 100644 index 0000000000000..6ba47d078b389 --- /dev/null +++ b/recipes/cose-c/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/cose-c/all/conandata.yml b/recipes/cose-c/all/conandata.yml new file mode 100644 index 0000000000000..19b29a5db955d --- /dev/null +++ b/recipes/cose-c/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20200430": + sha256: fef43742cba828a35640eefba774be11562cab6d7bcbdcfd62613019965f87c3 + url: https://github.com/cose-wg/COSE-C/archive/4432ae11f7a9711c46e8b4442fa2b35055c5cf98.zip +patches: + "cci.20200430": + - patch_file: "patches/001-fix-cmake-targets.patch" + base_path: "source_subfolder" diff --git a/recipes/cose-c/all/conanfile.py b/recipes/cose-c/all/conanfile.py new file mode 100644 index 0000000000000..35e896e14c7d9 --- /dev/null +++ b/recipes/cose-c/all/conanfile.py @@ -0,0 +1,94 @@ +from conans import CMake, ConanFile, tools +import glob +import os + + +class CoseCConan(ConanFile): + name = "cose-c" + license = "BSD-3-Clause" + homepage = "https://github.com/cose-wg/COSE-C" + url = "https://github.com/conan-io/conan-center-index" + description = """Implementation of COSE in C using cn-cbor and openssl""" + topics = ("cbor") + exports_sources = ["CMakeLists.txt", "patches/**"] + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": ["openssl", "mbedtls"] + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": "openssl" + } + generators = "cmake", "cmake_find_package" + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("cn-cbor/1.0.0") + + if self.options.with_ssl == "mbedtls": + self.requires("mbedtls/2.23.0") + else: + self.requires("openssl/1.1.1h") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(glob.glob("COSE-C-*")[0], self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["COSE_C_COVERALLS"] = False + self._cmake.definitions["COSE_C_BUILD_TESTS"] = False + self._cmake.definitions["COSE_C_BUILD_DOCS"] = False + self._cmake.definitions["COSE_C_BUILD_DUMPER"] = False + self._cmake.definitions["COSE_C_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" + self._cmake.definitions["COSE_C_USE_FIND_PACKAGE"] = True + self._cmake.definitions["COSE_C_EXPORT_TARGETS"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "secur32", "crypt32", "bcrypt"]) + if self.settings.os == "Macos": + self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) + if self.options.with_ssl == "mbedtls": + self.cpp_info.defines.append("COSE_C_USE_MBEDTLS") + else: + self.cpp_info.defines.append("COSE_C_USE_OPENSSL") diff --git a/recipes/cose-c/all/patches/001-fix-cmake-targets.patch b/recipes/cose-c/all/patches/001-fix-cmake-targets.patch new file mode 100644 index 0000000000000..0c13544696d16 --- /dev/null +++ b/recipes/cose-c/all/patches/001-fix-cmake-targets.patch @@ -0,0 +1,17 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5522b29..1e9700b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -62,10 +62,10 @@ target_include_directories( + target_link_libraries(${PROJECT_NAME} PRIVATE cn-cbor::cn-cbor) + + if(COSE_C_USE_MBEDTLS) +- target_link_libraries(${PROJECT_NAME} PRIVATE mbedtls) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::mbedtls) + else() + target_include_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR}) +- target_link_libraries(${PROJECT_NAME} PRIVATE ${OPENSSL_LIBRARIES}) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl) + endif() + + if(MSVC) diff --git a/recipes/cose-c/all/test_package/CMakeLists.txt b/recipes/cose-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fcda1859bb610 --- /dev/null +++ b/recipes/cose-c/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(cose-c REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cose-c::cose-c) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/cose-c/all/test_package/conanfile.py b/recipes/cose-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..aab3b289eb8cf --- /dev/null +++ b/recipes/cose-c/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/cose-c/all/test_package/test_package.cpp b/recipes/cose-c/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ed3aedbd14fcf --- /dev/null +++ b/recipes/cose-c/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include + +#if defined(COSE_C_USE_OPENSSL) +#include +#endif + +#if defined(COSE_C_USE_MBEDTLS) +#include +#endif + +int main(int argc, char *argv[]) +{ + const int aCoseInitFlags = COSE_INIT_FLAGS_NONE; + + const auto mSign = + COSE_Sign0_Init(static_cast(aCoseInitFlags), nullptr); + + return 0; +} diff --git a/recipes/cose-c/config.yml b/recipes/cose-c/config.yml new file mode 100644 index 0000000000000..6a4771df04b83 --- /dev/null +++ b/recipes/cose-c/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "cci.20200430": + folder: "all" diff --git a/recipes/cotila/all/conandata.yml b/recipes/cotila/all/conandata.yml new file mode 100644 index 0000000000000..d33f2b8f9826d --- /dev/null +++ b/recipes/cotila/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.1": + url: "https://github.com/calebzulawski/cotila/archive/refs/tags/1.2.1.tar.gz" + sha256: "898ebfdf562cd1a3622870e17a703b38559cf2c607b2d5f79e6b3a55563af619" diff --git a/recipes/cotila/all/conanfile.py b/recipes/cotila/all/conanfile.py new file mode 100644 index 0000000000000..eb47a8c74e0c9 --- /dev/null +++ b/recipes/cotila/all/conanfile.py @@ -0,0 +1,66 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class CotilaConan(ConanFile): + name = "cotila" + description = "A compile time linear algebra system" + homepage = "https://github.com/calebzulawski/cotila" + topics = ("c++", "math", "linear algebra", "compile-time") + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "clang": "6.0", + "apple-clang": "10", + } + + 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] + + 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)) + + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, + destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="include/*", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "cotila" + self.cpp_info.names["cmake_find_package_multi"] = "cotila" + diff --git a/recipes/cotila/all/test_package/CMakeLists.txt b/recipes/cotila/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fb76dc36e1dc6 --- /dev/null +++ b/recipes/cotila/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(cotila CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_compile_features(test_package PRIVATE cxx_std_17) +target_link_libraries(test_package cotila::cotila) diff --git a/recipes/cotila/all/test_package/conanfile.py b/recipes/cotila/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e1ab7e3d234d6 --- /dev/null +++ b/recipes/cotila/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class CotilaTestConan(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/cotila/all/test_package/test_package.cpp b/recipes/cotila/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..66e4c15a0d8ca --- /dev/null +++ b/recipes/cotila/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + constexpr cotila::matrix m1 {{{1., 2., 3.}, {4., 5., 6.}}}; // very explicit declaration + constexpr cotila::matrix m2 {{{1., 4.}, {2., 5.}, {3., 6.}}}; // deduces the type, but the extra braces are required + static_assert(m2 == cotila::transpose(m1)); +} diff --git a/recipes/cotila/config.yml b/recipes/cotila/config.yml new file mode 100644 index 0000000000000..cf2793f85804d --- /dev/null +++ b/recipes/cotila/config.yml @@ -0,0 +1,3 @@ +versions: + 1.2.1: + folder: all diff --git a/recipes/coz/all/CMakeLists.txt b/recipes/coz/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/coz/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/coz/all/conandata.yml b/recipes/coz/all/conandata.yml new file mode 100644 index 0000000000000..9ded250516619 --- /dev/null +++ b/recipes/coz/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210322": + url: "https://github.com/plasma-umass/coz/archive/6dd3c3f9cdce5094024aab49aeb1b6b44c73b220.zip" + sha256: "f6b8332df45190d300a9d7a9049e9817729080dbd099af3b02ea4ea6977f24dd" diff --git a/recipes/coz/all/conanfile.py b/recipes/coz/all/conanfile.py new file mode 100644 index 0000000000000..525f92fcfbd9c --- /dev/null +++ b/recipes/coz/all/conanfile.py @@ -0,0 +1,62 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class CozConan(ConanFile): + name = "coz" + description = """Causal profiler, uses performance experiments + to predict the effect of optimizations""" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://coz-profiler.org" + license = "BSD-2-Clause" + topics = ("conan", "coz", "profiler", "causal") + + settings = "os", "arch", "compiler", "build_type" + + requires = "libelfin/0.3" + exports_sources = "CMakeLists.txt" + generators = "cmake", "cmake_find_package" + + _source_subfolder = "source_subfolder" + + def validate(self): + compiler = self.settings.compiler + compiler_version = tools.Version(self.settings.compiler.version) + if self.settings.os == "Macos" or compiler == "Visual Studio" or ( + compiler == "gcc" and compiler_version < "5.0"): + raise ConanInvalidConfiguration( + "coz doesn't support compiler: {} on OS: {}.".format( + self.settings.compiler, self.settings.os)) + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + _cmake = None + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "coz-profiler" + self.cpp_info.filenames["cmake_find_package_multi"] = "coz-profiler" + self.cpp_info.names["cmake_find_package"] = "coz" + self.cpp_info.names["cmake_find_package_multi"] = "coz" diff --git a/recipes/coz/all/test_package/CMakeLists.txt b/recipes/coz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/coz/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/coz/all/test_package/conanfile.py b/recipes/coz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ad479949b486f --- /dev/null +++ b/recipes/coz/all/test_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" + + def build(self): + cmake = CMake(self, build_type="RelWithDebInfo") # To work properly Coz tool requires debug information https://github.com/plasma-umass/coz + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self.settings): + return + bin_path = os.path.join("bin", "test_package") + self.run("coz run --- " + bin_path, run_environment=True) + print(open("profile.coz").read()) diff --git a/recipes/coz/all/test_package/test_package.c b/recipes/coz/all/test_package/test_package.c new file mode 100644 index 0000000000000..7e5f6d8d14a0e --- /dev/null +++ b/recipes/coz/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include + +int +main(int argc, char **argv) +{ + COZ_PROGRESS_NAMED("something"); + printf("Hello, Coz!\n"); + + return 0; +} diff --git a/recipes/coz/config.yml b/recipes/coz/config.yml new file mode 100644 index 0000000000000..b90744deceea1 --- /dev/null +++ b/recipes/coz/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210322": + folder: "all" diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml new file mode 100644 index 0000000000000..9933170ac8517 --- /dev/null +++ b/recipes/cpp-httplib/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "0.12.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.3.tar.gz" + sha256: "175ced3c9cdaf221e9edf210297568d8f7d402a41d6db01254ac9e0b25487c54" + "0.12.2": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.2.tar.gz" + sha256: "a7897d052de8fae75817e7a261ae37b89dc4cb8ac74b74458a1f2d2e707cfd03" + "0.12.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.1.tar.gz" + sha256: "0e56c25c63e730ebd42e2beda6e7cb1b950131d8fc00d3158b1443a8d76f41ca" + "0.12.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.0.tar.gz" + sha256: "423900c9a124b88c406cd34aba08c9e60742e477a02bd29051cf0ecbf9ef0c65" + "0.11.4": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.4.tar.gz" + sha256: "28f76b875a332fb80972c3212980c963f0a7d2e11a8fe94a8ed0d847b9a2256f" + "0.11.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.3.tar.gz" + sha256: "799b2daa0441d207f6cd1179ae3a34869722084a434da6614978be1682c1e12d" + "0.11.2": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.2.tar.gz" + sha256: "e620d030215733c4831fdc7813d5eb37a6fd599f8192a730662662e1748a741b" + "0.11.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.1.tar.gz" + sha256: "1ce2f0393ba779ec34885c5cd937141b4b5b730e2bc2efc34eb8554289c24d61" + "0.11.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.0.tar.gz" + sha256: "9f533b0aa67066bd8f049e080eef75ad710a2f3ba3d80edbb13957389a5eeca7" + "0.10.9": + url: "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.10.9.tar.gz" + sha256: "95ac0740ef760829a079c01a44164fd74af3fdc0748a40fc6beefd0276fd2345" + "0.9.10": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.9.10.tar.gz" + sha256: "49dfa101ced75f8536ec7c865f872ab8fca157c8b49e29be5ef2d2aa11f716e8" + "0.8.9": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.8.9.tar.gz" + sha256: "3c5e0d6784d04b0b3d10f60fa2a26ef2a968fb80f434c4d117c2811f9e3a5ed7" + "0.7.18": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.7.18.tar.gz" + sha256: "ed90e670a39fcacfb670f51b619e670dafe419bca74f8a50fb3c31bb46be8b23" + "0.6.6": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.6.6.tar.gz" + sha256: "35bcc6a3f9612feb92b2153c5e56389ccc1ab46c7ba8781b873a5c2e249eb610" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py new file mode 100644 index 0000000000000..fafe791af7015 --- /dev/null +++ b/recipes/cpp-httplib/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class CpphttplibConan(ConanFile): + name = "cpp-httplib" + description = "A C++11 single-file header-only cross platform HTTP/HTTPS library." + license = "MIT" + homepage = "https://github.com/yhirose/cpp-httplib" + url = "https://github.com/conan-io/conan-center-index" + topics = ("http", "https", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_openssl": [True, False], + "with_zlib": [True, False], + "with_brotli": [True, False], + } + default_options = { + "with_openssl": False, + "with_zlib": False, + "with_brotli": False, + } + no_copy_source = True + + def config_options(self): + if Version(self.version) < "0.7.2": + del self.options.with_brotli + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.get_safe("with_brotli"): + self.requires("brotli/1.0.9") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + 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, "httplib.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "httplib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "httplib") + self.cpp_info.set_property("cmake_target_name", "httplib::httplib") + self.cpp_info.includedirs.append(os.path.join("include", "httplib")) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.with_openssl: + self.cpp_info.defines.append("CPPHTTPLIB_OPENSSL_SUPPORT") + if self.options.with_zlib: + self.cpp_info.defines.append("CPPHTTPLIB_ZLIB_SUPPORT") + if self.options.get_safe("with_brotli"): + self.cpp_info.defines.append("CPPHTTPLIB_BROTLI_SUPPORT") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["crypt32", "cryptui", "ws2_32"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "httplib" + self.cpp_info.names["cmake_find_package_multi"] = "httplib" diff --git a/recipes/cpp-httplib/all/test_package/CMakeLists.txt b/recipes/cpp-httplib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..71e165a411166 --- /dev/null +++ b/recipes/cpp-httplib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(httplib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE httplib::httplib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-httplib/all/test_package/conanfile.py b/recipes/cpp-httplib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/cpp-httplib/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/cpp-httplib/all/test_package/test_package.cpp b/recipes/cpp-httplib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e9fe638f7b17 --- /dev/null +++ b/recipes/cpp-httplib/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +int main() { + httplib::Server svr; + + svr.Get("/hi", [](const httplib::Request& req, httplib::Response& res) { + res.set_content("Hello World!", "text/plain"); + }); + + svr.Get(R"(/numbers/(\d+))", [&](const httplib::Request& req, httplib::Response& res) { + auto numbers = req.matches[1]; + res.set_content(numbers, "text/plain"); + }); + + svr.Get("/stop", [&](const httplib::Request& req, httplib::Response& res) { + svr.stop(); + }); + + return 0; +} diff --git a/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt b/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cpp-httplib/all/test_v1_package/conanfile.py b/recipes/cpp-httplib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpp-httplib/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/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml new file mode 100644 index 0000000000000..6ad1768ae264f --- /dev/null +++ b/recipes/cpp-httplib/config.yml @@ -0,0 +1,29 @@ +versions: + "0.12.3": + folder: all + "0.12.2": + folder: all + "0.12.1": + folder: all + "0.12.0": + folder: all + "0.11.4": + folder: all + "0.11.3": + folder: all + "0.11.2": + folder: all + "0.11.1": + folder: all + "0.11.0": + folder: all + "0.10.9": + folder: all + "0.9.10": + folder: all + "0.8.9": + folder: all + "0.7.18": + folder: all + "0.6.6": + folder: all diff --git a/recipes/cpp-ipc/all/CMakeLists.txt b/recipes/cpp-ipc/all/CMakeLists.txt new file mode 100644 index 0000000000000..e17d82eddcc5d --- /dev/null +++ b/recipes/cpp-ipc/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper LANGUAGES CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/cpp-ipc/all/conandata.yml b/recipes/cpp-ipc/all/conandata.yml new file mode 100644 index 0000000000000..c463e509b6004 --- /dev/null +++ b/recipes/cpp-ipc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.2.0": + url: "https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v1.2.0.tar.gz" + sha256: "c8df492e08b55e0722eb3e5684163709c1758f3282f05358ff78c694eadb6e60" + "1.1.1": + url: "https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v1.1.1.tar.gz" + sha256: "5c7539de763e5cf3bb3469df17837793cebe2cd9fe44ab2f6ef1ba45f06206a5" diff --git a/recipes/cpp-ipc/all/conanfile.py b/recipes/cpp-ipc/all/conanfile.py new file mode 100644 index 0000000000000..b11041af3f594 --- /dev/null +++ b/recipes/cpp-ipc/all/conanfile.py @@ -0,0 +1,87 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class CppIPCConan(ConanFile): + name = "cpp-ipc" + description = "C++ IPC Library: A high-performance inter-process communication using shared memory on Linux/Windows." + topics = ("ipc", "shared memory", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mutouyun/cpp-ipc" + license = "MIT", + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt"] + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake" + + _compiler_required_cpp17 = { + "Visual Studio": "17", + "gcc": "8", + "clang": "4", + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if tools.is_apple_os(self.settings.os): + raise ConanInvalidConfiguration("{} does not support Apple platform".format(self.name)) + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration("{} doesn't support clang with libc++".format(self.name)) + + 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["LIBIPC_BUILD_SHARED_LIBS"] = self.options.shared + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ipc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["rt", "pthread"] diff --git a/recipes/cpp-ipc/all/test_package/CMakeLists.txt b/recipes/cpp-ipc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c258338b9324e --- /dev/null +++ b/recipes/cpp-ipc/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cpp-ipc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cpp-ipc::cpp-ipc) +set(CMAKE_CXX_STANDARD 17) diff --git a/recipes/cpp-ipc/all/test_package/conanfile.py b/recipes/cpp-ipc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/cpp-ipc/all/test_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/cpp-ipc/all/test_package/test_package.cpp b/recipes/cpp-ipc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2b7e80a88c400 --- /dev/null +++ b/recipes/cpp-ipc/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "libipc/ipc.h" + +int main() { + ipc::channel cc { "my-ipc-channel", ipc::sender | ipc::receiver }; + + return EXIT_SUCCESS; +} diff --git a/recipes/cpp-ipc/config.yml b/recipes/cpp-ipc/config.yml new file mode 100644 index 0000000000000..797b8dd014054 --- /dev/null +++ b/recipes/cpp-ipc/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.0": + folder: all + "1.1.1": + folder: all diff --git a/recipes/cpp-jwt/all/conandata.yml b/recipes/cpp-jwt/all/conandata.yml new file mode 100644 index 0000000000000..a1d76536a0ad6 --- /dev/null +++ b/recipes/cpp-jwt/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "1.4": + url: "https://github.com/arun11299/cpp-jwt/archive/refs/tags/v1.4.tar.gz" + sha256: "1cb8039ee15bf9bf735c26082d7ff50c23d2886d65015dd6b0668c65e17dd20f" + "1.3": + url: "https://github.com/arun11299/cpp-jwt/archive/refs/tags/v1.3.tar.gz" + sha256: "792889f08dd1acbc14129d11e013f9ef46e663c545ea366dd922402d8becbe05" + "1.2": + url: "https://github.com/arun11299/cpp-jwt/archive/refs/tags/v1.2.tar.gz" + sha256: "5d0102d182c48ef520f3fb15412fbaa67e002e1bf90b3ba45d5a2c7f850371f7" +patches: + "1.4": + - patch_file: "patches/001-fix-msvc-14-compilation.patch" + "1.3": + - patch_file: "patches/001-fix-msvc-14-compilation.patch" + "1.2": + - patch_file: "patches/001-fix-msvc-14-compilation.patch" diff --git a/recipes/cpp-jwt/all/conanfile.py b/recipes/cpp-jwt/all/conanfile.py new file mode 100644 index 0000000000000..a9da0afcb17e4 --- /dev/null +++ b/recipes/cpp-jwt/all/conanfile.py @@ -0,0 +1,92 @@ +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 +import os + +required_conan_version = ">=1.52.0" + + +class CppJwtConan(ConanFile): + name = "cpp-jwt" + description = "A C++ library for handling JWT tokens" + license = "MIT" + topics = ("jwt", "auth", "header-only") + homepage = "https://github.com/arun11299/cpp-jwt" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6.4", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("nlohmann_json/3.11.2") + self.requires("openssl/1.1.1s") + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + 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["CPP_JWT_BUILD_EXAMPLES"] = False + tc.variables["CPP_JWT_BUILD_TESTS"] = False + tc.variables["CPP_JWT_USE_VENDORED_NLOHMANN_JSON"] = 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*", 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpp-jwt") + self.cpp_info.set_property("cmake_target_name", "cpp-jwt::cpp-jwt") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-jwt/all/patches/001-fix-msvc-14-compilation.patch b/recipes/cpp-jwt/all/patches/001-fix-msvc-14-compilation.patch new file mode 100644 index 0000000000000..8148de8414d25 --- /dev/null +++ b/recipes/cpp-jwt/all/patches/001-fix-msvc-14-compilation.patch @@ -0,0 +1,22 @@ +From 67f3dad16aebc78c2d5882be182114934416916d Mon Sep 17 00:00:00 2001 +From: Carlos Gomes Martinho +Date: Mon, 24 Feb 2020 19:54:37 +0100 +Subject: [PATCH] fix: compilation with visual studio 14 + +--- + include/jwt/base64.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/jwt/base64.hpp b/include/jwt/base64.hpp +index 248b10c..7df6245 100644 +--- a/include/jwt/base64.hpp ++++ b/include/jwt/base64.hpp +@@ -92,7 +92,7 @@ inline std::string base64_encode(const char* in, size_t len) + const auto encoded_siz = encoding_size(len); + result.resize(encoded_siz); + +- constexpr static const EMap emap{}; ++ constexpr static const EMap emap; + + int i = 0; + int j = 0; diff --git a/recipes/cpp-jwt/all/test_package/CMakeLists.txt b/recipes/cpp-jwt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5141de159bdfd --- /dev/null +++ b/recipes/cpp-jwt/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cpp-jwt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-jwt::cpp-jwt) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cpp-jwt/all/test_package/conanfile.py b/recipes/cpp-jwt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/cpp-jwt/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-jwt/all/test_package/test_package.cpp b/recipes/cpp-jwt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d3b3812a1a4e1 --- /dev/null +++ b/recipes/cpp-jwt/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include "jwt/jwt.hpp" +#include + +int main() { + using namespace jwt::params; + + auto key = "secret"; // Secret to use for the algorithm + // Create JWT object + jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), + secret(key)}; + + // Get the encoded string/assertion + auto enc_str = obj.signature(); + std::cout << enc_str << std::endl; + + // Decode + auto dec_obj = jwt::decode(enc_str, algorithms({"hs256"}), secret(key)); + std::cout << dec_obj.header() << std::endl; + std::cout << dec_obj.payload() << std::endl; + + return 0; +} diff --git a/recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt b/recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpp-jwt/all/test_v1_package/conanfile.py b/recipes/cpp-jwt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpp-jwt/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/cpp-jwt/config.yml b/recipes/cpp-jwt/config.yml new file mode 100644 index 0000000000000..f55a2df2807c5 --- /dev/null +++ b/recipes/cpp-jwt/config.yml @@ -0,0 +1,7 @@ +versions: + "1.4": + folder: all + "1.3": + folder: all + "1.2": + folder: all diff --git a/recipes/cpp-lazy/all/conandata.yml b/recipes/cpp-lazy/all/conandata.yml new file mode 100644 index 0000000000000..84cceb8cee130 --- /dev/null +++ b/recipes/cpp-lazy/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "7.0.2": + url: "https://github.com/MarcDirven/cpp-lazy/releases/download/v7.0.2/cpp-lazy-src.zip" + sha256: "fb6dd0870e07050f9e0bba3ddb5f53ee35d8d9a05987f73cb0d667ca1f8348aa" + "6.0.0": + url: "https://github.com/MarcDirven/cpp-lazy/releases/download/v6.0.0/cpp-lazy-src.zip" + sha256: "424973eabaab8c756dae5e1795febeface65bb1dc42f474e5e2e1e4ab3effc5e" +patches: + "6.0.0": + - patch_file: "patches/0001-support-gcc5.patch" + patch_description: "fix compilation errors on gcc5" + patch_type: "portability" + patch_source: "https://github.com/MarcDirven/cpp-lazy/issues/133" diff --git a/recipes/cpp-lazy/all/conanfile.py b/recipes/cpp-lazy/all/conanfile.py new file mode 100644 index 0000000000000..431ebcb132c22 --- /dev/null +++ b/recipes/cpp-lazy/all/conanfile.py @@ -0,0 +1,59 @@ +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 CpplazyConan(ConanFile): + name = "cpp-lazy" + description = "C++11/14/17/20 library for lazy evaluation " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MarcDirven/cpp-lazy" + topics = ("lazy evaluation", "header-only") + 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.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support apple-clang < 14.0.") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-lazy/all/patches/0001-support-gcc5.patch b/recipes/cpp-lazy/all/patches/0001-support-gcc5.patch new file mode 100644 index 0000000000000..578428158ca2b --- /dev/null +++ b/recipes/cpp-lazy/all/patches/0001-support-gcc5.patch @@ -0,0 +1,297 @@ +diff --git a/include/Lz/FunctionTools.hpp b/include/Lz/FunctionTools.hpp +index 5beebed..9b1e3c7 100644 +--- a/include/Lz/FunctionTools.hpp ++++ b/include/Lz/FunctionTools.hpp +@@ -91,7 +91,7 @@ LZ_NODISCARD StringSplitter lines(const String& string) + * @return The result of the sum from [from, upToAndIncluding] + */ + template +-LZ_NODISCARD constexpr T sumTo(const T from, const T upToAndIncluding) { ++LZ_NODISCARD LZ_CONSTEXPR_CXX_14 T sumTo(const T from, const T upToAndIncluding) { + static_assert(std::is_integral::value, "T must be integral type"); + const T fromAbs = from < 0 ? -from : from; + const T toAbs = upToAndIncluding < 0 ? -upToAndIncluding : upToAndIncluding; +@@ -114,7 +114,7 @@ LZ_NODISCARD constexpr T sumTo(const T from, const T upToAndIncluding) { + * @return The result of the sum from [0, upToAndIncluding] + */ + template +-LZ_NODISCARD constexpr T sumTo(const T upToAndIncluding) { ++LZ_NODISCARD LZ_CONSTEXPR_CXX_14 T sumTo(const T upToAndIncluding) { + return lz::sumTo(0, upToAndIncluding); + } + +@@ -1241,7 +1241,7 @@ bool startsWith(IteratorA beginA, IteratorA endA, IteratorB beginB, IteratorB en + return std::search(std::move(beginA), std::move(endA), std::move(beginB), std::move(endB), std::move(compare)) != endA; + } + +-template)> ++template)> + bool startsWith(const IterableA& a, const IterableB& b, BinaryPredicate compare = {}) { + return lz::startsWith(std::begin(a), std::end(a), std::begin(b), std::end(b), std::move(compare)); + } +@@ -1255,7 +1255,7 @@ bool endsWith(IteratorA beginA, IteratorA endA, IteratorB beginB, IteratorB endB + return lz::startsWith(std::move(revBegA), std::move(revEndA), std::move(revBegB), std::move(revEndB), std::move(compare)); + } + +-template)> ++template)> + bool endsWith(const IterableA& a, const IterableB& b, BinaryPredicate compare = {}) { + return lz::endsWith(std::begin(a), std::end(a), std::begin(b), std::end(b), std::move(compare)); + } +diff --git a/include/Lz/Zip.hpp b/include/Lz/Zip.hpp +index a3e1560..95c6cf5 100644 +--- a/include/Lz/Zip.hpp ++++ b/include/Lz/Zip.hpp +@@ -15,7 +15,7 @@ Tuple createFakeEnd(const Tuple& begin, Tuple end, IndexSequence) { + // If we use begin + smallestLength, we get compile errors for non random access iterators. However, we know that we are + // dealing with a random access iterator, so std::next does a + internally. It is implemented this way to prevent more + // enable_if's from appearing +- return { std::next(std::get(begin), smallestLength)... }; ++ return Tuple{ std::next(std::get(begin), smallestLength)... }; + } + } // namespace internal + +diff --git a/include/Lz/detail/BasicIteratorView.hpp b/include/Lz/detail/BasicIteratorView.hpp +index 176f878..b5cbff1 100644 +--- a/include/Lz/detail/BasicIteratorView.hpp ++++ b/include/Lz/detail/BasicIteratorView.hpp +@@ -641,7 +641,7 @@ view(Iterable&& iterable) { + template)> + bool equal(const IterableA& a, const IterableB& b, BinaryPredicate predicate = {}) { +- return std::equal(std::begin(a), std::end(a), std::begin(b), std::end(b), std::move(predicate)); ++ return std::equal(std::begin(a), std::end(a), std::begin(b), std::move(predicate)); + } + # else // ^^^ !LZ_HAS_EXECUTION vvv LZ_HAS_EXECUTION + /** +diff --git a/include/Lz/detail/CartesianProductIterator.hpp b/include/Lz/detail/CartesianProductIterator.hpp +index 554e75c..3c63d90 100644 +--- a/include/Lz/detail/CartesianProductIterator.hpp ++++ b/include/Lz/detail/CartesianProductIterator.hpp +@@ -209,7 +209,7 @@ private: + + template + LZ_CONSTEXPR_CXX_20 reference dereference(IndexSequence) const { +- return { *std::get(_iterator)... }; ++ return reference{ *std::get(_iterator)... }; + } + + template +diff --git a/include/Lz/detail/FunctionContainer.hpp b/include/Lz/detail/FunctionContainer.hpp +index c08d9ff..7b721a2 100644 +--- a/include/Lz/detail/FunctionContainer.hpp ++++ b/include/Lz/detail/FunctionContainer.hpp +@@ -28,7 +28,7 @@ class FunctionContainer { + _isConstructed = true; + } + +- constexpr void reset() noexcept { ++ LZ_CONSTEXPR_CXX_14 void reset() noexcept { + if (_isConstructed) { + _func.~Func(); + _isConstructed = false; +diff --git a/include/Lz/detail/LzTools.hpp b/include/Lz/detail/LzTools.hpp +index 919688a..8f57dce 100644 +--- a/include/Lz/detail/LzTools.hpp ++++ b/include/Lz/detail/LzTools.hpp +@@ -223,6 +223,8 @@ using Decay = typename std::decay::type; + + template + using TupleElement = typename std::tuple_element::type; ++ ++# define MAKE_BIN_OP(OP, VALUE_TYPE) OP + # else // ^^^ has cxx 11 vvv cxx > 11 + template + using IndexSequence = std::index_sequence; +@@ -364,7 +366,7 @@ template + struct IsRandomAccess : IsRandomAccessTag> {}; + + template +-inline constexpr bool isEven(const Arithmetic value) noexcept { ++LZ_CONSTEXPR_CXX_14 bool isEven(const Arithmetic value) noexcept { + return (value % 2) == 0; + } + +@@ -373,7 +375,7 @@ inline constexpr void decompose(const Ts&...) noexcept { + } + + template +-inline constexpr Arithmetic roundEven(const Arithmetic a, const Arithmetic b) noexcept { ++LZ_CONSTEXPR_CXX_14 Arithmetic roundEven(const Arithmetic a, const Arithmetic b) noexcept { + LZ_ASSERT(a != 0 && b != 0, "division by zero error"); + if (b == 1) { + return a; +diff --git a/include/Lz/detail/Optional.hpp b/include/Lz/detail/Optional.hpp +index 12bbf3f..885a50a 100644 +--- a/include/Lz/detail/Optional.hpp ++++ b/include/Lz/detail/Optional.hpp +@@ -39,7 +39,7 @@ public: + constexpr Optional(U&& value) : _value(std::forward(value)), _hasValue(true) { + } + +- constexpr Optional(Optional&& right) noexcept(noexcept(construct(std::move(right.value())))) { ++ LZ_CONSTEXPR_CXX_14 Optional(Optional&& right) noexcept { + if (right) { + construct(std::move(right.value())); + } +@@ -55,7 +55,7 @@ public: + } + + template +- constexpr Optional& ++ LZ_CONSTEXPR_CXX_14 Optional& + operator=(U&& value) noexcept { + if (_hasValue) { + _value = std::forward(value); +@@ -70,35 +70,35 @@ public: + return _hasValue; + } + +- constexpr const T& value() const { ++ LZ_CONSTEXPR_CXX_14 const T& value() const { + if (_hasValue) { + return _value; + } + throw std::runtime_error("Cannot get uninitialized optional"); + } + +- constexpr T& value() { ++ LZ_CONSTEXPR_CXX_14 T& value() { + if (_hasValue) { + return _value; + } + throw std::runtime_error("Cannot get uninitialized optional"); + } + +- constexpr T& operator*() noexcept { ++ LZ_CONSTEXPR_CXX_14 T& operator*() noexcept { + return _value; + } + +- constexpr const T& operator*() const noexcept { ++ LZ_CONSTEXPR_CXX_14 const T& operator*() const noexcept { + return _value; + } + + template +- constexpr T value_or(U&& v) const& { ++ LZ_CONSTEXPR_CXX_14 T value_or(U&& v) const& { + return bool(*this) ? this->value() : static_cast(std::forward(v)); + } + + template +- constexpr T value_or(U&& v) && { ++ LZ_CONSTEXPR_CXX_14 T value_or(U&& v) && { + return bool(*this) ? std::move(this->value()) : static_cast(std::forward(v)); + } + }; +diff --git a/include/Lz/detail/RangeIterator.hpp b/include/Lz/detail/RangeIterator.hpp +index 34ca280..7be29b2 100644 +--- a/include/Lz/detail/RangeIterator.hpp ++++ b/include/Lz/detail/RangeIterator.hpp +@@ -25,7 +25,7 @@ EnableIf::value, std::ptrdiff_t> plusImpl(cons + } + + template +-constexpr EnableIf::value, std::ptrdiff_t> ++LZ_CONSTEXPR_CXX_14 EnableIf::value, std::ptrdiff_t> + plusImpl(const ValueType difference, const ValueType step) noexcept { + return static_cast(roundEven(difference, step)); + } +@@ -95,23 +95,23 @@ public: + return *(*this + offset); + } + +- constexpr RangeIterator& operator+=(const difference_type value) noexcept { ++ LZ_CONSTEXPR_CXX_14 RangeIterator& operator+=(const difference_type value) noexcept { + _iterator += static_cast(value) * _step; + return *this; + } + +- LZ_NODISCARD constexpr RangeIterator operator+(const difference_type value) const noexcept { ++ LZ_NODISCARD LZ_CONSTEXPR_CXX_14 RangeIterator operator+(const difference_type value) const noexcept { + RangeIterator tmp(*this); + tmp += value; + return tmp; + } + +- constexpr RangeIterator operator-=(const difference_type value) noexcept { ++ LZ_CONSTEXPR_CXX_14 RangeIterator operator-=(const difference_type value) noexcept { + _iterator -= static_cast(value) * _step; + return *this; + } + +- LZ_NODISCARD constexpr RangeIterator operator-(const difference_type value) const noexcept { ++ LZ_NODISCARD LZ_CONSTEXPR_CXX_14 RangeIterator operator-(const difference_type value) const noexcept { + RangeIterator tmp(*this); + tmp -= value; + return tmp; +diff --git a/include/Lz/detail/SplitIterator.hpp b/include/Lz/detail/SplitIterator.hpp +index e4e58a3..564632e 100644 +--- a/include/Lz/detail/SplitIterator.hpp ++++ b/include/Lz/detail/SplitIterator.hpp +@@ -26,12 +26,12 @@ class SplitIterator { + } + # else + template +- EnableIf::value, std::size_t> getDelimiterLength() const { ++ constexpr EnableIf::value, std::size_t> getDelimiterLength() const { + return 1; + } + + template +- EnableIf::value, std::size_t> getDelimiterLength() const { ++ LZ_CONSTEXPR_CXX_20 EnableIf::value, std::size_t> getDelimiterLength() const { + return _delimiter.length(); + } + # endif +@@ -70,12 +70,12 @@ public: + return FakePointerProxy(**this); + } + +- constexpr friend bool operator!=(const SplitIterator& a, const SplitIterator& b) noexcept { ++ LZ_CONSTEXPR_CXX_14 friend bool operator!=(const SplitIterator& a, const SplitIterator& b) noexcept { + LZ_ASSERT(a._delimiter == b._delimiter, "incompatible iterator types, found different delimiters"); + return a._currentPos != b._currentPos; + } + +- constexpr friend bool operator==(const SplitIterator& a, const SplitIterator& b) noexcept { ++ LZ_CONSTEXPR_CXX_14 friend bool operator==(const SplitIterator& a, const SplitIterator& b) noexcept { + return !(a != b); // NOLINT + } + +diff --git a/include/Lz/detail/ZipIterator.hpp b/include/Lz/detail/ZipIterator.hpp +index 085c816..50e1668 100644 +--- a/include/Lz/detail/ZipIterator.hpp ++++ b/include/Lz/detail/ZipIterator.hpp +@@ -26,7 +26,7 @@ private: + + template + LZ_CONSTEXPR_CXX_20 reference dereference(IndexSequence) const { +- return { *std::get(_iterators)... }; ++ return reference{ *std::get(_iterators)... }; + } + + template +diff --git a/include/Lz/detail/ZipLongestIterator.hpp b/include/Lz/detail/ZipLongestIterator.hpp +index 2263cd9..4959996 100644 +--- a/include/Lz/detail/ZipLongestIterator.hpp ++++ b/include/Lz/detail/ZipLongestIterator.hpp +@@ -48,7 +48,7 @@ private: + + template + LZ_CONSTEXPR_CXX_20 value_type dereference(IndexSequence) const { +- return { dereferenceOne(std::get(_iterators), std::get(_end))... }; ++ return value_type{ dereferenceOne(std::get(_iterators), std::get(_end))... }; + } + + template +@@ -137,7 +137,7 @@ private: + + template + LZ_CONSTEXPR_CXX_20 value_type dereference(IndexSequence) const { +- return { dereferenceOne(std::get(_iterators), std::get(_end))... }; ++ return value_type{ dereferenceOne(std::get(_iterators), std::get(_end))... }; + } + + template diff --git a/recipes/cpp-lazy/all/test_package/CMakeLists.txt b/recipes/cpp-lazy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..77fddb4fc3c4b --- /dev/null +++ b/recipes/cpp-lazy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cpp-lazy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-lazy::cpp-lazy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-lazy/all/test_package/conanfile.py b/recipes/cpp-lazy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/cpp-lazy/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-lazy/all/test_package/test_package.cpp b/recipes/cpp-lazy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2fb082350a8e9 --- /dev/null +++ b/recipes/cpp-lazy/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +#define LZ_STANDALONE +#include + +int main() { + std::array arr = {1, 2, 3, 4}; + std::string result = lz::map(arr, [](int i) { return i + 1; }).toString(" "); // == "2 3 4 5" + + std::cout << result << "\n"; + + return 0; +} diff --git a/recipes/cpp-lazy/all/test_v1_package/CMakeLists.txt b/recipes/cpp-lazy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/cpp-lazy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cpp-lazy/all/test_v1_package/conanfile.py b/recipes/cpp-lazy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/cpp-lazy/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cpp-lazy/config.yml b/recipes/cpp-lazy/config.yml new file mode 100644 index 0000000000000..3001babefa7f1 --- /dev/null +++ b/recipes/cpp-lazy/config.yml @@ -0,0 +1,5 @@ +versions: + "7.0.2": + folder: all + "6.0.0": + folder: all diff --git a/recipes/cpp-optparse/all/CMakeLists.txt b/recipes/cpp-optparse/all/CMakeLists.txt new file mode 100644 index 0000000000000..85cb504fb1461 --- /dev/null +++ b/recipes/cpp-optparse/all/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.4) +project(cpp-optparse LANGUAGES CXX) + +include(GNUInstallDirs) + +add_library(OptionParser ${CPP_OPTPARSE_SRC_DIR}/OptionParser.cpp) +set_target_properties(OptionParser PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +install(TARGETS OptionParser + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${CPP_OPTPARSE_SRC_DIR}/OptionParser.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/cpp-optparse/all/conandata.yml b/recipes/cpp-optparse/all/conandata.yml new file mode 100644 index 0000000000000..930d4c2b24a51 --- /dev/null +++ b/recipes/cpp-optparse/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20171104": + url: "https://github.com/weisslj/cpp-optparse/archive/2ec0b7aca9a692ff93017ed44ca9d13a8e7d4d00.tar.gz" + sha256: "93353036f1405c87d72296a6c3f64ac793f2a8617cbe5e7633a8c9f72536f519" diff --git a/recipes/cpp-optparse/all/conanfile.py b/recipes/cpp-optparse/all/conanfile.py new file mode 100644 index 0000000000000..89caa73425148 --- /dev/null +++ b/recipes/cpp-optparse/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class CppOptparseConan(ConanFile): + name = "cpp-optparse" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/weisslj/cpp-optparse" + description = "Python's excellent OptionParser in C++" + topics = ("cpp-optparse", "argument", "parsing") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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["CPP_OPTPARSE_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 = ["OptionParser"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/cpp-optparse/all/test_package/CMakeLists.txt b/recipes/cpp-optparse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..39cb8da083e2d --- /dev/null +++ b/recipes/cpp-optparse/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(cpp-optparse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-optparse::cpp-optparse) diff --git a/recipes/cpp-optparse/all/test_package/conanfile.py b/recipes/cpp-optparse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a2443da94e9c --- /dev/null +++ b/recipes/cpp-optparse/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(f"{bin_path} --help", env="conanrun") diff --git a/recipes/cpp-optparse/all/test_package/test_package.cpp b/recipes/cpp-optparse/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..32515c6b0204e --- /dev/null +++ b/recipes/cpp-optparse/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +#include "OptionParser.h" + +using optparse::OptionParser; +using namespace std; + +int main(int argc, char *argv[]) +{ + OptionParser parser = OptionParser() .description("just an example"); + + parser.add_option("-f", "--file") .dest("filename") + .help("write report to FILE") .metavar("FILE"); + parser.add_option("-q", "--quiet") + .action("store_false") .dest("verbose") .set_default("1") + .help("don't print status messages to stdout"); + + optparse::Values options = parser.parse_args(argc, argv); + vector args = parser.args(); + + if (options.get("verbose")) + cout << options["filename"] << endl; +} diff --git a/recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt b/recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpp-optparse/all/test_v1_package/conanfile.py b/recipes/cpp-optparse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9f45afc4e29a1 --- /dev/null +++ b/recipes/cpp-optparse/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(f"{bin_path} --help", run_environment=True) diff --git a/recipes/cpp-optparse/config.yml b/recipes/cpp-optparse/config.yml new file mode 100644 index 0000000000000..1809514a059b6 --- /dev/null +++ b/recipes/cpp-optparse/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20171104": + folder: all diff --git a/recipes/cpp-peglib/0.x.x/conandata.yml b/recipes/cpp-peglib/0.x.x/conandata.yml new file mode 100644 index 0000000000000..a29b4845fd315 --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.13": + url: "https://github.com/yhirose/cpp-peglib/archive/v0.1.13.tar.gz" + sha256: "84af1255c0c53be57abbc41bf216d6ab7e0dbd0ff8886841b29e0e089dd985ca" diff --git a/recipes/cpp-peglib/0.x.x/conanfile.py b/recipes/cpp-peglib/0.x.x/conanfile.py new file mode 100644 index 0000000000000..2264c45db7817 --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class CpppeglibConan(ConanFile): + name = "cpp-peglib" + description = "A single file C++11 header-only PEG (Parsing Expression Grammars) library." + license = "MIT" + topics = ("peg", "parser", "header-only") + homepage = "https://github.com/yhirose/cpp-peglib" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "peglib.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 = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt b/recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9f2b801df306b --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cpp-peglib CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-peglib::cpp-peglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-peglib/0.x.x/test_package/conanfile.py b/recipes/cpp-peglib/0.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/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/cpp-peglib/0.x.x/test_package/test_package.cpp b/recipes/cpp-peglib/0.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..9955bf7ef717a --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/test_package/test_package.cpp @@ -0,0 +1,49 @@ +#include + +#include +#include + +int main() { + // (2) Make a parser + peg::parser parser(R"( + # Grammar for Calculator... + Additive <- Multitive '+' Additive / Multitive + Multitive <- Primary '*' Multitive / Primary + Primary <- '(' Additive ')' / Number + Number <- < [0-9]+ > + %whitespace <- [ \t]* + )"); + + assert((bool)parser == true); + + // (3) Setup actions + parser["Additive"] = [](const peg::SemanticValues &sv) { + switch (sv.choice()) { + case 0: // "Multitive '+' Additive" + return peg::any_cast(sv[0]) + peg::any_cast(sv[1]); + default: // "Multitive" + return peg::any_cast(sv[0]); + } + }; + + parser["Multitive"] = [](const peg::SemanticValues &sv) { + switch (sv.choice()) { + case 0: // "Primary '*' Multitive" + return peg::any_cast(sv[0]) * peg::any_cast(sv[1]); + default: // "Primary" + return peg::any_cast(sv[0]); + } + }; + + parser["Number"] = [](const peg::SemanticValues &sv) { + return std::stoi(sv.token(), nullptr, 10); + }; + + // (4) Parse + parser.enable_packrat_parsing(); // Enable packrat parsing. + + int val; + parser.parse(" (1 + 2) * 3 ", val); + + assert(val == 9); +} diff --git a/recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt b/recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..fad4cae2ba206 --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cpp-peglib CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-peglib::cpp-peglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-peglib/0.x.x/test_v1_package/conanfile.py b/recipes/cpp-peglib/0.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpp-peglib/0.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cpp-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml new file mode 100644 index 0000000000000..d7a924b2af542 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -0,0 +1,37 @@ +sources: + "1.8.3": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.3.tar.gz" + sha256: "3de8aeb44a262f9c2478e2a7e7bc2bb9426a2bdd176cf0654ff5a3d291c77b73" + "1.8.2": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.2.tar.gz" + sha256: "eca5d06dafb940ffee8a99060a57272ada7f2486fc21ed1663e4e49851a70e0c" + "1.8.1": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.1.tar.gz" + sha256: "15d7c39d01780bb6f27db511722936d82d04cb1f5a6c63025021ff5dfe5fe1b2" + "1.8.0": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.8.0.tar.gz" + sha256: "63dc755afb5072ba58468fa39d1037ebadc1206c489b0493d635147524cf5379" + "1.6.1": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.6.1.tar.gz" + sha256: "e1777ea79323c4cfe98587edc50e33df0c42bdb8648b7c5cc679dbf85f4f4768" + "1.6.0": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.6.0.tar.gz" + sha256: "2b09d711fd02bad24089bc5a6f51ef4c307d86e0adb6f9938e0549a12c102ac4" + "1.5.0": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.5.0.tar.gz" + sha256: "45a02b749556af6ab0abf78c4c1d1afe02f17705b1c51f5820e957616f453b33" + "1.4.2": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.4.2.tar.gz" + sha256: "28a09c1bee50608733a989cd5b62368a767a66f9e1a39654c0342e9698c479ca" + "1.4.1": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.4.1.tar.gz" + sha256: "3784039727f8317cd5e202c5a2d142584bf48a311910643298dc4ba9083424e7" + "1.3.10": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.3.10.tar.gz" + sha256: "9c79abd8a304d163d176918b74d7ab272e6ab1405af2dd699b6b7ae1b5605b09" + "1.3.9": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.3.9.tar.gz" + sha256: "0d14fcbf7ed4409699fff70867c5776a2219e38547de5bf0bf689ba0d58c0d7f" + "1.3.8": + url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.3.8.tar.gz" + sha256: "6d266806825ec491f1e3d1eb8a2163114f328a691f7c9fbce7bb3edf2f42074c" diff --git a/recipes/cpp-peglib/1.x.x/conanfile.py b/recipes/cpp-peglib/1.x.x/conanfile.py new file mode 100644 index 0000000000000..c700cd876b542 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class CpppeglibConan(ConanFile): + name = "cpp-peglib" + description = "A single file C++11 header-only PEG (Parsing Expression Grammars) library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yhirose/cpp-peglib" + topics = ("peg", "parser", "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.7", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) == "7" and \ + stdcpp_library(self) == "stdc++": + raise ConanInvalidConfiguration(f"{self.name} {self.version} does not support clang 7 with libstdc++.") + + 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, "peglib.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 = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + self.cpp_info.cxxflags.append("-pthread") + self.cpp_info.exelinkflags.append("-pthread") + self.cpp_info.sharedlinkflags.append("-pthread") + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:__cplusplus") diff --git a/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt b/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de79c59d80c35 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cpp-peglib CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-peglib::cpp-peglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cpp-peglib/1.x.x/test_package/conanfile.py b/recipes/cpp-peglib/1.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/cpp-peglib/1.x.x/test_package/test_package.cpp b/recipes/cpp-peglib/1.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..60e7ae6cc5f27 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/test_package/test_package.cpp @@ -0,0 +1,51 @@ +#include +#include +#include + +using namespace peg; +using namespace std; + +int main(void) { + // (2) Make a parser + parser parser(R"( + # Grammar for Calculator... + Additive <- Multitive '+' Additive / Multitive + Multitive <- Primary '*' Multitive / Primary + Primary <- '(' Additive ')' / Number + Number <- < [0-9]+ > + %whitespace <- [ \t]* + )"); + + assert(static_cast(parser) == true); + + // (3) Setup actions + parser["Additive"] = [](const SemanticValues &vs) { + switch (vs.choice()) { + case 0: // "Multitive '+' Additive" + return any_cast(vs[0]) + any_cast(vs[1]); + default: // "Multitive" + return any_cast(vs[0]); + } + }; + + parser["Multitive"] = [](const SemanticValues &vs) { + switch (vs.choice()) { + case 0: // "Primary '*' Multitive" + return any_cast(vs[0]) * any_cast(vs[1]); + default: // "Primary" + return any_cast(vs[0]); + } + }; + + parser["Number"] = [](const SemanticValues &vs) { + return vs.token_to_number(); + }; + + // (4) Parse + parser.enable_packrat_parsing(); // Enable packrat parsing. + + int val; + parser.parse(" (1 + 2) * 3 ", val); + + assert(val == 9); +} diff --git a/recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt b/recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpp-peglib/1.x.x/test_v1_package/conanfile.py b/recipes/cpp-peglib/1.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpp-peglib/1.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml new file mode 100644 index 0000000000000..923bbafb7c017 --- /dev/null +++ b/recipes/cpp-peglib/config.yml @@ -0,0 +1,27 @@ +versions: + "1.8.3": + folder: "1.x.x" + "1.8.2": + folder: "1.x.x" + "1.8.1": + folder: "1.x.x" + "1.8.0": + folder: "1.x.x" + "1.6.1": + folder: "1.x.x" + "1.6.0": + folder: "1.x.x" + "1.5.0": + folder: "1.x.x" + "1.4.2": + folder: "1.x.x" + "1.4.1": + folder: "1.x.x" + "1.3.10": + folder: "1.x.x" + "1.3.9": + folder: "1.x.x" + "1.3.8": + folder: "1.x.x" + "0.1.13": + folder: "0.x.x" diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml new file mode 100644 index 0000000000000..092fe59db4a19 --- /dev/null +++ b/recipes/cpp-sort/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "1.14.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.14.0.tar.gz" + sha256: "3b85cd4580f54ae3f171777d0630b4f7c89c33cf96e9ae24a1dbebbf200c3195" + "1.13.2": + url: "https://github.com/Morwenn/cpp-sort/archive/1.13.2.tar.gz" + sha256: "f5384ed9c8abef2f26cb010df2687ac8bba52f0e1726935826a80e83c1347b23" + "1.13.1": + url: "https://github.com/Morwenn/cpp-sort/archive/1.13.1.tar.gz" + sha256: "139912c6004df8748bb1cfd3b94f2c6bfc2713885ed4b8e927a783d6b66963a8" + "1.13.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.13.0.tar.gz" + sha256: "646eca5c592d20cbde0fbff41c65527940bb6430be68e0224fb5fcbf38b0df92" + "1.12.1": + url: "https://github.com/Morwenn/cpp-sort/archive/1.12.1.tar.gz" + sha256: "5b0b6f3b4d9ecc339d6c2204a18479edca49fbc4d487413e0ec747e143569e2a" + "1.12.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.12.0.tar.gz" + sha256: "70877c1993fa1e5eb53974ac30aeb713448c206344379f193dec8ee887c23998" + "1.11.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.11.0.tar.gz" + sha256: "a53b3ea240d6f8d8ea9da0a7e0c8e313cf5e714daedf1617473ab34f111ffeec" + "1.10.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.10.0.tar.gz" + sha256: "48951cac0051d48fee286c3bc02804975f9d83269d80c10dfc5589e76a542765" + "1.9.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.9.0.tar.gz" + sha256: "e83f3daad30bd91fed668bdb56ad379c4aeea39d7dc640484fdcc55149b6d0e4" + "1.8.1": + url: "https://github.com/Morwenn/cpp-sort/archive/1.8.1.tar.gz" + sha256: "04d518dabb422614fcb4a2b4e258c515f31dd01d51c26e9eaaec76e77c4d3d40" + "1.8.0": + sha256: a3de426a66cffbe9f8865feb7518ff4f4d1b3aadf3725161b8e118dcbf6fe9b9 + url: https://github.com/Morwenn/cpp-sort/archive/1.8.0.tar.gz + "1.7.0": + sha256: 4a8230be2c63a92395e140cb7e6593171638a41c46f4cd14d6ffc354ba830e2b + url: https://github.com/Morwenn/cpp-sort/archive/1.7.0.tar.gz + "1.6.0": + sha256: df048d15ff555030eb90d3c96f560a75bbec8baee256f2ced647f359c892c9c8 + url: https://github.com/Morwenn/cpp-sort/archive/1.6.0.tar.gz + "1.5.1": + sha256: 39925958dbd773f15d36d74d4ded48f075c05feef7fe604c7c5c4bfae2a4ec55 + url: https://github.com/Morwenn/cpp-sort/archive/1.5.1.tar.gz diff --git a/recipes/cpp-sort/all/conanfile.py b/recipes/cpp-sort/all/conanfile.py new file mode 100644 index 0000000000000..cfda199bf6a78 --- /dev/null +++ b/recipes/cpp-sort/all/conanfile.py @@ -0,0 +1,105 @@ +import os.path + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.50.0" + + +class CppSortConan(ConanFile): + name = "cpp-sort" + description = "Additional sorting algorithms & related tools" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Morwenn/cpp-sort" + topics = "cpp-sort", "sorting", "algorithms" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "9.4", + "clang": "3.8", + "gcc": "5.5" + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + if is_msvc(self) and Version(self.version) < "1.10.0": + raise ConanInvalidConfiguration(f"{self.ref} versions older than 1.10.0 do not support MSVC") + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + try: + minimum_version = self._compilers_minimum_version[str(compiler)] + if minimum_version and loose_lt_semver(version, minimum_version): + msg = ( + f"{self.ref} requires C++{self._minimum_cpp_standard} features " + f"which are not supported by compiler {compiler} {version}." + ) + raise ConanInvalidConfiguration(msg) + except KeyError: + msg = ( + f"{self.ref} recipe lacks information about the {compiler} compiler, " + f"support for the required C++{self._minimum_cpp_standard} features is assumed" + ) + self.output.warn(msg) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = "OFF" + tc.generate() + + def package(self): + # Install with CMake + cmake = CMake(self) + cmake.configure() + cmake.install() + + # Copy license files + if Version(self.version) < "1.8.0": + license_files = ["license.txt"] + else: + license_files = ["LICENSE.txt", "NOTICE.txt"] + for license_file in license_files: + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + # Remove CMake config files (only files in lib) + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpp-sort") + self.cpp_info.set_property("cmake_target_name", "cpp-sort::cpp-sort") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if is_msvc(self): + self.cpp_info.cxxflags = ["/permissive-"] diff --git a/recipes/cpp-sort/all/test_package/CMakeLists.txt b/recipes/cpp-sort/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..da13330ac49af --- /dev/null +++ b/recipes/cpp-sort/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(cpp-sort REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} cpp-sort-integrity.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE cpp-sort::cpp-sort) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cpp-sort/all/test_package/conanfile.py b/recipes/cpp-sort/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3c57d0fcd9af8 --- /dev/null +++ b/recipes/cpp-sort/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 CppsortTestConan(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/cpp-sort/all/test_package/cpp-sort-integrity.cpp b/recipes/cpp-sort/all/test_package/cpp-sort-integrity.cpp new file mode 100644 index 0000000000000..05f269569147f --- /dev/null +++ b/recipes/cpp-sort/all/test_package/cpp-sort-integrity.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2018-2020 Morwenn. + * + * SPDX-License-Identifier: MIT + */ +#include +#include +#include +#include +#include + +int main() +{ + int arr[] = { 5, 8, 3, 2, 9 }; + cppsort::smooth_sort(arr); + assert(std::is_sorted(std::begin(arr), std::end(arr))); + + // should print 2 3 5 8 9 + for (int val: arr) { + std::cout << val << ' '; + } +} diff --git a/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt b/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a9b48732268c --- /dev/null +++ b/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/cpp-sort/all/test_v1_package/conanfile.py b/recipes/cpp-sort/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b6f0560ab0e48 --- /dev/null +++ b/recipes/cpp-sort/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class CppsortTestConan(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/cpp-sort/config.yml b/recipes/cpp-sort/config.yml new file mode 100644 index 0000000000000..c097db627e415 --- /dev/null +++ b/recipes/cpp-sort/config.yml @@ -0,0 +1,29 @@ +versions: + "1.14.0": + folder: all + "1.13.2": + folder: all + "1.13.1": + folder: all + "1.13.0": + folder: all + "1.12.1": + folder: all + "1.12.0": + folder: all + "1.11.0": + folder: all + "1.10.0": + folder: all + "1.9.0": + folder: all + "1.8.1": + folder: all + "1.8.0": + folder: all + "1.7.0": + folder: all + "1.6.0": + folder: all + "1.5.1": + folder: all diff --git a/recipes/cpp-taskflow/all/conandata.yml b/recipes/cpp-taskflow/all/conandata.yml new file mode 100644 index 0000000000000..e82779fa22a56 --- /dev/null +++ b/recipes/cpp-taskflow/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + 2.2.0: + url: "https://github.com/taskflow/taskflow/archive/v2.2.0.tar.gz" + sha256: "A8AD8C94CEEAC0BC18D8429F877E10A2AF2CD44CD9DC420D9751E69F48FF85D1" + 2.4.0: + url: "https://github.com/taskflow/taskflow/archive/v2.4.0.tar.gz" + sha256: "1F6CC854DD579396CA22AE86014CBF13DD90205E7C9438E2B6B2FDDACA99668C" diff --git a/recipes/cpp-taskflow/all/conanfile.py b/recipes/cpp-taskflow/all/conanfile.py new file mode 100644 index 0000000000000..c52e7a7548e56 --- /dev/null +++ b/recipes/cpp-taskflow/all/conanfile.py @@ -0,0 +1,73 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.28.0" + +class CppTaskflowConan(ConanFile): + name = "cpp-taskflow" + description = "A fast C++ header-only library to help you quickly write parallel programs with complex task dependencies." + topics = ("conan", "cpp-taskflow", "taskflow", "tasking", "parallelism") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cpp-taskflow/cpp-taskflow" + license = "MIT" + no_copy_source = True + settings = "os", "compiler" + deprecated = "taskflow" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + min_req_cppstd = "17" if tools.Version(self.version) <= "2.2.0" else "14" + + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, min_req_cppstd) + else: + self.output.warn("%s recipe lacks information about the %s compiler" + " standard version support" % (self.name, compiler)) + + minimal_version = { + "17": { + "Visual Studio": "16", + "gcc": "7.3", + "clang": "6.0", + "apple-clang": "10.0" + }, + "14": { + "Visual Studio": "15", + "gcc": "5", + "clang": "4.0", + "apple-clang": "8.0" + } + } + + if compiler not in minimal_version[min_req_cppstd]: + self.output.info("%s requires a compiler that supports at least C++%s" % (self.name, min_req_cppstd)) + return + + # Exclude compilers not supported by cpp-taskflow + if compiler_version < minimal_version[min_req_cppstd][compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports" + " at least C++%s. %s %s is not" + " supported." % (self.name, min_req_cppstd, compiler, tools.Version(self.settings.compiler.version.value))) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("taskflow-" + self.version, self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include/taskflow", src=os.path.join(self._source_subfolder, "taskflow")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") + if self.settings.compiler == "Visual Studio": + self.cpp_info.defines.append("_ENABLE_EXTENDED_ALIGNED_STORAGE") diff --git a/recipes/cpp-taskflow/all/test_package/CMakeLists.txt b/recipes/cpp-taskflow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5694d2375840f --- /dev/null +++ b/recipes/cpp-taskflow/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(CPPTASKFLOW_CXX_STANDARD 14) +if (CPPTASKFLOW_VERSION LESS_EQUAL "2.2.0") + set(CPPTASKFLOW_CXX_STANDARD 17) +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD ${CPPTASKFLOW_CXX_STANDARD}) diff --git a/recipes/cpp-taskflow/all/test_package/conanfile.py b/recipes/cpp-taskflow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..befc8454d2cdf --- /dev/null +++ b/recipes/cpp-taskflow/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.definitions["CPPTASKFLOW_VERSION"] = self.deps_cpp_info["cpp-taskflow"].version + 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/cpp-taskflow/all/test_package/test_package.cpp b/recipes/cpp-taskflow/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3b078cb358c93 --- /dev/null +++ b/recipes/cpp-taskflow/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +int main() +{ + tf::Executor executor; + tf::Taskflow taskflow; + + auto A = taskflow.emplace([](){ std::cout << "Task A\n"; }); + auto B = taskflow.emplace([](){ std::cout << "Task B\n"; }); + auto C = taskflow.emplace([](){ std::cout << "Task C\n"; }); + auto D = taskflow.emplace([](){ std::cout << "Task D\n"; }); + + // + // +---+ + // +---->| B |-----+ + // | +---+ | + // +---+ +-v-+ + // | A | | D | + A.precede(B); // B runs after A // +---+ +-^-+ + A.precede(C); // C runs after A // | +---+ | + B.precede(D); // D runs after B // +---->| C |-----+ + C.precede(D); // D runs after C // +---+ + + executor.run(taskflow).get(); + + return 0; +} diff --git a/recipes/cpp-taskflow/config.yml b/recipes/cpp-taskflow/config.yml new file mode 100644 index 0000000000000..69a0530ca48bc --- /dev/null +++ b/recipes/cpp-taskflow/config.yml @@ -0,0 +1,5 @@ +versions: + 2.2.0: + folder: all + 2.4.0: + folder: all diff --git a/recipes/cpp_project_framework/all/conandata.yml b/recipes/cpp_project_framework/all/conandata.yml new file mode 100644 index 0000000000000..43a795642b381 --- /dev/null +++ b/recipes/cpp_project_framework/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/sheepgrass/cpp_project_framework/archive/1.0.0.tar.gz" + sha256: "1df9f3ad46e369372e1a3b108437b929e13320f8d649d2f360b8a3d033c8c60d" diff --git a/recipes/cpp_project_framework/all/conanfile.py b/recipes/cpp_project_framework/all/conanfile.py new file mode 100644 index 0000000000000..5a2a5fe5679e4 --- /dev/null +++ b/recipes/cpp_project_framework/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.tools.files import get +from conan.tools.scm import Version +from conans.errors import ConanInvalidConfiguration +from conans.tools import check_min_cppstd +import os + +required_conan_version = ">=1.33.0" + + +class CppProjectFrameworkConan(ConanFile): + name = "cpp_project_framework" + license = "AGPL-3.0" + homepage = "https://github.com/sheepgrass/cpp_project_framework" + url = "https://github.com/conan-io/conan-center-index" # Package recipe repository url here, for issues about the package + description = "C++ Project Framework is a framework for creating C++ project." + topics = ("cpp", "project", "framework") + settings = "os", "compiler", "build_type", "arch" + + def package_id(self): + self.info.header_only() + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + def validate(self): + if self.settings.os not in ('Linux', 'Windows'): + raise ConanInvalidConfiguration(f"{self.name} is just supported for Linux and Windows") + + compiler = self.settings.compiler + + if compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + if compiler in ('gcc', 'clang'): + if compiler.get_safe("libcxx") != "libstdc++": + raise ConanInvalidConfiguration(f"only supported {compiler} with libstdc++") + + min_version = self._minimum_compilers_version.get(str(compiler)) + if not min_version: + self.output.warn(f"{self.name} recipe lacks information about the {compiler} compiler support.") + else: + if Version(compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler {compiler} {compiler.version} does not support it.") + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst=os.path.join("include", self.name), src=os.path.join(self._source_subfolder, self.name)) diff --git a/recipes/cpp_project_framework/all/test_package/CMakeLists.txt b/recipes/cpp_project_framework/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d3c22a987a39d --- /dev/null +++ b/recipes/cpp_project_framework/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cpp_project_framework REQUIRED) +find_package(GTest REQUIRED) + +add_executable(test_package test_package.cpp) +if(UNIX) + target_link_libraries(test_package cpp_project_framework::cpp_project_framework GTest::gtest GTest::gtest_main stdc++fs) +else() + target_link_libraries(test_package cpp_project_framework::cpp_project_framework GTest::gtest GTest::gtest_main) +endif() diff --git a/recipes/cpp_project_framework/all/test_package/conanfile.py b/recipes/cpp_project_framework/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ed8a4e73713c6 --- /dev/null +++ b/recipes/cpp_project_framework/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class CppProjectFrameworkTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + requires = "gtest/1.10.0" + + 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/cpp_project_framework/all/test_package/test_package.cpp b/recipes/cpp_project_framework/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..056f85631bb0f --- /dev/null +++ b/recipes/cpp_project_framework/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include "cpp_project_framework/cpp_project_framework.h" + +#include "cpp_project_framework/filesystem.h" +#include "cpp_project_framework/gtest.h" + + +/// Dummy test +TEST(CppProjectFrameworkTest, DummyTest) +{ + EXPECT_TRUE(true); +} + + /// Test for GET_TEST_CASE_NAME() macro +TEST(CppProjectFrameworkGoogleTestTest, GetTestCaseName) +{ + EXPECT_STREQ(GET_TEST_CASE_NAME(), "CppProjectFrameworkGoogleTestTest.GetTestCaseName"); +} + +/// Test for SCOPED_TRACE_CODE_BLOCK() macro +TEST(CppProjectFrameworkGoogleTestTest, ScopedTraceCodeBlock) +{ + SCOPED_TRACE_CODE_BLOCK(EXPECT_STREQ(GET_TEST_CASE_NAME(), "CppProjectFrameworkGoogleTestTest.ScopedTraceCodeBlock")); +} + +/// Test for filesystem header +TEST(CppProjectFrameworkFileSystemTest, FileSystem) +{ + namespace fs = sheepgrass::filesystem; + EXPECT_TRUE(fs::is_directory(fs::current_path())); +} diff --git a/recipes/cpp_project_framework/config.yml b/recipes/cpp_project_framework/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/cpp_project_framework/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/cppbenchmark/all/conandata.yml b/recipes/cppbenchmark/all/conandata.yml new file mode 100644 index 0000000000000..2873a6dc352ca --- /dev/null +++ b/recipes/cppbenchmark/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "1.0.3.0": + url: "https://github.com/chronoxor/CppBenchmark/archive/1.0.3.0.tar.gz" + sha256: "6a62cfdb2aacf91523f74c6d0e42a3e2388ff94a2b7b983bec543c88554cc3e9" + "1.0.0.0": + url: "https://github.com/chronoxor/CppBenchmark/archive/1.0.0.0.tar.gz" + sha256: "8c043731e979ef570e3744484e6644de6e47db228b9543ec6433401e4e2f09b8" + "cci.20201029": + url: "https://github.com/chronoxor/CppBenchmark/archive/8605a8e886647e964180cb7a622424404a1da01f.tar.gz" + sha256: "f0b88802b4418b13c04ae4dfdb859b2cb81142a47ca473ad447a8be087e0adee" +patches: + "1.0.3.0": + - patch_file: "patches/1.0.3.0-0001-fix-cmake.patch" + patch_description: "fix install path, use cci packages, disable tests" + patch_type: "conan" + "1.0.0.0": + - patch_file: "patches/1.0.0.0-0001-fix-cmake.patch" + patch_description: "fix install path, use cci packages, disable tests" + patch_type: "conan" + "cci.20201029": + - patch_file: "patches/1.0.0.0-0001-fix-cmake.patch" + patch_description: "fix install path, use cci packages, disable tests" + patch_type: "conan" diff --git a/recipes/cppbenchmark/all/conanfile.py b/recipes/cppbenchmark/all/conanfile.py new file mode 100644 index 0000000000000..cf8688e000658 --- /dev/null +++ b/recipes/cppbenchmark/all/conanfile.py @@ -0,0 +1,98 @@ +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.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 CppBenchmark(ConanFile): + name = "cppbenchmark" + description = "Performance benchmark framework for C++ with nanoseconds measure precision." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chronoxor/CppBenchmark" + topics = ("utils", "library", "benchmark") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": 10, + "clang": 6, + "gcc": 7, + "Visual Studio": 16, + "msvc": 192, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("hdrhistogram-c/0.11.6") + self.requires("cpp-optparse/cci.20171104") + + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CPPBENCHMARK_MODULE"] = "OFF" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["cppbenchmark"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/cppbenchmark/all/patches/1.0.0.0-0001-fix-cmake.patch b/recipes/cppbenchmark/all/patches/1.0.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..73ce64552f4a6 --- /dev/null +++ b/recipes/cppbenchmark/all/patches/1.0.0.0-0001-fix-cmake.patch @@ -0,0 +1,82 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 1db1778..0343a94 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -17,41 +17,41 @@ if(DOXYGEN_FOUND) + endif() + endif() + +-# CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-# Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) +- + # External packages + find_package(Threads REQUIRED) + +-# Modules +-add_subdirectory("modules") +- + # Link libraries + list(APPEND LINKLIBS Threads::Threads) + +-# System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") +- + # Library ++find_package(hdr_histogram REQUIRED CONFIG) ++if(TARGET hdr_histogram::hdr_histogram) ++ list(APPEND LINKLIBS hdr_histogram::hdr_histogram) ++else() ++ list(APPEND LINKLIBS hdr_histogram::hdr_histogram_static) ++endif() ++ ++find_package(cpp-optparse REQUIRED CONFIG) ++list(APPEND LINKLIBS cpp-optparse::cpp-optparse) ++ ++ + file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h") + file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl") + file(GLOB_RECURSE LIB_SOURCE_FILES "source/*.cpp") + add_library(cppbenchmark ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppbenchmark PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") + target_include_directories(cppbenchmark PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +-target_link_libraries(cppbenchmark ${LINKLIBS} cpp-optparse HdrHistogram) ++target_compile_definitions(cppbenchmark PUBLIC _CRT_SECURE_NO_WARNINGS) ++target_compile_features(cppbenchmark PUBLIC cxx_std_17) ++set_target_properties(cppbenchmark PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++target_link_libraries(cppbenchmark ${LINKLIBS}) + list(APPEND INSTALL_TARGETS cppbenchmark) + list(APPEND LINKLIBS cppbenchmark) + + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPBENCHMARK_MODULE) + ++ if(0) + # Examples + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") +@@ -80,12 +80,16 @@ if(NOT CPPBENCHMARK_MODULE) + # CTest + enable_testing() + add_test(cppbenchmark-tests cppbenchmark-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++ install(FILES ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/benchmark) + + # Install *.pdb files + if(MSVC) diff --git a/recipes/cppbenchmark/all/patches/1.0.3.0-0001-fix-cmake.patch b/recipes/cppbenchmark/all/patches/1.0.3.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..92f92dd44a822 --- /dev/null +++ b/recipes/cppbenchmark/all/patches/1.0.3.0-0001-fix-cmake.patch @@ -0,0 +1,82 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index a42103b..59309e8 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -17,41 +17,41 @@ if(DOXYGEN_FOUND) + endif() + endif() + +-# CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-# Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) +- + # External packages + find_package(Threads REQUIRED) + +-# Modules +-add_subdirectory("modules") +- + # Link libraries + list(APPEND LINKLIBS Threads::Threads) + +-# System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") +- + # Library ++find_package(hdr_histogram REQUIRED CONFIG) ++if(TARGET hdr_histogram::hdr_histogram) ++ list(APPEND LINKLIBS hdr_histogram::hdr_histogram) ++else() ++ list(APPEND LINKLIBS hdr_histogram::hdr_histogram_static) ++endif() ++ ++find_package(cpp-optparse REQUIRED CONFIG) ++list(APPEND LINKLIBS cpp-optparse::cpp-optparse) ++ ++ + file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h" "source/*.h") + file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") + file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") + add_library(cppbenchmark ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppbenchmark PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") + target_include_directories(cppbenchmark PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +-target_link_libraries(cppbenchmark ${LINKLIBS} cpp-optparse HdrHistogram) ++target_compile_definitions(cppbenchmark PUBLIC _CRT_SECURE_NO_WARNINGS) ++target_compile_features(cppbenchmark PUBLIC cxx_std_17) ++set_target_properties(cppbenchmark PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++target_link_libraries(cppbenchmark ${LINKLIBS}) + list(APPEND INSTALL_TARGETS cppbenchmark) + list(APPEND LINKLIBS cppbenchmark) + + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPBENCHMARK_MODULE) + ++ if(0) + # Examples + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") +@@ -80,12 +80,16 @@ if(NOT CPPBENCHMARK_MODULE) + # CTest + enable_testing() + add_test(cppbenchmark-tests cppbenchmark-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++ install(FILES ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/benchmark) + + # Install *.pdb files + if(MSVC) diff --git a/recipes/cppbenchmark/all/test_package/CMakeLists.txt b/recipes/cppbenchmark/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba1f47741565b --- /dev/null +++ b/recipes/cppbenchmark/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cppbenchmark REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppbenchmark::cppbenchmark) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cppbenchmark/all/test_package/conanfile.py b/recipes/cppbenchmark/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/cppbenchmark/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cppbenchmark/all/test_package/test_package.cpp b/recipes/cppbenchmark/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..741ca9cb18204 --- /dev/null +++ b/recipes/cppbenchmark/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "benchmark/cppbenchmark.h" + +#include + +// Benchmark sin() call for 1 seconds. +// Make 1 attemtps and choose one with the best time result. +BENCHMARK("sin", Settings().Duration(1).Operations(1).Attempts(1)) +{ + std::sin(123.456); +} + +BENCHMARK_MAIN() diff --git a/recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt b/recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cppbenchmark/all/test_v1_package/conanfile.py b/recipes/cppbenchmark/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/cppbenchmark/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cppbenchmark/config.yml b/recipes/cppbenchmark/config.yml new file mode 100644 index 0000000000000..d05d94032be0f --- /dev/null +++ b/recipes/cppbenchmark/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.3.0": + folder: all + "1.0.0.0": + folder: all + "cci.20201029": + folder: all diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml new file mode 100644 index 0000000000000..f9dabdc5e5fa6 --- /dev/null +++ b/recipes/cppcheck/all/conandata.yml @@ -0,0 +1,61 @@ +sources: + "2.10.3": + url: "https://github.com/danmar/cppcheck/archive/2.10.3.tar.gz" + sha256: "8aae5e116daeaaf5d19f3efa61b91c06f161cb97412a1d1af6e1e20686e48967" + "2.10": + url: "https://github.com/danmar/cppcheck/archive/2.10.tar.gz" + sha256: "785dcbf711048dfe43ae920b6eff2eeebb4a096e88188a40e173ca4c030f57c3" + "2.9.3": + url: "https://github.com/danmar/cppcheck/archive/2.9.3.tar.gz" + sha256: "46319ca73e33e4b2bd91981a76a0d4f184cd3f86b62dc18e8938eabacd3ad2e3" + "2.9.2": + url: "https://github.com/danmar/cppcheck/archive/2.9.2.tar.gz" + sha256: "93920d24d4442856bf7916ee0e3fc31308bc23948e7029b4fd332e01cac63c3e" + "2.8.2": + url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" + sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" +patches: + "2.10.3": + - patch_file: "patches/0001-cli-remove-dmake-cmake-2.10.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" + "2.10": + - patch_file: "patches/0001-cli-remove-dmake-cmake-2.10.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" + "2.9.3": + - patch_file: "patches/0001-cli-remove-dmake-cmake.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" + - patch_file: "patches/0002-htmlreport-python3.patch" + patch_description: "Use Python 3 in Shebang Header" + patch_type: "portability" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" + "2.9.2": + - patch_file: "patches/0001-cli-remove-dmake-cmake.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" + - patch_file: "patches/0002-htmlreport-python3.patch" + patch_description: "Use Python 3 in Shebang Header" + patch_type: "portability" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" + "2.8.2": + - patch_file: "patches/0001-cli-remove-dmake-cmake-2.8.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" + - patch_file: "patches/0002-htmlreport-python3.patch" + patch_description: "Use Python 3 in Shebang Header" + patch_type: "portability" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py new file mode 100644 index 0000000000000..734ffc6f84fd2 --- /dev/null +++ b/recipes/cppcheck/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.52.0" + + +class CppcheckConan(ConanFile): + name = "cppcheck" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/danmar/cppcheck" + topics = ("code quality", "static analyzer", "linter") + description = "Cppcheck is an analysis tool for C/C++ code." + license = "GPL-3.0-or-later" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = {"have_rules": [True, False]} + default_options = {"have_rules": True} + + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + if self.options.get_safe("have_rules"): + self.requires("pcre/8.45") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HAVE_RULES"] = self.options.get_safe("have_rules", False) + tc.variables["USE_MATCHCOMPILER"] = "Auto" + tc.variables["ENABLE_OSS_FUZZ"] = False + tc.variables["FILESDIR"] = "bin" + 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, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder)) + copy(self, "cppcheck-htmlreport", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "htmlreport")) + cmake = CMake(self) + cmake.install() + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def package_info(self): + self.cpp_info.includedirs = [] + 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/all/patches/0001-cli-remove-dmake-cmake-2.10.patch b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.10.patch new file mode 100644 index 0000000000000..22f318312cdf0 --- /dev/null +++ b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.10.patch @@ -0,0 +1,15 @@ +--- a/cli/CMakeLists.txt 2022-11-08 20:22:59.000000000 +0100 ++++ b/cli/CMakeLists.txt 2022-11-23 21:33:49.347849300 +0100 +@@ -60,11 +60,10 @@ + + add_dependencies(cppcheck copy_cfg) + add_dependencies(cppcheck copy_addons) + add_dependencies(cppcheck copy_platforms) +-add_dependencies(cppcheck run-dmake) + + install(TARGETS cppcheck +- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons} diff --git a/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch new file mode 100644 index 0000000000000..157034975424b --- /dev/null +++ b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch @@ -0,0 +1,14 @@ +--- a/cli/CMakeLists.txt 2022-07-12 23:11:29.000000000 +0200 ++++ b/cli/CMakeLists.txt 2022-11-23 22:01:29.111581500 +0100 +@@ -45,10 +45,9 @@ + + add_dependencies(cppcheck copy_cfg) + add_dependencies(cppcheck copy_addons) +-add_dependencies(cppcheck run-dmake) + + install(TARGETS cppcheck +- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons} diff --git a/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch new file mode 100644 index 0000000000000..18fff8473a497 --- /dev/null +++ b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch @@ -0,0 +1,14 @@ +--- a/cli/CMakeLists.txt 2022-11-08 20:22:59.000000000 +0100 ++++ b/cli/CMakeLists.txt 2022-11-23 21:33:49.347849300 +0100 +@@ -43,10 +43,9 @@ + + add_dependencies(cppcheck copy_cfg) + add_dependencies(cppcheck copy_addons) +-add_dependencies(cppcheck run-dmake) + + install(TARGETS cppcheck +- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons} diff --git a/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch b/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch new file mode 100644 index 0000000000000..2012ae5551b1b --- /dev/null +++ b/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch @@ -0,0 +1,10 @@ +diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport +index 97a3af50d..b45cebf31 100755 +--- a/htmlreport/cppcheck-htmlreport ++++ b/htmlreport/cppcheck-htmlreport +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from __future__ import unicode_literals + diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch new file mode 100644 index 0000000000000..fa8b46fd1608e --- /dev/null +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -0,0 +1,28 @@ +--- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 ++++ b/cmake/findDependencies.cmake 2022-11-24 13:57:22.099453500 +0100 +@@ -16,7 +16,7 @@ + + if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) +- find_library(PCRE_LIBRARY pcre) ++ find_library(PCRE_LIBRARY NAMES pcre pcred) + if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) + message(FATAL_ERROR "pcre dependency for RULES has not been found") + endif() +@@ -24,16 +24,8 @@ + + if (USE_Z3) + find_package(Z3 QUIET) +- if (NOT Z3_FOUND) + find_library(Z3_LIBRARIES z3) +- if (NOT Z3_LIBRARIES) +- message(FATAL_ERROR "z3 dependency has not been found") +- endif() + find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") +- if (NOT Z3_CXX_INCLUDE_DIRS) +- message(FATAL_ERROR "z3++.h has not been found") +- endif() +- endif() + endif() + + set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch new file mode 100644 index 0000000000000..9431d05ce2a2d --- /dev/null +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch @@ -0,0 +1,11 @@ +--- a/cmake/findDependencies.cmake 2022-11-08 20:22:59.000000000 +0100 ++++ b/cmake/findDependencies.cmake 2022-11-23 21:29:50.222152900 +0100 +@@ -36,7 +36,7 @@ + + if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) +- find_library(PCRE_LIBRARY pcre) ++ find_library(PCRE_LIBRARY NAMES pcre pcred) + if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) + message(FATAL_ERROR "pcre dependency for RULES has not been found") + endif() diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a590f2dcaaa60 --- /dev/null +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("cppcheck --enable=warning,style,performance --std=c++11 .", + cwd=self.source_folder) + if self.settings.os == "Windows": + self.run("set CPPCHECK_HTMLREPORT") + else: + self.run("which cppcheck-htmlreport") diff --git a/recipes/cppcheck/all/test_package/file_to_check.cpp b/recipes/cppcheck/all/test_package/file_to_check.cpp new file mode 100644 index 0000000000000..33c14ce1d76c0 --- /dev/null +++ b/recipes/cppcheck/all/test_package/file_to_check.cpp @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/recipes/cppcheck/all/test_v1_package/conanfile.py b/recipes/cppcheck/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0102e14ac0191 --- /dev/null +++ b/recipes/cppcheck/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conan import ConanFile +from conan.tools.build import can_run +import sys + + +class TestPackageConan(ConanFile): + settings = "os", "arch" + generators = "VirtualRunEnv" + + def test(self): + if can_run(self): + self.run("cppcheck --enable=warning,style,performance --std=c++11 .", + cwd=self.source_folder, run_environment=True) + if self.settings.os == "Windows": + self.run(f"{sys.executable} %CPPCHECK_HTMLREPORT% -h", run_environment=True) + else: + self.run("cppcheck-htmlreport -h", run_environment=True) diff --git a/recipes/cppcheck/all/test_v1_package/file_to_check.cpp b/recipes/cppcheck/all/test_v1_package/file_to_check.cpp new file mode 100644 index 0000000000000..33c14ce1d76c0 --- /dev/null +++ b/recipes/cppcheck/all/test_v1_package/file_to_check.cpp @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml new file mode 100644 index 0000000000000..77ce70296b493 --- /dev/null +++ b/recipes/cppcheck/config.yml @@ -0,0 +1,11 @@ +versions: + "2.10.3": + folder: all + "2.10": + folder: all + "2.9.3": + folder: all + "2.9.2": + folder: all + "2.8.2": + folder: all diff --git a/recipes/cppcmd/all/conandata.yml b/recipes/cppcmd/all/conandata.yml new file mode 100644 index 0000000000000..ad9ece94d61e3 --- /dev/null +++ b/recipes/cppcmd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/remysalim/cppcmd/archive/v0.1.0.tar.gz" + sha256: f9813c298f40fd29ebdfa0a9e68cdea80ec1b0f93c32e8fafef58dc01eb48368 diff --git a/recipes/cppcmd/all/conanfile.py b/recipes/cppcmd/all/conanfile.py new file mode 100644 index 0000000000000..f83b9294d4efa --- /dev/null +++ b/recipes/cppcmd/all/conanfile.py @@ -0,0 +1,67 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +from glob import glob + + +class CppCmdConan(ConanFile): + name = "cppcmd" + description = "Simple cpp command interpreter header-only library" + topics = ("header-only", "interpreter", "cpp") + homepage = "https://github.com/remysalim/cppcmd" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "compiler", "arch", "build_type" + generators = "cmake" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15.7", + "gcc": "8", + "clang": "7", + "apple-clang": "10.2", + } + + def configure(self): + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get( + str(self.settings.compiler)) + if not min_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler)) + else: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("{} requires C++17 support. The current compiler {} {} does not support it.".format( + self.name, self.settings.compiler, self.settings.compiler.version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob("cppcmd-*")[0] + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + cmake = CMake(self) + cmake.definitions["BUILD_TESTS"] = "OFF" + cmake.configure(source_folder=self._source_subfolder, + build_folder=self._build_subfolder) + cmake.install() + + def package_id(self): + self.info.header_only() diff --git a/recipes/cppcmd/all/test_package/CMakeLists.txt b/recipes/cppcmd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1ecd7e0a81c7b --- /dev/null +++ b/recipes/cppcmd/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.5) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cppcmd/all/test_package/conanfile.py b/recipes/cppcmd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/cppcmd/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cppcmd/all/test_package/main.cpp b/recipes/cppcmd/all/test_package/main.cpp new file mode 100644 index 0000000000000..186e15bf7de57 --- /dev/null +++ b/recipes/cppcmd/all/test_package/main.cpp @@ -0,0 +1,21 @@ +#include + +#include + +using namespace cppcmd; +using namespace std; + +int main() { + unsigned int fooCalls = 0; + unsigned int barCalls = 0; + + stringstream input; + auto interpreter = CommandInterpreter(input, std::cout); + interpreter.registerCommand("foo", [&](const auto&, auto&) { fooCalls++; }); + interpreter.registerCommand("bar", [&](const auto&, auto&) { barCalls++; }); + + input << "foo\nbar\nundefined\nfoo\n"; + interpreter.run(); + + return 0; +} diff --git a/recipes/cppcmd/config.yml b/recipes/cppcmd/config.yml new file mode 100644 index 0000000000000..5d53fbdfdbbf5 --- /dev/null +++ b/recipes/cppcmd/config.yml @@ -0,0 +1,3 @@ +versions: + 0.1.0: + folder: "all" diff --git a/recipes/cppcodec/all/conandata.yml b/recipes/cppcodec/all/conandata.yml new file mode 100644 index 0000000000000..62413de635537 --- /dev/null +++ b/recipes/cppcodec/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2": + sha256: 0edaea2a9d9709d456aa99a1c3e17812ed130f9ef2b5c2d152c230a5cbc5c482 + url: https://github.com/tplgy/cppcodec/archive/v0.2.tar.gz diff --git a/recipes/cppcodec/all/conanfile.py b/recipes/cppcodec/all/conanfile.py new file mode 100644 index 0000000000000..59f96dbe4a59f --- /dev/null +++ b/recipes/cppcodec/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class CppcodecConan(ConanFile): + name = "cppcodec" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tplgy/cppcodec" + description = ( + "Header-only C++11 library to encode/decode base64, base64url, base32, " + "base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32" + ) + topics = ("base64", "cpp11", "codec", "base32") + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*hpp", src=os.path.join(self.source_folder, "cppcodec"), dst=os.path.join(self.package_folder, "include", "cppcodec")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "cppcodec-1") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/cppcodec/all/test_package/CMakeLists.txt b/recipes/cppcodec/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d359976811ee3 --- /dev/null +++ b/recipes/cppcodec/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cppcodec REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppcodec::cppcodec) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppcodec/all/test_package/conanfile.py b/recipes/cppcodec/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cppcodec/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/cppcodec/all/test_package/test_package.cpp b/recipes/cppcodec/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c916fb4f76887 --- /dev/null +++ b/recipes/cppcodec/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() { + using base32 = cppcodec::base32_crockford; + using base64 = cppcodec::base64_rfc4648; + + std::vector decoded = base64::decode("YW55IGNhcm5hbCBwbGVhc3VyZQ=="); + std::cout << "decoded size (\"any carnal pleasure\"): " << decoded.size() << '\n'; + std::cout << base32::encode(decoded) << std::endl; // "C5Q7J833C5S6WRBC41R6RSB1EDTQ4S8" + return 0; +} + diff --git a/recipes/cppcodec/all/test_v1_package/CMakeLists.txt b/recipes/cppcodec/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4e3738c68e0b9 --- /dev/null +++ b/recipes/cppcodec/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cppcodec REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppcodec::cppcodec) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppcodec/all/test_v1_package/conanfile.py b/recipes/cppcodec/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cppcodec/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/cppcodec/config.yml b/recipes/cppcodec/config.yml new file mode 100644 index 0000000000000..7e65100e62b2c --- /dev/null +++ b/recipes/cppcodec/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2": + folder: all diff --git a/recipes/cppcommon/all/CMakeLists.txt b/recipes/cppcommon/all/CMakeLists.txt new file mode 100644 index 0000000000000..6ba47d078b389 --- /dev/null +++ b/recipes/cppcommon/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/cppcommon/all/conandata.yml b/recipes/cppcommon/all/conandata.yml new file mode 100644 index 0000000000000..c69e434893cba --- /dev/null +++ b/recipes/cppcommon/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "1.0.0.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.0.0.tar.gz" + sha256: "d6124dd4cd430e5f10c2942ff02a95636369875b652e66a499b01f1fb3ecfd6d" + "cci.20201104": + url: "https://github.com/chronoxor/CppCommon/archive/cacfa9554d367467808663d9d5a695933ae566bb.tar.gz" + sha256: "d2e717798e1668c831ee977763eaff7413ef48e6e0914a6322c9918016092048" + "1.0.1.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.1.0.tar.gz" + sha256: "974ac65c72bb57bc6cbe825990e595fd40ead8c1e66e00c1206b19f749697878" + "1.0.2.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.2.0.tar.gz" + sha256: "1a748159ab5d0eb74a6c7b110606718caa779cdf17b3e91bf0dbd0e297823dec" + "1.0.3.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.3.0.tar.gz" + sha256: "af530d3550a050d4ed73a680b016e043ea6f4f56e11163226f2a6e24d9eae4ca" + +patches: + "1.0.0.0": + - patch_file: "patches/0001-update-cmakelists-1-0-0-0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-cross-platform-issues.patch" + base_path: "source_subfolder" + "cci.20201104": + - patch_file: "patches/0001-update-cmakelists-1-0-0-0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-define-win32-winnt-cci-20201104.patch" + base_path: "source_subfolder" + "1.0.1.0": + - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + base_path: "source_subfolder" + "1.0.2.0": + - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + base_path: "source_subfolder" + "1.0.3.0": + - patch_file: "patches/0001-update-cmakelists-1-0-3-0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + base_path: "source_subfolder" diff --git a/recipes/cppcommon/all/conanfile.py b/recipes/cppcommon/all/conanfile.py new file mode 100644 index 0000000000000..aa3040d536ba0 --- /dev/null +++ b/recipes/cppcommon/all/conanfile.py @@ -0,0 +1,99 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import glob + + +class CppCommon(ConanFile): + name = "cppcommon" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chronoxor/CppCommon" + description = "C++ Common Library contains reusable components and patterns" \ + " for error and exceptions handling, filesystem manipulations, math," \ + " string format and encoding, shared memory, threading, time management" \ + " and others." + topics = ("conan", "utils", "library") + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False], "shared": [True, False]} + default_options = {"fPIC": True, "shared": False} + exports_sources = ["patches/**", "CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": 10, + "clang": 6, + "gcc": 7, + "Visual Studio": 16, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler == "Visual Studio" and self.settings.arch == "x86": + raise ConanInvalidConfiguration("Visual Studio x86 builds are not supported.") + + if self.options.shared: + del self.options.fPIC + + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "17") + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("cppcommon requires C++17, which your compiler does not support.") + else: + self.output.warn("cppcommon requires C++17. Your compiler is unknown. Assuming it supports C++17.") + + def requirements(self): + self.requires("fmt/8.0.0") + if self.settings.os == "Linux": + self.requires("libuuid/1.0.3") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob("CppCommon-*")[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["CPPCOMMON_MODULE"] = "OFF" + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy(pattern="*.inl", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy(pattern="*.h", dst=os.path.join("include", "plugins"), src=os.path.join(self._source_subfolder, "plugins")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs.append(os.path.join("include", "plugins")) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread", "rt", "dl", "m"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["userenv", "rpcrt4"] diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch new file mode 100644 index 0000000000000..4429b5fee77ed --- /dev/null +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch @@ -0,0 +1,128 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dcd57785b..2dde9577f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,13 +18,13 @@ if(DOXYGEN_FOUND) + endif() + + # CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++# set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + # Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) ++# include(SetCompilerFeatures) ++# include(SetCompilerWarnings) ++# include(SetPlatformFeatures) ++# include(SystemInformation) + + # External packages + find_package(Threads REQUIRED) +@@ -32,16 +32,15 @@ if(UNIX AND NOT APPLE AND NOT MSYS) + find_package(LibBFD) + find_package(LibDL) + find_package(LibRT) +- find_package(LibUUID) ++ find_package(libuuid) #FIXME: CCI does not generate correctly #3441 + endif() + if(WIN32 OR MSYS) + find_package(DbgHelp) + find_package(RPC) +- find_package(Userenv) + endif() + + # Modules +-add_subdirectory("modules") ++# add_subdirectory("modules") + + # Link libraries + list(APPEND LINKLIBS Threads::Threads) +@@ -49,17 +48,18 @@ if(UNIX AND NOT APPLE AND NOT MSYS) + list(APPEND LINKLIBS ${LIBBFD_LIBRARIES}) + list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) + list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) +- list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) ++ list(APPEND LINKLIBS CONAN_PKG::libuuid) + endif() + if(WIN32 OR MSYS) + list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) + list(APPEND LINKLIBS ${RPC_LIBRARIES}) +- list(APPEND LINKLIBS ${USERENV_LIBRARIES}) ++ list(APPEND LINKLIBS userenv) ++ list(APPEND LINKLIBS rpcrt4) + list(APPEND LINKLIBS ${LIBVLD_LIBRARIES}) + endif() + + # System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") ++# include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") + include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") + + # Library +@@ -68,8 +68,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl") + file(GLOB_RECURSE LIB_SOURCE_FILES "source/*.cpp") + add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") +-target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" PUBLIC ${vld}) +-target_link_libraries(cppcommon ${LINKLIBS} fmt) ++target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") ++target_compile_features(cppcommon PUBLIC cxx_std_17) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) + +@@ -91,7 +92,7 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS_PDB ${PLUGIN_TARGET}) + endforeach() + +- # Examples ++if(FALSE) + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") + file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") +@@ -105,8 +106,8 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) + endforeach() +- +- # Benchmarks ++endif() ++if(FALSE) + file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") + file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") + file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") +@@ -120,8 +121,8 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) + endforeach() +- +- # Tests ++endif() ++if(FALSE) + file(GLOB TESTS_HEADER_FILES "tests/*.h") + file(GLOB TESTS_INLINE_FILES "tests/*.inl") + file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") +@@ -136,15 +137,15 @@ if(NOT CPPCOMMON_MODULE) + # CTest + enable_testing() + add_test(cppcommon-tests cppcommon-tests --durations yes --order lex) +- ++endif() + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch new file mode 100644 index 0000000000000..c7b2d0bf5679b --- /dev/null +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch @@ -0,0 +1,139 @@ +From 85122652b618951f1b8fe91d8804d92a74d971be Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Mon, 7 Jun 2021 10:27:46 +0200 +Subject: [PATCH] update cmakelists + +--- + CMakeLists.txt | 42 +++++++++++++++++++----------------------- + 1 file changed, 19 insertions(+), 23 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aa5447a8..10a0065b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,49 +17,36 @@ if(DOXYGEN_FOUND) + endif() + endif() + +-# CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-# Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) +- + # External packages + find_package(Threads REQUIRED) + if(UNIX AND NOT APPLE AND NOT MSYS) + find_package(LibBFD) + find_package(LibDL) + find_package(LibRT) +- find_package(LibUUID) ++ find_package(libuuid) + endif() + if(WIN32 OR MSYS) + find_package(DbgHelp) + find_package(RPC) +- find_package(Userenv) + endif() + +-# Modules +-add_subdirectory("modules") +- + # Link libraries + list(APPEND LINKLIBS Threads::Threads) + if(UNIX AND NOT APPLE AND NOT MSYS) + list(APPEND LINKLIBS ${LIBBFD_LIBRARIES}) + list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) + list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) +- list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) ++ list(APPEND LINKLIBS CONAN_PKG::libuuid) + endif() + if(WIN32 OR MSYS) + list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) + list(APPEND LINKLIBS ${RPC_LIBRARIES}) +- list(APPEND LINKLIBS ${USERENV_LIBRARIES}) ++ list(APPEND LINKLIBS userenv) ++ list(APPEND LINKLIBS rpcrt4) + list(APPEND LINKLIBS ${LIBVLD_LIBRARIES}) + endif() + + # System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") + include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") + + # Library +@@ -68,8 +55,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") + file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") + add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") +-target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" PUBLIC ${vld}) +-target_link_libraries(cppcommon ${LINKLIBS} fmt) ++target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") ++target_compile_features(cppcommon PUBLIC cxx_std_17) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) + +@@ -92,6 +80,7 @@ if(NOT CPPCOMMON_MODULE) + endforeach() + + # Examples ++ if(FALSE) + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") + file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") +@@ -105,8 +94,10 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) + endforeach() ++ endif() + + # Benchmarks ++ if(FALSE) + file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") + file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") + file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") +@@ -120,8 +111,10 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) + endforeach() ++ endif() + + # Tests ++ if(FALSE) + file(GLOB TESTS_HEADER_FILES "tests/*.h") + file(GLOB TESTS_INLINE_FILES "tests/*.inl") + file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") +@@ -132,19 +125,22 @@ if(NOT CPPCOMMON_MODULE) + target_link_libraries(cppcommon-tests ${LINKLIBS}) + list(APPEND INSTALL_TARGETS cppcommon-tests) + list(APPEND INSTALL_TARGETS_PDB cppcommon-tests) ++ endif() + + # CTest ++ if(FALSE) + enable_testing() + add_test(cppcommon-tests cppcommon-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() +-- +2.31.1.498.g6c1eba8ee3d + diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch new file mode 100644 index 0000000000000..83cb81ebe9a49 --- /dev/null +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch @@ -0,0 +1,133 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aa5447a8..10a0065b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.20) ++cmake_minimum_required(VERSION 3.18.2) + + # Global properties + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -17,49 +17,36 @@ if(DOXYGEN_FOUND) + endif() + endif() + +-# CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-# Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) +- + # External packages + find_package(Threads REQUIRED) + if(UNIX AND NOT APPLE AND NOT MSYS) + find_package(LibBFD) + find_package(LibDL) + find_package(LibRT) +- find_package(LibUUID) ++ find_package(libuuid) + endif() + if(WIN32 OR MSYS) + find_package(DbgHelp) + find_package(RPC) +- find_package(Userenv) + endif() + +-# Modules +-add_subdirectory("modules") +- + # Link libraries + list(APPEND LINKLIBS Threads::Threads) + if(UNIX AND NOT APPLE AND NOT MSYS) + list(APPEND LINKLIBS ${LIBBFD_LIBRARIES}) + list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) + list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) +- list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) ++ list(APPEND LINKLIBS CONAN_PKG::libuuid) + endif() + if(WIN32 OR MSYS) + list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) + list(APPEND LINKLIBS ${RPC_LIBRARIES}) +- list(APPEND LINKLIBS ${USERENV_LIBRARIES}) ++ list(APPEND LINKLIBS userenv) ++ list(APPEND LINKLIBS rpcrt4) + list(APPEND LINKLIBS ${VLD_LIBRARIES}) + endif() + + # System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") + include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") + + # Library +@@ -68,8 +55,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") + file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") + add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") +-target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" PUBLIC ${vld}) +-target_link_libraries(cppcommon ${LINKLIBS} fmt) ++target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") ++target_compile_features(cppcommon PUBLIC cxx_std_17) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) + +@@ -92,6 +80,7 @@ if(NOT CPPCOMMON_MODULE) + endforeach() + + # Examples ++ if(FALSE) + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") + file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") +@@ -105,8 +94,10 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) + endforeach() ++ endif() + + # Benchmarks ++ if(FALSE) + file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") + file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") + file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") +@@ -120,8 +111,10 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) + endforeach() ++ endif() + + # Tests ++ if(FALSE) + file(GLOB TESTS_HEADER_FILES "tests/*.h") + file(GLOB TESTS_INLINE_FILES "tests/*.inl") + file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") +@@ -132,19 +125,22 @@ if(NOT CPPCOMMON_MODULE) + target_link_libraries(cppcommon-tests ${LINKLIBS}) + list(APPEND INSTALL_TARGETS cppcommon-tests) + list(APPEND INSTALL_TARGETS_PDB cppcommon-tests) ++ endif() + + # CTest ++ if(FALSE) + enable_testing() + add_test(cppcommon-tests cppcommon-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() diff --git a/recipes/cppcommon/all/patches/0002-fix-cross-platform-issues.patch b/recipes/cppcommon/all/patches/0002-fix-cross-platform-issues.patch new file mode 100644 index 0000000000000..bc6b11ae5e02c --- /dev/null +++ b/recipes/cppcommon/all/patches/0002-fix-cross-platform-issues.patch @@ -0,0 +1,64 @@ +diff --git a/include/errors/exceptions_handler.h b/include/errors/exceptions_handler.h +index b17e843d2..79ae0fe9b 100644 +--- a/include/errors/exceptions_handler.h ++++ b/include/errors/exceptions_handler.h +@@ -69,7 +69,7 @@ private: + const Impl& impl() const noexcept { return reinterpret_cast(_storage); } + + static const size_t StorageSize = 72; +-#if defined(__APPLE__) ++#if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + static const size_t StorageAlign = 16; + #else + static const size_t StorageAlign = 8; +diff --git a/include/math/math.h b/include/math/math.h +index e40c02330..2178e75f3 100644 +--- a/include/math/math.h ++++ b/include/math/math.h +@@ -55,7 +55,10 @@ public: + \param divider - Divider + \return Calculated value of (operant * multiplier / divider) expression + */ ++#if defined(__GNUC__) && defined(__SIZEOF_INT128__) || defined(_MSC_VER) + static uint64_t MulDiv64(uint64_t operant, uint64_t multiplier, uint64_t divider); ++#endif ++ + }; + + /*! \example math_math.cpp Math example */ +diff --git a/source/errors/exceptions_handler.cpp b/source/errors/exceptions_handler.cpp +index f16c566c1..cf5eeb02e 100644 +--- a/source/errors/exceptions_handler.cpp ++++ b/source/errors/exceptions_handler.cpp +@@ -637,7 +637,7 @@ ExceptionsHandler::ExceptionsHandler() + { + // Check implementation storage parameters + static_assert((sizeof(Impl) <= StorageSize), "ExceptionsHandler::StorageSize must be increased!"); +- static_assert((alignof(Impl) == StorageAlign), "ExceptionsHandler::StorageAlign must be adjusted!"); ++ static_assert((StorageAlign % alignof(Impl) == 0), "ExceptionsHandler::StorageAlign must be adjusted!"); + + // Create the implementation instance + new(&_storage)Impl(); +diff --git a/source/math/math.cpp b/source/math/math.cpp +index 32c9a9dd1..42818b9ef 100644 +--- a/source/math/math.cpp ++++ b/source/math/math.cpp +@@ -14,9 +14,10 @@ + + namespace CppCommon { + ++#if defined(__GNUC__) && defined(__SIZEOF_INT128__) || defined(_MSC_VER) + uint64_t Math::MulDiv64(uint64_t operant, uint64_t multiplier, uint64_t divider) + { +-#if defined(__GNUC__) ++#if defined(__GNUC__) && defined(__SIZEOF_INT128__) + __uint128_t a = operant; + __uint128_t b = multiplier; + __uint128_t c = divider; +@@ -308,5 +309,6 @@ done: + #error MulDiv64 is no supported! + #endif + } ++#endif + + } // namespace CppCommon diff --git a/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch new file mode 100644 index 0000000000000..3b9099c8f0c45 --- /dev/null +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch @@ -0,0 +1,33 @@ +From 80370771e98dc4558811a3846cb567d13ad7d636 Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Mon, 7 Jun 2021 10:40:58 +0200 +Subject: [PATCH] define win32 winnt + +The change present here is handled upstream by this CMake module: + +https://github.com/chronoxor/CppCMakeScripts/blob/1.0.0.0/SetPlatformFeatures.cmake + +Even if it sets _WIN32_WINNT to _WIN32_WINNT_WIN10, here a less strict +definiton is chosen (_WIN32_WINNT_VISTA). +--- + CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 10a0065b..2ed1668c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,6 +61,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) + ++if(WIN32 AND NOT MSVC) ++ target_compile_definitions(cppcommon PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) ++endif() ++ + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPCOMMON_MODULE) + +-- +2.31.1.498.g6c1eba8ee3d + diff --git a/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch new file mode 100644 index 0000000000000..83c8b1f1eb2c9 --- /dev/null +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch @@ -0,0 +1,21 @@ +The change present here is handled upstream by this CMake module: + +https://github.com/chronoxor/CppCMakeScripts/blob/1.0.0.0/SetPlatformFeatures.cmake + +Even if it sets _WIN32_WINNT to _WIN32_WINNT_WIN10, here a less strict definiton is chosen (_WIN32_WINNT_VISTA). + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad3d53aa8..d4dcbf8b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,6 +74,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) + ++if(WIN32 AND NOT MSVC) ++ target_compile_definitions (cppcommon PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) ++endif() ++ + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPCOMMON_MODULE) + diff --git a/recipes/cppcommon/all/test_package/CMakeLists.txt b/recipes/cppcommon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba1e21ea8636c --- /dev/null +++ b/recipes/cppcommon/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +conan_target_link_libraries(${PROJECT_NAME}) + +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/cppcommon/all/test_package/conanfile.py b/recipes/cppcommon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4903f1a7e8fa0 --- /dev/null +++ b/recipes/cppcommon/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/cppcommon/all/test_package/test_package.cpp b/recipes/cppcommon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a31fc8ff7e3f3 --- /dev/null +++ b/recipes/cppcommon/all/test_package/test_package.cpp @@ -0,0 +1,56 @@ +#include "threads/thread.h" +#include "system/uuid.h" +#include "system/environment.h" +#include "time/timespan.h" +#include "system/dll.h" +#include "system/stack_trace.h" +#include "system/stack_trace_manager.h" + +#include "interface/interface.h" + +#include +#include +#include +#include + +void function1() +{ + std::cout << "Thread Id: " << __THREAD__ << std::endl; + std::cout << "Stack trace: " << std::endl << __STACK__ << std::endl; +} + +void function2() +{ + function1(); +} + +void function3() +{ + function2(); +} + +int main() +{ + // Initialize stack trace manager of the current process + CppCommon::StackTraceManager::Initialize(); + + // Show the stack trace from the main thread + function3(); + + // Show the stack trace from the child thread + std::thread(function3).join(); + + // Cleanup stack trace manager of the current process + CppCommon::StackTraceManager::Cleanup(); + + CppCommon::Thread::Yield(); + CppCommon::UUID id; + CppCommon::Timespan span; + + using namespace CppCommon; + + DLL plugin; + std::cout << std::boolalpha << plugin.IsLoaded() << "\n"; + plugin.Load("plugin-function"); + std::cout << plugin.IsLoaded(); +} diff --git a/recipes/cppcommon/config.yml b/recipes/cppcommon/config.yml new file mode 100644 index 0000000000000..17d2cd502269e --- /dev/null +++ b/recipes/cppcommon/config.yml @@ -0,0 +1,11 @@ +versions: + "1.0.0.0": + folder: all + "cci.20201104": + folder: all + "1.0.1.0": + folder: all + "1.0.2.0": + folder: all + "1.0.3.0": + folder: all diff --git a/recipes/cppfront/all/CMakeLists.txt b/recipes/cppfront/all/CMakeLists.txt new file mode 100644 index 0000000000000..91f9698142088 --- /dev/null +++ b/recipes/cppfront/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) +project(cppfront LANGUAGES CXX) + +add_executable(${PROJECT_NAME} ${CPPFRONT_SRC_DIR}/source/cppfront.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(DIRECTORY ${CPPFRONT_SRC_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/cppfront/all/conandata.yml b/recipes/cppfront/all/conandata.yml new file mode 100644 index 0000000000000..3db3937d63c0d --- /dev/null +++ b/recipes/cppfront/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20230103": + url: "https://github.com/hsutter/cppfront/archive/808db2bd6ae92f869166827dfda66cfa42dde0ab.zip" + sha256: "479252c99d66db477c4cd98a6e1707a8929a70afdf000c75589841d944c539f4" + "cci.20221024": + url: "https://github.com/hsutter/cppfront/archive/b1754dbd53a496a9104b43ecde6064c9980246bd.zip" + sha256: "8668bddbd7fc06d4975c867521c005f898eca8f83f018e7c28b54dbcf9aa3ab9" + "cci.20220924": + url: "https://github.com/hsutter/cppfront/archive/98f6dd46957e100f813245241f183c8aedbcb36f.zip" + sha256: "db51c1ac634d45c6047c7eec5c29993ff215443edadf334370f53d09a11cc5b1" diff --git a/recipes/cppfront/all/conanfile.py b/recipes/cppfront/all/conanfile.py new file mode 100644 index 0000000000000..7f4f580a8ec02 --- /dev/null +++ b/recipes/cppfront/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.50.0" + + +class CppfrontConan(ConanFile): + name = "cppfront" + description = "Cppfront is a experimental compiler from a potential C++ 'syntax 2' (Cpp2) to today's 'syntax 1' (Cpp1)" + topics = ("cpp2", "compiler") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hsutter/cppfront" + license = "CC-BY-NC-ND-4.0" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "Visual Studio": "16.9", + "msvc": "192.9", + "clang": "12", + "apple-clang": "13", + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if self.settings.compiler == "clang" and str(self.settings.compiler.version) in ("13", "14"): + raise ConanInvalidConfiguration( + f"{self.ref} currently does not work with Clang {self.settings.compiler.version} on CCI, " + "it enters in an infinite build loop (smells like a compiler bug). Contributions are welcomed!" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CPPFRONT_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.libdirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cppfront/all/test_package/conanfile.py b/recipes/cppfront/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5c77415f9d7dc --- /dev/null +++ b/recipes/cppfront/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +from conan import ConanFile +from conan.tools.files import copy +from conan.tools.layout import basic_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + copy(self, "pure2-hello.cpp2", src=self.recipe_folder, dst=self.build_folder) + self.run("cppfront {}".format(os.path.join(self.build_folder, "pure2-hello.cpp2"))) + + def test(self): + self.run("cppfront -h") + assert os.path.isfile(os.path.join(self.build_folder, "pure2-hello.cpp")) diff --git a/recipes/cppfront/all/test_package/pure2-hello.cpp2 b/recipes/cppfront/all/test_package/pure2-hello.cpp2 new file mode 100644 index 0000000000000..338735841ca79 --- /dev/null +++ b/recipes/cppfront/all/test_package/pure2-hello.cpp2 @@ -0,0 +1,13 @@ +main: () -> int = { + std::cout << "Hello " << name() << "\n"; +} + +name: () -> std::string = { + s: std::string = "world"; + decorate(s); + return s; +} + +decorate: (inout s: std::string) = { + s = "[" + s + "]"; +} \ No newline at end of file diff --git a/recipes/cppfront/all/test_v1_package/conanfile.py b/recipes/cppfront/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..13f05370739e6 --- /dev/null +++ b/recipes/cppfront/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile +import os +import shutil + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def build(self): + shutil.copy2(src=os.path.join(self.source_folder, os.pardir, "test_package", "pure2-hello.cpp2"), + dst=os.path.join(self.build_folder, "pure2-hello.cpp2")) + self.run("cppfront {}".format(os.path.join(self.build_folder, "pure2-hello.cpp2"))) + + def test(self): + self.run("cppfront -h") + assert os.path.isfile(os.path.join(self.build_folder, "pure2-hello.cpp")) diff --git a/recipes/cppfront/config.yml b/recipes/cppfront/config.yml new file mode 100644 index 0000000000000..50c5629b6e025 --- /dev/null +++ b/recipes/cppfront/config.yml @@ -0,0 +1,7 @@ +versions: + "cci.20230103": + folder: all + "cci.20221024": + folder: all + "cci.20220924": + folder: all diff --git a/recipes/cppitertools/all/conandata.yml b/recipes/cppitertools/all/conandata.yml new file mode 100644 index 0000000000000..b8a68ed038695 --- /dev/null +++ b/recipes/cppitertools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1": + url: https://github.com/ryanhaining/cppitertools/archive/v2.1.tar.gz + sha256: f7bcd4531e37083609bb92c3f0ae03b56e7197002d0dc9c695104dcef445f2ab diff --git a/recipes/cppitertools/all/conanfile.py b/recipes/cppitertools/all/conanfile.py new file mode 100644 index 0000000000000..585bcc850ce23 --- /dev/null +++ b/recipes/cppitertools/all/conanfile.py @@ -0,0 +1,65 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.32.0" + + +class CppItertoolsConan(ConanFile): + name = "cppitertools" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ryanhaining/cppitertools" + description = "Implementation of python itertools and builtin iteration functions for C++17" + topics = ("cpp17", "iter", "itertools") + license = "BSD-2-Clause" + no_copy_source = True + + settings = "os", "arch", "compiler", "build_type" + options = {'zip_longest': [True, False]} + default_options = {'zip_longest': False} + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimal_version = { + "Visual Studio": "15", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1" + } + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + if compiler not in minimal_version: + self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + return + + # Exclude compilers not supported by cppitertools + if compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( + self.name, compiler, tools.Version(self.settings.compiler.version.value))) + + def requirements(self): + if self.options.zip_longest: + self.requires('boost/1.75.0') + + def package(self): + self.copy("*.hpp", dst=os.path.join("include", "cppitertools"), src=self._source_subfolder, excludes=('examples/**', 'test/**')) + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "cppitertools" + self.cpp_info.names["cmake_find_package_multi"] = "cppitertools" + + def package_id(self): + self.info.header_only() diff --git a/recipes/cppitertools/all/test_package/CMakeLists.txt b/recipes/cppitertools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..76d1d8411383a --- /dev/null +++ b/recipes/cppitertools/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cppitertools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cppitertools::cppitertools) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + +if(ZIP_LONGEST) + add_executable(test_zip_longest test_zip_longest.cpp) + target_link_libraries(test_zip_longest cppitertools::cppitertools) + set_property(TARGET test_zip_longest PROPERTY CXX_STANDARD 17) +endif() diff --git a/recipes/cppitertools/all/test_package/conanfile.py b/recipes/cppitertools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..92e1d0d57881c --- /dev/null +++ b/recipes/cppitertools/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +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) + if self.options["cppitertools"].zip_longest: + cmake.definitions["ZIP_LONGEST"] = True + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + + if self.options["cppitertools"].zip_longest: + bin_path = os.path.join("bin", "test_zip_longest") + self.run(bin_path, run_environment=True) diff --git a/recipes/cppitertools/all/test_package/test_package.cpp b/recipes/cppitertools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b18a4af82cb6b --- /dev/null +++ b/recipes/cppitertools/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +namespace { + int length(const std::string& s) { + return s.size(); + } +} + + +int main() { + const std::vector vec = {"hi", "ab", "ho", "abc", "def", "abcde", "efghi"}; + std::vector keys; + std::vector> groups; + + for (auto&& gb : iter::groupby(vec, length)) { + keys.push_back(gb.first); + groups.emplace_back(std::begin(gb.second), std::end(gb.second)); + } + + for (auto&& [i, gb] : iter::enumerate(groups)) { + std::cout << "Group " << i << ": "; + for (auto&& [j, e] : iter::enumerate(gb)) { + std::cout << " - " << j << ": " << e << '\n'; + } + } + return 0; +} diff --git a/recipes/cppitertools/all/test_package/test_zip_longest.cpp b/recipes/cppitertools/all/test_package/test_zip_longest.cpp new file mode 100644 index 0000000000000..5d4d2a4293ce3 --- /dev/null +++ b/recipes/cppitertools/all/test_package/test_zip_longest.cpp @@ -0,0 +1,26 @@ +#include +#include +#include + + +int main() { + std::vector v1 = {0, 1, 2, 3}; + std::vector v2 = {10, 11}; + for (auto&& [x, y] : iter::zip_longest(v1, v2)) { + std::cout << '{'; + if (x) { + std::cout << "Just " << *x; + } else { + std::cout << "Nothing"; + } + std::cout << ", "; + if (y) { + std::cout << "Just " << *y; + } else { + std::cout << "Nothing"; + } + std::cout << "}\n"; + } + + return 0; +} diff --git a/recipes/cppitertools/config.yml b/recipes/cppitertools/config.yml new file mode 100644 index 0000000000000..be27564df143f --- /dev/null +++ b/recipes/cppitertools/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1": + folder: "all" diff --git a/recipes/cppkafka/all/conandata.yml b/recipes/cppkafka/all/conandata.yml new file mode 100644 index 0000000000000..741ef5502bb96 --- /dev/null +++ b/recipes/cppkafka/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.4.0": + url: "https://github.com/mfontanini/cppkafka/archive/refs/tags/0.4.0.tar.gz" + sha256: "f4f05eb7a180a856663b02ec0b777283275ef88e5523f3013fd51c6c4ab63b5a" +patches: + "0.4.0": + - patch_file: "patches/0001-no-template-export.patch" + - patch_file: "patches/0002-cppstd.patch" + - patch_file: "patches/0003-clean-rpath.patch" diff --git a/recipes/cppkafka/all/conanfile.py b/recipes/cppkafka/all/conanfile.py new file mode 100644 index 0000000000000..41a226efdbb76 --- /dev/null +++ b/recipes/cppkafka/all/conanfile.py @@ -0,0 +1,101 @@ +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, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class CppKafkaConan(ConanFile): + name = "cppkafka" + description = "Modern C++ Apache Kafka client library (wrapper for librdkafka)" + topics = ("librdkafka", "kafka") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mfontanini/cppkafka" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0") + self.requires("librdkafka/2.0.2") + + 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["CPPKAFKA_BUILD_SHARED"] = self.options.shared + tc.variables["CPPKAFKA_DISABLE_TESTS"] = True + tc.variables["CPPKAFKA_DISABLE_EXAMPLES"] = True + tc.variables["CPPKAFKA_RDKAFKA_STATIC_LIB"] = False # underlying logic is useless + if self.settings.os == "Windows": + tc.preprocessor_definitions["NOMINMAX"] = 1 + 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, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CppKafka") + self.cpp_info.set_property("cmake_target_name", "CppKafka::cppkafka") + self.cpp_info.set_property("pkg_config_name", "cppkafka") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_cppkafka"].libs = ["cppkafka"] + self.cpp_info.components["_cppkafka"].requires = ["boost::headers", "librdkafka::librdkafka"] + if self.settings.os == "Windows": + if not self.options.shared: + self.cpp_info.components["_cppkafka"].system_libs = ["mswsock", "ws2_32"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_cppkafka"].system_libs = ["pthread"] + if not self.options.shared: + self.cpp_info.components["_cppkafka"].defines.append("CPPKAFKA_STATIC") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "CppKafka" + self.cpp_info.names["cmake_find_package_multi"] = "CppKafka" + self.cpp_info.components["_cppkafka"].names["cmake_find_package"] = "cppkafka" + self.cpp_info.components["_cppkafka"].names["cmake_find_package_multi"] = "cppkafka" + self.cpp_info.components["_cppkafka"].set_property("cmake_target_name", "CppKafka::cppkafka") + self.cpp_info.components["_cppkafka"].set_property("pkg_config_name", "cppkafka") diff --git a/recipes/cppkafka/all/patches/0001-no-template-export.patch b/recipes/cppkafka/all/patches/0001-no-template-export.patch new file mode 100644 index 0000000000000..8c84c53443710 --- /dev/null +++ b/recipes/cppkafka/all/patches/0001-no-template-export.patch @@ -0,0 +1,45 @@ +Exporting a template is non-sense (it only makes sense for an explicit instantiation), and msvc will complain. +see https://github.com/mfontanini/cppkafka/issues/206 + +--- a/include/cppkafka/utils/buffered_producer.h ++++ b/include/cppkafka/utils/buffered_producer.h +@@ -84,7 +84,7 @@ namespace cppkafka { + */ + template >> +-class CPPKAFKA_API BufferedProducer { ++class BufferedProducer { + public: + enum class FlushMethod { + Sync, ///< Empty the buffer and wait for acks from the broker. +--- a/include/cppkafka/utils/compacted_topic_processor.h ++++ b/include/cppkafka/utils/compacted_topic_processor.h +@@ -44,7 +44,7 @@ namespace cppkafka { + * \brief Events generated by a CompactedTopicProcessor + */ + template +-class CPPKAFKA_API CompactedTopicEvent { ++class CompactedTopicEvent { + public: + /** + * \brief Event type enum +@@ -111,7 +111,7 @@ private: + }; + + template +-class CPPKAFKA_API CompactedTopicProcessor { ++class CompactedTopicProcessor { + public: + /** + * The type of events generated by this processor +--- a/include/cppkafka/utils/consumer_dispatcher.h ++++ b/include/cppkafka/utils/consumer_dispatcher.h +@@ -70,7 +70,7 @@ namespace cppkafka { + * * EOF: void(BasicConsumerDispatcher::EndOfFile, TopicPartition) + */ + template +-class CPPKAFKA_API BasicConsumerDispatcher { ++class BasicConsumerDispatcher { + public: + /** + * Tag to indicate a timeout occurred diff --git a/recipes/cppkafka/all/patches/0002-cppstd.patch b/recipes/cppkafka/all/patches/0002-cppstd.patch new file mode 100644 index 0000000000000..778cdc867d5ec --- /dev/null +++ b/recipes/cppkafka/all/patches/0002-cppstd.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,7 +28,6 @@ if (NOT CMAKE_CXX_FLAGS) + add_definitions("-DNOGDI=1") + add_definitions("-DNOMINMAX=1") + else() +- set(CMAKE_CXX_FLAGS "-std=c++11 -Wall") + endif() + endif() + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -36,6 +36,7 @@ set(NAMESPACE "${PROJECT_NAME}::") + set(TARGET_EXPORT_NAME ${PROJECT_NAME}Targets) + + add_library(${TARGET_NAME} ${CPPKAFKA_LIBRARY_TYPE} ${SOURCES}) ++target_compile_features(${TARGET_NAME} PUBLIC cxx_std_11) + target_include_directories(${TARGET_NAME} PUBLIC $) + set_target_properties(${TARGET_NAME} PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}" diff --git a/recipes/cppkafka/all/patches/0003-clean-rpath.patch b/recipes/cppkafka/all/patches/0003-clean-rpath.patch new file mode 100644 index 0000000000000..917faa692f549 --- /dev/null +++ b/recipes/cppkafka/all/patches/0003-clean-rpath.patch @@ -0,0 +1,11 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -43,8 +43,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES + ARCHIVE_OUTPUT_NAME "${TARGET_NAME}" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}" + LIBRARY_OUTPUT_NAME "${TARGET_NAME}" +- INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}" +- INSTALL_RPATH_USE_LINK_PATH TRUE + VERSION ${CPPKAFKA_VERSION} + SOVERSION ${CPPKAFKA_VERSION}) + # In CMake >= 3.15 Boost::boost == Boost::headers diff --git a/recipes/cppkafka/all/test_package/CMakeLists.txt b/recipes/cppkafka/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cceda19c2c398 --- /dev/null +++ b/recipes/cppkafka/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(CppKafka REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CppKafka::cppkafka) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppkafka/all/test_package/conanfile.py b/recipes/cppkafka/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cppkafka/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/cppkafka/all/test_package/test_package.cpp b/recipes/cppkafka/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..37e5ad0e461f6 --- /dev/null +++ b/recipes/cppkafka/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include "cppkafka/cppkafka.h" +#include +#include + +using namespace cppkafka; + +int main() { + try { + // Create the config + Configuration kafkaConfig = { + {"metadata.broker.list", "127.0.0.1:9092"}, + {"group.id", "xxx"}, + {"auto.offset.reset", "earliest"}, + {"enable.auto.commit", false} + }; + + // Create the producer + Producer producer(kafkaConfig); + + // Produce a message! + std::string message = "hey there!"; + producer.produce(MessageBuilder("my_topic").partition(0).payload(message)); + producer.flush(); + } catch (std::exception& e) { + std::cout << e.what() << std::endl; + } + + return 0; +} diff --git a/recipes/cppkafka/all/test_v1_package/CMakeLists.txt b/recipes/cppkafka/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cppkafka/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cppkafka/all/test_v1_package/conanfile.py b/recipes/cppkafka/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/cppkafka/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cppkafka/config.yml b/recipes/cppkafka/config.yml new file mode 100644 index 0000000000000..da269653d6e6b --- /dev/null +++ b/recipes/cppkafka/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.0": + folder: "all" diff --git a/recipes/cpprestsdk/all/conandata.yml b/recipes/cpprestsdk/all/conandata.yml new file mode 100644 index 0000000000000..5216074c76f9d --- /dev/null +++ b/recipes/cpprestsdk/all/conandata.yml @@ -0,0 +1,42 @@ +sources: + "2.10.18": + url: "https://github.com/Microsoft/cpprestsdk/archive/2.10.18.tar.gz" + sha256: "6bd74a637ff182144b6a4271227ea8b6b3ea92389f88b25b215e6f94fd4d41cb" + "2.10.17": + url: "https://github.com/Microsoft/cpprestsdk/archive/2.10.17.tar.gz" + sha256: "a2d9dae3ae10cdf7e41caf3dd0fa52f0b9c5012a24ba123901f686cfc484c043" + "2.10.16": + url: "https://github.com/Microsoft/cpprestsdk/archive/v2.10.16.tar.gz" + sha256: "3d75e17c7d79131320438f2a15331f7ca6281c38c0e2daa27f051e290eeb8681" + "2.10.15": + url: "https://github.com/Microsoft/cpprestsdk/archive/v2.10.15.tar.gz" + sha256: "1c027a53457e87b0b3a475e5c8045b94400c475898c8bd51b0fbd218b99a7f7b" +patches: + "2.10.18": + - patch_file: "patches/0003-find-cmake-targets.patch" + patch_type: "conan" + patch_description: "CMake: internal targets" + - patch_file: "patches/0002-remove-wconversion.patch" + patch_type: "conan" + patch_description: "fix warnings" + "2.10.17": + - patch_file: "patches/0003-find-cmake-targets.patch" + patch_type: "conan" + patch_description: "CMake: internal targets" + - patch_file: "patches/0002-remove-wconversion.patch" + patch_type: "conan" + patch_description: "fix warnings" + "2.10.16": + - patch_file: "patches/0003-find-cmake-targets.patch" + patch_type: "conan" + patch_description: "CMake: internal targets" + - patch_file: "patches/0002-remove-wconversion.patch" + patch_type: "conan" + patch_description: "fix warnings" + "2.10.15": + - patch_file: "patches/0001-find-cmake-targets.patch" + patch_type: "conan" + patch_description: "CMake: internal targets" + - patch_file: "patches/0002-remove-wconversion.patch" + patch_type: "conan" + patch_description: "fix warnings" diff --git a/recipes/cpprestsdk/all/conanfile.py b/recipes/cpprestsdk/all/conanfile.py new file mode 100644 index 0000000000000..467c812235f66 --- /dev/null +++ b/recipes/cpprestsdk/all/conanfile.py @@ -0,0 +1,154 @@ +from conan import ConanFile +from conan.tools import files +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + + +class CppRestSDKConan(ConanFile): + name = "cpprestsdk" + description = "A project for cloud-based client-server communication in native code using a modern asynchronous " \ + "C++ API design" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Microsoft/cpprestsdk" + topics = ("cpprestsdk", "rest", "client", "http", "https") + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_websockets": [True, False], + "with_compression": [True, False], + "pplx_impl": ["win", "winpplx"], + "http_client_impl": ["winhttp", "asio"], + "http_listener_impl": ["httpsys", "asio"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_websockets": True, + "with_compression": True, + "pplx_impl": "win", + "http_client_impl": "winhttp", + "http_listener_impl": "httpsys", + } + + def export_sources(self): + files.export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.pplx_impl + del self.options.http_client_impl + del self.options.http_listener_impl + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("boost/1.80.0") + self.requires("openssl/1.1.1s") + if self.options.with_compression: + self.requires("zlib/1.2.13") + if self.options.with_websockets: + self.requires("websocketpp/0.8.2") + + def package_id(self): + self.info.requires["boost"].minor_mode() + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # upstream CMakeLists.txt sets BUILD_SHARED_LIBS as a CACHE variable + # TODO: remove if required_conan_version = ">=1.54.0" + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_SAMPLES"] = False + tc.variables["WERROR"] = False + tc.variables["CPPREST_EXCLUDE_WEBSOCKETS"] = not self.options.with_websockets + tc.variables["CPPREST_EXCLUDE_COMPRESSION"] = not self.options.with_compression + if self.options.get_safe("pplx_impl"): + tc.variables["CPPREST_PPLX_IMPL"] = self.options.pplx_impl + if self.options.get_safe("http_client_impl"): + tc.variables["CPPREST_HTTP_CLIENT_IMPL"] = self.options.http_client_impl + if self.options.get_safe("http_listener_impl"): + tc.variables["CPPREST_HTTP_LISTENER_IMPL"] = self.options.http_listener_impl + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_clang_libcxx(self): + if self.settings.compiler == 'clang' and str(self.settings.compiler.libcxx) in ['libstdc++', 'libstdc++11']: + files.replace_in_file(self, os.path.join(self.source_folder, 'Release', 'CMakeLists.txt'), + 'libc++', 'libstdc++') + + def build(self): + files.apply_conandata_patches(self) + self._patch_clang_libcxx() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + files.copy(self, "license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "cpprestsdk")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpprestsdk") + + # 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"] + # 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 = [] + self.cpp_info.components["cpprestsdk_openssl_internal"].requires = ["openssl::openssl"] + # cpprest + self.cpp_info.components["cpprest"].set_property("cmake_target_name", "cpprestsdk::cpprest") + self.cpp_info.components["cpprest"].libs = files.collect_libs(self) + self.cpp_info.components["cpprest"].requires = ["cpprestsdk_boost_internal", "cpprestsdk_openssl_internal"] + if self.settings.os == "Linux": + self.cpp_info.components["cpprest"].system_libs.append("pthread") + elif self.settings.os == "Windows": + if self.options.get_safe("http_client_impl") == "winhttp": + self.cpp_info.components["cpprest"].system_libs.append("winhttp") + if self.options.get_safe("http_listener_impl") == "httpsys": + self.cpp_info.components["cpprest"].system_libs.append("httpapi") + self.cpp_info.components["cpprest"].system_libs.append("bcrypt") + if self.options.get_safe("pplx_impl") == "winpplx": + self.cpp_info.components["cpprest"].defines.append("CPPREST_FORCE_PPLX=1") + if self.options.get_safe("http_client_impl") == "asio": + self.cpp_info.components["cpprest"].defines.append("CPPREST_FORCE_HTTP_CLIENT_ASIO") + if self.options.get_safe("http_listener_impl") == "asio": + self.cpp_info.components["cpprest"].defines.append("CPPREST_FORCE_HTTP_LISTENER_ASIO") + elif self.settings.os == "Macos": + self.cpp_info.components["cpprest"].frameworks.extend(["CoreFoundation", "Security"]) + if not self.options.shared: + self.cpp_info.components["cpprest"].defines.extend(["_NO_ASYNCRTIMP", "_NO_PPLXIMP"]) + # cpprestsdk_zlib_internal + if self.options.with_compression: + self.cpp_info.components["cpprestsdk_zlib_internal"].set_property("cmake_target_name", "cpprestsdk::cpprestsdk_zlib_internal") + self.cpp_info.components["cpprestsdk_zlib_internal"].includedirs = [] + self.cpp_info.components["cpprestsdk_zlib_internal"].requires = ["zlib::zlib"] + self.cpp_info.components["cpprest"].requires.append("cpprestsdk_zlib_internal") + # cpprestsdk_websocketpp_internal + if self.options.with_websockets: + self.cpp_info.components["cpprestsdk_websocketpp_internal"].set_property("cmake_target_name", "cpprestsdk::cpprestsdk_websocketpp_internal") + self.cpp_info.components["cpprestsdk_websocketpp_internal"].includedirs = [] + self.cpp_info.components["cpprestsdk_websocketpp_internal"].requires = ["websocketpp::websocketpp"] + self.cpp_info.components["cpprest"].requires.append("cpprestsdk_websocketpp_internal") diff --git a/recipes/cpprestsdk/all/patches/0001-find-cmake-targets.patch b/recipes/cpprestsdk/all/patches/0001-find-cmake-targets.patch new file mode 100644 index 0000000000000..6fdbcbfe30dcb --- /dev/null +++ b/recipes/cpprestsdk/all/patches/0001-find-cmake-targets.patch @@ -0,0 +1,117 @@ +diff --git a/Release/cmake/cpprest_find_openssl.cmake b/Release/cmake/cpprest_find_openssl.cmake +index 0b49a7e..ed5c24b 100644 +--- a/Release/cmake/cpprest_find_openssl.cmake ++++ b/Release/cmake/cpprest_find_openssl.cmake +@@ -1,70 +1,7 @@ + function(cpprest_find_openssl) +- if(TARGET cpprestsdk_openssl_internal) +- return() +- endif() +- +- if(IOS) +- set(IOS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../Build_iOS") +- +- set(OPENSSL_INCLUDE_DIR "${IOS_SOURCE_DIR}/openssl/include" CACHE INTERNAL "") +- set(OPENSSL_LIBRARIES +- "${IOS_SOURCE_DIR}/openssl/lib/libcrypto.a" +- "${IOS_SOURCE_DIR}/openssl/lib/libssl.a" +- CACHE INTERNAL "" +- ) +- set(_SSL_LEAK_SUPPRESS_AVAILABLE ON CACHE INTERNAL "") +- elseif(ANDROID) +- if(ARM) +- set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/include" CACHE INTERNAL "") +- set(OPENSSL_LIBRARIES +- "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libssl.a" +- "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libcrypto.a" +- CACHE INTERNAL "" +- ) +- else() +- set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/x86/include" CACHE INTERNAL "") +- set(OPENSSL_LIBRARIES +- "${CMAKE_BINARY_DIR}/../openssl/x86/lib/libssl.a" +- "${CMAKE_BINARY_DIR}/../openssl/x86/lib/libcrypto.a" +- CACHE INTERNAL "" +- ) +- endif() +- set(_SSL_LEAK_SUPPRESS_AVAILABLE ON CACHE INTERNAL "") +- else() +- if(APPLE) +- if(NOT DEFINED OPENSSL_ROOT_DIR) +- # Prefer a homebrew version of OpenSSL over the one in /usr/lib +- file(GLOB OPENSSL_ROOT_DIR /usr/local/Cellar/openssl/*) +- # Prefer the latest (make the latest one first) +- list(REVERSE OPENSSL_ROOT_DIR) +- endif() +- # This should prevent linking against the system provided 0.9.8y +- set(_OPENSSL_VERSION "") +- endif() +- find_package(OpenSSL 1.0.0 REQUIRED) +- +- INCLUDE(CheckCXXSourceCompiles) +- set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") +- set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}") +- CHECK_CXX_SOURCE_COMPILES(" +- #include +- int main() +- { +- ::SSL_COMP_free_compression_methods(); +- } +- " _SSL_LEAK_SUPPRESS_AVAILABLE) +- endif() +- +- add_library(cpprestsdk_openssl_internal INTERFACE) +- if(TARGET OpenSSL::SSL) +- target_link_libraries(cpprestsdk_openssl_internal INTERFACE OpenSSL::SSL) +- else() +- target_link_libraries(cpprestsdk_openssl_internal INTERFACE "$") +- target_include_directories(cpprestsdk_openssl_internal INTERFACE "$") +- endif() +- +- if (NOT _SSL_LEAK_SUPPRESS_AVAILABLE) +- # libressl doesn't ship with the cleanup method being used in ws_client_wspp +- target_compile_definitions(cpprestsdk_openssl_internal INTERFACE -DCPPREST_NO_SSL_LEAK_SUPPRESS) +- endif() ++ if(NOT TARGET cpprestsdk_openssl_internal) ++ add_library(cpprestsdk_openssl_internal INTERFACE) ++ find_package(OpenSSL REQUIRED) ++ target_link_libraries(cpprestsdk_openssl_internal INTERFACE "OpenSSL::SSL") ++ endif() + endfunction() +diff --git a/Release/cmake/cpprest_find_websocketpp.cmake b/Release/cmake/cpprest_find_websocketpp.cmake +index 94ea81a..f83a777 100644 +--- a/Release/cmake/cpprest_find_websocketpp.cmake ++++ b/Release/cmake/cpprest_find_websocketpp.cmake +@@ -1,26 +1,6 @@ + function(cpprest_find_websocketpp) +- if(TARGET cpprestsdk_websocketpp_internal) +- return() +- endif() +- +- find_package(WEBSOCKETPP CONFIG QUIET) +- if(WEBSOCKETPP_FOUND) +- message("-- Found websocketpp version " ${WEBSOCKETPP_VERSION} " on system") +- set(WEBSOCKETPP_INCLUDE_DIR ${WEBSOCKETPP_INCLUDE_DIR} CACHE INTERNAL "") +- elseif(EXISTS ${PROJECT_SOURCE_DIR}/libs/websocketpp/CMakeLists.txt) +- message("-- websocketpp not found, using the embedded version") +- set(WEBSOCKETPP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libs/websocketpp CACHE INTERNAL "") +- else() +- message(FATAL_ERROR "-- websocketpp not found and embedded version not present; try `git submodule update --init` and run CMake again") +- endif() +- +- cpprest_find_boost() +- cpprest_find_openssl() +- +- add_library(cpprestsdk_websocketpp_internal INTERFACE) +- target_include_directories(cpprestsdk_websocketpp_internal INTERFACE "$") +- target_link_libraries(cpprestsdk_websocketpp_internal +- INTERFACE +- cpprestsdk_boost_internal +- cpprestsdk_openssl_internal +- ) ++ if(NOT TARGET cpprestsdk_websocketpp_internal) ++ add_library(cpprestsdk_websocketpp_internal INTERFACE) ++ find_package(websocketpp REQUIRED) ++ target_link_libraries(cpprestsdk_websocketpp_internal INTERFACE "websocketpp::websocketpp") ++ endif() + endfunction() diff --git a/recipes/cpprestsdk/all/patches/0002-remove-wconversion.patch b/recipes/cpprestsdk/all/patches/0002-remove-wconversion.patch new file mode 100644 index 0000000000000..1be476ea0e96a --- /dev/null +++ b/recipes/cpprestsdk/all/patches/0002-remove-wconversion.patch @@ -0,0 +1,28 @@ +diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt +index 18b0cb3..03d16a1 100644 +--- a/Release/CMakeLists.txt ++++ b/Release/CMakeLists.txt +@@ -146,12 +146,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR IOS) + if(ANDROID) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic -Wno-attributes -Wno-pointer-arith") + elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") +- set(WARNINGS -Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls) ++ set(WARNINGS -Wall -Wextra -Wcast-qual -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls) + set(LINUX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs) + set(WARNINGS ${WARNINGS} ${LINUX_SUPPRESSIONS}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") + else() +- set(WARNINGS -Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls) ++ set(WARNINGS -Wall -Wextra -Wcast-qual -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls) + set(OSX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs) + set(WARNINGS ${WARNINGS} ${OSX_SUPPRESSIONS}) + +@@ -165,7 +165,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR IOS) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + message("-- Setting gcc options") + +- set(WARNINGS -Wall -Wextra -Wunused-parameter -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wunreachable-code) ++ set(WARNINGS -Wall -Wextra -Wunused-parameter -Wcast-align -Wcast-qual -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wunreachable-code) + set(LD_FLAGS "${LD_FLAGS} -Wl,-z,defs") + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") diff --git a/recipes/cpprestsdk/all/patches/0003-find-cmake-targets.patch b/recipes/cpprestsdk/all/patches/0003-find-cmake-targets.patch new file mode 100644 index 0000000000000..b3963409c208d --- /dev/null +++ b/recipes/cpprestsdk/all/patches/0003-find-cmake-targets.patch @@ -0,0 +1,127 @@ +diff --git a/Release/cmake/cpprest_find_openssl.cmake b/Release/cmake/cpprest_find_openssl.cmake +index 0b49a7e..ed5c24b 100644 +--- a/Release/cmake/cpprest_find_openssl.cmake ++++ b/Release/cmake/cpprest_find_openssl.cmake +@@ -1,80 +1,7 @@ + function(cpprest_find_openssl) +- if(TARGET cpprestsdk_openssl_internal) +- return() +- endif() +- +- if(IOS) +- set(IOS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../Build_iOS") +- +- set(OPENSSL_INCLUDE_DIR "${IOS_SOURCE_DIR}/openssl/include" CACHE INTERNAL "") +- set(OPENSSL_LIBRARIES +- "${IOS_SOURCE_DIR}/openssl/lib/libcrypto.a" +- "${IOS_SOURCE_DIR}/openssl/lib/libssl.a" +- CACHE INTERNAL "" +- ) +- set(_SSL_LEAK_SUPPRESS_AVAILABLE ON CACHE INTERNAL "") +- elseif(ANDROID) +- if(ARM) +- set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/include" CACHE INTERNAL "") +- set(OPENSSL_LIBRARIES +- "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libssl.a" +- "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libcrypto.a" +- CACHE INTERNAL "" +- ) +- else() +- set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/x86/include" CACHE INTERNAL "") +- set(OPENSSL_LIBRARIES +- "${CMAKE_BINARY_DIR}/../openssl/x86/lib/libssl.a" +- "${CMAKE_BINARY_DIR}/../openssl/x86/lib/libcrypto.a" +- CACHE INTERNAL "" +- ) +- endif() +- set(_SSL_LEAK_SUPPRESS_AVAILABLE ON CACHE INTERNAL "") +- else() +- if(APPLE) +- if(NOT DEFINED OPENSSL_ROOT_DIR) +- # Prefer a homebrew version of OpenSSL over the one in /usr/lib +- file(GLOB OPENSSL_ROOT_DIR /usr/local/Cellar/openssl*/*) +- # Prefer the latest (make the latest one first) +- list(REVERSE OPENSSL_ROOT_DIR) +- list(GET OPENSSL_ROOT_DIR 0 OPENSSL_ROOT_DIR) +- endif() +- # This should prevent linking against the system provided 0.9.8y +- message(STATUS "OPENSSL_ROOT_DIR = ${OPENSSL_ROOT_DIR}") +- set(_OPENSSL_VERSION "") +- endif() +- if(UNIX) +- find_package(PkgConfig) +- pkg_search_module(OPENSSL openssl) +- endif() +- if(OPENSSL_FOUND) +- target_link_libraries(cpprest PRIVATE ${OPENSSL_LDFLAGS}) +- else() +- find_package(OpenSSL 1.0.0 REQUIRED) +- endif() +- +- INCLUDE(CheckCXXSourceCompiles) +- set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") +- set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}") +- CHECK_CXX_SOURCE_COMPILES(" +- #include +- int main() +- { +- ::SSL_COMP_free_compression_methods(); +- } +- " _SSL_LEAK_SUPPRESS_AVAILABLE) +- endif() +- +- add_library(cpprestsdk_openssl_internal INTERFACE) +- if(TARGET OpenSSL::SSL) +- target_link_libraries(cpprestsdk_openssl_internal INTERFACE OpenSSL::SSL) +- else() +- target_link_libraries(cpprestsdk_openssl_internal INTERFACE "$") +- target_include_directories(cpprestsdk_openssl_internal INTERFACE "$") +- endif() +- +- if (NOT _SSL_LEAK_SUPPRESS_AVAILABLE) +- # libressl doesn't ship with the cleanup method being used in ws_client_wspp +- target_compile_definitions(cpprestsdk_openssl_internal INTERFACE -DCPPREST_NO_SSL_LEAK_SUPPRESS) +- endif() ++ if(NOT TARGET cpprestsdk_openssl_internal) ++ add_library(cpprestsdk_openssl_internal INTERFACE) ++ find_package(OpenSSL REQUIRED) ++ target_link_libraries(cpprestsdk_openssl_internal INTERFACE "OpenSSL::SSL") ++ endif() + endfunction() +diff --git a/Release/cmake/cpprest_find_websocketpp.cmake b/Release/cmake/cpprest_find_websocketpp.cmake +index 94ea81a..f83a777 100644 +--- a/Release/cmake/cpprest_find_websocketpp.cmake ++++ b/Release/cmake/cpprest_find_websocketpp.cmake +@@ -1,26 +1,6 @@ + function(cpprest_find_websocketpp) +- if(TARGET cpprestsdk_websocketpp_internal) +- return() +- endif() +- +- find_package(WEBSOCKETPP CONFIG QUIET) +- if(WEBSOCKETPP_FOUND) +- message("-- Found websocketpp version " ${WEBSOCKETPP_VERSION} " on system") +- set(WEBSOCKETPP_INCLUDE_DIR ${WEBSOCKETPP_INCLUDE_DIR} CACHE INTERNAL "") +- elseif(EXISTS ${PROJECT_SOURCE_DIR}/libs/websocketpp/CMakeLists.txt) +- message("-- websocketpp not found, using the embedded version") +- set(WEBSOCKETPP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libs/websocketpp CACHE INTERNAL "") +- else() +- message(FATAL_ERROR "-- websocketpp not found and embedded version not present; try `git submodule update --init` and run CMake again") +- endif() +- +- cpprest_find_boost() +- cpprest_find_openssl() +- +- add_library(cpprestsdk_websocketpp_internal INTERFACE) +- target_include_directories(cpprestsdk_websocketpp_internal INTERFACE "$") +- target_link_libraries(cpprestsdk_websocketpp_internal +- INTERFACE +- cpprestsdk_boost_internal +- cpprestsdk_openssl_internal +- ) ++ if(NOT TARGET cpprestsdk_websocketpp_internal) ++ add_library(cpprestsdk_websocketpp_internal INTERFACE) ++ find_package(websocketpp REQUIRED) ++ target_link_libraries(cpprestsdk_websocketpp_internal INTERFACE "websocketpp::websocketpp") ++ endif() + endfunction() diff --git a/recipes/cpprestsdk/all/test_package/CMakeLists.txt b/recipes/cpprestsdk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b305f36beee8f --- /dev/null +++ b/recipes/cpprestsdk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(cpprestsdk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cpprestsdk::cpprest) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/cpprestsdk/all/test_package/conanfile.py b/recipes/cpprestsdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/cpprestsdk/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpprestsdk/all/test_package/test_package.cpp b/recipes/cpprestsdk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2e37ce5334db9 --- /dev/null +++ b/recipes/cpprestsdk/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + const auto parsed_value = web::json::value::parse(U("-22")); + const auto get_method = web::http::methods::GET; +} diff --git a/recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt b/recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpprestsdk/all/test_v1_package/conanfile.py b/recipes/cpprestsdk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpprestsdk/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/cpprestsdk/config.yml b/recipes/cpprestsdk/config.yml new file mode 100644 index 0000000000000..d4be51c9a70c3 --- /dev/null +++ b/recipes/cpprestsdk/config.yml @@ -0,0 +1,9 @@ +versions: + "2.10.18": + folder: "all" + "2.10.17": + folder: "all" + "2.10.16": + folder: "all" + "2.10.15": + folder: "all" diff --git a/recipes/cppserver/all/conandata.yml b/recipes/cppserver/all/conandata.yml new file mode 100644 index 0000000000000..c101e66da5ee2 --- /dev/null +++ b/recipes/cppserver/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "1.0.2.0": + url: "https://github.com/chronoxor/CppServer/archive/1.0.2.0.tar.gz" + sha256: "512b2ada2ddebcedcfac814e3d0784ccef410506dab5dcf64c56302b40e042d4" + "1.0.1.0": + url: "https://github.com/chronoxor/CppServer/archive/1.0.1.0.tar.gz" + sha256: "eff49607a18821de6b992e6b0d9c3d48fa6726242546a1da08cbc2832f901ffc" + "1.0.0.0": + url: "https://github.com/chronoxor/CppServer/archive/1.0.0.0.tar.gz" + sha256: "dc70fb24231ac4c06e813a0489ff911dd5c48f844b75856b1e753ac8dbd64772" +patches: + "1.0.2.0": + - patch_file: "patches/0001-cmake-clean-up-1-0-2-0.patch" + patch_description: "use cci packages, disable test/example builds" + patch_type: "conan" + - patch_file: "patches/0002-define-win32-winnt-1-0-2-0.patch" + patch_description: "add win32/winnt defines" + patch_type: "portability" + - patch_file: "patches/0003-remove-asio-defines-1-0-0-0.patch" + patch_description: "remove asio defines" + patch_type: "portability" + "1.0.1.0": + - patch_file: "patches/0001-cmake-clean-up-1-0-1-0.patch" + patch_description: "use cci packages, disable test/example builds" + patch_type: "conan" + - patch_file: "patches/0002-define-win32-winnt-1-0-1-0.patch" + patch_description: "add win32/winnt defines" + patch_type: "portability" + - patch_file: "patches/0003-remove-asio-defines-1-0-0-0.patch" + patch_description: "remove asio defines" + patch_type: "portability" + "1.0.0.0": + - patch_file: "patches/0001-cmake-clean-up-1-0-0-0.patch" + patch_description: "use cci packages, disable test/example builds" + patch_type: "conan" + - patch_file: "patches/0002-define-win32-winnt-1-0-0-0.patch" + patch_description: "add win32/winnt defines" + patch_type: "portability" + - patch_file: "patches/0003-remove-asio-defines-1-0-0-0.patch" + patch_description: "remove asio defines" + patch_type: "portability" diff --git a/recipes/cppserver/all/conanfile.py b/recipes/cppserver/all/conanfile.py new file mode 100644 index 0000000000000..785bad0fb6e29 --- /dev/null +++ b/recipes/cppserver/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, collect_libs +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 CppServer(ConanFile): + name = "cppserver" + description = "Ultra fast and low latency asynchronous socket server and" \ + " client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket" \ + " protocols and 10K connections problem solution." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chronoxor/CppServer" + topics = ("network", "socket", "asynchronous", "low-latency") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("asio/1.27.0") + self.requires("openssl/[>=1.1 <4]") + self.requires("cppcommon/1.0.3.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.ref} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires a compiler that supports at least C++17") + + def build_requirements(self): + if Version(self.version) >= "1.0.2.0": + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["CPPSERVER_MODULE"] = False + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.inl", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "crypt32", "mswsock"] diff --git a/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch new file mode 100644 index 0000000000000..757a8d7c15126 --- /dev/null +++ b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch @@ -0,0 +1,143 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a21eed..399a8ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,50 +18,51 @@ if(DOXYGEN_FOUND) + endif() + + # CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++# set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + # Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) ++# include(SetCompilerFeatures) ++# include(SetCompilerWarnings) ++# include(SetPlatformFeatures) ++# include(SystemInformation) + + # External packages +-if(CYGWIN) +- set(OPENSSL_ROOT_DIR "/usr/lib") +- set(OPENSSL_INCLUDE_DIR "/usr/include") +- set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") +- set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") +-elseif(MINGW) +- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") +- set(OPENSSL_USE_STATIC_LIBS TRUE) +-elseif(MSVC) +- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") +- set(OPENSSL_USE_STATIC_LIBS TRUE) +- set(OPENSSL_MSVC_STATIC_RT TRUE) +-endif() ++# if(CYGWIN) ++# set(OPENSSL_ROOT_DIR "/usr/lib") ++# set(OPENSSL_INCLUDE_DIR "/usr/include") ++# set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") ++# set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") ++# elseif(MINGW) ++# set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") ++# set(OPENSSL_USE_STATIC_LIBS TRUE) ++# elseif(MSVC) ++# set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") ++# set(OPENSSL_USE_STATIC_LIBS TRUE) ++# set(OPENSSL_MSVC_STATIC_RT TRUE) ++# endif() + find_package(OpenSSL REQUIRED) +-if(WIN32) ++if(FALSE) + find_package(Crypt) + find_package(WinSock) + endif() + + # Modules +-add_subdirectory("modules") ++# add_subdirectory("modules") + + # Link libraries +-list(APPEND LINKLIBS ${OPENSSL_LIBRARIES}) ++list(APPEND LINKLIBS OpenSSL::SSL) + if(WIN32) +- list(APPEND LINKLIBS ${CRYPT_LIBRARIES}) +- list(APPEND LINKLIBS ${WINSOCK_LIBRARIES}) ++ list(APPEND LINKLIBS crypt32) ++ list(APPEND LINKLIBS mswsock ws2_32) + endif() +-list(APPEND LINKLIBS cppcommon) ++find_package(cppcommon REQUIRED) ++list(APPEND LINKLIBS cppcommon::cppcommon) + + # OpenSSL libraries + message(STATUS "OpenSSL version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}") + + # System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") ++# include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") + + # Library + file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h") +@@ -70,14 +71,16 @@ file(GLOB_RECURSE LIB_SOURCE_FILES "source/*.cpp") + add_library(cppserver ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppserver PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") + target_include_directories(cppserver PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +-target_link_libraries(cppserver ${LINKLIBS} asio) ++find_package(asio REQUIRED) ++target_link_libraries(cppserver ${LINKLIBS} asio::asio) ++target_compile_features(cppserver PUBLIC cxx_std_17) + list(APPEND INSTALL_TARGETS cppserver) + list(APPEND LINKLIBS cppserver) + + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPSERVER_MODULE) + +- # Examples ++if(FALSE) + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") + file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") +@@ -90,8 +93,8 @@ if(NOT CPPSERVER_MODULE) + list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) + endforeach() +- +- # Benchmarks ++endif() ++if(FALSE) + file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") + file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") + file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") +@@ -104,8 +107,8 @@ if(NOT CPPSERVER_MODULE) + list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) + endforeach() +- +- # Tests ++endif() ++if(FALSE) + file(GLOB TESTS_HEADER_FILES "tests/*.h") + file(GLOB TESTS_INLINE_FILES "tests/*.inl") + file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") +@@ -119,15 +122,15 @@ if(NOT CPPSERVER_MODULE) + # CTest + enable_testing() + add_test(cppserver-tests cppserver-tests --durations yes --order lex) +- ++endif() + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() diff --git a/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch new file mode 100644 index 0000000000000..b15e8478995a1 --- /dev/null +++ b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch @@ -0,0 +1,130 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 95e9c9e..8616cb6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,52 +17,21 @@ if(DOXYGEN_FOUND) + endif() + endif() + +-# CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-# Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) +- + # External packages +-if(CYGWIN) +- set(OPENSSL_ROOT_DIR "/usr/lib") +- set(OPENSSL_INCLUDE_DIR "/usr/include") +- set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") +- set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") +-elseif(MINGW) +- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") +- set(OPENSSL_USE_STATIC_LIBS TRUE) +-elseif(MSVC) +- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") +- set(OPENSSL_USE_STATIC_LIBS TRUE) +- set(OPENSSL_MSVC_STATIC_RT TRUE) +-endif() + find_package(OpenSSL REQUIRED) +-if(WIN32) +- find_package(Crypt) +- find_package(WinSock) +-endif() +- +-# Modules +-add_subdirectory("modules") + + # Link libraries +-list(APPEND LINKLIBS ${OPENSSL_LIBRARIES}) ++list(APPEND LINKLIBS OpenSSL::SSL) + if(WIN32) +- list(APPEND LINKLIBS ${CRYPT_LIBRARIES}) +- list(APPEND LINKLIBS ${WINSOCK_LIBRARIES}) ++ list(APPEND LINKLIBS crypt32) ++ list(APPEND LINKLIBS mswsock ws2_32) + endif() +-list(APPEND LINKLIBS cppcommon) ++find_package(cppcommon REQUIRED) ++list(APPEND LINKLIBS cppcommon::cppcommon) + + # OpenSSL libraries + message(STATUS "OpenSSL version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}") + +-# System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") +- + # Library + file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h" "source/*.h") + file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") +@@ -70,7 +39,9 @@ file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") + add_library(cppserver ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppserver PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") + target_include_directories(cppserver PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +-target_link_libraries(cppserver ${LINKLIBS} asio) ++find_package(asio REQUIRED) ++target_link_libraries(cppserver ${LINKLIBS} asio::asio) ++target_compile_features(cppserver PUBLIC cxx_std_17) + list(APPEND INSTALL_TARGETS cppserver) + list(APPEND LINKLIBS cppserver) + +@@ -78,6 +49,7 @@ list(APPEND LINKLIBS cppserver) + if(NOT CPPSERVER_MODULE) + + # Examples ++ if(FALSE) + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") + file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") +@@ -90,8 +62,10 @@ if(NOT CPPSERVER_MODULE) + list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) + endforeach() ++ endif() + + # Benchmarks ++ if(FALSE) + file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") + file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") + file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") +@@ -104,8 +78,10 @@ if(NOT CPPSERVER_MODULE) + list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) + endforeach() ++ endif() + + # Tests ++ if(FALSE) + file(GLOB TESTS_HEADER_FILES "tests/*.h") + file(GLOB TESTS_INLINE_FILES "tests/*.inl") + file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") +@@ -115,19 +91,22 @@ if(NOT CPPSERVER_MODULE) + target_link_libraries(cppserver-tests ${LINKLIBS}) + list(APPEND INSTALL_TARGETS cppserver-tests) + list(APPEND INSTALL_TARGETS_PDB cppserver-tests) ++ endif() + + # CTest ++ if(FALSE) + enable_testing() + add_test(cppserver-tests cppserver-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() diff --git a/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-2-0.patch b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-2-0.patch new file mode 100644 index 0000000000000..c975a8d3ae2a3 --- /dev/null +++ b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-2-0.patch @@ -0,0 +1,133 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 89c0f91..3c842d1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,54 +17,25 @@ if(DOXYGEN_FOUND) + endif() + endif() + +-# CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-# Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) +- + # External packages +-if(APPLE) +- set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@1.1") +-elseif(CYGWIN) +- set(OPENSSL_ROOT_DIR "/usr/lib") +- set(OPENSSL_INCLUDE_DIR "/usr/include") +- set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") +- set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") +-elseif(MINGW) +- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") +- set(OPENSSL_USE_STATIC_LIBS TRUE) +-elseif(MSVC) +- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") +- set(OPENSSL_USE_STATIC_LIBS TRUE) +- set(OPENSSL_MSVC_STATIC_RT TRUE) +-endif() + find_package(OpenSSL REQUIRED) +-if(WIN32) ++if(FALSE) + find_package(Crypt) + find_package(WinSock) + endif() + +-# Modules +-add_subdirectory("modules") +- + # Link libraries +-list(APPEND LINKLIBS ${OPENSSL_LIBRARIES}) ++list(APPEND LINKLIBS OpenSSL::SSL) + if(WIN32) +- list(APPEND LINKLIBS ${CRYPT_LIBRARIES}) +- list(APPEND LINKLIBS ${WINSOCK_LIBRARIES}) ++ list(APPEND LINKLIBS crypt32) ++ list(APPEND LINKLIBS ws2_32) + endif() +-list(APPEND LINKLIBS cppcommon) ++find_package(cppcommon REQUIRED) ++list(APPEND LINKLIBS cppcommon::cppcommon) + + # OpenSSL libraries + message(STATUS "OpenSSL version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}") + +-# System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") +- + # Library + file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h" "source/*.h") + file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") +@@ -72,7 +43,9 @@ file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") + add_library(cppserver ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppserver PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") + target_include_directories(cppserver PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +-target_link_libraries(cppserver ${LINKLIBS} asio) ++find_package(asio REQUIRED) ++target_link_libraries(cppserver ${LINKLIBS} asio::asio) ++target_compile_features(cppserver PUBLIC cxx_std_17) + list(APPEND INSTALL_TARGETS cppserver) + list(APPEND LINKLIBS cppserver) + +@@ -91,6 +64,7 @@ if(NOT CPPSERVER_MODULE) + list(APPEND LINKLIBS proto) + + # Examples ++ if(FALSE) + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") + file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") +@@ -103,8 +77,10 @@ if(NOT CPPSERVER_MODULE) + list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) + endforeach() ++ endif() + + # Benchmarks ++ if(FALSE) + file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") + file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") + file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") +@@ -117,8 +93,10 @@ if(NOT CPPSERVER_MODULE) + list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) + list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) + endforeach() ++ endif() + + # Tests ++ if(FALSE) + file(GLOB TESTS_HEADER_FILES "tests/*.h") + file(GLOB TESTS_INLINE_FILES "tests/*.inl") + file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") +@@ -128,19 +106,22 @@ if(NOT CPPSERVER_MODULE) + target_link_libraries(cppserver-tests ${LINKLIBS}) + list(APPEND INSTALL_TARGETS cppserver-tests) + list(APPEND INSTALL_TARGETS_PDB cppserver-tests) ++ endif() + + # CTest ++ if(FALSE) + enable_testing() + add_test(cppserver-tests cppserver-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() diff --git a/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch new file mode 100644 index 0000000000000..cdbb5c5ddcac9 --- /dev/null +++ b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 399a8ed..d4590f4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,6 +77,10 @@ target_compile_features(cppserver PUBLIC cxx_std_17) + list(APPEND INSTALL_TARGETS cppserver) + list(APPEND LINKLIBS cppserver) + ++if(WIN32 AND NOT MSVC) ++ target_compile_definitions(cppserver PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) ++endif() ++ + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPSERVER_MODULE) + diff --git a/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch new file mode 100644 index 0000000000000..0365fe4134964 --- /dev/null +++ b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8616cb6..7d26a40 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,6 +45,10 @@ target_compile_features(cppserver PUBLIC cxx_std_17) + list(APPEND INSTALL_TARGETS cppserver) + list(APPEND LINKLIBS cppserver) + ++if(WIN32 AND NOT MSVC) ++ target_compile_definitions(cppserver PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) ++endif() ++ + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPSERVER_MODULE) + diff --git a/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-2-0.patch b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-2-0.patch new file mode 100644 index 0000000000000..4166ac1bfa138 --- /dev/null +++ b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-2-0.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3c842d1..0c92512 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,6 +49,10 @@ target_compile_features(cppserver PUBLIC cxx_std_17) + list(APPEND INSTALL_TARGETS cppserver) + list(APPEND LINKLIBS cppserver) + ++if(WIN32 AND NOT MSVC) ++ target_compile_definitions(cppserver PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) ++endif() ++ + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPSERVER_MODULE) + diff --git a/recipes/cppserver/all/patches/0003-remove-asio-defines-1-0-0-0.patch b/recipes/cppserver/all/patches/0003-remove-asio-defines-1-0-0-0.patch new file mode 100644 index 0000000000000..4660f2af9af23 --- /dev/null +++ b/recipes/cppserver/all/patches/0003-remove-asio-defines-1-0-0-0.patch @@ -0,0 +1,13 @@ +diff --git a/include/server/asio/asio.h b/include/server/asio/asio.h +index 8ad4d6bc..b8cb7030 100644 +--- a/include/server/asio/asio.h ++++ b/include/server/asio/asio.h +@@ -26,8 +26,6 @@ + + #else + +-#define ASIO_STANDALONE +-#define ASIO_SEPARATE_COMPILATION + #define ASIO_NO_WIN32_LEAN_AND_MEAN + + #if defined(_MSC_VER) diff --git a/recipes/cppserver/all/test_package/CMakeLists.txt b/recipes/cppserver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a18a7561cd17 --- /dev/null +++ b/recipes/cppserver/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cppserver REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppserver::cppserver) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cppserver/all/test_package/conanfile.py b/recipes/cppserver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/cppserver/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cppserver/all/test_package/test_package.cpp b/recipes/cppserver/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a716657265e40 --- /dev/null +++ b/recipes/cppserver/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include "server/asio/tcp_client.h" +#include "server/asio/tcp_server.h" +#include "threads/thread.h" + +#include + +class ChatSession : public CppServer::Asio::TCPSession +{ +public: + using CppServer::Asio::TCPSession::TCPSession; +}; + +class ChatServer : public CppServer::Asio::TCPServer +{ +public: + using CppServer::Asio::TCPServer::TCPServer; +protected: + std::shared_ptr CreateSession( + const std::shared_ptr& server) override + { + return std::make_shared(server); + } +}; + +int main() +{ + auto service = std::make_shared(); + auto server = std::make_shared(service, 6667); +} diff --git a/recipes/cppserver/all/test_v1_package/CMakeLists.txt b/recipes/cppserver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/cppserver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cppserver/all/test_v1_package/conanfile.py b/recipes/cppserver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/cppserver/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cppserver/config.yml b/recipes/cppserver/config.yml new file mode 100644 index 0000000000000..bb5222f546170 --- /dev/null +++ b/recipes/cppserver/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.2.0": + folder: all + "1.0.1.0": + folder: all + "1.0.0.0": + folder: all diff --git a/recipes/cpptoml/all/conandata.yml b/recipes/cpptoml/all/conandata.yml new file mode 100644 index 0000000000000..08ce9d848e1e3 --- /dev/null +++ b/recipes/cpptoml/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.1": + url: "https://github.com/skystrife/cpptoml/archive/refs/tags/v0.1.1.tar.gz" + sha256: "23af72468cfd4040984d46a0dd2a609538579c78ddc429d6b8fd7a10a6e24403" diff --git a/recipes/cpptoml/all/conanfile.py b/recipes/cpptoml/all/conanfile.py new file mode 100644 index 0000000000000..3085e5c8dce85 --- /dev/null +++ b/recipes/cpptoml/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class CppTomlConan(ConanFile): + name = "cpptoml" + description = "cpptoml is a header-only library for parsing TOML " + topics = ("toml", "header-only", "configuration") + license = "MIT" + homepage = "https://github.com/skystrife/cpptoml" + 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], 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=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"cpptoml": "cpptoml::cpptoml"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpptoml") + self.cpp_info.set_property("cmake_target_name", "cpptoml") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + 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/cpptoml/all/test_package/CMakeLists.txt b/recipes/cpptoml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f67d21d53d2fc --- /dev/null +++ b/recipes/cpptoml/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cpptoml CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpptoml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpptoml/all/test_package/conanfile.py b/recipes/cpptoml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cpptoml/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/cpptoml/all/test_package/test_package.cpp b/recipes/cpptoml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e6f828ff5e6e1 --- /dev/null +++ b/recipes/cpptoml/all/test_package/test_package.cpp @@ -0,0 +1,72 @@ +#include +#include +#include + +int main() +{ + std::cout << "Bincrafters\n"; + + + std::shared_ptr root = cpptoml::make_table(); + root->insert("Integer", 1234L); + root->insert("Double", 1.234); + root->insert("String", std::string("ABCD")); + + auto table = cpptoml::make_table(); + table->insert("ElementOne", 1L); + table->insert("ElementTwo", 2.0); + table->insert("ElementThree", std::string("THREE")); + + auto nested_table = cpptoml::make_table(); + nested_table->insert("ElementOne", 2L); + nested_table->insert("ElementTwo", 3.0); + nested_table->insert("ElementThree", std::string("FOUR")); + + table->insert("Nested", nested_table); + + root->insert("Table", table); + + auto int_array = cpptoml::make_array(); + int_array->push_back(1L); + int_array->push_back(2L); + int_array->push_back(3L); + int_array->push_back(4L); + int_array->push_back(5L); + + root->insert("IntegerArray", int_array); + + auto double_array = cpptoml::make_array(); + double_array->push_back(1.1); + double_array->push_back(2.2); + double_array->push_back(3.3); + double_array->push_back(4.4); + double_array->push_back(5.5); + + root->insert("DoubleArray", double_array); + + auto string_array = cpptoml::make_array(); + string_array->push_back(std::string("A")); + string_array->push_back(std::string("B")); + string_array->push_back(std::string("C")); + string_array->push_back(std::string("D")); + string_array->push_back(std::string("E")); + + root->insert("StringArray", string_array); + + auto table_array = cpptoml::make_table_array(); + table_array->push_back(table); + table_array->push_back(table); + table_array->push_back(table); + + root->insert("TableArray", table_array); + + auto array_of_arrays = cpptoml::make_array(); + array_of_arrays->push_back(int_array); + array_of_arrays->push_back(double_array); + array_of_arrays->push_back(string_array); + + root->insert("ArrayOfArrays", array_of_arrays); + + std::cout << (*root); + return 0; +} diff --git a/recipes/cpptoml/all/test_v1_package/CMakeLists.txt b/recipes/cpptoml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpptoml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpptoml/all/test_v1_package/conanfile.py b/recipes/cpptoml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpptoml/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/cpptoml/config.yml b/recipes/cpptoml/config.yml new file mode 100644 index 0000000000000..b893ff21f7c23 --- /dev/null +++ b/recipes/cpptoml/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/cppunit/all/conandata.yml b/recipes/cppunit/all/conandata.yml new file mode 100644 index 0000000000000..f363489384251 --- /dev/null +++ b/recipes/cppunit/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.15.1": + url: "http://dev-www.libreoffice.org/src/cppunit-1.15.1.tar.gz" + sha256: "89c5c6665337f56fd2db36bc3805a5619709d51fb136e51937072f63fcc717a7" diff --git a/recipes/cppunit/all/conanfile.py b/recipes/cppunit/all/conanfile.py new file mode 100644 index 0000000000000..37927a939aa12 --- /dev/null +++ b/recipes/cppunit/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import stdcpp_library +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class CppunitConan(ConanFile): + name = "cppunit" + description = ( + "CppUnit is the C++ port of the famous JUnit framework for unit testing. " + "Test output is in XML for automatic testing and GUI based for supervised tests." + ) + topics = ("unit-test", "tdd") + license = " LGPL-2.1-or-later" + homepage = "https://freedesktop.org/wiki/Software/cppunit/" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @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") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if self.settings.os == "Windows" and self.options.shared: + tc.extra_defines.append("CPPUNIT_BUILD_DLL") + 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") + if is_apple_os(self): + # https://github.com/conan-io/conan-center-index/pull/15759#issuecomment-1419046535 + tc.extra_ldflags.append("-headerpad_max_install_names") + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), + "--enable-doxygen=no", + "--enable-dot=no", + "--enable-werror=no", + "--enable-html-docs=no", + ]) + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "cppunit.dll.lib"), + os.path.join(self.package_folder, "lib", "cppunit.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", "cppunit") + self.cpp_info.libs = ["cppunit"] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m"]) + if self.options.shared and self.settings.os == "Windows": + self.cpp_info.defines.append("CPPUNIT_DLL") diff --git a/recipes/cppunit/all/test_package/CMakeLists.txt b/recipes/cppunit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e62b0d941a7cc --- /dev/null +++ b/recipes/cppunit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cppunit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppunit::cppunit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppunit/all/test_package/conanfile.py b/recipes/cppunit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cppunit/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/cppunit/all/test_package/test_package.cpp b/recipes/cppunit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..58840d3a0e997 --- /dev/null +++ b/recipes/cppunit/all/test_package/test_package.cpp @@ -0,0 +1,134 @@ +#include "cppunit/BriefTestProgressListener.h" +#include "cppunit/CompilerOutputter.h" +#include "cppunit/extensions/TestFactoryRegistry.h" +#include "cppunit/TestResult.h" +#include "cppunit/TestResultCollector.h" +#include "cppunit/TestRunner.h" + +#include + +int +main() +{ + // Create the event manager and test controller + CPPUNIT_NS::TestResult controller; + + // Add a listener that colllects test result + CPPUNIT_NS::TestResultCollector result; + controller.addListener( &result ); + + // Add a listener that print dots as test run. + CPPUNIT_NS::BriefTestProgressListener progress; + controller.addListener( &progress ); + + // Add the top suite to the test runner + CPPUNIT_NS::TestRunner runner; + runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); + runner.run( controller ); + + // Print test in a compiler compatible format. + CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() ); + outputter.write(); + + std::cout << "was succesful? " << result.wasSuccessful() << "\n"; + return 0; +} + +#ifndef CPP_UNIT_EXAMPLETESTCASE_H +#define CPP_UNIT_EXAMPLETESTCASE_H + +#include + +/* + * A test case that is designed to produce + * example errors and failures + * + */ + +class ExampleTestCase : public CPPUNIT_NS::TestFixture +{ + CPPUNIT_TEST_SUITE( ExampleTestCase ); + CPPUNIT_TEST( example ); + CPPUNIT_TEST( anotherExample ); + CPPUNIT_TEST( testAdd ); + CPPUNIT_TEST( testEquals ); + CPPUNIT_TEST_SUITE_END(); + +protected: + double m_value1; + double m_value2; + +public: + void setUp(); + +protected: + void example(); + void anotherExample(); + void testAdd(); + void testEquals(); +}; + + +#endif + +#include + +CPPUNIT_TEST_SUITE_REGISTRATION( ExampleTestCase ); + +void ExampleTestCase::example() +{ + CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, 1.1, 0.05 ); + CPPUNIT_ASSERT( 1 == 0 ); + CPPUNIT_ASSERT( 1 == 1 ); +} + + +void ExampleTestCase::anotherExample() +{ + CPPUNIT_ASSERT (1 == 2); +} + +void ExampleTestCase::setUp() +{ + m_value1 = 2.0; + m_value2 = 3.0; +} + +void ExampleTestCase::testAdd() +{ + double result = m_value1 + m_value2; + CPPUNIT_ASSERT( result == 6.0 ); +} + + +void ExampleTestCase::testEquals() +{ + long* l1 = new long(12); + long* l2 = new long(12); + + CPPUNIT_ASSERT_EQUAL( 12, 12 ); + CPPUNIT_ASSERT_EQUAL( 12L, 12L ); + CPPUNIT_ASSERT_EQUAL( *l1, *l2 ); + + delete l1; + delete l2; + + CPPUNIT_ASSERT( 12L == 12L ); + CPPUNIT_ASSERT_EQUAL( 12, 13 ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 12.0, 11.99, 0.5 ); +} + +class FixtureTest : public CPPUNIT_NS::TestFixture +{ +}; + +CPPUNIT_TEST_FIXTURE(FixtureTest, testEquals) +{ + CPPUNIT_ASSERT_EQUAL( 12, 12 ); +} + +CPPUNIT_TEST_FIXTURE(FixtureTest, testAdd) +{ + double result = 2.0 + 2.0; + CPPUNIT_ASSERT( result == 4.0 ); +} diff --git a/recipes/cppunit/all/test_v1_package/CMakeLists.txt b/recipes/cppunit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cppunit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cppunit/all/test_v1_package/conanfile.py b/recipes/cppunit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cppunit/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/cppunit/config.yml b/recipes/cppunit/config.yml new file mode 100644 index 0000000000000..c3fb69f23a902 --- /dev/null +++ b/recipes/cppunit/config.yml @@ -0,0 +1,3 @@ +versions: + "1.15.1": + folder: "all" diff --git a/recipes/cpputest/all/conandata.yml b/recipes/cpputest/all/conandata.yml new file mode 100644 index 0000000000000..6511c1a3d0188 --- /dev/null +++ b/recipes/cpputest/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "4.0": + url: "https://github.com/cpputest/cpputest/releases/download/v4.0/cpputest-4.0.tar.gz" + sha256: 21c692105db15299b5529af81a11a7ad80397f92c122bd7bf1e4a4b0e85654f7 +patches: + "4.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "CMake: move cmake_minimum_required() before project()" diff --git a/recipes/cpputest/all/conanfile.py b/recipes/cpputest/all/conanfile.py new file mode 100644 index 0000000000000..ee586cab99d82 --- /dev/null +++ b/recipes/cpputest/all/conanfile.py @@ -0,0 +1,126 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class CppUTestConan(ConanFile): + name = "cpputest" + description = ( + "CppUTest is a C /C++ based unit xUnit test framework for unit testing " + "and for test-driving your code. It is written in C++ but is used in C " + "and C++ projects and frequently used in embedded systems but it works " + "for any C/C++ project." + ) + license = "BSD-3-Clause" + topics = ("testing", "unit-testing") + homepage = "https://cpputest.github.io" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_extensions": [True, False], + "with_leak_detection": [True, False], + } + default_options = { + "fPIC": True, + "with_extensions": True, + "with_leak_detection": True, + } + + 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 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["STD_C"] = True + tc.variables["STD_CPP"] = True + tc.variables["C++11"] = True + tc.variables["MEMORY_LEAK_DETECTION"] = self.options.with_leak_detection + tc.variables["EXTENSIONS"] = self.options.with_extensions + tc.variables["LONGLONG"] = True + tc.variables["COVERAGE"] = False + tc.variables["TESTS"] = 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")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "CppUTest")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "CppUTest": "CppUTest::CppUTest", + "CppUTestExt": "CppUTest::CppUTestExt", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CppUTest") + self.cpp_info.set_property("pkg_config_name", "cpputest") + + self.cpp_info.components["CppUTest"].set_property("cmake_target_name", "CppUTest") + self.cpp_info.components["CppUTest"].libs = ["CppUTest"] + if self.settings.os == "Windows": + self.cpp_info.components["CppUTest"].system_libs.append("winmm") + elif self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["CppUTest"].system_libs.append("pthread") + + if self.options.with_extensions: + self.cpp_info.components["CppUTestExt"].set_property("cmake_target_name", "CppUTestExt") + self.cpp_info.components["CppUTestExt"].libs = ["CppUTestExt"] + self.cpp_info.components["CppUTestExt"].requires = ["CppUTest"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "CppUTest" + self.cpp_info.names["cmake_find_package_multi"] = "CppUTest" + self.cpp_info.names["pkg_config"] = "cpputest" + self.cpp_info.components["CppUTest"].names["cmake_find_package"] = "CppUTest" + self.cpp_info.components["CppUTest"].names["cmake_find_package_multi"] = "CppUTest" + self.cpp_info.components["CppUTest"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["CppUTest"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_extensions: + self.cpp_info.components["CppUTestExt"].names["cmake_find_package"] = "CppUTestExt" + self.cpp_info.components["CppUTestExt"].names["cmake_find_package_multi"] = "CppUTestExt" + self.cpp_info.components["CppUTestExt"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["CppUTestExt"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/cpputest/all/patches/0001-fix-cmake.patch b/recipes/cpputest/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..a40096caf1d6d --- /dev/null +++ b/recipes/cpputest/all/patches/0001-fix-cmake.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,4 @@ ++cmake_minimum_required(VERSION 3.1) + project(CppUTest) + + set(CppUTest_version_major 4) +@@ -5,7 +6,6 @@ set(CppUTest_version_minor 0) + + # 2.6.3 is needed for ctest support + # 3.1 is needed for target_sources +-cmake_minimum_required(VERSION 3.1) + + ############### + # Conan support diff --git a/recipes/cpputest/all/test_package/CMakeLists.txt b/recipes/cpputest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..be713b804677f --- /dev/null +++ b/recipes/cpputest/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(CppUTest REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE CppUTest) + +if(WITH_EXTENSIONS) + add_executable(test_package_with_extensions test_package_with_extensions.cpp) + target_link_libraries(test_package_with_extensions PRIVATE CppUTestExt) +endif() diff --git a/recipes/cpputest/all/test_package/conanfile.py b/recipes/cpputest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f422d1c08f29f --- /dev/null +++ b/recipes/cpputest/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_EXTENSIONS"] = self.dependencies["cpputest"].options.with_extensions + 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") + if self.options["cpputest"].with_extensions: + bin_extensions_path = os.path.join(self.cpp.build.bindirs[0], "test_package_with_extensions") + self.run(bin_extensions_path, env="conanrun") diff --git a/recipes/cpputest/all/test_package/test_package.cpp b/recipes/cpputest/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2675c3b7d443a --- /dev/null +++ b/recipes/cpputest/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +TEST_GROUP(FirstTestGroup) +{ +}; + +TEST(FirstTestGroup, FirstTest) +{ + CHECK_TRUE(true); +} + +int main(int argc, const char** argv) +{ + CommandLineTestRunner runner(argc, argv, TestRegistry::getCurrentRegistry()); + return runner.runAllTestsMain(); +} diff --git a/recipes/cpputest/all/test_package/test_package_with_extensions.cpp b/recipes/cpputest/all/test_package/test_package_with_extensions.cpp new file mode 100644 index 0000000000000..df94dae2d50a1 --- /dev/null +++ b/recipes/cpputest/all/test_package/test_package_with_extensions.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include // Only found if extensions enabled + +TEST_GROUP(FirstTestGroup) +{ +}; + +TEST(FirstTestGroup, FirstTest) +{ + CHECK_TRUE(true); +} + +int main(int argc, const char** argv) +{ + CommandLineTestRunner runner(argc, argv, TestRegistry::getCurrentRegistry()); + return runner.runAllTestsMain(); +} diff --git a/recipes/cpputest/all/test_v1_package/CMakeLists.txt b/recipes/cpputest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpputest/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpputest/all/test_v1_package/conanfile.py b/recipes/cpputest/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cce86300f1595 --- /dev/null +++ b/recipes/cpputest/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_EXTENSIONS"] = self.options["cpputest"].with_extensions + 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.options["cpputest"].with_extensions: + bin_extensions_path = os.path.join("bin", "test_package_with_extensions") + self.run(bin_extensions_path, run_environment=True) diff --git a/recipes/cpputest/config.yml b/recipes/cpputest/config.yml new file mode 100644 index 0000000000000..2e78700e71475 --- /dev/null +++ b/recipes/cpputest/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0": + folder: all diff --git a/recipes/cppzmq/all/conandata.yml b/recipes/cppzmq/all/conandata.yml new file mode 100644 index 0000000000000..263917af47c65 --- /dev/null +++ b/recipes/cppzmq/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "4.9.0": + url: "https://github.com/zeromq/cppzmq/archive/v4.9.0.tar.gz" + sha256: "3fdf5b100206953f674c94d40599bdb3ea255244dcc42fab0d75855ee3645581" + "4.8.1": + url: "https://github.com/zeromq/cppzmq/archive/v4.8.1.tar.gz" + sha256: "7a23639a45f3a0049e11a188e29aaedd10b2f4845f0000cf3e22d6774ebde0af" + "4.7.1": + url: "https://github.com/zeromq/cppzmq/archive/v4.7.1.tar.gz" + sha256: "9853e0437d834cbed5d3c223bf1d755cadee70e7c964c6e42c4c6783dee5d02c" + "4.6.0": + url: "https://github.com/zeromq/cppzmq/archive/v4.6.0.tar.gz" + sha256: "e9203391a0b913576153a2ad22a2dc1479b1ec325beb6c46a3237c669aef5a52" + "4.5.0": + url: "https://github.com/zeromq/cppzmq/archive/v4.5.0.tar.gz" + sha256: "64eb4e58eaf0c77505391c6c9a606cffcb57c6086f3431567a1ef4a25b01fa36" diff --git a/recipes/cppzmq/all/conanfile.py b/recipes/cppzmq/all/conanfile.py new file mode 100644 index 0000000000000..44e3718dd5de3 --- /dev/null +++ b/recipes/cppzmq/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class CppZmqConan(ConanFile): + name = "cppzmq" + description = "C++ binding for 0MQ" + homepage = "https://github.com/zeromq/cppzmq" + license = "MIT" + topics = ("cppzmq", "zmq-cpp", "zmq", "cpp-bind") + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("zeromq/4.3.4", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "zmq*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "cppzmq": "cppzmq::cppzmq", + "cppzmq-static": "cppzmq::cppzmq", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cppzmq") + # cppzmq has 2 weird official CMake imported targets: + # - cppzmq if cppzmq depends on shared zeromq + # - cppzmq-static if cppzmq depends on static zeromq + self.cpp_info.set_property("cmake_target_name", "cppzmq") + self.cpp_info.set_property("cmake_target_aliases", ["cppzmq-static"]) + 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"] = "cppzmq" + self.cpp_info.names["cmake_find_package_multi"] = "cppzmq" + 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/cppzmq/all/test_package/CMakeLists.txt b/recipes/cppzmq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..207bcc2f27a5a --- /dev/null +++ b/recipes/cppzmq/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(cppzmq REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppzmq) diff --git a/recipes/cppzmq/all/test_package/conanfile.py b/recipes/cppzmq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cppzmq/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/cppzmq/all/test_package/test_package.cpp b/recipes/cppzmq/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..60d610003c7ea --- /dev/null +++ b/recipes/cppzmq/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include + +int main () +{ + // Prepare our context and socket + zmq::context_t context (1); + zmq::socket_t socket (context, ZMQ_REQ); + + socket.connect ("tcp://localhost:5555"); + + return 0; +} diff --git a/recipes/cppzmq/all/test_v1_package/CMakeLists.txt b/recipes/cppzmq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/cppzmq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cppzmq/all/test_v1_package/conanfile.py b/recipes/cppzmq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cppzmq/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/cppzmq/config.yml b/recipes/cppzmq/config.yml new file mode 100644 index 0000000000000..a52b8593d6634 --- /dev/null +++ b/recipes/cppzmq/config.yml @@ -0,0 +1,11 @@ +versions: + "4.9.0": + folder: all + "4.8.1": + folder: all + "4.7.1": + folder: all + "4.6.0": + folder: all + "4.5.0": + folder: all diff --git a/recipes/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml new file mode 100644 index 0000000000000..4be23150be0d1 --- /dev/null +++ b/recipes/cpr/all/conandata.yml @@ -0,0 +1,89 @@ +sources: + "1.10.1": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.1.tar.gz" + sha256: "dc22ab9d34e6013e024e2c4a64e665b126573c0f125f0e02e6a7291cb7e04c4b" + "1.10.0": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.0.tar.gz" + sha256: "d669c028bd63a1c8827c32b348ecc85e46747bb33be3b00ce59b77717b91aee8" + "1.9.3": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.9.3.tar.gz" + sha256: "df53e7213d80fdc24583528521f7d3349099f5bb4ed05ab05206091a678cc53c" + "1.9.0": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.9.0.tar.gz" + sha256: "67023cde8979e8371f5ee7d6e586d6d0761af4a3a3a3be6270256353c9bf411f" + "1.8.1": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.8.1.tar.gz" + sha256: "9155ec36fcafe8cf8d61c98cde8dc6bd27c146740002069bf990855eecb2b95f" + "1.7.2": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.7.2.tar.gz" + sha256: "aa38a414fe2ffc49af13a08b6ab34df825fdd2e7a1213d032d835a779e14176f" + "1.6.2": + url: "https://github.com/libcpr/cpr/archive/1.6.2.tar.gz" + sha256: "c45f9c55797380c6ba44060f0c73713fbd7989eeb1147aedb8723aa14f3afaa3" + "1.5.2": + url: "https://github.com/libcpr/cpr/archive/1.5.2.tar.gz" + sha256: "6fc9102dd63b549912d7af1ec95ee41ece1a2fe27f759864306b07f6fcf24fe1" + "1.4.0": + url: "https://github.com/libcpr/cpr/archive/1.4.0.tar.gz" + sha256: "13baffba95445e02291684e31906b04df41d8c6a3020a1a55253047c6756a004" +patches: + "1.10.1": + - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.10.0": + - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.9.3": + - patch_file: "patches/005-1.9.3-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/008-1.9.3-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.9.0": + - patch_file: "patches/005-1.9.0-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/008-1.8.1-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.8.1": + - patch_file: "patches/005-1.8.1-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/007-fix-dll-install.patch" + patch_description: "fix install path for dll" + patch_type: "conan" + - patch_file: "patches/008-1.8.1-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.7.2": + - patch_file: "patches/005-1.7.2-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/007-fix-dll-install.patch" + patch_description: "fix install path for dll" + patch_type: "conan" + - patch_file: "patches/008-1.7.2-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.6.2": + - patch_file: "patches/005-1.6.2-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.5.2": + - patch_file: "patches/005-1.5.2-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.4.0": + - patch_file: "patches/002-1.4.0-create-install.patch" + patch_description: "add install definition" + patch_type: "conan" + - patch_file: "patches/003-1.4.0-curl-use-target.patch" + patch_description: "link curl library as target name" + patch_type: "portability" + - patch_file: "patches/004-1.4.0-curl-global-scope.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py new file mode 100644 index 0000000000000..f9ec63a80be5a --- /dev/null +++ b/recipes/cpr/all/conanfile.py @@ -0,0 +1,266 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building, check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CprConan(ConanFile): + _AUTO_SSL = "auto" + _NO_SSL = "off" + + name = "cpr" + description = "C++ Requests: Curl for People, a spiritual port of Python Requests" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://docs.libcpr.org/" + topics = ("requests", "web", "curl") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": ["openssl", "darwinssl", "winssl", _AUTO_SSL, _NO_SSL], + "signal": [True, False], + "verbose_logging": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": _AUTO_SSL, + "signal": True, + "verbose_logging": False, + } + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.10.0" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "9", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + @property + def _supports_openssl(self): + # https://github.com/libcpr/cpr/commit/b036a3279ba62720d1e43362d32202bf412ea152 + # https://github.com/libcpr/cpr/releases/tag/1.5.0 + return Version(self.version) >= "1.5.0" and not is_apple_os(self) + + @property + def _supports_winssl(self): + # https://github.com/libcpr/cpr/commit/18e1fc5c3fc0ffc07695f1d78897fb69e7474ea9 + # https://github.com/libcpr/cpr/releases/tag/1.5.1 + return Version(self.version) >= "1.5.1" and self.settings.os == "Windows" + + @property + def _supports_darwinssl(self): + # https://github.com/libcpr/cpr/releases/tag/1.6.1 + return Version(self.version) >= "1.6.1" and is_apple_os(self) + + @property + def _can_auto_ssl(self): + # https://github.com/libcpr/cpr/releases/tag/1.6.0 + return not self._uses_old_cmake_options and not ( + # https://github.com/libcpr/cpr/issues/546 + Version(self.version) in ["1.6.0", "1.6.1"] + and is_apple_os(self) + ) + + @property + def _uses_old_cmake_options(self): + # https://github.com/libcpr/cpr/releases/tag/1.6.0 + return Version(self.version) < "1.6.0" + + @property + def _uses_valid_abi_and_compiler(self): + # https://github.com/conan-io/conan-center-index/pull/5194#issuecomment-821908385 + return not ( + Version(self.version) >= "1.6.0" + and self.settings.compiler == "clang" + and self.settings.compiler.libcxx == "libstdc++" + and Version(self.settings.compiler.version) < "9" + ) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + ssl_library = str(self.options.get_safe("with_ssl")) + if not self._can_auto_ssl and ssl_library == CprConan._AUTO_SSL: + if self._supports_openssl: + self.output.info("Auto SSL is not available below version 1.6.0. Falling back to openssl") + self.options.with_ssl = "openssl" + else: + self.output.info("Auto SSL is not available below version 1.6.0 (or below 1.6.2 on macOS), and openssl not supported. Disabling SSL") + self.options.with_ssl = CprConan._NO_SSL + + if Version(self.version) < "1.10.0": + del self.options.verbose_logging + + 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("libcurl/7.87.0", transitive_headers=True, transitive_libs=True) + + # Check if the system supports the given ssl library + def _supports_ssl_library(self, library): + if library == CprConan._NO_SSL: + return True + elif library == CprConan._AUTO_SSL: + return self._can_auto_ssl + + validators = { + "openssl": self._supports_openssl, + "darwinssl": self._supports_darwinssl, + "winssl": self._supports_winssl, + CprConan._AUTO_SSL: self._can_auto_ssl + } + + # A KeyError should never happen, as the options are validated by conan. + return validators[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." + ) + + SSL_FAILURE_MESSAGES = { + "openssl": "OpenSSL is not supported on macOS or on CPR versions < 1.5.0", + "darwinssl": "DarwinSSL is only supported on macOS and on CPR versions >= 1.6.1", + "winssl": "WinSSL is only on Windows and on CPR versions >= 1.5.1", + CprConan._AUTO_SSL: "Automatic SSL selection is only available on CPR versions >= 1.6.0 (and only >= 1.6.2 on macOS)" + } + + 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 not self._supports_ssl_library(ssl_library): + raise ConanInvalidConfiguration( + f"Invalid SSL selection for the given configuration: {SSL_FAILURE_MESSAGES[ssl_library]}" + if ssl_library in SSL_FAILURE_MESSAGES + else f"Invalid value of ssl option, {ssl_library}" + ) + + if ssl_library not in (CprConan._AUTO_SSL, CprConan._NO_SSL, "winssl") and ssl_library != self.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 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") + + if Version(self.version) >= "1.9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 6") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _get_cmake_option(self, option): + CPR_1_6_CMAKE_OPTIONS_TO_OLD = { + "CPR_FORCE_USE_SYSTEM_CURL": "USE_SYSTEM_CURL", + "CPR_BUILD_TESTS": "BUILD_CPR_TESTS", + "CPR_BUILD_TESTS_SSL": "BUILD_CPR_TESTS_SSL", + "CPR_GENERATE_COVERAGE": "GENERATE_COVERAGE", + "CPR_USE_SYSTEM_GTEST": "USE_SYSTEM_GTEST", + "CPR_FORCE_OPENSSL_BACKEND": "USE_OPENSSL", + "CPR_FORCE_WINSSL_BACKEND": "USE_WINSSL", + } + + if self._uses_old_cmake_options: + # Get the translated option if we can, or the original if one isn't defined. + return CPR_1_6_CMAKE_OPTIONS_TO_OLD.get(option, option) + + CPR_1_6_CMAKE_OPTIONS_TO_1_10 = { + "CPR_FORCE_USE_SYSTEM_CURL": "CPR_USE_SYSTEM_CURL" + } + + if Version(self.version) >= "1.10.0": + return CPR_1_6_CMAKE_OPTIONS_TO_1_10.get(option, option) + return option + + def generate(self): + tc = CMakeToolchain(self) + tc.variables[self._get_cmake_option("CPR_FORCE_USE_SYSTEM_CURL")] = True + tc.variables[self._get_cmake_option("CPR_BUILD_TESTS")] = False + tc.variables[self._get_cmake_option("CPR_GENERATE_COVERAGE")] = False + tc.variables[self._get_cmake_option("CPR_USE_SYSTEM_GTEST")] = False + tc.variables["CPR_CURL_NOSIGNAL"] = not self.options.signal + ssl_value = str(self.options.get_safe("with_ssl")) + SSL_OPTIONS = { + "CPR_FORCE_DARWINSSL_BACKEND": ssl_value == "darwinssl", + "CPR_FORCE_OPENSSL_BACKEND": ssl_value == "openssl", + "CPR_FORCE_WINSSL_BACKEND": ssl_value == "winssl", + "CMAKE_USE_OPENSSL": ssl_value == "openssl" + } + for cmake_option, value in SSL_OPTIONS.items(): + tc.variables[self._get_cmake_option(cmake_option)] = value + # If we are on a version where disabling SSL requires a cmake option, disable it + if not self._uses_old_cmake_options and str(self.options.get_safe("with_ssl")) == CprConan._NO_SSL: + tc.variables["CPR_ENABLE_SSL"] = False + + if self.options.get_safe("verbose_logging", False): + tc.variables["CURL_VERBOSE_LOGGING"] = True + if cross_building(self, skip_x64_x86=True): + tc.variables["THREAD_SANITIZER_AVAILABLE_EXITCODE"] = 1 + tc.variables["THREAD_SANITIZER_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 + tc.variables["ADDRESS_SANITIZER_AVAILABLE_EXITCODE"] = 1 + tc.variables["ADDRESS_SANITIZER_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 + tc.variables["ALL_SANITIZERS_AVAILABLE_EXITCODE"] = 1 + tc.variables["ALL_SANITIZERS_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpr") + self.cpp_info.set_property("cmake_target_name", "cpr::cpr") + self.cpp_info.libs = ["cpr"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/cpr/all/patches/002-1.4.0-create-install.patch b/recipes/cpr/all/patches/002-1.4.0-create-install.patch new file mode 100644 index 0000000000000..42f7f34ab13fe --- /dev/null +++ b/recipes/cpr/all/patches/002-1.4.0-create-install.patch @@ -0,0 +1,14 @@ +--- cpr/CMakeLists.txt ++++ cpr/CMakeLists.txt +@@ -46,3 +46,11 @@ + message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.") + target_link_libraries(${CPR_LIBRARIES} + ${CURL_LIBRARIES}) ++ ++include(GNUInstallDirs) ++install(TARGETS cpr ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++) ++install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/cpr" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch b/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch new file mode 100644 index 0000000000000..61ba93886b977 --- /dev/null +++ b/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch @@ -0,0 +1,15 @@ +diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt +diff --git a/a/cpr/CMakeLists.txt b/b/cpr/CMakeLists.txt +index c4f9b5b..7e2279d 100644 +--- a/a/cpr/CMakeLists.txt ++++ b/b/cpr/CMakeLists.txt +@@ -44,8 +44,7 @@ add_library(${CPR_LIBRARIES} + "${CPR_INCLUDE_DIRS}/cpr/unix_socket.h") + + message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.") +-target_link_libraries(${CPR_LIBRARIES} +- ${CURL_LIBRARIES}) ++target_link_libraries(cpr PUBLIC CURL::libcurl) + + include(GNUInstallDirs) + install(TARGETS cpr diff --git a/recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch b/recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch new file mode 100644 index 0000000000000..b4fe11b69536a --- /dev/null +++ b/recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch @@ -0,0 +1,14 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index aa9f35d..86500d9 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -86,7 +86,8 @@ if(BUILD_CPR_TESTS) + enable_testing() + endif() + +-add_subdirectory(opt) ++# add_subdirectory(opt) # With Conan, none of this is used ++find_package(CURL) + add_subdirectory(cpr) + if(BUILD_CPR_TESTS) + add_subdirectory(test) diff --git a/recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch new file mode 100644 index 0000000000000..fda5c28eafd1d --- /dev/null +++ b/recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c065227d..c1c19155 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,15 +55,7 @@ include(cmake/code_coverage.cmake) + + # Curl configuration + if(USE_SYSTEM_CURL) +- find_package(CURL COMPONENTS PROTOCOLS HTTP HTTPS FEATURES SSL) +- if (CURL_FOUND) +- set(SSL_ENABLED ON CACHE INTERNAL "" FORCE) +- else() +- find_package(CURL COMPONENTS PROTOCOLS HTTP) +- if(CURL_FOUND) +- set(SSL_ENABLED OFF CACHE INTERNAL "" FORCE) +- endif() +- endif() ++ find_package(CURL) + endif() + if(NOT USE_SYSTEM_CURL OR NOT CURL_FOUND) + message(STATUS "Not using system Curl, using built-in curl project instead.") diff --git a/recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch new file mode 100644 index 0000000000000..04da489547e84 --- /dev/null +++ b/recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch @@ -0,0 +1,36 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,29 +120,11 @@ endif() + + # Curl configuration + if(CPR_FORCE_USE_SYSTEM_CURL) +- if(CPR_ENABLE_SSL) +- find_package(CURL COMPONENTS HTTP HTTPS SSL) +- if(CURL_FOUND) +- message(STATUS "Curl ${CURL_VERSION_STRING} found on this system.") +- # To be able to load certificates under Windows when using OpenSSL: +- if(CMAKE_USE_OPENSSL AND WIN32 AND (NOT (CURL_VERSION_STRING VERSION_GREATER_EQUAL "7.71.0"))) +- message(FATAL_ERROR "Your system curl version (${CURL_VERSION_STRING}) is too old to support OpenSSL on Windows which requires curl >= 7.71.0. Update your curl version, use WinSSL, disable SSL or use the build in version of curl.") +- endif() +- else() +- find_package(CURL COMPONENTS HTTP) +- if(CURL_FOUND) +- message(FATAL_ERROR "Curl found on this system but WITHOUT HTTPS/SSL support. Either disable SSL by setting CPR_ENABLE_SSL to OFF or use the build in version of curl by setting CPR_FORCE_USE_SYSTEM_CURL to OFF.") +- else() +- message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") +- endif() +- endif() ++ find_package(CURL REQUIRED) ++ if(CURL_FOUND) ++ message(STATUS "Curl found on this system.") + else() +- find_package(CURL COMPONENTS HTTP) +- if(CURL_FOUND) +- message(STATUS "Curl found on this system.") +- else() +- message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") +- endif() ++ message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") + endif() + else() + message(STATUS "Configuring build in curl...") diff --git a/recipes/cpr/all/patches/005-1.7.2-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.7.2-fix-curl-components.patch new file mode 100644 index 0000000000000..c1964e9affa40 --- /dev/null +++ b/recipes/cpr/all/patches/005-1.7.2-fix-curl-components.patch @@ -0,0 +1,19 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -143,6 +143,8 @@ endif() + + # Curl configuration + if(CPR_FORCE_USE_SYSTEM_CURL) ++ find_package(CURL REQUIRED) ++ if(0) + if(CPR_ENABLE_SSL) + find_package(CURL COMPONENTS HTTP HTTPS SSL) + if(CURL_FOUND) +@@ -167,6 +169,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) + message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") + endif() + endif() ++ endif() + else() + message(STATUS "Configuring build in curl...") + diff --git a/recipes/cpr/all/patches/005-1.8.1-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.8.1-fix-curl-components.patch new file mode 100644 index 0000000000000..4cab4c9e85382 --- /dev/null +++ b/recipes/cpr/all/patches/005-1.8.1-fix-curl-components.patch @@ -0,0 +1,55 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 6df3663..9317f97 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -156,6 +156,8 @@ endif() + + # Curl configuration + if(CPR_FORCE_USE_SYSTEM_CURL) ++ find_package(CURL REQUIRED) ++ if(0) + if(CPR_ENABLE_SSL) + find_package(CURL COMPONENTS HTTP HTTPS) + if(CURL_FOUND) +@@ -180,6 +182,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) + message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") + endif() + endif() ++ endif() + else() + message(STATUS "Configuring build in curl...") + +@@ -251,7 +254,7 @@ else() + if(BUILD_CURL_EXE) + set_property(TARGET curl PROPERTY FOLDER "external") + endif() +- ++ + set_property(TARGET libcurl PROPERTY FOLDER "external") + endif() + +@@ -279,13 +282,13 @@ if(CPR_BUILD_TESTS) + FetchContent_MakeAvailable(googletest) + + restore_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP) +- ++ + add_library(gtest_int INTERFACE) + target_link_libraries(gtest_int INTERFACE gtest) + target_include_directories(gtest_int INTERFACE ${googletest_SOURCE_DIR}/include) + + add_library(GTest::GTest ALIAS gtest_int) +- ++ + # Group under the "tests/gtest" project folder in IDEs such as Visual Studio. + set_property(TARGET gtest PROPERTY FOLDER "tests/gtest") + set_property(TARGET gtest_main PROPERTY FOLDER "tests/gtest") +@@ -314,7 +317,7 @@ if(CPR_BUILD_TESTS) + # Disable linting for mongoose + clear_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP) + +- FetchContent_Declare(mongoose ++ FetchContent_Declare(mongoose + URL https://github.com/cesanta/mongoose/archive/6.18.tar.gz + URL_HASH SHA256=f5c10346abc9c72f7cac7885d853ca064fb09aad57580433941a8fd7a3543769 # the hash for 6.18.tar.gz + USES_TERMINAL_DOWNLOAD TRUE) # <---- This is needed only for Ninja to show download progress diff --git a/recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch new file mode 100644 index 0000000000000..f20781e9ef90e --- /dev/null +++ b/recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cb7c5f0..c6c19e4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -162,6 +162,8 @@ endif() + + # Curl configuration + if(CPR_FORCE_USE_SYSTEM_CURL) ++ find_package(CURL REQUIRED) ++ if(0) + if(CPR_ENABLE_SSL) + find_package(CURL COMPONENTS HTTP HTTPS) + if(CURL_FOUND) +@@ -186,6 +188,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) + message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") + endif() + endif() ++ endif() + else() + message(STATUS "Configuring build in curl...") + diff --git a/recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch new file mode 100644 index 0000000000000..dee08272019c7 --- /dev/null +++ b/recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch @@ -0,0 +1,21 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 0c10971..9627982 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -150,6 +150,8 @@ endif() + + # Curl configuration + if(CPR_FORCE_USE_SYSTEM_CURL) ++ find_package(CURL REQUIRED) ++ if(0) + if(CPR_ENABLE_SSL) + find_package(CURL COMPONENTS HTTP HTTPS) + if(CURL_FOUND) +@@ -174,6 +176,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) + message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") + endif() + endif() ++ endif() + else() + message(STATUS "Configuring build in curl...") + diff --git a/recipes/cpr/all/patches/007-fix-dll-install.patch b/recipes/cpr/all/patches/007-fix-dll-install.patch new file mode 100644 index 0000000000000..74a7b3690c9c7 --- /dev/null +++ b/recipes/cpr/all/patches/007-fix-dll-install.patch @@ -0,0 +1,18 @@ +--- a/cpr/CMakeLists.txt ++++ b/cpr/CMakeLists.txt +@@ -36,6 +36,7 @@ include(GNUInstallDirs) + if(CPR_FORCE_USE_SYSTEM_CURL) + install(TARGETS cpr + EXPORT cprTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +@@ -62,6 +63,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) + + else() + install(TARGETS cpr ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() diff --git a/recipes/cpr/all/patches/008-1.10.0-remove-warning-flags.patch b/recipes/cpr/all/patches/008-1.10.0-remove-warning-flags.patch new file mode 100644 index 0000000000000..d4ec5ce51366c --- /dev/null +++ b/recipes/cpr/all/patches/008-1.10.0-remove-warning-flags.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d0e8854..807377f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -103,11 +103,6 @@ if(CPR_ENABLE_CPPCHECK) + include(cmake/cppcheck.cmake) + endif() + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +-else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +-endif() +- + # SSL + if(CPR_ENABLE_SSL) + if(CPR_FORCE_OPENSSL_BACKEND OR CPR_FORCE_WINSSL_BACKEND OR CPR_FORCE_DARWINSSL_BACKEND OR CPR_FORCE_MBEDTLS_BACKEND) diff --git a/recipes/cpr/all/patches/008-1.7.2-remove-warning-flags.patch b/recipes/cpr/all/patches/008-1.7.2-remove-warning-flags.patch new file mode 100644 index 0000000000000..e05c2f4263fde --- /dev/null +++ b/recipes/cpr/all/patches/008-1.7.2-remove-warning-flags.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fef2d28..6dcbf0d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -67,11 +67,6 @@ if(CPR_ENABLE_CPPCHECK) + include(cmake/cppcheck.cmake) + endif() + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +-else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +-endif() +- + # SSL + if(CPR_ENABLE_SSL) + if(CPR_FORCE_OPENSSL_BACKEND OR CPR_FORCE_WINSSL_BACKEND OR CPR_FORCE_DARWINSSL_BACKEND) diff --git a/recipes/cpr/all/patches/008-1.8.1-remove-warning-flags.patch b/recipes/cpr/all/patches/008-1.8.1-remove-warning-flags.patch new file mode 100644 index 0000000000000..a252a4d5c3280 --- /dev/null +++ b/recipes/cpr/all/patches/008-1.8.1-remove-warning-flags.patch @@ -0,0 +1,16 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 9317f97..c17a97f 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -71,11 +71,6 @@ if(CPR_ENABLE_CPPCHECK) + include(cmake/cppcheck.cmake) + endif() + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +-else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +-endif() +- + # SSL + if(CPR_ENABLE_SSL) + if(CPR_FORCE_OPENSSL_BACKEND OR CPR_FORCE_WINSSL_BACKEND OR CPR_FORCE_DARWINSSL_BACKEND OR CPR_FORCE_MBEDTLS_BACKEND) diff --git a/recipes/cpr/all/patches/008-1.9.3-remove-warning-flags.patch b/recipes/cpr/all/patches/008-1.9.3-remove-warning-flags.patch new file mode 100644 index 0000000000000..866d51c58b736 --- /dev/null +++ b/recipes/cpr/all/patches/008-1.9.3-remove-warning-flags.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9627982..481b9a0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,11 +76,6 @@ if(CPR_ENABLE_CPPCHECK) + include(cmake/cppcheck.cmake) + endif() + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +-else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +-endif() +- + # SSL + if(CPR_ENABLE_SSL) + if(CPR_FORCE_OPENSSL_BACKEND OR CPR_FORCE_WINSSL_BACKEND OR CPR_FORCE_DARWINSSL_BACKEND OR CPR_FORCE_MBEDTLS_BACKEND) diff --git a/recipes/cpr/all/test_package/CMakeLists.txt b/recipes/cpr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c55b28c7485b9 --- /dev/null +++ b/recipes/cpr/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(cpr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpr::cpr) +if(cpr_VERSION VERSION_LESS "1.10.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/cpr/all/test_package/conanfile.py b/recipes/cpr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/cpr/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpr/all/test_package/test_package.cpp b/recipes/cpr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6191f92bd8671 --- /dev/null +++ b/recipes/cpr/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +int main(int argc, char** argv) { + auto r = cpr::Get(cpr::Url{"http://jsonplaceholder.typicode.com/todos/1"}, // https available after 1.5.0 (not windows by default) + cpr::Parameters{{"Accept", "application/json"}}); + std::cout << "status code: " << r.status_code << '\n'; // 200 + std::cout << "headers: " << r.header["content-type"] << '\n'; // application/json; charset=utf-8 + std::cout << "text: " << r.text << '\n'; // JSON text string + return 0; +} diff --git a/recipes/cpr/all/test_v1_package/CMakeLists.txt b/recipes/cpr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpr/all/test_v1_package/conanfile.py b/recipes/cpr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpr/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/cpr/config.yml b/recipes/cpr/config.yml new file mode 100644 index 0000000000000..51dcfd080e779 --- /dev/null +++ b/recipes/cpr/config.yml @@ -0,0 +1,19 @@ +versions: + "1.10.1": + folder: all + "1.10.0": + folder: all + "1.9.3": + folder: all + "1.9.0": + folder: all + "1.8.1": + folder: all + "1.7.2": + folder: all + "1.6.2": + folder: all + "1.5.2": + folder: all + "1.4.0": + folder: all diff --git a/recipes/cprocessing/all/conandata.yml b/recipes/cprocessing/all/conandata.yml new file mode 100644 index 0000000000000..2dad81caaa9dc --- /dev/null +++ b/recipes/cprocessing/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.5": + url: "https://github.com/maksmakuta/CProcessing/archive/25d8888b4adde7b6b1f1e1f67226e5d9778db13f.tar.gz" + sha256: "a003f5cc368a995c095c66a12ebf7fc81d3f09eef9a27e485e32520c581fbf21" diff --git a/recipes/cprocessing/all/conanfile.py b/recipes/cprocessing/all/conanfile.py new file mode 100644 index 0000000000000..f1d8d20922d76 --- /dev/null +++ b/recipes/cprocessing/all/conanfile.py @@ -0,0 +1,84 @@ +from conans import ConanFile, tools +from conans.tools import ConanInvalidConfiguration +import os +import re + +required_conan_version = ">=1.43.0" + +class CProcessingConan(ConanFile): + name = "cprocessing" + description = "Processsing programming for C++ " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/maksmakuta/CProcessing" + topics = ("processing", "opengl", "sketch") + settings = "os", "arch", "compiler", "build_type" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "16.2", + "msvc": "19.22", + "clang": "10", + "apple-clang": "11" + } + + def requirements(self): + self.requires("glfw/3.3.7") + self.requires("glm/0.9.9.8") + self.requires("glew/2.2.0") + self.requires("stb/cci.20210910") + self.requires("opengl/system") + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 20) + + 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] + + compiler_version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("{} requires C++20. Your compiler is unknown. Assuming it supports C++20.".format(self.name)) + elif lazy_lt_semver(compiler_version, minimum_version): + raise ConanInvalidConfiguration("{} requires some C++20 features,".format(self.name)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, + destination=self._source_subfolder) + + def build(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "PImage.h"), + "stb/stb_image.h", + "stb_image.h") + + def package(self): + self.copy("*.h", "include", os.path.join(self._source_subfolder, "lib")) + + # Extract the License/s from README.md to a file + tmp = tools.load(os.path.join(self._source_subfolder, "README.md")) + license_contents = re.search("(## Author.*)", tmp, re.DOTALL)[1] + tools.save(os.path.join(self.package_folder, "licenses", "LICENSE.md"), license_contents) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CProcessing") + self.cpp_info.set_property("cmake_target_name", "CProcessing::CProcessing") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "CProcessing" + self.cpp_info.filenames["cmake_find_package_multi"] = "CProcessing" + self.cpp_info.names["cmake_find_package"] = "CProcessing" + self.cpp_info.names["cmake_find_package_multi"] = "CProcessing" diff --git a/recipes/cprocessing/all/test_package/CMakeLists.txt b/recipes/cprocessing/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05121b9bfe414 --- /dev/null +++ b/recipes/cprocessing/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(CProcessing REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CProcessing::CProcessing) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/cprocessing/all/test_package/conanfile.py b/recipes/cprocessing/all/test_package/conanfile.py new file mode 100644 index 0000000000000..51cf79f1d6887 --- /dev/null +++ b/recipes/cprocessing/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + test_file = os.path.join("bin", "test_package") + if self.settings.os == "Windows": + test_file += ".exe" + assert os.path.exists(test_file) diff --git a/recipes/cprocessing/all/test_package/test_package.cpp b/recipes/cprocessing/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..479e221b8ea06 --- /dev/null +++ b/recipes/cprocessing/all/test_package/test_package.cpp @@ -0,0 +1,72 @@ +/** + * Starfield Simulation + * Author: Maks Makuta + * URLs: + * Part 1: https://youtube.com/shorts/Bk5O7-3xIfw + * Part 2: https://youtube.com/shorts/IS6_apBewlI + */ + +#include + +float speed; + +class Star{ + private: + float x,y,z,pz; + public: + Star(){ + this->x = random(-width,width); + this->y = random(-height,height); + this->z = random(width); + this->pz = z; + } + + void update(){ + this->z -= speed; + if(this->z < 1.f){ + this->z = width; + this->x = random(-width,width); + this->y = random(-height,height); + this->pz = z; + } + } + + void show(){ + fill(255); + + float sx = map(this->x / this->z,0,1,0, width); + float sy = map(this->y / this->z,0,1,0,height); + + float r = map(this->z,0,width,16,0); + circle(sx,sy,r); + + float zx = map(this->x / this->pz,0,1,0, width); + float zy = map(this->y / this->pz,0,1,0,height); + + this->pz = z; + + stroke(255); + line(zx,zy,sx,sy); + } + +}; + +std::vector stars; + +void setup(){ + size(640,480); + for(int a = 0;a < 100;a++) + stars.push_back(Star()); +} + +void draw(){ + speed = map(mouseX,0,width,0.f,50.f); + background(0); + translate(width/2,height/2); + + for(int a = 0;a < stars.size();a++){ + stars[a].update(); + stars[a].show(); + } + +} diff --git a/recipes/cprocessing/config.yml b/recipes/cprocessing/config.yml new file mode 100644 index 0000000000000..9e9d42f66ffae --- /dev/null +++ b/recipes/cprocessing/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.5": + folder: all diff --git a/recipes/cpu_features/all/conandata.yml b/recipes/cpu_features/all/conandata.yml new file mode 100644 index 0000000000000..8e0a68b98fb04 --- /dev/null +++ b/recipes/cpu_features/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "0.8.0": + url: "https://github.com/google/cpu_features/archive/refs/tags/v0.8.0.tar.gz" + sha256: "7021729f2db97aa34f218d12727314f23e8b11eaa2d5a907e8426bcb41d7eaac" + "0.7.0": + url: "https://github.com/google/cpu_features/archive/refs/tags/v0.7.0.tar.gz" + sha256: "df80d9439abf741c7d2fdcdfd2d26528b136e6c52976be8bd0cd5e45a27262c0" + "0.6.0": + url: "https://github.com/google/cpu_features/archive/refs/tags/v0.6.0.tar.gz" + sha256: "95a1cf6f24948031df114798a97eea2a71143bd38a4d07d9a758dda3924c1932" +patches: + "0.8.0": + - patch_file: "patches/0.8.0-0001-support-aarch64-macos.patch" + patch_description: "support M1 MacOSX" + patch_type: "portability" + patch_source: "https://github.com/google/cpu_features/pull/204" + "0.7.0": + - patch_file: "patches/0.7.0-0001-support-aarch64-macos.patch" + patch_description: "support M1 MacOSX" + patch_type: "portability" + patch_source: "https://github.com/google/cpu_features/pull/204" + "0.6.0": + - patch_file: "patches/0.6.0-0001-fix-bundle-install.patch" + patch_description: "add bundle destination to install" + patch_type: "conan" diff --git a/recipes/cpu_features/all/conanfile.py b/recipes/cpu_features/all/conanfile.py new file mode 100644 index 0000000000000..704de6e4661e1 --- /dev/null +++ b/recipes/cpu_features/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CpuFeaturesConan(ConanFile): + name = "cpu_features" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/cpu_features" + description = "A cross platform C99 library to get cpu features at runtime." + topics = ("cpu", "features", "cpuid") + 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.compiler.rm_safe("cppstd") + self.settings.compiler.rm_safe("libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "0.7.0": + tc.variables["BUILD_PIC"] = self.options.get_safe("fPIC", True) + if Version(self.version) >= "0.7.0": + tc.variables["BUILD_TESTING"] = False + # TODO: should be handled by CMake helper + if is_apple_os(self) and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = "aarch64" + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CpuFeatures") + self.cpp_info.set_property("cmake_target_name", "CpuFeatures::cpu_features") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["libcpu_features"].libs = ["cpu_features"] + self.cpp_info.components["libcpu_features"].includedirs = [os.path.join("include", "cpu_features")] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libcpu_features"].system_libs = ["dl"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "CpuFeatures" + self.cpp_info.names["cmake_find_package_multi"] = "CpuFeatures" + self.cpp_info.components["libcpu_features"].names["cmake_find_package"] = "cpu_features" + self.cpp_info.components["libcpu_features"].names["cmake_find_package_multi"] = "cpu_features" + self.cpp_info.components["libcpu_features"].set_property("cmake_target_name", "CpuFeatures::cpu_features") + + 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/cpu_features/all/patches/0.6.0-0001-fix-bundle-install.patch b/recipes/cpu_features/all/patches/0.6.0-0001-fix-bundle-install.patch new file mode 100644 index 0000000000000..59baf15e395dd --- /dev/null +++ b/recipes/cpu_features/all/patches/0.6.0-0001-fix-bundle-install.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -233,6 +233,7 @@ install(TARGETS cpu_features list_cpu_features + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + install(EXPORT CpuFeaturesTargets + NAMESPACE CpuFeatures:: diff --git a/recipes/cpu_features/all/patches/0.7.0-0001-support-aarch64-macos.patch b/recipes/cpu_features/all/patches/0.7.0-0001-support-aarch64-macos.patch new file mode 100644 index 0000000000000..a498640a584fc --- /dev/null +++ b/recipes/cpu_features/all/patches/0.7.0-0001-support-aarch64-macos.patch @@ -0,0 +1,288 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 81451d4..99f2512 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -135,7 +135,7 @@ target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS}) + target_include_directories(cpu_features + PUBLIC $ + ) +-if(PROCESSOR_IS_X86) ++if(PROCESSOR_IS_X86 OR PROCESSOR_IS_AARCH64) + if(APPLE) + target_compile_definitions(cpu_features PRIVATE HAVE_SYSCTLBYNAME) + endif() +diff --git a/include/cpu_features_macros.h b/include/cpu_features_macros.h +index 6a2f76a..5faae4d 100644 +--- a/include/cpu_features_macros.h ++++ b/include/cpu_features_macros.h +@@ -39,7 +39,7 @@ + #define CPU_FEATURES_ARCH_ARM + #endif + +-#if defined(__aarch64__) ++#if defined(__aarch64__) || defined(__arm64__) + #define CPU_FEATURES_ARCH_AARCH64 + #endif + +diff --git b/include/impl_aarch64__base_implementation.inl b/include/impl_aarch64__base_implementation.inl +new file mode 100644 +index 0000000..a8918e6 +--- /dev/null ++++ b/include/impl_aarch64__base_implementation.inl +@@ -0,0 +1,84 @@ ++// Copyright 2021 Google LLC ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++#include ++ ++#include "cpuinfo_aarch64.h" ++#include "internal/bit_utils.h" ++#include "internal/filesystem.h" ++#include "internal/stack_line_reader.h" ++#include "internal/string_view.h" ++ ++#if !defined(CPU_FEATURES_ARCH_AARCH64) ++#error "Cannot compile aarch64_base on a non aarch64 platform." ++#endif ++ ++//////////////////////////////////////////////////////////////////////////////// ++// Definitions for introspection. ++//////////////////////////////////////////////////////////////////////////////// ++#define INTROSPECTION_TABLE \ ++ LINE(AARCH64_FP, fp, "fp", AARCH64_HWCAP_FP, 0) \ ++ LINE(AARCH64_ASIMD, asimd, "asimd", AARCH64_HWCAP_ASIMD, 0) \ ++ LINE(AARCH64_EVTSTRM, evtstrm, "evtstrm", AARCH64_HWCAP_EVTSTRM, 0) \ ++ LINE(AARCH64_AES, aes, "aes", AARCH64_HWCAP_AES, 0) \ ++ LINE(AARCH64_PMULL, pmull, "pmull", AARCH64_HWCAP_PMULL, 0) \ ++ LINE(AARCH64_SHA1, sha1, "sha1", AARCH64_HWCAP_SHA1, 0) \ ++ LINE(AARCH64_SHA2, sha2, "sha2", AARCH64_HWCAP_SHA2, 0) \ ++ LINE(AARCH64_CRC32, crc32, "crc32", AARCH64_HWCAP_CRC32, 0) \ ++ LINE(AARCH64_ATOMICS, atomics, "atomics", AARCH64_HWCAP_ATOMICS, 0) \ ++ LINE(AARCH64_FPHP, fphp, "fphp", AARCH64_HWCAP_FPHP, 0) \ ++ LINE(AARCH64_ASIMDHP, asimdhp, "asimdhp", AARCH64_HWCAP_ASIMDHP, 0) \ ++ LINE(AARCH64_CPUID, cpuid, "cpuid", AARCH64_HWCAP_CPUID, 0) \ ++ LINE(AARCH64_ASIMDRDM, asimdrdm, "asimdrdm", AARCH64_HWCAP_ASIMDRDM, 0) \ ++ LINE(AARCH64_JSCVT, jscvt, "jscvt", AARCH64_HWCAP_JSCVT, 0) \ ++ LINE(AARCH64_FCMA, fcma, "fcma", AARCH64_HWCAP_FCMA, 0) \ ++ LINE(AARCH64_LRCPC, lrcpc, "lrcpc", AARCH64_HWCAP_LRCPC, 0) \ ++ LINE(AARCH64_DCPOP, dcpop, "dcpop", AARCH64_HWCAP_DCPOP, 0) \ ++ LINE(AARCH64_SHA3, sha3, "sha3", AARCH64_HWCAP_SHA3, 0) \ ++ LINE(AARCH64_SM3, sm3, "sm3", AARCH64_HWCAP_SM3, 0) \ ++ LINE(AARCH64_SM4, sm4, "sm4", AARCH64_HWCAP_SM4, 0) \ ++ LINE(AARCH64_ASIMDDP, asimddp, "asimddp", AARCH64_HWCAP_ASIMDDP, 0) \ ++ LINE(AARCH64_SHA512, sha512, "sha512", AARCH64_HWCAP_SHA512, 0) \ ++ LINE(AARCH64_SVE, sve, "sve", AARCH64_HWCAP_SVE, 0) \ ++ LINE(AARCH64_ASIMDFHM, asimdfhm, "asimdfhm", AARCH64_HWCAP_ASIMDFHM, 0) \ ++ LINE(AARCH64_DIT, dit, "dit", AARCH64_HWCAP_DIT, 0) \ ++ LINE(AARCH64_USCAT, uscat, "uscat", AARCH64_HWCAP_USCAT, 0) \ ++ LINE(AARCH64_ILRCPC, ilrcpc, "ilrcpc", AARCH64_HWCAP_ILRCPC, 0) \ ++ LINE(AARCH64_FLAGM, flagm, "flagm", AARCH64_HWCAP_FLAGM, 0) \ ++ LINE(AARCH64_SSBS, ssbs, "ssbs", AARCH64_HWCAP_SSBS, 0) \ ++ LINE(AARCH64_SB, sb, "sb", AARCH64_HWCAP_SB, 0) \ ++ LINE(AARCH64_PACA, paca, "paca", AARCH64_HWCAP_PACA, 0) \ ++ LINE(AARCH64_PACG, pacg, "pacg", AARCH64_HWCAP_PACG, 0) \ ++ LINE(AARCH64_DCPODP, dcpodp, "dcpodp", 0, AARCH64_HWCAP2_DCPODP) \ ++ LINE(AARCH64_SVE2, sve2, "sve2", 0, AARCH64_HWCAP2_SVE2) \ ++ LINE(AARCH64_SVEAES, sveaes, "sveaes", 0, AARCH64_HWCAP2_SVEAES) \ ++ LINE(AARCH64_SVEPMULL, svepmull, "svepmull", 0, AARCH64_HWCAP2_SVEPMULL) \ ++ LINE(AARCH64_SVEBITPERM, svebitperm, "svebitperm", 0, \ ++ AARCH64_HWCAP2_SVEBITPERM) \ ++ LINE(AARCH64_SVESHA3, svesha3, "svesha3", 0, AARCH64_HWCAP2_SVESHA3) \ ++ LINE(AARCH64_SVESM4, svesm4, "svesm4", 0, AARCH64_HWCAP2_SVESM4) \ ++ LINE(AARCH64_FLAGM2, flagm2, "flagm2", 0, AARCH64_HWCAP2_FLAGM2) \ ++ LINE(AARCH64_FRINT, frint, "frint", 0, AARCH64_HWCAP2_FRINT) \ ++ LINE(AARCH64_SVEI8MM, svei8mm, "svei8mm", 0, AARCH64_HWCAP2_SVEI8MM) \ ++ LINE(AARCH64_SVEF32MM, svef32mm, "svef32mm", 0, AARCH64_HWCAP2_SVEF32MM) \ ++ LINE(AARCH64_SVEF64MM, svef64mm, "svef64mm", 0, AARCH64_HWCAP2_SVEF64MM) \ ++ LINE(AARCH64_SVEBF16, svebf16, "svebf16", 0, AARCH64_HWCAP2_SVEBF16) \ ++ LINE(AARCH64_I8MM, i8mm, "i8mm", 0, AARCH64_HWCAP2_I8MM) \ ++ LINE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \ ++ LINE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \ ++ LINE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \ ++ LINE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \ ++ LINE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE) ++#define INTROSPECTION_PREFIX Aarch64 ++#define INTROSPECTION_ENUM_PREFIX AARCH64 +diff --git a/src/impl_aarch64_linux_or_android.c b/src/impl_aarch64_linux_or_android.c +index 745beb9..c0a764c 100644 +--- a/src/impl_aarch64_linux_or_android.c ++++ b/src/impl_aarch64_linux_or_android.c +@@ -17,78 +17,7 @@ + #ifdef CPU_FEATURES_ARCH_AARCH64 + #if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) + +-#include "cpuinfo_aarch64.h" +- +-//////////////////////////////////////////////////////////////////////////////// +-// Definitions for introspection. +-//////////////////////////////////////////////////////////////////////////////// +-#define INTROSPECTION_TABLE \ +- LINE(AARCH64_FP, fp, "fp", AARCH64_HWCAP_FP, 0) \ +- LINE(AARCH64_ASIMD, asimd, "asimd", AARCH64_HWCAP_ASIMD, 0) \ +- LINE(AARCH64_EVTSTRM, evtstrm, "evtstrm", AARCH64_HWCAP_EVTSTRM, 0) \ +- LINE(AARCH64_AES, aes, "aes", AARCH64_HWCAP_AES, 0) \ +- LINE(AARCH64_PMULL, pmull, "pmull", AARCH64_HWCAP_PMULL, 0) \ +- LINE(AARCH64_SHA1, sha1, "sha1", AARCH64_HWCAP_SHA1, 0) \ +- LINE(AARCH64_SHA2, sha2, "sha2", AARCH64_HWCAP_SHA2, 0) \ +- LINE(AARCH64_CRC32, crc32, "crc32", AARCH64_HWCAP_CRC32, 0) \ +- LINE(AARCH64_ATOMICS, atomics, "atomics", AARCH64_HWCAP_ATOMICS, 0) \ +- LINE(AARCH64_FPHP, fphp, "fphp", AARCH64_HWCAP_FPHP, 0) \ +- LINE(AARCH64_ASIMDHP, asimdhp, "asimdhp", AARCH64_HWCAP_ASIMDHP, 0) \ +- LINE(AARCH64_CPUID, cpuid, "cpuid", AARCH64_HWCAP_CPUID, 0) \ +- LINE(AARCH64_ASIMDRDM, asimdrdm, "asimdrdm", AARCH64_HWCAP_ASIMDRDM, 0) \ +- LINE(AARCH64_JSCVT, jscvt, "jscvt", AARCH64_HWCAP_JSCVT, 0) \ +- LINE(AARCH64_FCMA, fcma, "fcma", AARCH64_HWCAP_FCMA, 0) \ +- LINE(AARCH64_LRCPC, lrcpc, "lrcpc", AARCH64_HWCAP_LRCPC, 0) \ +- LINE(AARCH64_DCPOP, dcpop, "dcpop", AARCH64_HWCAP_DCPOP, 0) \ +- LINE(AARCH64_SHA3, sha3, "sha3", AARCH64_HWCAP_SHA3, 0) \ +- LINE(AARCH64_SM3, sm3, "sm3", AARCH64_HWCAP_SM3, 0) \ +- LINE(AARCH64_SM4, sm4, "sm4", AARCH64_HWCAP_SM4, 0) \ +- LINE(AARCH64_ASIMDDP, asimddp, "asimddp", AARCH64_HWCAP_ASIMDDP, 0) \ +- LINE(AARCH64_SHA512, sha512, "sha512", AARCH64_HWCAP_SHA512, 0) \ +- LINE(AARCH64_SVE, sve, "sve", AARCH64_HWCAP_SVE, 0) \ +- LINE(AARCH64_ASIMDFHM, asimdfhm, "asimdfhm", AARCH64_HWCAP_ASIMDFHM, 0) \ +- LINE(AARCH64_DIT, dit, "dit", AARCH64_HWCAP_DIT, 0) \ +- LINE(AARCH64_USCAT, uscat, "uscat", AARCH64_HWCAP_USCAT, 0) \ +- LINE(AARCH64_ILRCPC, ilrcpc, "ilrcpc", AARCH64_HWCAP_ILRCPC, 0) \ +- LINE(AARCH64_FLAGM, flagm, "flagm", AARCH64_HWCAP_FLAGM, 0) \ +- LINE(AARCH64_SSBS, ssbs, "ssbs", AARCH64_HWCAP_SSBS, 0) \ +- LINE(AARCH64_SB, sb, "sb", AARCH64_HWCAP_SB, 0) \ +- LINE(AARCH64_PACA, paca, "paca", AARCH64_HWCAP_PACA, 0) \ +- LINE(AARCH64_PACG, pacg, "pacg", AARCH64_HWCAP_PACG, 0) \ +- LINE(AARCH64_DCPODP, dcpodp, "dcpodp", 0, AARCH64_HWCAP2_DCPODP) \ +- LINE(AARCH64_SVE2, sve2, "sve2", 0, AARCH64_HWCAP2_SVE2) \ +- LINE(AARCH64_SVEAES, sveaes, "sveaes", 0, AARCH64_HWCAP2_SVEAES) \ +- LINE(AARCH64_SVEPMULL, svepmull, "svepmull", 0, AARCH64_HWCAP2_SVEPMULL) \ +- LINE(AARCH64_SVEBITPERM, svebitperm, "svebitperm", 0, \ +- AARCH64_HWCAP2_SVEBITPERM) \ +- LINE(AARCH64_SVESHA3, svesha3, "svesha3", 0, AARCH64_HWCAP2_SVESHA3) \ +- LINE(AARCH64_SVESM4, svesm4, "svesm4", 0, AARCH64_HWCAP2_SVESM4) \ +- LINE(AARCH64_FLAGM2, flagm2, "flagm2", 0, AARCH64_HWCAP2_FLAGM2) \ +- LINE(AARCH64_FRINT, frint, "frint", 0, AARCH64_HWCAP2_FRINT) \ +- LINE(AARCH64_SVEI8MM, svei8mm, "svei8mm", 0, AARCH64_HWCAP2_SVEI8MM) \ +- LINE(AARCH64_SVEF32MM, svef32mm, "svef32mm", 0, AARCH64_HWCAP2_SVEF32MM) \ +- LINE(AARCH64_SVEF64MM, svef64mm, "svef64mm", 0, AARCH64_HWCAP2_SVEF64MM) \ +- LINE(AARCH64_SVEBF16, svebf16, "svebf16", 0, AARCH64_HWCAP2_SVEBF16) \ +- LINE(AARCH64_I8MM, i8mm, "i8mm", 0, AARCH64_HWCAP2_I8MM) \ +- LINE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \ +- LINE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \ +- LINE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \ +- LINE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \ +- LINE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE) +-#define INTROSPECTION_PREFIX Aarch64 +-#define INTROSPECTION_ENUM_PREFIX AARCH64 +-#include "define_introspection_and_hwcaps.inl" +- +-//////////////////////////////////////////////////////////////////////////////// +-// Implementation. +-//////////////////////////////////////////////////////////////////////////////// +- +-#include +- +-#include "internal/bit_utils.h" +-#include "internal/filesystem.h" +-#include "internal/stack_line_reader.h" +-#include "internal/string_view.h" ++#include "impl_aarch64__base_implementation.inl" + + static bool HandleAarch64Line(const LineResult result, + Aarch64Info* const info) { +diff --git b/src/impl_aarch64_macos_or_iphone.c b/src/impl_aarch64_macos_or_iphone.c +new file mode 100644 +index 0000000..4dd1db7 +--- /dev/null ++++ b/src/impl_aarch64_macos_or_iphone.c +@@ -0,0 +1,82 @@ ++// Copyright 2021 Google LLC ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++#include "cpu_features_macros.h" ++ ++#ifdef CPU_FEATURES_ARCH_AARCH64 ++#if defined(CPU_FEATURES_OS_MACOS) || defined(CPU_FEATURES_OS_IPHONE) ++ ++#include "impl_aarch64__base_implementation.inl" ++#include "define_introspection_and_hwcaps.inl" ++ ++#if !defined(HAVE_SYSCTLBYNAME) ++#error "Darwin needs support for sysctlbyname" ++#endif ++#include ++ ++#if defined(CPU_FEATURES_MOCK_SYSCTL_AARCH64) ++extern bool GetDarwinSysCtlByName(const char*); ++extern int GetDarwinSysCtlByNameValue(const char* name); ++#else ++static int GetDarwinSysCtlByNameValue(const char* name) { ++ int enabled; ++ size_t enabled_len = sizeof(enabled); ++ const int failure = sysctlbyname(name, &enabled, &enabled_len, NULL, 0); ++ return failure ? 0 : enabled; ++} ++ ++static bool GetDarwinSysCtlByName(const char* name) { ++ return GetDarwinSysCtlByNameValue(name) != 0; ++} ++#endif ++ ++static const Aarch64Info kEmptyAarch64Info; ++ ++Aarch64Info GetAarch64Info(void) { ++ Aarch64Info info = kEmptyAarch64Info; ++ ++ // Handling Darwin platform through sysctlbyname. ++ info.implementer = GetDarwinSysCtlByNameValue("hw.cputype"); ++ info.variant = GetDarwinSysCtlByNameValue("hw.cpusubtype"); ++ info.part = GetDarwinSysCtlByNameValue("hw.cpufamily"); ++ info.revision = GetDarwinSysCtlByNameValue("hw.cpusubfamily"); ++ ++ info.features.fp = GetDarwinSysCtlByName("hw.optional.floatingpoint"); ++ info.features.asimd = GetDarwinSysCtlByName("hw.optional.AdvSIMD"); ++ info.features.aes = GetDarwinSysCtlByName("hw.optional.arm.FEAT_AES"); ++ info.features.pmull = GetDarwinSysCtlByName("hw.optional.arm.FEAT_PMULL"); ++ info.features.sha1 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SHA1"); ++ info.features.sha2 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SHA2"); ++ info.features.crc32 = GetDarwinSysCtlByName("hw.optional.armv8_crc32"); ++ info.features.atomics = GetDarwinSysCtlByName("hw.optional.armv8_1_atomics"); ++ info.features.fphp = GetDarwinSysCtlByName("hw.optional.neon_hpfp"); ++ info.features.jscvt = GetDarwinSysCtlByName("hw.optional.arm.FEAT_JSCVT"); ++ info.features.fcma = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FCMA"); ++ info.features.lrcpc = GetDarwinSysCtlByName("hw.optional.arm.FEAT_LRCPC"); ++ info.features.sha3 = GetDarwinSysCtlByName("hw.optional.armv8_2_sha3"); ++ info.features.sha512 = GetDarwinSysCtlByName("hw.optional.armv8_2_sha512"); ++ info.features.asimdfhm = GetDarwinSysCtlByName("hw.optional.armv8_2_fhm"); ++ info.features.flagm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FLAGM"); ++ info.features.flagm2 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FLAGM2"); ++ info.features.ssbs = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SSBS"); ++ info.features.sb = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SB"); ++ info.features.i8mm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_I8MM"); ++ info.features.bf16 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_BF16"); ++ info.features.bti = GetDarwinSysCtlByName("hw.optional.arm.FEAT_BTI"); ++ ++ return info; ++} ++ ++#endif // defined(CPU_FEATURES_OS_MACOS) || defined(CPU_FEATURES_OS_IPHONE) ++#endif // CPU_FEATURES_ARCH_AARCH64 diff --git a/recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch b/recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch new file mode 100644 index 0000000000000..e29b90d0379c1 --- /dev/null +++ b/recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch @@ -0,0 +1,257 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bcc9bb0..c87475c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -147,7 +147,7 @@ target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS}) + target_include_directories(cpu_features + PUBLIC $ + ) +-if(PROCESSOR_IS_X86) ++if(PROCESSOR_IS_X86 OR PROCESSOR_IS_AARCH64) + if(APPLE) + target_compile_definitions(cpu_features PRIVATE HAVE_SYSCTLBYNAME) + endif() +diff --git b/include/impl_aarch64__base_implementation.inl b/include/impl_aarch64__base_implementation.inl +new file mode 100644 +index 0000000..ef3629e +--- /dev/null ++++ b/include/impl_aarch64__base_implementation.inl +@@ -0,0 +1,63 @@ ++#include "cpuinfo_aarch64.h" ++ ++//////////////////////////////////////////////////////////////////////////////// ++// Definitions for introspection. ++//////////////////////////////////////////////////////////////////////////////// ++#define INTROSPECTION_TABLE \ ++ LINE(AARCH64_FP, fp, "fp", AARCH64_HWCAP_FP, 0) \ ++ LINE(AARCH64_ASIMD, asimd, "asimd", AARCH64_HWCAP_ASIMD, 0) \ ++ LINE(AARCH64_EVTSTRM, evtstrm, "evtstrm", AARCH64_HWCAP_EVTSTRM, 0) \ ++ LINE(AARCH64_AES, aes, "aes", AARCH64_HWCAP_AES, 0) \ ++ LINE(AARCH64_PMULL, pmull, "pmull", AARCH64_HWCAP_PMULL, 0) \ ++ LINE(AARCH64_SHA1, sha1, "sha1", AARCH64_HWCAP_SHA1, 0) \ ++ LINE(AARCH64_SHA2, sha2, "sha2", AARCH64_HWCAP_SHA2, 0) \ ++ LINE(AARCH64_CRC32, crc32, "crc32", AARCH64_HWCAP_CRC32, 0) \ ++ LINE(AARCH64_ATOMICS, atomics, "atomics", AARCH64_HWCAP_ATOMICS, 0) \ ++ LINE(AARCH64_FPHP, fphp, "fphp", AARCH64_HWCAP_FPHP, 0) \ ++ LINE(AARCH64_ASIMDHP, asimdhp, "asimdhp", AARCH64_HWCAP_ASIMDHP, 0) \ ++ LINE(AARCH64_CPUID, cpuid, "cpuid", AARCH64_HWCAP_CPUID, 0) \ ++ LINE(AARCH64_ASIMDRDM, asimdrdm, "asimdrdm", AARCH64_HWCAP_ASIMDRDM, 0) \ ++ LINE(AARCH64_JSCVT, jscvt, "jscvt", AARCH64_HWCAP_JSCVT, 0) \ ++ LINE(AARCH64_FCMA, fcma, "fcma", AARCH64_HWCAP_FCMA, 0) \ ++ LINE(AARCH64_LRCPC, lrcpc, "lrcpc", AARCH64_HWCAP_LRCPC, 0) \ ++ LINE(AARCH64_DCPOP, dcpop, "dcpop", AARCH64_HWCAP_DCPOP, 0) \ ++ LINE(AARCH64_SHA3, sha3, "sha3", AARCH64_HWCAP_SHA3, 0) \ ++ LINE(AARCH64_SM3, sm3, "sm3", AARCH64_HWCAP_SM3, 0) \ ++ LINE(AARCH64_SM4, sm4, "sm4", AARCH64_HWCAP_SM4, 0) \ ++ LINE(AARCH64_ASIMDDP, asimddp, "asimddp", AARCH64_HWCAP_ASIMDDP, 0) \ ++ LINE(AARCH64_SHA512, sha512, "sha512", AARCH64_HWCAP_SHA512, 0) \ ++ LINE(AARCH64_SVE, sve, "sve", AARCH64_HWCAP_SVE, 0) \ ++ LINE(AARCH64_ASIMDFHM, asimdfhm, "asimdfhm", AARCH64_HWCAP_ASIMDFHM, 0) \ ++ LINE(AARCH64_DIT, dit, "dit", AARCH64_HWCAP_DIT, 0) \ ++ LINE(AARCH64_USCAT, uscat, "uscat", AARCH64_HWCAP_USCAT, 0) \ ++ LINE(AARCH64_ILRCPC, ilrcpc, "ilrcpc", AARCH64_HWCAP_ILRCPC, 0) \ ++ LINE(AARCH64_FLAGM, flagm, "flagm", AARCH64_HWCAP_FLAGM, 0) \ ++ LINE(AARCH64_SSBS, ssbs, "ssbs", AARCH64_HWCAP_SSBS, 0) \ ++ LINE(AARCH64_SB, sb, "sb", AARCH64_HWCAP_SB, 0) \ ++ LINE(AARCH64_PACA, paca, "paca", AARCH64_HWCAP_PACA, 0) \ ++ LINE(AARCH64_PACG, pacg, "pacg", AARCH64_HWCAP_PACG, 0) \ ++ LINE(AARCH64_DCPODP, dcpodp, "dcpodp", 0, AARCH64_HWCAP2_DCPODP) \ ++ LINE(AARCH64_SVE2, sve2, "sve2", 0, AARCH64_HWCAP2_SVE2) \ ++ LINE(AARCH64_SVEAES, sveaes, "sveaes", 0, AARCH64_HWCAP2_SVEAES) \ ++ LINE(AARCH64_SVEPMULL, svepmull, "svepmull", 0, AARCH64_HWCAP2_SVEPMULL) \ ++ LINE(AARCH64_SVEBITPERM, svebitperm, "svebitperm", 0, \ ++ AARCH64_HWCAP2_SVEBITPERM) \ ++ LINE(AARCH64_SVESHA3, svesha3, "svesha3", 0, AARCH64_HWCAP2_SVESHA3) \ ++ LINE(AARCH64_SVESM4, svesm4, "svesm4", 0, AARCH64_HWCAP2_SVESM4) \ ++ LINE(AARCH64_FLAGM2, flagm2, "flagm2", 0, AARCH64_HWCAP2_FLAGM2) \ ++ LINE(AARCH64_FRINT, frint, "frint", 0, AARCH64_HWCAP2_FRINT) \ ++ LINE(AARCH64_SVEI8MM, svei8mm, "svei8mm", 0, AARCH64_HWCAP2_SVEI8MM) \ ++ LINE(AARCH64_SVEF32MM, svef32mm, "svef32mm", 0, AARCH64_HWCAP2_SVEF32MM) \ ++ LINE(AARCH64_SVEF64MM, svef64mm, "svef64mm", 0, AARCH64_HWCAP2_SVEF64MM) \ ++ LINE(AARCH64_SVEBF16, svebf16, "svebf16", 0, AARCH64_HWCAP2_SVEBF16) \ ++ LINE(AARCH64_I8MM, i8mm, "i8mm", 0, AARCH64_HWCAP2_I8MM) \ ++ LINE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \ ++ LINE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \ ++ LINE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \ ++ LINE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \ ++ LINE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE) \ ++ LINE(AARCH64_ECV, ecv, "ecv", 0, AARCH64_HWCAP2_ECV) \ ++ LINE(AARCH64_AFP, afp, "afp", 0, AARCH64_HWCAP2_AFP) \ ++ LINE(AARCH64_RPRES, rpres, "rpres", 0, AARCH64_HWCAP2_RPRES) ++#define INTROSPECTION_PREFIX Aarch64 ++#define INTROSPECTION_ENUM_PREFIX AARCH64 +diff --git a/src/impl_aarch64_linux_or_android.c b/src/impl_aarch64_linux_or_android.c +index ef923d9..c0a764c 100644 +--- a/src/impl_aarch64_linux_or_android.c ++++ b/src/impl_aarch64_linux_or_android.c +@@ -17,81 +17,7 @@ + #ifdef CPU_FEATURES_ARCH_AARCH64 + #if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) + +-#include "cpuinfo_aarch64.h" +- +-//////////////////////////////////////////////////////////////////////////////// +-// Definitions for introspection. +-//////////////////////////////////////////////////////////////////////////////// +-#define INTROSPECTION_TABLE \ +- LINE(AARCH64_FP, fp, "fp", AARCH64_HWCAP_FP, 0) \ +- LINE(AARCH64_ASIMD, asimd, "asimd", AARCH64_HWCAP_ASIMD, 0) \ +- LINE(AARCH64_EVTSTRM, evtstrm, "evtstrm", AARCH64_HWCAP_EVTSTRM, 0) \ +- LINE(AARCH64_AES, aes, "aes", AARCH64_HWCAP_AES, 0) \ +- LINE(AARCH64_PMULL, pmull, "pmull", AARCH64_HWCAP_PMULL, 0) \ +- LINE(AARCH64_SHA1, sha1, "sha1", AARCH64_HWCAP_SHA1, 0) \ +- LINE(AARCH64_SHA2, sha2, "sha2", AARCH64_HWCAP_SHA2, 0) \ +- LINE(AARCH64_CRC32, crc32, "crc32", AARCH64_HWCAP_CRC32, 0) \ +- LINE(AARCH64_ATOMICS, atomics, "atomics", AARCH64_HWCAP_ATOMICS, 0) \ +- LINE(AARCH64_FPHP, fphp, "fphp", AARCH64_HWCAP_FPHP, 0) \ +- LINE(AARCH64_ASIMDHP, asimdhp, "asimdhp", AARCH64_HWCAP_ASIMDHP, 0) \ +- LINE(AARCH64_CPUID, cpuid, "cpuid", AARCH64_HWCAP_CPUID, 0) \ +- LINE(AARCH64_ASIMDRDM, asimdrdm, "asimdrdm", AARCH64_HWCAP_ASIMDRDM, 0) \ +- LINE(AARCH64_JSCVT, jscvt, "jscvt", AARCH64_HWCAP_JSCVT, 0) \ +- LINE(AARCH64_FCMA, fcma, "fcma", AARCH64_HWCAP_FCMA, 0) \ +- LINE(AARCH64_LRCPC, lrcpc, "lrcpc", AARCH64_HWCAP_LRCPC, 0) \ +- LINE(AARCH64_DCPOP, dcpop, "dcpop", AARCH64_HWCAP_DCPOP, 0) \ +- LINE(AARCH64_SHA3, sha3, "sha3", AARCH64_HWCAP_SHA3, 0) \ +- LINE(AARCH64_SM3, sm3, "sm3", AARCH64_HWCAP_SM3, 0) \ +- LINE(AARCH64_SM4, sm4, "sm4", AARCH64_HWCAP_SM4, 0) \ +- LINE(AARCH64_ASIMDDP, asimddp, "asimddp", AARCH64_HWCAP_ASIMDDP, 0) \ +- LINE(AARCH64_SHA512, sha512, "sha512", AARCH64_HWCAP_SHA512, 0) \ +- LINE(AARCH64_SVE, sve, "sve", AARCH64_HWCAP_SVE, 0) \ +- LINE(AARCH64_ASIMDFHM, asimdfhm, "asimdfhm", AARCH64_HWCAP_ASIMDFHM, 0) \ +- LINE(AARCH64_DIT, dit, "dit", AARCH64_HWCAP_DIT, 0) \ +- LINE(AARCH64_USCAT, uscat, "uscat", AARCH64_HWCAP_USCAT, 0) \ +- LINE(AARCH64_ILRCPC, ilrcpc, "ilrcpc", AARCH64_HWCAP_ILRCPC, 0) \ +- LINE(AARCH64_FLAGM, flagm, "flagm", AARCH64_HWCAP_FLAGM, 0) \ +- LINE(AARCH64_SSBS, ssbs, "ssbs", AARCH64_HWCAP_SSBS, 0) \ +- LINE(AARCH64_SB, sb, "sb", AARCH64_HWCAP_SB, 0) \ +- LINE(AARCH64_PACA, paca, "paca", AARCH64_HWCAP_PACA, 0) \ +- LINE(AARCH64_PACG, pacg, "pacg", AARCH64_HWCAP_PACG, 0) \ +- LINE(AARCH64_DCPODP, dcpodp, "dcpodp", 0, AARCH64_HWCAP2_DCPODP) \ +- LINE(AARCH64_SVE2, sve2, "sve2", 0, AARCH64_HWCAP2_SVE2) \ +- LINE(AARCH64_SVEAES, sveaes, "sveaes", 0, AARCH64_HWCAP2_SVEAES) \ +- LINE(AARCH64_SVEPMULL, svepmull, "svepmull", 0, AARCH64_HWCAP2_SVEPMULL) \ +- LINE(AARCH64_SVEBITPERM, svebitperm, "svebitperm", 0, \ +- AARCH64_HWCAP2_SVEBITPERM) \ +- LINE(AARCH64_SVESHA3, svesha3, "svesha3", 0, AARCH64_HWCAP2_SVESHA3) \ +- LINE(AARCH64_SVESM4, svesm4, "svesm4", 0, AARCH64_HWCAP2_SVESM4) \ +- LINE(AARCH64_FLAGM2, flagm2, "flagm2", 0, AARCH64_HWCAP2_FLAGM2) \ +- LINE(AARCH64_FRINT, frint, "frint", 0, AARCH64_HWCAP2_FRINT) \ +- LINE(AARCH64_SVEI8MM, svei8mm, "svei8mm", 0, AARCH64_HWCAP2_SVEI8MM) \ +- LINE(AARCH64_SVEF32MM, svef32mm, "svef32mm", 0, AARCH64_HWCAP2_SVEF32MM) \ +- LINE(AARCH64_SVEF64MM, svef64mm, "svef64mm", 0, AARCH64_HWCAP2_SVEF64MM) \ +- LINE(AARCH64_SVEBF16, svebf16, "svebf16", 0, AARCH64_HWCAP2_SVEBF16) \ +- LINE(AARCH64_I8MM, i8mm, "i8mm", 0, AARCH64_HWCAP2_I8MM) \ +- LINE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \ +- LINE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \ +- LINE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \ +- LINE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \ +- LINE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE) \ +- LINE(AARCH64_ECV, ecv, "ecv", 0, AARCH64_HWCAP2_ECV) \ +- LINE(AARCH64_AFP, afp, "afp", 0, AARCH64_HWCAP2_AFP) \ +- LINE(AARCH64_RPRES, rpres, "rpres", 0, AARCH64_HWCAP2_RPRES) +-#define INTROSPECTION_PREFIX Aarch64 +-#define INTROSPECTION_ENUM_PREFIX AARCH64 +-#include "define_introspection_and_hwcaps.inl" +- +-//////////////////////////////////////////////////////////////////////////////// +-// Implementation. +-//////////////////////////////////////////////////////////////////////////////// +- +-#include +- +-#include "internal/bit_utils.h" +-#include "internal/filesystem.h" +-#include "internal/stack_line_reader.h" +-#include "internal/string_view.h" ++#include "impl_aarch64__base_implementation.inl" + + static bool HandleAarch64Line(const LineResult result, + Aarch64Info* const info) { +diff --git b/src/impl_aarch64_macos_or_iphone.c b/src/impl_aarch64_macos_or_iphone.c +new file mode 100644 +index 0000000..4dd1db7 +--- /dev/null ++++ b/src/impl_aarch64_macos_or_iphone.c +@@ -0,0 +1,82 @@ ++// Copyright 2021 Google LLC ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++#include "cpu_features_macros.h" ++ ++#ifdef CPU_FEATURES_ARCH_AARCH64 ++#if defined(CPU_FEATURES_OS_MACOS) || defined(CPU_FEATURES_OS_IPHONE) ++ ++#include "impl_aarch64__base_implementation.inl" ++#include "define_introspection_and_hwcaps.inl" ++ ++#if !defined(HAVE_SYSCTLBYNAME) ++#error "Darwin needs support for sysctlbyname" ++#endif ++#include ++ ++#if defined(CPU_FEATURES_MOCK_SYSCTL_AARCH64) ++extern bool GetDarwinSysCtlByName(const char*); ++extern int GetDarwinSysCtlByNameValue(const char* name); ++#else ++static int GetDarwinSysCtlByNameValue(const char* name) { ++ int enabled; ++ size_t enabled_len = sizeof(enabled); ++ const int failure = sysctlbyname(name, &enabled, &enabled_len, NULL, 0); ++ return failure ? 0 : enabled; ++} ++ ++static bool GetDarwinSysCtlByName(const char* name) { ++ return GetDarwinSysCtlByNameValue(name) != 0; ++} ++#endif ++ ++static const Aarch64Info kEmptyAarch64Info; ++ ++Aarch64Info GetAarch64Info(void) { ++ Aarch64Info info = kEmptyAarch64Info; ++ ++ // Handling Darwin platform through sysctlbyname. ++ info.implementer = GetDarwinSysCtlByNameValue("hw.cputype"); ++ info.variant = GetDarwinSysCtlByNameValue("hw.cpusubtype"); ++ info.part = GetDarwinSysCtlByNameValue("hw.cpufamily"); ++ info.revision = GetDarwinSysCtlByNameValue("hw.cpusubfamily"); ++ ++ info.features.fp = GetDarwinSysCtlByName("hw.optional.floatingpoint"); ++ info.features.asimd = GetDarwinSysCtlByName("hw.optional.AdvSIMD"); ++ info.features.aes = GetDarwinSysCtlByName("hw.optional.arm.FEAT_AES"); ++ info.features.pmull = GetDarwinSysCtlByName("hw.optional.arm.FEAT_PMULL"); ++ info.features.sha1 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SHA1"); ++ info.features.sha2 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SHA2"); ++ info.features.crc32 = GetDarwinSysCtlByName("hw.optional.armv8_crc32"); ++ info.features.atomics = GetDarwinSysCtlByName("hw.optional.armv8_1_atomics"); ++ info.features.fphp = GetDarwinSysCtlByName("hw.optional.neon_hpfp"); ++ info.features.jscvt = GetDarwinSysCtlByName("hw.optional.arm.FEAT_JSCVT"); ++ info.features.fcma = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FCMA"); ++ info.features.lrcpc = GetDarwinSysCtlByName("hw.optional.arm.FEAT_LRCPC"); ++ info.features.sha3 = GetDarwinSysCtlByName("hw.optional.armv8_2_sha3"); ++ info.features.sha512 = GetDarwinSysCtlByName("hw.optional.armv8_2_sha512"); ++ info.features.asimdfhm = GetDarwinSysCtlByName("hw.optional.armv8_2_fhm"); ++ info.features.flagm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FLAGM"); ++ info.features.flagm2 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FLAGM2"); ++ info.features.ssbs = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SSBS"); ++ info.features.sb = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SB"); ++ info.features.i8mm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_I8MM"); ++ info.features.bf16 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_BF16"); ++ info.features.bti = GetDarwinSysCtlByName("hw.optional.arm.FEAT_BTI"); ++ ++ return info; ++} ++ ++#endif // defined(CPU_FEATURES_OS_MACOS) || defined(CPU_FEATURES_OS_IPHONE) ++#endif // CPU_FEATURES_ARCH_AARCH64 diff --git a/recipes/cpu_features/all/test_package/CMakeLists.txt b/recipes/cpu_features/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34c33e1cc8a13 --- /dev/null +++ b/recipes/cpu_features/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(CpuFeatures REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE CpuFeatures::cpu_features) diff --git a/recipes/cpu_features/all/test_package/conanfile.py b/recipes/cpu_features/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cpu_features/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/cpu_features/all/test_package/test_package.c b/recipes/cpu_features/all/test_package/test_package.c new file mode 100644 index 0000000000000..5871a5e9abd8c --- /dev/null +++ b/recipes/cpu_features/all/test_package/test_package.c @@ -0,0 +1,40 @@ +#include +#if defined(CPU_FEATURES_ARCH_X86) +#include +#elif defined(CPU_FEATURES_ARCH_ARM) +#include +#elif defined(CPU_FEATURES_ARCH_AARCH64) +#include +#elif defined(CPU_FEATURES_ARCH_MIPS) +#include +#elif defined(CPU_FEATURES_ARCH_PPC) +#include +#endif + +#include +#include + +int main() +{ +#if defined(CPU_FEATURES_ARCH_X86) + X86Features features = GetX86Info().features; +#elif defined(CPU_FEATURES_ARCH_ARM) + ArmFeatures features = GetArmInfo().features; +#elif defined(CPU_FEATURES_ARCH_AARCH64) + Aarch64Features features = GetAarch64Info().features; +#elif defined(CPU_FEATURES_ARCH_MIPS) + MipsFeatures features = GetMipsInfo().features; +#elif defined(CPU_FEATURES_ARCH_PPC) + PPCFeatures features = GetPPCInfo().features; +#endif + +#if defined(CPU_FEATURES_ARCH_X86) || defined(CPU_FEATURES_ARCH_ARM) || defined(CPU_FEATURES_ARCH_AARCH64) + printf("AES is%s available\n", features.aes ? "" : "n't"); +#elif defined(CPU_FEATURES_ARCH_MIPS) + printf("EVA is%s available\n", features.eva ? "" : "n't"); +#elif defined(CPU_FEATURES_ARCH_PPC) + printf("SPE is%s available\n", features.spe ? "" : "n't"); +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/cpu_features/all/test_v1_package/CMakeLists.txt b/recipes/cpu_features/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpu_features/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpu_features/all/test_v1_package/conanfile.py b/recipes/cpu_features/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpu_features/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/cpu_features/config.yml b/recipes/cpu_features/config.yml new file mode 100644 index 0000000000000..a4fbe67cb54a0 --- /dev/null +++ b/recipes/cpu_features/config.yml @@ -0,0 +1,7 @@ +versions: + "0.8.0": + folder: "all" + "0.7.0": + folder: "all" + "0.6.0": + folder: "all" diff --git a/recipes/cpuinfo/all/conandata.yml b/recipes/cpuinfo/all/conandata.yml new file mode 100644 index 0000000000000..6231a9e8c3b97 --- /dev/null +++ b/recipes/cpuinfo/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20220228": + url: "https://github.com/pytorch/cpuinfo/archive/6288930068efc8dff4f3c0b95f062fc5ddceba04.tar.gz" + sha256: "9e9e937b3569320d23d8b1c8c26ed3603affe55c3e4a3e49622e8a2c6d6e1696" + "cci.20201217": + url: "https://github.com/pytorch/cpuinfo/archive/5916273f79a21551890fd3d56fc5375a78d1598d.tar.gz" + sha256: "f3c16d5d393d6d1fa6b6ed8621dd0a535552df9bc88cbba739375dde38a93142" diff --git a/recipes/cpuinfo/all/conanfile.py b/recipes/cpuinfo/all/conanfile.py new file mode 100644 index 0000000000000..3a1f62573cb43 --- /dev/null +++ b/recipes/cpuinfo/all/conanfile.py @@ -0,0 +1,88 @@ +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, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class CpuinfoConan(ConanFile): + name = "cpuinfo" + description = "cpuinfo is a library to detect essential for performance " \ + "optimization information about host CPU." + license = "BSD-2-Clause" + topics = ("cpu", "cpuid", "cpu-cache", "cpu-model", "instruction-set", "cpu-topology") + homepage = "https://github.com/pytorch/cpuinfo" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "log_level": ["default", "debug", "info", "warning", "error", "fatal", "none"], + } + default_options = { + "shared": False, + "fPIC": True, + "log_level": "default", + } + + 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 self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("shared cpuinfo not supported on Windows") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # cpuinfo + tc.cache_variables["CPUINFO_LIBRARY_TYPE"] = "default" + tc.cache_variables["CPUINFO_RUNTIME_TYPE"] = "default" + tc.cache_variables["CPUINFO_LOG_LEVEL"] = self.options.log_level + tc.variables["CPUINFO_BUILD_TOOLS"] = False + tc.variables["CPUINFO_BUILD_UNIT_TESTS"] = False + tc.variables["CPUINFO_BUILD_MOCK_TESTS"] = False + tc.variables["CPUINFO_BUILD_BENCHMARKS"] = False + # clog (always static) + tc.cache_variables["CLOG_RUNTIME_TYPE"] = "default" + tc.variables["CLOG_BUILD_TESTS"] = False + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libcpuinfo") + self.cpp_info.libs = ["cpuinfo", "clog"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/cpuinfo/all/test_package/CMakeLists.txt b/recipes/cpuinfo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f7fd88969d977 --- /dev/null +++ b/recipes/cpuinfo/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(cpuinfo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cpuinfo::cpuinfo) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/cpuinfo/all/test_package/conanfile.py b/recipes/cpuinfo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cpuinfo/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/cpuinfo/all/test_package/test_package.c b/recipes/cpuinfo/all/test_package/test_package.c new file mode 100644 index 0000000000000..72878131f9608 --- /dev/null +++ b/recipes/cpuinfo/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include + +#include + +int main() { + bool initialized = cpuinfo_initialize(); + if (!initialized) { + printf("cpuinfo doesn't support this platforn\n"); + return 0; + } + printf("processors count: %u\n", cpuinfo_get_processors_count()); + printf("cores count: %u\n", cpuinfo_get_cores_count()); + printf("clusters count: %u\n", cpuinfo_get_clusters_count()); + printf("packages count: %u\n", cpuinfo_get_packages_count()); + printf("uarchs count: %u\n", cpuinfo_get_uarchs_count()); + printf("l1i caches count: %u\n", cpuinfo_get_l1i_caches_count()); + printf("l1d caches count: %u\n", cpuinfo_get_l1d_caches_count()); + printf("l2 count: %u\n", cpuinfo_get_l2_caches_count()); + printf("l3 count: %u\n", cpuinfo_get_l3_caches_count()); + printf("l4 count: %u\n", cpuinfo_get_l4_caches_count()); + cpuinfo_deinitialize(); + return 0; +} diff --git a/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt b/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpuinfo/all/test_v1_package/conanfile.py b/recipes/cpuinfo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpuinfo/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/cpuinfo/config.yml b/recipes/cpuinfo/config.yml new file mode 100644 index 0000000000000..a6383a8ac8924 --- /dev/null +++ b/recipes/cpuinfo/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220228": + folder: all + "cci.20201217": + folder: all diff --git a/recipes/cpython/all/conandata.yml b/recipes/cpython/all/conandata.yml new file mode 100644 index 0000000000000..f9fd51067c8b3 --- /dev/null +++ b/recipes/cpython/all/conandata.yml @@ -0,0 +1,72 @@ +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" +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" + - 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_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_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_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" diff --git a/recipes/cpython/all/conanfile.py b/recipes/cpython/all/conanfile.py new file mode 100644 index 0000000000000..4fa1d1da6334e --- /dev/null +++ b/recipes/cpython/all/conanfile.py @@ -0,0 +1,738 @@ +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" + + +class CPythonConan(ConanFile): + name = "cpython" + 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/**" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "optimizations": [True, False], + "lto": [True, False], + "docstrings": [True, False], + "pymalloc": [True, False], + "with_bz2": [True, False], + "with_gdbm": [True, False], + "with_nis": [True, False], + "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 + "env_vars": [True, False], # set environment variables + } + default_options = { + "shared": False, + "fPIC": True, + "optimizations": False, + "lto": False, + "docstrings": True, + "pymalloc": True, + "with_bz2": True, + "with_gdbm": True, + "with_nis": False, + "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(".")) + + @property + def _supports_modules(self): + return self.settings.compiler != "Visual Studio" 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]) + + @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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.compiler == "Visual Studio": + 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 + + def configure(self): + if self.options.shared: + del self.options.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") + + if not self.options.shared and tools.Version(self._version_number_only) >= "3.10": + raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") + + if self.options.get_safe("with_curses", False) and not self.options["ncurses"].with_widec: + raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") + + def package_id(self): + del self.info.options.env_vars + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @property + def _with_libffi(self): + # cpython 3.7.x on MSVC uses an ancient libffi 2.00-beta (which is not available at cci, and is API/ABI incompatible with current 3.2+) + return self._supports_modules \ + and (self.settings.compiler != "Visual Studio" or tools.Version(self._version_number_only) >= "3.8") + + def requirements(self): + self.requires("zlib/1.2.11") + 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("mpdecimal/2.5.0") + else: + self.requires("mpdecimal/2.5.0") # FIXME: no 2.5.1 to troubleshoot apple + 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 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") + 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") + 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") + if self.options.get_safe("with_lzma", False): + self.requires("xz_utils/5.2.5") + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + yes_no = lambda v: "yes" if v else "no" + conf_args = [ + "--enable-shared={}".format(yes_no(self.options.shared)), + "--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")), + ] + 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: + 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: + # FIXME: use info from xorg.components (x11, xscrnsaver) + tcltk_libs.extend(["-l{}".format(lib) for lib in ("X11", "Xss")]) + conf_args.extend([ + "--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 + + 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": + runtime_library = { + "MT": "MultiThreaded", + "MTd": "MultiThreadedDebug", + "MD": "MultiThreadedDLL", + "MDd": "MultiThreadedDebugDLL", + }[str(self.settings.compiler.runtime)] + 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) + + # Remove vendored packages + tools.rmdir(os.path.join(self._source_subfolder, "Modules", "_decimal", "libmpdec")) + tools.rmdir(os.path.join(self._source_subfolder, "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))) + + # 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")) + + @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())) + + def project_build(name): + if os.path.basename(name) in self._msvc_discarded_projects: + return False + if "test" in 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) + return projects + else: + return "pythoncore", "python", "pythonw" + + @property + def _msvc_discarded_projects(self): + discarded = {"python_uwp", "pythonw_uwp"} + 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") + return discarded + + @property + def _msvc_archs(self): + archs = { + "x86": "Win32", + "x86_64": "x64", + } + 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", + } + projects = self._solution_projects + self.output.info("Building {} Visual Studio projects: {}".format(len(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) + + 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": + self._msvc_build() + else: + autotools = self._configure_autotools() + autotools.make() + + @property + def _msvc_artifacts_path(self): + build_subdir_lut = { + "x86_64": "amd64", + "x86": "win32", + } + 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)]) + + @property + def _msvc_install_subprefix(self): + return "bin" + + def _copy_essential_dlls(self): + if self.settings.compiler == "Visual Studio": + # 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) + + 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) + 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)) + layout_args = [ + os.path.join(self._source_subfolder, "PC", "layout", "main.py"), + "-v", + "-s", self._source_subfolder, + "-b", build_path, + "--copy", install_prefix, + "-p", + "--include-pip", + "--include-venv", + "--include-dev", + ] + if self.options.with_tkinter: + 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) + + tools.rmdir(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")) + 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)) + + 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")) + + packages = {} + get_name_version = lambda fn: fn.split(".", 2)[:2] + whldir = os.path.join(self._source_subfolder, "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) + 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")) + + 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) + + 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: + self._msvc_package_layout() + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "vcruntime*") + 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")) + + # Rewrite shebangs of python scripts + for filename in os.listdir(os.path.join(self.package_folder, "bin")): + filepath = os.path.join(self.package_folder, "bin", filename) + if not os.path.isfile(filepath): + continue + if os.path.islink(filepath): + continue + with open(filepath, "rb") as fn: + firstline = fn.readline(1024) + 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)) + with open(filepath, "wb") as fn: + fn.write(textwrap.dedent("""\ + #!/bin/sh + ''':' + __file__="$0" + while [ -L "$__file__" ]; do + __file__="$(dirname "$__file__")/$(readlink "$__file__")" + done + exec "$(dirname "$__file__")/python{}" "$0" "$@" + ''' + """.format(self._version_suffix)).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() + + @property + def _cpython_symlink(self): + symlink = os.path.join(self.package_folder, "bin", "python") + if self.settings.os == "Windows": + symlink += ".exe" + return symlink + + @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": + if self.settings.build_type == "Debug": + python += "_d" + if self.settings.os == "Windows": + python += ".exe" + return python + + @property + def _cpython_interpreter_path(self): + return os.path.join(self.package_folder, "bin", self._cpython_interpreter_name) + + @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" + return res + + @property + def _lib_name(self): + if self.settings.compiler == "Visual Studio": + 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)) + + 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) + # python component: "Build a C extension for Python" + if self.settings.compiler == "Visual Studio": + 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))) + 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": + 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"].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"].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"].requires = ["python"] + + self.cpp_info.components["_embed_copy"].requires = ["embed"] + self.cpp_info.components["_embed_copy"].names["pkg_config"] = ["python{}-embed".format(py_version.major)] + self.cpp_info.components["_embed_copy"].libdirs = [] + + if self._supports_modules: + # hidden components: the C extensions of python are built as dynamically loaded shared libraries. + # C extensions or applications with an embedded Python should not need to link to them.. + self.cpp_info.components["_hidden"].requires = [ + "openssl::openssl", + "expat::expat", + "mpdecimal::mpdecimal", + ] + 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") + self.cpp_info.components["_hidden"].requires.append("libxcrypt::libxcrypt") + if self.options.with_bz2: + self.cpp_info.components["_hidden"].requires.append("bzip2::bzip2") + if self.options.get_safe("with_gdbm", False): + self.cpp_info.components["_hidden"].requires.append("gdbm::gdbm") + if self.options.with_sqlite3: + 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"].libdirs = [] + + if self.options.env_vars: + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + python = self._cpython_interpreter_path + self.user_info.python = python + if self.options.env_vars: + self.output.info("Setting PYTHON environment variable: {}".format(python)) + self.env_info.PYTHON = python + + if self.settings.compiler == "Visual Studio": + 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)) + self.user_info.pythonhome = pythonhome + + pythonhome_required = self.settings.compiler == "Visual Studio" or tools.is_apple_os(self.settings.os) + self.user_info.module_requires_pythonhome = pythonhome_required + + if self.settings.compiler == "Visual Studio": + if self.options.env_vars: + self.output.info("Setting PYTHONHOME environment variable: {}".format(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 + 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 new file mode 100644 index 0000000000000..2c101049df531 --- /dev/null +++ b/recipes/cpython/all/patches/2.7.18-0001-msvc.patch @@ -0,0 +1,278 @@ +--- 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 new file mode 100644 index 0000000000000..6034410d3d265 --- /dev/null +++ b/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch @@ -0,0 +1,59 @@ +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 new file mode 100644 index 0000000000000..9eb079402733d --- /dev/null +++ b/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000000000..5c61acd74bd5c --- /dev/null +++ b/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch @@ -0,0 +1,15 @@ +--- 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 new file mode 100644 index 0000000000000..e9b1faf061f3b --- /dev/null +++ b/recipes/cpython/all/patches/3.10.0-0001-msvc.patch @@ -0,0 +1,416 @@ +--- 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-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch new file mode 100644 index 0000000000000..4bc35cf905b12 --- /dev/null +++ b/recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch @@ -0,0 +1,50 @@ +--- Modules/_ctypes/cfield.c ++++ Modules/_ctypes/cfield.c +@@ -1472,7 +1472,11 @@ + 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, &ffi_type_pointer}, + { 'b', b_set, b_get, &ffi_type_schar}, + { 'B', B_set, B_get, &ffi_type_uchar}, +@@ -1524,6 +1528,11 @@ + { 'O', O_set, O_get, &ffi_type_pointer}, + { 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. +@@ -1538,5 +1547,6 @@ + + if (!initialized) { + initialized = 1; ++ formattable_init(); + if (sizeof(wchar_t) == sizeof(short)) + _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sshort; +@@ -1598,7 +1608,7 @@ typedef struct _ffi_type + struct _ffi_type **elements; + } ffi_type; + */ +- ++#if 0 + /* align and size are bogus for void, but they must not be zero */ + ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID }; + +@@ -1625,5 +1635,5 @@ + FFI_TYPE_LONGDOUBLE }; + + ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER }; +- ++#endif + /*---------------- EOF ----------------*/ 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 new file mode 100644 index 0000000000000..0288bdae92ee9 --- /dev/null +++ b/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch @@ -0,0 +1,15 @@ +--- 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 new file mode 100644 index 0000000000000..ec23890e0a717 --- /dev/null +++ b/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch @@ -0,0 +1,13 @@ +--- 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.7.9-0001-msvc.patch b/recipes/cpython/all/patches/3.7.9-0001-msvc.patch new file mode 100644 index 0000000000000..29be01b13f5b5 --- /dev/null +++ b/recipes/cpython/all/patches/3.7.9-0001-msvc.patch @@ -0,0 +1,416 @@ +--- 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 new file mode 100644 index 0000000000000..92e44c8ea6ee5 --- /dev/null +++ b/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch @@ -0,0 +1,15 @@ +--- 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 new file mode 100644 index 0000000000000..f5ffba2f61232 --- /dev/null +++ b/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch @@ -0,0 +1,15 @@ +--- 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 new file mode 100644 index 0000000000000..4e390810d2dde --- /dev/null +++ b/recipes/cpython/all/patches/3.8.12-0001-msvc.patch @@ -0,0 +1,431 @@ +--- 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-0002-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch new file mode 100644 index 0000000000000..04b87052a81e0 --- /dev/null +++ b/recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch @@ -0,0 +1,67 @@ +comments --- Modules/_ctypes/malloc_closure.c +comments +++ Modules/_ctypes/malloc_closure.c +comments @@ -87,7 +87,7 @@ +comments } +comments +comments /******************************************************************/ +comments - +comments +#if 0 +comments /* put the item back into the free list */ +comments void ffi_closure_free(void *p) +comments { +comments @@ -114,3 +114,4 @@ +comments #endif +comments return (void *)item; +comments } +comments +#endif +--- Modules/_ctypes/cfield.c ++++ Modules/_ctypes/cfield.c +@@ -1510,7 +1510,11 @@ + 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, &ffi_type_pointer}, + { 'b', b_set, b_get, &ffi_type_schar}, + { 'B', B_set, B_get, &ffi_type_uchar}, +@@ -1564,6 +1568,11 @@ + { 'O', O_set, O_get, &ffi_type_pointer}, + { 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. +@@ -1578,6 +1587,7 @@ + + if (!initialized) { + initialized = 1; ++ formattable_init(); + #ifdef CTYPES_UNICODE + if (sizeof(wchar_t) == sizeof(short)) + _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sshort; +@@ -1640,7 +1650,7 @@ + struct _ffi_type **elements; + } ffi_type; + */ +- ++#if 0 + /* align and size are bogus for void, but they must not be zero */ + ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID }; + +@@ -1667,5 +1677,5 @@ + FFI_TYPE_LONGDOUBLE }; + + ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER }; +- ++#endif + /*---------------- EOF ----------------*/ 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 new file mode 100644 index 0000000000000..21527d0ed307f --- /dev/null +++ b/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch @@ -0,0 +1,15 @@ +--- 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 new file mode 100644 index 0000000000000..90af822b58070 --- /dev/null +++ b/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch @@ -0,0 +1,13 @@ +--- 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.9.7-0001-msvc.patch b/recipes/cpython/all/patches/3.9.7-0001-msvc.patch new file mode 100644 index 0000000000000..fac9247123880 --- /dev/null +++ b/recipes/cpython/all/patches/3.9.7-0001-msvc.patch @@ -0,0 +1,434 @@ +--- 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-0002-_msi-vcxproj.patch b/recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch new file mode 100644 index 0000000000000..0dd36511dc9e0 --- /dev/null +++ b/recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch @@ -0,0 +1,11 @@ +--- PCbuild/_msi.vcxproj ++++ PCbuild/_msi.vcxproj +@@ -23,7 +23,7 @@ + + + PGInstrument +- ARM4 ++ ARM64 + + + PGInstrument diff --git a/recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch new file mode 100644 index 0000000000000..aecf32f4f6594 --- /dev/null +++ b/recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch @@ -0,0 +1,51 @@ +--- Modules/_ctypes/cfield.c ++++ Modules/_ctypes/cfield.c +@@ -1504,7 +1504,11 @@ + 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, &ffi_type_pointer}, + { 'b', b_set, b_get, &ffi_type_schar}, + { 'B', B_set, B_get, &ffi_type_uchar}, +@@ -1558,6 +1562,11 @@ + { 'O', O_set, O_get, &ffi_type_pointer}, + { 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 @@ + + if (!initialized) { + initialized = 1; ++ formattable_init(); + #ifdef CTYPES_UNICODE + if (sizeof(wchar_t) == sizeof(short)) + _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sshort; +@@ -1634,7 +1644,7 @@ + struct _ffi_type **elements; + } ffi_type; + */ +- ++#if 0 + /* align and size are bogus for void, but they must not be zero */ + ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID }; + +@@ -1661,5 +1671,5 @@ + FFI_TYPE_LONGDOUBLE }; + + ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER }; +- ++#endif + /*---------------- EOF ----------------*/ 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 new file mode 100644 index 0000000000000..0bec735b3653d --- /dev/null +++ b/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch @@ -0,0 +1,15 @@ +--- 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 new file mode 100644 index 0000000000000..68a48853b3089 --- /dev/null +++ b/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch @@ -0,0 +1,13 @@ +--- 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.x-0001-relocatable-python-config.patch b/recipes/cpython/all/patches/3.x-0001-relocatable-python-config.patch new file mode 100644 index 0000000000000..113aa2108bbe6 --- /dev/null +++ b/recipes/cpython/all/patches/3.x-0001-relocatable-python-config.patch @@ -0,0 +1,11 @@ +--- Misc/python-config.sh.in ++++ Misc/python-config.sh.in +@@ -30,7 +30,7 @@ + # locations. Keep prefix & exec_prefix using their original values in case + # they are referenced in other configure variables, to prevent double + # substitution, issue #22140. +-prefix="@prefix@" ++prefix="$PYTHON_ROOT" + exec_prefix="@exec_prefix@" + exec_prefix_real=${prefix_real} + includedir=$(echo "@includedir@" | sed "s#$prefix#$prefix_real#") diff --git a/recipes/cpython/all/test_package/CMakeLists.txt b/recipes/cpython/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..525329324757f --- /dev/null +++ b/recipes/cpython/all/test_package/CMakeLists.txt @@ -0,0 +1,100 @@ +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} ${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() + +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 "") + 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() + endif() +endif() + +add_executable(${PROJECT_NAME} "py${PY_VERSION_MAJOR}/test_package.c") +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/cpython/all/test_package/conanfile.py b/recipes/cpython/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8abc18e4492c5 --- /dev/null +++ b/recipes/cpython/all/test_package/conanfile.py @@ -0,0 +1,192 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment +from conans.errors import ConanException +from io import StringIO +import os +import re +import shutil + + +class CmakePython3Abi(object): + def __init__(self, debug, pymalloc, unicode): + self.debug, self.pymalloc, self.unicode = debug, pymalloc, unicode + + _cmake_lut = { + None: "ANY", + True: "ON", + False: "OFF", + } + + @property + def suffix(self): + return "{}{}{}".format( + "d" if self.debug else "", + "m" if self.pymalloc else "", + "u" if self.unicode else "", + ) + + @property + def cmake_arg(self): + return ";".join(self._cmake_lut[a] for a in (self.debug, self.pymalloc, self.unicode)) + + +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 _pymalloc(self): + return bool("pymalloc" in self.options["cpython"] and self.options["cpython"].pymalloc) + + @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, + ) + else: + return CmakePython3Abi( + debug=self.settings.build_type == "Debug", + pymalloc=False, + unicode=False, + ) + + @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 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) + 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.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) + + 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) + 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("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")) + + 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) + + 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. + 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) diff --git a/recipes/cpython/all/test_package/py2/test_module.c b/recipes/cpython/all/test_package/py2/test_module.c new file mode 100644 index 0000000000000..9c5af39ab391b --- /dev/null +++ b/recipes/cpython/all/test_package/py2/test_module.c @@ -0,0 +1,42 @@ +#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 new file mode 100644 index 0000000000000..5e5d839b5a6a1 --- /dev/null +++ b/recipes/cpython/all/test_package/py2/test_package.c @@ -0,0 +1,12 @@ +#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_module.c b/recipes/cpython/all/test_package/py3/test_module.c new file mode 100644 index 0000000000000..7372ac3b1a944 --- /dev/null +++ b/recipes/cpython/all/test_package/py3/test_module.c @@ -0,0 +1,52 @@ +#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 */ +}; + +static struct PyModuleDef spammodule = { + PyModuleDef_HEAD_INIT, + "spam", /* name of module */ + spam_doc, /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, + or -1 if the module keeps state in global variables. */ + SpamMethods +}; + +PyMODINIT_FUNC +PyInit_spam(void) +{ + PyObject *m; + + m = PyModule_Create(&spammodule); + if (m == NULL) + return NULL; + + SpamError = PyErr_NewException("spam.error", NULL, NULL); + Py_INCREF(SpamError); + PyModule_AddObject(m, "error", SpamError); + return m; +} diff --git a/recipes/cpython/all/test_package/py3/test_package.c b/recipes/cpython/all/test_package/py3/test_package.c new file mode 100644 index 0000000000000..f5dfe41cd757c --- /dev/null +++ b/recipes/cpython/all/test_package/py3/test_package.c @@ -0,0 +1,21 @@ +#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 new file mode 100644 index 0000000000000..cd1754cef8131 --- /dev/null +++ b/recipes/cpython/all/test_package/setup.py @@ -0,0 +1,31 @@ +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 +if hasattr(os, "add_dll_directory"): + for directory in os.environ.get("PATH", "").split(os.pathsep): + 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 + + +setup( + name="test_package", + version="1.0", + use_2to3=True, + ext_modules=[ + Extension("spam", [os.path.join(subdir, "test_module.c")]), + ], +) diff --git a/recipes/cpython/all/test_package/test_package.py b/recipes/cpython/all/test_package/test_package.py new file mode 100644 index 0000000000000..f77d2837c6376 --- /dev/null +++ b/recipes/cpython/all/test_package/test_package.py @@ -0,0 +1,213 @@ +import argparse +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 +if hasattr(os, "add_dll_directory"): + for directory in os.environ.get("PATH", "").split(os.pathsep): + if os.path.isdir(directory): + os.add_dll_directory(directory) + +ALL_TESTS = dict() + + +def add_test(fn): + global ALL_TESTS + 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 + + +@add_test +def test_expat(): + import xml.parsers.expat + + # 3 handler functions + def start_element(name, attrs): + print('Start element:', name, attrs) + + def end_element(name): + print('End element:', name) + + def char_data(data): + print('Character data:', repr(data)) + + p = xml.parsers.expat.ParserCreate() + + p.StartElementHandler = start_element + p.EndElementHandler = end_element + p.CharacterDataHandler = char_data + + p.Parse(""" + Text goes here + More text + """, 1) + + +@add_test +def test_gdbm(): + if sys.version_info < (3, 0): + import gdbm + else: + import dbm.gnu as gdbm + + dbfile = "gdbm.db" + + db = gdbm.open(dbfile, "c") + db["key1"] = "data1" + db["key2"] = "data2" + db.close() + + db = gdbm.open(dbfile, "r") + print("keys read from", dbfile, "are", db.keys()) + if len(db.keys()) != 2: + raise Exception("Wrong length") + if b"key1" not in db.keys(): + raise Exception("key1 not present") + if b"key2" not in db.keys(): + raise Exception("key2 not present") + + +@add_test +def test_spam(): + import platform + + print("About to import spam") + sys.stdout.flush() + import 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)) + sys.stdout.flush() + + spam.system(cmd) + + +@add_test +def test_bz2(): + import bz2 + + compressed = bz2.compress(b"hellow world") + if compressed is None: + 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 + + data = lzma.compress(b"hello world") + if data is None: + raise Exception("lzma.compress returned no data") + + +@add_test +def test_sqlite3(): + import sqlite3 + conn = sqlite3.connect("sqlite3.db") + + c = conn.cursor() + c.execute("""CREATE TABLE stocks + (date text, trans text, symbol text, qty real, price real)""") + 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) + + # 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), + ] + c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + conn.commit() + conn.close() + conn = sqlite3.connect("sqlite3.db") + c = conn.cursor() + c.execute("SELECT * from stocks") + data = c.fetchall() + if len(data) != 4: + raise Exception("Need 4 stocks") + print(data) + conn.close() + + +@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 + decimal.getcontext().prec = 6 + print("1/7 =", decimal.Decimal(1) / decimal.Decimal(7)) + decimal.getcontext().prec = 40 + print("1/7 =", decimal.Decimal(1) / decimal.Decimal(7)) + + +@add_test +def test_curses(): + import _curses + + print("Using _curses version {}".format(_curses.version)) + + +@add_test +def test_ctypes(): + import _ctypes + + errno = _ctypes.get_errno() + print("errno={}".format(errno)) + + +@add_test +def test_tkinter(): + import _tkinter + + print("tcl version: {}".format(_tkinter.TCL_VERSION)) + print("tk version: {}".format(_tkinter.TK_VERSION)) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("-b", dest="build_folder", help="build_folder", required=True) + parser.add_argument("-t", dest="test_module", help="test python module") + ns = parser.parse_args() + + os.chdir(ns.build_folder) + ALL_TESTS[ns.test_module]() + + +if __name__ == "__main__": + main() diff --git a/recipes/cpython/config.yml b/recipes/cpython/config.yml new file mode 100644 index 0000000000000..e3abf3ec8acb2 --- /dev/null +++ b/recipes/cpython/config.yml @@ -0,0 +1,11 @@ +versions: + "3.10.0": + folder: "all" + "3.9.7": + folder: "all" + "3.8.12": + folder: "all" + "3.7.12": + folder: "all" + "2.7.18": + folder: "all" diff --git a/recipes/cqrlib/all/CMakeLists.txt b/recipes/cqrlib/all/CMakeLists.txt new file mode 100644 index 0000000000000..1c86519b249a8 --- /dev/null +++ b/recipes/cqrlib/all/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.4) +project(CQRlib LANGUAGES C) + +add_library(CQRlib ${CQRLIB_SRC_DIR}/cqrlib.c) +target_include_directories(CQRlib PRIVATE ${CQRLIB_SRC_DIR}) +set_target_properties(CQRlib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +find_library(M_LIB m) +if(M_LIB) + target_link_libraries(CQRlib PRIVATE ${M_LIB}) +endif() + +include(GNUInstallDirs) +install(TARGETS CQRlib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES ${CQRLIB_SRC_DIR}/cqrlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/cqrlib/all/conandata.yml b/recipes/cqrlib/all/conandata.yml new file mode 100644 index 0000000000000..9ec75e284f70b --- /dev/null +++ b/recipes/cqrlib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.4": + url: "https://github.com/yayahjb/cqrlib/archive/refs/tags/CQRlib-1.1.4.tar.gz" + sha256: "98d70b5a347638754ef3a3874d4ec1ecdd9d1d12c123c44b367ff18419f92c6d" diff --git a/recipes/cqrlib/all/conanfile.py b/recipes/cqrlib/all/conanfile.py new file mode 100644 index 0000000000000..bcd50abb31e76 --- /dev/null +++ b/recipes/cqrlib/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class CqrlibConan(ConanFile): + name = "cqrlib" + description = "CQRlib is an ANSI C implementation of a utility library " \ + "for quaternion arithmetic and quaternion rotation math." + license = "LGPL-2.1-only" + topics = ("cqrlib", "quaternion") + homepage = "https://github.com/yayahjb/cqrlib" + 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, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CQRLIB_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, "lgpl.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 = ["CQRlib"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/cqrlib/all/test_package/CMakeLists.txt b/recipes/cqrlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e9a386c11d30 --- /dev/null +++ b/recipes/cqrlib/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(cqrlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE cqrlib::cqrlib) + +add_executable(${PROJECT_NAME}_cpp test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp PRIVATE cqrlib::cqrlib) diff --git a/recipes/cqrlib/all/test_package/conanfile.py b/recipes/cqrlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..94db9a10dc181 --- /dev/null +++ b/recipes/cqrlib/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") + bin_path_cpp = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path_cpp, env="conanrun") diff --git a/recipes/cqrlib/all/test_package/test_package.c b/recipes/cqrlib/all/test_package/test_package.c new file mode 100644 index 0000000000000..ec994ea428cfa --- /dev/null +++ b/recipes/cqrlib/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main(void) { + CQRQuaternionHandle q; + CQRCreateEmptyQuaternion(&q); + return 0; +} diff --git a/recipes/cqrlib/all/test_package/test_package.cpp b/recipes/cqrlib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..20ad8de2bc5cf --- /dev/null +++ b/recipes/cqrlib/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + CPPQR q; + return 0; +} diff --git a/recipes/cqrlib/all/test_v1_package/CMakeLists.txt b/recipes/cqrlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b455e3e89e446 --- /dev/null +++ b/recipes/cqrlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cqrlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_c ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE cqrlib::cqrlib) + +add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp PRIVATE cqrlib::cqrlib) diff --git a/recipes/cqrlib/all/test_v1_package/conanfile.py b/recipes/cqrlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..302285c48aded --- /dev/null +++ b/recipes/cqrlib/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) + bin_path_cpp = os.path.join("bin", "test_package_cpp") + self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/cqrlib/config.yml b/recipes/cqrlib/config.yml new file mode 100644 index 0000000000000..f7bc2bb892fbd --- /dev/null +++ b/recipes/cqrlib/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.4": + folder: all diff --git a/recipes/crashpad/all/conandata.yml b/recipes/crashpad/all/conandata.yml new file mode 100644 index 0000000000000..78196c9e613a3 --- /dev/null +++ b/recipes/crashpad/all/conandata.yml @@ -0,0 +1,49 @@ +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" + sha256: "3876ada53bfb35ca58ac4c27fba79ec56d9436046ab28477fb06c9e8d1a97c7e" + mini_chromium: + 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 + - 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 new file mode 100644 index 0000000000000..42d603abefb4c --- /dev/null +++ b/recipes/crashpad/all/conanfile.py @@ -0,0 +1,307 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from contextlib import contextmanager +import os +import textwrap + +required_conan_version = ">=1.33.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") + license = "Apache-2.0" + homepage = "https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md" + provides = "crashpad", "mini_chromium" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "http_transport": ["libcurl", "socket", None], + "with_tls": ["openssl", False], + } + default_options = { + "fPIC": True, + "http_transport": None, + "with_tls": "openssl", + } + exports_sources = "patches/*" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def _minimum_compiler_cxx14(self): + return { + "apple-clang": 10, + "gcc": 5, + "clang": "3.9", + "Visual Studio": 14, + }.get(str(self.settings.compiler)) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os in ("Linux", "FreeBSD"): + self.options.http_transport = "libcurl" + elif self.settings.os == "Android": + self.options.http_transport = "socket" + + def build_requirements(self): + self.build_requires("ninja/1.10.2") + self.build_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") + 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") + if self.options.get_safe("with_tls") == "openssl": + self.requires("openssl/1.1.1o") + + def validate(self): + if self.settings.compiler == "Visual Studio": + 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: + # FIXME: is this true? + self.output.warn("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: + 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.") + if self.settings.compiler.cppstd: + tools.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) + + @property + def _gn_os(self): + if tools.is_apple_os(self.settings.os): + if self.settings.os == "Macos": + return "mac" + else: + return "ios" + return { + "Windows": "win", + }.get(str(self.settings.os), str(self.settings.os).lower()) + + @property + def _gn_arch(self): + return { + "x86_64": "x64", + "armv8": "arm64", + "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 + + @property + def _http_transport_impl(self): + if str(self.options.http_transport) == "None": + return "" + 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) + + if self.settings.compiler == "Visual Studio": + tools.replace_in_file(os.path.join(self._source_subfolder, "third_party", "zlib", "BUILD.gn"), + "libs = [ \"z\" ]", + "libs = [ {} ]".format(", ".join("\"{}.lib\"".format(l) for l in self.deps_cpp_info["zlib"].libs))) + + if self.settings.compiler == "gcc": + toolchain_path = os.path.join(self._source_subfolder, "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), "\"\"") + + autotools = AutoToolsBuildEnvironment(self) + extra_cflags = autotools.flags + ["-D{}".format(d) for d in autotools.defines] + extra_cflags_c = [] + extra_cflags_cc = autotools.cxx_flags + extra_ldflags = autotools.link_flags + 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 = { + "libstdc++11": "libstdc++", + }.get(str(self.settings.compiler.libcxx), str(self.settings.compiler.libcxx)) + extra_cflags_cc.append("-stdlib={}".format(stdlib)) + extra_ldflags.append("-stdlib={}".format(stdlib)) + gn_args = [ + "host_os=\\\"{}\\\"".format(self._gn_os), + "host_cpu=\\\"{}\\\"".format(self._gn_arch), + "is_debug={}".format(str(self.settings.build_type == "Debug").lower()), + "crashpad_http_transport_impl=\\\"{}\\\"".format(self._http_transport_impl), + "crashpad_use_boringssl_for_http_transport_socket={}".format(str(self.options.get_safe("with_tls", False) != False).lower()), + "extra_cflags=\\\"{}\\\"".format(" ".join(extra_cflags)), + "extra_cflags_c=\\\"{}\\\"".format(" ".join(extra_cflags_c)), + "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) + + def lib_filename(name): + prefix, suffix = ("", ".lib") if self.settings.compiler == "Visual Studio" 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"))) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="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")) + + self.copy("*.a", src=os.path.join(self._source_subfolder, "out", "Default"), dst="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) + if self.settings.os == "Windows": + tools.rename(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*") + + tools.save(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) + endif() + """)) + + 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.components["mini_chromium_base"].builddirs = [os.path.join("lib", "cmake")] + if tools.is_apple_os(self.settings.os): + if self.settings.os == "Macos": + self.cpp_info.components["mini_chromium_base"].frameworks = ["ApplicationServices", "CoreFoundation", "Foundation", "IOKit", "Security"] + else: # iOS + self.cpp_info.components["mini_chromium_base"].frameworks = ["CoreFoundation", "CoreGraphics", "CoreText", "Foundation", "Security"] + + 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): + self.cpp_info.components["util"].libs.append("mig_output") + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["util"].libs.append("compat") + self.cpp_info.components["util"].requires.append("linux-syscall-support::linux-syscall-support") + if self.settings.os == "Windows": + self.cpp_info.components["util"].system_libs.extend(["dbghelp", "rpcrt4"]) + if self.options.http_transport == "libcurl": + self.cpp_info.components["util"].requires.append("libcurl::libcurl") + elif self.options.get_safe("with_tls") == "openssl": + self.cpp_info.components["util"].requires.append("openssl::openssl") + if self.settings.os == "Macos": + self.cpp_info.components["util"].frameworks.extend(["CoreFoundation", "Foundation", "IOKit"]) + self.cpp_info.components["util"].system_libs.append("bsm") + + self.cpp_info.components["client_common"].libs = ["client_common"] + self.cpp_info.components["client_common"].requires = ["util", "mini_chromium_base"] + + self.cpp_info.components["client"].libs = ["client"] + self.cpp_info.components["client"].requires = ["util", "mini_chromium_base", "client_common"] + if self.settings.os == "Windows": + self.cpp_info.components["client"].system_libs.append("rpcrt4") + + self.cpp_info.components["context"].libs = ["context"] + self.cpp_info.components["context"].requires = ["util"] + + 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): + self.cpp_info.components["snapshot"].frameworks.extend(["OpenCL"]) + + self.cpp_info.components["format"].libs = ["format"] + self.cpp_info.components["format"].requires = ["snapshot", "mini_chromium_base", "util"] + + 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"] + + 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["handler_common"].libs = ["handler_common"] + self.cpp_info.components["handler_common"].requires = ["client_common", "snapshot", "util"] + extra_handler_common_req + + self.cpp_info.components["handler"].libs = ["handler"] + 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 new file mode 100644 index 0000000000000..fa25c29585519 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000000000..dbe02c56b50c4 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch @@ -0,0 +1,70 @@ +--- 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 new file mode 100644 index 0000000000000..3d2fca3db7ec9 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000000000..849ed17734c92 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch @@ -0,0 +1,14 @@ +--- 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 new file mode 100644 index 0000000000000..ae7425fb742f1 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch @@ -0,0 +1,40 @@ +--- 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 new file mode 100644 index 0000000000000..be8423bbda8e1 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch @@ -0,0 +1,96 @@ +--- 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/patches/cci.20210507-0007-use-system-zlib.patch b/recipes/crashpad/all/patches/cci.20210507-0007-use-system-zlib.patch new file mode 100644 index 0000000000000..0df79c38f0b66 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20210507-0007-use-system-zlib.patch @@ -0,0 +1,11 @@ +--- third_party/zlib/BUILD.gn ++++ third_party/zlib/BUILD.gn +@@ -19,7 +19,7 @@ + } else if (!crashpad_is_win && !crashpad_is_fuchsia) { + zlib_source = "system" + } else if (crashpad_is_standalone) { +- zlib_source = "embedded" ++ zlib_source = "system" + } else if (crashpad_is_external) { + zlib_source = "external_with_embedded_build" + } diff --git a/recipes/crashpad/all/patches/cci.20220219-0001-fix-openssl-link-order.patch b/recipes/crashpad/all/patches/cci.20220219-0001-fix-openssl-link-order.patch new file mode 100644 index 0000000000000..06ec740db0f7c --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0001-fix-openssl-link-order.patch @@ -0,0 +1,22 @@ +--- util/BUILD.gn ++++ util/BUILD.gn +@@ -662,8 +662,8 @@ crashpad_static_library("net") { + deps += [ "//third_party/boringssl" ] + } else { + libs = [ +- "crypto", + "ssl", ++ "crypto", + ] + } + } +@@ -708,8 +708,8 @@ if (!crashpad_is_android && !crashpad_is_ios) { + deps += [ "//third_party/boringssl" ] + } else { + libs = [ +- "crypto", + "ssl", ++ "crypto", + ] + } + } diff --git a/recipes/crashpad/all/patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch b/recipes/crashpad/all/patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch new file mode 100644 index 0000000000000..574534a76af5c --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch @@ -0,0 +1,50 @@ +--- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn ++++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn +@@ -108,7 +108,7 @@ config("release") { + } + } 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. +@@ -118,9 +118,9 @@ config("release") { + ldflags = [ + "/OPT:ICF", + "/OPT:REF", +- "/LTCG", ++ + ] +- arflags = [ "/LTCG" ] ++ arflags = [ ] + } + } + +@@ -133,7 +133,7 @@ config("default") { + cflags = [ + "-Wall", + "-Wendif-labels", +- "-Werror", ++ + "-Wextra", + "-Wextra-semi", + "-Wheader-hygiene", +@@ -244,7 +244,7 @@ config("default") { + "/D_UNICODE", + "/FS", + "/W4", +- "/WX", ++ + "/Zi", + "/bigobj", # Support larger number of sections in obj file. + "/wd4100", # Unreferenced formal parameter. +@@ -329,7 +329,7 @@ config("default") { + + 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", diff --git a/recipes/crashpad/all/patches/cci.20220219-0003-compilers-from-env.patch b/recipes/crashpad/all/patches/cci.20220219-0003-compilers-from-env.patch new file mode 100644 index 0000000000000..64627104d299c --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0003-compilers-from-env.patch @@ -0,0 +1,13 @@ +--- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn ++++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn +@@ -437,8 +437,8 @@ toolchain("gcc_like_toolchain") { + ld = cxx + ar = ndk_bin_dir + tool_prefix + "-ar" + } else { +- cc = "clang" +- cxx = "clang++" ++ cc = getenv("CC") ++ cxx = getenv("CXX") + asm = cxx + ld = cxx + diff --git a/recipes/crashpad/all/patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch b/recipes/crashpad/all/patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch new file mode 100644 index 0000000000000..00b30221ee0a7 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch @@ -0,0 +1,14 @@ +--- 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 + #elif defined(CRASHPAD_LSS_SOURCE_FUCHSIA) + #include "../../../../third_party/linux-syscall-support/linux_syscall_support.h" + #else diff --git a/recipes/crashpad/all/patches/cci.20220219-0005-allow-all-archs.patch b/recipes/crashpad/all/patches/cci.20220219-0005-allow-all-archs.patch new file mode 100644 index 0000000000000..436e4b67ae520 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0005-allow-all-archs.patch @@ -0,0 +1,40 @@ +--- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn ++++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn +@@ -198,7 +198,7 @@ config("default") { + "arm64", + ] + } else { +- assert(false, "Unsupported architecture") ++ print("Unknown architecture -> assume conan knows how to handle it") + } + } + +@@ -278,7 +278,7 @@ config("default") { + "-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 +@@ -312,7 +312,7 @@ config("default") { + } 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 +@@ -143,7 +143,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.20220219-0006-mini_chromium-win_helper-py3.patch b/recipes/crashpad/all/patches/cci.20220219-0006-mini_chromium-win_helper-py3.patch new file mode 100644 index 0000000000000..311514add9153 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0006-mini_chromium-win_helper-py3.patch @@ -0,0 +1,96 @@ +--- 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 @@ def _FormatAsEnvironmentBlock(envvar_dict): + 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 @@ def _GenerateEnvironmentFiles(install_dir, out_dir, script_path): + 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 @@ def _GenerateEnvironmentFiles(install_dir, out_dir, script_path): + 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 @@ class WinTool(object): + 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 @@ class WinTool(object): + 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): +@@ -185,7 +188,7 @@ class WinTool(object): + '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')) +@@ -216,7 +219,7 @@ class WinTool(object): + 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/patches/cci.20220219-0007-static-lib-tool_support.patch b/recipes/crashpad/all/patches/cci.20220219-0007-static-lib-tool_support.patch new file mode 100644 index 0000000000000..c2f0a14e65754 --- /dev/null +++ b/recipes/crashpad/all/patches/cci.20220219-0007-static-lib-tool_support.patch @@ -0,0 +1,13 @@ +diff --git a/tools/BUILD.gn b/tools/BUILD.gn +index 4069e070..316d7ee7 100644 +--- a/tools/BUILD.gn ++++ b/tools/BUILD.gn +@@ -14,7 +14,7 @@ + + import("../build/crashpad_buildconfig.gni") + +-source_set("tool_support") { ++static_library("tool_support") { + sources = [ + "tool_support.cc", + "tool_support.h", diff --git a/recipes/crashpad/all/test_package/CMakeLists.txt b/recipes/crashpad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c1d84c7e3d82 --- /dev/null +++ b/recipes/crashpad/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +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 new file mode 100644 index 0000000000000..a0d87c14b0333 --- /dev/null +++ b/recipes/crashpad/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + 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) + 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) diff --git a/recipes/crashpad/all/test_package/test_package.cpp b/recipes/crashpad/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..923a0cf8888d3 --- /dev/null +++ b/recipes/crashpad/all/test_package/test_package.cpp @@ -0,0 +1,54 @@ +#include +#include +#include + +#ifdef _WIN32 +#include +#endif + +#include "client/crashpad_client.h" +#include "client/settings.h" + +#include "client/crash_report_database.h" + +bool startCrashpad(const base::FilePath &db, + const base::FilePath &handler) { + std::string url("http://localhost"); + std::map annotations; + std::vector arguments; + + crashpad::CrashpadClient client; + return client.StartHandler( + handler, + db, + db, + url, + annotations, + arguments, + true, + false + ); +} + +int main(int argc, char* argv[]) { + if (argc != 3) { + return 2; + } + +#ifdef _WIN32 + wchar_t ws[1024]; + swprintf(ws, 1024, L"%hs", argv[1]); + base::FilePath db(ws); + swprintf(ws, 1024, L"%hs", argv[2]); + base::FilePath handler(ws); +#else + base::FilePath db(argv[1]); + base::FilePath handler(argv[2]); +#endif + + // Test availability of this function. + auto database = crashpad::CrashReportDatabase::Initialize(db); + (void) database; /* Avoid warning about unused variable */ + + return startCrashpad(db, handler) ? 0 : 1; +} diff --git a/recipes/crashpad/config.yml b/recipes/crashpad/config.yml new file mode 100644 index 0000000000000..104465b6c7315 --- /dev/null +++ b/recipes/crashpad/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210507": + folder: all + "cci.20220219": + folder: all diff --git a/recipes/crc32c/all/conandata.yml b/recipes/crc32c/all/conandata.yml new file mode 100644 index 0000000000000..58186e6d3f210 --- /dev/null +++ b/recipes/crc32c/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.2": + url: "https://github.com/google/crc32c/archive/1.1.2.tar.gz" + sha256: "ac07840513072b7fcebda6e821068aa04889018f24e10e46181068fb214d7e56" + "1.1.1": + url: https://github.com/google/crc32c/archive/refs/tags/1.1.1.tar.gz + sha256: "a6533f45b1670b5d59b38a514d82b09c6fb70cc1050467220216335e873074e8" diff --git a/recipes/crc32c/all/conanfile.py b/recipes/crc32c/all/conanfile.py new file mode 100644 index 0000000000000..826861fd301fd --- /dev/null +++ b/recipes/crc32c/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class crc32cConan(ConanFile): + name = "crc32c" + description = "CRC32C implementation with support for CPU-specific acceleration instructions" + topics = ("crc32c", "crc") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/crc32c" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "11" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.variables["CRC32C_BUILD_TESTS"] = False + tc.variables["CRC32C_BUILD_BENCHMARKS"] = False + tc.variables["CRC32C_INSTALL"] = True + tc.variables["CRC32C_USE_GLOG"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Crc32c") + self.cpp_info.set_property("cmake_target_name", "Crc32c::crc32c") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["_crc32c"].libs = ["crc32c"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Crc32c" + self.cpp_info.names["cmake_find_package_multi"] = "Crc32c" + self.cpp_info.components["_crc32c"].names["cmake_find_package"] = "crc32c" + self.cpp_info.components["_crc32c"].names["cmake_find_package_multi"] = "crc32c" + self.cpp_info.components["_crc32c"].set_property("cmake_target_name", "Crc32c::crc32c") diff --git a/recipes/crc32c/all/test_package/CMakeLists.txt b/recipes/crc32c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4bb96eb2a3d2f --- /dev/null +++ b/recipes/crc32c/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Crc32c CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Crc32c::crc32c) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/crc32c/all/test_package/conanfile.py b/recipes/crc32c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/crc32c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/crc32c/all/test_package/test_package.cpp b/recipes/crc32c/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..53499dc9c43b3 --- /dev/null +++ b/recipes/crc32c/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include "crc32c/crc32c.h" + + +int main() { + const std::uint8_t buffer[] = {0, 0, 0, 0}; + std::uint32_t result; + + // Process a raw buffer. + result = crc32c::Crc32c(buffer, 4); + std::cout << result << '\n'; + + // Process a std::string. + std::string string; + string.resize(4); + result = crc32c::Crc32c(string); + std::cout << result << '\n'; + + return 0; +} diff --git a/recipes/crc32c/all/test_v1_package/CMakeLists.txt b/recipes/crc32c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/crc32c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/crc32c/all/test_v1_package/conanfile.py b/recipes/crc32c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..968e0fcd39136 --- /dev/null +++ b/recipes/crc32c/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(".", "bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/crc32c/config.yml b/recipes/crc32c/config.yml new file mode 100644 index 0000000000000..be8fcc08d267b --- /dev/null +++ b/recipes/crc32c/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.2": + folder: "all" + "1.1.1": + folder: "all" diff --git a/recipes/crc_cpp/all/conandata.yml b/recipes/crc_cpp/all/conandata.yml new file mode 100644 index 0000000000000..09ada265a5657 --- /dev/null +++ b/recipes/crc_cpp/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.0": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "035ed616e0662eddbe7db7c920faaef99bbeb8953ebf98c3bb76cb81a2c4de2b" + "1.0.1": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.1.tar.gz" + sha256: "865a0e110bf7e94061ceef1683947a7788b54f932c7ce3848edc89d36e1aea26" + "1.1.0": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.1.0.tar.gz" + sha256: "50e46e3c44eb39809f6697b253f7b36c089642d7b7f2ebe2f75adf23c50676be" + "1.2.0": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.2.0.tar.gz" + sha256: "508a609d9ef12c3088ed17a8ed820c965161a36dd90738c7358333fbfbe96af5" diff --git a/recipes/crc_cpp/all/conanfile.py b/recipes/crc_cpp/all/conanfile.py new file mode 100644 index 0000000000000..4ccb993ef97a2 --- /dev/null +++ b/recipes/crc_cpp/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile, tools +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class Crc_CppConan(ConanFile): + name = "crc_cpp" + description = "A header only constexpr / compile time small-table based CRC library for C++17 and newer" + topics = "crc_cpp", "crc", "constexpr", "cpp17", "cpp20", "header-only" + settings = "compiler", "os" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AshleyRoll/crc_cpp" + license = "MIT" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _supported_compiler(self): + compiler = str(self.settings.compiler) + version = Version(self.settings.compiler.version) + if compiler == "Visual Studio" and version >= "15": + return True + elif compiler == "gcc" and version >= "9": + return True + elif compiler == "clang" and version >= "5": + return True + elif compiler == "apple-clang" and version >= "10": + return True + else: + self.output.warn("{} recipe lacks information about the {} compiler standard version support".format(self.name, compiler)) + return False + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.build.check_min_cppstd(self, "17") + if not self._supported_compiler: + raise ConanInvalidConfiguration("crc_cpp: Unsupported compiler: {}-{} " + "Minimum C++17 constexpr features required.".format(self.settings.compiler, self.settings.compiler.version)) + def source(self): + tools.files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/crc_cpp/all/test_package/CMakeLists.txt b/recipes/crc_cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d41bc6dd30265 --- /dev/null +++ b/recipes/crc_cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/crc_cpp/all/test_package/conanfile.py b/recipes/crc_cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..34a0bcae95438 --- /dev/null +++ b/recipes/crc_cpp/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile, tools +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.build.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/crc_cpp/all/test_package/test_package.cpp b/recipes/crc_cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8ff6f35a02302 --- /dev/null +++ b/recipes/crc_cpp/all/test_package/test_package.cpp @@ -0,0 +1,35 @@ +#include +#include +#include + +#include "crc_cpp.h" + +using namespace crc_cpp; + +[[nodiscard]] auto compute_crc32(std::vector const &message) +{ + crc_cpp::crc32 crc; + + for(auto c : message) { + crc.update(c); + } + + return crc.final(); +} + + +int main() +{ + std::cout << "Smoke Testing crc_cpp with CRC32\n"; + + std::vector const message{'1', '2', '3', '4', '5', '6', '7', '8', '9'}; + + auto const result = compute_crc32(message); + if(result == 0xCBF43926) { + std::cout << "Success!\n"; + return 0; + } else { + std::cout << "Failed!??\n"; + return -1; + } +} diff --git a/recipes/crc_cpp/config.yml b/recipes/crc_cpp/config.yml new file mode 100644 index 0000000000000..0d463a277e732 --- /dev/null +++ b/recipes/crc_cpp/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.0": + folder: "all" + "1.0.1": + folder: "all" + "1.1.0": + folder: "all" + "1.2.0": + folder: "all" diff --git a/recipes/create-dmg/all/conandata.yml b/recipes/create-dmg/all/conandata.yml new file mode 100644 index 0000000000000..3bee38ab2012d --- /dev/null +++ b/recipes/create-dmg/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.1.0": + url: "https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.1.0.tar.gz" + sha256: "d50e14a00b73a3f040732b4cfa11361f5786521719059ce2dfcccd9088d3bf32" + "1.0.10": + url: "https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.0.10.tar.gz" + sha256: "8fd43498988f6d334d483faf4e4a330a25228784995d72c57e4565967d09e6ab" +patches: + "1.1.0": + - patch_file: "patches/0001-change-share-to-res.patch" + patch_type: "conan" + patch_description: "Change share folder to res" diff --git a/recipes/create-dmg/all/conanfile.py b/recipes/create-dmg/all/conanfile.py new file mode 100644 index 0000000000000..52e6fe840c8e2 --- /dev/null +++ b/recipes/create-dmg/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class CreateDmgConan(ConanFile): + name = "create-dmg" + description = "A shell script to build fancy DMGs" + license = "MIT" + topics = "command-line", "dmg" + homepage = "https://github.com/create-dmg/create-dmg" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + 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.os != "Macos": + raise ConanInvalidConfiguration(f"{self.name} works only on MacOS") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="create-dmg", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "res", "create-dmg", "support"), src=os.path.join(self.source_folder, "support")) + + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/create-dmg/all/patches/0001-change-share-to-res.patch b/recipes/create-dmg/all/patches/0001-change-share-to-res.patch new file mode 100644 index 0000000000000..c85d9062516ed --- /dev/null +++ b/recipes/create-dmg/all/patches/0001-change-share-to-res.patch @@ -0,0 +1,13 @@ +diff --git a/create-dmg b/create-dmg +index 4a9715e..4181ce4 100755 +--- a/create-dmg ++++ b/create-dmg +@@ -248,7 +248,7 @@ else + # We're running inside an installed location + bin_dir="$SCRIPT_DIR" + prefix_dir=$(dirname "$bin_dir") +- CDMG_SUPPORT_DIR="$prefix_dir/share/create-dmg/support" ++ CDMG_SUPPORT_DIR="$prefix_dir/res" + fi + + if [[ -z "$VOLUME_NAME" ]]; then diff --git a/recipes/create-dmg/all/test_package/conanfile.py b/recipes/create-dmg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5618bda930886 --- /dev/null +++ b/recipes/create-dmg/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("create-dmg --version") diff --git a/recipes/create-dmg/all/test_v1_package/conanfile.py b/recipes/create-dmg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3d9d911ea4f98 --- /dev/null +++ b/recipes/create-dmg/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile +from conan.tools.build import can_run + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if can_run(self): + self.run("create-dmg --version", run_environment=True) diff --git a/recipes/create-dmg/config.yml b/recipes/create-dmg/config.yml new file mode 100644 index 0000000000000..d8aafe5a32208 --- /dev/null +++ b/recipes/create-dmg/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.0.10": + folder: all diff --git a/recipes/croncpp/all/CMakeLists.txt b/recipes/croncpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..46247ce0c956e --- /dev/null +++ b/recipes/croncpp/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(conan_wrapper CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_CXX_STANDARD 11) + +add_subdirectory(source_subfolder) diff --git a/recipes/croncpp/all/conandata.yml b/recipes/croncpp/all/conandata.yml new file mode 100644 index 0000000000000..7f25de8a50772 --- /dev/null +++ b/recipes/croncpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220503": + url: "https://github.com/mariusbancila/croncpp/archive/5c28f410db1af9507ef8469c9796a7070e5e8e2e.tar.gz" + sha256: "cabc480c78ebf12b11bd9fcd705a7ecb1c85ac88a8c9debe8de67f30abd808a8" diff --git a/recipes/croncpp/all/conanfile.py b/recipes/croncpp/all/conanfile.py new file mode 100644 index 0000000000000..cecf595a5a249 --- /dev/null +++ b/recipes/croncpp/all/conanfile.py @@ -0,0 +1,45 @@ +import os +import functools +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + +class CroncppConan(ConanFile): + name = "croncpp" + description = "A C++11/14/17 header-only cross-platform library for handling CRON expressions" + topics = ("cron", "header-only") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mariusbancila/croncpp/" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def package(self): + self.copy("LICENSE*", "licenses", self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/croncpp/all/test_package/CMakeLists.txt b/recipes/croncpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1bb4c146bf257 --- /dev/null +++ b/recipes/croncpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(croncpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} croncpp::croncpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/croncpp/all/test_package/conanfile.py b/recipes/croncpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6cae150e6701a --- /dev/null +++ b/recipes/croncpp/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class CroncppConan(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/croncpp/all/test_package/test_package.cpp b/recipes/croncpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f8b277d966c59 --- /dev/null +++ b/recipes/croncpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include "croncpp.h" + +int main(int argc, const char** argv) { + try { + auto cron = cron::make_cron("* 0/5 * * * ?"); + + auto now = std::time(0); + auto next = cron::cron_next(cron, now); + std::cout << (next - now) << "[sec]" << std::endl; + return 0; + } catch (cron::bad_cronexpr const& ex) { + std::cerr << ex.what() << std::endl; + } + return -1; +} diff --git a/recipes/croncpp/config.yml b/recipes/croncpp/config.yml new file mode 100644 index 0000000000000..162ec03638ac6 --- /dev/null +++ b/recipes/croncpp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220503": + folder: "all" diff --git a/recipes/crow/all/conandata.yml b/recipes/crow/all/conandata.yml new file mode 100644 index 0000000000000..3ff1e1f3ee526 --- /dev/null +++ b/recipes/crow/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.1": + sha256: 140ca4a4d75ce5996cb103155580cb13b0b27082d1efbc331000a34af55b4390 + url: https://github.com/ipkn/crow/archive/v0.1.tar.gz +patches: + "0.1": + - patch_file: "patches/001-fix-cmake-errors.patch" + base_path: "source_subfolder" diff --git a/recipes/crow/all/conanfile.py b/recipes/crow/all/conanfile.py new file mode 100644 index 0000000000000..82aff1431b37c --- /dev/null +++ b/recipes/crow/all/conanfile.py @@ -0,0 +1,46 @@ +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration +import os + +class CrowConan(ConanFile): + name = "crow" + homepage = "https://github.com/ipkn/crow" + description = "Crow is C++ microframework for web. (inspired by Python Flask)" + topics = ("conan", "web", "microframework", "header-only") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "arch", "build_type" + exports_sources = ["patches/*"] + license = "BSD-3-Clause" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("boost/1.69.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "crow-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def build(self): + if tools.Version(self.deps_cpp_info["boost"].version) >= "1.70.0": + raise ConanInvalidConfiguration("Crow requires Boost <1.70.0") + + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = CMake(self) + cmake.configure(source_folder=self._source_subfolder) + cmake.build() + + def package(self): + self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst=os.path.join("include", "crow"), src="amalgamate") + + def package_id(self): + self.info.header_only() + + def package_info(self): + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/crow/all/patches/001-fix-cmake-errors.patch b/recipes/crow/all/patches/001-fix-cmake-errors.patch new file mode 100644 index 0000000000000..971b1a1edee80 --- /dev/null +++ b/recipes/crow/all/patches/001-fix-cmake-errors.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40d53f8b420c70c002134996842c46f5a84e181b..5dc9bfdd063f81466c2072a6a308e998f4fe7d50 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,15 +48,15 @@ include_directories("${PROJECT_INCLUDE_DIR}") + include_directories("${PROJECT_SOURCE_DIR}") + + #add_subdirectory(src) +-add_subdirectory(examples) ++#add_subdirectory(examples) + + if (MSVC) + else() +- add_subdirectory(tests) ++ #add_subdirectory(tests) + +- enable_testing() +- add_test(NAME crow_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/unittest) +- add_test(NAME template_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/template/test.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/template) ++ #enable_testing() ++ #add_test(NAME crow_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/unittest) ++ #add_test(NAME template_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/template/test.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/template) + + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/amalgamate) + diff --git a/recipes/crow/all/test_package/CMakeLists.txt b/recipes/crow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/crow/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/crow/all/test_package/conanfile.py b/recipes/crow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/crow/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/crow/all/test_package/test_package.cpp b/recipes/crow/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..656c7ae0d444f --- /dev/null +++ b/recipes/crow/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "crow/crow_all.h" + +int main() +{ + crow::SimpleApp app; + + CROW_ROUTE(app, "/") + ([]() { + return "Hello world!"; + }); + + app.port(18080); +} diff --git a/recipes/crow/config.yml b/recipes/crow/config.yml new file mode 100644 index 0000000000000..7a80eeb3e9b32 --- /dev/null +++ b/recipes/crow/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1": + folder: all diff --git a/recipes/crowcpp-crow/all/conandata.yml b/recipes/crowcpp-crow/all/conandata.yml new file mode 100644 index 0000000000000..6e89143bb07c8 --- /dev/null +++ b/recipes/crowcpp-crow/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.0+5": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.0+5.tar.gz" + sha256: "4eb1b80b97dda4a3c4f613c581c734e0221911c88ff859ed679bda3dd5d7b319" + "1.0+3": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.0+3.tar.gz" + sha256: "509248e7bd30dad725cfb66c383405a8bdc59d1fe7f8f2b464d459444047855e" + "1.0+1": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.0+1.tar.gz" + sha256: "0763342f1d6bfc8a58c99647bd2a5ac9fcb278523a662a20b560e42e5c6c8474" + "0.3+4": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v0.3+4.tar.gz" + sha256: "539622451c1c9be4329d1c260d4014db14ef399b6bc170c7dd0d72b33cba88b0" + "0.3+3": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v0.3+3.tar.gz" + sha256: "d6d8019ec647dc199e026e847f6cdf714afea29d1c202e3b2a9cde929bfd54b2" + "0.3+2": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v0.3+2.tar.gz" + sha256: "982fe978c113506aefe77c413befb3ab21fffb09d9bdf287ec8e8ba59bd786e7" + "0.3": + url: "https://github.com/CrowCpp/Crow/archive/refs/tags/v0.3.tar.gz" + sha256: "95538db88fba73c0bc87bbc40b62dcf488012c133a895634ade015009ebb4f25" + "0.2": + url: "https://github.com/CrowCpp/Crow/archive/refs/tags/0.2.tar.gz" + sha256: "c419767f0a336f2add71fc8b311ad95434d59601fb8b0e5ba3048407d85d0a71" +patches: + "0.2": + - patch_file: "patches/0.2/0001-normalize-buildsystem.patch" + patch_description: "Skip tests and examples from build" + patch_type: "conan" + - patch_file: "patches/0.2/0002-replace-uint.patch" + patch_description: "Replace uint (not default type) with unsigned" + patch_type: "bugfix" + patch_source: "https://github.com/CrowCpp/Crow/commit/5fe3a45793604a50f5c9086909dfa1b50dfa3e88" diff --git a/recipes/crowcpp-crow/all/conanfile.py b/recipes/crowcpp-crow/all/conanfile.py new file mode 100644 index 0000000000000..001767af2d0fd --- /dev/null +++ b/recipes/crowcpp-crow/all/conanfile.py @@ -0,0 +1,135 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class CrowConan(ConanFile): + name = "crowcpp-crow" + description = "Crow is a C++ microframework for running web services." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://crowcpp.org/" + topics = ("web", "microframework", "header-only") + settings = "os", "compiler", "arch", "build_type" + options = { + "amalgamation": [True, False], + "with_ssl": [True, False], + "with_compression": [True, False], + } + default_options = { + "amalgamation": False, + "with_ssl": False, + "with_compression": False, + } + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if Version(self.version) < "1.0": + del self.options.with_ssl + del self.options.with_compression + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0") + if self.version == "0.2": + self.requires("openssl/1.1.1s") + if Version(self.version) >= "1.0": + if self.options.with_ssl: + self.requires("openssl/1.1.1s") + if self.options.with_compression: + self.requires("zlib/1.2.13") + + def package_id(self): + self.info.settings.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 generate(self): + if self.options.amalgamation: + tc = CMakeToolchain(self) + if Version(self.version) < "1.0": + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTING"] = False + else: + tc.variables["CROW_BUILD_EXAMPLES"] = False + tc.variables["CROW_BUILD_TESTS"] = False + tc.variables["CROW_AMALGAMATE"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + + if self.options.amalgamation: + cmake = CMake(self) + cmake.configure() + if Version(self.version) < "1.0": + cmake.build(target="amalgamation") + else: + cmake.build(target="crow_amalgamated") + + + def package(self): + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + if self.options.amalgamation: + copy( + self, + pattern="crow_all.h", + dst=os.path.join(self.package_folder, "include"), + src=self.build_folder, + ) + 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 = [] + self.cpp_info.libdirs = [] + + self.cpp_info.requires.append("boost::headers") + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread"] + + self.cpp_info.set_property("cmake_file_name", "Crow") + self.cpp_info.set_property("cmake_target_name", "Crow::Crow") + + if Version(self.version) >= "1.0": + if self.options.with_ssl: + self.cpp_info.defines.append("CROW_ENABLE_SSL") + self.cpp_info.requires.append("OpenSSL::ssl") + if self.options.with_compression: + self.cpp_info.defines.append("CROW_ENABLE_COMPRESSION") + self.cpp_info.requires.append("zlib::zlib") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Crow" + self.cpp_info.names["cmake_find_package_multi"] = "Crow" + diff --git a/recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch b/recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch new file mode 100644 index 0000000000000..67c9be1d0235b --- /dev/null +++ b/recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f00e9a9..61961da 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,7 @@ + cmake_minimum_required(VERSION 3.15) + project (crow_all) + ++if(BUILD_TESTING) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") + + find_package(Tcmalloc) +@@ -43,15 +44,17 @@ include_directories("${PROJECT_INCLUDE_DIR}") + include_directories("${PROJECT_SOURCE_DIR}") + + add_subdirectory(examples) ++endif() + + if (MSVC) + else() ++ if (BUILD_TESTING) + add_subdirectory(tests) + + enable_testing() + add_test(NAME crow_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/unittest) + add_test(NAME template_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/template/test.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/template) +- ++ endif() + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/crow_all.h + COMMAND python ${PROJECT_SOURCE_DIR}/scripts/merge_all.py diff --git a/recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch b/recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch new file mode 100644 index 0000000000000..c6f95ea173f09 --- /dev/null +++ b/recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch @@ -0,0 +1,26 @@ +diff --git a/include/crow/http_connection.h b/include/crow/http_connection.h +index 2216687..04a992d 100644 +--- a/include/crow/http_connection.h ++++ b/include/crow/http_connection.h +@@ -627,7 +627,7 @@ namespace crow + + boost::array buffer_; + +- const uint res_stream_threshold_ = 1048576; ++ const unsigned res_stream_threshold_ = 1048576; + + HTTPParser parser_; + request req_; +diff --git a/include/crow/multipart.h b/include/crow/multipart.h +index 7deb8d4..7b63c20 100644 +--- a/include/crow/multipart.h ++++ b/include/crow/multipart.h +@@ -48,7 +48,7 @@ namespace crow + std::stringstream str; + std::string delimiter = dd + boundary; + +- for (uint i=0 ; i= min_new_capacity) + return true; + +- size_t new_capacity = min_new_capacity; ++ ptr_bits_t new_capacity = min_new_capacity; + if ((grow_hint) && (!math::is_power_of_2(new_capacity))) + new_capacity = math::next_pow2(new_capacity); + +--- inc/crn_decomp.h ++++ inc/crn_decomp.h +@@ -373,8 +373,8 @@ namespace crnd + enum eClear { cClear }; + + const uint32 cIntBits = 32U; +- +-#ifdef _WIN64 ++ ++#if defined(_WIN64) || defined(_LP64) + typedef uint64 ptr_bits; + #else + #ifdef __x86_64__ diff --git a/recipes/crunch/all/patches/002_fix_clang_inline.patch b/recipes/crunch/all/patches/002_fix_clang_inline.patch new file mode 100644 index 0000000000000..1b98af617c835 --- /dev/null +++ b/recipes/crunch/all/patches/002_fix_clang_inline.patch @@ -0,0 +1,11 @@ +--- crnlib/crn_core.h ++++ crnlib/crn_core.h +@@ -82,7 +82,7 @@ + + #define CRNLIB_RESTRICT + +- #define CRNLIB_FORCE_INLINE inline __attribute__((__always_inline__,__gnu_inline__)) ++ #define CRNLIB_FORCE_INLINE inline __attribute__((always_inline)) + + #define CRNLIB_INT64_FORMAT_SPECIFIER "%lli" + #define CRNLIB_UINT64_FORMAT_SPECIFIER "%llu" diff --git a/recipes/crunch/all/patches/003_fix_missing_cast.patch b/recipes/crunch/all/patches/003_fix_missing_cast.patch new file mode 100644 index 0000000000000..edda0c6236989 --- /dev/null +++ b/recipes/crunch/all/patches/003_fix_missing_cast.patch @@ -0,0 +1,22 @@ +--- crnlib/crn_miniz.cpp ++++ crnlib/crn_miniz.cpp +@@ -1892,7 +1892,7 @@ + *pLen_out = out_buf.m_size-41; + { + mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, +- 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0, ++ 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,(mz_uint8)"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0, + (mz_uint8)(*pLen_out>>24),(mz_uint8)(*pLen_out>>16),(mz_uint8)(*pLen_out>>8),(mz_uint8)*pLen_out,0x49,0x44,0x41,0x54}; + c=(mz_uint32)mz_crc32(MZ_CRC32_INIT,pnghdr+12,17); for (i=0; i<4; ++i, c<<=8) ((mz_uint8*)(pnghdr+29))[i]=(mz_uint8)(c>>24); + memcpy(out_buf.m_pBuf, pnghdr, 41); +--- crnlib/crn_stb_image.cpp ++++ crnlib/crn_stb_image.cpp +@@ -3776,7 +3776,7 @@ + if (c1 != 2 || c2 != 2 || (len & 0x80)) { + // not run-length encoded, so we have to actually use THIS data as a decoded + // pixel (note this can't be a valid pixel--one of RGB must be >= 128) +- stbi_uc rgbe[4] = { c1,c2,len, get8(s) }; ++ stbi_uc rgbe[4] = { (stbi_uc)c1, (stbi_uc)c2, (stbi_uc)len, (stbi_uc)get8(s) }; + hdr_convert(hdr_data, rgbe, req_comp); + i = 1; + j = 0; diff --git a/recipes/crunch/all/test_package/CMakeLists.txt b/recipes/crunch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bbee70e16ac5c --- /dev/null +++ b/recipes/crunch/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(crunch REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE crunch::crunch) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/crunch/all/test_package/conanfile.py b/recipes/crunch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7a2122729677a --- /dev/null +++ b/recipes/crunch/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if 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 new file mode 100644 index 0000000000000000000000000000000000000000..11640c7488fb114127f869572d7ffec132e77746 GIT binary patch literal 177424 zcmV)7K*zs{P)b{WyyIZw$}P$?~|Ez>27vYyoe$-l%W|7Y|jApvke&j<$g8%GPZ2YcqB?9 zMT(d1s;;ie%yV{pYxyB|w%|gex-N-Rxi9g>x(2^~_n&}`9Ptr6i*JDhAG`k!3H23u zpG@g9@y`GOoqS_|kUj%mgF$Y=NB2AGP4Jw)_I&^D5C8n@-~8sE-~H~%$8$gb$A7c^ z`@i`S^6EeT-N$YI?0#d?N8G3b?s=X4VIx0(c=h&jx!<){actT5j0@_u>ND^&@)b}Z z0K*@V=imsM*r3jf zqx3^`ItVOW4hDV?!z{bY5-)400IVu5(Eke zV1h8h05d_{LECZc*p3f(Je_IJZUb!u0Yz4c7Yz+ml_b>qLj!gi2!r7bmXEOGmJiR_ zbGonb)$vPsVV7#AstSuC1r;XZy)HoN098BL|%6d9-`>JbF$a9d{5C?5Rv7UCh|_ zyKOw|`>R)%hs(Iz_lNs^-^Uo-hN?KmwvDPy+Q!%}+jglg>b>em$ zH-o^9ATR)?(?$cGq#@G*48}1Mn4}XZ1`q%t3IG!#LJ2ikJNAq2?(}fa{a$w)YsWS+ zcGiGODpmmu*hD2j90ExbG8ou!;3UE9wBw{3>Y*Cq{opI<&8XMAUS0H1x*v5{ybm{W z6bG?MdsPkA1_&+K?s&rOZu@r3>oLD;KdB#q=XfSgJnh?@$Khknp1x&HAB06wBngnJ zvVKX$Xd_%NsV6u1sEVepaB8_n*6y+fX~0>4Blw`M7V2w2;NuKkAMF5&wl#T zUw-@k*Z=(c-~Q=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%zolJF2n+Z!q*C?fmG z0RVf96sq+Q2u0MZtd?T|ADJFo0G@HZU9Y!~#LJxbO!1h{_vhpJ%foo{j{IRh-^cZG zynMXfk}$L_UM{_fAZ0!t&mW#&e$k$u&X3o1^_3(VT||5YDPT(v(o^Z-W#sVJQ%uC@ z>D=x~cWZWhdU*Ho!w=v7?l-^t-GBVkay%a|Uwrk;Z@&KKufBQri#HEu2gnQ#!X|<%!m`y-{8wLwK`x>+L*rj1V}-DC69WEB&t9 zahQNakd82s6_p%_N0FL6&eq(4m>|@CbOsj2JW4&Byfcx`fuX zLjv5ngQPfiInLn;Ba^NQxVUf>#(&FVREVTF3^6&a>uKqivz(4o`)g;5N|&Z4+N8bG z)gaz9RrKL;N$RI-w{&Y)#XV + +#include "crnlib.h" + +int main(int argc, const char* argv[]) +{ + crn_get_file_type_ext(crn_file_type::cCRNFileTypeCRN); + return 0; +} diff --git a/recipes/crunch/all/test_v1_package/CMakeLists.txt b/recipes/crunch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/crunch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/crunch/all/test_v1_package/conanfile.py b/recipes/crunch/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f8fa68e1e8d17 --- /dev/null +++ b/recipes/crunch/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + 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/crunch/config.yml b/recipes/crunch/config.yml new file mode 100644 index 0000000000000..a5a17b9975e18 --- /dev/null +++ b/recipes/crunch/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190615": + folder: all diff --git a/recipes/cryptopp-pem/all/CMakeLists.txt b/recipes/cryptopp-pem/all/CMakeLists.txt new file mode 100644 index 0000000000000..f36a181c680d3 --- /dev/null +++ b/recipes/cryptopp-pem/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if (WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/cryptopp-pem/all/conandata.yml b/recipes/cryptopp-pem/all/conandata.yml new file mode 100644 index 0000000000000..47bad60429553 --- /dev/null +++ b/recipes/cryptopp-pem/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "8.2.0": + cmake: + url: "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_2_0.tar.gz" + sha256: "f41f6a32b1177c094c3ef97423916713c902d0ac26cbee30ec70b1e8ab0e6fba" + source: + url: "https://github.com/noloader/cryptopp-pem/archive/refs/tags/CRYPTOPP_8_2_0.tar.gz" + sha256: "7da8feaa201e3da79e56bbf1f400f963cb9c5b357f71d395d34cfc91bb3a7e4b" +patches: + "8.2.0": + - patch_file: "patches/fix-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/rename-output-library.patch" + base_path: "source_subfolder" + - patch_file: "patches/link-to-cryptopp.patch" + base_path: "source_subfolder" + - patch_file: "patches/remove-cryptopp-sources-from-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/use-cryptopp-include-from-conan.patch" + base_path: "source_subfolder" diff --git a/recipes/cryptopp-pem/all/conanfile.py b/recipes/cryptopp-pem/all/conanfile.py new file mode 100644 index 0000000000000..12b7d953de0b6 --- /dev/null +++ b/recipes/cryptopp-pem/all/conanfile.py @@ -0,0 +1,161 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import shutil +import textwrap + +required_conan_version = ">=1.43.0" + + +class CryptoPPPEMConan(ConanFile): + name = "cryptopp-pem" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.cryptopp.com/wiki/PEM_Pack" + license = "Unlicense" + description = "The PEM Pack is a partial implementation of message encryption which allows you to read and write PEM encoded keys and parameters, including encrypted private keys." + topics = ("cryptopp", "crypto", "cryptographic", "security", "PEM") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake", "cmake_find_package" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def 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 + + def source(self): + suffix = "CRYPTOPP_{}".format(self.version.replace(".", "_")) + + # Get sources + tools.get(**self.conan_data["sources"][self.version]["source"], + strip_root=True, destination=self._source_subfolder) + + # Get CMakeLists + tools.get(**self.conan_data["sources"][self.version]["cmake"]) + src_folder = os.path.join(self.source_folder, "cryptopp-cmake-" + suffix) + dst_folder = os.path.join(self.source_folder, self._source_subfolder) + shutil.move(os.path.join(src_folder, "CMakeLists.txt"), os.path.join(dst_folder, "CMakeLists.txt")) + shutil.move(os.path.join(src_folder, "cryptopp-config.cmake"), os.path.join(dst_folder, "cryptopp-config.cmake")) + tools.rmdir(src_folder) + + # Get license + tools.download("https://unlicense.org/UNLICENSE", "UNLICENSE", sha256="7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c") + + def _patch_sources(self): + if self.settings.os == "Android" and "ANDROID_NDK_HOME" in os.environ: + shutil.copyfile(os.path.join(tools.get_env("ANDROID_NDK_HOME"), "sources", "android", "cpufeatures", "cpu-features.h"), + os.path.join(self._source_subfolder, "cpu-features.h")) + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + # Honor fPIC option + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "SET(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["BUILD_SHARED"] = self.options.shared + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.definitions["BUILD_DOCUMENTATION"] = False + self._cmake.definitions["USE_INTERMEDIATE_OBJECTS_TARGET"] = False + self._cmake.definitions["DISABLE_ASM"] = True + if self.settings.os == "Android": + self._cmake.definitions["CRYPTOPP_NATIVE_ARCH"] = True + if self.settings.os == "Macos" and self.settings.arch == "armv8" and tools.Version(self.version) <= "8.4.0": + self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-march=armv8-a" + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def requirements(self): + self.requires("cryptopp/" + self.version) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="UNLICENSE", dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "cryptopp-pem-shared": "cryptopp-pem::cryptopp-pem-shared", + "cryptopp-pem-static": "cryptopp-pem::cryptopp-pem-static" + } + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + cmake_target = "cryptopp-pem-shared" if self.options.shared else "cryptopp-pem-static" + self.cpp_info.set_property("cmake_file_name", "cryptopp-pem") + self.cpp_info.set_property("cmake_target_name", cmake_target) + self.cpp_info.set_property("pkg_config_name", "libcryptopp-pem") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["libcryptopp-pem"].libs = tools.collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libcryptopp-pem"].system_libs = ["pthread", "m"] + elif self.settings.os == "SunOS": + self.cpp_info.components["libcryptopp-pem"].system_libs = ["nsl", "socket"] + elif self.settings.os == "Windows": + self.cpp_info.components["libcryptopp-pem"].system_libs = ["ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["pkg_config"] = "libcryptopp-pem" + self.cpp_info.components["libcryptopp-pem"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["libcryptopp-pem"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["libcryptopp-pem"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libcryptopp-pem"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["libcryptopp-pem"].set_property("cmake_target_name", cmake_target) + self.cpp_info.components["libcryptopp-pem"].set_property("pkg_config_name", "libcryptopp-pem") + + self.cpp_info.components["libcryptopp-pem"].requires = [ + "cryptopp::cryptopp", + ] diff --git a/recipes/cryptopp-pem/all/patches/fix-cmake.patch b/recipes/cryptopp-pem/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..139deaef4e3b5 --- /dev/null +++ b/recipes/cryptopp-pem/all/patches/fix-cmake.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -447,7 +447,7 @@ if (MSVC) + if (CMAKE_SYSTEM_VERSION MATCHES "10\\.0.*") + list(APPEND CRYPTOPP_COMPILE_DEFINITIONS "_WIN32_WINNT=0x0A00") + endif () +- list(APPEND CRYPTOPP_COMPILE_OPTIONS "/FI\"winapifamily.h\"") ++ list(APPEND CRYPTOPP_COMPILE_OPTIONS /FIwinapifamily.h) + endif () + + # Enable PIC for all target machines except 32-bit i386 due to register pressures. diff --git a/recipes/cryptopp-pem/all/patches/link-to-cryptopp.patch b/recipes/cryptopp-pem/all/patches/link-to-cryptopp.patch new file mode 100644 index 0000000000000..645f876fac181 --- /dev/null +++ b/recipes/cryptopp-pem/all/patches/link-to-cryptopp.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1101,4 +1101,12 @@ + endif () + ++find_package(cryptopp REQUIRED) ++if (BUILD_STATIC) ++ target_link_libraries(cryptopp-pem-static cryptopp::cryptopp) ++endif () ++if (BUILD_SHARED) ++ target_link_libraries(cryptopp-pem-shared cryptopp::cryptopp) ++endif () ++ + #============================================================================ + # Tests diff --git a/recipes/cryptopp-pem/all/patches/remove-cryptopp-sources-from-cmake.patch b/recipes/cryptopp-pem/all/patches/remove-cryptopp-sources-from-cmake.patch new file mode 100644 index 0000000000000..349b9d33f3b8f --- /dev/null +++ b/recipes/cryptopp-pem/all/patches/remove-cryptopp-sources-from-cmake.patch @@ -0,0 +1,25 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -545,22 +545,6 @@ + # Library sources. You can use the GNUmakefile to generate the list: `make sources`. + # Makefile sorted them at http://github.com/weidai11/cryptopp/pull/426. + file(GLOB cryptopp_SOURCES ${SRC_DIR}/*.cpp) +-list(SORT cryptopp_SOURCES) +-list(REMOVE_ITEM cryptopp_SOURCES +- ${SRC_DIR}/cryptlib.cpp +- ${SRC_DIR}/cpu.cpp +- ${SRC_DIR}/integer.cpp +- ${SRC_DIR}/pch.cpp +- ${SRC_DIR}/simple.cpp +- ${SRC_DIR}/adhoc.cpp +- ${cryptopp_SOURCES_TEST} +- ) +-set(cryptopp_SOURCES +- ${SRC_DIR}/cryptlib.cpp +- ${SRC_DIR}/cpu.cpp +- ${SRC_DIR}/integer.cpp +- ${cryptopp_SOURCES} +- ) + + set(cryptopp_SOURCES_ASM) + diff --git a/recipes/cryptopp-pem/all/patches/rename-output-library.patch b/recipes/cryptopp-pem/all/patches/rename-output-library.patch new file mode 100644 index 0000000000000..5d2755aaee4cb --- /dev/null +++ b/recipes/cryptopp-pem/all/patches/rename-output-library.patch @@ -0,0 +1,136 @@ +--- CMakeLists.txt 2022-05-24 09:38:00.964174000 +0200 ++++ CMakeLists_new.txt 2022-05-24 10:32:47.001894600 +0200 +@@ -1022,22 +1022,22 @@ + endif () + + if (BUILD_STATIC) +- add_library(cryptopp-static STATIC ${cryptopp_LIBRARY_SOURCES}) +- cryptopp_target_compile_properties(cryptopp-static) ++ add_library(cryptopp-pem-static STATIC ${cryptopp_LIBRARY_SOURCES}) ++ cryptopp_target_compile_properties(cryptopp-pem-static) + if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.11") +- target_include_directories(cryptopp-static PUBLIC $ $) ++ target_include_directories(cryptopp-pem-static PUBLIC $ $) + else () +- set_target_properties(cryptopp-static PROPERTIES INCLUDE_DIRECTORIES "$ $") ++ set_target_properties(cryptopp-pem-static PROPERTIES INCLUDE_DIRECTORIES "$ $") + endif () + endif () + + if (BUILD_SHARED) +- add_library(cryptopp-shared SHARED ${cryptopp_LIBRARY_SOURCES}) +- cryptopp_target_compile_properties(cryptopp-shared) ++ add_library(cryptopp-pem-shared SHARED ${cryptopp_LIBRARY_SOURCES}) ++ cryptopp_target_compile_properties(cryptopp-pem-shared) + if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.11") +- target_include_directories(cryptopp-shared PUBLIC $ $) ++ target_include_directories(cryptopp-pem-shared PUBLIC $ $) + else () +- set_target_properties(cryptopp-shared PROPERTIES INCLUDE_DIRECTORIES "$ $") ++ set_target_properties(cryptopp-pem-shared PROPERTIES INCLUDE_DIRECTORIES "$ $") + endif () + endif () + +@@ -1046,15 +1046,15 @@ + set(COMPAT_VERSION ${cryptopp_VERSION_MAJOR}.${cryptopp_VERSION_MINOR}) + + if (BUILD_STATIC) +- set_target_properties(cryptopp-static ++ set_target_properties(cryptopp-pem-static + PROPERTIES +- OUTPUT_NAME cryptopp) ++ OUTPUT_NAME cryptopp-pem) + endif () + if (BUILD_SHARED) +- set_target_properties(cryptopp-shared ++ set_target_properties(cryptopp-pem-shared + PROPERTIES + SOVERSION ${COMPAT_VERSION} +- OUTPUT_NAME cryptopp) ++ OUTPUT_NAME cryptopp-pem) + endif () + endif () + +@@ -1062,11 +1062,11 @@ + # similar to how the crypto++ 'make' tool works. + # see https://github.com/noloader/cryptopp-cmake/issues/32 + if (BUILD_STATIC) +- add_custom_target(static DEPENDS cryptopp-static) ++ add_custom_target(static DEPENDS cryptopp-pem-static) + endif () + if (BUILD_SHARED) +- add_custom_target(shared DEPENDS cryptopp-shared) +- add_custom_target(dynamic DEPENDS cryptopp-shared) ++ add_custom_target(shared DEPENDS cryptopp-pem-shared) ++ add_custom_target(dynamic DEPENDS cryptopp-pem-shared) + endif () + + #============================================================================ +@@ -1075,29 +1075,29 @@ + + if (WIN32) + if (BUILD_STATIC) +- target_link_libraries(cryptopp-static ws2_32) ++ target_link_libraries(cryptopp-pem-static ws2_32) + endif () + if (BUILD_SHARED) +- target_link_libraries(cryptopp-shared ws2_32) ++ target_link_libraries(cryptopp-pem-shared ws2_32) + endif () + endif () + + # This may need to be expanded to "Solaris" + if (CRYPTOPP_SOLARIS) + if (BUILD_STATIC) +- target_link_libraries(cryptopp-static nsl socket) ++ target_link_libraries(cryptopp-pem-static nsl socket) + endif () + if (BUILD_SHARED) +- target_link_libraries(cryptopp-shared nsl socket) ++ target_link_libraries(cryptopp-pem-shared nsl socket) + endif () + endif () + + find_package(Threads) + if (BUILD_STATIC) +- target_link_libraries(cryptopp-static ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries(cryptopp-pem-static ${CMAKE_THREAD_LIBS_INIT}) + endif () + if (BUILD_SHARED) +- target_link_libraries(cryptopp-shared ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries(cryptopp-pem-shared ${CMAKE_THREAD_LIBS_INIT}) + endif () + + #============================================================================ +@@ -1107,7 +1107,7 @@ + enable_testing() + if (BUILD_TESTING) + add_executable(cryptest ${cryptopp_SOURCES_TEST}) +- target_link_libraries(cryptest cryptopp-static) ++ target_link_libraries(cryptest cryptopp-pem-static) + + # Setting "cryptest" binary name to "cryptest.exe" + if (NOT (WIN32 OR CYGWIN)) +@@ -1159,9 +1159,9 @@ + + # Runtime package + if (BUILD_SHARED) +- export(TARGETS cryptopp-shared FILE ${export_name}.cmake ) ++ export(TARGETS cryptopp-pem-shared FILE ${export_name}.cmake ) + install( +- TARGETS cryptopp-shared ++ TARGETS cryptopp-pem-shared + EXPORT ${export_name} + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +@@ -1172,8 +1172,8 @@ + + # Development package + if (BUILD_STATIC) +- export(TARGETS cryptopp-static FILE ${export_name}.cmake ) +- install(TARGETS cryptopp-static EXPORT ${export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ export(TARGETS cryptopp-pem-static FILE ${export_name}.cmake ) ++ install(TARGETS cryptopp-pem-static EXPORT ${export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif () + install(FILES ${cryptopp_HEADERS} DESTINATION include/cryptopp) + diff --git a/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch b/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch new file mode 100644 index 0000000000000..e7c0d678e7363 --- /dev/null +++ b/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch @@ -0,0 +1,172 @@ +--- a/pem.h ++++ b/pem.h +@@ -15,13 +15,13 @@ + #ifndef CRYPTOPP_PEM_H + #define CRYPTOPP_PEM_H + +-#include "pubkey.h" +-#include "eccrypto.h" +-#include "gfpcrypt.h" +-#include "integer.h" +-#include "rsa.h" +-#include "dsa.h" +-#include "elgamal.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + NAMESPACE_BEGIN(CryptoPP) + +--- a/pem_common.cpp ++++ b/pem_common.cpp +@@ -6,10 +6,10 @@ + // http://www.cryptopp.com/wiki/PEM_Pack + /////////////////////////////////////////////////////////////////////////// + +-#include "cryptlib.h" +-#include "secblock.h" +-#include "base64.h" +-#include "osrng.h" ++#include ++#include ++#include ++#include + + #include + #include +--- a/pem_common.h ++++ b/pem_common.h +@@ -10,9 +10,10 @@ + #ifndef CRYPTOPP_PEM_COMMON_H + #define CRYPTOPP_PEM_COMMON_H + +-#include "cryptlib.h" +-#include "secblock.h" +-#include "osrng.h" ++#include ++#include ++#include ++ + #include "pem.h" + + #include +--- a/pem_read.cpp ++++ b/pem_read.cpp +@@ -10,27 +10,27 @@ + #include + #include + +-#include "cryptlib.h" +-#include "secblock.h" +-#include "nbtheory.h" +-#include "gfpcrypt.h" +-#include "camellia.h" +-#include "smartptr.h" +-#include "filters.h" +-#include "base64.h" +-#include "queue.h" +-#include "modes.h" +-#include "asn.h" +-#include "aes.h" +-#include "idea.h" +-#include "hex.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include "pem.h" + #include "pem_common.h" + + #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +-#include "des.h" +-#include "md5.h" ++#include ++#include + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// +--- a/pem_test.cxx ++++ b/pem_test.cxx +@@ -4,13 +4,14 @@ + #include + #include + +-#include "cryptlib.h" +-#include "integer.h" +-#include "eccrypto.h" +-#include "osrng.h" +-#include "files.h" +-#include "rsa.h" +-#include "dsa.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ + #include "pem.h" + + int main(int argc, char* argv[]) +--- a/pem_write.cpp ++++ b/pem_write.cpp +@@ -10,27 +10,27 @@ + #include + #include + +-#include "cryptlib.h" +-#include "secblock.h" +-#include "camellia.h" +-#include "smartptr.h" +-#include "filters.h" +-#include "base64.h" +-#include "files.h" +-#include "queue.h" +-#include "modes.h" +-#include "osrng.h" +-#include "asn.h" +-#include "aes.h" +-#include "idea.h" +-#include "hex.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include "pem.h" + #include "pem_common.h" + + #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +-#include "des.h" +-#include "md5.h" ++#include ++#include + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// diff --git a/recipes/cryptopp-pem/all/test_package/CMakeLists.txt b/recipes/cryptopp-pem/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9ceeed7804cb --- /dev/null +++ b/recipes/cryptopp-pem/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cryptopp-pem) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cryptopp-pem::cryptopp-pem) diff --git a/recipes/cryptopp-pem/all/test_package/conanfile.py b/recipes/cryptopp-pem/all/test_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/cryptopp-pem/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cryptopp-pem/all/test_package/test_package.cpp b/recipes/cryptopp-pem/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f3e9ea6413d94 --- /dev/null +++ b/recipes/cryptopp-pem/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include +#include + +int main() +{ + try + { + CryptoPP::RSA::PublicKey publicKey; + std::string key = "-----BEGIN PUBLIC KEY-----\n" + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWEDeqk749sYZAt2adT2m1Vo8N\n" + "h86GzAs/ZWvlQDUyiedDuAvOhrVwllp4GuAXP7tZwGoeJ+Un6Nkl45IIQ2U9NMWQ\n" + "aru76CD9kVUdThnKVOaeeqZysM1Bz6iJF5piSUzVKZdEk6rIUZjrwpNaYdBBq4a/\n" + "cNETdvolooljIRB8ywIDAQAB\n" + "-----END PUBLIC KEY-----"; + CryptoPP::StringSource source_str(key, true); + CryptoPP::PEM_Load(source_str, publicKey); + + return 0; + } + catch(const std::exception& e) + { + std::cout << e.what() << std::endl; + return 1; + } +} diff --git a/recipes/cryptopp-pem/config.yml b/recipes/cryptopp-pem/config.yml new file mode 100644 index 0000000000000..1496698a0560a --- /dev/null +++ b/recipes/cryptopp-pem/config.yml @@ -0,0 +1,3 @@ +versions: + "8.2.0": + folder: "all" diff --git a/recipes/cryptopp/all/conandata.yml b/recipes/cryptopp/all/conandata.yml new file mode 100644 index 0000000000000..2bc29cced3bfe --- /dev/null +++ b/recipes/cryptopp/all/conandata.yml @@ -0,0 +1,57 @@ +sources: + "8.7.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_7_0.tar.gz" + sha256: "8d6a4064b8e9f34cd3e838f5a12c40067ee7b95ee37d9173ec273cb0913e7ca2" + cmake: + url: "https://github.com/abdes/cryptopp-cmake/archive/CRYPTOPP_8_7_0_1.tar.gz" + sha256: "49800456bec6432eff4a798d37f6c7760b887adc9f8928e66f44bcb8bf81f157" + "8.6.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_6_0.tar.gz" + sha256: "9304625f4767a13e0a5f26d0f019d78cf9375604a33e5391c3bf2e81399dfeb8" + cmake: + url: "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_6_0.tar.gz" + sha256: "970b20d55dbf9d6335485e72c9f8967d878bf64bbd3de6aa28436beb6799c493" + "8.5.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_5_0.tar.gz" + sha256: "8f64cf09cf4f61d5d74bca53574b8cc9959186cc0f072a2e6597e4999d6ad5db" + cmake: + url: "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_5_0.tar.gz" + sha256: "10685209405e676993873fcf638ade5f8f99d7949afa6b2045289ce9cc6d90ac" + "8.4.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_4_0.tar.gz" + sha256: "6687dfc1e33b084aeab48c35a8550b239ee5f73a099a3b6a0918d70b8a89e654" + cmake: + url: "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_4_0.tar.gz" + sha256: "b850070141f6724fce640e4e2cfde433ec5b2d99d4386d29ba9255167bc4b4f0" + "8.2.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_2_0.tar.gz" + sha256: "e3bcd48a62739ad179ad8064b523346abb53767bcbefc01fe37303412292343e" + cmake: + url: "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_2_0.tar.gz" + sha256: "f41f6a32b1177c094c3ef97423916713c902d0ac26cbee30ec70b1e8ab0e6fba" +patches: + "8.7.0": + - patch_file: "patches/8.7.0-0001-fix-msvc-arm64.patch" + "8.6.0": + - patch_file: "patches/8.6.0-0001-fix-cmake.patch" + - patch_file: "patches/8.6.0-0002-relocatable-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" + "8.5.0": + - patch_file: "patches/8.4.0-0001-relocatable-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" + "8.4.0": + - patch_file: "patches/8.4.0-0001-relocatable-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" + "8.2.0": + - patch_file: "patches/8.2.0-0001-fix-cmake.patch" + - patch_file: "patches/8.2.0-0002-relocatable-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" diff --git a/recipes/cryptopp/all/conanfile.py b/recipes/cryptopp/all/conanfile.py new file mode 100644 index 0000000000000..f16bdf4f4f23d --- /dev/null +++ b/recipes/cryptopp/all/conanfile.py @@ -0,0 +1,188 @@ +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, collect_libs, copy, export_conandata_patches, get, + rename, replace_in_file, rmdir, save +) +from conan.tools.scm import Version + +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class CryptoPPConan(ConanFile): + name = "cryptopp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cryptopp.com" + license = "BSL-1.0" + description = "Crypto++ Library is a free C++ class library of cryptographic schemes." + topics = ("crypto", "cryptographic", "security") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and Version(self.version) >= "8.7.0": + raise ConanInvalidConfiguration("cryptopp 8.7.0 and higher do not support shared builds") + + def build_requirements(self): + if Version(self.version) >= "8.7.0": + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + # Get cryptopp sources + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) + + if Version(self.version) < "8.7.0": + # Get CMakeLists + base_source_dir = os.path.join(self.source_folder, os.pardir) + get(self, **self.conan_data["sources"][self.version]["cmake"], destination=base_source_dir) + src_folder = os.path.join( + base_source_dir, + f"cryptopp-cmake-CRYPTOPP_{self.version.replace('.', '_')}", + ) + for file in ("CMakeLists.txt", "cryptopp-config.cmake"): + rename(self, src=os.path.join(src_folder, file), dst=os.path.join(self.source_folder, file)) + rmdir(self, src_folder) + else: + # Get cryptopp-cmake sources + get(self, **self.conan_data["sources"][self.version]["cmake"], + destination=os.path.join(self.source_folder, "cryptopp-cmake"), strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "8.7.0": + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["USE_INTERMEDIATE_OBJECTS_TARGET"] = False + if self.settings.os == "Android": + tc.variables["CRYPTOPP_NATIVE_ARCH"] = True + if self.settings.os == "Macos" and self.settings.arch == "armv8" and Version(self.version) <= "8.4.0": + tc.variables["CMAKE_CXX_FLAGS"] = "-march=armv8-a" + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + else: + tc.cache_variables["CRYPTOPP_SOURCES"] = self.source_folder.replace("\\", "/") + tc.cache_variables["CRYPTOPP_BUILD_TESTING"] = False + tc.cache_variables["CRYPTOPP_BUILD_DOCUMENTATION"] = False + tc.cache_variables["CRYPTOPP_USE_INTERMEDIATE_OBJECTS_TARGET"] = False + if self.settings.os == "Android": + tc.cache_variables["CRYPTOPP_NATIVE_ARCH"] = True + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Use cpu-features.h from Android NDK + if self.settings.os == "Android" and Version(self.version) < "8.4.0": + # Replicate logic from: https://github.com/weidai11/cryptopp/blob/CRYPTOPP_8_2_0/cpu.cpp#L46-L52 + # In more recent versions this is already taken care of by cryptopp-cmake + android_ndk_home = self.conf.get("tools.android:ndk_path") + if android_ndk_home: + copy( + self, + "cpu-features.h", + src=os.path.join(android_ndk_home, "sources", "android", "cpufeatures"), + dst=self.source_folder, + ) + # Honor fPIC option + if Version(self.version) < "8.7.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "SET(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") + else: + replace_in_file(self, os.path.join(self.source_folder, "cryptopp-cmake", "cryptopp", "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + if Version(self.version) < "8.7.0": + cmake.configure() + else: + cmake.configure(build_script_folder="cryptopp-cmake") + 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() + if Version(self.version) < "8.7.0": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + rmdir(self, os.path.join(self.package_folder, "share")) + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "cryptopp-shared": "cryptopp::cryptopp-shared", + "cryptopp-static": "cryptopp::cryptopp-static" + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cryptopp") + self.cpp_info.set_property("cmake_target_name", "cryptopp::cryptopp") + legacy_cmake_target = "cryptopp-shared" if self.options.shared else "cryptopp-static" + self.cpp_info.set_property("cmake_target_aliases", [legacy_cmake_target]) + self.cpp_info.set_property("pkg_config_name", "libcryptopp") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["libcryptopp"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libcryptopp"].system_libs = ["pthread", "m"] + elif self.settings.os == "SunOS": + self.cpp_info.components["libcryptopp"].system_libs = ["nsl", "socket"] + elif self.settings.os == "Windows": + self.cpp_info.components["libcryptopp"].system_libs = ["bcrypt", "ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["pkg_config"] = "libcryptopp" + self.cpp_info.components["libcryptopp"].names["cmake_find_package"] = legacy_cmake_target + self.cpp_info.components["libcryptopp"].names["cmake_find_package_multi"] = legacy_cmake_target + self.cpp_info.components["libcryptopp"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libcryptopp"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["libcryptopp"].set_property("cmake_target_name", "cryptopp::cryptopp") + self.cpp_info.components["libcryptopp"].set_property("pkg_config_name", "libcryptopp") diff --git a/recipes/cryptopp/all/patches/8.2.0-0001-fix-cmake.patch b/recipes/cryptopp/all/patches/8.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..139deaef4e3b5 --- /dev/null +++ b/recipes/cryptopp/all/patches/8.2.0-0001-fix-cmake.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -447,7 +447,7 @@ if (MSVC) + if (CMAKE_SYSTEM_VERSION MATCHES "10\\.0.*") + list(APPEND CRYPTOPP_COMPILE_DEFINITIONS "_WIN32_WINNT=0x0A00") + endif () +- list(APPEND CRYPTOPP_COMPILE_OPTIONS "/FI\"winapifamily.h\"") ++ list(APPEND CRYPTOPP_COMPILE_OPTIONS /FIwinapifamily.h) + endif () + + # Enable PIC for all target machines except 32-bit i386 due to register pressures. diff --git a/recipes/cryptopp/all/patches/8.2.0-0002-relocatable-macos.patch b/recipes/cryptopp/all/patches/8.2.0-0002-relocatable-macos.patch new file mode 100644 index 0000000000000..2733f328862a4 --- /dev/null +++ b/recipes/cryptopp/all/patches/8.2.0-0002-relocatable-macos.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,7 +100,6 @@ set(CRYPTOPP_COMPILE_OPTIONS) + set(LIB_VER ${cryptopp_VERSION_MAJOR}${cryptopp_VERSION_MINOR}${cryptopp_VERSION_PATCH}) + + # Don't use RPATH's. The resulting binary could fail a security audit. +-set(CMAKE_MACOSX_RPATH 0) + + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + list(APPEND CRYPTOPP_COMPILE_OPTIONS -wd68 -wd186 -wd279 -wd327 -wd161 -wd3180) diff --git a/recipes/cryptopp/all/patches/8.4.0-0001-relocatable-macos.patch b/recipes/cryptopp/all/patches/8.4.0-0001-relocatable-macos.patch new file mode 100644 index 0000000000000..03772e1e4a7e1 --- /dev/null +++ b/recipes/cryptopp/all/patches/8.4.0-0001-relocatable-macos.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -99,7 +99,6 @@ set(CRYPTOPP_COMPILE_OPTIONS) + set(LIB_VER ${cryptopp_VERSION_MAJOR}${cryptopp_VERSION_MINOR}${cryptopp_VERSION_PATCH}) + + # Don't use RPATH's. The resulting binary could fail a security audit. +-set(CMAKE_MACOSX_RPATH 0) + + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + list(APPEND CRYPTOPP_COMPILE_OPTIONS -wd68 -wd186 -wd279 -wd327 -wd161 -wd3180) diff --git a/recipes/cryptopp/all/patches/8.6.0-0001-fix-cmake.patch b/recipes/cryptopp/all/patches/8.6.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..6491b83de8d9e --- /dev/null +++ b/recipes/cryptopp/all/patches/8.6.0-0001-fix-cmake.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1024,8 +1024,8 @@ + # https://stackoverflow.com/q/61250087 + add_definitions("${CMAKE_CPP_FLAGS}" "${CMAKE_CXX_FLAGS}" "${CRYPTOPP_COMPILE_DEFINITIONS}" "${CRYPTOPP_COMPILE_OPTIONS}") + else() +- add_compile_definitions("${CMAKE_CPP_FLAGS}" "${CRYPTOPP_COMPILE_DEFINITIONS}") +- add_compile_options("${CMAKE_CXX_FLAGS}" "${CRYPTOPP_COMPILE_OPTIONS}") ++ add_compile_definitions(${CRYPTOPP_COMPILE_DEFINITIONS}) ++ add_compile_options(${CRYPTOPP_COMPILE_OPTIONS}) + endif() + + #============================================================================ diff --git a/recipes/cryptopp/all/patches/8.6.0-0002-relocatable-macos.patch b/recipes/cryptopp/all/patches/8.6.0-0002-relocatable-macos.patch new file mode 100644 index 0000000000000..d835b100d1b64 --- /dev/null +++ b/recipes/cryptopp/all/patches/8.6.0-0002-relocatable-macos.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,7 +127,6 @@ set(CRYPTOPP_COMPILE_OPTIONS) + + # Stop CMake complaining... + if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") +- set(MACOSX_RPATH FALSE) + endif() + + # Always 1 ahead in Master. Also see http://groups.google.com/forum/#!topic/cryptopp-users/SFhqLDTQPG4 diff --git a/recipes/cryptopp/all/patches/8.7.0-0001-fix-msvc-arm64.patch b/recipes/cryptopp/all/patches/8.7.0-0001-fix-msvc-arm64.patch new file mode 100755 index 0000000000000..1e813c076823d --- /dev/null +++ b/recipes/cryptopp/all/patches/8.7.0-0001-fix-msvc-arm64.patch @@ -0,0 +1,35 @@ +--- a/arm_simd.h ++++ b/arm_simd.h +@@ -307,28 +307,32 @@ inline uint64x2_t PMULL_HIGH(const uint64x2_t a, const uint64x2_t b) + #endif + } + ++// This function will be removed in the next version of Crypto++: ++// https://github.com/weidai11/cryptopp/commit/31fa3384160071793bc428a32383938551b3652c ++#if !defined(_MSC_VER) || defined(_M_ARM) + /// \brief Vector extraction + /// \param a the first value + /// \param b the second value + /// \param c the byte count + /// \return vector + /// \details VEXT_U8() extracts the first c bytes of vector + /// a and the remaining bytes in b. VEXT_U8 is provided + /// as GCC inline assembly due to Clang and lack of support for the intrinsic. + /// \since Crypto++ 8.0 + inline uint64x2_t VEXT_U8(uint64x2_t a, uint64x2_t b, unsigned int c) + { + #if defined(_MSC_VER) + return vreinterpretq_u64_u8(vextq_u8( + vreinterpretq_u8_u64(a), vreinterpretq_u8_u64(b), c)); + #else + uint64x2_t r; + __asm__ ("ext %0.16b, %1.16b, %2.16b, %3 \n\t" + :"=w" (r) : "w" (a), "w" (b), "I" (c) ); + return r; + #endif + } ++#endif + + /// \brief Vector extraction + /// \tparam C the byte count + /// \param a the first value diff --git a/recipes/cryptopp/all/test_package/CMakeLists.txt b/recipes/cryptopp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b742b78c960d8 --- /dev/null +++ b/recipes/cryptopp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(cryptopp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cryptopp::cryptopp) diff --git a/recipes/cryptopp/all/test_package/conanfile.py b/recipes/cryptopp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cryptopp/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/cryptopp/all/test_package/test_package.cpp b/recipes/cryptopp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2460e01097c84 --- /dev/null +++ b/recipes/cryptopp/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "cryptopp/cryptlib.h" +#include "cryptopp/osrng.h" // AutoSeededRandomPool + +#include + +int main() { + printf("CryptoPP version: %d\n", CRYPTOPP_VERSION); + + CryptoPP::AutoSeededRandomPool rng; + printf("This is a random number from CryptoPP: %d\n", rng.GenerateByte()); + + return 0; +} diff --git a/recipes/cryptopp/all/test_v1_package/CMakeLists.txt b/recipes/cryptopp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cryptopp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cryptopp/all/test_v1_package/conanfile.py b/recipes/cryptopp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cryptopp/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/cryptopp/config.yml b/recipes/cryptopp/config.yml new file mode 100644 index 0000000000000..0cf6dab66b6c7 --- /dev/null +++ b/recipes/cryptopp/config.yml @@ -0,0 +1,11 @@ +versions: + "8.7.0": + folder: "all" + "8.6.0": + folder: "all" + "8.5.0": + folder: "all" + "8.4.0": + folder: "all" + "8.2.0": + folder: "all" diff --git a/recipes/cs_libguarded/all/conandata.yml b/recipes/cs_libguarded/all/conandata.yml new file mode 100644 index 0000000000000..6464993e20067 --- /dev/null +++ b/recipes/cs_libguarded/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.4.0": + url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.4.0.tar.gz" + sha256: "3911c56db6e7b222e2ec4c45513021f819ce647e7e6e803ca64dc720e8645d8e" + "1.3.0": + url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.3.0.tar.gz" + sha256: "4059db286bb6386faa748cdcdb53c0e5ce785ca3644fb4a01410011b8ea97be2" + "1.1.0": + url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.1.0.tar.gz" + sha256: "ad51992e5a8ba29ce55e7bd6dfb653f4b483a52edf07806871e8b15e67278af3" diff --git a/recipes/cs_libguarded/all/conanfile.py b/recipes/cs_libguarded/all/conanfile.py new file mode 100644 index 0000000000000..39578ddadb423 --- /dev/null +++ b/recipes/cs_libguarded/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.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 CsLibguardedConan(ConanFile): + name = "cs_libguarded" + description = "The libGuarded library is a standalone header-only library for multithreaded programming." + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/copperspice/libguarded" + topics = ("multithreading", "templates", "cpp14", "mutexes", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 if Version(self.version) < "1.3" else 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "1.3": + return { + "Visual Studio": "15.2", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5", + } + else: + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(compiler, False) + if minimum_version and loose_lt_semver(version, minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if Version(self.version) < "1.3": + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src"), + ) + else: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "CsLibGuarded"), + src=os.path.join(self.source_folder, "src"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if Version(self.version) >= "1.3": + self.cpp_info.includedirs.append(os.path.join("include", "CsLibGuarded")) + + self.cpp_info.set_property("cmake_file_name", "CsLibGuarded") + self.cpp_info.set_property("cmake_target_name", "CsLibGuarded::CsLibGuarded") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "CsLibGuarded" + self.cpp_info.filenames["cmake_find_package_multi"] = "CsLibGuarded" + self.cpp_info.names["cmake_find_package"] = "CsLibGuarded" + self.cpp_info.names["cmake_find_package_multi"] = "CsLibGuarded" diff --git a/recipes/cs_libguarded/all/test_package/CMakeLists.txt b/recipes/cs_libguarded/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5463ebc7c858 --- /dev/null +++ b/recipes/cs_libguarded/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(cs_libguarded CONFIG) +if (cs_libguarded_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE cs_libguarded::cs_libguarded) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + find_package(CsLibGuarded REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE CsLibGuarded::CsLibGuarded) + target_compile_definitions(${PROJECT_NAME} PRIVATE CS_LIBGUARDED_1_3_0_LATER) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/cs_libguarded/all/test_package/conanfile.py b/recipes/cs_libguarded/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/cs_libguarded/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cs_libguarded/all/test_package/test_package.cpp b/recipes/cs_libguarded/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9befabd77ff2c --- /dev/null +++ b/recipes/cs_libguarded/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#ifndef CS_LIBGUARDED_1_3_0_LATER + #include +#else + #include +#endif + +int main() { +#ifndef CS_LIBGUARDED_1_3_0_LATER + libguarded::guarded g; +#else + libguarded::plain_guarded g; +#endif + *g.lock() = 42; + return 0; +} diff --git a/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt b/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cs_libguarded/all/test_v1_package/conanfile.py b/recipes/cs_libguarded/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/cs_libguarded/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cs_libguarded/config.yml b/recipes/cs_libguarded/config.yml new file mode 100644 index 0000000000000..942362a3d6c93 --- /dev/null +++ b/recipes/cs_libguarded/config.yml @@ -0,0 +1,7 @@ +versions: + "1.4.0": + folder: all + "1.3.0": + folder: all + "1.1.0": + folder: all diff --git a/recipes/csm/all/CMakeLists.txt b/recipes/csm/all/CMakeLists.txt new file mode 100644 index 0000000000000..757e60e4da746 --- /dev/null +++ b/recipes/csm/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.1) +project(csm LANGUAGES CXX) + +find_package(Threads REQUIRED) +include(CheckFunctionExists) +check_function_exists(pow HAVE_MATH_SYSTEM) + +file(GLOB CSM_SRCS ${CSM_SRC_DIR}/*.cpp) +add_library(csmapi SHARED ${CSM_SRCS}) +target_include_directories(csmapi PRIVATE ${CSM_SRC_DIR}) +target_link_libraries(csmapi PRIVATE Threads::Threads ${CMAKE_DL_LIBS}) +if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(csmapi PRIVATE m) +endif() +set_target_properties(csmapi PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN TRUE + VERSION ${CSM_VERSION} + SOVERSION ${CSM_MAJOR_VERSION} +) +if(NOT WIN32) + set_target_properties(csmapi PROPERTIES DEFINE_SYMBOL LINUX_BUILD) +endif() + +include(GNUInstallDirs) +file(GLOB CSM_HEADERS ${CSM_SRC_DIR}/*.h) +install(FILES ${CSM_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/csm) +install( + TARGETS csmapi + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/recipes/csm/all/conandata.yml b/recipes/csm/all/conandata.yml new file mode 100644 index 0000000000000..80cde8337f258 --- /dev/null +++ b/recipes/csm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.4": + url: "https://github.com/ngageoint/csm/archive/refs/tags/v3.0.4.tar.gz" + sha256: "1f4d95af1ecc4fbdcf832d796c8da766c696927bd9d9691016d73a956d3e22bb" diff --git a/recipes/csm/all/conanfile.py b/recipes/csm/all/conanfile.py new file mode 100644 index 0000000000000..7253fb0bd7a4b --- /dev/null +++ b/recipes/csm/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.2" + + +class CsmConan(ConanFile): + name = "csm" + description = "Community Sensor Model base interface library" + license = "Unlicense" + topics = ("sensor", "camera", "camera-model", "geospatial", "planetary", "planetary-data") + homepage = "https://github.com/ngageoint/csm" + url = "https://github.com/conan-io/conan-center-index" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + exports_sources = "CMakeLists.txt" + + 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["CSM_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["CSM_VERSION"] = self.version + tc.variables["CSM_MAJOR_VERSION"] = str(Version(self.version).major) + 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 = ["csmapi"] diff --git a/recipes/csm/all/test_package/CMakeLists.txt b/recipes/csm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3d1c614448318 --- /dev/null +++ b/recipes/csm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(csm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE csm::csm) diff --git a/recipes/csm/all/test_package/conanfile.py b/recipes/csm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/csm/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/csm/all/test_package/test_package.cpp b/recipes/csm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4262df6c3ccb1 --- /dev/null +++ b/recipes/csm/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + csm::Ellipsoid ellipsoid; + return 0; +} diff --git a/recipes/csm/all/test_v1_package/CMakeLists.txt b/recipes/csm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/csm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/csm/all/test_v1_package/conanfile.py b/recipes/csm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/csm/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/csm/config.yml b/recipes/csm/config.yml new file mode 100644 index 0000000000000..72c13bca7df04 --- /dev/null +++ b/recipes/csm/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.4": + folder: all diff --git a/recipes/cspice/all/CMakeLists.txt b/recipes/cspice/all/CMakeLists.txt new file mode 100644 index 0000000000000..3812708448a9a --- /dev/null +++ b/recipes/cspice/all/CMakeLists.txt @@ -0,0 +1,131 @@ +cmake_minimum_required(VERSION 3.7) +project(cspice LANGUAGES C) + +include(GNUInstallDirs) + +option(CSPICE_BUILD_UTILITIES "Build cspice utilities" ON) + +add_compile_options( + $<$,$>:-Wno-implicit-int> + $<$,$>:-Wno-format> + $<$,$>:-Wno-pointer-to-int-cast> + $<$:-Wno-logical-op-parentheses> + $<$:-Wno-shift-op-parentheses> + $<$:-Wno-parentheses> + $<$:-Wno-dangling-else> + $<$:-Wno-unsequenced> + $<$:/wd4101> + $<$:/wd4244> + $<$:/wd4267> + $<$:/wd4311> + $<$:/wd4477> + $<$:/wd4554> + $<$:/wd4723> + $<$:/wd4996> + # Behavior of implicitly defined functions changed in AppleClang 12 + # https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes + $<$,$>:-Wno-error=implicit-function-declaration> +) + +set(SRC_DIR ${CSPICE_SRC_DIR}/src) + +file(GLOB CSPICE_SRC_FILES ${SRC_DIR}/cspice/*.c) +add_library(cspice ${CSPICE_SRC_FILES}) + +if(WIN32) + target_compile_definitions(cspice PRIVATE "_COMPLEX_DEFINED;MSDOS;OMIT_BLANK_CC;NON_ANSI_STDIO;_CRT_SECURE_NO_WARNINGS") + set_target_properties(cspice PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +elseif(UNIX) + target_compile_definitions(cspice PRIVATE "NON_UNIX_STDIO") + target_compile_options(cspice PRIVATE -ansi) +endif() + +include(CheckFunctionExists) +check_function_exists(pow HAVE_MATH_SYSTEM) +if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(cspice PRIVATE m) +endif() + +install( + TARGETS cspice + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +file(GLOB INCLUDE_FILES ${CSPICE_SRC_DIR}/include/*.h) +install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +if(CSPICE_BUILD_UTILITIES) + # csupport is common to all utilities + file(GLOB CSUPPORT_SRC_FILES "${SRC_DIR}/csupport/*.c") + add_library(csupport STATIC ${CSUPPORT_SRC_FILES}) + + # Walk into all utilities subfolders and build them (except cook_c which only contains examples) + file(GLOB CSPICE_UTILITIES_SUBDIRS RELATIVE ${SRC_DIR} "${SRC_DIR}/*_c") + list(REMOVE_ITEM CSPICE_UTILITIES_SUBDIRS "cook_c") + foreach(CSPICE_SUBDIR ${CSPICE_UTILITIES_SUBDIRS}) + set(UTILITY_SRC_DIR "${SRC_DIR}/${CSPICE_SUBDIR}") + + # Each .pgm file is the entry point of an executable + file(GLOB PGM_FILES "${UTILITY_SRC_DIR}/*.pgm") + + # Source files common to all executables in this subfolder + # Ignore these files: main.c, .c, _main.c + # (might have been pre-generated, specially in Windows source code) + file(GLOB CSPICE_UTILITY_SRC_FILES ${UTILITY_SRC_DIR}/*.c) + get_filename_component(MAIN_SRC_FILE "${UTILITY_SRC_DIR}/main.c" ABSOLUTE) + list(REMOVE_ITEM CSPICE_UTILITY_SRC_FILES "${MAIN_SRC_FILE}") + foreach(PGM_FILE ${PGM_FILES}) + get_filename_component(CSPICE_UTILITY ${PGM_FILE} NAME_WE) + get_filename_component(PGM_MAIN_SRC_FILE "${UTILITY_SRC_DIR}/${CSPICE_UTILITY}_main.c" ABSOLUTE) + get_filename_component(GENERIC_MAIN_SRC_FILE "${UTILITY_SRC_DIR}/${CSPICE_UTILITY}.c" ABSOLUTE) + list(REMOVE_ITEM CSPICE_UTILITY_SRC_FILES "${PGM_MAIN_SRC_FILE}" "${GENERIC_MAIN_SRC_FILE}") + endforeach() + if(CSPICE_UTILITY_SRC_FILES) + add_library(${CSPICE_SUBDIR}_commonlib OBJECT ${CSPICE_UTILITY_SRC_FILES}) + endif() + + # Build one executable per pgm file + foreach(PGM_FILE ${PGM_FILES}) + get_filename_component(CSPICE_UTILITY ${PGM_FILE} NAME_WE) + + # Generate _main.c file from .pgm file + set(PGM_MAIN_SRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/cspice_generated/${CSPICE_SUBDIR}/${CSPICE_UTILITY}_main.c") + add_custom_target(${CSPICE_UTILITY}_PGM DEPENDS ${PGM_FILE} ${PGM_MAIN_SRC_FILE}) + add_custom_command( + OUTPUT ${PGM_MAIN_SRC_FILE} + DEPENDS ${PGM_FILE} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PGM_FILE} ${PGM_MAIN_SRC_FILE} + ) + + # Generate .c from main.x file if it exists + set(INPUT_MAIN_FILE "${UTILITY_SRC_DIR}/main.x") + set(GENERIC_MAIN_SRC_FILE "") + if(EXISTS ${INPUT_MAIN_FILE}) + set(GENERIC_MAIN_SRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/cspice_generated/${CSPICE_SUBDIR}/${CSPICE_UTILITY}.c") + add_custom_target(${CSPICE_UTILITY}_MAIN DEPENDS ${INPUT_MAIN_FILE} ${GENERIC_MAIN_SRC_FILE}) + add_custom_command( + OUTPUT ${GENERIC_MAIN_SRC_FILE} + DEPENDS ${INPUT_MAIN_FILE} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INPUT_MAIN_FILE} ${GENERIC_MAIN_SRC_FILE} + ) + endif() + + add_executable(${CSPICE_UTILITY} ${PGM_MAIN_SRC_FILE} ${GENERIC_MAIN_SRC_FILE}) + add_dependencies(${CSPICE_UTILITY} ${CSPICE_UTILITY}_PGM) + if(TARGET ${CSPICE_UTILITY}_MAIN) + add_dependencies(${CSPICE_UTILITY} ${CSPICE_UTILITY}_MAIN) + endif() + target_include_directories(${CSPICE_UTILITY} PRIVATE ${UTILITY_SRC_DIR}) + target_link_libraries(${CSPICE_UTILITY} PRIVATE csupport cspice) + if(TARGET ${CSPICE_SUBDIR}_commonlib) + target_link_libraries(${CSPICE_UTILITY} PRIVATE ${CSPICE_SUBDIR}_commonlib) + endif() + if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(${CSPICE_UTILITY} PRIVATE m) + endif() + install(TARGETS ${CSPICE_UTILITY} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + endforeach() +endif() diff --git a/recipes/cspice/all/conandata.yml b/recipes/cspice/all/conandata.yml new file mode 100644 index 0000000000000..ed4687777f4ca --- /dev/null +++ b/recipes/cspice/all/conandata.yml @@ -0,0 +1,122 @@ +sources: + "0067": + "Macos": + "apple-clang": + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z" + sha256: "6f4980445fee4d363dbce6f571819f4a248358d2c1bebca47e0743eedfe9935e" + "armv8": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/MacM1_OSX_clang_64bit/packages/cspice.tar.Z" + sha256: "0deae048443e11ca4d093cac651d9785d4f2594631a183d85a3d58949f4d0aa9" + "Linux": + "gcc": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z" + sha256: "33d75cd94acf6546e53d7ebc4e7d3d6d42ac27c83cb0d8f04c91a8b50c1149e3" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z" + sha256: "60a95b51a6472f1afe7e40d77ebdee43c12bb5b8823676ccc74692ddfede06ce" + "Windows": + "Visual Studio": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Windows_VisualC_32bit/packages/cspice.zip" + sha256: "bc566e6a975c888fc5fd89d76554329501446bda88c8bab937c0725faead170f" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Windows_VisualC_64bit/packages/cspice.zip" + sha256: "98d60b814b412fa55294aeaaeb7dab46d849cc87a8b709ffe835d08de17625dc" + "msvc": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Windows_VisualC_32bit/packages/cspice.zip" + sha256: "bc566e6a975c888fc5fd89d76554329501446bda88c8bab937c0725faead170f" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Windows_VisualC_64bit/packages/cspice.zip" + sha256: "98d60b814b412fa55294aeaaeb7dab46d849cc87a8b709ffe835d08de17625dc" + "cygwin": + "gcc": + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Cygwin_GCC_64bit/packages/cspice.tar.gz" + sha256: "78ca611638653e1b86347d2b58d8bc761c256e5d0037314fcb7c3eedb3e981bd" + "SunOs": + "sun-cc": + "sparc": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/SunSPARC_Solaris_SunC_32bit/packages/cspice.tar.Z" + sha256: "382d6bc51312c0af8b52d6995c255a5af468551bb04c79fb2e6171dc10de95f3" + "sparcv9": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/SunSPARC_Solaris_SunC_64bit/packages/cspice.tar.Z" + sha256: "f2510faccdcfeb4ed75ed3fc377059629ae090c29e7d22189e0933e9a905143b" + "gcc": + "sparc": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/SunSPARC_Solaris_GCC_32bit/packages/cspice.tar.Z" + sha256: "b26c645d11b12f906c4283202d630c114710288531f2dfc118721b81de25722f" + "sparcv9": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/SunSPARC_Solaris_GCC_64bit/packages/cspice.tar.Z" + sha256: "b0936d1ef0973fcdbd2b204faacd128059d8a656d73e4f276dfc6709d8080eee" + "0066": + "Macos": + "apple-clang": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/MacIntel_OSX_AppleC_32bit/packages/cspice.tar.Z" + sha256: "9a4b5f674ea76821c43aa9140829da4091de646ef3ce40fd5be1d09d7c37b6b3" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z" + sha256: "f5d48c4b0d558c5d71e8bf6fcdf135b0943210c1ff91f8191dfc447419a6b12e" + "Linux": + "gcc": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z" + sha256: "59f5a2e865ff8dee3e415477fe55cf366bad5498948bf7b034ee00b46ec80720" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z" + sha256: "93cd4fbce5818f8b7fecf3914c5756b8d41fd5bdaaeac1f4037b5a5410bc4768" + "Windows": + "Visual Studio": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Windows_VisualC_32bit/packages/cspice.zip" + sha256: "db48e5beddc0e50f7a0224bb2c6f2b39fc38f84628ad5cd455e847fc70aa5e75" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Windows_VisualC_64bit/packages/cspice.zip" + sha256: "b29dfb0b41ae8322c60ee9d162beb97433d21e12843ecbe03d819e5edef45920" + "msvc": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Windows_VisualC_32bit/packages/cspice.zip" + sha256: "db48e5beddc0e50f7a0224bb2c6f2b39fc38f84628ad5cd455e847fc70aa5e75" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Windows_VisualC_64bit/packages/cspice.zip" + sha256: "b29dfb0b41ae8322c60ee9d162beb97433d21e12843ecbe03d819e5edef45920" + "cygwin": + "gcc": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Cygwin_GCC_32bit/packages/cspice.tar.gz" + sha256: "fae1e81f2b120801078415ddc78069543792b2ecf6f01e2ddd4f9d1fdff6d705" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/PC_Cygwin_GCC_64bit/packages/cspice.tar.gz" + sha256: "bc41bd496c98b5b26c03e2eb1235a2ab3ee3d6b54452155722c0163ebec52c09" + "SunOs": + "sun-cc": + "x86": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/SunIntel_Solaris_SunC_32bit/packages/cspice.tar.Z" + sha256: "2779be0a8cce3a342fd77d118c53689344979de01a4185f8ff727f85502f116e" + "x86_64": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/SunIntel_Solaris_SunC_64bit/packages/cspice.tar.Z" + sha256: "b221eb598e4397acf957b0464694a62c92871671be9fe9c32ac64d621b1eb29d" + "sparc": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/SunSPARC_Solaris_SunC_32bit/packages/cspice.tar.Z" + sha256: "1432f49f628930b48197bcf4e9234ed7a340732302c82fd6d0650d15fe8503f8" + "sparcv9": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/SunSPARC_Solaris_SunC_64bit/packages/cspice.tar.Z" + sha256: "be27fa91fefa9f54e90578a7c84e9e16d19b0ce6420eb346340ecf8d26db1b5f" + "gcc": + "sparc": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/SunSPARC_Solaris_GCC_32bit/packages/cspice.tar.Z" + sha256: "463c93a54f432fa41e1733bc4ec0e584f1017f48f84e0e9fafe4adc4163064c9" + "sparcv9": + url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/SunSPARC_Solaris_GCC_64bit/packages/cspice.tar.Z" + sha256: "4e86fad7e8fa947abddd3d78174efc65476a3f54627747ffc2027ee572af48b3" +patches: + "0067": + - patch_file: "patches/isatty.patch" + "0066": + - patch_file: "patches/isatty.patch" + - patch_file: "patches/patches20171106.patch" + patch_type: "backport" + patch_source: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066_patches" diff --git a/recipes/cspice/all/conanfile.py b/recipes/cspice/all/conanfile.py new file mode 100644 index 0000000000000..e2b42c62f365f --- /dev/null +++ b/recipes/cspice/all/conanfile.py @@ -0,0 +1,131 @@ +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, chdir, copy, download, export_conandata_patches, + get, load, rename, rmdir, save +) +import os + +required_conan_version = ">=1.53.0" + + +class CspiceConan(ConanFile): + name = "cspice" + description = "NASA C SPICE library" + license = "TSPA" + topics = ("spice", "naif", "kernels", "space", "nasa", "jpl", "spacecraft", "planet", "robotics") + homepage = "https://naif.jpl.nasa.gov/naif/toolkit.html" + 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], + "utilities": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "utilities": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + 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): + sources_url_per_triplet = self.conan_data["sources"][self.version] + host_os = self._get_os_or_subsystem() + if host_os not in sources_url_per_triplet: + raise ConanInvalidConfiguration( + f"cspice N{self.version} does not support {host_os}", + ) + compiler = str(self.settings.compiler) + if compiler not in sources_url_per_triplet[host_os]: + raise ConanInvalidConfiguration( + f"cspice N{self.version} does not support {compiler} on {host_os}", + ) + arch = str(self.settings.arch) + if arch not in sources_url_per_triplet[host_os][compiler]: + raise ConanInvalidConfiguration( + f"cspice N{self.version} does not support {compiler} on {host_os} {arch}", + ) + + def _get_os_or_subsystem(self): + if self.settings.os == "Windows" and self.settings.get_safe("os.subsystem"): + os_or_subsystem = str(self.settings.os.subsystem) + else: + os_or_subsystem = str(self.settings.os) + return os_or_subsystem + + def source(self): + pass + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CSPICE_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["CSPICE_BUILD_UTILITIES"] = self.options.utilities + tc.generate() + + @property + def _parent_source_folder(self): + return os.path.join(self.source_folder, os.pardir) + + def _get_sources(self): + with chdir(self, self._parent_source_folder): + host_os = self._get_os_or_subsystem() + compiler = str(self.settings.compiler) + arch = str(self.settings.arch) + data = self.conan_data["sources"][self.version][host_os][compiler][arch] + url = data["url"] + if url.endswith(".tar.Z"): # Python doesn't have any module to uncompress .Z files + tarball = os.path.basename(url) + download(self, url, tarball, sha256=data["sha256"]) + self.run(f"zcat {tarball} | tar -xf -") + os.remove(tarball) + else: + get(self, **data) + rmdir(self, self.source_folder) + rename(self, "cspice", os.path.basename(self.source_folder)) + + def build(self): + self._get_sources() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=self._parent_source_folder) + cmake.build() + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def _extract_license(self): + spiceusr_header = load(self, os.path.join(self.source_folder, "include", "SpiceUsr.h")) + begin = spiceusr_header.find("-Disclaimer") + end = spiceusr_header.find("-Required_Reading", begin) + return spiceusr_header[begin:end] + + def package_info(self): + self.cpp_info.libs = ["cspice"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + if self.options.utilities: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cspice/all/patches/isatty.patch b/recipes/cspice/all/patches/isatty.patch new file mode 100644 index 0000000000000..b51d34b6e4660 --- /dev/null +++ b/recipes/cspice/all/patches/isatty.patch @@ -0,0 +1,19 @@ +--- a/src/cspice/fio.h ++++ b/src/cspice/fio.h +@@ -1,3 +1,6 @@ ++#ifdef _WIN32 ++#include /* for isatty() */ ++#endif + #include "stdio.h" + #include "errno.h" + #ifndef NULL +@@ -73,7 +76,9 @@ extern void f_init(void); + extern int (*f__donewrec)(void), t_putc(int), x_wSL(void); + extern void b_char(char*,char*,ftnlen), g_char(char*,ftnlen,char*); + extern int c_sfe(cilist*), z_rnew(void); ++#ifndef _WIN32 + extern int isatty(int); ++#endif + extern int err__fl(int,int,char*); + extern int xrd_SL(void); + extern int f__putbuf(int); diff --git a/recipes/cspice/all/patches/patches20171106.patch b/recipes/cspice/all/patches/patches20171106.patch new file mode 100644 index 0000000000000..df1efb15811d4 --- /dev/null +++ b/recipes/cspice/all/patches/patches20171106.patch @@ -0,0 +1,473 @@ +--- a/src/cspice/dskx02.c ++++ b/src/cspice/dskx02.c +@@ -133,6 +133,7 @@ static integer c__0 = 0; + extern /* Subroutine */ int insang_(doublereal *, doublereal *, + doublereal *, doublereal *, logical *, doublereal *), pltnrm_( + doublereal *, doublereal *, doublereal *, doublereal *); ++ doublereal xpt2[3]; + + /* $ Abstract */ + +@@ -1315,6 +1316,16 @@ static integer c__0 = 0; + + /* $ Version */ + ++/* - SPICELIB Version 1.1.0 28-JUL-2017 (NJB) */ ++ ++/* Bug fix: in some cases the previous version of */ ++/* this routine could still return an intercept outside */ ++/* of the segment boundaries by more than the allowed */ ++/* margin. In those cases, the returned plate ID was */ ++/* invalid. Both problems have been corrected. */ ++ ++/* See $Revisions for details. */ ++ + /* - SPICELIB Version 1.0.0 04-APR-2017 (NJB) */ + + /* Added test for containment of intersection point */ +@@ -1474,6 +1485,46 @@ static integer c__0 = 0; + /* -& */ + /* $ Revisions */ + ++/* - SPICELIB Version 1.1.0 28-JUL-2017 (NJB) */ ++ ++/* Bug fix: in some cases the previous version of this routine */ ++/* could return an intercept outside of the segment boundaries */ ++/* (the "outside intercept") by more than the allowed margin. In */ ++/* those cases, the returned plate ID was invalid. */ ++ ++/* Both problems have been corrected. */ ++ ++/* Description of the bug */ ++/* ---------------------- */ ++ ++/* In the case where all of the follow conditions hold: */ ++ ++/* - the input ray's intercepts exist both within and */ ++/* outside the segment's boundaries */ ++ ++/* - the outside intercept is considered the nearest */ ++/* solution to the vertex at the time the intercept */ ++/* is found */ ++ ++/* - the intercept that should have been selected was found */ ++/* before the outside intercept */ ++ ++/* the outside intercept will overwrite the correct intercept. */ ++ ++/* In the situation described above, the plate ID returned */ ++/* will not be that of the outside plate. */ ++ ++/* Solution */ ++/* -------- */ ++ ++/* Each intercept that passes the test for being closest, of */ ++/* all intercepts seen so far, to the ray's vertex is stored */ ++/* in a temporary variable. The output XPT is updated only */ ++/* when the intercept is found to lie within the segment's */ ++/* coordinate bounds, or outside the bounds by no more than */ ++/* the allowed margin. */ ++ ++ + /* - 10-SEP-2014 (NJB) */ + + /* Bug fix: during an intercept search over the voxel list */ +@@ -1651,9 +1702,9 @@ static integer c__0 = 0; + } + for (i__ = 1; i__ <= 3; ++i__) { + grdext[(i__1 = i__ - 1) < 3 && 0 <= i__1 ? i__1 : s_rnge("grdext", +- i__1, "dskx02_", (ftnlen)1026)] = vgrext[(i__2 = i__ - 1) ++ i__1, "dskx02_", (ftnlen)1077)] = vgrext[(i__2 = i__ - 1) + < 3 && 0 <= i__2 ? i__2 : s_rnge("vgrext", i__2, "dskx0" +- "2_", (ftnlen)1026)] * voxsiz; ++ "2_", (ftnlen)1077)] * voxsiz; + } + + /* Set the margin used for checking whether the ray's vertex */ +@@ -1678,9 +1729,9 @@ static integer c__0 = 0; + + for (i__ = 1; i__ <= 3; ++i__) { + cgrext[(i__1 = i__ - 1) < 3 && 0 <= i__1 ? i__1 : s_rnge("cgrext", +- i__1, "dskx02_", (ftnlen)1053)] = vgrext[(i__2 = i__ - 1) ++ i__1, "dskx02_", (ftnlen)1104)] = vgrext[(i__2 = i__ - 1) + < 3 && 0 <= i__2 ? i__2 : s_rnge("vgrext", i__2, "dskx0" +- "2_", (ftnlen)1053)] / cgscal; ++ "2_", (ftnlen)1104)] / cgscal; + } + cgscl2 = cgscal * cgscal; + /* Computing 3rd power */ +@@ -1789,14 +1840,14 @@ static integer c__0 = 0; + + for (j = 1; j <= 3; ++j) { + cgxyz[(i__2 = j - 1) < 3 && 0 <= i__2 ? i__2 : s_rnge("cgxyz", +- i__2, "dskx02_", (ftnlen)1189)] = (voxlst[(i__3 = j + i__ ++ i__2, "dskx02_", (ftnlen)1240)] = (voxlst[(i__3 = j + i__ + * 3 - 4) < 150000 && 0 <= i__3 ? i__3 : s_rnge("voxlst", +- i__3, "dskx02_", (ftnlen)1189)] - 1) / cgscal + 1; ++ i__3, "dskx02_", (ftnlen)1240)] - 1) / cgscal + 1; + } + cvid = cgxyz[0] + cgrext[0] * (cgxyz[1] + cgxyz[2] * cgrext[1] - ( + cgrext[1] + 1)); + if (cgrptr[(i__2 = cvid - 1) < 100000 && 0 <= i__2 ? i__2 : s_rnge( +- "cgrptr", i__2, "dskx02_", (ftnlen)1196)] > 0) { ++ "cgrptr", i__2, "dskx02_", (ftnlen)1247)] > 0) { + + /* This coarse voxel is non-empty; add the index of the */ + /* current voxel to the output list. Save the coordinates of */ +@@ -1804,20 +1855,20 @@ static integer c__0 = 0; + + ++to; + vxlout[(i__2 = to - 1) < 50000 && 0 <= i__2 ? i__2 : s_rnge("vxl" +- "out", i__2, "dskx02_", (ftnlen)1203)] = i__; ++ "out", i__2, "dskx02_", (ftnlen)1254)] = i__; + for (j = 1; j <= 3; ++j) { + vxlcg[(i__2 = j + to * 3 - 4) < 150000 && 0 <= i__2 ? i__2 : +- s_rnge("vxlcg", i__2, "dskx02_", (ftnlen)1206)] = ++ s_rnge("vxlcg", i__2, "dskx02_", (ftnlen)1257)] = + cgxyz[(i__3 = j - 1) < 3 && 0 <= i__3 ? i__3 : s_rnge( +- "cgxyz", i__3, "dskx02_", (ftnlen)1206)]; ++ "cgxyz", i__3, "dskx02_", (ftnlen)1257)]; + } + + /* Save the coarse voxel start pointer as well. */ + + vxlstr[(i__2 = to - 1) < 50000 && 0 <= i__2 ? i__2 : s_rnge("vxl" +- "str", i__2, "dskx02_", (ftnlen)1211)] = cgrptr[(i__3 = ++ "str", i__2, "dskx02_", (ftnlen)1262)] = cgrptr[(i__3 = + cvid - 1) < 100000 && 0 <= i__3 ? i__3 : s_rnge("cgrptr", +- i__3, "dskx02_", (ftnlen)1211)]; ++ i__3, "dskx02_", (ftnlen)1262)]; + } + } + +@@ -1870,26 +1921,26 @@ static integer c__0 = 0; + /* the base of its parent coarse voxel. */ + + j = vxlout[(i__2 = vi - 1) < 50000 && 0 <= i__2 ? i__2 : s_rnge( +- "vxlout", i__2, "dskx02_", (ftnlen)1274)]; ++ "vxlout", i__2, "dskx02_", (ftnlen)1325)]; + fx = voxlst[(i__2 = j * 3 - 3) < 150000 && 0 <= i__2 ? i__2 : +- s_rnge("voxlst", i__2, "dskx02_", (ftnlen)1276)] - cgscal ++ s_rnge("voxlst", i__2, "dskx02_", (ftnlen)1327)] - cgscal + * (vxlcg[(i__3 = vi * 3 - 3) < 150000 && 0 <= i__3 ? i__3 +- : s_rnge("vxlcg", i__3, "dskx02_", (ftnlen)1276)] - 1); ++ : s_rnge("vxlcg", i__3, "dskx02_", (ftnlen)1327)] - 1); + fy = voxlst[(i__2 = j * 3 - 2) < 150000 && 0 <= i__2 ? i__2 : +- s_rnge("voxlst", i__2, "dskx02_", (ftnlen)1277)] - cgscal ++ s_rnge("voxlst", i__2, "dskx02_", (ftnlen)1328)] - cgscal + * (vxlcg[(i__3 = vi * 3 - 2) < 150000 && 0 <= i__3 ? i__3 +- : s_rnge("vxlcg", i__3, "dskx02_", (ftnlen)1277)] - 1); ++ : s_rnge("vxlcg", i__3, "dskx02_", (ftnlen)1328)] - 1); + fz = voxlst[(i__2 = j * 3 - 1) < 150000 && 0 <= i__2 ? i__2 : +- s_rnge("voxlst", i__2, "dskx02_", (ftnlen)1278)] - cgscal ++ s_rnge("voxlst", i__2, "dskx02_", (ftnlen)1329)] - cgscal + * (vxlcg[(i__3 = vi * 3 - 1) < 150000 && 0 <= i__3 ? i__3 +- : s_rnge("vxlcg", i__3, "dskx02_", (ftnlen)1278)] - 1); ++ : s_rnge("vxlcg", i__3, "dskx02_", (ftnlen)1329)] - 1); + offset = fx + cgscal * (fy - 1) + cgscl2 * (fz - 1); + + /* Now compute the index of voxel-plate list pointer in */ + /* the pointer array, and look up the pointer. */ + + j = vxlstr[(i__2 = vi - 1) < 50000 && 0 <= i__2 ? i__2 : s_rnge( +- "vxlstr", i__2, "dskx02_", (ftnlen)1286)] + offset - 1; ++ "vxlstr", i__2, "dskx02_", (ftnlen)1337)] + offset - 1; + dski02_(handle, dladsc, &c__10, &j, &c__1, &dim, &voxptr); + if (failed_()) { + chkout_("DSKX02", (ftnlen)6); +@@ -1917,7 +1968,7 @@ static integer c__0 = 0; + dski02_(handle, dladsc, &c__11, &i__3, &nplate, &dim, & + platid[(i__2 = pntr - 1) < 256000 && 0 <= i__2 ? + i__2 : s_rnge("platid", i__2, "dskx02_", (ftnlen) +- 1320)]); ++ 1371)]); + if (failed_()) { + chkout_("DSKX02", (ftnlen)6); + return 0; +@@ -1941,7 +1992,7 @@ static integer c__0 = 0; + + filli_(&vi, &nplate, &source[(i__2 = pntr - 1) < 256000 && 0 + <= i__2 ? i__2 : s_rnge("source", i__2, "dskx02_", ( +- ftnlen)1349)]); ++ ftnlen)1400)]); + } + + /* NPLATE returns zero or greater. */ +@@ -1981,13 +2032,13 @@ static integer c__0 = 0; + /* ID at index I-1 may have been "marked" via negation. */ + + if (platid[(i__3 = ordvec[(i__2 = i__ - 1) < 256000 && 0 <= i__2 ? +- i__2 : s_rnge("ordvec", i__2, "dskx02_", (ftnlen)1393)] ++ i__2 : s_rnge("ordvec", i__2, "dskx02_", (ftnlen)1444)] + - 1) < 256000 && 0 <= i__3 ? i__3 : s_rnge("platid", i__3, +- "dskx02_", (ftnlen)1393)] == (i__6 = platid[(i__5 = ++ "dskx02_", (ftnlen)1444)] == (i__6 = platid[(i__5 = + ordvec[(i__4 = i__ - 2) < 256000 && 0 <= i__4 ? i__4 : +- s_rnge("ordvec", i__4, "dskx02_", (ftnlen)1393)] - 1) < ++ s_rnge("ordvec", i__4, "dskx02_", (ftnlen)1444)] - 1) < + 256000 && 0 <= i__5 ? i__5 : s_rnge("platid", i__5, "dsk" +- "x02_", (ftnlen)1393)], abs(i__6))) { ++ "x02_", (ftnlen)1444)], abs(i__6))) { + + /* The plates having indices ORDVEC(I-1) and ORDVEC(I) are */ + /* duplicates. */ +@@ -2001,7 +2052,7 @@ static integer c__0 = 0; + /* index ORDVEC(I). */ + + if (ordvec[(i__2 = i__ - 1) < 256000 && 0 <= i__2 ? i__2 : +- s_rnge("ordvec", i__2, "dskx02_", (ftnlen)1407)] < ++ s_rnge("ordvec", i__2, "dskx02_", (ftnlen)1458)] < + minidx) { + + /* The plate that was previously at the minimum index is */ +@@ -2009,26 +2060,26 @@ static integer c__0 = 0; + /* the current plate ID value is ORDVEC(I). */ + + platid[(i__2 = minidx - 1) < 256000 && 0 <= i__2 ? i__2 : +- s_rnge("platid", i__2, "dskx02_", (ftnlen)1413)] = ++ s_rnge("platid", i__2, "dskx02_", (ftnlen)1464)] = + -platid[(i__3 = minidx - 1) < 256000 && 0 <= + i__3 ? i__3 : s_rnge("platid", i__3, "dskx02_", ( +- ftnlen)1413)]; ++ ftnlen)1464)]; + minidx = ordvec[(i__2 = i__ - 1) < 256000 && 0 <= i__2 ? + i__2 : s_rnge("ordvec", i__2, "dskx02_", (ftnlen) +- 1414)]; ++ 1465)]; + } else { + + /* The current plate is a duplicate; mark it. */ + + platid[(i__3 = ordvec[(i__2 = i__ - 1) < 256000 && 0 <= + i__2 ? i__2 : s_rnge("ordvec", i__2, "dskx02_", ( +- ftnlen)1420)] - 1) < 256000 && 0 <= i__3 ? i__3 : +- s_rnge("platid", i__3, "dskx02_", (ftnlen)1420)] = ++ ftnlen)1471)] - 1) < 256000 && 0 <= i__3 ? i__3 : ++ s_rnge("platid", i__3, "dskx02_", (ftnlen)1471)] = + -platid[(i__5 = ordvec[(i__4 = i__ - 1) < 256000 + && 0 <= i__4 ? i__4 : s_rnge("ordvec", i__4, +- "dskx02_", (ftnlen)1420)] - 1) < 256000 && 0 <= ++ "dskx02_", (ftnlen)1471)] - 1) < 256000 && 0 <= + i__5 ? i__5 : s_rnge("platid", i__5, "dskx02_", ( +- ftnlen)1420)]; ++ ftnlen)1471)]; + } + } else { + +@@ -2036,7 +2087,7 @@ static integer c__0 = 0; + /* ID has no duplicates. */ + + minidx = ordvec[(i__2 = i__ - 1) < 256000 && 0 <= i__2 ? i__2 +- : s_rnge("ordvec", i__2, "dskx02_", (ftnlen)1429)]; ++ : s_rnge("ordvec", i__2, "dskx02_", (ftnlen)1480)]; + } + } + +@@ -2061,7 +2112,7 @@ static integer c__0 = 0; + /* Retrieve the current plate ID. */ + + j = platid[(i__1 = i__ - 1) < 256000 && 0 <= i__1 ? i__1 : s_rnge( +- "platid", i__1, "dskx02_", (ftnlen)1459)]; ++ "platid", i__1, "dskx02_", (ftnlen)1510)]; + if (j > 0) { + + /* This is not a duplicate plate; consider it. */ +@@ -2073,7 +2124,7 @@ static integer c__0 = 0; + /* later voxel. */ + + if (source[(i__1 = i__ - 1) < 256000 && 0 <= i__1 ? i__1 : +- s_rnge("source", i__1, "dskx02_", (ftnlen)1472)] ++ s_rnge("source", i__1, "dskx02_", (ftnlen)1523)] + > final) { + + /* This is a "late plate": it occurs in a voxel later */ +@@ -2102,16 +2153,16 @@ static integer c__0 = 0; + + vloc = isrchi_(&vids[(i__1 = k - 1) < 3 && 0 <= i__1 ? + i__1 : s_rnge("vids", i__1, "dskx02_", ( +- ftnlen)1506)], &nvbuf, vidxs); ++ ftnlen)1557)], &nvbuf, vidxs); + if (vloc > 0) { + + /* The vertex was buffered; just copy it. */ + + vequ_(&vbuff[(i__1 = vloc * 3 - 3) < 600 && 0 <= + i__1 ? i__1 : s_rnge("vbuff", i__1, "dsk" +- "x02_", (ftnlen)1512)], &points[(i__2 = k * ++ "x02_", (ftnlen)1563)], &points[(i__2 = k * + 3 - 3) < 9 && 0 <= i__2 ? i__2 : s_rnge( +- "points", i__2, "dskx02_", (ftnlen)1512)]) ++ "points", i__2, "dskx02_", (ftnlen)1563)]) + ; + } else { + +@@ -2119,11 +2170,11 @@ static integer c__0 = 0; + + start = (vids[(i__1 = k - 1) < 3 && 0 <= i__1 ? + i__1 : s_rnge("vids", i__1, "dskx02_", ( +- ftnlen)1518)] - 1) * 3 + 1; ++ ftnlen)1569)] - 1) * 3 + 1; + dskd02_(handle, dladsc, &c__19, &start, &c__3, & + dim, &points[(i__1 = k * 3 - 3) < 9 && 0 + <= i__1 ? i__1 : s_rnge("points", i__1, +- "dskx02_", (ftnlen)1520)]); ++ "dskx02_", (ftnlen)1571)]); + if (failed_()) { + chkout_("DSKX02", (ftnlen)6); + return 0; +@@ -2135,15 +2186,15 @@ static integer c__0 = 0; + ++nvbuf; + vequ_(&points[(i__1 = k * 3 - 3) < 9 && 0 <= + i__1 ? i__1 : s_rnge("points", i__1, +- "dskx02_", (ftnlen)1536)], &vbuff[( ++ "dskx02_", (ftnlen)1587)], &vbuff[( + i__2 = nvbuf * 3 - 3) < 600 && 0 <= + i__2 ? i__2 : s_rnge("vbuff", i__2, +- "dskx02_", (ftnlen)1536)]); ++ "dskx02_", (ftnlen)1587)]); + vidxs[(i__1 = nvbuf - 1) < 200 && 0 <= i__1 ? + i__1 : s_rnge("vidxs", i__1, "dskx02_" +- , (ftnlen)1538)] = vids[(i__2 = k - 1) ++ , (ftnlen)1589)] = vids[(i__2 = k - 1) + < 3 && 0 <= i__2 ? i__2 : s_rnge( +- "vids", i__2, "dskx02_", (ftnlen)1538) ++ "vids", i__2, "dskx02_", (ftnlen)1589) + ]; + } + } +@@ -2158,8 +2209,8 @@ static integer c__0 = 0; + /* round-off error from causing the ray to miss the */ + /* plate. Compute the edges of the tetrahedral angle */ + /* with the observer as the apex and the vertices as */ +-/* members of the edge rays. Finally see if the */ +-/* boresight lies inside the tetrahedron. */ ++/* members of the edge rays. Finally see if the ray */ ++/* lies inside the tetrahedron. */ + + vsubg_(points, obsmat, &c__9, edges); + pltexp_(edges, &xpdfrc, xpnts); +@@ -2175,7 +2226,7 @@ static integer c__0 = 0; + } + if (hits) { + +-/* The boresight intersects this plate. */ ++/* The ray intersects this plate. */ + + if (! have || scale < near__) { + +@@ -2188,10 +2239,14 @@ static integer c__0 = 0; + /* If this intersection point is closer to the */ + /* ray's vertex than the last one, pick this point */ + /* and the plate it's on. */ +-/* ___ ____ __________ */ +-/* XPT = VTX2 + SCALE*UDIR */ + +- vlcom_(&c_b40, vtx2, &scale, udir, xpt); ++/* Note that we don't yet know that this solution */ ++/* is valid. */ ++ ++/* ___ ____ __________ */ ++/* XPT2 = VTX2 + SCALE*UDIR */ ++ ++ vlcom_(&c_b40, vtx2, &scale, udir, xpt2); + + /* Compute the voxel grid coordinates of the */ + /* intercept. HITCOR is a double precision vector */ +@@ -2199,25 +2254,25 @@ static integer c__0 = 0; + /* be precise). Note that the components of HITCOR */ + /* are zero-based. */ + +- zztogrid_(xpt, voxori, &voxsiz, hitcor); ++ zztogrid_(xpt2, voxori, &voxsiz, hitcor); + + /* Look up the voxel grid coordinates (integer, */ + /* 1-based) of the current voxel. */ + + k = vxlout[(i__2 = source[(i__1 = i__ - 1) < + 256000 && 0 <= i__1 ? i__1 : s_rnge("sou" +- "rce", i__1, "dskx02_", (ftnlen)1615)] - 1) ++ "rce", i__1, "dskx02_", (ftnlen)1670)] - 1) + < 50000 && 0 <= i__2 ? i__2 : s_rnge( +- "vxlout", i__2, "dskx02_", (ftnlen)1615)]; ++ "vxlout", i__2, "dskx02_", (ftnlen)1670)]; + vxc1 = voxlst[(i__1 = k * 3 - 3) < 150000 && 0 <= + i__1 ? i__1 : s_rnge("voxlst", i__1, +- "dskx02_", (ftnlen)1617)]; ++ "dskx02_", (ftnlen)1672)]; + vxc2 = voxlst[(i__1 = k * 3 - 2) < 150000 && 0 <= + i__1 ? i__1 : s_rnge("voxlst", i__1, +- "dskx02_", (ftnlen)1618)]; ++ "dskx02_", (ftnlen)1673)]; + vxc3 = voxlst[(i__1 = k * 3 - 1) < 150000 && 0 <= + i__1 ? i__1 : s_rnge("voxlst", i__1, +- "dskx02_", (ftnlen)1619)]; ++ "dskx02_", (ftnlen)1674)]; + invox = hitcor[0] > vxc1 - xtol - 1 && hitcor[0] < + vxc1 + xtol && hitcor[1] > vxc2 - xtol - + 1 && hitcor[1] < vxc2 + xtol && hitcor[2] +@@ -2230,7 +2285,7 @@ static integer c__0 = 0; + /* are extended using the "greedy" margin. */ + + dskgtl_(&c__2, &greedm); +- zzinvelt_(xpt, &corsys, &dskdsc[6], &dskdsc[ ++ zzinvelt_(xpt2, &corsys, &dskdsc[6], &dskdsc[ + 16], &greedm, &c__0, &inseg); + if (inseg) { + +@@ -2241,13 +2296,14 @@ static integer c__0 = 0; + /* intercepts beyond the voxel designated by */ + /* FINAL. */ + ++ vequ_(xpt2, xpt); + have = TRUE_; + near__ = scale; + *plid = j; + final = source[(i__1 = i__ - 1) < 256000 + && 0 <= i__1 ? i__1 : s_rnge( + "source", i__1, "dskx02_", ( +- ftnlen)1657)]; ++ ftnlen)1714)]; + + /* Indicate that a solution was found. We'll */ + /* keep looking for a better one if PLID is */ +@@ -2268,11 +2324,11 @@ static integer c__0 = 0; + if ((i__3 = platid[(i__2 = k - 1) < + 256000 && 0 <= i__2 ? i__2 : + s_rnge("platid", i__2, "dskx02_", +- (ftnlen)1678)], abs(i__3)) == w) { ++ (ftnlen)1735)], abs(i__3)) == w) { + platid[(i__2 = k - 1) < 256000 && 0 <= + i__2 ? i__2 : s_rnge("platid" + , i__2, "dskx02_", (ftnlen) +- 1679)] = w; ++ 1736)] = w; + } + } + } +--- a/src/cspice/subpnt.c ++++ b/src/cspice/subpnt.c +@@ -2095,6 +2095,13 @@ static integer c__3 = 3; + + /* $ Version */ + ++/* - SPICELIB Version 2.1.0, 25-OCT-2017 (NJB) */ ++ ++/* Bug fix: TRGEPC is now initialized prior to first use. */ ++/* Previously the lack of initialization could cause this routine */ ++/* to fail to find DSK data within the time bounds of a DSK */ ++/* segment. */ ++ + /* - SPICELIB Version 2.0.0, 04-APR-2017 (NJB) */ + + /* Added FAILED tests. */ +@@ -2504,6 +2511,10 @@ static integer c__3 = 3; + + vminus_(tpos, obspos); + ++/* Make a first estimate of the target epoch. */ ++ ++ *trgepc = *et + s * lt; ++ + /* Find the sub-observer point given the target epoch, */ + /* observer-target position, and target body orientation we've */ + /* already computed. If we're not using light time correction, this */ diff --git a/recipes/cspice/all/test_package/CMakeLists.txt b/recipes/cspice/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..19e72e03db2a8 --- /dev/null +++ b/recipes/cspice/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cspice REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cspice::cspice) diff --git a/recipes/cspice/all/test_package/conanfile.py b/recipes/cspice/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cspice/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/cspice/all/test_package/test_package.c b/recipes/cspice/all/test_package/test_package.c new file mode 100644 index 0000000000000..7d858a1804f32 --- /dev/null +++ b/recipes/cspice/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include "SpiceUsr.h" + +#include + +int main () { + ConstSpiceDouble rectan[3] = {0.0000, 1.0000, 1.0000}; + SpiceDouble radius; + SpiceDouble longitude; + SpiceDouble latitude; + + reclat_c(rectan, &radius, &longitude, &latitude); + longitude *= dpr_c(); + latitude *= dpr_c(); + + printf("Rectangular coordinates X=%f, Y=%f, Z=%f <=> Latitudinal coordinates r=%f, longitude=%f deg, latitude=%f deg\n", + rectan[0], rectan[1], rectan[2], radius, longitude, latitude); + + return 0; +} diff --git a/recipes/cspice/all/test_v1_package/CMakeLists.txt b/recipes/cspice/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cspice/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cspice/all/test_v1_package/conanfile.py b/recipes/cspice/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cspice/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/cspice/config.yml b/recipes/cspice/config.yml new file mode 100644 index 0000000000000..2624f80e58dbf --- /dev/null +++ b/recipes/cspice/config.yml @@ -0,0 +1,5 @@ +versions: + "0067": + folder: all + "0066": + folder: all diff --git a/recipes/csvmonkey/all/conandata.yml b/recipes/csvmonkey/all/conandata.yml new file mode 100644 index 0000000000000..299ceba354465 --- /dev/null +++ b/recipes/csvmonkey/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.5": + url: "https://github.com/dw/csvmonkey/archive/594ad9854b7a77ccb8e26260b1e1a4300ba18465.tar.gz" + sha256: "89db5c3cdee4e6d59945edbca054695d9ee2d1150c92a26282c0e35f041729ac" diff --git a/recipes/csvmonkey/all/conanfile.py b/recipes/csvmonkey/all/conanfile.py new file mode 100644 index 0000000000000..49542ed86e55c --- /dev/null +++ b/recipes/csvmonkey/all/conanfile.py @@ -0,0 +1,78 @@ +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.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class CSVMONEKYConan(ConanFile): + name = "csvmonkey" + description = "Header-only vectorized, lazy-decoding, zero-copy CSV file parser" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dw/csvmonkey/" + topics = ("csv-parser", "header-only", "vectorized") + settings = "os", "arch", "compiler", "build_type" + options = { + "with_spirit": [True, False], + } + default_options = { + "with_spirit": False, + } + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_spirit: + self.requires("boost/1.81.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) + + if self.settings.arch not in ("x86", "x86_64",): + raise ConanInvalidConfiguration(f"{self.ref} requires x86 architecture.") + + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio C++.") + + 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"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "csvmonkey") + self.cpp_info.set_property("cmake_target_name", "csvmonkey::csvmonkey") + self.cpp_info.set_property("pkg_config_name", "csvmonkey") + + if self.options.with_spirit: + self.cpp_info.defines.append("USE_SPIRIT") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "csvmonkey" + self.cpp_info.filenames["cmake_find_package_multi"] = "csvmonkey" + self.cpp_info.names["cmake_find_package"] = "csvmonkey" + self.cpp_info.names["cmake_find_package_multi"] = "csvmonkey" diff --git a/recipes/csvmonkey/all/test_package/CMakeLists.txt b/recipes/csvmonkey/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd4b892a1c012 --- /dev/null +++ b/recipes/csvmonkey/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(csvmonkey CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE csvmonkey::csvmonkey) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/csvmonkey/all/test_package/conanfile.py b/recipes/csvmonkey/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/csvmonkey/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/csvmonkey/all/test_package/test_package.cpp b/recipes/csvmonkey/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e1669a1c2b39e --- /dev/null +++ b/recipes/csvmonkey/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "csvmonkey.hpp" + +int main() { + csvmonkey::MappedFileCursor stream{}; + + return 0; +} diff --git a/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt b/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/csvmonkey/all/test_v1_package/conanfile.py b/recipes/csvmonkey/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/csvmonkey/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/csvmonkey/config.yml b/recipes/csvmonkey/config.yml new file mode 100644 index 0000000000000..6506e357707be --- /dev/null +++ b/recipes/csvmonkey/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.5": + folder: all diff --git a/recipes/ctml/all/conandata.yml b/recipes/ctml/all/conandata.yml new file mode 100644 index 0000000000000..ba4b9057c6b96 --- /dev/null +++ b/recipes/ctml/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.0": + url: "https://github.com/tinfoilboy/CTML/archive/refs/tags/2.0.0.tar.gz" + sha256: "e13b3bb04903f47b90b286f8a4695232179e28474a0a33f1a3f333552338d132" diff --git a/recipes/ctml/all/conanfile.py b/recipes/ctml/all/conanfile.py new file mode 100644 index 0000000000000..b5c3dd7c38f7d --- /dev/null +++ b/recipes/ctml/all/conanfile.py @@ -0,0 +1,42 @@ +import os +from conans import ConanFile, tools + +required_conan_version = ">=1.43.0" + +class CtmlLibrariesConan(ConanFile): + name = "ctml" + description = "A C++ HTML document constructor only depending on the standard library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tinfoilboy/CTML" + topics = ("generator", "html", ) + settings = "os", "arch", "compiler", "build_type", + generators = "cmake", + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE*", "licenses", self._source_subfolder) + self.copy("ctml.hpp", "include", os.path.join(self._source_subfolder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CTML") + self.cpp_info.set_property("cmake_target_name", "CTML::CTML") + + self.cpp_info.filenames["cmake_find_package"] = "CTML" + self.cpp_info.filenames["cmake_find_package_multi"] = "CTML" + self.cpp_info.names["cmake_find_package"] = "CTML" + self.cpp_info.names["cmake_find_package_multi"] = "CTML" diff --git a/recipes/ctml/all/test_package/CMakeLists.txt b/recipes/ctml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1df60de830867 --- /dev/null +++ b/recipes/ctml/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(CTML CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CTML::CTML) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ctml/all/test_package/conanfile.py b/recipes/ctml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..270a1ae971491 --- /dev/null +++ b/recipes/ctml/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestWrapperConan(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/ctml/all/test_package/test_package.cpp b/recipes/ctml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c7627f90fb776 --- /dev/null +++ b/recipes/ctml/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include "ctml.hpp" + +int main() { + CTML::Node node("div#first section#second article#third"); + + std::cout << node.ToString() << std::endl; + + return 0; +} diff --git a/recipes/ctml/config.yml b/recipes/ctml/config.yml new file mode 100644 index 0000000000000..d77ad03cbf510 --- /dev/null +++ b/recipes/ctml/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0": + folder: all diff --git a/recipes/ctpg/all/conandata.yml b/recipes/ctpg/all/conandata.yml new file mode 100644 index 0000000000000..e352628a7b1dd --- /dev/null +++ b/recipes/ctpg/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.3.7": + url: "https://github.com/peter-winter/ctpg/archive/refs/tags/v1.3.7.tar.gz" + sha256: "6cc7c34de4983e21070599fd5693b65ef08cd5c8f42612e43b47eda723623429" + "1.3.6": + url: "https://github.com/peter-winter/ctpg/archive/refs/tags/v1.3.6.tar.gz" + sha256: "8ad5e06ab551fe30ff10faf6b53b85c862a873e3827505d5f5b63aae2b836ba2" + "1.3.5": + url: "https://github.com/peter-winter/ctpg/archive/refs/tags/v1.3.5.tar.gz" + sha256: "6874e71aecace33a07dd202c5c6c53277653d54daa13b460f4e1eb5b0c902d42" diff --git a/recipes/ctpg/all/conanfile.py b/recipes/ctpg/all/conanfile.py new file mode 100644 index 0000000000000..bd69eefe8c5a2 --- /dev/null +++ b/recipes/ctpg/all/conanfile.py @@ -0,0 +1,59 @@ +from conans.errors import ConanInvalidConfiguration +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + +class CTPGConan(ConanFile): + name = "ctpg" + license = "MIT" + description = ( + "Compile Time Parser Generator is a C++ single header library which takes a language description as a C++ code " + "and turns it into a LR1 table parser with a deterministic finite automaton lexical analyzer, all in compile time." + ) + topics = ("regex", "parser", "grammar", "compile-time") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/peter-winter/ctpg" + settings = "compiler", + no_copy_source = True + + _compiler_required_cpp17 = { + "Visual Studio": "16", + "gcc": "8", + "clang": "12", + "apple-clang": "12.0", + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + ## TODO: In ctpg<=1.3.5, Visual Studio C++ failed to compile ctpg with "error MSB6006: "CL.exe" exited with code -1073741571." + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("{} does not support Visual Studio currently.".format(self.name)) + + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, "17") + + minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE*", "licenses", self._source_subfolder) + if tools.Version(self.version) >= "1.3.7": + self.copy("ctpg.hpp", + os.path.join("include", "ctpg"), + os.path.join(self._source_subfolder, "include", "ctpg")) + else: + self.copy("ctpg.hpp", "include", os.path.join(self._source_subfolder, "include")) diff --git a/recipes/ctpg/all/test_package/CMakeLists.txt b/recipes/ctpg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b09bb90b2f88d --- /dev/null +++ b/recipes/ctpg/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ctpg CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ctpg::ctpg) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +if(CTPG_PLACED_CPTG_FOLDER) + target_compile_definitions(${PROJECT_NAME} PUBLIC CTPG_PLACED_CPTG_FOLDER) +endif() + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + target_compile_options(${PROJECT_NAME} PUBLIC -constexpr:depth3000000) + target_compile_options(${PROJECT_NAME} PUBLIC -constexpr:steps3000000) +endif() diff --git a/recipes/ctpg/all/test_package/conanfile.py b/recipes/ctpg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..34c01340114ef --- /dev/null +++ b/recipes/ctpg/all/test_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.definitions["CTPG_PLACED_CPTG_FOLDER"] = tools.Version(self.deps_cpp_info["ctpg"].version) >= "1.3.7" + 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/ctpg/all/test_package/test_package.cpp b/recipes/ctpg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bcd377f23cbd8 --- /dev/null +++ b/recipes/ctpg/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#ifdef CTPG_PLACED_CPTG_FOLDER +# include "ctpg/ctpg.hpp" +#else +# include "ctpg.hpp" +#endif + +#include + +constexpr ctpg::nterm list("list"); +constexpr char number_pattern[] = "[1-9][0-9]*"; +constexpr ctpg::regex_term number("number"); + +int to_int(std::string_view sv) { + int i = 0; + for (auto c : sv) { + i = i * 10 + (c - '0'); + } + return i; +} + +constexpr ctpg::parser p( + list, + terms(',', number), + nterms(list), + rules( + list(number) >= to_int, + list(list, ',', number) >= [](int sum, char, const auto& n){ return sum + to_int(n); } + ) +); + +int main(int argc, char* argv[]) { + auto res = p.parse(ctpg::buffers::string_buffer("10, 20, 30"), std::cerr); + bool success = res.has_value(); + if (success) + std::cout << res.value() << std::endl; + return success ? 0 : -1; +} diff --git a/recipes/ctpg/config.yml b/recipes/ctpg/config.yml new file mode 100644 index 0000000000000..3da45bc778250 --- /dev/null +++ b/recipes/ctpg/config.yml @@ -0,0 +1,7 @@ +versions: + "1.3.7": + folder: all + "1.3.6": + folder: all + "1.3.5": + folder: all diff --git a/recipes/ctre/all/conandata.yml b/recipes/ctre/all/conandata.yml new file mode 100644 index 0000000000000..0cbb6fc297fa1 --- /dev/null +++ b/recipes/ctre/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "3.7.2": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.7.2.tar.gz" + sha256: "0711a6f97496e010f72adab69839939a9e50ba35ad87779e422ae3ff3b0edfc3" + "3.7.1": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.7.1.tar.gz" + sha256: "d00d7eaa0e22f2fdaa947a532b81b6fc35880acf4887b50a5ac9bfb7411ced03" + "3.7": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.7.tar.gz" + sha256: "12be2a37f7fe39c489f646d3faee534f965871fd998258162962f36a19a455ef" + "3.6": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.6.tar.gz" + sha256: "82633af08edff556f1401e1cf247e44eeef50f0588202731fddab183e9fda6d0" + "3.5": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.5.tar.gz" + sha256: "94b5cbf90057b252119e9a0ce459e3b488decb98e57163b00a6c7c494cd0761e" + "3.4.1": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.4.1.tar.gz" + sha256: "c4a1a88b8c4a8c267507a3da3707f29a2b7c1f722e27d695296f152501a414ab" + "3.3.4": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.3.4.tar.gz" + sha256: "8161f0d3100fc690590f475aa9acb70163ed7f2922e35e13136dececc52c49a9" + "3.2": + url: https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.2.tar.gz + sha256: d4e734e3dd501f741424aceb5198f5ebbc35c624335c99f7e202a9ecb31cd3e6 + "3.1": + url: https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.1.tar.gz + sha256: c209ab0533b56a4fbbc7959e10c91c89fe2c9cb1725b64ed52be272a534a1d83 + "2.10": + url: https://github.com/hanickadot/compile-time-regular-expressions/archive/v2.10.tar.gz + sha256: 2e166b672c5a733b5448bb9fc83db54d92852c39e3e19097b79307cc6a327c31 diff --git a/recipes/ctre/all/conanfile.py b/recipes/ctre/all/conanfile.py new file mode 100644 index 0000000000000..4a9068c2ee4fe --- /dev/null +++ b/recipes/ctre/all/conanfile.py @@ -0,0 +1,64 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy + +required_conan_version = ">=1.50.0" + + +class CtreConan(ConanFile): + name = "ctre" + description = "Compile Time Regular Expression for C++17/20" + license = ("Apache-2.0", "LLVM-exception") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hanickadot/compile-time-regular-expressions" + topics = ("cpp17", "regex", "compile-time-regular-expressions", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + compiler = self.settings.compiler + compiler_version = Version(self.settings.compiler.version) + ctre_version = Version(self.version) + + min_gcc = "7.4" if ctre_version < "3" else "8" + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") + if is_msvc(self): + if compiler_version < "15": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC < 15") + if ctre_version >= "3.7" and compiler_version < 16: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC < 16") + elif compiler == "gcc" and compiler_version < min_gcc: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < {min_gcc}") + elif compiler == "clang" and compiler_version < "6.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 6.0") + elif compiler == "apple-clang": + if compiler_version < "10.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Apple clang < 10.0") + # "library does not compile with (at least) Xcode 12.0-12.4" + # https://github.com/hanickadot/compile-time-regular-expressions/issues/188 + # it's also occurred in Xcode 13. + if ctre_version.major == "3" and ctre_version.minor == "4" and compiler_version >= "12": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Apple clang") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/ctre/all/test_package/CMakeLists.txt b/recipes/ctre/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a3f2fba7b1674 --- /dev/null +++ b/recipes/ctre/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(ctre CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ctre::ctre) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) diff --git a/recipes/ctre/all/test_package/conanfile.py b/recipes/ctre/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5641139581565 --- /dev/null +++ b/recipes/ctre/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + +class CtreTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + 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/ctre/all/test_package/test_package.cpp b/recipes/ctre/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62d658dad0a18 --- /dev/null +++ b/recipes/ctre/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +#include +#include + +int main() {} + +using namespace std::string_view_literals; + +static inline constexpr auto pattern1 = ctll::fixed_string{"^[\\x30-\\x39]+?$"}; +static inline constexpr auto pattern2 = ctll::fixed_string{""}; + + +static_assert(ctre::re().match("123456789"sv)); +static_assert(ctre::re().match(""sv)); + +template constexpr bool re() { +#if (__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L)) + constexpr auto _ptn = ptn; +#else + constexpr auto & _ptn = ptn; +#endif + return ctll::parser::template correct_with>; +} + +static_assert(re()); + +static inline constexpr ctll::fixed_string pat = "hello"; + +template constexpr bool re2() { +#if (__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L)) + constexpr auto _ptn = ptn; +#else + constexpr auto & _ptn = ptn; +#endif + return ctll::parser::template correct_with>; +} + +static_assert(re()); + +static_assert(ctre::re().match("hello"sv)); + +static_assert(ctre::match("hello"sv)); diff --git a/recipes/ctre/all/test_v1_package/CMakeLists.txt b/recipes/ctre/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bdcd221de0a2c --- /dev/null +++ b/recipes/ctre/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package 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/ctre/all/test_v1_package/conanfile.py b/recipes/ctre/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f44a943c8f6 --- /dev/null +++ b/recipes/ctre/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class CtreTestConan(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/ctre/config.yml b/recipes/ctre/config.yml new file mode 100644 index 0000000000000..791985db54420 --- /dev/null +++ b/recipes/ctre/config.yml @@ -0,0 +1,21 @@ +versions: + "3.7.2": + folder: all + "3.7.1": + folder: all + "3.7": + folder: all + "3.6": + folder: all + "3.5": + folder: all + "3.4.1": + folder: all + "3.3.4": + folder: all + "3.2": + folder: all + "3.1": + folder: all + "2.10": + folder: all diff --git a/recipes/cubicinterpolation/all/CMakeLists.txt b/recipes/cubicinterpolation/all/CMakeLists.txt new file mode 100644 index 0000000000000..0ed622c3eb5d7 --- /dev/null +++ b/recipes/cubicinterpolation/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATH) + +add_subdirectory("source_subfolder") diff --git a/recipes/cubicinterpolation/all/conandata.yml b/recipes/cubicinterpolation/all/conandata.yml new file mode 100644 index 0000000000000..7a7f4164cb542 --- /dev/null +++ b/recipes/cubicinterpolation/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "0.1.5": + url: "https://github.com/tudo-astroparticlephysics/cubic_interpolation/archive/v0.1.5.tar.gz" + sha256: "fc34de15c9dd9e651728c9e0eee5528ee9636e41a3d8aa6f41735018810afd59" + "0.1.4": + url: "https://github.com/tudo-astroparticlephysics/cubic_interpolation/archive/v0.1.4.tar.gz" + sha256: "38bb8fe46b19b135bfcba79e098c5d90284f0bc02f42f86118aefcb63aed7668" + "0.1.3": + url: "https://github.com/tudo-astroparticlephysics/cubic_interpolation/archive/v0.1.3.tar.gz" + sha256: "3151d99ecbbddd4e57605ff1919bdf234d08336b47d369b9dc562acff780aaf7" +patches: + "0.1.4": + - patch_file: "patches/patch_conanbuildinfo.diff" + patch_type: "conan" + - patch_file: "patches/rm_conan_basic_setup.diff" + patch_type: "conan" + "0.1.3": + - patch_file: "patches/patch_conanbuildinfo.diff" + patch_type: "conan" + - patch_file: "patches/rm_conan_basic_setup.diff" + patch_type: "conan" diff --git a/recipes/cubicinterpolation/all/conanfile.py b/recipes/cubicinterpolation/all/conanfile.py new file mode 100644 index 0000000000000..722cbaa5424a1 --- /dev/null +++ b/recipes/cubicinterpolation/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc, check_min_vs +import os + +required_conan_version = ">=1.57.0" + + +class CubicInterpolationConan(ConanFile): + name = "cubicinterpolation" + homepage = "https://github.com/MaxSac/cubic_interpolation" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + description = "Leightweight interpolation library based on boost and eigen." + topics = ("interpolation", "splines", "cubic", "bicubic", "boost", "eigen3") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + def export_sources(self): + export_conandata_patches(self) + + 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 requirements(self): + # TODO: update boost dependency as soon as we deprecate conan1.x (see discussion in #11207) + self.requires("boost/1.75.0") + self.requires("eigen/3.3.9") + + @property + def _required_boost_components(self): + return ["filesystem", "math", "serialization"] + + 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) + 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.get_safe("cppstd"): + check_min_cppstd(self, "14") + + if not check_min_vs(self, 192, raise_invalid=False): + raise ConanInvalidConfiguration(f"{self.ref} currently Visual Studio < 2019 not yet supported in this recipe. Contributions are welcome") + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared is not supported with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLE"] = False + tc.variables["BUILD_DOCUMENTATION"] = 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CubicInterpolation") + self.cpp_info.set_property("cmake_target_name", "CubicInterpolation::CubicInterpolation") + self.cpp_info.libs = ["CubicInterpolation"] + self.cpp_info.requires = ["boost::headers", "boost::filesystem", "boost::math", "boost::serialization", "eigen::eigen"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "CubicInterpolation" + self.cpp_info.names["cmake_find_package_multi"] = "CubicInterpolation" diff --git a/recipes/cubicinterpolation/all/patches/patch_conanbuildinfo.diff b/recipes/cubicinterpolation/all/patches/patch_conanbuildinfo.diff new file mode 100644 index 0000000000000..a97479b5d1290 --- /dev/null +++ b/recipes/cubicinterpolation/all/patches/patch_conanbuildinfo.diff @@ -0,0 +1,24 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0199a76..b7cd42c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -11,8 +11,10 @@ add_subdirectory(CubicInterpolation) + add_subdirectory(detail) + + target_link_libraries(CubicInterpolation +- CONAN_PKG::eigen +- CONAN_PKG::boost ++ Eigen3::Eigen ++ Boost::boost ++ Boost::filesystem ++ Boost::serialization + ) + + target_include_directories(CubicInterpolation PUBLIC +@@ -46,6 +48,3 @@ configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CubicInterpolationConfig.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CubicInterpolation + ) +- +-install(FILES "${PROJECT_BINARY_DIR}/conanbuildinfo.cmake" +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CubicInterpolation) diff --git a/recipes/cubicinterpolation/all/patches/rm_conan_basic_setup.diff b/recipes/cubicinterpolation/all/patches/rm_conan_basic_setup.diff new file mode 100644 index 0000000000000..6bc1808f2d777 --- /dev/null +++ b/recipes/cubicinterpolation/all/patches/rm_conan_basic_setup.diff @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index db6eb04..b319d33 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,8 +9,8 @@ set(CubicInterpolation_VERSION ${CubicInterpolation_VERSION_MAJOR}.${CubicInterp + + set(CMAKE_CXX_STANDARD 14) + +-include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +-conan_basic_setup(TARGETS) ++find_package(Eigen3 REQUIRED) ++find_package(Boost COMPONENTS filesystem serialization REQUIRED) + + add_subdirectory(src) + diff --git a/recipes/cubicinterpolation/all/test_package/CMakeLists.txt b/recipes/cubicinterpolation/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b98fa443a5368 --- /dev/null +++ b/recipes/cubicinterpolation/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(CubicInterpolation REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CubicInterpolation::CubicInterpolation) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/cubicinterpolation/all/test_package/conanfile.py b/recipes/cubicinterpolation/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cubicinterpolation/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/cubicinterpolation/all/test_package/test_package.cpp b/recipes/cubicinterpolation/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ab848742d9391 --- /dev/null +++ b/recipes/cubicinterpolation/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include "CubicInterpolation/Axis.h" +#include "CubicInterpolation/CubicSplines.h" +#include "CubicInterpolation/Interpolant.h" + +double func(double x) { return x * x + x; } + +int main(int argc, char* argv[]) +{ + + auto def = cubic_splines::CubicSplines::Definition(); + def.f = func; + def.axis = std::make_unique>( + -2.f, 2.f, (size_t)10); + + auto inter + = cubic_splines::Interpolant>( + std::move(def), "", ""); + + auto res = inter.evaluate(1.2345f); + + return 0; +} diff --git a/recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt b/recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ea0378c83fe1 --- /dev/null +++ b/recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package 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/cubicinterpolation/all/test_v1_package/conanfile.py b/recipes/cubicinterpolation/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cubicinterpolation/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/cubicinterpolation/config.yml b/recipes/cubicinterpolation/config.yml new file mode 100644 index 0000000000000..5185d65a2df90 --- /dev/null +++ b/recipes/cubicinterpolation/config.yml @@ -0,0 +1,7 @@ +versions: + "0.1.5": + folder: all + "0.1.4": + folder: all + "0.1.3": + folder: all diff --git a/recipes/cuda-kat/all/conandata.yml b/recipes/cuda-kat/all/conandata.yml new file mode 100644 index 0000000000000..1e1d88dea820e --- /dev/null +++ b/recipes/cuda-kat/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2": + url: "https://github.com/eyalroz/cuda-kat/archive/refs/tags/v0.2.tar.gz" + sha256: "1d5fc1172663f1db0e98d000ea0b1ab4c033a974090024559199954fd1c6b63f" diff --git a/recipes/cuda-kat/all/conanfile.py b/recipes/cuda-kat/all/conanfile.py new file mode 100644 index 0000000000000..dfc221ba485b8 --- /dev/null +++ b/recipes/cuda-kat/all/conanfile.py @@ -0,0 +1,54 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class CudaKatConan(ConanFile): + name = "cuda-kat" + homepage = "https://github.com/eyalroz/cuda-kat" + description = "CUDA kernel author's tools" + topics = ("gpgpu", "cuda", "cuda-kat", "header-only") + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("CUDA-kat library are not compatible on Windows") + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++17") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE*", src=self._source_subfolder, dst="licenses") + self.copy("*", src=os.path.join(self._source_subfolder, "src"), dst="include") + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "cuda-kat" + self.cpp_info.names["cmake_find_package_multi"] = "cuda-kat" diff --git a/recipes/cuda-kat/all/test_package/CMakeLists.txt b/recipes/cuda-kat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a6fd14216f176 --- /dev/null +++ b/recipes/cuda-kat/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cuda-kat REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cuda-kat::cuda-kat) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) diff --git a/recipes/cuda-kat/all/test_package/conanfile.py b/recipes/cuda-kat/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/cuda-kat/all/test_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/cuda-kat/all/test_package/test_package.cpp b/recipes/cuda-kat/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b8d25e32f26c1 --- /dev/null +++ b/recipes/cuda-kat/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + + +int main() { + auto t = kat::tuple{1}; + static_assert(kat::tuple_size>::value == 1, "tuple_size> test failed."); + if ( kat::get<0>(t) != 1 ) + { throw std::logic_error{""}; } + + return 0; +} + diff --git a/recipes/cuda-kat/config.yml b/recipes/cuda-kat/config.yml new file mode 100644 index 0000000000000..7e65100e62b2c --- /dev/null +++ b/recipes/cuda-kat/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2": + folder: all diff --git a/recipes/cunit/all/conandata.yml b/recipes/cunit/all/conandata.yml new file mode 100644 index 0000000000000..dc0e653a838f3 --- /dev/null +++ b/recipes/cunit/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.1-3": + url: "https://downloads.sourceforge.net/cunit/CUnit-2.1-3.tar.bz2" + sha256: "f5b29137f845bb08b77ec60584fdb728b4e58f1023e6f249a464efa49a40f214" +patches: + "2.1-3": + - patch_file: "patches/0001-configure-in-msvc-shortcuts.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-snprintf-msvc.patch" + base_path: "source_subfolder" diff --git a/recipes/cunit/all/conanfile.py b/recipes/cunit/all/conanfile.py new file mode 100644 index 0000000000000..a7c3f16aa1cdc --- /dev/null +++ b/recipes/cunit/all/conanfile.py @@ -0,0 +1,149 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from contextlib import contextmanager +import glob +import os + +required_conan_version = ">=1.33.0" + + +class CunitConan(ConanFile): + name = "cunit" + description = "A Unit Testing Framework for C" + topics = ("conan", "cunit", "testing") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://cunit.sourceforge.net/" + license = "BSD-3-Clause" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_automated": [True, False], + "enable_basic": [True, False], + "enable_console": [True, False], + "with_curses": [False, "ncurses"], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_automated": True, + "enable_basic": True, + "enable_console": True, + "with_curses": False, + } + exports_sources = "patches/**" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_curses == "ncurses": + self.requires("ncurses/6.2") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + with tools.chdir(self._source_subfolder): + for f in glob.glob("*.c"): + os.chmod(f, 0o644) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + @contextmanager + def _build_context(self): + env = {} + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + env.update({ + "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), + "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "NM": "dumpbin -symbols", + "OBJDUMP": ":", + "RANLIB": ":", + "STRIP": ":", + }) + with tools.environment_append(env): + yield + else: + with tools.environment_append(env): + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + host, build = None, None + if self.settings.compiler == "Visual Studio": + self._autotools.flags.append("-FS") + # MSVC canonical names aren't understood + host, build = False, False + conf_args = [ + "--datarootdir={}".format(os.path.join(self.package_folder, "bin", "share").replace("\\", "/")), + "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", + "--enable-automated" if self.options.enable_automated else "--disable-automated", + "--enable-basic" if self.options.enable_basic else "--disable-basic", + "--enable-console" if self.options.enable_console else "--disable-console", + "--enable-curses" if self.options.with_curses != False else "--disable-curses", + ] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(args=conf_args, host=host, build=build) + return self._autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + with self._build_context(): + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.install() + + if self.settings.compiler == "Visual Studio" and self.options.shared: + tools.rename(os.path.join(self.package_folder, "lib", "cunit.dll.lib"), + os.path.join(self.package_folder, "lib", "cunit.lib")) + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "bin", "share", "man")) + tools.rmdir(os.path.join(self.package_folder, "doc")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "CUnit" + self.cpp_info.names["cmake_find_package_multi"] = "CUnit" + self.cpp_info.libs = ["cunit"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("CU_DLL") diff --git a/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch b/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch new file mode 100644 index 0000000000000..f934c96f0e8b0 --- /dev/null +++ b/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch @@ -0,0 +1,39 @@ +--- configure.in ++++ configure.in +@@ -26,7 +26,7 @@ + + TOPDIR=`pwd` + +-CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -Wall -W -pedantic -Wshadow -ansi -I${PWD}/CUnit/Headers -std=c99" ++CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -pedantic -ansi -I${PWD}/CUnit/Headers -std=c99" + LDFLAGS="$LDFLAGS -L${PWD}/CUnit/Sources" + + AC_ARG_ENABLE(debug, +@@ -186,13 +186,13 @@ + AC_CHECK_FUNC(calloc, [], [echo calloc not found; exit 1]) + AC_CHECK_FUNC(realloc, [], [echo realloc not found; exit 1]) + +-AC_CHECK_FUNC(strcpy, [], [echo strcpy not found; exit 1]) ++dnl AC_CHECK_FUNC(strcpy, [], [echo strcpy not found; exit 1]) + AC_CHECK_FUNC(strerror, [], [echo strerror not found; exit 1]) + + AC_CHECK_FUNC(fopen, [], [echo fopen not found; exit 1]) + AC_CHECK_FUNC(fclose, [], [echo fclose not found; exit 1]) +-AC_CHECK_FUNC(fprintf, [], [echo fprintf not found; exit 1]) +-AC_CHECK_FUNC(snprintf, [], [echo snprintf not found; exit 1]) ++dnl AC_CHECK_FUNC(fprintf, [], [echo fprintf not found; exit 1]) ++dnl AC_CHECK_FUNC(snprintf, [], [echo snprintf not found; exit 1]) + AC_CHECK_FUNC(setvbuf, [], [echo setvbuf not found; exit 1]) + + AC_CHECK_FUNC(time, [], [echo time not found; exit 1]) +--- CUnit/Sources/Makefile.am ++++ CUnit/Sources/Makefile.am +@@ -67,7 +67,7 @@ + lib_LTLIBRARIES = libcunit.la + libcunit_la_SOURCES = + libcunit_la_LIBADD = $(OBJECT_FILES_SHARED) +-libcunit_la_LDFLAGS = -version-info @LIBTOOL_CURRENT@:@LIBTOOL_REVISION@:@LIBTOOL_AGE@ ++libcunit_la_LDFLAGS = -version-info @LIBTOOL_CURRENT@:@LIBTOOL_REVISION@:@LIBTOOL_AGE@ -no-undefined + + + if ENABLE_TEST diff --git a/recipes/cunit/all/patches/0002-snprintf-msvc.patch b/recipes/cunit/all/patches/0002-snprintf-msvc.patch new file mode 100644 index 0000000000000..ce5099b64d02c --- /dev/null +++ b/recipes/cunit/all/patches/0002-snprintf-msvc.patch @@ -0,0 +1,11 @@ +--- a/CUnit/Headers/CUnit.h.in ++++ b/CUnit/Headers/CUnit.h.in +@@ -101,7 +101,7 @@ + # else + # define CU_EXPORT + # endif +-# ifdef _MSC_VER ++# if defined(_MSC_VER) && _MSC_VER < 1900 + # define snprintf _snprintf + # endif + #else diff --git a/recipes/cunit/all/test_package/CMakeLists.txt b/recipes/cunit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/cunit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/cunit/all/test_package/conanfile.py b/recipes/cunit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/cunit/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cunit/all/test_package/test_package.c b/recipes/cunit/all/test_package/test_package.c new file mode 100644 index 0000000000000..170e70cff9624 --- /dev/null +++ b/recipes/cunit/all/test_package/test_package.c @@ -0,0 +1,128 @@ +/* + * Simple example of a CUnit unit test. + * + * This program (crudely) demonstrates a very simple "black box" + * test of the standard library functions fprintf() and fread(). + * It uses suite initialization and cleanup functions to open + * and close a common temporary file used by the test functions. + * The test functions then write to and read from the temporary + * file in the course of testing the library functions. + * + * The 2 test functions are added to a single CUnit suite, and + * then run using the CUnit Basic interface. The output of the + * program (on CUnit version 2.0-2) is: + * + * CUnit : A Unit testing framework for C. + * http://cunit.sourceforge.net/ + * + * Suite: Suite_1 + * Test: test of fprintf() ... passed + * Test: test of fread() ... passed + * + * --Run Summary: Type Total Ran Passed Failed + * suites 1 1 n/a 0 + * tests 2 2 2 0 + * asserts 5 5 5 0 + */ + +#include +#include +#include "CUnit/Basic.h" + +/* Pointer to the file used by the tests. */ +static FILE* temp_file = NULL; + +/* The suite initialization function. + * Opens the temporary file used by the tests. + * Returns zero on success, non-zero otherwise. + */ +int init_suite1(void) +{ + if (NULL == (temp_file = fopen("temp.txt", "w+"))) { + return -1; + } + else { + return 0; + } +} + +/* The suite cleanup function. + * Closes the temporary file used by the tests. + * Returns zero on success, non-zero otherwise. + */ +int clean_suite1(void) +{ + if (0 != fclose(temp_file)) { + return -1; + } + else { + temp_file = NULL; + return 0; + } +} + +/* Simple test of fprintf(). + * Writes test data to the temporary file and checks + * whether the expected number of bytes were written. + */ +void testFPRINTF(void) +{ + int i1 = 10; + + if (NULL != temp_file) { + CU_ASSERT(0 == fprintf(temp_file, "")); + CU_ASSERT(2 == fprintf(temp_file, "Q\n")); + CU_ASSERT(7 == fprintf(temp_file, "i1 = %d", i1)); + } +} + +/* Simple test of fread(). + * Reads the data previously written by testFPRINTF() + * and checks whether the expected characters are present. + * Must be run after testFPRINTF(). + */ +void testFREAD(void) +{ + unsigned char buffer[20]; + + if (NULL != temp_file) { + rewind(temp_file); + CU_ASSERT(9 == fread(buffer, sizeof(unsigned char), 20, temp_file)); + CU_ASSERT(0 == strncmp(buffer, "Q\ni1 = 10", 9)); + } +} + +/* The main() function for setting up and running the tests. + * Returns a CUE_SUCCESS on successful running, another + * CUnit error code on failure. + */ +int main() +{ + CU_pSuite pSuite = NULL; + + /* initialize the CUnit test registry */ + if (CUE_SUCCESS != CU_initialize_registry()) + return CU_get_error(); + + /* add a suite to the registry */ + pSuite = CU_add_suite("test_package suite", init_suite1, clean_suite1); + if (NULL == pSuite) { + CU_cleanup_registry(); + return CU_get_error(); + } + + /* add the tests to the suite */ + /* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */ + if ((NULL == CU_add_test(pSuite, "fprintf()", testFPRINTF)) || + (NULL == CU_add_test(pSuite, "fread()", testFREAD))) + { + CU_cleanup_registry(); + return CU_get_error(); + } + + /* Run all tests using the CUnit Basic interface */ + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + CU_cleanup_registry(); + return CU_get_error(); +} diff --git a/recipes/cunit/config.yml b/recipes/cunit/config.yml new file mode 100644 index 0000000000000..a5f9de36bda48 --- /dev/null +++ b/recipes/cunit/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1-3": + folder: "all" diff --git a/recipes/cute_headers/all/conandata.yml b/recipes/cute_headers/all/conandata.yml new file mode 100644 index 0000000000000..4817bebfcd4dc --- /dev/null +++ b/recipes/cute_headers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20201022": + url: "https://github.com/RandyGaul/cute_headers/archive/f04e37c5a8ba1c7ce385b0f38b584bec1056e831.zip" + sha256: c560718b3bee5ee7f00c8e89384d3bbeb1ecda3dde5f67b4f2dfa61e19bc785f diff --git a/recipes/cute_headers/all/conanfile.py b/recipes/cute_headers/all/conanfile.py new file mode 100644 index 0000000000000..2aeb5719c6df9 --- /dev/null +++ b/recipes/cute_headers/all/conanfile.py @@ -0,0 +1,39 @@ +from conans import ConanFile, tools +import os +import glob + + +class CuteHeadersConan(ConanFile): + name = "cute_headers" + description = "Various single-file cross-platform C/C++ headers implementing self-contained libraries." + topics = ("conan", "various", "pure-c") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/RandyGaul/cute_headers" + license = "Unlicense" + no_copy_source = True + + def _extract_license(self): + file = os.path.join(self.package_folder, "include/cute_math2d.h") + file_content = tools.load(file) + return file_content[file_content.rfind('/*'):] + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob(self.name + "-*/")[0] + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy( + pattern="*.h", + dst="include", + src=self._source_subfolder, + excludes=("examples_cute_*", "test_cute_*") + ) + tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + + def package_id(self): + self.info.header_only() diff --git a/recipes/cute_headers/all/test_package/CMakeLists.txt b/recipes/cute_headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b9be759ce7016 --- /dev/null +++ b/recipes/cute_headers/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +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/cute_headers/all/test_package/conanfile.py b/recipes/cute_headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b63178709d69f --- /dev/null +++ b/recipes/cute_headers/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/cute_headers/all/test_package/test_package.c b/recipes/cute_headers/all/test_package/test_package.c new file mode 100644 index 0000000000000..9df19fd5803ce --- /dev/null +++ b/recipes/cute_headers/all/test_package/test_package.c @@ -0,0 +1,28 @@ +#ifdef _WIN32 +#include +#endif + +#define CUTE_FILES_IMPLEMENTATION +#include + +#include + +void print_dir(cf_file_t* file, void* udata) +{ + printf("name: %-10s\text: %-10s\tpath: %s\n", file->name, file->ext, file->path); + *(int*)udata += 1; +} + +void test_dir() +{ + int n = 0; + cf_traverse(".", print_dir, &n); + printf("Found %d files with cf_traverse\n\n", n); +} + + +int main() +{ + test_dir(); + return 0; +} diff --git a/recipes/cute_headers/config.yml b/recipes/cute_headers/config.yml new file mode 100644 index 0000000000000..b38dca059d021 --- /dev/null +++ b/recipes/cute_headers/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201022": + folder: "all" diff --git a/recipes/cvplot/all/conandata.yml b/recipes/cvplot/all/conandata.yml new file mode 100644 index 0000000000000..9079421334b14 --- /dev/null +++ b/recipes/cvplot/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.2": + url: "https://github.com/Profactor/cv-plot/archive/refs/tags/v1.2.2.tar.gz" + sha256: "a7dbc80a8ec13fa2cfdc4f1389a1eb0cb83b56f021c64214d733812d3e301bc5" diff --git a/recipes/cvplot/all/conanfile.py b/recipes/cvplot/all/conanfile.py new file mode 100644 index 0000000000000..49ceaeafa285e --- /dev/null +++ b/recipes/cvplot/all/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.43.0" + + +class CvPlotConan(ConanFile): + name = "cvplot" + description = "fast modular opencv plotting library" + license = "MIT" + topics = ("plot", "opencv", "diagram", "plotting") + homepage = "https://github.com/Profactor/cv-plot" + url = "https://github.com/conan-io/conan-center-index" + requires = "opencv/4.5.3" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "CvPlot", "inc")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.defines.append("CVPLOT_HEADER_ONLY") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.names["cmake_find_package"] = "CvPlot" + self.cpp_info.names["cmake_find_package_multi"] = "CvPlot" diff --git a/recipes/cvplot/all/test_package/CMakeLists.txt b/recipes/cvplot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b75c35da97dea --- /dev/null +++ b/recipes/cvplot/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(CvPlot CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CvPlot::CvPlot) + +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) diff --git a/recipes/cvplot/all/test_package/conanfile.py b/recipes/cvplot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/cvplot/all/test_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/cvplot/all/test_package/test_package.cpp b/recipes/cvplot/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0592129b4a676 --- /dev/null +++ b/recipes/cvplot/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +using namespace CvPlot; + +int main() { + Axes axes = plot(std::vector{ 3, 3, 4, 6, 4, 3 }, "-o"); + cv::Mat mat = axes.render(400, 600); + return 0; +} diff --git a/recipes/cvplot/config.yml b/recipes/cvplot/config.yml new file mode 100644 index 0000000000000..af40d9653a378 --- /dev/null +++ b/recipes/cvplot/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.2": + folder: all diff --git a/recipes/cwalk/all/conandata.yml b/recipes/cwalk/all/conandata.yml new file mode 100644 index 0000000000000..89588e33be62f --- /dev/null +++ b/recipes/cwalk/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "1.2.7": + url: "https://github.com/likle/cwalk/archive/v1.2.7.tar.gz" + sha256: "ae424ec30830c970412e34d9092eaa6131d91af289cdad0ad66a7b1c58e768e7" + "1.2.6": + url: "https://github.com/likle/cwalk/archive/v1.2.6.tar.gz" + sha256: "4e7c0e9e30e93343ebc9d5dc3ffc1703b3abb05baf8d8a3ab05a75b69a65a3ef" + "1.2.5": + url: "https://github.com/likle/cwalk/archive/v1.2.5.tar.gz" + sha256: "55a24deb602a7bee822e48bda50e454d102649a8cb064300a6dabc8f0405646f" + "1.2.2": + url: "https://github.com/likle/cwalk/archive/v1.2.2.zip" + sha256: "62094c2bb8882fd57fe7ea00fb196e6065b363e8ca57f9c693c19f4912747d88" + "1.1.0": + url: "https://github.com/likle/cwalk/archive/v1.1.0.zip" + sha256: "44be1392d96bcbc66fb24e1ec5ecab273ee5add6ad8e2bab97552284db228e2e" + "1.0.0": + url: "https://github.com/likle/cwalk/archive/v1.0.0.zip" + sha256: "9ff6d85f88e7fe4877698afb40745d301491c1d3fca96f08d1622f5fe3494182" +patches: + "1.2.7": + - patch_file: "patches/0001-fix-cmake-1.2.5.patch" + "1.2.6": + - patch_file: "patches/0001-fix-cmake-1.2.5.patch" + "1.2.5": + - patch_file: "patches/0001-fix-cmake-1.2.5.patch" + "1.2.2": + - patch_file: "patches/0001-fix-cmake-1.2.2.patch" + "1.1.0": + - patch_file: "patches/0001-fix-cmake-1.1.0.patch" + "1.0.0": + - patch_file: "patches/0001-fix-cmake-1.0.0.patch" diff --git a/recipes/cwalk/all/conanfile.py b/recipes/cwalk/all/conanfile.py new file mode 100644 index 0000000000000..bf570216dca5f --- /dev/null +++ b/recipes/cwalk/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class CwalkConan(ConanFile): + name = "cwalk" + description = "Path library for C/C++. Cross-Platform for Windows, " \ + "MacOS and Linux. Supports UNIX and Windows path styles " \ + "on those platforms." + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://likle.github.io/cwalk/" + topics = ("cross-platform", "windows", "macos", "osx", "linux", + "path-manipulation", "path", "directory", "file", "file-system", + "unc", "path-parsing", "file-path") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"cwalk": "cwalk::cwalk"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Cwalk") + self.cpp_info.set_property("cmake_target_name", "cwalk") + self.cpp_info.libs = ["cwalk"] + if self.options.shared and Version(self.version) >= "1.2.5": + self.cpp_info.defines.append("CWK_SHARED") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Cwalk" + self.cpp_info.filenames["cmake_find_package_multi"] = "Cwalk" + self.cpp_info.names["cmake_find_package"] = "cwalk" + self.cpp_info.names["cmake_find_package_multi"] = "cwalk" + 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/cwalk/all/patches/0001-fix-cmake-1.0.0.patch b/recipes/cwalk/all/patches/0001-fix-cmake-1.0.0.patch new file mode 100644 index 0000000000000..c50f13017cfde --- /dev/null +++ b/recipes/cwalk/all/patches/0001-fix-cmake-1.0.0.patch @@ -0,0 +1,29 @@ +Fixes: +* export symbols if shared msvc +* add install target +* disable tests and warnings as errors + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,16 @@ add_library(${LIBRARY_TARGET} + "${INCLUDE_DIRECTORY}/cwalk.h" + "${SOURCE_DIRECTORY}/cwalk.c") + target_include_directories(${LIBRARY_TARGET} PUBLIC "${INCLUDE_DIRECTORY}") ++set_target_properties(${LIBRARY_TARGET} PROPERTIES ++ PUBLIC_HEADER "${INCLUDE_DIRECTORY}/cwalk.h" ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++install(TARGETS ${LIBRARY_TARGET} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ PUBLIC_HEADER DESTINATION include) + ++if(0) # disable tests and warnings as errors + # add tests + enable_testing() + create_test(DEFAULT absolute simple) +@@ -152,3 +161,4 @@ target_include_directories(${TEST_TARGET} PUBLIC "${INCLUDE_DIRECTORY}") + + # enable warnings + enable_warnings(${LIBRARY_TARGET}) ++endif() diff --git a/recipes/cwalk/all/patches/0001-fix-cmake-1.1.0.patch b/recipes/cwalk/all/patches/0001-fix-cmake-1.1.0.patch new file mode 100644 index 0000000000000..13a9c7f66569c --- /dev/null +++ b/recipes/cwalk/all/patches/0001-fix-cmake-1.1.0.patch @@ -0,0 +1,29 @@ +Fixes: +* export symbols if shared msvc +* add install target +* disable tests and warnings as errors + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,16 @@ add_library(${LIBRARY_TARGET} + "${INCLUDE_DIRECTORY}/cwalk.h" + "${SOURCE_DIRECTORY}/cwalk.c") + target_include_directories(${LIBRARY_TARGET} PUBLIC "${INCLUDE_DIRECTORY}") ++set_target_properties(${LIBRARY_TARGET} PROPERTIES ++ PUBLIC_HEADER "${INCLUDE_DIRECTORY}/cwalk.h" ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++install(TARGETS ${LIBRARY_TARGET} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ PUBLIC_HEADER DESTINATION include) + ++if(0) # disable tests and warnings as errors + # add tests + enable_testing() + create_test(DEFAULT absolute simple) +@@ -198,3 +207,4 @@ target_include_directories(${TEST_TARGET} PUBLIC "${INCLUDE_DIRECTORY}") + + # enable warnings + enable_warnings(${LIBRARY_TARGET}) ++endif() diff --git a/recipes/cwalk/all/patches/0001-fix-cmake-1.2.2.patch b/recipes/cwalk/all/patches/0001-fix-cmake-1.2.2.patch new file mode 100644 index 0000000000000..ca014de0fa389 --- /dev/null +++ b/recipes/cwalk/all/patches/0001-fix-cmake-1.2.2.patch @@ -0,0 +1,29 @@ +Fixes: +* export symbols if shared msvc +* add install target +* disable tests and warnings as errors + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,16 @@ add_library(${LIBRARY_TARGET} + "${INCLUDE_DIRECTORY}/cwalk.h" + "${SOURCE_DIRECTORY}/cwalk.c") + target_include_directories(${LIBRARY_TARGET} PUBLIC "${INCLUDE_DIRECTORY}") ++set_target_properties(${LIBRARY_TARGET} PROPERTIES ++ PUBLIC_HEADER "${INCLUDE_DIRECTORY}/cwalk.h" ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++install(TARGETS ${LIBRARY_TARGET} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ PUBLIC_HEADER DESTINATION include) + ++if(0) # disable tests and warnings as errors + # add tests + enable_testing() + create_test(DEFAULT absolute simple) +@@ -234,3 +243,4 @@ target_include_directories(${TEST_TARGET} PUBLIC "${INCLUDE_DIRECTORY}") + + # enable warnings + enable_warnings(${LIBRARY_TARGET}) ++endif() diff --git a/recipes/cwalk/all/patches/0001-fix-cmake-1.2.5.patch b/recipes/cwalk/all/patches/0001-fix-cmake-1.2.5.patch new file mode 100644 index 0000000000000..a59d803cf814d --- /dev/null +++ b/recipes/cwalk/all/patches/0001-fix-cmake-1.2.5.patch @@ -0,0 +1,12 @@ +Do not enable warnings as errors + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,7 +39,6 @@ endif() + add_library(cwalk + "${INCLUDE_DIRECTORY}/cwalk.h" + "${SOURCE_DIRECTORY}/cwalk.c") +-enable_warnings(cwalk) + target_include_directories(cwalk PUBLIC + $ + $ diff --git a/recipes/cwalk/all/test_package/CMakeLists.txt b/recipes/cwalk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..873589b946c24 --- /dev/null +++ b/recipes/cwalk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(Cwalk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cwalk) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/cwalk/all/test_package/conanfile.py b/recipes/cwalk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cwalk/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/cwalk/all/test_package/test_package.c b/recipes/cwalk/all/test_package/test_package.c new file mode 100755 index 0000000000000..a35e949fdebcc --- /dev/null +++ b/recipes/cwalk/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include +#include + +int main(int argc, char *argv[]) { + char result[FILENAME_MAX]; + + cwk_path_normalize("/var/log/weird/////path/.././..///", result, + sizeof(result)); + + return EXIT_SUCCESS; +} diff --git a/recipes/cwalk/all/test_v1_package/CMakeLists.txt b/recipes/cwalk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cwalk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cwalk/all/test_v1_package/conanfile.py b/recipes/cwalk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cwalk/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/cwalk/config.yml b/recipes/cwalk/config.yml new file mode 100644 index 0000000000000..3a4a484ff7332 --- /dev/null +++ b/recipes/cwalk/config.yml @@ -0,0 +1,13 @@ +versions: + "1.2.7": + folder: all + "1.2.6": + folder: all + "1.2.5": + folder: all + "1.2.2": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all diff --git a/recipes/cxxopts/all/conandata.yml b/recipes/cxxopts/all/conandata.yml new file mode 100644 index 0000000000000..ed4fef59dd9bc --- /dev/null +++ b/recipes/cxxopts/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.1.1": + url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.1.1.tar.gz" + sha256: "523175f792eb0ff04f9e653c90746c12655f10cb70f1d5e6d6d9491420298a08" + "3.0.0": + url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.0.0.tar.gz" + sha256: "36f41fa2a46b3c1466613b63f3fa73dc24d912bc90d667147f1e43215a8c6d00" + "2.2.1": + url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v2.2.1.tar.gz" + sha256: "984aa3c8917d649b14d7f6277104ce38dd142ce378a9198ec926f03302399681" + "2.2.0": + url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v2.2.0.tar.gz" + sha256: "447dbfc2361fce9742c5d1c9cfb25731c977b405f9085a738fbd608626da8a4d" diff --git a/recipes/cxxopts/all/conanfile.py b/recipes/cxxopts/all/conanfile.py new file mode 100644 index 0000000000000..03ec452dcf0b8 --- /dev/null +++ b/recipes/cxxopts/all/conanfile.py @@ -0,0 +1,85 @@ +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 +import os + +required_conan_version = ">=1.51.1" + + +class CxxOptsConan(ConanFile): + name = "cxxopts" + homepage = "https://github.com/jarro2783/cxxopts" + url = "https://github.com/conan-io/conan-center-index" + description = "Lightweight C++ option parser library, supporting the standard GNU style syntax for options." + license = "MIT" + topics = ("option-parser", "positional-arguments ", "header-only") + + settings = "os", "arch", "compiler", "build_type" + options = { + "unicode": [True, False], + } + default_options = { + "unicode": False, + } + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "14", + "msvc": "190", + "gcc": "4.9", + "clang": "3.9", + "apple-clang": "8", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.unicode: + self.requires("icu/72.1") + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], 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, "cxxopts.hpp", 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_file_name", "cxxopts") + self.cpp_info.set_property("cmake_target_name", "cxxopts::cxxopts") + self.cpp_info.set_property("pkg_config_name", "cxxopts") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.unicode: + self.cpp_info.defines = ["CXXOPTS_USE_UNICODE"] diff --git a/recipes/cxxopts/all/test_package/CMakeLists.txt b/recipes/cxxopts/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00a1aead37e8f --- /dev/null +++ b/recipes/cxxopts/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +enable_testing() + +find_package(cxxopts REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cxxopts::cxxopts) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(cxxopts_VERSION VERSION_LESS "3.1.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE CXXOPTS_OLD_EXCEPTIONS) +endif() + +add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME} -f 41 --bar baria --baz) +if(WITH_UNICODE) + # This will fail if it was not enabled in the package https://github.com/jarro2783/cxxopts#unrecognised-arguments + add_test(NAME unicode COMMAND ${PROJECT_NAME} -f 41 --bar baria --baz -q quxis) +endif() diff --git a/recipes/cxxopts/all/test_package/conanfile.py b/recipes/cxxopts/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1e91d7e0cc26d --- /dev/null +++ b/recipes/cxxopts/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import build_jobs, can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_UNICODE"] = self.dependencies["cxxopts"].options.unicode + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/cxxopts/all/test_package/test_package.cpp b/recipes/cxxopts/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..df1a81785c0ff --- /dev/null +++ b/recipes/cxxopts/all/test_package/test_package.cpp @@ -0,0 +1,64 @@ +#include +#include + +int main(int argc, char* argv[]) +{ + cxxopts::Options options { "test_package", "The example program to test cxxopts package" }; + + options.add_options() + ("h,help", "Print help") + ("f,foo", "Option foo", cxxopts::value()->default_value("10")) + ("b,bar", "Option bar", cxxopts::value()) + ("z,baz", "Option baz", cxxopts::value()->implicit_value("true")) + #ifdef CXXOPTS_USE_UNICODE + ("q,qux", u8"Option qux with non-ascii description: 你好", cxxopts::value()) + #endif + ; + + try { + // cxxopts versions before 2.x.x had a slightly different interface of options parsing + // This preprocessor block allows to use one recipe and test package + // for both 1.x.x and 2.x.x releases + #ifdef CXXOPTS__VERSION_MAJOR + auto result = options.parse(argc, argv); + #else + options.parse(argc, argv); + auto result = options; + #endif + + if (result.count("help")) { + std::cout << options.help({ "", "Group" }) << std::endl; + return 0; + } + + if (result.count("foo")) { + std::cout << "foo:" << result["foo"].as() << std::endl; + } + + if (result.count("bar")) { + std::cout << "bar:" << result["bar"].as() << std::endl; + } + + if (result.count("baz")) { + std::cout << "baz:" << result["baz"].as() << std::endl; + } + #ifdef CXXOPTS_USE_UNICODE + if (result.count("qux")) { + std::cout << "qux:" << result["qux"].as() << std::endl; + } + #endif + } + #ifdef CXXOPTS_OLD_EXCEPTIONS + catch (const cxxopts::OptionException& e) { + std::cout << "error parsing options: " << e.what() << std::endl; + return 1; + } + #else + catch (const cxxopts::exceptions::exception& e) { + std::cout << "error parsing options: " << e.what() << std::endl; + return 1; + } + #endif + + return 0; +} diff --git a/recipes/cxxopts/all/test_v1_package/CMakeLists.txt b/recipes/cxxopts/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cxxopts/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cxxopts/all/test_v1_package/conanfile.py b/recipes/cxxopts/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c68398ab15a88 --- /dev/null +++ b/recipes/cxxopts/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, CMake, tools +from io import StringIO +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): + output = StringIO() + bin_path = os.path.join("bin", "test_package") + option_string = "-f 41 --bar baria --baz" + if self.options["cxxopts"].unicode: + option_string += " -q quxis" + self.run(f"{bin_path} {option_string}", run_environment=True, output=output) + output_lines = set(output.getvalue().splitlines()) + expected_lines = {"foo:41", "bar:baria", "baz:1"} + if self.options["cxxopts"].unicode: + expected_lines.add("qux:quxis") + assert(expected_lines.issubset(output_lines)) diff --git a/recipes/cxxopts/config.yml b/recipes/cxxopts/config.yml new file mode 100644 index 0000000000000..60f4de8e82260 --- /dev/null +++ b/recipes/cxxopts/config.yml @@ -0,0 +1,9 @@ +versions: + "3.1.1": + folder: all + "3.0.0": + folder: all + "2.2.1": + folder: all + "2.2.0": + folder: all diff --git a/recipes/cyclonedds/all/conandata.yml b/recipes/cyclonedds/all/conandata.yml new file mode 100644 index 0000000000000..d4037567cc2c5 --- /dev/null +++ b/recipes/cyclonedds/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.10.2": + url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/refs/tags/0.10.2.tar.gz" + sha256: "bc84e137e0c8a055b8cd97fbeafec94e36de1b0c2e88800896a82384fd867ae5" +patches: + "0.10.2": + - patch_file: "patches/0.10.2-0001-fix-find-iceoryx.patch" + patch_description: "Fix cmake find for iceoryx package" + patch_type: "conan" diff --git a/recipes/cyclonedds/all/conanfile.py b/recipes/cyclonedds/all/conanfile.py new file mode 100644 index 0000000000000..28044cd38689c --- /dev/null +++ b/recipes/cyclonedds/all/conanfile.py @@ -0,0 +1,172 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CycloneDDSConan(ConanFile): + name = "cyclonedds" + license = "EPL-2.0" + homepage = "https://cyclonedds.io/" + url = "https://github.com/conan-io/conan-center-index" + description = "Eclipse Cyclone DDS - An implementation"\ + " of the OMG Data Distribution Service (DDS) specification" + topics = ("dds", "ipc", "ros", "middleware") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + "with_shm" : [True, False], + "enable_security" : [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": False, + "with_shm": False, + "enable_security": False, + } + + short_paths = True + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "16", + "msvc": "192", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self,src_folder="src") + + def requirements(self): + if self.options.with_shm: + self.requires("iceoryx/2.0.2") + if self.options.with_ssl: + self.requires("openssl/1.1.1t") + + def validate(self): + if self.options.enable_security and not self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} currently do not support"\ + "static build and security on") + 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 _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if not self._cmake_new_enough("3.16"): + self.tool_requires("cmake/3.25.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # TODO : determine how to do in conan : + # - idlc is a code generator that is used as tool (and so not cross compiled) + # - other tools like ddsperf is cross compiled for target + # - maybe separate package like cyclonedds_idlc + tc.variables["BUILD_IDLC"] = False + tc.variables["BUILD_IDLC_TESTING"] = False + tc.variables["BUILD_DDSPERF"] = False + tc.variables["BUILD_IDLC_TESTING"] = False + # variables which effects build + tc.variables["ENABLE_SSL"] = self.options.with_ssl + tc.variables["ENABLE_SHM"] = self.options.with_shm + tc.variables["ENABLE_SECURITY"] = self.options.enable_security + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE", self.source_folder, 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + if self.settings.os == "Windows" and self.options.shared: + for p in ("*.pdb", "concrt*.dll", "msvcp*.dll", "vcruntime*.dll"): + rm(self, p, os.path.join(self.package_folder, "bin")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CycloneDDS") + self.cpp_info.set_property("cmake_target_name", "CycloneDDS::ddsc") + self.cpp_info.set_property("pkg_config_name", "CycloneDDS") + # TODO: back to global scope in conan v2 + self.cpp_info.components["CycloneDDS"].libs = ["ddsc"] + requires = [] + if self.options.with_shm: + requires.append("iceoryx::iceoryx_binding_c") + if self.options.with_ssl: + requires.append("openssl::openssl") + self.cpp_info.components["CycloneDDS"].requires = requires + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["CycloneDDS"].system_libs = ["dl", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["CycloneDDS"].system_libs = [ + "ws2_32", + "dbghelp", + "bcrypt", + "iphlpapi" + ] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "CycloneDDS" + self.cpp_info.names["cmake_find_package_multi"] = "CycloneDDS" + self.cpp_info.components["CycloneDDS"].names["cmake_find_package"] = "ddsc" + self.cpp_info.components["CycloneDDS"].names["cmake_find_package_multi"] = "ddsc" + self.cpp_info.components["CycloneDDS"].set_property("cmake_target_name", "CycloneDDS::ddsc") + self.cpp_info.components["CycloneDDS"].set_property("pkg_config_name", "CycloneDDS") diff --git a/recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch b/recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch new file mode 100644 index 0000000000000..228ee7dba0b01 --- /dev/null +++ b/recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch @@ -0,0 +1,15 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index fa08094a..516806dd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -55,8 +55,8 @@ if(ENABLE_SHM) + else() + set(iceoryx_required QUIET) + endif() +- find_package(iceoryx_binding_c ${iceoryx_required}) +- set(ENABLE_SHM ${iceoryx_binding_c_FOUND} CACHE STRING "" FORCE) ++ find_package(iceoryx ${iceoryx_required}) ++ set(ENABLE_SHM ${iceoryx_FOUND} CACHE STRING "" FORCE) + if(ENABLE_SHM AND APPLE) + get_filename_component(iceoryx_libdir "${ICEORYX_LIB}" DIRECTORY) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${iceoryx_libdir}") diff --git a/recipes/cyclonedds/all/test_package/CMakeLists.txt b/recipes/cyclonedds/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f30c0b29578a0 --- /dev/null +++ b/recipes/cyclonedds/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(CycloneDDS REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CycloneDDS::ddsc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cyclonedds/all/test_package/conanfile.py b/recipes/cyclonedds/all/test_package/conanfile.py new file mode 100644 index 0000000000000..422a7d5c03da2 --- /dev/null +++ b/recipes/cyclonedds/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 CycloneDDSTestConan(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/cyclonedds/all/test_package/test_package.cpp b/recipes/cyclonedds/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9966d58481774 --- /dev/null +++ b/recipes/cyclonedds/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ + +#include +#include +#include +#include +#include +#include + +#include "dds/dds.h" + +int main() { + dds_entity_t participant; + dds_entity_t topic; + + /* Create a Participant. */ + participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); + if (participant < 0) + DDS_FATAL("dds_create_participant: %s\n", dds_strretcode(-participant)); + + return EXIT_SUCCESS; +} diff --git a/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt b/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cyclonedds/all/test_v1_package/conanfile.py b/recipes/cyclonedds/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1a9e66f7126fc --- /dev/null +++ b/recipes/cyclonedds/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake +from conan.tools import build + +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 build.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cyclonedds/config.yml b/recipes/cyclonedds/config.yml new file mode 100644 index 0000000000000..6c8041d964ef5 --- /dev/null +++ b/recipes/cyclonedds/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.2": + folder: all diff --git a/recipes/cyrus-sasl/all/conandata.yml b/recipes/cyrus-sasl/all/conandata.yml new file mode 100644 index 0000000000000..0fe894820dcdf --- /dev/null +++ b/recipes/cyrus-sasl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.27": + url: "https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.27/cyrus-sasl-2.1.27.tar.gz" + sha256: "26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5" diff --git a/recipes/cyrus-sasl/all/conanfile.py b/recipes/cyrus-sasl/all/conanfile.py new file mode 100644 index 0000000000000..53ce502733557 --- /dev/null +++ b/recipes/cyrus-sasl/all/conanfile.py @@ -0,0 +1,176 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path +import os + +required_conan_version = ">=1.54.0" + + +class CyrusSaslConan(ConanFile): + name = "cyrus-sasl" + license = "BSD-4-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.cyrusimap.org/sasl/" + description = ( + "This is the Cyrus SASL API implementation. " + "It can be used on the client or server side " + "to provide authentication and authorization services." + ) + topics = ("sasl", "authentication", "authorization") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "with_cram": [True, False], + "with_digest": [True, False], + "with_scram": [True, False], + "with_otp": [True, False], + "with_krb4": [True, False], + "with_gssapi": [True, False], + "with_plain": [True, False], + "with_anon": [True, False], + "with_postgresql": [True, False], + "with_mysql": [True, False], + "with_sqlite3": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": True, + "with_cram": True, + "with_digest": True, + "with_scram": True, + "with_otp": True, + "with_krb4": True, + "with_gssapi": False, # FIXME: should be True + "with_plain": True, + "with_anon": True, + "with_postgresql": False, + "with_mysql": False, + "with_sqlite3": False, + } + + @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): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_postgresql: + self.requires("libpq/14.7") + if self.options.with_mysql: + self.requires("libmysqlclient/8.0.31") + if self.options.with_sqlite3: + self.requires("sqlite3/3.41.1") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "Cyrus SASL package is not compatible with Windows yet." + ) + if self.options.with_gssapi: + raise ConanInvalidConfiguration( + f"{self.name}:with_gssapi=True requires krb5 recipe, not yet available in conan-center", + ) + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + rootpath_no = lambda v, req: unix_path(self, self.dependencies[req].package_folder) if v else "no" + tc.configure_args.extend([ + "--disable-sample", + "--disable-macos-framework", + "--with-dblib=none", + "--with-openssl={}".format(yes_no(self.options.with_openssl)), + "--enable-digest={}".format(yes_no(self.options.with_digest)), + "--enable-scram={}".format(yes_no(self.options.with_scram)), + "--enable-otp={}".format(yes_no(self.options.with_otp)), + "--enable-krb4={}".format(yes_no(self.options.with_krb4)), + "--enable-gssapi={}".format(yes_no(self.options.with_gssapi)), + "--enable-plain={}".format(yes_no(self.options.with_plain)), + "--enable-anon={}".format(yes_no(self.options.with_anon)), + "--enable-sql={}".format( + yes_no(self.options.with_postgresql or self.options.with_mysql or self.options.with_sqlite3), + ), + "--with-pgsql={}".format(rootpath_no(self.options.with_postgresql, "libpq")), + "--with-mysql={}".format(rootpath_no(self.options.with_mysql, "libmysqlclient")), + "--without-sqlite", + "--with-sqlite3={}".format(rootpath_no(self.options.with_sqlite3, "sqlite3")), + ]) + if self.options.with_gssapi: + tc.configure_args.append("--with-gss_impl=mit") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=os.path.join(self.source_folder, "config")) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libsasl2") + self.cpp_info.libs = ["sasl2"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cyrus-sasl/all/test_package/CMakeLists.txt b/recipes/cyrus-sasl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b50bb405e7050 --- /dev/null +++ b/recipes/cyrus-sasl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cyrus-sasl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cyrus-sasl::cyrus-sasl) diff --git a/recipes/cyrus-sasl/all/test_package/conanfile.py b/recipes/cyrus-sasl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/cyrus-sasl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cyrus-sasl/all/test_package/test_package.c b/recipes/cyrus-sasl/all/test_package/test_package.c new file mode 100644 index 0000000000000..8851f184023fd --- /dev/null +++ b/recipes/cyrus-sasl/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include + +int main(int argc, char *argv[]) +{ + const char *implementation, *version; + sasl_version_info(&implementation, &version, NULL, NULL, NULL, NULL); + printf("--------------------------->Tests are done.<--------------------------\n"); + printf("SASL Using implementation: %s, version: %s\n", implementation, version); + printf("//////////////////////////////////////////////////////////////////////\n"); + return 0; +} diff --git a/recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt b/recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cyrus-sasl/all/test_v1_package/conanfile.py b/recipes/cyrus-sasl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e0a85886fc12c --- /dev/null +++ b/recipes/cyrus-sasl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cyrus-sasl/config.yml b/recipes/cyrus-sasl/config.yml new file mode 100644 index 0000000000000..d7a18807b4494 --- /dev/null +++ b/recipes/cyrus-sasl/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.27": + folder: "all" diff --git a/recipes/czmq/all/conandata.yml b/recipes/czmq/all/conandata.yml new file mode 100644 index 0000000000000..f252ab078883b --- /dev/null +++ b/recipes/czmq/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "4.2.1": + url: "https://github.com/zeromq/czmq/releases/download/v4.2.1/czmq-4.2.1.tar.gz" + sha256: "5d720a204c2a58645d6f7643af15d563a712dad98c9d32c1ed913377daa6ac39" + "4.2.0": + url: "https://github.com/zeromq/czmq/releases/download/v4.2.0/czmq-4.2.0.tar.gz" + sha256: "cfab29c2b3cc8a845749758a51e1dd5f5160c1ef57e2a41ea96e4c2dcc8feceb" +patches: + "4.2.1": + - patch_file: patches/4.2.1-0001-fix-cmake.patch + patch_description: "set LINKER_LANGUAGE, disable executable and tests" + patch_type: "conan" + - patch_file: patches/4.2.1-0002-fix-zsys_thread-issue.patch + patch_description: "addresses three problems related to ZSYS_THREAD_NAME_PREFIX / ZSYS_THREAD_NAME_PREFIX_STR:" + patch_type: "bugfix" + patch_source: "https://github.com/zeromq/czmq/pull/2162" + "4.2.0": + - patch_file: patches/4.2.0-0001-fix-cmake.patch + patch_description: "add options which are added in 4.2.1, set LINKER_LANGUAGE, disable executable and tests" + patch_type: "conan" diff --git a/recipes/czmq/all/conanfile.py b/recipes/czmq/all/conanfile.py new file mode 100644 index 0000000000000..88618f4797ed7 --- /dev/null +++ b/recipes/czmq/all/conanfile.py @@ -0,0 +1,161 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class CzmqConan(ConanFile): + name = "czmq" + description = "High-level C binding for ZeroMQ" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zeromq/czmq" + topics = ("zmq", "libzmq", "message-queue", "asynchronous") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_drafts": [True, False], + "with_libcurl": [True, False], + "with_lz4": [True, False], + "with_libuuid": [True, False], + "with_libmicrohttpd": [True, False], + "with_systemd": [True, False], + } + default_options = { + "shared": False, + "enable_drafts": False, + "fPIC": True, + "with_libcurl": True, + "with_lz4": True, + "with_libuuid": True, + "with_libmicrohttpd": True, + "with_systemd": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # libuuid is not available on Windows + del self.options.with_libuuid + if self.settings.os == "Linux": + del self.options.with_systemd + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.enable_drafts: + del self.options.with_libcurl + del self.options.with_libmicrohttpd + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zeromq/4.3.4") + if self.options.get_safe("with_libmicrohttpd"): + self.requires("libmicrohttpd/0.9.75") + if self.options.get_safe("with_libcurl"): + self.requires("libcurl/7.87.0") + if self.options.with_lz4: + self.requires("lz4/1.9.4") + if self.options.get_safe("with_libuuid"): + self.requires("libuuid/1.0.3") + if self.options.get_safe("with_systemd"): + self.requires("libsystemd/252.4") + + def validate(self): + if is_apple_os(self) and self.options.shared and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared and debug on apple-clang.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_DRAFTS"] = self.options.enable_drafts + tc.variables["CZMQ_BUILD_SHARED"] = self.options.shared + tc.variables["CZMQ_BUILD_STATIC"] = not self.options.shared + tc.variables["CZMQ_WITH_UUID"] = self.options.get_safe("with_libuuid", False) + tc.variables["CZMQ_WITH_SYSTEMD"] = self.options.get_safe("with_systemd", False) + tc.variables["CZMQ_WITH_LZ4"] = self.options.with_lz4 + tc.variables["CZMQ_WITH_LIBCURL"] = self.options.get_safe("with_libcurl", False) + tc.variables["CZMQ_WITH_LIBMICROHTTPD"] = self.options.get_safe("with_libmicrohttpd", False) + if Version(self.version) >= "4.2.1": + tc.variables["CZMQ_WITH_NSS"] = False + if is_msvc(self): + tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + # remove custom Finduuid.cmake to use cci Finduuid.cmake + rm(self, "Finduuid.cmake", self.source_folder) + 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, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._czmq_target: "czmq::czmq"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _czmq_target(self): + return "czmq" if self.options.shared else "czmq-static" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "czmq") + self.cpp_info.set_property("cmake_target_name", self._czmq_target) + self.cpp_info.set_property("pkg_config_name", "libczmq") + prefix = "lib" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}czmq"] + if not self.options.shared: + self.cpp_info.defines.append("CZMQ_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("rpcrt4") + + # 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/czmq/all/patches/4.2.0-0001-fix-cmake.patch b/recipes/czmq/all/patches/4.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..b52b335d8bd61 --- /dev/null +++ b/recipes/czmq/all/patches/4.2.0-0001-fix-cmake.patch @@ -0,0 +1,167 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,27 +120,25 @@ set(OPTIONAL_LIBRARIES_STATIC) + ######################################################################## + # LIBZMQ dependency + ######################################################################## +-find_package(libzmq REQUIRED) +-IF (LIBZMQ_FOUND) +- include_directories(${LIBZMQ_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES}) ++IF (1) ++ find_package(ZeroMQ REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES $,libzmq,libzmq-static>) + IF (PC_LIBZMQ_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libzmq") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBZMQ_STATIC_LDFLAGS}) + ELSE (PC_LIBZMQ_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") + ENDIF (PC_LIBZMQ_FOUND) +-ELSE (LIBZMQ_FOUND) ++ELSE () + message( FATAL_ERROR "libzmq not found." ) +-ENDIF (LIBZMQ_FOUND) ++ENDIF () + + ######################################################################## + # UUID dependency + ######################################################################## +-find_package(uuid) +-IF (UUID_FOUND) +- include_directories(${UUID_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${UUID_LIBRARIES}) ++IF (CZMQ_WITH_UUID) ++ find_package(libuuid REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES libuuid::libuuid) + IF (PC_UUID_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} uuid") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_UUID_STATIC_LDFLAGS}) +@@ -148,16 +146,14 @@ IF (UUID_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -luuid") + ENDIF (PC_UUID_FOUND) + add_definitions(-DHAVE_UUID) +- list(APPEND OPTIONAL_LIBRARIES ${UUID_LIBRARIES}) +-ENDIF (UUID_FOUND) ++ENDIF () + + ######################################################################## + # SYSTEMD dependency + ######################################################################## +-find_package(systemd) +-IF (SYSTEMD_FOUND) +- include_directories(${SYSTEMD_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${SYSTEMD_LIBRARIES}) ++IF (CZMQ_WITH_SYSTEMD) ++ find_package(libsystemd REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES libsystemd::libsystemd) + IF (PC_SYSTEMD_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libsystemd >= 200.0.0") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_SYSTEMD_STATIC_LDFLAGS}) +@@ -165,16 +161,14 @@ IF (SYSTEMD_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lsystemd") + ENDIF (PC_SYSTEMD_FOUND) + add_definitions(-DHAVE_LIBSYSTEMD) +- list(APPEND OPTIONAL_LIBRARIES ${SYSTEMD_LIBRARIES}) +-ENDIF (SYSTEMD_FOUND) ++ENDIF () + + ######################################################################## + # LZ4 dependency + ######################################################################## +-find_package(lz4) +-IF (LZ4_FOUND) +- include_directories(${LZ4_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LZ4_LIBRARIES}) ++IF (CZMQ_WITH_LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES $,LZ4::lz4_shared,LZ4::lz4_static>) + IF (PC_LZ4_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} liblz4") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LZ4_STATIC_LDFLAGS}) +@@ -182,16 +176,14 @@ IF (LZ4_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -llz4") + ENDIF (PC_LZ4_FOUND) + add_definitions(-DHAVE_LIBLZ4) +- list(APPEND OPTIONAL_LIBRARIES ${LZ4_LIBRARIES}) +-ENDIF (LZ4_FOUND) ++ENDIF () + + ######################################################################## + # LIBCURL dependency + ######################################################################## +-find_package(libcurl) +-IF (LIBCURL_FOUND) +- include_directories(${LIBCURL_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBCURL_LIBRARIES}) ++IF (CZMQ_WITH_LIBCURL) ++ find_package(CURL REQUIRED) ++ list(APPEND MORE_LIBRARIES CURL::libcurl) + IF (PC_LIBCURL_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libcurl >= 7.28.0") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBCURL_STATIC_LDFLAGS}) +@@ -199,16 +191,14 @@ IF (LIBCURL_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lcurl") + ENDIF (PC_LIBCURL_FOUND) + add_definitions(-DHAVE_LIBCURL) +- list(APPEND OPTIONAL_LIBRARIES ${LIBCURL_LIBRARIES}) +-ENDIF (LIBCURL_FOUND) ++ENDIF () + + ######################################################################## + # LIBMICROHTTPD dependency + ######################################################################## +-find_package(libmicrohttpd) +-IF (LIBMICROHTTPD_FOUND) +- include_directories(${LIBMICROHTTPD_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBMICROHTTPD_LIBRARIES}) ++IF (CZMQ_WITH_LIBMICROHTTPD) ++ find_package(libmicrohttpd REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES libmicrohttpd::libmicrohttpd) + IF (PC_LIBMICROHTTPD_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libmicrohttpd") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBMICROHTTPD_STATIC_LDFLAGS}) +@@ -216,8 +206,7 @@ IF (LIBMICROHTTPD_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lmicrohttpd") + ENDIF (PC_LIBMICROHTTPD_FOUND) + add_definitions(-DHAVE_LIBMICROHTTPD) +- list(APPEND OPTIONAL_LIBRARIES ${LIBMICROHTTPD_LIBRARIES}) +-ENDIF (LIBMICROHTTPD_FOUND) ++ENDIF () + + ######################################################################## + # version +@@ -368,7 +357,10 @@ IF (NOT MSVC) + # avoid building everything twice for shared + static + # only on *nix, as Windows needs different preprocessor defines in static builds + add_library (czmq_objects OBJECT ${czmq_sources}) ++ target_link_libraries(czmq_objects PUBLIC ${MORE_LIBRARIES}) ++ if(CZMQ_BUILD_SHARED) + set_property(TARGET czmq_objects PROPERTY POSITION_INDEPENDENT_CODE ON) ++ endif() + ENDIF (NOT MSVC) + + # shared +@@ -380,6 +372,7 @@ if (CZMQ_BUILD_SHARED) + ENDIF (MSVC) + + set_target_properties (czmq PROPERTIES ++ LINKER_LANGUAGE CXX + PUBLIC_HEADER "${public_headers}" + DEFINE_SYMBOL "CZMQ_EXPORTS" + SOVERSION "4" +@@ -501,6 +494,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/czmqConfig.cmake + ######################################################################## + # executables + ######################################################################## ++if(0) + add_executable( + zmakecert + "${SOURCE_DIR}/src/zmakecert.c" +@@ -720,6 +714,7 @@ add_custom_command( + ) + + include(ClangFormat OPTIONAL) ++endif() + + ######################################################################## + # summary diff --git a/recipes/czmq/all/patches/4.2.1-0001-fix-cmake.patch b/recipes/czmq/all/patches/4.2.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e3926f0dd2b31 --- /dev/null +++ b/recipes/czmq/all/patches/4.2.1-0001-fix-cmake.patch @@ -0,0 +1,200 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -130,28 +130,26 @@ set(OPTIONAL_LIBRARIES_STATIC) + ######################################################################## + # LIBZMQ dependency + ######################################################################## +-find_package(libzmq REQUIRED) +-IF (LIBZMQ_FOUND) +- include_directories(${LIBZMQ_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES}) ++IF (1) ++ find_package(ZeroMQ REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES $,libzmq,libzmq-static>) + IF (PC_LIBZMQ_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libzmq") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBZMQ_STATIC_LDFLAGS}) + ELSE (PC_LIBZMQ_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") + ENDIF (PC_LIBZMQ_FOUND) +-ELSE (LIBZMQ_FOUND) ++ELSE () + message( FATAL_ERROR "libzmq not found." ) +-ENDIF (LIBZMQ_FOUND) ++ENDIF () + + ######################################################################## + # UUID dependency + ######################################################################## +-find_package(uuid) +-option(CZMQ_WITH_UUID "Build czmq with uuid" ${UUID_FOUND}) +-IF (CZMQ_WITH_UUID AND UUID_FOUND) +- include_directories(${UUID_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${UUID_LIBRARIES}) ++option(CZMQ_WITH_UUID "Build czmq with uuid" OFF) ++IF (CZMQ_WITH_UUID) ++ find_package(libuuid REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES libuuid::libuuid) + IF (PC_UUID_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} uuid") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_UUID_STATIC_LDFLAGS}) +@@ -159,17 +157,15 @@ IF (CZMQ_WITH_UUID AND UUID_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -luuid") + ENDIF (PC_UUID_FOUND) + add_definitions(-DHAVE_UUID) +- list(APPEND OPTIONAL_LIBRARIES ${UUID_LIBRARIES}) +-ENDIF (CZMQ_WITH_UUID AND UUID_FOUND) ++ENDIF () + + ######################################################################## + # SYSTEMD dependency + ######################################################################## +-find_package(systemd) +-option(CZMQ_WITH_SYSTEMD "Build czmq with systemd" ${SYSTEMD_FOUND}) +-IF (CZMQ_WITH_SYSTEMD AND SYSTEMD_FOUND) +- include_directories(${SYSTEMD_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${SYSTEMD_LIBRARIES}) ++option(CZMQ_WITH_SYSTEMD "Build czmq with systemd" OFF) ++IF (CZMQ_WITH_SYSTEMD) ++ find_package(libsystemd REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES libsystemd::libsystemd) + IF (PC_SYSTEMD_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libsystemd >= 200.0.0") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_SYSTEMD_STATIC_LDFLAGS}) +@@ -177,17 +173,15 @@ IF (CZMQ_WITH_SYSTEMD AND SYSTEMD_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lsystemd") + ENDIF (PC_SYSTEMD_FOUND) + add_definitions(-DHAVE_LIBSYSTEMD) +- list(APPEND OPTIONAL_LIBRARIES ${SYSTEMD_LIBRARIES}) +-ENDIF (CZMQ_WITH_SYSTEMD AND SYSTEMD_FOUND) ++ENDIF () + + ######################################################################## + # LZ4 dependency + ######################################################################## +-find_package(lz4) +-option(CZMQ_WITH_LZ4 "Build czmq with lz4" ${LZ4_FOUND}) +-IF (CZMQ_WITH_LZ4 AND LZ4_FOUND) +- include_directories(${LZ4_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LZ4_LIBRARIES}) ++option(CZMQ_WITH_LZ4 "Build czmq with lz4" ON) ++IF (CZMQ_WITH_LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES $,LZ4::lz4_shared,LZ4::lz4_static>) + IF (PC_LZ4_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} liblz4") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LZ4_STATIC_LDFLAGS}) +@@ -195,17 +189,15 @@ IF (CZMQ_WITH_LZ4 AND LZ4_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -llz4") + ENDIF (PC_LZ4_FOUND) + add_definitions(-DHAVE_LIBLZ4) +- list(APPEND OPTIONAL_LIBRARIES ${LZ4_LIBRARIES}) +-ENDIF (CZMQ_WITH_LZ4 AND LZ4_FOUND) ++ENDIF () + + ######################################################################## + # LIBCURL dependency + ######################################################################## +-find_package(libcurl) +-option(CZMQ_WITH_LIBCURL "Build czmq with libcurl" ${LIBCURL_FOUND}) +-IF (CZMQ_WITH_LIBCURL AND LIBCURL_FOUND) +- include_directories(${LIBCURL_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBCURL_LIBRARIES}) ++option(CZMQ_WITH_LIBCURL "Build czmq with libcurl" ON) ++IF (CZMQ_WITH_LIBCURL) ++ find_package(CURL REQUIRED) ++ list(APPEND MORE_LIBRARIES CURL::libcurl) + IF (PC_LIBCURL_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libcurl >= 7.28.0") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBCURL_STATIC_LDFLAGS}) +@@ -213,17 +205,15 @@ IF (CZMQ_WITH_LIBCURL AND LIBCURL_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lcurl") + ENDIF (PC_LIBCURL_FOUND) + add_definitions(-DHAVE_LIBCURL) +- list(APPEND OPTIONAL_LIBRARIES ${LIBCURL_LIBRARIES}) +-ENDIF (CZMQ_WITH_LIBCURL AND LIBCURL_FOUND) ++ENDIF () + + ######################################################################## + # NSS dependency + ######################################################################## +-find_package(nss) +-option(CZMQ_WITH_NSS "Build czmq with nss" ${NSS_FOUND}) +-IF (CZMQ_WITH_NSS AND NSS_FOUND) +- include_directories(${NSS_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${NSS_LIBRARIES}) ++option(CZMQ_WITH_NSS "Build czmq with nss" OFF) ++IF (CZMQ_WITH_NSS) ++ find_package(nss REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES nss::nss) + IF (PC_NSS_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} nss") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_NSS_STATIC_LDFLAGS}) +@@ -231,17 +221,15 @@ IF (CZMQ_WITH_NSS AND NSS_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lnss") + ENDIF (PC_NSS_FOUND) + add_definitions(-DHAVE_NSS) +- list(APPEND OPTIONAL_LIBRARIES ${NSS_LIBRARIES}) +-ENDIF (CZMQ_WITH_NSS AND NSS_FOUND) ++ENDIF () + + ######################################################################## + # LIBMICROHTTPD dependency + ######################################################################## +-find_package(libmicrohttpd) +-option(CZMQ_WITH_LIBMICROHTTPD "Build czmq with libmicrohttpd" ${LIBMICROHTTPD_FOUND}) +-IF (CZMQ_WITH_LIBMICROHTTPD AND LIBMICROHTTPD_FOUND) +- include_directories(${LIBMICROHTTPD_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBMICROHTTPD_LIBRARIES}) ++option(CZMQ_WITH_LIBMICROHTTPD "Build czmq with libmicrohttpd" OFF) ++IF (CZMQ_WITH_LIBMICROHTTPD) ++ find_package(libmicrohttpd REQUIRED CONFIG) ++ list(APPEND MORE_LIBRARIES libmicrohttpd::libmicrohttpd) + IF (PC_LIBMICROHTTPD_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libmicrohttpd") + list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBMICROHTTPD_STATIC_LDFLAGS}) +@@ -249,8 +237,7 @@ IF (CZMQ_WITH_LIBMICROHTTPD AND LIBMICROHTTPD_FOUND) + set(pkg_config_libs_private "${pkg_config_libs_private} -lmicrohttpd") + ENDIF (PC_LIBMICROHTTPD_FOUND) + add_definitions(-DHAVE_LIBMICROHTTPD) +- list(APPEND OPTIONAL_LIBRARIES ${LIBMICROHTTPD_LIBRARIES}) +-ENDIF (CZMQ_WITH_LIBMICROHTTPD AND LIBMICROHTTPD_FOUND) ++ENDIF () + + ######################################################################## + # version +@@ -403,7 +390,10 @@ IF (NOT MSVC) + # avoid building everything twice for shared + static + # only on *nix, as Windows needs different preprocessor defines in static builds + add_library (czmq_objects OBJECT ${czmq_sources}) ++ target_link_libraries(czmq_objects PUBLIC ${MORE_LIBRARIES}) ++ if(CZMQ_BUILD_SHARED) + set_property(TARGET czmq_objects PROPERTY POSITION_INDEPENDENT_CODE ON) ++ endif() + ENDIF (NOT MSVC) + + # shared +@@ -419,6 +409,7 @@ if (CZMQ_BUILD_SHARED) + ENDIF(APPLE) + + set_target_properties (czmq PROPERTIES ++ LINKER_LANGUAGE CXX + PUBLIC_HEADER "${public_headers}" + DEFINE_SYMBOL "CZMQ_EXPORTS" + SOVERSION "4" +@@ -544,6 +535,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/czmqConfig.cmake + ######################################################################## + # executables + ######################################################################## ++if(0) + add_executable( + zmakecert + "${SOURCE_DIR}/src/zmakecert.c" +@@ -778,6 +770,7 @@ add_custom_command( + ) + + include(ClangFormat OPTIONAL) ++endif() + + ######################################################################## + # summary diff --git a/recipes/czmq/all/patches/4.2.1-0002-fix-zsys_thread-issue.patch b/recipes/czmq/all/patches/4.2.1-0002-fix-zsys_thread-issue.patch new file mode 100644 index 0000000000000..82cede0540471 --- /dev/null +++ b/recipes/czmq/all/patches/4.2.1-0002-fix-zsys_thread-issue.patch @@ -0,0 +1,43 @@ +diff --git a/src/zsock.c b/src/zsock.c +index 46bbb63..36ad5e0 100644 +--- a/src/zsock.c ++++ b/src/zsock.c +@@ -2376,6 +2376,7 @@ zsock_test (bool verbose) + zstr_free (&addr); + zstr_free (&message); + ++#ifndef __APPLE__ + // ZMQ_DGRAM ipv4 multicast test + zsock_t* mdgramr = zsock_new_dgram ("udp://225.25.25.25:7777"); + assert (mdgramr); +@@ -2389,6 +2390,7 @@ zsock_test (bool verbose) + + char *mdmessage, *maddr; + ++ // this call blocks forever on MacOS + zmsg_t *mdmsg = zmsg_recv( mdgramr ); + assert (mdmsg); + maddr = zmsg_popstr (mdmsg); +@@ -2400,6 +2402,7 @@ zsock_test (bool verbose) + zstr_free (&mdmessage); + zstr_free (&maddr); + zstr_free (&mdmessage); ++#endif + + // // ipv6 (not supported yet) + // zsys_set_ipv6(1); +diff --git a/src/zsys.c b/src/zsys.c +index 7c7301b..f384051 100644 +--- a/src/zsys.c ++++ b/src/zsys.c +@@ -334,9 +334,7 @@ zsys_init (void) + zsys_set_thread_name_prefix (s_thread_name_prefix); + + if (getenv ("ZSYS_THREAD_NAME_PREFIX_STR")) +- zsys_set_thread_name_prefix_str (getenv ("ZSYS_THREAD_NAME_PREFIX")); +- else +- zsys_set_thread_name_prefix_str (s_thread_name_prefix_str); ++ zsys_set_thread_name_prefix_str (getenv ("ZSYS_THREAD_NAME_PREFIX_STR")); + + return s_process_ctx; + } diff --git a/recipes/czmq/all/test_package/CMakeLists.txt b/recipes/czmq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5ffa50b2e16b5 --- /dev/null +++ b/recipes/czmq/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C CXX) + +find_package(czmq REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) +if(TARGET czmq-static) + target_link_libraries(${PROJECT_NAME} PRIVATE czmq-static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE czmq) +endif() diff --git a/recipes/czmq/all/test_package/conanfile.py b/recipes/czmq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/czmq/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/czmq/all/test_package/test_package.c b/recipes/czmq/all/test_package/test_package.c new file mode 100644 index 0000000000000..b3dfd88de6516 --- /dev/null +++ b/recipes/czmq/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include + +int main (void) +{ + zsock_t *push = zsock_new_push ("inproc://example"); + zsock_t *pull = zsock_new_pull ("inproc://example"); + zstr_send (push, "Hello, World"); + + char *string = zstr_recv (pull); + puts (string); + zstr_free (&string); + + zsock_destroy (&pull); + zsock_destroy (&push); + // https://github.com/zeromq/zproto/pull/384 +#if defined (__WINDOWS__) + zsys_shutdown(); +#endif + return 0; +} diff --git a/recipes/czmq/all/test_v1_package/CMakeLists.txt b/recipes/czmq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/czmq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/czmq/all/test_v1_package/conanfile.py b/recipes/czmq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/czmq/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/czmq/config.yml b/recipes/czmq/config.yml new file mode 100644 index 0000000000000..5074502634e2b --- /dev/null +++ b/recipes/czmq/config.yml @@ -0,0 +1,5 @@ +versions: + "4.2.1": + folder: all + "4.2.0": + folder: all diff --git a/recipes/dacap-clip/all/conandata.yml b/recipes/dacap-clip/all/conandata.yml new file mode 100644 index 0000000000000..daa1ee060995e --- /dev/null +++ b/recipes/dacap-clip/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.5.tar.gz" + sha256: "8f6f8a427075a09011fafbb75bfdbf1213e4492a13cff4a70975aab361c99382" diff --git a/recipes/dacap-clip/all/conanfile.py b/recipes/dacap-clip/all/conanfile.py new file mode 100644 index 0000000000000..e2bd672a9b3d1 --- /dev/null +++ b/recipes/dacap-clip/all/conanfile.py @@ -0,0 +1,114 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd + +required_conan_version = ">=1.51.3" + +class DacapClipConan(ConanFile): + name = "dacap-clip" + description = "Cross-platform C++ library to copy/paste clipboard content" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dacap/clip/" + topics = ("clipboard", "copy", "paste") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + 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 + 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") + if self.settings.os == "Linux": + self.requires("xorg/system") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if is_msvc(self) and self.info.settings.build_type == "Debug" and self.info.options.shared == True: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC debug shared build (now).") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def generate(self): + toolchain = CMakeToolchain(self) + toolchain.variables["CLIP_EXAMPLES"] = False + toolchain.variables["CLIP_TESTS"] = False + toolchain.variables["CLIP_X11_WITH_PNG"] = self.options.get_safe("with_png", False) + if is_msvc(self): + toolchain.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = bool(self.options.shared) + toolchain.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "clip.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.so", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["clip"] + + if self.options.get_safe("with_png", False): + self.cpp_info.requires.append("libpng::libpng") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.requires.append("xorg::xcb") + self.cpp_info.system_libs.append("pthread") + elif is_apple_os(self): + self.cpp_info.frameworks = ['Cocoa', 'Carbon', 'CoreFoundation', 'Foundation', 'AppKit'] + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend([ + "shlwapi", + "windowscodecs", + ]) + + 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 + self.cpp_info.names["cmake_find_package"] = "clip" + self.cpp_info.names["cmake_find_package_multi"] = "clip" diff --git a/recipes/dacap-clip/all/test_package/CMakeLists.txt b/recipes/dacap-clip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..63e11b22a301b --- /dev/null +++ b/recipes/dacap-clip/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(clip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} clip::clip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dacap-clip/all/test_package/conanfile.py b/recipes/dacap-clip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5a673574d7a5b --- /dev/null +++ b/recipes/dacap-clip/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "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/dacap-clip/all/test_package/test_package.cpp b/recipes/dacap-clip/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78ce3cdf1d299 --- /dev/null +++ b/recipes/dacap-clip/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "clip.h" + +int main() { + clip::set_text("Hello World"); + + std::string value; + clip::get_text(value); + std::cout << value << std::endl; + + return 0; +} diff --git a/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt b/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..784c43a27c83a --- /dev/null +++ b/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include("${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(clip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} clip::clip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dacap-clip/all/test_v1_package/conanfile.py b/recipes/dacap-clip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e9bf8aa5f82dd --- /dev/null +++ b/recipes/dacap-clip/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +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 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/dacap-clip/config.yml b/recipes/dacap-clip/config.yml new file mode 100644 index 0000000000000..84f49b2850870 --- /dev/null +++ b/recipes/dacap-clip/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5": + folder: "all" diff --git a/recipes/daggy/2.1/CMakeLists.txt b/recipes/daggy/2.1/CMakeLists.txt new file mode 100644 index 0000000000000..9cc5cb456e2f0 --- /dev/null +++ b/recipes/daggy/2.1/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.21.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_subdirectory("source_subfolder/src") diff --git a/recipes/daggy/2.1/conandata.yml b/recipes/daggy/2.1/conandata.yml new file mode 100644 index 0000000000000..7f518b6c061d3 --- /dev/null +++ b/recipes/daggy/2.1/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.2": + sha256: d3b244fcb06cf5b749d19ca9d678aebbaa43a7e8c8208d99c15a58e140e49493 + url: https://github.com/synacker/daggy/archive/refs/tags/2.1.2.tar.gz diff --git a/recipes/daggy/2.1/conanfile.py b/recipes/daggy/2.1/conanfile.py new file mode 100644 index 0000000000000..6856d194c3bb9 --- /dev/null +++ b/recipes/daggy/2.1/conanfile.py @@ -0,0 +1,138 @@ +from conans import ConanFile, CMake, tools, errors +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class DaggyConan(ConanFile): + name = "daggy" + license = "MIT" + homepage = "https://daggy.dev" + url = "https://github.com/conan-io/conan-center-index" + description = "Data Aggregation Utility and C/C++ developer library for data streams catching" + topics = ("streaming", "qt", "monitoring", "process", "stream-processing", "extensible", "serverless-framework", "aggregation", "ssh2", "crossplatform", "ssh-client") + + settings = "os", "compiler", "build_type", "arch" + options = { + "with_ssh2": [True, False], + "with_yaml": [True, False], + "with_console": [True, False], + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "with_ssh2": True, + "with_yaml": True, + "with_console": False, + "shared": False, + "fPIC": True + } + generators = "cmake", "cmake_find_package" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_cpp_standard(self): + return 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 source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build_requirements(self): + self.build_requires("cmake/3.21.3") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + self.options["qt"].shared = True + + def configure(self): + if self.options.shared: + del self.options.fPIC + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "8", + "apple-clang": "10", + } + + 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 not self.options["qt"].shared: + raise ConanInvalidConfiguration("Shared Qt lib is required.") + + def requirements(self): + self.requires("qt/6.2.2") + self.requires("kainjow-mustache/4.1") + + if self.options.with_yaml: + self.requires("yaml-cpp/0.7.0") + + if self.options.with_ssh2: + self.requires("libssh2/1.10.0") + + def _configure(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["SSH2_SUPPORT"] = self.options.with_ssh2 + self._cmake.definitions["YAML_SUPPORT"] = self.options.with_yaml + self._cmake.definitions["CONSOLE"] = self.options.with_console + self._cmake.definitions["PACKAGE_DEPS"] = False + self._cmake.definitions["VERSION"] = self.version + self._cmake.definitions["CONAN_BUILD"] = True + self._cmake.definitions["BUILD_TESTING"] = False + + if self.options.shared: + self._cmake.definitions["CMAKE_C_VISIBILITY_PRESET"] = "hidden" + self._cmake.definitions["CMAKE_CXX_VISIBILITY_PRESET"] = "hidden" + self._cmake.definitions["CMAKE_VISIBILITY_INLINES_HIDDEN"] = 1 + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + cmake = self._configure() + cmake.build() + + def package(self): + cmake = self._configure() + cmake.install() + + self.copy("LICENSE", src=self._source_subfolder, dst="licenses", keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["DaggyCore"] + + + diff --git a/recipes/daggy/2.1/test_package/CMakeLists.txt b/recipes/daggy/2.1/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2be549c8044e6 --- /dev/null +++ b/recipes/daggy/2.1/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.21.0) +project(DaggyPackageTest) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(daggy REQUIRED) + +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_executable(testcpp test.cpp) +target_link_libraries(testcpp daggy::daggy) diff --git a/recipes/daggy/2.1/test_package/conanfile.py b/recipes/daggy/2.1/test_package/conanfile.py new file mode 100644 index 0000000000000..26810dfa0f7a5 --- /dev/null +++ b/recipes/daggy/2.1/test_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conans import ConanFile, CMake, tools, RunEnvironment + + +class DaggyTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_paths", "cmake_find_package" + + def build_requirements(self): + self.build_requires("cmake/3.21.3") + + def build(self): + cmake = CMake(self) + + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "testcpp"), run_environment=True) diff --git a/recipes/daggy/2.1/test_package/test.cpp b/recipes/daggy/2.1/test_package/test.cpp new file mode 100644 index 0000000000000..aaac466a71277 --- /dev/null +++ b/recipes/daggy/2.1/test_package/test.cpp @@ -0,0 +1,86 @@ +/* +MIT License + +Copyright (c) 2021 synacker + +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 +#include + +namespace { +constexpr const char* json_data = R"JSON( +{ + "sources": { + "localhost" : { + "type": "local", + "commands": { + "ping1": { + "exec": "ping 127.0.0.1", + "extension": "log" + }, + "ping2": { + "exec": "ping 127.0.0.1", + "extension": "log" + } + } + } + } +} +)JSON"; +} + +int main(int argc, char** argv) +{ + QCoreApplication app(argc, argv); + daggy::Core core(*daggy::sources::convertors::json(json_data)); + + daggy::aggregators::CFile file_aggregator("test"); + daggy::aggregators::CConsole console_aggregator("test"); + + core.connectAggregator(&file_aggregator); + core.connectAggregator(&console_aggregator); + + QObject::connect(&core, &daggy::Core::stateChanged, &core, + [&](DaggyStates state){ + if(state == DaggyFinished) + app.quit(); + }); + + QTimer::singleShot(2000, &core, [&]() + { + core.stop(); + }); + + QTimer::singleShot(5000, &core, [&]() + { + app.exit(-1); + }); + + core.prepare(); + core.start(); + + return app.exec(); +} diff --git a/recipes/daggy/config.yml b/recipes/daggy/config.yml new file mode 100644 index 0000000000000..009e3d455971a --- /dev/null +++ b/recipes/daggy/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.2": + folder: "2.1" diff --git a/recipes/darknet/all/conandata.yml b/recipes/darknet/all/conandata.yml new file mode 100644 index 0000000000000..f7382d7a3ec4c --- /dev/null +++ b/recipes/darknet/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + cci.20180914: + url: "https://github.com/pjreddie/darknet/archive/61c9d02ec461e30d55762ec7669d6a1d3c356fb2.tar.gz" + sha256: "a1993ba2628b1be81ab14f8ef81de6c00a298b316c64ca96bebef2b0f40c3967" +patches: + cci.20180914: + - patch_file: "patches/include_conan_flags.patch" + base_path: "source_subfolder" diff --git a/recipes/darknet/all/conanfile.py b/recipes/darknet/all/conanfile.py new file mode 100644 index 0000000000000..5e49bf67b81ff --- /dev/null +++ b/recipes/darknet/all/conanfile.py @@ -0,0 +1,98 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + + +class DarknetConan(ConanFile): + name = "darknet" + license = "YOLO" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://pjreddie.com/darknet/" + description = "Darknet is a neural network frameworks written in C" + topics = ("darknet", "neural network", "deep learning") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_opencv": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_opencv": False, + } + exports_sources = ['patches/*'] + generators = "pkg_config" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _lib_to_compile(self): + if not self.options.shared: + return "$(ALIB)" + else: + return "$(SLIB)" + + @property + def _shared_lib_extension(self): + if self.settings.os == "Macos": + return ".dylib" + else: + return ".so" + + def _patch_sources(self): + for patch in self.conan_data["patches"].get(self.version, []): + tools.patch(**patch) + tools.replace_in_file( + os.path.join(self._source_subfolder, "Makefile"), + "SLIB=libdarknet.so", + "SLIB=libdarknet" + self._shared_lib_extension + ) + tools.replace_in_file( + os.path.join(self._source_subfolder, "Makefile"), + "all: obj backup results $(SLIB) $(ALIB) $(EXEC)", + "all: obj backup results " + self._lib_to_compile + ) + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("This library is not compatible with Windows") + + def requirements(self): + if self.options.with_opencv: + self.requires("opencv/2.4.13.7") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, + strip_root=True) + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + with tools.environment_append({"PKG_CONFIG_PATH": self.build_folder}): + args = ["OPENCV={}".format("1" if self.options.with_opencv else "0")] + env_build = AutoToolsBuildEnvironment(self) + env_build.fpic = self.options.get_safe("fPIC", True) + env_build.make(args=args) + + def package(self): + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("*.so", dst="lib", keep_path=False) + self.copy("*.dylib", dst="lib", keep_path=False) + self.copy("*.a", dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["darknet"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m", "pthread"] + if tools.stdcpp_library(self): + self.cpp_info.system_libs.append(tools.stdcpp_library(self)) diff --git a/recipes/darknet/all/patches/include_conan_flags.patch b/recipes/darknet/all/patches/include_conan_flags.patch new file mode 100644 index 0000000000000..d1e2c248dca51 --- /dev/null +++ b/recipes/darknet/all/patches/include_conan_flags.patch @@ -0,0 +1,59 @@ +diff -ru a/Makefile b/Makefile +--- a/Makefile ++++ b/Makefile +@@ -19,30 +19,23 @@ + EXEC=darknet + OBJDIR=./obj/ + +-CC=gcc +-CPP=g++ ++CC?=gcc ++CXX?=g++ + NVCC=nvcc + AR=ar + ARFLAGS=rcs +-OPTS=-Ofast +-LDFLAGS= -lm -pthread ++LDFLAGS+=${LIBS} -lm -pthread + COMMON= -Iinclude/ -Isrc/ +-CFLAGS=-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC ++CFLAGS+=${CPPFLAGS} -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors + + ifeq ($(OPENMP), 1) + CFLAGS+= -fopenmp + endif + +-ifeq ($(DEBUG), 1) +-OPTS=-O0 -g +-endif +- +-CFLAGS+=$(OPTS) +- + ifeq ($(OPENCV), 1) + COMMON+= -DOPENCV + CFLAGS+= -DOPENCV +-LDFLAGS+= `pkg-config --libs opencv` -lstdc++ ++LDFLAGS+= `pkg-config --libs opencv` ${CXXFLAGS} + COMMON+= `pkg-config --cflags opencv` + endif + +@@ -60,8 +53,8 @@ + + OBJ=gemm.o utils.o cuda.o deconvolutional_layer.o convolutional_layer.o list.o image.o activations.o im2col.o col2im.o blas.o crop_layer.o dropout_layer.o maxpool_layer.o softmax_layer.o data.o matrix.o network.o connected_layer.o cost_layer.o parser.o option_list.o detection_layer.o route_layer.o upsample_layer.o box.o normalization_layer.o avgpool_layer.o layer.o local_layer.o shortcut_layer.o logistic_layer.o activation_layer.o rnn_layer.o gru_layer.o crnn_layer.o demo.o batchnorm_layer.o region_layer.o reorg_layer.o tree.o lstm_layer.o l2norm_layer.o yolo_layer.o iseg_layer.o image_opencv.o + EXECOBJA=captcha.o lsd.o super.o art.o tag.o cifar.o go.o rnn.o segmenter.o regressor.o classifier.o coco.o yolo.o detector.o nightmare.o instance-segmenter.o darknet.o +-ifeq ($(GPU), 1) +-LDFLAGS+= -lstdc++ ++ifeq ($(GPU), 1) ++LDFLAGS+= ${CXXFLAGS} + OBJ+=convolutional_kernels.o deconvolutional_kernels.o activation_kernels.o im2col_kernels.o col2im_kernels.o blas_kernels.o crop_layer_kernels.o dropout_layer_kernels.o maxpool_layer_kernels.o avgpool_layer_kernels.o + endif + +@@ -83,7 +76,7 @@ + $(CC) $(CFLAGS) -shared $^ -o $@ $(LDFLAGS) + + $(OBJDIR)%.o: %.cpp $(DEPS) +- $(CPP) $(COMMON) $(CFLAGS) -c $< -o $@ ++ $(CXX) $(COMMON) $(CFLAGS) -c $< -o $@ + + $(OBJDIR)%.o: %.c $(DEPS) + $(CC) $(COMMON) $(CFLAGS) -c $< -o $@ diff --git a/recipes/darknet/all/test_package/CMakeLists.txt b/recipes/darknet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e651ebaf233a3 --- /dev/null +++ b/recipes/darknet/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(darknet CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} darknet::darknet) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/darknet/all/test_package/conanfile.py b/recipes/darknet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ffafc9bf4fa15 --- /dev/null +++ b/recipes/darknet/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os +from conans import ConanFile, CMake, tools + + +class DarknetTestConan(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/darknet/all/test_package/example.cpp b/recipes/darknet/all/test_package/example.cpp new file mode 100644 index 0000000000000..f552a5b8da9b9 --- /dev/null +++ b/recipes/darknet/all/test_package/example.cpp @@ -0,0 +1,9 @@ +#include "darknet.h" + +#include + +int main() { + image image = make_image(2, 3, 1); + free_image(image); + return 0; +} diff --git a/recipes/darknet/config.yml b/recipes/darknet/config.yml new file mode 100644 index 0000000000000..aca3e3fbca005 --- /dev/null +++ b/recipes/darknet/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20180914": + folder: all diff --git a/recipes/dataframe/all/conandata.yml b/recipes/dataframe/all/conandata.yml new file mode 100644 index 0000000000000..98d9bcc0c3c09 --- /dev/null +++ b/recipes/dataframe/all/conandata.yml @@ -0,0 +1,39 @@ +sources: + "2.0.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/2.0.0.tar.gz" + sha256: "df46ab60153f75ef0a1ab269e6b107ec34fdc467993c3984029d7deb5e0fab6c" + "1.22.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/1.22.0.tar.gz" + sha256: "4b244241cd56893fccb22f7c874588f0d86b444912382ed6e9a4cf95e55ffda2" + "1.21.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/1.21.0.tar.gz" + sha256: "a6b07eaaf628225a34e4402c1a6e311430e8431455669ac03691d92f44081172" + "1.20.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/1.20.0.tar.gz" + sha256: "5c241c71823c6975251f49316e03724f06cd3a288892f5a76dd504fe08700b6d" + "1.19.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.19.0.tar.gz" + sha256: "81382e9c68df7c52f69f645b1830fcd3634eedc07fa3d2024ee6c57cf2cdb7ff" + "1.18.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.18.0.tar.gz" + sha256: "8cdb8b246263fbd8fcef07b6300f6aefb58b3a54cd67e5cbe5383bc948305844" + "1.17.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.17.0.tar.gz" + sha256: "669e9663de358330b15eacaa783ccf42fe16db27b9556fdcd18f1114c0335557" + "1.16.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.16.0.tar.gz" + sha256: "a5a24ec07fb4761a294a291d7bed7c72e82e2dde8bba8bfc1ca2f68e07afd7fc" + "1.15.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.15.0.tar.gz" + sha256: "68eb3fca66dff3f8473722d561e9391800957a09c2c6d4dde5f9ad37cbf88954" + "1.14.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.14.0.tar.gz" + sha256: "45991cc16e478b24641d0548aab24fd59ad534ada30fca8776fd9990e1914ac7" + "1.12.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/1.12.0.tar.gz" + sha256: "e951a699bd048bd7a034ac60bdd45f15cf066a04fda33cb22030d192b91a836c" +patches: + "2.0.0": + - patch_file: "patches/2.0.0-0001-use-abs.patch" + patch_description: "use std::abs instead fabsf/fabsl" + patch_type: "portability" diff --git a/recipes/dataframe/all/conanfile.py b/recipes/dataframe/all/conanfile.py new file mode 100644 index 0000000000000..55d7613657607 --- /dev/null +++ b/recipes/dataframe/all/conanfile.py @@ -0,0 +1,160 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class DataFrameConan(ConanFile): + name = "dataframe" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hosseinmoein/DataFrame" + description = ( + "C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ " + "using native types, continuous memory storage, and no pointers are involved" + ) + topics = ( + "dataframe", + "data-science", + "numerical-analysis", + "multidimensional-data", + "heterogeneous", + "cpp", + "statistical-analysis", + "financial-data-analysis", + "financial-engineering", + "data-analysis", + "trading-strategies", + "machine-learning", + "trading-algorithms", + "financial-engineering", + "large-data", + ) + + 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 _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "6", + "apple-clang": "10.0", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.options.shared and Version(self.version) < "1.20.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared lib with Visual Studio") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "1.20.0": + tc.variables["HMDF_TESTING"] = False + tc.variables["HMDF_EXAMPLES"] = False + tc.variables["HMDF_BENCHMARKS"] = False + elif Version(self.version) >= "1.14.0": + tc.variables["ENABLE_TESTING"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Don't pollute RPATH + if Version(self.version) < "1.20.0": + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + textwrap.dedent("""\ + include(AddInstallRPATHSupport) + add_install_rpath_support(BIN_DIRS "${CMAKE_INSTALL_FULL_LIBDIR}" + LIB_DIRS "${CMAKE_INSTALL_FULL_BINDIR}" + INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" + USE_LINK_PATH) + """), + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "License", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + # Remove packaging files & MS runtime files + for dir_to_remove in [ + os.path.join("lib", "cmake"), + os.path.join("lib", "share"), + os.path.join("lib", "pkgconfig"), + "CMake", + ]: + rmdir(self, os.path.join(self.package_folder, dir_to_remove)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "DataFrame") + self.cpp_info.set_property("cmake_target_name", "DataFrame::DataFrame") + self.cpp_info.set_property("pkg_config_name", "DataFrame") + self.cpp_info.libs = ["DataFrame"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "rt", "m"]) + if is_msvc(self): + self.cpp_info.defines.append("_USE_MATH_DEFINES") + if Version(self.version) < "1.20.0" and not self.options.shared: + # weird but required in those versions of dataframe + self.cpp_info.defines.append("LIBRARY_EXPORTS") + if "1.20.0" <= Version(self.version) < "2.0.0" and self.options.shared: + self.cpp_info.defines.append("HMDF_SHARED") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "DataFrame" + self.cpp_info.names["cmake_find_package_multi"] = "DataFrame" diff --git a/recipes/dataframe/all/patches/2.0.0-0001-use-abs.patch b/recipes/dataframe/all/patches/2.0.0-0001-use-abs.patch new file mode 100644 index 0000000000000..3ff303f97959a --- /dev/null +++ b/recipes/dataframe/all/patches/2.0.0-0001-use-abs.patch @@ -0,0 +1,37 @@ +diff --git b/cmake-add_runtime_destination.patch b/cmake-add_runtime_destination.patch +new file mode 100644 +index 0000000..e69de29 +diff --git a/include/DataFrame/Utils/Utils.h b/include/DataFrame/Utils/Utils.h +index 9f1f1f9..3bb3fde 100644 +--- a/include/DataFrame/Utils/Utils.h ++++ b/include/DataFrame/Utils/Utils.h +@@ -234,17 +234,29 @@ template<> + inline auto + abs__(const long long &val) { return (std::llabs(val)); } + ++#ifdef __GNUC__ ++template<> ++inline auto ++abs__(const float &val) { return (std::abs(val)); } ++#else + template<> + inline auto + abs__(const float &val) { return (std::fabsf(val)); } ++#endif + + template<> + inline auto + abs__(const double &val) { return (std::fabs(val)); } + ++#ifdef __GNUC__ ++template<> ++inline auto ++abs__(const long double &val) { return (std::abs(val)); } ++#else + template<> + inline auto + abs__(const long double &val) { return (std::fabsl(val)); } ++#endif + + // ---------------------------------------------------------------------------- + diff --git a/recipes/dataframe/all/test_package/CMakeLists.txt b/recipes/dataframe/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c82a6b1a8874 --- /dev/null +++ b/recipes/dataframe/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(DataFrame REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE DataFrame::DataFrame) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/dataframe/all/test_package/conanfile.py b/recipes/dataframe/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/dataframe/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/dataframe/all/test_package/test_package.cpp b/recipes/dataframe/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c5f07eb299a96 --- /dev/null +++ b/recipes/dataframe/all/test_package/test_package.cpp @@ -0,0 +1,81 @@ +#include + +#include +#include +#include +#include +#include + +using namespace hmdf; + +typedef StdDataFrame MyDataFrame; + +// ----------------------------------------------------------------------------- + +static void test_haphazard() { + + MyDataFrame::set_thread_level(10); + + std::cout << "\nTesting load_data ..." << std::endl; + + MyDataFrame df; + std::vector &col0 = + df.create_column(static_cast("col_name")); + + std::vector intvec = { 1, 2, 3, 4, 5 }; + std::vector dblvec = + { 1.2345, 2.2345, 3.2345, 4.2345, 5.2345 }; + std::vector dblvec2 = + { 0.998, 0.3456, 0.056, 0.15678, 0.00345, 0.923, 0.06743, 0.1 }; + std::vector strvec = + { "Col_name", "Col_name", "Col_name", "Col_name", "Col_name" }; + std::vector ulgvec = + { 1UL, 2UL, 3UL, 4UL, 5UL, 8UL, 7UL, 6UL }; + std::vector xulgvec = ulgvec; + const size_t total_count = + ulgvec.size() + + intvec.size() + + dblvec.size() + + dblvec2.size() + + strvec.size() + + xulgvec.size() + + 9; // NaN inserterd + + MyDataFrame::size_type rc = + df.load_data(std::move(ulgvec), + std::make_pair("int_col", intvec), + std::make_pair("dbl_col", dblvec), + std::make_pair("dbl_col_2", dblvec2), + std::make_pair("str_col", strvec), + std::make_pair("ul_col", xulgvec)); + + assert(rc == 48); + + df.load_index(ulgvec.begin(), ulgvec.end()); + df.load_column("int_col", { intvec.begin(), intvec.end() }, + nan_policy::pad_with_nans); + df.load_column("str_col", { strvec.begin(), strvec.end() }, + nan_policy::pad_with_nans); + df.load_column("dbl_col", { dblvec.begin(), dblvec.end() }, + nan_policy::pad_with_nans); + df.load_column("dbl_col_2", { dblvec2.begin(), dblvec2.end() }, + nan_policy::dont_pad_with_nans); + + df.append_column("str_col", "Additional column"); + df.append_column("dbl_col", 10.56); + + std::vector ivec = df.get_column ("int_col"); + + assert(df.get_column ("dbl_col")[2] == 3.2345); +} + +// ----------------------------------------------------------------------------- + +int main(int argc, char *argv[]) { + + test_haphazard(); + + return (0); +} + +// ----------------------------------------------------------------------------- diff --git a/recipes/dataframe/all/test_v1_package/CMakeLists.txt b/recipes/dataframe/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/dataframe/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dataframe/all/test_v1_package/conanfile.py b/recipes/dataframe/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/dataframe/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/dataframe/config.yml b/recipes/dataframe/config.yml new file mode 100644 index 0000000000000..db87f49d71721 --- /dev/null +++ b/recipes/dataframe/config.yml @@ -0,0 +1,23 @@ +versions: + "2.0.0": + folder: all + "1.22.0": + folder: all + "1.21.0": + folder: all + "1.20.0": + folder: all + "1.19.0": + folder: all + "1.18.0": + folder: all + "1.17.0": + folder: all + "1.16.0": + folder: all + "1.15.0": + folder: all + "1.14.0": + folder: all + "1.12.0": + folder: all diff --git a/recipes/date/all/conandata.yml b/recipes/date/all/conandata.yml new file mode 100644 index 0000000000000..bed2d768a8963 --- /dev/null +++ b/recipes/date/all/conandata.yml @@ -0,0 +1,29 @@ +sources: + "3.0.1": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.tar.gz" + sha256: "7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538" + "3.0.0": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.0.tar.gz" + sha256: "87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3" + "2.4.1": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v2.4.1.tar.gz" + sha256: "98907d243397483bd7ad889bf6c66746db0d7d2a39cc9aacc041834c40b65b98" +patches: + "3.0.1": + - patch_file: "patches/cmake-3.0.1.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" + "3.0.0": + - patch_file: "patches/cmake-3.0.0.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" + "2.4.1": + - patch_file: "patches/0001-fix-uwp.patch" + patch_description: "Fix Universal Windows Platform (UWP) unhandled exception support. See https://github.com/microsoft/vcpkg/pull/8151#issuecomment-531175393." + patch_type: "portability" + - patch_file: "patches/cmake.patch" + patch_description: "Add libcurl target for conan compatibility" + patch_type: "conan" + - patch_file: "patches/string_view.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" diff --git a/recipes/date/all/conanfile.py b/recipes/date/all/conanfile.py new file mode 100644 index 0000000000000..a42b06fc8f951 --- /dev/null +++ b/recipes/date/all/conanfile.py @@ -0,0 +1,140 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import get, rmdir, apply_conandata_patches, export_conandata_patches, copy +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + + +class DateConan(ConanFile): + name = "date" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/HowardHinnant/date" + description = "A date and time library based on the C++11/14/17 header" + topics = ("datetime", "timezone", "calendar", "time", "iana-database") + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "use_system_tz_db": [True, False], + "use_tz_db_in_dot": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "use_system_tz_db": False, + "use_tz_db_in_dot": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os in ["iOS", "tvOS", "watchOS", "Android"]: + self.options.use_system_tz_db = True + + def configure(self): + if self.options.shared or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if not self.options.header_only and not self.options.use_system_tz_db: + self.requires("libcurl/8.0.1") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_DATE_TESTING"] = False + tc.variables["USE_SYSTEM_TZ_DB"] = self.options.use_system_tz_db + tc.variables["USE_TZ_DB_IN_DOT"] = self.options.use_tz_db_in_dot + tc.variables["BUILD_TZ_LIB"] = not self.options.header_only + # workaround for clang 5 not having string_view + if Version(self.version) >= "3.0.0" and self.settings.compiler == "clang" \ + and Version(self.settings.compiler.version) <= "5.0": + tc.cache_variables["DISABLE_STRING_VIEW"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if not self.options.header_only: + 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) + if self.options.header_only: + src = os.path.join(self.source_folder, "include", "date") + dst = os.path.join(self.package_folder, "include", "date") + copy(self, "date.h", dst=dst, src=src) + copy(self, "tz.h", dst=dst, src=src) + copy(self, "ptz.h", dst=dst, src=src) + copy(self, "iso_week.h", dst=dst, src=src) + copy(self, "julian.h", dst=dst, src=src) + copy(self, "islamic.h", dst=dst, src=src) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "date::date") + # TODO: Remove legacy .names attribute when conan 2.0 is released + self.cpp_info.names["cmake_find_package"] = "date" + self.cpp_info.names["cmake_find_package_multi"] = "date" + + # date-tz + if not self.options.header_only: + self.cpp_info.components["date-tz"].set_property("cmake_target_name", "date::date-tz") + # TODO: Remove legacy .names attribute when conan 2.0 is released + self.cpp_info.components["date-tz"].names["cmake_find_package"] = "date-tz" + self.cpp_info.components["date-tz"].names["cmake_find_package_multi"] = "date-tz" + lib_name = "{}tz".format("date-" if Version(self.version) >= "3.0.0" else "") + self.cpp_info.components["date-tz"].libs = [lib_name] + if self.settings.os == "Linux": + self.cpp_info.components["date-tz"].system_libs.append("pthread") + self.cpp_info.components["date-tz"].system_libs.append("m") + + if not self.options.use_system_tz_db: + self.cpp_info.components["date-tz"].requires.append("libcurl::libcurl") + + if self.options.use_system_tz_db and not self.settings.os == "Windows": + use_os_tzdb = 1 + else: + use_os_tzdb = 0 + + defines = ["USE_OS_TZDB={}".format(use_os_tzdb)] + if self.settings.os == "Windows" and self.options.shared: + defines.append("DATE_USE_DLL=1") + + self.cpp_info.components["date-tz"].defines.extend(defines) + else: + self.cpp_info.defines.append("DATE_HEADER_ONLY") diff --git a/recipes/date/all/patches/0001-fix-uwp.patch b/recipes/date/all/patches/0001-fix-uwp.patch new file mode 100644 index 0000000000000..f7b5c246619fc --- /dev/null +++ b/recipes/date/all/patches/0001-fix-uwp.patch @@ -0,0 +1,17 @@ +diff --git a/include/date/date.h b/include/date/date.h +index cb115a9..66d87c2 100644 +--- a/include/date/date.h ++++ b/include/date/date.h +@@ -76,6 +76,12 @@ + # endif + #endif + ++#ifdef _MSC_VER ++# pragma warning(push) ++// warning C4127: conditional expression is constant ++# pragma warning(disable : 4127 4996) ++#endif ++ + namespace date + { + diff --git a/recipes/date/all/patches/cmake-3.0.0.patch b/recipes/date/all/patches/cmake-3.0.0.patch new file mode 100644 index 0000000000000..583e86e586463 --- /dev/null +++ b/recipes/date/all/patches/cmake-3.0.0.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad74900..ac390a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,6 +127,9 @@ if( BUILD_TZ_LIB ) + target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ) + target_link_libraries( date-tz PRIVATE ${CURL_LIBRARIES} ) + endif( ) ++ if( DISABLE_STRING_VIEW ) ++ target_compile_definitions( date-tz PRIVATE -DHAS_STRING_VIEW=0 -DHAS_DEDUCTION_GUIDES=0 ) ++ endif( ) + endif( ) + + #[===================================================================[ diff --git a/recipes/date/all/patches/cmake-3.0.1.patch b/recipes/date/all/patches/cmake-3.0.1.patch new file mode 100644 index 0000000000000..8edcb30921f23 --- /dev/null +++ b/recipes/date/all/patches/cmake-3.0.1.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad74900..ac390a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -156,6 +156,9 @@ if( BUILD_TZ_LIB ) + target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ) + target_link_libraries( date-tz PRIVATE ${CURL_LIBRARIES} ) + endif( ) ++ if( DISABLE_STRING_VIEW ) ++ target_compile_definitions( date-tz PRIVATE -DHAS_STRING_VIEW=0 -DHAS_DEDUCTION_GUIDES=0 ) ++ endif( ) + endif( ) + + #[===================================================================[ diff --git a/recipes/date/all/patches/cmake.patch b/recipes/date/all/patches/cmake.patch new file mode 100644 index 0000000000000..3f9df797629dd --- /dev/null +++ b/recipes/date/all/patches/cmake.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f025a3a..7bc93df 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -57,8 +57,12 @@ else( ) + target_compile_definitions( tz PRIVATE -DHAS_REMOTE_API=1 ) + target_compile_definitions( tz PUBLIC -DUSE_OS_TZDB=0 ) + find_package( CURL REQUIRED ) +- include_directories( SYSTEM ${CURL_INCLUDE_DIRS} ) +- set( OPTIONAL_LIBRARIES ${CURL_LIBRARIES} ) ++ set( OPTIONAL_LIBRARIES CURL::libcurl ) ++endif() ++ ++if( BUILD_SHARED_LIBS ) ++ target_compile_definitions( tz PRIVATE -DDATE_BUILD_DLL=1 ) ++ target_compile_definitions( tz PUBLIC -DDATE_USE_DLL=1 ) + endif( ) + + if( USE_TZ_DB_IN_DOT ) diff --git a/recipes/date/all/patches/string_view.patch b/recipes/date/all/patches/string_view.patch new file mode 100644 index 0000000000000..008dd04ccd0c4 --- /dev/null +++ b/recipes/date/all/patches/string_view.patch @@ -0,0 +1,13 @@ +diff --git a/include/date/date.h b/include/date/date.h +index cb115a9..23cd05a 100644 +--- a/include/date/date.h ++++ b/include/date/date.h +@@ -31,7 +31,7 @@ + // We did not mean to shout. + + #ifndef HAS_STRING_VIEW +-# if __cplusplus >= 201703 ++# if __cplusplus >= 201703 && __has_include() + # define HAS_STRING_VIEW 1 + # else + # define HAS_STRING_VIEW 0 diff --git a/recipes/date/all/test_package/CMakeLists.txt b/recipes/date/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..276e986aaf0a2 --- /dev/null +++ b/recipes/date/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(date REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE date::date) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(DATE_HEADER_ONLY) + target_compile_definitions(${PROJECT_NAME} PRIVATE DATE_HEADER_ONLY) +endif() diff --git a/recipes/date/all/test_package/conanfile.py b/recipes/date/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d75ac2f1b24f1 --- /dev/null +++ b/recipes/date/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DATE_HEADER_ONLY"] = self.dependencies["date"].options.header_only + 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/date/all/test_package/test_package.cpp b/recipes/date/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8dcac9f656989 --- /dev/null +++ b/recipes/date/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +#include "date/date.h" +#include "date/tz.h" + +#include +#include +#include +#include + +class ZoneOffset { +public: + explicit ZoneOffset(std::chrono::minutes offset) + : _offset(offset) {} + + template + auto to_local(date::sys_time tp) const + -> date::local_time::type> { + using namespace date; + using namespace std::chrono; + using LT = local_time::type>; + return LT{(tp + _offset).time_since_epoch()}; + } + + template + auto to_sys(date::local_time tp) const + -> date::sys_time::type> { + using namespace date; + using namespace std::chrono; + using ST = sys_time::type>; + return ST{(tp - _offset).time_since_epoch()}; + } + +private: + std::chrono::minutes _offset; +}; + +int main() { + using namespace std::chrono; + using namespace date; + + auto date1 = 2015_y/March/22; + std::cout << date1 << '\n'; + auto date2 = March/22/2015; + std::cout << date2 << '\n'; + auto date3 = 22_d/March/2015; + std::cout << date3 << '\n'; + + ZoneOffset p3_45{hours{3} + minutes{45}}; + zoned_time zt{&p3_45, floor(system_clock::now())}; + std::cout << zt.get_sys_time() << " (sys time)\n"; + std::cout << zt.get_local_time() << " (local time)\n"; + +#ifndef DATE_HEADER_ONLY + try { + auto tz = date::current_zone()->name(); + std::cout << "timezone: " << tz << std::endl; + } catch (const std::exception & e) { + std::cout << "exception caught " << e.what() << std::endl; + } +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/date/all/test_v1_package/CMakeLists.txt b/recipes/date/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/date/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/date/all/test_v1_package/conanfile.py b/recipes/date/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..09dc5f4a353ed --- /dev/null +++ b/recipes/date/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["DATE_HEADER_ONLY"] = self.options["date:header_only"] + 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/date/config.yml b/recipes/date/config.yml new file mode 100644 index 0000000000000..f4831f05aaf9e --- /dev/null +++ b/recipes/date/config.yml @@ -0,0 +1,7 @@ +versions: + "3.0.1": + folder: all + "3.0.0": + folder: all + "2.4.1": + folder: all diff --git a/recipes/dav1d/all/conandata.yml b/recipes/dav1d/all/conandata.yml new file mode 100644 index 0000000000000..960fc25c0f85a --- /dev/null +++ b/recipes/dav1d/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "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 new file mode 100644 index 0000000000000..8a1651ceed708 --- /dev/null +++ b/recipes/dav1d/all/conanfile.py @@ -0,0 +1,128 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +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" + + +class Dav1dConan(ConanFile): + name = "dav1d" + description = "dav1d is a new AV1 cross-platform decoder, open-source, and focused on speed, size and correctness." + homepage = "https://www.videolan.org/projects/dav1d.html" + topics = ("av1", "codec", "video", "decoding") + license = "BSD-2-Clause" + 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], + "bit_depth": ["all", 8, 16], + "with_tools": [True, False], + "assembly": [True, False], + "with_avx512": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "bit_depth": "all", + "with_tools": True, + "assembly": True, + "with_avx512": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + 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 build_requirements(self): + self.tool_requires("meson/1.1.0") + if self.options.assembly: + self.tool_requires("nasm/2.15.05") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = MesonToolchain(self) + tc.project_options["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" + else: + tc.project_options["bitdepths"] = str(self.options.bit_depth) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "subdir('doc')", "") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "dav1d") + self.cpp_info.libs = ["dav1d"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "pthread"]) + + # TODO: to remove in conan v2 + if self.options.with_tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/dav1d/all/test_package/CMakeLists.txt b/recipes/dav1d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ef99743f0b06 --- /dev/null +++ b/recipes/dav1d/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(dav1d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE dav1d::dav1d) diff --git a/recipes/dav1d/all/test_package/conanfile.py b/recipes/dav1d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/dav1d/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/dav1d/all/test_package/test_package.c b/recipes/dav1d/all/test_package/test_package.c new file mode 100644 index 0000000000000..cfddab4661ffd --- /dev/null +++ b/recipes/dav1d/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "dav1d/dav1d.h" + +#include + +int main() +{ + printf("dav1d version: %s\n", dav1d_version()); + return 0; +} diff --git a/recipes/dav1d/all/test_v1_package/CMakeLists.txt b/recipes/dav1d/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/dav1d/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/dav1d/all/test_v1_package/conanfile.py b/recipes/dav1d/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/dav1d/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/dav1d/config.yml b/recipes/dav1d/config.yml new file mode 100644 index 0000000000000..1807dabd0bac4 --- /dev/null +++ b/recipes/dav1d/config.yml @@ -0,0 +1,9 @@ +versions: + "1.1.0": + folder: "all" + "1.0.0": + folder: "all" + "0.9.1": + folder: "all" + "0.8.1": + folder: "all" diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml new file mode 100644 index 0000000000000..759c5753e034d --- /dev/null +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "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" + "2.73.1": + url: "https://github.com/beached/header_libraries/archive/v2.73.1.tar.gz" + sha256: "62bd26398afa7eba1aae7bbbf107865044b8be0539d266085c36aed82557ae07" + "2.72.0": + url: "https://github.com/beached/header_libraries/archive/v2.72.0.tar.gz" + sha256: "f681755183af4af35f4741f3bcb7d99c6707911806e39e3acc982f9532aacc08" + "2.71.0": + url: "https://github.com/beached/header_libraries/archive/v2.71.0.tar.gz" + sha256: "50b9ddebdbc808a5714408a45f686fafe9d1d3b78c988df3973c12c9928828b9" + "2.68.3": + url: "https://github.com/beached/header_libraries/archive/v2.68.3.tar.gz" + sha256: "9bb7d25d161b89ad4a0ac857c28734c061cf53f6e80212c7fe70b8e0fd14789f" + "1.29.7": + url: "https://github.com/beached/header_libraries/archive/refs/tags/v1.29.7.tar.gz" + sha256: "524c34f3f5d2af498e7bcaff7802b914ba42acde29f7e3ecce41a035db0bf5bd" diff --git a/recipes/daw_header_libraries/all/conanfile.py b/recipes/daw_header_libraries/all/conanfile.py new file mode 100644 index 0000000000000..b6840ea09fa55 --- /dev/null +++ b/recipes/daw_header_libraries/all/conanfile.py @@ -0,0 +1,78 @@ +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.50.0" + + +class DawHeaderLibrariesConan(ConanFile): + name = "daw_header_libraries" + description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" + 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") + 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": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.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( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "daw-header-libraries") + self.cpp_info.set_property("cmake_target_name", "daw::daw-header-libraries") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "daw-header-libraries" + self.cpp_info.filenames["cmake_find_package_multi"] = "daw-header-libraries" + self.cpp_info.names["cmake_find_package"] = "daw" + self.cpp_info.names["cmake_find_package_multi"] = "daw" + self.cpp_info.components["daw"].names["cmake_find_package"] = "daw-header-libraries" + self.cpp_info.components["daw"].names["cmake_find_package_multi"] = "daw-header-libraries" + self.cpp_info.components["daw"].set_property("cmake_target_name", "daw::daw-header-libraries") diff --git a/recipes/daw_header_libraries/all/test_package/CMakeLists.txt b/recipes/daw_header_libraries/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..817fb2a992dc4 --- /dev/null +++ b/recipes/daw_header_libraries/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(daw-header-libraries REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE daw::daw-header-libraries) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/daw_header_libraries/all/test_package/conanfile.py b/recipes/daw_header_libraries/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/daw_header_libraries/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/daw_header_libraries/all/test_package/test_package.cpp b/recipes/daw_header_libraries/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7b47a51d28ef5 --- /dev/null +++ b/recipes/daw_header_libraries/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "daw/daw_carray.h" + +int main() { + daw::carray t = { 1, 2, 3, 4, 5, 6 }; + + auto val = t[3]; + + return 0; +} diff --git a/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt b/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/daw_header_libraries/all/test_v1_package/conanfile.py b/recipes/daw_header_libraries/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/daw_header_libraries/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml new file mode 100644 index 0000000000000..95e2e809241da --- /dev/null +++ b/recipes/daw_header_libraries/config.yml @@ -0,0 +1,23 @@ +versions: + "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 + "2.73.1": + folder: all + "2.72.0": + folder: all + "2.71.0": + folder: all + "2.68.3": + folder: all + "1.29.7": + folder: all diff --git a/recipes/daw_json_link/all/conandata.yml b/recipes/daw_json_link/all/conandata.yml new file mode 100644 index 0000000000000..5ccbbdb92e211 --- /dev/null +++ b/recipes/daw_json_link/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "3.16.0": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.16.0.tar.gz" + sha256: "48eae5db76e72a481ba4830900974178c49fb8c7c89909405381bd1775cbc84c" + "3.15.0": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.15.0.tar.gz" + sha256: "6f72c69944e33f56823d941b09c8d17ece44b224e802ae0a3416c32f2bdbec40" + "3.14.1": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.14.1.tar.gz" + sha256: "a761c594dabd14b7484f5d286db31e9272f633d2ad0dab44cdae5ff3f06db6fb" + "3.14.0": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.14.tar.gz" + sha256: "07171e1b8f09f525116627015b6618990dc9cfb32357ba821512c0508730c9a4" + "3.12.0": + url: "https://github.com/beached/daw_json_link/archive/v3.12.0.tar.gz" + sha256: "b32097954caae14071893232fd85febbfda1deec34bb939f6aad76c077c6c5d5" + "3.11.1": + url: "https://github.com/beached/daw_json_link/archive/v3.11.1.tar.gz" + sha256: "d2b5cb221892c6b1ecd30fd2e45d168d6b378e97d134e75349703104c5882309" + "3.10.0": + url: "https://github.com/beached/daw_json_link/archive/v3.10.0.tar.gz" + sha256: "8a2e635e695d57eb147815f516c56d48360b103fbefc06f720607e8cf93c2937" + "3.8.1": + url: "https://github.com/beached/daw_json_link/archive/v3.8.1.tar.gz" + sha256: "b0f20310d1e295babaca62b83488b22f438cc4aacf8a7a47dcc92ad7386baaec" + "3.5.0": + url: "https://github.com/beached/daw_json_link/archive/v3.5.0.tar.gz" + sha256: "d1643725711b4564fb166f1f4bac0acb386fbbdb761f822c99a4ef585d8bdd71" + "3.4.1": + url: "https://github.com/beached/daw_json_link/archive/v3.4.1.tar.gz" + sha256: "3f57ccc936a9999b5c8c5684b2b3b8b989f50ef6e1ea8dce7bc311d1c77195ac" + "3.3.0": + url: "https://github.com/beached/daw_json_link/archive/v3.3.0.tar.gz" + sha256: "fd806245fc8b944e613b29da5ef0570c0e6881b6049a7bf65eb0285c58848f40" + "3.1.1": + url: "https://github.com/beached/daw_json_link/archive/v3.1.1.tar.gz" + sha256: "7d340886898b2ea3c595f0f871c81e4c7382fe53d22d80edc5629768e49fa634" + "2.15.3": + url: "https://github.com/beached/daw_json_link/archive/v2.15.3.tar.gz" + sha256: "ec0457a5682a76c5aec709f2d6959ef7bafa0b54c5e7740f911d97991188ee84" diff --git a/recipes/daw_json_link/all/conanfile.py b/recipes/daw_json_link/all/conanfile.py new file mode 100644 index 0000000000000..8aa6c28e920ef --- /dev/null +++ b/recipes/daw_json_link/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.52.0" + +class DawJsonLinkConan(ConanFile): + name = "daw_json_link" + description = "Static JSON parsing in C++" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/beached/daw_json_link" + topics = ("json", "parse", "json-parser", "serialization", "constexpr", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + short_paths = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("daw_header_libraries/2.88.0") + self.requires("daw_utf_range/2.2.3") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + 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._minimum_cpp_standard}, 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["DAW_USE_PACKAGE_MANAGEMENT"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + + 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "daw-json-link") + self.cpp_info.set_property("cmake_target_name", "daw::daw-json-link") + self.cpp_info.components["daw"].set_property("cmake_target_name", "daw::daw-json-link") + self.cpp_info.components["daw"].requires = ["daw_header_libraries::daw", "daw_utf_range::daw"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "daw-json-link" + self.cpp_info.filenames["cmake_find_package_multi"] = "daw-json-link" + self.cpp_info.names["cmake_find_package"] = "daw" + self.cpp_info.names["cmake_find_package_multi"] = "daw" + self.cpp_info.components["daw"].names["cmake_find_package"] = "daw-json-link" + self.cpp_info.components["daw"].names["cmake_find_package_multi"] = "daw-json-link" diff --git a/recipes/daw_json_link/all/test_package/CMakeLists.txt b/recipes/daw_json_link/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5162d77931f1e --- /dev/null +++ b/recipes/daw_json_link/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(daw-json-link REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE daw::daw-json-link) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/daw_json_link/all/test_package/conanfile.py b/recipes/daw_json_link/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/daw_json_link/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/daw_json_link/all/test_package/test_package.cpp b/recipes/daw_json_link/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f1f131b75e79a --- /dev/null +++ b/recipes/daw_json_link/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +#include "daw/json/daw_json_link.h" + +int main() { + std::string json_data = "[1, 2, 3, 4, 5]"; + + auto const obj = daw::json::from_json_array(json_data); + + for (auto val : obj) { + std::cout << val << std::endl; + } + + return 0; +} diff --git a/recipes/daw_json_link/all/test_v1_package/CMakeLists.txt b/recipes/daw_json_link/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b4b25bff2f0cd --- /dev/null +++ b/recipes/daw_json_link/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/daw_json_link/all/test_v1_package/conanfile.py b/recipes/daw_json_link/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..103e285f2d1a0 --- /dev/null +++ b/recipes/daw_json_link/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class DawJsonLinkTestConan(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/daw_json_link/config.yml b/recipes/daw_json_link/config.yml new file mode 100644 index 0000000000000..b5d7c520796ca --- /dev/null +++ b/recipes/daw_json_link/config.yml @@ -0,0 +1,27 @@ +versions: + "3.16.0": + folder: "all" + "3.15.0": + folder: "all" + "3.14.1": + folder: "all" + "3.14.0": + folder: "all" + "3.12.0": + folder: "all" + "3.11.1": + folder: "all" + "3.10.0": + folder: "all" + "3.8.1": + folder: "all" + "3.5.0": + folder: "all" + "3.4.1": + folder: "all" + "3.3.0": + folder: "all" + "3.1.1": + folder: "all" + "2.15.3": + folder: "all" diff --git a/recipes/daw_utf_range/all/conandata.yml b/recipes/daw_utf_range/all/conandata.yml new file mode 100644 index 0000000000000..179be6adbbd6e --- /dev/null +++ b/recipes/daw_utf_range/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.2.3": + url: "https://github.com/beached/utf_range/archive/v2.2.3.tar.gz" + sha256: "cfa36285ffbdf8d4d08fbbe95d054e67ad845c064a92419ea68a770415ad7a98" + "2.2.2": + url: "https://github.com/beached/utf_range/archive/refs/tags/v2.2.2.tar.gz" + sha256: "5380ade7c7eb5c82a748211896fc7385eaec00d3215af1374aec8f0e326f91fd" + "2.2.0": + url: "https://github.com/beached/utf_range/archive/refs/tags/v2.2.0.tar.gz" + sha256: "00f60360736062403c8a7a94dd07c750366958f20d1864578faecf2e09d84265" diff --git a/recipes/daw_utf_range/all/conanfile.py b/recipes/daw_utf_range/all/conanfile.py new file mode 100644 index 0000000000000..39ca72fe75c36 --- /dev/null +++ b/recipes/daw_utf_range/all/conanfile.py @@ -0,0 +1,91 @@ +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.47.0" + +class DawUtfRangeConan(ConanFile): + name = "daw_utf_range" + description = "Range operations on character arrays" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/beached/utf_range/" + topics = ("utf", "validator", "iterator") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("daw_header_libraries/2.88.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DAW_USE_PACKAGE_MANAGEMENT"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + + 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.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "daw-utf-range") + self.cpp_info.set_property("cmake_target_name", "daw::daw-utf-range") + self.cpp_info.components["daw"].set_property("cmake_target_name", "daw::daw-utf-range") + self.cpp_info.components["daw"].requires = ["daw_header_libraries::daw"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "daw-utf-range" + self.cpp_info.filenames["cmake_find_package_multi"] = "daw-utf-range" + self.cpp_info.names["cmake_find_package"] = "daw" + self.cpp_info.names["cmake_find_package_multi"] = "daw" + self.cpp_info.components["daw"].names["cmake_find_package"] = "daw-utf-range" + self.cpp_info.components["daw"].names["cmake_find_package_multi"] = "daw-utf-range" diff --git a/recipes/daw_utf_range/all/test_package/CMakeLists.txt b/recipes/daw_utf_range/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..423476843bbe4 --- /dev/null +++ b/recipes/daw_utf_range/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(daw-utf-range REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE daw::daw-utf-range) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/daw_utf_range/all/test_package/conanfile.py b/recipes/daw_utf_range/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/daw_utf_range/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/daw_utf_range/all/test_package/test_package.cpp b/recipes/daw_utf_range/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3591cd38b07aa --- /dev/null +++ b/recipes/daw_utf_range/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include "daw/utf8/unchecked.h" +#include +#include + +int main() { + std::string sample{"あいうえお abcde"}; + + auto first = daw::utf8::unchecked::iterator{sample.begin()}; + auto last = daw::utf8::unchecked::iterator{sample.end()}; + + int count = 0; + for (; first != last; ++first) { + ++count; + } + + std::cout << count << std::endl; + + return 0; +} diff --git a/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt b/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/daw_utf_range/all/test_v1_package/conanfile.py b/recipes/daw_utf_range/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e4d8733790192 --- /dev/null +++ b/recipes/daw_utf_range/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class DawUtfRangeTestConan(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/daw_utf_range/config.yml b/recipes/daw_utf_range/config.yml new file mode 100644 index 0000000000000..20edb7543cf05 --- /dev/null +++ b/recipes/daw_utf_range/config.yml @@ -0,0 +1,7 @@ +versions: + "2.2.3": + folder: "all" + "2.2.2": + folder: "all" + "2.2.0": + folder: "all" diff --git a/recipes/dbcppp/all/conandata.yml b/recipes/dbcppp/all/conandata.yml new file mode 100644 index 0000000000000..ee0c7b702a4f7 --- /dev/null +++ b/recipes/dbcppp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "3.2.6": + url: https://github.com/xR3b0rn/dbcppp/archive/refs/tags/v3.2.6.tar.gz + sha256: "e54829abf503abbc95513629e9318450224c1b22c0fcee4febc16cbfd73afafb" +patches: + "3.2.6": + - patch_file: "patches/0001-dep-cmake-rem-kcd.patch" + patch_type: "conan" + patch_description: "Disable use of KCD to ensure compatibility with conan" diff --git a/recipes/dbcppp/all/conanfile.py b/recipes/dbcppp/all/conanfile.py new file mode 100644 index 0000000000000..3a0d9d2ce43eb --- /dev/null +++ b/recipes/dbcppp/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class DBCpppConan(ConanFile): + name = "dbcppp" + description = ".dbc library for C/C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xR3b0rn/dbcppp" + topics = ("can", "dbc", "network") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tools": False, + } + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "12", + "apple-clang": "12", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.options["boost"].header_only = True + + def layout(self): + cmake_layout(self) + + def requirements(self): + if self.options.with_tools: + self.requires("cxxopts/3.0.0") + self.requires("boost/1.80.0") + + def validate(self): + if self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not currently support {self.ref}:shared=True") + + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][str(self.version)],destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.variables["build_tests"] = False + tc.variables["build_examples"] = False + tc.variables["build_tools"] = self.options.with_tools + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + rm(self, "KCD2Network.cpp", self.source_folder, recursive=True) # Cannot support KCD because of weird dll issues + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["libdbcppp"] + self.env_info.path.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/dbcppp/all/patches/0001-dep-cmake-rem-kcd.patch b/recipes/dbcppp/all/patches/0001-dep-cmake-rem-kcd.patch new file mode 100644 index 0000000000000..094014da38730 --- /dev/null +++ b/recipes/dbcppp/all/patches/0001-dep-cmake-rem-kcd.patch @@ -0,0 +1,317 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d905b29..d35d486 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,53 +5,16 @@ project("libdbcppp" VERSION 0.1.0) + + option(build_tests "Build tests" ON) + option(build_examples "Build examples" ON) ++option(build_tools "Build tools" ON) + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_STATIC_LIBRARY_PREFIX "") +-set(CMAKE_SHARED_LIBRARY_PREFIX "") +-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_definitions("/bigobj") + endif() + + include_directories("include") +-include_directories("third-party/libxml2/include") +-include_directories("third-party/libxmlmm/libxmlmm") +-include_directories("third-party/boost") +-include_directories("third-party/cxxopts/include") + +-set(LIBXML2_WITH_ICONV OFF) +-set(LIBXML2_WITH_LZMA OFF) +-set(LIBXML2_WITH_PYTHON OFF) +-set(LIBXML2_WITH_ZLIB OFF) +-set(LIBXML2_WITH_TESTS OFF) +- +-add_subdirectory(third-party/libxml2) +- +-file(GLOB libxmlmm_header +- "third-party/libxmlmm/libxmlmm/*.h" +-) +-file(GLOB libxmlmm_src +- "third-party/libxmlmm/libxmlmm/*.cpp" +-) +- +-add_library(libxmlmm SHARED "") +-target_link_libraries(libxmlmm LibXml2) +- +-target_sources("libxmlmm" +- PRIVATE ${libxmlmm_header} +- PRIVATE ${libxmlmm_src} +-) +- +-install( +- TARGETS "libxmlmm" "LibXml2" EXPORT ${PROJECT_NAME}Targets +- DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-install( +- DIRECTORY "libxmlmm" +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxmlmm +- FILES_MATCHING PATTERN "*.h") +- + add_subdirectory(src) + if (build_tests) + add_subdirectory(tests) +@@ -59,7 +22,3 @@ endif() + if (build_examples) + add_subdirectory(examples) + endif() +- +-set(CMAKE_STATIC_LIBRARY_PREFIX "") +-set(CMAKE_SHARED_LIBRARY_PREFIX "") +-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +diff --git a/include/dbcppp/Export.h b/include/dbcppp/Export.h +index 00dac6a..2ebe898 100644 +--- a/include/dbcppp/Export.h ++++ b/include/dbcppp/Export.h +@@ -1,12 +1,4 @@ + + #pragma once + +-#ifdef _WIN32 +-# ifdef DBCPPP_EXPORT +-# define DBCPPP_API __declspec(dllexport) +-# else +-# define DBCPPP_API __declspec(dllimport) +-# endif +-#else +-# define DBCPPP_API +-#endif ++#define DBCPPP_API +diff --git a/include/dbcppp/Network.h b/include/dbcppp/Network.h +index 34459e9..f36084b 100644 +--- a/include/dbcppp/Network.h ++++ b/include/dbcppp/Network.h +@@ -39,7 +39,6 @@ namespace dbcppp + , std::string&& comment); + static std::map> LoadNetworkFromFile(const std::filesystem::path& filename); + static std::unique_ptr LoadDBCFromIs(std::istream& is); +- static std::map> LoadKCDFromIs(std::istream& is); + + virtual std::unique_ptr Clone() const = 0; + +diff --git a/src/dbcppp/CMakeLists.txt b/src/dbcppp/CMakeLists.txt +index 371cbbf..6d56ae9 100644 +--- a/src/dbcppp/CMakeLists.txt ++++ b/src/dbcppp/CMakeLists.txt +@@ -1,8 +1,6 @@ +- +-include_directories( +- ${CMAKE_SOURCE_DIR}/src +- ${CMAKE_BINARY_DIR}/src +-) ++if(NOT build_tools) ++ return() ++endif() + + file(GLOB header + "*.h" +@@ -11,10 +9,12 @@ file(GLOB src + "*.cpp" + ) + ++find_package(cxxopts CONFIG REQUIRED) ++ + add_executable(dbcppp ${header} ${src}) + set_property(TARGET dbcppp PROPERTY CXX_STANDARD 17) + add_dependencies(dbcppp ${PROJECT_NAME}) +-target_link_libraries(dbcppp ${PROJECT_NAME} ${Boost_LIBRARIES}) ++target_link_libraries(dbcppp ${PROJECT_NAME} cxxopts::cxxopts) + + install( + TARGETS dbcppp +diff --git a/src/dbcppp/main.cpp b/src/dbcppp/main.cpp +index 462af2e..9ce93a6 100644 +--- a/src/dbcppp/main.cpp ++++ b/src/dbcppp/main.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -35,11 +36,7 @@ int main(int argc, char** argv) + ("f,format", "Output format (C, DBC, human)", cxxopts::value()) + ("dbc", "List of DBC files", cxxopts::value>()); + +- for (std::size_t i = 1; i < argc - 1; i++) +- { +- argv[i] = argv[i + 1]; +- } +- auto vm = options.parse(argc - 1, argv); ++ auto vm = options.parse(argc, argv); + + if (vm.count("help")) + { +@@ -89,10 +86,6 @@ int main(int argc, char** argv) + options.add_options() + ("h,help", "Produce help message") + ("bus", "List of buses in format <:>", cxxopts::value>()); +- for (std::size_t i = 1; i < argc - 1; i++) +- { +- argv[i] = argv[i + 1]; +- } + auto vm = options.parse(argc, argv); + if (vm.count("help")) + { +diff --git a/src/libdbcppp/CMakeLists.txt b/src/libdbcppp/CMakeLists.txt +index 9a69748..0ced933 100644 +--- a/src/libdbcppp/CMakeLists.txt ++++ b/src/libdbcppp/CMakeLists.txt +@@ -2,12 +2,11 @@ + include(GNUInstallDirs) + include(TestBigEndian) + +-add_library(${PROJECT_NAME} SHARED "") ++add_library(${PROJECT_NAME} "") + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + +-target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${LIBXML2_LIBRARIES} "libxmlmm") +- +-add_compile_definitions(DBCPPP_EXPORT) ++find_package(Boost CONFIG REQUIRED) ++target_link_libraries(${PROJECT_NAME} boost::boost) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -45,9 +44,6 @@ target_sources(${PROJECT_NAME} + ) + set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${header_interface}") + +-include(GenerateExportHeader) +-generate_export_header(${PROJECT_NAME}) +- + # install + install( + TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets +@@ -57,35 +53,3 @@ install( + FILES + $ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dbcppp) +- +-include(CMakePackageConfigHelpers) +-write_basic_package_version_file( +- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" +- VERSION ${Upstream_VERSION} +- COMPATIBILITY AnyNewerVersion +-) +- +-export(EXPORT ${PROJECT_NAME}Targets +- FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake" +-) +-configure_file(cmake/${PROJECT_NAME}Config.cmake +- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" +- @ONLY +-) +- +-set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +-install(EXPORT ${PROJECT_NAME}Targets +- FILE +- ${PROJECT_NAME}Targets.cmake +- DESTINATION +- ${ConfigPackageLocation} +-) +-install( +- FILES +- cmake/${PROJECT_NAME}Config.cmake +- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" +- DESTINATION +- ${ConfigPackageLocation} +- COMPONENT +- Devel +-) +\ No newline at end of file +diff --git a/src/libdbcppp/DBCAST2Network.cpp b/src/libdbcppp/DBCAST2Network.cpp +index fbbf155..d2fb973 100644 +--- a/src/libdbcppp/DBCAST2Network.cpp ++++ b/src/libdbcppp/DBCAST2Network.cpp +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + #include + +diff --git a/src/libdbcppp/Export.h b/src/libdbcppp/Export.h +index 00dac6a..2ebe898 100644 +--- a/src/libdbcppp/Export.h ++++ b/src/libdbcppp/Export.h +@@ -1,12 +1,4 @@ + + #pragma once + +-#ifdef _WIN32 +-# ifdef DBCPPP_EXPORT +-# define DBCPPP_API __declspec(dllexport) +-# else +-# define DBCPPP_API __declspec(dllimport) +-# endif +-#else +-# define DBCPPP_API +-#endif ++#define DBCPPP_API +diff --git a/src/libdbcppp/Network2DBC.cpp b/src/libdbcppp/Network2DBC.cpp +index 3de0623..2fc7caa 100644 +--- a/src/libdbcppp/Network2DBC.cpp ++++ b/src/libdbcppp/Network2DBC.cpp +@@ -1,5 +1,6 @@ + #include "../../include/dbcppp/Network2Functions.h" + #include "NetworkImpl.h" ++#include + + using namespace dbcppp; + using namespace dbcppp::Network2DBC; +diff --git a/src/libdbcppp/Network2Human.cpp b/src/libdbcppp/Network2Human.cpp +index d61ee14..3110f2f 100644 +--- a/src/libdbcppp/Network2Human.cpp ++++ b/src/libdbcppp/Network2Human.cpp +@@ -1,6 +1,7 @@ + + #include + #include "../../include/dbcppp/Network2Functions.h" ++#include + + using namespace dbcppp; + +diff --git a/src/libdbcppp/NetworkImpl.cpp b/src/libdbcppp/NetworkImpl.cpp +index 04ce841..eab54e5 100644 +--- a/src/libdbcppp/NetworkImpl.cpp ++++ b/src/libdbcppp/NetworkImpl.cpp +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include "../../include/dbcppp/Network.h" + #include "NetworkImpl.h" + +@@ -339,9 +340,5 @@ std::map> INetwork::LoadNetworkFromFile(c + result.insert(std::make_pair("", std::move(net))); + } + } +- else if (filename.extension() == ".kcd") +- { +- result = LoadKCDFromIs(is); +- } + return std::move(result); + } +\ No newline at end of file +diff --git a/src/libdbcppp/SignalMultiplexerValueImpl.cpp b/src/libdbcppp/SignalMultiplexerValueImpl.cpp +index 9c9a601..fea0544 100644 +--- a/src/libdbcppp/SignalMultiplexerValueImpl.cpp ++++ b/src/libdbcppp/SignalMultiplexerValueImpl.cpp +@@ -1,5 +1,6 @@ + + #include "SignalMultiplexerValueImpl.h" ++#include + + using namespace dbcppp; + diff --git a/recipes/dbcppp/all/test_package/CMakeLists.txt b/recipes/dbcppp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c5a24dec129dd --- /dev/null +++ b/recipes/dbcppp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(dbcppp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dbcppp::dbcppp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/dbcppp/all/test_package/conanfile.py b/recipes/dbcppp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/dbcppp/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dbcppp/all/test_package/test_package.cpp b/recipes/dbcppp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9adb143af2782 --- /dev/null +++ b/recipes/dbcppp/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ + +#include +#include +#include + +#include + +int main() { + constexpr char* test_dbc = + "VERSION \"\"\n" + "NS_ :\n" + "BS_: 1 : 2, 3\n" + "BU_:\n" + "BO_ 1 Msg0: 8 Sender0\n" + " SG_ Sig0: 0|1@1+ (1,0) [1|12] \"Unit0\" Vector__XXX\n" + " SG_ Sig1 m0 : 1|1@0- (1,0) [1|12] \"Unit1\" Recv0, Recv1\n" + " SG_ Sig2 M : 2|1@0- (1,0) [1|12] \"Unit2\" Recv0, Recv1\n"; + + std::istringstream iss(test_dbc); + auto net = dbcppp::INetwork::LoadDBCFromIs(iss); + for (const auto& msg : net->Messages()) { + std::cout << "Message ID: " << msg.Id() << " Name: " << msg.Name() << std::endl; + for (const auto& sig : msg.Signals()) { + std::cout << '\t' << "Signal ID: " << sig.Name() << " Unit: " << sig.Unit() << std::endl; + } + } +} diff --git a/recipes/dbcppp/all/test_v1_package/CMakeLists.txt b/recipes/dbcppp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/dbcppp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dbcppp/all/test_v1_package/conanfile.py b/recipes/dbcppp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e4d8733790192 --- /dev/null +++ b/recipes/dbcppp/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class DawUtfRangeTestConan(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/dbcppp/config.yml b/recipes/dbcppp/config.yml new file mode 100644 index 0000000000000..501f2f8a2e3d1 --- /dev/null +++ b/recipes/dbcppp/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2.6": + folder: all diff --git a/recipes/dbg-macro/all/conandata.yml b/recipes/dbg-macro/all/conandata.yml new file mode 100644 index 0000000000000..695393e722d3f --- /dev/null +++ b/recipes/dbg-macro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.0": + sha256: e44a1206fbfd1d3dc8ad649f387df479d288b08c80cf2f1239ccb4e26148d781 + url: https://github.com/sharkdp/dbg-macro/archive/v0.4.0.tar.gz diff --git a/recipes/dbg-macro/all/conanfile.py b/recipes/dbg-macro/all/conanfile.py new file mode 100644 index 0000000000000..49d4fa65df8ac --- /dev/null +++ b/recipes/dbg-macro/all/conanfile.py @@ -0,0 +1,43 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class DbgMacroConan(ConanFile): + name = "dbg-macro" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sharkdp/dbg-macro" + license = "MIT" + description = "A dbg(...) macro for C++" + topics = ("conan", "debugging", "macro", "pretty-printing", "header-only") + settings = ("compiler", ) + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + minimal_cpp_standard = "11" + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, minimal_cpp_standard) + + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "dbg-mcro can't be used by {0} {1}".format( + self.settings.compiler, + self.settings.compiler.version + ) + ) + + def package(self): + self.copy("dbg.h", dst="include", src=self._source_subfolder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/dbg-macro/all/test_package/CMakeLists.txt b/recipes/dbg-macro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/dbg-macro/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/dbg-macro/all/test_package/conanfile.py b/recipes/dbg-macro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a1606e05e0271 --- /dev/null +++ b/recipes/dbg-macro/all/test_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" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + tools.mkdir("logs/") + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dbg-macro/all/test_package/test_package.cpp b/recipes/dbg-macro/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..33523905e6595 --- /dev/null +++ b/recipes/dbg-macro/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#define DBG_MACRO_NO_WARNING + +#include +#include + +// You can use "dbg(..)" in expressions: +int factorial(int n) { + if (dbg(n <= 1)) { + return dbg(1); + } else { + return dbg(n * factorial(n - 1)); + } +} + +int main() { + std::string message = "hello"; + dbg(message); // [example.cpp:15 (main)] message = "hello" (std::string) + + const int a = 2; + const int b = dbg(3 * a) + 1; // [example.cpp:18 (main)] 3 * a = 6 (int) + + std::vector numbers{b, 13, 42}; + dbg(numbers); // [example.cpp:21 (main)] numbers = {7, 13, 42} (size: 3) (std::vector) + + dbg("this line is executed"); // [example.cpp:23 (main)] this line is executed + + factorial(4); + + return 0; +} diff --git a/recipes/dbg-macro/config.yml b/recipes/dbg-macro/config.yml new file mode 100644 index 0000000000000..da269653d6e6b --- /dev/null +++ b/recipes/dbg-macro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.0": + folder: "all" diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml new file mode 100644 index 0000000000000..20ee5e48052c8 --- /dev/null +++ b/recipes/dbus/1.x.x/conandata.yml @@ -0,0 +1,30 @@ +sources: + "1.15.2": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.2.tar.xz" + sha256: "7e640803084af59f5e477b7ded11fd888b5380910a895c51ca3aedd63c0626ca" + "1.15.0": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.0.tar.xz" + sha256: "5073c8cb9ad20226647bb38f4965182b762a6e1f595ccdc8e59411014bfd640a" + "1.14.0": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.14.0.tar.xz" + sha256: "ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4" + "1.12.20": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.12.20.tar.gz" + sha256: "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa7de5fe" +patches: + "1.15.2": + - patch_file: "patches/0003-meson-monotonic-clock-check.patch" + patch_type: "portability" + patch_description: "Fix detection of necessary monotonic clock functions in pthread" + patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/352" + "1.15.0": + - patch_file: "patches/0003-meson-monotonic-clock-check.patch" + patch_type: "portability" + patch_description: "Fix detection of necessary monotonic clock functions in pthread" + patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/352" + "1.12.20": + - patch_file: "patches/0001-cmake-project.patch" + - patch_file: "patches/0002-cmake_configure_checks_list_separator.patch" + patch_type: "portability" + url: "https://gitlab.freedesktop.org/dbus/dbus/-/commit/8cd1c2155252938ed38d2612e4d054c7fc0244c3.patch" + patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/issues/324" diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py new file mode 100644 index 0000000000000..00b0dc44a35ef --- /dev/null +++ b/recipes/dbus/1.x.x/conanfile.py @@ -0,0 +1,225 @@ +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.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, rm, rmdir, save +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 textwrap + +required_conan_version = ">=1.53.0" + + +class DbusConan(ConanFile): + name = "dbus" + license = ("AFL-2.1", "GPL-2.0-or-later") + 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." + topics = "bus", "interprocess", "message" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + short_paths = True + options = { + "system_socket": ["ANY"], + "system_pid_file": ["ANY"], + "with_x11": [True, False], + "with_glib": [True, False], + "with_systemd": [True, False], + "with_selinux": [True, False], + "session_socket_dir": ["ANY"], + } + default_options = { + "system_socket": "", + "system_pid_file": "", + "with_x11": False, + "with_glib": False, + "with_systemd": False, + "with_selinux": False, + "session_socket_dir": "/tmp", + } + + @property + def _meson_available(self): + return Version(self.version) >= "1.15.0" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os not in ("Linux", "FreeBSD") or Version(self.version) < "1.14.0": + del self.options.with_systemd + if self.settings.os not in ("Linux", "FreeBSD"): + del self.options.with_x11 + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if self._meson_available: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("expat/2.5.0") + if self.options.with_glib: + self.requires("glib/2.76.0") + if self.options.get_safe("with_systemd"): + self.requires("libsystemd/252.4") + if self.options.with_selinux: + self.requires("libselinux/3.3") + if self.options.get_safe("with_x11"): + self.requires("xorg/system") + + def validate(self): + if Version(self.version) >= "1.14.0": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: + raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") + + if not self._meson_available and self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} does not support Windows. Contributions welcome.") + + def build_requirements(self): + if self._meson_available: + self.tool_requires("meson/1.0.0") + if self._meson_available or self.options.get_safe("with_systemd"): + if not self.conf.get("tools.gnu:pkg_config",check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self._meson_available: + tc = MesonToolchain(self) + tc.project_options["asserts"] = not is_apple_os(self) + tc.project_options["checks"] = False + tc.project_options["doxygen_docs"] = "disabled" + tc.project_options["modular_tests"] = "disabled" + tc.project_options["session_socket_dir"] = str(self.options.session_socket_dir) + tc.project_options["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") + 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["xml_docs"] = "disabled" + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + else: + tc = CMakeToolchain(self) + tc.variables["DBUS_BUILD_TESTS"] = False + tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False + tc.variables["DBUS_ENABLE_XML_DOCS"] = False + tc.variables["DBUS_BUILD_X11"] = bool(self.options.get_safe("with_x11", False)) + tc.variables["ENABLE_SYSTEMD"] = "ON" if self.options.get_safe("with_systemd", False) else "OFF" + tc.variables["DBUS_WITH_GLIB"] = bool(self.options.get_safe("with_glib", False)) + tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self) + tc.variables["DBUS_DISABLE_CHECKS"] = False + + # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library. + # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. + tc.variables["EXPAT_LIBRARIES"] = "expat::expat" + + # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a + tc.variables["DBUS_SESSION_SOCKET_DIR"] = str(self.options.session_socket_dir) + + tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = False + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + if self.options.get_safe("with_systemd"): + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if self._meson_available: + meson = Meson(self) + meson.configure() + meson.build() + else: + cmake = CMake(self) + build_script_folder = None + if Version(self.version) < "1.14.0": + build_script_folder = "cmake" + cmake.configure(build_script_folder=build_script_folder) + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self._meson_available: + meson = Meson(self) + meson.install() + else: + cmake = CMake(self) + cmake.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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "systemd")) + fix_apple_shared_install_name(self) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"dbus-1": "dbus-1::dbus-1"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "DBus1") + self.cpp_info.set_property("cmake_target_name", "dbus-1") + self.cpp_info.set_property("pkg_config_name", "dbus-1") + self.cpp_info.includedirs.extend([ + os.path.join("include", "dbus-1.0"), + os.path.join("lib", "dbus-1.0", "include"), + ]) + self.cpp_info.resdirs = ["res"] + self.cpp_info.libs = ["dbus-1"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("rt") + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["iphlpapi", "ws2_32"]) + else: + self.cpp_info.system_libs.append("pthread") + + # 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" + self.cpp_info.names["cmake_find_package"] = "dbus-1" + self.cpp_info.names["cmake_find_package_multi"] = "dbus-1" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "dbus-1" diff --git a/recipes/dbus/1.x.x/patches/0001-cmake-project.patch b/recipes/dbus/1.x.x/patches/0001-cmake-project.patch new file mode 100644 index 0000000000000..2d00f57d33527 --- /dev/null +++ b/recipes/dbus/1.x.x/patches/0001-cmake-project.patch @@ -0,0 +1,23 @@ +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -1,10 +1,3 @@ +-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") +- +-# we do not need to have WIN32 defined +-set(CMAKE_LEGACY_CYGWIN_WIN32 0) +- +-project(dbus) + + # we need to be up to date + CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2 FATAL_ERROR) +@@ -19,6 +12,9 @@ if(CMAKE_MAJOR_VERSION GREATER 2) + cmake_policy(SET CMP0054 NEW) + endif() + endif() ++set(CMAKE_LEGACY_CYGWIN_WIN32 0) ++project(dbus) ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") + + # detect version + include(MacrosAutotools) diff --git a/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch b/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch new file mode 100644 index 0000000000000..7c60bf52d5ec2 --- /dev/null +++ b/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake +index a9a5fc90..1a59461a 100644 +--- a/cmake/ConfigureChecks.cmake ++++ b/cmake/ConfigureChecks.cmake +@@ -43,7 +43,7 @@ check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE) # + check_symbol_exists(getgrouplist "grp.h" HAVE_GETGROUPLIST) # dbus-sysdeps.c + check_symbol_exists(getpeerucred "ucred.h" HAVE_GETPEERUCRED) # dbus-sysdeps.c, dbus-sysdeps-win.c + check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP) # dbus-sysdeps.c +-check_symbol_exists(getpwnam_r "errno.h pwd.h" HAVE_POSIX_GETPWNAM_R) # dbus-sysdeps-util-unix.c ++check_symbol_exists(getpwnam_r "errno.h;pwd.h" HAVE_POSIX_GETPWNAM_R) # dbus-sysdeps-util-unix.c + check_symbol_exists(setenv "stdlib.h" HAVE_SETENV) # dbus-sysdeps.c + check_symbol_exists(unsetenv "stdlib.h" HAVE_UNSETENV) # dbus-sysdeps.c + check_symbol_exists(clearenv "stdlib.h" HAVE_CLEARENV) # dbus-sysdeps.c +@@ -66,7 +66,7 @@ check_symbol_exists(getrlimit "sys/resource.h;sys/time.h" HAVE_GETRLIMIT) + check_symbol_exists(prlimit "sys/resource.h;sys/time.h" HAVE_PRLIMIT) + check_symbol_exists(setrlimit "sys/resource.h;sys/time.h" HAVE_SETRLIMIT) + +-check_struct_member(cmsgcred cmcred_pid "sys/types.h sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c ++check_struct_member(cmsgcred cmcred_pid "sys/types.h;sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c + + # missing: + # DBUS_HAVE_GCC33_GCOV diff --git a/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch b/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch new file mode 100644 index 0000000000000..7e9e94edfd469 --- /dev/null +++ b/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch @@ -0,0 +1,15 @@ +diff --git a/meson.build b/meson.build +index 3b5b182c..4e400a52 100644 +--- a/meson.build ++++ b/meson.build +@@ -328,7 +328,9 @@ data_config.set('top_builddir', meson.project_build_root()) + threads = dependency('threads') + config.set( + 'HAVE_MONOTONIC_CLOCK', +- cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC', args: compile_args_c), ++ cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC', args: compile_args_c) ++ and cc.has_header_symbol('pthread.h', 'pthread_condattr_setclock', args: compile_args_c) ++ and cc.has_header_symbol('time.h', 'clock_getres', args: compile_args_c), + ) + + glib = dependency( diff --git a/recipes/dbus/1.x.x/test_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..497b3ee2b047c --- /dev/null +++ b/recipes/dbus/1.x.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(DBus1 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE dbus-1) diff --git a/recipes/dbus/1.x.x/test_package/conanfile.py b/recipes/dbus/1.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..da65c0176861b --- /dev/null +++ b/recipes/dbus/1.x.x/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run("dbus-monitor --help", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dbus/1.x.x/test_package/test_package.c b/recipes/dbus/1.x.x/test_package/test_package.c new file mode 100644 index 0000000000000..a1cecc681972f --- /dev/null +++ b/recipes/dbus/1.x.x/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +int main() { + int major_version = 0; + int minor_version = 0; + int micro_version = 0; + + dbus_get_version(&major_version, &minor_version, µ_version); + + printf("D-Bus version: v%i.%i.%i\n", major_version, minor_version, micro_version); + return 0; +} diff --git a/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dbus/1.x.x/test_v1_package/conanfile.py b/recipes/dbus/1.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3a412edafcc0d --- /dev/null +++ b/recipes/dbus/1.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run("dbus-monitor --help", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dbus/config.yml b/recipes/dbus/config.yml new file mode 100644 index 0000000000000..cc866e2f4cf3b --- /dev/null +++ b/recipes/dbus/config.yml @@ -0,0 +1,9 @@ +versions: + "1.15.2": + folder: 1.x.x + "1.15.0": + folder: 1.x.x + "1.14.0": + folder: 1.x.x + "1.12.20": + folder: 1.x.x diff --git a/recipes/dcmtk/all/CMakeLists.txt b/recipes/dcmtk/all/CMakeLists.txt new file mode 100644 index 0000000000000..56b7606e716f9 --- /dev/null +++ b/recipes/dcmtk/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/dcmtk/all/conandata.yml b/recipes/dcmtk/all/conandata.yml new file mode 100644 index 0000000000000..7e3e0a0cc6e01 --- /dev/null +++ b/recipes/dcmtk/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "3.6.7": + url: "https://dicom.offis.de/download/dcmtk/dcmtk367/dcmtk-3.6.7.tar.gz" + sha256: "7c58298e3e8d60232ee6fc8408cfadd14463cc11a3c4ca4c59af5988c7e9710a" + "3.6.6": + url: "https://dicom.offis.de/download/dcmtk/dcmtk366/dcmtk-3.6.6.tar.gz" + sha256: "6859c62b290ee55677093cccfd6029c04186d91cf99c7642ae43627387f3458e" + "3.6.5": + url: "https://dicom.offis.de/download/dcmtk/dcmtk365/dcmtk-3.6.5.tar.gz" + sha256: "a05178665f21896dbb0974106dba1ad144975414abd760b4cf8f5cc979f9beb9" +patches: + "3.6.7": + - patch_file: "patches/cmake-patching-3-6-7.patch" + base_path: "source_subfolder" + patch_type: conan + patch_description: "Don't ignore dependencies that can't be found; patch some variable names" + "3.6.6": + - patch_file: "patches/0002-cmake-use-conan-packages.patch" + base_path: "source_subfolder" + patch_type: conan + patch_description: "Don't ignore dependencies that can't be found; patch some variable names" + "3.6.5": + - patch_file: "patches/0001-cmake-use-conan-packages.patch" + base_path: "source_subfolder" + patch_type: conan + patch_description: "Don't ignore dependencies that can't be found; patch some variable names" diff --git a/recipes/dcmtk/all/conanfile.py b/recipes/dcmtk/all/conanfile.py new file mode 100644 index 0000000000000..286fb28a07048 --- /dev/null +++ b/recipes/dcmtk/all/conanfile.py @@ -0,0 +1,322 @@ +from conans import CMake +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.scm import Version +import functools +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class DCMTKConan(ConanFile): + name = "dcmtk" + description = "DCMTK is a collection of libraries and applications implementing large parts the DICOM standard" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://dicom.offis.de/dcmtk" + license = "BSD-3-Clause" + topics = ("dicom", "image") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_applications": [True, False], + "with_multithreading": [True, False], + "charset_conversion": [None, "libiconv", "icu"], + "with_libxml2": [True, False], + "with_zlib": [True, False], + "with_openssl": [True, False], + "with_libpng": [True, False], + "with_libtiff": [True, False], + "with_tcpwrappers": [True, False], + "builtin_dictionary": [None, True, False], + "builtin_private_tags": [True, False], + "external_dictionary": [None, True, False], + "wide_io": [True, False], + "enable_stl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_applications": False, + "with_multithreading": True, + "charset_conversion": "libiconv", + "with_libxml2": True, + "with_zlib": True, + "with_openssl": True, + "with_libpng": True, + "with_libtiff": True, + "with_tcpwrappers": False, + "builtin_dictionary": None, + "builtin_private_tags": False, + "external_dictionary": None, + "wide_io": False, + "enable_stl": True, + } + + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + self.options.rm_safe("with_tcpwrappers") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + if self.options.charset_conversion == "libiconv": + self.requires("libiconv/1.17") + elif self.options.charset_conversion == "icu": + self.requires("icu/72.1") + if self.options.with_libxml2: + self.requires("libxml2/2.10.3") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_openssl: + if self.settings.os == "Windows": + # FIXME: CMake configuration fails to detect Openssl 1.1 on Windows. + self.requires("openssl/1.0.2u") + else: + self.requires("openssl/1.1.1t") + if self.options.with_libpng: + self.requires("libpng/1.6.39") + if self.options.with_libtiff: + self.requires("libtiff/4.4.0") + if self.options.get_safe("with_tcpwrappers"): + self.requires("tcp-wrappers/7.6") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self) and \ + self.settings.os == "Macos" and self.settings.arch == "armv8": + # FIXME: Probable issue with flags, build includes header 'mmintrin.h' + raise ConanInvalidConfiguration("Cross building to Macos M1 is not supported (yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + + # DICOM Data Dictionaries are required + cmake.definitions["CMAKE_INSTALL_DATADIR"] = self._dcm_datadictionary_path + + cmake.definitions["BUILD_APPS"] = self.options.with_applications + cmake.definitions["DCMTK_WITH_ICONV"] = self.options.charset_conversion == "libiconv" + if self.options.charset_conversion == "libiconv": + cmake.definitions["WITH_LIBICONVINC"] = self.deps_cpp_info["libiconv"].rootpath + cmake.definitions["DCMTK_WITH_ICU"] = self.options.charset_conversion == "icu" + cmake.definitions["DCMTK_WITH_OPENJPEG"] = False + cmake.definitions["DCMTK_WITH_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + cmake.definitions["WITH_OPENSSLINC"] = self.deps_cpp_info["openssl"].rootpath + cmake.definitions["DCMTK_WITH_PNG"] = self.options.with_libpng + if self.options.with_libpng: + cmake.definitions["WITH_LIBPNGINC"] = self.deps_cpp_info["libpng"].rootpath + cmake.definitions["DCMTK_WITH_SNDFILE"] = False + cmake.definitions["DCMTK_WITH_THREADS"] = self.options.with_multithreading + cmake.definitions["DCMTK_WITH_TIFF"] = self.options.with_libtiff + if self.options.with_libtiff: + cmake.definitions["WITH_LIBTIFFINC"] = self.deps_cpp_info["libtiff"].rootpath + if self.settings.os != "Windows": + cmake.definitions["DCMTK_WITH_WRAP"] = self.options.with_tcpwrappers + cmake.definitions["DCMTK_WITH_XML"] = self.options.with_libxml2 + if self.options.with_libxml2: + cmake.definitions["WITH_LIBXMLINC"] = self.deps_cpp_info["libxml2"].rootpath + cmake.definitions["WITH_LIBXML_SHARED"] = self.options["libxml2"].shared + cmake.definitions["DCMTK_WITH_ZLIB"] = self.options.with_zlib + if self.options.with_zlib: + cmake.definitions["WITH_ZLIBINC"] = self.deps_cpp_info["zlib"].rootpath + + if self.options.enable_stl: + cmake.definitions["DCMTK_ENABLE_STL"] = "ON" + else: + cmake.definitions["DCMTK_ENABLE_STL"] = "OFF" + cmake.definitions["DCMTK_ENABLE_CXX11"] = True + + cmake.definitions["DCMTK_ENABLE_MANPAGE"] = False + cmake.definitions["DCMTK_WITH_DOXYGEN"] = False + + cmake.definitions["DCMTK_ENABLE_PRIVATE_TAGS"] = self.options.builtin_private_tags + if self.options.external_dictionary is not None: + if Version(self.version) < "3.6.7": + cmake.definitions["DCMTK_ENABLE_EXTERNAL_DICTIONARY"] = self.options.external_dictionary + else: + cmake.definitions["DCMTK_DEFAULT_DICT"] = self.options.external_dictionary + if self.options.builtin_dictionary is not None: + cmake.definitions["DCMTK_ENABLE_BUILTIN_DICTIONARY"] = self.options.builtin_dictionary + cmake.definitions["DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS"] = self.options.wide_io + cmake.definitions["DCMTK_WIDE_CHAR_MAIN_FUNCTION"] = self.options.wide_io + + if self.settings.os == "Windows": + cmake.definitions["DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS"] = False + + if is_msvc(self): + cmake.definitions["DCMTK_ICONV_FLAGS_ANALYZED"] = True + cmake.definitions["DCMTK_COMPILE_WIN32_MULTITHREADED_DLL"] = "MD" in msvc_runtime_flag(self) + + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + apply_conandata_patches(self) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYRIGHT", dst="licenses", src=self._source_subfolder) + + cmake = self._configure_cmake() + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "share")) + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {target: f"DCMTK::{target}" for target in self._dcmtk_components} + ) + + 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, "conan-official-{self.name}-targets.cmake") + + @property + def _dcmtk_components(self): + def charset_conversion(): + if bool(self.options.charset_conversion): + return ["libiconv::libiconv"] if self.options.charset_conversion == "libiconv" else ["icu::icu"] + return [] + + def zlib(): + return ["zlib::zlib"] if self.options.with_zlib else [] + + def png(): + return ["libpng::libpng"] if self.options.with_libpng else [] + + def tiff(): + return ["libtiff::libtiff"] if self.options.with_libtiff else [] + + def openssl(): + return ["openssl::openssl"] if self.options.with_openssl else [] + + def tcpwrappers(): + return ["tcp-wrappers::tcp-wrappers"] if self.options.get_safe("with_tcpwrappers") else [] + + def xml2(): + return ["libxml2::libxml2"] if self.options.with_libxml2 else [] + + charls = "dcmtkcharls" if Version("3.6.6") <= self.version else "charls" + + return { + "ofstd" : charset_conversion(), + "oflog" : ["ofstd"], + "dcmdata" : ["ofstd", "oflog"] + zlib(), + "i2d" : ["dcmdata"], + "dcmimgle": ["ofstd", "oflog", "dcmdata"], + "dcmimage": ["oflog", "dcmdata", "dcmimgle"] + png() + tiff(), + "dcmjpeg" : ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage", "ijg8", "ijg12", "ijg16"], + "ijg8" : [], + "ijg12" : [], + "ijg16" : [], + "dcmjpls" : ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage", charls], + charls : ["ofstd", "oflog"], + "dcmtls" : ["ofstd", "dcmdata", "dcmnet"] + openssl(), + "dcmnet" : ["ofstd", "oflog", "dcmdata"] + tcpwrappers(), + "dcmsr" : ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage"] + xml2(), + "cmr" : ["dcmsr"], + "dcmdsig" : ["ofstd", "dcmdata"] + openssl(), + "dcmwlm" : ["ofstd", "dcmdata", "dcmnet"], + "dcmqrdb" : ["ofstd", "dcmdata", "dcmnet"], + "dcmpstat": ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage", "dcmnet", "dcmdsig", "dcmtls", "dcmsr", "dcmqrdb"] + openssl(), + "dcmrt" : ["ofstd", "oflog", "dcmdata", "dcmimgle"], + "dcmiod" : ["dcmdata", "ofstd", "oflog"], + "dcmfg" : ["dcmiod", "dcmdata", "ofstd", "oflog"], + "dcmseg" : ["dcmfg", "dcmiod", "dcmdata", "ofstd", "oflog"], + "dcmtract": ["dcmiod", "dcmdata", "ofstd", "oflog"], + "dcmpmap" : ["dcmfg", "dcmiod", "dcmdata", "ofstd", "oflog"], + } + + @property + def _dcm_datadictionary_path(self): + return os.path.join(self.package_folder, "bin", "share") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "DCMTK") + + self.cpp_info.names["cmake_find_package"] = "DCMTK" + self.cpp_info.names["cmake_find_package_multi"] = "DCMTK" + + def register_components(components): + for target_lib, requires in components.items(): + self.cpp_info.components[target_lib].set_property("cmake_target_name", target_lib) + self.cpp_info.components[target_lib].libs = [target_lib] + self.cpp_info.components[target_lib].includedirs.append(os.path.join("include", "dcmtk")) + self.cpp_info.components[target_lib].requires = requires + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[target_lib].names["cmake_find_package"] = target_lib + self.cpp_info.components[target_lib].names["cmake_find_package_multi"] = target_lib + self.cpp_info.components[target_lib].builddirs.append(self._module_subfolder) + self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + + if self.settings.os == "Windows": + self.cpp_info.components["ofstd"].system_libs.extend([ + "iphlpapi", "ws2_32", "netapi32", "wsock32" + ]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ofstd"].system_libs.append("m") + if self.options.with_multithreading: + self.cpp_info.components["ofstd"].system_libs.append("pthread") + + register_components(self._dcmtk_components) + + dcmdictpath = os.path.join(self._dcm_datadictionary_path, "dcmtk", "dicom.dic") + self.output.info(f"Settings DCMDICTPATH environment variable: {dcmdictpath}") + self.runenv_info.define_path("DCMDICTPATH", dcmdictpath) + self.env_info.DCMDICTPATH = dcmdictpath # remove in conan v2? + + if self.options.with_applications: + self.buildenv_info.define_path("DCMDICTPATH", dcmdictpath) + 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) diff --git a/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch b/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch new file mode 100644 index 0000000000000..0e7d266d097c2 --- /dev/null +++ b/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch @@ -0,0 +1,253 @@ +--- a/CMake/3rdparty.cmake ++++ b/CMake/3rdparty.cmake +@@ -40,13 +40,15 @@ if(WIN32 AND NOT MINGW) + # libxml support: configure compiler + if(DCMTK_WITH_XML) + if(WITH_LIBXMLINC) +- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") +- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") +- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") ++ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) ++ link_directories(${WITH_LIBXMLINC}/lib) ++ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) ++ if(NOT WITH_LIBXML_SHARED) + # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly + add_definitions("-DLIBXML_STATIC") ++ endif() + else() # turn off library if library path not set + message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") + set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) +@@ -58,8 +60,8 @@ if(WIN32 AND NOT MINGW) + if(DCMTK_WITH_PNG) + if(WITH_LIBPNGINC) + set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") +- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") +- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") ++ link_directories(${WITH_LIBPNGINC}/lib) ++ set(LIBPNG_LIBS CONAN_PKG::libpng) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + else() # turn off library if library path not set +@@ -73,8 +75,8 @@ if(WIN32 AND NOT MINGW) + if(DCMTK_WITH_TIFF) + if(WITH_LIBTIFFINC) + set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") +- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") +- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") ++ link_directories(${WITH_LIBTIFFINC}/lib) ++ set(LIBTIFF_LIBS CONAN_PKG::libtiff) + message(STATUS "Info: DCMTK TIFF support will be enabled") + set(WITH_LIBTIFF 1) + else() # turn off library if library path not set +@@ -90,9 +92,9 @@ if(WIN32 AND NOT MINGW) + include(CheckCXXSourceCompiles) + set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") + set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") +- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") ++ link_directories(${WITH_OPENSSLINC}/lib) + # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. +- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") ++ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) +@@ -116,8 +118,8 @@ if(WIN32 AND NOT MINGW) + if(DCMTK_WITH_ZLIB) + if(WITH_ZLIBINC) + set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") +- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") +- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") ++ link_directories(${WITH_ZLIBINC}/lib) ++ set(ZLIB_LIBS CONAN_PKG::zlib) + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + else() # turn off library if library path not set +@@ -131,8 +133,8 @@ if(WIN32 AND NOT MINGW) + if(DCMTK_WITH_SNDFILE) + if(WITH_SNDFILEINC) + set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") +- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") +- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") ++ link_directories(${WITH_SNDFILEINC}/lib) ++ set(SNDFILE_LIBS CONAN_PKG::libsndfile) + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + else() # turn off library if library path not set +@@ -146,8 +148,8 @@ if(WIN32 AND NOT MINGW) + if(DCMTK_WITH_ICONV) + if(WITH_LIBICONVINC) + set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") +- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") +- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") ++ link_directories(${WITH_LIBICONVINC}/lib) ++ set(LIBICONV_LIBS CONAN_PKG::libiconv) + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + else() # turn off library if library path not set +@@ -170,7 +172,7 @@ if(WIN32 AND NOT MINGW) + else() + set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") + set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") +- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") ++ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + endif() +@@ -185,7 +187,7 @@ else(WIN32 AND NOT MINGW) + + # Find TIFF + if(DCMTK_WITH_TIFF) +- find_package(TIFF QUIET) ++ find_package(TIFF REQUIRED) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") +@@ -194,21 +196,21 @@ else(WIN32 AND NOT MINGW) + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path +- find_package(JPEG QUIET) ++ find_package(JPEG REQUIRED) + if(NOT JPEG_FOUND) + message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") +- include_directories(${TIFF_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS}) + else() + message(STATUS "Info: DCMTK TIFF support will be enabled") +- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) + endif() +- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY}) ++ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) +- find_package(PNG QUIET) ++ find_package(PNG REQUIRED) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") +@@ -217,13 +219,13 @@ else(WIN32 AND NOT MINGW) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) +- set(LIBPNG_LIBS ${PNG_LIBRARY}) ++ set(LIBPNG_LIBS ${PNG_LIBRARIES}) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) +- find_package(OpenSSL QUIET) ++ find_package(OpenSSL REQUIRED) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") +@@ -254,7 +256,7 @@ else(WIN32 AND NOT MINGW) + + # Find libXML2 + if(DCMTK_WITH_XML) +- find_package(LibXml2 QUIET) ++ find_package(LibXml2 REQUIRED) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") +@@ -269,7 +271,7 @@ else(WIN32 AND NOT MINGW) + + # Find zlib + if(DCMTK_WITH_ZLIB) +- find_package(ZLIB QUIET) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") +@@ -284,7 +286,7 @@ else(WIN32 AND NOT MINGW) + + # Find libsndfile + if(DCMTK_WITH_SNDFILE) +- find_package(Sndfile QUIET) ++ find_package(Sndfile REQUIRED) + if(NOT SNDFILE_LIBS) + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") + set(WITH_SNDFILE "") +@@ -292,16 +294,16 @@ else(WIN32 AND NOT MINGW) + else() + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) +- include_directories(${SNDFILE_INCLUDE_DIRS}) +- set(SNDFILE_LIBS ${SNDFILE_LIBRARIES}) ++ include_directories(${Sndfile_INCLUDE_DIRS}) ++ set(SNDFILE_LIBS ${Sndfile_LIBRARIES}) + endif() + endif() + + # Find libiconv + if(DCMTK_WITH_ICONV) +- find_package(Iconv QUIET) +- find_package(Charset QUIET) +- if(ICONV_FOUND) ++ find_package(Iconv REQUIRED) ++ #find_package(Charset REQUIRED) #FIXME?? ++ if(Iconv_FOUND) + if(NOT Iconv_IS_BUILT_IN) + set(LIBICONV_FOUND ${ICONV_FOUND}) + else() +@@ -322,14 +324,14 @@ else(WIN32 AND NOT MINGW) + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) + set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) +- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) ++ set(LIBICONV_LIBS Iconv::Iconv) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() + + # Find libwrap + if(DCMTK_WITH_WRAP) +- find_package(Wrap QUIET) ++ find_package(Wrap REQUIRED) + if(NOT WRAP_FOUND) + message(STATUS "Warning: WRAP support will be disabled because libwrap was not found.") + set(WITH_TCPWRAPPER "") +@@ -344,7 +346,7 @@ else(WIN32 AND NOT MINGW) + + # Find OpenJPEG + if(DCMTK_WITH_OPENJPEG) +- find_package(OpenJPEG QUIET) ++ find_package(OpenJPEG REQUIRED) + if(NOT OPENJPEG_FOUND) + message(STATUS "Warning: OpenJPEG support will be disabled because the OpenJPEG library was not found.") + set(WITH_OPENJPEG "") +@@ -352,8 +354,8 @@ else(WIN32 AND NOT MINGW) + else() + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) +- include_directories(${OPENJPEG_INCLUDE_DIRS}) +- set(OPENJPEG_LIBS ${OPENJPEG_LIBRARIES}) ++ include_directories(${OpenJPEG_INCLUDE_DIRS}) ++ set(OPENJPEG_LIBS ${OpenJPEG_LIBRARIES}) + endif() + endif() + +@@ -371,7 +373,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) + endif() + + if(DCMTK_WITH_ICU) +- find_package(ICU COMPONENTS uc data QUIET) ++ find_package(ICU COMPONENTS uc data REQUIRED) + if(NOT ICU_FOUND) + message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") + set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) +@@ -387,7 +389,7 @@ endif() + + # Find doxygen + if(DCMTK_WITH_DOXYGEN) +- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE ++ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE + if(NOT DOXYGEN_FOUND) + message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") + set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch b/recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch new file mode 100644 index 0000000000000..d566a50607ec7 --- /dev/null +++ b/recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch @@ -0,0 +1,225 @@ +--- CMake/3rdparty.cmake ++++ CMake/3rdparty.cmake +@@ -21,7 +21,7 @@ mark_as_advanced(DCMTK_USE_FIND_PACKAGE) + if(DCMTK_USE_FIND_PACKAGE) + # Find TIFF + if(DCMTK_WITH_TIFF) +- find_package(TIFF QUIET) ++ find_package(TIFF REQUIRED) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") +@@ -30,21 +30,21 @@ if(DCMTK_USE_FIND_PACKAGE) + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path +- find_package(JPEG QUIET) ++ find_package(JPEG REQUIRED) + if(NOT JPEG_FOUND) + message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") +- include_directories(${TIFF_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS}) + else() + message(STATUS "Info: DCMTK TIFF support will be enabled") +- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) + endif() +- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY}) ++ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) +- find_package(PNG QUIET) ++ find_package(PNG REQUIRED) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") +@@ -53,13 +53,13 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) +- set(LIBPNG_LIBS ${PNG_LIBRARY}) ++ set(LIBPNG_LIBS ${PNG_LIBRARIES}) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) +- find_package(OpenSSL QUIET) ++ find_package(OpenSSL REQUIRED) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") +@@ -90,7 +90,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libXML2 + if(DCMTK_WITH_XML) +- find_package(LibXml2 QUIET) ++ find_package(LibXml2 REQUIRED) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") +@@ -105,7 +105,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find zlib + if(DCMTK_WITH_ZLIB) +- find_package(ZLIB QUIET) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") +@@ -120,7 +120,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libsndfile + if(DCMTK_WITH_SNDFILE) +- find_package(Sndfile QUIET) ++ find_package(Sndfile REQUIRED) + if(NOT SNDFILE_LIBS) + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") + set(WITH_SNDFILE "") +@@ -128,16 +128,16 @@ if(DCMTK_USE_FIND_PACKAGE) + else() + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) +- include_directories(${SNDFILE_INCLUDE_DIRS}) +- set(SNDFILE_LIBS ${SNDFILE_LIBRARIES}) ++ include_directories(${Sndfile_INCLUDE_DIRS}) ++ set(SNDFILE_LIBS ${Sndfile_LIBRARIES}) + endif() + endif() + + # Find libiconv + if(DCMTK_WITH_ICONV) +- find_package(Iconv QUIET) +- find_package(Charset QUIET) +- if(ICONV_FOUND) ++ find_package(Iconv REQUIRED) ++ #find_package(Charset QUIET) #FIXME?? ++ if(Iconv_FOUND) + if(NOT Iconv_IS_BUILT_IN) + set(LIBICONV_FOUND ${ICONV_FOUND}) + else() +@@ -158,7 +158,7 @@ if(DCMTK_USE_FIND_PACKAGE) + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) + set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) +- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) ++ set(LIBICONV_LIBS Iconv::Iconv) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() +@@ -234,13 +234,15 @@ else() + # libxml support: configure compiler + if(DCMTK_WITH_XML) + if(WITH_LIBXMLINC) +- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") +- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") +- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") ++ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) ++ link_directories(${WITH_LIBXMLINC}/lib) ++ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) ++ if(NOT WITH_LIBXML_SHARED) + # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly + add_definitions("-DLIBXML_STATIC") ++ endif() + else() # turn off library if library path not set + message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") + set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) +@@ -252,8 +254,8 @@ else() + if(DCMTK_WITH_PNG) + if(WITH_LIBPNGINC) + set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") +- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") +- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") ++ link_directories(${WITH_LIBPNGINC}/lib) ++ set(LIBPNG_LIBS CONAN_PKG::libpng) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + else() # turn off library if library path not set +@@ -267,8 +269,8 @@ else() + if(DCMTK_WITH_TIFF) + if(WITH_LIBTIFFINC) + set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") +- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") +- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") ++ link_directories(${WITH_LIBTIFFINC}/lib) ++ set(LIBTIFF_LIBS CONAN_PKG::libtiff) + message(STATUS "Info: DCMTK TIFF support will be enabled") + set(WITH_LIBTIFF 1) + else() # turn off library if library path not set +@@ -284,9 +286,9 @@ else() + include(CheckCXXSourceCompiles) + set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") + set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") +- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") ++ link_directories(${WITH_OPENSSLINC}/lib) + # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. +- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") ++ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) +@@ -310,8 +312,8 @@ else() + if(DCMTK_WITH_ZLIB) + if(WITH_ZLIBINC) + set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") +- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") +- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") ++ link_directories(${WITH_ZLIBINC}/lib) ++ set(ZLIB_LIBS CONAN_PKG::zlib) + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + else() # turn off library if library path not set +@@ -325,8 +327,8 @@ else() + if(DCMTK_WITH_SNDFILE) + if(WITH_SNDFILEINC) + set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") +- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") +- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") ++ link_directories(${WITH_SNDFILEINC}/lib) ++ set(SNDFILE_LIBS CONAN_PKG::libsndfile) + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + else() # turn off library if library path not set +@@ -340,8 +342,8 @@ else() + if(DCMTK_WITH_ICONV) + if(WITH_LIBICONVINC) + set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") +- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") +- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") ++ link_directories(${WITH_LIBICONVINC}/lib) ++ set(LIBICONV_LIBS CONAN_PKG::libiconv) + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + else() # turn off library if library path not set +@@ -364,7 +366,7 @@ else() + else() + set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") + set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") +- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") ++ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + endif() +@@ -388,7 +390,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) + endif() + + if(DCMTK_WITH_ICU) +- find_package(ICU COMPONENTS uc data QUIET) ++ find_package(ICU COMPONENTS uc data REQUIRED) + if(NOT ICU_FOUND) + message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") + set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) +@@ -404,7 +406,7 @@ endif() + + # Find doxygen + if(DCMTK_WITH_DOXYGEN) +- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE ++ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE + if(NOT DOXYGEN_FOUND) + message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") + set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch b/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch new file mode 100644 index 0000000000000..b10d0378042ba --- /dev/null +++ b/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch @@ -0,0 +1,216 @@ +--- CMake/3rdparty.cmake ++++ CMake/3rdparty.cmake +@@ -21,7 +21,7 @@ mark_as_advanced(DCMTK_USE_FIND_PACKAGE) + if(DCMTK_USE_FIND_PACKAGE) + # Find TIFF + if(DCMTK_WITH_TIFF) +- find_package(TIFF QUIET) ++ find_package(TIFF REQUIRED) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") +@@ -30,21 +30,21 @@ if(DCMTK_USE_FIND_PACKAGE) + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path +- find_package(JPEG QUIET) ++ find_package(JPEG REQUIRED) + if(NOT JPEG_FOUND) + message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") +- include_directories(${TIFF_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS}) + else() + message(STATUS "Info: DCMTK TIFF support will be enabled") +- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) + endif() +- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${TIFF_EXTRA_LIBS_STATIC} ${JPEG_LIBRARY}) ++ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) +- find_package(PNG QUIET) ++ find_package(PNG REQUIRED) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") +@@ -53,13 +53,13 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) +- set(LIBPNG_LIBS ${PNG_LIBRARY}) ++ set(LIBPNG_LIBS ${PNG_LIBRARIES}) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) +- find_package(OpenSSL QUIET) ++ find_package(OpenSSL REQUIRED) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") +@@ -90,7 +90,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libXML2 + if(DCMTK_WITH_XML) +- find_package(LibXml2 QUIET) ++ find_package(LibXml2 REQUIRED) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") +@@ -105,7 +105,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find zlib + if(DCMTK_WITH_ZLIB) +- find_package(ZLIB QUIET) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") +@@ -120,7 +120,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libsndfile + if(DCMTK_WITH_SNDFILE) +- find_package(SNDFILE QUIET) ++ find_package(SNDFILE REQUIRED) + if(NOT SNDFILE_LIBS) + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") + set(WITH_SNDFILE "") +@@ -135,9 +135,9 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libiconv + if(DCMTK_WITH_ICONV) +- find_package(Iconv QUIET) +- find_package(LIBCHARSET QUIET) +- if(ICONV_FOUND) ++ find_package(Iconv REQUIRED) ++ find_package(LIBCHARSET REQUIRED) ++ if(Iconv_FOUND) + if(NOT Iconv_IS_BUILT_IN) + set(LIBICONV_FOUND ${ICONV_FOUND}) + else() +@@ -158,7 +158,7 @@ if(DCMTK_USE_FIND_PACKAGE) + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) + set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) +- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) ++ set(LIBICONV_LIBS Iconv::Iconv) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() +@@ -241,13 +241,15 @@ else() + # libxml support: configure compiler + if(DCMTK_WITH_XML) + if(WITH_LIBXMLINC) +- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") +- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") +- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") ++ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) ++ link_directories(${WITH_LIBXMLINC}/lib) ++ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) ++ if(NOT WITH_LIBXML_SHARED) + # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly + add_definitions("-DLIBXML_STATIC") ++ endif() + else() # turn off library if library path not set + message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") + set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) +@@ -259,8 +261,8 @@ else() + if(DCMTK_WITH_PNG) + if(WITH_LIBPNGINC) + set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") +- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") +- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") ++ link_directories(${WITH_LIBPNGINC}/lib) ++ set(LIBPNG_LIBS CONAN_PKG::libpng) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + else() # turn off library if library path not set +@@ -274,8 +276,8 @@ else() + if(DCMTK_WITH_TIFF) + if(WITH_LIBTIFFINC) + set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") +- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") +- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") ++ link_directories(${WITH_LIBTIFFINC}/lib) ++ set(LIBTIFF_LIBS CONAN_PKG::libtiff) + message(STATUS "Info: DCMTK TIFF support will be enabled") + set(WITH_LIBTIFF 1) + else() # turn off library if library path not set +@@ -291,9 +293,9 @@ else() + include(CheckCXXSourceCompiles) + set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") + set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") +- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") ++ link_directories(${WITH_OPENSSLINC}/lib) + # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. +- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") ++ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) +@@ -317,8 +319,8 @@ else() + if(DCMTK_WITH_ZLIB) + if(WITH_ZLIBINC) + set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") +- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") +- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") ++ link_directories(${WITH_ZLIBINC}/lib) ++ set(ZLIB_LIBS CONAN_PKG::zlib) + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + else() # turn off library if library path not set +@@ -332,8 +334,8 @@ else() + if(DCMTK_WITH_SNDFILE) + if(WITH_SNDFILEINC) + set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") +- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") +- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") ++ link_directories(${WITH_SNDFILEINC}/lib) ++ set(SNDFILE_LIBS CONAN_PKG::libsndfile) + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + else() # turn off library if library path not set +@@ -347,8 +349,8 @@ else() + if(DCMTK_WITH_ICONV) + if(WITH_LIBICONVINC) + set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") +- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") +- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") ++ link_directories(${WITH_LIBICONVINC}/lib) ++ set(LIBICONV_LIBS CONAN_PKG::libiconv) + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + else() # turn off library if library path not set +@@ -371,7 +373,7 @@ else() + else() + set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") + set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") +- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") ++ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + endif() +@@ -395,7 +397,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) + endif() + + if(DCMTK_WITH_ICU) +- find_package(ICU COMPONENTS uc data QUIET) ++ find_package(ICU COMPONENTS uc data REQUIRED) + if(NOT ICU_FOUND) + message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") + set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) +@@ -411,7 +413,7 @@ endif() + + # Find doxygen + if(DCMTK_WITH_DOXYGEN) +- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE ++ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE + if(NOT DOXYGEN_FOUND) + message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") + set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/test_package/CMakeLists.txt b/recipes/dcmtk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b3dafcdddcb7d --- /dev/null +++ b/recipes/dcmtk/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(DCMTK REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} dcmdata) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/dcmtk/all/test_package/conanfile.py b/recipes/dcmtk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c5fa77486cfa5 --- /dev/null +++ b/recipes/dcmtk/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import CMake +from conan import ConanFile +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dcmtk/all/test_package/test_package.cpp b/recipes/dcmtk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..13653041a7537 --- /dev/null +++ b/recipes/dcmtk/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include "dcmdata/dcfilefo.h" +#include "dcmdata/dcuid.h" +#include "dcmdata/dcdeftag.h" + +#include + +int main(int argc, char *argv[]) +{ + char uid[100]; + unsigned char data[256]; + for(unsigned i=0; i < sizeof(data); ++i) { + data[i] = i; + } + + + DcmFileFormat fileformat; + DcmDataset *dataset = fileformat.getDataset(); + dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); + dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); + dataset->putAndInsertString(DCM_PatientName, "Doe^John"); + /* ... */ + dataset->putAndInsertUint8Array(DCM_PixelData, data, sizeof(data)); + OFCondition status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit); + if (status.bad()) { + std::cerr << "Error: cannot write DICOM file (" << status.text() << ")\n"; + return 1; + } + return 0; +} diff --git a/recipes/dcmtk/config.yml b/recipes/dcmtk/config.yml new file mode 100644 index 0000000000000..81e7bce3c7d99 --- /dev/null +++ b/recipes/dcmtk/config.yml @@ -0,0 +1,7 @@ +versions: + "3.6.7": + folder: "all" + "3.6.6": + folder: "all" + "3.6.5": + folder: "all" diff --git a/recipes/dd-opentracing-cpp/all/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..4adab61a177bf --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/CMakeLists.txt @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000000..5c4a8f88936e6 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.3.0": + url: https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.0.tar.gz + sha256: 16aad0c0daed054d4bcdf68cf069956e8d3b0c60a33c2162ad655a17b33b65e4 +patches: + "1.3.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-Find-packages-setup.patch" diff --git a/recipes/dd-opentracing-cpp/all/conanfile.py b/recipes/dd-opentracing-cpp/all/conanfile.py new file mode 100644 index 0000000000000..39cb79ab41f5f --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/conanfile.py @@ -0,0 +1,120 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.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" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "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", + "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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + 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.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + 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() + 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" + ) + 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", + ] 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 new file mode 100644 index 0000000000000..3308c5a043699 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch @@ -0,0 +1,65 @@ +--- + 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/test_package/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..61e5eac8d9ed0 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +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 new file mode 100644 index 0000000000000..5c09494bc67c0 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/test_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" + + 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/dd-opentracing-cpp/all/test_package/test_package.cpp b/recipes/dd-opentracing-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..45a3699729757 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + datadog::opentracing::TracerOptions tracer_options{"localhost", 8126, "compiled-in example"}; + auto tracer = datadog::opentracing::makeTracer(tracer_options); + + tracer->Close(); + return 0; +} diff --git a/recipes/dd-opentracing-cpp/config.yml b/recipes/dd-opentracing-cpp/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/dd-opentracing-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/debug_assert/all/conandata.yml b/recipes/debug_assert/all/conandata.yml new file mode 100644 index 0000000000000..cfa7ab5250ed4 --- /dev/null +++ b/recipes/debug_assert/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + '1.3.3': + url: https://github.com/foonathan/debug_assert/archive/v1.3.3.zip + sha256: c0871c7bb8d7e0f36cfae9a5ba526ea0c0fcaa41203ffb4280de27cb030e7383 diff --git a/recipes/debug_assert/all/conanfile.py b/recipes/debug_assert/all/conanfile.py new file mode 100644 index 0000000000000..7c5ec7a1005be --- /dev/null +++ b/recipes/debug_assert/all/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, tools +import os + +class DebugAssert(ConanFile): + name = 'debug_assert' + description = 'Simple, flexible and modular assertion macro' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'http://foonathan.net/blog/2016/09/16/assertions.html' + license = 'Zlib' + topics = 'conan', 'assert', 'debugging', 'utilities' + + settings = 'compiler' + + no_copy_source = True + _source_subfolder = 'source_subfolder' + + @property + def _repo_folder(self): + return os.path.join(self.source_folder, self._source_subfolder) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, '11') + + def package(self): + self.copy("*LICENSE", dst="licenses", keep_path=False) + self.copy("debug_assert.hpp", src=self._repo_folder, dst='include/') + + def package_id(self): + self.info.header_only() diff --git a/recipes/debug_assert/all/test_package/CMakeLists.txt b/recipes/debug_assert/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/debug_assert/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/debug_assert/all/test_package/conanfile.py b/recipes/debug_assert/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/debug_assert/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/debug_assert/all/test_package/test_package.cpp b/recipes/debug_assert/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..46f66becef270 --- /dev/null +++ b/recipes/debug_assert/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "debug_assert.hpp" + +//=== module A ===// +#define MODULE_A_LEVEL 1 // macro to control assertion level +// usually set by the build system + +// tag type that defines a module +struct module_a : debug_assert::default_handler, // it uses the default handler + debug_assert::set_level // and this level +{ +}; + +int main() +{ + return 0; + DEBUG_UNREACHABLE(module_a{}); // mark unreachable statements +} diff --git a/recipes/debug_assert/config.yml b/recipes/debug_assert/config.yml new file mode 100644 index 0000000000000..416be34945c37 --- /dev/null +++ b/recipes/debug_assert/config.yml @@ -0,0 +1,3 @@ +versions: + '1.3.3': + folder: all diff --git a/recipes/decimal_for_cpp/all/conandata.yml b/recipes/decimal_for_cpp/all/conandata.yml new file mode 100644 index 0000000000000..1725a9d7288d2 --- /dev/null +++ b/recipes/decimal_for_cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.18": + url: "https://github.com/vpiotr/decimal_for_cpp/archive/c949929d796ea389f2203a198a23fe59c0ab47d9.tar.gz" + sha256: "575d06e0a75e9db981a2cdb6949c2fe0709214aaf3fb293c94df7657cd394192" diff --git a/recipes/decimal_for_cpp/all/conanfile.py b/recipes/decimal_for_cpp/all/conanfile.py new file mode 100644 index 0000000000000..3e6a2b2a8d7a3 --- /dev/null +++ b/recipes/decimal_for_cpp/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.50.0" + + +class DecimalforcppConan(ConanFile): + name = "decimal_for_cpp" + description = "Decimal data type support, for COBOL-like fixed-point operations on currency values." + license = "BSD-3-Clause" + topics = ("decimal_for_cpp", "currency", "money-library", "decimal-numbers") + homepage = "https://github.com/vpiotr/decimal_for_cpp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "license.txt", src=os.path.join(self.source_folder, "doc"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/decimal_for_cpp/all/test_package/CMakeLists.txt b/recipes/decimal_for_cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee7bfe5c692c5 --- /dev/null +++ b/recipes/decimal_for_cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(decimal_for_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} decimal_for_cpp::decimal_for_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/decimal_for_cpp/all/test_package/conanfile.py b/recipes/decimal_for_cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/decimal_for_cpp/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/decimal_for_cpp/all/test_package/test_package.cpp b/recipes/decimal_for_cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aca2d825d7873 --- /dev/null +++ b/recipes/decimal_for_cpp/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include + +int main() { + dec::decimal<2> value(143125); + std::cout << "Value #1 is: " << value << std::endl; + + dec::decimal<2> b("0.11"); + value += b; + std::cout << "Value #2 is: " << value << std::endl; + + value /= 1000; + std::cout << "Value #3 is: " << value << std::endl; + return 0; +} diff --git a/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt b/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..99324bd86f533 --- /dev/null +++ b/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(decimal_for_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} decimal_for_cpp::decimal_for_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/decimal_for_cpp/all/test_v1_package/conanfile.py b/recipes/decimal_for_cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/decimal_for_cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/decimal_for_cpp/config.yml b/recipes/decimal_for_cpp/config.yml new file mode 100644 index 0000000000000..7066915bb47f2 --- /dev/null +++ b/recipes/decimal_for_cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.18": + folder: all diff --git a/recipes/deco/all/conandata.yml b/recipes/deco/all/conandata.yml new file mode 100644 index 0000000000000..907b9dffee329 --- /dev/null +++ b/recipes/deco/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.1": + url: "https://github.com/Enhex/Deco/archive/refs/tags/v1.0.1.zip" + sha256: 819e0a7fe2053944e2ec7fe0dee5e028d51e998b6b46b82f9553f26da50e7c9a + "1.0.0": + url: "https://github.com/Enhex/Deco/archive/refs/tags/v1.0.0.zip" + sha256: f167228306ccfaa24cffd08f5bc95e909b811920e7ed7b584ca83173534ff1eb diff --git a/recipes/deco/all/conanfile.py b/recipes/deco/all/conanfile.py new file mode 100644 index 0000000000000..3760e5bb68e07 --- /dev/null +++ b/recipes/deco/all/conanfile.py @@ -0,0 +1,56 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +class DecoConan(ConanFile): + name = "deco" + license = "Apache-2.0-WITH-LLVM-exception" + description = "Delimiter Collision Free Format" + topics = ("serialization") + homepage = "https://github.com/Enhex/Deco" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + settings = ("compiler", "build_type", "os", "arch") + requires = ( + "enhex-generic_serialization/1.0.0", + "enhex-strong_type/1.0.0", + "boost/1.79.0", + "rang/3.2", + ) + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimal_version = { + "Visual Studio": "15", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1" + } + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + if compiler not in minimal_version: + self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + return + + # Exclude compilers not supported + if compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( + self.name, compiler, tools.Version(self.settings.compiler.version.value))) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/deco/all/test_package/CMakeLists.txt b/recipes/deco/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00c3587be1a63 --- /dev/null +++ b/recipes/deco/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(deco CONFIG REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example deco::deco) +set_target_properties(example PROPERTIES CXX_STANDARD 17) diff --git a/recipes/deco/all/test_package/conanfile.py b/recipes/deco/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f735734fbcfa9 --- /dev/null +++ b/recipes/deco/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class DecoTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/deco/all/test_package/example.cpp b/recipes/deco/all/test_package/example.cpp new file mode 100644 index 0000000000000..336ea678b84e6 --- /dev/null +++ b/recipes/deco/all/test_package/example.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +int main() +{ + using namespace std; + + const string sample { + "hello:\n" + " world!\n" + ":\n" + }; + + deco::parse(sample.begin(), sample.end()); + + cout << sample << endl; +} diff --git a/recipes/deco/config.yml b/recipes/deco/config.yml new file mode 100644 index 0000000000000..ac95cfe2bb3a3 --- /dev/null +++ b/recipes/deco/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.1": + folder: "all" + "1.0.0": + folder: "all" diff --git a/recipes/depot_tools/all/conandata.yml b/recipes/depot_tools/all/conandata.yml new file mode 100644 index 0000000000000..76dffe6ab4ef4 --- /dev/null +++ b/recipes/depot_tools/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "20200407": + url: "https://chromium.googlesource.com/chromium/tools/depot_tools/+archive/48c5c9c50455c625c58dab2fbb0904cac467168c.tar.gz" + "cci.20201009": + url: "https://chromium.googlesource.com/chromium/tools/depot_tools.git/+archive/b073999c6f90103a36a923e63ae8cf7a5c9c6c8c.tar.gz" +patches: + "cci.20201009": + - patch_file: "patches/001-use-system-python.patch" + base_path: "source_subfolder" diff --git a/recipes/depot_tools/all/conanfile.py b/recipes/depot_tools/all/conanfile.py new file mode 100644 index 0000000000000..45bfe37d78533 --- /dev/null +++ b/recipes/depot_tools/all/conanfile.py @@ -0,0 +1,92 @@ +import os +import shutil +from conans import ConanFile, tools + + +class DepotToolsConan(ConanFile): + name = "depot_tools" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://chromium.googlesource.com/chromium/tools/depot_tools" + description = "Tools for working with Chromium development." + topics = ("depot_tools", "chromium") + license = "BSD-3-Clause" + short_paths = True + no_copy_source = True + settings = "os", "arch", "build_type", "compiler" + exports_sources = ["patches/**"] + + + @property + def _source_subfolder(self): + return os.path.join(self.source_folder, "source_subfolder") + + def _dereference_symlinks(self): + """ + Windows 10 started to introduce support for symbolic links. Unfortunately + it caused a lot of trouble during packaging. Namely, opening symlinks causes + `OSError: Invalid argument` rather than actually following the symlinks. + Therefore, this workaround simply copies the destination file over the symlink + """ + if self.settings.os != "Windows": + return + + for root, dirs, files in os.walk(self._source_subfolder): + symlinks = [os.path.join(root, f) for f in files if os.path.islink(os.path.join(root, f))] + for symlink in symlinks: + dest = os.readlink(symlink) + os.remove(symlink) + shutil.copy(os.path.join(root, dest), symlink, follow_symlinks=False) + self.output.info("Replaced symlink '%s' with its destination file '%s'" % (symlink, dest)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder) + self._dereference_symlinks() + + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="bin", src=self._source_subfolder) + self._fix_permissions() + + def _fix_permissions(self): + + def chmod_plus_x(name): + os.chmod(name, os.stat(name).st_mode | 0o111) + + if self.settings.os != "Windows": + for root, _, files in os.walk(self.package_folder): + for file_it in files: + filename = os.path.join(root, file_it) + with open(filename, 'rb') as f: + sig = f.read(4) + if type(sig) is str: + sig = [ord(s) for s in sig] + if len(sig) >= 2 and sig[0] == 0x23 and sig[1] == 0x21: + self.output.info('chmod on script file %s' % file_it) + chmod_plus_x(filename) + elif sig == [0x7F, 0x45, 0x4C, 0x46]: + self.output.info('chmod on ELF file %s' % file_it) + chmod_plus_x(filename) + elif \ + sig == [0xCA, 0xFE, 0xBA, 0xBE] or \ + sig == [0xBE, 0xBA, 0xFE, 0xCA] or \ + sig == [0xFE, 0xED, 0xFA, 0xCF] or \ + sig == [0xCF, 0xFA, 0xED, 0xFE] or \ + sig == [0xFE, 0xED, 0xFA, 0xCE] or \ + sig == [0xCE, 0xFA, 0xED, 0xFE]: + self.output.info('chmod on Mach-O file %s' % file_it) + chmod_plus_x(filename) + + def package_id(self): + del self.info.settings.arch + del self.info.settings.build_type + del self.info.settings.compiler + + def package_info(self): + 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) + + self.env_info.DEPOT_TOOLS_UPDATE = "0" diff --git a/recipes/depot_tools/all/patches/001-use-system-python.patch b/recipes/depot_tools/all/patches/001-use-system-python.patch new file mode 100644 index 0000000000000..86b1edd76677e --- /dev/null +++ b/recipes/depot_tools/all/patches/001-use-system-python.patch @@ -0,0 +1,16 @@ +diff --git a/vpython3.bat b/vpython3.bat +index d40cca5..5173dc1 100644 +--- a/vpython3.bat ++++ b/vpython3.bat +@@ -3,10 +3,4 @@ + :: Use of this source code is governed by a BSD-style license that can be + :: found in the LICENSE file. + +-:: TODO(crbug.com/1003139): Remove. +-:: Add Python 3 to PATH to work around crbug.com/1003139. +-for /f %%i in (%~dp0python3_bin_reldir.txt) do set PYTHON3_BIN_RELDIR=%%i +-set PATH=%~dp0%PYTHON3_BIN_RELDIR%;%~dp0%PYTHON3_BIN_RELDIR%\Scripts;%~dp0%PYTHON3_BIN_RELDIR%\DLLs;%PATH% +- +-call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 +-"%~dp0\.cipd_bin\vpython3.exe" -vpython-interpreter "%~dp0\%PYTHON3_BIN_RELDIR%\python3.exe" %* ++call python.exe %* diff --git a/recipes/depot_tools/all/test_package/conanfile.py b/recipes/depot_tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38bf21d14dbee --- /dev/null +++ b/recipes/depot_tools/all/test_package/conanfile.py @@ -0,0 +1,7 @@ +from conans import ConanFile + + +class TestPackageConan(ConanFile): + def test(self): + # cit: Chrome Infrastructure CLI + self.run("cit --help", run_environment=True) diff --git a/recipes/depot_tools/config.yml b/recipes/depot_tools/config.yml new file mode 100644 index 0000000000000..67beecc3322c0 --- /dev/null +++ b/recipes/depot_tools/config.yml @@ -0,0 +1,5 @@ +versions: + "20200407": + folder: all + "cci.20201009": + folder: all diff --git a/recipes/detools/all/CMakeLists.txt b/recipes/detools/all/CMakeLists.txt new file mode 100644 index 0000000000000..d0a389940b0bf --- /dev/null +++ b/recipes/detools/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(detools C) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_library(detools source_subfolder/c/detools.c) +install(TARGETS detools DESTINATION lib) +install(FILES source_subfolder/c/detools.h DESTINATION include) diff --git a/recipes/detools/all/conandata.yml b/recipes/detools/all/conandata.yml new file mode 100644 index 0000000000000..0c05a6fd77b19 --- /dev/null +++ b/recipes/detools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.51.0": + url: "https://github.com/eerimoq/detools/archive/refs/tags/0.51.0.zip" + sha256: 604175d493a9df5d19e78a55cd183e9c44789ee552f24d1a2b7466d58628c1ac diff --git a/recipes/detools/all/conanfile.py b/recipes/detools/all/conanfile.py new file mode 100644 index 0000000000000..2b8703a181ae6 --- /dev/null +++ b/recipes/detools/all/conanfile.py @@ -0,0 +1,65 @@ +import functools + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class DetoolsConan(ConanFile): + name = "detools" + description = "Binary delta encoding" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eerimoq/detools" + license = "MIT" + topics = ("delta-compression", "delta-update", "delta-encoding", + "ota", "bsdiff", "hdiffpatch") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports_sources = "CMakeLists.txt" + generators = "cmake" + requires = ['heatshrink/0.4.1', 'lz4/1.9.3', 'xz_utils/5.2.5'] + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This library is only compatible with Linux and FreeBSD") + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["detools"] diff --git a/recipes/detools/all/test_package/CMakeLists.txt b/recipes/detools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4e6b7c3b6cba8 --- /dev/null +++ b/recipes/detools/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(detools REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package detools::detools) diff --git a/recipes/detools/all/test_package/conanfile.py b/recipes/detools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..add2424f12959 --- /dev/null +++ b/recipes/detools/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +import os + +from conans import ConanFile, CMake, tools + + +class DetoolsTestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + self.build_requires("cmake/3.20.1") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self): + return + + bin_path = os.path.join("bin", "test_package") + old_path = os.path.join(self.source_folder, "old") + patch_path = os.path.join(self.source_folder, "patch") + patched_path = os.path.join(self.build_folder, "patched") + + self.run(f"{bin_path} {old_path} {patch_path} {patched_path}", + run_environment=True) diff --git a/recipes/detools/all/test_package/old b/recipes/detools/all/test_package/old new file mode 100644 index 0000000000000000000000000000000000000000..0368e11feda26b887c11cbf5525785a9906f8a5f GIT binary patch literal 2780 zcma)8eN0=|6+hSS`Pt?pbFF|5VMUO4~FwY8pXPu}YKL{jnq_AriK?;g#yTq6(ou5dj(;#?Q{d=vFma+Ex7!ndPqm!c%Wij1Znwm9;2ENm)+7Ez|Y zX_eohPbfWz2$?FaddoWxzl)c{CMp#V_#|4qP49L}wbWG<<7+DTVl-=2%$Tg#yB%ef zMn_0D#<%IH`NMAilixKus$>|me49bvZhuU)X91$G0B8Y#$Oj-sOA+tI-g#BvnWh$a zB%7!dzr*mB*GF!F)0nQ34aYV)HxMU~mD?P5!y&qRo9q+N#wU?0AkwEIX{Gmkx^8scUY;uljxbLQ@djO(NO@us6BTCi2>w<15+SNQcE0mA21qeCMUMvkXrGJjSW0 z3q;Rzrkkoy=tzr5=g<(YgOH0IDW{<=+|!pZhBLPEyg`>U`UJqP^{PV^&`)=; zKwXjBj+wGkS&JDc!P8Bh06b@m7t}IiXRs`K2;53(pAGlinDgQ?zj+FgW+BoDM;a|b zsqyD!j~|huhHn2^*8E50b-*y%f1^~$8+1B-x2-r|#>^%zWt0RR$z$XPw-mgmUhT5W=r3fxQO(LS&|l|Ujx zc*~o05HF)u%*q?(+UBuEyyZ7=Ucd@c;PL+{=?M+bBCk}dOMw9zGF!Sz=^ZT^S&|&GnGM-(eOXCX|>~X{2XdBwU!G$lyh@h zduFiMT1OB?U@!~UuzcrUtY)Kx$CF31qE@tHMI(5Z)fg$F$)6vuM4o0Fd)gY3)Kgoifd(S5Dy%3?`Wv__z zi{I%%j3l3l7OwnJQQ}zlnqWizV;1fJ2sjrb%`FybtqF#+%zeWdJk_SsR4YoDAwHb5 zxGlaHnFP80Q|l$Tpqds$2RtE@G`m2?$}YqucBA5HAU~U;p+HP^&>eHSa>leNHT`1z zVc3o}1E2^ih1~whJsqu8vd@9JB5*C3x!0ASnpjc(ZKt)fa`_|(6@C!+95lwmdQKPi zlIJlyaxg<3sL|MT7C>E*xKbC(J7Wr!wLo6`l3ersu!r5fV7qN}KFLu8C%@R(0fhU& zy9L`sTQ?6>24RbZt1s)r`eI6S-6sjw7uElK&i&&Mgmw)9aHCE*k7iN3d z!h|qKKE^zF88Lpw`$DGcExpT)o?6?y;F1EPa>t4J|0CufAjs7Ik?{}XABOH9;?BVh|5X(lCULL` z@bGEMy+5dMHNuBUvFLz +#include "detools.h" + +#define EXPECTED_PATCHED_FILE_SIZE 2780 + +int main(int argc, const char *argv[]) +{ + int res; + + if (argc != 4) { + printf("Wrong number of arguments.\n"); + + return EXIT_FAILURE; + } + + res = detools_apply_patch_filenames(argv[1], argv[2], argv[3]); + + if (res == EXPECTED_PATCHED_FILE_SIZE) { + return EXIT_SUCCESS; + } else { + return EXIT_FAILURE; + } +} diff --git a/recipes/detools/config.yml b/recipes/detools/config.yml new file mode 100644 index 0000000000000..0cb36a4c86d32 --- /dev/null +++ b/recipes/detools/config.yml @@ -0,0 +1,3 @@ +versions: + "0.51.0": + folder: "all" diff --git a/recipes/detours/all/CMakeLists.txt b/recipes/detours/all/CMakeLists.txt new file mode 100644 index 0000000000000..08643cd4c3e75 --- /dev/null +++ b/recipes/detours/all/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.0) +project(conan_detours CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +file(GLOB DETOURS_SOURCES source_subfolder/src/*.cpp) +list(REMOVE_ITEM DETOURS_SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src/uimports.cpp" +) +file(GLOB DETOURS_HEADERS source_subfolder/src/*.h) +add_library(detours STATIC ${DETOURS_SOURCES} ${DETOURS_HEADERS}) + +include(GNUInstallDirs) +install(TARGETS detours + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) +install(FILES ${DETOURS_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/detours/all/conandata.yml b/recipes/detours/all/conandata.yml new file mode 100644 index 0000000000000..3dfe062c93117 --- /dev/null +++ b/recipes/detours/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220630": + url: "https://github.com/microsoft/Detours/archive/a1dd93fddfbba5ad07992edbaf4a296dcfca8d6f.tar.gz" + sha256: "6e1c9c8f7264749e58931660721b3aaa520ce1b489559bc9ad7003eb705427df" diff --git a/recipes/detours/all/conanfile.py b/recipes/detours/all/conanfile.py new file mode 100644 index 0000000000000..6d72096230585 --- /dev/null +++ b/recipes/detours/all/conanfile.py @@ -0,0 +1,98 @@ +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.45.0" + + +class DetoursConan(ConanFile): + name = "detours" + homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" + description = "Detours is a software package for monitoring and instrumenting API calls on Windows" + topics = ("monitoror", "instrumenting", "hook", "injection") + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("Only os=Windows is supported") + # if not is_msvc(self): + # raise ConanInvalidConfiguration("Only the MSVC compiler is supported") + if is_msvc(self) and not is_msvc_static_runtime(self): + # Debug and/or dynamic runtime is undesired for a hooking library + raise ConanInvalidConfiguration("Only static runtime is supported (MT)") + if self.settings.build_type != "Release": + raise ConanInvalidConfiguration("Detours only supports the Release build type") + try: + self.output.info(f"target process is {self._target_processor}") + except KeyError: + raise ConanInvalidConfiguration("Unsupported architecture") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def export_sources(self): + self.copy("CMakeLists.txt") + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + @property + def _target_processor(self): + return { + "x86": "X86", + "x86_64": "X64", + "armv7": "ARM", + "armv8": "ARM64", + }[str(self.settings.arch)] + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def _patch_sources(self): + if is_msvc(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Makefile"), + "/MT ", f"/{self.settings.compiler.runtime} ") + + def build(self): + self._patch_sources() + if is_msvc(self): + with tools.vcvars(self): + with tools.chdir(os.path.join(self._source_subfolder, "src")): + self.run(f"nmake DETOURS_TARGET_PROCESSOR={self._target_processor}") + else: + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") + if is_msvc(self): + self.copy("detours.lib", src=os.path.join(self._source_subfolder, f"lib.{self._target_processor}"), dst="lib") + self.copy("*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") + else: + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libs = ["detours"] + if self.settings.compiler == "gcc": + self.cpp_info.system_libs = [tools.stdcpp_library(self)] + self.cpp_info.link_flags = ["-static-libgcc", "-static-libstdc++"] diff --git a/recipes/detours/all/test_package/CMakeLists.txt b/recipes/detours/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b89b27839454 --- /dev/null +++ b/recipes/detours/all/test_package/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(detours REQUIRED CONFIG) + +add_executable(victim victim.c) + +set(HOOK_SOURCES hook.c) +if(MSVC) + list(APPEND HOOK_SOURCES hook_msvc.def) +else() + list(APPEND HOOK_SOURCES hook_mingw.def) +endif() +add_library(hook SHARED ${HOOK_SOURCES}) +target_link_libraries(hook PRIVATE detours::detours) +if(NOT MSVC) + target_link_options(hook PRIVATE -static-libgcc -static-libstdc++) +endif() +set_target_properties(hook PROPERTIES PREFIX "") + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE detours::detours) diff --git a/recipes/detours/all/test_package/conanfile.py b/recipes/detours/all/test_package/conanfile.py new file mode 100644 index 0000000000000..43240d491944c --- /dev/null +++ b/recipes/detours/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake, tools +import io +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.verbose = 1 + 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") + buffer = io.StringIO() + self.run(f"{bin_path} \"{os.path.join(self.build_folder, 'bin')}\"", run_environment=True, output=buffer) + print(buffer.getvalue()) + assert "I found your message! It was 'A secret text'! I am 1337! :^)" in buffer.getvalue() diff --git a/recipes/detours/all/test_package/hook.c b/recipes/detours/all/test_package/hook.c new file mode 100644 index 0000000000000..55bcff4678b8c --- /dev/null +++ b/recipes/detours/all/test_package/hook.c @@ -0,0 +1,40 @@ +#include +#include + +#include +#include + +typedef BOOL (WINAPI * tWriteFile)(HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED); +static tWriteFile OriginalWriteFile = WriteFile; +static BOOL WINAPI HookWriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) { + char buffer[512]; + sprintf_s(buffer, sizeof(buffer), "I found your message! It was '%s'! I am 1337! :^)", (char*)lpBuffer); + return OriginalWriteFile(hFile, buffer, (DWORD)strlen(buffer), lpNumberOfBytesWritten, lpOverlapped); +} + +BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserve0d) +{ + if (DetourIsHelperProcess()) { + return TRUE; + } + + if (dwReason == DLL_PROCESS_ATTACH) { + AllocConsole(); + DetourRestoreAfterWith(); + + DetourTransactionBegin(); + DetourUpdateThread(GetCurrentThread()); + + DetourAttach((PVOID*)&OriginalWriteFile, HookWriteFile); + + DetourTransactionCommit(); + } else if (dwReason == DLL_PROCESS_DETACH) { + DetourTransactionBegin(); + DetourUpdateThread(GetCurrentThread()); + + DetourDetach((PVOID*)&OriginalWriteFile, HookWriteFile); + + DetourTransactionCommit(); + } + return TRUE; +} diff --git a/recipes/detours/all/test_package/hook_mingw.def b/recipes/detours/all/test_package/hook_mingw.def new file mode 100644 index 0000000000000..1f2b4e23a5ee9 --- /dev/null +++ b/recipes/detours/all/test_package/hook_mingw.def @@ -0,0 +1,3 @@ +LIBRARY hook.dll +EXPORTS + DetourFinishHelperProcess@16 @1 NONAME diff --git a/recipes/detours/all/test_package/hook_msvc.def b/recipes/detours/all/test_package/hook_msvc.def new file mode 100644 index 0000000000000..c84b3610d727f --- /dev/null +++ b/recipes/detours/all/test_package/hook_msvc.def @@ -0,0 +1,3 @@ +LIBRARY hook.dll +EXPORTS + DetourFinishHelperProcess @1 NONAME diff --git a/recipes/detours/all/test_package/test_package.c b/recipes/detours/all/test_package/test_package.c new file mode 100644 index 0000000000000..908c3cb28e6e0 --- /dev/null +++ b/recipes/detours/all/test_package/test_package.c @@ -0,0 +1,134 @@ +#include +#include + +#include +#include +#include + +#define ARRAY_SIZE(ARR) ((sizeof(ARR))/sizeof(*(ARR))) + +int CDECL main(int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "Need at least one argument\n"); + return 1; + } + + SECURITY_ATTRIBUTES saAttr; + saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); + saAttr.bInheritHandle = TRUE; + saAttr.lpSecurityDescriptor = NULL; + + HANDLE hChildStd_IN_Rd = NULL; + HANDLE hChildStd_IN_Wr = NULL; + HANDLE hChildStd_OUT_Rd = NULL; + HANDLE hChildStd_OUT_Wr = NULL; + + if (!CreatePipe(&hChildStd_OUT_Rd, &hChildStd_OUT_Wr, &saAttr, 0)) { + fprintf(stderr, "StdoutRd CreatePipe\n"); + return 1; + } + if (!SetHandleInformation(hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0)) { + fprintf(stderr, "Stdout SetHandleInformation"); + } + if (!CreatePipe(&hChildStd_IN_Rd, &hChildStd_IN_Wr, &saAttr, 0)) { + fprintf(stderr, "Stdin CreatePipe"); + } + if (!SetHandleInformation(hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0)) { + fprintf(stderr, "Stdin SetHandleInformation"); + } + + STARTUPINFOA si; + PROCESS_INFORMATION pi; + + ZeroMemory(&si, sizeof(si)); + ZeroMemory(&pi, sizeof(pi)); + si.cb = sizeof(si); + si.hStdError = hChildStd_OUT_Wr; + si.hStdOutput = hChildStd_OUT_Wr; + si.hStdInput = hChildStd_IN_Rd; + si.dwFlags |= STARTF_USESTDHANDLES; + + char exe[1024]; + strcpy_s(exe, sizeof(exe), argv[1]); + strcat_s(exe, sizeof(exe), "\\"); + strcat_s(exe, sizeof(exe), "victim.exe"); + + char command[1024]; + strcpy_s(command, sizeof(command), exe); + + char hook_dll[1024];; + strcpy_s(hook_dll, sizeof(hook_dll), argv[1]); + strcat_s(hook_dll, sizeof(hook_dll), "\\"); + strcat_s(hook_dll, sizeof(hook_dll), "hook.dll"); + const char* hooks[] = { + hook_dll, + }; + + printf("Starting \"%s`\n", exe); + printf(" with command: \"%s`\n", command); + printf(" with dlls:\n"); + for (size_t i = 0; i < ARRAY_SIZE(hooks); ++i) { + printf(" - %s\n", hooks[i]); + } + fflush(stdout); + + DWORD dwFlags = CREATE_DEFAULT_ERROR_MODE | CREATE_SUSPENDED | CREATE_NO_WINDOW; + + SetLastError(0); + if (!DetourCreateProcessWithDllsA( + exe, + command, + NULL, + NULL, + TRUE, + dwFlags, + NULL, + NULL, + &si, + &pi, + ARRAY_SIZE(hooks), + hooks, + NULL)) { + DWORD dwError = GetLastError(); + printf("%s: DetourCreateProcessWithDllEx failed: %ld\n", argv[0], dwError); + if (dwError == ERROR_INVALID_HANDLE) { +#if DETOURS_64BIT + printf("%s: Can't detour a 32-bit target process from a 64-bit parent process.\n", argv[0]); +#else + printf("%s: Can't detour a 64-bit target process from a 32-bit parent process.\n", argv[0]); +#endif + } + printf("ERROR"); + return 1; + } + + ResumeThread(pi.hThread); + CloseHandle(hChildStd_OUT_Wr); + CloseHandle(hChildStd_IN_Rd); + + for (;;) + { + DWORD dwRead, dwWritten; + char chBuf[256]; + BOOL bSuccess = ReadFile( hChildStd_OUT_Rd, chBuf, sizeof(chBuf), &dwRead, NULL); + if( ! bSuccess || dwRead == 0 ) { + break; + } + + bSuccess = WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), chBuf, + dwRead, &dwWritten, NULL); + if (!bSuccess) { + break; + } + } + + WaitForSingleObject(pi.hProcess, INFINITE); + + DWORD dwResult = 0; + if (!GetExitCodeProcess(pi.hProcess, &dwResult)) { + printf("%s: GetExitCodeProcess failed: %ld\n", argv[0], GetLastError()); + return 9010; + } + + return dwResult; +} diff --git a/recipes/detours/all/test_package/victim.c b/recipes/detours/all/test_package/victim.c new file mode 100644 index 0000000000000..ea4d0ad64375e --- /dev/null +++ b/recipes/detours/all/test_package/victim.c @@ -0,0 +1,11 @@ +#include + +#include + +int main(int argc, const char *args[]) +{ + HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE); + const char* text = "A secret text"; + WriteFile(stdout, text, (DWORD)strlen(text), NULL, NULL); + return 0; +} diff --git a/recipes/detours/config.yml b/recipes/detours/config.yml new file mode 100644 index 0000000000000..add5cbbf72010 --- /dev/null +++ b/recipes/detours/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220630": + folder: all diff --git a/recipes/di/all/BSL-1.0.txt b/recipes/di/all/BSL-1.0.txt new file mode 100644 index 0000000000000..36b7cd93cdfba --- /dev/null +++ b/recipes/di/all/BSL-1.0.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +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, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/recipes/di/all/conandata.yml b/recipes/di/all/conandata.yml new file mode 100644 index 0000000000000..0dd2a459aba98 --- /dev/null +++ b/recipes/di/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.0": + url: https://github.com/boost-ext/di/archive/v1.1.0.tar.gz + sha256: 2bb52ed621c36e4e301ed7fbe4197980e9110bd4afc4208841637ce112c0d443 + "1.2.0": + url: https://github.com/boost-ext/di/archive/v1.2.0.tar.gz + sha256: 47ed660a1198f61394d30890cbb9a68b0fd6d17f41283e1de0036d10c1d24a55 diff --git a/recipes/di/all/conanfile.py b/recipes/di/all/conanfile.py new file mode 100644 index 0000000000000..5ccda35c324e5 --- /dev/null +++ b/recipes/di/all/conanfile.py @@ -0,0 +1,61 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class DiConan(ConanFile): + name = "di" + license = "BSL-1.0" + homepage = "https://github.com/boost-ext/di" + url = "https://github.com/conan-io/conan-center-index" + description = "DI: C++14 Dependency Injection Library." + topics = ("dependency-injection", "metaprogramming", "design-patterns") + exports_sources = ["BSL-1.0.txt"] + settings = "compiler" + options = {"with_extensions": [True, False], "diagnostics_level": [0, 1, 2]} + default_options = {"with_extensions": False, "diagnostics_level": 1} + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + minimal_cpp_standard = "14" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "15" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warn( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "di-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy("BSL-1.0.txt", src="", dst="licenses") + if self.options.with_extensions: + self.copy("*.hpp", src=os.path.join(self._source_subfolder, "extension", "include", "boost", "di", "extension"), dst=os.path.join("include", "boost", "di", "extension"), keep_path=True) + self.copy("di.hpp", src=os.path.join(self._source_subfolder, "include", "boost"), dst=os.path.join("include", "boost")) + + def package_id(self): + self.info.requires.clear() + self.info.settings.clear() + del self.info.options.diagnostics_level + + def package_info(self): + self.cpp_info.defines.append("BOOST_DI_CFG_DIAGNOSTICS_LEVEL={}".format(self.options.diagnostics_level)) diff --git a/recipes/di/all/test_package/CMakeLists.txt b/recipes/di/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..44d785353d02d --- /dev/null +++ b/recipes/di/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1.3) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(example example.cpp) +set_target_properties(example PROPERTIES CXX_STANDARD 14) +target_link_libraries(example CONAN_PKG::di) diff --git a/recipes/di/all/test_package/conanfile.py b/recipes/di/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8d63f059b4cdc --- /dev/null +++ b/recipes/di/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class DiConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "example"), run_environment=True) diff --git a/recipes/di/all/test_package/example.cpp b/recipes/di/all/test_package/example.cpp new file mode 100644 index 0000000000000..9e3fa6934c640 --- /dev/null +++ b/recipes/di/all/test_package/example.cpp @@ -0,0 +1,34 @@ +#include +#include +#include + +namespace di = boost::di; + +class IPrinter { +public: + virtual ~IPrinter() = default; + virtual void print() = 0; +}; + +class Printer : public IPrinter { + void print() override { std::cout << "Success !\n"; } +}; + +class PrintCaller { +public: + explicit PrintCaller(std::unique_ptr printer) : _printer{std::move(printer)} {} + void callPrint() { _printer->print(); } +private: + std::unique_ptr _printer; +}; + +int main() { + const auto injector = di::make_injector( + di::bind().to() + ); + + auto printCaller = injector.create(); + printCaller.callPrint(); + + return 0; +} diff --git a/recipes/di/config.yml b/recipes/di/config.yml new file mode 100644 index 0000000000000..246aedabf295f --- /dev/null +++ b/recipes/di/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.2.0": + folder: all diff --git a/recipes/dice-template-library/all/CMakeLists.txt b/recipes/dice-template-library/all/CMakeLists.txt new file mode 100644 index 0000000000000..b71c882d9d33f --- /dev/null +++ b/recipes/dice-template-library/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml new file mode 100644 index 0000000000000..a56456e70c621 --- /dev/null +++ b/recipes/dice-template-library/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.1.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.1.0.tar.gz" + sha256: "1d682283c4a54c4495fc65caa6f9a7674739156ce851227980430052120b2c29" + "0.2.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.2.0.tar.gz" + sha256: "0f981aeb5604eb305a190d3aef6625032bbb2a34a0bcd17f17ae0cef19fac384" + "0.3.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.3.0.tar.gz" + sha256: "2c02278f86c7b5fe1c684f5126f30529952a03784fa7c883cc4fd44965b3c33e" diff --git a/recipes/dice-template-library/all/conanfile.py b/recipes/dice-template-library/all/conanfile.py new file mode 100644 index 0000000000000..d7cce02ca9aa4 --- /dev/null +++ b/recipes/dice-template-library/all/conanfile.py @@ -0,0 +1,69 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class DiceTemplateLibrary(ConanFile): + name = "dice-template-library" + description = "This template library is a collection of handy template-oriented code that we, the Data Science Group at UPB, found pretty handy." + homepage = "https://dice-research.org/" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + topics = ("template", "template-library", "compile-time", "switch", "integral-tuple") + settings = "build_type", "compiler", "os", "arch" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10.2", + "clang": "12", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._min_cppstd) + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("apple-clang is not supported because a full concept implementation is needed") + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("MSVC is not supported because a full concept implementation is needed") + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("{} {} requires C++20. Your compiler is unknown. Assuming it supports C++20.".format(self.name, self.version)) + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration("{} {} requires C++20, which your compiler does not support.".format(self.name, self.version)) + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", self.name) + self.cpp_info.set_property("cmake_target_aliases", ["{0}::{0}".format(self.name)]) + self.cpp_info.names["cmake_find_package"] = self.name + self.cpp_info.names["cmake_find_package_multi"] = self.name diff --git a/recipes/dice-template-library/all/test_package/CMakeLists.txt b/recipes/dice-template-library/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6fcf6dde0f94e --- /dev/null +++ b/recipes/dice-template-library/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(dice-template-library REQUIRED) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dice-template-library::dice-template-library) diff --git a/recipes/dice-template-library/all/test_package/conanfile.py b/recipes/dice-template-library/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9d8f35201d56c --- /dev/null +++ b/recipes/dice-template-library/all/test_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", "cmake_find_package_multi", + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dice-template-library/all/test_package/test_package.cpp b/recipes/dice-template-library/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..49e49454d63d0 --- /dev/null +++ b/recipes/dice-template-library/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include +#include + +template struct Wrapper { static constexpr int i = N; }; + +int main() { + dice::template_library::integral_template_tuple tup; + std::cout << std::boolalpha << "tup.get<3>().i == 3: " << (tup.get<3>().i == 3) << std::endl; +} diff --git a/recipes/dice-template-library/config.yml b/recipes/dice-template-library/config.yml new file mode 100644 index 0000000000000..b657866f6cca6 --- /dev/null +++ b/recipes/dice-template-library/config.yml @@ -0,0 +1,7 @@ +versions: + "0.1.0": + folder: all + "0.2.0": + folder: all + "0.3.0": + folder: all diff --git a/recipes/diligent-core/all/CMakeLists.txt b/recipes/diligent-core/all/CMakeLists.txt new file mode 100644 index 0000000000000..a00123a14d403 --- /dev/null +++ b/recipes/diligent-core/all/CMakeLists.txt @@ -0,0 +1,22 @@ +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/conandata.yml b/recipes/diligent-core/all/conandata.yml new file mode 100644 index 0000000000000..a48d5fbd77dc8 --- /dev/null +++ b/recipes/diligent-core/all/conandata.yml @@ -0,0 +1,59 @@ +sources: + "api.252009": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252009.tar.gz" + sha256: "48d62ba72551166ea47eec4d2ad0589811e51c76c40d1998ad5049096efe8c19" + "api.252005": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252005.tar.gz" + sha256: "20d164b36ec6ff6f1ef69aa44210bb46f3244af1c0d9538ac3758ca2437fb2e1" + "api.252004": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252004.tar.gz" + sha256: "06e4ee5f95163ae74bbe62f59dcdf1da5e181ff2d6a8e3982319bb5c8f97c53b" + "api.252003": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252003.tar.gz" + sha256: "18f17eaa0b6425022be4019c61fede441b9feec4b94c2b7e8ab73d86a7f6a913" + "2.5.2": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/v2.5.2.tar.gz" + sha256: "6767a6b4f5750c3801ccdba8f7793ac79fa429c8d4518d79717f68ef9dd0ed2a" + "2.5.1": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/v2.5.1.tar.gz" + sha256: "56a577d5273539f88cc27fb74ab61e42f407da77ef4d0876f83a9f8e763c0f64" + "api.250014": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API250014.tar.gz" + sha256: "8f85fc55c6241f9215875df58a077f797e9134c9b51f330f1489df91d8553b7d" +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 new file mode 100644 index 0000000000000..a02de86844027 --- /dev/null +++ b/recipes/diligent-core/all/conanfile.py @@ -0,0 +1,225 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +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.apple import is_apple_os +import os + +required_conan_version = ">=1.52.0" + + +class DiligentCoreConan(ConanFile): + name = "diligent-core" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DiligentGraphics/DiligentCore" + description = "Diligent Core is a modern cross-platfrom low-level graphics API." + license = "Apache-2.0" + topics = ("graphics") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_glslang": [True, False], + } + default_options = { + "shared": False , + "fPIC": True, + "with_glslang": True + } + short_paths = True + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "6", + "clang": "3.4", + "apple-clang": "5.1", + } + + @property + def _minimum_cpp_standard(self): + return 14 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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 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: + 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) + 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) + + 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: + self.info.settings.compiler.runtime = "MT/MTd" + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DILIGENT_BUILD_SAMPLES"] = False + tc.variables["DILIGENT_NO_FORMAT_VALIDATION"] = True + 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["DILIGENT_CLANG_COMPILE_OPTIONS"] = "" + tc.variables["DILIGENT_MSVC_COMPILE_OPTIONS"] = "" + tc.variables["ENABLE_RTTI"] = True + tc.variables["ENABLE_EXCEPTIONS"] = True + tc.variables[self._diligent_platform()] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def layout(self): + cmake_layout(self) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _patch_sources(self): + patches.apply_conandata_patches(self) + + def build_requirements(self): + self.tool_requires("cmake/3.24.2") + + def requirements(self): + self.requires("opengl/system") + if self.settings.os == "Linux": + self.requires("wayland/1.21.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-validationlayers/1.3.224.1") + self.requires("volk/1.3.224.1") + self.requires("xxhash/0.8.1") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + if not cross_building(self, skip_x64_x86=True): + self.requires("xkbcommon/1.4.1") + + def _diligent_platform(self): + if self.settings.os == "Windows": + return "PLATFORM_WIN32" + elif self.settings.os == "Macos": + return "PLATFORM_MACOS" + elif self.settings.os == "Linux": + return "PLATFORM_LINUX" + elif self.settings.os == "Android": + return "PLATFORM_ANDROID" + elif self.settings.os == "iOS": + return "PLATFORM_IOS" + elif self.settings.os == "Emscripten": + return "PLATFORM_EMSCRIPTEN" + elif self.settings.os == "watchOS": + return "PLATFORM_TVOS" + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + 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")) + + if self.options.shared: + copy(self, pattern="*.dylib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + rm(self, os.path.join(self.package_folder, "lib"), "*.a", recursive=True) + if self.settings.os != "Windows": + rm(self, os.path.join(self.package_folder, "lib"), "*.lib", recursive=True) + else: + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + rm(self, os.path.join(self.package_folder, "lib"), "*.dylib", recursive=True) + rm(self, os.path.join(self.package_folder, "lib"), "*.so", recursive=True) + rm(self, os.path.join(self.package_folder, "lib"), "*.dll", recursive=True) + + copy(self, pattern="*.fxh", dst=os.path.join(self.package_folder, "res"), src=self.source_folder, keep_path=False) + copy(self, "File2String*", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) + rm(self, "*.pdb", self.package_folder, recursive=True) + # MinGw creates many invalid files, called objects.a, remove them here: + rm(self, "objects.a", self.package_folder, recursive=True) + + 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") + 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")) + if self.settings.os == "Android": + self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Android", "interface")) + elif is_apple_os(self): + self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Apple", "interface")) + elif self.settings.os == "Emscripten": + self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Emscripten", "interface")) + elif self.settings.os == "Linux": + self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "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.defines.append("SPIRV_CROSS_NAMESPACE_OVERRIDE={}".format(self.options["spirv-cross"].namespace)) + self.cpp_info.defines.append("{}=1".format(self._diligent_platform())) + + if self.settings.os in ["Macos", "Linux"]: + self.cpp_info.system_libs = ["dl", "pthread"] + if self.settings.os == 'Macos': + self.cpp_info.frameworks = ["CoreFoundation", 'Cocoa', 'AppKit'] + if self.settings.os == 'Windows': + self.cpp_info.system_libs = ["dxgi", "shlwapi"] diff --git a/recipes/diligent-core/all/patches/0001-remove_warning_as_error.patch b/recipes/diligent-core/all/patches/0001-remove_warning_as_error.patch new file mode 100644 index 0000000000000..0bb985efa0bb4 --- /dev/null +++ b/recipes/diligent-core/all/patches/0001-remove_warning_as_error.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c8fa3c2a2..15dd0f60e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -296,7 +296,7 @@ if(MSVC) + # - w4100 - unreferenced formal parameter + # - w4201 - nonstandard extension used: nameless struct/union + # - w4505 - unreferenced local function has been removed +- target_compile_options(Diligent-BuildSettings INTERFACE /W4 /WX /wd4100 /wd4201 /wd4505 /MP) ++ target_compile_options(Diligent-BuildSettings INTERFACE /W1 /wd4100 /wd4201 /wd4505 /MP) + # In all release modes also: + # - disable w4189 - local variable is initialized but not referenced + # - Disable RTTI (/GR-) +@@ -343,7 +343,7 @@ endif() + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(Diligent-BuildSettings INTERFACE + # All warnings are errors +- -Werror ++ + # Some extra warnings + -Wall -Wextra -Wuninitialized -Wconditional-uninitialized -Wextra-tokens -Wpointer-arith -Wloop-analysis -Wunused + # Disable few warnings +@@ -427,7 +427,6 @@ add_subdirectory(Primitives) + add_subdirectory(Platforms) + add_subdirectory(Common) + add_subdirectory(Graphics) +-add_subdirectory(Tests) + + + # Installation instructions diff --git a/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch b/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch new file mode 100644 index 0000000000000..b6e7c03e3b6d6 --- /dev/null +++ b/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch @@ -0,0 +1,93 @@ +diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt +index e329495f..d61520cd 100644 +--- a/ThirdParty/CMakeLists.txt ++++ b/ThirdParty/CMakeLists.txt +@@ -23,9 +23,6 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + # do not really need any target from the project. + #add_subdirectory(SPIRV-Headers) + #set_directory_root_folder("SPIRV-Headers" "ThirdParty/DiligentCore/SPIRV-Headers") +- install(FILES SPIRV-Headers/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Headers-License.txt) +- +- install(FILES Vulkan-Headers/LICENSE.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME Vulkan-Headers-License.txt) + + option(DILIGENT_NO_GLSLANG "Do NOT build glslang compiler" OFF) + option(DILIGENT_IMPROVE_SPIRV_TOOLS_DEBUG_PERF "Enable some optimizations for SPIRV-Tools, glslang, SPIRV-Cross and related projects in debug build to improve performance" ON) +@@ -41,15 +38,9 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(SPIRV_CHECK_CONTEXT OFF CACHE BOOL "Do not check if the IR context is in a valid state") + endif() + set(CMAKE_MACOSX_RPATH TRUE) +- add_subdirectory(SPIRV-Tools) +- set_directory_root_folder("SPIRV-Tools" "DiligentCore/ThirdParty/SPIRV-Tools") + # We only need SPIRV-Tools-opt for glslang that also depends on SPIRV-Tools-static. + # Exclude all other targets from the build to save build time +- set(SPIRV_TOOLS_EXCLUDE_TARGETS SPIRV-Tools-link SPIRV-Tools-reduce SPIRV-Tools-shared) +- set_target_properties(${SPIRV_TOOLS_EXCLUDE_TARGETS} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) + +- set(THIRD_PARTY_LIBS SPIRV-Tools-static SPIRV-Tools-opt) +- install(FILES SPIRV-Tools/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Tools-License.txt) + endif() + + if(NOT ${DILIGENT_NO_GLSLANG}) +@@ -57,14 +48,9 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(ENABLE_SPVREMAPPER OFF CACHE BOOL "Do not build SPIRV remapper") + set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "Skip glslang installation") + set(ENABLE_CTEST OFF CACHE BOOL "Disable testing") +- add_subdirectory(glslang) +- set_directory_root_folder("glslang" "DiligentCore/ThirdParty/glslang") + + # glslang "kindly" sets global CMAKE_DEBUG_POSTFIX to "d", which we have to unset now + unset(CMAKE_DEBUG_POSTFIX CACHE) +- +- list(APPEND THIRD_PARTY_LIBS GenericCodeGen glslang OGLCompiler OSDependent SPIRV HLSL MachineIndependent) +- install(FILES glslang/LICENSE.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME GLSLang-License.txt) + endif() + + set(SPIRV_CROSS_CLI OFF CACHE BOOL "Build the CLI binary. Requires SPIRV_CROSS_STATIC.") +@@ -80,37 +66,11 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(SPIRV_CROSS_FORCE_PIC ON CACHE BOOL "Force position-independent code.") + set(SPIRV_CROSS_SKIP_INSTALL ON CACHE BOOL "Skip SPIRV-Cross installation.") + set(SPIRV_CROSS_NAMESPACE_OVERRIDE diligent_spirv_cross CACHE STRING "Override the namespace used in the C++ API.") +- add_subdirectory(SPIRV-Cross) +- set_directory_root_folder("SPIRV-Cross" "DiligentCore/ThirdParty/SPIRV-Cross") +- +- list(APPEND THIRD_PARTY_LIBS spirv-cross-core) +- if(METAL_SUPPORTED) +- list(APPEND THIRD_PARTY_LIBS spirv-cross-msl spirv-cross-glsl) +- endif() +- install(FILES SPIRV-Cross/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Cross-License.txt) +- +- if(DILIGENT_INSTALL_CORE) +- install(TARGETS ${THIRD_PARTY_LIBS} +- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" +- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" +- ) +- endif() + +- if(${DILIGENT_IMPROVE_SPIRV_TOOLS_DEBUG_PERF} AND MSVC) +- # Enable function inlining (/Ob1) in Debug build to improve shader compilation performance +- foreach(TARGET ${THIRD_PARTY_LIBS}) +- target_compile_options(${TARGET} PRIVATE "$<$:/Ob1>") +- endforeach() +- endif() ++ list(APPEND THIRD_PARTY_LIBS SPIRV-Tools-opt spirv-cross-msl spirv-cross-glsl glslang::SPIRV glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::OSDependent glslang::OGLCompiler glslang::HLSL) + + # Make sure that symbols do not leak out when third-party + # libs are linked into shared libraries +- set_target_properties(${THIRD_PARTY_LIBS} PROPERTIES +- CXX_VISIBILITY_PRESET hidden # -fvisibility=hidden +- C_VISIBILITY_PRESET hidden # -fvisibility=hidden +- VISIBILITY_INLINES_HIDDEN TRUE +- ) + endif() + + if(${DILIGENT_BUILD_GOOGLE_TEST}) +@@ -126,8 +86,3 @@ if(${DILIGENT_BUILD_GOOGLE_TEST}) + ) + endif() + +-install(FILES googletest/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME googletest-License.txt) +-install(FILES stb/stb_image_write_license.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}") +-install(FILES volk/LICENSE.md DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME Volk-License.md) +-install(FILES DirectXShaderCompiler/LICENSE.TXT DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME DXC-License.txt) +-install(FILES DirectXShaderCompiler/ThirdPartyNotices.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME DXC-ThirdPartyNotices.txt) diff --git a/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch b/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch new file mode 100644 index 0000000000000..3a247cb516390 --- /dev/null +++ b/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch @@ -0,0 +1,40 @@ +diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt +index e760513d..a0d2de9c 100644 +--- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt ++++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt +@@ -156,7 +156,8 @@ target_include_directories(Diligent-GraphicsEngineVk-static + PRIVATE + include + ../../ThirdParty +- ../../ThirdParty/Vulkan-Headers/include ++${VulkanHeaders_INCLUDE_DIR} ++${volk_INCLUDE_DIR}/ + ) + + set(PRIVATE_DEPENDENCIES +diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h +index ad00815a..65b3753c 100644 +--- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h ++++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h +@@ -37,7 +37,7 @@ + #define VK_FORMAT_RANGE_SIZE (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1) + + #if DILIGENT_USE_VOLK +-# include "volk/volk.h" ++# include "volk.h" + #endif + + #ifdef _WINBASE_ +diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp +index 6e0a8e42..5fbf4b20 100644 +--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp ++++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp +@@ -34,7 +34,7 @@ + + #if DILIGENT_USE_VOLK + # define VOLK_IMPLEMENTATION +-# include "volk/volk.h" ++# include "volk.h" + #endif + + #include "VulkanErrors.hpp" diff --git a/recipes/diligent-core/all/patches/0005-spirv-cross-namespace-override.patch b/recipes/diligent-core/all/patches/0005-spirv-cross-namespace-override.patch new file mode 100644 index 0000000000000..d966a41920467 --- /dev/null +++ b/recipes/diligent-core/all/patches/0005-spirv-cross-namespace-override.patch @@ -0,0 +1,142 @@ +diff --git a/Graphics/ShaderTools/include/SPIRVShaderResources.hpp b/Graphics/ShaderTools/include/SPIRVShaderResources.hpp +index 6f3bec87b..842b485b3 100644 +--- a/Graphics/ShaderTools/include/SPIRVShaderResources.hpp ++++ b/Graphics/ShaderTools/include/SPIRVShaderResources.hpp +@@ -47,11 +47,17 @@ + #include "RefCntAutoPtr.hpp" + #include "StringPool.hpp" + +-namespace diligent_spirv_cross ++#ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE ++#define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE ++#else ++#define SPIRV_CROSS_NAMESPACE spirv_cross ++#endif ++ ++namespace SPIRV_CROSS_NAMESPACE + { + class Compiler; + struct Resource; +-} // namespace diligent_spirv_cross ++} // namespace SPIRV_CROSS_NAMESPACE + + namespace Diligent + { +@@ -98,8 +104,8 @@ struct SPIRVShaderResourceAttribs + + // clang-format on + +- SPIRVShaderResourceAttribs(const diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& Res, ++ SPIRVShaderResourceAttribs(const SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& Res, + const char* _Name, + ResourceType _Type, + Uint32 _BufferStaticSize = 0, +diff --git a/Graphics/ShaderTools/src/SPIRVShaderResources.cpp b/Graphics/ShaderTools/src/SPIRVShaderResources.cpp +index c8badc818..c9f8f2171 100644 +--- a/Graphics/ShaderTools/src/SPIRVShaderResources.cpp ++++ b/Graphics/ShaderTools/src/SPIRVShaderResources.cpp +@@ -38,8 +38,8 @@ namespace Diligent + { + + template +-Type GetResourceArraySize(const diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& Res) ++Type GetResourceArraySize(const SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& Res) + { + const auto& type = Compiler.get_type(Res.type_id); + uint32_t arrSize = 1; +@@ -53,12 +53,12 @@ Type GetResourceArraySize(const diligent_spirv_cross::Compiler& Compiler, + return static_cast(arrSize); + } + +-static RESOURCE_DIMENSION GetResourceDimension(const diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& Res) ++static RESOURCE_DIMENSION GetResourceDimension(const SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& Res) + { + const auto& type = Compiler.get_type(Res.type_id); +- if (type.basetype == diligent_spirv_cross::SPIRType::BaseType::Image || +- type.basetype == diligent_spirv_cross::SPIRType::BaseType::SampledImage) ++ if (type.basetype == SPIRV_CROSS_NAMESPACE::SPIRType::BaseType::Image || ++ type.basetype == SPIRV_CROSS_NAMESPACE::SPIRType::BaseType::SampledImage) + { + switch (type.image.dim) + { +@@ -78,12 +78,12 @@ static RESOURCE_DIMENSION GetResourceDimension(const diligent_spirv_cross::Compi + } + } + +-static bool IsMultisample(const diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& Res) ++static bool IsMultisample(const SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& Res) + { + const auto& type = Compiler.get_type(Res.type_id); +- if (type.basetype == diligent_spirv_cross::SPIRType::BaseType::Image || +- type.basetype == diligent_spirv_cross::SPIRType::BaseType::SampledImage) ++ if (type.basetype == SPIRV_CROSS_NAMESPACE::SPIRType::BaseType::Image || ++ type.basetype == SPIRV_CROSS_NAMESPACE::SPIRType::BaseType::SampledImage) + { + return type.image.ms; + } +@@ -93,8 +93,8 @@ static bool IsMultisample(const diligent_spirv_cross::Compiler& Compiler, + } + } + +-static uint32_t GetDecorationOffset(const diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& Res, ++static uint32_t GetDecorationOffset(const SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& Res, + spv::Decoration Decoration) + { + VERIFY(Compiler.has_decoration(Res.id, Decoration), "Resource \'", Res.name, "\' has no requested decoration"); +@@ -105,8 +105,8 @@ static uint32_t GetDecorationOffset(const diligent_spirv_cross::Compiler& Compil + return offset; + } + +-SPIRVShaderResourceAttribs::SPIRVShaderResourceAttribs(const diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& Res, ++SPIRVShaderResourceAttribs::SPIRVShaderResourceAttribs(const SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& Res, + const char* _Name, + ResourceType _Type, + Uint32 _BufferStaticSize, +@@ -222,9 +222,9 @@ spv::ExecutionModel ShaderTypeToSpvExecutionModel(SHADER_TYPE ShaderType) + } + } + +-const std::string& GetUBName(diligent_spirv_cross::Compiler& Compiler, +- const diligent_spirv_cross::Resource& UB, +- const diligent_spirv_cross::ParsedIR::Source& IRSource) ++const std::string& GetUBName(SPIRV_CROSS_NAMESPACE::Compiler& Compiler, ++ const SPIRV_CROSS_NAMESPACE::Resource& UB, ++ const SPIRV_CROSS_NAMESPACE::ParsedIR::Source& IRSource) + { + // Consider the following HLSL constant buffer: + // +@@ -269,11 +269,11 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, + m_ShaderType{shaderDesc.ShaderType} + { + // https://github.com/KhronosGroup/SPIRV-Cross/wiki/Reflection-API-user-guide +- diligent_spirv_cross::Parser parser(move(spirv_binary)); ++ SPIRV_CROSS_NAMESPACE::Parser parser(move(spirv_binary)); + parser.parse(); + const auto ParsedIRSource = parser.get_parsed_ir().source; + m_IsHLSLSource = ParsedIRSource.hlsl; +- diligent_spirv_cross::Compiler Compiler(std::move(parser.get_parsed_ir())); ++ SPIRV_CROSS_NAMESPACE::Compiler Compiler(std::move(parser.get_parsed_ir())); + + spv::ExecutionModel ExecutionModel = ShaderTypeToSpvExecutionModel(shaderDesc.ShaderType); + auto EntryPoints = Compiler.get_entry_points_and_stages(); +@@ -298,7 +298,7 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, + Compiler.set_entry_point(EntryPoint, ExecutionModel); + + // The SPIR-V is now parsed, and we can perform reflection on it. +- diligent_spirv_cross::ShaderResources resources = Compiler.get_shader_resources(); ++ SPIRV_CROSS_NAMESPACE::ShaderResources resources = Compiler.get_shader_resources(); + + size_t ResourceNamesPoolSize = 0; + for (const auto& ub : resources.uniform_buffers) diff --git a/recipes/diligent-core/all/patches/0006-install-linux-platform-header.diff b/recipes/diligent-core/all/patches/0006-install-linux-platform-header.diff new file mode 100644 index 0000000000000..a1af22db1a7f4 --- /dev/null +++ b/recipes/diligent-core/all/patches/0006-install-linux-platform-header.diff @@ -0,0 +1,120 @@ +commit 7b5536cfee83af507b9182ca7f8035b69d6af6bd +Author: assiduous +Date: Thu Feb 17 07:57:41 2022 -0800 + + CMake: added install instructions for required Linux platform headers for Apple, Emscriptent and Android (fixed DiligentGraphics/DiligentTools#161) + +diff --git a/Platforms/Android/CMakeLists.txt b/Platforms/Android/CMakeLists.txt +index 8d9ef237f..724e41faa 100644 +--- a/Platforms/Android/CMakeLists.txt ++++ b/Platforms/Android/CMakeLists.txt +@@ -8,6 +8,7 @@ set(INTERFACE + interface/AndroidPlatformDefinitions.h + interface/AndroidPlatformMisc.hpp + interface/AndroidNativeWindow.h ++ ../Linux/interface/LinuxPlatformMisc.hpp + ) + + set(SOURCE +@@ -34,8 +35,8 @@ PUBLIC + ) + + source_group("src" FILES ${SOURCE}) +-source_group("include" FILES ${INCLUDE}) +-source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) ++source_group("interface\\android" FILES ${INTERFACE}) ++source_group("interface\\common" FILES ${PLATFORM_INTERFACE_HEADERS}) + + set_target_properties(Diligent-AndroidPlatform PROPERTIES + FOLDER DiligentCore/Platforms +@@ -43,4 +44,9 @@ set_target_properties(Diligent-AndroidPlatform PROPERTIES + + if(DILIGENT_INSTALL_CORE) + install_core_lib(Diligent-AndroidPlatform) ++ ++ get_target_relative_dir(Diligent-AndroidPlatform RELATIVE_PATH) ++ install(DIRECTORY ../Linux/interface ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${RELATIVE_PATH}/../Linux" ++ ) + endif() +diff --git a/Platforms/Apple/CMakeLists.txt b/Platforms/Apple/CMakeLists.txt +index 643c06aac..2d0f19c6d 100644 +--- a/Platforms/Apple/CMakeLists.txt ++++ b/Platforms/Apple/CMakeLists.txt +@@ -16,6 +16,7 @@ set(INTERFACE + interface/AppleFileSystem.hpp + interface/ApplePlatformDefinitions.h + interface/ApplePlatformMisc.hpp ++ ../Linux/interface/LinuxPlatformMisc.hpp + ${APPLE_NATIVE_WINDOW_H} + ) + +@@ -61,8 +62,8 @@ elseif(PLATFORM_TVOS) + endif() + + source_group("src" FILES ${SOURCE}) +-source_group("include" FILES ${INCLUDE}) +-source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) ++source_group("interface\\apple" FILES ${INTERFACE}) ++source_group("interface\\common" FILES ${PLATFORM_INTERFACE_HEADERS}) + + set_target_properties(Diligent-ApplePlatform PROPERTIES + FOLDER DiligentCore/Platforms +@@ -70,4 +71,9 @@ set_target_properties(Diligent-ApplePlatform PROPERTIES + + if(DILIGENT_INSTALL_CORE) + install_core_lib(Diligent-ApplePlatform) ++ ++ get_target_relative_dir(Diligent-ApplePlatform RELATIVE_PATH) ++ install(DIRECTORY ../Linux/interface ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${RELATIVE_PATH}/../Linux" ++ ) + endif() +diff --git a/Platforms/Emscripten/CMakeLists.txt b/Platforms/Emscripten/CMakeLists.txt +index 9d19518d9..4012f6bc3 100644 +--- a/Platforms/Emscripten/CMakeLists.txt ++++ b/Platforms/Emscripten/CMakeLists.txt +@@ -8,6 +8,7 @@ set(INTERFACE + interface/EmscriptenPlatformDefinitions.h + interface/EmscriptenPlatformMisc.hpp + interface/EmscriptenNativeWindow.h ++ ../Linux/interface/LinuxPlatformMisc.hpp + ) + + set(SOURCE +@@ -32,8 +33,8 @@ PUBLIC + ) + + source_group("src" FILES ${SOURCE}) +-source_group("include" FILES ${INCLUDE}) +-source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) ++source_group("interface\\emscripten" FILES ${INTERFACE}) ++source_group("interface\\common" FILES ${PLATFORM_INTERFACE_HEADERS}) + + set_target_properties(Diligent-EmscriptenPlatform PROPERTIES + FOLDER DiligentCore/Platforms +@@ -41,4 +42,9 @@ set_target_properties(Diligent-EmscriptenPlatform PROPERTIES + + if(DILIGENT_INSTALL_CORE) + install_core_lib(Diligent-EmscriptenPlatform) ++ ++ get_target_relative_dir(Diligent-EmscriptenPlatform RELATIVE_PATH) ++ install(DIRECTORY ../Linux/interface ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${RELATIVE_PATH}/../Linux" ++ ) + endif() +diff --git a/Platforms/Linux/CMakeLists.txt b/Platforms/Linux/CMakeLists.txt +index 558673dd8..db113331c 100644 +--- a/Platforms/Linux/CMakeLists.txt ++++ b/Platforms/Linux/CMakeLists.txt +@@ -32,8 +32,8 @@ PUBLIC + ) + + source_group("src" FILES ${SOURCE}) +-source_group("include" FILES ${INCLUDE}) +-source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) ++source_group("interface\\linux" FILES ${INTERFACE}) ++source_group("interface\\common" FILES ${PLATFORM_INTERFACE_HEADERS}) + + set_target_properties(Diligent-LinuxPlatform PROPERTIES + FOLDER DiligentCore/Platforms diff --git a/recipes/diligent-core/all/patches/0007-API250014-remove_warning_as_error.patch b/recipes/diligent-core/all/patches/0007-API250014-remove_warning_as_error.patch new file mode 100644 index 0000000000000..caf983be16889 --- /dev/null +++ b/recipes/diligent-core/all/patches/0007-API250014-remove_warning_as_error.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c527cc4cd..bc7de0420 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -304,7 +304,7 @@ if(MSVC) + # - w4100 - unreferenced formal parameter + # - w4201 - nonstandard extension used: nameless struct/union + # - w4505 - unreferenced local function has been removed +- target_compile_options(Diligent-BuildSettings INTERFACE /W4 /WX /wd4100 /wd4201 /wd4505 /MP) ++ target_compile_options(Diligent-BuildSettings INTERFACE /W1 /wd4100 /wd4201 /wd4505 /MP) + # In all release modes also: + # - disable w4189 - local variable is initialized but not referenced + # - Disable RTTI (/GR-) +@@ -351,7 +351,7 @@ endif() + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(Diligent-BuildSettings INTERFACE + # All warnings are errors +- -Werror ++ + # Some extra warnings + -Wall -Wextra -Wuninitialized -Wconditional-uninitialized -Wextra-tokens -Wpointer-arith -Wloop-analysis -Wunused + # Disable few warnings +@@ -441,7 +441,6 @@ add_subdirectory(Primitives) + add_subdirectory(Platforms) + add_subdirectory(Common) + add_subdirectory(Graphics) +-add_subdirectory(Tests) + + + # Installation instructions diff --git a/recipes/diligent-core/all/patches/0009-API250014-use_conan_dependencies_in_third_party.patch b/recipes/diligent-core/all/patches/0009-API250014-use_conan_dependencies_in_third_party.patch new file mode 100644 index 0000000000000..28b9e92435870 --- /dev/null +++ b/recipes/diligent-core/all/patches/0009-API250014-use_conan_dependencies_in_third_party.patch @@ -0,0 +1,100 @@ +diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt +index d7eea08a..e457b9b6 100644 +--- a/ThirdParty/CMakeLists.txt ++++ b/ThirdParty/CMakeLists.txt +@@ -23,9 +23,6 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + # do not really need any target from the project. + #add_subdirectory(SPIRV-Headers) + #set_directory_root_folder("SPIRV-Headers" "ThirdParty/DiligentCore/SPIRV-Headers") +- install(FILES SPIRV-Headers/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Headers-License.txt) +- +- install(FILES Vulkan-Headers/LICENSE.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME Vulkan-Headers-License.txt) + + option(DILIGENT_NO_GLSLANG "Do NOT build glslang compiler" OFF) + option(DILIGENT_IMPROVE_SPIRV_TOOLS_DEBUG_PERF "Enable some optimizations for SPIRV-Tools, glslang, SPIRV-Cross and related projects in debug build to improve performance" ON) +@@ -41,15 +38,8 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(SPIRV_CHECK_CONTEXT OFF CACHE BOOL "Do not check if the IR context is in a valid state") + endif() + set(CMAKE_MACOSX_RPATH TRUE) +- add_subdirectory(SPIRV-Tools) +- set_directory_root_folder("SPIRV-Tools" "DiligentCore/ThirdParty/SPIRV-Tools") + # We only need SPIRV-Tools-opt for glslang that also depends on SPIRV-Tools-static. + # Exclude all other targets from the build to save build time +- set(SPIRV_TOOLS_EXCLUDE_TARGETS SPIRV-Tools-link SPIRV-Tools-lint SPIRV-Tools-reduce SPIRV-Tools-shared) +- set_target_properties(${SPIRV_TOOLS_EXCLUDE_TARGETS} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) +- +- set(THIRD_PARTY_LIBS SPIRV-Tools-static SPIRV-Tools-opt) +- install(FILES SPIRV-Tools/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Tools-License.txt) + endif() + + if(NOT ${DILIGENT_NO_GLSLANG}) +@@ -57,14 +47,8 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(ENABLE_SPVREMAPPER OFF CACHE BOOL "Do not build SPIRV remapper") + set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "Skip glslang installation") + set(ENABLE_CTEST OFF CACHE BOOL "Disable testing") +- add_subdirectory(glslang) +- set_directory_root_folder("glslang" "DiligentCore/ThirdParty/glslang") + + # glslang "kindly" sets global CMAKE_DEBUG_POSTFIX to "d", which we have to unset now +- unset(CMAKE_DEBUG_POSTFIX CACHE) +- +- list(APPEND THIRD_PARTY_LIBS GenericCodeGen glslang OGLCompiler OSDependent SPIRV HLSL MachineIndependent) +- install(FILES glslang/LICENSE.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME GLSLang-License.txt) + endif() + + set(SPIRV_CROSS_CLI OFF CACHE BOOL "Build the CLI binary. Requires SPIRV_CROSS_STATIC.") +@@ -80,37 +64,9 @@ if(VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(SPIRV_CROSS_FORCE_PIC ON CACHE BOOL "Force position-independent code.") + set(SPIRV_CROSS_SKIP_INSTALL ON CACHE BOOL "Skip SPIRV-Cross installation.") + set(SPIRV_CROSS_NAMESPACE_OVERRIDE diligent_spirv_cross CACHE STRING "Override the namespace used in the C++ API.") +- add_subdirectory(SPIRV-Cross) +- set_directory_root_folder("SPIRV-Cross" "DiligentCore/ThirdParty/SPIRV-Cross") +- +- list(APPEND THIRD_PARTY_LIBS spirv-cross-core) +- if(METAL_SUPPORTED) +- list(APPEND THIRD_PARTY_LIBS spirv-cross-msl spirv-cross-glsl) +- endif() +- install(FILES SPIRV-Cross/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Cross-License.txt) +- +- if(DILIGENT_INSTALL_CORE) +- install(TARGETS ${THIRD_PARTY_LIBS} +- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" +- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" +- ) +- endif() +- +- if(${DILIGENT_IMPROVE_SPIRV_TOOLS_DEBUG_PERF} AND MSVC) +- # Enable function inlining (/Ob1) in Debug build to improve shader compilation performance +- foreach(TARGET ${THIRD_PARTY_LIBS}) +- target_compile_options(${TARGET} PRIVATE "$<$:/Ob1>") +- endforeach() +- endif() +- ++ list(APPEND THIRD_PARTY_LIBS SPIRV-Tools-opt spirv-cross-msl spirv-cross-glsl glslang::SPIRV glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::OSDependent glslang::OGLCompiler glslang::HLSL xxHash::xxhash) + # Make sure that symbols do not leak out when third-party + # libs are linked into shared libraries +- set_target_properties(${THIRD_PARTY_LIBS} PROPERTIES +- CXX_VISIBILITY_PRESET hidden # -fvisibility=hidden +- C_VISIBILITY_PRESET hidden # -fvisibility=hidden +- VISIBILITY_INLINES_HIDDEN TRUE +- ) + endif() + + if(${DILIGENT_BUILD_GOOGLE_TEST}) +@@ -127,15 +83,4 @@ if(${DILIGENT_BUILD_GOOGLE_TEST}) + endif() + + option(BUILD_SHARED_LIBS "Build shared library" OFF) +-set(XXHASH_BUILD_XXHSUM OFF) +-set(XXHASH_BUILD_ENABLE_INLINE_API OFF) +-add_subdirectory(xxHash/cmake_unofficial) +-set_directory_root_folder("xxHash/cmake_unofficial" "DiligentCore/ThirdParty/xxHash") + +-install(FILES xxHash/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME XXH3-License.txt) +-install(FILES googletest/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME googletest-License.txt) +-install(FILES stb/stb_image_write_license.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}") +-install(FILES volk/LICENSE.md DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME Volk-License.md) +-install(FILES DirectXShaderCompiler/LICENSE.TXT DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME DXC-License.txt) +-install(FILES DirectXShaderCompiler/ThirdPartyNotices.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME DXC-ThirdPartyNotices.txt) +-install(FILES xxHash/LICENSE DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME xxHash-License.txt) diff --git a/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch b/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch new file mode 100644 index 0000000000000..fd00b73de0f8b --- /dev/null +++ b/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch @@ -0,0 +1,40 @@ +diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt +index 34451f2dd..d61797325 100644 +--- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt ++++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt +@@ -165,7 +165,8 @@ target_include_directories(Diligent-GraphicsEngineVk-static + PRIVATE + include + ../../ThirdParty +- ../../ThirdParty/Vulkan-Headers/include ++${VulkanHeaders_INCLUDE_DIR} ++${volk_INCLUDE_DIR}/ + ) + + set(PRIVATE_DEPENDENCIES +diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h +index 50f25dcdd..cf1c301aa 100644 +--- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h ++++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanHeaders.h +@@ -41,7 +41,7 @@ + #define VK_FORMAT_RANGE_SIZE (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1) + + #if DILIGENT_USE_VOLK +-# include "volk/volk.h" ++# include "volk.h" + #endif + + #if PLATFORM_WIN32 +diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp +index bd293feb2..6b42a243e 100644 +--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp ++++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp +@@ -34,7 +34,7 @@ + + #if DILIGENT_USE_VOLK + # define VOLK_IMPLEMENTATION +-# include "volk/volk.h" ++# include "volk.h" + #endif + + #include "VulkanErrors.hpp" diff --git a/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch b/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch new file mode 100644 index 0000000000000..c6f5c58e9c39c --- /dev/null +++ b/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch @@ -0,0 +1,14 @@ +diff --git a/Graphics/Archiver/CMakeLists.txt b/Graphics/Archiver/CMakeLists.txt +index 1552937ce..73c77158e 100644 +--- a/Graphics/Archiver/CMakeLists.txt ++++ b/Graphics/Archiver/CMakeLists.txt +@@ -116,7 +116,8 @@ if(VULKAN_SUPPORTED) + target_include_directories(Diligent-Archiver-static + PRIVATE + ../GraphicsEngineVulkan/include +- ../../ThirdParty/Vulkan-Headers/include ++ ${VulkanHeaders_INCLUDE_DIR} ++ ${volk_INCLUDE_DIR}/ + ) + endif() + diff --git a/recipes/diligent-core/all/patches/0014-252-exclude-tests.patch b/recipes/diligent-core/all/patches/0014-252-exclude-tests.patch new file mode 100644 index 0000000000000..e9b971b287199 --- /dev/null +++ b/recipes/diligent-core/all/patches/0014-252-exclude-tests.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 88c4ba53..0b094735 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -446,7 +446,7 @@ add_subdirectory(Primitives) + add_subdirectory(Platforms) + add_subdirectory(Common) + add_subdirectory(Graphics) +-add_subdirectory(Tests) ++#add_subdirectory(Tests) + + + # Installation instructions diff --git a/recipes/diligent-core/all/patches/0015-252-dont-install-3d-party-license.patch b/recipes/diligent-core/all/patches/0015-252-dont-install-3d-party-license.patch new file mode 100644 index 0000000000000..2b626adc16205 --- /dev/null +++ b/recipes/diligent-core/all/patches/0015-252-dont-install-3d-party-license.patch @@ -0,0 +1,78 @@ +diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt +index a77ab3d7..86606aeb 100644 +--- a/ThirdParty/CMakeLists.txt ++++ b/ThirdParty/CMakeLists.txt +@@ -15,7 +15,6 @@ if (GL_SUPPORTED AND (PLATFORM_WIN32 OR PLATFORM_LINUX OR PLATFORM_MACOS) AND (N + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" + ) + endif() +- install(FILES glew/LICENSE.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME GLEW-License.txt) + endif() + + if (VULKAN_SUPPORTED OR METAL_SUPPORTED) +@@ -26,7 +25,6 @@ if (VULKAN_SUPPORTED OR METAL_SUPPORTED) + # Note that SPIRV-Headers_SOURCE_DIR variable is normally created by project(SPIRV-Headers) + set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Headers") + target_include_directories(SPIRV-Headers INTERFACE "${SPIRV-Headers_SOURCE_DIR}/include") +- install(FILES "${SPIRV-Headers_SOURCE_DIR}/LICENSE" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Headers-License.txt) + endif() + + if (NOT TARGET Vulkan::Headers) +@@ -37,7 +35,6 @@ if (VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(Vulkan-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers") + add_library(Vulkan::Headers ALIAS Vulkan-Headers) + target_include_directories(Vulkan-Headers INTERFACE "${Vulkan-Headers_SOURCE_DIR}/include") +- install(FILES "${Vulkan-Headers_SOURCE_DIR}/LICENSE.txt" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME Vulkan-Headers-License.txt) + endif() + + option(DILIGENT_NO_GLSLANG "Do NOT build glslang compiler" OFF) +@@ -61,7 +58,6 @@ if (VULKAN_SUPPORTED OR METAL_SUPPORTED) + set_target_properties(${SPIRV_TOOLS_EXCLUDE_TARGETS} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) + + set(THIRD_PARTY_LIBS SPIRV-Tools-static SPIRV-Tools-opt) +- install(FILES "${spirv-tools_SOURCE_DIR}/LICENSE" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Tools-License.txt) + endif() + + if (NOT ${DILIGENT_NO_GLSLANG} AND (NOT TARGET glslang)) +@@ -76,7 +72,6 @@ if (VULKAN_SUPPORTED OR METAL_SUPPORTED) + unset(CMAKE_DEBUG_POSTFIX CACHE) + + list(APPEND THIRD_PARTY_LIBS GenericCodeGen glslang OGLCompiler OSDependent SPIRV HLSL MachineIndependent) +- install(FILES "${glslang_SOURCE_DIR}/LICENSE.txt" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME GLSLang-License.txt) + endif() + + if (NOT TARGET spirv-cross-core) +@@ -101,7 +96,6 @@ if (VULKAN_SUPPORTED OR METAL_SUPPORTED) + list(APPEND THIRD_PARTY_LIBS spirv-cross-msl spirv-cross-glsl) + endif() + +- install(FILES "${SPIRV-Cross_SOURCE_DIR}/LICENSE" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME SPIRV-Cross-License.txt) + endif() + + if (DILIGENT_INSTALL_CORE) +@@ -138,7 +132,6 @@ if (VULKAN_SUPPORTED AND (PLATFORM_WIN32 OR PLATFORM_LINUX OR PLATFORM_MACOS OR + EXCLUDE_FROM_DEFAULT_BUILD 1 + FOLDER "DiligentCore/ThirdParty/volk" + ) +- install(FILES "${volk_SOURCE_DIR}/LICENSE.md" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME Volk-License.md) + endif() + + if ((${DILIGENT_BUILD_GOOGLE_TEST}) AND (NOT TARGET gtest)) +@@ -154,7 +147,6 @@ if ((${DILIGENT_BUILD_GOOGLE_TEST}) AND (NOT TARGET gtest)) + ) + + get_target_property(GTEST_SOURCE_DIR gtest SOURCE_DIR) +- install(FILES "googletest/LICENSE" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME googletest-License.txt) + endif() + + if (NOT TARGET xxHash::xxhash) +@@ -163,9 +155,6 @@ if (NOT TARGET xxHash::xxhash) + set(XXHASH_BUILD_ENABLE_INLINE_API OFF) + add_subdirectory(xxHash/cmake_unofficial) + set_directory_root_folder("xxHash/cmake_unofficial" "DiligentCore/ThirdParty/xxHash") +- install(FILES "${xxHash_SOURCE_DIR}/../LICENSE" DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME xxHash-License.txt) + endif() + +-install(FILES stb/stb_image_write_license.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}") +-install(FILES DirectXShaderCompiler/LICENSE.TXT DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME DXC-License.txt) + install(FILES DirectXShaderCompiler/ThirdPartyNotices.txt DESTINATION "Licenses/ThirdParty/${DILIGENT_CORE_DIR}" RENAME DXC-ThirdPartyNotices.txt) diff --git a/recipes/diligent-core/all/patches/0016-252-fix-glslang-usage.patch b/recipes/diligent-core/all/patches/0016-252-fix-glslang-usage.patch new file mode 100644 index 0000000000000..72d343355ab43 --- /dev/null +++ b/recipes/diligent-core/all/patches/0016-252-fix-glslang-usage.patch @@ -0,0 +1,28 @@ +diff --git a/Graphics/ShaderTools/CMakeLists.txt b/Graphics/ShaderTools/CMakeLists.txt +index c2dd85f3..cc83e707 100644 +--- a/Graphics/ShaderTools/CMakeLists.txt ++++ b/Graphics/ShaderTools/CMakeLists.txt +@@ -150,8 +150,8 @@ if(ENABLE_SPIRV) + if (${USE_GLSLANG}) + target_link_libraries(Diligent-ShaderTools + PRIVATE +- SPIRV +- glslang ++ SPIRV-Tools-opt ++ glslang::SPIRV glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::OSDependent glslang::OGLCompiler glslang::HLSL + ) + endif() + endif() +diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt +index 86606aeb..f2d84497 100644 +--- a/ThirdParty/CMakeLists.txt ++++ b/ThirdParty/CMakeLists.txt +@@ -60,7 +60,7 @@ if (VULKAN_SUPPORTED OR METAL_SUPPORTED) + set(THIRD_PARTY_LIBS SPIRV-Tools-static SPIRV-Tools-opt) + endif() + +- if (NOT ${DILIGENT_NO_GLSLANG} AND (NOT TARGET glslang)) ++ if (NOT ${DILIGENT_NO_GLSLANG} AND (NOT TARGET glslang::glslang)) + set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "Do not build glslang binaries") + set(ENABLE_SPVREMAPPER OFF CACHE BOOL "Do not build SPIRV remapper") + set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "Skip glslang installation") diff --git a/recipes/diligent-core/all/patches/0017-252-fix-glslang-include.patch b/recipes/diligent-core/all/patches/0017-252-fix-glslang-include.patch new file mode 100644 index 0000000000000..592bf3d4e8cf9 --- /dev/null +++ b/recipes/diligent-core/all/patches/0017-252-fix-glslang-include.patch @@ -0,0 +1,13 @@ +diff --git a/Graphics/ShaderTools/src/GLSLangUtils.cpp b/Graphics/ShaderTools/src/GLSLangUtils.cpp +index eb2f4a9a..085bc61b 100644 +--- a/Graphics/ShaderTools/src/GLSLangUtils.cpp ++++ b/Graphics/ShaderTools/src/GLSLangUtils.cpp +@@ -34,7 +34,7 @@ + # include + #else + # define ENABLE_HLSL +-# include "SPIRV/GlslangToSpv.h" ++# include + #endif + + #include "GLSLangUtils.hpp" diff --git a/recipes/diligent-core/all/patches/0018-252-fix-warning-as-error.patch b/recipes/diligent-core/all/patches/0018-252-fix-warning-as-error.patch new file mode 100644 index 0000000000000..8c5572bcaa2b4 --- /dev/null +++ b/recipes/diligent-core/all/patches/0018-252-fix-warning-as-error.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0b094735..de80eb1e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -304,7 +304,7 @@ if(MSVC) + # - w4100 - unreferenced formal parameter + # - w4201 - nonstandard extension used: nameless struct/union + # - w4505 - unreferenced local function has been removed +- target_compile_options(Diligent-BuildSettings INTERFACE /W4 /WX /wd4100 /wd4201 /wd4505 /MP) ++ target_compile_options(Diligent-BuildSettings INTERFACE /W1 /wd4100 /wd4201 /wd4505 /MP) + # In all release modes also: + # - disable w4189 - local variable is initialized but not referenced + # - Disable RTTI (/GR-) +@@ -353,7 +353,6 @@ endif() + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(Diligent-BuildSettings INTERFACE + # All warnings are errors +- -Werror + # Some extra warnings + -Wall -Wextra -Wuninitialized -Wconditional-uninitialized -Wextra-tokens -Wpointer-arith -Wloop-analysis -Wunused + # Disable few warnings diff --git a/recipes/diligent-core/all/patches/0023-252003-fix-warning-as-error.patch b/recipes/diligent-core/all/patches/0023-252003-fix-warning-as-error.patch new file mode 100644 index 0000000000000..9f05a87c6d918 --- /dev/null +++ b/recipes/diligent-core/all/patches/0023-252003-fix-warning-as-error.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -362,7 +362,7 @@ endif() + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(Diligent-BuildSettings INTERFACE + # All warnings are errors +- -Werror ++ + # Some extra warnings + -Wall -Wextra -Wuninitialized -Wconditional-uninitialized -Wextra-tokens -Wpointer-arith -Wloop-analysis -Wunused + # Disable few warnings diff --git a/recipes/diligent-core/all/test_package/CMakeLists.txt b/recipes/diligent-core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..927e85d16c3ed --- /dev/null +++ b/recipes/diligent-core/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +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(CONVERTED_FILE "${PROJECT_BINARY_DIR}/HLSLDefinitions.h") + +add_custom_command(OUTPUT ${CONVERTED_FILE} + COMMAND ${FILE2STRING_PATH} ${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}) +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 new file mode 100644 index 0000000000000..f2355b8294daf --- /dev/null +++ b/recipes/diligent-core/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/diligent-core/all/test_package/test_package.cpp b/recipes/diligent-core/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..797079ee15abf --- /dev/null +++ b/recipes/diligent-core/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include + +#include "Common/interface/RefCntAutoPtr.hpp" +#include "Graphics/GraphicsEngine/interface/PipelineState.h" +#include "Graphics/GraphicsEngine/interface/SwapChain.h" +#include "Graphics/GraphicsEngine/interface/DeviceContext.h" +#include "Graphics/GraphicsEngine/interface/RenderDevice.h" + +int main() +{ +#ifdef PLATFORM_WIN32 + std::cout << "PLATFORM_WIN32: " << PLATFORM_WIN32; +#endif + +#ifdef PLATFORM_MACOS + std::cout << "PLATFORM_MACOS: " << PLATFORM_MACOS; +#endif + +#ifdef PLATFORM_LINUX + std::cout << "PLATFORM_LINUX: " << PLATFORM_LINUX; +#endif + +#ifdef PLATFORM_ANDROID + std::cout << "PLATFORM_ANDROID: " << PLATFORM_ANDROID; +#endif + +#ifdef PLATFORM_IOS + std::cout << "PLATFORM_IOS: " << PLATFORM_IOS; +#endif + +#ifdef PLATFORM_EMSCRIPTEN + std::cout << "PLATFORM_EMSCRIPTEN: " << PLATFORM_EMSCRIPTEN; +#endif + +#ifdef PLATFORM_TVOS + std::cout << "PLATFORM_TVOS: " << PLATFORM_TVOS; +#endif + + Diligent::RefCntAutoPtr _pDevice; + Diligent::RefCntAutoPtr _pImmediateContext; + Diligent::RefCntAutoPtr _pSwapChain; + return 0; +} diff --git a/recipes/diligent-core/config.yml b/recipes/diligent-core/config.yml new file mode 100644 index 0000000000000..fbdb8d06e169e --- /dev/null +++ b/recipes/diligent-core/config.yml @@ -0,0 +1,15 @@ +versions: + "api.252009": + folder: "all" + "api.252005": + folder: "all" + "api.252004": + folder: "all" + "api.252003": + folder: "all" + "2.5.2": + folder: "all" + "2.5.1": + folder: "all" + "api.250014": + folder: "all" diff --git a/recipes/diligent-fx/all/BuildUtils.cmake b/recipes/diligent-fx/all/BuildUtils.cmake new file mode 100644 index 0000000000000..baedd17d66435 --- /dev/null +++ b/recipes/diligent-fx/all/BuildUtils.cmake @@ -0,0 +1,399 @@ +if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) + + function(copy_required_dlls TARGET_NAME) + if(D3D11_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineD3D11-shared) + endif() + if(D3D12_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineD3D12-shared) + endif() + if(GL_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineOpenGL-shared) + endif() + if(VULKAN_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineVk-shared) + endif() + if(METAL_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineMetal-shared) + endif() + + foreach(DLL ${ENGINE_DLLS}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "\"$\"" + "\"$\"") + endforeach(DLL) + + # Copy D3Dcompiler_47.dll, dxcompiler.dll, and dxil.dll + if(MSVC) + if ((D3D11_SUPPORTED OR D3D12_SUPPORTED) AND VS_D3D_COMPILER_PATH) + # Note that VS_D3D_COMPILER_PATH can only be used in a Visual Studio command + # and is not a valid path during CMake configuration + list(APPEND SHADER_COMPILER_DLLS ${VS_D3D_COMPILER_PATH}) + endif() + + if(D3D12_SUPPORTED AND VS_DXC_COMPILER_PATH AND VS_DXIL_SIGNER_PATH) + # For the compiler to sign the bytecode, you have to have a copy of dxil.dll in + # the same folder as the dxcompiler.dll at runtime. + + # Note that VS_DXC_COMPILER_PATH and VS_DXIL_SIGNER_PATH can only be used in a Visual Studio command + # and are not valid paths during CMake configuration + list(APPEND SHADER_COMPILER_DLLS ${VS_DXC_COMPILER_PATH}) + list(APPEND SHADER_COMPILER_DLLS ${VS_DXIL_SIGNER_PATH}) + endif() + + foreach(DLL ${SHADER_COMPILER_DLLS}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DLL} + "\"$\"") + endforeach(DLL) + + if(D3D12_SUPPORTED AND EXISTS ${DILIGENT_PIX_EVENT_RUNTIME_DLL_PATH}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DILIGENT_PIX_EVENT_RUNTIME_DLL_PATH} + "\"$\"") + endif() + + if(VULKAN_SUPPORTED) + if(NOT DEFINED DILIGENT_DXCOMPILER_FOR_SPIRV_PATH) + message(FATAL_ERROR "DILIGENT_DXCOMPILER_FOR_SPIRV_PATH is undefined, check order of cmake includes") + endif() + if(EXISTS ${DILIGENT_DXCOMPILER_FOR_SPIRV_PATH}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DILIGENT_DXCOMPILER_FOR_SPIRV_PATH} + "\"$/spv_dxcompiler.dll\"") + endif() + endif() + endif() + endfunction() + + function(package_required_dlls TARGET_NAME) + if(D3D12_SUPPORTED AND VS_DXC_COMPILER_PATH AND VS_DXIL_SIGNER_PATH) + # Copy the dlls to the project's CMake binary dir + + # Note that VS_DXC_COMPILER_PATH and VS_DXIL_SIGNER_PATH can only be used in a Visual Studio command + # and are not valid paths during CMake configuration + add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${VS_DXC_COMPILER_PATH} + "\"${CMAKE_CURRENT_BINARY_DIR}/dxcompiler.dll\"" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${VS_DXIL_SIGNER_PATH} + "\"${CMAKE_CURRENT_BINARY_DIR}/dxil.dll\"") + set(DLLS "${CMAKE_CURRENT_BINARY_DIR}/dxcompiler.dll" "${CMAKE_CURRENT_BINARY_DIR}/dxil.dll") + + # Add the dlls to the target project as source files + target_sources(${TARGET_NAME} PRIVATE ${DLLS}) + + # Label them as content + set_source_files_properties(${DLLS} PROPERTIES + GENERATED TRUE + VS_DEPLOYMENT_CONTENT 1 + VS_DEPLOYMENT_LOCATION ".") + endif() + endfunction() + + # Set dll output name by adding _{32|64}{r|d} suffix + function(set_dll_output_name TARGET_NAME OUTPUT_NAME_WITHOUT_SUFFIX) + foreach(DBG_CONFIG ${DEBUG_CONFIGURATIONS}) + set_target_properties(${TARGET_NAME} PROPERTIES + OUTPUT_NAME_${DBG_CONFIG} ${OUTPUT_NAME_WITHOUT_SUFFIX}${DLL_DBG_SUFFIX} + ) + endforeach() + + foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) + set_target_properties(${TARGET_NAME} PROPERTIES + OUTPUT_NAME_${REL_CONFIG} ${OUTPUT_NAME_WITHOUT_SUFFIX}${DLL_REL_SUFFIX} + ) + endforeach() + endfunction() + +endif(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) + + +function(set_common_target_properties TARGET) + + if(COMMAND custom_pre_configure_target) + custom_pre_configure_target(${TARGET}) + if(TARGET_CONFIGURATION_COMPLETE) + return() + endif() + endif() + + get_target_property(TARGET_TYPE ${TARGET} TYPE) + + if(MSVC) + # For msvc, enable link-time code generation for release builds (I was not able to + # find any way to set these settings through interface library BuildSettings) + if(TARGET_TYPE STREQUAL STATIC_LIBRARY) + + foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) + set_target_properties(${TARGET} PROPERTIES + STATIC_LIBRARY_FLAGS_${REL_CONFIG} /LTCG + ) + endforeach() + + else() + + foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS_${REL_CONFIG} "/LTCG /OPT:REF /INCREMENTAL:NO" + ) + endforeach() + + if(PLATFORM_UNIVERSAL_WINDOWS) + # On UWP, disable incremental link to avoid linker warnings + foreach(DBG_CONFIG ${DEBUG_CONFIGURATIONS}) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS_${DBG_CONFIG} "/INCREMENTAL:NO" + ) + endforeach() + endif() + endif() + else() + set_target_properties(${TARGET} PROPERTIES + CXX_VISIBILITY_PRESET hidden # -fvisibility=hidden + C_VISIBILITY_PRESET hidden # -fvisibility=hidden + VISIBILITY_INLINES_HIDDEN TRUE + + # Without -fPIC option GCC fails to link static libraries into dynamic library: + # -fPIC + # If supported for the target machine, emit position-independent code, suitable for + # dynamic linking and avoiding any limit on the size of the global offset table. + POSITION_INDEPENDENT_CODE ON + + # It is crucial to set CXX_STANDARD flag to only affect c++ files and avoid failures compiling c-files: + # error: invalid argument '-std=c++14' not allowed with 'C/ObjC' + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + + C_STANDARD 11 + ) + + if(NOT MINGW_BUILD) + # Do not disable extensions when building with MinGW! + set_target_properties(${TARGET} PROPERTIES + CXX_EXTENSIONS OFF + ) + endif() + endif() + + if(COMMAND custom_post_configure_target) + custom_post_configure_target(${TARGET}) + endif() + +endfunction() + +function(find_targets_in_directory _RESULT _DIR) + get_property(_subdirs DIRECTORY "${_DIR}" PROPERTY SUBDIRECTORIES) + foreach(_subdir IN LISTS _subdirs) + find_targets_in_directory(${_RESULT} "${_subdir}") + endforeach() + get_property(_SUB_TARGETS DIRECTORY "${_DIR}" PROPERTY BUILDSYSTEM_TARGETS) + set(${_RESULT} ${${_RESULT}} ${_SUB_TARGETS} PARENT_SCOPE) +endfunction() + +function(set_directory_root_folder _DIRECTORY _ROOT_FOLDER) + find_targets_in_directory(_TARGETS ${_DIRECTORY}) + foreach(_TARGET IN LISTS _TARGETS) + get_target_property(_FOLDER ${_TARGET} FOLDER) + if(_FOLDER) + set_target_properties(${_TARGET} PROPERTIES FOLDER "${_ROOT_FOLDER}/${_FOLDER}") + else() + set_target_properties(${_TARGET} PROPERTIES FOLDER "${_ROOT_FOLDER}") + endif() + endforeach() +endfunction() + + +# Returns default backend library type (static/dynamic) for the current platform +function(get_backend_libraries_type _LIB_TYPE) + if(PLATFORM_WIN32 OR PLATFORM_LINUX OR PLATFORM_ANDROID OR PLATFORM_UNIVERSAL_WINDOWS OR PLATFORM_MACOS) + set(LIB_TYPE "shared") + elseif(PLATFORM_IOS OR PLATFORM_TVOS OR PLATFORM_EMSCRIPTEN) + # Statically link with the engine on iOS, tvOS and Emscripten. + # It is also possible to link dynamically by + # putting the library into the framework. + set(LIB_TYPE "static") + else() + message(FATAL_ERROR "Undefined platform") + endif() + set(${_LIB_TYPE} ${LIB_TYPE} PARENT_SCOPE) +endfunction() + + +# Adds the list of supported backend targets to variable ${_TARGETS} in parent scope. +# Second argument to the function may override the target type (static/dynamic). If It +# is not given, default target type for the platform is used. +function(get_supported_backends _TARGETS) + if(${ARGC} GREATER 1) + set(LIB_TYPE ${ARGV1}) + else() + get_backend_libraries_type(LIB_TYPE) + endif() + + if(D3D11_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineD3D11-${LIB_TYPE}) + endif() + if(D3D12_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineD3D12-${LIB_TYPE}) + endif() + if(GL_SUPPORTED OR GLES_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineOpenGL-${LIB_TYPE}) + endif() + if(VULKAN_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineVk-${LIB_TYPE}) + endif() + if(METAL_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineMetal-${LIB_TYPE}) + endif() + # ${_TARGETS} == ENGINE_LIBRARIES + # ${${_TARGETS}} == ${ENGINE_LIBRARIES} + set(${_TARGETS} ${${_TARGETS}} ${BACKENDS} PARENT_SCOPE) +endfunction() + + +# Returns path to the target relative to CMake root +function(get_target_relative_dir _TARGET _DIR) + get_target_property(TARGET_SOURCE_DIR ${_TARGET} SOURCE_DIR) + file(RELATIVE_PATH TARGET_RELATIVE_PATH "${CMAKE_SOURCE_DIR}" "${TARGET_SOURCE_DIR}") + set(${_DIR} ${TARGET_RELATIVE_PATH} PARENT_SCOPE) +endfunction() + +# Performs installation steps for the core library +function(install_core_lib _TARGET) + get_target_relative_dir(${_TARGET} TARGET_RELATIVE_PATH) + + get_target_property(TARGET_TYPE ${_TARGET} TYPE) + if(TARGET_TYPE STREQUAL STATIC_LIBRARY) + list(APPEND DILIGENT_CORE_INSTALL_LIBS_LIST ${_TARGET}) + set(DILIGENT_CORE_INSTALL_LIBS_LIST ${DILIGENT_CORE_INSTALL_LIBS_LIST} CACHE INTERNAL "Core libraries installation list") + elseif(TARGET_TYPE STREQUAL SHARED_LIBRARY) + install(TARGETS ${_TARGET} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" + ) + if (DILIGENT_INSTALL_PDB) + install(FILES $ DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" OPTIONAL) + endif() + endif() + + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/interface") + install(DIRECTORY interface + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${TARGET_RELATIVE_PATH}/" + ) + endif() +endfunction() + + +function(install_combined_static_lib COMBINED_LIB_NAME LIBS_LIST CUSTOM_TARGET_NAME CUSTOM_TARGET_FOLDER INSTALL_DESTINATION) + + foreach(LIB ${LIBS_LIST}) + list(APPEND COMBINED_LIB_TARGET_FILES $) + endforeach(LIB) + + if(MSVC) + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + COMMAND lib.exe /OUT:${COMBINED_LIB_NAME} ${COMBINED_LIB_TARGET_FILES} + DEPENDS ${LIBS_LIST} + COMMENT "Combining libraries..." + ) + add_custom_target(${CUSTOM_TARGET_NAME} ALL DEPENDS ${COMBINED_LIB_NAME}) + else() + + if(PLATFORM_WIN32) + # do NOT use stock ar on MinGW + find_program(AR NAMES x86_64-w64-mingw32-gcc-ar) + else() + set(AR ${CMAKE_AR}) + endif() + + if(AR) + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + # Delete all object files from current directory + COMMAND ${CMAKE_COMMAND} -E remove "*${CMAKE_C_OUTPUT_EXTENSION}" + DEPENDS ${LIBS_LIST} + COMMENT "Combining libraries..." + ) + + # Unpack all object files from all targets to current directory + foreach(LIB_TARGET ${COMBINED_LIB_TARGET_FILES}) + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + COMMAND ${AR} -x ${LIB_TARGET} + APPEND + ) + endforeach() + + # Pack object files to a combined library and delete them + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + COMMAND ${AR} -crs ${COMBINED_LIB_NAME} "*${CMAKE_C_OUTPUT_EXTENSION}" + COMMAND ${CMAKE_COMMAND} -E remove "*${CMAKE_C_OUTPUT_EXTENSION}" + APPEND + ) + + add_custom_target(${CUSTOM_TARGET_NAME} ALL DEPENDS ${COMBINED_LIB_NAME}) + else() + message("ar command is not found") + endif() + endif() + + if(TARGET ${CUSTOM_TARGET_NAME}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${COMBINED_LIB_NAME}" + DESTINATION ${INSTALL_DESTINATION} + ) + set_target_properties(${CUSTOM_TARGET_NAME} PROPERTIES + FOLDER ${CUSTOM_TARGET_FOLDER} + ) + else() + message("Unable to find librarian tool. Combined ${COMBINED_LIB_NAME} static library will not be produced.") + endif() + +endfunction() + + + + +function(add_format_validation_target MODULE_NAME MODULE_ROOT_PATH IDE_FOLDER) + + if(${DILIGENT_NO_FORMAT_VALIDATION}) + return() + endif() + + # Start by copying .clang-format file to the module's root folder + add_custom_target(${MODULE_NAME}-ValidateFormatting ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DILIGENT_CORE_SOURCE_DIR}/.clang-format" "${MODULE_ROOT_PATH}/.clang-format" + ) + + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(RUN_VALIDATION_SCRIPT validate_format_win.bat) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(RUN_VALIDATION_SCRIPT ./validate_format_linux.sh) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(RUN_VALIDATION_SCRIPT ./validate_format_mac.sh) + else() + message(FATAL_ERROR "Unexpected host system") + endif() + + # Run the format validation script + add_custom_command(TARGET ${MODULE_NAME}-ValidateFormatting + COMMAND ${RUN_VALIDATION_SCRIPT} + WORKING_DIRECTORY "${MODULE_ROOT_PATH}/BuildTools/FormatValidation" + COMMENT "Validating ${MODULE_NAME} module's source code formatting..." + VERBATIM + ) + + if(TARGET ${MODULE_NAME}-ValidateFormatting) + set_target_properties(${MODULE_NAME}-ValidateFormatting PROPERTIES FOLDER ${IDE_FOLDER}) + endif() + +endfunction() + + diff --git a/recipes/diligent-fx/all/CMakeLists.txt b/recipes/diligent-fx/all/CMakeLists.txt new file mode 100644 index 0000000000000..f624602d00651 --- /dev/null +++ b/recipes/diligent-fx/all/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(diligent-core) +find_package(diligent-tools) + +find_package(PythonInterp 3 REQUIRED) +set(FILE2STRING_PATH "${CMAKE_CURRENT_SOURCE_DIR}/script.py" CACHE INTERNAL "File2String utility") + +include(BuildUtils.cmake) +add_subdirectory(source_subfolder) diff --git a/recipes/diligent-fx/all/conandata.yml b/recipes/diligent-fx/all/conandata.yml new file mode 100644 index 0000000000000..c9711b69e2711 --- /dev/null +++ b/recipes/diligent-fx/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "api.252009": + url: "https://github.com/DiligentGraphics/DiligentFX/archive/refs/tags/API252009.tar.gz" + sha256: "4a7822e21d07d018fb5436fb286c552e160847ba5104561c17af6e86fa837c7d" + "api.252005": + url: "https://github.com/DiligentGraphics/DiligentFX/archive/refs/tags/API252005.tar.gz" + sha256: "1f6b4e0e81a8300ebd89bbf1a94d73b508e7c0b2e1170c3f9faa9d22645d19dd" + "2.5.2": + url: "https://github.com/DiligentGraphics/DiligentFX/archive/refs/tags/v2.5.2.tar.gz" + sha256: "2875e7d1e449c32c3c10a7f563cc5b3ad56b3465374dec2a9ed598411ab3b65f" + "cci.20211112": + url: "https://github.com/DiligentGraphics/DiligentFX/archive/d2f70a5107f51800e84b08072ec72dfbc0144529.tar.gz" + sha256: "0ce506bc1d509551468cc7e109f76fb7beeecf90238e93cc30c129b5ebc9f28d" + "cci.20220219": + url: "https://github.com/DiligentGraphics/DiligentFX/archive/3757c8c99141400e0d215e0bb8865eef404a5488.tar.gz" + sha256: "09f347dc00b968f3ccc383bb3e9af0e9197641f1ba7a5d22652a1cee5552786a" +patches: + "api.252009": + - patch_file: "patches/0001-use-conan-dependencies.diff" + base_path: "source_subfolder" + "api.252005": + - patch_file: "patches/0001-use-conan-dependencies.diff" + base_path: "source_subfolder" + "2.5.2": + - patch_file: "patches/0001-use-conan-dependencies.diff" + base_path: "source_subfolder" + "cci.20211112": + - patch_file: "patches/0001-use-conan-dependencies.diff" + base_path: "source_subfolder" + "cci.20220219": + - patch_file: "patches/0001-use-conan-dependencies.diff" + base_path: "source_subfolder" diff --git a/recipes/diligent-fx/all/conanfile.py b/recipes/diligent-fx/all/conanfile.py new file mode 100644 index 0000000000000..e5b2755279d0d --- /dev/null +++ b/recipes/diligent-fx/all/conanfile.py @@ -0,0 +1,121 @@ +import os +from conan import ConanFile +from conans import CMake +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, collect_libs, export_conandata_patches, apply_conandata_patches, rename +import shutil + +required_conan_version = ">=1.52.0" + +class DiligentFxConan(ConanFile): + name = "diligent-fx" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DiligentGraphics/DiligentFx/" + description = "DiligentFX is the Diligent Engine's high-level rendering framework." + license = ("Apache-2.0") + topics = ("graphics", "game-engine", "renderer", "graphics-library") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False], + } + default_options = {"shared": False, + "fPIC": True, + } + generators = "cmake_find_package", "cmake" + _cmake = None + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + export_conandata_patches(self) + self.copy("CMakeLists.txt") + self.copy("BuildUtils.cmake") + self.copy("script.py") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def validate(self): + if self.options.shared: + raise ConanInvalidConfiguration("Can't build as a shared lib") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def _patch_sources(self): + apply_conandata_patches(self) + + def requirements(self): + if self.version == "cci.20220219" or self.version == "cci.20211112": + self.requires("diligent-tools/2.5.2") + else: + self.requires("diligent-tools/{}".format(self.version)) + + @property + def _diligent_platform(self): + if self.settings.os == "Windows": + return "PLATFORM_WIN32" + elif self.settings.os == "Macos": + return "PLATFORM_MACOS" + elif self.settings.os == "Linux": + return "PLATFORM_LINUX" + elif self.settings.os == "Android": + return "PLATFORM_ANDROID" + elif self.settings.os == "iOS": + return "PLATFORM_IOS" + elif self.settings.os == "Emscripten": + return "PLATFORM_EMSCRIPTEN" + elif self.settings.os == "watchOS": + return "PLATFORM_TVOS" + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["DILIGENT_NO_FORMAT_VALIDATION"] = True + self._cmake.definitions["DILIGENT_BUILD_TESTS"] = False + + self._cmake.definitions[self._diligent_platform] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("License.txt", dst="licenses", src=self._source_subfolder) + rename(self, src=os.path.join(self.package_folder, "include", "source_subfolder"), + dst=os.path.join(self.package_folder, "include", "DiligentFx")) + shutil.move(os.path.join(self.package_folder, "Shaders"), + os.path.join(self.package_folder, "res", "Shaders")) + + self.copy(pattern="*.dll", src=self._build_subfolder, dst="bin", keep_path=False) + self.copy(pattern="*.dylib", src=self._build_subfolder, dst="lib", keep_path=False) + self.copy(pattern="*.lib", src=self._build_subfolder, dst="lib", keep_path=False) + self.copy(pattern="*.a", src=self._build_subfolder, dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.includedirs.append(os.path.join("include", "DiligentFx")) + self.cpp_info.includedirs.append(os.path.join("include", "DiligentFx", "Components", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "DiligentFx", "GLTF_PBR_Renderer", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "DiligentFx", "PostProcess", "EpipolarLightScattering", "interface")) + self.cpp_info.includedirs.append(os.path.join("res")) + + diff --git a/recipes/diligent-fx/all/patches/0001-use-conan-dependencies.diff b/recipes/diligent-fx/all/patches/0001-use-conan-dependencies.diff new file mode 100644 index 0000000000000..ed42ff2d58f84 --- /dev/null +++ b/recipes/diligent-fx/all/patches/0001-use-conan-dependencies.diff @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d56e79..46b1113 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,11 +18,8 @@ endif() + + target_link_libraries(DiligentFX + PRIVATE +- Diligent-BuildSettings +-PUBLIC +- Diligent-GraphicsEngine +- Diligent-GraphicsTools +- Diligent-AssetLoader ++ diligent-core::diligent-core ++ diligent-tools::diligent-tools + ) + set_common_target_properties(DiligentFX) + diff --git a/recipes/diligent-fx/all/script.py b/recipes/diligent-fx/all/script.py new file mode 100644 index 0000000000000..38007ee747ebd --- /dev/null +++ b/recipes/diligent-fx/all/script.py @@ -0,0 +1,58 @@ +# ---------------------------------------------------------------------------- +# Copyright 2019-2022 Diligent Graphics LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# In no event and under no legal theory, whether in tort (including negligence), +# contract, or otherwise, unless required by applicable law (such as deliberate +# and grossly negligent acts) or agreed to in writing, shall any Contributor be +# liable for any damages, including any direct, indirect, special, incidental, +# or consequential damages of any character arising as a result of this License or +# out of the use or inability to use the software (including but not limited to damages +# for loss of goodwill, work stoppage, computer failure or malfunction, or any and +# all other commercial damages or losses), even if such Contributor has been advised +# of the possibility of such damages. +# ---------------------------------------------------------------------------- + +import sys + + +def main(): + try: + if len(sys.argv) < 3: + raise ValueError("Incorrect number of command line arguments. Expected arguments: src file, dst file") + + if sys.argv[1] == sys.argv[2]: + raise ValueError("Source and destination files must be different") + + with open(sys.argv[1], "r") as src_file, open(sys.argv[2], "w") as dst_file: + special_chars = "\'\"\\" + + for line in src_file: + dst_file.write('\"') + + for i, c in enumerate(line.rstrip()): + if special_chars.find(c) != -1: + dst_file.write('\\') + dst_file.write(c) + + dst_file.write('\\n\"\n') + + print("File2String: successfully converted {} to {}".format(sys.argv[1], sys.argv[2])) + except (ValueError, IOError) as error: + print(error) + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/recipes/diligent-fx/all/test_package/CMakeLists.txt b/recipes/diligent-fx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d1ec0133b8f6 --- /dev/null +++ b/recipes/diligent-fx/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(diligent-fx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} diligent-fx::diligent-fx) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/diligent-fx/all/test_package/conanfile.py b/recipes/diligent-fx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/diligent-fx/all/test_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/diligent-fx/all/test_package/test_package.cpp b/recipes/diligent-fx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b6931c38fa517 --- /dev/null +++ b/recipes/diligent-fx/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + Diligent::ShadowMapManager manager; + return 0; +} diff --git a/recipes/diligent-fx/config.yml b/recipes/diligent-fx/config.yml new file mode 100644 index 0000000000000..0ef99607c429d --- /dev/null +++ b/recipes/diligent-fx/config.yml @@ -0,0 +1,11 @@ +versions: + "api.252009": + folder: "all" + "api.252005": + folder: "all" + "cci.20211112": + folder: "all" + "cci.20220219": + folder: "all" + "2.5.2": + folder: "all" diff --git a/recipes/diligent-tools/all/BuildUtils.cmake b/recipes/diligent-tools/all/BuildUtils.cmake new file mode 100644 index 0000000000000..baedd17d66435 --- /dev/null +++ b/recipes/diligent-tools/all/BuildUtils.cmake @@ -0,0 +1,399 @@ +if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) + + function(copy_required_dlls TARGET_NAME) + if(D3D11_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineD3D11-shared) + endif() + if(D3D12_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineD3D12-shared) + endif() + if(GL_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineOpenGL-shared) + endif() + if(VULKAN_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineVk-shared) + endif() + if(METAL_SUPPORTED) + list(APPEND ENGINE_DLLS Diligent-GraphicsEngineMetal-shared) + endif() + + foreach(DLL ${ENGINE_DLLS}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "\"$\"" + "\"$\"") + endforeach(DLL) + + # Copy D3Dcompiler_47.dll, dxcompiler.dll, and dxil.dll + if(MSVC) + if ((D3D11_SUPPORTED OR D3D12_SUPPORTED) AND VS_D3D_COMPILER_PATH) + # Note that VS_D3D_COMPILER_PATH can only be used in a Visual Studio command + # and is not a valid path during CMake configuration + list(APPEND SHADER_COMPILER_DLLS ${VS_D3D_COMPILER_PATH}) + endif() + + if(D3D12_SUPPORTED AND VS_DXC_COMPILER_PATH AND VS_DXIL_SIGNER_PATH) + # For the compiler to sign the bytecode, you have to have a copy of dxil.dll in + # the same folder as the dxcompiler.dll at runtime. + + # Note that VS_DXC_COMPILER_PATH and VS_DXIL_SIGNER_PATH can only be used in a Visual Studio command + # and are not valid paths during CMake configuration + list(APPEND SHADER_COMPILER_DLLS ${VS_DXC_COMPILER_PATH}) + list(APPEND SHADER_COMPILER_DLLS ${VS_DXIL_SIGNER_PATH}) + endif() + + foreach(DLL ${SHADER_COMPILER_DLLS}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DLL} + "\"$\"") + endforeach(DLL) + + if(D3D12_SUPPORTED AND EXISTS ${DILIGENT_PIX_EVENT_RUNTIME_DLL_PATH}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DILIGENT_PIX_EVENT_RUNTIME_DLL_PATH} + "\"$\"") + endif() + + if(VULKAN_SUPPORTED) + if(NOT DEFINED DILIGENT_DXCOMPILER_FOR_SPIRV_PATH) + message(FATAL_ERROR "DILIGENT_DXCOMPILER_FOR_SPIRV_PATH is undefined, check order of cmake includes") + endif() + if(EXISTS ${DILIGENT_DXCOMPILER_FOR_SPIRV_PATH}) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DILIGENT_DXCOMPILER_FOR_SPIRV_PATH} + "\"$/spv_dxcompiler.dll\"") + endif() + endif() + endif() + endfunction() + + function(package_required_dlls TARGET_NAME) + if(D3D12_SUPPORTED AND VS_DXC_COMPILER_PATH AND VS_DXIL_SIGNER_PATH) + # Copy the dlls to the project's CMake binary dir + + # Note that VS_DXC_COMPILER_PATH and VS_DXIL_SIGNER_PATH can only be used in a Visual Studio command + # and are not valid paths during CMake configuration + add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${VS_DXC_COMPILER_PATH} + "\"${CMAKE_CURRENT_BINARY_DIR}/dxcompiler.dll\"" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${VS_DXIL_SIGNER_PATH} + "\"${CMAKE_CURRENT_BINARY_DIR}/dxil.dll\"") + set(DLLS "${CMAKE_CURRENT_BINARY_DIR}/dxcompiler.dll" "${CMAKE_CURRENT_BINARY_DIR}/dxil.dll") + + # Add the dlls to the target project as source files + target_sources(${TARGET_NAME} PRIVATE ${DLLS}) + + # Label them as content + set_source_files_properties(${DLLS} PROPERTIES + GENERATED TRUE + VS_DEPLOYMENT_CONTENT 1 + VS_DEPLOYMENT_LOCATION ".") + endif() + endfunction() + + # Set dll output name by adding _{32|64}{r|d} suffix + function(set_dll_output_name TARGET_NAME OUTPUT_NAME_WITHOUT_SUFFIX) + foreach(DBG_CONFIG ${DEBUG_CONFIGURATIONS}) + set_target_properties(${TARGET_NAME} PROPERTIES + OUTPUT_NAME_${DBG_CONFIG} ${OUTPUT_NAME_WITHOUT_SUFFIX}${DLL_DBG_SUFFIX} + ) + endforeach() + + foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) + set_target_properties(${TARGET_NAME} PROPERTIES + OUTPUT_NAME_${REL_CONFIG} ${OUTPUT_NAME_WITHOUT_SUFFIX}${DLL_REL_SUFFIX} + ) + endforeach() + endfunction() + +endif(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) + + +function(set_common_target_properties TARGET) + + if(COMMAND custom_pre_configure_target) + custom_pre_configure_target(${TARGET}) + if(TARGET_CONFIGURATION_COMPLETE) + return() + endif() + endif() + + get_target_property(TARGET_TYPE ${TARGET} TYPE) + + if(MSVC) + # For msvc, enable link-time code generation for release builds (I was not able to + # find any way to set these settings through interface library BuildSettings) + if(TARGET_TYPE STREQUAL STATIC_LIBRARY) + + foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) + set_target_properties(${TARGET} PROPERTIES + STATIC_LIBRARY_FLAGS_${REL_CONFIG} /LTCG + ) + endforeach() + + else() + + foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS_${REL_CONFIG} "/LTCG /OPT:REF /INCREMENTAL:NO" + ) + endforeach() + + if(PLATFORM_UNIVERSAL_WINDOWS) + # On UWP, disable incremental link to avoid linker warnings + foreach(DBG_CONFIG ${DEBUG_CONFIGURATIONS}) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS_${DBG_CONFIG} "/INCREMENTAL:NO" + ) + endforeach() + endif() + endif() + else() + set_target_properties(${TARGET} PROPERTIES + CXX_VISIBILITY_PRESET hidden # -fvisibility=hidden + C_VISIBILITY_PRESET hidden # -fvisibility=hidden + VISIBILITY_INLINES_HIDDEN TRUE + + # Without -fPIC option GCC fails to link static libraries into dynamic library: + # -fPIC + # If supported for the target machine, emit position-independent code, suitable for + # dynamic linking and avoiding any limit on the size of the global offset table. + POSITION_INDEPENDENT_CODE ON + + # It is crucial to set CXX_STANDARD flag to only affect c++ files and avoid failures compiling c-files: + # error: invalid argument '-std=c++14' not allowed with 'C/ObjC' + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + + C_STANDARD 11 + ) + + if(NOT MINGW_BUILD) + # Do not disable extensions when building with MinGW! + set_target_properties(${TARGET} PROPERTIES + CXX_EXTENSIONS OFF + ) + endif() + endif() + + if(COMMAND custom_post_configure_target) + custom_post_configure_target(${TARGET}) + endif() + +endfunction() + +function(find_targets_in_directory _RESULT _DIR) + get_property(_subdirs DIRECTORY "${_DIR}" PROPERTY SUBDIRECTORIES) + foreach(_subdir IN LISTS _subdirs) + find_targets_in_directory(${_RESULT} "${_subdir}") + endforeach() + get_property(_SUB_TARGETS DIRECTORY "${_DIR}" PROPERTY BUILDSYSTEM_TARGETS) + set(${_RESULT} ${${_RESULT}} ${_SUB_TARGETS} PARENT_SCOPE) +endfunction() + +function(set_directory_root_folder _DIRECTORY _ROOT_FOLDER) + find_targets_in_directory(_TARGETS ${_DIRECTORY}) + foreach(_TARGET IN LISTS _TARGETS) + get_target_property(_FOLDER ${_TARGET} FOLDER) + if(_FOLDER) + set_target_properties(${_TARGET} PROPERTIES FOLDER "${_ROOT_FOLDER}/${_FOLDER}") + else() + set_target_properties(${_TARGET} PROPERTIES FOLDER "${_ROOT_FOLDER}") + endif() + endforeach() +endfunction() + + +# Returns default backend library type (static/dynamic) for the current platform +function(get_backend_libraries_type _LIB_TYPE) + if(PLATFORM_WIN32 OR PLATFORM_LINUX OR PLATFORM_ANDROID OR PLATFORM_UNIVERSAL_WINDOWS OR PLATFORM_MACOS) + set(LIB_TYPE "shared") + elseif(PLATFORM_IOS OR PLATFORM_TVOS OR PLATFORM_EMSCRIPTEN) + # Statically link with the engine on iOS, tvOS and Emscripten. + # It is also possible to link dynamically by + # putting the library into the framework. + set(LIB_TYPE "static") + else() + message(FATAL_ERROR "Undefined platform") + endif() + set(${_LIB_TYPE} ${LIB_TYPE} PARENT_SCOPE) +endfunction() + + +# Adds the list of supported backend targets to variable ${_TARGETS} in parent scope. +# Second argument to the function may override the target type (static/dynamic). If It +# is not given, default target type for the platform is used. +function(get_supported_backends _TARGETS) + if(${ARGC} GREATER 1) + set(LIB_TYPE ${ARGV1}) + else() + get_backend_libraries_type(LIB_TYPE) + endif() + + if(D3D11_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineD3D11-${LIB_TYPE}) + endif() + if(D3D12_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineD3D12-${LIB_TYPE}) + endif() + if(GL_SUPPORTED OR GLES_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineOpenGL-${LIB_TYPE}) + endif() + if(VULKAN_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineVk-${LIB_TYPE}) + endif() + if(METAL_SUPPORTED) + list(APPEND BACKENDS Diligent-GraphicsEngineMetal-${LIB_TYPE}) + endif() + # ${_TARGETS} == ENGINE_LIBRARIES + # ${${_TARGETS}} == ${ENGINE_LIBRARIES} + set(${_TARGETS} ${${_TARGETS}} ${BACKENDS} PARENT_SCOPE) +endfunction() + + +# Returns path to the target relative to CMake root +function(get_target_relative_dir _TARGET _DIR) + get_target_property(TARGET_SOURCE_DIR ${_TARGET} SOURCE_DIR) + file(RELATIVE_PATH TARGET_RELATIVE_PATH "${CMAKE_SOURCE_DIR}" "${TARGET_SOURCE_DIR}") + set(${_DIR} ${TARGET_RELATIVE_PATH} PARENT_SCOPE) +endfunction() + +# Performs installation steps for the core library +function(install_core_lib _TARGET) + get_target_relative_dir(${_TARGET} TARGET_RELATIVE_PATH) + + get_target_property(TARGET_TYPE ${_TARGET} TYPE) + if(TARGET_TYPE STREQUAL STATIC_LIBRARY) + list(APPEND DILIGENT_CORE_INSTALL_LIBS_LIST ${_TARGET}) + set(DILIGENT_CORE_INSTALL_LIBS_LIST ${DILIGENT_CORE_INSTALL_LIBS_LIST} CACHE INTERNAL "Core libraries installation list") + elseif(TARGET_TYPE STREQUAL SHARED_LIBRARY) + install(TARGETS ${_TARGET} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${DILIGENT_CORE_DIR}/$" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" + ) + if (DILIGENT_INSTALL_PDB) + install(FILES $ DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_CORE_DIR}/$" OPTIONAL) + endif() + endif() + + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/interface") + install(DIRECTORY interface + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${TARGET_RELATIVE_PATH}/" + ) + endif() +endfunction() + + +function(install_combined_static_lib COMBINED_LIB_NAME LIBS_LIST CUSTOM_TARGET_NAME CUSTOM_TARGET_FOLDER INSTALL_DESTINATION) + + foreach(LIB ${LIBS_LIST}) + list(APPEND COMBINED_LIB_TARGET_FILES $) + endforeach(LIB) + + if(MSVC) + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + COMMAND lib.exe /OUT:${COMBINED_LIB_NAME} ${COMBINED_LIB_TARGET_FILES} + DEPENDS ${LIBS_LIST} + COMMENT "Combining libraries..." + ) + add_custom_target(${CUSTOM_TARGET_NAME} ALL DEPENDS ${COMBINED_LIB_NAME}) + else() + + if(PLATFORM_WIN32) + # do NOT use stock ar on MinGW + find_program(AR NAMES x86_64-w64-mingw32-gcc-ar) + else() + set(AR ${CMAKE_AR}) + endif() + + if(AR) + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + # Delete all object files from current directory + COMMAND ${CMAKE_COMMAND} -E remove "*${CMAKE_C_OUTPUT_EXTENSION}" + DEPENDS ${LIBS_LIST} + COMMENT "Combining libraries..." + ) + + # Unpack all object files from all targets to current directory + foreach(LIB_TARGET ${COMBINED_LIB_TARGET_FILES}) + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + COMMAND ${AR} -x ${LIB_TARGET} + APPEND + ) + endforeach() + + # Pack object files to a combined library and delete them + add_custom_command( + OUTPUT ${COMBINED_LIB_NAME} + COMMAND ${AR} -crs ${COMBINED_LIB_NAME} "*${CMAKE_C_OUTPUT_EXTENSION}" + COMMAND ${CMAKE_COMMAND} -E remove "*${CMAKE_C_OUTPUT_EXTENSION}" + APPEND + ) + + add_custom_target(${CUSTOM_TARGET_NAME} ALL DEPENDS ${COMBINED_LIB_NAME}) + else() + message("ar command is not found") + endif() + endif() + + if(TARGET ${CUSTOM_TARGET_NAME}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${COMBINED_LIB_NAME}" + DESTINATION ${INSTALL_DESTINATION} + ) + set_target_properties(${CUSTOM_TARGET_NAME} PROPERTIES + FOLDER ${CUSTOM_TARGET_FOLDER} + ) + else() + message("Unable to find librarian tool. Combined ${COMBINED_LIB_NAME} static library will not be produced.") + endif() + +endfunction() + + + + +function(add_format_validation_target MODULE_NAME MODULE_ROOT_PATH IDE_FOLDER) + + if(${DILIGENT_NO_FORMAT_VALIDATION}) + return() + endif() + + # Start by copying .clang-format file to the module's root folder + add_custom_target(${MODULE_NAME}-ValidateFormatting ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DILIGENT_CORE_SOURCE_DIR}/.clang-format" "${MODULE_ROOT_PATH}/.clang-format" + ) + + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(RUN_VALIDATION_SCRIPT validate_format_win.bat) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(RUN_VALIDATION_SCRIPT ./validate_format_linux.sh) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(RUN_VALIDATION_SCRIPT ./validate_format_mac.sh) + else() + message(FATAL_ERROR "Unexpected host system") + endif() + + # Run the format validation script + add_custom_command(TARGET ${MODULE_NAME}-ValidateFormatting + COMMAND ${RUN_VALIDATION_SCRIPT} + WORKING_DIRECTORY "${MODULE_ROOT_PATH}/BuildTools/FormatValidation" + COMMENT "Validating ${MODULE_NAME} module's source code formatting..." + VERBATIM + ) + + if(TARGET ${MODULE_NAME}-ValidateFormatting) + set_target_properties(${MODULE_NAME}-ValidateFormatting PROPERTIES FOLDER ${IDE_FOLDER}) + endif() + +endfunction() + + diff --git a/recipes/diligent-tools/all/CMakeLists.txt b/recipes/diligent-tools/all/CMakeLists.txt new file mode 100644 index 0000000000000..67d43c91fddd2 --- /dev/null +++ b/recipes/diligent-tools/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.2) +project(cmake_wrapper) + +include(BuildUtils.cmake) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(imgui REQUIRED) +find_package(PNG REQUIRED) +find_package(TIFF REQUIRED) +find_package(JPEG REQUIRED) +find_package(ZLIB REQUIRED) +find_package(args CONFIG) +find_package(diligent-core REQUIRED) + +set(Diligent-GraphicsEngine_SOURCE_DIR ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/) +set(DILIGENT_ARGS_DIR ${CONAN_INCLUDE_DIRS_TAYWEE-ARGS}) +set(DILIGENT_DEAR_IMGUI_PATH ${CONAN_INCLUDE_DIRS_IMGUI}) + +add_library(Diligent-BuildSettings ALIAS diligent-core::diligent-core) +add_library(Diligent-Common ALIAS diligent-core::diligent-core) +add_library(Diligent-PlatformInterface ALIAS diligent-core::diligent-core) +add_library(Diligent-GraphicsEngineInterface ALIAS diligent-core::diligent-core) +add_library(Diligent-GraphicsAccessories ALIAS diligent-core::diligent-core) +add_library(Diligent-GraphicsTools ALIAS diligent-core::diligent-core) +add_library(Diligent-Archiver-static ALIAS diligent-core::diligent-core) +add_library(Diligent-HLSL2GLSLConverterLib ALIAS diligent-core::diligent-core) +add_library(Diligent-TargetPlatform ALIAS diligent-core::diligent-core) +add_library(Diligent-GraphicsEngineOpenGL-static ALIAS diligent-core::diligent-core) +add_library(imgui ALIAS imgui::imgui) + +add_subdirectory(source_subfolder) diff --git a/recipes/diligent-tools/all/conandata.yml b/recipes/diligent-tools/all/conandata.yml new file mode 100644 index 0000000000000..27798ef8a71ae --- /dev/null +++ b/recipes/diligent-tools/all/conandata.yml @@ -0,0 +1,44 @@ +sources: + "api.252009": + url: "https://github.com/DiligentGraphics/DiligentTools/archive/refs/tags/API252009.tar.gz" + sha256: "f0ffd7e7145df2b66694d88a9d7854325032171ee6a9650f348da69f735d57a3" + "api.252005": + url: "https://github.com/DiligentGraphics/DiligentTools/archive/refs/tags/API252004.tar.gz" + sha256: "28caa91bc1a7d8b1e7bf0198da23c74a8ea0cfda447c72eeb39b5766d01a754a" + "2.5.2": + url: "https://github.com/DiligentGraphics/DiligentTools/archive/refs/tags/v2.5.2.tar.gz" + sha256: "6519f3d5871a1119876928531d249c45ef46392237ab7bacc6531b4d538551ca" + "cci.20211009": + url: "https://github.com/DiligentGraphics/DiligentTools/archive/846ffbe83ac5ae0c96135f5a772d0077d0d086a8.tar.gz" + sha256: "12ec01e730aefd64ca0d335b5ac6af47279f5e58617f37bc062cd83422f81703" +patches: + "api.252009": + - patch_file: "patches/0012-2.5.2-fix-imgui-include-path.diff" + base_path: "source_subfolder" + "api.252005": + - patch_file: "patches/0006-2.5.2-use-imgui-from-conan.diff" + base_path: "source_subfolder" + - patch_file: "patches/0012-2.5.2-fix-imgui-include-path.diff" + base_path: "source_subfolder" + "2.5.2": + - patch_file: "patches/0006-2.5.2-use-imgui-from-conan.diff" + base_path: "source_subfolder" + - patch_file: "patches/0007-2.5.2-use-diligent-core-dependencies.diff" + base_path: "source_subfolder" + - patch_file: "patches/0008-2.5.2-use-conan-dependencies.diff" + base_path: "source_subfolder" + - patch_file: "patches/0009-2.5.2-fix-include-path.diff" + base_path: "source_subfolder" + - patch_file: "patches/0010-2.5.2-fix-render-state-notation-paths.diff" + base_path: "source_subfolder" + - patch_file: "patches/0011-2.5.2-use-conan-dependencies-part2.diff" + base_path: "source_subfolder" + - patch_file: "patches/0012-2.5.2-fix-imgui-include-path.diff" + base_path: "source_subfolder" + "cci.20211009": + - patch_file: "patches/0001-use-imgui-from-conan.diff" + base_path: "source_subfolder" + - patch_file: "patches/0002-use-conan-dependencies.diff" + base_path: "source_subfolder" + - patch_file: "patches/0005-fix-include-path.diff" + base_path: "source_subfolder" diff --git a/recipes/diligent-tools/all/conanfile.py b/recipes/diligent-tools/all/conanfile.py new file mode 100644 index 0000000000000..958f6428f4048 --- /dev/null +++ b/recipes/diligent-tools/all/conanfile.py @@ -0,0 +1,165 @@ +import os +from conan import ConanFile +from conans import CMake +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, rmdir, rm, collect_libs, patches, export_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + +class DiligentToolsConan(ConanFile): + name = "diligent-tools" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DiligentGraphics/DiligentTools/" + description = "Diligent Core is a modern cross-platfrom low-level graphics API." + license = ("Apache-2.0") + topics = ("graphics", "texture", "gltf", "draco", "imgui") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False], + "jpeg": [False, "libjpeg-turbo", "libjpeg"], + "with_render_state_packager": [True, False], + "with_archiver": [True, False], + } + default_options = {"shared": False, + "fPIC": True, + "jpeg": "libjpeg", + "with_render_state_packager": False, + "with_archiver": True, + } + + generators = "cmake_find_package", "cmake_find_package_multi", "cmake" + _cmake = None + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + export_conandata_patches(self) + self.copy("CMakeLists.txt") + self.copy("BuildUtils.cmake") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + 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: + self.info.settings.compiler.runtime = "MT/MTd" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def _patch_sources(self): + patches.apply_conandata_patches(self) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.options.shared: + raise ConanInvalidConfiguration("Can't build diligent tools as shared lib") + + def build_requirements(self): + self.tool_requires("cmake/3.24.2") + + def requirements(self): + if self.version == "cci.20211009": + self.requires("diligent-core/2.5.1") + self.requires("imgui/1.87") + else: + self.requires("diligent-core/{}".format(self.version)) + self.requires('taywee-args/6.3.0') + self.requires("imgui/1.85") + + if self.options.jpeg == "libjpeg": + self.requires("libjpeg/9e") + if self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + self.requires("libpng/1.6.37") + self.requires("libtiff/4.3.0") + self.requires("zlib/1.2.12") + + @property + def _diligent_platform(self): + if self.settings.os == "Windows": + return "PLATFORM_WIN32" + elif self.settings.os == "Macos": + return "PLATFORM_MACOS" + elif self.settings.os == "Linux": + return "PLATFORM_LINUX" + elif self.settings.os == "Android": + return "PLATFORM_ANDROID" + elif self.settings.os == "iOS": + return "PLATFORM_IOS" + elif self.settings.os == "Emscripten": + return "PLATFORM_EMSCRIPTEN" + elif self.settings.os == "watchOS": + return "PLATFORM_TVOS" + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + self._cmake.definitions["DILIGENT_INSTALL_TOOLS"] = False + self._cmake.definitions["DILIGENT_BUILD_SAMPLES"] = False + self._cmake.definitions["DILIGENT_NO_FORMAT_VALIDATION"] = True + self._cmake.definitions["DILIGENT_BUILD_TESTS"] = False + self._cmake.definitions["DILIGENT_BUILD_TOOLS_TESTS"] = False + self._cmake.definitions["DILIGENT_BUILD_TOOLS_INCLUDE_TEST"] = False + self._cmake.definitions["DILIGENT_NO_RENDER_STATE_PACKAGER"] = not self.options.with_render_state_packager + self._cmake.definitions["ARCHIVER_SUPPORTED"] = not self.options.with_archiver + + if self.version != "cci.20211009" and \ + (self.version.startswith("api") and self.version >= "api.252005") or \ + (self.version > "2.5.2"): + self._cmake.definitions["GL_SUPPORTED"] = True + self._cmake.definitions["GLES_SUPPORTED"] = True + self._cmake.definitions["VULKAN_SUPPORTED"] = True + self._cmake.definitions["METAL_SUPPORTED"] = True + + self._cmake.definitions[self._diligent_platform] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("*.hpp", src=self._source_subfolder, dst="include/DiligentTools", keep_path=True) + self.copy(pattern="*.dll", src=self._build_subfolder, dst="bin", keep_path=False) + self.copy(pattern="*.dylib", src=self._build_subfolder, dst="lib", keep_path=False) + self.copy(pattern="*.lib", src=self._build_subfolder, dst="lib", keep_path=False) + self.copy(pattern="*.a", src=self._build_subfolder, dst="lib", keep_path=False) + self.copy("*", src=os.path.join(self._build_subfolder, "bin"), dst="bin", keep_path=False) + rmdir(self, os.path.join(self.package_folder, "Licenses")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + self.copy("License.txt", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.includedirs.append(os.path.join("include", "DiligentTools")) + self.cpp_info.includedirs.append(os.path.join("include", "DiligentTools", "AssetLoader", "interface")) + + self.cpp_info.defines.append(f"{self._diligent_platform}=1") + + if self.settings.os in ["Macos", "Linux"]: + self.cpp_info.system_libs = ["dl", "pthread"] + if self.settings.os == 'Macos': + self.cpp_info.frameworks = ["CoreFoundation", 'Cocoa'] diff --git a/recipes/diligent-tools/all/patches/0001-use-imgui-from-conan.diff b/recipes/diligent-tools/all/patches/0001-use-imgui-from-conan.diff new file mode 100644 index 0000000000000..364629b2f1833 --- /dev/null +++ b/recipes/diligent-tools/all/patches/0001-use-imgui-from-conan.diff @@ -0,0 +1,56 @@ +diff --git a/Imgui/CMakeLists.txt b/Imgui/CMakeLists.txt +index 7a8e62f..041f324 100644 +--- a/Imgui/CMakeLists.txt ++++ b/Imgui/CMakeLists.txt +@@ -11,24 +11,12 @@ endif() + set(IMGUIZMO_QUAT_PATH ../ThirdParty/imGuIZMO.quat) + + set(DEAR_IMGUI_INCLUDE +- ${DEAR_IMGUI_PATH}/imconfig.h +- ${DEAR_IMGUI_PATH}/imgui_internal.h +- ${DEAR_IMGUI_PATH}/imstb_rectpack.h +- ${DEAR_IMGUI_PATH}/imstb_textedit.h +- ${DEAR_IMGUI_PATH}/imstb_truetype.h +- ${DEAR_IMGUI_PATH}/misc/cpp/imgui_stdlib.h + ) + + set(DEAR_IMGUI_INTERFACE +- ${DEAR_IMGUI_PATH}/imgui.h + ) + + set(DEAR_IMGUI_SOURCE +- ${DEAR_IMGUI_PATH}/imgui.cpp +- ${DEAR_IMGUI_PATH}/imgui_draw.cpp +- ${DEAR_IMGUI_PATH}/imgui_tables.cpp +- ${DEAR_IMGUI_PATH}/imgui_widgets.cpp +- ${DEAR_IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp + ) + + set(SOURCE +@@ -48,8 +36,6 @@ set(INTERFACE + ) + + if(PLATFORM_WIN32) +- list(APPEND DEAR_IMGUI_SOURCE ${DEAR_IMGUI_PATH}/backends/imgui_impl_win32.cpp) +- list(APPEND DEAR_IMGUI_INCLUDE ${DEAR_IMGUI_PATH}/backends/imgui_impl_win32.h) + + list(APPEND SOURCE src/ImGuiImplWin32.cpp) + list(APPEND INTERFACE interface/ImGuiImplWin32.hpp) +@@ -62,9 +48,6 @@ elseif(PLATFORM_LINUX) + elseif(PLATFORM_ANDROID) + list(APPEND SOURCE src/ImGuiImplAndroid.cpp) + list(APPEND INTERFACE interface/ImGuiImplAndroid.hpp) +-elseif(PLATFORM_MACOS) +- list(APPEND DEAR_IMGUI_SOURCE ${DEAR_IMGUI_PATH}/backends/imgui_impl_osx.mm) +- list(APPEND DEAR_IMGUI_INCLUDE ${DEAR_IMGUI_PATH}/backends/imgui_impl_osx.h) + + list(APPEND SOURCE src/ImGuiImplMacOS.mm) + list(APPEND INTERFACE interface/ImGuiImplMacOS.hpp) +@@ -129,6 +112,7 @@ PRIVATE + Diligent-GraphicsEngineInterface + Diligent-GraphicsAccessories + Diligent-GraphicsTools ++ imgui::imgui + ) + + set_target_properties(Diligent-Imgui PROPERTIES diff --git a/recipes/diligent-tools/all/patches/0002-use-conan-dependencies.diff b/recipes/diligent-tools/all/patches/0002-use-conan-dependencies.diff new file mode 100644 index 0000000000000..9c378eb64f83a --- /dev/null +++ b/recipes/diligent-tools/all/patches/0002-use-conan-dependencies.diff @@ -0,0 +1,131 @@ +diff --git a/AssetLoader/CMakeLists.txt b/AssetLoader/CMakeLists.txt +--- a/AssetLoader/CMakeLists.txt ++++ b/AssetLoader/CMakeLists.txt +@@ -34,13 +34,8 @@ source_group("interface" FILES ${INTERFACE}) + + target_link_libraries(Diligent-AssetLoader + PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools + Diligent-TextureLoader ++ diligent-core::diligent-core + ) + + if (TARGET draco) +diff --git a/HLSL2GLSLConverter/CMakeLists.txt b/HLSL2GLSLConverter/CMakeLists.txt +--- a/HLSL2GLSLConverter/CMakeLists.txt ++++ b/HLSL2GLSLConverter/CMakeLists.txt +@@ -33,12 +33,7 @@ target_compile_definitions(HLSL2GLSLConverter PRIVATE UNICODE) + + target_link_libraries(HLSL2GLSLConverter + PRIVATE +- Diligent-BuildSettings +- Diligent-TargetPlatform +- Diligent-Common +- Diligent-GraphicsTools +- Diligent-HLSL2GLSLConverterLib +- Diligent-GraphicsEngineOpenGL-static ++ diligent-core::diligent-core + ) + + source_group("source" FILES ${SOURCE}) +diff --git a/Imgui/CMakeLists.txt b/Imgui/CMakeLists.txt +--- a/Imgui/CMakeLists.txt ++++ b/Imgui/CMakeLists.txt +@@ -106,13 +106,8 @@ source_group("imGuIZMO.quat" FILES ${IMGUIZMO_QUAT_SOURCE}) + + target_link_libraries(Diligent-Imgui + PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools +- imgui::imgui ++ diligent-core::diligent-core ++ imgui::imgui + ) + + set_target_properties(Diligent-Imgui PROPERTIES +diff --git a/NativeApp/Android/ndk_helper/CMakeLists.txt b/NativeApp/Android/ndk_helper/CMakeLists.txt +--- a/NativeApp/Android/ndk_helper/CMakeLists.txt ++++ b/NativeApp/Android/ndk_helper/CMakeLists.txt +@@ -29,7 +29,7 @@ PUBLIC + + target_link_libraries(NDKHelper + PRIVATE +- Diligent-BuildSettings ++ diligent-core::diligent-core + PUBLIC + native_app_glue + ) +diff --git a/NativeApp/CMakeLists.txt b/NativeApp/CMakeLists.txt +--- a/NativeApp/CMakeLists.txt ++++ b/NativeApp/CMakeLists.txt +@@ -432,8 +432,7 @@ PUBLIC + + target_link_libraries(Diligent-NativeAppBase + PRIVATE +- Diligent-BuildSettings +- Diligent-Common ++ diligent-core::diligent-core + ) + + if(PLATFORM_WIN32) +diff --git a/NativeApp/Linux/CMakeLists.txt b/NativeApp/Linux/CMakeLists.txt +--- a/NativeApp/Linux/CMakeLists.txt ++++ b/NativeApp/Linux/CMakeLists.txt +@@ -20,7 +20,7 @@ source_group("interface" FILES ${INTERFACE}) + + target_link_libraries(XCBKeySyms + PRIVATE +- Diligent-BuildSettings ++ diligent-core::diligent-core + xcb + ) + +diff --git a/TextureLoader/CMakeLists.txt b/TextureLoader/CMakeLists.txt +--- a/TextureLoader/CMakeLists.txt ++++ b/TextureLoader/CMakeLists.txt +@@ -44,16 +44,12 @@ source_group("include" FILES ${INCLUDE}) + source_group("interface" FILES ${INTERFACE}) + + target_link_libraries(Diligent-TextureLoader +-PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools +- LibPng +- LibTiff +- ZLib ++PRIVATE ++ diligent-core::diligent-core ++ JPEG::JPEG ++ PNG::PNG ++ TIFF::TIFF ++ ZLIB::ZLIB + ) + + if (NOT DILIGENT_EXTERNAL_LIBJPEG) +diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt +--- a/ThirdParty/CMakeLists.txt ++++ b/ThirdParty/CMakeLists.txt +@@ -1,10 +1,5 @@ + cmake_minimum_required (VERSION 3.6) + +-add_subdirectory(libjpeg-9a) +-add_subdirectory(libtiff) +-add_subdirectory(zlib-1.2.8) +-add_subdirectory(lpng-1.6.17) +- + set(LICENSE_INSTALL_PATH "Licenses/ThirdParty/${DILIGENT_TOOLS_DIR}") + + install(FILES libjpeg-9a/README DESTINATION ${LICENSE_INSTALL_PATH} RENAME libjpeg-readme.txt) diff --git a/recipes/diligent-tools/all/patches/0003-fix-diligent-core-include-paths.diff b/recipes/diligent-tools/all/patches/0003-fix-diligent-core-include-paths.diff new file mode 100644 index 0000000000000..2c3025797fc4b --- /dev/null +++ b/recipes/diligent-tools/all/patches/0003-fix-diligent-core-include-paths.diff @@ -0,0 +1,122 @@ +diff --git a/TextureLoader/interface/BCTools.h b/TextureLoader/interface/BCTools.h +index cb46211..95bee9f 100644 +--- a/TextureLoader/interface/BCTools.h ++++ b/TextureLoader/interface/BCTools.h +@@ -26,7 +26,7 @@ + + #pragma once + +-#include "../../../DiligentCore/Primitives/interface/BasicTypes.h" ++#include "DiligentCore/Primitives/interface/BasicTypes.h" + + DILIGENT_BEGIN_NAMESPACE(Diligent) + +diff --git a/TextureLoader/interface/Image.h b/TextureLoader/interface/Image.h +index 78629a0..4d5f5f7 100644 +--- a/TextureLoader/interface/Image.h ++++ b/TextureLoader/interface/Image.h +@@ -27,15 +27,15 @@ + + #pragma once + +-#include "../../../DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h" +-#include "../../../DiligentCore/Primitives/interface/FileStream.h" +-#include "../../../DiligentCore/Primitives/interface/DataBlob.h" ++#include "DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h" ++#include "DiligentCore/Primitives/interface/FileStream.h" ++#include "DiligentCore/Primitives/interface/DataBlob.h" + + #if DILIGENT_CPP_INTERFACE + # include + +-# include "../../../DiligentCore/Common/interface/RefCntAutoPtr.hpp" +-# include "../../../DiligentCore/Common/interface/ObjectBase.hpp" ++# include "DiligentCore/Common/interface/RefCntAutoPtr.hpp" ++# include "DiligentCore/Common/interface/ObjectBase.hpp" + #endif + + DILIGENT_BEGIN_NAMESPACE(Diligent) +diff --git a/TextureLoader/interface/TextureLoader.h b/TextureLoader/interface/TextureLoader.h +index 15710a6..9ccf234 100644 +--- a/TextureLoader/interface/TextureLoader.h ++++ b/TextureLoader/interface/TextureLoader.h +@@ -27,9 +27,9 @@ + + #pragma once + +-#include "../../../DiligentCore/Primitives/interface/FileStream.h" +-#include "../../../DiligentCore/Graphics/GraphicsEngine/interface/RenderDevice.h" +-#include "../../../DiligentCore/Graphics/GraphicsEngine/interface/Texture.h" ++#include "DiligentCore/Primitives/interface/FileStream.h" ++#include "DiligentCore/Graphics/GraphicsEngine/interface/RenderDevice.h" ++#include "DiligentCore/Graphics/GraphicsEngine/interface/Texture.h" + #include "Image.h" + + DILIGENT_BEGIN_NAMESPACE(Diligent) +@@ -96,7 +96,7 @@ static const struct INTERFACE_ID IID_TextureLoader = + {0xe04fe6d5, 0x8665, 0x4183, {0xa8, 0x72, 0x85, 0x2e, 0xf, 0x7c, 0xe2, 0x42}}; + + #define DILIGENT_INTERFACE_NAME ITextureLoader +-#include "../../../DiligentCore/Primitives/interface/DefineInterfaceHelperMacros.h" ++#include "DiligentCore/Primitives/interface/DefineInterfaceHelperMacros.h" + + #define ITextureLoaderInclusiveMethods \ + IObjectInclusiveMethods; \ +@@ -123,7 +123,7 @@ DILIGENT_BEGIN_INTERFACE(ITextureLoader, IObject) + DILIGENT_END_INTERFACE + // clang-format on + +-#include "../../../DiligentCore/Primitives/interface/UndefInterfaceHelperMacros.h" ++#include "DiligentCore/Primitives/interface/UndefInterfaceHelperMacros.h" + + #if DILIGENT_C_INTERFACE + +@@ -135,7 +135,7 @@ DILIGENT_END_INTERFACE + + #endif + +-#include "../../../DiligentCore/Primitives/interface/DefineGlobalFuncHelperMacros.h" ++#include "DiligentCore/Primitives/interface/DefineGlobalFuncHelperMacros.h" + + /// Creates a texture loader from image. + +@@ -177,6 +177,6 @@ void DILIGENT_GLOBAL_FUNCTION(CreateTextureLoaderFromMemory)(const void* + const TextureLoadInfo REF TexLoadInfo, + ITextureLoader** ppLoader); + +-#include "../../../DiligentCore/Primitives/interface/UndefGlobalFuncHelperMacros.h" ++#include "DiligentCore/Primitives/interface/UndefGlobalFuncHelperMacros.h" + + DILIGENT_END_NAMESPACE // namespace Diligent +diff --git a/TextureLoader/interface/TextureUtilities.h b/TextureLoader/interface/TextureUtilities.h +index 93d563a..2b53b02 100644 +--- a/TextureLoader/interface/TextureUtilities.h ++++ b/TextureLoader/interface/TextureUtilities.h +@@ -30,15 +30,15 @@ + /// \file + /// Defines texture utilities + +-#include "../../../DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h" +-#include "../../../DiligentCore/Graphics/GraphicsEngine/interface/Texture.h" +-#include "../../../DiligentCore/Graphics/GraphicsEngine/interface/RenderDevice.h" ++#include "DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h" ++#include "DiligentCore/Graphics/GraphicsEngine/interface/Texture.h" ++#include "DiligentCore/Graphics/GraphicsEngine/interface/RenderDevice.h" + #include "TextureLoader.h" + + DILIGENT_BEGIN_NAMESPACE(Diligent) + + +-#include "../../../DiligentCore/Primitives/interface/DefineGlobalFuncHelperMacros.h" ++#include "DiligentCore/Primitives/interface/DefineGlobalFuncHelperMacros.h" + + /// Creates a texture from file. + +@@ -51,6 +51,6 @@ void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromFile)(const Char* F + IRenderDevice* pDevice, + ITexture** ppTexture); + +-#include "../../../DiligentCore/Primitives/interface/UndefGlobalFuncHelperMacros.h" ++#include "DiligentCore/Primitives/interface/UndefGlobalFuncHelperMacros.h" + + DILIGENT_END_NAMESPACE // namespace Diligent diff --git a/recipes/diligent-tools/all/patches/0005-fix-include-path.diff b/recipes/diligent-tools/all/patches/0005-fix-include-path.diff new file mode 100644 index 0000000000000..9f64d594c669c --- /dev/null +++ b/recipes/diligent-tools/all/patches/0005-fix-include-path.diff @@ -0,0 +1,13 @@ +diff --git a/Imgui/src/ImGuiImplWin32.cpp b/Imgui/src/ImGuiImplWin32.cpp +index 2c01cc6..403375c 100644 +--- a/Imgui/src/ImGuiImplWin32.cpp ++++ b/Imgui/src/ImGuiImplWin32.cpp +@@ -33,7 +33,7 @@ + #include "GraphicsTypes.h" + #include "imgui.h" + #include "ImGuiImplWin32.hpp" +-#include "backends/imgui_impl_win32.h" ++#include "../res/bindings/imgui_impl_win32.h" + #include "DebugUtilities.hpp" + + IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/recipes/diligent-tools/all/patches/0006-2.5.2-use-imgui-from-conan.diff b/recipes/diligent-tools/all/patches/0006-2.5.2-use-imgui-from-conan.diff new file mode 100644 index 0000000000000..9c9e5cb1cfd03 --- /dev/null +++ b/recipes/diligent-tools/all/patches/0006-2.5.2-use-imgui-from-conan.diff @@ -0,0 +1,21 @@ +diff --git a/Imgui/CMakeLists.txt b/Imgui/CMakeLists.txt +index 89e8a33..64a2a77 100644 +--- a/Imgui/CMakeLists.txt ++++ b/Imgui/CMakeLists.txt +@@ -78,8 +78,6 @@ add_library(Diligent-Imgui STATIC + ${SOURCE} + ${INCLUDE} + ${INTERFACE} +- ${DEAR_IMGUI_SOURCE} +- ${DEAR_IMGUI_INCLUDE} + ${DEAR_IMGUI_INTERFACE} + ${IMGUIZMO_QUAT_SOURCE} + ) +@@ -124,6 +122,7 @@ PRIVATE + Diligent-GraphicsEngineInterface + Diligent-GraphicsAccessories + Diligent-GraphicsTools ++ imgui::imgui + ) + + set_target_properties(Diligent-Imgui PROPERTIES diff --git a/recipes/diligent-tools/all/patches/0007-2.5.2-use-diligent-core-dependencies.diff b/recipes/diligent-tools/all/patches/0007-2.5.2-use-diligent-core-dependencies.diff new file mode 100644 index 0000000000000..fa18122657068 --- /dev/null +++ b/recipes/diligent-tools/all/patches/0007-2.5.2-use-diligent-core-dependencies.diff @@ -0,0 +1,97 @@ +diff --git a/AssetLoader/CMakeLists.txt b/AssetLoader/CMakeLists.txt +index 9c9a16d..7479b6c 100644 +--- a/AssetLoader/CMakeLists.txt ++++ b/AssetLoader/CMakeLists.txt +@@ -35,13 +35,8 @@ source_group("interface" FILES ${INTERFACE}) + + target_link_libraries(Diligent-AssetLoader + PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools + Diligent-TextureLoader ++ diligent-core::diligent-core + ) + + if (TARGET draco) +diff --git a/HLSL2GLSLConverter/CMakeLists.txt b/HLSL2GLSLConverter/CMakeLists.txt +index 0b1de80..5f800f3 100644 +--- a/HLSL2GLSLConverter/CMakeLists.txt ++++ b/HLSL2GLSLConverter/CMakeLists.txt +@@ -33,12 +33,7 @@ target_compile_definitions(HLSL2GLSLConverter PRIVATE UNICODE) + + target_link_libraries(HLSL2GLSLConverter + PRIVATE +- Diligent-BuildSettings +- Diligent-TargetPlatform +- Diligent-Common +- Diligent-GraphicsTools +- Diligent-HLSL2GLSLConverterLib +- Diligent-GraphicsEngineOpenGL-static ++ diligent-core::diligent-core + ) + + source_group("source" FILES ${SOURCE}) +diff --git a/Imgui/CMakeLists.txt b/Imgui/CMakeLists.txt +index 64a2a77..bc0fb39 100644 +--- a/Imgui/CMakeLists.txt ++++ b/Imgui/CMakeLists.txt +@@ -116,13 +116,8 @@ source_group("imGuIZMO.quat" FILES ${IMGUIZMO_QUAT_SOURCE}) + + target_link_libraries(Diligent-Imgui + PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools +- imgui::imgui ++ diligent-core::diligent-core ++ imgui::imgui + ) + + set_target_properties(Diligent-Imgui PROPERTIES +diff --git a/NativeApp/Android/ndk_helper/CMakeLists.txt b/NativeApp/Android/ndk_helper/CMakeLists.txt +index 6f23857..35d2f02 100644 +--- a/NativeApp/Android/ndk_helper/CMakeLists.txt ++++ b/NativeApp/Android/ndk_helper/CMakeLists.txt +@@ -29,7 +29,7 @@ PUBLIC + + target_link_libraries(NDKHelper + PRIVATE +- Diligent-BuildSettings ++ diligent-core::diligent-core + PUBLIC + native_app_glue + ) +diff --git a/NativeApp/CMakeLists.txt b/NativeApp/CMakeLists.txt +index 7ea2063..951206b 100644 +--- a/NativeApp/CMakeLists.txt ++++ b/NativeApp/CMakeLists.txt +@@ -435,8 +435,7 @@ PUBLIC + + target_link_libraries(Diligent-NativeAppBase + PRIVATE +- Diligent-BuildSettings +- Diligent-Common ++ diligent-core::diligent-core + ) + + if(PLATFORM_WIN32) +diff --git a/NativeApp/Linux/CMakeLists.txt b/NativeApp/Linux/CMakeLists.txt +index a550fe0..e17d01c 100644 +--- a/NativeApp/Linux/CMakeLists.txt ++++ b/NativeApp/Linux/CMakeLists.txt +@@ -20,7 +20,7 @@ source_group("interface" FILES ${INTERFACE}) + + target_link_libraries(XCBKeySyms + PRIVATE +- Diligent-BuildSettings ++ diligent-core::diligent-core + xcb + ) + diff --git a/recipes/diligent-tools/all/patches/0008-2.5.2-use-conan-dependencies.diff b/recipes/diligent-tools/all/patches/0008-2.5.2-use-conan-dependencies.diff new file mode 100644 index 0000000000000..25a58db257d65 --- /dev/null +++ b/recipes/diligent-tools/all/patches/0008-2.5.2-use-conan-dependencies.diff @@ -0,0 +1,18 @@ +diff --git a/TextureLoader/CMakeLists.txt b/TextureLoader/CMakeLists.txt +index 362e209..256b352 100644 +--- a/TextureLoader/CMakeLists.txt ++++ b/TextureLoader/CMakeLists.txt +@@ -47,12 +47,7 @@ source_group("interface" FILES ${INTERFACE}) + + target_link_libraries(Diligent-TextureLoader + PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools ++ diligent-core::diligent-core + PNG::PNG + TIFF::TIFF + ZLIB::ZLIB diff --git a/recipes/diligent-tools/all/patches/0009-2.5.2-fix-include-path.diff b/recipes/diligent-tools/all/patches/0009-2.5.2-fix-include-path.diff new file mode 100644 index 0000000000000..3d6f8246a5f82 --- /dev/null +++ b/recipes/diligent-tools/all/patches/0009-2.5.2-fix-include-path.diff @@ -0,0 +1,13 @@ +diff --git a/Imgui/src/ImGuiImplWin32.cpp b/Imgui/src/ImGuiImplWin32.cpp +--- a/Imgui/src/ImGuiImplWin32.cpp ++++ b/Imgui/src/ImGuiImplWin32.cpp +@@ -32,7 +32,7 @@ + #include "GraphicsTypes.h" + #include "imgui.h" + #include "ImGuiImplWin32.hpp" +-#include "backends/imgui_impl_win32.h" ++#include "../res/bindings/imgui_impl_win32.h" + #include "DebugUtilities.hpp" + + IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + diff --git a/recipes/diligent-tools/all/patches/0010-2.5.2-fix-render-state-notation-paths.diff b/recipes/diligent-tools/all/patches/0010-2.5.2-fix-render-state-notation-paths.diff new file mode 100644 index 0000000000000..9099a853a4abb --- /dev/null +++ b/recipes/diligent-tools/all/patches/0010-2.5.2-fix-render-state-notation-paths.diff @@ -0,0 +1,43 @@ +diff --git a/RenderStateNotation/CMakeLists.txt b/RenderStateNotation/CMakeLists.txt +index fca3d7b..30ded42 100644 +--- a/RenderStateNotation/CMakeLists.txt ++++ b/RenderStateNotation/CMakeLists.txt +@@ -3,18 +3,18 @@ cmake_minimum_required (VERSION 3.6) + project(Diligent-RenderStateNotation CXX) + + set(REFLECTED +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/BlendState.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/DepthStencilState.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/InputLayout.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/PipelineResourceSignature.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/PipelineState.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/RasterizerState.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/RenderPass.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/Shader.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/ShaderResourceVariable.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/GraphicsEngine/interface/Sampler.h +- ${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/Graphics/Archiver/interface/ArchiverFactory.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/BlendState.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/DepthStencilState.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/InputLayout.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/PipelineResourceSignature.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/PipelineState.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/RasterizerState.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/RenderPass.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/Shader.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/ShaderResourceVariable.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/GraphicsEngine/interface/Sampler.h ++ ${CONAN_DILIGENT-CORE_ROOT}/include/DiligentCore/Graphics/Archiver/interface/ArchiverFactory.h + ) + + set(RSN_PARSER_HEADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/parser_headers CACHE INTERNAL "Render State Notation Parser generated headers directory") +@@ -64,7 +64,6 @@ endif() + + add_custom_command(OUTPUT ${GENERATED} + COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/scripts/cxx_generator.py" --dir "." --files ${REFLECTED} +- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/../../DiligentCore/BuildTools/FormatValidation/${CLANG_FORMAT_VERSION}" -i *.hpp --verbose + WORKING_DIRECTORY "${RSN_PARSER_GENERATED_HEADERS_DIR}" + DEPENDS ${REFLECTED} + COMMENT "RSN Parser Header Generation") diff --git a/recipes/diligent-tools/all/patches/0011-2.5.2-use-conan-dependencies-part2.diff b/recipes/diligent-tools/all/patches/0011-2.5.2-use-conan-dependencies-part2.diff new file mode 100644 index 0000000000000..75579bd94bb7b --- /dev/null +++ b/recipes/diligent-tools/all/patches/0011-2.5.2-use-conan-dependencies-part2.diff @@ -0,0 +1,35 @@ +diff --git a/RenderStateNotation/CMakeLists.txt b/RenderStateNotation/CMakeLists.txt +index 30ded42..34cc344 100644 +--- a/RenderStateNotation/CMakeLists.txt ++++ b/RenderStateNotation/CMakeLists.txt +@@ -88,12 +88,7 @@ PRIVATE + + target_link_libraries(Diligent-RenderStateNotation + PRIVATE +- Diligent-BuildSettings +- Diligent-Common +- Diligent-PlatformInterface +- Diligent-GraphicsEngineInterface +- Diligent-GraphicsAccessories +- Diligent-GraphicsTools ++diligent-core::diligent-core + ) + + target_compile_definitions(Diligent-RenderStateNotation PUBLIC JSON_DIAGNOSTICS=1) +diff --git a/RenderStatePackager/CMakeLists.txt b/RenderStatePackager/CMakeLists.txt +index 003a298..f047083 100644 +--- a/RenderStatePackager/CMakeLists.txt ++++ b/RenderStatePackager/CMakeLists.txt +@@ -25,11 +25,7 @@ target_include_directories(Diligent-RenderStatePackager + + target_link_libraries(Diligent-RenderStatePackager + PUBLIC +- Diligent-BuildSettings +- Diligent-GraphicsAccessories +- Diligent-Common +- Diligent-Archiver-static +- Diligent-RenderStateNotation ++diligent-core::diligent-core + ) + + set_target_properties(Diligent-RenderStatePackager PROPERTIES diff --git a/recipes/diligent-tools/all/patches/0012-2.5.2-fix-imgui-include-path.diff b/recipes/diligent-tools/all/patches/0012-2.5.2-fix-imgui-include-path.diff new file mode 100644 index 0000000000000..c8b1088f0d524 --- /dev/null +++ b/recipes/diligent-tools/all/patches/0012-2.5.2-fix-imgui-include-path.diff @@ -0,0 +1,26 @@ +diff --git a/Imgui/src/ImGuiImplMacOS.mm b/Imgui/src/ImGuiImplMacOS.mm +index 3b5c217..6cdabdb 100644 +--- a/Imgui/src/ImGuiImplMacOS.mm ++++ b/Imgui/src/ImGuiImplMacOS.mm +@@ -23,7 +23,7 @@ + + #include "imgui.h" + #include "ImGuiImplMacOS.hpp" +-#include "backends/imgui_impl_osx.h" ++#include "../res/bindings/imgui_impl_osx.h" + #import + + namespace Diligent +diff --git a/Imgui/src/ImGuiImplWin32.cpp b/Imgui/src/ImGuiImplWin32.cpp +index d5f4767..b7cefb2 100644 +--- a/Imgui/src/ImGuiImplWin32.cpp ++++ b/Imgui/src/ImGuiImplWin32.cpp +@@ -32,7 +32,7 @@ + #include "GraphicsTypes.h" + #include "imgui.h" + #include "ImGuiImplWin32.hpp" +-#include "backends/imgui_impl_win32.h" ++#include "../res/bindings/imgui_impl_win32.h" + #include "DebugUtilities.hpp" + + IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); \ No newline at end of file diff --git a/recipes/diligent-tools/all/test_package/CMakeLists.txt b/recipes/diligent-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..86493ca2e0e0f --- /dev/null +++ b/recipes/diligent-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(diligent-tools CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} diligent-tools::diligent-tools) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/diligent-tools/all/test_package/conanfile.py b/recipes/diligent-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/diligent-tools/all/test_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/diligent-tools/all/test_package/test_package.cpp b/recipes/diligent-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5d09457bb585e --- /dev/null +++ b/recipes/diligent-tools/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + Diligent::GLTF::Material material; + return 0; +} diff --git a/recipes/diligent-tools/config.yml b/recipes/diligent-tools/config.yml new file mode 100644 index 0000000000000..961e780a18a9f --- /dev/null +++ b/recipes/diligent-tools/config.yml @@ -0,0 +1,9 @@ +versions: + "api.252009": + folder: "all" + "api.252005": + folder: "all" + "cci.20211009": + folder: "all" + "2.5.2": + folder: "all" diff --git a/recipes/diligentgraphics-spirv-headers/all/CMakeLists.txt b/recipes/diligentgraphics-spirv-headers/all/CMakeLists.txt new file mode 100644 index 0000000000000..1848ca5a77c35 --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/diligentgraphics-spirv-headers/all/conandata.yml b/recipes/diligentgraphics-spirv-headers/all/conandata.yml new file mode 100644 index 0000000000000..484bd4f756594 --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20211006": + url: https://github.com/DiligentGraphics/SPIRV-Headers/archive/5ea2d62e8c0ddd9e2a7d0ca5e3f2335e09e5f408.zip + sha256: 8b9a9b49600a01d7d768c7e95ae09a4e81e7b2b3ed0a7a24d2375474c00d06ff diff --git a/recipes/diligentgraphics-spirv-headers/all/conanfile.py b/recipes/diligentgraphics-spirv-headers/all/conanfile.py new file mode 100644 index 0000000000000..2ea40ddfdfe54 --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/all/conanfile.py @@ -0,0 +1,59 @@ +from conans import ConanFile, tools, CMake +import os + +required_conan_version = ">=1.33.0" + + +class SpirvheadersConan(ConanFile): + name = "diligentgraphics-spirv-headers" + homepage = "https://github.com/DiligentGraphics/SPIRV-Headers" + description = "Diligent fork of header files for the SPIRV instruction set." + license = "MIT-KhronosGroup" + topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "khronos") + url = "https://github.com/conan-io/conan-center-index" + provides = "spirv-headers" + deprecated = "spirv-headers" + + settings = "os", "compiler", "arch", "build_type" + + exports_sources = "CMakeLists.txt" + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["SPIRV_HEADERS_SKIP_EXAMPLES"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "SPIRV-Headers" + self.cpp_info.names["cmake_find_package_multi"] = "SPIRV-Headers" diff --git a/recipes/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt b/recipes/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1a13bcce874fc --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SPIRV-Headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} SPIRV-Headers::SPIRV-Headers) diff --git a/recipes/diligentgraphics-spirv-headers/all/test_package/conanfile.py b/recipes/diligentgraphics-spirv-headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/all/test_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/diligentgraphics-spirv-headers/all/test_package/test_package.cpp b/recipes/diligentgraphics-spirv-headers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..db6d549853bea --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2016 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are 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 Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE 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 +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +#include +#include +#include + +namespace { + +const GLSLstd450 kSin = GLSLstd450Sin; +const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; +const spv::Op kNop = spv::OpNop; + +} + +int main(int argc, char ** argv) +{ + + return 0; +} diff --git a/recipes/diligentgraphics-spirv-headers/config.yml b/recipes/diligentgraphics-spirv-headers/config.yml new file mode 100644 index 0000000000000..ae88f0a176dec --- /dev/null +++ b/recipes/diligentgraphics-spirv-headers/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211006": + folder: all diff --git a/recipes/diligentgraphics-spirv-tools/all/CMakeLists.txt b/recipes/diligentgraphics-spirv-tools/all/CMakeLists.txt new file mode 100644 index 0000000000000..1848ca5a77c35 --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/diligentgraphics-spirv-tools/all/conandata.yml b/recipes/diligentgraphics-spirv-tools/all/conandata.yml new file mode 100644 index 0000000000000..707d246773a1c --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20211008": + url: https://github.com/DiligentGraphics/SPIRV-Tools/archive/7308083707a4bffb62bcfbc721851033e5534bb7.zip + sha256: bfe9d6f1c2cfc354c0eda3c2139485cae4483d8b12fa994d1f0f1f3624645fcd diff --git a/recipes/diligentgraphics-spirv-tools/all/conanfile.py b/recipes/diligentgraphics-spirv-tools/all/conanfile.py new file mode 100644 index 0000000000000..04f39fb2c75a4 --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/conanfile.py @@ -0,0 +1,223 @@ +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.33.0" + + +class SpirvtoolsConan(ConanFile): + name = "diligentgraphics-spirv-tools" + homepage = "https://github.com/DiligentGraphics/SPIRV-Tools/" + description = "Diligent fork. Create and optimize SPIRV shaders" + topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "hlsl", "khronos", "diligent") + url = "https://github.com/conan-io/conan-center-index" + provides = "spirv-tools" + deprecated = "spirv-tools" + license = "Apache-2.0" + + settings = "os", "compiler", "arch", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_executables": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executables": True, + } + + short_paths = True + + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if not self._get_compatible_spirv_headers_version: + raise ConanInvalidConfiguration("unknown diligentgraphics-spirv-headers version") + self.requires("diligentgraphics-spirv-headers/{}".format(self._get_compatible_spirv_headers_version)) + + @property + def _get_compatible_spirv_headers_version(self): + return { + "cci.20211008": "cci.20211006", + }.get(str(self.version), False) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def _validate_dependency_graph(self): + if self.deps_cpp_info["diligentgraphics-spirv-headers"].version != self._get_compatible_spirv_headers_version: + raise ConanInvalidConfiguration("diligentgraphics-spirv-tools {0} requires diligentgraphics-spirv-headers {1}" + .format(self.version, self._get_compatible_spirv_headers_version)) + + 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 + + cmake = CMake(self) + + # Required by the project's CMakeLists.txt + cmake.definitions["SPIRV-Headers_SOURCE_DIR"] = self.deps_cpp_info["diligentgraphics-spirv-headers"].rootpath.replace("\\", "/") + + # There are some switch( ) statements that are causing errors + # need to turn this off + cmake.definitions["SPIRV_WERROR"] = False + + cmake.definitions["SKIP_SPIRV_TOOLS_INSTALL"] = False + cmake.definitions["SPIRV_LOG_DEBUG"] = False + cmake.definitions["SPIRV_SKIP_TESTS"] = True + cmake.definitions["SPIRV_CHECK_CONTEXT"] = False + cmake.definitions["SPIRV_BUILD_FUZZER"] = False + cmake.definitions["SPIRV_SKIP_EXECUTABLES"] = not self.options.build_executables + + cmake.configure(build_folder=self._build_subfolder) + self._cmake = cmake + return self._cmake + + def build(self): + self._validate_dependency_graph() + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + # CMAKE_POSITION_INDEPENDENT_CODE was set ON for the entire + # project in the lists file. + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + def package(self): + self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools")) + tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-link")) + tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-opt")) + tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-reduce")) + tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-lint")) + + if self.options.shared: + for file_name in ["*SPIRV-Tools", "*SPIRV-Tools-opt", "*SPIRV-Tools-link", "*SPIRV-Tools-reduce"]: + for ext in [".a", ".lib"]: + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), file_name + ext) + else: + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*SPIRV-Tools-shared.dll") + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*SPIRV-Tools-shared*") + + if self.options.shared: + targets = {"SPIRV-Tools-shared": "diligentgraphics-spirv-tools::SPIRV-Tools"} + else: + targets = { + "SPIRV-Tools": "diligentgraphics-spirv-tools::SPIRV-Tools", # before 2020.5, kept for conveniency + "SPIRV-Tools-static": "diligentgraphics-spirv-tools::SPIRV-Tools", + "SPIRV-Tools-opt": "diligentgraphics-spirv-tools::SPIRV-Tools-opt", + "SPIRV-Tools-link": "diligentgraphics-spirv-tools::SPIRV-Tools-link", + "SPIRV-Tools-reduce": "diligentgraphics-spirv-tools::SPIRV-Tools-reduce", + } + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + targets, + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "SPIRV-Tools" + self.cpp_info.filenames["cmake_find_package_multi"] = "SPIRV-Tools" + self.cpp_info.names["pkg_config"] = "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools" + + # SPIRV-Tools + self.cpp_info.components["spirv-tools-core"].names["cmake_find_package"] = "SPIRV-Tools" + self.cpp_info.components["spirv-tools-core"].names["cmake_find_package_multi"] = "SPIRV-Tools" + self.cpp_info.components["spirv-tools-core"].builddirs.append(self._module_subfolder) + self.cpp_info.components["spirv-tools-core"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-core"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-core"].libs = ["SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools"] + self.cpp_info.components["spirv-tools-core"].requires = ["diligentgraphics-spirv-headers::diligentgraphics-spirv-headers"] + if self.options.shared: + self.cpp_info.components["spirv-tools-core"].defines = ["SPIRV_TOOLS_SHAREDLIB"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spirv-tools-core"].system_libs.extend(["m", "rt"]) + if not self.options.shared and tools.stdcpp_library(self): + self.cpp_info.components["spirv-tools-core"].system_libs.append(tools.stdcpp_library(self)) + + # FIXME: others components should have their own CMake config file + if not self.options.shared: + # SPIRV-Tools-opt + self.cpp_info.components["spirv-tools-opt"].names["cmake_find_package"] = "SPIRV-Tools-opt" + self.cpp_info.components["spirv-tools-opt"].names["cmake_find_package_multi"] = "SPIRV-Tools-opt" + self.cpp_info.components["spirv-tools-opt"].builddirs.append(self._module_subfolder) + self.cpp_info.components["spirv-tools-opt"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-opt"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-opt"].libs = ["SPIRV-Tools-opt"] + self.cpp_info.components["spirv-tools-opt"].requires = ["spirv-tools-core", "diligentgraphics-spirv-headers::diligentgraphics-spirv-headers"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spirv-tools-opt"].system_libs.append("m") + # SPIRV-Tools-link + self.cpp_info.components["spirv-tools-link"].names["cmake_find_package"] = "SPIRV-Tools-link" + self.cpp_info.components["spirv-tools-link"].names["cmake_find_package_multi"] = "SPIRV-Tools-link" + self.cpp_info.components["spirv-tools-link"].builddirs.append(self._module_subfolder) + self.cpp_info.components["spirv-tools-link"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-link"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-link"].libs = ["SPIRV-Tools-link"] + self.cpp_info.components["spirv-tools-link"].requires = ["spirv-tools-core", "spirv-tools-opt"] + # SPIRV-Tools-reduce + self.cpp_info.components["spirv-tools-reduce"].names["cmake_find_package"] = "SPIRV-Tools-reduce" + self.cpp_info.components["spirv-tools-reduce"].names["cmake_find_package_multi"] = "SPIRV-Tools-reduce" + self.cpp_info.components["spirv-tools-reduce"].builddirs.append(self._module_subfolder) + self.cpp_info.components["spirv-tools-reduce"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-reduce"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-reduce"].libs = ["SPIRV-Tools-reduce"] + self.cpp_info.components["spirv-tools-reduce"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: %s" % bin_path) + self.env_info.path.append(bin_path) diff --git a/recipes/diligentgraphics-spirv-tools/all/patches/support-SPV_KHR_fragment_shading_rate.patch b/recipes/diligentgraphics-spirv-tools/all/patches/support-SPV_KHR_fragment_shading_rate.patch new file mode 100644 index 0000000000000..67d7765e7856e --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/patches/support-SPV_KHR_fragment_shading_rate.patch @@ -0,0 +1,243 @@ +Patch from 2 PR: +https://github.com/KhronosGroup/SPIRV-Tools/pull/3943 +https://github.com/KhronosGroup/SPIRV-Tools/pull/4014 +Mandatory in v2020.5 with spirv-headers 1.5.4, otherwise compilation fails +with 'SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE': undeclared identifier +--- a/include/spirv-tools/libspirv.h ++++ b/include/spirv-tools/libspirv.h +@@ -182,6 +182,7 @@ typedef enum spv_operand_type_t { + SPV_OPERAND_TYPE_LOOP_CONTROL, // SPIR-V Sec 3.23 + SPV_OPERAND_TYPE_FUNCTION_CONTROL, // SPIR-V Sec 3.24 + SPV_OPERAND_TYPE_MEMORY_ACCESS, // SPIR-V Sec 3.26 ++ SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE, // SPIR-V Sec 3.FSR + + // The remaining operand types are only used internally by the assembler. + // There are two categories: +--- a/source/operand.cpp ++++ b/source/operand.cpp +@@ -208,6 +208,8 @@ const char* spvOperandTypeStr(spv_operand_type_t type) { + case SPV_OPERAND_TYPE_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + return "memory access"; ++ case SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE: ++ return "shading rate"; + case SPV_OPERAND_TYPE_SCOPE_ID: + return "scope ID"; + case SPV_OPERAND_TYPE_GROUP_OPERATION: +@@ -360,6 +362,7 @@ bool spvOperandIsConcreteMask(spv_operand_type_t type) { + case SPV_OPERAND_TYPE_LOOP_CONTROL: + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + case SPV_OPERAND_TYPE_MEMORY_ACCESS: ++ case SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE: + case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: + case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS: + return true; +--- a/source/val/validate_builtins.cpp ++++ b/source/val/validate_builtins.cpp +@@ -230,6 +230,12 @@ class BuiltInsValidator { + spv_result_t ValidateComputeI32InputAtDefinition(const Decoration& decoration, + const Instruction& inst); + ++ spv_result_t ValidatePrimitiveShadingRateAtDefinition( ++ const Decoration& decoration, const Instruction& inst); ++ ++ spv_result_t ValidateShadingRateAtDefinition(const Decoration& decoration, ++ const Instruction& inst); ++ + // The following section contains functions which are called when id defined + // by |referenced_inst| is + // 1. referenced by |referenced_from_inst| +@@ -383,6 +389,16 @@ class BuiltInsValidator { + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + ++ spv_result_t ValidatePrimitiveShadingRateAtReference( ++ const Decoration& decoration, const Instruction& built_in_inst, ++ const Instruction& referenced_inst, ++ const Instruction& referenced_from_inst); ++ ++ spv_result_t ValidateShadingRateAtReference( ++ const Decoration& decoration, const Instruction& built_in_inst, ++ const Instruction& referenced_inst, ++ const Instruction& referenced_from_inst); ++ + // Validates that |built_in_inst| is not (even indirectly) referenced from + // within a function which can be called with |execution_model|. + // +@@ -3314,6 +3330,142 @@ spv_result_t BuiltInsValidator::ValidateSMBuiltinsAtReference( + return SPV_SUCCESS; + } + ++spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtDefinition( ++ const Decoration& decoration, const Instruction& inst) { ++ if (spvIsVulkanEnv(_.context()->target_env)) { ++ if (spv_result_t error = ValidateI32( ++ decoration, inst, ++ [this, &inst, ++ &decoration](const std::string& message) -> spv_result_t { ++ return _.diag(SPV_ERROR_INVALID_DATA, &inst) ++ << _.VkErrorID(4486) ++ << "According to the Vulkan spec BuiltIn " ++ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, ++ decoration.params()[0]) ++ << " variable needs to be a 32-bit int scalar. " ++ << message; ++ })) { ++ return error; ++ } ++ } ++ ++ // Seed at reference checks with this built-in. ++ return ValidatePrimitiveShadingRateAtReference(decoration, inst, inst, inst); ++} ++ ++spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtReference( ++ const Decoration& decoration, const Instruction& built_in_inst, ++ const Instruction& referenced_inst, ++ const Instruction& referenced_from_inst) { ++ if (spvIsVulkanEnv(_.context()->target_env)) { ++ const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); ++ if (storage_class != SpvStorageClassMax && ++ storage_class != SpvStorageClassOutput) { ++ return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) ++ << _.VkErrorID(4485) << "Vulkan spec allows BuiltIn " ++ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, ++ decoration.params()[0]) ++ << " to be only used for variables with Output storage class. " ++ << GetReferenceDesc(decoration, built_in_inst, referenced_inst, ++ referenced_from_inst) ++ << " " << GetStorageClassDesc(referenced_from_inst); ++ } ++ ++ for (const SpvExecutionModel execution_model : execution_models_) { ++ switch (execution_model) { ++ case SpvExecutionModelVertex: ++ case SpvExecutionModelGeometry: ++ case SpvExecutionModelMeshNV: ++ break; ++ default: { ++ return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) ++ << _.VkErrorID(4484) << "Vulkan spec allows BuiltIn " ++ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, ++ decoration.params()[0]) ++ << " to be used only with Vertex, Geometry, or MeshNV " ++ "execution models. " ++ << GetReferenceDesc(decoration, built_in_inst, referenced_inst, ++ referenced_from_inst, execution_model); ++ } ++ } ++ } ++ } ++ ++ if (function_id_ == 0) { ++ // Propagate this rule to all dependant ids in the global scope. ++ id_to_at_reference_checks_[referenced_from_inst.id()].push_back( ++ std::bind(&BuiltInsValidator::ValidatePrimitiveShadingRateAtReference, ++ this, decoration, built_in_inst, referenced_from_inst, ++ std::placeholders::_1)); ++ } ++ ++ return SPV_SUCCESS; ++} ++ ++spv_result_t BuiltInsValidator::ValidateShadingRateAtDefinition( ++ const Decoration& decoration, const Instruction& inst) { ++ if (spvIsVulkanEnv(_.context()->target_env)) { ++ if (spv_result_t error = ValidateI32( ++ decoration, inst, ++ [this, &inst, ++ &decoration](const std::string& message) -> spv_result_t { ++ return _.diag(SPV_ERROR_INVALID_DATA, &inst) ++ << _.VkErrorID(4492) ++ << "According to the Vulkan spec BuiltIn " ++ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, ++ decoration.params()[0]) ++ << " variable needs to be a 32-bit int scalar. " ++ << message; ++ })) { ++ return error; ++ } ++ } ++ ++ // Seed at reference checks with this built-in. ++ return ValidateShadingRateAtReference(decoration, inst, inst, inst); ++} ++ ++spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( ++ const Decoration& decoration, const Instruction& built_in_inst, ++ const Instruction& referenced_inst, ++ const Instruction& referenced_from_inst) { ++ if (spvIsVulkanEnv(_.context()->target_env)) { ++ const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); ++ if (storage_class != SpvStorageClassMax && ++ storage_class != SpvStorageClassInput) { ++ return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) ++ << _.VkErrorID(4491) << "Vulkan spec allows BuiltIn " ++ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, ++ decoration.params()[0]) ++ << " to be only used for variables with Input storage class. " ++ << GetReferenceDesc(decoration, built_in_inst, referenced_inst, ++ referenced_from_inst) ++ << " " << GetStorageClassDesc(referenced_from_inst); ++ } ++ ++ for (const SpvExecutionModel execution_model : execution_models_) { ++ if (execution_model != SpvExecutionModelFragment) { ++ return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) ++ << _.VkErrorID(4490) << "Vulkan spec allows BuiltIn " ++ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, ++ decoration.params()[0]) ++ << " to be used only with the Fragment execution model. " ++ << GetReferenceDesc(decoration, built_in_inst, referenced_inst, ++ referenced_from_inst, execution_model); ++ } ++ } ++ } ++ ++ if (function_id_ == 0) { ++ // Propagate this rule to all dependant ids in the global scope. ++ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( ++ &BuiltInsValidator::ValidateShadingRateAtReference, this, decoration, ++ built_in_inst, referenced_from_inst, std::placeholders::_1)); ++ } ++ ++ return SPV_SUCCESS; ++} ++ + spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( + const Decoration& decoration, const Instruction& inst) { + const SpvBuiltIn label = SpvBuiltIn(decoration.params()[0]); +@@ -3515,6 +3667,12 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( + // No validation rules (for the moment). + break; + } ++ case SpvBuiltInPrimitiveShadingRateKHR: { ++ return ValidatePrimitiveShadingRateAtDefinition(decoration, inst); ++ } ++ case SpvBuiltInShadingRateKHR: { ++ return ValidateShadingRateAtDefinition(decoration, inst); ++ } + } + return SPV_SUCCESS; + } +--- a/source/val/validation_state.cpp ++++ b/source/val/validation_state.cpp +@@ -1517,6 +1517,18 @@ std::string ValidationState_t::VkErrorID(uint32_t id, + return VUID_WRAP(VUID-WorkgroupSize-WorkgroupSize-04426); + case 4427: + return VUID_WRAP(VUID-WorkgroupSize-WorkgroupSize-04427); ++ case 4484: ++ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-04484); ++ case 4485: ++ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-04485); ++ case 4486: ++ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-04486); ++ case 4490: ++ return VUID_WRAP(VUID-ShadingRateKHR-ShadingRateKHR-04490); ++ case 4491: ++ return VUID_WRAP(VUID-ShadingRateKHR-ShadingRateKHR-04491); ++ case 4492: ++ return VUID_WRAP(VUID-ShadingRateKHR-ShadingRateKHR-04492); + default: + return ""; // unknown id + }; diff --git a/recipes/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt b/recipes/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..17a8d915b246e --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SPIRV-Tools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_c test_package.c) +if(TARGET SPIRV-Tools-shared) + target_link_libraries(${PROJECT_NAME}_c SPIRV-Tools-shared) +elseif(TARGET SPIRV-Tools-static) + target_link_libraries(${PROJECT_NAME}_c SPIRV-Tools-static) +else() + message(FATAL_ERROR "Neither target SPIRV-Tools-shared or target SPIRV-Tools-shared exist") +endif() + +# TODO: we should call find_package(SPIRV-Tools-opt REQUIRED CONFIG), but not modeled right now +if(TARGET SPIRV-Tools-opt) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp SPIRV-Tools-opt) + set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) +endif() diff --git a/recipes/diligentgraphics-spirv-tools/all/test_package/conanfile.py b/recipes/diligentgraphics-spirv-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..095f9b5e4320c --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) + if not self.options["diligentgraphics-spirv-tools"].shared: + bin_path_cpp = os.path.join("bin", "test_package_cpp") + self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/diligentgraphics-spirv-tools/all/test_package/test_package.c b/recipes/diligentgraphics-spirv-tools/all/test_package/test_package.c new file mode 100644 index 0000000000000..932428db546e7 --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "spirv-tools/libspirv.h" + +int main(int argc, char ** argv) +{ +const char input_text[] = + "OpCapability Shader\n" + "OpCapability Linkage\n" + "OpMemoryModel Logical GLSL450"; + spv_text text; + spv_binary binary; + spv_context context; + + context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + + binary = 0; + if( SPV_SUCCESS != spvTextToBinary(context, input_text, sizeof(input_text), &binary, 0) ) + { + return 1; + } + + text = 0; + if( SPV_SUCCESS != spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, 0) ) + { + return 1; + } + + spvTextDestroy(text); + spvBinaryDestroy(binary); + spvContextDestroy(context); + return 0; +} diff --git a/recipes/diligentgraphics-spirv-tools/all/test_package/test_package.cpp b/recipes/diligentgraphics-spirv-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a1e22c7365ae8 --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/all/test_package/test_package.cpp @@ -0,0 +1,65 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This program demonstrates basic SPIR-V module processing using +// SPIRV-Tools C++ API: +// * Assembling +// * Validating +// * Optimizing +// * Disassembling + +#include +#include +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +int main() { + const std::string source = + " OpCapability Linkage " + " OpCapability Shader " + " OpMemoryModel Logical GLSL450 " + " OpSource GLSL 450 " + " OpDecorate %spec SpecId 1 " + " %int = OpTypeInt 32 1 " + " %spec = OpSpecConstant %int 0 " + "%const = OpConstant %int 42"; + + spvtools::SpirvTools core(SPV_ENV_UNIVERSAL_1_3); + spvtools::Optimizer opt(SPV_ENV_UNIVERSAL_1_3); + + auto print_msg_to_stderr = [](spv_message_level_t, const char*, + const spv_position_t&, const char* m) { + std::cerr << "error: " << m << std::endl; + }; + core.SetMessageConsumer(print_msg_to_stderr); + opt.SetMessageConsumer(print_msg_to_stderr); + + std::vector spirv; + if (!core.Assemble(source, &spirv)) return 1; + if (!core.Validate(spirv)) return 1; + + opt.RegisterPass(spvtools::CreateSetSpecConstantDefaultValuePass({{1, "42"}})) + .RegisterPass(spvtools::CreateFreezeSpecConstantValuePass()) + .RegisterPass(spvtools::CreateUnifyConstantPass()) + .RegisterPass(spvtools::CreateStripDebugInfoPass()); + if (!opt.Run(spirv.data(), spirv.size(), &spirv)) return 1; + + std::string disassembly; + if (!core.Disassemble(spirv, &disassembly)) return 1; + std::cout << disassembly << "\n"; + + return 0; +} diff --git a/recipes/diligentgraphics-spirv-tools/config.yml b/recipes/diligentgraphics-spirv-tools/config.yml new file mode 100644 index 0000000000000..b60234b0142df --- /dev/null +++ b/recipes/diligentgraphics-spirv-tools/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211008": + folder: all diff --git a/recipes/diligentgraphics-vulkan-headers/all/conandata.yml b/recipes/diligentgraphics-vulkan-headers/all/conandata.yml new file mode 100644 index 0000000000000..055ccbddfe499 --- /dev/null +++ b/recipes/diligentgraphics-vulkan-headers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20211005": + url: "https://github.com/DiligentGraphics/Vulkan-Headers/archive/fa27a13cf74080df2ad421a788299db1276f17a7.zip" + sha256: "c4af8476d8ac788c5d7fea9fc74c982a64e280c592c5c68fe65e3119f40ed58e" diff --git a/recipes/diligentgraphics-vulkan-headers/all/conanfile.py b/recipes/diligentgraphics-vulkan-headers/all/conanfile.py new file mode 100644 index 0000000000000..7f3356c28a8d9 --- /dev/null +++ b/recipes/diligentgraphics-vulkan-headers/all/conanfile.py @@ -0,0 +1,49 @@ +from conans import ConanFile, tools +import glob +import os + +required_conan_version = ">=1.33" + + +class VulkanHeadersConan(ConanFile): + name = "diligentgraphics-vulkan-headers" + description = "Diligent fork of Vulkan Header files." + license = "Apache-2.0" + topics = ("vulkan-headers", "vulkan") + homepage = "https://github.com/DiligentGraphics/Vulkan-Headers" + url = "https://github.com/conan-io/conan-center-index" + provides = "vulkan-headers" + deprecated = "vulkan-headers" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy("*", dst="include", src=os.path.join(self.source_folder, self._source_subfolder, "include")) + self.copy("*", dst=os.path.join("res", "vulkan", "registry"), + src=os.path.join(self.source_folder, self._source_subfolder, "registry")) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "VulkanHeaders" + self.cpp_info.filenames["cmake_find_package_multi"] = "VulkanHeaders" + self.cpp_info.names["cmake_find_package"] = "Vulkan" + self.cpp_info.names["cmake_find_package_multi"] = "Vulkan" + self.cpp_info.components["vulkanheaders"].names["cmake_find_package"] = "Headers" + self.cpp_info.components["vulkanheaders"].names["cmake_find_package_multi"] = "Headers" + self.cpp_info.components["vulkanheaders"].bindirs = [] + self.cpp_info.components["vulkanheaders"].libdirs = [] + self.cpp_info.components["vulkanregistry"].names["cmake_find_package"] = "Registry" + self.cpp_info.components["vulkanregistry"].names["cmake_find_package_multi"] = "Registry" + self.cpp_info.components["vulkanregistry"].includedirs = [os.path.join("res", "vulkan", "registry")] + self.cpp_info.components["vulkanregistry"].bindirs = [] + self.cpp_info.components["vulkanregistry"].libdirs = [] diff --git a/recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt b/recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e69638f3fc18 --- /dev/null +++ b/recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(VulkanHeaders REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} Vulkan::Headers) diff --git a/recipes/diligentgraphics-vulkan-headers/all/test_package/conanfile.py b/recipes/diligentgraphics-vulkan-headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b6a26067f365d --- /dev/null +++ b/recipes/diligentgraphics-vulkan-headers/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/diligentgraphics-vulkan-headers/all/test_package/test_package.c b/recipes/diligentgraphics-vulkan-headers/all/test_package/test_package.c new file mode 100644 index 0000000000000..defd9fd301685 --- /dev/null +++ b/recipes/diligentgraphics-vulkan-headers/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include + +int main() { + VkApplicationInfo appInfo; + appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; + appInfo.pApplicationName = "Hello Conan"; + appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.pEngineName = "Dummy Engine"; + appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.apiVersion = VK_API_VERSION_1_0; + + VkInstanceCreateInfo createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + createInfo.pApplicationInfo = &appInfo; + createInfo.enabledLayerCount = 0; + createInfo.ppEnabledLayerNames = NULL; + createInfo.enabledExtensionCount = 0; + createInfo.ppEnabledExtensionNames = NULL; + + return 0; +} diff --git a/recipes/diligentgraphics-vulkan-headers/config.yml b/recipes/diligentgraphics-vulkan-headers/config.yml new file mode 100644 index 0000000000000..3d7bd37111af4 --- /dev/null +++ b/recipes/diligentgraphics-vulkan-headers/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211005": + folder: all diff --git a/recipes/dime/all/CMakeLists.txt b/recipes/dime/all/CMakeLists.txt new file mode 100644 index 0000000000000..8977c3f43d6f8 --- /dev/null +++ b/recipes/dime/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/dime/all/conandata.yml b/recipes/dime/all/conandata.yml new file mode 100644 index 0000000000000..3672fc5963336 --- /dev/null +++ b/recipes/dime/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.1": + url: "https://github.com/coin3d/dime/releases/download/dime-0.9.1/dime-0.9.1-src.tar.gz" + sha256: "ded4c45b4a13a876d87bb36a0fba40d3456ccda3add739791da117e9603f0325" diff --git a/recipes/dime/all/conanfile.py b/recipes/dime/all/conanfile.py new file mode 100644 index 0000000000000..4c72fb275c245 --- /dev/null +++ b/recipes/dime/all/conanfile.py @@ -0,0 +1,96 @@ +from conans import ConanFile, CMake, tools +from conan.tools.microsoft import is_msvc +import os +import functools + +required_conan_version = ">=1.33.0" + +class DimeConan(ConanFile): + name = "dime" + description = "DXF (Data eXchange Format) file format support library." + topics = ("dxf", "coin3d", "opengl", "graphics") + homepage = "https://github.com/coin3d/dime" + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + exports_sources = ["CMakeLists.txt"] + generators = "cmake", + settings = "os", "arch", "compiler", "build_type", + options = { + "fPIC": [True, False], + "shared": [True, False], + "fixbig": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "fixbig": False, + } + + @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): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["DIME_BUILD_SHARED_LIBS"] = self.options.shared + if self.options.fixbig: + cmake.definitions["CMAKE_CXX_FLAGS"] = "-DDIME_FIXBIG" + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "configure_file(${CMAKE_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)", + "configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)") + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.settings.os == "Windows" and is_msvc(self): + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_info(self): + libname = "dime" + if self.settings.os == "Windows" and is_msvc(self): + libname = "{}{}{}{}".format( + libname, + tools.Version(self.version).major, + "" if self.options.shared else "s", + "d" if self.settings.build_type == "Debug" else "", + ) + self.cpp_info.libs = [libname] + + if self.settings.os == "Windows": + self.cpp_info.cxxflags.append("-DDIME_DLL" if self.options.shared else "-DDIME_NOT_DLL") + if self.options.fixbig: + self.cpp_info.cxxflags.append("-DDIME_FIXBIG") + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/dime/all/test_package/CMakeLists.txt b/recipes/dime/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..78a1ddc2ab6be --- /dev/null +++ b/recipes/dime/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(dime CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} dime::dime) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/dime/all/test_package/conanfile.py b/recipes/dime/all/test_package/conanfile.py new file mode 100644 index 0000000000000..17d1e9ed261a6 --- /dev/null +++ b/recipes/dime/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + dxf_path = os.path.join(self.source_folder, "testFile_Bug01.dxf") + self.run("{} {}".format(bin_path, dxf_path), run_environment=True) diff --git a/recipes/dime/all/test_package/testFile_Bug01.dxf b/recipes/dime/all/test_package/testFile_Bug01.dxf new file mode 100644 index 0000000000000..0e5c47430e86d --- /dev/null +++ b/recipes/dime/all/test_package/testFile_Bug01.dxf @@ -0,0 +1,104 @@ + 0 +SECTION + 2 +ENTITIES + 0 +POLYLINE + 5 +205 + 8 +0 + 66 + 1 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 0 +VERTEX + 5 +279 + 8 +0 + 10 +-176.07272753254799 + 20 +-907.11665722290854 + 30 +0.0 + 0 +VERTEX + 5 +27A + 8 +0 + 10 +-176.07272753254799 + 20 +-157.11665722290871 + 30 +0.0 + 42 +-0.4142135623730951 + 0 +VERTEX + 5 +27B + 8 +0 + 10 +73.927272467451957 + 20 +92.883342777091343 + 30 +0.0 + 0 +VERTEX + 5 +27C + 8 +0 + 10 +573.92727246745198 + 20 +92.883342777091343 + 30 +0.0 + 42 +0.4142135623730951 + 0 +VERTEX + 5 +27D + 8 +0 + 10 +823.92727246745187 + 20 +342.88334277709129 + 30 +0.0 + 0 +VERTEX + 5 +27E + 8 +0 + 10 +823.92727246745187 + 20 +1092.883342777091 + 30 +0.0 + 0 +SEQEND + 5 +27F + 8 +0 + 0 +ENDSEC + 0 +EOF diff --git a/recipes/dime/all/test_package/test_package.cpp b/recipes/dime/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2b3fd63e8e439 --- /dev/null +++ b/recipes/dime/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include + +#include +#include +#include + +int main(int argc, char* argv[]) { + if (argc < 2) { + return 1; + } + const char* filename = argv[1]; + + dimeInput in; + + if (!in.setFile(filename)) { + std::cerr << "could not read dxf file : " << filename << std::endl; + return 1; + } + + dimeModel model; + model.read(&in); + + return 0; +} diff --git a/recipes/dime/config.yml b/recipes/dime/config.yml new file mode 100644 index 0000000000000..d25f7a4b69da5 --- /dev/null +++ b/recipes/dime/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.1": + folder: "all" diff --git a/recipes/directshowbaseclasses/all/CMakeLists.txt b/recipes/directshowbaseclasses/all/CMakeLists.txt new file mode 100644 index 0000000000000..bb980e8f92249 --- /dev/null +++ b/recipes/directshowbaseclasses/all/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.8.11) +project(strmbas) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(DSROOT "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/Samples/Win7Samples/multimedia/directshow/baseclasses") + +file(GLOB SOURCES "${DSROOT}/*.cpp") +file(GLOB HEADERS "${DSROOT}/*.h") + +add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS}) + +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${HEADERS}" + DEBUG_POSTFIX d + RELEASE_POSTFIX e) + +target_include_directories(${PROJECT_NAME} PRIVATE ${DSROOT}) + +target_compile_definitions(${PROJECT_NAME} PRIVATE UNICODE=1 _UNICODE=1) + +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include) diff --git a/recipes/directshowbaseclasses/all/conandata.yml b/recipes/directshowbaseclasses/all/conandata.yml new file mode 100644 index 0000000000000..49e00235843a1 --- /dev/null +++ b/recipes/directshowbaseclasses/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "260557": + sha256: 33ebd4f40f88520ed1df3785091eddc9d2140eeb50d43b7f1d932df63a3ade3b + url: https://github.com/microsoft/Windows-classic-samples/archive/260557.tar.gz diff --git a/recipes/directshowbaseclasses/all/conanfile.py b/recipes/directshowbaseclasses/all/conanfile.py new file mode 100644 index 0000000000000..4f42eddc66a52 --- /dev/null +++ b/recipes/directshowbaseclasses/all/conanfile.py @@ -0,0 +1,40 @@ +from conans import ConanFile, CMake, tools +import os + + +class DirectShowBaseClassesConan(ConanFile): + name = "directshowbaseclasses" + description = "Microsoft DirectShow Base Classes are a set of C++ classes and utility functions designed for " \ + "implementing DirectShow filters" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://docs.microsoft.com/en-us/windows/desktop/directshow/directshow-base-classes" + topics = ("conan", "directshow", "dshow") + license = "MIT" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = {"os": ["Windows"], "arch": ["x86", "x86_64"], "compiler": None, "build_type": None} + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + short_paths = True + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename('Windows-classic-samples-%s' % self.version, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ['strmbasd' if self.settings.build_type == 'Debug' else 'strmbase'] + self.cpp_info.system_libs = ['strmiids', 'winmm'] diff --git a/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt b/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/directshowbaseclasses/all/test_package/conanfile.py b/recipes/directshowbaseclasses/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b88a6525524a6 --- /dev/null +++ b/recipes/directshowbaseclasses/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/directshowbaseclasses/all/test_package/test_package.cpp b/recipes/directshowbaseclasses/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e908b81b10cd1 --- /dev/null +++ b/recipes/directshowbaseclasses/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include + +#include +#include + +int main() +{ + BITMAPINFOHEADER bh; + memset(&bh, 0, sizeof(BITMAPINFOHEADER)); + bh.biSize = sizeof(BITMAPINFOHEADER); + bh.biWidth = 1920; + bh.biHeight = 1080; + bh.biPlanes = 1; + bh.biBitCount = 32; + bh.biCompression = BI_RGB; + GetBitmapSize(&bh); + std::cout << "Microsoft DirectShow Base Classes" << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/directshowbaseclasses/config.yml b/recipes/directshowbaseclasses/config.yml new file mode 100644 index 0000000000000..42ada6777f50d --- /dev/null +++ b/recipes/directshowbaseclasses/config.yml @@ -0,0 +1,3 @@ +versions: + "260557": + folder: all diff --git a/recipes/dirent/all/conandata.yml b/recipes/dirent/all/conandata.yml new file mode 100644 index 0000000000000..41d2c31a73c7a --- /dev/null +++ b/recipes/dirent/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.23.2": + url: "https://github.com/tronkko/dirent/archive/1.23.2.tar.gz" + sha256: "f72d39e3c39610b6901e391b140aa69b51e0eb99216939ed5e547b5dad03afb1" diff --git a/recipes/dirent/all/conanfile.py b/recipes/dirent/all/conanfile.py new file mode 100644 index 0000000000000..57cf3a210664f --- /dev/null +++ b/recipes/dirent/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class DirEntConan(ConanFile): + name = "dirent" + description = "Dirent is a C/C++ programming interface that allows programmers to retrieve information about " \ + "files and directories under Linux/UNIX" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tronkko/dirent" + topics = ("directory", "file system", "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.os != "Windows": + raise ConanInvalidConfiguration("Only Windows builds are supported") + if self.settings.compiler == "gcc": + raise ConanInvalidConfiguration("mingw has a dirent.h implementation") + + 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"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/dirent/all/test_package/CMakeLists.txt b/recipes/dirent/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..682b23e6c7c90 --- /dev/null +++ b/recipes/dirent/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(dirent REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} dirent::dirent) diff --git a/recipes/dirent/all/test_package/conanfile.py b/recipes/dirent/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/dirent/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/dirent/all/test_package/test_package.cpp b/recipes/dirent/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..75fc54640de6f --- /dev/null +++ b/recipes/dirent/all/test_package/test_package.cpp @@ -0,0 +1,97 @@ +/* + * An example demonstrating basic directory listing. + * + * Compile this file with Visual Studio and run the produced command in + * console with a directory name argument. For example, command + * + * ls "c:\Program Files" + * + * might output something like + * + * ./ + * ../ + * 7-Zip/ + * Internet Explorer/ + * Microsoft Visual Studio 9.0/ + * Microsoft.NET/ + * Mozilla Firefox/ + * + * The ls command provided by this file is only an example: the command does + * not have any fancy options like "ls -al" in Linux and the command does not + * support file name matching like "ls *.c". + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include + +static void list_directory (const char *dirname); + + +int +main( + int argc, char *argv[]) +{ + int i; + + /* For each directory in command line */ + i = 1; + while (i < argc) { + list_directory (argv[i]); + i++; + } + + /* List current working directory if no arguments on command line */ + if (argc == 1) { + list_directory ("."); + } + return EXIT_SUCCESS; +} + +/* + * List files and directories within a directory. + */ +static void +list_directory( + const char *dirname) +{ + DIR *dir; + struct dirent *ent; + + /* Open directory stream */ + dir = opendir (dirname); + if (dir != NULL) { + + /* Print all files and directories within the directory */ + while ((ent = readdir (dir)) != NULL) { + switch (ent->d_type) { + case DT_REG: + printf ("%s\n", ent->d_name); + break; + + case DT_DIR: + printf ("%s/\n", ent->d_name); + break; + + case DT_LNK: + printf ("%s@\n", ent->d_name); + break; + + default: + printf ("%s*\n", ent->d_name); + } + } + + closedir (dir); + + } else { + /* Could not open directory */ + printf ("Cannot open directory %s\n", dirname); + exit (EXIT_FAILURE); + } +} diff --git a/recipes/dirent/all/test_v1_package/CMakeLists.txt b/recipes/dirent/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/dirent/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dirent/all/test_v1_package/conanfile.py b/recipes/dirent/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/dirent/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dirent/config.yml b/recipes/dirent/config.yml new file mode 100644 index 0000000000000..6086eb1e0524d --- /dev/null +++ b/recipes/dirent/config.yml @@ -0,0 +1,3 @@ +versions: + "1.23.2": + folder: all diff --git a/recipes/discount/all/conandata.yml b/recipes/discount/all/conandata.yml new file mode 100644 index 0000000000000..dc0fe14a1af08 --- /dev/null +++ b/recipes/discount/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.2.7": + url: "https://www.pell.portland.or.us/~orc/Code/discount/discount-2.2.7.tar.bz2" + sha256: "b1262be5d7b04f3c4e2cee3a0937369b12786af18f65f599f334eefbc0ee9508" +patches: + "2.2.7": + - patch_file: "patches/0001-fix-cmake-install.patch" + - patch_file: "patches/0002-fix-incomplete-type.patch" diff --git a/recipes/discount/all/conanfile.py b/recipes/discount/all/conanfile.py new file mode 100644 index 0000000000000..c7bfdf5809fd4 --- /dev/null +++ b/recipes/discount/all/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class DiscountConan(ConanFile): + name = "discount" + description = "DISCOUNT is a implementation of John Gruber & Aaron Swartz's Markdown markup language." + license = "BSD-3-Clause" + topics = ("markdown",) + homepage = "http://www.pell.portland.or.us/~orc/Code/discount" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("discount doesn't support cross-build yet") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISCOUNT_MAKE_INSTALL"] = True + tc.variables["DISCOUNT_INSTALL_SAMPLES"] = False + tc.variables["DISCOUNT_ONLY_LIBRARY"] = True + # For shared msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cmake")) + cmake.build() + + def package(self): + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "discount") + self.cpp_info.set_property("cmake_target_name", "discount::libmarkdown") + self.cpp_info.set_property("pkg_config_name", "libmarkdown") + # TODO: back to global scope in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.components["_discount"].libs = ["markdown"] + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "discount" + self.cpp_info.names["cmake_find_package_multi"] = "discount" + self.cpp_info.names["pkg_config"] = "libmarkdown" + self.cpp_info.components["_discount"].names["cmake_find_package"] = "libmarkdown" + self.cpp_info.components["_discount"].names["cmake_find_package_multi"] = "libmarkdown" + self.cpp_info.components["_discount"].set_property("pkg_config_name", "libmarkdown") diff --git a/recipes/discount/all/patches/0001-fix-cmake-install.patch b/recipes/discount/all/patches/0001-fix-cmake-install.patch new file mode 100644 index 0000000000000..00f48437d17fa --- /dev/null +++ b/recipes/discount/all/patches/0001-fix-cmake-install.patch @@ -0,0 +1,14 @@ +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -182,7 +182,10 @@ if(${PROJECT_NAME}_MAKE_INSTALL) + target_include_directories(libmarkdown INTERFACE + $ + ) +- set(_TARGETS libmarkdown markdown) ++ set(_TARGETS libmarkdown) ++ if(NOT ${PROJECT_NAME}_ONLY_LIBRARY) ++ list(APPEND _TARGETS markdown) ++ endif() + if(${PROJECT_NAME}_INSTALL_SAMPLES) + list(APPEND _TARGETS mkd2html makepage) + endif() diff --git a/recipes/discount/all/patches/0002-fix-incomplete-type.patch b/recipes/discount/all/patches/0002-fix-incomplete-type.patch new file mode 100644 index 0000000000000..b5d6f3bbb14df --- /dev/null +++ b/recipes/discount/all/patches/0002-fix-incomplete-type.patch @@ -0,0 +1,11 @@ +--- a/setup.c ++++ b/setup.c +@@ -31,7 +31,7 @@ mkd_initialize() + } + + +-void DESTRUCTOR ++void + mkd_shlib_destructor() + { + mkd_deallocate_tags(); diff --git a/recipes/discount/all/test_package/CMakeLists.txt b/recipes/discount/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a38ae26b913bf --- /dev/null +++ b/recipes/discount/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(discount REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE discount::libmarkdown) diff --git a/recipes/discount/all/test_package/conanfile.py b/recipes/discount/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/discount/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/discount/all/test_package/test_package.c b/recipes/discount/all/test_package/test_package.c new file mode 100644 index 0000000000000..3846e8db833e9 --- /dev/null +++ b/recipes/discount/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + mkd_initialize(); + return 0; +} diff --git a/recipes/discount/all/test_v1_package/CMakeLists.txt b/recipes/discount/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/discount/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/discount/all/test_v1_package/conanfile.py b/recipes/discount/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/discount/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/discount/config.yml b/recipes/discount/config.yml new file mode 100644 index 0000000000000..bbfb8846cd874 --- /dev/null +++ b/recipes/discount/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.7": + folder: all diff --git a/recipes/djinni-generator/all/conandata.yml b/recipes/djinni-generator/all/conandata.yml new file mode 100644 index 0000000000000..f0faa524fc522 --- /dev/null +++ b/recipes/djinni-generator/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "0.3.1": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v0.3.1/djinni + sha256: "052925e2590b40982a64d5386f79078cf61718d660b876e0a26670df4fc36838" + "0.3.2": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v0.3.2/djinni + sha256: "e9689e0848c952065ebe729c790c32279e9f738354d3377ee09571e248f394c7" + "0.4.0": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v0.4.0/djinni + sha256: "3daee97298195f90efe087b4385c54b5d58621a32e4ac1825e54b7ab54eb96a3" + "0.5.0": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v0.5.0/djinni + sha256: "666aef5634fe1de76b56c25fc2dae745d9a8e8d12da88b7c496985f14bc09b95" + "1.0.0": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.0.0/djinni + sha256: "a5dc94cd5175f228eb17e93e0f4cec93c18615758b139707a05f20dc7001f55f" + "1.1.0": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.1.0/djinni + sha256: "4efd4f68cf913af7c9dd7dd975a8aa2d2a90e8efd9d3b556979ff577923e0d44" + "1.2.0": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.2.0/djinni + sha256: "6340da0c0ae916d9cc317a03f151e4bb49c3403b76d18cbcdb3600bf47bc59bd" + "1.3.0": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.3.0/djinni + sha256: "013623e9fcc1c279459b299f0235687202a292015252526113b2015287031424" + "1.3.1": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.3.1/djinni + sha256: "bfba34fcb83cd42e41657b4951615b823677e3de7674e66d2b26e436e202dd5a" + "1.3.2": + url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.3.2/djinni + sha256: "8e618aeb8e9138e7fefaca804263317846799fee59d9465a4eee6625b8266ea1" diff --git a/recipes/djinni-generator/all/conanfile.py b/recipes/djinni-generator/all/conanfile.py new file mode 100644 index 0000000000000..ae2c62ed78bb5 --- /dev/null +++ b/recipes/djinni-generator/all/conanfile.py @@ -0,0 +1,37 @@ +import os + +from conans import ConanFile, tools + + +class Djinni(ConanFile): + name = "djinni-generator" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://djinni.xlcpp.dev" + description = "Djinni is a tool for generating cross-language type declarations and interface bindings." + topics = ("java", "Objective-C", "ios", "Android") + license = "Apache-2.0" + settings = "os", "arch" + + + def source(self): + filename = os.path.basename(self.conan_data["sources"][self.version]["url"]) + tools.download(filename=filename, **self.conan_data["sources"][self.version]) + tools.download(filename="LICENSE", url="https://raw.githubusercontent.com/cross-language-cpp/djinni-generator/main/LICENSE") + + def build(self): + pass # avoid warning for missing build steps + + def package(self): + if tools.detected_os() == "Windows": + os.rename('djinni','djinni.bat') + self.copy("djinni.bat", dst="bin", keep_path=False) + else: + self.copy("djinni", dst="bin", keep_path=False) + executable = os.path.join(self.package_folder, "bin", "djinni") + os.chmod(executable, os.stat(executable).st_mode | 0o111) + self.copy("LICENSE", dst="licenses", keep_path=False) + + def package_info(self): + self.cpp_info.includedirs = [] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + diff --git a/recipes/djinni-generator/all/test_package/conanfile.py b/recipes/djinni-generator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..456428a9a8670 --- /dev/null +++ b/recipes/djinni-generator/all/test_package/conanfile.py @@ -0,0 +1,21 @@ + +from io import StringIO +from conans import ConanFile, tools + +class TestPackageConan(ConanFile): + settings = "os", "arch" + + def build(self): + pass # please no warning that we build nothing + + def test(self): + if not tools.cross_building(self.settings): + output = StringIO() + self.run("djinni --help", output=output, run_environment=True) + output.seek(0, 0) + found_usage = False + for line in output: + if "Usage: djinni [options]" in line: + found_usage = True + break + assert(found_usage) diff --git a/recipes/djinni-generator/config.yml b/recipes/djinni-generator/config.yml new file mode 100644 index 0000000000000..47d0ee6875d8a --- /dev/null +++ b/recipes/djinni-generator/config.yml @@ -0,0 +1,21 @@ +versions: + "0.3.1": + folder: "all" + "0.3.2": + folder: "all" + "0.4.0": + folder: "all" + "0.5.0": + folder: "all" + "1.0.0": + folder: "all" + "1.1.0": + folder: "all" + "1.2.0": + folder: "all" + "1.3.0": + folder: "all" + "1.3.1": + folder: "all" + "1.3.2": + folder: "all" diff --git a/recipes/djinni-support-lib/1.x.x/CMakeLists.txt b/recipes/djinni-support-lib/1.x.x/CMakeLists.txt new file mode 100644 index 0000000000000..0afabb3cbe2e0 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(conan_cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory("source_subfolder") diff --git a/recipes/djinni-support-lib/1.x.x/conandata.yml b/recipes/djinni-support-lib/1.x.x/conandata.yml new file mode 100644 index 0000000000000..d35c553da9ba8 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.0": + url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.0.0.tar.gz + sha256: "25f8c648c3bec78a54d5387a792f1d7cd3c073c4477dc50ad2b9c5270a590779" + "1.1.0": + url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.1.0.tar.gz + sha256: "3a67d1c26959a9df5c158fdf0792e036149009b206ed89fcee8c7b1608187336" + "1.2.0": + url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.2.0.tar.gz + sha256: "3630870c2b3305dc6216f8ca8e37139f3f59f2ea7bd600a1154c5aa1c4d983a9" + "1.2.1": + url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.2.1.tar.gz + sha256: "ed64d3466ad7f13971913b5bd70c608a558a6b8574d9dbd8779dcdce9b97521b" diff --git a/recipes/djinni-support-lib/1.x.x/conanfile.py b/recipes/djinni-support-lib/1.x.x/conanfile.py new file mode 100644 index 0000000000000..61920459f5086 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/conanfile.py @@ -0,0 +1,145 @@ +import os + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class DjinniSuppotLib(ConanFile): + name = "djinni-support-lib" + homepage = "https://djinni.xlcpp.dev" + url = "https://github.com/conan-io/conan-center-index" + description = "Djinni is a tool for generating cross-language type declarations and interface bindings" + topics = ("java", "Objective-C", "Android", "iOS") + license = "Apache-2.0" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False], + "target": ["jni", "objc", "python", "cppcli", "auto", "deprecated"], + "with_jni": [True, False, "auto"], + "with_objc": [True, False, "auto"], + "with_python": [True, False, "auto"], + "with_cppcli": [True, False, "auto"], + "system_java": [True, False] + } + default_options = {"shared": False, + "fPIC": True, + "target": "deprecated", + "with_jni": "auto", + "with_objc": "auto", + "with_python": "auto", + "with_cppcli": "auto", + "system_java": False, + } + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _objc_support(self): + if self.options.with_objc == "auto" or self.options.target == "auto": + return tools.is_apple_os(self.settings.os) + else: + return self.options.with_objc == True or self.options.target == "objc" + + @property + def _jni_support(self): + if self.options.with_jni == "auto" or self.options.target == "auto": + return self.settings.os == "Android" + else: + return self.options.with_jni == True or self.options.target == "jni" + + @property + def _python_support(self): + return self.options.with_python == True or self.options.target == "python" + + @property + def _cppcli_support(self): + if self.options.with_cppcli == "auto" or self.options.target == "auto": + return self.settings.os == "Windows" + else: + return self.options.with_cppcli == True or self.options.target == "cppcli" + + def configure(self): + if self.settings.compiler == "Visual Studio" or self.options.shared: + del self.options.fPIC + + @property + def _source_subfolder(self): + return "source_subfolder" + + def build_requirements(self): + if not self.options.system_java and self._jni_support: + self.build_requires("zulu-openjdk/11.0.12@") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + elif self.settings.os == "Android": + self.options.system_java = True + + @property + def _supported_compilers(self): + return { + "gcc": "8", + "clang": "7", + "Visual Studio": "15", + "apple-clang": "10", + } + + def validate(self): + if self.options.target != "deprecated": + self.output.warn("The 'target' option is deprecated and will be removed soon. Use 'with_jni', 'with_objc', 'with_python' or 'with_cppcli' options instead.") + if not (self._objc_support or self._jni_support or self._python_support or self._cppcli_support): + raise ConanInvalidConfiguration("Target language could not be determined automatically. Set at least one of 'with_jni', 'with_objc', 'with_python' or 'with_cppcli' options to `True`.") + if self._cppcli_support: + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("C++/CLI has been enabled on a non-Windows operating system. This is not supported.") + if self.options.shared: + raise ConanInvalidConfiguration("C++/CLI does not support building as shared library") + if self.settings.compiler.runtime == "MT" or self.settings.compiler.runtime == "MTd": + raise ConanInvalidConfiguration("'/clr' and '/MT' command-line options are incompatible") + if self._objc_support or self._jni_support or self._python_support: + raise ConanInvalidConfiguration( + "C++/CLI is not yet supported with other languages enabled as well. Disable 'with_jni', 'with_objc' and 'with_python' options for a valid configuration.") + if self._python_support: + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Python on Windows is not fully yet supported, please see https://github.com/cross-language-cpp/djinni-support-lib/issues.") + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, "17") + try: + minimum_required_compiler_version = self._supported_compilers[str(self.settings.compiler)] + if tools.Version(self.settings.compiler.version) < minimum_required_compiler_version: + raise ConanInvalidConfiguration("This package requires c++17 support. The current compiler does not support it.") + except KeyError: + self.output.warn("This recipe has no support for the current compiler. Please consider adding it.") + + 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["DJINNI_WITH_OBJC"] = self._objc_support + self._cmake.definitions["DJINNI_WITH_JNI"] = self._jni_support + self._cmake.definitions["DJINNI_WITH_PYTHON"] = self._python_support + self._cmake.definitions["DJINNI_WITH_CPPCLI"] = self._cppcli_support + self._cmake.definitions["BUILD_TESTING"] = False + if self._jni_support: + self._cmake.definitions["JAVA_AWT_LIBRARY"] = "NotNeeded" + self._cmake.definitions["JAVA_AWT_INCLUDE_PATH"] = "NotNeeded" + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt b/recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c1d84c7e3d82 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/djinni-support-lib/1.x.x/test_package/conanfile.py b/recipes/djinni-support-lib/1.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..ed8aa8b7e0ebb --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/test_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" + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + 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/djinni-support-lib/1.x.x/test_package/test_package.cpp b/recipes/djinni-support-lib/1.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..9228c8f56407e --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +// since we would either need objective C++ or Java (jni) there is not a lot to test +// just that we have the hearders and can link +int main() { + return EXIT_SUCCESS ; +} + + + diff --git a/recipes/djinni-support-lib/all/CMakeLists.txt b/recipes/djinni-support-lib/all/CMakeLists.txt new file mode 100644 index 0000000000000..0afabb3cbe2e0 --- /dev/null +++ b/recipes/djinni-support-lib/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(conan_cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory("source_subfolder") diff --git a/recipes/djinni-support-lib/all/conandata.yml b/recipes/djinni-support-lib/all/conandata.yml new file mode 100644 index 0000000000000..dea5fe156fcc1 --- /dev/null +++ b/recipes/djinni-support-lib/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.0.1": + url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v0.0.1.tar.gz + sha256: "ddef30a95a8bd325446d3a76ea9c11f198f3b33f66157217bd46fb13d75c43d2" +patches: + "0.0.1": + - patch_file: "patches/cmake_install.patch" + base_path: "source_subfolder" + diff --git a/recipes/djinni-support-lib/all/conanfile.py b/recipes/djinni-support-lib/all/conanfile.py new file mode 100644 index 0000000000000..97c05458fb360 --- /dev/null +++ b/recipes/djinni-support-lib/all/conanfile.py @@ -0,0 +1,93 @@ +import os + +from conans import ConanFile, CMake, tools + +class DjinniSuppotLib(ConanFile): + name = "djinni-support-lib" + homepage = "https://djinni.xlcpp.dev" + url = "https://github.com/conan-io/conan-center-index" + description = "Djinni is a tool for generating cross-language type declarations and interface bindings" + topics = ("java", "Objective-C", "Android", "iOS") + license = "Apache-2.0" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False], + "target": ["jni", "objc", "auto"], + "system_java": [True, False] + } + default_options = {"shared": False, + "fPIC": True , + "target": "auto", + "system_java": False + } + exports_sources = ["patches/**", "CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def objc_support(self): + if self.options.target == "auto": + return tools.is_apple_os(self.settings.os) + else: + return self.options.target == "objc" + + @property + def jni_support(self): + if self.options.target == "auto": + return self.settings.os not in ["iOS", "watchOS", "tvOS"] + else: + return self.options.target == "jni" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def build_requirements(self): + if not self.options.system_java: + self.build_requires("zulu-openjdk/11.0.8@") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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) + if not self.options.shared: + self._cmake.definitions["DJINNI_STATIC_LIB"] = True + self._cmake.definitions["DJINNI_WITH_OBJC"] = self.objc_support + self._cmake.definitions["DJINNI_WITH_JNI"] = self.jni_support + if self.jni_support: + self._cmake.definitions["JAVA_AWT_LIBRARY"] = "NotNeeded" + self._cmake.definitions["JAVA_AWT_INCLUDE_PATH"] = "NotNeeded" + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + # these should not be here, but to support old generated files .... + if self.objc_support: + self.cpp_info.includedirs.append(os.path.join("include", "djinni", "objc")) + if self.jni_support: + self.cpp_info.includedirs.append(os.path.join("include", "djinni", "jni")) diff --git a/recipes/djinni-support-lib/all/patches/cmake_install.patch b/recipes/djinni-support-lib/all/patches/cmake_install.patch new file mode 100644 index 0000000000000..fbf35c46b9f1f --- /dev/null +++ b/recipes/djinni-support-lib/all/patches/cmake_install.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 53c3ed1..f48be06 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,8 +42,9 @@ set_target_properties(djinni_support_lib PROPERTIES + + install( + TARGETS djinni_support_lib +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + + diff --git a/recipes/djinni-support-lib/all/test_package/CMakeLists.txt b/recipes/djinni-support-lib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/djinni-support-lib/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/djinni-support-lib/all/test_package/conanfile.py b/recipes/djinni-support-lib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ed8aa8b7e0ebb --- /dev/null +++ b/recipes/djinni-support-lib/all/test_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" + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + 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/djinni-support-lib/all/test_package/test_package.cpp b/recipes/djinni-support-lib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9228c8f56407e --- /dev/null +++ b/recipes/djinni-support-lib/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +// since we would either need objective C++ or Java (jni) there is not a lot to test +// just that we have the hearders and can link +int main() { + return EXIT_SUCCESS ; +} + + + diff --git a/recipes/djinni-support-lib/config.yml b/recipes/djinni-support-lib/config.yml new file mode 100644 index 0000000000000..7faa090829836 --- /dev/null +++ b/recipes/djinni-support-lib/config.yml @@ -0,0 +1,11 @@ +versions: + "0.0.1": + folder: "all" + "1.0.0": + folder: "1.x.x" + "1.1.0": + folder: "1.x.x" + "1.2.0": + folder: "1.x.x" + "1.2.1": + folder: "1.x.x" diff --git a/recipes/dlib/all/CMakeLists.txt b/recipes/dlib/all/CMakeLists.txt new file mode 100644 index 0000000000000..1c22f04937945 --- /dev/null +++ b/recipes/dlib/all/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +# Include the dlib subdirectory to skip a check +add_subdirectory(source_subfolder/dlib) diff --git a/recipes/dlib/all/conandata.yml b/recipes/dlib/all/conandata.yml new file mode 100644 index 0000000000000..8896193f464de --- /dev/null +++ b/recipes/dlib/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "19.24": + url: "https://github.com/davisking/dlib/archive/refs/tags/v19.24.tar.gz" + sha256: "3cc42e84c7b1bb926c6451a21ad1595f56c5b10be3a1d7aa2f3c716a25b7ae39" + "19.23": + url: "https://github.com/davisking/dlib/archive/v19.23.tar.gz" + sha256: "0fc74a39d2046ad15819bab25a695333a63e740c91ed3c620c8594381c132e88" + "19.21": + url: "https://github.com/davisking/dlib/archive/v19.21.tar.gz" + sha256: "116f52e58be04b47dab52057eaad4b5c4d5c3032d927fe23d55b0741fc4107a0" + "19.19": + url: "https://github.com/davisking/dlib/archive/v19.19.tar.gz" + sha256: "7af455bb422d3ae5ef369c51ee64e98fa68c39435b0fa23be2e5d593a3d45b87" diff --git a/recipes/dlib/all/conanfile.py b/recipes/dlib/all/conanfile.py new file mode 100644 index 0000000000000..a15a2fc95a7d5 --- /dev/null +++ b/recipes/dlib/all/conanfile.py @@ -0,0 +1,193 @@ +from conan.tools.microsoft import is_msvc +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.45.0" + + +class DlibConan(ConanFile): + name = "dlib" + description = "A toolkit for making real world machine learning and data analysis applications" + topics = ("machine-learning", "deep-learning", "computer-vision") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://dlib.net" + license = "BSL-1.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gif": [True, False], + "with_jpeg": [True, False], + "with_png": [True, False], + "with_webp": [True, False], + "with_sqlite3": [True, False], + "with_sse2": [True, False, "auto"], + "with_sse4": [True, False, "auto"], + "with_avx": [True, False, "auto"], + "with_openblas": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_gif": True, + "with_jpeg": True, + "with_png": True, + "with_webp": True, + "with_sqlite3": True, + "with_sse2": "auto", + "with_sse4": "auto", + "with_avx": "auto", + "with_openblas": True, + } + + exports_sources = "CMakeLists.txt" + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _has_with_webp_option(self): + return tools.Version(self.version) >= "19.24" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.with_sse2 + del self.options.with_sse4 + del self.options.with_avx + if not self._has_with_webp_option: + del self.options.with_webp + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_gif: + self.requires("giflib/5.2.1") + if self.options.with_jpeg: + self.requires("libjpeg/9d") + if self.options.with_png: + self.requires("libpng/1.6.37") + if self.options.get_safe("with_webp"): + self.requires("libwebp/1.2.2") + if self.options.with_sqlite3: + self.requires("sqlite3/3.38.5") + if self.options.with_openblas: + self.requires("openblas/0.3.17") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("dlib can not be built as a shared library with Visual Studio") + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("dlib doesn't support macOS M1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + dlib_cmakelists = os.path.join(self._source_subfolder, "dlib", "CMakeLists.txt") + # robust giflib injection + tools.replace_in_file(dlib_cmakelists, "${GIF_LIBRARY}", "GIF::GIF") + # robust libjpeg injection + for cmake_file in [ + dlib_cmakelists, + os.path.join(self._source_subfolder, "dlib", "cmake_utils", "find_libjpeg.cmake"), + os.path.join(self._source_subfolder, "dlib", "cmake_utils", "test_for_libjpeg", "CMakeLists.txt"), + ]: + tools.replace_in_file(cmake_file, "${JPEG_LIBRARY}", "JPEG::JPEG") + # robust libpng injection + for cmake_file in [ + dlib_cmakelists, + os.path.join(self._source_subfolder, "dlib", "cmake_utils", "find_libpng.cmake"), + os.path.join(self._source_subfolder, "dlib", "cmake_utils", "test_for_libpng", "CMakeLists.txt"), + ]: + tools.replace_in_file(cmake_file, "${PNG_LIBRARIES}", "PNG::PNG") + # robust sqlite3 injection + tools.replace_in_file(dlib_cmakelists, "find_library(sqlite sqlite3)", "find_package(SQLite3 REQUIRED)") + tools.replace_in_file(dlib_cmakelists, "find_path(sqlite_path sqlite3.h)", "") + tools.replace_in_file(dlib_cmakelists, "if (sqlite AND sqlite_path)", "if(1)") + tools.replace_in_file(dlib_cmakelists, "${sqlite}", "SQLite::SQLite3") + # robust libwebp injection + if self._has_with_webp_option: + tools.replace_in_file(dlib_cmakelists, "include(cmake_utils/find_libwebp.cmake)", "find_package(WebP REQUIRED)") + tools.replace_in_file(dlib_cmakelists, "if (WEBP_FOUND)", "if(1)") + tools.replace_in_file(dlib_cmakelists, "${WEBP_LIBRARY}", "WebP::webp") + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + + # With in-project builds dlib is always built as a static library, + # we want to be able to build it as a shared library too + cmake.definitions["DLIB_IN_PROJECT_BUILD"] = False + + cmake.definitions["DLIB_ISO_CPP_ONLY"] = False + cmake.definitions["DLIB_NO_GUI_SUPPORT"] = True + + # Configure external dependencies + cmake.definitions["DLIB_JPEG_SUPPORT"] = self.options.with_jpeg + if self._has_with_webp_option: + cmake.definitions["DLIB_WEBP_SUPPORT"] = self.options.with_webp + cmake.definitions["DLIB_LINK_WITH_SQLITE3"] = self.options.with_sqlite3 + cmake.definitions["DLIB_USE_BLAS"] = True # FIXME: all the logic behind is not sufficiently under control + cmake.definitions["DLIB_USE_LAPACK"] = True # FIXME: all the logic behind is not sufficiently under control + cmake.definitions["DLIB_USE_CUDA"] = False # TODO: add with_cuda option? + cmake.definitions["DLIB_PNG_SUPPORT"] = self.options.with_png + cmake.definitions["DLIB_GIF_SUPPORT"] = self.options.with_gif + cmake.definitions["DLIB_USE_MKL_FFT"] = False + + # Configure SIMD options if possible + if self.settings.arch in ["x86", "x86_64"]: + if self.options.with_sse2 != "auto": + cmake.definitions["USE_SSE2_INSTRUCTIONS"] = self.options.with_sse2 + if self.options.with_sse4 != "auto": + cmake.definitions["USE_SSE4_INSTRUCTIONS"] = self.options.with_sse4 + if self.options.with_avx != "auto": + cmake.definitions["USE_AVX_INSTRUCTIONS"] = self.options.with_avx + + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + + self.copy("LICENSE.txt", "licenses", os.path.join(self._source_subfolder, "dlib"), keep_path=False) + + # Remove configuration files + for dir_to_remove in [ + os.path.join("lib", "cmake"), + os.path.join("lib", "pkgconfig"), + os.path.join("include", "dlib", "cmake_utils"), + os.path.join("include", "dlib", "external", "pybind11", "tools") + ]: + tools.rmdir(os.path.join(self.package_folder, dir_to_remove)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "dlib") + self.cpp_info.set_property("cmake_target_name", "dlib::dlib") + self.cpp_info.set_property("pkg_config_name", "dlib-1") + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "winmm", "comctl32", "gdi32", "imm32"] + + self.cpp_info.names["pkg_config"] = "dlib-1" diff --git a/recipes/dlib/all/test_package/CMakeLists.txt b/recipes/dlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..50caaa372ec83 --- /dev/null +++ b/recipes/dlib/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(dlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} dlib::dlib) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/dlib/all/test_package/conanfile.py b/recipes/dlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/dlib/all/test_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/dlib/all/test_package/test_package.cpp b/recipes/dlib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec4d7d59863d7 --- /dev/null +++ b/recipes/dlib/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#include +#include + +// Create a logger object somewhere. It is usually convenient to make it at the global scope +// which is what I am doing here. The following statement creates a logger that is named example. +dlib::logger dlog("conan-test"); + +int main() +{ + // Every logger has a logging level (given by dlog.level()). Each log message is tagged with a + // level and only levels equal to or higher than dlog.level() will be printed. By default all + // loggers start with level() == LERROR. In this case I'm going to set the lowest level LALL + // which means that dlog will print all logging messages it gets. + dlog.set_level(dlib::LALL); + + // print our first message. It will go to cout because that is the default. + dlog << dlib::LINFO << "This is an informational message."; + + // now print a debug message. + int variable = 8; + dlog << dlib::LDEBUG << "The integer variable is set to " << variable; + + // the logger can be used pretty much like any ostream object. But you have to give a logging + // level first. But after that you can chain << operators like normal. + + if (variable > 4) + dlog << dlib::LWARN << "The variable is bigger than 4! Its value is " << variable; + + dlog << dlib::LINFO << "we are going to sleep for half a second."; + // sleep for half a second + dlib::sleep(500); + dlog << dlib::LINFO << "we just woke up"; + + dlog << dlib::LINFO << "program ending"; + return 0; +} diff --git a/recipes/dlib/config.yml b/recipes/dlib/config.yml new file mode 100644 index 0000000000000..4d03ed4f4b36d --- /dev/null +++ b/recipes/dlib/config.yml @@ -0,0 +1,9 @@ +versions: + "19.24": + folder: all + "19.23": + folder: all + "19.21": + folder: all + "19.19": + folder: all diff --git a/recipes/dlpack/all/conandata.yml b/recipes/dlpack/all/conandata.yml new file mode 100644 index 0000000000000..1ee4d67252887 --- /dev/null +++ b/recipes/dlpack/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.8": + url: "https://github.com/dmlc/dlpack/archive/v0.8.tar.gz" + sha256: "cf965c26a5430ba4cc53d61963f288edddcd77443aa4c85ce722aaf1e2f29513" + "0.6": + url: "https://github.com/dmlc/dlpack/archive/v0.6.tar.gz" + sha256: "ce7715108623c011aa1e01afb32e218ddbdf66492494d7e718a78ac41010b77a" + "0.4": + url: "https://github.com/dmlc/dlpack/archive/v0.4.tar.gz" + sha256: "d0a533189ecd45a033b72e276fccaa2122cfd76de125e0a5e126bdea0fec2d24" diff --git a/recipes/dlpack/all/conanfile.py b/recipes/dlpack/all/conanfile.py new file mode 100644 index 0000000000000..16cb97d66e4ba --- /dev/null +++ b/recipes/dlpack/all/conanfile.py @@ -0,0 +1,41 @@ +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 DlpackConan(ConanFile): + name = "dlpack" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dmlc/dlpack" + description = "RFC for common in-memory tensor structure and operator interface for deep learning system" + topics = ("deep-learning", "operator", "tensor", "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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/dlpack/all/test_package/CMakeLists.txt b/recipes/dlpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..45718466e5323 --- /dev/null +++ b/recipes/dlpack/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(dlpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dlpack::dlpack) diff --git a/recipes/dlpack/all/test_package/conanfile.py b/recipes/dlpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/dlpack/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dlpack/all/test_package/test_package.cpp b/recipes/dlpack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6304024f2e652 --- /dev/null +++ b/recipes/dlpack/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +int main() +{ +#if DLPACK_VERSION < 60 + int major = (DLPACK_VERSION >> 6) & 7; + int minor = (DLPACK_VERSION >> 3) & 7; + int patch = DLPACK_VERSION & 7; +#else + int major = DLPACK_VERSION / 100; + int minor = (DLPACK_VERSION - major * 100) / 10; + int patch = DLPACK_VERSION - major * 100 - minor * 10; +#endif + std::cout << "dlpack version: " << major << "." << minor << "." << patch << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/dlpack/all/test_v1_package/CMakeLists.txt b/recipes/dlpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/dlpack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dlpack/all/test_v1_package/conanfile.py b/recipes/dlpack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/dlpack/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dlpack/config.yml b/recipes/dlpack/config.yml new file mode 100644 index 0000000000000..a1b8905afe4b1 --- /dev/null +++ b/recipes/dlpack/config.yml @@ -0,0 +1,7 @@ +versions: + "0.8": + folder: "all" + "0.6": + folder: "all" + "0.4": + folder: "all" diff --git a/recipes/docopt.cpp/all/conandata.yml b/recipes/docopt.cpp/all/conandata.yml new file mode 100644 index 0000000000000..ce21cb936020c --- /dev/null +++ b/recipes/docopt.cpp/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "0.6.3": + url: "https://github.com/docopt/docopt.cpp/archive/v0.6.3.tar.gz" + sha256: "28af5a0c482c6d508d22b14d588a3b0bd9ff97135f99c2814a5aa3cbff1d6632" + "0.6.2": + url: "https://github.com/docopt/docopt.cpp/archive/v0.6.2.tar.gz" + sha256: "c05542245232420d735c7699098b1ea130e3a92bade473b64baf876cdf098a17" +patches: + "0.6.3": + - patch_file: "patches/cmake-library-0.6.3.patch" + patch_description: "fix install path, separate static/shared build" + patch_type: "conan" + - patch_file: "patches/msvc-dll-export-0.6.3.patch" + patch_description: "export ostream<< to dll" + patch_type: "portability" + "0.6.2": + - patch_file: "patches/include-stdexcept.patch" + patch_description: "include stdexcept" + patch_type: "portability" + - patch_file: "patches/cmake-library-0.6.2.patch" + patch_description: "fix install path, separate static/shared build" + patch_type: "conan" + - patch_file: "patches/msvc-dll-export-0.6.2.patch" + patch_description: "export ostream<< to dll" + patch_type: "portability" diff --git a/recipes/docopt.cpp/all/conanfile.py b/recipes/docopt.cpp/all/conanfile.py new file mode 100644 index 0000000000000..0745cc959331b --- /dev/null +++ b/recipes/docopt.cpp/all/conanfile.py @@ -0,0 +1,127 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os +import textwrap + +required_conan_version = ">=1.53.0" + +class DocoptCppConan(ConanFile): + name = "docopt.cpp" + description = "C++11 port of docopt" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/docopt/docopt.cpp" + topics = ("cli", "getopt", "options", "argparser") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "boost_regex": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "boost_regex": False, + } + + @property + def _min_cppstd(self): + return 11 + + 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): + if self.options.boost_regex: + self.requires("boost/1.81.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_BOOST_REGEX"] = self.options.boost_regex + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._cmake_target: "docopt::{}".format(self._cmake_target)} + ) + + @property + def _cmake_target(self): + return "docopt" if self.options.shared else "docopt_s" + + 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_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "docopt") + self.cpp_info.set_property("cmake_target_name", self._cmake_target) + self.cpp_info.set_property("pkg_config_name", "docopt") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["docopt"].libs = ["docopt"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["docopt"].system_libs = ["m"] + if is_msvc(self) and self.options.shared: + self.cpp_info.components["docopt"].defines = ["DOCOPT_DLL"] + if self.options.boost_regex: + self.cpp_info.components["docopt"].requires.append("boost::boost") + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "docopt" + self.cpp_info.names["cmake_find_package_multi"] = "docopt" + self.cpp_info.names["pkg_config"] = "docopt" + self.cpp_info.components["docopt"].names["cmake_find_package"] = self._cmake_target + self.cpp_info.components["docopt"].names["cmake_find_package_multi"] = self._cmake_target + self.cpp_info.components["docopt"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["docopt"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["docopt"].set_property("cmake_target_name", self._cmake_target) diff --git a/recipes/docopt.cpp/all/patches/cmake-library-0.6.2.patch b/recipes/docopt.cpp/all/patches/cmake-library-0.6.2.patch new file mode 100644 index 0000000000000..e77c5e994eeb8 --- /dev/null +++ b/recipes/docopt.cpp/all/patches/cmake-library-0.6.2.patch @@ -0,0 +1,58 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,20 +46,14 @@ if(MSVC OR XCODE) + # static libraries completely separately. + # Xcode does not support libraries with only object files as sources. + # See https://cmake.org/cmake/help/v3.0/command/add_library.html?highlight=add_library +- add_library(docopt SHARED ${docopt_SOURCES} ${docopt_HEADERS}) +- add_library(docopt_s STATIC ${docopt_SOURCES} ${docopt_HEADERS}) ++ add_library(docopt ${docopt_SOURCES} ${docopt_HEADERS}) + else() + # If not using MSVC or Xcode, we will create an intermediate object target + # to avoid compiling the source code twice. +- add_library(docopt_o OBJECT ${docopt_SOURCES} ${docopt_HEADERS}) +- set_target_properties(docopt_o PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +- +- add_library(docopt SHARED $) +- add_library(docopt_s STATIC $) ++ add_library(docopt ${docopt_SOURCES} ${docopt_HEADERS}) + endif() + + target_include_directories(docopt PUBLIC $ $) +-target_include_directories(docopt_s PUBLIC $ $) + + if(MSVC) + # DOCOPT_DLL: Must be specified when building *and* when using the DLL. +@@ -72,7 +66,6 @@ endif() + + if(NOT MSVC) + set_target_properties(docopt PROPERTIES OUTPUT_NAME docopt) +- set_target_properties(docopt_s PROPERTIES OUTPUT_NAME docopt) + endif() + + if(USE_BOOST_REGEX) +@@ -83,9 +76,6 @@ if(USE_BOOST_REGEX) + find_package(Boost 1.53 REQUIRED COMPONENTS regex) + include_directories(${Boost_INCLUDE_DIRS}) + target_link_libraries(docopt ${Boost_LIBRARIES}) +- if(WITH_STATIC) +- target_link_libraries(docopt_s ${Boost_LIBRARIES}) +- endif() + endif() + + #============================================================================ +@@ -118,10 +108,12 @@ endif() + set(export_name "docopt-targets") + + # Runtime package +-install(TARGETS docopt EXPORT ${export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS docopt EXPORT ${export_name} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + # Development package +-install(TARGETS docopt_s EXPORT ${export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${docopt_HEADERS} DESTINATION include/docopt) + + # CMake Package diff --git a/recipes/docopt.cpp/all/patches/cmake-library-0.6.3.patch b/recipes/docopt.cpp/all/patches/cmake-library-0.6.3.patch new file mode 100644 index 0000000000000..12f628ac67051 --- /dev/null +++ b/recipes/docopt.cpp/all/patches/cmake-library-0.6.3.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,24 +41,18 @@ if(MSVC OR XCODE) + # static libraries completely separately. + # Xcode does not support libraries with only object files as sources. + # See https://cmake.org/cmake/help/v3.0/command/add_library.html?highlight=add_library +- add_library(docopt SHARED ${docopt_SOURCES} ${docopt_HEADERS}) +- add_library(docopt_s STATIC ${docopt_SOURCES} ${docopt_HEADERS}) ++ add_library(docopt ${docopt_SOURCES} ${docopt_HEADERS}) + else() + # If not using MSVC or Xcode, we will create an intermediate object target + # to avoid compiling the source code twice. +- add_library(docopt_o OBJECT ${docopt_SOURCES} ${docopt_HEADERS}) +- set_target_properties(docopt_o PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +- +- add_library(docopt SHARED $) ++ add_library(docopt ${docopt_SOURCES} ${docopt_HEADERS}) + set_target_properties(docopt PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + ) +- add_library(docopt_s STATIC $) + endif() + + target_include_directories(docopt PUBLIC $ $) +-target_include_directories(docopt_s PUBLIC $ $) + + if(MSVC) + # DOCOPT_DLL: Must be specified when building *and* when using the DLL. +@@ -71,7 +65,6 @@ endif() + + if(NOT MSVC) + set_target_properties(docopt PROPERTIES OUTPUT_NAME docopt) +- set_target_properties(docopt_s PROPERTIES OUTPUT_NAME docopt) + endif() + + if(USE_BOOST_REGEX) +@@ -82,9 +75,6 @@ if(USE_BOOST_REGEX) + find_package(Boost 1.53 REQUIRED COMPONENTS regex) + include_directories(${Boost_INCLUDE_DIRS}) + target_link_libraries(docopt ${Boost_LIBRARIES}) +- if(WITH_STATIC) +- target_link_libraries(docopt_s ${Boost_LIBRARIES}) +- endif() + endif() + + #============================================================================ +@@ -117,10 +107,12 @@ endif() + set(export_name "docopt-targets") + + # Runtime package +-install(TARGETS docopt EXPORT ${export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS docopt EXPORT ${export_name} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + # Development package +-install(TARGETS docopt_s EXPORT ${export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${docopt_HEADERS} DESTINATION include/docopt) + + # CMake Package diff --git a/recipes/docopt.cpp/all/patches/include-stdexcept.patch b/recipes/docopt.cpp/all/patches/include-stdexcept.patch new file mode 100644 index 0000000000000..f4472482e893f --- /dev/null +++ b/recipes/docopt.cpp/all/patches/include-stdexcept.patch @@ -0,0 +1,11 @@ +diff --git a/docopt_value.h b/docopt_value.h +index a923219..2003a7a 100644 +--- a/docopt_value.h ++++ b/docopt_value.h +@@ -13,5 +13,6 @@ + #include + #include // std::hash + #include ++#include + + namespace docopt { diff --git a/recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.2.patch b/recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.2.patch new file mode 100644 index 0000000000000..683410176285d --- /dev/null +++ b/recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.2.patch @@ -0,0 +1,43 @@ +diff --git a/docopt.h b/docopt.h +index 4c40741..d11fb25 100644 +--- a/docopt.h ++++ b/docopt.h +@@ -9,12 +9,6 @@ + #ifndef docopt__docopt_h_ + #define docopt__docopt_h_ + +-#include "docopt_value.h" +- +-#include +-#include +-#include +- + #ifdef DOCOPT_HEADER_ONLY + #define DOCOPT_INLINE inline + #define DOCOPT_API +@@ -40,6 +34,12 @@ + #endif + #endif + ++#include "docopt_value.h" ++ ++#include ++#include ++#include ++ + namespace docopt { + + // Usage string could not be parsed (ie, the developer did something wrong) +diff --git a/docopt_value.h b/docopt_value.h +index 829ee55..020634b 100644 +--- a/docopt_value.h ++++ b/docopt_value.h +@@ -105,7 +105,7 @@ namespace docopt { + }; + + /// Write out the contents to the ostream +- std::ostream& operator<<(std::ostream&, value const&); ++ DOCOPT_API std::ostream& operator<<(std::ostream&, value const&); + } + + namespace std { diff --git a/recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.3.patch b/recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.3.patch new file mode 100644 index 0000000000000..cadecfd04dcce --- /dev/null +++ b/recipes/docopt.cpp/all/patches/msvc-dll-export-0.6.3.patch @@ -0,0 +1,41 @@ +--- a/docopt.h ++++ b/docopt.h +@@ -9,13 +9,6 @@ + #ifndef docopt__docopt_h_ + #define docopt__docopt_h_ + +-#include "docopt_value.h" +- +-#include +-#include +-#include +-#include +- + #ifdef DOCOPT_HEADER_ONLY + #define DOCOPT_INLINE inline + #define DOCOPT_API +@@ -41,6 +34,13 @@ + #endif + #endif + ++#include "docopt_value.h" ++ ++#include ++#include ++#include ++#include ++ + namespace docopt { + + // Usage string could not be parsed (ie, the developer did something wrong) +--- a/docopt_value.h ++++ b/docopt_value.h +@@ -105,7 +105,7 @@ namespace docopt { + }; + + /// Write out the contents to the ostream +- std::ostream& operator<<(std::ostream&, value const&); ++ DOCOPT_API std::ostream& operator<<(std::ostream&, value const&); + } + + namespace std { diff --git a/recipes/docopt.cpp/all/test_package/CMakeLists.txt b/recipes/docopt.cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f25c54702003 --- /dev/null +++ b/recipes/docopt.cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(docopt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET docopt_s) + target_link_libraries(${PROJECT_NAME} PRIVATE docopt_s) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE docopt) +endif() diff --git a/recipes/docopt.cpp/all/test_package/conanfile.py b/recipes/docopt.cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c72c51b464c6d --- /dev/null +++ b/recipes/docopt.cpp/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} --help", env="conanrun") diff --git a/recipes/docopt.cpp/all/test_package/test_package.cpp b/recipes/docopt.cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62ae532bf679d --- /dev/null +++ b/recipes/docopt.cpp/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#include +#include + + +static const char USAGE[] = +R"(Naval Fate. + + Usage: + naval_fate ship new ... + naval_fate ship move [--speed=] + naval_fate ship shoot + naval_fate mine (set|remove) [--moored | --drifting] + naval_fate (-h | --help) + naval_fate --version + + Options: + -h --help Show this screen. + --version Show version. + --speed= Speed in knots [default: 10]. + --moored Moored (anchored) mine. + --drifting Drifting mine. +)"; + +int main(int argc, const char** argv) +{ + std::map args + = docopt::docopt(USAGE, + { argv + 1, argv + argc }, + true, // show help if requested + "Naval Fate 2.0"); // version string + + for(auto const& arg : args) { + std::cout << arg.first << arg.second << std::endl; + } + + return 0; +} diff --git a/recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt b/recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/docopt.cpp/all/test_v1_package/conanfile.py b/recipes/docopt.cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..85a33f9580148 --- /dev/null +++ b/recipes/docopt.cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} --help", run_environment=True) diff --git a/recipes/docopt.cpp/config.yml b/recipes/docopt.cpp/config.yml new file mode 100644 index 0000000000000..5adc30b2f3c24 --- /dev/null +++ b/recipes/docopt.cpp/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.3": + folder: all + "0.6.2": + folder: all diff --git a/recipes/doctest/2.x.x/conandata.yml b/recipes/doctest/2.x.x/conandata.yml new file mode 100644 index 0000000000000..a2a355893f983 --- /dev/null +++ b/recipes/doctest/2.x.x/conandata.yml @@ -0,0 +1,43 @@ +sources: + "2.4.11": + url: "https://github.com/doctest/doctest/archive/refs/tags/v2.4.11.tar.gz" + sha256: "632ed2c05a7f53fa961381497bf8069093f0d6628c5f26286161fbd32a560186" + "2.4.10": + url: "https://github.com/doctest/doctest/archive/refs/tags/v2.4.10.tar.gz" + sha256: "d23213c415152d7aa4de99bb7c817fa29c0c03bd1a89972748579a7217fdbb8f" + "2.4.9": + url: "https://github.com/doctest/doctest/archive/refs/tags/v2.4.9.tar.gz" + sha256: "19b2df757f2f3703a5e63cee553d85596875f06d91a3333acd80a969ef210856" + "2.4.8": + url: "https://github.com/doctest/doctest/archive/refs/tags/v2.4.8.tar.gz" + sha256: "f52763630aa17bd9772b54e14b6cdd632c87adf0169455a86a49bd94abf2cd83" + "2.4.6": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.4.6.tar.gz" + sha256: "39110778e6baf373ef04342d7cb3fe35da104cb40769103e8a2f0035f5a5f1cb" + "2.4.5": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.4.5.tar.gz" + sha256: "b76ece19f0e473e3afa5c545dbdce2dd70bfef98ed0f383443b2f9fd9f86d5b4" + "2.4.4": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.4.4.tar.gz" + sha256: "3bcb62ad316bf4230873a336fcc6eb6292116568a6e19ab8cdd37a1610773d70" + "2.4.3": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.4.3.tar.gz" + sha256: "18c0f87f526bf34bb595c2841a2f0f33b28ab8c817d7c71ed1ba4665815d9ef6" + "2.4.1": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.4.1.tar.gz" + sha256: "0a0f0be21ee23e36ff6b8b9d63c06a7792e04cce342e1df3dee0e40d1e21b9f0" + "2.4.0": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.4.0.tar.gz" + sha256: "f689f48e92c088928d88d8481e769c8e804f0a608b484ab8ef3d6ab6045b5444" + "2.3.8": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.3.8.tar.gz" + sha256: "d7232437eceb46ad5de03cacdee770c80f2e53e7b8efc1c8a8ed29539f64efa5" + "2.3.7": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.3.7.tar.gz" + sha256: "a70cd25875029879e577b08cfaa57a76c7bea62c473ca94d85ec87ea53af7177" + "2.3.6": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.3.6.tar.gz" + sha256: "f63c3c01021ba3fb35a0702127abfaa6fc44aaefd309e2c246e62a083deffa1f" + "2.3.5": + url: "https://github.com/doctest/doctest/archive/refs/tags/2.3.5.tar.gz" + sha256: "71d1ca0916bfea8f4550de196b66f2226f2fdb5fd4a2885a3b4c2dd8f035a8c9" diff --git a/recipes/doctest/2.x.x/conanfile.py b/recipes/doctest/2.x.x/conanfile.py new file mode 100644 index 0000000000000..074df44e7b6d8 --- /dev/null +++ b/recipes/doctest/2.x.x/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class DoctestConan(ConanFile): + name = "doctest" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/onqtam/doctest" + description = "C++11/14/17/20 single header testing framework" + topics = ("header-only", "unit-test", "tdd") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + license = "MIT" + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + 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.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*doctest.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + for cmake_file in ("doctest.cmake", "doctestAddTests.cmake"): + copy(self, cmake_file, src=os.path.join(self.source_folder, "scripts", "cmake"), + dst=os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "doctest") + self.cpp_info.set_property("cmake_target_name", "doctest::doctest") + # Upstream config file populates CMAKE_MODULE_PATH so that doctest.cmake & doctestAddTests.cmake + # are discoverable, therefore their folder is appended to builddirs. + # But this config file doesn't include these module files directly, + # thus they are not defined as cmake_build_modules + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self._is_mingw: + # See https://sourceforge.net/p/mingw-w64/bugs/727/ + # can't use destructors in thread_local with mingw + self.cpp_info.defines.append("DOCTEST_THREAD_LOCAL=") diff --git a/recipes/doctest/2.x.x/test_package/CMakeLists.txt b/recipes/doctest/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c3a61e866425e --- /dev/null +++ b/recipes/doctest/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(doctest REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE doctest::doctest) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/doctest/2.x.x/test_package/conanfile.py b/recipes/doctest/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/doctest/2.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/doctest/2.x.x/test_package/test_package.cpp b/recipes/doctest/2.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..2567ad6be452d --- /dev/null +++ b/recipes/doctest/2.x.x/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#include + +TEST_CASE("testing the factorial function") { + CHECK(1 == 1); +} diff --git a/recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt b/recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/doctest/2.x.x/test_v1_package/conanfile.py b/recipes/doctest/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/doctest/2.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/doctest/config.yml b/recipes/doctest/config.yml new file mode 100644 index 0000000000000..9e8f4ea41f589 --- /dev/null +++ b/recipes/doctest/config.yml @@ -0,0 +1,29 @@ +versions: + "2.4.11": + folder: 2.x.x + "2.4.10": + folder: 2.x.x + "2.4.9": + folder: 2.x.x + "2.4.8": + folder: 2.x.x + "2.4.6": + folder: 2.x.x + "2.4.5": + folder: 2.x.x + "2.4.4": + folder: 2.x.x + "2.4.3": + folder: 2.x.x + "2.4.1": + folder: 2.x.x + "2.4.0": + folder: 2.x.x + "2.3.8": + folder: 2.x.x + "2.3.7": + folder: 2.x.x + "2.3.6": + folder: 2.x.x + "2.3.5": + folder: 2.x.x diff --git a/recipes/double-conversion/all/conandata.yml b/recipes/double-conversion/all/conandata.yml new file mode 100644 index 0000000000000..7e987d626c73a --- /dev/null +++ b/recipes/double-conversion/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "3.2.1": + url: "https://github.com/google/double-conversion/archive/v3.2.1.tar.gz" + sha256: "e40d236343cad807e83d192265f139481c51fc83a1c49e406ac6ce0a0ba7cd35" + "3.2.0": + url: "https://github.com/google/double-conversion/archive/v3.2.0.tar.gz" + sha256: "3dbcdf186ad092a8b71228a5962009b5c96abde9a315257a3452eb988414ea3b" + "3.1.7": + url: "https://github.com/google/double-conversion/archive/v3.1.7.tar.gz" + sha256: "a0204d6ab48223f2c8f53a932014e7f245125e7a5267764b1fbeebe4fa0ee8b9" + "3.1.6": + url: https://github.com/google/double-conversion/archive/v3.1.6.tar.gz + sha256: 8a79e87d02ce1333c9d6c5e47f452596442a343d8c3e9b234e8a62fce1b1d49c + "3.1.5": + url: "https://github.com/google/double-conversion/archive/v3.1.5.tar.gz" + sha256: "a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13" + "3.1.4": + url: "https://github.com/google/double-conversion/archive/v3.1.4.tar.gz" + sha256: "95004b65e43fefc6100f337a25da27bb99b9ef8d4071a36a33b5e83eb1f82021" diff --git a/recipes/double-conversion/all/conanfile.py b/recipes/double-conversion/all/conanfile.py new file mode 100644 index 0000000000000..9abd55fe46dcf --- /dev/null +++ b/recipes/double-conversion/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.54.0" + + +class DoubleConversionConan(ConanFile): + name = "double-conversion" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/double-conversion" + description = "Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles." + license = "BSD-3-Clause" + topics = ("google", "decimal-binary", "conversion") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "190") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "double-conversion") + self.cpp_info.set_property("cmake_target_name", "double-conversion::double-conversion") + self.cpp_info.libs = ["double-conversion"] diff --git a/recipes/double-conversion/all/test_package/CMakeLists.txt b/recipes/double-conversion/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cdc70c7766f8f --- /dev/null +++ b/recipes/double-conversion/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(double-conversion REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE double-conversion::double-conversion) diff --git a/recipes/double-conversion/all/test_package/conanfile.py b/recipes/double-conversion/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/double-conversion/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/double-conversion/all/test_package/test_package.cpp b/recipes/double-conversion/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c026f07be141c --- /dev/null +++ b/recipes/double-conversion/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "double-conversion/diy-fp.h" +#include "double-conversion/utils.h" +#include "double-conversion/ieee.h" + +#ifndef UINT64_2PART_C +#define UINT64_2PART_C(a, b) DOUBLE_CONVERSION_UINT64_2PART_C(a, b) +#endif + +int main() { + uint64_t ordered = UINT64_2PART_C(0x01234567, 89ABCDEF); + std::cout << "A value: " << double_conversion::Double(ordered).value() << std::endl; + return 0; +} diff --git a/recipes/double-conversion/all/test_v1_package/CMakeLists.txt b/recipes/double-conversion/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/double-conversion/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/double-conversion/all/test_v1_package/conanfile.py b/recipes/double-conversion/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/double-conversion/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/double-conversion/config.yml b/recipes/double-conversion/config.yml new file mode 100644 index 0000000000000..af0b0f2b2e22d --- /dev/null +++ b/recipes/double-conversion/config.yml @@ -0,0 +1,13 @@ +versions: + "3.2.1": + folder: all + "3.2.0": + folder: all + "3.1.7": + folder: all + "3.1.6": + folder: all + "3.1.5": + folder: all + "3.1.4": + folder: all diff --git a/recipes/doxygen/all/conandata.yml b/recipes/doxygen/all/conandata.yml new file mode 100644 index 0000000000000..b6735dc89d517 --- /dev/null +++ b/recipes/doxygen/all/conandata.yml @@ -0,0 +1,45 @@ +sources: + "1.9.4": + url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.9.4.src.tar.gz" + sha256: "a15e9cd8c0d02b7888bc8356eac200222ecff1defd32f3fe05257d81227b1f37" + "1.9.2": + url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.9.2.src.tar.gz" + sha256: "060f254bcef48673cc7ccf542736b7455b67c110b30fdaa33512a5b09bbecee5" + "1.9.1": + url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.9.1.src.tar.gz" + sha256: "67aeae1be4e1565519898f46f1f7092f1973cce8a767e93101ee0111717091d1" + "1.8.20": + url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.8.20.src.tar.gz" + sha256: "e0db6979286fd7ccd3a99af9f97397f2bae50532e4ecb312aa18862f8401ddec" + "1.8.18": + url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.8.18.src.tar.gz" + sha256: "18173d9edc46d2d116c1f92a95d683ec76b6b4b45b817ac4f245bb1073d00656" + "1.8.17": + url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.8.17.src.tar.gz" + sha256: "2cba988af2d495541cbbe5541b3bee0ee11144dcb23a81eada19f5501fd8b599" +patches: + "1.9.4": + - patch_file: "patches/1.9.4-0001-enable-modern-compilers.patch" + patch_description: "Enable modern compilers" + patch_type: "portability" + patch_source: "https://github.com/doxygen/doxygen/commit/5198966c8d5fec89116d025c74934ac03ea511fa" + "1.9.2": + - patch_file: "patches/1.9.2-0001-imported-target.patch" + patch_description: "Fix includes" + patch_type: "portability" + "1.9.1": + - patch_file: "patches/1.9.1-0001-imported-target.patch" + patch_description: "Fix includes" + patch_type: "portability" + "1.8.20": + - patch_file: "patches/1.8-0001-xapian.patch" + patch_description: "Fix xapian find_package command" + patch_type: "portability" + "1.8.18": + - patch_file: "patches/1.8-0001-xapian.patch" + patch_description: "Fix xapian find_package command" + patch_type: "portability" + "1.8.17": + - patch_file: "patches/1.8-0001-xapian.patch" + patch_description: "Fix xapian find_package command" + patch_type: "portability" diff --git a/recipes/doxygen/all/conanfile.py b/recipes/doxygen/all/conanfile.py new file mode 100644 index 0000000000000..7b30ce53b0060 --- /dev/null +++ b/recipes/doxygen/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class DoxygenConan(ConanFile): + name = "doxygen" + description = "A documentation system for C++, C, Java, IDL and PHP --- Note: Dot is disabled in this package" + topics = ("installer", "devtool", "documentation") + homepage = "https://github.com/doxygen/doxygen" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "enable_parse": [True, False], + "enable_search": [True, False], + } + default_options = { + "enable_parse": True, + "enable_search": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _minimum_compiler_version(self): + if Version(self.version) <= "1.9.1": + return { + "gcc": "5", + } + return { + "gcc": "7", # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297 + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.enable_search: + self.requires("xapian-core/1.4.19") + self.requires("zlib/1.2.13") + + def package_id(self): + del self.info.settings.compiler + + def compatibility(self): + return [{"settings": [("build_type", "Release")]}] + + def validate(self): + minimum_compiler_version = self._minimum_compiler_version.get(str(self.settings.compiler)) + if minimum_compiler_version and Version(self.settings.compiler.version) < minimum_compiler_version: + raise ConanInvalidConfiguration(f"Compiler version too old. At least {minimum_compiler_version} is required.") + if Version(self.version) == "1.8.18": + check_min_vs(self, "191") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["build_parse"] = self.options.enable_parse + tc.variables["build_search"] = self.options.enable_search + tc.variables["use_libc++"] = self.settings.compiler.get_safe("libcxx") == "libc++" + tc.variables["win_static"] = is_msvc_static_runtime(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "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.set_property("cmake_find_mode", "none") + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/doxygen/all/patches/1.8-0001-xapian.patch b/recipes/doxygen/all/patches/1.8-0001-xapian.patch new file mode 100644 index 0000000000000..c892c87957f88 --- /dev/null +++ b/recipes/doxygen/all/patches/1.8-0001-xapian.patch @@ -0,0 +1,13 @@ +--- a/addon/doxysearch/CMakeLists.txt 2020-08-24 13:12:55.000000000 +0200 ++++ b/addon/doxysearch/CMakeLists.txt 2022-12-16 20:41:07.040801300 +0100 +@@ -1,8 +1,8 @@ +-find_package(Xapian REQUIRED) ++find_package(xapian REQUIRED) + find_package(ZLIB REQUIRED) + + if (WIN32) +- set(WIN_EXTRA_LIBS "uuid.lib rpcrt4.lib ws2_32.lib") ++ set(WIN_EXTRA_LIBS uuid.lib rpcrt4.lib ws2_32.lib) + endif() + + include_directories( diff --git a/recipes/doxygen/all/patches/1.9.1-0001-imported-target.patch b/recipes/doxygen/all/patches/1.9.1-0001-imported-target.patch new file mode 100644 index 0000000000000..170bfd9753ce3 --- /dev/null +++ b/recipes/doxygen/all/patches/1.9.1-0001-imported-target.patch @@ -0,0 +1,70 @@ +diff --git a/libmscgen/mscgen_bool.h b/libmscgen/mscgen_bool.h +index e982d80..d16ef98 100644 +--- libmscgen/mscgen_bool.h ++++ libmscgen/mscgen_bool.h +@@ -23,6 +23,14 @@ + #ifndef MSCGEN_BOOL_H + #define MSCGEN_BOOL_H + ++/* Some system headers define TRUE and FALSE so undefine them first */ ++#ifdef TRUE ++#undef TRUE ++#endif ++#ifdef FALSE ++#undef FALSE ++#endif ++ + typedef enum + { + FALSE = 0, +diff --git a/qtools/qglobal.h b/qtools/qglobal.h +index 0deef5d..86846f8 100644 +--- qtools/qglobal.h ++++ qtools/qglobal.h +@@ -357,6 +356,7 @@ typedef const char *pcchar; + typedef __int64 int64; + typedef unsigned __int64 uint64; + #else ++#include + #if !defined(_OS_AIX_) || !defined(_H_INTTYPES) + typedef long long int64; + #endif +diff --git a/src/doxygen.cpp b/src/doxygen.cpp +index 3fdde9bc..1b32e273 100644 +--- src/doxygen.cpp ++++ src/doxygen.cpp +@@ -12,6 +12,7 @@ + * input used in their production; they are not affected by this license. + * + */ ++#include + + #include + +@@ -32,7 +33,6 @@ + #include + #include + #include +-#include + + #include "version.h" + #include "doxygen.h" +diff --git a/src/util.cpp b/src/util.cpp +index 7fcd5ed..399e7a2 100644 +--- src/util.cpp ++++ src/util.cpp +@@ -13,13 +13,13 @@ + * input used in their production; they are not affected by this license. + * + */ ++#include + + #include + #include + #include + #include + #include +-#include + #include + + #include diff --git a/recipes/doxygen/all/patches/1.9.2-0001-imported-target.patch b/recipes/doxygen/all/patches/1.9.2-0001-imported-target.patch new file mode 100644 index 0000000000000..aa88aa13aa307 --- /dev/null +++ b/recipes/doxygen/all/patches/1.9.2-0001-imported-target.patch @@ -0,0 +1,17 @@ +--- libmscgen/mscgen_bool.h ++++ libmscgen/mscgen_bool.h +@@ -23,6 +23,14 @@ + #ifndef MSCGEN_BOOL_H + #define MSCGEN_BOOL_H + ++/* Some system headers define TRUE and FALSE so undefine them first */ ++#ifdef TRUE ++#undef TRUE ++#endif ++#ifdef FALSE ++#undef FALSE ++#endif ++ + typedef enum + { + FALSE = 0, diff --git a/recipes/doxygen/all/patches/1.9.4-0001-enable-modern-compilers.patch b/recipes/doxygen/all/patches/1.9.4-0001-enable-modern-compilers.patch new file mode 100644 index 0000000000000..d9f3f94873c2a --- /dev/null +++ b/recipes/doxygen/all/patches/1.9.4-0001-enable-modern-compilers.patch @@ -0,0 +1,25 @@ +From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001 +From: Dimitri van Heesch +Date: Fri, 6 May 2022 09:55:16 +0200 +Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a + member of 'std' + +--- + src/cache.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cache.h b/src/cache.h +index 0ff3092ed5..e218eb27d2 100644 +--- a/src/cache.h ++++ b/src/cache.h +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + + /*! Fixed size cache for value type V using keys of type K. +-- +2.39.1 + diff --git a/recipes/doxygen/all/test_package/CMakeLists.txt b/recipes/doxygen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f0e28d12efb4d --- /dev/null +++ b/recipes/doxygen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.9) +project(test_package LANGUAGES CXX) + +find_package(Doxygen REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) + +doxygen_add_docs(docs test_package.cpp ALL COMMENT "generate HTML") diff --git a/recipes/doxygen/all/test_package/conanfile.py b/recipes/doxygen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0bcb6db477b62 --- /dev/null +++ b/recipes/doxygen/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not os.path.isdir(os.path.join(self.build_folder, "html")): + raise ConanException("doxygen did not create html documentation directory") + + self.output.info("Version:") + self.run("doxygen --version") diff --git a/recipes/doxygen/all/test_package/test_package.cpp b/recipes/doxygen/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4caefdf4a378f --- /dev/null +++ b/recipes/doxygen/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +/// \brief just a simple main function for the hello world +int main() +{ + std::cout << "bincrafters" << std::endl; + return 0; +} diff --git a/recipes/doxygen/all/test_v1_package/CMakeLists.txt b/recipes/doxygen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/doxygen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/doxygen/all/test_v1_package/conanfile.py b/recipes/doxygen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d659dafd309f3 --- /dev/null +++ b/recipes/doxygen/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + if not os.path.isdir(os.path.join(self.build_folder, "test_package", "html")): + raise ConanException("doxygen did not create html documentation directory") + + self.output.info("Version:") + self.run("doxygen --version", run_environment=True) diff --git a/recipes/doxygen/config.yml b/recipes/doxygen/config.yml new file mode 100644 index 0000000000000..2157880ecf476 --- /dev/null +++ b/recipes/doxygen/config.yml @@ -0,0 +1,13 @@ +versions: + "1.9.4": + folder: "all" + "1.9.2": + folder: "all" + "1.9.1": + folder: "all" + "1.8.20": + folder: "all" + "1.8.18": + folder: "all" + "1.8.17": + folder: "all" diff --git a/recipes/draco/all/conandata.yml b/recipes/draco/all/conandata.yml new file mode 100644 index 0000000000000..5ef3ead009666 --- /dev/null +++ b/recipes/draco/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "1.5.6": + url: "https://github.com/google/draco/archive/refs/tags/1.5.6.tar.gz" + sha256: "0280888e5b8e4c4fb93bf40e65e4e8a1ba316a0456f308164fb5c2b2b0c282d6" + "1.5.5": + url: "https://github.com/google/draco/archive/refs/tags/1.5.5.tar.gz" + sha256: "6b7994150bbc513abcdbe22ad778d6b2df10fc8cdc7035e916985b2a209ab826" + "1.5.4": + url: "https://github.com/google/draco/archive/refs/tags/1.5.4.tar.gz" + sha256: "7698cce91c24725562fb73811d24823f0f0a25e3ac0941e792993c5191d3baee" + "1.5.3": + url: "https://github.com/google/draco/archive/refs/tags/1.5.3.tar.gz" + sha256: "7882a942a1da14a9ae9d557b1a3af7f44bdee7f5d42b745c4e474fb8b28d4e5e" + "1.5.2": + url: "https://github.com/google/draco/archive/1.5.2.tar.gz" + sha256: "a887e311ec04a068ceca0bd6f3865083042334fbff26e65bc809e8978b2ce9cd" + "1.4.3": + url: "https://github.com/google/draco/archive/1.4.3.tar.gz" + sha256: "02a620a7ff8388c57d6f6e0941eecc10d0c23ab47c45942fb52f64a6245c44f5" + "1.3.6": + url: "https://github.com/google/draco/archive/1.3.6.tar.gz" + sha256: "80eaa54ef5fc687c9aeebb9bd24d936d3e6d2c6048f358be8b83fa088ef4b2cb" + "1.3.5": + url: "https://github.com/google/draco/archive/1.3.5.tar.gz" + sha256: "a3ac692397574166ad99493ff1efcd7b5c69b580e7eb4500d5d181b2f676aa6e" +patches: + "1.5.2": + - patch_file: "patches/0001-fix-cmake-1.5.2.patch" + "1.4.3": + - patch_file: "patches/0001-fix-cmake-1.4.3.patch" + "1.3.6": + - patch_file: "patches/0001-fix-cmake-1.3.6.patch" + - patch_file: "patches/0002-v1.3.6-gcc-11.patch" + - patch_file: "patches/0003-non-copy-ellision-workaround.patch" + "1.3.5": + - patch_file: "patches/0001-fix-cmake-1.3.5.patch" + - patch_file: "patches/0002-v1.3.5-gcc-11.patch" diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py new file mode 100644 index 0000000000000..c61899af9a34f --- /dev/null +++ b/recipes/draco/all/conanfile.py @@ -0,0 +1,154 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class DracoConan(ConanFile): + name = "draco" + description = "Draco is a library for compressing and decompressing 3D " \ + "geometric meshes and point clouds. It is intended to " \ + "improve the storage and transmission of 3D graphics." + license = "Apache-2.0" + topics = ("draco", "3d", "graphics", "mesh", "compression", "decompression") + homepage = "https://google.github.io/draco/" + 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], + "target": ["draco", "encode_and_decode", "encode_only", "decode_only"], + "enable_point_cloud_compression": [True, False], + "enable_mesh_compression": [True, False], + "enable_standard_edgebreaker": [True, False], + "enable_predictive_edgebreaker": [True, False], + "enable_backwards_compatibility": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "target": "draco", + "enable_point_cloud_compression": True, + "enable_mesh_compression": True, + "enable_standard_edgebreaker": True, + "enable_predictive_edgebreaker": True, + "enable_backwards_compatibility": True, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.enable_mesh_compression: + del self.options.enable_standard_edgebreaker + del self.options.enable_predictive_edgebreaker + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + + # use different cmake definitions based on package version + if Version(self.version) < "1.4.0": + tc.variables["ENABLE_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression + tc.variables["ENABLE_MESH_COMPRESSION"] = self.options.enable_mesh_compression + if self.options.enable_mesh_compression: + tc.variables["ENABLE_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker + tc.variables["ENABLE_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker + tc.variables["ENABLE_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility + + # BUILD_FOR_GLTF is not needed, it is equivalent to: + # - enable_point_cloud_compression=False + # - enable_mesh_compression=True + # - enable_standard_edgebreaker=True + # - enable_predictive_edgebreaker=False + # - enable_backwards_compatibility=False + tc.variables["BUILD_FOR_GLTF"] = False + + tc.variables["BUILD_UNITY_PLUGIN"] = False + tc.variables["BUILD_MAYA_PLUGIN"] = False + tc.variables["BUILD_USD_PLUGIN"] = False + + tc.variables["ENABLE_CCACHE"] = False + tc.variables["ENABLE_DISTCC"] = False + tc.variables["ENABLE_EXTRA_SPEED"] = False + tc.variables["ENABLE_EXTRA_WARNINGS"] = False + tc.variables["ENABLE_GOMA"] = False + tc.variables["ENABLE_JS_GLUE"] = False + tc.variables["ENABLE_DECODER_ATTRIBUTE_DEDUPLICATION"] = False + tc.variables["ENABLE_TESTS"] = False + tc.variables["ENABLE_WASM"] = False + tc.variables["ENABLE_WERROR"] = False + tc.variables["ENABLE_WEXTRA"] = False + tc.variables["IGNORE_EMPTY_BUILD_TYPE"] = False + tc.variables["BUILD_ANIMATION_ENCODING"] = False + else: + tc.variables["DRACO_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression + tc.variables["DRACO_MESH_COMPRESSION"] = self.options.enable_mesh_compression + if self.options.enable_mesh_compression: + tc.variables["DRACO_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker + tc.variables["DRACO_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker + tc.variables["DRACO_ANIMATION_ENCODING"] = False + tc.variables["DRACO_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility + tc.variables["DRACO_DECODER_ATTRIBUTE_DEDUPLICATION"] = False + tc.variables["DRACO_FAST"] = False + # DRACO_GLTF True overrides options by enabling + # DRACO_MESH_COMPRESSION_SUPPORTED, + # DRACO_NORMAL_ENCODING_SUPPORTED, + # DRACO_STANDARD_EDGEBREAKER_SUPPORTED + tc.variables["DRACO_GLTF"] = False + tc.variables["DRACO_JS_GLUE"] = False + tc.variables["DRACO_MAYA_PLUGIN"] = False + tc.variables["DRACO_TESTS"] = False + tc.variables["DRACO_UNITY_PLUGIN"] = False + tc.variables["DRACO_WASM"] = False + + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if Version(self.version) < "1.4.0": + rmdir(self, os.path.join(self.package_folder, "lib", "draco")) + else: + rmdir(self, os.path.join(self.package_folder, "share")) + if self.options.shared: + rm(self, "*draco.a", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "draco") + self.cpp_info.set_property("cmake_target_name", "draco::draco") + self.cpp_info.set_property("pkg_config_name", "draco") + self.cpp_info.libs = ["draco"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/draco/all/patches/0001-fix-cmake-1.3.5.patch b/recipes/draco/all/patches/0001-fix-cmake-1.3.5.patch new file mode 100644 index 0000000000000..0b8abdd51f389 --- /dev/null +++ b/recipes/draco/all/patches/0001-fix-cmake-1.3.5.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1107,7 +1107,7 @@ else () + + # Draco app targets. + add_executable(draco_decoder "${draco_src_root}/tools/draco_decoder.cc") +- target_link_libraries(draco_decoder PRIVATE dracodec) ++ target_link_libraries(draco_decoder PRIVATE draco) + add_executable(draco_encoder + "${draco_src_root}/tools/draco_encoder.cc") + target_link_libraries(draco_encoder PRIVATE draco) +@@ -1138,8 +1138,10 @@ else () + endif () + + # Add install rules for lib and executable targets. +- install(TARGETS dracodec dracoenc draco +- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") ++ install(TARGETS draco ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) + if (BUILD_UNITY_PLUGIN) + install(TARGETS dracodec_unity + DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") diff --git a/recipes/draco/all/patches/0001-fix-cmake-1.3.6.patch b/recipes/draco/all/patches/0001-fix-cmake-1.3.6.patch new file mode 100644 index 0000000000000..ff3287e3f4b83 --- /dev/null +++ b/recipes/draco/all/patches/0001-fix-cmake-1.3.6.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1044,7 +1044,7 @@ else() + # Draco app targets. + add_executable(draco_decoder "${draco_src_root}/tools/draco_decoder.cc" + ${draco_io_sources}) +- target_link_libraries(draco_decoder PRIVATE dracodec) ++ target_link_libraries(draco_decoder PRIVATE draco) + add_executable(draco_encoder "${draco_src_root}/tools/draco_encoder.cc" + ${draco_io_sources}) + target_link_libraries(draco_encoder PRIVATE draco) +@@ -1073,8 +1073,10 @@ else() + endif() + + # Add install rules for lib and executable targets. +- install(TARGETS dracodec dracoenc draco DESTINATION +- "${CMAKE_INSTALL_PREFIX}/lib") ++ install(TARGETS draco ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) + if(BUILD_UNITY_PLUGIN) + install(TARGETS dracodec_unity DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") + endif() diff --git a/recipes/draco/all/patches/0001-fix-cmake-1.4.3.patch b/recipes/draco/all/patches/0001-fix-cmake-1.4.3.patch new file mode 100644 index 0000000000000..b18161cfbf66d --- /dev/null +++ b/recipes/draco/all/patches/0001-fix-cmake-1.4.3.patch @@ -0,0 +1,19 @@ +--- a/cmake/draco_install.cmake ++++ b/cmake/draco_install.cmake +@@ -70,14 +70,12 @@ macro(draco_setup_install_target) + "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + + if(MSVC) +- install(TARGETS draco DESTINATION +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++ install(TARGETS draco RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + else() + install(TARGETS draco_static DESTINATION + "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + if(BUILD_SHARED_LIBS) +- install(TARGETS draco_shared DESTINATION +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++ install(TARGETS draco_shared RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + endif() + endif() + diff --git a/recipes/draco/all/patches/0001-fix-cmake-1.5.2.patch b/recipes/draco/all/patches/0001-fix-cmake-1.5.2.patch new file mode 100644 index 0000000000000..dbaee4fdaf2b4 --- /dev/null +++ b/recipes/draco/all/patches/0001-fix-cmake-1.5.2.patch @@ -0,0 +1,17 @@ +--- a/cmake/draco_install.cmake ++++ b/cmake/draco_install.cmake +@@ -84,12 +84,12 @@ macro(draco_setup_install_target) + endif() + + if(MSVC) +- install(TARGETS draco DESTINATION "${libs_path}") ++ install(TARGETS draco RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + else() + install(TARGETS draco_static DESTINATION "${libs_path}") + + if(BUILD_SHARED_LIBS) +- install(TARGETS draco_shared DESTINATION "${libs_path}") ++ install(TARGETS draco_shared RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + endif() + endif() + diff --git a/recipes/draco/all/patches/0002-v1.3.5-gcc-11.patch b/recipes/draco/all/patches/0002-v1.3.5-gcc-11.patch new file mode 100644 index 0000000000000..6a24b6c9ce15b --- /dev/null +++ b/recipes/draco/all/patches/0002-v1.3.5-gcc-11.patch @@ -0,0 +1,24 @@ +diff --git a/src/draco/core/hash_utils.h b/src/draco/core/hash_utils.h +index 0e8da60..ec28e85 100644 +--- a/src/draco/core/hash_utils.h ++++ b/src/draco/core/hash_utils.h +@@ -16,6 +16,7 @@ + #define DRACO_CORE_HASH_UTILS_H_ + + #include ++#include + #include + + // TODO(fgalligan): Move this to core. +diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc +index 0a22ba1..f6d040a 100644 +--- a/src/draco/io/parser_utils.cc ++++ b/src/draco/io/parser_utils.cc +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + namespace draco { + namespace parser { diff --git a/recipes/draco/all/patches/0002-v1.3.6-gcc-11.patch b/recipes/draco/all/patches/0002-v1.3.6-gcc-11.patch new file mode 100644 index 0000000000000..5980643ec3156 --- /dev/null +++ b/recipes/draco/all/patches/0002-v1.3.6-gcc-11.patch @@ -0,0 +1,25 @@ +diff --git a/src/draco/core/hash_utils.h b/src/draco/core/hash_utils.h +index dd910d0..ec28e85 100644 +--- a/src/draco/core/hash_utils.h ++++ b/src/draco/core/hash_utils.h +@@ -16,7 +16,7 @@ + #define DRACO_CORE_HASH_UTILS_H_ + + #include +- ++#include + #include + + // TODO(fgalligan): Move this to core. +diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc +index 6e42a58..45df9d1 100644 +--- a/src/draco/io/parser_utils.cc ++++ b/src/draco/io/parser_utils.cc +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + namespace draco { + namespace parser { diff --git a/recipes/draco/all/patches/0003-non-copy-ellision-workaround.patch b/recipes/draco/all/patches/0003-non-copy-ellision-workaround.patch new file mode 100644 index 0000000000000..82e1e4ef6056c --- /dev/null +++ b/recipes/draco/all/patches/0003-non-copy-ellision-workaround.patch @@ -0,0 +1,15 @@ +--- a/src/draco/io/stdio_file_writer.cc ++++ b/src/draco/io/stdio_file_writer.cc +@@ -41,7 +41,12 @@ std::unique_ptr StdioFileWriter::Open( + return nullptr; + } + ++#if (defined(__GNUC__) && (__GNUC___ < 5)) || \ ++ (defined(__clang__) && (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 9))) ++ return std::move(file); ++#else + return file; ++#endif + } + + bool StdioFileWriter::Write(const char *buffer, size_t size) { diff --git a/recipes/draco/all/test_package/CMakeLists.txt b/recipes/draco/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..df800aa1ddc46 --- /dev/null +++ b/recipes/draco/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(draco REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE draco::draco) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/draco/all/test_package/conanfile.py b/recipes/draco/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/draco/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/draco/all/test_package/test_package.cpp b/recipes/draco/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a691f02d06ffc --- /dev/null +++ b/recipes/draco/all/test_package/test_package.cpp @@ -0,0 +1,124 @@ +#include + +#include +#include +#include +#include + +struct Vec3D { + float x, y, z; + Vec3D(float x, float y, float z): x(x), y(y), z(z) {} +}; + +struct Triangle { + uint32_t i1, i2, i3; + Triangle(uint32_t i1, uint32_t i2, uint32_t i3): i1(i1), i2(i2), i3(i3) {} +}; + +struct IndexedMesh { + std::vector vertices; + std::vector primitives; + + unsigned long long size() { + return vertices.size() * sizeof(Vec3D) + primitives.size() * sizeof(Triangle); + } +}; + +std::vector create_icosahedron_vertices() { + std::vector vertices; + vertices.reserve(12); + + const float t = (1.0f + std::sqrt(5.0f)) / 2.0f; + + vertices.emplace_back(-1.0f, t, 0.0f); + vertices.emplace_back( 1.0f, t, 0.0f); + vertices.emplace_back(-1.0f, -t, 0.0f); + vertices.emplace_back( 1.0f, -t, 0.0f); + + vertices.emplace_back(0.0f, -1.0f, t); + vertices.emplace_back(0.0f, 1.0f, t); + vertices.emplace_back(0.0f, -1.0f, -t); + vertices.emplace_back(0.0f, 1.0f, -t); + + vertices.emplace_back( t, 0.0f, -1.0f); + vertices.emplace_back( t, 0.0f, 1.0f); + vertices.emplace_back(-t, 0.0f, -1.0f); + vertices.emplace_back(-t, 0.0f, 1.0f); + + return vertices; +} + +std::vector create_icosahedron_primitives() { + std::vector primitives; + primitives.reserve(20); + + primitives.emplace_back(0 , 11, 5 ); + primitives.emplace_back(0 , 5 , 1 ); + primitives.emplace_back(0 , 1 , 7 ); + primitives.emplace_back(0 , 7 , 10); + primitives.emplace_back(0 , 10, 11); + + primitives.emplace_back(1 , 5 , 9 ); + primitives.emplace_back(5 , 11, 4 ); + primitives.emplace_back(11, 1 , 2 ); + primitives.emplace_back(10, 7 , 6 ); + primitives.emplace_back(7 , 1 , 8 ); + + primitives.emplace_back(3 , 9 , 4 ); + primitives.emplace_back(3 , 4 , 2 ); + primitives.emplace_back(3 , 2 , 6 ); + primitives.emplace_back(3 , 6 , 8 ); + primitives.emplace_back(3 , 8 , 9 ); + + primitives.emplace_back(4 , 9 , 5 ); + primitives.emplace_back(2 , 4 , 11); + primitives.emplace_back(6 , 2 , 10); + primitives.emplace_back(8 , 6 , 7 ); + primitives.emplace_back(9 , 8 , 1 ); + + return primitives; +} + +int main(int argc, char **argv) { + // Create initial Mesh + IndexedMesh mesh; + mesh.vertices = create_icosahedron_vertices(); + mesh.primitives = create_icosahedron_primitives(); + + // Create Draco Mesh from initial Mesh + std::unique_ptr dracoMesh(new draco::Mesh()); + dracoMesh->set_num_points(static_cast(mesh.vertices.size())); + + draco::GeometryAttribute pos_attr; + pos_attr.Init(draco::GeometryAttribute::POSITION, nullptr, 3, draco::DT_FLOAT32, false, sizeof(Vec3D), 0); + const uint32_t pos_att_id = dracoMesh->AddAttribute(pos_attr, true, static_cast(mesh.vertices.size())); + for (std::size_t i = 0; i < mesh.vertices.size(); ++i) { + dracoMesh->attribute(pos_att_id)->SetAttributeValue( + draco::AttributeValueIndex(static_cast(i)), + &mesh.vertices[i] + ); + } + + for (const auto &primitive : mesh.primitives) { + dracoMesh->AddFace({ + draco::PointIndex(primitive.i1), + draco::PointIndex(primitive.i2), + draco::PointIndex(primitive.i3) + }); + } + + std::cout << "Number of faces : " << dracoMesh->num_faces() << "\n"; + std::cout << "Number of vertices: " << dracoMesh->num_points() << "\n"; + + // Encode mesh with position's quantization of 16 bits and edgebreaker + draco::Encoder encoder; + encoder.SetAttributeQuantization(draco::GeometryAttribute::POSITION, 16); + encoder.SetEncodingMethod(draco::MESH_EDGEBREAKER_ENCODING); + draco::EncoderBuffer buffer; + encoder.EncodeMeshToBuffer(*dracoMesh, &buffer); + + std::cout << "Initial mesh in " << mesh.size() << " bytes\n"; + std::cout << "Encoded mesh in " << buffer.size() << " bytes\n"; + + return 0; +} diff --git a/recipes/draco/all/test_v1_package/CMakeLists.txt b/recipes/draco/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/draco/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/draco/all/test_v1_package/conanfile.py b/recipes/draco/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/draco/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/draco/config.yml b/recipes/draco/config.yml new file mode 100644 index 0000000000000..5abf33ed66800 --- /dev/null +++ b/recipes/draco/config.yml @@ -0,0 +1,17 @@ +versions: + "1.5.6": + folder: all + "1.5.5": + folder: all + "1.5.4": + folder: all + "1.5.3": + folder: all + "1.5.2": + folder: all + "1.4.3": + folder: all + "1.3.6": + folder: all + "1.3.5": + folder: all diff --git a/recipes/dragonbox/all/conandata.yml b/recipes/dragonbox/all/conandata.yml new file mode 100644 index 0000000000000..fbf31246d5c77 --- /dev/null +++ b/recipes/dragonbox/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.1.3": + url: "https://github.com/jk-jeon/dragonbox/archive/refs/tags/1.1.3.tar.gz" + sha256: "09d63b05e9c594ec423778ab59b7a5aa1d76fdd71d25c7048b0258c4ec9c3384" +patches: + "1.1.3": + - patch_file: "patches/1.1.3-fix-include-directory.patch" + patch_description: "fix include path" + patch_type: "conan" diff --git a/recipes/dragonbox/all/conanfile.py b/recipes/dragonbox/all/conanfile.py new file mode 100644 index 0000000000000..89c3a6984496c --- /dev/null +++ b/recipes/dragonbox/all/conanfile.py @@ -0,0 +1,98 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +import os + + +required_conan_version = ">=1.53.0" + + +class DragonboxConan(ConanFile): + name = "dragonbox" + description = "Reference implementation of Dragonbox in C++" + license = ("Apache-2.0", "LLVM-exception", "BSL-1.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jk-jeon/dragonbox" + topics = ("float-to-string", "grisu", "grisu-exact") + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.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.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["DRAGONBOX_INSTALL_TO_CHARS"] = True + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_module_file_name", "dragonbox") + self.cpp_info.components["_dragonbox"].set_property("cmake_target_name", "dragonbox::dragonbox") + self.cpp_info.components["dragonbox_to_chars_headers"].set_property("cmake_target_name", "dragonbox::dragonbox_to_chars") + self.cpp_info.components["dragonbox_to_chars_headers"].libs = ["dragonbox_to_chars"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "dragonbox" + self.cpp_info.filenames["cmake_find_package_multi"] = "dragonbox" + self.cpp_info.names["cmake_find_package"] = "dragonbox" + self.cpp_info.names["cmake_find_package_multi"] = "dragonbox" + self.cpp_info.components["_dragonbox"].names["cmake_find_package"] = "dragonbox" + self.cpp_info.components["_dragonbox"].names["cmake_find_package_multi"] = "dragonbox" + self.cpp_info.components["dragonbox_to_chars_headers"].names["cmake_find_package"] = "dragonbox_to_chars" + self.cpp_info.components["dragonbox_to_chars_headers"].names["cmake_find_package_multi"] = "dragonbox_to_chars" diff --git a/recipes/dragonbox/all/patches/1.1.3-fix-include-directory.patch b/recipes/dragonbox/all/patches/1.1.3-fix-include-directory.patch new file mode 100644 index 0000000000000..906ca02b2235e --- /dev/null +++ b/recipes/dragonbox/all/patches/1.1.3-fix-include-directory.patch @@ -0,0 +1,13 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index a9d80b9..e0417d7 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -58,7 +58,7 @@ option(DRAGONBOX_INSTALL_TO_CHARS + On) + + set(dragonbox_directory "dragonbox-${PROJECT_VERSION}") +-set(dragonbox_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${dragonbox_directory}") ++set(dragonbox_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") + set(dragonbox_install_targets "dragonbox") + + if (DRAGONBOX_INSTALL_TO_CHARS) diff --git a/recipes/dragonbox/all/test_package/CMakeLists.txt b/recipes/dragonbox/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7523e1c1d0d5d --- /dev/null +++ b/recipes/dragonbox/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(dragonbox REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dragonbox::dragonbox_to_chars) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/dragonbox/all/test_package/conanfile.py b/recipes/dragonbox/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/dragonbox/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/dragonbox/all/test_package/test_package.cpp b/recipes/dragonbox/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7f20adde8e681 --- /dev/null +++ b/recipes/dragonbox/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include + +#include "dragonbox/dragonbox_to_chars.h" + +int main(void) { + constexpr int buffer_length = 1 + // for '\0' + jkj::dragonbox::max_output_string_length; + double x = 1.234; // Also works for float + char buffer[buffer_length]; + + // Null-terminate the buffer and return the pointer to the null character + // Hence, the length of the string is (end_ptr - buffer) + // buffer is now { '1', '.', '2', '3', '4', 'E', '0', '\0', (garbages) } + char* end_ptr = jkj::dragonbox::to_chars(x, buffer); + + // Does not null-terminate the buffer; returns the next-to-end pointer + // buffer is now { '1', '.', '2', '3', '4', 'E', '0', (garbages) } + // you can wrap the buffer with things like std::string_view + end_ptr = jkj::dragonbox::to_chars_n(x, buffer); + + return 0; +} diff --git a/recipes/dragonbox/all/test_v1_package/CMakeLists.txt b/recipes/dragonbox/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/dragonbox/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dragonbox/all/test_v1_package/conanfile.py b/recipes/dragonbox/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/dragonbox/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dragonbox/config.yml b/recipes/dragonbox/config.yml new file mode 100644 index 0000000000000..e1c4f3be24983 --- /dev/null +++ b/recipes/dragonbox/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.3": + folder: all diff --git a/recipes/drflac/all/CMakeLists.txt b/recipes/drflac/all/CMakeLists.txt new file mode 100644 index 0000000000000..f2a49258562bf --- /dev/null +++ b/recipes/drflac/all/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.4) +project(dr_flac LANGUAGES C) + +include(GNUInstallDirs) + +set(BUFFER_SIZE "0" CACHE STRING "Value for define DR_FLAC_BUFFER_SIZE. 0 means default buffer size.") +option(NO_CRC "Build with define DR_FLAC_NO_CRC" OFF) +option(NO_OGG "Build with define DR_FLAC_NO_OGG" OFF) +option(NO_SIMD "Build with define DR_FLAC_NO_SIMD" OFF) +option(NO_STDIO "Build with define DR_FLAC_NO_STDIO" OFF) +option(NO_WCHAR "Build with define DR_FLAC_NO_WCHAR" OFF) + +add_library(${CMAKE_PROJECT_NAME} dr_flac.c) + +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRFLAC_SRC_DIR}) + +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES + PUBLIC_HEADER ${DRFLAC_SRC_DIR}/dr_flac.h + C_STANDARD 99 +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDRFLAC_DLL) +endif() +if(NOT BUFFER_SIZE STREQUAL "0") + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC "-DDR_FLAC_BUFFER_SIZE=${BUFFER_SIZE}") +endif() +if(NO_CRC) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_CRC) +endif() +if(NO_OGG) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_OGG) +endif() +if(NO_SIMD) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_SIMD) +endif() +if(NO_STDIO) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_STDIO) +endif() +if(NO_WCHAR) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_WCHAR) +endif() + +install(TARGETS ${CMAKE_PROJECT_NAME} + 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/drflac/all/conandata.yml b/recipes/drflac/all/conandata.yml new file mode 100644 index 0000000000000..4b8f26778e5b0 --- /dev/null +++ b/recipes/drflac/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + # NOTE: https://github.com/mackron/dr_libs/blob/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb/dr_flac.h#L3 + "0.12.39": + url: https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip + sha256: "077d6b29a78da5132065fcc9b44ca50e7e168b94250f2c25614101d3f808bcc1" + # NOTE: https://github.com/mackron/dr_libs/blob/089deaa62268e6dacf2026754b1b228e54eb3993/dr_flac.h#L3 + "0.12.38": + url: https://github.com/mackron/dr_libs/archive/089deaa62268e6dacf2026754b1b228e54eb3993.zip + sha256: "1b9fa02c56c2b42c99dd070c7dc3d4e8dee6a4e49139055e7f79e21aa88070d7" diff --git a/recipes/drflac/all/conanfile.py b/recipes/drflac/all/conanfile.py new file mode 100644 index 0000000000000..99eec44380473 --- /dev/null +++ b/recipes/drflac/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class DrflacConan(ConanFile): + name = "drflac" + description = "FLAC audio decoder." + homepage = "https://mackron.github.io/dr_flac" + topics = ("audio", "flac", "sound") + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "buffer_size": ["ANY"], + "no_crc": [True, False], + "no_ogg": [True, False], + "no_simd": [True, False], + "no_stdio": [True, False], + "no_wchar": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "buffer_size": 0, # zero means the default buffer size is used + "no_crc": False, + "no_ogg": False, + "no_simd": False, + "no_stdio": False, + "no_wchar": False, + } + exports_sources = ["CMakeLists.txt", "dr_flac.c"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "0.12.39": + del self.options.no_wchar + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DRFLAC_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BUFFER_SIZE"] = self.options.buffer_size + tc.variables["NO_CRC"] = self.options.no_crc + tc.variables["NO_OGG"] = self.options.no_ogg + tc.variables["NO_SIMD"] = self.options.no_simd + tc.variables["NO_STDIO"] = self.options.no_stdio + tc.variables["NO_WCHAR"] = self.options.get_safe("no_wchar", False) + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["dr_flac"] + if self.options.shared: + self.cpp_info.defines.append("DRFLAC_DLL") + if self.options.buffer_size != "0": + self.cpp_info.defines.append("DR_FLAC_BUFFER_SIZE={}".format(self.options.buffer_size)) + if self.options.no_crc: + self.cpp_info.defines.append("DR_FLAC_NO_CRC") + if self.options.no_ogg: + self.cpp_info.defines.append("DR_FLAC_NO_OGG") + if self.options.no_simd: + self.cpp_info.defines.append("DR_FLAC_NO_SIMD") + if self.options.no_stdio: + self.cpp_info.defines.append("DR_FLAC_NO_STDIO") + if self.options.get_safe("no_wchar", False): + self.cpp_info.defines.append("DR_FLAC_NO_WCHAR") diff --git a/recipes/drflac/all/dr_flac.c b/recipes/drflac/all/dr_flac.c new file mode 100644 index 0000000000000..8d3599cc734f1 --- /dev/null +++ b/recipes/drflac/all/dr_flac.c @@ -0,0 +1,3 @@ +#define DR_FLAC_IMPLEMENTATION + +#include "dr_flac.h" diff --git a/recipes/drflac/all/test_package/CMakeLists.txt b/recipes/drflac/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1db07f8a402a7 --- /dev/null +++ b/recipes/drflac/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(drflac CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE drflac::drflac) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/drflac/all/test_package/conanfile.py b/recipes/drflac/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/drflac/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/drflac/all/test_package/test_package.c b/recipes/drflac/all/test_package/test_package.c new file mode 100644 index 0000000000000..992ab6220085f --- /dev/null +++ b/recipes/drflac/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include "dr_flac.h" + +int main(void) { + const char *version = drflac_version_string(); + printf("dr_flac version: %s\n", version); + + return 0; +} diff --git a/recipes/drflac/all/test_v1_package/CMakeLists.txt b/recipes/drflac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/drflac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/drflac/all/test_v1_package/conanfile.py b/recipes/drflac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/drflac/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/drflac/config.yml b/recipes/drflac/config.yml new file mode 100644 index 0000000000000..f7ff0941f9f1b --- /dev/null +++ b/recipes/drflac/config.yml @@ -0,0 +1,5 @@ +versions: + "0.12.39": + folder: all + "0.12.38": + folder: all diff --git a/recipes/drmp3/all/CMakeLists.txt b/recipes/drmp3/all/CMakeLists.txt new file mode 100644 index 0000000000000..c44a0bb77d180 --- /dev/null +++ b/recipes/drmp3/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.4) +project(dr_mp3 LANGUAGES C) + +include(GNUInstallDirs) + +option(NO_SIMD "Build with define DR_MP3_NO_SIMD" OFF) +option(NO_STDIO "Build with define DR_MP3_NO_STDIO" OFF) + +add_library(${CMAKE_PROJECT_NAME} dr_mp3.c) + +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRMP3_SRC_DIR}) + +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES + PUBLIC_HEADER ${DRMP3_SRC_DIR}/dr_mp3.h + C_STANDARD 99 +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDRMP3_DLL) +endif() +if(NO_SIMD) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_MP3_NO_SIMD) +endif() +if(NO_STDIO) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_MP3_NO_STDIO) +endif() + +install(TARGETS ${CMAKE_PROJECT_NAME} + 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/drmp3/all/conandata.yml b/recipes/drmp3/all/conandata.yml new file mode 100644 index 0000000000000..a26d9e9dbb871 --- /dev/null +++ b/recipes/drmp3/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + # NOTE: https://github.com/mackron/dr_libs/blob/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb/dr_mp3.h#L3 + "0.6.34": + url: https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip + sha256: "077d6b29a78da5132065fcc9b44ca50e7e168b94250f2c25614101d3f808bcc1" + # NOTE: https://github.com/mackron/dr_libs/blob/9497270f581f43e6b795ce5d98d8764861fb6a50/dr_mp3.h#L3 + "0.6.32": + url: https://github.com/mackron/dr_libs/archive/9497270f581f43e6b795ce5d98d8764861fb6a50.zip + sha256: "572b59ec9719cf8f4938f982bc1f2e52689a3fbf6cceb4f27478942d7e35456b" diff --git a/recipes/drmp3/all/conanfile.py b/recipes/drmp3/all/conanfile.py new file mode 100644 index 0000000000000..5ff9719fea314 --- /dev/null +++ b/recipes/drmp3/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class Drmp3Conan(ConanFile): + name = "drmp3" + description = "MP3 audio decoder." + homepage = "https://mackron.github.io/" + topics = ("audio", "mp3", "sound") + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "no_simd": [True, False], + "no_stdio": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "no_simd": False, + "no_stdio": False, + } + exports_sources = ["CMakeLists.txt", "dr_mp3.c"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DRMP3_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["NO_SIMD"] = self.options.no_simd + tc.variables["NO_STDIO"] = self.options.no_stdio + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["dr_mp3"] + if self.options.shared: + self.cpp_info.defines.append("DRMP3_DLL") + if self.options.no_simd: + self.cpp_info.defines.append("DR_MP3_NO_SIMD") + if self.options.no_stdio: + self.cpp_info.defines.append("DR_MP3_NO_STDIO") diff --git a/recipes/drmp3/all/dr_mp3.c b/recipes/drmp3/all/dr_mp3.c new file mode 100644 index 0000000000000..c1514c4731e49 --- /dev/null +++ b/recipes/drmp3/all/dr_mp3.c @@ -0,0 +1,3 @@ +#define DR_MP3_IMPLEMENTATION + +#include "dr_mp3.h" diff --git a/recipes/drmp3/all/test_package/CMakeLists.txt b/recipes/drmp3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5c1b7eb10c20 --- /dev/null +++ b/recipes/drmp3/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(drmp3 CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE drmp3::drmp3) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/drmp3/all/test_package/conanfile.py b/recipes/drmp3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/drmp3/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/drmp3/all/test_package/test_package.c b/recipes/drmp3/all/test_package/test_package.c new file mode 100644 index 0000000000000..9760fc154c008 --- /dev/null +++ b/recipes/drmp3/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include "dr_mp3.h" + +int main(void) { + const char *version = drmp3_version_string(); + printf("dr_mp3 version: %s\n", version); + + return 0; +} diff --git a/recipes/drmp3/all/test_v1_package/CMakeLists.txt b/recipes/drmp3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/drmp3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/drmp3/all/test_v1_package/conanfile.py b/recipes/drmp3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/drmp3/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/drmp3/config.yml b/recipes/drmp3/config.yml new file mode 100644 index 0000000000000..dda44114b507b --- /dev/null +++ b/recipes/drmp3/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.34": + folder: all + "0.6.32": + folder: all diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml new file mode 100644 index 0000000000000..3d2e4a7aaaaea --- /dev/null +++ b/recipes/drogon/all/conandata.yml @@ -0,0 +1,62 @@ +sources: + "1.8.3": + url: "https://github.com/drogonframework/drogon/archive/v1.8.3.tar.gz" + sha256: "db6d92a0c40ec52d5704fb4128860b9eecdc284653e8d85113b4219b96dc7129" + "1.8.2": + url: "https://github.com/drogonframework/drogon/archive/v1.8.2.tar.gz" + sha256: "1182cab00c33e400eac617c6dbf44fa2f358e1844990b6b8c5c87783024f9971" + "1.8.0": + url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.8.0.tar.gz" + sha256: "bc6503cf213ed961d4a5e9fd7cb8e75b6b11045a67840ea2241e57321dd8711b" + "1.7.5": + url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" + sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" +patches: + "1.8.3": + - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" + patch_description: "Consume Trantor package from Conan instead of using the\ + \ subproject" + patch_type: "conan" + - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + - patch_file: "patches/1.8.3-0003-find-package-sqlite.patch" + patch_description: "Fix sqlite cmake target name" + patch_type: "conan" + + "1.8.2": + - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" + patch_description: "Consume Trantor package from Conan instead of using the\ + \ subproject" + patch_type: "conan" + - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + - patch_file: "patches/1.8.2-0003-find-package-sqlite.patch" + patch_description: "Fix sqlite cmake target name" + patch_type: "conan" + + "1.8.0": + - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" + patch_description: "Consume Trantor package from Conan instead of using the subproject" + patch_type: "conan" + - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + - patch_file: "patches/1.8.0-0003-find-package-sqlite.patch" + patch_description: "Fix sqlite cmake target name" + patch_type: "conan" + + "1.7.5": + - patch_file: "patches/1.7.5-0001-disable_trantor.patch" + patch_description: "Consume Trantor package from Conan instead of using the subproject" + patch_type: "conan" + - patch_file: "patches/1.7.5-0002-remove-boost-components.patch" + patch_description: "Do not consume specific Boost components" + patch_type: "conan" + - patch_file: "patches/1.7.5-0003-find-package-trantor.patch" + patch_description: "Fix Trantor cmake target name" + patch_type: "conan" + - patch_file: "patches/1.7.5-0004-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py new file mode 100644 index 0000000000000..05e8a3e45cfa1 --- /dev/null +++ b/recipes/drogon/all/conanfile.py @@ -0,0 +1,179 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + +class DrogonConan(ConanFile): + name = "drogon" + description = "A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows" + topics = ("http-server", "non-blocking-io", "http-framework", "asynchronous-programming") + license = "MIT" + homepage = "https://github.com/drogonframework/drogon" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [False, True], + "fPIC": [True, False], + "with_boost": [True, False], + "with_ctl": [True, False], + "with_orm": [True, False], + "with_profile": [True, False], + "with_brotli": [True, False], + "with_postgres": [True, False], + "with_postgres_batch": [True, False], + "with_mysql": [True, False], + "with_sqlite": [True, False], + "with_redis": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_boost": True, + "with_ctl": False, + "with_orm": True, + "with_profile": False, + "with_brotli": False, + "with_postgres": False, + "with_postgres_batch": False, + "with_mysql": False, + "with_sqlite": False, + "with_redis": 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.options["trantor"].shared = True + if not self.options.with_orm: + del self.options.with_postgres + del self.options.with_postgres_batch + del self.options.with_mysql + del self.options.with_sqlite + del self.options.with_redis + elif not self.options.with_postgres: + del self.options.with_postgres_batch + + @property + def _min_cppstd(self): + return 14 if Version(self.version) < "1.8.2" else 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "1.8.2": + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", + "clang": "5", + "apple-clang": "10", + } + else: + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version: + if Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + else: + self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + + def requirements(self): + self.requires("trantor/1.5.8") + self.requires("jsoncpp/1.9.5") + self.requires("openssl/1.1.1s") + self.requires("zlib/1.2.13") + if self.settings.os == "Linux": + self.requires("libuuid/1.0.3") + if self.options.with_profile: + self.requires("coz/cci.20210322") + if self.options.with_boost: + self.requires("boost/1.81.0") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + if self.options.get_safe("with_postgres"): + self.requires("libpq/14.5") + if self.options.get_safe("with_mysql"): + self.requires("libmysqlclient/8.0.30") + if self.options.get_safe("with_sqlite"): + self.requires("sqlite3/3.40.0") + if self.options.get_safe("with_redis"): + self.requires("hiredis/1.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_CTL"] = self.options.with_ctl + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_ORM"] = self.options.with_orm + tc.variables["COZ_PROFILING"] = self.options.with_profile + tc.variables["BUILD_DROGON_SHARED"] = self.options.shared + tc.variables["BUILD_DOC"] = False + tc.variables["BUILD_BROTLI"] = self.options.with_brotli + tc.variables["BUILD_POSTGRESQL"] = self.options.get_safe("with_postgres", False) + tc.variables["BUILD_POSTGRESQL_BATCH"] = self.options.get_safe("with_postgres_batch", False) + tc.variables["BUILD_MYSQL"] = self.options.get_safe("with_mysql", False) + tc.variables["BUILD_SQLITE"] = self.options.get_safe("with_sqlite", False) + tc.variables["BUILD_REDIS"] = self.options.get_safe("with_redis", False) + 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", 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 = ["drogon"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["rpcrt4", "ws2_32", "crypt32", "advapi32"]) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + self.cpp_info.system_libs.append("stdc++fs") + + if self.options.with_ctl: + 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.set_property("cmake_file_name", "Drogon") + self.cpp_info.set_property("cmake_target_name", "Drogon::Drogon") + + # TODO: Remove after Conan 2.0 + self.cpp_info.filenames["cmake_find_package"] = "Drogon" + self.cpp_info.filenames["cmake_find_package_multi"] = "Drogon" + self.cpp_info.names["cmake_find_package"] = "Drogon" + self.cpp_info.names["cmake_find_package_multi"] = "Drogon" diff --git a/recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch b/recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch new file mode 100644 index 0000000000000..bd56d16c697b5 --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 146d2b8..f83e119 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,7 +52,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + endif () + + if (BUILD_DROGON_SHARED) +- set(BUILD_TRANTOR_SHARED TRUE) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + find_package(Threads) + # set(BUILD_EXAMPLES FALSE) +@@ -110,7 +109,6 @@ target_include_directories( + $ + $ + $ +- $ + $ + $) + +@@ -120,8 +118,6 @@ if (WIN32) + PRIVATE $) + endif (WIN32) + +-add_subdirectory(trantor) +- + target_link_libraries(${PROJECT_NAME} PUBLIC trantor) + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") diff --git a/recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch b/recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch new file mode 100644 index 0000000000000..6823964b810ea --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f83e119..46a23fd 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -177,7 +177,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") + endif () + + if(NEED_BOOST_FS) +- find_package(Boost 1.49.0 COMPONENTS filesystem system REQUIRED) ++ # TODO: component specified find_package is always failed. Need to fix it. ++ find_package(Boost 1.49.0 REQUIRED) + message(STATUS "Using Boost filesytem::path") + message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIR}) + include_directories(${BOOST_INCLUDE_DIRS}) diff --git a/recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch b/recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch new file mode 100644 index 0000000000000..d2e449648defd --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 46a23fd..d2e2f69 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,7 +118,8 @@ if (WIN32) + PRIVATE $) + endif (WIN32) + +-target_link_libraries(${PROJECT_NAME} PUBLIC trantor) ++find_package(Trantor REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor) + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") + target_link_libraries(${PROJECT_NAME} PRIVATE network) diff --git a/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch new file mode 100644 index 0000000000000..dc4849690a251 --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d2e2f69..61fb3bf 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -199,9 +199,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" + AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" diff --git a/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch b/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch new file mode 100644 index 0000000000000..3038da266a3a2 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch @@ -0,0 +1,41 @@ +index ca6dff2..ba015d2 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,6 @@ option(BUILD_CTL "Build drogon_ctl" ${BUILD_PROGRAMS}) + option(BUILD_EXAMPLES "Build examples" ${BUILD_PROGRAMS}) + option(BUILD_ORM "Build orm" ON) + option(COZ_PROFILING "Use coz for profiling" OFF) +-option(BUILD_SHARED_LIBS "Build drogon as a shared lib" OFF) + option(BUILD_DOC "Build Doxygen documentation" OFF) + option(BUILD_BROTLI "Build Brotli" ON) + +@@ -106,7 +105,6 @@ target_include_directories( + $ + $ + $ +- $ + $ + $) + +@@ -116,9 +114,8 @@ if (WIN32) + PRIVATE $) + endif (WIN32) + +-add_subdirectory(trantor) +- +-target_link_libraries(${PROJECT_NAME} PUBLIC trantor) ++find_package(Trantor REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor) + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") + target_link_libraries(${PROJECT_NAME} PRIVATE network) +@@ -177,7 +174,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") + endif () + + if(NEED_BOOST_FS) +- find_package(Boost 1.49.0 COMPONENTS filesystem system REQUIRED) ++ # TODO: component specified find_package is always failed. Need to fix it. ++ find_package(Boost 1.49.0 REQUIRED) + message(STATUS "Using Boost filesytem::path") + message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIR}) + include_directories(${BOOST_INCLUDE_DIRS}) diff --git a/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch new file mode 100644 index 0000000000000..2402bc2bfdf71 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba015d2..02c2ccc 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -195,9 +195,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" + AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" diff --git a/recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch new file mode 100644 index 0000000000000..908cb3b2952e3 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5d92323..b971267 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -394,7 +394,7 @@ # Find sqlite3. + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) diff --git a/recipes/drogon/all/patches/1.8.2-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.2-0003-find-package-sqlite.patch new file mode 100644 index 0000000000000..c54242f8776df --- /dev/null +++ b/recipes/drogon/all/patches/1.8.2-0003-find-package-sqlite.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5d92323..b971267 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -402,7 +402,7 @@ # Find sqlite3. + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) diff --git a/recipes/drogon/all/patches/1.8.3-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.3-0003-find-package-sqlite.patch new file mode 100644 index 0000000000000..f4d98d1fd03e8 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.3-0003-find-package-sqlite.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 680dc46..28cbcf4 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -405,7 +405,7 @@ if (BUILD_SQLITE) + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) diff --git a/recipes/drogon/all/test_package/CMakeLists.txt b/recipes/drogon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf16e9b501eaa --- /dev/null +++ b/recipes/drogon/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Drogon CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon) + +# drogon uses string_view when MSVC_VERSION is greater than 1900. +# https://github.com/drogonframework/drogon/blob/v1.7.5/lib/inc/drogon/utils/string_view.h#L16 +if((DEFINED MSVC_VERSION AND MSVC_VERSION GREATER 1900) OR Drogon_VERSION VERSION_GREATER_EQUAL "1.8.2") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/drogon/all/test_package/conanfile.py b/recipes/drogon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..84eaa369e4a72 --- /dev/null +++ b/recipes/drogon/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/drogon/all/test_package/test_package.cpp b/recipes/drogon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4676e2ff59d38 --- /dev/null +++ b/recipes/drogon/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include "drogon/drogon.h" + +int main() { + trantor::Logger::setLogLevel(trantor::Logger::kTrace); + + auto client = drogon::HttpClient::newHttpClient("http://www.example.com"); + auto req = drogon::HttpRequest::newHttpRequest(); + req->setMethod(drogon::Get); + req->setPath("/s"); + req->setParameter("wd", "wx"); + req->setParameter("oq", "wx"); + + return 0; +} diff --git a/recipes/drogon/all/test_v1_package/CMakeLists.txt b/recipes/drogon/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/drogon/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/drogon/all/test_v1_package/conanfile.py b/recipes/drogon/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..db6f728ae05ec --- /dev/null +++ b/recipes/drogon/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml new file mode 100644 index 0000000000000..0ab8881109d24 --- /dev/null +++ b/recipes/drogon/config.yml @@ -0,0 +1,9 @@ +versions: + "1.8.3": + folder: "all" + "1.8.2": + folder: "all" + "1.8.0": + folder: "all" + "1.7.5": + folder: "all" diff --git a/recipes/drwav/all/CMakeLists.txt b/recipes/drwav/all/CMakeLists.txt new file mode 100644 index 0000000000000..64cb2f4533122 --- /dev/null +++ b/recipes/drwav/all/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 3.4) +project(dr_wav LANGUAGES C) + +include(GNUInstallDirs) + +option(NO_CONVERSION_API "Build with define DR_WAV_NO_CONVERSION_API" OFF) +option(NO_STDIO "Build with define DR_WAV_NO_STDIO" OFF) +option(NO_WCHAR "Build with define DR_WAV_NO_WCHAR" OFF) + +add_library(${CMAKE_PROJECT_NAME} dr_wav.c) + +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRWAV_SRC_DIR}) + +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES + PUBLIC_HEADER ${DRWAV_SRC_DIR}/dr_wav.h + C_STANDARD 99 +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDRWAV_DLL) +endif() +if(NO_CONVERSION_API) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_WAV_NO_CONVERSION_API) +endif() +if(NO_STDIO) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_WAV_NO_STDIO) +endif() +if(NO_WCHAR) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_WAV_NO_WCHAR) +endif() + +install(TARGETS ${CMAKE_PROJECT_NAME} + 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/drwav/all/conandata.yml b/recipes/drwav/all/conandata.yml new file mode 100644 index 0000000000000..449e35d180bee --- /dev/null +++ b/recipes/drwav/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + # NOTE: https://github.com/mackron/dr_libs/blob/4f6da71ed357ade92dc91f00e6be7301ec9a82a3/dr_wav.h#L3 + "0.13.7": + url: https://github.com/mackron/dr_libs/archive/4f6da71ed357ade92dc91f00e6be7301ec9a82a3.zip + sha256: "0a77850ca558633e0516a68383481fb36823064256f2c50911056714420bc5b1" + # NOTE: https://github.com/mackron/dr_libs/blob/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9/dr_wav.h#L3 + "0.13.6": + url: https://github.com/mackron/dr_libs/archive/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9.zip + sha256: "39ea8c1f9b60a945735dfe4a2e0a2a6bd3bc921619fa7d2612dbc284b68c2419" diff --git a/recipes/drwav/all/conanfile.py b/recipes/drwav/all/conanfile.py new file mode 100644 index 0000000000000..893c882ec028c --- /dev/null +++ b/recipes/drwav/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class DrwavConan(ConanFile): + name = "drwav" + description = "WAV audio loader and writer." + homepage = "https://mackron.github.io/dr_wav" + topics = ("audio", "wav", "wave", "sound") + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "no_conversion_api": [True, False], + "no_stdio": [True, False], + "no_wchar": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "no_conversion_api": False, + "no_stdio": False, + "no_wchar": False, + } + exports_sources = ["CMakeLists.txt", "dr_wav.c"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DRWAV_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["NO_CONVERSION_API"] = self.options.no_conversion_api + tc.variables["NO_STDIO"] = self.options.no_stdio + tc.variables["NO_WCHAR"] = self.options.no_wchar + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["dr_wav"] + if self.options.shared: + self.cpp_info.defines.append("DRWAV_DLL") + if self.options.no_conversion_api: + self.cpp_info.defines.append("DR_WAV_NO_CONVERSION_API") + if self.options.no_stdio: + self.cpp_info.defines.append("DR_WAV_NO_STDIO") + if self.options.no_wchar: + self.cpp_info.defines.append("DR_WAV_NO_WCHAR") diff --git a/recipes/drwav/all/dr_wav.c b/recipes/drwav/all/dr_wav.c new file mode 100644 index 0000000000000..79c6c57152b37 --- /dev/null +++ b/recipes/drwav/all/dr_wav.c @@ -0,0 +1,3 @@ +#define DRWAV_IMPLEMENTATION + +#include "dr_wav.h" diff --git a/recipes/drwav/all/test_package/CMakeLists.txt b/recipes/drwav/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e57f5fb28026 --- /dev/null +++ b/recipes/drwav/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(drwav CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE drwav::drwav) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/drwav/all/test_package/conanfile.py b/recipes/drwav/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/drwav/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/drwav/all/test_package/test_package.c b/recipes/drwav/all/test_package/test_package.c new file mode 100644 index 0000000000000..17e551d634202 --- /dev/null +++ b/recipes/drwav/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include "dr_wav.h" + +int main(void) { + const char *version = drwav_version_string(); + printf("dr_wav version: %s\n", version); + + return 0; +} diff --git a/recipes/drwav/all/test_v1_package/CMakeLists.txt b/recipes/drwav/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/drwav/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/drwav/all/test_v1_package/conanfile.py b/recipes/drwav/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/drwav/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/drwav/config.yml b/recipes/drwav/config.yml new file mode 100644 index 0000000000000..6c8f065f79d49 --- /dev/null +++ b/recipes/drwav/config.yml @@ -0,0 +1,5 @@ +versions: + "0.13.7": + folder: all + "0.13.6": + folder: all diff --git a/recipes/dtl/all/conandata.yml b/recipes/dtl/all/conandata.yml new file mode 100644 index 0000000000000..7ae1dc4743d98 --- /dev/null +++ b/recipes/dtl/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.20": + url: "https://github.com/cubicdaiya/dtl/archive/v1.20.tar.gz" + sha256: "579f81bca88f4b9760a59d99c5a95bd8dd5dc2f20f33f1f9b5f64cb08979f54d" + "1.19": + url: "https://github.com/cubicdaiya/dtl/archive/v1.19.tar.gz" + sha256: "f47b99dd11e5d771ad32a8dc960db4ab2fbe349fb0346fa0795f53c846a99c5d" + "cci.20210404": + url: "https://github.com/cubicdaiya/dtl/archive/0551c22f5ee3d30dbc4b0700bde5acdb6f1a9348.tar.gz" + sha256: "59c2e770454c935200179aa4457f72741aec2319072862950b2490d0758d4e43" diff --git a/recipes/dtl/all/conanfile.py b/recipes/dtl/all/conanfile.py new file mode 100644 index 0000000000000..6d45ac4104004 --- /dev/null +++ b/recipes/dtl/all/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + +class DtlConan(ConanFile): + name = "dtl" + description = "diff template library written by C++" + topics = ("diff", "library", "algorithm") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cubicdaiya/dtl" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(os.path.join("dtl", "*.hpp"), dst="include", src=self._source_subfolder) + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + diff --git a/recipes/dtl/all/test_package/CMakeLists.txt b/recipes/dtl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9710bb88ce36c --- /dev/null +++ b/recipes/dtl/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(dtl CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PUBLIC dtl::dtl) diff --git a/recipes/dtl/all/test_package/conanfile.py b/recipes/dtl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/dtl/all/test_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/dtl/all/test_package/test_package.cpp b/recipes/dtl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..60dc20e4edc82 --- /dev/null +++ b/recipes/dtl/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + std::string a = "abc"; + std::string b = "abd"; + dtl::Diff diff(a, b); + diff.compose(); +} diff --git a/recipes/dtl/config.yml b/recipes/dtl/config.yml new file mode 100644 index 0000000000000..66e68aaaf6fad --- /dev/null +++ b/recipes/dtl/config.yml @@ -0,0 +1,7 @@ +versions: + "1.20": + folder: "all" + "1.19": + folder: "all" + "cci.20210404": + folder: "all" diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml new file mode 100644 index 0000000000000..034e9d6c571e6 --- /dev/null +++ b/recipes/duckdb/all/conandata.yml @@ -0,0 +1,39 @@ +sources: + "0.7.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.7.1.tar.gz" + sha256: "67f840f861e5ffbe137d65a8543642d016f900b89dd035492d562ad11acf0e1e" + "0.6.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.1.tar.gz" + sha256: "ea9bba89ae3e461f3fc9f83911b2f3b6c386c23463bcf7b1ed6bb4cc13e822a4" + "0.6.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.0.tar.gz" + sha256: "700b09114f8b99892a9d19ba21ca962ae65d1ea8085622418a2fa50ff915b244" + "0.5.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz" + sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" +patches: + "0.7.1": + - patch_file: "patches/0.7.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.6.0-0002-include-stdlib.patch" + patch_description: "include stdlib for abort function" + patch_type: "portability" + "0.6.1": + - patch_file: "patches/0.6.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.6.0-0002-include-stdlib.patch" + patch_description: "include stdlib for abort function" + patch_type: "portability" + "0.6.0": + - patch_file: "patches/0.6.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.6.0-0002-include-stdlib.patch" + patch_description: "include stdlib for abort function" + patch_type: "portability" + "0.5.1": + - patch_file: "patches/0.5.1-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py new file mode 100644 index 0000000000000..34aad40c19a16 --- /dev/null +++ b/recipes/duckdb/all/conanfile.py @@ -0,0 +1,203 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + +class DuckdbConan(ConanFile): + name = "duckdb" + description = "DuckDB is an embeddable SQL OLAP Database Management System" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cwida/duckdb" + topics = ("sql", "database", "olap", "embedded-database") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_icu": [True, False], + "with_parquet": [True, False], + "with_tpch": [True, False], + "with_tpcds": [True, False], + "with_fts": [True, False], + "with_httpfs": [True, False], + "with_visualizer": [True, False], + "with_json": [True, False], + "with_excel": [True, False], + "with_sqlsmith": [True, False], + "with_odbc": [True, False], + "with_query_log": [True, False], + "with_shell": [True, False], + "with_threads": [True, False], + "with_rdtsc": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_icu": False, + "with_parquet": False, + "with_tpch": False, + "with_tpcds": False, + "with_fts": False, + "with_httpfs": False, + "with_visualizer": False, + "with_json": False, + "with_excel": False, + "with_sqlsmith": False, + "with_odbc": False, + "with_query_log": False, + "with_shell": False, + "with_threads": True, + "with_rdtsc": False, + } + short_paths = True + + @property + def _min_cppstd(self): + return 11 + + 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): + # FIXME: duckdb vendors a bunch of deps by modify the source code to have their own namespace + if self.options.with_odbc: + self.requires("odbc/2.3.11") + if self.options.with_httpfs: + self.requires("openssl/[>=1.1 <4]") + + 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], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DUCKDB_MAJOR_VERSION"] = Version(self.version).major + 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["BUILD_ICU_EXTENSION"] = self.options.with_icu + tc.variables["BUILD_PARQUET_EXTENSION"] = self.options.with_parquet + tc.variables["BUILD_TPCH_EXTENSION"] = self.options.with_tpch + tc.variables["BUILD_TPCDS_EXTENSION"] = self.options.with_tpcds + tc.variables["BUILD_FTS_EXTENSION"] = self.options.with_fts + tc.variables["BUILD_HTTPFS_EXTENSION"] = self.options.with_httpfs + tc.variables["BUILD_VISUALIZER_EXTENSION"] = self.options.with_visualizer + tc.variables["BUILD_JSON_EXTENSION"] = self.options.with_json + tc.variables["BUILD_EXCEL_EXTENSION"] = self.options.with_excel + tc.variables["BUILD_SQLSMITH_EXTENSION"] = self.options.with_sqlsmith + tc.variables["BUILD_ODBC_DRIVER"] = self.options.with_odbc + tc.variables["FORCE_QUERY_LOG"] = self.options.with_query_log + tc.variables["BUILD_SHELL"] = self.options.with_shell + tc.variables["DISABLE_THREADS"] = not self.options.with_threads + tc.variables["BUILD_UNITTESTS"] = False + tc.variables["BUILD_RDTSC"] = self.options.with_rdtsc + tc.variables["EXTENSION_STATIC_BUILD"] = not self.options.shared + tc.variables["ENABLE_SANITIZER"] = False + tc.variables["ENABLE_UBSAN"] = False + if is_msvc(self) and not self.options.shared: + tc.preprocessor_definitions["DUCKDB_API"] = "" + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self) and not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "src", "include", "duckdb.h"), + "#define DUCKDB_API __declspec(dllimport)", + "#define DUCKDB_API" + ) + replace_in_file(self, os.path.join(self.source_folder, "src", "include", "duckdb", "common", "winapi.hpp"), + "#define DUCKDB_API __declspec(dllimport)", + "#define DUCKDB_API" + ) + + 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.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rm(self, "duckdb_*.lib", os.path.join(self.package_folder, "lib")) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + if self.options.shared: + self.cpp_info.libs = ["duckdb"] + else: + self.cpp_info.libs = [ + "duckdb_static", + "duckdb_fmt", + "duckdb_pg_query", + "duckdb_re2", + "duckdb_miniz", + "duckdb_utf8proc", + "duckdb_hyperloglog", + "duckdb_fastpforlib", + "duckdb_mbedtls", + ] + if Version(self.version) >= "0.6.0": + self.cpp_info.libs.append("duckdb_fsst") + + if self.options.with_icu: + self.cpp_info.libs.append("icu_extension") + if self.options.with_parquet: + self.cpp_info.libs.append("parquet_extension") + if self.options.with_tpch: + self.cpp_info.libs.append("tpch_extension") + if self.options.with_tpcds: + self.cpp_info.libs.append("tpcds_extension") + if self.options.with_fts: + self.cpp_info.libs.append("fts_extension") + if self.options.with_httpfs: + self.cpp_info.libs.append("httpfs_extension") + if self.options.with_visualizer: + self.cpp_info.libs.append("visualizer_extension") + if Version(self.version) >= "0.6.0" and self.settings.os == "Linux": + self.cpp_info.libs.append("jemalloc_extension") + if self.options.with_json: + self.cpp_info.libs.append("json_extension") + if self.options.with_excel: + self.cpp_info.libs.append("excel_extension") + if self.options.with_sqlsmith: + self.cpp_info.libs.append("sqlsmith_extension") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + + if self.options.with_shell: + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var: {binpath}") + self.env_info.PATH.append(binpath) diff --git a/recipes/duckdb/all/patches/0.5.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.5.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..4c586f0038760 --- /dev/null +++ b/recipes/duckdb/all/patches/0.5.1-0001-fix-cmake.patch @@ -0,0 +1,82 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cc43104..5b034d2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -196,6 +196,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + set(SUN TRUE) + endif() + ++if(0) # conan patch ++ + execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +@@ -236,6 +238,10 @@ else() + set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}") + endif() + ++else() # conan patch ++set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}") ++endif() # conan patch ++ + option(AMALGAMATION_BUILD + "Build from the amalgamation files, rather than from the normal sources." + FALSE) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7e07a47..8027d90 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -166,9 +166,18 @@ if(BUILD_PYTHON + endif() + endif() + +-install( +- TARGETS duckdb duckdb_static +- EXPORT "${DUCKDB_EXPORT_SET}" +- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" +- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++if(BUILD_SHARED_LIBS) ++ install( ++ TARGETS duckdb ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++ install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index 9d116b9..b46e5bd 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,3 +53,11 @@ add_library( + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) ++ ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index cef9622..ca7e1f1 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -14,7 +14,7 @@ add_library(sqlite3_api_wrapper_static STATIC sqlite3_api_wrapper.cpp + target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32) ++if(BUILD_SHARED_LIBS AND NOT WIN32) + add_library(sqlite3_api_wrapper SHARED sqlite3_api_wrapper.cpp + ${ALL_OBJECT_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) diff --git a/recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..d43649a21a753 --- /dev/null +++ b/recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch @@ -0,0 +1,58 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b1bb843..4a4949c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -167,9 +167,18 @@ if(BUILD_PYTHON + endif() + endif() + +-install( +- TARGETS duckdb duckdb_static +- EXPORT "${DUCKDB_EXPORT_SET}" +- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" +- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++if(BUILD_SHARED_LIBS) ++ install( ++ TARGETS duckdb ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++ install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index 9d116b9..b46e5bd 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,3 +53,11 @@ add_library( + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) ++ ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e785d4f..922746f 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -17,7 +17,7 @@ add_library(sqlite3_api_wrapper_static STATIC ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32) ++if(BUILD_SHARED_LIBS AND NOT WIN32) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) diff --git a/recipes/duckdb/all/patches/0.6.0-0002-include-stdlib.patch b/recipes/duckdb/all/patches/0.6.0-0002-include-stdlib.patch new file mode 100644 index 0000000000000..e9e04e59a49cc --- /dev/null +++ b/recipes/duckdb/all/patches/0.6.0-0002-include-stdlib.patch @@ -0,0 +1,12 @@ +diff --git a/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h b/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h +index 47455cb..cfd73bc 100644 +--- a/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h ++++ b/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #include "jemalloc/internal/jemalloc_internal_defs.h" + #include "jemalloc/internal/jemalloc_internal_decls.h" diff --git a/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..0ba6b7e472f9a --- /dev/null +++ b/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch @@ -0,0 +1,61 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 99cd46c..3f3d039 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -182,9 +182,18 @@ if(BUILD_PYTHON + endif() + endif() + +-install( +- TARGETS duckdb duckdb_static +- EXPORT "${DUCKDB_EXPORT_SET}" +- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" +- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++if(BUILD_SHARED_LIBS) ++ install( ++ TARGETS duckdb ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++ install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index 8f13cfe..6755894 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,6 +53,14 @@ add_library( + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) + ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ + if(NOT WIN32 AND NOT CLANG_TIDY) + add_subdirectory(test) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e785d4f..922746f 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -17,7 +17,7 @@ add_library(sqlite3_api_wrapper_static STATIC ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32) ++if(BUILD_SHARED_LIBS AND NOT WIN32) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) diff --git a/recipes/duckdb/all/test_package/CMakeLists.txt b/recipes/duckdb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..139856fb65898 --- /dev/null +++ b/recipes/duckdb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(duckdb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE duckdb::duckdb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/duckdb/all/test_package/conanfile.py b/recipes/duckdb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/duckdb/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/duckdb/all/test_package/test_package.cpp b/recipes/duckdb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..66bd4253c138b --- /dev/null +++ b/recipes/duckdb/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include "duckdb.hpp" + +int main() { + duckdb::DuckDB db(nullptr); + duckdb::Connection con(db); +} diff --git a/recipes/duckdb/all/test_v1_package/CMakeLists.txt b/recipes/duckdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/duckdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/duckdb/all/test_v1_package/conanfile.py b/recipes/duckdb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/duckdb/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml new file mode 100644 index 0000000000000..c1b25ce335aee --- /dev/null +++ b/recipes/duckdb/config.yml @@ -0,0 +1,9 @@ +versions: + "0.7.1": + folder: "all" + "0.6.1": + folder: "all" + "0.6.0": + folder: "all" + "0.5.1": + folder: "all" diff --git a/recipes/duktape/all/CMakeLists.txt b/recipes/duktape/all/CMakeLists.txt new file mode 100644 index 0000000000000..76bab4dba57c0 --- /dev/null +++ b/recipes/duktape/all/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 2.8.12) + +project(duktape C) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src/*.c) +file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src/*.h) +add_library(duktape ${SOURCES} ${HEADERS}) +set_target_properties(duktape PROPERTIES PUBLIC_HEADER "${HEADERS}") + +if (UNIX AND NOT APPLE AND NOT ANDROID) + target_link_libraries(duktape m) +endif() + +install( + TARGETS duktape + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + PUBLIC_HEADER DESTINATION include +) diff --git a/recipes/duktape/all/conandata.yml b/recipes/duktape/all/conandata.yml new file mode 100644 index 0000000000000..c2be9628e480b --- /dev/null +++ b/recipes/duktape/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.7.0": + url: "https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz" + sha256: "90f8d2fa8b5567c6899830ddef2c03f3c27960b11aca222fa17aa7ac613c2890" + "2.6.0": + url: "https://github.com/svaarala/duktape/releases/download/v2.6.0/duktape-2.6.0.tar.xz" + sha256: "96f4a05a6c84590e53b18c59bb776aaba80a205afbbd92b82be609ba7fe75fa7" + "2.5.0": + url: "https://github.com/svaarala/duktape/releases/download/v2.5.0/duktape-2.5.0.tar.xz" + sha256: "83d411560a1cd36ea132bd81d8d9885efe9285c6bc6685c4b71e69a0c4329616" diff --git a/recipes/duktape/all/conanfile.py b/recipes/duktape/all/conanfile.py new file mode 100644 index 0000000000000..3e582932bd595 --- /dev/null +++ b/recipes/duktape/all/conanfile.py @@ -0,0 +1,74 @@ +import os +from conans import CMake, ConanFile, tools + +required_conan_version = ">=1.33.0" + +class DuktapeConan(ConanFile): + name = "duktape" + license = "MIT" + description = "Duktape is an embeddable Javascript engine, with a focus on portability and compact footprint." + topics = ("javascript", "engine", "embeddable", "compact") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://duktape.org" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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.configure() + return self._cmake + + def build(self): + # Duktape has configure script with a number of options. + # However it requires python 2 and PyYAML package + # which is quite an unusual combination to have. + # The most crucial option is --dll which just flips this define. + if self.settings.os == "Windows" and self.options.shared: + tools.replace_in_file( + os.path.join(self._source_subfolder, "src", "duk_config.h"), + "#undef DUK_F_DLL_BUILD", + "#define DUK_F_DLL_BUILD", + ) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["duktape"] + if not self.options.shared and str(self.settings.os) in ( + "Linux", + "FreeBSD", + "SunOS", + ): + self.cpp_info.system_libs = ["m"] diff --git a/recipes/duktape/all/test_package/CMakeLists.txt b/recipes/duktape/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..526e8d40c66a2 --- /dev/null +++ b/recipes/duktape/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${CMAKE_PROJECT_NAME} test_package.c) +target_link_libraries(${CMAKE_PROJECT_NAME} CONAN_PKG::duktape) diff --git a/recipes/duktape/all/test_package/conanfile.py b/recipes/duktape/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ca9da95670911 --- /dev/null +++ b/recipes/duktape/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/duktape/all/test_package/test_package.c b/recipes/duktape/all/test_package/test_package.c new file mode 100644 index 0000000000000..a2ffa51e7e232 --- /dev/null +++ b/recipes/duktape/all/test_package/test_package.c @@ -0,0 +1,42 @@ +#include "duktape.h" + +static duk_ret_t native_print(duk_context *ctx) { + duk_push_string(ctx, " "); + duk_insert(ctx, 0); + duk_join(ctx, duk_get_top(ctx) - 1); + printf("%s\n", duk_safe_to_string(ctx, -1)); + return 0; +} + +static duk_ret_t native_adder(duk_context *ctx) { + int i; + int n = duk_get_top(ctx); /* #args */ + double res = 0.0; + + for (i = 0; i < n; i++) { + res += duk_to_number(ctx, i); + } + + duk_push_number(ctx, res); + return 1; /* one return value */ +} + +int main(int argc, char *argv[]) { + duk_context *ctx = duk_create_heap_default(); + + (void) argc; (void) argv; /* suppress warning */ + + duk_push_c_function(ctx, native_print, DUK_VARARGS); + duk_put_global_string(ctx, "print"); + duk_push_c_function(ctx, native_adder, DUK_VARARGS); + duk_put_global_string(ctx, "adder"); + + duk_eval_string(ctx, "print('Hello world!');"); + + duk_eval_string(ctx, "print('2+3=' + adder(2, 3));"); + duk_pop(ctx); /* pop eval result */ + + duk_destroy_heap(ctx); + + return 0; +} diff --git a/recipes/duktape/config.yml b/recipes/duktape/config.yml new file mode 100644 index 0000000000000..feada510c6875 --- /dev/null +++ b/recipes/duktape/config.yml @@ -0,0 +1,7 @@ +versions: + "2.7.0": + folder: "all" + "2.6.0": + folder: "all" + "2.5.0": + folder: "all" diff --git a/recipes/eabase/all/conandata.yml b/recipes/eabase/all/conandata.yml new file mode 100644 index 0000000000000..2c833d6c97845 --- /dev/null +++ b/recipes/eabase/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.09.12": + url: "https://github.com/electronicarts/EABase/archive/d1be0a1d0fc01a9bf8f3f2cea75018df0d2410ee.zip" + sha256: "53b72d188aa17c7b23aa6bef9a4767854e82eac46a027dec233d12fd3dfbc677" + "2.09.06": + url: "https://github.com/electronicarts/EABase/archive/refs/heads/2.09.06.zip" + sha256: "3223c2b81dcdccaeb9fca7a83695f9edb402b817c89c073c0eb3ee64646699ea" + "2.09.05": + url: "https://github.com/electronicarts/EABase/archive/2.09.05.tar.gz" + sha256: "f85b98c96f1976aa013c8d6016c5e37a409633ac3fce843cd4ec0b89c67e6b7a" diff --git a/recipes/eabase/all/conanfile.py b/recipes/eabase/all/conanfile.py new file mode 100644 index 0000000000000..e1ead0a93a9bc --- /dev/null +++ b/recipes/eabase/all/conanfile.py @@ -0,0 +1,59 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class EABaseConan(ConanFile): + name = "eabase" + description = "EABase is a small set of header files that define platform-independent data types and platform feature macros. " + topics = ("eastl", "config") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/electronicarts/EABase" + 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, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs += [ + os.path.join("include", "Common"), + os.path.join("include", "Common", "EABase"), + ] + + self.cpp_info.set_property("cmake_file_name", "EABase") + self.cpp_info.set_property("cmake_target_name", "EABase::EABase") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "EABase" + self.cpp_info.filenames["cmake_find_package_multi"] = "EABase" + self.cpp_info.names["cmake_find_package"] = "EABase" + self.cpp_info.names["cmake_find_package_multi"] = "EABase" diff --git a/recipes/eabase/all/test_package/CMakeLists.txt b/recipes/eabase/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d2f6d0c57dfc9 --- /dev/null +++ b/recipes/eabase/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(EABase REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE EABase::EABase) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eabase/all/test_package/conanfile.py b/recipes/eabase/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/eabase/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/eabase/all/test_package/test_package.cpp b/recipes/eabase/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c57fbc1c03fe --- /dev/null +++ b/recipes/eabase/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#include + +#include +#include + +#ifndef EA_COMPILER_IS_ANSIC +#define EA_COMPILER_IS_ANSIC 0 +#endif +#ifndef EA_COMPILER_IS_C99 +#define EA_COMPILER_IS_C99 0 +#endif +#ifndef EA_COMPILER_IS_C99 +#define EA_COMPILER_IS_C99 0 +#endif +#ifndef EA_COMPILER_HAS_C99_TYPES +#define EA_COMPILER_HAS_C99_TYPES 0 +#endif +#ifndef EA_COMPILER_IS_CPLUSPLUS +#define EA_COMPILER_IS_CPLUSPLUS 0 +#endif + +int main() { +#define PRINT_COMPILER_INFO(VAR) std::cout << #VAR << ": " << (VAR) << '\n' + + PRINT_COMPILER_INFO(EA_COMPILER_VERSION); + PRINT_COMPILER_INFO(EA_COMPILER_NAME); + PRINT_COMPILER_INFO(EA_COMPILER_STRING); + + std::cout << '\n'; + + PRINT_COMPILER_INFO(EA_PLATFORM_NAME); + PRINT_COMPILER_INFO(EA_PLATFORM_DESCRIPTION); + + std::cout << '\n'; + + PRINT_COMPILER_INFO(EA_COMPILER_IS_ANSIC); + PRINT_COMPILER_INFO(EA_COMPILER_IS_C99); + PRINT_COMPILER_INFO(EA_COMPILER_HAS_C99_TYPES); + PRINT_COMPILER_INFO(EA_COMPILER_IS_CPLUSPLUS); + + std::cout << '\n'; + + PRINT_COMPILER_INFO(EA_PLATFORM_PTR_SIZE); + PRINT_COMPILER_INFO(EA_PLATFORM_WORD_SIZE); + + return EXIT_SUCCESS; +} diff --git a/recipes/eabase/all/test_v1_package/CMakeLists.txt b/recipes/eabase/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f6d6c9603dafa --- /dev/null +++ b/recipes/eabase/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +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/eabase/all/test_v1_package/conanfile.py b/recipes/eabase/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/eabase/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/eabase/config.yml b/recipes/eabase/config.yml new file mode 100644 index 0000000000000..7c5c5f65bfc3e --- /dev/null +++ b/recipes/eabase/config.yml @@ -0,0 +1,7 @@ +versions: + "2.09.12": + folder: "all" + "2.09.06": + folder: "all" + "2.09.05": + folder: "all" diff --git a/recipes/earcut/all/conandata.yml b/recipes/earcut/all/conandata.yml new file mode 100644 index 0000000000000..e7672ce5fb5f3 --- /dev/null +++ b/recipes/earcut/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.2.4": + url: "https://github.com/mapbox/earcut.hpp/archive/v2.2.4.tar.gz" + sha256: "fcfa6a47a52d4c94dc960bdb747f17e077609235517b0bb5ce8097d6b747695a" + "2.2.3": + url: "https://github.com/mapbox/earcut.hpp/archive/v2.2.3.tar.gz" + sha256: "f382616de763289c698f37ec3a5b9fcd3d6d821cbef0b3c72e43bdd909c81b5a" + "0.12.4": + sha256: "d935feac891fd39b4872074d968b1ddfe4b9128c5db1604e15447b87f7c70970" + url: "https://github.com/mapbox/earcut.hpp/archive/refs/tags/v0.12.4.zip" diff --git a/recipes/earcut/all/conanfile.py b/recipes/earcut/all/conanfile.py new file mode 100644 index 0000000000000..23791142acadb --- /dev/null +++ b/recipes/earcut/all/conanfile.py @@ -0,0 +1,72 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration + + +class EarcutPackage(ConanFile): + name = "earcut" + description = "A C++ port of earcut.js, a fast, header-only polygon triangulation library." + homepage = "https://github.com/mapbox/earcut.hpp" + url = "https://github.com/conan-io/conan-center-index" + license = "ISC" + topics = ("algorithm", "cpp", "geometry", "rendering", "triangulation", + "polygon", "header-only", "tessellation", "earcut") + settings = "compiler" + no_copy_source = True + + @property + def _minimum_compilers_version(self): + # References: + # * https://github.com/mapbox/earcut.hpp#dependencies + # * https://en.cppreference.com/w/cpp/compiler_support/11 + # * https://en.wikipedia.org/wiki/Xcode#Toolchain_versions + return { + "apple-clang": "5.1", + "clang": "3.4", + "gcc": "4.9", + "intel": "15", + "sun-cc": "5.14", + "Visual Studio": "12" + } + + @property + def _minimum_cpp_standard(self): + return 11 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + 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] + + min_version = self._minimum_compilers_version.get( + str(self.settings.compiler)) + if not min_version: + self.output.warning( + f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") + else: + if lazy_lt_semver(str(self.settings.compiler.version), min_version): + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "*", os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", self.source_folder, + os.path.join(self.package_folder, "licenses")) + + def package_id(self): + self.info.clear() diff --git a/recipes/earcut/all/test_package/CMakeLists.txt b/recipes/earcut/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4a460cc9a3c99 --- /dev/null +++ b/recipes/earcut/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(earcut REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE earcut::earcut) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/earcut/all/test_package/conanfile.py b/recipes/earcut/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0246d899d7bc9 --- /dev/null +++ b/recipes/earcut/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class EarcutTestPackage(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if 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/earcut/all/test_package/example.cpp b/recipes/earcut/all/test_package/example.cpp new file mode 100644 index 0000000000000..9613efc7a09dc --- /dev/null +++ b/recipes/earcut/all/test_package/example.cpp @@ -0,0 +1,33 @@ +#include + +#include +#include + +/// The example below is taken directly from https://github.com/mapbox/earcut.hpp#usage. +int main(int, char **) +{ + // The number type to use for tessellation + using Coord = double; + + // The index type. Defaults to uint32_t, but you can also pass uint16_t if you know that your + // data won't have more than 65536 vertices. + using N = uint32_t; + + // Create array + using Point = std::array; + std::vector> polygon; + + // Fill polygon structure with actual data. Any winding order works. + // The first polyline defines the main polygon. + polygon.push_back({{100, 0}, {100, 100}, {0, 100}, {0, 0}}); + // Following polylines define holes. + polygon.push_back({{75, 25}, {75, 75}, {25, 75}, {25, 25}}); + + // Run tessellation + // Returns array of indices that refer to the vertices of the input polygon. + // e.g: the index 6 would refer to {25, 75} in this example. + // Three subsequent indices form a triangle. Output triangles are clockwise. + std::vector indices = mapbox::earcut(polygon); + + return indices.empty(); +} diff --git a/recipes/earcut/all/test_v1_package/CMakeLists.txt b/recipes/earcut/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf60ef4f067f3 --- /dev/null +++ b/recipes/earcut/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/earcut/all/test_v1_package/conanfile.py b/recipes/earcut/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0357a45cbaadf --- /dev/null +++ b/recipes/earcut/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class EarcutTestConan(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/earcut/config.yml b/recipes/earcut/config.yml new file mode 100644 index 0000000000000..dc295dd4a8376 --- /dev/null +++ b/recipes/earcut/config.yml @@ -0,0 +1,7 @@ +versions: + "2.2.4": + folder: "all" + "2.2.3": + folder: "all" + "0.12.4": + folder: "all" diff --git a/recipes/eastl/all/CMakeLists.txt b/recipes/eastl/all/CMakeLists.txt new file mode 100644 index 0000000000000..9533e6887cb91 --- /dev/null +++ b/recipes/eastl/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(CMAKE_CXX_STANDARD 14) + +add_subdirectory(source_subfolder) diff --git a/recipes/eastl/all/conandata.yml b/recipes/eastl/all/conandata.yml new file mode 100644 index 0000000000000..f1c15b1dc7308 --- /dev/null +++ b/recipes/eastl/all/conandata.yml @@ -0,0 +1,50 @@ +sources: + "3.18.00": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.18.00.tar.gz" + sha256: "a3c5b970684be02e81fb16fbf92ed2584e055898704fde87c72d0331afdea12b" + "3.17.06": + url: "https://github.com/electronicarts/EASTL/archive/3.17.06.tar.gz" + sha256: "9ebeef26cdf091877ee348450d2711cd0bb60ae435309126c0adf8fec9a01ea5" + "3.17.03": + url: "https://github.com/electronicarts/EASTL/archive/3.17.03.tar.gz" + sha256: "50a072066e30fda364d482df6733572d8ca440a33825d81254b59a6ca9f4375a" + "3.16.07": + url: "https://github.com/electronicarts/EASTL/archive/3.16.07.tar.gz" + sha256: "f997a81c8cb36618bd4526ea7a02d026c8111d15fbc138c67ba8f4606680d551" + "3.16.05": + url: "https://github.com/electronicarts/EASTL/archive/3.16.05.tar.gz" + sha256: "deebff248ec0d4da35ca006cec39abdcfe65ccbd7294f6fbdb42fc92232368b6" + "3.16.01": + url: "https://github.com/electronicarts/EASTL/archive/3.16.01.tar.gz" + sha256: "80b0754ea02364dfd3f94e3b65c93087849a8d407196702c0cae59097fbe8d21" + "3.15.00": + url: "https://github.com/electronicarts/EASTL/archive/3.15.00.tar.gz" + sha256: "1578a2935ca490920b96c960fb570dab025280bb978fba40c88eb9ac74760c14" +patches: + "3.18.00": + - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + base_path: "source_subfolder" + "3.17.06": + - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + base_path: "source_subfolder" + "3.17.03": + - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + base_path: "source_subfolder" + "3.16.07": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" + "3.16.05": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" + "3.16.01": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" + "3.15.00": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + base_path: "source_subfolder" diff --git a/recipes/eastl/all/conanfile.py b/recipes/eastl/all/conanfile.py new file mode 100644 index 0000000000000..faccbd629bec0 --- /dev/null +++ b/recipes/eastl/all/conanfile.py @@ -0,0 +1,116 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class EastlConan(ConanFile): + name = "eastl" + description = "EASTL stands for Electronic Arts Standard Template Library. " \ + "It is an extensive and robust implementation that has an " \ + "emphasis on high performance." + topics = ("eastl", "stl", "high-performance") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/electronicarts/EASTL" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "14", + "gcc": "5", + "clang": "3.2", + "apple-clang": "4.3", + } + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("eabase/2.09.06") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + + mininum_compiler_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if mininum_compiler_version and tools.Version(self.settings.compiler.version) < mininum_compiler_version: + raise ConanInvalidConfiguration("Compiler is too old for c++ {}".format(self._minimum_cpp_standard)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["EASTL_BUILD_BENCHMARK"] = False + self._cmake.definitions["EASTL_BUILD_TESTS"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + tools.replace_path_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "include(CommonCppFlags)", + "") + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("3RDPARTYLICENSES.TXT", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["EASTL"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.options.shared: + self.cpp_info.defines.append("EA_DLL") + + # Do not use these names in set_property, it was a mistake, eastl doesn't export its target + self.cpp_info.names["cmake_find_package"] = "EASTL" + self.cpp_info.names["cmake_find_package_multi"] = "EASTL" diff --git a/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000000000..8b004f0ee5054 --- /dev/null +++ b/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,5 +46,18 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-target_link_libraries(EASTL EABase) ++target_link_libraries(EASTL CONAN_PKG::eabase) + ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() ++ ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) diff --git a/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000000000..05c5b0bd39e41 --- /dev/null +++ b/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,26 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -47,8 +47,21 @@ + # Dependencies + #------------------------------------------------------------------------------------------- + if (NOT TARGET EABase) +- add_subdirectory(test/packages/EABase) ++ #add_subdirectory(test/packages/EABase) + endif() + +-target_link_libraries(EASTL EABase) ++target_link_libraries(EASTL CONAN_PKG::eabase) + ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() ++ ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) diff --git a/recipes/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch b/recipes/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch new file mode 100644 index 0000000000000..9167720f0d1ed --- /dev/null +++ b/recipes/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch @@ -0,0 +1,18 @@ +--- include/EASTL/internal/config.h ++++ include/EASTL/internal/config.h +@@ -143,7 +143,14 @@ + // http://en.wikipedia.org/wiki/C%2B%2B14#Relaxed_constexpr_restrictions + // + #if !defined(EA_CPP14_CONSTEXPR) +- #if defined(EA_COMPILER_CPP14_ENABLED) ++ ++ #if defined(EA_COMPILER_MSVC_2015) ++ #define EA_CPP14_CONSTEXPR // not supported ++ #define EA_NO_CPP14_CONSTEXPR ++ #elif defined(__GNUC__) && (EA_COMPILER_VERSION < 9000) // Before GCC 9.0 ++ #define EA_CPP14_CONSTEXPR // not supported ++ #define EA_NO_CPP14_CONSTEXPR ++ #elif defined(EA_COMPILER_CPP14_ENABLED) + #define EA_CPP14_CONSTEXPR constexpr + #else + #define EA_CPP14_CONSTEXPR // not supported diff --git a/recipes/eastl/all/test_package/CMakeLists.txt b/recipes/eastl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3300ff7750277 --- /dev/null +++ b/recipes/eastl/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/eastl/all/test_package/conanfile.py b/recipes/eastl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5c09494bc67c0 --- /dev/null +++ b/recipes/eastl/all/test_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" + + 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/eastl/all/test_package/test_package.cpp b/recipes/eastl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3f5332883d4d5 --- /dev/null +++ b/recipes/eastl/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() +{ + std::vector vec; + eastl::max_element(vec.begin(), vec.end()); + return 0; +} diff --git a/recipes/eastl/config.yml b/recipes/eastl/config.yml new file mode 100644 index 0000000000000..bfb95b02f09c0 --- /dev/null +++ b/recipes/eastl/config.yml @@ -0,0 +1,15 @@ +versions: + "3.18.00": + folder: "all" + "3.17.06": + folder: "all" + "3.17.03": + folder: "all" + "3.16.07": + folder: "all" + "3.16.05": + folder: "all" + "3.16.01": + folder: "all" + "3.15.00": + folder: "all" diff --git a/recipes/easy_profiler/all/conandata.yml b/recipes/easy_profiler/all/conandata.yml new file mode 100644 index 0000000000000..a8ed1296ca75d --- /dev/null +++ b/recipes/easy_profiler/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.1.0": + url: "https://github.com/yse/easy_profiler/archive/v2.1.0.tar.gz" + sha256: "fabf95d59ede9da4873aebd52ef8a762fa8578dcdbcc6d7cdd811b5a7c3367ad" +patches: + "2.1.0": + - patch_file: "patches/0001-fix-cmake-bundle-install.patch" + patch_description: "fix-cmake-bundle-install" + patch_type: "conan" diff --git a/recipes/easy_profiler/all/conanfile.py b/recipes/easy_profiler/all/conanfile.py new file mode 100644 index 0000000000000..3365c9592b68d --- /dev/null +++ b/recipes/easy_profiler/all/conanfile.py @@ -0,0 +1,149 @@ +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, get, copy, rm, rmdir, save +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class EasyProfilerConan(ConanFile): + name = "easy_profiler" + description = "Lightweight profiler library for c++" + license = "MIT" + topics = ("profiler") + homepage = "https://github.com/yse/easy_profiler/" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.8", + "clang": "3.3", + "apple-clang": "8.0", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def export_sources(self): + export_conandata_patches(self) + + 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.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc_static_runtime(self) and self.options.shared: + raise ConanInvalidConfiguration( + "{} {} with static runtime not supported".format(self.settings.compiler, + self.settings.compiler.version) + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EASY_PROFILER_NO_GUI"] = True + tc.variables["EASY_PROFILER_NO_SAMPLES"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) + copy(self, pattern="LICENSE.MIT", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) + copy(self, pattern="LICENSE.APACHE", 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")) + rm(self, "LICENSE.MIT", self.package_folder) + rm(self, "LICENSE.APACHE", self.package_folder) + if self.settings.os == "Windows": + for dll_prefix in ["concrt", "msvcp", "vcruntime"]: + rm(self, "{}*.dll".format(dll_prefix), os.path.join(self.package_folder, "bin")) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"easy_profiler": "easy_profiler::easy_profiler"} + ) + + 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, + "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "easy_profiler") + self.cpp_info.set_property("cmake_target_name", "easy_profiler") + + self.cpp_info.libs = ["easy_profiler"] + self.cpp_info.builddirs.append(self._module_subfolder) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["psapi", "ws2_32"] + if not self.options.shared: + self.cpp_info.defines.append("EASY_PROFILER_STATIC") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "easy_profiler" + self.cpp_info.names["cmake_find_package_multi"] = "easy_profiler" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/easy_profiler/all/patches/0001-fix-cmake-bundle-install.patch b/recipes/easy_profiler/all/patches/0001-fix-cmake-bundle-install.patch new file mode 100644 index 0000000000000..8d955636585ac --- /dev/null +++ b/recipes/easy_profiler/all/patches/0001-fix-cmake-bundle-install.patch @@ -0,0 +1,10 @@ +--- a/easy_profiler_converter/CMakeLists.txt ++++ b/easy_profiler_converter/CMakeLists.txt +@@ -15,7 +15,6 @@ target_link_libraries(profiler_converter easy_profiler) + install( + TARGETS + profiler_converter +- RUNTIME + DESTINATION + bin + ) diff --git a/recipes/easy_profiler/all/test_package/CMakeLists.txt b/recipes/easy_profiler/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..da87b85f5894a --- /dev/null +++ b/recipes/easy_profiler/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(easy_profiler REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE easy_profiler) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/easy_profiler/all/test_package/conanfile.py b/recipes/easy_profiler/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/easy_profiler/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/easy_profiler/all/test_package/example.cpp b/recipes/easy_profiler/all/test_package/example.cpp new file mode 100644 index 0000000000000..f775269ec8586 --- /dev/null +++ b/recipes/easy_profiler/all/test_package/example.cpp @@ -0,0 +1,55 @@ +//#define FULL_DISABLE_PROFILER +#include +#include +#include +#include +#include +#include +#include + +#define BUILD_WITH_EASY_PROFILER +#include +#include +#include + +int RENDER_STEPS = 300; + +//#define SAMPLE_NETWORK_TEST + +void localSleep(uint64_t magic=200000) +{ + //PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Blue); + volatile int i = 0; + for (; i < magic; ++i); +} + +void renderThread(){ + EASY_THREAD("Render"); + uint64_t n = 20; + + for (int i = 0; i < RENDER_STEPS; i++) + { + localSleep(1200000); + n += 20; + if (n >= 700) + n = 20; + //std::this_thread::sleep_for(std::chrono::milliseconds(20)); + } +} + +////////////////////////////////////////////////////////////////////////// + +int main(int argc, char* argv[]) +{ + #ifndef SAMPLE_NETWORK_TEST + EASY_PROFILER_ENABLE; + #endif + EASY_MAIN_THREAD; + profiler::startListen(); + + renderThread(); + + std::cout << "SUCCESS" << std::endl; + + return 0; +} diff --git a/recipes/easy_profiler/all/test_v1_package/CMakeLists.txt b/recipes/easy_profiler/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/easy_profiler/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/easy_profiler/all/test_v1_package/conanfile.py b/recipes/easy_profiler/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8037a9296cc42 --- /dev/null +++ b/recipes/easy_profiler/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/easy_profiler/config.yml b/recipes/easy_profiler/config.yml new file mode 100644 index 0000000000000..dfff490f9a9b6 --- /dev/null +++ b/recipes/easy_profiler/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.0": + folder: all diff --git a/recipes/easyexif/all/CMakeLists.txt b/recipes/easyexif/all/CMakeLists.txt new file mode 100644 index 0000000000000..de50a2ead5152 --- /dev/null +++ b/recipes/easyexif/all/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.4) +project(easyexif) + +set(CMAKE_CXX_STANDARD_REQUIRED True) +set(CMAKE_CXX_STANDARD 11) + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_library(easyexif exif.cpp) +target_include_directories(easyexif PUBLIC exif.h) + +install(TARGETS easyexif + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +install(FILES exif.h DESTINATION include/easyexif) + diff --git a/recipes/easyexif/all/conandata.yml b/recipes/easyexif/all/conandata.yml new file mode 100644 index 0000000000000..c82e62e1abb86 --- /dev/null +++ b/recipes/easyexif/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + sha256: e4251ae76a172bfd676e9e24a5a27b970a81d1731296822ef1afaeb4857f045a + url: https://github.com/mayanklahiri/easyexif/archive/v1.0.tar.gz diff --git a/recipes/easyexif/all/conanfile.py b/recipes/easyexif/all/conanfile.py new file mode 100644 index 0000000000000..c2f91926a073b --- /dev/null +++ b/recipes/easyexif/all/conanfile.py @@ -0,0 +1,58 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" + + +class EasyExifConan(ConanFile): + name = "easyexif" + description = "Tiny ISO-compliant C++ EXIF parsing library, third-party dependency free." + topics = ("conan", "exif", "image", "multimedia", "format", "graphics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mayanklahiri/easyexif" + license = "BSD-2-Clause" + exports_sources = "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = {"shared": False, "fPIC": 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 validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + cmake_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + 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() + + def package_info(self): + self.cpp_info.libs = ["easyexif"] diff --git a/recipes/easyexif/all/test_package/CMakeLists.txt b/recipes/easyexif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2cf2b33919697 --- /dev/null +++ b/recipes/easyexif/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) + +set_target_properties(example PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/easyexif/all/test_package/conanfile.py b/recipes/easyexif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f0acb990f0375 --- /dev/null +++ b/recipes/easyexif/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class SolaceTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/easyexif/all/test_package/example.cpp b/recipes/easyexif/all/test_package/example.cpp new file mode 100644 index 0000000000000..7659ae7321d51 --- /dev/null +++ b/recipes/easyexif/all/test_package/example.cpp @@ -0,0 +1,7 @@ +#include "easyexif/exif.h" + +int main() { + easyexif::EXIFInfo exif_info; + exif_info.clear(); + return 0; +} diff --git a/recipes/easyexif/all/test_v1_package/CMakeLists.txt b/recipes/easyexif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a84ec58a29d01 --- /dev/null +++ b/recipes/easyexif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(easyexif REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE easyexif::easyexif) diff --git a/recipes/easyexif/all/test_v1_package/conanfile.py b/recipes/easyexif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a691174f8ed16 --- /dev/null +++ b/recipes/easyexif/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/easyexif/config.yml b/recipes/easyexif/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/easyexif/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/easyhttpcpp/all/conandata.yml b/recipes/easyhttpcpp/all/conandata.yml new file mode 100644 index 0000000000000..cf0e07a0bd9a5 --- /dev/null +++ b/recipes/easyhttpcpp/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.1.0": + url: "https://github.com/sony/easyhttpcpp/archive/refs/tags/2.1.0.tar.gz" + sha256: "a20216039af129900a270e020917c3e7e7b9eb45d73ff09b1c5d9b44777a6b75" +patches: + "2.1.0": + - patch_file: "patches/0001-fix-cmake-config-in-path.patch" + patch_description: "Fix path to easyhttpcppeasyhttpConfig.cmake.in" + patch_type: "conan" + - patch_file: "patches/0002-use-poco-targets.patch" + patch_description: "Use Poco targets, remove OpenSSL from direct dependencies" + patch_type: "conan" diff --git a/recipes/easyhttpcpp/all/conanfile.py b/recipes/easyhttpcpp/all/conanfile.py new file mode 100644 index 0000000000000..519369a7d9e1a --- /dev/null +++ b/recipes/easyhttpcpp/all/conanfile.py @@ -0,0 +1,125 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class EasyhttpcppConan(ConanFile): + name = "easyhttpcpp" + description = "A cross-platform HTTP client library with a focus on usability and speed" + license = "MIT" + topics = ("http", "client", "protocol") + homepage = "https://github.com/sony/easyhttpcpp" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + short_paths = True + + @property + def _min_cppstd(self): + return "11" + + 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("poco/1.12.4", transitive_headers=True, transitive_libs=True) + + @property + def _required_poco_components(self): + comps = ["enable_data", "enable_data_sqlite", "enable_net"] + if self.settings.os == "Windows": + comps.append("enable_netssl_win") + else: + comps.append("enable_netssl") + return comps + + def validate(self): + if any([not self.dependencies["poco"].options.get_safe(comp, False) for comp in self._required_poco_components]): + raise ConanInvalidConfiguration( + f"{self.ref} requires the following poco options enabled: {', '.join(self._required_poco_components)}" + ) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FORCE_SHAREDLIB"] = self.options.shared + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + if self.settings.os == "Windows" and self.options.shared: + tc.preprocessor_definitions["EASYHTTPCPP_DLL"] = "1" + tc.preprocessor_definitions["EASYHTTPCPP_API_EXPORTS"] = "1" + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "easyhttpcppeasyhttp") + self.cpp_info.set_property("cmake_target_name", "easyhttpcpp::easyhttp") + # TODO: back to global scope in conan v2 + libsuffix = "" + if self.settings.build_type == "Debug": + if self.settings.os == "Windows" and not self.options.shared: + libsuffix += "md" + libsuffix += "d" + self.cpp_info.components["easyhttp"].libs = [f"easyhttp{libsuffix}"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["easyhttp"].defines.append("EASYHTTPCPP_DLL") + self.cpp_info.components["easyhttp"].requires = [ + "poco::poco_foundation", "poco::poco_data", + "poco::poco_datasqlite", "poco::poco_net", + ] + if self.settings.os == "Windows": + self.cpp_info.components["easyhttp"].requires.append("poco::poco_netsslwin") + else: + self.cpp_info.components["easyhttp"].requires.append("poco::poco_netssl") + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "easyhttpcppeasyhttp" + self.cpp_info.filenames["cmake_find_package_multi"] = "easyhttpcppeasyhttp" + self.cpp_info.names["cmake_find_package"] = "easyhttpcpp" + self.cpp_info.names["cmake_find_package_multi"] = "easyhttpcpp" + self.cpp_info.components["easyhttp"].names["cmake_find_package"] = "easyhttp" + self.cpp_info.components["easyhttp"].names["cmake_find_package_multi"] = "easyhttp" + self.cpp_info.components["easyhttp"].set_property("cmake_target_name", "easyhttpcpp::easyhttp") diff --git a/recipes/easyhttpcpp/all/patches/0001-fix-cmake-config-in-path.patch b/recipes/easyhttpcpp/all/patches/0001-fix-cmake-config-in-path.patch new file mode 100644 index 0000000000000..02ab32989983b --- /dev/null +++ b/recipes/easyhttpcpp/all/patches/0001-fix-cmake-config-in-path.patch @@ -0,0 +1,11 @@ +--- a/cmake/DefineProjectMacros.cmake ++++ b/cmake/DefineProjectMacros.cmake +@@ -18,7 +18,7 @@ macro(easyhttpcpp_generate_package target_name) + NAMESPACE "${CMAKE_PROJECT_NAME}::" + ) + +- configure_file("${CMAKE_MODULE_PATH}/${CMAKE_PROJECT_NAME}${target_name}Config.cmake.in" ++ configure_file("${PROJECT_SOURCE_DIR}/cmake/${CMAKE_PROJECT_NAME}${target_name}Config.cmake.in" + "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}/${CMAKE_PROJECT_NAME}${target_name}Config.cmake" + @ONLY + ) diff --git a/recipes/easyhttpcpp/all/patches/0002-use-poco-targets.patch b/recipes/easyhttpcpp/all/patches/0002-use-poco-targets.patch new file mode 100644 index 0000000000000..32b3faa52f217 --- /dev/null +++ b/recipes/easyhttpcpp/all/patches/0002-use-poco-targets.patch @@ -0,0 +1,27 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,7 +70,6 @@ set(LIBRARY_TARGET_NAME "easyhttp") + if (WIN32) + find_package(Poco REQUIRED Foundation Data DataSQLite Net NetSSLWin CONFIG) + else () +- find_package(OpenSSL REQUIRED) + find_package(Poco REQUIRED Foundation Data DataSQLite Net NetSSL Crypto CONFIG) + endif () + +@@ -109,10 +108,12 @@ set_target_properties(${LIBRARY_TARGET_NAME} + OUTPUT_NAME ${LIBRARY_TARGET_NAME} + ) + +-target_link_libraries(${LIBRARY_TARGET_NAME} +- ${Poco_LIBRARIES} +- ${OPENSSL_SSL_LIBRARY} +- ${OPENSSL_CRYPTO_LIBRARY}) ++target_link_libraries(${LIBRARY_TARGET_NAME} PUBLIC Poco::Foundation Poco::Data Poco::DataSQLite Poco::Net) ++if(WIN32) ++ target_link_libraries(${LIBRARY_TARGET_NAME} PUBLIC Poco::NetSSLWin) ++else() ++ target_link_libraries(${LIBRARY_TARGET_NAME} PUBLIC Poco::NetSSL Poco::Crypto) ++endif() + + target_include_directories(${LIBRARY_TARGET_NAME} + PUBLIC diff --git a/recipes/easyhttpcpp/all/test_package/CMakeLists.txt b/recipes/easyhttpcpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1c309d560ea6a --- /dev/null +++ b/recipes/easyhttpcpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(easyhttpcppeasyhttp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE easyhttpcpp::easyhttp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/easyhttpcpp/all/test_package/conanfile.py b/recipes/easyhttpcpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..99768c9dfed80 --- /dev/null +++ b/recipes/easyhttpcpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} http://localhost:80", env="conanrun") diff --git a/recipes/easyhttpcpp/all/test_package/test_package.cpp b/recipes/easyhttpcpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1162499f997bc --- /dev/null +++ b/recipes/easyhttpcpp/all/test_package/test_package.cpp @@ -0,0 +1,76 @@ +/* + * Copyright 2017 Sony Corporation + */ + +#include "easyhttpcpp/EasyHttp.h" + +#include +#include + +void displayUsage(char** argv) +{ + std::cout << "Usage: " << argv[0] << " " << std::endl; + std::cout << " Fetches the resource identified by and prints it to the standard output" + << std::endl; +} + +void dumpResponse(easyhttpcpp::Response::Ptr pResponse) +{ + std::cout << "Http status code: " << pResponse->getCode() << std::endl; + std::cout << "Http status message: " << pResponse->getMessage() << std::endl; + std::cout << "Http response headers:\n" << pResponse->getHeaders()->toString() << std::endl; + + // dump response body if text + const std::string contentType = pResponse->getHeaderValue("Content-Type", ""); + if (Poco::isubstr(contentType, "text/html") != std::string::npos) { + std::cout << "Http response body:\n" << pResponse->getBody()->toString() << std::endl; + } +} + +int main(int argc, char** argv) +{ + // need a url to execute easyhttpcpp http client + if (argc < 2) { + displayUsage(argv); + return 1; + } + std::string url = argv[1]; + + // HTTP GET the url + std::cout << "HTTP GET url: " << url << std::endl; + + try { + // cache dir = current working dir; cache size = 100 KB + easyhttpcpp::HttpCache::Ptr pCache = easyhttpcpp::HttpCache::createCache(Poco::Path::current(), 1024 * 100); + + // a default http connection pool + easyhttpcpp::ConnectionPool::Ptr pConnectionPool = easyhttpcpp::ConnectionPool::createConnectionPool(); + + // configure http cache and connection pool instance (optional but recommended) + easyhttpcpp::EasyHttp::Builder httpClientBuilder; + httpClientBuilder.setCache(pCache) + .setConnectionPool(pConnectionPool); + + // create http client + easyhttpcpp::EasyHttp::Ptr pHttpClient = httpClientBuilder.build(); + + // create a new request and execute synchronously + easyhttpcpp::Request::Builder requestBuilder; + easyhttpcpp::Request::Ptr pRequest = requestBuilder.setUrl(url).build(); + easyhttpcpp::Call::Ptr pCall = pHttpClient->newCall(pRequest); + easyhttpcpp::Response::Ptr pResponse = pCall->execute(); + + if (!pResponse->isSuccessful()) { + std::cout << "HTTP GET Error: (" << pResponse->getCode() << ")" << std::endl; + } else { + std::cout << "HTTP GET Success!" << std::endl; + } + + // dump response + dumpResponse(pResponse); + } catch (const std::exception& e) { + std::cout << "Error occurred: " << e.what() << std::endl; + } + + return 0; +} diff --git a/recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt b/recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/easyhttpcpp/all/test_v1_package/conanfile.py b/recipes/easyhttpcpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5da5f0f382b3f --- /dev/null +++ b/recipes/easyhttpcpp/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(f"{bin_path} http://localhost:80", run_environment=True) diff --git a/recipes/easyhttpcpp/config.yml b/recipes/easyhttpcpp/config.yml new file mode 100644 index 0000000000000..dfff490f9a9b6 --- /dev/null +++ b/recipes/easyhttpcpp/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.0": + folder: all diff --git a/recipes/easyloggingpp/all/CMakeLists.txt b/recipes/easyloggingpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..f6fc5c33e69b0 --- /dev/null +++ b/recipes/easyloggingpp/all/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() +option(enable_crash_log "Enable crash log handler" OFF) +option(enable_thread_safe "Enable thread safety for use in multithreaded env" OFF) +option(enable_debug_errors "Enable debug errors in case of configuration issues" OFF) +option(enable_default_logfile "Enable creation of default logfile" ON) +option(disable_logs "Disables all logs" OFF) +option(disable_debug_logs "Disables debug logs" OFF) +option(disable_info_logs "Disables info logs" OFF) +option(disable_warning_logs "Disables warning logs" OFF) +option(disable_error_logs "Disables error logs" OFF) +option(disable_fatal_logs "Disables fatal logs" OFF) +option(disable_verbose_logs "Disables verbose logs" OFF) +option(disable_trace_logs "Disables trace logs" OFF) + +if (enable_crash_log) + add_definitions(-DELPP_FEATURE_CRASH_LOG) +endif() + +if (enable_thread_safe) + add_definitions(-DELPP_THREAD_SAFE) +endif() + +if (enable_debug_errors) + add_definitions(-DELPP_DEBUG_ERRORS) +endif() + +if (NOT enable_default_logfile) + add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) +endif() + +if (disable_logs) + add_definitions(-DELPP_DISABLE_LOGS) +endif() + +if (disable_debug_logs) + add_definitions(-DELPP_DISABLE_DEBUG_LOGS) +endif() + +if (disable_info_logs) + add_definitions(-DELPP_DISABLE_INFO_LOGS) +endif() + +if (disable_warning_logs) + add_definitions(-DELPP_DISABLE_WARNING_LOGS) +endif() + +if (disable_error_logs) + add_definitions(-DELPP_DISABLE_ERROR_LOGS) +endif() + +if (disable_fatal_logs) + add_definitions(-DELPP_DISABLE_FATAL_LOGS) +endif() + +if (disable_verbose_logs) + add_definitions(-DELPP_DISABLE_VERBOSE_LOGS) +endif() + +if (disable_trace_logs) + add_definitions(-DELPP_DISABLE_TRACE_LOGS) +endif() + +add_subdirectory("source_subfolder") diff --git a/recipes/easyloggingpp/all/conandata.yml b/recipes/easyloggingpp/all/conandata.yml new file mode 100644 index 0000000000000..5649e78f158cc --- /dev/null +++ b/recipes/easyloggingpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "9.97.0": + url: "https://github.com/amrayn/easyloggingpp/archive/v9.97.0.tar.gz" + sha256: "9110638e21ef02428254af8688bf9e766483db8cc2624144aa3c59006907ce22" diff --git a/recipes/easyloggingpp/all/conanfile.py b/recipes/easyloggingpp/all/conanfile.py new file mode 100644 index 0000000000000..b5d1f9b44e060 --- /dev/null +++ b/recipes/easyloggingpp/all/conanfile.py @@ -0,0 +1,121 @@ +import os +from conans import CMake +from conan.tools import files +from conan import ConanFile + + +required_conan_version = ">=1.33.0" + +class EasyloggingppConan(ConanFile): + name = "easyloggingpp" + license = "The MIT License (MIT)" + homepage = "https://github.com/amrayn/easyloggingpp" + url = "https://github.com/conan-io/conan-center-index" + description = "Single header C++ logging library." + topics = ("logging", "stacktrace", "efficient-logging") + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + exports_sources = "CMakeLists.txt", + options = { + "enable_crash_log": [True, False], + "enable_thread_safe": [True, False], + "enable_debug_errors": [True, False], + "enable_default_logfile": [True, False], + "disable_logs": [True, False], + "disable_debug_logs": [True, False], + "disable_info_logs": [True, False], + "disable_warning_logs": [True, False], + "disable_error_logs": [True, False], + "disable_fatal_logs": [True, False], + "disable_verbose_logs": [True, False], + "disable_trace_logs": [True, False] + } + default_options = { + "enable_crash_log": False, + "enable_thread_safe": False, + "enable_debug_errors": False, + "enable_default_logfile": True, + "disable_logs": False, + "disable_debug_logs": False, + "disable_info_logs": False, + "disable_warning_logs": False, + "disable_error_logs": False, + "disable_fatal_logs": False, + "disable_verbose_logs": False, + "disable_trace_logs": False + } + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _configure_cmake(self): + if self._cmake is not None: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["build_static_lib"] = True + self._cmake.definitions["enable_crash_log"] = self.options.enable_crash_log + self._cmake.definitions["enable_thread_safe"] = self.options.enable_thread_safe + self._cmake.definitions["enable_debug_errors"] = self.options.enable_debug_errors + self._cmake.definitions["enable_default_logfile"] = self.options.enable_default_logfile + self._cmake.definitions["disable_logs"] = self.options.disable_logs + self._cmake.definitions["disable_debug_logs"] = self.options.disable_debug_logs + self._cmake.definitions["disable_info_logs"] = self.options.disable_info_logs + self._cmake.definitions["disable_warning_logs"] = self.options.disable_warning_logs + self._cmake.definitions["disable_error_logs"] = self.options.disable_error_logs + self._cmake.definitions["disable_fatal_logs"] = self.options.disable_fatal_logs + self._cmake.definitions["disable_verbose_logs"] = self.options.disable_verbose_logs + self._cmake.definitions["disable_trace_logs"] = self.options.disable_trace_logs + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + files.rmdir(self, os.path.join(self.package_folder, "share")) + self.copy(pattern="LICENSE", + dst="licenses", + src=self._source_subfolder) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "easyloggingpp" + self.cpp_info.names["cmake_find_package_multi"] = "easyloggingpp" + self.cpp_info.libs = ["easyloggingpp"] + if self.options.enable_crash_log: + self.cpp_info.defines.append("ELPP_FEATURE_CRASH_LOG") + if self.options.enable_thread_safe: + self.cpp_info.defines.append("ELPP_THREAD_SAFE") + if self.options.enable_debug_errors: + self.cpp_info.defines.append("ELPP_DEBUG_ERRORS") + if self.options.enable_default_logfile: + self.cpp_info.defines.append("ELPP_NO_DEFAULT_LOG_FILE") + if self.options.disable_logs: + self.cpp_info.defines.append("ELPP_DISABLE_LOGS") + if self.options.disable_debug_logs: + self.cpp_info.defines.append("ELPP_DISABLE_DEBUG_LOGS") + if self.options.disable_info_logs: + self.cpp_info.defines.append("ELPP_DISABLE_INFO_LOGS") + if self.options.disable_warning_logs: + self.cpp_info.defines.append("ELPP_DISABLE_WARNING_LOGS") + if self.options.disable_error_logs: + self.cpp_info.defines.append("ELPP_DISABLE_ERROR_LOGS") + if self.options.disable_fatal_logs: + self.cpp_info.defines.append("ELPP_DISABLE_FATAL_LOGS") + if self.options.disable_verbose_logs: + self.cpp_info.defines.append("ELPP_DISABLE_VERBOSE_LOGS") + if self.options.disable_trace_logs: + self.cpp_info.defines.append("ELPP_DISABLE_TRACE_LOGS") + diff --git a/recipes/easyloggingpp/all/test_package/CMakeLists.txt b/recipes/easyloggingpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e515e14d7e6ad --- /dev/null +++ b/recipes/easyloggingpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(easyloggingpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE easyloggingpp::easyloggingpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/easyloggingpp/all/test_package/conanfile.py b/recipes/easyloggingpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/easyloggingpp/all/test_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/easyloggingpp/all/test_package/test_package.cpp b/recipes/easyloggingpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9f1fc4b8dad34 --- /dev/null +++ b/recipes/easyloggingpp/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "easylogging++.h" +INITIALIZE_EASYLOGGINGPP + +#ifdef ELPP_FEATURE_CRASH_LOG +void myCrashHandler(int sig) { + LOG(ERROR) << "Woops! Crashed!"; + el::Helpers::logCrashReason(sig, true); + // FOLLOWING LINE IS ABSOLUTELY NEEDED AT THE END IN ORDER TO ABORT APPLICATION + el::Helpers::crashAbort(sig); +} +#endif + +int main() { + LOG(INFO) << "My first info log using default logger"; + #ifdef ELPP_FEATURE_CRASH_LOG + LOG(INFO) << "Installed crash handler"; + el::Helpers::setCrashHandler(myCrashHandler); + #endif + return 0; +} diff --git a/recipes/easyloggingpp/config.yml b/recipes/easyloggingpp/config.yml new file mode 100644 index 0000000000000..8f835ce7bab04 --- /dev/null +++ b/recipes/easyloggingpp/config.yml @@ -0,0 +1,3 @@ +versions: + "9.97.0": + folder: all diff --git a/recipes/easylzma/all/CMakeLists.txt b/recipes/easylzma/all/CMakeLists.txt new file mode 100644 index 0000000000000..8b2a23892d7de --- /dev/null +++ b/recipes/easylzma/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.6) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/easylzma/all/conandata.yml b/recipes/easylzma/all/conandata.yml new file mode 100644 index 0000000000000..ce63d9a78cbcc --- /dev/null +++ b/recipes/easylzma/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.0.7": + url: "https://github.com/lloyd/easylzma/archive/0.0.7.tar.gz" + sha256: "c32565643598ba5147332d094d0392ec5b15b494e237c39a712db3fab9d9939a" +patches: + "0.0.7": + - patch_file: "patches/memleaksfix.patch" + base_path: "source_subfolder" + - patch_file: "patches/cmake-no-cflags.patch" + base_path: "source_subfolder" + diff --git a/recipes/easylzma/all/conanfile.py b/recipes/easylzma/all/conanfile.py new file mode 100644 index 0000000000000..5e527b6090911 --- /dev/null +++ b/recipes/easylzma/all/conanfile.py @@ -0,0 +1,72 @@ +import os +from conans import ConanFile, tools, CMake + + +class EazylzmaConan(ConanFile): + name = "easylzma" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lloyd/easylzma" + description = ("An easy to use, tiny, public domain, C wrapper library around \ + Igor Pavlov's work that can be used to compress and extract lzma files") + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + topics = ("conan", "eazylzma", "lzma") + exports_sources = ["CMakeLists.txt", "patches/*"] + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _license_text(self): + # Extract the License/s from the README to a file + tmp = tools.load(os.path.join("source_subfolder", "README")) + return tmp[tmp.find("License",1):tmp.find("work.", 1)+5] + + @property + def _libname(self): + return "easylzma" if self.options.shared else "easylzma_s" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + cmake = CMake(self) + cmake.configure() + cmake.build(target=self._libname) + + def package(self): + tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + + self.copy(pattern="*.dylib*", dst="lib", src="lib", keep_path=False, symlinks=True) + self.copy(pattern="*.so*", dst="lib", src="lib", keep_path=False, symlinks=True) + self.copy(pattern="*.dll", dst="bin", src="bin", keep_path=False) + self.copy(pattern="*.a", dst="lib", src="lib", keep_path=False) + self.copy(pattern="*.lib", dst="lib", src="lib", keep_path=False) + + self.copy("easylzma/*", dst="include", src=os.path.join(self._source_subfolder, "src")) + + def package_info(self): + self.cpp_info.libs = [self._libname] + if self.options.shared: + self.cpp_info.defines = ["EASYLZMA_SHARED"] + if self.settings.compiler == "Visual Studio": + if "d" in str(self.settings.compiler.runtime): + self.cpp_info.defines.append("DEBUG") diff --git a/recipes/easylzma/all/patches/cmake-no-cflags.patch b/recipes/easylzma/all/patches/cmake-no-cflags.patch new file mode 100644 index 0000000000000..0e54abb3961bc --- /dev/null +++ b/recipes/easylzma/all/patches/cmake-no-cflags.patch @@ -0,0 +1,27 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -26,8 +26,8 @@ + MESSAGE("** for a debug build: cmake -DCMAKE_BUILD_TYPE=Debug ..") + ENDIF (${CMAKE_BUILD_TYPE} STREQUAL "Release") + +-SET(CMAKE_C_FLAGS "-Wall") +-IF (WIN32) ++#SET(CMAKE_C_FLAGS "-Wall") ++IF (0) + SET(linkFlags "/PDB:NONE /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF") + SET(CMAKE_EXE_LINKER_FLAGS "${linkFlags}" + CACHE STRING "LZMA linker flags" FORCE) +@@ -43,11 +43,11 @@ + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4668 /wd4820 /wd4996 /wd4255 /wd4130 /wd4100 /wd4711") + SET(CMAKE_C_FLAGS_DEBUG "/D DEBUG /Od /Z7") + SET(CMAKE_C_FLAGS_RELEASE "/D NDEBUG /O2") +-ELSE (WIN32) ++ELSEIF(0) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -ansi") + SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -g") + SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2") +-ENDIF (WIN32) ++ENDIF () + + ADD_SUBDIRECTORY(src) + ADD_SUBDIRECTORY(elzma) diff --git a/recipes/easylzma/all/patches/memleaksfix.patch b/recipes/easylzma/all/patches/memleaksfix.patch new file mode 100644 index 0000000000000..d64733c310369 --- /dev/null +++ b/recipes/easylzma/all/patches/memleaksfix.patch @@ -0,0 +1,74 @@ +--- + src/compress.c | 2 +- + test/easylzma_test.c | 20 ++++++++++++-------- + test/simple.c | 4 +++- + 3 files changed, 16 insertions(+), 10 deletions(-) + +diff --git a/src/compress.c b/src/compress.c +index 78be112..577b014 100644 +--- a/src/compress.c ++++ b/src/compress.c +@@ -66,7 +66,7 @@ elzma_compress_free(elzma_compress_handle * hand) + (ISzAlloc *) &((*hand)->allocStruct), + (ISzAlloc *) &((*hand)->allocStruct)); + } +- ++ free(*hand); + } + *hand = NULL; + } +diff --git a/test/easylzma_test.c b/test/easylzma_test.c +index 80691d9..3dfa45d 100644 +--- a/test/easylzma_test.c ++++ b/test/easylzma_test.c +@@ -153,16 +153,20 @@ static int roundTripTest(elzma_file_format format) + + free(compressed); + +- if (rc != ELZMA_E_OK) return rc; +- +- if (sz != strlen(sampleData) || +- 0 != memcmp(decompressed, sampleData, sz)) +- { ++ if (rc != ELZMA_E_OK) { ++ if (sz != strlen(sampleData) || ++ 0 != memcmp(decompressed, sampleData, sz)) ++ { ++ rc = 1; ++ } else { ++ rc = ELZMA_E_OK; ++ } ++ } ++ ++ if (decompressed != NULL) { + free(decompressed); +- return 1; + } +- +- return ELZMA_E_OK; ++ return rc; + } + + /* "correct" lzip generated from the lzip program */ +diff --git a/test/simple.c b/test/simple.c +index 09df38e..5ae6800 100644 +--- a/test/simple.c ++++ b/test/simple.c +@@ -99,6 +99,7 @@ simpleCompress(elzma_file_format format, const unsigned char * inData, + return rc; + } + ++ elzma_compress_free(&hand); + *outData = ds.outData; + *outLen = ds.outLen; + } +@@ -132,7 +133,8 @@ simpleDecompress(elzma_file_format format, const unsigned char * inData, + elzma_decompress_free(&hand); + return rc; + } +- ++ ++ elzma_decompress_free(&hand); + *outData = ds.outData; + *outLen = ds.outLen; + } diff --git a/recipes/easylzma/all/test_package/CMakeLists.txt b/recipes/easylzma/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/easylzma/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/easylzma/all/test_package/conanfile.py b/recipes/easylzma/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4903f1a7e8fa0 --- /dev/null +++ b/recipes/easylzma/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/easylzma/all/test_package/test_package.c b/recipes/easylzma/all/test_package/test_package.c new file mode 100644 index 0000000000000..e1fb059730570 --- /dev/null +++ b/recipes/easylzma/all/test_package/test_package.c @@ -0,0 +1,33 @@ +#include "easylzma/compress.h" + +#include + +int main() { + printf("EasyLZMA test package \n"); + + int rc; + int inLen = 10; + elzma_file_format format = ELZMA_lzma; + elzma_compress_handle hand; + + /* allocate compression handle */ + hand = elzma_compress_alloc(); + if (hand == NULL) { + printf("Allocation failed \n"); + return 0; + } + + rc = elzma_compress_config(hand, ELZMA_LC_DEFAULT, + ELZMA_LP_DEFAULT, ELZMA_PB_DEFAULT, + 5, (1 << 20) /* 1mb */, + format, inLen); + + if (rc != ELZMA_E_OK) { + printf("Config failed with error code: %d \n", rc); + } else { + printf("Config OK \n"); + } + + elzma_compress_free(&hand); + return 0; +} diff --git a/recipes/easylzma/config.yml b/recipes/easylzma/config.yml new file mode 100644 index 0000000000000..3b1adbf0ba92f --- /dev/null +++ b/recipes/easylzma/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.7": + folder: all diff --git a/recipes/ecos/all/conandata.yml b/recipes/ecos/all/conandata.yml new file mode 100644 index 0000000000000..3034805590c75 --- /dev/null +++ b/recipes/ecos/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.0.8": + url: "https://github.com/embotech/ecos/archive/refs/tags/v2.0.8.tar.gz" + sha256: "d905d16599efd927a75b29852c3476ff1ffd0b97ab27d5b8ad63bb4ff2ad8130" +patches: + "2.0.8": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-missing-include.patch" diff --git a/recipes/ecos/all/conanfile.py b/recipes/ecos/all/conanfile.py new file mode 100644 index 0000000000000..6947c543e0352 --- /dev/null +++ b/recipes/ecos/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.52.0" + + +class EcosConan(ConanFile): + name = "ecos" + description = "ECOS is a numerical software for solving convex second-order cone programs (SOCPs)." + license = "GPL-3.0-or-later" + topics = ("ecos", "conic-solver") + homepage = "https://github.com/embotech/ecos" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_long": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_long": 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: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # TODO: unvendor suitesparse + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_LONG"] = self.options.use_long + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ecos") + self.cpp_info.set_property("cmake_target_name", "ecos::ecos") + self.cpp_info.libs = ["ecos"] + self.cpp_info.defines.append("CTRLC=1") + if self.options.use_long: + self.cpp_info.defines.extend(["LDL_LONG", "DLONG"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/ecos/all/patches/0001-fix-cmake.patch b/recipes/ecos/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..896d894e5eb55 --- /dev/null +++ b/recipes/ecos/all/patches/0001-fix-cmake.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,11 +77,9 @@ set(ecos_sources + ) + + # ECOS library +-add_library(ecos SHARED ${ecos_headers} ${ecos_sources}) ++add_library(ecos ${ecos_headers} ${ecos_sources}) + + # Set compiler options and definitions +-target_compile_options(ecos PRIVATE "$<$:${DEBUG_OPTIONS}>") +-target_compile_options(ecos PRIVATE "$<$:${RELEASE_OPTIONS}>") + target_compile_definitions(ecos PUBLIC CTRLC=1) + if(USE_LONG) + target_compile_definitions(ecos PUBLIC LDL_LONG DLONG) diff --git a/recipes/ecos/all/patches/0002-missing-include.patch b/recipes/ecos/all/patches/0002-missing-include.patch new file mode 100644 index 0000000000000..e58ddb2eb47cf --- /dev/null +++ b/recipes/ecos/all/patches/0002-missing-include.patch @@ -0,0 +1,10 @@ +--- a/ecos_bb/ecos_bb.c ++++ b/ecos_bb/ecos_bb.c +@@ -31,6 +31,7 @@ + #include "math.h" + #include "equil.h" + #include "spla.h" ++#include + + #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) + diff --git a/recipes/ecos/all/test_package/CMakeLists.txt b/recipes/ecos/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..006729666b6b5 --- /dev/null +++ b/recipes/ecos/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ecos REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ecos::ecos) diff --git a/recipes/ecos/all/test_package/conanfile.py b/recipes/ecos/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ecos/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/ecos/all/test_package/test_package.c b/recipes/ecos/all/test_package/test_package.c new file mode 100644 index 0000000000000..e2355977706cc --- /dev/null +++ b/recipes/ecos/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main(void) { + printf("ECOS version %s\n", ECOS_ver()); + return 0; +} diff --git a/recipes/ecos/all/test_v1_package/CMakeLists.txt b/recipes/ecos/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..465202cc7e581 --- /dev/null +++ b/recipes/ecos/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ecos REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ecos::ecos) diff --git a/recipes/ecos/all/test_v1_package/conanfile.py b/recipes/ecos/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ecos/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/ecos/config.yml b/recipes/ecos/config.yml new file mode 100644 index 0000000000000..ebde7c07fe491 --- /dev/null +++ b/recipes/ecos/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.8": + folder: all diff --git a/recipes/editline/all/conandata.yml b/recipes/editline/all/conandata.yml new file mode 100644 index 0000000000000..6a96752d03234 --- /dev/null +++ b/recipes/editline/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.1": + url: "http://thrysoee.dk/editline/libedit-20191231-3.1.tar.gz" + sha256: "dbb82cb7e116a5f8025d35ef5b4f7d4a3cdd0a3909a146a39112095a2d229071" diff --git a/recipes/editline/all/conanfile.py b/recipes/editline/all/conanfile.py new file mode 100644 index 0000000000000..3a10507e0cd32 --- /dev/null +++ b/recipes/editline/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class EditlineConan(ConanFile): + name = "editline" + description = "Autotool- and libtoolized port of the NetBSD Editline library (libedit)." + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://thrysoee.dk/editline/" + topics = ("libedit", "line", "editing", "history", "tokenization") + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "terminal_db": ["termcap", "ncurses", "tinfo"], + } + default_options = { + "shared": False, + "fPIC": True, + "terminal_db": "termcap", + } + + 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.terminal_db == "termcap": + self.requires("termcap/1.3.1") + elif self.options.terminal_db == "ncurses": + self.requires("ncurses/6.4") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported by libedit (missing termios.h)") + if self.options.terminal_db == "tinfo": + # TODO - Add tinfo when available + raise ConanInvalidConfiguration("tinfo is not (yet) available on CCI") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-examples") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libedit") + self.cpp_info.libs = ["edit"] + self.cpp_info.includedirs.append(os.path.join("include", "editline")) diff --git a/recipes/editline/all/test_package/CMakeLists.txt b/recipes/editline/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7dd22a34887ac --- /dev/null +++ b/recipes/editline/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(editline REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE editline::editline) diff --git a/recipes/editline/all/test_package/conanfile.py b/recipes/editline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..299c3facd9ebf --- /dev/null +++ b/recipes/editline/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import Environment +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 generate(self): + env = Environment() + env.define("TERM", "xtermc") + env.vars(self, scope="run").save_script("conanrun_term") + + 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/editline/all/test_package/test_package.c b/recipes/editline/all/test_package/test_package.c new file mode 100644 index 0000000000000..68811611154ab --- /dev/null +++ b/recipes/editline/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "histedit.h" + +#include + +int main(int argc, char *argv[]) +{ + EditLine *el = el_init(argv[0], stdin, stdout, stderr); + el_end(el); + return 0; +} diff --git a/recipes/editline/all/test_v1_package/CMakeLists.txt b/recipes/editline/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/editline/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/editline/all/test_v1_package/conanfile.py b/recipes/editline/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ca3e725401958 --- /dev/null +++ b/recipes/editline/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): + with tools.environment_append({"TERM": "xtermc"}): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/editline/config.yml b/recipes/editline/config.yml new file mode 100644 index 0000000000000..992d10eb37c11 --- /dev/null +++ b/recipes/editline/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1": + folder: all diff --git a/recipes/edlib/all/conandata.yml b/recipes/edlib/all/conandata.yml new file mode 100644 index 0000000000000..88db7a2db84b8 --- /dev/null +++ b/recipes/edlib/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.7": + url: "https://github.com/Martinsos/edlib/archive/v1.2.7.tar.gz" + sha256: "8767bc1b04a1a67282d57662e5702c4908996e96b1753b5520921ff189974621" + "1.2.6": + url: "https://github.com/Martinsos/edlib/archive/v1.2.6.tar.gz" + sha256: "0436f14b0339dabd2aab7faf3779ac1b4bbbdc46246c1bff49be997fe4b4e2c7" +patches: + "1.2.6": + - patch_file: "patches/cmake-install-and-export-symbols.patch" diff --git a/recipes/edlib/all/conanfile.py b/recipes/edlib/all/conanfile.py new file mode 100644 index 0000000000000..df371a10db550 --- /dev/null +++ b/recipes/edlib/all/conanfile.py @@ -0,0 +1,112 @@ +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, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class EdlibConan(ConanFile): + name = "edlib" + description = "Lightweight, super fast C/C++ (& Python) library for " \ + "sequence alignment using edit (Levenshtein) distance." + topics = ("sequence-alignment", "edit-distance", "levehnstein-distance", "alignment-path") + license = "MIT" + homepage = "https://github.com/Martinsos/edlib" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.2.7" else "14" + + @property + def _minimum_compilers_version(self): + return { + "14": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + 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) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def 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["EDLIB_BUILD_EXAMPLES"] = False + tc.variables["EDLIB_BUILD_UTILITIES"] = False + if Version(self.version) >= "1.2.7": + tc.variables["EDLIB_ENABLE_INSTALL"] = True + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0063"] = "NEW" + # Needed because upstream CMakeLists overrides BUILD_SHARED_LIBS as a cache variable + tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "edlib") + self.cpp_info.set_property("cmake_target_name", "edlib::edlib") + self.cpp_info.set_property("pkg_config_name", f"edlib-{Version(self.version).major}") + self.cpp_info.libs = ["edlib"] + if self.options.shared: + self.cpp_info.defines = ["EDLIB_SHARED"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/edlib/all/patches/cmake-install-and-export-symbols.patch b/recipes/edlib/all/patches/cmake-install-and-export-symbols.patch new file mode 100644 index 0000000000000..09142667409ab --- /dev/null +++ b/recipes/edlib/all/patches/cmake-install-and-export-symbols.patch @@ -0,0 +1,114 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,8 @@ + cmake_minimum_required(VERSION 3.2 FATAL_ERROR) + project(edlib VERSION 1.2.5) + ++option(EDLIB_BUILD_EXAMPLES "Build examples" ON) ++option(EDLIB_BUILD_UTILITIES "Build utilities" ON) + set(MACOSX (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) + + if(CMAKE_BUILD_TYPE MATCHES Debug) +@@ -50,16 +52,23 @@ file(GLOB SOURCES "edlib/src/*.cpp") + add_library(edlib ${SOURCES}) + set_target_properties(edlib + PROPERTIES ++ CXX_VISIBILITY_PRESET hidden ++ VISIBILITY_INLINES_HIDDEN ON + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION}) ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(edlib PUBLIC EDLIB_SHARED PRIVATE EDLIB_BUILD_SHARED) ++endif() + + target_include_directories(edlib PUBLIC + $ + $) + + # Build binaries. ++if(EDLIB_BUILD_EXAMPLES) + add_executable(helloWorld apps/hello-world/helloWorld.c) + target_link_libraries(helloWorld edlib) ++endif() + + include(CTest) + if (BUILD_TESTING) +@@ -69,14 +78,17 @@ if (BUILD_TESTING) + add_test(edlib_tests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runTests) + endif() + +-if (NOT WIN32) # If on windows, do not build binaries that do not support windows. ++if(EDLIB_BUILD_UTILITIES AND NOT WIN32) + add_executable(edlib-aligner apps/aligner/aligner.cpp) + target_link_libraries(edlib-aligner edlib) + endif() + + + # Create target 'install' for installing libraries. +-install(TARGETS edlib DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS edlib ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES edlib/include/edlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + # configure and install pkg-config file +--- a/edlib/include/edlib.h ++++ b/edlib/include/edlib.h +@@ -11,6 +11,16 @@ + extern "C" { + #endif + ++#ifndef EDLIB_SHARED ++#define EDLIB_API ++#elif !defined(_WIN32) ++#define EDLIB_API __attribute__ ((visibility ("default"))) ++#elif defined(EDLIB_BUILD_SHARED) ++#define EDLIB_API __declspec(dllexport) ++#else ++#define EDLIB_API __declspec(dllimport) ++#endif ++ + // Status codes + #define EDLIB_STATUS_OK 0 + #define EDLIB_STATUS_ERROR 1 +@@ -128,6 +138,7 @@ extern "C" { + * Helper method for easy construction of configuration object. + * @return Configuration object filled with given parameters. + */ ++ EDLIB_API + EdlibAlignConfig edlibNewAlignConfig(int k, EdlibAlignMode mode, EdlibAlignTask task, + EdlibEqualityPair* additionalEqualities, + int additionalEqualitiesLength); +@@ -136,6 +147,7 @@ extern "C" { + * @return Default configuration object, with following defaults: + * k = -1, mode = EDLIB_MODE_NW, task = EDLIB_TASK_DISTANCE, no additional equalities. + */ ++ EDLIB_API + EdlibAlignConfig edlibDefaultAlignConfig(void); + + +@@ -204,6 +216,7 @@ extern "C" { + * Frees memory in EdlibAlignResult that was allocated by edlib. + * If you do not use it, make sure to free needed members manually using free(). + */ ++ EDLIB_API + void edlibFreeAlignResult(EdlibAlignResult result); + + +@@ -222,6 +235,7 @@ extern "C" { + * @return Result of alignment, which can contain edit distance, start and end locations and alignment path. + * Make sure to clean up the object using edlibFreeAlignResult() or by manually freeing needed members. + */ ++ EDLIB_API + EdlibAlignResult edlibAlign(const char* query, int queryLength, + const char* target, int targetLength, + const EdlibAlignConfig config); +@@ -246,6 +260,7 @@ extern "C" { + * Needed memory is allocated and given pointer is set to it. + * Do not forget to free it later using free()! + */ ++ EDLIB_API + char* edlibAlignmentToCigar(const unsigned char* alignment, int alignmentLength, + EdlibCigarFormat cigarFormat); + diff --git a/recipes/edlib/all/test_package/CMakeLists.txt b/recipes/edlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..502714cc3a9ba --- /dev/null +++ b/recipes/edlib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(edlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE edlib::edlib) diff --git a/recipes/edlib/all/test_package/conanfile.py b/recipes/edlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/edlib/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/edlib/all/test_package/test_package.c b/recipes/edlib/all/test_package/test_package.c new file mode 100644 index 0000000000000..99372380ed350 --- /dev/null +++ b/recipes/edlib/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + EdlibAlignResult result = edlibAlign("hello", 5, "world!", 6, edlibDefaultAlignConfig()); + printf("edit_distance('hello', 'world!') = %d\n", result.editDistance); + edlibFreeAlignResult(result); + return 0; +} diff --git a/recipes/edlib/all/test_v1_package/CMakeLists.txt b/recipes/edlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/edlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/edlib/all/test_v1_package/conanfile.py b/recipes/edlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/edlib/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/edlib/config.yml b/recipes/edlib/config.yml new file mode 100644 index 0000000000000..10801ad040b22 --- /dev/null +++ b/recipes/edlib/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.7": + folder: all + "1.2.6": + folder: all diff --git a/recipes/edyn/all/conandata.yml b/recipes/edyn/all/conandata.yml new file mode 100644 index 0000000000000..4f8e161949ad2 --- /dev/null +++ b/recipes/edyn/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.1": + url: "https://github.com/xissburg/edyn/archive/refs/tags/v1.2.1.tar.gz" + sha256: "d088dac1bebed65cd342c76f27661fbb557b95f959a67137f4df1000d9698b13" diff --git a/recipes/edyn/all/conanfile.py b/recipes/edyn/all/conanfile.py new file mode 100644 index 0000000000000..d6278b4cb5dcb --- /dev/null +++ b/recipes/edyn/all/conanfile.py @@ -0,0 +1,109 @@ +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, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class EdynConan(ConanFile): + name = "edyn" + description = "Edyn is a real-time physics engine organized as an ECS" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xissburg/edyn" + topics = ("physics", "game-development", "ecs") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "floating_type": ["float", "double"], + } + default_options = { + "shared": False, + "fPIC": True, + "floating_type": "float", + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9.3", # GCC 9.3 started supporting attributes in constructor arguments + "clang": "8", + "apple-clang": "10", + "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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("entt/3.10.3", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EDYN_CONFIG_DOUBLE"] = self.options.floating_type == "double" + tc.variables["EDYN_INSTALL"] = True + tc.variables["EDYN_BUILD_EXAMPLES"] = False + tc.variables["EDYN_BUILD_TESTS"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, pattern="*.pdb", folder=self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Edyn") + self.cpp_info.set_property("cmake_target_name", "Edyn::Edyn") + suffix = "_d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"Edyn{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs += ["m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["winmm"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Edyn" + self.cpp_info.names["cmake_find_package_multi"] = "Edyn" diff --git a/recipes/edyn/all/test_package/CMakeLists.txt b/recipes/edyn/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c81d1ceba454a --- /dev/null +++ b/recipes/edyn/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Edyn REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Edyn::Edyn) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/edyn/all/test_package/conanfile.py b/recipes/edyn/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4e578144a798a --- /dev/null +++ b/recipes/edyn/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/edyn/all/test_package/test_package.cpp b/recipes/edyn/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec6be85f6dfe0 --- /dev/null +++ b/recipes/edyn/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main() +{ + edyn::vector3 const v0{ 0, 1, 2 }; + edyn::vector3 const v1{ -2, -1, -0 }; + + std::printf("%f\n", edyn::dot(v0, v1)); + assert(edyn::dot(v0, v1) == -1); +} diff --git a/recipes/edyn/all/test_v1_package/CMakeLists.txt b/recipes/edyn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/edyn/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/edyn/all/test_v1_package/conanfile.py b/recipes/edyn/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/edyn/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/edyn/config.yml b/recipes/edyn/config.yml new file mode 100644 index 0000000000000..b230418434b61 --- /dev/null +++ b/recipes/edyn/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.1": + folder: all diff --git a/recipes/effcee/all/conandata.yml b/recipes/effcee/all/conandata.yml new file mode 100644 index 0000000000000..8e17ad0e718d0 --- /dev/null +++ b/recipes/effcee/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2019.1": + sha256: 332586221ef53a615cc6595cc54643610b1f9f77acd2862860a1eda6f03de8b9 + url: https://github.com/google/effcee/archive/refs/tags/v2019.1.zip +patches: + "2019.1": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/effcee/all/conanfile.py b/recipes/effcee/all/conanfile.py new file mode 100644 index 0000000000000..8579fbc0fec1b --- /dev/null +++ b/recipes/effcee/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class EffceeConan(ConanFile): + name = "effcee" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/effcee/" + description = "Effcee is a C++ library for stateful pattern matching" \ + " of strings, inspired by LLVM's FileCheck" + topics = ("strings", "algorithm", "matcher") + license = "Apache-2.0" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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("re2/20230301", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} shared with MT runtime not supported by msvc") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EFFCEE_BUILD_TESTING"] = False + tc.variables["EFFCEE_BUILD_SAMPLES"] = False + if self.settings.os == "Windows": + if is_msvc(self): + tc.variables["EFFCEE_ENABLE_SHARED_CRT"] = not is_msvc_static_runtime(self) + else: + # Do not force linkage to static libgcc and libstdc++ for MinGW + tc.variables["EFFCEE_ENABLE_SHARED_CRT"] = True + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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 = ["effcee"] diff --git a/recipes/effcee/all/patches/0001-fix-cmake.patch b/recipes/effcee/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..ad916f3755d34 --- /dev/null +++ b/recipes/effcee/all/patches/0001-fix-cmake.patch @@ -0,0 +1,35 @@ +Use external re2 +Fix installation of dll + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,7 +33,7 @@ include(cmake/setup_build.cmake) + include(cmake/utils.cmake) + include(GNUInstallDirs) + +-add_subdirectory(third_party) ++find_package(re2 REQUIRED CONFIG) + add_subdirectory(effcee) + add_subdirectory(fuzzer) + +--- a/effcee/CMakeLists.txt ++++ b/effcee/CMakeLists.txt +@@ -4,8 +4,8 @@ add_library(effcee + effcee_default_compile_options(effcee) + # We need to expose RE2's StringPiece. + target_include_directories(effcee +- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/.. ${EFFCEE_RE2_DIR}) +-target_link_libraries(effcee PUBLIC re2 ${CMAKE_THREADS_LIB_INIT}) ++ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..) ++target_link_libraries(effcee PUBLIC re2::re2 ${CMAKE_THREADS_LIB_INIT}) + + # TODO(dneto): Avoid installing gtest and gtest_main. ?! + install( +@@ -14,6 +14,7 @@ install( + DESTINATION + include/effcee) + install(TARGETS effcee ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + diff --git a/recipes/effcee/all/test_package/CMakeLists.txt b/recipes/effcee/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..52906cfefeb69 --- /dev/null +++ b/recipes/effcee/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(effcee REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE effcee::effcee) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/effcee/all/test_package/conanfile.py b/recipes/effcee/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/effcee/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/effcee/all/test_package/test_package.cpp b/recipes/effcee/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..74d98eec5216e --- /dev/null +++ b/recipes/effcee/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "effcee/effcee.h" + +int main(void) { + auto match = effcee::Match("foo bar qux", "foo", + effcee::Options().SetChecksName("checks")); + return 0; +} diff --git a/recipes/effcee/all/test_v1_package/CMakeLists.txt b/recipes/effcee/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/effcee/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/effcee/all/test_v1_package/conanfile.py b/recipes/effcee/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..12dd810a6ab3b --- /dev/null +++ b/recipes/effcee/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" + + 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/effcee/config.yml b/recipes/effcee/config.yml new file mode 100644 index 0000000000000..97d49d4ebd089 --- /dev/null +++ b/recipes/effcee/config.yml @@ -0,0 +1,3 @@ +versions: + "2019.1": + folder: all diff --git a/recipes/effolkronium-random/all/conandata.yml b/recipes/effolkronium-random/all/conandata.yml new file mode 100644 index 0000000000000..caf25d2461065 --- /dev/null +++ b/recipes/effolkronium-random/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.4.1": + url: "https://github.com/effolkronium/random/archive/v1.4.1.tar.gz" + sha256: "ec6beb67496ad2ce722d311d3fa5efb7e847dac5fd1c16b8920b51562fe20f53" + "1.4.0": + url: "https://github.com/effolkronium/random/archive/v1.4.0.tar.gz" + sha256: "228baa24736a409b37bbe31df40ef7537f04bfbe3921dfed3d806d4eef112632" + "1.3.1": + url: "https://github.com/effolkronium/random/archive/v1.3.1.tar.gz" + sha256: "556CD0E050D533B3C787958088C8418A337760A16230C6543FDBA6B6059A5BC0" diff --git a/recipes/effolkronium-random/all/conanfile.py b/recipes/effolkronium-random/all/conanfile.py new file mode 100644 index 0000000000000..1c77e0e87ce24 --- /dev/null +++ b/recipes/effolkronium-random/all/conanfile.py @@ -0,0 +1,31 @@ +import os + +from conans import ConanFile, tools + +class RandomConan(ConanFile): + name = "effolkronium-random" + description = "Random for modern C++ with convenient API." + license = "MIT" + topics = ("conan", "random", "header-only") + homepage = "https://github.com/effolkronium/random" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("random-" + self.version, self._source_subfolder) + + def package(self): + self.copy("LICENSE.MIT", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "effolkronium_random" + self.cpp_info.names["cmake_find_package_multi"] = "effolkronium_random" diff --git a/recipes/effolkronium-random/all/test_package/CMakeLists.txt b/recipes/effolkronium-random/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/effolkronium-random/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/effolkronium-random/all/test_package/conanfile.py b/recipes/effolkronium-random/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/effolkronium-random/all/test_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" + + 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/effolkronium-random/all/test_package/test_package.cpp b/recipes/effolkronium-random/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa94d88711809 --- /dev/null +++ b/recipes/effolkronium-random/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "effolkronium/random.hpp" + +int main( ) { + effolkronium::random_local random{ }; + auto val = random.get(-10, 10); + return 0; +} diff --git a/recipes/effolkronium-random/config.yml b/recipes/effolkronium-random/config.yml new file mode 100644 index 0000000000000..c0455a0dac1c9 --- /dev/null +++ b/recipes/effolkronium-random/config.yml @@ -0,0 +1,7 @@ +versions: + "1.4.1": + folder: "all" + "1.4.0": + folder: "all" + "1.3.1": + folder: "all" diff --git a/recipes/egl-headers/all/conandata.yml b/recipes/egl-headers/all/conandata.yml new file mode 100644 index 0000000000000..9599f3d0a9488 --- /dev/null +++ b/recipes/egl-headers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220525": + url: "https://github.com/KhronosGroup/EGL-Registry/archive/84f25dd4c04a01ea48480f7296ba9d64d435fa87.tar.gz" + sha256: "6a4cbc7cf8b9057250c5c3982939b2bf46b1c2bfe0795e1445b8f7f39bd33988" diff --git a/recipes/egl-headers/all/conanfile.py b/recipes/egl-headers/all/conanfile.py new file mode 100644 index 0000000000000..5f6e1786a60cb --- /dev/null +++ b/recipes/egl-headers/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class EglHeadersConan(ConanFile): + name = "egl-headers" + description = "EGL Header files." + license = "Apache-2.0" + topics = ("egl-headers", "egl") + homepage = "https://github.com/KhronosGroup/EGL-Registry" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("khrplatform/cci.20200529") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + license_data = load(self, os.path.join(self.source_folder, "api", "EGL", "egl.h")) + begin = license_data.find("/*") + len("/*") + end = license_data.find("*/") + license_data = license_data[begin:end] + license_data = license_data.replace("**", "") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_data) + + copy(self, "*", src=os.path.join(self.source_folder, "api", "EGL"), dst=os.path.join(self.package_folder, "include", "EGL")) + + def package_info(self): + pass diff --git a/recipes/egl-headers/all/test_package/CMakeLists.txt b/recipes/egl-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8c6a625d847ec --- /dev/null +++ b/recipes/egl-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(egl-headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} egl-headers::egl-headers) diff --git a/recipes/egl-headers/all/test_package/conanfile.py b/recipes/egl-headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/egl-headers/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/egl-headers/all/test_package/test_package.c b/recipes/egl-headers/all/test_package/test_package.c new file mode 100644 index 0000000000000..966cb253f7d85 --- /dev/null +++ b/recipes/egl-headers/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "EGL/egl.h" +#include "EGL/eglext.h" +#include +#include + +int main() { + EGLBoolean value = EGL_TRUE; + printf("EGL_TRUE: %d\n", value); + return EXIT_SUCCESS; +} diff --git a/recipes/egl-headers/all/test_v1_package/CMakeLists.txt b/recipes/egl-headers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/egl-headers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/egl-headers/all/test_v1_package/conanfile.py b/recipes/egl-headers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90f7a062ba0d0 --- /dev/null +++ b/recipes/egl-headers/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +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/egl-headers/config.yml b/recipes/egl-headers/config.yml new file mode 100644 index 0000000000000..cc6aac6874544 --- /dev/null +++ b/recipes/egl-headers/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220525": + folder: all diff --git a/recipes/egl/config.yml b/recipes/egl/config.yml new file mode 100644 index 0000000000000..131cdfe2b56d6 --- /dev/null +++ b/recipes/egl/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "system" diff --git a/recipes/egl/system/conanfile.py b/recipes/egl/system/conanfile.py new file mode 100644 index 0000000000000..7461d1a751e0c --- /dev/null +++ b/recipes/egl/system/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager + +required_conan_version = ">=1.50.0" + + +class SysConfigEGLConan(ConanFile): + name = "egl" + version = "system" + description = "cross-platform virtual conan package for the EGL support" + topics = ("opengl", "egl") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.khronos.org/egl" + license = "MIT" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipes supports only Linux and FreeBSD") + + def system_requirements(self): + dnf = package_manager.Dnf(self) + dnf.install(["mesa-libEGL-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libEGL-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install_substitutes(["libegl-dev"], ["libegl1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libglvnd"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["Mesa-libEGL-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libglvnd"], update=True, check=True) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + pkg_config = PkgConfig(self, "egl") + pkg_config.fill_cpp_info(self.cpp_info, is_system=True) diff --git a/recipes/egl/system/test_package/CMakeLists.txt b/recipes/egl/system/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b6c53602ff568 --- /dev/null +++ b/recipes/egl/system/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + + +set(SOURCES test_package.c) + +find_package(egl REQUIRED) + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} PRIVATE egl::egl) diff --git a/recipes/egl/system/test_package/conanfile.py b/recipes/egl/system/test_package/conanfile.py new file mode 100644 index 0000000000000..49ea0c6cecc47 --- /dev/null +++ b/recipes/egl/system/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", "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/egl/system/test_package/test_package.c b/recipes/egl/system/test_package/test_package.c new file mode 100644 index 0000000000000..ec2b6411cd72c --- /dev/null +++ b/recipes/egl/system/test_package/test_package.c @@ -0,0 +1,33 @@ +#include + +#include + +int main() +{ + EGLint major = 0; + EGLint minor = 0; + EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); + EGLBoolean b; + if (dpy == EGL_NO_DISPLAY) + { + printf("No display available\n"); + return 0; + } + b = eglInitialize(dpy, &major, &minor); + if(b != EGL_TRUE) + { + printf("could not initialize egl, error %d\n", eglGetError()); + return 0; + } + + printf("egl version %d.%d\n", major, minor); + + b = eglTerminate(dpy); + if(b != EGL_TRUE) + { + printf("could not terminate egl %d\n", eglGetError()); + return 0; + } + + return 0; +} diff --git a/recipes/egl/system/test_v1_package/CMakeLists.txt b/recipes/egl/system/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a8ae2ad50945 --- /dev/null +++ b/recipes/egl/system/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_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/egl/system/test_v1_package/conanfile.py b/recipes/egl/system/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1d0bdd3779793 --- /dev/null +++ b/recipes/egl/system/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" + + 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/eigen/all/conandata.yml b/recipes/eigen/all/conandata.yml new file mode 100644 index 0000000000000..c035b5ceb11c3 --- /dev/null +++ b/recipes/eigen/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "3.4.0": + url: "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2" + sha256: "b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626" + "3.3.9": + url: "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.bz2" + sha256: "0fa5cafe78f66d2b501b43016858070d52ba47bd9b1016b0165a7b8e04675677" + "3.3.8": + url: "https://gitlab.com/libeigen/eigen/-/archive/3.3.8/eigen-3.3.8.tar.bz2" + sha256: "0215c6593c4ee9f1f7f28238c4e8995584ebf3b556e9dbf933d84feb98d5b9ef" + "3.3.7": + url: "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.bz2" + sha256: "685adf14bd8e9c015b78097c1dc22f2f01343756f196acdc76a678e1ae352e11" +patches: + "3.4.0": + - patch_file: "patches/3.4.0-0001-vec-reduce-half.patch" + patch_description: "Fix vectorized reductions compilation errors for Eigen::half" + patch_type: "bugfix" + patch_source: "https://gitlab.com/libeigen/eigen/-/commit/b0fe14213ec4c8615de485fe4c2bcd4bab0cbd19.patch" + "3.3.9": + - patch_file: "patches/0002-cmake-minimum-required.patch" + patch_description: "CMake: Move cmake_minimum_required() before project()" + patch_type: "conan" + "3.3.8": + - patch_file: "patches/0001-assert-exception-upstream-issue-2011.patch" + - patch_file: "patches/0002-cmake-minimum-required.patch" + patch_description: "CMake: Move cmake_minimum_required() before project()" + patch_type: "conan" + "3.3.7": + - patch_file: "patches/0002-cmake-minimum-required.patch" + patch_description: "CMake: Move cmake_minimum_required() before project()" + patch_type: "conan" diff --git a/recipes/eigen/all/conanfile.py b/recipes/eigen/all/conanfile.py new file mode 100644 index 0000000000000..c97c160c28920 --- /dev/null +++ b/recipes/eigen/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir +import os + +required_conan_version = ">=1.52.0" + + +class EigenConan(ConanFile): + name = "eigen" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://eigen.tuxfamily.org" + description = "Eigen is a C++ template library for linear algebra: matrices, vectors," \ + " numerical solvers, and related algorithms." + topics = ("algebra", "linear-algebra", "matrix", "vector", "numerical", "header-only") + package_type = "header-library" + license = ("MPL-2.0", "LGPL-3.0-or-later") # Taking into account the default value of MPL2_only option + + settings = "os", "arch", "compiler", "build_type" + options = { + "MPL2_only": [True, False], + } + default_options = { + "MPL2_only": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.license = "MPL-2.0" if self.options.MPL2_only else ("MPL-2.0", "LGPL-3.0-or-later") + + def layout(self): + cmake_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) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.cache_variables["EIGEN_TEST_NOQT"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + copy(self, "COPYING.*", self.source_folder, os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Eigen3") + self.cpp_info.set_property("cmake_target_name", "Eigen3::Eigen") + self.cpp_info.set_property("pkg_config_name", "eigen3") + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["eigen3"].bindirs = [] + self.cpp_info.components["eigen3"].libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["eigen3"].system_libs = ["m"] + if self.options.MPL2_only: + self.cpp_info.components["eigen3"].defines = ["EIGEN_MPL2_ONLY"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "Eigen3" + self.cpp_info.names["cmake_find_package_multi"] = "Eigen3" + self.cpp_info.names["pkg_config"] = "eigen3" + self.cpp_info.components["eigen3"].names["cmake_find_package"] = "Eigen" + self.cpp_info.components["eigen3"].names["cmake_find_package_multi"] = "Eigen" + self.cpp_info.components["eigen3"].set_property("cmake_target_name", "Eigen3::Eigen") + self.cpp_info.components["eigen3"].includedirs = [os.path.join("include", "eigen3")] diff --git a/recipes/eigen/all/patches/0001-assert-exception-upstream-issue-2011.patch b/recipes/eigen/all/patches/0001-assert-exception-upstream-issue-2011.patch new file mode 100644 index 0000000000000..91ba0d61f8f6f --- /dev/null +++ b/recipes/eigen/all/patches/0001-assert-exception-upstream-issue-2011.patch @@ -0,0 +1,46 @@ +diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h +index 67b2442b53a114af3c08829af4344acc6be7a42f..a3cc05b77bbd19466e7f969d37ec18085ba3d36c 100644 +--- a/Eigen/src/Core/products/Parallelizer.h ++++ b/Eigen/src/Core/products/Parallelizer.h +@@ -132,8 +132,7 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, + + ei_declare_aligned_stack_constructed_variable(GemmParallelInfo,info,threads,0); + +- int errorCount = 0; +- #pragma omp parallel num_threads(threads) reduction(+: errorCount) ++ #pragma omp parallel num_threads(threads) + { + Index i = omp_get_thread_num(); + // Note that the actual number of threads might be lower than the number of request ones. +@@ -152,14 +151,11 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, + info[i].lhs_start = r0; + info[i].lhs_length = actualBlockRows; + +- EIGEN_TRY { +- if(transpose) func(c0, actualBlockCols, 0, rows, info); +- else func(0, rows, c0, actualBlockCols, info); +- } EIGEN_CATCH(...) { +- ++errorCount; +- } ++ if(transpose) ++ func(c0, actualBlockCols, 0, rows, info); ++ else ++ func(0, rows, c0, actualBlockCols, info); + } +- if (errorCount) EIGEN_THROW_X(Eigen::eigen_assert_exception()); + #endif + } + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 0747aa6cb65a40a47fdee2685a2798f93c481ea0..b0257778082143ce27fc847cf163e845fa2afd1e 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -163,7 +163,7 @@ ei_add_test(constructor) + ei_add_test(linearstructure) + ei_add_test(integer_types) + ei_add_test(unalignedcount) +-if(NOT EIGEN_TEST_NO_EXCEPTIONS) ++if(NOT EIGEN_TEST_NO_EXCEPTIONS AND NOT EIGEN_TEST_OPENMP) + ei_add_test(exceptions) + endif() + ei_add_test(redux) diff --git a/recipes/eigen/all/patches/0002-cmake-minimum-required.patch b/recipes/eigen/all/patches/0002-cmake-minimum-required.patch new file mode 100644 index 0000000000000..ed2fc38f4da97 --- /dev/null +++ b/recipes/eigen/all/patches/0002-cmake-minimum-required.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ ++cmake_minimum_required(VERSION 2.8.5) + project(Eigen3) + +-cmake_minimum_required(VERSION 2.8.5) + + # guard against in-source builds + diff --git a/recipes/eigen/all/patches/3.4.0-0001-vec-reduce-half.patch b/recipes/eigen/all/patches/3.4.0-0001-vec-reduce-half.patch new file mode 100644 index 0000000000000..3ab79a576da93 --- /dev/null +++ b/recipes/eigen/all/patches/3.4.0-0001-vec-reduce-half.patch @@ -0,0 +1,49 @@ +From b0fe14213ec4c8615de485fe4c2bcd4bab0cbd19 Mon Sep 17 00:00:00 2001 +From: Alex Druinsky +Date: Wed, 20 Oct 2021 16:03:12 -0700 +Subject: [PATCH] Fix vectorized reductions for Eigen::half + +Fixes compiler errors in expressions that look like + + Eigen::Matrix::Random().maxCoeff() + +The error comes from the code that creates the initial value for +vectorized reductions. The fix is to specify the scalar type of the +reduction's initial value. + +The cahnge is necessary for Eigen::half because unlike other types, +Eigen::half scalars cannot be implicitly created from integers. + + +(cherry picked from commit d0e3791b1a0e2db9edd5f1d1befdb2ac5a40efe0) +--- + Eigen/src/Core/PartialReduxEvaluator.h | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/Eigen/src/Core/PartialReduxEvaluator.h b/Eigen/src/Core/PartialReduxEvaluator.h +index 29abf35b99..17c06f0783 100644 +--- a/Eigen/src/Core/PartialReduxEvaluator.h ++++ b/Eigen/src/Core/PartialReduxEvaluator.h +@@ -54,12 +54,17 @@ struct packetwise_redux_traits + /* Value to be returned when size==0 , by default let's return 0 */ + template + EIGEN_DEVICE_FUNC +-PacketType packetwise_redux_empty_value(const Func& ) { return pset1(0); } ++PacketType packetwise_redux_empty_value(const Func& ) { ++ const typename unpacket_traits::type zero(0); ++ return pset1(zero); ++} + + /* For products the default is 1 */ + template + EIGEN_DEVICE_FUNC +-PacketType packetwise_redux_empty_value(const scalar_product_op& ) { return pset1(1); } ++PacketType packetwise_redux_empty_value(const scalar_product_op& ) { ++ return pset1(Scalar(1)); ++} + + /* Perform the actual reduction */ + template +#include +#include + + +int main(void) +{ + int const N = 5; + Eigen::MatrixXi A(N, N); + A.setRandom(); + + std::cout << "A =\n" << A << "\n\n" + << "A(2..3,:) =\n" << A.middleRows(2, 2) << "\n"; + + return 0; +} diff --git a/recipes/eigen/all/test_v1_package/CMakeLists.txt b/recipes/eigen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/eigen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/eigen/all/test_v1_package/conanfile.py b/recipes/eigen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..41edcae379d5b --- /dev/null +++ b/recipes/eigen/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/eigen/config.yml b/recipes/eigen/config.yml new file mode 100644 index 0000000000000..13a66d304efa9 --- /dev/null +++ b/recipes/eigen/config.yml @@ -0,0 +1,9 @@ +versions: + "3.4.0": + folder: all + "3.3.9": + folder: all + "3.3.8": + folder: all + "3.3.7": + folder: all diff --git a/recipes/elfio/all/conandata.yml b/recipes/elfio/all/conandata.yml new file mode 100644 index 0000000000000..f57351ff19434 --- /dev/null +++ b/recipes/elfio/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.11": + sha256: 3307b104c205399786edbba203906de9517e36297709fe747faf9478d55fbb91 + url: https://github.com/serge1/ELFIO/releases/download/Release_3.11/elfio-3.11.tar.gz + "3.10": + sha256: cdc6362ede2e0c8d1d6db15d7da4b526f461d9cfae6f6337369e416a8bc60234 + url: https://github.com/serge1/ELFIO/releases/download/Release_3.10/elfio-3.10.tar.gz + "3.9": + sha256: 767b269063fc35aba6d361139f830aa91c45dc6b77942f082666876c1aa0be0f + url: https://github.com/serge1/ELFIO/releases/download/Release_3.9/elfio-3.9.tar.gz + "3.8": + sha256: 9553ce2b8d8aa2fb43f0e9be9bcbd10cd52f40b385110ea54173889c982f9ac4 + url: https://github.com/serge1/ELFIO/releases/download/Release_3.8/elfio-3.8.tar.gz diff --git a/recipes/elfio/all/conanfile.py b/recipes/elfio/all/conanfile.py new file mode 100644 index 0000000000000..eef05956d7282 --- /dev/null +++ b/recipes/elfio/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class ElfioConan(ConanFile): + name = "elfio" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://elfio.sourceforge.net" + description = "A header-only C++ library that provides a simple interface for reading and generating files in ELF binary format." + topics = ("elfio", "elf") + license = "MIT" + 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"): + if Version(self.version) < "3.11": + check_min_cppstd(self, 11) + else: + check_min_cppstd(self, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy( + self, + pattern=os.path.join("elfio", "*.hpp"), + src=self.source_folder, + dst=os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/elfio/all/test_package/CMakeLists.txt b/recipes/elfio/all/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..6fa586f7cb943 --- /dev/null +++ b/recipes/elfio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(elfio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE elfio::elfio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/elfio/all/test_package/conanfile.py b/recipes/elfio/all/test_package/conanfile.py new file mode 100755 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/elfio/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/elfio/all/test_package/test_package.cpp b/recipes/elfio/all/test_package/test_package.cpp new file mode 100755 index 0000000000000..08728f016b554 --- /dev/null +++ b/recipes/elfio/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ + +#include +#include + +using namespace ELFIO; + +int main() { + // just check we can create an reader, that means the recipe works + elfio reader; + if ( !reader.load( "/does/not/exist" ) ) { + return EXIT_SUCCESS; + } + return EXIT_FAILURE; +} diff --git a/recipes/elfio/all/test_v1_package/CMakeLists.txt b/recipes/elfio/all/test_v1_package/CMakeLists.txt new file mode 100755 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/elfio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/elfio/all/test_v1_package/conanfile.py b/recipes/elfio/all/test_v1_package/conanfile.py new file mode 100755 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/elfio/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/elfio/config.yml b/recipes/elfio/config.yml new file mode 100644 index 0000000000000..387fbf23f814b --- /dev/null +++ b/recipes/elfio/config.yml @@ -0,0 +1,9 @@ +versions: + "3.11": + folder: all + "3.10": + folder: all + "3.9": + folder: all + "3.8": + folder: all diff --git a/recipes/elfutils/all/conandata.yml b/recipes/elfutils/all/conandata.yml new file mode 100644 index 0000000000000..85717c37cac04 --- /dev/null +++ b/recipes/elfutils/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "0.186": + url: "https://sourceware.org/elfutils/ftp/0.186/elfutils-0.186.tar.bz2" + sha256: "7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177" + "0.180": + url: "https://sourceware.org/elfutils/ftp/0.180/elfutils-0.180.tar.bz2" + sha256: "b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d" +patches: + "0.186": + - base_path: "source_subfolder" + patch_file: "patches/0.186-0001-Add-enable-werror-configure-option.patch" + - base_path: "source_subfolder" + patch_file: "patches/0.186-0002-add-enable-static-option-to-configure.patch" + "0.180": + - base_path: "source_subfolder" + patch_file: "patches/0.180-0001-Add-enable-werror-configure-option.patch" + - base_path: "source_subfolder" + patch_file: "patches/0.180-0002-add-enable-static-option-to-configure.patch" diff --git a/recipes/elfutils/all/conanfile.py b/recipes/elfutils/all/conanfile.py new file mode 100644 index 0000000000000..caefeb2a118b9 --- /dev/null +++ b/recipes/elfutils/all/conanfile.py @@ -0,0 +1,235 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os +import glob + +required_conan_version = ">=1.33.0" + +class ElfutilsConan(ConanFile): + name = "elfutils" + description = "A dwarf, dwfl and dwelf functions to read DWARF, find separate debuginfo, symbols and inspect process state." + homepage = "https://sourceware.org/elfutils" + url = "https://github.com/conan-io/conan-center-index" + topics = ("elfutils", "libelf", "libdw", "libasm") + license = ["GPL-1.0-or-later", "LGPL-3.0-or-later", "GPL-2.0-or-later"] + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "debuginfod": [True, False], + "libdebuginfod": [True, False], + "with_bzlib": [True, False], + "with_lzma": [True, False], + "with_sqlite3": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "debuginfod": False, + "libdebuginfod": False, + "with_bzlib": True, + "with_lzma": True, + "with_sqlite3": False, + } + + generators = "pkg_config" + + _autotools = None + _source_subfolder = "source_subfolder" + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + if tools.Version(self.version) < "0.186": + del self.options.libdebuginfod + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if tools.Version(self.version) >= "0.186": + if self.settings.compiler in ["Visual Studio", "apple-clang", "msvc"]: + raise ConanInvalidConfiguration("Compiler %s not supported. " + "elfutils only supports gcc and clang" % self.settings.compiler) + else: + if self.settings.compiler in ["Visual Studio", "clang", "apple-clang", "msvc"]: + raise ConanInvalidConfiguration("Compiler %s not supported. " + "elfutils only supports gcc" % self.settings.compiler) + if self.settings.compiler != "gcc": + self.output.warn("Compiler %s is not gcc." % self.settings.compiler) + + def requirements(self): + self.requires("zlib/1.2.12") + if self.options.with_sqlite3: + self.requires("sqlite3/3.38.5") + if self.options.with_bzlib: + self.requires("bzip2/1.0.8") + if self.options.with_lzma: + self.requires("xz_utils/5.2.5") + if self.options.get_safe("libdebuginfod"): + self.requires("libcurl/7.83.0") + if self.options.debuginfod: + # FIXME: missing recipe for libmicrohttpd + raise ConanInvalidConfiguration("libmicrohttpd is not available (yet) on CCI") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires("automake/1.16.4") + self.build_requires("m4/1.4.19") + self.build_requires("flex/2.6.4") + self.build_requires("bison/3.7.6") + self.build_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _configure_autotools(self): + if not self._autotools: + args = [ + "--disable-werror", + "--enable-static={}".format("no" if self.options.shared else "yes"), + "--enable-deterministic-archives", + "--enable-silent-rules", + "--with-zlib", + "--with-bzlib" if self.options.with_bzlib else "--without-bzlib", + "--with-lzma" if self.options.with_lzma else "--without-lzma", + "--enable-debuginfod" if self.options.debuginfod else "--disable-debuginfod", + ] + if tools.Version(self.version) >= "0.186": + args.append("--enable-libdebuginfod" if self.options.libdebuginfod else "--disable-libdebuginfod") + args.append('BUILD_STATIC={}'.format("0" if self.options.shared else "1")) + + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.configure(configure_dir=self._source_subfolder, args=args) + return self._autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + with tools.chdir(self._source_subfolder): + self.run("autoreconf -fiv") + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.options.shared: + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a") + else: + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so") + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so.1") + + 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["libdw"].libs = ["dw"] + self.cpp_info.components["libdw"].requires = ["libelf", "zlib::zlib"] + if self.options.with_bzlib: + self.cpp_info.components["libdw"].requires.append("bzip2::bzip2") + if self.options.with_lzma: + self.cpp_info.components["libdw"].requires.append("xz_utils::xz_utils") + + self.cpp_info.components["libasm"].includedirs = ["include/elfutils"] + self.cpp_info.components["libasm"].libs = ["asm"] + self.cpp_info.components["libasm"].requires = ["libelf", "libdw"] + + if self.options.get_safe("libdebuginfod"): + self.cpp_info.components["libdebuginfod"].libs = ["debuginfod"] + self.cpp_info.components["libdebuginfod"].requires = ["libcurl::curl"] + + # utilities + 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) + + bin_ext = ".exe" if self.settings.os == "Windows" else "" + + addr2line = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-addr2line" + bin_ext)) + self.output.info("Setting ADDR2LINE to {}".format(addr2line)) + self.env_info.ADDR2LINE = addr2line + + ar = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-ar" + bin_ext)) + self.output.info("Setting AR to {}".format(ar)) + self.env_info.AR = ar + + elfclassify = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elfclassify" + bin_ext)) + self.output.info("Setting ELFCLASSIFY to {}".format(elfclassify)) + self.env_info.ELFCLASSIFY = elfclassify + + elfcmp = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elfcmp" + bin_ext)) + self.output.info("Setting ELFCMP to {}".format(elfcmp)) + self.env_info.ELFCMP = elfcmp + + elfcompress = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elfcompress" + bin_ext)) + self.output.info("Setting ELFCOMPRESS to {}".format(elfcompress)) + self.env_info.ELFCOMPRESS = elfcompress + + elflint = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elflint" + bin_ext)) + self.output.info("Setting ELFLINT to {}".format(elflint)) + self.env_info.ELFLINT = elflint + + findtextrel = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-findtextrel" + bin_ext)) + self.output.info("Setting FINDTEXTREL to {}".format(findtextrel)) + self.env_info.FINDTEXTREL = findtextrel + + make_debug_archive = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-make-debug-archive" + bin_ext)) + self.output.info("Setting MAKE_DEBUG_ARCHIVE to {}".format(make_debug_archive)) + self.env_info.MAKE_DEBUG_ARCHIVE = make_debug_archive + + nm = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-nm" + bin_ext)) + self.output.info("Setting NM to {}".format(nm)) + self.env_info.NM = nm + + objdump = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-objdump" + bin_ext)) + self.output.info("Setting OBJDUMP to {}".format(objdump)) + self.env_info.OBJDUMP = objdump + + ranlib = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-ranlib" + bin_ext)) + self.output.info("Setting RANLIB to {}".format(ranlib)) + self.env_info.RANLIB = ranlib + + readelf = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-readelf" + bin_ext)) + self.output.info("Setting READELF to {}".format(readelf)) + self.env_info.READELF = readelf + + size = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-size" + bin_ext)) + self.output.info("Setting SIZE to {}".format(size)) + self.env_info.SIZE = size + + stack = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-stack" + bin_ext)) + self.output.info("Setting STACK to {}".format(stack)) + self.env_info.STACK = stack + + strings = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-strings" + bin_ext)) + self.output.info("Setting STRINGS to {}".format(strings)) + self.env_info.STRINGS = strings + + strip = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-strip" + bin_ext)) + self.output.info("Setting STRIP to {}".format(strip)) + self.env_info.STRIP = strip + + unstrip = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-unstrip" + bin_ext)) + self.output.info("Setting UNSTRIP to {}".format(unstrip)) + self.env_info.UNSTRIP = unstrip + diff --git a/recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch b/recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch new file mode 100644 index 0000000000000..332c215103f1f --- /dev/null +++ b/recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch @@ -0,0 +1,41 @@ +--- config/eu.am ++++ config/eu.am +@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ + -Wold-style-definition -Wstrict-prototypes -Wtrampolines \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ +@@ -83,7 +82,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \ + -Wtrampolines \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ +diff --git a/source/source_subfolder/configure.ac b/source/source_subfolder/configure.ac +index 74cc749..634858d 100644 +--- configure.ac ++++ configure.ac +@@ -294,6 +294,18 @@ + esac + AC_SUBST([DEBUGPRED], $use_debugpred_val) + ++dnl Enable -Werror ++AC_MSG_CHECKING([whether to treat warnings as errors]) ++AC_ARG_ENABLE([werror], ++AS_HELP_STRING([--enable-werror],[treat warnings as errors]), ++[werror=$enableval], [werror=yes]) ++if test "x$werror" = xyes; then ++ AC_MSG_RESULT([yes]) ++ CFLAGS="$CFLAGS -Werror" ++else ++ AC_MSG_RESULT([no]) ++fi ++ + dnl Enable gprof suport. + AC_ARG_ENABLE([gprof], + AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) diff --git a/recipes/elfutils/all/patches/0.180-0002-add-enable-static-option-to-configure.patch b/recipes/elfutils/all/patches/0.180-0002-add-enable-static-option-to-configure.patch new file mode 100644 index 0000000000000..8b2b35602af06 --- /dev/null +++ b/recipes/elfutils/all/patches/0.180-0002-add-enable-static-option-to-configure.patch @@ -0,0 +1,29 @@ +--- configure.ac ++++ configure.ac +@@ -393,8 +393,25 @@ + [install_elfh=$enableval], [install_elfh=no]) + AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes) + ++ ++AC_MSG_CHECKING([whether to build elfutils as a static library]) ++AC_ARG_ENABLE([static], ++AS_HELP_STRING([--enable-static],[build elfutils as static libraries]), ++[static_elfutils=$enableval], [static_elfutils=no]) ++ ++static_elfutils=$static_elfutils ++ ++if test "$static_elfutils" = yes ; then ++ AC_MSG_RESULT([yes]) ++else ++ if test "$use_gprof" = yes -o "$use_gcov" = yes ; then ++ AC_MSG_ERROR([cannot build a shared elfutils with gprof or gcov enabled]) ++ fi ++ AC_MSG_RESULT([no]) ++fi ++ + AM_CONDITIONAL(BUILD_STATIC, [dnl +-test "$use_gprof" = yes -o "$use_gcov" = yes]) ++test "$static_elfutils" = yes]) + + AC_ARG_ENABLE([tests-rpath], + AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), diff --git a/recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch b/recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch new file mode 100644 index 0000000000000..789694c1fe951 --- /dev/null +++ b/recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch @@ -0,0 +1,41 @@ +--- config/eu.am ++++ config/eu.am +@@ -91,7 +91,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ + -Wold-style-definition -Wstrict-prototypes $(TRAMPOLINES_WARNING) \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \ +@@ -101,7 +101,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \ + $(TRAMPOLINES_WARNING) \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \ +diff --git a/source/source_subfolder/configure.ac b/source/source_subfolder/configure.ac +index 74cc749..634858d 100644 +--- configure.ac ++++ configure.ac +@@ -262,6 +262,18 @@ + esac + AC_SUBST([DEBUGPRED], $use_debugpred_val) + ++dnl Enable -Werror ++AC_MSG_CHECKING([whether to treat warnings as errors]) ++AC_ARG_ENABLE([werror], ++AS_HELP_STRING([--enable-werror],[treat warnings as errors]), ++[werror=$enableval], [werror=yes]) ++if test "x$werror" = xyes; then ++ AC_MSG_RESULT([yes]) ++ CFLAGS="$CFLAGS -Werror" ++else ++ AC_MSG_RESULT([no]) ++fi ++ + dnl Enable gprof support. + AC_ARG_ENABLE([gprof], + AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) diff --git a/recipes/elfutils/all/patches/0.186-0002-add-enable-static-option-to-configure.patch b/recipes/elfutils/all/patches/0.186-0002-add-enable-static-option-to-configure.patch new file mode 100644 index 0000000000000..440b815d4edbf --- /dev/null +++ b/recipes/elfutils/all/patches/0.186-0002-add-enable-static-option-to-configure.patch @@ -0,0 +1,29 @@ +--- configure.ac ++++ configure.ac +@@ -364,8 +364,25 @@ + [install_elfh=$enableval], [install_elfh=no]) + AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes) + ++ ++AC_MSG_CHECKING([whether to build elfutils as a static library]) ++AC_ARG_ENABLE([static], ++AS_HELP_STRING([--enable-static],[build elfutils as static libraries]), ++[static_elfutils=$enableval], [static_elfutils=no]) ++ ++static_elfutils=$static_elfutils ++ ++if test "$static_elfutils" = yes ; then ++ AC_MSG_RESULT([yes]) ++else ++ if test "$use_gprof" = yes -o "$use_gcov" = yes ; then ++ AC_MSG_ERROR([cannot build a shared elfutils with gprof or gcov enabled]) ++ fi ++ AC_MSG_RESULT([no]) ++fi ++ + AM_CONDITIONAL(BUILD_STATIC, [dnl +-test "$use_gprof" = yes -o "$use_gcov" = yes]) ++test "$static_elfutils" = yes]) + + AC_ARG_ENABLE([tests-rpath], + AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), diff --git a/recipes/elfutils/all/test_package/CMakeLists.txt b/recipes/elfutils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/elfutils/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/elfutils/all/test_package/conanfile.py b/recipes/elfutils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a92de2cf5935 --- /dev/null +++ b/recipes/elfutils/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + self.run("eu-ar --version", run_environment=True) + + bin_path = os.path.join("bin", "test_package") + archive_path = "archive.a" + + self.run("eu-ar r {0} {1}".format(archive_path, bin_path), run_environment=True) + self.run("eu-objdump -d {0}".format(bin_path), run_environment=True) + if not tools.cross_building(self.settings): + self.run("{} {}".format(bin_path, bin_path), run_environment=True) + + self.run("{} {}".format(bin_path, archive_path), run_environment=True) diff --git a/recipes/elfutils/all/test_package/test_package.c b/recipes/elfutils/all/test_package/test_package.c new file mode 100644 index 0000000000000..cfd9d1d529b48 --- /dev/null +++ b/recipes/elfutils/all/test_package/test_package.c @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +//#include +#include +#include + +#include +#include + +#include +#ifdef _MSC_VER +#include +#else +#include +#endif + +int main(int argc , char **argv) +{ + int fd; + Elf *e; + const char *k; + Elf_Kind ek; + + + if (argc < 2) + { + printf("Usage: %s ", argv[0]); + return -1; + } + + + if (elf_version(EV_CURRENT) == EV_NONE) { + printf("ELF library initialization failed: %s\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + +#ifdef _WIN32 + return EXIT_SUCCESS; +#endif + +#ifdef _MSVC_VER + if ((fd = _open(argv[1], _O_RDONLY , 0)) < 0) { +#else + if ((fd = open(argv[1], O_RDONLY , 0)) < 0) { +#endif + printf("open %s failed\n", argv [0]); + return EXIT_FAILURE; + } + + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + printf("elf_begin () failed: %s.\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + + ek = elf_kind(e); + + switch (ek) { + case ELF_K_AR: + k = "ar(1) archive"; + break; + case ELF_K_ELF: + k = "elf object"; + break; + case ELF_K_NONE: + k = "data"; + break; + default: + k = "unrecognized"; + } + + printf("%s: %s\n", argv[1], k); + elf_end(e); + +#ifdef _MSVC_VER + _close(fd); +#else + close(fd); +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/elfutils/config.yml b/recipes/elfutils/config.yml new file mode 100644 index 0000000000000..837391aa2d05d --- /dev/null +++ b/recipes/elfutils/config.yml @@ -0,0 +1,5 @@ +versions: + "0.186": + folder: all + "0.180": + folder: all diff --git a/recipes/embree3/all/conandata.yml b/recipes/embree3/all/conandata.yml new file mode 100644 index 0000000000000..231d0eaa13377 --- /dev/null +++ b/recipes/embree3/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "3.13.5": + url: "https://github.com/embree/embree/archive/refs/tags/v3.13.5.tar.gz" + sha256: "b8c22d275d9128741265537c559d0ea73074adbf2f2b66b0a766ca52c52d665b" + "3.13.3": + url: "https://github.com/embree/embree/archive/refs/tags/v3.13.3.tar.gz" + sha256: "74ec785afb8f14d28ea5e0773544572c8df2e899caccdfc88509f1bfff58716f" + "3.13.1": + url: "https://github.com/embree/embree/archive/refs/tags/v3.13.1.tar.gz" + sha256: "00dbd852f19ae2b95f5106dd055ca4b304486436ced0ccf842aec4e38a4df425" + "3.12.0": + url: "https://github.com/embree/embree/archive/refs/tags/v3.12.0.tar.gz" + sha256: "f3646977c45a9ece1fb0cfe107567adcc645b1c77c27b36572d0aa98b888190c" +patches: + "3.13.5": + - patch_file: "patches/3.13.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "portability" + patch_source: "https://github.com/embree/embree/pull/406" + "3.13.3": + - patch_file: "patches/3.13.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "portability" + patch_source: "https://github.com/embree/embree/pull/406" + "3.13.1": + - patch_file: "patches/3.13.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "portability" + patch_source: "https://github.com/embree/embree/pull/406" + "3.12.0": + - patch_file: "patches/3.12.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "portability" + patch_source: "https://github.com/embree/embree/pull/406" diff --git a/recipes/embree3/all/conanfile.py b/recipes/embree3/all/conanfile.py new file mode 100644 index 0000000000000..326d9d376218a --- /dev/null +++ b/recipes/embree3/all/conanfile.py @@ -0,0 +1,276 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rm, rmdir, save +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version +import glob +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class EmbreeConan(ConanFile): + name = "embree3" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + topics = ("embree", "raytracing", "rendering") + description = "Intel's collection of high-performance ray tracing kernels." + homepage = "https://embree.github.io/" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "sse2": [True, False], + "sse42": [True, False], + "avx": [True, False], + "avx2": [True, False], + "avx512": [True, False], + "neon": [True, False], + "neon2x": [True, False], + "geometry_curve": [True, False], + "geometry_grid": [True, False], + "geometry_instance": [True, False], + "geometry_quad": [True, False], + "geometry_subdivision": [True, False], + "geometry_triangle": [True, False], + "geometry_user": [True, False], + "ray_packets": [True, False], + "ray_masking": [True, False], + "backface_culling": [True, False], + "ignore_invalid_rays": [True, False], + "with_tbb": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "sse2": True, + "sse42": False, + "avx": False, + "avx2": False, + "avx512": False, + "neon": False, + "neon2x": False, + "geometry_curve": True, + "geometry_grid": True, + "geometry_instance": True, + "geometry_quad": True, + "geometry_subdivision": True, + "geometry_triangle": True, + "geometry_user": True, + "ray_packets": True, + "ray_masking": False, + "backface_culling": False, + "ignore_invalid_rays": False, + "with_tbb": False, + } + + @property + def _has_sse_avx(self): + return self.settings.arch in ["x86", "x86_64"] + + @property + def _embree_has_neon_support(self): + return Version(self.version) >= "3.13.0" + + @property + def _embree_has_neon2x_support(self): + return Version(self.version) >= "3.13.4" + + @property + def _has_neon(self): + return "arm" in self.settings.arch + + @property + def _has_neon2x(self): + return "arm" in self.settings.arch and is_apple_os(self) + + @property + def _num_isa(self): + num_isa = 0 + if self._has_neon: + if self._embree_has_neon_support and self.options.neon: + num_isa += 1 + if self._embree_has_neon2x_support and self.options.neon2x: + num_isa += 1 + for simd_option in ["sse2", "sse42", "avx", "avx2", "avx512"]: + if self.options.get_safe(simd_option): + num_isa += 1 + return num_isa + + 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_sse_avx: + del self.options.sse2 + del self.options.sse42 + del self.options.avx + del self.options.avx2 + del self.options.avx512 + if not self._has_neon: + del self.options.neon + del self.options.neon2x + else: + if not self._embree_has_neon_support: + del self.options.neon + if not self._embree_has_neon2x_support: + del self.options.neon2x + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_tbb: + self.requires("onetbb/2021.7.0") + + def validate(self): + if not (self._has_sse_avx or (self._embree_has_neon_support and self._has_neon)): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {self.settings.arch}") + + compiler_version = Version(self.settings.compiler.version) + if self.settings.compiler == "clang" and compiler_version < "4": + raise ConanInvalidConfiguration("Clang < 4 is not supported") + + check_min_vs(self, 191) + + if self.settings.os == "Linux" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} cannot be built with clang libc++, use libstdc++ instead") + + if self.settings.compiler == "apple-clang" and not self.options.shared and compiler_version >= "9.0" and self._num_isa > 1: + raise ConanInvalidConfiguration(f"{self.ref} static with apple-clang >=9 and multiple ISA (simd) is not supported") + + if self._num_isa == 0: + raise ConanInvalidConfiguration("At least one ISA (simd) must be enabled") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EMBREE_STATIC_LIB"] = not self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["EMBREE_TUTORIALS"] = False + tc.variables["EMBREE_GEOMETRY_CURVE"] = self.options.geometry_curve + tc.variables["EMBREE_GEOMETRY_GRID"] = self.options.geometry_grid + tc.variables["EMBREE_GEOMETRY_INSTANCE"] = self.options.geometry_instance + tc.variables["EMBREE_GEOMETRY_QUAD"] = self.options.geometry_quad + tc.variables["EMBREE_GEOMETRY_SUBDIVISION"] = self.options.geometry_subdivision + tc.variables["EMBREE_GEOMETRY_TRIANGLE"] = self.options.geometry_triangle + tc.variables["EMBREE_GEOMETRY_USER"] = self.options.geometry_user + tc.variables["EMBREE_RAY_PACKETS"] = self.options.ray_packets + tc.variables["EMBREE_RAY_MASK"] = self.options.ray_masking + tc.variables["EMBREE_BACKFACE_CULLING"] = self.options.backface_culling + tc.variables["EMBREE_IGNORE_INVALID_RAYS"] = self.options.ignore_invalid_rays + tc.variables["EMBREE_ISPC_SUPPORT"] = False + tc.variables["EMBREE_TASKING_SYSTEM"] = "TBB" if self.options.with_tbb else "INTERNAL" + tc.variables["EMBREE_MAX_ISA"] = "NONE" + if self._embree_has_neon_support: + tc.variables["EMBREE_ISA_NEON"] = self.options.get_safe("neon", False) + if self._embree_has_neon2x_support: + tc.variables["EMBREE_ISA_NEON2X"] = self.options.get_safe("neon2x", False) + + tc.variables["EMBREE_ISA_SSE2"] = self.options.get_safe("sse2", False) + tc.variables["EMBREE_ISA_SSE42"] = self.options.get_safe("sse42", False) + tc.variables["EMBREE_ISA_AVX"] = self.options.get_safe("avx", False) + tc.variables["EMBREE_ISA_AVX2"] = self.options.get_safe("avx2", False) + if Version(self.version) < "3.12.2": + # TODO: probably broken if avx512 enabled, must cumbersome to add specific options in the recipe + tc.variables["EMBREE_ISA_AVX512KNL"] = self.options.get_safe("avx512", False) + tc.variables["EMBREE_ISA_AVX512SKX"] = self.options.get_safe("avx512", False) + else: + tc.variables["EMBREE_ISA_AVX512"] = self.options.get_safe("avx512", False) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # some compilers (e.g. clang) do not like UTF-16 sources + rc = os.path.join(self.source_folder, "kernels", "embree.rc") + content = load(self, rc, encoding="utf_16_le") + if content[0] == '\ufeff': + content = content[1:] + content = "#pragma code_page(65001)\n" + content + save(self, rc, content) + os.remove(os.path.join(self.source_folder, "common", "cmake", "FindTBB.cmake")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.command", os.path.join(self.package_folder)) + rm(self, "*.cmake", os.path.join(self.package_folder)) + + if self.settings.os == "Windows" and self.options.shared: + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, dll_pattern_to_remove, os.path.join(self.package_folder, "bin")) + else: + rmdir(self, 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( + os.path.join(self.package_folder, self._module_file_rel_path), + {"embree": "embree::embree"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "embree") + self.cpp_info.set_property("cmake_target_name", "embree") + + def _lib_exists(name): + return bool(glob.glob(os.path.join(self.package_folder, "lib", f"*{name}.*"))) + + self.cpp_info.libs = ["embree3"] + if not self.options.shared: + self.cpp_info.libs.extend(["sys", "math", "simd", "lexers", "tasking"]) + simd_libs = ["embree_sse42", "embree_avx", "embree_avx2"] + simd_libs.extend(["embree_avx512knl", "embree_avx512skx"] if Version(self.version) < "3.12.2" else ["embree_avx512"]) + for lib in simd_libs: + if _lib_exists(lib): + self.cpp_info.libs.append(lib) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "embree" + self.cpp_info.names["cmake_find_package_multi"] = "embree" + 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/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch b/recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..d07ff0aa4e590 --- /dev/null +++ b/recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,6 @@ + ## Copyright 2009-2020 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + SET(EMBREE_VERSION_MAJOR 3) + SET(EMBREE_VERSION_MINOR 12) +@@ -12,7 +13,6 @@ SET(CPACK_RPM_PACKAGE_RELEASE 1) + + PROJECT(embree${EMBREE_VERSION_MAJOR}) + +-CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + # We use our own strip tool on macOS to sign during install. This is required as CMake modifies RPATH of the binary during install. + IF (APPLE AND EMBREE_SIGN_FILE) diff --git a/recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch b/recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..6208148722846 --- /dev/null +++ b/recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,6 @@ + ## Copyright 2009-2021 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + SET(EMBREE_VERSION_MAJOR 3) + SET(EMBREE_VERSION_MINOR 13) +@@ -12,7 +13,6 @@ SET(CPACK_RPM_PACKAGE_RELEASE 1) + + PROJECT(embree${EMBREE_VERSION_MAJOR}) + +-CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + # We use our own strip tool on macOS to sign during install. This is required as CMake modifies RPATH of the binary during install. + IF (APPLE AND EMBREE_SIGN_FILE) diff --git a/recipes/embree3/all/test_package/CMakeLists.txt b/recipes/embree3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fe2724327bb76 --- /dev/null +++ b/recipes/embree3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(embree REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE embree) diff --git a/recipes/embree3/all/test_package/conanfile.py b/recipes/embree3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/embree3/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/embree3/all/test_package/test_package.cpp b/recipes/embree3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..acf78e712339a --- /dev/null +++ b/recipes/embree3/all/test_package/test_package.cpp @@ -0,0 +1,49 @@ +#include + +#include +#include + +int main() +{ + RTCDevice device = rtcNewDevice(NULL); + RTCScene scene = rtcNewScene(device); + RTCGeometry geom = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE); + + float* vb = (float*) rtcSetNewGeometryBuffer(geom, + RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT3, 3*sizeof(float), 3); + vb[0] = 0.f; vb[1] = 0.f; vb[2] = 0.f; // 1st vertex + vb[3] = 1.f; vb[4] = 0.f; vb[5] = 0.f; // 2nd vertex + vb[6] = 0.f; vb[7] = 1.f; vb[8] = 0.f; // 3rd vertex + + unsigned* ib = (unsigned*) rtcSetNewGeometryBuffer(geom, + RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3, 3*sizeof(unsigned), 1); + ib[0] = 0; ib[1] = 1; ib[2] = 2; + + rtcCommitGeometry(geom); + rtcAttachGeometry(scene, geom); + rtcReleaseGeometry(geom); + rtcCommitScene(scene); + + RTCRayHit rayhit; + rayhit.ray.org_x = 0.f; rayhit.ray.org_y = 0.f; rayhit.ray.org_z = -1.f; + rayhit.ray.dir_x = 0.f; rayhit.ray.dir_y = 0.f; rayhit.ray.dir_z = 1.f; + rayhit.ray.tnear = 0.f; + rayhit.ray.tfar = std::numeric_limits::infinity(); + rayhit.hit.geomID = RTC_INVALID_GEOMETRY_ID; + + RTCIntersectContext context; + rtcInitIntersectContext(&context); + + rtcIntersect1(scene, &context, &rayhit); + + if (rayhit.hit.geomID != RTC_INVALID_GEOMETRY_ID) { + std::cout << "Intersection at t = " << rayhit.ray.tfar << std::endl; + } else { + std::cout << "No Intersection" << std::endl; + } + + rtcReleaseScene(scene); + rtcReleaseDevice(device); + + return 0; +} diff --git a/recipes/embree3/all/test_v1_package/CMakeLists.txt b/recipes/embree3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/embree3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/embree3/all/test_v1_package/conanfile.py b/recipes/embree3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/embree3/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/embree3/config.yml b/recipes/embree3/config.yml new file mode 100644 index 0000000000000..f3cd7c6b5617a --- /dev/null +++ b/recipes/embree3/config.yml @@ -0,0 +1,9 @@ +versions: + "3.13.5": + folder: all + "3.13.3": + folder: all + "3.13.1": + folder: all + "3.12.0": + folder: all diff --git a/recipes/emsdk/all/conandata.yml b/recipes/emsdk/all/conandata.yml new file mode 100644 index 0000000000000..8a32427b651c2 --- /dev/null +++ b/recipes/emsdk/all/conandata.yml @@ -0,0 +1,61 @@ +sources: + "3.1.31": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.31.tar.gz" + sha256: "1d38b7375e12e85197165a4c51d76d90e1d9db8c2c593b64cfaec4338af54750" + "3.1.30": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.30.tar.gz" + sha256: "7b9c4e0b19f08df9f0d807112926f3908fe73a2960b752a87c3862956da8b9a8" + "3.1.29": + url: "https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.29.tar.gz" + sha256: "506376d0d2a71fc3dd1a4dba6fb4cf18f0a2fa4e1936aa04ba4b59f2d435bf3f" + "3.1.23": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.23.tar.gz" + sha256: "a2609fd97580e4e332acbf49b6cc363714982f06cb6970d54c9789df8e91381c" + "3.1.20": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.20.tar.gz" + sha256: "fd336c6d3e51c7205a8ec68e835c442dcbb187f92e50c42b3d7d54a312072ef7" + "3.1.18": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.18.tar.gz" + sha256: "6479c60710bfb1d146a8bdd8619b693699e73185c850a6eb79ef2bd7e2a8e411" + "3.1.17": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.17.tar.gz" + sha256: "f52359d3f265162dc875ac4c9d4570abc9d012e30bef8d380cb74f0e427800a3" + "3.1.16": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.16.tar.gz" + sha256: "0a7a822e09bb22d081a49bf4229377689aef473376f36b5fe62db040d7e1c065" + "3.1.15": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.15.tar.gz" + sha256: "74c7c54b3544555ec38d1e9dcc7e90b9f49ed0e04f2cc3fd44663c598af24124" + "3.1.12": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.12.tar.gz" + sha256: "1b8d8fdebf9f155131ba74f91d2c0dd572b2ba5d1d4a22fb123d20d3ca258e30" + "3.1.7": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.7.tar.gz" + sha256: "bcceced0b7cad2e08375adf74ef20fa431230abbae8766bdad268c43e34f8d03" + "3.1.5": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.5.tar.gz" + sha256: "ae540d681aa04f32b92afbda1c9ef737aa03c81222c1ce3fd567de5af7d36625" + "3.1.4": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.4.tar.gz" + sha256: "7dc13d967705582e11ff62ae143425dbc63c38372f1a1b14f0cb681fda413714" + "3.1.3": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.3.tar.gz" + sha256: "c03767ad4b6d24f143c0a4922735c80ec17d745191ebf54b8f97dbe5d81eb52f" + "3.1.0": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.0.tar.gz" + sha256: "a2c5f3cf36525cf6a4b569f9d25500e3b2f7341c6e6779b54bcf4703b834202d" + "3.0.1": + url: "https://github.com/emscripten-core/emsdk/archive/3.0.1.tar.gz" + sha256: "3a51e17d45878a5c6d1b6c20f35d308b95d58d56dbfbee4ec058e2ee216b2c90" + "3.0.0": + url: "https://github.com/emscripten-core/emsdk/archive/3.0.0.tar.gz" + sha256: "a41dccfd15be9e85f923efaa0ac21943cbab77ec8d39e52f25eca1ec61a9ac9e" + "2.0.34": + url: "https://github.com/emscripten-core/emsdk/archive/2.0.34.tar.gz" + sha256: "a96ddf34de8de779c78be2785df04ae63c9a557da9e83e85332cda3d01bca250" + "2.0.31": + url: "https://github.com/emscripten-core/emsdk/archive/2.0.31.tar.gz" + sha256: "6bf70f4522308de1941200f8cdb9bde6967ba7aacb03445e9d136a5dd812b728" + "2.0.30": + url: https://github.com/emscripten-core/emsdk/archive/refs/tags/2.0.30.tar.gz + sha256: 69050d76c8907a58f99b08831e8cb7a4fba857efec6037d5e59df4b73111ba36 diff --git a/recipes/emsdk/all/conanfile.py b/recipes/emsdk/all/conanfile.py new file mode 100644 index 0000000000000..b8fc485ded548 --- /dev/null +++ b/recipes/emsdk/all/conanfile.py @@ -0,0 +1,196 @@ +from conan import ConanFile, conan_version +from conan.tools.build import cross_building +from conan.tools.env import Environment +from conan.tools.files import chdir, copy, get, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import json +import os + +required_conan_version = ">=1.52.0" + + +class EmSDKConan(ConanFile): + name = "emsdk" + description = "Emscripten SDK. Emscripten is an Open Source LLVM to JavaScript compiler" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kripken/emscripten" + topics = ("emsdk", "emscripten", "sdk") + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("nodejs/16.3.0") + # self.requires("python") # FIXME: Not available as Conan package + # self.requires("wasm") # FIXME: Not available as Conan package + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + @property + def _relative_paths(self): + return ["bin", os.path.join("bin", "upstream", "emscripten")] + + @property + def _paths(self): + return [os.path.join(self.package_folder, path) for path in self._relative_paths] + + @property + def _emsdk(self): + return os.path.join(self.package_folder, "bin") + + @property + def _emscripten(self): + return os.path.join(self.package_folder, "bin", "upstream", "emscripten") + + @property + def _em_config(self): + return os.path.join(self.package_folder, "bin", ".emscripten") + + @property + def _em_cache(self): + return os.path.join(self.package_folder, "bin", ".emscripten_cache") + + def generate(self): + env = Environment() + env.prepend_path("PATH", self._paths) + env.define_path("EMSDK", self._emsdk) + env.define_path("EMSCRIPTEN", self._emscripten) + env.define_path("EM_CONFIG", self._em_config) + env.define_path("EM_CACHE", self._em_cache) + env.vars(self, scope="emsdk").save_script("emsdk_env_file") + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def _tools_for_version(self): + ret = {} + # Select release-upstream from version (wasm-binaries) + with open(os.path.join(self.source_folder, "emscripten-releases-tags.json"), "r") as f: + data = json.load(f) + ret["wasm"] = f"releases-upstream-{data['releases'][self.version]}-64bit" + # Select python and node versions + with open(os.path.join(self.source_folder, "emsdk_manifest.json"), "r") as f: + data = json.load(f) + tools = data["tools"] + if self.settings.os == "Windows": + python = next((it for it in tools if (it["id"] == "python" and not it.get("is_old", False))), None) + ret["python"] = f"python-{python['version']}-64bit" + node = next((it for it in tools if (it["id"] == "node" and not it.get("is_old", False))), None) + ret["nodejs"] = f"node-{node['version']}-64bit" + return ret + + def build(self): + with chdir(self, self.source_folder): + emsdk = "emsdk.bat" if self._settings_build.os == "Windows" else "./emsdk" + self._chmod_plus_x("emsdk") + + # Install required tools + required_tools = self._tools_for_version() + for key, value in required_tools.items(): + if key != 'nodejs': + self.run(f"{emsdk} install {value}") + self.run(f"{emsdk} activate {value}") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + emscripten = os.path.join(self.package_folder, "bin", "upstream", "emscripten") + toolchain = os.path.join(emscripten, "cmake", "Modules", "Platform", "Emscripten.cmake") + # FIXME: conan should add the root of conan package requirements to CMAKE_PREFIX_PATH (LIBRARY/INCLUDE -> ONLY; PROGRAM -> NEVER) + # allow to find conan libraries + replace_in_file(self, toolchain, + "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)", + "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)") + replace_in_file(self, toolchain, + "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)", + "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)") + replace_in_file(self, toolchain, + "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)", + "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)") + if not cross_building(self): + self.run("embuilder build MINIMAL", env=["conanemsdk", "conanrun"]) # force cache population + # the line below forces emscripten to accept the cache as-is, even after re-location + # https://github.com/emscripten-core/emscripten/issues/15053#issuecomment-920950710 + os.remove(os.path.join(self._em_cache, "sanity.txt")) + + def _define_tool_var(self, value): + suffix = ".bat" if self.settings.os == "Windows" else "" + path = os.path.join(self._emscripten, f"{value}{suffix}") + self._chmod_plus_x(path) + return path + + def package_info(self): + self.cpp_info.bindirs = self._relative_paths + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # If we are not building for Emscripten, probably we don't want to inject following environment variables, + # but it might be legit use cases... until we find them, let's be conservative. + if not hasattr(self, "settings_target") or self.settings_target is None: + return + + if self.settings_target.os != "Emscripten": + self.output.warning(f"You've added {self.name}/{self.version} as a build requirement, while os={self.settings_target.os} != Emscripten") + return + + toolchain = os.path.join(self.package_folder, "bin", "upstream", "emscripten", "cmake", "Modules", "Platform", "Emscripten.cmake") + self.conf_info.prepend("tools.cmake.cmaketoolchain:user_toolchain", toolchain) + + self.buildenv_info.define_path("EMSDK", self._emsdk) + self.buildenv_info.define_path("EMSCRIPTEN", self._emscripten) + self.buildenv_info.define_path("EM_CONFIG", self._em_config) + self.buildenv_info.define_path("EM_CACHE", self._em_cache) + + compiler_executables = { + "c": self._define_tool_var("emcc"), + "cpp": self._define_tool_var("em++"), + } + 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("AR", self._define_tool_var("emar")) + self.buildenv_info.define_path("NM", self._define_tool_var("emnm")) + self.buildenv_info.define_path("RANLIB", self._define_tool_var("emranlib")) + self.buildenv_info.define_path("STRIP", self._define_tool_var("emstrip")) + + self.cpp_info.builddirs = [ + os.path.join("bin", "releases", "src"), + os.path.join("bin", "upstream", "emscripten", "cmake", "Modules"), + os.path.join("bin", "upstream", "emscripten", "cmake", "Modules", "Platform"), + os.path.join("bin", "upstream", "emscripten", "system", "lib", "libunwind", "cmake", "Modules"), + os.path.join("bin", "upstream", "emscripten", "system", "lib", "libunwind", "cmake"), + os.path.join("bin", "upstream", "emscripten", "tests", "cmake", "target_library"), + os.path.join("bin", "upstream", "lib", "cmake", "llvm"), + ] + + if Version(conan_version).major < 2: + self.env_info.PATH.extend(self._paths) + self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = toolchain + self.env_info.EMSDK = self._emsdk + self.env_info.EMSCRIPTEN = self._emscripten + self.env_info.EM_CONFIG = self._em_config + self.env_info.EM_CACHE = self._em_cache + self.env_info.CC = compiler_executables["c"] + self.env_info.CXX = compiler_executables["cpp"] + self.env_info.AR = self._define_tool_var("emar") + self.env_info.NM = self._define_tool_var("emnm") + self.env_info.RANLIB = self._define_tool_var("emranlib") + self.env_info.STRIP = self._define_tool_var("emstrip") diff --git a/recipes/emsdk/all/test_package/CMakeLists.txt b/recipes/emsdk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f776bcb524ea6 --- /dev/null +++ b/recipes/emsdk/all/test_package/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/emsdk/all/test_package/conanfile.py b/recipes/emsdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5bce241404bf4 --- /dev/null +++ b/recipes/emsdk/all/test_package/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.env import Environment +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + if self.settings.os == "Emscripten": + env = Environment() + env.define_path("EM_CACHE", os.path.join(self.build_folder, ".emcache")) + envvars = env.vars(self, scope="build") + envvars.save_script("em_cache") + + def build(self): + # It only makes sense to build a library, if the target os is Emscripten + if self.settings.os == "Emscripten": + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + # Check the package provides working binaries + self.run("emcc -v") + self.run("em++ -v") + + # Run the project that was built using emsdk + if self.settings.os == "Emscripten": + test_file = os.path.join(self.cpp.build.bindirs[0], "test_package.js") + self.run(f"node {test_file}") diff --git a/recipes/emsdk/all/test_package/test_package.cpp b/recipes/emsdk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dc0f143f2972b --- /dev/null +++ b/recipes/emsdk/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + std::cout << "conan-center-index\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/emsdk/all/test_v1_package/CMakeLists.txt b/recipes/emsdk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f7c5ddc942cf1 --- /dev/null +++ b/recipes/emsdk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) diff --git a/recipes/emsdk/all/test_v1_package/conanfile.py b/recipes/emsdk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..434f5772df524 --- /dev/null +++ b/recipes/emsdk/all/test_v1_package/conanfile.py @@ -0,0 +1,30 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + generators = "cmake" + + 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 Emscripten + if self.settings.os == "Emscripten": + with tools.environment_append({"EM_CACHE": os.path.join(self.build_folder, ".emcache")}): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + # Check the package provides working binaries + if not tools.cross_building(self): + self.run("emcc -v", run_environment=True) + self.run("em++ -v", run_environment=True) + + # Run the project that was built using emsdk + if self.settings.os == "Emscripten": + test_file = os.path.join("bin", "test_package.js") + self.run(f"node {test_file}", run_environment=True) diff --git a/recipes/emsdk/config.yml b/recipes/emsdk/config.yml new file mode 100644 index 0000000000000..82752e0f1209d --- /dev/null +++ b/recipes/emsdk/config.yml @@ -0,0 +1,41 @@ +versions: + "3.1.31": + folder: all + "3.1.30": + folder: all + "3.1.29": + folder: all + "3.1.23": + folder: all + "3.1.20": + folder: all + "3.1.18": + folder: all + "3.1.17": + folder: all + "3.1.16": + folder: all + "3.1.15": + folder: all + "3.1.12": + folder: all + "3.1.7": + folder: all + "3.1.5": + folder: all + "3.1.4": + folder: all + "3.1.3": + folder: all + "3.1.0": + folder: all + "3.0.1": + folder: all + "3.0.0": + folder: all + "2.0.34": + folder: all + "2.0.31": + folder: all + "2.0.30": + folder: all diff --git a/recipes/enchant/all/CMakeLists.txt b/recipes/enchant/all/CMakeLists.txt new file mode 100644 index 0000000000000..5c44e31e17e0f --- /dev/null +++ b/recipes/enchant/all/CMakeLists.txt @@ -0,0 +1,102 @@ +cmake_minimum_required(VERSION 3.2) + +project(enchant VERSION "${CONAN_enchant_VERSION}") + +set(root "${PROJECT_SOURCE_DIR}/source_subfolder") +set(src "${root}/src") +set(bin "${PROJECT_BINARY_DIR}") + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +# ---- Config headers ---- + +include(configure.cmake) + +# ---- Setup ---- + +find_package(glib REQUIRED CONFIG) + +include(GenerateExportHeader) + +function(target_set_visibility target) + set_target_properties( + "${target}" PROPERTIES + C_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN YES + ) +endfunction() + +set(providers "") +macro(add_provider target) + add_library("${target}" MODULE ${ARGN}) + set_property(TARGET "${target}" PROPERTY DEFINE_SYMBOL enchant_module_EXPORTS) + target_set_visibility("${target}") + target_link_libraries("${target}" PRIVATE enchant) + if(NOT providers) + generate_export_header("${target}" BASE_NAME enchant_module) + endif() + list(APPEND providers "${target}") +endmacro() + +if(MSVC) + add_compile_options(/wd4996) +endif() + +# ---- Library ---- + +add_library( + enchant SHARED + "${root}/lib/relocatable.c" + "${src}/lib.c" + "${src}/libenchant.rc" + "${src}/pwl.c" +) + +target_compile_definitions(enchant PRIVATE NO_XMALLOC=1 PIC=1 ENABLE_COSTLY_RELOCATABLE=1) +target_include_directories(enchant PUBLIC "${bin}" "${src}" "${root}/lib") +target_link_libraries(enchant PRIVATE glib::glib-2.0 glib::gmodule-2.0 ${DLADDR_LIBRARIES}) + +generate_export_header(enchant) +target_set_visibility(enchant) +set_target_properties( + enchant PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}" +) + +# ---- Providers ---- + +# There is only this provider in CCI for now +add_provider(enchant_hunspell "${root}/providers/enchant_hunspell.cpp") +target_compile_features(enchant_hunspell PRIVATE cxx_std_11) + +find_package(hunspell REQUIRED CONFIG) +target_link_libraries(enchant_hunspell PRIVATE hunspell::hunspell glib::glib-2.0) + +# ---- Install rules ---- + +include(GNUInstallDirs) + +install( + TARGETS enchant + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) + +if(NOT providers STREQUAL "") + install( + TARGETS ${providers} + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/enchant-${PROJECT_VERSION_MAJOR}" + ) +endif() + +install( + FILES + "${src}/enchant++.h" + "${src}/enchant.h" + "${bin}/enchant_export.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) diff --git a/recipes/enchant/all/conandata.yml b/recipes/enchant/all/conandata.yml new file mode 100644 index 0000000000000..0e74282d629d1 --- /dev/null +++ b/recipes/enchant/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.3.2": + sha256: "ce9ba47fd4d34031bd69445598a698a6611602b2b0e91d705e91a6f5099ead6e" + url: https://github.com/AbiWord/enchant/releases/download/v2.3.2/enchant-2.3.2.tar.gz +patches: + "2.3.2": + - patch_file: patches/0001-add-visibility-annotations.patch + base_path: source_subfolder + - patch_file: patches/0002-remove-strchrnul-usage.patch + base_path: source_subfolder + - patch_file: patches/0003-fix-file-locking.patch + base_path: source_subfolder + - patch_file: patches/0004-fix-ssize_t-in-headers.patch + base_path: source_subfolder + - patch_file: patches/0005-fix-relocatable.patch + base_path: source_subfolder + - patch_file: patches/0006-add-macos-support.patch + base_path: source_subfolder diff --git a/recipes/enchant/all/conanfile.py b/recipes/enchant/all/conanfile.py new file mode 100644 index 0000000000000..de37d8e54862f --- /dev/null +++ b/recipes/enchant/all/conanfile.py @@ -0,0 +1,57 @@ +import functools + +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.43.0" + + +class EnchantConan(ConanFile): + name = "enchant" + description = ( + "Enchant aims to provide a simple but comprehensive abstraction for " + "dealing with different spell checking libraries in a consistent way" + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://abiword.github.io/enchant/" + topics = "enchant", "spell", "spell-check" + license = "LGPL-2.1-or-later" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + requires = "glib/2.71.3", "hunspell/1.7.0" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + self.copy("configmake.h") + self.copy("configure.cmake") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def source(self): + root = self._source_subfolder + get_args = self.conan_data["sources"][self.version] + tools.get(**get_args, destination=root, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["CONAN_enchant_VERSION"] = self.version + cmake.configure() + return cmake + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + self._configure_cmake().build() + + def package(self): + self.copy("COPYING.LIB", "licenses", self._source_subfolder) + self._configure_cmake().install() + + def package_info(self): + self.cpp_info.libs = ["enchant"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] diff --git a/recipes/enchant/all/configmake.h b/recipes/enchant/all/configmake.h new file mode 100644 index 0000000000000..eebd0272c402c --- /dev/null +++ b/recipes/enchant/all/configmake.h @@ -0,0 +1,13 @@ +/* Relocation requires the INSTALLDIR define to end with a path segment that is + * equal to the final installation for the library file. Note that on Windows + * the convention is /bin while on other platforms it's /lib */ +#ifdef _WIN32 +#define INSTALLDIR "/usr/local/bin" +#else +#define INSTALLDIR "/usr/local/lib" +#endif + +#define INSTALLPREFIX "/usr/local" +#define PKGDATADIR "/usr/local/share/enchant" +#define PKGLIBDIR "/usr/local/lib/enchant" +#define SYSCONFDIR "/usr/local/etc" diff --git a/recipes/enchant/all/configure.cmake b/recipes/enchant/all/configure.cmake new file mode 100644 index 0000000000000..5e067b9fc7047 --- /dev/null +++ b/recipes/enchant/all/configure.cmake @@ -0,0 +1,42 @@ +# ---- Autotools style compile checks ---- + +set(DLADDR_LIBRARIES "") +set(ENABLE_RELOCATABLE 1) + +if(NOT WIN32) + include(CheckFunctionExists) + include(CheckLibraryExists) + + check_library_exists(dl dladdr "" HAVE_DLADDR_IN_DL) + if(HAVE_DLADDR_IN_DL) + set(HAVE_DLADDR 1) + set(DLADDR_LIBRARIES dl) + else() + check_function_exists(dladdr HAVE_DLADDR) + endif() + + check_function_exists(flock HAVE_FLOCK) +endif() + +# ---- Write config headers ---- + +set_directory_properties(PROPERTIES CMAKE_CONFIGURE_DEPENDS config.h.in) +file(READ "${root}/config.h.in" content) +string(REGEX REPLACE "#[ \t]*undef ([^\r\n ]+)" "#cmakedefine \\1 @\\1@" content "${content}") +string(CONFIGURE "${content} +#cmakedefine HAVE_DLADDR @HAVE_DLADDR@ +" content @ONLY) +file( + WRITE "${bin}/config.h.tmp" "${content}" + "#define ENCHANT_MAJOR_VERSION \"${PROJECT_VERSION_MAJOR}\"\n" + "#define ENCHANT_VERSION_STRING \"${PROJECT_VERSION}\"\n" +) + +configure_file(configmake.h configmake.h COPYONLY) +execute_process( + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${bin}/config.h.tmp" "${bin}/config.h" + RESULT_VARIABLE result +) +if(NOT result STREQUAL "0") + message(FATAL_ERROR "Copy failed: ${result}") +endif() diff --git a/recipes/enchant/all/patches/0001-add-visibility-annotations.patch b/recipes/enchant/all/patches/0001-add-visibility-annotations.patch new file mode 100644 index 0000000000000..66e53772d5511 --- /dev/null +++ b/recipes/enchant/all/patches/0001-add-visibility-annotations.patch @@ -0,0 +1,283 @@ +--- src/enchant.h ++++ src/enchant.h +@@ -30,6 +30,7 @@ + #ifndef ENCHANT_H + #define ENCHANT_H + ++#include "enchant_export.h" /* for ENCHANT_EXPORT */ + #include /* for uint32_t */ + #include /* for size_t, ssize_t */ + +@@ -41,7 +42,7 @@ + typedef struct str_enchant_broker EnchantBroker; + typedef struct str_enchant_dict EnchantDict; + +-const char *enchant_get_version (void); ++ENCHANT_EXPORT const char *enchant_get_version (void); + + /** + * enchant_broker_init +@@ -49,7 +50,7 @@ + * Returns: A new broker object capable of requesting + * dictionaries from providers. + */ +-EnchantBroker *enchant_broker_init (void); ++ENCHANT_EXPORT EnchantBroker *enchant_broker_init (void); + + /** + * enchant_broker_free +@@ -57,7 +58,7 @@ + * + * Destroys the broker object. Must only be called once per broker init + */ +-void enchant_broker_free (EnchantBroker * broker); ++ENCHANT_EXPORT void enchant_broker_free (EnchantBroker * broker); + + /** + * enchant_broker_request_dict +@@ -66,7 +67,7 @@ + * + * Returns: An #EnchantDict, or %null if no suitable dictionary could be found. This dictionary is reference counted. + */ +-EnchantDict *enchant_broker_request_dict (EnchantBroker * broker, const char *const tag); ++ENCHANT_EXPORT EnchantDict *enchant_broker_request_dict (EnchantBroker * broker, const char *const tag); + + /** + * enchant_broker_request_pwl_dict +@@ -78,7 +79,7 @@ + * + * Returns: An EnchantDict. This dictionary is reference counted. + */ +-EnchantDict *enchant_broker_request_pwl_dict (EnchantBroker * broker, const char *const pwl); ++ENCHANT_EXPORT EnchantDict *enchant_broker_request_pwl_dict (EnchantBroker * broker, const char *const pwl); + + /** + * enchant_broker_free_dict +@@ -87,7 +88,7 @@ + * + * Releases the dictionary when you are done using it. Must only be called once per dictionary request + */ +-void enchant_broker_free_dict (EnchantBroker * broker, EnchantDict * dict); ++ENCHANT_EXPORT void enchant_broker_free_dict (EnchantBroker * broker, EnchantDict * dict); + + /** + * enchant_broker_dict_exists +@@ -96,7 +97,7 @@ + * + * Return existance of the requested dictionary (1 == true, 0 == false) + */ +-int enchant_broker_dict_exists (EnchantBroker * broker, const char * const tag); ++ENCHANT_EXPORT int enchant_broker_dict_exists (EnchantBroker * broker, const char * const tag); + + /** + * enchant_broker_set_ordering +@@ -110,7 +111,7 @@ + * be used as a language tag to declare a default ordering for any + * language that does not explictly declare an ordering. + */ +-void enchant_broker_set_ordering (EnchantBroker * broker, ++ENCHANT_EXPORT void enchant_broker_set_ordering (EnchantBroker * broker, + const char * const tag, + const char * const ordering); + /** +@@ -121,7 +122,7 @@ + * WARNING: error is transient and is likely cleared as soon as the + * next broker operation happens + */ +-const char *enchant_broker_get_error (EnchantBroker * broker); ++ENCHANT_EXPORT const char *enchant_broker_get_error (EnchantBroker * broker); + + /** + * EnchantBrokerDescribeFn +@@ -146,7 +147,7 @@ + * Enumerates the Enchant providers and tells + * you some rudimentary information about them. + */ +-void enchant_broker_describe (EnchantBroker * broker, ++ENCHANT_EXPORT void enchant_broker_describe (EnchantBroker * broker, + EnchantBrokerDescribeFn fn, + void * user_data); + +@@ -161,7 +162,7 @@ + * + * Returns: 0 if the word is correctly spelled, positive if not, negative if error + */ +-int enchant_dict_check (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT int enchant_dict_check (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_suggest +@@ -175,7 +176,7 @@ + * + * Returns: A %null terminated list of UTF-8 encoded suggestions, or %null + */ +-char **enchant_dict_suggest (EnchantDict * dict, const char *const word, ++ENCHANT_EXPORT char **enchant_dict_suggest (EnchantDict * dict, const char *const word, + ssize_t len, size_t * out_n_suggs); + + /** +@@ -187,7 +188,7 @@ + * Remarks: if the word exists in the exclude dictionary, it will be removed from the + * exclude dictionary + */ +-void enchant_dict_add (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT void enchant_dict_add (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_add_to_session +@@ -196,7 +197,7 @@ + * @len: The byte length of @word, or -1 for strlen (@word) + * + */ +-void enchant_dict_add_to_session (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT void enchant_dict_add_to_session (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_remove +@@ -206,7 +207,7 @@ + * @len: The byte length of @word, or -1 for strlen (@word) + * + */ +-void enchant_dict_remove (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT void enchant_dict_remove (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_remove_from_session +@@ -215,7 +216,7 @@ + * @len: The byte length of @word, or -1 for strlen (@word) + * + */ +-void enchant_dict_remove_from_session (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT void enchant_dict_remove_from_session (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_is_added +@@ -223,7 +224,7 @@ + * @word: The word you wish to see if it has been added (to your session or dict) in UTF8 encoding + * @len: the byte length of @word, or -1 for strlen (@word) + */ +-int enchant_dict_is_added (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT int enchant_dict_is_added (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_is_removed +@@ -231,7 +232,7 @@ + * @word: The word you wish to see if it has been removed (from your session or dict) in UTF8 encoding + * @len: the byte length of @word, or -1 for strlen (@word) + */ +-int enchant_dict_is_removed (EnchantDict * dict, const char *const word, ssize_t len); ++ENCHANT_EXPORT int enchant_dict_is_removed (EnchantDict * dict, const char *const word, ssize_t len); + + /** + * enchant_dict_store_replacement +@@ -245,7 +246,7 @@ + * that future occurrences of @mis will be replaced with @cor. So it might + * bump @cor up in the suggestion list. + */ +-void enchant_dict_store_replacement (EnchantDict * dict, ++ENCHANT_EXPORT void enchant_dict_store_replacement (EnchantDict * dict, + const char *const mis, ssize_t mis_len, + const char *const cor, ssize_t cor_len); + +@@ -256,7 +257,7 @@ + * + * Releases the string list + */ +-void enchant_dict_free_string_list (EnchantDict * dict, char **string_list); ++ENCHANT_EXPORT void enchant_dict_free_string_list (EnchantDict * dict, char **string_list); + + /** + * enchant_dict_get_error +@@ -266,7 +267,7 @@ + * WARNING: error is transient. It will likely be cleared as soon as + * the next dictionary operation is called. + */ +-const char *enchant_dict_get_error (EnchantDict * dict); ++ENCHANT_EXPORT const char *enchant_dict_get_error (EnchantDict * dict); + + /** + * enchant_dict_get_extra_word_characters +@@ -282,7 +283,7 @@ + * Note that for some back-ends the result may be a guess, in which case it + * may include characters not actually allowed in the given dictionary. + */ +-const char *enchant_dict_get_extra_word_characters (EnchantDict * dict); ++ENCHANT_EXPORT const char *enchant_dict_get_extra_word_characters (EnchantDict * dict); + + /** + * enchant_dict_is_word_character +@@ -304,7 +305,7 @@ + * If @dict is %null, a built-in implementation is used (FIXME: We should document + * behavior for this). If @n is not 0, 1 or 2, then a false flag is returned. + */ +-int enchant_dict_is_word_character (EnchantDict * dict, uint32_t uc, size_t n); ++ENCHANT_EXPORT int enchant_dict_is_word_character (EnchantDict * dict, uint32_t uc, size_t n); + + /** + * EnchantDictDescribeFn +@@ -330,7 +331,7 @@ + * + * Describes an individual dictionary + */ +-void enchant_dict_describe (EnchantDict * dict, ++ENCHANT_EXPORT void enchant_dict_describe (EnchantDict * dict, + EnchantDictDescribeFn fn, + void * user_data); + +@@ -343,7 +344,7 @@ + * Enumerates the dictionaries available from + * all Enchant providers. + */ +-void enchant_broker_list_dicts (EnchantBroker * broker, ++ENCHANT_EXPORT void enchant_broker_list_dicts (EnchantBroker * broker, + EnchantDictDescribeFn fn, + void * user_data); + +@@ -355,7 +356,7 @@ + * auto-detection does not work. + * + */ +-void enchant_set_prefix_dir(const char *); ++ENCHANT_EXPORT void enchant_set_prefix_dir(const char *); + + #ifdef __cplusplus + } +--- src/enchant-provider.h ++++ src/enchant-provider.h +@@ -62,7 +62,7 @@ + * + * The returned string must be free'd. + */ +-char *enchant_get_user_config_dir (void); ++ENCHANT_EXPORT char *enchant_get_user_config_dir (void); + + /** + * enchant_get_conf_dirs +@@ -89,7 +89,7 @@ + * + * The return value must be free'd. + */ +-char *enchant_get_prefix_dir(void); ++ENCHANT_EXPORT char *enchant_get_prefix_dir(void); + + /** + * enchant_relocate +--- providers/enchant_hunspell.cpp ++++ providers/enchant_hunspell.cpp +@@ -42,6 +42,7 @@ + #include + #include + ++#include + #include "enchant-provider.h" + #include "unused-parameter.h" + +@@ -503,7 +504,7 @@ + return "Hunspell Provider"; + } + +-EnchantProvider *init_enchant_provider (void); ++ENCHANT_MODULE_EXPORT EnchantProvider *init_enchant_provider (void); + + EnchantProvider * + init_enchant_provider (void) diff --git a/recipes/enchant/all/patches/0002-remove-strchrnul-usage.patch b/recipes/enchant/all/patches/0002-remove-strchrnul-usage.patch new file mode 100644 index 0000000000000..9a737af139e72 --- /dev/null +++ b/recipes/enchant/all/patches/0002-remove-strchrnul-usage.patch @@ -0,0 +1,33 @@ +--- src/lib.c ++++ src/lib.c +@@ -177,12 +177,17 @@ + enchant_normalize_dictionary_tag (const char * const dict_tag) + { + char * new_tag = g_strstrip (strdup (dict_tag)); ++ char * tmp; + + /* strip off en_GB@euro */ +- *strchrnul (new_tag, '@') = '\0'; ++ if ((tmp = strchr (new_tag, '@'))) { ++ *tmp = '\0'; ++ } + + /* strip off en_GB.UTF-8 */ +- *strchrnul (new_tag, '.') = '\0'; ++ if ((tmp = strchr (new_tag, '.'))) { ++ *tmp = '\0'; ++ } + + /* turn en-GB into en_GB */ + char * needle; +@@ -190,7 +195,9 @@ + *needle = '_'; + + /* everything before first '_' is converted to lower case */ +- needle = strchrnul (new_tag, '_'); ++ if (!(needle = strchr (new_tag, '_'))) { ++ return new_tag; ++ } + for (gchar *it = new_tag; it != needle; ++it) + *it = g_ascii_tolower (*it); + /* everything after first '_' is converted to upper case */ diff --git a/recipes/enchant/all/patches/0003-fix-file-locking.patch b/recipes/enchant/all/patches/0003-fix-file-locking.patch new file mode 100644 index 0000000000000..05322a067b5ce --- /dev/null +++ b/recipes/enchant/all/patches/0003-fix-file-locking.patch @@ -0,0 +1,100 @@ +--- src/pwl.c ++++ src/pwl.c +@@ -54,14 +54,24 @@ + + #include "config.h" + ++#define _DEFAULT_SOURCE 1 ++ + #include + #include + #include + #include + #include +-#include + #include + ++#if defined _WIN32 ++# include ++# include ++#elif defined HAVE_FLOCK ++# include ++#else ++# include ++#endif ++ + #include + #include + #include "enchant-provider.h" +@@ -182,8 +192,69 @@ + + static int edit_dist(const char* word1, const char* word2); + +-#define enchant_lock_file(f) flock (fileno (f), LOCK_EX) +-#define enchant_unlock_file(f) flock (fileno (f), LOCK_UN) ++static void enchant_lock_file(FILE * f) ++{ ++#if defined _WIN32 ++ const DWORD all_bits = ~(DWORD)0; ++ int descriptor = -1; ++ HANDLE handle = INVALID_HANDLE_VALUE; ++ OVERLAPPED overlapped = {0}; ++ ++ if ((descriptor = _fileno (f)) == -1) ++ goto warning; ++ ++ if ((handle = (HANDLE) _get_osfhandle (descriptor)) == INVALID_HANDLE_VALUE) ++ goto warning; ++ ++ if (LockFileEx (handle, LOCKFILE_EXCLUSIVE_LOCK, 0, all_bits, all_bits, &overlapped) == TRUE) ++ return; ++#elif defined HAVE_FLOCK ++ int descriptor = fileno (f); ++ ++ if (descriptor != -1 && flock (descriptor, LOCK_EX) == 0) ++ return; ++#else ++ int descriptor = fileno (f); ++ ++ if (descriptor != -1 && lockf (descriptor, F_LOCK, 0) == 0) ++ return; ++#endif ++ ++warning: ++ g_warning("Could not lock file\n"); ++} ++ ++static void enchant_unlock_file(FILE * f) ++{ ++#if defined _WIN32 ++ const DWORD all_bits = ~(DWORD)0; ++ int descriptor = -1; ++ HANDLE handle = INVALID_HANDLE_VALUE; ++ OVERLAPPED overlapped = {0}; ++ ++ if ((descriptor = _fileno (f)) == -1) ++ goto warning; ++ ++ if ((handle = (HANDLE) _get_osfhandle (descriptor)) == INVALID_HANDLE_VALUE) ++ goto warning; ++ ++ if (UnlockFileEx (handle, 0, all_bits, all_bits, &overlapped)) ++ return; ++#elif defined HAVE_FLOCK ++ int descriptor = fileno (f); ++ ++ if (descriptor != -1 && flock (descriptor, LOCK_UN) == 0) ++ return; ++#else ++ int descriptor = fileno (f); ++ ++ if (descriptor != -1 && lockf (descriptor, F_ULOCK, 0) == 0) ++ return; ++#endif ++ ++warning: ++ g_warning("Could not unlock file\n"); ++} + + /** + * enchant_pwl_init diff --git a/recipes/enchant/all/patches/0004-fix-ssize_t-in-headers.patch b/recipes/enchant/all/patches/0004-fix-ssize_t-in-headers.patch new file mode 100644 index 0000000000000..51400604efabd --- /dev/null +++ b/recipes/enchant/all/patches/0004-fix-ssize_t-in-headers.patch @@ -0,0 +1,13 @@ +--- src/enchant.h ++++ src/enchant.h +@@ -34,6 +34,10 @@ + #include /* for uint32_t */ + #include /* for size_t, ssize_t */ + ++#ifdef _WIN32 ++# include ++# define ssize_t SSIZE_T ++#endif + + #ifdef __cplusplus + extern "C" { diff --git a/recipes/enchant/all/patches/0005-fix-relocatable.patch b/recipes/enchant/all/patches/0005-fix-relocatable.patch new file mode 100644 index 0000000000000..299998652be31 --- /dev/null +++ b/recipes/enchant/all/patches/0005-fix-relocatable.patch @@ -0,0 +1,10 @@ +--- lib/relocatable.c ++++ lib/relocatable.c +@@ -25,6 +25,7 @@ + + #define _GL_USE_STDLIB_ALLOC 1 + #include ++#include + + /* Specification. */ + #include "relocatable.h" diff --git a/recipes/enchant/all/patches/0006-add-macos-support.patch b/recipes/enchant/all/patches/0006-add-macos-support.patch new file mode 100644 index 0000000000000..372732b910dfb --- /dev/null +++ b/recipes/enchant/all/patches/0006-add-macos-support.patch @@ -0,0 +1,51 @@ +--- lib/relocatable.c ++++ lib/relocatable.c +@@ -37,6 +37,10 @@ + #include + #include + ++#ifdef HAVE_DLADDR ++# include ++#endif ++ + #ifdef NO_XMALLOC + # define xmalloc malloc + #else +@@ -389,6 +393,19 @@ + return 1; + } + ++#elif defined HAVE_DLADDR ++ ++static Dl_info lib_info; ++ ++static void ++find_shared_library_fullname (void) ++{ ++ if (dladdr (&lib_info, &lib_info)) ++ { ++ shared_library_fullname = strdup (lib_info.dli_fname); ++ } ++} ++ + #else /* Unix */ + + static void +@@ -444,7 +461,7 @@ + #endif + } + +-#endif /* Native Windows / EMX / Unix */ ++#endif /* Native Windows / EMX / BSD / Unix */ + + /* Return the full pathname of the current shared library. + Return NULL if unknown. +@@ -452,7 +469,7 @@ + static char * + get_shared_library_fullname () + { +-#if !(defined _WIN32 && !defined __CYGWIN__) && !defined __EMX__ ++#if (!(defined _WIN32 && !defined __CYGWIN__) && !defined __EMX__) || defined HAVE_DLADDR + static bool tried_find_shared_library_fullname; + if (!tried_find_shared_library_fullname) + { diff --git a/recipes/enchant/all/test_package/CMakeLists.txt b/recipes/enchant/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..71e01b224abd1 --- /dev/null +++ b/recipes/enchant/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +find_package(enchant REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE enchant::enchant) diff --git a/recipes/enchant/all/test_package/conanfile.py b/recipes/enchant/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a8c92dea63335 --- /dev/null +++ b/recipes/enchant/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.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/enchant/all/test_package/test_package.c b/recipes/enchant/all/test_package/test_package.c new file mode 100644 index 0000000000000..3fdb81bea3e70 --- /dev/null +++ b/recipes/enchant/all/test_package/test_package.c @@ -0,0 +1,48 @@ +#include +#include +#include + +static void for_each_provider(const char* const provider_name, + const char* const provider_desc, + const char* const provider_dll_file, + void* user_data) +{ + (void)provider_desc; + (void)provider_dll_file; + + ++*(int*)user_data; + (void)puts(provider_name); +} + +int main(void) +{ + EnchantBroker* broker = enchant_broker_init(); + char* prefix_dir = NULL; + int counter = 0; + int return_code = 0; + + if (broker == NULL) { + (void)fputs("Failed to init the broker", stderr); + return 1; + } + + (void)puts("Providers found:"); + enchant_broker_describe(broker, for_each_provider, &counter); + if (counter == 0) { + (void)puts("(none)"); + } + /* NOTE: this is temporary, since the recipe always uses the hunspell + * provider */ + if (counter != 1) { + (void)fflush(stdout); + (void)fprintf(stderr, + "Expected to find exactly 1 provider, found %d\n", + counter); + return_code = 1; + } else { + (void)printf("\nenchant version %s\n", enchant_get_version()); + } + + enchant_broker_free(broker); + return return_code; +} diff --git a/recipes/enchant/config.yml b/recipes/enchant/config.yml new file mode 100644 index 0000000000000..aee8de619ec30 --- /dev/null +++ b/recipes/enchant/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.2": + folder: all diff --git a/recipes/enet/all/conandata.yml b/recipes/enet/all/conandata.yml new file mode 100644 index 0000000000000..c03ba9c9c59fb --- /dev/null +++ b/recipes/enet/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "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.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/conanfile.py b/recipes/enet/all/conanfile.py new file mode 100644 index 0000000000000..cc4771c9c977b --- /dev/null +++ b/recipes/enet/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class EnetConan(ConanFile): + name = "enet" + description = "ENet reliable UDP networking library" + topics = ("udp", "networking") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lsalzman/enet" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libenet") + self.cpp_info.libs = ["enet"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "winmm"]) + if is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("ENET_DLL") diff --git a/recipes/enet/all/patches/fix-cmake.patch b/recipes/enet/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..2355cb635cfd6 --- /dev/null +++ b/recipes/enet/all/patches/fix-cmake.patch @@ -0,0 +1,32 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,11 +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() ++ ++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/all/test_package/CMakeLists.txt b/recipes/enet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4d708d2778b59 --- /dev/null +++ b/recipes/enet/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(enet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE enet::enet) diff --git a/recipes/enet/all/test_package/conanfile.py b/recipes/enet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/enet/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/enet/all/test_package/test_package.c b/recipes/enet/all/test_package/test_package.c new file mode 100644 index 0000000000000..9757189b48020 --- /dev/null +++ b/recipes/enet/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +int main (int argc, char ** argv) +{ + if (enet_initialize () != 0) + { + return 1; + } + enet_deinitialize(); + return 0; +} diff --git a/recipes/enet/all/test_v1_package/CMakeLists.txt b/recipes/enet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/enet/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/enet/all/test_v1_package/conanfile.py b/recipes/enet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/enet/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/enet/config.yml b/recipes/enet/config.yml new file mode 100644 index 0000000000000..1e0720325112a --- /dev/null +++ b/recipes/enet/config.yml @@ -0,0 +1,9 @@ +versions: + "1.3.17": + folder: all + "1.3.16": + folder: all + "1.3.15": + folder: all + "1.3.14": + folder: all diff --git a/recipes/enhex-generic_serialization/all/conandata.yml b/recipes/enhex-generic_serialization/all/conandata.yml new file mode 100644 index 0000000000000..5c26732b3e9b0 --- /dev/null +++ b/recipes/enhex-generic_serialization/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/Enhex/generic_serialization/archive/refs/tags/v1.0.0.zip" + sha256: a3a09fb0c026662a06075fbcf993458d9611db03cb8fdc6db31268afa9314400 diff --git a/recipes/enhex-generic_serialization/all/conanfile.py b/recipes/enhex-generic_serialization/all/conanfile.py new file mode 100644 index 0000000000000..9dbb338a5b3f4 --- /dev/null +++ b/recipes/enhex-generic_serialization/all/conanfile.py @@ -0,0 +1,50 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +class EnhexGenericserializationConan(ConanFile): + name = "enhex-generic_serialization" + license = "MIT" + description = "Lightweight and extensible generic serialization library" + topics = ("serialization") + homepage = "https://github.com/Enhex/generic_serialization" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + settings = ("compiler") + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimal_version = { + "Visual Studio": "15", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1" + } + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + if compiler not in minimal_version: + self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + return + + # Exclude compilers not supported + if compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( + self.name, compiler, tools.Version(self.settings.compiler.version.value))) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt b/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..60c63e2f06ba6 --- /dev/null +++ b/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(enhex-generic_serialization CONFIG REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example enhex-generic_serialization::enhex-generic_serialization) +set_target_properties(example PROPERTIES CXX_STANDARD 17) diff --git a/recipes/enhex-generic_serialization/all/test_package/conanfile.py b/recipes/enhex-generic_serialization/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6ab1666628a5d --- /dev/null +++ b/recipes/enhex-generic_serialization/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class EnhexGenericserializationTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/enhex-generic_serialization/all/test_package/example.cpp b/recipes/enhex-generic_serialization/all/test_package/example.cpp new file mode 100644 index 0000000000000..8f8955be3a79d --- /dev/null +++ b/recipes/enhex-generic_serialization/all/test_package/example.cpp @@ -0,0 +1,123 @@ +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include + +using namespace std; + + +// Example for serializing a POD type (without references/pointers since memory addresses change) +struct Vector3 { + float x, y, z; + + void print() const { + std::cout << + "x: " << x << '\n' << + "x: " << y << '\n' << + "y: " << z << '\n'; + } +}; + +namespace gs +{ +template +void serialize(Stream& stream, Vector3& value) { + gs::read_or_write_bytes(stream, value); +} +} + + +// example class +struct A +{ + int x = 0; + float y = 0; + char z[3]; + Vector3 vec3; + + void print() const { + cout + << "x: " << x << '\n' + << "x: " << y << '\n' + << "z: " << z << '\n' + << "vec3:\n"; + vec3.print(); + + } +}; + +namespace gs +{ + //TODO alternatively can be a member function so we don't have to pass A and we can access members directly. Requires using SFINAE to check if the method is available. + template + void serialize(Stream& stream, A& value) { + // choose which members to serialize + gs::serializer(stream, value.x, value.y, value.z, value.vec3); // members' types' already have serialization implemented + } +} + + +#include + + +namespace test +{ + void serialization() + { + A a; + + a.x = 5; + a.y = 7.5; + a.z[0] = 'a'; + a.z[1] = 'b'; + a.z[2] = '\0'; + a.vec3 = { 1,2,3 }; + + puts("writing:"); + puts("========"); + a.print(); + putchar('\n'); + + // serialize to file + { + ofstream f("test", ofstream::binary); + gs::serializer(f, a); + } + + a.x = 0; + a.y = 0; + a.z[0] = '0'; + a.z[1] = '0'; + a.vec3 = { 0,0,0 }; + + // read back from file + { + ifstream f("test", ios::binary); + gs::serializer(f, a); + } + + puts("reading:"); + puts("========"); + a.print(); + putchar('\n'); + + assert(a.x == 5); + assert(a.y == 7.5); + assert(a.z[0] == 'a'); + assert(a.z[1] == 'b'); + assert(a.z[2] == '\0'); + assert(a.vec3.x == 1); + assert(a.vec3.y == 2); + assert(a.vec3.z == 3); + } +} + + +int main() +{ + puts("Serialization test"); + puts("=================="); + + test::serialization(); +} diff --git a/recipes/enhex-generic_serialization/config.yml b/recipes/enhex-generic_serialization/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/enhex-generic_serialization/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/enhex-strong_type/all/conandata.yml b/recipes/enhex-strong_type/all/conandata.yml new file mode 100644 index 0000000000000..4f41faaea9d53 --- /dev/null +++ b/recipes/enhex-strong_type/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/Enhex/strong_type/archive/refs/tags/v1.0.0.zip" + sha256: b7897146f8dfa12bfe466147760840f1d1631754f6ba3672542f8a0bb3372856 diff --git a/recipes/enhex-strong_type/all/conanfile.py b/recipes/enhex-strong_type/all/conanfile.py new file mode 100644 index 0000000000000..40601c5f9d3e8 --- /dev/null +++ b/recipes/enhex-strong_type/all/conanfile.py @@ -0,0 +1,50 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +class EnhexStrongTypeConan(ConanFile): + name = "enhex-strong_type" + license = "MIT" + description = "Create new type from existing type without changing the interface." + topics = ("strong_type", "safety") + homepage = "https://github.com/Enhex/strong_type" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + settings = ("compiler") + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimal_version = { + "Visual Studio": "15", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1" + } + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + if compiler not in minimal_version: + self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + return + + # Exclude compilers not supported + if compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( + self.name, compiler, tools.Version(self.settings.compiler.version.value))) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/enhex-strong_type/all/test_package/CMakeLists.txt b/recipes/enhex-strong_type/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee8f5992e5656 --- /dev/null +++ b/recipes/enhex-strong_type/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(enhex-strong_type CONFIG REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example enhex-strong_type::enhex-strong_type) +set_target_properties(example PROPERTIES CXX_STANDARD 17) diff --git a/recipes/enhex-strong_type/all/test_package/conanfile.py b/recipes/enhex-strong_type/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c48d1d23bfccd --- /dev/null +++ b/recipes/enhex-strong_type/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class EnhexStrongTypeTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/enhex-strong_type/all/test_package/example.cpp b/recipes/enhex-strong_type/all/test_package/example.cpp new file mode 100644 index 0000000000000..f99b50095864c --- /dev/null +++ b/recipes/enhex-strong_type/all/test_package/example.cpp @@ -0,0 +1,12 @@ +#include +#include +#include +using namespace std; + +STRONG_TYPE(ST, string); + +int main() +{ + ST st = "strong_type"; + cout << "hello " << st << "!\n"; +} diff --git a/recipes/enhex-strong_type/config.yml b/recipes/enhex-strong_type/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/enhex-strong_type/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/enjincppsdk/all/CMakeLists.txt b/recipes/enjincppsdk/all/CMakeLists.txt new file mode 100644 index 0000000000000..9d48e327cd88a --- /dev/null +++ b/recipes/enjincppsdk/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/enjincppsdk/all/conandata.yml b/recipes/enjincppsdk/all/conandata.yml new file mode 100644 index 0000000000000..51b1a6998b1de --- /dev/null +++ b/recipes/enjincppsdk/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.0-beta.1": + url: "https://github.com/enjin/enjin-cpp-sdk/archive/1.0.0.2000.tar.gz" + sha256: "ba1ea4800a73dc25e0e5261108cf7245531ec5bfd3a12b989f72cf5c23778d7e" + "1.0.0-alpha.7": + url: "https://github.com/enjin/enjin-cpp-sdk/archive/1.0.0.1006.tar.gz" + sha256: "3b75bf2bb5b0fb9dc995e7c319dc0795d3bee802ebdbd7ed5565a944bf87f6ec" + "1.0.0-alpha.6": + url: "https://github.com/enjin/enjin-cpp-sdk/archive/1.0.0.1005.tar.gz" + sha256: "18c064089ee9dd4bbd3f98329fab38e6c4e8c46284c39d07269222be58fa6eb3" + "1.0.0-alpha.5": + url: "https://github.com/enjin/enjin-cpp-sdk/archive/1.0.0.1004.tar.gz" + sha256: "37affa40d5509cdd3c9133f0d9517f2e90ce4a86fd6342367423d5602ea3879e" diff --git a/recipes/enjincppsdk/all/conanfile.py b/recipes/enjincppsdk/all/conanfile.py new file mode 100644 index 0000000000000..172ca8e02037d --- /dev/null +++ b/recipes/enjincppsdk/all/conanfile.py @@ -0,0 +1,136 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class EnjinCppSdk(ConanFile): + name = "enjincppsdk" + description = "A C++ SDK for development on the Enjin blockchain platform." + license = "Apache-2.0" + topics = ("enjin", "sdk", "blockchain") + homepage = "https://github.com/enjin/enjin-cpp-sdk" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_default_http_client": [True, False], + "with_default_ws_client": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_default_http_client": False, + "with_default_ws_client": False, + } + + _cmake = None + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "9", + "clang": "10", + } + + def export_sources(self): + self.copy("CMakeLists.txt") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + if self.options.with_default_http_client: + self.options["cpp-httplib"].with_openssl = True + + self.options["spdlog"].header_only = True + + def requirements(self): + if self.options.with_default_http_client: + self.requires("cpp-httplib/0.8.5") + + if self.options.with_default_ws_client: + self.requires("ixwebsocket/11.0.4") + + self.requires("rapidjson/1.1.0") + self.requires("spdlog/1.8.2") + + def build_requirements(self): + self.build_requires("cmake/3.16.9") + + def validate(self): + # Validations for OS + if self.settings.os == "Macos": + raise ConanInvalidConfiguration("macOS is not supported at this time. Contributions are welcomed.") + + # Validations for minimum required C++ standard + compiler = self.settings.compiler + + if compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimum_version = self._minimum_compilers_version.get(str(compiler), False) + if not minimum_version: + self.output.warn("C++17 support is required. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration("C++17 support is required, which your compiler does not support.") + + if compiler == "clang" and compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration("libstdc++11 is required for clang.") + + # Validations for dependencies + if not self.options["spdlog"].header_only: + raise ConanInvalidConfiguration(f"{self.name} requires spdlog:header_only=True to be enabled.") + + if self.options.with_default_http_client and not self.options["cpp-httplib"].with_openssl: + raise ConanInvalidConfiguration(f"{self.name} requires cpp-httplib:with_openssl=True when using " + f"with_default_http_client=True.") + + 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["ENJINSDK_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["ENJINSDK_BUILD_TESTS"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "enjinsdk")) + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "enjinsdk::enjinsdk") + self.cpp_info.names["cmake_find_package"] = "enjinsdk" + self.cpp_info.names["cmake_find_package_multi"] = "enjinsdk" + self.cpp_info.libs = ["enjinsdk"] diff --git a/recipes/enjincppsdk/all/test_package/CMakeLists.txt b/recipes/enjincppsdk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30e76e5090606 --- /dev/null +++ b/recipes/enjincppsdk/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(enjinsdk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} enjinsdk::enjinsdk) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/enjincppsdk/all/test_package/conanfile.py b/recipes/enjincppsdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4a5eb7410ea85 --- /dev/null +++ b/recipes/enjincppsdk/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.43.0" + + +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/enjincppsdk/all/test_package/test_package.cpp b/recipes/enjincppsdk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4d2320a487e90 --- /dev/null +++ b/recipes/enjincppsdk/all/test_package/test_package.cpp @@ -0,0 +1,90 @@ +#include "enjinsdk/GraphqlQueryRegistry.hpp" +#include "enjinsdk/models/AccessToken.hpp" +#include "enjinsdk/project/AuthProject.hpp" +#include +#include +#include +#include +#include + +using namespace enjin::sdk::graphql; +using namespace enjin::sdk::models; +using namespace enjin::sdk::project; + +void test_model_deserialization(); + +void test_query_registry(); + +void test_request_serialization(); + +int main() { + test_model_deserialization(); + test_query_registry(); + test_request_serialization(); + + return 0; +} + +void test_model_deserialization() { + const std::string token = "xyz"; + const long expiration = 100L; + + std::stringstream json_stream; + json_stream << R"({"accessToken":")" << token << R"(","expiresIn":)" << expiration << R"(})"; + const std::string json = json_stream.str(); + + AccessToken access_token; + access_token.deserialize(json); + + const std::optional & token_opt = access_token.get_token(); + if (!token_opt.has_value()) { + throw std::runtime_error(R"(Field "token" was not serialized)"); + } + + const std::optional& expiration_opt = access_token.get_expires_in(); + if (!expiration_opt.has_value()) { + throw std::runtime_error(R"(Field "expiresIn" was not serialized)"); + } + + std::cout << "AccessToken result:" + << "\n* token: [" << token_opt.value() << "] (expected: [" << token << "])" + << "\n* expiresIn: [" << expiration_opt.value() << "] (expected: [" << expiration << "])" + << "\n" << std::endl; +} + +void test_query_registry() { + const GraphqlQueryRegistry registry; + const AuthProject req; + + const std::string& req_namespace = req.get_namespace(); + const bool has_operation = registry.has_operation_for_name(req_namespace); + + if (!has_operation) { + throw std::runtime_error("Could not find operation for namespace \"" + req_namespace + "\""); + } + + std::cout << "GraphqlQueryRegistry result:" + << "\n* Found operation for namespace \"" << req_namespace << "\"" + << "\n" << std::endl; +} + +void test_request_serialization() { + const std::string uuid = "TestUuid"; + const std::string secret = "TestSecret"; + + AuthProject req = AuthProject().set_uuid(uuid).set_secret(secret); + const std::string req_json = req.serialize(); + + if (req_json.find(uuid) == std::string::npos) { + throw std::runtime_error("Did not find UUID in serialized JSON"); + } + + if (req_json.find(secret) == std::string::npos) { + throw std::runtime_error("Did not find secret in serialized JSON"); + } + + std::cout << "AuthProject result:" + << "\n* Request JSON: " << req_json + << "\n* Found UUID and secret in serialized JSON" + << "\n" << std::endl; +} diff --git a/recipes/enjincppsdk/config.yml b/recipes/enjincppsdk/config.yml new file mode 100644 index 0000000000000..cd6f8cc467b7b --- /dev/null +++ b/recipes/enjincppsdk/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.0-beta.1": + folder: all + "1.0.0-alpha.7": + folder: all + "1.0.0-alpha.6": + folder: all + "1.0.0-alpha.5": + folder: all diff --git a/recipes/enkits/all/CMakeLists.txt b/recipes/enkits/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/enkits/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/enkits/all/conandata.yml b/recipes/enkits/all/conandata.yml new file mode 100644 index 0000000000000..9604c7fcf2b72 --- /dev/null +++ b/recipes/enkits/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "1.11": + url: "https://github.com/dougbinks/enkiTS/archive/v1.11.tar.gz" + sha256: "b57a782a6a68146169d29d180d3553bfecb9f1a0e87a5159082331920e7d297e" + "1.10": + url: "https://github.com/dougbinks/enkiTS/archive/v1.10.tar.gz" + sha256: "578f285fc7c2744bf831548f35b855c6ab06c0d541d08c9cc50b6b72a250811a" + "1.8": + url: "https://github.com/dougbinks/enkiTS/archive/v1.8.zip" + sha256: "b96d8d439502d52f9dc419539b12b588df10750f4631ad5518586f7048cdfaef" +patches: + "1.11": + - patch_file: "patches/cmake-install-lib-location.patch" + base_path: "source_subfolder" + "1.10": + - patch_file: "patches/cmake-install-lib-location.patch" + base_path: "source_subfolder" + "1.8": + - patch_file: "patches/cmake-install-lib-location.patch" + base_path: "source_subfolder" diff --git a/recipes/enkits/all/conanfile.py b/recipes/enkits/all/conanfile.py new file mode 100644 index 0000000000000..3a8bf5c9e920b --- /dev/null +++ b/recipes/enkits/all/conanfile.py @@ -0,0 +1,70 @@ +import os +from conans import ConanFile, CMake, tools + +class EnkiTSConan(ConanFile): + name = "enkits" + description = "A permissively licensed C and C++ Task Scheduler for creating parallel programs." + topics = ("conan", "c", "thread", "multithreading", "scheduling", "enkits", "gamedev") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dougbinks/enkiTS" + license = "Zlib" + settings = "os", "arch", "compiler", "build_type" + + exports_sources = "CMakeLists.txt", "patches/*" + generators = "cmake" + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "enkiTS-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["ENKITS_INSTALL"] = True + self._cmake.definitions["ENKITS_BUILD_EXAMPLES"] = False + self._cmake.definitions["ENKITS_BUILD_SHARED"] = self.options.shared + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="License.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["enkiTS"] + + if self.options.shared: + self.cpp_info.defines.append("ENKITS_DLL=1") + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/enkits/all/patches/cmake-install-lib-location.patch b/recipes/enkits/all/patches/cmake-install-lib-location.patch new file mode 100644 index 0000000000000..0a43979813c18 --- /dev/null +++ b/recipes/enkits/all/patches/cmake-install-lib-location.patch @@ -0,0 +1,5 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -63,1 +63,1 @@ +- install(TARGETS enkiTS DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/enkiTS") ++ install(TARGETS enkiTS ARCHIVE LIBRARY RUNTIME) diff --git a/recipes/enkits/all/test_package/CMakeLists.txt b/recipes/enkits/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/enkits/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/enkits/all/test_package/conanfile.py b/recipes/enkits/all/test_package/conanfile.py new file mode 100644 index 0000000000000..32e9e0cb58ab6 --- /dev/null +++ b/recipes/enkits/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/enkits/all/test_package/test_package.cpp b/recipes/enkits/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..536d3ded1a93e --- /dev/null +++ b/recipes/enkits/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + enki::TaskScheduler ts; + ts.Initialize(); + return 0; +} diff --git a/recipes/enkits/config.yml b/recipes/enkits/config.yml new file mode 100644 index 0000000000000..a23bb21b6345f --- /dev/null +++ b/recipes/enkits/config.yml @@ -0,0 +1,7 @@ +versions: + "1.11": + folder: all + "1.10": + folder: all + "1.8": + folder: all diff --git a/recipes/entityx/all/conandata.yml b/recipes/entityx/all/conandata.yml new file mode 100644 index 0000000000000..2b201a5dfe96a --- /dev/null +++ b/recipes/entityx/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.3.0": + url: "https://github.com/alecthomas/entityx/archive/1.3.0.tar.gz" + sha256: "2cd56d4fc5c553b786b8caf0b5bd9231434f21d43ca0e963d3bc5ee503a06222" +patches: + "1.3.0": + - patch_file: "patches/0001-cmake-not-force-libcpp.patch" diff --git a/recipes/entityx/all/conanfile.py b/recipes/entityx/all/conanfile.py new file mode 100644 index 0000000000000..e534a04fb16dd --- /dev/null +++ b/recipes/entityx/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class EntityXConan(ConanFile): + name = "entityx" + description = ( + "EntityX is an EC system that uses C++11 features to provide type-safe " + "component management, event delivery, etc." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/alecthomas/entityx/" + topics = ("entity", "c++11", "type-safe", "component") + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("entityx shared library does not export all symbols with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENTITYX_BUILD_SHARED"] = self.options.shared + tc.variables["ENTITYX_BUILD_TESTING"] = False + tc.variables["ENTITYX_RUN_BENCHMARKS"] = False + # Relocatable shared lib on macOS + tc.variables["CMAKE_MACOSX_RPATH"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "entityx") + suffix = "-d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"entityx{suffix}"] diff --git a/recipes/entityx/all/patches/0001-cmake-not-force-libcpp.patch b/recipes/entityx/all/patches/0001-cmake-not-force-libcpp.patch new file mode 100644 index 0000000000000..70772a8d453ca --- /dev/null +++ b/recipes/entityx/all/patches/0001-cmake-not-force-libcpp.patch @@ -0,0 +1,55 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -27,23 +27,6 @@ set(ENTITYX_BUILD_SHARED true CACHE BOOL "Build shared libraries?") + include(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) + include(CheckCXXSourceCompiles) + +-# Default compiler args +-if (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|.*Clang)") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=sign-compare") +- set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +- set(CMAKE_CXX_FLAGS_MINSIZEREL "-g -Os -DNDEBUG") +- set(CMAKE_CXX_FLAGS_RELEASE "-g -O2 -DNDEBUG") +- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") +-elseif(CMAKE_CXX_COMPILER_ID STREQUAL 'MSVC') +- # /Zi - Produces a program database (PDB) that contains type information and symbolic debugging information for use with the debugger. +- # /FS - Allows multiple cl.exe processes to write to the same .pdb file +- # /DEBUG - Enable debug during linking +- # /Od - Disables optimization +- set(CMAKE_CXX_FLAGS_DEBUG "/Zi /FS /DEBUG /Od /MDd") +- # /Ox - Full optimization +- set(CMAKE_CXX_FLAGS_RELEASE "/Ox -DNDEBUG") +- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ox /Zi /FS /DEBUG") +-endif() + + # if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-shadow -Wno-padded -Wno-missing-noreturn -Wno-global-constructors") +@@ -55,28 +38,6 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR) + endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) + set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + +-set(OLD_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +-if ((MAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +-endif() +-check_cxx_source_compiles( +-" +-#include +- +-int main() { +- std::shared_ptr(); +-} +-" +-ENTITYX_HAVE_CXX11_STDLIB +-) +- +-if (NOT ENTITYX_HAVE_CXX11_STDLIB) +- message(STATUS "-- Not using -stdlib=libc++ (test failed to build)") +- set(CMAKE_CXX_FLAGS "${OLD_CMAKE_CXX_FLAGS}") +-else () +- message(STATUS "-- Using -stdlib=libc++") +-endif () +- + + # Misc features + check_include_file("stdint.h" HAVE_STDINT_H) diff --git a/recipes/entityx/all/test_package/CMakeLists.txt b/recipes/entityx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3469e1c7a6f88 --- /dev/null +++ b/recipes/entityx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(entityx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE entityx::entityx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/entityx/all/test_package/conanfile.py b/recipes/entityx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/entityx/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/entityx/all/test_package/test_package.cpp b/recipes/entityx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8696dc350a5e8 --- /dev/null +++ b/recipes/entityx/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#if defined(_WIN32) +#define NOMINMAX +#endif +#include + +#include +#include + +int +main(int argc, char **argv) +{ + entityx::EntityX ex; + entityx::Entity entity = ex.entities.create(); + std::cout << "Entity = " << entity; + entity.destroy(); + return 0; +} diff --git a/recipes/entityx/all/test_v1_package/CMakeLists.txt b/recipes/entityx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/entityx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/entityx/all/test_v1_package/conanfile.py b/recipes/entityx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/entityx/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/entityx/config.yml b/recipes/entityx/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/entityx/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/entt/3.x.x/conandata.yml b/recipes/entt/3.x.x/conandata.yml new file mode 100644 index 0000000000000..b55145bf44224 --- /dev/null +++ b/recipes/entt/3.x.x/conandata.yml @@ -0,0 +1,67 @@ +sources: + "3.11.1": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.1.tar.gz" + sha256: "0ac010f232d3089200c5e545bcbd6480cf68b705de6930d8ff7cdb0a29f5b47b" + "3.11.0": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.0.tar.gz" + sha256: "7cca2bd4d4aeef6c5bdbe06b9e047e7f2519ebaff901207cc81ac71a2bbe185e" + "3.10.3": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.3.tar.gz" + sha256: "315918fc678e89a326ce1c13b0e9d3e53882dd9c58a63fef413325917a5c753b" + "3.10.1": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.1.tar.gz" + sha256: "f7031545130bfc06f5fe6b2f8c87dcbd4c1254fab86657e2788b70dfeea57965" + "3.10.0": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.0.tar.gz" + sha256: "4c716cebf4f2964824da158dd58cc81d9f1e056a083538e22fb03ae2d64805ee" + "3.9.0": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.9.0.tar.gz" + sha256: "1b06f1f6627c3702486855877bdeab6885f5d821d3dd78862126d4308c627c23" + "3.8.1": + url: "https://github.com/skypjack/entt/archive/v3.8.1.tar.gz" + sha256: "a2b767f06bca67a73a4d71fb9ebb6ed823bb5146faad3c282b9dbbbdae1aa01b" + "3.8.0": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.8.0.tar.gz" + sha256: "71c8ff5a604e8e214571a8b2218dfeaf61be59e2fe2ff5b550b4810c37d4da3c" + "3.7.1": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.1.tar.gz" + sha256: "fe3ce773c17797c0c57ffa97f73902854fcc8e7afc7e09bea373e0c64fa24a23" + "3.7.0": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.0.tar.gz" + sha256: "39ad5c42acf3434f8c37e0baa18a8cb562c0845383a6b4da17fdbacc9f0a7695" + "3.6.0": + url: "https://github.com/skypjack/entt/archive/v3.6.0.tar.gz" + sha256: "94b7dc874acd0961cfc28cf6b0342eeb0b7c58250ddde8bdc6c101e84b74c190" + "3.5.2": + url: "https://github.com/skypjack/entt/archive/v3.5.2.tar.gz" + sha256: "f9271293c44518386c402c9a2188627819748f66302df48af4f6d08e30661036" + "3.5.1": + url: "https://github.com/skypjack/entt/archive/v3.5.1.tar.gz" + sha256: "f442ece6881ec24863e7f0fbdc4bf641e01b0f87955f49dc4687b2fa564e9c83" + "3.5.0": + url: "https://github.com/skypjack/entt/archive/v3.5.0.tar.gz" + sha256: "89cba5ddf90bcec0dcf8d9554d9acf5ad86f5ce305e3acacf795007ee65c93f8" + "3.4.0": + url: "https://github.com/skypjack/entt/archive/v3.4.0.tar.gz" + sha256: "07086b8c5b1d84a1b76b39b0ce257c36c4f1521b77e664368b3d5ca7c00264e2" + "3.3.2": + url: "https://github.com/skypjack/entt/archive/v3.3.2.tar.gz" + sha256: "150cd89b45bffbcd7643d39bbce282e8fa38307bb5ed25567b79e337376ba1c7" + "3.3.1": + url: "https://github.com/skypjack/entt/archive/v3.3.1.tar.gz" + sha256: "432f31a80fb0463960dfd36e103c206dd67f1bfa91fc48408594c28aa790a3f5" + "3.3.0": + url: "https://github.com/skypjack/entt/archive/v3.3.0.tar.gz" + sha256: "d21a45df4960adc86a8f23a8c3c0cea6d2cecc4ef6946a8040e336d8e5266ab3" + "3.2.2": + url: "https://github.com/skypjack/entt/archive/v3.2.2.tar.gz" + sha256: "94592270b6750dd0b057a4af9d2c1ea8798369b3bb127927a8f70db232808f93" +patches: + "3.11.1": + - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" + patch_description: "Fix GCC 7.0 to 7.3" + patch_type: "portability" + "3.11.0": + - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" + patch_description: "Fix GCC 7.0 to 7.3" + patch_type: "portability" diff --git a/recipes/entt/3.x.x/conanfile.py b/recipes/entt/3.x.x/conanfile.py new file mode 100644 index 0000000000000..bcce48c1ce46c --- /dev/null +++ b/recipes/entt/3.x.x/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class EnttConan(ConanFile): + name = "entt" + description = "Gaming meets modern C++ - a fast and reliable entity-component system (ECS) and much more" + topics = ("entt", "gaming", "entity", "ecs") + homepage = "https://github.com/skypjack/entt" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.9", + "msvc": "191", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + 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): + # TODO: use self.info.settings in validate() instead of self.settings + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "EnTT") + self.cpp_info.set_property("cmake_target_name", "EnTT::EnTT") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "EnTT" + self.cpp_info.names["cmake_find_package_multi"] = "EnTT" diff --git a/recipes/entt/3.x.x/patches/0001-3.11.0-fix-gcc-7.0-7.3.patch b/recipes/entt/3.x.x/patches/0001-3.11.0-fix-gcc-7.0-7.3.patch new file mode 100644 index 0000000000000..f525e3855f87c --- /dev/null +++ b/recipes/entt/3.x.x/patches/0001-3.11.0-fix-gcc-7.0-7.3.patch @@ -0,0 +1,20 @@ +--- a/src/entt/meta/meta.hpp ++++ b/src/entt/meta/meta.hpp +@@ -1613,7 +1613,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} +@@ -1707,7 +1707,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} diff --git a/recipes/entt/3.x.x/test_package/CMakeLists.txt b/recipes/entt/3.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..317de178fe28d --- /dev/null +++ b/recipes/entt/3.x.x/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(EnTT REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE EnTT::EnTT) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(EnTT_VERSION VERSION_LESS "3.4.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE "ENTT_LESS_3_4_0") +endif() diff --git a/recipes/entt/3.x.x/test_package/conanfile.py b/recipes/entt/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/entt/3.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/entt/3.x.x/test_package/test_package.cpp b/recipes/entt/3.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..ccaef2e9b20d2 --- /dev/null +++ b/recipes/entt/3.x.x/test_package/test_package.cpp @@ -0,0 +1,66 @@ +#include +#include + +struct position +{ + float x; + float y; +}; + +struct velocity +{ + float dx; + float dy; +}; + +void update(entt::registry ®istry) +{ + auto view = registry.view(); + + for (auto entity : view) + { + // gets only the components that are going to be used ... + + auto &vel = view.get(entity); + + vel.dx = 0.; + vel.dy = 0.; + + // ... + } +} + +void update(std::uint64_t dt, entt::registry ®istry) +{ + registry.view().each([dt](auto &pos, auto &vel) { + // gets all the components of the view at once ... + + pos.x += vel.dx * dt; + pos.y += vel.dy * dt; + + // ... + }); +} + +int main() +{ + entt::registry registry; + std::uint64_t dt = 16; + + for (auto i = 0; i < 10; ++i) + { + auto entity = registry.create(); +#ifdef ENTT_LESS_3_4_0 + registry.assign(entity, i * 1.f, i * 1.f); + if (i % 2 == 0) { registry.assign(entity, i * .1f, i * .1f); } +#else + registry.emplace(entity, i * 1.f, i * 1.f); + if (i % 2 == 0) { registry.emplace(entity, i * .1f, i * .1f); } +#endif + } + + update(dt, registry); + update(registry); + + // ... +} diff --git a/recipes/entt/3.x.x/test_v1_package/CMakeLists.txt b/recipes/entt/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/entt/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/entt/3.x.x/test_v1_package/conanfile.py b/recipes/entt/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/entt/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/entt/config.yml b/recipes/entt/config.yml new file mode 100644 index 0000000000000..0000b93d983f2 --- /dev/null +++ b/recipes/entt/config.yml @@ -0,0 +1,39 @@ +versions: + "3.11.1": + folder: 3.x.x + "3.11.0": + folder: 3.x.x + "3.10.3": + folder: 3.x.x + "3.10.1": + folder: 3.x.x + "3.10.0": + folder: 3.x.x + "3.9.0": + folder: 3.x.x + "3.8.1": + folder: 3.x.x + "3.8.0": + folder: 3.x.x + "3.7.1": + folder: 3.x.x + "3.7.0": + folder: 3.x.x + "3.6.0": + folder: 3.x.x + "3.5.2": + folder: 3.x.x + "3.5.1": + folder: 3.x.x + "3.5.0": + folder: 3.x.x + "3.4.0": + folder: 3.x.x + "3.3.2": + folder: 3.x.x + "3.3.1": + folder: 3.x.x + "3.3.0": + folder: 3.x.x + "3.2.2": + folder: 3.x.x diff --git a/recipes/enum-flags/all/conandata.yml b/recipes/enum-flags/all/conandata.yml new file mode 100644 index 0000000000000..d29d7bbf48ded --- /dev/null +++ b/recipes/enum-flags/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1a": + url: "https://github.com/grisumbras/enum-flags/archive/refs/tags/v0.1a.tar.gz" + sha256: "34a952a39e9f079357003566da01cabae434e3679c52fafc6bc09f94d0b9d525" diff --git a/recipes/enum-flags/all/conanfile.py b/recipes/enum-flags/all/conanfile.py new file mode 100644 index 0000000000000..81ac78601093a --- /dev/null +++ b/recipes/enum-flags/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class EnumFlagsConan(ConanFile): + name = "enum-flags" + description = "Bit flags for C++11 scoped enums" + homepage = "https://github.com/grisumbras/enum-flags" + url = "https://github.com/conan-io/conan-center-index" + topics = ("bitmask", "enum") + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "forbid_implicit_conversions": [True, False], + } + default_options = { + "forbid_implicit_conversions": True, + } + + 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], + destination=self.source_folder, 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, "*", 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_file_name", "enumflags") + self.cpp_info.set_property("cmake_target_name", "EnumFlags::EnumFlags") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + # Yes, there is a typo in the macro name. + # This macro is only useful when using regular C enums, + # since enum classes prevent implicit conversions already. + if self.options.forbid_implicit_conversions: + self.cpp_info.defines = ["ENUM_CLASS_FLAGS_FORBID_IMPLICT_CONVERSION"] + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "enumflags" + self.cpp_info.filenames["cmake_find_package_multi"] = "enumflags" + self.cpp_info.names["cmake_find_package"] = "EnumFlags" + self.cpp_info.names["cmake_find_package_multi"] = "EnumFlags" diff --git a/recipes/enum-flags/all/test_package/CMakeLists.txt b/recipes/enum-flags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..62594120f0543 --- /dev/null +++ b/recipes/enum-flags/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(enumflags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE EnumFlags::EnumFlags) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/enum-flags/all/test_package/conanfile.py b/recipes/enum-flags/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/enum-flags/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/enum-flags/all/test_package/test_package.cpp b/recipes/enum-flags/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..494bbbd38a990 --- /dev/null +++ b/recipes/enum-flags/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include + +enum class MyEnum { Value1 = 1 << 0, Value2 = 1 << 1 }; +ALLOW_FLAGS_FOR_ENUM(MyEnum) + +int main() { + auto mask1 = MyEnum::Value1 | MyEnum::Value2; + std::cout << mask1.underlying_value() << std::endl; +} diff --git a/recipes/enum-flags/all/test_v1_package/CMakeLists.txt b/recipes/enum-flags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/enum-flags/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/enum-flags/all/test_v1_package/conanfile.py b/recipes/enum-flags/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/enum-flags/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/enum-flags/config.yml b/recipes/enum-flags/config.yml new file mode 100644 index 0000000000000..26aefcacb9d5d --- /dev/null +++ b/recipes/enum-flags/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1a": + folder: all diff --git a/recipes/erikzenker-hsm/all/conandata.yml b/recipes/erikzenker-hsm/all/conandata.yml new file mode 100644 index 0000000000000..ee7984b9e6e76 --- /dev/null +++ b/recipes/erikzenker-hsm/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.3.0": + url: "https://github.com/erikzenker/hsm/archive/v2.3.0.tar.gz" + sha256: "b3a13cd70fa2470fba4db09fad3c22afbfe6042c8da81da4396f890d02ee3518" + "2.1.0": + url: "https://github.com/erikzenker/hsm/archive/v2.1.0.tar.gz" + sha256: "956eb4950e1bee3074e10fe85279164386ba34e4e96fabe694aaf20b24adcdef" + "1.4.7": + url: "https://github.com/erikzenker/hsm/archive/refs/tags/v1.4.7.tar.gz" + sha256: "e56fd4a71337448727dbb9e2abe18992224d496a7ab5567030d6717a00680364" diff --git a/recipes/erikzenker-hsm/all/conanfile.py b/recipes/erikzenker-hsm/all/conanfile.py new file mode 100644 index 0000000000000..dd35c89776d73 --- /dev/null +++ b/recipes/erikzenker-hsm/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class HsmConan(ConanFile): + name = "erikzenker-hsm" + license = "MIT" + homepage = "https://github.com/erikzenker/hsm" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "The hana state machine (hsm) is a finite state machine library based " + "on the boost hana meta programming library. It follows the principles " + "of the boost msm and boost sml libraries, but tries to reduce own " + "complex meta programming code to a minimum." + ) + topics = ("state-machine", "template-meta-programming") + + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + + def requirements(self): + self.requires("boost/1.81.0") + + def package_id(self): + self.info.clear() + + def validate(self): + # FIXME: should use self.info.settings instead of self.settings for conan v2 + # https://github.com/erikzenker/hsm#dependencies + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 17) + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "8": + raise ConanInvalidConfiguration("clang 8+ is required") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + raise ConanInvalidConfiguration("GCC 8+ is required") + + 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.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "hsm" + self.cpp_info.names["cmake_find_package_multi"] = "hsm" + self.cpp_info.set_property("cmake_file_name", "hsm") + self.cpp_info.set_property("cmake_target_name", "hsm::hsm") + self.cpp_info.requires = ["boost::headers"] diff --git a/recipes/erikzenker-hsm/all/test_package/CMakeLists.txt b/recipes/erikzenker-hsm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2fe2bc0003d31 --- /dev/null +++ b/recipes/erikzenker-hsm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(hsm CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hsm::hsm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/erikzenker-hsm/all/test_package/conanfile.py b/recipes/erikzenker-hsm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..185c9f3ab199a --- /dev/null +++ b/recipes/erikzenker-hsm/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout +import os + + +class HsmTestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + 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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/erikzenker-hsm/all/test_package/test_package.cpp b/recipes/erikzenker-hsm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5401fc4d4e36e --- /dev/null +++ b/recipes/erikzenker-hsm/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +#include "hsm/hsm.h" + +#include +#include + +// States +struct Locked { +}; +struct Unlocked { +}; + +// Events +struct Push { +}; +struct Coin { +}; + +// Guards +const auto noError = [](auto /*event*/, auto /*source*/, auto /*target*/) { return true; }; + +// Actions +constexpr auto beep + = [](auto /*event*/, auto /*source*/, auto /*target*/) { std::cout << "beep!" << std::endl; }; +constexpr auto blink = [](auto /*event*/, auto /*source*/, auto /*target*/) { + std::cout << "blink, blink, blink!" << std::endl; +}; + +struct Turnstile { + static constexpr auto make_transition_table() + { + // clang-format off + return hsm::transition_table( + // Source + Event [Guard] / Action = Target + // +-------------------+-----------------+---------+--------+----------------------+ + * hsm::state + hsm::event / beep = hsm::state , + hsm::state + hsm::event [noError] / blink = hsm::state, + // +--------------------+---------------------+---------+--------+------------------------+ + hsm::state + hsm::event [noError] = hsm::state , + hsm::state + hsm::event / blink = hsm::state + // +--------------------+---------------------+---------+--------+------------------------+ + ); + // clang-format on + } +}; + +auto main() -> int +{ + hsm::sm turnstileSm; + + // The turnstile is initially locked + assert(turnstileSm.is(hsm::state)); + + // Inserting a coin unlocks it + turnstileSm.process_event(Coin {}); + assert(turnstileSm.is(hsm::state)); + + // Entering the turnstile will lock it again + turnstileSm.process_event(Push {}); + assert(turnstileSm.is(hsm::state)); + + return 0; +} diff --git a/recipes/erikzenker-hsm/all/test_v1_package/CMakeLists.txt b/recipes/erikzenker-hsm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/erikzenker-hsm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/erikzenker-hsm/all/test_v1_package/conanfile.py b/recipes/erikzenker-hsm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/erikzenker-hsm/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/erikzenker-hsm/config.yml b/recipes/erikzenker-hsm/config.yml new file mode 100644 index 0000000000000..70460f0d554d4 --- /dev/null +++ b/recipes/erikzenker-hsm/config.yml @@ -0,0 +1,7 @@ +versions: + "2.3.0": + folder: all + "2.1.0": + folder: all + "1.4.7": + folder: all diff --git a/recipes/erkir/all/conandata.yml b/recipes/erkir/all/conandata.yml new file mode 100644 index 0000000000000..24a6857c0b7eb --- /dev/null +++ b/recipes/erkir/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "2.0.0": + url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.0.0.tar.gz" + sha256: "98d095adcf0f2f11e3ba345bd5bbe890568cde69de9680b2c2a424f0008453ac" + "1.0.0": + url: "https://github.com/vahancho/erkir/archive/refs/tags/1.0.0.tar.gz" + sha256: "0bc5122fe2fef0f9036de275483af7f8adb947f6e8dd63fc18ac085ef31e9421" +patches: + "2.0.0": + - 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.0.0-0002-fix-cmake.patch" + patch_description: "disable shared and fPIC options" + patch_type: "conan" + - patch_file: "patches/2.0.0-0003-fix-erkir_export.patch" + patch_description: "define ERKIR_EXPORT as empty on static build" + patch_type: "conan" + "1.0.0": + - patch_file: "patches/1.0.0-0001-remove-testing.patch" + patch_description: "stop executing test codes" + patch_type: "conan" + - patch_file: "patches/1.0.0-0002-export-symbols.patch" + patch_description: "export all symbols on windows" + patch_type: "backport" diff --git a/recipes/erkir/all/conanfile.py b/recipes/erkir/all/conanfile.py new file mode 100644 index 0000000000000..941e33312f121 --- /dev/null +++ b/recipes/erkir/all/conanfile.py @@ -0,0 +1,87 @@ +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, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class ErkirConan(ConanFile): + name = "erkir" + description = "a C++ library for geodetic and trigonometric calculations" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vahancho/erkir" + topics = ("earth", "geodesy", "geography", "coordinate-systems", "geodetic", "datum") + 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 export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CODE_COVERAGE"] = 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if Version(self.version) < "2.0.0": + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dylib*", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.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}"] diff --git a/recipes/erkir/all/patches/1.0.0-0001-remove-testing.patch b/recipes/erkir/all/patches/1.0.0-0001-remove-testing.patch new file mode 100644 index 0000000000000..379ea53449dae --- /dev/null +++ b/recipes/erkir/all/patches/1.0.0-0001-remove-testing.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 673e4b8..851f78a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,19 +21,8 @@ add_library(erkir + ) + add_library(erkir::erkir ALIAS erkir) + +-add_executable(erkir_test +- test/test.cpp +-) +- +-target_link_libraries(erkir_test PRIVATE erkir) +- + # Includes + target_include_directories(erkir PUBLIC include) +-target_include_directories(erkir_test PRIVATE include) +-target_include_directories(erkir_test PRIVATE src) +- +-enable_testing() +-add_test(NAME Test COMMAND erkir_test) + + # Coverage support. + option(CODE_COVERAGE "Enable coverage reporting" ON) diff --git a/recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch b/recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch new file mode 100644 index 0000000000000..190ff9b9a3f95 --- /dev/null +++ b/recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 851f78a..6575859 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,8 @@ add_library(erkir::erkir ALIAS erkir) + # Includes + target_include_directories(erkir PUBLIC include) + ++set_target_properties(erkir PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++ + # Coverage support. + option(CODE_COVERAGE "Enable coverage reporting" ON) + if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") diff --git a/recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch b/recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch new file mode 100644 index 0000000000000..0a3aad55accce --- /dev/null +++ b/recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 52e5571..b97d9d0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,7 +17,7 @@ include(GNUInstallDirs) + option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + option(ENABLE_TESTING "Enable unit test build" OFF) + +-if (NOT MSVC) ++if (0) + # Specify the target architecture (Linux). For Windows based generator use rather + # '-A Win32' or '-A x64 options' + set(TARGET_ARCH x86 CACHE STRING "the target architecture") diff --git a/recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch b/recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch new file mode 100644 index 0000000000000..50bd8af00a0b8 --- /dev/null +++ b/recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b97d9d0..0152f84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,6 @@ 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) + + # The project definition + project(erkir VERSION 2.0.0 +@@ -14,7 +13,6 @@ project(erkir VERSION 2.0.0 + include(GNUInstallDirs) + + # General options +-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.0.0-0003-fix-erkir_export.patch b/recipes/erkir/all/patches/2.0.0-0003-fix-erkir_export.patch new file mode 100644 index 0000000000000..cef30fbc03eea --- /dev/null +++ b/recipes/erkir/all/patches/2.0.0-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 ccb807b..8eb005d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -37,6 +37,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/all/test_package/CMakeLists.txt b/recipes/erkir/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..135087f122cde --- /dev/null +++ b/recipes/erkir/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(erkir REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE erkir::erkir) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/erkir/all/test_package/conanfile.py b/recipes/erkir/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/erkir/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/erkir/all/test_package/test_package.cpp b/recipes/erkir/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..887871e867da3 --- /dev/null +++ b/recipes/erkir/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + // Calculate great-circle distance between two points. + erkir::spherical::Point p1{ 52.205, 0.119 }; + erkir::spherical::Point p2{ 48.857, 2.351 }; + auto d = p1.distanceTo(p2); // 404.3 km + + // Get destination point by given distance (shortest) and bearing from start point. + erkir::spherical::Point p3{ 51.4778, -0.0015 }; + auto dest = p3.destinationPoint(7794.0, 300.7); // 51.5135°N, 000.0983°W + + // Convert a point from one coordinates system to another. + erkir::ellipsoidal::Point pWGS84(51.4778, -0.0016, 0, erkir::ellipsoidal::Datum::Type::WGS84); + auto pOSGB = pWGS84.toDatum(erkir::ellipsoidal::Datum::Type::OSGB36); // 51.4778°N, 000.0000°E + + // Convert to Cartesian coordinates. + auto cartesian = pWGS84.toCartesianPoint(); + + // Convert Cartesian point to a geodetic one. + auto geoPoint = cartesian->toGeoPoint(); + + return 0; +} diff --git a/recipes/erkir/all/test_v1_package/CMakeLists.txt b/recipes/erkir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/erkir/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/erkir/all/test_v1_package/conanfile.py b/recipes/erkir/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/erkir/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/erkir/config.yml b/recipes/erkir/config.yml new file mode 100644 index 0000000000000..870fb33e55af0 --- /dev/null +++ b/recipes/erkir/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.0": + folder: all + "1.0.0": + folder: all diff --git a/recipes/etc2comp/all/CMakeLists.txt b/recipes/etc2comp/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/etc2comp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/etc2comp/all/conandata.yml b/recipes/etc2comp/all/conandata.yml new file mode 100644 index 0000000000000..c09fa8bdc3d9b --- /dev/null +++ b/recipes/etc2comp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20170424": + url: "https://github.com/google/etc2comp/archive/9cd0f9cae0f32338943699bb418107db61bb66f2.tar.gz" + sha256: "719f88aab5dc30c9e4a53c4a5925e22149d0371a16fbe45a1c3a79525a975266" +patches: + "cci.20170424": + - patch_file: "patches/fix-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/etc2comp/all/conanfile.py b/recipes/etc2comp/all/conanfile.py new file mode 100644 index 0000000000000..4a9a0df7d2266 --- /dev/null +++ b/recipes/etc2comp/all/conanfile.py @@ -0,0 +1,74 @@ +import os +import glob +from conans import ConanFile, CMake, tools + +class Etc2compConan(ConanFile): + name = "etc2comp" + description = "Open source c++ skeletal animation library and toolset." + license = "Apache-2.0", + topics = ("conan", "texture", "etc2", "compressor") + homepage = "https://github.com/google/etc2comp" + 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 + + @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): + if self.options.shared: + del self.options.fPIC + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob('etc2comp-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.lib", dst="lib", keep_path=False) + self.copy("*.dll", dst="bin", keep_path=False) + self.copy("*.so*", dst="lib", keep_path=False, symlinks=True) + self.copy("*.dylib", dst="lib", keep_path=False) + self.copy("*.a", dst="lib", keep_path=False) + self.copy("*.h", dst=os.path.join("include"), src=os.path.join(self._source_subfolder, "EtcLib"), keep_path=False) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/etc2comp/all/patches/fix-cmake.patch b/recipes/etc2comp/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..16f5bebd89067 --- /dev/null +++ b/recipes/etc2comp/all/patches/fix-cmake.patch @@ -0,0 +1,34 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,18 +12,8 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-cmake_minimum_required(VERSION 2.8.9) ++cmake_minimum_required(VERSION 3.1) + project(EtcTest) + + set (CMAKE_CXX_STANDARD 11) +-IF (APPLE) +- set (CMAKE_CXX_FLAGS "-I/usr/include/i386-linux-gnu/c++/4.8 -I/usr/include/c++/4.8 -std=c++11 -g3 -Wall -O3") +-ELSE () +- IF (WIN32) +- set (CMAKE_CXX_FLAGS "-I/usr/include/i386-linux-gnu/c++/4.8 -I/usr/include/c++/4.8 -W4 /EHsc") +- ELSE() +- set (CMAKE_CXX_FLAGS "-I/usr/include/i386-linux-gnu/c++/4.8 -I/usr/include/c++/4.8 -std=c++11 -pthread -g3 -Wall -O2") +- ENDIF() +-ENDIF () + ADD_SUBDIRECTORY(EtcLib) +-ADD_SUBDIRECTORY(EtcTool) +--- a/EtcLib/CMakeLists.txt ++++ b/EtcLib/CMakeLists.txt +@@ -22,3 +22,9 @@ file(GLOB SOURCES + ${PROJECT_SOURCE_DIR}/Etc/*.cpp + ${PROJECT_SOURCE_DIR}/EtcCodec/*.cpp) + ADD_LIBRARY(EtcLib ${SOURCES}) ++set(CMAKE_THREAD_PREFER_PTHREAD TRUE) ++set(THREADS_PREFER_PTHREAD_FLAG TRUE) ++find_package(Threads REQUIRED) ++if(CMAKE_USE_PTHREADS_INIT) ++ target_link_libraries(EtcLib PRIVATE Threads::Threads) ++endif() diff --git a/recipes/etc2comp/all/test_package/CMakeLists.txt b/recipes/etc2comp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aede60e3b1e4a --- /dev/null +++ b/recipes/etc2comp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/etc2comp/all/test_package/conanfile.py b/recipes/etc2comp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4903f1a7e8fa0 --- /dev/null +++ b/recipes/etc2comp/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/etc2comp/all/test_package/test_package.cpp b/recipes/etc2comp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8bc4d48909a05 --- /dev/null +++ b/recipes/etc2comp/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include "EtcImage.h" +#include "EtcColorFloatRGBA.h" + +int main() +{ + Etc::ColorFloatRGBA* pafrgbaPixels = new Etc::ColorFloatRGBA[256 * 256]; + + Etc::Image::EncodingStatus encStatus = Etc::Image::EncodingStatus::SUCCESS; + + delete[] pafrgbaPixels; + pafrgbaPixels = nullptr; + + return EXIT_SUCCESS; +} diff --git a/recipes/etc2comp/config.yml b/recipes/etc2comp/config.yml new file mode 100644 index 0000000000000..9ac31e90c7a47 --- /dev/null +++ b/recipes/etc2comp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20170424": + folder: all diff --git a/recipes/eternal/all/conandata.yml b/recipes/eternal/all/conandata.yml new file mode 100644 index 0000000000000..8214ea0955a49 --- /dev/null +++ b/recipes/eternal/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.1": + url: "https://github.com/mapbox/eternal/archive/refs/tags/v1.0.1.tar.gz" + sha256: "7d799381b3786d0bd987eea75df2a81f581a64ee962e922a2f7a7d3d0c3d0421" diff --git a/recipes/eternal/all/conanfile.py b/recipes/eternal/all/conanfile.py new file mode 100644 index 0000000000000..fd3a53c2138bb --- /dev/null +++ b/recipes/eternal/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class EternalConan(ConanFile): + name = "eternal" + description = "A C++14 compile-time/constexpr map and hash map with minimal binary footprint" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mapbox/eternal" + topics = ("hashing", "map", "constexpr", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "4", + "apple-clang": "10", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, 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 + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/eternal/all/test_package/CMakeLists.txt b/recipes/eternal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8d5920de9d2e0 --- /dev/null +++ b/recipes/eternal/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(eternal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eternal::eternal) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eternal/all/test_package/conanfile.py b/recipes/eternal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/eternal/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/eternal/all/test_package/test_package.cpp b/recipes/eternal/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..11565bc6294ec --- /dev/null +++ b/recipes/eternal/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +#include +#include +#include + +#include "mapbox/eternal.hpp" + +struct Color { + constexpr inline Color() { + } + constexpr inline Color(unsigned char r_, unsigned char g_, unsigned char b_, float a_) + : r(r_), g(g_), b(b_), a(a_ > 1 ? 1 : a_ < 0 ? 0 : a_) { + } + unsigned char r = 0, g = 0, b = 0; + float a = 1.0f; + + constexpr bool operator==(const Color& rhs) const { + return r == rhs.r && g == rhs.g && b == rhs.b && + (a >= rhs.a ? a - rhs.a : rhs.a - a) < std::numeric_limits::epsilon(); + } +}; + +MAPBOX_ETERNAL_CONSTEXPR const auto multi_colors = mapbox::eternal::map({ + { "red", { 255, 0, 0, 1 } }, + { "yellow", { 255, 255, 0, 1 } }, + { "white", { 255, 255, 255, 1 } }, // comes before yellow! + { "yellow", { 255, 220, 0, 1 } }, // a darker yellow +}); + +int main(void) { + static_assert(!multi_colors.unique(), "multi_colors are not unique"); + static_assert(multi_colors.find("yellow") != multi_colors.end(), "colors contains yellow"); + static_assert(multi_colors.find("yellow")->second == Color(255, 255, 0, 1), "yellow returns the correct color"); + static_assert((++multi_colors.find("yellow"))->second == Color(255, 220, 0, 1), "yellow returns the correct color"); + static_assert(multi_colors.equal_range("white").first == multi_colors.find("white"), "white range returns the correct begin"); + static_assert(multi_colors.equal_range("white").second == multi_colors.find("yellow"), "white range end is the next color"); + static_assert(multi_colors.equal_range("yellow").first == multi_colors.find("yellow"), "yellow range returns the correct begin"); + static_assert(multi_colors.equal_range("yellow").second == multi_colors.end(), "yellow range end returns end"); + static_assert(multi_colors.count("yellow") == 2, "has 2 yellows"); + + return EXIT_SUCCESS; +} diff --git a/recipes/eternal/all/test_v1_package/CMakeLists.txt b/recipes/eternal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e900db203f73f --- /dev/null +++ b/recipes/eternal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(eternal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eternal::eternal) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eternal/all/test_v1_package/conanfile.py b/recipes/eternal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/eternal/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/eternal/config.yml b/recipes/eternal/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/eternal/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/etl/all/conandata.yml b/recipes/etl/all/conandata.yml new file mode 100644 index 0000000000000..8cb6346b5426d --- /dev/null +++ b/recipes/etl/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "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.35.5": + url: "https://github.com/ETLCPP/etl/archive/20.35.5.tar.gz" + sha256: "d67aead4f1c023eaeb9ae67b62b0aed76138aa1b7dac48f627530ab3ea366281" + "20.35.0": + url: "https://github.com/ETLCPP/etl/archive/20.35.0.tar.gz" + sha256: "1bfbc5679bce41625add0e5d7354ab8521dc4811f13e1627a9816af65f49f42b" + "20.34.0": + url: "https://github.com/ETLCPP/etl/archive/20.34.0.tar.gz" + sha256: "56e25968f20167a161ee50c3eecda3daa91f696660ba59654c1afd22e502c465" + "20.33.0": + url: "https://github.com/ETLCPP/etl/archive/20.33.0.tar.gz" + sha256: "46068e44cc3cbd626fc8adc5344101b4654c675b9a5faec0c80989176419cd7d" + "20.32.1": + url: "https://github.com/ETLCPP/etl/archive/20.32.1.tar.gz" + sha256: "f39c8ccf33190303946dbcb2b251c86b4516234f57e0e87b83c0a28a1bdb059d" + "20.31.3": + url: "https://github.com/ETLCPP/etl/archive/20.31.3.tar.gz" + sha256: "dabfeaec4e0aaee6920ee429ab262959595b78d65ef7846df13b5fe68ea85f4b" + "20.30.1": + url: "https://github.com/ETLCPP/etl/archive/20.30.1.tar.gz" + sha256: "10b50ca3ae406ae379e85504546843fc9d97be18924e71d8eb7e8e5a418e91cd" + "20.29.3": + url: "https://github.com/ETLCPP/etl/archive/20.29.3.tar.gz" + sha256: "8a0df2b475ea99bb27dd4ee04c39bda69e29be93b3709a1e243dcc2599e92ff4" diff --git a/recipes/etl/all/conanfile.py b/recipes/etl/all/conanfile.py new file mode 100644 index 0000000000000..2eacebb25e1f6 --- /dev/null +++ b/recipes/etl/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.tools.files import get, copy, save +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") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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") + + 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 new file mode 100644 index 0000000000000..5755c51bbf480 --- /dev/null +++ b/recipes/etl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package 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} etl) diff --git a/recipes/etl/all/test_package/conanfile.py b/recipes/etl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..220ec13c13be3 --- /dev/null +++ b/recipes/etl/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +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 = "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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/etl/all/test_package/test_package.cpp b/recipes/etl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..767f8cbf18649 --- /dev/null +++ b/recipes/etl/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + const etl::array data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + return (data.size() == 10)?0:1; +} diff --git a/recipes/etl/all/test_v1_package/CMakeLists.txt b/recipes/etl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b8e7ad788b821 --- /dev/null +++ b/recipes/etl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +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) diff --git a/recipes/etl/all/test_v1_package/conanfile.py b/recipes/etl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/etl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml new file mode 100644 index 0000000000000..8fa9e8f7bd7b9 --- /dev/null +++ b/recipes/etl/config.yml @@ -0,0 +1,25 @@ +versions: + "20.35.14": + folder: all + "20.35.11": + folder: all + "20.35.8": + folder: all + "20.35.7": + folder: all + "20.35.5": + folder: all + "20.35.0": + folder: all + "20.34.0": + folder: all + "20.33.0": + folder: all + "20.32.1": + folder: all + "20.31.3": + folder: all + "20.30.1": + folder: all + "20.29.3": + folder: all diff --git a/recipes/exiv2/all/conandata.yml b/recipes/exiv2/all/conandata.yml new file mode 100644 index 0000000000000..63e5ef9836649 --- /dev/null +++ b/recipes/exiv2/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "0.27.5": + url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.5/exiv2-0.27.5-Source.tar.gz" + sha256: "35a58618ab236a901ca4928b0ad8b31007ebdc0386d904409d825024e45ea6e2" + "0.27.4": + url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.4/exiv2-0.27.4-Source.tar.gz" + sha256: "84366dba7c162af9a7603bcd6c16f40fe0e9af294ba2fd2f66ffffb9fbec904e" +patches: + "0.27.5": + - patch_file: "patches/0001-link-0.27.5.patch" + - patch_file: "patches/0003-fix-ios.patch" + - patch_file: "patches/0004-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" + "0.27.4": + - patch_file: "patches/0001-link.patch" + - patch_file: "patches/0002-fpic.patch" + - patch_file: "patches/0003-fix-ios.patch" + - patch_file: "patches/0004-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" diff --git a/recipes/exiv2/all/conanfile.py b/recipes/exiv2/all/conanfile.py new file mode 100644 index 0000000000000..34ee99761cacc --- /dev/null +++ b/recipes/exiv2/all/conanfile.py @@ -0,0 +1,167 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Exiv2Conan(ConanFile): + name = "exiv2" + description = "Exiv2 is a C++ library and a command-line utility " \ + "to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata." + license = "GPL-2.0" + topics = ("image", "exif", "xmp") + homepage = "https://www.exiv2.org" + 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_png": [True, False], + "with_xmp": [False, "bundled", "external"], + "with_curl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + "with_xmp": "bundled", + "with_curl": False, + } + + provides = [] + + 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.with_xmp == "bundled": + # recipe has bundled xmp-toolkit-sdk of old version + # avoid conflict with a future xmp recipe + self.provides.append("xmp-toolkit-sdk") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + if self.options.with_png: + self.requires("libpng/1.6.39") + self.requires("zlib/1.2.13") + if self.options.with_xmp == "bundled": + self.requires("expat/2.5.0") + if self.options.with_curl: + self.requires("libcurl/7.87.0") + + def validate(self): + if self.options.with_xmp == "external": + raise ConanInvalidConfiguration("adobe-xmp-toolkit is not available on cci (yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EXIV2_BUILD_SAMPLES"] = False + tc.variables["EXIV2_BUILD_EXIV2_COMMAND"] = False + tc.variables["EXIV2_ENABLE_PNG"] = self.options.with_png + tc.variables["EXIV2_ENABLE_XMP"] = self.options.with_xmp == "bundled" + tc.variables["EXIV2_ENABLE_EXTERNAL_XMP"] = self.options.with_xmp == "external" + # NLS is used only for tool which is not built + tc.variables["EXIV2_ENABLE_NLS"] = False + tc.variables["EXIV2_ENABLE_WEBREADY"] = self.options.with_curl + tc.variables["EXIV2_ENABLE_CURL"] = self.options.with_curl + tc.variables["EXIV2_ENABLE_SSH"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + if is_msvc(self): + tc.variables["EXIV2_ENABLE_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) + # set PIC manually because of object target exiv2_int + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = bool(self.options.get_safe("fPIC", True)) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + targets = {"exiv2lib": "exiv2::exiv2lib"} + if self.options.with_xmp == "bundled": + targets.update({"exiv2-xmp": "exiv2::exiv2-xmp"}) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + targets + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "exiv2") + self.cpp_info.set_property("pkg_config_name", "exiv2") + + # component exiv2lib + self.cpp_info.components["exiv2lib"].set_property("cmake_target_name", "exiv2lib") + self.cpp_info.components["exiv2lib"].libs = ["exiv2"] + self.cpp_info.components["exiv2lib"].requires = [ "libiconv::libiconv"] + if self.options.with_png: + self.cpp_info.components["exiv2lib"].requires.extend(["libpng::libpng", "zlib::zlib"]) + if self.options.with_curl: + self.cpp_info.components["exiv2lib"].requires.append("libcurl::libcurl") + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["exiv2lib"].system_libs.extend(["pthread"]) + if self.settings.os == "Windows": + self.cpp_info.components["exiv2lib"].system_libs.extend(["psapi", "ws2_32"]) + self.cpp_info.components["exiv2lib"].defines.append("WIN32_LEAN_AND_MEAN") + + # component exiv2-xmp + if self.options.with_xmp == "bundled": + self.cpp_info.components["exiv2-xmp"].set_property("cmake_target_name", "exiv2-xmp") + self.cpp_info.components["exiv2-xmp"].libs = ["exiv2-xmp"] + self.cpp_info.components["exiv2-xmp"].requires = [ "expat::expat" ] + self.cpp_info.components["exiv2lib"].requires.append("exiv2-xmp") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["exiv2lib"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["exiv2lib"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_xmp == "bundled": + self.cpp_info.components["exiv2-xmp"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["exiv2-xmp"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/exiv2/all/patches/0001-link-0.27.5.patch b/recipes/exiv2/all/patches/0001-link-0.27.5.patch new file mode 100644 index 0000000000000..b94b7e7a8c10c --- /dev/null +++ b/recipes/exiv2/all/patches/0001-link-0.27.5.patch @@ -0,0 +1,29 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 26e5a951..141211ef 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -142,11 +142,6 @@ if (MSVC) + set_target_properties(exiv2lib PROPERTIES LINK_FLAGS "/ignore:4099") + endif() + +-set_target_properties( exiv2lib_int PROPERTIES +- POSITION_INDEPENDENT_CODE ON +- COMPILE_DEFINITIONS exiv2lib_EXPORTS +-) +- + # NOTE: Cannot use target_link_libraries on OBJECT libraries with old versions of CMake + target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR}) + target_include_directories(exiv2lib SYSTEM PRIVATE +diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt +index a22698fb..9ef87970 100644 +--- a/xmpsdk/CMakeLists.txt ++++ b/xmpsdk/CMakeLists.txt +@@ -28,7 +28,7 @@ add_library(exiv2-xmp STATIC + + target_link_libraries(exiv2-xmp + PRIVATE +- $ ++ EXPAT::EXPAT + ) + + target_include_directories(exiv2-xmp diff --git a/recipes/exiv2/all/patches/0001-link.patch b/recipes/exiv2/all/patches/0001-link.patch new file mode 100644 index 0000000000000..fd93d6c5c3698 --- /dev/null +++ b/recipes/exiv2/all/patches/0001-link.patch @@ -0,0 +1,26 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c52b352f..2c270c5f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -215,7 +215,7 @@ else() + endif() + + if( EXIV2_ENABLE_PNG ) +- target_link_libraries( exiv2lib PRIVATE $) ++ target_link_libraries( exiv2lib PRIVATE ZLIB::ZLIB) + endif() + + if( EXIV2_ENABLE_NLS ) +diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt +index a22698fb..9ef87970 100644 +--- a/xmpsdk/CMakeLists.txt ++++ b/xmpsdk/CMakeLists.txt +@@ -28,7 +28,7 @@ add_library(exiv2-xmp STATIC + + target_link_libraries(exiv2-xmp + PRIVATE +- $ ++ EXPAT::EXPAT + ) + + target_include_directories(exiv2-xmp diff --git a/recipes/exiv2/all/patches/0002-fpic.patch b/recipes/exiv2/all/patches/0002-fpic.patch new file mode 100644 index 0000000000000..680f251bd8de4 --- /dev/null +++ b/recipes/exiv2/all/patches/0002-fpic.patch @@ -0,0 +1,16 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c52b352f..92fcd847 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -142,11 +142,6 @@ if (MSVC) + set_target_properties(exiv2lib PROPERTIES LINK_FLAGS "/ignore:4099") + endif() + +-set_target_properties( exiv2lib_int PROPERTIES +- POSITION_INDEPENDENT_CODE ON +- COMPILE_DEFINITIONS exiv2lib_EXPORTS +-) +- + target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR}) + target_include_directories(exiv2lib PRIVATE + $ diff --git a/recipes/exiv2/all/patches/0003-fix-ios.patch b/recipes/exiv2/all/patches/0003-fix-ios.patch new file mode 100644 index 0000000000000..062b6990f2cb2 --- /dev/null +++ b/recipes/exiv2/all/patches/0003-fix-ios.patch @@ -0,0 +1,30 @@ +patch from https://github.com/Exiv2/exiv2/pull/1718 + +--- a/src/futils.cpp ++++ b/src/futils.cpp +@@ -47,8 +47,11 @@ + #if defined(_MSC_VER) + #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + #elif defined(__APPLE__) ++#include ++#ifndef TARGET_OS_IPHONE + #include + #endif ++#endif + + #if defined(__FreeBSD__) + #include +@@ -445,11 +448,13 @@ namespace Exiv2 { + CloseHandle(processHandle); + } + #elif defined(__APPLE__) ++ #ifndef TARGET_OS_IPHONE + const int pid = getpid(); + char pathbuf[PROC_PIDPATHINFO_MAXSIZE]; + if (proc_pidpath (pid, pathbuf, sizeof(pathbuf)) > 0) { + ret = pathbuf; + } ++ #endif + #elif defined(__FreeBSD__) + unsigned int n; + char buffer[PATH_MAX] = {}; diff --git a/recipes/exiv2/all/patches/0004-find-expat.patch b/recipes/exiv2/all/patches/0004-find-expat.patch new file mode 100644 index 0000000000000..5bb571eb0f807 --- /dev/null +++ b/recipes/exiv2/all/patches/0004-find-expat.patch @@ -0,0 +1,15 @@ +Ensure to use FindEXPAT.cmake instead of expat-config.cmake +(side effect of CMAKE_FIND_PACKAGE_PREFER_CONFIG ON, see https://github.com/conan-io/conan/issues/10387) +diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake +index ec3a43f5..27bf42d3 100644 +--- a/cmake/findDependencies.cmake ++++ b/cmake/findDependencies.cmake +@@ -42,7 +42,7 @@ if (EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP) + message(FATAL_ERROR "EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive. You can only choose one of them") + else() + if (EXIV2_ENABLE_XMP) +- find_package(EXPAT REQUIRED) ++ find_package(EXPAT REQUIRED MODULE) + elseif (EXIV2_ENABLE_EXTERNAL_XMP) + find_package(XmpSdk REQUIRED) + endif () diff --git a/recipes/exiv2/all/test_package/CMakeLists.txt b/recipes/exiv2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3bd4318c428ba --- /dev/null +++ b/recipes/exiv2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(exiv2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} exiv2lib) diff --git a/recipes/exiv2/all/test_package/conanfile.py b/recipes/exiv2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/exiv2/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/exiv2/all/test_package/test_package.cpp b/recipes/exiv2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e92e73571e294 --- /dev/null +++ b/recipes/exiv2/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + std::cout << Exiv2::versionString() << std::endl; + return 0; +} diff --git a/recipes/exiv2/all/test_v1_package/CMakeLists.txt b/recipes/exiv2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/exiv2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/exiv2/all/test_v1_package/conanfile.py b/recipes/exiv2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b6a26067f365d --- /dev/null +++ b/recipes/exiv2/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/exiv2/config.yml b/recipes/exiv2/config.yml new file mode 100644 index 0000000000000..470d3a327a30b --- /dev/null +++ b/recipes/exiv2/config.yml @@ -0,0 +1,5 @@ +versions: + "0.27.5": + folder: all + "0.27.4": + folder: all diff --git a/recipes/expat/all/conandata.yml b/recipes/expat/all/conandata.yml new file mode 100644 index 0000000000000..f3b9d575c901c --- /dev/null +++ b/recipes/expat/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "2.5.0": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.xz" + sha256: "ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe" + "2.4.9": + sha256: "6e8c0728fe5c7cd3f93a6acce43046c5e4736c7b4b68e032e9350daa0efc0354" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_9/expat-2.4.9.tar.xz" + "2.4.8": + sha256: "f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz" + "2.4.7": + sha256: "9875621085300591f1e64c18fd3da3a0eeca4a74f884b9abac2758ad1bd07a7d" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_7/expat-2.4.7.tar.xz" + "2.4.6": + sha256: "de55794b7a9bc214852fdc075beaaecd854efe1361597e6268ee87946951289b" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_6/expat-2.4.6.tar.xz" + "2.4.5": + sha256: "f2af8fc7cdc63a87920da38cd6d12cb113c3c3a3f437495b1b6541e0cff32579" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_5/expat-2.4.5.tar.xz" + "2.4.4": + sha256: "b5d25d6e373351c2ed19b562b4732d01d2589ac8c8e9e7962d8df1207cc311b8" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_4/expat-2.4.4.tar.xz" + "2.4.3": + sha256: "b1f9f1b1a5ebb0acaa88c9ff79bfa4e145823b78aa5185e5c5d85f060824778a" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_3/expat-2.4.3.tar.xz" + "2.4.2": + sha256: "a2fb692e8e610406168296f25ba500ae8ce22cb4c8947a8689894d744b6deb02" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_2/expat-2.4.2.tar.gz" + "2.4.1": + sha256: "a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.gz" + "2.3.0": + sha256: "89df123c62f2c2e2b235692d9fe76def6a9ab03dbe95835345bf412726eb1987" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz" + "2.2.10": + sha256: "bf42d1f52371d23684de36cc6d2f0f1acd02de264d1105bdc17792bbeb7e7ceb" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_2_10/expat-2.2.10.tar.gz" +patches: + "2.3.0": + - patch_file: "patches/0001-2.3.0-relax-vs-restriction.patch" diff --git a/recipes/expat/all/conanfile.py b/recipes/expat/all/conanfile.py new file mode 100644 index 0000000000000..36b0654037e28 --- /dev/null +++ b/recipes/expat/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class ExpatConan(ConanFile): + name = "expat" + description = "Fast streaming XML parser written in C." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libexpat/libexpat" + topics = ("xml", "parsing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "char_type": ["char", "wchar_t", "ushort"], + } + default_options = { + "shared": False, + "fPIC": True, + "char_type": "char", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EXPAT_BUILD_DOCS"] = False + tc.variables["EXPAT_BUILD_EXAMPLES"] = False + tc.variables["EXPAT_SHARED_LIBS"] = self.options.shared + tc.variables["EXPAT_BUILD_TESTS"] = False + tc.variables["EXPAT_BUILD_TOOLS"] = False + tc.variables["EXPAT_CHAR_TYPE"] = self.options.char_type + if is_msvc(self): + tc.variables["EXPAT_MSVC_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["EXPAT_BUILD_PKGCONFIG"] = 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")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "EXPAT") + self.cpp_info.set_property("cmake_module_target_name", "EXPAT::EXPAT") + self.cpp_info.set_property("cmake_file_name", "expat") + self.cpp_info.set_property("cmake_target_name", "expat::expat") + self.cpp_info.set_property("pkg_config_name", "expat") + + self.cpp_info.libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.defines = ["XML_STATIC"] + if self.options.get_safe("char_type") in ("wchar_t", "ushort"): + self.cpp_info.defines.append("XML_UNICODE") + elif self.options.get_safe("char_type") == "wchar_t": + self.cpp_info.defines.append("XML_UNICODE_WCHAR_T") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "EXPAT" + self.cpp_info.names["cmake_find_package_multi"] = "expat" diff --git a/recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch b/recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch new file mode 100644 index 0000000000000..e365197cbaef5 --- /dev/null +++ b/recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch @@ -0,0 +1,13 @@ +diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt +index e3564691..0dc5cf80 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -133,7 +133,7 @@ if(MSVC) + # Minimum supported MSVC version is 1910 = Visual Studio 15.0/2017 + # See also https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html + if(MSVC_VERSION VERSION_LESS 1910) +- message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is not a supported Visual Studio compiler version. Please use Visual Studio 15.0/2017 or any later version.") ++ message(WARNING "MSVC_VERSION ${MSVC_VERSION} is not a supported Visual Studio compiler version. Please use Visual Studio 15.0/2017 or any later version.") + endif() + endif() + diff --git a/recipes/expat/all/test_package/CMakeLists.txt b/recipes/expat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5129dd0d2152f --- /dev/null +++ b/recipes/expat/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(expat REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE expat::expat) diff --git a/recipes/expat/all/test_package/conanfile.py b/recipes/expat/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/expat/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/expat/all/test_package/test_package.c b/recipes/expat/all/test_package/test_package.c new file mode 100644 index 0000000000000..71ad7b8f7ebc2 --- /dev/null +++ b/recipes/expat/all/test_package/test_package.c @@ -0,0 +1,64 @@ +/* This is simple demonstration of how to use expat. This program + reads an XML document from standard input and writes a line with + the name of each element to standard output indenting child + elements by one tab stop more than their parent element. + It must be used with Expat compiled for UTF-8 output. +*/ + +#include +#include "expat.h" + +#ifdef XML_UNICODE_WCHAR_T +#include +#endif + +#ifdef XML_LARGE_SIZE +#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 +#define XML_FMT_INT_MOD "I64" +#else +#define XML_FMT_INT_MOD "ll" +#endif +#else +#define XML_FMT_INT_MOD "l" +#endif + +static void XMLCALL +startElement(void *userData, const XML_Char *name, const XML_Char **atts) +{ + int i; + int *depthPtr = (int *)userData; + (void)atts; + + for (i = 0; i < *depthPtr; i++) + putchar('\t'); +#ifdef XML_UNICODE_WCHAR_T + fputws(name, stdout); +#else + puts(name); +#endif + *depthPtr += 1; +} + +static void XMLCALL +endElement(void *userData, const XML_Char *name) +{ + int *depthPtr = (int *)userData; + (void)name; + + *depthPtr -= 1; +} + +int +main(int argc, char *argv[]) +{ + XML_Parser parser = XML_ParserCreate(NULL); + int depth = 0; + (void)argc; + (void)argv; + + XML_SetUserData(parser, &depth); + XML_SetElementHandler(parser, startElement, endElement); + XML_ParserFree(parser); + printf("Test application successfully ran!\n"); + return 0; +} diff --git a/recipes/expat/all/test_package_module/CMakeLists.txt b/recipes/expat/all/test_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..9d264c42f3e45 --- /dev/null +++ b/recipes/expat/all/test_package_module/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package LANGUAGES C) + +find_package(EXPAT REQUIRED MODULE) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE EXPAT::EXPAT) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindEXPAT.html +# are properly defined in conan generators +set(_custom_vars + EXPAT_INCLUDE_DIRS + EXPAT_LIBRARIES + EXPAT_FOUND +) +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/expat/all/test_package_module/conanfile.py b/recipes/expat/all/test_package_module/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/expat/all/test_package_module/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/expat/all/test_v1_package/CMakeLists.txt b/recipes/expat/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/expat/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/expat/all/test_v1_package/conanfile.py b/recipes/expat/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/expat/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/expat/all/test_v1_package_module/CMakeLists.txt b/recipes/expat/all/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..1626621388ae7 --- /dev/null +++ b/recipes/expat/all/test_v1_package_module/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package_module/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module/) diff --git a/recipes/expat/all/test_v1_package_module/conanfile.py b/recipes/expat/all/test_v1_package_module/conanfile.py new file mode 100644 index 0000000000000..5f9efeb33878b --- /dev/null +++ b/recipes/expat/all/test_v1_package_module/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + 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/expat/config.yml b/recipes/expat/config.yml new file mode 100644 index 0000000000000..e09e9d75495cc --- /dev/null +++ b/recipes/expat/config.yml @@ -0,0 +1,25 @@ +versions: + "2.5.0": + folder: all + "2.4.9": + folder: all + "2.4.8": + folder: all + "2.4.7": + folder: all + "2.4.6": + folder: all + "2.4.5": + folder: all + "2.4.4": + folder: all + "2.4.3": + folder: all + "2.4.2": + folder: all + "2.4.1": + folder: all + "2.3.0": + folder: all + "2.2.10": + folder: all diff --git a/recipes/expected-lite/all/conandata.yml b/recipes/expected-lite/all/conandata.yml new file mode 100644 index 0000000000000..d3a6677071af2 --- /dev/null +++ b/recipes/expected-lite/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.6.3": + url: "https://github.com/martinmoene/expected-lite/archive/v0.6.3.tar.gz" + sha256: "b2f90d5f03f6423ec67cc3c06fd0c4e813ec10c4313062b875b37d17593b57b4" + "0.6.2": + url: "https://github.com/martinmoene/expected-lite/archive/v0.6.2.tar.gz" + sha256: "8e3c58fddb32abc22a429543440554f1ae50d1de3fb9a0abf699bc3f247dc1da" + "0.6.1": + url: "https://github.com/martinmoene/expected-lite/archive/v0.6.1.tar.gz" + sha256: "91724069aaab7491d48ac0711f9af7fd4fd1a3b0f95406c3a773b7944e67f125" + "0.6.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.6.0.tar.gz" + sha256: "90478ff7345100bf7539b12ea2c5ff04a7b6290bc5c280f02b473d5c65165342" + "0.5.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.5.0.tar.gz" + sha256: "80f8c91d228cdc5cac3698141c0321d51dcdb0239c2fdcdeae7d46a9a58f2297" + "0.4.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.4.0.tar.gz" + sha256: "bf4c0ceec0f1197f33dbab1d5cce43af8722d9507143c6ec837ee3288e29f80c" + "0.3.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.3.0.tar.gz" + sha256: "fc942ce0614e9498bff6f35f1ee8d58f83026bac904d9ab427a2e822b5bdfcbd" diff --git a/recipes/expected-lite/all/conanfile.py b/recipes/expected-lite/all/conanfile.py new file mode 100644 index 0000000000000..d5786a1bd1873 --- /dev/null +++ b/recipes/expected-lite/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class 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" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "expected-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::expected-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "expected-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "expected-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["expectedlite"].names["cmake_find_package"] = "expected-lite" + self.cpp_info.components["expectedlite"].names["cmake_find_package_multi"] = "expected-lite" + self.cpp_info.components["expectedlite"].set_property("cmake_target_name", "nonstd::expected-lite") diff --git a/recipes/expected-lite/all/test_package/CMakeLists.txt b/recipes/expected-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1d87701ed4e32 --- /dev/null +++ b/recipes/expected-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(expected-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::expected-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/expected-lite/all/test_package/conanfile.py b/recipes/expected-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/expected-lite/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/expected-lite/all/test_package/test_package.cpp b/recipes/expected-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3b396b0f56e20 --- /dev/null +++ b/recipes/expected-lite/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include "nonstd/expected.hpp" + +#include +#include +#include + +using nonstd::expected; + +using ErrorInfo = expected; + +ErrorInfo to_int( char const * const text ) +{ + char * pos = NULL; + const int value = static_cast( strtol( text, &pos, 0 ) ); + + return pos == text ? nonstd::make_unexpected(std::string("Failed to convert '") + text + std::string("' to int")) : ErrorInfo(value); +} + +int main( int argc, char * argv[] ) +{ + const char * text = argc > 1 ? argv[1] : "42"; + + auto val = to_int( text ); + + if ( val ) std::cout << "'" << text << "' is " << val.value() << std::endl; + else std::cout << "'" << text << "' isn't a number. Error: " << val.error() << std::endl; +} + +// cl -nologo -W3 -EHsc -I../include to_int.cpp && to_int x1 +// g++ -Wall -Wextra -std=c++03 -I../include -o to_int.exe to_int.cpp && to_int x1 diff --git a/recipes/expected-lite/all/test_v1_package/CMakeLists.txt b/recipes/expected-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d57a2501c92f1 --- /dev/null +++ b/recipes/expected-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(expected-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::expected-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/expected-lite/all/test_v1_package/conanfile.py b/recipes/expected-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/expected-lite/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/expected-lite/config.yml b/recipes/expected-lite/config.yml new file mode 100644 index 0000000000000..9fcad808e37e7 --- /dev/null +++ b/recipes/expected-lite/config.yml @@ -0,0 +1,15 @@ +versions: + "0.6.3": + folder: all + "0.6.2": + folder: all + "0.6.1": + folder: all + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all + "0.3.0": + folder: all diff --git a/recipes/exprtk/all/conandata.yml b/recipes/exprtk/all/conandata.yml new file mode 100755 index 0000000000000..8720b949093ed --- /dev/null +++ b/recipes/exprtk/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.0.2": + url: "https://github.com/ArashPartow/exprtk/archive/0.0.2.tar.gz" + sha256: "7e8de4a0bfc9855c1316d8b8bc422061aef9a307c2f42d2e66298980463195c1" + + "0.0.1": + url: "https://github.com/ArashPartow/exprtk/archive/refs/tags/0.0.1.tar.gz" + sha256: "fb72791c88ae3b3426e14fdad630027715682584daf56b973569718c56e33f28" diff --git a/recipes/exprtk/all/conanfile.py b/recipes/exprtk/all/conanfile.py new file mode 100755 index 0000000000000..4df0e1b342c15 --- /dev/null +++ b/recipes/exprtk/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy, load, save +import os + +required_conan_version = ">=1.53.0" + + +class ExprTkConan(ConanFile): + name = "exprtk" + description = "C++ Mathematical Expression Parsing And Evaluation Library ExprTk" + license = "MIT" + topics = ("math", "mathematics", "parser", "lexer", "numerical", "header-only") + homepage = "https://www.partow.net/programming/exprtk/index.html" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _extract_license(self): + exprtk_header_file = "exprtk.hpp" + file = os.path.join(self.source_folder, exprtk_header_file) + file_content = load(self, file) + license_end = "/MIT *" + license_contents = file_content[2:file_content.find(license_end) + len(license_end)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + def package(self): + self._extract_license() + copy(self, "exprtk.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/exprtk/all/test_package/CMakeLists.txt b/recipes/exprtk/all/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..632ea1ba6d56e --- /dev/null +++ b/recipes/exprtk/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(exprtk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE exprtk::exprtk) + +if (MSVC) + # Compile will fail without this flag + # TODO should this be something added into conan recipe? + target_compile_options(${PROJECT_NAME} PRIVATE "/bigobj") +endif (MSVC) diff --git a/recipes/exprtk/all/test_package/conanfile.py b/recipes/exprtk/all/test_package/conanfile.py new file mode 100755 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/exprtk/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/exprtk/all/test_package/test_package.cpp b/recipes/exprtk/all/test_package/test_package.cpp new file mode 100755 index 0000000000000..8ae4a2288e7ce --- /dev/null +++ b/recipes/exprtk/all/test_package/test_package.cpp @@ -0,0 +1,78 @@ +/* + ************************************************************** + * C++ Mathematical Expression Toolkit Library * + * * + * Exprtk Test Package * + * Author: Arash Partow (1999-2022) * + * URL: https://www.partow.net/programming/exprtk/index.html * + * * + * Copyright notice: * + * Free use of the Mathematical Expression Toolkit Library is * + * permitted under the guidelines and in accordance with the * + * most current version of the MIT License. * + * http://www.opensource.org/licenses/MIT * + * * + ************************************************************** +*/ + + +#include +#include + +#include + + +template +void test_function() +{ + typedef exprtk::symbol_table symbol_table_t; + typedef exprtk::expression expression_t; + typedef exprtk::parser parser_t; + typedef exprtk::parser_error::type error_t; + + symbol_table_t symbol_table; + expression_t expression; + parser_t parser; + + T x = 1; + T y = 2; + + const std::string expression_string = "x * y + 3"; + + symbol_table.add_variable("x",x); + symbol_table.add_variable("y",y); + + expression.register_symbol_table(symbol_table); + + if (!parser.compile(expression_string,expression)) + { + printf("Error: %s\tExpression: %s\n", + parser.error().c_str(), + expression_string.c_str()); + + for (std::size_t i = 0; i < parser.error_count(); ++i) + { + const error_t error = parser.get_error(i); + + printf("Error: %02d Position: %02d " + "Type: [%s] " + "Message: %s " + "Expression: %s\n", + static_cast(i), + static_cast(error.token.position), + exprtk::parser_error::to_str(error.mode).c_str(), + error.diagnostic.c_str(), + expression_string.c_str()); + } + + return; + } + + expression.value(); +} + +int main() +{ + test_function(); + return 0; +} diff --git a/recipes/exprtk/all/test_v1_package/CMakeLists.txt b/recipes/exprtk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/exprtk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/exprtk/all/test_v1_package/conanfile.py b/recipes/exprtk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/exprtk/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/exprtk/config.yml b/recipes/exprtk/config.yml new file mode 100755 index 0000000000000..9873c37c1518d --- /dev/null +++ b/recipes/exprtk/config.yml @@ -0,0 +1,5 @@ +versions: + "0.0.2": + folder: "all" + "0.0.1": + folder: "all" diff --git a/recipes/extra-cmake-modules/all/conandata.yml b/recipes/extra-cmake-modules/all/conandata.yml new file mode 100644 index 0000000000000..c1c71096d72a6 --- /dev/null +++ b/recipes/extra-cmake-modules/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "5.75.0": + url: "https://download.kde.org/stable/frameworks/5.75/extra-cmake-modules-5.75.0.zip" + sha256: "dc937fd2018eb8285c1b07d4b5de104c60959404c4979883f6bdb0a4d40cf98e" + "5.80.0": + url: "https://download.kde.org/stable/frameworks/5.80/extra-cmake-modules-5.80.0.tar.xz" + sha256: "2370fd80f685533d0b96efa6fa443ceea68e0ceba4e8a9d7c151d297b1c96f64" + "5.84.0": + url: "https://download.kde.org/stable/frameworks/5.84/extra-cmake-modules-5.84.0.tar.xz" + sha256: "bb085ef2e177c182ff46988516b6b31849d1497beb2ff5301165ad2ba12a1c41" + "5.93.0": + url: "https://download.kde.org/stable/frameworks/5.93/extra-cmake-modules-5.93.0.tar.xz" + sha256: "093dea7b11647bc5f74e6971d47ef15b5c410cba2b4620acae00f008d5480b21" diff --git a/recipes/extra-cmake-modules/all/conanfile.py b/recipes/extra-cmake-modules/all/conanfile.py new file mode 100644 index 0000000000000..260ac51ba3a9a --- /dev/null +++ b/recipes/extra-cmake-modules/all/conanfile.py @@ -0,0 +1,56 @@ +import os +from conans import ConanFile, CMake, tools + +class ExtracmakemodulesConan(ConanFile): + name = "extra-cmake-modules" + license = ("MIT", "BSD-2-Clause", "BSD-3-Clause") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://api.kde.org/ecm/" + topics = ("conan", "cmake", "toolchain", "build-settings") + description = "KDE's CMake modules" + generators = "cmake" + no_copy_source = False + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("extra-cmake-modules-{}".format(self.version), self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + # KB-H016: do not install Find*.cmake + tools.replace_path_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "install(FILES ${installFindModuleFiles} DESTINATION ${FIND_MODULES_INSTALL_DIR})", "") + + self._cmake = CMake(self) + self._cmake.definitions["BUILD_HTML_DOCS"] = False + self._cmake.definitions["BUILD_QTHELP_DOCS"] = False + self._cmake.definitions["BUILD_MAN_DOCS"] = False + self._cmake.definitions["SHARE_INSTALL_DIR"] = os.path.join(self.package_folder, "res") + self._cmake.configure(source_folder=os.path.join(self.source_folder, self._source_subfolder)) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("testhelper.h", src=os.path.join(self.source_folder, self._source_subfolder, "tests/ECMAddTests"), dst="res/tests") + self.copy("*", src=os.path.join(self.source_folder, self._source_subfolder, "LICENSES"), dst="licenses") + + def package_info(self): + self.cpp_info.resdirs = ["res"] + self.cpp_info.builddirs = ["res/ECM/cmake", "res/ECM/kde-modules", "res/ECM/modules", "res/ECM/test-modules", "res/ECM/toolchain"] + + def package_id(self): + self.info.header_only() + diff --git a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..96f9cb73534c7 --- /dev/null +++ b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + + +find_package(ECM REQUIRED NO_MODULE) +list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) +include(ECMGenerateHeaders) + +add_library(MyLib INTERFACE) +target_include_directories(MyLib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") +ecm_generate_headers( + MyLib_FORWARDING_HEADERS + HEADER_NAMES Foo + REQUIRED_HEADERS MyLib_HEADERS +) + +add_executable(example example.cpp) +target_link_libraries(example MyLib) diff --git a/recipes/extra-cmake-modules/all/test_package/conanfile.py b/recipes/extra-cmake-modules/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1ffe0933a5715 --- /dev/null +++ b/recipes/extra-cmake-modules/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + +class ExtraCMakeModulesTestConan(ConanFile): + settings = "os", "compiler", "arch", "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", "example") + self.run(bin_path, run_environment=True) + diff --git a/recipes/extra-cmake-modules/all/test_package/example.cpp b/recipes/extra-cmake-modules/all/test_package/example.cpp new file mode 100644 index 0000000000000..e187901537727 --- /dev/null +++ b/recipes/extra-cmake-modules/all/test_package/example.cpp @@ -0,0 +1,6 @@ +#include // This header should be created by ECM + +int main() +{ + return success(); +} diff --git a/recipes/extra-cmake-modules/all/test_package/foo.h b/recipes/extra-cmake-modules/all/test_package/foo.h new file mode 100644 index 0000000000000..601218dcdca80 --- /dev/null +++ b/recipes/extra-cmake-modules/all/test_package/foo.h @@ -0,0 +1,5 @@ +int success() +{ + return 0; +} + diff --git a/recipes/extra-cmake-modules/config.yml b/recipes/extra-cmake-modules/config.yml new file mode 100644 index 0000000000000..c17f03346f04f --- /dev/null +++ b/recipes/extra-cmake-modules/config.yml @@ -0,0 +1,9 @@ +versions: + "5.75.0": + folder: "all" + "5.80.0": + folder: "all" + "5.84.0": + folder: "all" + "5.93.0": + folder: "all" diff --git a/recipes/ezc3d/all/conandata.yml b/recipes/ezc3d/all/conandata.yml new file mode 100644 index 0000000000000..7c22e7d856992 --- /dev/null +++ b/recipes/ezc3d/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.5.0": + url: "https://github.com/pyomeca/ezc3d/archive/refs/tags/Release_1.5.0.tar.gz" + sha256: "8387857d989f5bbb62869ec930b417e6d0a303eef9b39e8b0e6b35437d5809ce" + "1.4.8": + url: "https://github.com/pyomeca/ezc3d/archive/refs/tags/Release_1.4.8.tar.gz" + sha256: "ebe69a97ba64b463b0d4b0bd1657fa55af9bc17572a3b6bf9e8b321846cd30c8" + "1.3.8": + url: "https://github.com/pyomeca/ezc3d/archive/Release_1.3.8.tar.gz" + sha256: "888cb191c7939b31891e93356aa5bfcf21edb8785d3b5d4d9ec215984bc8b83e" +patches: + "1.4.8": + - patch_file: "patches/0001-fix-cmake-1.4.8.patch" + "1.3.8": + - patch_file: "patches/0001-fix-cmake-1.3.8.patch" diff --git a/recipes/ezc3d/all/conanfile.py b/recipes/ezc3d/all/conanfile.py new file mode 100644 index 0000000000000..61652bf6c8d41 --- /dev/null +++ b/recipes/ezc3d/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Ezc3dConan(ConanFile): + name = "ezc3d" + description = "EZC3D is an easy to use reader, modifier and writer for C3D format files." + license = "MIT" + topics = ("ezc3d", "c3d") + homepage = "https://github.com/pyomeca/ezc3d" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_MATRIX_FAST_ACCESSOR"] = True + tc.variables["BINDER_PYTHON3"] = False + tc.variables["BINDER_MATLAB"] = False + if Version(self.version) >= "1.4.3": + tc.variables["BINDER_OCTAVE"] = False + tc.variables["BUILD_EXAMPLE"] = False + tc.variables["BUILD_DOC"] = False + tc.variables["GET_OFFICIAL_DOCUMENTATION"] = False + tc.variables["BUILD_TESTS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove once cmake_find_package* removed in conan v2 + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"ezc3d": "ezc3d::ezc3d"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ezc3d") + self.cpp_info.set_property("cmake_target_name", "ezc3d") + + self.cpp_info.includedirs.append(os.path.join("include", "ezc3d")) + lib_suffix = {"Debug": "_debug"}.get(str(self.settings.build_type), "") + self.cpp_info.libs = [f"ezc3d{lib_suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + # TODO: to remove once cmake_find_package* removed in conan v2 + self.cpp_info.names["cmake_find_package"] = "ezc3d" + self.cpp_info.names["cmake_find_package_multi"] = "ezc3d" + 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/ezc3d/all/patches/0001-fix-cmake-1.3.8.patch b/recipes/ezc3d/all/patches/0001-fix-cmake-1.3.8.patch new file mode 100644 index 0000000000000..29143b93ecbef --- /dev/null +++ b/recipes/ezc3d/all/patches/0001-fix-cmake-1.3.8.patch @@ -0,0 +1,35 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.8) + cmake_policy(SET CMP0048 NEW) + project(ezc3d VERSION 1.3.7) + set(EZC3D_NAME ${PROJECT_NAME}) +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + set(EZC3D_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) + set(EZC3D_VERSION_MINOR ${PROJECT_VERSION_MINOR}) + set(EZC3D_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +@@ -45,6 +43,7 @@ if (BUILD_SHARED_LIBS) + else() + add_library(${PROJECT_NAME} STATIC ${SRC_LIST}) + endif() ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + set_target_properties(${PROJECT_NAME} PROPERTIES + DEBUG_POSTFIX "_debug" + CXX_VISIBILITY_PRESET hidden +@@ -79,12 +78,12 @@ target_include_directories(${PROJECT_NAME} INTERFACE + + # Install target + if(WIN32) +- set(${PROJECT_NAME}_LIB_FOLDER Lib) ++ set(${PROJECT_NAME}_LIB_FOLDER lib) + set(${PROJECT_NAME}_BIN_FOLDER bin) + set(${PROJECT_NAME}_INCLUDE_FOLDER include/${PROJECT_NAME}) + else() +- set(${PROJECT_NAME}_LIB_FOLDER lib/${PROJECT_NAME}) +- set(${PROJECT_NAME}_BIN_FOLDER lib/${PROJECT_NAME}) ++ set(${PROJECT_NAME}_LIB_FOLDER lib) ++ set(${PROJECT_NAME}_BIN_FOLDER bin) + set(${PROJECT_NAME}_INCLUDE_FOLDER include/${PROJECT_NAME}) + endif() + install(TARGETS ${PROJECT_NAME} EXPORT ezc3dTargets diff --git a/recipes/ezc3d/all/patches/0001-fix-cmake-1.4.8.patch b/recipes/ezc3d/all/patches/0001-fix-cmake-1.4.8.patch new file mode 100644 index 0000000000000..5edaea8bb062b --- /dev/null +++ b/recipes/ezc3d/all/patches/0001-fix-cmake-1.4.8.patch @@ -0,0 +1,35 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,8 +3,6 @@ cmake_policy(SET CMP0048 NEW) + project(ezc3d VERSION 1.4.8) + set(EZC3D_NAME ${PROJECT_NAME}) + set(EZC3D_ROOT_FOLDER ${PROJECT_SOURCE_DIR}) +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + set(EZC3D_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) + set(EZC3D_VERSION_MINOR ${PROJECT_VERSION_MINOR}) + set(EZC3D_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +@@ -56,6 +54,7 @@ if (BUILD_SHARED_LIBS) + else() + add_library(${PROJECT_NAME} STATIC ${SRC_LIST}) + endif() ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + set_target_properties(${PROJECT_NAME} PROPERTIES + DEBUG_POSTFIX "_debug" + CXX_VISIBILITY_PRESET hidden +@@ -91,12 +90,12 @@ target_include_directories(${PROJECT_NAME} INTERFACE + # Install target + if(WIN32) + # NOTE: Maybe use GNUInstallDirs? +- set(${PROJECT_NAME}_LIB_FOLDER Lib CACHE STRING "ARCHIVE/LIBRARY DESTINATION") ++ set(${PROJECT_NAME}_LIB_FOLDER lib CACHE STRING "ARCHIVE/LIBRARY DESTINATION") + set(${PROJECT_NAME}_BIN_FOLDER bin CACHE STRING "RUNTIME DESTINATION") + set(${PROJECT_NAME}_INCLUDE_FOLDER include/${PROJECT_NAME} CACHE STRING "INCLUDE DESTINATION") + else() +- set(${PROJECT_NAME}_LIB_FOLDER lib/${PROJECT_NAME} CACHE STRING "ARCHIVE/LIBRARY DESTINATION") +- set(${PROJECT_NAME}_BIN_FOLDER lib/${PROJECT_NAME} CACHE STRING "RUNTIME DESTINATION") ++ set(${PROJECT_NAME}_LIB_FOLDER lib CACHE STRING "ARCHIVE/LIBRARY DESTINATION") ++ set(${PROJECT_NAME}_BIN_FOLDER bin CACHE STRING "RUNTIME DESTINATION") + set(${PROJECT_NAME}_INCLUDE_FOLDER include/${PROJECT_NAME} CACHE STRING "INCLUDE DESTINATION") + endif() + install(TARGETS ${PROJECT_NAME} EXPORT ezc3dTargets diff --git a/recipes/ezc3d/all/test_package/CMakeLists.txt b/recipes/ezc3d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b1b2099ff3c1c --- /dev/null +++ b/recipes/ezc3d/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ezc3d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ezc3d) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ezc3d/all/test_package/conanfile.py b/recipes/ezc3d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ezc3d/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/ezc3d/all/test_package/test_package.cpp b/recipes/ezc3d/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5f3be679e9a1f --- /dev/null +++ b/recipes/ezc3d/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + ezc3d::c3d c3d; + return 0; +} diff --git a/recipes/ezc3d/all/test_v1_package/CMakeLists.txt b/recipes/ezc3d/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ezc3d/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ezc3d/all/test_v1_package/conanfile.py b/recipes/ezc3d/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ezc3d/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/ezc3d/config.yml b/recipes/ezc3d/config.yml new file mode 100644 index 0000000000000..3d5d9b1cd1d49 --- /dev/null +++ b/recipes/ezc3d/config.yml @@ -0,0 +1,7 @@ +versions: + "1.5.0": + folder: all + "1.4.8": + folder: all + "1.3.8": + folder: all diff --git a/recipes/faac/all/conandata.yml b/recipes/faac/all/conandata.yml new file mode 100644 index 0000000000000..a217e9fd92fd5 --- /dev/null +++ b/recipes/faac/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.30": + url: "https://github.com/knik0/faac/archive/1_30.tar.gz" + sha256: "adc387ce588cca16d98c03b6ec1e58f0ffd9fc6eadb00e254157d6b16203b2d2" +patches: + "1.30": + - patch_file: "patches/1.30-0001-fix-out-of-root-build.patch" + patch_description: "Fix out of root build" + patch_source: "https://github.com/knik0/faac/commit/c8d12a5c7c5b6f1c4593f0a6c1eeceacc4d7c941.patch" + patch_type: "conan" + - patch_file: "patches/1.30-0002-dont-hardcode-x86.patch" + patch_description: "Allow to build for x86_64" + patch_type: "portability" + - patch_file: "patches/1.30-0003-relax-windows-sdk.patch" + patch_description: "Don't constrain Windows SDK" + patch_type: "portability" diff --git a/recipes/faac/all/conanfile.py b/recipes/faac/all/conanfile.py new file mode 100644 index 0000000000000..101a73acd4cc4 --- /dev/null +++ b/recipes/faac/all/conanfile.py @@ -0,0 +1,191 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, 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, MSBuild, MSBuildToolchain +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class FaacConan(ConanFile): + name = "faac" + description = "Freeware Advanced Audio Coder" + topics = ("audio", "mp4", "encoder", "aac", "m4a", "faac") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/faac" + license = "LGPL-2.0-only" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_mp4": [True, False], + "drm": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_mp4": False, + "drm": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _has_mp4_option(self): + return Version(self.version) < "1.29.1" + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + @property + def _sln_folder(self): + return os.path.join(self.source_folder, "project", "msvc") + + 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_mp4_option: + del self.options.with_mp4 + + 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): + # FIXME: libfaac depends on kissfft. Try to unvendor this dependency + pass + + def validate(self): + if is_msvc(self): + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} only supports x86 and x86_64 with Visual Studio") + if self.options.drm and not self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} with drm support can't be built as static with Visual Studio") + if self.options.get_safe("with_mp4"): + # TODO: as mpv4v2 as a conan package + raise ConanInvalidConfiguration("building with mp4v2 is not supported currently") + + def build_requirements(self): + 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) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.generate() + else: + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.append(f"--enable-drm={yes_no(self.options.drm)}") + if self._has_mp4_option: + tc.configure_args.append(f"--with-mp4v2={yes_no(self.options.with_mp4)}") + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + #========================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + vcxproj_files = ["faac.vcxproj", "libfaac.vcxproj", "libfaac_dll.vcxproj", "libfaac_dll_drm.vcxproj"] + platform_toolset = MSBuildToolchain(self).toolset + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + for vcxproj_file in vcxproj_files: + replace_in_file( + self, os.path.join(self._sln_folder, vcxproj_file), + "v141", + f"{platform_toolset}", + ) + replace_in_file( + self, os.path.join(self._sln_folder, vcxproj_file), + "", + f"", + ) + #========================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + # Allow to build for other archs than Win32 + if self.settings.arch != "x86": + for vc_proj_file in ( + "faac.sln", "faac.vcxproj", "libfaac.vcxproj", + "libfaac_dll.vcxproj", "libfaac_dll_drm.vcxproj" + ): + replace_in_file(self, os.path.join(self._sln_folder, vc_proj_file), "Win32", msbuild.platform) + targets = ["faac"] + if self.options.drm: + targets.append("libfaac_dll_drm") + else: + targets.append("libfaac_dll" if self.options.shared else "libfaac") + msbuild.build(os.path.join(self._sln_folder, "faac.sln"), targets=targets) + else: + autotools = Autotools(self) + autotools.autoreconf() + if self._is_mingw and self.options.shared: + replace_in_file(self, os.path.join(self.build_folder, "libfaac", "Makefile"), + "\nlibfaac_la_LIBADD = ", + "\nlibfaac_la_LIBADD = -no-undefined ") + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + output_folder = os.path.join(self._sln_folder, "bin", self._msbuild_configuration) + copy(self, "*.exe", src=output_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.dll", src=output_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + if self.options.drm: + old_libname = "libfaacdrm.lib" + new_libname = "faac_drm.lib" + else: + old_libname = "libfaac_dll.lib" if self.options.shared else "libfaac.lib" + new_libname = "faac.lib" + lib_folder = os.path.join(self.package_folder, "lib") + copy(self, old_libname, src=output_folder, dst=lib_folder, keep_path=False) + rename(self, os.path.join(lib_folder, old_libname), os.path.join(lib_folder, new_libname)) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + suffix = "_drm" if self.options.drm else "" + self.cpp_info.libs = [f"faac{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/faac/all/patches/1.30-0001-fix-out-of-root-build.patch b/recipes/faac/all/patches/1.30-0001-fix-out-of-root-build.patch new file mode 100644 index 0000000000000..134c51ffeb5d1 --- /dev/null +++ b/recipes/faac/all/patches/1.30-0001-fix-out-of-root-build.patch @@ -0,0 +1,29 @@ +From c8d12a5c7c5b6f1c4593f0a6c1eeceacc4d7c941 Mon Sep 17 00:00:00 2001 +From: Christopher Degawa +Date: Sun, 29 Dec 2019 21:10:15 +0000 +Subject: [PATCH] frontend: fix out-of-root build + +from https://github.com/m-ab-s/media-autobuild_suite/commit/11d58abd8fde7c70378993029bad7bbaeb5f7e3e +--- + frontend/Makefile.am | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/frontend/Makefile.am b/frontend/Makefile.am +index dbe88c4..745a2f1 100644 +--- a/frontend/Makefile.am ++++ b/frontend/Makefile.am +@@ -14,10 +14,10 @@ bin_PROGRAMS += faacgui + faacgui_SOURCES = maingui.c input.c input.h resource.h + faac_LDADD += -lws2_32 icon.o + faacgui_LDADD = $(faac_LDADD) faacguires.o -lcomdlg32 +-faacguires.o: +- $(WINDRES) faacgui.rc faacguires.o +-icon.o: +- $(WINDRES) icon.rc icon.o ++faacguires.o: faacgui.rc ++ $(WINDRES) $(top_srcdir)/frontend/faacgui.rc faacguires.o ++icon.o: icon.rc ++ $(WINDRES) $(top_srcdir)/frontend/icon.rc icon.o + endif + + endif # !USE_DRM diff --git a/recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch b/recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch new file mode 100644 index 0000000000000..f39de0190d9d7 --- /dev/null +++ b/recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch @@ -0,0 +1,74 @@ +--- a/project/msvc/faac.vcxproj ++++ b/project/msvc/faac.vcxproj +@@ -66,7 +66,7 @@ + 0x0413 + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + true + Console +@@ -89,7 +89,7 @@ + 0x0413 + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + Console + +--- a/project/msvc/libfaac_dll.vcxproj ++++ b/project/msvc/libfaac_dll.vcxproj +@@ -61,10 +61,9 @@ + true + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def +- MachineX86 + + + Retrieving package version... +@@ -84,11 +83,10 @@ + EditAndContinue + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def + true +- MachineX86 + + + Retrieving package version... +--- a/project/msvc/libfaac_dll_drm.vcxproj ++++ b/project/msvc/libfaac_dll_drm.vcxproj +@@ -61,10 +61,9 @@ + true + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def +- MachineX86 + $(OutDir)libfaacdrm.lib + + +@@ -85,11 +84,10 @@ + EditAndContinue + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def + true +- MachineX86 + $(OutDir)libfaacdrm.lib + + diff --git a/recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch b/recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch new file mode 100644 index 0000000000000..772fe863051a4 --- /dev/null +++ b/recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch @@ -0,0 +1,40 @@ +--- a/project/msvc/faac.vcxproj ++++ b/project/msvc/faac.vcxproj +@@ -12,7 +12,6 @@ + + + {92992E74-AEDE-46DC-AD8C-ADEA876F1A4C} +- 8.1 + + + +--- a/project/msvc/libfaac.vcxproj ++++ b/project/msvc/libfaac.vcxproj +@@ -13,7 +13,6 @@ + + libfaac + {9CC48C6E-92EB-4814-AD37-97AB3622AB65} +- 8.1 + + + +--- a/project/msvc/libfaac_dll.vcxproj ++++ b/project/msvc/libfaac_dll.vcxproj +@@ -13,7 +13,6 @@ + + libfaac_dll + {856BB8CF-B944-4D7A-9D59-4945316229AA} +- 8.1 + + + +--- a/project/msvc/libfaac_dll_drm.vcxproj ++++ b/project/msvc/libfaac_dll_drm.vcxproj +@@ -13,7 +13,6 @@ + + libfaac_dll_drm + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F} +- 8.1 + + + diff --git a/recipes/faac/all/test_package/CMakeLists.txt b/recipes/faac/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d2d4532f8451f --- /dev/null +++ b/recipes/faac/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(faac REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE faac::faac) diff --git a/recipes/faac/all/test_package/conanfile.py b/recipes/faac/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/faac/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/faac/all/test_package/test_package.c b/recipes/faac/all/test_package/test_package.c new file mode 100644 index 0000000000000..91e3f9bf61bbb --- /dev/null +++ b/recipes/faac/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include +#include + +int main() +{ + char *faac_id_string; + char *faac_copyright_string; + // get faac version + if (faacEncGetVersion(&faac_id_string, &faac_copyright_string) == + FAAC_CFG_VERSION) + { + fprintf(stderr, "Freeware Advanced Audio Coder\nFAAC %s\n", + faac_id_string); + } + else + { + fprintf(stderr, __FILE__ "(%d): wrong libfaac version\n", __LINE__); + return 1; + } + return 0; +} diff --git a/recipes/faac/all/test_v1_package/CMakeLists.txt b/recipes/faac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/faac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/faac/all/test_v1_package/conanfile.py b/recipes/faac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/faac/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/faac/config.yml b/recipes/faac/config.yml new file mode 100644 index 0000000000000..a6f1b0cffc2dd --- /dev/null +++ b/recipes/faac/config.yml @@ -0,0 +1,3 @@ +versions: + "1.30": + folder: all diff --git a/recipes/fakeit/all/conandata.yml b/recipes/fakeit/all/conandata.yml new file mode 100644 index 0000000000000..9b66729378da9 --- /dev/null +++ b/recipes/fakeit/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "2.4.0": + url: "https://github.com/eranpeer/FakeIt/archive/2.4.0.tar.gz" + sha256: "eb79459ad6a97a5c985e3301b0d44538bdce2ba26115afe040f3874688edefb5" + "2.3.2": + url: "https://github.com/eranpeer/FakeIt/archive/2.3.2.tar.gz" + sha256: "d2472d0d4b3dce83e8c9672e9221375c7a0c32aa8fe57c20075776928142b495" + "2.3.1": + url: "https://github.com/eranpeer/FakeIt/archive/2.3.1.tar.gz" + sha256: "8dea371c729ff4b5f007dafc95e7807ea146402a3b0da1b5a11cace538a57b61" + "2.3.0": + url: "https://github.com/eranpeer/FakeIt/archive/2.3.0.tar.gz" + sha256: "990469c1e4608ebf662d64e979aa607a0c32faa40cc5ffe38b74c7dd6968ed2d" + "2.2.0": + url: "https://github.com/eranpeer/FakeIt/archive/2.2.0.tar.gz" + sha256: "a54267fc5787acda229be11d3f5ea9a80339a385685e0e0c4d7df0a304a6f57d" + "2.1.0": + url: "https://github.com/eranpeer/FakeIt/archive/2.1.0.tar.gz" + sha256: "695826dc5c3012e57f2c7aa9801c7af1d1a8677f88c624343b3039c6b5c59871" + "2.0.9": + url: "https://github.com/eranpeer/FakeIt/archive/2.0.9.tar.gz" + sha256: "dc4ee7b17a84c959019b92c20fce6dc9426e9e170b6edf84db6cb2e188520cd7" + "2.0.8": + url: "https://github.com/eranpeer/FakeIt/archive/2.0.8.tar.gz" + sha256: "beff681216e6645ede25af1cc4dc743d525f38cba1fa4a58f964efcaba0dd7e5" + "2.0.7": + url: "https://github.com/eranpeer/FakeIt/archive/2.0.7.tar.gz" + sha256: "e28ad1181487447a7add926a289d0db0bbb354a64d3395f75066b74750a93769" diff --git a/recipes/fakeit/all/conanfile.py b/recipes/fakeit/all/conanfile.py new file mode 100644 index 0000000000000..821c0ce34e387 --- /dev/null +++ b/recipes/fakeit/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 apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + +class FakeItConan(ConanFile): + name = "fakeit" + description = "C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking." + topics = ("mock", "fake", "spy") + license = "MIT" + homepage = "https://github.com/eranpeer/FakeIt" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "integration": ["boost", "catch", "cute", "gtest", "mettle", "nunit", "mstest", "qtest", "standalone", "tpunit"] + } + default_options = {"integration": "standalone"} + 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 requirements(self): + if self.options.integration == "boost": + self.requires("boost/1.79.0") + elif self.options.integration == "catch": + self.requires("catch2/2.13.9") + elif self.options.integration == "gtest": + self.requires("gtest/1.11.0") + elif self.options.integration == "qtest": + self.requires("qt/6.3.0") + elif self.options.integration == "standalone": + pass + else: + raise ConanInvalidConfiguration("%s is not (yet) available on cci" % self.options.integration) + + def package_id(self): + # The "integration" option must be kept because it will impact which header is packaged, + # therefor self.info.clear() cannot be used. + self.info.settings.clear() + self.info.requires.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): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="fakeit.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "single_header", str(self.options.integration)), + ) diff --git a/recipes/fakeit/all/test_package/CMakeLists.txt b/recipes/fakeit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc2658ff1b34e --- /dev/null +++ b/recipes/fakeit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(fakeit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_link_libraries(${PROJECT_NAME} fakeit::fakeit) diff --git a/recipes/fakeit/all/test_package/conanfile.py b/recipes/fakeit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..159d15723bbfa --- /dev/null +++ b/recipes/fakeit/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 FakeItTestConan(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/fakeit/all/test_package/test_package.cpp b/recipes/fakeit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..09cbc49e98b63 --- /dev/null +++ b/recipes/fakeit/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include +#include +#include + +using namespace fakeit; + +struct SomeInterface +{ + virtual int foo(int) = 0; + virtual int bar(std::string) = 0; +}; + +int main(int, char**) +{ + Mock mock; + + When(Method(mock,foo)).Return(0); + SomeInterface& i = mock.get(); + + // Production code + i.foo(1); + // Verify method mock.foo was invoked. + Verify(Method(mock,foo)); + // Verify method mock.foo was invoked with specific arguments. + Verify(Method(mock,foo).Using(1)); + + std::cout << "Success !" << std::endl; + + return 0; +} diff --git a/recipes/fakeit/all/test_v1_package/CMakeLists.txt b/recipes/fakeit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/fakeit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fakeit/all/test_v1_package/conanfile.py b/recipes/fakeit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a1bf8d95c2742 --- /dev/null +++ b/recipes/fakeit/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class FakeItTestV1Conan(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/fakeit/config.yml b/recipes/fakeit/config.yml new file mode 100644 index 0000000000000..2d2179fc9b476 --- /dev/null +++ b/recipes/fakeit/config.yml @@ -0,0 +1,19 @@ +versions: + "2.4.0": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.1.0": + folder: all + "2.0.9": + folder: all + "2.0.8": + folder: all + "2.0.7": + folder: all diff --git a/recipes/farmhash/all/CMakeLists.txt b/recipes/farmhash/all/CMakeLists.txt new file mode 100644 index 0000000000000..fd338ded4ae99 --- /dev/null +++ b/recipes/farmhash/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.4) +project(farmhash LANGUAGES CXX) + +include(GNUInstallDirs) + +if(NOT FARMHASH_NO_BUILTIN_EXPECT) + # Transcribed from farmhash/src/Makefile.am + include(CheckCXXSourceCompiles) + check_cxx_source_compiles( + "int main(int argc, char* argv[]) { return (int)__builtin_expect(0, 0); }" + FARMHASH_HAS_BUILTIN_EXPECT + ) +endif() + +add_library(farmhash "${FARMHASH_SRC_DIR}/src/farmhash.cc" ) +target_include_directories(farmhash PRIVATE "${FARMHASH_SRC_DIR}/src") + +if(NOT FARMHASH_HAS_BUILTIN_EXPECT) + target_compile_definitions(farmhash PUBLIC FARMHASH_NO_BUILTIN_EXPECT) +endif() + +set_target_properties(farmhash + PROPERTIES + PUBLIC_HEADER "${FARMHASH_SRC_DIR}/src/farmhash.h" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +install(TARGETS farmhash + 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/farmhash/all/conandata.yml b/recipes/farmhash/all/conandata.yml new file mode 100644 index 0000000000000..64c0c2f2f2894 --- /dev/null +++ b/recipes/farmhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20190513": + url: "https://github.com/google/farmhash/archive/0d859a811870d10f53a594927d0d0b97573ad06d.tar.gz" + sha256: "18392cf0736e1d62ecbb8d695c31496b6507859e8c75541d7ad0ba092dc52115" diff --git a/recipes/farmhash/all/conanfile.py b/recipes/farmhash/all/conanfile.py new file mode 100644 index 0000000000000..f0ae10679b01c --- /dev/null +++ b/recipes/farmhash/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class FarmhashConan(ConanFile): + name = "farmhash" + description = "A family of hash functions" + topics = ("hash", "google", "family") + license = "MIT" + homepage = "https://github.com/google/farmhash" + 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], + "no_builtin_expect": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "no_builtin_expect": False, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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["FARMHASH_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["FARMHASH_NO_BUILTIN_EXPECT"] = self.options.no_builtin_expect + 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, "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 = ["farmhash"] diff --git a/recipes/farmhash/all/test_package/CMakeLists.txt b/recipes/farmhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8229712d40a9e --- /dev/null +++ b/recipes/farmhash/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(farmhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE farmhash::farmhash) diff --git a/recipes/farmhash/all/test_package/conanfile.py b/recipes/farmhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/farmhash/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/farmhash/all/test_package/test_package.cpp b/recipes/farmhash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..22e5ba91f7634 --- /dev/null +++ b/recipes/farmhash/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +#include +#include + +int main() { + + std::string aString = "Conan"; + uint32_t hashResult; + + hashResult = util::Hash32(aString); + + std::cout << "Input string: " << aString << std::endl; + std::cout << "Generated hash: " << hashResult << std::endl; + + return 0; +} diff --git a/recipes/farmhash/all/test_v1_package/CMakeLists.txt b/recipes/farmhash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/farmhash/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/farmhash/all/test_v1_package/conanfile.py b/recipes/farmhash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/farmhash/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/farmhash/config.yml b/recipes/farmhash/config.yml new file mode 100644 index 0000000000000..a94d138fcd02f --- /dev/null +++ b/recipes/farmhash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190513": + folder: all diff --git a/recipes/fast-cdr/all/conandata.yml b/recipes/fast-cdr/all/conandata.yml new file mode 100644 index 0000000000000..6a9ba77868449 --- /dev/null +++ b/recipes/fast-cdr/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.0.27": + url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.27.tar.gz" + sha256: "a9bc8fd31a2c2b95e6d2fb46e6ce1ad733e86dc4442f733479e33ed9cdc54bf6" + "1.0.26": + url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.26.tar.gz" + sha256: "812b29dd9fa8b79395dea3f4b810f9ab9e820fa4f0a666338c279b739a36595d" + "1.0.24": + url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.24.tar.gz" + sha256: "ecd688ab89ff1c03b9031c314891ae60995e2e73d919b93569eb840d6e87dec2" + "1.0.23": + url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.23.tar.gz" + sha256: "6f7c9c6c0c82c150b5ea2b0a58d5c9a466b87a1fcfca40d5786d99d4963a6721" + "1.0.22": + url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.22.tar.gz" + sha256: "7ca7f09c633963622431bdb216eeb4145e378f81a2ce5113e341b9eee55e4f44" + "1.0.21": + url: "https://github.com/eProsima/Fast-CDR/archive/refs/tags/v1.0.21.tar.gz" + sha256: "C1F32BDD76910ADA00D551EB8828DE7561AD2B2846D063CB4316F9262C03C77D" diff --git a/recipes/fast-cdr/all/conanfile.py b/recipes/fast-cdr/all/conanfile.py new file mode 100644 index 0000000000000..c39c56b44ddc4 --- /dev/null +++ b/recipes/fast-cdr/all/conanfile.py @@ -0,0 +1,107 @@ +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 collect_libs, copy, get, rm, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class FastCDRConan(ConanFile): + name = "fast-cdr" + license = "Apache-2.0" + homepage = "https://github.com/eProsima/Fast-CDR" + url = "https://github.com/conan-io/conan-center-index" + description = "eProsima FastCDR library for serialization" + topics = ("dds", "middleware", "serialization") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + 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): + # This combination leads to an fast-cdr error when linking + # linking dynamic '*.dll' and static MT runtime + # see https://github.com/eProsima/Fast-CDR/blob/v1.0.21/include/fastcdr/eProsima_auto_link.h#L37 + # (2021-05-31) + raise ConanInvalidConfiguration("Mixing a dll eprosima library with a static runtime is a bad idea") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"fastcdr": "fastcdr::fastcdr"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fastcdr") + self.cpp_info.set_property("cmake_target_name", "fastcdr") + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("FASTCDR_DYN_LINK") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "fastcdr" + self.cpp_info.names["cmake_find_package_multi"] = "fastcdr" + 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/fast-cdr/all/test_package/CMakeLists.txt b/recipes/fast-cdr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a71d2d409cc4 --- /dev/null +++ b/recipes/fast-cdr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fastcdr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fastcdr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast-cdr/all/test_package/conanfile.py b/recipes/fast-cdr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/fast-cdr/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/fast-cdr/all/test_package/test_package.cpp b/recipes/fast-cdr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3a437b366c3c4 --- /dev/null +++ b/recipes/fast-cdr/all/test_package/test_package.cpp @@ -0,0 +1,74 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include +#include +#include + +#define N_ARR_ELEMENTS 5 + +static const char char_seq_t[N_ARR_ELEMENTS] = {'E', 'D', 'C', 'B', 'A'}; +static const std::wstring wstring_t = L"Hola a todos, esto es un test con widestring"; + +using namespace eprosima::fastcdr; + +#define BUFFER_LENGTH 2000 + + +void check_good_case() +{ + char buffer[BUFFER_LENGTH]; + const std::wstring& input_value = wstring_t; + + // Serialization. + { + FastBuffer cdrbuffer(buffer, BUFFER_LENGTH); + Cdr cdr_ser(cdrbuffer); + cdr_ser << input_value; + } + + // Deserialization. + { + FastBuffer cdrbuffer(buffer, BUFFER_LENGTH); + Cdr cdr_des(cdrbuffer); + std::wstring output_value{}; + + cdr_des >> output_value; + } +} + + +int main() +{ + check_good_case(); + + char buffer[BUFFER_LENGTH]; + + // Serialization. + FastBuffer cdrbuffer(buffer, BUFFER_LENGTH); + Cdr cdr_ser(cdrbuffer); + cdr_ser.serializeSequence(char_seq_t, 5); + + // Deserialization. + Cdr cdr_des(cdrbuffer); + + char* char_seq_value = NULL; size_t char_seq_len = 0; + + cdr_des.deserializeSequence(char_seq_value, char_seq_len); + + return 0; +} diff --git a/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt b/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fast-cdr/all/test_v1_package/conanfile.py b/recipes/fast-cdr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fast-cdr/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/fast-cdr/config.yml b/recipes/fast-cdr/config.yml new file mode 100644 index 0000000000000..3527dfb5e8511 --- /dev/null +++ b/recipes/fast-cdr/config.yml @@ -0,0 +1,13 @@ +versions: + "1.0.27": + folder: all + "1.0.26": + folder: all + "1.0.24": + folder: all + "1.0.23": + folder: all + "1.0.22": + folder: all + "1.0.21": + folder: all diff --git a/recipes/fast-cpp-csv-parser/all/conandata.yml b/recipes/fast-cpp-csv-parser/all/conandata.yml new file mode 100644 index 0000000000000..87d270e80c74e --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20211104": + url: "https://github.com/ben-strasser/fast-cpp-csv-parser/archive/5a417973b4cea674a5e4a3b88a23098a2ab75479.zip" + sha256: "33a22bda2603a87b8f36c79673339490f58656d92a4882e788de3f4ef7ec57b2" + "cci.20200830": + url: "https://github.com/ben-strasser/fast-cpp-csv-parser/archive/1165be530d19ed730228dd122f2df0896be8f64e.zip" + sha256: "28ae9e3b95dcb7a78086ff1425f3bd1258407ebedc34d8517c5bcb8084b5833e" + "20191004": + url: "https://github.com/ben-strasser/fast-cpp-csv-parser/archive/713c5fd2ba1b6d145296a21fc7f9dee576daaa4f.zip" + sha256: "cef1aa042b8d82722e02af2f09659d5b8aeba10fcf431b2fe8ce452798423a56" diff --git a/recipes/fast-cpp-csv-parser/all/conanfile.py b/recipes/fast-cpp-csv-parser/all/conanfile.py new file mode 100644 index 0000000000000..f20fc50349a4e --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class FastcppcsvparserConan(ConanFile): + name = "fast-cpp-csv-parser" + description = "C++11 header-only library for reading comma separated value (CSV) files." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ben-strasser/fast-cpp-csv-parser" + topics = ("csv", "parser", "header-only") + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_thread": [True, False], + } + default_options = { + "with_thread": True, + } + + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "csv.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "fast-cpp-csv-parser")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "fast-cpp-csv-parser")) + if not self.options.with_thread: + self.cpp_info.defines.append("CSV_IO_NO_THREAD") + if self.settings.os in ["Linux", "FreeBSD"] and self.options.with_thread: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt b/recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9136830af77ff --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fast-cpp-csv-parser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fast-cpp-csv-parser::fast-cpp-csv-parser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py b/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ca068b831644c --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + csv_name = os.path.join(self.source_folder, "test_package.csv") + self.run(f"{bin_path} {csv_name}", env="conanrun") diff --git a/recipes/fast-cpp-csv-parser/all/test_package/test_package.cpp b/recipes/fast-cpp-csv-parser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef153d5b367a6 --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include +#include + +int main(int argc, char **argv) { + if (argc < 2) { + std::cerr << "Need at least one argument\n"; + return 1; + } + + io::CSVReader<3> in(argv[1]); + in.read_header(io::ignore_extra_column, "First Name", "Last Name", "Age"); + std::string first_name; std::string last_name; double age; + while (in.read_row(first_name, last_name, age)) { + std::cout << first_name << " " << last_name << " " << age << '\n'; + } + + return 0; +} diff --git a/recipes/fast-cpp-csv-parser/all/test_package/test_package.csv b/recipes/fast-cpp-csv-parser/all/test_package/test_package.csv new file mode 100644 index 0000000000000..09cbcd57c8cde --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/test_package/test_package.csv @@ -0,0 +1,3 @@ +First Name,Last Name,Age +John,Doe,38 +Mary,Blake,25 diff --git a/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt b/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c53b3fb245385 --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fast-cpp-csv-parser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fast-cpp-csv-parser::fast-cpp-csv-parser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast-cpp-csv-parser/all/test_v1_package/conanfile.py b/recipes/fast-cpp-csv-parser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..47d6b79839192 --- /dev/null +++ b/recipes/fast-cpp-csv-parser/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + csv_name = os.path.join(self.source_folder, os.pardir, "test_package", "test_package.csv") + self.run(f"{bin_path} {csv_name}", run_environment=True) diff --git a/recipes/fast-cpp-csv-parser/config.yml b/recipes/fast-cpp-csv-parser/config.yml new file mode 100644 index 0000000000000..ca4b1e35049ab --- /dev/null +++ b/recipes/fast-cpp-csv-parser/config.yml @@ -0,0 +1,7 @@ +versions: + "cci.20211104": + folder: all + "cci.20200830": + folder: all + "20191004": + folder: all diff --git a/recipes/fast-dds/all/conandata.yml b/recipes/fast-dds/all/conandata.yml new file mode 100644 index 0000000000000..b9e90bef53612 --- /dev/null +++ b/recipes/fast-dds/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "2.3.4": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.4.tar.gz" + sha256: "b1b2322de0ca55a16495666e3fbda8aca32b888bbfaecda29f2ffc4b072ef7ac" + "2.3.3": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.3.tar.gz" + sha256: "5ebf27d810c6ab68eef7d42937cd421d85e50509ae96883239979a1b3a2f4f82" + "2.3.2": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.2.tar.gz" + sha256: "4d8183cf4d37c3de9e6fd28d2850dd08023a9079001c4880b23c95f0d8c0b5ce" +patches: + "2.3.4": + - patch_file: "patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch" + patch_type: "conan" + patch_description: "Fixup find asio and tinyxml2" + "2.3.3": + - patch_file: "patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch" + patch_type: "conan" + patch_description: "Fixup find asio and tinyxml2" + "2.3.2": + - patch_file: "patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch" + patch_type: "conan" + patch_description: "Fixup find asio and tinyxml2" diff --git a/recipes/fast-dds/all/conanfile.py b/recipes/fast-dds/all/conanfile.py new file mode 100644 index 0000000000000..f65eb37516bb2 --- /dev/null +++ b/recipes/fast-dds/all/conanfile.py @@ -0,0 +1,190 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, + collect_libs, + copy, + export_conandata_patches, + get, + rename, + rm, + rmdir, + save, +) +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc, msvc_runtime_flag +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class FastDDSConan(ConanFile): + name = "fast-dds" + license = "Apache-2.0" + homepage = "https://fast-dds.docs.eprosima.com/" + url = "https://github.com/conan-io/conan-center-index" + description = "The most complete OSS DDS implementation for embedded systems." + topics = ("dds", "middleware", "ipc") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": False, + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.9", + "apple-clang": "8", + } + + 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("tinyxml2/9.0.0") + self.requires("asio/1.21.0") + self.requires("fast-cdr/1.0.26", transitive_headers=True, transitive_libs=True) + self.requires("foonathan-memory/0.7.3") + self.requires("boost/1.75.0") # boost/1.76 is required by version 2.3.2, boost/1.75.0 required for 2.3.3 by Windows + if self.options.with_ssl: + self.requires("openssl/1.1.1t") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, "192") + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if 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)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_MEMORY_TOOLS"] = False + tc.variables["NO_TLS"] = not self.options.with_ssl + tc.variables["SECURITY"] = self.options.with_ssl + tc.variables["EPROSIMA_INSTALLER_MINION"] = False + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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")) + rename( + self, + os.path.join(self.package_folder, "tools"), + os.path.join(os.path.join(self.package_folder, "bin", "tools")), + ) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + 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( + os.path.join(self.package_folder, self._module_file_rel_path), + {"fastrtps": "fastdds::fastrtps"} + ) + + 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_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fastdds") + + # component fastrtps + self.cpp_info.components["fastrtps"].set_property("cmake_target_name", "fastrtps") + self.cpp_info.components["fastrtps"].set_property("cmake_target_aliases", ["fastdds::fastrtps"]) + self.cpp_info.components["fastrtps"].libs = collect_libs(self) + self.cpp_info.components["fastrtps"].requires = [ + "fast-cdr::fast-cdr", + "asio::asio", + "tinyxml2::tinyxml2", + "foonathan-memory::foonathan-memory", + "boost::boost", + ] + if self.settings.os in ["Linux", "FreeBSD", "Neutrino"]: + self.cpp_info.components["fastrtps"].system_libs.append("pthread") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["fastrtps"].system_libs.extend(["rt", "dl", "atomic", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.components["fastrtps"].system_libs.extend(["iphlpapi", "shlwapi", "mswsock", "ws2_32"]) + if self.options.shared: + self.cpp_info.components["fastrtps"].defines.append("FASTRTPS_DYN_LINK") + if self.options.with_ssl: + self.cpp_info.components["fastrtps"].requires.append("openssl::openssl") + + # component fast-discovery + # FIXME: actually conan generators don't know how to create an executable imported target + self.cpp_info.components["fast-discovery-server"].set_property("cmake_target_name", "fastdds::fast-discovery-server") + self.cpp_info.components["fast-discovery-server"].bindirs = ["bin"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "fastdds" + self.cpp_info.names["cmake_find_package_multi"] = "fastdds" + self.cpp_info.components["fastrtps"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["fastrtps"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["fast-discovery-server"].names["cmake_find_package"] = "fast-discovery-server" + self.cpp_info.components["fast-discovery-server"].names["cmake_find_package_multi"] = "fast-discovery-server" diff --git a/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch new file mode 100644 index 0000000000000..5d4d5bc2037bb --- /dev/null +++ b/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8a9cb0209..400c681e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -225,8 +225,8 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + eprosima_find_package(fastcdr REQUIRED) +-eprosima_find_thirdparty(Asio asio VERSION 1.10.8) +-eprosima_find_thirdparty(TinyXML2 tinyxml2) ++eprosima_find_thirdparty(asio REQUIRED) ++eprosima_find_thirdparty(tinyxml2 REQUIRED) + + find_package(foonathan_memory REQUIRED) + message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt +index 04d313bf2..efd1f9f7a 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -434,7 +434,7 @@ elseif(NOT EPROSIMA_INSTALLER) + $ + $ + PRIVATE +- ${Asio_INCLUDE_DIR} ++ ${asio_INCLUDE_DIR} + ${TINYXML2_INCLUDE_DIR} + $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> + ${THIRDPARTY_BOOST_INCLUDE_DIR} +@@ -455,7 +455,7 @@ elseif(NOT EPROSIMA_INSTALLER) + # Link library to external libraries. + target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory + ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} +- ${TINYXML2_LIBRARY} ++ tinyxml2::tinyxml2 + $<$:OpenSSL::SSL$OpenSSL::Crypto> + $<$:iphlpapi$Shlwapi> + ${THIRDPARTY_BOOST_LINK_LIBS} +@@ -536,7 +536,7 @@ if(UNIX AND EPROSIMA_INSTALLER) + COMPONENT headers + ) + +- set_public_headers_directory(${Asio_INCLUDE_DIR} "" ++ set_public_headers_directory(${asio_INCLUDE_DIR} "" + DESTINATION thirdparty/asio + COMPONENT headers + ) diff --git a/recipes/fast-dds/all/patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch new file mode 100644 index 0000000000000..a8f7744bacf11 --- /dev/null +++ b/recipes/fast-dds/all/patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8a9cb0209..400c681e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -225,8 +225,8 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + eprosima_find_package(fastcdr REQUIRED) +-eprosima_find_thirdparty(Asio asio VERSION 1.10.8) +-eprosima_find_thirdparty(TinyXML2 tinyxml2) ++eprosima_find_thirdparty(asio REQUIRED) ++eprosima_find_thirdparty(tinyxml2 REQUIRED) + + find_package(foonathan_memory REQUIRED) + message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt +index d26915242..5cc41ba84 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -435,7 +435,7 @@ elseif(NOT EPROSIMA_INSTALLER) + $ + $ + PRIVATE +- ${Asio_INCLUDE_DIR} ++ ${asio_INCLUDE_DIR} + ${TINYXML2_INCLUDE_DIR} + $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> + ${THIRDPARTY_BOOST_INCLUDE_DIR} +@@ -456,7 +456,7 @@ elseif(NOT EPROSIMA_INSTALLER) + # Link library to external libraries. + target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory + ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} +- ${TINYXML2_LIBRARY} ++ tinyxml2::tinyxml2 + $<$:OpenSSL::SSL$OpenSSL::Crypto$<$:$crypt32.lib>> + $<$:iphlpapi$Shlwapi> + ${THIRDPARTY_BOOST_LINK_LIBS} +@@ -579,7 +579,7 @@ if(UNIX AND EPROSIMA_INSTALLER) + COMPONENT headers + ) + +- set_public_headers_directory(${Asio_INCLUDE_DIR} "" ++ set_public_headers_directory(${asio_INCLUDE_DIR} "" + DESTINATION thirdparty/asio + COMPONENT headers + ) diff --git a/recipes/fast-dds/all/test_package/CMakeLists.txt b/recipes/fast-dds/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d158385cb30f9 --- /dev/null +++ b/recipes/fast-dds/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(fastdds REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} + test_package.cpp + msg/HelloWorld.cxx + msg/HelloWorldPubSubTypes.cxx +) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_link_libraries(${PROJECT_NAME} fastrtps) diff --git a/recipes/fast-dds/all/test_package/conanfile.py b/recipes/fast-dds/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fafba71d30d56 --- /dev/null +++ b/recipes/fast-dds/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/fast-dds/all/test_package/msg/HelloWorld.cxx b/recipes/fast-dds/all/test_package/msg/HelloWorld.cxx new file mode 100644 index 0000000000000..b850b450127bf --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg/HelloWorld.cxx @@ -0,0 +1,207 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { char dummy; } +#endif + +#include "HelloWorld.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +HelloWorld::HelloWorld() +{ + // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1622f1b + m_index = 0; + // m_message com.eprosima.idl.parser.typecode.StringTypeCode@70e8f8e + m_message =""; + +} + +HelloWorld::~HelloWorld() +{ + + +} + +HelloWorld::HelloWorld(const HelloWorld &x) +{ + m_index = x.m_index; + m_message = x.m_message; +} + +HelloWorld::HelloWorld(HelloWorld &&x) +{ + m_index = x.m_index; + m_message = std::move(x.m_message); +} + +HelloWorld& HelloWorld::operator=(const HelloWorld &x) +{ + + m_index = x.m_index; + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator=(HelloWorld &&x) +{ + + m_index = x.m_index; + m_message = std::move(x.m_message); + + return *this; +} + +size_t HelloWorld::getMaxCdrSerializedSize(size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t HelloWorld::getCdrSerializedSize(const HelloWorld& data, size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + +void HelloWorld::serialize(eprosima::fastcdr::Cdr &scdr) const +{ + + scdr << m_index; + scdr << m_message; +} + +void HelloWorld::deserialize(eprosima::fastcdr::Cdr &dcdr) +{ + + dcdr >> m_index; + dcdr >> m_message; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index(uint32_t _index) +{ +m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message(const std::string &_message) +{ +m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message(std::string &&_message) +{ +m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + +size_t HelloWorld::getKeyMaxCdrSerializedSize(size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + + + return current_align; +} + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey(eprosima::fastcdr::Cdr &scdr) const +{ + (void) scdr; + + +} diff --git a/recipes/fast-dds/all/test_package/msg/HelloWorld.h b/recipes/fast-dds/all/test_package/msg/HelloWorld.h new file mode 100644 index 0000000000000..380f487456147 --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg/HelloWorld.h @@ -0,0 +1,206 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _HELLOWORLD_H_ +#define _HELLOWORLD_H_ + +// TODO Poner en el contexto. + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif +#else +#define eProsima_user_DllExport +#endif + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HelloWorld_SOURCE) +#define HelloWorld_DllAPI __declspec( dllexport ) +#else +#define HelloWorld_DllAPI __declspec( dllimport ) +#endif // HelloWorld_SOURCE +#else +#define HelloWorld_DllAPI +#endif +#else +#define HelloWorld_DllAPI +#endif // _WIN32 + +namespace eprosima +{ + namespace fastcdr + { + class Cdr; + } +} + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HELLOWORLD + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld(const HelloWorld &x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld(HelloWorld &&x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator=(const HelloWorld &x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator=(HelloWorld &&x); + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index(uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message(const std::string &_message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message(std::string &&_message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const HelloWorld& data, size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const; + +private: + uint32_t m_index; + std::string m_message; +}; + +#endif // _HELLOWORLD_H_ diff --git a/recipes/fast-dds/all/test_package/msg/HelloWorld.idl b/recipes/fast-dds/all/test_package/msg/HelloWorld.idl new file mode 100644 index 0000000000000..0fd2c355aeefa --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg/HelloWorld.idl @@ -0,0 +1,5 @@ +struct HelloWorld +{ + unsigned long index; + string message; +}; diff --git a/recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.cxx b/recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.cxx new file mode 100644 index 0000000000000..89e89cc8581e8 --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.cxx @@ -0,0 +1,133 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HelloWorldPubSubTypes.h" + +using namespace eprosima::fastrtps; +using namespace eprosima::fastrtps::rtps; + +HelloWorldPubSubType::HelloWorldPubSubType() +{ + setName("HelloWorld"); + m_typeSize = static_cast(HelloWorld::getMaxCdrSerializedSize()) + 4 /*encapsulation*/; + m_isGetKeyDefined = HelloWorld::isKeyDefined(); + size_t keyLength = HelloWorld::getKeyMaxCdrSerializedSize()>16 ? HelloWorld::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +HelloWorldPubSubType::~HelloWorldPubSubType() +{ + if(m_keyBuffer!=nullptr) + free(m_keyBuffer); +} + +bool HelloWorldPubSubType::serialize(void *data, SerializedPayload_t *payload) +{ + HelloWorld *p_type = static_cast(data); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that manages the raw buffer. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + p_type->serialize(ser); // Serialize the object: + } + catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length + return true; +} + +bool HelloWorldPubSubType::deserialize(SerializedPayload_t* payload, void* data) +{ + HelloWorld* p_type = static_cast(data); //Convert DATA to pointer of your type + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + p_type->deserialize(deser); //Deserialize the object: + } + catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; +} + +std::function HelloWorldPubSubType::getSerializedSizeProvider(void* data) +{ + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + 4 /*encapsulation*/; + }; +} + +void* HelloWorldPubSubType::createData() +{ + return reinterpret_cast(new HelloWorld()); +} + +void HelloWorldPubSubType::deleteData(void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HelloWorldPubSubType::getKey(void *data, InstanceHandle_t* handle, bool force_md5) +{ + if(!m_isGetKeyDefined) + return false; + HelloWorld* p_type = static_cast(data); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer),HelloWorld::getKeyMaxCdrSerializedSize()); // Object that manages the raw buffer. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); // Object that serializes the data. + p_type->serializeKey(ser); + if(force_md5 || HelloWorld::getKeyMaxCdrSerializedSize()>16) { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for(uint8_t i = 0;i<16;++i) { + handle->value[i] = m_md5.digest[i]; + } + } + else { + for(uint8_t i = 0;i<16;++i) { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; +} + diff --git a/recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.h b/recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.h new file mode 100644 index 0000000000000..7afa612cc5925 --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg/HelloWorldPubSubTypes.h @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _HELLOWORLD_PUBSUBTYPES_H_ +#define _HELLOWORLD_PUBSUBTYPES_H_ + +#include +#include + +#include "HelloWorld.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated HelloWorld is not compatible with current installed Fast-RTPS. Please, regenerate it with fastrtpsgen. +#endif + +/*! + * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. + * @ingroup HELLOWORLD + */ +class HelloWorldPubSubType : public eprosima::fastrtps::TopicDataType { +public: + typedef HelloWorld type; + + eProsima_user_DllExport HelloWorldPubSubType(); + + eProsima_user_DllExport virtual ~HelloWorldPubSubType(); + eProsima_user_DllExport virtual bool serialize(void *data, eprosima::fastrtps::rtps::SerializedPayload_t *payload) override; + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t *payload, void *data) override; + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport virtual bool getKey(void *data, eprosima::fastrtps::rtps::InstanceHandle_t *ihandle, + bool force_md5 = false) override; + eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport virtual void deleteData(void * data) override; + MD5 m_md5; + unsigned char* m_keyBuffer; +}; + +#endif // _HELLOWORLD_PUBSUBTYPES_H_ diff --git a/recipes/fast-dds/all/test_package/test_package.cpp b/recipes/fast-dds/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..89ac973375f14 --- /dev/null +++ b/recipes/fast-dds/all/test_package/test_package.cpp @@ -0,0 +1,56 @@ +#include +#include +#include +#include +#include +#include + +#include "msg/HelloWorld.h" +#include "msg/HelloWorldPubSubTypes.h" + +int main() +{ + // Define msg to send + HelloWorld hello; + hello.index(0); + hello.message("HelloWorld"); + + eprosima::fastrtps::Participant *participant; + eprosima::fastrtps::Publisher *publisher; + + eprosima::fastrtps::ParticipantAttributes PParam; + PParam.rtps.setName("Participant_pub"); + participant = eprosima::fastrtps::Domain::createParticipant(PParam); + + if (participant == nullptr) + { + return 1; + } + + HelloWorldPubSubType type; + + eprosima::fastrtps::Domain::registerType(participant, &type); + + //CREATE THE PUBLISHER + eprosima::fastrtps::PublisherAttributes Wparam; + Wparam.topic.topicKind = eprosima::fastrtps::rtps::TopicKind_t::NO_KEY; + Wparam.topic.topicDataType = "HelloWorld"; + Wparam.topic.topicName = "HelloWorldTopic"; + Wparam.topic.historyQos.kind = eprosima::fastrtps::KEEP_LAST_HISTORY_QOS; + Wparam.topic.historyQos.depth = 30; + Wparam.topic.resourceLimitsQos.max_samples = 50; + Wparam.topic.resourceLimitsQos.allocated_samples = 20; + Wparam.times.heartbeatPeriod.seconds = 2; + Wparam.times.heartbeatPeriod.nanosec = 200 * 1000 * 1000; + publisher = eprosima::fastrtps::Domain::createPublisher(participant, Wparam); + if (publisher == nullptr) + { + return 1; + } + + publisher->write((void*)&hello); + + eprosima::fastrtps::Domain::removeParticipant(participant); + + return 0; +} diff --git a/recipes/fast-dds/all/test_v1_package/CMakeLists.txt b/recipes/fast-dds/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..fe92296627765 --- /dev/null +++ b/recipes/fast-dds/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package 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/fast-dds/all/test_v1_package/conanfile.py b/recipes/fast-dds/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1bf1c7e26255d --- /dev/null +++ b/recipes/fast-dds/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fast-dds/config.yml b/recipes/fast-dds/config.yml new file mode 100644 index 0000000000000..e8d99700ff1a0 --- /dev/null +++ b/recipes/fast-dds/config.yml @@ -0,0 +1,7 @@ +versions: + "2.3.4": + folder: all + "2.3.3": + folder: all + "2.3.2": + folder: all diff --git a/recipes/fast_double_parser/all/conandata.yml b/recipes/fast_double_parser/all/conandata.yml new file mode 100644 index 0000000000000..e6359076757f6 --- /dev/null +++ b/recipes/fast_double_parser/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.7.0": + url: "https://github.com/lemire/fast_double_parser/archive/v0.7.0.tar.gz" + sha256: "eb80a1d9c406bbe8cb22fffd3c007651f716abd03225009302d8aba8e9c4df77" + "0.6.0": + url: "https://github.com/lemire/fast_double_parser/archive/refs/tags/v0.6.0.tar.gz" + sha256: "90835c770a2577a38442601e92330207ad8b917f956614938303b8439d13b282" + "0.5.0": + url: "https://github.com/lemire/fast_double_parser/archive/refs/tags/v0.5.0.tar.gz" + sha256: "afbd2d42facd037bf3859856a8fe4112e4d7ded942255f6c0e6c17689d41f645" diff --git a/recipes/fast_double_parser/all/conanfile.py b/recipes/fast_double_parser/all/conanfile.py new file mode 100644 index 0000000000000..a704c8e783d7f --- /dev/null +++ b/recipes/fast_double_parser/all/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class 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") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lemire/fast_double_parser" + license = ("Apache-2.0", "BSL-1.0") + + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + def layout(self): + basic_layout(self) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + include_folder = os.path.join(self.source_folder, "include") + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=include_folder) + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) diff --git a/recipes/fast_double_parser/all/test_package/CMakeLists.txt b/recipes/fast_double_parser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00ff6376bfebe --- /dev/null +++ b/recipes/fast_double_parser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +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_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast_double_parser/all/test_package/conanfile.py b/recipes/fast_double_parser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/fast_double_parser/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fast_double_parser/all/test_package/test_package.cpp b/recipes/fast_double_parser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..02cddc31a03a3 --- /dev/null +++ b/recipes/fast_double_parser/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + std::string a = "0."; + double x; + bool ok = fast_double_parser::parse_number(a.c_str(), &x); + return 0; +} diff --git a/recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt b/recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fast_double_parser/all/test_v1_package/conanfile.py b/recipes/fast_double_parser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/fast_double_parser/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fast_double_parser/config.yml b/recipes/fast_double_parser/config.yml new file mode 100644 index 0000000000000..d61439bae1bc3 --- /dev/null +++ b/recipes/fast_double_parser/config.yml @@ -0,0 +1,7 @@ +versions: + "0.7.0": + folder: all + "0.6.0": + folder: all + "0.5.0": + folder: all diff --git a/recipes/fast_float/all/conandata.yml b/recipes/fast_float/all/conandata.yml new file mode 100644 index 0000000000000..c3fef89b2a998 --- /dev/null +++ b/recipes/fast_float/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "4.0.0": + url: "https://github.com/fastfloat/fast_float/archive/v4.0.0.tar.gz" + sha256: "9470f229b9ea8d116af7c92f2ab8e8ae6b3c3225d15081b859634328f28d4664" + "3.11.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.11.0.tar.gz" + sha256: "accb9d1ae94bdb5c50b5a7c3723c0e2e128853f8d8f007068fec2b58887db05d" + "3.10.1": + url: "https://github.com/fastfloat/fast_float/archive/v3.10.1.tar.gz" + sha256: "d162c21c1dc538dbc6b3bb6d1317a7808f2eccef78638445630533f5bed902ee" + "3.10.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.10.0.tar.gz" + sha256: "9167ad938f29464ca2312fe32565646a61328249e16f84b2a23969c627cc93f5" + "3.9.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.9.0.tar.gz" + sha256: "a10443e13748291709b422b2da49fc6753a1a43bf24205d4600595dfe3d811bb" + "3.8.1": + url: "https://github.com/fastfloat/fast_float/archive/v3.8.1.tar.gz" + sha256: "823d7f8df7fadc3ed24738eb0cf4a40f0450068edd92805698916be40966d87a" + "3.8.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.8.0.tar.gz" + sha256: "8cb82dc35da3b745b3beb1a9974402307c9ded0e875aea077dbb3ea63833dd2e" + "3.7.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.7.0.tar.gz" + sha256: "4a30c43d14bbc979130a7807aecb2de5ff513951dd99a8b77cc32acfc610f850" + "3.6.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.6.0.tar.gz" + sha256: "0852175e5ebf2b59bcde9c3be2ccd50441f2997350884652302d034785a4fbf5" + "3.5.1": + url: "https://github.com/fastfloat/fast_float/archive/v3.5.1.tar.gz" + sha256: "8558bf9c66ccd2f7d03c94461a107f49ad9cf6e4f6c0c84e148fec0aa32b4dd9" + "3.4.0": + url: "https://github.com/fastfloat/fast_float/archive/v3.4.0.tar.gz" + sha256: "a242877d2fae81ca412033f5ebf5dbc43cb029c56b4af78e33106b9a69f8f58e" + "2.0.0": + url: "https://github.com/fastfloat/fast_float/archive/v2.0.0.tar.gz" + sha256: "5d528ec20811577c5f2b2873528c085c500fdcd2b2c0901450509a71de5f1fa4" + "1.1.2": + url: "https://github.com/fastfloat/fast_float/archive/v1.1.2.tar.gz" + sha256: "580655a9ad2aeac7507de4433dcf985d8699ae8128b97c2cabc0962aa5beb513" + "0.9.0": + url: "https://github.com/fastfloat/fast_float/archive/v0.9.0.tar.gz" + sha256: "1e40982107e03559a98323a0b97fc2110d73b0743818fe2cdc09abe77c4c5af8" diff --git a/recipes/fast_float/all/conanfile.py b/recipes/fast_float/all/conanfile.py new file mode 100644 index 0000000000000..dd07baab915bd --- /dev/null +++ b/recipes/fast_float/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + +class FastFloatConan(ConanFile): + name = "fast_float" + description = "Fast and exact implementation of the C++ from_chars " \ + "functions for float and double types." + license = ("Apache-2.0", "MIT") + topics = ("fast_float", "conversion", "from_chars", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fastfloat/fast_float" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + 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, "*", 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_file_name", "FastFloat") + self.cpp_info.set_property("cmake_target_name", "FastFloat::fast_float") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "FastFloat" + self.cpp_info.names["cmake_find_package_multi"] = "FastFloat" + self.cpp_info.components["fastfloat"].names["cmake_find_package"] = "fast_float" + self.cpp_info.components["fastfloat"].names["cmake_find_package_multi"] = "fast_float" + self.cpp_info.components["fastfloat"].set_property("cmake_target_name", "FastFloat::fast_float") diff --git a/recipes/fast_float/all/test_package/CMakeLists.txt b/recipes/fast_float/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4e77f3f59c71c --- /dev/null +++ b/recipes/fast_float/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(FastFloat REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE FastFloat::fast_float) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast_float/all/test_package/conanfile.py b/recipes/fast_float/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/fast_float/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/fast_float/all/test_package/test_package.cpp b/recipes/fast_float/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b27894b2a6fb0 --- /dev/null +++ b/recipes/fast_float/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include + +int main() { + const std::string input = "3.1416 xyz "; + double result; + auto answer = fast_float::from_chars(input.data(), input.data() + input.size(), result); + if (answer.ec != std::errc()) { + std::cerr << "parsing failure\n"; + return 1; + } + std::cout << "parsed the number " << result << std::endl; + return 0; +} diff --git a/recipes/fast_float/all/test_v1_package/CMakeLists.txt b/recipes/fast_float/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/fast_float/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fast_float/all/test_v1_package/conanfile.py b/recipes/fast_float/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fast_float/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/fast_float/config.yml b/recipes/fast_float/config.yml new file mode 100644 index 0000000000000..853456106d279 --- /dev/null +++ b/recipes/fast_float/config.yml @@ -0,0 +1,29 @@ +versions: + "4.0.0": + folder: all + "3.11.0": + folder: all + "3.10.1": + folder: all + "3.10.0": + folder: all + "3.9.0": + folder: all + "3.8.1": + folder: all + "3.8.0": + folder: all + "3.7.0": + folder: all + "3.6.0": + folder: all + "3.5.1": + folder: all + "3.4.0": + folder: all + "2.0.0": + folder: all + "1.1.2": + folder: all + "0.9.0": + folder: all diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml new file mode 100644 index 0000000000000..e16837fea8797 --- /dev/null +++ b/recipes/fastpfor/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "cci.20221225": + url: "https://github.com/lemire/FastPFor/archive/3e7358f8656b4456f4ea1762075553f2984fefcf.tar.gz" + sha256: "cc50b03421db3aa21be2243f5996ea6d027a6563e0863b77cfc46dd08bcfcaf5" + "cci.20220205": + url: "https://github.com/lemire/FastPFor/archive/773283d4a11fa2440a1b3b28fd77f775e86d7898.tar.gz" + sha256: "d4419512420f3bcc65862c5c367021f201b5ba3e8cb0dad895cdf444e0867b30" + +patches: + "cci.20221225": + - patch_file: "patches/cci.20221225-0001-fix-cmake.patch" + patch_description: "enable shared build, disable unittest/utility" + patch_type: "conan" + "cci.20220205": + - patch_file: "patches/cci.20220205-0001-fix-cmake.patch" + patch_description: "enable shared build, disable unittest/utility" + patch_type: "conan" diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py new file mode 100644 index 0000000000000..3ea949a5a46d9 --- /dev/null +++ b/recipes/fastpfor/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" +class FastPFORConan(ConanFile): + name = "fastpfor" + description = "Fast integer compression" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lemire/FastPFor" + topics = ("compression", "sorted-lists", "simd", "x86", "x86-64") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration(f"{self.settings.arch} architecture is not supported") + + 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["FastPFOR"] + + self.cpp_info.set_property("cmake_file_name", "FastPFOR") + self.cpp_info.set_property("cmake_target_name", "FastPFOR::FastPFOR") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "FastPFOR" + self.cpp_info.filenames["cmake_find_package_multi"] = "FastPFOR" + self.cpp_info.names["cmake_find_package"] = "FastPFOR" + self.cpp_info.names["cmake_find_package_multi"] = "FastPFOR" diff --git a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch new file mode 100644 index 0000000000000..831aaf49de782 --- /dev/null +++ b/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5520747..dfccbc1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -94,6 +94,10 @@ elseif(WIN32) + if(NOT MSVC12) + message(STATUS "On Windows, only MSVC version 12 is supported!") + endif() ++ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") ++ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") + else () + message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") + endif() +@@ -108,7 +112,7 @@ MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE} ) + + # library target + include_directories(headers) +-add_library(FastPFOR STATIC ++add_library(FastPFOR + src/bitpacking.cpp + src/bitpackingaligned.cpp + src/bitpackingunaligned.cpp +@@ -117,9 +121,8 @@ add_library(FastPFOR STATIC + src/simdbitpacking.cpp + src/varintdecode.c + src/streamvbyte.c) +-set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +- + ++if(0) + # other executables + add_executable(gapstats src/gapstats.cpp) + add_executable(partitionbylength src/partitionbylength.cpp) +@@ -132,6 +135,7 @@ if( SUPPORT_SSE42 ) + add_executable(benchbitpacking src/benchbitpacking.cpp) + target_link_libraries(benchbitpacking FastPFOR) + endif() ++endif(0) + + find_package(snappy) + if(NOT ${snappy_FOUND}) +@@ -141,6 +145,8 @@ else() + message(STATUS "Snappy was found. Building additional targets " + "codecssnappy and inmemorybenchmarksnappy.") + include_directories(${snappy_INCLUDE_DIRS}) ++ ++ if(0) + add_executable(codecssnappy src/codecs.cpp) + set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) +@@ -148,8 +154,10 @@ else() + add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) + set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) ++ endif(0) + endif() + ++if(0) + # Download and unpack googletest at configure time + configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) + execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . +@@ -207,7 +215,7 @@ target_link_libraries(FastPFOR_unittest gtest FastPFOR) + enable_testing() + add_test("unit" unit) + add_test("FastPFOR_unittest" FastPFOR_unittest) +- ++endif(0) + + include(GNUInstallDirs) + install(TARGETS FastPFOR diff --git a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch new file mode 100644 index 0000000000000..9ac6f1894f7c7 --- /dev/null +++ b/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 118fc00..d57a46e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -94,6 +94,10 @@ elseif(WIN32) + if(NOT MSVC12) + message(STATUS "On Windows, only MSVC version 12 is supported!") + endif() ++ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") ++ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") + else () + message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") + endif() +@@ -108,7 +112,7 @@ MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE} ) + + # library target + include_directories(headers) +-add_library(FastPFOR STATIC ++add_library(FastPFOR + src/bitpacking.cpp + src/bitpackingaligned.cpp + src/bitpackingunaligned.cpp +@@ -118,9 +122,9 @@ add_library(FastPFOR STATIC + src/simdbitpacking.cpp + src/varintdecode.c + src/streamvbyte.c) +-set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + + ++if(0) + # other executables + add_executable(gapstats src/gapstats.cpp) + add_executable(partitionbylength src/partitionbylength.cpp) +@@ -133,6 +137,7 @@ if( SUPPORT_SSE42 ) + add_executable(benchbitpacking src/benchbitpacking.cpp) + target_link_libraries(benchbitpacking FastPFOR) + endif() ++endif() + + find_package(snappy) + if(NOT ${snappy_FOUND}) +@@ -142,6 +147,7 @@ else() + message(STATUS "Snappy was found. Building additional targets " + "codecssnappy and inmemorybenchmarksnappy.") + include_directories(${snappy_INCLUDE_DIRS}) ++ if(0) + add_executable(codecssnappy src/codecs.cpp) + set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) +@@ -149,8 +155,10 @@ else() + add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) + set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) ++ endif() + endif() + ++if(0) + # Download and unpack googletest at configure time + configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) + execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . +@@ -208,7 +216,7 @@ target_link_libraries(FastPFOR_unittest gtest FastPFOR) + enable_testing() + add_test("unit" unit) + add_test("FastPFOR_unittest" FastPFOR_unittest) +- ++endif() + + include(GNUInstallDirs) + install(TARGETS FastPFOR diff --git a/recipes/fastpfor/all/test_package/CMakeLists.txt b/recipes/fastpfor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f466c43ce9867 --- /dev/null +++ b/recipes/fastpfor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(FastPFOR REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} FastPFOR::FastPFOR) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fastpfor/all/test_package/conanfile.py b/recipes/fastpfor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/fastpfor/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fastpfor/all/test_package/test_package.cpp b/recipes/fastpfor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ebb317a740251 --- /dev/null +++ b/recipes/fastpfor/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include "fastpfor/codecfactory.h" +#include "fastpfor/deltautil.h" + +int main() { + using namespace FastPForLib; + CODECFactory factory; + + IntegerCODEC &codec = *factory.getFromName("simdfastpfor256"); + + size_t N = 10 * 1000; + std::vector mydata(N); + for (uint32_t i = 0; i < N; i += 150) + mydata[i] = i; + + std::vector compressed_output(N + 1024); + + size_t compressedsize = compressed_output.size(); + codec.encodeArray(mydata.data(), mydata.size(), compressed_output.data(), + compressedsize); + + compressed_output.resize(compressedsize); + compressed_output.shrink_to_fit(); + + std::cout << std::setprecision(3); + std::cout << "You are using " + << 32.0 * static_cast(compressed_output.size()) / + static_cast(mydata.size()) + << " bits per integer. " << std::endl; + + return 0; +} diff --git a/recipes/fastpfor/all/test_v1_package/CMakeLists.txt b/recipes/fastpfor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/fastpfor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fastpfor/all/test_v1_package/conanfile.py b/recipes/fastpfor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/fastpfor/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fastpfor/config.yml b/recipes/fastpfor/config.yml new file mode 100644 index 0000000000000..216ef81b387a5 --- /dev/null +++ b/recipes/fastpfor/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20221225": + folder: all + "cci.20220205": + folder: all diff --git a/recipes/fastprng/all/conandata.yml b/recipes/fastprng/all/conandata.yml new file mode 100644 index 0000000000000..7df6c1bcf5865 --- /dev/null +++ b/recipes/fastprng/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200628": + url: "https://github.com/BrutPitt/fastPRNG/archive/5ce17711a65965b3726b3f0c62c7dcbd967a7b0f.zip" + sha256: "ab185d52bbc4d3d02cf258a3be01059e7c28a0d9e6320a0c1dba7aa74a27b201" diff --git a/recipes/fastprng/all/conanfile.py b/recipes/fastprng/all/conanfile.py new file mode 100644 index 0000000000000..c83ba01f89440 --- /dev/null +++ b/recipes/fastprng/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy +import os + +required_conan_version = ">=1.50.0" + + +class FastPRNGConan(ConanFile): + name = "fastprng" + description = "FAST 32/64 bit PRNG (pseudo-random generator), highly optimized, based on xoshiro* / xoroshiro*, xorshift and other Marsaglia algorithms." + topics = ("random", "prng", "xorshift", "xoshiro", ) + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/BrutPitt/fastPRNG" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, "11") + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + strip_root=True + ) + + def package(self): + copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include")) + copy(self, "license.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) diff --git a/recipes/fastprng/all/test_package/CMakeLists.txt b/recipes/fastprng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a0f34e4c094ac --- /dev/null +++ b/recipes/fastprng/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(fastprng CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fastprng::fastprng) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fastprng/all/test_package/conanfile.py b/recipes/fastprng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/fastprng/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fastprng/all/test_package/test_package.cpp b/recipes/fastprng/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1ddf23d672e5a --- /dev/null +++ b/recipes/fastprng/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "fastPRNG.h" + +#include + +int main() { + fastPRNG::fastXS64 fastR; + + std::cout << fastR.xoshiro256p() << std::endl; + + return 0; +} diff --git a/recipes/fastprng/all/test_v1_package/CMakeLists.txt b/recipes/fastprng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ea0378c83fe1 --- /dev/null +++ b/recipes/fastprng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package 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/fastprng/all/test_v1_package/conanfile.py b/recipes/fastprng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..aaf25befb2087 --- /dev/null +++ b/recipes/fastprng/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(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/fastprng/config.yml b/recipes/fastprng/config.yml new file mode 100644 index 0000000000000..d47d739245183 --- /dev/null +++ b/recipes/fastprng/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200628": + folder: "all" diff --git a/recipes/fcl/all/conandata.yml b/recipes/fcl/all/conandata.yml new file mode 100644 index 0000000000000..2d2965127b1cf --- /dev/null +++ b/recipes/fcl/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "0.7.0": + url: "https://github.com/flexible-collision-library/fcl/archive/refs/tags/0.7.0.tar.gz" + sha256: "90409e940b24045987506a6b239424a4222e2daf648c86dd146cbcb692ebdcbc" + "0.6.1": + url: "https://github.com/flexible-collision-library/fcl/archive/v0.6.1.tar.gz" + sha256: "c8a68de8d35a4a5cd563411e7577c0dc2c626aba1eef288cb1ca88561f8d8019" +patches: + "0.7.0": + - patch_file: "patches/0001-fix-cmake-0.7.0.patch" + - patch_file: "patches/0002-fix-mingw-bigobj.patch" + "0.6.1": + - patch_file: "patches/0001-fix-cmake-0.6.1.patch" + - patch_file: "patches/0002-fix-mingw-bigobj.patch" + - patch_file: "patches/0003-fix-alias-type-msvc2015.patch" diff --git a/recipes/fcl/all/conanfile.py b/recipes/fcl/all/conanfile.py new file mode 100644 index 0000000000000..7e41afda3be3f --- /dev/null +++ b/recipes/fcl/all/conanfile.py @@ -0,0 +1,134 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class FclConan(ConanFile): + name = "fcl" + description = "C++11 library for performing three types of proximity " \ + "queries on a pair of geometric models composed of triangles." + license = "BSD-3-Clause" + topics = ("geometry", "collision") + homepage = "https://github.com/flexible-collision-library/fcl" + 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_octomap": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_octomap": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0") + self.requires("libccd/2.1") + if self.options.with_octomap: + self.requires("octomap/1.9.7") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't properly support shared lib on Windows") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FCL_ENABLE_PROFILING"] = False + tc.variables["FCL_TREAT_WARNINGS_AS_ERRORS"] = False + tc.variables["FCL_HIDE_ALL_SYMBOLS"] = False + tc.variables["FCL_STATIC_LIBRARY"] = not self.options.shared + tc.variables["FCL_USE_X64_SSE"] = False # Let consumer decide to add relevant compile options, fcl doesn't have simd intrinsics + tc.variables["FCL_USE_HOST_NATIVE_ARCH"] = False + tc.variables["FCL_USE_SSE"] = False + tc.variables["FCL_COVERALLS"] = False + tc.variables["FCL_COVERALLS_UPLOAD"] = False + tc.variables["FCL_WITH_OCTOMAP"] = self.options.with_octomap + if self.options.with_octomap: + octomap_version_str = self.dependencies["octomap"].ref.version + tc.variables["OCTOMAP_VERSION"] = octomap_version_str + octomap_version = Version(octomap_version_str) + tc.variables["OCTOMAP_MAJOR_VERSION"] = octomap_version.major + tc.variables["OCTOMAP_MINOR_VERSION"] = octomap_version.minor + tc.variables["OCTOMAP_PATCH_VERSION"] = octomap_version.patch + tc.variables["BUILD_TESTING"] = False + tc.variables["FCL_NO_DEFAULT_RPATH"] = False + 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, "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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"fcl": "fcl::fcl"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fcl") + self.cpp_info.set_property("cmake_target_name", "fcl") + self.cpp_info.set_property("pkg_config_name", "fcl") + self.cpp_info.libs = ["fcl"] + + # 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/fcl/all/patches/0001-fix-cmake-0.6.1.patch b/recipes/fcl/all/patches/0001-fix-cmake-0.6.1.patch new file mode 100644 index 0000000000000..87690d911d402 --- /dev/null +++ b/recipes/fcl/all/patches/0001-fix-cmake-0.6.1.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -72,7 +72,7 @@ if(MSVC OR MSVC90 OR MSVC10) + endif (MSVC OR MSVC90 OR MSVC10) + + set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") + include(CMakePackageConfigHelpers) + include(GenerateExportHeader) + include(GNUInstallDirs) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -103,6 +103,8 @@ if(FCL_HAVE_OCTOMAP) + # available, otherwise fall back to OCTOMAP_INCLUDE_DIRS and OCTOMAP_LIBRARIES + if(TARGET octomap) + target_link_libraries(${PROJECT_NAME} PUBLIC octomap) ++ elseif(TARGET octomap-static) ++ target_link_libraries(${PROJECT_NAME} PUBLIC octomap-static) + elseif(OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARIES) + target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${OCTOMAP_INCLUDE_DIRS}") + target_link_libraries(${PROJECT_NAME} PUBLIC "${OCTOMAP_LIBRARIES}") diff --git a/recipes/fcl/all/patches/0001-fix-cmake-0.7.0.patch b/recipes/fcl/all/patches/0001-fix-cmake-0.7.0.patch new file mode 100644 index 0000000000000..54b12b1ddcc5a --- /dev/null +++ b/recipes/fcl/all/patches/0001-fix-cmake-0.7.0.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,7 +66,7 @@ if(MSVC OR MSVC90 OR MSVC10) + endif (MSVC OR MSVC90 OR MSVC10) + + set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") + include(CMakePackageConfigHelpers) + include(GenerateExportHeader) + include(GNUInstallDirs) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -103,6 +103,8 @@ if(FCL_HAVE_OCTOMAP) + # available, otherwise fall back to OCTOMAP_INCLUDE_DIRS and OCTOMAP_LIBRARIES + if(TARGET octomap) + target_link_libraries(${PROJECT_NAME} PUBLIC octomap) ++ elseif(TARGET octomap-static) ++ target_link_libraries(${PROJECT_NAME} PUBLIC octomap-static) + elseif(OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARIES) + target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${OCTOMAP_INCLUDE_DIRS}") + target_link_libraries(${PROJECT_NAME} PUBLIC "${OCTOMAP_LIBRARIES}") diff --git a/recipes/fcl/all/patches/0002-fix-mingw-bigobj.patch b/recipes/fcl/all/patches/0002-fix-mingw-bigobj.patch new file mode 100644 index 0000000000000..d50db01fa43b5 --- /dev/null +++ b/recipes/fcl/all/patches/0002-fix-mingw-bigobj.patch @@ -0,0 +1,17 @@ +--- a/CMakeModules/CompilerSettings.cmake ++++ b/CMakeModules/CompilerSettings.cmake +@@ -104,11 +104,13 @@ endif() + + # MinGW + if((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW) +- add_definitions(-fPIC) + if(FCL_TREAT_WARNINGS_AS_ERRORS) + add_definitions(-Werror) + endif() + endif() ++if(MINGW) ++ add_definitions(-Wa,-mbig-obj) ++endif() + + # By default CMake sets RPATH for binaries in the build tree, but clears + # it when installing. Switch this option off if the default behaviour is diff --git a/recipes/fcl/all/patches/0003-fix-alias-type-msvc2015.patch b/recipes/fcl/all/patches/0003-fix-alias-type-msvc2015.patch new file mode 100644 index 0000000000000..339514f4a1b95 --- /dev/null +++ b/recipes/fcl/all/patches/0003-fix-alias-type-msvc2015.patch @@ -0,0 +1,47 @@ +--- a/include/fcl/geometry/octree/octree-inl.h ++++ b/include/fcl/geometry/octree/octree-inl.h +@@ -107,7 +107,7 @@ typename OcTree::OcTreeNode* OcTree::getRoot() const + + //============================================================================== + template +-bool OcTree::isNodeOccupied(const OcTree::OcTreeNode* node) const ++bool OcTree::isNodeOccupied(const typename OcTree::OcTreeNode* node) const + { + // return tree->isNodeOccupied(node); + return node->getOccupancy() >= occupancy_threshold; +@@ -115,7 +115,7 @@ bool OcTree::isNodeOccupied(const OcTree::OcTreeNode* node) const + + //============================================================================== + template +-bool OcTree::isNodeFree(const OcTree::OcTreeNode* node) const ++bool OcTree::isNodeFree(const typename OcTree::OcTreeNode* node) const + { + // return false; // default no definitely free node + return node->getOccupancy() <= free_threshold; +@@ -123,7 +123,7 @@ bool OcTree::isNodeFree(const OcTree::OcTreeNode* node) const + + //============================================================================== + template +-bool OcTree::isNodeUncertain(const OcTree::OcTreeNode* node) const ++bool OcTree::isNodeUncertain(const typename OcTree::OcTreeNode* node) const + { + return (!isNodeOccupied(node)) && (!isNodeFree(node)); + } +@@ -197,7 +197,7 @@ const typename OcTree::OcTreeNode* OcTree::getNodeChild( + //============================================================================== + template + bool OcTree::nodeChildExists( +- const OcTree::OcTreeNode* node, unsigned int childIdx) const ++ const typename OcTree::OcTreeNode* node, unsigned int childIdx) const + { + #if OCTOMAP_VERSION_AT_LEAST(1,8,0) + return tree->nodeChildExists(node, childIdx); +@@ -208,7 +208,7 @@ bool OcTree::nodeChildExists( + + //============================================================================== + template +-bool OcTree::nodeHasChildren(const OcTree::OcTreeNode* node) const ++bool OcTree::nodeHasChildren(const typename OcTree::OcTreeNode* node) const + { + #if OCTOMAP_VERSION_AT_LEAST(1,8,0) + return tree->nodeHasChildren(node); diff --git a/recipes/fcl/all/test_package/CMakeLists.txt b/recipes/fcl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8f41ad8aed5d9 --- /dev/null +++ b/recipes/fcl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fcl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fcl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fcl/all/test_package/conanfile.py b/recipes/fcl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/fcl/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/fcl/all/test_package/test_package.cpp b/recipes/fcl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0f0651d6aa60c --- /dev/null +++ b/recipes/fcl/all/test_package/test_package.cpp @@ -0,0 +1,78 @@ +/* +From test_broadphase_dynamic_AABB_tree.cpp test in FCL test directory +*/ + +#include "fcl/common/types.h" +#include "fcl/geometry/shape/sphere.h" +#include "fcl/broadphase/broadphase_dynamic_AABB_tree.h" + +#include +#include + +int main() { + auto sphere0 = std::make_shared(0.1); + auto sphere1 = std::make_shared(0.2); + fcl::CollisionObjectd object0(sphere0); + fcl::CollisionObjectd object1(sphere1); + const fcl::Vector3d position0(0.1, 0.2, 0.3); + const fcl::Vector3d position1(0.11, 0.21, 0.31); + + // We will use `objects` to check the order of the two collision objects in + // our callback function. + // + // We use std::vector that contains *pointers* to CollisionObjectd, + // instead of std::vector that contains CollisionObjectd's. + // Previously we used std::vector, and it failed the + // Eigen alignment assertion on Win32. We also tried, without success, the + // custom allocator: + // std::vector>, + // but some platforms failed to build. + std::vector objects = {&object0, &object1}; + std::vector positions = {&position0, &position1}; + + fcl::DynamicAABBTreeCollisionManager dynamic_tree; + for (int i = 0; i < static_cast(objects.size()); ++i) { + objects[i]->setTranslation(*positions[i]); + objects[i]->computeAABB(); + dynamic_tree.registerObject(objects[i]); + } + + // Pack the data for callback function. + struct CallBackData { + bool expect_object0_then_object1; + std::vector* objects; + } data; + data.expect_object0_then_object1 = false; + data.objects = &objects; + + // This callback function tests the order of the two collision objects from + // the dynamic tree against the `data`. We assume that the first two + // parameters are always objects[0] and objects[1] in two possible orders, + // so we can safely ignore the second parameter. We do not use the last + // double& parameter, which specifies the distance beyond which the + // pair of objects will be skipped. + auto distance_callback = [](fcl::CollisionObjectd* a, fcl::CollisionObjectd*, + void* callback_data, double&) -> bool { + // Unpack the data. + auto data = static_cast(callback_data); + const std::vector& objects = *(data->objects); + const bool object0_first = a == objects[0]; + // EXPECT_EQ(data->expect_object0_then_object1, object0_first); + // TODO(DamrongGuoy): Remove the statement below when we solve the + // repeatability problem as mentioned in: + // https://github.com/flexible-collision-library/fcl/issues/368 + // Expect to switch the order next time. + data->expect_object0_then_object1 = !data->expect_object0_then_object1; + // Return true to stop the tree traversal. + return true; + }; + // We repeat update() and distance() many times. Each time, in the + // callback function, we check the order of the two objects. + for (int count = 0; count < 8; ++count) { + dynamic_tree.update(); + dynamic_tree.distance(&data, distance_callback); + } + + return 0; +} diff --git a/recipes/fcl/all/test_v1_package/CMakeLists.txt b/recipes/fcl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fcl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fcl/all/test_v1_package/conanfile.py b/recipes/fcl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fcl/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/fcl/config.yml b/recipes/fcl/config.yml new file mode 100644 index 0000000000000..20ca85280a5a5 --- /dev/null +++ b/recipes/fcl/config.yml @@ -0,0 +1,5 @@ +versions: + "0.7.0": + folder: all + "0.6.1": + folder: all diff --git a/recipes/fernandovelcic-hexdump/all/conandata.yml b/recipes/fernandovelcic-hexdump/all/conandata.yml new file mode 100644 index 0000000000000..2f5299a240ff1 --- /dev/null +++ b/recipes/fernandovelcic-hexdump/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/FernandoVelcic/hexdump/archive/1.0.0.tar.gz" + sha256: "6745f9a528c0932d99ff7c400109784688e9948f298c3cc26c4cb5bd7ec002c5" diff --git a/recipes/fernandovelcic-hexdump/all/conanfile.py b/recipes/fernandovelcic-hexdump/all/conanfile.py new file mode 100644 index 0000000000000..0f297f7cfa6c3 --- /dev/null +++ b/recipes/fernandovelcic-hexdump/all/conanfile.py @@ -0,0 +1,24 @@ +from conans import ConanFile, tools + +class FernandoVelcicHexdumpConan(ConanFile): + name = "fernandovelcic-hexdump" + description = "A header-only hexdump library." + license = ["BSD-3-Clause"] + topics = ("hexadecimal", "hexdump", "inspection", "debug") + homepage = "https://github.com/FernandoVelcic/hexdump" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + self.copy(pattern="hexdump.hpp", dst="include", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt b/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e81affac8e80 --- /dev/null +++ b/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fernandovelcic-hexdump CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} fernandovelcic-hexdump::fernandovelcic-hexdump) diff --git a/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py b/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/fernandovelcic-hexdump/all/test_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/fernandovelcic-hexdump/all/test_package/test_package.cpp b/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d9f8d0c243fcc --- /dev/null +++ b/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include "hexdump.hpp" +#include +#include + +template +void testCustomHexdumpBase() +{ + unsigned char data[bufSize]; + for (int i = 0; i < bufSize; ++i) + { + data[i] = i; + } + std::cout << CustomHexdumpBase(data, bufSize) << std::endl; +} + +int main(int argc, char **argv) +{ + unsigned char data[150]; + for (int i = 0; i < 150; ++i) + { + data[i] = i; + } + + std::cout << Hexdump(data, sizeof(data)) << std::endl; + std::cout << CustomHexdump<8, true>(data, sizeof(data)) << std::endl; + std::cout << CustomHexdump<32, false>(data, sizeof(data)) << std::endl; + + testCustomHexdumpBase(); + testCustomHexdumpBase(); + testCustomHexdumpBase(); + testCustomHexdumpBase(); + + return 0; +} diff --git a/recipes/fernandovelcic-hexdump/config.yml b/recipes/fernandovelcic-hexdump/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/fernandovelcic-hexdump/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/fff/all/conandata.yml b/recipes/fff/all/conandata.yml new file mode 100644 index 0000000000000..43b155015b702 --- /dev/null +++ b/recipes/fff/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: https://github.com/meekrosoft/fff/archive/refs/tags/v1.1.zip + sha256: 5a8329878f59bd1ea19b734573d63c228f742384b8c78d00e4d005909b90ee83 diff --git a/recipes/fff/all/conanfile.py b/recipes/fff/all/conanfile.py new file mode 100644 index 0000000000000..b4367b0a79cab --- /dev/null +++ b/recipes/fff/all/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, tools +import os + +class TypeSafe(ConanFile): + name = 'fff' + description = 'A testing micro framework for creating function test doubles' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'https://github.com/meekrosoft/fff' + license = 'MIT' + topics = 'conan', 'c', 'c++', 'embedded', 'tdd', 'micro-framework', 'fake-functions' + + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + self.copy("fff.h", dst="include", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/fff/all/test_package/CMakeLists.txt b/recipes/fff/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/fff/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/fff/all/test_package/conanfile.py b/recipes/fff/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/fff/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fff/all/test_package/test_package.cpp b/recipes/fff/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..80fdb032c8ac4 --- /dev/null +++ b/recipes/fff/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include "fff.h" + +DEFINE_FFF_GLOBALS; + +FAKE_VOID_FUNC(TestFunction, uint32_t, uint8_t); + +int main() +{ + RESET_FAKE(TestFunction); + FFF_RESET_HISTORY(); + + TestFunction(8, 16); + + return 0; +} diff --git a/recipes/fff/config.yml b/recipes/fff/config.yml new file mode 100644 index 0000000000000..73cff68f18893 --- /dev/null +++ b/recipes/fff/config.yml @@ -0,0 +1,3 @@ +versions: + '1.1': + folder: all diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml new file mode 100644 index 0000000000000..89651174ed1ed --- /dev/null +++ b/recipes/ffmpeg/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "5.1": + url: "https://ffmpeg.org/releases/ffmpeg-5.1.tar.bz2" + sha256: "32b56fb01ce90d452958ae25e91c9564abf49ed5453c127bec23c63e530aa8fa" + "5.0": + url: "https://ffmpeg.org/releases/ffmpeg-5.0.tar.bz2" + sha256: "c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9" + "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": + - 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" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py new file mode 100644 index 0000000000000..b68accaf3f292 --- /dev/null +++ b/recipes/ffmpeg/all/conanfile.py @@ -0,0 +1,980 @@ +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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import ( + apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, + 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 check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version +import os +import glob +import shutil +import re + +required_conan_version = ">=1.57.0" + + +class FFMpegConan(ConanFile): + name = "ffmpeg" + url = "https://github.com/conan-io/conan-center-index" + description = "A complete, cross-platform solution to record, convert and stream audio and video" + # https://github.com/FFmpeg/FFmpeg/blob/master/LICENSE.md + license = ("LGPL-2.1-or-later", "GPL-2.0-or-later") + homepage = "https://ffmpeg.org" + topics = ("multimedia", "audio", "video", "encoder", "decoder", "encoding", "decoding", + "transcoding", "multiplexer", "demultiplexer", "streaming") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "avdevice": [True, False], + "avcodec": [True, False], + "avformat": [True, False], + "swresample": [True, False], + "swscale": [True, False], + "postproc": [True, False], + "avfilter": [True, False], + "with_asm": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "with_lzma": [True, False], + "with_libiconv": [True, False], + "with_freetype": [True, False], + "with_openjpeg": [True, False], + "with_openh264": [True, False], + "with_opus": [True, False], + "with_vorbis": [True, False], + "with_zeromq": [True, False], + "with_sdl": [True, False], + "with_libx264": [True, False], + "with_libx265": [True, False], + "with_libvpx": [True, False], + "with_libmp3lame": [True, False], + "with_libfdk_aac": [True, False], + "with_libwebp": [True, False], + "with_ssl": [False, "openssl", "securetransport"], + "with_libalsa": [True, False], + "with_pulse": [True, False], + "with_vaapi": [True, False], + "with_vdpau": [True, False], + "with_vulkan": [True, False], + "with_xcb": [True, False], + "with_appkit": [True, False], + "with_avfoundation": [True, False], + "with_coreimage": [True, False], + "with_audiotoolbox": [True, False], + "with_videotoolbox": [True, False], + "with_programs": [True, False], + "disable_everything": [True, False], + "disable_all_encoders": [True, False], + "disable_encoders": [None, "ANY"], + "enable_encoders": [None, "ANY"], + "disable_all_decoders": [True, False], + "disable_decoders": [None, "ANY"], + "enable_decoders": [None, "ANY"], + "disable_all_hardware_accelerators": [True, False], + "disable_hardware_accelerators": [None, "ANY"], + "enable_hardware_accelerators": [None, "ANY"], + "disable_all_muxers": [True, False], + "disable_muxers": [None, "ANY"], + "enable_muxers": [None, "ANY"], + "disable_all_demuxers": [True, False], + "disable_demuxers": [None, "ANY"], + "enable_demuxers": [None, "ANY"], + "disable_all_parsers": [True, False], + "disable_parsers": [None, "ANY"], + "enable_parsers": [None, "ANY"], + "disable_all_bitstream_filters": [True, False], + "disable_bitstream_filters": [None, "ANY"], + "enable_bitstream_filters": [None, "ANY"], + "disable_all_protocols": [True, False], + "disable_protocols": [None, "ANY"], + "enable_protocols": [None, "ANY"], + "disable_all_devices": [True, False], + "disable_all_input_devices": [True, False], + "disable_input_devices": [None, "ANY"], + "enable_input_devices": [None, "ANY"], + "disable_all_output_devices": [True, False], + "disable_output_devices": [None, "ANY"], + "enable_output_devices": [None, "ANY"], + "disable_all_filters": [True, False], + "disable_filters": [None, "ANY"], + "enable_filters": [None, "ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "avdevice": True, + "avcodec": True, + "avformat": True, + "swresample": True, + "swscale": True, + "postproc": True, + "avfilter": True, + "with_asm": True, + "with_zlib": True, + "with_bzip2": True, + "with_lzma": True, + "with_libiconv": True, + "with_freetype": True, + "with_openjpeg": True, + "with_openh264": True, + "with_opus": True, + "with_vorbis": True, + "with_zeromq": False, + "with_sdl": False, + "with_libx264": True, + "with_libx265": True, + "with_libvpx": True, + "with_libmp3lame": True, + "with_libfdk_aac": True, + "with_libwebp": True, + "with_ssl": "openssl", + "with_libalsa": True, + "with_pulse": True, + "with_vaapi": True, + "with_vdpau": True, + "with_vulkan": True, + "with_xcb": True, + "with_appkit": True, + "with_avfoundation": True, + "with_coreimage": True, + "with_audiotoolbox": True, + "with_videotoolbox": True, + "with_programs": True, + "disable_everything": False, + "disable_all_encoders": False, + "disable_encoders": None, + "enable_encoders": None, + "disable_all_decoders": False, + "disable_decoders": None, + "enable_decoders": None, + "disable_all_hardware_accelerators": False, + "disable_hardware_accelerators": None, + "enable_hardware_accelerators": None, + "disable_all_muxers": False, + "disable_muxers": None, + "enable_muxers": None, + "disable_all_demuxers": False, + "disable_demuxers": None, + "enable_demuxers": None, + "disable_all_parsers": False, + "disable_parsers": None, + "enable_parsers": None, + "disable_all_bitstream_filters": False, + "disable_bitstream_filters": None, + "enable_bitstream_filters": None, + "disable_all_protocols": False, + "disable_protocols": None, + "enable_protocols": None, + "disable_all_devices": False, + "disable_all_input_devices": False, + "disable_input_devices": None, + "enable_input_devices": None, + "disable_all_output_devices": False, + "disable_output_devices": None, + "enable_output_devices": None, + "disable_all_filters": False, + "disable_filters": None, + "enable_filters": None, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _dependencies(self): + return { + "avformat": ["avcodec"], + "avdevice": ["avcodec", "avformat"], + "avfilter": ["avformat"], + "with_bzip2": ["avformat"], + "with_ssl": ["avformat"], + "with_zlib": ["avcodec"], + "with_lzma": ["avcodec"], + "with_libiconv": ["avcodec"], + "with_openjpeg": ["avcodec"], + "with_openh264": ["avcodec"], + "with_vorbis": ["avcodec"], + "with_opus": ["avcodec"], + "with_libx264": ["avcodec"], + "with_libx265": ["avcodec"], + "with_libvpx": ["avcodec"], + "with_libmp3lame": ["avcodec"], + "with_libfdk_aac": ["avcodec"], + "with_libwebp": ["avcodec"], + "with_freetype": ["avfilter"], + "with_zeromq": ["avfilter", "avformat"], + "with_libalsa": ["avdevice"], + "with_xcb": ["avdevice"], + "with_pulse": ["avdevice"], + "with_sdl": ["with_programs"], + } + + @property + def _version_supports_vulkan(self): + return Version(self.version) >= "4.3.0" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self.settings.os in ["Linux", "FreeBSD"]: + del self.options.with_vaapi + del self.options.with_vdpau + del self.options.with_vulkan + del self.options.with_xcb + del self.options.with_libalsa + del self.options.with_pulse + if self.settings.os != "Macos": + del self.options.with_appkit + if self.settings.os not in ["Macos", "iOS", "tvOS"]: + del self.options.with_coreimage + del self.options.with_audiotoolbox + del self.options.with_videotoolbox + if not is_apple_os(self): + del self.options.with_avfoundation + if not self._version_supports_vulkan: + self.options.rm_safe("with_vulkan") + + 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_zlib: + self.requires("zlib/1.2.13") + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.with_lzma: + self.requires("xz_utils/5.4.2") + if self.options.with_libiconv: + self.requires("libiconv/1.17") + if self.options.with_freetype: + self.requires("freetype/2.13.0") + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + if self.options.with_openh264: + self.requires("openh264/2.3.1") + if self.options.with_vorbis: + self.requires("vorbis/1.3.7") + if self.options.with_opus: + self.requires("opus/1.3.1") + if self.options.with_zeromq: + self.requires("zeromq/4.3.4") + if self.options.with_sdl: + self.requires("sdl/2.26.1") + if self.options.with_libx264: + self.requires("libx264/cci.20220602") + if self.options.with_libx265: + self.requires("libx265/3.4") + if self.options.with_libvpx: + self.requires("libvpx/1.11.0") + if self.options.with_libmp3lame: + self.requires("libmp3lame/3.100") + if self.options.with_libfdk_aac: + self.requires("libfdk_aac/2.0.2") + if self.options.with_libwebp: + self.requires("libwebp/1.3.0") + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + if self.options.get_safe("with_libalsa"): + self.requires("libalsa/1.2.7.2") + if self.options.get_safe("with_xcb") or self.options.get_safe("with_vaapi"): + self.requires("xorg/system") + if self.options.get_safe("with_pulse"): + self.requires("pulseaudio/14.2") + if self.options.get_safe("with_vaapi"): + self.requires("vaapi/system") + if self.options.get_safe("with_vdpau"): + self.requires("vdpau/system") + if self._version_supports_vulkan and self.options.get_safe("with_vulkan"): + self.requires("vulkan-loader/1.3.239.0") + + def validate(self): + if self.options.with_ssl == "securetransport" and not is_apple_os(self): + raise ConanInvalidConfiguration( + "securetransport is only available on Apple") + + for dependency, features in self._dependencies.items(): + if not self.options.get_safe(dependency): + continue + used = False + for feature in features: + used = used or self.options.get_safe(feature) + if not used: + raise ConanInvalidConfiguration("FFmpeg '{}' option requires '{}' option to be enabled".format( + dependency, "' or '".join(features))) + + def build_requirements(self): + if self.settings.arch in ("x86", "x86_64"): + self.tool_requires("yasm/1.3.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _target_arch(self): + # Taken from acceptable values https://github.com/FFmpeg/FFmpeg/blob/0684e58886881a998f1a7b510d73600ff1df2b90/configure#L5010 + if str(self.settings.arch).startswith("armv8"): + return "aarch64" + elif self.settings.arch == "x86": + return "i686" + return str(self.settings.arch) + + @property + def _target_os(self): + if self.settings.os == "Windows": + return "mingw32" if self.settings.compiler == "gcc" else "win32" + elif is_apple_os(self): + return "darwin" + + # Taken from https://github.com/FFmpeg/FFmpeg/blob/0684e58886881a998f1a7b510d73600ff1df2b90/configure#L5485 + # This is the map of Conan OS settings to FFmpeg acceptable values + return { + "AIX": "aix", + "Android": "android", + "FreeBSD": "freebsd", + "Linux": "linux", + "Neutrino": "qnx", + "SunOS": "sunos", + }.get(str(self.settings.os), "none") + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) < "5.1": + # suppress MSVC linker warnings: https://trac.ffmpeg.org/ticket/7396 + # warning LNK4049: locally defined symbol x264_levels imported + # warning LNK4049: locally defined symbol x264_bit_depth imported + replace_in_file(self, os.path.join(self.source_folder, "libavcodec", "libx264.c"), + "#define X264_API_IMPORTS 1", "") + if self.options.with_ssl == "openssl": + # https://trac.ffmpeg.org/ticket/5675 + openssl_libraries = " ".join( + [f"-l{lib}" for lib in self.dependencies["openssl"].cpp_info.aggregated_components().libs]) + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||", + f"check_lib openssl openssl/ssl.h OPENSSL_init_ssl {openssl_libraries} || ") + + replace_in_file(self, os.path.join(self.source_folder, "configure"), "echo libx264.lib", "echo x264.lib") + + @property + def _default_compilers(self): + if self.settings.compiler == "gcc": + return {"cc": "gcc", "cxx": "g++"} + elif self.settings.compiler in ["clang", "apple-clang"]: + return {"cc": "clang", "cxx": "clang++"} + elif is_msvc(self): + return {"cc": "cl.exe", "cxx": "cl.exe"} + return {} + + def _create_toolchain(self): + tc = AutotoolsToolchain(self) + # Custom configure script of ffmpeg understands: + # --prefix, --bindir, --datadir, --docdir, --incdir, --libdir, --mandir + # Options --datadir, --docdir, --incdir, and --mandir are not injected by AutotoolsToolchain but their default value + # in ffmpeg script matches expected conan install layout. + # Several options injected by AutotoolsToolchain are unknown from this configure script and must be pruned. + # This must be done before modifying tc.configure_args, because update_configre_args currently removes + # duplicate configuration keys, even when they have different values, such as list of encoder flags. + # See https://github.com/conan-io/conan-center-index/issues/17140 for further information. + tc.update_configure_args({ + "--sbindir": None, + "--includedir": None, + "--oldincludedir": None, + "--datarootdir": None, + "--build": None, + "--host": None, + "--target": None, + }) + return tc + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + def opt_enable_disable(what, v): + return "--{}-{}".format("enable" if v else "disable", what) + + def opt_append_disable_if_set(args, what, v): + if v: + args.append(f"--disable-{what}") + + tc = self._create_toolchain() + + args = [ + "--pkg-config-flags=--static", + "--disable-doc", + opt_enable_disable("cross-compile", cross_building(self)), + opt_enable_disable("asm", self.options.with_asm), + # Libraries + opt_enable_disable("shared", self.options.shared), + opt_enable_disable("static", not self.options.shared), + opt_enable_disable("pic", self.options.get_safe("fPIC", True)), + # Components + opt_enable_disable("avdevice", self.options.avdevice), + opt_enable_disable("avcodec", self.options.avcodec), + opt_enable_disable("avformat", self.options.avformat), + opt_enable_disable("swresample", self.options.swresample), + opt_enable_disable("swscale", self.options.swscale), + opt_enable_disable("postproc", self.options.postproc), + opt_enable_disable("avfilter", self.options.avfilter), + + # Dependencies + opt_enable_disable("bzlib", self.options.with_bzip2), + opt_enable_disable("zlib", self.options.with_zlib), + opt_enable_disable("lzma", self.options.with_lzma), + opt_enable_disable("iconv", self.options.with_libiconv), + opt_enable_disable("libopenjpeg", self.options.with_openjpeg), + opt_enable_disable("libopenh264", self.options.with_openh264), + opt_enable_disable("libvorbis", self.options.with_vorbis), + opt_enable_disable("libopus", self.options.with_opus), + opt_enable_disable("libzmq", self.options.with_zeromq), + opt_enable_disable("sdl2", self.options.with_sdl), + opt_enable_disable("libx264", self.options.with_libx264), + opt_enable_disable("libx265", self.options.with_libx265), + opt_enable_disable("libvpx", self.options.with_libvpx), + opt_enable_disable("libmp3lame", self.options.with_libmp3lame), + opt_enable_disable("libfdk-aac", self.options.with_libfdk_aac), + opt_enable_disable("libwebp", self.options.with_libwebp), + 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("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("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"), + "--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) + ] + + # Individual Component Options + opt_append_disable_if_set(args, "everything", self.options.disable_everything) + opt_append_disable_if_set(args, "encoders", self.options.disable_all_encoders) + opt_append_disable_if_set(args, "decoders", self.options.disable_all_decoders) + opt_append_disable_if_set(args, "hwaccels", self.options.disable_all_hardware_accelerators) + opt_append_disable_if_set(args, "muxers", self.options.disable_all_muxers) + opt_append_disable_if_set(args, "demuxers", self.options.disable_all_demuxers) + opt_append_disable_if_set(args, "parsers", self.options.disable_all_parsers) + opt_append_disable_if_set(args, "bsfs", self.options.disable_all_bitstream_filters) + opt_append_disable_if_set(args, "protocols", self.options.disable_all_protocols) + opt_append_disable_if_set(args, "devices", self.options.disable_all_devices) + opt_append_disable_if_set(args, "indevs", self.options.disable_all_input_devices) + opt_append_disable_if_set(args, "outdevs", self.options.disable_all_output_devices) + opt_append_disable_if_set(args, "filters", self.options.disable_all_filters) + + args.extend(self._split_and_format_options_string( + "enable-encoder", self.options.enable_encoders)) + args.extend(self._split_and_format_options_string( + "disable-encoder", self.options.disable_encoders)) + args.extend(self._split_and_format_options_string( + "enable-decoder", self.options.enable_decoders)) + args.extend(self._split_and_format_options_string( + "disable-decoder", self.options.disable_decoders)) + args.extend(self._split_and_format_options_string( + "enable-hwaccel", self.options.enable_hardware_accelerators)) + args.extend(self._split_and_format_options_string( + "disable-hwaccel", self.options.disable_hardware_accelerators)) + args.extend(self._split_and_format_options_string( + "enable-muxer", self.options.enable_muxers)) + args.extend(self._split_and_format_options_string( + "disable-muxer", self.options.disable_muxers)) + args.extend(self._split_and_format_options_string( + "enable-demuxer", self.options.enable_demuxers)) + args.extend(self._split_and_format_options_string( + "disable-demuxer", self.options.disable_demuxers)) + args.extend(self._split_and_format_options_string( + "enable-parser", self.options.enable_parsers)) + args.extend(self._split_and_format_options_string( + "disable-parser", self.options.disable_parsers)) + args.extend(self._split_and_format_options_string( + "enable-bsf", self.options.enable_bitstream_filters)) + args.extend(self._split_and_format_options_string( + "disable-bsf", self.options.disable_bitstream_filters)) + args.extend(self._split_and_format_options_string( + "enable-protocol", self.options.enable_protocols)) + args.extend(self._split_and_format_options_string( + "disable-protocol", self.options.disable_protocols)) + args.extend(self._split_and_format_options_string( + "enable-indev", self.options.enable_input_devices)) + args.extend(self._split_and_format_options_string( + "disable-indev", self.options.disable_input_devices)) + args.extend(self._split_and_format_options_string( + "enable-outdev", self.options.enable_output_devices)) + args.extend(self._split_and_format_options_string( + "disable-outdev", self.options.disable_output_devices)) + args.extend(self._split_and_format_options_string( + "enable-filter", self.options.enable_filters)) + args.extend(self._split_and_format_options_string( + "disable-filter", self.options.disable_filters)) + + if self._version_supports_vulkan: + args.append(opt_enable_disable("vulkan", self.options.get_safe("with_vulkan"))) + if is_apple_os(self): + # relocatable shared libs + args.append("--install-name-dir=@rpath") + args.append(f"--arch={self._target_arch}") + if self.settings.build_type == "Debug": + args.extend([ + "--disable-optimizations", + "--disable-mmx", + "--disable-stripping", + "--enable-debug", + ]) + if not self.options.with_programs: + args.append("--disable-programs") + # since ffmpeg"s build system ignores CC and CXX + compilers_from_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + buildenv_vars = VirtualBuildEnv(self).vars() + nm = buildenv_vars.get("NM") + if nm: + args.append(f"--nm={unix_path(self, nm)}") + ar = buildenv_vars.get("AR") + if ar: + args.append(f"--ar={unix_path(self, ar)}") + if self.options.with_asm: + asm = compilers_from_conf.get("asm", buildenv_vars.get("AS")) + if asm: + args.append(f"--as={unix_path(self, asm)}") + strip = buildenv_vars.get("STRIP") + if strip: + args.append(f"--strip={unix_path(self, strip)}") + cc = compilers_from_conf.get("c", buildenv_vars.get("CC", self._default_compilers.get("cc"))) + if cc: + args.append(f"--cc={unix_path(self, cc)}") + cxx = compilers_from_conf.get("cpp", buildenv_vars.get("CXX", self._default_compilers.get("cxx"))) + if cxx: + args.append(f"--cxx={unix_path(self, cxx)}") + ld = buildenv_vars.get("LD") + if ld: + args.append(f"--ld={unix_path(self, ld)}") + ranlib = buildenv_vars.get("RANLIB") + if ranlib: + args.append(f"--ranlib={unix_path(self, ranlib)}") + # for some reason pkgconf from conan can't find .pc files on Linux in the context of ffmpeg configure... + if self._settings_build.os != "Linux": + pkg_config = self.conf.get("tools.gnu:pkg_config", default=buildenv_vars.get("PKG_CONFIG"), check_type=str) + if pkg_config: + args.append(f"--pkg-config={unix_path(self, pkg_config)}") + if is_msvc(self): + args.append("--toolchain=msvc") + if not check_min_vs(self, "190", raise_invalid=False): + # Visual Studio 2013 (and earlier) doesn't support "inline" keyword for C (only for C++) + tc.extra_defines.append("inline=__inline") + if cross_building(self): + args.append(f"--target-os={self._target_os}") + if is_apple_os(self) and self.options.with_audiotoolbox: + args.append("--disable-outdev=audiotoolbox") + + if tc.cflags: + args.append("--extra-cflags={}".format(" ".join(tc.cflags))) + if tc.ldflags: + args.append("--extra-ldflags={}".format(" ".join(tc.ldflags))) + tc.configure_args.extend(args) + tc.generate() + + 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"-LIBPATH:{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() + + deps = PkgConfigDeps(self) + deps.generate() + + def _split_and_format_options_string(self, flag_name, options_list): + if not options_list: + return [] + + def _format_options_list_item(flag_name, options_item): + return f"--{flag_name}={options_item}" + + def _split_options_string(options_string): + return list(filter(None, "".join(options_string.split()).split(","))) + + options_string = str(options_list) + return [_format_options_list_item(flag_name, item) for item in _split_options_string(options_string)] + + def build(self): + self._patch_sources() + if self.options.with_libx264: + # ffmepg expects libx264.pc instead of x264.pc + with chdir(self, self.generators_folder): + shutil.copy("x264.pc", "libx264.pc") + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE.md", 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")) + if is_msvc(self): + if self.options.shared: + # ffmpeg created `.lib` files in the `/bin` folder + for fn in os.listdir(os.path.join(self.package_folder, "bin")): + if fn.endswith(".lib"): + rename(self, os.path.join(self.package_folder, "bin", fn), + os.path.join(self.package_folder, "lib", fn)) + rm(self, "*.def", os.path.join(self.package_folder, "lib")) + else: + # ffmpeg produces `.a` files that are actually `.lib` files + with chdir(self, os.path.join(self.package_folder, "lib")): + for lib in glob.glob("*.a"): + rename(self, lib, lib[3:-2] + ".lib") + + def _read_component_version(self, component_name): + # since 5.1, major version may be defined in version_major.h instead of version.h + component_folder = os.path.join(self.package_folder, "include", f"lib{component_name}") + version_file_name = os.path.join(component_folder, "version.h") + version_major_file_name = os.path.join(component_folder, "version_major.h") + pattern = f"define LIB{component_name.upper()}_VERSION_(MAJOR|MINOR|MICRO)[ \t]+(\\d+)" + version = dict() + for file in (version_file_name, version_major_file_name): + if os.path.isfile(file): + with open(file, "r", encoding="utf-8") as f: + for line in f: + match = re.search(pattern, line) + if match: + version[match[1]] = match[2] + if "MAJOR" in version and "MINOR" in version and "MICRO" in version: + return f"{version['MAJOR']}.{version['MINOR']}.{version['MICRO']}" + return None + + def _set_component_version(self, component_name): + version = self._read_component_version(component_name) + if version is not None: + self.cpp_info.components[component_name].set_property("component_version", version) + # TODO: to remove once support of conan v1 dropped + self.cpp_info.components[component_name].version = version + else: + self.output.warning(f"cannot determine version of lib{component_name} packaged with ffmpeg!") + + def package_info(self): + if self.options.with_programs: + if self.options.with_sdl: + self.cpp_info.components["programs"].requires = [ + "sdl::libsdl2"] + + 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") + + 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") + + 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") + + 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") + + 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") + + 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") + + 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") + + 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"] + 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"] + 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"] + elif self.settings.os == "Windows": + if self.options.avcodec: + self.cpp_info.components["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"] + elif is_apple_os(self): + if self.options.avdevice: + self.cpp_info.components["avdevice"].frameworks = [ + "CoreFoundation", "Foundation", "CoreGraphics"] + if self.options.avfilter: + self.cpp_info.components["avfilter"].frameworks = [ + "CoreGraphics"] + if self.options.avcodec: + self.cpp_info.components["avcodec"].frameworks = [ + "CoreFoundation", "CoreVideo", "CoreMedia"] + if self.settings.os == "Macos": + if self.options.avdevice: + self.cpp_info.components["avdevice"].frameworks.append( + "OpenGL") + if self.options.avfilter: + self.cpp_info.components["avfilter"].frameworks.append( + "OpenGL") + + if self.options.avdevice: + if self.options.get_safe("with_libalsa"): + self.cpp_info.components["avdevice"].requires.append( + "libalsa::libalsa") + if self.options.get_safe("with_xcb"): + self.cpp_info.components["avdevice"].requires.append( + "xorg::xcb") + if self.options.get_safe("with_pulse"): + self.cpp_info.components["avdevice"].requires.append( + "pulseaudio::pulseaudio") + if self.options.get_safe("with_appkit"): + self.cpp_info.components["avdevice"].frameworks.append( + "AppKit") + if self.options.get_safe("with_avfoundation"): + self.cpp_info.components["avdevice"].frameworks.append( + "AVFoundation") + if self.options.get_safe("with_audiotoolbox"): + self.cpp_info.components["avdevice"].frameworks.append( + "CoreAudio") + + if self.options.avcodec: + if self.options.with_zlib: + self.cpp_info.components["avcodec"].requires.append( + "zlib::zlib") + if self.options.with_lzma: + self.cpp_info.components["avcodec"].requires.append( + "xz_utils::xz_utils") + if self.options.with_libiconv: + self.cpp_info.components["avcodec"].requires.append( + "libiconv::libiconv") + if self.options.with_openjpeg: + self.cpp_info.components["avcodec"].requires.append( + "openjpeg::openjpeg") + if self.options.with_openh264: + self.cpp_info.components["avcodec"].requires.append( + "openh264::openh264") + if self.options.with_vorbis: + self.cpp_info.components["avcodec"].requires.append( + "vorbis::vorbis") + if self.options.with_opus: + self.cpp_info.components["avcodec"].requires.append( + "opus::opus") + if self.options.with_libx264: + self.cpp_info.components["avcodec"].requires.append( + "libx264::libx264") + if self.options.with_libx265: + self.cpp_info.components["avcodec"].requires.append( + "libx265::libx265") + if self.options.with_libvpx: + self.cpp_info.components["avcodec"].requires.append( + "libvpx::libvpx") + if self.options.with_libmp3lame: + self.cpp_info.components["avcodec"].requires.append( + "libmp3lame::libmp3lame") + if self.options.with_libfdk_aac: + self.cpp_info.components["avcodec"].requires.append( + "libfdk_aac::libfdk_aac") + if self.options.with_libwebp: + self.cpp_info.components["avcodec"].requires.append( + "libwebp::libwebp") + if self.options.get_safe("with_audiotoolbox"): + self.cpp_info.components["avcodec"].frameworks.append( + "AudioToolbox") + if self.options.get_safe("with_videotoolbox"): + self.cpp_info.components["avcodec"].frameworks.append( + "VideoToolbox") + + if self.options.avformat: + if self.options.with_bzip2: + self.cpp_info.components["avformat"].requires.append( + "bzip2::bzip2") + if self.options.with_zeromq: + self.cpp_info.components["avformat"].requires.append( + "zeromq::libzmq") + if self.options.with_ssl == "openssl": + self.cpp_info.components["avformat"].requires.append( + "openssl::ssl") + elif self.options.with_ssl == "securetransport": + self.cpp_info.components["avformat"].frameworks.append( + "Security") + + if self.options.avfilter: + if self.options.with_freetype: + self.cpp_info.components["avfilter"].requires.append( + "freetype::freetype") + if self.options.with_zeromq: + self.cpp_info.components["avfilter"].requires.append( + "zeromq::libzmq") + if self.options.get_safe("with_appkit"): + self.cpp_info.components["avfilter"].frameworks.append( + "AppKit") + if self.options.get_safe("with_coreimage"): + self.cpp_info.components["avfilter"].frameworks.append( + "CoreImage") + if Version(self.version) >= "5.0" and is_apple_os(self): + self.cpp_info.components["avfilter"].frameworks.append("Metal") + + if self.options.get_safe("with_vaapi"): + self.cpp_info.components["avutil"].requires.extend( + ["vaapi::vaapi", "xorg::x11"]) + + if self.options.get_safe("with_vdpau"): + self.cpp_info.components["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") diff --git a/recipes/ffmpeg/all/patches/5.0-0001-fix-hwcontext_vulkan.patch b/recipes/ffmpeg/all/patches/5.0-0001-fix-hwcontext_vulkan.patch new file mode 100644 index 0000000000000..344b5c89fcdec --- /dev/null +++ b/recipes/ffmpeg/all/patches/5.0-0001-fix-hwcontext_vulkan.patch @@ -0,0 +1,17 @@ +--- a/libavutil/hwcontext_vulkan.c ++++ b/libavutil/hwcontext_vulkan.c +@@ -354,14 +354,6 @@ static const VulkanOptExtension optional_device_exts[] = { + { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY }, + { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM }, + #endif +- +- /* Video encoding/decoding */ +- { VK_KHR_VIDEO_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, + }; + + /* Converts return values to strings */ diff --git a/recipes/ffmpeg/all/test_package/CMakeLists.txt b/recipes/ffmpeg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e8b19851e2f49 --- /dev/null +++ b/recipes/ffmpeg/all/test_package/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ffmpeg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::avutil) +if (TARGET ffmpeg::avdevice) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_AVDEVICE) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::avdevice) +endif () +if (TARGET ffmpeg::avfilter) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_AVFILTER) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::avfilter) +endif () +if (TARGET ffmpeg::avformat) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_AVFORMAT) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::avformat) +endif () +if (TARGET ffmpeg::avcodec) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_AVCODEC) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::avcodec) +endif () +if (TARGET ffmpeg::swscale) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_SWSCALE) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::swscale) +endif () +if (TARGET ffmpeg::swresample) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_SWRESAMPLE) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::swresample) +endif () +if (TARGET ffmpeg::postproc) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FFMPEG_POSTPROC) + target_link_libraries(${PROJECT_NAME} PRIVATE ffmpeg::postproc) +endif () diff --git a/recipes/ffmpeg/all/test_package/conanfile.py b/recipes/ffmpeg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/ffmpeg/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ffmpeg/all/test_package/test_package.c b/recipes/ffmpeg/all/test_package/test_package.c new file mode 100644 index 0000000000000..a868a90f9d1a1 --- /dev/null +++ b/recipes/ffmpeg/all/test_package/test_package.c @@ -0,0 +1,55 @@ +#ifdef HAVE_FFMPEG_AVCODEC +# include +#endif +#ifdef HAVE_FFMPEG_AVFORMAT +# include +#endif +#ifdef HAVE_FFMPEG_AVFILTER +# include +#endif +#ifdef HAVE_FFMPEG_AVDEVICE +# include +#endif +#ifdef HAVE_FFMPEG_SWRESAMPLE +# include +#endif +#ifdef HAVE_FFMPEG_SWSCALE +# include +#endif +#include + +#include +#include + +int main() +{ + #ifdef HAVE_FFMPEG_AVCODEC + printf("configuration: %s\n", avcodec_configuration()); + printf("avcodec version: %d.%d.%d\n", AV_VERSION_MAJOR(avcodec_version()), AV_VERSION_MINOR(avcodec_version()), AV_VERSION_MICRO(avcodec_version())); + #else + printf("avcodec is disabled!\n"); + #endif + #ifdef HAVE_FFMPEG_AVFILTER + printf("avfilter version: %d.%d.%d\n", AV_VERSION_MAJOR(avfilter_version()), AV_VERSION_MINOR(avfilter_version()), AV_VERSION_MICRO(avfilter_version())); + #else + printf("avfilter is disabled!\n"); + #endif + #ifdef HAVE_FFMPEG_AVDEVICE + avdevice_register_all(); + printf("avdevice version: %d.%d.%d\n", AV_VERSION_MAJOR(avdevice_version()), AV_VERSION_MINOR(avdevice_version()), AV_VERSION_MICRO(avdevice_version())); + #else + printf("avdevice is disabled!\n"); + #endif + #ifdef HAVE_FFMPEG_SWRESAMPLE + printf("swresample version: %d.%d.%d\n", AV_VERSION_MAJOR(swresample_version()), AV_VERSION_MINOR(swresample_version()), AV_VERSION_MICRO(swresample_version())); + #else + printf("swresample is disabled!\n"); + #endif + #ifdef HAVE_FFMPEG_SWSCALE + printf("swscale version: %d.%d.%d\n", AV_VERSION_MAJOR(swscale_version()), AV_VERSION_MINOR(swscale_version()), AV_VERSION_MICRO(swscale_version())); + #else + printf("swscale is disabled!\n"); + #endif + + return EXIT_SUCCESS; +} diff --git a/recipes/ffmpeg/all/test_v1_package/CMakeLists.txt b/recipes/ffmpeg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ffmpeg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ffmpeg/all/test_v1_package/conanfile.py b/recipes/ffmpeg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..eab3ab98cce15 --- /dev/null +++ b/recipes/ffmpeg/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + if self.options["ffmpeg"].with_programs: + self.run("ffmpeg --help", run_environment=True) + + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml new file mode 100644 index 0000000000000..c829a400b90aa --- /dev/null +++ b/recipes/ffmpeg/config.yml @@ -0,0 +1,13 @@ +versions: + "5.1": + folder: "all" + "5.0": + 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/fft/all/CMakeLists.txt b/recipes/fft/all/CMakeLists.txt new file mode 100644 index 0000000000000..373435ea9437a --- /dev/null +++ b/recipes/fft/all/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.2) +project(fft LANGUAGES C) + +option(FFT_THREADS "use threads" OFF) + +set(HEADERS "fft.h;fft2.h;fft3.h;dct.h;${CMAKE_CURRENT_BINARY_DIR}/fft_export.h") + +add_library(${PROJECT_NAME} fft_build.c) + +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${HEADERS}" + C_VISIBILITY_PRESET hidden) +target_include_directories(${PROJECT_NAME} PRIVATE ${FFT_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + +if(FFT_THREADS) + find_package(Threads REQUIRED) + if(WIN32) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_CDFT_WINTHREADS) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_FFT2D_WINTHREADS) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_FFT3D_WINTHREADS) + else() + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_CDFT_PTHREADS) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_FFT2D_PTHREADS) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_FFT3D_PTHREADS) + endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE "CDFT_THREADS_BEGIN_N=${FFT_THREADS_BEGIN_N}") + target_compile_definitions(${PROJECT_NAME} PRIVATE "CDFT_4THREADS_BEGIN_N=${FFT_THREADS_BEGIN_N}") + target_compile_definitions(${PROJECT_NAME} PRIVATE "FFT2D_THREADS_BEGIN_N=${FFT_THREADS_BEGIN_N}") + target_compile_definitions(${PROJECT_NAME} PRIVATE "FFT2D_MAX_THREADS=${FFT_MAX_THREADS}") + target_compile_definitions(${PROJECT_NAME} PRIVATE "FFT3D_THREADS_BEGIN_N=${FFT_THREADS_BEGIN_N}") + target_compile_definitions(${PROJECT_NAME} PRIVATE "FFT3D_MAX_THREADS=${FFT_MAX_THREADS}") + + target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads) +endif() + +include(GenerateExportHeader) +generate_export_header(${PROJECT_NAME}) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fft + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/recipes/fft/all/conandata.yml b/recipes/fft/all/conandata.yml new file mode 100644 index 0000000000000..982fde49902e6 --- /dev/null +++ b/recipes/fft/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20061228": + url: "http://www.kurims.kyoto-u.ac.jp/~ooura/fft2d.tgz" + sha256: "ada7e99087c4ed477bfdf11413f2ba8db8a840ba9bbf8ac94f4f3972e2a7cec9" diff --git a/recipes/fft/all/conanfile.py b/recipes/fft/all/conanfile.py new file mode 100644 index 0000000000000..70af1f1a66f4c --- /dev/null +++ b/recipes/fft/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, save +import os + +required_conan_version = ">=1.53.0" + + +class FftConan(ConanFile): + name = "fft" + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html" + description = ( + "This is a package to calculate Discrete Fourier/Cosine/Sine " + "Transforms of 2,3-dimensional sequences of length 2^N." + ) + topics = ("fft2d", "fft3d", "dct", "dst", "dft") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threads": [True, False], + "max_threads": ["ANY"], + "threads_begin_n": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "threads": False, + "max_threads": 4, + "threads_begin_n": 65536, + } + + exports_sources = ["CMakeLists.txt", "fft_build.c", "fft.h", "fft2.h", "fft3.h", "dct.h"] + + 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") + if not self.options.threads: + del self.options.max_threads + del self.options.threads_begin_n + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + def _is_power_of_two(n): + return (n != 0) and (n & (n-1) == 0) + + if self.options.threads: + if not self.options.max_threads.isdigit(): + raise ConanInvalidConfiguration("max_threads must be an integer") + if not self.options.threads_begin_n.isdigit(): + raise ConanInvalidConfiguration("threads_begin_n must be an integer") + if not _is_power_of_two(int(self.options.max_threads)): + raise ConanInvalidConfiguration("max_threads must be a power of 2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FFT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["FFT_THREADS"] = self.options.threads + if self.options.threads: + tc.variables["FFT_MAX_THREADS"] = self.options.max_threads + tc.variables["FFT_THREADS_BEGIN_N"] = self.options.threads_begin_n + 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): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), +"""Copyright + Copyright(C) 1997,2001 Takuya OOURA (email: ooura@kurims.kyoto-u.ac.jp). + You may use, copy, modify this code for any purpose and + without fee. You may distribute this ORIGINAL package.""") + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["fft"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.options.threads: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/fft/all/dct.h b/recipes/fft/all/dct.h new file mode 100644 index 0000000000000..f050591cf7919 --- /dev/null +++ b/recipes/fft/all/dct.h @@ -0,0 +1,19 @@ +#pragma once + +#ifndef __FFT_DCT_H_AC3FBB1E_47B8_49E2_8271_1E44DAB78490__ +#define __FFT_DCT_H_AC3FBB1E_47B8_49E2_8271_1E44DAB78490__ + +#include "fft_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +FFT_EXPORT void ddct8x8s(int isgn, double **a); +FFT_EXPORT void ddct16x16s(int isgn, double **a); + +#ifdef __cplusplus +} +#endif + +#endif /* __FFT_DCT_H_AC3FBB1E_47B8_49E2_8271_1E44DAB78490__ */ diff --git a/recipes/fft/all/fft.h b/recipes/fft/all/fft.h new file mode 100644 index 0000000000000..4ff774164459a --- /dev/null +++ b/recipes/fft/all/fft.h @@ -0,0 +1,23 @@ +#pragma once + +#ifndef __FFT_FFT_H_796A834A_D06E_4C88_A15C_E611857B108F__ +#define __FFT_FFT_H_796A834A_D06E_4C88_A15C_E611857B108F__ + +#include "fft_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +FFT_EXPORT void cdft(int, int, double *, int *, double *); +FFT_EXPORT void rdft(int, int, double *, int *, double *); +FFT_EXPORT void ddct(int, int, double *, int *, double *); +FFT_EXPORT void ddst(int, int, double *, int *, double *); +FFT_EXPORT void dfct(int, double *, double *, int *, double *); +FFT_EXPORT void dfst(int, double *, double *, int *, double *); + +#ifdef __cplusplus +} +#endif + +#endif /* __FFT_FFT_H_796A834A_D06E_4C88_A15C_E611857B108F__ */ diff --git a/recipes/fft/all/fft2.h b/recipes/fft/all/fft2.h new file mode 100644 index 0000000000000..4f21b4a227095 --- /dev/null +++ b/recipes/fft/all/fft2.h @@ -0,0 +1,22 @@ +#pragma once + +#ifndef __FFT_FFT2_H_F6EDD639_4BBB_4536_9F32_C7DFEC1608A3__ +#define __FFT_FFT2_H_F6EDD639_4BBB_4536_9F32_C7DFEC1608A3__ + +#include "fft_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +FFT_EXPORT void cdft2d(int, int, int, double **, double *, int *, double *); +FFT_EXPORT void rdft2d(int, int, int, double **, double *, int *, double *); +FFT_EXPORT void rdft2dsort(int, int, int, double **); +FFT_EXPORT void ddct2d(int, int, int, double **, double *, int *, double *); +FFT_EXPORT void ddst2d(int, int, int, double **, double *, int *, double *); + +#ifdef __cplusplus +} +#endif + +#endif /* __FFT_FFT2_H_F6EDD639_4BBB_4536_9F32_C7DFEC1608A3__ */ diff --git a/recipes/fft/all/fft3.h b/recipes/fft/all/fft3.h new file mode 100644 index 0000000000000..95d7f8f9e8725 --- /dev/null +++ b/recipes/fft/all/fft3.h @@ -0,0 +1,22 @@ +#pragma once + +#ifndef __FFT_FFT3_H_F55B14B4_B254_4440_B623_B689DEFA3E0D__ +#define __FFT_FFT3_H_F55B14B4_B254_4440_B623_B689DEFA3E0D__ + +#include "fft_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +FFT_EXPORT void cdft3d(int, int, int, int, double ***, double *, int *, double *); +FFT_EXPORT void rdft3d(int, int, int, int, double ***, double *, int *, double *); +FFT_EXPORT void rdft3dsort(int, int, int, int, double ***); +FFT_EXPORT void ddct3d(int, int, int, int, double ***, double *, int *, double *); +FFT_EXPORT void ddst3d(int, int, int, int, double ***, double *, int *, double *); + +#ifdef __cplusplus +} +#endif + +#endif /* __FFT_FFT3_H_F55B14B4_B254_4440_B623_B689DEFA3E0D__ */ diff --git a/recipes/fft/all/fft_build.c b/recipes/fft/all/fft_build.c new file mode 100644 index 0000000000000..e6c3541c01ae7 --- /dev/null +++ b/recipes/fft/all/fft_build.c @@ -0,0 +1,19 @@ +/* 2D-array Allocation */ +#include "alloc.h" +#include "alloc.c" + +/* 1D FFT Package in C - Fast Version (Split-Radix) */ +#include "fft.h" +#include "fftsg.c" + +/* 2D FFT Package in C - Version II (Split-Radix) */ +#include "fft2.h" +#include "fftsg2d.c" + +/* fftsg3d.c : 3D FFT Package in C - Version II (Split-Radix) */ +#include "fft3.h" +#include "fftsg3d.c" + +/* 8x8, 16x16 DCT Package */ +#include "dct.h" +#include "shrtdct.c" diff --git a/recipes/fft/all/test_package/CMakeLists.txt b/recipes/fft/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a87685a9ccd7a --- /dev/null +++ b/recipes/fft/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(fft REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fft::fft) +if(MSVC) + target_compile_definitions(${PROJECT_NAME} PRIVATE "CRT_SECURE_NO_WARNINGS=1") +endif() diff --git a/recipes/fft/all/test_package/conanfile.py b/recipes/fft/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/fft/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/fft/all/test_package/test_package.c b/recipes/fft/all/test_package/test_package.c new file mode 100644 index 0000000000000..cd8170ce52fa3 --- /dev/null +++ b/recipes/fft/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include +#include + +#define N 2 + +int main() +{ + double A1[N]; + double A2[N]; + double * A[N] = {A1, A2}; + double B[N]; + int ip[N * 2]; + + memset(A1, 0, sizeof(double) * N); + memset(A2, 0, sizeof(double) * N); + memset(B, 0, sizeof(double) * N); + memset(ip, 0, sizeof(int) * N * 2); + + cdft2d(N, N, 1, A, NULL, ip, B); + + return EXIT_SUCCESS; +} diff --git a/recipes/fft/all/test_v1_package/CMakeLists.txt b/recipes/fft/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fft/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fft/all/test_v1_package/conanfile.py b/recipes/fft/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fft/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/fft/config.yml b/recipes/fft/config.yml new file mode 100644 index 0000000000000..f2747d80e2afe --- /dev/null +++ b/recipes/fft/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20061228": + folder: "all" diff --git a/recipes/fftw/all/conandata.yml b/recipes/fftw/all/conandata.yml new file mode 100644 index 0000000000000..9e37904841157 --- /dev/null +++ b/recipes/fftw/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "3.3.10": + url: + - "https://www.fftw.org/fftw-3.3.10.tar.gz" + - "https://fftw.org/fftw-3.3.10.tar.gz" + sha256: "56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467" + "3.3.9": + url: + - "https://www.fftw.org/fftw-3.3.9.tar.gz" + - "https://fftw.org/fftw-3.3.9.tar.gz" + sha256: "bf2c7ce40b04ae811af714deb512510cc2c17b9ab9d6ddcf49fe4487eea7af3d" + "3.3.8": + url: "http://www.fftw.org/fftw-3.3.8.tar.gz" + sha256: "6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303" +patches: + "3.3.9": + - patch_file: "patches/fix-simd.patch" + "3.3.8": + - patch_file: "patches/fix-simd.patch" diff --git a/recipes/fftw/all/conanfile.py b/recipes/fftw/all/conanfile.py new file mode 100644 index 0000000000000..633f3bfb2dc71 --- /dev/null +++ b/recipes/fftw/all/conanfile.py @@ -0,0 +1,133 @@ +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, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class FFTWConan(ConanFile): + name = "fftw" + description = "C subroutine library for computing the Discrete Fourier Transform (DFT) in one or more dimensions" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.fftw.org/" + license = "GPL-2.0" + topics = ("fftw", "dft", "dct", "dst") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "precision": ["double", "single", "longdouble"], + "openmp": [True, False], + "threads": [True, False], + "combinedthreads": [True, False], + "simd": ["sse", "sse2", "avx", "avx2", False], + } + default_options = { + "shared": False, + "fPIC": True, + "precision": "double", + "openmp": False, + "threads": False, + "combinedthreads": False, + "simd": 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") + if not self.options.threads: + del self.options.combinedthreads + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + if self.options.openmp: + raise ConanInvalidConfiguration("Shared fftw with openmp can't be built on Windows") + if self.options.threads and not self.options.combinedthreads: + raise ConanInvalidConfiguration("Shared fftw with threads and not combinedthreads can't be built on Windows") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["ENABLE_OPENMP"] = self.options.openmp + tc.variables["ENABLE_THREADS"] = self.options.threads + tc.variables["WITH_COMBINED_THREADS"] = self.options.get_safe("combinedthreads", False) + tc.variables["ENABLE_FLOAT"] = self.options.precision == "single" + tc.variables["ENABLE_LONG_DOUBLE"] = self.options.precision == "longdouble" + tc.variables["ENABLE_SSE"] = self.options.simd == "sse" + tc.variables["ENABLE_SSE2"] = self.options.simd == "sse2" + tc.variables["ENABLE_AVX"] = self.options.simd == "avx" + tc.variables["ENABLE_AVX2"] = self.options.simd == "avx2" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + prec_suffix = self._prec_suffix[str(self.options.precision)] + cmake_config_name = "FFTW3" + prec_suffix + cmake_namespace = "FFTW3" + cmake_target_name = "fftw3" + prec_suffix + pkgconfig_name = "fftw3" + prec_suffix + lib_name = "fftw3" + prec_suffix + + self.cpp_info.set_property("cmake_file_name", cmake_config_name) + self.cpp_info.set_property("cmake_target_name", f"{cmake_namespace}::{cmake_target_name}") + self.cpp_info.set_property("pkg_config_name", pkgconfig_name) + + # TODO: back to global scope in conan v2 once cmake_find_package_* & pkg_config generators removed + if self.options.openmp: + self.cpp_info.components["fftwlib"].libs.append(lib_name + "_omp") + if self.options.threads and not self.options.combinedthreads: + self.cpp_info.components["fftwlib"].libs.append(lib_name + "_threads") + self.cpp_info.components["fftwlib"].libs.append(lib_name) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["fftwlib"].system_libs.append("m") + if self.options.threads: + self.cpp_info.components["fftwlib"].system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = cmake_config_name + self.cpp_info.filenames["cmake_find_package_multi"] = cmake_config_name + self.cpp_info.names["cmake_find_package"] = cmake_namespace + self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace + self.cpp_info.components["fftwlib"].names["cmake_find_package"] = cmake_target_name + self.cpp_info.components["fftwlib"].names["cmake_find_package_multi"] = cmake_target_name + self.cpp_info.components["fftwlib"].set_property("cmake_target_name", f"{cmake_namespace}::{cmake_target_name}") + self.cpp_info.components["fftwlib"].set_property("pkg_config_name", pkgconfig_name) + + @property + def _prec_suffix(self): + return { + "double": "", + "single": "f", + "longdouble": "l" + } diff --git a/recipes/fftw/all/patches/fix-simd.patch b/recipes/fftw/all/patches/fix-simd.patch new file mode 100644 index 0000000000000..dc92c2877c15a --- /dev/null +++ b/recipes/fftw/all/patches/fix-simd.patch @@ -0,0 +1,43 @@ +https://github.com/FFTW/fftw3/pull/232 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,6 +134,7 @@ include (CheckCCompilerFlag) + if (ENABLE_SSE) + foreach (FLAG "-msse" "/arch:SSE") + unset (HAVE_SSE CACHE) ++ unset (HAVE_SSE) + check_c_compiler_flag (${FLAG} HAVE_SSE) + if (HAVE_SSE) + set (SSE_FLAG ${FLAG}) +@@ -145,6 +146,7 @@ endif () + if (ENABLE_SSE2) + foreach (FLAG "-msse2" "/arch:SSE2") + unset (HAVE_SSE2 CACHE) ++ unset (HAVE_SSE2) + check_c_compiler_flag (${FLAG} HAVE_SSE2) + if (HAVE_SSE2) + set (SSE2_FLAG ${FLAG}) +@@ -156,6 +158,7 @@ endif () + if (ENABLE_AVX) + foreach (FLAG "-mavx" "/arch:AVX") + unset (HAVE_AVX CACHE) ++ unset (HAVE_AVX) + check_c_compiler_flag (${FLAG} HAVE_AVX) + if (HAVE_AVX) + set (AVX_FLAG ${FLAG}) +@@ -167,6 +170,7 @@ endif () + if (ENABLE_AVX2) + foreach (FLAG "-mavx2" "/arch:AVX2") + unset (HAVE_AVX2 CACHE) ++ unset (HAVE_AVX2) + check_c_compiler_flag (${FLAG} HAVE_AVX2) + if (HAVE_AVX2) + set (AVX2_FLAG ${FLAG}) +@@ -179,6 +183,7 @@ endif () + if (ENABLE_AVX2) + foreach (FLAG "-mfma" "/arch:FMA") + unset (HAVE_FMA CACHE) ++ unset (HAVE_FMA) + check_c_compiler_flag (${FLAG} HAVE_FMA) + if (HAVE_FMA) + set (FMA_FLAG ${FLAG}) diff --git a/recipes/fftw/all/test_package/CMakeLists.txt b/recipes/fftw/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3943d935ac8c2 --- /dev/null +++ b/recipes/fftw/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +option(ENABLE_DOUBLE_PRECISION "Enable FFTW single precision" ON) +option(ENABLE_SINGLE_PRECISION "Enable FFTW single precision" OFF) +option(ENABLE_LONG_DOUBLE_PRECISION "Enable FFTW single precision" OFF) + +if(ENABLE_SINGLE_PRECISION) + find_package(FFTW3f REQUIRED CONFIG) +elseif(ENABLE_LONG_DOUBLE_PRECISION) + find_package(FFTW3l REQUIRED CONFIG) +else() + find_package(FFTW3 REQUIRED CONFIG) +endif() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} + $<$:FFTW3::fftw3> + $<$:FFTW3::fftw3f> + $<$:FFTW3::fftw3l>) + +target_compile_options(${PROJECT_NAME} PRIVATE + $<$:-DENABLE_SINGLE_PRECISION=1> + $<$:-DENABLE_LONG_DOUBLE_PRECISION=1>) diff --git a/recipes/fftw/all/test_package/conanfile.py b/recipes/fftw/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ae78315e3f3d3 --- /dev/null +++ b/recipes/fftw/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_DOUBLE_PRECISION"] = self.dependencies["fftw"].options.precision == "double" + tc.variables["ENABLE_SINGLE_PRECISION"] = self.dependencies["fftw"].options.precision == "single" + tc.variables["ENABLE_LONG_DOUBLE_PRECISION"] = self.dependencies["fftw"].options.precision == "longdouble" + 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/fftw/all/test_package/test_package.c b/recipes/fftw/all/test_package/test_package.c new file mode 100644 index 0000000000000..b098fdf9507b1 --- /dev/null +++ b/recipes/fftw/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include "fftw3.h" + +// switch API to match the precision option (fftw_|fftwf_|fftwl) +#if defined(ENABLE_SINGLE_PRECISION) +typedef float real_t; +#define FFTW_MANGLE(name) FFTW_MANGLE_FLOAT(name) +#elif defined(ENABLE_LONG_DOUBLE_PRECISION) +typedef long double real_t; +#define FFTW_MANGLE(name) FFTW_MANGLE_LONG_DOUBLE(name) +#else +typedef double real_t; +#define FFTW_MANGLE(name) FFTW_MANGLE_DOUBLE(name) +#endif + +int main() { + long size = 256; + real_t* input = FFTW_MANGLE(alloc_real)(size); + FFTW_MANGLE(complex)* output = FFTW_MANGLE(alloc_complex)(size); + FFTW_MANGLE(plan) plan = (FFTW_MANGLE(plan_dft_r2c_1d)( + size, input, output, FFTW_ESTIMATE)); + FFTW_MANGLE(execute)(plan); + FFTW_MANGLE(destroy_plan)(plan); + FFTW_MANGLE(free)(output); + FFTW_MANGLE(free)(input); + return 0; +} diff --git a/recipes/fftw/all/test_v1_package/CMakeLists.txt b/recipes/fftw/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fftw/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fftw/all/test_v1_package/conanfile.py b/recipes/fftw/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0608a56e96b9b --- /dev/null +++ b/recipes/fftw/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ENABLE_DOUBLE_PRECISION"] = self.options["fftw"].precision == "double" + cmake.definitions["ENABLE_SINGLE_PRECISION"] = self.options["fftw"].precision == "single" + cmake.definitions["ENABLE_LONG_DOUBLE_PRECISION"] = self.options["fftw"].precision == "longdouble" + 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/fftw/config.yml b/recipes/fftw/config.yml new file mode 100644 index 0000000000000..246a8feb14244 --- /dev/null +++ b/recipes/fftw/config.yml @@ -0,0 +1,7 @@ +versions: + "3.3.10": + folder: all + "3.3.9": + folder: all + "3.3.8": + folder: all diff --git a/recipes/fire-hpp/all/conandata.yml b/recipes/fire-hpp/all/conandata.yml new file mode 100644 index 0000000000000..0ac5acb1e3d98 --- /dev/null +++ b/recipes/fire-hpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2": + sha256: 50ac76005e5d45590355a51e5e1b62aba65c56f2003335acce0370da13d77b28 + url: https://github.com/kongaskristjan/fire-hpp/archive/v0.2.tar.gz diff --git a/recipes/fire-hpp/all/conanfile.py b/recipes/fire-hpp/all/conanfile.py new file mode 100644 index 0000000000000..e2770d10a2f50 --- /dev/null +++ b/recipes/fire-hpp/all/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, CMake, tools +import os + +class FireHppConan(ConanFile): + name = "fire-hpp" + homepage = "https://github.com/kongaskristjan/fire-hpp" + url = "https://github.com/conan-io/conan-center-index" + description = "Fire for C++: Create fully functional CLIs using function signatures" + topics = ("command-line", "argument", "parser") + license = "BSL-1.0" + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + _cmake = None + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "{}-{}".format(self.name, self.version) + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["FIRE_EXAMPLES"] = False + self._cmake.definitions["FIRE_UNIT_TESTS"] = False + self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) + return self._cmake + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENCE", dst="licenses", src=self._source_subfolder) + tools.rmdir(os.path.join(self.package_folder, "lib")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/fire-hpp/all/test_package/CMakeLists.txt b/recipes/fire-hpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..520f51ea73d4a --- /dev/null +++ b/recipes/fire-hpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(fire-hpp REQUIRED) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE fire-hpp::fire-hpp) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/fire-hpp/all/test_package/conanfile.py b/recipes/fire-hpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b6680c7d91280 --- /dev/null +++ b/recipes/fire-hpp/all/test_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" + + 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") + bin_args = "-x=1 -y=2" + self.run("{} {}".format(bin_path, bin_args), run_environment=True) diff --git a/recipes/fire-hpp/all/test_package/test_package.cpp b/recipes/fire-hpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..614e5b1984d23 --- /dev/null +++ b/recipes/fire-hpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int fired_main(int x = fire::arg("-x"), int y = fire::arg("-y")) { + std::cout << x + y << std::endl; + return 0; +} + +FIRE(fired_main) diff --git a/recipes/fire-hpp/config.yml b/recipes/fire-hpp/config.yml new file mode 100644 index 0000000000000..7e65100e62b2c --- /dev/null +++ b/recipes/fire-hpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2": + folder: all diff --git a/recipes/flac/all/conandata.yml b/recipes/flac/all/conandata.yml new file mode 100644 index 0000000000000..b0d1e5271b850 --- /dev/null +++ b/recipes/flac/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.4.2": + url: "https://github.com/xiph/flac/releases/download/1.4.2/flac-1.4.2.tar.xz" + sha256: "e322d58a1f48d23d9dd38f432672865f6f79e73a6f9cc5a5f57fcaa83eb5a8e4" + "1.3.3": + url: "https://github.com/xiph/flac/archive/1.3.3.tar.gz" + sha256: "668cdeab898a7dd43cf84739f7e1f3ed6b35ece2ef9968a5c7079fe9adfe1689" +patches: + "1.4.2": + - patch_file: "patches/fix-cmake-1.4.2.patch" + patch_description: "Adapts find_package commands and install destination paths in CMakeLists.txt files." + 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." + patch_type: "conan" diff --git a/recipes/flac/all/conanfile.py b/recipes/flac/all/conanfile.py new file mode 100644 index 0000000000000..e8e39c9a71f0a --- /dev/null +++ b/recipes/flac/all/conanfile.py @@ -0,0 +1,114 @@ +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, export_conandata_patches, copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class FlacConan(ConanFile): + name = "flac" + description = "Free Lossless Audio Codec" + topics = ("flac", "codec", "audio", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xiph/flac" + license = ("BSD-3-Clause", "GPL-2.0-or-later", "LPGL-2.1-or-later", "GFDL-1.2") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("ogg/1.3.5") + + def build_requirements(self): + if Version(self.version) < "1.4.2" and self.settings.arch in ["x86", "x86_64"]: + self.tool_requires("nasm/2.15.05") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_DOCS"] = False + tc.variables["BUILD_TESTING"] = False + tc.generate() + cd = CMakeDeps(self) + cd.generate() + if self.settings.arch in ["x86", "x86_64"]: + envbuild = VirtualBuildEnv(self) + envbuild.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "COPYING.*", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + copy(self, "*.h", src=os.path.join(self.source_folder, "include", "share"), + dst=os.path.join(self.package_folder, "include", "share"), keep_path=False) + copy(self, "*.h", src=os.path.join(self.source_folder, "include", "share", "grabbag"), + dst=os.path.join(self.package_folder, "include", "share", "grabbag"), keep_path=False) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "flac") + + self.cpp_info.components["libflac"].set_property("cmake_target_name", "FLAC::FLAC") + self.cpp_info.components["libflac"].set_property("pkg_config_name", "flac") + self.cpp_info.components["libflac"].libs = ["FLAC"] + self.cpp_info.components["libflac"].requires = ["ogg::ogg"] + + self.cpp_info.components["libflac++"].set_property("cmake_target_name", "FLAC::FLAC++") + self.cpp_info.components["libflac++"].set_property("pkg_config_name", "flac++") + self.cpp_info.components["libflac++"].libs = ["FLAC++"] + self.cpp_info.components["libflac++"].requires = ["libflac"] + if not self.options.shared: + self.cpp_info.components["libflac"].defines = ["FLAC__NO_DLL"] + if self.settings.os in ["Linux", "FreeBSD"]: + 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 + self.cpp_info.filenames["cmake_find_package"] = "flac" + self.cpp_info.filenames["cmake_find_package_multi"] = "flac" + self.cpp_info.names["cmake_find_package"] = "FLAC" + self.cpp_info.names["cmake_find_package_multi"] = "FLAC" + self.cpp_info.components["libflac"].names["cmake_find_package"] = "FLAC" + self.cpp_info.components["libflac"].names["cmake_find_package_multi"] = "FLAC" + self.cpp_info.components["libflac++"].names["cmake_find_package"] = "FLAC++" + self.cpp_info.components["libflac++"].names["cmake_find_package_multi"] = "FLAC++" diff --git a/recipes/flac/all/patches/fix-cmake-1.3.3.patch b/recipes/flac/all/patches/fix-cmake-1.3.3.patch new file mode 100644 index 0000000000000..ec7db2f2d00aa --- /dev/null +++ b/recipes/flac/all/patches/fix-cmake-1.3.3.patch @@ -0,0 +1,66 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,7 +13,7 @@ option(BUILD_EXAMPLES "Build and install examples" ON) + option(WITH_OGG "ogg support (default: test for libogg)" ON) + + if(WITH_OGG) +- find_package(OGG REQUIRED) ++ find_package(Ogg REQUIRED CONFIG) + endif() + + if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") +@@ -25,9 +25,6 @@ endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef") + endif() +-if(CMAKE_C_COMPILER_ID MATCHES "GNU") +- set(CMAKE_EXE_LINKER_FLAGS -no-pie) +-endif() + + include(CMakePackageConfigHelpers) + include(CPack) +@@ -76,7 +73,7 @@ add_compile_options( + $<$,$>:-Wdeclaration-after-statement>) + + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND HAVE_STACKREALIGN_FLAG) +- add_compile_options(-mstackrealign) ++ add_compile_options($<$,$>:-mstackrealign>) + endif() + + include_directories("include") +--- a/src/flac/CMakeLists.txt ++++ b/src/flac/CMakeLists.txt +@@ -21,4 +21,4 @@ if(TARGET win_utf8_io) + endif() + + install(TARGETS flacapp EXPORT targets +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ DESTINATION "${CMAKE_INSTALL_BINDIR}") +--- a/src/libFLAC/CMakeLists.txt ++++ b/src/libFLAC/CMakeLists.txt +@@ -102,7 +102,7 @@ target_compile_definitions(FLAC + target_include_directories(FLAC INTERFACE + "$" + "$") +-target_link_libraries(FLAC PRIVATE $<$:m>) ++target_link_libraries(FLAC PUBLIC $<$:m>) + if(TARGET Ogg::ogg) + target_link_libraries(FLAC PUBLIC Ogg::ogg) + endif() +--- a/src/metaflac/CMakeLists.txt ++++ b/src/metaflac/CMakeLists.txt +@@ -15,4 +15,4 @@ if(TARGET win_utf8_io) + endif() + + install(TARGETS metaflac EXPORT targets +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ DESTINATION "${CMAKE_INSTALL_BINDIR}") +--- a/src/share/getopt/CMakeLists.txt ++++ b/src/share/getopt/CMakeLists.txt +@@ -1,6 +1,5 @@ + check_include_file("string.h" HAVE_STRING_H) + +-find_package(Intl) + + add_library(getopt STATIC getopt.c getopt1.c) + diff --git a/recipes/flac/all/patches/fix-cmake-1.4.2.patch b/recipes/flac/all/patches/fix-cmake-1.4.2.patch new file mode 100644 index 0000000000000..bd5a0ebdb6997 --- /dev/null +++ b/recipes/flac/all/patches/fix-cmake-1.4.2.patch @@ -0,0 +1,38 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,7 @@ if(WITH_OGG) + endif() + else() + if(NOT TARGET Ogg::ogg) +- find_package(Ogg REQUIRED) ++ find_package(Ogg REQUIRED CONFIG) + else() + set(OGG_FOUND 1 CACHE INTERNAL "ogg has already been built") + endif() +--- a/src/flac/CMakeLists.txt ++++ b/src/flac/CMakeLists.txt +@@ -21,4 +21,4 @@ target_link_libraries(flacapp + utf8) + + install(TARGETS flacapp EXPORT targets +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ DESTINATION "${CMAKE_INSTALL_BINDIR}") +--- a/src/metaflac/CMakeLists.txt ++++ b/src/metaflac/CMakeLists.txt +@@ -14,4 +14,4 @@ add_executable(metaflac + target_link_libraries(metaflac FLAC getopt utf8) + + install(TARGETS metaflac EXPORT targets +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ DESTINATION "${CMAKE_INSTALL_BINDIR}") +--- a/src/share/getopt/CMakeLists.txt ++++ b/src/share/getopt/CMakeLists.txt +@@ -1,8 +1,7 @@ + check_include_file("string.h" HAVE_STRING_H) + + if(NOT WIN32) +- find_package(Intl) + endif() + + add_library(getopt STATIC getopt.c getopt1.c) + diff --git a/recipes/flac/all/test_package/CMakeLists.txt b/recipes/flac/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3b8634d9cb495 --- /dev/null +++ b/recipes/flac/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(flac REQUIRED FLAC++ CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE FLAC::FLAC++) diff --git a/recipes/flac/all/test_package/conanfile.py b/recipes/flac/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/flac/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/flac/all/test_package/test_package.cpp b/recipes/flac/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7cf6cde31675b --- /dev/null +++ b/recipes/flac/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include + +#include "FLAC++/encoder.h" + +class OurEncoder: public FLAC::Encoder::File { +public: + OurEncoder(): FLAC::Encoder::File() {} +protected: + virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate) + {} +}; + +int main() +{ + OurEncoder encoder; + if(!encoder) { + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/flac/all/test_v1_package/CMakeLists.txt b/recipes/flac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3da5fc64af2ab --- /dev/null +++ b/recipes/flac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(flac REQUIRED FLAC++ CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE FLAC::FLAC++) diff --git a/recipes/flac/all/test_v1_package/conanfile.py b/recipes/flac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/flac/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/flac/config.yml b/recipes/flac/config.yml new file mode 100644 index 0000000000000..fac8ae5f33f51 --- /dev/null +++ b/recipes/flac/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.2": + folder: all + "1.3.3": + folder: all diff --git a/recipes/flann/all/conandata.yml b/recipes/flann/all/conandata.yml new file mode 100644 index 0000000000000..7fc1c0b27777d --- /dev/null +++ b/recipes/flann/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "1.9.2": + url: "https://github.com/flann-lib/flann/archive/refs/tags/1.9.2.tar.gz" + sha256: "e26829bb0017f317d9cc45ab83ddcb8b16d75ada1ae07157006c1e7d601c8824" + "1.9.1": + url: "https://github.com/flann-lib/flann/archive/refs/tags/1.9.1.tar.gz" + sha256: "b23b5f4e71139faa3bcb39e6bbcc76967fbaf308c4ee9d4f5bfbeceaa76cc5d3" +patches: + "1.9.2": + - patch_file: "patches/1.9.2-0001-cxx-11-required.patch" + - patch_file: "patches/1.9.2-0002-cmake-lz4.patch" + "1.9.1": + - patch_file: "patches/1.9.1-0001-external-lz4-and-export-symbols.patch" + - patch_file: "patches/1.9.1-0002-support-cpp17.patch" + patch_description: "Support C++17" + patch_type: "portability" + patch_source: "https://github.com/flann-lib/flann/pull/392" diff --git a/recipes/flann/all/conanfile.py b/recipes/flann/all/conanfile.py new file mode 100644 index 0000000000000..6a9cd05129f49 --- /dev/null +++ b/recipes/flann/all/conanfile.py @@ -0,0 +1,151 @@ +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.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class FlannConan(ConanFile): + name = "flann" + description = "Fast Library for Approximate Nearest Neighbors" + topics = ("nns", "nearest-neighbor-search", "knn", "kd-tree") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.cs.ubc.ca/research/flann/" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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): + # see https://github.com/conan-io/conan-center-index/pull/16355#discussion_r1150197550 + self.requires("lz4/1.9.4", transitive_headers=True, transitive_libs=True) + + def validate(self): + if Version(self.version) >= "1.9.2" and 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_C_BINDINGS"] = True + # Only build the C++ libraries + tc.variables["BUILD_DOC"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_MATLAB_BINDINGS"] = False + tc.variables["BUILD_PYTHON_BINDINGS"] = False + # OpenMP support can be added later if needed + tc.variables["USE_OPENMP"] = False + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # remove embedded lz4 + rmdir(self, os.path.join(self.source_folder, "src", "cpp", "flann", "ext")) + + if Version(self.version) < "1.9.2": + # Workaround issue with empty sources for a CMake target + flann_cpp_dir = os.path.join(self.source_folder, "src", "cpp") + save(self, os.path.join(flann_cpp_dir, "empty.cpp"), "\n") + + replace_in_file(self, + os.path.join(flann_cpp_dir, "CMakeLists.txt"), + 'add_library(flann_cpp SHARED "")', + 'add_library(flann_cpp SHARED empty.cpp)' + ) + replace_in_file(self, + os.path.join(flann_cpp_dir, "CMakeLists.txt"), + 'add_library(flann SHARED "")', + 'add_library(flann SHARED empty.cpp)' + ) + + def build(self): + self._patch_sources() + 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + # Remove vc runtimes + if self.settings.os == "Windows": + if self.options.shared: + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, dll_pattern_to_remove, os.path.join(self.package_folder, "bin")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + # Remove static/dynamic libraries depending on the build mode + libs_pattern_to_remove = ["*flann_cpp_s.*", "*flann_s.*"] if self.options.shared else ["*flann_cpp.*", "*flann.*"] + for lib_pattern_to_remove in libs_pattern_to_remove: + rm(self, lib_pattern_to_remove, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "Flann") + self.cpp_info.set_property("cmake_file_name", "flann") + self.cpp_info.set_property("pkg_config_name", "flann") + + # flann_cpp + flann_cpp_lib = "flann_cpp" if self.options.shared else "flann_cpp_s" + self.cpp_info.components["flann_cpp"].set_property("cmake_target_name", f"flann::{flann_cpp_lib}") + self.cpp_info.components["flann_cpp"].libs = [flann_cpp_lib] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["flann_cpp"].system_libs.append(libcxx) + self.cpp_info.components["flann_cpp"].requires = ["lz4::lz4"] + + # flann + flann_c_lib = "flann" if self.options.shared else "flann_s" + self.cpp_info.components["flann_c"].set_property("cmake_target_name", f"flann::{flann_c_lib}") + self.cpp_info.components["flann_c"].libs = [flann_c_lib] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["flann_c"].system_libs.append("m") + if not self.options.shared: + self.cpp_info.components["flann_c"].defines.append("FLANN_STATIC") + self.cpp_info.components["flann_c"].requires = ["flann_cpp"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Flann" + self.cpp_info.names["cmake_find_package_multi"] = "flann" + self.cpp_info.components["flann_cpp"].names["cmake_find_package"] = flann_cpp_lib + self.cpp_info.components["flann_cpp"].names["cmake_find_package_multi"] = flann_cpp_lib + self.cpp_info.components["flann_c"].names["cmake_find_package"] = flann_c_lib + self.cpp_info.components["flann_c"].names["cmake_find_package_multi"] = flann_c_lib diff --git a/recipes/flann/all/patches/1.9.1-0001-external-lz4-and-export-symbols.patch b/recipes/flann/all/patches/1.9.1-0001-external-lz4-and-export-symbols.patch new file mode 100644 index 0000000000000..444a0294c08a5 --- /dev/null +++ b/recipes/flann/all/patches/1.9.1-0001-external-lz4-and-export-symbols.patch @@ -0,0 +1,69 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,6 +66,7 @@ if (NOT BUILD_C_BINDINGS) + set(BUILD_MATLAB_BINDINGS OFF) + endif() + ++find_package(lz4 REQUIRED) + + # find python + find_package(PythonInterp) +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -4,11 +4,12 @@ add_definitions(-D_FLANN_VERSION=${FLANN_VERSION}) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h) + +-file(GLOB_RECURSE C_SOURCES flann.cpp lz4.c lz4hc.c) +-file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp lz4.c lz4hc.c) ++file(GLOB_RECURSE C_SOURCES flann.cpp) ++file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp) + file(GLOB_RECURSE CU_SOURCES *.cu) + + add_library(flann_cpp_s STATIC ${CPP_SOURCES}) ++target_link_libraries(flann_cpp_s PUBLIC lz4::lz4) + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC) + endif() +@@ -42,10 +43,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC) + endif() + else() + add_library(flann_cpp SHARED ${CPP_SOURCES}) ++ target_link_libraries(flann_cpp PUBLIC lz4::lz4) + if (BUILD_CUDA_LIB) + cuda_add_library(flann_cuda SHARED ${CPP_SOURCES}) + set_property(TARGET flann_cpp PROPERTY COMPILE_DEFINITIONS FLANN_USE_CUDA) + endif() ++ set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif() + + set_target_properties(flann_cpp PROPERTIES +@@ -77,6 +80,7 @@ endif() + + if (BUILD_C_BINDINGS) + add_library(flann_s STATIC ${C_SOURCES}) ++ target_link_libraries(flann_s PUBLIC lz4::lz4) + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + set_target_properties(flann_s PROPERTIES COMPILE_FLAGS -fPIC) + endif() +@@ -88,6 +92,7 @@ if (BUILD_C_BINDINGS) + target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive) + else() + add_library(flann SHARED ${C_SOURCES}) ++ target_link_libraries(flann PUBLIC lz4::lz4) + + if(MINGW AND OPENMP_FOUND) + target_link_libraries(flann gomp) +--- a/src/cpp/flann/util/serialization.h ++++ b/src/cpp/flann/util/serialization.h +@@ -6,8 +6,8 @@ + #include + #include + #include +-#include "flann/ext/lz4.h" +-#include "flann/ext/lz4hc.h" ++#include ++#include + + + namespace flann diff --git a/recipes/flann/all/patches/1.9.1-0002-support-cpp17.patch b/recipes/flann/all/patches/1.9.1-0002-support-cpp17.patch new file mode 100644 index 0000000000000..fedae0a138f45 --- /dev/null +++ b/recipes/flann/all/patches/1.9.1-0002-support-cpp17.patch @@ -0,0 +1,103 @@ +--- a/src/cpp/flann/algorithms/kdtree_index.h ++++ b/src/cpp/flann/algorithms/kdtree_index.h +@@ -37,6 +37,9 @@ + #include + #include + #include ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) ++#include ++#endif + + #include "flann/general.h" + #include "flann/algorithms/nn_index.h" +@@ -265,8 +268,14 @@ protected: + /* Construct the randomized trees. */ + for (int i = 0; i < trees_; i++) { + /* Randomize the order of vectors to allow for unbiased sampling. */ ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) ++ std::random_device rd; ++ std::mt19937 g(rd()); ++ std::shuffle(ind.begin(), ind.end(), g); ++#else + std::random_shuffle(ind.begin(), ind.end()); + tree_roots_[i] = divideTree(&ind[0], int(size_) ); ++#endif + } + delete[] mean_; + delete[] var_; +--- a/src/cpp/flann/util/heap.h ++++ b/src/cpp/flann/util/heap.h +@@ -105,8 +105,11 @@ public: + count = 0; + } + +- struct CompareT : public std::binary_function ++ struct CompareT + { ++ typedef T first_argument_type; ++ typedef T second_argument_type; ++ typedef bool result_type; + bool operator()(const T& t_1, const T& t_2) const + { + return t_2 < t_1; +--- a/src/cpp/flann/util/lsh_table.h ++++ b/src/cpp/flann/util/lsh_table.h +@@ -39,6 +39,9 @@ + #include + #include + #include ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) ++#include ++#endif + // TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP + #if USE_UNORDERED_MAP + #include +@@ -364,7 +367,13 @@ inline LshTable::LshTable(unsigned int feature_size, unsigned int + // A bit brutal but fast to code + std::vector indices(feature_size * CHAR_BIT); + for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) indices[i] = i; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) ++ std::random_device rd; ++ std::mt19937 g(rd()); ++ std::shuffle(indices.begin(), indices.end(),g); ++#else + std::random_shuffle(indices.begin(), indices.end()); ++#endif + + // Generate a random set of order of subsignature_size_ bits + for (unsigned int i = 0; i < key_size_; ++i) { +--- a/src/cpp/flann/util/random.h ++++ b/src/cpp/flann/util/random.h +@@ -34,6 +34,9 @@ + #include + #include + #include ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) ++#include ++#endif + #include + + #include "flann/general.h" +@@ -110,14 +113,22 @@ public: + */ + void init(int n) + { ++#if !((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + static RandomGenerator generator; ++#endif + // create and initialize an array of size n + vals_.resize(n); + size_ = n; + for (int i = 0; i < size_; ++i) vals_[i] = i; + + // shuffle the elements in the array ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) ++ std::random_device rd; ++ std::mt19937 g(rd()); ++ std::shuffle(vals_.begin(), vals_.end(), g); ++#else + std::random_shuffle(vals_.begin(), vals_.end(), generator); ++#endif + + counter_ = 0; + } diff --git a/recipes/flann/all/patches/1.9.2-0001-cxx-11-required.patch b/recipes/flann/all/patches/1.9.2-0001-cxx-11-required.patch new file mode 100644 index 0000000000000..9015d84efa567 --- /dev/null +++ b/recipes/flann/all/patches/1.9.2-0001-cxx-11-required.patch @@ -0,0 +1,28 @@ +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt +index d8bff04..daec3d6 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -9,6 +9,7 @@ file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp) + file(GLOB_RECURSE CU_SOURCES *.cu) + + add_library(flann_cpp_s STATIC ${CPP_SOURCES}) ++target_compile_features(flann_cpp_s PUBLIC cxx_std_11) + target_link_libraries(flann_cpp_s ${LZ4_LINK_LIBRARIES}) + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC) +@@ -31,6 +32,7 @@ endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC) + add_library(flann_cpp SHARED dummy.c) ++ target_compile_features(flann_cpp PUBLIC cxx_std_11) + set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive) + +@@ -80,6 +82,7 @@ endif() + + if (BUILD_C_BINDINGS) + add_library(flann_s STATIC ${C_SOURCES}) ++ target_compile_features(flann_s PRIVATE cxx_std_11) + target_link_libraries(flann_s ${LZ4_LINK_LIBRARIES}) + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + set_target_properties(flann_s PROPERTIES COMPILE_FLAGS -fPIC) diff --git a/recipes/flann/all/patches/1.9.2-0002-cmake-lz4.patch b/recipes/flann/all/patches/1.9.2-0002-cmake-lz4.patch new file mode 100644 index 0000000000000..41ee873f7e054 --- /dev/null +++ b/recipes/flann/all/patches/1.9.2-0002-cmake-lz4.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e1a6f54..2dfa2b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -146,9 +146,7 @@ if (BUILD_CUDA_LIB) + endif(CUDA_FOUND) + endif(BUILD_CUDA_LIB) + +-find_package(PkgConfig REQUIRED) +-pkg_check_modules(LZ4 REQUIRED liblz4) +-include_directories(${LZ4_INCLUDE_DIRS}) ++find_package(lz4 REQUIRED) + + #set the C/C++ include path to the "include" directory + include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src/cpp) +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt +index daec3d6..b613f20 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -10,7 +10,7 @@ file(GLOB_RECURSE CU_SOURCES *.cu) + + add_library(flann_cpp_s STATIC ${CPP_SOURCES}) + target_compile_features(flann_cpp_s PUBLIC cxx_std_11) +-target_link_libraries(flann_cpp_s ${LZ4_LINK_LIBRARIES}) ++target_link_libraries(flann_cpp_s PRIVATE lz4::lz4) + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC) + endif() +@@ -44,7 +44,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC) + endif() + else() + add_library(flann_cpp SHARED ${CPP_SOURCES}) +- target_link_libraries(flann_cpp ${LZ4_LINK_LIBRARIES}) ++ target_link_libraries(flann_cpp PRIVATE lz4::lz4) + # export lz4 headers, so that MSVC to creates flann_cpp.lib + set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES) + if (BUILD_CUDA_LIB) +@@ -83,7 +83,7 @@ endif() + if (BUILD_C_BINDINGS) + add_library(flann_s STATIC ${C_SOURCES}) + target_compile_features(flann_s PRIVATE cxx_std_11) +- target_link_libraries(flann_s ${LZ4_LINK_LIBRARIES}) ++ target_link_libraries(flann_s PRIVATE lz4::lz4) + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + set_target_properties(flann_s PROPERTIES COMPILE_FLAGS -fPIC) + endif() +@@ -95,7 +95,7 @@ if (BUILD_C_BINDINGS) + target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive) + else() + add_library(flann SHARED ${C_SOURCES}) +- target_link_libraries(flann ${LZ4_LINK_LIBRARIES}) ++ target_link_libraries(flann PRIVATE lz4::lz4) + + if(MINGW AND OPENMP_FOUND) + target_link_libraries(flann gomp) diff --git a/recipes/flann/all/test_package/CMakeLists.txt b/recipes/flann/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..78713ac43c143 --- /dev/null +++ b/recipes/flann/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(flann REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET flann::flann_s) + target_link_libraries(${PROJECT_NAME} PRIVATE flann::flann_s) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE flann::flann) +endif() diff --git a/recipes/flann/all/test_package/conanfile.py b/recipes/flann/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/flann/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/flann/all/test_package/test_package.c b/recipes/flann/all/test_package/test_package.c new file mode 100644 index 0000000000000..ce236a60605ef --- /dev/null +++ b/recipes/flann/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() +{ + // Simply make sure that it builds an runs + printf("%i\n", flann_get_distance_type()); + return 0; +} diff --git a/recipes/flann/all/test_v1_package/CMakeLists.txt b/recipes/flann/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/flann/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/flann/all/test_v1_package/conanfile.py b/recipes/flann/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/flann/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/flann/config.yml b/recipes/flann/config.yml new file mode 100644 index 0000000000000..524442a72b4f3 --- /dev/null +++ b/recipes/flann/config.yml @@ -0,0 +1,5 @@ +versions: + "1.9.2": + folder: all + "1.9.1": + folder: all diff --git a/recipes/flatbuffers/all/cmake/FlatcTargets.cmake b/recipes/flatbuffers/all/cmake/FlatcTargets.cmake new file mode 100644 index 0000000000000..cddc331b7f319 --- /dev/null +++ b/recipes/flatbuffers/all/cmake/FlatcTargets.cmake @@ -0,0 +1,31 @@ +if(NOT TARGET flatbuffers::flatc) + if(CMAKE_CROSSCOMPILING) + find_program(FLATBUFFERS_FLATC_EXECUTABLE + NAMES flatc + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(FLATBUFFERS_FLATC_EXECUTABLE + NAMES flatc + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH + ) + endif() + # TODO: In conan v2 with CMakeToolchain, can be replaced by: + # find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) + # # Nice enough to handle flatbuffers not in build_requires for native build + # if(NOT FLATBUFFERS_FLATC_EXECUTABLE AND NOT CMAKE_CROSSCOMPILING) + # find_program(FLATBUFFERS_FLATC_EXECUTABLE + # NAMES flatc + # PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + # NO_DEFAULT_PATH + # ) + # endif() + + if(FLATBUFFERS_FLATC_EXECUTABLE) + get_filename_component(FLATBUFFERS_FLATC_EXECUTABLE "${FLATBUFFERS_FLATC_EXECUTABLE}" ABSOLUTE) + add_executable(flatbuffers::flatc IMPORTED) + set_property(TARGET flatbuffers::flatc PROPERTY IMPORTED_LOCATION ${FLATBUFFERS_FLATC_EXECUTABLE}) + endif() +endif() diff --git a/recipes/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml new file mode 100644 index 0000000000000..8ec1c3ec389ea --- /dev/null +++ b/recipes/flatbuffers/all/conandata.yml @@ -0,0 +1,49 @@ +sources: + "23.3.3": + url: "https://github.com/google/flatbuffers/archive/v23.3.3.tar.gz" + sha256: "8aff985da30aaab37edf8e5b02fda33ed4cbdd962699a8e2af98fdef306f4e4d" + "23.1.21": + url: "https://github.com/google/flatbuffers/archive/v23.1.21.tar.gz" + sha256: "d84cb25686514348e615163b458ae0767001b24b42325f426fd56406fd384238" + "23.1.4": + url: "https://github.com/google/flatbuffers/archive/v23.1.4.tar.gz" + sha256: "801871ff3747838c0dd9730fc44ca9cc453ff42f9c8a0a2f1b33776d2ca5e4b9" + "22.12.06": + url: "https://github.com/google/flatbuffers/archive/v22.12.06.tar.gz" + sha256: "209823306f2cbedab6ff70997e0d236fcfd1864ca9ad082cbfdb196e7386daed" + "22.11.23": + url: "https://github.com/google/flatbuffers/archive/v22.11.23.tar.gz" + sha256: "8e9bacc942db59ca89a383dd7923f3e69a377d6e579d1ba13557de1fdfddf56a" + "22.10.26": + url: "https://github.com/google/flatbuffers/archive/v22.10.26.tar.gz" + sha256: "34f1820cfd78a3d92abc880fbb1a644c7fb31a71238995f4ed6b5915a1ad4e79" + "22.9.29": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v22.9.29.tar.gz" + sha256: "372df01795c670f6538055a7932fc7eb3e81b3653be4a216c081e9c3c26b1b6d" + "22.9.24": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v22.9.24.tar.gz" + sha256: "40e0788873012def4d66a2fdbac15fbe012784473c01a703ccb5be33383556bf" + "2.0.8": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.8.tar.gz" + sha256: "f97965a727d26386afaefff950badef2db3ab6af9afe23ed6d94bfb65f95f37e" + "2.0.6": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.6.tar.gz" + sha256: "e2dc24985a85b278dd06313481a9ca051d048f9474e0f199e372fea3ea4248c9" + "2.0.5": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.5.tar.gz" + sha256: "b01e97c988c429e164c5c7df9e87c80007ca87f593c0d73733ba536ddcbc8f98" + "1.12.0": + url: "https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz" + sha256: "62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45" +patches: + "2.0.6": + - patch_file: "patches/0004-no-flatc-execution-build-time.patch" + patch_description: "No flatc execution during build time" + patch_type: "conan" + "2.0.5": + - patch_file: "patches/0002-apple-no-universal-build.patch" + patch_description: "Don't use universal2 architecture" + patch_type: "bugfix" + - patch_file: "patches/0003-no-flatc-execution-build-time.patch" + patch_description: "No flatc execution during build time" + patch_type: "conan" diff --git a/recipes/flatbuffers/all/conanfile.py b/recipes/flatbuffers/all/conanfile.py new file mode 100644 index 0000000000000..06610b4d9bfd6 --- /dev/null +++ b/recipes/flatbuffers/all/conanfile.py @@ -0,0 +1,172 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, collect_libs, copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class FlatbuffersConan(ConanFile): + name = "flatbuffers" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://google.github.io/flatbuffers" + topics = ("serialization", "rpc", "json-parser") + description = "Memory Efficient Serialization Library" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + } + + def _has_flatc(self, info=False): + # don't build flatc when it makes little sense or not supported + host_os = self.info.settings.os if info else self.settings.os + return host_os not in ["Android", "iOS", "watchOS", "tvOS", "Neutrino"] + + def export_sources(self): + copy(self, os.path.join("cmake", "FlatcTargets.cmake"), self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only and not self._has_flatc(info=True): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def build_requirements(self): + # since 23.3.3 version, flatbuffers cmake scripts were refactored to use cmake 3.8 version + # see https://github.com/google/flatbuffers/pull/7801 + if Version(self.version) >= "2.0.7" and Version(self.version) < "23.3.3": + 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["FLATBUFFERS_BUILD_TESTS"] = False + tc.variables["FLATBUFFERS_INSTALL"] = True + tc.variables["FLATBUFFERS_BUILD_FLATLIB"] = not self.options.header_only and not self.options.shared + tc.variables["FLATBUFFERS_BUILD_FLATC"] = self._has_flatc() + tc.variables["FLATBUFFERS_STATIC_FLATC"] = False + tc.variables["FLATBUFFERS_BUILD_FLATHASH"] = False + tc.variables["FLATBUFFERS_BUILD_SHAREDLIB"] = not self.options.header_only and self.options.shared + # Honor conan profile + tc.variables["FLATBUFFERS_LIBCXX_WITH_CLANG"] = False + # Mimic upstream CMake/Version.cmake removed in _patch_sources() + version = Version(self.version) + tc.cache_variables["VERSION_MAJOR"] = str(version.major) + tc.cache_variables["VERSION_MINOR"] = str(version.minor or "0") + tc.cache_variables["VERSION_PATCH"] = str(version.patch or "0") + tc.cache_variables["VERSION_COMMIT"] = str(version.pre or "0") + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Fix iOS/tvOS/watchOS + if is_apple_os(self): + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # Inject at least C++11 standard (would be more elegant to rely on cxx_std_11 compile feature upstream) + if not valid_min_cppstd(self, 11): + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Prefer manual injection of current version in build(), otherwise it tries to call git + replace_in_file(self, cmakelists, "include(CMake/Version.cmake)", "") + # No warnings as errors + replace_in_file(self, cmakelists, "/WX", "") + replace_in_file(self, cmakelists, "-Werror ", "") + # Install dll to bin folder + replace_in_file(self, cmakelists, + "RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}", + "RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "FlatcTargets.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + copy(self, "BuildFlatBuffers.cmake", + src=os.path.join(self.source_folder, "CMake"), + dst=os.path.join(self.package_folder, self._module_path)) + + @property + def _module_path(self): + return os.path.join("lib", "cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "flatbuffers") + self.cpp_info.set_property("cmake_file_name", "flatbuffers") + cmake_target = "flatbuffers" + if not self.options.header_only and self.options.shared: + cmake_target += "_shared" + self.cpp_info.set_property("cmake_target_name", f"flatbuffers::{cmake_target}") + self.cpp_info.set_property("pkg_config_name", "flatbuffers") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if not self.options.header_only: + self.cpp_info.components["libflatbuffers"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libflatbuffers"].system_libs.append("m") + + # Provide flatbuffers::flatc target and CMake functions from BuildFlatBuffers.cmake + build_modules = [ + os.path.join(self._module_path, "FlatcTargets.cmake"), + os.path.join(self._module_path, "BuildFlatBuffers.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "flatbuffers" + self.cpp_info.filenames["cmake_find_package_multi"] = "flatbuffers" + self.cpp_info.names["cmake_find_package"] = "flatbuffers" + self.cpp_info.names["cmake_find_package_multi"] = "flatbuffers" + self.cpp_info.components["libflatbuffers"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["libflatbuffers"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["libflatbuffers"].build_modules["cmake_find_package"] = build_modules + self.cpp_info.components["libflatbuffers"].build_modules["cmake_find_package_multi"] = build_modules + self.cpp_info.components["libflatbuffers"].set_property("cmake_file_name", f"flatbuffers::{cmake_target}") + self.cpp_info.components["libflatbuffers"].set_property("pkg_config_name", "flatbuffers") + if self._has_flatc(): + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/flatbuffers/all/patches/0002-apple-no-universal-build.patch b/recipes/flatbuffers/all/patches/0002-apple-no-universal-build.patch new file mode 100644 index 0000000000000..43e3e8f6ab5a3 --- /dev/null +++ b/recipes/flatbuffers/all/patches/0002-apple-no-universal-build.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -282,7 +282,6 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) + + elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + if(APPLE) +- set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") diff --git a/recipes/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch b/recipes/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch new file mode 100644 index 0000000000000..8716b3ba7ccf4 --- /dev/null +++ b/recipes/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -514,6 +514,7 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT) + register_generated_output(${GEN_BFBS_HEADER}) + endfunction() + ++if(0) + # Look if we have python 3 installed so that we can run the generate code python + # script after flatc is built. + find_package(PythonInterp 3) +@@ -544,6 +545,7 @@ if(PYTHONINTERP_FOUND AND + else() + message("No Python3 interpreter found! Unable to generate files automatically.") + endif() ++endif() + + if(FLATBUFFERS_BUILD_TESTS) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch b/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch new file mode 100644 index 0000000000000..11da02ea5d8c9 --- /dev/null +++ b/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 21e90151..2ce3eb48 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -536,6 +536,7 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT) + register_generated_output(${GEN_BFBS_HEADER}) + endfunction() + ++if(0) + # Look if we have python 3.5 installed so that we can run the generate code + # python script after flatc is built. + find_package(Python3 3.5 COMPONENTS Interpreter) +@@ -559,6 +560,7 @@ if(Python3_Interpreter_FOUND) + else() + message("No Python3 interpreter found! Unable to generate files automatically.") + endif() ++endif() + + if(FLATBUFFERS_BUILD_TESTS) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/recipes/flatbuffers/all/test_package/CMakeLists.txt b/recipes/flatbuffers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..59f9fe8ba9801 --- /dev/null +++ b/recipes/flatbuffers/all/test_package/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(FlatBuffers REQUIRED CONFIG) +if(TARGET flatbuffers::flatbuffers_shared) + set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) +else() + set(FLATBUFFERS_TARGET flatbuffers::flatbuffers) +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLATBUFFERS_TARGET}) +if(FLATBUFFERS_HEADER_ONLY) + target_compile_definitions(${PROJECT_NAME} PRIVATE FLATBUFFERS_HEADER_ONLY) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +# Testing this block in case of cross-build would require to add flatbuffers to build requirements of test package +# But due to c3i limitations, package id of build requirement if header_only is not available while building in c3i +if(NOT CMAKE_CROSSCOMPILING) + add_executable(sample_binary sample_binary.cpp) + target_link_libraries(sample_binary PRIVATE ${FLATBUFFERS_TARGET}) + target_compile_features(sample_binary PRIVATE cxx_std_11) + + set(MONSTER_GENERATED_HEADER ${CMAKE_CURRENT_BINARY_DIR}/monster_generated.h) + set(MONSTER_FBS ${CMAKE_CURRENT_SOURCE_DIR}/monster.fbs) + add_custom_command( + OUTPUT ${MONSTER_GENERATED_HEADER} + COMMAND $ + --cpp + -o ${CMAKE_CURRENT_BINARY_DIR} + ${MONSTER_FBS} + DEPENDS ${MONSTER_FBS} + ) + add_custom_target(generate_monster_header DEPENDS ${MONSTER_GENERATED_HEADER}) + add_dependencies(sample_binary generate_monster_header) + target_include_directories(sample_binary PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +endif() diff --git a/recipes/flatbuffers/all/test_package/conanfile.py b/recipes/flatbuffers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c045cfa4864e3 --- /dev/null +++ b/recipes/flatbuffers/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def generate(self): + env = VirtualRunEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) + tc.variables["FLATBUFFERS_HEADER_ONLY"] = self.dependencies["flatbuffers"].options.header_only + 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") + sample_binary = os.path.join(self.cpp.build.bindirs[0], "sample_binary") + self.run(sample_binary, env="conanrun") diff --git a/recipes/flatbuffers/all/test_package/monster.fbs b/recipes/flatbuffers/all/test_package/monster.fbs new file mode 100644 index 0000000000000..af224512ee724 --- /dev/null +++ b/recipes/flatbuffers/all/test_package/monster.fbs @@ -0,0 +1,33 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; + color:Color = Blue; + weapons:[Weapon]; + equipped:Equipment; + path:[Vec3]; +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; diff --git a/recipes/flatbuffers/all/test_package/sample_binary.cpp b/recipes/flatbuffers/all/test_package/sample_binary.cpp new file mode 100644 index 0000000000000..b8f4f1f6c37fd --- /dev/null +++ b/recipes/flatbuffers/all/test_package/sample_binary.cpp @@ -0,0 +1,104 @@ +/* + * Copyright 2015 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h". + +using namespace MyGame::Sample; + +// Example how to use FlatBuffers to create and read binary buffers. + +int main(int /*argc*/, const char * /*argv*/[]) { + // Build up a serialized buffer algorithmically: + flatbuffers::FlatBufferBuilder builder; + + // First, lets serialize some weapons for the Monster: A 'sword' and an 'axe'. + auto weapon_one_name = builder.CreateString("Sword"); + short weapon_one_damage = 3; + + auto weapon_two_name = builder.CreateString("Axe"); + short weapon_two_damage = 5; + + // Use the `CreateWeapon` shortcut to create Weapons with all fields set. + auto sword = CreateWeapon(builder, weapon_one_name, weapon_one_damage); + auto axe = CreateWeapon(builder, weapon_two_name, weapon_two_damage); + + // Create a FlatBuffer's `vector` from the `std::vector`. + std::vector> weapons_vector; + weapons_vector.push_back(sword); + weapons_vector.push_back(axe); + auto weapons = builder.CreateVector(weapons_vector); + + // Second, serialize the rest of the objects needed by the Monster. + auto position = Vec3(1.0f, 2.0f, 3.0f); + + auto name = builder.CreateString("MyMonster"); + + unsigned char inv_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + auto inventory = builder.CreateVector(inv_data, 10); + + // Shortcut for creating monster with all fields set: + auto orc = CreateMonster(builder, &position, 150, 80, name, inventory, + Color_Red, weapons, Equipment_Weapon, axe.Union()); + + builder.Finish(orc); // Serialize the root of the object. + + // We now have a FlatBuffer we can store on disk or send over a network. + + // ** file/network code goes here :) ** + // access builder.GetBufferPointer() for builder.GetSize() bytes + + // Instead, we're going to access it right away (as if we just received it). + + // Get access to the root: + auto monster = GetMonster(builder.GetBufferPointer()); + + // Get and test some scalar types from the FlatBuffer. + assert(monster->hp() == 80); + assert(monster->mana() == 150); // default + assert(monster->name()->str() == "MyMonster"); + + // Get and test a field of the FlatBuffer's `struct`. + auto pos = monster->pos(); + assert(pos); + assert(pos->z() == 3.0f); + (void)pos; + + // Get a test an element from the `inventory` FlatBuffer's `vector`. + auto inv = monster->inventory(); + assert(inv); + assert(inv->Get(9) == 9); + (void)inv; + + // Get and test the `weapons` FlatBuffers's `vector`. + std::string expected_weapon_names[] = { "Sword", "Axe" }; + short expected_weapon_damages[] = { 3, 5 }; + auto weps = monster->weapons(); + for (unsigned int i = 0; i < weps->size(); i++) { + assert(weps->Get(i)->name()->str() == expected_weapon_names[i]); + assert(weps->Get(i)->damage() == expected_weapon_damages[i]); + } + (void)expected_weapon_names; + (void)expected_weapon_damages; + + // Get and test the `Equipment` union (`equipped` field). + assert(monster->equipped_type() == Equipment_Weapon); + auto equipped = static_cast(monster->equipped()); + assert(equipped->name()->str() == "Axe"); + assert(equipped->damage() == 5); + (void)equipped; + + printf("The FlatBuffer was successfully created and verified!\n"); +} diff --git a/recipes/flatbuffers/all/test_package/test_package.cpp b/recipes/flatbuffers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5846ed266944 --- /dev/null +++ b/recipes/flatbuffers/all/test_package/test_package.cpp @@ -0,0 +1,48 @@ +/* + * Copyright 2018 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "flatbuffers/flatbuffers.h" + +#ifndef FLATBUFFERS_HEADER_ONLY + #include "flatbuffers/util.h" +#endif +// Test to validate Conan package generated + +int main(int /*argc*/, const char * /*argv*/ []) { + + flatbuffers::FlatBufferBuilder builder; + const auto offset = builder.CreateString("test"); + if (!offset.IsNull()) { + std::cout << "Offset is " << builder.CreateString("test").o << ".\n"; + } else { + std::cout << "Offset is null.\n"; + return EXIT_FAILURE; + } + +#ifndef FLATBUFFERS_HEADER_ONLY + const std::string filename("conanbuildinfo.txt"); + if (flatbuffers::FileExists(filename.c_str())) { + std::cout << "File " << filename << " exists.\n"; + } else { + std::cout << "File " << filename << " does not exist.\n"; + } +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt b/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/flatbuffers/all/test_v1_package/conanfile.py b/recipes/flatbuffers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..949b7060f8e9c --- /dev/null +++ b/recipes/flatbuffers/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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.definitions["FLATBUFFERS_HEADER_ONLY"] = self.options["flatbuffers"].header_only + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) + self.run(os.path.join("bin", "sample_binary"), run_environment=True) diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml new file mode 100644 index 0000000000000..a6c4efcf09db7 --- /dev/null +++ b/recipes/flatbuffers/config.yml @@ -0,0 +1,25 @@ +versions: + "23.3.3": + folder: all + "23.1.21": + folder: all + "23.1.4": + folder: all + "22.12.06": + folder: all + "22.11.23": + folder: all + "22.10.26": + folder: all + "22.9.29": + folder: all + "22.9.24": + folder: all + "2.0.8": + folder: all + "2.0.6": + folder: all + "2.0.5": + folder: all + "1.12.0": + folder: all diff --git a/recipes/flatbush/all/conandata.yml b/recipes/flatbush/all/conandata.yml new file mode 100644 index 0000000000000..3d50fc3bd1efd --- /dev/null +++ b/recipes/flatbush/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.1.0.zip" + sha256: "3ef034110b0ea6f7514d3cdc362976e2a9ab321cc9e4b2c847167ad26df0c0f1" diff --git a/recipes/flatbush/all/conanfile.py b/recipes/flatbush/all/conanfile.py new file mode 100644 index 0000000000000..c9dd4bc6e1a67 --- /dev/null +++ b/recipes/flatbush/all/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, tools + +class FlatbushConan(ConanFile): + name = "flatbush" + license = "MIT" + homepage = "https://github.com/chusitoo/flatbush" + description = "Flatbush for C++" + topics = ("header-only", "flatbush", "r-tree", "hilbert", "zero-copy", "spatial-index") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses") + self.copy(pattern="flatbush.h", dst="include") + + def package_id(self): + self.info.header_only() + + def package_info(self): + if not tools.valid_min_cppstd(self, "20"): + self.cpp_info.defines = ["FLATBUSH_SPAN"] diff --git a/recipes/flatbush/all/test_package/CMakeLists.txt b/recipes/flatbush/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ad4f7bcfdd6b --- /dev/null +++ b/recipes/flatbush/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package VERSION 1.0.0 LANGUAGES CXX) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) +find_package(flatbush CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} "test_package.cpp") + +target_link_libraries(${PROJECT_NAME} flatbush::flatbush) + +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/flatbush/all/test_package/conanfile.py b/recipes/flatbush/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5b0ef1df32f11 --- /dev/null +++ b/recipes/flatbush/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/flatbush/all/test_package/test_package.cpp b/recipes/flatbush/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..36860193e4ed8 --- /dev/null +++ b/recipes/flatbush/all/test_package/test_package.cpp @@ -0,0 +1,33 @@ +/* +MIT License + +Copyright (c) 2021 Alex Emirov + +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 "flatbush.h" + +int main(int argc, char** argv) +{ + flatbush::FlatbushBuilder wBuilder; + wBuilder.add({ 0, 0, 0, 0 }); + auto wIndex = wBuilder.finish(); + auto wIds = wIndex.search({ 0, 0, 1, 1 }); +} diff --git a/recipes/flatbush/config.yml b/recipes/flatbush/config.yml new file mode 100644 index 0000000000000..11b7aff3a5ac4 --- /dev/null +++ b/recipes/flatbush/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: "all" diff --git a/recipes/flatc/all/CMakeLists.txt b/recipes/flatc/all/CMakeLists.txt new file mode 100644 index 0000000000000..2765caac4dc2c --- /dev/null +++ b/recipes/flatc/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.4) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if (WIN32 AND MSVC AND FLATBUFFERS_BUILD_SHAREDLIB) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif(WIN32 AND MSVC AND FLATBUFFERS_BUILD_SHAREDLIB) + +add_subdirectory("source_subfolder") diff --git a/recipes/flatc/all/conandata.yml b/recipes/flatc/all/conandata.yml new file mode 100644 index 0000000000000..ed9781e339181 --- /dev/null +++ b/recipes/flatc/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + 1.11.0: + url: "https://github.com/google/flatbuffers/archive/v1.11.0.tar.gz" + sha256: "3f4a286642094f45b1b77228656fbd7ea123964f19502f9ecfd29933fd23a50b" + 1.12.0: + url: "https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz" + sha256: "62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45" +patches: + 1.11.0: + - patch_file: "patches/0001-buildflatbuffers-cmake.patch" + base_path: "source_subfolder" + 1.12.0: + - patch_file: "patches/0001-buildflatbuffers-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/flatc/all/conanfile.py b/recipes/flatc/all/conanfile.py new file mode 100644 index 0000000000000..0968794e0610f --- /dev/null +++ b/recipes/flatc/all/conanfile.py @@ -0,0 +1,64 @@ +"""Conan recipe package for Google FlatBuffers - Flatc +""" +import os +from conans import ConanFile, CMake, tools + + +class FlatcConan(ConanFile): + name = "flatc" + deprecated = "flatbuffers" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://google.github.io/flatbuffers/" + topics = ("conan", "flatbuffers", "serialization", "rpc", "json-parser", "installer") + description = "Memory Efficient Serialization Library" + settings = "os", "arch" + exports_sources = ["CMakeLists.txt","patches/**"] + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "flatbuffers-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["FLATBUFFERS_BUILD_TESTS"] = False + cmake.definitions["FLATBUFFERS_BUILD_SHAREDLIB"] = False + cmake.definitions["FLATBUFFERS_BUILD_FLATLIB"] = True + cmake.definitions["FLATBUFFERS_BUILD_FLATC"] = True + cmake.definitions["FLATBUFFERS_BUILD_FLATHASH"] = True + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + extension = ".exe" if self.settings.os == "Windows" else "" + bin_dir = os.path.join(self._build_subfolder, "bin") + self.copy(pattern="flatc" + extension, dst="bin", src=bin_dir) + self.copy(pattern="flathash" + extension, dst="bin", src=bin_dir) + self.copy(pattern="BuildFlatBuffers.cmake", dst="bin/cmake", src=os.path.join(self._source_subfolder,"CMake")) + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info('Appending PATH environment variable: %s' % bin_path) + self.env_info.PATH.append(bin_path) + self.cpp_info.builddirs.append("bin/cmake") + self.cpp_info.build_modules.append("bin/cmake/BuildFlatBuffers.cmake") diff --git a/recipes/flatc/all/patches/0001-buildflatbuffers-cmake.patch b/recipes/flatc/all/patches/0001-buildflatbuffers-cmake.patch new file mode 100644 index 0000000000000..b54f5042542e0 --- /dev/null +++ b/recipes/flatc/all/patches/0001-buildflatbuffers-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/BuildFlatBuffers.cmake b/CMake/BuildFlatBuffers.cmake +index 835f4b80..edc2fde7 100644 +--- a/CMake/BuildFlatBuffers.cmake ++++ b/CMake/BuildFlatBuffers.cmake +@@ -60,7 +60,7 @@ function(build_flatbuffers flatbuffers_schemas + set(FLATC_TARGET "") + set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE}) + else() +- set(FLATC_TARGET flatc) ++ set(FLATC_TARGET "") + set(FLATC flatc) + endif() + set(FLATC_SCHEMA_ARGS --gen-mutable) diff --git a/recipes/flatc/all/test_package/CMakeLists.txt b/recipes/flatc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..345fa69ffef50 --- /dev/null +++ b/recipes/flatc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +find_package(flatc REQUIRED) + +build_flatbuffers("test_package.fbs" "" flatbuffers "" "${CMAKE_CURRENT_BINARY_DIR}" "" "") + +add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}/test_package_generated.h test_package.cpp) diff --git a/recipes/flatc/all/test_package/conanfile.py b/recipes/flatc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ab7f129616778 --- /dev/null +++ b/recipes/flatc/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch" + generators = "cmake", "cmake_find_package" + + def build_requirements(self): + if tools.cross_building(self.settings): + self.build_requires(str(self.requires["flatc"])) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build(target="flatbuffers") + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("flatc --version", run_environment=True) + self.run("flathash fnv1_16 conan", run_environment=True) diff --git a/recipes/flatc/all/test_package/test_package.cpp b/recipes/flatc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d1381dd5ea96b --- /dev/null +++ b/recipes/flatc/all/test_package/test_package.cpp @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} diff --git a/recipes/flatc/all/test_package/test_package.fbs b/recipes/flatc/all/test_package/test_package.fbs new file mode 100644 index 0000000000000..c6391125ec369 --- /dev/null +++ b/recipes/flatc/all/test_package/test_package.fbs @@ -0,0 +1,8 @@ +// example IDL file + +struct Vec3 { + x:float; + y:float; + z:float; +} + diff --git a/recipes/flatc/config.yml b/recipes/flatc/config.yml new file mode 100644 index 0000000000000..0b18ee803ecfb --- /dev/null +++ b/recipes/flatc/config.yml @@ -0,0 +1,7 @@ +--- +versions: + 1.11.0: + folder: all + 1.12.0: + folder: all + diff --git a/recipes/flatcc/all/CMakeLists.txt b/recipes/flatcc/all/CMakeLists.txt new file mode 100644 index 0000000000000..07ec7f05275cb --- /dev/null +++ b/recipes/flatcc/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/flatcc/all/conandata.yml b/recipes/flatcc/all/conandata.yml new file mode 100644 index 0000000000000..f71d236804bce --- /dev/null +++ b/recipes/flatcc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.6.1": + url: "https://github.com/dvidelabs/flatcc/archive/v0.6.1.tar.gz" + sha256: "2533c2f1061498499f15acc7e0937dcf35bc68e685d237325124ae0d6c600c2b" + "0.6.0": + url: "https://github.com/dvidelabs/flatcc/archive/v0.6.0.tar.gz" + sha256: "a92da3566d11e19bb807a83554b1a2c644a5bd91c9d9b088514456bb56e1c666" diff --git a/recipes/flatcc/all/conanfile.py b/recipes/flatcc/all/conanfile.py new file mode 100644 index 0000000000000..09f5cab415518 --- /dev/null +++ b/recipes/flatcc/all/conanfile.py @@ -0,0 +1,111 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os +import functools + +required_conan_version = ">=1.33.0" + +class FlatccConan(ConanFile): + name = "flatcc" + description = "C language binding for Flatbuffers, an efficient cross platform serialization library" + license = "Apache-2.0" + topics = ("flatbuffers", "serialization") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dvidelabs/flatcc" + settings = "os", "arch", "compiler", "build_type" + options = { "shared": [True, False], + "fPIC": [True, False], + "portable": [True, False], + "gnu_posix_memalign": [True, False], + "runtime_lib_only": [True, False], + "verify_assert": [True, False], + "verify_trace": [True, False], + "reflection": [True, False], + "native_optim": [True, False], + "fast_double": [True, False], + "ignore_const_condition": [True, False], + } + default_options = { "shared": False, + "fPIC": True, + "portable": False, + "gnu_posix_memalign": True, + "runtime_lib_only": False, + "verify_assert": False, + "verify_trace": False, + "reflection": True, + "native_optim": False, + "fast_double": False, + "ignore_const_condition": False + } + generators = "cmake" + 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): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Windows": + if self.settings.compiler == "Visual Studio" and self.options.shared: + #Building flatcc shared libs with Visual Studio is broken + raise ConanInvalidConfiguration("Building flatcc libraries shared is not supported") + if tools.Version(self.version) == "0.6.0" and self.settings.compiler == "gcc": + raise ConanInvalidConfiguration("Building flatcc with MinGW is not supported") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["FLATCC_PORTABLE"] = self.options.portable + cmake.definitions["FLATCC_GNU_POSIX_MEMALIGN"] = self.options.gnu_posix_memalign + cmake.definitions["FLATCC_RTONLY"] = self.options.runtime_lib_only + cmake.definitions["FLATCC_INSTALL"] = True + cmake.definitions["FLATCC_COVERAGE"] = False + cmake.definitions["FLATCC_DEBUG_VERIFY"] = self.options.verify_assert + cmake.definitions["FLATCC_TRACE_VERIFY"] = self.options.verify_trace + cmake.definitions["FLATCC_REFLECTION"] = self.options.reflection + cmake.definitions["FLATCC_NATIVE_OPTIM"] = self.options.native_optim + cmake.definitions["FLATCC_FAST_DOUBLE"] = self.options.fast_double + cmake.definitions["FLATCC_IGNORE_CONST_COND"] = self.options.ignore_const_condition + cmake.definitions["FLATCC_TEST"] = False + cmake.definitions["FLATCC_ALLOW_WERROR"] = False + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + if self.settings.build_type == "Debug" and not tools.os_info.is_windows: + debug_suffix = "_d" if self.settings.build_type == "Debug" else "" + os.rename(os.path.join(self.package_folder, "bin", "flatcc%s" % debug_suffix), + os.path.join(self.package_folder, "bin", "flatcc")) + # Copy license file + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info('Appending PATH environment variable: %s' % bin_path) + self.env_info.PATH.append(bin_path) + debug_suffix = "_d" if self.settings.build_type == "Debug" else "" + if not self.options.runtime_lib_only: + self.cpp_info.libs.append("flatcc%s" % debug_suffix) + self.cpp_info.libs.append("flatccrt%s" % debug_suffix) diff --git a/recipes/flatcc/all/test_package/CMakeLists.txt b/recipes/flatcc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a1e3c2e0ae88 --- /dev/null +++ b/recipes/flatcc/all/test_package/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.1) +project(flatcc_example) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(flatcc REQUIRED CONFIG) + +set(INC_DIR "${PROJECT_SOURCE_DIR}/include") +set(GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(FBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + +include_directories("${GEN_DIR}" "${INC_DIR}") + +add_executable(monster monster.c) + +#On MacOS System Integrity Protection (SIP) will clear the DYLD_LIBRARY_PATH variable. +#As a result calling flatcc from cmake will currently not work if the flatcc executable +# is linked shared. As a workaround we generate the flatbuffer C files in the Conan recipe +# when on MacOS and flatcc option 'shared' is True. +if (NOT MACOS_SIP_WORKAROUND) + add_custom_target(gen_monster_fbs ALL) + add_custom_command ( + TARGET gen_monster_fbs + COMMAND cmake -E make_directory "${GEN_DIR}" + COMMAND flatcc -a -o "${GEN_DIR}" "${FBS_DIR}/monster.fbs" + DEPENDS flatcc "${FBS_DIR}/monster.fbs" + ) + + add_dependencies(monster gen_monster_fbs) +endif() + +target_link_libraries(monster flatcc::flatcc) diff --git a/recipes/flatcc/all/test_package/conanfile.py b/recipes/flatcc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..35aa66924f6ab --- /dev/null +++ b/recipes/flatcc/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +import os.path + +from conans import ConanFile, CMake, tools, RunEnvironment +from conans.errors import ConanException + + +class FlatccTestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + if tools.cross_building(self): + return + + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self) + if tools.os_info.is_macos and self.options["flatcc"].shared: + # Because of MacOS System Integraty Protection it is currently not possible to run the flatcc + # executable from cmake if it is linked shared. As a temporary work-around run flatcc here in + # the build function. + tools.mkdir(os.path.join(self.build_folder, "generated")) + self.run("flatcc -a -o " + os.path.join(self.build_folder, "generated") + " " + os.path.join(self.source_folder, "monster.fbs"), run_environment=True) + cmake.definitions["MACOS_SIP_WORKAROUND"] = True + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self): + bin_path = os.path.join(self.deps_cpp_info["flatcc"].rootpath, "bin", "flatcc") + if not os.path.isfile(bin_path) or not os.access(bin_path, os.X_OK): + raise ConanException("flatcc doesn't exist.") + else: + bin_path = os.path.join(self.build_folder, "bin", "monster") + self.run(bin_path, cwd=self.source_folder, run_environment=True) diff --git a/recipes/flatcc/all/test_package/monster.c b/recipes/flatcc/all/test_package/monster.c new file mode 100644 index 0000000000000..a1d98fe72d401 --- /dev/null +++ b/recipes/flatcc/all/test_package/monster.c @@ -0,0 +1,350 @@ +// Example on how to build a Monster FlatBuffer. + + +// Note: while some older C89 compilers are supported when +// -DFLATCC_PORTABLE is defined, this particular sample is known not to +// not work with MSVC 2010 (MSVC 2013 is OK) due to inline variable +// declarations. These are easily move to the start of code blocks, but +// since we follow the step-wise tutorial, it isn't really practical +// in this case. The comment style is technically also in violation of C89. + + +#include "monster_builder.h" // Generated by `flatcc`. +// and already included. + +// Convenient namespace macro to manage long namespace prefix. +// The ns macro makes it possible to write `ns(Monster_create(...))` +// instead of `MyGame_Sample_Monster_create(...)` +#undef ns +#define ns(x) FLATBUFFERS_WRAP_NAMESPACE(MyGame_Sample, x) // Specified in the schema. + +// A helper to simplify creating vectors from C-arrays. +#define c_vec_len(V) (sizeof(V)/sizeof((V)[0])) + +// This allows us to verify result in optimized builds. +#define test_assert(x) do { if (!(x)) { assert(0); return -1; }} while(0) + +// Bottom-up approach where we create child objects and store these +// in temporary references before a parent object is created with +// these references. +int create_monster_bottom_up(flatcc_builder_t *B, int flexible) +{ + flatbuffers_string_ref_t weapon_one_name = flatbuffers_string_create_str(B, "Sword"); + uint16_t weapon_one_damage = 3; + + flatbuffers_string_ref_t weapon_two_name = flatbuffers_string_create_str(B, "Axe"); + uint16_t weapon_two_damage = 5; + + // Use the `MyGame_Sample_Weapon_create` shortcut to create Weapons + // with all the fields set. + // + // In the C-API, verbs (here create) always follow the type name + // (here Weapon), prefixed by the namespace (here MyGame_Sample_): + // MyGame_Sample_Weapon_create(...), or ns(Weapone_create(...)). + ns(Weapon_ref_t) sword = ns(Weapon_create(B, weapon_one_name, weapon_one_damage)); + ns(Weapon_ref_t) axe = ns(Weapon_create(B, weapon_two_name, weapon_two_damage)); + + // Serialize a name for our monster, called "Orc". + // The _str suffix indicates the source is an ascii-z string. + flatbuffers_string_ref_t name = flatbuffers_string_create_str(B, "Orc"); + + // Create a `vector` representing the inventory of the Orc. Each number + // could correspond to an item that can be claimed after he is slain. + uint8_t treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + flatbuffers_uint8_vec_ref_t inventory; + // `c_vec_len` is the convenience macro we defined earlier. + inventory = flatbuffers_uint8_vec_create(B, treasure, c_vec_len(treasure)); + + // Here we use a top-down approach locally to build a Weapons vector + // in-place instead of creating a temporary external vector to use + // as argument like we did with the `inventory` earlier on, but the + // overall approach is still bottom-up. + ns(Weapon_vec_start(B)); + ns(Weapon_vec_push(B, sword)); + ns(Weapon_vec_push(B, axe)); + ns(Weapon_vec_ref_t) weapons = ns(Weapon_vec_end(B)); + + + // Create a `Vec3`, representing the Orc's position in 3-D space. + ns(Vec3_t) pos = { 1.0f, 2.0f, 3.0f }; + + + // Set his hit points to 300 and his mana to 150. + uint16_t hp = 300; + // The default value is 150, so we will never store this field. + uint16_t mana = 150; + + // Create the equipment union. In the C++ language API this is given + // as two arguments to the create call, or as two separate add + // operations for the type and the table reference. Here we create + // a single union value that carries both the type and reference. + ns(Equipment_union_ref_t) equipped = ns(Equipment_as_Weapon(axe)); + + if (!flexible) { + // Finally, create the monster using the `Monster_create` helper function + // to set all fields. + // + // Note that the Equipment union only take up one argument in C, where + // C++ takes a type and an object argument. + ns(Monster_create_as_root(B, &pos, mana, hp, name, inventory, ns(Color_Red), + weapons, equipped)); + + // Unlike C++ we do not use a Finish call. Instead we use the + // `create_as_root` action which has better type safety and + // simplicity. + // + // However, we can also express this as: + // + // ns(Monster_ref_t) orc = ns(Monster_create(B, ...)); + // flatcc_builder_buffer_create(orc); + // + // In this approach the function should return the orc and + // let a calling function handle the flatcc_buffer_create call + // for a more composable setup that is also able to create child + // monsters. In general, `flatcc_builder` calls are best isolated + // in a containing driver function. + + } else { + + // A more flexible approach where we mix bottom-up and top-down + // style. We still create child objects first, but then create + // a top-down style monster object that we can manipulate in more + // detail. + + // It is important to pair `start_as_root` with `end_as_root`. + ns(Monster_start_as_root(B)); + ns(Monster_pos_create(B, 1.0f, 2.0f, 3.0f)); + // or alternatively + //ns(Monster_pos_add(&pos); + + ns(Monster_hp_add(B, hp)); + // Notice that `Monser_name_add` adds a string reference unlike the + // add_str and add_strn variants. + ns(Monster_name_add(B, name)); + ns(Monster_inventory_add(B, inventory)); + ns(Monster_color_add(B, ns(Color_Red))); + ns(Monster_weapons_add(B, weapons)); + ns(Monster_equipped_add(B, equipped)); + // Complete the monster object and make it the buffer root object. + ns(Monster_end_as_root(B)); + + // We could also drop the `as_root` suffix from Monster_start/end(B) + // and add the table as buffer root later: + // + // ns(Monster_ref_t) orc = ns(Monster_start(B)); + // ... + // ns(Monster_ref_t) orc = ns(Monster_end(B)); + // flatcc_builder_buffer_create(orc); + // + // It is best to keep the `flatcc_builder` calls in a containing + // driver function for modularity. + } + return 0; +} + +// Alternative top-down approach where parent objects are created before +// their children. We only need to save one reference because the `axe` +// object is used in two places effectively making the buffer object +// graph a DAG. +int create_monster_top_down(flatcc_builder_t *B) +{ + uint8_t treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + size_t treasure_count = c_vec_len(treasure); + ns(Weapon_ref_t) axe; + + // NOTE: if we use end_as_root, we MUST also start as root. + ns(Monster_start_as_root(B)); + ns(Monster_pos_create(B, 1.0f, 2.0f, 3.0f)); + ns(Monster_hp_add(B, 300)); + //ns(Monster_mana_add(B, 150)); + // We use create_str instead of add because we have no existing string reference. + ns(Monster_name_create_str(B, "Orc")); + // Again we use create because we no existing vector object, only a C-array. + ns(Monster_inventory_create(B, treasure, treasure_count)); + ns(Monster_color_add(B, ns(Color_Red))); + if (1) { + ns(Monster_weapons_start(B)); + ns(Monster_weapons_push_create(B, flatbuffers_string_create_str(B, "Sword"), 3)); + // We reuse the axe object later. Note that we dereference a pointer + // because push always returns a short-term pointer to the stored element. + // We could also have created the axe object first and simply pushed it. + axe = *ns(Monster_weapons_push_create(B, flatbuffers_string_create_str(B, "Axe"), 5)); + ns(Monster_weapons_end(B)); + } else { + // We can have more control with the table elements added to a vector: + // + ns(Monster_weapons_start(B)); + ns(Monster_weapons_push_start(B)); + ns(Weapon_name_create_str(B, "Sword")); + ns(Weapon_damage_add(B, 3)); + ns(Monster_weapons_push_end(B)); + ns(Monster_weapons_push_start(B)); + ns(Weapon_name_create_str(B, "Axe")); + ns(Weapon_damage_add(B, 5)); + axe = *ns(Monster_weapons_push_end(B)); + ns(Monster_weapons_end(B)); + } + // Unions can get their type by using a type-specific add/create/start method. + ns(Monster_equipped_Weapon_add(B, axe)); + + ns(Monster_end_as_root(B)); + return 0; +} + +// This isn't strictly needed because the builder already included the reader, +// but we would need it if our reader were in a separate file. +#include "monster_reader.h" + +#undef ns +#define ns(x) FLATBUFFERS_WRAP_NAMESPACE(MyGame_Sample, x) // Specified in the schema. + +int access_monster_buffer(const void *buffer) +{ + // Note that we use the `table_t` suffix when reading a table object + // as opposed to the `ref_t` suffix used during the construction of + // the buffer. + ns(Monster_table_t) monster = ns(Monster_as_root(buffer)); + + // Note: root object pointers are NOT the same as the `buffer` pointer. + + // Make sure the buffer is accessible. + test_assert(monster != 0); + + uint16_t hp = ns(Monster_hp(monster)); + uint16_t mana = ns(Monster_mana(monster)); + // This is just a const char *, but it also supports a fast length operation. + flatbuffers_string_t name = ns(Monster_name(monster)); + size_t name_len = flatbuffers_string_len(name); + + test_assert(hp == 300); + // Since 150 is the default, we are reading a value that wasn't stored. + test_assert(mana == 150); + test_assert(0 == strcmp(name, "Orc")); + test_assert(name_len == strlen("Orc")); + + int hp_present = ns(Monster_hp_is_present(monster)); // 1 + int mana_present = ns(Monster_mana_is_present(monster)); // 0 + test_assert(hp_present); + test_assert(!mana_present); + + ns(Vec3_struct_t) pos = ns(Monster_pos(monster)); + // Make sure pos has been set. + test_assert(pos != 0); + float x = ns(Vec3_x(pos)); + float y = ns(Vec3_y(pos)); + float z = ns(Vec3_z(pos)); + + // The literal `f` suffix is important because double literals does + // not always map cleanly to 32-bit represention even with only a few digits: + // `1.0 == 1.0f`, but `3.2 != 3.2f`. + test_assert(x == 1.0f); + test_assert(y == 2.0f); + test_assert(z == 3.0f); + + // We can also read the position into a C-struct. We have to copy + // because we generally do not know if the native endian format + // matches the one stored in the buffer (pe: protocol endian). + ns(Vec3_t) pos_vec; + // `pe` indicates endian conversion from protocol to native. + ns(Vec3_copy_from_pe(&pos_vec, pos)); + test_assert(pos_vec.x == 1.0f); + test_assert(pos_vec.y == 2.0f); + test_assert(pos_vec.z == 3.0f); + + // This is a const uint8_t *, but it shouldn't be accessed directly + // to ensure proper endian conversion. However, uint8 (ubyte) are + // not sensitive endianness, so we *could* have accessed it directly. + // The compiler likely optimizes this so that it doesn't matter. + flatbuffers_uint8_vec_t inv = ns(Monster_inventory(monster)); + size_t inv_len = flatbuffers_uint8_vec_len(inv); + // Make sure the inventory has been set. + test_assert(inv != 0); + // If `inv` were absent, the length would 0, so the above test is redundant. + test_assert(inv_len == 10); + // Index 0 is the first, index 2 is the third. + // NOTE: C++ uses the `Get` terminology for vector elemetns, C use `at`. + uint8_t third_item = flatbuffers_uint8_vec_at(inv, 2); + test_assert(third_item == 2); + + ns(Weapon_vec_t) weapons = ns(Monster_weapons(monster)); + size_t weapons_len = ns(Weapon_vec_len(weapons)); + test_assert(weapons_len == 2); + // We can use `const char *` instead of `flatbuffers_string_t`. + const char *second_weapon_name = ns(Weapon_name(ns(Weapon_vec_at(weapons, 1)))); + uint16_t second_weapon_damage = ns(Weapon_damage(ns(Weapon_vec_at(weapons, 1)))); + test_assert(second_weapon_name != 0 && strcmp(second_weapon_name, "Axe") == 0); + test_assert(second_weapon_damage == 5); + + // Access union type field. + if (ns(Monster_equipped_type(monster)) == ns(Equipment_Weapon)) { + // Cast to appropriate type: + // C does not require the cast to Weapon_table_t, but C++ does. + ns(Weapon_table_t) weapon = (ns(Weapon_table_t)) ns(Monster_equipped(monster)); + const char *weapon_name = ns(Weapon_name(weapon)); + uint16_t weapon_damage = ns(Weapon_damage(weapon)); + + test_assert(0 == strcmp(weapon_name, "Axe")); + test_assert(weapon_damage == 5); + } + return 0; +} + +#include + +int main(int argc, char *argv[]) +{ + // Create a `FlatBufferBuilder`, which will be used to create our + // monsters' FlatBuffers. + flatcc_builder_t builder; + void *buf; + size_t size; + + // Silence warnings. + (void)argc; + (void)argv; + + // Initialize the builder object. + flatcc_builder_init(&builder); + test_assert(0 == create_monster_bottom_up(&builder, 0)); + + // Allocate and extract a readable buffer from internal builder heap. + // The returned buffer must be deallocated using `free`. + // NOTE: Finalizing the buffer does NOT change the builder, it + // just creates a snapshot of the builder content. + // NOTE2: finalize_buffer uses malloc while finalize_aligned_buffer + // uses a portable aligned allocation method. Often the malloc + // version is sufficient, but won't work for all schema on all + // systems. If the buffer is written to disk or network, but not + // accessed in memory, `finalize_buffer` is also sufficient. + buf = flatcc_builder_finalize_aligned_buffer(&builder, &size); + //buf = flatcc_builder_finalize_buffer(&builder, &size); + + // We now have a FlatBuffer we can store on disk or send over a network. + // ** file/network code goes here :) ** + // Instead, we're going to access it right away (as if we just received it). + //access_monster_buffer(buf); + + // prior to v0.5.0, use `aligned_free` + flatcc_builder_aligned_free(buf); + //free(buf); + // + // The builder object can optionally be reused after a reset which + // is faster than creating a new builder. Subsequent use might + // entirely avoid temporary allocations until finalizing the buffer. + flatcc_builder_reset(&builder); + test_assert(0 == create_monster_bottom_up(&builder, 1)); + buf = flatcc_builder_finalize_aligned_buffer(&builder, &size); + access_monster_buffer(buf); + flatcc_builder_aligned_free(buf); + flatcc_builder_reset(&builder); + create_monster_top_down(&builder); + buf = flatcc_builder_finalize_buffer(&builder, &size); + test_assert(0 == access_monster_buffer(buf)); + free(buf); + // Eventually the builder must be cleaned up: + flatcc_builder_clear(&builder); + + printf("The FlatBuffer was successfully created and accessed!\n"); + + return 0; +} diff --git a/recipes/flatcc/all/test_package/monster.fbs b/recipes/flatcc/all/test_package/monster.fbs new file mode 100644 index 0000000000000..12859d2e4c4b6 --- /dev/null +++ b/recipes/flatcc/all/test_package/monster.fbs @@ -0,0 +1,32 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; // Struct. + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; // Vector of scalars. + color:Color = Blue; // Enum. + weapons:[Weapon]; // Vector of tables. + equipped:Equipment; // Union. +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; diff --git a/recipes/flatcc/config.yml b/recipes/flatcc/config.yml new file mode 100644 index 0000000000000..72628ee9e8a7f --- /dev/null +++ b/recipes/flatcc/config.yml @@ -0,0 +1,5 @@ +versions: + 0.6.1: + folder: all + 0.6.0: + folder: all diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml new file mode 100644 index 0000000000000..d95e9e88c952a --- /dev/null +++ b/recipes/flecs/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "3.1.4": + url: "https://github.com/SanderMertens/flecs/archive/v3.1.4.tar.gz" + sha256: "cc73d529ddc47891fc16c7dd965ca9c4239d1caccae024c81364bf3d49286fe0" + "3.1.3": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.3.tar.gz" + sha256: "52da12a8bae260be21bf29d97af622241efd822737d0a15e551cd92e30abd5c9" + "3.1.2": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.2.tar.gz" + sha256: "1fe4f78b44f2ded1355179a8395bb254fbd8a9db88b9f8ecd890472d60acf723" + "3.1.1": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.1.tar.gz" + sha256: "f31edfa258b90d086c311ad5ccc60e8e1ab0448aa10856d96e9e503cc15c1c63" + "3.1.0": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.0.tar.gz" + sha256: "67e7cf4ff2abe661d9269b9d7f52ec7c39192f22e69bab638f27ef4337c12905" + "3.0.4": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.0.4.tar.gz" + sha256: "370e2bf1bd9fd6dc79b515887e7f048be676b0d95e23d43b2c8b76a5e645c8f4" + "3.0.1": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.0.1.tar.gz" + sha256: "a7c80dea0677721f83433623169cd4094c48270022c19adedac28331d546b539" + "2.4.8": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v2.4.8.tar.gz" + sha256: "9a8040a197e4b5e032524bc7183f68faa7b2f759c67b983b40018a7726561cac" + "2.4.7": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v2.4.7.tar.gz" + sha256: "ef3952fee5b83991fbd9aa77212c45171393b2dfd14001b2d1c7b97861934afa" + "2.4.6": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v2.4.6.tar.gz" + sha256: "e74798d4b387c85272b05ee574d991cbe1fb844680a1fc3d68818a02b5f59299" + "2.3.2": + url: "https://github.com/SanderMertens/flecs/archive/v2.3.2.tar.gz" + sha256: "ff2690953941b3f08d4e934e299fa8902e46ce8532edd176388d467ace33eebf" diff --git a/recipes/flecs/all/conanfile.py b/recipes/flecs/all/conanfile.py new file mode 100644 index 0000000000000..b4d76faa5ed41 --- /dev/null +++ b/recipes/flecs/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class FlecsConan(ConanFile): + name = "flecs" + description = "A fast entity component system (ECS) for C & C++" + license = "MIT" + topics = ("gamedev", "cpp", "data-oriented-design", "c99", + "game-development", "ecs", "entity-component-system", + "cpp11", "ecs-framework") + homepage = "https://github.com/SanderMertens/flecs" + 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, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "3.0.1": + tc.variables["FLECS_STATIC_LIBS"] = not self.options.shared + tc.variables["FLECS_SHARED_LIBS"] = self.options.shared + tc.variables["FLECS_DEVELOPER_WARNINGS"] = False + else: + tc.variables["FLECS_STATIC"] = not self.options.shared + tc.variables["FLECS_SHARED"] = self.options.shared + tc.variables["FLECS_PIC"] = self.options.get_safe("fPIC", True) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + suffix = "" if self.options.shared else "_static" + self.cpp_info.set_property("cmake_file_name", "flecs") + self.cpp_info.set_property("cmake_target_name", f"flecs::flecs{suffix}") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["_flecs"].libs = [f"flecs{suffix}"] + if not self.options.shared: + self.cpp_info.components["_flecs"].defines.append("flecs_STATIC") + if Version(self.version) >= "3.0.0": + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_flecs"].system_libs.append("pthread") + elif self.settings.os == "Windows": + self.cpp_info.components["_flecs"].system_libs.extend(["wsock32", "ws2_32"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "flecs" + self.cpp_info.names["cmake_find_package_multi"] = "flecs" + self.cpp_info.components["_flecs"].names["cmake_find_package"] = f"flecs{suffix}" + self.cpp_info.components["_flecs"].names["cmake_find_package_multi"] = f"flecs{suffix}" + self.cpp_info.components["_flecs"].set_property("cmake_target_name", f"flecs::flecs{suffix}") diff --git a/recipes/flecs/all/test_package/CMakeLists.txt b/recipes/flecs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fc32143d0f19f --- /dev/null +++ b/recipes/flecs/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(flecs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET flecs::flecs_static) + target_link_libraries(${PROJECT_NAME} PRIVATE flecs::flecs_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE flecs::flecs) +endif() diff --git a/recipes/flecs/all/test_package/conanfile.py b/recipes/flecs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/flecs/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/flecs/all/test_package/test_package.c b/recipes/flecs/all/test_package/test_package.c new file mode 100644 index 0000000000000..6b277544863db --- /dev/null +++ b/recipes/flecs/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include + +#include + +typedef struct { + float x; + float y; +} Position; + +int main() { + ecs_world_t *world = ecs_init(); + + ECS_COMPONENT(world, Position); + + ecs_entity_t e = ecs_new_id(world); + ecs_set(world, e, Position, {10.0f, 20.0f}); + + const char *name = ecs_get_name(world, e); + const Position *p = ecs_get(world, e, Position); + printf("Position of %s is {%f, %f}\n", name, p->x, p->y); + + return 0; +} diff --git a/recipes/flecs/all/test_v1_package/CMakeLists.txt b/recipes/flecs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/flecs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/flecs/all/test_v1_package/conanfile.py b/recipes/flecs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/flecs/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/flecs/config.yml b/recipes/flecs/config.yml new file mode 100644 index 0000000000000..6dd38fdadfe17 --- /dev/null +++ b/recipes/flecs/config.yml @@ -0,0 +1,23 @@ +versions: + "3.1.4": + folder: all + "3.1.3": + folder: all + "3.1.2": + folder: all + "3.1.1": + folder: all + "3.1.0": + folder: all + "3.0.4": + folder: all + "3.0.1": + folder: all + "2.4.8": + folder: all + "2.4.7": + folder: all + "2.4.6": + folder: all + "2.3.2": + folder: all diff --git a/recipes/flex/all/conandata.yml b/recipes/flex/all/conandata.yml new file mode 100644 index 0000000000000..590bff3866793 --- /dev/null +++ b/recipes/flex/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.6.4": + sha256: "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995" + url: "https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz" +patches: + "2.6.4": + - patch_file: patches/darwin-newer-versions.patch + patch_description: "missing linker flags skipped due to a problem in configure." + patch_source: "https://github.com/westes/flex/issues/509" + patch_type: "portability" diff --git a/recipes/flex/all/conanfile.py b/recipes/flex/all/conanfile.py new file mode 100644 index 0000000000000..1a19a7b9aedd3 --- /dev/null +++ b/recipes/flex/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.files import get, rmdir, copy, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import AutotoolsToolchain, Autotools + +required_conan_version = ">=1.53.0" + + +class FlexConan(ConanFile): + name = "flex" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/westes/flex" + description = "Flex, the fast lexical analyzer generator" + topics = ("lex", "lexer", "lexical analyzer generator") + license = "BSD-2-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + # Flex requires M4 to be compiled. If consumer does not have M4 + # installed, Conan will need to know that Flex requires it. + self.requires("m4/1.4.19") + + def build_requirements(self): + self.tool_requires("m4/1.4.19") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires(f"{self.name}/{self.version}") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Flex package is not compatible with Windows. " + "Consider using winflexbison instead.") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def generate(self): + at = AutotoolsToolchain(self) + at.configure_args.extend([ + "--disable-nls", + "--disable-bootstrap", + "HELP2MAN=/bin/true", + "M4=m4", + # https://github.com/westes/flex/issues/247 + "ac_cv_func_malloc_0_nonnull=yes", "ac_cv_func_realloc_0_nonnull=yes", + # https://github.com/easybuilders/easybuild-easyconfigs/pull/5792 + "ac_cv_func_reallocarray=no", + ]) + at.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["fl"] + self.cpp_info.system_libs = ["m"] + # Avoid CMakeDeps messing with Conan targets + self.cpp_info.set_property("cmake_find_mode", "none") + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + lex_path = os.path.join(bindir, "flex").replace("\\", "/") + self.output.info("Setting LEX environment variable: {}".format(lex_path)) + self.env_info.LEX = lex_path diff --git a/recipes/flex/all/patches/darwin-newer-versions.patch b/recipes/flex/all/patches/darwin-newer-versions.patch new file mode 100644 index 0000000000000..d0a7b8300861e --- /dev/null +++ b/recipes/flex/all/patches/darwin-newer-versions.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index d88c47c..827c01a 100755 +--- a/configure ++++ b/configure +@@ -6842,7 +6842,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- 10.*) ++ *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; diff --git a/recipes/flex/all/test_package/CMakeLists.txt b/recipes/flex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1c6f9d490deb4 --- /dev/null +++ b/recipes/flex/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(FLEX REQUIRED) +flex_target(flex_scanner basic_nr.l ${PROJECT_BINARY_DIR}/basic_nr.cpp) + +add_executable(${PROJECT_NAME} basic_nr.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${FLEX_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLEX_LIBRARIES}) diff --git a/recipes/flex/all/test_package/basic_nr.l b/recipes/flex/all/test_package/basic_nr.l new file mode 100644 index 0000000000000..71fa5d65f82c6 --- /dev/null +++ b/recipes/flex/all/test_package/basic_nr.l @@ -0,0 +1,89 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +%option C++ noyywrap + +%{ +int mylineno = 0; +%} + +string \"[^\n"]+\" + +ws [ \t]+ + +alpha [A-Za-z] +dig [0-9] +name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* +num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? +num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? +number {num1}|{num2} + +%% + +{ws} /* skip blanks and tabs */ + +"/*" { + int c; + + while((c = yyinput()) != 0) + { + if(c == '\n') + ++mylineno; + + else if(c == '*') + { + if((c = yyinput()) == '/') + break; + else + unput(c); + } + } + } + +{number} std::cout << "number " << YYText() << '\n'; + +\n mylineno++; + +{name} std::cout << "name " << YYText() << '\n'; + +{string} std::cout << "string " << YYText() << '\n'; + +%% + +extern "C" { + int yylex() {return 0;} +} + +#include + +int main( int argc, const char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + std::ifstream ifs(argv[1]); + FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); + while(lexer->yylex() != 0) + ; + return 0; +} diff --git a/recipes/flex/all/test_package/basic_nr.txt b/recipes/flex/all/test_package/basic_nr.txt new file mode 100644 index 0000000000000..3dca798730b64 --- /dev/null +++ b/recipes/flex/all/test_package/basic_nr.txt @@ -0,0 +1,6 @@ +/* this is a multi line comment +still in the comment +and done */ +foo = "bar" +num = 43 +setting = false diff --git a/recipes/flex/all/test_package/conanfile.py b/recipes/flex/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4270466e9e01c --- /dev/null +++ b/recipes/flex/all/test_package/conanfile.py @@ -0,0 +1,50 @@ +import os +import re +from io import StringIO + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv", "CMakeDeps" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def _assert_expected_version(self): + + def tested_reference_version(): + tokens = re.split('[@#]', self.tested_reference_str) + return tokens[0].split("/", 1)[1] + + output = StringIO() + self.run("flex --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + expected_version = tested_reference_version() + self.output.info("Expected version: {}".format(expected_version)) + assert_flex_version = "flex {}".format(expected_version) + assert(assert_flex_version in output_str) + + def build(self): + # Let's check flex version installed + self._assert_expected_version() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + txt_file = os.path.join(self.source_folder, "basic_nr.txt") + self.run(f"{bin_path} {txt_file}", env="conanrun") diff --git a/recipes/flex/all/test_v1_package/CMakeLists.txt b/recipes/flex/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b93b03cb34ebf --- /dev/null +++ b/recipes/flex/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(FLEX REQUIRED) +flex_target(flex_scanner basic_nr.l ${PROJECT_BINARY_DIR}/basic_nr.cpp) + +add_executable(${PROJECT_NAME} basic_nr.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${FLEX_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLEX_LIBRARIES}) diff --git a/recipes/flex/all/test_v1_package/basic_nr.l b/recipes/flex/all/test_v1_package/basic_nr.l new file mode 100644 index 0000000000000..71fa5d65f82c6 --- /dev/null +++ b/recipes/flex/all/test_v1_package/basic_nr.l @@ -0,0 +1,89 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +%option C++ noyywrap + +%{ +int mylineno = 0; +%} + +string \"[^\n"]+\" + +ws [ \t]+ + +alpha [A-Za-z] +dig [0-9] +name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* +num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? +num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? +number {num1}|{num2} + +%% + +{ws} /* skip blanks and tabs */ + +"/*" { + int c; + + while((c = yyinput()) != 0) + { + if(c == '\n') + ++mylineno; + + else if(c == '*') + { + if((c = yyinput()) == '/') + break; + else + unput(c); + } + } + } + +{number} std::cout << "number " << YYText() << '\n'; + +\n mylineno++; + +{name} std::cout << "name " << YYText() << '\n'; + +{string} std::cout << "string " << YYText() << '\n'; + +%% + +extern "C" { + int yylex() {return 0;} +} + +#include + +int main( int argc, const char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + std::ifstream ifs(argv[1]); + FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); + while(lexer->yylex() != 0) + ; + return 0; +} diff --git a/recipes/flex/all/test_v1_package/basic_nr.txt b/recipes/flex/all/test_v1_package/basic_nr.txt new file mode 100644 index 0000000000000..3dca798730b64 --- /dev/null +++ b/recipes/flex/all/test_v1_package/basic_nr.txt @@ -0,0 +1,6 @@ +/* this is a multi line comment +still in the comment +and done */ +foo = "bar" +num = 43 +setting = false diff --git a/recipes/flex/all/test_v1_package/conanfile.py b/recipes/flex/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4d0b7ff593f64 --- /dev/null +++ b/recipes/flex/all/test_v1_package/conanfile.py @@ -0,0 +1,47 @@ +import os +import re +from io import StringIO + +from conans import ConanFile, tools, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def _assert_expected_version(self): + + def tested_reference_version(): + tokens = re.split('[@#]', self.tested_reference_str) + return tokens[0].split("/", 1)[1] + + output = StringIO() + self.run(f"flex --version", output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + expected_version = tested_reference_version() + self.output.info("Expected version: {}".format(expected_version)) + assert_flex_version = "flex {}".format(expected_version) + assert(assert_flex_version in output_str) + + def build(self): + # Let's check flex version installed + self._assert_expected_version() + # FIXME: CMake legacy is not working as expected when cross-compiling + if not tools.cross_building(self, skip_x64_x86=True): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + txt_file = os.path.join(self.source_folder, "basic_nr.txt") + self.run(f"{bin_path} {txt_file}", run_environment=True) diff --git a/recipes/flex/config.yml b/recipes/flex/config.yml new file mode 100644 index 0000000000000..1d8c5a5f183fd --- /dev/null +++ b/recipes/flex/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.4": + folder: all diff --git a/recipes/flint/all/CMakeLists.txt b/recipes/flint/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/flint/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/flint/all/conandata.yml b/recipes/flint/all/conandata.yml new file mode 100644 index 0000000000000..ca7fe5127f757 --- /dev/null +++ b/recipes/flint/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.8.1": + url: "https://github.com/wbhart/flint2/archive/refs/tags/v2.8.1.tar.gz" + sha256: "93c4d6acd46d7a4357a2abe313e5f0625fa7e94a1a0e53048f9066f55a7acd49" + "2.7.1": + url: "https://github.com/wbhart/flint2/archive/refs/tags/v2.7.1.tar.gz" + sha256: "bcadc2252e61092a9b3a3198b337e20abeac56078eaa19793ab99ff7a987efb7" +patches: + "2.8.1": + - patch_file: "patches/0001-cmake-2.8.1.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-msvc-alloca.patch" + base_path: "source_subfolder" + "2.7.1": + - patch_file: "patches/0001-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-msvc-alloca.patch" + base_path: "source_subfolder" diff --git a/recipes/flint/all/conanfile.py b/recipes/flint/all/conanfile.py new file mode 100644 index 0000000000000..29a0ae933dc5f --- /dev/null +++ b/recipes/flint/all/conanfile.py @@ -0,0 +1,91 @@ +import os + +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + + +class FlintConan(ConanFile): + name = "flint" + description = "FLINT (Fast Library for Number Theory)" + license = "LGPL-2.1-or-later" + topics = ("math", "numerical") + homepage = "https://www.flintlib.org" + 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 + + @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): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("gmp/6.2.1") + self.requires("mpfr/4.1.0") + if self.settings.compiler == "Visual Studio": + self.requires("pthreads4w/3.0.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.definitions["BUILD_DOCS"] = False + self._cmake.definitions["WITH_NTL"] = False + # IPO/LTO breaks clang builds + self._cmake.definitions["IPO_SUPPORTED"] = False + # No BLAS yet + self._cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_CBLAS"] = True + # handle run in a cross-build + if tools.cross_building(self): + self._cmake.definitions["FLINT_USES_POPCNT_EXITCODE"] = "1" + self._cmake.definitions["FLINT_USES_POPCNT_EXITCODE__TRYRUN_OUTPUT"] = "" + 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() + cmake.install() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "libflint" + self.cpp_info.names["cmake_find_package_multi"] = "libflint" + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "m"] + + self.cpp_info.includedirs.append(os.path.join("include", "flint")) + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/flint/all/patches/0001-cmake-2.8.1.patch b/recipes/flint/all/patches/0001-cmake-2.8.1.patch new file mode 100644 index 0000000000000..bfb50ddd978c7 --- /dev/null +++ b/recipes/flint/all/patches/0001-cmake-2.8.1.patch @@ -0,0 +1,63 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2616d0669..6fa4cf5f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,7 +46,10 @@ endif() + # pthread configuration + + if(MSVC) +- find_package(PThreads REQUIRED) ++ #find_package(PThreads REQUIRED) ++ set(PThreads_FOUND TRUE) ++ set(PThreads_LIBRARIES "${CONAN_LIBS_PTHREADS4W}") ++ set(PThreads_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_PTHREADS4W}") + set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.") + else() + option(CMAKE_THREAD_PREFER_PTHREAD "Prefer pthreads" yes) +@@ -101,9 +104,9 @@ set(HEADERS + ) + + foreach (build_dir IN LISTS BUILD_DIRS TEMPLATE_DIRS) +- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.c") ++ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.c") + list(APPEND SOURCES ${TEMP}) +- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.h") ++ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.h") + list(APPEND HEADERS ${TEMP}) + endforeach () + +@@ -112,7 +115,7 @@ execute_process( + " + from os.path import join + +-with open(join('${CMAKE_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: ++with open(join('${CMAKE_CURRENT_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: + with open('CPimport.h.in', 'w+') as fout: + while True: + l = fin.readline() +@@ -212,14 +215,14 @@ endif() + set(TEMP ${HEADERS}) + set(HEADERS ) + foreach(header IN LISTS TEMP) +- if(EXISTS ${CMAKE_SOURCE_DIR}/${header}) ++ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${header}) + list(APPEND HEADERS ${header}) + else() +- list(APPEND HEADERS ${CMAKE_BINARY_DIR}/${header}) ++ list(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${header}) + endif() + endforeach() + +-file(GLOB TEMP "${CMAKE_SOURCE_DIR}/*.h") ++file(GLOB TEMP "${CMAKE_CURRENT_SOURCE_DIR}/*.h") + list(APPEND HEADERS ${TEMP}) + + add_library(flint ${SOURCES}) +@@ -236,6 +239,7 @@ endif() + target_include_directories(flint PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} ${GMP_INCLUDE_DIRS} ${MPFR_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} ${PThreads_INCLUDE_DIRS} ++ ${CMAKE_BINARY_DIR} + ${NTL_INCLUDE_DIR} + ) + diff --git a/recipes/flint/all/patches/0001-cmake.patch b/recipes/flint/all/patches/0001-cmake.patch new file mode 100644 index 0000000000000..9e5780c52e94b --- /dev/null +++ b/recipes/flint/all/patches/0001-cmake.patch @@ -0,0 +1,63 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 11ff789a7..80a45f90f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,7 +46,10 @@ endif() + # pthread configuration + + if(MSVC) +- find_package(PThreads REQUIRED) ++ #find_package(PThreads REQUIRED) ++ set(PThreads_FOUND TRUE) ++ set(PThreads_LIBRARIES "${CONAN_LIBS_PTHREADS4W}") ++ set(PThreads_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_PTHREADS4W}") + set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.") + else() + option(CMAKE_THREAD_PREFER_PTHREAD "Prefer pthreads" yes) +@@ -99,9 +102,9 @@ set(HEADERS + ) + + foreach (build_dir IN LISTS BUILD_DIRS TEMPLATE_DIRS) +- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.c") ++ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.c") + list(APPEND SOURCES ${TEMP}) +- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.h") ++ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.h") + list(APPEND HEADERS ${TEMP}) + endforeach () + +@@ -110,7 +113,7 @@ execute_process( + " + from os.path import join + +-with open(join('${CMAKE_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: ++with open(join('${CMAKE_CURRENT_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: + with open('CPimport.h.in', 'w+') as fout: + while True: + l = fin.readline() +@@ -210,14 +213,14 @@ endif() + set(TEMP ${HEADERS}) + set(HEADERS ) + foreach(header IN LISTS TEMP) +- if(EXISTS ${CMAKE_SOURCE_DIR}/${header}) ++ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${header}) + list(APPEND HEADERS ${header}) + else() +- list(APPEND HEADERS ${CMAKE_BINARY_DIR}/${header}) ++ list(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${header}) + endif() + endforeach() + +-file(GLOB TEMP "${CMAKE_SOURCE_DIR}/*.h") ++file(GLOB TEMP "${CMAKE_CURRENT_SOURCE_DIR}/*.h") + list(APPEND HEADERS ${TEMP}) + + add_library(flint ${SOURCES}) +@@ -234,6 +237,7 @@ endif() + target_include_directories(flint PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} ${GMP_INCLUDE_DIRS} ${MPFR_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} ${PThreads_INCLUDE_DIRS} ++ ${CMAKE_BINARY_DIR} + ${NTL_INCLUDE_DIR} + ) + diff --git a/recipes/flint/all/patches/0002-msvc-alloca.patch b/recipes/flint/all/patches/0002-msvc-alloca.patch new file mode 100644 index 0000000000000..5e616ee7e08a3 --- /dev/null +++ b/recipes/flint/all/patches/0002-msvc-alloca.patch @@ -0,0 +1,13 @@ +diff --git a/flint.h b/flint.h +index f4e98b2e9..62ac39222 100644 +--- a/flint.h ++++ b/flint.h +@@ -26,7 +26,7 @@ + /* MinGW and FreeBSD have alloca, but not alloca.h */ + #include + #endif +-#if defined(__MINGW32__) ++#if defined(__MINGW32__) || defined(_MSC_VER) + #include /* for alloca on MinGW */ + #endif + #include "limits.h" diff --git a/recipes/flint/all/test_package/CMakeLists.txt b/recipes/flint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e0200ac7628d3 --- /dev/null +++ b/recipes/flint/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libflint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} libflint::libflint) diff --git a/recipes/flint/all/test_package/conanfile.py b/recipes/flint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b6a26067f365d --- /dev/null +++ b/recipes/flint/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/flint/all/test_package/test_package.cpp b/recipes/flint/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6ce46f2b7921e --- /dev/null +++ b/recipes/flint/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + flint_printf("OK\n"); + return 0; +} diff --git a/recipes/flint/config.yml b/recipes/flint/config.yml new file mode 100644 index 0000000000000..fed2a63c4da2b --- /dev/null +++ b/recipes/flint/config.yml @@ -0,0 +1,5 @@ +versions: + "2.8.1": + folder: all + "2.7.1": + folder: all diff --git a/recipes/fltk/all/CMakeLists.txt b/recipes/fltk/all/CMakeLists.txt new file mode 100644 index 0000000000000..60dd71d7363c3 --- /dev/null +++ b/recipes/fltk/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/fltk/all/conandata.yml b/recipes/fltk/all/conandata.yml new file mode 100644 index 0000000000000..1b3f085545004 --- /dev/null +++ b/recipes/fltk/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.3.8": + url: "https://github.com/fltk/fltk/archive/refs/tags/release-1.3.8.tar.gz" + sha256: "abddf697bf1b0a59462a0d2ec57557f4bfb9c634627e6fa50d8c664112642811" + +patches: + "1.3.8": + - base_path: "source_subfolder" + patch_file: "patches/1.3.8-0001-remove-fluid.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.3.8-0002-fix-resources.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.3.8-0003-build-static-only-on-static.patch" diff --git a/recipes/fltk/all/conanfile.py b/recipes/fltk/all/conanfile.py new file mode 100644 index 0000000000000..0533063aab585 --- /dev/null +++ b/recipes/fltk/all/conanfile.py @@ -0,0 +1,139 @@ +import os + +import conan.tools.files as tools +from conan import ConanFile +from conans import CMake + +required_conan_version = ">=1.50.0" + + +class FltkConan(ConanFile): + name = "fltk" + description = "Fast Light Toolkit is a cross-platform C++ GUI toolkit" + topics = ("fltk", "gui") + homepage = "https://www.fltk.org" + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-2.0-custom" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gl": [True, False], + "with_threads": [True, False], + "with_gdiplus": [True, False], + "abi_version": "ANY" + } + default_options = { + "shared": False, + "fPIC": True, + "with_gl": True, + "with_threads": True, + "with_gdiplus": True + } + generators = "cmake", "cmake_find_package_multi" + + @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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.with_gdiplus + if self.options.abi_version == None: + _version_token = self.version.split(".") + _version_major = int(_version_token[0]) + if len(_version_token) >= 3: + _version_minor = int(_version_token[1]) + _version_patch = int(_version_token[2]) + elif len(_version_token) >= 2: + _version_minor = int(_version_token[1]) + _version_patch = 0 + self.options.abi_version = str( + int(_version_major) * 10000 + + int(_version_minor) * 100 + + int(_version_patch) + ) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("zlib/1.2.12") + self.requires("libjpeg/9d") + self.requires("libpng/1.6.37") + if self.settings.os == "Linux": + self.requires("opengl/system") + self.requires("glu/system") + self.requires("fontconfig/2.13.93") + self.requires("xorg/system") + + def source(self): + tools.get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions['OPTION_BUILD_SHARED_LIBS'] = self.options.shared + cmake.definitions['FLTK_BUILD_TEST'] = False + cmake.definitions['FLTK_BUILD_EXAMPLES'] = False + cmake.definitions['OPTION_USE_GL'] = self.options.with_gl + cmake.definitions['OPTION_USE_THREADS'] = self.options.with_threads + cmake.definitions['OPTION_BUILD_HTML_DOCUMENTATION'] = False + cmake.definitions['OPTION_BUILD_PDF_DOCUMENTATION'] = False + if self.options.abi_version: + cmake.definitions['OPTION_ABI_VERSION'] = self.options.abi_version + cmake.configure() + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(self, **patch) + + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(self, os.path.join(self.package_folder, "share")) + tools.rmdir(self, os.path.join(self.package_folder, "FLTK.framework")) + tools.rmdir(self, os.path.join(self.package_folder, "CMake")) + tools.rm(self, "fltk-config*", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fltk") + self.cpp_info.set_property("cmake_target_name", "fltk::fltk") + + self.cpp_info.names["cmake_find_package"] = "fltk" + self.cpp_info.names["cmake_find_package_multi"] = "fltk" + + if self.options.shared and self.settings.os == "Windows": + self.cpp_info.defines.append("FL_DLL") + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os in ("Linux", "FreeBSD"): + if self.options.with_threads: + self.cpp_info.system_libs.extend(['pthread', 'dl']) + if self.options.with_gl: + self.cpp_info.system_libs.extend(['GL', 'GLU']) + if self.settings.os == "Macos": + self.cpp_info.frameworks = ['Cocoa', 'OpenGL', 'IOKit', 'Carbon', 'CoreFoundation', 'CoreVideo'] + if self.settings.os == "Windows": + self.cpp_info.system_libs = [ + "gdi32", + "imm32", + "msimg32", + "ole32", + "oleaut32", + "uuid", + ] + if self.options.get_safe("with_gdiplus"): + self.cpp_info.system_libs.append("gdiplus") diff --git a/recipes/fltk/all/patches/1.3.8-0001-remove-fluid.patch b/recipes/fltk/all/patches/1.3.8-0001-remove-fluid.patch new file mode 100644 index 0000000000000..051b9e9f6be9c --- /dev/null +++ b/recipes/fltk/all/patches/1.3.8-0001-remove-fluid.patch @@ -0,0 +1,20 @@ +diff --git a/CMake/export.cmake b/CMake/export.cmake +index 6e8bc5d..5118cb4 100644 +--- a/CMake/export.cmake ++++ b/CMake/export.cmake +@@ -20,6 +20,7 @@ + ####################################################################### + + # Set the fluid executable path ++if (0) + if (CMAKE_CROSSCOMPILING) + find_file(FLUID_PATH + NAMES fluid fluid.exe +@@ -37,6 +38,7 @@ else () + set (FLTK_FLUID_EXECUTABLE fluid) + set (FLUID fluid) # export + endif (CMAKE_CROSSCOMPILING) ++endif() + + add_subdirectory(src) + diff --git a/recipes/fltk/all/patches/1.3.8-0002-fix-resources.patch b/recipes/fltk/all/patches/1.3.8-0002-fix-resources.patch new file mode 100644 index 0000000000000..ef15cfc93c479 --- /dev/null +++ b/recipes/fltk/all/patches/1.3.8-0002-fix-resources.patch @@ -0,0 +1,78 @@ +diff --git a/CMake/options.cmake b/CMake/options.cmake +index ddd650f..28c4190 100644 +--- a/CMake/options.cmake ++++ b/CMake/options.cmake +@@ -327,12 +327,22 @@ endif (debug_threads) + unset (debug_threads) + + ####################################################################### ++if (0) ++ + option (OPTION_USE_SYSTEM_ZLIB "use system zlib" ON) + + if (OPTION_USE_SYSTEM_ZLIB) + include (FindZLIB) + endif (OPTION_USE_SYSTEM_ZLIB) + ++else() ++ ++option (OPTION_USE_SYSTEM_ZLIB "use system zlib" ON) ++find_package(ZLIB) ++set (FLTK_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) ++ ++endif() ++ + if (ZLIB_FOUND) + set (FLTK_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + include_directories (${ZLIB_INCLUDE_DIRS}) +@@ -352,6 +362,8 @@ endif (ZLIB_FOUND) + set (HAVE_LIBZ 1) + + ####################################################################### ++if (0) ++ + if (APPLE) + option (OPTION_USE_SYSTEM_LIBJPEG "use system libjpeg" OFF) + else () +@@ -377,9 +389,22 @@ else () + set (FLTK_BUILTIN_JPEG_FOUND TRUE) + endif (JPEG_FOUND) + ++else() ++ ++option (OPTION_USE_SYSTEM_LIBJPEG "use system libjpeg" ON) ++find_package(JPEG REQUIRED) ++set (FLTK_JPEG_LIBRARIES ${JPEG_LIBRARIES}) ++set (FLTK_BUILTIN_JPEG_FOUND FALSE) ++ ++endif() ++ ++ ++ + set (HAVE_LIBJPEG 1) + + ####################################################################### ++if(0) ++ + if (APPLE) + option (OPTION_USE_SYSTEM_LIBPNG "use system libpng" OFF) + else () +@@ -409,6 +434,18 @@ else() + set (FLTK_BUILTIN_PNG_FOUND TRUE) + endif (PNG_FOUND) + ++else() ++ ++option (OPTION_USE_SYSTEM_LIBPNG "use system libpng" ON) ++find_package(PNG REQUIRED) ++set (FLTK_PNG_LIBRARIES ${PNG_LIBRARIES}) ++set (FLTK_BUILTIN_PNG_FOUND FALSE) ++set (HAVE_PNG_H 1) ++set (HAVE_PNG_GET_VALID 1) ++set (HAVE_PNG_SET_TRNS_TO_ALPHA 1) ++ ++endif() ++ + set (HAVE_LIBPNG 1) + + ####################################################################### diff --git a/recipes/fltk/all/patches/1.3.8-0003-build-static-only-on-static.patch b/recipes/fltk/all/patches/1.3.8-0003-build-static-only-on-static.patch new file mode 100644 index 0000000000000..382aef3e36be6 --- /dev/null +++ b/recipes/fltk/all/patches/1.3.8-0003-build-static-only-on-static.patch @@ -0,0 +1,20 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d153b1c..ef5a492 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -303,6 +303,7 @@ if (USE_XFT) + endif (LIB_fontconfig) + endif (USE_XFT) + ++if (NOT OPTION_BUILD_SHARED_LIBS) + ####################################################################### + + FL_ADD_LIBRARY (fltk STATIC "${STATIC_FILES}") +@@ -342,6 +343,7 @@ if (OPENGL_FOUND) + FL_ADD_LIBRARY (fltk_gl STATIC "${GLCPPFILES}") + target_link_libraries (fltk_gl fltk ${OPENGL_LIBRARIES}) + endif (OPENGL_FOUND) ++endif (NOT OPTION_BUILD_SHARED_LIBS) + + ####################################################################### + # Build shared libraries (optional) diff --git a/recipes/fltk/all/test_package/CMakeLists.txt b/recipes/fltk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a163bc26a443b --- /dev/null +++ b/recipes/fltk/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fltk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} fltk::fltk) diff --git a/recipes/fltk/all/test_package/conanfile.py b/recipes/fltk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/fltk/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fltk/all/test_package/test_package.cpp b/recipes/fltk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0f01ca1d8f94f --- /dev/null +++ b/recipes/fltk/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "FL/Fl.H" + +#include + +int main(int argc, char* argv[]) +{ + std::cout << "fltk version : " << Fl::version() << std::endl; + std::cout << "fltk api version : " << Fl::api_version() << std::endl; + std::cout << "fltk abi version : " << Fl::abi_version() << std::endl; + + return 0; +} diff --git a/recipes/fltk/config.yml b/recipes/fltk/config.yml new file mode 100644 index 0000000000000..76eba86fa7f6d --- /dev/null +++ b/recipes/fltk/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.8": + folder: "all" diff --git a/recipes/fmt/all/conandata.yml b/recipes/fmt/all/conandata.yml new file mode 100644 index 0000000000000..2125f36949279 --- /dev/null +++ b/recipes/fmt/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "10.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip" + sha256: "4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281" + "9.1.0": + url: "https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip" + sha256: "cceb4cb9366e18a5742128cb3524ce5f50e88b476f1e54737a47ffdf4df4c996" + "9.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/9.0.0/fmt-9.0.0.zip" + sha256: "fc96dd2d2fdf2bded630787adba892c23cb9e35c6fd3273c136b0c57d4651ad6" + "8.1.1": + url: "https://github.com/fmtlib/fmt/releases/download/8.1.1/fmt-8.1.1.zip" + sha256: "23778bad8edba12d76e4075da06db591f3b0e3c6c04928ced4a7282ca3400e5d" + "8.0.1": + url: "https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip" + sha256: "a627a56eab9554fc1e5dd9a623d0768583b3a383ff70a4312ba68f94c9d415bf" + "7.1.3": + url: "https://github.com/fmtlib/fmt/releases/download/7.1.3/fmt-7.1.3.zip" + sha256: "5d98c504d0205f912e22449ecdea776b78ce0bb096927334f80781e720084c9f" + "6.2.1": + url: "https://github.com/fmtlib/fmt/releases/download/6.2.1/fmt-6.2.1.zip" + sha256: "94fea742ddcccab6607b517f6e608b1e5d63d712ddbc5982e44bafec5279881a" + "5.3.0": + url: "https://github.com/fmtlib/fmt/releases/download/5.3.0/fmt-5.3.0.zip" + sha256: "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c" +patches: + "5.3.0": + - patch_file: "patches/fix-install-5.3.0.patch" diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py new file mode 100644 index 0000000000000..862834c358047 --- /dev/null +++ b/recipes/fmt/all/conanfile.py @@ -0,0 +1,139 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version + +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" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "header_only": [True, False], + "shared": [True, False], + "fPIC": [True, False], + "with_fmt_alias": [True, False], + "with_os_api": [True, False], + } + default_options = { + "header_only": False, + "shared": False, + "fPIC": True, + "with_fmt_alias": False, + "with_os_api": True, + } + + @property + def _has_with_os_api_option(self): + return Version(self.version) >= "7.0.0" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_with_os_api_option: + del self.options.with_os_api + elif str(self.settings.os) == "baremetal": + self.options.with_os_api = False + + def configure(self): + if self.options.header_only: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + self.options.rm_safe("with_os_api") + elif self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + else: + del self.info.options.with_fmt_alias + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.cache_variables["FMT_DOC"] = False + tc.cache_variables["FMT_TEST"] = False + tc.cache_variables["FMT_INSTALL"] = True + tc.cache_variables["FMT_LIB_DIR"] = "lib" + if self._has_with_os_api_option: + tc.cache_variables["FMT_OS"] = bool(self.options.with_os_api) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if not self.options.header_only: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="*LICENSE.rst", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.options.header_only: + copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + target = "fmt-header-only" if self.options.header_only else "fmt" + self.cpp_info.set_property("cmake_file_name", "fmt") + self.cpp_info.set_property("cmake_target_name", f"fmt::{target}") + self.cpp_info.set_property("pkg_config_name", "fmt") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if self.options.with_fmt_alias: + self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") + + if self.options.header_only: + self.cpp_info.components["_fmt"].defines.append("FMT_HEADER_ONLY=1") + + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + else: + postfix = "d" if self.settings.build_type == "Debug" else "" + libname = "fmt" + postfix + self.cpp_info.components["_fmt"].libs = [libname] + if self.settings.os == "Linux": + self.cpp_info.components["_fmt"].system_libs.extend(["m"]) + if self.options.shared: + self.cpp_info.components["_fmt"].defines.append("FMT_SHARED") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "fmt" + self.cpp_info.names["cmake_find_package_multi"] = "fmt" + self.cpp_info.names["pkg_config"] = "fmt" + self.cpp_info.components["_fmt"].names["cmake_find_package"] = target + self.cpp_info.components["_fmt"].names["cmake_find_package_multi"] = target + self.cpp_info.components["_fmt"].set_property("cmake_target_name", f"fmt::{target}") diff --git a/recipes/fmt/all/patches/fix-install-5.3.0.patch b/recipes/fmt/all/patches/fix-install-5.3.0.patch new file mode 100644 index 0000000000000..b478cc0710e3b --- /dev/null +++ b/recipes/fmt/all/patches/fix-install-5.3.0.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -235,7 +235,9 @@ if (FMT_INSTALL) + + # Install the library and headers. + install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} +- DESTINATION ${FMT_LIB_DIR}) ++ LIBRARY DESTINATION ${FMT_LIB_DIR} ++ ARCHIVE DESTINATION ${FMT_LIB_DIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES $ DESTINATION ${FMT_LIB_DIR} OPTIONAL) + install(FILES ${FMT_HEADERS} DESTINATION ${FMT_INC_DIR}) diff --git a/recipes/fmt/all/patches/fix-install-6.0.0.patch b/recipes/fmt/all/patches/fix-install-6.0.0.patch new file mode 100644 index 0000000000000..c64f2ea628b1b --- /dev/null +++ b/recipes/fmt/all/patches/fix-install-6.0.0.patch @@ -0,0 +1,13 @@ +--- 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 new file mode 100644 index 0000000000000..4623c31cff962 --- /dev/null +++ b/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch @@ -0,0 +1,23 @@ +--- 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/CMakeLists.txt b/recipes/fmt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..98b237372b898 --- /dev/null +++ b/recipes/fmt/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fmt REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_compile_features(test_package PRIVATE cxx_std_14) +if(FMT_HEADER_ONLY) + target_link_libraries(test_package PRIVATE fmt::fmt-header-only) +else() + target_link_libraries(test_package PRIVATE fmt::fmt) +endif() + +add_executable(test_ranges test_ranges.cpp) +target_compile_features(test_ranges PRIVATE cxx_std_14) +if(FMT_HEADER_ONLY) + target_link_libraries(test_ranges PRIVATE fmt::fmt-header-only) +else() + target_link_libraries(test_ranges PRIVATE fmt::fmt) +endif() diff --git a/recipes/fmt/all/test_package/conanfile.py b/recipes/fmt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..943effe9479aa --- /dev/null +++ b/recipes/fmt/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FMT_HEADER_ONLY"] = self.dependencies[self.tested_reference_str].options.header_only + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindirs[0], "test_ranges"), env="conanrun") diff --git a/recipes/fmt/all/test_package/test_package.cpp b/recipes/fmt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bcd009407212d --- /dev/null +++ b/recipes/fmt/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + + +void vreport(const char *format, fmt::format_args args) { + fmt::vprint(format, args); +} + +template +void report(const char *format, const Args & ... args) { + vreport(format, fmt::make_format_args(args...)); +} + +class Date { + int year_, month_, day_; + public: + Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} + + friend std::ostream &operator<<(std::ostream &os, const Date &d) { + return os << d.year_ << '-' << d.month_ << '-' << d.day_; + } +}; + +#if FMT_VERSION >= 90000 +namespace fmt { + template <> struct formatter : ostream_formatter {}; +} +#endif + +int main() { + const std::string thing("World"); + fmt::print("PRINT: Hello {}!\n", thing); + fmt::printf("PRINTF: Hello, %s!\n", thing); + + const std::string formatted = fmt::format("{0}{1}{0}", "abra", "cad"); + fmt::print("{}\n", formatted); + + fmt::memory_buffer buf; + fmt::format_to(std::begin(buf), "{}", 2.7182818); + fmt::print("Euler number: {}\n", fmt::to_string(buf)); + + const std::string date = fmt::format("The date is {}\n", Date(2012, 12, 9)); + fmt::print(date); + + report("{} {} {}\n", "Conan", 42, 3.14159); + + fmt::print(std::cout, "{} {}\n", "Magic number", 42); + + fmt::print(fg(fmt::color::aqua), "Bincrafters\n"); + + return EXIT_SUCCESS; +} diff --git a/recipes/fmt/all/test_package/test_ranges.cpp b/recipes/fmt/all/test_package/test_ranges.cpp new file mode 100644 index 0000000000000..b808d6987b07e --- /dev/null +++ b/recipes/fmt/all/test_package/test_ranges.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "fmt/ranges.h" + +int main() { + std::vector numbers; + fmt::format_to(std::back_inserter(numbers), "{}{}{}", 1, 2, 3); + const std::string str_numbers = fmt::format("{}", numbers); + fmt::print("numbers: {}\n", str_numbers); + return EXIT_SUCCESS; +} diff --git a/recipes/fmt/all/test_v1_package/CMakeLists.txt b/recipes/fmt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/fmt/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/fmt/all/test_v1_package/conanfile.py b/recipes/fmt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f99cfc80791d2 --- /dev/null +++ b/recipes/fmt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["FMT_HEADER_ONLY"] = self.options["fmt"].header_only + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) + self.run(os.path.join("bin", "test_ranges"), run_environment=True) diff --git a/recipes/fmt/config.yml b/recipes/fmt/config.yml new file mode 100644 index 0000000000000..44e12e4e3ddc7 --- /dev/null +++ b/recipes/fmt/config.yml @@ -0,0 +1,17 @@ +versions: + "10.0.0": + folder: all + "9.1.0": + folder: all + "9.0.0": + folder: all + "8.1.1": + folder: all + "8.0.1": + folder: all + "7.1.3": + folder: all + "6.2.1": + folder: all + "5.3.0": + folder: all diff --git a/recipes/fmtlog/all/conandata.yml b/recipes/fmtlog/all/conandata.yml new file mode 100644 index 0000000000000..181d1e80ed96e --- /dev/null +++ b/recipes/fmtlog/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.2.1": + url: "https://github.com/MengRao/fmtlog/archive/refs/tags/v2.2.1.tar.gz" + sha256: "9bc2f1ea37eece0f4807689962b529d2d4fa07654baef184f051319b4eac9304" +patches: + "2.2.1": + - patch_file: "patches/2.2.1-0001-fix-cmake.patch" + patch_description: "make shared, static library separately" + patch_type: "conan" diff --git a/recipes/fmtlog/all/conanfile.py b/recipes/fmtlog/all/conanfile.py new file mode 100644 index 0000000000000..e1fd99b8fca24 --- /dev/null +++ b/recipes/fmtlog/all/conanfile.py @@ -0,0 +1,119 @@ +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.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "fmtlog" + description = "fmtlog is a performant fmtlib-style logging library with latency in nanoseconds." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MengRao/fmtlog" + topics = ("logging", "low-latency", "topic3") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + } + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "msvc": "191", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/9.1.0") + + def package_id(self): + if self.options.header_only: + self.info.clear() + + def validate(self): + # FIXME: self.info.settings.compiler does not work with header-only packages + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + 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._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + if self.options.header_only: + return + + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + if self.options.header_only: + return + 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) + if self.options.header_only: + copy(self, pattern="fmtlog*.h", dst=os.path.join(self.package_folder, "include", "fmtlog"), src=self.source_folder) + else: + cmake = CMake(self) + cmake.install() + + def package_info(self): + if self.options.header_only: + self.cpp_info.defines.append("FMTLOG_HEADER_ONLY") + else: + self.cpp_info.libs = ["fmtlog-shared" if self.options.shared else "fmtlog-static"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch b/recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..08354bb048c10 --- /dev/null +++ b/recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c45e569..6dc75d4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,23 +12,24 @@ else() + link_libraries(pthread) + endif() + +-link_directories(.) +-include_directories(fmt/include) ++find_package(fmt REQUIRED CONFIG) + ++if(BUILD_SHARED_LIBS) + add_library(fmtlog-shared SHARED fmtlog.cc) +-if(MSVC) +- target_link_libraries(fmtlog-shared fmt) ++if(1) ++ target_link_libraries(fmtlog-shared PUBLIC fmt::fmt) + endif() ++set_property(TARGET fmtlog-shared PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) + install(TARGETS fmtlog-shared) + ++else() ++ + add_library(fmtlog-static fmtlog.cc) +-if(MSVC) +- target_link_libraries(fmtlog-static fmt) ++if(1) ++ target_link_libraries(fmtlog-static PUBLIC fmt::fmt) + endif() + install(TARGETS fmtlog-static) + +-add_subdirectory(fmt) +-add_subdirectory(test) +-if(NOT MSVC) +- add_subdirectory(bench) + endif() ++ ++install(FILES fmtlog.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fmtlog) diff --git a/recipes/fmtlog/all/test_package/CMakeLists.txt b/recipes/fmtlog/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..42a1ef5c3a35e --- /dev/null +++ b/recipes/fmtlog/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(fmtlog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmtlog::fmtlog) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/fmtlog/all/test_package/conanfile.py b/recipes/fmtlog/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/fmtlog/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/fmtlog/all/test_package/test_package.cpp b/recipes/fmtlog/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..25429fa8fbed2 --- /dev/null +++ b/recipes/fmtlog/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include "fmtlog/fmtlog.h" +int main() +{ + FMTLOG(fmtlog::INF, "The answer is {}.", 42); +} diff --git a/recipes/fmtlog/all/test_v1_package/CMakeLists.txt b/recipes/fmtlog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..885bdb9ba0ee8 --- /dev/null +++ b/recipes/fmtlog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fmtlog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmtlog::fmtlog) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/fmtlog/all/test_v1_package/conanfile.py b/recipes/fmtlog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/fmtlog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fmtlog/config.yml b/recipes/fmtlog/config.yml new file mode 100644 index 0000000000000..a816d92f78ee3 --- /dev/null +++ b/recipes/fmtlog/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.1": + folder: all diff --git a/recipes/folly/all/CMakeLists.txt b/recipes/folly/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/folly/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml new file mode 100644 index 0000000000000..8fcc8945ab40d --- /dev/null +++ b/recipes/folly/all/conandata.yml @@ -0,0 +1,56 @@ +sources: + "2019.10.21.00": + url: "https://github.com/facebook/folly/archive/v2019.10.21.00.tar.gz" + sha256: "6efcc2b2090691a9fe3d339c433d102d6399bbdc6dc4893080d59f15f648f393" + "2020.08.10.00": + url: "https://github.com/facebook/folly/archive/v2020.08.10.00.tar.gz" + sha256: "e81140d04a4e89e3f848e528466a9b3d3ae37d7eeb9e65467fca50d70918eef6" + "2022.01.31.00": + url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz" + sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c" +patches: + "2019.10.21.00": + - patch_file: "patches/0001-find-packages.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-compiler-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-boost-shared-ptr.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-disable-posix-names.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-include-atomic.patch" + base_path: "source_subfolder" + - patch_file: "patches/0006-duplicate-hash.patch" + base_path: "source_subfolder" + - patch_file: "patches/0007-allow-builtins.patch" + base_path: "source_subfolder" + - patch_file: "patches/0013-include-bit.patch" + base_path: "source_subfolder" + - patch_file: "patches/0020-include-ssizet.patch" + base_path: "source_subfolder" + "2020.08.10.00": + - patch_file: "patches/0008-find-packages.patch" + base_path: "source_subfolder" + - patch_file: "patches/0009-ill-formed-atomic-copy.patch" + base_path: "source_subfolder" + - patch_file: "patches/0010-duplicate-hash.patch" + base_path: "source_subfolder" + - patch_file: "patches/0011-disable-logger-example.patch" + base_path: "source_subfolder" + - patch_file: "patches/0012-compiler-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0014-find-librt.patch" + base_path: "source_subfolder" + - patch_file: "patches/0015-benchmark-format-macros.patch" + base_path: "source_subfolder" + "2022.01.31.00": + - patch_file: "patches/0016-find-packages.patch" + base_path: "source_subfolder" + - patch_file: "patches/0017-compiler-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0018-find-glog.patch" + base_path: "source_subfolder" + - patch_file: "patches/0019-exclude-example.patch" + base_path: "source_subfolder" + - patch_file: "patches/0022-fix-windows-minmax.patch" + base_path: "source_subfolder" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py new file mode 100755 index 0000000000000..06dc6965155a7 --- /dev/null +++ b/recipes/folly/all/conanfile.py @@ -0,0 +1,307 @@ +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.build import can_run +from conan.tools.scm import Version +from conan.tools import files +from conan import ConanFile +from conans import CMake, tools +from conan.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.45.0" + + +class FollyConan(ConanFile): + name = "folly" + description = "An open-source C++ components library developed and used at Facebook" + topics = ("facebook", "components", "core", "efficiency") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/facebook/folly" + license = "Apache-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_sse4_2" : [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_sse4_2" : False + } + + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_cpp_standard(self): + return 17 if Version(self.version) >= "2022.01.31.00" else 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "6", + "apple-clang": "8", + } if self._minimum_cpp_standard == 14 else { + "gcc": "7", + "Visual Studio": "16", + "clang": "6", + "apple-clang": "10", + } + + 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 + + if str(self.settings.arch) not in ['x86', 'x86_64']: + del self.options.use_sse4_2 + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("boost/1.78.0") + self.requires("bzip2/1.0.8") + self.requires("double-conversion/3.2.0") + self.requires("gflags/2.2.2") + self.requires("glog/0.4.0") + self.requires("libevent/2.1.12") + self.requires("openssl/1.1.1q") + self.requires("lz4/1.9.3") + self.requires("snappy/1.1.9") + self.requires("zlib/1.2.12") + self.requires("zstd/1.5.2") + if not is_msvc(self): + self.requires("libdwarf/20191104") + self.requires("libsodium/1.0.18") + self.requires("xz_utils/5.2.5") + # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") + if self.settings.os == "Linux": + self.requires("libiberty/9.1.0") + self.requires("libunwind/1.5.0") + if Version(self.version) >= "2020.08.10.00": + self.requires("fmt/7.1.3") + + @property + def _required_boost_components(self): + return ["context", "filesystem", "program_options", "regex", "system", "thread"] + + 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 Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( + self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + + if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": + raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") + + if self.settings.os == "Macos" and self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") + + if self.settings.os == "Windows" and self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") + + if self.settings.os in ["Macos", "Windows"] and self.options.shared: + raise ConanInvalidConfiguration("Folly could not be built on {} as shared library".format(self.settings.os)) + + if Version(self.version) == "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: + raise ConanInvalidConfiguration("Folly could not be built by clang as a shared library") + + if self.options["boost"].header_only: + raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") + + miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) + if miss_boost_required_comp: + raise ConanInvalidConfiguration("Folly requires these boost components: {}".format(", ".join(self._required_boost_components))) + + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if not min_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) + else: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( + self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: + raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") + + # FIXME: Freeze max. CMake version at 3.16.2 to fix the Linux build + def build_requirements(self): + self.build_requires("cmake/3.16.9") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + if can_run(self): + cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" + cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" + cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" + cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" + cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" + cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" + cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" + cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" + + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: + # in folly, if simd >=sse4.2, we also needs -mfma flag to avoid compiling error. + if not is_msvc(self): + cmake.definitions["CMAKE_C_FLAGS"] = "-mfma" + cmake.definitions["CMAKE_CXX_FLAGS"] = "-mfma" + else: + cmake.definitions["CMAKE_C_FLAGS"] = "/arch:FMA" + cmake.definitions["CMAKE_CXX_FLAGS"] = "/arch:FMA" + + cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + + cxx_std_flag = tools.cppstd_flag(self.settings) + cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) + cmake.definitions["CXX_STD"] = cxx_std_value + if is_msvc: + cmake.definitions["MSVC_LANGUAGE_VERSION"] = cxx_std_value + cmake.definitions["MSVC_ENABLE_ALL_WARNINGS"] = False + cmake.definitions["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) + cmake.configure() + return cmake + + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "folly") + self.cpp_info.set_property("cmake_target_name", "Folly::folly") + self.cpp_info.set_property("pkg_config_name", "libfolly") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + if Version(self.version) == "2019.10.21.00": + self.cpp_info.components["libfolly"].libs = [ + "follybenchmark", + "folly_test_util", + "folly" + ] + elif Version(self.version) >= "2020.08.10.00": + if self.settings.os == "Linux": + self.cpp_info.components["libfolly"].libs = [ + "folly_exception_counter", + "folly_exception_tracer", + "folly_exception_tracer_base", + "folly_test_util", + "follybenchmark", + "folly" + ] + else: + self.cpp_info.components["libfolly"].libs = [ + "folly_test_util", + "follybenchmark", + "folly" + ] + + self.cpp_info.components["libfolly"].requires = [ + "boost::boost", + "bzip2::bzip2", + "double-conversion::double-conversion", + "gflags::gflags", + "glog::glog", + "libevent::libevent", + "lz4::lz4", + "openssl::openssl", + "snappy::snappy", + "zlib::zlib", + "zstd::zstd", + "libsodium::libsodium", + "xz_utils::xz_utils" + ] + if not is_msvc(self): + self.cpp_info.components["libfolly"].requires.append("libdwarf::libdwarf") + if self.settings.os == "Linux": + self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) + self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) + + if Version(self.version) >= "2020.08.10.00": + self.cpp_info.components["libfolly"].requires.append("fmt::fmt") + if self.settings.os == "Linux": + self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) + + elif self.settings.os == "Windows": + self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) + + if (self.settings.os == "Linux" and self.settings.compiler == "clang" and + self.settings.compiler.libcxx == "libstdc++") or \ + (self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and + Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"): + self.cpp_info.components["libfolly"].system_libs.append("atomic") + + if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": + self.cpp_info.components["libfolly"].system_libs.append("c++abi") + + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: + self.cpp_info.components["libfolly"].defines = ["FOLLY_SSE=4", "FOLLY_SSE_MINOR=2"] + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "folly" + self.cpp_info.filenames["cmake_find_package_multi"] = "folly" + self.cpp_info.names["cmake_find_package"] = "Folly" + self.cpp_info.names["cmake_find_package_multi"] = "Folly" + self.cpp_info.names["pkg_config"] = "libfolly" + self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" + self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" + self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") + self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") + + if Version(self.version) >= "2019.10.21.00": + self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") + self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") + self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] + self.cpp_info.components["follybenchmark"].requires = ["libfolly"] + + self.cpp_info.components["folly_test_util"].set_property("cmake_target_name", "Folly::folly_test_util") + self.cpp_info.components["folly_test_util"].set_property("pkg_config_name", "libfolly_test_util") + self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] + self.cpp_info.components["folly_test_util"].requires = ["libfolly"] + + if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux": + self.cpp_info.components["folly_exception_tracer_base"].set_property("cmake_target_name", "Folly::folly_exception_tracer_base") + self.cpp_info.components["folly_exception_tracer_base"].set_property("pkg_config_name", "libfolly_exception_tracer_base") + self.cpp_info.components["folly_exception_tracer_base"].libs = ["folly_exception_tracer_base"] + self.cpp_info.components["folly_exception_tracer_base"].requires = ["libfolly"] + + self.cpp_info.components["folly_exception_tracer"].set_property("cmake_target_name", "Folly::folly_exception_tracer") + self.cpp_info.components["folly_exception_tracer"].set_property("pkg_config_name", "libfolly_exception_tracer") + self.cpp_info.components["folly_exception_tracer"].libs = ["folly_exception_tracer"] + self.cpp_info.components["folly_exception_tracer"].requires = ["folly_exception_tracer_base"] + + self.cpp_info.components["folly_exception_counter"].set_property("cmake_target_name", "Folly::folly_exception_counter") + self.cpp_info.components["folly_exception_counter"].set_property("pkg_config_name", "libfolly_exception_counter") + self.cpp_info.components["folly_exception_counter"].libs = ["folly_exception_counter"] + self.cpp_info.components["folly_exception_counter"].requires = ["folly_exception_tracer"] diff --git a/recipes/folly/all/patches/0001-find-packages.patch b/recipes/folly/all/patches/0001-find-packages.patch new file mode 100644 index 0000000000000..4cee77cd34c1c --- /dev/null +++ b/recipes/folly/all/patches/0001-find-packages.patch @@ -0,0 +1,93 @@ +diff --git a/CMake/FindLibsodium.cmake b/CMake/FindLibsodium.cmake +index 18d4d0c..2b3cd2a 100644 +--- a/CMake/FindLibsodium.cmake ++++ b/CMake/FindLibsodium.cmake +@@ -15,7 +15,7 @@ + find_path(LIBSODIUM_INCLUDE_DIR NAMES sodium.h) + mark_as_advanced(LIBSODIUM_INCLUDE_DIR) + +-find_library(LIBSODIUM_LIBRARY NAMES sodium) ++find_library(LIBSODIUM_LIBRARY NAMES sodium libsodium PATHS ${CONAN_LIBSODIUM_ROOT}) + mark_as_advanced(LIBSODIUM_LIBRARY) + + include(FindPackageHandleStandardArgs) +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 048e1cd..da3ab8e 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -36,19 +36,19 @@ find_package(DoubleConversion MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) + +-find_package(Gflags MODULE) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +-list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) +-list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) +- +-find_package(Glog MODULE) ++find_package(gflags MODULE REQUIRED) ++set(FOLLY_HAVE_LIBGFLAGS ${GFLAGS_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${CONAN_LIBS_GFLAGS}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_GFLAGS}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARY}) ++list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) ++ ++find_package(glog MODULE) + set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) + list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) ++find_package(Libevent MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + +diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake +index 246ceac..385605e 100644 +--- a/build/fbcode_builder/CMake/FindGflags.cmake ++++ b/build/fbcode_builder/CMake/FindGflags.cmake +@@ -48,8 +48,13 @@ if (gflags_FOUND) + else() + FIND_PATH(LIBGFLAGS_INCLUDE_DIR gflags/gflags.h) + +- FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_staticd) +- FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_static) ++ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_nothreads_staticd gflags_nothreads_static_debug PATHS ${CONAN_GFLAGS_ROOT}) ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_nothreads_static PATHS ${CONAN_GFLAGS_ROOT}) ++ else() ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflags gflags_nothreads_debug PATHS ${CONAN_GFLAGS_ROOT}) ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags_nothreads gflags PATHS ${CONAN_GFLAGS_ROOT}) ++ endif() + + INCLUDE(SelectLibraryConfigurations) + SELECT_LIBRARY_CONFIGURATIONS(LIBGFLAGS) +diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake +index a589b2e..15aef75 100644 +--- a/build/fbcode_builder/CMake/FindGlog.cmake ++++ b/build/fbcode_builder/CMake/FindGlog.cmake +@@ -8,8 +8,7 @@ + + include(FindPackageHandleStandardArgs) + +-find_library(GLOG_LIBRARY glog +- PATHS ${GLOG_LIBRARYDIR}) ++find_library(GLOG_LIBRARY glog glogd PATHS ${CONAN_GLOG_ROOT}) + + find_path(GLOG_INCLUDE_DIR glog/logging.h + PATHS ${GLOG_INCLUDEDIR}) +diff --git a/build/fbcode_builder/CMake/FindLibEvent.cmake b/build/fbcode_builder/CMake/FindLibEvent.cmake +index dd11ebd..9ef0807 100644 +--- a/build/fbcode_builder/CMake/FindLibEvent.cmake ++++ b/build/fbcode_builder/CMake/FindLibEvent.cmake +@@ -50,7 +50,7 @@ if (TARGET event) + endif() + else() + find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LibEvent_INCLUDE_PATHS}) +- find_library(LIBEVENT_LIB NAMES event PATHS ${LibEvent_LIB_PATHS}) ++ find_library(LIBEVENT_LIB NAMES event libevent PATHS ${CONAN_LIBEVENT_ROOT}) + + if (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR) + set(LibEvent_FOUND TRUE) diff --git a/recipes/folly/all/patches/0002-compiler-flags.patch b/recipes/folly/all/patches/0002-compiler-flags.patch new file mode 100644 index 0000000000000..b9213ff6d4895 --- /dev/null +++ b/recipes/folly/all/patches/0002-compiler-flags.patch @@ -0,0 +1,24 @@ +diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake +index 7fba75f..019d30f 100644 +--- a/CMake/FollyCompilerUnix.cmake ++++ b/CMake/FollyCompilerUnix.cmake +@@ -28,9 +28,9 @@ set( + ) + mark_as_advanced(CXX_STD) + +-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") ++set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") + + # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") +@@ -44,7 +44,6 @@ function(apply_folly_compile_options_to_target THETARGET) + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -std=${CXX_STD} + -finput-charset=UTF-8 + -fsigned-char diff --git a/recipes/folly/all/patches/0003-boost-shared-ptr.patch b/recipes/folly/all/patches/0003-boost-shared-ptr.patch new file mode 100644 index 0000000000000..7608d6b2e9e2b --- /dev/null +++ b/recipes/folly/all/patches/0003-boost-shared-ptr.patch @@ -0,0 +1,24 @@ +diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp +index f8cd6d4..0908668 100644 +--- a/folly/portability/PThread.cpp ++++ b/folly/portability/PThread.cpp +@@ -18,7 +18,9 @@ + + #if !FOLLY_HAVE_PTHREAD && defined(_WIN32) + #include // @manual +- ++#include ++#include ++#include + #include + + #include +@@ -683,7 +685,7 @@ int pthread_setspecific(pthread_key_t key, const void* value) { + // function, which we don't want to do. + boost::detail::set_tss_data( + realKey, +- boost::shared_ptr(), ++ 0,0, + const_cast(value), + false); + return 0; diff --git a/recipes/folly/all/patches/0004-disable-posix-names.patch b/recipes/folly/all/patches/0004-disable-posix-names.patch new file mode 100644 index 0000000000000..9efd4e24140e1 --- /dev/null +++ b/recipes/folly/all/patches/0004-disable-posix-names.patch @@ -0,0 +1,27 @@ +diff --git a/folly/portability/Windows.h b/folly/portability/Windows.h +index f7990ca..b22fac5 100644 +--- a/folly/portability/Windows.h ++++ b/folly/portability/Windows.h +@@ -26,16 +26,12 @@ + // These have to be this way because we define our own versions + // of close(), because the normal Windows versions don't handle + // sockets at all. +-#ifndef __STDC__ +-/* nolint */ +-#define __STDC__ 1 +-#include // @manual nolint +-#include // @manual nolint +-#undef __STDC__ +-#else +-#include // @manual nolint +-#include // @manual nolint +-#endif ++#include ++#pragma push_macro("_CRT_INTERNAL_NONSTDC_NAMES") ++#define _CRT_INTERNAL_NONSTDC_NAMES 0 ++#include ++#include ++#pragma pop_macro("_CRT_INTERNAL_NONSTDC_NAMES") + + #if defined(min) || defined(max) + #error Windows.h needs to be included by this header, or else NOMINMAX needs \ diff --git a/recipes/folly/all/patches/0005-include-atomic.patch b/recipes/folly/all/patches/0005-include-atomic.patch new file mode 100644 index 0000000000000..0eb9382e49a9d --- /dev/null +++ b/recipes/folly/all/patches/0005-include-atomic.patch @@ -0,0 +1,12 @@ +diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp +index 2891c4c..7c98975 100644 +--- a/folly/portability/PThread.cpp ++++ b/folly/portability/PThread.cpp +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/recipes/folly/all/patches/0006-duplicate-hash.patch b/recipes/folly/all/patches/0006-duplicate-hash.patch new file mode 100644 index 0000000000000..f8905d003157e --- /dev/null +++ b/recipes/folly/all/patches/0006-duplicate-hash.patch @@ -0,0 +1,13 @@ +diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h +index 33fa553..4266cf1 100644 +--- a/folly/hash/Hash.h ++++ b/folly/hash/Hash.h +@@ -730,7 +730,7 @@ struct TupleHasher<0, Ts...> { + + // Custom hash functions. + namespace std { +-#if FOLLY_SUPPLY_MISSING_INT128_TRAITS ++#if 0 + template <> + struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; + diff --git a/recipes/folly/all/patches/0007-allow-builtins.patch b/recipes/folly/all/patches/0007-allow-builtins.patch new file mode 100644 index 0000000000000..de09722f02acc --- /dev/null +++ b/recipes/folly/all/patches/0007-allow-builtins.patch @@ -0,0 +1,128 @@ +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index 971cb8819..e68de4456 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -41,7 +41,6 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { + } + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { + unsigned long index; + return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -93,7 +92,6 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -119,15 +117,12 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + #endif + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -138,7 +133,6 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... +-- + +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index e68de4456..30caf4003 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -16,7 +16,7 @@ + + #pragma once + +-#if defined(_WIN32) && !defined(__clang__) ++#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__) + #include + #include + #include +-- +see https://github.com/facebook/folly/issues/1412 +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index 30caf4003..e8ef97266 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -22,6 +22,14 @@ + #include + #include + ++// MSVC had added support for __builtin_clz etc. in 16.3 (1923) but it will be ++// removed in 16.8 (1928). ++#if (_MSC_VER >= 1923) && (_MSC_VER < 1928) ++#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 1 ++#else ++#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 0 ++#endif ++ + namespace folly { + namespace portability { + namespace detail { +@@ -41,6 +49,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { + } + } + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { + unsigned long index; + return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -92,6 +101,7 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -117,12 +127,15 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + #endif + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -133,6 +146,7 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... +@@ -141,3 +155,5 @@ FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + return _ReturnAddress(); + } + #endif ++ ++#undef FOLLY_DETAIL_MSC_BUILTIN_SUPPORT +-- + diff --git a/recipes/folly/all/patches/0008-find-packages.patch b/recipes/folly/all/patches/0008-find-packages.patch new file mode 100644 index 0000000000000..3329a68425e3b --- /dev/null +++ b/recipes/folly/all/patches/0008-find-packages.patch @@ -0,0 +1,73 @@ +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 3169b972d52..23dc6d509b1 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -46,11 +46,11 @@ find_package(Boost 1.51.0 MODULE + list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) + +-find_package(DoubleConversion MODULE REQUIRED) ++find_package(double-conversion MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) + +-find_package(Gflags MODULE) ++find_package(gflags MODULE) + set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) + if(LIBGFLAGS_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +@@ -59,12 +59,12 @@ if(LIBGFLAGS_FOUND) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) + endif() + +-find_package(Glog MODULE) ++find_package(glog MODULE) + set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) + list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) ++find_package(Libevent MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + +@@ -96,14 +96,14 @@ if (LIBLZMA_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + +-find_package(LZ4 MODULE) ++find_package(lz4 MODULE) + set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) + if (LZ4_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) + list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) + endif() + +-find_package(Zstd MODULE) ++find_package(zstd MODULE) + set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) + if(ZSTD_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +@@ -117,11 +117,11 @@ if (SNAPPY_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) + endif() + +-find_package(LibDwarf) ++find_package(libdwarf) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) + +-find_package(Libiberty) ++find_package(libiberty) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) + +@@ -133,7 +133,7 @@ find_package(LibUring) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) + +-find_package(Libsodium) ++find_package(libsodium) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) + diff --git a/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch b/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch new file mode 100644 index 0000000000000..58f95224f3873 --- /dev/null +++ b/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch @@ -0,0 +1,13 @@ +diff --git a/folly/fibers/SemaphoreBase.cpp b/folly/fibers/SemaphoreBase.cpp +index 06e9ecc7111..77e2da75c18 100644 +--- a/folly/fibers/SemaphoreBase.cpp ++++ b/folly/fibers/SemaphoreBase.cpp +@@ -170,7 +170,7 @@ namespace { + class FutureWaiter final : public fibers::Baton::Waiter { + public: + explicit FutureWaiter(int64_t tokens) +- : semaphoreWaiter(SemaphoreBase::Waiter(tokens)) { ++ : semaphoreWaiter(tokens) { + semaphoreWaiter.baton.setWaiter(*this); + } + diff --git a/recipes/folly/all/patches/0010-duplicate-hash.patch b/recipes/folly/all/patches/0010-duplicate-hash.patch new file mode 100644 index 0000000000000..69268c6acf6f6 --- /dev/null +++ b/recipes/folly/all/patches/0010-duplicate-hash.patch @@ -0,0 +1,13 @@ +diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h +index a8a50e8e8dc..d7a3da8e61f 100644 +--- a/folly/hash/Hash.h ++++ b/folly/hash/Hash.h +@@ -733,7 +733,7 @@ struct TupleHasher<0, Ts...> { + + // Custom hash functions. + namespace std { +-#if FOLLY_SUPPLY_MISSING_INT128_TRAITS ++#if 0 + template <> + struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; + diff --git a/recipes/folly/all/patches/0011-disable-logger-example.patch b/recipes/folly/all/patches/0011-disable-logger-example.patch new file mode 100644 index 0000000000000..fa20905367fb1 --- /dev/null +++ b/recipes/folly/all/patches/0011-disable-logger-example.patch @@ -0,0 +1,12 @@ +diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt +index 08de7daf20f..cdc1f03bf46 100644 +--- a/folly/CMakeLists.txt ++++ b/folly/CMakeLists.txt +@@ -27,7 +27,6 @@ install( + ) + + add_subdirectory(experimental/exception_tracer) +-add_subdirectory(logging/example) + + if (PYTHON_EXTENSIONS) + # Create tree of symbolic links in structure required for successful diff --git a/recipes/folly/all/patches/0012-compiler-flags.patch b/recipes/folly/all/patches/0012-compiler-flags.patch new file mode 100644 index 0000000000000..358500a1800cd --- /dev/null +++ b/recipes/folly/all/patches/0012-compiler-flags.patch @@ -0,0 +1,24 @@ +diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake +index 8dcaf141a3a..200fe8d3798 100644 +--- a/CMake/FollyCompilerUnix.cmake ++++ b/CMake/FollyCompilerUnix.cmake +@@ -28,9 +28,9 @@ set( + ) + mark_as_advanced(CXX_STD) + +-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") ++set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") + + # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") +@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -std=${CXX_STD} + -finput-charset=UTF-8 + -fsigned-char diff --git a/recipes/folly/all/patches/0013-include-bit.patch b/recipes/folly/all/patches/0013-include-bit.patch new file mode 100644 index 0000000000000..1a8ac249a146b --- /dev/null +++ b/recipes/folly/all/patches/0013-include-bit.patch @@ -0,0 +1,13 @@ +--- a/folly/lang/Bits.h ++++ b/folly/lang/Bits.h +@@ -64,6 +64,10 @@ + #include + #include + ++#if __has_include() && __cpp_lib_bit_cast ++#include ++#endif ++ + namespace folly { + + #if __cpp_lib_bit_cast diff --git a/recipes/folly/all/patches/0014-find-librt.patch b/recipes/folly/all/patches/0014-find-librt.patch new file mode 100644 index 0000000000000..90a1f0f7b9ada --- /dev/null +++ b/recipes/folly/all/patches/0014-find-librt.patch @@ -0,0 +1,18 @@ +diff --git a/CMake/FollyConfigChecks.cmake b/CMake/FollyConfigChecks.cmake +index 6b8b308c7..908d72d51 100644 +--- a/CMake/FollyConfigChecks.cmake ++++ b/CMake/FollyConfigChecks.cmake +@@ -83,6 +83,13 @@ string(REGEX REPLACE + CMAKE_REQUIRED_FLAGS + "${CMAKE_REQUIRED_FLAGS}") + ++if (CMAKE_SYSTEM_NAME STREQUAL "Linux") ++ find_library(LIBRT rt) ++ if (LIBRT) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES "rt") ++ endif() ++endif() ++ + check_symbol_exists(pthread_atfork pthread.h FOLLY_HAVE_PTHREAD_ATFORK) + + # Unfortunately check_symbol_exists() does not work for memrchr(): diff --git a/recipes/folly/all/patches/0015-benchmark-format-macros.patch b/recipes/folly/all/patches/0015-benchmark-format-macros.patch new file mode 100644 index 0000000000000..14f8b2088a1b3 --- /dev/null +++ b/recipes/folly/all/patches/0015-benchmark-format-macros.patch @@ -0,0 +1,15 @@ +diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp +index 389ee46a1..390b7674b 100644 +--- a/folly/Benchmark.cpp ++++ b/folly/Benchmark.cpp +@@ -16,6 +16,10 @@ + + // @author Andrei Alexandrescu (andrei.alexandrescu@fb.com) + ++#ifndef __STDC_FORMAT_MACROS ++#define __STDC_FORMAT_MACROS 1 ++#endif ++ + #include + + #include diff --git a/recipes/folly/all/patches/0016-find-packages.patch b/recipes/folly/all/patches/0016-find-packages.patch new file mode 100644 index 0000000000000..c6cd14fad52c9 --- /dev/null +++ b/recipes/folly/all/patches/0016-find-packages.patch @@ -0,0 +1,80 @@ +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 9c9d9ea60..e78611542 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -48,25 +48,25 @@ find_package(Boost 1.51.0 MODULE + list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) + +-find_package(DoubleConversion MODULE REQUIRED) ++find_package(double-conversion MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) + +-find_package(Gflags MODULE) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-if(LIBGFLAGS_FOUND) +- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) +- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) ++find_package(gflags MODULE) ++set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) ++if(gflags_FOUND) ++ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIRS}) ++ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) ++ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIRS}) + endif() + +-find_package(Glog MODULE) ++find_package(glog MODULE) + set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) + list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) ++find_package(Libevent MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + +@@ -104,14 +104,14 @@ if (LIBLZMA_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + +-find_package(LZ4 MODULE) ++find_package(lz4 MODULE) + set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) + if (LZ4_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) + list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) + endif() + +-find_package(Zstd MODULE) ++find_package(zstd MODULE) + set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) + if(ZSTD_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +@@ -125,11 +125,11 @@ if (SNAPPY_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) + endif() + +-find_package(LibDwarf) ++find_package(libdwarf) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) + +-find_package(Libiberty) ++find_package(libiberty) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) + +@@ -141,7 +141,7 @@ find_package(LibUring) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) + +-find_package(Libsodium) ++find_package(libsodium) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) + diff --git a/recipes/folly/all/patches/0017-compiler-flags.patch b/recipes/folly/all/patches/0017-compiler-flags.patch new file mode 100644 index 0000000000000..1290e801ba4ba --- /dev/null +++ b/recipes/folly/all/patches/0017-compiler-flags.patch @@ -0,0 +1,24 @@ +diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake +index 8dcaf14..200fe8d 100644 +--- a/CMake/FollyCompilerUnix.cmake ++++ b/CMake/FollyCompilerUnix.cmake +@@ -28,9 +28,9 @@ set( + ) + mark_as_advanced(CXX_STD) + +-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") ++set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") + + # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") +@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -std=${CXX_STD} + -finput-charset=UTF-8 + -fsigned-char diff --git a/recipes/folly/all/patches/0018-find-glog.patch b/recipes/folly/all/patches/0018-find-glog.patch new file mode 100644 index 0000000000000..b2d17ad455a7b --- /dev/null +++ b/recipes/folly/all/patches/0018-find-glog.patch @@ -0,0 +1,16 @@ +diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake +index 752647c..aa2fa1c 100644 +--- a/build/fbcode_builder/CMake/FindGlog.cmake ++++ b/build/fbcode_builder/CMake/FindGlog.cmake +@@ -10,9 +10,9 @@ include(FindPackageHandleStandardArgs) + include(SelectLibraryConfigurations) + + find_library(GLOG_LIBRARY_RELEASE glog +- PATHS ${GLOG_LIBRARYDIR}) ++ PATHS ${CONAN_GLOG_ROOT}) + find_library(GLOG_LIBRARY_DEBUG glogd +- PATHS ${GLOG_LIBRARYDIR}) ++ PATHS ${CONAN_GLOG_ROOT}) + + find_path(GLOG_INCLUDE_DIR glog/logging.h + PATHS ${GLOG_INCLUDEDIR}) diff --git a/recipes/folly/all/patches/0019-exclude-example.patch b/recipes/folly/all/patches/0019-exclude-example.patch new file mode 100644 index 0000000000000..d2afb310ff8a0 --- /dev/null +++ b/recipes/folly/all/patches/0019-exclude-example.patch @@ -0,0 +1,12 @@ +diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt +index 883f27c..2d2086f 100644 +--- a/folly/CMakeLists.txt ++++ b/folly/CMakeLists.txt +@@ -28,7 +28,6 @@ install( + ) + + add_subdirectory(experimental/exception_tracer) +-add_subdirectory(logging/example) + + if (PYTHON_EXTENSIONS) + # Create tree of symbolic links in structure required for successful diff --git a/recipes/folly/all/patches/0020-include-ssizet.patch b/recipes/folly/all/patches/0020-include-ssizet.patch new file mode 100644 index 0000000000000..0575fecd13e84 --- /dev/null +++ b/recipes/folly/all/patches/0020-include-ssizet.patch @@ -0,0 +1,12 @@ +diff --git a/folly/executors/ExecutorWithPriority.h b/folly/executors/ExecutorWithPriority.h +index b95a6c4..18b8110 100644 +--- a/folly/executors/ExecutorWithPriority.h ++++ b/folly/executors/ExecutorWithPriority.h +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + namespace folly { + diff --git a/recipes/folly/all/patches/0021-typedef-clockid.patch b/recipes/folly/all/patches/0021-typedef-clockid.patch new file mode 100644 index 0000000000000..fb46c057d58ce --- /dev/null +++ b/recipes/folly/all/patches/0021-typedef-clockid.patch @@ -0,0 +1,12 @@ +diff --git a/folly/portability/Time.h b/folly/portability/Time.h +index 994a09e5d70..e4f0d101ca9 100644 +--- a/folly/portability/Time.h ++++ b/folly/portability/Time.h +@@ -49,7 +49,6 @@ + #define CLOCK_PROCESS_CPUTIME_ID 2 + #define CLOCK_THREAD_CPUTIME_ID 3 + +-typedef uint8_t clockid_t; + extern "C" int clock_gettime(clockid_t clk_id, struct timespec* ts); + extern "C" int clock_getres(clockid_t clk_id, struct timespec* ts); + #endif diff --git a/recipes/folly/all/patches/0022-fix-windows-minmax.patch b/recipes/folly/all/patches/0022-fix-windows-minmax.patch new file mode 100644 index 0000000000000..1fc69a43a83e5 --- /dev/null +++ b/recipes/folly/all/patches/0022-fix-windows-minmax.patch @@ -0,0 +1,12 @@ +diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake +index ec2ce1a1d..16deda71c 100644 +--- a/CMake/FollyCompilerMSVC.cmake ++++ b/CMake/FollyCompilerMSVC.cmake +@@ -289,6 +289,7 @@ function(apply_folly_compile_options_to_target THETARGET) + # And the extra defines: + target_compile_definitions(${THETARGET} + PUBLIC ++ NOMINMAX + _CRT_NONSTDC_NO_WARNINGS # Don't deprecate posix names of functions. + _CRT_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. + _SCL_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. diff --git a/recipes/folly/all/test_package/CMakeLists.txt b/recipes/folly/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a9df4ea0b752 --- /dev/null +++ b/recipes/folly/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(folly REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} + Folly::folly + Folly::follybenchmark) + + +if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +endif() diff --git a/recipes/folly/all/test_package/conanfile.py b/recipes/folly/all/test_package/conanfile.py new file mode 100644 index 0000000000000..63889d5258fa5 --- /dev/null +++ b/recipes/folly/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + +required_conan_version = ">=1.43.0" + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FOLLY_VERSION"] = self.dependencies["folly"].ref.version + tc.generate() + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/folly/all/test_package/test_package.cpp b/recipes/folly/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cc522b8b0280d --- /dev/null +++ b/recipes/folly/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#if FOLLY_HAVE_ELF +#include +#endif + +static void print_uri(const folly::fbstring& value) { + const folly::Uri uri(value); + std::cout << "The authority from " << value << " is " << uri.authority() << std::endl; +} + +int main() { + folly::ThreadedExecutor executor; + folly::Promise promise; + folly::Future future = promise.getSemiFuture().via(&executor); + folly::Future unit = std::move(future).thenValue(print_uri); + promise.setValue("https://github.com/bincrafters"); + std::move(unit).get(); +#if FOLLY_HAVE_ELF + folly::symbolizer::ElfFile elffile; +#endif + return EXIT_SUCCESS; +} diff --git a/recipes/folly/all/test_v1_package/CMakeLists.txt b/recipes/folly/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f8cc697ab67d2 --- /dev/null +++ b/recipes/folly/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(folly CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} Folly::folly) + + +if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +endif() diff --git a/recipes/folly/all/test_v1_package/conanfile.py b/recipes/folly/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8b8cfae4c1882 --- /dev/null +++ b/recipes/folly/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["FOLLY_VERSION"] = self.deps_cpp_info["folly"].version + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(command=bin_path, run_environment=True) diff --git a/recipes/folly/all/test_v1_package/test_package.cpp b/recipes/folly/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..cc522b8b0280d --- /dev/null +++ b/recipes/folly/all/test_v1_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#if FOLLY_HAVE_ELF +#include +#endif + +static void print_uri(const folly::fbstring& value) { + const folly::Uri uri(value); + std::cout << "The authority from " << value << " is " << uri.authority() << std::endl; +} + +int main() { + folly::ThreadedExecutor executor; + folly::Promise promise; + folly::Future future = promise.getSemiFuture().via(&executor); + folly::Future unit = std::move(future).thenValue(print_uri); + promise.setValue("https://github.com/bincrafters"); + std::move(unit).get(); +#if FOLLY_HAVE_ELF + folly::symbolizer::ElfFile elffile; +#endif + return EXIT_SUCCESS; +} diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml new file mode 100644 index 0000000000000..6a14a274c3fe9 --- /dev/null +++ b/recipes/folly/config.yml @@ -0,0 +1,7 @@ +versions: + "2019.10.21.00": + folder: all + "2020.08.10.00": + folder: all + "2022.01.31.00": + folder: all diff --git a/recipes/fontconfig/all/conandata.yml b/recipes/fontconfig/all/conandata.yml new file mode 100644 index 0000000000000..d4f92f5455a44 --- /dev/null +++ b/recipes/fontconfig/all/conandata.yml @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..c44276116659f --- /dev/null +++ b/recipes/fontconfig/all/conanfile.py @@ -0,0 +1,150 @@ +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.0") + self.requires("expat/2.5.0") + if self.settings.os == "Linux": + self.requires("libuuid/1.0.3") + + 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/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], 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 new file mode 100644 index 0000000000000..5def13d67bcff --- /dev/null +++ b/recipes/fontconfig/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/fontconfig/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fontconfig/all/test_package/test_package.c b/recipes/fontconfig/all/test_package/test_package.c new file mode 100644 index 0000000000000..7703ab64bbdec --- /dev/null +++ b/recipes/fontconfig/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() { + FcConfig* config = FcInitLoadConfigAndFonts(); + FcPattern* pat = FcNameParse((const FcChar8*)"Arial"); + FcConfigSubstitute(config, pat, FcMatchPattern); + FcDefaultSubstitute(pat); + char* fontFile; + FcResult result; + FcPattern* font = FcFontMatch(config, pat, &result); + if (font) { + FcChar8* file = NULL; + if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) { + fontFile = (char*)file; + printf("%s\n",fontFile); + } + } else { + printf("Ops! I can't find any font!\n"); + } + FcPatternDestroy(pat); + return EXIT_SUCCESS; +} diff --git a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fontconfig/all/test_v1_package/conanfile.py b/recipes/fontconfig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/fontconfig/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fontconfig/config.yml b/recipes/fontconfig/config.yml new file mode 100644 index 0000000000000..a3042d0ed624f --- /dev/null +++ b/recipes/fontconfig/config.yml @@ -0,0 +1,9 @@ +versions: + "2.14.2": + folder: meson + "2.13.93": + folder: meson + "2.13.92": + folder: all + "2.13.91": + folder: all diff --git a/recipes/fontconfig/meson/conandata.yml b/recipes/fontconfig/meson/conandata.yml new file mode 100644 index 0000000000000..e2b11bfd27f49 --- /dev/null +++ b/recipes/fontconfig/meson/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.14.2": + url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.14.2.tar.xz" + sha256: "dba695b57bce15023d2ceedef82062c2b925e51f5d4cc4aef736cf13f60a468b" + "2.13.93": + url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.93.tar.gz" + sha256: "0f302a18ee52dde0793fe38b266bf269dfe6e0c0ae140e30d72c6cca5dc08db5" +patches: + "2.13.93": + - patch_file: "patches/0001-meson-win32.patch" + patch_type: "portability" + patch_source: "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/7bfbaecf819a8b1630dfc8f56126e31f985d5fb3" + patch_description: "Windows: Fix symlink privilege error detection" diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py new file mode 100644 index 0000000000000..7effda31e1c9d --- /dev/null +++ b/recipes/fontconfig/meson/conanfile.py @@ -0,0 +1,142 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, copy, export_conandata_patches, get, + 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 +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.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, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("freetype/2.13.0") + self.requires("expat/2.5.0") + if self.settings.os == "Linux": + self.requires("libuuid/1.0.3") + + def build_requirements(self): + self.tool_requires("gperf/3.1") + self.tool_requires("meson/1.0.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + tc = MesonToolchain(self) + tc.project_options.update({ + "doc": "disabled", + "nls": "disabled", + "tests": "disabled", + "tools": "disabled" + }) + 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() + 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() + 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")) + 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) + + 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 + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/fontconfig/meson/patches/0001-meson-win32.patch b/recipes/fontconfig/meson/patches/0001-meson-win32.patch new file mode 100644 index 0000000000000..c8a4911fc8e45 --- /dev/null +++ b/recipes/fontconfig/meson/patches/0001-meson-win32.patch @@ -0,0 +1,19 @@ +--- conf.d/link_confs.py ++++ conf.d/link_confs.py +@@ -3,6 +3,7 @@ + import os + import sys + import argparse ++import platform + + if __name__=='__main__': + parser = argparse.ArgumentParser() +@@ -26,7 +27,7 @@ if __name__=='__main__': + break + except OSError as e: + # Symlink privileges are not available +- if len(e.args) == 1 and 'privilege' in e.args[0]: ++ if platform.system().lower() == 'windows' and e.winerror == 1314: + break + raise + except FileExistsError: diff --git a/recipes/fontconfig/meson/test_package/CMakeLists.txt b/recipes/fontconfig/meson/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5def13d67bcff --- /dev/null +++ b/recipes/fontconfig/meson/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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/meson/test_package/conanfile.py b/recipes/fontconfig/meson/test_package/conanfile.py new file mode 100644 index 0000000000000..42aa9d19c7fbe --- /dev/null +++ b/recipes/fontconfig/meson/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 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/meson/test_package/test_package.c b/recipes/fontconfig/meson/test_package/test_package.c new file mode 100644 index 0000000000000..7703ab64bbdec --- /dev/null +++ b/recipes/fontconfig/meson/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() { + FcConfig* config = FcInitLoadConfigAndFonts(); + FcPattern* pat = FcNameParse((const FcChar8*)"Arial"); + FcConfigSubstitute(config, pat, FcMatchPattern); + FcDefaultSubstitute(pat); + char* fontFile; + FcResult result; + FcPattern* font = FcFontMatch(config, pat, &result); + if (font) { + FcChar8* file = NULL; + if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) { + fontFile = (char*)file; + printf("%s\n",fontFile); + } + } else { + printf("Ops! I can't find any font!\n"); + } + FcPatternDestroy(pat); + return EXIT_SUCCESS; +} diff --git a/recipes/fontconfig/meson/test_v1_package/CMakeLists.txt b/recipes/fontconfig/meson/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9e65290cb3f89 --- /dev/null +++ b/recipes/fontconfig/meson/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/ +) diff --git a/recipes/fontconfig/meson/test_v1_package/conanfile.py b/recipes/fontconfig/meson/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/fontconfig/meson/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/foonathan-lexy/all/conandata.yml b/recipes/foonathan-lexy/all/conandata.yml new file mode 100644 index 0000000000000..98cd033191be3 --- /dev/null +++ b/recipes/foonathan-lexy/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2022.12.1": + url: "https://github.com/foonathan/lexy/releases/download/v2022.12.1/lexy-src.zip" + sha256: "4c16efd31d03f908c7125352ebacbdb6c028de3788ca56940175e7017dbc6c7f" + "2022.12.00": + url: "https://github.com/foonathan/lexy/releases/download/v2022.12.0/lexy-src.zip" + sha256: "62afda502963abce28f051416b977dcc8f11581ba0773f4b1da39a9b4842b19d" + "2022.05.01": + url: "https://github.com/foonathan/lexy/releases/download/v2022.05.1/lexy-src.zip" + sha256: "de2199f8233ea5ed9d4dbe86a8eaf88d754decd28e28554329a7b29b4d952773" diff --git a/recipes/foonathan-lexy/all/conanfile.py b/recipes/foonathan-lexy/all/conanfile.py new file mode 100644 index 0000000000000..ab4e9af924282 --- /dev/null +++ b/recipes/foonathan-lexy/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class FoonathanLexyConan(ConanFile): + name = "foonathan-lexy" + description = "lexy is a parser combinator library for C++17 and onwards." + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/foonathan/lexy" + topics = ("parser", "parser-combinators", "grammar") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.18 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LEXY_BUILD_EXAMPLES"] = False + tc.variables["LEXY_BUILD_TESTS"] = False + tc.variables["LEXY_BUILD_PACKAGE"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "lexy") + self.cpp_info.set_property("cmake_target_name", "foonathan::lexy") + + self.cpp_info.components["lexy_core"].set_property("cmake_target_name", "foonathan::lexy::lexy_core") + + self.cpp_info.components["lexy_file"].set_property("cmake_target_name", "foonathan::lexy::lexy_file") + self.cpp_info.components["lexy_file"].libs = ["lexy_file"] + + self.cpp_info.components["lexy_unicode"].set_property("cmake_target_name", "lexy::lexy_unicode") + self.cpp_info.components["lexy_unicode"].defines.append("LEXY_HAS_UNICODE_DATABASE=1") + + self.cpp_info.components["lexy_ext"].set_property("cmake_target_name", "lexy::lexy_ext") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "lexy" + self.cpp_info.filenames["cmake_find_package_multi"] = "lexy" + self.cpp_info.names["cmake_find_package"] = "foonathan" + self.cpp_info.names["cmake_find_package_multi"] = "foonathan" + self.cpp_info.components["foonathan"].names["cmake_find_package"] = "lexy" + self.cpp_info.components["foonathan"].names["cmake_find_package_multi"] = "lexy" diff --git a/recipes/foonathan-lexy/all/test_package/CMakeLists.txt b/recipes/foonathan-lexy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..caf4fe13f8177 --- /dev/null +++ b/recipes/foonathan-lexy/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(lexy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE foonathan::lexy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/foonathan-lexy/all/test_package/conanfile.py b/recipes/foonathan-lexy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/foonathan-lexy/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/foonathan-lexy/all/test_package/test_package.cpp b/recipes/foonathan-lexy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6efe05caf5ed2 --- /dev/null +++ b/recipes/foonathan-lexy/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include + +#include +#include +#include +#include +#include + +struct Color +{ + std::uint8_t r, g, b; +}; + +namespace grammar +{ +namespace dsl = lexy::dsl; + +struct channel +{ + static constexpr auto rule = dsl::integer(dsl::n_digits<2, dsl::hex>); + static constexpr auto value = lexy::forward; +}; + +struct color +{ + static constexpr auto rule = dsl::hash_sign + dsl::times<3>(dsl::p); + static constexpr auto value = lexy::construct; +}; +} // namespace grammar + +int main() { + unsigned char array[] = {'#', '5', '5', 'A', 'A', '0', '5'}; + + auto input = lexy::string_input(array, array + 7); + auto result = lexy::parse(input, lexy_ext::report_error); + if (result.has_value()) + { + auto color = result.value(); + std::printf("#%02x%02x%02x\n", color.r, color.g, color.b); + } + + return result ? 0 : 1; +} diff --git a/recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt b/recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/foonathan-lexy/all/test_v1_package/conanfile.py b/recipes/foonathan-lexy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/foonathan-lexy/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/foonathan-lexy/config.yml b/recipes/foonathan-lexy/config.yml new file mode 100644 index 0000000000000..9b16b933ef1b6 --- /dev/null +++ b/recipes/foonathan-lexy/config.yml @@ -0,0 +1,7 @@ +versions: + "2022.12.1": + folder: all + "2022.12.00": + folder: all + "2022.05.01": + folder: all diff --git a/recipes/foonathan-memory/all/conandata.yml b/recipes/foonathan-memory/all/conandata.yml new file mode 100644 index 0000000000000..5438e06adfb02 --- /dev/null +++ b/recipes/foonathan-memory/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "0.7.3": + url: "https://github.com/foonathan/memory/archive/refs/tags/v0.7-3.tar.gz" + sha256: "4203d15db22a94a3978eeb1afb59a37d35c57c0f148733f0f1a53a6281cb74dd" + "0.7.2": + url: "https://github.com/foonathan/memory/archive/refs/tags/v0.7-2.tar.gz" + sha256: "8aba7211bb0e59b7538decda453e492cc6e36f8781508ed92b38cbafe8a48762" + "0.7.1": + url: "https://github.com/foonathan/memory/archive/refs/tags/v0.7-1.tar.gz" + sha256: "19eb61c5cba6ccc40b8ee741350fd29402a46641ba752c30b7079528d87dbc79" + "0.7.0": + url: "https://github.com/foonathan/memory/archive/refs/tags/v0.7.tar.gz" + sha256: "01a7cc5a5ebddbd71bec69c89562a4a2ecd7c29334c0a29d38d83e7f7f66eb53" +patches: + "0.7.0": + - patch_file: "patches/0.7.0-0001-fix-virtualAllocFromApp.patch" + patch_description: "use VirtualAlloc on Desktop environment" + patch_type: "portability" diff --git a/recipes/foonathan-memory/all/conanfile.py b/recipes/foonathan-memory/all/conanfile.py new file mode 100644 index 0000000000000..041ce28409468 --- /dev/null +++ b/recipes/foonathan-memory/all/conanfile.py @@ -0,0 +1,134 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, collect_libs, copy, get, replace_in_file, rm, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class FoonathanMemoryConan(ConanFile): + name = "foonathan-memory" + license = "Zlib" + homepage = "https://github.com/foonathan/memory" + url = "https://github.com/conan-io/conan-center-index" + description = "STL compatible C++ memory allocator library" + topics = ("memory", "STL", "RawAllocator") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tools": [True, False], + "with_sizecheck": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tools": True, + "with_sizecheck": True, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate_build(self): + # Versions older than 0.7.2 require to compile and run an executable + # during the build, newer versions do it differently. + is_older = Version(self.version) < "0.7.2" + if hasattr(self, "settings_build") and cross_building(self) and is_older: + raise ConanInvalidConfiguration( + "Cross building is not supported on versions older than 0.7.2") + + 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["FOONATHAN_MEMORY_BUILD_EXAMPLES"] = False + tc.variables["FOONATHAN_MEMORY_BUILD_TESTS"] = False + tc.variables["FOONATHAN_MEMORY_BUILD_TOOLS"] = self.options.with_tools + tc.variables["FOONATHAN_MEMORY_CHECK_ALLOCATION_SIZE"] = self.options.with_sizecheck + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + current_version = Version(self.version) + if current_version >= "0.7.2" and current_version < "0.7.4": + # Remove static linking when cross-building, see: + # https://github.com/conan-io/conan-center-index/pull/16997#issuecomment-1508243262 + # https://github.com/foonathan/memory/issues/162 + replace_in_file(self, os.path.join(self.source_folder, "tool/CMakeLists.txt"), "if (CMAKE_CROSSCOMPILING)", "if (FALSE)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, + "lib", "foonathan_memory", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"foonathan_memory": "foonathan_memory::foonathan_memory"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "foonathan_memory") + self.cpp_info.set_property("cmake_target_name", "foonathan_memory") + self.cpp_info.libs = collect_libs(self) + self.cpp_info.includedirs = [ + os.path.join("include", "foonathan_memory")] + + if self.options.with_tools: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var with : {bin_path}"), + self.env_info.PATH.append(bin_path) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "foonathan_memory" + self.cpp_info.names["cmake_find_package_multi"] = "foonathan_memory" + 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/foonathan-memory/all/patches/0.7.0-0001-fix-virtualAllocFromApp.patch b/recipes/foonathan-memory/all/patches/0.7.0-0001-fix-virtualAllocFromApp.patch new file mode 100755 index 0000000000000..7961ecb88013c --- /dev/null +++ b/recipes/foonathan-memory/all/patches/0.7.0-0001-fix-virtualAllocFromApp.patch @@ -0,0 +1,22 @@ +diff --git a/src/virtual_memory.cpp b/src/virtual_memory.cpp +index 74d1c4e..d0e5fd5 100644 +--- a/src/virtual_memory.cpp ++++ b/src/virtual_memory.cpp +@@ -37,7 +37,7 @@ const std::size_t foonathan::memory::virtual_memory_page_size = get_page_size(); + void* foonathan::memory::virtual_memory_reserve(std::size_t no_pages) noexcept + { + auto pages = +-#if (_MSC_VER <= 1900) ++#if (_MSC_VER <= 1900) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + VirtualAlloc(nullptr, no_pages * virtual_memory_page_size, MEM_RESERVE, PAGE_READWRITE); + #else + VirtualAllocFromApp(nullptr, no_pages * virtual_memory_page_size, MEM_RESERVE, +@@ -55,7 +55,7 @@ void foonathan::memory::virtual_memory_release(void* pages, std::size_t) noexcep + void* foonathan::memory::virtual_memory_commit(void* memory, std::size_t no_pages) noexcept + { + auto region = +-#if (_MSC_VER <= 1900) ++#if (_MSC_VER <= 1900) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + VirtualAlloc(memory, no_pages * virtual_memory_page_size, MEM_COMMIT, PAGE_READWRITE); + #else + VirtualAllocFromApp(memory, no_pages * virtual_memory_page_size, MEM_COMMIT, diff --git a/recipes/foonathan-memory/all/test_package/CMakeLists.txt b/recipes/foonathan-memory/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f778dab17e9aa --- /dev/null +++ b/recipes/foonathan-memory/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(foonathan_memory REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE foonathan_memory) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/foonathan-memory/all/test_package/conanfile.py b/recipes/foonathan-memory/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/foonathan-memory/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/foonathan-memory/all/test_package/test_package.cpp b/recipes/foonathan-memory/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..20153e0cbe2dc --- /dev/null +++ b/recipes/foonathan-memory/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ + +// Copyright (C) 2015-2021 Müller +// This file is subject to the license terms in the LICENSE file +// found in the top-level directory of this distribution. + +// this example shows how to store allocators by reference and type-erased +// see https://memory.foonathan.net/md_doc_adapters_storage.html for further details + +#include +#include + +#include // allocator_reference, any_allocator_reference +#include // heap_allocator +#include // memory_stack + +// alias namespace foonathan::memory as memory for easier access +#include + +template +void do_sth(memory::allocator_reference ref); + +int main() +{ + using namespace memory::literals; + + // storing stateless allocator by reference + // heap_allocator is stateless so it does not need to be actually referenced + // the reference can take it as a temporary and construct it on the fly + memory::allocator_reference ref_stateless(memory::heap_allocator{}); + do_sth(ref_stateless); + + // create a memory_stack + // allocates a memory block - initially 4KiB big - and allocates from it in a stack-like manner + // deallocation is only done via unwinding to a previously queried marker + memory::memory_stack<> stack(4_KiB); + + // storing stateful allocator by reference + // memory_stack is stateful and thus the reference actually takes the address of the object + // the user has to ensure that the referenced object lives long enough + memory::allocator_reference> ref_stateful(stack); + do_sth(ref_stateful); + + // storing a reference type-erased + // any_allocator_reference is an alias for allocator_reference + // it triggers a specialization that uses type-erasure + // the tag type can be passed to any class that uses an allocator_reference internally, + // like std_allocator or the deep_copy_ptr from the other example + memory::any_allocator_reference any1( + ref_stateful); // initialize with another allocator reference, will "unwrap" + do_sth(any1); + + memory::any_allocator_reference any2(stack); // initialize with a "normal" RawAllocator + do_sth(any2); + + memory::any_allocator_reference any3( + std::allocator{}); // normal Allocators are RawAllocators, too, so this works + do_sth(any3); +} + +template +void do_sth(memory::allocator_reference ref) +{ + // ref is a full-blown RawAllocator that provides all member functions, + // so there is no need to use the allocator_traits + + auto node = ref.allocate_node(sizeof(int), alignof(int)); + std::cout << "Got memory for an int " << node << '\n'; + ref.deallocate_node(node, sizeof(int), alignof(int)); +} diff --git a/recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt b/recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/foonathan-memory/all/test_v1_package/conanfile.py b/recipes/foonathan-memory/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/foonathan-memory/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/foonathan-memory/config.yml b/recipes/foonathan-memory/config.yml new file mode 100644 index 0000000000000..d4d016ea9d423 --- /dev/null +++ b/recipes/foonathan-memory/config.yml @@ -0,0 +1,9 @@ +versions: + "0.7.3": + folder: all + "0.7.2": + folder: all + "0.7.1": + folder: all + "0.7.0": + folder: all diff --git a/recipes/forestdb/all/CMakeLists.txt b/recipes/forestdb/all/CMakeLists.txt new file mode 100644 index 0000000000000..78b537ac50f88 --- /dev/null +++ b/recipes/forestdb/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/forestdb/all/conandata.yml b/recipes/forestdb/all/conandata.yml new file mode 100644 index 0000000000000..935f0559af335 --- /dev/null +++ b/recipes/forestdb/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20220727": + url: "https://github.com/ForestDB-KVStore/Simple-ForestDB/archive/123dc7b2e4e99f85df6ed7a5b995393ec2197b09.tar.gz" + sha256: f847321479b525dccd9918799d9672d16140de65a3e07b8a2cc1cf92ff41bb65 +patches: + "cci.20220727": + - patch_file: "patches/0001-proper-cxx-std-flag.patch" + base_path: "source_subfolder" diff --git a/recipes/forestdb/all/conanfile.py b/recipes/forestdb/all/conanfile.py new file mode 100644 index 0000000000000..526ab2f1f2069 --- /dev/null +++ b/recipes/forestdb/all/conanfile.py @@ -0,0 +1,87 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class ForestDBConan(ConanFile): + name = "forestdb" + description = "ForestDB is a KeyValue store based on a Hierarchical B+-Tree." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ForestDB-KVStore/forestdb" + topics = ("kv-store", "mvcc", "wal") + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_snappy": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_snappy": False, + } + + generators = "cmake" + + @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"]) + + def requirements(self): + if self.options.with_snappy: + self.requires("snappy/1.1.9") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows Builds Unsupported") + if self.settings.compiler == "clang": + if self.settings.compiler.libcxx == "libc++" and self.options.shared == False: + raise ConanInvalidConfiguration("LibC++ Static Builds Unsupported") + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = CMake(self) + cmake.definitions["SNAPPY_OPTION"] = "Disable" + if self.options.with_snappy: + cmake.definitions["SNAPPY_OPTION"] = "Enable" + cmake.configure() + lib_target = "forestdb" + if not self.options.shared: + lib_target = "static_lib" + cmake.build(target=lib_target) + + def package(self): + self.copy("LICENSE", dst="licenses/", src=self._source_subfolder ) + # Parent Build system does not support library type selection + # and will only install the shared object from cmake; so we must + # handpick our libraries. + self.copy("*.a*", dst="lib", src="lib") + self.copy("*.lib", dst="lib", src="lib") + self.copy("*.so*", dst="lib", src="lib", symlinks=True) + self.copy("*.dylib*", dst="lib", src="lib", symlinks=True) + self.copy("*.dll*", dst="lib", src="lib") + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include"), keep_path=True) + + def package_info(self): + self.cpp_info.libs = ["forestdb"] + self.cpp_info.system_libs.extend(["pthread", "m", "dl"]) + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["rt"]) diff --git a/recipes/forestdb/all/patches/0001-proper-cxx-std-flag.patch b/recipes/forestdb/all/patches/0001-proper-cxx-std-flag.patch new file mode 100644 index 0000000000000..e21c0fb1e24c6 --- /dev/null +++ b/recipes/forestdb/all/patches/0001-proper-cxx-std-flag.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 22f58c7..af6e3e2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,18 +5,8 @@ IF (${CMAKE_MAJOR_VERSION} GREATER 2) + CMAKE_POLICY(SET CMP0042 NEW) + ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2) + +-INCLUDE(CheckCXXCompilerFlag) +-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +-CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) +-IF (COMPILER_SUPPORTS_CXX11) +- SET(STD_VERSION "-std=c++11") +-ELSEIF(COMPILER_SUPPORTS_CXX0X) +- SET(STD_VERSION "-std=c++0x") +-ELSE() +- IF (NOT WIN32) +- MESSAGE(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") +- ENDIF() +-ENDIF() ++set(CMAKE_CXX_STANDARD 11) ++set(STD_VERSION "") + + INCLUDE(CheckFunctionExists) + INCLUDE(CheckIncludeFileCXX) diff --git a/recipes/forestdb/all/test_package/CMakeLists.txt b/recipes/forestdb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9912b39ed8da5 --- /dev/null +++ b/recipes/forestdb/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(forestdb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} forestdb::forestdb) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/forestdb/all/test_package/conanfile.py b/recipes/forestdb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..751b9d5bc7b9c --- /dev/null +++ b/recipes/forestdb/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools, RunEnvironment +from conan.tools.build import cross_building +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/forestdb/all/test_package/test_package.cpp b/recipes/forestdb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3f6128efe9bfd --- /dev/null +++ b/recipes/forestdb/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include + +int main(void) { + fdb_config default_config = fdb_get_default_config(); + fdb_status const status = fdb_init(&default_config); + if (FDB_RESULT_SUCCESS != status) return -1; + return 0; +} diff --git a/recipes/forestdb/config.yml b/recipes/forestdb/config.yml new file mode 100644 index 0000000000000..df66b73b532f4 --- /dev/null +++ b/recipes/forestdb/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220727": + folder: all diff --git a/recipes/foxglove-websocket/all/conandata.yml b/recipes/foxglove-websocket/all/conandata.yml new file mode 100644 index 0000000000000..30a26f91bb4d6 --- /dev/null +++ b/recipes/foxglove-websocket/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 1.0.0: + url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.0.0.tar.gz + sha256: c6106934a47d9d5b53ee3f6a0a6c8ec778ffdb52e9b462136bfc1bc5391ed227 diff --git a/recipes/foxglove-websocket/all/conanfile.py b/recipes/foxglove-websocket/all/conanfile.py new file mode 100644 index 0000000000000..60557d9c03f13 --- /dev/null +++ b/recipes/foxglove-websocket/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + +class FoxgloveWebSocketConan(ConanFile): + name = "foxglove-websocket" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/foxglove/ws-protocol" + description = "A C++ server implementation of the Foxglove WebSocket Protocol" + license = "MIT" + topics = ("foxglove", "websocket") + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16.9", + "msvc": "191", + "gcc": "9", + "clang": "9", + "apple-clang": "12", + } + + @property + def _source_package_path(self): + return os.path.join(self.source_folder, "tarball", "cpp", "foxglove-websocket") + + def source(self): + tmp_folder = "tarball" + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=tmp_folder) + copy(self, "*", src=os.path.join(self.source_folder, tmp_folder, "cpp", "foxglove-websocket"), dst=self.source_folder) + copy(self, "LICENSE", src=tmp_folder, dst=self.source_folder) + rmdir(self, tmp_folder) + + 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 requirements(self): + self.requires("nlohmann_json/3.10.5", transitive_headers=True) + self.requires("websocketpp/0.8.2") + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.options["websocketpp"].asio = "standalone" + + if self.options.shared: + self.options.rm_safe("fPIC") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["foxglove_websocket"] diff --git a/recipes/foxglove-websocket/all/test_package/CMakeLists.txt b/recipes/foxglove-websocket/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..869000fbad0c4 --- /dev/null +++ b/recipes/foxglove-websocket/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(foxglove-websocket REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} foxglove-websocket::foxglove-websocket) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/foxglove-websocket/all/test_package/conanfile.py b/recipes/foxglove-websocket/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3475b6c2095c1 --- /dev/null +++ b/recipes/foxglove-websocket/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.build import can_run +import os + + +class TestPackageConan(ConanFile): + settings = ("os", "arch", "compiler", "build_type") + generators = "CMakeDeps" + test_type = "explicit" + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/foxglove-websocket/all/test_package/test_package.cpp b/recipes/foxglove-websocket/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d63b14b5b96bc --- /dev/null +++ b/recipes/foxglove-websocket/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +template<> +void foxglove::Server::setupTlsHandler() {} + +int main() { + // Note: Server instance is only initiated here and not started. This is similar to how it's + // done in the websocketpp recipe. + const auto logHandler = [](foxglove::WebSocketLogLevel, char const* msg) { + std::cout << msg << std::endl; + }; + foxglove::ServerOptions serverOptions; + foxglove::Server server("example", logHandler, serverOptions); + (void)server; + return 0; +} diff --git a/recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt b/recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/foxglove-websocket/all/test_v1_package/conanfile.py b/recipes/foxglove-websocket/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a4da47d572258 --- /dev/null +++ b/recipes/foxglove-websocket/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = ("os", "arch", "compiler", "build_type") + generators = ("cmake", "cmake_find_package_multi") + test_type = "explicit" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def requirements(self): + self.requires(self.tested_reference_str) + + 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/foxglove-websocket/config.yml b/recipes/foxglove-websocket/config.yml new file mode 100644 index 0000000000000..3e794e52e592a --- /dev/null +++ b/recipes/foxglove-websocket/config.yml @@ -0,0 +1,3 @@ +versions: + 1.0.0: + folder: all diff --git a/recipes/foxi/all/conandata.yml b/recipes/foxi/all/conandata.yml new file mode 100644 index 0000000000000..b242c7b479adf --- /dev/null +++ b/recipes/foxi/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210217": + url: "https://github.com/houseroad/foxi/archive/bd6feb6d0d3fc903df42b4feb82a602a5fcb1fd5.zip" + sha256: "1485f400ba468664884287b6b94e0164844e28a100d3795ada4361d2c34832e1" +patches: + "cci.20210217": + - patch_file: "patches/fix-conflicting-types.patch" diff --git a/recipes/foxi/all/conanfile.py b/recipes/foxi/all/conanfile.py new file mode 100644 index 0000000000000..1215880aee391 --- /dev/null +++ b/recipes/foxi/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rename, replace_in_file +import glob +import os + +required_conan_version = ">=1.46.0" + + +class FoxiConan(ConanFile): + name = "foxi" + description = "ONNXIFI with Facebook Extension." + license = "MIT" + topics = ("foxi", "onnxifi") + homepage = "https://github.com/houseroad/foxi" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + 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["FOXI_WERROR"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_msvc_runtime_flag(foxi_loader)", "") + replace_in_file(self, cmakelists, "add_msvc_runtime_flag(foxi_dummy)", "") + replace_in_file(self, cmakelists, + "DESTINATION lib", + "RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + # Move plugin to bin folder on Windows + for dll_file in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): + rename(self, src=dll_file, dst=os.path.join(self.package_folder, "bin", os.path.basename(dll_file))) + + def package_info(self): + self.cpp_info.libs = ["foxi_dummy", "foxi_loader"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl"] diff --git a/recipes/foxi/all/patches/fix-conflicting-types.patch b/recipes/foxi/all/patches/fix-conflicting-types.patch new file mode 100644 index 0000000000000..74d6a42f1d2a3 --- /dev/null +++ b/recipes/foxi/all/patches/fix-conflicting-types.patch @@ -0,0 +1,48 @@ +--- a/foxi/onnxifi_dummy.c ++++ b/foxi/onnxifi_dummy.c +@@ -103,7 +103,9 @@ ONNXIFI_PUBLIC ONNXIFI_CHECK_RESULT onnxStatus ONNXIFI_ABI onnxInitGraph( + const void* onnxModel, + uint32_t weightCount, + const onnxTensorDescriptorV1* weightDescriptors, +- onnxGraph* graph) { ++ onnxGraph* graph, ++ uint32_t maxSeqLength, ++ void* deferredWeightReader) { + if (graph == NULL) { + return ONNXIFI_STATUS_INVALID_POINTER; + } +@@ -215,6 +217,8 @@ ONNXIFI_PUBLIC ONNXIFI_CHECK_RESULT onnxStatus ONNXIFI_ABI + onnxWaitEventFor(onnxEvent event, + uint32_t timeoutMs, + onnxEventState* eventState, +- onnxStatus* eventStatus) { ++ onnxStatus* eventStatus, ++ char* message, ++ size_t* messageLength) { + return ONNXIFI_STATUS_SUCCESS; + } +\ No newline at end of file +--- a/foxi/onnxifi_wrapper.c ++++ b/foxi/onnxifi_wrapper.c +@@ -761,7 +761,9 @@ ONNXIFI_PUBLIC onnxStatus ONNXIFI_ABI onnxInitGraph( + const void* onnxModel, + uint32_t weightsCount, + const onnxTensorDescriptorV1* weightDescriptors, +- onnxGraph* graph) ++ onnxGraph* graph, ++ uint32_t maxSeqLength, ++ void* deferredWeightReader) + { + if (graph == NULL) { + return ONNXIFI_STATUS_INVALID_POINTER; +@@ -797,7 +799,9 @@ ONNXIFI_PUBLIC onnxStatus ONNXIFI_ABI onnxInitGraph( + onnxModel, + weightsCount, + weightDescriptors, +- &graph_wrapper->graph); ++ &graph_wrapper->graph, ++ maxSeqLength, ++ deferredWeightReader); + switch (status) { + case ONNXIFI_STATUS_SUCCESS: + case ONNXIFI_STATUS_FALLBACK: diff --git a/recipes/foxi/all/test_package/CMakeLists.txt b/recipes/foxi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ab378d1724765 --- /dev/null +++ b/recipes/foxi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(foxi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE foxi::foxi) diff --git a/recipes/foxi/all/test_package/conanfile.py b/recipes/foxi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/foxi/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/foxi/all/test_package/test_package.c b/recipes/foxi/all/test_package/test_package.c new file mode 100644 index 0000000000000..fdf9a46dad3df --- /dev/null +++ b/recipes/foxi/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include + +#include + +int main() { + struct onnxifi_library onnx; + int ret = onnxifi_load(ONNXIFI_LOADER_FLAG_VERSION_1_0, NULL, &onnx); + if (!ret) { + printf("Cannot load onnxifi lib\n"); + return 0; + } + onnxifi_unload(&onnx); + return 0; +} diff --git a/recipes/foxi/all/test_v1_package/CMakeLists.txt b/recipes/foxi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a1ab465c8f39c --- /dev/null +++ b/recipes/foxi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(foxi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE foxi::foxi) diff --git a/recipes/foxi/all/test_v1_package/conanfile.py b/recipes/foxi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/foxi/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/foxi/config.yml b/recipes/foxi/config.yml new file mode 100644 index 0000000000000..fd09c4d8c1f0a --- /dev/null +++ b/recipes/foxi/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210217": + folder: all diff --git a/recipes/fp16/all/conandata.yml b/recipes/fp16/all/conandata.yml new file mode 100644 index 0000000000000..cf80322a4b8bb --- /dev/null +++ b/recipes/fp16/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210320": + url: "https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip" + sha256: "e66e65515fa09927b348d3d584c68be4215cfe664100d01c9dbc7655a5716d70" + "cci.20200514": + url: "https://github.com/Maratyszcza/FP16/archive/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip" + sha256: "d973501a40c55126b31accc2d9f08d931ec3cc190c0430309a5e341d3c0ce32a" diff --git a/recipes/fp16/all/conanfile.py b/recipes/fp16/all/conanfile.py new file mode 100644 index 0000000000000..75666c9f3bd71 --- /dev/null +++ b/recipes/fp16/all/conanfile.py @@ -0,0 +1,41 @@ +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 Fp16Conan(ConanFile): + name = "fp16" + description = "Conversion to/from half-precision floating point formats." + license = "MIT" + topics = ("half-precision-floating-point") + homepage = "https://github.com/Maratyszcza/FP16" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("psimd/cci.20200517", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fp16/all/test_package/CMakeLists.txt b/recipes/fp16/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1e502f0857d7c --- /dev/null +++ b/recipes/fp16/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(fp16 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fp16::fp16) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fp16/all/test_package/conanfile.py b/recipes/fp16/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/fp16/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/fp16/all/test_package/test_package.c b/recipes/fp16/all/test_package/test_package.c new file mode 100644 index 0000000000000..74259de8146a0 --- /dev/null +++ b/recipes/fp16/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + uint16_t a = fp16_ieee_from_fp32_value(35.f); + return 0; +} diff --git a/recipes/fp16/all/test_v1_package/CMakeLists.txt b/recipes/fp16/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d609dc2f83e68 --- /dev/null +++ b/recipes/fp16/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fp16 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fp16::fp16) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fp16/all/test_v1_package/conanfile.py b/recipes/fp16/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fp16/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/fp16/config.yml b/recipes/fp16/config.yml new file mode 100644 index 0000000000000..97367a08f7fea --- /dev/null +++ b/recipes/fp16/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210320": + folder: all + "cci.20200514": + folder: all diff --git a/recipes/fpgen/all/conandata.yml b/recipes/fpgen/all/conandata.yml new file mode 100644 index 0000000000000..89315a6f71ce4 --- /dev/null +++ b/recipes/fpgen/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.0": + url: "https://github.com/jay-tux/fpgen/archive/refs/tags/v1.1.0.tar.gz" + sha256: "5e5faf1fbdcb3d93306bd8a838f805afdccdbb9076d78356ad5443943555be7d" + "1.1.0-clang": + url: "https://github.com/jay-tux/fpgen/archive/refs/tags/v1.1.0-clang.tar.gz" + sha256: "02936c1e790bcdba1479cf8164596b05cfc5b7401b3c71e0a1fd77e51fe8b93f" diff --git a/recipes/fpgen/all/conanfile.py b/recipes/fpgen/all/conanfile.py new file mode 100644 index 0000000000000..b9e1ea43fa34a --- /dev/null +++ b/recipes/fpgen/all/conanfile.py @@ -0,0 +1,94 @@ +import os + +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class FpgenConan(ConanFile): + name = "fpgen" + description = " Functional programming in C++ using C++20 coroutines." + license = ["MPL2"] + topics = ( + "generators", + "coroutines", + "c++20", + "header-only", + "functional-programming", + "functional", + ) + homepage = "https://github.com/jay-tux/fpgen/" + url = "https://github.com/conan-io/conan-center-index" + settings = "arch", "os", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "13", + } + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + destination=self._source_subfolder, + strip_root=True, + ) + + def validate(self): + if self.settings.compiler == "clang" and "clang" not in str(self.version): + raise ConanInvalidConfiguration( + f"Use '{self.version}-clang' for Clang support." + ) + + if ( + self.settings.compiler == "clang" + and not self.settings.compiler.libcxx == "libc++" + ): + raise ConanInvalidConfiguration( + f"Use 'compiler.libcxx=libc++' for {self.name} on Clang." + ) + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._min_cppstd) + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False + ) + if not minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} is currently not available for your compiler." + ) + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++20, which your compiler does not support." + ) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy( + pattern="*.hpp", + dst=os.path.join("include", "fpgen"), + src=self._source_subfolder, + keep_path=False, + ) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "fpgen")) diff --git a/recipes/fpgen/all/test_package/CMakeLists.txt b/recipes/fpgen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2d7e6737381f9 --- /dev/null +++ b/recipes/fpgen/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(fpgen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) +target_link_libraries(${PROJECT_NAME} fpgen::fpgen) diff --git a/recipes/fpgen/all/test_package/conanfile.py b/recipes/fpgen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3f4a9f50f389e --- /dev/null +++ b/recipes/fpgen/all/test_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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fpgen/all/test_package/main.cpp b/recipes/fpgen/all/test_package/main.cpp new file mode 100644 index 0000000000000..43bf51fe320f0 --- /dev/null +++ b/recipes/fpgen/all/test_package/main.cpp @@ -0,0 +1,13 @@ +#include +#include +#include "fpgen/fpgen.hpp" + +int main() { + std::vector vals = {0,1,2,3}; + auto gen = fpgen::from(vals); + + for(auto &&val : gen) { + std::cout << val << std::endl; + } + return 0; +} diff --git a/recipes/fpgen/config.yml b/recipes/fpgen/config.yml new file mode 100644 index 0000000000000..ec935d5cf64ff --- /dev/null +++ b/recipes/fpgen/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.1.0-clang": + folder: all diff --git a/recipes/freeglut/all/conandata.yml b/recipes/freeglut/all/conandata.yml new file mode 100644 index 0000000000000..e132a04abbb80 --- /dev/null +++ b/recipes/freeglut/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.4.0": + url: "https://github.com/FreeGLUTProject/freeglut/archive/v3.4.0.tar.gz" + sha256: "3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec" + "3.2.2": + sha256: "c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50" + url: "https://github.com/FreeGLUTProject/freeglut/releases/download/v3.2.2/freeglut-3.2.2.tar.gz" + "3.2.1": + sha256: "d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68" + url: "https://github.com/FreeGLUTProject/freeglut/releases/download/v3.2.1/freeglut-3.2.1.tar.gz" diff --git a/recipes/freeglut/all/conanfile.py b/recipes/freeglut/all/conanfile.py new file mode 100644 index 0000000000000..d8b38c56cfa8c --- /dev/null +++ b/recipes/freeglut/all/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class freeglutConan(ConanFile): + name = "freeglut" + description = "Open-source alternative to the OpenGL Utility Toolkit (GLUT) library" + topics = ("opengl", "gl", "glut", "utility", "toolkit", "graphics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://freeglut.sourceforge.net" + license = "X11" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "gles": [True, False], + "print_errors_at_runtime": [True, False], + "print_warnings_at_runtime": [True, False], + "replace_glut": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "gles": False, + "print_errors_at_runtime": True, + "print_warnings_at_runtime": True, + "replace_glut": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + self.requires("glu/system") + if self.settings.os == "Linux": + self.requires("xorg/system") + + def validate(self): + if self.settings.os == "Macos": + # see https://github.com/dcnieho/FreeGLUT/issues/27 + # and https://sourceforge.net/p/freeglut/bugs/218/ + # also, it seems to require `brew cask install xquartz` + raise ConanInvalidConfiguration(f"{self.ref} does not support macos") + if Version(self.version) < "3.2.2": + if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) >= "10.0") or \ + (self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "11.0"): + # see https://github.com/dcnieho/FreeGLUT/issues/86 + raise ConanInvalidConfiguration(f"{self.ref} does not support gcc >= 10 and clang >= 11") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FREEGLUT_BUILD_DEMOS"] = False + tc.variables["FREEGLUT_BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["FREEGLUT_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["FREEGLUT_GLES"] = self.options.gles + tc.variables["FREEGLUT_PRINT_ERRORS"] = self.options.print_errors_at_runtime + tc.variables["FREEGLUT_PRINT_WARNINGS"] = self.options.print_warnings_at_runtime + tc.variables["FREEGLUT_INSTALL_PDB"] = False + tc.variables["INSTALL_PDB"] = False + tc.variables["FREEGLUT_REPLACE_GLUT"] = self.options.replace_glut + tc.preprocessor_definitions["FREEGLUT_LIB_PRAGMAS"] = "0" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + config_target = "freeglut" if self.options.shared else "freeglut_static" + pkg_config = "freeglut" if self.settings.os == "Windows" else "glut" + + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "GLUT") + self.cpp_info.set_property("cmake_module_target_name", "GLUT::GLUT") + self.cpp_info.set_property("cmake_file_name", "FreeGLUT") + self.cpp_info.set_property("cmake_target_name", f"FreeGLUT::{config_target}") + self.cpp_info.set_property("pkg_config_name", pkg_config) + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["freeglut_"].libs = collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.components["freeglut_"].system_libs.extend(["pthread", "m", "dl", "rt"]) + elif self.settings.os == "Windows": + if not self.options.shared: + self.cpp_info.components["freeglut_"].defines.append("FREEGLUT_STATIC=1") + self.cpp_info.components["freeglut_"].defines.append("FREEGLUT_LIB_PRAGMAS=0") + self.cpp_info.components["freeglut_"].system_libs.extend(["glu32", "gdi32", "winmm", "user32"]) + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "GLUT" + self.cpp_info.names["cmake_find_package_multi"] = "FreeGLUT" + self.cpp_info.names["pkg_config"] = pkg_config + self.cpp_info.components["freeglut_"].names["cmake_find_package"] = "GLUT" + self.cpp_info.components["freeglut_"].set_property("cmake_module_target_name", "GLUT::GLUT") + self.cpp_info.components["freeglut_"].names["cmake_find_package_multi"] = config_target + self.cpp_info.components["freeglut_"].set_property("cmake_target_name", f"FreeGLUT::{config_target}") + self.cpp_info.components["freeglut_"].set_property("pkg_config_name", pkg_config) + self.cpp_info.components["freeglut_"].requires.extend(["opengl::opengl", "glu::glu"]) + if self.settings.os == "Linux": + self.cpp_info.components["freeglut_"].requires.append("xorg::xorg") diff --git a/recipes/freeglut/all/test_package/CMakeLists.txt b/recipes/freeglut/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8010c630a0049 --- /dev/null +++ b/recipes/freeglut/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(FreeGLUT REQUIRED CONFIG) +find_package(OpenGL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET FreeGLUT::freeglut_static) + target_link_libraries(${PROJECT_NAME} PRIVATE FreeGLUT::freeglut_static OpenGL::GL) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE FreeGLUT::freeglut OpenGL::GL) +endif() diff --git a/recipes/freeglut/all/test_package/conanfile.py b/recipes/freeglut/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6e146f0e38642 --- /dev/null +++ b/recipes/freeglut/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("opengl/system") + + 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/freeglut/all/test_package/test_package.c b/recipes/freeglut/all/test_package/test_package.c new file mode 100644 index 0000000000000..e9601bcf20626 --- /dev/null +++ b/recipes/freeglut/all/test_package/test_package.c @@ -0,0 +1,48 @@ +#include +#include "GL/freeglut.h" + + +void error_handler(const char *fmt, va_list ap) { + printf("glut error: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); +} + +void warning_handler(const char *fmt, va_list ap) { + printf("glut warning: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); +} + +void renderScene(void) { + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glBegin(GL_TRIANGLES); + glVertex3f(-0.5,-0.5,0.0); + glVertex3f(0.5,0.0,0.0); + glVertex3f(0.0,0.5,0.0); + glEnd(); + + glutSwapBuffers(); +} + +int main(int argc, char **argv) { + glutInitErrorFunc(error_handler); + glutInitWarningFunc(warning_handler); + // glutInit(&argc,argv); //causes segfault on linux when called + printf("FreeGLUT version: %d\n", glutGet(GLUT_VERSION)); + + /* + glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); + glutInitWindowPosition(100,100); + glutInitWindowSize(320,320); + glutCreateWindow("Lighthouse3D - GLUT Tutorial"); + + // register callbacks + glutDisplayFunc(renderScene); + + // enter GLUT event processing cycle + glutMainLoop();*/ + return EXIT_SUCCESS; +} diff --git a/recipes/freeglut/all/test_package_module/CMakeLists.txt b/recipes/freeglut/all/test_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..cfee51d49e44b --- /dev/null +++ b/recipes/freeglut/all/test_package_module/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(GLUT REQUIRED MODULE) +find_package(OpenGL REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GLUT::GLUT OpenGL::GL) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindGLUT.html are properly defined +set(_custom_vars + GLUT_FOUND + GLUT_INCLUDE_DIRS + GLUT_LIBRARIES +) +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/freeglut/all/test_package_module/conanfile.py b/recipes/freeglut/all/test_package_module/conanfile.py new file mode 100644 index 0000000000000..6e146f0e38642 --- /dev/null +++ b/recipes/freeglut/all/test_package_module/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("opengl/system") + + 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/freeglut/all/test_v1_package/CMakeLists.txt b/recipes/freeglut/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/freeglut/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/freeglut/all/test_v1_package/conanfile.py b/recipes/freeglut/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f044ed5376bf7 --- /dev/null +++ b/recipes/freeglut/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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("opengl/system") + + 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/freeglut/all/test_v1_package_module/CMakeLists.txt b/recipes/freeglut/all/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..27f7a57e7a0b3 --- /dev/null +++ b/recipes/freeglut/all/test_v1_package_module/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package_module + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/freeglut/all/test_v1_package_module/conanfile.py b/recipes/freeglut/all/test_v1_package_module/conanfile.py new file mode 100644 index 0000000000000..f0bc95c494a3c --- /dev/null +++ b/recipes/freeglut/all/test_v1_package_module/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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("opengl/system") + + 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/freeglut/config.yml b/recipes/freeglut/config.yml new file mode 100644 index 0000000000000..dc897e491fcb6 --- /dev/null +++ b/recipes/freeglut/config.yml @@ -0,0 +1,7 @@ +versions: + "3.4.0": + folder: all + "3.2.2": + folder: all + "3.2.1": + folder: all diff --git a/recipes/freeimage/all/CMakeLists.txt b/recipes/freeimage/all/CMakeLists.txt new file mode 100644 index 0000000000000..fa022c569a005 --- /dev/null +++ b/recipes/freeimage/all/CMakeLists.txt @@ -0,0 +1,164 @@ +cmake_minimum_required(VERSION 3.8) +project(FreeImage LANGUAGES C CXX) + +include(GNUInstallDirs) + +find_package(ZLIB REQUIRED) +if(FREEIMAGE_WITH_PNG) + find_package(PNG REQUIRED) +endif() +if(FREEIMAGE_WITH_JPEG) + find_package(JPEG REQUIRED) +endif() +if(FREEIMAGE_WITH_OPENJPEG) + find_package(OpenJPEG REQUIRED CONFIG) +endif() +if(FREEIMAGE_WITH_WEBP) + find_package(WebP REQUIRED CONFIG) +endif() +if(FREEIMAGE_WITH_JXR) + find_package(jxrlib REQUIRED CONFIG) +endif() +if(FREEIMAGE_WITH_RAW) + find_package(libraw REQUIRED CONFIG) +endif() +if(FREEIMAGE_WITH_OPENEXR OR FREEIMAGE_WITH_TIFF) + find_package(OpenEXR REQUIRED CONFIG) +endif() +if(FREEIMAGE_WITH_TIFF) + find_package(TIFF REQUIRED) +endif() + +# FreeImage + +file(GLOB FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/*.cpp ${FREEIMAGE_FOLDER}/Source/FreeImage/*.c) +list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginG3.cpp) +if(NOT FREEIMAGE_WITH_PNG) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginPNG.cpp) +endif() +if(NOT FREEIMAGE_WITH_JPEG) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginJPEG.cpp) +endif() +if(NOT FREEIMAGE_WITH_OPENJPEG) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginJP2.cpp) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginJ2K.cpp) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/J2KHelper.cpp) +endif() +if(NOT FREEIMAGE_WITH_WEBP) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginWebP.cpp) +endif() +if(NOT FREEIMAGE_WITH_JXR) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginJXR.cpp) +endif() +if(NOT FREEIMAGE_WITH_RAW) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginRAW.cpp) +endif() +if(NOT FREEIMAGE_WITH_OPENEXR) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginEXR.cpp) +endif() +if(NOT FREEIMAGE_WITH_TIFF) + list(REMOVE_ITEM FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImage/PluginTIFF.cpp) +endif() +if(MSVC) + list(APPEND FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/FreeImage.rc) +endif(MSVC) + +file(GLOB FREEIMAGETOOLKIT_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImageToolkit/*.cpp ${FREEIMAGE_FOLDER}/Source/FreeImageToolkit/*.c) +list(REMOVE_ITEM FREEIMAGETOOLKIT_SOURCES ${FREEIMAGE_FOLDER}/Source/FreeImageToolkit/JPEGTransform.cpp) + +file(GLOB METADATA_SOURCES ${FREEIMAGE_FOLDER}/Source/Metadata/*.cpp ${FREEIMAGE_FOLDER}/Source/Metadata/*.c) +if(NOT FREEIMAGE_WITH_TIFF) + list(REMOVE_ITEM METADATA_SOURCES ${FREEIMAGE_FOLDER}/Source/Metadata/XTIFF.cpp) +endif() + +add_library(FreeImage ${FREEIMAGE_SOURCES} ${FREEIMAGETOOLKIT_SOURCES} ${METADATA_SOURCES}) +target_compile_features(FreeImage PRIVATE cxx_std_11) +set_target_properties(FreeImage PROPERTIES + OUTPUT_NAME "freeimage" + C_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON +) +target_include_directories(FreeImage PRIVATE + ${FREEIMAGE_FOLDER}/Source + ${FREEIMAGE_FOLDER}/Source/FreeImage + ${FREEIMAGE_FOLDER}/Source/FreeImageToolkit + ${FREEIMAGE_FOLDER}/Source/Metadata +) +target_link_libraries(FreeImage PRIVATE ZLIB::ZLIB) +if(FREEIMAGE_WITH_PNG) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_PNG) + target_link_libraries(FreeImage PRIVATE PNG::PNG) +endif() +if(FREEIMAGE_WITH_JPEG) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_JPEG) + target_link_libraries(FreeImage PRIVATE JPEG::JPEG) +endif() +if(FREEIMAGE_WITH_OPENJPEG) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_OPENJPEG) + target_link_libraries(FreeImage PRIVATE openjp2) +endif() +if(FREEIMAGE_WITH_WEBP) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_WEBP) + target_link_libraries(FreeImage PRIVATE WebP::webp WebP::webpdecoder WebP::libwebpmux WebP::webpdemux) +endif() +if(FREEIMAGE_WITH_JXR) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_JXR) + target_link_libraries(FreeImage PRIVATE jxrlib::jxrlib) +endif() +if(FREEIMAGE_WITH_RAW) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_RAW) + target_link_libraries(FreeImage PRIVATE libraw::libraw) +endif() +if(FREEIMAGE_WITH_OPENEXR) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_OPENEXR) + target_link_libraries(FreeImage PRIVATE openexr::openexr) # TODO: link to exact required components +endif() +if(FREEIMAGE_WITH_TIFF) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_WITH_TIFF) + target_link_libraries(FreeImage PRIVATE TIFF::TIFF IlmBase::Half) +endif() +if(BUILD_SHARED_LIBS) + target_compile_definitions(FreeImage PRIVATE FREEIMAGE_EXPORTS) +else() + target_compile_definitions(FreeImage PUBLIC FREEIMAGE_LIB) +endif() + +install(TARGETS FreeImage + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +set(FREEIMAGE_HEADERS ${FREEIMAGE_FOLDER}/Source/FreeImage.h) +install(FILES ${FREEIMAGE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +# FreeImagePlus + +set(FREEIMAGEPLUS_HEADERS ${FREEIMAGE_FOLDER}/Wrapper/FreeImagePlus/FreeImagePlus.h) +file(GLOB FREEIMAGEPLUS_SOURCES ${FREEIMAGE_FOLDER}/Wrapper/FreeImagePlus/src/*.cpp ${FREEIMAGE_FOLDER}/Wrapper/FreeImagePlus/src/*.c) +if(MSVC) + list(APPEND FREEIMAGE_SOURCES ${FREEIMAGE_FOLDER}/Wrapper/FreeImagePlus/FreeImagePlus.rc) +endif(MSVC) +add_library(FreeImagePlus ${FREEIMAGEPLUS_SOURCES}) +target_compile_features(FreeImagePlus PUBLIC cxx_std_11) +set_target_properties(FreeImagePlus PROPERTIES + OUTPUT_NAME "freeimageplus" + C_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON +) +target_link_libraries(FreeImagePlus PUBLIC FreeImage) +target_include_directories(FreeImagePlus PRIVATE + ${FREEIMAGE_FOLDER}/Wrapper/FreeImagePlus + ${FREEIMAGE_FOLDER}/Source +) +if(BUILD_SHARED_LIBS) + target_compile_definitions(FreeImagePlus PRIVATE FIP_EXPORTS) +endif() + +install(TARGETS FreeImagePlus + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES ${FREEIMAGEPLUS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/freeimage/all/conandata.yml b/recipes/freeimage/all/conandata.yml new file mode 100644 index 0000000000000..ab58bf12a8d2b --- /dev/null +++ b/recipes/freeimage/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "3.18.0": + url: "http://downloads.sourceforge.net/project/freeimage/Source Distribution/3.18.0/FreeImage3180.zip" + sha256: "f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd" +patches: + "3.18.0": + - patch_file: "patches/001_disable-plugins-depending-on-internal-third-party-libraries.patch" + - patch_file: "patches/002_fix-function-overload.patch" + - patch_file: "patches/003_use-external-jpeg.patch" + - patch_file: "patches/004_use-external-jxrlib.patch" + - patch_file: "patches/005_use-external-libtiff.patch" + - patch_file: "patches/006_use-external-openexr.patch" + - patch_file: "patches/007_use-external-openjpeg.patch" + - patch_file: "patches/008_use-external-png-zlib.patch" + - patch_file: "patches/009_use-external-rawlib.patch" + - patch_file: "patches/010_use-external-webp.patch" + - patch_file: "patches/011_update-libraw-support.patch" + - patch_file: "patches/012_use-functions-to-override-libtiff-warning-error-handlers.patch" + - patch_file: "patches/013_use-typedef-as-already-declared.patch" + - patch_file: "patches/014_no_auto_ptr.patch" diff --git a/recipes/freeimage/all/conanfile.py b/recipes/freeimage/all/conanfile.py new file mode 100644 index 0000000000000..11a3b438484c7 --- /dev/null +++ b/recipes/freeimage/all/conanfile.py @@ -0,0 +1,170 @@ +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, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class FreeImageConan(ConanFile): + name = "freeimage" + description = "Open Source library project for developers who would like to support popular graphics image formats"\ + "like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications." + homepage = "https://freeimage.sourceforge.io" + url = "https://github.com/conan-io/conan-center-index" + license = "FreeImage", "GPL-3.0-or-later", "GPL-2.0-or-later" + topics = ("image", "decoding", "graphics") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "with_png": [True, False], + "with_tiff": [True, False], + "with_jpeg2000": [True, False], + "with_openexr": [True, False], + "with_eigen": [True, False], + "with_webp": [True, False], + "with_raw": [True, False], + "with_jxr": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_jpeg": "libjpeg", + "with_png": True, + "with_tiff": True, + "with_jpeg2000": True, + "with_openexr": True, + "with_eigen": True, + "with_webp": True, + "with_raw": True, + "with_jxr": True, + } + + short_paths = True + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.output.warning("G3 plugin and JPEGTransform are disabled.") + if bool(self.options.with_jpeg): + if self.options.with_tiff: + self.options["libtiff"].jpeg = self.options.with_jpeg + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + if self.options.with_jpeg2000: + self.requires("openjpeg/2.5.0") + if self.options.with_png: + self.requires("libpng/1.6.39") + if self.options.with_webp: + self.requires("libwebp/1.3.0") + if self.options.with_tiff or self.options.with_openexr: + # can't upgrade to openexr/3.x.x because plugin tiff requires openexr/2.x.x header files + self.requires("openexr/2.5.7") + if self.options.with_raw: + # can't upgrade to libraw >= 0.21 (error: no member named 'shot_select' in 'libraw_output_params_t') + self.requires("libraw/0.20.2") + if self.options.with_jxr: + self.requires("jxrlib/cci.20170615") + if self.options.with_tiff: + self.requires("libtiff/4.4.0") + + 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["FREEIMAGE_FOLDER"] = self.source_folder.replace("\\", "/") + tc.variables["FREEIMAGE_WITH_JPEG"] = bool(self.options.with_jpeg) + tc.variables["FREEIMAGE_WITH_OPENJPEG"] = self.options.with_jpeg2000 + tc.variables["FREEIMAGE_WITH_PNG"] = self.options.with_png + tc.variables["FREEIMAGE_WITH_WEBP"] = self.options.with_webp + tc.variables["FREEIMAGE_WITH_OPENEXR"] = self.options.with_openexr + tc.variables["FREEIMAGE_WITH_RAW"] = self.options.with_raw + tc.variables["FREEIMAGE_WITH_JXR"] = self.options.with_jxr + tc.variables["FREEIMAGE_WITH_TIFF"] = self.options.with_tiff + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "Source", "LibPNG")) + rmdir(self, os.path.join(self.source_folder, "Source", "LibTIFF4")) + rmdir(self, os.path.join(self.source_folder, "Source", "LibOpenJPEG")) + rmdir(self, os.path.join(self.source_folder, "Source", "LibJXR")) + rmdir(self, os.path.join(self.source_folder, "Source", "LibWebP")) + rmdir(self, os.path.join(self.source_folder, "Source", "LibRawLite")) + rmdir(self, os.path.join(self.source_folder, "Source", "OpenEXR")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + for license in ["license-fi.txt", "license-gplv3.txt", "license-fi.txt"]: + copy(self, license, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + def imageformats_deps(): + components = [] + components.append("zlib::zlib") + if self.options.with_jpeg == "libjpeg": + components.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + components.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + components.append("mozjpeg::libjpeg") + if self.options.with_jpeg2000: + components.append("openjpeg::openjpeg") + if self.options.with_png: + components.append("libpng::libpng") + if self.options.with_webp: + components.append("libwebp::libwebp") + if self.options.with_openexr or self.options.with_tiff: + components.append("openexr::openexr") + if self.options.with_raw: + components.append("libraw::libraw") + if self.options.with_jxr: + components.append("jxrlib::jxrlib") + if self.options.with_tiff: + components.append("libtiff::libtiff") + return components + + self.cpp_info.components["FreeImage"].libs = ["freeimage"] + self.cpp_info.components["FreeImage"].requires = imageformats_deps() + self.cpp_info.components["FreeImagePlus"].libs = ["freeimageplus"] + self.cpp_info.components["FreeImagePlus"].requires = ["FreeImage"] + + if not self.options.shared: + self.cpp_info.components["FreeImage"].defines.append("FREEIMAGE_LIB") diff --git a/recipes/freeimage/all/patches/001_disable-plugins-depending-on-internal-third-party-libraries.patch b/recipes/freeimage/all/patches/001_disable-plugins-depending-on-internal-third-party-libraries.patch new file mode 100644 index 0000000000000..2a8015b31b1cd --- /dev/null +++ b/recipes/freeimage/all/patches/001_disable-plugins-depending-on-internal-third-party-libraries.patch @@ -0,0 +1,136 @@ +diff --git a/Source/FreeImage.h b/Source/FreeImage.h +index 12182cd..ebd0453 100644 +--- a/Source/FreeImage.h ++++ b/Source/FreeImage.h +@@ -410,16 +410,20 @@ FI_ENUM(FREE_IMAGE_FORMAT) { + FIF_DDS = 24, + FIF_GIF = 25, + FIF_HDR = 26, +- FIF_FAXG3 = 27, +- FIF_SGI = 28, +- FIF_EXR = 29, +- FIF_J2K = 30, +- FIF_JP2 = 31, +- FIF_PFM = 32, +- FIF_PICT = 33, +- FIF_RAW = 34, +- FIF_WEBP = 35, +- FIF_JXR = 36 ++/* conan: The G3 fax format plugin is deliberately disabled in our build of ++ FreeImage, since it requires usage of the vendored copy of libtiff. */ ++#if 0 ++ FIF_FAXG3 = 27, ++#endif ++ FIF_SGI = 27, ++ FIF_EXR = 28, ++ FIF_J2K = 29, ++ FIF_JP2 = 30, ++ FIF_PFM = 31, ++ FIF_PICT = 32, ++ FIF_RAW = 33, ++ FIF_WEBP = 34, ++ FIF_JXR = 35 + }; + + /** Image type used in FreeImage. +@@ -476,6 +480,9 @@ FI_ENUM(FREE_IMAGE_DITHER) { + /** Lossless JPEG transformations + Constants used in FreeImage_JPEGTransform + */ ++/* conan: The JPEGTransform functions are deliberately disabled in our build ++ of FreeImage, since they require usage of the vendored copy of libjpeg. */ ++#if 0 + FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { + FIJPEG_OP_NONE = 0, //! no transformation + FIJPEG_OP_FLIP_H = 1, //! horizontal flip +@@ -486,6 +493,7 @@ FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { + FIJPEG_OP_ROTATE_180 = 6, //! 180-degree rotation + FIJPEG_OP_ROTATE_270 = 7 //! 270-degree clockwise (or 90 ccw) + }; ++#endif + + /** Tone mapping operators. + Constants used in FreeImage_ToneMapping. +@@ -1089,6 +1097,9 @@ DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, + // JPEG lossless transformation routines + // -------------------------------------------------------------------------- + ++/* conan: The JPEGTransform functions are deliberately disabled in our build ++ of FreeImage, since they require usage of the vendored copy of libjpeg. */ ++#if 0 + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom); +@@ -1097,7 +1108,7 @@ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformFromHandle(FreeImageIO* src_io, + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombined(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedFromMemory(FIMEMORY* src_stream, FIMEMORY* dst_stream, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); +- ++#endif + + // -------------------------------------------------------------------------- + // Image manipulation toolkit +diff --git a/Source/FreeImage/Plugin.cpp b/Source/FreeImage/Plugin.cpp +index 11e7294..0119ba7 100644 +--- a/Source/FreeImage/Plugin.cpp ++++ b/Source/FreeImage/Plugin.cpp +@@ -238,7 +238,9 @@ + */ + s_plugins->AddNode(InitBMP); + s_plugins->AddNode(InitICO); ++#if FREEIMAGE_WITH_JPEG + s_plugins->AddNode(InitJPEG); ++#endif + s_plugins->AddNode(InitJNG); + s_plugins->AddNode(InitKOALA); + s_plugins->AddNode(InitIFF); +@@ -249,12 +251,16 @@ + s_plugins->AddNode(InitPCX); + s_plugins->AddNode(InitPNM, NULL, "PGM", "Portable Greymap (ASCII)", "pgm", "^P2"); + s_plugins->AddNode(InitPNM, NULL, "PGMRAW", "Portable Greymap (RAW)", "pgm", "^P5"); ++#if FREEIMAGE_WITH_PNG + s_plugins->AddNode(InitPNG); ++#endif + s_plugins->AddNode(InitPNM, NULL, "PPM", "Portable Pixelmap (ASCII)", "ppm", "^P3"); + s_plugins->AddNode(InitPNM, NULL, "PPMRAW", "Portable Pixelmap (RAW)", "ppm", "^P6"); + s_plugins->AddNode(InitRAS); + s_plugins->AddNode(InitTARGA); ++#if FREEIMAGE_WITH_TIFF + s_plugins->AddNode(InitTIFF); ++#endif + s_plugins->AddNode(InitWBMP); + s_plugins->AddNode(InitPSD); + s_plugins->AddNode(InitCUT); +@@ -263,18 +269,32 @@ + s_plugins->AddNode(InitDDS); + s_plugins->AddNode(InitGIF); + s_plugins->AddNode(InitHDR); ++/* conan: The G3 fax format plugin is deliberately disabled in our build of FreeImage ++ since it requires usage of the vendored copy of libtiff. */ ++#if 0 + s_plugins->AddNode(InitG3); ++#endif + s_plugins->AddNode(InitSGI); ++#if FREEIMAGE_WITH_OPENEXR + s_plugins->AddNode(InitEXR); ++#endif ++#if FREEIMAGE_WITH_OPENJPEG + s_plugins->AddNode(InitJ2K); + s_plugins->AddNode(InitJP2); ++#endif + s_plugins->AddNode(InitPFM); + s_plugins->AddNode(InitPICT); ++#if FREEIMAGE_WITH_RAW + s_plugins->AddNode(InitRAW); ++#endif ++#if FREEIMAGE_WITH_WEBP + s_plugins->AddNode(InitWEBP); ++#endif ++#if FREEIMAGE_WITH_JXR + #if !(defined(_MSC_VER) && (_MSC_VER <= 1310)) + s_plugins->AddNode(InitJXR); + #endif // unsupported by MS Visual Studio 2003 !!! ++#endif + + // external plugin initialization + diff --git a/recipes/freeimage/all/patches/002_fix-function-overload.patch b/recipes/freeimage/all/patches/002_fix-function-overload.patch new file mode 100644 index 0000000000000..adb1164f6d132 --- /dev/null +++ b/recipes/freeimage/all/patches/002_fix-function-overload.patch @@ -0,0 +1,40 @@ +diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp +index 8db177d..efa2c4e 100644 +--- a/Source/FreeImage/PluginJPEG.cpp ++++ b/Source/FreeImage/PluginJPEG.cpp +@@ -503,7 +503,7 @@ marker_is_icc(jpeg_saved_marker_ptr marker) { + return FALSE. You might want to issue an error message instead. + */ + static BOOL +-jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) { ++jpeg_read_icc_profile_(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) { + jpeg_saved_marker_ptr marker; + int num_markers = 0; + int seq_no; +@@ -745,7 +745,7 @@ read_markers(j_decompress_ptr cinfo, FIBITMAP *dib) { + BYTE *icc_profile = NULL; + unsigned icc_length = 0; + +- if( jpeg_read_icc_profile(cinfo, &icc_profile, &icc_length) ) { ++ if( jpeg_read_icc_profile_(cinfo, &icc_profile, &icc_length) ) { + // copy ICC profile data + FreeImage_CreateICCProfile(dib, icc_profile, icc_length); + // clean up +@@ -785,7 +785,7 @@ jpeg_write_comment(j_compress_ptr cinfo, FIBITMAP *dib) { + Write JPEG_APP2 marker (ICC profile) + */ + static BOOL +-jpeg_write_icc_profile(j_compress_ptr cinfo, FIBITMAP *dib) { ++jpeg_write_icc_profile_(j_compress_ptr cinfo, FIBITMAP *dib) { + // marker identifying string "ICC_PROFILE" (null-terminated) + BYTE icc_signature[12] = { 0x49, 0x43, 0x43, 0x5F, 0x50, 0x52, 0x4F, 0x46, 0x49, 0x4C, 0x45, 0x00 }; + +@@ -1038,7 +1038,7 @@ write_markers(j_compress_ptr cinfo, FIBITMAP *dib) { + jpeg_write_comment(cinfo, dib); + + // write ICC profile +- jpeg_write_icc_profile(cinfo, dib); ++ jpeg_write_icc_profile_(cinfo, dib); + + // write IPTC profile + jpeg_write_iptc_profile(cinfo, dib); diff --git a/recipes/freeimage/all/patches/003_use-external-jpeg.patch b/recipes/freeimage/all/patches/003_use-external-jpeg.patch new file mode 100644 index 0000000000000..5e98e5f24b235 --- /dev/null +++ b/recipes/freeimage/all/patches/003_use-external-jpeg.patch @@ -0,0 +1,23 @@ +diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp +index 573989c..aaeefa4 100644 +--- a/Source/FreeImage/PluginJPEG.cpp ++++ b/Source/FreeImage/PluginJPEG.cpp +@@ -35,9 +35,15 @@ extern "C" { + #undef FAR + #include + +-#include "../LibJPEG/jinclude.h" +-#include "../LibJPEG/jpeglib.h" +-#include "../LibJPEG/jerror.h" ++#ifndef FALSE ++#define FALSE 0 ++#endif ++#ifndef TRUE ++#define TRUE 1 ++#endif ++#include ++#include ++#include + } + + #include "FreeImage.h" diff --git a/recipes/freeimage/all/patches/004_use-external-jxrlib.patch b/recipes/freeimage/all/patches/004_use-external-jxrlib.patch new file mode 100644 index 0000000000000..0363694c6df41 --- /dev/null +++ b/recipes/freeimage/all/patches/004_use-external-jxrlib.patch @@ -0,0 +1,13 @@ +diff --git a/Source/FreeImage/PluginJXR.cpp b/Source/FreeImage/PluginJXR.cpp +index 0e14e09..8eb9d5d 100644 +--- a/Source/FreeImage/PluginJXR.cpp ++++ b/Source/FreeImage/PluginJXR.cpp +@@ -23,7 +23,7 @@ + #include "Utilities.h" + #include "../Metadata/FreeImageTag.h" + +-#include "../LibJXR/jxrgluelib/JXRGlue.h" ++#include + + // ========================================================== + // Plugin Interface diff --git a/recipes/freeimage/all/patches/005_use-external-libtiff.patch b/recipes/freeimage/all/patches/005_use-external-libtiff.patch new file mode 100644 index 0000000000000..d602f55194431 --- /dev/null +++ b/recipes/freeimage/all/patches/005_use-external-libtiff.patch @@ -0,0 +1,204 @@ +diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp +index 5068d94..8947b03 100644 +--- a/Source/FreeImage/PluginTIFF.cpp ++++ b/Source/FreeImage/PluginTIFF.cpp +@@ -37,9 +37,9 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibTIFF4/tiffiop.h" ++#include + #include "../Metadata/FreeImageTag.h" + #include "../OpenEXR/Half/half.h" + + #include "FreeImageIO.h" + #include "PSDParser.h" +@@ -199,15 +199,18 @@ Open a TIFF file for reading or writing + @param name + @param mode + */ ++/* + TIFF* + TIFFOpen(const char* name, const char* mode) { + return 0; + } ++*/ + + // ---------------------------------------------------------- + // TIFF library FreeImage-specific routines. + // ---------------------------------------------------------- + ++/* + void* + _TIFFmalloc(tmsize_t s) { + return malloc(s); +@@ -245,6 +248,7 @@ int + _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c) { + return (memcmp(p1, p2, (size_t) c)); + } ++*/ + + // ---------------------------------------------------------- + // in FreeImage warnings and errors are disabled + +diff --git a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp +index d5be902..8dbcd5d 100644 +--- a/Source/Metadata/XTIFF.cpp ++++ b/Source/Metadata/XTIFF.cpp +@@ -29,7 +29,7 @@ + #pragma warning (disable : 4786) // identifier was truncated to 'number' characters + #endif + +-#include "../LibTIFF4/tiffiop.h" ++#include + + #include "FreeImage.h" + #include "Utilities.h" +@@ -40,6 +40,43 @@ + // Extended TIFF Directory GEO Tag Support + // ---------------------------------------------------------- + ++// conan: function imported from libtiff/tif_dirinfo.c, in which it is not exported ++/* ++ * Return size of TIFFDataType in bytes. ++ * ++ * XXX: We need a separate function to determine the space needed ++ * to store the value. For TIFF_RATIONAL values TIFFDataWidth() returns 8, ++ * but we use 4-byte float to represent rationals. ++ */ ++int ++FreeImage_TIFFDataSize(TIFFDataType type) ++{ ++ switch (type) ++ { ++ case TIFF_BYTE: ++ case TIFF_SBYTE: ++ case TIFF_ASCII: ++ case TIFF_UNDEFINED: ++ return 1; ++ case TIFF_SHORT: ++ case TIFF_SSHORT: ++ return 2; ++ case TIFF_LONG: ++ case TIFF_SLONG: ++ case TIFF_FLOAT: ++ case TIFF_IFD: ++ case TIFF_RATIONAL: ++ case TIFF_SRATIONAL: ++ return 4; ++ case TIFF_DOUBLE: ++ case TIFF_LONG8: ++ case TIFF_SLONG8: ++ case TIFF_IFD8: ++ return 8; ++ default: ++ return 0; ++ } ++} + /** + Tiff info structure. + Entry format: +@@ -224,6 +261,33 @@ tiff_write_geotiff_profile(TIFF *tif, FIBITMAP *dib) { + // TIFF EXIF tag reading & writing + // ---------------------------------------------------------- + ++static uint32 exif_tag_ids[] = { ++ EXIFTAG_EXPOSURETIME, EXIFTAG_FNUMBER, EXIFTAG_EXPOSUREPROGRAM, ++ EXIFTAG_SPECTRALSENSITIVITY, EXIFTAG_ISOSPEEDRATINGS, EXIFTAG_OECF, ++ EXIFTAG_EXIFVERSION, EXIFTAG_DATETIMEORIGINAL, EXIFTAG_DATETIMEDIGITIZED, ++ EXIFTAG_COMPONENTSCONFIGURATION, EXIFTAG_COMPRESSEDBITSPERPIXEL, ++ EXIFTAG_SHUTTERSPEEDVALUE, EXIFTAG_APERTUREVALUE, ++ EXIFTAG_BRIGHTNESSVALUE, EXIFTAG_EXPOSUREBIASVALUE, ++ EXIFTAG_MAXAPERTUREVALUE, EXIFTAG_SUBJECTDISTANCE, EXIFTAG_METERINGMODE, ++ EXIFTAG_LIGHTSOURCE, EXIFTAG_FLASH, EXIFTAG_FOCALLENGTH, ++ EXIFTAG_SUBJECTAREA, EXIFTAG_MAKERNOTE, EXIFTAG_USERCOMMENT, ++ EXIFTAG_SUBSECTIME, EXIFTAG_SUBSECTIMEORIGINAL, ++ EXIFTAG_SUBSECTIMEDIGITIZED, EXIFTAG_FLASHPIXVERSION, EXIFTAG_COLORSPACE, ++ EXIFTAG_PIXELXDIMENSION, EXIFTAG_PIXELYDIMENSION, ++ EXIFTAG_RELATEDSOUNDFILE, EXIFTAG_FLASHENERGY, ++ EXIFTAG_SPATIALFREQUENCYRESPONSE, EXIFTAG_FOCALPLANEXRESOLUTION, ++ EXIFTAG_FOCALPLANEYRESOLUTION, EXIFTAG_FOCALPLANERESOLUTIONUNIT, ++ EXIFTAG_SUBJECTLOCATION, EXIFTAG_EXPOSUREINDEX, EXIFTAG_SENSINGMETHOD, ++ EXIFTAG_FILESOURCE, EXIFTAG_SCENETYPE, EXIFTAG_CFAPATTERN, ++ EXIFTAG_CUSTOMRENDERED, EXIFTAG_EXPOSUREMODE, EXIFTAG_WHITEBALANCE, ++ EXIFTAG_DIGITALZOOMRATIO, EXIFTAG_FOCALLENGTHIN35MMFILM, ++ EXIFTAG_SCENECAPTURETYPE, EXIFTAG_GAINCONTROL, EXIFTAG_CONTRAST, ++ EXIFTAG_SATURATION, EXIFTAG_SHARPNESS, EXIFTAG_DEVICESETTINGDESCRIPTION, ++ EXIFTAG_SUBJECTDISTANCERANGE, EXIFTAG_GAINCONTROL, EXIFTAG_GAINCONTROL, ++ EXIFTAG_IMAGEUNIQUEID ++}; ++static int nExifTags = sizeof(exif_tag_ids) / sizeof(exif_tag_ids[0]); ++ + /** + Read a single Exif tag + +@@ -575,43 +639,10 @@ tiff_read_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { + + // loop over all Core Directory Tags + // ### uses private data, but there is no other way ++ // -> conan: Best we can do without private headers is to hard-code a list of known EXIF tags and read those + if(md_model == TagLib::EXIF_MAIN) { +- const TIFFDirectory *td = &tif->tif_dir; +- +- uint32 lastTag = 0; //<- used to prevent reading some tags twice (as stored in tif_fieldinfo) +- +- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { +- const TIFFField *fld = tif->tif_fields[fi]; +- +- const uint32 tag_id = TIFFFieldTag(fld); +- +- if(tag_id == lastTag) { +- continue; +- } +- +- // test if tag value is set +- // (lifted directly from LibTiff _TIFFWriteDirectory) +- +- if( fld->field_bit == FIELD_CUSTOM ) { +- int is_set = FALSE; +- +- for(int ci = 0; ci < td->td_customValueCount; ci++ ) { +- is_set |= (td->td_customValues[ci].info == fld); +- } +- +- if( !is_set ) { +- continue; +- } +- +- } else if(!TIFFFieldSet(tif, fld->field_bit)) { +- continue; +- } +- +- // process *all* other tags (some will be ignored) +- +- tiff_read_exif_tag(tif, tag_id, dib, md_model); +- +- lastTag = tag_id; ++ for (int i = 0; i < nExifTags; ++i) { ++ tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model); + } + + } +@@ -723,10 +754,9 @@ tiff_write_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { + + TagLib& tag_lib = TagLib::instance(); + +- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { +- const TIFFField *fld = tif->tif_fields[fi]; +- +- const uint32 tag_id = TIFFFieldTag(fld); ++ for (int fi = 0, nfi = nExifTags; nfi > 0; nfi--, fi++) { ++ const uint32 tag_id = exif_tag_ids[fi]; ++ const TIFFField *fld = TIFFFieldWithTag(tif, tag_id); + + if(skip_write_field(tif, tag_id)) { + // skip tags that are already handled by the LibTIFF writing process +@@ -749,7 +779,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { + continue; + } + // type of storage may differ (e.g. rationnal array vs float array type) +- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { ++ if((unsigned)FreeImage_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { + // skip tag or _TIFFmemcpy will fail + continue; + } diff --git a/recipes/freeimage/all/patches/006_use-external-openexr.patch b/recipes/freeimage/all/patches/006_use-external-openexr.patch new file mode 100644 index 0000000000000..08915da726807 --- /dev/null +++ b/recipes/freeimage/all/patches/006_use-external-openexr.patch @@ -0,0 +1,44 @@ +diff --git a/Source/FreeImage/PluginEXR.cpp b/Source/FreeImage/PluginEXR.cpp +index b286430..82b3b72 100644 +--- a/Source/FreeImage/PluginEXR.cpp ++++ b/Source/FreeImage/PluginEXR.cpp +@@ -28,16 +28,16 @@ + #pragma warning (disable : 4800) // ImfVersion.h - 'const int' : forcing value to bool 'true' or 'false' (performance warning) + #endif + +-#include "../OpenEXR/IlmImf/ImfIO.h" +-#include "../OpenEXR/Iex/Iex.h" +-#include "../OpenEXR/IlmImf/ImfOutputFile.h" +-#include "../OpenEXR/IlmImf/ImfInputFile.h" +-#include "../OpenEXR/IlmImf/ImfRgbaFile.h" +-#include "../OpenEXR/IlmImf/ImfChannelList.h" +-#include "../OpenEXR/IlmImf/ImfRgba.h" +-#include "../OpenEXR/IlmImf/ImfArray.h" +-#include "../OpenEXR/IlmImf/ImfPreviewImage.h" +-#include "../OpenEXR/Half/half.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + + // ========================================================== +diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp +index 562fdd7..ce12649 100644 +--- a/Source/FreeImage/PluginTIFF.cpp ++++ b/Source/FreeImage/PluginTIFF.cpp +@@ -39,7 +39,7 @@ + #include "Utilities.h" + #include + #include "../Metadata/FreeImageTag.h" +-#include "../OpenEXR/Half/half.h" ++#include + + #include "FreeImageIO.h" + #include "PSDParser.h" diff --git a/recipes/freeimage/all/patches/007_use-external-openjpeg.patch b/recipes/freeimage/all/patches/007_use-external-openjpeg.patch new file mode 100644 index 0000000000000..fa4f8e7b6e791 --- /dev/null +++ b/recipes/freeimage/all/patches/007_use-external-openjpeg.patch @@ -0,0 +1,39 @@ +diff --git a/Source/FreeImage/J2KHelper.cpp b/Source/FreeImage/J2KHelper.cpp +index 1776c3b..538f1c5 100644 +--- a/Source/FreeImage/J2KHelper.cpp ++++ b/Source/FreeImage/J2KHelper.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // -------------------------------------------------------------------------- +diff --git a/Source/FreeImage/PluginJ2K.cpp b/Source/FreeImage/PluginJ2K.cpp +index b8bcfc8..621a903 100644 +--- a/Source/FreeImage/PluginJ2K.cpp ++++ b/Source/FreeImage/PluginJ2K.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // ========================================================== +diff --git a/Source/FreeImage/PluginJP2.cpp b/Source/FreeImage/PluginJP2.cpp +index 742fe2c..c57f626 100644 +--- a/Source/FreeImage/PluginJP2.cpp ++++ b/Source/FreeImage/PluginJP2.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // ========================================================== diff --git a/recipes/freeimage/all/patches/008_use-external-png-zlib.patch b/recipes/freeimage/all/patches/008_use-external-png-zlib.patch new file mode 100644 index 0000000000000..da489b6b82cd4 --- /dev/null +++ b/recipes/freeimage/all/patches/008_use-external-png-zlib.patch @@ -0,0 +1,40 @@ +diff --git a/Source/FreeImage/PluginPNG.cpp b/Source/FreeImage/PluginPNG.cpp +index ba2ef17..c3c5cd6 100644 +--- a/Source/FreeImage/PluginPNG.cpp ++++ b/Source/FreeImage/PluginPNG.cpp +@@ -40,8 +40,8 @@ + + // ---------------------------------------------------------- + +-#include "../ZLib/zlib.h" +-#include "../LibPNG/png.h" ++#include ++#include + + // ---------------------------------------------------------- + +diff --git a/Source/FreeImage/ZLibInterface.cpp b/Source/FreeImage/ZLibInterface.cpp +index 3ab6d32..725618b 100644 +--- a/Source/FreeImage/ZLibInterface.cpp ++++ b/Source/FreeImage/ZLibInterface.cpp +@@ -19,10 +19,9 @@ + // Use at your own risk! + // ========================================================== + +-#include "../ZLib/zlib.h" ++#include + #include "FreeImage.h" + #include "Utilities.h" +-#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */ + + /** + Compresses a source buffer into a target buffer, using the ZLib library. +@@ -115,7 +114,7 @@ FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_s + return 0; + case Z_OK: { + // patch header, setup crc and length (stolen from mod_trace_output) +- BYTE *p = target + 8; *p++ = 2; *p = OS_CODE; // xflags, os_code ++ BYTE *p = target + 8; *p++ = 2; *p = 0x03; // xflags, os_code + crc = crc32(crc, source, source_size); + memcpy(target + 4 + dest_len, &crc, 4); + memcpy(target + 8 + dest_len, &source_size, 4); diff --git a/recipes/freeimage/all/patches/009_use-external-rawlib.patch b/recipes/freeimage/all/patches/009_use-external-rawlib.patch new file mode 100644 index 0000000000000..6afa0bffa2549 --- /dev/null +++ b/recipes/freeimage/all/patches/009_use-external-rawlib.patch @@ -0,0 +1,13 @@ +diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp +index e9bd5bf..c7f8758 100644 +--- a/Source/FreeImage/PluginRAW.cpp ++++ b/Source/FreeImage/PluginRAW.cpp +@@ -19,7 +19,7 @@ + // Use at your own risk! + // ========================================================== + +-#include "../LibRawLite/libraw/libraw.h" ++#include + + #include "FreeImage.h" + #include "Utilities.h" diff --git a/recipes/freeimage/all/patches/010_use-external-webp.patch b/recipes/freeimage/all/patches/010_use-external-webp.patch new file mode 100644 index 0000000000000..4d1757c395fd7 --- /dev/null +++ b/recipes/freeimage/all/patches/010_use-external-webp.patch @@ -0,0 +1,17 @@ +diff --git a/Source/FreeImage/PluginWebP.cpp b/Source/FreeImage/PluginWebP.cpp +index 7c9f62f..c401447 100644 +--- a/Source/FreeImage/PluginWebP.cpp ++++ b/Source/FreeImage/PluginWebP.cpp +@@ -24,9 +24,9 @@ + + #include "../Metadata/FreeImageTag.h" + +-#include "../LibWebP/src/webp/decode.h" +-#include "../LibWebP/src/webp/encode.h" +-#include "../LibWebP/src/webp/mux.h" ++#include ++#include ++#include + + // ========================================================== + // Plugin Interface diff --git a/recipes/freeimage/all/patches/011_update-libraw-support.patch b/recipes/freeimage/all/patches/011_update-libraw-support.patch new file mode 100644 index 0000000000000..666b98d8aff3a --- /dev/null +++ b/recipes/freeimage/all/patches/011_update-libraw-support.patch @@ -0,0 +1,149 @@ +diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp +index e9bd5bf..c7f8758 100644 +--- a/Source/FreeImage/PluginRAW.cpp ++++ b/Source/FreeImage/PluginRAW.cpp +@@ -59,21 +59,18 @@ + } + + int valid() { +- return (_io && _handle); ++ return (_io && _handle) ? 1 : 0; + } + + int read(void *buffer, size_t size, size_t count) { +- if(substream) return substream->read(buffer, size, count); + return _io->read_proc(buffer, (unsigned)size, (unsigned)count, _handle); + } + + int seek(INT64 offset, int origin) { +- if(substream) return substream->seek(offset, origin); + return _io->seek_proc(_handle, (long)offset, origin); + } + + INT64 tell() { +- if(substream) return substream->tell(); + return _io->tell_proc(_handle); + } + +@@ -83,19 +80,21 @@ + + int get_char() { + int c = 0; +- if(substream) return substream->get_char(); +- if(!_io->read_proc(&c, 1, 1, _handle)) return -1; ++ if (!_io->read_proc(&c, 1, 1, _handle)) { ++ return -1; ++ } + return c; + } + + char* gets(char *buffer, int length) { +- if (substream) return substream->gets(buffer, length); + memset(buffer, 0, length); + for(int i = 0; i < length; i++) { +- if(!_io->read_proc(&buffer[i], 1, 1, _handle)) ++ if (!_io->read_proc(&buffer[i], 1, 1, _handle)) { + return NULL; +- if(buffer[i] == 0x0A) ++ } ++ if (buffer[i] == 0x0A) { + break; ++ } + } + return buffer; + } +@@ -104,7 +103,6 @@ + std::string buffer; + char element = 0; + bool bDone = false; +- if(substream) return substream->scanf_one(fmt,val); + do { + if(_io->read_proc(&element, 1, 1, _handle) == 1) { + switch(element) { +@@ -127,7 +125,6 @@ + } + + int eof() { +- if(substream) return substream->eof(); + return (_io->tell_proc(_handle) >= _eof); + } + +@@ -564,48 +561,58 @@ + { 0x4D, 0x4D, 0x00, 0x2A } Classic TIFF, big-endian + */ + // Canon (CR2), little-endian byte order +- const BYTE CR2_II[] = { 0x49, 0x49, 0x2A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x43, 0x52, 0x02, 0x00 }; ++ static const BYTE CR2_II[] = { 0x49, 0x49, 0x2A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x43, 0x52, 0x02, 0x00 }; + // Canon (CRW), little-endian byte order +- const BYTE CRW_II[] = { 0x49, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x48, 0x45, 0x41, 0x50, 0x43, 0x43, 0x44, 0x52, 0x02, 0x00 }; ++ static const BYTE CRW_II[] = { 0x49, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x48, 0x45, 0x41, 0x50, 0x43, 0x43, 0x44, 0x52, 0x02, 0x00 }; + // Minolta (MRW) +- const BYTE MRW[] = { 0x00, 0x4D, 0x52, 0x4D, 0x00 }; ++ static const BYTE MRW[] = { 0x00, 0x4D, 0x52, 0x4D, 0x00 }; + // Olympus (ORF), little-endian byte order +- const BYTE ORF_IIRS[] = { 0x49, 0x49, 0x52, 0x53, 0x08, 0x00, 0x00, 0x00 }; +- const BYTE ORF_IIRO[] = { 0x49, 0x49, 0x52, 0x4F, 0x08, 0x00, 0x00, 0x00 }; ++ static const BYTE ORF_IIRS[] = { 0x49, 0x49, 0x52, 0x53, 0x08, 0x00, 0x00, 0x00 }; ++ static const BYTE ORF_IIRO[] = { 0x49, 0x49, 0x52, 0x4F, 0x08, 0x00, 0x00, 0x00 }; + // Olympus (ORF), big-endian byte order +- const BYTE ORF_MMOR[] = { 0x4D, 0x4D, 0x4F, 0x52, 0x00, 0x00, 0x00, 0x08 }; ++ static const BYTE ORF_MMOR[] = { 0x4D, 0x4D, 0x4F, 0x52, 0x00, 0x00, 0x00, 0x08 }; + // Fujifilm (RAF) +- const BYTE RAF[] = { 0x46, 0x55, 0x4A, 0x49, 0x46, 0x49, 0x4C, 0x4D, 0x43, 0x43, 0x44, 0x2D, 0x52, 0x41, 0x57, 0x20 }; ++ static const BYTE RAF[] = { 0x46, 0x55, 0x4A, 0x49, 0x46, 0x49, 0x4C, 0x4D, 0x43, 0x43, 0x44, 0x2D, 0x52, 0x41, 0x57, 0x20 }; + // Panasonic (RW2) or Leica (RWL), little-endian byte order +- const BYTE RWx_II[] = { 0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8, 0xF8, 0x25, 0x1D, 0x4D, 0x94, 0x7A, 0x6E, 0x77, 0x82, 0x2B, 0x5D, 0x6A }; ++ static const BYTE RWx_II[] = { 0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8, 0xF8, 0x25, 0x1D, 0x4D, 0x94, 0x7A, 0x6E, 0x77, 0x82, 0x2B, 0x5D, 0x6A }; + // Panasonic (RAW) or Leica (RAW), little-endian byte order +- const BYTE RAW_II[] = { 0x49, 0x49, 0x55, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0x00, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00 }; ++ static const BYTE RAW_II[] = { 0x49, 0x49, 0x55, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0x00, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00 }; + // Foveon (X3F) +- const BYTE X3F[] = { 0x46, 0x4F, 0x56, 0x62 }; ++ static const BYTE X3F[] = { 0x46, 0x4F, 0x56, 0x62 }; + + if(io->read_proc(signature, 1, signature_size, handle) != signature_size) { + return FALSE; + } +- if(memcmp(CR2_II, signature, 12) == 0) ++ if (memcmp(CR2_II, signature, 12) == 0) { + return TRUE; +- if(memcmp(CRW_II, signature, 16) == 0) ++ } ++ if (memcmp(CRW_II, signature, 16) == 0) { + return TRUE; +- if(memcmp(MRW, signature, 5) == 0) ++ } ++ if (memcmp(MRW, signature, 5) == 0) { + return TRUE; +- if(memcmp(ORF_IIRS, signature, 8) == 0) ++ } ++ if (memcmp(ORF_IIRS, signature, 8) == 0) { + return TRUE; +- if(memcmp(ORF_IIRO, signature, 8) == 0) ++ } ++ if (memcmp(ORF_IIRO, signature, 8) == 0) { + return TRUE; +- if(memcmp(ORF_MMOR, signature, 8) == 0) ++ } ++ if (memcmp(ORF_MMOR, signature, 8) == 0) { + return TRUE; +- if(memcmp(RAF, signature, 16) == 0) ++ } ++ if (memcmp(RAF, signature, 16) == 0) { + return TRUE; +- if(memcmp(RWx_II, signature, 24) == 0) ++ } ++ if (memcmp(RWx_II, signature, 24) == 0) { + return TRUE; +- if(memcmp(RAW_II, signature, 18) == 0) ++ } ++ if (memcmp(RAW_II, signature, 18) == 0) { + return TRUE; +- if(memcmp(X3F, signature, 4) == 0) ++ } ++ if (memcmp(X3F, signature, 4) == 0) { + return TRUE; ++ } + + return FALSE; + } diff --git a/recipes/freeimage/all/patches/012_use-functions-to-override-libtiff-warning-error-handlers.patch b/recipes/freeimage/all/patches/012_use-functions-to-override-libtiff-warning-error-handlers.patch new file mode 100644 index 0000000000000..7c62447a68a50 --- /dev/null +++ b/recipes/freeimage/all/patches/012_use-functions-to-override-libtiff-warning-error-handlers.patch @@ -0,0 +1,31 @@ +diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp +index a9fcf0e..b1f7b32 100644 +--- a/Source/FreeImage/PluginTIFF.cpp ++++ b/Source/FreeImage/PluginTIFF.cpp +@@ -258,7 +258,7 @@ static void + msdosWarningHandler(const char* module, const char* fmt, va_list ap) { + } + +-TIFFErrorHandler _TIFFwarningHandler = msdosWarningHandler; ++//TIFFErrorHandler _TIFFwarningHandler = msdosWarningHandler; + + static void + msdosErrorHandler(const char* module, const char* fmt, va_list ap) { +@@ -273,7 +273,7 @@ msdosErrorHandler(const char* module, const char* fmt, va_list ap) { + */ + } + +-TIFFErrorHandler _TIFFerrorHandler = msdosErrorHandler; ++//TIFFErrorHandler _TIFFerrorHandler = msdosErrorHandler; + + // ---------------------------------------------------------- + +@@ -2659,6 +2659,8 @@ InitTIFF(Plugin *plugin, int format_id) { + // Set up the callback for extended TIFF directory tag support (see XTIFF.cpp) + // Must be called before using libtiff + XTIFFInitialize(); ++ TIFFSetWarningHandler(msdosWarningHandler); ++ TIFFSetErrorHandler(msdosErrorHandler); + + plugin->format_proc = Format; + plugin->description_proc = Description; diff --git a/recipes/freeimage/all/patches/013_use-typedef-as-already-declared.patch b/recipes/freeimage/all/patches/013_use-typedef-as-already-declared.patch new file mode 100644 index 0000000000000..27428582075c5 --- /dev/null +++ b/recipes/freeimage/all/patches/013_use-typedef-as-already-declared.patch @@ -0,0 +1,15 @@ +diff --git a/Source/FreeImage.h b/Source/FreeImage.h +index 1fd9c2f..59de277 100644 +--- a/Source/FreeImage.h ++++ b/Source/FreeImage.h +@@ -155,8 +155,8 @@ typedef uint8_t BYTE; + typedef uint16_t WORD; + typedef uint32_t DWORD; + typedef int32_t LONG; +-typedef int64_t INT64; +-typedef uint64_t UINT64; ++typedef long long int INT64; ++typedef long long unsigned int UINT64; + #else + // MS is not C99 ISO compliant + typedef long BOOL; diff --git a/recipes/freeimage/all/patches/014_no_auto_ptr.patch b/recipes/freeimage/all/patches/014_no_auto_ptr.patch new file mode 100644 index 0000000000000..7118f0a2f320f --- /dev/null +++ b/recipes/freeimage/all/patches/014_no_auto_ptr.patch @@ -0,0 +1,24 @@ +--- a/Source/FreeImage/MultiPage.cpp ++++ b/Source/FreeImage/MultiPage.cpp +@@ -271,8 +271,8 @@ FreeImage_OpenMultiBitmap(FREE_IMAGE_FORMAT fif, const char *filename, BOOL crea + } + } + +- std::auto_ptr bitmap (new FIMULTIBITMAP); +- std::auto_ptr header (new MULTIBITMAPHEADER); ++ std::unique_ptr bitmap (new FIMULTIBITMAP); ++ std::unique_ptr header (new MULTIBITMAPHEADER); + header->m_filename = filename; + // io is default + header->node = node; +@@ -337,8 +337,8 @@ FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_h + PluginNode *node = list->FindNodeFromFIF(fif); + + if (node) { +- std::auto_ptr bitmap (new FIMULTIBITMAP); +- std::auto_ptr header (new MULTIBITMAPHEADER); ++ std::unique_ptr bitmap (new FIMULTIBITMAP); ++ std::unique_ptr header (new MULTIBITMAPHEADER); + header->io = *io; + header->node = node; + header->fif = fif; diff --git a/recipes/freeimage/all/test_package/CMakeLists.txt b/recipes/freeimage/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a3aaf996ceb62 --- /dev/null +++ b/recipes/freeimage/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(freeimage CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE freeimage::freeimage) diff --git a/recipes/freeimage/all/test_package/conanfile.py b/recipes/freeimage/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f97d7f9f47a9 --- /dev/null +++ b/recipes/freeimage/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + bees = os.path.join(self.source_folder, "test.png") + self.run(f"{bin_path} {bees}", env="conanrun") diff --git a/recipes/freeimage/all/test_package/test.png b/recipes/freeimage/all/test_package/test.png new file mode 100644 index 0000000000000000000000000000000000000000..11640c7488fb114127f869572d7ffec132e77746 GIT binary patch literal 177424 zcmV)7K*zs{P)b{WyyIZw$}P$?~|Ez>27vYyoe$-l%W|7Y|jApvke&j<$g8%GPZ2YcqB?9 zMT(d1s;;ie%yV{pYxyB|w%|gex-N-Rxi9g>x(2^~_n&}`9Ptr6i*JDhAG`k!3H23u zpG@g9@y`GOoqS_|kUj%mgF$Y=NB2AGP4Jw)_I&^D5C8n@-~8sE-~H~%$8$gb$A7c^ z`@i`S^6EeT-N$YI?0#d?N8G3b?s=X4VIx0(c=h&jx!<){actT5j0@_u>ND^&@)b}Z z0K*@V=imsM*r3jf zqx3^`ItVOW4hDV?!z{bY5-)400IVu5(Eke zV1h8h05d_{LECZc*p3f(Je_IJZUb!u0Yz4c7Yz+ml_b>qLj!gi2!r7bmXEOGmJiR_ zbGonb)$vPsVV7#AstSuC1r;XZy)HoN098BL|%6d9-`>JbF$a9d{5C?5Rv7UCh|_ zyKOw|`>R)%hs(Iz_lNs^-^Uo-hN?KmwvDPy+Q!%}+jglg>b>em$ zH-o^9ATR)?(?$cGq#@G*48}1Mn4}XZ1`q%t3IG!#LJ2ikJNAq2?(}fa{a$w)YsWS+ zcGiGODpmmu*hD2j90ExbG8ou!;3UE9wBw{3>Y*Cq{opI<&8XMAUS0H1x*v5{ybm{W z6bG?MdsPkA1_&+K?s&rOZu@r3>oLD;KdB#q=XfSgJnh?@$Khknp1x&HAB06wBngnJ zvVKX$Xd_%NsV6u1sEVepaB8_n*6y+fX~0>4Blw`M7V2w2;NuKkAMF5&wl#T zUw-@k*Z=(c-~Q=$!k;?N18+uM7>aOM!eDQR32hG#mCx=jcl$nyJuca|RDne7OyMzj zLIQNsuz{I82Tk1-D!NDlHed~^L2SW=Im~N7Xai@9Q~Mn4zH_eK!&O0u(z;8SiRmLi zE2fzXLr?%a-Dt)Pn(Lh-K?rsQM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VJQ%uC@ z>D=x~cWZWhdU*Ho!w=v7?l-^t-GBVkay%a|Uwrk;Z@&KKufBQri#HEu2gnQ#!X|<%!m`y-{8wLwK`x>+L*rj1V}-DC69WEB&t9 zahQNakd82s6_p%_N0FL6&eq(4m>|@CbOsj2JW4&Byfcx`fuX zLjv5ngQPfiInLn;Ba^NQxVUf>#(&FVREVTF3^6&a>uKqivz(4o`)g;5N|&Z4+N8bG z)gaz9RrKL;N$RI-w{&Y)#XV + +#include + +#if defined(FREEIMAGE_LIB) || !defined(WIN32) +#define NEED_INIT 1 +#endif + +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; + } + +#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); + } + } + +#if NEED_INIT + FreeImage_DeInitialise(); +#endif + + return 0; +} diff --git a/recipes/freeimage/all/test_v1_package/CMakeLists.txt b/recipes/freeimage/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/freeimage/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/freeimage/all/test_v1_package/conanfile.py b/recipes/freeimage/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6895afd01c85c --- /dev/null +++ b/recipes/freeimage/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + bees = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") + self.run(f"{bin_path} {bees}", run_environment=True) diff --git a/recipes/freeimage/config.yml b/recipes/freeimage/config.yml new file mode 100644 index 0000000000000..7e5f545547ca1 --- /dev/null +++ b/recipes/freeimage/config.yml @@ -0,0 +1,3 @@ +versions: + "3.18.0": + folder: all diff --git a/recipes/freetype/all/conandata.yml b/recipes/freetype/all/conandata.yml new file mode 100644 index 0000000000000..ba0c7f323c387 --- /dev/null +++ b/recipes/freetype/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "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" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.12.1/freetype-2.12.1.tar.xz" + sha256: "4766f20157cc4cf0cd292f80bf917f92d1c439b243ac3018debf6b9140c41a7f" + "2.11.1": + url: + - "https://download.savannah.gnu.org/releases/freetype/freetype-2.11.1.tar.xz" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.11.1/freetype-2.11.1.tar.xz" + sha256: "3333ae7cfda88429c97a7ae63b7d01ab398076c3b67182e960e5684050f2c5c8" + "2.10.4": + url: + - "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 new file mode 100644 index 0000000000000..907eedb701583 --- /dev/null +++ b/recipes/freetype/all/conanfile.py @@ -0,0 +1,272 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, collect_libs, copy, export_conandata_patches, load, + get, rename, replace_in_file, rmdir, save +) +from conan.tools.scm import Version +import os +import re +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" + 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, + } + + @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: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_png: + self.requires("libpng/1.6.39") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.get_safe("with_brotli"): + self.requires("brotli/1.0.9") + + 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) + if Version(self.version) >= "2.11.0": + tc.variables["FT_REQUIRE_ZLIB"] = self.options.with_zlib + tc.variables["FT_DISABLE_ZLIB"] = not self.options.with_zlib + tc.variables["FT_REQUIRE_PNG"] = self.options.with_png + tc.variables["FT_DISABLE_PNG"] = not self.options.with_png + tc.variables["FT_REQUIRE_BZIP2"] = self.options.with_bzip2 + tc.variables["FT_DISABLE_BZIP2"] = not self.options.with_bzip2 + # 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 + 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 + # 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) + # 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, if_harfbuzz_found, "if(0)") + if not self.options.with_png: + replace_in_file(self, cmakelists, "find_package(PNG)", "") + replace_in_file(self, cmakelists, "if (PNG_FOUND)", "if(0)") + if not self.options.with_zlib: + replace_in_file(self, cmakelists, "find_package(ZLIB)", "") + replace_in_file(self, cmakelists, "if (ZLIB_FOUND)", "if(0)") + 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)") + + 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() + cmake = CMake(self) + cmake.configure() + cmake.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) + libs = "-lfreetyped" if self.settings.build_type == "Debug" else "-lfreetype" + staticlibs = f"-lm {libs}" if self.settings.os == "Linux" else libs + 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"-lfreetype", libs) + 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 next(re.finditer(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): + cmake = CMake(self) + cmake.install() + + 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) + + 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"} + ) + + 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 = collect_libs(self) + 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) + # 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 + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + 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/all/patches/2.13.0-0001-fix-fallthrough.patch b/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch new file mode 100644 index 0000000000000..0386998dea7bb --- /dev/null +++ b/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch @@ -0,0 +1,13 @@ +--- 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/CMakeLists.txt b/recipes/freetype/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9ac9bd88e8a63 --- /dev/null +++ b/recipes/freetype/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +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/all/test_package/OpenSans-Bold.ttf b/recipes/freetype/all/test_package/OpenSans-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd79d43bea0293ac1b20e8aca1142627983d2c07 GIT binary patch literal 224592 zcmbTe349bq+CN^^*W8&qlRGn+9E1>Zk;HIi2qAQM&s|SFJ%kcM ztoRa0YJNqpo==B7){*c7z97W@SkL?(1tgw-mGBjZ&?~BEY2ON6wlN#$xK1AGSq zD5=XEgs-#_!XNKjk&?b;$_pWc&;z($J8bNb35hSKj3UIe4+De^oBEj3njH2FA(1*xUL`h==2ehvp%>%NZf8hd%rho_>j8a zE}aO%^E=~u)+jUtC2GrY{us_ zl92eM36q9Tcwf`}2q6&+zFUOhj)t!5_)^Ym4;wrGN;GOT5OOllv016VFM8pQzGbI& zxq3PJY6!<#@xguS)^auAJm@t4J5F5ciajAhZ>sOh+m47dPrUltPqjf1StrvwLw~6)2dGq)H|u z#QC5|Ejb{Dl4;@JZPe3A3a+ga zmJ=drO#Jn3}ACeJ4qc6{t&MC z?*Z;vn?PD`^J4)kp2Mq23Q8w77qJkqbs-ZOzUj8sCbU=c;UtIMuhNtD{xT4_@1o$H z;rtVF#4^kFTg{S_cX1vb$3N=A30MGwsa|W(+QU8Ei zh5A)S1K=UaUvCzVk~}S6bvgMU~%$87_zLY|bd|5$e- z(%oyIF~cdN>;1LrB$=i1*Vg9;8fLt=!_|qCP%jAa1?)|kQ$DrT;Yt7_c zkvS&spl?9#nd~w7zrTh|Z3d4X3-AErdB%5vx!r}ei5wJ^Lc>vi#dLwNiB{4bkn1LL zM%YI-;QXAhi5wK?x4zHhPSmz;lwN7wD1@SJY&|YTwl0#2T95O2ttS;(gRT?m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tTS8z0@e`X8tCO#a)IcW%A-(ks3RZ@D~e^ZO-F-@GjAv{}c$zvZjVRc|ltfBJ%X zUAuihy0gCgaLNszUh~(9xB3o#>F%!%3(URuVD^t0kt*NqgXgcAQ3X8&ZeZdg=S(&I&9l96JNncPTa6oTZD6wgSyrO}E$qsUWSL@$b) zeiedGcV2q--ffxBzFdAxvvoq-q3`jk!R^h($ literal 0 HcmV?d00001 diff --git a/recipes/freetype/all/test_package/conanfile.py b/recipes/freetype/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5da019d033eb1 --- /dev/null +++ b/recipes/freetype/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +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" + + 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/all/test_package/test_package.c b/recipes/freetype/all/test_package/test_package.c new file mode 100644 index 0000000000000..332eeaeae1c39 --- /dev/null +++ b/recipes/freetype/all/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/all/test_package_module/CMakeLists.txt b/recipes/freetype/all/test_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..2c27f3b8d69b0 --- /dev/null +++ b/recipes/freetype/all/test_package_module/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Freetype REQUIRED MODULE) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Freetype::Freetype) + +# 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() diff --git a/recipes/freetype/all/test_package_module/conanfile.py b/recipes/freetype/all/test_package_module/conanfile.py new file mode 100644 index 0000000000000..e789c017730b3 --- /dev/null +++ b/recipes/freetype/all/test_package_module/conanfile.py @@ -0,0 +1,27 @@ +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" + + 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/all/test_v1_package/CMakeLists.txt b/recipes/freetype/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/freetype/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/freetype/all/test_v1_package/conanfile.py b/recipes/freetype/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..da2d908b1d4a7 --- /dev/null +++ b/recipes/freetype/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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/all/test_v1_package_module/CMakeLists.txt b/recipes/freetype/all/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..27f7a57e7a0b3 --- /dev/null +++ b/recipes/freetype/all/test_v1_package_module/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package_module + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/freetype/all/test_v1_package_module/conanfile.py b/recipes/freetype/all/test_v1_package_module/conanfile.py new file mode 100644 index 0000000000000..7834358365541 --- /dev/null +++ b/recipes/freetype/all/test_v1_package_module/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + 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/config.yml b/recipes/freetype/config.yml new file mode 100644 index 0000000000000..03088d905ff89 --- /dev/null +++ b/recipes/freetype/config.yml @@ -0,0 +1,9 @@ +versions: + "2.13.0": + folder: all + "2.12.1": + folder: all + "2.11.1": + folder: all + "2.10.4": + folder: all diff --git a/recipes/freexl/all/conandata.yml b/recipes/freexl/all/conandata.yml new file mode 100644 index 0000000000000..1ded763735f94 --- /dev/null +++ b/recipes/freexl/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.6": + url: "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-1.0.6.tar.gz" + sha256: "3de8b57a3d130cb2881ea52d3aa9ce1feedb1b57b7daa4eb37f751404f90fc22" + "1.0.5": + url: "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-1.0.5.tar.gz" + sha256: "3dc9b150d218b0e280a3d6a41d93c1e45f4d7155829d75f1e5bf3e0b0de6750d" +patches: + "1.0.6": + - patch_file: "patches/fix-nmake-1.0.6.patch" + "1.0.5": + - patch_file: "patches/fix-nmake-1.0.5.patch" + - patch_file: "patches/msvc-round-lround.patch" diff --git a/recipes/freexl/all/conanfile.py b/recipes/freexl/all/conanfile.py new file mode 100644 index 0000000000000..794b52fdc98a5 --- /dev/null +++ b/recipes/freexl/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeDeps, NMakeToolchain +import os + +required_conan_version = ">=1.55.0" + + +class FreexlConan(ConanFile): + name = "freexl" + description = "FreeXL is an open source library to extract valid data " \ + "from within an Excel (.xls) spreadsheet." + license = ["MPL-1.0", "GPL-2.0-only", "LGPL-2.1-only"] + topics = ("excel", "xls") + homepage = "https://www.gaia-gis.it/fossil/freexl/index" + 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 _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + + def build_requirements(self): + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + args = "freexl_i.lib FREEXL_EXPORT=-DDLL_EXPORT" if self.options.shared else "freexl.lib" + with chdir(self, self.source_folder): + self.run(f"nmake -f makefile.vc {args}") + else: + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "freexl.h", src=os.path.join(self.source_folder, "headers"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "freexl") + suffix = "_i" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"freexl{suffix}"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/freexl/all/patches/fix-nmake-1.0.5.patch b/recipes/freexl/all/patches/fix-nmake-1.0.5.patch new file mode 100644 index 0000000000000..e966ed03b4ba3 --- /dev/null +++ b/recipes/freexl/all/patches/fix-nmake-1.0.5.patch @@ -0,0 +1,35 @@ +--- a/makefile.vc ++++ b/makefile.vc +@@ -7,7 +7,7 @@ + LIBOBJ = freexl.obj + FREEXL_DLL = freexl$(VERSION).dll + +-CFLAGS = /nologo -IC:\OSGeo4W\include -I. -Iheaders $(OPTFLAGS) ++CFLAGS = /nologo -I. -Iheaders $(OPTFLAGS) + + default: all + +@@ -23,9 +23,8 @@ freexl.lib: $(LIBOBJ) + $(FREEXL_DLL): freexl_i.lib + + freexl_i.lib: $(LIBOBJ) +- link /debug /dll /out:$(FREEXL_DLL) \ +- /implib:freexl_i.lib $(LIBOBJ) \ +- C:\OSGeo4w\lib\iconv.lib ++ link /dll /out:$(FREEXL_DLL) \ ++ /implib:freexl_i.lib $(LIBOBJ) + if exist $(FREEXL_DLL).manifest mt -manifest \ + $(FREEXL_DLL).manifest -outputresource:$(FREEXL_DLL);2 + +--- a/nmake.opt ++++ b/nmake.opt +@@ -2,8 +2,7 @@ + INSTDIR=C:\OSGeo4W + + # Uncomment the first for an optimized build, or the second for debug. +-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \ +- /DDLL_EXPORT ++OPTFLAGS= /nologo /fp:precise /W3 /D_CRT_SECURE_NO_WARNINGS $(FREEXL_EXPORT) + #OPTFLAGS= /nologo /Zi /MD /Fdfreexl.pdb /DDLL_EXPORT + + # Set the version number for the DLL. Normally we leave this blank since diff --git a/recipes/freexl/all/patches/fix-nmake-1.0.6.patch b/recipes/freexl/all/patches/fix-nmake-1.0.6.patch new file mode 100644 index 0000000000000..efeef131f022d --- /dev/null +++ b/recipes/freexl/all/patches/fix-nmake-1.0.6.patch @@ -0,0 +1,35 @@ +--- a/makefile.vc ++++ b/makefile.vc +@@ -7,7 +7,7 @@ + LIBOBJ = freexl.obj + FREEXL_DLL = freexl$(VERSION).dll + +-CFLAGS = /nologo -I. -Iheaders -IC:\OSGeo4W\include $(OPTFLAGS) ++CFLAGS = /nologo -I. -Iheaders $(OPTFLAGS) + + default: all + +@@ -23,9 +23,8 @@ freexl.lib: $(LIBOBJ) + $(FREEXL_DLL): freexl_i.lib + + freexl_i.lib: $(LIBOBJ) +- link /debug /dll /out:$(FREEXL_DLL) \ +- /implib:freexl_i.lib $(LIBOBJ) \ +- C:\OSGeo4w\lib\iconv.lib ++ link /dll /out:$(FREEXL_DLL) \ ++ /implib:freexl_i.lib $(LIBOBJ) + if exist $(FREEXL_DLL).manifest mt -manifest \ + $(FREEXL_DLL).manifest -outputresource:$(FREEXL_DLL);2 + +--- a/nmake.opt ++++ b/nmake.opt +@@ -2,8 +2,7 @@ + INSTDIR=C:\OSGeo4W + + # Uncomment the first for an optimized build, or the second for debug. +-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \ +- /DDLL_EXPORT ++OPTFLAGS= /nologo /fp:precise /W3 /D_CRT_SECURE_NO_WARNINGS $(FREEXL_EXPORT) + #OPTFLAGS= /nologo /Zi /MD /Fdfreexl.pdb /DDLL_EXPORT + + # Set the version number for the DLL. Normally we leave this blank since diff --git a/recipes/freexl/all/patches/msvc-round-lround.patch b/recipes/freexl/all/patches/msvc-round-lround.patch new file mode 100644 index 0000000000000..bca7efcf9da8b --- /dev/null +++ b/recipes/freexl/all/patches/msvc-round-lround.patch @@ -0,0 +1,11 @@ +--- a/src/freexl.c ++++ b/src/freexl.c +@@ -89,7 +89,7 @@ freexl_version (void) + return freexlversion; + } + +-#if defined(_WIN32) && !defined(__MINGW32__) ++#if defined(_WIN32) && !defined(__MINGW32__) && _MSC_VER < 1800 + /* MSVC compiler doesn't support lround() at all */ + static double + round (double num) diff --git a/recipes/freexl/all/test_package/CMakeLists.txt b/recipes/freexl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e92c3ad896b62 --- /dev/null +++ b/recipes/freexl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(freexl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE freexl::freexl) diff --git a/recipes/freexl/all/test_package/conanfile.py b/recipes/freexl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fa2bdcf79755e --- /dev/null +++ b/recipes/freexl/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + xls_path = os.path.join(self.source_folder, "simple2003_21.xls") + self.run(f"{bin_path} {xls_path}", env="conanrun") diff --git a/recipes/freexl/all/test_package/simple2003_21.xls b/recipes/freexl/all/test_package/simple2003_21.xls new file mode 100644 index 0000000000000000000000000000000000000000..20e5d1313430a2f481f66ebe53962d271cf491f6 GIT binary patch literal 1102 zcmbu8%a2QO6vw~!wzu!r2n`Z*+qA|^jnR%`F*5p6BGF_#W~IVNn@p2-(1~EB8ygFI zYb*W&v9h$bA(7ZgBqCT7<9p8U_GRmLbI;>*&pE&Id)zSm2x10NJBGdu4nJN~S7E~% z#6==T*}^WhcTE^=FY35wa;^5Hbw`-T%t?SbP3>gNn*i=4!DUn5HI^v%yUYHMd zVNQFLW@)iUvFeM`I-Op=m4C?LB8o_>xzy|RnoHsa5iqVUeuQI)ZmuvUU1{Xk8ZHkx zA^ytt_6Tuj1Zkf4P2+}BHPhxZXCE%X>|K_fu`z8|OX^;i59mqMc+Y?`jIMb4f~Omv zzT)Y1tTRhaTwcix(27%wwKJe9DzL_&tUzw77jaI3Zw!j8G(%VVK&W=Rd#|^ZUN+2{ zWXJuGduI!aUES>TTWJ&RXAd$Zxl?O*yG$0K$qJY$KrQ)qEbfGH9MqHehE@Ky575EK>Yo&F1_{8Db#bVemHBNhLwuW$<3wox E1p{)T1poj5 literal 0 HcmV?d00001 diff --git a/recipes/freexl/all/test_package/test_package.c b/recipes/freexl/all/test_package/test_package.c new file mode 100644 index 0000000000000..8c12ee6b6e6ed --- /dev/null +++ b/recipes/freexl/all/test_package/test_package.c @@ -0,0 +1,317 @@ +#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; + } + + /* 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; + } + + return 0; +} diff --git a/recipes/freexl/all/test_v1_package/CMakeLists.txt b/recipes/freexl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/freexl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/freexl/all/test_v1_package/conanfile.py b/recipes/freexl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..305903625c5ac --- /dev/null +++ b/recipes/freexl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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) diff --git a/recipes/freexl/config.yml b/recipes/freexl/config.yml new file mode 100644 index 0000000000000..06269eb399e91 --- /dev/null +++ b/recipes/freexl/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.6": + folder: all + "1.0.5": + folder: all diff --git a/recipes/fribidi/all/conandata.yml b/recipes/fribidi/all/conandata.yml new file mode 100644 index 0000000000000..08937af14f728 --- /dev/null +++ b/recipes/fribidi/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.12": + url: "https://github.com/fribidi/fribidi/releases/download/v1.0.12/fribidi-1.0.12.tar.xz" + sha256: "0cd233f97fc8c67bb3ac27ce8440def5d3ffacf516765b91c2cc654498293495" + "1.0.10": + url: "https://github.com/fribidi/fribidi/releases/download/v1.0.10/fribidi-1.0.10.tar.xz" + sha256: "7f1c687c7831499bcacae5e8675945a39bacbad16ecaa945e9454a32df653c01" + "1.0.9": + url: "https://github.com/fribidi/fribidi/releases/download/v1.0.9/fribidi-1.0.9.tar.xz" + sha256: "c5e47ea9026fb60da1944da9888b4e0a18854a0e2410bbfe7ad90a054d36e0c7" +patches: + "1.0.9": + - patch_file: "patches/1.0.9-0001-meson-no-tests-bin.patch" diff --git a/recipes/fribidi/all/conanfile.py b/recipes/fribidi/all/conanfile.py new file mode 100644 index 0000000000000..0867aa984f255 --- /dev/null +++ b/recipes/fribidi/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +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" + + +class FriBiDiCOnan(ConanFile): + name = "fribidi" + description = "The Free Implementation of the Unicode Bidirectional Algorithm" + topics = ("unicode", "bidirectional", "text") + license = "LGPL-2.1" + homepage = "https://github.com/fribidi/fribidi" + 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_deprecated": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_deprecated": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["deprecated"] = self.options.with_deprecated + tc.project_options["docs"] = False + if Version(self.version) >= "1.0.10": + tc.project_options["bin"] = False + tc.project_options["tests"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + 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) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "fribidi") + self.cpp_info.libs = ["fribidi"] + self.cpp_info.includedirs.append(os.path.join("include", "fribidi")) + if not self.options.shared: + if Version(self.version) >= "1.0.10": + self.cpp_info.defines.append("FRIBIDI_LIB_STATIC") + else: + self.cpp_info.defines.append("FRIBIDI_STATIC") + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/fribidi/all/patches/1.0.9-0001-meson-no-tests-bin.patch b/recipes/fribidi/all/patches/1.0.9-0001-meson-no-tests-bin.patch new file mode 100644 index 0000000000000..1b249fe545df6 --- /dev/null +++ b/recipes/fribidi/all/patches/1.0.9-0001-meson-no-tests-bin.patch @@ -0,0 +1,13 @@ +--- meson.build ++++ meson.build +@@ -84,8 +84,8 @@ + + subdir('gen.tab') + subdir('lib') +-subdir('bin') +-subdir('test') ++ ++ + if get_option('docs') + subdir('doc') + endif diff --git a/recipes/fribidi/all/test_package/CMakeLists.txt b/recipes/fribidi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7afbb0e9ea3b3 --- /dev/null +++ b/recipes/fribidi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(fribidi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fribidi::fribidi) diff --git a/recipes/fribidi/all/test_package/conanfile.py b/recipes/fribidi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/fribidi/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/fribidi/all/test_package/test_package.c b/recipes/fribidi/all/test_package/test_package.c new file mode 100644 index 0000000000000..8561acd617331 --- /dev/null +++ b/recipes/fribidi/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main(int argc,char** argv) +{ + fribidi_get_type('c'); + + return 0; +} diff --git a/recipes/fribidi/all/test_v1_package/CMakeLists.txt b/recipes/fribidi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fribidi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fribidi/all/test_v1_package/conanfile.py b/recipes/fribidi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fribidi/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/fribidi/config.yml b/recipes/fribidi/config.yml new file mode 100644 index 0000000000000..1a912a9e71c6e --- /dev/null +++ b/recipes/fribidi/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.12": + folder: all + "1.0.10": + folder: all + "1.0.9": + folder: all diff --git a/recipes/frozen/all/conandata.yml b/recipes/frozen/all/conandata.yml new file mode 100644 index 0000000000000..4d9b977925cb2 --- /dev/null +++ b/recipes/frozen/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.1": + url: "https://github.com/serge-sans-paille/frozen/archive/1.1.1.tar.gz" + sha256: "f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45" + "1.0.1": + url: "https://github.com/serge-sans-paille/frozen/archive/1.0.1.tar.gz" + sha256: "29ab5de4eb6bebfb803cd4bd33e324777488fb035116dab1aea27f9118809d0d" + "1.0.0": + url: "https://github.com/serge-sans-paille/frozen/archive/1.0.0.tar.gz" + sha256: "590440d45dd53c6150b47df86071bba5128055e823ccc8715b363f75fc531269" diff --git a/recipes/frozen/all/conanfile.py b/recipes/frozen/all/conanfile.py new file mode 100644 index 0000000000000..c27fe687bd194 --- /dev/null +++ b/recipes/frozen/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class FrozenConan(ConanFile): + name = "frozen" + description = "A header-only, constexpr alternative to gperf for C++14 users." + homepage = "https://github.com/serge-sans-paille/frozen" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("gperf", "constexpr", "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 _minimum_compilers_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14", + "msvc": "190", + } + + 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._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "frozen") + self.cpp_info.set_property("cmake_target_name", "frozen::frozen") + self.cpp_info.set_property("cmake_target_aliases", ["frozen::frozen-headers"]) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/frozen/all/test_package/CMakeLists.txt b/recipes/frozen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bf59d5df3d910 --- /dev/null +++ b/recipes/frozen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(frozen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE frozen::frozen) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/frozen/all/test_package/conanfile.py b/recipes/frozen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/frozen/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/frozen/all/test_package/test_package.cpp b/recipes/frozen/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2772a14cd19cb --- /dev/null +++ b/recipes/frozen/all/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#include + +#include + +#define ELF_RELOC(name, value) name = value, + +/** i386 relocations. */ +enum class RELOC_i386 { + /* TODO: this is just a subset */ + ELF_RELOC(R_386_NONE, 0) + ELF_RELOC(R_386_32, 1) + ELF_RELOC(R_386_PC32, 2) + ELF_RELOC(R_386_GOT32, 3) + ELF_RELOC(R_386_PLT32, 4) + ELF_RELOC(R_386_COPY, 5) + ELF_RELOC(R_386_GLOB_DAT, 6) + ELF_RELOC(R_386_JUMP_SLOT, 7) + ELF_RELOC(R_386_RELATIVE, 8) + ELF_RELOC(R_386_GOTOFF, 9) +}; + +constexpr frozen::map e2s = { + { RELOC_i386::R_386_NONE, "NONE"}, + { RELOC_i386::R_386_32, "R32"}, + { RELOC_i386::R_386_PC32, "PC32"}, + { RELOC_i386::R_386_GOT32, "GOT32"}, + { RELOC_i386::R_386_PLT32, "PLT32"}, + { RELOC_i386::R_386_COPY, "COPY"}, + { RELOC_i386::R_386_GLOB_DAT, "GLOB_DAT"}, + { RELOC_i386::R_386_JUMP_SLOT, "JUMP_SLOT"}, + { RELOC_i386::R_386_RELATIVE, "RELATIVE"}, + { RELOC_i386::R_386_GOTOFF, "GOTOFF"} +}; + + +int main() +{ + printf("%s\n", e2s.at(RELOC_i386::R_386_GOT32)); + return 0; +} diff --git a/recipes/frozen/all/test_v1_package/CMakeLists.txt b/recipes/frozen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/frozen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/frozen/all/test_v1_package/conanfile.py b/recipes/frozen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/frozen/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/frozen/config.yml b/recipes/frozen/config.yml new file mode 100644 index 0000000000000..9234b604d8ed1 --- /dev/null +++ b/recipes/frozen/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.1": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all diff --git a/recipes/frugally-deep/all/conandata.yml b/recipes/frugally-deep/all/conandata.yml new file mode 100644 index 0000000000000..5db89f0f8f389 --- /dev/null +++ b/recipes/frugally-deep/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "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 new file mode 100644 index 0000000000000..2588afa778f5b --- /dev/null +++ b/recipes/frugally-deep/all/conanfile.py @@ -0,0 +1,71 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class FrugallyDeepConan(ConanFile): + name = "frugally-deep" + description = "Use Keras models in C++ with ease." + license = "MIT" + topics = ("keras", "tensorflow") + homepage = "https://github.com/Dobiasd/frugally-deep" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.9", + "Visual Studio": "14", + "clang": "3.7", + "apple-clang": "9", + } + + def requirements(self): + self.requires("eigen/3.4.0") + self.requires("functionalplus/0.2.18-p0") + self.requires("nlohmann_json/3.10.5") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("frugally-deep requires C++14. Your compiler is unknown. Assuming it supports C++14.") + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration("frugally-deep requires C++14, which your compiler does not support.") + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "frugally-deep") + self.cpp_info.set_property("cmake_target_name", "frugally-deep::fdeep") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["fdeep"].requires = ["eigen::eigen", + "functionalplus::functionalplus", + "nlohmann_json::nlohmann_json"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["fdeep"].system_libs = ["pthread"] diff --git a/recipes/frugally-deep/all/test_package/CMakeLists.txt b/recipes/frugally-deep/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a8c615c1776b8 --- /dev/null +++ b/recipes/frugally-deep/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(frugally-deep REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} frugally-deep::fdeep) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/frugally-deep/all/test_package/conanfile.py b/recipes/frugally-deep/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/frugally-deep/all/test_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/frugally-deep/all/test_package/test_package.cpp b/recipes/frugally-deep/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3ff67b2ad71da --- /dev/null +++ b/recipes/frugally-deep/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + const fdeep::tensor t( + fdeep::tensor_shape(static_cast(4)), + fdeep::float_vec{1, 2, 3, 4}); + std::cout << fdeep::show_tensor(t) << std::endl; +} diff --git a/recipes/frugally-deep/config.yml b/recipes/frugally-deep/config.yml new file mode 100644 index 0000000000000..5b45f70613267 --- /dev/null +++ b/recipes/frugally-deep/config.yml @@ -0,0 +1,11 @@ +versions: + "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/fruit/all/conandata.yml b/recipes/fruit/all/conandata.yml new file mode 100644 index 0000000000000..76fd9cdd1653e --- /dev/null +++ b/recipes/fruit/all/conandata.yml @@ -0,0 +1,64 @@ +sources: + "3.7.1": + url: "https://github.com/google/fruit/archive/v3.7.1.tar.gz" + sha256: "ed4c6b7ebfbf75e14a74e21eb74ce2703b8485bfc9e660b1c36fb7fe363172d0" + "3.7.0": + url: "https://github.com/google/fruit/archive/v3.7.0.tar.gz" + sha256: "134d65c8e6dff204aeb771058c219dcd9a353853e30a3961a5d17a6cff434a09" + "3.6.0": + url: "https://github.com/google/fruit/archive/v3.6.0.tar.gz" + sha256: "b35b9380f3affe0b3326f387505fa80f3584b0d0a270362df1f4ca9c39094eb5" + "3.5.0": + url: "https://github.com/google/fruit/archive/v3.5.0.tar.gz" + sha256: "1e1f26fb2ec100550e0e29ee0f4ad0df9f7a8144a65c0b9cb9954cd2e4d6a529" + "3.4.0": + url: "https://github.com/google/fruit/archive/v3.4.0.tar.gz" + sha256: "0f3793ee5e437437c3d6360a037866429a7f1975451fd60d740f9d2023e92034" +patches: + "3.7.1": + - patch_file: "patches/0002-remove-cmake-extra-target-3.7.1.patch" + patch_description: "remove CMake extra target" + patch_type: "conan" + - patch_file: "patches/0003-supports-cmake-multi-configuration-generator-3.7.patch" + patch_description: "support CMake multi configuration generator" + patch_type: "conan" + - patch_file: "patches/0004-set-options-for-cmake-target.patch" + patch_description: "Set options for CMake target" + patch_type: "conan" + "3.7.0": + - patch_file: "patches/0002-remove-cmake-extra-target-3.7.0.patch" + patch_description: "remove CMake extra target" + patch_type: "conan" + - patch_file: "patches/0003-supports-cmake-multi-configuration-generator-3.7.patch" + patch_description: "support CMake multi configuration generator" + patch_type: "conan" + - patch_file: "patches/0004-set-options-for-cmake-target.patch" + patch_description: "Set options for CMake target" + patch_type: "conan" + "3.6.0": + - patch_file: "patches/0002-remove-cmake-extra-target-3.6.0.patch" + patch_description: "remove CMake extra target" + patch_type: "conan" + - patch_file: "patches/0003-supports-cmake-multi-configuration-generator.patch" + patch_description: "support CMake multi configuration generator" + patch_type: "conan" + - patch_file: "patches/0004-set-options-for-cmake-target.patch" + patch_description: "Set options for CMake target" + patch_type: "conan" + "3.5.0": + - patch_file: "patches/0002-remove-cmake-extra-target-3.5.0.patch" + patch_description: "remove CMake extra target" + patch_type: "conan" + - patch_file: "patches/0003-supports-cmake-multi-configuration-generator.patch" + patch_description: "support CMake multi configuration generator" + patch_type: "conan" + - patch_file: "patches/0004-set-options-for-cmake-target.patch" + patch_description: "Set options for CMake target" + patch_type: "conan" + "3.4.0": + - patch_file: "patches/0001-fruit-3.4.0-cmake.patch" + patch_description: "Adapt CMake for Conan" + patch_type: "conan" + - patch_file: "patches/0004-3.4.0-set-options-for-cmake-target.patch" + patch_description: "Set Boost cmake target" + patch_type: "conan" diff --git a/recipes/fruit/all/conanfile.py b/recipes/fruit/all/conanfile.py new file mode 100644 index 0000000000000..39e570bb06b3a --- /dev/null +++ b/recipes/fruit/all/conanfile.py @@ -0,0 +1,124 @@ +import os +import shutil +import tarfile +from fnmatch import fnmatch + +from conan import ConanFile, 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.files import apply_conandata_patches, copy, download, export_conandata_patches, get + +required_conan_version = ">=1.53.0" + + +class FruitConan(ConanFile): + name = "fruit" + description = "C++ dependency injection framework" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/fruit" + license = "Apache-2.0" + topics = ("injection", "framework") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "use_boost": [True, False, "deprecated"], + "with_boost": [True, False], + "fPIC": [True, False]} + default_options = { + "shared": False, + "use_boost": "deprecated", + "with_boost": True, + "fPIC": True} + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def package_id(self): + del self.info.options.use_boost + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.use_boost != "deprecated": + self.output.warn("use_boost option is deprecated, use the option with_boost instead.") + self.options.with_boost = self.options.use_boost + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_boost: + self.requires("boost/1.80.0") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, "11") + compiler = str(self.settings.compiler) + compiler_version = Version(self.settings.compiler.version.value) + + minimal_version = { + "gcc": "5", + "clang": "3.5", + "apple-clang": "7.3", + "Visual Studio": "14" + } + + if compiler in minimal_version and \ + compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports" + " at least C++11. {compiler} {compiler_version} is not" + " supported.") + + def source(self): + if Version(self.version) == "3.4.0": + filename = os.path.basename(self.conan_data["sources"][self.version]["url"]) + download(self, filename=filename, **self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + + with tarfile.TarFile.open(filename, 'r:*') as tarredgzippedFile: + # NOTE: In fruit v3.4.0, The archive file contains the file names + # build and BUILD in the extras/bazel_root/third_party/fruit directory. + # Extraction fails on a case-insensitive file system due to file + # name conflicts. + # Exclude build as a workaround. + exclude_pattern = f"{extracted_dir}/extras/bazel_root/third_party/fruit/build" + members = list(filter(lambda m: not fnmatch(m.name, exclude_pattern), + tarredgzippedFile.getmembers())) + tarredgzippedFile.extractall(path=self.source_folder, members=members) + allfiles = os.listdir(os.path.join(self.source_folder, extracted_dir)) + for file_name in allfiles: + shutil.move(os.path.join(self.source_folder, extracted_dir, file_name), self.source_folder) + else: + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["FRUIT_USES_BOOST"] = self.options.with_boost + tc.variables["FRUIT_ENABLE_COVERAGE"] = False + tc.variables["RUN_TESTS_UNDER_VALGRIND"] = False + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + 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, "COPYING", 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 = ["fruit"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] diff --git a/recipes/fruit/all/patches/0001-fruit-3.4.0-cmake.patch b/recipes/fruit/all/patches/0001-fruit-3.4.0-cmake.patch new file mode 100644 index 0000000000000..e567a9b5299ec --- /dev/null +++ b/recipes/fruit/all/patches/0001-fruit-3.4.0-cmake.patch @@ -0,0 +1,201 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d77de0c..0cbf39b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-project(Fruit) + cmake_minimum_required(VERSION 2.8) ++project(Fruit) + + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) +@@ -8,19 +8,8 @@ endif() + # CMake on OSX likes to see this set explicitly, otherwise it outputs a warning. + set(CMAKE_MACOSX_RPATH 1) + +-if(NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") +- message(FATAL_ERROR "Please re-run CMake, specifying -DCMAKE_BUILD_TYPE=Debug , -DCMAKE_BUILD_TYPE=Release , -DCMAKE_BUILD_TYPE=RelWithDebInfo or -DCMAKE_BUILD_TYPE=MinSizeRel .") +-endif() +- + option(BUILD_SHARED_LIBS "Build shared library" ON) + +-# The Visual Studio CMake generators default to multiple configurations, but Fruit doesn't support multi-configuration build directories. +-set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}") +- +-if(NOT "${RUNTIME_OUTPUT_DIRECTORY}") +- set(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") +-endif() +- + set(FRUIT_ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX compiler flags." FORCE) + + set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_CXX_FLAGS}") +@@ -34,23 +23,24 @@ if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|AppleClang|MSVC)$") + # - https://software.intel.com/en-us/forums/intel-c-compiler/topic/606049 + endif() + +-if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|Intel|AppleClang)$") +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -std=c++11 -W -Wall -Wno-unknown-warning-option -Wno-missing-braces") +-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(MSVC)$") +- # TODO: we currently disable the warning C4709 because MSVC emits it even when there is no reason to. Re-enable it when possible. +- # TODO: the warning C4141 is disabled, because MSVC emits it ("'inline': used more than once") when a function/method is marked with both __forceinline and inline. +- # TODO: the warning C4714 is disabled, MSVC emits it when it decides not to inline a __forceinline function/method. +- # The warning C4577 is disabled because we don't need a termination guarantee on exceptions for functions marked with +- # 'noexcept'. +- # The warning C4530 is disabled because it's triggered by MSVC's STL. +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /wd4141 /wd4714 /wd4577 /wd4530 /D_SCL_SECURE_NO_WARNINGS") +-endif() ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC ${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /wd4141 /wd4714 /wd4577 /wd4530 /D_SCL_SECURE_NO_WARNINGS) ++ ++list(APPEND FRUIT_ADDITIONAL_COMPILE_FLAGS ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC}>) + + option(FRUIT_ENABLE_COVERAGE "Enable collection of test coverage. This is meant to be used by Fruit developers. It's only supported when using GCC on Linux." OFF) + if("${FRUIT_ENABLE_COVERAGE}") + # We also disable exceptions because otherwise GCC considers every function/method call that could throw as an + # additional branch. +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -fprofile-arcs -ftest-coverage -fno-exceptions -fno-inline -O0") ++ list(APPEND FRUIT_ADDITIONAL_COMPILE_FLAGS -fprofile-arcs -ftest-coverage -fno-exceptions -fno-inline -O0) + set(FRUIT_ADDITIONAL_LINKER_FLAGS "${FRUIT_ADDITIONAL_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -fno-exceptions -fno-inline -O0") + endif() + +@@ -58,61 +48,27 @@ set(FRUIT_USES_BOOST TRUE CACHE BOOL + "Whether to use Boost (specifically, boost::unordered_set and boost::unordered_map). + If this is false, Fruit will use std::unordered_set and std::unordered_map instead (however this causes injection to be a bit slower).") + +-if("${WIN32}" AND "${FRUIT_USES_BOOST}") +- set(BOOST_DIR "" CACHE PATH "The directory where the boost library is installed, e.g. C:\\boost\\boost_1_62_0.") +- if("${BOOST_DIR}" STREQUAL "") +- message(FATAL_ERROR "Please re-run CMake, specifying the boost library path as BOOST_DIR, e.g. -DBOOST_DIR=C:\\boost\\boost_1_62_0, or specify -DFRUIT_USES_BOOST=False to not use boost.") +- endif() +- include_directories("${BOOST_DIR}") +-endif() +- +-set(RUN_TESTS_UNDER_VALGRIND FALSE CACHE BOOL "Whether to run Fruit tests under valgrind") +-if ("${RUN_TESTS_UNDER_VALGRIND}") +- set(RUN_TESTS_UNDER_VALGRIND_FLAG "1") +-endif() +- + # Unsafe, only for debugging/benchmarking. + #set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -DFRUIT_NO_LOOP_CHECK=1") + +-add_definitions(${FRUIT_ADDITIONAL_COMPILE_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") +- +-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +- set(FRUIT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${FRUIT_ADDITIONAL_COMPILE_FLAGS}") +-else() +- set(FRUIT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} ${FRUIT_ADDITIONAL_COMPILE_FLAGS}") +-endif() +- +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +-include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) ++set(FRUIT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include) + + # (debug-only) compile switch to get deep template instantiation stacktraces for errors (instead + # of the user-friendly default that hides Fruit internals). + #add_definitions(-DFRUIT_DEEP_TEMPLATE_INSTANTIATION_STACKTRACES_FOR_ERRORS=1) + +-set(INSTALL_INCLUDE_DIR include/fruit CACHE PATH "Installation directory for headers") +-set(INSTALL_LIBRARY_DIR lib CACHE PATH "Installation directory for libraries") ++include(GNUInstallDirs) + + set(FRUIT_VERSION "3.4.0") + + add_subdirectory(configuration) + add_subdirectory(src) + +-if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- # Do not exclude these from "make all" in debug mode, they must build. +- add_subdirectory(examples) +- add_subdirectory(tests) +-else() +- add_subdirectory(examples EXCLUDE_FROM_ALL) +- add_subdirectory(tests) +-endif() +- +-add_subdirectory(extras EXCLUDE_FROM_ALL) +- + install(DIRECTORY include/fruit/ +- DESTINATION "${INSTALL_INCLUDE_DIR}" ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fruit + FILES_MATCHING PATTERN "*.h") + + set(CPACK_PACKAGE_NAME "Fruit") +diff --git a/configuration/CMakeLists.txt b/configuration/CMakeLists.txt +index b18a463..a78a5bb 100644 +--- a/configuration/CMakeLists.txt ++++ b/configuration/CMakeLists.txt +@@ -1,7 +1,17 @@ + + include(CheckCXXSourceCompiles) + +-set(CMAKE_REQUIRED_FLAGS "${FRUIT_COMPILE_FLAGS}") ++if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^Clang$") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC}) ++endif() + + CHECK_CXX_SOURCE_COMPILES(" + int main() {} +@@ -218,4 +228,4 @@ endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fruit-config-base.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/fruit/impl/fruit-config-base.h) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../include/fruit/impl/fruit-config-base.h +- DESTINATION ${INSTALL_INCLUDE_DIR}/impl) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fruit/impl) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 66bf79f..9c75ec6 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -11,16 +11,28 @@ normalized_component_storage_holder.cpp + semistatic_map.cpp + semistatic_graph.cpp) + +-if("${BUILD_SHARED_LIBS}") ++if(BUILD_SHARED_LIBS) + add_library(fruit SHARED ${FRUIT_SOURCES}) + +- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +- set_target_properties(fruit PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +- endif() ++ set_target_properties(fruit PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + else() + add_library(fruit STATIC ${FRUIT_SOURCES}) + endif() + ++target_include_directories(fruit ++ PUBLIC ++ ${FRUIT_INCLUDE_DIRS}) ++target_compile_options(fruit ++ PUBLIC ++ ${FRUIT_ADDITIONAL_COMPILE_FLAGS}) ++ ++if(FRUIT_USES_BOOST) ++ target_include_directories(fruit ++ PRIVATE ++ ${CONAN_INCLUDE_DIRS_BOOST}) ++endif() ++ + install(TARGETS fruit +- ARCHIVE DESTINATION "${INSTALL_LIBRARY_DIR}" +- LIBRARY DESTINATION "${INSTALL_LIBRARY_DIR}") ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") diff --git a/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.5.0.patch b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.5.0.patch new file mode 100644 index 0000000000000..b9c60aa084fd2 --- /dev/null +++ b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.5.0.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d5b6a64..11342ce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,12 +2,6 @@ cmake_minimum_required(VERSION 3.2) + + project(Fruit VERSION 3.5.0 LANGUAGES CXX) + +-set(FRUIT_IS_BEING_BUILT_BY_CONAN FALSE CACHE BOOL "This is set in Conan builds.") +-if("${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +- conan_basic_setup() +-endif() +- + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) + endif() +@@ -125,19 +119,6 @@ include(GNUInstallDirs) + add_subdirectory(configuration) + add_subdirectory(src) + +-if(NOT "${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- # Do not exclude these from "make all" in debug mode, they must build. +- add_subdirectory(examples) +- add_subdirectory(tests) +- else() +- add_subdirectory(examples EXCLUDE_FROM_ALL) +- add_subdirectory(tests) +- endif() +- +- add_subdirectory(extras EXCLUDE_FROM_ALL) +-endif() +- + install(DIRECTORY include/fruit/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fruit + FILES_MATCHING PATTERN "*.h") diff --git a/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.6.0.patch b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.6.0.patch new file mode 100644 index 0000000000000..aea739f1fee7b --- /dev/null +++ b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.6.0.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7efcf7b..c083efd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,12 +2,6 @@ cmake_minimum_required(VERSION 3.2) + + project(Fruit VERSION 3.6.0 LANGUAGES CXX) + +-set(FRUIT_IS_BEING_BUILT_BY_CONAN FALSE CACHE BOOL "This is set in Conan builds.") +-if("${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +- conan_basic_setup() +-endif() +- + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) + endif() +@@ -125,19 +119,6 @@ include(GNUInstallDirs) + add_subdirectory(configuration) + add_subdirectory(src) + +-if(NOT "${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- # Do not exclude these from "make all" in debug mode, they must build. +- add_subdirectory(examples) +- add_subdirectory(tests) +- else() +- add_subdirectory(examples EXCLUDE_FROM_ALL) +- add_subdirectory(tests) +- endif() +- +- add_subdirectory(extras EXCLUDE_FROM_ALL) +-endif() +- + install(DIRECTORY include/fruit/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fruit + FILES_MATCHING PATTERN "*.h") diff --git a/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.0.patch b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.0.patch new file mode 100644 index 0000000000000..c63577ff5ae4a --- /dev/null +++ b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.0.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74c62a5..03444f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,12 +2,6 @@ cmake_minimum_required(VERSION 3.2) + + project(Fruit VERSION 3.7.0 LANGUAGES CXX) + +-set(FRUIT_IS_BEING_BUILT_BY_CONAN FALSE CACHE BOOL "This is set in Conan builds.") +-if("${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +- conan_basic_setup() +-endif() +- + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) + endif() +@@ -130,19 +124,6 @@ include(GNUInstallDirs) + add_subdirectory(configuration) + add_subdirectory(src) + +-if(NOT "${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- # Do not exclude these from "make all" in debug mode, they must build. +- add_subdirectory(examples) +- add_subdirectory(tests) +- else() +- add_subdirectory(examples EXCLUDE_FROM_ALL) +- add_subdirectory(tests) +- endif() +- +- add_subdirectory(extras EXCLUDE_FROM_ALL) +-endif() +- + install(DIRECTORY include/fruit/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fruit + FILES_MATCHING PATTERN "*.h") diff --git a/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.1.patch b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.1.patch new file mode 100644 index 0000000000000..f72cc8e6e525a --- /dev/null +++ b/recipes/fruit/all/patches/0002-remove-cmake-extra-target-3.7.1.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74c62a5..03444f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,12 +2,6 @@ cmake_minimum_required(VERSION 3.2) + + project(Fruit VERSION 3.7.1 LANGUAGES CXX) + +-set(FRUIT_IS_BEING_BUILT_BY_CONAN FALSE CACHE BOOL "This is set in Conan builds.") +-if("${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +- conan_basic_setup() +-endif() +- + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) + endif() +@@ -130,19 +124,6 @@ include(GNUInstallDirs) + add_subdirectory(configuration) + add_subdirectory(src) + +-if(NOT "${FRUIT_IS_BEING_BUILT_BY_CONAN}") +- if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- # Do not exclude these from "make all" in debug mode, they must build. +- add_subdirectory(examples) +- add_subdirectory(tests) +- else() +- add_subdirectory(examples EXCLUDE_FROM_ALL) +- add_subdirectory(tests) +- endif() +- +- add_subdirectory(extras EXCLUDE_FROM_ALL) +-endif() +- + install(DIRECTORY include/fruit/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fruit + FILES_MATCHING PATTERN "*.h") diff --git a/recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator-3.7.patch b/recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator-3.7.patch new file mode 100644 index 0000000000000..7d45a68e3e529 --- /dev/null +++ b/recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator-3.7.patch @@ -0,0 +1,91 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 03444f5..46d3918 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,15 +14,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + # CMake on OSX likes to see this set explicitly, otherwise it outputs a warning. + set(CMAKE_MACOSX_RPATH 1) + +-if(NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") +- message(FATAL_ERROR "Please re-run CMake, specifying -DCMAKE_BUILD_TYPE=Debug , -DCMAKE_BUILD_TYPE=Release , -DCMAKE_BUILD_TYPE=RelWithDebInfo or -DCMAKE_BUILD_TYPE=MinSizeRel .") +-endif() +- + option(BUILD_SHARED_LIBS "Build shared library" ON) + +-# The Visual Studio CMake generators default to multiple configurations, but Fruit doesn't support multi-configuration build directories. +-set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}") +- + set(FRUIT_ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX compiler flags." FORCE) + + set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_CXX_FLAGS}") +@@ -36,23 +29,18 @@ if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|AppleClang|MSVC)$") + # - https://software.intel.com/en-us/forums/intel-c-compiler/topic/606049 + endif() + +-option(FRUIT_ADD_WNO_UNKNOWN_WARNING_OPTION "Add -Wno-unknown-warning-option to the compiler options for GCC, Clang, ICC and AppleClang" ON) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC ${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /wd4141 /wd4714 /wd4577 /wd4530 /wd5205 /D_SCL_SECURE_NO_WARNINGS) + +-if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|Intel|AppleClang)$") +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -std=c++11 -W -Wall -Wno-missing-braces") +- if(${FRUIT_ADD_WNO_UNKNOWN_WARNING_OPTION}) +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -Wno-unknown-warning-option") +- endif() +-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(MSVC)$") +- # TODO: we currently disable the warning C4709 because MSVC emits it even when there is no reason to. Re-enable it when possible. +- # TODO: the warning C4141 is disabled, because MSVC emits it ("'inline': used more than once") when a function/method is marked with both __forceinline and inline. +- # TODO: the warning C4714 is disabled, MSVC emits it when it decides not to inline a __forceinline function/method. +- # The warning C4577 is disabled because we don't need a termination guarantee on exceptions for functions marked with +- # 'noexcept'. +- # The warning C4530 is disabled because it's triggered by MSVC's STL. +- # The warning C5205 is disabled, MSVC emits it for abstract classes in example code with non-virtual destructors, but we never call delete on those (even though std::default_delete is instantiated for those types). +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /wd4141 /wd4714 /wd4577 /wd4530 /wd5205 /D_SCL_SECURE_NO_WARNINGS") +-endif() ++list(APPEND FRUIT_ADDITIONAL_COMPILE_FLAGS ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC}>) + + option(FRUIT_ENABLE_COVERAGE "Enable collection of test coverage. This is meant to be used by Fruit developers. It's only supported when using GCC on Linux." OFF) + if("${FRUIT_ENABLE_COVERAGE}") +@@ -94,12 +82,6 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_ + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + +-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +- set(FRUIT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${FRUIT_ADDITIONAL_COMPILE_FLAGS}") +-else() +- set(FRUIT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} ${FRUIT_ADDITIONAL_COMPILE_FLAGS}") +-endif() +- + set(FRUIT_CLANG_TIDY_CHECKS + bugprone*,-bugprone-reserved-identifier,-bugprone-exception-escape,clang-analyzer*,performance*,google*,-google-readability*,-google-runtime-references,clang-diagnostic-unused-command-line-argument,misc-macro-parentheses,-clang-diagnostic-dtor-name) + +diff --git a/configuration/CMakeLists.txt b/configuration/CMakeLists.txt +index 11d8445..a78a5bb 100644 +--- a/configuration/CMakeLists.txt ++++ b/configuration/CMakeLists.txt +@@ -1,7 +1,17 @@ + + include(CheckCXXSourceCompiles) + +-set(CMAKE_REQUIRED_FLAGS "${FRUIT_COMPILE_FLAGS}") ++if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^Clang$") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC}) ++endif() + + CHECK_CXX_SOURCE_COMPILES(" + int main() {} diff --git a/recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator.patch b/recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator.patch new file mode 100644 index 0000000000000..469e9be4c2c6c --- /dev/null +++ b/recipes/fruit/all/patches/0003-supports-cmake-multi-configuration-generator.patch @@ -0,0 +1,87 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 11342ce..c85be1b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,15 +14,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + # CMake on OSX likes to see this set explicitly, otherwise it outputs a warning. + set(CMAKE_MACOSX_RPATH 1) + +-if(NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") +- message(FATAL_ERROR "Please re-run CMake, specifying -DCMAKE_BUILD_TYPE=Debug , -DCMAKE_BUILD_TYPE=Release , -DCMAKE_BUILD_TYPE=RelWithDebInfo or -DCMAKE_BUILD_TYPE=MinSizeRel .") +-endif() +- + option(BUILD_SHARED_LIBS "Build shared library" ON) + +-# The Visual Studio CMake generators default to multiple configurations, but Fruit doesn't support multi-configuration build directories. +-set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}") +- + set(FRUIT_ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX compiler flags." FORCE) + + set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_CXX_FLAGS}") +@@ -36,18 +29,18 @@ if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|AppleClang|MSVC)$") + # - https://software.intel.com/en-us/forums/intel-c-compiler/topic/606049 + endif() + +-if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|Intel|AppleClang)$") +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -std=c++11 -W -Wall -Wno-unknown-warning-option -Wno-missing-braces") +-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(MSVC)$") +- # TODO: we currently disable the warning C4709 because MSVC emits it even when there is no reason to. Re-enable it when possible. +- # TODO: the warning C4141 is disabled, because MSVC emits it ("'inline': used more than once") when a function/method is marked with both __forceinline and inline. +- # TODO: the warning C4714 is disabled, MSVC emits it when it decides not to inline a __forceinline function/method. +- # The warning C4577 is disabled because we don't need a termination guarantee on exceptions for functions marked with +- # 'noexcept'. +- # The warning C4530 is disabled because it's triggered by MSVC's STL. +- # The warning C5205 is disabled, MSVC emits it for abstract classes in example code with non-virtual destructors, but we never call delete on those (even though std::default_delete is instantiated for those types). +- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /wd4141 /wd4714 /wd4577 /wd4530 /wd5205 /D_SCL_SECURE_NO_WARNINGS") +-endif() ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang ${FRUIT_ADDITIONAL_COMPILE_FLAGS} -W -Wall -Wno-unknown-warning-option -Wno-missing-braces) ++set(FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC ${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /wd4141 /wd4714 /wd4577 /wd4530 /wd5205 /D_SCL_SECURE_NO_WARNINGS) ++ ++list(APPEND FRUIT_ADDITIONAL_COMPILE_FLAGS ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang}> ++ $<$:${FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC}>) + + option(FRUIT_ENABLE_COVERAGE "Enable collection of test coverage. This is meant to be used by Fruit developers. It's only supported when using GCC on Linux." OFF) + if("${FRUIT_ENABLE_COVERAGE}") +@@ -89,12 +82,6 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_ + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + +-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +- set(FRUIT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${FRUIT_ADDITIONAL_COMPILE_FLAGS}") +-else() +- set(FRUIT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} ${FRUIT_ADDITIONAL_COMPILE_FLAGS}") +-endif() +- + set(FRUIT_CLANG_TIDY_CHECKS + bugprone*,-bugprone-reserved-identifier,-bugprone-exception-escape,clang-analyzer*,performance*,google*,-google-readability*,-google-runtime-references,clang-diagnostic-unused-command-line-argument,misc-macro-parentheses,-clang-diagnostic-dtor-name) + +diff --git a/configuration/CMakeLists.txt b/configuration/CMakeLists.txt +index 11d8445..a78a5bb 100644 +--- a/configuration/CMakeLists.txt ++++ b/configuration/CMakeLists.txt +@@ -1,7 +1,17 @@ + + include(CheckCXXSourceCompiles) + +-set(CMAKE_REQUIRED_FLAGS "${FRUIT_COMPILE_FLAGS}") ++if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_GNU}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^Clang$") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_Clang}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_Intel}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_AppleClang}) ++elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") ++ set(CMAKE_REQUIRED_FLAGS ${FRUIT_ADDITIONAL_COMPILE_FLAGS_MSVC}) ++endif() + + CHECK_CXX_SOURCE_COMPILES(" + int main() {} diff --git a/recipes/fruit/all/patches/0004-3.4.0-set-options-for-cmake-target.patch b/recipes/fruit/all/patches/0004-3.4.0-set-options-for-cmake-target.patch new file mode 100644 index 0000000000000..972eec63bdee1 --- /dev/null +++ b/recipes/fruit/all/patches/0004-3.4.0-set-options-for-cmake-target.patch @@ -0,0 +1,16 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9c75ec6..0d7100d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -27,9 +27,8 @@ target_compile_options(fruit + ${FRUIT_ADDITIONAL_COMPILE_FLAGS}) + + if(FRUIT_USES_BOOST) +- target_include_directories(fruit +- PRIVATE +- ${CONAN_INCLUDE_DIRS_BOOST}) ++ find_package(Boost REQUIRED CONFIG) ++ target_link_libraries(fruit PUBLIC Boost::boost) + endif() + + install(TARGETS fruit diff --git a/recipes/fruit/all/patches/0004-set-options-for-cmake-target.patch b/recipes/fruit/all/patches/0004-set-options-for-cmake-target.patch new file mode 100644 index 0000000000000..bdea499c081e9 --- /dev/null +++ b/recipes/fruit/all/patches/0004-set-options-for-cmake-target.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 46d3918..9d6bb1c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,18 +55,7 @@ set(FRUIT_USES_BOOST TRUE CACHE BOOL + If this is false, Fruit will use std::unordered_set and std::unordered_map instead (however this causes injection to be a bit slower).") + + if(${FRUIT_USES_BOOST}) +- +- if(DEFINED BOOST_DIR) +- message(DEPRECATION "BOOST_DIR is deprecated. Use Boost_INCLUDE_DIR instead.") +- set(Boost_INCLUDE_DIR "${BOOST_DIR}" CACHE PATH "") +- endif() +- +- find_package(Boost) +- if(Boost_FOUND) +- include_directories(${Boost_INCLUDE_DIRS}) +- else() +- message(FATAL_ERROR "Please re-run CMake, specifying the boost library path as Boost_INCLUDE_DIR, e.g. -DBoost_INCLUDE_DIR=C:\\boost\\boost_1_62_0, or specify -DFRUIT_USES_BOOST=False to not use boost.") +- endif() ++ find_package(Boost REQUIRED CONFIG) + endif() + + set(RUN_TESTS_UNDER_VALGRIND FALSE CACHE BOOL "Whether to run Fruit tests under valgrind") +@@ -77,7 +66,6 @@ endif() + # Unsafe, only for debugging/benchmarking. + #set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -DFRUIT_NO_LOOP_CHECK=1") + +-add_definitions(${FRUIT_ADDITIONAL_COMPILE_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FRUIT_ADDITIONAL_LINKER_FLAGS}") +@@ -94,9 +82,7 @@ if(${FRUIT_ENABLE_CLANG_TIDY}) + -warnings-as-errors=*;) + endif() + +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +-include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) +- ++set(FRUIT_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") + # (debug-only) compile switch to get deep template instantiation stacktraces for errors (instead + # of the user-friendly default that hides Fruit internals). + #add_definitions(-DFRUIT_DEEP_TEMPLATE_INSTANTIATION_STACKTRACES_FOR_ERRORS=1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0e328cf..bf437e9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,6 +21,13 @@ else() + add_library(fruit STATIC ${FRUIT_SOURCES}) + endif() + ++target_include_directories(fruit PUBLIC ${FRUIT_INCLUDE_DIRS}) ++target_compile_options(fruit PUBLIC ${FRUIT_ADDITIONAL_COMPILE_FLAGS}) ++ ++if(FRUIT_USES_BOOST) ++ target_link_libraries(fruit PRIVATE Boost::boost) ++endif() ++ + install(TARGETS fruit + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/recipes/fruit/all/test_package/CMakeLists.txt b/recipes/fruit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a965663f9c6ad --- /dev/null +++ b/recipes/fruit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(fruit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fruit::fruit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fruit/all/test_package/conanfile.py b/recipes/fruit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/fruit/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/fruit/all/test_package/test_package.cpp b/recipes/fruit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4364993585267 --- /dev/null +++ b/recipes/fruit/all/test_package/test_package.cpp @@ -0,0 +1,55 @@ + +#include +#include + +using fruit::Component; +using fruit::Injector; + +class Writer { +public: + virtual void write(std::string s) = 0; +}; + +class StdoutWriter : public Writer { +public: + // Like "StdoutWriter() = default;" but also marks this constructor as the + // one to use for injection. + INJECT(StdoutWriter()) = default; + + virtual void write(std::string s) override { + std::cout << s; + } +}; + +class Greeter { +public: + virtual void greet() = 0; +}; + +class GreeterImpl : public Greeter { +private: + Writer* writer; + +public: + // Like "GreeterImpl(Writer* writer) {...}" but also marks this constructor + // as the one to use for injection. + INJECT(GreeterImpl(Writer* writer)) : writer(writer) {} + + virtual void greet() override { + writer->write("Hello world!\n"); + } +}; + +Component getGreeterComponent() { + return fruit::createComponent().bind().bind(); +} + +int main() { + + Injector injector(getGreeterComponent); + Greeter* greeter = injector.get(); + + greeter->greet(); + + return 0; +} diff --git a/recipes/fruit/all/test_v1_package/CMakeLists.txt b/recipes/fruit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ea0378c83fe1 --- /dev/null +++ b/recipes/fruit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package 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/fruit/all/test_v1_package/conanfile.py b/recipes/fruit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/fruit/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fruit/config.yml b/recipes/fruit/config.yml new file mode 100644 index 0000000000000..684a4c74b2542 --- /dev/null +++ b/recipes/fruit/config.yml @@ -0,0 +1,11 @@ +versions: + "3.4.0": + folder: all + "3.5.0": + folder: all + "3.6.0": + folder: all + "3.7.0": + folder: all + "3.7.1": + folder: all diff --git a/recipes/ftjam/all/conandata.yml b/recipes/ftjam/all/conandata.yml new file mode 100644 index 0000000000000..11d1d96f36866 --- /dev/null +++ b/recipes/ftjam/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.5.2": + url: "http://downloads.sourceforge.net/freetype/ftjam-2.5.2.tar.gz" + sha256: "a5d456f65477d77936e1726f5f803a2e6def18a6c6fccf5ea8528926c136abc8" +patches: + "2.5.2": + - patch_file: "patches/0001-jam-2.5-overflow.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-msvc-mingw-fix-makefile.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-missing-includes.patch" + base_path: "source_subfolder" diff --git a/recipes/ftjam/all/conanfile.py b/recipes/ftjam/all/conanfile.py new file mode 100644 index 0000000000000..3a86cd556cb4a --- /dev/null +++ b/recipes/ftjam/all/conanfile.py @@ -0,0 +1,127 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class FtjamConan(ConanFile): + name = "ftjam" + description = "Jam (ftjam) is a small open-source build tool that can be used as a replacement for Make." + topics = ("conan", "ftjam", "build", "make") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freetype.org/jam/" + license = "BSD-3-Clause" + exports_sources = "patches/*" + settings = "os", "arch", "compiler", "build_type" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("ftjam doesn't build with Visual Studio yet") + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("ftjam can't be cross-built") + + def package_id(self): + del self.info.settings.compiler + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + if self.settings.compiler == "Visual Studio": + self.build_requires("automake/1.16.2") + if self.settings.os != "Windows": + self.build_requires("bison/3.7.1") + + 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) + tools.replace_in_file(os.path.join(self._source_subfolder, "jamgram.c"), + "\n#line", "\n//#line") + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + # The configure MUST be run inside this directory + with tools.chdir(os.path.join(self.build_folder, self._source_subfolder, "builds", "unix")): + self._autotools.configure() + return self._autotools + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + if self.settings.os == "Windows": + # toolset name of the system building ftjam + jam_toolset = self._jam_toolset(self.settings.os, self.settings.compiler) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + env = autotools.vars + with tools.environment_append(env): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + self.run("nmake -f builds/win32-visualc.mk JAM_TOOLSET={}".format(jam_toolset)) + else: + with tools.environment_append({"PATH": [os.getcwd()]}): + autotools.make(args=["JAM_TOOLSET={}".format(jam_toolset), "-f", "builds/win32-gcc.mk"]) + else: + autotools = self._configure_autotools() + autotools.make() + + def package(self): + txt = tools.load(os.path.join(self._source_subfolder, "jam.c")) + license_txt = txt[:txt.find("*/")+3] + tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_txt) + if self.settings.os == "Windows": + if self.settings.compiler == "Visual Studio": + pass + else: + self.copy("*.exe", src=os.path.join(self._source_subfolder, "bin.nt"), dst=os.path.join(self.package_folder, "bin")) + else: + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.install() + + def _jam_toolset(self, os, compiler): + if compiler == "Visual Studio": + return "VISUALC" + if compiler == "intel": + return "INTELC" + if os == "Windows": + return "MINGW" + return None + + def package_info(self): + jam_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(jam_path)) + self.env_info.PATH.append(jam_path) + + jam_bin = os.path.join(jam_path, "jam") + if self.settings.os == "Windows": + jam_bin += ".exe" + self.output.info("Setting JAM environment variable: {}".format(jam_bin)) + self.env_info.JAM = jam_bin + + # toolset of the system using ftjam + jam_toolset = self._jam_toolset(self.settings.os, self.settings.compiler) + if jam_toolset: + self.output.info("Setting JAM_TOOLSET environment variable: {}".format(jam_toolset)) + self.env_info.JAM_TOOLSET = jam_toolset diff --git a/recipes/ftjam/all/patches/0001-jam-2.5-overflow.patch b/recipes/ftjam/all/patches/0001-jam-2.5-overflow.patch new file mode 100644 index 0000000000000..0acdb4452f8f2 --- /dev/null +++ b/recipes/ftjam/all/patches/0001-jam-2.5-overflow.patch @@ -0,0 +1,74 @@ +From: Lubomir Rintel +Subject: [PATCH] Fix stack smashing in variable expansion + +Apparently, Fedora's compiler flags were too long for jam's mind, +resulting in out-of-bounds write on stack. This patch increases length +of variable expansion buffer (and filename buffer, just in case) as +well as adds checks for buffer overflows in some places. + +--- expand.c 2003-04-23 06:45:50.000000000 +0200 ++++ expand.c 2009-07-25 15:59:30.319767119 +0200 +@@ -27,6 +27,7 @@ + * 10/22/02 (seiwald) - list_new() now does its own newstr()/copystr() + * 11/04/02 (seiwald) - const-ing for string literals + * 12/30/02 (armstrong) - fix out-of-bounds access in var_expand() ++ * 25/07/09 (lkundrak@v3.sk) - fix stack overflows in var_expand() + */ + + # include "jam.h" +@@ -286,7 +286,13 @@ var_expand( + if( colon && edits.filemods ) + var_edit_file( value->string, out, &edits ); +- else ++ else { ++ if( out + strlen( value->string ) > out_buf + sizeof( out_buf ) ) { ++ fprintf( stderr, "ERROR: String longer than %i characters: '%s' + '%s'\n", ++ sizeof( out_buf ), out, value->string ); ++ exit( 1 ); ++ } + strcpy( out, value->string ); ++ } + + if( colon && ( edits.upshift || edits.downshift ) ) + var_edit_shift( out, &edits ); +@@ -303,6 +303,11 @@ var_expand( + ( list_next( value ) || list_next( vars ) ) ) + { + out += strlen( out ); ++ if( out + strlen( edits.join.ptr ) > out_buf + sizeof( out_buf ) ) { ++ fprintf( stderr, "ERROR: String longer than %i characters: '%s' + '%s'\n", ++ sizeof( out_buf ), out, edits.join.ptr ); ++ exit( 1 ); ++ } + strcpy( out, edits.join.ptr ); + out += strlen( out ); + continue; +@@ -326,5 +326,10 @@ var_expand( + for( rem = remainder; rem; rem = list_next( rem ) ) + { ++ if( out1 + strlen( rem->string ) > out_buf + sizeof( out_buf ) ) { ++ fprintf( stderr, "ERROR: String longer than %i characters: '%s' + '%s'\n", ++ sizeof( out_buf ), out, rem->string ); ++ exit( 1 ); ++ } + strcpy( out1, rem->string ); + l = list_new( l, out_buf, 0 ); + } + +--- jam.h. 2004-06-23 19:45:36.000000000 +0200 ++++ jam.h 2009-07-25 15:59:35.464767132 +0200 +@@ -472,8 +472,12 @@ + + /* You probably don't need to muck with these. */ + +-# define MAXSYM 1024 /* longest symbol in the environment */ +-# define MAXJPATH 1024 /* longest filename */ ++# define MAXSYM 65536 /* longest symbol in the environment */ ++# ifdef PATH_MAX ++# define MAXJPATH PATH_MAX /* longest filename */ ++# else ++# define MAXJPATH 4096 ++# endif + + # define MAXJOBS 64 /* silently enforce -j limit */ + # define MAXARGC 32 /* words in $(JAMSHELL) */ diff --git a/recipes/ftjam/all/patches/0002-msvc-mingw-fix-makefile.patch b/recipes/ftjam/all/patches/0002-msvc-mingw-fix-makefile.patch new file mode 100644 index 0000000000000..b8206ebaf92c3 --- /dev/null +++ b/recipes/ftjam/all/patches/0002-msvc-mingw-fix-makefile.patch @@ -0,0 +1,35 @@ +--- builds/win32-visualc.mk ++++ builds/win32-visualc.mk +@@ -8,13 +8,14 @@ + # the program "jam.exe" will be created in a new directory + # named "bin.ntx86" + # + CC = cl /nologo +-CFLAGS = -DNT ++CFLAGS = $(CFLAGS) $(CPPFLAGS) -DNT + TARGET = /Fejam0 +-LINKLIBS = oldnames.lib kernel32.lib libc.lib ++LINKLIBS = $(LIBS) oldnames.lib kernel32.lib + + all: jam0 + attrib -r jambase.c ++ jam0 -v +- jam0 ++ jam0 JamFile + + !include common.mk +--- builds/win32-gcc.mk ++++ builds/win32-gcc.mk +@@ -10,9 +10,9 @@ + # directory named "bin.ntx86" + # + +-CC = gcc +-TARGET = -o jam0.exe +-CFLAGS = -DNT ++CC = gcc ++TARGET = -o jam0.exe ++CFLAGS += -DNT $(CPPFLAGS) + + all: jam0 + attrib -r jambase.c diff --git a/recipes/ftjam/all/patches/0003-missing-includes.patch b/recipes/ftjam/all/patches/0003-missing-includes.patch new file mode 100644 index 0000000000000..b84deefc435b2 --- /dev/null +++ b/recipes/ftjam/all/patches/0003-missing-includes.patch @@ -0,0 +1,26 @@ +--- a/execunix.c ++++ b/execunix.c +@@ -60,6 +60,8 @@ + # define wait my_wait + static int my_wait( int *status ); + # endif ++# else ++# include + # endif + + static int intr = 0; +--- a/make1.c ++++ b/make1.c +@@ -62,6 +62,12 @@ + # include "command.h" + # include "execcmd.h" + ++# ifdef _MSC_VER ++# include ++# else ++# include ++# endif ++ + static void make1a( TARGET *t, TARGET *parent ); + static void make1b( TARGET *t ); + static void make1c( TARGET *t ); diff --git a/recipes/ftjam/all/test_package/Jamfile b/recipes/ftjam/all/test_package/Jamfile new file mode 100644 index 0000000000000..bd4be599fc738 --- /dev/null +++ b/recipes/ftjam/all/test_package/Jamfile @@ -0,0 +1 @@ +Main test_package : main.c source.c ; diff --git a/recipes/ftjam/all/test_package/conanfile.py b/recipes/ftjam/all/test_package/conanfile.py new file mode 100644 index 0000000000000..da7d45af31ef5 --- /dev/null +++ b/recipes/ftjam/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import os +import shutil + + +class TestPackage(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.build_requires(str(self.requires["ftjam"])) + + def build(self): + for f in ("header.h", "main.c", "source.c", "Jamfile"): + shutil.copy(os.path.join(self.source_folder, f), + os.path.join(self.build_folder, f)) + if not tools.cross_building(self): + assert os.path.isfile(tools.get_env("JAM")) + + vars = AutoToolsBuildEnvironment(self).vars + vars["CCFLAGS"] = vars["CFLAGS"] + vars["C++FLAGS"] = vars["CXXFLAGS"] + vars["LINKFLAGS"] = vars["LDFLAGS"] + vars["LINKLIBS"] = vars["LIBS"] + with tools.environment_append(vars): + self.run("{} -d7".format(tools.get_env("JAM")), run_environment=True) + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(".", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ftjam/all/test_package/header.h b/recipes/ftjam/all/test_package/header.h new file mode 100644 index 0000000000000..c066b9d99476b --- /dev/null +++ b/recipes/ftjam/all/test_package/header.h @@ -0,0 +1,6 @@ +#ifndef HEADER_H_ +#define HEADER_H_ + +double some_function(double a, double b); + +#endif // HEADER_H_ diff --git a/recipes/ftjam/all/test_package/main.c b/recipes/ftjam/all/test_package/main.c new file mode 100644 index 0000000000000..cb8e9e3716805 --- /dev/null +++ b/recipes/ftjam/all/test_package/main.c @@ -0,0 +1,9 @@ +#include "header.h" + +#include + +int main() { + printf("Hello world\n"); + printf("Result of some_function(3., 4.) = %f\n", some_function(3., 4.)); + return 0; +} diff --git a/recipes/ftjam/all/test_package/source.c b/recipes/ftjam/all/test_package/source.c new file mode 100644 index 0000000000000..a0066ed8a7402 --- /dev/null +++ b/recipes/ftjam/all/test_package/source.c @@ -0,0 +1,5 @@ +#include "header.h" + +double some_function(double a, double b) { + return a + b; +} diff --git a/recipes/ftjam/config.yml b/recipes/ftjam/config.yml new file mode 100644 index 0000000000000..f94dbdec94df7 --- /dev/null +++ b/recipes/ftjam/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.2": + folder: "all" diff --git a/recipes/ftxui/all/conandata.yml b/recipes/ftxui/all/conandata.yml new file mode 100644 index 0000000000000..2a9fda1f01655 --- /dev/null +++ b/recipes/ftxui/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "4.0.0": + url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v4.0.0.tar.gz" + sha256: "7276e4117429ebf8e34ea371c3ea4e66eb99e0f234cb4c5c85fca17174a53dfa" + "3.0.0": + url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v3.0.0.tar.gz" + sha256: "a8f2539ab95caafb21b0c534e8dfb0aeea4e658688797bb9e5539729d9258cc1" + "2.0.0": + url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v2.0.0.tar.gz" + sha256: "d891695ef22176f0c09f8261a37af9ad5b262dd670a81e6b83661a23abc2c54f" +patches: + "4.0.0": + - patch_file: "patches/4.0.0-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" + "3.0.0": + - patch_file: "patches/2.0.0-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" + "2.0.0": + - patch_file: "patches/2.0.0-0001-lib-prefix.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "bugfix" + patch_source: "https://github.com/ArthurSonzogni/FTXUI/pull/340" + - patch_file: "patches/2.0.0-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" diff --git a/recipes/ftxui/all/conanfile.py b/recipes/ftxui/all/conanfile.py new file mode 100644 index 0000000000000..d458731d30305 --- /dev/null +++ b/recipes/ftxui/all/conanfile.py @@ -0,0 +1,121 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class FTXUIConan(ConanFile): + name = "ftxui" + description = "C++ Functional Terminal User Interface." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ArthurSonzogni/FTXUI" + topics = ("ncurses", "terminal", "screen", "tui") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "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 validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if is_msvc(self) and self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("shared with static runtime not supported") + + 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["FTXUI_BUILD_DOCS"] = False + tc.variables["FTXUI_BUILD_EXAMPLES"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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.set_property("cmake_file_name", "ftxui") + + self.cpp_info.components["ftxui-dom"].set_property("cmake_target_name", "ftxui::dom") + self.cpp_info.components["ftxui-dom"].libs = ["ftxui-dom"] + self.cpp_info.components["ftxui-dom"].requires = ["ftxui-screen"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ftxui-dom"].system_libs.append("m") + + self.cpp_info.components["ftxui-screen"].set_property("cmake_target_name", "ftxui::screen") + self.cpp_info.components["ftxui-screen"].libs = ["ftxui-screen"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ftxui-screen"].system_libs.append("m") + + self.cpp_info.components["ftxui-component"].set_property("cmake_target_name", "ftxui::component") + self.cpp_info.components["ftxui-component"].libs = ["ftxui-component"] + self.cpp_info.components["ftxui-component"].requires = ["ftxui-dom"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ftxui-component"].system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["ftxui-dom"].names["cmake_find_package"] = "dom" + self.cpp_info.components["ftxui-dom"].names["cmake_find_package_multi"] = "dom" + self.cpp_info.components["ftxui-screen"].names["cmake_find_package"] = "screen" + self.cpp_info.components["ftxui-screen"].names["cmake_find_package_multi"] = "screen" + self.cpp_info.components["ftxui-component"].names["cmake_find_package"] = "component" + self.cpp_info.components["ftxui-component"].names["cmake_find_package_multi"] = "component" diff --git a/recipes/ftxui/all/patches/2.0.0-0001-lib-prefix.patch b/recipes/ftxui/all/patches/2.0.0-0001-lib-prefix.patch new file mode 100644 index 0000000000000..ea9742245acd9 --- /dev/null +++ b/recipes/ftxui/all/patches/2.0.0-0001-lib-prefix.patch @@ -0,0 +1,23 @@ +From 71fdd3961c1311319709b976bf9065b1bb010800 Mon Sep 17 00:00:00 2001 +From: ericLemanissier +Date: Fri, 18 Feb 2022 14:58:28 +0100 +Subject: [PATCH] Don't override PREFIX target property + +PREFIX is by default "lib", which most of the libraries use. +this changes makes the library files libftxui-foo.a +as ArthurSonzogni/FTXUI#140 intended originally +--- + cmake/ftxui_set_options.cmake | 2 +- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/cmake/ftxui_set_options.cmake b/cmake/ftxui_set_options.cmake +index 9021cbcc..46e806c7 100644 +--- a/cmake/ftxui_set_options.cmake ++++ b/cmake/ftxui_set_options.cmake +@@ -1,5 +1,5 @@ + function(ftxui_set_options library) +- set_target_properties(${library} PROPERTIES PREFIX "ftxui-") ++ set_target_properties(${library} PROPERTIES OUTPUT_NAME "ftxui-${library}") + + + target_include_directories(${library} diff --git a/recipes/ftxui/all/patches/2.0.0-0002-install-dll.patch b/recipes/ftxui/all/patches/2.0.0-0002-install-dll.patch new file mode 100644 index 0000000000000..2b6bf21726448 --- /dev/null +++ b/recipes/ftxui/all/patches/2.0.0-0002-install-dll.patch @@ -0,0 +1,10 @@ +--- a/cmake/ftxui_install.cmake ++++ b/cmake/ftxui_install.cmake +@@ -1,6 +1,7 @@ + include(GNUInstallDirs) + install(TARGETS screen dom component + EXPORT ftxui-export ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) diff --git a/recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch b/recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch new file mode 100644 index 0000000000000..41ba040d126b6 --- /dev/null +++ b/recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/ftxui_install.cmake b/cmake/ftxui_install.cmake +index 19e68d0..19d22c0 100644 +--- a/cmake/ftxui_install.cmake ++++ b/cmake/ftxui_install.cmake +@@ -5,6 +5,7 @@ endif() + include(GNUInstallDirs) + install(TARGETS screen dom component + EXPORT ftxui-export ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) diff --git a/recipes/ftxui/all/test_package/CMakeLists.txt b/recipes/ftxui/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..44e0ebf683f7a --- /dev/null +++ b/recipes/ftxui/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ftxui REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ftxui::dom ftxui::screen) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ftxui/all/test_package/conanfile.py b/recipes/ftxui/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/ftxui/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ftxui/all/test_package/test_package.cpp b/recipes/ftxui/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7b4065ab9bc13 --- /dev/null +++ b/recipes/ftxui/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include // for operator|, text, Element, hcenter, Fit, hbox, size, window, Elements, bold, dim, EQUAL, WIDTH +#include // for Screen +#include // for allocator, shared_ptr +#include // for string, to_string +#include // for move + +int main(int argc, char *argv[]) +{ + using namespace ftxui; + auto make_box = [](const std::string& title) { + return window(text(title) | hcenter | bold, text("content") | hcenter | dim); + }; + + Elements content; + for (int x = 3; x < 30; ++x) { + content.push_back(make_box(std::to_string(x)) | size(WIDTH, EQUAL, x)); + } + + auto document = hbox(std::move(content)); + auto screen = Screen::Create(Dimension::Fit(document)); + + return 0; +} + diff --git a/recipes/ftxui/all/test_v1_package/CMakeLists.txt b/recipes/ftxui/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/ftxui/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ftxui/all/test_v1_package/conanfile.py b/recipes/ftxui/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/ftxui/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ftxui/config.yml b/recipes/ftxui/config.yml new file mode 100644 index 0000000000000..4763abe690b6e --- /dev/null +++ b/recipes/ftxui/config.yml @@ -0,0 +1,7 @@ +versions: + "4.0.0": + folder: all + "3.0.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/function2/all/conandata.yml b/recipes/function2/all/conandata.yml new file mode 100644 index 0000000000000..4a8c1d45eb5f5 --- /dev/null +++ b/recipes/function2/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "4.2.2": + url: "https://github.com/Naios/function2/archive/refs/tags/4.2.2.tar.gz" + sha256: "f755cb79712dfb9ceefcf7f7ff3225f7c99d22a164dae109044dbfad55d7111e" + "4.2.1": + url: "https://github.com/Naios/function2/archive/4.2.1.tar.gz" + sha256: "dfaf12f6cc4dadc4fc7051af7ac57be220c823aaccfd2fecebcb45a0a03a6eb0" + "4.2.0": + url: "https://github.com/Naios/function2/archive/4.2.0.tar.gz" + sha256: "fd1194b236e55f695c3a0c17f2440d6965b800c9309d0d5937e0185bcfe7ae6e" + "4.1.0": + sha256: "C3AAEAF93BF90C0F4505A18F1094B51FE28881CE202C3BF78EC4EFB336C51981" + url: "https://github.com/Naios/function2/archive/4.1.0.tar.gz" diff --git a/recipes/function2/all/conanfile.py b/recipes/function2/all/conanfile.py new file mode 100644 index 0000000000000..cd8358a3305e8 --- /dev/null +++ b/recipes/function2/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class Function2Conan(ConanFile): + name = "function2" + description = "Improved and configurable drop-in replacement to std::function that supports move only types, multiple overloads and more" + topics = ("function", "functional", "function-wrapper", "type-erasure", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Naios/function2" + license = "BSL-1.0" + 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": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14", + "msvc": "190", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/function2/all/test_package/CMakeLists.txt b/recipes/function2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..85a339e09a26c --- /dev/null +++ b/recipes/function2/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.10) + +project(test_package CXX) + +find_package(function2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE function2::function2) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/function2/all/test_package/conanfile.py b/recipes/function2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b4a4c16800289 --- /dev/null +++ b/recipes/function2/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", "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/function2/all/test_package/test_package.cpp b/recipes/function2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8f772f0ed0a92 --- /dev/null +++ b/recipes/function2/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +int main(int, char **) { + + fu2::unique_function fun = [](int /*a*/, int /*b*/) {}; + + (void) fun; + + return 0; +} diff --git a/recipes/function2/all/test_v1_package/CMakeLists.txt b/recipes/function2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/function2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/function2/all/test_v1_package/conanfile.py b/recipes/function2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8037a9296cc42 --- /dev/null +++ b/recipes/function2/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/function2/config.yml b/recipes/function2/config.yml new file mode 100644 index 0000000000000..955cd0773fc58 --- /dev/null +++ b/recipes/function2/config.yml @@ -0,0 +1,9 @@ +versions: + "4.2.2": + folder: all + "4.2.1": + folder: all + "4.2.0": + folder: all + "4.1.0": + folder: all diff --git a/recipes/functionalplus/all/conandata.yml b/recipes/functionalplus/all/conandata.yml new file mode 100644 index 0000000000000..ca33489d4d5de --- /dev/null +++ b/recipes/functionalplus/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "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/all/conanfile.py b/recipes/functionalplus/all/conanfile.py new file mode 100644 index 0000000000000..e87d42e53ba37 --- /dev/null +++ b/recipes/functionalplus/all/conanfile.py @@ -0,0 +1,82 @@ +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 +import os + +required_conan_version = ">=1.50.0" + + +class FunctionalPlusConan(ConanFile): + name = "functionalplus" + description = "Functional Programming Library for C++." + license = "BSL-1.0" + topics = ("functionalplus", "fplus", "functional programming") + homepage = "https://github.com/Dobiasd/FunctionalPlus" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.9", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.7", + "apple-clang": "9", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration("functionalplus requires C++14, which your compiler does not support.") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + 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_file_name", "FunctionalPlus") + self.cpp_info.set_property("cmake_target_name", "FunctionalPlus::fplus") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["fplus"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "FunctionalPlus" + self.cpp_info.names["cmake_find_package_multi"] = "FunctionalPlus" + self.cpp_info.components["fplus"].names["cmake_find_package"] = "fplus" + self.cpp_info.components["fplus"].names["cmake_find_package_multi"] = "fplus" + self.cpp_info.components["fplus"].set_property("cmake_target_name", "FunctionalPlus::fplus") + self.cpp_info.components["fplus"].bindirs = [] + self.cpp_info.components["fplus"].frameworkdirs = [] + self.cpp_info.components["fplus"].libdirs = [] + self.cpp_info.components["fplus"].resdirs = [] diff --git a/recipes/functionalplus/all/test_package/CMakeLists.txt b/recipes/functionalplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee3481206b2db --- /dev/null +++ b/recipes/functionalplus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(FunctionalPlus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE FunctionalPlus::fplus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/functionalplus/all/test_package/conanfile.py b/recipes/functionalplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/functionalplus/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/functionalplus/all/test_package/test_package.cpp b/recipes/functionalplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..669aac44618ff --- /dev/null +++ b/recipes/functionalplus/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include +#include + +int main() +{ + std::list things = {"same old", "same old"}; + if (fplus::all_the_same(things)) { + std::cout << "All things being equal." << std::endl; + } + return 0; +} diff --git a/recipes/functionalplus/all/test_v1_package/CMakeLists.txt b/recipes/functionalplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d0b01f5d3cd02 --- /dev/null +++ b/recipes/functionalplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(FunctionalPlus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE FunctionalPlus::fplus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/functionalplus/all/test_v1_package/conanfile.py b/recipes/functionalplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/functionalplus/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/functionalplus/config.yml b/recipes/functionalplus/config.yml new file mode 100644 index 0000000000000..42d00dd1c341a --- /dev/null +++ b/recipes/functionalplus/config.yml @@ -0,0 +1,13 @@ +versions: + "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/functions-framework-cpp/all/CMakeLists.txt b/recipes/functions-framework-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..c921d02a0d877 --- /dev/null +++ b/recipes/functions-framework-cpp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/functions-framework-cpp/all/conandata.yml b/recipes/functions-framework-cpp/all/conandata.yml new file mode 100644 index 0000000000000..c01327cda0d09 --- /dev/null +++ b/recipes/functions-framework-cpp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.0.0": + url: "https://github.com/GoogleCloudPlatform/functions-framework-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "005f2fbe3b8be9f6f0bf7a4a5d218a23b0f62d854a5e84c56872dd3a4d2820f7" +patches: + "1.0.0": + - patch_file: "patches/0001-dont-skip-namelink.patch" + base_path: "source_subfolder" diff --git a/recipes/functions-framework-cpp/all/conanfile.py b/recipes/functions-framework-cpp/all/conanfile.py new file mode 100644 index 0000000000000..96389274771c4 --- /dev/null +++ b/recipes/functions-framework-cpp/all/conanfile.py @@ -0,0 +1,154 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class FunctionsFrameworkCppConan(ConanFile): + name = "functions-framework-cpp" + description = "An open source FaaS (Functions as a Service) framework" + license = "Apache-2.0" + topics = ("google", "cloud", "functions-as-a-service", "faas-framework") + homepage = "https://github.com/GoogleCloudPlatform/functions-framework-cpp" + 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, + } + + generators = "cmake", "cmake_find_package_multi", "cmake_find_package" + short_paths = True + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + + def requirements(self): + self.requires("abseil/20211102.0") + self.requires("boost/1.78.0") + self.requires("nlohmann_json/3.10.5") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "clang": "7", + "apple-clang": "11", + } + + @property + def _required_boost_components(self): + return ["program_options"] + + def validate(self): + 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) + ) + ) + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + "{} requires C++17, which your compiler does not support.".format(self.name) + ) + + if self._is_msvc and self.options.shared: + raise ConanInvalidConfiguration("Fails to build for Visual Studio as a DLL") + + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration( + "Recipe not prepared for cross-building (yet)" + ) + + 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["BUILD_TESTING"] = False + self._cmake.definitions["FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES"] = False + + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "functions_framework_cpp") + self.cpp_info.set_property("cmake_target_name", "functions-framework-cpp::framework") + self.cpp_info.set_property("pkg_config_name", "functions_framework_cpp") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["framework"].libs = ["functions_framework_cpp"] + self.cpp_info.components["framework"].requires = [ + "abseil::absl_time", + "boost::headers", + "boost::program_options", + "nlohmann_json::nlohmann_json", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["framework"].system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "functions_framework_cpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "functions_framework_cpp" + self.cpp_info.names["pkg_config"] = "functions_framework_cpp" + self.cpp_info.components["framework"].set_property("cmake_target_name", "functions-framework-cpp::framework") + self.cpp_info.components["framework"].set_property("pkg_config_name", "functions_framework_cpp") diff --git a/recipes/functions-framework-cpp/all/patches/0001-dont-skip-namelink.patch b/recipes/functions-framework-cpp/all/patches/0001-dont-skip-namelink.patch new file mode 100644 index 0000000000000..eeaf81a81461c --- /dev/null +++ b/recipes/functions-framework-cpp/all/patches/0001-dont-skip-namelink.patch @@ -0,0 +1,10 @@ +--- a/google/cloud/functions/CMakeLists.txt ++++ b/google/cloud/functions/CMakeLists.txt +@@ -132,7 +132,6 @@ install( + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT runtime +- NAMELINK_SKIP + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT development + NAMELINK_COMPONENT development diff --git a/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt b/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4b4a2212f334 --- /dev/null +++ b/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(functions_framework_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} functions-framework-cpp::framework) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/functions-framework-cpp/all/test_package/conanfile.py b/recipes/functions-framework-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/functions-framework-cpp/all/test_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/functions-framework-cpp/all/test_package/test_package.cpp b/recipes/functions-framework-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d3e5b1cd6c630 --- /dev/null +++ b/recipes/functions-framework-cpp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main(int, char*[]) { + std::cout << google::cloud::functions::VersionString() << "\n"; + return 0; +} diff --git a/recipes/functions-framework-cpp/config.yml b/recipes/functions-framework-cpp/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/functions-framework-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/fusepp/all/CMakeLists.txt b/recipes/fusepp/all/CMakeLists.txt new file mode 100644 index 0000000000000..661f0d421c545 --- /dev/null +++ b/recipes/fusepp/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(KEEP_RPATHS) + +set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) + +file(GLOB_RECURSE INCLUDE_FILES "${SOURCE_SUBFOLDER}/Fuse*.h" "${SOURCE_SUBFOLDER}/Fuse.cpp") + +add_library(fusepp ${SOURCE_SUBFOLDER}/Fuse.cpp) + +set_target_properties(fusepp PROPERTIES PUBLIC_HEADER "${INCLUDE_FILES}") +install(TARGETS fusepp + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/fusepp/all/conandata.yml b/recipes/fusepp/all/conandata.yml new file mode 100644 index 0000000000000..f0eeba285988d --- /dev/null +++ b/recipes/fusepp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210820": + url: "https://github.com/jachappell/Fusepp/archive/4a457accb1ae4686b0ccc2805a317bc29a5cddf8.zip" + sha256: "2ea6379f0d76b9a8e7e805d7c6941863a7254653633e2f63a551c2ef6c4605e8" diff --git a/recipes/fusepp/all/conanfile.py b/recipes/fusepp/all/conanfile.py new file mode 100644 index 0000000000000..f23b9daa7e874 --- /dev/null +++ b/recipes/fusepp/all/conanfile.py @@ -0,0 +1,78 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class FuseppConan(ConanFile): + name = "fusepp" + description = "A simple C++ wrapper for the FUSE filesystem." + license = "MIT" + topics = ("fuse", "fusepp", "wrapper", "filesystem") + homepage = "https://github.com/jachappell/Fusepp" + 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 + } + exports_sources = "CMakeLists.txt" + + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + if self.settings.compiler == "gcc": + if tools.Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("gcc < 6 is unsupported") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def requirements(self): + self.requires("libfuse/3.10.5") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["fusepp"] + # TODO: Remove after Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "fusepp" + self.cpp_info.names["cmake_find_package_multi"] = "fusepp" + + self.cpp_info.set_property("cmake_file_name", "fusepp") + self.cpp_info.set_property("cmake_target_name", "fusepp") diff --git a/recipes/fusepp/all/test_package/CMakeLists.txt b/recipes/fusepp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00168e2e07000 --- /dev/null +++ b/recipes/fusepp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fusepp CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} fusepp::fusepp) diff --git a/recipes/fusepp/all/test_package/conanfile.py b/recipes/fusepp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..46d9d6bbaf311 --- /dev/null +++ b/recipes/fusepp/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run("%s --version" % bin_path, run_environment=True) diff --git a/recipes/fusepp/all/test_package/example.cpp b/recipes/fusepp/all/test_package/example.cpp new file mode 100644 index 0000000000000..1c551d1dc8302 --- /dev/null +++ b/recipes/fusepp/all/test_package/example.cpp @@ -0,0 +1,9 @@ +#include "Fuse.h" +#include "Fuse-impl.h" + +class MyFilesystem : public Fusepp::Fuse { +}; + +int main() { + MyFilesystem(); +} diff --git a/recipes/fusepp/config.yml b/recipes/fusepp/config.yml new file mode 100644 index 0000000000000..312f834c7fcdf --- /dev/null +++ b/recipes/fusepp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210820": + folder: all diff --git a/recipes/fxdiv/all/conandata.yml b/recipes/fxdiv/all/conandata.yml new file mode 100644 index 0000000000000..6c67406686303 --- /dev/null +++ b/recipes/fxdiv/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200417": + url: "https://github.com/Maratyszcza/FXdiv/archive/b408327ac2a15ec3e43352421954f5b1967701d1.zip" + sha256: "ab7dfb08829bee33dca38405d647868fb214ac685e379ec7ef2bebcd234cd44d" diff --git a/recipes/fxdiv/all/conanfile.py b/recipes/fxdiv/all/conanfile.py new file mode 100644 index 0000000000000..8b36feb1d6229 --- /dev/null +++ b/recipes/fxdiv/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class FxdivConan(ConanFile): + name = "fxdiv" + description = "C99/C++ header-only library for division via fixed-point " \ + "multiplication by inverse." + license = "MIT" + topics = ("integer-division",) + homepage = "https://github.com/Maratyszcza/FXdiv" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def 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", 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fxdiv/all/test_package/CMakeLists.txt b/recipes/fxdiv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4681666d5bdaf --- /dev/null +++ b/recipes/fxdiv/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(fxdiv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fxdiv::fxdiv) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fxdiv/all/test_package/conanfile.py b/recipes/fxdiv/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/fxdiv/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/fxdiv/all/test_package/test_package.c b/recipes/fxdiv/all/test_package/test_package.c new file mode 100644 index 0000000000000..40cff7fec58d4 --- /dev/null +++ b/recipes/fxdiv/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include + +#include +#include + +void divide_array_fxdiv(size_t length, uint32_t array[], uint32_t divisor) { + const struct fxdiv_divisor_uint32_t precomputed_divisor = fxdiv_init_uint32_t(divisor); + for (size_t i = 0; i < length; ++i) { + array[i] = fxdiv_quotient_uint32_t(array[i], precomputed_divisor); + } +} + +int main() { + uint32_t arr[] = {19, 3219, 34, 4, 365}; + divide_array_fxdiv(5, arr, 7); + return 0; +} diff --git a/recipes/fxdiv/all/test_v1_package/CMakeLists.txt b/recipes/fxdiv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/fxdiv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fxdiv/all/test_v1_package/conanfile.py b/recipes/fxdiv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fxdiv/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/fxdiv/config.yml b/recipes/fxdiv/config.yml new file mode 100644 index 0000000000000..649be3e218ae5 --- /dev/null +++ b/recipes/fxdiv/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200417": + folder: all diff --git a/recipes/g3log/all/conandata.yml b/recipes/g3log/all/conandata.yml new file mode 100644 index 0000000000000..1ad5a5433b5fb --- /dev/null +++ b/recipes/g3log/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "2.3": + url: "https://github.com/KjellKod/g3log/archive/2.3.tar.gz" + sha256: "a27dc3ff0d962cc6e0b4e60890b4904e664b0df16393d27e14c878d7de09b505" + "2.2": + url: "https://github.com/KjellKod/g3log/archive/2.2.tar.gz" + sha256: "9ce18295f71936eaa12d890996ca48fdb578bf0bde16ab652e86b8f30dbe1f1e" + "2.1": + url: "https://github.com/KjellKod/g3log/archive/2.1.tar.gz" + sha256: "13c9d8cc0387792301f264c4f623618fc4dea9814d9b5844931ffbfd9aafb1fe" + "1.3.4": + url: "https://github.com/KjellKod/g3log/archive/refs/tags/1.3.4.tar.gz" + sha256: "2fe8815e5f5afec6b49bdfedfba1e86b8e58a5dc89fd97f4868fb7f3141aed19" + "1.3.3": + url: "https://github.com/KjellKod/g3log/archive/1.3.3.tar.gz" + sha256: "d8cae14e1508490145d710f10178b2da9b86ce03fb2428a684fff35576fe5d5c" + "1.3.2-86": + url: "https://github.com/KjellKod/g3log/archive/4000c5c899c0ae58b8b851f9b66e1a2ac0fe2bff.tar.gz" + sha256: "4572b723458fbe2b3bf620e2bd47ecfab2975c16369dc6390ffa27e177b33c88" + "1.3.2": + url: "https://github.com/KjellKod/g3log/archive/1.3.2.tar.gz" + sha256: "0ed1983654fdd8268e051274904128709c3d9df8234acf7916e9015199b0b247" +patches: + "1.3.2": + - patch_file: "patches/1.3.2-0001-remove-explicit-stdlib-setting.patch" + patch_description: "fix compilation and link errors on Linux" + patch_type: "portability" diff --git a/recipes/g3log/all/conanfile.py b/recipes/g3log/all/conanfile.py new file mode 100644 index 0000000000000..714d7778c58eb --- /dev/null +++ b/recipes/g3log/all/conanfile.py @@ -0,0 +1,170 @@ +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 export_conandata_patches, apply_conandata_patches, copy, get, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class G3logConan(ConanFile): + name = "g3log" + description = ( + "G3log is an asynchronous, \"crash safe\", logger that is easy to use " + "with default logging sinks or you can add your own." + ) + license = "The Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/KjellKod/g3log" + topics = ("logging", "log", "asynchronous") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_dynamic_logging_levels": [True, False], + "change_debug_to_dbug": [True, False], + "use_dynamic_max_message_size": [True, False], + "log_full_filename": [True, False], + "enable_fatal_signal_handling": [True, False], + "enable_vectored_exception_handling": [True, False], + "debug_break_at_fatal_signal": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_dynamic_logging_levels": False, + "change_debug_to_dbug": False, + "use_dynamic_max_message_size": True, + "log_full_filename": False, + "enable_fatal_signal_handling": True, + "enable_vectored_exception_handling": True, + "debug_break_at_fatal_signal": False, + } + + @property + def _min_cppstd(self): + return "14" if Version(self.version) < "2.0" else "17" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6.1", + "clang": "3.4", + "apple-clang": "5.1", + "Visual Studio": "15", + "msvc": "191", + }, + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not is_msvc(self): + del self.options.enable_vectored_exception_handling + del self.options.debug_break_at_fatal_signal + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + 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["VERSION"] = self.version + tc.variables["G3_SHARED_LIB"] = self.options.shared + tc.variables["USE_DYNAMIC_LOGGING_LEVELS"] = self.options.use_dynamic_logging_levels + tc.variables["CHANGE_G3LOG_DEBUG_TO_DBUG"] = self.options.change_debug_to_dbug + tc.variables["USE_G3_DYNAMIC_MAX_MESSAGE_SIZE"] = self.options.use_dynamic_max_message_size + tc.variables["G3_LOG_FULL_FILENAME"] = self.options.log_full_filename + tc.variables["ENABLE_FATAL_SIGNALHANDLING"] = self.options.enable_fatal_signal_handling + if is_msvc(self): + tc.variables["ENABLE_VECTORED_EXCEPTIONHANDLING"] = self.options.enable_vectored_exception_handling + tc.variables["DEBUG_BREAK_AT_FATAL_SIGNAL"] = self.options.debug_break_at_fatal_signal + tc.variables["ADD_FATAL_EXAMPLE"] = "OFF" + tc.variables["ADD_G3LOG_PERFORMANCE"] = "OFF" + tc.variables["ADD_G3LOG_UNIT_TEST"] = "OFF" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"g3log": "g3log::g3log"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "g3log") + self.cpp_info.set_property("cmake_target_name", "g3log") + self.cpp_info.libs = ["g3logger" if Version(self.version) < "1.3.4" else "g3log"] + + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.system_libs.extend(["m", "pthread", "rt"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("dbghelp") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/g3log/all/patches/1.3.2-0001-remove-explicit-stdlib-setting.patch b/recipes/g3log/all/patches/1.3.2-0001-remove-explicit-stdlib-setting.patch new file mode 100644 index 0000000000000..bbd9ff69e7c4d --- /dev/null +++ b/recipes/g3log/all/patches/1.3.2-0001-remove-explicit-stdlib-setting.patch @@ -0,0 +1,57 @@ +diff --git a/Build.cmake b/Build.cmake +index c692a4c..cd5c6d1 100644 +--- a/Build.cmake ++++ b/Build.cmake +@@ -25,11 +25,6 @@ IF (${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang") + message( STATUS "" ) + message( STATUS "cmake for Clang " ) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++14 -Wunused -D_GLIBCXX_USE_NANOSLEEP") +- IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -pthread") +- ELSE() +- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +- ENDIF() + IF (${CMAKE_SYSTEM} MATCHES "FreeBSD-([0-9]*)\\.(.*)") + IF (${CMAKE_MATCH_1} GREATER 9) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 914a761..28976ee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -160,7 +160,6 @@ message( STATUS "Software Version: ${VERSION}" ) + + + +-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # ========================================================================== + # Only tested on Ubuntu, CentOS and OSX. + # For OSX you can also install an older version using 'brew install' +@@ -177,7 +176,6 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" + # + # ========================================================================== + INCLUDE (${g3log_SOURCE_DIR}/CPackLists.txt) +-ENDIF() + + IF(MINGW) + # ========================================================================== +diff --git a/CPackLists.txt b/CPackLists.txt +index 7a89ad0..3262b6d 100644 +--- a/CPackLists.txt ++++ b/CPackLists.txt +@@ -23,7 +23,7 @@ IF(NOT MINGW) + ENDIF() + ENDIF() + +-SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output dir for libraries") ++SET(CMAKE_INSTALL_LIBDIR lib CACHE STRING "Output dir for libraries" FORCE) + SET(CMAKE_INSTALL_HEADERDIR include CACHE PATH "Output dir for headers") + + SET(CPACK_PACKAGE_NAME g3log) +@@ -43,6 +43,7 @@ IF(NOT MINGW) + INSTALL( TARGETS g3logger + ARCHIVE DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR} + COMPONENT libraries) + + INSTALL( FILES ${HEADER_FILES} diff --git a/recipes/g3log/all/test_package/CMakeLists.txt b/recipes/g3log/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c9d535ba3d96a --- /dev/null +++ b/recipes/g3log/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(g3log REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE g3log) +if(g3log_VERSION VERSION_LESS 2.0) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/g3log/all/test_package/conanfile.py b/recipes/g3log/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/g3log/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/g3log/all/test_package/test_package.cpp b/recipes/g3log/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d88cfa9eb0b4a --- /dev/null +++ b/recipes/g3log/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +int main() +{ + auto worker = g3::LogWorker::createLogWorker(); + auto defaultHandler = worker->addDefaultLogger("my_log", "."); + g3::initializeLogging(worker.get()); + LOG(INFO) << "Make a log call"; + return 0; +} + diff --git a/recipes/g3log/all/test_v1_package/CMakeLists.txt b/recipes/g3log/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/g3log/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/g3log/all/test_v1_package/conanfile.py b/recipes/g3log/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/g3log/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/g3log/config.yml b/recipes/g3log/config.yml new file mode 100644 index 0000000000000..0452fc2e8e027 --- /dev/null +++ b/recipes/g3log/config.yml @@ -0,0 +1,15 @@ +versions: + "2.3": + folder: all + "2.2": + folder: all + "2.1": + folder: all + "1.3.4": + folder: all + "1.3.3": + folder: all + "1.3.2-86": + folder: all + "1.3.2": + folder: all diff --git a/recipes/gainput/all/conandata.yml b/recipes/gainput/all/conandata.yml new file mode 100644 index 0000000000000..663b4be81a94a --- /dev/null +++ b/recipes/gainput/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.0": + url: "https://github.com/jkuhlmann/gainput/archive/refs/tags/v1.0.0.tar.gz" + sha256: "e1444f2093d0b8c1a0a127668e957b91517177aa1ece292efefacc127a56bd96" +patches: + "1.0.0": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/gainput/all/conanfile.py b/recipes/gainput/all/conanfile.py new file mode 100644 index 0000000000000..609bad1913a9e --- /dev/null +++ b/recipes/gainput/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.52.0" + + +class GainputConan(ConanFile): + name = "gainput" + description = "Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch." + license = "MIT" + topics = ("gainput", "input", "keyboard", "gamepad", "mouse", "multi-touch") + homepage = "https://gainput.johanneskuhlmann.de" + 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, + } + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + + 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["GAINPUT_SAMPLES"] = False + tc.variables["GAINPUT_TESTS"] = False + tc.variables["GAINPUT_BUILD_SHARED"] = self.options.shared + tc.variables["GAINPUT_BUILD_STATIC"] = not self.options.shared + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + suffix = "{}{}".format("" if self.options.shared else "static", + "-d" if self.settings.build_type == "Debug" else "") + self.cpp_info.libs = ["gainput" + suffix] + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["xinput", "ws2_32"]) + elif self.settings.os == "Android": + self.cpp_info.system_libs.extend(["native_app_glue", "log", "android"]) + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "Foundation", "IOKit", "GameController"]) + if self.settings.os == "iOS": + self.cpp_info.frameworks.extend(["UIKit", "CoreMotion"]) + else: + self.cpp_info.frameworks.append("AppKit") diff --git a/recipes/gainput/all/patches/0001-fix-cmake.patch b/recipes/gainput/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..39ae12ecf689f --- /dev/null +++ b/recipes/gainput/all/patches/0001-fix-cmake.patch @@ -0,0 +1,52 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ + cmake_minimum_required(VERSION 2.8) ++project(gainput) + set(GAINPUT_MAJOR_VERSION 1) + set(GAINPUT_MINOR_VERSION 0) + set(GAINPUT_PATCH_VERSION 0) +@@ -9,7 +10,7 @@ option(GAINPUT_TESTS "Build Tests for Gainput" ON) + option(GAINPUT_BUILD_SHARED "BUILD_SHARED" ON) + option(GAINPUT_BUILD_STATIC "BUILD_STATIC" ON) + +-if(!WIN32) ++if(NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra") + else() + set(XINPUT "Xinput9_1_0") +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -1,10 +1,8 @@ +-project(gainput) + message(STATUS "GAINPUT version ${GAINPUT_VERSION}") + + set(CMAKE_MACOSX_RPATH 1) + + if(CMAKE_COMPILER_IS_GNUCXX) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wextra -pedantic -Wshadow -Wno-variadic-macros") + endif() + + include_directories (include/) +@@ -36,12 +34,11 @@ if (GAINPUT_BUILD_STATIC) + set(install_libs ${install_libs} gainputstatic) + endif (GAINPUT_BUILD_STATIC) + ++if(GAINPUT_BUILD_SHARED) + if(WIN32) + target_link_libraries(gainput ${XINPUT} ws2_32) +- target_link_libraries(gainputstatic ${XINPUT} ws2_32) + add_definitions(-DGAINPUT_LIB_DYNAMIC=1) + elseif(ANDROID) +- target_link_libraries(gainputstatic native_app_glue log android) + target_link_libraries(gainput native_app_glue log android) + elseif(APPLE) + find_library(FOUNDATION Foundation) +@@ -58,6 +55,7 @@ elseif(APPLE) + target_link_libraries(gainput ${APPKIT}) + endif() + endif() ++endif() + + # Library installation directory + if(NOT DEFINED CMAKE_INSTALL_LIBDIR) diff --git a/recipes/gainput/all/test_package/CMakeLists.txt b/recipes/gainput/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f0a0ee2f13583 --- /dev/null +++ b/recipes/gainput/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(gainput REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gainput::gainput) diff --git a/recipes/gainput/all/test_package/conanfile.py b/recipes/gainput/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gainput/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/gainput/all/test_package/test_package.cpp b/recipes/gainput/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ca866c0b7fbf9 --- /dev/null +++ b/recipes/gainput/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +int main() { + enum Button + { + ButtonConfirm + }; + + gainput::InputManager manager; + manager.SetDisplaySize(800, 600); + const gainput::DeviceId keyboardId = manager.CreateDevice(); + const gainput::DeviceId padId = manager.CreateDevice(); + const gainput::DeviceId touchId = manager.CreateDevice(); + + gainput::InputMap map(manager); + map.MapBool(ButtonConfirm, keyboardId, gainput::KeyReturn); + map.MapBool(ButtonConfirm, padId, gainput::PadButtonA); + map.MapBool(ButtonConfirm, touchId, gainput::Touch0Down); + + return 0; +} diff --git a/recipes/gainput/all/test_v1_package/CMakeLists.txt b/recipes/gainput/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e3274020b8ef --- /dev/null +++ b/recipes/gainput/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gainput REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gainput::gainput) diff --git a/recipes/gainput/all/test_v1_package/conanfile.py b/recipes/gainput/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gainput/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/gainput/config.yml b/recipes/gainput/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/gainput/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/gamenetworkingsockets/all/CMakeLists.txt b/recipes/gamenetworkingsockets/all/CMakeLists.txt new file mode 100644 index 0000000000000..7a80c0b2c26dc --- /dev/null +++ b/recipes/gamenetworkingsockets/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory("source_subfolder") diff --git a/recipes/gamenetworkingsockets/all/conandata.yml b/recipes/gamenetworkingsockets/all/conandata.yml new file mode 100644 index 0000000000000..882c3ee20c6d7 --- /dev/null +++ b/recipes/gamenetworkingsockets/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.3.0": + url: "https://github.com/ValveSoftware/GameNetworkingSockets/archive/refs/tags/v1.3.0.zip" + sha256: "22e409546babc449c44f492b253b547a2f5f11abe11a100686a10a990b5091cd" +patches: + "1.3.0": + - patch_file: "patches/001-disable-runtime-override.patch" + base_path: "source_subfolder" + - patch_file: "patches/002-either-static-or-shared.patch" + base_path: "source_subfolder" diff --git a/recipes/gamenetworkingsockets/all/conanfile.py b/recipes/gamenetworkingsockets/all/conanfile.py new file mode 100644 index 0000000000000..cb91ff14df39f --- /dev/null +++ b/recipes/gamenetworkingsockets/all/conanfile.py @@ -0,0 +1,126 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class GameNetworkingSocketsConan(ConanFile): + name = "gamenetworkingsockets" + description = "GameNetworkingSockets is a basic transport layer for games." + topics = ("networking", "game-development") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ValveSoftware/GameNetworkingSockets" + license = "BSD-3-Clause" + generators = "cmake", "pkg_config" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt", "patches/**"] + + options = { + "shared": [True, False], + "fPIC": [True, False], + "encryption": ["openssl", "libsodium", "bcrypt"] + } + + default_options = { + "shared": False, + "fPIC": True, + "encryption": "openssl" + } + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + if self.options.encryption == "bcrypt" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("bcrypt is only valid on Windows") + + def build_requirements(self): + self.build_requires("protobuf/3.17.1") + + def requirements(self): + self.requires("protobuf/3.17.1") + if self.options.encryption == "openssl": + self.requires("openssl/1.1.1l") + elif self.options.encryption == "libsodium": + self.requires("libsodium/1.0.18") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["BUILD_SHARED"] = self.options.shared + self._cmake.definitions["GAMENETWORKINGSOCKETS_BUILD_EXAMPLES"] = False + self._cmake.definitions["GAMENETWORKINGSOCKETS_BUILD_TESTS"] = False + self._cmake.definitions["Protobuf_USE_STATIC_LIBS"] = not self.options["protobuf"].shared + crypto = {"openssl": "OpenSSL", "libsodium": "libsodium", "bcrypt": "BCrypt"} + self._cmake.definitions["USE_CRYPTO"] = crypto[str(self.options.encryption)] + crypto25519 = {"openssl": "OpenSSL", "libsodium": "libsodium", "bcrypt": "Reference"} + self._cmake.definitions["USE_CRYPTO25519"] = crypto25519[str(self.options.encryption)] + if self.options.encryption == "openssl": + self._cmake.definitions["OPENSSL_NEW_ENOUGH"] = True + self._cmake.definitions["OPENSSL_HAS_25519_RAW"] = True + 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() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "GameNetworkingSockets" + self.cpp_info.names["cmake_find_package_multi"] = "GameNetworkingSockets" + self.cpp_info.names["pkg_config"] = "GameNetworkingSockets" + self.cpp_info.includedirs.append(os.path.join("include", "GameNetworkingSockets")) + if self.options.shared: + self.cpp_info.libs = ["GameNetworkingSockets"] + else: + self.cpp_info.libs = ["GameNetworkingSockets_s"] + self.cpp_info.defines = ["STEAMNETWORKINGSOCKETS_STATIC_LINK"] + + self.cpp_info.requires = ["protobuf::libprotobuf"] + if self.options.encryption == "openssl": + self.cpp_info.requires += ["openssl::crypto"] + elif self.options.encryption == "libsodium": + self.cpp_info.requires += ["libsodium::libsodium"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "crypt32", "winmm"] + if self.options.encryption == "bcrypt": + self.cpp_info.system_libs += ["bcrypt"] + diff --git a/recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch b/recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch new file mode 100644 index 0000000000000..652aea2685bb8 --- /dev/null +++ b/recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/tmp/CMakeLists.txt +index 3471701..49efee3 100644 +--- a/CMakeLists.txt ++++ b/tmp/CMakeLists.txt +@@ -35,7 +35,7 @@ endif() + + include(FlagsMSVC) + set(MSVC_RUNTIME "dynamic") +-configure_msvc_runtime() ++# configure_msvc_runtime() + print_default_msvc_flags() + + add_definitions( -DVALVE_CRYPTO_ENABLE_25519 ) diff --git a/recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch b/recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch new file mode 100644 index 0000000000000..47b3eec1ee41e --- /dev/null +++ b/recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch @@ -0,0 +1,49 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7040ab3..c75897e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -282,28 +282,38 @@ macro(gamenetworkingsockets_common GNS_TARGET) + + endmacro() + ++if (BUILD_SHARED) + add_library(GameNetworkingSockets SHARED "") + add_library(GameNetworkingSockets::GameNetworkingSockets ALIAS GameNetworkingSockets) + add_library(GameNetworkingSockets::shared ALIAS GameNetworkingSockets) + gamenetworkingsockets_common(GameNetworkingSockets) + ++install( ++ TARGETS GameNetworkingSockets ++ EXPORT GameNetworkingSockets ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++endif() ++ ++if (BUILD_STATIC) + add_library(GameNetworkingSockets_s STATIC "") + add_library(GameNetworkingSockets::GameNetworkingSockets_s ALIAS GameNetworkingSockets_s) + add_library(GameNetworkingSockets::static ALIAS GameNetworkingSockets_s) + target_compile_definitions(GameNetworkingSockets_s INTERFACE STEAMNETWORKINGSOCKETS_STATIC_LINK) + gamenetworkingsockets_common(GameNetworkingSockets_s) + +-# Install rules +- + install( +- TARGETS +- GameNetworkingSockets +- GameNetworkingSockets_s ++ TARGETS GameNetworkingSockets_s + EXPORT GameNetworkingSockets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- ) ++) ++endif() ++ ++# Install rules + + install(DIRECTORY ../include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GameNetworkingSockets) + diff --git a/recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt b/recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb6bc1b893324 --- /dev/null +++ b/recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GameNetworkingSockets REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} GameNetworkingSockets::GameNetworkingSockets) diff --git a/recipes/gamenetworkingsockets/all/test_package/conanfile.py b/recipes/gamenetworkingsockets/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gamenetworkingsockets/all/test_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/gamenetworkingsockets/all/test_package/test_package.cpp b/recipes/gamenetworkingsockets/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..558f03d11e7d6 --- /dev/null +++ b/recipes/gamenetworkingsockets/all/test_package/test_package.cpp @@ -0,0 +1,55 @@ +#include +#include +#include + +#include +#include + +static FILE* g_fpLog = NULL; +static SteamNetworkingMicroseconds g_logTimeZero; + +static void DebugOutput(ESteamNetworkingSocketsDebugOutputType eType, char const* pszMsg) +{ + SteamNetworkingMicroseconds time = SteamNetworkingUtils()->GetLocalTimestamp() - g_logTimeZero; + if (g_fpLog) { + fprintf(g_fpLog, "%10.6f %s\n", time * 1e-6, pszMsg); + } + + if (eType <= k_ESteamNetworkingSocketsDebugOutputType_Msg) { + printf("%10.6f %s\n", time * 1e-6, pszMsg); + fflush(stdout); + } + + if (eType == k_ESteamNetworkingSocketsDebugOutputType_Bug) { + fflush(stdout); + fflush(stderr); + if (g_fpLog) { + fflush(g_fpLog); + } + + if (strstr(pszMsg, "SteamNetworkingGlobalLock held for")) { + return; + } + + assert(!"TEST FAILED"); + } +} + +int main() +{ + g_fpLog = stderr; + g_logTimeZero = SteamNetworkingUtils()->GetLocalTimestamp(); + + SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Debug, DebugOutput); + SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Verbose, DebugOutput); + SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Msg, DebugOutput); + + SteamDatagramErrMsg errMsg; + if (!GameNetworkingSockets_Init(NULL, errMsg)) { + fprintf(stderr, "GameNetworkingSockets_Init failed. %s", errMsg); + return 1; + } + + GameNetworkingSockets_Kill(); + return 0; +} diff --git a/recipes/gamenetworkingsockets/config.yml b/recipes/gamenetworkingsockets/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/gamenetworkingsockets/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/gamma/all/CMakeLists.txt b/recipes/gamma/all/CMakeLists.txt new file mode 100644 index 0000000000000..c614cd0c1e028 --- /dev/null +++ b/recipes/gamma/all/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 3.8) +project(Gamma LANGUAGES CXX) + +option(GAMMA_AUDIO_IO "Provide Audio Class" ON) +option(GAMMA_SOUNDFILE "Provide SoundFile Class" ON) + +include(GNUInstallDirs) + +file(GLOB GAMMA_PUBLIC_HEADERS ${GAMMA_SRC_DIR}/Gamma/*.h) + +add_library(Gamma + ${GAMMA_SRC_DIR}/src/arr.cpp + ${GAMMA_SRC_DIR}/src/Conversion.cpp + ${GAMMA_SRC_DIR}/src/Domain.cpp + ${GAMMA_SRC_DIR}/src/DFT.cpp + ${GAMMA_SRC_DIR}/src/FFT_fftpack.cpp + ${GAMMA_SRC_DIR}/src/fftpack++1.cpp + ${GAMMA_SRC_DIR}/src/fftpack++2.cpp + ${GAMMA_SRC_DIR}/src/Print.cpp + ${GAMMA_SRC_DIR}/src/scl.cpp + ${GAMMA_SRC_DIR}/src/Recorder.cpp + ${GAMMA_SRC_DIR}/src/Scheduler.cpp + ${GAMMA_SRC_DIR}/src/Timer.cpp +) +target_include_directories(Gamma PUBLIC ${GAMMA_SRC_DIR}) +target_compile_features(Gamma PUBLIC cxx_std_14) +set_target_properties(Gamma PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +find_package(Threads REQUIRED) +target_link_libraries(Gamma PRIVATE Threads::Threads) + +include(CheckFunctionExists) +check_function_exists(pow HAVE_MATH_SYSTEM) +if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(Gamma PRIVATE m) +endif() + +if(GAMMA_AUDIO_IO) + find_package(portaudio REQUIRED CONFIG) + target_link_libraries(Gamma PRIVATE portaudio::portaudio) + target_sources(Gamma PRIVATE ${GAMMA_SRC_DIR}/src/AudioIO.cpp) +else() + list(FILTER GAMMA_PUBLIC_HEADERS EXCLUDE REGEX ".*AudioIO\\.h$") +endif() + +if(GAMMA_SOUNDFILE) + find_package(SndFile REQUIRED CONFIG) + target_link_libraries(Gamma PRIVATE SndFile::sndfile) + target_sources(Gamma PRIVATE ${GAMMA_SRC_DIR}/src/SoundFile.cpp) + target_compile_definitions(Gamma PRIVATE GAM_USE_LIBSNDFILE) +else() + list(FILTER GAMMA_PUBLIC_HEADERS EXCLUDE REGEX ".*SoundFile\\.h$") +endif() + +install( + TARGETS Gamma + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install(FILES ${GAMMA_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Gamma) diff --git a/recipes/gamma/all/conandata.yml b/recipes/gamma/all/conandata.yml new file mode 100644 index 0000000000000..4cabf0af40040 --- /dev/null +++ b/recipes/gamma/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220221": + url: "https://github.com/LancePutnam/Gamma/archive/cd192cad292d78210b6ecd6202a7799c6ab976fc.tar.gz" + sha256: "96b70ce3bf876a7f71a3b698b2a2030240649b54ae57209d9851f9c3062b30a2" diff --git a/recipes/gamma/all/conanfile.py b/recipes/gamma/all/conanfile.py new file mode 100644 index 0000000000000..b5f3681984e45 --- /dev/null +++ b/recipes/gamma/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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class Gammaconan(ConanFile): + name = "gamma" + description = ( + "Gamma is a cross-platform, C++ library for doing generic synthesis " + "and filtering of signals." + ) + license = "MIT" + topics = ("signal-processing", "sound", "audio") + homepage = "https://github.com/LancePutnam/Gamma" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "audio_io": [True, False], + "soundfile": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "audio_io": False, + "soundfile": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.soundfile: + self.requires("libsndfile/1.2.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + if self.options.audio_io: + # TODO: add audio_io support once portaudio added to CCI + raise ConanInvalidConfiguration( + "gamma:audio_io=True requires portaudio, not available in conan-center yet" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GAMMA_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["GAMMA_AUDIO_IO"] = self.options.audio_io + tc.variables["GAMMA_SOUNDFILE"] = self.options.soundfile + tc.generate() + deps = CMakeDeps(self) + deps.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 = ["Gamma"] + if not self.options.shared and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/gamma/all/test_package/CMakeLists.txt b/recipes/gamma/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..98f55fe7ea287 --- /dev/null +++ b/recipes/gamma/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(gamma REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gamma::gamma) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/gamma/all/test_package/conanfile.py b/recipes/gamma/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gamma/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/gamma/all/test_package/test_package.cpp b/recipes/gamma/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..217ea581adcd5 --- /dev/null +++ b/recipes/gamma/all/test_package/test_package.cpp @@ -0,0 +1,85 @@ +#include +#include +#include + +#include +#include + +using namespace gam; +using namespace gam::gen; + +int main(){ + + const unsigned size = 32; + float table[size]; + //unsigned indices[size]; + + for(unsigned i=0; i>1]; + featureI = arr::maxima(peaks, table, size); + printf("Maxima (%d):\n", featureI); + for(unsigned long i=0; i + +int main() +{ + puts(" gcc: Hello, World!"); + return 0; +} + diff --git a/recipes/gcc/all/test_package/hello.cpp b/recipes/gcc/all/test_package/hello.cpp new file mode 100644 index 0000000000000..6cf57370b3281 --- /dev/null +++ b/recipes/gcc/all/test_package/hello.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + std::cout << " g++: Hello, World!\n"; + return 0; +} + diff --git a/recipes/gcc/all/test_package/hello.f90 b/recipes/gcc/all/test_package/hello.f90 new file mode 100644 index 0000000000000..ff78fe23454f7 --- /dev/null +++ b/recipes/gcc/all/test_package/hello.f90 @@ -0,0 +1,4 @@ +program hello + implicit none + write(*,*) 'gfortran: Hello, World!' +end program hello diff --git a/recipes/gcc/all/test_v1_package/conanfile.py b/recipes/gcc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a9e585e6ddfd4 --- /dev/null +++ b/recipes/gcc/all/test_v1_package/conanfile.py @@ -0,0 +1,34 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def test(self): + def chmod_plus_x(name): + if os.name == 'posix': + os.chmod(name, os.stat(name).st_mode | 0o111) + + cc = self.deps_env_info["gcc"].CC + cxx = self.deps_env_info["gcc"].CXX + hello_c = os.path.join(self.source_folder, "hello.c") + hello_cpp = os.path.join(self.source_folder, "hello.cpp") + self.run("%s --version" % cc, run_environment=True) + self.run("%s --version" % cxx, run_environment=True) + self.run("%s -dumpversion" % cc, run_environment=True) + self.run("%s -dumpversion" % cxx, run_environment=True) + self.run("%s %s -o hello_c" % (cc, hello_c), run_environment=True) + self.run("%s %s -o hello_cpp" % (cxx, hello_cpp), run_environment=True) + if not tools.cross_building(self.settings): + chmod_plus_x("hello_c") + chmod_plus_x("hello_cpp") + self.run("./hello_c", run_environment=True) + self.run("./hello_cpp", run_environment=True) + if tools.which("readelf"): + self.run("readelf -l hello_c", run_environment=True) + self.run("readelf -l hello_cpp", run_environment=True) + if tools.which("otool"): + self.run("otool -L hello_c", run_environment=True) + self.run("otool -L hello_cpp", run_environment=True) diff --git a/recipes/gcc/all/test_v1_package/hello.c b/recipes/gcc/all/test_v1_package/hello.c new file mode 100644 index 0000000000000..52029834a425b --- /dev/null +++ b/recipes/gcc/all/test_v1_package/hello.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + puts("Hello, World!\n"); + return 0; +} + diff --git a/recipes/gcc/all/test_v1_package/hello.cpp b/recipes/gcc/all/test_v1_package/hello.cpp new file mode 100644 index 0000000000000..e59b7b15826e3 --- /dev/null +++ b/recipes/gcc/all/test_v1_package/hello.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + std::cout << "Hello, World!\n"; + return 0; +} + diff --git a/recipes/gcc/config.yml b/recipes/gcc/config.yml new file mode 100644 index 0000000000000..20d860f029e5e --- /dev/null +++ b/recipes/gcc/config.yml @@ -0,0 +1,7 @@ +versions: + "12.2.0": + folder: all + "11.3.0": + folder: all + "10.2.0": + folder: all diff --git a/recipes/gcem/all/conandata.yml b/recipes/gcem/all/conandata.yml new file mode 100644 index 0000000000000..58f1cc5b754a9 --- /dev/null +++ b/recipes/gcem/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.16.0": + url: "https://github.com/kthohr/gcem/archive/v1.16.0.tar.gz" + sha256: "119c742b9371c0adc7d9cd710c3cbc575459a98fb63f6be4c636215dcf8404ce" + "1.14.1": + url: "https://github.com/kthohr/gcem/archive/v1.14.1.tar.gz" + sha256: "fd0860e89f47eeddf5a2280dd6fb3f9b021ce36fe8798116b3f703fa0e01409d" + "1.13.1": + url: "https://github.com/kthohr/gcem/archive/v1.13.1.tar.gz" + sha256: "69a1973f146a4a5e584193af062359f50bd5b948c4175d58ea2622e1c066b99b" + "1.12.0": + url: "https://github.com/kthohr/gcem/archive/v1.12.0.tar.gz" + sha256: "debbd6bf125126fb92499026b37aab70ed08df819baf9cf3948a2623fd5fa165" diff --git a/recipes/gcem/all/conanfile.py b/recipes/gcem/all/conanfile.py new file mode 100644 index 0000000000000..90bc15dd9edc5 --- /dev/null +++ b/recipes/gcem/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class GcemConan(ConanFile): + name = "gcem" + description = "A C++ compile-time math library using generalized " \ + "constant expressions." + license = "Apache-2.0" + topics = ("gcem", "math", "header-only") + homepage = "https://github.com/kthohr/gcem" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + settings = "os", "arch", "compiler", "build_type", + + 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], + destination=self.source_folder, 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, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"gcem": "gcem::gcem"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gcem") + self.cpp_info.set_property("cmake_target_name", "gcem") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + 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/gcem/all/test_package/CMakeLists.txt b/recipes/gcem/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..434ba12e4a1c5 --- /dev/null +++ b/recipes/gcem/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(gcem REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE gcem) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gcem/all/test_package/conanfile.py b/recipes/gcem/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gcem/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/gcem/all/test_package/test_package.cpp b/recipes/gcem/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..63e5716420740 --- /dev/null +++ b/recipes/gcem/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include + +#include + +int main() +{ + constexpr int x = 3; + constexpr double y = 5; + + constexpr int r1 = gcem::factorial(x); + constexpr double r2 = gcem::lgamma(y); + constexpr double r3 = gcem::pow(y, 0.5); + constexpr double r4 = gcem::sqrt(y); + + std::cout << "factorial(3) == " << r1 << '\n' + << "lgamma(5) == " << r2 << '\n' + << "pow(5, 0.5) == " << r3 << '\n' + << "sqrt(5) == " << r4 << '\n'; + + return EXIT_SUCCESS; +} diff --git a/recipes/gcem/all/test_v1_package/CMakeLists.txt b/recipes/gcem/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gcem/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gcem/all/test_v1_package/conanfile.py b/recipes/gcem/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..071ca3ed857af --- /dev/null +++ b/recipes/gcem/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/gcem/config.yml b/recipes/gcem/config.yml new file mode 100644 index 0000000000000..cc18649bfe195 --- /dev/null +++ b/recipes/gcem/config.yml @@ -0,0 +1,9 @@ +versions: + "1.16.0": + folder: all + "1.14.1": + folder: all + "1.13.1": + folder: all + "1.12.0": + folder: all diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml new file mode 100644 index 0000000000000..3a324b7465d34 --- /dev/null +++ b/recipes/gdal/config.yml @@ -0,0 +1,15 @@ +versions: + "3.5.2": + folder: "post_3.5.0" + "3.5.1": + folder: "post_3.5.0" + "3.4.3": + folder: "pre_3.5.0" + "3.4.1": + folder: "pre_3.5.0" + "3.3.3": + folder: "pre_3.5.0" + "3.2.3": + folder: "pre_3.5.0" + "3.1.4": + folder: "pre_3.5.0" diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt new file mode 100644 index 0000000000000..c0e666f41f1de --- /dev/null +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -0,0 +1,117 @@ +cmake_minimum_required(VERSION 3.15) +project(gdal_cmake_wrapper) + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +include(CMakePushCheckState) + + +if (${GDAL_USE_POPPLER}) + find_package(poppler) + set(Poppler_VERSION_STRING ${poppler_VERSION}) + add_library(Poppler::Poppler ALIAS poppler::libpoppler) +endif() + +file(GLOB CONAN_GENERATED_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Find*.cmake") +foreach(CMAKE_FILE ${CONAN_GENERATED_CMAKE_FILES}) + include(${CMAKE_FILE}) +endforeach() + +if (${GDAL_USE_ARROW}) + find_package(Arrow REQUIRED) + add_library(arrow_shared ALIAS arrow::arrow) +endif() + +if (${GDAL_USE_CRYPTOPP}) + find_package(cryptopp REQUIRED) + add_library(CRYPTOPP::CRYPTOPP ALIAS cryptopp::cryptopp-static) +endif() + +if (${GDAL_USE_DEFLATE}) + find_package(libdeflate REQUIRED) + add_library(Deflate::Deflate ALIAS libdeflate::libdeflate) +endif() + +if (${GDAL_USE_LZ4}) + find_package(lz4 REQUIRED) + add_library(LZ4::LZ4 ALIAS lz4::lz4) +endif() + +if (${GDAL_USE_BLOSC}) + find_package(c-blosc REQUIRED) + add_library(Blosc::Blosc ALIAS c-blosc::c-blosc) +endif() + +if (${GDAL_USE_OPENEXR}) + find_package(Imath REQUIRED) + find_package(OpenEXR REQUIRED) + add_library(OpenEXR::IlmImf ALIAS OpenEXR::IlmThread) + add_library(OpenEXR::IlmImfUtil ALIAS OpenEXR::OpenEXR) + add_library(OpenEXR::Half ALIAS Imath::Imath) + # gdal includes without "Imath/" folder prefix + target_include_directories(Imath::Imath INTERFACE ${Imath_INCLUDE_DIR}) + # and also without "OpenEXR/" prefix + target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) +endif() + +if (${GDAL_USE_FREEXL}) + find_package(freexl REQUIRED) + add_library(FREEXL::freexl ALIAS freexl::freexl) +endif() + +if (${GDAL_USE_OPENJPEG}) + add_library(OPENJPEG::OpenJPEG ALIAS OpenJPEG::OpenJPEG) +endif() + +if (${GDAL_USE_GIF}) + find_package(GIF REQUIRED) +endif() + +if (${GDAL_USE_CFITSIO}) + find_package(cfitsio) + add_library(CFITSIO::CFITSIO ALIAS cfitsio::cfitsio) +endif() + +if (${GDAL_USE_SQLITE3}) + find_package(SQLite3) +endif() + +if (${GDAL_USE_LIBXML2}) + find_package(LibXml2) +endif() + +if (${GDAL_USE_POSTGRESQL}) + find_package(PostgreSQL) + add_library(PostgreSQL::PostgreSQL ALIAS PostgreSQL::pq) +endif() + +if (${GDAL_USE_HDF5}) + find_package(HDF5) + set(HDF5_C_LIBRARIES HDF5::C) +endif() + +if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "libmysqlclient") + find_package(mysql REQUIRED) +endif() +if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "mariadb-connector-c") + find_package(mariadb-connector-c REQUIRED) +endif() + +if (${GDAL_USE_ZLIB}) + find_package(ZLIB) +endif() + +if ("${GDAL_CONAN_PACKAGE_FOR_JPEG}" STREQUAL "libjpeg-turbo") + find_package(libjpeg-turbo REQUIRED) + add_library(JPEG::JPEG ALIAS ${TARGET_FOR_JPEG}) +endif() + +if (${GDAL_USE_PCRE2}) + find_package(PCRE2 REQUIRED) + add_library(PCRE2::PCRE2-8 ALIAS PCRE2::8BIT) +endif() + + +add_subdirectory("source_subfolder") diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml new file mode 100644 index 0000000000000..2dbc2d17b374f --- /dev/null +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -0,0 +1,14 @@ +sources: + "3.5.2": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" + sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" + "3.5.1": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.1/gdal-3.5.1.tar.gz" + sha256: "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1" +patches: + "3.5.2": + - patch_file: "patches/3.5.2/0-replace-find-package.patch" + base_path: "source_subfolder" + "3.5.1": + - patch_file: "patches/3.5.1/0-replace-find-package.patch" + base_path: "source_subfolder" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py new file mode 100644 index 0000000000000..d03de4e5125cc --- /dev/null +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -0,0 +1,899 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, get, files +from conan.errors import ConanInvalidConfiguration +from conans import CMake +import functools +import os + +class GdalConan(ConanFile): + name = "gdal" + description = "GDAL is an open source X/MIT licensed translator library " \ + "for raster and vector geospatial data formats." + license = "MIT" + topics = ("osgeo", "geospatial", "raster", "vector") + homepage = "https://github.com/OSGeo/gdal" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + + # A list of gdal dependencies can be taken from cmake/helpers/CheckDependentLibraries.cmake + # within gdal sources with the command: + # grep -E '^[ \t]*gdal_check_package\(' cmake/helpers/CheckDependentLibraries.cmake \ + # | sed 's/[ \t]*gdal_check_package(\([a-zA-Z_0-9]\+\) "\(.*\)"\(.*\)/{ 'dep': \'\1\', 'descr': \'\2\' },/' \ + # | sort | uniq + + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + "with_armadillo": [True, False], + "with_arrow": [True, False], + "with_blosc": [True, False], + "with_cfitsio": [True, False], + # with_cypto option has been renamed with_openssl in version 3.5.1 + "with_crypto": [True, False, "deprecated"], + "with_cryptopp": [True, False], + "with_curl": [True, False], + "with_dds": [True, False], + "with_expat": [True, False], + "with_exr": [True, False], + "with_freexl": [True, False], + "with_geos": [True, False], + "with_gif": [True, False], + "with_gta": [True, False], + "with_hdf4": [True, False], + "with_hdf5": [True, False], + "with_heif": [True, False], + "with_kea": [True, False], + "with_libdeflate": [True, False], + "with_libiconv": [True, False], + "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], + "with_libkml": [True, False], + "with_libtiff": [True, False], + "with_lz4": [True, False], + "with_mongocxx": [True, False], + "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], + "with_netcdf": [True, False], + "with_odbc": [True, False], + "with_openjpeg": [True, False], + "with_openssl": [True, False], + "with_pcre": [True, False], + "with_pcre2": [True, False], + "with_pg": [True, False], + "with_png": [True, False], + "with_podofo": [True, False], + "with_poppler": [True, False], + "with_proj": [True, False], + "with_qhull": [True, False], + "with_sqlite3": [True, False], + "with_webp": [True, False], + "with_xerces": [True, False], + "with_xml2": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "tools": False, + "with_armadillo": False, + "with_arrow": False, + "with_blosc": False, + "with_cfitsio": False, + "with_crypto": "deprecated", + "with_cryptopp": False, + "with_curl": False, + "with_dds": False, + "with_expat": False, + "with_exr": False, + "with_freexl": False, + "with_geos": True, + "with_gif": True, + "with_gta": False, + "with_hdf4": False, + "with_hdf5": False, + "with_heif": False, + "with_kea": False, + "with_libdeflate": True, + "with_libiconv": True, + "with_jpeg": "libjpeg", + "with_libkml": False, + "with_libtiff": True, + "with_lz4": False, + "with_mongocxx": False, + "with_mysql": None, + "with_netcdf": False, + "with_odbc": False, + "with_openjpeg": False, + "with_openssl": False, + "with_pcre": False, + "with_pcre2": False, + "with_pg": False, + "with_png": True, + "with_podofo": False, + "with_poppler": False, + "with_proj": True, + "with_qhull": True, + "with_sqlite3": True, + "with_webp": False, + "with_xerces": False, + "with_xml2": False, + "with_zlib": True, + "with_zstd": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build" + + 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.with_crypto != "deprecated": + self.output.error("with_crypto option is deprecated, use with_openssl instead.") + + if self.options.shared: + try: + del self.options.fPIC + except: + pass + + def requirements(self): + self.requires("json-c/0.16") + self.requires("libgeotiff/1.7.1") + + if self.options.with_armadillo: + self.requires("armadillo/10.7.3") + + if self.options.with_arrow: + self.requires("arrow/8.0.1") + + if self.options.with_blosc: + self.requires("c-blosc/1.21.1") + + if self.options.with_cfitsio: + self.requires("cfitsio/4.1.0") + + if self.options.with_cryptopp: + self.requires("cryptopp/8.7.0") + + if self.options.with_curl: + self.requires("libcurl/7.85.0") + + if self.options.with_dds: + self.requires("crunch/cci.20190615") + + if self.options.with_expat: + self.requires("expat/2.4.9") + + if self.options.with_exr: + self.requires("openexr/3.1.5") + self.requires("imath/3.1.5") + + if self.options.with_freexl: + self.requires("freexl/1.0.6") + + if self.options.with_geos: + self.requires("geos/3.11.0") + + if self.options.with_gif: + self.requires("giflib/5.2.1") + + if self.options.with_gta: + self.requires("libgta/1.2.1") + + if self.options.with_hdf4: + self.requires("hdf4/4.2.15") + + if self.options.with_hdf5: + self.requires("hdf5/1.13.1") + + if self.options.with_heif: + self.requires("libheif/1.13.0") + + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + + if self.options.with_kea: + self.requires("kealib/1.4.14") + + if self.options.with_libdeflate: + self.requires("libdeflate/1.12") + + if self.options.with_libiconv: + self.requires("libiconv/1.17") + + if self.options.with_libkml: + self.requires("libkml/1.3.0") + + if self.options.with_libtiff: + self.requires("libtiff/4.4.0") + + if self.options.with_lz4: + self.requires("lz4/1.9.4") + + if self.options.with_mongocxx: + self.requires("mongo-cxx-driver/3.6.7") + + if self.options.with_mysql == "libmysqlclient": + self.requires("libmysqlclient/8.0.30") + elif self.options.with_mysql == "mariadb-connector-c": + self.requires("mariadb-connector-c/3.1.12") + + if self.options.with_netcdf: + self.requires("netcdf/4.8.1") + + if self.options.with_odbc: + self.requires("odbc/2.3.11") + + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + + if self.options.with_openssl: + self.requires("openssl/1.1.1q") + + if self.options.with_pcre: + self.requires("pcre/8.45") + + if self.options.with_pcre2: + self.requires("pcre2/10.40") + + if self.options.with_pg: + self.requires("libpq/14.5") + + if self.options.with_png: + self.requires("libpng/1.6.38") + + if self.options.with_podofo: + self.requires("podofo/0.9.7") + + if self.options.with_poppler: + self.requires("poppler/21.07.0") + + if self.options.with_proj: + self.requires("proj/9.0.1") + + if self.options.with_qhull: + self.requires("qhull/8.0.1") + + if self.options.with_sqlite3: + self.requires("sqlite3/3.39.3") + + if self.options.with_webp: + self.requires("libwebp/1.2.4") + + if self.options.with_xerces: + self.requires("xerces-c/3.2.3") + + if self.options.with_xml2: + self.requires("libxml2/2.9.14") + + if self.options.with_zlib: + self.requires("zlib/1.2.12") + + if self.options.with_zstd: + self.requires("zstd/1.5.2") + + def package_id(self): + del self.info.options.with_crypto + + def validate(self): + if self.options.get_safe("with_pcre") and self.options.get_safe("with_pcre2"): + raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") + + if self.options.get_safe("with_sqlite3") and not self.options["sqlite3"].enable_column_metadata: + raise ConanInvalidConfiguration("gdql requires sqlite3:enable_column_metadata=True") + + if self.options.get_safe("with_libtiff") and self.options["libtiff"].jpeg != self.options.get_safe("with_jpeg"): + msg = "libtiff:jpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." + # For some reason, the ConanInvalidConfiguration message is not shown, only + # ERROR: At least two recipes provides the same functionality: + # - 'libjpeg' provided by 'libjpeg-turbo/2.1.2', 'libjpeg/9d' + # So we print the error message manually. + self.output.error(msg) + raise ConanInvalidConfiguration(msg) + + if self.options.get_safe("with_poppler") and self.options["poppler"].with_libjpeg != self.options.get_safe("with_jpeg"): + msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." + self.output.error(msg) + raise ConanInvalidConfiguration(msg) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + + if self.options.get_safe("fPIC", True): + cmake.definitions[ + "GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True + + cmake.definitions["BUILD_JAVA_BINDINGS"] = False + cmake.definitions["BUILD_CSHARP_BINDINGS"] = False + cmake.definitions["BUILD_PYTHON_BINDINGS"] = False + + cmake.definitions["BUILD_TESTING"] = False + cmake.definitions["GDAL_USE_ZLIB_INTERNAL"] = False + cmake.definitions["GDAL_USE_JSONC_INTERNAL"] = False + cmake.definitions["GDAL_USE_JPEG_INTERNAL"] = False + cmake.definitions["GDAL_USE_JPEG12_INTERNAL"] = False + cmake.definitions["GDAL_USE_TIFF_INTERNAL"] = False + cmake.definitions["GDAL_USE_GEOTIFF_INTERNAL"] = False + cmake.definitions["GDAL_USE_GIF_INTERNAL"] = False + cmake.definitions["GDAL_USE_PNG_INTERNAL"] = False + + cmake.definitions["GDAL_USE_LERC_INTERNAL"] = True + cmake.definitions["GDAL_USE_SHAPELIB_INTERNAL"] = True + + cmake.definitions["BUILD_APPS"] = self.options.tools + + cmake.definitions["SQLite3_HAS_COLUMN_METADATA"] = \ + self.options["sqlite3"].enable_column_metadata + + cmake.definitions["SQLite3_HAS_RTREE"] = self.options[ + "sqlite3"].enable_rtree + + cmake.definitions["GDAL_USE_JSONC"] = True + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" + + cmake.definitions["GDAL_USE_GEOTIFF"] = True + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" + cmake.definitions["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" + + cmake.definitions["GDAL_USE_ARMADILLO"] = self.options.with_armadillo + if self.options.with_armadillo: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARMADILLO"] = "armadillo" + cmake.definitions["TARGET_FOR_ARMADILLO"] = \ + self.dependencies["armadillo"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Armadillo_FOUND"] = False + + cmake.definitions["GDAL_USE_ARROW"] = self.options.with_arrow + if self.options.with_arrow: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARROW"] = "arrow" + cmake.definitions["TARGET_FOR_ARROW"] = \ + self.dependencies["arrow"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Arrow_FOUND"] = False + + cmake.definitions["GDAL_USE_BLOSC"] = self.options.with_blosc + if self.options.with_blosc: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_BLOSC"] = "c-blosc" + cmake.definitions["TARGET_FOR_BLOSC"] = \ + self.dependencies["c-blosc"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Blosc_FOUND"] = False + + cmake.definitions["GDAL_USE_CFITSIO"] = self.options.with_cfitsio + if self.options.with_cfitsio: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CFITSIO"] = "cfitsio" + cmake.definitions["TARGET_FOR_CFITSIO"] = \ + self.dependencies["cfitsio"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["CFITSIO_FOUND"] = False + + cmake.definitions["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp + if self.options.with_cryptopp: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRYPTOPP"] = "cryptopp" + cmake.definitions["TARGET_FOR_CRYPTOPP"] = \ + self.dependencies["cryptopp"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["CryptoPP_FOUND"] = False + + cmake.definitions["GDAL_USE_CURL"] = self.options.with_curl + if self.options.with_curl: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CURL"] = "libcurl" + cmake.definitions["TARGET_FOR_CURL"] = \ + self.dependencies["libcurl"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["CURL_FOUND"] = False + + cmake.definitions["GDAL_USE_CRNLIB"] = self.options.with_dds + if self.options.with_dds: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRNLIB"] = "crunch" + cmake.definitions["TARGET_FOR_CRNLIB"] = \ + self.dependencies["crunch"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Crnlib_FOUND"] = False + + cmake.definitions["GDAL_USE_EXPAT"] = self.options.with_expat + if self.options.with_expat: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_EXPAT"] = "expat" + cmake.definitions["TARGET_FOR_EXPAT"] = "EXPAT::EXPAT" + else: + cmake.definitions["EXPAT_FOUND"] = False + + cmake.definitions["GDAL_USE_OPENEXR"] = self.options.with_exr + if self.options.with_exr: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENEXR"] = "openexr" + cmake.definitions["TARGET_FOR_OPENEXR"] = \ + self.dependencies["openexr"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["OpenEXR_FOUND"] = False + + cmake.definitions["GDAL_USE_FREEXL"] = self.options.with_freexl + if self.options.with_freexl: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_FREEXL"] = "freexl" + cmake.definitions["TARGET_FOR_FREEXL"] = "freexl::freexl" + else: + cmake.definitions["FreeXL_FOUND"] = False + + cmake.definitions["GDAL_USE_GEOS"] = self.options.with_geos + if self.options.with_geos: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOS"] = "geos" + cmake.definitions["TARGET_FOR_GEOS"] = \ + self.dependencies["geos"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["GEOS_FOUND"] = False + + cmake.definitions["GDAL_USE_GIF"] = self.options.with_gif + if self.options.with_gif: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GIF"] = "giflib" + cmake.definitions["TARGET_FOR_GIF"] = \ + self.dependencies["giflib"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["GIF_FOUND"] = False + + cmake.definitions["GDAL_USE_GTA"] = self.options.with_gta + if self.options.with_gta: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GTA"] = "libgta" + cmake.definitions["TARGET_FOR_GTA"] = \ + self.dependencies["libgta"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["GTA_FOUND"] = False + + cmake.definitions["GDAL_USE_HDF4"] = self.options.with_hdf4 + if self.options.with_hdf4: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF4"] = "hdf4" + cmake.definitions["TARGET_FOR_HDF4"] = \ + self.dependencies["hdf4"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["HDF4_FOUND"] = False + + cmake.definitions["GDAL_USE_HDF5"] = self.options.with_hdf5 + if self.options.with_hdf5: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF5"] = "hdf5" + cmake.definitions["TARGET_FOR_HDF5"] = \ + self.dependencies["hdf5"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["HDF5_FOUND"] = False + + cmake.definitions["GDAL_USE_HEIF"] = self.options.with_heif + if self.options.with_heif: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HEIF"] = "libheif" + cmake.definitions["TARGET_FOR_HEIF"] = \ + self.dependencies["libheif"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["HEIF_FOUND"] = False + + cmake.definitions["GDAL_USE_KEA"] = self.options.with_kea + if self.options.with_kea: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_KEA"] = "kealib" + cmake.definitions["TARGET_FOR_KEA"] = \ + self.dependencies["kealib"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["KEA_FOUND"] = False + + cmake.definitions["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + if self.options.with_libdeflate: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_DEFLATE"] = "libdeflate" + cmake.definitions["TARGET_FOR_DEFLATE"] = \ + self.dependencies["libdeflate"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Deflate_FOUND"] = False + + cmake.definitions["GDAL_USE_ICONV"] = self.options.with_libiconv + if self.options.with_libiconv: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ICONV"] = "libiconv" + cmake.definitions["TARGET_FOR_ICONV"] = \ + self.dependencies["libiconv"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Iconv_FOUND"] = False + + if self.options.with_jpeg == "libjpeg" or self.options.with_jpeg == "libjpeg-turbo": + print(f'self.options.with_jpeg: {self.options.with_jpeg}') + cmake.definitions["GDAL_USE_JPEG"] = True + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg + cmake.definitions["TARGET_FOR_JPEG"] = ( + "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else + self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"] \ + .get_property("cmake_target_name")) + else: + cmake.definitions["JPEG_FOUND"] = False + + cmake.definitions["GDAL_USE_LIBKML"] = self.options.with_libkml + if self.options.with_libkml: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBKML"] = "libkml" + cmake.definitions["TARGET_FOR_LIBKML"] = \ + self.dependencies["libkml"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["LibKML_FOUND"] = False + + cmake.definitions["GDAL_USE_TIFF"] = self.options.with_libtiff + if self.options.with_libtiff: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_TIFF"] = "libtiff" + cmake.definitions["TARGET_FOR_TIFF"] = \ + self.dependencies["libtiff"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["TIFF_FOUND"] = False + + cmake.definitions["GDAL_USE_LZ4"] = self.options.with_lz4 + if self.options.with_lz4: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LZ4"] = "lz4" + cmake.definitions["TARGET_FOR_LZ4"] = \ + self.dependencies["lz4"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["LZ4_FOUND"] = False + + cmake.definitions["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + if self.options.with_mongocxx: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MONGOCXX"] = "mongo-cxx-driver" + cmake.definitions["TARGET_FOR_MONGOCXX"] = \ + self.dependencies["mongo-cxx-driver"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["MONGOCXX_FOUND"] = False + + if self.options.with_mysql == "libmysqlclient" or self.options.with_mysql == "mariadb-connector-c": + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) + cmake.definitions["TARGET_FOR_MYSQL"] = \ + "mariadb-connector-c::mariadb-connector-c" \ + if self.options.with_mysql == "mariadb-connector-c" \ + else "libmysqlclient::libmysqlclient" + else: + cmake.definitions["MYSQL_FOUND"] = False + + cmake.definitions["GDAL_USE_NETCDF"] = self.options.with_netcdf + if self.options.with_netcdf: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_NETCDF"] = "netcdf" + cmake.definitions["TARGET_FOR_NETCDF"] = \ + self.dependencies["netcdf"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["NetCDF_FOUND"] = False + + cmake.definitions["GDAL_USE_ODBC"] = self.options.with_odbc + if self.options.with_odbc: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ODBC"] = "odbc" + cmake.definitions["TARGET_FOR_ODBC"] = \ + self.dependencies["odbc"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["ODBC_FOUND"] = False + + cmake.definitions["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg + if self.options.with_openjpeg: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENJPEG"] = "openjpeg" + cmake.definitions["TARGET_FOR_OPENJPEG"] = \ + self.dependencies["openjpeg"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["OPENJPEG_FOUND"] = False + + cmake.definitions["GDAL_USE_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENSSL"] = "openssl" + cmake.definitions["TARGET_FOR_OPENSSL"] = \ + self.dependencies["openssl"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["OpenSSL_FOUND"] = False + + cmake.definitions["GDAL_USE_PCRE"] = self.options.with_pcre + if self.options.with_pcre: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE"] = "pcre" + cmake.definitions["TARGET_FOR_PCRE"] = \ + self.dependencies["pcre"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PCRE_FOUND"] = False + + cmake.definitions["GDAL_USE_PCRE2"] = self.options.with_pcre2 + if self.options.with_pcre2: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE2"] = "pcre2" + cmake.definitions["TARGET_FOR_PCRE2"] = \ + self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PCRE2_FOUND"] = False + + cmake.definitions["GDAL_USE_PDFIUM"] = False + cmake.definitions["PDFIUM_FOUND"] = False + + cmake.definitions["GDAL_USE_POSTGRESQL"] = self.options.with_pg + if self.options.with_pg: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POSTGRESQL"] = "libpq" + cmake.definitions["TARGET_FOR_POSTGRESQL"] = \ + self.dependencies["libpq"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PostgreSQL_FOUND"] = False + + cmake.definitions["GDAL_USE_PNG"] = self.options.with_png + if self.options.with_png: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PNG"] = "libpng" + cmake.definitions["TARGET_FOR_PNG"] = \ + self.dependencies["libpng"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PNG_FOUND"] = False + + cmake.definitions["GDAL_USE_PODOFO"] = self.options.with_podofo + if self.options.with_podofo: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PODOFO"] = "podofo" + cmake.definitions["TARGET_FOR_PODOFO"] = \ + self.dependencies["podofo"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Podofo_FOUND"] = False + + cmake.definitions["GDAL_USE_POPPLER"] = self.options.with_poppler + if self.options.with_poppler: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POPPLER"] = "poppler" + cmake.definitions["TARGET_FOR_POPPLER"] = \ + self.dependencies["poppler"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Poppler_FOUND"] = False + + cmake.definitions["GDAL_USE_PROJ"] = self.options.with_proj + if self.options.with_proj: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PROJ"] = "proj" + cmake.definitions["TARGET_FOR_PROJ"] = \ + self.dependencies["proj"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PROJ_FOUND"] = False + + cmake.definitions["GDAL_USE_QHULL"] = self.options.with_qhull + if self.options.with_qhull: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_QHULL"] = "qhull" + cmake.definitions["TARGET_FOR_QHULL"] = \ + self.dependencies["qhull"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["QHULL_FOUND"] = False + + cmake.definitions["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + if self.options.with_sqlite3: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_SQLITE3"] = "sqlite3" + cmake.definitions["TARGET_FOR_SQLITE3"] = \ + self.dependencies["sqlite3"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["SQLite3_FOUND"] = False + + cmake.definitions["GDAL_USE_WEBP"] = self.options.with_webp + if self.options.with_webp: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_WEBP"] = "libwebp" + cmake.definitions["TARGET_FOR_WEBP"] = \ + self.dependencies["libwebp"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["WebP_FOUND"] = False + + cmake.definitions["GDAL_USE_XERCESC"] = self.options.with_xerces + if self.options.with_xerces: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_XERCESC"] = "xerces-c" + cmake.definitions["TARGET_FOR_XERCESC"] = \ + self.dependencies["xerces-c"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["XercesC_FOUND"] = False + + cmake.definitions["GDAL_USE_LIBXML2"] = self.options.with_xml2 + if self.options.with_xml2: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBXML2"] = "libxml2" + cmake.definitions["TARGET_FOR_LIBXML2"] = \ + self.dependencies["libxml2"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["LibXml2_FOUND"] = False + + cmake.definitions["GDAL_USE_ZLIB"] = self.options.with_zlib + if self.options.with_zlib: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZLIB"] = "zlib" + cmake.definitions["TARGET_FOR_ZLIB"] = \ + self.dependencies["zlib"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["ZLIB_FOUND"] = False + + cmake.definitions["GDAL_USE_ZSTD"] = self.options.with_zstd + if self.options.with_zstd: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZSTD"] = "zstd" + cmake.definitions["TARGET_FOR_ZSTD"] = \ + self.dependencies["zstd"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["ZSTD_FOUND"] = False + + + for k, v in cmake.definitions.items(): + print(k, " = ", v) + + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + apply_conandata_patches(self) + cmake = self._configure_cmake() + + cmake.build() + + def package(self): + self.copy("LICENSE.TXT", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + files.rmdir(self, os.path.join(self.package_folder, "share")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + + self.cpp_info.set_property("cmake_file_name", "GDAL") + self.cpp_info.set_property("cmake_target_name", "GDAL::GDAL") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("pkg_config_name", "gdal") + + self.cpp_info.names["cmake_find_package"] = "GDAL" + self.cpp_info.names["cmake_find_package_multi"] = "GDAL" + self.cpp_info.filenames["cmake_find_package"] = "GDAL" + self.cpp_info.filenames["cmake_find_package_multi"] = "GDAL" + + libname = "gdal" + if self.settings.os == "Windows": + if self.settings.build_type == "Debug": + libname += "d" + self.cpp_info.libs = [ libname ] + + self.cpp_info.requires.extend(['json-c::json-c']) + self.cpp_info.requires.extend(['libgeotiff::libgeotiff']) + + if self.options.with_armadillo: + self.cpp_info.requires.extend(['armadillo::armadillo']) + + if self.options.with_arrow: + self.cpp_info.requires.extend(['arrow::libarrow']) + + if self.options.with_blosc: + self.cpp_info.requires.extend(['c-blosc::c-blosc']) + + if self.options.with_cfitsio: + self.cpp_info.requires.extend(['cfitsio::cfitsio']) + + if self.options.with_cryptopp: + self.cpp_info.requires.extend(['cryptopp::libcryptopp']) + + if self.options.with_curl: + self.cpp_info.requires.extend(['libcurl::curl']) + + if self.options.with_dds: + self.cpp_info.requires.extend(['crunch::crunch']) + + if self.options.with_expat: + self.cpp_info.requires.extend(['expat::expat']) + + if self.options.with_exr: + self.cpp_info.requires.extend(['openexr::openexr', 'imath::imath']) + + if self.options.with_freexl: + self.cpp_info.requires.extend(['freexl::freexl']) + + if self.options.with_geos: + self.cpp_info.requires.extend(['geos::geos_c']) + + if self.options.with_gif: + self.cpp_info.requires.extend(['giflib::giflib']) + + if self.options.with_gta: + self.cpp_info.requires.extend(['libgta::libgta']) + + if self.options.with_hdf4: + self.cpp_info.requires.extend(['hdf4::hdf4']) + + if self.options.with_hdf5: + self.cpp_info.requires.extend(['hdf5::hdf5_c']) + + if self.options.with_heif: + self.cpp_info.requires.extend(['libheif::libheif']) + + if self.options.with_kea: + self.cpp_info.requires.extend(['kealib::kealib']) + + if self.options.with_libdeflate: + self.cpp_info.requires.extend(['libdeflate::libdeflate']) + + if self.options.with_libiconv: + self.cpp_info.requires.extend(['libiconv::libiconv']) + + if self.options.with_jpeg == "libjpeg": + self.cpp_info.requires.extend(['libjpeg::libjpeg']) + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.requires.extend(['libjpeg-turbo::turbojpeg']) + + if self.options.with_libkml: + self.cpp_info.requires.extend(['libkml::kmldom', 'libkml::kmlengine']) + + if self.options.with_libtiff: + self.cpp_info.requires.extend(['libtiff::libtiff']) + + if self.options.with_lz4: + self.cpp_info.requires.extend(['lz4::lz4']) + + if self.options.with_mongocxx: + self.cpp_info.requires.extend(['mongo-cxx-driver::mongo-cxx-driver']) + + if self.options.with_mysql == "libmysqlclient": + self.cpp_info.requires.extend(['libmysqlclient::libmysqlclient']) + elif self.options.with_mysql == "mariadb-connector-c": + self.cpp_info.requires.extend(['mariadb-connector-c::mariadb-connector-c']) + + if self.options.with_netcdf: + self.cpp_info.requires.extend(['netcdf::netcdf']) + + if self.options.with_odbc: + self.cpp_info.requires.extend(['odbc::odbc']) + + if self.options.with_openjpeg: + self.cpp_info.requires.extend(['openjpeg::openjpeg']) + + if self.options.with_openssl: + self.cpp_info.requires.extend(['openssl::ssl']) + + if self.options.with_pcre: + self.cpp_info.requires.extend(['pcre::pcre']) + + if self.options.with_pcre2: + self.cpp_info.requires.extend(['pcre2::pcre2-8']) + + if self.options.with_pg: + self.cpp_info.requires.extend(['libpq::pq']) + + if self.options.with_png: + self.cpp_info.requires.extend(['libpng::libpng']) + + if self.options.with_podofo: + self.cpp_info.requires.extend(['podofo::podofo']) + + if self.options.with_poppler: + self.cpp_info.requires.extend(['poppler::libpoppler']) + + if self.options.with_proj: + self.cpp_info.requires.extend(['proj::projlib']) + + if self.options.with_qhull: + self.cpp_info.requires.extend(['qhull::libqhull']) + + if self.options.with_sqlite3: + self.cpp_info.requires.extend(['sqlite3::sqlite']) + + if self.options.with_webp: + self.cpp_info.requires.extend(['libwebp::libwebp']) + + if self.options.with_xerces: + self.cpp_info.requires.extend(['xerces-c::xerces-c']) + + if self.options.with_xml2: + self.cpp_info.requires.extend(['libxml2::libxml2']) + + if self.options.with_zlib: + self.cpp_info.requires.extend(['zlib::zlib']) + + if self.options.with_zstd: + self.cpp_info.requires.extend(['zstd::zstdlib']) + + gdal_data_path = os.path.join(self.package_folder, "res", "gdal") + self.output.info( + "Prepending to GDAL_DATA environment variable: {}".format( + gdal_data_path)) + self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.GDAL_DATA = gdal_data_path + + if self.options.tools: + self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) + 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/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch new file mode 100644 index 0000000000000..e790a586d8abd --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch @@ -0,0 +1,266 @@ +diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt +index edf75158c7..4200309ca8 100644 +--- a/alg/CMakeLists.txt ++++ b/alg/CMakeLists.txt +@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) + target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) + endif () + +-gdal_target_link_libraries(alg PRIVATE PROJ::proj) ++target_link_libraries(alg PUBLIC PROJ::proj) + + if (GDAL_USE_QHULL_INTERNAL) + target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index a49165d14a..91d6170067 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -25,7 +25,7 @@ target_include_directories( + appslib PRIVATE $ $ + $ $) + +-gdal_target_link_libraries(appslib PRIVATE PROJ::proj) ++target_link_libraries(appslib PUBLIC PROJ::proj) + + set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) +diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake +index 7fa3b565c7..77a610f223 100644 +--- a/cmake/helpers/CheckDependentLibraries.cmake ++++ b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++ ++# Conan recipes should rely on config files from generators so let's just disble GDAL's ++include(ConanFindPackage) ++ + include(CheckSymbolExists) + + option( +@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) + set(_find_dependency_args "") + find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) + if (NOT DEFINED ${key}_FOUND) +- set(_find_package_args) +- if (_GCP_VERSION) +- list(APPEND _find_package_args ${_GCP_VERSION}) +- endif () +- if (_GCP_CONFIG) +- list(APPEND _find_package_args CONFIG) +- endif () +- if (_GCP_COMPONENTS) +- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) +- endif () +- if (_GCP_PATHS) +- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) +- endif () +- if (_GCP_NAMES) +- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) +- endif () +- if (_GCP_TARGETS) +- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) +- endif () +- if (GDAL_CHECK_PACKAGE_${name}_NAMES) +- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) +- if (${name}_FOUND) +- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) +- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") +- endif () +- endif () +- if (NOT ${name}_FOUND) +- find_package(${name} ${_find_package_args}) +- if (${name}_FOUND) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- elseif (${key}_FOUND) # Some find modules do not set _FOUND +- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- set(${name}_FOUND "${key}_FOUND") +- endif () +- if (${name}_FOUND) +- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") +- endif() +- endif () ++ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") + endif () + if (${key}_FOUND OR ${name}_FOUND) + set(HAVE_${key} ON) +@@ -321,14 +284,15 @@ if (GDAL_USE_CRYPTOPP) + endif () + + # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. +-find_package(PROJ 9 CONFIG QUIET) +-if (NOT PROJ_FOUND) +- find_package(PROJ 8 CONFIG QUIET) +-endif() ++find_package2(PROJ) ++target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) ++#if (NOT PROJ_FOUND) ++# find_package(proj 8 CONFIG QUIET) ++#endif() + if (PROJ_FOUND) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") + else() +- find_package(PROJ 6.0 REQUIRED) ++ find_package(proj 6.0 REQUIRED) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") + endif () + +@@ -379,15 +343,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE + TARGETS json-c::json-c JSONC::JSONC + ) + gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) +- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) +- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) +- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +- list(REMOVE_DUPLICATES include_dirs) +- set_target_properties(json-c::json-c PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" +- ) +-endif() ++get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) ++list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") ++set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") ++message("Setting include for json-c: ${include_dirs}") + + gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) + gdal_internal_library(OPENCAD) +@@ -482,7 +441,7 @@ if (GDAL_USE_RASTERLITE2) + endif () + cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +diff --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake +new file mode 100644 +index 0000000000..9dfa8193a3 +--- /dev/null ++++ b/cmake/helpers/ConanFindPackage.cmake +@@ -0,0 +1,43 @@ ++ ++function(define_find_package2 pkgname include_file library_name) ++endfunction() ++ ++function(find_package2 pkgname) ++ set(_options QUIET REQUIRED) ++ set(_oneValueArgs OUT_DEPENDENCY) ++ set(_multiValueArgs) ++ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) ++ if(arg_QUIET) ++ set(${pkgname}_FIND_QUIETLY TRUE) ++ endif() ++ if(arg_REQUIRED) ++ set(${pkgname}_FIND_REQUIRED TRUE) ++ endif() ++ ++ string(TOUPPER ${pkgname} key) ++ ++ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") ++ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) ++ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") ++ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) ++ string(TOUPPER ${conan_package} conan_package_upper) ++ ++ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) ++ if (NOT TARGET_FOR_${key}) ++ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") ++ endif() ++ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) ++ ++ else () ++ message("dependency ${pkgname} has no conan package") ++ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) ++ endif() ++ ++endfunction() +diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt +index e5b7138e91..039cac7361 100644 +--- a/frmts/hfa/CMakeLists.txt ++++ b/frmts/hfa/CMakeLists.txt +@@ -15,7 +15,8 @@ add_gdal_driver( + hfa_overviews.cpp + BUILTIN) + gdal_standard_includes(gdal_HFA) +-target_include_directories(gdal_HFA PRIVATE $) ++target_link_libraries(gdal_HFA INTERFACE PROJ::proj) ++target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) + target_compile_definitions(gdal_HFA PRIVATE $) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) +diff --git a/gdal.cmake b/gdal.cmake +index ff1ca7e6f6..e98875f1b9 100644 +--- a/gdal.cmake ++++ b/gdal.cmake +@@ -795,25 +795,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) + ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) + +- # Generate gdal-config utility command and pkg-config module gdal.pc +- include(GdalGenerateConfig) +- gdal_generate_config( +- TARGET +- "${GDAL_LIB_TARGET_NAME}" +- GLOBAL_PROPERTY +- "gdal_private_link_libraries" +- GDAL_CONFIG +- "${PROJECT_BINARY_DIR}/apps/gdal-config" +- PKG_CONFIG +- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") +- install( +- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config +- DESTINATION ${CMAKE_INSTALL_BINDIR} +- COMPONENT applications) +- install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- COMPONENT libraries) + endif () + + configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) +diff --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt +index 19ba4e12fe..87cd123c54 100644 +--- a/ogr/CMakeLists.txt ++++ b/ogr/CMakeLists.txt +@@ -88,12 +88,12 @@ endif () + + target_compile_definitions(ogr PRIVATE HAVE_MITAB) + +-gdal_target_link_libraries(ogr PRIVATE PROJ::proj) ++target_link_libraries(ogr PUBLIC PROJ::proj) + + # External libs then + if (GDAL_USE_GEOS) + target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) +- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) ++ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) + endif () + + if (GDAL_USE_SFCGAL) +diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h +index 88928ad1ad..7cdd587db7 100644 +--- a/ogr/ogr_proj_p.h ++++ b/ogr/ogr_proj_p.h +@@ -29,7 +29,7 @@ + #ifndef OGR_PROJ_P_H_INCLUDED + #define OGR_PROJ_P_H_INCLUDED + +-#include "proj.h" ++#include + + #include "cpl_mem_cache.h" + diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch new file mode 100644 index 0000000000000..b01b5b271034c --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -0,0 +1,266 @@ +diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt +index edf75158c7..4200309ca8 100644 +--- a/alg/CMakeLists.txt ++++ b/alg/CMakeLists.txt +@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) + target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) + endif () + +-gdal_target_link_libraries(alg PRIVATE PROJ::proj) ++target_link_libraries(alg PUBLIC PROJ::proj) + + if (GDAL_USE_QHULL_INTERNAL) + target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index 8b02cea456..ad4adbfc9e 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -25,7 +25,7 @@ target_include_directories( + appslib PRIVATE $ $ + $ $) + +-gdal_target_link_libraries(appslib PRIVATE PROJ::proj) ++target_link_libraries(appslib PUBLIC PROJ::proj) + + set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) +diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake +index 0a66b44fec..152ff42ff7 100644 +--- a/cmake/helpers/CheckDependentLibraries.cmake ++++ b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++ ++# Conan recipes should rely on config files from generators so let's just disble GDAL's ++include(ConanFindPackage) ++ + include(CheckSymbolExists) + + option( +@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) + set(_find_dependency_args "") + find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) + if (NOT DEFINED ${key}_FOUND) +- set(_find_package_args) +- if (_GCP_VERSION) +- list(APPEND _find_package_args ${_GCP_VERSION}) +- endif () +- if (_GCP_CONFIG) +- list(APPEND _find_package_args CONFIG) +- endif () +- if (_GCP_COMPONENTS) +- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) +- endif () +- if (_GCP_PATHS) +- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) +- endif () +- if (_GCP_NAMES) +- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) +- endif () +- if (_GCP_TARGETS) +- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) +- endif () +- if (GDAL_CHECK_PACKAGE_${name}_NAMES) +- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) +- if (${name}_FOUND) +- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) +- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") +- endif () +- endif () +- if (NOT ${name}_FOUND) +- find_package(${name} ${_find_package_args}) +- if (${name}_FOUND) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- elseif (${key}_FOUND) # Some find modules do not set _FOUND +- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- set(${name}_FOUND "${key}_FOUND") +- endif () +- if (${name}_FOUND) +- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") +- endif() +- endif () ++ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") + endif () + if (${key}_FOUND OR ${name}_FOUND) + set(HAVE_${key} ON) +@@ -345,14 +308,15 @@ if (GDAL_USE_CRYPTOPP) + endif () + + # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. +-find_package(PROJ 9 CONFIG QUIET) +-if (NOT PROJ_FOUND) +- find_package(PROJ 8 CONFIG QUIET) +-endif() ++find_package2(PROJ) ++target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) ++#if (NOT PROJ_FOUND) ++# find_package(proj 8 CONFIG QUIET) ++#endif() + if (PROJ_FOUND) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") + else() +- find_package(PROJ 6.0 REQUIRED) ++ find_package(proj 6.0 REQUIRED) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") + endif () + +@@ -412,15 +376,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE + TARGETS json-c::json-c JSONC::JSONC + ) + gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) +- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) +- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) +- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +- list(REMOVE_DUPLICATES include_dirs) +- set_target_properties(json-c::json-c PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" +- ) +-endif() ++get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) ++list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") ++set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") ++message("Setting include for json-c: ${include_dirs}") + + gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) + gdal_internal_library(OPENCAD) +@@ -517,7 +476,7 @@ if (GDAL_USE_RASTERLITE2) + endif () + cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +diff --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake +new file mode 100644 +index 0000000000..9dfa8193a3 +--- /dev/null ++++ b/cmake/helpers/ConanFindPackage.cmake +@@ -0,0 +1,43 @@ ++ ++function(define_find_package2 pkgname include_file library_name) ++endfunction() ++ ++function(find_package2 pkgname) ++ set(_options QUIET REQUIRED) ++ set(_oneValueArgs OUT_DEPENDENCY) ++ set(_multiValueArgs) ++ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) ++ if(arg_QUIET) ++ set(${pkgname}_FIND_QUIETLY TRUE) ++ endif() ++ if(arg_REQUIRED) ++ set(${pkgname}_FIND_REQUIRED TRUE) ++ endif() ++ ++ string(TOUPPER ${pkgname} key) ++ ++ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") ++ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) ++ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") ++ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) ++ string(TOUPPER ${conan_package} conan_package_upper) ++ ++ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) ++ if (NOT TARGET_FOR_${key}) ++ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") ++ endif() ++ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) ++ ++ else () ++ message("dependency ${pkgname} has no conan package") ++ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) ++ endif() ++ ++endfunction() +diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt +index e5b7138e91..039cac7361 100644 +--- a/frmts/hfa/CMakeLists.txt ++++ b/frmts/hfa/CMakeLists.txt +@@ -15,7 +15,8 @@ add_gdal_driver( + hfa_overviews.cpp + BUILTIN) + gdal_standard_includes(gdal_HFA) +-target_include_directories(gdal_HFA PRIVATE $) ++target_link_libraries(gdal_HFA INTERFACE PROJ::proj) ++target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) + target_compile_definitions(gdal_HFA PRIVATE $) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) +diff --git a/gdal.cmake b/gdal.cmake +index 4bae2e2760..7695df40c8 100644 +--- a/gdal.cmake ++++ b/gdal.cmake +@@ -787,25 +787,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) + ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) + +- # Generate gdal-config utility command and pkg-config module gdal.pc +- include(GdalGenerateConfig) +- gdal_generate_config( +- TARGET +- "${GDAL_LIB_TARGET_NAME}" +- GLOBAL_PROPERTY +- "gdal_private_link_libraries" +- GDAL_CONFIG +- "${PROJECT_BINARY_DIR}/apps/gdal-config" +- PKG_CONFIG +- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") +- install( +- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config +- DESTINATION ${CMAKE_INSTALL_BINDIR} +- COMPONENT applications) +- install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- COMPONENT libraries) + endif () + + configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) +diff --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt +index 19ba4e12fe..87cd123c54 100644 +--- a/ogr/CMakeLists.txt ++++ b/ogr/CMakeLists.txt +@@ -88,12 +88,12 @@ endif () + + target_compile_definitions(ogr PRIVATE HAVE_MITAB) + +-gdal_target_link_libraries(ogr PRIVATE PROJ::proj) ++target_link_libraries(ogr PUBLIC PROJ::proj) + + # External libs then + if (GDAL_USE_GEOS) + target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) +- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) ++ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) + endif () + + if (GDAL_USE_SFCGAL) +diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h +index 88928ad1ad..7cdd587db7 100644 +--- a/ogr/ogr_proj_p.h ++++ b/ogr/ogr_proj_p.h +@@ -29,7 +29,7 @@ + #ifndef OGR_PROJ_P_H_INCLUDED + #define OGR_PROJ_P_H_INCLUDED + +-#include "proj.h" ++#include + + #include "cpl_mem_cache.h" + diff --git a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..861d8d69409b0 --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GDAL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} GDAL::GDAL) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c GDAL::GDAL) diff --git a/recipes/gdal/post_3.5.0/test_package/conanfile.py b/recipes/gdal/post_3.5.0/test_package/conanfile.py new file mode 100644 index 0000000000000..9dced2ad9cf71 --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + if self.options["gdal"].tools: + self.run("gdal_translate --formats", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.c b/recipes/gdal/post_3.5.0/test_package/test_package.c new file mode 100644 index 0000000000000..e4faf1b9e561d --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/test_package.c @@ -0,0 +1,58 @@ +#include + +#include +#include + +int main() { + GDALAllRegister(); + + const char *pszDriverName = "ESRI Shapefile"; + GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); + if (!hDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } + + GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!hDS) { + printf("Creation of output file failed.\n"); + exit(1); + } + + OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); + if (!hLayer) { + printf("Layer creation failed.\n"); + exit(1); + } + + OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); + + OGR_Fld_SetWidth(hFieldDefn, 32); + + if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } + + OGR_Fld_Destroy(hFieldDefn); + + OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); + OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); + + OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); + OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); + + OGR_F_SetGeometry(hFeature, hPt); + OGR_G_DestroyGeometry(hPt); + + if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit(1); + } + + OGR_F_Destroy(hFeature); + + GDALClose(hDS); + + return 0; +} diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.cpp b/recipes/gdal/post_3.5.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec77987bc5ece --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/test_package.cpp @@ -0,0 +1,54 @@ +#include + +#include +#include + +int main() { + GDALAllRegister(); + + const char *pszDriverName = "ESRI Shapefile"; + GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); + if (!poDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } + + GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!poDS) { + printf("Creation of output file failed.\n"); + exit(1); + } + + OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); + if (!poLayer) { + printf("Layer creation failed.\n"); + exit(1); + } + + OGRFieldDefn oField("Name", OFTString); + oField.SetWidth(32); + + if (poLayer->CreateField(&oField) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } + + OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); + poFeature->SetField("Name", "conan"); + + OGRPoint pt; + pt.setX(40.74); + pt.setY(-27.891); + poFeature->SetGeometry(&pt); + + if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit( 1 ); + } + + OGRFeature::DestroyFeature(poFeature); + + GDALClose(poDS); + + return 0; +} diff --git a/recipes/gdal/pre_3.5.0/conandata.yml b/recipes/gdal/pre_3.5.0/conandata.yml new file mode 100644 index 0000000000000..4ca595dd10256 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/conandata.yml @@ -0,0 +1,49 @@ +sources: + "3.4.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.4.3/gdal-3.4.3.tar.gz" + sha256: "7244962628c82921b4a4903dbb721c7222b7d82ed5928fef55a52f87f68ad1fe" + "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" + "3.2.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.2.3/gdal-3.2.3.tar.gz" + sha256: "86a35aad60a1eb87c2c0c145f9bccd83a47c4781254544ed5246f64d55ee1f18" + "3.1.4": + url: "https://github.com/OSGeo/gdal/releases/download/v3.1.4/gdal-3.1.4.tar.gz" + sha256: "5f09ea6ca797e296b608d261e08e18ffa43a12fa28d460ae139d2a026ee2b0c0" +patches: + "3.4.3": + - patch_file: "patches/3.4.x/fix-autotools-3.4.3.patch" + - patch_file: "patches/3.4.x/fix-nmake.patch" + - patch_file: "patches/3.4.x/fix-include-jsonc-3.4.3.patch" + - patch_file: "patches/3.4.x/fix-include-xerces.patch" + - patch_file: "patches/3.4.x/fix-include-podofo.patch" + "3.4.1": + - patch_file: "patches/3.4.x/fix-autotools-3.4.1.patch" + - patch_file: "patches/3.4.x/fix-nmake.patch" + - 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" + "3.2.3": + - patch_file: "patches/3.2.x/fix-autotools.patch" + - patch_file: "patches/3.2.x/fix-nmake.patch" + - patch_file: "patches/3.2.x/fix-include-jsonc.patch" + - patch_file: "patches/3.2.x/fix-include-xerces.patch" + - patch_file: "patches/3.2.x/fix-include-podofo.patch" + "3.1.4": + - patch_file: "patches/3.1.x/fix-autotools-3.1.4.patch" + - patch_file: "patches/3.1.x/fix-nmake-common.patch" + - patch_file: "patches/3.1.x/fix-nmake-opt-3.1.2.patch" + - patch_file: "patches/3.1.x/fix-import-dll-msvc.patch" + - patch_file: "patches/3.1.x/fix-include-jsonc.patch" + - patch_file: "patches/3.1.x/fix-include-xerces-3.1.2.patch" + - patch_file: "patches/3.1.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 new file mode 100644 index 0000000000000..7ecdfb6713c6a --- /dev/null +++ b/recipes/gdal/pre_3.5.0/conanfile.py @@ -0,0 +1,934 @@ +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, cross_building, stdcpp_library, valid_min_cppstd +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeDeps, NMakeToolchain, unix_path +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.58.0" + + +class GdalConan(ConanFile): + name = "gdal" + description = "GDAL is an open source X/MIT licensed translator library " \ + "for raster and vector geospatial data formats." + license = "MIT" + topics = ("osgeo", "geospatial", "raster", "vector") + homepage = "https://github.com/OSGeo/gdal" + 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], + "simd_intrinsics": [None, "sse", "ssse3", "avx"], + "threadsafe": [True, False], + "tools": [True, False], + "with_zlib": [True, False], + "with_libdeflate": [True, False], + "with_libiconv": [True, False], + "with_zstd": [True, False], + "with_blosc": [True, False], + "with_lz4": [True, False], + "with_pg": [True, False], + # "with_libgrass": [True, False], + "with_cfitsio": [True, False], + "with_pcraster": [True, False], + "with_png": [True, False], + "with_dds": [True, False], + "with_gta": [True, False], + "with_pcidsk": [True, False], + "with_jpeg": [None, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "with_charls": [True, False], + "with_gif": [True, False], + # "with_ogdi": [True, False], + # "with_sosi": [True, False], + "with_mongocxx": [True, False], + "with_hdf4": [True, False], + "with_hdf5": [True, False], + "with_kea": [True, False], + "with_netcdf": [True, False], + "with_jasper": [True, False], + "with_openjpeg": [True, False], + # "with_fgdb": [True, False], + "with_gnm": [True, False], + "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], + "with_xerces": [True, False], + "with_expat": [True, False], + "with_libkml": [True, False], + "with_odbc": [True, False], + # "with_dods_root": [True, False], + "with_curl": [True, False], + "with_xml2": [True, False], + # "with_spatialite": [True, False], + "with_sqlite3": [True, False], + # "with_rasterlite2": [True, False], + "with_pcre": [True, False], + "with_pcre2": [True, False], + "with_webp": [True, False], + "with_geos": [True, False], + # "with_sfcgal": [True, False], + "with_qhull": [True, False], + "with_opencl": [True, False], + "with_freexl": [True, False], + "without_pam": [True, False], + "with_poppler": [True, False], + "with_podofo": [True, False], + # "with_pdfium": [True, False], + # "with_tiledb": [True, False], + # "with_rasdaman": [True, False], + "with_brunsli": [True, False], + # "with_armadillo": [True, False], + "with_cryptopp": [True, False], + "with_crypto": [True, False], + "without_lerc": [True, False], + "with_null": [True, False], + "with_exr": [True, False], + "with_heif": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "simd_intrinsics": "sse", + "threadsafe": True, + "tools": False, + "with_zlib": True, + "with_libdeflate": True, + "with_libiconv": True, + "with_zstd": False, + "with_blosc": False, + "with_lz4": False, + "with_pg": False, + # "with_libgrass": False, + "with_cfitsio": False, + "with_pcraster": True, + "with_png": True, + "with_dds": False, + "with_gta": False, + "with_pcidsk": True, + "with_jpeg": "libjpeg", + "with_charls": False, + "with_gif": True, + # "with_ogdi": False, + # "with_sosi": False, + "with_mongocxx": False, + "with_hdf4": False, + "with_hdf5": False, + "with_kea": False, + "with_netcdf": False, + "with_jasper": False, + "with_openjpeg": False, + # "with_fgdb": False, + "with_gnm": True, + "with_mysql": None, + "with_xerces": False, + "with_expat": False, + "with_libkml": False, + "with_odbc": False, + # "with_dods_root": False, + "with_curl": False, + "with_xml2": False, + # "with_spatialite": False, + "with_sqlite3": True, + # "with_rasterlite2": False, + "with_pcre": False, + "with_pcre2": False, + "with_webp": False, + "with_geos": True, + # "with_sfcgal": False, + "with_qhull": True, + "with_opencl": False, + "with_freexl": False, + "without_pam": False, + "with_poppler": False, + "with_podofo": False, + # "with_pdfium": False, + # "with_tiledb": False, + # "with_rasdaman": False, + "with_brunsli": False, + # "with_armadillo": False, + "with_cryptopp": False, + "with_crypto": False, + "without_lerc": False, + "with_null": False, + "with_exr": False, + "with_heif": False, + } + + @property + 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) + + 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: + self.options.rm_safe("fPIC") + if self.settings.arch not in ["x86", "x86_64"]: + self.options.rm_safe("simd_intrinsics") + if self.options.without_lerc: + self.options.rm_safe("with_zstd") + # if self.options.with_spatialite: + # self.options.rm_safe("with_sqlite3 + if not self.options.get_safe("with_sqlite3"): + self.options.rm_safe("with_pcre") + self.options.rm_safe("with_pcre2") + if is_msvc(self): + self.options.rm_safe("threadsafe") + self.options.rm_safe("with_null") + self.options.rm_safe("with_zlib") # zlib and png are always used in nmake build, + 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 + + def layout(self): + basic_layout(self, src_folder="src") + self.folders.build = self.folders.source + + def requirements(self): + self.requires("json-c/0.16") + 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.4.0") + self.requires("proj/9.1.1") + if Version(self.version) >= "3.1.0": + 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.17") + if self.options.with_libiconv: + self.requires("libiconv/1.17") + if self.options.get_safe("with_zstd"): + self.requires("zstd/1.5.2") + if self.options.get_safe("with_blosc"): + self.requires("c-blosc/1.21.3") + if self.options.get_safe("with_lz4"): + self.requires("lz4/1.9.4") + if self.options.with_pg: + self.requires("libpq/14.5") + # if self.options.with_libgrass: + # self.requires("libgrass/x.x.x") + if self.options.with_cfitsio: + self.requires("cfitsio/4.1.0") + # 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.39") + if self.options.with_dds: + self.requires("crunch/cci.20190615") + if self.options.with_gta: + self.requires("libgta/1.2.1") + # if self.options.with_pcidsk: + # self.requires("pcidsk/x.x.x") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + if self.options.with_charls: + self.requires("charls/2.4.1") + if self.options.with_gif: + self.requires("giflib/5.2.1") + # if self.options.with_ogdi: + # self.requires("ogdi/4.1.0") + # if self.options.with_sosi: + # self.requires("fyba/4.1.1") + if self.options.with_mongocxx: + self.requires("mongo-cxx-driver/3.6.7") + if self.options.with_hdf4: + self.requires("hdf4/4.2.15") + if self.options.with_hdf5: + self.requires("hdf5/1.14.0") + if self.options.with_kea: + self.requires("kealib/1.4.14") + if self.options.with_netcdf: + self.requires("netcdf/4.8.1") + if self.options.with_jasper: + self.requires("jasper/4.0.0") + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + # if self.options.with_fgdb: + # self.requires("file-geodatabase-api/x.x.x") + if self.options.with_mysql == "libmysqlclient": + self.requires("libmysqlclient/8.0.31") + elif self.options.with_mysql == "mariadb-connector-c": + self.requires("mariadb-connector-c/3.1.12") + if self.options.with_xerces: + self.requires("xerces-c/3.2.4") + if self.options.with_expat: + self.requires("expat/2.5.0") + if self.options.with_libkml: + self.requires("libkml/1.3.0") + if self.options.with_odbc and self.settings.os != "Windows": + self.requires("odbc/2.3.11") + # if self.options.with_dods_root: + # self.requires("libdap/3.20.6") + if self.options.with_curl: + self.requires("libcurl/7.87.0") + 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.40.1") + # if self.options.with_rasterlite2: + # self.requires("rasterlite2/x.x.x") + if self.options.get_safe("with_pcre"): + self.requires("pcre/8.45") + if self.options.get_safe("with_pcre2"): + self.requires("pcre2/10.42") + if self.options.with_webp: + self.requires("libwebp/1.3.0") + if self.options.with_geos: + self.requires("geos/3.11.1") + # if self.options.with_sfcgal: + # self.requires("sfcgal/1.3.7") + if self.options.with_qhull: + self.requires("qhull/8.0.1") + if self.options.with_opencl: + self.requires("opencl-headers/2022.09.30") + self.requires("opencl-icd-loader/2022.09.30") + if self.options.with_freexl: + self.requires("freexl/1.0.6") + if self.options.with_poppler: + self.requires("poppler/21.07.0") + if self.options.with_podofo: + self.requires("podofo/0.9.7") + # if self.options.with_pdfium: + # self.requires("pdfium/x.x.x") + # if self.options.get_safe("with_tiledb"): + # self.requires("tiledb/2.0.2") + # if self.options.with_rasdaman: + # self.requires("raslib/x.x.x") + # if self.options.with_armadillo: + # self.requires("armadillo/9.880.1") + if self.options.with_cryptopp: + self.requires("cryptopp/8.7.0") + if self.options.with_crypto: + self.requires("openssl/1.1.1s") + # 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"): + self.requires("openexr/3.1.5") + if self.options.get_safe("with_heif"): + self.requires("libheif/1.13.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + min_cppstd = 14 if self.options.with_charls else 11 + check_min_cppstd(self, min_cppstd) + if self.options.get_safe("with_pcre") and self.options.get_safe("with_pcre2"): + 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"): + 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): + 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: + 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") + if self.options.tools: + raise ConanInvalidConfiguration(f"{self.ref} can't cross-build tools") + + if Version(self.dependencies["libtiff"].ref.version) < "4.0.0": + raise ConanInvalidConfiguration(f"{self.ref} requires libtiff >= 4.0.0") + if self.options.with_mongocxx: + mongocxx_version = Version(self.dependencies["mongo-cxx-driver"].ref.version) + 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": + 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") + 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 _patch_sources(self): + apply_conandata_patches(self) + + # Remove embedded dependencies + embedded_libs = [ + os.path.join("alg", "internal_libqhull"), + os.path.join("frmts", "gif", "giflib"), + os.path.join("frmts", "jpeg", "libjpeg"), + os.path.join("frmts", "png", "libpng"), + 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"), + ] + 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)) + + # OpenCL headers + replace_in_file(self, os.path.join(self.source_folder, "alg", "gdalwarpkernel_opencl.h"), + "#include ", + "#include ") + + # More patches for autotools build + if not is_msvc(self): + configure_ac = os.path.join(self.source_folder, "configure.ac") + # Workaround for nc-config not packaged in netcdf recipe (gdal relies on it to check nc4 and hdf4 support in netcdf): + if self.options.with_netcdf: + if self.dependencies["netcdf"].options.netcdf4 and self.dependencies["netcdf"].options.with_hdf5: + replace_in_file(self, configure_ac, "NETCDF_HAS_NC4=no", "NETCDF_HAS_NC4=yes") + # Fix zlib checks and -lz injection to ensure to use external zlib and not fail others checks + if self.options.get_safe("with_zlib", True): + zlib_name = self.dependencies["zlib"].cpp_info.aggregated_components().libs[0] + replace_in_file(self, configure_ac, "AC_CHECK_LIB(z,", f"AC_CHECK_LIB({zlib_name},") + replace_in_file(self, configure_ac, "-lz ", f"-l{zlib_name} ") + # Workaround for autoconf 2.71 + with open(os.path.join(self.source_folder, "config.rpath"), "w"): + pass + + # Disable tools + if not self.options.tools: + # autotools + gnumakefile_apps = os.path.join(self.source_folder, "apps", "GNUmakefile") + 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 core gdal-config gdal-config-inst") + replace_in_file(self, gnumakefile_apps, + "for f in $(BIN_LIST) ; do $(INSTALL) $$f $(DESTDIR)$(INST_BIN) ; done", + "") + # msvc + vcmakefile_apps = os.path.join(self.source_folder, "apps", "makefile.vc") + replace_in_file(self, vcmakefile_apps, "default: ", "default: \n\nold-default: ") + replace_in_file(self, vcmakefile_apps, "copy *.exe $(BINDIR)", "") + + def _build_nmake(self): + def replace_in_nmake_opt(str1, str2): + replace_in_file(self, os.path.join(self.source_folder, "nmake.opt"), str1, str2) + + simd_intrinsics = str(self.options.get_safe("simd_intrinsics", False)) + if simd_intrinsics != "avx": + replace_in_nmake_opt("AVXFLAGS = /DHAVE_AVX_AT_COMPILE_TIME", "") + if simd_intrinsics not in ["sse3", "avx"]: + replace_in_nmake_opt("SSSE3FLAGS = /DHAVE_SSSE3_AT_COMPILE_TIME", "") + if simd_intrinsics not in ["sse", "sse3", "avx"]: + replace_in_nmake_opt("SSEFLAGS = /DHAVE_SSE_AT_COMPILE_TIME", "") + if self.options.without_pam: + replace_in_nmake_opt("PAM_SETTING=-DPAM_ENABLED", "") + if not self.options.with_gnm: + replace_in_nmake_opt("INCLUDE_GNM_FRMTS = YES", "") + if not self.options.with_odbc: + replace_in_nmake_opt("ODBC_SUPPORTED = 1", "") + if not bool(self.options.with_jpeg): + replace_in_nmake_opt("JPEG_SUPPORTED = 1", "") + replace_in_nmake_opt("JPEG12_SUPPORTED = 1", "") + if not self.options.with_pcidsk: + replace_in_nmake_opt("PCIDSK_SETTING=INTERNAL", "") + if self.options.with_pg: + replace_in_nmake_opt("#PG_LIB = n:\\pkg\\libpq_win32\\lib\\libpqdll.lib wsock32.lib", "PG_LIB=") + if bool(self.options.with_mysql): + replace_in_nmake_opt("#MYSQL_LIB = D:\\Software\\MySQLServer4.1\\lib\\opt\\libmysql.lib advapi32.lib", "MYSQL_LIB=") + if self.options.get_safe("with_sqlite3"): + replace_in_nmake_opt("#SQLITE_LIB=N:\\pkg\\sqlite-win32\\sqlite3_i.lib", "SQLITE_LIB=") + if self.options.with_curl: + replace_in_nmake_opt("#CURL_LIB = $(CURL_DIR)/libcurl.lib wsock32.lib wldap32.lib winmm.lib", "CURL_LIB=") + if self.options.with_freexl: + replace_in_nmake_opt("#FREEXL_LIBS = e:/freexl-1.0.0a/freexl_i.lib", "FREEXL_LIBS=") + if not (self.options.get_safe("with_zlib", True) and self.options.get_safe("with_png", True) and bool(self.options.with_jpeg)): + replace_in_nmake_opt("MRF_SETTING=yes", "") + if self.options.with_charls: + replace_in_nmake_opt("#CHARLS_LIB=e:\\work\\GIS\\gdal\\supportlibs\\charls\\bin\\Release\\x86\\CharLS.lib", "CHARLS_LIB=") + # Trick to enable OpenCL (option missing in upstream nmake files) + if self.options.with_opencl: + replace_in_file(self, os.path.join(self.source_folder, "alg", "makefile.vc"), + "$(GEOS_CFLAGS)", "$(GEOS_CFLAGS) /DHAVE_OPENCL") + + with chdir(self, self.source_folder): + self.run(f"nmake -f makefile.vc {' '.join(self._nmake_args)}") + + @property + def _nmake_args(self): + rootpath = lambda req: self.dependencies[req].package_folder + include_paths = lambda req: " -I".join(self.dependencies[req].cpp_info.aggregated_components().includedirs) + version = lambda req: Version(self.dependencies[req].ref.version) + + args = [] + args.append("GDAL_HOME=\"{}\"".format(self.package_folder)) + args.append("INCDIR=\"{}\"".format(os.path.join(self.package_folder, "include", "gdal"))) + args.append("DATADIR=\"{}\"".format(os.path.join(self.package_folder, "res", "gdal"))) + if self.settings.arch == "x86_64": + args.append("WIN64=1") + args.append("DEBUG={}".format("1" if self.settings.build_type == "Debug" else "0")) + args.append("DLLBUILD={}".format("1" if self.options.shared else "0")) + args.append("PROJ_INCLUDE=\"-I{}\"".format(include_paths("proj"))) + if self.options.with_libiconv: + args.append("LIBICONV_INCLUDE=\"-I{}\"".format(include_paths("libiconv"))) + args.append("LIBICONV_CFLAGS=\"-DICONV_CONST=\"") + args.append("JPEG_EXTERNAL_LIB=1") + if self.options.with_jpeg == "libjpeg": + args.append("JPEGDIR=\"{}\"".format(include_paths("libjpeg"))) + elif self.options.with_jpeg == "libjpeg-turbo": + args.append("JPEGDIR=\"{}\"".format(include_paths("libjpeg-turbo"))) + elif self.options.with_jpeg == "mozjpeg": + args.append("JPEGDIR=\"{}\"".format(include_paths("mozjpeg"))) + args.append("PNG_EXTERNAL_LIB=1") + args.append("PNGDIR=\"{}\"".format(include_paths("libpng"))) + if self.options.with_gif: + args.append("GIF_SETTING=EXTERNAL") + if self.options.with_pcraster: + args.append("PCRASTER_SETTING=INTERNAL") + args.append("TIFF_INC=\"-I{}\"".format(include_paths("libtiff"))) + args.append("GEOTIFF_INC=\"-I{}\"".format(include_paths("libgeotiff"))) + if self.options.with_libkml: + args.append("LIBKML_DIR=\"{}\"".format(rootpath("libkml"))) + if self.options.with_expat: + args.append("EXPAT_DIR=\"{}\"".format(rootpath("expat"))) + args.append("EXPAT_INCLUDE=\"-I{}\"".format(include_paths("expat"))) + if self.options.with_xerces: + args.append("XERCES_DIR=\"{}\"".format(rootpath("xerces-c"))) + args.append("XERCES_INCLUDE=\"-I{}\"".format(include_paths("xerces-c"))) + if self.options.with_jasper: + args.append("JASPER_DIR=\"{}\"".format(rootpath("jasper"))) + if self.options.with_hdf4: + args.append("HDF4_DIR=\"{}\"".format(rootpath("hdf4"))) + args.append("HDF4_INCLUDE=\"{}\"".format(include_paths("hdf4"))) + if version("hdf4") >= "4.2.5": + args.append("HDF4_HAS_MAXOPENFILES=YES") + if self.options.with_hdf5: + args.append("HDF5_DIR=\"{}\"".format(rootpath("hdf5"))) + if self.options.with_kea: + args.append("KEA_CFLAGS=\"-I{}\"".format(include_paths("kealib"))) + if self.options.with_pg: + args.append("PG_INC_DIR=\"{}\"".format(include_paths("libpq"))) + if self.options.with_mysql == "libmysqlclient": + args.append("MYSQL_INC_DIR=\"{}\"".format(include_paths("libmysqlclient"))) + elif self.options.with_mysql == "mariadb-connector-c": + args.append("MYSQL_INC_DIR=\"{}\"".format(include_paths("mariadb-connector-c"))) + if self.options.get_safe("with_sqlite3"): + args.append("SQLITE_INC=\"-I{}\"".format(include_paths("sqlite3"))) + if self.options.get_safe("with_pcre2"): + args.append("PCRE2_INC=\"-I{}\"".format(include_paths("pcre2"))) + if self.options.get_safe("with_pcre"): + args.append("PCRE_INC=\"-I{}\"".format(include_paths("pcre"))) + if self.options.with_cfitsio: + args.append("FITS_INC_DIR=\"{}\"".format(include_paths("cfitsio"))) + if self.options.with_netcdf: + args.extend([ + "NETCDF_SETTING=YES", + "NETCDF_INC_DIR=\"{}\"".format(include_paths("netcdf")) + ]) + 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")): + args.append("NETCDF_HAS_NETCDF_MEM=YES") + if self.options.with_curl: + args.append("CURL_INC=\"-I{}\"".format(include_paths("libcurl"))) + if self.options.with_geos: + args.append("GEOS_CFLAGS=\"-I{} -DHAVE_GEOS\"".format(include_paths("geos"))) + if self.options.with_openjpeg: + args.append("OPENJPEG_ENABLED=YES") + 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"): + args.append("LIBDEFLATE_CFLAGS=\"-I{}\"".format(include_paths("libdeflate"))) + if self.options.with_poppler: + poppler_version = version("poppler") + args.extend([ + "POPPLER_ENABLED=YES", + "POPPLER_MAJOR_VERSION={}".format(poppler_version.major), + "POPPLER_MINOR_VERSION={}".format(poppler_version.minor) + ]) + if self.options.with_podofo: + 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"): + args.append("BLOSC_CFLAGS=\"-I{}\"".format(include_paths("c-blosc"))) + if self.options.get_safe("with_lz4"): + args.append("LZ4_CFLAGS=\"-I{}\"".format(include_paths("lz4"))) + if self.options.with_webp: + args.append("WEBP_ENABLED=YES") + args.append("WEBP_CFLAGS=\"-I{}\"".format(include_paths("libwebp"))) + if self.options.with_xml2: + args.append("LIBXML2_INC=\"-I{}\"".format(include_paths("libxml2"))) + if self.options.with_gta: + args.append("GTA_CFLAGS=\"-I{}\"".format(include_paths("libgta"))) + if self.options.with_mongocxx: + args.append("MONGOCXXV3_CFLAGS=\"-I{}\"".format(include_paths("mongo-cxx-driver"))) + args.append("QHULL_SETTING={}".format("EXTERNAL" if self.options.with_qhull else "NO")) + if self.options.with_qhull and self.dependencies["qhull"].options.reentrant: + args.append("QHULL_IS_LIBQHULL_R=1") + if self.options.with_cryptopp: + args.append("CRYPTOPP_INC=\"-I{}\"".format(include_paths("cryptopp"))) + if self.dependencies["cryptopp"].options.shared: + args.append("USE_ONLY_CRYPTODLL_ALG=YES") + if self.options.with_crypto: + 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"): + args.extend([ + "BRUNSLI_DIR=\"{}\"".format(rootpath("brunsli")), + "BRUNSLI_INC=\"{}\"".format(include_paths("brunsli")), + ]) + if self.options.with_charls: + charls_version = version("charls") + if charls_version >= "2.1.0": + args.append("CHARLS_FLAGS=-DCHARLS_2_1") + elif charls_version >= "2.0.0": + 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"): + args.append("EXR_INC=\"-I{}\"".format(include_paths("openexr"))) + if self.options.get_safe("with_heif"): + args.append("HEIF_INC=\"-I{}\"".format(include_paths("libheif"))) + + return args + + def _gather_libs(self, p): + deps_cpp_info = self.dependencies[p].cpp_info.aggregated_components() + libs = deps_cpp_info.libs + deps_cpp_info.system_libs + for dep in self.dependencies[p].dependencies: + for l in self._gather_libs(dep): + if not l in libs: + libs.append(l) + return libs + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + else: + 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" + internal_no = lambda v: "internal" if v else "no" + rootpath = lambda req: unix_path(self, self.dependencies[req].package_folder) + rootpath_no = lambda v, req: rootpath(req) if v else "no" + + tc.configure_args.extend([ + "--includedir=${prefix}/include/gdal", + "--datarootdir=${prefix}/res", + ]) + + # Enable C++14 if requested in conan profile or if with_charls enabled + if (self.settings.compiler.get_safe("cppstd") and valid_min_cppstd(self, 14)) or self.options.with_charls: + tc.configure_args.append("--with-cpp14") + # Debug + if self.settings.build_type == "Debug": + tc.configure_args.append("--enable-debug") + # SIMD Intrinsics + simd_intrinsics = self.options.get_safe("simd_intrinsics", False) + if not simd_intrinsics: + tc.configure_args.extend(["--without-sse", "--without-ssse3", "--without-avx"]) + elif simd_intrinsics == "sse": + tc.configure_args.extend(["--with-sse", "--without-ssse3", "--without-avx"]) + elif simd_intrinsics == "ssse3": + tc.configure_args.extend(["--with-sse", "--with-ssse3", "--without-avx"]) + elif simd_intrinsics == "avx": + tc.configure_args.extend(["--with-sse", "--with-ssse3", "--with-avx"]) + # LTO (disabled) + tc.configure_args.append("--disable-lto") + # Symbols + tc.configure_args.append("--with-hide_internal_symbols") + # Do not add /usr/local/lib and /usr/local/include + tc.configure_args.append("--without-local") + # Threadsafe + tc.configure_args.append("--with-threads={}".format(yes_no(self.options.threadsafe))) + # 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-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))) + # 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("--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"))) + tc.configure_args.append("--with-pcraster={}".format(internal_no(self.options.with_pcraster))) # TODO: use conan recipe when available instead of internal one + tc.configure_args.append("--with-png={}".format(rootpath_no(self.options.with_png, "libpng"))) + tc.configure_args.append("--with-dds={}".format(rootpath_no(self.options.with_dds, "crunch"))) + tc.configure_args.append("--with-gta={}".format(rootpath_no(self.options.with_gta, "libgta"))) + tc.configure_args.append("--with-pcidsk={}".format(internal_no(self.options.with_pcidsk))) # TODO: use conan recipe when available instead of internal one + tc.configure_args.append("--with-libtiff={}".format(rootpath("libtiff"))) # always required ! + tc.configure_args.append("--with-geotiff={}".format(rootpath("libgeotiff"))) # always required ! + if self.options.with_jpeg == "libjpeg": + tc.configure_args.append("--with-jpeg={}".format(rootpath("libjpeg"))) + elif self.options.with_jpeg == "libjpeg-turbo": + tc.configure_args.append("--with-jpeg={}".format(rootpath("libjpeg-turbo"))) + elif self.options.with_jpeg == "mozjpeg": + tc.configure_args.append("--with-jpeg={}".format(rootpath("mozjpeg"))) + else: + tc.configure_args.append("--without-jpeg") + tc.configure_args.append("--without-jpeg12") # disabled: it requires internal libjpeg and libgeotiff + tc.configure_args.append("--with-charls={}".format(yes_no(self.options.with_charls))) + tc.configure_args.append("--with-gif={}".format(rootpath_no(self.options.with_gif, "giflib"))) + tc.configure_args.append("--without-ogdi") # TODO: to implement when ogdi lib available (https://sourceforge.net/projects/ogdi/) + tc.configure_args.append("--without-fme") # commercial library + tc.configure_args.append("--without-sosi") # TODO: to implement when fyba lib available + tc.configure_args.append("--without-mongocxx") # TODO: handle mongo-cxx-driver v2 + tc.configure_args.append("--with-mongocxxv3={}".format(yes_no(self.options.with_mongocxx))) + tc.configure_args.append("--with-hdf4={}".format(yes_no(self.options.with_hdf4))) + tc.configure_args.append("--with-hdf5={}".format(yes_no(self.options.with_hdf5))) + tc.configure_args.append("--with-kea={}".format(yes_no(self.options.with_kea))) + tc.configure_args.append("--with-netcdf={}".format(rootpath_no(self.options.with_netcdf, "netcdf"))) + tc.configure_args.append("--with-jasper={}".format(rootpath_no(self.options.with_jasper, "jasper"))) + tc.configure_args.append("--with-openjpeg={}".format(yes_no(self.options.with_openjpeg))) + tc.configure_args.append("--without-fgdb") # TODO: to implement when file-geodatabase-api lib available + tc.configure_args.append("--without-ecw") # commercial library + tc.configure_args.append("--without-kakadu") # commercial library + tc.configure_args.extend(["--without-mrsid", "--without-jp2mrsid", "--without-mrsid_lidar"]) # commercial library + tc.configure_args.append("--without-jp2lura") # commercial library + tc.configure_args.append("--without-msg") # commercial library + tc.configure_args.append("--without-oci") # TODO + tc.configure_args.append("--with-gnm={}".format(yes_no(self.options.with_gnm))) + tc.configure_args.append("--with-mysql={}".format(yes_no(self.options.with_mysql))) + tc.configure_args.append("--without-ingres") # commercial library + tc.configure_args.append("--with-xerces={}".format(rootpath_no(self.options.with_xerces, "xerces-c"))) + tc.configure_args.append("--with-expat={}".format(yes_no(self.options.with_expat))) + tc.configure_args.append("--with-libkml={}".format(rootpath_no(self.options.with_libkml, "libkml"))) + if self.options.with_odbc: + tc.configure_args.append("--with-odbc={}".format("yes" if self.settings.os == "Windows" else rootpath("odbc"))) + else: + tc.configure_args.append("--without-odbc") + tc.configure_args.append("--without-dods-root") # TODO: to implement when libdap lib available + tc.configure_args.append("--with-curl={}".format(yes_no(self.options.with_curl))) + tc.configure_args.append("--with-xml2={}".format(yes_no(self.options.with_xml2))) + 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-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 + tc.configure_args.append("--with-qhull={}".format(yes_no(self.options.with_qhull))) + if self.options.with_opencl: + tc.configure_args.extend([ + "--with-opencl", + "--with-opencl-include={}".format(unix_path(self, self.dependencies["opencl-headers"].cpp_info.aggregated_components().includedirs[0])), + "--with-opencl-lib=-L{}".format(unix_path(self, self.dependencies["opencl-icd-loader"].cpp_info.aggregated_components().libdirs[0])) + ]) + else: + tc.configure_args.append("--without-opencl") + tc.configure_args.append("--with-freexl={}".format(yes_no(self.options.with_freexl))) + tc.configure_args.append("--with-libjson-c={}".format(rootpath("json-c"))) # always required ! + if self.options.without_pam: + tc.configure_args.append("--without-pam") + tc.configure_args.append("--with-poppler={}".format(yes_no(self.options.with_poppler))) + tc.configure_args.append("--with-podofo={}".format(rootpath_no(self.options.with_podofo, "podofo"))) + if self.options.with_podofo: + tc.configure_args.append("--with-podofo-lib=-l{}".format(" -l".join(self._gather_libs("podofo")))) + tc.configure_args.append("--without-pdfium") # TODO: to implement when pdfium lib available + tc.configure_args.append("--without-perl") + 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-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("--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))) + 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.generate() + + AutotoolsDeps(self).generate() + PkgConfigDeps(self).generate() + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_nmake() + else: + autotools = Autotools(self) + autotools.autoreconf() + # Required for cross-build to iOS, see https://github.com/OSGeo/gdal/issues/4123 + replace_in_file(self, os.path.join(self.source_folder, "port", "cpl_config.h.in"), + "/* port/cpl_config.h.in", + "#pragma once\n/* port/cpl_config.h.in") + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE.TXT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + with chdir(self, self.source_folder): + self.run(f"nmake -f makefile.vc devinstall {' '.join(self._nmake_args)}") + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "gdalplugins")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "GDAL") + self.cpp_info.set_property("cmake_target_name", "GDAL::GDAL") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("pkg_config_name", "gdal") + + self.cpp_info.includedirs.append(os.path.join("include", "gdal")) + self.cpp_info.resdirs = ["res"] + + lib_suffix = "" + if is_msvc(self): + if self.options.shared: + lib_suffix += "_i" + if self.settings.build_type == "Debug": + lib_suffix += "_d" + self.cpp_info.libs = [f"gdal{lib_suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m"]) + if self.options.threadsafe: + 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): + 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"]) + if is_msvc(self): + self.cpp_info.system_libs.append("legacy_stdio_definitions") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + + gdal_data_path = os.path.join(self.package_folder, "res", "gdal") + self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) + if self.options.tools: + self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "GDAL" + self.cpp_info.names["cmake_find_package_multi"] = "GDAL" + self.env_info.GDAL_DATA = gdal_data_path + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch new file mode 100644 index 0000000000000..974146f6a3f7a --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch @@ -0,0 +1,283 @@ +--- a/GDALmake.opt.in ++++ b/GDALmake.opt.in +@@ -601,7 +601,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 +@@ -1214,6 +1214,7 @@ dnl --------------------------------------------------------------------------- + dnl PROJ.6 related stuff + dnl --------------------------------------------------------------------------- + ++PKG_PROG_PKG_CONFIG([0.21]) + AC_MSG_CHECKING([for PROJ >= 6 library]) + + AC_ARG_WITH(proj,[ --with-proj=ARG Compile with PROJ.x (ARG=yes or path)],,) +@@ -1229,11 +1230,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 $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,) +@@ -1876,7 +1873,6 @@ else + + DDS_SETTING=yes + CRUNCHDIR="$with_dds" +- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" + echo "using libcrunch from $with_dds." + + fi +@@ -2012,7 +2008,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 + +@@ -2082,7 +2078,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" +@@ -2650,6 +2645,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 +@@ -2780,7 +2779,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 +@@ -2849,21 +2847,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 +@@ -3715,18 +3713,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= + +@@ -3820,8 +3815,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" +@@ -3834,6 +3832,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ + fi + ]) + ++fi + fi + + AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) +@@ -4059,29 +4058,17 @@ 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 +-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`) + ++if test "$with_curl" = "yes" ; then ++ PKG_CHECK_MODULES([CURL], [libcurl], [CURL_SETTING=yes], [AC_MSG_ERROR([libcurl not found...])]) ++else ++ CURL_SETTING=no + 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 +@@ -4121,7 +4108,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 + +@@ -4242,9 +4228,12 @@ dnl --------------------------------------------------------------------------- + dnl Check for SQLite (only if SpatiaLite is not detected) + dnl --------------------------------------------------------------------------- + ++HAVE_SQLITE3=no ++AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3[=ARG]], [use SQLite 3 library (ARG=yes or no)]),,) + if test "${HAVE_SPATIALITE}" = "no" -o "${HAVE_SPATIALITE}" = "dlopen" ; then +- SQLITE3_REQ_VERSION="3.0.0" +- AX_LIB_SQLITE3($SQLITE3_REQ_VERSION) ++ 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" +@@ -4597,8 +4586,13 @@ 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_RESULT="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]) +@@ -4607,6 +4601,8 @@ if test "${HAVE_GEOS}" = "yes" ; then + LIBS="${GEOS_LIBS} ${LIBS}" + HAVE_GEOS_RESULT="yes" + fi ++fi ++AC_SUBST(HAVE_GEOS, $HAVE_GEOS) + + dnl --------------------------------------------------------------------------- + dnl Check if SFCGAL library is available. +@@ -4641,20 +4637,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 + +@@ -4741,7 +4735,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) + +@@ -4847,8 +4843,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 +@@ -5952,7 +5947,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.1.x/fix-import-dll-msvc.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-import-dll-msvc.patch new file mode 100644 index 0000000000000..308c1bca0a4c0 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-import-dll-msvc.patch @@ -0,0 +1,15 @@ +--- a/port/cpl_port.h ++++ b/port/cpl_port.h +@@ -344,7 +344,11 @@ typedef unsigned int GUIntptr_t; + + #ifndef CPL_DLL + #if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL) +-# define CPL_DLL __declspec(dllexport) ++# ifdef GDAL_COMPILATION ++# define CPL_DLL __declspec(dllexport) ++# else ++# define CPL_DLL ++# endif + # define CPL_INTERNAL + #else + # if defined(USE_GCC_VISIBILITY_FLAG) diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch new file mode 100644 index 0000000000000..c52f9dff53382 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch @@ -0,0 +1,104 @@ +--- 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 // JSON-C + + #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 +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include // JSON-C ++#include // JSON-C + + #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 // JSON-C + + #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 // JSON-C + #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.1.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-podofo.patch new file mode 100644 index 0000000000000..aa86489f0296b --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-podofo.patch @@ -0,0 +1,11 @@ +--- 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.1.x/fix-include-xerces-3.1.2.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-xerces-3.1.2.patch new file mode 100644 index 0000000000000..8b08760381794 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-xerces-3.1.2.patch @@ -0,0 +1,63 @@ +--- 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.1.x/fix-nmake-common.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-common.patch new file mode 100644 index 0000000000000..c0201f8dc9cd8 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-common.patch @@ -0,0 +1,165 @@ +--- 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_dted -DFRMT_mem -DFRMT_jdem \ + -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\channel\cbandinterleavedchannel.obj \ +@@ -57,11 +61,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 <= 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 + +@@ -1333,23 +1337,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) +@@ -1361,8 +1353,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" +@@ -1393,11 +1388,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,) +@@ -1820,8 +1811,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 +@@ -2153,7 +2144,6 @@ else + + DDS_SETTING=yes + CRUNCHDIR="$with_dds" +- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" + echo "using libcrunch from $with_dds." + + fi +@@ -2304,7 +2294,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" +@@ -2872,6 +2861,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 +@@ -3002,7 +2995,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 +@@ -3071,21 +3063,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 +@@ -3937,18 +3929,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= + +@@ -4042,8 +4031,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" +@@ -4056,6 +4048,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ + fi + ]) + ++fi + fi + + AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) +@@ -4287,7 +4280,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 + +@@ -4567,8 +4559,13 @@ 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_RESULT="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]) +@@ -4577,6 +4574,8 @@ if test "${HAVE_GEOS}" = "yes" ; then + LIBS="${GEOS_LIBS} ${LIBS}" + HAVE_GEOS_RESULT="yes" + fi ++fi ++AC_SUBST(HAVE_GEOS, $HAVE_GEOS) + + dnl --------------------------------------------------------------------------- + dnl Check if SFCGAL library is available. +@@ -4611,20 +4610,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 + +@@ -4711,7 +4708,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) + +@@ -4817,8 +4816,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 +@@ -5928,7 +5926,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.2.x/fix-include-jsonc.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-jsonc.patch new file mode 100644 index 0000000000000..e88043df4189f --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-jsonc.patch @@ -0,0 +1,104 @@ +--- 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.2.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-podofo.patch new file mode 100644 index 0000000000000..aa86489f0296b --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-podofo.patch @@ -0,0 +1,11 @@ +--- 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.2.x/fix-include-xerces.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-xerces.patch new file mode 100644 index 0000000000000..8b08760381794 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-xerces.patch @@ -0,0 +1,63 @@ +--- 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.2.x/fix-nmake.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-nmake.patch new file mode 100644 index 0000000000000..e23b85d35a16a --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-nmake.patch @@ -0,0 +1,179 @@ +--- 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\channel\cbandinterleavedchannel.obj \ +@@ -57,11 +61,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 <= 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 new file mode 100644 index 0000000000000..e88043df4189f --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-jsonc.patch @@ -0,0 +1,104 @@ +--- 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 new file mode 100644 index 0000000000000..aa86489f0296b --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-podofo.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000000000..8b08760381794 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-xerces.patch @@ -0,0 +1,63 @@ +--- 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 new file mode 100644 index 0000000000000..4c0ef454c2aac --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-nmake.patch @@ -0,0 +1,179 @@ +--- 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 <= 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 + +@@ -1395,23 +1399,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) +@@ -1423,8 +1415,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" +@@ -1455,11 +1450,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,) +@@ -1690,6 +1681,8 @@ dnl --------------------------------------------------------------------------- + AC_ARG_WITH(blosc,[ --with-blosc[=ARG] Include blosc support (ARG=yes/no/installation_prefix)],,) + + if test "$with_blosc" = "" -o "$with_blosc" = "yes" ; then ++ HAVE_BLOSC=yes ++ if false; then + AC_CHECK_LIB(blosc,blosc_cbuffer_validate,HAVE_BLOSC=yes,HAVE_BLOSC=no,) + + if test "$HAVE_BLOSC" = "yes" ; then +@@ -1701,6 +1694,7 @@ if test "$with_blosc" = "" -o "$with_blosc" = "yes" ; then + echo "libblosc not found - BLOSC support disabled" + fi + fi ++ fi + elif test "$with_blosc" != "" -a "$with_blosc" != "no"; then + + AC_CHECK_LIB(blosc,blosc_cbuffer_validate,HAVE_BLOSC=yes,HAVE_BLOSC=no,-L$with_blosc/lib) +@@ -1953,8 +1947,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 +@@ -2286,7 +2280,6 @@ else + + DDS_SETTING=yes + CRUNCHDIR="$with_dds" +- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" + echo "using libcrunch from $with_dds." + + fi +@@ -2437,7 +2430,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" +@@ -2924,6 +2916,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 +@@ -3054,7 +3050,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 +@@ -3123,21 +3118,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 +@@ -4001,18 +3996,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= + +@@ -4106,8 +4098,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" +@@ -4120,6 +4115,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ + fi + ]) + ++fi + fi + + AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) +@@ -4366,7 +4362,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 + +@@ -4453,10 +4448,9 @@ else + AC_MSG_ERROR([cannot find pcre2.h]) + fi + else +- AC_CHECK_LIB(pcre2-8,pcre2_compile_8,HAVE_PCRE2=yes,HAVE_PCRE2=no,) ++ HAVE_PCRE2=yes + if test "$HAVE_PCRE2" = "yes" ; then + HAVE_PCRE2=yes +- LIBS="$LIBS -lpcre2-8" + else + if test "$with_pcre2" = "yes"; then + AC_MSG_ERROR([cannot find libpcre2]) +@@ -4487,10 +4481,9 @@ elif test "$HAVE_PCRE2" = "no"; then + AC_MSG_ERROR([cannot find pcre.h]) + fi + else +- AC_CHECK_LIB(pcre,pcre_compile,HAVE_PCRE=yes,HAVE_PCRE=no,) ++ HAVE_PCRE=yes + if test "$HAVE_PCRE" = "yes" ; then + HAVE_PCRE=yes +- LIBS="$LIBS -lpcre" + else + if test "$with_pcre" = "yes"; then + AC_MSG_ERROR([cannot find libpcre]) +@@ -4648,13 +4641,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. +@@ -4684,11 +4682,10 @@ elif test "$with_qhull" = "yes" -o "$with_qhull" = "" ; then + + AC_CHECK_HEADERS([libqhull_r/libqhull_r.h]) + if test "$ac_cv_header_libqhull_r_libqhull_r_h" = "yes"; then +- AC_CHECK_LIB(qhull_r,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) ++ QHULL_SETTING=yes + if test "$QHULL_SETTING" = "yes"; then + QHULL_SETTING=external + QHULL_IS_LIBQHULL_R=1 +- LIBS="-lqhull_r $LIBS" + fi + else + # Only qhull 2012 is reliable on certain datasets. Older Ubuntu have +@@ -4798,7 +4795,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) + +@@ -4904,8 +4903,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 +@@ -6079,7 +6077,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]) + if test "$HAVE_EXR" = "no"; then + dnl Try with OpenEXR >= 3 name + AC_CHECK_LIB(OpenEXR,ImfTiledInputReadTile, [HAVE_EXR=yes], [HAVE_EXR=no]) diff --git a/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-autotools-3.4.3.patch b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-autotools-3.4.3.patch new file mode 100644 index 0000000000000..4aac2e1660963 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-autotools-3.4.3.patch @@ -0,0 +1,333 @@ +--- a/GDALmake.opt.in ++++ b/GDALmake.opt.in +@@ -620,7 +620,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 +@@ -1168,6 +1168,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) +@@ -1197,13 +1201,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 + +@@ -1371,7 +1375,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 + +@@ -1395,23 +1399,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) +@@ -1423,8 +1415,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" +@@ -1455,11 +1450,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,) +@@ -1690,6 +1681,8 @@ dnl --------------------------------------------------------------------------- + AC_ARG_WITH(blosc,[ --with-blosc[=ARG] Include blosc support (ARG=yes/no/installation_prefix)],,) + + if test "$with_blosc" = "" -o "$with_blosc" = "yes" ; then ++ HAVE_BLOSC=yes ++ if false; then + AC_CHECK_LIB(blosc,blosc_cbuffer_validate,HAVE_BLOSC=yes,HAVE_BLOSC=no,) + + if test "$HAVE_BLOSC" = "yes" ; then +@@ -1701,6 +1694,7 @@ if test "$with_blosc" = "" -o "$with_blosc" = "yes" ; then + echo "libblosc not found - BLOSC support disabled" + fi + fi ++ fi + elif test "$with_blosc" != "" -a "$with_blosc" != "no"; then + + AC_CHECK_LIB(blosc,blosc_cbuffer_validate,HAVE_BLOSC=yes,HAVE_BLOSC=no,-L$with_blosc/lib) +@@ -1953,8 +1947,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 +@@ -2286,7 +2280,6 @@ else + + DDS_SETTING=yes + CRUNCHDIR="$with_dds" +- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" + echo "using libcrunch from $with_dds." + + fi +@@ -2437,7 +2430,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" +@@ -2924,6 +2916,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 +@@ -3054,7 +3050,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 +@@ -3123,21 +3118,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 +@@ -4001,18 +3996,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= + +@@ -4106,8 +4098,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" +@@ -4120,6 +4115,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ + fi + ]) + ++fi + fi + + AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) +@@ -4366,7 +4362,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 + +@@ -4453,10 +4448,9 @@ else + AC_MSG_ERROR([cannot find pcre2.h]) + fi + else +- AC_CHECK_LIB(pcre2-8,pcre2_compile_8,HAVE_PCRE2=yes,HAVE_PCRE2=no,) ++ HAVE_PCRE2=yes + if test "$HAVE_PCRE2" = "yes" ; then + HAVE_PCRE2=yes +- LIBS="$LIBS -lpcre2-8" + else + if test "$with_pcre2" = "yes"; then + AC_MSG_ERROR([cannot find libpcre2]) +@@ -4487,10 +4481,9 @@ elif test "$HAVE_PCRE2" = "no"; then + AC_MSG_ERROR([cannot find pcre.h]) + fi + else +- AC_CHECK_LIB(pcre,pcre_compile,HAVE_PCRE=yes,HAVE_PCRE=no,) ++ HAVE_PCRE=yes + if test "$HAVE_PCRE" = "yes" ; then + HAVE_PCRE=yes +- LIBS="$LIBS -lpcre" + else + if test "$with_pcre" = "yes"; then + AC_MSG_ERROR([cannot find libpcre]) +@@ -4648,13 +4641,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. +@@ -4684,11 +4682,10 @@ elif test "$with_qhull" = "yes" -o "$with_qhull" = "" ; then + + AC_CHECK_HEADERS([libqhull_r/libqhull_r.h]) + if test "$ac_cv_header_libqhull_r_libqhull_r_h" = "yes"; then +- AC_CHECK_LIB(qhull_r,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) ++ QHULL_SETTING=yes + if test "$QHULL_SETTING" = "yes"; then + QHULL_SETTING=external + QHULL_IS_LIBQHULL_R=1 +- LIBS="-lqhull_r $LIBS" + fi + else + # Only qhull 2012 is reliable on certain datasets. Older Ubuntu have +@@ -4798,7 +4795,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) + +@@ -4904,8 +4903,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 +@@ -6113,7 +6111,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]) + if test "$HAVE_EXR" = "no"; then + dnl Try with OpenEXR >= 3 name + AC_CHECK_LIB(OpenEXR,ImfTiledInputReadTile, [HAVE_EXR=yes], [HAVE_EXR=no]) diff --git a/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.1.patch b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.1.patch new file mode 100644 index 0000000000000..4760275af3a27 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.1.patch @@ -0,0 +1,104 @@ +--- 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 "cpl_port.h" + #include "cpl_conv.h" + #include "ogr_geometry.h" +-#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 "ogr_api.h" + #include "ogr_p.h" + +--- 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 "ogr_api.h" + +--- 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.4.x/fix-include-jsonc-3.4.3.patch b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.3.patch new file mode 100644 index 0000000000000..a6252aae80718 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-jsonc-3.4.3.patch @@ -0,0 +1,104 @@ +--- a/gcore/gdal_rat.cpp ++++ b/gcore/gdal_rat.cpp +@@ -51,7 +51,7 @@ + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wold-style-cast" + #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 +@@ -38,7 +38,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 "cpl_port.h" + #include "cpl_conv.h" + #include "ogr_geometry.h" +-#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 "ogr_api.h" + #include "ogr_p.h" + +--- 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 "ogr_api.h" + +--- 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.4.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-podofo.patch new file mode 100644 index 0000000000000..aa86489f0296b --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-podofo.patch @@ -0,0 +1,11 @@ +--- 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.4.x/fix-include-xerces.patch b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-xerces.patch new file mode 100644 index 0000000000000..830883f5eaae3 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-include-xerces.patch @@ -0,0 +1,48 @@ +--- 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 + + using namespace XERCES_CPP_NAMESPACE; + +--- 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 + + using namespace XERCES_CPP_NAMESPACE; + diff --git a/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-nmake.patch b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-nmake.patch new file mode 100644 index 0000000000000..446e886dcd8b3 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/patches/3.4.x/fix-nmake.patch @@ -0,0 +1,168 @@ +--- 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 < + +#include +#include + +int main() { + GDALAllRegister(); + + const char *pszDriverName = "ESRI Shapefile"; + GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); + if (!hDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } + + GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!hDS) { + printf("Creation of output file failed.\n"); + exit(1); + } + + OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); + if (!hLayer) { + printf("Layer creation failed.\n"); + exit(1); + } + + OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); + + OGR_Fld_SetWidth(hFieldDefn, 32); + + if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } + + OGR_Fld_Destroy(hFieldDefn); + + OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); + OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); + + OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); + OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); + + OGR_F_SetGeometry(hFeature, hPt); + OGR_G_DestroyGeometry(hPt); + + if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit(1); + } + + OGR_F_Destroy(hFeature); + + GDALClose(hDS); + + return 0; +} diff --git a/recipes/gdal/pre_3.5.0/test_package/test_package.cpp b/recipes/gdal/pre_3.5.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec77987bc5ece --- /dev/null +++ b/recipes/gdal/pre_3.5.0/test_package/test_package.cpp @@ -0,0 +1,54 @@ +#include + +#include +#include + +int main() { + GDALAllRegister(); + + const char *pszDriverName = "ESRI Shapefile"; + GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); + if (!poDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } + + GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!poDS) { + printf("Creation of output file failed.\n"); + exit(1); + } + + OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); + if (!poLayer) { + printf("Layer creation failed.\n"); + exit(1); + } + + OGRFieldDefn oField("Name", OFTString); + oField.SetWidth(32); + + if (poLayer->CreateField(&oField) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } + + OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); + poFeature->SetField("Name", "conan"); + + OGRPoint pt; + pt.setX(40.74); + pt.setY(-27.891); + poFeature->SetGeometry(&pt); + + if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit( 1 ); + } + + OGRFeature::DestroyFeature(poFeature); + + GDALClose(poDS); + + return 0; +} diff --git a/recipes/gdal/pre_3.5.0/test_v1_package/CMakeLists.txt b/recipes/gdal/pre_3.5.0/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gdal/pre_3.5.0/test_v1_package/conanfile.py b/recipes/gdal/pre_3.5.0/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..45e13620d8746 --- /dev/null +++ b/recipes/gdal/pre_3.5.0/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +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): + if self.options["gdal"].tools: + self.run("gdal_translate --formats", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) diff --git a/recipes/gdbm/all/conandata.yml b/recipes/gdbm/all/conandata.yml new file mode 100644 index 0000000000000..cc2f6e66ae117 --- /dev/null +++ b/recipes/gdbm/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.23": + url: [ + "https://ftp.gnu.org/gnu/gdbm/gdbm-1.23.tar.gz", + "https://mirrors.tripadvisor.com/gnu/gdbm/gdbm-1.23.tar.gz", + ] + sha256: "74b1081d21fff13ae4bd7c16e5d6e504a4c26f7cde1dca0d963a484174bbcacd" + "1.19": + url: [ + "https://ftp.gnu.org/gnu/gdbm/gdbm-1.19.tar.gz", + "https://mirrors.tripadvisor.com/gnu/gdbm/gdbm-1.19.tar.gz", + ] + sha256: "37ed12214122b972e18a0d94995039e57748191939ef74115b1d41d8811364bc" + "1.18.1": + url: [ + "https://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz", + "https://mirrors.tripadvisor.com/gnu/gdbm/gdbm-1.18.1.tar.gz", + ] + sha256: "86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc" +patches: + "1.18.1": + - patch_file: "patches/0001-fix-multiple-definitions.patch" diff --git a/recipes/gdbm/all/conanfile.py b/recipes/gdbm/all/conanfile.py new file mode 100644 index 0000000000000..71b092ccff400 --- /dev/null +++ b/recipes/gdbm/all/conanfile.py @@ -0,0 +1,143 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.54.0" + + +class GdbmConan(ConanFile): + name = "gdbm" + description = ("gdbm is a library of database functions that uses " + "extensible hashing and work similar to " + "the standard UNIX dbm. " + "These routines are provided to a programmer needing " + "to create and manipulate a hashed database.") + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org.ua/software/gdbm/gdbm.html" + topics = ("dbm", "hash", "database") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "libgdbm_compat": [True, False], + "gdbmtool_debug": [True, False], + "with_libiconv": [True, False], + "with_readline": [True, False], + "with_nls": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "libgdbm_compat": False, + "gdbmtool_debug": True, + "with_libiconv": False, + "with_readline": False, + "with_nls": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if not self.options.with_nls: + self.options.rm_safe("with_libiconv") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_libiconv"): + self.requires("libiconv/1.17") + if self.options.with_readline: + self.requires("readline/8.1.2") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.name} is not supported on Windows") + + def build_requirements(self): + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + self.tool_requires("gnu-config/cci.20210814") + + 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() + if not cross_building(self): + virtual_run_env = VirtualRunEnv(self) + virtual_run_env.generate(scope="build") + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + enable_debug = self.settings.build_type in ["Debug", "RelWithDebInfo"] + tc.configure_args.extend([ + f"--enable-debug={yes_no(enable_debug)}", + f"--enable-libgdbm-compat={yes_no(self.options.libgdbm_compat)}", + f"--enable-gdbmtool-debug={yes_no(self.options.gdbmtool_debug)}", + f"--enable-nls={yes_no(self.options.with_nls)}", + f"--with-readline={yes_no(self.options.with_readline)}", + f"--with-pic={yes_no(self.options.get_safe('fPIC', True))}", + ]) + if self.options.gdbmtool_debug: + tc.extra_defines.append("YYDEBUG=1") + if self.options.get_safe("with_libiconv"): + libiconv_package_folder = self.dependencies.direct_host["libiconv"].package_folder + tc.configure_args.extend([ + f"--with-libiconv-prefix={libiconv_package_folder}" + "--with-libintl-prefix" + ]) + else: + tc.configure_args.extend([ + "--without-libiconv-prefix", + "--without-libintl-prefix" + ]) + tc.generate() + autotools_deps = AutotoolsDeps(self) + autotools_deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), os.path.dirname(gnu_config), os.path.join(self.source_folder, "build-aux")) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make(target="maintainer-clean-generic") + 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, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + if self.options.libgdbm_compat: + self.cpp_info.libs.append("gdbm_compat") + self.cpp_info.libs.append("gdbm") + + 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/gdbm/all/patches/0001-fix-multiple-definitions.patch b/recipes/gdbm/all/patches/0001-fix-multiple-definitions.patch new file mode 100644 index 0000000000000..341fa514fb44d --- /dev/null +++ b/recipes/gdbm/all/patches/0001-fix-multiple-definitions.patch @@ -0,0 +1,11 @@ +--- a/src/parseopt.c ++++ b/src/parseopt.c +@@ -255,8 +255,6 @@ print_option_descr (const char *descr, size_t lmargin, size_t rmargin) + } + + char *parseopt_program_name; +-char *parseopt_program_doc; +-char *parseopt_program_args; + const char *program_bug_address = "<" PACKAGE_BUGREPORT ">"; + void (*parseopt_help_hook) (FILE *stream); + diff --git a/recipes/gdbm/all/test_package/CMakeLists.txt b/recipes/gdbm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..271f4ed1ffbb0 --- /dev/null +++ b/recipes/gdbm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(gdbm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE gdbm::gdbm) diff --git a/recipes/gdbm/all/test_package/conanfile.py b/recipes/gdbm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/gdbm/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/gdbm/all/test_package/test_package.c b/recipes/gdbm/all/test_package/test_package.c new file mode 100644 index 0000000000000..ab72c72ff801f --- /dev/null +++ b/recipes/gdbm/all/test_package/test_package.c @@ -0,0 +1,62 @@ +#include + +#include +#include +#include + +#define SET_DATUM_CSTR(DATUM, CSTR) do {(DATUM).dptr=(CSTR); (DATUM).dsize=strlen(CSTR)+1;} while (0) + +int main(int argc, char *argv[]) { + GDBM_FILE file; + int res; + gdbm_count_t count; + datum key, content, fetch; + + file = gdbm_open("test.db", 512, GDBM_WRCREAT, 0644, NULL); + if (file == NULL) { + puts("gdbm_open failed\n"); + return EXIT_FAILURE; + } + + res = gdbm_count(file, &count); + if (res != 0) { + puts("gdbm_count failed\n"); + return EXIT_FAILURE; + } + + SET_DATUM_CSTR(key, "key"); + SET_DATUM_CSTR(content, "content"); + res = gdbm_store(file, key, content, GDBM_INSERT); + if (res != 0) { + puts("gdbm_store failed\n"); + return EXIT_FAILURE; + } + + if (!gdbm_exists(file, key)) { + puts("gdbm_exists failed: cannot find key"); + return EXIT_FAILURE; + } + + memset(&fetch, 0, sizeof(fetch)); + fetch = gdbm_fetch(file, key); + if (content.dsize != fetch.dsize) { + puts("gdbm_fetch failed: dsize does not match\n"); + } + if (strncmp(content.dptr, fetch.dptr, strlen(content.dptr))) { + puts("gdbm_fetch failed: dptr does not match\n"); + } + + res = gdbm_close(file); + if (res != 0) { + puts("gdbm_close failed\n"); + return EXIT_FAILURE; + } + + if (gdbm_errno) { + puts("gdbm_errno nonzero\n"); + puts(gdbm_strerror(gdbm_errno)); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/gdbm/all/test_v1_package/CMakeLists.txt b/recipes/gdbm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0624ca060d101 --- /dev/null +++ b/recipes/gdbm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_v1_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/gdbm/all/test_v1_package/conanfile.py b/recipes/gdbm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/gdbm/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gdbm/config.yml b/recipes/gdbm/config.yml new file mode 100644 index 0000000000000..bdd7d2d2f235b --- /dev/null +++ b/recipes/gdbm/config.yml @@ -0,0 +1,7 @@ +versions: + "1.23": + folder: all + "1.19": + folder: all + "1.18.1": + folder: all diff --git a/recipes/gdcm/all/conandata.yml b/recipes/gdcm/all/conandata.yml new file mode 100644 index 0000000000000..330dc8dd2483c --- /dev/null +++ b/recipes/gdcm/all/conandata.yml @@ -0,0 +1,81 @@ +sources: + "3.0.21": + url: "https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%203.0.21/gdcm-3.0.21.tar.bz2" + sha256: "f29dbdd3b6b4c30c9803e6466b88b139d67f5585768565fe29f0be65ad737744" + "3.0.20": + url: "https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%203.0.20/gdcm-3.0.20.tar.bz2" + sha256: "d299731e229fe7595001f17e6b81e6f9a27daac3df7295543753525242cea0b2" + "3.0.9": + url: "https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%203.0.9/gdcm-3.0.9.tar.bz2" + sha256: "1d518b0e4709cecfb7330c9bd9b3a73cfd01ffe70d1c178f36a4c847283c4672" +patches: + "3.0.21": + - patch_file: "patches/0001-charls-linking.patch" + patch_description: "fix symbol export for gdcmcharls" + patch_type: "portability" + - patch_file: "patches/0002-3.0.20-openjpeg.patch" + patch_description: "fix variable names for openjpeg" + patch_type: "conan" + - patch_file: "patches/0004-3.0.20-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" + - patch_file: "patches/0005-3.0.20-openssl.patch" + patch_description: "skip check_cxx_source_compiles usage for openssl" + patch_type: "conan" + - patch_file: "patches/0006-json.patch" + patch_description: "skip check_cxx_source_compiles usage for json-c" + patch_type: "conan" + - patch_file: "patches/0007-3.0.20-find-json.patch" + patch_description: "fix find_package for json-c" + patch_type: "conan" + - patch_file: "patches/0008-3.0.20-find-libuuid.patch" + patch_description: "fix find_package for libuuid" + patch_type: "conan" + "3.0.20": + - patch_file: "patches/0001-charls-linking.patch" + patch_description: "fix symbol export for gdcmcharls" + patch_type: "portability" + - patch_file: "patches/0002-3.0.20-openjpeg.patch" + patch_description: "fix variable names for openjpeg" + patch_type: "conan" + - patch_file: "patches/0004-3.0.20-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" + - patch_file: "patches/0005-3.0.20-openssl.patch" + patch_description: "skip check_cxx_source_compiles usage for openssl" + patch_type: "conan" + - patch_file: "patches/0006-json.patch" + patch_description: "skip check_cxx_source_compiles usage for json-c" + patch_type: "conan" + - patch_file: "patches/0007-3.0.20-find-json.patch" + patch_description: "fix find_package for json-c" + patch_type: "conan" + - patch_file: "patches/0008-3.0.20-find-libuuid.patch" + patch_description: "fix find_package for libuuid" + patch_type: "conan" + "3.0.9": + - patch_file: "patches/0001-charls-linking.patch" + patch_description: "fix symbol export for gdcmcharls" + patch_type: "portability" + - patch_file: "patches/0002-3.0.9-openjpeg.patch" + patch_description: "fix variable names for openjpeg" + patch_type: "conan" + - patch_file: "patches/0003-gcc-11-compilation.patch" + patch_description: "add missing includes for GCC 11" + patch_type: "portability" + patch_source: "https://github.com/malaterre/GDCM/commit/4404b770be337bd0d5d3c2289abfd34426433db2" + - patch_file: "patches/0004-3.0.9-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" + - patch_file: "patches/0005-3.0.9-openssl.patch" + patch_description: "skip check_cxx_source_compiles usage for openssl" + patch_type: "conan" + - patch_file: "patches/0006-json.patch" + patch_description: "skip check_cxx_source_compiles usage for json-c" + patch_type: "conan" + - patch_file: "patches/0007-3.0.9-find-json.patch" + patch_description: "fix find_package for json-c" + patch_type: "conan" + - patch_file: "patches/0008-3.0.9-find-libuuid.patch" + patch_description: "fix find_package for libuuid" + patch_type: "conan" diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py new file mode 100644 index 0000000000000..f32e56dd3a6fd --- /dev/null +++ b/recipes/gdcm/all/conanfile.py @@ -0,0 +1,250 @@ +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, valid_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, rm, rmdir, save +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version +import os +import textwrap + + +required_conan_version = ">=1.53.0" + + +class GDCMConan(ConanFile): + name = "gdcm" + package_type = "library" + description = "C++ library for DICOM medical files" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://gdcm.sourceforge.net/" + topics = ("dicom", "images", "medical-imaging") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_json": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_json": True, + "with_openssl": True, + } + + @property + def _min_cppstd(self): + return 11 + + 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("expat/2.5.0") + self.requires("openjpeg/2.5.0") + self.requires("zlib/1.2.13") + if self.settings.os != "Windows": + self.requires("libuuid/1.0.3") + if Version(self.version) >= Version("3.0.20"): + self.requires("libiconv/1.17") + if self.options.with_json: + self.requires("json-c/0.16") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if is_msvc_static_runtime(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared and static runtime together.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GDCM_BUILD_DOCBOOK_MANPAGES"] = False + tc.variables["GDCM_BUILD_SHARED_LIBS"] = bool(self.options.shared) + # FIXME: unvendor deps https://github.com/conan-io/conan-center-index/pull/5705#discussion_r647224146 + tc.variables["GDCM_USE_SYSTEM_EXPAT"] = True + tc.variables["GDCM_USE_SYSTEM_JSON"] = self.options.with_json + tc.variables["GDCM_USE_SYSTEM_OPENJPEG"] = True + tc.variables["GDCM_USE_SYSTEM_OPENSSL"] = self.options.with_openssl + tc.variables["GDCM_USE_SYSTEM_UUID"] = self.settings.os != "Windows" + tc.variables["GDCM_USE_SYSTEM_ZLIB"] = True + + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "CMake")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="Copyright.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + if self.settings.os == "Windows": + bin_dir = os.path.join(self.package_folder, "bin") + rm(self, "[!gs]*.dll", bin_dir) + rm(self, "*.pdb", bin_dir) + + rm(self, "[!U]*.cmake", os.path.join(self.package_folder, "lib", self._gdcm_subdir)) #leave UseGDCM.cmake untouched + rmdir(self, os.path.join(self.package_folder, "share")) + self._create_cmake_variables(os.path.join(self.package_folder, self._gdcm_cmake_variables_path)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets() + + def _create_cmake_variables(self, variables_file): + v = Version(self.version) + content = textwrap.dedent(f"""\ + # The GDCM version number. + set(GDCM_MAJOR_VERSION "{v.major}") + set(GDCM_MINOR_VERSION "{v.minor}") + set(GDCM_BUILD_VERSION "{v.patch}") + + get_filename_component(SELF_DIR "${{CMAKE_CURRENT_LIST_FILE}}" PATH) + + # The libraries. + set(GDCM_LIBRARIES "") + + # The CMake macros dir. + set(GDCM_CMAKE_DIR "") + + # The configuration options. + set(GDCM_BUILD_SHARED_LIBS "{"ON" if self.options.shared else "OFF"}") + + set(GDCM_USE_VTK "OFF") + + # The "use" file. + set(GDCM_USE_FILE ${{SELF_DIR}}/UseGDCM.cmake) + + # The VTK options. + set(GDCM_VTK_DIR "") + + get_filename_component(GDCM_INCLUDE_ROOT "${{SELF_DIR}}/../../include/{self._gdcm_subdir}" ABSOLUTE) + set(GDCM_INCLUDE_DIRS ${{GDCM_INCLUDE_ROOT}}) + get_filename_component(GDCM_LIB_ROOT "${{SELF_DIR}}/../../lib" ABSOLUTE) + set(GDCM_LIBRARY_DIRS ${{GDCM_LIB_ROOT}}) + """) + save(self, variables_file, content) + + def _create_cmake_module_alias_targets(self): + module_file = os.path.join(self.package_folder, self._gdcm_cmake_module_aliases_path) + targets = {library: f"GDCM::{library}" for library in self._gdcm_libraries} + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _gdcm_builddir(self): + return os.path.join("lib", self._gdcm_subdir) + + @property + def _gdcm_cmake_module_aliases_path(self): + return os.path.join("lib", self._gdcm_subdir, "conan-official-gdcm-targets.cmake") + + @property + def _gdcm_cmake_variables_path(self): + return os.path.join("lib", self._gdcm_subdir, "conan-official-gdcm-variables.cmake") + + @property + def _gdcm_build_modules(self): + return [self._gdcm_cmake_module_aliases_path, self._gdcm_cmake_variables_path] + + @property + def _gdcm_libraries(self): + gdcm_libs = ["gdcmcharls", + "gdcmCommon", + "gdcmDICT", + "gdcmDSED", + "gdcmIOD", + "gdcmjpeg12", + "gdcmjpeg16", + "gdcmjpeg8", + "gdcmMEXD", + "gdcmMSFF", + "socketxx"] + if self.settings.os == "Windows": + gdcm_libs.append("gdcmgetopt") + return gdcm_libs + + @property + def _gdcm_subdir(self): + v = Version(self.version) + return f"gdcm-{v.major}.{v.minor}" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "GDCM") + self.cpp_info.set_property("cmake_build_modules", [self._gdcm_cmake_variables_path]) + + for lib in self._gdcm_libraries: + self.cpp_info.components[lib].set_property("cmake_target_name", lib) + self.cpp_info.components[lib].libs = [lib] + self.cpp_info.components[lib].includedirs = [os.path.join("include", self._gdcm_subdir)] + self.cpp_info.components[lib].builddirs.append(self._gdcm_builddir) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[lib].build_modules["cmake"] = [self._gdcm_cmake_module_aliases_path] + self.cpp_info.components[lib].build_modules["cmake_find_package"] = self._gdcm_build_modules + self.cpp_info.components[lib].build_modules["cmake_find_package_multi"] = self._gdcm_build_modules + + if self.options.with_openssl: + self.cpp_info.components["gdcmCommon"].requires.append("openssl::openssl") + self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", "zlib::zlib"]) + self.cpp_info.components["gdcmIOD"].requires.extend(["gdcmDSED", "gdcmCommon", "expat::expat"]) + self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmIOD", "gdcmDSED", "gdcmDICT", "openjpeg::openjpeg"]) + if self.options.with_json: + self.cpp_info.components["gdcmMSFF"].requires.append("json-c::json-c") + if self.settings.os != "Windows": + self.cpp_info.components["gdcmMSFF"].requires.append("libuuid::libuuid") + if Version(self.version) >= Version("3.0.20"): + self.cpp_info.components["gdcmMSFF"].requires.append("libiconv::libiconv") + if not self.options.shared: + self.cpp_info.components["gdcmDICT"].requires.extend(["gdcmDSED", "gdcmIOD"]) + self.cpp_info.components["gdcmMEXD"].requires.extend(["gdcmMSFF", "gdcmDICT", "gdcmDSED", "gdcmIOD", "socketxx"]) + self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmjpeg8", "gdcmjpeg12", "gdcmjpeg16", "gdcmcharls"]) + + if self.settings.os == "Windows": + self.cpp_info.components["gdcmCommon"].system_libs = ["ws2_32", "crypt32"] + self.cpp_info.components["gdcmMSFF"].system_libs = ["rpcrt4"] + self.cpp_info.components["socketxx"].system_libs = ["ws2_32"] + else: + self.cpp_info.components["gdcmCommon"].system_libs = ["dl"] + if is_apple_os(self): + self.cpp_info.components["gdcmCommon"].frameworks = ["CoreFoundation"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "GDCM" + self.cpp_info.names["cmake_find_package_multi"] = "GDCM" diff --git a/recipes/gdcm/all/patches/0001-charls-linking.patch b/recipes/gdcm/all/patches/0001-charls-linking.patch new file mode 100644 index 0000000000000..57df8966f04ba --- /dev/null +++ b/recipes/gdcm/all/patches/0001-charls-linking.patch @@ -0,0 +1,38 @@ +--- a/Utilities/gdcmcharls/CMakeLists.txt ++++ b/Utilities/gdcmcharls/CMakeLists.txt +@@ -61,12 +61,10 @@ endif() + #option(charls_BUILD_SHARED_LIBS "Build CharLS with shared libraries." OFF) + #set(BUILD_SHARED_LIBS ${charls_BUILD_SHARED_LIBS}) + +-if(WIN32) +- if(BUILD_SHARED_LIBS) +- add_definitions(-DCHARLS_DLL_BUILD) +- else() +- add_definitions(-DCHARLS_STATIC) +- endif() ++if(BUILD_SHARED_LIBS) ++ add_definitions(-DCHARLS_DLL_BUILD) ++else() ++ add_definitions(-DCHARLS_STATIC) + endif() + + add_library(${CHARLS_LIBRARY_NAME} +--- a/Utilities/gdcmcharls/charls.h ++++ b/Utilities/gdcmcharls/charls.h +@@ -13,12 +13,12 @@ + #define CHARLS_IMEXPORT(returntype) __declspec(dllexport) returntype __stdcall + #endif + +-// Non-windows (static linking) +-#if !defined(CHARLS_IMEXPORT) && !defined(_WIN32) +-# define CHARLS_IMEXPORT(returntype) returntype ++// Non-windows (dynamic linking) ++#if !defined(WIN32) && (defined(CHARLS_DLL) || defined(CHARLS_DLL_BUILD)) ++#define CHARLS_IMEXPORT(returntype) __attribute__((visibility("default"))) returntype + #endif + +-// Windows static linking ++// Static linking + #if !defined(CHARLS_IMEXPORT) && defined(CHARLS_STATIC) + # define CHARLS_IMEXPORT(returntype) returntype + #endif diff --git a/recipes/gdcm/all/patches/0002-3.0.20-openjpeg.patch b/recipes/gdcm/all/patches/0002-3.0.20-openjpeg.patch new file mode 100644 index 0000000000000..59aa76d14cfc8 --- /dev/null +++ b/recipes/gdcm/all/patches/0002-3.0.20-openjpeg.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -360,7 +360,7 @@ endif() + + if(GDCM_USE_SYSTEM_OPENJPEG) + find_package(OpenJPEG 2.0.0 REQUIRED) +- set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) ++ set(GDCM_OPENJPEG_LIBRARIES ${OpenJPEG_LIBRARIES}) + else() + set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2) + endif() +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -161,7 +161,7 @@ else() + ) + endif() + if(GDCM_USE_SYSTEM_OPENJPEG) +- include_directories(${OPENJPEG_INCLUDE_DIRS} ) ++ include_directories(${OpenJPEG_INCLUDE_DIRS} ) + else() + include_directories( + "${GDCM_BINARY_DIR}/Utilities/gdcmopenjpeg" diff --git a/recipes/gdcm/all/patches/0002-3.0.9-openjpeg.patch b/recipes/gdcm/all/patches/0002-3.0.9-openjpeg.patch new file mode 100644 index 0000000000000..a85da145a8462 --- /dev/null +++ b/recipes/gdcm/all/patches/0002-3.0.9-openjpeg.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -364,7 +364,7 @@ endif() + + if(GDCM_USE_SYSTEM_OPENJPEG) + find_package(OpenJPEG 2.0.0 REQUIRED) +- set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) ++ set(GDCM_OPENJPEG_LIBRARIES ${OpenJPEG_LIBRARIES}) + else() + set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2) + endif() +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -149,7 +149,7 @@ else() + ) + endif() + if(GDCM_USE_SYSTEM_OPENJPEG) +- include_directories(${OPENJPEG_INCLUDE_DIRS} ) ++ include_directories(${OpenJPEG_INCLUDE_DIRS} ) + else() + include_directories( + "${GDCM_BINARY_DIR}/Utilities/gdcmopenjpeg" diff --git a/recipes/gdcm/all/patches/0003-gcc-11-compilation.patch b/recipes/gdcm/all/patches/0003-gcc-11-compilation.patch new file mode 100644 index 0000000000000..ff438c185dc4f --- /dev/null +++ b/recipes/gdcm/all/patches/0003-gcc-11-compilation.patch @@ -0,0 +1,68 @@ +From 4404b770be337bd0d5d3c2289abfd34426433db2 Mon Sep 17 00:00:00 2001 +From: Axel Braun +Date: Mon, 7 Jun 2021 16:27:52 +0200 +Subject: [PATCH] gdcm fails to build with gcc11 compiler + +gdcm fails to build with gcc11 compiler: +cd +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/build/Source/MediaStorageAndFileFormat +&& /usr/bin/c++ -DgdcmMSFF_EXPORTS +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/Common +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/build/Source/Common +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/DataStructureAndEncodingDefinition +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/DataDictionary +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/InformationObjectDefinition +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Utilities +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/build/Utilities +-I/usr/include/charls -I/usr/include/openjpeg-2.4 -I/usr/include/json-c +-I/usr/include/json -O2 -Wall -D_FORTIFY_SOURCE=2 +-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables +-fstack-clash-protection -Werror=return-type -flto=auto -g -fpermissive +-O2 -g -DNDEBUG -fPIC -MD -MT +Source/MediaStorageAndFileFormat/CMakeFiles/gdcmMSFF.dir/gdcmImageChangePhotometricInterpretation.cxx.o +-MF +CMakeFiles/gdcmMSFF.dir/gdcmImageChangePhotometricInterpretation.cxx.o.d +-o +CMakeFiles/gdcmMSFF.dir/gdcmImageChangePhotometricInterpretation.cxx.o +-c +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.cxx +[ 131s] In file included from +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.cxx:14: +[ 131s] +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h: +In function 'T gdcm::Clamp(int)': +[ 131s] +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:32: +error: 'numeric_limits' is not a member of 'std' +[ 131s] 67 | return v < 0 ? 0 : (v > std::numeric_limits::max() +? std::numeric_limits::max() : v); +--- + Source/MediaStorageAndFileFormat/gdcmImage.cxx | 1 + + .../gdcmImageChangePhotometricInterpretation.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/Source/MediaStorageAndFileFormat/gdcmImage.cxx b/Source/MediaStorageAndFileFormat/gdcmImage.cxx +index f59fdd7b7..78a1f7a5c 100644 +--- a/Source/MediaStorageAndFileFormat/gdcmImage.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmImage.cxx +@@ -20,6 +20,7 @@ + #include "gdcmFragment.h" + + #include ++#include + + namespace gdcm + { +diff --git a/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h b/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h +index d55a5ee47..798d3dfa6 100644 +--- a/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h ++++ b/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h +@@ -16,6 +16,7 @@ + + #include "gdcmImageToImageFilter.h" + #include "gdcmPhotometricInterpretation.h" ++#include + + namespace gdcm + { diff --git a/recipes/gdcm/all/patches/0004-3.0.20-find-expat.patch b/recipes/gdcm/all/patches/0004-3.0.20-find-expat.patch new file mode 100644 index 0000000000000..8922436502476 --- /dev/null +++ b/recipes/gdcm/all/patches/0004-3.0.20-find-expat.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -419,7 +419,7 @@ endif() + + if(GDCM_USE_SYSTEM_EXPAT) + # If user say so, then this is a requirement ! +- find_package(EXPAT REQUIRED) ++ find_package(EXPAT REQUIRED MODULE) + set(GDCM_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) + else() + set(GDCM_EXPAT_LIBRARIES "gdcmexpat") diff --git a/recipes/gdcm/all/patches/0004-3.0.9-find-expat.patch b/recipes/gdcm/all/patches/0004-3.0.9-find-expat.patch new file mode 100644 index 0000000000000..174d4de82d842 --- /dev/null +++ b/recipes/gdcm/all/patches/0004-3.0.9-find-expat.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -423,7 +423,7 @@ endif() + + if(GDCM_USE_SYSTEM_EXPAT) + # If user say so, then this is a requirement ! +- find_package(EXPAT REQUIRED) ++ find_package(EXPAT REQUIRED MODULE) + set(GDCM_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) + else() + set(GDCM_EXPAT_LIBRARIES "gdcmexpat") diff --git a/recipes/gdcm/all/patches/0005-3.0.20-openssl.patch b/recipes/gdcm/all/patches/0005-3.0.20-openssl.patch new file mode 100644 index 0000000000000..f66b7d5bc18bd --- /dev/null +++ b/recipes/gdcm/all/patches/0005-3.0.20-openssl.patch @@ -0,0 +1,23 @@ +--- a/Source/Common/CMakeLists.txt ++++ b/Source/Common/CMakeLists.txt +@@ -68,18 +68,8 @@ CHECK_CXX_SOURCE_COMPILES( + "\#include \n#include \n#include \nint main() { std::u16string u16; std::string utf8 = std::wstring_convert, char16_t>{}.to_bytes(u16); }" + GDCM_HAVE_CODECVT) + if(GDCM_USE_SYSTEM_OPENSSL) +-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +-set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} +- ${CMAKE_DL_LIBS} # FIXME ?? +- ) +-CHECK_CXX_SOURCE_COMPILES( +- # "\#include \nint main() { CMS_add0_recipient_key(0); return 0;}" +- #HAVE_CMS_RECIPIENT_KEY) +- "\#include \nint main() { CMS_add0_recipient_password(0,0,0,0,0,0,0); return 0;}" +- GDCM_HAVE_CMS_RECIPIENT_PASSWORD) +-CHECK_CXX_SOURCE_COMPILES( +- "\#include \nint main() { const void*mem; int len; BIO_new_mem_buf(mem, len); }" +- OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF) ++ set(GDCM_HAVE_CMS_RECIPIENT_PASSWORD ON CACHE INTERNAL "") ++ set(OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF ON CACHE INTERNAL "") + endif() + + #----------------------------------------------------------------------------- diff --git a/recipes/gdcm/all/patches/0005-3.0.9-openssl.patch b/recipes/gdcm/all/patches/0005-3.0.9-openssl.patch new file mode 100644 index 0000000000000..fe118a13f6970 --- /dev/null +++ b/recipes/gdcm/all/patches/0005-3.0.9-openssl.patch @@ -0,0 +1,19 @@ +--- a/Source/Common/CMakeLists.txt ++++ b/Source/Common/CMakeLists.txt +@@ -65,15 +65,7 @@ CHECK_CXX_SOURCE_COMPILES( + "\#include \nint main() { const wchar_t fn[10] = {}; std::ifstream is( fn ); return 0;}" + GDCM_HAVE_WCHAR_IFSTREAM) + if(GDCM_USE_SYSTEM_OPENSSL) +-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +-set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} +- ${CMAKE_DL_LIBS} # FIXME ?? +- ) +-CHECK_CXX_SOURCE_COMPILES( +- # "\#include \nint main() { CMS_add0_recipient_key(0); return 0;}" +- #HAVE_CMS_RECIPIENT_KEY) +- "\#include \nint main() { CMS_add0_recipient_password(0,0,0,0,0,0,0); return 0;}" +- GDCM_HAVE_CMS_RECIPIENT_PASSWORD) ++ set(GDCM_HAVE_CMS_RECIPIENT_PASSWORD ON CACHE INTERNAL "") + endif() + + #----------------------------------------------------------------------------- diff --git a/recipes/gdcm/all/patches/0006-json.patch b/recipes/gdcm/all/patches/0006-json.patch new file mode 100644 index 0000000000000..5010643b169c4 --- /dev/null +++ b/recipes/gdcm/all/patches/0006-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_FUNCTION_EXISTS(gettimeofday 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/patches/0007-3.0.20-find-json.patch b/recipes/gdcm/all/patches/0007-3.0.20-find-json.patch new file mode 100644 index 0000000000000..5790521e58be6 --- /dev/null +++ b/recipes/gdcm/all/patches/0007-3.0.20-find-json.patch @@ -0,0 +1,45 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -426,7 +426,7 @@ else() + endif() + + if(GDCM_USE_SYSTEM_JSON) +- find_package(JSON REQUIRED) ++ find_package(json-c REQUIRED CONFIG) + endif() + if(GDCM_USE_SYSTEM_PAPYRUS3) + find_package(PAPYRUS3 REQUIRED) +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -187,11 +187,6 @@ else() + ) + set(GDCMUUID gdcmuuid) + endif() +-if(GDCM_USE_SYSTEM_JSON) +- include_directories( +- ${JSON_INCLUDE_DIRS} +- ) +-endif() + + add_library(gdcmMSFF ${MSFF_SRCS}) + # gdcmPVRGCodec calls gdcmjpeg +@@ -226,7 +221,7 @@ else() + target_link_libraries(gdcmMSFF LINK_PRIVATE ${GDCMUUID}) + endif() + if(GDCM_USE_SYSTEM_JSON) +- target_link_libraries(gdcmMSFF LINK_PRIVATE ${JSON_LIBRARIES}) ++ target_link_libraries(gdcmMSFF PRIVATE json-c::json-c) + endif() + if(UNIX) + find_package(Iconv) +--- a/Source/MediaStorageAndFileFormat/gdcmJSON.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmJSON.cxx +@@ -18,7 +18,7 @@ + #include "gdcmSystem.h" + + #ifdef GDCM_USE_SYSTEM_JSON +-#include ++#include + #endif + + #ifdef GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX diff --git a/recipes/gdcm/all/patches/0007-3.0.9-find-json.patch b/recipes/gdcm/all/patches/0007-3.0.9-find-json.patch new file mode 100644 index 0000000000000..1c072edc979dd --- /dev/null +++ b/recipes/gdcm/all/patches/0007-3.0.9-find-json.patch @@ -0,0 +1,45 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -430,7 +430,7 @@ else() + endif() + + if(GDCM_USE_SYSTEM_JSON) +- find_package(JSON REQUIRED) ++ find_package(json-c REQUIRED CONFIG) + endif() + if(GDCM_USE_SYSTEM_PAPYRUS3) + find_package(PAPYRUS3 REQUIRED) +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -175,11 +175,6 @@ else() + ) + set(GDCMUUID gdcmuuid) + endif() +-if(GDCM_USE_SYSTEM_JSON) +- include_directories( +- ${JSON_INCLUDE_DIRS} +- ) +-endif() + + add_library(gdcmMSFF ${MSFF_SRCS}) + # gdcmPVRGCodec calls gdcmjpeg +@@ -214,7 +209,7 @@ else() + target_link_libraries(gdcmMSFF LINK_PRIVATE ${GDCMUUID}) + endif() + if(GDCM_USE_SYSTEM_JSON) +- target_link_libraries(gdcmMSFF LINK_PRIVATE ${JSON_LIBRARIES}) ++ target_link_libraries(gdcmMSFF PRIVATE json-c::json-c) + endif() + # handling of static lib within shared is a mess: + #target_link_libraries(gdcmMSFF gdcmrle) +--- a/Source/MediaStorageAndFileFormat/gdcmJSON.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmJSON.cxx +@@ -18,7 +18,7 @@ + #include "gdcmSystem.h" + + #ifdef GDCM_USE_SYSTEM_JSON +-#include ++#include + #endif + + #ifdef GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX diff --git a/recipes/gdcm/all/patches/0008-3.0.20-find-libuuid.patch b/recipes/gdcm/all/patches/0008-3.0.20-find-libuuid.patch new file mode 100644 index 0000000000000..72cf47eea31a2 --- /dev/null +++ b/recipes/gdcm/all/patches/0008-3.0.20-find-libuuid.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -411,7 +411,7 @@ endif() + + if(GDCM_USE_SYSTEM_UUID) + # If user say so, then this is a requirement ! +- find_package(UUID REQUIRED) ++ find_package(libuuid REQUIRED) + set(GDCM_UUID_LIBRARIES ${UUID_LIBRARIES}) + else() + set(GDCM_UUID_LIBRARIES "gdcmuuid") +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -176,17 +176,6 @@ if(NOT GDCM_USE_SYSTEM_ZLIB) + "${GDCM_BINARY_DIR}/Utilities/gdcmzlib" + ) + endif() +-if(GDCM_USE_SYSTEM_UUID) +- include_directories( +- ${UUID_INCLUDE_DIR} +- ) +- set(GDCMUUID ${UUID_LIBRARIES}) +-else() +- include_directories( +- "${GDCM_BINARY_DIR}/Utilities/gdcmuuid" # uuid_mangle.h +- ) +- set(GDCMUUID gdcmuuid) +-endif() + + add_library(gdcmMSFF ${MSFF_SRCS}) + # gdcmPVRGCodec calls gdcmjpeg +@@ -218,7 +207,7 @@ if(WIN32) + target_link_libraries(gdcmMSFF LINK_PRIVATE rpcrt4) + #endif() + else() +- target_link_libraries(gdcmMSFF LINK_PRIVATE ${GDCMUUID}) ++ target_link_libraries(gdcmMSFF LINK_PRIVATE libuuid::libuuid) + endif() + if(GDCM_USE_SYSTEM_JSON) + target_link_libraries(gdcmMSFF PRIVATE json-c::json-c) diff --git a/recipes/gdcm/all/patches/0008-3.0.9-find-libuuid.patch b/recipes/gdcm/all/patches/0008-3.0.9-find-libuuid.patch new file mode 100644 index 0000000000000..e455940c59566 --- /dev/null +++ b/recipes/gdcm/all/patches/0008-3.0.9-find-libuuid.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -415,7 +415,7 @@ endif() + + if(GDCM_USE_SYSTEM_UUID) + # If user say so, then this is a requirement ! +- find_package(UUID REQUIRED) ++ find_package(libuuid REQUIRED) + set(GDCM_UUID_LIBRARIES ${UUID_LIBRARIES}) + else() + set(GDCM_UUID_LIBRARIES "gdcmuuid") +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -164,17 +164,6 @@ if(NOT GDCM_USE_SYSTEM_ZLIB) + "${GDCM_BINARY_DIR}/Utilities/gdcmzlib" + ) + endif() +-if(GDCM_USE_SYSTEM_UUID) +- include_directories( +- ${UUID_INCLUDE_DIR} +- ) +- set(GDCMUUID ${UUID_LIBRARIES}) +-else() +- include_directories( +- "${GDCM_BINARY_DIR}/Utilities/gdcmuuid" # uuid_mangle.h +- ) +- set(GDCMUUID gdcmuuid) +-endif() + + add_library(gdcmMSFF ${MSFF_SRCS}) + # gdcmPVRGCodec calls gdcmjpeg +@@ -206,7 +195,7 @@ if(WIN32) + target_link_libraries(gdcmMSFF LINK_PRIVATE rpcrt4) + #endif() + else() +- target_link_libraries(gdcmMSFF LINK_PRIVATE ${GDCMUUID}) ++ target_link_libraries(gdcmMSFF LINK_PRIVATE libuuid::libuuid) + endif() + if(GDCM_USE_SYSTEM_JSON) + target_link_libraries(gdcmMSFF PRIVATE json-c::json-c) diff --git a/recipes/gdcm/all/test_package/CMakeLists.txt b/recipes/gdcm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5465ea8e54b6d --- /dev/null +++ b/recipes/gdcm/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(GDCM REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +include(${GDCM_USE_FILE}) +target_link_libraries(${PROJECT_NAME} PRIVATE gdcmMSFF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm b/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm new file mode 100644 index 0000000000000000000000000000000000000000..a38d4be8214fc72c76f4a6051f314e466ffbdcc5 GIT binary patch literal 3626 zcmc&$X;f2L5`L_KKuZ8wWJ`c(Xn~Nh%N7MxB0>-dVNsL-K~X?jwy=wuVb3DF5@?}8 zB#3}EAjl#+2zJ{*gDisJAfO;oS!A0RPM`VFXQtZ|wFz4zRA0pR~D z)_5yBevkt3v>?z4YJPwZAXxG=D17{&CgK$UELsw^y#Z3M;z zzzqGp3|%8bGzM*?tB1j0F=)NLEJGtBBVB#0FXWR372KopQKnSpMf&zFa z!g;(S0;DYh$o_{;L;(5!x)Tuq0azac01*HKINR~G1IUY~eLx<90LjT3;bT6 z*dH1JoF?$zF?(1Ta1_i1z)Ii!1rJ^Hzn@WE5WDX$uzG)i#e!Ja9%lp~3Cq!dI% zT2*vE_L!QC>>2e#x|WXDnY*t65nd%6uoJfnl;mCd^QfjwjQnD!L<$$@4!ST^%=|aW z_{GcwpDgN3?(D^j3XJ~4IwT67C?dXJ&RkZ4wX!qc(WO7Ep-!rF_qg^_Iq$9U^!0P^%uavm zQP;Y(B$Rx_lt#3CC6yxfo1Ok2!||+&8h+N+@o}))E}%hddz}6zgLy_~9Y}Ys6T1H4 zZk(vFZNg7^Ux!^kwwY%$z0(_RC^6Ma&4)cZBE(_xvr2V=6Lm`P!e;B8bd2d@J1gkE zVLB>2kk}Q|+pfEQg`u0+@ZjL3pyFQ>-Z1xTZqChpu867`=%21UIPu!T_LJwwaYiQ*IS>frJY(`uB(zPBjqtSX07oGK|{3k zsL4N1R7=J|(y9&dt3khCY(e&|Qf27zqDp!$L?i>U6|Z#TrNUDQY4;21^$T`za`jX1 z>i*xhLexrYQQa5Dd*nTFNUmVi_cI^9isot-yU7D76^Z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endif + +#ifdef GDCM_USE_SYSTEM_JSON +#include "gdcmJSON.h" +void test_json_link() +{ + gdcm::JSON json; + json.PrettyPrintOn(); +} +#endif + +bool test_uid() +{ + 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"; + 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/CMakeLists.txt b/recipes/gdcm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gdcm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gdcm/all/test_v1_package/conanfile.py b/recipes/gdcm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a38d3dbb55dca --- /dev/null +++ b/recipes/gdcm/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +from conan.tools.files import mkdir +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") + 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) diff --git a/recipes/gdcm/config.yml b/recipes/gdcm/config.yml new file mode 100644 index 0000000000000..868e7933ac4a6 --- /dev/null +++ b/recipes/gdcm/config.yml @@ -0,0 +1,7 @@ +versions: + "3.0.21": + folder: "all" + "3.0.20": + folder: "all" + "3.0.9": + folder: "all" diff --git a/recipes/gdk-pixbuf/all/conandata.yml b/recipes/gdk-pixbuf/all/conandata.yml new file mode 100644 index 0000000000000..d321370ee9136 --- /dev/null +++ b/recipes/gdk-pixbuf/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.42.10": + url: "https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.10.tar.xz" + sha256: "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b" + "2.42.9": + url: "https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.9.tar.xz" + sha256: "28f7958e7bf29a32d4e963556d241d0a41a6786582ff6a5ad11665e0347fc962" + "2.42.8": + url: "https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.8.tar.xz" + sha256: "84acea3acb2411b29134b32015a5b1aaa62844b19c4b1ef8b8971c6b0759f4c6" + "2.42.6": + url: "https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.6.tar.xz" + sha256: "c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f" +patches: + "2.42.8": + - patch_file: "patches/define_dllmain_only_when_shared.patch" + patch_type: "portability" + patch_description: Disable relocation when built as a static libary on Windows + patch_source: "https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/136" diff --git a/recipes/gdk-pixbuf/all/conanfile.py b/recipes/gdk-pixbuf/all/conanfile.py new file mode 100644 index 0000000000000..fe76b0dd2bad4 --- /dev/null +++ b/recipes/gdk-pixbuf/all/conanfile.py @@ -0,0 +1,231 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import can_run +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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 +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + + +class GdkPixbufConan(ConanFile): + name = "gdk-pixbuf" + description = "toolkit for image loading and pixel buffer manipulation" + topics = ("gdk-pixbuf", "image") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://developer.gnome.org/gdk-pixbuf/" + license = "LGPL-2.1-or-later" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libpng": [True, False], + "with_libtiff": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg", False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libpng": True, + "with_libtiff": True, + "with_libjpeg": "libjpeg", + "with_introspection": False, + } + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + 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") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.options.shared: + wildcard = "" if Version(conan_version) < "2.0.0" else "/*" + self.options[f"glib{wildcard}"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.76.0", transitive_headers=True, transitive_libs=True, run=can_run(self)) + if self.options.with_libpng: + self.requires("libpng/1.6.39") + if self.options.with_libtiff: + self.requires("libtiff/4.4.0") + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + + def validate(self): + if self.options.shared and not self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if self.settings.os == "Macos": + # when running gdk-pixbuf-query-loaders + # dyld: malformed mach-o: load commands size (97560) > 32768 + raise ConanInvalidConfiguration("This package does not support Macos currently") + if self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if not can_run(self): + self.tool_requires("glib/2.76.0") + if self.options.with_introspection: + self.tool_requires("gobject-introspection/1.72.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _requires_compiler_rt(self): + return self.settings.compiler == "clang" and Version(self.settings.compiler.version) <= "12" and self.settings.build_type == "Debug" + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + deps = PkgConfigDeps(self) + deps.generate() + + tc = MesonToolchain(self) + enabled_disabled = lambda v: "enabled" if v else "disabled" + true_false = lambda v: "true" if v else "false" + tc.project_options.update({ + "builtin_loaders": "all", + "gio_sniffing": "false", + "introspection": enabled_disabled(self.options.with_introspection), + "docs": "false", + "man": "false", + "installed_tests": "false" + }) + if Version(self.version) < "2.42.0": + tc.project_options["gir"] = "false" + + if Version(self.version) >= "2.42.8": + tc.project_options.update({ + "png": enabled_disabled(self.options.with_libpng), + "tiff": enabled_disabled(self.options.with_libtiff), + "jpeg": enabled_disabled(self.options.with_libjpeg) + }) + else: + tc.project_options.update({ + "png": true_false(self.options.with_libpng), + "tiff": true_false(self.options.with_libtiff), + "jpeg": true_false(self.options.with_libjpeg) + }) + + # Workaround for https://bugs.llvm.org/show_bug.cgi?id=16404 + # Only really for the purposes of building on CCI - end users can + # workaround this by appropriately setting global linker flags in their profile + if self._requires_compiler_rt: + tc.c_link_args.append("-rtlib=compiler-rt") + 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')", "#subdir('tests')") + replace_in_file(self, meson_build, "subdir('thumbnailer')", "#subdir('thumbnailer')") + replace_in_file(self, meson_build, + "gmodule_dep.get_variable(pkgconfig: 'gmodule_supported')" if Version(self.version) >= "2.42.6" + else "gmodule_dep.get_pkgconfig_variable('gmodule_supported')", "'true'") + # workaround https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/203 + if Version(self.version) >= "2.42.6": + replace_in_file(self, os.path.join(self.source_folder, "build-aux", "post-install.py"), + "close_fds=True", "close_fds=(sys.platform != 'win32')") + if Version(self.version) >= "2.42.9": + replace_in_file(self, meson_build, "is_msvc_like ? 'png' : 'libpng'", "'libpng'") + replace_in_file(self, meson_build, "is_msvc_like ? 'jpeg' : 'libjpeg'", "'libjpeg'") + replace_in_file(self, meson_build, "is_msvc_like ? 'tiff' : 'libtiff-4'", "'libtiff-4'") + + def build(self): + self._patch_sources() + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "gdk-pixbuf-2.0") + self.cpp_info.libs = ["gdk_pixbuf-2.0"] + self.cpp_info.includedirs = [os.path.join("include", "gdk-pixbuf-2.0")] + if not self.options.shared: + self.cpp_info.defines.append("GDK_PIXBUF_STATIC_COMPILATION") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if self._requires_compiler_rt: + ldflags = ["-rtlib=compiler-rt"] + self.cpp_info.exelinkflags = ldflags + self.cpp_info.sharedlinkflags = ldflags + + pkgconfig_variables = { + "bindir": "${prefix}/bin", + "gdk_pixbuf_binary_version": "2.10.0", + "gdk_pixbuf_binarydir": "${libdir1}/gdk-pixbuf-2.0/2.10", + "gdk_pixbuf_moduledir": "${gdk_pixbuf_binarydir}/loaders", + "gdk_pixbuf_cache_file": "${gdk_pixbuf_binarydir}/loaders.cache", + "gdk_pixbuf_csource": "${bindir}/gdk-pixbuf-csource", + "gdk_pixbuf_pixdata": "${bindir}/gdk-pixbuf-pixdata", + "gdk_pixbuf_query_loaders": "${bindir}/gdk-pixbuf-query-loaders" + } + self.cpp_info.set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) + + gdk_pixbuf_pixdata = os.path.join(self.package_folder, "bin", "gdk-pixbuf-pixdata") + self.runenv_info.define_path("GDK_PIXBUF_PIXDATA", gdk_pixbuf_pixdata) + self.env_info.GDK_PIXBUF_PIXDATA = gdk_pixbuf_pixdata # remove in conan v2? + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/gdk-pixbuf/all/patches/define_dllmain_only_when_shared.patch b/recipes/gdk-pixbuf/all/patches/define_dllmain_only_when_shared.patch new file mode 100644 index 0000000000000..27d2f92f061eb --- /dev/null +++ b/recipes/gdk-pixbuf/all/patches/define_dllmain_only_when_shared.patch @@ -0,0 +1,63 @@ +commit 9521539021d6c8e57fd40d1bf0ff34abf2edbd6b +Author: Hesham Essam +Date: Fri Jun 3 13:29:28 2022 +0200 + + Enable static builds on Windows + +diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c +index 182781178..e207d8143 100644 +--- a/gdk-pixbuf/gdk-pixbuf-io.c ++++ b/gdk-pixbuf/gdk-pixbuf-io.c +@@ -182,6 +182,8 @@ get_file_formats (void) + return file_formats; + } + ++#ifdef GDK_PIXBUF_RELOCATABLE // implies that gdk-pixbuf is built as a dll on windows ++ + #ifdef G_OS_WIN32 + + /* DllMain function needed to tuck away the gdk-pixbuf DLL handle */ +@@ -203,9 +205,6 @@ DllMain (HINSTANCE hinstDLL, + } + #endif + +- +-#ifdef GDK_PIXBUF_RELOCATABLE +- + gchar * + gdk_pixbuf_get_toplevel (void) + { +diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c +index ddcae7b6f..1d39b442e 100644 +--- a/gdk-pixbuf/queryloaders.c ++++ b/gdk-pixbuf/queryloaders.c +@@ -280,7 +280,7 @@ query_module (GString *contents, const char *dir, const char *file) + g_free (path); + } + +-#ifdef G_OS_WIN32 ++#if defined(G_OS_WIN32) && defined(GDK_PIXBUF_RELOCATABLE) + + static char * + get_libdir (void) +diff --git a/meson.build b/meson.build +index ed82464e4..6b123847f 100644 +--- a/meson.build ++++ b/meson.build +@@ -382,7 +382,7 @@ endif + # Determine whether we enable application bundle relocation support, and we use + # this always on Windows + if host_system == 'windows' +- relocatable = true ++ relocatable = (get_option('default_library') != 'static') + else + relocatable = get_option('relocatable') + endif +@@ -445,6 +445,6 @@ summary('MediaLib', use_medialib, section: 'Build') + summary('Introspection', build_gir, section: 'Build') + summary('Documentation', build_docs, section: 'Build') + summary('Manual pages', get_option('man'), section: 'Build') +-summary('Relocatable', get_option('relocatable'), section: 'Build') ++summary('Relocatable', relocatable, section: 'Build') + summary('Installed tests', get_option('installed_tests'), section: 'Build') + diff --git a/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt b/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..66c6c2f99bdd2 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(gdk-pixbuf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} gdk-pixbuf::gdk-pixbuf) diff --git a/recipes/gdk-pixbuf/all/test_package/conanfile.py b/recipes/gdk-pixbuf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..77f365fc4d372 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run("gdk-pixbuf-pixdata -v", env="conanrun") diff --git a/recipes/gdk-pixbuf/all/test_package/test_package.c b/recipes/gdk-pixbuf/all/test_package/test_package.c new file mode 100644 index 0000000000000..74bab77ccac41 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include +#include "gdk-pixbuf/gdk-pixbuf.h" + +int main() +{ + GdkPixbuf *pixbuf; + printf("gdk-pixbuf version %s %d.%d.%d\n", gdk_pixbuf_version, gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version); + pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 100, 100); + + g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB); + g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8); + g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); + g_assert (gdk_pixbuf_get_n_channels (pixbuf) == 4); + + g_assert (gdk_pixbuf_get_width (pixbuf) == 100); + g_assert (gdk_pixbuf_get_height (pixbuf) == 100); + + g_object_unref(pixbuf); + return 0; +} diff --git a/recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt b/recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gdk-pixbuf/all/test_v1_package/conanfile.py b/recipes/gdk-pixbuf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..42f6f019466b0 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run("gdk-pixbuf-pixdata -v", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/gdk-pixbuf/config.yml b/recipes/gdk-pixbuf/config.yml new file mode 100644 index 0000000000000..5fd1bb955b361 --- /dev/null +++ b/recipes/gdk-pixbuf/config.yml @@ -0,0 +1,9 @@ +versions: + "2.42.10": + folder: all + "2.42.9": + folder: all + "2.42.8": + folder: all + "2.42.6": + folder: all diff --git a/recipes/gemmlowp/all/conandata.yml b/recipes/gemmlowp/all/conandata.yml new file mode 100644 index 0000000000000..5f6290c4c906d --- /dev/null +++ b/recipes/gemmlowp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210928": + url: "https://github.com/google/gemmlowp/archive/daf630d3d0c439dbe22229838a5ba1bc5f82908d.zip" + sha256: "7b48199021cfad7d06ea84b975b5ff3c259b8f7c0d3d289e0c99e1708704e6db" +patches: + "cci.20210928": + - patch_file: "patches/build-static-libraries.patch" diff --git a/recipes/gemmlowp/all/conanfile.py b/recipes/gemmlowp/all/conanfile.py new file mode 100644 index 0000000000000..b8480392b1dd3 --- /dev/null +++ b/recipes/gemmlowp/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class GemmlowpConan(ConanFile): + name = "gemmlowp" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/gemmlowp" + description = "Low-precision matrix multiplication" + topics = ("gemm", "matrix") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + 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(build_script_folder=os.path.join(self.source_folder, "contrib")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gemmlowp") + self.cpp_info.set_property("cmake_target_name", "gemmlowp::gemmlowp") + + self.cpp_info.components["eight_bit_int_gemm"].set_property("cmake_target_name", "gemmlowp::eight_bit_int_gemm") + self.cpp_info.components["eight_bit_int_gemm"].includedirs.append(os.path.join("include", "gemmlowp")) + self.cpp_info.components["eight_bit_int_gemm"].libs = ["eight_bit_int_gemm"] + if is_msvc(self): + self.cpp_info.components["eight_bit_int_gemm"].defines = ["NOMINMAX"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["eight_bit_int_gemm"].system_libs.extend(["pthread"]) diff --git a/recipes/gemmlowp/all/patches/build-static-libraries.patch b/recipes/gemmlowp/all/patches/build-static-libraries.patch new file mode 100644 index 0000000000000..67de837875aee --- /dev/null +++ b/recipes/gemmlowp/all/patches/build-static-libraries.patch @@ -0,0 +1,19 @@ +diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt +index d6833e8..e2932f8 100644 +--- a/contrib/CMakeLists.txt ++++ b/contrib/CMakeLists.txt +@@ -47,12 +47,8 @@ list(APPEND gemmlowp_test_headers ${gemmlowp_headers}) + file(GLOB fixedpoint_private_headers "${gemmlowp_src}/fixedpoint/*.h") + list(APPEND fixedpoint_private_headers "${gemmlowp_src}/internal/common.h") + +-# Eight bit int gemm library +-if(WIN32) +- add_library(eight_bit_int_gemm STATIC ${eight_bit_int_gemm_sources_with_no_headers}) +-else() +- add_library(eight_bit_int_gemm SHARED ${eight_bit_int_gemm_sources_with_no_headers}) +-endif() ++add_library(eight_bit_int_gemm ${eight_bit_int_gemm_sources_with_no_headers}) ++set_target_properties(eight_bit_int_gemm PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + target_link_libraries(eight_bit_int_gemm ${EXTERNAL_LIBRARIES}) + + # INTERFACE target to help header include diff --git a/recipes/gemmlowp/all/test_package/CMakeLists.txt b/recipes/gemmlowp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f1605354570fc --- /dev/null +++ b/recipes/gemmlowp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(gemmlowp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gemmlowp::gemmlowp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gemmlowp/all/test_package/conanfile.py b/recipes/gemmlowp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gemmlowp/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/gemmlowp/all/test_package/test_package.cpp b/recipes/gemmlowp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78f4042de621a --- /dev/null +++ b/recipes/gemmlowp/all/test_package/test_package.cpp @@ -0,0 +1,60 @@ +#include +#include +#include + +#include + +template +std::ostream& operator<<(std::ostream& s, + const gemmlowp::MatrixMap& m) { + for (int i = 0; i < m.rows(); i++) { + for (int j = 0; j < m.cols(); j++) { + if (j) { + s << '\t'; + } + s << static_cast(m(i, j)); + } + s << '\n'; + } + return s; +} + +int main() { + const int rows = 2; + const int cols = 3; + const auto kOrder = gemmlowp::MapOrder::RowMajor; + + std::array lhs{ + 1, 2, 3, + 4, 5, 6 + }; + + std::array rhs{ + 7, 8, + 9, 10, + 11, 12 + }; + + std::array result{}; + + const gemmlowp::MatrixMap lhs_map(lhs.data(), rows, cols); + const gemmlowp::MatrixMap rhs_map(rhs.data(), cols, rows); + std::cout << "LHS:\n " << lhs_map << "\n"; + std::cout << "RHS:\n " << rhs_map << "\n\n"; + gemmlowp::MatrixMap result_map(result.data(), rows, rows); + + gemmlowp::GemmContext gemm_context{}; + gemmlowp::Gemm( + &gemm_context, + lhs_map, + rhs_map, + &result_map, + 0, + 0, + 0, + 1, + 0); + + std::cout << "Result LHSxRHS: \n" << result_map << std::endl; + return 0; +} diff --git a/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt b/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gemmlowp/all/test_v1_package/conanfile.py b/recipes/gemmlowp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gemmlowp/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/gemmlowp/config.yml b/recipes/gemmlowp/config.yml new file mode 100644 index 0000000000000..5c798b981f84b --- /dev/null +++ b/recipes/gemmlowp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210928": + folder: "all" diff --git a/recipes/genie/all/conandata.yml b/recipes/genie/all/conandata.yml new file mode 100644 index 0000000000000..1b0883fe01d12 --- /dev/null +++ b/recipes/genie/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1141": + url: "https://github.com/bkaradzic/GENie/archive/44918162588e56512ddac6264b08ca6ba4e67468.zip" + sha256: "cadbdccf6c0931f10f1a17eae06f5776c5eb81db47e581a898158e882f354b3f" + "1157": + url: "https://github.com/bkaradzic/GENie/archive/5fecb127855ee069df345f20d17fea78220fee93.zip" + sha256: "88efc5d16665cbda9885d86b1665388e3307f0426df3da46c4598350caa893d9" + "1160": + url: "https://github.com/bkaradzic/GENie/archive/f9bd455a8439dbcb807816c0be9e4aedf5991bc3.zip" + sha256: "6fe7e2f0107c965ebe9d099b0168128dfcaee67d7368d4b15b42d80808e3d373" + "1170": + url: "https://github.com/bkaradzic/GENie/archive/22cc907a4351db46c55f73e6aa901f1b2f0c52ad.zip" + sha256: "C7691E50F8FB6F2346D0D3CEED14A26F9DE7AEE658CE30B61770F8BE87C1FE00" diff --git a/recipes/genie/all/conanfile.py b/recipes/genie/all/conanfile.py new file mode 100644 index 0000000000000..d29587bee35bc --- /dev/null +++ b/recipes/genie/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.tools.files import get, replace_in_file, copy +from conan.tools.build import cross_building +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import VCVars, is_msvc +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.apple import is_apple_os +import os + +required_conan_version = ">=1.51.3" + +class GenieConan(ConanFile): + name = "genie" + license = "BSD-3-clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bkaradzic/GENie" + description = "Project generator tool" + topics = ("genie", "project", "generator", "build", "build-systems") + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + # TODO: Remove for Conan v2 + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome") + + def build_requirements(self): + 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("cccl/1.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + @property + def _os(self): + if is_apple_os(self): + return "darwin" + return { + "Windows": "windows", + "Linux": "linux", + "FreeBSD": "bsd", + }[str(self.settings.os)] + + def _patch_compiler(self, cc, cxx): + replace_in_file(self, os.path.join(self.source_folder, "build", f"gmake.{self._os}", "genie.make"), "CC = gcc", f"CC = {cc}") + replace_in_file(self, os.path.join(self.source_folder, "build", f"gmake.{self._os}", "genie.make"), "CXX = g++", f"CXX = {cxx}") + + @property + def _genie_config(self): + return "debug" if self.settings.build_type == "Debug" else "release" + + def generate(self): + vbe = VirtualBuildEnv(self) + vbe.generate() + if is_msvc(self): + ms = VCVars(self) + ms.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if is_msvc(self): + self._patch_compiler("cccl", "cccl") + self.run("make", cwd=self.source_folder) + else: + cc = os.environ.get("CC") + cxx = os.environ.get("CXX") + if is_apple_os(self): + if not cc: + cc = "clang" + if not cxx: + cxx = "clang" + else: + if not cc: + cc = "clang" if self.settings.compiler == "clang" else "gcc" + if not cxx: + cxx = "clang++" if self.settings.compiler == "clang" else "g++" + self._patch_compiler(cc, cxx) + + autotools = Autotools(self) + autotools.make(args=[f"-C {self.source_folder}", f"OS={self._os}", f"config={self._genie_config}"]) + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + bin_ext = ".exe" if self.settings.os == "Windows" else "" + copy(self, pattern=f"genie{bin_ext}", src=os.path.join(self.source_folder, "bin", self._os), dst=os.path.join(self.package_folder, "bin")) + if self.settings.build_type == "Debug": + copy(self, pattern="*.lua", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder,"res")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + #TODO remove for conan v2 + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) + + if self.settings.build_type == "Debug": + resdir = os.path.join(self.package_folder, "res") + self.output.info(f"Appending PREMAKE_PATH environment variable: {resdir}") + self.env_info.PREMAKE_PATH.append(resdir) diff --git a/recipes/genie/all/test_package/conanfile.py b/recipes/genie/all/test_package/conanfile.py new file mode 100644 index 0000000000000..aeafeb9ac53d2 --- /dev/null +++ b/recipes/genie/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conan import ConanFile +from conan.tools.build import can_run + +required_conan_version = ">=1.49.0" + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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("genie ninja") diff --git a/recipes/genie/all/test_package/scripts/genie.lua b/recipes/genie/all/test_package/scripts/genie.lua new file mode 100644 index 0000000000000..4ffa82e43b5cb --- /dev/null +++ b/recipes/genie/all/test_package/scripts/genie.lua @@ -0,0 +1,23 @@ +newoption { + trigger = "to", + value = "path", + description = "Set the output location for the generated files" +} + +solution "test_package_sln" + configurations { + "Debug", + "Release", + } + + platforms { + "x32", + "x64", + "Native", + } + + language "C++" + + location (_WORKING_DIR) + +dofile "test_package.lua" diff --git a/recipes/genie/all/test_package/scripts/test_package.lua b/recipes/genie/all/test_package/scripts/test_package.lua new file mode 100644 index 0000000000000..7415d29d51726 --- /dev/null +++ b/recipes/genie/all/test_package/scripts/test_package.lua @@ -0,0 +1,8 @@ +project "test_package" + targetname "test_package" + language "C++" + kind "ConsoleApp" + files { + "../test_package.cpp", + } + location (_WORKING_DIR) diff --git a/recipes/genie/all/test_package/test_package.cpp b/recipes/genie/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..564c85c3b236f --- /dev/null +++ b/recipes/genie/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() +{ + return 0; +} diff --git a/recipes/genie/all/test_v1_package/conanfile.py b/recipes/genie/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..00bbdee2789b3 --- /dev/null +++ b/recipes/genie/all/test_v1_package/conanfile.py @@ -0,0 +1,11 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("genie ninja", run_environment=True, cwd=os.path.join(self.source_folder, "..", "test_package")) diff --git a/recipes/genie/config.yml b/recipes/genie/config.yml new file mode 100644 index 0000000000000..f8c262eda3d07 --- /dev/null +++ b/recipes/genie/config.yml @@ -0,0 +1,9 @@ +versions: + "1141": + folder: "all" + "1157": + folder: "all" + "1160": + folder: "all" + "1170": + folder: "all" diff --git a/recipes/geographiclib/all/conandata.yml b/recipes/geographiclib/all/conandata.yml new file mode 100644 index 0000000000000..d77a331b2e16a --- /dev/null +++ b/recipes/geographiclib/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.52": + url: "https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.52.tar.gz" + sha256: "5d4145cd16ebf51a2ff97c9244330a340787d131165cfd150e4b2840c0e8ac2b" + "1.51": + url: "https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.51.tar.gz" + sha256: "34370949617df5105bd6961e0b91581aef758dc455fe8629eb5858516022d310" + "1.50.1": + url: "https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.50.1.tar.gz" + sha256: "d1765009e068b8cc5e76957e5d6be45ce6cff08c4aad8e5995e84a28354385f1" +patches: + "1.52": + - patch_file: "patches/0002-cmake-minimum-required-1.52.patch" + patch_description: "Add cmake_minimum_required() to top CMakeLists" + patch_type: "conan" + patch_source: "https://github.com/geographiclib/geographiclib/commit/d9ca6c6ec0b721326b9a690eee259eac643b927f" + "1.51": + - patch_file: "patches/0002-cmake-minimum-required-1.51.patch" + patch_description: "Add cmake_minimum_required() to top CMakeLists" + patch_type: "conan" + patch_source: "https://github.com/geographiclib/geographiclib/commit/d9ca6c6ec0b721326b9a690eee259eac643b927f" + "1.50.1": + - patch_file: "patches/0001-streamoff.patch" + - patch_file: "patches/0002-cmake-minimum-required-1.50.1.patch" + patch_description: "Add cmake_minimum_required() to top CMakeLists" + patch_type: "conan" + patch_source: "https://github.com/geographiclib/geographiclib/commit/d9ca6c6ec0b721326b9a690eee259eac643b927f" diff --git a/recipes/geographiclib/all/conanfile.py b/recipes/geographiclib/all/conanfile.py new file mode 100644 index 0000000000000..d3a9097b7417e --- /dev/null +++ b/recipes/geographiclib/all/conanfile.py @@ -0,0 +1,148 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, + replace_in_file, rm, rmdir +) +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class GeographiclibConan(ConanFile): + name = "geographiclib" + description = "Convert geographic units and solve geodesic problems" + topics = ("geographiclib", "geodesic") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://geographiclib.sourceforge.io" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "precision": ["float", "double", "extended", "quadruple", "variable"], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "precision": "double", + "tools": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + @property + def _compilers_minimum_version(self): + # Minimum compiler version having C++11 math functions + return { + "apple-clang": "3.3", + "gcc": "4.9", + "clang": "6", + "Visual Studio": "14", # guess + "msvc": "190", + } + + def validate(self): + if Version(self.version) >= "1.51": + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++11 math functions, which your compiler does not support." + ) + + if self.options.precision not in ["float", "double"]: + # FIXME: add support for extended, quadruple and variable precisions + # (may require external libs: boost multiprecision for quadruple, mpfr for variable) + raise ConanInvalidConfiguration("extended, quadruple and variable precisions not yet supported in this recipe") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _cmake_option_precision(self): + return { + "float": 1, + "double": 2, + "extended": 3, + "quadruple": 4, + "variable": 5, + }.get(str(self.options.precision)) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GEOGRAPHICLIB_LIB_TYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.variables["GEOGRAPHICLIB_PRECISION"] = self._cmake_option_precision + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # it does not work on Windows but is not needed + 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}", "") + + def build(self): + self._patch_sources() + 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() + for folder in [ + "share", "sbin", "python", "matlab", "doc", "cmake", + os.path.join("lib", "python"), + os.path.join("lib", "pkgconfig"), + os.path.join("lib", "cmake"), + ]: + rmdir(self, os.path.join(os.path.join(self.package_folder, folder))) + rm(self, "*.pdb", 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") + self.cpp_info.libs = collect_libs(self) + self.cpp_info.defines.append("GEOGRAPHICLIB_SHARED_LIB={}".format("1" if self.options.shared else "0")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "geographiclib" + self.cpp_info.filenames["cmake_find_package_multi"] = "geographiclib" + self.cpp_info.names["cmake_find_package"] = "GeographicLib" + self.cpp_info.names["cmake_find_package_multi"] = "GeographicLib" + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/geographiclib/all/patches/0001-streamoff.patch b/recipes/geographiclib/all/patches/0001-streamoff.patch new file mode 100644 index 0000000000000..203a1711939ec --- /dev/null +++ b/recipes/geographiclib/all/patches/0001-streamoff.patch @@ -0,0 +1,38 @@ +--- a/src/SphericalEngine.cpp ++++ b/src/SphericalEngine.cpp +@@ -134,6 +134,8 @@ + #include + #include + ++#include ++ + #if defined(_MSC_VER) + // Squelch warnings about constant conditional expressions and potentially + // uninitialized local variables +@@ -409,22 +411,22 @@ namespace GeographicLib { + SphericalEngine::coeff::Csize(N0, M )) * sizeof(double); + if (N == N0) { + Utility::readarray(stream, C); +- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); ++ if (skip) stream.seekg(streamoff(skip), ios::cur); + Utility::readarray(stream, S); +- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); ++ if (skip) stream.seekg(streamoff(skip), ios::cur); + } else { + for (int m = 0, k = 0; m <= M; ++m) { + Utility::readarray(stream, &C[k], N + 1 - m); + stream.seekg((N0 - N) * sizeof(double), ios::cur); + k += N + 1 - m; + } +- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); ++ if (skip) stream.seekg(streamoff(skip), ios::cur); + for (int m = 1, k = 0; m <= M; ++m) { + Utility::readarray(stream, &S[k], N + 1 - m); + stream.seekg((N0 - N) * sizeof(double), ios::cur); + k += N + 1 - m; + } +- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); ++ if (skip) stream.seekg(streamoff(skip), ios::cur); + } + return; + } diff --git a/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.50.1.patch b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.50.1.patch new file mode 100644 index 0000000000000..b288ab87c7f7a --- /dev/null +++ b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.50.1.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,4 @@ ++cmake_minimum_required (VERSION 3.13.0) + project (GeographicLib) + + # Version information +@@ -47,7 +48,6 @@ set (LIBVERSION_BUILD 19.0.1) + string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) + +-cmake_minimum_required (VERSION 3.1.0) # This version was released 2014-12-15 + + # User-settable variables + diff --git a/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.51.patch b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.51.patch new file mode 100644 index 0000000000000..1919e3213be84 --- /dev/null +++ b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.51.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,4 @@ ++cmake_minimum_required (VERSION 3.13.0) + project (GeographicLib) + + # Version information +@@ -47,7 +48,6 @@ set (LIBVERSION_BUILD 19.1.0) + string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) + +-cmake_minimum_required (VERSION 3.7.0) # This version was released 2016-11-11 + + # User-settable variables + diff --git a/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch new file mode 100644 index 0000000000000..7f25113816c11 --- /dev/null +++ b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,4 @@ ++cmake_minimum_required (VERSION 3.13.0) + project (GeographicLib) + + # Version information +@@ -47,7 +48,6 @@ set (LIBVERSION_BUILD 19.2.0) + string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) + +-cmake_minimum_required (VERSION 3.7.0) # This version was released 2016-11-11 + + # User-settable variables + diff --git a/recipes/geographiclib/all/test_package/CMakeLists.txt b/recipes/geographiclib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..91e2ed38f5138 --- /dev/null +++ b/recipes/geographiclib/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(geographiclib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE GeographicLib::GeographicLib) + +if(geographiclib_VERSION VERSION_GREATER_EQUAL "1.51") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/geographiclib/all/test_package/conanfile.py b/recipes/geographiclib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/geographiclib/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/geographiclib/all/test_package/test_package.cpp b/recipes/geographiclib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8bf60a884c336 --- /dev/null +++ b/recipes/geographiclib/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +#include + +int main() +{ + const GeographicLib::Geodesic& geod = GeographicLib::Geodesic::WGS84(); + GeographicLib::Math::real lat1 = 40.6, lon1 = -73.8; // JFK Airport + GeographicLib::Math::real lat2 = 51.6, lon2 = -0.5; // LHR Airport + GeographicLib::Math::real s12; + + geod.Inverse(lat1, lon1, lat2, lon2, s12); + std::cout << "The distance from JFK to LHR is " << s12 / 1000 << " km\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/geographiclib/all/test_v1_package/CMakeLists.txt b/recipes/geographiclib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/geographiclib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/geographiclib/all/test_v1_package/conanfile.py b/recipes/geographiclib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/geographiclib/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/geographiclib/config.yml b/recipes/geographiclib/config.yml new file mode 100644 index 0000000000000..6c3b63fe79e7e --- /dev/null +++ b/recipes/geographiclib/config.yml @@ -0,0 +1,7 @@ +versions: + "1.52": + folder: all + "1.51": + folder: all + "1.50.1": + folder: all diff --git a/recipes/geos/all/conandata.yml b/recipes/geos/all/conandata.yml new file mode 100644 index 0000000000000..dce86864c12ad --- /dev/null +++ b/recipes/geos/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.11.2": + url: "https://github.com/libgeos/geos/releases/download/3.11.2/geos-3.11.2.tar.bz2" + sha256: "b1f077669481c5a3e62affc49e96eb06f281987a5d36fdab225217e5b825e4cc" + "3.11.1": + url: "https://github.com/libgeos/geos/releases/download/3.11.1/geos-3.11.1.tar.bz2" + sha256: "be83ed195ffb82373710c90befc580911ea0eb57003a2d703e30101c5b262f62" + "3.11.0": + url: "https://github.com/libgeos/geos/releases/download/3.11.0/geos-3.11.0.tar.bz2" + sha256: "79ab8cabf4aa8604d161557b52e3e4d84575acdc0d08cb09ab3f7aaefa4d858a" + "3.10.3": + url: "https://download.osgeo.org/geos/geos-3.10.3.tar.bz2" + sha256: "3c141b07d61958a758345d5f54e3c735834b2f4303edb9f67fb26914f0d44770" + "3.10.2": + url: "https://download.osgeo.org/geos/geos-3.10.2.tar.bz2" + sha256: "50bbc599ac386b4c2b3962dcc411f0040a61f204aaef4eba7225ecdd0cf45715" diff --git a/recipes/geos/all/conanfile.py b/recipes/geos/all/conanfile.py new file mode 100644 index 0000000000000..7238296e0a1c1 --- /dev/null +++ b/recipes/geos/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class GeosConan(ConanFile): + name = "geos" + description = "C++11 library for performing operations on two-dimensional vector geometries" + license = "LGPL-2.1" + topics = ("osgeo", "geometry", "topology", "geospatial") + homepage = "https://trac.osgeo.org/geos" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "inline": [True, False], + "utils": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "inline": True, + "utils": True, + } + + @property + def _has_inline_option(self): + return Version(self.version) < "3.11.0" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_inline_option: + del self.options.inline + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "3.11.0": + # these 2 options are declared before project() in geos < 3.11.0 + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["BUILD_BENCHMARKS"] = False + else: + tc.variables["BUILD_BENCHMARKS"] = False + if self._has_inline_option: + tc.variables["DISABLE_GEOS_INLINE"] = not self.options.inline + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["BUILD_ASTYLE"] = False + tc.variables["BUILD_GEOSOP"] = self.options.utils + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + copy(self, "geos.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + 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", "geos") + # Avoid to create unwanted geos::geos target + # (geos_c component overrides this global target and it's fine since it depends on all other components) + self.cpp_info.set_property("cmake_target_name", "GEOS::geos_c") + self.cpp_info.set_property("pkg_config_name", "geos") + + self.cpp_info.filenames["cmake_find_package"] = "geos" + self.cpp_info.filenames["cmake_find_package_multi"] = "geos" + self.cpp_info.names["cmake_find_package"] = "GEOS" + self.cpp_info.names["cmake_find_package_multi"] = "GEOS" + + # GEOS::geos_cxx_flags + self.cpp_info.components["geos_cxx_flags"].set_property("cmake_target_name", "GEOS::geos_cxx_flags") + self.cpp_info.components["geos_cxx_flags"].defines.append("USE_UNSTABLE_GEOS_CPP_API") + if self.options.get_safe("inline"): + self.cpp_info.components["geos_cxx_flags"].defines.append("GEOS_INLINE") + if self.settings.os == "Windows": + self.cpp_info.components["geos_cxx_flags"].defines.append("TTMATH_NOASM") + + # GEOS::geos + self.cpp_info.components["geos_cpp"].set_property("cmake_target_name", "GEOS::geos") + self.cpp_info.components["geos_cpp"].names["cmake_find_package"] = "geos" + self.cpp_info.components["geos_cpp"].names["cmake_find_package_multi"] = "geos" + self.cpp_info.components["geos_cpp"].libs = ["geos"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["geos_cpp"].system_libs.append("m") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["geos_cpp"].system_libs.append(libcxx) + self.cpp_info.components["geos_cpp"].requires = ["geos_cxx_flags"] + + # GEOS::geos_c + self.cpp_info.components["geos_c"].set_property("cmake_target_name", "GEOS::geos_c") + self.cpp_info.components["geos_c"].libs = ["geos_c"] + self.cpp_info.components["geos_c"].requires = ["geos_cpp"] + + if self.options.utils: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/geos/all/test_package/CMakeLists.txt b/recipes/geos/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18b308026f83b --- /dev/null +++ b/recipes/geos/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(geos CONFIG REQUIRED geos_c) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GEOS::geos_c) diff --git a/recipes/geos/all/test_package/conanfile.py b/recipes/geos/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/geos/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/geos/all/test_package/test_package.c b/recipes/geos/all/test_package/test_package.c new file mode 100644 index 0000000000000..d5eb60e7d8311 --- /dev/null +++ b/recipes/geos/all/test_package/test_package.c @@ -0,0 +1,37 @@ +#include + +#include +#include +#include + +void notice(const char *fmt, ...) { + va_list ap; + + fprintf(stdout, "NOTICE: "); + + va_start(ap, fmt); + vfprintf(stdout, fmt, ap); + va_end(ap); + fprintf(stdout, "\n"); +} + +void log_and_exit(const char *fmt, ...) { + va_list ap; + + fprintf(stdout, "ERROR: "); + + va_start(ap, fmt); + vfprintf(stdout, fmt, ap); + va_end(ap); + fprintf(stdout, "\n"); + exit(1); +} + +int main() { + initGEOS(notice, log_and_exit); + printf("GEOS version %s\n", GEOSversion()); + + finishGEOS(); + + return EXIT_SUCCESS; +} diff --git a/recipes/geos/all/test_v1_package/CMakeLists.txt b/recipes/geos/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/geos/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/geos/all/test_v1_package/conanfile.py b/recipes/geos/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/geos/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/geos/config.yml b/recipes/geos/config.yml new file mode 100644 index 0000000000000..aad029ca82e11 --- /dev/null +++ b/recipes/geos/config.yml @@ -0,0 +1,11 @@ +versions: + "3.11.2": + folder: all + "3.11.1": + folder: all + "3.11.0": + folder: all + "3.10.3": + folder: all + "3.10.2": + folder: all diff --git a/recipes/geotrans/all/CMakeLists.txt b/recipes/geotrans/all/CMakeLists.txt new file mode 100644 index 0000000000000..70f2583ebeb4e --- /dev/null +++ b/recipes/geotrans/all/CMakeLists.txt @@ -0,0 +1,76 @@ +cmake_minimum_required(VERSION 3.8) +project(geotrans LANGUAGES CXX) + +#### +# Directories +#### + +set(DTCCDIR "${GEOTRANS_SRC_DIR}/CCS/src/dtcc/CoordinateSystems") +set(CCSERVICEDIR "${GEOTRANS_SRC_DIR}/CCS/src") +set(SRCDIR "${GEOTRANS_SRC_DIR}/GEOTRANS3/java_gui/geotrans3/jni") + +#### +# Sources +#### +file(GLOB_RECURSE DTCCSRCS "${DTCCDIR}/*.cpp") +set(CCSSRCS "${CCSERVICEDIR}/CoordinateConversion/CoordinateConversionService.cpp") +file(GLOB_RECURSE CCSERVICESRCS "${CCSERVICEDIR}/dtcc/*.cpp") +list(FILTER CCSERVICESRCS EXCLUDE REGEX ".*${DTCCDIR}.*") +set(SRCS "${SRCDIR}/strtoval.cpp" "${SRCDIR}/fiomeths.cpp") + +#### +# Includes +#### + +# Construct DTCC includes +file(GLOB_RECURSE DTCC_HEADERS "${DTCCDIR}/*.h") +set(DTTCINCS "") +foreach(file ${DTCC_HEADERS}) + get_filename_component(DIR_PATH ${file} PATH) + set(DTTCINCS ${DTTCINCS} ${DIR_PATH}) +endforeach() +list(REMOVE_DUPLICATES DTTCINCS) + +# Construct CCS includes. This is all headers not in DTTCINCS +file(GLOB_RECURSE CCS_HEADERS "${CCSERVICEDIR}/*.h") +set(INCS ${SRCDIR}) +foreach(file ${CCS_HEADERS}) + get_filename_component(DIR_PATH ${file} PATH) + set(INCS ${INCS} ${DIR_PATH}) +endforeach() +list(REMOVE_DUPLICATES INCS) +list(FILTER INCS EXCLUDE REGEX ".*${DTCCDIR}.*") + +set(PUBLIC_HEADERS ${DTTC_HEADERS} ${CCS_HEADERS}) + +#### +# Dependencies +#### + +find_package(Threads REQUIRED) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# Create libMSPdtcc +add_library(MSPdtcc ${DTCCSRCS} ${CCSERVICESRCS}) +target_compile_features(MSPdtcc PUBLIC cxx_std_11) +if (WIN32) + add_compile_definitions(MSPdtcc PRIVATE LITTLE_ENDIAN=1) +endif(WIN32) +target_include_directories(MSPdtcc PUBLIC include ${DTTCINCS} ${INCS}) +set_target_properties(MSPdtcc PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +target_link_libraries(MSPdtcc PRIVATE Threads::Threads) + +# Create libMSPCoordinateConversionService +add_library(MSPCoordinateConversionService ${CCSSRCS} ${CCSERVICESRCS}) +target_compile_features(MSPCoordinateConversionService PUBLIC cxx_std_11) +target_include_directories(MSPCoordinateConversionService PUBLIC include ${DTTCINCS} ${INCS}) +set_target_properties(MSPCoordinateConversionService PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +target_link_libraries(MSPCoordinateConversionService PUBLIC MSPdtcc) + +include(GNUInstallDirs) +install(TARGETS MSPdtcc MSPCoordinateConversionService + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +install(DIRECTORY "${GEOTRANS_SRC_DIR}/data/" DESTINATION res) diff --git a/recipes/geotrans/all/conandata.yml b/recipes/geotrans/all/conandata.yml new file mode 100644 index 0000000000000..2b4068a9ac96e --- /dev/null +++ b/recipes/geotrans/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "3.9": + url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/geotrans/geotrans-3.9.tgz" + sha256: "06712b1c52e0a321bad1b5e6b38babbdbfd89f709669a238644fd878e8ccb4f2" + "3.8": + url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/geotrans/geotrans-3.8.tgz" + sha256: "baa72d3b1ae12f237a8ad30f2deb3fed2b80feb759528ea0a72b4b42cb77c565" +patches: + "3.9": + - patch_file: "patches/3.x-fix-for-cxx20.patch" + "3.8": + - patch_file: "patches/3.x-fix-for-cxx20.patch" diff --git a/recipes/geotrans/all/conanfile.py b/recipes/geotrans/all/conanfile.py new file mode 100644 index 0000000000000..416bae1b78a53 --- /dev/null +++ b/recipes/geotrans/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class GeotransConan(ConanFile): + name = "geotrans" + license = "NGA GEOTRANS ToS (https://earth-info.nga.mil/php/download.php?file=wgs-terms)" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://earth-info.nga.mil/" + description = "MSP GEOTRANS is the NGA and DOD approved coordinate converter and datum translator." + topics = ("geotrans", "geodesic", "geographic", "coordinate", "datum", "geodetic", "conversion", "transformation") + 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) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, filename=f"geotrans-{self.version}.tgz") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GEOTRANS_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "*.txt", + src=os.path.join(self.source_folder, "GEOTRANS3", "docs"), + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.components["dtcc"].libs = ["MSPdtcc"] + self.cpp_info.components["dtcc"].includedirs = [ + path[0] for path in os.walk("include") + ] + self.cpp_info.components["dtcc"].res = ["res"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["dtcc"].system_libs.append("pthread") + self.cpp_info.components["dtcc"].system_libs.append("m") + + self.cpp_info.components["ccs"].libs = ["MSPCoordinateConversionService"] + self.cpp_info.components["ccs"].requires = ["dtcc"] + self.cpp_info.components["ccs"].includedirs = [ + path[0] for path in os.walk("include") + ] + self.cpp_info.components["ccs"].res = ["res"] + + mspccs_data_path = os.path.join(self.package_folder, "res") + self.runenv_info.define_path("MSPCCS_DATA", mspccs_data_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.MSPCCS_DATA = mspccs_data_path diff --git a/recipes/geotrans/all/patches/3.x-fix-for-cxx20.patch b/recipes/geotrans/all/patches/3.x-fix-for-cxx20.patch new file mode 100644 index 0000000000000..c26083bb3f299 --- /dev/null +++ b/recipes/geotrans/all/patches/3.x-fix-for-cxx20.patch @@ -0,0 +1,15 @@ +Only in b/CCS/src/dtcc/CoordinateSystems/gars: .GARS.cpp.swp +diff -ru a/CCS/src/dtcc/CoordinateSystems/gars/GARS.cpp b/CCS/src/dtcc/CoordinateSystems/gars/GARS.cpp +--- a/CCS/src/dtcc/CoordinateSystems/gars/GARS.cpp 2019-05-09 08:43:20.000000000 +0800 ++++ b/CCS/src/dtcc/CoordinateSystems/gars/GARS.cpp 2022-06-23 08:04:37.949610100 +0800 +@@ -199,8 +199,8 @@ + char _15_minute_value_str[2] = ""; + char _5_minute_value_str[2] = ""; + double round_error = 5.0e-11; +- char* _15_minute_array[2][2] = {{"3", "1"}, {"4", "2"}}; +- char* _5_minute_array[3][3] = {{"7", "4", "1"}, {"8", "5", "2"}, {"9", "6", "3"}}; ++ const char* _15_minute_array[2][2] = {{"3", "1"}, {"4", "2"}}; ++ const char* _5_minute_array[3][3] = {{"7", "4", "1"}, {"8", "5", "2"}, {"9", "6", "3"}}; + double long_minutes, lat_minutes; + double long_remainder, lat_remainder; + long horiz_index_30, vert_index_30; diff --git a/recipes/geotrans/all/test_package/CMakeLists.txt b/recipes/geotrans/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e9431340ab31 --- /dev/null +++ b/recipes/geotrans/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(geotrans REQUIRED dtcc ccs CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE geotrans::dtcc geotrans::ccs) diff --git a/recipes/geotrans/all/test_package/conanfile.py b/recipes/geotrans/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/geotrans/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/geotrans/all/test_package/test_package.cpp b/recipes/geotrans/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dcdb44554da17 --- /dev/null +++ b/recipes/geotrans/all/test_package/test_package.cpp @@ -0,0 +1,576 @@ +// Classification : UNCLASSIFIED + +/****************************************************************************** +* Filename : testCoordinateConversionSample.h +* +* Copyright 2007 BAE Systems National Security Solutions Inc. 1989-2006 +* ALL RIGHTS RESERVED +* +* MODIFICATION HISTORY: +* +* DATE NAME DR# DESCRIPTION +* +* 05/12/10 S Gillis BAEts26542 MSP TS MSL-HAE conversion +* should use CCS +* 06/11/10 S. Gillis BAEts26724 Fixed memory error problem +* when MSPCCS_DATA is not set +* 08/26/11 K Ou BAEts27716 Improved CCS sample code +* +******************************************************************************/ + +#include +#include + +#include "CoordinateConversionService.h" +#include "CoordinateSystemParameters.h" +#include "GeodeticParameters.h" +#include "CoordinateTuple.h" +#include "GeodeticCoordinates.h" +#include "CartesianCoordinates.h" +#include "Accuracy.h" +#include "MGRSorUSNGCoordinates.h" +#include "UTMParameters.h" +#include "UTMCoordinates.h" +#include "CoordinateType.h" +#include "HeightType.h" +#include "CoordinateConversionException.h" +/** + * Sample code to demontrate how to use the MSP Coordinate Conversion Service. + * + * Includes the following conversions: + * + * |=============================|=============================| + * | Source | Target | + * |=============================+=============================| + * | Geodetic (Ellipsoid Height) | Geocentric | + * | Geocentric | Geodetic (Ellipsoid Height) | + * |-----------------------------+-----------------------------| + * | Geocentric | Geodetic (MSL EGM 96 15M) | + * |-----------------------------+-----------------------------| + * | Geodetic (Ellipsoid Height) | Geodetic (MSL EGM 96 15M) | + * | Geodetic (MSL EGM 96 15M) | Geodetic (Ellipsoid Height) | + * |-----------------------------+-----------------------------| + * | Geocentric | UTM | + * |-----------------------------+-----------------------------| + * | Geocentric | MGRS | + * |-----------------------------+-----------------------------| + * + **/ + + +/** + * Function which uses the given Geodetic (Ellipsoid Height) to Geocentric + * Coordinate Conversion Service, 'ccsGeodeticEllipsoidToGeocentric', to + * convert the given lat, lon, and height to x, y, z coordinates. + **/ +void convertGeodeticEllipsoidToGeocentric( + MSP::CCS::CoordinateConversionService& ccsGeodeticEllipsoidToGeocentric, + double lat, + double lon, + double height, + double& x, + double& y, + double& z) +{ + MSP::CCS::Accuracy sourceAccuracy; + MSP::CCS::Accuracy targetAccuracy; + MSP::CCS::GeodeticCoordinates sourceCoordinates( + MSP::CCS::CoordinateType::geodetic, lon, lat, height); + MSP::CCS::CartesianCoordinates targetCoordinates( + MSP::CCS::CoordinateType::geocentric); + + ccsGeodeticEllipsoidToGeocentric.convertSourceToTarget( + &sourceCoordinates, + &sourceAccuracy, + targetCoordinates, + targetAccuracy); + + x = targetCoordinates.x(); + y = targetCoordinates.y(); + z = targetCoordinates.z(); +} + + +/** + * Function which uses the given Geodetic (Ellipsoid Height) to Geocentric + * Coordinate Conversion Service, 'ccsGeodeticEllipsoidToGeocentric', to + * convert the given x, y, z coordinates to a lat, lon, and height. + **/ +void convertGeocentricToGeodeticEllipsoid( + MSP::CCS::CoordinateConversionService& ccsGeodeticEllipsoidToGeocentric, + double x, + double y, + double z, + double& lat, + double& lon, + double& height) +{ + MSP::CCS::Accuracy geocentricAccuracy; + MSP::CCS::Accuracy geodeticAccuracy; + MSP::CCS::CartesianCoordinates geocentricCoordinates( + MSP::CCS::CoordinateType::geocentric, x, y, z); + MSP::CCS::GeodeticCoordinates geodeticCoordinates; + + // Note that the Geodetic (Ellipsoid Height) to Geocentric Coordinate + // Conversion Service is used here in conjunction with the + // convertTargetToSource() method (as opposed to a Geocentric to + // Geodetic (Ellipsoid Height) Coordinate Conversion Service in + // conjunction with the convertSourceToTarget() method) + ccsGeodeticEllipsoidToGeocentric.convertTargetToSource( + &geocentricCoordinates, + &geocentricAccuracy, + geodeticCoordinates, + geodeticAccuracy); + + lat = geodeticCoordinates.latitude(); + lon = geodeticCoordinates.longitude(); + height = geodeticCoordinates.height(); +} + + +/** + * Function which uses the given Geocentric to Geodetic (MSL EGM 96 15M) + * Coordinate Conversion Service, 'ccsGeocentricToGeodeticMslEgm96', to + * convert the given x, y, z coordinates to a lat, lon, and height. + **/ +void convertGeocentricToGeodeticMslEgm96( + MSP::CCS::CoordinateConversionService& ccsGeocentricToGeodeticMslEgm96, + double x, + double y, + double z, + double& lat, + double& lon, + double& height) +{ + MSP::CCS::Accuracy sourceAccuracy; + MSP::CCS::Accuracy targetAccuracy; + MSP::CCS::CartesianCoordinates sourceCoordinates( + MSP::CCS::CoordinateType::geocentric, x, y, z); + MSP::CCS::GeodeticCoordinates targetCoordinates( + MSP::CCS::CoordinateType::geodetic, lon, lat, height); + + ccsGeocentricToGeodeticMslEgm96.convertSourceToTarget( + &sourceCoordinates, + &sourceAccuracy, + targetCoordinates, + targetAccuracy ); + + lat = targetCoordinates.latitude(); + lon = targetCoordinates.longitude(); + height = targetCoordinates.height(); +} + + +/** + * Function which uses the given Geodetic (MSL EGM 96 15M) to Geodetic + * (Ellipsoid Height) Coordinate Conversion Service, + * 'ccsMslEgm96ToEllipsoidHeight', to convert the given MSL height at the + * given lat, lon, to an Ellipsoid height. + **/ +void convertMslEgm96ToEllipsoidHeight( + MSP::CCS::CoordinateConversionService& ccsMslEgm96ToEllipsoidHeight, + double lat, + double lon, + double mslHeight, + double& ellipsoidHeight) +{ + MSP::CCS::Accuracy sourceAccuracy; + MSP::CCS::Accuracy targetAccuracy; + MSP::CCS::GeodeticCoordinates sourceCoordinates( + MSP::CCS::CoordinateType::geodetic, lon, lat, mslHeight); + MSP::CCS::GeodeticCoordinates targetCoordinates; + + ccsMslEgm96ToEllipsoidHeight.convertSourceToTarget( + &sourceCoordinates, + &sourceAccuracy, + targetCoordinates, + targetAccuracy); + + ellipsoidHeight = targetCoordinates.height(); +} + + +/** + * Function which uses the given Geodetic (Ellipsoid Height) to Geodetic + * (MSL EGM 96 15M) Coordinate Conversion Service, + * 'ccsEllipsoidHeightToMslEgm96', to convert the given Ellipsoid height at + * the given lat, lon, to an MSL height. + **/ +void convertEllipsoidHeightToMslEgm96( + MSP::CCS::CoordinateConversionService& ccsEllipsoidHeightToMslEgm96, + double lat, + double lon, + double ellipsoidHeight, + double& mslHeight) +{ + MSP::CCS::Accuracy sourceAccuracy; + MSP::CCS::Accuracy targetAccuracy; + + MSP::CCS::GeodeticCoordinates sourceCoordinates( + MSP::CCS::CoordinateType::geodetic, lon, lat, ellipsoidHeight); + MSP::CCS::GeodeticCoordinates targetCoordinates; + + ccsEllipsoidHeightToMslEgm96.convertSourceToTarget( + &sourceCoordinates, + &sourceAccuracy, + targetCoordinates, + targetAccuracy); + + mslHeight = targetCoordinates.height(); +} + + +/** + * Function which uses the given Geocentric to UTM Coordinate Conversion + * Service, 'ccsGeocentricToUtm', to convert the given x, y, z coordinates + * a UTM zone, hemisphere, Easting and Northing. + **/ +void convertGeocentricToUtm( + MSP::CCS::CoordinateConversionService& ccsGeocentricToUtm, + double x, + double y, + double z, + long& zone, + char& hemisphere, + double& easting, + double& northing) +{ + MSP::CCS::Accuracy sourceAccuracy; + MSP::CCS::Accuracy targetAccuracy; + MSP::CCS::CartesianCoordinates sourceCoordinates( + MSP::CCS::CoordinateType::geocentric, x, y, z); + MSP::CCS::UTMCoordinates targetCoordinates; + + ccsGeocentricToUtm.convertSourceToTarget( + &sourceCoordinates, + &sourceAccuracy, + targetCoordinates, + targetAccuracy); + + zone = targetCoordinates.zone(); + hemisphere = targetCoordinates.hemisphere(); + easting = targetCoordinates.easting(); + northing = targetCoordinates.northing(); +} + + +/** + * Function which uses the given Geocentric to MGRS Coordinate Conversion + * Service, 'ccsGeocentricToMgrs', to convert the given x, y, z coordinates + * to an MGRS string and precision. + **/ +std::string convertGeocentricToMgrs( + MSP::CCS::CoordinateConversionService& ccsGeocentricToMgrs, + double x, + double y, + double z, + MSP::CCS::Precision::Enum& precision) +{ + char* p; + std::string mgrsString; + + MSP::CCS::Accuracy sourceAccuracy; + MSP::CCS::Accuracy targetAccuracy; + MSP::CCS::CartesianCoordinates sourceCoordinates( + MSP::CCS::CoordinateType::geocentric, x, y, z); + MSP::CCS::MGRSorUSNGCoordinates targetCoordinates; + + ccsGeocentricToMgrs.convertSourceToTarget( + &sourceCoordinates, + &sourceAccuracy, + targetCoordinates, + targetAccuracy ); + + // Returned value, 'p', points to targetCoordinate's internal character + // array so assign/copy the character array to mgrsString to avoid + // introducing memory management issues + p = targetCoordinates.MGRSString(); + mgrsString = p; + + precision = targetCoordinates.precision(); + + return mgrsString; +} + + +/****************************************************************************** + * Main function + ******************************************************************************/ + +int main(int argc, char **argv) +{ + const char* WGE = "WGE"; + + // initialize status value to one, indicating an error condition + int status = 1; + + std::cout << "Coordinate Conversion Service Sample Test Driver" << std::endl; + std::cout << std::endl; + + // + // Coordinate System Parameters + // + MSP::CCS::GeodeticParameters ellipsoidParameters( + MSP::CCS::CoordinateType::geodetic, + MSP::CCS::HeightType::ellipsoidHeight); + + MSP::CCS::CoordinateSystemParameters geocentricParameters( + MSP::CCS::CoordinateType::geocentric); + + MSP::CCS::GeodeticParameters mslEgm96Parameters( + MSP::CCS::CoordinateType::geodetic, + MSP::CCS::HeightType::EGM96FifteenMinBilinear); + + MSP::CCS::UTMParameters utmParameters( + MSP::CCS::CoordinateType::universalTransverseMercator, + 1, + 0); + + MSP::CCS::CoordinateSystemParameters mgrsParameters( + MSP::CCS::CoordinateType::militaryGridReferenceSystem); + + // + // Coordinate Conversion Services + // + MSP::CCS::CoordinateConversionService ccsGeodeticEllipsoidToGeocentric( + WGE, &ellipsoidParameters, + WGE, &geocentricParameters); + + MSP::CCS::CoordinateConversionService ccsGeocentricToGeodeticMslEgm96( + WGE, &geocentricParameters, + WGE, &mslEgm96Parameters); + + MSP::CCS::CoordinateConversionService ccsMslEgm96ToEllipsoidHeight( + WGE, &mslEgm96Parameters, + WGE, &ellipsoidParameters); + MSP::CCS::CoordinateConversionService ccsEllipsoidHeightToMslEgm96( + WGE, &ellipsoidParameters, + WGE, &mslEgm96Parameters); + + MSP::CCS::CoordinateConversionService ccsGeocentricToUtm( + WGE, &geocentricParameters, + WGE, &utmParameters); + MSP::CCS::CoordinateConversionService ccsGeocentricToMgrs( + WGE, &geocentricParameters, + WGE, &mgrsParameters); + + try { + + // + // Geodetic (Ellipsoid Height) to Geocentric + // + double lat = 0.56932; + double lon = -2.04552; + double height = 0.0; + + double x, y, z; + + std::cout << "convertGeodeticEllipsoidToGeocentric" << '\n'; + convertGeodeticEllipsoidToGeocentric( + ccsGeodeticEllipsoidToGeocentric, + lat, lon, height, + x, y, z); + + std::cout << "Convert Geodetic (Ellipsoid Height) to Geocentric" << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "Height(m): " << height << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl; + + // + // Geocentric to Geodetic (Ellipsoid Height) + // + + // function convertGeocentricToGeodeticEllipsoid() reuses the + // ccsGeodeticEllipsoidToGeocentric instance to perform the reverse + // conversion + convertGeocentricToGeodeticEllipsoid( + ccsGeodeticEllipsoidToGeocentric, + x, y, z, + lat, lon, height); + + std::cout << "Revert Geocentric To Geodetic (Ellipsoid Height): " << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "Height(m): " << height << std::endl + << std::endl; + + + // reuse ccsGeodeticEllipsoidToGeocentric instance to perform another + // Geodetic (Ellipsoid Height) to Geocentric conversions + lat = 0.76388; + lon = 0.60566; + height = 11.0; + + convertGeodeticEllipsoidToGeocentric( + ccsGeodeticEllipsoidToGeocentric, + lat, lon, height, + x, y, z); + + std::cout << "Convert Geodetic (Ellipsoid Height) to Geocentric" << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "Height(m): " << height << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl; + + // reuse ccsGeodeticEllipsoidToGeocentric instance to perform another + // Geodetic (Ellipsoid Height) to Geocentric conversions + lat = 0.71458; + lon = 0.88791; + height = 22.0; + + convertGeodeticEllipsoidToGeocentric( + ccsGeodeticEllipsoidToGeocentric, + lat, lon, height, + x, y, z); + + std::cout << "Convert Geodetic (Ellipsoid Height) to Geocentric" << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "Height(m): " << height << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl; + + // + // Geocentric to Geodetic (MSL EGM96 15M) + // + x = 3851747; + y = 3719589; + z = 3454013; + + double mslHeight; + + convertGeocentricToGeodeticMslEgm96( + ccsGeocentricToGeodeticMslEgm96, + x, y, z, + lat, lon, mslHeight); + + std::cout << "Convert Geocentric To Geodetic MSL EGM96: " << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "MSL EGM96 15M Height: " << mslHeight << std::endl + << std::endl; + + // + // Geodetic (MSL EGM96 15M) to Geodetic (Ellipsoid Height) + // + convertMslEgm96ToEllipsoidHeight( + ccsMslEgm96ToEllipsoidHeight, + lat, lon, mslHeight, + height); + + std::cout << "Convert Geodetic (MSL EMG96 15M Height) To Geodetic (Ellipsoid Height)" << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "MSL EGM96 15M Height: " << mslHeight << std::endl + << std::endl + << "Ellipsoid Height: " << height << std::endl + << std::endl; + + // + // Geodetic (Ellipsoid Height) to Geodetic (MSL EMG96 15M) + // + convertEllipsoidHeightToMslEgm96( + ccsEllipsoidHeightToMslEgm96, + lat, lon, height, + mslHeight); + + std::cout << "Revert Geodetic (Ellipsoid Height) To Geodetic (MSL EGM96 15M) Height" << std::endl + << std::endl + << "Lat (radians): " << lat << std::endl + << "Lon (radians): " << lon << std::endl + << "Height(m): " << height << std::endl + << std::endl + << "MSL EGM96 15M Height: " << mslHeight << std::endl + << std::endl; + + // + // Geocentric to UTM + // + long zone; + char hemi; + double easting, northing; + convertGeocentricToUtm( + ccsGeocentricToUtm, + x, y, z, + zone, hemi, easting, northing); + + std::cout << "Convert Geocentric To UTM: " << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl + << "Zone: " << zone << std::endl + << "Hemisphere: " << hemi << std::endl + << "Easting: " << easting << std::endl + << "Northing: " << northing<< std::endl + << std::endl; + + // + // Geocentric to MGRS + // + std::string mgrsString; + MSP::CCS::Precision::Enum precision; + + mgrsString = convertGeocentricToMgrs( + ccsGeocentricToMgrs, + x, y, z, + precision); + + std::cout << "Convert Geocentric To MGRS: " << std::endl + << std::endl + << "x: " << x << std::endl + << "y: " << y << std::endl + << "z: " << z << std::endl + << std::endl + << "MGRS: " << mgrsString << std::endl + << "Precision: " << precision << std::endl + << std::endl; + + // set status value to zero to indicate successful completion + status = 0; + + } catch(MSP::CCS::CoordinateConversionException& e) { + // catch and report any exceptions thrown by the Coordinate + // Conversion Service + std::cerr + << "ERROR: Coordinate Conversion Service exception encountered - " + << e.getMessage() + << std::endl; + + } catch(std::exception& e) { + // catch and report any unexpected exceptions thrown + std::cerr << "ERROR: Unexpected exception encountered - " + << e.what() << std::endl; + } + + return status; +} + +// Classification : UNCLASSIFIED diff --git a/recipes/geotrans/all/test_v1_package/CMakeLists.txt b/recipes/geotrans/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/geotrans/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/geotrans/all/test_v1_package/conanfile.py b/recipes/geotrans/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2f992fa32bae6 --- /dev/null +++ b/recipes/geotrans/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake, tools +from contextlib import contextmanager +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() + + @contextmanager + def _workaround_2profiles(self): + if hasattr(self, "settings_build"): + with tools.environment_append( + {"MSPCCS_DATA": os.path.join(self.deps_cpp_info["geotrans"].rootpath, "res")} + ): + yield + else: + yield + + def test(self): + if not tools.cross_building(self): + with self._workaround_2profiles(): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/geotrans/config.yml b/recipes/geotrans/config.yml new file mode 100644 index 0000000000000..bc00071b32bef --- /dev/null +++ b/recipes/geotrans/config.yml @@ -0,0 +1,5 @@ +versions: + "3.9": + folder: all + "3.8": + folder: all diff --git a/recipes/getdns/all/CMakeLists.txt b/recipes/getdns/all/CMakeLists.txt new file mode 100644 index 0000000000000..f96c6dd4ed727 --- /dev/null +++ b/recipes/getdns/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32) + set(CMAKE_REQUIRED_LIBRARIES ws2_32) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/getdns/all/conandata.yml b/recipes/getdns/all/conandata.yml new file mode 100644 index 0000000000000..63656d1d51254 --- /dev/null +++ b/recipes/getdns/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.6.0": + url: "https://getdnsapi.net/dist/getdns-1.6.0.tar.gz" + sha256: "40e5737471a3902ba8304b0fd63aa7c95802f66ebbc6eae53c487c8e8a380f4a" +patches: + "1.6.0": + - patch_file: "patches/1.6.0-0001-install-runtimes.patch" + base_path: "source_subfolder" + - patch_file: "patches/1.6.0-0002-fix-exports-extension-libraries.patch" + base_path: "source_subfolder" + - patch_file: "patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch" + base_path: "source_subfolder" + - patch_file: "patches/1.6.0-0004-dont-install-symlinked-license.patch" + base_path: "source_subfolder" diff --git a/recipes/getdns/all/conanfile.py b/recipes/getdns/all/conanfile.py new file mode 100644 index 0000000000000..a1d7aed1728a6 --- /dev/null +++ b/recipes/getdns/all/conanfile.py @@ -0,0 +1,170 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import glob +import os + + +class GetDnsConan(ConanFile): + name = "getdns" + description = "A modern asynchronous DNS API" + topics = "conan", "getdns", "asynchronous", "event" + license = "BSD-3-Clause" + homepage = "https://getdnsapi.net/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + exports_sources = "CMakeLists.txt", "patches/**" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tls": [False, "gnutls"], + "stub_only": ["auto", True, False], + "with_libev": ["auto", True, False], + "with_libevent": [True, False], + "with_libuv": [True, False], + "with_libidn2": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "stub_only": "auto", + "tls": False, + "with_libev": "auto", + "with_libevent": True, + "with_libuv": True, + "with_libidn2": True, + } + generators = "cmake", "pkg_config", "cmake_find_package" + + _cmake = None + + @property + def _with_libev(self): + if self.options.with_libev == "auto": + return self.settings.os != "Windows" + else: + return self.options.with_libev + + @property + def _stub_only(self): + if self.options.stub_only == "auto": + # FIXME: uncomment the next line when libunbound is available + # return self.settings.os == "Windows" + return True + else: + return self.options.stub_only + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("openssl/1.1.1j") + if self._with_libev: + self.requires("libev/4.33") + if self.options.with_libevent: + self.requires("libevent/2.1.12") + if self.options.with_libuv: + self.requires("libuv/1.41.0") + if self.options.with_libidn2: + self.requires("libidn2/2.3.0") + if self.options.tls == "gnutls": + self.requires("nettle/3.6") + # FIXME: missing gnutls recipe + raise ConanInvalidConfiguration("gnutls is not (yet) available on cci") + if not self._stub_only: + # FIXME: missing libunbound recipe + raise ConanInvalidConfiguration("libunbound is not (yet) available on cci") + + def build_requirements(self): + self.build_requires("pkgconf/1.7.3") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("getdns-{}".format(self.version), self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = not self.options["openssl"].shared + self._cmake.definitions["ENABLE_SHARED"] = self.options.shared + self._cmake.definitions["ENABLE_STATIC"] = not self.options.shared + self._cmake.definitions["ENABLE_STUB_ONLY"] = self._stub_only + self._cmake.definitions["BUILD_LIBEV"] = self._with_libev + self._cmake.definitions["BUILD_LIBEVENT2"] = self.options.with_libevent + self._cmake.definitions["BUILD_LIBUV"] = self.options.with_libuv + self._cmake.definitions["USE_LIBIDN2"] = self.options.with_libidn2 + self._cmake.definitions["USE_GNUTLS"] = self.options.tls == "gnutls" + self._cmake.definitions["BUILD_TESTING"] = False + + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + # Use FindOpenSSL.cmake to let check_function_exists succeed + # Remove other cmake modules as they use FindPkgConfig + for fn in glob.glob("Find*cmake"): + if "OpenSSL" not in fn: + os.unlink(fn) + 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", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_id(self): + self.info.options.stub_only = self._stub_only + self.info.options.with_libev = self._with_libev + + def package_info(self): + libsuffix = "" + if self.settings.compiler == "Visual Studio" and not self.options.shared: + libsuffix = "_static" + + self.cpp_info.components["libgetdns"].libs = ["getdns" + libsuffix] + self.cpp_info.components["libgetdns"].includedirs.append(os.path.join("include", "getdns")) + self.cpp_info.components["libgetdns"].names["pkg_config"]= "getdns" + self.cpp_info.components["libgetdns"].requires = ["openssl::openssl"] + if self.options.with_libidn2: + self.cpp_info.components["libgetdns"].requires.append("libidn2::libidn2") + if self.options.with_libidn2: + self.cpp_info.components["libgetdns"].requires.append("libidn2::libidn2") + if self.options.tls == "gnutls": + self.cpp_info.components["libgetdns"].requires.extend(["nettle::nettle", "gnutls::gnutls"]) + + if self.options.with_libevent: + self.cpp_info.components["dns_ex_event"].libs = ["getdns_ex_event" + libsuffix] + self.cpp_info.components["dns_ex_event"].requires= ["libgetdns", "libevent::libevent"] + self.cpp_info.components["dns_ex_event"].names["pkg_config"]= "getdns_ext_event" + + if self._with_libev: + self.cpp_info.components["dns_ex_ev"].libs = ["getdns_ex_ev" + libsuffix] + self.cpp_info.components["dns_ex_ev"].requires = ["libgetdns", "libev::libev"] + self.cpp_info.components["dns_ex_ev"].names["pkg_config"]= "getdns_ext_ev" + + if self.options.with_libuv: + self.cpp_info.components["dns_ex_uv"].libs = ["getdns_ex_uv" + libsuffix] + self.cpp_info.components["dns_ex_uv"].requires = ["libgetdns", "libuv::libuv"] + self.cpp_info.components["dns_ex_uv"].names["pkg_config"]= "getdns_ext_uv" + + 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/getdns/all/patches/1.6.0-0001-install-runtimes.patch b/recipes/getdns/all/patches/1.6.0-0001-install-runtimes.patch new file mode 100644 index 0000000000000..de23061cc40af --- /dev/null +++ b/recipes/getdns/all/patches/1.6.0-0001-install-runtimes.patch @@ -0,0 +1,33 @@ +Based on https://github.com/getdnsapi/getdns/pull/477 + +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1055,22 +1055,22 @@ + endif () + endif () + if (ENABLE_SHARED) +- install(TARGETS getdns_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + if (USE_LIBEV) +- install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif () + if (USE_LIBEVENT2) +- install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif () + if (USE_LIBUV) +- install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif () + endif () + if (BUILD_GETDNS_QUERY) +- install(TARGETS getdns_query RUNTIME DESTINATION bin) ++ install(TARGETS getdns_query RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif () + if (BUILD_GETDNS_SERVER_MON) +- install(TARGETS getdns_server_mon RUNTIME DESTINATION bin) ++ install(TARGETS getdns_server_mon RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif () + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/getdns DESTINATION include) diff --git a/recipes/getdns/all/patches/1.6.0-0002-fix-exports-extension-libraries.patch b/recipes/getdns/all/patches/1.6.0-0002-fix-exports-extension-libraries.patch new file mode 100644 index 0000000000000..8291fa7e151ad --- /dev/null +++ b/recipes/getdns/all/patches/1.6.0-0002-fix-exports-extension-libraries.patch @@ -0,0 +1,13 @@ +Based on https://github.com/getdnsapi/getdns/pull/489 + +--- cmake/modules/TargetSharedLibraryExports.cmake ++++ cmake/modules/TargetSharedLibraryExports.cmake +@@ -20,7 +20,7 @@ + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" " ${symbol};\n") + endforeach () + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" "local:\n *;\n};\n") +- target_link_libraries(${lib} PRIVATE "-Wl,--version-script=getdns.ver") ++ target_link_libraries(${lib} PRIVATE "-Wl,--version-script=${libname}.ver") + else () + message(WARNING "Unknown platform, ${lib} exports not set.") + endif () diff --git a/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch b/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch new file mode 100644 index 0000000000000..9e446cae01b2a --- /dev/null +++ b/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch @@ -0,0 +1,641 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -659,9 +659,9 @@ + target_include_directories(getdns_objects PRIVATE src/ssl_dane) + set(USE_DANESSL 1) + endif () +-if (Libidn_FOUND) +- target_include_directories(getdns_objects PRIVATE ${LIBIDN_INCLUDE_DIR}) +-endif () ++#if (Libidn_FOUND) ++# target_include_directories(getdns_objects PRIVATE ${LIBIDN_INCLUDE_DIR}) ++#endif () + if (Libidn2_FOUND) + target_include_directories(getdns_objects PRIVATE ${LIBIDN2_INCLUDE_DIR}) + endif () +@@ -695,9 +695,9 @@ + if (Libunbound_FOUND) + target_link_libraries(getdns PUBLIC Libunbound::Libunbound) + endif () +- if (Libidn_FOUND) +- target_link_libraries(getdns PUBLIC Libidn::Libidn) +- endif () ++# if (Libidn_FOUND) ++# target_link_libraries(getdns PUBLIC Libidn::Libidn) ++# endif () + if (Libidn2_FOUND) + target_link_libraries(getdns PUBLIC Libidn2::Libidn2) + endif () +--- cmake/modules/FindGnuTLS.cmake ++++ cmake/modules/FindGnuTLS.cmake +@@ -30,51 +30,65 @@ + + #]=======================================================================] + +-find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h +- HINTS +- "${GNUTLS_DIR}" +- "${GNUTLS_DIR}/include" +-) +- +-find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls +- HINTS +- "${GNUTLS_DIR}" +- "${GNUTLS_DIR}/lib" +-) +- +-find_library(GNUTLS_DANE_LIBRARY NAMES gnutls-dane libgnutls-dane +- HINTS +- "${GNUTLS_DIR}" +- "${GNUTLS_DIR}/lib" +-) +- +-set(GNUTLS_LIBRARIES "") +- +-if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY) +- if (NOT TARGET GnuTLS::GnuTLS) +- add_library(GnuTLS::GnuTLS UNKNOWN IMPORTED) +- set_target_properties(GnuTLS::GnuTLS PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${GNUTLS_LIBRARY}" +- ) +- endif () +- if (NOT TARGET GnuTLS::Dane) +- add_library(GnuTLS::Dane UNKNOWN IMPORTED) +- set_target_properties(GnuTLS::Dane PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${GNUTLS_DANE_LIBRARY}" +- ) +- endif () +- +- if (NOT GNUTLS_VERSION AND GNUTLS_INCLUDE_DIR) +- file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" GNUTLS_VER_H REGEX "^#define GNUTLS_VERSION_(MAJOR|MINOR|PATCH) ") +- string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3c" GNUTLS_VERSION "${GNUTLS_VER_H}") +- endif () ++include(FindPkgConfig) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PkgGnuTLS IMPORTED_TARGET GLOBAL QUIET gnutls) ++ pkg_check_modules(PkgGnuTLSDane IMPORTED_TARGET GLOBAL QUIET gnutls-dane) + endif() + +-list(APPEND GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}") ++if(PkgGnuTLS_FOUND AND PkgGnuTLSDane_FOUND) ++ set(GNUTLS_INCLUDE_DIR ${PkgGnuTLS_INCLUDE_DIRS} $PkgGnuTLSDane_INCLUDE_DIRS}) ++ set(NETTLE_LIBRARIES ${PkgGnuTLS_LIBRARIES} ${PkgGnuTLSDane_LIBRARIES}) ++ set(NETTLE_VERSION ${PkgGnuTLS_VERSION}) ++ add_library(GnuTLS::GnuTLS ALIAS PkgConfig::PkgGnuTLS) ++ add_library(GnuTLS::Dane ALIAS PkgConfig::PkgGnuTLSDane) ++else() ++ find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h ++ HINTS ++ "${GNUTLS_DIR}" ++ "${GNUTLS_DIR}/include" ++ ) ++ ++ find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls ++ HINTS ++ "${GNUTLS_DIR}" ++ "${GNUTLS_DIR}/lib" ++ ) ++ ++ find_library(GNUTLS_DANE_LIBRARY NAMES gnutls-dane libgnutls-dane ++ HINTS ++ "${GNUTLS_DIR}" ++ "${GNUTLS_DIR}/lib" ++ ) ++ ++ set(GNUTLS_LIBRARIES "") ++ ++ if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY) ++ if (NOT TARGET GnuTLS::GnuTLS) ++ add_library(GnuTLS::GnuTLS UNKNOWN IMPORTED) ++ set_target_properties(GnuTLS::GnuTLS PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${GNUTLS_LIBRARY}" ++ ) ++ endif () ++ if (NOT TARGET GnuTLS::Dane) ++ add_library(GnuTLS::Dane UNKNOWN IMPORTED) ++ set_target_properties(GnuTLS::Dane PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${GNUTLS_DANE_LIBRARY}" ++ ) ++ endif () ++ ++ if (NOT GNUTLS_VERSION AND GNUTLS_INCLUDE_DIR) ++ file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" GNUTLS_VER_H REGEX "^#define GNUTLS_VERSION_(MAJOR|MINOR|PATCH) ") ++ string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3c" GNUTLS_VERSION "${GNUTLS_VER_H}") ++ endif () ++ endif() ++ ++ list(APPEND GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}") ++endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(GnuTLS +--- cmake/modules/FindLibevent2.cmake ++++ cmake/modules/FindLibevent2.cmake +@@ -28,37 +28,49 @@ + + #]=======================================================================] + +-find_path(LIBEVENT2_INCLUDE_DIR event2/event.h +- HINTS +- "${LIBEVENT2_DIR}" +- "${LIBEVENT2_DIR}/include" +-) +- +-find_library(LIBEVENT2_LIBRARY NAMES event_core libevent_core +- HINTS +- "${LIBEVENT2_DIR}" +- "${LIBEVENT2_DIR}/lib" +-) +- +-set(LIBEVENT2_LIBRARIES "") +- +-if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARY) +- if (NOT TARGET Libevent2::Libevent_core) +- add_library(Libevent2::Libevent_core UNKNOWN IMPORTED) +- set_target_properties(Libevent2::Libevent_core PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${LIBEVENT2_LIBRARY}" +- ) +- endif () +- +- if (NOT LIBEVENT2_VERSION AND LIBEVENT2_INCLUDE_DIR AND EXISTS "${LIBEVENT2_INCLUDE_DIR}/event2/event.h") +- file(STRINGS "${LIBEVENT2_INCLUDE_DIR}/event2/event-config.h" LIBEVENT2_H REGEX "^#define _?EVENT_+VERSION ") +- string(REGEX REPLACE "^.*EVENT_+VERSION \"([^\"]+)\".*$" "\\1" LIBEVENT2_VERSION "${LIBEVENT2_H}") +- endif () ++include(FindPkgConfig) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PkgLibevent IMPORTED_TARGET GLOBAL QUIET libevent>=2) + endif() + +-list(APPEND LIBEVENT2_LIBRARIES "${LIBEVENT2_LIBRARY}") ++if(PkgLibevent_FOUND) ++ set(LIBEVENT2_INCLUDE_DIR ${PkgLibevent_INCLUDE_DIRS}) ++ set(LIBEVENT2_LIBRARIES ${PkgLibevent_LIBRARIES}) ++ set(LIBEVENT2_VERSION ${PkgLibevent_VERSION}) ++ add_library(Libevent2::Libevent_core ALIAS PkgConfig::PkgLibevent) ++else() ++ find_path(LIBEVENT2_INCLUDE_DIR event2/event.h ++ HINTS ++ "${LIBEVENT2_DIR}" ++ "${LIBEVENT2_DIR}/include" ++ ) ++ ++ find_library(LIBEVENT2_LIBRARY NAMES event_core libevent_core ++ HINTS ++ "${LIBEVENT2_DIR}" ++ "${LIBEVENT2_DIR}/lib" ++ ) ++ ++ set(LIBEVENT2_LIBRARIES "") ++ ++ if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARY) ++ if (NOT TARGET Libevent2::Libevent_core) ++ add_library(Libevent2::Libevent_core UNKNOWN IMPORTED) ++ set_target_properties(Libevent2::Libevent_core PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${LIBEVENT2_LIBRARY}" ++ ) ++ endif () ++ ++ if (NOT LIBEVENT2_VERSION AND LIBEVENT2_INCLUDE_DIR AND EXISTS "${LIBEVENT2_INCLUDE_DIR}/event2/event.h") ++ file(STRINGS "${LIBEVENT2_INCLUDE_DIR}/event2/event-config.h" LIBEVENT2_H REGEX "^#define _?EVENT_+VERSION ") ++ string(REGEX REPLACE "^.*EVENT_+VERSION \"([^\"]+)\".*$" "\\1" LIBEVENT2_VERSION "${LIBEVENT2_H}") ++ endif () ++ endif() ++ ++ list(APPEND LIBEVENT2_LIBRARIES "${LIBEVENT2_LIBRARY}") ++endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libevent2 +--- cmake/modules/FindLibidn2.cmake ++++ cmake/modules/FindLibidn2.cmake +@@ -28,37 +28,49 @@ + + #]=======================================================================] + +-find_path(LIBIDN2_INCLUDE_DIR idn2.h +- HINTS +- "${LIBIDN2_DIR}" +- "${LIBIDN2_DIR}/include" +-) +- +-find_library(LIBIDN2_LIBRARY NAMES idn2 libidn2 +- HINTS +- "${LIBIDN2_DIR}" +- "${LIBIDN2_DIR}/lib" +-) +- +-set(LIBIDN2_LIBRARIES "") +- +-if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARY) +- if (NOT TARGET Libidn2::Libidn2) +- add_library(Libidn2::Libidn2 UNKNOWN IMPORTED) +- set_target_properties(Libidn2::Libidn2 PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${LIBIDN2_LIBRARY}" ++include(FindPkgConfig) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PkgLibIdn2 IMPORTED_TARGET GLOBAL libidn2) ++endif() ++ ++if(PkgLibIdn2_FOUND) ++ set(LIBIDN2_INCLUDE_DIR ${PkgLibIdn2_INCLUDE_DIRS}) ++ set(LIBIDN2_LIBRARIES ${PkgLibIdn2_LIBRARIES}) ++ set(LIBIDN2_VERSION ${PkgLibIdn2_VERSION}) ++ add_library(Libidn2::Libidn2 ALIAS PkgConfig::PkgLibIdn2) ++else() ++ find_path(LIBIDN2_INCLUDE_DIR idn2.h ++ HINTS ++ "${LIBIDN2_DIR}" ++ "${LIBIDN2_DIR}/include" ++ ) ++ ++ find_library(LIBIDN2_LIBRARY NAMES idn2 libidn2 ++ HINTS ++ "${LIBIDN2_DIR}" ++ "${LIBIDN2_DIR}/lib" ++ ) ++ ++ set(LIBIDN2_LIBRARIES "") ++ ++ if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARY) ++ if (NOT TARGET Libidn2::Libidn2) ++ add_library(Libidn2::Libidn2 UNKNOWN IMPORTED) ++ set_target_properties(Libidn2::Libidn2 PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${LIBIDN2_LIBRARY}" + ) +- endif () ++ endif () + +- if (NOT LIBIDN2_VERSION AND LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/unbound.h") +- file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" LIBIDN2_H REGEX "^#define IDN2_VERSION ") +- string(REGEX REPLACE "^.*IDN2_VERSION \"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}") +- endif () +-endif() ++ if (NOT LIBIDN2_VERSION AND LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/unbound.h") ++ file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" LIBIDN2_H REGEX "^#define IDN2_VERSION ") ++ string(REGEX REPLACE "^.*IDN2_VERSION \"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}") ++ endif () + +-list(APPEND LIBIDN2_LIBRARIES "${LIBIDN2_LIBRARY}") ++ list(APPEND LIBIDN2_LIBRARIES "${LIBIDN2_LIBRARY}") ++ endif() ++endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libidn2 +--- cmake/modules/FindLibunbound.cmake ++++ cmake/modules/FindLibunbound.cmake +@@ -28,58 +28,70 @@ + + #]=======================================================================] + +-find_path(LIBUNBOUND_INCLUDE_DIR unbound.h +- HINTS +- "${LIBUNBOUND_DIR}" +- "${LIBUNBOUND_DIR}/include" +-) +- +-find_library(LIBUNBOUND_LIBRARY NAMES unbound +- HINTS +- "${LIBUNBOUND_DIR}" +- "${LIBUNBOUND_DIR}/lib" +-) +- +-set(LIBUNBOUND_LIBRARIES "") +- +-if (UNIX) +- find_package(Threads REQUIRED) +- find_package(OpenSSL REQUIRED) +- +- list(APPEND LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") +- list(APPEND LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}") ++include(FindPkgConfig) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PkgLibunbound IMPORTED_TARGET GLOBAL QUIET libunbound) + endif() + +-if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY) +- if (NOT TARGET Libunbound::Libunbound) +- add_library(Libunbound::Libunbound UNKNOWN IMPORTED) +- set_target_properties(Libunbound::Libunbound PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}" +- ) +- +- if(UNIX AND TARGET Threads::Threads) +- set_property(TARGET Libunbound::Libunbound APPEND PROPERTY +- INTERFACE_LINK_LIBRARIES Threads::Threads) +- endif () +- if(UNIX AND TARGET OpenSSL::SSL) +- set_property(TARGET Libunbound::Libunbound APPEND PROPERTY +- INTERFACE_LINK_LIBRARIES OpenSSL::SSL) ++if(PkgLibunbound_FOUND) ++ set(LIBUNBOUND_INCLUDE_DIR ${PkgLibunbound_INCLUDE_DIRS}) ++ set(LIBUNBOUND_LIBRARIES ${PkgLibunbound_LIBRARIES}) ++ set(LIBUNBOUND_VERSION ${PkgLibunbound_VERSION}) ++ add_library(Libunbound::Libunbound ALIAS PkgConfig::PkgLibunbound) ++else() ++ find_path(LIBUNBOUND_INCLUDE_DIR unbound.h ++ HINTS ++ "${LIBUNBOUND_DIR}" ++ "${LIBUNBOUND_DIR}/include" ++ ) ++ ++ find_library(LIBUNBOUND_LIBRARY NAMES unbound ++ HINTS ++ "${LIBUNBOUND_DIR}" ++ "${LIBUNBOUND_DIR}/lib" ++ ) ++ ++ set(LIBUNBOUND_LIBRARIES "") ++ ++ if (UNIX) ++ find_package(Threads REQUIRED) ++ find_package(OpenSSL REQUIRED) ++ ++ list(APPEND LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") ++ list(APPEND LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}") ++ endif() ++ ++ if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY) ++ if (NOT TARGET Libunbound::Libunbound) ++ add_library(Libunbound::Libunbound UNKNOWN IMPORTED) ++ set_target_properties(Libunbound::Libunbound PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}" ++ ) ++ ++ if(UNIX AND TARGET Threads::Threads) ++ set_property(TARGET Libunbound::Libunbound APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES Threads::Threads) ++ endif () ++ if(UNIX AND TARGET OpenSSL::SSL) ++ set_property(TARGET Libunbound::Libunbound APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES OpenSSL::SSL) ++ endif () ++ if(UNIX AND TARGET OpenSSL::Crypto) ++ set_property(TARGET Libunbound::Libunbound APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES OpenSSL::Crypto) ++ endif () + endif () +- if(UNIX AND TARGET OpenSSL::Crypto) +- set_property(TARGET Libunbound::Libunbound APPEND PROPERTY +- INTERFACE_LINK_LIBRARIES OpenSSL::Crypto) ++ ++ if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h") ++ file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+") ++ string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}") + endif () +- endif () +- +- if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h") +- file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+") +- string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}") +- endif () +-endif() +- +-list(APPEND LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}") ++ endif() ++ ++ list(APPEND LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}") ++endif + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libunbound +--- cmake/modules/FindLibuv.cmake ++++ cmake/modules/FindLibuv.cmake +@@ -28,42 +28,54 @@ + + #]=======================================================================] + +-find_path(LIBUV_INCLUDE_DIR uv.h +- HINTS +- "${LIBUV_DIR}" +- "${LIBUV_DIR}/include" +-) +- +-find_library(LIBUV_LIBRARY NAMES uv libuv +- HINTS +- "${LIBUV_DIR}" +- "${LIBUV_DIR}/lib" +-) +- +-set(LIBUV_LIBRARIES "") +- +-if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY) +- if (NOT TARGET Libuv::Libuv) +- add_library(Libuv::Libuv UNKNOWN IMPORTED) +- set_target_properties(Libuv::Libuv PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${LIBUV_LIBRARY}" +- ) +- endif () ++include(FindPkgConfig) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PkgLibuv IMPORTED_TARGET GLOBAL QUIET libuv) ++endif() + +- if (NOT LIBUV_VERSION AND LIBUV_INCLUDE_DIR) +- if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h") +- file(STRINGS "${LIBUV_INCLUDE_DIR}/uv-version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") +- elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h") +- file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") ++if(PkgLibuv_FOUND) ++ set(LIBUV_INCLUDE_DIR ${PkgLibuv_INCLUDE_DIRS}) ++ set(LIBUV_LIBRARIES ${PkgLibuv_LIBRARIES}) ++ set(LIBUV_VERSION ${PkgLibuv_VERSION}) ++ add_library(Libuv::Libuv ALIAS PkgConfig::PkgLibuv) ++else() ++ find_path(LIBUV_INCLUDE_DIR uv.h ++ HINTS ++ "${LIBUV_DIR}" ++ "${LIBUV_DIR}/include" ++ ) ++ ++ find_library(LIBUV_LIBRARY NAMES uv libuv ++ HINTS ++ "${LIBUV_DIR}" ++ "${LIBUV_DIR}/lib" ++ ) ++ ++ set(LIBUV_LIBRARIES "") ++ ++ if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY) ++ if (NOT TARGET Libuv::Libuv) ++ add_library(Libuv::Libuv UNKNOWN IMPORTED) ++ set_target_properties(Libuv::Libuv PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${LIBUV_LIBRARY}" ++ ) + endif () +- string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3" LIBUV_VERSION "${LIBUV_VER_H}") +- endif () ++ ++ if (NOT LIBUV_VERSION AND LIBUV_INCLUDE_DIR) ++ if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h") ++ file(STRINGS "${LIBUV_INCLUDE_DIR}/uv-version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") ++ elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h") ++ file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") ++ endif () ++ string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3" LIBUV_VERSION "${LIBUV_VER_H}") ++ endif () ++ endif() ++ ++ list(APPEND LIBUV_LIBRARIES "${LIBUV_LIBRARY}") + endif() + +-list(APPEND LIBUV_LIBRARIES "${LIBUV_LIBRARY}") +- + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libuv + REQUIRED_VARS LIBUV_LIBRARIES LIBUV_INCLUDE_DIR +--- cmake/modules/FindNettle.cmake ++++ cmake/modules/FindNettle.cmake +@@ -30,62 +30,76 @@ + + #]=======================================================================] + +-find_path(NETTLE_INCLUDE_DIR nettle/version.h +- HINTS +- "${NETTLE_DIR}" +- "${NETTLE_DIR}/include" +-) +- +-find_library(NETTLE_LIBRARY NAMES nettle libnettle +- HINTS +- "${NETTLE_DIR}" +- "${NETTLE_DIR}/lib" +-) +- +-find_library(HOGWEED_LIBRARY NAMES hogweed libhogweed +- HINTS +- "${NETTLE_DIR}" +- "${NETTLE_DIR}/lib" +-) +- +-set(NETTLE_LIBRARIES "") +- +-# May need gmp library on Unix. +-if (UNIX) +- find_library(NETTLE_GMP_LIBRARY gmp) +- +- if (NETTLE_GMP_LIBRARY) +- list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}") +- endif () +-endif () +- +-if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY) +- if (NOT TARGET Nettle::Nettle) +- add_library(Nettle::Nettle UNKNOWN IMPORTED) +- set_target_properties(Nettle::Nettle PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" +- INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${NETTLE_LIBRARY}" +- ) +- endif () +- if (NOT TARGET Nettle::Hogweed) +- add_library(Nettle::Hogweed UNKNOWN IMPORTED) +- set_target_properties(Nettle::Hogweed PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${HOGWEED_LIBRARY}" +- ) +- endif () ++include(FindPkgConfig) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PkgNettle IMPORTED_TARGET GLOBAL nettle) ++ pkg_check_modules(PkgHogweed IMPORTED_TARGET GLOBAL QUIET hogweed) ++endif() + +- if (NOT NETTLE_VERSION AND NETTLE_INCLUDE_DIR) +- file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" NETTLE_VER_H REGEX "^#define NETTLE_VERSION_(MAJOR|MINOR) ") +- string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*$" "\\1.\\2" NETTLE_VERSION "${NETTLE_VER_H}") ++if(PkgNettle_FOUND AND PkHogweed_FOUND) ++ set(NETTLE_INCLUDE_DIR ${PkgNettle_INCLUDE_DIRS} ${PkgHogweed_INCLUDE_DIRS}) ++ set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES}) ++ set(NETTLE_VERSION ${PkgNettle_VERSION}) ++ add_library(Nettle::Nettle ALIAS PkgConfig::PkgNettle) ++ add_library(Nettle::Hogweed ALIAS PkgConfig::PkgHogweed) ++else() ++ find_path(NETTLE_INCLUDE_DIR nettle/version.h ++ HINTS ++ "${NETTLE_DIR}" ++ "${NETTLE_DIR}/include" ++ ) ++ ++ find_library(NETTLE_LIBRARY NAMES nettle libnettle ++ HINTS ++ "${NETTLE_DIR}" ++ "${NETTLE_DIR}/lib" ++ ) ++ ++ find_library(HOGWEED_LIBRARY NAMES hogweed libhogweed ++ HINTS ++ "${NETTLE_DIR}" ++ "${NETTLE_DIR}/lib" ++ ) ++ ++ set(NETTLE_LIBRARIES "") ++ ++ # May need gmp library on Unix. ++ if (UNIX) ++ find_library(NETTLE_GMP_LIBRARY gmp) ++ ++ if (NETTLE_GMP_LIBRARY) ++ list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}") ++ endif () + endif () ++ ++ if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY) ++ if (NOT TARGET Nettle::Nettle) ++ add_library(Nettle::Nettle UNKNOWN IMPORTED) ++ set_target_properties(Nettle::Nettle PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" ++ INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${NETTLE_LIBRARY}" ++ ) ++ endif () ++ if (NOT TARGET Nettle::Hogweed) ++ add_library(Nettle::Hogweed UNKNOWN IMPORTED) ++ set_target_properties(Nettle::Hogweed PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ IMPORTED_LOCATION "${HOGWEED_LIBRARY}" ++ ) ++ endif () ++ ++ if (NOT NETTLE_VERSION AND NETTLE_INCLUDE_DIR) ++ file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" NETTLE_VER_H REGEX "^#define NETTLE_VERSION_(MAJOR|MINOR) ") ++ string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*$" "\\1.\\2" NETTLE_VERSION "${NETTLE_VER_H}") ++ endif () ++ endif() ++ ++ list(APPEND NETTLE_LIBRARIES "${NETTLE_LIBRARY}" "${HOGWEED_LIBRARY}") + endif() + +-list(APPEND NETTLE_LIBRARIES "${NETTLE_LIBRARY}" "${HOGWEED_LIBRARY}") +- + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Nettle + REQUIRED_VARS NETTLE_LIBRARIES NETTLE_INCLUDE_DIR diff --git a/recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch b/recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch new file mode 100644 index 0000000000000..fadb8d2d20e5f --- /dev/null +++ b/recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch @@ -0,0 +1,16 @@ +Avoids weird issue on c3i Windows builders: + + CMake Error at source_subfolder/cmake_install.cmake:104 (file): + file INSTALL cannot read symlink + "C:/J/w/cci_PR-2903@2/.conan/data/getdns/1.6.0/_/_/build/dd6d0e14f162a68e24ee52fee674d130eac57dea/source_subfolder/COPYING" + to duplicate at + "C:/J/w/cci_PR-2903@2/.conan/data/getdns/1.6.0/_/_/package/dd6d0e14f162a68e24ee52fee674d130eac57dea/share/doc/getdns/COPYING": + File exists. + Call Stack (most recent call first): + + +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1080,1 +1080,1 @@ +-install(FILES AUTHORS ChangeLog COPYING LICENSE NEWS README.md DESTINATION ${docdir}) ++install(FILES AUTHORS ChangeLog NEWS README.md DESTINATION ${docdir}) diff --git a/recipes/getdns/all/test_package/CMakeLists.txt b/recipes/getdns/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a403dc404b41 --- /dev/null +++ b/recipes/getdns/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/getdns/all/test_package/conanfile.py b/recipes/getdns/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/getdns/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/getdns/all/test_package/test_package.c b/recipes/getdns/all/test_package/test_package.c new file mode 100644 index 0000000000000..c55c14f559026 --- /dev/null +++ b/recipes/getdns/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include "getdns.h" + +#include +#include + +#define CHECK(V) if ((V) != GETDNS_RETURN_GOOD) { \ + fprintf(stderr, "Fail: " #V "!\n"); \ + return 1; \ +} + +int main() +{ + getdns_context *context; + CHECK(getdns_context_create(&context, 1)); + getdns_dict *info = getdns_context_get_api_information(context); + if (info == NULL) { + fprintf(stderr, "Could not get api information\n"); + return 1; + } + char *txt = getdns_pretty_print_dict(info); + printf("%s\n", txt); + free(txt); + getdns_dict_destroy(info); + getdns_context_destroy(context); + return 0; +} diff --git a/recipes/getdns/config.yml b/recipes/getdns/config.yml new file mode 100644 index 0000000000000..10acb3ad5b1e8 --- /dev/null +++ b/recipes/getdns/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.0": + folder: "all" diff --git a/recipes/getopt-for-visual-studio/all/conandata.yml b/recipes/getopt-for-visual-studio/all/conandata.yml new file mode 100644 index 0000000000000..5da98d58a5952 --- /dev/null +++ b/recipes/getopt-for-visual-studio/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20200201": + url: "https://github.com/skandhurkat/Getopt-for-Visual-Studio/archive/6708172892a4d89042b743315e8a52e2d9d5defc.zip" + sha256: "9b50026b3f10c3f6a7340e0074a898d6d1105eef068bf98d90af99770375a465" +patches: + "20200201": + - patch_file: "patches/0001-allow-usage-in-multiple-compilation-units.patch" diff --git a/recipes/getopt-for-visual-studio/all/conanfile.py b/recipes/getopt-for-visual-studio/all/conanfile.py new file mode 100644 index 0000000000000..23ca37727bf10 --- /dev/null +++ b/recipes/getopt-for-visual-studio/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, save +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + + +class GetoptForVisualStudioConan(ConanFile): + name = "getopt-for-visual-studio" + description = "GNU getopt for Visual Studio" + topics = ("getopt", "cli", "command line", "options") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/skandhurkat/Getopt-for-Visual-Studio" + license = "MIT", "BSD-2-Clause" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + 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 not is_msvc(self): + raise ConanInvalidConfiguration("getopt-for-visual-studio is only supported for Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + @property + def _license_text(self): + content = load(self, os.path.join(self.source_folder, "getopt.h")) + return "\n".join(list(l.strip() for l in content[content.find("/**", 3):content.find("#pragma")].split("\n"))) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + copy(self, "getopt.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/getopt-for-visual-studio/all/patches/0001-allow-usage-in-multiple-compilation-units.patch b/recipes/getopt-for-visual-studio/all/patches/0001-allow-usage-in-multiple-compilation-units.patch new file mode 100644 index 0000000000000..4eb2ebb0f6239 --- /dev/null +++ b/recipes/getopt-for-visual-studio/all/patches/0001-allow-usage-in-multiple-compilation-units.patch @@ -0,0 +1,59 @@ +--- getopt.h ++++ getopt.h +@@ -56,7 +56,7 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#pragma warning(disable:4996); ++#pragma warning(disable:4996) + + #define __GETOPT_H__ + +@@ -76,13 +76,13 @@ extern "C" { + #define REPLACE_GETOPT /* use this getopt as the system getopt(3) */ + + #ifdef REPLACE_GETOPT +-int opterr = 1; /* if error message should be printed */ +-int optind = 1; /* index into parent argv vector */ +-int optopt = '?'; /* character checked for validity */ +-#undef optreset /* see getopt.h */ ++static int opterr = 1; /* if error message should be printed */ ++static int optind = 1; /* index into parent argv vector */ ++static int optopt = '?'; /* character checked for validity */ ++#undef optreset /* see getopt.h */ + #define optreset __mingw_optreset +-int optreset; /* reset getopt */ +-char *optarg; /* argument associated with option */ ++static int optreset; /* reset getopt */ ++static char *optarg; /* argument associated with option */ + #endif + + //extern int optind; /* index of first non-option in argv */ +@@ -216,7 +216,7 @@ permute_args(int panonopt_start, int panonopt_end, int opt_end, + * + * [eventually this will replace the BSD getopt] + */ +-int ++static int + getopt(int nargc, char * const *nargv, const char *options) + { + +@@ -610,7 +610,7 @@ start: + * getopt_long -- + * Parse argc/argv argument vector. + */ +-int ++static int + getopt_long(int nargc, char * const *nargv, const char *options, + const struct option *long_options, int *idx) + { +@@ -623,7 +623,7 @@ getopt_long(int nargc, char * const *nargv, const char *options, + * getopt_long_only -- + * Parse argc/argv argument vector. + */ +-int ++static int + getopt_long_only(int nargc, char * const *nargv, const char *options, + const struct option *long_options, int *idx) + { + diff --git a/recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt b/recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1f997dfbcef54 --- /dev/null +++ b/recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(getopt-for-visual-studio) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE getopt-for-visual-studio::getopt-for-visual-studio) diff --git a/recipes/getopt-for-visual-studio/all/test_package/conanfile.py b/recipes/getopt-for-visual-studio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/getopt-for-visual-studio/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/getopt-for-visual-studio/all/test_package/test_package.c b/recipes/getopt-for-visual-studio/all/test_package/test_package.c new file mode 100644 index 0000000000000..cb90987f63f12 --- /dev/null +++ b/recipes/getopt-for-visual-studio/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include +#include + +#include + +int main(int argc, char * argv[]) +{ + int option_index = 0; + int c = getopt(argc, argv, "v"); + switch (c) { + case -1: + puts("No more options"); + break; + case 'v': + puts("version : 1"); + break; + default: + puts("no option found"); + } + return EXIT_SUCCESS; +} diff --git a/recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt b/recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/getopt-for-visual-studio/all/test_v1_package/conanfile.py b/recipes/getopt-for-visual-studio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/getopt-for-visual-studio/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/getopt-for-visual-studio/config.yml b/recipes/getopt-for-visual-studio/config.yml new file mode 100644 index 0000000000000..92c973265790f --- /dev/null +++ b/recipes/getopt-for-visual-studio/config.yml @@ -0,0 +1,3 @@ +versions: + "20200201": + folder: all diff --git a/recipes/gettext/all/conandata.yml b/recipes/gettext/all/conandata.yml new file mode 100644 index 0000000000000..e03cab34f1431 --- /dev/null +++ b/recipes/gettext/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "0.21": + url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz" + sha256: "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12" + "0.20.1": + url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz" + sha256: "66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c" +patches: + "0.21": + - patch_file: "patches/0002-memmove-is-intrinsic-function-on-MSVC.patch" + - patch_file: "patches/0004-autopoint-relocatable.patch" + patch_description: "relocatable autopoint with resources relative to script" + patch_type: "conan" + "0.20.1": + - patch_file: "patches/0.20.1-0001-fix-build-errors-with-MSVC.patch" + - patch_file: "patches/0002-memmove-is-intrinsic-function-on-MSVC.patch" + - patch_file: "patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch" + - patch_file: "patches/0004-autopoint-relocatable.patch" + patch_description: "relocatable autopoint with resources relative to script" + patch_type: "conan" diff --git a/recipes/gettext/all/conanfile.py b/recipes/gettext/all/conanfile.py new file mode 100644 index 0000000000000..72a7afc2b30cc --- /dev/null +++ b/recipes/gettext/all/conanfile.py @@ -0,0 +1,148 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path, unix_path_package_info_legacy +from conan.tools.scm import Version + +required_conan_version = ">=1.57.0" + +class GetTextConan(ConanFile): + name = "gettext" + package_type = "application" + description = "An internationalization and localization system for multilingual programs" + topics = ("intl", "libintl", "i18n") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/gettext" + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def requirements(self): + self.requires("libiconv/1.17") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.win_bash = True + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.build_requires("automake/1.16.5") + + def validate(self): + if Version(self.version) < "0.21" and is_msvc(self): + raise ConanInvalidConfiguration("MSVC builds of gettext for versions < 0.21 are not supported.") # FIXME: it used to be possible. What changed? + + def package_id(self): + del self.info.settings.compiler + + 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() + + tc = AutotoolsToolchain(self) + libiconv = self.dependencies["libiconv"] + libiconv_root = unix_path(self, libiconv.package_folder) + tc.configure_args.extend([ + "HELP2MAN=/bin/true", + "EMACS=no", + "--datarootdir=${prefix}/res", + "--with-libiconv-prefix={}".format(libiconv_root), + "--disable-shared", + "--disable-static", + "--disable-nls", + "--disable-dependency-tracking", + "--enable-relocatable", + "--disable-c++", + "--disable-java", + "--disable-csharp", + "--disable-libasprintf", + "--disable-curses", + ]) + + if is_msvc(self): + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") #TODO: reference github issue + + # 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 + iconv_includedir = unix_path(self, libiconv.cpp_info.aggregated_components().includedirs[0]) + iconv_libdir = unix_path(self, libiconv.cpp_info.aggregated_components().libdirs[0]) + tc.extra_cflags.append(f"-I{iconv_includedir}") + tc.extra_ldflags.append(f"-L{iconv_libdir}") + + env = Environment() + compile_wrapper = self.dependencies.build["automake"].conf_info.get("user.automake:compile-wrapper") + lib_wrapper = self.dependencies.build["automake"].conf_info.get("user.automake:lib-wrapper") + env.define("CC", "{} cl -nologo".format(unix_path(self, compile_wrapper))) + env.define("LD", "link -nologo") + env.define("NM", "dumpbin -symbols") + env.define("STRIP", ":") + env.define("AR", "{} lib".format(unix_path(self, lib_wrapper))) + env.define("RANLIB", ":") + + # One of the checks performed by the configure script requires this as a preprocessor flag + # rather than a C compiler flag + env.prepend("CPPFLAGS", f"-I{iconv_includedir}") + + windres_arch = {"x86": "i686", "x86_64": "x86-64"}[str(self.settings.arch)] + env.define("RC", f"windres --target=pe-{windres_arch}") + env.vars(self).save_script("conanbuild_msvc") + + tc.generate() + + def build(self): + apply_conandata_patches(self) + + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + rmdir(self, os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "include")) + rmdir(self, os.path.join(self.package_folder, "share", "doc")) + rmdir(self, os.path.join(self.package_folder, "share", "info")) + rmdir(self, os.path.join(self.package_folder, "share", "man")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + aclocal = os.path.join(self.package_folder, "res", "aclocal") + autopoint = os.path.join(self.package_folder, "bin", "autopoint") + self.buildenv_info.append_path("ACLOCAL_PATH", aclocal) + self.buildenv_info.define_path("AUTOPOINT", autopoint) + + # TODO: the following can be removed when the recipe supports Conan >= 2.0 only + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(aclocal)) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, aclocal)) + + self.output.info("Setting AUTOPOINT environment variable: {}".format(autopoint)) + self.env_info.AUTOPOINT = unix_path_package_info_legacy(self, autopoint) diff --git a/recipes/gettext/all/patches/0.20.1-0001-fix-build-errors-with-MSVC.patch b/recipes/gettext/all/patches/0.20.1-0001-fix-build-errors-with-MSVC.patch new file mode 100644 index 0000000000000..194989aac247c --- /dev/null +++ b/recipes/gettext/all/patches/0.20.1-0001-fix-build-errors-with-MSVC.patch @@ -0,0 +1,362 @@ +From b33dca8eecdc1eb30bb3747df563faabf729f001 Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Thu, 4 Jul 2019 16:27:33 +0200 +Subject: [PATCH 1/2] build: Fix build errors with MSVC. + +* gettext-tools/libgettextpo/exported.sh.in: Remove one level of eval. +* gettext-tools/libgettextpo/Makefile.am (config.h): Redirect compiler output to +stderr. Remove symbols that contain an '@'. +* libtextstyle/lib/Makefile.am (config.h): Likewise. + +build: Fix build error with MSVC. + +* gettext-runtime/intl/export.h (LIBINTL_DLL_EXPORTED): Define differently for +MSVC. + +build: Fix build error with MSVC. + +* gettext-runtime/intl/Makefile.am (INTL_WINDOWS_LIBS): New variable. +(OTHER_LDFLAGS): Add it. + +build: Fix build errors with MSVC. + +* gettext-tools/src/lang-table.h (language_table, language_variant_table): +Declare with C linkage. +* gettext-tools/src/read-po.h (input_format_po): Likewise. +* gettext-tools/src/read-properties.h (input_format_properties): Likewise. +* gettext-tools/src/read-stringtable.h (input_format_stringtable): Likewise. +* gettext-tools/src/write-properties.h (output_format_properties): Likewise. +* gettext-tools/src/write-stringtable.h (output_format_stringtable): Likewise. + +intl: Don't export the glwthread* symbols from libintl on native Windows. + +* gettext-runtime/intl/Makefile.am (OTHER_LDFLAGS): Add an -export-symbols-regex +option. +--- + gettext-runtime/intl/Makefile.in | 10 +++++++++- + gettext-runtime/intl/export.h | 2 ++ + gettext-tools/intl/Makefile.in | 10 +++++++++- + gettext-tools/libgettextpo/Makefile.in | 4 ++-- + gettext-tools/libgettextpo/exported.sh.in | 5 ++--- + gettext-tools/src/lang-table.h | 14 +++++++++++++- + gettext-tools/src/read-po.h | 14 +++++++++++++- + gettext-tools/src/read-properties.h | 14 +++++++++++++- + gettext-tools/src/read-stringtable.h | 14 +++++++++++++- + gettext-tools/src/write-properties.h | 14 +++++++++++++- + gettext-tools/src/write-stringtable.h | 14 +++++++++++++- + libtextstyle/lib/Makefile.in | 4 ++-- + 12 files changed, 104 insertions(+), 15 deletions(-) + +diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in +index fe59cd4aa..10aaa89fe 100644 +--- a/gettext-runtime/intl/Makefile.in ++++ b/gettext-runtime/intl/Makefile.in +@@ -1416,6 +1416,11 @@ libintl_la_DEPENDENCIES = $(WOE32_LIBADD) + libgnuintl_la_LIBADD = $(WOE32_LIBADD) + libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD) + ++# langprefs.c (_nl_language_preferences_win32_95) uses functions from ++# advapi32.dll. ++@WOE32_TRUE@INTL_WINDOWS_LIBS = -ladvapi32 ++@WOE32_FALSE@INTL_WINDOWS_LIBS = ++ + # Libtool's library version information for libintl. + # Before making a gettext release, you must change this according to the + # libtool documentation, section "Library interface versions". +@@ -1424,8 +1429,11 @@ LTV_REVISION = 6 + LTV_AGE = 1 + + # How to build libintl.la and libgnuintl.la. ++# Limit the exported symbols: Don't export glwthread* (from gnulib modules). + OTHER_LDFLAGS = \ +- @LTLIBICONV@ @INTL_MACOSX_LIBS@ @LTLIBTHREAD@ -no-undefined \ ++ @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \ ++ -no-undefined \ ++ -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) + +diff --git a/gettext-runtime/intl/export.h b/gettext-runtime/intl/export.h +index b5c47ad5b..10253e338 100644 +--- a/gettext-runtime/intl/export.h ++++ b/gettext-runtime/intl/export.h +@@ -1,6 +1,8 @@ + + #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL + #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBINTL ++#define LIBINTL_DLL_EXPORTED __declspec(dllexport) + #else + #define LIBINTL_DLL_EXPORTED + #endif +diff --git a/gettext-tools/intl/Makefile.in b/gettext-tools/intl/Makefile.in +index 9bdfe2238..6eabf22af 100644 +--- a/gettext-tools/intl/Makefile.in ++++ b/gettext-tools/intl/Makefile.in +@@ -2120,6 +2120,11 @@ libintl_la_DEPENDENCIES = $(WOE32_LIBADD) + libgnuintl_la_LIBADD = $(WOE32_LIBADD) + libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD) + ++# langprefs.c (_nl_language_preferences_win32_95) uses functions from ++# advapi32.dll. ++@WOE32_TRUE@INTL_WINDOWS_LIBS = -ladvapi32 ++@WOE32_FALSE@INTL_WINDOWS_LIBS = ++ + # Libtool's library version information for libintl. + # Before making a gettext release, you must change this according to the + # libtool documentation, section "Library interface versions". +@@ -2128,8 +2133,11 @@ LTV_REVISION = 6 + LTV_AGE = 1 + + # How to build libintl.la and libgnuintl.la. ++# Limit the exported symbols: Don't export glwthread* (from gnulib modules). + OTHER_LDFLAGS = \ +- @LTLIBICONV@ @INTL_MACOSX_LIBS@ @LTLIBTHREAD@ -no-undefined \ ++ @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \ ++ -no-undefined \ ++ -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) + +diff --git a/gettext-tools/libgettextpo/Makefile.in b/gettext-tools/libgettextpo/Makefile.in +index 59356fa1d..444ef7807 100644 +--- a/gettext-tools/libgettextpo/Makefile.in ++++ b/gettext-tools/libgettextpo/Makefile.in +@@ -2942,8 +2942,8 @@ config.h: $(BUILT_SOURCES) + ;; \ + esac; \ + done; \ +- } 5>&1 \ +- | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \ ++ } 5>&1 1>&2 \ ++ | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | sed -e 's,^obstack_free$$,__obstack_free,' \ + | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \ + if test -f config.h; then \ +diff --git a/gettext-tools/libgettextpo/exported.sh.in b/gettext-tools/libgettextpo/exported.sh.in +index 2e6b89ab6..be7fb38bd 100644 +--- a/gettext-tools/libgettextpo/exported.sh.in ++++ b/gettext-tools/libgettextpo/exported.sh.in +@@ -1,6 +1,6 @@ + #! /bin/sh + # +-# Copyright (C) 2006 Free Software Foundation, Inc. ++# Copyright (C) 2006, 2009, 2019 Free Software Foundation, Inc. + # + # 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 +@@ -20,5 +20,4 @@ + # This is a separate script because $(GLOBAL_SYMBOL_PIPE) cannot be used in a + # Makefile, since it may contain dollar signs. + +-nm_cmd="@NM@ $1 | @GLOBAL_SYMBOL_PIPE@" +-eval $nm_cmd ++@NM@ "$1" | @GLOBAL_SYMBOL_PIPE@ +diff --git a/gettext-tools/src/lang-table.h b/gettext-tools/src/lang-table.h +index 7ac197669..ebf193b98 100644 +--- a/gettext-tools/src/lang-table.h ++++ b/gettext-tools/src/lang-table.h +@@ -1,5 +1,5 @@ + /* Table of languages. +- Copyright (C) 2001-2007 Free Software Foundation, Inc. ++ Copyright (C) 2001-2007, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2005. + + This program is free software: you can redistribute it and/or modify +@@ -20,6 +20,12 @@ + + #include + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + struct language_table_entry + { + const char *code; +@@ -32,4 +38,10 @@ extern const size_t language_table_size; + extern struct language_table_entry language_variant_table[]; + extern const size_t language_variant_table_size; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _LANG_TABLE_H */ +diff --git a/gettext-tools/src/read-po.h b/gettext-tools/src/read-po.h +index 6852a22a0..98fc893b2 100644 +--- a/gettext-tools/src/read-po.h ++++ b/gettext-tools/src/read-po.h +@@ -1,5 +1,5 @@ + /* Reading PO files. +- Copyright (C) 2006 Free Software Foundation, Inc. ++ Copyright (C) 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2006. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .po / .pot file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_po; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_PO_H */ +diff --git a/gettext-tools/src/read-properties.h b/gettext-tools/src/read-properties.h +index e04abe524..9c299e6c2 100644 +--- a/gettext-tools/src/read-properties.h ++++ b/gettext-tools/src/read-properties.h +@@ -1,5 +1,5 @@ + /* Reading Java .properties files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .properties file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_properties; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_PROPERTIES_H */ +diff --git a/gettext-tools/src/read-stringtable.h b/gettext-tools/src/read-stringtable.h +index 43d1ba505..4a107f2ff 100644 +--- a/gettext-tools/src/read-stringtable.h ++++ b/gettext-tools/src/read-stringtable.h +@@ -1,5 +1,5 @@ + /* Reading NeXTstep/GNUstep .strings files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .strings file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_stringtable; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_STRINGTABLE_H */ +diff --git a/gettext-tools/src/write-properties.h b/gettext-tools/src/write-properties.h +index f0d18a7e4..7671afb30 100644 +--- a/gettext-tools/src/write-properties.h ++++ b/gettext-tools/src/write-properties.h +@@ -1,5 +1,5 @@ + /* Writing Java .properties files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "write-catalog.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a PO file in Java .properties syntax. */ + extern DLL_VARIABLE const struct catalog_output_format output_format_properties; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _WRITE_PROPERTIES_H */ +diff --git a/gettext-tools/src/write-stringtable.h b/gettext-tools/src/write-stringtable.h +index 7d4981826..af0b081c8 100644 +--- a/gettext-tools/src/write-stringtable.h ++++ b/gettext-tools/src/write-stringtable.h +@@ -1,5 +1,5 @@ + /* Writing NeXTstep/GNUstep .strings files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "write-catalog.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a PO file in .strings syntax. */ + extern DLL_VARIABLE const struct catalog_output_format output_format_stringtable; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _WRITE_STRINGTABLE_H */ +diff --git a/libtextstyle/lib/Makefile.in b/libtextstyle/lib/Makefile.in +index 4a11d73a1..ebee4845a 100644 +--- a/libtextstyle/lib/Makefile.in ++++ b/libtextstyle/lib/Makefile.in +@@ -4536,8 +4536,8 @@ config.h: $(BUILT_SOURCES) libtextstyle.sym + ;; \ + esac; \ + done; \ +- } 5>&1 \ +- | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \ ++ } 5>&1 1>&2 \ ++ | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | LC_ALL=C join -v 1 - libtextstyle.sym \ + | sed -e 's,^\(.*\)$$,#define \1 libtextstyle_\1,' > config.h-t; \ + } 6>&1 && \ +-- +2.21.0.windows.1 + diff --git a/recipes/gettext/all/patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch b/recipes/gettext/all/patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch new file mode 100644 index 0000000000000..f5e7045d82247 --- /dev/null +++ b/recipes/gettext/all/patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch @@ -0,0 +1,29 @@ +From e81ca090d69837e4f1a3c41fe2345c77b38f756a Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Fri, 12 Jul 2019 13:11:06 +0200 +Subject: [PATCH 3/3] Reported by Gabor Z. Papp . + +This is a regression from 2018-11-25. + +* gettext-tools/configure.ac (PRELOADABLE_LIBINTL): Set to false if +--disable-shared was specified. +--- + gettext-tools/configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gettext-tools/configure b/gettext-tools/configure +index 5a831d6da..4be36c383 100755 +--- a/gettext-tools/configure ++++ b/gettext-tools/configure +@@ -23901,7 +23901,7 @@ else + PACKAGE_IS_GETTEXT_TOOLS_FALSE= + fi + +- if test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes; then ++ if test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test $enable_shared = yes; then + PRELOADABLE_LIBINTL_TRUE= + PRELOADABLE_LIBINTL_FALSE='#' + else +-- +2.21.0 + diff --git a/recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch b/recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch new file mode 100644 index 0000000000000..dbbf7b795a53e --- /dev/null +++ b/recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch @@ -0,0 +1,72 @@ +From 9b2e480278d36c4d7b6f988621a3a9f699cc730f Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 10 Jul 2019 03:55:56 -0700 +Subject: [PATCH 2/2] - memmove is intrinsic function on MSVC + +Signed-off-by: SSE4 +--- + gettext-runtime/gnulib-lib/memmove.c | 4 ++++ + gettext-tools/gnulib-lib/memmove.c | 4 ++++ + gettext-tools/gnulib-lib/memset.c | 4 ++++ + 3 files changed, 12 insertions(+) + +diff --git a/gettext-runtime/gnulib-lib/memmove.c b/gettext-runtime/gnulib-lib/memmove.c +index 0f040540c..bc8883ae4 100644 +--- a/gettext-runtime/gnulib-lib/memmove.c ++++ b/gettext-runtime/gnulib-lib/memmove.c +@@ -7,6 +7,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memmove (void *dest0, void const *source0, size_t length) + { +@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) + } + return dest0; + } ++ ++#endif +diff --git a/gettext-tools/gnulib-lib/memmove.c b/gettext-tools/gnulib-lib/memmove.c +index 0f040540c..bc8883ae4 100644 +--- a/gettext-tools/gnulib-lib/memmove.c ++++ b/gettext-tools/gnulib-lib/memmove.c +@@ -7,6 +7,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memmove (void *dest0, void const *source0, size_t length) + { +@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) + } + return dest0; + } ++ ++#endif +diff --git a/gettext-tools/gnulib-lib/memset.c b/gettext-tools/gnulib-lib/memset.c +index 4e60124e7..b595fa966 100644 +--- a/gettext-tools/gnulib-lib/memset.c ++++ b/gettext-tools/gnulib-lib/memset.c +@@ -18,6 +18,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memset (void *str, int c, size_t len) + { +@@ -27,3 +29,5 @@ memset (void *str, int c, size_t len) + *st++ = c; + return str; + } ++ ++#endif +-- +2.21.0.windows.1 + diff --git a/recipes/gettext/all/patches/0004-autopoint-relocatable.patch b/recipes/gettext/all/patches/0004-autopoint-relocatable.patch new file mode 100644 index 0000000000000..29613a326dfbf --- /dev/null +++ b/recipes/gettext/all/patches/0004-autopoint-relocatable.patch @@ -0,0 +1,27 @@ +diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in +index 3a24eee..a53c65a 100644 +--- a/gettext-tools/misc/autopoint.in ++++ b/gettext-tools/misc/autopoint.in +@@ -27,9 +27,10 @@ archive_version=@ARCHIVE_VERSION@ + + # Set variables + # - gettext_datadir directory where the data files are stored. +-prefix="@prefix@" +-datarootdir="@datarootdir@" +-: ${gettext_datadir="@datadir@/gettext"} ++scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) ++prefix="$scriptdir/.." ++datarootdir="$prefix/res" ++: ${gettext_datadir="${datarootdir}/gettext"} + : ${AUTOM4TE=autom4te} + + # func_tmpdir +@@ -130,7 +131,7 @@ func_find_prefixes () + } + if test "@RELOCATABLE@" = yes; then + exec_prefix="@exec_prefix@" +- bindir="@bindir@" ++ bindir="$prefix/bin" + orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables + func_find_curr_installdir # determine curr_installdir + func_find_prefixes diff --git a/recipes/gettext/all/test_package/conanfile.py b/recipes/gettext/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8ef53a96f7ded --- /dev/null +++ b/recipes/gettext/all/test_package/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualRunEnv, VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "configure.ac", + 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) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + 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") + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + at = AutotoolsToolchain(self) + at.generate() + + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + env.define("LD", "link -nologo") + env.vars(self).save_script("conanbuild_libsmacker_msvc") + + runenv = VirtualRunEnv(self) + runenv.generate() + + def build(self): + + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + + + def test(self): + if can_run(self): + for exe in ["gettext", "ngettext", "msgcat", "msgmerge"]: + self.run("{} --version".format(exe), env="conanrun") diff --git a/recipes/gettext/all/test_package/src/configure.ac b/recipes/gettext/all/test_package/src/configure.ac new file mode 100644 index 0000000000000..b2c4f352a64de --- /dev/null +++ b/recipes/gettext/all/test_package/src/configure.ac @@ -0,0 +1,6 @@ +AC_INIT([test_package_gettext],[1.0]) +AC_PREREQ([2.69]) + +AM_GNU_GETTEXT_REQUIRE_VERSION([0.20]) +AM_GNU_GETTEXT([external], [need-ngettext]) +AM_ICONV diff --git a/recipes/gettext/all/test_v1_package/conanfile.py b/recipes/gettext/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9e810ecf433fc --- /dev/null +++ b/recipes/gettext/all/test_v1_package/conanfile.py @@ -0,0 +1,51 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +import contextlib +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler" + exports_sources = "configure.ac", + 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.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextlib.contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + env = { + "CC": "cl -nologo", + "LD": "link -nologo", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), os.path.join(self.build_folder, src)) + + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows, run_environment=True) + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + autotools.configure() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + for exe in ["gettext", "ngettext", "msgcat", "msgmerge"]: + self.run("{} --version".format(exe), run_environment=True) diff --git a/recipes/gettext/all/test_v1_package/configure.ac b/recipes/gettext/all/test_v1_package/configure.ac new file mode 100644 index 0000000000000..b2c4f352a64de --- /dev/null +++ b/recipes/gettext/all/test_v1_package/configure.ac @@ -0,0 +1,6 @@ +AC_INIT([test_package_gettext],[1.0]) +AC_PREREQ([2.69]) + +AM_GNU_GETTEXT_REQUIRE_VERSION([0.20]) +AM_GNU_GETTEXT([external], [need-ngettext]) +AM_ICONV diff --git a/recipes/gettext/config.yml b/recipes/gettext/config.yml new file mode 100644 index 0000000000000..dc03f51a1d462 --- /dev/null +++ b/recipes/gettext/config.yml @@ -0,0 +1,5 @@ +versions: + "0.21": + folder: all + "0.20.1": + folder: all diff --git a/recipes/gf-complete/all/conandata.yml b/recipes/gf-complete/all/conandata.yml new file mode 100644 index 0000000000000..58f9543628ba7 --- /dev/null +++ b/recipes/gf-complete/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "cci.20170410": + url: "https://github.com/ceph/gf-complete/archive/a6862d10c9db467148f20eef2c6445ac9afd94d8.tar.gz" + sha256: "f7a8f61eb3c6718b4d8011c75b75a1bedd820e6851d71a65e491af805e8749aa" + "1.03": # 20141225 + url: "https://github.com/ceph/gf-complete/archive/58eebabd204998364355eee293402929502bf1a9.tar.gz" + sha256: "ba9d90b5818b8356073fdc21704bdd8b70e80aceb51700374386393f39cb1b0e" +patches: + "cci.20170410": + - patch_file: "patches/0001-fix-msvc-cci.20170410.patch" + base_path: "source_subfolder" diff --git a/recipes/gf-complete/all/conanfile.py b/recipes/gf-complete/all/conanfile.py new file mode 100644 index 0000000000000..0947d375fcf7d --- /dev/null +++ b/recipes/gf-complete/all/conanfile.py @@ -0,0 +1,162 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import contextlib +import os + +required_conan_version = ">=1.33.0" + + +class GfCompleteConan(ConanFile): + name = "gf-complete" + description = "A library for Galois Field arithmetic" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ceph/gf-complete" + license = "BSD-3-Clause" + topics = ("galois field", "math", "algorithms") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "neon": [True, False, "auto"], + "sse": [True, False, "auto"], + "avx": [True, False, "auto"] + } + default_options = { + "shared": False, + "fPIC": True, + "neon": "auto", + "sse": "auto", + "avx": "auto" + } + + 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 config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.sse + del self.options.avx + if "arm" not in self.settings.arch: + del self.options.neon + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.settings.compiler == "Visual Studio": + self.requires("getopt-for-visual-studio/20200201") + + def validate(self): + if self.settings.compiler == "Visual Studio": + if self.options.shared: + raise ConanInvalidConfiguration("gf-complete doesn't support shared with Visual Studio") + if self.version == "1.03": + raise ConanInvalidConfiguration("gf-complete 1.03 doesn't support Visual Studio") + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + 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) + # Don't build tests and examples (and also tools if Visual Studio) + to_build = ["src"] + if self.settings.compiler != "Visual Studio": + to_build.append("tools") + tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.am"), + "SUBDIRS = src tools test examples", + "SUBDIRS = {}".format(" ".join(to_build))) + # Honor build type settings and fPIC option + for subdir in ["src", "tools"]: + for flag in ["-O3", "-fPIC"]: + tools.replace_in_file(os.path.join(self._source_subfolder, subdir, "Makefile.am"), + flag, "") + + @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 + + def _configure_autotools(self): + if self._autotools: + return self._autotools + + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + if self.settings.compiler == "Visual Studio": + self._autotools.flags.append("-FS") + elif "x86" in self.settings.arch: + self._autotools.flags.append("-mstackrealign") + + 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)), + ] + + if "arm" in self.settings.arch: + if self.options.neon != "auto": + conf_args.append("--enable-neon={}".format(yes_no(self.options.neon))) + + if self.settings.arch in ["x86", "x86_64"]: + if self.options.sse != "auto": + conf_args.append("--enable-sse={}".format(yes_no(self.options.sse))) + + if self.options.avx != "auto": + conf_args.append("--enable-avx={}".format(yes_no(self.options.avx))) + + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + + return self._autotools + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package_info(self): + self.cpp_info.libs = ["gf_complete"] + + if self.settings.compiler != "Visual Studio": + 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/gf-complete/all/patches/0001-fix-msvc-cci.20170410.patch b/recipes/gf-complete/all/patches/0001-fix-msvc-cci.20170410.patch new file mode 100644 index 0000000000000..8a4f75ba1757e --- /dev/null +++ b/recipes/gf-complete/all/patches/0001-fix-msvc-cci.20170410.patch @@ -0,0 +1,70 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -11,13 +11,13 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include + # with SIMD_FLAGS, this static library will get linked into gf_complete.so + noinst_LTLIBRARIES = libgf_util.la + libgf_util_la_SOURCES = gf_method.c +-libgf_util_la_CFLAGS = -O3 -fPIC -Wsign-compare ++libgf_util_la_CFLAGS = -O3 -fPIC + + # we narrowly use SIMD_FLAGS for code that needs it + lib_LTLIBRARIES = libgf_complete.la + libgf_complete_la_SOURCES = gf.c gf_wgen.c gf_w4.c gf_w8.c gf_w16.c gf_w32.c \ + gf_w64.c gf_w128.c gf_rand.c gf_general.c gf_cpu.c +-libgf_complete_la_CFLAGS = -O3 $(SIMD_FLAGS) -fPIC -Wsign-compare ++libgf_complete_la_CFLAGS = -O3 $(SIMD_FLAGS) -fPIC + libgf_complete_la_LIBADD = libgf_util.la + + if HAVE_NEON +--- a/src/gf.c ++++ b/src/gf.c +@@ -13,6 +13,10 @@ + #include + #include + #include "gf_cpu.h" ++#ifdef _MSC_VER ++#include ++#define bzero(s, n) {memset(s, 0, n);} ++#endif + + int _gf_errno = GF_E_DEFAULT; + +--- a/src/gf_w16.c ++++ b/src/gf_w16.c +@@ -13,6 +13,10 @@ + #include + #include "gf_w16.h" + #include "gf_cpu.h" ++#ifdef _MSC_VER ++#include ++#define bzero(s, n) {memset(s, 0, n);} ++#endif + + #define AB2(ip, am1 ,am2, b, t1, t2) {\ + t1 = (b << 1) & am1;\ +--- a/src/gf_w4.c ++++ b/src/gf_w4.c +@@ -13,6 +13,10 @@ + #include + #include "gf_w4.h" + #include "gf_cpu.h" ++#ifdef _MSC_VER ++#include ++#define bzero(s, n) {memset(s, 0, n);} ++#endif + + #define AB2(ip, am1 ,am2, b, t1, t2) {\ + t1 = (b << 1) & am1;\ +--- a/src/gf_w8.c ++++ b/src/gf_w8.c +@@ -14,6 +14,10 @@ + #include + #include + #include "gf_cpu.h" ++#ifdef _MSC_VER ++#include ++#define bzero(s, n) {memset(s, 0, n);} ++#endif + + #define AB2(ip, am1 ,am2, b, t1, t2) {\ + t1 = (b << 1) & am1;\ diff --git a/recipes/gf-complete/all/test_package/CMakeLists.txt b/recipes/gf-complete/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd126a732c403 --- /dev/null +++ b/recipes/gf-complete/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/gf-complete/all/test_package/conanfile.py b/recipes/gf-complete/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6bc1a2f31ef01 --- /dev/null +++ b/recipes/gf-complete/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gf-complete/all/test_package/test_package.c b/recipes/gf-complete/all/test_package/test_package.c new file mode 100644 index 0000000000000..7ef15121f223f --- /dev/null +++ b/recipes/gf-complete/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main(void) { + gf_t gf; + gf_init_easy(&gf, 16); + return 0; +} diff --git a/recipes/gf-complete/config.yml b/recipes/gf-complete/config.yml new file mode 100644 index 0000000000000..661448b09007f --- /dev/null +++ b/recipes/gf-complete/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20170410": + folder: all + "1.03": # 20141225 + folder: all diff --git a/recipes/gflags/all/conandata.yml b/recipes/gflags/all/conandata.yml new file mode 100644 index 0000000000000..f438b0ba1c510 --- /dev/null +++ b/recipes/gflags/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.2": + sha256: 34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf + url: https://github.com/gflags/gflags/archive/v2.2.2.tar.gz diff --git a/recipes/gflags/all/conanfile.py b/recipes/gflags/all/conanfile.py new file mode 100644 index 0000000000000..985562e799cab --- /dev/null +++ b/recipes/gflags/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class GflagsConan(ConanFile): + name = "gflags" + description = "The gflags package contains a C++ library that implements commandline flags processing" + topics = ("cli", "flags", "commandline") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gflags/gflags" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "nothreads": [True, False], + "namespace": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "nothreads": True, + "namespace": "gflags", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_gflags_LIB"] = not self.options.nothreads + tc.variables["BUILD_gflags_nothreads_LIB"] = self.options.nothreads + tc.variables["BUILD_PACKAGING"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["INSTALL_HEADERS"] = True + tc.variables["INSTALL_SHARED_LIBS"] = self.options.shared + tc.variables["INSTALL_STATIC_LIBS"] = not self.options.shared + tc.variables["REGISTER_BUILD_DIR"] = False + tc.variables["REGISTER_INSTALL_PREFIX"] = False + tc.variables["GFLAGS_NAMESPACE"] = self.options.namespace + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"gflags": "gflags::gflags"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gflags") + self.cpp_info.set_property("cmake_target_name", "gflags::gflags") + self.cpp_info.set_property("cmake_target_aliases", ["gflags"]) + self.cpp_info.set_property("pkg_config_name", "gflags") + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["shlwapi"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/gflags/all/test_package/CMakeLists.txt b/recipes/gflags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5b23a3ac87bb6 --- /dev/null +++ b/recipes/gflags/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(gflags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gflags::gflags) diff --git a/recipes/gflags/all/test_package/conanfile.py b/recipes/gflags/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gflags/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gflags/all/test_package/test_package.cpp b/recipes/gflags/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..52d36fe7643c5 --- /dev/null +++ b/recipes/gflags/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +DEFINE_bool(big_menu, true, "Include 'advanced' options in the menu listing"); +DEFINE_string(languages, "english,french,german", + "comma-separated list of languages to offer in the 'lang' menu"); + +int main(int argc, char **argv) { + GFLAGS_NAMESPACE::ShowUsageWithFlags(argv[0]); + GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true); + return 0; +} diff --git a/recipes/gflags/all/test_v1_package/CMakeLists.txt b/recipes/gflags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gflags/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gflags/all/test_v1_package/conanfile.py b/recipes/gflags/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gflags/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gflags/config.yml b/recipes/gflags/config.yml new file mode 100644 index 0000000000000..6d6cfc66eae07 --- /dev/null +++ b/recipes/gflags/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.2": + folder: all diff --git a/recipes/gfortran/all/conandata.yml b/recipes/gfortran/all/conandata.yml new file mode 100644 index 0000000000000..7baa9c9b5ccf6 --- /dev/null +++ b/recipes/gfortran/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "10.2": + "Windows": + "x86_64": + url: "https://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/ray_linn/GCC-10.X-with-ada/GCC-10.2.0-crt-8.0.0-with-ada-20201019.7z" + sha256: "5c3fc254494bc24eb201870f4b781d401cf7279bd03ea1aba6f2ffae771ded44" + "Linux": + "x86_64": + url: "https://gfortran.meteodat.ch/download/x86_64/releases/gcc-10.2.0.tar.xz" + sha256: "5cfaf152db442bb967963ca62d4590980cb2664c5902c1a9578fc8a9c6efe40f" + "Macos": + "x86_64": + url: "https://downloads.sourceforge.net/project/hpc/hpc/g95/gfortran-10.2-bin.tar.gz" + sha256: "2de46f571eefc2b544db4ed6c958c78a5e3e78c4b4b5daab38aabc1b08dd5666" diff --git a/recipes/gfortran/all/conanfile.py b/recipes/gfortran/all/conanfile.py new file mode 100644 index 0000000000000..209997c47d1fa --- /dev/null +++ b/recipes/gfortran/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, load, save, download +import os + +required_conan_version = ">=1.46.0" + +class GFortranConan(ConanFile): + name = "gfortran" + description = "The Fortran compiler front end and run-time libraries for GCC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gcc.gnu.org/fortran" + topics = ("gnu", "gcc", "fortran", "compiler") + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + short_paths = True + + def validate(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("No binaries available for the architecture '{}'.".format(self.settings.arch)) + if str(self.settings.os) not in ("Windows", "Linux", "Macos"): + raise ConanInvalidConfiguration("No binaries available for the OS '{}'.".format(self.settings.os)) + + def build_requirements(self): + if self.settings.os == "Windows": + self.tool_requires("7zip/19.00") + + def build(self): + if self.settings.os == "Windows": + filename = os.path.join(self.build_folder, "GCC-10.2.0-crt-8.0.0-with-ada-20201019.7z") + download(self, **self.conan_data["sources"][self.version][str(self.settings.os)]["x86_64"], filename=filename) + self.run(f"7z x {filename}") + else: + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)]["x86_64"], + destination=self.build_folder, strip_root=True) + + @property + def _archive_contents_path(self): + if self.settings.os == "Macos": + return os.path.join(self.build_folder, "local") + elif self.settings.os == "Windows": + return os.path.join(self.build_folder, "mingw64") + else: + return os.path.join(self.build_folder) + + @property + def _license_path(self): + return os.path.join(self._archive_contents_path, "share", "info") + + @property + def _library_source_path(self): + return os.path.join(self._archive_contents_path, { + "Linux": "lib64", + "Macos": "lib", + "Windows": os.path.join("lib", "gcc", "x86_64-w64-mingw32", "10.2.0") + }[str(self.settings.os)]) + + def _extract_license(self): + info = load(self, os.path.join(self._license_path, "gfortran.info")) + license_contents = info[info.find("Version 3"):info.find("END OF TERMS", 1)] + save(self, os.path.join(self.build_folder, "LICENSE"), license_contents) + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type # The binaries are not specific + + def package(self): + self._extract_license() + copy(self, "LICENSE", src=self.build_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "gfortran*", src=os.path.join(self._archive_contents_path, "bin"), dst=os.path.join(self.package_folder, "bin")) + copy(self, "libgfortran.a", src=self._library_source_path, dst=os.path.join(self.package_folder, "lib")) + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.cpp_info.includedirs = [] + self.env_info.PATH.append(bin_path) + self.cpp_info.libs = ["gfortran"] diff --git a/recipes/gfortran/all/test_package/conanfile.py b/recipes/gfortran/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9d3aaf213929b --- /dev/null +++ b/recipes/gfortran/all/test_package/conanfile.py @@ -0,0 +1,14 @@ +from conan import ConanFile +from conan.tools.build import can_run + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("gfortran --version", env="conanrun") diff --git a/recipes/gfortran/all/test_v1_package/conanfile.py b/recipes/gfortran/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c9380771129c0 --- /dev/null +++ b/recipes/gfortran/all/test_v1_package/conanfile.py @@ -0,0 +1,8 @@ +from conans import ConanFile, tools + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("gfortran --version", run_environment=True) diff --git a/recipes/gfortran/config.yml b/recipes/gfortran/config.yml new file mode 100644 index 0000000000000..4d10e8ecf55d3 --- /dev/null +++ b/recipes/gfortran/config.yml @@ -0,0 +1,3 @@ +versions: + "10.2": + folder: all diff --git a/recipes/ghc-filesystem/all/conandata.yml b/recipes/ghc-filesystem/all/conandata.yml new file mode 100644 index 0000000000000..934a94aaf88eb --- /dev/null +++ b/recipes/ghc-filesystem/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.5.12": + url: "https://github.com/gulrak/filesystem/archive/v1.5.12.tar.gz" + sha256: "7d62c5746c724d28da216d9e11827ba4e573df15ef40720292827a4dfd33f2e9" + "1.5.8": + url: "https://github.com/gulrak/filesystem/archive/v1.5.8.tar.gz" + sha256: "726f8ccb2ec844f4c66cc4b572369497327df31b86c04cefad6b311964107139" + "1.4.0": + url: "https://github.com/gulrak/filesystem/archive/v1.4.0.tar.gz" + sha256: "332fb8afda06671090c755c623da15889b66cfdedcf6f343d38a28a930ea5304" diff --git a/recipes/ghc-filesystem/all/conanfile.py b/recipes/ghc-filesystem/all/conanfile.py new file mode 100644 index 0000000000000..e7b402102ac33 --- /dev/null +++ b/recipes/ghc-filesystem/all/conanfile.py @@ -0,0 +1,61 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.50.0" + + +class GhcFilesystemRecipe(ConanFile): + name = "ghc-filesystem" + description = "A header-only single-file std::filesystem compatible helper library" + topics = ("ghc-filesystem", "header-only", "filesystem") + homepage = "https://github.com/gulrak/filesystem" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + cmake_layout(self) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + + tc.variables["GHC_FILESYSTEM_BUILD_TESTING"] = False + tc.variables["GHC_FILESYSTEM_BUILD_EXAMPLES"] = False + tc.variables["GHC_FILESYSTEM_WITH_INSTALL"] = True + + tc.generate() + + def package(self): + copy(self, pattern="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, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ghc_filesystem") + self.cpp_info.set_property("cmake_target_name", "ghcFilesystem::ghc_filesystem") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["ghc_filesystem"].bindirs = [] + self.cpp_info.components["ghc_filesystem"].frameworkdirs = [] + self.cpp_info.components["ghc_filesystem"].libdirs = [] + self.cpp_info.components["ghc_filesystem"].resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "ghc_filesystem" + self.cpp_info.filenames["cmake_find_package_multi"] = "ghc_filesystem" + self.cpp_info.names["cmake_find_package"] = "ghcFilesystem" + self.cpp_info.names["cmake_find_package_multi"] = "ghcFilesystem" + self.cpp_info.components["ghc_filesystem"].names["cmake_find_package"] = "ghc_filesystem" + self.cpp_info.components["ghc_filesystem"].names["cmake_find_package_multi"] = "ghc_filesystem" + self.cpp_info.components["ghc_filesystem"].set_property("cmake_target_name", "ghcFilesystem::ghc_filesystem") diff --git a/recipes/ghc-filesystem/all/test_package/CMakeLists.txt b/recipes/ghc-filesystem/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b3075eb110867 --- /dev/null +++ b/recipes/ghc-filesystem/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ghc_filesystem REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ghcFilesystem::ghc_filesystem) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ghc-filesystem/all/test_package/conanfile.py b/recipes/ghc-filesystem/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ghc-filesystem/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/ghc-filesystem/all/test_package/test_package.cpp b/recipes/ghc-filesystem/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e8d2746c2d3eb --- /dev/null +++ b/recipes/ghc-filesystem/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char** argv) { + std::cout << "Version: " << GHC_FILESYSTEM_VERSION << std::endl; + ghc::filesystem::path program{argv[0]}; + std::cout << "Program: " << ghc::filesystem::absolute(program) << std::endl; + return 0; +} diff --git a/recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt b/recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ghc-filesystem/all/test_v1_package/conanfile.py b/recipes/ghc-filesystem/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ghc-filesystem/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/ghc-filesystem/config.yml b/recipes/ghc-filesystem/config.yml new file mode 100644 index 0000000000000..a66760cf157ac --- /dev/null +++ b/recipes/ghc-filesystem/config.yml @@ -0,0 +1,7 @@ +versions: + "1.5.12": + folder: "all" + "1.5.8": + folder: "all" + "1.4.0": + folder: "all" diff --git a/recipes/giflib/5.1.x/conandata.yml b/recipes/giflib/5.1.x/conandata.yml new file mode 100644 index 0000000000000..f7e24c49fe144 --- /dev/null +++ b/recipes/giflib/5.1.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "5.1.4": + url: "https://downloads.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz" + sha256: "34a7377ba834397db019e8eb122e551a49c98f49df75ec3fcc92b9a794a4f6d1" diff --git a/recipes/giflib/5.1.x/conanfile.py b/recipes/giflib/5.1.x/conanfile.py new file mode 100644 index 0000000000000..9853dbf433ace --- /dev/null +++ b/recipes/giflib/5.1.x/conanfile.py @@ -0,0 +1,169 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os +import shutil + +required_conan_version = ">=1.43.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" + homepage = "http://giflib.sourceforge.net" + topics = ("giflib", "image", "multimedia", "format", "graphics") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + 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"]) + + 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"), + os.path.join(self.package_folder, "lib", "gif.lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + 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: + self.cpp_info.defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") diff --git a/recipes/giflib/5.1.x/gif_lib.h b/recipes/giflib/5.1.x/gif_lib.h new file mode 100644 index 0000000000000..15b3a174c1351 --- /dev/null +++ b/recipes/giflib/5.1.x/gif_lib.h @@ -0,0 +1,342 @@ +/****************************************************************************** + +gif_lib.h - service library for decoding and encoding GIF images + +*****************************************************************************/ + +#ifndef _GIF_LIB_H_ +#define _GIF_LIB_H_ 1 + +#ifdef __cplusplus +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 */ +#endif /* _MSC_VER */ + +#define GIFLIB_MAJOR @GIFLIB_MAJOR@ +#define GIFLIB_MINOR @GIFLIB_MINOR@ +#define GIFLIB_RELEASE @GIFLIB_RELEASE@ + +#define GIF_ERROR 0 +#define GIF_OK 1 + +#include + + +#ifdef _MSC_VER + #if (_MSC_VER >= 1800) + /* C99 is not supported for MSVC vefore VS2013 */ + #include + #else + #ifndef __cplusplus + typedef int bool; + #define false 0 + #define true 1 + #endif + #endif + + #if (_MSC_VER < 1900) + #define snprintf _snprintf + #endif +#endif + + +#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */ +#define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1 +#define GIF_VERSION_POS 3 /* Version first character in stamp. */ +#define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */ +#define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */ + +typedef unsigned char GifPixelType; +typedef unsigned char *GifRowType; +typedef unsigned char GifByteType; +typedef unsigned int GifPrefixType; +typedef int GifWord; + +typedef struct GifColorType { + GifByteType Red, Green, Blue; +} GifColorType; + +typedef struct ColorMapObject { + int ColorCount; + int BitsPerPixel; + bool SortFlag; + GifColorType *Colors; /* on malloc(3) heap */ +} ColorMapObject; + +typedef struct GifImageDesc { + GifWord Left, Top, Width, Height; /* Current image dimensions. */ + bool Interlace; /* Sequential/Interlaced lines. */ + ColorMapObject *ColorMap; /* The local color map */ +} GifImageDesc; + +typedef struct ExtensionBlock { + int ByteCount; + GifByteType *Bytes; /* on malloc(3) heap */ + int Function; /* The block function code */ +#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */ +#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */ +#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */ +#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */ +#define APPLICATION_EXT_FUNC_CODE 0xff /* application block */ +} ExtensionBlock; + +typedef struct SavedImage { + GifImageDesc ImageDesc; + GifByteType *RasterBits; /* on malloc(3) heap */ + int ExtensionBlockCount; /* Count of extensions before image */ + ExtensionBlock *ExtensionBlocks; /* Extensions before image */ +} SavedImage; + +typedef struct GifFileType { + GifWord SWidth, SHeight; /* Size of virtual canvas */ + GifWord SColorResolution; /* How many colors can we generate? */ + GifWord SBackGroundColor; /* Background color for virtual canvas */ + GifByteType AspectByte; /* Used to compute pixel aspect ratio */ + ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */ + int ImageCount; /* Number of current image (both APIs) */ + GifImageDesc Image; /* Current image (low-level API) */ + SavedImage *SavedImages; /* Image sequence (high-level API) */ + int ExtensionBlockCount; /* Count extensions past last image */ + ExtensionBlock *ExtensionBlocks; /* Extensions past last image */ + int Error; /* Last error condition reported */ + void *UserData; /* hook to attach user data (TVT) */ + void *Private; /* Don't mess with this! */ +} GifFileType; + +#define GIF_ASPECT_RATIO(n) ((n)+15.0/64.0) + +typedef enum { + UNDEFINED_RECORD_TYPE, + SCREEN_DESC_RECORD_TYPE, + IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */ + EXTENSION_RECORD_TYPE, /* Begin with '!' */ + TERMINATE_RECORD_TYPE /* Begin with ';' */ +} GifRecordType; + +/* func type to read gif data from arbitrary sources (TVT) */ +typedef int (*InputFunc) (GifFileType *, GifByteType *, int); + +/* func type to write gif data to arbitrary targets. + * Returns count of bytes written. (MRB) + */ +typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int); + +/****************************************************************************** + GIF89 structures +******************************************************************************/ + +typedef struct GraphicsControlBlock { + int DisposalMode; +#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */ +#define DISPOSE_DO_NOT 1 /* Leave image in place */ +#define DISPOSE_BACKGROUND 2 /* Set area too background color */ +#define DISPOSE_PREVIOUS 3 /* Restore to previous content */ + bool UserInputFlag; /* User confirmation required before disposal */ + int DelayTime; /* pre-display delay in 0.01sec units */ + int TransparentColor; /* Palette index for transparency, -1 if none */ +#define NO_TRANSPARENT_COLOR -1 +} GraphicsControlBlock; + +/****************************************************************************** + GIF encoding routines +******************************************************************************/ + +/* Main entry points */ +GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +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. */ +#define E_GIF_ERR_WRITE_FAILED 2 +#define E_GIF_ERR_HAS_SCRN_DSCR 3 +#define E_GIF_ERR_HAS_IMAG_DSCR 4 +#define E_GIF_ERR_NO_COLOR_MAP 5 +#define E_GIF_ERR_DATA_TOO_BIG 6 +#define E_GIF_ERR_NOT_ENOUGH_MEM 7 +#define E_GIF_ERR_DISK_IS_FULL 8 +#define E_GIF_ERR_CLOSE_FAILED 9 +#define E_GIF_ERR_NOT_WRITEABLE 10 + +/* These are legacy. You probably do not want to call them directly */ +GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, + const int GifWidth, const int GifHeight, + const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, + const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +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); +GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); +GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, + const void *GifExtension); +GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, + const GifByteType *GifCodeBlock); + +/****************************************************************************** + GIF decoding routines +******************************************************************************/ + +/* Main entry points */ +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); + +#define D_GIF_SUCCEEDED 0 +#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +#define D_GIF_ERR_READ_FAILED 102 +#define D_GIF_ERR_NOT_GIF_FILE 103 +#define D_GIF_ERR_NO_SCRN_DSCR 104 +#define D_GIF_ERR_NO_IMAG_DSCR 105 +#define D_GIF_ERR_NO_COLOR_MAP 106 +#define D_GIF_ERR_WRONG_RECORD 107 +#define D_GIF_ERR_DATA_TOO_BIG 108 +#define D_GIF_ERR_NOT_ENOUGH_MEM 109 +#define D_GIF_ERR_CLOSE_FAILED 110 +#define D_GIF_ERR_NOT_READABLE 111 +#define D_GIF_ERR_IMAGE_DEFECT 112 +#define D_GIF_ERR_EOF_TOO_SOON 113 + +/* These are legacy. You probably do not want to call them directly */ +GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); +GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +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 DGifGetComment(GifFileType *GifFile, char *GifComment); +GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); + + +/****************************************************************************** + Color table quantization (deprecated) +******************************************************************************/ +GIF_EXPORT int GifQuantizeBuffer(unsigned int Width, unsigned int Height, + int *ColorMapSize, GifByteType * RedInput, + GifByteType * GreenInput, GifByteType * BlueInput, + GifByteType * OutputBuffer, + GifColorType * OutputColorMap); + +/****************************************************************************** + Error handling and reporting. +******************************************************************************/ +GIF_EXPORT const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + +/***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp + mode' for doing I/O in two big belts with all the image-bashing in core. +******************************************************************************/ + +/****************************************************************************** + Color map handling from gif_alloc.c +******************************************************************************/ + +GIF_EXPORT ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +GIF_EXPORT void GifFreeMapObject(ColorMapObject *Object); +GIF_EXPORT ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +GIF_EXPORT int GifBitSize(int n); + +GIF_EXPORT void * +reallocarray(void *optr, size_t nmemb, size_t size); + +/****************************************************************************** + Support for the in-core structures allocation (slurp mode). +******************************************************************************/ + +GIF_EXPORT void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); +GIF_EXPORT int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, + int Function, + unsigned int Len, unsigned char ExtData[]); +GIF_EXPORT void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +GIF_EXPORT SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +GIF_EXPORT void GifFreeSavedImages(GifFileType *GifFile); + +/****************************************************************************** + 5.x functions for GIF89 graphics control blocks +******************************************************************************/ + +GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, + int ImageIndex, + GraphicsControlBlock *GCB); +GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, + int ImageIndex); + +/****************************************************************************** + The library's internal utility font +******************************************************************************/ + +#define GIF_FONT_WIDTH 8 +#define GIF_FONT_HEIGHT 8 +GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +GIF_EXPORT void GifDrawText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, const int color); + +GIF_EXPORT void GifDrawBox(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +GIF_EXPORT void GifDrawRectangle(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +GIF_EXPORT void GifDrawBoxedText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, + const int border, const int bg, const int fg); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _GIF_LIB_H */ + +/* end */ diff --git a/recipes/giflib/5.1.x/test_package/CMakeLists.txt b/recipes/giflib/5.1.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..95fca5bec20b2 --- /dev/null +++ b/recipes/giflib/5.1.x/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GIF REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} GIF::GIF) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/giflib/5.1.x/test_package/conanfile.py b/recipes/giflib/5.1.x/test_package/conanfile.py new file mode 100644 index 0000000000000..9c22b9663e80c --- /dev/null +++ b/recipes/giflib/5.1.x/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build_requirements(self): + if self.settings.os == "Macos" 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.1.x/test_package/test_package.c b/recipes/giflib/5.1.x/test_package/test_package.c new file mode 100644 index 0000000000000..7e36b181016e3 --- /dev/null +++ b/recipes/giflib/5.1.x/test_package/test_package.c @@ -0,0 +1,131 @@ +#include +#include +#include +#include + +#include "gif_lib.h" + + +#define LINE_LEN 40 +#define IMAGEWIDTH LINE_LEN*GIF_FONT_WIDTH + +static int BackGround = 0; +static void QuitGifError(GifFileType *GifFile); +static void GenRasterTextLine(GifRowType *RasterBuffer, char *TextLine, + int BufferWidth, int ForeGroundIndex); + +/****************************************************************************** + Interpret the command line and generate the given GIF file. +******************************************************************************/ +int main(int argc, char **argv) +{ + int i, j, l, ColorMapSize, ErrorCode; + char Line[LINE_LEN]; + GifRowType RasterBuffer[GIF_FONT_HEIGHT]; + ColorMapObject *ColorMap; + GifFileType *GifFile; + GifColorType ScratchMap[256]; + + /* Allocate the raster buffer for GIF_FONT_HEIGHT scan lines. */ + for (i = 0; i < GIF_FONT_HEIGHT; i++) + { + if ((RasterBuffer[i] = (GifRowType) malloc(sizeof(GifPixelType) * + IMAGEWIDTH)) == NULL) + exit(1); + } + + /* Open stdout for the output file: */ + if ((GifFile = EGifOpenFileName("out.gif", 0, &ErrorCode)) == NULL) { + printf("error: %d\n", ErrorCode); + exit(EXIT_FAILURE); + } + + /* Read the color map in ColorFile into this color map: */ + for (ColorMapSize = 0; ColorMapSize < 256; ColorMapSize++) + { + ScratchMap[ColorMapSize].Red = ColorMapSize; + ScratchMap[ColorMapSize].Green = ColorMapSize; + ScratchMap[ColorMapSize].Blue = ColorMapSize; + } + + if ((ColorMap = GifMakeMapObject(1 << GifBitSize(ColorMapSize), ScratchMap)) == NULL) + exit(1); + + if (EGifPutScreenDesc(GifFile, + IMAGEWIDTH, ColorMapSize * GIF_FONT_HEIGHT, + GifBitSize(ColorMapSize), + BackGround, ColorMap) == GIF_ERROR) + QuitGifError(GifFile); + + /* Dump out the image descriptor: */ + if (EGifPutImageDesc(GifFile, + 0, 0, IMAGEWIDTH, ColorMapSize * GIF_FONT_HEIGHT, false, NULL) == GIF_ERROR) + QuitGifError(GifFile); + + printf("\n%s: Image 1 at (%d, %d) [%dx%d]: \n", + "test_package", GifFile->Image.Left, GifFile->Image.Top, + GifFile->Image.Width, GifFile->Image.Height); + + for (i = l = 0; i < ColorMap->ColorCount; i++) { + (void)snprintf(Line, sizeof(Line), + "Color %-3d: [%-3d, %-3d, %-3d] ", i, + ColorMap->Colors[i].Red, + ColorMap->Colors[i].Green, + ColorMap->Colors[i].Blue); + GenRasterTextLine(RasterBuffer, Line, IMAGEWIDTH, i); + for (j = 0; j < GIF_FONT_HEIGHT; j++) { + if (EGifPutLine(GifFile, RasterBuffer[j], IMAGEWIDTH) == GIF_ERROR) + QuitGifError(GifFile); + printf("\b\b\b\b%-4d", l++); + } + } + + if (EGifCloseFile(GifFile, &ErrorCode) == GIF_ERROR) + { + printf("error: %d\n", ErrorCode); + if (GifFile != NULL) { + EGifCloseFile(GifFile, NULL); + } + exit(EXIT_FAILURE); + } + + return 0; +} + +/****************************************************************************** + Close output file (if open), and exit. +******************************************************************************/ +static void GenRasterTextLine(GifRowType *RasterBuffer, char *TextLine, + int BufferWidth, int ForeGroundIndex) +{ + unsigned char c; + unsigned char Byte, Mask; + int i, j, k, CharPosX, Len = (int)strlen(TextLine); + + for (i = 0; i < BufferWidth; i++) + for (j = 0; j < GIF_FONT_HEIGHT; j++) RasterBuffer[j][i] = BackGround; + + for (i = CharPosX = 0; i < Len; i++, CharPosX += GIF_FONT_WIDTH) { + c = TextLine[i]; + for (j = 0; j < GIF_FONT_HEIGHT; j++) { + Byte = GifAsciiTable8x8[(unsigned short)c][j]; + for (k = 0, Mask = 128; k < GIF_FONT_WIDTH; k++, Mask >>= 1) + if (Byte & Mask) + RasterBuffer[j][CharPosX + k] = ForeGroundIndex; + } + } +} + +/****************************************************************************** + Close output file (if open), and exit. +******************************************************************************/ +static void QuitGifError(GifFileType *GifFile) +{ + if (GifFile != NULL) { + printf("error: %d\n", GifFile->Error); + EGifCloseFile(GifFile, NULL); + } + exit(EXIT_FAILURE); +} + +/* vim: ts=8 sw=8 et */ diff --git a/recipes/giflib/5.1.x/unistd.h b/recipes/giflib/5.1.x/unistd.h new file mode 100644 index 0000000000000..2581c0c0b36d3 --- /dev/null +++ b/recipes/giflib/5.1.x/unistd.h @@ -0,0 +1,51 @@ +#ifndef _UNISTD_H +#define _UNISTD_H 1 + +/* This file intended to serve as a drop-in replacement for + * unistd.h on Windows + * Please add functionality as neeeded + */ + +#include +#include +#include /* for getpid() and the exec..() family */ +#include /* for _getcwd() and _chdir() */ + +#define srandom srand +#define random rand + +/* Values for the second argument to access. + These may be OR'd together. */ +#define R_OK 4 /* Test for read permission. */ +#define W_OK 2 /* Test for write permission. */ +//#define X_OK 1 /* execute permission - unsupported in windows*/ +#define F_OK 0 /* Test for existence. */ + +#define access _access +#define dup2 _dup2 +#define execve _execve +#define ftruncate _chsize +#define unlink _unlink +#define fileno _fileno +#define getcwd _getcwd +#define chdir _chdir +#define isatty _isatty +#define lseek _lseek +/* read, write, and close are NOT being #defined here, because while there are file handle specific versions for Windows, they probably don't work for sockets. You need to look at your app and consider whether to call e.g. closesocket(). */ + +#define ssize_t int + +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 +/* should be in some equivalent to */ +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; + +#endif /* unistd.h */ diff --git a/recipes/giflib/5.2.x/CMakeLists.txt b/recipes/giflib/5.2.x/CMakeLists.txt new file mode 100644 index 0000000000000..2d4e86b610d29 --- /dev/null +++ b/recipes/giflib/5.2.x/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 3.1) +project(gif LANGUAGES C) + +include(GNUInstallDirs) + +add_library(gif + "${GIFLIB_SRC_DIR}/dgif_lib.c" + "${GIFLIB_SRC_DIR}/egif_lib.c" + "${GIFLIB_SRC_DIR}/gifalloc.c" + "${GIFLIB_SRC_DIR}/gif_err.c" + "${GIFLIB_SRC_DIR}/gif_font.c" + "${GIFLIB_SRC_DIR}/gif_hash.c" + "${GIFLIB_SRC_DIR}/openbsd-reallocarray.c" +) +if(WIN32) + if(BUILD_SHARED_LIBS) + set_property(TARGET gif PROPERTY PREFIX "") + target_compile_definitions(gif INTERFACE USE_GIF_DLL) + else() + target_compile_definitions(gif PUBLIC USE_GIF_LIB) + endif() +endif() + +install( + TARGETS gif + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install( + FILES "${GIFLIB_SRC_DIR}/gif_lib.h" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +if(UTILS) + add_library(giflib_util STATIC + "${GIFLIB_SRC_DIR}/qprintf.c" + "${GIFLIB_SRC_DIR}/quantize.c" + "${GIFLIB_SRC_DIR}/getarg.c" + ) + target_link_libraries(giflib_util PRIVATE gif) + + set(GIF_UTILS + gif2rgb + gifbuild + giffix + giftext + giftool + gifclrmp + ) + foreach(GIF_UTIL ${GIF_UTILS}) + add_executable(${GIF_UTIL} "${GIFLIB_SRC_DIR}/${GIF_UTIL}.c") + target_link_libraries(${GIF_UTIL} PRIVATE gif giflib_util) + endforeach() + find_library(LIBM NAMES m) + target_link_libraries(gifclrmp PRIVATE $<$:${LIBM}>) + if(MSVC) + find_package(getopt-for-visual-studio REQUIRED CONFIG) + target_link_libraries(giftool PRIVATE getopt-for-visual-studio::getopt-for-visual-studio) + endif() + install(TARGETS ${GIF_UTILS} DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/giflib/5.2.x/conandata.yml b/recipes/giflib/5.2.x/conandata.yml new file mode 100644 index 0000000000000..e36e2cd9d7be2 --- /dev/null +++ b/recipes/giflib/5.2.x/conandata.yml @@ -0,0 +1,7 @@ +sources: + "5.2.1": + url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz" + sha256: "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd" +patches: + "5.2.1": + - patch_file: "patches/0001-msvc-unistd.patch" diff --git a/recipes/giflib/5.2.x/conanfile.py b/recipes/giflib/5.2.x/conanfile.py new file mode 100644 index 0000000000000..439c512e9402a --- /dev/null +++ b/recipes/giflib/5.2.x/conanfile.py @@ -0,0 +1,86 @@ +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 +from conan.tools.microsoft import is_msvc +import os + +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" + homepage = "http://giflib.sourceforge.net" + topics = ("gif", "image", "multimedia", "format", "graphics") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "utils" : [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "utils" : True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if is_msvc(self) and self.options.utils: + self.requires("getopt-for-visual-studio/20200201") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GIFLIB_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["UTILS"] = self.options.utils + tc.generate() + + if is_msvc(self): + cd = CMakeDeps(self) + cd.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "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_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "GIF") + self.cpp_info.set_property("cmake_target_name", "GIF::GIF") + self.cpp_info.libs = ["gif"] + 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" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch new file mode 100644 index 0000000000000..05112f7bfb6f7 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch @@ -0,0 +1,261 @@ +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 ++++ b/gif_hash.h +@@ -9,7 +9,11 @@ SPDX-License-Identifier: MIT + #ifndef _GIF_HASH_H_ + #define _GIF_HASH_H_ + ++#ifdef _WIN32 ++#else + #include ++#endif ++ + #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/test_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..909c7abfcc3fc --- /dev/null +++ b/recipes/giflib/5.2.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(GIF REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GIF::GIF) diff --git a/recipes/giflib/5.2.x/test_package/conanfile.py b/recipes/giflib/5.2.x/test_package/conanfile.py new file mode 100644 index 0000000000000..e79bad64833c1 --- /dev/null +++ b/recipes/giflib/5.2.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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(f"{bin_path} testimg.gif", env="conanrun") diff --git a/recipes/giflib/5.2.x/test_package/test_package.c b/recipes/giflib/5.2.x/test_package/test_package.c new file mode 100644 index 0000000000000..7c3b23c1cd736 --- /dev/null +++ b/recipes/giflib/5.2.x/test_package/test_package.c @@ -0,0 +1,134 @@ +#include "gif_lib.h" + +#include +#include +#include +#include + +#define LINE_LEN 40 +#define IMAGEWIDTH LINE_LEN*GIF_FONT_WIDTH + +static int BackGround = 0; +static void QuitGifError(GifFileType *GifFile); +static void GenRasterTextLine(GifRowType *RasterBuffer, char *TextLine, + int BufferWidth, int ForeGroundIndex); + +/****************************************************************************** + Interpret the command line and generate the given GIF file. +******************************************************************************/ +int main(int argc, char **argv) +{ + int i, j, l, ColorMapSize, ErrorCode; + char Line[LINE_LEN]; + GifRowType RasterBuffer[GIF_FONT_HEIGHT]; + ColorMapObject *ColorMap; + GifFileType *GifFile; + GifColorType ScratchMap[256]; + + if (argc < 2) { + fprintf(stderr, "Usage: %s OUTPUTGIF\n", argv[0]); + exit(1); + } + + /* Allocate the raster buffer for GIF_FONT_HEIGHT scan lines. */ + for (i = 0; i < GIF_FONT_HEIGHT; i++) + { + if ((RasterBuffer[i] = (GifRowType) malloc(sizeof(GifPixelType) * IMAGEWIDTH)) == NULL) + exit(1); + } + + /* Open stdout for the output file: */ + if ((GifFile = EGifOpenFileName(argv[1], 0, &ErrorCode)) == NULL) { + printf("error: %d\n", ErrorCode); + exit(EXIT_FAILURE); + } + + /* Read the color map in ColorFile into this color map: */ + for (ColorMapSize = 0; ColorMapSize < 256; ColorMapSize++) + { + ScratchMap[ColorMapSize].Red = ColorMapSize; + ScratchMap[ColorMapSize].Green = ColorMapSize; + ScratchMap[ColorMapSize].Blue = ColorMapSize; + } + + if ((ColorMap = GifMakeMapObject(1 << GifBitSize(ColorMapSize), ScratchMap)) == NULL) + exit(1); + + if (EGifPutScreenDesc(GifFile, + IMAGEWIDTH, ColorMapSize * GIF_FONT_HEIGHT, + GifBitSize(ColorMapSize), + BackGround, ColorMap) == GIF_ERROR) + QuitGifError(GifFile); + + /* Dump out the image descriptor: */ + if (EGifPutImageDesc(GifFile, + 0, 0, IMAGEWIDTH, ColorMapSize * GIF_FONT_HEIGHT, false, NULL) == GIF_ERROR) + QuitGifError(GifFile); + + printf("\n%s: Image 1 at (%d, %d) [%dx%d]: \n", + "test_package", GifFile->Image.Left, GifFile->Image.Top, + GifFile->Image.Width, GifFile->Image.Height); + + for (i = l = 0; i < ColorMap->ColorCount; i++) + { + (void)snprintf(Line, sizeof(Line), + "Color %-3d: [%-3d, %-3d, %-3d] ", i, + ColorMap->Colors[i].Red, + ColorMap->Colors[i].Green, + ColorMap->Colors[i].Blue); + GenRasterTextLine(RasterBuffer, Line, IMAGEWIDTH, i); + for (j = 0; j < GIF_FONT_HEIGHT; j++) + { + if (EGifPutLine(GifFile, RasterBuffer[j], IMAGEWIDTH) == GIF_ERROR) + QuitGifError(GifFile); + printf("\b\b\b\b%-4d", l++); + } + } + + if (EGifCloseFile(GifFile, &ErrorCode) == GIF_ERROR) { + printf("error: %d\n", ErrorCode); + if (GifFile != NULL) { + EGifCloseFile(GifFile, NULL); + } + exit(EXIT_FAILURE); + } + + return 0; +} + +/****************************************************************************** + Close output file (if open), and exit. +******************************************************************************/ +static void GenRasterTextLine(GifRowType *RasterBuffer, char *TextLine, + int BufferWidth, int ForeGroundIndex) +{ + unsigned char c; + unsigned char Byte, Mask; + int i, j, k, CharPosX, Len = (int)strlen(TextLine); + + for (i = 0; i < BufferWidth; i++) + for (j = 0; j < GIF_FONT_HEIGHT; j++) + RasterBuffer[j][i] = BackGround; + + for (i = CharPosX = 0; i < Len; i++, CharPosX += GIF_FONT_WIDTH) { + c = TextLine[i]; + for (j = 0; j < GIF_FONT_HEIGHT; j++) { + Byte = GifAsciiTable8x8[(unsigned short)c][j]; + for (k = 0, Mask = 128; k < GIF_FONT_WIDTH; k++, Mask >>= 1) + if (Byte & Mask) + RasterBuffer[j][CharPosX + k] = ForeGroundIndex; + } + } +} + +/****************************************************************************** + Close output file (if open), and exit. +******************************************************************************/ +static void QuitGifError(GifFileType *GifFile) +{ + if (GifFile != NULL) { + printf("error: %d\n", GifFile->Error); + EGifCloseFile(GifFile, NULL); + } + exit(EXIT_FAILURE); +} diff --git a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/giflib/5.2.x/test_v1_package/conanfile.py b/recipes/giflib/5.2.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..15e08a8cf4897 --- /dev/null +++ b/recipes/giflib/5.2.x/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +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(f"{bin_path} testimg.gif", run_environment=True) + assert os.path.isfile("testimg.gif") + if self.options["giflib"].utils: + self.run("gif2rgb -o testimg.rgb testimg.gif", run_environment=True) + assert os.path.isfile("testimg.rgb.R") diff --git a/recipes/giflib/config.yml b/recipes/giflib/config.yml new file mode 100644 index 0000000000000..1ccf672c09135 --- /dev/null +++ b/recipes/giflib/config.yml @@ -0,0 +1,5 @@ +versions: + "5.2.1": + folder: "5.2.x" + "5.1.4": + folder: "5.1.x" diff --git a/recipes/ginkgo/all/conandata.yml b/recipes/ginkgo/all/conandata.yml new file mode 100644 index 0000000000000..1b82b82c2ec35 --- /dev/null +++ b/recipes/ginkgo/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.4.0": + url: "https://github.com/ginkgo-project/ginkgo/archive/v1.4.0.tar.gz" + sha256: "6dcadbd3e93f6ec58ef6cda5b980fbf51ea3c7c13e27952ef38804058ac93f08" + "1.3.0": + url: "https://github.com/ginkgo-project/ginkgo/archive/v1.3.0.tar.gz" + sha256: "1b0e907b4046cdf7cef16d1730c12ba812b38f2764f49f74f454239a27f63596" +patches: + "1.4.0": + - patch_file: "patches/windows-symbols.patch" + "1.3.0": + - patch_file: "patches/cmake-fixes.patch" + - patch_file: "patches/windows-iterator.patch" diff --git a/recipes/ginkgo/all/conanfile.py b/recipes/ginkgo/all/conanfile.py new file mode 100644 index 0000000000000..89838bc8bd072 --- /dev/null +++ b/recipes/ginkgo/all/conanfile.py @@ -0,0 +1,177 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class GinkgoConan(ConanFile): + name = "ginkgo" + license = "BSD-3-Clause" + homepage = "https://github.com/ginkgo-project/ginkgo" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "High-performance linear algebra library for manycore systems, with a " + "focus on sparse solution of linear systems." + ) + topics = ("hpc", "linear-algebra") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "openmp": [True, False], + "cuda": [True, False], + } + default_options = { + "shared": False, + "fPIC": False, + "openmp": False, + "cuda": False, + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "5.4", + "clang": "3.9", + "apple-clang": "10.0", + "intel": "18", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 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] + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Ginkgo does not support mixing static CRT and shared library" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GINKGO_BUILD_TESTS"] = False + tc.variables["GINKGO_BUILD_EXAMPLES"] = False + tc.variables["GINKGO_BUILD_BENCHMARKS"] = False + tc.variables["GINKGO_DEVEL_TOOLS"] = False + tc.variables["GINKGO_BUILD_REFERENCE"] = True + tc.variables["GINKGO_BUILD_OMP"] = self.options.openmp + tc.variables["GINKGO_BUILD_CUDA"] = self.options.cuda + tc.variables["GINKGO_BUILD_HIP"] = False + tc.variables["GINKGO_BUILD_DPCPP"] = False + tc.variables["GINKGO_BUILD_HWLOC"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Ginkgo") + self.cpp_info.set_property("cmake_target_name", "Ginkgo::ginkgo") + self.cpp_info.set_property("pkg_config_name", "ginkgo") + + debug_suffix = "d" if self.settings.build_type == "Debug" else "" + has_dpcpp_device = Version(self.version) >= "1.4.0" + + self.cpp_info.components["ginkgo_core"].set_property("cmake_target_name", "Ginkgo::ginkgo") + self.cpp_info.components["ginkgo_core"].set_property("pkg_config_name", "ginkgo") + self.cpp_info.components["ginkgo_core"].libs = [ + "ginkgo" + debug_suffix] + self.cpp_info.components["ginkgo_core"].requires = [ + "ginkgo_omp", "ginkgo_cuda", "ginkgo_reference", "ginkgo_hip" + ] + + self.cpp_info.components["ginkgo_cuda"].set_property("cmake_target_name", "Ginkgo::ginkgo_cuda") + self.cpp_info.components["ginkgo_cuda"].libs = [ + "ginkgo_cuda" + debug_suffix] + self.cpp_info.components["ginkgo_cuda"].requires = ["ginkgo_hip"] + + self.cpp_info.components["ginkgo_omp"].set_property("cmake_target_name", "Ginkgo::ginkgo_omp") + self.cpp_info.components["ginkgo_omp"].libs = [ + "ginkgo_omp" + debug_suffix] + self.cpp_info.components["ginkgo_omp"].requires = [ + "ginkgo_cuda", "ginkgo_hip"] + + self.cpp_info.components["ginkgo_hip"].set_property("cmake_target_name", "Ginkgo::ginkgo_hip") + self.cpp_info.components["ginkgo_hip"].libs = [ + "ginkgo_hip" + debug_suffix] + + self.cpp_info.components["ginkgo_reference"].set_property("cmake_target_name", "Ginkgo::ginkgo_reference") + self.cpp_info.components["ginkgo_reference"].libs = [ + "ginkgo_reference" + debug_suffix] + + if has_dpcpp_device: # Always add these components + # See https://github.com/conan-io/conan-center-index/pull/7044#discussion_r698181588 + self.cpp_info.components["ginkgo_core"].requires += ["ginkgo_dpcpp"] + self.cpp_info.components["ginkgo_core"].requires += ["ginkgo_device"] + + self.cpp_info.components["ginkgo_dpcpp"].set_property("cmake_target_name", "Ginkgo::ginkgo_dpcpp") + self.cpp_info.components["ginkgo_dpcpp"].libs = [ + "ginkgo_dpcpp" + debug_suffix] + + self.cpp_info.components["ginkgo_device"].set_property("cmake_target_name", "Ginkgo::ginkgo_device") + self.cpp_info.components["ginkgo_device"].libs = [ + "ginkgo_device" + debug_suffix] + + self.cpp_info.components["ginkgo_omp"].requires += [ + "ginkgo_dpcpp", "ginkgo_device"] + self.cpp_info.components["ginkgo_reference"].requires += ["ginkgo_device"] + self.cpp_info.components["ginkgo_hip"].requires += ["ginkgo_device"] + self.cpp_info.components["ginkgo_cuda"].requires += ["ginkgo_device"] + self.cpp_info.components["ginkgo_dpcpp"].requires += ["ginkgo_device"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Ginkgo" + self.cpp_info.names["cmake_find_package_multi"] = "Ginkgo" + self.cpp_info.components["ginkgo_core"].names["cmake_find_package"] = "ginkgo" + self.cpp_info.components["ginkgo_core"].names["cmake_find_package_multi"] = "ginkgo" diff --git a/recipes/ginkgo/all/patches/cmake-fixes.patch b/recipes/ginkgo/all/patches/cmake-fixes.patch new file mode 100644 index 0000000000000..2aa4f20846cff --- /dev/null +++ b/recipes/ginkgo/all/patches/cmake-fixes.patch @@ -0,0 +1,114 @@ +Based on the upstream PRs +https://github.com/ginkgo-project/ginkgo/pull/713 +https://github.com/ginkgo-project/ginkgo/pull/720 +--- +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e75f7d6..63685f2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,12 @@ include(cmake/hip_path.cmake) + include(cmake/autodetect_executors.cmake) + include(cmake/build_type_helpers.cmake) + ++if (MSVC) ++ add_compile_options(/bigobj) ++elseif (MINGW OR CYGWIN) ++ add_compile_options("-Wa,-mbig-obj") ++endif() ++ + # Ginkgo configuration options + option(GINKGO_DEVEL_TOOLS "Add development tools to the build system" OFF) + option(GINKGO_BUILD_TESTS "Generate build files for unit tests" ON) +diff --git a/cmake/GinkgoConfig.cmake.in b/cmake/GinkgoConfig.cmake.in +index 0348f95..3b8be0f 100644 +--- a/cmake/GinkgoConfig.cmake.in ++++ b/cmake/GinkgoConfig.cmake.in +@@ -129,8 +129,6 @@ set(GINKGO_OPENMP_LIBRARIES @OpenMP_CXX_LIBRARIES@) + set(GINKGO_OPENMP_FLAGS "@OpenMP_CXX_FLAGS@") + + # Provide useful HIP helper functions +-include(${CMAKE_CURRENT_LIST_DIR}/hip_helpers.cmake) +-include(${CMAKE_CURRENT_LIST_DIR}/windows_helpers.cmake) + + # NOTE: we do not export benchmarks, examples, tests or devel tools + # so `third_party` libraries are currently unneeded. +diff --git a/cmake/install_helpers.cmake b/cmake/install_helpers.cmake +index 70d6905f51..c62aa57916 100644 +--- a/cmake/install_helpers.cmake ++++ b/cmake/install_helpers.cmake +@@ -2,28 +2,29 @@ include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + + +-set(GINKGO_INSTALL_INCLUDE_DIR "include") +-set(GINKGO_INSTALL_LIBRARY_DIR "lib") +-set(GINKGO_INSTALL_PKGCONFIG_DIR "lib/pkgconfig") +-set(GINKGO_INSTALL_CONFIG_DIR "lib/cmake/Ginkgo") +-set(GINKGO_INSTALL_MODULE_DIR "lib/cmake/Ginkgo/Modules") ++set(GINKGO_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}") ++set(GINKGO_INSTALL_LIBRARY_DIR "${CMAKE_INSTALL_LIBDIR}") ++set(GINKGO_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}") ++set(GINKGO_INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++set(GINKGO_INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Ginkgo") ++set(GINKGO_INSTALL_MODULE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Ginkgo/Modules") + + function(ginkgo_install_library name subdir) +- ++ + if (WIN32 OR CYGWIN) + # dll is considered as runtime + install(TARGETS "${name}" + EXPORT Ginkgo +- LIBRARY DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR} +- ARCHIVE DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR} +- RUNTIME DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR} ++ LIBRARY DESTINATION "${GINKGO_INSTALL_LIBRARY_DIR}" ++ ARCHIVE DESTINATION "${GINKGO_INSTALL_LIBRARY_DIR}" ++ RUNTIME DESTINATION "${GINKGO_INSTALL_RUNTIME_DIR}" + ) + else () + # install .so and .a files + install(TARGETS "${name}" + EXPORT Ginkgo +- LIBRARY DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR} +- ARCHIVE DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR} ++ LIBRARY DESTINATION "${GINKGO_INSTALL_LIBRARY_DIR}" ++ ARCHIVE DESTINATION "${GINKGO_INSTALL_LIBRARY_DIR}" + ) + endif () + endfunction() +@@ -37,9 +32,8 @@ function(ginkgo_install) + DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}" + FILES_MATCHING PATTERN "*.hpp" + ) +- install(DIRECTORY "${Ginkgo_BINARY_DIR}/include/" +- DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}" +- FILES_MATCHING PATTERN "*.hpp" ++ install(FILES "${Ginkgo_BINARY_DIR}/include/ginkgo/config.hpp" ++ DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}/ginkgo" + ) + if (GINKGO_HAVE_PAPI_SDE) + install(FILES "${Ginkgo_SOURCE_DIR}/third_party/papi_sde/papi_sde_interface.h" +@@ -70,8 +64,6 @@ function(ginkgo_install) + install(FILES + "${Ginkgo_BINARY_DIR}/GinkgoConfig.cmake" + "${Ginkgo_BINARY_DIR}/GinkgoConfigVersion.cmake" +- "${Ginkgo_SOURCE_DIR}/cmake/hip_helpers.cmake" +- "${Ginkgo_SOURCE_DIR}/cmake/windows_helpers.cmake" + DESTINATION "${GINKGO_INSTALL_CONFIG_DIR}" + ) + install(EXPORT Ginkgo +diff --git a/cmake/windows_helpers.cmake b/cmake/windows_helpers.cmake +index 5f517a5..46d31ba 100644 +--- a/cmake/windows_helpers.cmake ++++ b/cmake/windows_helpers.cmake +@@ -14,9 +14,7 @@ function(ginkgo_switch_windows_link lang from to) + endfunction() + + macro(ginkgo_switch_to_windows_static lang) +- ginkgo_switch_windows_link(${lang} "MD" "MT") + endmacro() + + macro(ginkgo_switch_to_windows_dynamic lang) +- ginkgo_switch_windows_link(${lang} "MT" "MD") + endmacro() diff --git a/recipes/ginkgo/all/patches/windows-iterator.patch b/recipes/ginkgo/all/patches/windows-iterator.patch new file mode 100644 index 0000000000000..f51ec8a321e31 --- /dev/null +++ b/recipes/ginkgo/all/patches/windows-iterator.patch @@ -0,0 +1,119 @@ +Based on the upstream PR https://github.com/ginkgo-project/ginkgo/pull/665 +--- +diff --git a/core/base/iterator_factory.hpp b/core/base/iterator_factory.hpp +index b7efd21dfe..5e4bddeb17 100644 +--- a/core/base/iterator_factory.hpp ++++ b/core/base/iterator_factory.hpp +@@ -110,7 +110,7 @@ class IteratorFactory { + + ~Reference() {} + +- Reference(IteratorFactory &parent, array_index_type array_index) ++ Reference(IteratorFactory *parent, array_index_type array_index) + : parent_(parent), arr_index_(array_index) + {} + +@@ -143,10 +143,10 @@ class IteratorFactory { + { + // In C++11, it is legal for a nested class to access private + // members of the parent class. +- parent_.dominant_values_[arr_index_] = +- std::move(other.parent_.dominant_values_[other.arr_index_]); +- parent_.secondary_values_[arr_index_] = +- std::move(other.parent_.secondary_values_[other.arr_index_]); ++ parent_->dominant_values_[arr_index_] = ++ std::move(other.parent_->dominant_values_[other.arr_index_]); ++ parent_->secondary_values_[arr_index_] = ++ std::move(other.parent_->secondary_values_[other.arr_index_]); + return *this; + } + +@@ -174,25 +174,25 @@ class IteratorFactory { + return left.dominant < right.dominant(); + } + +- ToSortType &dominant() { return parent_.dominant_values_[arr_index_]; } ++ ToSortType &dominant() { return parent_->dominant_values_[arr_index_]; } + + const ToSortType &dominant() const + { +- return parent_.dominant_values_[arr_index_]; ++ return parent_->dominant_values_[arr_index_]; + } + + SecondaryType &secondary() + { +- return parent_.secondary_values_[arr_index_]; ++ return parent_->secondary_values_[arr_index_]; + } + + const SecondaryType &secondary() const + { +- return parent_.secondary_values_[arr_index_]; ++ return parent_->secondary_values_[arr_index_]; + } + + private: +- IteratorFactory &parent_; ++ IteratorFactory *parent_; + array_index_type arr_index_; + }; + +@@ -214,9 +214,11 @@ class IteratorFactory { + using reference = Reference; + using iterator_category = std::random_access_iterator_tag; + ++ Iterator() = default; ++ + ~Iterator() {} + +- Iterator(IteratorFactory &parent, difference_type array_index) ++ Iterator(IteratorFactory *parent, difference_type array_index) + : parent_(parent), arr_index_(array_index) + {} + +@@ -298,12 +300,12 @@ class IteratorFactory { + } + + // Comparable operators +- bool operator==(const Iterator &other) ++ bool operator==(const Iterator &other) const + { + return arr_index_ == other.arr_index_; + } + +- bool operator!=(const Iterator &other) ++ bool operator!=(const Iterator &other) const + { + return arr_index_ != other.arr_index_; + } +@@ -329,8 +331,8 @@ class IteratorFactory { + } + + private: +- IteratorFactory &parent_; +- difference_type arr_index_; ++ IteratorFactory *parent_{}; ++ difference_type arr_index_{}; + }; + + public: +@@ -363,7 +365,7 @@ class IteratorFactory { + * Creates an iterator pointing to the beginning of both arrays + * @returns an iterator pointing to the beginning of both arrays + */ +- Iterator begin() { return {*this, 0}; } ++ Iterator begin() { return {this, 0}; } + + /** + * Creates an iterator pointing to the (excluding) end of both arrays +@@ -371,7 +373,7 @@ class IteratorFactory { + */ + Iterator end() + { +- return {*this, static_cast(size_)}; ++ return {this, static_cast(size_)}; + } + + private: + diff --git a/recipes/ginkgo/all/patches/windows-symbols.patch b/recipes/ginkgo/all/patches/windows-symbols.patch new file mode 100644 index 0000000000000..ea60add6e6c1f --- /dev/null +++ b/recipes/ginkgo/all/patches/windows-symbols.patch @@ -0,0 +1,710 @@ +diff --git a/core/base/array.cpp b/core/base/array.cpp +index 0f31b3d9ba7..3a2ad7b5568 100644 +--- a/core/base/array.cpp ++++ b/core/base/array.cpp +@@ -42,20 +42,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace conversion { ++namespace { + + + GKO_REGISTER_OPERATION(convert, components::convert_precision); + + ++} // anonymous namespace + } // namespace conversion + + + namespace array { ++namespace { + + + GKO_REGISTER_OPERATION(fill_array, components::fill_array); + + ++} // anonymous namespace + } // namespace array + + +diff --git a/core/base/composition.cpp b/core/base/composition.cpp +index d383b0174b6..3a67a8ebff6 100644 +--- a/core/base/composition.cpp ++++ b/core/base/composition.cpp +@@ -46,11 +46,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace composition { ++namespace { + + + GKO_REGISTER_OPERATION(fill_array, components::fill_array); + + ++} // anonymous namespace + } // namespace composition + + +diff --git a/core/factorization/ic.cpp b/core/factorization/ic.cpp +index 3c8b6dd29ba..34bbbcb048d 100644 +--- a/core/factorization/ic.cpp ++++ b/core/factorization/ic.cpp +@@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace factorization { + namespace ic_factorization { ++namespace { + + + GKO_REGISTER_OPERATION(compute, ic_factorization::compute); +@@ -58,6 +59,7 @@ GKO_REGISTER_OPERATION(initialize_row_ptrs_l, + GKO_REGISTER_OPERATION(initialize_l, factorization::initialize_l); + + ++} // anonymous namespace + } // namespace ic_factorization + + +diff --git a/core/factorization/ilu.cpp b/core/factorization/ilu.cpp +index 1518853b9b8..8359bf3f465 100644 +--- a/core/factorization/ilu.cpp ++++ b/core/factorization/ilu.cpp +@@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace factorization { + namespace ilu_factorization { ++namespace { + + + GKO_REGISTER_OPERATION(compute_ilu, ilu_factorization::compute_lu); +@@ -58,6 +59,7 @@ GKO_REGISTER_OPERATION(initialize_row_ptrs_l_u, + GKO_REGISTER_OPERATION(initialize_l_u, factorization::initialize_l_u); + + ++} // anonymous namespace + } // namespace ilu_factorization + + +diff --git a/core/factorization/par_ic.cpp b/core/factorization/par_ic.cpp +index 33e40d85bb0..6266816a059 100644 +--- a/core/factorization/par_ic.cpp ++++ b/core/factorization/par_ic.cpp +@@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace factorization { + namespace par_ic_factorization { ++namespace { + + + GKO_REGISTER_OPERATION(add_diagonal_elements, +@@ -66,6 +67,7 @@ GKO_REGISTER_OPERATION(csr_transpose, csr::transpose); + GKO_REGISTER_OPERATION(convert_to_coo, csr::convert_to_coo); + + ++} // anonymous namespace + } // namespace par_ic_factorization + + +diff --git a/core/factorization/par_ict.cpp b/core/factorization/par_ict.cpp +index 69025ecd305..93050b5c67a 100644 +--- a/core/factorization/par_ict.cpp ++++ b/core/factorization/par_ict.cpp +@@ -57,6 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace factorization { + namespace par_ict_factorization { ++namespace { + + + GKO_REGISTER_OPERATION(threshold_select, +@@ -77,6 +78,7 @@ GKO_REGISTER_OPERATION(convert_to_coo, csr::convert_to_coo); + GKO_REGISTER_OPERATION(spgemm, csr::spgemm); + + ++} // anonymous namespace + } // namespace par_ict_factorization + + +diff --git a/core/factorization/par_ilu.cpp b/core/factorization/par_ilu.cpp +index 3b5bf605a4c..995902b9bb4 100644 +--- a/core/factorization/par_ilu.cpp ++++ b/core/factorization/par_ilu.cpp +@@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace factorization { + namespace par_ilu_factorization { ++namespace { + + + GKO_REGISTER_OPERATION(add_diagonal_elements, +@@ -64,6 +65,7 @@ GKO_REGISTER_OPERATION(compute_l_u_factors, + GKO_REGISTER_OPERATION(csr_transpose, csr::transpose); + + ++} // anonymous namespace + } // namespace par_ilu_factorization + + +diff --git a/core/factorization/par_ilut.cpp b/core/factorization/par_ilut.cpp +index 69370659cc3..3cd7f12b0f7 100644 +--- a/core/factorization/par_ilut.cpp ++++ b/core/factorization/par_ilut.cpp +@@ -56,6 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace factorization { + namespace par_ilut_factorization { ++namespace { + + + GKO_REGISTER_OPERATION(threshold_select, +@@ -77,6 +78,7 @@ GKO_REGISTER_OPERATION(convert_to_coo, csr::convert_to_coo); + GKO_REGISTER_OPERATION(spgemm, csr::spgemm); + + ++} // anonymous namespace + } // namespace par_ilut_factorization + + +diff --git a/core/matrix/coo.cpp b/core/matrix/coo.cpp +index efa2b160a92..4eda43b2dd8 100644 +--- a/core/matrix/coo.cpp ++++ b/core/matrix/coo.cpp +@@ -53,9 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace matrix { +- +- + namespace coo { ++namespace { + + + GKO_REGISTER_OPERATION(spmv, coo::spmv); +@@ -72,6 +71,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace coo + + +diff --git a/core/matrix/csr.cpp b/core/matrix/csr.cpp +index cd09474cf63..571a90ca351 100644 +--- a/core/matrix/csr.cpp ++++ b/core/matrix/csr.cpp +@@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace csr { ++namespace { + + + GKO_REGISTER_OPERATION(spmv, csr::spmv); +@@ -90,6 +91,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace csr + + +diff --git a/core/matrix/dense.cpp b/core/matrix/dense.cpp +index abf0fe57ac5..ef997adbaf7 100644 +--- a/core/matrix/dense.cpp ++++ b/core/matrix/dense.cpp +@@ -59,6 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace dense { ++namespace { + + + GKO_REGISTER_OPERATION(simple_apply, dense::simple_apply); +@@ -102,6 +103,7 @@ GKO_REGISTER_OPERATION(get_real, dense::get_real); + GKO_REGISTER_OPERATION(get_imag, dense::get_imag); + + ++} // anonymous namespace + } // namespace dense + + +diff --git a/core/matrix/diagonal.cpp b/core/matrix/diagonal.cpp +index 8a6d36a8759..9f158bc1650 100644 +--- a/core/matrix/diagonal.cpp ++++ b/core/matrix/diagonal.cpp +@@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace diagonal { ++namespace { + + + GKO_REGISTER_OPERATION(apply_to_dense, diagonal::apply_to_dense); +@@ -60,6 +61,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace diagonal + + +diff --git a/core/matrix/ell.cpp b/core/matrix/ell.cpp +index fcb198106cd..5cd026c6310 100644 +--- a/core/matrix/ell.cpp ++++ b/core/matrix/ell.cpp +@@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace ell { ++namespace { + + + GKO_REGISTER_OPERATION(spmv, ell::spmv); +@@ -70,6 +71,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace ell + + +diff --git a/core/matrix/fbcsr.cpp b/core/matrix/fbcsr.cpp +index 9e4a264b3e6..8911b72ff43 100644 +--- a/core/matrix/fbcsr.cpp ++++ b/core/matrix/fbcsr.cpp +@@ -57,6 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace fbcsr { ++namespace { + + + GKO_REGISTER_OPERATION(spmv, fbcsr::spmv); +@@ -80,6 +81,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace fbcsr + + +diff --git a/core/matrix/hybrid.cpp b/core/matrix/hybrid.cpp +index f6cf69f2955..7ad40dfe529 100644 +--- a/core/matrix/hybrid.cpp ++++ b/core/matrix/hybrid.cpp +@@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace hybrid { ++namespace { + + + GKO_REGISTER_OPERATION(convert_to_dense, hybrid::convert_to_dense); +@@ -68,6 +69,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace hybrid + + +diff --git a/core/matrix/sellp.cpp b/core/matrix/sellp.cpp +index 07542e3ab40..d51b0fb04c7 100644 +--- a/core/matrix/sellp.cpp ++++ b/core/matrix/sellp.cpp +@@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace sellp { ++namespace { + + + GKO_REGISTER_OPERATION(spmv, sellp::spmv); +@@ -66,6 +67,7 @@ GKO_REGISTER_OPERATION(outplace_absolute_array, + components::outplace_absolute_array); + + ++} // anonymous namespace + } // namespace sellp + + +diff --git a/core/matrix/sparsity_csr.cpp b/core/matrix/sparsity_csr.cpp +index d253792c6a3..e5a45557934 100644 +--- a/core/matrix/sparsity_csr.cpp ++++ b/core/matrix/sparsity_csr.cpp +@@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace matrix { + namespace sparsity_csr { ++namespace { + + + GKO_REGISTER_OPERATION(spmv, sparsity_csr::spmv); +@@ -62,6 +63,7 @@ GKO_REGISTER_OPERATION(is_sorted_by_column_index, + sparsity_csr::is_sorted_by_column_index); + + ++} // anonymous namespace + } // namespace sparsity_csr + + +diff --git a/core/multigrid/amgx_pgm.cpp b/core/multigrid/amgx_pgm.cpp +index e38d10d27c3..ff4e2423636 100644 +--- a/core/multigrid/amgx_pgm.cpp ++++ b/core/multigrid/amgx_pgm.cpp +@@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace multigrid { + namespace amgx_pgm { ++namespace { + + + GKO_REGISTER_OPERATION(match_edge, amgx_pgm::match_edge); +@@ -64,6 +65,7 @@ GKO_REGISTER_OPERATION(fill_array, components::fill_array); + GKO_REGISTER_OPERATION(fill_seq_array, components::fill_seq_array); + + ++} // anonymous namespace + } // namespace amgx_pgm + + +diff --git a/core/preconditioner/isai.cpp b/core/preconditioner/isai.cpp +index 7247b9a04e7..4ee7d718db3 100644 +--- a/core/preconditioner/isai.cpp ++++ b/core/preconditioner/isai.cpp +@@ -58,6 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace preconditioner { + namespace isai { ++namespace { + + + GKO_REGISTER_OPERATION(generate_tri_inverse, isai::generate_tri_inverse); +@@ -71,6 +72,7 @@ GKO_REGISTER_OPERATION(initialize_row_ptrs_l, + GKO_REGISTER_OPERATION(initialize_l, factorization::initialize_l); + + ++} // anonymous namespace + } // namespace isai + + +diff --git a/core/preconditioner/jacobi.cpp b/core/preconditioner/jacobi.cpp +index d62d97ec0b5..d908a7e0ac3 100644 +--- a/core/preconditioner/jacobi.cpp ++++ b/core/preconditioner/jacobi.cpp +@@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace preconditioner { + namespace jacobi { ++namespace { + + + GKO_REGISTER_OPERATION(simple_apply, jacobi::simple_apply); +@@ -73,6 +74,7 @@ GKO_REGISTER_OPERATION(scalar_convert_to_dense, + GKO_REGISTER_OPERATION(initialize_precisions, jacobi::initialize_precisions); + + ++} // anonymous namespace + } // namespace jacobi + + +diff --git a/core/reorder/rcm.cpp b/core/reorder/rcm.cpp +index f2ec8f0fd63..7224bad4ef3 100644 +--- a/core/reorder/rcm.cpp ++++ b/core/reorder/rcm.cpp +@@ -54,12 +54,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace reorder { + namespace rcm { ++namespace { + + + GKO_REGISTER_OPERATION(get_permutation, rcm::get_permutation); + GKO_REGISTER_OPERATION(get_degree_of_nodes, rcm::get_degree_of_nodes); + + ++} // anonymous namespace + } // namespace rcm + + +diff --git a/core/solver/bicg.cpp b/core/solver/bicg.cpp +index f79832dedc0..0f67a4f1ce1 100644 +--- a/core/solver/bicg.cpp ++++ b/core/solver/bicg.cpp +@@ -47,9 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace solver { +- +- + namespace bicg { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, bicg::initialize); +@@ -57,6 +56,7 @@ GKO_REGISTER_OPERATION(step_1, bicg::step_1); + GKO_REGISTER_OPERATION(step_2, bicg::step_2); + + ++} // anonymous namespace + } // namespace bicg + + +diff --git a/core/solver/bicgstab.cpp b/core/solver/bicgstab.cpp +index 7c8c852fa11..cf583b5dbd6 100644 +--- a/core/solver/bicgstab.cpp ++++ b/core/solver/bicgstab.cpp +@@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace solver { + namespace bicgstab { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, bicgstab::initialize); +@@ -56,6 +57,7 @@ GKO_REGISTER_OPERATION(step_3, bicgstab::step_3); + GKO_REGISTER_OPERATION(finalize, bicgstab::finalize); + + ++} // anonymous namespace + } // namespace bicgstab + + +diff --git a/core/solver/cb_gmres.cpp b/core/solver/cb_gmres.cpp +index 8478ea49b5e..104d77ccbbb 100644 +--- a/core/solver/cb_gmres.cpp ++++ b/core/solver/cb_gmres.cpp +@@ -54,9 +54,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace solver { +- +- + namespace cb_gmres { ++namespace { + + + GKO_REGISTER_OPERATION(initialize_1, cb_gmres::initialize_1); +@@ -65,6 +64,7 @@ GKO_REGISTER_OPERATION(step_1, cb_gmres::step_1); + GKO_REGISTER_OPERATION(step_2, cb_gmres::step_2); + + ++} // anonymous namespace + } // namespace cb_gmres + + +diff --git a/core/solver/cg.cpp b/core/solver/cg.cpp +index 4dc624584e8..ae0fb37f2a9 100644 +--- a/core/solver/cg.cpp ++++ b/core/solver/cg.cpp +@@ -47,9 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace solver { +- +- + namespace cg { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, cg::initialize); +@@ -57,6 +56,7 @@ GKO_REGISTER_OPERATION(step_1, cg::step_1); + GKO_REGISTER_OPERATION(step_2, cg::step_2); + + ++} // anonymous namespace + } // namespace cg + + +diff --git a/core/solver/cgs.cpp b/core/solver/cgs.cpp +index c33a3b7b9c1..16589ffbeb3 100644 +--- a/core/solver/cgs.cpp ++++ b/core/solver/cgs.cpp +@@ -46,9 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace solver { +- +- + namespace cgs { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, cgs::initialize); +@@ -57,6 +56,7 @@ GKO_REGISTER_OPERATION(step_2, cgs::step_2); + GKO_REGISTER_OPERATION(step_3, cgs::step_3); + + ++} // anonymous namespace + } // namespace cgs + + +diff --git a/core/solver/fcg.cpp b/core/solver/fcg.cpp +index ee1eff61434..fc081a21b23 100644 +--- a/core/solver/fcg.cpp ++++ b/core/solver/fcg.cpp +@@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace solver { + namespace fcg { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, fcg::initialize); +@@ -54,6 +55,7 @@ GKO_REGISTER_OPERATION(step_1, fcg::step_1); + GKO_REGISTER_OPERATION(step_2, fcg::step_2); + + ++} // anonymous namespace + } // namespace fcg + + +diff --git a/core/solver/gmres.cpp b/core/solver/gmres.cpp +index ac0c484a34b..f5e933631c8 100644 +--- a/core/solver/gmres.cpp ++++ b/core/solver/gmres.cpp +@@ -50,9 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace gko { + namespace solver { +- +- + namespace gmres { ++namespace { + + + GKO_REGISTER_OPERATION(initialize_1, gmres::initialize_1); +@@ -61,6 +60,7 @@ GKO_REGISTER_OPERATION(step_1, gmres::step_1); + GKO_REGISTER_OPERATION(step_2, gmres::step_2); + + ++} // anonymous namespace + } // namespace gmres + + +diff --git a/core/solver/idr.cpp b/core/solver/idr.cpp +index 411ab892dd9..d3190414678 100644 +--- a/core/solver/idr.cpp ++++ b/core/solver/idr.cpp +@@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace solver { + namespace idr { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, idr::initialize); +@@ -58,6 +59,7 @@ GKO_REGISTER_OPERATION(compute_omega, idr::compute_omega); + GKO_REGISTER_OPERATION(fill_array, components::fill_array); + + ++} // anonymous namespace + } // namespace idr + + +diff --git a/core/solver/ir.cpp b/core/solver/ir.cpp +index 5d7aa749b87..9b61d78cb33 100644 +--- a/core/solver/ir.cpp ++++ b/core/solver/ir.cpp +@@ -43,11 +43,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace solver { + namespace ir { ++namespace { + + + GKO_REGISTER_OPERATION(initialize, ir::initialize); + + ++} // anonymous namespace + } // namespace ir + + +diff --git a/core/solver/lower_trs.cpp b/core/solver/lower_trs.cpp +index 9c9f8306a92..cbe5f332f9a 100644 +--- a/core/solver/lower_trs.cpp ++++ b/core/solver/lower_trs.cpp +@@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace solver { + namespace lower_trs { ++namespace { + + + GKO_REGISTER_OPERATION(generate, lower_trs::generate); +@@ -60,6 +61,7 @@ GKO_REGISTER_OPERATION(should_perform_transpose, + GKO_REGISTER_OPERATION(solve, lower_trs::solve); + + ++} // anonymous namespace + } // namespace lower_trs + + +diff --git a/core/solver/upper_trs.cpp b/core/solver/upper_trs.cpp +index d4529fefd69..bae00182fc8 100644 +--- a/core/solver/upper_trs.cpp ++++ b/core/solver/upper_trs.cpp +@@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace solver { + namespace upper_trs { ++namespace { + + + GKO_REGISTER_OPERATION(generate, upper_trs::generate); +@@ -60,6 +61,7 @@ GKO_REGISTER_OPERATION(should_perform_transpose, + GKO_REGISTER_OPERATION(solve, upper_trs::solve); + + ++} // anonymous namespace + } // namespace upper_trs + + +diff --git a/core/stop/criterion.cpp b/core/stop/criterion.cpp +index 59d1db2839e..ca902912307 100644 +--- a/core/stop/criterion.cpp ++++ b/core/stop/criterion.cpp +@@ -39,11 +39,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace stop { + namespace criterion { ++namespace { + + + GKO_REGISTER_OPERATION(set_all_statuses, set_all_statuses::set_all_statuses); + + ++} // anonymous namespace + } // namespace criterion + + +diff --git a/core/stop/residual_norm.cpp b/core/stop/residual_norm.cpp +index 73630204a22..bd31e67caef 100644 +--- a/core/stop/residual_norm.cpp ++++ b/core/stop/residual_norm.cpp +@@ -40,21 +40,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace gko { + namespace stop { + namespace residual_norm { ++namespace { + + + GKO_REGISTER_OPERATION(residual_norm, residual_norm::residual_norm); + + ++} // anonymous namespace + } // namespace residual_norm + + + namespace implicit_residual_norm { ++namespace { + + + GKO_REGISTER_OPERATION(implicit_residual_norm, + implicit_residual_norm::implicit_residual_norm); + + ++} // anonymous namespace + } // namespace implicit_residual_norm + + diff --git a/recipes/ginkgo/all/test_package/CMakeLists.txt b/recipes/ginkgo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b153fe63054f5 --- /dev/null +++ b/recipes/ginkgo/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Ginkgo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Ginkgo::ginkgo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/ginkgo/all/test_package/conanfile.py b/recipes/ginkgo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/ginkgo/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ginkgo/all/test_package/test_package.cpp b/recipes/ginkgo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a98036e20c14b --- /dev/null +++ b/recipes/ginkgo/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +int main(int, char **) +{ + auto refExec = gko::ReferenceExecutor::create(); + auto test = gko::solver::Bicgstab<>::build() + .with_preconditioner(gko::preconditioner::Jacobi<>::build().with_max_block_size(1u).on(refExec)) + .with_criteria( + gko::stop::Iteration::build().with_max_iters(1u).on( + refExec), + gko::stop::ResidualNormReduction<>::build() + .with_reduction_factor(1e-10) + .on(refExec)) + .on(refExec); + + std::cout << "test_install: the Ginkgo installation was correctly detected " + "and is complete." + << std::endl; + + return 0; +} diff --git a/recipes/ginkgo/all/test_v1_package/CMakeLists.txt b/recipes/ginkgo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ginkgo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ginkgo/all/test_v1_package/conanfile.py b/recipes/ginkgo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ginkgo/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/ginkgo/config.yml b/recipes/ginkgo/config.yml new file mode 100644 index 0000000000000..25c9b4921636c --- /dev/null +++ b/recipes/ginkgo/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.0": + folder: all + "1.3.0": + folder: all diff --git a/recipes/gklib/all/CMakeLists.txt b/recipes/gklib/all/CMakeLists.txt new file mode 100644 index 0000000000000..17aa471de5c7b --- /dev/null +++ b/recipes/gklib/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper LANGUAGES C) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/gklib/all/conandata.yml b/recipes/gklib/all/conandata.yml new file mode 100644 index 0000000000000..65acd4434d084 --- /dev/null +++ b/recipes/gklib/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "5.1.1": + url: "https://github.com/KarypisLab/GKlib/archive/refs/tags/METIS-v5.1.1-DistDGL-0.5.tar.gz" + sha256: "52aa0d383d42360f4faa0ae9537ba2ca348eeab4db5f2dfd6343192d0ff4b833" +patches: + "5.1.1": + - patch_file: "patches/001-install-win32-headers.patch" + base_path: "source_subfolder" + - patch_file: "patches/002-disable-tests.patch" + base_path: "source_subfolder" + - patch_file: "patches/003-install-runtime.patch" + base_path: "source_subfolder" diff --git a/recipes/gklib/all/conanfile.py b/recipes/gklib/all/conanfile.py new file mode 100644 index 0000000000000..c9233e206a92a --- /dev/null +++ b/recipes/gklib/all/conanfile.py @@ -0,0 +1,96 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches + +required_conan_version = ">=1.43.0" + + +class GKlibConan(ConanFile): + name = "gklib" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/KarypisLab/GKlib" + description = "A library of various helper routines and frameworks" \ + " used by many of the lab's software" + topics = ("karypislab") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.options.shared and self._is_msvc: + raise ConanInvalidConfiguration( + f"{self.name} {self.version} shared not supported with Visual Studio") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["ASSERT"] = self.settings.build_type == "Debug" + self._cmake.definitions["ASSERT2"] = self.settings.build_type == "Debug" + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.libs = ["GKlib"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self._is_msvc or self._is_mingw: + self.cpp_info.defines.append("USE_GKREGEX") + if self._is_msvc: + self.cpp_info.defines.append("__thread=__declspec(thread)") diff --git a/recipes/gklib/all/patches/001-install-win32-headers.patch b/recipes/gklib/all/patches/001-install-win32-headers.patch new file mode 100644 index 0000000000000..ef49a65a88c55 --- /dev/null +++ b/recipes/gklib/all/patches/001-install-win32-headers.patch @@ -0,0 +1,21 @@ +Install headers for Visual Studio +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -29,3 +29,6 @@ install(TARGETS GKlib + ARCHIVE DESTINATION lib/${LINSTALL_PATH} + LIBRARY DESTINATION lib/${LINSTALL_PATH}) + install(FILES ${GKlib_includes} DESTINATION include/${HINSTALL_PATH}) ++if(MSVC) ++ install(FILES ${GKlib_win32_includes} DESTINATION include/${HINSTALL_PATH}/win32) ++endif() +diff --git a/GKlibSystem.cmake b/GKlibSystem.cmake +index d83b208..3dc5a7b 100644 +--- a/GKlibSystem.cmake ++++ b/GKlibSystem.cmake +@@ -135,3 +135,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GKlib_COPTIONS} ${GKlib_COPTS}") + # Find GKlib sources. + file(GLOB GKlib_sources ${GKLIB_PATH}/*.c) + file(GLOB GKlib_includes ${GKLIB_PATH}/*.h) ++if(MSVC) ++ file(GLOB GKlib_win32_includes ${GKLIB_PATH}/win32/*.h) ++endif() diff --git a/recipes/gklib/all/patches/002-disable-tests.patch b/recipes/gklib/all/patches/002-disable-tests.patch new file mode 100644 index 0000000000000..318b570bf934c --- /dev/null +++ b/recipes/gklib/all/patches/002-disable-tests.patch @@ -0,0 +1,12 @@ +Do not build tests +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,8 +22,6 @@ if(UNIX) + target_link_libraries(GKlib m) + endif(UNIX) + +-include_directories("test") +-add_subdirectory("test") + + install(TARGETS GKlib + ARCHIVE DESTINATION lib/${LINSTALL_PATH} diff --git a/recipes/gklib/all/patches/003-install-runtime.patch b/recipes/gklib/all/patches/003-install-runtime.patch new file mode 100644 index 0000000000000..f0d360d1a2c59 --- /dev/null +++ b/recipes/gklib/all/patches/003-install-runtime.patch @@ -0,0 +1,11 @@ +Add install destination for runtime +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,7 @@ endif(UNIX) + + + install(TARGETS GKlib ++ RUNTIME DESTINATION bin/${LINSTALL_PATH} + ARCHIVE DESTINATION lib/${LINSTALL_PATH} + LIBRARY DESTINATION lib/${LINSTALL_PATH}) + install(FILES ${GKlib_includes} DESTINATION include/${HINSTALL_PATH}) diff --git a/recipes/gklib/all/test_package/CMakeLists.txt b/recipes/gklib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b012d77ecf242 --- /dev/null +++ b/recipes/gklib/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gklib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} gklib::gklib) diff --git a/recipes/gklib/all/test_package/conanfile.py b/recipes/gklib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..46d71712aba54 --- /dev/null +++ b/recipes/gklib/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +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_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + self.build_requires("cmake/3.20.1") + + def 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/gklib/all/test_package/test_package.c b/recipes/gklib/all/test_package/test_package.c new file mode 100644 index 0000000000000..bbc1fb69c1776 --- /dev/null +++ b/recipes/gklib/all/test_package/test_package.c @@ -0,0 +1,72 @@ +/*! +\file strings.c +\brief Testing module for the string functions in GKlib +\date Started 3/5/2007 +\author George +\version\verbatim $Id: strings.c 10711 2011-08-31 22:23:04Z karypis $ \endverbatim +*/ + +#include + + +/*************************************************************************/ +/*! Testing module for gk_strstr_replace() */ +/*************************************************************************/ +void test_strstr_replace() +{ + char *new_str; + int rc; + + rc = gk_strstr_replace("This is a simple string", "s", "S", "", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + + rc = gk_strstr_replace("This is a simple string", "s", "S", "g", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + + rc = gk_strstr_replace("This is a simple SS & ss string", "s", "T", "g", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + + rc = gk_strstr_replace("This is a simple SS & ss string", "s", "T", "ig", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + rc = gk_strstr_replace("This is a simple SS & ss string", "\\b\\w(\\w+)\\w\\b", "$1", "ig", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + rc = gk_strstr_replace("This is a simple SS & ss string", "\\b\\w+\\b", "word", "ig", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + rc = gk_strstr_replace("http://www.cs.umn.edu/This-is-something-T12323?pp=20&page=4", + "(http://www\\.cs\\.umn\\.edu/)(.*)-T(\\d+)", "$1$2-P$3", "g", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + rc = gk_strstr_replace("http://www.cs.umn.edu/This-is-something-T12323?pp=20&page=4", + "(\\d+)", "number:$1", "ig", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); + + + rc = gk_strstr_replace("http://www.cs.umn.edu/This-is-something-T12323?pp=20&page=4", + "(http://www\\.cs\\.umn\\.edu/)", "[$1]", "g", &new_str); + printf("%d, %s.\n", rc, new_str); + gk_free((void **)&new_str, LTERM); +} + +void test_gk_cur_jbufs_linking(void) { + printf("%d", gk_cur_jbufs); +} + +int main() +{ + test_strstr_replace(); + test_gk_cur_jbufs_linking(); +} diff --git a/recipes/gklib/config.yml b/recipes/gklib/config.yml new file mode 100644 index 0000000000000..e7148244c2a2f --- /dev/null +++ b/recipes/gklib/config.yml @@ -0,0 +1,3 @@ +versions: + "5.1.1": + folder: all diff --git a/recipes/glad/all/conandata.yml b/recipes/glad/all/conandata.yml new file mode 100644 index 0000000000000..1dba3ce94b4ce --- /dev/null +++ b/recipes/glad/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.1.36": + url: "https://github.com/Dav1dde/glad/archive/v0.1.36.tar.gz" + sha256: "8470ed1b0e9fbe88e10c34770505c8a1dc8ccb78cadcf673331aaf5224f963d2" + "0.1.35": + url: "https://github.com/Dav1dde/glad/archive/v0.1.35.tar.gz" + sha256: "5fc384062960bc38f26128b9bfef3c667e405e592f121a235ecbecb20f8ec8af" + "0.1.34": + url: "https://github.com/Dav1dde/glad/archive/v0.1.34.tar.gz" + sha256: "4be2900ff76ac71a2aab7a8be301eb4c0338491c7e205693435b09aad4969ecd" + "0.1.33": + url: "https://github.com/Dav1dde/glad/archive/v0.1.33.tar.gz" + sha256: "4bc850062e9bcfc182bd4095d45b987517507d8ec0edcc424ed58f67b4ea9e37" +patches: + "0.1.36": + - patch_file: "patches/0003-CMake-handle-all-specs.patch" + "0.1.35": + - patch_file: "patches/0003-CMake-handle-all-specs.patch" + "0.1.34": + - patch_file: "patches/0002-CMake-handle-all-specs.patch" + "0.1.33": + - patch_file: "patches/0001-CMake-handle-all-specs.patch" diff --git a/recipes/glad/all/conanfile.py b/recipes/glad/all/conanfile.py new file mode 100644 index 0000000000000..6e5e16777a859 --- /dev/null +++ b/recipes/glad/all/conanfile.py @@ -0,0 +1,145 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.errors import ConanInvalidConfiguration + +class GladConan(ConanFile): + name = "glad" + description = "Multi-Language GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs." + topics = ("opengl",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Dav1dde/glad" + license = "MIT" + settings = "os", "compiler", "build_type", "arch" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "no_loader": [True, False], + "spec": ["gl", "egl", "glx", "wgl"], # Name of the spec + "extensions": ["ANY"], # Path to extensions file or comma separated list of extensions, if missing all extensions are included + # if specification is gl + "gl_profile": ["compatibility", "core"], + "gl_version": ["None", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0", + "2.1", "3.0", "3.1", "3.2", "3.3", "4.0", "4.1", "4.2", + "4.3", "4.4", "4.5", "4.6"], + "gles1_version": ["None", "1.0"], + "gles2_version": ["None", "2.0", "3.0", "3.1", "3.2"], + "glsc2_version": ["None", "2.0"], + # if specification is egl + "egl_version": ["None", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5"], + # if specification is glx + "glx_version": ["None", "1.0", "1.1", "1.2", "1.3", "1.4"], + # if specification is wgl + "wgl_version": ["None", "1.0"] + } + + default_options = { + "shared": False, + "fPIC": True, + "no_loader": False, + "spec": "gl", + "extensions": "", + "gl_profile": "compatibility", + "gl_version": "3.3", + "gles1_version": "None", + "gles2_version": "None", + "glsc2_version": "None", + "egl_version": "None", + "glx_version": "None", + "wgl_version": "None" + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + if self.options.spec != "gl": + del self.options.gl_profile + del self.options.gl_version + del self.options.gles1_version + del self.options.gles2_version + del self.options.glsc2_version + + if self.options.spec != "egl": + del self.options.egl_version + + if self.options.spec != "glx": + del self.options.glx_version + + if self.options.spec != "wgl": + del self.options.wgl_version + + def validate(self): + if self.options.spec == "wgl" and self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref}:{self.options.spec} specification is not compatible with {self.settings.os}") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if "gl_profile" in self.options: + tc.variables["GLAD_PROFILE"] = self.options.gl_profile + tc.variables["GLAD_API"] = self._get_api() + tc.variables["GLAD_EXTENSIONS"] = self.options.extensions + tc.variables["GLAD_SPEC"] = self.options.spec + tc.variables["GLAD_NO_LOADER"] = self.options.no_loader + tc.variables["GLAD_GENERATOR"] = "c" if self.settings.build_type == "Release" else "c-debug" + tc.variables["GLAD_EXPORT"] = True + tc.variables["GLAD_INSTALL"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _get_api(self): + if self.options.spec == "gl": + spec_api = { + "gl": self.options.gl_version, + "gles1": self.options.gles1_version, + "gles2": self.options.gles2_version, + "glsc2": self.options.glsc2_version + } + elif self.options.spec == "egl": + spec_api = {"egl": self.options.egl_version} + elif self.options.spec == "glx": + spec_api = {"glx": self.options.glx_version} + elif self.options.spec == "wgl": + spec_api = {"wgl": self.options.wgl_version} + + api_concat = ",".join(f"{api_name}={api_version}".format() + for api_name, api_version in spec_api.items() if api_version != "None") + + return api_concat + + def package(self): + CMake(self).install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + if self.options.shared: + self.cpp_info.defines = ["GLAD_GLAPI_EXPORT"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("dl") diff --git a/recipes/glad/all/patches/0001-CMake-handle-all-specs.patch b/recipes/glad/all/patches/0001-CMake-handle-all-specs.patch new file mode 100644 index 0000000000000..499eebf9e91c5 --- /dev/null +++ b/recipes/glad/all/patches/0001-CMake-handle-all-specs.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index eee46ea..eb13f73 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,10 +58,17 @@ elseif(GLAD_GENERATOR STREQUAL "volt") + ) + else() + set(GLAD_INCLUDE_DIRS "${GLAD_OUT_DIR}/include") +- list(APPEND GLAD_SOURCES +- "${GLAD_OUT_DIR}/src/glad.c" +- "${GLAD_INCLUDE_DIRS}/glad/glad.h" +- ) ++ if(GLAD_SPEC STREQUAL "gl") ++ list(APPEND GLAD_SOURCES ++ "${GLAD_OUT_DIR}/src/glad.c" ++ "${GLAD_INCLUDE_DIRS}/glad/glad.h" ++ ) ++ else() ++ list(APPEND GLAD_SOURCES ++ "${GLAD_OUT_DIR}/src/glad_${GLAD_SPEC}.c" ++ "${GLAD_INCLUDE_DIRS}/glad/glad_${GLAD_SPEC}.h" ++ ) ++ endif() + endif() + + if(GLAD_NO_LOADER) diff --git a/recipes/glad/all/patches/0002-CMake-handle-all-specs.patch b/recipes/glad/all/patches/0002-CMake-handle-all-specs.patch new file mode 100644 index 0000000000000..43332c1017b50 --- /dev/null +++ b/recipes/glad/all/patches/0002-CMake-handle-all-specs.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -73,10 +73,17 @@ elseif(GLAD_GENERATOR STREQUAL "volt") + ) + else() + set(GLAD_INCLUDE_DIRS "${GLAD_OUT_DIR}/include") +- list(APPEND GLAD_SOURCES +- "${GLAD_OUT_DIR}/src/glad.c" +- "${GLAD_INCLUDE_DIRS}/glad/glad.h" +- ) ++ if(GLAD_SPEC STREQUAL "gl") ++ list(APPEND GLAD_SOURCES ++ "${GLAD_OUT_DIR}/src/glad.c" ++ "${GLAD_INCLUDE_DIRS}/glad/glad.h" ++ ) ++ else() ++ list(APPEND GLAD_SOURCES ++ "${GLAD_OUT_DIR}/src/glad_${GLAD_SPEC}.c" ++ "${GLAD_INCLUDE_DIRS}/glad/glad_${GLAD_SPEC}.h" ++ ) ++ endif() + endif() + + if(NOT GLAD_ALL_EXTENSIONS) diff --git a/recipes/glad/all/patches/0003-CMake-handle-all-specs.patch b/recipes/glad/all/patches/0003-CMake-handle-all-specs.patch new file mode 100644 index 0000000000000..92a43a1a5cf8d --- /dev/null +++ b/recipes/glad/all/patches/0003-CMake-handle-all-specs.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0466e11..0726557 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -90,10 +90,17 @@ else() + foreach(spec ${spec_list}) + if(${spec} STREQUAL "gl") + list(APPEND GLAD_HEADERS "${GLAD_INCLUDE_DIRS}/glad/glad.h") +- list(APPEND GLAD_SOURCES +- "${GLAD_INCLUDE_DIRS}/glad/glad.h" +- "${GLAD_OUT_DIR}/src/glad.c" +- ) ++ if(GLAD_SPEC STREQUAL "gl") ++ list(APPEND GLAD_SOURCES ++ "${GLAD_OUT_DIR}/src/glad.c" ++ "${GLAD_INCLUDE_DIRS}/glad/glad.h" ++ ) ++ else() ++ list(APPEND GLAD_SOURCES ++ "${GLAD_OUT_DIR}/src/glad_${GLAD_SPEC}.c" ++ "${GLAD_INCLUDE_DIRS}/glad/glad_${GLAD_SPEC}.h" ++ ) ++ endif() + else() + list(APPEND GLAD_HEADERS "${GLAD_INCLUDE_DIRS}/glad/glad_${spec}.h") + list(APPEND GLAD_SOURCES diff --git a/recipes/glad/all/test_package/CMakeLists.txt b/recipes/glad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..672dd8a2797af --- /dev/null +++ b/recipes/glad/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(glad REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glad::glad) diff --git a/recipes/glad/all/test_package/conanfile.py b/recipes/glad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c4fa6db1be46 --- /dev/null +++ b/recipes/glad/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glad/all/test_package/test_package.c b/recipes/glad/all/test_package/test_package.c new file mode 100644 index 0000000000000..a67cc937dc824 --- /dev/null +++ b/recipes/glad/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include "glad/glad.h" + +#include + +int main() { + return EXIT_SUCCESS; +} diff --git a/recipes/glad/all/test_v1_package/CMakeLists.txt b/recipes/glad/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..393ceb7e700f6 --- /dev/null +++ b/recipes/glad/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glad/all/test_v1_package/conanfile.py b/recipes/glad/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/glad/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glad/config.yml b/recipes/glad/config.yml new file mode 100644 index 0000000000000..20bf40ac113d1 --- /dev/null +++ b/recipes/glad/config.yml @@ -0,0 +1,9 @@ +versions: + "0.1.36": + folder: all + "0.1.35": + folder: all + "0.1.34": + folder: all + "0.1.33": + folder: all diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml new file mode 100644 index 0000000000000..165fceb314bfd --- /dev/null +++ b/recipes/glaze/all/conandata.yml @@ -0,0 +1,56 @@ +sources: + "1.2.3": + url: "https://github.com/stephenberry/glaze/archive/v1.2.3.tar.gz" + sha256: "003cd3922795319253f080b328dd5c957bc8f446cc2a8145324c2748f4acf10f" + "1.2.2": + url: "https://github.com/stephenberry/glaze/archive/v1.2.2.tar.gz" + sha256: "9bacbe5b07819de9799c8b9aa4861224768d2f87b0cb2f16bd1a4639c6e54755" + "1.2.0": + url: "https://github.com/stephenberry/glaze/archive/v1.2.0.tar.gz" + sha256: "f324a88885da5ed832ddb3ab4e3b0c8994815167b2608615fabfe0373c48a0a4" + "1.1.2": + url: "https://github.com/stephenberry/glaze/archive/v1.1.2.tar.gz" + sha256: "ee22d55b7f40d63f510a41f22765cb24e9e70d312978bad4eb9c94c7ba2fe58c" + "0.3.6": + url: "https://github.com/stephenberry/glaze/archive/v0.3.6.tar.gz" + sha256: "bc87d4fd458f0634a146d6f4c902a952b66c3f718c3e20f680b99066224b51a1" + "0.3.5": + url: "https://github.com/stephenberry/glaze/archive/v0.3.5.tar.gz" + sha256: "4a3e81a4862b57a21b03ed6d5b823397291e50e7b7d24944cc4932c5ae256cf7" + "0.3.2": + url: "https://github.com/stephenberry/glaze/archive/v0.3.2.tar.gz" + sha256: "41f19b1b4872a637ecb63bccb07578255f54c8842faf1bab78779e6342b2fa7e" + "0.2.2": + url: "https://github.com/stephenberry/glaze/archive/v0.2.2.tar.gz" + sha256: "d0d2edcc546b0ebb4bedaeedfb4a54aa678a6fdffa6b20dd6b252ef6325a9e75" + "0.2.1": + url: "https://github.com/stephenberry/glaze/archive/v0.2.1.tar.gz" + sha256: "dcf9ddf51b186dbc4cfd3b9324f9ee238cc1ba46fc2a62effa9293971ac4d1d4" + "0.2.0": + url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" + sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" + "0.1.8": + url: "https://github.com/stephenberry/glaze/archive/v0.1.8.tar.gz" + sha256: "8268ec2a8e0f2d9de2e65830ad9f7a623577c7bd47d465d4c6e4bed9d266ad48" + "0.1.7": + url: "https://github.com/stephenberry/glaze/archive/v0.1.7.tar.gz" + sha256: "7dc31ceaa444fd92339a48a69be638e92daa2858c3228f347b1df54a824b8f62" + "0.1.4": + url: "https://github.com/stephenberry/glaze/archive/v0.1.4.tar.gz" + sha256: "dd46e77973fe5b3cf4cd68fd597ba6b1010ecffd3e10cd8ccbd6cd615e6ffaff" + "0.0.7": + url: "https://github.com/stephenberry/glaze/archive/refs/tags/v0.0.7.tar.gz" + sha256: "124f7e8fea58c012b548ba1b643684fe428c7dbfeb8d8a5f701eb7db4356a759" +patches: + "0.2.2": + - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" + patch_description: "use cci's frozen" + patch_type: "conan" + "0.2.1": + - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" + patch_description: "use cci's frozen" + patch_type: "conan" + "0.2.0": + - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" + patch_description: "use cci's frozen" + patch_type: "conan" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py new file mode 100644 index 0000000000000..7f723fc2acd6a --- /dev/null +++ b/recipes/glaze/all/conanfile.py @@ -0,0 +1,88 @@ +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.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + +class GlazeConan(ConanFile): + name = "glaze" + description = "Extremely fast, in memory, JSON and interface library for modern C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/stephenberry/glaze" + topics = ("json", "memory", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "12", + "clang": "12" if Version(self.version) > "1.0.0" else "13", + "apple-clang": "13.1", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "0.2.4": + self.requires("fmt/9.1.0") + self.requires("frozen/1.1.1") + self.requires("nanorange/cci.20200706") + if Version(self.version) < "0.2.3": + self.requires("fast_float/4.0.0") + if "0.1.5" <= Version(self.version) < "0.2.3": + self.requires("dragonbox/1.1.3") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._minimum_cpp_standard}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + excludes="glaze/frozen/*.hpp" if Version(self.version) < "0.2.4" else "", + 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/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch b/recipes/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch new file mode 100644 index 0000000000000..01b0c786fa02b --- /dev/null +++ b/recipes/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch @@ -0,0 +1,28 @@ +diff --git a/include/glaze/core/common.hpp b/include/glaze/core/common.hpp +index aed6ce6..6cf4ace 100644 +--- a/include/glaze/core/common.hpp ++++ b/include/glaze/core/common.hpp +@@ -12,8 +12,8 @@ + #include + #include + +-#include "glaze/frozen/string.hpp" +-#include "glaze/frozen/unordered_map.hpp" ++#include "frozen/string.h" ++#include "frozen/unordered_map.h" + + #include "glaze/core/context.hpp" + #include "glaze/core/meta.hpp" +diff --git a/include/glaze/util/hash_map.hpp b/include/glaze/util/hash_map.hpp +index eaaec57..ae75ee2 100644 +--- a/include/glaze/util/hash_map.hpp ++++ b/include/glaze/util/hash_map.hpp +@@ -4,7 +4,7 @@ + #include + #include + +-#include "glaze/frozen/random.hpp" ++#include "frozen/random.h" + #include "glaze/util/string_cmp.hpp" + + namespace glz diff --git a/recipes/glaze/all/test_package/CMakeLists.txt b/recipes/glaze/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..11ef3b807bd40 --- /dev/null +++ b/recipes/glaze/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(glaze REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glaze::glaze) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +if(glaze_VERSION VERSION_LESS "1.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE GLAZE_USE_EXCEPTION) +endif() diff --git a/recipes/glaze/all/test_package/conanfile.py b/recipes/glaze/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/glaze/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/glaze/all/test_package/test_package.cpp b/recipes/glaze/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8dbee5ab44d50 --- /dev/null +++ b/recipes/glaze/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include "glaze/glaze.hpp" +#include "glaze/json/json_ptr.hpp" +#include "glaze/api/impl.hpp" + +struct my_struct +{ + int i = 287; + double d = 3.14; + std::string hello = "Hello World"; + std::array arr = { 1, 2, 3 }; +}; + +template <> +struct glz::meta { + using T = my_struct; + static constexpr auto value = object( + "i", &T::i, + "d", &T::d, + "hello", &T::hello, + "arr", &T::arr + ); +}; + +int main(void) { + std::string buffer = R"({"i":287,"d":3.14,"hello":"Hello World","arr":[1,2,3]})"; +#ifdef GLAZE_USE_EXCEPTION + auto s = glz::read_json(buffer); + + (void)s.d; + (void)s.hello; + (void)s.arr; +#else + auto s = glz::read_json(buffer); + + if (s) { + (void)s.value().d; + (void)s.value().hello; + (void)s.value().arr; + } +#endif + + return 0; +} diff --git a/recipes/glaze/all/test_v1_package/CMakeLists.txt b/recipes/glaze/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9652e22fc19d5 --- /dev/null +++ b/recipes/glaze/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/glaze/all/test_v1_package/conanfile.py b/recipes/glaze/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/glaze/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml new file mode 100644 index 0000000000000..779e5b74adbe2 --- /dev/null +++ b/recipes/glaze/config.yml @@ -0,0 +1,29 @@ +versions: + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.2.0": + folder: all + "1.1.2": + folder: all + "0.3.6": + folder: all + "0.3.5": + folder: all + "0.3.2": + folder: all + "0.2.2": + folder: all + "0.2.1": + folder: all + "0.2.0": + folder: all + "0.1.8": + folder: all + "0.1.7": + folder: all + "0.1.4": + folder: all + "0.0.7": + folder: all diff --git a/recipes/glbinding/all/conandata.yml b/recipes/glbinding/all/conandata.yml new file mode 100644 index 0000000000000..c3868ee88cb4c --- /dev/null +++ b/recipes/glbinding/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "3.1.0": + url: "https://github.com/cginternals/glbinding/archive/v3.1.0.tar.gz" + sha256: "6729b260787108462ec6d8954f32a3f11f959ada7eebf1a2a33173b68762849e" +patches: + "3.1.0": + - patch_file: "patches/cmake-install.patch" + - patch_file: "patches/getProcAddr.patch" diff --git a/recipes/glbinding/all/conanfile.py b/recipes/glbinding/all/conanfile.py new file mode 100644 index 0000000000000..f3b937be48106 --- /dev/null +++ b/recipes/glbinding/all/conanfile.py @@ -0,0 +1,120 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class GlbindingConan(ConanFile): + name = "glbinding" + description = "A C++ binding for the OpenGL API, generated using the gl.xml specification." + license = "MIT" + topics = ("opengl", "binding") + homepage = "https://glbinding.org/" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["OPTION_SELF_CONTAINED"] = False + tc.cache_variables["OPTION_BUILD_TESTS"] = False + tc.cache_variables["OPTION_BUILD_DOCS"] = False + tc.cache_variables["OPTION_BUILD_TOOLS"] = False + tc.cache_variables["OPTION_BUILD_EXAMPLES"] = False + tc.cache_variables["OPTION_BUILD_WITH_BOOST_THREAD"] = False + tc.cache_variables["OPTION_BUILD_CHECK"] = False + # TODO: might be a good idea to fix upstream CMakeLists to not rely on + # WriteCompilerDetectionHeader, and just use cxx_std_11 compile feature + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0120"] = "OLD" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + compile_options = os.path.join(self.source_folder, "cmake", "CompileOptions.cmake") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Don't force PIC + replace_in_file(self, compile_options, "POSITION_INDEPENDENT_CODE ON", "") + # Don't replace /W3 by /W4 + replace_in_file(self, compile_options, "/W4", "") + # No whole program optimization + replace_in_file(self, compile_options, "/GL", "") + # Don't populate rpath + replace_in_file(self, cmakelists, "if(NOT SYSTEM_DIR_INSTALL)", "if(0)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "glbinding") + + suffix = "d" if self.settings.build_type == "Debug" else "" + # glbinding + self.cpp_info.components["_glbinding"].set_property("cmake_target_name", "glbinding::glbinding") + self.cpp_info.components["_glbinding"].libs = ["glbinding" + suffix] + self.cpp_info.components["_glbinding"].requires = ["khrplatform"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_glbinding"].system_libs = ["dl", "pthread"] + # glbinding-aux + self.cpp_info.components["glbinding-aux"].set_property("cmake_target_name", "glbinding::glbinding-aux") + self.cpp_info.components["glbinding-aux"].libs = ["glbinding-aux" + suffix] + self.cpp_info.components["glbinding-aux"].requires = ["_glbinding"] + # KHRplatform + self.cpp_info.components["khrplatform"].set_property("cmake_target_name", "glbinding::KHRplatform") + self.cpp_info.components["khrplatform"].libdirs = [] + + # workaround to propagate all components in CMakeDeps generator + self.cpp_info.set_property("cmake_target_name", "glbinding::glbinding-aux") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "glbinding" + self.cpp_info.names["cmake_find_package_multi"] = "glbinding" + self.cpp_info.components["_glbinding"].names["cmake_find_package"] = "glbinding" + self.cpp_info.components["_glbinding"].names["cmake_find_package_multi"] = "glbinding" + self.cpp_info.components["glbinding-aux"].names["cmake_find_package"] = "glbinding-aux" + self.cpp_info.components["glbinding-aux"].names["cmake_find_package_multi"] = "glbinding-aux" + self.cpp_info.components["khrplatform"].names["cmake_find_package"] = "KHRplatform" + self.cpp_info.components["khrplatform"].names["cmake_find_package_multi"] = "KHRplatform" diff --git a/recipes/glbinding/all/patches/cmake-install.patch b/recipes/glbinding/all/patches/cmake-install.patch new file mode 100644 index 0000000000000..8e001445fbd6a --- /dev/null +++ b/recipes/glbinding/all/patches/cmake-install.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -152,11 +152,11 @@ if(UNIX AND SYSTEM_DIR_INSTALL) + set(INSTALL_INIT "/etc/init") # /etc/init (upstart init scripts) + else() + # Install into local directory +- set(INSTALL_ROOT ".") # ./ ++ set(INSTALL_ROOT "share") # ./ + set(INSTALL_CMAKE "cmake") # ./cmake + set(INSTALL_EXAMPLES ".") # ./ + set(INSTALL_DATA ".") # ./ +- set(INSTALL_BIN ".") # ./ ++ set(INSTALL_BIN "bin") # ./ + set(INSTALL_SHARED "lib") # ./lib + set(INSTALL_LIB "lib") # ./lib + set(INSTALL_INCLUDE "include") # ./include diff --git a/recipes/glbinding/all/patches/getProcAddr.patch b/recipes/glbinding/all/patches/getProcAddr.patch new file mode 100644 index 0000000000000..6ce27e5135994 --- /dev/null +++ b/recipes/glbinding/all/patches/getProcAddr.patch @@ -0,0 +1,21 @@ +--- a/source/glbinding/source/getProcAddress.cpp ++++ b/source/glbinding/source/getProcAddress.cpp +@@ -21,7 +21,7 @@ ProcAddress getProcAddress(const char * name) + static auto module = LoadLibrary(_T("OPENGL32.DLL")); + + // Prevent static linking of opengl32 +- static auto wglGetProcAddress_ = reinterpret_cast(::GetProcAddress(module, "wglGetProcAddress")); ++ static auto wglGetProcAddress_ = reinterpret_cast((uintptr_t)::GetProcAddress(module, "wglGetProcAddress")); + assert(wglGetProcAddress_ != nullptr); + + auto procAddress = wglGetProcAddress_(name); +@@ -30,7 +30,7 @@ ProcAddress getProcAddress(const char * name) + return reinterpret_cast(procAddress); + } + +- procAddress = ::GetProcAddress(module, name); ++ procAddress = (void*)::GetProcAddress(module, name); + return reinterpret_cast(procAddress); + } + + diff --git a/recipes/glbinding/all/test_package/CMakeLists.txt b/recipes/glbinding/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ff080ea67fff7 --- /dev/null +++ b/recipes/glbinding/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(glbinding REQUIRED CONFIG) +find_package(glfw3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glbinding::glbinding glfw) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/glbinding/all/test_package/conanfile.py b/recipes/glbinding/all/test_package/conanfile.py new file mode 100644 index 0000000000000..64eabdd7c894e --- /dev/null +++ b/recipes/glbinding/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("glfw/3.3.8") + + 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/glbinding/all/test_package/test_package.cpp b/recipes/glbinding/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..046173356e0ad --- /dev/null +++ b/recipes/glbinding/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#define GLFW_INCLUDE_NONE +#include + +int main() { + GLFWmonitor *monitor = glfwGetPrimaryMonitor(); + GLFWwindow *window = glfwCreateWindow(640, 480, "Window name", monitor, NULL); + + glbinding::initialize(glfwGetProcAddress, false); + + glfwDestroyWindow(window); + glfwTerminate(); + + return 0; +} diff --git a/recipes/glbinding/all/test_v1_package/CMakeLists.txt b/recipes/glbinding/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glbinding/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glbinding/all/test_v1_package/conanfile.py b/recipes/glbinding/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..67eb137fb4f2d --- /dev/null +++ b/recipes/glbinding/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires("glfw/3.3.8") + + 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/glbinding/config.yml b/recipes/glbinding/config.yml new file mode 100644 index 0000000000000..baa80af0c4b7d --- /dev/null +++ b/recipes/glbinding/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.0": + folder: all diff --git a/recipes/glew/all/conandata.yml b/recipes/glew/all/conandata.yml new file mode 100644 index 0000000000000..c4c27b1a2cf9f --- /dev/null +++ b/recipes/glew/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.2.0": + sha256: "d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1" + url: "https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz" + "2.1.0": + sha256: "04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95" + url: "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz" +patches: + "2.2.0": + - patch_file: "patches/0001-fix-cmake-2.2.0.patch" + patch_description: "Fix CMake: cmake_minimum_required() before project()" + patch_type: conan + "2.1.0": + - patch_file: "patches/0001-fix-cmake-2.1.0.patch" + patch_description: "Fix CMake: cmake_minimum_required() before project()" + patch_type: conan + - patch_file: "patches/0002-vs16-release-fix.patch" + patch_type: "backport" + patch_source: "https://github.com/nigels-com/glew/commit/4bbe8aa2ab70a6eb847ee5751735422d0ba623cd" diff --git a/recipes/glew/all/conanfile.py b/recipes/glew/all/conanfile.py new file mode 100644 index 0000000000000..75e5f17da8e37 --- /dev/null +++ b/recipes/glew/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +import os + +required_conan_version = ">=1.52.0" + + +class GlewConan(ConanFile): + name = "glew" + description = "The GLEW library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://github.com/nigels-com/glew" + topics = ("glew", "opengl", "wrangler", "loader", "binding") + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_egl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_egl": False, + } + + 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_egl + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + self.requires("glu/system") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_UTILS"] = False + tc.variables["GLEW_EGL"] = self.options.get_safe("with_egl", False) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "build", "cmake")) + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + def package_info(self): + glewlib_target_name = "glew" if self.options.shared else "glew_s" + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "GLEW") + self.cpp_info.set_property("cmake_file_name", "glew") + self.cpp_info.set_property("cmake_target_name", "GLEW::GLEW") + self.cpp_info.set_property("pkg_config_name", "glew") + self.cpp_info.components["glewlib"].set_property("cmake_module_target_name", "GLEW::GLEW") + self.cpp_info.components["glewlib"].set_property("cmake_target_name", f"GLEW::{glewlib_target_name}") + self.cpp_info.components["glewlib"].set_property("pkg_config_name", "glew") + + if self.settings.os == "Windows": + lib_name = "glew32" if self.options.shared else "libglew32" + else: + lib_name = "GLEW" + if self.settings.build_type == "Debug": + lib_name += "d" + self.cpp_info.components["glewlib"].libs = [lib_name] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.components["glewlib"].defines.append("GLEW_STATIC") + self.cpp_info.components["glewlib"].requires = ["opengl::opengl", "glu::glu"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "GLEW" + self.cpp_info.filenames["cmake_find_package_multi"] = "glew" + self.cpp_info.names["cmake_find_package"] = "GLEW" + self.cpp_info.names["cmake_find_package_multi"] = "GLEW" + self.cpp_info.components["glewlib"].names["cmake_find_package"] = "GLEW" + self.cpp_info.components["glewlib"].names["cmake_find_package_multi"] = glewlib_target_name diff --git a/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch b/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch new file mode 100644 index 0000000000000..d64b6d88a9c4b --- /dev/null +++ b/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch @@ -0,0 +1,15 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -1,10 +1,10 @@ ++cmake_minimum_required (VERSION 2.8.12) ++project (glew C) + if ( NOT DEFINED CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" ) + endif () + +-project (glew) + +-cmake_minimum_required (VERSION 2.8.12) + + include(GNUInstallDirs) + diff --git a/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch b/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch new file mode 100644 index 0000000000000..8373c5364c4dd --- /dev/null +++ b/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch @@ -0,0 +1,15 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -1,10 +1,10 @@ ++cmake_minimum_required (VERSION 2.8.12) ++project (glew C) + if ( NOT DEFINED CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" ) + endif () + +-project (glew C) + +-cmake_minimum_required (VERSION 2.8.12) + + include(GNUInstallDirs) + diff --git a/recipes/glew/all/patches/0002-vs16-release-fix.patch b/recipes/glew/all/patches/0002-vs16-release-fix.patch new file mode 100644 index 0000000000000..8fab8fdd4a920 --- /dev/null +++ b/recipes/glew/all/patches/0002-vs16-release-fix.patch @@ -0,0 +1,12 @@ +diff -Nuar a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt +--- a/build/cmake/CMakeLists.txt 2020-01-23 04:02:19.297625325 +0300 ++++ b/build/cmake/CMakeLists.txt 2020-01-23 04:02:57.444622827 +0300 +@@ -109,6 +109,8 @@ + target_compile_options (glew_s PRIVATE -GS-) + # remove stdlib dependency + target_link_libraries (glew LINK_PRIVATE -nodefaultlib -noentry) ++ target_link_libraries (glew LINK_PRIVATE libvcruntime.lib) ++ target_link_libraries (glew LINK_PRIVATE msvcrt.lib ) + string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) + elseif (WIN32 AND ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))) + # remove stdlib dependency on windows with GCC and Clang (for similar reasons diff --git a/recipes/glew/all/test_package/CMakeLists.txt b/recipes/glew/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f7e367639f538 --- /dev/null +++ b/recipes/glew/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(GLEW REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GLEW::GLEW) diff --git a/recipes/glew/all/test_package/conanfile.py b/recipes/glew/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/glew/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/glew/all/test_package/test_package.c b/recipes/glew/all/test_package/test_package.c new file mode 100644 index 0000000000000..07557b081bb50 --- /dev/null +++ b/recipes/glew/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main () +{ + assert(glewGetString(GLEW_VERSION)); + printf("GLEW %s\n", glewGetString(GLEW_VERSION)); + return EXIT_SUCCESS; +} diff --git a/recipes/glew/all/test_v1_package/CMakeLists.txt b/recipes/glew/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..abaffb362cf82 --- /dev/null +++ b/recipes/glew/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GLEW REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GLEW::GLEW) diff --git a/recipes/glew/all/test_v1_package/conanfile.py b/recipes/glew/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/glew/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glew/config.yml b/recipes/glew/config.yml new file mode 100644 index 0000000000000..57df2fc911f74 --- /dev/null +++ b/recipes/glew/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.0": + folder: all + "2.1.0": + folder: all diff --git a/recipes/glext/all/conandata.yml b/recipes/glext/all/conandata.yml new file mode 100644 index 0000000000000..c92de73c28c2b --- /dev/null +++ b/recipes/glext/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210420": + url: "https://github.com/KhronosGroup/OpenGL-Registry/raw/8e729daa702d45597ccffa0c964bba1eca10a9e6/api/GL/glext.h" + sha256: "d19f1fd288d7e997eb797b11700e96f42344d22163a67bcae8e8747fcc5cc6b7" diff --git a/recipes/glext/all/conanfile.py b/recipes/glext/all/conanfile.py new file mode 100644 index 0000000000000..746356cd3af89 --- /dev/null +++ b/recipes/glext/all/conanfile.py @@ -0,0 +1,35 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.37.0" + +class GlextConan(ConanFile): + name = "glext" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" + description = "OpenGL 1.2 and above compatibility profile and extension interfaces" + topics = ("opengl", "gl", "glext") + no_copy_source = True + + def requirements(self): + self.requires("opengl/system") + self.requires("khrplatform/cci.20200529") + + def source(self): + tools.download(filename="glext.h", **self.conan_data["sources"][self.version]) + + def package(self): + self.copy(pattern="glext.h", dst=os.path.join("include", "GL")) + license_data = tools.load(os.path.join(self.source_folder, "glext.h")) + begin = license_data.find("/*") + len("/*") + end = license_data.find("*/") + license_data = license_data[begin:end] + license_data = license_data.replace("**", "") + tools.save("LICENSE", license_data) + self.copy("LICENSE", dst="licenses") + + def package_id(self): + self.info.header_only() diff --git a/recipes/glext/all/test_package/CMakeLists.txt b/recipes/glext/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b455e673a3ef0 --- /dev/null +++ b/recipes/glext/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(glext REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glext::glext) diff --git a/recipes/glext/all/test_package/conanfile.py b/recipes/glext/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/glext/all/test_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/glext/all/test_package/test_package.c b/recipes/glext/all/test_package/test_package.c new file mode 100644 index 0000000000000..9d878cd4be06b --- /dev/null +++ b/recipes/glext/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include + +#ifdef _MSC_VER +# include +#endif +#ifdef __APPLE__ +# include +# include +#else +# include +#endif +#include + +int main() +{ + printf("GL_GLEXT_VERSION: %d\n", GL_GLEXT_VERSION); + return EXIT_SUCCESS; +} diff --git a/recipes/glext/config.yml b/recipes/glext/config.yml new file mode 100644 index 0000000000000..f7fca403f982f --- /dev/null +++ b/recipes/glext/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210420": + folder: "all" diff --git a/recipes/glfw/all/conandata.yml b/recipes/glfw/all/conandata.yml new file mode 100644 index 0000000000000..43e8790efbe29 --- /dev/null +++ b/recipes/glfw/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "3.3.8": + url: "https://github.com/glfw/glfw/releases/download/3.3.8/glfw-3.3.8.zip" + sha256: "4d025083cc4a3dd1f91ab9b9ba4f5807193823e565a5bcf4be202669d9911ea6" + "3.3.7": + url: "https://github.com/glfw/glfw/releases/download/3.3.7/glfw-3.3.7.zip" + sha256: "4ef0c544a8ace9a6cd0e0aef8250090f89fea1bf96e9fc1d9d6f76386c290c9c" + "3.3.6": + url: "https://github.com/glfw/glfw/releases/download/3.3.6/glfw-3.3.6.zip" + sha256: "45537305d44c0a9f3612d4ec4a48414547cf854bff3ed613078f7ec648a12781" + "3.3.5": + url: "https://github.com/glfw/glfw/releases/download/3.3.5/glfw-3.3.5.zip" + sha256: "98a8639cfcd4f9ed2748cfa531c217e0364b64884b43e3336c62c58802eaa34f" + "3.3.4": + url: "https://github.com/glfw/glfw/releases/download/3.3.4/glfw-3.3.4.zip" + sha256: "bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd" + "3.3.3": + url: "https://github.com/glfw/glfw/releases/download/3.3.3/glfw-3.3.3.zip" + sha256: "723087ad45b40cd333be7d1a2cd5e09a28facb7f3acdb69f3e5613bd20543977" + "3.3.2": + url: "https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip" + sha256: "08a33a512f29d7dbf78eab39bd7858576adcc95228c9efe8e4bc5f0f3261efc7" +patches: + "3.3.2": + - patch_file: "patches/3.3.2-0001-fix-objc-cmake3.19+.patch" + patch_description: "Fix ObjC handling while using recent CMake versions" + patch_type: "portability" + patch_source: "https://github.com/glfw/glfw/commit/3327050ca66ad34426a82c217c2d60ced61526b7" + - patch_file: "patches/3.3.2-0002-macos-relocatable.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "portability" + patch_source: "https://github.com/glfw/glfw/commit/5a15d8a7842fbc4b5260eac2335a6691bca9be4b" diff --git a/recipes/glfw/all/conanfile.py b/recipes/glfw/all/conanfile.py new file mode 100644 index 0000000000000..f7a8579bcc74f --- /dev/null +++ b/recipes/glfw/all/conanfile.py @@ -0,0 +1,156 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class GlfwConan(ConanFile): + name = "glfw" + description = "GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan" \ + "application development. It provides a simple, platform-independent API for creating" \ + "windows, contexts and surfaces, reading input, handling events, etc." + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/glfw/glfw" + topics = ("graphics", "opengl", "vulkan", "opengl-es") + package_type = "library" + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + "vulkan_static": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "vulkan_static": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + if self.options.vulkan_static: + self.requires("vulkan-loader/1.3.239.0") + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GLFW_BUILD_EXAMPLES"] = False + tc.variables["GLFW_BUILD_TESTS"] = False + tc.variables["GLFW_BUILD_DOCS"] = False + tc.variables["GLFW_INSTALL"] = True + tc.variables["GLFW_VULKAN_STATIC"] = self.options.vulkan_static + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # don't force PIC + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "POSITION_INDEPENDENT_CODE ON", "") + # don't force static link to libgcc if MinGW + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "target_link_libraries(glfw PRIVATE \"-static-libgcc\")", "") + + # Allow to link vulkan-loader into shared glfw + if self.options.vulkan_static: + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file( + self, + cmakelists, + 'message(FATAL_ERROR "You are trying to link the Vulkan loader static library into the GLFW shared library")', + "", + ) + vulkan_lib = self.dependencies["vulkan-loader"].cpp_info.libs[0] + replace_in_file( + self, + cmakelists, + 'list(APPEND glfw_PKG_DEPS "vulkan")', + f'list(APPEND glfw_PKG_DEPS "vulkan")\nlist(APPEND glfw_LIBRARIES "{vulkan_lib}")', + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"glfw": "glfw::glfw"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "glfw3") + self.cpp_info.set_property("cmake_target_name", "glfw") + self.cpp_info.set_property("pkg_config_name", "glfw3") + libname = "glfw" + if self.settings.os == "Windows" or not self.options.shared: + libname += "3" + if self.settings.os == "Windows" and self.options.shared: + libname += "dll" + self.cpp_info.defines.append("GLFW_DLL") + self.cpp_info.libs = [libname] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl", "rt"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("gdi32") + elif self.settings.os == "Macos": + self.cpp_info.frameworks.extend([ + "AppKit", "Cocoa", "CoreFoundation", "CoreGraphics", + "CoreServices", "Foundation", "IOKit", + ]) + + # backward support of cmake_find_package, cmake_find_package_multi & pkg_config generators + self.cpp_info.filenames["cmake_find_package"] = "glfw3" + self.cpp_info.filenames["cmake_find_package_multi"] = "glfw3" + self.cpp_info.names["cmake_find_package"] = "glfw" + self.cpp_info.names["cmake_find_package_multi"] = "glfw" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "glfw3" diff --git a/recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch b/recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch new file mode 100644 index 0000000000000..54c1246a85ae3 --- /dev/null +++ b/recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch @@ -0,0 +1,11 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -72,7 +72,7 @@ if (_GLFW_X11 OR _GLFW_WAYLAND) + endif() + endif() + +-if (APPLE) ++if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE) + # For some reason CMake didn't know about .m until version 3.16 + set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m + cocoa_window.m nsgl_context.m PROPERTIES diff --git a/recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch b/recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch new file mode 100644 index 0000000000000..82f93cbaed918 --- /dev/null +++ b/recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch @@ -0,0 +1,11 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -160,8 +160,6 @@ if (BUILD_SHARED_LIBS) + # Add -fno-common to work around a bug in Apple's GCC + target_compile_options(glfw PRIVATE "-fno-common") + +- set_target_properties(glfw PROPERTIES +- INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}") + endif() + + if (UNIX) diff --git a/recipes/glfw/all/test_package/CMakeLists.txt b/recipes/glfw/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b6a8569c50ff8 --- /dev/null +++ b/recipes/glfw/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(glfw3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glfw) diff --git a/recipes/glfw/all/test_package/conanfile.py b/recipes/glfw/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/glfw/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/glfw/all/test_package/test_package.c b/recipes/glfw/all/test_package/test_package.c new file mode 100644 index 0000000000000..6b172dc99248d --- /dev/null +++ b/recipes/glfw/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include + +int main (void) +{ + GLFWwindow* window; + GLFWmonitor* monitor = NULL; + + monitor = glfwGetPrimaryMonitor(); + + window = glfwCreateWindow(640, 480, "Window name", monitor, NULL); + + glfwDestroyWindow(window); + glfwTerminate(); + + return 0; +} diff --git a/recipes/glfw/all/test_v1_package/CMakeLists.txt b/recipes/glfw/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glfw/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glfw/all/test_v1_package/conanfile.py b/recipes/glfw/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/glfw/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/glfw/config.yml b/recipes/glfw/config.yml new file mode 100644 index 0000000000000..a0746c2e38c76 --- /dev/null +++ b/recipes/glfw/config.yml @@ -0,0 +1,15 @@ +versions: + "3.3.8": + folder: all + "3.3.7": + folder: all + "3.3.6": + folder: all + "3.3.5": + folder: all + "3.3.4": + folder: all + "3.3.3": + folder: all + "3.3.2": + folder: all diff --git a/recipes/gli/all/conandata.yml b/recipes/gli/all/conandata.yml new file mode 100644 index 0000000000000..d6e11dbb4707a --- /dev/null +++ b/recipes/gli/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210515": + url: "https://github.com/g-truc/gli/archive/779b99ac6656e4d30c3b24e96e0136a59649a869.zip" + sha256: "38b3ee37404cb16b326025185a6480f6ca20c9228056e33bb4fcb37cd7d1aeb1" diff --git a/recipes/gli/all/conanfile.py b/recipes/gli/all/conanfile.py new file mode 100644 index 0000000000000..7eb260e9e7202 --- /dev/null +++ b/recipes/gli/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import copy, get, load, save +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.53.0" + + +class GliConan(ConanFile): + name = "gli" + description = "OpenGL Image (GLI)" + topics = ("opengl", "image") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/g-truc/gli" + license = "LicenseRef-copying.txt" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.7", + "clang": "3.4", + "apple-clang": "6", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glm/cci.20230113", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 180) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "copying.txt"), self._get_license()) + for headers in ("*.hpp", "*.inl", "*.h"): + copy(self, headers, src=os.path.join(self.source_folder, "gli"), + dst=os.path.join(self.package_folder, "include", "gli")) + + 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![](https://github.com/g-truc/glm/blob/manual/doc/manual/frontpage2.png)", begin) + return manual[begin:end] + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gli") + self.cpp_info.set_property("cmake_target_name", "gli::gli") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/gli/all/test_package/CMakeLists.txt b/recipes/gli/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f7789e29322d3 --- /dev/null +++ b/recipes/gli/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(gli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gli::gli) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gli/all/test_package/conanfile.py b/recipes/gli/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gli/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/gli/all/test_package/test_package.cpp b/recipes/gli/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..17d15a1d74af1 --- /dev/null +++ b/recipes/gli/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include "gli/gli.hpp" + +int main (int argc, char * argv[]) { + std::cout << GLI_VERSION << "\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/gli/all/test_v1_package/CMakeLists.txt b/recipes/gli/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gli/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gli/all/test_v1_package/conanfile.py b/recipes/gli/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gli/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/gli/config.yml b/recipes/gli/config.yml new file mode 100644 index 0000000000000..01c19117cfc2b --- /dev/null +++ b/recipes/gli/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210515": + folder: all diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml new file mode 100644 index 0000000000000..cad33c3742370 --- /dev/null +++ b/recipes/glib/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "2.76.2": + url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.2.tar.xz" + sha256: "24f3847857b1d8674cdb0389a36edec0f13c666cd3ce727ecd340eb9da8aca9e" + "2.76.1": + url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.1.tar.xz" + sha256: "43dc0f6a126958f5b454136c4398eab420249c16171a769784486e25f2fda19f" + "2.76.0": + url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.0.tar.xz" + sha256: "525bb703b807142e1aee5ccf222c344e8064b21c0c45677ef594e587874c6797" + "2.75.3": + url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.3.tar.xz" + sha256: "7c517d0aff456c35a039bce8a8df7a08ce95a8285b09d1849f8865f633f7f871" + "2.75.2": + url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.2.tar.xz" + sha256: "360d6fb75202c0eb0d07f0ab812b19b526f1c05ccc0a8ed7e5d2c988616d343a" + "2.75.1": + url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.1.tar.xz" + sha256: "96fd22355a542cca96c31082f2d09b72cb5a3454b6ea60c1be17c987a18a6b93" + "2.75.0": + url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.0.tar.xz" + sha256: "6dde8e55cc4a2c83d96797120b08bcffb5f645b2e212164ae22d63c40e0e6360" + "2.74.1": + url: "https://download.gnome.org/sources/glib/2.74/glib-2.74.1.tar.xz" + sha256: "0ab981618d1db47845e56417b0d7c123f81a3427b2b9c93f5a46ff5bbb964964" + "2.73.3": + url: "https://download.gnome.org/sources/glib/2.73/glib-2.73.3.tar.xz" + sha256: "df1a2b841667d6b48b2ef6969ebda4328243829f6e45866726f806f90f64eead" + "2.72.4": + url: "https://download.gnome.org/sources/glib/2.72/glib-2.72.4.tar.xz" + sha256: "8848aba518ba2f4217d144307a1d6cb9afcc92b54e5c13ac1f8c4d4608e96f0e" +patches: + "2.73.3": + - patch_file: "patches/0001-2.73.3-clang-static-assert.patch" + patch_type: bugfix + patch_description: fix for clang compilation + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py new file mode 100644 index 0000000000000..041447c27862e --- /dev/null +++ b/recipes/glib/all/conanfile.py @@ -0,0 +1,302 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +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 +import os +import shutil + + +required_conan_version = ">=1.53.0" + + +class GLibConan(ConanFile): + name = "glib" + description = ( + "Low-level core library that forms the basis for projects such as GTK+ and GNOME. " + "It provides data structure handling for C, portability wrappers, and interfaces " + "for such runtime functionality as an event loop, threads, dynamic loading, and an object system." + ) + topics = "gio", "gmodule", "gnome", "gobject", "gtk" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.gnome.org/GNOME/glib" + license = "LGPL-2.1-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_elf": [True, False], + "with_selinux": [True, False], + "with_mount": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "with_elf": True, + "with_mount": True, + "with_selinux": True, + } + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.with_mount + del self.options.with_selinux + if is_msvc(self): + del self.options.with_elf + + 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("zlib/1.2.13") + self.requires("libffi/3.4.4") + if Version(self.version) >= "2.73.2": + self.requires("pcre2/10.42") + else: + self.requires("pcre/8.45") + if self.options.get_safe("with_elf"): + self.requires("libelf/0.8.13") + if self.options.get_safe("with_mount"): + self.requires("libmount/2.36.2") + if self.options.get_safe("with_selinux"): + self.requires("libselinux/3.3") + if self.settings.os != "Linux": + # for Linux, gettext is provided by libc + self.requires("libgettext/0.21", transitive_headers=True, transitive_libs=True) + + if is_apple_os(self): + self.requires("libiconv/1.17") + + def build_requirements(self): + self.tool_requires("meson/1.1.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = MesonToolchain(self) + + if is_apple_os(self) and Version(self.version) < "2.75.1": + tc.project_options["iconv"] = "external" # https://gitlab.gnome.org/GNOME/glib/issues/1557 + tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" + tc.project_options["libmount"] = "enabled" if self.options.get_safe("with_mount") else "disabled" + if self.settings.os == "FreeBSD": + tc.project_options["xattr"] = "false" + tc.project_options["tests"] = "false" + tc.project_options["libelf"] = "enabled" if self.options.get_safe("with_elf") else "disabled" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), + "subdir('fuzzing')", + "#subdir('fuzzing')", + ) # https://gitlab.gnome.org/GNOME/glib/-/issues/2152 + if Version(self.version) < "2.73.2": + for filename in [ + os.path.join(self.source_folder, "meson.build"), + os.path.join(self.source_folder, "glib", "meson.build"), + os.path.join(self.source_folder, "gobject", "meson.build"), + os.path.join(self.source_folder, "gio", "meson.build"), + ]: + replace_in_file(self, filename, "subdir('tests')", "#subdir('tests')") + if self.settings.os != "Linux": + # allow to find gettext + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), + "libintl = cc.find_library('intl', required : false" if Version(self.version) < "2.73.1" \ + else "libintl = dependency('intl', required: false", + "libintl = dependency('libgettext', method : 'pkg-config', required : false", + ) + + replace_in_file(self, + os.path.join( + self.source_folder, + "gio", + "gdbus-2.0", + "codegen", + "gdbus-codegen.in", + ), + "'share'", + "'res'", + ) + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + if Version(self.version) < "2.73.0": + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + else: + copy(self, pattern="LGPL-2.1-or-later.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "libexec")) + shutil.move( + os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res"), + ) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.components["glib-2.0"].set_property("pkg_config_name", "glib-2.0") + self.cpp_info.components["glib-2.0"].libs = ["glib-2.0"] + self.cpp_info.components["glib-2.0"].includedirs += [ + os.path.join("include", "glib-2.0"), + os.path.join("lib", "glib-2.0", "include") + ] + self.cpp_info.components["glib-2.0"].resdirs = ["res"] + + self.cpp_info.components["gmodule-no-export-2.0"].set_property("pkg_config_name", "gmodule-no-export-2.0") + self.cpp_info.components["gmodule-no-export-2.0"].libs = ["gmodule-2.0"] + self.cpp_info.components["gmodule-no-export-2.0"].resdirs = ["res"] + self.cpp_info.components["gmodule-no-export-2.0"].requires.append("glib-2.0") + + self.cpp_info.components["gmodule-export-2.0"].set_property("pkg_config_name", "gmodule-export-2.0") + self.cpp_info.components["gmodule-export-2.0"].requires += ["gmodule-no-export-2.0", "glib-2.0"] + + self.cpp_info.components["gmodule-2.0"].set_property("pkg_config_name", "gmodule-2.0") + self.cpp_info.components["gmodule-2.0"].requires += ["gmodule-no-export-2.0", "glib-2.0"] + + self.cpp_info.components["gobject-2.0"].set_property("pkg_config_name", "gobject-2.0") + self.cpp_info.components["gobject-2.0"].libs = ["gobject-2.0"] + self.cpp_info.components["gobject-2.0"].resdirs = ["res"] + self.cpp_info.components["gobject-2.0"].requires += ["glib-2.0", "libffi::libffi"] + + self.cpp_info.components["gthread-2.0"].set_property("pkg_config_name", "gthread-2.0") + self.cpp_info.components["gthread-2.0"].libs = ["gthread-2.0"] + self.cpp_info.components["gthread-2.0"].resdirs = ["res"] + self.cpp_info.components["gthread-2.0"].requires.append("glib-2.0") + + self.cpp_info.components["gio-2.0"].set_property("pkg_config_name", "gio-2.0") + self.cpp_info.components["gio-2.0"].libs = ["gio-2.0"] + self.cpp_info.components["gio-2.0"].resdirs = ["res"] + self.cpp_info.components["gio-2.0"].requires += ["glib-2.0", "gobject-2.0", "gmodule-2.0", "zlib::zlib"] + + self.cpp_info.components["gresource"].set_property("pkg_config_name", "gresource") + self.cpp_info.components["gresource"].libs = [] # this is actually an executable + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["glib-2.0"].system_libs.append("pthread") + self.cpp_info.components["gmodule-no-export-2.0"].system_libs.append("pthread") + self.cpp_info.components["gmodule-no-export-2.0"].system_libs.append("dl") + self.cpp_info.components["gmodule-export-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["gmodule-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["gthread-2.0"].system_libs.append("pthread") + self.cpp_info.components["gio-2.0"].system_libs.append("dl") + + if self.settings.os == "Windows": + self.cpp_info.components["glib-2.0"].system_libs += ["ws2_32", "ole32", "shell32", "user32", "advapi32"] + self.cpp_info.components["gio-2.0"].system_libs.extend(["iphlpapi", "dnsapi", "shlwapi"]) + self.cpp_info.components["gio-windows-2.0"].set_property("pkg_config_name", "gio-windows-2.0") + self.cpp_info.components["gio-windows-2.0"].requires = ["gobject-2.0", "gmodule-no-export-2.0", "gio-2.0"] + self.cpp_info.components["gio-windows-2.0"].includedirs = [os.path.join("include", "gio-win32-2.0")] + else: + self.cpp_info.components["gio-unix-2.0"].set_property("pkg_config_name", "gio-unix-2.0") + self.cpp_info.components["gio-unix-2.0"].requires += ["gobject-2.0", "gio-2.0"] + self.cpp_info.components["gio-unix-2.0"].includedirs = [os.path.join("include", "gio-unix-2.0")] + + if self.settings.os == "Macos": + self.cpp_info.components["glib-2.0"].system_libs.append("resolv") + self.cpp_info.components["glib-2.0"].frameworks += ["Foundation", "CoreServices", "CoreFoundation"] + self.cpp_info.components["gio-2.0"].frameworks.append("AppKit") + + if is_apple_os(self): + self.cpp_info.components["glib-2.0"].requires.append("libiconv::libiconv") + + if Version(self.version) >= "2.73.2": + self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") + else: + self.cpp_info.components["glib-2.0"].requires.append("pcre::pcre") + + if self.settings.os == "Linux": + self.cpp_info.components["gio-2.0"].system_libs.append("resolv") + else: + self.cpp_info.components["glib-2.0"].requires.append("libgettext::libgettext") + + if self.options.get_safe("with_mount"): + self.cpp_info.components["gio-2.0"].requires.append("libmount::libmount") + + if self.options.get_safe("with_selinux"): + self.cpp_info.components["gio-2.0"].requires.append("libselinux::libselinux") + + if self.options.get_safe("with_elf"): + self.cpp_info.components["gresource"].requires.append("libelf::libelf") # this is actually an executable + + self.env_info.GLIB_COMPILE_SCHEMAS = os.path.join(self.package_folder, "bin", "glib-compile-schemas") + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + + pkgconfig_variables = { + 'datadir': '${prefix}/res', + 'schemasdir': '${datadir}/glib-2.0/schemas', + 'bindir': '${prefix}/bin', + # Can't use libdir here as it is libdir1 when using the PkgConfigDeps generator. + 'giomoduledir': '${prefix}/lib/gio/modules', + 'gio': '${bindir}/gio', + 'gio_querymodules': '${bindir}/gio-querymodules', + 'glib_compile_schemas': '${bindir}/glib-compile-schemas', + 'glib_compile_resources': '${bindir}/glib-compile-resources', + 'gdbus': '${bindir}/gdbus', + 'gdbus_codegen': '${bindir}/gdbus-codegen', + 'gresource': '${bindir}/gresource', + 'gsettings': '${bindir}/gsettings' + } + self.cpp_info.components["gio-2.0"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) + + pkgconfig_variables = { + 'bindir': '${prefix}/bin', + 'glib_genmarshal': '${bindir}/glib-genmarshal', + 'gobject_query': '${bindir}/gobject-query', + 'glib_mkenums': '${bindir}/glib-mkenums' + } + self.cpp_info.components["glib-2.0"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch b/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch new file mode 100644 index 0000000000000..c46f5e071d71c --- /dev/null +++ b/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch @@ -0,0 +1,33 @@ +diff --git a/gio/gio-launch-desktop.c b/gio/gio-launch-desktop.c +index 29bf9d5d4..47717b987 100644 +--- a/gio/gio-launch-desktop.c ++++ b/gio/gio-launch-desktop.c +@@ -39,7 +39,6 @@ + + #if defined(__linux__) && !defined(__BIONIC__) + #include +-#include + #include + #include + #include +@@ -48,6 +47,9 @@ + #include + + #include "gjournal-private.h" ++#define GLIB_COMPILATION ++#include "gmacros.h" /* For G_STATIC_ASSERT define */ ++#undef GLIB_COMPILATION + + /* + * write_all: +@@ -119,8 +121,8 @@ journal_stream_fd (const char *identifier, + /* Arbitrary large size for the sending buffer, from systemd */ + int large_buffer_size = 8 * 1024 * 1024; + +- static_assert (LOG_EMERG == 0, "Linux ABI defines LOG_EMERG"); +- static_assert (LOG_DEBUG == 7, "Linux ABI defines LOG_DEBUG"); ++ G_STATIC_ASSERT (LOG_EMERG == 0 && sizeof "Linux ABI defines LOG_EMERG"); ++ G_STATIC_ASSERT (LOG_DEBUG == 7 && sizeof "Linux ABI defines LOG_DEBUG"); + + fd = socket (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); + diff --git a/recipes/glib/all/test_package/CMakeLists.txt b/recipes/glib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..44f2423e0f831 --- /dev/null +++ b/recipes/glib/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package LANGUAGES C) + +add_executable(${PROJECT_NAME} test_package.c) + +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() diff --git a/recipes/glib/all/test_package/conanfile.py b/recipes/glib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..37f9bd528f982 --- /dev/null +++ b/recipes/glib/all/test_package/conanfile.py @@ -0,0 +1,50 @@ +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 VirtualBuildEnv, VirtualRunEnv +from conan.tools.gnu import PkgConfig, PkgConfigDeps +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + 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/1.9.3") + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + virtual_run_env = VirtualRunEnv(self) + virtual_run_env.generate() + 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() + + 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") + + 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") diff --git a/recipes/glib/all/test_package/test_package.c b/recipes/glib/all/test_package/test_package.c new file mode 100644 index 0000000000000..c75317a5f7f06 --- /dev/null +++ b/recipes/glib/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +#include "glib.h" +#include "gmodule.h" +#include "gio/gio.h" + + +int main() { + printf("glib %d.%d.%d\n", glib_major_version, glib_minor_version, glib_micro_version); + printf("glib interface age: %d\n", glib_interface_age); + printf("glib binary age: %d\n", glib_binary_age); + + GQueue *queue = g_queue_new(); + g_queue_free(queue); + + printf("glib module supported: %s\n", g_module_supported() ? "true" : "false"); + + GMutex m; + g_mutex_init(&m); + g_mutex_clear(&m); + + printf("type name for char: %s\n", g_type_name(G_TYPE_CHAR)); + + return EXIT_SUCCESS; +} diff --git a/recipes/glib/all/test_v1_package/CMakeLists.txt b/recipes/glib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glib/all/test_v1_package/conanfile.py b/recipes/glib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ed236807fcf7e --- /dev/null +++ b/recipes/glib/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, CMake, tools +import os + + +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.build_requires("pkgconf/1.9.3") + + 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() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml new file mode 100644 index 0000000000000..385fb40736e20 --- /dev/null +++ b/recipes/glib/config.yml @@ -0,0 +1,21 @@ +versions: + "2.76.2": + folder: all + "2.76.1": + folder: all + "2.76.0": + folder: all + "2.75.3": + folder: all + "2.75.2": + folder: all + "2.75.1": + folder: all + "2.75.0": + folder: all + "2.74.1": + folder: all + "2.73.3": + folder: all + "2.72.4": + folder: all diff --git a/recipes/glibmm/all/conandata.yml b/recipes/glibmm/all/conandata.yml new file mode 100644 index 0000000000000..171a01a50da60 --- /dev/null +++ b/recipes/glibmm/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "2.75.0": + url: "https://download.gnome.org/sources/glibmm/2.75/glibmm-2.75.0.tar.xz" + sha256: "60bb12e66488aa8ce41f0eb2f3612f89f5ddc887e3e4d45498524bf60b266b3d" + "2.72.1": + url: "https://download.gnome.org/sources/glibmm/2.72/glibmm-2.72.1.tar.xz" + sha256: "2a7649a28ab5dc53ac4dabb76c9f61599fbc628923ab6a7dd74bf675d9155cd8" + "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 new file mode 100644 index 0000000000000..df88638f61d35 --- /dev/null +++ b/recipes/glibmm/all/conanfile.py @@ -0,0 +1,195 @@ +import os +import glob +import shutil + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +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.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class GlibmmConan(ConanFile): + name = "glibmm" + homepage = "https://gitlab.gnome.org/GNOME/glibmm" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + description = "glibmm is a C++ API for parts of glib that are useful for C++." + topics = ("giomm",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + short_paths = True + + @property + def _abi_version(self): + return "2.68" if Version(self.version) >= "2.68.0" else "2.4" + + @property + def _glibmm_lib(self): + return f"glibmm-{self._abi_version}" + + @property + 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 + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.76.0") + if self._abi_version == "2.68": + self.requires("libsigcpp/3.0.7") + else: + self.requires("libsigcpp/2.10.8") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + if 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: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + + if self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + tc = MesonToolchain(self) + tc.project_options.update({ + "build-examples": "false", + "build-documentation": "false", + "msvc14x-parallel-installable": "false" + }) + 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 + # conformant! see: + # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 + replace_in_file(self, meson_build, "cpp_std=c++", "cpp_std=vc++") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + 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() + + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + + 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") + for header_file in glob.glob(directory_path): + shutil.move( + header_file, + os.path.join(self.package_folder, "include", directory, os.path.basename(header_file)), + ) + + for dir_to_remove in ["pkgconfig", self._glibmm_lib, self._giomm_lib]: + rmdir(self, os.path.join(self.package_folder, "lib", dir_to_remove)) + fix_apple_shared_install_name(self) + + def package_info(self): + glibmm_component = f"glibmm-{self._abi_version}" + self.cpp_info.components[glibmm_component].set_property("pkg_config_name", glibmm_component) + self.cpp_info.components[glibmm_component].libs = [glibmm_component] + self.cpp_info.components[glibmm_component].includedirs = [os.path.join("include", glibmm_component)] + self.cpp_info.components[glibmm_component].requires = ["glib::gobject-2.0", "libsigcpp::libsigcpp"] + + giomm_component = f"giomm-{self._abi_version}" + self.cpp_info.components[giomm_component].set_property("pkg_config_name", giomm_component) + self.cpp_info.components[giomm_component].libs = [giomm_component] + self.cpp_info.components[giomm_component].includedirs = [os.path.join("include", giomm_component)] + self.cpp_info.components[giomm_component].requires = [glibmm_component, "glib::gio-2.0"] 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 new file mode 100644 index 0000000000000..c94b5200949f7 --- /dev/null +++ b/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000000000..b9ec412d84d2e --- /dev/null +++ b/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000000000..f24c64bb5bd54 --- /dev/null +++ b/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000000000..3cf9f867ed1f0 --- /dev/null +++ b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch @@ -0,0 +1,163 @@ +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 new file mode 100644 index 0000000000000..e2f8e705abbe0 --- /dev/null +++ b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch @@ -0,0 +1,95 @@ +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 new file mode 100644 index 0000000000000..6a24ae04d3038 --- /dev/null +++ b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch @@ -0,0 +1,84 @@ +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/all/test_package/CMakeLists.txt b/recipes/glibmm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e57ebb60abaed --- /dev/null +++ b/recipes/glibmm/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package) + +find_package(glibmm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +if (TARGET glibmm::glibmm-2.68) + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + target_link_libraries(${PROJECT_NAME} PRIVATE glibmm::glibmm-2.68 glibmm::giomm-2.68) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + target_link_libraries(${PROJECT_NAME} PRIVATE glibmm::glibmm-2.4 glibmm::giomm-2.4) +endif() + diff --git a/recipes/glibmm/all/test_package/conanfile.py b/recipes/glibmm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..825105b610efd --- /dev/null +++ b/recipes/glibmm/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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/glibmm/all/test_package/test_package.cpp b/recipes/glibmm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6b7e7a7a9270c --- /dev/null +++ b/recipes/glibmm/all/test_package/test_package.cpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2004 The glibmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#include +#include +#include +#include + +int +main(int, char**) +{ + Glib::init(); + /* Reusing one regex pattern: */ + const auto regex = Glib::Regex::create("(a)?(b)"); + std::cout << "Pattern=" << regex->get_pattern() << ", with string=abcd, result=" << std::boolalpha + << regex->match("abcd") << std::endl; + std::cout << "Pattern=" << regex->get_pattern() << ", with string=1234, result=" << std::boolalpha + << regex->match("1234") << std::endl; + std::cout << std::endl; + + /* Using the static function without a regex instance: */ + std::cout << "Pattern=b* with string=abcd, result=" << std::boolalpha + << Glib::Regex::match_simple("b*", "abcd") << std::endl; + + Gio::init(); + try + { + auto directory = Gio::File::create_for_path("."); + if(!directory) + std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl; + + auto enumerator = directory->enumerate_children(); + if(!enumerator) + std::cerr << "Gio::File::enumerate_children() returned an empty RefPtr." << std::endl; + + auto file_info = enumerator->next_file(); + while(file_info) + { + std::cout << "file: " << file_info->get_name() << std::endl; + file_info = enumerator->next_file(); + } + + } + catch(const Glib::Error& ex) + { + std::cerr << "Exception caught: " << ex.what() << std::endl; + } + + return 0; +} diff --git a/recipes/glibmm/all/test_v1_package/CMakeLists.txt b/recipes/glibmm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/glibmm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/glibmm/all/test_v1_package/conanfile.py b/recipes/glibmm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/glibmm/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/glibmm/config.yml b/recipes/glibmm/config.yml new file mode 100644 index 0000000000000..6aaa4e9d859bb --- /dev/null +++ b/recipes/glibmm/config.yml @@ -0,0 +1,7 @@ +versions: + "2.75.0": + folder: "all" + "2.72.1": + folder: "all" + "2.66.4": + folder: "all" diff --git a/recipes/glm/all/conandata.yml b/recipes/glm/all/conandata.yml new file mode 100644 index 0000000000000..ea5c8f567b661 --- /dev/null +++ b/recipes/glm/all/conandata.yml @@ -0,0 +1,22 @@ +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" + "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 new file mode 100644 index 0000000000000..b86499dcc4c3d --- /dev/null +++ b/recipes/glm/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class GlmConan(ConanFile): + name = "glm" + description = "OpenGL Mathematics (GLM)" + topics = ("glm", "opengl", "mathematics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/g-truc/glm" + license = "MIT" + 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): + 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: + copy(self, "copying.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + for headers in ("*.hpp", "*.inl", "*.h"): + 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") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/glm/all/test_package/CMakeLists.txt b/recipes/glm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a15bbd78f6de4 --- /dev/null +++ b/recipes/glm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(glm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glm::glm) diff --git a/recipes/glm/all/test_package/conanfile.py b/recipes/glm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/glm/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/glm/all/test_package/test_package.cpp b/recipes/glm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a2fcaaf72ceeb --- /dev/null +++ b/recipes/glm/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include "glm/glm.hpp" + +int main (int argc, char * argv[]) { + glm::vec4 position = glm::vec4(glm::vec3(0.0), 1.0); + glm::mat4 model = glm::mat4(1.0); + model[3] = glm::vec4(1.0, 1.0, 0.0, 1.0); + glm::vec4 transformed = model * position; + + return EXIT_SUCCESS; +} diff --git a/recipes/glm/all/test_v1_package/CMakeLists.txt b/recipes/glm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glm/all/test_v1_package/conanfile.py b/recipes/glm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/glm/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/glm/config.yml b/recipes/glm/config.yml new file mode 100644 index 0000000000000..ee1899a79d2af --- /dev/null +++ b/recipes/glm/config.yml @@ -0,0 +1,15 @@ +versions: + "cci.20230113": + folder: all + "cci.20220420": + 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 new file mode 100644 index 0000000000000..280f568cd746b --- /dev/null +++ b/recipes/glog/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "0.6.0": + sha256: 8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6 + url: https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz + "0.5.0": + sha256: eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5 + url: https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz + "0.4.0": + sha256: f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c + url: https://github.com/google/glog/archive/v0.4.0.tar.gz +patches: + "0.5.0": + - patch_file: "patches/0001-fix-msvc-snprintf.patch" + patch_description: "Use stdio.h instead of cstdio.h for snprintf" + patch_type: "conan" diff --git a/recipes/glog/all/conanfile.py b/recipes/glog/all/conanfile.py new file mode 100644 index 0000000000000..f0db480178e58 --- /dev/null +++ b/recipes/glog/all/conanfile.py @@ -0,0 +1,131 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class GlogConan(ConanFile): + name = "glog" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/glog/" + description = "Google logging library" + topics = ("logging",) + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gflags": [True, False], + "with_threads": [True, False], + "with_unwind": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_gflags": True, + "with_threads": True, + "with_unwind": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"] or Version(self.version) < "0.5.0": + del self.options.with_unwind + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.with_gflags: + self.options["gflags"].shared = self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_gflags: + self.requires("gflags/2.2.2", transitive_headers=True, transitive_libs=True) + # 0.4.0 requires libunwind unconditionally + if self.options.get_safe("with_unwind") or (Version(self.version) < "0.5.0" and self.settings.os in ["Linux", "FreeBSD"]): + self.requires("libunwind/1.6.2") + + def build_requirements(self): + if Version(self.version) >= "0.6.0": + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + + tc = CMakeToolchain(self) + tc.variables["WITH_GFLAGS"] = self.options.with_gflags + tc.variables["WITH_THREADS"] = self.options.with_threads + if Version(self.version) >= "0.5.0": + tc.variables["WITH_PKGCONFIG"] = True + if self.settings.os == "Emscripten": + tc.variables["WITH_SYMBOLIZE"] = False + tc.variables["HAVE_SYSCALL_H"] = False + tc.variables["HAVE_SYS_SYSCALL_H"] = False + else: + tc.variables["WITH_SYMBOLIZE"] = True + tc.variables["WITH_UNWIND"] = self.options.get_safe("with_unwind", default=False) + tc.variables["BUILD_TESTING"] = False + tc.variables["WITH_GTEST"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # do not force PIC + if Version(self.version) <= "0.5.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)", + "") + # INFO: avoid "CONAN_LIB::gflags_gflags_nothreads_RELEASE" but the target was not found. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "determine_gflags_namespace", + "# determine_gflags_namespace") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "glog") + self.cpp_info.set_property("cmake_target_name", "glog::glog") + self.cpp_info.set_property("pkg_config_name", "libglog") + postfix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["glog" + postfix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["dbghelp"] + self.cpp_info.defines = ["GLOG_NO_ABBREVIATED_SEVERITIES"] + decl = "__declspec(dllimport)" if self.options.shared else "" + self.cpp_info.defines.append(f"GOOGLE_GLOG_DLL_DECL={decl}") + if self.options.with_gflags and not self.options.shared: + self.cpp_info.defines.extend(["GFLAGS_DLL_DECLARE_FLAG=", "GFLAGS_DLL_DEFINE_FLAG="]) diff --git a/recipes/glog/all/patches/0001-fix-msvc-snprintf.patch b/recipes/glog/all/patches/0001-fix-msvc-snprintf.patch new file mode 100644 index 0000000000000..c92d98cb82e67 --- /dev/null +++ b/recipes/glog/all/patches/0001-fix-msvc-snprintf.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -141,7 +141,7 @@ check_cxx_compiler_flag (-Wunnamed-type-template-args + + # NOTE: Cannot use check_function_exists here since >=vc-14.0 can define + # snprintf as an inline function +-check_symbol_exists (snprintf cstdio HAVE_SNPRINTF) ++check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF) + + check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP) + diff --git a/recipes/glog/all/test_package/CMakeLists.txt b/recipes/glog/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..28603535e29e9 --- /dev/null +++ b/recipes/glog/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(glog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glog::glog) diff --git a/recipes/glog/all/test_package/conanfile.py b/recipes/glog/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/glog/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glog/all/test_package/test_package.cpp b/recipes/glog/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..10542f4f6b21e --- /dev/null +++ b/recipes/glog/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char** argv) { + google::InitGoogleLogging(argv[0]); + LOG(INFO) << "It works"; + return 0; +} diff --git a/recipes/glog/all/test_v1_package/CMakeLists.txt b/recipes/glog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glog/all/test_v1_package/conanfile.py b/recipes/glog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/glog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glog/config.yml b/recipes/glog/config.yml new file mode 100644 index 0000000000000..babcbfb79d964 --- /dev/null +++ b/recipes/glog/config.yml @@ -0,0 +1,7 @@ +versions: + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/glpk/all/conandata.yml b/recipes/glpk/all/conandata.yml new file mode 100644 index 0000000000000..a355fe0344e5f --- /dev/null +++ b/recipes/glpk/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "5.0": + url: "https://ftp.gnu.org/gnu/glpk/glpk-5.0.tar.gz" + sha256: "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15" diff --git a/recipes/glpk/all/conanfile.py b/recipes/glpk/all/conanfile.py new file mode 100644 index 0000000000000..e03f104fe6d73 --- /dev/null +++ b/recipes/glpk/all/conanfile.py @@ -0,0 +1,150 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conan.tools.files import rename +from conan.tools.microsoft import is_msvc +from contextlib import contextmanager +import os + +required_conan_version = ">=1.45.0" + + +class GlpkConan(ConanFile): + name = "glpk" + description = "GNU Linear Programming Kit" + homepage = "https://www.gnu.org/software/glpk" + topics = ("linear", "programming", "simplex", "solver") + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, + destination=self._source_subfolder) + + @contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + env = { + "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "LD": "{} link -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), + } + with tools.environment_append(env): + yield + else: + yield + + def _patch_source(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows, run_environment=True) + tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), + r"-install_name \$rpath/", + "-install_name @rpath/") + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + + self._autotools.libs = [] + yes_no = lambda v: "yes" if v else "no" + args = [ + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-static={}".format(yes_no(not self.options.shared)), + "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))) + ] + + if is_msvc(self): + self._autotools.defines.append("__WOE__") + if self.settings.compiler == "Visual Studio" and \ + tools.Version(self.settings.compiler.version) >= "12": + self._autotools.flags.append("-FS") + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + #self._patch_source() + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + if is_msvc(self) and self.options.shared: + pjoin = lambda p: os.path.join(self.package_folder, "lib", p) + rename(self, pjoin("glpk.dll.lib"), pjoin("glpk.lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "glpk") + self.cpp_info.set_property("cmake_target_name", "glpk::glpk") + self.cpp_info.set_property("pkg_config_name", "glpk") + + self.cpp_info.components["libglpk"].set_property("cmake_target_name", "glpk::glpk") + self.cpp_info.components["libglpk"].libs = ["glpk"] + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["libglpk"].system_libs = ["m"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment var: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "glpk" + self.cpp_info.names["cmake_find_package_multi"] = "glpk" + self.cpp_info.components["libglpk"].names["cmake_find_package"] = "glpk" + self.cpp_info.components["libglpk"].names["cmake_find_package_multi"] = "glpk" + + diff --git a/recipes/glpk/all/test_package/CMakeLists.txt b/recipes/glpk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3258d5f78ee30 --- /dev/null +++ b/recipes/glpk/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(glpk CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glpk::glpk) diff --git a/recipes/glpk/all/test_package/conanfile.py b/recipes/glpk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..66177d47bc143 --- /dev/null +++ b/recipes/glpk/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +import os +from conans import ConanFile, CMake, tools + + +class GlpkTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + #def build_requirements(self): + # if self.settings.os == "Macos" and self.settings.arch == "armv8": + # # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # # set. This could be because you are using a Mac OS X version less than 10.5 + # # or because CMake's platform configuration is corrupt. + # self.build_requires("cmake/3.20.1") + + def 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/glpk/all/test_package/test_package.c b/recipes/glpk/all/test_package/test_package.c new file mode 100644 index 0000000000000..965bd82a292c4 --- /dev/null +++ b/recipes/glpk/all/test_package/test_package.c @@ -0,0 +1,54 @@ +/** + * The example program from the GLPK documentation + * Can be found in examples/sample.c + */ + +#include +#include +#include + +int main(void) +{ glp_prob *lp; + int ia[1+1000], ja[1+1000]; + double ar[1+1000], z, x1, x2, x3; +s1: lp = glp_create_prob(); +s2: glp_set_prob_name(lp, "sample"); +s3: glp_set_obj_dir(lp, GLP_MAX); +s4: glp_add_rows(lp, 3); +s5: glp_set_row_name(lp, 1, "p"); +s6: glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); +s7: glp_set_row_name(lp, 2, "q"); +s8: glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); +s9: glp_set_row_name(lp, 3, "r"); +s10: glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); +s11: glp_add_cols(lp, 3); +s12: glp_set_col_name(lp, 1, "x1"); +s13: glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); +s14: glp_set_obj_coef(lp, 1, 10.0); +s15: glp_set_col_name(lp, 2, "x2"); +s16: glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); +s17: glp_set_obj_coef(lp, 2, 6.0); +s18: glp_set_col_name(lp, 3, "x3"); +s19: glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); +s20: glp_set_obj_coef(lp, 3, 4.0); +s21: ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ +s22: ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ +s23: ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ +s24: ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ +s25: ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ +s26: ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ +s27: ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ +s28: ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ +s29: ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ +s30: glp_load_matrix(lp, 9, ia, ja, ar); +s31: glp_simplex(lp, NULL); +s32: z = glp_get_obj_val(lp); +s33: x1 = glp_get_col_prim(lp, 1); +s34: x2 = glp_get_col_prim(lp, 2); +s35: x3 = glp_get_col_prim(lp, 3); +s36: printf("\nz = %g; x1 = %g; x2 = %g; x3 = %g\n", + z, x1, x2, x3); +s37: glp_delete_prob(lp); + return 0; +} + diff --git a/recipes/glpk/config.yml b/recipes/glpk/config.yml new file mode 100644 index 0000000000000..d27c85493de54 --- /dev/null +++ b/recipes/glpk/config.yml @@ -0,0 +1,3 @@ +versions: + "5.0": + folder: all diff --git a/recipes/glshaderpp/all/conandata.yml b/recipes/glshaderpp/all/conandata.yml new file mode 100644 index 0000000000000..44a4436634860 --- /dev/null +++ b/recipes/glshaderpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp/-/package_files/7/download" + sha256: "0be41a89185e173255f82e9b149ab6562019b0da793bd1af1c44594fa8347da1" diff --git a/recipes/glshaderpp/all/conanfile.py b/recipes/glshaderpp/all/conanfile.py new file mode 100644 index 0000000000000..5f5d7e6cc487c --- /dev/null +++ b/recipes/glshaderpp/all/conanfile.py @@ -0,0 +1,55 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class GLShaderPPConan(ConanFile): + name = "glshaderpp" + homepage = "https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp" + description = "A lightweight header-only library to compile and link OpenGL GLSL shaders." + topics = ("opengl", "glsl", "shader", "header-only") + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + license = "LGPL-3.0-or-later" + settings = "compiler", "os", "arch", "build_type" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "17", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + 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(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") + else: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("*", src=os.path.join(self._source_subfolder, "include"), dst="include") + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "GLShaderPP")) diff --git a/recipes/glshaderpp/all/test_package/CMakeLists.txt b/recipes/glshaderpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7f0e01ff5256f --- /dev/null +++ b/recipes/glshaderpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(glew CONFIG REQUIRED) +find_package(glshaderpp CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} glshaderpp::glshaderpp GLEW::GLEW) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/glshaderpp/all/test_package/conanfile.py b/recipes/glshaderpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b5aad28ecae40 --- /dev/null +++ b/recipes/glshaderpp/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires("glew/2.2.0") + + 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", "PackageTest") + self.run(bin_path, run_environment=True) diff --git a/recipes/glshaderpp/all/test_package/example.cpp b/recipes/glshaderpp/all/test_package/example.cpp new file mode 100644 index 0000000000000..eb8a668f50e89 --- /dev/null +++ b/recipes/glshaderpp/all/test_package/example.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include +#include + +int main() { + GLShaderPP::CShaderException e("If you read this, GLShaderPP is happy :)", GLShaderPP::CShaderException::ExceptionType::LinkError); + std::cout << e.what() << '\n'; + return EXIT_SUCCESS; +} diff --git a/recipes/glshaderpp/config.yml b/recipes/glshaderpp/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/glshaderpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/glslang/all/CMakeLists.txt b/recipes/glslang/all/CMakeLists.txt new file mode 100644 index 0000000000000..17ed662273267 --- /dev/null +++ b/recipes/glslang/all/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +# TODO: +# - It should be find_package(SPIRV-Tools-opt REQUIRED CONFIG), but it can't be +# modeled yet in spirv-tools recipe. +# - Upstream CMakeLists is not very neat, and doesn't always link +# Spirv-Tools-opt in all required targets. Keep in mind that it works thanks +# to global injection of include dirs/interface definitions from +# conan_basic_setup(). It won't work without patches when moving to +# CMakeToolchain + CMakeDeps. +if(ENABLE_OPT) + find_package(SPIRV-Tools REQUIRED CONFIG) +endif() + +add_subdirectory(src) diff --git a/recipes/glslang/all/conandata.yml b/recipes/glslang/all/conandata.yml new file mode 100644 index 0000000000000..c41da7c94f094 --- /dev/null +++ b/recipes/glslang/all/conandata.yml @@ -0,0 +1,55 @@ +sources: + "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" diff --git a/recipes/glslang/all/conanfile.py b/recipes/glslang/all/conanfile.py new file mode 100644 index 0000000000000..7d393607fb969 --- /dev/null +++ b/recipes/glslang/all/conanfile.py @@ -0,0 +1,261 @@ +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, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +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"] + topics = ("glsl", "hlsl", "spirv", "spir-v", "validation", "translation") + homepage = "https://github.com/KhronosGroup/glslang" + 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], + "build_executables": [True, False], + "spv_remapper": [True, False], + "hlsl": [True, False], + "enable_optimizer": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executables": True, + "spv_remapper": True, + "hlsl": True, + "enable_optimizer": True, + } + + short_paths = True + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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}") + + 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.enable_optimizer and self.dependencies["spirv-tools"].options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} with enable_optimizer requires static spirv-tools, " + "because SPIRV-Tools-opt is not built if shared" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + 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_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_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.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"]), + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + 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 + + 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 + + # 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: + 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"]) + if has_machineindependent: + self.cpp_info.components["glslang-core"].requires.append("machineindependent") + if has_genericcodegen: + self.cpp_info.components["glslang-core"].requires.append("genericcodegen") + if has_osdependent: + self.cpp_info.components["glslang-core"].requires.append("osdependent") + if has_oglcompiler: + self.cpp_info.components["glslang-core"].requires.append("oglcompiler") + if self.options.hlsl: + self.cpp_info.components["glslang-core"].defines.append("ENABLE_HLSL") + self.cpp_info.components["glslang-core"].requires.append("hlsl") + + if has_machineindependent: + # MachineIndependent + self.cpp_info.components["machineindependent"].set_property("cmake_target_name", "glslang::MachineIndependent") + self.cpp_info.components["machineindependent"].names["cmake_find_package"] = "MachineIndependent" + self.cpp_info.components["machineindependent"].names["cmake_find_package_multi"] = "MachineIndependent" + self.cpp_info.components["machineindependent"].libs = [f"MachineIndependent{lib_suffix}"] + if has_genericcodegen: + self.cpp_info.components["machineindependent"].requires.append("genericcodegen") + if has_osdependent: + self.cpp_info.components["machineindependent"].requires.append("osdependent") + if has_oglcompiler: + self.cpp_info.components["machineindependent"].requires.append("oglcompiler") + + if has_genericcodegen: + # GenericCodeGen + self.cpp_info.components["genericcodegen"].set_property("cmake_target_name", "glslang::GenericCodeGen") + self.cpp_info.components["genericcodegen"].names["cmake_find_package"] = "GenericCodeGen" + self.cpp_info.components["genericcodegen"].names["cmake_find_package_multi"] = "GenericCodeGen" + self.cpp_info.components["genericcodegen"].libs = [f"GenericCodeGen{lib_suffix}"] + + if has_osdependent: + # OSDependent + self.cpp_info.components["osdependent"].set_property("cmake_target_name", "glslang::OSDependent") + self.cpp_info.components["osdependent"].names["cmake_find_package"] = "OSDependent" + self.cpp_info.components["osdependent"].names["cmake_find_package_multi"] = "OSDependent" + self.cpp_info.components["osdependent"].libs = [f"OSDependent{lib_suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["osdependent"].system_libs.append("pthread") + + if has_oglcompiler: + # OGLCompiler + self.cpp_info.components["oglcompiler"].set_property("cmake_target_name", "glslang::OGLCompiler") + self.cpp_info.components["oglcompiler"].names["cmake_find_package"] = "OGLCompiler" + self.cpp_info.components["oglcompiler"].names["cmake_find_package_multi"] = "OGLCompiler" + self.cpp_info.components["oglcompiler"].libs = [f"OGLCompiler{lib_suffix}"] + + # SPIRV + self.cpp_info.components["spirv"].set_property("cmake_target_name", "glslang::SPIRV") + self.cpp_info.components["spirv"].names["cmake_find_package"] = "SPIRV" + self.cpp_info.components["spirv"].names["cmake_find_package_multi"] = "SPIRV" + self.cpp_info.components["spirv"].libs = [f"SPIRV{lib_suffix}"] + self.cpp_info.components["spirv"].requires = ["glslang-core"] + if self.options.enable_optimizer: + self.cpp_info.components["spirv"].requires.append("spirv-tools::spirv-tools-opt") + self.cpp_info.components["spirv"].defines.append("ENABLE_OPT") + + # HLSL + if self.options.hlsl: + self.cpp_info.components["hlsl"].set_property("cmake_target_name", "glslang::HLSL") + self.cpp_info.components["hlsl"].names["cmake_find_package"] = "HLSL" + self.cpp_info.components["hlsl"].names["cmake_find_package_multi"] = "HLSL" + self.cpp_info.components["hlsl"].libs = [f"HLSL{lib_suffix}"] + + # SPVRemapper + if self.options.spv_remapper: + self.cpp_info.components["spvremapper"].set_property("cmake_target_name", "glslang::SPVRemapper") + self.cpp_info.components["spvremapper"].names["cmake_find_package"] = "SPVRemapper" + self.cpp_info.components["spvremapper"].names["cmake_find_package_multi"] = "SPVRemapper" + self.cpp_info.components["spvremapper"].libs = [f"SPVRemapper{lib_suffix}"] + + if self.options.build_executables: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch b/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch new file mode 100644 index 0000000000000..00e2266d3a9ae --- /dev/null +++ b/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch @@ -0,0 +1,10 @@ +--- 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 new file mode 100644 index 0000000000000..10a3ace245afd --- /dev/null +++ b/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch @@ -0,0 +1,10 @@ +--- 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/all/test_package/CMakeLists.txt b/recipes/glslang/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..02d778d679219 --- /dev/null +++ b/recipes/glslang/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(glslang REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glslang::glslang) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/glslang/all/test_package/conanfile.py b/recipes/glslang/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ee5a5cfcdd781 --- /dev/null +++ b/recipes/glslang/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + shader_name = os.path.join(self.source_folder, "test_package.vert") + self.run(f"glslangValidator \"{shader_name}\"", env="conanrun") diff --git a/recipes/glslang/all/test_package/test_package.cpp b/recipes/glslang/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1d4ef3e9d0757 --- /dev/null +++ b/recipes/glslang/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + glslang::InitializeProcess(); + glslang::FinalizeProcess(); + + return 0; +} diff --git a/recipes/glslang/all/test_package/test_package.vert b/recipes/glslang/all/test_package/test_package.vert new file mode 100644 index 0000000000000..8f349eebab57e --- /dev/null +++ b/recipes/glslang/all/test_package/test_package.vert @@ -0,0 +1,8 @@ +#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/glslang/all/test_v1_package/CMakeLists.txt b/recipes/glslang/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glslang/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glslang/all/test_v1_package/conanfile.py b/recipes/glslang/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d939929a7a456 --- /dev/null +++ b/recipes/glslang/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + shader_name = os.path.join(self.source_folder, os.pardir, "test_package", "test_package.vert") + self.run(f"glslangValidator \"{shader_name}\"", run_environment=True) diff --git a/recipes/glslang/config.yml b/recipes/glslang/config.yml new file mode 100644 index 0000000000000..99298a61152e6 --- /dev/null +++ b/recipes/glslang/config.yml @@ -0,0 +1,23 @@ +versions: + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.224.0": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all + "1.3.204.0": + folder: all + "11.7.0": + folder: all + "11.6.0": + folder: all + "11.5.0": + folder: all + "8.13.3559": + folder: all diff --git a/recipes/glu/all/conanfile.py b/recipes/glu/all/conanfile.py new file mode 100644 index 0000000000000..77dcc692f82dd --- /dev/null +++ b/recipes/glu/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager + +required_conan_version = ">=1.51.3" + + +class SysConfigGLUConan(ConanFile): + name = "glu" + version = "system" + description = "cross-platform virtual conan package for the GLU support" + topics = ("opengl", "glu") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cgit.freedesktop.org/mesa/glu/" + license = "SGI-B-2.0" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def requirements(self): + # - glu headers include opengl headers + # - on Apple OS, glu is part of OpenGL framework, already managed by opengl recipe + self.requires("opengl/system", transitive_headers=True, transitive_libs=is_apple_os(self)) + + def package_id(self): + self.info.clear() + + def system_requirements(self): + dnf = package_manager.Dnf(self) + dnf.install(["mesa-libGLU-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libGLU-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libglu1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["glu"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["glu-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libGLU"], update=True, check=True) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["glu32"] + elif self.settings.os in ["Linux", "FreeBSD"]: + pkg_config = PkgConfig(self, 'glu') + pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") diff --git a/recipes/glu/all/test_package/CMakeLists.txt b/recipes/glu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..56f2fb9c24114 --- /dev/null +++ b/recipes/glu/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(glu REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glu::glu) diff --git a/recipes/glu/all/test_package/conanfile.py b/recipes/glu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/glu/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/glu/all/test_package/test_package.c b/recipes/glu/all/test_package/test_package.c new file mode 100644 index 0000000000000..27c553570eadf --- /dev/null +++ b/recipes/glu/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include + +#ifdef __APPLE__ +# include +#else +# ifdef _WIN32 +# include +# endif +# include +#endif + +int main() +{ + printf("GLU %s\n", gluGetString(GLU_VERSION)); + + return 0; +} diff --git a/recipes/glu/all/test_v1_package/CMakeLists.txt b/recipes/glu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/glu/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glu/all/test_v1_package/conanfile.py b/recipes/glu/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/glu/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glu/config.yml b/recipes/glu/config.yml new file mode 100644 index 0000000000000..0594dfd676099 --- /dev/null +++ b/recipes/glu/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: all diff --git a/recipes/gm2calc/all/CMakeLists.txt b/recipes/gm2calc/all/CMakeLists.txt new file mode 100644 index 0000000000000..023f135034eed --- /dev/null +++ b/recipes/gm2calc/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(MSVC AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory("source_subfolder") diff --git a/recipes/gm2calc/all/conandata.yml b/recipes/gm2calc/all/conandata.yml new file mode 100644 index 0000000000000..5246438fdf67a --- /dev/null +++ b/recipes/gm2calc/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.7.5": + url: "https://github.com/GM2Calc/GM2Calc/archive/v1.7.5.tar.gz" + sha256: "5b44b3d51c763238a1f53845c10559c0a8c9a88e524377d698d2c2306b117a7f" + "2.0.0": + url: "https://github.com/GM2Calc/GM2Calc/archive/v2.0.0.tar.gz" + sha256: "1e5fcdc2fc170d1dade7080504ff622c55bdd4167b5c4d1b09f616b403910de5" + "2.1.0": + url: "https://github.com/GM2Calc/GM2Calc/archive/v2.1.0.tar.gz" + sha256: "33fd0d6da089e25ae0a6ac81b70e9bc9152952e7be4383f4c0baa862af7921bb" +patches: + "1.7.5": + - patch_file: "patches/0001-update-1.7.5-to-FindMathematica-3.6.0.patch" + base_path: "source_subfolder" diff --git a/recipes/gm2calc/all/conanfile.py b/recipes/gm2calc/all/conanfile.py new file mode 100644 index 0000000000000..5332dc62195c9 --- /dev/null +++ b/recipes/gm2calc/all/conanfile.py @@ -0,0 +1,74 @@ +import os +import conan +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.30.0" + + +class Gm2calcConan(ConanFile): + name = "gm2calc" + license = "GPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/GM2Calc/GM2Calc" + description = "C++ library to calculate the anomalous magnetic moment of the muon in the MSSM and 2HDM" + topics = ("high-energy", "physics", "hep", "magnetic moment", "muon", "mssm", "2hdm") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("boost/1.75.0") + self.requires("eigen/3.3.9") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + conan.tools.files.rename(self, "GM2Calc-{}".format(self.version), self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "GM2Calc" + self.cpp_info.names["cmake_find_package_multi"] = "GM2Calc" + self.cpp_info.names["pkg_config"] = "gm2calc" + self.cpp_info.libs = ["gm2calc"] + self.cpp_info.requires = ["boost::headers", "eigen::eigen"] diff --git a/recipes/gm2calc/all/patches/0001-update-1.7.5-to-FindMathematica-3.6.0.patch b/recipes/gm2calc/all/patches/0001-update-1.7.5-to-FindMathematica-3.6.0.patch new file mode 100644 index 0000000000000..4236e508a89c2 --- /dev/null +++ b/recipes/gm2calc/all/patches/0001-update-1.7.5-to-FindMathematica-3.6.0.patch @@ -0,0 +1,285 @@ +diff --git a/cmake/Mathematica/FindMathematica.cmake b/cmake/Mathematica/FindMathematica.cmake +index 6e721a0..8ae7595 100644 +--- a/cmake/Mathematica/FindMathematica.cmake ++++ b/cmake/Mathematica/FindMathematica.cmake +@@ -3,7 +3,7 @@ + # See the FindMathematica manual for usage hints. + # + #============================================================================= +-# Copyright 2010-2020 Sascha Kratky ++# Copyright 2010-2021 Sascha Kratky + # + # Permission is hereby granted, free of charge, to any person) + # obtaining a copy of this software and associated documentation) +@@ -34,7 +34,7 @@ cmake_minimum_required(VERSION 2.8.12) + cmake_policy(POP) + + set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}") +-set (Mathematica_CMAKE_MODULE_VERSION "3.3.0") ++set (Mathematica_CMAKE_MODULE_VERSION "3.6.0") + + # activate select policies + if (POLICY CMP0025) +@@ -242,10 +242,14 @@ endmacro() + macro (_get_program_names _outProgramNames) + set (${_outProgramNames} "") + # Mathematica products in order of preference +- set (_MathematicaApps "Mathematica" "Wolfram Desktop" "Wolfram Engine" "gridMathematica Server") ++ set (_MathematicaApps ++ "Mathematica" "mathematica" ++ "Wolfram Desktop" "Wolfram Engine" ++ "gridMathematica Server") + # Mathematica product versions in order of preference + set (_MathematicaVersions +- "12.1" "12.0" ++ "13.0" ++ "12.3" "12.2" "12.1" "12.0" + "11.3" "11.2" "11.1" "11.0" + "10.4" "10.3" "10.2" "10.1" "10.0" + "9.0" "8.0" "7.0" "6.0" "5.2") +@@ -348,8 +352,10 @@ function (_add_launch_services_search_paths _outSearchPaths) + # the executable usually resides in the LaunchServices framework Support directory + # The LaunchServices framework is a sub-framework of the CoreServices umbrella framework + cmake_find_frameworks(CoreServices) +- find_program (Mathematica_LSRegister_EXECUTABLE NAMES "lsregister" PATH_SUFFIXES "Support" +- HINTS "${CoreServices_FRAMEWORKS}/Frameworks/LaunchServices.framework") ++ find_program (Mathematica_LSRegister_EXECUTABLE ++ NAMES "lsregister" ++ PATH_SUFFIXES "/Frameworks/LaunchServices.framework/Support" ++ HINTS ${CoreServices_FRAMEWORKS}) + mark_as_advanced( + Mathematica_CoreServices_DIR + Mathematica_LaunchServices_DIR +@@ -361,7 +367,7 @@ function (_add_launch_services_search_paths _outSearchPaths) + foreach (_bundleID IN ITEMS ${ARGN}) + execute_process( + COMMAND "${Mathematica_LSRegister_EXECUTABLE}" "-dump" +- COMMAND "grep" "--before-context=20" "--after-context=20" " ${_bundleID} " ++ COMMAND "grep" "--before-context=20" "--after-context=20" "${_bundleID}" + COMMAND "grep" "--only-matching" "/.*\\.app" + TIMEOUT 10 OUTPUT_VARIABLE _queryResult ERROR_QUIET) + string (REPLACE ";" "\\;" _queryResult "${_queryResult}") +@@ -461,6 +467,14 @@ macro (_get_search_paths _outSearchPaths) + list (APPEND ${_outSearchPaths} "${_unixPath}/Wolfram Research" ) + endif() + endforeach() ++ # add default installation path ++ if (IS_DIRECTORY "C:/Program Files/Wolfram Research") ++ list (APPEND ${_outSearchPaths} "C:/Program Files/Wolfram Research" ) ++ endif() ++ # Windows container paths may be lowercase ++ if (IS_DIRECTORY "C:/Program Files/wolfram research") ++ list (APPEND ${_outSearchPaths} "C:/Program Files/wolfram research" ) ++ endif() + elseif (CMAKE_HOST_APPLE) + # add standard Mathematica Mac OS X installation paths + list (APPEND ${_outSearchPaths} "~/Applications;/Applications") +@@ -500,6 +514,8 @@ macro (_systemNameToSystemID _systemName _systemProcessor _outSystemIDs) + set (${_outSystemIDs} "MacOSX-x86") + elseif ("${_systemProcessor}" STREQUAL "x86_64") + set (${_outSystemIDs} "MacOSX-x86-64") ++ elseif ("${_systemProcessor}" STREQUAL "arm64") ++ set (${_outSystemIDs} "MacOSX-ARM64") + elseif ("${_systemProcessor}" MATCHES "ppc64|powerpc64") + set (${_outSystemIDs} "Darwin-PowerPC64") + elseif ("${_systemProcessor}" MATCHES "ppc|powerpc") +@@ -648,7 +664,12 @@ macro (_get_host_system_IDs _outSystemIDs) + endmacro() + + macro (_get_supported_systemIDs _version _outSystemIDs) +- if (NOT "${_version}" VERSION_LESS "12.1") ++ if (NOT "${_version}" VERSION_LESS "12.3") ++ set (${_outSystemIDs} ++ "Windows-x86-64" ++ "Linux-x86-64" "Linux-ARM" ++ "MacOSX-x86-64" "MacOSX-ARM64") ++ elseif (NOT "${_version}" VERSION_LESS "12.1") + set (${_outSystemIDs} + "Windows-x86-64" + "Linux-x86-64" "Linux-ARM" +@@ -741,6 +762,19 @@ macro (_get_compatible_system_IDs _systemID _outSystemIDs) + else() + list (APPEND ${_outSystemIDs} "MacOSX-x86-64" "MacOSX-x86") + endif() ++ elseif ("${_systemID}" MATCHES "MacOSX-ARM64") ++ if (Mathematica_VERSION) ++ # Mathematica 12.3 added support for MacOSX-ARM64 ++ if (NOT "${Mathematica_VERSION}" VERSION_LESS "12.3") ++ list (APPEND ${_outSystemIDs} "MacOSX-ARM64") ++ endif() ++ # Mathematica 6 added support for MacOSX-x86-64 ++ if (NOT "${Mathematica_VERSION}" VERSION_LESS "6.0") ++ list (APPEND ${_outSystemIDs} "MacOSX-x86-64") ++ endif() ++ else() ++ list (APPEND ${_outSystemIDs} "MacOSX-ARM64" "MacOSX-x86-64") ++ endif() + elseif ("${_systemID}" STREQUAL "Darwin-PowerPC64") + if (Mathematica_VERSION) + if (NOT "${Mathematica_VERSION}" VERSION_LESS "5.2" AND +@@ -801,7 +835,7 @@ macro(_get_developer_kit_system_IDs _outSystemIDs) + set (${_outSystemIDs} "") + else() + # Mathematica versions after 9 have a system ID subdirectory +- set (${_outSystemIDs} "MacOSX-x86-64") ++ set (${_outSystemIDs} "MacOSX-x86-64" "MacOSX-ARM64") + endif() + else() + _get_system_IDs(${_outSystemIDs}) +@@ -819,8 +853,8 @@ macro(_get_host_developer_kit_system_IDs _outSystemIDs) + if ("${Mathematica_VERSION}" VERSION_LESS "9.0") + set (${_outSystemIDs} "") + else() +- # The MacOSX-x86-64 DeveloperKit is a universal binary with architectures i386 and x86_64 +- set (${_outSystemIDs} "MacOSX-x86-64") ++ # Mathematica versions after 9 have a system ID subdirectory ++ set (${_outSystemIDs} "MacOSX-x86-64" "MacOSX-ARM64") + endif() + else() + _get_host_system_IDs(${_outSystemIDs}) +@@ -1175,7 +1209,10 @@ macro (_append_WSTP_needed_system_libraries _outLibraries) + if (DEFINED Mathematica_WSTP_VERSION_MINOR) + if ("${Mathematica_WSTP_VERSION_MINOR}" GREATER 24) + # Linux WSTP API revision >= 25 has dependency on libdl and libuuid +- list (APPEND ${_outLibraries} dl uuid) ++ list (APPEND ${_outLibraries} ${CMAKE_DL_LIBS}) ++ find_library (Mathematica_uuid_LIBRARY uuid) ++ mark_as_advanced(Mathematica_uuid_LIBRARY) ++ list (APPEND ${_outLibraries} ${Mathematica_uuid_LIBRARY}) + endif() + endif() + endif() +@@ -1262,7 +1299,7 @@ macro (_setup_mathematica_systemIDs) + _get_system_IDs(Mathematica_SYSTEM_IDS) + # default target platform system ID is first one in Mathematica_SYSTEM_IDS + list(GET Mathematica_SYSTEM_IDS 0 Mathematica_SYSTEM_ID) +- if (COMMAND Mathematica_EXECUTE) ++ if (Mathematica_RUN_KERNEL_ON_CONFIGURE AND COMMAND Mathematica_EXECUTE) + # determine true host system ID which depends on both Mathematica version + # and OS variant by running Mathematica kernel + Mathematica_EXECUTE( +@@ -1315,7 +1352,7 @@ endmacro() + + # internal macro to set up Mathematica base directory variable + macro (_setup_mathematica_base_directory) +- if (COMMAND Mathematica_EXECUTE) ++ if (Mathematica_RUN_KERNEL_ON_CONFIGURE AND COMMAND Mathematica_EXECUTE) + # determine true $BaseDirectory + Mathematica_EXECUTE( + CODE "Print[StandardForm[$BaseDirectory]]" +@@ -1367,7 +1404,7 @@ endmacro() + + # internal macro to set up Mathematica user base directory variable + macro (_setup_mathematica_userbase_directory) +- if (COMMAND Mathematica_EXECUTE) ++ if (Mathematica_RUN_KERNEL_ON_CONFIGURE AND COMMAND Mathematica_EXECUTE) + # determine true $UserBaseDirectory + Mathematica_EXECUTE( + CODE "Print[StandardForm[$UserBaseDirectory]]" +@@ -1461,6 +1498,16 @@ macro (_setup_findmathematica_options) + option (Mathematica_DEBUG + "enable FindMathematica debugging output?" + ${Mathematica_DEBUG_INIT}) ++ if (NOT DEFINED Mathematica_RUN_KERNEL_ON_CONFIGURE_INIT) ++ if (DEFINED Mathematica_RUN_KERNEL_ON_CONFIGURE) ++ set (Mathematica_RUN_KERNEL_ON_CONFIGURE_INIT ${Mathematica_RUN_KERNEL_ON_CONFIGURE}) ++ else() ++ set (Mathematica_RUN_KERNEL_ON_CONFIGURE_INIT TRUE) ++ endif() ++ endif() ++ option (Mathematica_RUN_KERNEL_ON_CONFIGURE ++ "allow FindMathematica to implicitly run the Mathematica kernel at CMake configure time?" ++ ${Mathematica_RUN_KERNEL_ON_CONFIGURE_INIT}) + endmacro() + + # internal macro to find Mathematica installation +@@ -1940,7 +1987,7 @@ endmacro() + + # internal macro to find MUnit package + macro (_find_munit_package) +- if (COMMAND Mathematica_FIND_PACKAGE) ++ if (Mathematica_RUN_KERNEL_ON_CONFIGURE AND COMMAND Mathematica_FIND_PACKAGE) + Mathematica_FIND_PACKAGE(Mathematica_MUnit_PACKAGE_FILE "MUnit`MUnit`") + # determine enclosing MUnit package directory + if (Mathematica_MUnit_PACKAGE_FILE) +@@ -1954,7 +2001,7 @@ endmacro() + + # internal macro to find LibaryLink package + macro (_find_librarylink_package) +- if (COMMAND Mathematica_FIND_PACKAGE) ++ if (Mathematica_RUN_KERNEL_ON_CONFIGURE AND COMMAND Mathematica_FIND_PACKAGE) + Mathematica_FIND_PACKAGE(Mathematica_LibraryLink_PACKAGE_FILE "LibraryLink`LibraryLink`") + # determine enclosing LibraryLink package directory + if (Mathematica_LibraryLink_PACKAGE_FILE) +@@ -2449,6 +2496,31 @@ macro (_log_found_variables) + message (STATUS "MUnit not found") + endif() + endif() ++ # warn explicitly about common mistakes users make ++ if (UNIX AND NOT APPLE) ++ if (DEFINED Mathematica_uuid_LIBRARY) ++ if (Mathematica_uuid_LIBRARY MATCHES "-NOTFOUND$") ++ message (WARNING "WSTP and MathLink require libuuid. Install libuuid with the system package manager.") ++ endif() ++ endif() ++ endif() ++ if (DEFINED Mathematica_VERSION) ++ if (CMAKE_SIZEOF_VOID_P EQUAL 4) ++ if (WINDOWS) ++ if (NOT "${Mathematica_VERSION}" VERSION_LESS "12.1") ++ message (WARNING "Windows Mathematica ${Mathematica_VERSION} does not support 32-bit.") ++ endif() ++ elseif (APPLE) ++ if (NOT "${Mathematica_VERSION}" VERSION_LESS "9.0") ++ message (WARNING "Mac Mathematica ${Mathematica_VERSION} does not support 32-bit.") ++ endif() ++ elseif (UNIX) ++ if (NOT "${Mathematica_VERSION}" VERSION_LESS "11.3") ++ message (WARNING "Linux Mathematica ${Mathematica_VERSION} does not support 32-bit.") ++ endif() ++ endif() ++ endif() ++ endif() + if (DEFINED Mathematica_VERSION_MAJOR AND + DEFINED Mathematica_VERSION_MINOR AND + DEFINED Mathematica_SYSTEM_IDS) +@@ -3009,6 +3081,8 @@ macro (_add_launch_prefix _cmdVar _systemIDVar) + list (APPEND ${_cmdVar} "/usr/bin/arch" "-i386") + elseif("${${_systemIDVar}}" STREQUAL "MacOSX-x86-64") + list (APPEND ${_cmdVar} "/usr/bin/arch" "-x86_64") ++ elseif("${${_systemIDVar}}" STREQUAL "MacOSX-ARM64") ++ list (APPEND ${_cmdVar} "/usr/bin/arch" "-arm64") + elseif("${${_systemIDVar}}" MATCHES "Darwin|MacOSX") + list (APPEND ${_cmdVar} "/usr/bin/arch" "-ppc") + elseif("${${_systemIDVar}}" STREQUAL "Darwin-PowerPC64") +@@ -3999,7 +4073,7 @@ function (Mathematica_MathLink_ADD_EXECUTABLE _executableName _templateFile) + _get_mprep_output_file(${_templateFile} _outfile) + Mathematica_MathLink_MPREP_TARGET(${_templateFile} OUTPUT ${_outfile}) + add_executable (${_executableName} WIN32 ${_outfile} ${ARGN}) +- target_link_libraries(${_executableName} ${Mathematica_MathLink_LIBRARIES}) ++ target_link_libraries(${_executableName} PRIVATE ${Mathematica_MathLink_LIBRARIES}) + if (Mathematica_MathLink_LINKER_FLAGS) + set_target_properties(${_executableName} PROPERTIES LINK_FLAGS "${Mathematica_MathLink_LINKER_FLAGS}") + endif() +@@ -4129,7 +4203,7 @@ function (Mathematica_WSTP_ADD_EXECUTABLE _executableName _templateFile) + _get_mprep_output_file("${_templateFile}" _outfile) + Mathematica_WSTP_WSPREP_TARGET(${_templateFile} OUTPUT ${_outfile}) + add_executable (${_executableName} WIN32 ${_outfile} ${ARGN}) +- target_link_libraries(${_executableName} ${Mathematica_WSTP_LIBRARIES}) ++ target_link_libraries(${_executableName} PRIVATE ${Mathematica_WSTP_LIBRARIES}) + if (Mathematica_WSTP_LINKER_FLAGS) + set_target_properties(${_executableName} PROPERTIES LINK_FLAGS "${Mathematica_WSTP_LINKER_FLAGS}") + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5741f1c..1bc7e72 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -51,7 +68,7 @@ if(Mathematica_MathLink_FOUND) + Mathematica_MathLink_ADD_EXECUTABLE( + gm2calc.mx + gm2calc.tm) +- target_link_libraries(gm2calc.mx GM2Calc::GM2Calc) ++ target_link_libraries(gm2calc.mx PRIVATE GM2Calc::GM2Calc) + target_include_directories(gm2calc.mx + PRIVATE ${Mathematica_MathLink_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + install( diff --git a/recipes/gm2calc/all/test_package/CMakeLists.txt b/recipes/gm2calc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..126cafe808e38 --- /dev/null +++ b/recipes/gm2calc/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/gm2calc/all/test_package/conanfile.py b/recipes/gm2calc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ab40ee8b181e8 --- /dev/null +++ b/recipes/gm2calc/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + + +class Gm2calcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/gm2calc/all/test_package/test_package.cpp b/recipes/gm2calc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..136918f90705d --- /dev/null +++ b/recipes/gm2calc/all/test_package/test_package.cpp @@ -0,0 +1,96 @@ +#include "gm2calc/gm2_1loop.hpp" +#include "gm2calc/gm2_2loop.hpp" +#include "gm2calc/gm2_error.hpp" +#include "gm2calc/gm2_uncertainty.hpp" +#include "gm2calc/gm2_version.h" +#include "gm2calc/MSSMNoFV_onshell.hpp" +#include + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +gm2calc::MSSMNoFV_onshell setup() { + gm2calc::MSSMNoFV_onshell model; + + const Eigen::Matrix UnitMatrix + = Eigen::Matrix::Identity(); + + // fill SM parameters + model.set_alpha_MZ(0.00775531); // 1L + model.set_alpha_thompson(0.00729735); // 2L + model.set_g3(std::sqrt(4 * M_PI * 0.1184)); // 2L + model.get_physical().MFt = 173.34; // 2L + model.get_physical().MFb = 4.18; // 2L, mb(mb) MS-bar + model.get_physical().MFm = 0.1056583715; // 1L + model.get_physical().MFtau = 1.777; // 2L + model.get_physical().MVWm = 80.385; // 1L + model.get_physical().MVZ = 91.1876; // 1L + + // fill pole masses + model.get_physical().MSvmL = 5.18860573e+02; // 1L + model.get_physical().MSm(0) = 5.05095249e+02; // 1L + model.get_physical().MSm(1) = 5.25187016e+02; // 1L + model.get_physical().MChi(0) = 2.01611468e+02; // 1L + model.get_physical().MChi(1) = 4.10040273e+02; // 1L + model.get_physical().MChi(2) = -5.16529941e+02; // 1L + model.get_physical().MChi(3) = 5.45628749e+02; // 1L + model.get_physical().MCha(0) = 4.09989890e+02; // 1L + model.get_physical().MCha(1) = 5.46057190e+02; // 1L + model.get_physical().MAh(1) = 1.50000000e+03; // 2L + + // fill DR-bar parameters + model.set_TB(40); // 1L + model.set_Mu(500); // initial guess + model.set_MassB(200); // initial guess + model.set_MassWB(400); // initial guess + model.set_MassG(2000); // 2L + model.set_mq2(7000 * 7000 * UnitMatrix); // 2L + model.set_ml2(0, 0, 500 * 500); // 2L + model.set_ml2(1, 1, 500 * 500); // irrelevant + model.set_ml2(2, 2, 500 * 500); // 2L + model.set_md2(7000 * 7000 * UnitMatrix); // 2L + model.set_mu2(7000 * 7000 * UnitMatrix); // 2L + model.set_me2(0, 0, 500 * 500); // 2L + model.set_me2(1, 1, 500 * 500); // initial guess + model.set_me2(2, 2, 500 * 500); // 2L + model.set_Au(2, 2, 0); // 2L + model.set_Ad(2, 2, 0); // 2L + model.set_Ae(1, 1, 0); // 1L + model.set_Ae(2, 2, 0); // 2L + model.set_scale(1000); // 2L + + // convert DR-bar parameters to on-shell + model.convert_to_onshell(); + + // check for warnings + if (model.get_problems().have_warning()) + std::cout << model.get_problems().get_warnings() << '\n'; + + // check for problems + if (model.get_problems().have_problem()) + std::cout << model.get_problems().get_problems() << '\n'; + + return model; +} + +int main() { + std::cout << "GM2Calc " << GM2CALC_VERSION << '\n'; + + try { + gm2calc::MSSMNoFV_onshell model(setup()); + + const double amu = + + gm2calc::calculate_amu_1loop(model) + + gm2calc::calculate_amu_2loop(model); + + const double delta_amu = + gm2calc::calculate_uncertainty_amu_2loop(model); + + std::cout << "amu = " << amu << " +- " << delta_amu << std::endl; + } catch (const gm2calc::Error& e) { + std::cout << e.what() << std::endl; + } + + return 0; +} diff --git a/recipes/gm2calc/config.yml b/recipes/gm2calc/config.yml new file mode 100644 index 0000000000000..008d442d385b9 --- /dev/null +++ b/recipes/gm2calc/config.yml @@ -0,0 +1,7 @@ +versions: + "1.7.5": + folder: all + "2.0.0": + folder: all + "2.1.0": + folder: all diff --git a/recipes/gmp/all/conandata.yml b/recipes/gmp/all/conandata.yml new file mode 100644 index 0000000000000..9266fcde97cc7 --- /dev/null +++ b/recipes/gmp/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "6.2.1": + url: "https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2" + sha256: "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c" + "6.2.0": + url: "https://gmplib.org/download/gmp/gmp-6.2.0.tar.bz2" + sha256: "f51c99cb114deb21a60075ffb494c1a210eb9d7cb729ed042ddb7de9534451ea" + "6.1.2": + url: "https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2" + sha256: "5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2" +patches: + "6.2.1": + - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" + - patch_file: "patches/6.2.x-0001-fix-MSVC-next-prime-error.patch" + "6.2.0": + - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" + - patch_file: "patches/6.2.x-0001-fix-MSVC-next-prime-error.patch" + "6.1.2": + - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" + - patch_file: "patches/6.1.x-0001-fix-MSVC-next-prime-error.patch" + - patch_file: "patches/6.1.x-0002-fix-MSVC-debug.patch" diff --git a/recipes/gmp/all/conanfile.py b/recipes/gmp/all/conanfile.py new file mode 100644 index 0000000000000..eae86d9dc3505 --- /dev/null +++ b/recipes/gmp/all/conanfile.py @@ -0,0 +1,179 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os +import stat + +required_conan_version = ">=1.57.0" + + +class GmpConan(ConanFile): + name = "gmp" + description = ( + "GMP is a free library for arbitrary precision arithmetic, operating " + "on signed integers, rational numbers, and floating-point numbers." + ) + url = "https://github.com/conan-io/conan-center-index" + topics = ("gmp", "math", "arbitrary", "precision", "integer") + license = ("LGPL-3.0", "GPL-2.0") + homepage = "https://gmplib.org" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_assembly": [True, False], + "enable_fat": [True, False], + "run_checks": [True, False], + "enable_cxx": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "disable_assembly": True, + "enable_fat": False, + "run_checks": False, + "enable_cxx": 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 + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.enable_fat + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.get_safe("enable_fat"): + del self.options.disable_assembly + if not self.options.enable_cxx: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.run_checks # run_checks doesn't affect package's ID + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built as a shared library using Visual Studio: some error occurs at link time", + ) + + def build_requirements(self): + self.tool_requires("m4/1.4.19") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("yasm/1.3.0") # Needed for determining 32-bit word size + self.tool_requires("automake/1.16.5") # Needed for lib-wrapper + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f'--with-pic={yes_no(self.options.get_safe("fPIC", True))}', + f'--enable-assembly={yes_no(not self.options.get_safe("disable_assembly", False))}', + f'--enable-fat={yes_no(self.options.get_safe("enable_fat", False))}', + f'--enable-cxx={yes_no(self.options.enable_cxx)}', + f'--srcdir={"../src"}', # Use relative path to avoid issues with #include "$srcdir/gmp-h.in" on Windows + ]) + if is_msvc(self): + tc.configure_args.extend([ + "ac_cv_c_restrict=restrict", + "gmp_cv_asm_label_suffix=:", + "lt_cv_sys_global_symbol_pipe=cat", # added to get further in shared MSVC build, but it gets stuck later + ]) + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() # Environment must be captured *after* setting extra_cflags, etc. to pick up changes + if is_msvc(self): + yasm_wrapper = unix_path(self, os.path.join(self.source_folder, "yasm_wrapper.sh")) + yasm_machine = { + "x86": "x86", + "x86_64": "amd64", + }[str(self.settings.arch)] + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper")) + dumpbin_nm = unix_path(self, os.path.join(self.source_folder, "dumpbin_nm.py")) + env.define("CC", "cl -nologo") + env.define("CCAS", f"{yasm_wrapper} -a x86 -m {yasm_machine} -p gas -r raw -f win32 -g null -X gnu") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f'{ar_wrapper} "lib -nologo"') + env.define("NM", f"python {dumpbin_nm}") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + # Fix permission issue + if is_apple_os(self): + configure_file = os.path.join(self.source_folder, "configure") + configure_stats = os.stat(configure_file) + os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server. + if self.options.run_checks: + autotools.make(target="check") + + def package(self): + copy(self, "COPYINGv2", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING.LESSERv3", 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")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + # Workaround to always provide a pkgconfig file depending on all components + self.cpp_info.set_property("pkg_config_name", "gmp-all-do-not-use") + + self.cpp_info.components["libgmp"].set_property("pkg_config_name", "gmp") + self.cpp_info.components["libgmp"].libs = ["gmp"] + if self.options.enable_cxx: + self.cpp_info.components["gmpxx"].set_property("pkg_config_name", "gmpxx") + self.cpp_info.components["gmpxx"].libs = ["gmpxx"] + self.cpp_info.components["gmpxx"].requires = ["libgmp"] + if self.settings.os != "Windows": + self.cpp_info.components["gmpxx"].system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # GMP doesn't have any official CMake Find nor config file, do not port these names to CMakeDeps + self.cpp_info.names["pkg_config"] = "gmp-all-do-not-use" + self.cpp_info.components["libgmp"].names["cmake_find_package"] = "GMP" + self.cpp_info.components["libgmp"].names["cmake_find_package_multi"] = "GMP" + if self.options.enable_cxx: + self.cpp_info.components["gmpxx"].names["cmake_find_package"] = "GMPXX" + self.cpp_info.components["gmpxx"].names["cmake_find_package_multi"] = "GMPXX" diff --git a/recipes/gmp/all/patches/0001-msvc-dumpbin-yasm-wrapper.patch b/recipes/gmp/all/patches/0001-msvc-dumpbin-yasm-wrapper.patch new file mode 100644 index 0000000000000..c802a6bfec0b6 --- /dev/null +++ b/recipes/gmp/all/patches/0001-msvc-dumpbin-yasm-wrapper.patch @@ -0,0 +1,72 @@ +--- /dev/null ++++ dumpbin_nm.py +@@ -0,0 +1,28 @@ ++#!/usr/bin/env python3 ++ ++import re ++import subprocess ++import sys ++#print(open(sys.argv[1], "rb").read()) ++#output = subprocess.check_output(["dumpbin", "-nologo", "-symbols"] + sys.argv[1:], stderr=subprocess.STDOUT, text=True, shell=True) ++output = subprocess.check_output("dumpbin -nologo -symbols {}".format(sys.argv[1]), stderr=subprocess.STDOUT, shell=True) ++output = output.decode() ++for line in output.splitlines(): ++ d = re.split("[ |]+", line.strip()) ++ if len(d) == 6: ++ try: ++ int(d[0]) ++ except ValueError: ++ continue ++ ++ section = d[-1] ++ if section == ".file": ++ continue ++ elif section == ".data": ++ stype = "d" ++ elif section == ".text": ++ stype = "t" ++ else: ++ stype = "D" ++ offset = d[1] ++ print("{} {} {}".format(offset, stype, section)) +--- /dev/null ++++ yasm_wrapper.sh +@@ -0,0 +1,38 @@ ++#!/bin/sh ++asmopts=() ++setoutput= ++calculated_output= ++source= ++while test $# -gt 0; do ++ case "$1" in ++ *.s | *.S | *.asm | *.ASM) ++ calculated_output=$(echo -n "$1" | sed -e 's/\.asm$/.obj/g' | sed -e 's/\.ASM/.obj/g' | sed -e 's/\.s/.obj/g' | sed -e 's/\.S/.obj/g') ++ source="$1" ++ ;; ++ -o) ++ asmopts+=("$1") ++ shift ++ setoutput="$1" ++ asmopts+=("$1") ++ ;; ++ -O*) ++ ;; ++ -MT | -MD | -MTd | -MDd) ++ ;; ++ -D*) ++ asmopts+=("$1") ++ ;; ++ *) ++ asmopts+=("$1") ++ ;; ++ esac ++ shift ++done ++ ++if [ "$setoutput" == "" ] && [ "$calculated_output" != "" ]; then ++ asmopts+=("-o") ++ asmopts+=("$calculated_output") ++fi ++ ++echo "Executing yasm ${asmopts[@]} $source" ++exec yasm ${asmopts[@]} "$source" diff --git a/recipes/gmp/all/patches/6.1.x-0001-fix-MSVC-next-prime-error.patch b/recipes/gmp/all/patches/6.1.x-0001-fix-MSVC-next-prime-error.patch new file mode 100644 index 0000000000000..8f9033d47536c --- /dev/null +++ b/recipes/gmp/all/patches/6.1.x-0001-fix-MSVC-next-prime-error.patch @@ -0,0 +1,14 @@ +--- nextprime.c ++++ nextprime.c +@@ -54,9 +54,9 @@ + + #include "gmp.h" + #include "gmp-impl.h" ++#ifndef _MSC_VER + #include /* for memset */ ++#endif +- +- + unsigned long int + gmp_nextprime (gmp_primesieve_t *ps) + { diff --git a/recipes/gmp/all/patches/6.1.x-0002-fix-MSVC-debug.patch b/recipes/gmp/all/patches/6.1.x-0002-fix-MSVC-debug.patch new file mode 100644 index 0000000000000..c27c30be3197b --- /dev/null +++ b/recipes/gmp/all/patches/6.1.x-0002-fix-MSVC-debug.patch @@ -0,0 +1,11 @@ +--- configure ++++ configure +@@ -6776,7 +6776,7 @@ + long i; + for (i = 0; i < 88 + 1; i++) + a[i] = ~0L; +- r = malloc (10000 * sizeof (unsigned long)); ++ r = calloc (10000, sizeof (unsigned long)); + r2 = r; + for (i = 0; i < 528; i += 23) + { diff --git a/recipes/gmp/all/patches/6.2.x-0001-fix-MSVC-next-prime-error.patch b/recipes/gmp/all/patches/6.2.x-0001-fix-MSVC-next-prime-error.patch new file mode 100644 index 0000000000000..a2de61645dc97 --- /dev/null +++ b/recipes/gmp/all/patches/6.2.x-0001-fix-MSVC-next-prime-error.patch @@ -0,0 +1,14 @@ +--- nextprime.c ++++ nextprime.c +@@ -53,9 +53,9 @@ + */ + + #include "gmp-impl.h" ++#ifndef _MSC_VER + #include /* for memset */ ++#endif +- +- + unsigned long int + gmp_nextprime (gmp_primesieve_t *ps) + { diff --git a/recipes/gmp/all/test_package/CMakeLists.txt b/recipes/gmp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba2fbfaf5b1f9 --- /dev/null +++ b/recipes/gmp/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +enable_testing() + +find_package(gmp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE gmp::libgmp) +add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}) + +if(TEST_PIC) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + add_executable(${PROJECT_NAME}_pic test_package.c) + target_link_libraries(${PROJECT_NAME}_pic PRIVATE gmp::libgmp) + add_test(NAME ${PROJECT_NAME}_pic_test COMMAND ${PROJECT_NAME}_pic) +endif() + +if(ENABLE_CXX) + enable_language(CXX) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE gmp::gmpxx) + add_test(NAME ${PROJECT_NAME}_cpp_test COMMAND ${PROJECT_NAME}_cpp) +endif() diff --git a/recipes/gmp/all/test_package/conanfile.py b/recipes/gmp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..408e5ddb1389c --- /dev/null +++ b/recipes/gmp/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, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_CXX"] = self.dependencies["gmp"].options.enable_cxx + tc.variables["TEST_PIC"] = "fPIC" in self.dependencies["gmp"].options and self.dependencies["gmp"].options.fPIC + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not can_run(self): + return + with chdir(self, self.folders.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/recipes/gmp/all/test_package/test_package.c b/recipes/gmp/all/test_package/test_package.c new file mode 100644 index 0000000000000..855fb40978336 --- /dev/null +++ b/recipes/gmp/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include + +#include +#include + +int main (void) { + mpz_t a,b,c; + mpz_init_set_str(a, "1234", 10); + mpz_init_set_str(b, "4321", 10); + mpz_init(c); + + mpz_add(c, a, b); + + char *a_str = mpz_get_str(NULL, 10, a); + char *b_str = mpz_get_str(NULL, 10, b); + char *c_str = mpz_get_str(NULL, 10, c); + + printf("%s + %s = %s\n", a_str, b_str, c_str); + + free(a_str); + free(b_str); + free(c_str); + + return EXIT_SUCCESS; +} diff --git a/recipes/gmp/all/test_package/test_package.cpp b/recipes/gmp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4a494a2142fa0 --- /dev/null +++ b/recipes/gmp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include + +int main (void) { + mpz_class a("1234"); + mpz_class b("4321"); + + mpz_class c = a + b; + std::cout << a << " + " << b << " = " << c << "\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/gmp/all/test_v1_package/CMakeLists.txt b/recipes/gmp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..81f52f58013af --- /dev/null +++ b/recipes/gmp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +if(ENABLE_CXX) + enable_language(CXX) +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(gmp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE gmp::GMP) + +if(TEST_PIC) + add_library(${PROJECT_NAME}_shared SHARED ../test_package/test_package.c) + target_link_libraries(${PROJECT_NAME}_shared PRIVATE gmp::GMP) +endif() + +if(ENABLE_CXX) + add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE gmp::GMPXX) +endif() diff --git a/recipes/gmp/all/test_v1_package/conanfile.py b/recipes/gmp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..716c611a38e8a --- /dev/null +++ b/recipes/gmp/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.definitions["ENABLE_CXX"] = self.options["gmp"].enable_cxx + cmake.definitions["TEST_PIC"] = "fPIC" in self.options["gmp"] and self.options["gmp"].fPIC + 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.options["gmp"].enable_cxx: + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) diff --git a/recipes/gmp/config.yml b/recipes/gmp/config.yml new file mode 100644 index 0000000000000..7beafba5ffe63 --- /dev/null +++ b/recipes/gmp/config.yml @@ -0,0 +1,7 @@ +versions: + "6.2.1": + folder: all + "6.2.0": + folder: all + "6.1.2": + folder: all diff --git a/recipes/gn/all/conandata.yml b/recipes/gn/all/conandata.yml new file mode 100644 index 0000000000000..171741d9a625a --- /dev/null +++ b/recipes/gn/all/conandata.yml @@ -0,0 +1,3 @@ +sources: + "cci.20210429": + url: "https://gn.googlesource.com/gn/+archive/6771ce569fb4803dad7a427aa2e2c23e960b917e.tar.gz" diff --git a/recipes/gn/all/conanfile.py b/recipes/gn/all/conanfile.py new file mode 100644 index 0000000000000..14fc7169fc53f --- /dev/null +++ b/recipes/gn/all/conanfile.py @@ -0,0 +1,128 @@ +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 sys +import textwrap +import time + +required_conan_version = ">=1.46.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" + homepage = "https://gn.googlesource.com/" + settings = "os", "arch", "compiler", "build_type" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_compiler_version_supporting_cxx17(self): + return { + "Visual Studio": 15, + "gcc": 7, + "clang": 4, + "apple-clang": 10, + }.get(str(self.settings.compiler)) + + def validate(self): + if self.settings.compiler.cppstd: + tools.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: + 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) + + def build_requirements(self): + # FIXME: add cpython build requirements for `build/gen.py`. + self.build_requires("ninja/1.10.2") + + @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_): + return "darwin" + if compiler == "Visual Studio": + return "msvc" + # Assume gn knows about the os + return str(os_).lower() + + 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) + + 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") + + def package_info(self): + 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/gn/all/test_package/.gn b/recipes/gn/all/test_package/.gn new file mode 100644 index 0000000000000..4933a3bffc64c --- /dev/null +++ b/recipes/gn/all/test_package/.gn @@ -0,0 +1,2 @@ +# The location of the build configuration file. +buildconfig = "//config/BUILDCONFIG.gn" diff --git a/recipes/gn/all/test_package/BUILD.gn b/recipes/gn/all/test_package/BUILD.gn new file mode 100644 index 0000000000000..7cf914f59ddad --- /dev/null +++ b/recipes/gn/all/test_package/BUILD.gn @@ -0,0 +1,22 @@ + +executable("test_package") { + sources = ["test_package.cpp"] + + deps = [ + ":test_shared", + ":test_static", + ] +} + +shared_library("test_shared") { + defines = ["TEST_SHARED_BUILD"] + sources = [ + "test_shared.cpp", + ] +} + +static_library("test_static") { + sources = [ + "test_static.cpp", + ] +} diff --git a/recipes/gn/all/test_package/conanfile.py b/recipes/gn/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6afe525facbbe --- /dev/null +++ b/recipes/gn/all/test_package/conanfile.py @@ -0,0 +1,69 @@ +from conans import ConanFile, CMake, tools +from contextlib import contextmanager +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def build_requirements(self): + self.build_requires("ninja/1.10.2") + + @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 + + @property + def _target_os(self): + if tools.is_apple_os(self.settings.os): + return "mac" + # Assume gn knows about the os + return { + "Windows": "win", + }.get(str(self.settings.os), str(self.settings.os).lower()) + + @property + def _target_cpu(self): + return { + "x86_64": "x64", + }.get(str(self.settings.arch), str(self.settings.arch)) + + 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) + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/gn/all/test_package/config/BUILD.gn b/recipes/gn/all/test_package/config/BUILD.gn new file mode 100644 index 0000000000000..be72127ebb882 --- /dev/null +++ b/recipes/gn/all/test_package/config/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +config("compiler_defaults") { + if (current_os == "linux") { + cflags = [ + "-fPIC", + "-pthread", + ] + } + if (current_os == "windows") { + cflags_cc = [ + "-EHsc", + ] + } +} +config("executable_ldconfig") { + if (!is_mac && current_os != "win") { + ldflags = [ + "-Wl,-rpath=\$ORIGIN/", + "-Wl,-rpath-link=", + ] + } +} diff --git a/recipes/gn/all/test_package/config/BUILDCONFIG.gn b/recipes/gn/all/test_package/config/BUILDCONFIG.gn new file mode 100644 index 0000000000000..51893aa4c4833 --- /dev/null +++ b/recipes/gn/all/test_package/config/BUILDCONFIG.gn @@ -0,0 +1,48 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (target_os == "") { + target_os = host_os +} +if (target_cpu == "") { + target_cpu = host_cpu +} +if (current_cpu == "") { + current_cpu = target_cpu +} +if (current_os == "") { + current_os = target_os +} +is_windows = host_os == "win" && current_os == "win" && target_os == "win" +is_linux = host_os == "linux" && current_os == "linux" && target_os == "linux" +is_mac = host_os == "mac" && current_os == "mac" && target_os == "mac" +# All binary targets will get this list of configs by default. +_shared_binary_target_configs = [ "//config:compiler_defaults" ] +# Apply that default list to the binary target types. +set_defaults("executable") { + configs = _shared_binary_target_configs + # Executables get this additional configuration. + configs += [ "//config:executable_ldconfig" ] +} +set_defaults("static_library") { + configs = _shared_binary_target_configs +} +set_defaults("shared_library") { + configs = _shared_binary_target_configs +} +set_defaults("source_set") { + configs = _shared_binary_target_configs +} +if (is_windows) { + set_default_toolchain("//config/toolchain:msvc") +} else { + set_default_toolchain("//config/toolchain:gcc") +} + +print("current_os:", current_os) +print("current_cpu:", current_cpu) +print("host_os:", host_os) +print("host_cpu:", host_cpu) +print("target_os:", target_os) +print("target_cpu:", target_os) diff --git a/recipes/gn/all/test_package/config/toolchain/BUILD.gn b/recipes/gn/all/test_package/config/toolchain/BUILD.gn new file mode 100644 index 0000000000000..216db1e757f5b --- /dev/null +++ b/recipes/gn/all/test_package/config/toolchain/BUILD.gn @@ -0,0 +1,174 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +toolchain("gcc") { + tool("cc") { + depfile = "{{output}}.d" + _compiler = getenv("CC") + if (_compiler == "") { + _compiler = "gcc" + } + command = _compiler + " -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" + depsformat = "gcc" + description = "CC {{output}}" + outputs = + [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] + } + tool("cxx") { + depfile = "{{output}}.d" + _compiler = getenv("CXX") + if (_compiler == "") { + _compiler = "g++" + } + command = _compiler + " -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" + depsformat = "gcc" + description = "CXX {{output}}" + outputs = + [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] + } + tool("alink") { + _archiver = getenv("AR") + if (_archiver == "") { + _archiver = "ar" + } + command = "rm -f {{output}} && " + _archiver + " rcs {{output}} {{inputs}}" + description = "AR {{target_output_name}}{{output_extension}}" + outputs = + [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ] + default_output_extension = ".a" + output_prefix = "lib" + } + tool("solink") { + _linker = getenv("LD") + if (_linker == "") { + _linker = getenv("CXX") + if (_linker == "") { + _linker = "g++" + } + } + soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". + sofile = "{{output_dir}}/$soname" + rspfile = soname + ".rsp" + if (is_mac) { + os_specific_option = "-install_name @executable_path/$sofile" + rspfile_content = "{{inputs}} {{solibs}} {{libs}}" + default_output_extension = ".dylib" + } else { + os_specific_option = "-Wl,-soname=$soname" + rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}" + default_output_extension = ".so" + } + command = _linker + " -shared {{ldflags}} -o $sofile $os_specific_option @$rspfile" + description = "SOLINK $soname" + default_output_dir = "{{root_out_dir}}" + outputs = [ sofile ] + link_output = sofile + depend_output = sofile + output_prefix = "lib" + } + tool("link") { + _linker = getenv("LD") + if (_linker == "") { + _linker = getenv("CXX") + if (_linker == "") { + _linker = "g++" + } + } + outfile = "{{target_output_name}}{{output_extension}}" + rspfile = "$outfile.rsp" + if (is_mac) { + command = _linker + " {{ldflags}} -o $outfile @$rspfile {{solibs}} {{libs}}" + } else { + command = _linker + " {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}}" + } + description = "LINK $outfile" + default_output_dir = "{{root_out_dir}}" + rspfile_content = "{{inputs}}" + outputs = [ outfile ] + } + tool("stamp") { + command = "touch {{output}}" + description = "STAMP {{output}}" + } + tool("copy") { + command = "cp -af {{source}} {{output}}" + description = "COPY {{source}} {{output}}" + } +} + +toolchain("msvc") { + tool("cc") { + _compiler = getenv("CC") + if (_compiler == "") { + _compiler = "cl -nologo" + } + command = _compiler + " {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -Fo{{output}}" + description = "CC {{output}}" + outputs = + [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ] + } + tool("cxx") { + _compiler = getenv("CXX") + if (_compiler == "") { + _compiler = "cl -nologo" + } + command = _compiler + " {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -Fo{{output}}" + description = "CXX {{output}}" + default_output_extension = ".obj" + outputs = + [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] + } + tool("alink") { + _archiver = getenv("AR") + if (_archiver == "") { + _archiver = "lib -nologo" + } + command = _archiver + " -OUT:{{output}} {{inputs}}" + description = "LIB {{target_output_name}}{{output_extension}}" + outputs = + [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ] + default_output_extension = ".lib" + output_prefix = "" + } + tool("solink") { + _linker = getenv("LD") + if (_linker == "") { + _linker = "link -nologo" + } + soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". + sofile = "{{output_dir}}/$soname" + implib = "$sofile.lib" + rspfile = soname + ".rsp" + rspfile_content = "{{inputs}} {{solibs}} {{libs}}" + command = _linker + " -dll {{ldflags}} -OUT:$sofile -IMPLIB:$implib @$rspfile" + description = "SOLINK $soname" + default_output_extension = ".dll" + default_output_dir = "{{root_out_dir}}" + outputs = [ sofile, implib ] + link_output = implib + depend_output = implib + output_prefix = "" + } + tool("link") { + _linker = getenv("LD") + if (_linker == "") { + _linker = "link -nologo" + } + outfile = "{{target_output_name}}{{output_extension}}" + rspfile = "$outfile.rsp" + command = _linker + " {{ldflags}} -OUT:$outfile @$rspfile {{solibs}} {{libs}}" + description = "LINK $outfile" + default_output_extension = ".exe" + default_output_dir = "{{root_out_dir}}" + rspfile_content = "{{inputs}}" + outputs = [ outfile ] + } + tool("stamp") { + command = "touch {{output}}" + description = "STAMP {{output}}" + } + tool("copy") { + command = "cp -af {{source}} {{output}}" + description = "COPY {{source}} {{output}}" + } +} diff --git a/recipes/gn/all/test_package/test_package.cpp b/recipes/gn/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..576931dcb63ac --- /dev/null +++ b/recipes/gn/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "test_shared.h" +#include "test_static.h" + +#include + +int main(int argc, char* argv[]) { + std::cout << get_test_shared_text() << "\n"; + std::cout << get_test_static_text() << "\n"; + return 0; +} diff --git a/recipes/gn/all/test_package/test_shared.cpp b/recipes/gn/all/test_package/test_shared.cpp new file mode 100644 index 0000000000000..290c715db7a2f --- /dev/null +++ b/recipes/gn/all/test_package/test_shared.cpp @@ -0,0 +1,5 @@ +#include "test_shared.h" + +const char *get_test_shared_text() { + return "hello from the shared library!"; +} diff --git a/recipes/gn/all/test_package/test_shared.h b/recipes/gn/all/test_package/test_shared.h new file mode 100644 index 0000000000000..f7a934dc1b9fd --- /dev/null +++ b/recipes/gn/all/test_package/test_shared.h @@ -0,0 +1,14 @@ +#pragma once + +#ifdef _WIN32 +# ifdef TEST_SHARED_BUILD +# define TEST_SHARED_API __declspec(dllexport) +# else +# define TEST_SHARED_API __declspec(dllimport) +# endif +#else +# define TEST_SHARED_API +#endif + +TEST_SHARED_API +const char *get_test_shared_text(); diff --git a/recipes/gn/all/test_package/test_static.cpp b/recipes/gn/all/test_package/test_static.cpp new file mode 100644 index 0000000000000..45cdc962d7d2e --- /dev/null +++ b/recipes/gn/all/test_package/test_static.cpp @@ -0,0 +1,5 @@ +#include "test_static.h" + +const char *get_test_static_text() { + return "hello from the static library!"; +} diff --git a/recipes/gn/all/test_package/test_static.h b/recipes/gn/all/test_package/test_static.h new file mode 100644 index 0000000000000..4fbf705069a49 --- /dev/null +++ b/recipes/gn/all/test_package/test_static.h @@ -0,0 +1,3 @@ +#pragma once + +const char *get_test_static_text(); diff --git a/recipes/gn/config.yml b/recipes/gn/config.yml new file mode 100644 index 0000000000000..7831e6ed51225 --- /dev/null +++ b/recipes/gn/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210429": + folder: all diff --git a/recipes/gnu-config/all/conandata.yml b/recipes/gnu-config/all/conandata.yml new file mode 100644 index 0000000000000..c49d54ae16b78 --- /dev/null +++ b/recipes/gnu-config/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "cci.20210814": + url: "http://git.savannah.gnu.org/cgit/config.git/snapshot/config-191bcb948f7191c36eefe634336f5fc5c0c4c2be.tar.gz" + sha256: "302e5e7f3c4996976c58efde8b2f28f71d51357e784330eeed738e129300dc33" + "cci.20201022": + url: "http://git.savannah.gnu.org/cgit/config.git/snapshot/config-1c4398015583eb77bc043234f5734be055e64bea.tar.gz" + sha256: "339eb64757bf5af9e23ca15daa136acdd9d778753377190ce17fba7e1b222aff" +patches: + "cci.20210814": + - patch_file: "patches/cci.20210814-0001-tvos-support.patch" + patch_description: "add support to tvOS" + patch_type: "portability" diff --git a/recipes/gnu-config/all/conanfile.py b/recipes/gnu-config/all/conanfile.py new file mode 100644 index 0000000000000..21b5d5bd14970 --- /dev/null +++ b/recipes/gnu-config/all/conanfile.py @@ -0,0 +1,67 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.files import copy, get, load, save, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class GnuConfigConan(ConanFile): + name = "gnu-config" + description = "The GNU config.guess and config.sub scripts" + homepage = "https://savannah.gnu.org/projects/config/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("gnu", "config", "autotools", "canonical", "host", "build", "target", "triplet") + license = "GPL-3.0-or-later", "autoconf-special-exception" + os = "arch", "compiler", "build_type", "arch" + no_copy_source = True + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def _extract_license(self): + txt_lines = load(self, os.path.join(self.source_folder, "config.guess")).splitlines() + start_index = None + end_index = None + for line_i, line in enumerate(txt_lines): + if start_index is None: + if "This file is free" in line: + start_index = line_i + if end_index is None: + if "Please send patches" in line: + end_index = line_i + if not all((start_index, end_index)): + raise ConanException("Failed to extract the license") + return "\n".join(txt_lines[start_index:end_index]) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "COPYING"), self._extract_license()) + copy(self, "config.guess", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + copy(self, "config.sub", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bin_path = os.path.join(self.package_folder, "bin") + self.conf_info.define("user.gnu-config:config_guess", os.path.join(bin_path, "config.guess")) + self.conf_info.define("user.gnu-config:config_sub", os.path.join(bin_path, "config.sub")) + + # TODO: to remove in conan v2 + self.user_info.CONFIG_GUESS = os.path.join(bin_path, "config.guess") + self.user_info.CONFIG_SUB = os.path.join(bin_path, "config.sub") + self.env_info.PATH.append(bin_path) diff --git a/recipes/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch b/recipes/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch new file mode 100644 index 0000000000000..64667f1b35284 --- /dev/null +++ b/recipes/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch @@ -0,0 +1,11 @@ +--- config.sub ++++ config.sub +@@ -1723,7 +1723,7 @@ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ +- | os9* | macos* | osx* | ios* \ ++ | os9* | macos* | osx* | ios* | tvos* | watchos* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ diff --git a/recipes/gnu-config/all/test_package/conanfile.py b/recipes/gnu-config/all/test_package/conanfile.py new file mode 100644 index 0000000000000..93cb4f77f7eab --- /dev/null +++ b/recipes/gnu-config/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def test(self): + self.run("config.guess") + self.run("config.sub --version") diff --git a/recipes/gnu-config/all/test_v1_package/conanfile.py b/recipes/gnu-config/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f98dcb17dfac3 --- /dev/null +++ b/recipes/gnu-config/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, tools +from conans.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def test(self): + self.run("config.guess", run_environment=True, win_bash=tools.os_info.is_windows) + try: + triplet = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)) + self.run(f"config.sub {triplet}", run_environment=True, win_bash=tools.os_info.is_windows) + except ConanException: + self.output.info("Current configuration is not supported by GNU config.\nIgnoring...") diff --git a/recipes/gnu-config/config.yml b/recipes/gnu-config/config.yml new file mode 100644 index 0000000000000..cf1827d502db3 --- /dev/null +++ b/recipes/gnu-config/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210814": + folder: "all" + "cci.20201022": + folder: "all" diff --git a/recipes/gnulib/all/conandata.yml b/recipes/gnulib/all/conandata.yml new file mode 100644 index 0000000000000..5a178c6fd8562 --- /dev/null +++ b/recipes/gnulib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20200224": + url: "http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=d279bc6d9f9323e19ad8c32b6d12ff96dfb0f5ba;sf=tgz" + sha256: "171142863dd860b3a5babc0f6172048313cf9d98d00a289be9c154bf015ac68d" diff --git a/recipes/gnulib/all/conanfile.py b/recipes/gnulib/all/conanfile.py new file mode 100644 index 0000000000000..8f85099afedec --- /dev/null +++ b/recipes/gnulib/all/conanfile.py @@ -0,0 +1,51 @@ +from conans import ConanFile, tools +import os +import shutil + +required_conan_version = ">=1.33.0" + + +class GnuLibConanFile(ConanFile): + name = "gnulib" + description = "Gnulib is a central location for common GNU code, intended to be shared among GNU packages." + homepage = "https://www.gnu.org/software/gnulib/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("gnulib", "library", "gnu") + license = ("GPL-3.0-or-later", "LGPL-3.0-or-later", "Unlicense") + + no_copy_source = True + + _source_subfolder = "source_subfolder" + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True, filename="gnulib.tar.gz") + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + # The following line did not work, so do it the long way... + # shutil.copy(os.path.join(self.source_folder, self._source_subfolder), os.path.join(self.package_folder, "bin")) + + gnulib_dir = os.path.join(self.source_folder, self._source_subfolder) + for root, _, files in os.walk(gnulib_dir): + relpath = os.path.relpath(root, gnulib_dir) + dstdir = os.path.join(self.package_folder, "bin", relpath) + try: + os.makedirs(dstdir) + except FileExistsError: + pass + for file in files: + src = os.path.join(root, file) + dst = os.path.join(dstdir, file) + shutil.copy(src, dst) + + def package_info(self): + self.cpp_info.libdirs = [] + + binpath = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment var: {}".format(binpath)) + self.env_info.PATH.append(binpath) diff --git a/recipes/gnulib/all/test_package/Makefile.am b/recipes/gnulib/all/test_package/Makefile.am new file mode 100644 index 0000000000000..e20a3e053d14e --- /dev/null +++ b/recipes/gnulib/all/test_package/Makefile.am @@ -0,0 +1,9 @@ +SUBDIRS = lib . + +ACLOCAL_AMFLAGS = -I m4 + +AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.c +test_package_LDADD = $(top_builddir)/lib/libgnu.a diff --git a/recipes/gnulib/all/test_package/conanfile.py b/recipes/gnulib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..39d8fd2e49aac --- /dev/null +++ b/recipes/gnulib/all/test_package/conanfile.py @@ -0,0 +1,60 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +import contextlib +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "configure.ac", "Makefile.am", "test_package.c" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + self.build_requires("automake/1.16.4") + + @contextlib.contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + env = { + "AR": "{} lib".format(tools.unix_path(os.path.join(self.build_folder, "build-aux", "ar-lib"))), + "CC": "cl -nologo", + "CXX": "cl -nologo", + "LD": "link -nologo", + "NM": "dumpbin -symbols", + "OBJDUMP": ":", + "RANLIB": ":", + "STRIP": ":", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), dst=os.path.join(self.build_folder, src)) + with tools.chdir(self.build_folder): + for fn in ("COPYING", "NEWS", "INSTALL", "README", "AUTHORS", "ChangeLog"): + tools.save(fn, "\n") + with tools.run_environment(self): + self.run("gnulib-tool --list", win_bash=tools.os_info.is_windows, run_environment=True) + self.run("gnulib-tool --import getopt-posix", win_bash=tools.os_info.is_windows, run_environment=True) + # m4 built with Visual Studio does not support executing *nix utils (e.g. `test`) + with tools.environment_append({"M4":None}) if self.settings.os == "Windows" else tools.no_op(): + self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows, run_environment=True) + + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.configure() + autotools.make() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(".", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gnulib/all/test_package/configure.ac b/recipes/gnulib/all/test_package/configure.ac new file mode 100644 index 0000000000000..1bc2b4ec4d440 --- /dev/null +++ b/recipes/gnulib/all/test_package/configure.ac @@ -0,0 +1,21 @@ +AC_PREREQ([2.69]) +AC_INIT([gnulib test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) + +AM_INIT_AUTOMAKE + +AC_CONFIG_SRCDIR([test_package.c]) +AC_CONFIG_HEADERS([config.h]) + +AC_PROG_CC +gl_EARLY +AM_PROG_AR + +gl_INIT + +AC_CONFIG_FILES([ + Makefile + lib/Makefile +]) + +AC_OUTPUT diff --git a/recipes/gnulib/all/test_package/test_package.c b/recipes/gnulib/all/test_package/test_package.c new file mode 100644 index 0000000000000..2b13f44237f3e --- /dev/null +++ b/recipes/gnulib/all/test_package/test_package.c @@ -0,0 +1,53 @@ +#include + +#include +#include +#include +#include + +int +main (int argc, char **argv) +{ + int aflag = 0; + int bflag = 0; + char *cvalue = NULL; + int index; + int c; + + opterr = 0; + + + while ((c = getopt (argc, argv, "abc:")) != -1) + switch (c) + { + case 'a': + aflag = 1; + break; + case 'b': + bflag = 1; + break; + case 'c': + cvalue = optarg; + break; + case '?': + if (optopt == 'c') + fprintf (stderr, "Option -%c requires an argument.\n", optopt); + else if (isprint (optopt)) + fprintf (stderr, "Unknown option `-%c'.\n", optopt); + else + fprintf (stderr, + "Unknown option character `\\x%x'.\n", + optopt); + return 1; + default: + abort (); + } + + + printf ("aflag = %d, bflag = %d, cvalue = %s\n", + aflag, bflag, cvalue); + + for (index = optind; index < argc; index++) + printf ("Non-option argument %s\n", argv[index]); + return 0; +} diff --git a/recipes/gnulib/config.yml b/recipes/gnulib/config.yml new file mode 100644 index 0000000000000..3f6aba5ec0fcc --- /dev/null +++ b/recipes/gnulib/config.yml @@ -0,0 +1,3 @@ +versions: + "20200224": + folder: all diff --git a/recipes/gnutls/all/conandata.yml b/recipes/gnutls/all/conandata.yml new file mode 100644 index 0000000000000..ffbcf3dfbc66a --- /dev/null +++ b/recipes/gnutls/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.7.8": + url: + - "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" + - "http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.7/gnutls-3.7.8.tar.xz" + - "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" + sha256: "c58ad39af0670efe6a8aee5e3a8b2331a1200418b64b7c51977fb396d4617114" +patches: + "3.7.8": + - patch_description: "Fix Mac OS build when linking to libtasn1" + patch_type: "portability" + patch_source: "https://github.com/xbmc/inputstream.ffmpegdirect/blob/Matrix/depends/common/gnutls/03-undo-libtasn1-cisdigit.patch" + patch_file: "patches/0001-fix-isdigit.patch" diff --git a/recipes/gnutls/all/conanfile.py b/recipes/gnutls/all/conanfile.py new file mode 100644 index 0000000000000..9f3b2e2521c51 --- /dev/null +++ b/recipes/gnutls/all/conanfile.py @@ -0,0 +1,205 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps, Autotools +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class GnuTLSConan(ConanFile): + name = "gnutls" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnutls.org" + description = "GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols" + topics = ("tls", "ssl", "secure communications") + license = ("LGPL-2.1-or-later", "GPL-3-or-later") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_cxx": [True, False], + "enable_tools": [True, False], + "enable_openssl_compatibility": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_brotli": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_cxx": True, + "enable_tools": True, + "enable_openssl_compatibility": False, + "with_zlib": True, + "with_zstd": True, + "with_brotli": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.enable_cxx: + 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("nettle/3.8.1") + self.requires("gmp/6.2.1") + self.requires("libiconv/1.17") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_zstd: + self.requires("zstd/1.5.4") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} cannot be deployed by Visual Studio.") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-tests", + "--disable-doc", + "--disable-guile", + "--disable-libdane", + "--disable-manpages", + "--disable-silent-rules", + "--disable-full-test-suite", + "--disable-maintainer-mode", + "--disable-option-checking", + "--disable-dependency-tracking", + "--disable-heartbeat-support", + "--disable-gtk-doc-html", + "--without-p11-kit", + "--disable-rpath", + "--without-idn", + "--with-included-unistring", + "--with-included-libtasn1", + "--with-libiconv-prefix={}".format(self.dependencies["libiconv"].package_folder), + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-static={}".format(yes_no(not self.options.shared)), + "--with-cxx={}".format(yes_no(self.options.enable_cxx)), + "--with-zlib={}".format(yes_no(self.options.with_zlib)), + "--with-brotli={}".format(yes_no(self.options.with_brotli)), + "--with-zstd={}".format(yes_no(self.options.with_zstd)), + "--enable-tools={}".format(yes_no(self.options.enable_tools)), + "--enable-openssl-compatibility={}".format(yes_no(self.options.enable_openssl_compatibility)), + ]) + if is_apple_os(self): + # fix_apple_shared_install_name() may fail without -headerpad_max_install_names + # (see https://github.com/conan-io/conan-center-index/pull/15946#issuecomment-1464321305) + tc.extra_ldflags.append("-headerpad_max_install_names") + env = tc.environment() + if cross_building(self): + # INFO: Undefined symbols for architecture Mac arm64 rpl_malloc and rpl_realloc + env.define("ac_cv_func_malloc_0_nonnull", "yes") + env.define("ac_cv_func_realloc_0_nonnull", "yes") + tc.generate(env) + autodeps = AutotoolsDeps(self) + autodeps.generate() + pkgdeps = PkgConfigDeps(self) + pkgdeps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(GNUTLS_FOUND TRUE) + if(NOT DEFINED GNUTLS_INCLUDE_DIR AND DEFINED GnuTLS_INCLUDE_DIRS) + set(GNUTLS_INCLUDE_DIR ${{GnuTLS_INCLUDE_DIRS}}) + endif() + if(NOT DEFINED GNUTLS_LIBRARIES AND DEFINED GnuTLS_LIBRARIES) + set(GNUTLS_LIBRARIES ${{GnuTLS_LIBRARIES}}) + endif() + if(NOT DEFINED GNUTLS_DEFINITIONS) + if(DEFINED GnuTLS_DEFINITIONS) + set(GNUTLS_DEFINITIONS ${{GnuTLS_DEFINITIONS}}) + else() + set(GNUTLS_DEFINITIONS "") + endif() + endif() + set(GNUTLS_VERSION {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.libs = ["gnutlsxx", "gnutls"] if self.options.enable_cxx else ["gnutls"] + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "GnuTLS") + self.cpp_info.set_property("cmake_target_name", "GnuTLS::GnuTLS") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "gnutls") + + if is_apple_os(self): + self.cpp_info.frameworks = ["Security", "CoreFoundation"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "GnuTLS" + self.cpp_info.names["cmake_find_package_multi"] = "GnuTLS" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + if self.options.enable_tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/gnutls/all/patches/0001-fix-isdigit.patch b/recipes/gnutls/all/patches/0001-fix-isdigit.patch new file mode 100644 index 0000000000000..64c04ca78c4c2 --- /dev/null +++ b/recipes/gnutls/all/patches/0001-fix-isdigit.patch @@ -0,0 +1,149 @@ +diff --git a/lib/minitasn1/decoding.c b/lib/minitasn1/decoding.c +index 378219c..f75baa7 100644 +--- a/lib/minitasn1/decoding.c ++++ b/lib/minitasn1/decoding.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include "c-ctype.h" + + #ifdef DEBUG + # define warn() fprintf(stderr, "%s: %d\n", __func__, __LINE__) +@@ -353,7 +352,7 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r + p = &der[len_len]; + for (i=0;i<(unsigned)(str_len-1);i++) + { +- if (c_isdigit(p[i]) == 0) ++ if (isdigit(p[i]) == 0) + { + if (type == ASN1_ETYPE_GENERALIZED_TIME) + { +diff --git a/lib/minitasn1/element.c b/lib/minitasn1/element.c +index 550fdb2..58d9243 100644 +--- a/lib/minitasn1/element.c ++++ b/lib/minitasn1/element.c +@@ -30,7 +30,6 @@ + #include "parser_aux.h" + #include + #include "structure.h" +-#include "c-ctype.h" + #include "element.h" + + void +@@ -380,7 +379,7 @@ asn1_write_value (asn1_node node_root, const char *name, + case ASN1_ETYPE_ENUMERATED: + if (len == 0) + { +- if ((c_isdigit (value[0])) || (value[0] == '-')) ++ if ((isdigit (value[0])) || (value[0] == '-')) + { + value_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); + if (value_temp == NULL) +@@ -453,7 +452,7 @@ asn1_write_value (asn1_node node_root, const char *name, + p = node->down; + while (type_field (p->type) != ASN1_ETYPE_DEFAULT) + p = p->right; +- if ((c_isdigit (p->value[0])) || (p->value[0] == '-')) ++ if ((isdigit (p->value[0])) || (p->value[0] == '-')) + { + default_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); + if (default_temp == NULL) +@@ -519,7 +518,7 @@ asn1_write_value (asn1_node node_root, const char *name, + break; + case ASN1_ETYPE_OBJECT_ID: + for (i = 0; i < _asn1_strlen (value); i++) +- if ((!c_isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) ++ if ((!isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) + return ASN1_VALUE_NOT_VALID; + if (node->type & CONST_DEFAULT) + { +@@ -540,7 +539,7 @@ asn1_write_value (asn1_node node_root, const char *name, + if (len < 11) + return ASN1_VALUE_NOT_VALID; + for (k = 0; k < 10; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + switch (len) + { +@@ -549,7 +548,7 @@ asn1_write_value (asn1_node node_root, const char *name, + return ASN1_VALUE_NOT_VALID; + break; + case 13: +- if ((!c_isdigit (value[10])) || (!c_isdigit (value[11])) || ++ if ((!isdigit (value[10])) || (!isdigit (value[11])) || + (value[12] != 'Z')) + return ASN1_VALUE_NOT_VALID; + break; +@@ -557,16 +556,16 @@ asn1_write_value (asn1_node node_root, const char *name, + if ((value[10] != '+') && (value[10] != '-')) + return ASN1_VALUE_NOT_VALID; + for (k = 11; k < 15; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + break; + case 17: +- if ((!c_isdigit (value[10])) || (!c_isdigit (value[11]))) ++ if ((!isdigit (value[10])) || (!isdigit (value[11]))) + return ASN1_VALUE_NOT_VALID; + if ((value[12] != '+') && (value[12] != '-')) + return ASN1_VALUE_NOT_VALID; + for (k = 13; k < 17; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + break; + default: +@@ -890,7 +889,7 @@ asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, + p = node->down; + while (type_field (p->type) != ASN1_ETYPE_DEFAULT) + p = p->right; +- if ((c_isdigit (p->value[0])) || (p->value[0] == '-') ++ if ((isdigit (p->value[0])) || (p->value[0] == '-') + || (p->value[0] == '+')) + { + result = _asn1_convert_integer +diff --git a/lib/minitasn1/int.h b/lib/minitasn1/int.h +index 57f1efd..8e3e2e4 100644 +--- a/lib/minitasn1/int.h ++++ b/lib/minitasn1/int.h +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + #ifdef HAVE_SYS_TYPES_H +diff --git a/lib/minitasn1/parser_aux.c b/lib/minitasn1/parser_aux.c +index bb88ab9..c01b3fa 100644 +--- a/lib/minitasn1/parser_aux.c ++++ b/lib/minitasn1/parser_aux.c +@@ -26,7 +26,6 @@ + #include "gstr.h" + #include "structure.h" + #include "element.h" +-#include "c-ctype.h" + + char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not found */ + +@@ -755,7 +754,7 @@ _asn1_expand_object_id (list_type **list, asn1_node node) + p2 = p->down; + if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) + { +- if (p2->value && !c_isdigit (p2->value[0])) ++ if (p2->value && !isdigit (p2->value[0])) + { + _asn1_str_cpy (name2, sizeof (name2), name_root); + _asn1_str_cat (name2, sizeof (name2), "."); +@@ -1067,7 +1066,7 @@ _asn1_check_identifier (asn1_node_const node) + p2 = p->down; + if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) + { +- if (p2->value && !c_isdigit (p2->value[0])) ++ if (p2->value && !isdigit (p2->value[0])) + { + _asn1_str_cpy (name2, sizeof (name2), node->name); + _asn1_str_cat (name2, sizeof (name2), "."); diff --git a/recipes/gnutls/all/test_package/CMakeLists.txt b/recipes/gnutls/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0529758951292 --- /dev/null +++ b/recipes/gnutls/all/test_package/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(GnuTLS REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GnuTLS::GnuTLS) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindGnuTLS.html are properly defined +set(_custom_vars + GNUTLS_FOUND + GNUTLS_INCLUDE_DIR + GNUTLS_LIBRARIES + GNUTLS_DEFINITIONS + GNUTLS_VERSION +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/gnutls/all/test_package/conanfile.py b/recipes/gnutls/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/gnutls/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/gnutls/all/test_package/test_package.c b/recipes/gnutls/all/test_package/test_package.c new file mode 100644 index 0000000000000..e40be9a5950ff --- /dev/null +++ b/recipes/gnutls/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include + +int main (void) { + int result = 0; + gnutls_session_t session; + + gnutls_global_init(); + gnutls_global_set_log_level(0); + + gnutls_init(&session, GNUTLS_SERVER); + gnutls_deinit(session); + gnutls_global_deinit(); + + return EXIT_SUCCESS; +} diff --git a/recipes/gnutls/all/test_v1_package/CMakeLists.txt b/recipes/gnutls/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/gnutls/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/gnutls/all/test_v1_package/conanfile.py b/recipes/gnutls/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e335244ee18cf --- /dev/null +++ b/recipes/gnutls/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +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/gnutls/config.yml b/recipes/gnutls/config.yml new file mode 100644 index 0000000000000..c993c311a349d --- /dev/null +++ b/recipes/gnutls/config.yml @@ -0,0 +1,3 @@ +versions: + "3.7.8": + folder: "all" diff --git a/recipes/gobject-introspection/all/conandata.yml b/recipes/gobject-introspection/all/conandata.yml new file mode 100644 index 0000000000000..47eccc41d1faf --- /dev/null +++ b/recipes/gobject-introspection/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.72.0": + sha256: "02fe8e590861d88f83060dd39cda5ccaa60b2da1d21d0f95499301b186beaabc" + url: "https://download.gnome.org/sources/gobject-introspection/1.72/gobject-introspection-1.72.0.tar.xz" + "1.70.0": + url: "https://download.gnome.org/sources/gobject-introspection/1.70/gobject-introspection-1.70.0.tar.xz" + sha256: "902b4906e3102d17aa2fcb6dad1c19971c70f2a82a159ddc4a94df73a3cafc4a" + "1.69.0": + url: "https://download.gnome.org/sources/gobject-introspection/1.69/gobject-introspection-1.69.0.tar.xz" + sha256: "c668cbe4a3aad7539e2cf669ab576ce7fbadac6890472f4095ca215dbbebee99" + "1.68.0": + url: "https://download.gnome.org/sources/gobject-introspection/1.68/gobject-introspection-1.68.0.tar.xz" + sha256: "d229242481a201b84a0c66716de1752bca41db4133672cfcfb37c93eb6e54a27" + "1.67.1": + url: "https://download.gnome.org/sources/gobject-introspection/1.67/gobject-introspection-1.67.1.tar.xz" + sha256: "9635184d668794609f9fe661c5bde11c106385d26c3babe291c24e3655987e47" + "1.66.1": + url: "https://download.gnome.org/sources/gobject-introspection/1.66/gobject-introspection-1.66.1.tar.xz" + sha256: "dd44a55ee5f426ea22b6b89624708f9e8d53f5cc94e5485c15c87cb30e06161d" diff --git a/recipes/gobject-introspection/all/conanfile.py b/recipes/gobject-introspection/all/conanfile.py new file mode 100644 index 0000000000000..4e30ffbb5f86f --- /dev/null +++ b/recipes/gobject-introspection/all/conanfile.py @@ -0,0 +1,129 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import os +import shutil +import glob + +required_conan_version = ">=1.36.0" + +class GobjectIntrospectionConan(ConanFile): + name = "gobject-introspection" + description = "GObject introspection is a middleware layer between C libraries (using GObject) and language bindings" + topics = ("conan", "gobject-instrospection") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.gnome.org/GNOME/gobject-introspection" + license = "LGPL-2.1" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + generators = "pkg_config" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("%s recipe does not support windows. Contributions are welcome!" % self.name) + + def build_requirements(self): + if tools.Version(self.version) >= "1.71.0": + self.build_requires("meson/0.62.2") + else: + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/414 + self.build_requires("meson/0.59.3") + self.build_requires("pkgconf/1.7.4") + if self.settings.os == "Windows": + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("flex/2.6.4") + self.build_requires("bison/3.7.6") + + def requirements(self): + self.requires("glib/2.73.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def _configure_meson(self): + meson = Meson(self) + defs = dict() + defs["build_introspection_data"] = self.options["glib"].shared + defs["datadir"] = os.path.join(self.package_folder, "res") + + meson.configure( + source_folder=self._source_subfolder, + args=["--wrap-mode=nofallback"], + build_folder=self._build_subfolder, + defs=defs, + ) + return meson + + def build(self): + tools.replace_in_file( + os.path.join(self._source_subfolder, "meson.build"), + "subdir('tests')", + "#subdir('tests')", + ) + tools.replace_in_file( + os.path.join(self._source_subfolder, "meson.build"), + "if meson.version().version_compare('>=0.54.0')", + "if false", + ) + + with tools.environment_append( + VisualStudioBuildEnvironment(self).vars + if self._is_msvc + else {"PKG_CONFIG_PATH": self.build_folder} + ): + meson = self._configure_meson() + meson.build() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append( + VisualStudioBuildEnvironment(self).vars + ) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + for pdb_file in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): + os.unlink(pdb_file) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "gobject-introspection-1.0" + self.cpp_info.libs = ["girepository-1.0"] + self.cpp_info.includedirs.append( + os.path.join("include", "gobject-introspection-1.0") + ) + + 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) + + exe_ext = ".exe" if self.settings.os == "Windows" else "" + + pkgconfig_variables = { + 'datadir': '${prefix}/res', + 'bindir': '${prefix}/bin', + 'g_ir_scanner': '${bindir}/g-ir-scanner', + 'g_ir_compiler': '${bindir}/g-ir-compiler%s' % exe_ext, + 'g_ir_generate': '${bindir}/g-ir-generate%s' % exe_ext, + 'gidatadir': '${datadir}/gobject-introspection-1.0', + 'girdir': '${datadir}/gir-1.0', + 'typelibdir': '${libdir}/girepository-1.0', + } + self.cpp_info.set_property( + "pkg_config_custom_content", + "\n".join("%s=%s" % (key, value) for key,value in pkgconfig_variables.items())) diff --git a/recipes/gobject-introspection/all/test_package/CMakeLists.txt b/recipes/gobject-introspection/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/gobject-introspection/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/gobject-introspection/all/test_package/conanfile.py b/recipes/gobject-introspection/all/test_package/conanfile.py new file mode 100644 index 0000000000000..32d4b65e5f11e --- /dev/null +++ b/recipes/gobject-introspection/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package", "pkg_config" + + def build(self): + if self.settings.os != 'Windows': + with tools.environment_append({'PKG_CONFIG_PATH': "."}): + pkg_config = tools.PkgConfig("gobject-introspection-1.0") + for tool in ["g_ir_compiler", "g_ir_generate", "g_ir_scanner"]: + self.run('%s --version' % pkg_config.variables[tool], run_environment=True) + self.run('g-ir-annotation-tool --version', run_environment=True) + self.run('g-ir-inspect -h', run_environment=True) + + 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/gobject-introspection/all/test_package/test_package.c b/recipes/gobject-introspection/all/test_package/test_package.c new file mode 100644 index 0000000000000..c1b18cd52e49e --- /dev/null +++ b/recipes/gobject-introspection/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include "girepository.h" + +int main(int argc, char **argv) +{ + printf("gobject introspection version %d.%d.%d\n", + gi_get_major_version(), + gi_get_minor_version(), + gi_get_micro_version()); + return 0; +} diff --git a/recipes/gobject-introspection/config.yml b/recipes/gobject-introspection/config.yml new file mode 100644 index 0000000000000..06afabf3f5bc4 --- /dev/null +++ b/recipes/gobject-introspection/config.yml @@ -0,0 +1,13 @@ +versions: + "1.72.0": + folder: all + "1.70.0": + folder: all + "1.69.0": + folder: all + "1.68.0": + folder: all + "1.67.1": + folder: all + "1.66.1": + folder: all diff --git a/recipes/godot-cpp/all/conandata.yml b/recipes/godot-cpp/all/conandata.yml new file mode 100644 index 0000000000000..a5e56e1b0aaa0 --- /dev/null +++ b/recipes/godot-cpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.5.1": + url: "https://github.com/godotengine/godot-cpp/archive/godot-3.5.1-stable.tar.gz" + sha256: "a0ab1f117d30ab01837e39e7ff704bbded282db4643343579b2bca11794f99fc" + "3.3.4": + url: "https://github.com/godotengine/godot-cpp/archive/godot-3.3.4-stable.tar.gz" + sha256: "fa12b8dd8652109eceae7aecf134f64529edfb34ec33d24b1a9c220b40599575" + "cci.3.2-20200130": + url: "https://github.com/godotengine/godot-cpp/archive/aba8766618c6aa40c6f7b40b513e8e47cfa807f4.zip" + sha256: "a6dba9cda3c36c669ffca2bb9dd4e372bcd1fbf23c74076505467247c15f0e77" diff --git a/recipes/godot-cpp/all/conanfile.py b/recipes/godot-cpp/all/conanfile.py new file mode 100644 index 0000000000000..625aabfb6d902 --- /dev/null +++ b/recipes/godot-cpp/all/conanfile.py @@ -0,0 +1,142 @@ +import glob +import os + +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class GodotCppConan(ConanFile): + name = "godot-cpp" + description = "C++ bindings for the Godot script API" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/godotengine/godot-cpp" + topics = ("game-engine", "game-development", "c++") + settings = "os", "arch", "compiler", "build_type" + build_requires = ["scons/3.1.2"] + + @property + def _bits(self): + return 64 if self.settings.get_safe("arch") in ["x86_64", "armv8"] else 32 + + @property + def _custom_api_file(self): + return "{}/api.json".format(self._godot_headers.res_paths[0]) + + @property + def _headers_dir(self): + return self._godot_headers.include_paths[0] + + @property + def _platform(self): + flag_map = { + "Windows": "windows", + "Linux": "linux", + "Macos": "osx", + } + return flag_map[self.settings.get_safe("os")] + + @property + def _target(self): + return "debug" if self.settings.get_safe("build_type") == "Debug" else "release" + + @property + def _use_llvm(self): + return self.settings.get_safe("compiler") in ["clang", "apple-clang"] + + @property + def _use_mingw(self): + return self._platform == "windows" and self.settings.compiler == "gcc" + + @property + def _libname(self): + return "godot-cpp.{platform}.{target}.{bits}".format(platform=self._platform, target=self._target, bits=self._bits) + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _godot_headers(self): + return self.deps_cpp_info["godot_headers"] + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + tools.rename(glob.glob("godot-cpp-*")[0], self._source_subfolder) + + def requirements(self): + self.requires("godot_headers/{}".format(self.version)) + + def configure(self): + minimal_cpp_standard = "14" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + + minimal_version = { + "gcc": "5", + "clang": "4", + "apple-clang": "10", + "Visual Studio": "15", + } + + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "{} recipe lacks information about the {} compiler standard version support".format(self.name, compiler)) + self.output.warn( + "{} requires a compiler that supports at least C++{}".format(self.name, minimal_cpp_standard)) + return + + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + if compiler in ["apple-clang", "clang"]: + raise ConanInvalidConfiguration( + "{} requires a clang version that supports the '-Og' flag".format(self.name)) + raise ConanInvalidConfiguration( + "{} requires a compiler that supports at least C++{}".format(self.name, minimal_cpp_standard)) + + def build(self): + self.run("python --version") + if self.settings.os == "Macos": + self.run("which python") + self.run("scons --version") + self.run( + " ".join([ + "scons", + "-C{}".format(self._source_subfolder), + "-j{}".format(tools.cpu_count()), + "generate_bindings=yes", + "use_custom_api_file=yes", + "bits={}".format(self._bits), + "custom_api_file={}".format(self._custom_api_file), + "headers_dir={}".format(self._headers_dir), + "platform={}".format(self._platform), + "target={}".format(self._target), + "use_llvm={}".format(self._use_llvm), + "use_mingw={}".format(self._use_mingw), + ]) + ) + + def package(self): + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst="include/godot-cpp", src=os.path.join(self._source_subfolder, "include")) + self.copy("*.a", dst="lib", src=os.path.join(self._source_subfolder, "bin")) + self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "bin")) + + def package_info(self): + if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": + self.cpp_info.libs = ["lib{}".format(self._libname)] + else: + self.cpp_info.libs = [self._libname] + + self.cpp_info.includedirs = [ + os.path.join("include", "godot-cpp"), + os.path.join("include", "godot-cpp", "core"), + os.path.join("include", "godot-cpp", "gen"), + ] + + def package_id(self): + if self._target == "release": + self.info.settings.build_type = "Release" + else: + self.info.settings.build_type = "Debug" diff --git a/recipes/godot-cpp/all/test_package/CMakeLists.txt b/recipes/godot-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb623ce6ed58f --- /dev/null +++ b/recipes/godot-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION "3.1") +project("test_package" LANGUAGES CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable("${PROJECT_NAME}" "test_package.cpp") +target_link_libraries("${PROJECT_NAME}" ${CONAN_LIBS}) +set_property(TARGET "${PROJECT_NAME}" PROPERTY CXX_STANDARD "14") diff --git a/recipes/godot-cpp/all/test_package/conanfile.py b/recipes/godot-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4dea15a1318e1 --- /dev/null +++ b/recipes/godot-cpp/all/test_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" + + 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/godot-cpp/all/test_package/test_package.cpp b/recipes/godot-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6128bc4c48cf2 --- /dev/null +++ b/recipes/godot-cpp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() + { + godot::Vector2{1.0, -1.0}; + return 0; + } diff --git a/recipes/godot-cpp/config.yml b/recipes/godot-cpp/config.yml new file mode 100644 index 0000000000000..6d3463978fb93 --- /dev/null +++ b/recipes/godot-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "3.5.1": + folder: all + "3.3.4": + folder: all + "cci.3.2-20200130": + folder: all diff --git a/recipes/godot_headers/all/conandata.yml b/recipes/godot_headers/all/conandata.yml new file mode 100644 index 0000000000000..8764611b2ac9a --- /dev/null +++ b/recipes/godot_headers/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.5.1": + url: "https://github.com/godotengine/godot-headers/archive/godot-3.5.1-stable.tar.gz" + sha256: "1c38268031425a4881c0d6d41926a0f1bf5847f05dc24c29332609e318276b6b" + "3.4.4": + url: "https://github.com/godotengine/godot-headers/archive/godot-3.4.4-stable.tar.gz" + sha256: "bb0eac00a4d5b800a4ca2555d11b4a35981bdb730b630e9bd31a0649fa1d6fd7" + "3.4": + url: "https://github.com/godotengine/godot-headers/archive/refs/tags/godot-3.4-stable.zip" + sha256: "584c8fedb9c521e0f21b37aed60a7bf76f417a196bb79205cf41b4e79a866237" + "3.3.4": + url: "https://github.com/godotengine/godot-headers/archive/godot-3.3.4-stable.tar.gz" + sha256: "14cff754199cc48dcf29b326ad4758c0bc71613acea9942de780815903a0d5a5" + "3.3.2": + url: "https://github.com/godotengine/godot-headers/archive/refs/tags/godot-3.3.2-stable.zip" + sha256: "0297aa9d0eb4374ecb82eb844f588343c6efbc39028473b96de12ca703aa1834" + "3.2.3": + url: "https://github.com/godotengine/godot-headers/archive/refs/tags/godot-3.2.3-stable.zip" + sha256: "91815415a134ec061e1126a78d773bb13b28417f6dff34e02d54a38bf1b7e27d" + "cci.3.2-20200130": + url: "https://github.com/godotengine/godot-headers/archive/ddf67cc7b8274c5fb77a71c828bab2991f1ee12a.zip" + sha256: "d62b1a2ae5b19ba1d116de754efb22c66a4425f31a4887b59249d9c0f073cc48" diff --git a/recipes/godot_headers/all/conanfile.py b/recipes/godot_headers/all/conanfile.py new file mode 100644 index 0000000000000..0a0d46219f9db --- /dev/null +++ b/recipes/godot_headers/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.50.0" + + +class GodotHeadersConan(ConanFile): + name = "godot_headers" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/godotengine/godot_headers" + description = "Godot Native interface headers" + topics = ("game-engine", "game-development") + 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) + + 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")) + copy(self, "api.json", src=self.source_folder, dst=os.path.join(self.package_folder, "res")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] diff --git a/recipes/godot_headers/all/test_package/CMakeLists.txt b/recipes/godot_headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..60556215726fc --- /dev/null +++ b/recipes/godot_headers/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(godot_headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE godot_headers::godot_headers) diff --git a/recipes/godot_headers/all/test_package/conanfile.py b/recipes/godot_headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/godot_headers/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/godot_headers/all/test_package/test_package.c b/recipes/godot_headers/all/test_package/test_package.c new file mode 100644 index 0000000000000..8f2fd7e04e8ff --- /dev/null +++ b/recipes/godot_headers/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + godot_vector2 vector; + return 0; +} diff --git a/recipes/godot_headers/all/test_v1_package/CMakeLists.txt b/recipes/godot_headers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..643dedc50d02a --- /dev/null +++ b/recipes/godot_headers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(godot_headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE godot_headers::godot_headers) diff --git a/recipes/godot_headers/all/test_v1_package/conanfile.py b/recipes/godot_headers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/godot_headers/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/godot_headers/config.yml b/recipes/godot_headers/config.yml new file mode 100644 index 0000000000000..3ded438e58f33 --- /dev/null +++ b/recipes/godot_headers/config.yml @@ -0,0 +1,15 @@ +versions: + "3.5.1": + folder: all + "3.4.4": + folder: all + "3.4": + folder: all + "3.3.4": + folder: all + "3.3.2": + folder: all + "3.2.3": + folder: all + "cci.3.2-20200130": + folder: all diff --git a/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake b/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..17098fdadc87d --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake @@ -0,0 +1,10 @@ +find_package(googleapis CONFIG REQUIRED) +if (NOT ("${googleapis_RES_DIRS_RELEASE}" STREQUAL "")) + set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELEASE}") +elseif (NOT ("${googleapis_RES_DIRS_RELWITHDEBINFO}" STREQUAL "")) + set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELWITHDEBINFO}") +elseif (NOT ("${googleapis_RES_DIRS_MINSIZEREL}" STREQUAL "")) + set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_MINSIZEREL}") +elseif (NOT ("${googleapis_RES_DIRS_DEBUG}" STREQUAL "")) + set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_DEBUG}") +endif () diff --git a/recipes/google-cloud-cpp/2.x/conandata.yml b/recipes/google-cloud-cpp/2.x/conandata.yml new file mode 100644 index 0000000000000..94473c6cb2ac9 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.5.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.5.0.tar.gz" + sha256: "ac93ef722d08bfb220343bde2f633c7c11f15e34ec3ecd0a57dbd3ff729cc3a6" +patches: + "2.5.0": + - patch_file: "patches/2.5.0/001-use-googleapis-conan-package.patch" + patch_description: "Use Conan package for googleapis" + patch_type: conan + - patch_file: "patches/2.5.0/002-interface-library-properties.patch" + patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10636 + patch_description: "Fix problems with INTERFACE proto libraries" + patch_type: backport + - patch_file: "patches/2.5.0/003-use-conan-msvc-runtime.patch" + patch_description: "Let Conan select the MSVC runtime" + patch_type: conan diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py new file mode 100644 index 0000000000000..0da218c665ea2 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -0,0 +1,336 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.56.0" + + +class GoogleCloudCppConan(ConanFile): + name = "google-cloud-cpp" + description = "C++ Client Libraries for Google Cloud Services" + license = "Apache-2.0" + topics = ( + "google", + "cloud", + "google-cloud-storage", + "google-cloud-platform", + "google-cloud-pubsub", + "google-cloud-spanner", + "google-cloud-bigtable", + ) + homepage = "https://github.com/googleapis/google-cloud-cpp" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + short_paths = True + + def export_sources(self): + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.options["protobuf"].shared = True + self.options["googleapis"].shared = True + self.options["grpc-proto"].shared = True + self.options["grpc"].shared = True + + def validate(self): + # As-of 2022-03, google-cloud-cpp only supports "Visual Studio >= 2019", + # and Visual Studio < 2019 is out of mainline support. + # The wikipedia page says this maps to 192* for the MSVC version: + # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B + check_min_vs(self, "192") + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration( + "Recipe not prepared for cross-building (yet)" + ) + + if ( + self.settings.compiler == "clang" + and Version(self.settings.compiler.version) < "6.0" + ): + raise ConanInvalidConfiguration("Clang version must be at least 6.0.") + + if self.settings.compiler.cppstd: + check_min_cppstd(self, 14) + + if ( + self.settings.compiler == "gcc" + and Version(self.settings.compiler.version) < "5.4" + ): + raise ConanInvalidConfiguration("Building requires GCC >= 5.4") + + if self.info.options.shared and \ + (not self.dependencies["protobuf"].options.shared or \ + not self.dependencies["googleapis"].options.shared or \ + not self.dependencies["grpc-proto"].options.shared or \ + not self.dependencies["grpc"].options.shared): + raise ConanInvalidConfiguration( + "If built as shared, protobuf, googleapis, grpc-proto, and grpc must be shared as well." + " Please, use `protobuf/*:shared=True`, `googleapis/*:shared=True`, `grpc-proto/*:shared=True`," + " and `grpc/*:shared=True`", + ) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def requirements(self): + self.requires("protobuf/3.21.9", transitive_headers=True) + self.requires("grpc/1.50.1", transitive_headers=True) + self.requires("nlohmann_json/3.10.0") + self.requires("crc32c/1.1.1") + self.requires("abseil/20220623.0", transitive_headers=True) + self.requires("libcurl/7.88.1") + self.requires("openssl/[>=1.1 <4]") + self.requires("zlib/1.2.13") + # `google-cloud-cpp` contains code generated from the proto files. + # Working with older versions of these protos almost always will fail, as + # at least some of the RPCs included in the GRPC-generator stubs will be + # missing. + # Working with newer versions of these protos almost always will work. There + # are very few breaking changes on the proto files. + self.requires(f"googleapis/{self._GOOGLEAPIS_VERSIONS[self.version]}", transitive_headers=True) + + def build_requirements(self): + # For the grpc-cpp-plugin executable + self.tool_requires("grpc/1.50.1") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_PROJECT_google-cloud-cpp_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + tc.variables["BUILD_TESTING"] = False + tc.variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False + tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) + tc.generate() + VirtualRunEnv(self).generate(scope="build") + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # This was informed by comments in the grpc port. On macOS `Make` will + # run commands via `/bin/sh`. `/bin/sh` is subject to System Integrity + # Protections. In particular, the system will purge the DYLD_LIBRARY_PATH + # enviroment variables: + # https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html + settings_build = getattr(self, "settings_build", self.settings) + if settings_build.os == "Macos": + replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), + "$", + '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" $') + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + _GOOGLEAPIS_VERSIONS = { + "2.5.0": "cci.20221108", + } + + _GA_COMPONENTS_BASE = {"bigquery", "bigtable", "iam", "pubsub", "spanner", "storage"} + _GA_COMPONENTS_VERSION = { + '2.5.0': { + "accessapproval", + "accesscontextmanager", + "apigateway", + "apigeeconnect", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "debugger", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "edgecontainer", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkehub", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "speech", + "storagetransfer", + "talent", + "tasks", + "texttospeech", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", + }, + } + + def _components(self): + result = self._GA_COMPONENTS_BASE + for v in sorted(self._GA_COMPONENTS_VERSION.keys()): + if v > Version(self): + break + result = result.union(self._GA_COMPONENTS_VERSION[v]) + # Some protos do not compile due to inconvenient system macros clashing with proto enum values. + # Protobuf can workaround these problems, but the current version in Conan index (protobuf/3.21.4) + # do not contain the fixes for these cases. + # TODO - review after protobuf >= 3.22.x + result.remove('asset') + result.remove('channel') + result.remove('storagetransfer') + # Some of the macros are platform specific. + if self.settings.os == "Android": + result.remove('accesscontextmanager') + result.remove('talent') + # TODO - certificatemanager crashes the gRPC code generator. Add it back after gRPC >= 1.53.x + result.remove('certificatemanager') + return result + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, path=os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, path=os.path.join(self.package_folder, "lib", "pkgconfig")) + + def _add_proto_component(self, component): + PROTOS_SHARED_REQUIRES=["googleapis::googleapis", "grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"] + self.cpp_info.components[component].requires = PROTOS_SHARED_REQUIRES + self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] + self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + + def _add_grpc_component(self, component, protos, extra=None): + SHARED_REQUIRES=["grpc_utils", "common", "grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf", "abseil::absl_memory"] + self.cpp_info.components[component].requires = (extra or []) + [protos] + SHARED_REQUIRES + self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] + self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + + def package_info(self): + self.cpp_info.components["common"].requires = ["abseil::absl_any", "abseil::absl_flat_hash_map", "abseil::absl_memory", "abseil::absl_optional", "abseil::absl_time"] + self.cpp_info.components["common"].libs = ["google_cloud_cpp_common"] + self.cpp_info.components["common"].names["pkg_config"] = "google_cloud_cpp_common" + + self.cpp_info.components["rest_internal"].requires = ["common", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["rest_internal"].libs = ["google_cloud_cpp_rest_internal"] + self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_common" + + # A small number of gRPC-generated stubs are used directly in the common components + # shared by all gRPC-based libraries. These bust be defined without reference to `grpc_utils`. + GRPC_UTILS_REQUIRED_PROTOS=["iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"] + for component in GRPC_UTILS_REQUIRED_PROTOS: + self._add_proto_component(component) + + self.cpp_info.components["grpc_utils"].requires = GRPC_UTILS_REQUIRED_PROTOS + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"] + self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"] + self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" + + for component in self._components(): + # bigquery proto library predates the adoption of more consistent naming + if component == 'bigquery': + self._add_proto_component("cloud_bigquery_protos") + self._add_grpc_component(component, "cloud_bigquery_protos") + continue + if component == 'dialogflow_es': + self._add_proto_component("cloud_dialogflow_v2_protos") + self._add_grpc_component(component, "cloud_dialogflow_v2_protos") + continue + # `storage` is the only component that does not depend on a matching `*_protos` library + protos=f"{component}_protos" + if component != 'storage' and component not in GRPC_UTILS_REQUIRED_PROTOS: + self._add_proto_component(protos) + # The components in self._GA_COMPONENTS_BASE are hand-crafted and need custom + # definitions (see below) + if component in self._GA_COMPONENTS_BASE: + continue + self._add_grpc_component(component, protos) + + self._add_grpc_component("bigquery", "cloud_bigquery_protos") + self._add_grpc_component("bigtable", "bigtable_protos") + self._add_grpc_component("iam", "iam_protos") + self._add_grpc_component("pubsub", "pubsub_protos", ["abseil::absl_flat_hash_map"]) + self._add_grpc_component("spanner", "spanner_protos", ["abseil::absl_fixed_array", "abseil::absl_numeric", "abseil::absl_strings", "abseil::absl_time"]) + + self.cpp_info.components["storage"].requires = ["rest_internal", "common", "nlohmann_json::nlohmann_json", "abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["storage"].libs = ["google_cloud_cpp_storage"] + self.cpp_info.components["storage"].names["pkg_config"] = "google_cloud_cpp_storage" diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch new file mode 100644 index 0000000000000..44737240ad451 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch @@ -0,0 +1,1279 @@ +diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake +index 366edba..4eb5ea3 100644 +--- a/cmake/CompileProtos.cmake ++++ b/cmake/CompileProtos.cmake +@@ -362,20 +362,10 @@ function (google_cloud_cpp_proto_library libname) + return() + endif () + +- if (${_opt_LOCAL_INCLUDE}) +- google_cloud_cpp_generate_proto( +- proto_sources ${_opt_UNPARSED_ARGUMENTS} LOCAL_INCLUDE +- PROTO_PATH_DIRECTORIES ${_opt_PROTO_PATH_DIRECTORIES}) +- else () +- google_cloud_cpp_generate_proto( +- proto_sources ${_opt_UNPARSED_ARGUMENTS} PROTO_PATH_DIRECTORIES +- ${_opt_PROTO_PATH_DIRECTORIES}) +- endif () +- + add_library(${libname} ${proto_sources}) + set_property(TARGET ${libname} PROPERTY PROTO_SOURCES + ${_opt_UNPARSED_ARGUMENTS}) +- target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc ++ target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc googleapis::googleapis + protobuf::libprotobuf) + # We want to treat the generated code as "system" headers so they get + # ignored by the more aggressive warnings. +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index ad2bd4b..28bf016 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -16,24 +16,6 @@ + + include(GoogleapisConfig) + +-set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL +- "https://github.com/googleapis/googleapis/archive/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" +- "https://storage.googleapis.com/cloud-cpp-community-archive/com_google_googleapis/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" +-) +-set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH +- "${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256}") +-if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL) +- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL +- ${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL}) +-endif () +-if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH) +- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH +- "${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH}") +-endif () +- +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") +- + set(EXTERNAL_GOOGLEAPIS_PROTO_FILES + # cmake-format: sort + "google/api/annotations.proto" +@@ -113,32 +95,6 @@ foreach (file IN LISTS protolists) + endforeach () + endforeach () + +-include(ExternalProject) +- +-externalproject_add( +- googleapis_download +- EXCLUDE_FROM_ALL ON +- PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" +- URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} +- URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH} +- PATCH_COMMAND +- "" +- # ~~~ +- # Scaffolding for patching googleapis after download. For example: +- # PATCH_COMMAND +- # patch +- # -p1 +- # --input=/workspace/external/googleapis.patch +- # NOTE: This should only be used while developing with a new +- # protobuf message. No changes to `PATCH_COMMAND` should ever be +- # committed to the main branch. +- # ~~~ +- CONFIGURE_COMMAND "" +- BUILD_COMMAND "" +- INSTALL_COMMAND "" +- BUILD_BYPRODUCTS ${EXTERNAL_GOOGLEAPIS_BYPRODUCTS} +- LOG_DOWNLOAD OFF) +- + # Sometimes (this happens often with vcpkg) protobuf is installed in a non- + # standard directory. We need to find out where, and then add that directory to + # the search path for protos. +@@ -187,7 +143,6 @@ function (external_googleapis_add_library proto) + endfunction () + + function (external_googleapis_set_version_and_alias short_name) +- add_dependencies("google_cloud_cpp_${short_name}" googleapis_download) + set_target_properties( + "google_cloud_cpp_${short_name}" + PROPERTIES EXPORT_NAME google-cloud-cpp::${short_name} +diff --git a/google/cloud/accessapproval/CMakeLists.txt b/google/cloud/accessapproval/CMakeLists.txt +index 43af932..e297251 100644 +--- a/google/cloud/accessapproval/CMakeLists.txt ++++ b/google/cloud/accessapproval/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accessapproval_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/accesscontextmanager/CMakeLists.txt b/google/cloud/accesscontextmanager/CMakeLists.txt +index 9ff4ce8..3c96472 100644 +--- a/google/cloud/accesscontextmanager/CMakeLists.txt ++++ b/google/cloud/accesscontextmanager/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accesscontextmanager_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/apigateway/CMakeLists.txt b/google/cloud/apigateway/CMakeLists.txt +index 5764bd3..517eb1e 100644 +--- a/google/cloud/apigateway/CMakeLists.txt ++++ b/google/cloud/apigateway/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigateway_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/apigeeconnect/CMakeLists.txt b/google/cloud/apigeeconnect/CMakeLists.txt +index 17bd60f..af353aa 100644 +--- a/google/cloud/apigeeconnect/CMakeLists.txt ++++ b/google/cloud/apigeeconnect/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigeeconnect_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/apikeys/CMakeLists.txt b/google/cloud/apikeys/CMakeLists.txt +index 9359474..6410175 100644 +--- a/google/cloud/apikeys/CMakeLists.txt ++++ b/google/cloud/apikeys/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apikeys_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/appengine/CMakeLists.txt b/google/cloud/appengine/CMakeLists.txt +index 154a058..6136505 100644 +--- a/google/cloud/appengine/CMakeLists.txt ++++ b/google/cloud/appengine/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::appengine_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/artifactregistry/CMakeLists.txt b/google/cloud/artifactregistry/CMakeLists.txt +index 43d5f07..53184d4 100644 +--- a/google/cloud/artifactregistry/CMakeLists.txt ++++ b/google/cloud/artifactregistry/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::artifactregistry_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/asset/CMakeLists.txt b/google/cloud/asset/CMakeLists.txt +index dc33c07..6924523 100644 +--- a/google/cloud/asset/CMakeLists.txt ++++ b/google/cloud/asset/CMakeLists.txt +@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/assuredworkloads/CMakeLists.txt b/google/cloud/assuredworkloads/CMakeLists.txt +index a081c00..01332c6 100644 +--- a/google/cloud/assuredworkloads/CMakeLists.txt ++++ b/google/cloud/assuredworkloads/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::assuredworkloads_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/automl/CMakeLists.txt b/google/cloud/automl/CMakeLists.txt +index c890e5e..f711f54 100644 +--- a/google/cloud/automl/CMakeLists.txt ++++ b/google/cloud/automl/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::automl_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/baremetalsolution/CMakeLists.txt b/google/cloud/baremetalsolution/CMakeLists.txt +index df02616..f4cbee4 100644 +--- a/google/cloud/baremetalsolution/CMakeLists.txt ++++ b/google/cloud/baremetalsolution/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::baremetalsolution_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/batch/CMakeLists.txt b/google/cloud/batch/CMakeLists.txt +index 03a1a3d..9645386 100644 +--- a/google/cloud/batch/CMakeLists.txt ++++ b/google/cloud/batch/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::batch_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/beyondcorp/CMakeLists.txt b/google/cloud/beyondcorp/CMakeLists.txt +index e8eea05..24b9a98 100644 +--- a/google/cloud/beyondcorp/CMakeLists.txt ++++ b/google/cloud/beyondcorp/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::beyondcorp_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/billing/CMakeLists.txt b/google/cloud/billing/CMakeLists.txt +index 54c45e6..4c928e6 100644 +--- a/google/cloud/billing/CMakeLists.txt ++++ b/google/cloud/billing/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::billing_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/binaryauthorization/CMakeLists.txt b/google/cloud/binaryauthorization/CMakeLists.txt +index 9f8cd45..48363e2 100644 +--- a/google/cloud/binaryauthorization/CMakeLists.txt ++++ b/google/cloud/binaryauthorization/CMakeLists.txt +@@ -32,8 +32,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/certificatemanager/CMakeLists.txt b/google/cloud/certificatemanager/CMakeLists.txt +index 84a25b0..f4bae6d 100644 +--- a/google/cloud/certificatemanager/CMakeLists.txt ++++ b/google/cloud/certificatemanager/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::certificatemanager_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/channel/CMakeLists.txt b/google/cloud/channel/CMakeLists.txt +index ed6967b..ac19559 100644 +--- a/google/cloud/channel/CMakeLists.txt ++++ b/google/cloud/channel/CMakeLists.txt +@@ -35,8 +35,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::channel_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/cloudbuild/CMakeLists.txt b/google/cloud/cloudbuild/CMakeLists.txt +index 8f30f40..04d6a82 100644 +--- a/google/cloud/cloudbuild/CMakeLists.txt ++++ b/google/cloud/cloudbuild/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::cloudbuild_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/composer/CMakeLists.txt b/google/cloud/composer/CMakeLists.txt +index cde8542..c9af9d1 100644 +--- a/google/cloud/composer/CMakeLists.txt ++++ b/google/cloud/composer/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::composer_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/connectors/CMakeLists.txt b/google/cloud/connectors/CMakeLists.txt +index aef9110..cfd986f 100644 +--- a/google/cloud/connectors/CMakeLists.txt ++++ b/google/cloud/connectors/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::connectors_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/contactcenterinsights/CMakeLists.txt b/google/cloud/contactcenterinsights/CMakeLists.txt +index 03b74ed..3f8831c 100644 +--- a/google/cloud/contactcenterinsights/CMakeLists.txt ++++ b/google/cloud/contactcenterinsights/CMakeLists.txt +@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/container/CMakeLists.txt b/google/cloud/container/CMakeLists.txt +index 20a6c8b..dedca21 100644 +--- a/google/cloud/container/CMakeLists.txt ++++ b/google/cloud/container/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::container_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/containeranalysis/CMakeLists.txt b/google/cloud/containeranalysis/CMakeLists.txt +index 7548de3..e2486d2 100644 +--- a/google/cloud/containeranalysis/CMakeLists.txt ++++ b/google/cloud/containeranalysis/CMakeLists.txt +@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/datacatalog/CMakeLists.txt b/google/cloud/datacatalog/CMakeLists.txt +index 7e80060..dd20ab2 100644 +--- a/google/cloud/datacatalog/CMakeLists.txt ++++ b/google/cloud/datacatalog/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datacatalog_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/datamigration/CMakeLists.txt b/google/cloud/datamigration/CMakeLists.txt +index ee95f1a..1772e90 100644 +--- a/google/cloud/datamigration/CMakeLists.txt ++++ b/google/cloud/datamigration/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datamigration_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/dataplex/CMakeLists.txt b/google/cloud/dataplex/CMakeLists.txt +index c83e390..079242e 100644 +--- a/google/cloud/dataplex/CMakeLists.txt ++++ b/google/cloud/dataplex/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dataplex_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/dataproc/CMakeLists.txt b/google/cloud/dataproc/CMakeLists.txt +index ed180ca..e8c5912 100644 +--- a/google/cloud/dataproc/CMakeLists.txt ++++ b/google/cloud/dataproc/CMakeLists.txt +@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/datastream/CMakeLists.txt b/google/cloud/datastream/CMakeLists.txt +index 7ecfd1f..2a7c100 100644 +--- a/google/cloud/datastream/CMakeLists.txt ++++ b/google/cloud/datastream/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datastream_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/debugger/CMakeLists.txt b/google/cloud/debugger/CMakeLists.txt +index 8c299f3..3fae60d 100644 +--- a/google/cloud/debugger/CMakeLists.txt ++++ b/google/cloud/debugger/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::debugger_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/deploy/CMakeLists.txt b/google/cloud/deploy/CMakeLists.txt +index 73c0d68..9181cb8 100644 +--- a/google/cloud/deploy/CMakeLists.txt ++++ b/google/cloud/deploy/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::deploy_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/dialogflow_cx/CMakeLists.txt b/google/cloud/dialogflow_cx/CMakeLists.txt +index 90c70e3..4aead59 100644 +--- a/google/cloud/dialogflow_cx/CMakeLists.txt ++++ b/google/cloud/dialogflow_cx/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_cx_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt +index 0ddf345..fad8716 100644 +--- a/google/cloud/dialogflow_es/CMakeLists.txt ++++ b/google/cloud/dialogflow_es/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_es_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/dlp/CMakeLists.txt b/google/cloud/dlp/CMakeLists.txt +index 67c6329..f6eaa27 100644 +--- a/google/cloud/dlp/CMakeLists.txt ++++ b/google/cloud/dlp/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dlp_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/documentai/CMakeLists.txt b/google/cloud/documentai/CMakeLists.txt +index 00bc94b..42fd1e1 100644 +--- a/google/cloud/documentai/CMakeLists.txt ++++ b/google/cloud/documentai/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::documentai_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/edgecontainer/CMakeLists.txt b/google/cloud/edgecontainer/CMakeLists.txt +index 4cacb9a..08a2f2e 100644 +--- a/google/cloud/edgecontainer/CMakeLists.txt ++++ b/google/cloud/edgecontainer/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::edgecontainer_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/eventarc/CMakeLists.txt b/google/cloud/eventarc/CMakeLists.txt +index d5e2854..fe37f94 100644 +--- a/google/cloud/eventarc/CMakeLists.txt ++++ b/google/cloud/eventarc/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::eventarc_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/filestore/CMakeLists.txt b/google/cloud/filestore/CMakeLists.txt +index 1f5a0e8..0ae2d00 100644 +--- a/google/cloud/filestore/CMakeLists.txt ++++ b/google/cloud/filestore/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::filestore_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt +index ec9ebcd..50d9fc7 100644 +--- a/google/cloud/functions/CMakeLists.txt ++++ b/google/cloud/functions/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::functions_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/gameservices/CMakeLists.txt b/google/cloud/gameservices/CMakeLists.txt +index 30d81ff..0b9cf8c 100644 +--- a/google/cloud/gameservices/CMakeLists.txt ++++ b/google/cloud/gameservices/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gameservices_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/gkehub/CMakeLists.txt b/google/cloud/gkehub/CMakeLists.txt +index 1747a18..d71c854 100644 +--- a/google/cloud/gkehub/CMakeLists.txt ++++ b/google/cloud/gkehub/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gkehub_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/grafeas/CMakeLists.txt b/google/cloud/grafeas/CMakeLists.txt +index 2ed9350..33ba5fd 100644 +--- a/google/cloud/grafeas/CMakeLists.txt ++++ b/google/cloud/grafeas/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::grafeas_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/iap/CMakeLists.txt b/google/cloud/iap/CMakeLists.txt +index a22e9b0..4c78edb 100644 +--- a/google/cloud/iap/CMakeLists.txt ++++ b/google/cloud/iap/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iap_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/ids/CMakeLists.txt b/google/cloud/ids/CMakeLists.txt +index 4724bf2..fc73ea3 100644 +--- a/google/cloud/ids/CMakeLists.txt ++++ b/google/cloud/ids/CMakeLists.txt +@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::ids_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/iot/CMakeLists.txt b/google/cloud/iot/CMakeLists.txt +index 3619b82..1874025 100644 +--- a/google/cloud/iot/CMakeLists.txt ++++ b/google/cloud/iot/CMakeLists.txt +@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iot_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/kms/CMakeLists.txt b/google/cloud/kms/CMakeLists.txt +index 14a2ef3..59a3596 100644 +--- a/google/cloud/kms/CMakeLists.txt ++++ b/google/cloud/kms/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::kms_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/language/CMakeLists.txt b/google/cloud/language/CMakeLists.txt +index 123ef3c..add8dbc 100644 +--- a/google/cloud/language/CMakeLists.txt ++++ b/google/cloud/language/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::language_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/managedidentities/CMakeLists.txt b/google/cloud/managedidentities/CMakeLists.txt +index 674ce03..b5e4bfa 100644 +--- a/google/cloud/managedidentities/CMakeLists.txt ++++ b/google/cloud/managedidentities/CMakeLists.txt +@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::managedidentities_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/memcache/CMakeLists.txt b/google/cloud/memcache/CMakeLists.txt +index 8a0ad6b..2fafadc 100644 +--- a/google/cloud/memcache/CMakeLists.txt ++++ b/google/cloud/memcache/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::memcache_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/monitoring/CMakeLists.txt b/google/cloud/monitoring/CMakeLists.txt +index e021974..346a1a6 100644 +--- a/google/cloud/monitoring/CMakeLists.txt ++++ b/google/cloud/monitoring/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::monitoring_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/networkconnectivity/CMakeLists.txt b/google/cloud/networkconnectivity/CMakeLists.txt +index 4ca5e45..ffe44d2 100644 +--- a/google/cloud/networkconnectivity/CMakeLists.txt ++++ b/google/cloud/networkconnectivity/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkconnectivity_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/networkmanagement/CMakeLists.txt b/google/cloud/networkmanagement/CMakeLists.txt +index 3fe12a5..d94db72 100644 +--- a/google/cloud/networkmanagement/CMakeLists.txt ++++ b/google/cloud/networkmanagement/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkmanagement_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/notebooks/CMakeLists.txt b/google/cloud/notebooks/CMakeLists.txt +index 4cc76ea..2508e4b 100644 +--- a/google/cloud/notebooks/CMakeLists.txt ++++ b/google/cloud/notebooks/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::notebooks_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/optimization/CMakeLists.txt b/google/cloud/optimization/CMakeLists.txt +index 474c28a..e37eb3f 100644 +--- a/google/cloud/optimization/CMakeLists.txt ++++ b/google/cloud/optimization/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::optimization_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/orgpolicy/CMakeLists.txt b/google/cloud/orgpolicy/CMakeLists.txt +index b6935e6..8fe4286 100644 +--- a/google/cloud/orgpolicy/CMakeLists.txt ++++ b/google/cloud/orgpolicy/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::orgpolicy_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/osconfig/CMakeLists.txt b/google/cloud/osconfig/CMakeLists.txt +index 7b5dfe5..19f88a1 100644 +--- a/google/cloud/osconfig/CMakeLists.txt ++++ b/google/cloud/osconfig/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::osconfig_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/oslogin/CMakeLists.txt b/google/cloud/oslogin/CMakeLists.txt +index 1092f6f..87410cf 100644 +--- a/google/cloud/oslogin/CMakeLists.txt ++++ b/google/cloud/oslogin/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::oslogin_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/policytroubleshooter/CMakeLists.txt b/google/cloud/policytroubleshooter/CMakeLists.txt +index aa934d5..9f0bb42 100644 +--- a/google/cloud/policytroubleshooter/CMakeLists.txt ++++ b/google/cloud/policytroubleshooter/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::policytroubleshooter_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/privateca/CMakeLists.txt b/google/cloud/privateca/CMakeLists.txt +index 5ba62ac..b47750d 100644 +--- a/google/cloud/privateca/CMakeLists.txt ++++ b/google/cloud/privateca/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::privateca_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/profiler/CMakeLists.txt b/google/cloud/profiler/CMakeLists.txt +index b1388dc..d2fe3b2 100644 +--- a/google/cloud/profiler/CMakeLists.txt ++++ b/google/cloud/profiler/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::profiler_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/pubsublite/CMakeLists.txt b/google/cloud/pubsublite/CMakeLists.txt +index 12b2b33..2ec80d0 100644 +--- a/google/cloud/pubsublite/CMakeLists.txt ++++ b/google/cloud/pubsublite/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::pubsublite_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/recommender/CMakeLists.txt b/google/cloud/recommender/CMakeLists.txt +index b44cd96..26fdfb5 100644 +--- a/google/cloud/recommender/CMakeLists.txt ++++ b/google/cloud/recommender/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::recommender_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/redis/CMakeLists.txt b/google/cloud/redis/CMakeLists.txt +index 9387bbd..c3bbd0e 100644 +--- a/google/cloud/redis/CMakeLists.txt ++++ b/google/cloud/redis/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::redis_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/resourcemanager/CMakeLists.txt b/google/cloud/resourcemanager/CMakeLists.txt +index d445a8f..2689c33 100644 +--- a/google/cloud/resourcemanager/CMakeLists.txt ++++ b/google/cloud/resourcemanager/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::resourcemanager_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/resourcesettings/CMakeLists.txt b/google/cloud/resourcesettings/CMakeLists.txt +index afac58e..c0b4359 100644 +--- a/google/cloud/resourcesettings/CMakeLists.txt ++++ b/google/cloud/resourcesettings/CMakeLists.txt +@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/retail/CMakeLists.txt b/google/cloud/retail/CMakeLists.txt +index cbda24a..da3b066 100644 +--- a/google/cloud/retail/CMakeLists.txt ++++ b/google/cloud/retail/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::retail_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/run/CMakeLists.txt b/google/cloud/run/CMakeLists.txt +index f771798..7906713 100644 +--- a/google/cloud/run/CMakeLists.txt ++++ b/google/cloud/run/CMakeLists.txt +@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::run_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/scheduler/CMakeLists.txt b/google/cloud/scheduler/CMakeLists.txt +index d4e2310..eeaae20 100644 +--- a/google/cloud/scheduler/CMakeLists.txt ++++ b/google/cloud/scheduler/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::scheduler_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/secretmanager/CMakeLists.txt b/google/cloud/secretmanager/CMakeLists.txt +index f33f9bf..949f929 100644 +--- a/google/cloud/secretmanager/CMakeLists.txt ++++ b/google/cloud/secretmanager/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::secretmanager_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/securitycenter/CMakeLists.txt b/google/cloud/securitycenter/CMakeLists.txt +index e482223..bad25ac 100644 +--- a/google/cloud/securitycenter/CMakeLists.txt ++++ b/google/cloud/securitycenter/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::securitycenter_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/servicecontrol/CMakeLists.txt b/google/cloud/servicecontrol/CMakeLists.txt +index b2f6362..c1c55f3 100644 +--- a/google/cloud/servicecontrol/CMakeLists.txt ++++ b/google/cloud/servicecontrol/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicecontrol_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/servicedirectory/CMakeLists.txt b/google/cloud/servicedirectory/CMakeLists.txt +index a66c216..527201a 100644 +--- a/google/cloud/servicedirectory/CMakeLists.txt ++++ b/google/cloud/servicedirectory/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicedirectory_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/servicemanagement/CMakeLists.txt b/google/cloud/servicemanagement/CMakeLists.txt +index 96b1a0b..c9981ae 100644 +--- a/google/cloud/servicemanagement/CMakeLists.txt ++++ b/google/cloud/servicemanagement/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicemanagement_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/serviceusage/CMakeLists.txt b/google/cloud/serviceusage/CMakeLists.txt +index f9b199a..fddb936 100644 +--- a/google/cloud/serviceusage/CMakeLists.txt ++++ b/google/cloud/serviceusage/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::serviceusage_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/shell/CMakeLists.txt b/google/cloud/shell/CMakeLists.txt +index 178b8bc..a7181f6 100644 +--- a/google/cloud/shell/CMakeLists.txt ++++ b/google/cloud/shell/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::shell_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt +index 4cc2e0a..3f52437 100644 +--- a/google/cloud/speech/CMakeLists.txt ++++ b/google/cloud/speech/CMakeLists.txt +@@ -39,8 +39,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::speech_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/storagetransfer/CMakeLists.txt b/google/cloud/storagetransfer/CMakeLists.txt +index fd8a5ae..163e9b4 100644 +--- a/google/cloud/storagetransfer/CMakeLists.txt ++++ b/google/cloud/storagetransfer/CMakeLists.txt +@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::storagetransfer_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/talent/CMakeLists.txt b/google/cloud/talent/CMakeLists.txt +index 574023e..405dc48 100644 +--- a/google/cloud/talent/CMakeLists.txt ++++ b/google/cloud/talent/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::talent_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/tasks/CMakeLists.txt b/google/cloud/tasks/CMakeLists.txt +index 3b5678e..026f9b1 100644 +--- a/google/cloud/tasks/CMakeLists.txt ++++ b/google/cloud/tasks/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tasks_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt +index 0fdc54a..840e8d4 100644 +--- a/google/cloud/texttospeech/CMakeLists.txt ++++ b/google/cloud/texttospeech/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::texttospeech_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/tpu/CMakeLists.txt b/google/cloud/tpu/CMakeLists.txt +index 2666b6b..cdaf519 100644 +--- a/google/cloud/tpu/CMakeLists.txt ++++ b/google/cloud/tpu/CMakeLists.txt +@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tpu_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt +index 99a04f5..80d4c1b 100644 +--- a/google/cloud/trace/CMakeLists.txt ++++ b/google/cloud/trace/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::trace_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/translate/CMakeLists.txt b/google/cloud/translate/CMakeLists.txt +index f8a0394..6a44718 100644 +--- a/google/cloud/translate/CMakeLists.txt ++++ b/google/cloud/translate/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::translate_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/video/CMakeLists.txt b/google/cloud/video/CMakeLists.txt +index b1b2628..df98ae4 100644 +--- a/google/cloud/video/CMakeLists.txt ++++ b/google/cloud/video/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::video_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/videointelligence/CMakeLists.txt b/google/cloud/videointelligence/CMakeLists.txt +index 1963d27..4638ddc 100644 +--- a/google/cloud/videointelligence/CMakeLists.txt ++++ b/google/cloud/videointelligence/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::videointelligence_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/vision/CMakeLists.txt b/google/cloud/vision/CMakeLists.txt +index b23e737..004b803 100644 +--- a/google/cloud/vision/CMakeLists.txt ++++ b/google/cloud/vision/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vision_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/vmmigration/CMakeLists.txt b/google/cloud/vmmigration/CMakeLists.txt +index aa88701..e799a3b 100644 +--- a/google/cloud/vmmigration/CMakeLists.txt ++++ b/google/cloud/vmmigration/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmmigration_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/vmwareengine/CMakeLists.txt b/google/cloud/vmwareengine/CMakeLists.txt +index 55adb2f..79c0f53 100644 +--- a/google/cloud/vmwareengine/CMakeLists.txt ++++ b/google/cloud/vmwareengine/CMakeLists.txt +@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmwareengine_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/vpcaccess/CMakeLists.txt b/google/cloud/vpcaccess/CMakeLists.txt +index 5ce47b7..dc7454e 100644 +--- a/google/cloud/vpcaccess/CMakeLists.txt ++++ b/google/cloud/vpcaccess/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vpcaccess_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/webrisk/CMakeLists.txt b/google/cloud/webrisk/CMakeLists.txt +index 5be0ce7..5d3123f 100644 +--- a/google/cloud/webrisk/CMakeLists.txt ++++ b/google/cloud/webrisk/CMakeLists.txt +@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::webrisk_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/websecurityscanner/CMakeLists.txt b/google/cloud/websecurityscanner/CMakeLists.txt +index e21608e..c95230e 100644 +--- a/google/cloud/websecurityscanner/CMakeLists.txt ++++ b/google/cloud/websecurityscanner/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::websecurityscanner_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") +diff --git a/google/cloud/workflows/CMakeLists.txt b/google/cloud/workflows/CMakeLists.txt +index 76c239a..aef6492 100644 +--- a/google/cloud/workflows/CMakeLists.txt ++++ b/google/cloud/workflows/CMakeLists.txt +@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::workflows_protos) + + include(GoogleCloudCppCommon) + +-set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) + if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch new file mode 100644 index 0000000000000..6800c78c11f3e --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch @@ -0,0 +1,44 @@ +diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake +index 4eb5ea3..9de47cd 100644 +--- a/cmake/CompileProtos.cmake ++++ b/cmake/CompileProtos.cmake +@@ -315,6 +315,10 @@ include(GNUInstallDirs) + + # Install headers for a C++ proto library. + function (google_cloud_cpp_install_proto_library_headers target) ++ get_target_property(type ${target} TYPE) ++ if ("${type}" STREQUAL "INTERFACE_LIBRARY") ++ return() ++ endif () + get_target_property(target_sources ${target} SOURCES) + foreach (header ${target_sources}) + # Skip anything that is not a header file. +@@ -332,6 +336,10 @@ endfunction () + + # Install protos for a C++ proto library. + function (google_cloud_cpp_install_proto_library_protos target source_dir) ++ get_target_property(type ${target} TYPE) ++ if ("${type}" STREQUAL "INTERFACE_LIBRARY") ++ return() ++ endif () + get_target_property(target_protos ${target} PROTO_SOURCES) + foreach (header ${target_protos}) + # Skip anything that is not a header file. +diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt +index fad8716..cc44723 100644 +--- a/google/cloud/dialogflow_es/CMakeLists.txt ++++ b/google/cloud/dialogflow_es/CMakeLists.txt +@@ -35,7 +35,12 @@ endif () + + include(CompileProtos) + add_library(google_cloud_cpp_dialogflow_es_protos INTERFACE) +-external_googleapis_set_version_and_alias(dialogflow_es_protos) ++set_target_properties( ++ google_cloud_cpp_dialogflow_es_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::dialogflow_es_protos) ++add_library(google-cloud-cpp::dialogflow_es_protos ALIAS ++ google_cloud_cpp_dialogflow_es_protos) ++ + target_link_libraries( + google_cloud_cpp_dialogflow_es_protos + PUBLIC diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch new file mode 100644 index 0000000000000..875dd10498af2 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 236c6e1..f961398 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,7 +68,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + endif () + + list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +-include(SelectMSVCRuntime) + + option(GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK + "If enabled, check that the user has defined OPENSSL_ROOT_DIR on macOS" +diff --git a/cmake/GoogleCloudCppCommon.cmake b/cmake/GoogleCloudCppCommon.cmake +index 057fe6b..dbffd7b 100644 +--- a/cmake/GoogleCloudCppCommon.cmake ++++ b/cmake/GoogleCloudCppCommon.cmake +@@ -21,9 +21,6 @@ get_filename_component(GOOGLE_CLOUD_CPP_SUBPROJECT + # Get the destination directories based on the GNU recommendations. + include(GNUInstallDirs) + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + # Enable Werror + include(EnableWerror) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 0cb7a9a..d9016a0 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -14,9 +14,6 @@ + # limitations under the License. + # ~~~ + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + add_executable(gcs2cbt gcs2cbt.cc) + target_link_libraries(gcs2cbt google-cloud-cpp::bigtable + google-cloud-cpp::storage google-cloud-cpp::grpc_utils) +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index 28bf016..c281ce8 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -103,8 +103,6 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(SelectMSVCRuntime) +- + google_cloud_cpp_add_protos_property() + + function (external_googleapis_short_name var proto) diff --git a/recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt b/recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d76b297da5c5 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.10...3.24) +project(google-cloud-cpp-test CXX) + +find_package(google-cloud-cpp CONFIG REQUIRED) + +# There are too many libraries to test them all. We +# should pick what we test with a view to detecting +# the most common packaging problems. + +# Bigtable, Pub/Sub and Spanner have signficant amounts of +# custom code and thus some amount of ad-hoc dependencies on +# absl::* components. +# Storage has custom code and does not depend on gRPC or Protobuf. +# Speech is a good model for most other libraries. +foreach(component IN ITEMS "bigtable" "pubsub" "spanner" "speech" "storage") + add_executable("${component}" "${component}.cpp") + target_compile_features("${component}" PRIVATE cxx_std_14) + target_link_libraries("${component}" google-cloud-cpp::${component}) +endforeach() diff --git a/recipes/google-cloud-cpp/2.x/test_package/bigtable.cpp b/recipes/google-cloud-cpp/2.x/test_package/bigtable.cpp new file mode 100644 index 0000000000000..3c792f63e06bf --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/bigtable.cpp @@ -0,0 +1,16 @@ +#include + +int main(int argc, char *argv[]) { + if (argc != 1) { + std::cerr << "Usage: bigtable\n"; + return 1; + } + auto const project_id = std::string{"test-only-invalid"}; + auto const instance_id = std::string{"test-only-invalid"}; + auto const table_id = std::string{"test-only-invalid"}; + std::cout << "Testing google-cloud-cpp::bigtable library " << google::cloud::version_string() << "\n"; + namespace cbt = ::google::cloud::bigtable; + auto table = cbt::Table( + cbt::MakeDataConnection(), cbt::TableResource(project_id, instance_id, table_id)); + return 0; +} diff --git a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py new file mode 100644 index 0000000000000..a3be7ec5660ae --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py @@ -0,0 +1,37 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import can_run +from conan.tools.env import VirtualRunEnv + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + # Environment so that the compiled test executable can load shared libraries + runenv = VirtualRunEnv(self) + runenv.generate(scope="run") + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not can_run(self): + return + for test in ["bigtable", "pubsub", "spanner", "speech", "storage"]: + cmd = os.path.join(self.cpp.build.bindir, test) + self.run(cmd, env="conanrun") diff --git a/recipes/google-cloud-cpp/2.x/test_package/pubsub.cpp b/recipes/google-cloud-cpp/2.x/test_package/pubsub.cpp new file mode 100644 index 0000000000000..c000cd8a7c940 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/pubsub.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main(int argc, char* argv[]) { + if (argc != 1) { + std::cerr << "Usage: pubsub\n"; + return 1; + } + auto const project_id = std::string{"test-only-invalid"}; + auto const topic_id = std::string{"test-only-invalid"}; + std::cout << "Testing google-cloud-cpp::pubsub library " << google::cloud::version_string() << "\n"; + namespace pubsub = google::cloud::pubsub; + auto publisher = pubsub::Publisher( + pubsub::MakePublisherConnection(pubsub::Topic(project_id, topic_id))); + return 0; +} diff --git a/recipes/google-cloud-cpp/2.x/test_package/spanner.cpp b/recipes/google-cloud-cpp/2.x/test_package/spanner.cpp new file mode 100644 index 0000000000000..77d7f3f6a68ad --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/spanner.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 1) { + std::cerr << "Usage: bigtable\n"; + return 1; + } + auto const project_id = std::string{"test-only-invalid"}; + auto const instance_id = std::string{"test-only-invalid"}; + auto const database_id = std::string{"test-only-invalid"}; + std::cout << "Testing google-cloud-cpp::spanner library " << google::cloud::version_string() << "\n"; + namespace spanner = ::google::cloud::spanner; + auto client = spanner::Client( + spanner::MakeConnection(spanner::Database(project_id, instance_id, database_id))); + return 0; +} diff --git a/recipes/google-cloud-cpp/2.x/test_package/speech.cpp b/recipes/google-cloud-cpp/2.x/test_package/speech.cpp new file mode 100644 index 0000000000000..e05f7ddf8d1b5 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/speech.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char* argv[]) { + if (argc != 1) { + std::cerr << "Usage: speech\n"; + return 1; + } + std::cout << "Testing google-cloud-cpp::speech library " << google::cloud::version_string() << "\n"; + namespace speech = ::google::cloud::speech; + auto client = speech::SpeechClient(speech::MakeSpeechConnection()); + return 0; +} diff --git a/recipes/google-cloud-cpp/2.x/test_package/storage.cpp b/recipes/google-cloud-cpp/2.x/test_package/storage.cpp new file mode 100644 index 0000000000000..ae43da936475d --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/storage.cpp @@ -0,0 +1,18 @@ +#include +#include + +int main(int argc, char* argv[]) { + if (argc != 1) { + std::cerr << "Usage: storage\n"; + return 1; + } + + // Create aliases to make the code easier to read. + namespace gcs = google::cloud::storage; + + // Create a client to communicate with Google Cloud Storage. This client + // uses the default configuration for authentication and project id. + std::cout << "Testing google-cloud-cpp::storage library " << google::cloud::version_string() << "\n"; + auto client = gcs::Client(); + return 0; +} diff --git a/recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt b/recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d63e750dab0a --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10...3.24) +project(google-cloud-cpp-test 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/google-cloud-cpp/2.x/test_v1_package/conanfile.py b/recipes/google-cloud-cpp/2.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7d052b9b26983 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conans import ConanFile, CMake, tools +from conan.tools.build import can_run + + +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 can_run(self): + return + for test in ["bigtable", "pubsub", "spanner", "speech", "storage"]: + cmd = os.path.join("bin", test) + self.run(cmd, run_environment=True) diff --git a/recipes/google-cloud-cpp/all/CMakeLists.txt b/recipes/google-cloud-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..a342eb16dcf1a --- /dev/null +++ b/recipes/google-cloud-cpp/all/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +if(MSVC) + add_definitions("-D_SILENCE_CXX20_REL_OPS_DEPRECATION_WARNING") + add_definitions("-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING") +endif() + +add_subdirectory("source_subfolder") diff --git a/recipes/google-cloud-cpp/all/conandata.yml b/recipes/google-cloud-cpp/all/conandata.yml new file mode 100644 index 0000000000000..a410b93b2e064 --- /dev/null +++ b/recipes/google-cloud-cpp/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "1.26.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.26.1.tar.gz" + sha256: "83108515fc59c72cdb87f178712256f4b0098e1ca5dc6f64c2c20dd2f1e1559d" + "1.27.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.27.0.tar.gz" + sha256: "84a7ac7b63db986bb737462e374c11fc6f35f6020ccaacec1d0e4d61ec929528" + "1.30.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.30.1.tar.gz" + sha256: "b651a58cb44bd715f0cb8e42c7ea58490b3e768a35ede01d798b983eef88e143" + "1.31.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.31.1.tar.gz" + sha256: "dc7cbf95b506a84b48cf71e0462985d262183edeaabdacaaee2109852394a609" + "1.40.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.40.1.tar.gz" + sha256: "fb62f0e7dc964c5d3cd0d85977b85f3e0e7dce97e9029abf9c32ecc29db07043" +patches: + "1.26.1": + - patch_file: "patches/0001-googleapis-folder.patch" + base_path: "source_subfolder" + "1.27.0": + - patch_file: "patches/0001-googleapis-folder.patch" + base_path: "source_subfolder" diff --git a/recipes/google-cloud-cpp/all/conanfile.py b/recipes/google-cloud-cpp/all/conanfile.py new file mode 100644 index 0000000000000..30fac004d5e19 --- /dev/null +++ b/recipes/google-cloud-cpp/all/conanfile.py @@ -0,0 +1,374 @@ +import os +import textwrap +import functools + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class GoogleCloudCppConan(ConanFile): + name = "google-cloud-cpp" + description = "C++ Client Libraries for Google Cloud Services" + license = "Apache-2.0" + topics = "google", "cloud", "google-cloud-storage", "google-cloud-platform", "google-cloud-pubsub", "google-cloud-spanner", "google-cloud-bigtable" + homepage = "https://github.com/googleapis/google-cloud-cpp" + url = "https://github.com/conan-io/conan-center-index" + generators = "cmake", "cmake_find_package_multi", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + short_paths = True + _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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == 'Windows' and self.options.shared: + raise ConanInvalidConfiguration("Fails to compile for Windows as a DLL") + + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Recipe not prepared for cross-building (yet)") + + if tools.Version(self.version) >= "1.30.0": + if self.settings.compiler == 'clang' and tools.Version(self.settings.compiler.version) < "6.0": + raise ConanInvalidConfiguration("Clang version must be at least 6.0.") + + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + if self.settings.compiler == 'gcc' and tools.Version(self.settings.compiler.version) < "5.4": + raise ConanInvalidConfiguration("Building requires GCC >= 5.4") + if self.settings.compiler == 'clang' and tools.Version(self.settings.compiler.version) < "3.8": + raise ConanInvalidConfiguration("Building requires clang >= 3.8") + if self.settings.compiler == 'Visual Studio' and tools.Version(self.settings.compiler.version) < "16": + raise ConanInvalidConfiguration("Building requires VS >= 2019") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def requirements(self): + self.requires('protobuf/3.20.0') + self.requires('grpc/1.45.2') + self.requires('nlohmann_json/3.10.5') + self.requires('crc32c/1.1.2') + self.requires('abseil/20211102.0') + self.requires('libcurl/7.80.0') + self.requires('openssl/1.1.1n') + # TODO: Add googleapis once it is available in CCI (now it is embedded) + + @functools.lru_cache(1) + def _configure_cmake(self): + # Do not build in parallel for certain configurations, it fails writting/reading files at the same time + parallel = not (self.settings.compiler == "Visual Studio" and self.settings.compiler.version == "16" and self.version in ["1.31.1", "1.30.1"]) + cmake = CMake(self, parallel=parallel) + cmake.definitions["BUILD_TESTING"] = 0 + + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False + + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_BIGTABLE"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_BIGQUERY"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_SPANNER"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_STORAGE"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_FIRESTORE"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_PUBSUB"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_IAM"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_LOGGING"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_GENERATOR"] = True + + cmake.configure() + return cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + if tools.Version(self.version) < "1.33.0": + # Do not override CMAKE_CXX_STANDARD if provided + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + textwrap.dedent("""\ + set(CMAKE_CXX_STANDARD + 11 + CACHE STRING "Configure the C++ standard version for all targets.")"""), + textwrap.dedent("""\ + if(NOT "${CMAKE_CXX_STANDARD}") + set(CMAKE_CXX_STANDARD 11 CACHE STRING "Configure the C++ standard version for all targets.") + endif() + """)) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, 'lib', "cmake")) + tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig')) + + def package_info(self): + self.cpp_info.components["common"].requires = ["abseil::absl_any", "abseil::absl_flat_hash_map", "abseil::absl_memory", "abseil::absl_optional", "abseil::absl_time"] + self.cpp_info.components["common"].libs = ["google_cloud_cpp_common"] + self.cpp_info.components["common"].names["pkg_config"] = "google_cloud_cpp_common" + + self.cpp_info.components["experimental-bigquery"].requires = ["grpc_utils", "common", "cloud_bigquery_protos"] + self.cpp_info.components["experimental-bigquery"].libs = ["google_cloud_cpp_bigquery"] + self.cpp_info.components["experimental-bigquery"].names["pkg_config"] = "google_cloud_cpp_bigquery" + + self.cpp_info.components["bigtable"].requires = ["abseil::absl_memory", "bigtable_protos", "common", "grpc_utils", "grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["bigtable"].libs = ["google_cloud_cpp_bigtable"] + self.cpp_info.components["bigtable"].names["pkg_config"] = "google_cloud_cpp_bigtable" + + if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + self.cpp_info.components["experimental-firestore"].requires = ["common"] + self.cpp_info.components["experimental-firestore"].libs = ["google_cloud_cpp_firestore"] + self.cpp_info.components["experimental-firestore"].names["pkg_config"] = "google_cloud_cpp_firestore" + + self.cpp_info.components["bigtable_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "longrunning_operations_protos", "rpc_status_protos", "api_auth_protos"] + self.cpp_info.components["bigtable_protos"].libs = ["google_cloud_cpp_bigtable_protos"] + self.cpp_info.components["bigtable_protos"].names["pkg_config"] = "google_cloud_cpp_bigtable_protos" + + self.cpp_info.components["cloud_bigquery_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "rpc_status_protos", "api_http_protos"] + self.cpp_info.components["cloud_bigquery_protos"].libs = ["google_cloud_cpp_cloud_bigquery_protos"] + self.cpp_info.components["cloud_bigquery_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_bigquery_protos" + + self.cpp_info.components["cloud_speech_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "longrunning_operations_protos", "rpc_status_protos"] + self.cpp_info.components["cloud_speech_protos"].libs = ["google_cloud_cpp_cloud_speech_protos"] + self.cpp_info.components["cloud_speech_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_speech_protos" + + self.cpp_info.components["cloud_texttospeech_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos"] + self.cpp_info.components["cloud_texttospeech_protos"].libs = ["google_cloud_cpp_cloud_texttospeech_protos"] + self.cpp_info.components["cloud_texttospeech_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_texttospeech_protos" + + self.cpp_info.components["iam_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos"] + self.cpp_info.components["iam_protos"].libs = ["google_cloud_cpp_iam_protos"] + self.cpp_info.components["iam_protos"].names["pkg_config"] = "google_cloud_cpp_iam_protos" + + self.cpp_info.components["pubsub_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos"] + self.cpp_info.components["pubsub_protos"].libs = ["google_cloud_cpp_pubsub_protos"] + self.cpp_info.components["pubsub_protos"].names["pkg_config"] = "google_cloud_cpp_pubsub_protos" + + self.cpp_info.components["spanner_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "longrunning_operations_protos", "rpc_status_protos"] + self.cpp_info.components["spanner_protos"].libs = ["google_cloud_cpp_spanner_protos"] + self.cpp_info.components["spanner_protos"].names["pkg_config"] = "google_cloud_cpp_spanner_protos" + + self.cpp_info.components["storage_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos"] + self.cpp_info.components["storage_protos"].libs = ["google_cloud_cpp_storage_protos"] + self.cpp_info.components["storage_protos"].names["pkg_config"] = "google_cloud_cpp_storage_protos" + + self.cpp_info.components["longrunning_operations_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "rpc_status_protos"] + self.cpp_info.components["longrunning_operations_protos"].libs = ["google_cloud_cpp_longrunning_operations_protos"] + self.cpp_info.components["longrunning_operations_protos"].names["pkg_config"] = "google_cloud_cpp_longrunning_operations_protos" + + self.cpp_info.components["api_http_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_http_protos"].libs = ["google_cloud_cpp_api_http_protos"] + self.cpp_info.components["api_http_protos"].names["pkg_config"] = "google_cloud_cpp_api_http_protos" + + self.cpp_info.components["api_annotations_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_http_protos"] + self.cpp_info.components["api_annotations_protos"].libs = ["google_cloud_cpp_api_annotations_protos"] + self.cpp_info.components["api_annotations_protos"].names["pkg_config"] = "google_cloud_cpp_api_annotations_protos" + + self.cpp_info.components["api_auth_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components["api_auth_protos"].libs = ["google_cloud_cpp_api_auth_protos"] + self.cpp_info.components["api_auth_protos"].names["pkg_config"] = "google_cloud_cpp_api_auth_protos" + + self.cpp_info.components["api_client_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_client_protos"].libs = ["google_cloud_cpp_api_client_protos"] + self.cpp_info.components["api_client_protos"].names["pkg_config"] = "google_cloud_cpp_api_client_protos" + + self.cpp_info.components["api_distribution_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_distribution_protos"].libs = ["google_cloud_cpp_api_distribution_protos"] + self.cpp_info.components["api_distribution_protos"].names["pkg_config"] = "google_cloud_cpp_api_distribution_protos" + + self.cpp_info.components["api_field_behavior_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_field_behavior_protos"].libs = ["google_cloud_cpp_api_field_behavior_protos"] + self.cpp_info.components["api_field_behavior_protos"].names["pkg_config"] = "google_cloud_cpp_api_field_behavior_protos" + + self.cpp_info.components["api_label_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_label_protos"].libs = ["google_cloud_cpp_api_label_protos"] + self.cpp_info.components["api_label_protos"].names["pkg_config"] = "google_cloud_cpp_api_label_protos" + + self.cpp_info.components["api_launch_stage_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_launch_stage_protos"].libs = ["google_cloud_cpp_api_launch_stage_protos"] + self.cpp_info.components["api_launch_stage_protos"].names["pkg_config"] = "google_cloud_cpp_api_launch_stage_protos" + + self.cpp_info.components["api_metric_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_launch_stage_protos", "api_label_protos"] + self.cpp_info.components["api_metric_protos"].libs = ["google_cloud_cpp_api_metric_protos"] + self.cpp_info.components["api_metric_protos"].names["pkg_config"] = "google_cloud_cpp_api_metric_protos" + + self.cpp_info.components["api_monitored_resource_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_launch_stage_protos", "api_label_protos"] + self.cpp_info.components["api_monitored_resource_protos"].libs = ["google_cloud_cpp_api_monitored_resource_protos"] + self.cpp_info.components["api_monitored_resource_protos"].names["pkg_config"] = "google_cloud_cpp_api_monitored_resource_protos" + + self.cpp_info.components["api_resource_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_resource_protos"].libs = ["google_cloud_cpp_api_resource_protos"] + self.cpp_info.components["api_resource_protos"].names["pkg_config"] = "google_cloud_cpp_api_resource_protos" + + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_field_behavior_protos", "api_resource_protos", "rpc_status_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].libs = ["google_cloud_cpp_devtools_cloudtrace_v2_trace_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].names["pkg_config"] = "google_cloud_cpp_devtools_cloudtrace_v2_trace_protos" + + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "devtools_cloudtrace_v2_trace_protos", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "rpc_status_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].libs = ["google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].names["pkg_config"] = "google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos" + + cmp_logging_type_type_protos = None + if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + cmp_logging_type_type_protos = "logging_type_protos" + self.cpp_info.components[cmp_logging_type_type_protos].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].libs = ["google_cloud_cpp_logging_type_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].names["pkg_config"] = "google_cloud_cpp_logging_type_protos" + else: + cmp_logging_type_type_protos = "logging_type_type_protos" + self.cpp_info.components[cmp_logging_type_type_protos].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].libs = ["google_cloud_cpp_logging_type_type_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].names["pkg_config"] = "google_cloud_cpp_logging_type_type_protos" + + self.cpp_info.components["logging_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_distribution_protos", "api_field_behavior_protos", "api_metric_protos", "api_monitored_resource_protos", "api_resource_protos", cmp_logging_type_type_protos, "rpc_status_protos"] + self.cpp_info.components["logging_protos"].libs = ["google_cloud_cpp_logging_protos"] + self.cpp_info.components["logging_protos"].names["pkg_config"] = "google_cloud_cpp_logging_protos" + + self.cpp_info.components["monitoring_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_distribution_protos", "api_field_behavior_protos", "api_label_protos", "api_launch_stage_protos", "api_metric_protos", "api_monitored_resource_protos", "api_resource_protos", "rpc_status_protos", "type_calendar_period_protos"] + self.cpp_info.components["monitoring_protos"].libs = ["google_cloud_cpp_monitoring_protos"] + self.cpp_info.components["monitoring_protos"].names["pkg_config"] = "google_cloud_cpp_monitoring_protos" + + self.cpp_info.components["iam_v1_options_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components["iam_v1_options_protos"].libs = ["google_cloud_cpp_iam_v1_options_protos"] + self.cpp_info.components["iam_v1_options_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_options_protos" + + self.cpp_info.components["iam_v1_policy_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "type_expr_protos"] + self.cpp_info.components["iam_v1_policy_protos"].libs = ["google_cloud_cpp_iam_v1_policy_protos"] + self.cpp_info.components["iam_v1_policy_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_policy_protos" + + self.cpp_info.components["iam_v1_iam_policy_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_options_protos", "iam_v1_policy_protos"] + self.cpp_info.components["iam_v1_iam_policy_protos"].libs = ["google_cloud_cpp_iam_v1_iam_policy_protos"] + self.cpp_info.components["iam_v1_iam_policy_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_iam_policy_protos" + + self.cpp_info.components["rpc_error_details_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["rpc_error_details_protos"].libs = ["google_cloud_cpp_rpc_error_details_protos"] + self.cpp_info.components["rpc_error_details_protos"].names["pkg_config"] = "google_cloud_cpp_rpc_error_details_protos" + + self.cpp_info.components["rpc_status_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "rpc_error_details_protos"] + self.cpp_info.components["rpc_status_protos"].libs = ["google_cloud_cpp_rpc_status_protos"] + self.cpp_info.components["rpc_status_protos"].names["pkg_config"] = "google_cloud_cpp_rpc_status_protos" + + self.cpp_info.components["type_calendar_period_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_calendar_period_protos"].libs = ["google_cloud_cpp_type_calendar_period_protos"] + self.cpp_info.components["type_calendar_period_protos"].names["pkg_config"] = "google_cloud_cpp_type_calendar_period_protos" + + self.cpp_info.components["type_color_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_color_protos"].libs = ["google_cloud_cpp_type_color_protos"] + self.cpp_info.components["type_color_protos"].names["pkg_config"] = "google_cloud_cpp_type_color_protos" + + self.cpp_info.components["type_date_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_date_protos"].libs = ["google_cloud_cpp_type_date_protos"] + self.cpp_info.components["type_date_protos"].names["pkg_config"] = "google_cloud_cpp_type_date_protos" + + self.cpp_info.components["type_datetime_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_datetime_protos"].libs = ["google_cloud_cpp_type_datetime_protos"] + self.cpp_info.components["type_datetime_protos"].names["pkg_config"] = "google_cloud_cpp_type_datetime_protos" + + self.cpp_info.components["type_dayofweek_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_dayofweek_protos"].libs = ["google_cloud_cpp_type_dayofweek_protos"] + self.cpp_info.components["type_dayofweek_protos"].names["pkg_config"] = "google_cloud_cpp_type_dayofweek_protos" + + self.cpp_info.components["type_expr_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_expr_protos"].libs = ["google_cloud_cpp_type_expr_protos"] + self.cpp_info.components["type_expr_protos"].names["pkg_config"] = "google_cloud_cpp_type_expr_protos" + + self.cpp_info.components["type_fraction_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_fraction_protos"].libs = ["google_cloud_cpp_type_fraction_protos"] + self.cpp_info.components["type_fraction_protos"].names["pkg_config"] = "google_cloud_cpp_type_fraction_protos" + + self.cpp_info.components["type_interval_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_interval_protos"].libs = ["google_cloud_cpp_type_interval_protos"] + self.cpp_info.components["type_interval_protos"].names["pkg_config"] = "google_cloud_cpp_type_interval_protos" + + self.cpp_info.components["type_latlng_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_latlng_protos"].libs = ["google_cloud_cpp_type_latlng_protos"] + self.cpp_info.components["type_latlng_protos"].names["pkg_config"] = "google_cloud_cpp_type_latlng_protos" + + self.cpp_info.components["type_localized_text_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_localized_text_protos"].libs = ["google_cloud_cpp_type_localized_text_protos"] + self.cpp_info.components["type_localized_text_protos"].names["pkg_config"] = "google_cloud_cpp_type_localized_text_protos" + + self.cpp_info.components["type_money_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_money_protos"].libs = ["google_cloud_cpp_type_money_protos"] + self.cpp_info.components["type_money_protos"].names["pkg_config"] = "google_cloud_cpp_type_money_protos" + + self.cpp_info.components["type_month_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_month_protos"].libs = ["google_cloud_cpp_type_month_protos"] + self.cpp_info.components["type_month_protos"].names["pkg_config"] = "google_cloud_cpp_type_month_protos" + + self.cpp_info.components["type_phone_number_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_phone_number_protos"].libs = ["google_cloud_cpp_type_phone_number_protos"] + self.cpp_info.components["type_phone_number_protos"].names["pkg_config"] = "google_cloud_cpp_type_phone_number_protos" + + self.cpp_info.components["type_postal_address_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_postal_address_protos"].libs = ["google_cloud_cpp_type_postal_address_protos"] + self.cpp_info.components["type_postal_address_protos"].names["pkg_config"] = "google_cloud_cpp_type_postal_address_protos" + + self.cpp_info.components["type_quaternion_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_quaternion_protos"].libs = ["google_cloud_cpp_type_quaternion_protos"] + self.cpp_info.components["type_quaternion_protos"].names["pkg_config"] = "google_cloud_cpp_type_quaternion_protos" + + self.cpp_info.components["type_timeofday_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_timeofday_protos"].libs = ["google_cloud_cpp_type_timeofday_protos"] + self.cpp_info.components["type_timeofday_protos"].names["pkg_config"] = "google_cloud_cpp_type_timeofday_protos" + + self.cpp_info.components["cloud_dialogflow_v2_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "longrunning_operations_protos", "rpc_status_protos", "type_latlng_protos"] + self.cpp_info.components["cloud_dialogflow_v2_protos"].libs = ["google_cloud_cpp_cloud_dialogflow_v2_protos"] + self.cpp_info.components["cloud_dialogflow_v2_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_dialogflow_v2_protos" + + if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "longrunning_operations_protos", "rpc_status_protos", "type_latlng_protos"] + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].libs = ["google_cloud_cpp_cloud_dialogflow_v2beta1_protos"] + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_dialogflow_v2beta1_protos" + + self.cpp_info.components["grpc_utils"].requires = ["abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "rpc_status_protos", "common", "grpc::grpc++", "grpc::grpc"] + self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"] + self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" + + self.cpp_info.components["experimental-iam"].requires = ["grpc_utils", "common", "iam_protos"] + self.cpp_info.components["experimental-iam"].libs = ["google_cloud_cpp_iam"] + self.cpp_info.components["experimental-iam"].names["pkg_config"] = "google_cloud_cpp_iam" + + self.cpp_info.components["experimental-logging"].requires = ["grpc_utils", "common", "logging_protos"] + self.cpp_info.components["experimental-logging"].libs = ["google_cloud_cpp_logging"] + self.cpp_info.components["experimental-logging"].names["pkg_config"] = "google_cloud_cpp_logging" + + self.cpp_info.components["pubsub"].requires = ["grpc_utils", "common", "pubsub_protos", "abseil::absl_flat_hash_map"] + self.cpp_info.components["pubsub"].libs = ["google_cloud_cpp_pubsub"] + self.cpp_info.components["pubsub"].names["pkg_config"] = "google_cloud_cpp_pubsub" + + self.cpp_info.components["spanner"].requires = ["abseil::absl_fixed_array", "abseil::absl_memory", "abseil::absl_numeric", "abseil::absl_strings", "abseil::absl_time", "grpc_utils", "common", "spanner_protos"] + self.cpp_info.components["spanner"].libs = ["google_cloud_cpp_spanner"] + self.cpp_info.components["spanner"].names["pkg_config"] = "google_cloud_cpp_spanner" + + self.cpp_info.components["storage"].requires = ["abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "common", "nlohmann_json::nlohmann_json", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto"] + self.cpp_info.components["storage"].libs = ["google_cloud_cpp_storage"] + self.cpp_info.components["storage"].names["pkg_config"] = "google_cloud_cpp_storage" diff --git a/recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch b/recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch new file mode 100644 index 0000000000000..0fc76cae5ba7c --- /dev/null +++ b/recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch @@ -0,0 +1,22 @@ +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index c3f1ef1..fb65356 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -25,7 +25,7 @@ set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256 + "6762083f829f998c3971efa2ba858c21d4ac4ba77feb9650bad7d358e3add2a5") + + set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${CMAKE_BINARY_DIR}/external/googleapis/src/googleapis_download") ++ "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + + set(EXTERNAL_GOOGLEAPIS_PROTO_FILES + "google/api/http.proto" +@@ -161,7 +161,7 @@ include(ExternalProject) + ExternalProject_Add( + googleapis_download + EXCLUDE_FROM_ALL ON +- PREFIX "${CMAKE_BINARY_DIR}/external/googleapis" ++ PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" + URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} + URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256} + PATCH_COMMAND diff --git a/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt b/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a657ae7a34ce1 --- /dev/null +++ b/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.5) +project(google-cloud-cpp-storage-quickstart CXX C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(google-cloud-cpp REQUIRED) + +# Once the packages are found, define the targets. +add_executable(storage storage.cpp) +target_link_libraries(storage google-cloud-cpp::storage) diff --git a/recipes/google-cloud-cpp/all/test_package/conanfile.py b/recipes/google-cloud-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..39f0d1104e661 --- /dev/null +++ b/recipes/google-cloud-cpp/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "storage") + self.run("%s bucket_name" % bin_path, run_environment=True) diff --git a/recipes/google-cloud-cpp/all/test_package/storage.cpp b/recipes/google-cloud-cpp/all/test_package/storage.cpp new file mode 100644 index 0000000000000..1cd9a7f126f74 --- /dev/null +++ b/recipes/google-cloud-cpp/all/test_package/storage.cpp @@ -0,0 +1,24 @@ +#include "google/cloud/storage/client.h" +#include + +int main(int argc, char* argv[]) { + if (argc != 2) { + std::cerr << "Missing bucket name.\n"; + std::cerr << "Usage: quickstart \n"; + return 1; + } + std::string const bucket_name = argv[1]; + + // Create aliases to make the code easier to read. + namespace gcs = google::cloud::storage; + + // Create a client to communicate with Google Cloud Storage. This client + // uses the default configuration for authentication and project id. + google::cloud::StatusOr client = + gcs::Client::CreateDefaultClient(); + if (!client) { + std::cerr << "Failed to create Storage Client, status=" << client.status() + << "\n"; + return 0; + } +} diff --git a/recipes/google-cloud-cpp/config.yml b/recipes/google-cloud-cpp/config.yml new file mode 100644 index 0000000000000..90eb7ac7b97bc --- /dev/null +++ b/recipes/google-cloud-cpp/config.yml @@ -0,0 +1,13 @@ +versions: + "1.26.1": + folder: "all" + "1.27.0": + folder: "all" + "1.30.1": + folder: "all" + "1.31.1": + folder: "all" + "1.40.1": + folder: "all" + "2.5.0": + folder: "2.x" diff --git a/recipes/googleapis/all/CMakeLists.txt b/recipes/googleapis/all/CMakeLists.txt new file mode 100644 index 0000000000000..a66178c44cba0 --- /dev/null +++ b/recipes/googleapis/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.20) +# CMake >= 3.20 is required. There is a proto with dots in the name 'k8s.min.proto' and CMake fails to generate project files + +project(googleapis) + +find_package(Protobuf REQUIRED CONFIG) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include("${CMAKE_CURRENT_SOURCE_DIR}/generated_targets.cmake") diff --git a/recipes/googleapis/all/conandata.yml b/recipes/googleapis/all/conandata.yml new file mode 100644 index 0000000000000..1c14a1790d586 --- /dev/null +++ b/recipes/googleapis/all/conandata.yml @@ -0,0 +1,53 @@ +# Source code for googleapis is vendorized in (at least) two other libreries: grpc and google-cloud-cpp, +# these libraries use an specific commit from googleapis repository. +# +# - google-cloud-cpp: https://github.com/googleapis/google-cloud-cpp/blob/main/cmake/GoogleapisConfig.cmake +# - grpc: +# (old versions) https://github.com/grpc/grpc/tree/v1.46.3/third_party +# (master branch) https://github.com/grpc/grpc/blob/master/CMakeLists.txt#L347 + +sources: + "cci.20230501": + url: "https://github.com/googleapis/googleapis/archive/2da477b6a72168c65fdb4245530cfa702cc4b029.tar.gz" + sha256: "3e48e5833fcd2e1fcb8b6a5b7a88e18503b670e8636b868cdb5ac32e00fbdafb" + "cci.20221108": + url: "https://github.com/googleapis/googleapis/archive/67b2d7c2fb11188776bc398f02c67fccd8187502.zip" + sha256: "cca450c34e3a8adc03364686d44748f362e4a9af6d3ef32b918f2d5483a3025e" + "cci.20220711": + url: "https://github.com/googleapis/googleapis/archive/220b13e335ea8e0153c84c56a135a19d15384621.zip" + sha256: "0a8aac018f49f8595fc0fbfe53f46d73b2fb42661a425746be802302928e6ac2" + "cci.20220531": # Used by google-cloud-cpp 1.41.0 + url: "https://github.com/googleapis/googleapis/archive/f19049fdd8dfc8b6eba387f4ef6d1d8b4d0103e7.zip" + sha256: "d4ebe22c0a8a884adbeb63f72ab1fee4b15bad0a535de37cabba427a37711ee8" + "cci.20211122": # Used by google-cloud-cpp 1.34.1 + url: "https://github.com/googleapis/googleapis/archive/eddd3d845b5d462c0f2fb2d1bf764b921ae70a93.zip" + sha256: "3d49dc722113100617dc02ee6b3331e61fa28a1616777375553f3d8e25d4e302" + "cci.20210730": # Used by grpc 1.46.3 + url: "https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.zip" + sha256: "c53ef0768e07bd4e2334cdacba8c6672d2252bef307a889f94893652e8e7f3a4" +patches: + "cci.20221108": + - patch_file: "patches/cci.20220711/001-fix-google-api-deps.patch" + patch_description: "Fix incorrect dependency name in BUILD.bazel file" + patch_type: "bugfix" + patch_source: "https://github.com/googleapis/googleapis/commit/5fd35b6a1316570df7f117426ed35af9086e9bda" + "cci.20220711": + - patch_file: "patches/cci.20220711/001-fix-google-api-deps.patch" + patch_description: "Fix incorrect dependency name in BUILD.bazel file" + patch_type: "bugfix" + patch_source: "https://github.com/googleapis/googleapis/commit/5fd35b6a1316570df7f117426ed35af9086e9bda" + "cci.20220531": + - patch_file: "patches/cci.20220531/001-fix-google-api-deps.patch" + patch_description: "Fix incorrect dependency name in BUILD.bazel file" + patch_type: "bugfix" + patch_source: "https://github.com/googleapis/googleapis/commit/5fd35b6a1316570df7f117426ed35af9086e9bda" + "cci.20211122": + - patch_file: "patches/cci.20211122/001-fix-google-api-deps.patch" + patch_description: "Fix incorrect dependency name in BUILD.bazel file" + patch_type: "bugfix" + patch_source: "https://github.com/googleapis/googleapis/commit/5fd35b6a1316570df7f117426ed35af9086e9bda" + "cci.20210730": + - patch_file: "patches/cci.20210730/001-fix-google-api-deps.patch" + patch_description: "Fix incorrect dependency name in BUILD.bazel file" + patch_type: "bugfix" + patch_source: "https://github.com/googleapis/googleapis/commit/5fd35b6a1316570df7f117426ed35af9086e9bda" diff --git a/recipes/googleapis/all/conanfile.py b/recipes/googleapis/all/conanfile.py new file mode 100644 index 0000000000000..c1eae06780f75 --- /dev/null +++ b/recipes/googleapis/all/conanfile.py @@ -0,0 +1,210 @@ +import os +import functools +import glob + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import can_run, check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + + +from helpers import parse_proto_libraries + +required_conan_version = ">=1.53.0" + + +class GoogleAPIS(ConanFile): + name = "googleapis" + package_type = "library" + description = "Public interface definitions of Google APIs" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/googleapis/googleapis" + topics = "google", "protos", "api" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports = "helpers.py" + short_paths = True + + @property + def _protobuf_version(self): + return "3.21.9" + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) + + def 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") + self.options["protobuf"].shared = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/conan-io/conan-center-index/pull/15601#issuecomment-1493086506 + self.requires(f"protobuf/{self._protobuf_version}", transitive_headers=True, transitive_libs=True, run=can_run(self)) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": + raise ConanInvalidConfiguration("Build with GCC 5 fails") + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("Source code generated from protos is missing some export macro") + if self.options.shared and not self.dependencies["protobuf"].options.shared: + raise ConanInvalidConfiguration("If built as shared, protobuf must be shared as well. Please, use `protobuf:shared=True`") + + def build_requirements(self): + if not can_run(self): + self.tool_requires(f"protobuf/{self._protobuf_version}") + + # CMake >= 3.20 is required. There is a proto with dots in the name 'k8s.min.proto' and CMake fails to generate project files + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + @functools.lru_cache(1) + def _parse_proto_libraries(self): + # Generate the libraries to build dynamically + proto_libraries = [] + for filename in glob.iglob(os.path.join(self.source_folder, 'google', '**', 'BUILD.bazel'), recursive=True): + proto_libraries += parse_proto_libraries(filename, self.source_folder, self.output.error) + + for filename in glob.iglob(os.path.join(self.source_folder, 'grafeas', '**', 'BUILD.bazel'), recursive=True): + proto_libraries += parse_proto_libraries(filename, self.source_folder, self.output.error) + + # Validate that all files exist and all dependencies are found + all_deps = [f"{it.qname}:{it.name}" for it in proto_libraries] + all_deps += ["protobuf::libprotobuf"] + for it in proto_libraries: + it.validate(self.source_folder, all_deps) + + # Mark the libraries we need recursively (C++ context) + all_dict = {f"{it.qname}:{it.name}": it for it in proto_libraries} + + def activate_library(proto_library): + proto_library.is_used = True + for it_dep in proto_library.deps: + if it_dep == "protobuf::libprotobuf": + continue + activate_library(all_dict[it_dep]) + + for it in filter(lambda u: u.is_used, proto_libraries): + activate_library(it) + + # Tweaks + def deactivate_library(key): + if key in all_dict: + all_dict[key].is_used = False + # - Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs: GID_MAX + # Patched here: https://github.com/protocolbuffers/protobuf/commit/f138d5de2535eb7dd7c8d0ad5eb16d128ab221fd + # https://github.com/conan-io/conan-center-index/pull/16034/files#r1159042324 + # This was fixed in the v22 release which starts at 4.22 for the C++ library + if Version(self.dependencies["protobuf"].ref.version) <= "3.21.9" and self.settings.os == "Macos" or \ + self.settings.os == "Android": + deactivate_library("//google/storagetransfer/v1:storagetransfer_proto") + deactivate_library("//google/storagetransfer/v1:storagetransfer_cc_proto") + # - Inconvenient macro names from /usr/include/math.h : DOMAIN + if (self.settings.os == "Linux" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++") or \ + is_msvc(self): + deactivate_library("//google/cloud/channel/v1:channel_proto") + deactivate_library("//google/cloud/channel/v1:channel_cc_proto") + # - Inconvenient names for android + if self.settings.os == "Android": + deactivate_library("//google/identity/accesscontextmanager/type:type_proto") + deactivate_library("//google/identity/accesscontextmanager/type:type_cc_proto") + deactivate_library("//google/identity/accesscontextmanager/v1:accesscontextmanager_proto") + deactivate_library("//google/identity/accesscontextmanager/v1:accesscontextmanager_cc_proto") + deactivate_library("//google/devtools/testing/v1:testing_proto") + deactivate_library("//google/devtools/testing/v1:testing_cc_proto") + deactivate_library("//google/devtools/resultstore/v2:resultstore_proto") + deactivate_library("//google/devtools/resultstore/v2:resultstore_cc_proto") + deactivate_library("//google/cloud/talent/v4beta1:talent_proto") + deactivate_library("//google/cloud/talent/v4beta1:talent_cc_proto") + deactivate_library("//google/cloud/talent/v4:talent_proto") + deactivate_library("//google/cloud/talent/v4:talent_cc_proto") + deactivate_library("//google/cloud/asset/v1:asset_proto") + deactivate_library("//google/cloud/asset/v1:asset_cc_proto") + # This fails to build on Windows. It is arguably a missing feature of + # Protobuf. + # https://github.com/protocolbuffers/protobuf/issues/12774 + # Fortunately this library is not used by any downstream packages + # (grpc-protos, or google-cloud-cpp), and it is only "beta" at the + # moment. Simply disable it for now. + deactivate_library("//google/cloud/lifesciences/v2beta:lifesciences_proto") + deactivate_library("//google/cloud/lifesciences/v2beta:lifesciences_cc_proto") + + return proto_libraries + + def build(self): + apply_conandata_patches(self) + proto_libraries = self._parse_proto_libraries() + # Use a separate file to host the generated code, which is generated in full each time. + # This is safe to call multiple times, for example, if you need to invoke `conan build` more than + # once. + with open(os.path.join(self.source_folder, "generated_targets.cmake"), "w", encoding="utf-8") as f: + f.write("# Generated C++ library targets for googleapis\n") + f.write("# DO NOT EDIT - change the generation code in conanfile.py instead\n") + for it in filter(lambda u: u.is_used, proto_libraries): + f.write(it.cmake_content) + cmake = CMake(self) + cmake.configure() + cmake.build() + + _DEPS_FILE = "res/generated_targets.deps" + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*.proto", src=self.source_folder, dst=os.path.join(self.package_folder, "res")) + copy(self, pattern="*.pb.h", src=self.build_folder, dst=os.path.join(self.package_folder, "include")) + + copy(self, pattern="*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, pattern="*.so*", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + + with open(os.path.join(self.package_folder, self._DEPS_FILE), "w", encoding="utf-8") as f: + for lib in filter(lambda u: u.is_used, self._parse_proto_libraries()): + interface = 'LIB' if lib.srcs else 'INTERFACE' + f.write(f"{lib.cmake_target} {interface} {','.join(lib.cmake_deps)}\n") + + def package_info(self): + with open(os.path.join(self.package_folder, self._DEPS_FILE), "r", encoding="utf-8") as f: + for line in f.read().splitlines(): + (name, libtype, deps) = line.rstrip('\n').split(' ') + self.cpp_info.components[name].requires = deps.split(',') + self.cpp_info.components[name].resdirs = ["res"] + if libtype == 'LIB': + self.cpp_info.components[name].libs = [name] + self.cpp_info.components[name].set_property("pkg_config_name", name) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components[name].system_libs.extend(["m"]) diff --git a/recipes/googleapis/all/helpers.py b/recipes/googleapis/all/helpers.py new file mode 100644 index 0000000000000..268a1364e7302 --- /dev/null +++ b/recipes/googleapis/all/helpers.py @@ -0,0 +1,190 @@ +import os +import re +import textwrap + +class _ProtoLibrary: + name: str = None + qname: str = None + srcs: list = None + deps: list = None + is_cc: bool = False + is_used: bool = False + + def __init__(self, is_cc) -> None: + self.srcs = [] + self.deps = set(["protobuf::libprotobuf"]) # Add to all libraries even if not explicitly set + self.is_cc = is_cc + self.is_used = self.is_cc + + def validate(self, source_folder, all_deps): + # Check all files exists + for it in self.srcs: + assert os.path.exists(os.path.join(source_folder, it)), f"{self.qname}:{self.name} - file '{it}' doesn't exist" + # Check all deps exists + for it in self.deps: + assert it in all_deps, f"{self.qname}:{self.name} - dep '{it}' not found" + + def dumps(self): + import json + return json.dumps({ + "name": self.name, + "qname": self.qname, + "srcs": self.srcs, + "deps": list(self.deps), + "is_cc": self.is_cc, + }, indent=4) + + @property + def cmake_target(self): + qname = self.qname + if self.qname.startswith("//"): + qname = qname[2:] + return f'{qname.replace("/", "_")}_{self.name}' + + def shorten_cmake_target(self, cmake_target): + short_name = cmake_target + prefix = "google_" + suffix = "_proto" + if cmake_target.startswith(prefix): + short_name = short_name[len(prefix):] + if short_name.endswith(suffix): + short_name = short_name[:-len(suffix)] + return short_name + + @property + def cmake_deps(self): + def to_cmake_target(item): + if item.startswith("//"): + return item[2:].replace("/", "_").replace(":", "_") + return item + return [to_cmake_target(it) for it in self.deps] + + @property + def cmake_deps_short(self): + return [self.shorten_cmake_target(dep) for dep in self.cmake_deps] + + @property + def cmake_content(self): + cmake_target_short = self.shorten_cmake_target(self.cmake_target) + content = f"\n\n# {self.cmake_target} ({cmake_target_short})\n" + content += "\n".join([f"#{it}" for it in self.dumps().split('\n')]) + content += "\n" + if not self.srcs: + content += textwrap.dedent(f"""\ + add_library({cmake_target_short} INTERFACE) + """) + else: + content += textwrap.dedent(f"""\ + set({cmake_target_short}_PROTOS {" ".join(["${CMAKE_SOURCE_DIR}/"+it for it in self.srcs])}) + add_library({cmake_target_short} ${{{cmake_target_short}_PROTOS}}) + target_include_directories({cmake_target_short} PUBLIC ${{CMAKE_BINARY_DIR}}) + target_compile_features({cmake_target_short} PUBLIC cxx_std_11) + # set project_label to shorten the name of the vcxproj file and cause shorter paths + set_property(TARGET {cmake_target_short} PROPERTY OUTPUT_NAME "{self.cmake_target}") + protobuf_generate(LANGUAGE cpp + TARGET {cmake_target_short} + PROTOS ${{{cmake_target_short}_PROTOS}} + IMPORT_DIRS ${{CMAKE_SOURCE_DIR}} + ) + """) + + if self.deps: + content += textwrap.dedent(f"""\ + target_link_libraries({cmake_target_short} {"PUBLIC" if self.srcs else "INTERFACE"} {" ".join(self.cmake_deps_short)}) + """) + + return content + +def parse_proto_libraries(filename, source_folder, error): + # Generate the libraries to build dynamically + re_name = re.compile(r'name = "(.*)"') + re_srcs_oneline = re.compile(r'srcs = \["(.*)"\],') + re_deps_oneline = re.compile(r'deps = \["(.*)"\],') + re_add_varname = re.compile(r'] \+ (.*),') + + proto_libraries = [] + + basedir = os.path.dirname(filename) + current_folder_str = os.path.relpath(basedir, source_folder).replace('\\', '/') # We need forward slashes because of Windows + proto_library = None + + def parsing_sources(line): + proto_path = os.path.relpath(os.path.join(basedir, line.strip(",").strip("\"")), source_folder).replace('\\', '/') + proto_library.srcs.append(proto_path) + + def parsing_deps(line): + # Remove any comments + line = line.split('#', 1)[0].strip() + line = line.strip(",").strip("\"") + if line == '': + pass + elif line.startswith("@com_google_protobuf//:"): + proto_library.deps.add("protobuf::libprotobuf") + elif line.startswith("@com_google_googleapis//"): + proto_library.deps.add(line[len("@com_google_googleapis"):]) + elif line.startswith(":"): + proto_library.deps.add(f"//{current_folder_str}{line}") + elif line.startswith("//google/"): + proto_library.deps.add(line) + elif line.startswith("//grafeas/"): + proto_library.deps.add(line) + else: + error(f"Unrecognized dep: {line} -- {os.path.relpath(filename, source_folder)}") + + def collecting_items(collection, line): + line = line.strip(",").strip("\"") + collection.append(line) + + with open(filename, 'r', encoding='utf-8') as f: + action = None + parsing_variable = None + variables = {} + for line in f.readlines(): + line = line.strip() + + if line == "proto_library(": + assert proto_library == None + proto_library = _ProtoLibrary(is_cc=False) + elif line == "cc_proto_library(": + assert proto_library == None + proto_library = _ProtoLibrary(is_cc=True) + elif line == '_PROTO_SUBPACKAGE_DEPS = [': + variables["_PROTO_SUBPACKAGE_DEPS"] = [] + parsing_variable = lambda u: collecting_items(variables["_PROTO_SUBPACKAGE_DEPS"], u) + elif parsing_variable != None: + if line == "]": + parsing_variable = None + else: + parsing_variable(line) + elif proto_library != None: + if line.startswith("name ="): + proto_library.name = re_name.search(line).group(1) + proto_library.qname = f"//{current_folder_str}" + elif line.startswith("srcs = "): + m = re_srcs_oneline.search(line) + if m: + parsing_sources(m.group(1)) + else: + action = parsing_sources + elif line.startswith("deps = "): + m = re_deps_oneline.search(line) + if m: + parsing_deps(m.group(1)) + else: + action = parsing_deps + elif line.startswith("visibility = "): + pass + elif line == ")": + proto_libraries.append(proto_library) + proto_library = None + action = None + elif line == "],": + action = None + elif line.startswith("] + "): + varname = re_add_varname.search(line).group(1) + for it in variables[varname]: + action(it) + elif action: + action(line) + + return proto_libraries diff --git a/recipes/googleapis/all/patches/cci.20210730/001-fix-google-api-deps.patch b/recipes/googleapis/all/patches/cci.20210730/001-fix-google-api-deps.patch new file mode 100644 index 0000000000000..dc65e55e9e148 --- /dev/null +++ b/recipes/googleapis/all/patches/cci.20210730/001-fix-google-api-deps.patch @@ -0,0 +1,19 @@ +diff --git a/google/api/BUILD.bazel b/google/api/BUILD.bazel +index ebb9ba8..7188218 100644 +--- a/google/api/BUILD.bazel ++++ b/google/api/BUILD.bazel +@@ -509,12 +509,12 @@ cc_proto_library( + + cc_proto_library( + name = "monitoring_cc_proto", +- deps = ["monitoring_proto"], ++ deps = [":monitoring_proto"], + ) + + cc_proto_library( + name = "quota_cc_proto", +- deps = ["quota_proto"], ++ deps = [":quota_proto"], + ) + + cc_proto_library( diff --git a/recipes/googleapis/all/patches/cci.20211122/001-fix-google-api-deps.patch b/recipes/googleapis/all/patches/cci.20211122/001-fix-google-api-deps.patch new file mode 100644 index 0000000000000..cd41b738015a0 --- /dev/null +++ b/recipes/googleapis/all/patches/cci.20211122/001-fix-google-api-deps.patch @@ -0,0 +1,19 @@ +diff --git a/google/api/BUILD.bazel b/google/api/BUILD.bazel +index ebb9ba8..7188218 100644 +--- a/google/api/BUILD.bazel ++++ b/google/api/BUILD.bazel +@@ -574,12 +574,12 @@ cc_proto_library( + + cc_proto_library( + name = "monitoring_cc_proto", +- deps = ["monitoring_proto"], ++ deps = [":monitoring_proto"], + ) + + cc_proto_library( + name = "quota_cc_proto", +- deps = ["quota_proto"], ++ deps = [":quota_proto"], + ) + + cc_proto_library( diff --git a/recipes/googleapis/all/patches/cci.20220531/001-fix-google-api-deps.patch b/recipes/googleapis/all/patches/cci.20220531/001-fix-google-api-deps.patch new file mode 100644 index 0000000000000..08060c68c114a --- /dev/null +++ b/recipes/googleapis/all/patches/cci.20220531/001-fix-google-api-deps.patch @@ -0,0 +1,19 @@ +diff --git a/google/api/BUILD.bazel b/google/api/BUILD.bazel +index ebb9ba8..7188218 100644 +--- a/google/api/BUILD.bazel ++++ b/google/api/BUILD.bazel +@@ -578,12 +578,12 @@ cc_proto_library( + + cc_proto_library( + name = "monitoring_cc_proto", +- deps = ["monitoring_proto"], ++ deps = [":monitoring_proto"], + ) + + cc_proto_library( + name = "quota_cc_proto", +- deps = ["quota_proto"], ++ deps = [":quota_proto"], + ) + + cc_proto_library( diff --git a/recipes/googleapis/all/patches/cci.20220711/001-fix-google-api-deps.patch b/recipes/googleapis/all/patches/cci.20220711/001-fix-google-api-deps.patch new file mode 100644 index 0000000000000..42682e4d30899 --- /dev/null +++ b/recipes/googleapis/all/patches/cci.20220711/001-fix-google-api-deps.patch @@ -0,0 +1,19 @@ +diff --git a/google/api/BUILD.bazel b/google/api/BUILD.bazel +index ebb9ba8..7188218 100644 +--- a/google/api/BUILD.bazel ++++ b/google/api/BUILD.bazel +@@ -580,12 +580,12 @@ cc_proto_library( + + cc_proto_library( + name = "monitoring_cc_proto", +- deps = ["monitoring_proto"], ++ deps = [":monitoring_proto"], + ) + + cc_proto_library( + name = "quota_cc_proto", +- deps = ["quota_proto"], ++ deps = [":quota_proto"], + ) + + cc_proto_library( diff --git a/recipes/googleapis/all/test_package/CMakeLists.txt b/recipes/googleapis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aba09b40ee6df --- /dev/null +++ b/recipes/googleapis/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(googleapis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE googleapis::googleapis) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/googleapis/all/test_package/conanfile.py b/recipes/googleapis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..58019cb35dee5 --- /dev/null +++ b/recipes/googleapis/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/googleapis/all/test_package/test_package.cpp b/recipes/googleapis/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3b9a08aef74ea --- /dev/null +++ b/recipes/googleapis/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main() { + std::cout << "Conan - test package for googleapis\n"; + + google::bigtable::v2::CheckAndMutateRowRequest request; + request.set_table_name("projects/my-project/instances/my-instance/tables/my-table"); + + std::cout << request.DebugString(); + + return 0; +} diff --git a/recipes/googleapis/all/test_v1_package/CMakeLists.txt b/recipes/googleapis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/googleapis/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/googleapis/all/test_v1_package/conanfile.py b/recipes/googleapis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/googleapis/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/googleapis/config.yml b/recipes/googleapis/config.yml new file mode 100644 index 0000000000000..dd9050334b552 --- /dev/null +++ b/recipes/googleapis/config.yml @@ -0,0 +1,13 @@ +versions: + "cci.20230501": + folder: all + "cci.20221108": + folder: all + "cci.20220711": + folder: all + "cci.20220531": + folder: all + "cci.20211122": + folder: all + "cci.20210730": + folder: all diff --git a/recipes/gperf/all/conandata.yml b/recipes/gperf/all/conandata.yml new file mode 100644 index 0000000000000..1ee999c771b91 --- /dev/null +++ b/recipes/gperf/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.1": + url: "https://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz" + sha256: "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2" +patches: + "3.1": + - patch_file: "patches/0001-remove-register-keyword.patch" diff --git a/recipes/gperf/all/conanfile.py b/recipes/gperf/all/conanfile.py new file mode 100644 index 0000000000000..6527eca9695ee --- /dev/null +++ b/recipes/gperf/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class GperfConan(ConanFile): + name = "gperf" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/gperf" + description = "GNU gperf is a perfect hash function generator" + topics = ("hash-generator", "hash") + + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + self.folders.build = self.folders.source + + def package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "compile")) + ar_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "ar-lib")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.append("CPPFLAGS", "-D_WIN32_WINNT=_WIN32_WINNT_WIN8") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + + #Prevent msys2 from performing erroneous path conversions for C++ files + # when invoking cl.exe as this is already handled by the compile wrapper. + env.define("MSYS2_ARG_CONV_EXCL", "-Tp") + env.vars(self).save_script("conanbuild_gperf_msvc") + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + with chdir(self, self.source_folder): + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/gperf/all/patches/0001-remove-register-keyword.patch b/recipes/gperf/all/patches/0001-remove-register-keyword.patch new file mode 100644 index 0000000000000..8af66429ebaaa --- /dev/null +++ b/recipes/gperf/all/patches/0001-remove-register-keyword.patch @@ -0,0 +1,13 @@ +diff --git a/lib/getline.cc b/lib/getline.cc +index ecc3e85..2d97644 100644 (file) +--- a/lib/getline.cc ++++ b/lib/getline.cc +@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset) + + for (;;) + { +- register int c = getc (stream); ++ int c = getc (stream); + + /* We always want at least one char left in the buffer, since we + always (unless we get an error while reading the first char) diff --git a/recipes/gperf/all/test_package/conanfile.py b/recipes/gperf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..619bde15fb3e9 --- /dev/null +++ b/recipes/gperf/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("gperf --version") diff --git a/recipes/gperf/all/test_v1_package/conanfile.py b/recipes/gperf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..45466856213a3 --- /dev/null +++ b/recipes/gperf/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("gperf --version", run_environment=True) diff --git a/recipes/gperf/config.yml b/recipes/gperf/config.yml new file mode 100644 index 0000000000000..10cce9d257525 --- /dev/null +++ b/recipes/gperf/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1": + folder: "all" diff --git a/recipes/graphene/all/conandata.yml b/recipes/graphene/all/conandata.yml new file mode 100644 index 0000000000000..31d9edff33102 --- /dev/null +++ b/recipes/graphene/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.10.8": + url: "https://github.com/ebassi/graphene/archive/refs/tags/1.10.8.tar.gz" + sha256: "922dc109d2dc5dc56617a29bd716c79dd84db31721a8493a13a5f79109a4a4ed" + "1.10.6": + url: "https://github.com/ebassi/graphene/releases/download/1.10.6/graphene-1.10.6.tar.xz" + sha256: "80ae57723e4608e6875626a88aaa6f56dd25df75024bd16e9d77e718c3560b25" + "1.10.4": + url: "https://github.com/ebassi/graphene/releases/download/1.10.4/graphene-1.10.4.tar.xz" + sha256: "b2a45f230f332478553bd79666eca8df1d1c6dbf208c344ba9f5120592772414" + "1.10.2": + url: "https://github.com/ebassi/graphene/releases/download/1.10.2/graphene-1.10.2.tar.xz" + sha256: "e97de8208f1aac4f913d4fa71ab73a7034e807186feb2abe55876e51c425a7f6" diff --git a/recipes/graphene/all/conanfile.py b/recipes/graphene/all/conanfile.py new file mode 100644 index 0000000000000..c7a67802da5a5 --- /dev/null +++ b/recipes/graphene/all/conanfile.py @@ -0,0 +1,142 @@ +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 copy, get, 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.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class GrapheneConan(ConanFile): + name = "graphene" + description = "A thin layer of graphic data types." + topics = ("graphic", "canvas", "types") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://ebassi.github.io/graphene/" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_glib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_glib": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if self.options.shared and self.options.with_glib: + self.options["glib"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_glib: + self.requires("glib/2.75.2") + + def validate(self): + if self.settings.compiler == "gcc": + if Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("graphene does not support GCC before 5.0") + + if self.options.with_glib: + glib_is_shared = self.dependencies["glib"].options.shared + if self.options.shared and not glib_is_shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if glib_is_shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", default=False): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + meson = MesonToolchain(self) + meson.project_options.update({ + "tests": "false", + "installed_tests": "false", + "gtk_doc": "false", + }) + meson.project_options["gobject_types"] = "true" if self.options.with_glib else "false" + if Version(self.version) < "1.10.4": + meson.project_options["introspection"] = "false" + else: + meson.project_options["introspection"] = "disabled" + meson.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE.txt", 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")) + rm(self, "*.pdb", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.components["graphene-1.0"].set_property("pkg_config_name", "graphene-1.0") + self.cpp_info.components["graphene-1.0"].libs = ["graphene-1.0"] + self.cpp_info.components["graphene-1.0"].includedirs = [os.path.join("include", "graphene-1.0"), os.path.join("lib", "graphene-1.0", "include")] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["graphene-1.0"].system_libs = ["m", "pthread"] + if self.options.with_glib: + self.cpp_info.components["graphene-1.0"].requires = ["glib::gobject-2.0"] + + if self.options.with_glib: + self.cpp_info.components["graphene-gobject-1.0"].set_property("pkg_config_name","graphene-gobject-1.0") + self.cpp_info.components["graphene-gobject-1.0"].includedirs = [os.path.join("include", "graphene-1.0")] + self.cpp_info.components["graphene-gobject-1.0"].requires = ["graphene-1.0", "glib::gobject-2.0"] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/graphene/all/test_package/CMakeLists.txt b/recipes/graphene/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..086ffbaad4058 --- /dev/null +++ b/recipes/graphene/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(graphene CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE graphene::graphene) diff --git a/recipes/graphene/all/test_package/conanfile.py b/recipes/graphene/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c64a877f7976 --- /dev/null +++ b/recipes/graphene/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "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/graphene/all/test_package/test_package.c b/recipes/graphene/all/test_package/test_package.c new file mode 100644 index 0000000000000..77235d38af7ed --- /dev/null +++ b/recipes/graphene/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "graphene.h" + +int main (int argc, char **argv) +{ + graphene_point_t *p = graphene_point_init(graphene_point_alloc(), 3, 4);; + graphene_vec2_t * vect = graphene_vec2_alloc(); + float res; + graphene_point_to_vec2(p, vect); + res = graphene_vec2_length(vect); + graphene_vec2_free(vect); + graphene_point_free(p); + if(res != 5) + { + return 1; + } + return 0; +} diff --git a/recipes/graphene/all/test_v1_package/CMakeLists.txt b/recipes/graphene/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/graphene/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/graphene/all/test_v1_package/conanfile.py b/recipes/graphene/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/graphene/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/graphene/config.yml b/recipes/graphene/config.yml new file mode 100644 index 0000000000000..a08ceb60b7f94 --- /dev/null +++ b/recipes/graphene/config.yml @@ -0,0 +1,9 @@ +versions: + "1.10.8": + folder: "all" + "1.10.6": + folder: "all" + "1.10.4": + folder: "all" + "1.10.2": + folder: "all" diff --git a/recipes/graphthewy/all/conandata.yml b/recipes/graphthewy/all/conandata.yml new file mode 100644 index 0000000000000..74ed70612fdb0 --- /dev/null +++ b/recipes/graphthewy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: "https://github.com/alex-87/graphthewy/archive/v1.1.tar.gz" + sha256: "a47aede1e96d696d3fd33096b477eae7b6b87736f26581b5a6116f16a1374f8c" diff --git a/recipes/graphthewy/all/conanfile.py b/recipes/graphthewy/all/conanfile.py new file mode 100644 index 0000000000000..87bfe2e73e236 --- /dev/null +++ b/recipes/graphthewy/all/conanfile.py @@ -0,0 +1,55 @@ +import os + +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class GraphthewyConan(ConanFile): + name = "graphthewy" + license = "EUPL-1.2" + homepage = "https://github.com/alex-87/graphthewy" + url = "https://github.com/conan-io/conan-center-index" + description = "Simple header-only C++ Library for graph modelling (directed or not) and graph cycle detection. " + topics = ("graph", "algorithm", "modelling", "header-only") + settings = "compiler" + no_copy_source = True + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "gcc": "7", + "clang": "7", + "apple-clang": "10" + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("graphthewy requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration("graphthewy requires C++17, which your compiler does not support.") + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst=os.path.join("include", "graphthewy"), src=self._source_subfolder, keep_path=False) + + def package_id(self): + self.info.header_only() diff --git a/recipes/graphthewy/all/test_package/CMakeLists.txt b/recipes/graphthewy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4f4089cf5e4ec --- /dev/null +++ b/recipes/graphthewy/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) + +set_property(TARGET test_package PROPERTY CXX_STANDARD 17) diff --git a/recipes/graphthewy/all/test_package/conanfile.py b/recipes/graphthewy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1d8d5788c2d75 --- /dev/null +++ b/recipes/graphthewy/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class GraphthewyTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/graphthewy/all/test_package/test_package.cpp b/recipes/graphthewy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..10db9f97c57c1 --- /dev/null +++ b/recipes/graphthewy/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char** arvg) +{ + graphthewy::UndirectedGraph(g); + g.addVertex(1); + g.addVertex(2); + g.addVertex(3); + g.link(1, 2); + g.link(2, 3); + g.link(3, 1); + + graphthewy::GraphCyclegc(g); + + return (gc.hasCycle() == true ? 0 : -1); +} diff --git a/recipes/graphthewy/config.yml b/recipes/graphthewy/config.yml new file mode 100644 index 0000000000000..3f8a45fae5832 --- /dev/null +++ b/recipes/graphthewy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1": + folder: all diff --git a/recipes/greatest/all/conandata.yml b/recipes/greatest/all/conandata.yml new file mode 100644 index 0000000000000..79a70bd7bbd68 --- /dev/null +++ b/recipes/greatest/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.5.0": + url: "https://github.com/silentbicycle/greatest/archive/v1.5.0.tar.gz" + sha256: "33e4c93b1b7f631fec173b8675582d1739b1238a5440b7f4ad50582f0cf38c34" + "1.4.2": + url: "https://github.com/silentbicycle/greatest/archive/v1.4.2.tar.gz" + sha256: "9adea2add921513a9106b7197d82e608f96ad37be808a4def3342cf8e7445998" diff --git a/recipes/greatest/all/conanfile.py b/recipes/greatest/all/conanfile.py new file mode 100644 index 0000000000000..cda1c077e6c1d --- /dev/null +++ b/recipes/greatest/all/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, tools + + +class GreatestConan(ConanFile): + name = "greatest" + description = "A C testing library in 1 file. No dependencies, no dynamic allocation." + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/silentbicycle/greatest" + topics = ("testing", "testing-framework", "unit-testing", "header-only") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("greatest.h", dst="include", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/greatest/all/test_package/CMakeLists.txt b/recipes/greatest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a5ffd526aaea7 --- /dev/null +++ b/recipes/greatest/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.c) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/greatest/all/test_package/conanfile.py b/recipes/greatest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/greatest/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/greatest/all/test_package/test_package.c b/recipes/greatest/all/test_package/test_package.c new file mode 100644 index 0000000000000..85428b5278b3a --- /dev/null +++ b/recipes/greatest/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include +#include +#include + +#include "greatest.h" + +TEST standalone_test(void) { + ASSERT(1>0); +} + + +/* Add all the definitions that need to be in the test runner's main file. */ +GREATEST_MAIN_DEFS(); + +int main(int argc, char **argv) { + GREATEST_MAIN_BEGIN(); /* command-line arguments, initialization. */ + RUN_TEST(standalone_test); + + GREATEST_MAIN_END(); /* display results */ +} + diff --git a/recipes/greatest/config.yml b/recipes/greatest/config.yml new file mode 100644 index 0000000000000..e11ce33fecb95 --- /dev/null +++ b/recipes/greatest/config.yml @@ -0,0 +1,5 @@ +versions: + "1.5.0": + folder: all + "1.4.2": + folder: all diff --git a/recipes/greg7mdp-gtl/all/conandata.yml b/recipes/greg7mdp-gtl/all/conandata.yml new file mode 100644 index 0000000000000..c22694a6e750c --- /dev/null +++ b/recipes/greg7mdp-gtl/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.1.8": + url: "https://github.com/greg7mdp/gtl/archive/v1.1.8.tar.gz" + sha256: "6bda4c07bd966a88740ee07e3df23863a93d7b5365e0eea7f13cde9eda961b86" + "1.1.5": + url: "https://github.com/greg7mdp/gtl/archive/v1.1.5.tar.gz" + sha256: "2d943d2ccc33c6c662918efc51782dac414354a1458441f16041a98eec164bda" + "1.1.4": + url: "https://github.com/greg7mdp/gtl/archive/v1.1.4.tar.gz" + sha256: "b51b9951d11fb73ed22360a96a3f6c691c15202c3b14c79dcdd498da80b6502d" + "1.1.3": + url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.1.3.tar.gz" + sha256: "c667690eeecf37f660d8a61bca1076e845154bc535c44ec0d2404c04c66ae228" + "1.1.2": + url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.1.2.tar.gz" + sha256: "22ac9fb43608c7ddccb983096f5dadb036e5d3122d9194cdb42fee67d754c552" diff --git a/recipes/greg7mdp-gtl/all/conanfile.py b/recipes/greg7mdp-gtl/all/conanfile.py new file mode 100644 index 0000000000000..511f3700cda78 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class Greg7mdpGtlConan(ConanFile): + name = "greg7mdp-gtl" + description = "Greg's Template Library of useful classes." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/greg7mdp/gtl" + topics = ("bitset", "memoize", "containers", "bitvector", "unordered-set", "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 { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "10", + "apple-clang": "10", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.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(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "gtl") + self.cpp_info.set_property("cmake_target_name", "gtl::gtl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "gtl" + self.cpp_info.filenames["cmake_find_package_multi"] = "gtl" + self.cpp_info.names["cmake_find_package"] = "gtl" + self.cpp_info.names["cmake_find_package_multi"] = "gtl" diff --git a/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt b/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4de04c5c56508 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(gtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gtl::gtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/greg7mdp-gtl/all/test_package/conanfile.py b/recipes/greg7mdp-gtl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/greg7mdp-gtl/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/greg7mdp-gtl/all/test_package/test_package.cpp b/recipes/greg7mdp-gtl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..543ef825d77e7 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +// this code is referred from README.md of https://github.com/greg7mdp/gtl +#include +#include +#include + +using gtl::flat_hash_map; + +int main() { + // Create an unordered_map of three strings (that map to strings) + flat_hash_map email = + { + { "tom", "tom@gmail.com"}, + { "jeff", "jk@gmail.com"}, + { "jim", "jimg@microsoft.com"} + }; + + // Iterate and print keys and values + for (const auto& n : email) + std::cout << n.first << "'s email is: " << n.second << "\n"; + + // Add a new entry + email["bill"] = "bg@whatever.com"; + + // and print it + std::cout << "bill's email is: " << email["bill"] << "\n"; + + return 0; +} diff --git a/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt b/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9652e22fc19d5 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/greg7mdp-gtl/all/test_v1_package/conanfile.py b/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/greg7mdp-gtl/config.yml b/recipes/greg7mdp-gtl/config.yml new file mode 100644 index 0000000000000..cd16082304dc7 --- /dev/null +++ b/recipes/greg7mdp-gtl/config.yml @@ -0,0 +1,11 @@ +versions: + "1.1.8": + folder: all + "1.1.5": + folder: all + "1.1.4": + folder: all + "1.1.3": + folder: all + "1.1.2": + folder: all diff --git a/recipes/grpc-proto/all/CMakeLists.txt b/recipes/grpc-proto/all/CMakeLists.txt new file mode 100644 index 0000000000000..bdbe441b33bae --- /dev/null +++ b/recipes/grpc-proto/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.4) + +project(grpc-proto) + +find_package(Protobuf REQUIRED CONFIG) +find_package(googleapis REQUIRED CONFIG) + +set(IMPORT_DIRS ${CMAKE_SOURCE_DIR} ${GOOGLEAPIS_PROTO_DIRS}) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) diff --git a/recipes/grpc-proto/all/conandata.yml b/recipes/grpc-proto/all/conandata.yml new file mode 100644 index 0000000000000..d933b0654e5f3 --- /dev/null +++ b/recipes/grpc-proto/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20220627": + url: "https://github.com/grpc/grpc-proto/archive/d653c6d98105b2af937511aa6e46610c7e677e6e.zip" + sha256: "365c0c8d9ae90aa11a8bd7fa870d8962a13600cfc851405acd5327907f9f4c56" + "cci.20211106": # Synced here https://github.com/grpc/grpc/pull/27957 + url: "https://github.com/grpc/grpc-proto/archive/8e3fec8612bc0708e857950dccadfd5063703e04.zip" + sha256: "8675b46d7997f9b6b80b37e8c30c359e0f919632ca3d8d6076944c7893c2d4cf" diff --git a/recipes/grpc-proto/all/conanfile.py b/recipes/grpc-proto/all/conanfile.py new file mode 100644 index 0000000000000..5ab0a942ba98e --- /dev/null +++ b/recipes/grpc-proto/all/conanfile.py @@ -0,0 +1,144 @@ +import functools +import os + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import can_run, check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import get, collect_libs, copy +from conan.tools.scm import Version + +from helpers import parse_proto_libraries + +required_conan_version = ">=1.53.0" + + +class GRPCProto(ConanFile): + name = "grpc-proto" + package_type = "library" + description = "gRPC-defined protobufs for peripheral services such as health checking, load balancing, etc" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/grpc/grpc-proto" + topics = "google", "protos", "api" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports = "helpers.py" + + 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": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if Version(conan_version) < "2.0.0": + self.options["protobuf"].shared = True + self.options["googleapis"].shared = True + else: + self.options["protobuf/*"].shared = True + self.options["googleapis/*"].shared = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # protobuf symbols are exposed from generated structures + # https://github.com/conan-io/conan-center-index/pull/16185#issuecomment-1501174215 + self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("googleapis/cci.20230501") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + if self.options.shared and \ + not (self.dependencies["protobuf"].options.shared and self.dependencies["googleapis"].options.shared): + raise ConanInvalidConfiguration( + "If built as shared, protobuf and googleapis must be shared as well. " + "Please, use `protobuf:shared=True` and `googleapis:shared=True`" + ) + + def build_requirements(self): + if not can_run(self): + self.tool_requires("protobuf/3.21.9") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) + googleapis_resdirs = self.dependencies["googleapis"].cpp_info.aggregated_components().resdirs + tc.cache_variables["GOOGLEAPIS_PROTO_DIRS"] = ";".join([p.replace("\\", "/") for p in googleapis_resdirs]) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + @functools.lru_cache(1) + def _parse_proto_libraries(self): + # Generate the libraries to build dynamically + proto_libraries = parse_proto_libraries(os.path.join(self.source_folder, 'BUILD.bazel'), self.source_folder, self.output.error) + + # Validate that all files exist and all dependencies are found + all_deps = [it.cmake_target for it in proto_libraries] + all_deps += ["googleapis::googleapis", "protobuf::libprotobuf"] + for it in proto_libraries: + it.validate(self.source_folder, all_deps) + + # Mark the libraries we need recursively (C++ context) + all_dict = {it.cmake_target: it for it in proto_libraries} + def activate_library(proto_library): + proto_library.is_used = True + for it_dep in proto_library.deps: + if it_dep in ["googleapis::googleapis", "protobuf::libprotobuf"]: + continue + activate_library(all_dict[it_dep]) + + for it in filter(lambda u: u.is_used, proto_libraries): + activate_library(it) + + return proto_libraries + + def build(self): + copy(self, "CMakeLists.txt", src=os.path.join(self.source_folder, os.pardir), dst=self.source_folder) + proto_libraries = self._parse_proto_libraries() + with open(os.path.join(self.source_folder, "CMakeLists.txt"), "a", encoding="utf-8") as f: + for it in filter(lambda u: u.is_used, proto_libraries): + f.write(it.cmake_content) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*.proto", src=self.source_folder, dst=os.path.join(self.package_folder, "res")) + copy(self, pattern="*.pb.h", src=self.build_folder, dst=os.path.join(self.package_folder, "include")) + + copy(self, pattern="*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, pattern="*.so*", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + + def package_info(self): + # We are not creating components, we can just collect the libraries + self.cpp_info.libs = collect_libs(self) + self.cpp_info.resdirs = ["res"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m"]) diff --git a/recipes/grpc-proto/all/helpers.py b/recipes/grpc-proto/all/helpers.py new file mode 100644 index 0000000000000..85d23a77ff1de --- /dev/null +++ b/recipes/grpc-proto/all/helpers.py @@ -0,0 +1,151 @@ +import os +import re +import textwrap + + +def grpc_target_name(internal_name): + return f"grpc_{internal_name}" + + +class _ProtoLibrary: + name: str = None + srcs: list = None + deps: list = None + is_used: bool = False + + def __init__(self) -> None: + self.srcs = [] + self.deps = set(["protobuf::libprotobuf"]) # Add to all libraries even if not explicitly set + self.is_used = True + + def validate(self, source_folder, all_deps): + # Check all files exists + for it in self.srcs: + assert os.path.exists(os.path.join(source_folder, it)), f"{self.name} - file '{it}' doesn't exist" + # Check all deps exists + for it in self.deps: + assert it in all_deps, f"{self.name} - dep '{it}' not found" + + def dumps(self): + import json + return json.dumps({ + "name": self.name, + "srcs": self.srcs, + "deps": list(self.deps), + }, indent=4) + + @property + def cmake_target(self): + return grpc_target_name(self.name) + + @property + def cmake_deps(self): + def to_cmake_target(item): + if item.startswith("//"): + return item[2:].replace("/", "_").replace(":", "_") + return item + return [to_cmake_target(it) for it in self.deps] + + @property + def cmake_content(self): + content = f"\n\n# {self.cmake_target}\n" + content += "\n".join([f"#{it}" for it in self.dumps().split('\n')]) + content += "\n" + if not self.srcs: + content += textwrap.dedent(f"""\ + add_library({self.cmake_target} INTERFACE) + """) + else: + content += textwrap.dedent(f"""\ + set({self.cmake_target}_PROTOS {" ".join(["${CMAKE_SOURCE_DIR}/"+it for it in self.srcs])}) + add_library({self.cmake_target} ${{{self.cmake_target}_PROTOS}}) + target_include_directories({self.cmake_target} PUBLIC ${{CMAKE_BINARY_DIR}}) + target_compile_features({self.cmake_target} PUBLIC cxx_std_11) + protobuf_generate(LANGUAGE cpp + TARGET {self.cmake_target} + PROTOS ${{{self.cmake_target}_PROTOS}} + IMPORT_DIRS ${{IMPORT_DIRS}} + ) + """) + + if self.deps: + content += textwrap.dedent(f"""\ + target_link_libraries({self.cmake_target} {"PUBLIC" if self.srcs else "INTERFACE"} {" ".join(self.cmake_deps)}) + """) + + return content + + +def parse_proto_libraries(filename, source_folder, error): + # Generate the libraries to build dynamically + re_name = re.compile(r'name = "(.*)"') + re_srcs_oneline = re.compile(r'srcs = \["(.*)"\],') + re_deps_oneline = re.compile(r'deps = \["(.*)"\],') + re_add_varname = re.compile(r'] \+ (.*),') + + proto_libraries = [] + + basedir = os.path.dirname(filename) + proto_library = None + + def parsing_sources(line): + proto_path = os.path.relpath(os.path.join(basedir, line.strip(",").strip("\"")), source_folder).replace('\\', '/') + proto_library.srcs.append(proto_path) + + def parsing_deps(line): + line = line.strip(",").strip("\"") + if line.startswith("@com_google_protobuf//:"): + proto_library.deps.add("protobuf::libprotobuf") + elif line.startswith("@com_google_googleapis//"): + proto_library.deps.add("googleapis::googleapis") + elif line.startswith(":"): + proto_library.deps.add(grpc_target_name(line[1:])) + else: + error(f"Unrecognized dep: {line} -- {os.path.relpath(filename, source_folder)}") + + with open(filename, 'r') as f: + action = None + parsing_variable = None + variables = {} + for line in f.readlines(): + line = line.strip() + + if line == "proto_library(": + assert proto_library == None + proto_library = _ProtoLibrary() + elif parsing_variable != None: + if line == "]": + parsing_variable = None + else: + parsing_variable(line) + elif proto_library != None: + if line.startswith("name ="): + proto_library.name = re_name.search(line).group(1) + elif line.startswith("srcs = "): + m = re_srcs_oneline.search(line) + if m: + parsing_sources(m.group(1)) + else: + action = parsing_sources + elif line.startswith("deps = "): + m = re_deps_oneline.search(line) + if m: + parsing_deps(m.group(1)) + else: + action = parsing_deps + elif line.startswith("visibility = "): + pass + elif line == ")": + proto_libraries.append(proto_library) + proto_library = None + action = None + elif line == "],": + action = None + elif line.startswith("] + "): + varname = re_add_varname.search(line).group(1) + for it in variables[varname]: + action(it) + elif action: + action(line) + + return proto_libraries diff --git a/recipes/grpc-proto/all/test_package/CMakeLists.txt b/recipes/grpc-proto/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3ea2dba3ece4d --- /dev/null +++ b/recipes/grpc-proto/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(grpc-proto REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE grpc-proto::grpc-proto) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/grpc-proto/all/test_package/conanfile.py b/recipes/grpc-proto/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3dd9c60ba6118 --- /dev/null +++ b/recipes/grpc-proto/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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 = "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/grpc-proto/all/test_package/test_package.cpp b/recipes/grpc-proto/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..781e968605dab --- /dev/null +++ b/recipes/grpc-proto/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include "grpc/health/v1/health.pb.h" + +int main() { + std::cout << "Conan - test package for grpc-proto\n"; + + grpc::health::v1::HealthCheckResponse h; + h.set_status(::grpc::health::v1::HealthCheckResponse_ServingStatus::HealthCheckResponse_ServingStatus_NOT_SERVING); + + std::cout << h.DebugString(); + + return 0; +} diff --git a/recipes/grpc-proto/all/test_v1_package/CMakeLists.txt b/recipes/grpc-proto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..02d1682084fb5 --- /dev/null +++ b/recipes/grpc-proto/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_v1_package 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/grpc-proto/all/test_v1_package/conanfile.py b/recipes/grpc-proto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..85f1fc3729bb9 --- /dev/null +++ b/recipes/grpc-proto/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/grpc-proto/config.yml b/recipes/grpc-proto/config.yml new file mode 100644 index 0000000000000..89d36274b28d4 --- /dev/null +++ b/recipes/grpc-proto/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220627": + folder: all + "cci.20211106": + folder: all diff --git a/recipes/grpc/all/cmake/grpc_plugin_template.cmake.in b/recipes/grpc/all/cmake/grpc_plugin_template.cmake.in new file mode 100644 index 0000000000000..4685c5c34b8fc --- /dev/null +++ b/recipes/grpc/all/cmake/grpc_plugin_template.cmake.in @@ -0,0 +1,31 @@ +if(NOT TARGET @target_name@) + if(CMAKE_CROSSCOMPILING) + find_program(@find_program_variable@ + NAMES @executable_name@ + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(@find_program_variable@ + NAMES @executable_name@ + PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/" + NO_DEFAULT_PATH + ) + endif() + # TODO: In conan v2 with CMakeToolchain, can be replaced by: + # find_program(@find_program_variable@ NAMES @executable_name@)) + # # Nice enough to handle grpc not in build_requires for native build + # if(NOT @find_program_variable@ AND NOT CMAKE_CROSSCOMPILING) + # find_program(@find_program_variable@ + # NAMES @executable_name@ + # PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/" + # NO_DEFAULT_PATH + # ) + # endif() + + if(@find_program_variable@) + get_filename_component(@find_program_variable@ "${@find_program_variable@}" ABSOLUTE) + add_executable(@target_name@ IMPORTED) + set_property(TARGET @target_name@ PROPERTY IMPORTED_LOCATION ${@find_program_variable@}) + endif() +endif() diff --git a/recipes/grpc/all/conan_cmake_project_include.cmake b/recipes/grpc/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..0036126a38780 --- /dev/null +++ b/recipes/grpc/all/conan_cmake_project_include.cmake @@ -0,0 +1,18 @@ +find_package(grpc-proto CONFIG REQUIRED) +find_package(googleapis CONFIG REQUIRED) + +set(googleapis_RES_DIRS + $<$:${googleapis_RES_DIRS_RELEASE}> + $<$:${googleapis_RES_DIRS_RELWITHDEBINFO}> + $<$:${googleapis_RES_DIRS_MINSIZEREL}> + $<$:${googleapis_RES_DIRS_DEBUG}>) +set(grpc-proto_RES_DIRS + $<$:${grpc-proto_RES_DIRS_RELEASE}> + $<$:${grpc-proto_RES_DIRS_RELWITHDEBINFO}> + $<$:${grpc-proto_RES_DIRS_MINSIZEREL}> + $<$:${grpc-proto_RES_DIRS_DEBUG}>) + +# TODO: move to a patch? It avoids link errors while resolving abseil symbols with gcc +if (TARGET check_epollexclusive) + set_target_properties(check_epollexclusive PROPERTIES LINKER_LANGUAGE CXX) +endif() diff --git a/recipes/grpc/all/conandata.yml b/recipes/grpc/all/conandata.yml new file mode 100644 index 0000000000000..80e0a549aa77c --- /dev/null +++ b/recipes/grpc/all/conandata.yml @@ -0,0 +1,29 @@ +sources: + "1.50.1": + url: "https://github.com/grpc/grpc/archive/v1.50.1.tar.gz" + sha256: "fb1ed98eb3555877d55eb2b948caca44bc8601c6704896594de81558639709ef" + "1.50.0": + url: "https://github.com/grpc/grpc/archive/v1.50.0.tar.gz" + sha256: "76900ab068da86378395a8e125b5cc43dfae671e09ff6462ddfef18676e2165a" + "1.47.1": + url: "https://github.com/grpc/grpc/archive/v1.47.1.tar.gz" + sha256: "ba7c36989ad8a52c813adeebb0c65869283448f496dbb2868c75f69941dec6a9" + "1.46.3": + url: "https://github.com/grpc/grpc/archive/refs/tags/v1.46.3.tar.gz" + sha256: "d6cbf22cb5007af71b61c6be316a79397469c58c82a942552a62e708bce60964" +patches: + "1.50.1": + - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" + - patch_file: "patches/v1.50.x/002-consume-protos-from-requirements.patch" + "1.50.0": + - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" + - patch_file: "patches/v1.50.x/002-consume-protos-from-requirements.patch" + "1.48.0": + - patch_file: "patches/v1.48.x/001-disable-cppstd-override.patch" + - patch_file: "patches/v1.48.x/002-consume-protos-from-requirements.patch" + "1.47.1": + - patch_file: "patches/v1.47.x/001-disable-cppstd-override.patch" + - patch_file: "patches/v1.47.x/002-consume-protos-from-requirements.patch" + "1.46.3": + - patch_file: "patches/v1.46.x/001-disable-cppstd-override.patch" + - patch_file: "patches/v1.46.x/002-consume-protos-from-requirements.patch" diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py new file mode 100644 index 0000000000000..bdae7abad302a --- /dev/null +++ b/recipes/grpc/all/conanfile.py @@ -0,0 +1,444 @@ +import os +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run, cross_building, valid_min_cppstd, check_min_cppstd +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +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",) + + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "codegen": [True, False], + "csharp_ext": [True, False], + "cpp_plugin": [True, False], + "csharp_plugin": [True, False], + "node_plugin": [True, False], + "objective_c_plugin": [True, False], + "php_plugin": [True, False], + "python_plugin": [True, False], + "ruby_plugin": [True, False], + "secure": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "codegen": True, + "csharp_ext": False, + "cpp_plugin": True, + "csharp_plugin": True, + "node_plugin": True, + "objective_c_plugin": True, + "php_plugin": True, + "python_plugin": True, + "ruby_plugin": True, + "secure": False, + } + + short_paths = True + + @property + def _grpc_plugin_template(self): + return "grpc_plugin_template.cmake.in" + + @property + def _cxxstd_required(self): + return 14 if Version(self.version) >= "1.47" else 11 + + def export_sources(self): + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + copy(self, f"cmake/{self._grpc_plugin_template}", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.options["protobuf"].shared = True + self.options["googleapis"].shared = True + self.options["grpc-proto"].shared = True + + if cross_building(self): + self.options["grpc"].shared = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # abseil is public. See https://github.com/conan-io/conan-center-index/pull/17284#issuecomment-1526082638 + if is_msvc(self) and Version(self.version) < "1.47": + self.requires("abseil/20211102.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("abseil/20220623.0", transitive_headers=True, transitive_libs=True) + self.requires("c-ares/1.19.0") + self.requires("openssl/[>=1.1 <4]") + self.requires("re2/20230301") + self.requires("zlib/1.2.13") + self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("googleapis/cci.20230501") + self.requires("grpc-proto/cci.20220627") + + def package_id(self): + del self.info.options.secure + + def validate(self): + check_min_vs(self, "190") + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + + if Version(self.version) >= "1.47" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("GCC older than 6 is not supported") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._cxxstd_required) + + if self.options.shared and \ + (not self.dependencies["protobuf"].options.shared or not self.dependencies["googleapis"].options.shared or not self.dependencies["grpc-proto"].options.shared): + raise ConanInvalidConfiguration( + "If built as shared, protobuf, googleapis and grpc-proto must be shared as well. " + "Please, use `protobuf:shared=True` and `googleapis:shared=True` and `grpc-proto:shared=True`", + ) + + def build_requirements(self): + if not can_run(self): + self.tool_requires("protobuf/3.21.9") + if cross_building(self): + # when cross compiling we need pre compiled grpc plugins for protoc + self.tool_requires(f"grpc/{self.version}") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + # Set up environment so that we can run grpc-cpp-plugin at build time + VirtualBuildEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + + # This doesn't work yet as one would expect, because the install target builds everything + # and we need the install target because of the generated CMake files + # + # enable_mobile=False # Enables iOS and Android support + # + # cmake.definitions["CONAN_ENABLE_MOBILE"] = "ON" if self.options.csharp_ext else "OFF" + tc = CMakeToolchain(self) + + tc.cache_variables["CMAKE_PROJECT_grpc_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + + tc.cache_variables["gRPC_BUILD_CODEGEN"] = self.options.codegen + tc.cache_variables["gRPC_BUILD_CSHARP_EXT"] = self.options.csharp_ext + tc.cache_variables["gRPC_BUILD_TESTS"] = False + + # We need the generated cmake/ files (bc they depend on the list of targets, which is dynamic) + tc.cache_variables["gRPC_INSTALL"] = True + tc.cache_variables["gRPC_INSTALL_SHAREDIR"] = "res/grpc" + + # tell grpc to use the find_package versions + tc.cache_variables["gRPC_ZLIB_PROVIDER"] = "package" + tc.cache_variables["gRPC_CARES_PROVIDER"] = "package" + tc.cache_variables["gRPC_RE2_PROVIDER"] = "package" + tc.cache_variables["gRPC_SSL_PROVIDER"] = "package" + tc.cache_variables["gRPC_PROTOBUF_PROVIDER"] = "package" + tc.cache_variables["gRPC_ABSL_PROVIDER"] = "package" + + tc.cache_variables["gRPC_BUILD_GRPC_CPP_PLUGIN"] = self.options.cpp_plugin + tc.cache_variables["gRPC_BUILD_GRPC_CSHARP_PLUGIN"] = self.options.csharp_plugin + tc.cache_variables["gRPC_BUILD_GRPC_NODE_PLUGIN"] = self.options.node_plugin + tc.cache_variables["gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN"] = self.options.objective_c_plugin + tc.cache_variables["gRPC_BUILD_GRPC_PHP_PLUGIN"] = self.options.php_plugin + tc.cache_variables["gRPC_BUILD_GRPC_PYTHON_PLUGIN"] = self.options.python_plugin + tc.cache_variables["gRPC_BUILD_GRPC_RUBY_PLUGIN"] = self.options.ruby_plugin + + # Consumed targets (abseil) via interface target_compiler_feature can propagate newer standards + if not valid_min_cppstd(self, self._cxxstd_required): + tc.cache_variables["CMAKE_CXX_STANDARD"] = self._cxxstd_required + + if is_apple_os(self): + # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + + if is_msvc(self) and Version(self.version) >= "1.48": + tc.cache_variables["CMAKE_SYSTEM_VERSION"] = "10.0.18362.0" + + tc.generate() + + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Clean existing proto files, they will be taken from requirements + shutil.rmtree(os.path.join(self.source_folder, "src", "proto", "grpc")) + + if Version(self.version) >= "1.47": + # Take googleapis from requirement instead of vendored/hardcoded version + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googleapis)", + "if (FALSE) # Do not download, it is provided by Conan" + ) + + # On macOS if all the following are true: + # - protoc from protobuf has shared library dependencies + # - grpc_cpp_plugin has shared library deps (when crossbuilding) + # - using `make` as the cmake generator + # Make will run commands via `/bin/sh` which will strip all env vars that start with `DYLD*` + # This workaround wraps the protoc command to be invoked by CMake with a modified environment + settings_build = getattr(self, "settings_build", self.settings) + if settings_build.os == "Macos": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}", + 'COMMAND ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}') + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # Create one custom module file per executable in order to emulate + # CMake executables imported targets of grpc + for plugin_option, values in self._grpc_plugins.items(): + if self.options.get_safe(plugin_option): + target = values["target"] + executable = values["executable"] + self._create_executable_module_file(target, executable) + + @property + def _grpc_plugins(self): + return { + "cpp_plugin": { + "target": "gRPC::grpc_cpp_plugin", + "executable": "grpc_cpp_plugin", + }, + "csharp_plugin": { + "target": "gRPC::grpc_csharp_plugin", + "executable": "grpc_csharp_plugin", + }, + "node_plugin": { + "target": "gRPC::grpc_node_plugin", + "executable": "grpc_node_plugin", + }, + "objective_c_plugin": { + "target": "gRPC::grpc_objective_c_plugin", + "executable": "grpc_objective_c_plugin", + }, + "php_plugin": { + "target": "gRPC::grpc_php_plugin", + "executable": "grpc_php_plugin", + }, + "python_plugin": { + "target": "gRPC::grpc_python_plugin", + "executable": "grpc_python_plugin", + }, + "ruby_plugin": { + "target": "gRPC::grpc_ruby_plugin", + "executable": "grpc_ruby_plugin", + }, + } + + def _create_executable_module_file(self, target, executable): + module_abs_path = os.path.join(self.package_folder, self._module_path) + + # Copy our CMake module template file to package folder + copy(self, self._grpc_plugin_template, src=os.path.join(self.source_folder, "cmake"), dst=module_abs_path) + + # Rename it + dst_file = os.path.join(module_abs_path, f"{executable}.cmake") + rename(self, os.path.join(module_abs_path, self._grpc_plugin_template), dst_file) + + # Replace placeholders + replace_in_file(self, dst_file, "@target_name@", target) + replace_in_file(self, dst_file, "@executable_name@", executable) + + find_program_var = "{}_PROGRAM".format(executable.upper()) + replace_in_file(self, dst_file, "@find_program_variable@", find_program_var) + + module_folder_depth = len(os.path.normpath(self._module_path).split(os.path.sep)) + rel_path = "".join(["../"] * module_folder_depth) + replace_in_file(self, dst_file, "@relative_path@", rel_path) + + @property + def _module_path(self): + return os.path.join("lib", "cmake", "conan_trick") + + @property + def _grpc_components(self): + def libm(): + return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def pthread(): + return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def crypt32(): + return ["crypt32"] if self.settings.os == "Windows" else [] + + def ws2_32(): + return ["ws2_32"] if self.settings.os == "Windows" else [] + + def wsock32(): + return ["wsock32"] if self.settings.os == "Windows" else [] + + def corefoundation(): + return ["CoreFoundation"] if is_apple_os(self) else [] + + components = { + "address_sorting": { + "lib": "address_sorting", + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "gpr": { + "lib": "gpr", + "requires": [ + "upb", "abseil::absl_base", "abseil::absl_memory", + "abseil::absl_status", "abseil::absl_str_format", + "abseil::absl_strings", "abseil::absl_synchronization", + "abseil::absl_time", "abseil::absl_optional", + ], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "_grpc": { + "lib": "grpc", + "requires": [ + "address_sorting", "gpr", "upb", "abseil::absl_bind_front", + "abseil::absl_flat_hash_map", "abseil::absl_inlined_vector", + "abseil::absl_statusor", "abseil::absl_random_random", + "c-ares::cares", "openssl::crypto", + "openssl::ssl", "re2::re2", "zlib::zlib", + ], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + "frameworks": corefoundation(), + }, + "grpc++": { + "lib": "grpc++", + "requires": ["_grpc", "protobuf::libprotobuf"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "grpc++_alts": { + "lib": "grpc++_alts", + "requires": ["grpc++", "protobuf::libprotobuf"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "grpc++_error_details": { + "lib": "grpc++_error_details", + "requires": ["grpc++", "protobuf::libprotobuf"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "upb": { + "lib": "upb", + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "grpc_plugin_support": { + "lib": "grpc_plugin_support", + "requires": ["protobuf::libprotoc", "protobuf::libprotobuf"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + } + + if not self.options.secure: + components.update({ + "grpc_unsecure": { + "lib": "grpc_unsecure", + "requires": [ + "address_sorting", "gpr", "upb", "abseil::absl_flat_hash_map", + "abseil::absl_inlined_vector", "abseil::absl_statusor", + "c-ares::cares", "re2::re2", "zlib::zlib", + "abseil::absl_random_random", + ], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + "frameworks": corefoundation(), + }, + "grpc++_unsecure": { + "lib": "grpc++_unsecure", + "requires": ["grpc_unsecure", "protobuf::libprotobuf"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + }) + + if self.options.codegen: + components.update({ + "grpc++_reflection": { + "lib": "grpc++_reflection", + "requires": ["grpc++", "protobuf::libprotobuf", "grpc-proto::grpc-proto", "googleapis::googleapis"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + "grpcpp_channelz": { + "lib": "grpcpp_channelz", + "requires": ["grpc++", "protobuf::libprotobuf", "grpc-proto::grpc-proto", "googleapis::googleapis"], + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + }, + }) + + return components + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gRPC") + self.cpp_info.resdirs = ["res"] + ssl_roots_file_path = os.path.join(self.package_folder, "res", "grpc", "roots.pem") + self.runenv_info.define_path("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", ssl_roots_file_path) + self.env_info.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH = ssl_roots_file_path # remove in conan v2? + + for component, values in self._grpc_components.items(): + target = values.get("lib") + lib = values.get("lib") + self.cpp_info.components[component].set_property("cmake_target_name", "gRPC::{}".format(target)) + # actually only gpr, grpc, grpc_unsecure, grpc++ and grpc++_unsecure should have a .pc file + self.cpp_info.components[component].set_property("pkg_config_name", target) + self.cpp_info.components[component].libs = [lib] + self.cpp_info.components[component].requires = values.get("requires", []) + self.cpp_info.components[component].system_libs = values.get("system_libs", []) + self.cpp_info.components[component].frameworks = values.get("frameworks", []) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components[component].names["cmake_find_package"] = target + self.cpp_info.components[component].names["cmake_find_package_multi"] = target + + # Executable imported targets are added through custom CMake module files, + # since conan generators don't know how to emulate these kind of targets. + grpc_modules = [] + for plugin_option, values in self._grpc_plugins.items(): + if self.options.get_safe(plugin_option): + grpc_module_filename = "{}.cmake".format(values["executable"]) + grpc_modules.append(os.path.join(self._module_path, grpc_module_filename)) + self.cpp_info.set_property("cmake_build_modules", grpc_modules) + + if any(self.options.get_safe(plugin_option) for plugin_option in self._grpc_plugins.keys()): + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "gRPC" + self.cpp_info.names["cmake_find_package_multi"] = "gRPC" + if grpc_modules: + self.cpp_info.components["grpc_execs"].build_modules["cmake_find_package"] = grpc_modules + self.cpp_info.components["grpc_execs"].build_modules["cmake_find_package_multi"] = grpc_modules diff --git a/recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch new file mode 100644 index 0000000000000..a260124675947 --- /dev/null +++ b/recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7a97604b75..7ae815042f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -222,21 +222,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) + endif() + +-# Add c++11 flags +-if (NOT DEFINED CMAKE_CXX_STANDARD) +- set(CMAKE_CXX_STANDARD 11) +-else() +- if (CMAKE_CXX_STANDARD LESS 11) +- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 11, please specify at least SET(CMAKE_CXX_STANDARD 11)") +- endif() +-endif() +-if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) +- set(CMAKE_CXX_STANDARD_REQUIRED ON) +-endif() +-if (NOT DEFINED CMAKE_CXX_EXTENSIONS) +- set(CMAKE_CXX_EXTENSIONS OFF) +-endif() +- + if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + endif() diff --git a/recipes/grpc/all/patches/v1.46.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.46.x/002-consume-protos-from-requirements.patch new file mode 100644 index 0000000000000..ff27fa43b34ea --- /dev/null +++ b/recipes/grpc/all/patches/v1.46.x/002-consume-protos-from-requirements.patch @@ -0,0 +1,290 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2db10e5..612d2cf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -329,7 +329,7 @@ function(protobuf_generate_grpc_cpp) + return() + endif() + +- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) ++ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) + foreach(FIL ${ARGN}) + get_filename_component(ABS_FIL ${FIL} ABSOLUTE) + get_filename_component(FIL_WE ${FIL} NAME_WE) +@@ -348,18 +348,15 @@ function(protobuf_generate_grpc_cpp) + OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" + COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} + ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} +- --cpp_out=${_gRPC_PROTO_GENS_DIR} + --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} + ${_protobuf_include_path} +- ${REL_FIL} +- DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN} ++ ${FIL} ++ DEPENDS ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Running gRPC C++ protocol buffer compiler on ${FIL}" +- VERBATIM) ++ ) + endforeach() + endfunction() + +@@ -413,178 +410,28 @@ add_custom_target(tools + DEPENDS tools_c tools_cxx) + + protobuf_generate_grpc_cpp( +- src/proto/grpc/channelz/channelz.proto ++ grpc/channelz/v1/channelz.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/core/stats.proto ++ grpc/core/stats.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/health/v1/health.proto ++ grpc/health/v1/health.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/lb/v1/load_balancer.proto ++ grpc/lb/v1/load_balancer.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/lookup/v1/rls.proto ++ grpc/lookup/v1/rls.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/lookup/v1/rls_config.proto ++ grpc/lookup/v1/rls_config.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/reflection/v1alpha/reflection.proto ++ grpc/reflection/v1alpha/reflection.proto + ) + protobuf_generate_grpc_cpp( +- src/proto/grpc/status/status.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/benchmark_service.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/control.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/duplicate/echo_duplicate.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/echo.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/echo_messages.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/empty.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/messages.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/payloads.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/report_qps_scenario_service.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/simple_messages.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/stats.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/test.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/worker_service.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/ads_for_test.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/cds_for_test.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/eds_for_test.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/lds_rds_for_test.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/lrs_for_test.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/address.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/ads.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/base.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/cluster.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/config_dump.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/config_source.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/csds.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/discovery.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/endpoint.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/expr.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/extension.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/fault.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/fault_common.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/http_connection_manager.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/listener.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/load_report.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/lrs.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/metadata.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/orca_load_report.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/orca_service.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/path.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/percent.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/protocol.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/range.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/rbac.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/regex.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/route.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/router.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/string.proto +-) +-protobuf_generate_grpc_cpp( +- src/proto/grpc/testing/xds/v3/tls.proto ++ grpc/status/status.proto + ) + protobuf_generate_grpc_cpp( + test/core/tsi/alts/fake_handshaker/handshaker.proto +@@ -3275,10 +3122,8 @@ endif() + + if(gRPC_BUILD_CODEGEN) + add_library(grpc++_reflection +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h + src/cpp/ext/proto_server_reflection.cc + src/cpp/ext/proto_server_reflection_plugin.cc + ) +@@ -3317,6 +3162,7 @@ target_link_libraries(grpc++_reflection + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +@@ -3872,10 +3718,8 @@ endif() + # See https://github.com/grpc/grpc/issues/19473 + if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) + add_library(grpcpp_channelz +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h + src/cpp/server/channelz/channelz_service.cc + src/cpp/server/channelz/channelz_service_plugin.cc + ) +@@ -3914,6 +3758,7 @@ target_link_libraries(grpcpp_channelz + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h +index 04f1e63..82837e8 100644 +--- a/src/cpp/ext/proto_server_reflection.h ++++ b/src/cpp/ext/proto_server_reflection.h +@@ -24,7 +24,7 @@ + + #include + +-#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" ++#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" + + namespace grpc { + +diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h +index 824f0a9..bfa31a1 100644 +--- a/src/cpp/server/channelz/channelz_service.h ++++ b/src/cpp/server/channelz/channelz_service.h +@@ -23,7 +23,7 @@ + + #include + +-#include "src/proto/grpc/channelz/channelz.grpc.pb.h" ++#include "grpc/channelz/v1/channelz.grpc.pb.h" + + namespace grpc { + diff --git a/recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch new file mode 100644 index 0000000000000..0ba329e6480bc --- /dev/null +++ b/recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index db075cbe4a..289cc52215 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -220,26 +220,6 @@ if(WIN32) + set(_gRPC_PLATFORM_WINDOWS ON) + endif() + +- # Use C11 standard +-if (NOT DEFINED CMAKE_C_STANDARD) +- set(CMAKE_C_STANDARD 11) +-endif() +- +-# Add c++14 flags +-if (NOT DEFINED CMAKE_CXX_STANDARD) +- set(CMAKE_CXX_STANDARD 14) +-else() +- if (CMAKE_CXX_STANDARD LESS 14) +- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 14, please specify at least SET(CMAKE_CXX_STANDARD 14)") +- endif() +-endif() +-if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) +- set(CMAKE_CXX_STANDARD_REQUIRED ON) +-endif() +-if (NOT DEFINED CMAKE_CXX_EXTENSIONS) +- set(CMAKE_CXX_EXTENSIONS OFF) +-endif() +- + if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + endif() diff --git a/recipes/grpc/all/patches/v1.47.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.47.x/002-consume-protos-from-requirements.patch new file mode 100644 index 0000000000000..9ead7f09de502 --- /dev/null +++ b/recipes/grpc/all/patches/v1.47.x/002-consume-protos-from-requirements.patch @@ -0,0 +1,309 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1eaeba..706e6d1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -445,7 +445,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + endif() + + # Sets the include path for ProtoBuf files +- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) ++ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) + # The absolute path of the expected place for the input proto file + # For example, health proto has package name grpc.health.v1, it's expected to be: + # ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1/health.proto +@@ -470,8 +470,8 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + # path. For example, health proto has package name grpc.health.v1, the bash + # equivalent would be: + # cp src/proto/grpc/health/v1/health.proto ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1 +- file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) +- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) ++ # file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) ++ # file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) + + #if cross-compiling, find host plugin + if(CMAKE_CROSSCOMPILING) +@@ -484,18 +484,15 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" + COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} + ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} +- --cpp_out=${_gRPC_PROTO_GENS_DIR} + --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} + ${_protobuf_include_path} +- ${REL_FIL} +- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin ++ ${FILE_LOCATION} ++ DEPENDS ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin + WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR} +- COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}" +- VERBATIM) ++ COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE_LOCATION}" ++ ) + endfunction() + + # These options allow users to enable or disable the building of the various +@@ -548,181 +545,28 @@ add_custom_target(tools + DEPENDS tools_c tools_cxx) + + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/core/stats.proto src/proto/grpc/core/stats.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/health/v1/health.proto src/proto/grpc/health/v1/health.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lb/v1/load_balancer.proto src/proto/grpc/lb/v1/load_balancer.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lookup/v1/rls.proto src/proto/grpc/lookup/v1/rls.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lookup/v1/rls_config.proto src/proto/grpc/lookup/v1/rls_config.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/reflection/v1alpha/reflection.proto src/proto/grpc/reflection/v1alpha/reflection.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/status/status.proto src/proto/grpc/status/status.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/benchmark_service.proto src/proto/grpc/testing/benchmark_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/control.proto src/proto/grpc/testing/control.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/duplicate/echo_duplicate.proto src/proto/grpc/testing/duplicate/echo_duplicate.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/echo.proto src/proto/grpc/testing/echo.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/echo_messages.proto src/proto/grpc/testing/echo_messages.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/empty.proto src/proto/grpc/testing/empty.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/messages.proto src/proto/grpc/testing/messages.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/payloads.proto src/proto/grpc/testing/payloads.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/report_qps_scenario_service.proto src/proto/grpc/testing/report_qps_scenario_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/simple_messages.proto src/proto/grpc/testing/simple_messages.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/stats.proto src/proto/grpc/testing/stats.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/test.proto src/proto/grpc/testing/test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/worker_service.proto src/proto/grpc/testing/worker_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/ads_for_test.proto src/proto/grpc/testing/xds/ads_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/cds_for_test.proto src/proto/grpc/testing/xds/cds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/eds_for_test.proto src/proto/grpc/testing/xds/eds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/lds_rds_for_test.proto src/proto/grpc/testing/xds/lds_rds_for_test.proto ++ grpc/channelz/v1/channelz.proto grpc/channelz/v1/channelz.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/lrs_for_test.proto src/proto/grpc/testing/xds/lrs_for_test.proto ++ grpc/core/stats.proto grpc/core/stats.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/address.proto src/proto/grpc/testing/xds/v3/address.proto ++ grpc/health/v1/health.proto grpc/health/v1/health.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/ads.proto src/proto/grpc/testing/xds/v3/ads.proto ++ grpc/lb/v1/load_balancer.proto grpc/lb/v1/load_balancer.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto src/proto/grpc/testing/xds/v3/aggregate_cluster.proto ++ grpc/lookup/v1/rls.proto grpc/lookup/v1/rls.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/base.proto src/proto/grpc/testing/xds/v3/base.proto ++ grpc/lookup/v1/rls_config.proto grpc/lookup/v1/rls_config.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/cluster.proto src/proto/grpc/testing/xds/v3/cluster.proto ++ grpc/reflection/v1alpha/reflection.proto grpc/reflection/v1alpha/reflection.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/config_dump.proto src/proto/grpc/testing/xds/v3/config_dump.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/config_source.proto src/proto/grpc/testing/xds/v3/config_source.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/csds.proto src/proto/grpc/testing/xds/v3/csds.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/discovery.proto src/proto/grpc/testing/xds/v3/discovery.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/endpoint.proto src/proto/grpc/testing/xds/v3/endpoint.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/expr.proto src/proto/grpc/testing/xds/v3/expr.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/extension.proto src/proto/grpc/testing/xds/v3/extension.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/fault.proto src/proto/grpc/testing/xds/v3/fault.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto src/proto/grpc/testing/xds/v3/http_filter_rbac.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/listener.proto src/proto/grpc/testing/xds/v3/listener.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/load_report.proto src/proto/grpc/testing/xds/v3/load_report.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/lrs.proto src/proto/grpc/testing/xds/v3/lrs.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/metadata.proto src/proto/grpc/testing/xds/v3/metadata.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/orca_load_report.proto src/proto/grpc/testing/xds/v3/orca_load_report.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/orca_service.proto src/proto/grpc/testing/xds/v3/orca_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/outlier_detection.proto src/proto/grpc/testing/xds/v3/outlier_detection.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/path.proto src/proto/grpc/testing/xds/v3/path.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/percent.proto src/proto/grpc/testing/xds/v3/percent.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/protocol.proto src/proto/grpc/testing/xds/v3/protocol.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/range.proto src/proto/grpc/testing/xds/v3/range.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/rbac.proto src/proto/grpc/testing/xds/v3/rbac.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/regex.proto src/proto/grpc/testing/xds/v3/regex.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/route.proto src/proto/grpc/testing/xds/v3/route.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/router.proto src/proto/grpc/testing/xds/v3/router.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/string.proto src/proto/grpc/testing/xds/v3/string.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/tls.proto src/proto/grpc/testing/xds/v3/tls.proto ++ grpc/status/status.proto grpc/status/status.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( + test/core/tsi/alts/fake_handshaker/handshaker.proto test/core/tsi/alts/fake_handshaker/handshaker.proto +@@ -3446,10 +3290,8 @@ endif() + + if(gRPC_BUILD_CODEGEN) + add_library(grpc++_reflection +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h + src/cpp/ext/proto_server_reflection.cc + src/cpp/ext/proto_server_reflection_plugin.cc + ) +@@ -3488,6 +3330,7 @@ target_link_libraries(grpc++_reflection + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +@@ -4076,10 +3919,8 @@ endif() + # See https://github.com/grpc/grpc/issues/19473 + if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) + add_library(grpcpp_channelz +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h + src/cpp/server/channelz/channelz_service.cc + src/cpp/server/channelz/channelz_service_plugin.cc + ) +@@ -4118,6 +3959,7 @@ target_link_libraries(grpcpp_channelz + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h +index a9b5db0..528e75b 100644 +--- a/src/cpp/ext/proto_server_reflection.h ++++ b/src/cpp/ext/proto_server_reflection.h +@@ -29,8 +29,8 @@ + #include + #include + +-#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" +-#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" ++#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" ++#include "grpc/reflection/v1alpha/reflection.pb.h" + + namespace grpc { + +diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h +index 91936da..a84c57a 100644 +--- a/src/cpp/server/channelz/channelz_service.h ++++ b/src/cpp/server/channelz/channelz_service.h +@@ -24,8 +24,8 @@ + #include + #include + +-#include "src/proto/grpc/channelz/channelz.grpc.pb.h" +-#include "src/proto/grpc/channelz/channelz.pb.h" ++#include "grpc/channelz/v1/channelz.grpc.pb.h" ++#include "grpc/channelz/v1/channelz.pb.h" + + namespace grpc { + diff --git a/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch new file mode 100644 index 0000000000000..65b655ba1f8b5 --- /dev/null +++ b/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5..f37849c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -226,21 +226,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 11) + endif() + +-# Add c++14 flags +-if (NOT DEFINED CMAKE_CXX_STANDARD) +- set(CMAKE_CXX_STANDARD 14) +-else() +- if (CMAKE_CXX_STANDARD LESS 14) +- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 14, please specify at least SET(CMAKE_CXX_STANDARD 14)") +- endif() +-endif() +-if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) +- set(CMAKE_CXX_STANDARD_REQUIRED ON) +-endif() +-if (NOT DEFINED CMAKE_CXX_EXTENSIONS) +- set(CMAKE_CXX_EXTENSIONS OFF) +-endif() +- + if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + endif() diff --git a/recipes/grpc/all/patches/v1.48.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.48.x/002-consume-protos-from-requirements.patch new file mode 100644 index 0000000000000..5fd52235a25e3 --- /dev/null +++ b/recipes/grpc/all/patches/v1.48.x/002-consume-protos-from-requirements.patch @@ -0,0 +1,327 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d23aa5..457188b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -451,7 +451,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + endif() + + # Sets the include path for ProtoBuf files +- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) ++ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) + # The absolute path of the expected place for the input proto file + # For example, health proto has package name grpc.health.v1, it's expected to be: + # ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1/health.proto +@@ -476,8 +476,8 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + # path. For example, health proto has package name grpc.health.v1, the bash + # equivalent would be: + # cp src/proto/grpc/health/v1/health.proto ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1 +- file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) +- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) ++ # file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) ++ # file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) + + #if cross-compiling, find host plugin + if(CMAKE_CROSSCOMPILING) +@@ -490,18 +490,15 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" + COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} + ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} +- --cpp_out=${_gRPC_PROTO_GENS_DIR} + --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} + ${_protobuf_include_path} +- ${REL_FIL} +- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin ++ ${FILE_LOCATION} ++ DEPENDS ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin + WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR} +- COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}" +- VERBATIM) ++ COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE_LOCATION}" ++ ) + endfunction() + + # These options allow users to enable or disable the building of the various +@@ -554,199 +551,28 @@ add_custom_target(tools + DEPENDS tools_c tools_cxx) + + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/core/stats.proto src/proto/grpc/core/stats.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/health/v1/health.proto src/proto/grpc/health/v1/health.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lb/v1/load_balancer.proto src/proto/grpc/lb/v1/load_balancer.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lookup/v1/rls.proto src/proto/grpc/lookup/v1/rls.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lookup/v1/rls_config.proto src/proto/grpc/lookup/v1/rls_config.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/reflection/v1alpha/reflection.proto src/proto/grpc/reflection/v1alpha/reflection.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/status/status.proto src/proto/grpc/status/status.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/benchmark_service.proto src/proto/grpc/testing/benchmark_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/control.proto src/proto/grpc/testing/control.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/duplicate/echo_duplicate.proto src/proto/grpc/testing/duplicate/echo_duplicate.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/echo.proto src/proto/grpc/testing/echo.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/echo_messages.proto src/proto/grpc/testing/echo_messages.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/empty.proto src/proto/grpc/testing/empty.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/istio_echo.proto src/proto/grpc/testing/istio_echo.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/messages.proto src/proto/grpc/testing/messages.proto ++ grpc/channelz/v1/channelz.proto grpc/channelz/v1/channelz.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/payloads.proto src/proto/grpc/testing/payloads.proto ++ grpc/core/stats.proto grpc/core/stats.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/report_qps_scenario_service.proto src/proto/grpc/testing/report_qps_scenario_service.proto ++ grpc/health/v1/health.proto grpc/health/v1/health.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/simple_messages.proto src/proto/grpc/testing/simple_messages.proto ++ grpc/lb/v1/load_balancer.proto grpc/lb/v1/load_balancer.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/stats.proto src/proto/grpc/testing/stats.proto ++ grpc/lookup/v1/rls.proto grpc/lookup/v1/rls.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/test.proto src/proto/grpc/testing/test.proto ++ grpc/lookup/v1/rls_config.proto grpc/lookup/v1/rls_config.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/worker_service.proto src/proto/grpc/testing/worker_service.proto ++ grpc/reflection/v1alpha/reflection.proto grpc/reflection/v1alpha/reflection.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/ads_for_test.proto src/proto/grpc/testing/xds/ads_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/cds_for_test.proto src/proto/grpc/testing/xds/cds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/eds_for_test.proto src/proto/grpc/testing/xds/eds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/lds_rds_for_test.proto src/proto/grpc/testing/xds/lds_rds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/lrs_for_test.proto src/proto/grpc/testing/xds/lrs_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/address.proto src/proto/grpc/testing/xds/v3/address.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/ads.proto src/proto/grpc/testing/xds/v3/ads.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto src/proto/grpc/testing/xds/v3/aggregate_cluster.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/base.proto src/proto/grpc/testing/xds/v3/base.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/cluster.proto src/proto/grpc/testing/xds/v3/cluster.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/config_dump.proto src/proto/grpc/testing/xds/v3/config_dump.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/config_source.proto src/proto/grpc/testing/xds/v3/config_source.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/csds.proto src/proto/grpc/testing/xds/v3/csds.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/discovery.proto src/proto/grpc/testing/xds/v3/discovery.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/endpoint.proto src/proto/grpc/testing/xds/v3/endpoint.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/expr.proto src/proto/grpc/testing/xds/v3/expr.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/extension.proto src/proto/grpc/testing/xds/v3/extension.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/fault.proto src/proto/grpc/testing/xds/v3/fault.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto src/proto/grpc/testing/xds/v3/http_filter_rbac.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/listener.proto src/proto/grpc/testing/xds/v3/listener.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/load_report.proto src/proto/grpc/testing/xds/v3/load_report.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/lrs.proto src/proto/grpc/testing/xds/v3/lrs.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/metadata.proto src/proto/grpc/testing/xds/v3/metadata.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/orca_load_report.proto src/proto/grpc/testing/xds/v3/orca_load_report.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/orca_service.proto src/proto/grpc/testing/xds/v3/orca_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/outlier_detection.proto src/proto/grpc/testing/xds/v3/outlier_detection.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/path.proto src/proto/grpc/testing/xds/v3/path.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/percent.proto src/proto/grpc/testing/xds/v3/percent.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/protocol.proto src/proto/grpc/testing/xds/v3/protocol.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/range.proto src/proto/grpc/testing/xds/v3/range.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/rbac.proto src/proto/grpc/testing/xds/v3/rbac.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/regex.proto src/proto/grpc/testing/xds/v3/regex.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/ring_hash.proto src/proto/grpc/testing/xds/v3/ring_hash.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/round_robin.proto src/proto/grpc/testing/xds/v3/round_robin.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/route.proto src/proto/grpc/testing/xds/v3/route.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/router.proto src/proto/grpc/testing/xds/v3/router.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/string.proto src/proto/grpc/testing/xds/v3/string.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/tls.proto src/proto/grpc/testing/xds/v3/tls.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/typed_struct.proto src/proto/grpc/testing/xds/v3/typed_struct.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/wrr_locality.proto src/proto/grpc/testing/xds/v3/wrr_locality.proto ++ src/proto/grpc/status/status.proto grpc/status/status.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( + test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto +@@ -3497,10 +3323,8 @@ endif() + + if(gRPC_BUILD_CODEGEN) + add_library(grpc++_reflection +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h + src/cpp/ext/proto_server_reflection.cc + src/cpp/ext/proto_server_reflection_plugin.cc + ) +@@ -3539,6 +3363,7 @@ target_link_libraries(grpc++_reflection + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +@@ -4096,10 +3921,8 @@ endif() + # See https://github.com/grpc/grpc/issues/19473 + if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) + add_library(grpcpp_channelz +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h + src/cpp/server/channelz/channelz_service.cc + src/cpp/server/channelz/channelz_service_plugin.cc + ) +@@ -4138,6 +3961,7 @@ target_link_libraries(grpcpp_channelz + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h +index a9b5db0..528e75b 100644 +--- a/src/cpp/ext/proto_server_reflection.h ++++ b/src/cpp/ext/proto_server_reflection.h +@@ -29,8 +29,8 @@ + #include + #include + +-#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" +-#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" ++#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" ++#include "grpc/reflection/v1alpha/reflection.pb.h" + + namespace grpc { + +diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h +index 91936da..a84c57a 100644 +--- a/src/cpp/server/channelz/channelz_service.h ++++ b/src/cpp/server/channelz/channelz_service.h +@@ -24,8 +24,8 @@ + #include + #include + +-#include "src/proto/grpc/channelz/channelz.grpc.pb.h" +-#include "src/proto/grpc/channelz/channelz.pb.h" ++#include "grpc/channelz/v1/channelz.grpc.pb.h" ++#include "grpc/channelz/v1/channelz.pb.h" + + namespace grpc { + diff --git a/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch new file mode 100644 index 0000000000000..a9339dbcc896b --- /dev/null +++ b/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7052846..259fa93 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -227,21 +227,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 11) + endif() + +-# Add c++14 flags +-if (NOT DEFINED CMAKE_CXX_STANDARD) +- set(CMAKE_CXX_STANDARD 14) +-else() +- if (CMAKE_CXX_STANDARD LESS 14) +- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 14, please specify at least SET(CMAKE_CXX_STANDARD 14)") +- endif() +-endif() +-if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) +- set(CMAKE_CXX_STANDARD_REQUIRED ON) +-endif() +-if (NOT DEFINED CMAKE_CXX_EXTENSIONS) +- set(CMAKE_CXX_EXTENSIONS OFF) +-endif() +- + if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + endif() diff --git a/recipes/grpc/all/patches/v1.50.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.50.x/002-consume-protos-from-requirements.patch new file mode 100644 index 0000000000000..515291213b267 --- /dev/null +++ b/recipes/grpc/all/patches/v1.50.x/002-consume-protos-from-requirements.patch @@ -0,0 +1,326 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 259fa93..fb05774 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -452,7 +452,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + endif() + + # Sets the include path for ProtoBuf files +- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) ++ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) + # The absolute path of the expected place for the input proto file + # For example, health proto has package name grpc.health.v1, it's expected to be: + # ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1/health.proto +@@ -477,8 +477,6 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + # path. For example, health proto has package name grpc.health.v1, the bash + # equivalent would be: + # cp src/proto/grpc/health/v1/health.proto ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1 +- file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) +- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) + + #if cross-compiling, find host plugin + if(CMAKE_CROSSCOMPILING) +@@ -491,18 +489,15 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM + OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" + "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" +- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" + COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} + ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} +- --cpp_out=${_gRPC_PROTO_GENS_DIR} + --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} + ${_protobuf_include_path} +- ${REL_FIL} +- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN} ++ ${FILE_LOCATION} ++ DEPENDS ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin + WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR} +- COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}" +- VERBATIM) ++ COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE_LOCATION}" ++ ) + endfunction() + + # These options allow users to enable or disable the building of the various +@@ -554,199 +549,28 @@ add_custom_target(tools + DEPENDS tools_c tools_cxx) + + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/core/stats.proto src/proto/grpc/core/stats.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/health/v1/health.proto src/proto/grpc/health/v1/health.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lb/v1/load_balancer.proto src/proto/grpc/lb/v1/load_balancer.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lookup/v1/rls.proto src/proto/grpc/lookup/v1/rls.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/lookup/v1/rls_config.proto src/proto/grpc/lookup/v1/rls_config.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/reflection/v1alpha/reflection.proto src/proto/grpc/reflection/v1alpha/reflection.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/status/status.proto src/proto/grpc/status/status.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/benchmark_service.proto src/proto/grpc/testing/benchmark_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/control.proto src/proto/grpc/testing/control.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/duplicate/echo_duplicate.proto src/proto/grpc/testing/duplicate/echo_duplicate.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/echo.proto src/proto/grpc/testing/echo.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/echo_messages.proto src/proto/grpc/testing/echo_messages.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/empty.proto src/proto/grpc/testing/empty.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/istio_echo.proto src/proto/grpc/testing/istio_echo.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/messages.proto src/proto/grpc/testing/messages.proto ++ grpc/channelz/v1/channelz.proto grpc/channelz/v1/channelz.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/payloads.proto src/proto/grpc/testing/payloads.proto ++ grpc/core/stats.proto grpc/core/stats.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/report_qps_scenario_service.proto src/proto/grpc/testing/report_qps_scenario_service.proto ++ grpc/health/v1/health.proto grpc/health/v1/health.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/simple_messages.proto src/proto/grpc/testing/simple_messages.proto ++ grpc/lb/v1/load_balancer.proto grpc/lb/v1/load_balancer.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/stats.proto src/proto/grpc/testing/stats.proto ++ grpc/lookup/v1/rls.proto grpc/lookup/v1/rls.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/test.proto src/proto/grpc/testing/test.proto ++ grpc/lookup/v1/rls_config.proto grpc/lookup/v1/rls_config.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/worker_service.proto src/proto/grpc/testing/worker_service.proto ++ grpc/reflection/v1alpha/reflection.proto grpc/reflection/v1alpha/reflection.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/ads_for_test.proto src/proto/grpc/testing/xds/ads_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/cds_for_test.proto src/proto/grpc/testing/xds/cds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/eds_for_test.proto src/proto/grpc/testing/xds/eds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/lds_rds_for_test.proto src/proto/grpc/testing/xds/lds_rds_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/lrs_for_test.proto src/proto/grpc/testing/xds/lrs_for_test.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/address.proto src/proto/grpc/testing/xds/v3/address.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/ads.proto src/proto/grpc/testing/xds/v3/ads.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto src/proto/grpc/testing/xds/v3/aggregate_cluster.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/base.proto src/proto/grpc/testing/xds/v3/base.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/cluster.proto src/proto/grpc/testing/xds/v3/cluster.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/config_dump.proto src/proto/grpc/testing/xds/v3/config_dump.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/config_source.proto src/proto/grpc/testing/xds/v3/config_source.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/csds.proto src/proto/grpc/testing/xds/v3/csds.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/discovery.proto src/proto/grpc/testing/xds/v3/discovery.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/endpoint.proto src/proto/grpc/testing/xds/v3/endpoint.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/expr.proto src/proto/grpc/testing/xds/v3/expr.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/extension.proto src/proto/grpc/testing/xds/v3/extension.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/fault.proto src/proto/grpc/testing/xds/v3/fault.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto src/proto/grpc/testing/xds/v3/http_filter_rbac.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/listener.proto src/proto/grpc/testing/xds/v3/listener.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/load_report.proto src/proto/grpc/testing/xds/v3/load_report.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/lrs.proto src/proto/grpc/testing/xds/v3/lrs.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/metadata.proto src/proto/grpc/testing/xds/v3/metadata.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/orca_load_report.proto src/proto/grpc/testing/xds/v3/orca_load_report.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/orca_service.proto src/proto/grpc/testing/xds/v3/orca_service.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/outlier_detection.proto src/proto/grpc/testing/xds/v3/outlier_detection.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/path.proto src/proto/grpc/testing/xds/v3/path.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/percent.proto src/proto/grpc/testing/xds/v3/percent.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/protocol.proto src/proto/grpc/testing/xds/v3/protocol.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/range.proto src/proto/grpc/testing/xds/v3/range.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/rbac.proto src/proto/grpc/testing/xds/v3/rbac.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/regex.proto src/proto/grpc/testing/xds/v3/regex.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/ring_hash.proto src/proto/grpc/testing/xds/v3/ring_hash.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/round_robin.proto src/proto/grpc/testing/xds/v3/round_robin.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/route.proto src/proto/grpc/testing/xds/v3/route.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/router.proto src/proto/grpc/testing/xds/v3/router.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/string.proto src/proto/grpc/testing/xds/v3/string.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/tls.proto src/proto/grpc/testing/xds/v3/tls.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/typed_struct.proto src/proto/grpc/testing/xds/v3/typed_struct.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto +-) +-protobuf_generate_grpc_cpp_with_import_path_correction( +- src/proto/grpc/testing/xds/v3/wrr_locality.proto src/proto/grpc/testing/xds/v3/wrr_locality.proto ++ src/proto/grpc/status/status.proto grpc/status/status.proto + ) + protobuf_generate_grpc_cpp_with_import_path_correction( + test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto +@@ -3536,10 +3360,8 @@ endif() + + if(gRPC_BUILD_CODEGEN) + add_library(grpc++_reflection +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h + src/cpp/ext/proto_server_reflection.cc + src/cpp/ext/proto_server_reflection_plugin.cc + ) +@@ -3578,6 +3400,7 @@ target_link_libraries(grpc++_reflection + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +@@ -4149,10 +3972,8 @@ endif() + # See https://github.com/grpc/grpc/issues/19473 + if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) + add_library(grpcpp_channelz +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h +- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc ++ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h + src/cpp/server/channelz/channelz_service.cc + src/cpp/server/channelz/channelz_service_plugin.cc + ) +@@ -4191,6 +4012,7 @@ target_link_libraries(grpcpp_channelz + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ ++ grpc-proto::grpc-proto + ) + + foreach(_hdr +diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h +index a9b5db0..528e75b 100644 +--- a/src/cpp/ext/proto_server_reflection.h ++++ b/src/cpp/ext/proto_server_reflection.h +@@ -29,8 +29,8 @@ + #include + #include + +-#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" +-#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" ++#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" ++#include "grpc/reflection/v1alpha/reflection.pb.h" + + namespace grpc { + +diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h +index 91936da..0172493 100644 +--- a/src/cpp/server/channelz/channelz_service.h ++++ b/src/cpp/server/channelz/channelz_service.h +@@ -24,8 +24,9 @@ + #include + #include + +-#include "src/proto/grpc/channelz/channelz.grpc.pb.h" +-#include "src/proto/grpc/channelz/channelz.pb.h" ++#include "grpc/channelz/v1/channelz.grpc.pb.h" ++#include "grpc/channelz/v1/channelz.pb.h" ++ + + namespace grpc { + diff --git a/recipes/grpc/all/test_package/CMakeLists.txt b/recipes/grpc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..36ab1457a65dd --- /dev/null +++ b/recipes/grpc/all/test_package/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + + +find_package(protobuf CONFIG REQUIRED QUIET) +find_package(gRPC CONFIG REQUIRED QUIET) + +message("DYLD_LIBRARY_PATH from CMake: $ENV{DYLD_LIBRARY_PATH}") + +add_executable(${PROJECT_NAME} test_package.cpp helloworld.proto) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) # grpc 1.47.0 requires c++14 +target_link_libraries(${PROJECT_NAME} + PRIVATE + protobuf::libprotobuf + $,gRPC::grpc++_unsecure,gRPC::grpc++> +) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +if(TEST_ACTUAL_SERVER) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DTEST_ACTUAL_SERVER) +endif() +protobuf_generate( + TARGET ${PROJECT_NAME} + LANGUAGE cpp +) +protobuf_generate( + TARGET ${PROJECT_NAME} + LANGUAGE grpc + GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc + PLUGIN protoc-gen-grpc=$ +) diff --git a/recipes/grpc/all/test_package/conanfile.py b/recipes/grpc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0f6a5af6c45a4 --- /dev/null +++ b/recipes/grpc/all/test_package/conanfile.py @@ -0,0 +1,56 @@ +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 VirtualRunEnv, VirtualBuildEnv +from conan.tools.microsoft import is_msvc +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + 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): + # For the grpc-cpp-plugin executable at build time + self.tool_requires(self.tested_reference_str) + + def generate(self): + # Set up environment so that we can run grpc-cpp-plugin at build time + VirtualBuildEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + + # Environment so that the compiled test executable can load shared libraries + runenv = VirtualRunEnv(self) + runenv.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["TEST_ACTUAL_SERVER"] = not (is_msvc(self) + and str(self.settings.compiler.version) in ("15", "191") + and self.settings.build_type == "Release") + + # Additional logic to override the make program on MacOS if /usr/bin/make is found by CMake + # which otherwise prevents the propagation of DYLD_LIBRARY_PATH as set by the VirtualBuildEnv + project_include = os.path.join(self.source_folder, "macos_make_override.cmake") + tc.cache_variables["CMAKE_PROJECT_test_package_INCLUDE"] = project_include + tc.generate() + + deps = CMakeDeps(self) + deps.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/grpc/all/test_package/helloworld.proto b/recipes/grpc/all/test_package/helloworld.proto new file mode 100644 index 0000000000000..be878ce25fffc --- /dev/null +++ b/recipes/grpc/all/test_package/helloworld.proto @@ -0,0 +1,38 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; +option objc_class_prefix = "HLW"; + +package helloworld; + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; +} diff --git a/recipes/grpc/all/test_package/macos_make_override.cmake b/recipes/grpc/all/test_package/macos_make_override.cmake new file mode 100644 index 0000000000000..e7078c1b51419 --- /dev/null +++ b/recipes/grpc/all/test_package/macos_make_override.cmake @@ -0,0 +1,13 @@ +if (CMAKE_GENERATOR MATCHES "Unix Makefiles" AND CMAKE_HOST_APPLE AND CMAKE_MAKE_PROGRAM MATCHES "/usr/bin/make") + execute_process( + COMMAND xcrun --find make + OUTPUT_VARIABLE xcode_make OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE xcrun_error) + if(xcode_make) + #Override the value of `CMAKE_MAKE_PROGRAM` + set_property(CACHE CMAKE_MAKE_PROGRAM PROPERTY VALUE "${xcode_make}") + else() + message(WARNING "Using /usr/bin/make may prevent execution of Conan tool_requires that require DYLD_LIBRARY_PATH" + " to be set at build time.") + endif() +endif() diff --git a/recipes/grpc/all/test_package/test_package.cpp b/recipes/grpc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..18a37cf90692e --- /dev/null +++ b/recipes/grpc/all/test_package/test_package.cpp @@ -0,0 +1,122 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include + +#include +#include "helloworld.grpc.pb.h" + +using grpc::Channel; +using grpc::ClientContext; +using grpc::Server; +using grpc::ServerBuilder; +using grpc::ServerContext; +using grpc::Status; +using helloworld::HelloRequest; +using helloworld::HelloReply; +using helloworld::Greeter; + +class GreeterClient { + public: + GreeterClient(std::shared_ptr channel) + : stub_(Greeter::NewStub(channel)) {} + + // Assembles the client's payload, sends it and presents the response back + // from the server. + std::string SayHello(const std::string& user) { + // Data we are sending to the server. + HelloRequest request; + request.set_name(user); + + // Container for the data we expect from the server. + HelloReply reply; + + // Context for the client. It could be used to convey extra information to + // the server and/or tweak certain RPC behaviors. + ClientContext context; + + // The actual RPC. + Status status = stub_->SayHello(&context, request, &reply); + + // Act upon its status. + if (status.ok()) { + return reply.message(); + } else { + std::cout << status.error_code() << ": " << status.error_message() + << std::endl; + return "RPC failed"; + } + } + + private: + std::unique_ptr stub_; +}; + +// Logic and data behind the server's behavior. +class GreeterServiceImpl final : public Greeter::Service { + Status SayHello(ServerContext* context, const HelloRequest* request, + HelloReply* reply) override { + std::string prefix("Hello "); + reply->set_message(prefix + request->name()); + return Status::OK; + } +}; + +int main(int argc, char** argv) { + std::string server_address("127.0.0.1:0"); + GreeterServiceImpl service; + + ServerBuilder builder; + int selected_port = 0; + // Listen on the given address without any authentication mechanism. + builder.AddListeningPort(server_address, grpc::InsecureServerCredentials(), &selected_port); + // Register "service" as the instance through which we'll communicate with + // clients. In this case it corresponds to an *synchronous* service. + builder.RegisterService(&service); + + // Finally assemble the server. +#ifdef TEST_ACTUAL_SERVER + std::unique_ptr server(builder.BuildAndStart()); + std::thread serverThread([&](){ + std::cout << "Server listening on 127.0.0.1:" << selected_port << std::endl; + server->Wait(); + std::cout << "Server closed" << std::endl; + }); +#endif + + // Instantiate the client. It requires a channel, out of which the actual RPCs + // are created. This channel models a connection to an endpoint (in this case, + // localhost at the selected port). We indicate that the channel isn't + // authenticated (use of InsecureChannelCredentials()). + std::ostringstream addr; + addr << "localhost:" << selected_port; + GreeterClient greeter(grpc::CreateChannel(addr.str(), grpc::InsecureChannelCredentials())); + std::string user("world"); + std::string reply = greeter.SayHello(user); + std::cout << "Greeter received: " << reply << std::endl; + +#ifdef TEST_ACTUAL_SERVER + server->Shutdown(); + serverThread.join(); +#endif + return 0; +} diff --git a/recipes/grpc/all/test_v1_package/CMakeLists.txt b/recipes/grpc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f16bc97992e86 --- /dev/null +++ b/recipes/grpc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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/grpc/all/test_v1_package/conanfile.py b/recipes/grpc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5fbf37e412127 --- /dev/null +++ b/recipes/grpc/all/test_v1_package/conanfile.py @@ -0,0 +1,55 @@ +from conans import ConanFile, CMake, tools +import contextlib +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.build_requires(str(self.requires["grpc"])) + + @contextlib.contextmanager + def _buildenv(self): + # TODO: conan v2: replace by VirtualBuildEnv and always add grpc to build requirements + if tools.cross_building(self): + yield + else: + with tools.run_environment(self): + yield + + @property + def macos_grpc_shared(self): + # Due to SIP limitations on newer macOS, `DYLD_LIBRARY_PATH`, which is set + # by `tools.run_environment`, will not be propagated properly, see + # https://stackoverflow.com/questions/35568122/why-isnt-dyld-library-path-being-propagated-here + return self.settings.os == "Macos" and self.options["grpc"].shared + + def build(self): + # TODO: always build in conan v2 + # this is a limitation of conan v1: + # at build time we want to inject PATH/LD_LIBRARY/DYLD_LIBRARY_PATH + # of build requirements so that gprc_cpp_plugin can find its + # shared dependencies (in build context as well) + # should be fixed by using: CMakeToolchain + VirtualBuildEnv + if (tools.cross_building(self) and self.options["grpc"].shared) or self.macos_grpc_shared: + self.output.warning("Skipping build of test_package due to limitation propagating " + "runtime environment when invoking protoc and grpc_cpp_plugin. " + "For a working example, please see the newer Conan 2.0 compatible " + "test package.") + return + with self._buildenv(): + cmake = CMake(self) + # FIXME: This combination of settings randomly fails in CI + cmake.definitions["TEST_ACTUAL_SERVER"] = not (self.settings.compiler == "Visual Studio" + and self.settings.compiler.version == "15" + and self.settings.build_type == "Release") + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self) and not self.macos_grpc_shared: + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/grpc/config.yml b/recipes/grpc/config.yml new file mode 100644 index 0000000000000..d36f53e1f178c --- /dev/null +++ b/recipes/grpc/config.yml @@ -0,0 +1,9 @@ +versions: + "1.50.1": + folder: "all" + "1.50.0": + folder: "all" + "1.47.1": + folder: "all" + "1.46.3": + folder: "all" diff --git a/recipes/gsl-lite/all/conandata.yml b/recipes/gsl-lite/all/conandata.yml new file mode 100644 index 0000000000000..010ad6b469c3c --- /dev/null +++ b/recipes/gsl-lite/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.40.0": + url: "https://github.com/gsl-lite/gsl-lite/archive/v0.40.0.tar.gz" + sha256: "65af4ec8a1050dac4f1ca4622881bb02a9c3978a9baec289fb56e25412d6cac7" + "0.39.0": + url: "https://github.com/gsl-lite/gsl-lite/archive/v0.39.0.tar.gz" + sha256: "f80ec07d9f4946097a1e2554e19cee4b55b70b45d59e03a7d2b7f80d71e467e9" + "0.38.1": + url: "https://github.com/gsl-lite/gsl-lite/archive/v0.38.1.tar.gz" + sha256: "c2fa2315fff312f3897958903ed4d4e027f73fa44235459ecb467ad7b7d62b18" + "0.38.0": + url: "https://github.com/gsl-lite/gsl-lite/archive/v0.38.0.zip" + sha256: "03c5380b08dd57c0f3d1102a1966cf5e4ec65e72daf75608ab125276b0ae17f8" + "0.37.0": + url: "https://github.com/gsl-lite/gsl-lite/archive/0.37.0.zip" + sha256: "980c8e91dd25bfaac7bfbd7151f04027fa68ff0bf652baa11de137242641e399" + "0.36.0": + url: "https://github.com/martinmoene/gsl-lite/archive/v0.36.0.zip" + sha256: "ab1bb560611dcf9cef2265b8e40e59689bb4af1fd64914aa4a8eff945dd75057" + "0.34.0": + url: "https://github.com/martinmoene/gsl-lite/archive/v0.34.0.zip" + sha256: "44255fd8aab1780773a5a2a16703c9c5a95f8c944d95caa7c468b229c0fcd1ff" diff --git a/recipes/gsl-lite/all/conanfile.py b/recipes/gsl-lite/all/conanfile.py new file mode 100644 index 0000000000000..d59ea8610e6a3 --- /dev/null +++ b/recipes/gsl-lite/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.files import get, copy +import os + +required_conan_version = ">=1.47.0" + + +class GslLiteConan(ConanFile): + name = "gsl-lite" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/gsl-lite" + topics = ("GSL") + description = "A single-file header-only version of ISO C++ " \ + "Guideline Support Library (GSL) for C++98, C++11 and later" + + settings = "os", "arch", "compiler", "build_type" + # There are three configuration options for this GSL implementation's behavior + # when pre/post conditions on the GSL types are violated: + # + # 1. GSL_TERMINATE_ON_CONTRACT_VIOLATION: std::terminate will be called (default) + # 2. GSL_THROW_ON_CONTRACT_VIOLATION: a gsl::fail_fast exception will be thrown + # 3. GSL_UNENFORCED_ON_CONTRACT_VIOLATION: nothing happens + # + options = { + "on_contract_violation": ["terminate", "throw", "unenforced"] + } + default_options = { + "on_contract_violation": "terminate", + } + + no_copy_source = True + + @property + def _source_subfolder(self): + return os.path.join(self.source_folder, "source_subfolder") + + @property + def _contract_map(self): + return { + "terminate": "GSL_TERMINATE_ON_CONTRACT_VIOLATION", + "throw": "GSL_THROW_ON_CONTRACT_VIOLATION", + "unenforced": "GSL_UNENFORCED_ON_CONTRACT_VIOLATION" + } + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + copy(self, "*gsl-lite.hpp", src=self._source_subfolder, dst=self.package_folder) + copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gsl-lite") + self.cpp_info.set_property("cmake_target_name", "gsl::gsl-lite") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["gsllite"].defines = [self._contract_map[str(self.options.on_contract_violation)]] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "gsl-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "gsl-lite" + self.cpp_info.names["cmake_find_package"] = "gsl" + self.cpp_info.names["cmake_find_package_multi"] = "gsl" + self.cpp_info.components["gsllite"].names["cmake_find_package"] = "gsl-lite" + self.cpp_info.components["gsllite"].names["cmake_find_package_multi"] = "gsl-lite" + self.cpp_info.components["gsllite"].set_property("cmake_target_name", "gsl::gsl-lite") diff --git a/recipes/gsl-lite/all/test_package/CMakeLists.txt b/recipes/gsl-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0063a1958556f --- /dev/null +++ b/recipes/gsl-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(gsl-lite REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gsl::gsl-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gsl-lite/all/test_package/conanfile.py b/recipes/gsl-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d60b533632ddd --- /dev/null +++ b/recipes/gsl-lite/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/gsl-lite/all/test_package/test_package.cpp b/recipes/gsl-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0c0489ff79d3e --- /dev/null +++ b/recipes/gsl-lite/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() +{ + char const s[] = "Hello, World!"; + gsl::span sp(s) ; + std::cout << sp << std::endl; +} diff --git a/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt b/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6042a2363b626 --- /dev/null +++ b/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gsl-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gsl::gsl-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gsl-lite/all/test_v1_package/conanfile.py b/recipes/gsl-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..db36d97f3c465 --- /dev/null +++ b/recipes/gsl-lite/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +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(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/gsl-lite/config.yml b/recipes/gsl-lite/config.yml new file mode 100644 index 0000000000000..d21a23d317e33 --- /dev/null +++ b/recipes/gsl-lite/config.yml @@ -0,0 +1,15 @@ +versions: + "0.40.0": + folder: all + "0.39.0": + folder: all + "0.38.1": + folder: all + "0.38.0": + folder: all + "0.37.0": + folder: all + "0.36.0": + folder: all + "0.34.0": + folder: all diff --git a/recipes/gsl/all/conandata.yml b/recipes/gsl/all/conandata.yml new file mode 100644 index 0000000000000..ae4c67c1283a1 --- /dev/null +++ b/recipes/gsl/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "2.7": + url: "https://ftp.gnu.org/gnu/gsl/gsl-2.7.tar.gz" + sha256: "efbbf3785da0e53038be7907500628b466152dbc3c173a87de1b5eba2e23602b" + "2.6": + url: "https://ftp.gnu.org/gnu/gsl/gsl-2.6.tar.gz" + sha256: "b782339fc7a38fe17689cb39966c4d821236c28018b6593ddb6fd59ee40786a8" +patches: + "2.7": + - patch_file: "patches/0001-windows-support.patch" + - patch_file: "patches/0002-export-all-gsl_-symbols.patch" + "2.6": + - patch_file: "patches/0001-windows-support.patch" + - patch_file: "patches/0002-export-all-gsl_-symbols.patch" diff --git a/recipes/gsl/all/conanfile.py b/recipes/gsl/all/conanfile.py new file mode 100644 index 0000000000000..ed26f83de3863 --- /dev/null +++ b/recipes/gsl/all/conanfile.py @@ -0,0 +1,143 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class GslConan(ConanFile): + name = "gsl" + description = "GNU Scientific Library" + homepage = "https://www.gnu.org/software/gsl" + topics = ("numerical", "math", "random", "scientific") + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-or-later" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if self.settings.os == "Windows": + tc.extra_defines.extend(["HAVE_WIN_IEEE_INTERFACE", "WIN32"]) + if self.options.shared: + tc.extra_defines.append("GSL_DLL") + if self.settings.os == "Linux" and "x86" in self.settings.arch: + tc.extra_defines.append("HAVE_GNUX86_IEEE_INTERFACE") + if is_msvc(self): + tc.configure_args.extend([ + "ac_cv_func_memcpy=yes", + "ac_cv_func_memmove=yes", + "ac_cv_c_c99inline=no", + ]) + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.c", os.path.join(self.package_folder, "include", "gsl")) + rm(self, "gsl-config", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: + pjoin = lambda p: os.path.join(self.package_folder, "lib", p) + rename(self, pjoin("gsl.dll.lib"), pjoin("gsl.lib")) + rename(self, pjoin("gslcblas.dll.lib"), pjoin("gslcblas.lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "GSL") + self.cpp_info.set_property("cmake_target_name", "GSL::gsl") + self.cpp_info.set_property("pkg_config_name", "gsl") + + self.cpp_info.components["libgsl"].set_property("cmake_target_name", "GSL::gsl") + self.cpp_info.components["libgsl"].libs = ["gsl"] + self.cpp_info.components["libgsl"].requires = ["libgslcblas"] + + self.cpp_info.components["libgslcblas"].set_property("cmake_target_name", "GSL::gslcblas") + self.cpp_info.components["libgslcblas"].libs = ["gslcblas"] + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["libgsl"].system_libs = ["m"] + self.cpp_info.components["libgslcblas"].system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "GSL" + self.cpp_info.names["cmake_find_package_multi"] = "GSL" + self.cpp_info.components["libgsl"].names["cmake_find_package"] = "gsl" + self.cpp_info.components["libgsl"].names["cmake_find_package_multi"] = "gsl" + self.cpp_info.components["libgslcblas"].names["cmake_find_package"] = "gslcblas" + self.cpp_info.components["libgslcblas"].names["cmake_find_package_multi"] = "gslcblas" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/gsl/all/patches/0001-windows-support.patch b/recipes/gsl/all/patches/0001-windows-support.patch new file mode 100644 index 0000000000000..37c78c8b5731a --- /dev/null +++ b/recipes/gsl/all/patches/0001-windows-support.patch @@ -0,0 +1,90 @@ +From https://github.com/ampl/gsl/blob/master/ieee-utils/fp-win.c + +--- /dev/null ++++ ieee-utils/fp-win.c +@@ -0,0 +1,70 @@ ++/* fp-win.c ++ * ++ * Author: Brian Gladman ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ */ ++ ++#include ++ ++#include ++#include ++#include ++ ++const char *fp_env_string = "round-to-nearest,double-precision,mask-all"; ++ ++int ++gsl_ieee_set_mode (int precision, int rounding, int exception_mask) ++{ ++ unsigned int old, mode = _DN_SAVE, mask = _MCW_DN | _MCW_RC | _MCW_EM; ++ ++ switch(precision) ++ { ++ case GSL_IEEE_SINGLE_PRECISION: mode |= _PC_24; break; ++ case GSL_IEEE_EXTENDED_PRECISION: mode |= _PC_64; break; ++ case GSL_IEEE_DOUBLE_PRECISION: ++ default: mode |= _PC_53; ++ } ++#ifndef _M_AMD64 ++ mask |= _MCW_PC; ++#endif ++ ++ switch(rounding) ++ { ++ case GSL_IEEE_ROUND_DOWN: mode |= _RC_DOWN; break; ++ case GSL_IEEE_ROUND_UP: mode |= _RC_UP; break; ++ case GSL_IEEE_ROUND_TO_ZERO: mode |= _RC_CHOP; break; ++ case GSL_IEEE_ROUND_TO_NEAREST: ++ default: mode |= _RC_NEAR; ++ } ++ ++ if(exception_mask & GSL_IEEE_MASK_INVALID) ++ mode |= _EM_INVALID; ++ if(exception_mask & GSL_IEEE_MASK_DENORMALIZED) ++ mode |= _EM_DENORMAL; ++ if(exception_mask & GSL_IEEE_MASK_DIVISION_BY_ZERO) ++ mode |= _EM_ZERODIVIDE; ++ if(exception_mask & GSL_IEEE_MASK_OVERFLOW) ++ mode |= _EM_OVERFLOW; ++ if(exception_mask & GSL_IEEE_MASK_UNDERFLOW) ++ mode |= _EM_UNDERFLOW; ++ if(exception_mask & GSL_IEEE_TRAP_INEXACT) ++ mode &= ~_EM_INEXACT; ++ else ++ mode |= _EM_INEXACT; ++ ++ _controlfp_s( &old, mode, mask); ++ return GSL_SUCCESS; ++} +--- ieee-utils/fp.c ++++ ieee-utils/fp.c +@@ -26,8 +26,10 @@ + #include "fp-freebsd.c" + #elif HAVE_OS2EMX_IEEE_INTERFACE + #include "fp-os2emx.c" +-#elif HAVE_NETBSD_IEEE_INTERFACE +-#include "fp-netbsd.c" ++#elif HAVE_WIN_IEEE_INTERFACE ++#include "fp-win.c" ++#elif HAVE_OPENBSD_IEEE_INTERFACE ++#include "fp-openbsd.c" + #elif HAVE_OPENBSD_IEEE_INTERFACE + #include "fp-openbsd.c" + /* Try to handle universal binaries */ diff --git a/recipes/gsl/all/patches/0002-export-all-gsl_-symbols.patch b/recipes/gsl/all/patches/0002-export-all-gsl_-symbols.patch new file mode 100644 index 0000000000000..f06b70f58939f --- /dev/null +++ b/recipes/gsl/all/patches/0002-export-all-gsl_-symbols.patch @@ -0,0 +1,12 @@ +Fixes building a shared library with mingw@Windows +--- Makefile.am ++++ Makefile.am +@@ -20,7 +20,7 @@ + lib_LTLIBRARIES = libgsl.la + libgsl_la_SOURCES = version.c + libgsl_la_LIBADD = $(GSL_LIBADD) $(SUBLIBS) +-libgsl_la_LDFLAGS = $(GSL_LDFLAGS) -version-info $(GSL_LT_VERSION) ++libgsl_la_LDFLAGS = $(GSL_LDFLAGS) -version-info $(GSL_LT_VERSION) -export-symbols-regex '^gsl_' + noinst_HEADERS = templates_on.h templates_off.h build.h + + m4datadir = $(datadir)/aclocal diff --git a/recipes/gsl/all/test_package/CMakeLists.txt b/recipes/gsl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..808366bc0e673 --- /dev/null +++ b/recipes/gsl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(GSL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GSL::gsl) diff --git a/recipes/gsl/all/test_package/conanfile.py b/recipes/gsl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gsl/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/gsl/all/test_package/test_package.c b/recipes/gsl/all/test_package/test_package.c new file mode 100644 index 0000000000000..f0b03b16cad40 --- /dev/null +++ b/recipes/gsl/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include + +/** + * The example program from the GSL documentation + * http://www.gnu.org/software/gsl/doc/html/usage.html#an-example-program + */ + +int main() { + double x = 5.0; + double y = gsl_sf_bessel_J0 (x); + printf ("J0(%g) = %.18e\n", x, y); + return 0; +} diff --git a/recipes/gsl/all/test_v1_package/CMakeLists.txt b/recipes/gsl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gsl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gsl/all/test_v1_package/conanfile.py b/recipes/gsl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/gsl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gsl/config.yml b/recipes/gsl/config.yml new file mode 100644 index 0000000000000..15814520e1bfd --- /dev/null +++ b/recipes/gsl/config.yml @@ -0,0 +1,5 @@ +versions: + "2.7": + folder: all + "2.6": + folder: all diff --git a/recipes/gsoap/all/CMakeLists.txt b/recipes/gsoap/all/CMakeLists.txt new file mode 100644 index 0000000000000..ff37f753a87ae --- /dev/null +++ b/recipes/gsoap/all/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.0) +project(gSOAP) + +include(GNUInstallDirs) + +option(BUILD_TOOLS "Build soapcpp2 and wsdl2h" ON) +option(BUILD_GSOAP "Build gsoap library" ON) + +message("Generate gSOAP from sources at ${GSOAP_PATH}") + +if(${WITH_OPENSSL}) + find_package(OpenSSL REQUIRED) + find_package(ZLIB REQUIRED) +endif() + +# Tools +if(${BUILD_TOOLS}) + include(${PROJECT_SOURCE_DIR}/cmake/soapcpp2.cmake) + include(${PROJECT_SOURCE_DIR}/cmake/wsdl2h.cmake) + + install(FILES ${GSOAP_PATH}/gsoap/typemap.dat DESTINATION res) + install(DIRECTORY ${GSOAP_PATH}/gsoap/import DESTINATION ${CMAKE_INSTALL_BINDIR} + FILES_MATCHING PATTERN "*.h") +endif() + +# Libraries +if(${BUILD_GSOAP}) + include(${PROJECT_SOURCE_DIR}/cmake/gsoap.cmake) +endif() diff --git a/recipes/gsoap/all/cmake/gsoap.cmake b/recipes/gsoap/all/cmake/gsoap.cmake new file mode 100644 index 0000000000000..c42821ef6f350 --- /dev/null +++ b/recipes/gsoap/all/cmake/gsoap.cmake @@ -0,0 +1,71 @@ + +# Generate requested libraries: +# - gsoap +# - gsoap++ +# - gsoapssl +# - gsoapssl++ + + +# C library +set(SRCS_GSOAP_C + ${GSOAP_PATH}/gsoap/stdsoap2.c + ${GSOAP_PATH}/gsoap/dom.c +) +set_source_files_properties(${SRCS_GSOAP_C} PROPERTIES LANGUAGE C) +add_library(gsoap ${SRCS_GSOAP_C} ${GSOAP_PATH}/gsoap/stdsoap2.h) +set_target_properties(gsoap PROPERTIES + PUBLIC_HEADER ${GSOAP_PATH}/gsoap/stdsoap2.h + DEFINE_SYMBOL "SOAP_STD_EXPORTS" + LINKER_LANGUAGE C + ) +install(TARGETS gsoap + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + +# CXX library +set(SRCS_GSOAP_CXX + ${GSOAP_PATH}/gsoap/stdsoap2.cpp + ${GSOAP_PATH}/gsoap/dom.cpp +) +set_source_files_properties(${SRCS_GSOAP_CXX} PROPERTIES LANGUAGE CXX) +add_library(gsoap++ ${SRCS_GSOAP_CXX} ${GSOAP_PATH}/gsoap/stdsoap2.h) +set_target_properties(gsoap++ PROPERTIES + PUBLIC_HEADER ${GSOAP_PATH}/gsoap/stdsoap2.h + DEFINE_SYMBOL "SOAP_STD_EXPORTS" + LINKER_LANGUAGE CXX + ) +install(TARGETS gsoap++ + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + +# Add SSL if requested +if(${WITH_OPENSSL}) + target_include_directories(gsoap PRIVATE ${GSOAP_PATH}/gsoap/plugin) + target_compile_definitions(gsoap PUBLIC WITH_OPENSSL WITH_GZIP) + set_target_properties(gsoap PROPERTIES OUTPUT_NAME gsoapssl) + target_link_libraries(gsoap PUBLIC OpenSSL::Crypto OpenSSL::SSL ZLIB::ZLIB) + + target_include_directories(gsoap++ PRIVATE ${GSOAP_PATH}/gsoap/plugin) + target_compile_definitions(gsoap++ PUBLIC WITH_OPENSSL WITH_GZIP) + set_target_properties(gsoap++ PROPERTIES OUTPUT_NAME gsoapssl++) + target_link_libraries(gsoap++ PUBLIC OpenSSL::Crypto OpenSSL::SSL ZLIB::ZLIB) +endif() +if(${WITH_IPV6}) + target_compile_definitions(gsoap PUBLIC WITH_IPV6) + target_compile_definitions(gsoap++ PUBLIC WITH_IPV6) +endif() +if(${WITH_COOKIES}) + target_compile_definitions(gsoap PUBLIC WITH_COOKIES) + target_compile_definitions(gsoap++ PUBLIC WITH_COOKIES) +endif() +if(${WITH_C_LOCALE}) + target_compile_definitions(gsoap PUBLIC WITH_C_LOCALE) + target_compile_definitions(gsoap++ PUBLIC WITH_C_LOCALE) +endif() diff --git a/recipes/gsoap/all/cmake/soapcpp2.cmake b/recipes/gsoap/all/cmake/soapcpp2.cmake new file mode 100644 index 0000000000000..c625c2461a633 --- /dev/null +++ b/recipes/gsoap/all/cmake/soapcpp2.cmake @@ -0,0 +1,65 @@ + +# Generate project for soapcpp2 executable + +set(STDCPP2_PATH ${GSOAP_PATH}/gsoap/src) + +set(SRC_CPP + ${STDCPP2_PATH}/symbol2.c + ${STDCPP2_PATH}/error2.c + ${STDCPP2_PATH}/init2.c + ${STDCPP2_PATH}/soapcpp2.c + ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c + ${CMAKE_BINARY_DIR}/generated/lex.yy.c + ) +set_source_files_properties(${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c PROPERTIES GENERATED TRUE) +set_source_files_properties(${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.h PROPERTIES GENERATED TRUE) +set_source_files_properties(${CMAKE_BINARY_DIR}/generated/lex.yy.c PROPERTIES GENERATED TRUE) + +# Create the generated folder +add_custom_target(create-generated-folder ALL + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/generated) + +if(WIN32) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c + COMMAND win_bison.exe -d -v -o ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c ${STDCPP2_PATH}/soapcpp2_yacc.y + COMMENT "Run BISON on soapcpp2" + ) + + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/generated/lex.yy.c + COMMAND win_flex.exe -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l + COMMENT "Run FLEX on soapcpp2" + ) + +else() + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c + COMMAND yacc -d -v -o ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c ${STDCPP2_PATH}/soapcpp2_yacc.y + COMMENT "Run YACC on soapcpp2" + ) + + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/generated/lex.yy.c + COMMAND flex -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l + COMMENT "Run FLEX on soapcpp2" + ) +endif() + +add_custom_target(FLEXBISON_GENERATORS + DEPENDS + ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c + ${CMAKE_BINARY_DIR}/generated/lex.yy.c) + + +add_dependencies(FLEXBISON_GENERATORS create-generated-folder) + +add_executable(soapcpp2 ${SRC_CPP}) +if(${WITH_OPENSSL}) + target_compile_definitions(soapcpp2 PUBLIC WITH_OPENSSL WITH_GZIP) + target_link_libraries(soapcpp2 PUBLIC OpenSSL::Crypto OpenSSL::SSL ZLIB::ZLIB) +endif() +target_include_directories(soapcpp2 PRIVATE ${STDCPP2_PATH}) +set_source_files_properties(${SRC_CPP} PROPERTIES LANGUAGE C) +add_dependencies(soapcpp2 FLEXBISON_GENERATORS) +install(TARGETS soapcpp2 DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/recipes/gsoap/all/cmake/wsdl2h.cmake b/recipes/gsoap/all/cmake/wsdl2h.cmake new file mode 100644 index 0000000000000..2165d031400e0 --- /dev/null +++ b/recipes/gsoap/all/cmake/wsdl2h.cmake @@ -0,0 +1,64 @@ + +# Generate project for wsdl2h + +set(WSDL2H_PATH ${GSOAP_PATH}/gsoap/wsdl) + +set(SRC_CPP + ${WSDL2H_PATH}/wsdl2h.cpp + ${WSDL2H_PATH}/wsdl.cpp + ${WSDL2H_PATH}/wadl.cpp + ${WSDL2H_PATH}/schema.cpp + ${WSDL2H_PATH}/soap.cpp + ${WSDL2H_PATH}/mime.cpp + ${WSDL2H_PATH}/wsp.cpp + ${WSDL2H_PATH}/bpel.cpp + ${WSDL2H_PATH}/types.cpp + ${WSDL2H_PATH}/service.cpp + ${WSDL2H_PATH}/../stdsoap2.cpp + ${CMAKE_BINARY_DIR}/generated/wsdlC.cpp + ) + +if(${WITH_OPENSSL}) + list(APPEND SRC_CPP + ${GSOAP_PATH}/gsoap/plugin/httpda.c + ${GSOAP_PATH}/gsoap/plugin/smdevp.c + ${GSOAP_PATH}/gsoap/plugin/threads.c + ) +endif() + +set_source_files_properties(${SRC_CPP} PROPERTIES LANGUAGE CXX) +set_source_files_properties(${CMAKE_BINARY_DIR}/generated/wsdlC.cpp PROPERTIES GENERATED TRUE) + +# Search for soapcpp2 executable +if(CMAKE_CROSSCOMPILING) + find_program(SOAPCPP2_PROGRAM soapcpp2 PATHS ENV PATH NO_DEFAULT_PATH) +endif() +if(NOT SOAPCPP2_PROGRAM) + set(SOAPCPP2_PROGRAM $) +endif() + +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/generated/wsdlC.cpp + COMMAND ${SOAPCPP2_PROGRAM} -I${GSOAP_PATH}/gsoap/import -SC -pwsdl -d${CMAKE_BINARY_DIR}/generated ${WSDL2H_PATH}/wsdl.h + COMMENT "Parsing WSDL and Schema definitions" + WORKING_DIRECTORY ${WSDL2H_PATH} + ) + +add_custom_target(WSDL2H_GENERATORS + DEPENDS + ${CMAKE_BINARY_DIR}/generated/wsdlC.cpp) + +add_executable(wsdl2h ${SRC_CPP}) +target_include_directories(wsdl2h + PRIVATE ${GSOAP_PATH}/gsoap + PRIVATE ${CMAKE_BINARY_DIR}/generated + PRIVATE ${WSDL2H_PATH}) +add_dependencies(wsdl2h WSDL2H_GENERATORS) +if(${WITH_OPENSSL}) + find_package(ZLIB REQUIRED) + target_include_directories(wsdl2h PRIVATE ${GSOAP_PATH}/gsoap/plugin) + target_compile_definitions(wsdl2h PRIVATE WITH_OPENSSL WITH_GZIP) + target_link_libraries(wsdl2h OpenSSL::Crypto OpenSSL::SSL ZLIB::ZLIB) +endif() + +install(TARGETS wsdl2h DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/recipes/gsoap/all/conandata.yml b/recipes/gsoap/all/conandata.yml new file mode 100644 index 0000000000000..4a616af7b7a29 --- /dev/null +++ b/recipes/gsoap/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "2.8.117": + url: + - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.117.zip/download" + - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.117.zip" + sha256: "7cadf8808cfd982629948fe09e4fa6cd18e23cafd40df0aaaff1b1f5b695c442" + "2.8.116": + url: + - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.116.zip/download" + - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.116.zip" + sha256: "2a41e42aaddbcd603b99004af95bb83559dbd4fd2d842920f003d24867599192" + "2.8.115": + url: + - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.115.zip/download" + - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.115.zip" + sha256: "6f6813b189d201022254a2879cc8ee005bdb1bcf126bc03238710f19ec4e7268" + "2.8.114": + url: + - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.114.zip/download" + - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.114.zip" + sha256: "aa70a999258100c170a3f8750c1f91318a477d440f6a28117f68bc1ded32327f" diff --git a/recipes/gsoap/all/conanfile.py b/recipes/gsoap/all/conanfile.py new file mode 100644 index 0000000000000..38b4629ae4211 --- /dev/null +++ b/recipes/gsoap/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.52.0" + + +class GsoapConan(ConanFile): + name = "gsoap" + description = "The gSOAP toolkit is a C and C++ software development toolkit for SOAP and " \ + "REST XML Web services and generic C/C++ XML data bindings." + license = ("gSOAP-1.3b", "GPL-2.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/gsoap2" + topics = ("logging",) + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_openssl": [True, False], + "with_ipv6": [True, False], + "with_cookies": [True, False], + "with_c_locale": [True, False], + } + default_options = { + "fPIC": True, + "with_openssl": True, + "with_ipv6": True, + "with_cookies": True, + "with_c_locale": True, + } + + exports_sources = "CMakeLists.txt", "cmake/*.cmake" + short_paths = 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 layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + self.requires("zlib/1.2.13") + + def build_requirements(self): + if cross_building(self, skip_x64_x86=True) and hasattr(self, "settings_build"): + self.tool_requires(f"gsoap/{self.version}") + + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + toolchain = CMakeToolchain(self) + toolchain.variables["GSOAP_PATH"] = self.source_folder.replace("\\", "/") + toolchain.variables["BUILD_TOOLS"] = True + toolchain.variables["WITH_OPENSSL"] = self.options.with_openssl + toolchain.variables["WITH_IPV6"] = self.options.with_ipv6 + toolchain.variables["WITH_COOKIES"] = self.options.with_cookies + toolchain.variables["WITH_C_LOCALE"] = self.options.with_c_locale + toolchain.generate() + + deps = CMakeDeps(self) + deps.generate() + + ms = VirtualBuildEnv(self) + ms.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, "GPLv2_license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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): + defines = [] + if self.options.with_openssl: + libs = ["gsoapssl++", ] + defines.append("WITH_OPENSSL") + defines.append("WITH_GZIP") + else: + libs = ["gsoap++", ] + self.cpp_info.libs = libs + + if self.options.with_ipv6: + defines.append("WITH_IPV6") + if self.options.with_cookies: + defines.append("WITH_COOKIES") + if self.options.with_c_locale: + defines.append("WITH_C_LOCALE") + self.cpp_info.defines = defines diff --git a/recipes/gsoap/all/test_package/CMakeLists.txt b/recipes/gsoap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1464ab750d83b --- /dev/null +++ b/recipes/gsoap/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(gsoap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} + test_package.cpp + ${CMAKE_BINARY_DIR}/soapC.cpp + ${CMAKE_BINARY_DIR}/soapcalcProxy.cpp +) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE gsoap::gsoap) diff --git a/recipes/gsoap/all/test_package/calc.nsmap b/recipes/gsoap/all/test_package/calc.nsmap new file mode 100644 index 0000000000000..2dd595326c7dd --- /dev/null +++ b/recipes/gsoap/all/test_package/calc.nsmap @@ -0,0 +1,11 @@ + +#include "stdsoap2.h" +/* This defines the global XML namespaces[] table to #include and compile */ +SOAP_NMAC struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns2", "urn:calc", NULL, NULL }, + { NULL, NULL, NULL, NULL} + }; diff --git a/recipes/gsoap/all/test_package/calc.wsdl b/recipes/gsoap/all/test_package/calc.wsdl new file mode 100644 index 0000000000000..d68041066fb8e --- /dev/null +++ b/recipes/gsoap/all/test_package/calc.wsdl @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service definition of function ns__add + + + + + Service definition of function ns__sub + + + + + Service definition of function ns__mul + + + + + Service definition of function ns__div + + + + + Service definition of function ns__pow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gSOAP 2.7.9k generated service definition + + + + + + diff --git a/recipes/gsoap/all/test_package/conanfile.py b/recipes/gsoap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1ea623e022729 --- /dev/null +++ b/recipes/gsoap/all/test_package/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile, conan_version +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.scm import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + 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() + + def build(self): + 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}") + if Version(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") + + 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/gsoap/all/test_package/test_package.cpp b/recipes/gsoap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bf5391ec2d579 --- /dev/null +++ b/recipes/gsoap/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ + +#include "calc.nsmap" // XML namespace mapping table (only needed once at the global level) +#include "soapcalcProxy.h" // the proxy class, also #includes "soapH.h" and "soapStub.h" +#include + +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); +} diff --git a/recipes/gsoap/all/test_v1_package/CMakeLists.txt b/recipes/gsoap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gsoap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gsoap/all/test_v1_package/conanfile.py b/recipes/gsoap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..27d9e27609d72 --- /dev/null +++ b/recipes/gsoap/all/test_v1_package/conanfile.py @@ -0,0 +1,32 @@ +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): + calc_wsdl = os.path.join(self.source_folder, os.pardir, "test_package", "calc.wsdl") + self.output.info(f"Generating code from WSDL '{calc_wsdl}'") + self.run(f"wsdl2h -o calc.h {calc_wsdl}") + import_dir = os.path.join(self.deps_cpp_info["gsoap"].rootpath, "bin", "import") + self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h") + + 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/gsoap/config.yml b/recipes/gsoap/config.yml new file mode 100644 index 0000000000000..01534d05392ba --- /dev/null +++ b/recipes/gsoap/config.yml @@ -0,0 +1,9 @@ +versions: + "2.8.117": + folder: all + "2.8.116": + folder: all + "2.8.115": + folder: all + "2.8.114": + folder: all diff --git a/recipes/gst-libav/all/conandata.yml b/recipes/gst-libav/all/conandata.yml new file mode 100644 index 0000000000000..a62d1f5aa8b77 --- /dev/null +++ b/recipes/gst-libav/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.19.1": + url: "https://gitlab.freedesktop.org/gstreamer/gst-libav/-/archive/1.19.1/gst-libav-1.19.1.tar.bz2" + sha256 : "771b55f9de7f81153b12c0d2d562e82d4119fcb6e5983bcf51c872dfbe2f5edc" diff --git a/recipes/gst-libav/all/conanfile.py b/recipes/gst-libav/all/conanfile.py new file mode 100644 index 0000000000000..04e247c12ac12 --- /dev/null +++ b/recipes/gst-libav/all/conanfile.py @@ -0,0 +1,170 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import msvc_runtime_flag +import glob +import os +import shutil + + +class GStLibAVConan(ConanFile): + name = "gst-libav" + description = "GStreamer is a development framework for creating applications like media players, video editors, " \ + "streaming media broadcasters and so on" + topics = ("gstreamer", "multimedia", "video", "audio", "broadcasting", "framework", "media") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gstreamer.freedesktop.org/" + license = "GPL-2.0-only" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_introspection": False, + } + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + exports_sources = ["patches/*.patch"] + + generators = "pkg_config" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def validate(self): + if self.options.shared != self.options["gstreamer"].shared or \ + self.options.shared != self.options["glib"].shared or \ + self.options.shared != self.options["gst-plugins-base"].shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("GLib, GStreamer and GstPlugins must be either all shared, or all static") + if tools.Version(self.version) >= "1.18.2" and\ + self.settings.compiler == "gcc" and\ + tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "gst-plugins-good %s does not support gcc older than 5" % self.version + ) + if self.options.shared and str(msvc_runtime_flag(self)).startswith("MT"): + raise ConanInvalidConfiguration('shared build with static runtime is not supported due to the FlsAlloc limit') + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + self.options['gstreamer'].shared = self.options.shared + self.options['gst-plugins-base'].shared = self.options.shared + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def requirements(self): + self.requires("glib/2.70.1") + self.requires("gstreamer/1.19.1") + self.requires("gst-plugins-base/1.19.1") + self.requires('ffmpeg/4.4') + if self.settings.os == 'Linux': + self.requires('libalsa/1.2.5.1') # temp - conflict with gst-plugins-base + + def build_requirements(self): + self.build_requires("meson/0.54.2") + if not tools.which("pkg-config"): + self.build_requires("pkgconf/1.7.4") + if self.settings.os == 'Windows': + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + if self.options.with_introspection: + self.build_requires("gobject-introspection/1.68.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_meson(self): + defs = dict() + + def add_flag(name, value): + if name in defs: + defs[name] += " " + value + else: + defs[name] = value + + def add_compiler_flag(value): + add_flag("c_args", value) + add_flag("cpp_args", value) + + def add_linker_flag(value): + add_flag("c_link_args", value) + add_flag("cpp_link_args", value) + + meson = Meson(self) + if self.settings.compiler == "Visual Studio": + add_linker_flag("-lws2_32") + add_compiler_flag("-%s" % self.settings.compiler.runtime) + if int(str(self.settings.compiler.version)) < 14: + add_compiler_flag("-Dsnprintf=_snprintf") + if self.settings.get_safe("compiler.runtime"): + defs["b_vscrt"] = str(self.settings.compiler.runtime).lower() + defs["tools"] = "disabled" + defs["examples"] = "disabled" + defs["benchmarks"] = "disabled" + defs["tests"] = "disabled" + defs["wrap_mode"] = "nofallback" + defs["introspection"] = "enabled" if self.options.with_introspection else "disabled" + meson.configure(build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + defs=defs) + return meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def _fix_library_names(self, path): + # regression in 1.16 + if self.settings.compiler == "Visual Studio": + with tools.chdir(path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info("rename %s into %s" % (filename_old, filename_new)) + shutil.move(filename_old, filename_new) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + + self._fix_library_names(os.path.join(self.package_folder, "lib")) + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_info(self): + + plugins = ["libav"] + + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + if self.options.shared: + self.output.info("Appending GST_PLUGIN_PATH env var : %s" % gst_plugin_path) + self.cpp_info.bindirs.append(gst_plugin_path) + self.runenv_info.prepend_path("GST_PLUGIN_PATH", gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + else: + self.cpp_info.defines.append("GST_LIBAV_STATIC") + self.cpp_info.libdirs.append(gst_plugin_path) + self.cpp_info.libs.extend(["gst%s" % plugin for plugin in plugins]) + + self.cpp_info.includedirs = ["include", os.path.join("include", "gstreamer-1.0")] diff --git a/recipes/gst-libav/all/test_package/CMakeLists.txt b/recipes/gst-libav/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f22364a6eaec9 --- /dev/null +++ b/recipes/gst-libav/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gst-libav CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gst-libav::gst-libav) diff --git a/recipes/gst-libav/all/test_package/conanfile.py b/recipes/gst-libav/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gst-libav/all/test_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/gst-libav/all/test_package/test_package.cpp b/recipes/gst-libav/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..290f444c910bd --- /dev/null +++ b/recipes/gst-libav/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include +#include + +#ifdef GST_LIBAV_STATIC + +extern "C" +{ + GST_PLUGIN_STATIC_DECLARE(libav); +} + +#endif + +#include + +int main(int argc, char * argv[]) +{ + gst_init(&argc, &argv); + +#ifdef GST_LIBAV_STATIC + + GST_PLUGIN_STATIC_REGISTER(libav); + +#endif + + GstElement * avdec_mjpeg = gst_element_factory_make("avdec_mjpeg", NULL); + if (!avdec_mjpeg) { + std::cerr << "failed to create avdec_mjpeg element" << std::endl; + return -1; + } else { + std::cout << "avdec_mjpeg has been created successfully" << std::endl; + } + gst_object_unref(GST_OBJECT(avdec_mjpeg)); + return 0; +} diff --git a/recipes/gst-libav/config.yml b/recipes/gst-libav/config.yml new file mode 100644 index 0000000000000..e20650f02a0e5 --- /dev/null +++ b/recipes/gst-libav/config.yml @@ -0,0 +1,3 @@ +versions: + "1.19.1": + folder: all diff --git a/recipes/gst-plugins-bad/all/conandata.yml b/recipes/gst-plugins-bad/all/conandata.yml new file mode 100644 index 0000000000000..602ab1c11e3e2 --- /dev/null +++ b/recipes/gst-plugins-bad/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.19.1": + url: "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/archive/1.19.1/gst-plugins-bad-1.19.1.tar.bz2" + sha256 : "eef44e835a8425a79d69241853040a24769067707c1012ade5cae55175392dcf" diff --git a/recipes/gst-plugins-bad/all/conanfile.py b/recipes/gst-plugins-bad/all/conanfile.py new file mode 100644 index 0000000000000..12454eb3c5747 --- /dev/null +++ b/recipes/gst-plugins-bad/all/conanfile.py @@ -0,0 +1,232 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import msvc_runtime_flag +import glob +import os +import shutil + + +class GStPluginsBadConan(ConanFile): + name = "gst-plugins-bad" + description = "GStreamer is a development framework for creating applications like media players, video editors, " \ + "streaming media broadcasters and so on" + topics = ("gstreamer", "multimedia", "video", "audio", "broadcasting", "framework", "media") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gstreamer.freedesktop.org/" + license = "GPL-2.0-only" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_introspection": False, + } + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + exports_sources = ["patches/*.patch"] + + generators = "pkg_config" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def validate(self): + if self.options.shared != self.options["gstreamer"].shared or \ + self.options.shared != self.options["glib"].shared or \ + self.options.shared != self.options["gst-plugins-base"].shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("GLib, GStreamer and GstPlugins must be either all shared, or all static") + if tools.Version(self.version) >= "1.18.2" and\ + self.settings.compiler == "gcc" and\ + tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "gst-plugins-bad %s does not support gcc older than 5" % self.version + ) + if self.options.shared and str(msvc_runtime_flag(self)).startswith("MT"): + raise ConanInvalidConfiguration('shared build with static runtime is not supported due to the FlsAlloc limit') + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + self.options['gstreamer'].shared = self.options.shared + self.options['gst-plugins-base'].shared = self.options.shared + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def requirements(self): + self.requires("glib/2.70.1") + self.requires("gstreamer/1.19.1") + self.requires("gst-plugins-base/1.19.1") + + def build_requirements(self): + self.build_requires("meson/0.54.2") + if not tools.which("pkg-config"): + self.build_requires("pkgconf/1.7.4") + if self.settings.os == 'Windows': + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + if self.options.with_introspection: + self.build_requires("gobject-introspection/1.68.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_meson(self): + defs = dict() + + def add_flag(name, value): + if name in defs: + defs[name] += " " + value + else: + defs[name] = value + + def add_compiler_flag(value): + add_flag("c_args", value) + add_flag("cpp_args", value) + + def add_linker_flag(value): + add_flag("c_link_args", value) + add_flag("cpp_link_args", value) + + meson = Meson(self) + if self.settings.compiler == "Visual Studio": + add_linker_flag("-lws2_32") + add_compiler_flag("-%s" % self.settings.compiler.runtime) + if int(str(self.settings.compiler.version)) < 14: + add_compiler_flag("-Dsnprintf=_snprintf") + if self.settings.get_safe("compiler.runtime"): + defs["b_vscrt"] = str(self.settings.compiler.runtime).lower() + defs["tools"] = "disabled" + defs["examples"] = "disabled" + defs["benchmarks"] = "disabled" + defs["tests"] = "disabled" + defs["wrap_mode"] = "nofallback" + defs["introspection"] = "enabled" if self.options.with_introspection else "disabled" + meson.configure(build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + defs=defs) + return meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def _fix_library_names(self, path): + # regression in 1.16 + if self.settings.compiler == "Visual Studio": + with tools.chdir(path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info("rename %s into %s" % (filename_old, filename_new)) + shutil.move(filename_old, filename_new) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + + self._fix_library_names(os.path.join(self.package_folder, "lib")) + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_info(self): + + plugins = ["accurip", + "adpcmdec", + "adpcmenc", + "aiff", + "asfmux", + "audiobuffersplit", + "audiofxbad", + "audiolatency", + "audiomixmatrix", + "audiovisualizers", + "autoconvert", + "bayer", + "camerabin", + "codecalpha", + "coloreffects", + "debugutilsbad", + "dvbsubenc", + "dvbsuboverlay", + "dvdspu", + "faceoverlay", + "festival", + "fieldanalysis", + "freeverb", + "frei0r", + "gaudieffects", + "gdp", + "geometrictransform", + "id3tag", + "inter", + "interlace", + "ivfparse", + "ivtc", + "jp2kdecimator", + "jpegformat", + "rfbsrc", + "midi", + "mpegpsdemux", + "mpegpsmux", + "mpegtsdemux", + "mpegtsmux", + "mxf", + "netsim", + "rtponvif", + "pcapparse", + "pnm", + "proxy", + "legacyrawparse", + "removesilence", + "rist", + "rtmp2", + "rtpmanagerbad", + "sdpelem", + "segmentclip", + "siren", + "smooth", + "speed", + "subenc", + "switchbin", + "timecode", + "transcode", + "videofiltersbad", + "videoframe_audiolevel", + "videoparsersbad", + "videosignal", + "vmnc", + "y4mdec"] + + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + if self.options.shared: + self.output.info("Appending GST_PLUGIN_PATH env var : %s" % gst_plugin_path) + self.cpp_info.bindirs.append(gst_plugin_path) + self.runenv_info.prepend_path("GST_PLUGIN_PATH", gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + else: + self.cpp_info.defines.append("GST_PLUGINS_BAD_STATIC") + self.cpp_info.libdirs.append(gst_plugin_path) + self.cpp_info.libs.extend(["gst%s" % plugin for plugin in plugins]) + + self.cpp_info.includedirs = ["include", os.path.join("include", "gstreamer-1.0")] diff --git a/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt b/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a585dafd3e413 --- /dev/null +++ b/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gst-plugins-bad CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gst-plugins-bad::gst-plugins-bad) diff --git a/recipes/gst-plugins-bad/all/test_package/conanfile.py b/recipes/gst-plugins-bad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gst-plugins-bad/all/test_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/gst-plugins-bad/all/test_package/test_package.cpp b/recipes/gst-plugins-bad/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4c05ffed8b6c3 --- /dev/null +++ b/recipes/gst-plugins-bad/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include +#include + +#ifdef GST_PLUGINS_BAD_STATIC + +extern "C" +{ + GST_PLUGIN_STATIC_DECLARE(mpegpsdemux); +} + +#endif + +#include + +int main(int argc, char * argv[]) +{ + gst_init(&argc, &argv); + +#ifdef GST_PLUGINS_BAD_STATIC + + GST_PLUGIN_STATIC_REGISTER(mpegpsdemux); + +#endif + + GstElement * mpegpsdemux = gst_element_factory_make("mpegpsdemux", NULL); + if (!mpegpsdemux) { + std::cerr << "failed to create mpegpsdemux element" << std::endl; + return -1; + } else { + std::cout << "mpegpsdemux has been created successfully" << std::endl; + } + gst_object_unref(GST_OBJECT(mpegpsdemux)); + return 0; +} diff --git a/recipes/gst-plugins-bad/config.yml b/recipes/gst-plugins-bad/config.yml new file mode 100644 index 0000000000000..e20650f02a0e5 --- /dev/null +++ b/recipes/gst-plugins-bad/config.yml @@ -0,0 +1,3 @@ +versions: + "1.19.1": + folder: all diff --git a/recipes/gst-plugins-base/all/conandata.yml b/recipes/gst-plugins-base/all/conandata.yml new file mode 100644 index 0000000000000..7c043aceb40a4 --- /dev/null +++ b/recipes/gst-plugins-base/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.19.2": + url: "https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/archive/1.19.2/gst-plugins-base-1.19.2.tar.gz" + sha256: "567b3bf2d08ed6602fb56b7aa9debbd5ff4b5957eb8fbb1f945b491695bc8198" + "1.19.1": + url: "https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/archive/1.19.1/gst-plugins-base-1.19.1.tar.bz2" + sha256: "b39338e306502570b49043a9b9df5704043e02c8a2ccba3a5a4f1f6ea410d4b1" diff --git a/recipes/gst-plugins-base/all/conanfile.py b/recipes/gst-plugins-base/all/conanfile.py new file mode 100644 index 0000000000000..55f105d03d691 --- /dev/null +++ b/recipes/gst-plugins-base/all/conanfile.py @@ -0,0 +1,696 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import glob +import os +import shutil + + +class GStPluginsBaseConan(ConanFile): + name = "gst-plugins-base" + description = "GStreamer is a development framework for creating applications like media players, video editors, " \ + "streaming media broadcasters and so on" + topics = ("gstreamer", "multimedia", "video", "audio", "broadcasting", "framework", "media") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gstreamer.freedesktop.org/" + license = "GPL-2.0-only" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libalsa": [True, False], + "with_libpng": [True, False], + "with_libjpeg": [False, "libjpeg", "libjpeg-turbo"], + "with_graphene": [True, False], + "with_pango": [True, False], + "with_ogg": [True, False], + "with_opus": [True, False], + "with_theora": [True, False], + "with_vorbis": [True, False], + "with_gl": [True, False], + "with_egl": [True, False], + "with_wayland": [True, False], + "with_xorg": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libalsa": True, + "with_libpng": True, + "with_libjpeg": "libjpeg", + "with_graphene": True, + "with_pango": True, + "with_ogg": True, + "with_opus": True, + "with_theora": True, + "with_vorbis": True, + "with_gl": True, + "with_egl": True, + "with_wayland": True, + "with_xorg": True, + "with_introspection": False, + } + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + exports_sources = ["patches/*.patch"] + + generators = "pkg_config" + + _gl_api = None + _gl_platform = None + _gl_winsys = None + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def validate(self): + if not self.options["glib"].shared and self.options.shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("shared GStreamer cannot link to static GLib") + if self.options.shared != self.options["gstreamer"].shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("GStreamer and GstPlugins must be either all shared, or all static") + if tools.Version(self.version) >= "1.18.2" and\ + self.settings.compiler == "gcc" and\ + tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "gst-plugins-base %s does not support gcc older than 5" % self.version + ) + if self.options.with_gl and self.options.get_safe("with_wayland") and not self.options.get_safe("with_egl"): + raise ConanInvalidConfiguration("OpenGL support with Wayland requires 'with_egl' turned on!") + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + self.options['gstreamer'].shared = self.options.shared + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.with_libalsa + del self.options.with_wayland + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_egl + del self.options.with_xorg + + def requirements(self): + self.requires("zlib/1.2.12") + self.requires("glib/2.72.0") + self.requires("gstreamer/1.19.2") + if self.options.get_safe("with_libalsa"): + self.requires("libalsa/1.2.5.1") + if self.options.get_safe("with_xorg"): + self.requires("xorg/system") + if self.options.with_gl: + self.requires("opengl/system") + if self.settings.os == "Windows": + self.requires("wglext/cci.20200813") + self.requires('glext/cci.20210420') + if self.options.get_safe("with_egl"): + self.requires("egl/system") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.20.0") + self.requires("wayland-protocols/1.25") + if self.options.with_graphene: + self.requires("graphene/1.10.8") + if self.options.with_libpng: + self.requires("libpng/1.6.37") + if self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9d") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.2") + if self.options.with_ogg: + self.requires("ogg/1.3.5") + if self.options.with_opus: + self.requires("opus/1.3.1") + if self.options.with_theora: + self.requires("theora/1.1.1") + if self.options.with_vorbis: + self.requires("vorbis/1.3.7") + if self.options.with_pango: + self.requires("pango/1.49.3") + + def build_requirements(self): + self.build_requires("meson/0.61.2") + if not tools.which("pkg-config"): + self.build_requires("pkgconf/1.7.4") + if self.settings.os == 'Windows': + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + if self.options.with_introspection: + self.build_requires("gobject-introspection/1.70.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _gl_config(self): + if not self._gl_api or not self._gl_platform or not self._gl_winsys: + gl_api = set() + gl_platform = set() + gl_winsys = set() # TODO: winrt, dispamnx, viv-fb, gbm, android + if self.options.get_safe("with_egl"): + gl_api.add("opengl") + gl_platform.add("egl") + gl_winsys.add("egl") + if self.options.get_safe("with_xorg"): + gl_api.add("opengl") + gl_platform.add("glx") + gl_winsys.add("x11") + if self.options.get_safe("with_wayland"): + gl_api.add("opengl") + gl_platform.add("egl") + gl_winsys.add("wayland") + if self.settings.os == "Macos": + gl_api.add("opengl") + gl_platform.add("cgl") + gl_winsys.add("cocoa") + elif self.settings.os in ["iOS", "tvOS", "watchOS"]: + gl_api.add("gles2") + gl_platform.add("eagl") + gl_winsys.add("eagl") + elif self.settings.os == "Windows": + gl_api.add("opengl") + gl_platform.add("wgl") + gl_winsys.add("win32") + self._gl_api = list(gl_api) + self._gl_platform = list(gl_platform) + self._gl_winsys = list(gl_winsys) + return self._gl_api, self._gl_platform, self._gl_winsys + + def _configure_meson(self): + defs = dict() + + def add_flag(name, value): + if name in defs: + defs[name] += " " + value + else: + defs[name] = value + + def add_compiler_flag(value): + add_flag("c_args", value) + add_flag("cpp_args", value) + + def add_linker_flag(value): + add_flag("c_link_args", value) + add_flag("cpp_link_args", value) + + meson = Meson(self) + if self.settings.compiler == "Visual Studio": + add_linker_flag("-lws2_32") + add_compiler_flag("-%s" % self.settings.compiler.runtime) + if int(str(self.settings.compiler.version)) < 14: + add_compiler_flag("-Dsnprintf=_snprintf") + if self.settings.get_safe("compiler.runtime"): + defs["b_vscrt"] = str(self.settings.compiler.runtime).lower() + + gl_api, gl_platform, gl_winsys = self._gl_config() + + defs["tools"] = "disabled" + defs["examples"] = "disabled" + defs["tests"] = "disabled" + defs["wrap_mode"] = "nofallback" + defs["introspection"] = "enabled" if self.options.with_introspection else "disabled" + defs["orc"] = "disabled" # TODO: orc + defs["gl"] = "enabled" if self.options.with_gl else "disabled" + defs["gl-graphene"] = "enabled" if self.options.with_gl and self.options.with_graphene else "disabled" + defs["gl-png"] = "enabled" if self.options.with_gl and self.options.with_libpng else "disabled" + defs["gl-jpeg"] = "enabled" if self.options.with_gl and self.options.with_libjpeg else "disabled" + defs["gl_api"] = gl_api + defs["gl_platform"] = gl_platform + defs["gl_winsys"] = gl_winsys + defs["alsa"] = "enabled" if self.options.get_safe("with_libalsa") else "disabled" + defs["cdparanoia"] = "disabled" # "enabled" if self.options.with_cdparanoia else "disabled" # TODO: cdparanoia + defs["libvisual"] = "disabled" # "enabled" if self.options.with_libvisual else "disabled" # TODO: libvisual + defs["ogg"] = "enabled" if self.options.with_ogg else "disabled" + defs["opus"] = "enabled" if self.options.with_opus else "disabled" + defs["pango"] = "enabled" if self.options.with_pango else "disabled" + defs["theora"] = "enabled" if self.options.with_theora else "disabled" + defs["tremor"] = "disabled" # "enabled" if self.options.with_tremor else "disabled" # TODO: tremor - only useful on machines without floating-point support + defs["vorbis"] = "enabled" if self.options.with_vorbis else "disabled" + defs["x11"] = "enabled" if self.options.get_safe("with_xorg") else "disabled" + defs["xshm"] = "enabled" if self.options.get_safe("with_xorg") else "disabled" + defs["xvideo"] = "enabled" if self.options.get_safe("with_xorg") else "disabled" + meson.configure(build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + defs=defs) + return meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def _fix_library_names(self, path): + # regression in 1.16 + if self.settings.compiler == "Visual Studio": + with tools.chdir(path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info("rename %s into %s" % (filename_old, filename_new)) + shutil.move(filename_old, filename_new) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + + self._fix_library_names(os.path.join(self.package_folder, "lib")) + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_id(self): + self.info.requires["glib"].full_package_mode() + self.info.requires["gstreamer"].full_package_mode() + + def package_info(self): + gst_plugins = [] + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + gst_include_path = os.path.join(self.package_folder, "include", "gstreamer-1.0") + + pkgconfig_variables = { + "exec_prefix": "${prefix}", + "toolsdir": "${exec_prefix}/bin", + "pluginsdir": "${libdir}/gstreamer-1.0", + "datarootdir": "${prefix}/share", + "datadir": "${datarootdir}", + "girdir": "${datadir}/gir-1.0", + "typelibdir": "${libdir}/girepository-1.0", + "libexecdir": "${prefix}/libexec" + } + pkgconfig_custom_content = "\n".join("{}={}".format(key, value) for key, value in pkgconfig_variables.items()) + + if self.options.shared: + self.output.info("Appending GST_PLUGIN_PATH env var : %s" % gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + + # Plugins ('gst') + self.cpp_info.components["gstadder"].libs = ["gstadder"] + self.cpp_info.components["gstadder"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstadder"].requires = ["gstreamer-audio-1.0"] # TODO: orc + gst_plugins.append("gstadder") + + self.cpp_info.components["gstapp"].libs = ["gstapp"] + self.cpp_info.components["gstapp"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstapp"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-app-1.0", "gstreamer-tag-1.0"] + gst_plugins.append("gstapp") + + self.cpp_info.components["gstaudioconvert"].libs = ["gstaudioconvert"] + self.cpp_info.components["gstaudioconvert"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstaudioconvert"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0"] + gst_plugins.append("gstaudioconvert") + + self.cpp_info.components["gstaudiomixer"].libs = ["gstaudiomixer"] + self.cpp_info.components["gstaudiomixer"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstaudiomixer"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0"] # TODO: orc + gst_plugins.append("gstaudiomixer") + + self.cpp_info.components["gstaudiorate"].libs = ["gstaudiorate"] + self.cpp_info.components["gstaudiorate"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstaudiorate"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0"] + gst_plugins.append("gstaudiorate") + + self.cpp_info.components["gstaudioresample"].libs = ["gstaudioresample"] + self.cpp_info.components["gstaudioresample"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstaudioresample"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0"] + if self.settings.os == "Linux": + self.cpp_info.components["gstaudioresample"].system_libs = ["m"] + gst_plugins.append("gstaudioresample") + + self.cpp_info.components["gstaudiotestsrc"].libs = ["gstaudiotestsrc"] + self.cpp_info.components["gstaudiotestsrc"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstaudiotestsrc"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0"] + if self.settings.os == "Linux": + self.cpp_info.components["gstaudiotestsrc"].system_libs = ["m"] + gst_plugins.append("gstaudiotestsrc") + + self.cpp_info.components["gstcompositor"].libs = ["gstcompositor"] + self.cpp_info.components["gstcompositor"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstcompositor"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-video-1.0"] # TODO: orc + if self.settings.os == "Linux": + self.cpp_info.components["gstcompositor"].system_libs = ["m"] + gst_plugins.append("gstcompositor") + + self.cpp_info.components["gstencoding"].libs = ["gstencoding"] + self.cpp_info.components["gstencoding"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstencoding"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-video-1.0", "gstreamer-pbutils-1.0"] + gst_plugins.append("gstencoding") + + self.cpp_info.components["gstgio"].libs = ["gstgio"] + self.cpp_info.components["gstgio"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstgio"].requires = ["gstreamer::gstreamer-base-1.0", "glib::gio-2.0"] + gst_plugins.append("gstgio") + + self.cpp_info.components["gstoverlaycomposition"].libs = ["gstoverlaycomposition"] + self.cpp_info.components["gstoverlaycomposition"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstoverlaycomposition"].requires = ["gstreamer-video-1.0"] + gst_plugins.append("gstoverlaycomposition") + + self.cpp_info.components["gstpbtypes"].libs = ["gstpbtypes"] + self.cpp_info.components["gstpbtypes"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstpbtypes"].requires = ["gstreamer-video-1.0"] + gst_plugins.append("gstpbtypes") + + self.cpp_info.components["gstplayback"].libs = ["gstplayback"] + self.cpp_info.components["gstplayback"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstplayback"].requires = ["gstreamer-audio-1.0", "gstreamer-video-1.0", "gstreamer-pbutils-1.0", "gstreamer-tag-1.0"] + gst_plugins.append("gstplayback") + + self.cpp_info.components["gstrawparse"].libs = ["gstrawparse"] + self.cpp_info.components["gstrawparse"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstrawparse"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0", "gstreamer-video-1.0"] + gst_plugins.append("gstrawparse") + + self.cpp_info.components["gstsubparse"].libs = ["gstsubparse"] + self.cpp_info.components["gstsubparse"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstsubparse"].requires = ["gstreamer::gstreamer-base-1.0"] + gst_plugins.append("gstsubparse") + + self.cpp_info.components["gsttcp"].libs = ["gsttcp"] + self.cpp_info.components["gsttcp"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gsttcp"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer::gstreamer-net-1.0", "glib::gio-2.0"] + gst_plugins.append("gsttcp") + + self.cpp_info.components["gsttypefindfunctions"].libs = ["gsttypefindfunctions"] + self.cpp_info.components["gsttypefindfunctions"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gsttypefindfunctions"].requires = ["gstreamer::gstreamer-base-1.0", "gstreamer-pbutils-1.0", "glib::gio-2.0"] + gst_plugins.append("gsttypefindfunctions") + + self.cpp_info.components["gstvideoconvert"].libs = ["gstvideoconvert"] + self.cpp_info.components["gstvideoconvert"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstvideoconvert"].requires = ["gstreamer-video-1.0"] + gst_plugins.append("gstvideoconvert") + + self.cpp_info.components["gstvideorate"].libs = ["gstvideorate"] + self.cpp_info.components["gstvideorate"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstvideorate"].requires = ["gstreamer-video-1.0"] + gst_plugins.append("gstvideorate") + + self.cpp_info.components["gstvideoscale"].libs = ["gstvideoscale"] + self.cpp_info.components["gstvideoscale"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstvideoscale"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-video-1.0", "glib::glib-2.0", "glib::gobject-2.0"] + gst_plugins.append("gstvideoscale") + + self.cpp_info.components["gstvideotestsrc"].libs = ["gstvideotestsrc"] + self.cpp_info.components["gstvideotestsrc"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstvideotestsrc"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-video-1.0", "glib::glib-2.0", "glib::gobject-2.0"] # TODO: orc + if self.settings.os == "Linux": + self.cpp_info.components["gstvideotestsrc"].system_libs = ["m"] + gst_plugins.append("gstvideotestsrc") + + self.cpp_info.components["gstvolume"].libs = ["gstvolume"] + self.cpp_info.components["gstvolume"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstvolume"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-audio-1.0", "glib::glib-2.0", "glib::gobject-2.0"] # TODO: orc + gst_plugins.append("gstvolume") + + # Plugins ('ext') + if self.options.get_safe("with_libalsa"): + self.cpp_info.components["gstalsa"].libs = ["gstalsa"] + self.cpp_info.components["gstalsa"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstalsa"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-audio-1.0", "gstreamer-tag-1.0", + "libalsa::libalsa", "glib::glib-2.0", "glib::gobject-2.0"] + gst_plugins.append("gstalsa") + + # if self.options.with_cdparanoia: # TODO: cdparanoia + # self.cpp_info.components["gstcdparanoia"].libs = ["gstcdparanoia"] + # self.cpp_info.components["gstcdparanoia"].libdirs.append(gst_plugin_path) + # self.cpp_info.components["gstcdparanoia"].requires = [ + # "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0", + # "cdparanoia::cdparanoia", "glib::glib-2.0", "glib::gobject-2.0"] + # gst_plugins.append("gstcdparanoia") + + if self.options.with_gl: + self.cpp_info.components["gstopengl"].libs = ["gstopengl"] + self.cpp_info.components["gstopengl"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstopengl"].requires = [ + "gstreamer::gstreamer-base-1.0", "gstreamer::gstreamer-controller-1.0", + "gstreamer-video-1.0", "gstreamer-allocators-1.0", "opengl::opengl"] # TODO: bcm, nvbuf_utils + if self.settings.os == "Macos": + self.cpp_info.components["gstopengl"].frameworks = ["CoreFoundation", "Foundation", "QuartzCore"] + if self.options.with_graphene: + self.cpp_info.components["gstopengl"].requires.append("graphene::graphene-gobject-1.0") + if self.options.with_libpng: + self.cpp_info.components["gstopengl"].requires.append("libpng::libpng") + if self.options.with_libjpeg == "libjpeg": + self.cpp_info.components["gstopengl"].requires.append("libjpeg::libjpeg") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.cpp_info.components["gstopengl"].requires.append("libjpeg-turbo::libjpeg-turbo") + if self.options.get_safe("with_xorg"): + self.cpp_info.components["gstopengl"].requires.append("xorg::x11") + if self.settings.os == "Linux": + self.cpp_info.components["gstopengl"].system_libs = ["m"] + gst_plugins.append("gstopengl") + + # if self.options.with_libvisual: # TODO: libvisual + # self.cpp_info.components["gstlibvisual"].libs = ["gstlibvisual"] + # self.cpp_info.components["gstlibvisual"].libdirs.append(gst_plugin_path) + # self.cpp_info.components["gstlibvisual"].requires = [ + # "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + # "gstreamer-audio-1.0", "gstreamer-video-1.0", "gstreamer-pbutils-1.0", + # "libvisual::libvisual", "glib::glib-2.0", "glib::gobject-2.0"] + # gst_plugins.append("gstlibvisual") + + if self.options.with_ogg: + self.cpp_info.components["gstogg"].libs = ["gstogg"] + self.cpp_info.components["gstogg"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstogg"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-audio-1.0", "gstreamer-pbutils-1.0", "gstreamer-tag-1.0", "gstreamer-riff-1.0", + "ogg::ogglib", "glib::glib-2.0", "glib::gobject-2.0"] + gst_plugins.append("gstogg") + + if self.options.with_opus: + self.cpp_info.components["gstopus"].libs = ["gstopus"] + self.cpp_info.components["gstopus"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstopus"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-audio-1.0", "gstreamer-pbutils-1.0", "gstreamer-tag-1.0", + "opus::libopus", "glib::glib-2.0", "glib::gobject-2.0"] + if self.settings.os == "Linux": + self.cpp_info.components["gstopus"].system_libs = ["m"] + gst_plugins.append("gstopus") + + if self.options.with_pango: + self.cpp_info.components["gstpango"].libs = ["gstpango"] + self.cpp_info.components["gstpango"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstpango"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-video-1.0", + "pango::pangocairo", "glib::glib-2.0", "glib::gobject-2.0"] + if self.settings.os == "Linux": + self.cpp_info.components["gstpango"].system_libs = ["m"] + gst_plugins.append("gstpango") + + if self.options.with_theora: + self.cpp_info.components["gsttheora"].libs = ["gsttheora"] + self.cpp_info.components["gsttheora"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gsttheora"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-video-1.0", "gstreamer-tag-1.0", + "theora::theoraenc", "theora::theoradec", "glib::glib-2.0", "glib::gobject-2.0"] + gst_plugins.append("gsttheora") + + if self.options.with_vorbis: + self.cpp_info.components["gstvorbis"].libs = ["gstvorbis"] + self.cpp_info.components["gstvorbis"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstvorbis"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-audio-1.0", "gstreamer-tag-1.0", + "vorbis::vorbismain", "vorbis::vorbisenc", "glib::glib-2.0", "glib::gobject-2.0"] + gst_plugins.append("gstvorbis") + + # if self.options.with_tremor: # TODO: tremor + # self.cpp_info.components["gstivorbisdec"].libs = ["gstivorbisdec"] + # self.cpp_info.components["gstivorbisdec"].libdirs.append(gst_plugin_path) + # self.cpp_info.components["gstivorbisdec"].requires = [ + # "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + # "gstreamer-audio-1.0", "gstreamer-tag-1.0", + # "tremor::tremor", "glib::glib-2.0", "glib::gobject-2.0"] + # gst_plugins.append("gstivorbisdec") + + # Plugins ('sys') + if self.options.get_safe("with_xorg"): + self.cpp_info.components["gstximagesink"].libs = ["gstximagesink"] + self.cpp_info.components["gstximagesink"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstximagesink"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-video-1.0", + "xorg::x11", "xorg::xext", "glib::glib-2.0", "glib::gobject-2.0"] + gst_plugins.append("gstximagesink") + + self.cpp_info.components["gstxvimagesink"].libs = ["gstxvimagesink"] + self.cpp_info.components["gstxvimagesink"].libdirs.append(gst_plugin_path) + self.cpp_info.components["gstxvimagesink"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-video-1.0", + "xorg::x11", "xorg::xext", "xorg::xv", "glib::glib-2.0", "glib::gobject-2.0"] + if self.settings.os == "Linux": + self.cpp_info.components["gstxvimagesink"].system_libs = ["m"] + gst_plugins.append("gstxvimagesink") + + # Libraries + self.cpp_info.components["gstreamer-plugins-base-1.0"].names["pkg_config"] = "gstreamer-plugins-base-1.0" + self.cpp_info.components["gstreamer-plugins-base-1.0"].requires = ["gstreamer::gstreamer-1.0"] + self.cpp_info.components["gstreamer-plugins-base-1.0"].includedirs = [gst_include_path] + if not self.options.shared: + self.cpp_info.components["gstreamer-plugins-base-1.0"].defines.append("GST_PLUGINS_BASE_STATIC") + self.cpp_info.components["gstreamer-plugins-base-1.0"].requires.extend(gst_plugins) + else: + self.cpp_info.components["gstreamer-plugins-base-1.0"].bindirs.append(gst_plugin_path) + self.cpp_info.components["gstreamer-plugins-base-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-allocators-1.0"].names["pkg_config"] = "gstreamer-allocators-1.0" + self.cpp_info.components["gstreamer-allocators-1.0"].libs = ["gstallocators-1.0"] + self.cpp_info.components["gstreamer-allocators-1.0"].requires = ["gstreamer::gstreamer-1.0"] + self.cpp_info.components["gstreamer-allocators-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-allocators-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-app-1.0"].names["pkg_config"] = "gstreamer-app-1.0" + self.cpp_info.components["gstreamer-app-1.0"].libs = ["gstapp-1.0"] + self.cpp_info.components["gstreamer-app-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0"] + self.cpp_info.components["gstreamer-app-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-app-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-audio-1.0"].names["pkg_config"] = "gstreamer-audio-1.0" + self.cpp_info.components["gstreamer-audio-1.0"].libs = ["gstaudio-1.0"] + self.cpp_info.components["gstreamer-audio-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", "gstreamer-tag-1.0"] # TODO: orc + self.cpp_info.components["gstreamer-audio-1.0"].includedirs = [gst_include_path] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-audio-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-audio-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-fft-1.0"].names["pkg_config"] = "gstreamer-fft-1.0" + self.cpp_info.components["gstreamer-fft-1.0"].libs = ["gstfft-1.0"] + self.cpp_info.components["gstreamer-fft-1.0"].requires = ["gstreamer::gstreamer-1.0"] + self.cpp_info.components["gstreamer-fft-1.0"].includedirs = [gst_include_path] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-fft-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-fft-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + if self.options.with_gl: + gl_api, gl_platform, gl_winsys = self._gl_config() + gl_variables = { + **pkgconfig_variables, + "gl_apis": " ".join(gl_api), + "gl_platforms": " ".join(gl_platform), + "gl_winsys": " ".join(gl_winsys) + } + gl_custom_content = "\n".join("{}={}".format(key, value) for key, value in gl_variables.items()) + + self.cpp_info.components["gstreamer-gl-1.0"].names["pkg_config"] = "gstreamer-gl-1.0" + self.cpp_info.components["gstreamer-gl-1.0"].libs = ["gstgl-1.0"] + self.cpp_info.components["gstreamer-gl-1.0"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-allocators-1.0", "gstreamer-video-1.0", + "glib::gmodule-no-export-2.0", "opengl::opengl"] # TODO: bcm + if self.options.get_safe("with_egl"): + self.cpp_info.components["gstreamer-gl-1.0"].requires.extend(["egl::egl"]) + if self.options.get_safe("with_xorg"): + self.cpp_info.components["gstreamer-gl-1.0"].requires.extend(["xorg::x11", "xorg::x11-xcb"]) + if self.options.get_safe("with_wayland"): + self.cpp_info.components["gstreamer-gl-1.0"].requires.extend([ + "wayland::wayland-client", "wayland::wayland-cursor", "wayland::wayland-egl", + "wayland-protocols::wayland-protocols"]) + if self.settings.os == "Windows": + self.cpp_info.components["gstreamer-gl-1.0"].requires.append("wglext::wglext") + self.cpp_info.components["gstreamer-gl-1.0"].requires.extend(['glext::glext']) + self.cpp_info.components["gstreamer-gl-1.0"].system_libs = ["gdi32"] + if self.settings.os in ["Macos", "iOS", "tvOS", "watchOS"]: + self.cpp_info.components["gstreamer-gl-1.0"].frameworks = ["CoreFoundation", "Foundation", "QuartzCore", "Cocoa"] + if self.settings.os in ["iOS", "tvOS", "watchOS"]: + self.cpp_info.components["gstreamer-gl-1.0"].frameworks.extend(["CoreGraphics", "UIkit"]) + self.cpp_info.components["gstreamer-gl-1.0"].includedirs = [os.path.join(self.package_folder, "include"), gst_include_path] + self.cpp_info.components["gstreamer-gl-1.0"].includedirs.append(os.path.join(gst_plugin_path, "include")) + self.cpp_info.components["gstreamer-gl-1.0"].set_property("pkg_config_custom_content", gl_custom_content) + + self.cpp_info.components["gstreamer-gl-prototypes-1.0"].names["pkg_config"] = "gstreamer-gl-prototypes-1.0" + self.cpp_info.components["gstreamer-gl-prototypes-1.0"].requires = ["gstreamer-gl-1.0", "opengl::opengl"] + + if self.options.get_safe("with_egl"): + self.cpp_info.components["gstreamer-gl-egl-1.0"].names["pkg_config"] = "gstreamer-gl-egl-1.0" + self.cpp_info.components["gstreamer-gl-egl-1.0"].requires = ["gstreamer-gl-1.0", "egl::egl"] + + if self.options.get_safe("with_wayland"): + self.cpp_info.components["gstreamer-gl-wayland-1.0"].names["pkg_config"] = "gstreamer-gl-wayland-1.0" + self.cpp_info.components["gstreamer-gl-wayland-1.0"].requires = [ + "gstreamer-gl-1.0", "wayland::wayland-client", "wayland::wayland-egl", + "wayland-protocols::wayland-protocols"] + + if self.options.get_safe("with_xorg"): + self.cpp_info.components["gstreamer-gl-x11-1.0"].names["pkg_config"] = "gstreamer-gl-x11-1.0" + self.cpp_info.components["gstreamer-gl-x11-1.0"].requires = ["gstreamer-gl-1.0", "xorg::x11-xcb"] + + self.cpp_info.components["gstreamer-pbutils-1.0"].names["pkg_config"] = "gstreamer-pbutils-1.0" + self.cpp_info.components["gstreamer-pbutils-1.0"].libs = ["gstpbutils-1.0"] + self.cpp_info.components["gstreamer-pbutils-1.0"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-audio-1.0", "gstreamer-video-1.0", "gstreamer-tag-1.0"] + self.cpp_info.components["gstreamer-pbutils-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-pbutils-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-riff-1.0"].names["pkg_config"] = "gstreamer-riff-1.0" + self.cpp_info.components["gstreamer-riff-1.0"].libs = ["gstriff-1.0"] + self.cpp_info.components["gstreamer-riff-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer-audio-1.0", "gstreamer-tag-1.0"] + self.cpp_info.components["gstreamer-riff-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-riff-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-rtp-1.0"].names["pkg_config"] = "gstreamer-rtp-1.0" + self.cpp_info.components["gstreamer-rtp-1.0"].libs = ["gstrtp-1.0"] + self.cpp_info.components["gstreamer-rtp-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", "gstreamer-audio-1.0"] + self.cpp_info.components["gstreamer-rtp-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-rtp-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-rtsp-1.0"].names["pkg_config"] = "gstreamer-rtsp-1.0" + self.cpp_info.components["gstreamer-rtsp-1.0"].libs = ["gstrtsp-1.0"] + self.cpp_info.components["gstreamer-rtsp-1.0"].requires = [ + "gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", + "gstreamer-sdp-1.0", "glib::gio-2.0"] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-rtsp-1.0"].system_libs = ["m"] + elif self.settings.os == "Windows": + self.cpp_info.components["gstreamer-rtsp-1.0"].system_libs = ["ws2_32"] + self.cpp_info.components["gstreamer-rtsp-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-rtsp-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-sdp-1.0"].names["pkg_config"] = "gstreamer-sdp-1.0" + self.cpp_info.components["gstreamer-sdp-1.0"].libs = ["gstsdp-1.0"] + self.cpp_info.components["gstreamer-sdp-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer-rtp-1.0", "glib::glib-2.0", "glib::gio-2.0"] + self.cpp_info.components["gstreamer-sdp-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-sdp-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-tag-1.0"].names["pkg_config"] = "gstreamer-tag-1.0" + self.cpp_info.components["gstreamer-tag-1.0"].libs = ["gsttag-1.0"] + self.cpp_info.components["gstreamer-tag-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0", "zlib::zlib"] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-tag-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-tag-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-tag-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-video-1.0"].names["pkg_config"] = "gstreamer-video-1.0" + self.cpp_info.components["gstreamer-video-1.0"].libs = ["gstvideo-1.0"] + self.cpp_info.components["gstreamer-video-1.0"].requires = ["gstreamer::gstreamer-1.0", "gstreamer::gstreamer-base-1.0"] # TODO: orc + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-video-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-video-1.0"].includedirs = [gst_include_path] + self.cpp_info.components["gstreamer-video-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) diff --git a/recipes/gst-plugins-base/all/test_package/CMakeLists.txt b/recipes/gst-plugins-base/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a872f34009a12 --- /dev/null +++ b/recipes/gst-plugins-base/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gst-plugins-base CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gst-plugins-base::gstreamer-plugins-base-1.0) diff --git a/recipes/gst-plugins-base/all/test_package/conanfile.py b/recipes/gst-plugins-base/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gst-plugins-base/all/test_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/gst-plugins-base/all/test_package/test_package.cpp b/recipes/gst-plugins-base/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..89721999b15cf --- /dev/null +++ b/recipes/gst-plugins-base/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +#include +#include + +#ifdef GST_PLUGINS_BASE_STATIC + +extern "C" +{ + GST_PLUGIN_STATIC_DECLARE(audiotestsrc); + GST_PLUGIN_STATIC_DECLARE(videotestsrc); +} + +#endif + +#include + +int main(int argc, char * argv[]) +{ + gst_init(&argc, &argv); + +#ifdef GST_PLUGINS_BASE_STATIC + + GST_PLUGIN_STATIC_REGISTER(audiotestsrc); + GST_PLUGIN_STATIC_REGISTER(videotestsrc); + +#endif + + GstElement * audiotestsrc = gst_element_factory_make("audiotestsrc", NULL); + if (!audiotestsrc) { + std::cerr << "failed to create audiotestsrc element" << std::endl; + return -1; + } else { + std::cout << "audiotestsrc has been created successfully" << std::endl; + } + gst_object_unref(GST_OBJECT(audiotestsrc)); + GstElement * videotestsrc = gst_element_factory_make("videotestsrc", NULL); + if (!videotestsrc) { + std::cerr << "failed to create videotestsrc element" << std::endl; + return -1; + } else { + std::cout << "videotestsrc has been created successfully" << std::endl; + } + gst_object_unref(GST_OBJECT(videotestsrc)); + return 0; +} diff --git a/recipes/gst-plugins-base/config.yml b/recipes/gst-plugins-base/config.yml new file mode 100644 index 0000000000000..00bb72b6988b8 --- /dev/null +++ b/recipes/gst-plugins-base/config.yml @@ -0,0 +1,5 @@ +versions: + "1.19.2": + folder: all + "1.19.1": + folder: all diff --git a/recipes/gst-plugins-good/all/conandata.yml b/recipes/gst-plugins-good/all/conandata.yml new file mode 100644 index 0000000000000..d7297bec108c9 --- /dev/null +++ b/recipes/gst-plugins-good/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.19.1": + url: "https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/archive/1.19.1/gst-plugins-good-1.19.1.tar.bz2" + sha256 : "c2c97b8bfeac812dbdca3a72a15a874de4845e4a042693dad8447272c8767a64" diff --git a/recipes/gst-plugins-good/all/conanfile.py b/recipes/gst-plugins-good/all/conanfile.py new file mode 100644 index 0000000000000..37aae306fba09 --- /dev/null +++ b/recipes/gst-plugins-good/all/conanfile.py @@ -0,0 +1,209 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import msvc_runtime_flag +import glob +import os +import shutil + + +class GStPluginsGoodConan(ConanFile): + name = "gst-plugins-good" + description = "GStreamer is a development framework for creating applications like media players, video editors, " \ + "streaming media broadcasters and so on" + topics = ("gstreamer", "multimedia", "video", "audio", "broadcasting", "framework", "media") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gstreamer.freedesktop.org/" + license = "GPL-2.0-only" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_introspection": False, + } + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + exports_sources = ["patches/*.patch"] + + generators = "pkg_config" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def validate(self): + if self.options.shared != self.options["gstreamer"].shared or \ + self.options.shared != self.options["glib"].shared or \ + self.options.shared != self.options["gst-plugins-base"].shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("GLib, GStreamer and GstPlugins must be either all shared, or all static") + if tools.Version(self.version) >= "1.18.2" and\ + self.settings.compiler == "gcc" and\ + tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "gst-plugins-good %s does not support gcc older than 5" % self.version + ) + if self.options.shared and str(msvc_runtime_flag(self)).startswith("MT"): + raise ConanInvalidConfiguration('shared build with static runtime is not supported due to the FlsAlloc limit') + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + self.options['gstreamer'].shared = self.options.shared + self.options['gst-plugins-base'].shared = self.options.shared + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def requirements(self): + self.requires("glib/2.70.0") + self.requires("gstreamer/1.19.1") + self.requires("gst-plugins-base/1.19.1") + + def build_requirements(self): + self.build_requires("meson/0.54.2") + if not tools.which("pkg-config"): + self.build_requires("pkgconf/1.7.4") + if self.settings.os == 'Windows': + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + if self.options.with_introspection: + self.build_requires("gobject-introspection/1.68.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_meson(self): + defs = dict() + + def add_flag(name, value): + if name in defs: + defs[name] += " " + value + else: + defs[name] = value + + def add_compiler_flag(value): + add_flag("c_args", value) + add_flag("cpp_args", value) + + def add_linker_flag(value): + add_flag("c_link_args", value) + add_flag("cpp_link_args", value) + + meson = Meson(self) + if self.settings.compiler == "Visual Studio": + add_linker_flag("-lws2_32") + add_compiler_flag("-%s" % self.settings.compiler.runtime) + if int(str(self.settings.compiler.version)) < 14: + add_compiler_flag("-Dsnprintf=_snprintf") + if self.settings.get_safe("compiler.runtime"): + defs["b_vscrt"] = str(self.settings.compiler.runtime).lower() + defs["tools"] = "disabled" + defs["examples"] = "disabled" + defs["benchmarks"] = "disabled" + defs["tests"] = "disabled" + defs["wrap_mode"] = "nofallback" + defs["introspection"] = "enabled" if self.options.with_introspection else "disabled" + meson.configure(build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + defs=defs) + return meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def _fix_library_names(self, path): + # regression in 1.16 + if self.settings.compiler == "Visual Studio": + with tools.chdir(path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info("rename %s into %s" % (filename_old, filename_new)) + shutil.move(filename_old, filename_new) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + + self._fix_library_names(os.path.join(self.package_folder, "lib")) + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_info(self): + + plugins = ["alpha", "alphacolor", + "apetag", + "audiofx", + "audioparsers", + "auparse", + "autodetect", + "avi", + "cutter", + "debug", + "deinterlace", + "dtmf", + "effectv", + "equalizer", + "flv", + "flxdec", + "goom", + "goom2k1", + "icydemux", + "id3demux", + "imagefreeze", + "interleave", + "isomp4", + "alaw", "mulaw", + "level", + "matroska", + "monoscope", + "multifile", + "multipart", + "replaygain", + "rtp", + "rtpmanager", + "rtsp", + "shapewipe", + "smpte", + "spectrum", + "udp", + "videobox", + "videocrop", + "videofilter", + "videomixer", + "wavenc", + "wavparse", + "y4menc"] + + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + if self.options.shared: + self.output.info("Appending GST_PLUGIN_PATH env var : %s" % gst_plugin_path) + self.cpp_info.bindirs.append(gst_plugin_path) + self.runenv_info.prepend_path("GST_PLUGIN_PATH", gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + else: + self.cpp_info.defines.append("GST_PLUGINS_GOOD_STATIC") + self.cpp_info.libdirs.append(gst_plugin_path) + self.cpp_info.libs.extend(["gst%s" % plugin for plugin in plugins]) + + self.cpp_info.includedirs = ["include", os.path.join("include", "gstreamer-1.0")] diff --git a/recipes/gst-plugins-good/all/test_package/CMakeLists.txt b/recipes/gst-plugins-good/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..12ca5f526ed07 --- /dev/null +++ b/recipes/gst-plugins-good/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gst-plugins-good CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gst-plugins-good::gst-plugins-good) diff --git a/recipes/gst-plugins-good/all/test_package/conanfile.py b/recipes/gst-plugins-good/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gst-plugins-good/all/test_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/gst-plugins-good/all/test_package/test_package.cpp b/recipes/gst-plugins-good/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bc7a25a413ef3 --- /dev/null +++ b/recipes/gst-plugins-good/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include +#include + +#ifdef GST_PLUGINS_GOOD_STATIC + +extern "C" +{ + GST_PLUGIN_STATIC_DECLARE(wavparse); +} + +#endif + +#include + +int main(int argc, char * argv[]) +{ + gst_init(&argc, &argv); + +#ifdef GST_PLUGINS_GOOD_STATIC + + GST_PLUGIN_STATIC_REGISTER(wavparse); + +#endif + + GstElement * wavparse = gst_element_factory_make("wavparse", NULL); + if (!wavparse) { + std::cerr << "failed to create wavparse element" << std::endl; + return -1; + } else { + std::cout << "wavparse has been created successfully" << std::endl; + } + gst_object_unref(GST_OBJECT(wavparse)); + return 0; +} diff --git a/recipes/gst-plugins-good/config.yml b/recipes/gst-plugins-good/config.yml new file mode 100644 index 0000000000000..e20650f02a0e5 --- /dev/null +++ b/recipes/gst-plugins-good/config.yml @@ -0,0 +1,3 @@ +versions: + "1.19.1": + folder: all diff --git a/recipes/gst-plugins-ugly/all/conandata.yml b/recipes/gst-plugins-ugly/all/conandata.yml new file mode 100644 index 0000000000000..a6f4354cc6a61 --- /dev/null +++ b/recipes/gst-plugins-ugly/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.19.1": + url: "https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/archive/1.19.1/gst-plugins-ugly-1.19.1.tar.bz2" + sha256 : "b9ae94a04eaf9d93bc36500b3d7eda864f82142d2ce950c1e92a4288924227e6" diff --git a/recipes/gst-plugins-ugly/all/conanfile.py b/recipes/gst-plugins-ugly/all/conanfile.py new file mode 100644 index 0000000000000..b889700ec4e84 --- /dev/null +++ b/recipes/gst-plugins-ugly/all/conanfile.py @@ -0,0 +1,171 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import msvc_runtime_flag +import glob +import os +import shutil + + +class GStPluginsUglyConan(ConanFile): + name = "gst-plugins-ugly" + description = "GStreamer is a development framework for creating applications like media players, video editors, " \ + "streaming media broadcasters and so on" + topics = ("gstreamer", "multimedia", "video", "audio", "broadcasting", "framework", "media") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gstreamer.freedesktop.org/" + license = "GPL-2.0-only" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_introspection": False, + } + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + exports_sources = ["patches/*.patch"] + + generators = "pkg_config" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def validate(self): + if self.options.shared != self.options["gstreamer"].shared or \ + self.options.shared != self.options["glib"].shared or \ + self.options.shared != self.options["gst-plugins-base"].shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("GLib, GStreamer and GstPlugins must be either all shared, or all static") + if tools.Version(self.version) >= "1.18.2" and\ + self.settings.compiler == "gcc" and\ + tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "gst-plugins-ugly%s does not support gcc older than 5" % self.version + ) + if self.options.shared and str(msvc_runtime_flag(self)).startswith("MT"): + raise ConanInvalidConfiguration('shared build with static runtime is not supported due to the FlsAlloc limit') + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + self.options['gstreamer'].shared = self.options.shared + self.options['gst-plugins-base'].shared = self.options.shared + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def requirements(self): + self.requires("glib/2.70.1") + self.requires("gstreamer/1.19.1") + self.requires("gst-plugins-base/1.19.1") + + def build_requirements(self): + self.build_requires("meson/0.54.2") + if not tools.which("pkg-config"): + self.build_requires("pkgconf/1.7.4") + if self.settings.os == 'Windows': + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + if self.options.with_introspection: + self.build_requires("gobject-introspection/1.68.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_meson(self): + defs = dict() + + def add_flag(name, value): + if name in defs: + defs[name] += " " + value + else: + defs[name] = value + + def add_compiler_flag(value): + add_flag("c_args", value) + add_flag("cpp_args", value) + + def add_linker_flag(value): + add_flag("c_link_args", value) + add_flag("cpp_link_args", value) + + meson = Meson(self) + if self.settings.compiler == "Visual Studio": + add_linker_flag("-lws2_32") + add_compiler_flag("-%s" % self.settings.compiler.runtime) + if int(str(self.settings.compiler.version)) < 14: + add_compiler_flag("-Dsnprintf=_snprintf") + if self.settings.get_safe("compiler.runtime"): + defs["b_vscrt"] = str(self.settings.compiler.runtime).lower() + defs["tools"] = "disabled" + defs["examples"] = "disabled" + defs["benchmarks"] = "disabled" + defs["tests"] = "disabled" + defs["wrap_mode"] = "nofallback" + defs["introspection"] = "enabled" if self.options.with_introspection else "disabled" + meson.configure(build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + defs=defs) + return meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def _fix_library_names(self, path): + # regression in 1.16 + if self.settings.compiler == "Visual Studio": + with tools.chdir(path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info("rename %s into %s" % (filename_old, filename_new)) + shutil.move(filename_old, filename_new) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + + self._fix_library_names(os.path.join(self.package_folder, "lib")) + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_info(self): + + plugins = ["asf", + "dvdlpcmdec", + "dvdsub", + "realmedia", + "xingmux"] + + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + if self.options.shared: + self.output.info("Appending GST_PLUGIN_PATH env var : %s" % gst_plugin_path) + self.cpp_info.bindirs.append(gst_plugin_path) + self.runenv_info.prepend_path("GST_PLUGIN_PATH", gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + else: + self.cpp_info.defines.append("GST_PLUGINS_UGLY_STATIC") + self.cpp_info.libdirs.append(gst_plugin_path) + self.cpp_info.libs.extend(["gst%s" % plugin for plugin in plugins]) + + self.cpp_info.includedirs = ["include", os.path.join("include", "gstreamer-1.0")] diff --git a/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt b/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..86125a5ca6402 --- /dev/null +++ b/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gst-plugins-ugly CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gst-plugins-ugly::gst-plugins-ugly) diff --git a/recipes/gst-plugins-ugly/all/test_package/conanfile.py b/recipes/gst-plugins-ugly/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gst-plugins-ugly/all/test_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/gst-plugins-ugly/all/test_package/test_package.cpp b/recipes/gst-plugins-ugly/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9824c176d4b22 --- /dev/null +++ b/recipes/gst-plugins-ugly/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include +#include + +#ifdef GST_PLUGINS_UGLY_STATIC + +extern "C" +{ + GST_PLUGIN_STATIC_DECLARE(asf); +} + +#endif + +#include + +int main(int argc, char * argv[]) +{ + gst_init(&argc, &argv); + +#ifdef GST_PLUGINS_UGLY_STATIC + + GST_PLUGIN_STATIC_REGISTER(asf); + +#endif + + GstElement * asfdemux = gst_element_factory_make("asfdemux", NULL); + if (!asfdemux) { + std::cerr << "failed to create asfdemux element" << std::endl; + return -1; + } else { + std::cout << "asfdemux has been created successfully" << std::endl; + } + gst_object_unref(GST_OBJECT(asfdemux)); + return 0; +} diff --git a/recipes/gst-plugins-ugly/config.yml b/recipes/gst-plugins-ugly/config.yml new file mode 100644 index 0000000000000..e20650f02a0e5 --- /dev/null +++ b/recipes/gst-plugins-ugly/config.yml @@ -0,0 +1,3 @@ +versions: + "1.19.1": + folder: all diff --git a/recipes/gstreamer/all/conandata.yml b/recipes/gstreamer/all/conandata.yml new file mode 100644 index 0000000000000..5c2457feed4e9 --- /dev/null +++ b/recipes/gstreamer/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.16.2": + sha256: "dac037ab84d557f5d4e6e66e833f6bf8cf4f84671a311e0b2df99f9b30a9d693" + url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.16.2/gstreamer-1.16.2.tar.bz2" + "1.18.0": + sha256: "f072da67b6dad9b4aecf2cb594aaaa66f86c22af9ba80503b90f957d47015ef8" + url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18.0/gstreamer-1.18.0.tar.bz2" + "1.18.3": + url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18.3/gstreamer-1.18.3.tar.gz" + sha256: "d7e3917b5d3d9c3bd9bb70b7500314a5725377cff39bcd818df13c1fda0f60ba" + "1.18.4": + url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18.4/gstreamer-1.18.4.tar.gz" + sha256: "f0956c2056281f5909d030945a9896810e55084f29b6bcfc401b53e91ddf1c7f" + "1.19.1": + url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.19.1/gstreamer-1.19.1.tar.gz" + sha256: "2e51f61e59564e48883b5f1996871b0d1c404406aadb9aa1b306de8a2a331a90" + "1.19.2": + url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.19.2/gstreamer-1.19.2.tar.gz" + sha256: "6ec8494867d9b58f145c0c357da631faf21c2c72c7cd8b637b440188fe904ab8" diff --git a/recipes/gstreamer/all/conanfile.py b/recipes/gstreamer/all/conanfile.py new file mode 100644 index 0000000000000..f2f81654473da --- /dev/null +++ b/recipes/gstreamer/all/conanfile.py @@ -0,0 +1,210 @@ +from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import glob +import os +import shutil + +required_conan_version = ">=1.29" + +class GStreamerConan(ConanFile): + name = "gstreamer" + description = "GStreamer is a development framework for creating applications like media players, video editors, streaming media broadcasters and so on" + topics = ("conan", "gstreamer", "multimedia", "video", "audio", "broadcasting", "framework", "media") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gstreamer.freedesktop.org/" + license = "GPL-2.0-only" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_introspection": False, + } + generators = "pkg_config" + _meson = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + self.requires("glib/2.72.0") + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def validate(self): + if not self.options["glib"].shared and self.options.shared: + # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 + raise ConanInvalidConfiguration("shared GStreamer cannot link to static GLib") + + def build_requirements(self): + self.build_requires("meson/0.61.2") + self.build_requires("pkgconf/1.7.4") + if self.options.with_introspection: + self.build_requires("gobject-introspection/1.70.0") + if self.settings.os == 'Windows': + self.build_requires("winflexbison/2.5.24") + else: + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("%s-%s" % (self.name, self.version), self._source_subfolder) + + def _configure_meson(self): + if self._meson: + return self._meson + meson = Meson(self) + if self._is_msvc: + if tools.Version(self.settings.compiler.version) < "14": + meson.options["c_args"] = " -Dsnprintf=_snprintf" + meson.options["cpp_args"] = " -Dsnprintf=_snprintf" + if self.settings.get_safe("compiler.runtime"): + meson.options["b_vscrt"] = str(self.settings.compiler.runtime).lower() + meson.options["tools"] = "disabled" + meson.options["examples"] = "disabled" + meson.options["benchmarks"] = "disabled" + meson.options["tests"] = "disabled" + meson.options["introspection"] = "enabled" if self.options.with_introspection else "disabled" + meson.configure(build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + args=['--wrap-mode=nofallback']) + self._meson = meson + return self._meson + + def build(self): + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def _fix_library_names(self, path): + # regression in 1.16 + if self.settings.compiler == "Visual Studio": + with tools.chdir(path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info("rename %s into %s" % (filename_old, filename_new)) + shutil.move(filename_old, filename_new) + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if self._is_msvc else tools.no_op(): + meson = self._configure_meson() + meson.install() + + self._fix_library_names(os.path.join(self.package_folder, "lib")) + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_id(self): + self.info.requires["glib"].full_package_mode() + + def package_info(self): + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + + pkgconfig_variables = { + "exec_prefix": "${prefix}", + "toolsdir": "${exec_prefix}/bin", + "pluginsdir": "${libdir}/gstreamer-1.0", + "datarootdir": "${prefix}/share", + "datadir": "${datarootdir}", + "girdir": "${datadir}/gir-1.0", + "typelibdir": "${libdir}/girepository-1.0", + "libexecdir": "${prefix}/libexec", + "pluginscannerdir": "${libexecdir}/gstreamer-1.0", + } + pkgconfig_custom_content = "\n".join("{}={}".format(key, value) for key, value in pkgconfig_variables.items()) + + self.cpp_info.components["gstreamer-1.0"].names["pkg_config"] = "gstreamer-1.0" + self.cpp_info.components["gstreamer-1.0"].requires = ["glib::glib-2.0", "glib::gobject-2.0"] + if not self.options.shared: + self.cpp_info.components["gstreamer-1.0"].requires.append("glib::gmodule-no-export-2.0") + self.cpp_info.components["gstreamer-1.0"].defines.append("GST_STATIC_COMPILATION") + self.cpp_info.components["gstreamer-1.0"].libs = ["gstreamer-1.0"] + self.cpp_info.components["gstreamer-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-base-1.0"].names["pkg_config"] = "gstreamer-base-1.0" + self.cpp_info.components["gstreamer-base-1.0"].requires = ["gstreamer-1.0"] + self.cpp_info.components["gstreamer-base-1.0"].libs = ["gstbase-1.0"] + self.cpp_info.components["gstreamer-base-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] + self.cpp_info.components["gstreamer-base-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-controller-1.0"].names["pkg_config"] = "gstreamer-controller-1.0" + self.cpp_info.components["gstreamer-controller-1.0"].requires = ["gstreamer-1.0"] + self.cpp_info.components["gstreamer-controller-1.0"].libs = ["gstcontroller-1.0"] + self.cpp_info.components["gstreamer-controller-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-controller-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-controller-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-net-1.0"].names["pkg_config"] = "gstreamer-net-1.0" + self.cpp_info.components["gstreamer-net-1.0"].requires = ["gstreamer-1.0", "glib::gio-2.0"] + self.cpp_info.components["gstreamer-net-1.0"].libs = ["gstnet-1.0"] + self.cpp_info.components["gstreamer-net-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] + self.cpp_info.components["gstreamer-net-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + self.cpp_info.components["gstreamer-check-1.0"].names["pkg_config"] = "gstreamer-check-1.0" + self.cpp_info.components["gstreamer-check-1.0"].requires = ["gstreamer-1.0"] + self.cpp_info.components["gstreamer-check-1.0"].libs = ["gstcheck-1.0"] + self.cpp_info.components["gstreamer-check-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] + if self.settings.os == "Linux": + self.cpp_info.components["gstreamer-check-1.0"].system_libs = ["rt", "m"] + self.cpp_info.components["gstreamer-check-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) + + # gstcoreelements and gstcoretracers are plugins which should be loaded dynamicaly, and not linked to directly + if not self.options.shared: + self.cpp_info.components["gstcoreelements"].names["pkg_config"] = "gstcoreelements" + self.cpp_info.components["gstcoreelements"].requires = ["glib::gobject-2.0", "glib::glib-2.0", "gstreamer-1.0", "gstreamer-base-1.0"] + self.cpp_info.components["gstcoreelements"].libs = ["gstcoreelements"] + self.cpp_info.components["gstcoreelements"].includedirs = [os.path.join("include", "gstreamer-1.0")] + self.cpp_info.components["gstcoreelements"].libdirs = [gst_plugin_path] + + self.cpp_info.components["gstcoretracers"].names["pkg_config"] = "gstcoretracers" + self.cpp_info.components["gstcoretracers"].requires = ["gstreamer-1.0"] + self.cpp_info.components["gstcoretracers"].libs = ["gstcoretracers"] + self.cpp_info.components["gstcoretracers"].includedirs = [os.path.join("include", "gstreamer-1.0")] + self.cpp_info.components["gstcoretracers"].libdirs = [gst_plugin_path] + + if self.options.shared: + self.output.info("Appending GST_PLUGIN_PATH env var : %s" % gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + gstreamer_root = self.package_folder + self.output.info("Creating GSTREAMER_ROOT env var : %s" % gstreamer_root) + self.env_info.GSTREAMER_ROOT = gstreamer_root + gst_plugin_scanner = "gst-plugin-scanner.exe" if self.settings.os == "Windows" else "gst-plugin-scanner" + gst_plugin_scanner = os.path.join(self.package_folder, "bin", "gstreamer-1.0", gst_plugin_scanner) + self.output.info("Creating GST_PLUGIN_SCANNER env var : %s" % gst_plugin_scanner) + self.env_info.GST_PLUGIN_SCANNER = gst_plugin_scanner + if self.settings.arch == "x86": + self.output.info("Creating GSTREAMER_ROOT_X86 env var : %s" % gstreamer_root) + self.env_info.GSTREAMER_ROOT_X86 = gstreamer_root + elif self.settings.arch == "x86_64": + self.output.info("Creating GSTREAMER_ROOT_X86_64 env var : %s" % gstreamer_root) + self.env_info.GSTREAMER_ROOT_X86_64 = gstreamer_root diff --git a/recipes/gstreamer/all/test_package/CMakeLists.txt b/recipes/gstreamer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4e7b0a54031d8 --- /dev/null +++ b/recipes/gstreamer/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gstreamer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} + gstreamer::gstreamer-1.0 gstreamer::gstreamer-base-1.0 gstreamer::gstreamer-controller-1.0 + gstreamer::gstreamer-net-1.0 gstreamer::gstreamer-check-1.0) +if (TARGET gstreamer::gstcoreelements) + target_link_libraries(${PROJECT_NAME} gstreamer::gstcoreelements) +endif () diff --git a/recipes/gstreamer/all/test_package/conanfile.py b/recipes/gstreamer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gstreamer/all/test_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/gstreamer/all/test_package/test_package.c b/recipes/gstreamer/all/test_package/test_package.c new file mode 100644 index 0000000000000..910eb6a5fcf47 --- /dev/null +++ b/recipes/gstreamer/all/test_package/test_package.c @@ -0,0 +1,35 @@ +#include +#include +#include + +#ifdef GST_STATIC_COMPILATION +GST_PLUGIN_STATIC_DECLARE(coreelements); +#endif + +int main(int argc, char * argv[]) +{ + gst_init(&argc, &argv); + printf("GStreamer version: %s\n", gst_version_string()); + +#ifdef GST_STATIC_COMPILATION + GST_PLUGIN_STATIC_REGISTER(coreelements); +#endif + + GstElement * fakesink = gst_element_factory_make("fakesink", NULL); + if (!fakesink) { + printf("failed to create fakesink element\n"); + return EXIT_FAILURE; + } else { + printf("fakesink has been created successfully\n"); + } + gst_object_unref(GST_OBJECT(fakesink)); + GstElement * fakesrc = gst_element_factory_make("fakesrc", NULL); + if (!fakesrc) { + printf("failed to create fakesrc element\n"); + return EXIT_FAILURE; + } else { + printf("fakesrc has been created successfully\n"); + } + gst_object_unref(GST_OBJECT(fakesrc)); + return EXIT_SUCCESS; +} diff --git a/recipes/gstreamer/config.yml b/recipes/gstreamer/config.yml new file mode 100644 index 0000000000000..e2a4a362c2d1c --- /dev/null +++ b/recipes/gstreamer/config.yml @@ -0,0 +1,13 @@ +versions: + "1.16.2": + folder: all + "1.18.0": + folder: all + "1.18.3": + folder: all + "1.18.4": + folder: all + "1.19.1": + folder: all + "1.19.2": + folder: all diff --git a/recipes/gtest/all/conandata.yml b/recipes/gtest/all/conandata.yml new file mode 100644 index 0000000000000..70ff2819b4d9f --- /dev/null +++ b/recipes/gtest/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.13.0": + url: "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz" + sha256: "ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363" + "1.12.1": + url: "https://github.com/google/googletest/archive/release-1.12.1.tar.gz" + sha256: "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2" + "1.10.0": + url: "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" + sha256: "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb" +patches: + "1.10.0": + - patch_file: "patches/gtest-1.10.0.patch" + patch_description: "add CUSTOM_DEBUG_POSTFIX option" + patch_type: "conan" + - patch_file: "patches/gtest-1.10.0-override.patch" + patch_description: "prevent compiler from complaining while compiling" + patch_type: "bugfix" + patch_source: "https://github.com/google/googletest/pull/2507" diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py new file mode 100644 index 0000000000000..198ee6fa77ef1 --- /dev/null +++ b/recipes/gtest/all/conanfile.py @@ -0,0 +1,192 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, msvc_runtime_flag +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class GTestConan(ConanFile): + name = "gtest" + description = "Google's C++ test framework" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/googletest" + topics = ("testing", "google-testing", "unit-test") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_gmock": [True, False], + "no_main": [True, False], + "hide_symbols": [True, False], + "debug_postfix": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "build_gmock": True, + "no_main": False, + "hide_symbols": False, + "debug_postfix": "d", + } + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.13.0" else "14" + + @property + def _minimum_compilers_version(self): + return { + "11": { + "Visual Studio": "14", + "msvc": "190", + "gcc": "4.8.1" if Version(self.version) < "1.11.0" else "5", + "clang": "3.3" if Version(self.version) < "1.11.0" else "5", + "apple-clang": "5.0" if Version(self.version) < "1.11.0" else "9.1", + }, + # Sinse 1.13.0, gtest requires C++14 and Google's Foundational C++ Support Policy + # https://github.com/google/oss-policies-info/blob/603a042ce2ee8f165fac46721a651d796ce59cb6/foundational-cxx-support-matrix.md + "14": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7.3.1", + "clang": "6", + "apple-clang": "12", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "1.12.0" or self.settings.build_type != "Debug": + del self.options.debug_postfix + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.no_main # Only used to expose more targets + + def validate(self): + if self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("gtest shared is not compatible with static vc runtime") + + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = self.settings.compiler + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_GMOCK"] = bool(self.options.build_gmock) + tc.variables["gtest_hide_internal_symbols"] = bool(self.options.hide_symbols) + + if self.settings.build_type == "Debug" and Version(self.version) < "1.12.0": + tc.cache_variables["CUSTOM_DEBUG_POSTFIX"] = str(self.options.debug_postfix) + + if self.settings.compiler.get_safe("runtime"): + tc.variables["gtest_force_shared_crt"] = "MD" in msvc_runtime_flag(self) + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + tc.variables["gtest_disable_pthreads"] = True + if Version(self.version) < "1.12.0": + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # No warnings as errors + internal_utils = os.path.join(self.source_folder, "googletest", "cmake", "internal_utils.cmake") + replace_in_file(self, internal_utils, "-WX", "") + if Version(self.version) < "1.12.0": + replace_in_file(self, internal_utils, "-Werror", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + @property + def _postfix(self): + return self.options.get_safe("debug_postfix", "") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "GTest") + + # gtest + self.cpp_info.components["libgtest"].set_property("cmake_target_name", "GTest::gtest") + self.cpp_info.components["libgtest"].set_property("cmake_target_aliases", ["GTest::GTest"]) + self.cpp_info.components["libgtest"].set_property("pkg_config_name", "gtest") + self.cpp_info.components["libgtest"].libs = [f"gtest{self._postfix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libgtest"].system_libs.append("m") + self.cpp_info.components["libgtest"].system_libs.append("pthread") + if self.settings.os == "Neutrino" and self.settings.os.version == "7.1": + self.cpp_info.components["libgtest"].system_libs.append("regex") + if self.options.shared: + self.cpp_info.components["libgtest"].defines.append("GTEST_LINKED_AS_SHARED_LIBRARY=1") + + # gtest_main + if not self.options.no_main: + self.cpp_info.components["gtest_main"].set_property("cmake_target_name", "GTest::gtest_main") + self.cpp_info.components["gtest_main"].set_property("cmake_target_aliases", ["GTest::Main"]) + self.cpp_info.components["gtest_main"].set_property("pkg_config_name", "gtest_main") + self.cpp_info.components["gtest_main"].libs = [f"gtest_main{self._postfix}"] + self.cpp_info.components["gtest_main"].requires = ["libgtest"] + + # gmock + if self.options.build_gmock: + self.cpp_info.components["gmock"].set_property("cmake_target_name", "GTest::gmock") + self.cpp_info.components["gmock"].set_property("pkg_config_name", "gmock") + self.cpp_info.components["gmock"].libs = [f"gmock{self._postfix}"] + self.cpp_info.components["gmock"].requires = ["libgtest"] + + # gmock_main + if not self.options.no_main: + self.cpp_info.components["gmock_main"].set_property("cmake_target_name", "GTest::gmock_main") + self.cpp_info.components["gmock_main"].set_property("pkg_config_name", "gmock_main") + self.cpp_info.components["gmock_main"].libs = [f"gmock_main{self._postfix}"] + self.cpp_info.components["gmock_main"].requires = ["gmock"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "GTest" + self.cpp_info.names["cmake_find_package_multi"] = "GTest" + self.cpp_info.components["libgtest"].names["cmake_find_package"] = "gtest" + self.cpp_info.components["libgtest"].names["cmake_find_package_multi"] = "gtest" diff --git a/recipes/gtest/all/patches/gtest-1.10.0-override.patch b/recipes/gtest/all/patches/gtest-1.10.0-override.patch new file mode 100644 index 0000000000000..1757bf3107445 --- /dev/null +++ b/recipes/gtest/all/patches/gtest-1.10.0-override.patch @@ -0,0 +1,450 @@ +From 3cddd56e195b516f449bea6dcd3edd4494195631 Mon Sep 17 00:00:00 2001 +From: Robert Luberda +Date: Wed, 9 Oct 2019 21:48:00 +0200 +Subject: [PATCH] Add more override keywords + +Mark more functions with "override" keyword, just like +it was done in commit 2460f97152c. + +This should prevent compiler from complaining while compiling both +user code, and the googletest code itself with the -Wsuggest-override +option turned on; with the exception of: + * calls to new MOCK_METHOD() in test/gmock-function-mocker_test.cc + * calls to old MOCK_METHODx()/MOCK_CONST_METHODx() in other + unit test files. + +Closes #2493 +--- + .../include/gmock/gmock-generated-actions.h | 24 ++--- + .../gmock/gmock-generated-actions.h.pump | 4 +- + .../include/gmock/gmock-generated-matchers.h | 88 +++++++++---------- + .../gmock/gmock-generated-matchers.h.pump | 8 +- + googletest/include/gtest/gtest-typed-test.h | 4 +- + .../include/gtest/internal/gtest-port.h | 4 +- + googletest/test/gtest_unittest.cc | 4 +- + 7 files changed, 68 insertions(+), 68 deletions(-) + +diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h +index 981af78ff..cee96dae8 100644 +--- a/googlemock/include/gmock/gmock-generated-actions.h ++++ b/googlemock/include/gmock/gmock-generated-actions.h +@@ -663,7 +663,7 @@ class ActionHelper { + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -726,7 +726,7 @@ class ActionHelper { + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl() {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -776,7 +776,7 @@ class ActionHelper { + args_type;\ + explicit gmock_Impl(p0##_type gmock_p0) : \ + p0(::std::forward(gmock_p0)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -832,7 +832,7 @@ class ActionHelper { + gmock_Impl(p0##_type gmock_p0, \ + p1##_type gmock_p1) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -893,7 +893,7 @@ class ActionHelper { + p2##_type gmock_p2) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -961,7 +961,7 @@ class ActionHelper { + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1038,7 +1038,7 @@ class ActionHelper { + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1119,7 +1119,7 @@ class ActionHelper { + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1206,7 +1206,7 @@ class ActionHelper { + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1302,7 +1302,7 @@ class ActionHelper { + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1404,7 +1404,7 @@ class ActionHelper { + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1513,7 +1513,7 @@ class ActionHelper { + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)), \ + p9(::std::forward(gmock_p9)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump +index 209603c5a..283abcdc2 100644 +--- a/googlemock/include/gmock/gmock-generated-actions.h.pump ++++ b/googlemock/include/gmock/gmock-generated-actions.h.pump +@@ -395,7 +395,7 @@ $range k 0..n-1 + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -482,7 +482,7 @@ $var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]] + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h +index 690a57f1c..61892380c 100644 +--- a/googlemock/include/gmock/gmock-generated-matchers.h ++++ b/googlemock/include/gmock/gmock-generated-matchers.h +@@ -269,13 +269,13 @@ + public:\ + gmock_Impl()\ + {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + private:\ +@@ -318,13 +318,13 @@ + public:\ + explicit gmock_Impl(p0##_type gmock_p0)\ + : p0(::std::move(gmock_p0)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -371,13 +371,13 @@ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -431,13 +431,13 @@ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -495,13 +495,13 @@ + p3##_type gmock_p3)\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -568,13 +568,13 @@ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -644,13 +644,13 @@ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -726,13 +726,13 @@ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -814,13 +814,13 @@ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -909,13 +909,13 @@ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -1009,13 +1009,13 @@ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump +index ae90917cc..69d2ae418 100644 +--- a/googlemock/include/gmock/gmock-generated-matchers.h.pump ++++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump +@@ -302,13 +302,13 @@ $var param_field_decls2 = [[$for j + public:\ + [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\ + $impl_inits {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\$param_field_decls + private:\ +diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h +index 095ce0580..6b7c9c8a0 100644 +--- a/googletest/include/gtest/gtest-typed-test.h ++++ b/googletest/include/gtest/gtest-typed-test.h +@@ -201,7 +201,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); + private: \ + typedef CaseName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ +- virtual void TestBody(); \ ++ void TestBody() override; \ + }; \ + static bool gtest_##CaseName##_##TestName##_registered_ \ + GTEST_ATTRIBUTE_UNUSED_ = \ +@@ -276,7 +276,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); + private: \ + typedef SuiteName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ +- virtual void TestBody(); \ ++ void TestBody() override; \ + }; \ + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ +diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h +index f6433c58a..2b4770ff5 100644 +--- a/googletest/include/gtest/internal/gtest-port.h ++++ b/googletest/include/gtest/internal/gtest-port.h +@@ -1599,7 +1599,7 @@ class ThreadLocal : public ThreadLocalBase { + class DefaultValueHolderFactory : public ValueHolderFactory { + public: + DefaultValueHolderFactory() {} +- virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); } ++ ValueHolder* MakeNewHolder() const override { return new ValueHolder(); } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory); +@@ -1608,7 +1608,7 @@ class ThreadLocal : public ThreadLocalBase { + class InstanceValueHolderFactory : public ValueHolderFactory { + public: + explicit InstanceValueHolderFactory(const T& value) : value_(value) {} +- virtual ValueHolder* MakeNewHolder() const { ++ ValueHolder* MakeNewHolder() const override { + return new ValueHolder(value_); + } + +diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc +index 8312bd10e..d17a15540 100644 +--- a/googletest/test/gtest_unittest.cc ++++ b/googletest/test/gtest_unittest.cc +@@ -6170,7 +6170,7 @@ TEST_F(ParseFlagsTest, WideStrings) { + #if GTEST_USE_OWN_FLAGFILE_FLAG_ + class FlagfileTest : public ParseFlagsTest { + public: +- virtual void SetUp() { ++ void SetUp() override { + ParseFlagsTest::SetUp(); + + testdata_path_.Set(internal::FilePath( +@@ -6180,7 +6180,7 @@ class FlagfileTest : public ParseFlagsTest { + EXPECT_TRUE(testdata_path_.CreateFolder()); + } + +- virtual void TearDown() { ++ void TearDown() override { + testing::internal::posix::RmDir(testdata_path_.c_str()); + ParseFlagsTest::TearDown(); + } diff --git a/recipes/gtest/all/patches/gtest-1.10.0.patch b/recipes/gtest/all/patches/gtest-1.10.0.patch new file mode 100644 index 0000000000000..92d37990ee2c6 --- /dev/null +++ b/recipes/gtest/all/patches/gtest-1.10.0.patch @@ -0,0 +1,13 @@ +diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake +index 2f70f0b0..8cd03693 100644 +--- a/googletest/cmake/internal_utils.cmake ++++ b/googletest/cmake/internal_utils.cmake +@@ -154,7 +154,7 @@ function(cxx_library_with_type name type cxx_flags) + # Generate debug library name with a postfix. + set_target_properties(${name} + PROPERTIES +- DEBUG_POSTFIX "d") ++ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") + # Set the output directory for build artifacts + set_target_properties(${name} + PROPERTIES diff --git a/recipes/gtest/all/test_package/CMakeLists.txt b/recipes/gtest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3ca688fabb972 --- /dev/null +++ b/recipes/gtest/all/test_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(GTest REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest) +if(GTest_VERSION VERSION_LESS "1.13.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() + +if(WITH_MAIN) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest_main) + if(WITH_GMOCK) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gmock_main) + endif() +else() + target_sources(${PROJECT_NAME} PRIVATE main.cpp) +endif() + +if(WITH_GMOCK) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gmock) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_GMOCK) +endif() diff --git a/recipes/gtest/all/test_package/conanfile.py b/recipes/gtest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1bddd2ba2988a --- /dev/null +++ b/recipes/gtest/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + + with_gmock = bool(self.dependencies[self.tested_reference_str].options.build_gmock) + tc.cache_variables['WITH_GMOCK'] = with_gmock + if with_gmock: + tc.preprocessor_definitions['WITH_GMOCK'] = 1 + + tc.variables['WITH_MAIN'] = not bool(self.dependencies[self.tested_reference_str].options.no_main) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gtest/all/test_package/main.cpp b/recipes/gtest/all/test_package/main.cpp new file mode 100644 index 0000000000000..4483c91af4082 --- /dev/null +++ b/recipes/gtest/all/test_package/main.cpp @@ -0,0 +1,6 @@ +#include "gtest/gtest.h" + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/recipes/gtest/all/test_package/test_package.cpp b/recipes/gtest/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..36d68c62eb3c5 --- /dev/null +++ b/recipes/gtest/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +// Thanks to http://joeyates.info/2010/05/26/googletest-hello-world/ for the example! + +///////////////////////////// +// In the header file + +#include +using namespace std; + +class Salutation +{ +public: + static string greet(const string& name); +}; + +/////////////////////////////////////// +// In the class implementation file + +string Salutation::greet(const string& name) { + ostringstream s; + s << "Hello " << name << "!"; + return s.str(); +} + +/////////////////////////////////////////// +// In the test file +#include + +#ifdef WITH_GMOCK +#include + +class Example +{ +public: + virtual void foo() = 0; +}; + +class MockExample : public Example +{ +public: + MOCK_METHOD0(foo, void()); +}; + +#endif + +TEST(SalutationTest, Static) { + +#ifdef WITH_GMOCK + MockExample m; +#endif + + EXPECT_EQ(string("Hello World!"), Salutation::greet("World")); +} diff --git a/recipes/gtest/all/test_v1_package/CMakeLists.txt b/recipes/gtest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gtest/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gtest/all/test_v1_package/conanfile.py b/recipes/gtest/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1490f15fbb3c6 --- /dev/null +++ b/recipes/gtest/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions['WITH_GMOCK'] = self.options['gtest'].build_gmock + cmake.definitions['WITH_MAIN'] = not self.options['gtest'].no_main + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gtest/config.yml b/recipes/gtest/config.yml new file mode 100644 index 0000000000000..6df56e900d95a --- /dev/null +++ b/recipes/gtest/config.yml @@ -0,0 +1,7 @@ +versions: + "1.13.0": + folder: all + "1.12.1": + folder: all + "1.10.0": + folder: all diff --git a/recipes/gtk-doc-stub/all/conandata.yml b/recipes/gtk-doc-stub/all/conandata.yml new file mode 100644 index 0000000000000..f0e15055fe310 --- /dev/null +++ b/recipes/gtk-doc-stub/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20181216": + url: "https://gitlab.gnome.org/GNOME/gtk-doc-stub/-/archive/d26c9b8343540661080eccbff393ee5709a673f4/gtk-doc-stub-d26c9b8343540661080eccbff393ee5709a673f4.tar.gz" + sha256: "50da38b540d9cf8a865b4c9a10d45f09471d29f7dd946dd63cfc94b44fee8479" +patches: + "cci.20181216": + - patch_file: "patches/0001-relocatable-gtkdocize.patch" + base_path: "source_subfolder" diff --git a/recipes/gtk-doc-stub/all/conanfile.py b/recipes/gtk-doc-stub/all/conanfile.py new file mode 100644 index 0000000000000..dc86c338bb133 --- /dev/null +++ b/recipes/gtk-doc-stub/all/conanfile.py @@ -0,0 +1,65 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import functools +import os + +required_conan_version = ">=1.33.0" + + +class GtkDocStubConan(ConanFile): + name = "gtk-doc-stub" + homepage = "https://gitlab.gnome.org/GNOME/gtk-doc-stub" + description = "Helper scripts for generating GTK documentation" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-2.0-or-later" + topics = ("gtk", "documentation", "gtkdocize") + settings = "os" + + exports_sources = "patches/*" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_autotools(self): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + args = [ + "--datadir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), + "--datarootdir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), + ] + autotools.configure(args=args, configure_dir=self._source_subfolder) + return autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + autotools = self._configure_autotools() + autotools.install() + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] + + automake_dir = tools.unix_path(os.path.join(self.package_folder, "res", "aclocal")) + self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(automake_dir)) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(automake_dir) diff --git a/recipes/gtk-doc-stub/all/patches/0001-relocatable-gtkdocize.patch b/recipes/gtk-doc-stub/all/patches/0001-relocatable-gtkdocize.patch new file mode 100644 index 0000000000000..c9e5d61667830 --- /dev/null +++ b/recipes/gtk-doc-stub/all/patches/0001-relocatable-gtkdocize.patch @@ -0,0 +1,15 @@ +--- gtkdocize.in ++++ gtkdocize.in +@@ -6,9 +6,9 @@ + PACKAGE=gtk-doc + VERSION=1.1000 + +-prefix=@prefix@ +-datarootdir=@datarootdir@ +-datadir=@datadir@ ++SCRIPT_HOME=`dirname $0 | while read a; do cd $a && pwd && break; done` ++datarootdir=$SCRIPT_HOME/../res ++datadir=$datarootdir + + # options + copy=no diff --git a/recipes/gtk-doc-stub/all/test_package/conanfile.py b/recipes/gtk-doc-stub/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9346d5cf9cd7a --- /dev/null +++ b/recipes/gtk-doc-stub/all/test_package/conanfile.py @@ -0,0 +1,37 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "configure.ac", + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + self.build_requires("automake/1.16.4") + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), + os.path.join(self.build_folder, src)) + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True, win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + args = [ + "--enable-option-checking=fatal", + "--enable-gtk-doc=no", + ] + autotools.configure(args=args) + + def test(self): + self.run("gtkdocize --copy", run_environment=True, win_bash=tools.os_info.is_windows) diff --git a/recipes/gtk-doc-stub/all/test_package/configure.ac b/recipes/gtk-doc-stub/all/test_package/configure.ac new file mode 100644 index 0000000000000..1764b280fd98b --- /dev/null +++ b/recipes/gtk-doc-stub/all/test_package/configure.ac @@ -0,0 +1,7 @@ +AC_INIT([test_package], [1.0]) + +AC_CONFIG_SRCDIR([configure.ac]) + +GTK_DOC_CHECK + +AC_OUTPUT diff --git a/recipes/gtk-doc-stub/config.yml b/recipes/gtk-doc-stub/config.yml new file mode 100644 index 0000000000000..4d27ee8819880 --- /dev/null +++ b/recipes/gtk-doc-stub/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20181216": + folder: "all" diff --git a/recipes/gtk/all/conandata.yml b/recipes/gtk/all/conandata.yml new file mode 100644 index 0000000000000..2fd377b60695c --- /dev/null +++ b/recipes/gtk/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "4.7.0": + sha256: "913fcd9d065efb348723e18c3b9113e23b92072e927ebd2f61d32745c8228b94" + url: "https://download.gnome.org/sources/gtk/4.7/gtk-4.7.0.tar.xz" + "4.6.2": + url: "https://download.gnome.org/sources/gtk/4.6/gtk-4.6.2.tar.xz" + sha256: "ff263af609a50eb76056653592d929459aef4819a444c436f6d52c6f63c1faec" + "4.4.0": + url: "https://download.gnome.org/sources/gtk/4.4/gtk-4.4.0.tar.xz" + sha256: "e0a1508f441686c3a20dfec48af533b19a4b2e017c18eaee31dccdb7d292505b" + "4.3.2": + url: "https://download.gnome.org/sources/gtk/4.3/gtk-4.3.2.tar.xz" + sha256: "20639bb2be8b9f58304f14480e3d957abd2c9fa3f671bb7e05193f9a8389d93f" + "4.2.1": + url: "https://download.gnome.org/sources/gtk/4.2/gtk-4.2.1.tar.xz" + sha256: "023169775de43f0a1fde066fbc19d78545ea6a7562c1915abde9b8ae4a7309e6" + "4.1.2": + url: "https://download.gnome.org/sources/gtk/4.1/gtk-4.1.2.tar.xz" + sha256: "33407da437c5e5ac09e7a463ba3bd025da3d80ba1953b8bbe2bce97dd2609677" + "4.0.2": + url: "https://download.gnome.org/sources/gtk/4.0/gtk-4.0.2.tar.xz" + sha256: "626707ac6751426ed76fed49c5b2d052dfee45757ce3827088ba87ca7f1dbc84" + "3.24.24": + url: "https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.24.tar.xz" + sha256: "cc9d4367c55b724832f6b09ab85481738ea456871f0381768a6a99335a98378a" +patches: + "4.4.0": + - patch_file: "patches/0001-fix-UAC-manifest-rc.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-version-resource-for-Windows-11-sdk.patch" + base_path: "source_subfolder" + "4.3.2": + - patch_file: "patches/0001-fix-UAC-manifest-rc.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-version-resource-for-Windows-11-sdk.patch" + base_path: "source_subfolder" + "4.2.1": + - patch_file: "patches/0001-fix-UAC-manifest-rc.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-version-resource-for-Windows-11-sdk.patch" + base_path: "source_subfolder" diff --git a/recipes/gtk/all/conanfile.py b/recipes/gtk/all/conanfile.py new file mode 100644 index 0000000000000..3d742625f585d --- /dev/null +++ b/recipes/gtk/all/conanfile.py @@ -0,0 +1,242 @@ +from conans import ConanFile, Meson, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class GtkConan(ConanFile): + name = "gtk" + description = "libraries used for creating graphical user interfaces for applications." + topics = ("gtk", "widgets") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gtk.org" + license = "LGPL-2.1-or-later" + generators = "pkg_config" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_wayland": [True, False], + "with_x11": [True, False], + "with_pango": [True, False], + "with_ffmpeg": [True, False], + "with_gstreamer": [True, False], + "with_cups": [True, False], + "with_cloudprint": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_wayland": False, + "with_x11": True, + "with_pango": True, + "with_ffmpeg": False, + "with_gstreamer": False, + "with_cups": False, + "with_cloudprint": False + } + + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _gtk4(self): + return tools.Version("4.0.0") <= tools.Version(self.version) < tools.Version("5.0.0") + + @property + def _gtk3(self): + return tools.Version("3.0.0") <= tools.Version(self.version) < tools.Version("4.0.0") + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # Fix duplicate definitions of DllMain + self.options["gdk-pixbuf"].shared = True + # Fix segmentation fault + self.options["cairo"].shared = True + if tools.Version(self.version) >= "4.1.0": + # The upstream meson file does not create a static library + # See https://github.com/GNOME/gtk/commit/14f0a0addb9a195bad2f8651f93b95450b186bd6 + self.options.shared = True + if self.settings.os != "Linux": + del self.options.with_wayland + del self.options.with_x11 + + def validate(self): + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("this recipes does not support GCC before version 5. contributions are welcome") + if str(self.settings.compiler) in ["Visual Studio", "msvc"]: + if tools.Version(self.version) < "4.2": + raise ConanInvalidConfiguration("MSVC support of this recipe requires at least gtk/4.2") + if not self.options["gdk-pixbuf"].shared: + raise ConanInvalidConfiguration("MSVC build requires shared gdk-pixbuf") + if not self.options["cairo"].shared: + raise ConanInvalidConfiguration("MSVC build requires shared cairo") + if tools.Version(self.version) >= "4.1.0": + if not self.options.shared: + raise ConanInvalidConfiguration("gtk supports only shared since 4.1.0") + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.settings.os == "Linux": + if self.options.with_wayland or self.options.with_x11: + if not self.options.with_pango: + raise ConanInvalidConfiguration("with_pango option is mandatory when with_wayland or with_x11 is used") + + def build_requirements(self): + self.build_requires("meson/0.62.2") + if self._gtk4: + self.build_requires("libxml2/2.9.14") # for xmllint + self.build_requires("pkgconf/1.7.4") + if self._gtk4: + self.build_requires("sassc/3.6.2") + + def requirements(self): + self.requires("gdk-pixbuf/2.42.6") + self.requires("glib/2.73.0") + if self._gtk4 or self.settings.compiler != "Visual Studio": + self.requires("cairo/1.17.4") + if self._gtk4: + self.requires("graphene/1.10.8") + self.requires("fribidi/1.0.12") + self.requires("libpng/1.6.37") + self.requires("libtiff/4.3.0") + self.requires("libjpeg/9d") + if self.settings.os == "Linux": + if self._gtk4: + self.requires("xkbcommon/1.4.1") + if self._gtk3: + self.requires("at-spi2-atk/2.38.0") + if self.options.with_wayland: + if self._gtk3: + self.requires("xkbcommon/1.4.1") + self.requires("wayland/1.20.0") + if self.options.with_x11: + self.requires("xorg/system") + if self._gtk3: + self.requires("atk/2.38.0") + self.requires("libepoxy/1.5.10") + if self.options.with_pango: + self.requires("pango/1.50.7") + if self.options.with_ffmpeg: + self.requires("ffmpeg/5.0") + if self.options.with_gstreamer: + self.requires("gstreamer/1.19.2") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def _configure_meson(self): + meson = Meson(self) + defs = {} + if self.settings.os == "Linux": + defs["wayland_backend" if self._gtk3 else "wayland-backend"] = "true" if self.options.with_wayland else "false" + defs["x11_backend" if self._gtk3 else "x11-backend"] = "true" if self.options.with_x11 else "false" + defs["introspection"] = "false" if self._gtk3 else "disabled" + defs["gtk_doc"] = "false" + defs["man-pages" if self._gtk4 else "man"] = "false" + defs["tests" if self._gtk3 else "build-tests"] = "false" + defs["examples" if self._gtk3 else "build-examples"] = "false" + defs["demos"] = "false" + defs["datadir"] = os.path.join(self.package_folder, "res", "share") + defs["localedir"] = os.path.join(self.package_folder, "res", "share", "locale") + defs["sysconfdir"] = os.path.join(self.package_folder, "res", "etc") + + if self._gtk4: + enabled_disabled = lambda opt : "enabled" if opt else "disabled" + defs["media-ffmpeg"] = enabled_disabled(self.options.with_ffmpeg) + defs["media-gstreamer"] = enabled_disabled(self.options.with_gstreamer) + defs["print-cups"] = enabled_disabled(self.options.with_cups) + if tools.Version(self.version) < "4.3.2": + defs["print-cloudprint"] = enabled_disabled(self.options.with_cloudprint) + args=[] + args.append("--wrap-mode=nofallback") + meson.configure(defs=defs, build_folder=self._build_subfolder, source_folder=self._source_subfolder, pkg_config_paths=[self.install_folder], args=args) + return meson + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if self._gtk3: + tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), "\ntest(\n", "\nfalse and test(\n") + if "4.2.0" <= tools.Version(self.version) < "4.6.1": + tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), + "gtk_update_icon_cache: true", + "gtk_update_icon_cache: false") + if "4.6.2" <= tools.Version(self.version): + tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), + "dependency(is_msvc_like ? ", + "dependency(false ? ") + with tools.environment_append(tools.RunEnvironment(self).vars): + meson = self._configure_meson() + meson.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + with tools.environment_append({ + "PKG_CONFIG_PATH": self.install_folder, + "PATH": [os.path.join(self.package_folder, "bin")]}): + meson.install() + + self.copy(pattern="COPYING", src=self._source_subfolder, dst="licenses") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + + def package_info(self): + if self._gtk3: + self.cpp_info.components["gdk-3.0"].libs = ["gdk-3"] + self.cpp_info.components["gdk-3.0"].includedirs = [os.path.join("include", "gtk-3.0")] + self.cpp_info.components["gdk-3.0"].requires = [] + if self.options.with_pango: + self.cpp_info.components["gdk-3.0"].requires.extend(["pango::pango_", "pango::pangocairo"]) + self.cpp_info.components["gdk-3.0"].requires.append("gdk-pixbuf::gdk-pixbuf") + if self.settings.compiler != "Visual Studio": + self.cpp_info.components["gdk-3.0"].requires.extend(["cairo::cairo", "cairo::cairo-gobject"]) + if self.settings.os == "Linux": + self.cpp_info.components["gdk-3.0"].requires.extend(["glib::gio-unix-2.0", "cairo::cairo-xlib"]) + if self.options.with_x11: + self.cpp_info.components["gdk-3.0"].requires.append("xorg::xorg") + self.cpp_info.components["gdk-3.0"].requires.append("libepoxy::libepoxy") + self.cpp_info.components["gdk-3.0"].names["pkg_config"] = "gdk-3.0" + + self.cpp_info.components["gtk+-3.0"].libs = ["gtk-3"] + self.cpp_info.components["gtk+-3.0"].requires = ["gdk-3.0", "atk::atk"] + if self.settings.compiler != "Visual Studio": + self.cpp_info.components["gtk+-3.0"].requires.extend(["cairo::cairo", "cairo::cairo-gobject"]) + self.cpp_info.components["gtk+-3.0"].requires.extend(["gdk-pixbuf::gdk-pixbuf", "glib::gio-2.0"]) + if self.settings.os == "Linux": + self.cpp_info.components["gtk+-3.0"].requires.append("at-spi2-atk::at-spi2-atk") + self.cpp_info.components["gtk+-3.0"].requires.append("libepoxy::libepoxy") + if self.options.with_pango: + self.cpp_info.components["gtk+-3.0"].requires.append('pango::pangoft2') + if self.settings.os == "Linux": + self.cpp_info.components["gtk+-3.0"].requires.append("glib::gio-unix-2.0") + self.cpp_info.components["gtk+-3.0"].includedirs = [os.path.join("include", "gtk-3.0")] + self.cpp_info.components["gtk+-3.0"].names["pkg_config"] = "gtk+-3.0" + + self.cpp_info.components["gail-3.0"].libs = ["gailutil-3"] + self.cpp_info.components["gail-3.0"].requires = ["gtk+-3.0", "atk::atk"] + self.cpp_info.components["gail-3.0"].includedirs = [os.path.join("include", "gail-3.0")] + self.cpp_info.components["gail-3.0"].names["pkg_config"] = "gail-3.0" + elif self._gtk4: + self.cpp_info.names["pkg_config"] = "gtk4" + self.cpp_info.libs = ["gtk-4"] + self.cpp_info.includedirs.append(os.path.join("include", "gtk-4.0")) diff --git a/recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch b/recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch new file mode 100644 index 0000000000000..7994c91a214fc --- /dev/null +++ b/recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch @@ -0,0 +1,36 @@ +From 53705a537c1aa51ffbecfaaf685501b9ea1cb6ba Mon Sep 17 00:00:00 2001 +From: Chun-wei Fan +Date: Wed, 13 Oct 2021 12:17:44 +0800 +Subject: [PATCH] tools/generate-uac-manifest.py: Fix UAC manifest .rc + +The resource compiler in the Windows 11 SDK does not allow one to include +winuser.h directly in resource scripts (.rc) with a rather cryptic error +message, so fix generating the .rc file to embed the UAC manifest by including +windows.h with WIN32_LEAN_AND_MEAN instead. +--- + tools/generate-uac-manifest.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tools/generate-uac-manifest.py b/tools/generate-uac-manifest.py +index ede6ba5044..62f063a8bb 100644 +--- a/tools/generate-uac-manifest.py ++++ b/tools/generate-uac-manifest.py +@@ -24,7 +24,7 @@ def main(): + help='require admin access to application') + parser.add_argument('--input-resource-file', dest='resource', + default=None, +- help='existing .rc file to embed UAC manifest (do not generate a new .rc file), must have included winuser.h in it') ++ help='existing .rc file to embed UAC manifest (do not generate a new .rc file), must have included windows.h in it') + parser.add_argument('--output-dir', dest='outdir', + default=None, + help='directory to output resulting files') +@@ -92,7 +92,8 @@ def write_rc_file(name, resource, outdir): + + if resource is None: + outfile = open(output_file_base_name + '.rc', 'w+') +- outfile.write('#include ') ++ outfile.write('#define WIN32_LEAN_AND_MEAN\n') ++ outfile.write('#include \n') + else: + if resource != output_file_base_name + '.rc': + outfile = open(output_file_base_name + '.rc', 'w+') diff --git a/recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch b/recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch new file mode 100644 index 0000000000000..5233563a36001 --- /dev/null +++ b/recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch @@ -0,0 +1,25 @@ +From 3481ebdafb474ce7e312914e998e7212ecdbc5ba Mon Sep 17 00:00:00 2001 +From: Chun-wei Fan +Date: Wed, 13 Oct 2021 12:16:06 +0800 +Subject: [PATCH] gtk: Fix version resource on for Windows 11 SDK + +The rc.exe that comes with the Windows 11 SDK does not allow one to include +winuser.h directly in the .rc scripts, so make sure that it is not included +by gtk-win32.rc.body.in, but instead include windows.h with WIN32_LEAN_AND_MEAN +defined. +--- + gtk/gtk-win32.rc.body.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gtk/gtk-win32.rc.body.in b/gtk/gtk-win32.rc.body.in +index b876a6ddf5..fc2dfd2ed3 100644 +--- a/gtk/gtk-win32.rc.body.in ++++ b/gtk/gtk-win32.rc.body.in +@@ -1,5 +1,5 @@ +-#include +-#include ++#define WIN32_LEAN_AND_MEAN ++#include + + GTK_ICON ICON "gtk.ico" + diff --git a/recipes/gtk/all/test_package/CMakeLists.txt b/recipes/gtk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afa2476357074 --- /dev/null +++ b/recipes/gtk/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +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/gtk/all/test_package/conanfile.py b/recipes/gtk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/gtk/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gtk/all/test_package/test_package.c b/recipes/gtk/all/test_package/test_package.c new file mode 100644 index 0000000000000..81aed0516c00a --- /dev/null +++ b/recipes/gtk/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "gtk/gtk.h" +#include + +int main (int argc, char **argv) +{ + printf("gtk version %d.%d.%d\n", gtk_get_major_version(), gtk_get_minor_version(), gtk_get_micro_version()); + printf("binary age: %d\n", gtk_get_binary_age()); + printf("interface age: %d\n", gtk_get_interface_age()); + return 0; +} diff --git a/recipes/gtk/config.yml b/recipes/gtk/config.yml new file mode 100644 index 0000000000000..d1ce9d2211eee --- /dev/null +++ b/recipes/gtk/config.yml @@ -0,0 +1,19 @@ +versions: + "system": + folder: "system" + "4.7.0": + folder: all + "4.6.2": + folder: all + "4.4.0": + folder: all + "4.3.2": + folder: all + "4.2.1": + folder: all + "4.1.2": + folder: all + "4.0.2": + folder: all + "3.24.24": + folder: all diff --git a/recipes/gtk/system/conanfile.py b/recipes/gtk/system/conanfile.py new file mode 100644 index 0000000000000..265377d6fedfe --- /dev/null +++ b/recipes/gtk/system/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager + +required_conan_version = ">=1.50.0" + + +class ConanGTK(ConanFile): + name = "gtk" + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-2.1-or-later" + homepage = "https://www.gtk.org" + description = "A free and open-source cross-platform widget toolkit for creating graphical user interfaces" + topics = ("gui", "widget", "graphical") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = {"version": [2, 3]} + default_options = {"version": 2} + + def layout(self): + pass + + def package_id(self): + self.info.settings.clear() + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def system_requirements(self): + dnf = package_manager.Dnf(self) + dnf.install([f"gtk{self.options.version}-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install([f"gtk{self.options.version}-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libgtk2.0-dev"] if self.options.version == 2 else ["libgtk-3-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install([f"gtk{self.options.version}"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install([f"gtk{self.options.version}-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install([f"gtk{self.options.version}"], update=True, check=True) + + def package_info(self): + for name in [f"gtk+-{self.options.version}.0"]: + pkg_config = PkgConfig(self, name) + pkg_config.fill_cpp_info(self.cpp_info, is_system=True) diff --git a/recipes/gtk/system/test_package/CMakeLists.txt b/recipes/gtk/system/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7439c8794d1a1 --- /dev/null +++ b/recipes/gtk/system/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(gtk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) + +target_link_libraries(${PROJECT_NAME} PRIVATE gtk::gtk) + diff --git a/recipes/gtk/system/test_package/conanfile.py b/recipes/gtk/system/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/gtk/system/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gtk/system/test_package/test_package.c b/recipes/gtk/system/test_package/test_package.c new file mode 100644 index 0000000000000..3d9a10b5d775d --- /dev/null +++ b/recipes/gtk/system/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(void) { + gtk_window_new (GTK_WINDOW_TOPLEVEL); + + return EXIT_SUCCESS; +} diff --git a/recipes/gtk/system/test_v1_package/CMakeLists.txt b/recipes/gtk/system/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/gtk/system/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/gtk/system/test_v1_package/conanfile.py b/recipes/gtk/system/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/gtk/system/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gtk/system/test_v1_package/test_package.c b/recipes/gtk/system/test_v1_package/test_package.c new file mode 100644 index 0000000000000..3d9a10b5d775d --- /dev/null +++ b/recipes/gtk/system/test_v1_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(void) { + gtk_window_new (GTK_WINDOW_TOPLEVEL); + + return EXIT_SUCCESS; +} diff --git a/recipes/gtsam/all/conandata.yml b/recipes/gtsam/all/conandata.yml new file mode 100644 index 0000000000000..a7ab46e7ea6fb --- /dev/null +++ b/recipes/gtsam/all/conandata.yml @@ -0,0 +1,50 @@ +sources: + "4.1.1": + url: "https://github.com/borglab/gtsam/archive/4.1.1.tar.gz" + sha256: "c7b5e6cdad52b141c272778f47baf628975457be3e26ed96a7bc2ae685a00af0" + "4.0.3": + url: "https://github.com/borglab/gtsam/archive/4.0.3.tar.gz" + sha256: "eaa561749edf7a2d402981828253e28aed6c717dae35738301c5ab23e2595f25" + "4.0.2": + url: "https://github.com/borglab/gtsam/archive/4.0.2.tar.gz" + sha256: "8770a440f1af98c3f0d9d4dffd568de2d4c21b245e7231e987e26bc236aeb5aa" +patches: + "4.1.1": + - patch_file: "patches/4.1.1-0001-cmake-boost.patch" + patch_description: "Use boost targets" + patch_type: "conan" + - patch_file: "patches/4.1.1-0002-cmake-eigen.patch" + patch_description: "Use Eigen include variable from CMakeDeps" + patch_type: "conan" + - patch_file: "patches/4.1.1-0003-macos-rpath.patch" + patch_description: "Relocatable shared libs on Apple OS" + patch_type: "conan" + - patch_file: "patches/4.0.2-0003-cmake-project.patch" + patch_description: "CMake: move project() after cmake_minimum_required()" + patch_type: "conan" + "4.0.3": + - patch_file: "patches/4.0.3-0001-cmake-boost.patch" + patch_description: "Use boost targets" + patch_type: "conan" + - patch_file: "patches/4.0.3-0002-cmake-eigen.patch" + patch_description: "Use Eigen include variable from CMakeDeps" + patch_type: "conan" + - patch_file: "patches/4.0.3-0003-macos-rpath.patch" + patch_description: "Relocatable shared libs on Apple OS" + patch_type: "conan" + - patch_file: "patches/4.0.2-0003-cmake-project.patch" + patch_description: "CMake: move project() after cmake_minimum_required()" + patch_type: "conan" + "4.0.2": + - patch_file: "patches/4.0.2-0001-cmake-boost.patch" + patch_description: "Use boost targets" + patch_type: "conan" + - patch_file: "patches/4.0.2-0002-cmake-eigen.patch" + patch_description: "Use Eigen include variable from CMakeDeps" + patch_type: "conan" + - patch_file: "patches/4.0.2-0003-macos-rpath.patch" + patch_description: "Relocatable shared libs on Apple OS" + patch_type: "conan" + - patch_file: "patches/4.0.2-0003-cmake-project.patch" + patch_description: "CMake: move project() after cmake_minimum_required()" + patch_type: "conan" diff --git a/recipes/gtsam/all/conanfile.py b/recipes/gtsam/all/conanfile.py new file mode 100644 index 0000000000000..6ed583d1786ac --- /dev/null +++ b/recipes/gtsam/all/conanfile.py @@ -0,0 +1,258 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.microsoft import check_min_vs, is_msvc, msvc_runtime_flag +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class GtsamConan(ConanFile): + name = "gtsam" + license = "BSD-3-Clause" + homepage = "https://github.com/borglab/gtsam" + 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") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_quaternions": [True, False], + "pose3_expmap": [True, False], + "rot3_expmap": [True, False], + "enable_consistency_checks": [True, False], + "with_TBB": [True, False], + "with_eigen_MKL": [True, False], + "with_eigen_MKL_OPENMP": [True, False], + "throw_cheirality_exception": [True, False], + "allow_deprecated_since_V4": [True, False], + "typedef_points_to_vectors": [True, False], + "support_nested_dissection": [True, False], + "tangent_preintegration": [True, False], + "build_wrap": [True, False], + "wrap_serialization": [True, False], + "build_unstable": [True, False], + "disable_new_timers": [True, False], + "build_type_postfixes": [True, False], + "install_matlab_toolbox": [True, False], + "install_cython_toolbox": [True, False], + "install_cppunitlite": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_quaternions": False, + "pose3_expmap": False, + "rot3_expmap": False, + "enable_consistency_checks": False, + "with_TBB": False, + "with_eigen_MKL": False, + "with_eigen_MKL_OPENMP": False, + "throw_cheirality_exception": True, + "allow_deprecated_since_V4": True, + "typedef_points_to_vectors": False, + "support_nested_dissection": False, + "tangent_preintegration": False, + "build_wrap": False, + "wrap_serialization": True, + "build_unstable": True, + "disable_new_timers": False, + "build_type_postfixes": True, + "install_matlab_toolbox": False, + "install_cython_toolbox": False, + "install_cppunitlite": 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") + if self.options.with_TBB: + self.options["onetbb"].tbbmalloc = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0") + self.requires("eigen/3.4.0") + if self.options.with_TBB: + self.requires("onetbb/2020.3") + + @property + def _required_boost_components(self): + return ["serialization", "system", "filesystem", "thread", "date_time", "regex", "timer", "chrono"] + + def validate(self): + 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.options.with_TBB and not self.dependencies["onetbb"].options.tbbmalloc: + raise ConanInvalidConfiguration("gtsam with tbb requires onetbb:tbbmalloc=True") + + check_min_vs(self, "191") + + if Version(self.version) >= "4.1.0" and is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} does not support shared builds with MSVC. See https://github.com/borglab/gtsam/issues/1087" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["GTSAM_USE_QUATERNIONS"] = self.options.use_quaternions + tc.variables["GTSAM_POSE3_EXPMAP"] = self.options.pose3_expmap + tc.variables["GTSAM_ROT3_EXPMAP"] = self.options.rot3_expmap + tc.variables["GTSAM_ENABLE_CONSISTENCY_CHECKS"] = self.options.enable_consistency_checks + tc.variables["GTSAM_WITH_TBB"] = self.options.with_TBB + tc.variables["GTSAM_WITH_EIGEN_MKL"] = self.options.with_eigen_MKL + tc.variables["GTSAM_WITH_EIGEN_MKL_OPENMP"] = self.options.with_eigen_MKL_OPENMP + tc.variables["GTSAM_THROW_CHEIRALITY_EXCEPTION"] = self.options.throw_cheirality_exception + tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated_since_V4 + tc.variables["GTSAM_TYPEDEF_POINTS_TO_VECTORS"] = self.options.typedef_points_to_vectors + tc.variables["GTSAM_SUPPORT_NESTED_DISSECTION"] = self.options.support_nested_dissection + tc.variables["GTSAM_TANGENT_PREINTEGRATION"] = self.options.tangent_preintegration + tc.variables["GTSAM_BUILD_WITH_CCACHE"] = False + tc.variables["GTSAM_BUILD_UNSTABLE"] = self.options.build_unstable + tc.variables["GTSAM_DISABLE_NEW_TIMERS"] = self.options.disable_new_timers + tc.variables["GTSAM_BUILD_TYPE_POSTFIXES"] = self.options.build_type_postfixes + tc.variables["GTSAM_BUILD_TESTS"] = False + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.variables["Boost_NO_SYSTEM_PATHS"] = True + tc.variables["GTSAM_BUILD_DOCS"] = False + tc.variables["GTSAM_BUILD_DOC_HTML"] = False + tc.variables["GTSAM_BUILD_EXAMPLES_ALWAYS"] = False + tc.variables["GTSAM_BUILD_WRAP"] = self.options.build_wrap + tc.variables["GTSAM_BUILD_WITH_MARCH_NATIVE"] = False + tc.variables["GTSAM_WRAP_SERIALIZATION"] = self.options.wrap_serialization + tc.variables["GTSAM_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox + tc.variables["GTSAM_INSTALL_CYTHON_TOOLBOX"] = self.options.install_cython_toolbox + tc.variables["GTSAM_INSTALL_CPPUNITLITE"] = self.options.install_cppunitlite + tc.variables["GTSAM_INSTALL_GEOGRAPHICLIB"] = False + tc.variables["GTSAM_USE_SYSTEM_EIGEN"] = True + tc.variables["GTSAM_BUILD_TYPE_POSTFIXES"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Honor vc runtime + if is_msvc(self): + gtsam_build_types_cmake = os.path.join(self.source_folder, "cmake", "GtsamBuildTypes.cmake") + 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)} ") + + 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, "LICENSE.BSD", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "gtsam": "GTSAM::gtsam", + "gtsam_unstable": "GTSAM::gtsam_unstable", + "metis-gtsam": "GTSAM::metis-gtsam", + "CppUnitLite": "GTSAM::CppUnitLite", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "GTSAM") + + prefix = "lib" if is_msvc(self) and not self.options.shared else "" + + self.cpp_info.components["libgtsam"].set_property("cmake_target_name", "gtsam") + self.cpp_info.components["libgtsam"].libs = [f"{prefix}gtsam"] + self.cpp_info.components["libgtsam"].requires = [f"boost::{component}" for component in self._required_boost_components] + self.cpp_info.components["libgtsam"].requires.append("eigen::eigen") + if self.options.with_TBB: + self.cpp_info.components["libgtsam"].requires.append("onetbb::onetbb") + if self.options.support_nested_dissection: + self.cpp_info.components["libgtsam"].requires.append("libmetis-gtsam") + if self.settings.os == "Windows" and Version(self.version) >= "4.0.3": + self.cpp_info.components["libgtsam"].system_libs = ["dbghelp"] + + if self.options.build_unstable: + self.cpp_info.components["libgtsam_unstable"].set_property("cmake_target_name", "gtsam_unstable") + self.cpp_info.components["libgtsam_unstable"].libs = [f"{prefix}gtsam_unstable"] + self.cpp_info.components["libgtsam_unstable"].requires = ["libgtsam"] + + if self.options.support_nested_dissection: + self.cpp_info.components["libmetis-gtsam"].set_property("cmake_target_name", "metis-gtsam") + self.cpp_info.components["libmetis-gtsam"].libs = ["metis-gtsam"] + self.cpp_info.components["libmetis-gtsam"].names["pkg_config"] = "metis-gtsam" + + if self.options.install_cppunitlite: + self.cpp_info.components["gtsam_CppUnitLite"].set_property("cmake_target_name", "CppUnitLite") + self.cpp_info.components["gtsam_CppUnitLite"].libs = ["CppUnitLite"] + self.cpp_info.components["gtsam_CppUnitLite"].requires = ["boost::boost"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "GTSAM" + self.cpp_info.names["cmake_find_package_multi"] = "GTSAM" + self.cpp_info.components["libgtsam"].names["cmake_find_package"] = "gtsam" + self.cpp_info.components["libgtsam"].names["cmake_find_package_multi"] = "gtsam" + self.cpp_info.components["libgtsam"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libgtsam"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.build_unstable: + self.cpp_info.components["libgtsam_unstable"].names["cmake_find_package"] = "gtsam_unstable" + self.cpp_info.components["libgtsam_unstable"].names["cmake_find_package_multi"] = "gtsam_unstable" + self.cpp_info.components["libgtsam_unstable"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libgtsam_unstable"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.support_nested_dissection: + self.cpp_info.components["libmetis-gtsam"].names["cmake_find_package"] = "metis-gtsam" + self.cpp_info.components["libmetis-gtsam"].names["cmake_find_package_multi"] = "metis-gtsam" + self.cpp_info.components["libmetis-gtsam"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libmetis-gtsam"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.install_cppunitlite: + self.cpp_info.components["gtsam_CppUnitLite"].names["cmake_find_package"] = "CppUnitLite" + self.cpp_info.components["gtsam_CppUnitLite"].names["cmake_find_package_multi"] = "CppUnitLite" + self.cpp_info.components["gtsam_CppUnitLite"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["gtsam_CppUnitLite"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch b/recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch new file mode 100644 index 0000000000000..d19f34cd53327 --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch @@ -0,0 +1,61 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -163,13 +163,13 @@ + set(BOOST_FIND_MINIMUM_VERSION 1.43) + set(BOOST_FIND_MINIMUM_COMPONENTS serialization system filesystem thread program_options date_time timer chrono regex) + +-find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS}) ++find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS} REQUIRED) + + # Required components +-if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR +- NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) +- message(FATAL_ERROR "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.") +-endif() ++#if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR ++# NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) ++# message(FATAL_ERROR "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.") ++#endif() + + # Allow for not using the timer libraries on boost < 1.48 (GTSAM timing code falls back to old timer library) + option(GTSAM_DISABLE_NEW_TIMERS "Disables using Boost.chrono for timing" OFF) +@@ -179,30 +179,22 @@ + # so we downgraded this to classic filenames-based variables, and manually adding + # the target_include_directories(xxx ${Boost_INCLUDE_DIR}) + set(GTSAM_BOOST_LIBRARIES +- optimized ${Boost_SERIALIZATION_LIBRARY_RELEASE} +- optimized ${Boost_SYSTEM_LIBRARY_RELEASE} +- optimized ${Boost_FILESYSTEM_LIBRARY_RELEASE} +- optimized ${Boost_THREAD_LIBRARY_RELEASE} +- optimized ${Boost_DATE_TIME_LIBRARY_RELEASE} +- optimized ${Boost_REGEX_LIBRARY_RELEASE} +- debug ${Boost_SERIALIZATION_LIBRARY_DEBUG} +- debug ${Boost_SYSTEM_LIBRARY_DEBUG} +- debug ${Boost_FILESYSTEM_LIBRARY_DEBUG} +- debug ${Boost_THREAD_LIBRARY_DEBUG} +- debug ${Boost_DATE_TIME_LIBRARY_DEBUG} +- debug ${Boost_REGEX_LIBRARY_DEBUG} ++ Boost::serialization ++ Boost::system ++ Boost::filesystem ++ Boost::thread ++ Boost::date_time ++ Boost::regex + ) + message(STATUS "GTSAM_BOOST_LIBRARIES: ${GTSAM_BOOST_LIBRARIES}") + if (GTSAM_DISABLE_NEW_TIMERS) + message("WARNING: GTSAM timing instrumentation manually disabled") + list_append_cache(GTSAM_COMPILE_DEFINITIONS_PUBLIC DGTSAM_DISABLE_NEW_TIMERS) + else() +- if(Boost_TIMER_LIBRARY) ++ if(TARGET Boost::timer) + list(APPEND GTSAM_BOOST_LIBRARIES +- optimized ${Boost_TIMER_LIBRARY_RELEASE} +- optimized ${Boost_CHRONO_LIBRARY_RELEASE} +- debug ${Boost_TIMER_LIBRARY_DEBUG} +- debug ${Boost_CHRONO_LIBRARY_DEBUG} ++ Boost::timer ++ Boost::chrono + ) + else() + list(APPEND GTSAM_BOOST_LIBRARIES rt) # When using the header-only boost timer library, need -lrt diff --git a/recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch b/recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch new file mode 100644 index 0000000000000..21c808ace60fd --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -292,7 +292,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) + find_package(Eigen3 REQUIRED) + + # Use generic Eigen include paths e.g. +- set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${EIGEN3_INCLUDE_DIR}") ++ set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${Eigen3_INCLUDE_DIRS}") + + # check if MKL is also enabled - can have one or the other, but not both! + # Note: Eigen >= v3.2.5 includes our patches +@@ -307,7 +307,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) + endif() + + # The actual include directory (for BUILD cmake target interface): +- set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${EIGEN3_INCLUDE_DIR}") ++ set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${Eigen3_INCLUDE_DIRS}") + else() + # Use bundled Eigen include path. + # Clear any variables set by FindEigen3 diff --git a/recipes/gtsam/all/patches/4.0.2-0003-cmake-project.patch b/recipes/gtsam/all/patches/4.0.2-0003-cmake-project.patch new file mode 100644 index 0000000000000..e6d665e0c60aa --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.2-0003-cmake-project.patch @@ -0,0 +1,9 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-project(GTSAM CXX C) + cmake_minimum_required(VERSION 3.0) ++project(GTSAM CXX C) + + # new feature to Cmake Version > 2.8.12 + # Mac ONLY. Define Relative Path on Mac OS diff --git a/recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch b/recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch new file mode 100644 index 0000000000000..6bc74d30d7ff1 --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch @@ -0,0 +1,34 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) + # new feature to Cmake Version > 2.8.12 + # Mac ONLY. Define Relative Path on Mac OS + if(NOT DEFINED CMAKE_MACOSX_RPATH) +- set(CMAKE_MACOSX_RPATH 0) + endif() + + # Set the version number for the library +--- a/gtsam/CMakeLists.txt ++++ b/gtsam/CMakeLists.txt +@@ -177,9 +177,6 @@ if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with + endif() + + if (APPLE AND BUILD_SHARED_LIBS) +- set_target_properties(gtsam PROPERTIES +- INSTALL_NAME_DIR +- "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + install( +--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt ++++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt +@@ -16,9 +16,6 @@ if(WIN32) + endif() + + if (APPLE) +- set_target_properties(metis PROPERTIES +- INSTALL_NAME_DIR +- "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + install(TARGETS metis EXPORT GTSAM-exports LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) diff --git a/recipes/gtsam/all/patches/4.0.3-0001-cmake-boost.patch b/recipes/gtsam/all/patches/4.0.3-0001-cmake-boost.patch new file mode 100644 index 0000000000000..ca7acfebb3fa2 --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.3-0001-cmake-boost.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -164,13 +164,13 @@ + set(BOOST_FIND_MINIMUM_VERSION 1.43) + set(BOOST_FIND_MINIMUM_COMPONENTS serialization system filesystem thread program_options date_time timer chrono regex) + +-find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS}) ++find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS} REQUIRED) + + # Required components +-if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR +- NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) +- message(FATAL_ERROR "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.") +-endif() ++#if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR ++# NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) ++# message(FATAL_ERROR "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.") ++#endif() + + option(GTSAM_DISABLE_NEW_TIMERS "Disables using Boost.chrono for timing" OFF) + # Allow for not using the timer libraries on boost < 1.48 (GTSAM timing code falls back to old timer library) +@@ -186,7 +186,7 @@ + message("WARNING: GTSAM timing instrumentation manually disabled") + list_append_cache(GTSAM_COMPILE_DEFINITIONS_PUBLIC DGTSAM_DISABLE_NEW_TIMERS) + else() +- if(Boost_TIMER_LIBRARY) ++ if(TARGET Boost::timer) + list(APPEND GTSAM_BOOST_LIBRARIES Boost::timer Boost::chrono) + else() + list(APPEND GTSAM_BOOST_LIBRARIES rt) # When using the header-only boost timer library, need -lrt diff --git a/recipes/gtsam/all/patches/4.0.3-0002-cmake-eigen.patch b/recipes/gtsam/all/patches/4.0.3-0002-cmake-eigen.patch new file mode 100644 index 0000000000000..13c0702834d4b --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.3-0002-cmake-eigen.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -283,7 +283,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) + find_package(Eigen3 REQUIRED) + + # Use generic Eigen include paths e.g. +- set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${EIGEN3_INCLUDE_DIR}") ++ set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${Eigen3_INCLUDE_DIRS}") + + # check if MKL is also enabled - can have one or the other, but not both! + # Note: Eigen >= v3.2.5 includes our patches +@@ -298,7 +298,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) + endif() + + # The actual include directory (for BUILD cmake target interface): +- set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${EIGEN3_INCLUDE_DIR}") ++ set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${Eigen3_INCLUDE_DIRS}") + else() + # Use bundled Eigen include path. + # Clear any variables set by FindEigen3 diff --git a/recipes/gtsam/all/patches/4.0.3-0003-macos-rpath.patch b/recipes/gtsam/all/patches/4.0.3-0003-macos-rpath.patch new file mode 100644 index 0000000000000..c172edcd2dcc4 --- /dev/null +++ b/recipes/gtsam/all/patches/4.0.3-0003-macos-rpath.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) + # new feature to Cmake Version > 2.8.12 + # Mac ONLY. Define Relative Path on Mac OS + if(NOT DEFINED CMAKE_MACOSX_RPATH) +- set(CMAKE_MACOSX_RPATH 0) + endif() + + # Set the version number for the library +@@ -347,7 +346,6 @@ endif() + + if (APPLE AND BUILD_SHARED_LIBS) + # Set the default install directory on macOS +- set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + ############################################################################### +--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt ++++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt +@@ -16,9 +16,6 @@ if(WIN32) + endif() + + if (APPLE) +- set_target_properties(metis-gtsam PROPERTIES +- INSTALL_NAME_DIR +- "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + install(TARGETS metis-gtsam EXPORT GTSAM-exports diff --git a/recipes/gtsam/all/patches/4.1.1-0001-cmake-boost.patch b/recipes/gtsam/all/patches/4.1.1-0001-cmake-boost.patch new file mode 100644 index 0000000000000..ccc216be860c8 --- /dev/null +++ b/recipes/gtsam/all/patches/4.1.1-0001-cmake-boost.patch @@ -0,0 +1,27 @@ +diff --git a/cmake/HandleBoost.cmake b/cmake/HandleBoost.cmake +--- a/cmake/HandleBoost.cmake ++++ b/cmake/HandleBoost.cmake +@@ -25,13 +25,7 @@ endif() + set(BOOST_FIND_MINIMUM_VERSION 1.65) + set(BOOST_FIND_MINIMUM_COMPONENTS serialization system filesystem thread program_options date_time timer chrono regex) + +-find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS}) +- +-# Required components +-if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR +- NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) +- message(FATAL_ERROR "Missing required Boost components >= v1.65, please install/upgrade Boost or configure your search paths.") +-endif() ++find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS} REQUIRED) + + option(GTSAM_DISABLE_NEW_TIMERS "Disables using Boost.chrono for timing" OFF) + # Allow for not using the timer libraries on boost < 1.48 (GTSAM timing code falls back to old timer library) +@@ -47,7 +41,7 @@ if (GTSAM_DISABLE_NEW_TIMERS) + message("WARNING: GTSAM timing instrumentation manually disabled") + list_append_cache(GTSAM_COMPILE_DEFINITIONS_PUBLIC DGTSAM_DISABLE_NEW_TIMERS) + else() +- if(Boost_TIMER_LIBRARY) ++ if(TARGET Boost::timer) + list(APPEND GTSAM_BOOST_LIBRARIES Boost::timer Boost::chrono) + else() + list(APPEND GTSAM_BOOST_LIBRARIES rt) # When using the header-only boost timer library, need -lrt diff --git a/recipes/gtsam/all/patches/4.1.1-0002-cmake-eigen.patch b/recipes/gtsam/all/patches/4.1.1-0002-cmake-eigen.patch new file mode 100644 index 0000000000000..61e8f3ee3656f --- /dev/null +++ b/recipes/gtsam/all/patches/4.1.1-0002-cmake-eigen.patch @@ -0,0 +1,20 @@ +--- a/cmake/HandleEigen.cmake ++++ b/cmake/HandleEigen.cmake +@@ -14,7 +14,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) + find_package(Eigen3 REQUIRED) + + # Use generic Eigen include paths e.g. +- set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${EIGEN3_INCLUDE_DIR}") ++ set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${Eigen3_INCLUDE_DIRS}") + + # check if MKL is also enabled - can have one or the other, but not both! + # Note: Eigen >= v3.2.5 includes our patches +@@ -29,7 +29,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) + endif() + + # The actual include directory (for BUILD cmake target interface): +- set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${EIGEN3_INCLUDE_DIR}") ++ set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${Eigen3_INCLUDE_DIRS}") + else() + # Use bundled Eigen include path. + # Clear any variables set by FindEigen3 diff --git a/recipes/gtsam/all/patches/4.1.1-0003-macos-rpath.patch b/recipes/gtsam/all/patches/4.1.1-0003-macos-rpath.patch new file mode 100644 index 0000000000000..1a596c6b0883a --- /dev/null +++ b/recipes/gtsam/all/patches/4.1.1-0003-macos-rpath.patch @@ -0,0 +1,32 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) + # new feature to Cmake Version > 2.8.12 + # Mac ONLY. Define Relative Path on Mac OS + if(NOT DEFINED CMAKE_MACOSX_RPATH) +- set(CMAKE_MACOSX_RPATH 0) + endif() + + # Set the version number for the library +--- a/cmake/HandleGlobalBuildFlags.cmake ++++ b/cmake/HandleGlobalBuildFlags.cmake +@@ -20,7 +20,6 @@ endif() + + if (APPLE AND BUILD_SHARED_LIBS) + # Set the default install directory on macOS +- set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + ############################################################################### +--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt ++++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt +@@ -17,9 +17,6 @@ if(WIN32) + endif() + + if (APPLE) +- set_target_properties(metis-gtsam PROPERTIES +- INSTALL_NAME_DIR +- "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + install(TARGETS metis-gtsam EXPORT GTSAM-exports diff --git a/recipes/gtsam/all/test_package/CMakeLists.txt b/recipes/gtsam/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3f46187fc1f60 --- /dev/null +++ b/recipes/gtsam/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(GTSAM REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gtsam) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gtsam/all/test_package/conanfile.py b/recipes/gtsam/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gtsam/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/gtsam/all/test_package/test_package.cpp b/recipes/gtsam/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8219b594d982c --- /dev/null +++ b/recipes/gtsam/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +using namespace gtsam; + +const double degree = M_PI / 180; + +int main() { + + Rot2 prior = Rot2::fromAngle(30 * degree); + prior.print("30 degrees in radians is"); + noiseModel::Isotropic::shared_ptr model = noiseModel::Isotropic::Sigma(1, 1 * degree); + Symbol key('x',1); + PriorFactor factor(key, prior, model); + + return 0; +} diff --git a/recipes/gtsam/all/test_v1_package/CMakeLists.txt b/recipes/gtsam/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/gtsam/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gtsam/all/test_v1_package/conanfile.py b/recipes/gtsam/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gtsam/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/gtsam/config.yml b/recipes/gtsam/config.yml new file mode 100644 index 0000000000000..6f380a83ebb14 --- /dev/null +++ b/recipes/gtsam/config.yml @@ -0,0 +1,7 @@ +versions: + "4.1.1": + folder: all + "4.0.3": + folder: all + "4.0.2": + folder: all diff --git a/recipes/guetzli/all/conandata.yml b/recipes/guetzli/all/conandata.yml new file mode 100644 index 0000000000000..d051b6e10260b --- /dev/null +++ b/recipes/guetzli/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.0.1": + url: "https://github.com/google/guetzli/archive/v1.0.1.tar.gz" + sha256: "e52eb417a5c0fb5a3b08a858c8d10fa797627ada5373e203c196162d6a313697" +patches: + "1.0.1": + - base_path: "source_subfolder" + patch_file: "patches/0001-no-debug.patch" diff --git a/recipes/guetzli/all/conanfile.py b/recipes/guetzli/all/conanfile.py new file mode 100644 index 0000000000000..acf147558e0f4 --- /dev/null +++ b/recipes/guetzli/all/conanfile.py @@ -0,0 +1,76 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class GoogleGuetzliConan(ConanFile): + name = "guetzli" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://opensource.google/projects/guetzli" + description = "Perceptual JPEG encoder" + topics = "jpeg", "compression" + exports_sources = "patches/**" + settings = "os", "compiler", "arch" + generators = "pkg_config" + requires = ["libpng/1.6.37"] + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def configure(self): + if self.settings.os not in ["Linux", "Windows"]: + raise ConanInvalidConfiguration("conan recipe for guetzli v{0} is not \ + available in {1}.".format(self.version, self.settings.os)) + + if self.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration("conan recipe for guetzli v{0} cannot be\ + built with libc++".format(self.version)) + + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "guetzli-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + if self._is_msvc: + msbuild = MSBuild(self) + with tools.chdir(self._source_subfolder): + msbuild.build("guetzli.sln", build_type="Release") + else: + autotools = AutoToolsBuildEnvironment(self) + with tools.chdir(self._source_subfolder): + env_vars = {"PKG_CONFIG_PATH": self.build_folder} + env_vars.update(autotools.vars) + with tools.environment_append(env_vars): + make_args = [ + "config=release", + "verbose=1'," + ] + autotools.make(args=make_args) + + def package(self): + if self._is_msvc: + self.copy(os.path.join(self._source_subfolder, "bin", str(self.settings.arch), "Release", "guetzli.exe"), dst="bin", keep_path=False) + else: + self.copy(os.path.join(self._source_subfolder, "bin", "Release", "guetzli"), dst="bin", keep_path=False) + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + + def package_id(self): + del self.info.settings.compiler + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/guetzli/all/patches/0001-no-debug.patch b/recipes/guetzli/all/patches/0001-no-debug.patch new file mode 100644 index 0000000000000..e3d119caf2292 --- /dev/null +++ b/recipes/guetzli/all/patches/0001-no-debug.patch @@ -0,0 +1,24 @@ +--- guetzli.make ++++ guetzli.make +@@ -19,8 +19,8 @@ + INCLUDES += -I. -Ithird_party/butteraugli + FORCE_INCLUDE += + ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) +- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -g `pkg-config --cflags libpng` +- ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -g -std=c++11 `pkg-config --cflags libpng` ++ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 `pkg-config --cflags libpng` ++ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -std=c++11 `pkg-config --cflags libpng` + ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) + LIBS += + LDDEPS += +@@ -46,8 +46,8 @@ + INCLUDES += -I. -Ithird_party/butteraugli + FORCE_INCLUDE += + ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) +- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g `pkg-config --cflags libpng` +- ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++11 `pkg-config --cflags libpng` ++ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) `pkg-config --cflags libpng` ++ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++11 `pkg-config --cflags libpng` + ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) + LIBS += + LDDEPS += diff --git a/recipes/guetzli/all/test_package/bees.png b/recipes/guetzli/all/test_package/bees.png new file mode 100644 index 0000000000000000000000000000000000000000..11640c7488fb114127f869572d7ffec132e77746 GIT binary patch literal 177424 zcmV)7K*zs{P)b{WyyIZw$}P$?~|Ez>27vYyoe$-l%W|7Y|jApvke&j<$g8%GPZ2YcqB?9 zMT(d1s;;ie%yV{pYxyB|w%|gex-N-Rxi9g>x(2^~_n&}`9Ptr6i*JDhAG`k!3H23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y)#XV()); +}; + +TEST(ParserTest, shouldParseOneScenario) +{ + auto scenariosMock = std::make_shared(); + Parser parser(IParserStateFactoryPtr(new ParserStateFactory(scenariosMock))); + + EXPECT_CALL(*scenariosMock, appendScenario(_)); + parser.parseLine("Scenario: Add two numbers."); + parser.parseLine("Given I have entered 1 into the calculator"); + parser.finish(); +} + diff --git a/recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt b/recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/gurkenlaeufer/all/test_v1_package/conanfile.py b/recipes/gurkenlaeufer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7d408490e37b7 --- /dev/null +++ b/recipes/gurkenlaeufer/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestGurkenlaeuferV1Conan(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/gurkenlaeufer/config.yml b/recipes/gurkenlaeufer/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/gurkenlaeufer/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/gzip-hpp/all/conandata.yml b/recipes/gzip-hpp/all/conandata.yml new file mode 100644 index 0000000000000..dc56977498952 --- /dev/null +++ b/recipes/gzip-hpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/mapbox/gzip-hpp/archive/refs/tags/v0.1.0.tar.gz" + sha256: "7ce3908cd13f186987820be97083fc5e62a7c6df0877af44b334a92e868eff06" diff --git a/recipes/gzip-hpp/all/conanfile.py b/recipes/gzip-hpp/all/conanfile.py new file mode 100644 index 0000000000000..9401872c82770 --- /dev/null +++ b/recipes/gzip-hpp/all/conanfile.py @@ -0,0 +1,56 @@ +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 GzipHppConan(ConanFile): + name = "gzip-hpp" + description = "Gzip header-only C++ library " + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mapbox/gzip-hpp" + topics = ("gzip", "zlib", "compression", "decompression", "header-only") + 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("zlib/1.2.13", transitive_headers=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) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/gzip-hpp/all/test_package/CMakeLists.txt b/recipes/gzip-hpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..84ca7198a323c --- /dev/null +++ b/recipes/gzip-hpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(gzip-hpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gzip-hpp::gzip-hpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gzip-hpp/all/test_package/conanfile.py b/recipes/gzip-hpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/gzip-hpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gzip-hpp/all/test_package/test_package.cpp b/recipes/gzip-hpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..72042fe701b60 --- /dev/null +++ b/recipes/gzip-hpp/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +// Include the specific gzip headers your code needs, for example... +#include +#include +#include +#include +#include + +#include + +int main() { + // All function calls must pass in a pointer of an + // immutable character sequence (aka a string in C) and its size + std::string data = "hello"; + const char* pointer = data.data(); + std::size_t size = data.size(); + + // Check if compressed. Can check both gzip and zlib. + bool c = gzip::is_compressed(pointer, size); // false + + // Compress returns a std::string + std::string compressed_data = gzip::compress(pointer, size); + + // Decompress returns a std::string and decodes both zlib and gzip + const char* compressed_pointer = compressed_data.data(); + std::string decompressed_data = gzip::decompress(compressed_pointer, compressed_data.size()); + + return 0; +} diff --git a/recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt b/recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/gzip-hpp/all/test_v1_package/conanfile.py b/recipes/gzip-hpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/gzip-hpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gzip-hpp/config.yml b/recipes/gzip-hpp/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/gzip-hpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/h3/all/conandata.yml b/recipes/h3/all/conandata.yml new file mode 100644 index 0000000000000..39601951d8c9a --- /dev/null +++ b/recipes/h3/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "4.1.0": + url: "https://github.com/uber/h3/archive/refs/tags/v4.1.0.tar.gz" + sha256: "ec99f1f5974846bde64f4513cf8d2ea1b8d172d2218ab41803bf6a63532272bc" + "3.7.2": + url: "https://github.com/uber/h3/archive/refs/tags/v3.7.2.tar.gz" + sha256: "803a7fbbeb01f1f65cae9398bda9579a0529e7bafffc6e0e0a6d81a71b305629" + "3.7.1": + url: "https://github.com/uber/h3/archive/v3.7.1.tar.gz" + sha256: "cfa3b4e1d46251929bd30575f09c89edb2c209be7ad8b0af15ff3f9a04132688" + "3.7.0": + url: "https://github.com/uber/h3/archive/v3.7.0.tar.gz" + sha256: "7b59780781750d2ccc64c50b6364d706947a684b0cb996c1b104f448562d2d7c" + "3.6.4": + url: "https://github.com/uber/h3/archive/v3.6.4.tar.gz" + sha256: "b80c2eee2b3e645de77893e27ca149e63d3bb6bf95d33e3a384e3f390e2681bb" + "3.6.3": + url: "https://github.com/uber/h3/archive/v3.6.3.tar.gz" + sha256: "3ba219959ecb0ef6956f05113aa659d7b605e4eebbdca561b8243ce309e4684e" +patches: + "3.7.2": + - patch_file: "patches/fix-cmake-3.7.x.patch" + patch_description: "move project definition to head, set c99 flag" + patch_type: "portability" + "3.7.1": + - patch_file: "patches/fix-cmake-3.7.x.patch" + patch_description: "move project definition to head, set c99 flag" + patch_type: "portability" + "3.7.0": + - patch_file: "patches/fix-cmake-3.7.x.patch" + patch_description: "move project definition to head, set c99 flag" + patch_type: "portability" + "3.6.4": + - patch_file: "patches/fix-cmake-3.6.4.patch" + patch_description: "move project definition to head, set c99 flag" + patch_type: "portability" + "3.6.3": + - patch_file: "patches/fix-cmake-3.6.3.patch" + patch_description: "move project definition to head, set c99 flag" + patch_type: "portability" diff --git a/recipes/h3/all/conanfile.py b/recipes/h3/all/conanfile.py new file mode 100644 index 0000000000000..1976ac70237aa --- /dev/null +++ b/recipes/h3/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class H3Conan(ConanFile): + name = "h3" + description = "Hexagonal hierarchical geospatial indexing system." + license = "Apache-2.0" + topics = ("hierarchical", "geospatial", "indexing") + homepage = "https://github.com/uber/h3" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_filters": [True, False], + "h3_prefix": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "build_filters": True, + "h3_prefix": "", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + if Version(self.version) >= "4.1.0": + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["H3_PREFIX"] = self.options.h3_prefix + tc.variables["ENABLE_COVERAGE"] = False + tc.variables["BUILD_BENCHMARKS"] = False + tc.variables["BUILD_FILTERS"] = self.options.build_filters + tc.variables["BUILD_GENERATORS"] = False + tc.variables["WARNINGS_AS_ERRORS"] = False + tc.variables["ENABLE_FORMAT"] = False + tc.variables["ENABLE_LINTING"] = False + tc.variables["ENABLE_DOCS"] = False + 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, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "h3") + self.cpp_info.set_property("cmake_target_name", "h3::h3") + self.cpp_info.libs = ["h3"] + self.cpp_info.defines.append(f"H3_PREFIX={self.options.h3_prefix}") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if self.options.build_filters: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/h3/all/patches/fix-cmake-3.6.3.patch b/recipes/h3/all/patches/fix-cmake-3.6.3.patch new file mode 100644 index 0000000000000..9e69a89b18b77 --- /dev/null +++ b/recipes/h3/all/patches/fix-cmake-3.6.3.patch @@ -0,0 +1,56 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,6 +13,10 @@ + # limitations under the License. + + cmake_minimum_required(VERSION 3.1) ++file(READ VERSION H3_VERSION LIMIT_COUNT 1) ++# Clean any newlines ++string(REPLACE "\n" "" H3_VERSION "${H3_VERSION}") ++project(h3 LANGUAGES C VERSION ${H3_VERSION}) + + set(H3_PREFIX "" CACHE STRING "Prefix for exported symbols") + +@@ -24,9 +28,6 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +-set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake" +- CACHE FILEPATH +- "Toolchain to use for building this project") + + option(ENABLE_COVERAGE "Enable compiling tests with coverage." ON) + option(BUILD_BENCHMARKS "Build benchmarking applications." ON) +@@ -45,16 +46,12 @@ else() + set(LIBRARY_OUTPUT_PATH lib) + endif() + +-file(READ VERSION H3_VERSION LIMIT_COUNT 1) +-# Clean any newlines +-string(REPLACE "\n" "" H3_VERSION "${H3_VERSION}") + string(REPLACE "." ";" H3_VERSION_LIST "${H3_VERSION}") + list(GET H3_VERSION_LIST 0 H3_VERSION_MAJOR) + list(GET H3_VERSION_LIST 1 H3_VERSION_MINOR) + list(GET H3_VERSION_LIST 2 H3_VERSION_PATCH) + set(H3_SOVERSION 1) + +-project(h3 LANGUAGES C VERSION ${H3_VERSION}) + + set(H3_COMPILE_FLAGS "") + set(H3_LINK_FLAGS "") +@@ -203,6 +200,7 @@ set(INSTALL_TARGETS h3) + # Build the H3 library + add_library(h3 ${LIB_SOURCE_FILES} ${CONFIGURED_API_HEADER}) + ++target_compile_features(h3 PUBLIC c_std_99) + target_compile_options(h3 PRIVATE ${H3_COMPILE_FLAGS}) + target_link_libraries(h3 PRIVATE ${H3_LINK_FLAGS}) + +@@ -602,6 +600,7 @@ install( + LIBRARY DESTINATION "lib" + ARCHIVE DESTINATION "lib" + RUNTIME DESTINATION "bin" ++ BUNDLE DESTINATION "bin" + INCLUDES DESTINATION "${include_install_dir}" + ) + diff --git a/recipes/h3/all/patches/fix-cmake-3.6.4.patch b/recipes/h3/all/patches/fix-cmake-3.6.4.patch new file mode 100644 index 0000000000000..e98b3fe8f56fc --- /dev/null +++ b/recipes/h3/all/patches/fix-cmake-3.6.4.patch @@ -0,0 +1,65 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,6 +13,10 @@ + # limitations under the License. + + cmake_minimum_required(VERSION 3.1) ++file(READ VERSION H3_VERSION LIMIT_COUNT 1) ++# Clean any newlines ++string(REPLACE "\n" "" H3_VERSION "${H3_VERSION}") ++project(h3 LANGUAGES C VERSION ${H3_VERSION}) + + set(H3_PREFIX "" CACHE STRING "Prefix for exported symbols") + set(H3_ALLOC_PREFIX "" CACHE STRING "Prefix for allocation functions") +@@ -25,9 +29,6 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +-set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake" +- CACHE FILEPATH +- "Toolchain to use for building this project") + + option(ENABLE_COVERAGE "Enable compiling tests with coverage." ON) + option(BUILD_BENCHMARKS "Build benchmarking applications." ON) +@@ -46,16 +47,12 @@ else() + set(LIBRARY_OUTPUT_PATH lib) + endif() + +-file(READ VERSION H3_VERSION LIMIT_COUNT 1) +-# Clean any newlines +-string(REPLACE "\n" "" H3_VERSION "${H3_VERSION}") + string(REPLACE "." ";" H3_VERSION_LIST "${H3_VERSION}") + list(GET H3_VERSION_LIST 0 H3_VERSION_MAJOR) + list(GET H3_VERSION_LIST 1 H3_VERSION_MINOR) + list(GET H3_VERSION_LIST 2 H3_VERSION_PATCH) + set(H3_SOVERSION 1) + +-project(h3 LANGUAGES C VERSION ${H3_VERSION}) + + set(H3_COMPILE_FLAGS "") + set(H3_LINK_FLAGS "") +@@ -205,6 +202,7 @@ set(INSTALL_TARGETS) + function(add_h3_library name h3_alloc_prefix_override) + add_library(${name} ${LIB_SOURCE_FILES} ${CONFIGURED_API_HEADER}) + ++ target_compile_features(${name} PUBLIC c_std_99) + target_compile_options(${name} PRIVATE ${H3_COMPILE_FLAGS}) + target_link_libraries(${name} PRIVATE ${H3_LINK_FLAGS}) + +@@ -647,7 +645,7 @@ configure_package_config_file( + install( + TARGETS ${INSTALL_TARGETS} + EXPORT "${TARGETS_EXPORT_NAME}" +- RUNTIME DESTINATION "bin" ++ DESTINATION "bin" + COMPONENT h3 + ) + +@@ -656,6 +654,7 @@ install( + EXPORT "${TARGETS_EXPORT_NAME}" + LIBRARY DESTINATION "lib" + ARCHIVE DESTINATION "lib" ++ RUNTIME DESTINATION "bin" + COMPONENT libh3 + ) + diff --git a/recipes/h3/all/patches/fix-cmake-3.7.x.patch b/recipes/h3/all/patches/fix-cmake-3.7.x.patch new file mode 100644 index 0000000000000..b8139d810b08e --- /dev/null +++ b/recipes/h3/all/patches/fix-cmake-3.7.x.patch @@ -0,0 +1,57 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,6 +13,10 @@ + # limitations under the License. + + cmake_minimum_required(VERSION 3.1) ++file(READ VERSION H3_VERSION LIMIT_COUNT 1) ++# Clean any newlines ++string(REPLACE "\n" "" H3_VERSION "${H3_VERSION}") ++project(h3 LANGUAGES C VERSION ${H3_VERSION}) + + set(H3_PREFIX "" CACHE STRING "Prefix for exported symbols") + set(H3_ALLOC_PREFIX "" CACHE STRING "Prefix for allocation functions") +@@ -25,9 +29,6 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +-set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake" +- CACHE FILEPATH +- "Toolchain to use for building this project") + + option(ENABLE_COVERAGE "Enable compiling tests with coverage." ON) + option(BUILD_BENCHMARKS "Build benchmarking applications." ON) +@@ -47,16 +48,12 @@ else() + set(LIBRARY_OUTPUT_PATH lib) + endif() + +-file(READ VERSION H3_VERSION LIMIT_COUNT 1) +-# Clean any newlines +-string(REPLACE "\n" "" H3_VERSION "${H3_VERSION}") + string(REPLACE "." ";" H3_VERSION_LIST "${H3_VERSION}") + list(GET H3_VERSION_LIST 0 H3_VERSION_MAJOR) + list(GET H3_VERSION_LIST 1 H3_VERSION_MINOR) + list(GET H3_VERSION_LIST 2 H3_VERSION_PATCH) + set(H3_SOVERSION 1) + +-project(h3 LANGUAGES C VERSION ${H3_VERSION}) + + set(H3_COMPILE_FLAGS "") + set(H3_LINK_FLAGS "") +@@ -213,6 +210,7 @@ set(INSTALL_TARGETS) + function(add_h3_library name h3_alloc_prefix_override) + add_library(${name} ${LIB_SOURCE_FILES} ${CONFIGURED_API_HEADER}) + ++ target_compile_features(${name} PUBLIC c_std_99) + target_compile_options(${name} PRIVATE ${H3_COMPILE_FLAGS}) + target_link_libraries(${name} PRIVATE ${H3_LINK_FLAGS}) + +@@ -666,7 +664,7 @@ configure_package_config_file( + install( + TARGETS ${INSTALL_TARGETS} + EXPORT "${TARGETS_EXPORT_NAME}" +- RUNTIME DESTINATION "bin" ++ DESTINATION "bin" + COMPONENT h3 + ) + diff --git a/recipes/h3/all/test_package/CMakeLists.txt b/recipes/h3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f0064105601c7 --- /dev/null +++ b/recipes/h3/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(h3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE h3::h3) + +if(h3_VERSION VERSION_GREATER_EQUAL "4.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE "H3_VERSION_4_LATER") +endif() diff --git a/recipes/h3/all/test_package/conanfile.py b/recipes/h3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/h3/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/h3/all/test_package/test_package.c b/recipes/h3/all/test_package/test_package.c new file mode 100644 index 0000000000000..9fd4729a81173 --- /dev/null +++ b/recipes/h3/all/test_package/test_package.c @@ -0,0 +1,89 @@ +/* + * Copyright 2017 Uber Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Example program that converts coordinates to an H3 index (hexagon), + * and then finds the vertices and center coordinates of the index. + */ + +#include

+ +#include +#include + +#ifndef H3_VERSION_4_LATER + +int main() { + // Get the H3 index of some location and print it. + GeoCoord location; + location.lat = degsToRads(40.689167); + location.lon = degsToRads(-74.044444); + int resolution = 10; + H3Index indexed = geoToH3(&location, resolution); + printf("The index is: %" PRIx64 "\n", indexed); + + // Get the vertices of the H3 index. + GeoBoundary boundary; + h3ToGeoBoundary(indexed, &boundary); + // Indexes can have different number of vertices under some cases, + // which is why boundary.numVerts is needed. + int v; + for (v = 0; v < boundary.numVerts; v++) { + printf("Boundary vertex #%d: %lf, %lf\n", v, + radsToDegs(boundary.verts[v].lat), + radsToDegs(boundary.verts[v].lon)); + } + + // Get the center coordinates. + GeoCoord center; + h3ToGeo(indexed, ¢er); + printf("Center coordinates: %lf, %lf\n", radsToDegs(center.lat), radsToDegs(center.lon)); + + return 0; +} + +#else + +int main() { + // Get the H3 index of some location and print it. + LatLng location; + location.lat = degsToRads(40.689167); + location.lng = degsToRads(-74.044444); + int resolution = 10; + H3Index indexed; + latLngToCell(&location, resolution, &indexed); + printf("The index is: %" PRIx64 "\n", indexed); + + // Get the vertices of the H3 index. + CellBoundary boundary; + cellToBoundary(indexed, &boundary); + // Indexes can have different number of vertices under some cases, + // which is why boundary.numVerts is needed. + int v; + for (v = 0; v < boundary.numVerts; v++) { + printf("Boundary vertex #%d: %lf, %lf\n", v, + radsToDegs(boundary.verts[v].lat), + radsToDegs(boundary.verts[v].lng)); + } + + // Get the center coordinates. + LatLng center; + cellToLatLng(indexed, ¢er); + printf("Center coordinates: %lf, %lf\n", radsToDegs(center.lat), radsToDegs(center.lng)); + + return 0; +} + +#endif diff --git a/recipes/h3/all/test_v1_package/CMakeLists.txt b/recipes/h3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/h3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/h3/all/test_v1_package/conanfile.py b/recipes/h3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/h3/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/h3/config.yml b/recipes/h3/config.yml new file mode 100644 index 0000000000000..7a121275170d5 --- /dev/null +++ b/recipes/h3/config.yml @@ -0,0 +1,13 @@ +versions: + "4.1.0": + folder: all + "3.7.2": + folder: all + "3.7.1": + folder: all + "3.7.0": + folder: all + "3.6.4": + folder: all + "3.6.3": + folder: all diff --git a/recipes/h5pp/all/conandata.yml b/recipes/h5pp/all/conandata.yml new file mode 100644 index 0000000000000..cd78418f65010 --- /dev/null +++ b/recipes/h5pp/all/conandata.yml @@ -0,0 +1,48 @@ +sources: + "1.11.0": + url: "https://github.com/DavidAce/h5pp/archive/v1.11.0.tar.gz" + sha256: "1c4171275eb50a26ed9da8055397f03a726896c4c49ad0380b16dcb13574ecff" + "1.10.0": + url: "https://github.com/DavidAce/h5pp/archive/v1.10.0.tar.gz" + sha256: "27a3e42ed02d8d9341229d58a517134753e1ea46dab4c40d01bb309098c32f13" + "1.9.0": + url: "https://github.com/DavidAce/h5pp/archive/v1.9.0.tar.gz" + sha256: "f633b6f76ab20e1767f55068154cf8bf553e39d526ae80947388640c57ea2056" + "1.8.6": + url: "https://github.com/DavidAce/h5pp/archive/v1.8.6.tar.gz" + sha256: "39d413c9383b00a87153b9480ab6a91ba356d3f30b3598de0c0c8f7f3bd802c7" + "1.8.5": + url: "https://github.com/DavidAce/h5pp/archive/v1.8.5.tar.gz" + sha256: "1e1a42159fccd10b1022445ea0f0690c5314e94b0fc3d5c9fa0f02b165148c18" + "1.8.4": + url: "https://github.com/DavidAce/h5pp/archive/v1.8.4.tar.gz" + sha256: "401f2014d90d9ce318e518e368e7e45fc2aa95b8e30cdc91baa41212df15b831" + "1.8.3": + url: "https://github.com/DavidAce/h5pp/archive/v1.8.3.tar.gz" + sha256: "52d439a0008cb76071f0e839d15ca6a4e911a87dc779f0bbd9dc91d98ba0b52b" +patches: + "1.9.0": + - patch_file: "patches/fix-support-new-hdf5-v1.9.0.patch" + patch_type: "bugfix" + patch_source: "https://github.com/DavidAce/h5pp/commit/a8471cd2a21310bae0564eeed21dc00c457d674d" + patch_description: "Adds support for HDF5 versions later than 1.12.1 by allowing the construction of h5pp::hid types from any integral type (not just hid_t)" + "1.8.6": + - patch_file: "patches/fix-support-new-hdf5-v1.8.6.patch" + patch_type: "bugfix" + patch_source: "https://github.com/DavidAce/h5pp/commit/a8471cd2a21310bae0564eeed21dc00c457d674d" + patch_description: "Adds support for HDF5 versions later than 1.12.1 by allowing the construction of h5pp::hid types from any integral type (not just hid_t)" + "1.8.5": + - patch_file: "patches/fix-support-new-hdf5-v1.8.3-5.patch" + patch_type: "bugfix" + patch_source: "https://github.com/DavidAce/h5pp/commit/a8471cd2a21310bae0564eeed21dc00c457d674d" + patch_description: "Adds support for HDF5 versions later than 1.12.1 by allowing the construction of h5pp::hid types from any integral type (not just hid_t)" + "1.8.4": + - patch_file: "patches/fix-support-new-hdf5-v1.8.3-5.patch" + patch_type: "bugfix" + patch_source: "https://github.com/DavidAce/h5pp/commit/a8471cd2a21310bae0564eeed21dc00c457d674d" + patch_description: "Adds support for HDF5 versions later than 1.12.1 by allowing the construction of h5pp::hid types from any integral type (not just hid_t)" + "1.8.3": + - patch_file: "patches/fix-support-new-hdf5-v1.8.3-5.patch" + patch_type: "bugfix" + patch_source: "https://github.com/DavidAce/h5pp/commit/a8471cd2a21310bae0564eeed21dc00c457d674d" + patch_description: "Adds support for HDF5 versions later than 1.12.1 by allowing the construction of h5pp::hid types from any integral type (not just hid_t)" diff --git a/recipes/h5pp/all/conanfile.py b/recipes/h5pp/all/conanfile.py new file mode 100644 index 0000000000000..572f56191b252 --- /dev/null +++ b/recipes/h5pp/all/conanfile.py @@ -0,0 +1,151 @@ +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.tools.files import get +from conan.tools.files import copy +from conan.tools.files import apply_conandata_patches,export_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + +class H5ppConan(ConanFile): + name = "h5pp" + description = "A C++17 wrapper for HDF5 with focus on simplicity" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DavidAce/h5pp" + topics = ("hdf5", "binary", "storage", "header-only", "cpp17") + license = "MIT" + package_type="header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + short_paths = True + options = { + "with_eigen": [True, False], + "with_spdlog": [True, False], + "with_zlib" : [True, False], + } + default_options = { + "with_eigen": True, + "with_spdlog": True, + "with_zlib" : True, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7.4", + "Visual Studio": "15.7", + "clang": "6", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if Version(self.version) < "1.10.0": + # These dependencies are always required before h5pp 1.10.0: + # * h5pp < 1.10.0 includes any version of headers indiscriminately (e.g. system headers), + # and can't tell if the the corresponding library will be linked. This makes the, + # build and /link steps non-deterministic. + # * h5pp >= 1.10.0 fixes the issue with H5PP_USE_ preprocessor flags, to make sure + # that including the headers is intentional. + del self.options.with_eigen + del self.options.with_spdlog + del self.options.with_zlib + else: + self.options["hdf5"].with_zlib = self.options.with_zlib + + def requirements(self): + self.requires("hdf5/1.14.0", transitive_headers=True, transitive_libs=True) + if Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'): + self.requires("eigen/3.4.0", transitive_headers=True) + if Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'): + self.requires("spdlog/1.11.0", transitive_headers=True, transitive_libs=True) + if Version(self.version) >= "1.10.0" and self.options.with_zlib: + self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=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, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("h5pp requires C++17, which your compiler does not support.") + else: + self.output.warning("h5pp requires C++17. Your compiler is unknown. Assuming it supports C++17.") + + def source(self): + get(self,**self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + apply_conandata_patches(self) + + def package(self): + if Version(self.version) < "1.9.0": + includedir = os.path.join(self.source_folder, "h5pp", "include") + else: + includedir = os.path.join(self.source_folder, "include") + copy(self, pattern="*", src=includedir, dst=os.path.join(self.package_folder, "include")) + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "h5pp") + self.cpp_info.set_property("cmake_target_name", "h5pp::h5pp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.components["h5pp_headers"].set_property("cmake_target_name", "h5pp::headers") + self.cpp_info.components["h5pp_headers"].bindirs = [] + self.cpp_info.components["h5pp_headers"].libdirs = [] + self.cpp_info.components["h5pp_deps"].set_property("cmake_target_name", "h5pp::deps") + self.cpp_info.components["h5pp_deps"].bindirs = [] + self.cpp_info.components["h5pp_deps"].libdirs = [] + self.cpp_info.components["h5pp_deps"].requires = ["hdf5::hdf5"] + self.cpp_info.components["h5pp_flags"].set_property("cmake_target_name", "h5pp::flags") + self.cpp_info.components["h5pp_flags"].bindirs = [] + self.cpp_info.components["h5pp_flags"].libdirs = [] + + if Version(self.version) >= "1.10.0": + if self.options.with_eigen: + self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") + self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_EIGEN3") + if self.options.with_spdlog: + self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog") + self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_SPDLOG") + self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_FMT") + if self.options.with_zlib: + self.cpp_info.components["h5pp_deps"].requires.append("zlib::zlib") + + else: + self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") + self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog") + + if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9") or \ + (self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") in ["libstdc++", "libstdc++11"]): + self.cpp_info.components["h5pp_flags"].system_libs = ["stdc++fs"] + if is_msvc(self): + self.cpp_info.components["h5pp_flags"].defines.append("NOMINMAX") + self.cpp_info.components["h5pp_flags"].cxxflags = ["/permissive-"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "h5pp" + self.cpp_info.names["cmake_find_package_multi"] = "h5pp" + self.cpp_info.components["h5pp_headers"].names["cmake_find_package"] = "headers" + self.cpp_info.components["h5pp_headers"].names["cmake_find_package_multi"] = "headers" + self.cpp_info.components["h5pp_deps"].names["cmake_find_package"] = "deps" + self.cpp_info.components["h5pp_deps"].names["cmake_find_package_multi"] = "deps" + self.cpp_info.components["h5pp_flags"].names["cmake_find_package"] = "flags" + self.cpp_info.components["h5pp_flags"].names["cmake_find_package_multi"] = "flags" diff --git a/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.3-5.patch b/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.3-5.patch new file mode 100644 index 0000000000000..aeea88c60d8ff --- /dev/null +++ b/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.3-5.patch @@ -0,0 +1,13 @@ +diff --git a/h5pp/include/h5pp/details/h5ppHid.h b/h5pp/include/h5pp/details/h5ppHid.h +index 7bd9f12..1335dd8 100644 +--- a/h5pp/include/h5pp/details/h5ppHid.h ++++ b/h5pp/include/h5pp/details/h5ppHid.h +@@ -16,7 +16,7 @@ namespace h5pp::hid { + hid_base() = default; + hid_base(std::initializer_list) = delete; + // Use enable_if to avoid implicit conversion from hid_h5x and still have a non-explicit hid_t constructor +- template>> ++ template>> + hid_base(const T &other) { + // constructor from hid_t + if constexpr(zeroValueIsOK){ diff --git a/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.6.patch b/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.6.patch new file mode 100644 index 0000000000000..02970a76bf18c --- /dev/null +++ b/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.8.6.patch @@ -0,0 +1,22 @@ +diff --git a/h5pp/include/h5pp/details/h5ppHid.h b/h5pp/include/h5pp/details/h5ppHid.h +index cda2d6d..76ba594 100644 +--- a/h5pp/include/h5pp/details/h5ppHid.h ++++ b/h5pp/include/h5pp/details/h5ppHid.h +@@ -15,7 +15,7 @@ namespace h5pp::hid { + virtual ~hid_base() = default; + hid_base() = default; + // Use enable_if to avoid implicit conversion from hid_h5x and still have a non-explicit hid_t constructor +- template>> ++ template>> + hid_base(const T &other) { + // constructor from hid_t + if constexpr(zeroValueIsOK) { +@@ -66,7 +66,7 @@ namespace h5pp::hid { + return *this; + } + +- template>> ++ template>> + hid_base &operator=(const T &rhs) { + // Copy assignment from hid_t + if constexpr(zeroValueIsOK) { diff --git a/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.9.0.patch b/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.9.0.patch new file mode 100644 index 0000000000000..af8a034bf7dd1 --- /dev/null +++ b/recipes/h5pp/all/patches/fix-support-new-hdf5-v1.9.0.patch @@ -0,0 +1,23 @@ +diff --git a/include/h5pp/details/h5ppHid.h b/include/h5pp/details/h5ppHid.h +index b1f4989..8af0eb3 100644 +--- a/include/h5pp/details/h5ppHid.h ++++ b/include/h5pp/details/h5ppHid.h +@@ -15,7 +15,7 @@ namespace h5pp::hid { + virtual ~hid_base() = default; + hid_base() = default; + // Use enable_if to avoid implicit conversion from hid_h5x and still have a non-explicit hid_t constructor +- template>> ++ template>> + hid_base(const T &other) { + // constructor from hid_t + if constexpr(zeroValueIsOK) { +@@ -66,7 +66,7 @@ namespace h5pp::hid { + return *this; + } + +- template>> ++ template>> + hid_base &operator=(const T &rhs) { + // Copy assignment from hid_t + if constexpr(zeroValueIsOK) { + diff --git a/recipes/h5pp/all/test_package/CMakeLists.txt b/recipes/h5pp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..523f3a9d98155 --- /dev/null +++ b/recipes/h5pp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +add_executable(test_package test_package.cpp) +target_compile_features(test_package PRIVATE cxx_std_17) + +find_package(h5pp REQUIRED CONFIG) +target_link_libraries(test_package PRIVATE h5pp::h5pp) diff --git a/recipes/h5pp/all/test_package/conanfile.py b/recipes/h5pp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..57ecdac2f006b --- /dev/null +++ b/recipes/h5pp/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/h5pp/all/test_package/test_package.cpp b/recipes/h5pp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..384a3eda62383 --- /dev/null +++ b/recipes/h5pp/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include + +int main() { + using cplx = std::complex; + + static_assert(h5pp::type::sfinae::has_data>() and + "h5pp ompile time type-checker failed. Could not properly detect class member data. Check that you are using a supported compiler!"); + + std::string outputFilename = "test_package.h5"; + size_t logLevel = 1; + h5pp::File file(outputFilename, H5F_ACC_TRUNC | H5F_ACC_RDWR, logLevel); + + // Generate dummy data + std::vector vectorComplexWrite = {{-0.191154, 0.326211}, {0.964728, -0.712335}, {-0.0351791, -0.10264}, {0.177544, 0.99999}}; + + // Write dummy data to file + file.writeDataset(vectorComplexWrite, "vectorComplex"); + + + // Read dummy data from file + auto vectorComplexRead = file.readDataset>("vectorComplex"); + return 0; +} diff --git a/recipes/h5pp/all/test_v1_package/CMakeLists.txt b/recipes/h5pp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b0b3d3e25936 --- /dev/null +++ b/recipes/h5pp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17) + +find_package(h5pp REQUIRED CONFIG) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE h5pp::h5pp) diff --git a/recipes/h5pp/all/test_v1_package/conanfile.py b/recipes/h5pp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ca45a778caa64 --- /dev/null +++ b/recipes/h5pp/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/h5pp/all/test_v1_package/test_package.cpp b/recipes/h5pp/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..384a3eda62383 --- /dev/null +++ b/recipes/h5pp/all/test_v1_package/test_package.cpp @@ -0,0 +1,23 @@ +#include + +int main() { + using cplx = std::complex; + + static_assert(h5pp::type::sfinae::has_data>() and + "h5pp ompile time type-checker failed. Could not properly detect class member data. Check that you are using a supported compiler!"); + + std::string outputFilename = "test_package.h5"; + size_t logLevel = 1; + h5pp::File file(outputFilename, H5F_ACC_TRUNC | H5F_ACC_RDWR, logLevel); + + // Generate dummy data + std::vector vectorComplexWrite = {{-0.191154, 0.326211}, {0.964728, -0.712335}, {-0.0351791, -0.10264}, {0.177544, 0.99999}}; + + // Write dummy data to file + file.writeDataset(vectorComplexWrite, "vectorComplex"); + + + // Read dummy data from file + auto vectorComplexRead = file.readDataset>("vectorComplex"); + return 0; +} diff --git a/recipes/h5pp/config.yml b/recipes/h5pp/config.yml new file mode 100644 index 0000000000000..2a1bf3aae7487 --- /dev/null +++ b/recipes/h5pp/config.yml @@ -0,0 +1,15 @@ +versions: + "1.8.3": + folder: "all" + "1.8.4": + folder: "all" + "1.8.5": + folder: "all" + "1.8.6": + folder: "all" + "1.9.0": + folder: "all" + "1.10.0": + folder: "all" + "1.11.0": + folder: "all" diff --git a/recipes/half/all/conandata.yml b/recipes/half/all/conandata.yml new file mode 100644 index 0000000000000..dd92109aef829 --- /dev/null +++ b/recipes/half/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.0": + url: "https://sourceforge.net/projects/half/files/half/2.2.0/half-2.2.0.zip" + sha256: "1d1d9e482fb95fcd7cab0953a4bd35e00b86578f11cb6939a067811a055a563b" diff --git a/recipes/half/all/conanfile.py b/recipes/half/all/conanfile.py new file mode 100644 index 0000000000000..64b104957470d --- /dev/null +++ b/recipes/half/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class HalfConan(ConanFile): + name = "half" + description = ( + "C++ header-only library to provide an IEEE 754 conformant 16-bit " + "half-precision floating-point type along with corresponding " + "arithmetic operators, type conversions and common mathematical " + "functions." + ) + license = "MIT" + topics = ("half", "half-precision", "float", "arithmetic") + homepage = "https://sourceforge.net/projects/half" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "half.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/half/all/test_package/CMakeLists.txt b/recipes/half/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8909a3f1339ea --- /dev/null +++ b/recipes/half/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(half REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE half::half) diff --git a/recipes/half/all/test_package/conanfile.py b/recipes/half/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/half/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/half/all/test_package/test_package.cpp b/recipes/half/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..020dd06e55072 --- /dev/null +++ b/recipes/half/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include + +int main() { + half_float::half a(3.4), b(5); + half_float::half c = a * b; + c += 3; + std::cout << c << std::endl; + return 0; +} diff --git a/recipes/half/all/test_v1_package/CMakeLists.txt b/recipes/half/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c8aa9412f7287 --- /dev/null +++ b/recipes/half/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(half REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE half::half) diff --git a/recipes/half/all/test_v1_package/conanfile.py b/recipes/half/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/half/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/half/config.yml b/recipes/half/config.yml new file mode 100644 index 0000000000000..1979b3114ab95 --- /dev/null +++ b/recipes/half/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.0": + folder: all diff --git a/recipes/hana/all/conandata.yml b/recipes/hana/all/conandata.yml new file mode 100644 index 0000000000000..5300848922c23 --- /dev/null +++ b/recipes/hana/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.79.0": + url: "https://github.com/boostorg/hana/archive/boost-1.79.0.tar.gz" + sha256: "dcaaa99a2c09394c366347b40b001a0a762da59e6136485a4157a820759a9a58" + "boost-1.78.0": + url: "https://github.com/boostorg/hana/archive/boost-1.78.0.tar.gz" + sha256: "f713c2888e849f66b90c01fecb69924538a2d1440bfa432d92c8f600bc98ad49" + "boost-1.74.0": + url: "https://github.com/boostorg/hana/archive/boost-1.74.0.tar.gz" + sha256: "d50b366aca035b7fbeaf1cadc3bad0edd9d68d98b297dcf9473bbfb0f52408b8" + "1.6.0": + url: "https://github.com/boostorg/hana/archive/v1.6.0.tar.gz" + sha256: "4238f1a132c783b0013f2f6757370ff0ac2b28fc0c8b862de9d5fb296de5b1cb" + "1.7.0": + url: "https://github.com/boostorg/hana/archive/v1.7.0.tar.gz" + sha256: "f228013dc32acf69e30c2200964c96b119a6e779817b24457c76096bb57e1280" diff --git a/recipes/hana/all/conanfile.py b/recipes/hana/all/conanfile.py new file mode 100644 index 0000000000000..9aa79d1435368 --- /dev/null +++ b/recipes/hana/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +from conan.tools.files import get, save +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.33.0" + + +class HanaConan(ConanFile): + name = "hana" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://boostorg.github.io/hana/" + description = "Hana is a header-only library for C++ metaprogramming suited for computations on both types and values." + license = "BSL-1.0" + topics = ("hana", "metaprogramming", "boost") + settings = "compiler" + no_copy_source = True + deprecated = "boost" + + @property + def _source_subfolder(self): + return "_source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "14", + "clang": "3.4", + "apple-clang": "3.4", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "14") + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("{} {} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name, self.version)) + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration("{} {} requires C++14, which your compiler does not support.".format(self.name, self.version)) + + raise ConanInvalidConfiguration(f"{self.ref} is deprecated of Boost. Please, use boost package.") + + def package_id(self): + self.info.clear() + + def source(self): + get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + self._create_cmake_module_alias_targets( + self, + os.path.join(self.package_folder, self._module_file_rel_path), + {"hana": "hana::hana"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(conanfile, 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(conanfile, 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, + "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "Hana" + self.cpp_info.filenames["cmake_find_package_multi"] = "Hana" + self.cpp_info.names["cmake_find_package"] = "hana" + self.cpp_info.names["cmake_find_package_multi"] = "hana" + self.cpp_info.builddirs.append(self._module_subfolder) + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "hana" diff --git a/recipes/hana/all/test_package/CMakeLists.txt b/recipes/hana/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..35d91de00798e --- /dev/null +++ b/recipes/hana/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Hana REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} hana) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/hana/all/test_package/conanfile.py b/recipes/hana/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c9d5dba712c7 --- /dev/null +++ b/recipes/hana/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/hana/all/test_package/test_package.cpp b/recipes/hana/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9cfbdefa34e70 --- /dev/null +++ b/recipes/hana/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include + +int main(void) +{ + using namespace boost; + auto map = hana::make_map( + hana::make_pair(hana::type_c, "char"), + hana::make_pair(hana::type_c, "int"), + hana::make_pair(hana::type_c, "long"), + hana::make_pair(hana::type_c, "float"), + hana::make_pair(hana::type_c, "double") + ); +} diff --git a/recipes/hana/config.yml b/recipes/hana/config.yml new file mode 100644 index 0000000000000..034bff6f60fd2 --- /dev/null +++ b/recipes/hana/config.yml @@ -0,0 +1,11 @@ +versions: + "1.79.0": + folder: all + "boost-1.78.0": + folder: all + "boost-1.74.0": + folder: all + "1.6.0": + folder: all + "1.7.0": + folder: all diff --git a/recipes/happly/all/conandata.yml b/recipes/happly/all/conandata.yml new file mode 100644 index 0000000000000..2e27bba5a746f --- /dev/null +++ b/recipes/happly/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200822": + url: "https://github.com/nmwsharp/happly/archive/88f79725d32d78e0e637ebf42d8432d519e1c7d0.tar.gz" + sha256: 61c6d112ac011408eab2154f145a9b71e188fa4b60cf3903b95e08f3a0d1fb17 diff --git a/recipes/happly/all/conanfile.py b/recipes/happly/all/conanfile.py new file mode 100644 index 0000000000000..21fdcfcb45fd6 --- /dev/null +++ b/recipes/happly/all/conanfile.py @@ -0,0 +1,30 @@ +from conans import ConanFile, tools + + +class HapplyConan(ConanFile): + name = "happly" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nmwsharp/happly" + topics = ("conan", "happly", "ply", "3D") + license = "MIT" + description = "A C++ header-only parser for the PLY file format. Parse .ply happily!" + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("happly.h", src=self._source_subfolder, dst="include") + + def package_id(self): + self.info.header_only() diff --git a/recipes/happly/all/test_package/CMakeLists.txt b/recipes/happly/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/happly/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/happly/all/test_package/conanfile.py b/recipes/happly/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5a25a64cfaaa9 --- /dev/null +++ b/recipes/happly/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +import glob +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package")) + # Let's check if the *.ply file has been created successfully + ply_format_file = glob.glob("*.ply")[0] + assert os.path.exists(ply_format_file) diff --git a/recipes/happly/all/test_package/test_package.cpp b/recipes/happly/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..27aa667aff6c1 --- /dev/null +++ b/recipes/happly/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include + + +int main(int argc, char const *argv[]) +{ + // Suppose these hold your data + std::vector> meshVertexPositions; + std::vector> meshVertexColors; + std::vector> meshFaceIndices; + + // Create an empty object + happly::PLYData plyOut; + + // Add mesh data (elements are created automatically) + plyOut.addVertexPositions(meshVertexPositions); + plyOut.addVertexColors(meshVertexColors); + plyOut.addFaceIndices(meshFaceIndices); + + + // Write the object to file + plyOut.write("my_output_mesh_file.ply", happly::DataFormat::ASCII); + + return 0; +} diff --git a/recipes/happly/config.yml b/recipes/happly/config.yml new file mode 100644 index 0000000000000..2c1035136c9e0 --- /dev/null +++ b/recipes/happly/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200822": + folder: all diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml new file mode 100644 index 0000000000000..bdeb5b0c43801 --- /dev/null +++ b/recipes/harfbuzz/all/conandata.yml @@ -0,0 +1,36 @@ +sources: + "7.1.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/7.1.0/harfbuzz-7.1.0.tar.xz" + sha256: "f135a61cd464c9ed6bc9823764c188f276c3850a8dc904628de2a87966b7077b" + "6.0.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/6.0.0/harfbuzz-6.0.0.tar.xz" + sha256: "1d1010a1751d076d5291e433c138502a794d679a7498d1268ee21e2d4a140eb4" + "5.3.1": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.3.1/harfbuzz-5.3.1.tar.xz" + sha256: "4a6ce097b75a8121facc4ba83b5b083bfec657f45b003cd5a3424f2ae6b4434d" + "5.3.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.3.0/harfbuzz-5.3.0.tar.xz" + sha256: "a05e19e3f52da24ed071522f0fddf872157d7d25e869cfd156cd6f1e81c42152" + "5.2.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.2.0/harfbuzz-5.2.0.tar.xz" + sha256: "735a94917b47936575acb4d4fa7e7986522f8a89527e4635721474dee2bc942c" + "5.1.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.1.0/harfbuzz-5.1.0.tar.xz" + sha256: "2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05" + "4.4.1": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/4.4.1/harfbuzz-4.4.1.tar.xz" + sha256: "c5bc33ac099b2e52f01d27cde21cee4281b9d5bfec7684135e268512478bc9ee" + "3.2.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/3.2.0/harfbuzz-3.2.0.tar.xz" + sha256: "0ada50a1c199bb6f70843ab893c55867743a443b84d087d54df08ad883ebc2cd" +patches: + "5.1.0": + - patch_file: "patches/0000-fix-freetype-lookup-5.1.0.patch" + patch_type: "portability" + patch_description: "fix fretype and icu dependency lookup" + patch_source: "https://github.com/harfbuzz/harfbuzz/pull/3811" + "4.4.1": + - patch_file: "patches/0000-fix-freetype-lookup-4.4.1.patch" + patch_type: "portability" + patch_description: "fix fretype and icu dependency lookup" + patch_source: "https://github.com/harfbuzz/harfbuzz/pull/3811" diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py new file mode 100644 index 0000000000000..8c53f442303a5 --- /dev/null +++ b/recipes/harfbuzz/all/conanfile.py @@ -0,0 +1,203 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import can_run, stdcpp_library +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, replace_in_file +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.54.0" + + +class HarfbuzzConan(ConanFile): + name = "harfbuzz" + description = "HarfBuzz is an OpenType text shaping engine." + topics = ("opentype", "text", "engine") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://harfbuzz.org" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_freetype": [True, False], + "with_icu": [True, False], + "with_glib": [True, False], + "with_gdi": [True, False], + "with_uniscribe": [True, False], + "with_directwrite": [True, False], + "with_subset": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_freetype": True, + "with_icu": False, + "with_glib": True, + "with_gdi": True, + "with_uniscribe": True, + "with_directwrite": False, + "with_subset": False, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.with_gdi + del self.options.with_uniscribe + del self.options.with_directwrite + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.shared and self.options.with_glib: + wildcard = "" if Version(conan_version) < "2.0.0" else "/*" + self.options[f"glib{wildcard}"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_freetype: + self.requires("freetype/2.13.0") + if self.options.with_icu: + self.requires("icu/72.1") + if self.options.with_glib: + self.requires("glib/2.76.0", run=can_run(self)) + + def validate(self): + if self.options.shared and self.options.with_glib and not self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if Version(self.version) >= "4.4.0": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration("New versions of harfbuzz require at least gcc 7") + + if self.options.with_glib and self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self.options.with_glib and not can_run(self): + self.tool_requires("glib/2.76.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + def is_enabled(value): + return "enabled" if value else "disabled" + + def meson_backend_and_flags(): + def is_vs_2017(): + version = Version(self.settings.compiler.version) + return version == "15" or version == "191" + + if is_msvc(self) and is_vs_2017() and self.settings.build_type == "Debug": + # Mitigate https://learn.microsoft.com/en-us/cpp/build/reference/zf?view=msvc-170 + return "vs", ["/bigobj"] + return "ninja", [] + + VirtualBuildEnv(self).generate() + if self.options.with_glib and can_run(self): + VirtualRunEnv(self).generate(scope="build") + PkgConfigDeps(self).generate() + + backend, cxxflags = meson_backend_and_flags() + tc = MesonToolchain(self, backend=backend) + tc.project_options.update({ + "glib": is_enabled(self.options.with_glib), + "icu": is_enabled(self.options.with_icu), + "freetype": is_enabled(self.options.with_freetype), + "gdi": is_enabled(self.options.get_safe("with_gdi")), + "directwrite": is_enabled(self.options.get_safe("with_directwrite")), + "gobject": is_enabled(can_run(self) and self.options.with_glib), + "introspection": is_enabled(False), + "tests": "disabled", + "docs": "disabled", + "benchmark": "disabled", + "icu_builtin": "false" + }) + tc.cpp_args += cxxflags + tc.generate() + + def build(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('util')", "") + 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() + 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")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "harfbuzz") + self.cpp_info.set_property("cmake_target_name", "harfbuzz::harfbuzz") + self.cpp_info.set_property("pkg_config_name", "harfbuzz") + if self.options.with_icu: + self.cpp_info.libs.append("harfbuzz-icu") + if self.options.with_subset: + self.cpp_info.libs.append("harfbuzz-subset") + self.cpp_info.libs.append("harfbuzz") + self.cpp_info.includedirs.append(os.path.join("include", "harfbuzz")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.system_libs.append("user32") + if self.options.with_gdi or self.options.with_uniscribe: + self.cpp_info.system_libs.append("gdi32") + if self.options.with_uniscribe or self.options.with_directwrite: + self.cpp_info.system_libs.append("rpcrt4") + if self.options.with_uniscribe: + self.cpp_info.system_libs.append("usp10") + if self.options.with_directwrite: + self.cpp_info.system_libs.append("dwrite") + if is_apple_os(self): + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText", "ApplicationServices"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch new file mode 100644 index 0000000000000..708b5d9734b00 --- /dev/null +++ b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch @@ -0,0 +1,99 @@ +diff --git a/meson.build b/meson.build +index 4a69d6d9e..a82ff598c 100644 +--- a/meson.build ++++ b/meson.build +@@ -21,7 +21,7 @@ pkgmod = import('pkgconfig') + cpp = meson.get_compiler('cpp') + null_dep = dependency('', required: false) + +-if cpp.get_id() == 'msvc' ++if cpp.get_argument_syntax() == 'msvc' + # Ignore several spurious warnings for things HarfBuzz does very commonly. + # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it + # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once +@@ -83,25 +83,39 @@ check_funcs = [ + + m_dep = cpp.find_library('m', required: false) + +-# https://github.com/harfbuzz/harfbuzz/pull/2498 +-freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2', +- required: get_option('freetype'), +- default_options: ['harfbuzz=disabled']) ++ ++# Try pkgconfig name ++freetype_dep = dependency('freetype2', required: false) ++if not freetype_dep.found() ++ # Try cmake name ++ freetype_dep = dependency('freetype', required: false) ++endif ++if not freetype_dep.found() ++ # Subproject fallback, `allow_fallback: true` means the fallback will be ++ # tried even if the freetype option is set to `auto`. ++ freetype_dep = dependency('freetype2', ++ required: get_option('freetype'), ++ default_options: ['harfbuzz=disabled'], ++ allow_fallback: true) ++endif + + glib_dep = dependency('glib-2.0', required: get_option('glib')) + gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) + graphite2_dep = dependency('graphite2', required: get_option('graphite2')) + graphite_dep = dependency('graphite2', required: get_option('graphite')) + +-if cpp.get_argument_syntax() == 'msvc' ++# Try pkgconfig name ++icu_dep = dependency('icu-uc', required: false) ++if not icu_dep.found() ++ # Try cmake name + icu_dep = dependency('ICU', +- required: get_option('icu'), ++ required: false, + components: 'uc', + method: 'cmake') +-else +- icu_dep = dependency('icu-uc', +- required: get_option('icu'), +- method: 'pkg-config') ++endif ++if not icu_dep.found() ++ # Subproject fallback if icu option is enabled ++ icu_dep = dependency('icu-uc', required: get_option('icu')) + endif + + if icu_dep.found() and icu_dep.type_name() == 'pkgconfig' +@@ -118,7 +132,7 @@ if not get_option('cairo').disabled() + cairo_ft_dep = dependency('cairo-ft', required: false) + + if (not cairo_dep.found() and +- cpp.get_id() == 'msvc' and ++ cpp.get_argument_syntax() == 'msvc' and + cpp.has_header('cairo.h')) + cairo_dep = cpp.find_library('cairo', required: false) + if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face', +@@ -198,6 +212,7 @@ if freetype_dep.found() + ['FT_Get_Var_Blend_Coordinates', {'deps': freetype_dep}], + ['FT_Set_Var_Blend_Coordinates', {'deps': freetype_dep}], + ['FT_Done_MM_Var', {'deps': freetype_dep}], ++ ['FT_Get_Transform', {'deps': freetype_dep}], + ] + + if freetype_dep.type_name() == 'internal' +@@ -232,17 +247,12 @@ if host_machine.system() == 'windows' and not get_option('gdi').disabled() + endif + + # DirectWrite (Windows) +-directwrite_dep = null_dep + if host_machine.system() == 'windows' and not get_option('directwrite').disabled() + if get_option('directwrite').enabled() and not cpp.has_header('dwrite_1.h') + error('DirectWrite was enabled explicitly, but required header is missing.') + endif + +- directwrite_dep = cpp.find_library('dwrite', required: get_option('directwrite')) +- +- if directwrite_dep.found() +- conf.set('HAVE_DIRECTWRITE', 1) +- endif ++ conf.set('HAVE_DIRECTWRITE', 1) + endif + + # CoreText (macOS) diff --git a/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch new file mode 100644 index 0000000000000..f3992bf9530f0 --- /dev/null +++ b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch @@ -0,0 +1,72 @@ +diff --git a/meson.build b/meson.build +index df4443fb2..b8b143948 100644 +--- a/meson.build ++++ b/meson.build +@@ -21,7 +21,7 @@ pkgmod = import('pkgconfig') + cpp = meson.get_compiler('cpp') + null_dep = dependency('', required: false) + +-if cpp.get_id() == 'msvc' ++if cpp.get_argument_syntax() == 'msvc' + # Ignore several spurious warnings for things HarfBuzz does very commonly. + # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it + # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once +@@ -83,25 +83,39 @@ check_funcs = [ + + m_dep = cpp.find_library('m', required: false) + +-# https://github.com/harfbuzz/harfbuzz/pull/2498 +-freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2', +- required: get_option('freetype'), +- default_options: ['harfbuzz=disabled']) ++ ++# Try pkgconfig name ++freetype_dep = dependency('freetype2', required: false) ++if not freetype_dep.found() ++ # Try cmake name ++ freetype_dep = dependency('freetype', required: false) ++endif ++if not freetype_dep.found() ++ # Subproject fallback, `allow_fallback: true` means the fallback will be ++ # tried even if the freetype option is set to `auto`. ++ freetype_dep = dependency('freetype2', ++ required: get_option('freetype'), ++ default_options: ['harfbuzz=disabled'], ++ allow_fallback: true) ++endif + + glib_dep = dependency('glib-2.0', required: get_option('glib')) + gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) + graphite2_dep = dependency('graphite2', required: get_option('graphite2')) + graphite_dep = dependency('graphite2', required: get_option('graphite')) + +-if cpp.get_argument_syntax() == 'msvc' ++# Try pkgconfig name ++icu_dep = dependency('icu-uc', required: false) ++if not icu_dep.found() ++ # Try cmake name + icu_dep = dependency('ICU', +- required: get_option('icu'), ++ required: false, + components: 'uc', + method: 'cmake') +-else +- icu_dep = dependency('icu-uc', +- required: get_option('icu'), +- method: 'pkg-config') ++endif ++if not icu_dep.found() ++ # Subproject fallback if icu option is enabled ++ icu_dep = dependency('icu-uc', required: get_option('icu')) + endif + + if icu_dep.found() and icu_dep.type_name() == 'pkgconfig' +@@ -118,7 +132,7 @@ if not get_option('cairo').disabled() + cairo_ft_dep = dependency('cairo-ft', required: false) + + if (not cairo_dep.found() and +- cpp.get_id() == 'msvc' and ++ cpp.get_argument_syntax() == 'msvc' and + cpp.has_header('cairo.h')) + cairo_dep = cpp.find_library('cairo', required: false) + if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face', diff --git a/recipes/harfbuzz/all/test_package/CMakeLists.txt b/recipes/harfbuzz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..297728d956c6c --- /dev/null +++ b/recipes/harfbuzz/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(harfbuzz REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE harfbuzz::harfbuzz) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/harfbuzz/all/test_package/conanfile.py b/recipes/harfbuzz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e9a060aba448d --- /dev/null +++ b/recipes/harfbuzz/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + 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): + 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") diff --git a/recipes/harfbuzz/all/test_package/example.ttf b/recipes/harfbuzz/all/test_package/example.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1849f5cc07efa9c7fe07b22f4222c7af1893e6d3 GIT binary patch literal 2948 zcmds3>u(%a6+h>`=C!l$o$(rbz23EV+}2sIXT7^tVml$FCa5im+B_U7EnXZyqWTrv zdGU}SAm|sQ@}WW?RVotn3lx-y51^_gMMx+WpngDnD&ivwQjsDxw6vAYxw~t}iNrs^ z%-%V_^E>yRbMBq9b1xtOxbO|&aAJD;E`0{wS^D2KKU!z2LR-!OY_b1 z?2EVmL$>#*)t89if5DH*SDN&JrIoF#DhWR&{nwV zCq2K~T$%q@^S6Hou=2!xw7#~v^|x34nV|SxWS<5-H)`K``}LQ;6q~pQ4kH5K-5>q_ zwLO{GxrcY~4bn|$n_FY>jh%Z?ZWDN?&NTz0QKAO)m(YCo-Z z7Lss?Agz6?^>q4AkfulWfPg$nK{x4l8NDaC3p+cpww+9)M~eF8BW@ zTlEZ&>Kjk8>uj5*$XaXtLp(*RX+Ze~!pOu;L%{pt4JF^3xXBqoxWP3oHGR`i`02z= zTE_RoYNDD5s)=Ia#VZR7cxwA+39OP&2hLLEy@o$0-~I3$T!2gPb+``Sg&)9M@F)6v z6l!CoVj+r|G@*LvWjxIk)Sj*iWfqizGS(YY*oU4PLFIdmx}Ou_6tC4a4h&T~jCIe? zp)!;aWu-z;B1_n)dj=14ER$A+(pcRK>)LnPFB zc4InJX#@=t?H0p=Pn{?jrQ-RXq5hq)6gNa7`I+QQ(u|nNRCj9RaM&9a5i4Q{#^N%t zQdU|0T8v{9|1zqK;Ydh|xXJ-R(pj zCu(Oh&2ygcX3u#q_?1$S?Xq}GB&xNi2ev=4xO4|n(k%5EMqkO4sUg>l3=5VRkg}&o zsDT9IL+mG{w*y%_Xo`on6f5vT{F?K44b zEA*nmH-*4)6VI6O?cd-Nh*mjCop(cU*GZvvYFLc1lcJk!0)LgTEsD{}rSF#obXYKL zIjzW!`j%reDTQP{W4?5y?J(bQL{xMkc9C!#zT((q@DV%q-hGsNzS9+7T3UPzjxmP)||Clcf_7zn5B&a=~e1x}YH|m8UI6&2P7GTitZ`2yW6l>ITSPiGp&&fV2G2bBE`dFpCMvcB$ zex_a<3#ysWH|U!-N;1bYX(LmtRf>h6;Z?(Gt;}j;4Sey)_U5B!C%IEhGGz*3M}*zw zWfD;?*y))o-NW7E$H&J9t)!i@VlIogh|Dk}vS_hLibbOgBeq+7`}Xs1eZe=YHH^O(`&0+(`y@x^ZBq` z$sf#jA`=R02S!H^=p6rddZ#JS25i#QbUJx*s@>`|^qmJdJ-@MeVQn>Esf?B@l?pKr zW_Ew3`UFH5oxrjru%+yO&}oTShO~8|FfOfLm>#WEI&!ol!`1+#vzGSO^6~ES3t!Rf I{xj%*0nf>0!2kdN literal 0 HcmV?d00001 diff --git a/recipes/harfbuzz/all/test_package/test_package.c b/recipes/harfbuzz/all/test_package/test_package.c new file mode 100644 index 0000000000000..5f2ac9a8454e4 --- /dev/null +++ b/recipes/harfbuzz/all/test_package/test_package.c @@ -0,0 +1,141 @@ +/* + * 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); + + return 0; +} diff --git a/recipes/harfbuzz/all/test_v1_package/CMakeLists.txt b/recipes/harfbuzz/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/harfbuzz/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/harfbuzz/all/test_v1_package/conanfile.py b/recipes/harfbuzz/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a4aa2f28304a1 --- /dev/null +++ b/recipes/harfbuzz/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): + 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) + diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml new file mode 100644 index 0000000000000..ccb850f8b35f9 --- /dev/null +++ b/recipes/harfbuzz/config.yml @@ -0,0 +1,17 @@ +versions: + "7.1.0": + folder: all + "6.0.0": + folder: all + "5.3.1": + folder: all + "5.3.0": + folder: all + "5.2.0": + folder: all + "5.1.0": + folder: all + "4.4.1": + folder: all + "3.2.0": + folder: all diff --git a/recipes/hash-library/all/CMakeLists.txt b/recipes/hash-library/all/CMakeLists.txt new file mode 100644 index 0000000000000..14405c91fb240 --- /dev/null +++ b/recipes/hash-library/all/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 3.4) +project(hash-library LANGUAGES CXX) + +add_library(hash-library + ${HASH_LIBRARY_SRC_DIR}/crc32.cpp + ${HASH_LIBRARY_SRC_DIR}/keccak.cpp + ${HASH_LIBRARY_SRC_DIR}/md5.cpp + ${HASH_LIBRARY_SRC_DIR}/sha1.cpp + ${HASH_LIBRARY_SRC_DIR}/sha256.cpp + ${HASH_LIBRARY_SRC_DIR}/sha3.cpp +) + +target_include_directories(hash-library PUBLIC ${HASH_LIBRARY_SRC_DIR}) + +set(HEADERS + ${HASH_LIBRARY_SRC_DIR}/crc32.h + ${HASH_LIBRARY_SRC_DIR}/hash.h + ${HASH_LIBRARY_SRC_DIR}/hmac.h + ${HASH_LIBRARY_SRC_DIR}/keccak.h + ${HASH_LIBRARY_SRC_DIR}/md5.h + ${HASH_LIBRARY_SRC_DIR}/sha1.h + ${HASH_LIBRARY_SRC_DIR}/sha256.h + ${HASH_LIBRARY_SRC_DIR}/sha3.h +) + +set_target_properties(hash-library PROPERTIES + PUBLIC_HEADER "${HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) + +include(GNUInstallDirs) +install(TARGETS hash-library + 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/hash-library/all/conandata.yml b/recipes/hash-library/all/conandata.yml new file mode 100644 index 0000000000000..e3155c060c064 --- /dev/null +++ b/recipes/hash-library/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "8.0": + url: "https://github.com/stbrumme/hash-library/archive/hash_library_v8.tar.gz" + sha256: "ddf9d398166e08482af1225aed968ac4c370f99648b5359b0a20c9ed56f7b1c7" +patches: + "8.0": + - patch_file: "patches/001-fix-macos.patch" diff --git a/recipes/hash-library/all/conanfile.py b/recipes/hash-library/all/conanfile.py new file mode 100644 index 0000000000000..83c2d2fdd2b74 --- /dev/null +++ b/recipes/hash-library/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class HashLibraryConan(ConanFile): + name = "hash-library" + description = "Portable C++ hashing library" + homepage = "https://create.stephan-brumme.com/hash-library/" + topics = ("hash", "digest", "hmac", "checksum", "crc32", "md5", "sha1", "sha2", "sha256", "sha3", "keccak") + license = "Zlib" + 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, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HASH_LIBRARY_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["hash-library"] diff --git a/recipes/hash-library/all/patches/001-fix-macos.patch b/recipes/hash-library/all/patches/001-fix-macos.patch new file mode 100644 index 0000000000000..e138933e33525 --- /dev/null +++ b/recipes/hash-library/all/patches/001-fix-macos.patch @@ -0,0 +1,98 @@ +Fixes includes of endian.h on MacOS, see https://github.com/stbrumme/hash-library/pull/4. + +diff --git a/crc32.cpp b/crc32.cpp +--- a/crc32.cpp ++++ b/crc32.cpp +@@ -7,8 +7,10 @@ + #include "crc32.h" + + // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN +-#ifndef _MSC_VER +-#include ++#if defined(__APPLE__) ++ #include ++#elif !defined(_MSC_VER) ++ #include + #endif + + +diff --git a/keccak.cpp b/keccak.cpp +--- a/keccak.cpp ++++ b/keccak.cpp +@@ -7,8 +7,10 @@ + #include "keccak.h" + + // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN +-#ifndef _MSC_VER +-#include ++#if defined(__APPLE__) ++ #include ++#elif !defined(_MSC_VER) ++ #include + #endif + + +diff --git a/md5.cpp b/md5.cpp +--- a/md5.cpp ++++ b/md5.cpp +@@ -6,8 +6,10 @@ + + #include "md5.h" + +-#ifndef _MSC_VER +-#include ++#if defined(__APPLE__) ++ #include ++#elif !defined(_MSC_VER) ++ #include + #endif + + +diff --git a/sha1.cpp b/sha1.cpp +--- a/sha1.cpp ++++ b/sha1.cpp +@@ -7,8 +7,10 @@ + #include "sha1.h" + + // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN +-#ifndef _MSC_VER +-#include ++#if defined(__APPLE__) ++ #include ++#elif !defined(_MSC_VER) ++ #include + #endif + + +diff --git a/sha256.cpp b/sha256.cpp +--- a/sha256.cpp ++++ b/sha256.cpp +@@ -7,8 +7,10 @@ + #include "sha256.h" + + // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN +-#ifndef _MSC_VER +-#include ++#if defined(__APPLE__) ++ #include ++#elif !defined(_MSC_VER) ++ #include + #endif + + +diff --git a/sha3.cpp b/sha3.cpp +--- a/sha3.cpp ++++ b/sha3.cpp +@@ -7,8 +7,10 @@ + #include "sha3.h" + + // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN +-#ifndef _MSC_VER +-#include ++#if defined(__APPLE__) ++ #include ++#elif !defined(_MSC_VER) ++ #include + #endif + + #include diff --git a/recipes/hash-library/all/test_package/CMakeLists.txt b/recipes/hash-library/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d020276409c2e --- /dev/null +++ b/recipes/hash-library/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(hash-library CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hash-library::hash-library) diff --git a/recipes/hash-library/all/test_package/conanfile.py b/recipes/hash-library/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6dbd1de388288 --- /dev/null +++ b/recipes/hash-library/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 HashLibraryTestConan(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/hash-library/all/test_package/test_package.cpp b/recipes/hash-library/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8f47720724b8b --- /dev/null +++ b/recipes/hash-library/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include "crc32.h" +#include "keccak.h" +#include "md5.h" +#include "sha1.h" +#include "sha256.h" +#include "sha3.h" + +int main(void) { + if (CRC32()("abc") != "352441c2") { + return 1; + } + if (Keccak()("abc") != "4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45") { + return 2; + } + if (MD5()("abc") != "900150983cd24fb0d6963f7d28e17f72") { + return 3; + } + if (SHA1()("abc") != "a9993e364706816aba3e25717850c26c9cd0d89d") { + return 4; + } + if (SHA256()("abc") != "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad") { + return 5; + } + if (SHA3()("abc") != "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532") { + return 6; + } + + return 0; +} diff --git a/recipes/hash-library/all/test_v1_package/CMakeLists.txt b/recipes/hash-library/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/hash-library/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hash-library/all/test_v1_package/conanfile.py b/recipes/hash-library/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4265550ef4aee --- /dev/null +++ b/recipes/hash-library/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, tools, CMake + + +class HashLibraryTestConan(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/hash-library/config.yml b/recipes/hash-library/config.yml new file mode 100644 index 0000000000000..2bb15eca7e86c --- /dev/null +++ b/recipes/hash-library/config.yml @@ -0,0 +1,3 @@ +versions: + "8.0": + folder: all diff --git a/recipes/hazelcast-cpp-client/all/conandata.yml b/recipes/hazelcast-cpp-client/all/conandata.yml new file mode 100644 index 0000000000000..03a7693f717d9 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "5.2.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.2.0.tar.gz" + sha256: "49afe765fe4e8ddf134ebf2862a698b8d0dd8dc724d4300e09e5bf7da9e4cbfb" + "5.1.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.1.0.tar.gz" + sha256: "de22ddf2c99079ed2385baa554a997b15ae17b039d6d108f68e25e1b3bbf76b6" + "5.0.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.0.0.tar.gz" + sha256: "0df7948bc6f4d219c60f51179355599938cab5b713335c2ea48d1d38be1b69dc" + "4.2.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.2.0.zip" + sha256: "18aeb755a875015a2e182d4c575cc46a041bdfb699937c5174d94534517e4708" + "4.1.1": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.1.1.zip" + sha256: "ca425c97eb871400de4bd2307ddaf3c557c9c1bae50d6a0db6507d72f435830c" + "4.1.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.1.0.zip" + sha256: "8356bc76077fea354e83ffcd506096797137af10b292809c6b7843a8fbd084e3" + "4.0.1": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.0.1.zip" + sha256: "4b3c6a876ebca2a4dcf23a556d3c3d4da2284e4ce1d2bbdf335df7f86b03fd28" +patches: + "5.1.0": + - patch_file: "patches/gcc_11_1_0.patch" + patch_description: "Fix for GCC-111" + patch_type: "portability" + "4.1.0": + - patch_file: "patches/gcc_4.9_5_fix.patch" + patch_description: "Fix for GCC-495" + patch_type: "portability" diff --git a/recipes/hazelcast-cpp-client/all/conanfile.py b/recipes/hazelcast-cpp-client/all/conanfile.py new file mode 100644 index 0000000000000..ccfd70e209aa3 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.54.0" + + +class HazelcastCppClient(ConanFile): + name = "hazelcast-cpp-client" + description = "C++ client library for Hazelcast in-memory database." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hazelcast/hazelcast-cpp-client" + topics = ("hazelcast", "client", "database", "cache", "in-memory", "distributed", "computing", "ssl") + 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": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.79.0", transitive_headers=True, transitive_libs=True) + if self.options.with_openssl: + self.requires("openssl/1.1.1t") + + 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["WITH_OPENSSL"] = self.options.with_openssl + if Version(self.version) <= "4.0.0": + tc.variables["BUILD_STATIC_LIB"] = not self.options.shared + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "hazelcast-cpp-client") + self.cpp_info.set_property("cmake_target_name", "hazelcast-cpp-client::hazelcast-cpp-client") + + self.cpp_info.libs = ["hazelcast-cpp-client"] + self.cpp_info.defines = ["BOOST_THREAD_VERSION=5"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/hazelcast-cpp-client/all/patches/gcc_11_1_0.patch b/recipes/hazelcast-cpp-client/all/patches/gcc_11_1_0.patch new file mode 100644 index 0000000000000..c286f1883f21f --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/patches/gcc_11_1_0.patch @@ -0,0 +1,40 @@ +diff --git a/hazelcast/include/hazelcast/client/protocol/ClientMessage.h b/hazelcast/include/hazelcast/client/protocol/ClientMessage.h +index 462ea85b0..f2686506a 100644 +--- a/hazelcast/include/hazelcast/client/protocol/ClientMessage.h ++++ b/hazelcast/include/hazelcast/client/protocol/ClientMessage.h +@@ -190,6 +190,9 @@ struct HAZELCAST_API is_trivial_entry_vector< + */ + class HAZELCAST_API ClientMessage + { ++ template ++ struct default_nullable_decoder; ++ + public: + static constexpr size_t EXPECTED_DATA_BLOCK_SIZE = 1024; + +@@ -974,10 +977,8 @@ public: + } + + template +- boost::optional get_nullable(std::function decoder = +- [](ClientMessage& msg) { +- return msg.get(); +- }) ++ boost::optional get_nullable( ++ std::function decoder = default_nullable_decoder{}) + { + if (next_frame_is_null_frame()) { + // skip next frame with null flag +@@ -1357,6 +1358,12 @@ private: + static const frame_header_type BEGIN_FRAME; + static const frame_header_type END_FRAME; + ++ template ++ struct default_nullable_decoder ++ { ++ T operator()(ClientMessage& msg) const { return msg.get(); } ++ }; ++ + template + void set_primitive_vector(const std::vector& values, + bool is_final = false) diff --git a/recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch b/recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch new file mode 100644 index 0000000000000..f5655c00c6f25 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch @@ -0,0 +1,79 @@ +diff --git a/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h b/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h +index 41b437a80..6bef9e28b 100644 +--- a/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h ++++ b/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h +@@ -64,10 +64,7 @@ namespace hazelcast { + void reset(); + private: + struct partition_table { +- partition_table(int32_t connectionId = 0, int32_t version = -1, +- const std::unordered_map &partitions = {}); +- +- int32_t connection_id{0}; ++ int32_t connection_id; + int32_t version; + std::unordered_map partitions; + }; +diff --git a/hazelcast/src/hazelcast/client/config.cpp b/hazelcast/src/hazelcast/client/config.cpp +index 88cad1ec5..5da63b36a 100644 +--- a/hazelcast/src/hazelcast/client/config.cpp ++++ b/hazelcast/src/hazelcast/client/config.cpp +@@ -856,7 +856,7 @@ namespace hazelcast { + return it->second; + } + +- return reliable_topic_config_map_.emplace(name, name).first->second; ++ return reliable_topic_config_map_.emplace(name, config::reliable_topic_config{name}).first->second; + } + + const config::reliable_topic_config *client_config::lookup_reliable_topic_config(const std::string &name) const { +diff --git a/hazelcast/src/hazelcast/client/discovery.cpp b/hazelcast/src/hazelcast/client/discovery.cpp +index cdc10a906..51279b446 100644 +--- a/hazelcast/src/hazelcast/client/discovery.cpp ++++ b/hazelcast/src/hazelcast/client/discovery.cpp +@@ -588,7 +588,7 @@ namespace hazelcast { + + std::unordered_map aws_client::get_addresses() { + util::Preconditions::check_ssl("aws_client::get_addresses"); +- return {}; ++ return std::unordered_map(); + } + } + } +diff --git a/hazelcast/src/hazelcast/client/spi.cpp b/hazelcast/src/hazelcast/client/spi.cpp +index ada4e665c..206aecb9e 100644 +--- a/hazelcast/src/hazelcast/client/spi.cpp ++++ b/hazelcast/src/hazelcast/client/spi.cpp +@@ -788,9 +788,10 @@ namespace hazelcast { + auto previous_list = member_list_snapshot_.load()->members; + + member_list_snapshot_.store( +- boost::shared_ptr(new member_list_snapshot{0, {}})); ++ boost::shared_ptr(new member_list_snapshot{0})); + +- return detect_membership_events(previous_list, {}); ++ return detect_membership_events(previous_list, ++ std::unordered_map>()); + } + + void ClientClusterServiceImpl::clear_member_list() { +@@ -2357,7 +2358,7 @@ namespace hazelcast { + } + #else + util::Preconditions::check_ssl("cloud_discovery::get_addresses"); +- return {}; ++ return std::unordered_map(); + #endif + } + +@@ -2388,10 +2389,6 @@ namespace hazelcast { + return address(std::move(scoped_hostname), address_holder.get_port()); + } + } +- +- ClientPartitionServiceImpl::partition_table::partition_table(int32_t connectionId, int32_t version, +- const std::unordered_map &partitions) +- : connection_id(connectionId), version(version), partitions(partitions) {} + } + } + } diff --git a/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..47708a63a3ae9 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(hazelcast-cpp-client REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hazelcast-cpp-client::hazelcast-cpp-client) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/hazelcast-cpp-client/all/test_package/conanfile.py b/recipes/hazelcast-cpp-client/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f70d40a28931b --- /dev/null +++ b/recipes/hazelcast-cpp-client/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 TestPackageHazelcastCppClient(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/hazelcast-cpp-client/all/test_package/test_package.cpp b/recipes/hazelcast-cpp-client/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..485a5dcd244e1 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +int main() { + hazelcast::client::client_config config; + config.get_connection_strategy_config().get_retry_config().set_cluster_connect_timeout(std::chrono::seconds(1)); + + try { + auto hz = hazelcast::new_client(std::move(config)).get(); + } catch (std::exception &e) { + } + return EXIT_SUCCESS; +} diff --git a/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py b/recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hazelcast-cpp-client/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/hazelcast-cpp-client/config.yml b/recipes/hazelcast-cpp-client/config.yml new file mode 100644 index 0000000000000..cc9a79c74eb46 --- /dev/null +++ b/recipes/hazelcast-cpp-client/config.yml @@ -0,0 +1,15 @@ +versions: + "5.2.0": + folder: all + "5.1.0": + folder: all + "5.0.0": + folder: all + "4.2.0": + folder: all + "4.1.1": + folder: all + "4.1.0": + folder: all + "4.0.1": + folder: all diff --git a/recipes/hdf4/all/CMakeLists.txt b/recipes/hdf4/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/hdf4/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/hdf4/all/conandata.yml b/recipes/hdf4/all/conandata.yml new file mode 100644 index 0000000000000..c28edc581baba --- /dev/null +++ b/recipes/hdf4/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.2.15": + url: "https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.15/src/hdf-4.2.15.tar.gz" + sha256: "dbeeef525af7c2d01539906c28953f0fdab7dba603d1bc1ec4a5af60d002c459" +patches: + "4.2.15": + - patch_file: "patches/fix-export-macro.patch" + base_path: "source_subfolder" + - patch_file: "patches/fix-missing-unistd-include.patch" + base_path: "source_subfolder" diff --git a/recipes/hdf4/all/conanfile.py b/recipes/hdf4/all/conanfile.py new file mode 100644 index 0000000000000..2d8c7ea8622e4 --- /dev/null +++ b/recipes/hdf4/all/conanfile.py @@ -0,0 +1,156 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class Hdf4Conan(ConanFile): + name = "hdf4" + description = "HDF4 is a data model, library, and file format for storing and managing data." + license = "BSD-3-Clause" + topics = ("conan", "hdf4", "hdf", "data") + homepage = "https://portal.hdfgroup.org/display/HDF4/HDF4" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "jpegturbo": [True, False], + "szip_support": [None, "with_libaec", "with_szip"], + "szip_encoding": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "jpegturbo": False, + "szip_support": None, + "szip_encoding": False, + } + + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake", "cmake_find_package" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if not bool(self.options.szip_support): + del self.options.szip_encoding + + def requirements(self): + self.requires("zlib/1.2.12") + if self.options.jpegturbo: + self.requires("libjpeg-turbo/2.1.2") + else: + self.requires("libjpeg/9d") + if self.options.szip_support == "with_libaec": + self.requires("libaec/1.0.6") + elif self.options.szip_support == "with_szip": + self.requires("szip/2.1.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["HDF4_EXTERNALLY_CONFIGURED"] = True + self._cmake.definitions["HDF4_EXTERNAL_LIB_PREFIX"] = "" + self._cmake.definitions["HDF4_NO_PACKAGES"] = True + self._cmake.definitions["ONLY_SHARED_LIBS"] = self.options.shared + self._cmake.definitions["HDF4_ENABLE_COVERAGE"] = False + self._cmake.definitions["HDF4_ENABLE_DEPRECATED_SYMBOLS"] = True + self._cmake.definitions["HDF4_ENABLE_JPEG_LIB_SUPPORT"] = True # HDF can't compile without libjpeg or libjpeg-turbo + self._cmake.definitions["HDF4_ENABLE_Z_LIB_SUPPORT"] = True # HDF can't compile without zlib + self._cmake.definitions["HDF4_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) + self._cmake.definitions["HDF4_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding") or False + self._cmake.definitions["HDF4_PACKAGE_EXTLIBS"] = False + self._cmake.definitions["HDF4_BUILD_XDR_LIB"] = True + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.definitions["HDF4_INSTALL_INCLUDE_DIR"] = os.path.join(self.package_folder, "include", "hdf4") + self._cmake.definitions["HDF4_BUILD_FORTRAN"] = False + self._cmake.definitions["HDF4_BUILD_UTILS"] = False + self._cmake.definitions["HDF4_BUILD_TOOLS"] = False + self._cmake.definitions["HDF4_BUILD_EXAMPLES"] = False + self._cmake.definitions["HDF4_BUILD_JAVA"] = False + if tools.cross_building(self): + self._cmake.definitions["H4_PRINTF_LL_TEST_RUN"] = "0" + self._cmake.definitions["H4_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT"] = "" + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + os.remove(os.path.join(self.package_folder, "lib", "libhdf4.settings")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "hdf" + unofficial_includedir = os.path.join(self.package_folder, "include", "hdf4") + # xdr + xdr_cmake = "xdr-shared" if self.options.shared else "xdr-static" + self.cpp_info.components["xdr"].names["cmake_find_package"] = xdr_cmake + self.cpp_info.components["xdr"].names["cmake_find_package_multi"] = xdr_cmake + self.cpp_info.components["xdr"].includedirs.append(unofficial_includedir) + self.cpp_info.components["xdr"].libs = [self._get_decorated_lib("xdr")] + if self.settings.os == "Windows": + self.cpp_info.components["xdr"].system_libs.append("ws2_32") + # hdf + hdf_cmake = "hdf-shared" if self.options.shared else "hdf-static" + self.cpp_info.components["hdf"].names["cmake_find_package"] = hdf_cmake + self.cpp_info.components["hdf"].names["cmake_find_package_multi"] = hdf_cmake + self.cpp_info.components["hdf"].includedirs.append(unofficial_includedir) + self.cpp_info.components["hdf"].libs = [self._get_decorated_lib("hdf")] + self.cpp_info.components["hdf"].requires = [ + "zlib::zlib", + "libjpeg-turbo::libjpeg-turbo" if self.options.jpegturbo else "libjpeg::libjpeg" + ] + if self.options.szip_support == "with_libaec": + self.cpp_info.components["hdf"].requires.append("libaec::libaec") + elif self.options.szip_support == "with_szip": + self.cpp_info.components["hdf"].requires.append("szip::szip") + # mfhdf + mfhdf_cmake = "mfhdf-shared" if self.options.shared else "mfhdf-static" + self.cpp_info.components["mfhdf"].names["cmake_find_package"] = mfhdf_cmake + self.cpp_info.components["mfhdf"].names["cmake_find_package_multi"] = mfhdf_cmake + self.cpp_info.components["mfhdf"].includedirs.append(unofficial_includedir) + self.cpp_info.components["mfhdf"].libs = [self._get_decorated_lib("mfhdf")] + self.cpp_info.components["mfhdf"].requires = ["xdr", "hdf"] + + if self.options.shared: + self.cpp_info.components["xdr"].defines.append("H4_BUILT_AS_DYNAMIC_LIB=1") + self.cpp_info.components["hdf"].defines.append("H4_BUILT_AS_DYNAMIC_LIB=1") + self.cpp_info.components["mfhdf"].defines.append("H4_BUILT_AS_DYNAMIC_LIB=1") + + def _get_decorated_lib(self, name): + libname = name + if self.settings.os == "Windows" and self.settings.compiler != "gcc" and not self.options.shared: + libname = "lib" + libname + if self.settings.build_type == "Debug": + libname += "_D" if self.settings.os == "Windows" else "_debug" + return libname diff --git a/recipes/hdf4/all/patches/fix-export-macro.patch b/recipes/hdf4/all/patches/fix-export-macro.patch new file mode 100644 index 0000000000000..857211f71aaec --- /dev/null +++ b/recipes/hdf4/all/patches/fix-export-macro.patch @@ -0,0 +1,11 @@ +--- a/hdf/src/H4api_adpt.h ++++ b/hdf/src/H4api_adpt.h +@@ -38,7 +38,7 @@ + + #if defined(hdf_shared_EXPORTS) + #if defined (_MSC_VER) || defined(__MINGW32__) /* MSVC Compiler Case */ +- #define HDFERRPUBLIC extern __declspec(dllimport) ++ #define HDFERRPUBLIC extern __declspec(dllexport) + #define HDFPUBLIC __declspec(dllexport) + #define HDFLIBAPI extern __declspec(dllexport) + #define HDFFCLIBAPI extern __declspec(dllimport) diff --git a/recipes/hdf4/all/patches/fix-missing-unistd-include.patch b/recipes/hdf4/all/patches/fix-missing-unistd-include.patch new file mode 100644 index 0000000000000..ce1ecb30fb4f8 --- /dev/null +++ b/recipes/hdf4/all/patches/fix-missing-unistd-include.patch @@ -0,0 +1,13 @@ +--- a/mfhdf/libsrc/file.c ++++ b/mfhdf/libsrc/file.c +@@ -26,6 +26,10 @@ + #include "alloc.h" + #include "herr.h" + ++#ifdef H4_HAVE_UNISTD_H ++#include ++#endif ++ + /* obtain the maximum number of open files allowed, at the same time, + on the current system */ + #if defined _WIN32 diff --git a/recipes/hdf4/all/test_package/CMakeLists.txt b/recipes/hdf4/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a6de4b1271021 --- /dev/null +++ b/recipes/hdf4/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hdf4 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET hdf4::hdf-shared) + target_link_libraries(${PROJECT_NAME} hdf4::hdf-shared) +else() + target_link_libraries(${PROJECT_NAME} hdf4::hdf-static) +endif() diff --git a/recipes/hdf4/all/test_package/conanfile.py b/recipes/hdf4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..612db2552bfca --- /dev/null +++ b/recipes/hdf4/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + self.build_requires("cmake/3.20.1") + + def 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/hdf4/all/test_package/test_package.c b/recipes/hdf4/all/test_package/test_package.c new file mode 100644 index 0000000000000..4efcf0be4d7a7 --- /dev/null +++ b/recipes/hdf4/all/test_package/test_package.c @@ -0,0 +1,114 @@ +#include + +#define FILE_NAME "General_HDFobjects.hdf" +#define VG_NAME "AN Vgroup" +#define FILE_LABEL_TXT "General HDF objects" +#define FILE_DESC_TXT "This is an HDF file that contains general HDF objects" +#define DATA_LABEL_TXT "Common AN Vgroup" +#define DATA_DESC_TXT "This is a vgroup that is used to test data annotations" + +int main() { + /************************* Variable declaration **************************/ + + intn status_n; /* returned status for functions returning an intn */ + int32 status_32, /* returned status for functions returning an int32 */ + file_id, /* HDF file identifier */ + an_id, /* AN interface identifier */ + file_label_id, /* file label identifier */ + file_desc_id, /* file description identifier */ + data_label_id, /* data label identifier */ + data_desc_id, /* data description identifier */ + vgroup_id; + uint16 vgroup_tag, vgroup_ref; + + /********************** End of variable declaration **********************/ + + /* + * Create the HDF file. + */ + file_id = Hopen(FILE_NAME, DFACC_CREATE, 0); + + /* + * Initialize the AN interface. + */ + an_id = ANstart(file_id); + + /* + * Create the file label. + */ + file_label_id = ANcreatef(an_id, AN_FILE_LABEL); + + /* + * Write the annotations to the file label. + */ + status_32 = ANwriteann(file_label_id, FILE_LABEL_TXT, (int32) strlen(FILE_LABEL_TXT)); + + /* + * Create file description. + */ + file_desc_id = ANcreatef(an_id, AN_FILE_DESC); + + /* + * Write the annotation to the file description. + */ + status_32 = ANwriteann(file_desc_id, FILE_DESC_TXT, (int32) strlen(FILE_DESC_TXT)); + + /* + * Create a vgroup in the V interface. Note that the vgroup's ref number + * is set to -1 for creating and the access mode is "w" for writing. + */ + status_n = Vstart(file_id); + vgroup_id = Vattach(file_id, -1, "w"); + status_32 = Vsetname(vgroup_id, VG_NAME); + + /* + * Obtain the tag and ref number of the vgroup for subsequent + * references. + */ + vgroup_tag = (uint16) VQuerytag(vgroup_id); + vgroup_ref = (uint16) VQueryref(vgroup_id); + + /* + * Create the data label for the vgroup identified by its tag + * and ref number. + */ + data_label_id = ANcreate(an_id, vgroup_tag, vgroup_ref, AN_DATA_LABEL); + + /* + * Write the annotation text to the data label. + */ + status_32 = ANwriteann(data_label_id, DATA_LABEL_TXT, (int32) strlen(DATA_LABEL_TXT)); + + /* + * Create the data description for the vgroup identified by its tag + * and ref number. + */ + data_desc_id = ANcreate(an_id, vgroup_tag, vgroup_ref, AN_DATA_DESC); + + /* + * Write the annotation text to the data description. + */ + status_32 = ANwriteann(data_desc_id, DATA_DESC_TXT, (int32) strlen(DATA_DESC_TXT)); + + /* + * Teminate access to the vgroup and to the V interface. + */ + status_32 = Vdetach(vgroup_id); + status_n = Vend(file_id); + + /* + * Terminate access to each annotation explicitly. + */ + status_n = ANendaccess(file_label_id); + status_n = ANendaccess(file_desc_id); + status_n = ANendaccess(data_label_id); + status_n = ANendaccess(data_desc_id); + + /* + * Terminate access to the AN interface and close the HDF file. + */ + status_32 = ANend(an_id); + status_n = Hclose(file_id); + + return 0; +} diff --git a/recipes/hdf4/config.yml b/recipes/hdf4/config.yml new file mode 100644 index 0000000000000..64a8c610990e2 --- /dev/null +++ b/recipes/hdf4/config.yml @@ -0,0 +1,3 @@ +versions: + "4.2.15": + folder: all diff --git a/recipes/hdf5/all/conandata.yml b/recipes/hdf5/all/conandata.yml new file mode 100644 index 0000000000000..dc660f8ec159b --- /dev/null +++ b/recipes/hdf5/all/conandata.yml @@ -0,0 +1,76 @@ +sources: + "1.14.0": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_0.tar.gz" + sha256: "0f2ec13c1bf6e9f506fd03681c83a476d722e7479cad9ce6f8585a26c317d0ad" + "1.13.1": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_13_1.tar.gz" + sha256: "92552458f35c7e58128ce1bfc2831abf901cc142ea0fdd2b056311e4452db7bf" + "1.12.2": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_12_2.tar.gz" + sha256: "1ca14cadff7bc4b61826eee591da1a330f44c107db66c9510ee95df3b2bc5f78" + "1.12.0": + # Need 1.12.0 for NetCDF 4.7.4 with byteranges=True + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_12_0.tar.gz" + sha256: "c64ffec2539ae6b6041f97952a40b0893c3c0df4d5b1c0177fb8aba567808158" + "1.10.6": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_10_6.tar.gz" + sha256: "e524b374b1c6f14f1aa87595c0761608c861fe7838549dab84639ae564ff48e8" + "1.10.5": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_10_5.tar.gz" + sha256: "22a4a48f94b013e9fd482c0bb0251de02ff9963787a107c5dde26a3f903b3b90" + "1.8.21": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_8_21.tar.gz" + sha256: "753520e34a576a64809b8e02d9c015d6126f7974f678c7417a60492d835a88f4" +patches: + "1.14.0": + - patch_file: "patches/conanize-link-szip-1.14.0+.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + "1.13.1": + - patch_file: "patches/conanize-link-szip-1.12.2+.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + "1.12.2": + - patch_file: "patches/conanize-link-szip-1.12.2+.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + "1.12.0": + - patch_file: "patches/conanize-link-szip-1.10.5+.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + "1.10.6": + - patch_file: "patches/fix-missing-function-prototypes-1.10.5+.patch" + patch_type: "conan" + patch_description: "Fix missing function prototypes" + - patch_file: "patches/fix-missing-function-prototypes-1.10.6.patch" + patch_type: "conan" + patch_description: "Fix missing function prototypes" + - patch_file: "patches/conanize-link-szip-1.10.5+.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + "1.10.5": + - patch_file: "patches/fix-missing-function-prototypes-1.10.5+.patch" + patch_type: "conan" + patch_description: "Fix missing function prototypes" + - patch_file: "patches/conanize-link-szip-1.10.5+.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + - patch_file: "patches/mingw-cmake-size-type-checks-1.10.5.patch" + patch_type: "conan" + patch_description: "mingw cmake size type checks" + - patch_file: "patches/mingw-fix-prefix-lib.patch" + patch_type: "conan" + patch_description: "mingw fix prefix lib" + - patch_file: "patches/mingw-unused-ellipses.patch" + patch_type: "conan" + patch_description: "mingw unused ellipses" + "1.8.21": + - patch_file: "patches/conanize-link-szip-1.8.21.patch" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" + - patch_file: "patches/mingw-cmake-size-type-checks-1.8.21.patch" + patch_type: "conan" + patch_description: "mingw cmake size type checks" + - patch_file: "patches/mingw-fix-prefix-lib.patch" + patch_type: "conan" + patch_description: "mingw fix prefix lib" diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py new file mode 100644 index 0000000000000..e4e17863639bf --- /dev/null +++ b/recipes/hdf5/all/conanfile.py @@ -0,0 +1,300 @@ +import os +import textwrap + +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.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 + +required_conan_version = ">=1.54.0" + + +class Hdf5Conan(ConanFile): + name = "hdf5" + description = "HDF5 is a data model, library, and file format for storing and managing data." + license = "BSD-3-Clause" + topics = "hdf", "data" + homepage = "https://portal.hdfgroup.org/display/HDF5/HDF5" + 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], + "enable_cxx": [True, False], + "hl": [True, False], + "threadsafe": [True, False], + "with_zlib": [True, False], + "szip_support": [None, "with_libaec", "with_szip"], + "szip_encoding": [True, False], + "parallel": [True, False], + "enable_unsupported": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_cxx": True, + "hl": True, + "threadsafe": False, + "with_zlib": True, + "szip_support": None, + "szip_encoding": False, + "parallel": False, + "enable_unsupported": False + } + + @property + def _min_cppstd(self): + if Version(self.version) < "1.14.0": + return "98" + return "11" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.enable_cxx: + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if (not self.options.enable_unsupported and (self.options.enable_cxx or self.options.hl))\ + or (self.settings.os == "Windows" and not self.options.shared): + del self.options.threadsafe + if not bool(self.options.szip_support): + del self.options.szip_encoding + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.szip_support == "with_libaec": + self.requires("libaec/1.0.6") + elif self.options.szip_support == "with_szip": + self.requires("szip/2.1.1") + if self.options.parallel: + 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") + if self.options.get_safe("threadsafe", False): + raise ConanInvalidConfiguration("Parallel and Threadsafe options are mutually exclusive, forcefully allow with enable_unsupported=True") + if self.options.szip_support == "with_szip" and \ + self.options.szip_encoding and \ + not self.dependencies["szip"].options.enable_encoding: + raise ConanInvalidConfiguration("encoding must be enabled in szip dependency (szip:enable_encoding=True)") + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def build_requirements(self): + if Version(self.version) >= "1.14.0": + self.tool_requires("cmake/[>=3.18 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _inject_stdlib_flag(self, tc): + if self.settings.os == "Linux" and self.settings.compiler == "clang": + cpp_stdlib = f" -stdlib={self.settings.compiler.libcxx}".rstrip("1") # strip 11 from stdlibc++11 + tc.variables["CMAKE_CXX_FLAGS"] = tc.variables.get("CMAKE_CXX_FLAGS", "") + cpp_stdlib + return tc + + def generate(self): + cmakedeps = CMakeDeps(self) + cmakedeps.generate() + + tc = CMakeToolchain(self) + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + if self.settings.get_safe("compiler.libcxx"): + tc = self._inject_stdlib_flag(tc) + if self.options.szip_support == "with_libaec": + tc.variables["USE_LIBAEC"] = True + tc.variables["HDF5_EXTERNALLY_CONFIGURED"] = True + tc.variables["HDF5_EXTERNAL_LIB_PREFIX"] = "" + tc.variables["HDF5_USE_FOLDERS"] = False + tc.variables["HDF5_NO_PACKAGES"] = True + tc.variables["ALLOW_UNSUPPORTED"] = False + if Version(self.version) >= "1.10.6": + tc.variables["ONLY_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_STATIC_EXECS"] = False + tc.variables["HDF5_ENABLE_COVERAGE"] = False + tc.variables["HDF5_ENABLE_USING_MEMCHECKER"] = False + if Version(self.version) >= "1.10.0": + tc.variables["HDF5_MEMORY_ALLOC_SANITY_CHECK"] = False + if Version(self.version) >= "1.10.5": + tc.variables["HDF5_ENABLE_PREADWRITE"] = True + tc.variables["HDF5_ENABLE_DEPRECATED_SYMBOLS"] = True + tc.variables["HDF5_BUILD_GENERATORS"] = False + tc.variables["HDF5_ENABLE_TRACE"] = False + if self.settings.build_type == "Debug": + tc.variables["HDF5_ENABLE_INSTRUMENT"] = False # Option? + tc.variables["HDF5_ENABLE_PARALLEL"] = self.options.parallel + tc.variables["HDF5_ENABLE_Z_LIB_SUPPORT"] = self.options.with_zlib + tc.variables["HDF5_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) + tc.variables["HDF5_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding", False) + tc.variables["HDF5_PACKAGE_EXTLIBS"] = False + tc.variables["HDF5_ENABLE_THREADSAFE"] = self.options.get_safe("threadsafe", False) + tc.variables["HDF5_ENABLE_DEBUG_APIS"] = False # Option? + tc.variables["BUILD_TESTING"] = False + + tc.variables["HDF5_INSTALL_INCLUDE_DIR"] = "include/hdf5" + + tc.variables["HDF5_BUILD_TOOLS"] = False + tc.variables["HDF5_BUILD_EXAMPLES"] = False + tc.variables["HDF5_BUILD_HL_LIB"] = self.options.hl + tc.variables["HDF5_BUILD_FORTRAN"] = False + tc.variables["HDF5_BUILD_CPP_LIB"] = self.options.enable_cxx + if Version(self.version) >= "1.10.0": + tc.variables["HDF5_BUILD_JAVA"] = False + tc.variables["ALLOW_UNSUPPORTED"] = self.options.enable_unsupported + tc.generate() + + def build(self): + apply_conandata_patches(self) + # Do not force PIC + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set (CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _components(self): + hdf5_requirements = [] + if self.options.with_zlib: + hdf5_requirements.append("zlib::zlib") + if self.options.szip_support == "with_libaec": + hdf5_requirements.append("libaec::libaec") + elif self.options.szip_support == "with_szip": + hdf5_requirements.append("szip::szip") + if self.options.parallel: + hdf5_requirements.append("openmpi::openmpi") + + return { + "hdf5_c": {"component": "C", "alias_target": "hdf5", "requirements": hdf5_requirements}, + "hdf5_hl": {"component": "HL", "alias_target": "hdf5_hl", "requirements": ["hdf5_c"]}, + "hdf5_cpp": {"component": "CXX", "alias_target": "hdf5_cpp", "requirements": ["hdf5_c"]}, + "hdf5_hl_cpp": {"component": "HL_CXX", "alias_target": "hdf5_hl_cpp", "requirements": ["hdf5_c", "hdf5_cpp", "hdf5_hl"]}, + } + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + + # add the additional hdf5_hl_cxx target when both CXX and HL components are specified + content += textwrap.dedent("""\ + if(TARGET HDF5::HL AND TARGET HDF5::CXX AND NOT TARGET hdf5::hdf5_hl_cpp) + add_library(hdf5::hdf5_hl_cpp INTERFACE IMPORTED) + set_property(TARGET hdf5::hdf5_hl_cpp PROPERTY INTERFACE_LINK_LIBRARIES HDF5::HL_CXX) + endif() + """) + save(self, module_file, content) + + def _create_cmake_module_variables(self, module_file, is_parallel): + content = "set(HDF5_IS_PARALLEL {})".format("ON" if is_parallel else "OFF") + save(self, module_file, content) + + @property + def _module_targets_file_rel_path(self): + return os.path.join("lib", "cmake", + f"conan-official-{self.name}-targets.cmake") + + @property + def _module_variables_file_rel_path(self): + return os.path.join("lib", "cmake", + f"conan-official-{self.name}-variables.cmake") + + 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")) + rm(self, "libhdf5.settings", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + # remove extra libs... building 1.8.21 as shared also outputs static libs on Linux. + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + + # Mimic the official CMake FindHDF5 targets. HDF5::HDF5 refers to the global target as per conan, + # but component targets have a lower case namespace prefix. hdf5::hdf5 refers to the C library only + components = self._components() + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_targets_file_rel_path), + {f"hdf5::{component['alias_target']}": f"HDF5::{component['component']}" for component in components.values()} + ) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_variables_file_rel_path), + self.options.get_safe("parallel", False) + ) + + def package_info(self): + def add_component(component_name, component, alias_target, requirements): + def _config_libname(lib): + if self.settings.os == "Windows" and self.settings.compiler != "gcc" and not self.options.shared: + lib = "lib" + lib + if self.settings.build_type == "Debug": + debug_postfix = "_D" if self.settings.os == "Windows" else "_debug" + return lib + debug_postfix + # See config/cmake_ext_mod/HDFMacros.cmake + return lib + + self.cpp_info.components[component_name].set_property("cmake_target_name", f"hdf5::{alias_target}") + self.cpp_info.components[component_name].set_property("pkg_config_name", alias_target) + self.cpp_info.components[component_name].libs = [_config_libname(alias_target)] + self.cpp_info.components[component_name].requires = requirements + self.cpp_info.components[component_name].includedirs.append(os.path.join("include", "hdf5")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components[component_name].names["cmake_find_package"] = component + self.cpp_info.components[component_name].names["cmake_find_package_multi"] = component + self.cpp_info.components[component_name].build_modules["cmake_find_package"] = [self._module_targets_file_rel_path, self._module_variables_file_rel_path] + self.cpp_info.components[component_name].build_modules["cmake_find_package_multi"] = [self._module_targets_file_rel_path, self._module_variables_file_rel_path] + + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "HDF5") + self.cpp_info.set_property("cmake_target_name", "HDF5::HDF5") + self.cpp_info.set_property("pkg_config_name", "hdf5-all-do-not-use") # to avoid conflict with hdf5_c component + self.cpp_info.set_property("cmake_build_modules", [self._module_variables_file_rel_path]) + + components = self._components() + add_component("hdf5_c", **components["hdf5_c"]) + self.cpp_info.components["hdf5_c"].includedirs.append(os.path.join("include", "hdf5")) + if self.settings.os == "Linux": + self.cpp_info.components["hdf5_c"].system_libs.extend(["dl", "m"]) + if self.options.get_safe("threadsafe"): + self.cpp_info.components["hdf5_c"].system_libs.append("pthread") + + if self.options.shared: + self.cpp_info.components["hdf5_c"].defines.append("H5_BUILT_AS_DYNAMIC_LIB") + if self.options.get_safe("enable_cxx"): + add_component("hdf5_cpp", **components["hdf5_cpp"]) + if self.options.get_safe("hl"): + add_component("hdf5_hl", **components["hdf5_hl"]) + if self.options.get_safe("enable_cxx"): + add_component("hdf5_hl_cpp", **components["hdf5_hl_cpp"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "HDF5" + self.cpp_info.names["cmake_find_package_multi"] = "HDF5" diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch new file mode 100644 index 0000000000000..d81778f11d3b3 --- /dev/null +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch @@ -0,0 +1,37 @@ +--- a/CMakeFilters.cmake ++++ b/CMakeFilters.cmake +@@ -52,10 +52,10 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif () ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -102,10 +102,15 @@ + if (NOT SZIP_USE_EXTERNAL) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) +- find_package (SZIP) # Legacy find +- if (SZIP_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) +- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) ++ find_package (szip CONFIG REQUIRED) ++ endif () ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-static) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch new file mode 100644 index 0000000000000..1cdae1d205cdc --- /dev/null +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake +index 725390b31b..085b18051e 100644 +--- a/CMakeFilters.cmake ++++ b/CMakeFilters.cmake +@@ -63,9 +62,9 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif () ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -113,19 +112,21 @@ + if (NOT SZIP_USE_EXTERNAL) + set(SZIP_FOUND FALSE) + if (USE_LIBAEC) +- set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC}) +- find_package (libaec 1.0.5 CONFIG) +- if (SZIP_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) +- endif () ++ find_package (libaec CONFIG REQUIRED) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} libaec::libaec) ++ set (SZIP_FOUND TRUE) + endif () + + if (NOT SZIP_FOUND) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) + find_package (SZIP) # Legacy find +- if (SZIP_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) ++ endif () ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.14.0+.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.14.0+.patch new file mode 100644 index 0000000000000..b7c286ec1ccf2 --- /dev/null +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.14.0+.patch @@ -0,0 +1,45 @@ +diff -u a/CMakeFilters.cmake b/CMakeFilters.cmake +--- a/CMakeFilters.cmake 2023-01-04 22:29:45.875695757 +0100 ++++ b/CMakeFilters.cmake 2023-01-04 22:37:15.356762199 +0100 +@@ -59,9 +59,9 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif() ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -105,20 +105,20 @@ + if (NOT SZIP_USE_EXTERNAL) + set(SZIP_FOUND FALSE) + if (USE_LIBAEC) +- set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC}) +- find_package (libaec 1.0.5 CONFIG) +- if (SZIP_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) +- endif () ++ find_package (libaec CONFIG REQUIRED) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) ++ set (SZIP_FOUND TRUE) + endif () + + if (NOT SZIP_FOUND) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) + find_package (SZIP) # Legacy find +- if (SZIP_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) +- endif () ++ endif() ++ if (TARGET szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch new file mode 100644 index 0000000000000..44cd11379d7b8 --- /dev/null +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch @@ -0,0 +1,37 @@ +--- a/CMakeFilters.cmake ++++ b/CMakeFilters.cmake +@@ -44,10 +44,10 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif () ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -94,10 +94,15 @@ + if (NOT SZIP_USE_EXTERNAL) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) +- find_package (SZIP) # Legacy find +- if (SZIP_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) +- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) ++ find_package (szip CONFIG REQUIRED) ++ endif () ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-static) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.5+.patch b/recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.5+.patch new file mode 100644 index 0000000000000..5ef02437673c3 --- /dev/null +++ b/recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.5+.patch @@ -0,0 +1,34 @@ +diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c +index 9339b3df6c..052c296ac1 100644 +--- a/src/H5Fsuper.c ++++ b/src/H5Fsuper.c +@@ -54,6 +54,7 @@ + /********************/ + static herr_t H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr); + static herr_t H5F__update_super_ext_driver_msg(H5F_t *f); ++herr_t H5O__fsinfo_set_version(H5F_t *f, H5O_fsinfo_t *fsinfo); + + + /*********************/ +diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c +index 33ed787440..b8e1af55ce 100644 +--- a/src/H5Odeprec.c ++++ b/src/H5Odeprec.c +@@ -54,6 +54,17 @@ + /********************/ + /* Local Prototypes */ + /********************/ ++herr_t ++H5CX_set_apl(hid_t *, const H5P_libclass_t *, ++ hid_t ++#ifndef H5_HAVE_PARALLEL ++H5_ATTR_UNUSED ++#endif /* H5_HAVE_PARALLEL */ ++, hbool_t ++#ifndef H5_HAVE_PARALLEL ++ H5_ATTR_UNUSED ++#endif /* H5_HAVE_PARALLEL */ ++); + + + /*********************/ diff --git a/recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.6.patch b/recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.6.patch new file mode 100644 index 0000000000000..e709d0b0d06b5 --- /dev/null +++ b/recipes/hdf5/all/patches/fix-missing-function-prototypes-1.10.6.patch @@ -0,0 +1,24 @@ +diff --git a/src/H5Oint.c b/src/H5Oint.c +index 543637c127..c8a6131a34 100644 +--- a/src/H5Oint.c ++++ b/src/H5Oint.c +@@ -82,6 +82,7 @@ static herr_t H5O__free_visit_visited(void *item, void *key, + static herr_t H5O__visit_cb(hid_t group, const char *name, const H5L_info_t *linfo, + void *_udata); + static const H5O_obj_class_t *H5O__obj_class_real(const H5O_t *oh); ++H5_DLL herr_t H5CX_get_ohdr_flags(uint8_t *ohdr_flags); + + + /*********************/ +diff --git a/src/H5Rint.c b/src/H5Rint.c +index 159bccac34..b48d2a706d 100644 +--- a/src/H5Rint.c ++++ b/src/H5Rint.c +@@ -46,6 +46,7 @@ + /********************/ + /* Local Prototypes */ + /********************/ ++H5_DLL herr_t H5CX_set_libver_bounds(H5F_t *f); + + /*********************/ + /* Package Variables */ diff --git a/recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.10.5.patch b/recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.10.5.patch new file mode 100644 index 0000000000000..ed647a7164031 --- /dev/null +++ b/recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.10.5.patch @@ -0,0 +1,29 @@ +--- a/config/cmake_ext_mod/ConfigureChecks.cmake ++++ b/config/cmake_ext_mod/ConfigureChecks.cmake +@@ -405,7 +405,7 @@ if (NOT APPLE) + if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) + endif () +- if (NOT WINDOWS) ++ if (MINGW OR NOT WINDOWS) + HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) + endif () + endif () +@@ -429,7 +429,7 @@ else () + HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) + endif () + +-if (NOT WINDOWS) ++if (MINGW OR NOT WINDOWS) + #----------------------------------------------------------------------------- + # Check if the dev_t type is a scalar type + #----------------------------------------------------------------------------- +@@ -558,7 +558,7 @@ endif () + #----------------------------------------------------------------------------- + # Check a bunch of other functions + #----------------------------------------------------------------------------- +-if (NOT WINDOWS) ++if (MINGW OR NOT WINDOWS) + foreach (test + HAVE_ATTRIBUTE + HAVE_C99_FUNC diff --git a/recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.8.21.patch b/recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.8.21.patch new file mode 100644 index 0000000000000..0c74663b1e6ca --- /dev/null +++ b/recipes/hdf5/all/patches/mingw-cmake-size-type-checks-1.8.21.patch @@ -0,0 +1,29 @@ +--- a/config/cmake_ext_mod/ConfigureChecks.cmake ++++ b/config/cmake_ext_mod/ConfigureChecks.cmake +@@ -420,7 +420,7 @@ if (NOT APPLE) + if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) + endif () +- if (NOT WINDOWS) ++ if (MINGW OR NOT WINDOWS) + HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) + endif () + endif () +@@ -444,7 +444,7 @@ else () + HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) + endif () + +-if (NOT WINDOWS) ++if (MINGW OR NOT WINDOWS) + #----------------------------------------------------------------------------- + # Check if the dev_t type is a scalar type + #----------------------------------------------------------------------------- +@@ -571,7 +571,7 @@ endif () + #----------------------------------------------------------------------------- + # Check a bunch of other functions + #----------------------------------------------------------------------------- +-if (NOT WINDOWS) ++if (MINGW OR NOT WINDOWS) + foreach (test + HAVE_ATTRIBUTE + HAVE_C99_FUNC diff --git a/recipes/hdf5/all/patches/mingw-fix-prefix-lib.patch b/recipes/hdf5/all/patches/mingw-fix-prefix-lib.patch new file mode 100644 index 0000000000000..abb6a0eb71723 --- /dev/null +++ b/recipes/hdf5/all/patches/mingw-fix-prefix-lib.patch @@ -0,0 +1,11 @@ +--- a/config/cmake_ext_mod/HDFMacros.cmake ++++ b/config/cmake_ext_mod/HDFMacros.cmake +@@ -117,7 +117,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}") + else () +- if (WIN32) ++ if (WIN32 AND NOT MINGW) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}") + else () diff --git a/recipes/hdf5/all/patches/mingw-unused-ellipses.patch b/recipes/hdf5/all/patches/mingw-unused-ellipses.patch new file mode 100644 index 0000000000000..52926db5dff03 --- /dev/null +++ b/recipes/hdf5/all/patches/mingw-unused-ellipses.patch @@ -0,0 +1,16 @@ +--- a/src/H5win32defs.h ++++ b/src/H5win32defs.h +@@ -54,7 +54,12 @@ typedef __int64 h5_stat_size_t; + * Also note that the variadic macro is using a VC++ extension + * where the comma is dropped if nothing is passed to the ellipsis. + */ +-#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__) ++#ifdef H5_HAVE_MINGW ++ /* GCC/MINGW uses a different extension to handle unused ellipses */ ++ #define HDopen(S,F,...) _open(S, F | _O_BINARY, ##__VA_ARGS__) ++#else ++ #define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__) ++#endif + #define HDread(F,M,Z) _read(F,M,Z) + #define HDrmdir(S) _rmdir(S) + #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2)) diff --git a/recipes/hdf5/all/test_package/CMakeLists.txt b/recipes/hdf5/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a613c94b64b96 --- /dev/null +++ b/recipes/hdf5/all/test_package/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) + +set(HDF5_COMPONENTS C) +if (HDF5_HL) + list(APPEND HDF5_COMPONENTS HL) +endif() +if (HDF5_CXX) + list(APPEND HDF5_COMPONENTS CXX) +endif() +find_package(HDF5 COMPONENTS ${HDF5_COMPONENTS}) + +add_executable(${PROJECT_NAME} test_package.c) +if(HDF5_CXX) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() + +if (TARGET hdf5::hdf5_cpp) + target_compile_definitions(${PROJECT_NAME} PRIVATE CONAN_HDF5_CXX) + target_sources(${PROJECT_NAME} PRIVATE test_package.cpp) + target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5_cpp) +elseif (HDF5_IS_PARALLEL) + target_compile_definitions(${PROJECT_NAME} PRIVATE CONAN_HDF5_PARALLEL) + target_sources(${PROJECT_NAME} PRIVATE test_parallel.c) + target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5) +endif() diff --git a/recipes/hdf5/all/test_package/conanfile.py b/recipes/hdf5/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9ff0574745609 --- /dev/null +++ b/recipes/hdf5/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables.update({ + "HDF5_CXX": self.dependencies["hdf5"].options.enable_cxx, + "HDF5_HL": self.dependencies["hdf5"].options.hl, + }) + 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/hdf5/all/test_package/test_package.c b/recipes/hdf5/all/test_package/test_package.c new file mode 100644 index 0000000000000..acc23d1bd8c5f --- /dev/null +++ b/recipes/hdf5/all/test_package/test_package.c @@ -0,0 +1,50 @@ +#include "hdf5.h" +#define FILE "dset.h5" + +extern void test_cxx_api(); +extern void test_parallel(); + +void test_c_api() +{ + + hid_t file_id, dataset_id, dataspace_id; /* identifiers */ + hsize_t dims[2]; + herr_t status; + + /* Create a new file using default properties. */ + file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Create the data space for the dataset. */ + dims[0] = 4; + dims[1] = 6; + dataspace_id = H5Screate_simple(2, dims, NULL); + + /* Create the dataset. */ + dataset_id = + H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* End access to the dataset and release resources used by it. */ + status = H5Dclose(dataset_id); + + /* Terminate access to the data space. */ + status = H5Sclose(dataspace_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} + +int main(int argc, char **argv) +{ + printf("Testing C API\n"); + test_c_api(); + #ifdef CONAN_HDF5_CXX + printf("Testing C++ API\n"); + test_cxx_api(); + #endif + #ifdef CONAN_HDF5_PARALLEL + printf("Testing HDF5 Parallel\n"); + test_parallel(argc, argv); + #endif + + return 0; +} diff --git a/recipes/hdf5/all/test_package/test_package.cpp b/recipes/hdf5/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef3ec22b3871e --- /dev/null +++ b/recipes/hdf5/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +extern "C" void test_cxx_api() +{ + hsize_t dimensions[] = {4, 6}; + H5::H5File file("dataset.h5", H5F_ACC_TRUNC); + H5::DataSpace dataspace(2, dimensions); + H5::DataSet dataset = file.createDataSet("dataset", H5::PredType::STD_I32BE, dataspace); +} diff --git a/recipes/hdf5/all/test_package/test_parallel.c b/recipes/hdf5/all/test_package/test_parallel.c new file mode 100644 index 0000000000000..557e7c0f80372 --- /dev/null +++ b/recipes/hdf5/all/test_package/test_parallel.c @@ -0,0 +1,99 @@ +/* + * This example writes data to the HDF5 file. + * Number of processes is assumed to be 1 or multiples of 2 (up to 8) + */ + +#include "hdf5.h" +#include "stdlib.h" + +#define H5FILE_NAME "SDS.h5" +#define DATASETNAME "IntArray" +#define NX 8 /* dataset dimensions */ +#define NY 5 +#define RANK 2 + +int test_parallel(int argc, char **argv) +{ + /* + * HDF5 APIs definitions + */ + hid_t file_id, dset_id; /* file and dataset identifiers */ + hid_t filespace; /* file and memory dataspace identifiers */ + hsize_t dimsf[] = {NX, NY}; /* dataset dimensions */ + int *data; /* pointer to data buffer to write */ + hid_t plist_id; /* property list identifier */ + int i; + herr_t status; + + /* + * MPI variables + */ + int mpi_size, mpi_rank; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + /* + * Initialize MPI + */ + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + /* + * Initialize data buffer + */ + data = (int *) malloc(sizeof(int)*dimsf[0]*dimsf[1]); + for (i=0; i < dimsf[0]*dimsf[1]; i++) { + data[i] = i; + } + /* + * Set up file access property list with parallel I/O access + */ + plist_id = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fapl_mpio(plist_id, comm, info); + + /* + * Create a new file collectively and release property list identifier. + */ + file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); + H5Pclose(plist_id); + + + /* + * Create the dataspace for the dataset. + */ + filespace = H5Screate_simple(RANK, dimsf, NULL); + + /* + * Create the dataset with default properties and close filespace. + */ + dset_id = H5Dcreate(file_id, DATASETNAME, H5T_NATIVE_INT, filespace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* + * Create property list for collective dataset write. + */ + plist_id = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE); + + /* + * To write dataset independently use + * + * H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_INDEPENDENT); + */ + + status = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + plist_id, data); + free(data); + + /* + * Close/release resources. + */ + H5Dclose(dset_id); + H5Sclose(filespace); + H5Pclose(plist_id); + H5Fclose(file_id); + + MPI_Finalize(); + + return 0; +} diff --git a/recipes/hdf5/all/test_v1_package/CMakeLists.txt b/recipes/hdf5/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..907e42aba8a37 --- /dev/null +++ b/recipes/hdf5/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hdf5/all/test_v1_package/conanfile.py b/recipes/hdf5/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..57bd58e9f46c2 --- /dev/null +++ b/recipes/hdf5/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +import os + +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions.update({ + "HDF5_CXX": self.options["hdf5"].enable_cxx, + "HDF5_HL": self.options["hdf5"].hl, + }) + 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/hdf5/config.yml b/recipes/hdf5/config.yml new file mode 100644 index 0000000000000..6c8040e06da05 --- /dev/null +++ b/recipes/hdf5/config.yml @@ -0,0 +1,15 @@ +versions: + "1.14.0": + folder: all + "1.13.1": + folder: all + "1.12.2": + folder: all + "1.12.0": + folder: all + "1.10.6": + folder: all + "1.10.5": + folder: all + "1.8.21": + folder: all diff --git a/recipes/hdrhistogram-c/all/conandata.yml b/recipes/hdrhistogram-c/all/conandata.yml new file mode 100644 index 0000000000000..ed9d533f37715 --- /dev/null +++ b/recipes/hdrhistogram-c/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.11.6": + url: "https://github.com/HdrHistogram/HdrHistogram_c/archive/0.11.6.tar.gz" + sha256: "b9bb6425d9b0ac5424f6d2286a1295900edab0170d1f50767decb00196785de3" + "0.11.1": + url: "https://github.com/HdrHistogram/HdrHistogram_c/archive/0.11.1.tar.gz" + sha256: "8550071d4ae5c8229448f9b68469d6d42c620cd25111b49c696d00185e5f8329" + "0.11.0": + url: "https://github.com/HdrHistogram/HdrHistogram_c/archive/0.11.0.tar.gz" + sha256: "c00696b3d81776675aa2bc62d3642e31bd8a48cc9619c9bd7d4a78762896e353" +patches: + "0.11.0": + - patch_file: "patches/cmake-install.patch" diff --git a/recipes/hdrhistogram-c/all/conanfile.py b/recipes/hdrhistogram-c/all/conanfile.py new file mode 100644 index 0000000000000..dafe5ff3618bc --- /dev/null +++ b/recipes/hdrhistogram-c/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +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, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class HdrhistogramcConan(ConanFile): + name = "hdrhistogram-c" + license = ("BSD-2-Clause", "CC0-1.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/HdrHistogram/HdrHistogram_c" + description = "'C' port of High Dynamic Range (HDR) Histogram" + topics = ("libraries", "c", "histogram") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HDR_HISTOGRAM_BUILD_PROGRAMS"] = False + tc.variables["HDR_HISTOGRAM_BUILD_SHARED"] = self.options.shared + tc.variables["HDR_HISTOGRAM_INSTALL_SHARED"] = self.options.shared + tc.variables["HDR_HISTOGRAM_BUILD_STATIC"] = not self.options.shared + tc.variables["HDR_HISTOGRAM_INSTALL_STATIC"] = not self.options.shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + target = "hdr_histogram" if self.options.shared else "hdr_histogram_static" + self.cpp_info.set_property("cmake_file_name", "hdr_histogram") + self.cpp_info.set_property("cmake_target_name", f"hdr_histogram::{target}") + if Version(self.version) >= "0.11.6": + self.cpp_info.set_property("pkg_config_name", "hdr_histogram") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["hdr_histrogram"].libs = collect_libs(self) + self.cpp_info.components["hdr_histrogram"].includedirs.append(os.path.join("include", "hdr")) + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["hdr_histrogram"].system_libs = ["m", "rt", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["hdr_histrogram"].system_libs = ["ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "hdr_histogram" + self.cpp_info.names["cmake_find_package_multi"] = "hdr_histogram" + self.cpp_info.components["hdr_histrogram"].names["cmake_find_package"] = target + self.cpp_info.components["hdr_histrogram"].names["cmake_find_package_multi"] = target + self.cpp_info.components["hdr_histrogram"].set_property("cmake_target_name", f"hdr_histogram::{target}") + self.cpp_info.components["hdr_histrogram"].requires = ["zlib::zlib"] diff --git a/recipes/hdrhistogram-c/all/patches/cmake-install.patch b/recipes/hdrhistogram-c/all/patches/cmake-install.patch new file mode 100644 index 0000000000000..6dc559335bb5a --- /dev/null +++ b/recipes/hdrhistogram-c/all/patches/cmake-install.patch @@ -0,0 +1,13 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -48,7 +48,9 @@ function(hdr_histogram_add_library NAME LIBRARY_TYPE DO_INSTALL) + install( + TARGETS ${NAME} + EXPORT ${PROJECT_NAME}-targets +- DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + endfunction() + diff --git a/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt b/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..43cecb9cf0752 --- /dev/null +++ b/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(hdr_histogram REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET hdr_histogram::hdr_histogram_static) + target_link_libraries(${PROJECT_NAME} PRIVATE hdr_histogram::hdr_histogram_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE hdr_histogram::hdr_histogram) +endif() diff --git a/recipes/hdrhistogram-c/all/test_package/conanfile.py b/recipes/hdrhistogram-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/hdrhistogram-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/hdrhistogram-c/all/test_package/test_package.c b/recipes/hdrhistogram-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..6e65a4000654a --- /dev/null +++ b/recipes/hdrhistogram-c/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include + +int main() +{ + struct hdr_histogram* h = NULL; + + if(!hdr_alloc(1, 2, &h)) + { + hdr_percentiles_print(h, stdout, 5, 1.0, CLASSIC); + } + + return 0; +} diff --git a/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt b/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/hdrhistogram-c/all/test_v1_package/conanfile.py b/recipes/hdrhistogram-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hdrhistogram-c/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/hdrhistogram-c/config.yml b/recipes/hdrhistogram-c/config.yml new file mode 100644 index 0000000000000..7e06391938f78 --- /dev/null +++ b/recipes/hdrhistogram-c/config.yml @@ -0,0 +1,7 @@ +versions: + "0.11.6": + folder: all + "0.11.1": + folder: all + "0.11.0": + folder: all diff --git a/recipes/heatshrink/all/CMakeLists.txt b/recipes/heatshrink/all/CMakeLists.txt new file mode 100644 index 0000000000000..e739fade74253 --- /dev/null +++ b/recipes/heatshrink/all/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.8) +project(heatshrink LANGUAGES C) + +add_library(heatshrink + ${HEATSHRINK_SRC_DIR}/heatshrink_decoder.c + ${HEATSHRINK_SRC_DIR}/heatshrink_encoder.c +) +target_include_directories(heatshrink PUBLIC ${HEATSHRINK_SRC_DIR}) +set_target_properties(heatshrink PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_compile_features(heatshrink PRIVATE c_std_99) + +include(GNUInstallDirs) +install( + FILES + ${HEATSHRINK_SRC_DIR}/heatshrink_common.h + ${HEATSHRINK_SRC_DIR}/heatshrink_config.h + ${HEATSHRINK_SRC_DIR}/heatshrink_decoder.h + ${HEATSHRINK_SRC_DIR}/heatshrink_encoder.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +install( + TARGETS heatshrink + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/recipes/heatshrink/all/conandata.yml b/recipes/heatshrink/all/conandata.yml new file mode 100644 index 0000000000000..520974039dd7a --- /dev/null +++ b/recipes/heatshrink/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.1": + url: "https://github.com/atomicobject/heatshrink/archive/refs/tags/v0.4.1.tar.gz" + sha256: "7529a1c8ac501191ad470b166773364e66d9926aad632690c72c63a1dea7e9a6" diff --git a/recipes/heatshrink/all/conanfile.py b/recipes/heatshrink/all/conanfile.py new file mode 100644 index 0000000000000..06cb55ed511e8 --- /dev/null +++ b/recipes/heatshrink/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file +import os + +required_conan_version = ">=1.53.0" + + +class HeatshrinkConan(ConanFile): + name = "heatshrink" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + description = "data compression library for embedded/real-time systems" + topics = ("compression", "embedded", "realtime") + homepage = "https://github.com/atomicobject/heatshrink" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [False, True], + "fPIC": [True, False], + "dynamic_alloc": [True, False], + "debug_log": [True, False], + "use_index": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "dynamic_alloc": True, + "debug_log": False, + "use_index": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.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["HEATSHRINK_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def _patch_sources(self): + config_file = os.path.join(self.source_folder, "heatshrink_config.h") + if not self.options.dynamic_alloc: + replace_in_file(self, config_file, + "#define HEATSHRINK_DYNAMIC_ALLOC 1", + "#define HEATSHRINK_DYNAMIC_ALLOC 0") + if self.options.debug_log: + replace_in_file(self, config_file, + "#define HEATSHRINK_DEBUGGING_LOGS 0", + "#define HEATSHRINK_DEBUGGING_LOGS 1") + if not self.options.use_index: + replace_in_file(self, config_file, + "#define HEATSHRINK_USE_INDEX 1", + "#define HEATSHRINK_USE_INDEX 0") + + def build(self): + self._patch_sources() + 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 = ["heatshrink"] diff --git a/recipes/heatshrink/all/test_package/CMakeLists.txt b/recipes/heatshrink/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ac68508859a4c --- /dev/null +++ b/recipes/heatshrink/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(heatshrink REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE heatshrink::heatshrink) diff --git a/recipes/heatshrink/all/test_package/conanfile.py b/recipes/heatshrink/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/heatshrink/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/heatshrink/all/test_package/test_package.c b/recipes/heatshrink/all/test_package/test_package.c new file mode 100644 index 0000000000000..0e3338c2dbbc8 --- /dev/null +++ b/recipes/heatshrink/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include "heatshrink_encoder.h" + +int main() { +#if HEATSHRINK_DYNAMIC_ALLOC + heatshrink_encoder *hse = heatshrink_encoder_alloc(8, 7); + heatshrink_encoder_reset(hse); + heatshrink_encoder_free(hse); +#else + heatshrink_encoder hse; + heatshrink_encoder_reset(&hse); +#endif + + return 0; +} diff --git a/recipes/heatshrink/all/test_v1_package/CMakeLists.txt b/recipes/heatshrink/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/heatshrink/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/heatshrink/all/test_v1_package/conanfile.py b/recipes/heatshrink/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/heatshrink/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/heatshrink/config.yml b/recipes/heatshrink/config.yml new file mode 100644 index 0000000000000..3a9d5538921fc --- /dev/null +++ b/recipes/heatshrink/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.1": + folder: all diff --git a/recipes/hedley/all/conandata.yml b/recipes/hedley/all/conandata.yml new file mode 100644 index 0000000000000..5c0e6cb34eb6a --- /dev/null +++ b/recipes/hedley/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "15": + url: "https://github.com/nemequ/hedley/archive/refs/tags/v15.tar.gz" + sha256: "e91c71b58f59d08c7b8289be8f687866863d934dfaa528e4be30b178139ae863" diff --git a/recipes/hedley/all/conanfile.py b/recipes/hedley/all/conanfile.py new file mode 100644 index 0000000000000..835a13a80a59b --- /dev/null +++ b/recipes/hedley/all/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class HedleyConan(ConanFile): + name = "hedley" + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://nemequ.github.io/hedley/" + description = "A C/C++ header to help move #ifdefs out of your code" + topics = ("header", "header-only", "preprocessor", "#ifdef", "cross-platform") + 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) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/hedley/all/test_package/CMakeLists.txt b/recipes/hedley/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6cccdaf4798b6 --- /dev/null +++ b/recipes/hedley/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(hedley REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hedley::hedley) diff --git a/recipes/hedley/all/test_package/conanfile.py b/recipes/hedley/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/hedley/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/hedley/all/test_package/test_package.cpp b/recipes/hedley/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..05e99beaaa27b --- /dev/null +++ b/recipes/hedley/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "hedley.h" +#include + +int main() { + std::cout << "HEDLEY_VERSION: " << HEDLEY_VERSION << std::endl; + return 0; +} diff --git a/recipes/hedley/all/test_v1_package/CMakeLists.txt b/recipes/hedley/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/hedley/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hedley/all/test_v1_package/conanfile.py b/recipes/hedley/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hedley/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/hedley/config.yml b/recipes/hedley/config.yml new file mode 100644 index 0000000000000..f819fab522d8c --- /dev/null +++ b/recipes/hedley/config.yml @@ -0,0 +1,3 @@ +versions: + "15": + folder: all diff --git a/recipes/hexl/all/CMakeLists.txt b/recipes/hexl/all/CMakeLists.txt new file mode 100644 index 0000000000000..8b3b9ef203c08 --- /dev/null +++ b/recipes/hexl/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.13.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/hexl/all/conandata.yml b/recipes/hexl/all/conandata.yml new file mode 100644 index 0000000000000..8ed6d6d348eaa --- /dev/null +++ b/recipes/hexl/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.2.4": + url: "https://github.com/intel/hexl/archive/refs/tags/v1.2.4.tar.gz" + sha256: "f91dd158e3faa8795035f618286cdef7dacbf488fd0ba4f44409880997b4549f" +patches: + "1.2.4": + - patch_file: "patches/fix-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/hexl/all/conanfile.py b/recipes/hexl/all/conanfile.py new file mode 100644 index 0000000000000..820c3b5030b0a --- /dev/null +++ b/recipes/hexl/all/conanfile.py @@ -0,0 +1,158 @@ +from conans import CMake, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, rmdir +from conan.tools.scm import Version +from conan.tools.build import cross_building + +import os + +required_conan_version = ">=1.43.0" + +class HexlConan(ConanFile): + name = "hexl" + license = "Apache-2.0" + homepage = "https://github.com/intel/hexl" + url = "https://github.com/conan-io/conan-center-index" + description = "Intel Homomorphic Encryption (HE) Acceleration Library" + topics = ("homomorphic", "encryption", "privacy") + settings = "os", "compiler", "build_type", "arch" + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake", "cmake_find_package" + + _cmake = None + + options = { + "shared": [True, False], + "fPIC": [True, False], + "experimental": [True, False], + "fpga_compatibility_dyadic_multiply": [True, False], + "fpga_compatibility_keyswitch": [True, False] + } + + default_options = { + "shared": False, + "fPIC": True, + "experimental": False, + "fpga_compatibility_dyadic_multiply": False, + "fpga_compatibility_keyswitch": False + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build_requirements(self): + self.build_requires("cmake/3.22.0") + + def requirements(self): + self.requires("cpu_features/0.7.0") + + if self.settings.build_type == "Debug": + self.requires("easyloggingpp/9.97.0") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "clang": "7", + "apple-clang": "11", + } + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("Hexl only supports x86 architecture") + + if self.options.shared and is_msvc(self): + raise ConanInvalidConfiguration("Hexl only supports static linking with msvc") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self); + + + self._cmake.definitions["HEXL_BENCHMARK"] = False + self._cmake.definitions["HEXL_TESTING"] = False + self._cmake.definitions["HEXL_EXPERIMENTAL"] = self.options.experimental + + + if self.options.fpga_compatibility_dyadic_multiply and self.options.fpga_compatibility_keyswitch: + self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 3 + elif self.options.fpga_compatibility_dyadic_multiply: + self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 1 + elif self.options.fpga_compatibility_keyswitch: + self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 2 + else: + self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 0 + + self._cmake.definitions["HEXL_SHARED_LIB"] = self.options.shared + self._cmake.definitions["HEXL_CROSS_COMPILED"] = cross_building(self) + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + 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.set_property("cmake_file_name", "Hexl") + # TODO: Remove in Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "Hexl" + self.cpp_info.names["cmake_find_package_multi"] = "Hexl" + + if self.settings.build_type == "Debug": + if not is_msvc(self): + self.cpp_info.components["Hexl"].libs = ["hexl_debug"] + else: + self.cpp_info.components["Hexl"].libs = ["hexl"] + + self.cpp_info.components["Hexl"].requires.append("easyloggingpp::easyloggingpp") + else: + self.cpp_info.components["Hexl"].libs = ["hexl"] + + self.cpp_info.components["Hexl"].names["cmake_find_package"] = "hexl" + self.cpp_info.components["Hexl"].names["cmake_find_package_multi"] = "hexl" + self.cpp_info.components["Hexl"].set_property("cmake_target_name", "Hexl::hexl") + self.cpp_info.components["Hexl"].set_property("pkg_config_name", "hexl") + self.cpp_info.components["Hexl"].requires.append("cpu_features::libcpu_features") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["Hexl"].system_libs = ["pthread", "m"] + diff --git a/recipes/hexl/all/patches/fix-cmake.patch b/recipes/hexl/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..8aeb45bf1b421 --- /dev/null +++ b/recipes/hexl/all/patches/fix-cmake.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1cee76b..0db1f9c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,10 +28,6 @@ if(CMAKE_BUILD_TYPE) + endif() + endif() + +-if(NOT CMAKE_BUILD_TYPE) +- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE) +-endif() +- + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(HEXL_DEBUG ON) + else() +@@ -139,18 +135,12 @@ message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") + #------------------------------------------------------------------------------ + # Third-party code... + #------------------------------------------------------------------------------ +-find_package(CpuFeatures CONFIG) +-if (NOT CpuFeatures_FOUND) +- message(STATUS "CpuFeatures: pre-installed CpuFeatures not found") +- add_subdirectory(cmake/third-party/cpu-features) +-else() +- message(STATUS "CpuFeatures: found") +- add_library(cpu_features ALIAS CpuFeatures::cpu_features) +- get_target_property( +- CpuFeatures_INCLUDE_DIR +- CpuFeatures::cpu_features +- INTERFACE_INCLUDE_DIRECTORIES) +-endif() ++find_package(CpuFeatures REQUIRED) ++add_library(cpu_features ALIAS CpuFeatures::cpu_features) ++get_target_property( ++ CpuFeatures_INCLUDE_DIR ++ CpuFeatures::cpu_features ++ INTERFACE_INCLUDE_DIRECTORIES) + + if (HEXL_TESTING OR HEXL_BENCHMARK OR HEXL_DEBUG) + if(NOT TARGET Threads::Threads) +@@ -168,18 +158,11 @@ if (HEXL_BENCHMARK) + endif() + + if (HEXL_DEBUG) +- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/third-party/easylogging") +- find_package(EASYLOGGINGPP MODULE) +- if (EASYLOGGINGPP_FOUND) +- message(STATUS "easyloggingpp: pre-installed easyloggingpp found") +- get_target_property( +- EASYLOGGINGPP_INCLUDE_DIR +- easyloggingpp +- INTERFACE_INCLUDE_DIRECTORIES) +- else() +- message(STATUS "easyloggingpp: pre-installed easyloggingpp NOT found, building from source") +- add_subdirectory(cmake/third-party/easylogging) +- endif() ++ find_package(easyloggingpp REQUIRED) ++ get_target_property( ++ EASYLOGGINGPP_INCLUDE_DIR ++ easyloggingpp::easyloggingpp ++ INTERFACE_INCLUDE_DIRECTORIES) + endif() + + #------------------------------------------------------------------------------ +diff --git a/hexl/CMakeLists.txt b/hexl/CMakeLists.txt +index 139f17c..6558256 100644 +--- a/hexl/CMakeLists.txt ++++ b/hexl/CMakeLists.txt +@@ -53,7 +53,8 @@ else() + endif() + add_library(HEXL::hexl ALIAS hexl) + +-hexl_add_asan_flag(hexl) ++# Should come from compiler.sanitizer=Address ++# hexl_add_asan_flag(hexl) + + set(HEXL_DEFINES_IN_FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/include/hexl/util/defines.hpp.in) + set(HEXL_DEFINES_FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/include/hexl/util/defines.hpp) +@@ -89,10 +90,15 @@ endif() + + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + target_compile_options(hexl PRIVATE -Wall -Wconversion -Wshadow -pedantic -Wextra +- -Wno-unknown-pragmas -march=native -O3 -fomit-frame-pointer ++ -Wno-unknown-pragmas -O3 -fomit-frame-pointer + -Wno-sign-conversion + -Wno-implicit-int-conversion + ) ++ ++ if(NOT HEXL_CROSS_COMPILED) ++ target_compile_options(hexl PRIVATE -march=native) ++ endif() ++ + # Avoid 3rd-party dependency warnings when including HEXL as a dependency + target_compile_options(hexl PUBLIC + -Wno-unknown-warning +@@ -121,7 +127,7 @@ if (HEXL_SHARED_LIB) + target_link_libraries(hexl PUBLIC easyloggingpp) + # Manually add logging include directory + target_include_directories(hexl +- PUBLIC $> ++ PUBLIC ${EASYLOGGINGPP_INCLUDE_DIR} + ) + endif() + else () +@@ -132,7 +138,7 @@ else () + if (HEXL_DEBUG) + # Manually add logging include directory + target_include_directories(hexl +- PUBLIC $> ++ PUBLIC ${EASYLOGGINGPP_INCLUDE_DIR} + ) + if (EASYLOGGINGPP_FOUND) + target_link_libraries(hexl PRIVATE easyloggingpp) +@@ -152,8 +158,6 @@ else () + PRIVATE $) + endif() + +-install(TARGETS hexl DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- + #------------------------------------------------------------------------------ + # Config export... + #------------------------------------------------------------------------------ diff --git a/recipes/hexl/all/test_package/CMakeLists.txt b/recipes/hexl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf18c1281c79a --- /dev/null +++ b/recipes/hexl/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Hexl COMPONENTS hexl REQUIRED) +add_executable(example example.cpp) +target_link_libraries(example PRIVATE Hexl::hexl) + diff --git a/recipes/hexl/all/test_package/conanfile.py b/recipes/hexl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..417bb10e807de --- /dev/null +++ b/recipes/hexl/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +import os + +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building + + +class HexlTestConan(ConanFile): + settings = "os", "build_type", "arch", "compiler" + generators = "cmake", "cmake_find_package" + + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/hexl/all/test_package/example.cpp b/recipes/hexl/all/test_package/example.cpp new file mode 100644 index 0000000000000..e276d0275eeb4 --- /dev/null +++ b/recipes/hexl/all/test_package/example.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "hexl/hexl.hpp" + +bool CheckEqual(const std::vector& x, + const std::vector& y) { + if (x.size() != y.size()) { + std::cout << "Not equal in size\n"; + return false; + } + uint64_t N = x.size(); + bool is_match = true; + for (size_t i = 0; i < N; ++i) { + if (x[i] != y[i]) { + std::cout << "Not equal at index " << i << "\n"; + is_match = false; + } + } + return is_match; +} + +bool ExampleEltwiseVectorVectorAddMod() { + std::vector op1{1, 2, 3, 4, 5, 6, 7, 8}; + std::vector op2{1, 3, 5, 7, 2, 4, 6, 8}; + uint64_t modulus = 10; + std::vector exp_out{2, 5, 8, 1, 7, 0, 3, 6}; + + intel::hexl::EltwiseAddMod(op1.data(), op1.data(), op2.data(), op1.size(), + modulus); + + return CheckEqual(op1, exp_out); +} + +int main() { + if(ExampleEltwiseVectorVectorAddMod()) + { + return 0; + } + + return -1; +} diff --git a/recipes/hexl/config.yml b/recipes/hexl/config.yml new file mode 100644 index 0000000000000..5c12183246809 --- /dev/null +++ b/recipes/hexl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.4": + folder: all diff --git a/recipes/hffix/all/conandata.yml b/recipes/hffix/all/conandata.yml new file mode 100644 index 0000000000000..63e048eedc787 --- /dev/null +++ b/recipes/hffix/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.1": + url: "https://github.com/jamesdbrock/hffix/archive/refs/tags/v1.1.1.tar.gz" + sha256: "25dcaee8ded3590dd04225bd98909c9d78c8e39c26fb3c9880ec001a35464c07" diff --git a/recipes/hffix/all/conanfile.py b/recipes/hffix/all/conanfile.py new file mode 100644 index 0000000000000..b8be09b23ee81 --- /dev/null +++ b/recipes/hffix/all/conanfile.py @@ -0,0 +1,42 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class HffixConan(ConanFile): + name = "hffix" + description = "Financial Information Exchange Protocol C++ Library" + license = "BSD-2-Clause" + topics = ("fixprotocol", "financial") + homepage = "https://github.com/jamesdbrock/hffix" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/hffix/all/test_package/CMakeLists.txt b/recipes/hffix/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bea843560a088 --- /dev/null +++ b/recipes/hffix/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(hffix REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hffix::hffix) diff --git a/recipes/hffix/all/test_package/conanfile.py b/recipes/hffix/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/hffix/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/hffix/all/test_package/test_package.cpp b/recipes/hffix/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1efe3d51d13ff --- /dev/null +++ b/recipes/hffix/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ +#include + +#include + +int main() { + int seq_send = 1; + + char buffer[1 << 13]; + + // We'll put a FIX Logon message in the buffer. + hffix::message_writer logon(buffer, buffer + sizeof(buffer)); + + logon.push_back_header("FIX.4.2"); // Write BeginString and BodyLength. + + // Logon MsgType. + logon.push_back_string (hffix::tag::MsgType, "A"); + logon.push_back_string (hffix::tag::SenderCompID, "AAAA"); + logon.push_back_string (hffix::tag::TargetCompID, "BBBB"); + logon.push_back_int (hffix::tag::MsgSeqNum, seq_send++); + logon.push_back_timestamp (hffix::tag::SendingTime, 2022, 02, 23, 11, 20, 0); + // No encryption. + logon.push_back_int (hffix::tag::EncryptMethod, 0); + // 10 second heartbeat interval. + logon.push_back_int (hffix::tag::HeartBtInt, 10); + + logon.push_back_trailer(); // write CheckSum. + + // Now the Logon message is written to the buffer. + + // Add a FIX New Order - Single message to the buffer, after the Logon + // message. + hffix::message_writer new_order(logon.message_end(), buffer + sizeof(buffer)); + + new_order.push_back_header("FIX.4.2"); + + // New Order - Single + new_order.push_back_string (hffix::tag::MsgType, "D"); + // Required Standard Header field. + new_order.push_back_string (hffix::tag::SenderCompID, "AAAA"); + new_order.push_back_string (hffix::tag::TargetCompID, "BBBB"); + new_order.push_back_int (hffix::tag::MsgSeqNum, seq_send++); + new_order.push_back_timestamp (hffix::tag::SendingTime, 2022, 2, 23, 11, 20, 0); + new_order.push_back_string (hffix::tag::ClOrdID, "A1"); + // Automated execution. + new_order.push_back_char (hffix::tag::HandlInst, '1'); + // Ticker symbol OIH. + new_order.push_back_string (hffix::tag::Symbol, "OIH"); + // Buy side. + new_order.push_back_char (hffix::tag::Side, '1'); + new_order.push_back_timestamp (hffix::tag::TransactTime, 2022, 2, 23, 11, 20, 0); + // 100 shares. + new_order.push_back_int (hffix::tag::OrderQty, 100); + // Limit order. + new_order.push_back_char (hffix::tag::OrdType, '2'); + // Limit price $500.01 = 50001*(10^-2). The push_back_decimal() method + // takes a decimal floating point number of the form mantissa*(10^exponent). + new_order.push_back_decimal (hffix::tag::Price, 50001, -2); + // Good Till Cancel. + new_order.push_back_char (hffix::tag::TimeInForce, '1'); + + new_order.push_back_trailer(); // write CheckSum. + + //Now the New Order message is in the buffer after the Logon message. + + // Write both messages to stdout. + std::cout.write(buffer, new_order.message_end() - buffer); + + return 0; +} diff --git a/recipes/hffix/all/test_v1_package/CMakeLists.txt b/recipes/hffix/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..31a17e5e32684 --- /dev/null +++ b/recipes/hffix/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hffix REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hffix::hffix) diff --git a/recipes/hffix/all/test_v1_package/conanfile.py b/recipes/hffix/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hffix/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/hffix/config.yml b/recipes/hffix/config.yml new file mode 100644 index 0000000000000..60d31991f5141 --- /dev/null +++ b/recipes/hffix/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1": + folder: all diff --git a/recipes/hidapi/all/conandata.yml b/recipes/hidapi/all/conandata.yml new file mode 100644 index 0000000000000..eac49619f91bb --- /dev/null +++ b/recipes/hidapi/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.13.1": + url: "https://github.com/libusb/hidapi/archive/hidapi-0.13.1.tar.gz" + sha256: "476a2c9a4dc7d1fc97dd223b84338dbea3809a84caea2dcd887d9778725490e3" + "0.12.0": + url: "https://github.com/libusb/hidapi/archive/hidapi-0.12.0.tar.gz" + sha256: "28ec1451f0527ad40c1a4c92547966ffef96813528c8b184a665f03ecbb508bc" + "0.11.2": + url: "https://github.com/libusb/hidapi/archive/hidapi-0.11.2.tar.gz" + sha256: "bc4ac0f32a6b21ef96258a7554c116152e2272dacdec1e4620fc44abeea50c27" + "0.11.0": + url: "https://github.com/libusb/hidapi/archive/hidapi-0.11.0.tar.gz" + sha256: "391d8e52f2d6a5cf76e2b0c079cfefe25497ba1d4659131297081fc0cd744632" + "0.10.1": + url: "https://github.com/libusb/hidapi/archive/hidapi-0.10.1.tar.gz" + sha256: "f71dd8a1f46979c17ee521bc2117573872bbf040f8a4750e492271fc141f2644" diff --git a/recipes/hidapi/all/conanfile.py b/recipes/hidapi/all/conanfile.py new file mode 100644 index 0000000000000..fe9ed0a02da20 --- /dev/null +++ b/recipes/hidapi/all/conanfile.py @@ -0,0 +1,156 @@ +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 copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildToolchain +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class HidapiConan(ConanFile): + name = "hidapi" + description = "HIDAPI is a multi-platform library which allows an application to interface " \ + "with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and macOS." + topics = ("libusb", "hid-class", "bluetooth") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libusb/hidapi" + license = "GPL-3-or-later", "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if is_msvc(self): + self.options.shared = 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): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("libusb/1.0.26") + if self.settings.os == "Linux": + self.requires("libudev/system") + + def validate(self): + if is_msvc(self) and not self.options.shared: + raise ConanInvalidConfiguration("Static libraries for Visual Studio are currently not available") + + def build_requirements(self): + if not is_msvc(self): + self.tool_requires("libtool/2.4.7") + if self.settings.os in ["Linux", "FreeBSD"] and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.properties["WholeProgramOptimization"] = "false" + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "configure.ac"), + "AC_CONFIG_MACRO_DIR", "dnl AC_CONFIG_MACRO_DIR") + + def build(self): + self._patch_sources() + if is_msvc(self): + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + replace_in_file( + self, os.path.join(self.source_folder, "windows", "hidapi.vcxproj"), + "true", + "", + ) + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, os.path.join(self.source_folder, "windows", "hidapi.vcxproj"), + "", + f"", + ) + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(self.source_folder, "windows", "hidapi.sln"), targets=["hidapi"]) + else: + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, os.path.join("hidapi", "*.h"), src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + output_folder = os.path.join(self.source_folder, "windows") + copy(self, "*hidapi.lib", src=output_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libusb"].set_property("pkg_config_name", "hidapi-libusb") + self.cpp_info.components["libusb"].libs = ["hidapi-libusb"] + self.cpp_info.components["libusb"].requires = ["libusb::libusb"] + self.cpp_info.components["libusb"].system_libs = ["pthread", "dl", "rt"] + + self.cpp_info.components["hidraw"].set_property("pkg_config_name", "hidapi-hidraw") + self.cpp_info.components["hidraw"].libs = ["hidapi-hidraw"] + if self.settings.os == "Linux": + self.cpp_info.components["hidraw"].requires = ["libudev::libudev"] + self.cpp_info.components["hidraw"].system_libs = ["pthread", "dl"] + else: + self.cpp_info.libs = ["hidapi"] + if self.settings.os == "Macos": + self.cpp_info.frameworks.extend(["IOKit", "CoreFoundation", "AppKit"]) + if Version(self.version) == "0.10.1" and self.settings.os == "Windows": + self.cpp_info.system_libs = ["setupapi"] diff --git a/recipes/hidapi/all/test_package/CMakeLists.txt b/recipes/hidapi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..51fe04d5b6cce --- /dev/null +++ b/recipes/hidapi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(hidapi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hidapi::hidapi) diff --git a/recipes/hidapi/all/test_package/conanfile.py b/recipes/hidapi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/hidapi/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hidapi/all/test_package/test_package.c b/recipes/hidapi/all/test_package/test_package.c new file mode 100644 index 0000000000000..5939b5717b638 --- /dev/null +++ b/recipes/hidapi/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include "hidapi/hidapi.h" + +int main(void) { + hid_init(); + return 0; +} diff --git a/recipes/hidapi/all/test_v1_package/CMakeLists.txt b/recipes/hidapi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/hidapi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hidapi/all/test_v1_package/conanfile.py b/recipes/hidapi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hidapi/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/hidapi/config.yml b/recipes/hidapi/config.yml new file mode 100644 index 0000000000000..902a32ea98919 --- /dev/null +++ b/recipes/hidapi/config.yml @@ -0,0 +1,11 @@ +versions: + "0.13.1": + folder: all + "0.12.0": + folder: all + "0.11.2": + folder: all + "0.11.0": + folder: all + "0.10.1": + folder: all diff --git a/recipes/highfive/all/conandata.yml b/recipes/highfive/all/conandata.yml new file mode 100644 index 0000000000000..b9befb53e74d3 --- /dev/null +++ b/recipes/highfive/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.7.1": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.7.1.tar.gz" + sha256: "25b4c51a94d1e670dc93b9b73f51e79b65d8ff49bcd6e5d5582d5ecd2789a249" + "2.7.0": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.7.0.tar.gz" + sha256: "8e05672ddf81a59ce014b1d065bd9a8c5034dbd91a5c2578e805ef880afa5907" + "2.6.2": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.6.2.tar.gz" + sha256: "ab51b9fbb49e877dd1aa7b53b4b26875f41e4e0b8ee0fc2f1d735e0d1e43d708" + "2.5.1": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.5.1.tar.gz" + sha256: "1ba05aa31cdeda03d013094eebc10f932783e4e071e253e9eaa8889120f241c7" + "2.4.1": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.4.1.tar.gz" + sha256: "6826471ef5c645ebf947d29574b302991525a8a8ff1ef687aba7311d9a0ea36f" + "2.3.1": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.3.1.tar.gz" + sha256: "41728a1204bdfcdcef8cbc3ddffe5d744c5331434ce3dcef35614b831234fcd7" diff --git a/recipes/highfive/all/conanfile.py b/recipes/highfive/all/conanfile.py new file mode 100644 index 0000000000000..ebce29b0f3b16 --- /dev/null +++ b/recipes/highfive/all/conanfile.py @@ -0,0 +1,139 @@ +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, save +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class HighFiveConan(ConanFile): + name = "highfive" + description = "HighFive is a modern header-only C++11 friendly interface for libhdf5." + license = "Boost Software License 1.0" + topics = ("hdf5", "hdf", "data") + homepage = "https://github.com/BlueBrain/HighFive" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_boost": [True, False], + "with_eigen": [True, False], + "with_xtensor": [True, False], + "with_opencv": [True, False], + } + default_options = { + "with_boost": True, + "with_eigen": True, + "with_xtensor": True, + "with_opencv": False, + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("hdf5/1.14.0") + if self.options.with_boost: + self.requires("boost/1.81.0") + if self.options.with_eigen: + self.requires("eigen/3.4.0") + if self.options.with_xtensor: + self.requires("xtensor/0.24.3") + if self.options.with_opencv: + self.requires("opencv/4.5.5") + + 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_BOOST"] = self.options.with_boost + tc.variables["USE_EIGEN"] = self.options.with_eigen + tc.variables["USE_XTENSOR"] = self.options.with_xtensor + tc.variables["USE_OPENCV"] = self.options.with_opencv + tc.variables["HIGHFIVE_UNIT_TESTS"] = False + tc.variables["HIGHFIVE_EXAMPLES"] = False + tc.variables["HIGHFIVE_BUILD_DOCS"] = False + tc.variables["HIGHFIVE_USE_INSTALL_DEPS"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "CMake", "HighFiveTargetDeps.cmake"), + "find_package(Eigen3 NO_MODULE)", + "find_package(Eigen3 REQUIRED)", + ) + replace_in_file( + self, + os.path.join(self.source_folder, "CMake", "HighFiveTargetDeps.cmake"), + "EIGEN3_INCLUDE_DIRS", + "Eigen3_INCLUDE_DIRS", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"HighFive": "HighFive::HighFive"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "HighFive") + self.cpp_info.set_property("cmake_target_name", "HighFive") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.requires = ["hdf5::hdf5"] + if self.options.with_boost: + self.cpp_info.requires.append("boost::headers") + if self.options.with_eigen: + self.cpp_info.requires.append("eigen::eigen") + if self.options.with_xtensor: + self.cpp_info.requires.append("xtensor::xtensor") + if self.options.with_opencv: + self.cpp_info.requires.append("opencv::opencv") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "HighFive" + self.cpp_info.names["cmake_find_package_multi"] = "HighFive" + 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/highfive/all/test_package/CMakeLists.txt b/recipes/highfive/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9094d8eb2cd6d --- /dev/null +++ b/recipes/highfive/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(HighFive REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE HighFive) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/highfive/all/test_package/conanfile.py b/recipes/highfive/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/highfive/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/highfive/all/test_package/test_package.cpp b/recipes/highfive/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..93c1b2f6ea391 --- /dev/null +++ b/recipes/highfive/all/test_package/test_package.cpp @@ -0,0 +1,77 @@ +/* + * This file was copied from https://github.com/BlueBrain/HighFive/blob/master/src/examples/create_attribute_string_integer.cpp + * and changed in terms of namespaces and const correctness. + */ +/* + * Copyright (c), 2017, Adrien Devresse + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + */ +#include +#include +#include + +#include +#include +#include +#include + +const std::string FILE_NAME("create_attribute.h5"); +const std::string DATASET_NAME("my_dataset"); + +const std::string ATTRIBUTE_NAME_NOTE("note"); +const std::string ATTRIBUTE_NAME_VERSION("version_string"); + +// create a dataset from a vector of string +// read it back and print it +int main(void) +{ + try + { + // Create a new file using the default property lists. + HighFive::File file(FILE_NAME, HighFive::File::ReadWrite | HighFive::File::Create | HighFive::File::Truncate); + + // Create a dummy dataset of one single integer + HighFive::DataSet dataset = + file.createDataSet(DATASET_NAME, HighFive::DataSpace(1), HighFive::AtomicType()); + + // Now let's add a attribute on this dataset + // This attribute will be named "note" + // and have the following content + std::string string_list("very important Dataset!"); + + HighFive::Attribute attribute = dataset.createAttribute( + ATTRIBUTE_NAME_NOTE, HighFive::DataSpace::From(string_list)); + attribute.write(string_list); + + // We also add a "version" attribute + // that will be an array 1x2 of integer + std::vector version; + version.push_back(1); + version.push_back(0); // version 1.0 + + HighFive::Attribute v = dataset.createAttribute(ATTRIBUTE_NAME_VERSION, + HighFive::DataSpace::From(version)); + v.write(version); + + // Ok all attributes are now written + + // let's list the keys of all attributes now + const std::vector all_attributes_keys = + dataset.listAttributeNames(); + for (const auto &attr : all_attributes_keys) + { + std::cout << "attribute: " << attr << std::endl; + } + } + catch (HighFive::Exception &err) + { + // catch and print any HDF5 error + std::cerr << err.what() << std::endl; + } + + return 0; // successfully terminated +} diff --git a/recipes/highfive/all/test_v1_package/CMakeLists.txt b/recipes/highfive/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..671f071b8ed9f --- /dev/null +++ b/recipes/highfive/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(HighFive REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE HighFive) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/highfive/all/test_v1_package/conanfile.py b/recipes/highfive/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4453fcd822f20 --- /dev/null +++ b/recipes/highfive/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/highfive/config.yml b/recipes/highfive/config.yml new file mode 100644 index 0000000000000..546cbf2ce6f7b --- /dev/null +++ b/recipes/highfive/config.yml @@ -0,0 +1,13 @@ +versions: + "2.7.1": + folder: all + "2.7.0": + folder: all + "2.6.2": + folder: all + "2.5.1": + folder: all + "2.4.1": + folder: all + "2.3.1": + folder: all diff --git a/recipes/highs/all/conandata.yml b/recipes/highs/all/conandata.yml new file mode 100644 index 0000000000000..03938c9f3bdf9 --- /dev/null +++ b/recipes/highs/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.4.2": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.4.2.tar.gz" + sha256: "29330e284491143cd53a547c23178221df46423679a98f6684251e65cc384d2b" +patches: + "1.4.2": + - patch_file: "patches/0001-missing-includes-msvc15-1.4.2.patch" + patch_description: "Add missing includes for std::tolower and std::max in MSVC15" + patch_type: portability + patch_source: "https://github.com/ERGO-Code/HiGHS/pull/1152" diff --git a/recipes/highs/all/conanfile.py b/recipes/highs/all/conanfile.py new file mode 100644 index 0000000000000..0873a3aeb59f0 --- /dev/null +++ b/recipes/highs/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +from os.path import join + +required_conan_version = ">=1.53.0" + + +class HiGHSConan(ConanFile): + name = "highs" + description = "high performance serial and parallel solver for large scale sparse linear optimization problems" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.highs.dev/" + topics = ("simplex", "interior point", "solver", "linear", "programming") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def 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): + self.requires("zlib/1.2.13") + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SHARED"] = self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["PYTHON"] = False + tc.variables["FORTRAN"] = False + tc.variables["CSHARP"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build(target="libhighs") + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) + copy(self, pattern="*.h", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) + copy(self, pattern="HConfig.h", src=self.build_folder, dst=join(self.package_folder, "include")) + if self.options.shared: + copy(self, pattern="*.so*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + else: + copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") + if is_msvc(self): + self.cpp_info.defines.append("_ITERATOR_DEBUG_LEVEL=0") diff --git a/recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch b/recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch new file mode 100644 index 0000000000000..83c7f865fb734 --- /dev/null +++ b/recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch @@ -0,0 +1,48 @@ +diff --git a/extern/filereaderlp/reader.cpp b/extern/filereaderlp/reader.cpp +index 86151120..71f6747a 100644 +--- a/extern/filereaderlp/reader.cpp ++++ b/extern/filereaderlp/reader.cpp +@@ -2,6 +2,7 @@ + + #include "builder.hpp" + ++#include + #include + #include + #include +diff --git a/src/lp_data/HighsOptions.cpp b/src/lp_data/HighsOptions.cpp +index 903a7c71..6e66e78e 100644 +--- a/src/lp_data/HighsOptions.cpp ++++ b/src/lp_data/HighsOptions.cpp +@@ -17,6 +17,7 @@ + + #include + #include ++#include + + // void setLogOptions(); + +diff --git a/src/presolve/ICrash.cpp b/src/presolve/ICrash.cpp +index 12a6fc3f..e7bf86a4 100644 +--- a/src/presolve/ICrash.cpp ++++ b/src/presolve/ICrash.cpp +@@ -14,6 +14,7 @@ + #include "presolve/ICrash.h" + + #include ++#include + #include + #include + #include +diff --git a/src/util/HighsTimer.h b/src/util/HighsTimer.h +index 6f1d3047..cabef8c4 100644 +--- a/src/util/HighsTimer.h ++++ b/src/util/HighsTimer.h +@@ -16,6 +16,7 @@ + #ifndef UTIL_HIGHSTIMER_H_ + #define UTIL_HIGHSTIMER_H_ + ++#include + #include + #include + #include diff --git a/recipes/highs/all/test_package/CMakeLists.txt b/recipes/highs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d953c847e1679 --- /dev/null +++ b/recipes/highs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 11) + +find_package(highs REQUIRED CONFIG) +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE highs::highs) diff --git a/recipes/highs/all/test_package/conanfile.py b/recipes/highs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/highs/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/highs/all/test_package/main.cpp b/recipes/highs/all/test_package/main.cpp new file mode 100644 index 0000000000000..e4dc6f7ec78d9 --- /dev/null +++ b/recipes/highs/all/test_package/main.cpp @@ -0,0 +1,164 @@ +// HiGHS is designed to solve linear optimization problems of the form +// +// Min (1/2)x^TQx + c^Tx + d subject to L <= Ax <= U; l <= x <= u +// +// where A is a matrix with m rows and n columns, and Q is either zero +// or positive definite. If Q is zero, HiGHS can determine the optimal +// integer-valued solution. +// +// The scalar n is num_col_ +// The scalar m is num_row_ +// +// The vector c is col_cost_ +// The scalar d is offset_ +// The vector l is col_lower_ +// The vector u is col_upper_ +// The vector L is row_lower_ +// The vector U is row_upper_ +// +// The matrix A is represented in packed vector form, either +// row-wise or column-wise: only its nonzeros are stored +// +// * The number of nonzeros in A is num_nz +// +// * The indices of the nonnzeros in the vectors of A are stored in a_index +// +// * The values of the nonnzeros in the vectors of A are stored in a_value +// +// * The position in a_index/a_value of the index/value of the first +// nonzero in each vector is stored in a_start +// +// Note that a_start[0] must be zero +// +// The matrix Q is represented in packed column form +// +// * The dimension of Q is dim_ +// +// * The number of nonzeros in Q is hessian_num_nz +// +// * The indices of the nonnzeros in the vectors of A are stored in q_index +// +// * The values of the nonnzeros in the vectors of A are stored in q_value +// +// * The position in q_index/q_value of the index/value of the first +// nonzero in each column is stored in q_start +// +// Note +// +// * By default, Q is zero. This is indicated by dim_ being initialised to zero. +// +// * q_start[0] must be zero +// +#include "Highs.h" +#include + +using std::cout; +using std::endl; + +int main() { + // Create and populate a HighsModel instance for the LP + // + // Min f = x_0 + x_1 + 3 + // s.t. x_1 <= 7 + // 5 <= x_0 + 2x_1 <= 15 + // 6 <= 3x_0 + 2x_1 + // 0 <= x_0 <= 4; 1 <= x_1 + // + // Although the first constraint could be expressed as an upper + // bound on x_1, it serves to illustrate a non-trivial packed + // column-wise matrix. + // + HighsModel model; + model.lp_.num_col_ = 2; + model.lp_.num_row_ = 3; + model.lp_.sense_ = ObjSense::kMinimize; + model.lp_.offset_ = 3; + model.lp_.col_cost_ = {1.0, 1.0}; + model.lp_.col_lower_ = {0.0, 1.0}; + model.lp_.col_upper_ = {4.0, 1.0e30}; + model.lp_.row_lower_ = {-1.0e30, 5.0, 6.0}; + model.lp_.row_upper_ = {7.0, 15.0, 1.0e30}; + // + // Here the orientation of the matrix is column-wise + model.lp_.a_matrix_.format_ = MatrixFormat::kColwise; + // a_start_ has num_col_1 entries, and the last entry is the number + // of nonzeros in A, allowing the number of nonzeros in the last + // column to be defined + model.lp_.a_matrix_.start_ = {0, 2, 5}; + model.lp_.a_matrix_.index_ = {1, 2, 0, 1, 2}; + model.lp_.a_matrix_.value_ = {1.0, 3.0, 1.0, 2.0, 2.0}; + // + // Create a Highs instance + Highs highs; + HighsStatus return_status; + // + // Pass the model to HiGHS + return_status = highs.passModel(model); + assert(return_status==HighsStatus::kOk); + // + // Get a const reference to the LP data in HiGHS + const HighsLp& lp = highs.getLp(); + // + // Solve the model + return_status = highs.run(); + assert(return_status==HighsStatus::kOk); + // + // Get the model status + const HighsModelStatus& model_status = highs.getModelStatus(); + assert(model_status==HighsModelStatus::kOptimal); + cout << "Model status: " << highs.modelStatusToString(model_status) << endl; + // + // Get the solution information + const HighsInfo& info = highs.getInfo(); + cout << "Simplex iteration count: " << info.simplex_iteration_count << endl; + cout << "Objective function value: " << info.objective_function_value << endl; + cout << "Primal solution status: " << highs.solutionStatusToString(info.primal_solution_status) << endl; + cout << "Dual solution status: " << highs.solutionStatusToString(info.dual_solution_status) << endl; + cout << "Basis: " << highs.basisValidityToString(info.basis_validity) << endl; + const bool has_values = info.primal_solution_status; + const bool has_duals = info.dual_solution_status; + const bool has_basis = info.basis_validity; + // + // Get the solution values and basis + const HighsSolution& solution = highs.getSolution(); + const HighsBasis& basis = highs.getBasis(); + // + // Report the primal and solution values and basis + for (int col=0; col < lp.num_col_; col++) { + cout << "Column " << col; + if (has_values) cout << "; value = " << solution.col_value[col]; + if (has_duals) cout << "; dual = " << solution.col_dual[col]; + if (has_basis) cout << "; status: " << highs.basisStatusToString(basis.col_status[col]); + cout << endl; + } + for (int row=0; row < lp.num_row_; row++) { + cout << "Row " << row; + if (has_values) cout << "; value = " << solution.row_value[row]; + if (has_duals) cout << "; dual = " << solution.row_dual[row]; + if (has_basis) cout << "; status: " << highs.basisStatusToString(basis.row_status[row]); + cout << endl; + } + + // Now indicate that all the variables must take integer values + model.lp_.integrality_.resize(lp.num_col_); + for (int col=0; col < lp.num_col_; col++) + model.lp_.integrality_[col] = HighsVarType::kInteger; + + highs.passModel(model); + // Solve the model + return_status = highs.run(); + assert(return_status==HighsStatus::kOk); + // Report the primal solution values + for (int col=0; col < lp.num_col_; col++) { + cout << "Column " << col; + if (info.primal_solution_status) cout << "; value = " << solution.col_value[col]; + cout << endl; + } + for (int row=0; row < lp.num_row_; row++) { + cout << "Row " << row; + if (info.primal_solution_status) cout << "; value = " << solution.row_value[row]; + cout << endl; + } + + return 0; +} diff --git a/recipes/highs/all/test_v1_package/CMakeLists.txt b/recipes/highs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..36b48f96d1078 --- /dev/null +++ b/recipes/highs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 11) + +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/highs/all/test_v1_package/conanfile.py b/recipes/highs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/highs/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/highs/config.yml b/recipes/highs/config.yml new file mode 100644 index 0000000000000..ba127d382373b --- /dev/null +++ b/recipes/highs/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.2": + folder: all diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml new file mode 100644 index 0000000000000..ae12819eb44d8 --- /dev/null +++ b/recipes/highway/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.0.3": + url: "https://github.com/google/highway/archive/1.0.3.tar.gz" + sha256: "566fc77315878473d9a6bd815f7de78c73734acdcb745c3dde8579560ac5440e" + "1.0.2": + url: "https://github.com/google/highway/archive/1.0.2.tar.gz" + sha256: "e8ef71236ac0d97f12d553ec1ffc5b6375d57b5f0b860c7447dd69b6ed1072db" + "1.0.1": + url: "https://github.com/google/highway/archive/1.0.1.tar.gz" + sha256: "7ca6af7dc2e3e054de9e17b9dfd88609a7fd202812b1c216f43cc41647c97311" + "1.0.0": + url: "https://github.com/google/highway/archive/1.0.0.tar.gz" + sha256: "ab4f5f864932268356f9f6aa86f612fa4430a7db3c8de0391076750197e876b8" + "0.17.0": + url: "https://github.com/google/highway/archive/0.17.0.tar.gz" + sha256: "25158fd5c090b70ecea47fc246c860d150f07f801d2434e1e51ec14a6c15822c" + "0.16.0": + url: "https://github.com/google/highway/archive/0.16.0.tar.gz" + sha256: "746c9578446be6c5286e8846c5f0d4118c0c1f04219c401abadcb8a5f2051893" + "0.12.2": + url: "https://github.com/google/highway/archive/0.12.2.tar.gz" + sha256: "e1d47ce510429fdcf31f41697ca74fb0dcd59d933196e531a86d51751a56f4cc" + "0.11.1": + url: "https://github.com/google/highway/archive/0.11.1.tar.gz" + sha256: "4c4bb9501c02b27a0944afde8923aaab554384690d37e5b2a7f97553426ea641" +patches: + "0.16.0": + - patch_file: "patches/0.16.0-0001-fix-sys-random-h.patch" + patch_description: "fix including sys/random.h on several environments" + patch_type: "portability" + "0.11.1": + - patch_file: "patches/0.11.1-0001-remove-contrib.patch" + patch_description: "remove contrib sources" + patch_type: "portability" diff --git a/recipes/highway/all/conanfile.py b/recipes/highway/all/conanfile.py new file mode 100644 index 0000000000000..47b313cb31ecc --- /dev/null +++ b/recipes/highway/all/conanfile.py @@ -0,0 +1,114 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class HighwayConan(ConanFile): + name = "highway" + description = "Performance-portable, length-agnostic SIMD with runtime dispatch" + topics = ("simd",) + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/highway" + 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" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + } + + 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 Version(self.version) < "0.16.0": + del self.options.shared + elif 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) + minimum_version = self._minimum_compilers_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." + ) + + 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["HWY_ENABLE_EXAMPLES"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Honor fPIC option + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)", "") + replace_in_file(self, cmakelists, + "set_property(TARGET hwy PROPERTY POSITION_INDEPENDENT_CODE ON)", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.components["hwy"].set_property("pkg_config_name", "libhwy") + self.cpp_info.components["hwy"].libs = ["hwy"] + if Version(self.version) >= "0.16.0": + self.cpp_info.components["hwy"].defines.append( + "HWY_SHARED_DEFINE" if self.options.shared else "HWY_STATIC_DEFINE" + ) + if Version(self.version) >= "0.12.1": + self.cpp_info.components["hwy_contrib"].set_property("pkg_config_name", "libhwy-contrib") + self.cpp_info.components["hwy_contrib"].libs = ["hwy_contrib"] + self.cpp_info.components["hwy_contrib"].requires = ["hwy"] + if Version(self.version) >= "0.15.0": + self.cpp_info.components["hwy_test"].set_property("pkg_config_name", "libhwy-test") + self.cpp_info.components["hwy_test"].libs = ["hwy_test"] + self.cpp_info.components["hwy_test"].requires = ["hwy"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch b/recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch new file mode 100644 index 0000000000000..e409cd92d3227 --- /dev/null +++ b/recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,9 +52,6 @@ check_cxx_source_compiles( + ) + + set(HWY_SOURCES +- contrib/image/image.cc +- contrib/image/image.h +- contrib/math/math-inl.h + hwy/aligned_allocator.cc + hwy/aligned_allocator.h + hwy/base.h diff --git a/recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch b/recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch new file mode 100644 index 0000000000000..aee3b37dc1e43 --- /dev/null +++ b/recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch @@ -0,0 +1,50 @@ +diff --git a/hwy/contrib/sort/vqsort.cc b/hwy/contrib/sort/vqsort.cc +index 951a0bd..2009da8 100644 +--- a/hwy/contrib/sort/vqsort.cc ++++ b/hwy/contrib/sort/vqsort.cc +@@ -25,12 +25,43 @@ + // After foreach_target + #include "hwy/contrib/sort/shared-inl.h" + ++// Check if we have sys/random.h. First skip some systems on which the check ++// itself (features.h) might be problematic. ++#if defined(ANDROID) || defined(__ANDROID__) || HWY_ARCH_RVV ++#define VQSORT_GETRANDOM 0 ++#endif ++ ++#if !defined(VQSORT_GETRANDOM) && (defined(linux) || defined(__linux__)) ++#include ++ ++// ---- which libc ++#if defined(__UCLIBC__) ++#define VQSORT_GETRANDOM 1 // added Mar 2015, before uclibc-ng 1.0 ++ ++#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 25) ++#define VQSORT_GETRANDOM 1 ++#else ++#define VQSORT_GETRANDOM 0 ++#endif ++ ++#else ++// Assume MUSL, which has getrandom since 2018. There is no macro to test, see ++// https://www.openwall.com/lists/musl/2013/03/29/13. ++#define VQSORT_GETRANDOM 1 ++ ++#endif // ---- which libc ++#endif // linux ++ ++#if !defined(VQSORT_GETRANDOM) ++#define VQSORT_GETRANDOM 0 ++#endif ++ + // Seed source for SFC generator: 1=getrandom, 2=CryptGenRandom + // (not all Android support the getrandom wrapper) + #ifndef VQSORT_SECURE_SEED + +-#if (defined(linux) || defined(__linux__)) && \ +- !(defined(ANDROID) || defined(__ANDROID__) || HWY_ARCH_RVV) ++#if VQSORT_GETRANDOM + #define VQSORT_SECURE_SEED 1 + #elif defined(_WIN32) || defined(_WIN64) + #define VQSORT_SECURE_SEED 2 diff --git a/recipes/highway/all/test_package/CMakeLists.txt b/recipes/highway/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..06e1e8678e6bd --- /dev/null +++ b/recipes/highway/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(highway REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE highway::highway) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/highway/all/test_package/conanfile.py b/recipes/highway/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/highway/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/highway/all/test_package/test_package.cpp b/recipes/highway/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b86c4bfed366c --- /dev/null +++ b/recipes/highway/all/test_package/test_package.cpp @@ -0,0 +1,45 @@ +#include "hwy/aligned_allocator.h" +#include "hwy/highway.h" + +#include + +HWY_BEFORE_NAMESPACE(); +namespace { +namespace HWY_NAMESPACE { + +void test() +{ + const HWY_FULL(uint32_t) d; + + const size_t count = 5 * Lanes(d); + auto x_array = hwy::AllocateAligned(count); + + uint32_t result = 0; + uint32_t expected = 0; + + for (size_t i = 0; i < count; ++i) { + x_array[i] = i; + expected += x_array[i]; + } + + for (size_t i = 0; i < count; i += Lanes(d)) { + const auto x = Load(d, &x_array[i]); +#if HWY_MAJOR == 0 && HWY_MINOR < 14 + result += GetLane(SumOfLanes(x)); +#else + result += GetLane(SumOfLanes(d, x)); +#endif + } + + std::cout << "result = " << result << ", expected = " << expected << '\n'; +} + +} // namespace HWY_NAMESPACE +} // namespace +HWY_AFTER_NAMESPACE(); + +int main() +{ + HWY_NAMESPACE::test(); + return 0; +} diff --git a/recipes/highway/all/test_v1_package/CMakeLists.txt b/recipes/highway/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/highway/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/highway/all/test_v1_package/conanfile.py b/recipes/highway/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/highway/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/highway/config.yml b/recipes/highway/config.yml new file mode 100644 index 0000000000000..08286722329d4 --- /dev/null +++ b/recipes/highway/config.yml @@ -0,0 +1,17 @@ +versions: + "1.0.3": + folder: all + "1.0.2": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all + "0.17.0": + folder: all + "0.16.0": + folder: all + "0.12.2": + folder: all + "0.11.1": + folder: all diff --git a/recipes/hipony-enumerate/all/conandata.yml b/recipes/hipony-enumerate/all/conandata.yml new file mode 100644 index 0000000000000..9dd2b532a188d --- /dev/null +++ b/recipes/hipony-enumerate/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.4.1": + url: "https://github.com/hipony/enumerate/archive/v2.4.1.tar.gz" + sha256: "a071f6014711dcd09e752cd042651d96f2917925ff743208064ebd0d6bdc4e55" + "2.4.0": + url: "https://github.com/hipony/enumerate/archive/v2.4.0.tar.gz" + sha256: "21ee64fc3b1fda25356df0ee0e0292b529bb9b99931ee2b388222d2f498d7a45" + "2.2.1": + url: "https://github.com/hipony/enumerate/archive/refs/tags/v2.2.1.zip" + sha256: "0b6e208007fc0cdffe7f23686faddf5c2bc06f6794bacf2e612197e1e54140e7" diff --git a/recipes/hipony-enumerate/all/conanfile.py b/recipes/hipony-enumerate/all/conanfile.py new file mode 100644 index 0000000000000..d73933d9969a3 --- /dev/null +++ b/recipes/hipony-enumerate/all/conanfile.py @@ -0,0 +1,117 @@ +import os + +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, rmdir +from conan.tools.build import check_min_cppstd + +required_conan_version = ">=1.53.0" + + +class HiponyEnumerateConan(ConanFile): + name = "hipony-enumerate" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hipony/enumerate" + description = "C++11 compatible version of enumerate" + topics = ("enumerate", "header-only", "cpp", + "constexpr", "cpp17", "cpp11", "tuples") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "aggregates": [True, False], + } + default_options = { + "aggregates": False, + } + + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8" if self.options.aggregates else "6", + "Visual Studio": "16" if self.options.aggregates else "14", + "msvc": "192" if self.options.aggregates else "190", + "clang": "5.0" if self.options.aggregates else "3.9", + "apple-clang": "10", + } + + @property + def _minimum_standard(self): + return "17" if self.options.aggregates else "11" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.aggregates: + self.requires("pfr/2.0.3") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_standard) + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warning( + "{0} {1} requires C++{2}. Your compiler is unknown. Assuming it supports C++{2}." + .format(self.name, self.version, self._minimum_standard)) + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + "{} {} requires C++{}, which your compiler does not support." + .format(self.name, self.version, self._minimum_standard)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = "OFF" + tc.variables["HIPONY_ENUMERATE_AGGREGATES_ENABLED"] = self.options.aggregates + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure() + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "hipony-enumerate") + self.cpp_info.set_property("cmake_target_name", "hipony::enumerate") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + if self.options.aggregates: + self.cpp_info.components["enumerate"].defines.append( + "HIPONY_ENUMERATE_AGGREGATES_ENABLED") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "hipony-enumerate" + self.cpp_info.filenames["cmake_find_package_multi"] = "hipony-enumerate" + self.cpp_info.names["cmake_find_package"] = "hipony" + self.cpp_info.names["cmake_find_package_multi"] = "hipony" + self.cpp_info.components["enumerate"].names["cmake_find_package"] = "enumerate" + self.cpp_info.components["enumerate"].names["cmake_find_package_multi"] = "enumerate" + self.cpp_info.components["enumerate"].set_property("cmake_target_name", "hipony::enumerate") + if self.options.aggregates: + self.cpp_info.components["enumerate"].requires.append("pfr::pfr") diff --git a/recipes/hipony-enumerate/all/test_package/CMakeLists.txt b/recipes/hipony-enumerate/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b8ca205c62256 --- /dev/null +++ b/recipes/hipony-enumerate/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(hipony-enumerate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hipony::enumerate) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/hipony-enumerate/all/test_package/conanfile.py b/recipes/hipony-enumerate/all/test_package/conanfile.py new file mode 100644 index 0000000000000..58ea4a29517f7 --- /dev/null +++ b/recipes/hipony-enumerate/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" + 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/hipony-enumerate/all/test_package/test_package.cpp b/recipes/hipony-enumerate/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f4232aad68348 --- /dev/null +++ b/recipes/hipony-enumerate/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include +#include + +int main() { + std::array array{0, 1, 2, 3, 4, 5}; + for (auto &&item : hipony::enumerate(array)) { + std::cout << item.index << ' ' << item.value << '\n'; + } +} diff --git a/recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt b/recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hipony-enumerate/all/test_v1_package/conanfile.py b/recipes/hipony-enumerate/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hipony-enumerate/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/hipony-enumerate/config.yml b/recipes/hipony-enumerate/config.yml new file mode 100644 index 0000000000000..5ccb72ceb5aff --- /dev/null +++ b/recipes/hipony-enumerate/config.yml @@ -0,0 +1,7 @@ +versions: + "2.4.1": + folder: "all" + "2.4.0": + folder: "all" + "2.2.1": + folder: "all" diff --git a/recipes/hippomocks/all/conandata.yml b/recipes/hippomocks/all/conandata.yml new file mode 100644 index 0000000000000..4d0dd1e46fc2e --- /dev/null +++ b/recipes/hippomocks/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20190311": + url: https://github.com/dascandy/hippomocks/archive/10960d0.zip + sha256: a4efc07eacdc35107039bd3b7b491b9fc5f95d4dabb37de83a2b0642c7231fe8 diff --git a/recipes/hippomocks/all/conanfile.py b/recipes/hippomocks/all/conanfile.py new file mode 100755 index 0000000000000..313e2b97cc5a4 --- /dev/null +++ b/recipes/hippomocks/all/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, ConanFile, tools +import os, glob + +class HippomocksConan(ConanFile): + name = 'hippomocks' + _libname = 'HippoMocks' + description = 'Single-header mocking framework.' + topics = ("conan", "hippomocks", "mock", "framework") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dascandy/hippomocks" + license = 'LGPL-2.1' + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob("%s-*" % (self.name))[0] + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy('LICENSE', dst='licenses', src=self._source_subfolder) + self.copy('*.h', dst=os.path.join('include', self._libname), src=os.path.join(self._source_subfolder, self._libname)) + + def package_id(self): + self.info.header_only() diff --git a/recipes/hippomocks/all/test_package/CMakeLists.txt b/recipes/hippomocks/all/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..aff8268476df7 --- /dev/null +++ b/recipes/hippomocks/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hippomocks REQUIRED) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hippomocks::hippomocks) diff --git a/recipes/hippomocks/all/test_package/conanfile.py b/recipes/hippomocks/all/test_package/conanfile.py new file mode 100755 index 0000000000000..e065617c053bc --- /dev/null +++ b/recipes/hippomocks/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools, RunEnvironment +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + 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/hippomocks/all/test_package/main.cpp b/recipes/hippomocks/all/test_package/main.cpp new file mode 100755 index 0000000000000..ed6a1ba6b6fb0 --- /dev/null +++ b/recipes/hippomocks/all/test_package/main.cpp @@ -0,0 +1,20 @@ +#include + +struct Foo { +public: + virtual ~Foo() {} + virtual void f() {} + virtual void g() = 0; +}; + +int main() +{ + MockRepository mocks; + Foo *iamock = mocks.Mock(); + mocks.ExpectCall(iamock, Foo::f); + mocks.ExpectCall(iamock, Foo::g); + mocks.ExpectCall(iamock, Foo::f); + iamock->f(); + iamock->g(); + iamock->f(); +} diff --git a/recipes/hippomocks/config.yml b/recipes/hippomocks/config.yml new file mode 100644 index 0000000000000..a3c85f4de509d --- /dev/null +++ b/recipes/hippomocks/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190311": + folder: "all" diff --git a/recipes/hiredis/0.x.x/conandata.yml b/recipes/hiredis/0.x.x/conandata.yml new file mode 100644 index 0000000000000..0b74d88eff05f --- /dev/null +++ b/recipes/hiredis/0.x.x/conandata.yml @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000000000..f94cea21a0db9 --- /dev/null +++ b/recipes/hiredis/0.x.x/conanfile.py @@ -0,0 +1,78 @@ +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 new file mode 100644 index 0000000000000..52271f0ac9947 --- /dev/null +++ b/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch @@ -0,0 +1,42 @@ +--- 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 new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/hiredis/0.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} 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 new file mode 100644 index 0000000000000..5c09494bc67c0 --- /dev/null +++ b/recipes/hiredis/0.x.x/test_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" + + 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 new file mode 100644 index 0000000000000..6df475bd4539a --- /dev/null +++ b/recipes/hiredis/0.x.x/test_package/test_package.c @@ -0,0 +1,21 @@ +#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/all/conandata.yml b/recipes/hiredis/all/conandata.yml new file mode 100644 index 0000000000000..2063383701218 --- /dev/null +++ b/recipes/hiredis/all/conandata.yml @@ -0,0 +1,29 @@ +sources: + "1.1.0": + url: "https://github.com/redis/hiredis/archive/v1.1.0.tar.gz" + sha256: "fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6" + "1.0.2": + url: "https://github.com/redis/hiredis/archive/v1.0.2.tar.gz" + sha256: "e0ab696e2f07deb4252dda45b703d09854e53b9703c7d52182ce5a22616c3819" + "1.0.0": + url: "https://github.com/redis/hiredis/archive/v1.0.0.tar.gz" + sha256: "2a0b5fe5119ec973a0c1966bfc4bd7ed39dbce1cb6d749064af9121fe971936f" +patches: + "1.1.0": + - patch_file: "patches/0001-fix-cmake-1.1.0.patch" + patch_description: "divide static/shared build, fix openssl link name" + patch_type: "conan" + - patch_file: "patches/0002-fix-aix.patch" + patch_description: "support AIX build" + patch_type: "portability" + "1.0.2": + - patch_file: "patches/0001-fix-cmake-1.0.0.patch" + patch_description: "enable static/shared build, fix openssl link name" + patch_type: "conan" + - patch_file: "patches/0002-fix-aix.patch" + patch_description: "support AIX build" + patch_type: "portability" + "1.0.0": + - patch_file: "patches/0001-fix-cmake-1.0.0.patch" + patch_description: "enable static/shared build, fix openssl link name" + patch_type: "conan" diff --git a/recipes/hiredis/all/conanfile.py b/recipes/hiredis/all/conanfile.py new file mode 100644 index 0000000000000..95c01b327b522 --- /dev/null +++ b/recipes/hiredis/all/conanfile.py @@ -0,0 +1,113 @@ +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 +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.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" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": 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.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_ssl: + self.requires("openssl/[>=1.1 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_SSL"] = self.options.with_ssl + tc.variables["DISABLE_TESTS"] = True + tc.variables["ENABLE_EXAMPLES"] = 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, "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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "build")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "hiredis") + + suffix = "" + if Version(self.version) >= "1.1.0": + if is_msvc(self) and not self.options.shared: + suffix += "_static" + if self.settings.build_type == "Debug": + suffix += "d" + + # hiredis + self.cpp_info.components["hiredislib"].set_property("cmake_target_name", "hiredis::hiredis") + self.cpp_info.components["hiredislib"].set_property("pkg_config_name", "hiredis") + self.cpp_info.components["hiredislib"].names["cmake_find_package"] = "hiredis" + self.cpp_info.components["hiredislib"].names["cmake_find_package_multi"] = "hiredis" + self.cpp_info.components["hiredislib"].libs = [f"hiredis{suffix}"] + if self.settings.os == "Windows": + self.cpp_info.components["hiredislib"].system_libs = ["ws2_32"] + # hiredis_ssl + if self.options.with_ssl: + self.cpp_info.components["hiredis_ssl"].set_property("cmake_target_name", "hiredis::hiredis_ssl") + self.cpp_info.components["hiredis_ssl"].set_property("pkg_config_name", "hiredis_ssl") + self.cpp_info.components["hiredis_ssl"].names["cmake_find_package"] = "hiredis_ssl" + self.cpp_info.components["hiredis_ssl"].names["cmake_find_package_multi"] = "hiredis_ssl" + self.cpp_info.components["hiredis_ssl"].libs = [f"hiredis_ssl{suffix}"] + self.cpp_info.components["hiredis_ssl"].requires = ["openssl::ssl"] + if self.settings.os == "Windows": + self.cpp_info.components["hiredis_ssl"].requires.append("hiredislib") + + # These cmake_target_name and pkg_config_name are unofficial. It avoids conflicts + # in conan generators between global target/pkg-config and hiredislib component. + # TODO: eventually remove the cmake_target_name trick if conan can implement smarter logic + # in CMakeDeps when a downstream recipe requires another recipe globally + # (link to all components directly instead of global target) + self.cpp_info.set_property("cmake_target_name", "hiredis::hiredis_all_unofficial") + self.cpp_info.set_property("pkg_config_name", "hiredis_all_unofficial") diff --git a/recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch b/recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch new file mode 100644 index 0000000000000..630a4c0250233 --- /dev/null +++ b/recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.4.0) +-INCLUDE(GNUInstallDirs) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.8) + PROJECT(hiredis) ++INCLUDE(GNUInstallDirs) + + OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) + OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) +@@ -40,7 +40,8 @@ IF(WIN32) + ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN) + ENDIF() + +-ADD_LIBRARY(hiredis SHARED ${hiredis_sources}) ++ADD_LIBRARY(hiredis ${hiredis_sources}) ++target_compile_features(hiredis PUBLIC c_std_99) + + SET_TARGET_PROPERTIES(hiredis + PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE +@@ -97,7 +98,7 @@ IF(ENABLE_SSL) + FIND_PACKAGE(OpenSSL REQUIRED) + SET(hiredis_ssl_sources + ssl.c) +- ADD_LIBRARY(hiredis_ssl SHARED ++ ADD_LIBRARY(hiredis_ssl + ${hiredis_ssl_sources}) + + IF (APPLE) +@@ -109,8 +110,7 @@ IF(ENABLE_SSL) + WINDOWS_EXPORT_ALL_SYMBOLS TRUE + VERSION "${HIREDIS_SONAME}") + +- TARGET_INCLUDE_DIRECTORIES(hiredis_ssl PRIVATE "${OPENSSL_INCLUDE_DIR}") +- TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE ${OPENSSL_LIBRARIES}) ++ TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE OpenSSL::SSL) + IF (WIN32 OR MINGW) + TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE hiredis) + ENDIF() diff --git a/recipes/hiredis/all/patches/0001-fix-cmake-1.1.0.patch b/recipes/hiredis/all/patches/0001-fix-cmake-1.1.0.patch new file mode 100644 index 0000000000000..02e57dfa04bfa --- /dev/null +++ b/recipes/hiredis/all/patches/0001-fix-cmake-1.1.0.patch @@ -0,0 +1,219 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d52d0c..59f9e7a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,5 @@ + CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) + +-OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) +-OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) +-OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF) +-OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF) + + MACRO(getVersionBit name) + SET(VERSION_REGEX "^#define ${name} (.+)$") +@@ -22,6 +18,11 @@ MESSAGE("Detected version: ${VERSION}") + PROJECT(hiredis LANGUAGES "C" VERSION "${VERSION}") + INCLUDE(GNUInstallDirs) + ++OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) ++OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) ++OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF) ++OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF) ++ + # Hiredis requires C99 + SET(CMAKE_C_STANDARD 99) + SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +@@ -44,36 +45,45 @@ IF(WIN32) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN) + ENDIF() + +-ADD_LIBRARY(hiredis SHARED ${hiredis_sources}) +-ADD_LIBRARY(hiredis_static STATIC ${hiredis_sources}) +-ADD_LIBRARY(hiredis::hiredis ALIAS hiredis) +-ADD_LIBRARY(hiredis::hiredis_static ALIAS hiredis_static) ++if(BUILD_SHARED_LIBS) ++ ADD_LIBRARY(hiredis SHARED ${hiredis_sources}) ++ ADD_LIBRARY(hiredis::hiredis ALIAS hiredis) ++ SET_TARGET_PROPERTIES(hiredis ++ PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE ++ VERSION "${HIREDIS_SONAME}") + +-IF(NOT MSVC) +- SET_TARGET_PROPERTIES(hiredis_static +- PROPERTIES OUTPUT_NAME hiredis) +-ENDIF() ++ IF(WIN32 OR MINGW) ++ TARGET_LINK_LIBRARIES(hiredis PUBLIC ws2_32 crypt32) ++ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") ++ TARGET_LINK_LIBRARIES(hiredis PUBLIC m) ++ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS") ++ TARGET_LINK_LIBRARIES(hiredis PUBLIC socket) ++ ENDIF() + +-SET_TARGET_PROPERTIES(hiredis +- PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE +- VERSION "${HIREDIS_SONAME}") +-IF(MSVC) +- SET_TARGET_PROPERTIES(hiredis_static +- PROPERTIES COMPILE_FLAGS /Z7) +-ENDIF() +-IF(WIN32 OR MINGW) +- TARGET_LINK_LIBRARIES(hiredis PUBLIC ws2_32 crypt32) +- TARGET_LINK_LIBRARIES(hiredis_static PUBLIC ws2_32 crypt32) +-ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +- TARGET_LINK_LIBRARIES(hiredis PUBLIC m) +- TARGET_LINK_LIBRARIES(hiredis_static PUBLIC m) +-ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS") +- TARGET_LINK_LIBRARIES(hiredis PUBLIC socket) +- TARGET_LINK_LIBRARIES(hiredis_static PUBLIC socket) +-ENDIF() ++ TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $ $) ++else() ++ ADD_LIBRARY(hiredis_static STATIC ${hiredis_sources}) ++ ADD_LIBRARY(hiredis::hiredis_static ALIAS hiredis_static) ++ ++ IF(NOT MSVC) ++ SET_TARGET_PROPERTIES(hiredis_static ++ PROPERTIES OUTPUT_NAME hiredis) ++ ENDIF() ++ IF(MSVC) ++ SET_TARGET_PROPERTIES(hiredis_static ++ PROPERTIES COMPILE_FLAGS /Z7) ++ ENDIF() + +-TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $ $) +-TARGET_INCLUDE_DIRECTORIES(hiredis_static PUBLIC $ $) ++ IF(WIN32 OR MINGW) ++ TARGET_LINK_LIBRARIES(hiredis_static PUBLIC ws2_32 crypt32) ++ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") ++ TARGET_LINK_LIBRARIES(hiredis_static PUBLIC m) ++ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS") ++ TARGET_LINK_LIBRARIES(hiredis_static PUBLIC socket) ++ ENDIF() ++ ++ TARGET_INCLUDE_DIRECTORIES(hiredis_static PUBLIC $ $) ++endif() + + CONFIGURE_FILE(hiredis.pc.in hiredis.pc @ONLY) + +@@ -103,13 +113,21 @@ set(CPACK_RPM_PACKAGE_AUTOREQPROV ON) + + include(CPack) + +-INSTALL(TARGETS hiredis hiredis_static +- EXPORT hiredis-targets +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++if(BUILD_SHARED_LIBS) ++ INSTALL(TARGETS hiredis ++ EXPORT hiredis-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++else() ++ INSTALL(TARGETS hiredis_static ++ EXPORT hiredis-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() + +-if (MSVC) ++if (0) + INSTALL(FILES $ + DESTINATION ${CMAKE_INSTALL_BINDIR} + CONFIGURATIONS Debug RelWithDebInfo) +@@ -161,45 +179,57 @@ IF(ENABLE_SSL) + FIND_PACKAGE(OpenSSL REQUIRED) + SET(hiredis_ssl_sources + ssl.c) +- ADD_LIBRARY(hiredis_ssl SHARED +- ${hiredis_ssl_sources}) +- ADD_LIBRARY(hiredis_ssl_static STATIC +- ${hiredis_ssl_sources}) +- IF(NOT MSVC) +- SET_TARGET_PROPERTIES(hiredis_ssl_static +- PROPERTIES OUTPUT_NAME hiredis_ssl) +- ENDIF() +- +- IF (APPLE) +- SET_PROPERTY(TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup") +- ENDIF() + +- SET_TARGET_PROPERTIES(hiredis_ssl +- PROPERTIES +- WINDOWS_EXPORT_ALL_SYMBOLS TRUE +- VERSION "${HIREDIS_SONAME}") +- IF(MSVC) +- SET_TARGET_PROPERTIES(hiredis_ssl_static +- PROPERTIES COMPILE_FLAGS /Z7) +- ENDIF() +- +- TARGET_INCLUDE_DIRECTORIES(hiredis_ssl PRIVATE "${OPENSSL_INCLUDE_DIR}") +- TARGET_INCLUDE_DIRECTORIES(hiredis_ssl_static PRIVATE "${OPENSSL_INCLUDE_DIR}") ++ if(BUILD_SHARED_LIBS) ++ ADD_LIBRARY(hiredis_ssl SHARED ++ ${hiredis_ssl_sources}) ++ IF (APPLE) ++ SET_PROPERTY(TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup") ++ ENDIF() ++ SET_TARGET_PROPERTIES(hiredis_ssl ++ PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE ++ VERSION "${HIREDIS_SONAME}") ++ TARGET_INCLUDE_DIRECTORIES(hiredis_ssl PRIVATE "${OPENSSL_INCLUDE_DIR}") ++ TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE OpenSSL::SSL) ++ ++ IF (WIN32 OR MINGW) ++ TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE hiredis) ++ ENDIF() ++ else() ++ ADD_LIBRARY(hiredis_ssl_static STATIC ++ ${hiredis_ssl_sources}) ++ IF(NOT MSVC) ++ SET_TARGET_PROPERTIES(hiredis_ssl_static ++ PROPERTIES OUTPUT_NAME hiredis_ssl) ++ ENDIF() ++ IF(MSVC) ++ SET_TARGET_PROPERTIES(hiredis_ssl_static ++ PROPERTIES COMPILE_FLAGS /Z7) ++ ENDIF() ++ TARGET_INCLUDE_DIRECTORIES(hiredis_ssl_static PRIVATE "${OPENSSL_INCLUDE_DIR}") ++ IF (WIN32 OR MINGW) ++ TARGET_LINK_LIBRARIES(hiredis_ssl_static PUBLIC hiredis_static) ++ ENDIF() ++ endif() + +- TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE ${OPENSSL_LIBRARIES}) +- IF (WIN32 OR MINGW) +- TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE hiredis) +- TARGET_LINK_LIBRARIES(hiredis_ssl_static PUBLIC hiredis_static) +- ENDIF() + CONFIGURE_FILE(hiredis_ssl.pc.in hiredis_ssl.pc @ONLY) + +- INSTALL(TARGETS hiredis_ssl hiredis_ssl_static +- EXPORT hiredis_ssl-targets +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ if(BUILD_SHARED_LIBS) ++ INSTALL(TARGETS hiredis_ssl ++ EXPORT hiredis_ssl-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ else() ++ INSTALL(TARGETS hiredis_ssl_static ++ EXPORT hiredis_ssl-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ endif() + +- if (MSVC) ++ if (0) + INSTALL(FILES $ + DESTINATION ${CMAKE_INSTALL_BINDIR} + CONFIGURATIONS Debug RelWithDebInfo) diff --git a/recipes/hiredis/all/patches/0002-fix-aix.patch b/recipes/hiredis/all/patches/0002-fix-aix.patch new file mode 100644 index 0000000000000..7aa6522eebdf3 --- /dev/null +++ b/recipes/hiredis/all/patches/0002-fix-aix.patch @@ -0,0 +1,15 @@ +diff --git a/fmacros.h b/fmacros.h +index 3227faa..754a53c 100644 +--- a/fmacros.h ++++ b/fmacros.h +@@ -1,8 +1,10 @@ + #ifndef __HIREDIS_FMACRO_H + #define __HIREDIS_FMACRO_H + ++#ifndef _AIX + #define _XOPEN_SOURCE 600 + #define _POSIX_C_SOURCE 200112L ++#endif + + #if defined(__APPLE__) && defined(__MACH__) + /* Enable TCP_KEEPALIVE */ diff --git a/recipes/hiredis/all/test_package/CMakeLists.txt b/recipes/hiredis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..49e1f3d74c74e --- /dev/null +++ b/recipes/hiredis/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(hiredis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) diff --git a/recipes/hiredis/all/test_package/conanfile.py b/recipes/hiredis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/hiredis/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/hiredis/all/test_package/test_package.c b/recipes/hiredis/all/test_package/test_package.c new file mode 100644 index 0000000000000..db64e7ee1c746 --- /dev/null +++ b/recipes/hiredis/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include + +#include +#include + +#ifdef _MSC_VER +#include +#endif + +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; + struct timeval timeout = {2, 0}; + + redisContext *c = redisConnectWithTimeout(hostname, port, timeout); + if (c == NULL) { + printf("Error: Can't allocate redis context\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/hiredis/all/test_v1_package/CMakeLists.txt b/recipes/hiredis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1ea1807c4774 --- /dev/null +++ b/recipes/hiredis/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hiredis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) diff --git a/recipes/hiredis/all/test_v1_package/conanfile.py b/recipes/hiredis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hiredis/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/hiredis/config.yml b/recipes/hiredis/config.yml new file mode 100644 index 0000000000000..b06a4f7517eb0 --- /dev/null +++ b/recipes/hiredis/config.yml @@ -0,0 +1,9 @@ +versions: + "1.1.0": + folder: all + "1.0.2": + folder: all + "1.0.0": + folder: all + "0.14.1": + folder: "0.x.x" diff --git a/recipes/hlslpp/all/conandata.yml b/recipes/hlslpp/all/conandata.yml new file mode 100644 index 0000000000000..41a6668e87c71 --- /dev/null +++ b/recipes/hlslpp/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.2.2": + url: "https://github.com/redorav/hlslpp/archive/refs/tags/3.2.2.tar.gz" + sha256: "f8fae38e6f02920f24344a86397f03b2a7a1fe18bbcb77f4c39bc33978c4a058" + "3.2": + url: "https://github.com/redorav/hlslpp/archive/3.2.tar.gz" + sha256: "23ab0b7f392c518185157e9b1e099eac0a560f4932cebbdf8ccb4a533a0d0336" + "3.1": + url: "https://github.com/redorav/hlslpp/archive/refs/tags/3.1.tar.gz" + sha256: "6f933e43bf8150a41d76a188377e59007897dc87e96be30608e7f2007605d5c4" + "3.0": + url: "https://github.com/redorav/hlslpp/archive/3.0.tar.gz" + sha256: "2ba6d8d3cdfbd0f87d4ede0281a293e872eff8d6390d96d2aab063562072a830" + "2.0": + url: "https://github.com/redorav/hlslpp/archive/2.0.tar.gz" + sha256: "63ca1fb18e129d9daf045160a96867b934c9a4595a094298597ff18192fc476b" diff --git a/recipes/hlslpp/all/conanfile.py b/recipes/hlslpp/all/conanfile.py new file mode 100644 index 0000000000000..d8ccb3fef6db2 --- /dev/null +++ b/recipes/hlslpp/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class HlslppConan(ConanFile): + name = "hlslpp" + description = "Header-only Math library using hlsl syntax with SSE/NEON support" + topics = ("hlsl", "math", "shader", "vector", "matrix", "quaternion") + license = "MIT" + homepage = "https://github.com/redorav/hlslpp" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/hlslpp/all/test_package/CMakeLists.txt b/recipes/hlslpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c9f473983b37c --- /dev/null +++ b/recipes/hlslpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(hlslpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hlslpp::hlslpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/hlslpp/all/test_package/conanfile.py b/recipes/hlslpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/hlslpp/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/hlslpp/all/test_package/test_package.cpp b/recipes/hlslpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..641170a440ce0 --- /dev/null +++ b/recipes/hlslpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +int main() { + hlslpp::float4 foo4 = hlslpp::float4(1, 2, 3, 4); + hlslpp::float3 bar3 = foo4.xzy; + hlslpp::float2 logFoo2 = hlslpp::log(bar3.xz); + foo4.wx = logFoo2.yx; + hlslpp::float4 baz4 = hlslpp::float4(logFoo2, foo4.zz); + hlslpp::float4x4 fooMatrix4x4 = hlslpp::float4x4(1, 2, 3, 4, + 5, 6, 7, 8, + 8, 7, 6, 5, + 4, 3, 2, 1); + hlslpp::float4 myTransformedVector = hlslpp::mul(fooMatrix4x4, baz4); + hlslpp::int2 ifoo2 = hlslpp::int2(1, 2); + hlslpp::int4 ifoo4 = hlslpp::int4(1, 2, 3, 4) + ifoo2.xyxy; + + return 0; +} diff --git a/recipes/hlslpp/all/test_v1_package/CMakeLists.txt b/recipes/hlslpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/hlslpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hlslpp/all/test_v1_package/conanfile.py b/recipes/hlslpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hlslpp/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/hlslpp/config.yml b/recipes/hlslpp/config.yml new file mode 100644 index 0000000000000..199b902f23539 --- /dev/null +++ b/recipes/hlslpp/config.yml @@ -0,0 +1,11 @@ +versions: + "3.2.2": + folder: all + "3.2": + folder: all + "3.1": + folder: all + "3.0": + folder: all + "2.0": + folder: all diff --git a/recipes/homog2d/all/conandata.yml b/recipes/homog2d/all/conandata.yml new file mode 100644 index 0000000000000..376b2a2d1feee --- /dev/null +++ b/recipes/homog2d/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "2.10": + url: "https://github.com/skramm/homog2d/archive/refs/tags/v2.10.tar.gz" + sha256: "fb71f709d78c386188894b7f08a2c4690b45a5695b8d988e24efbe1216c53052" + "2.9": + url: "https://github.com/skramm/homog2d/archive/refs/tags/v2.9.tar.gz" + sha256: "7784237154fd0c1beea5b1ed4349e910ce86ad463d21f4f21019f553834c1dad" + +patches: + "2.9": + - patch_file: "patches/0001-include-array.patch" + patch_description: "include array to solve compilation error on appale-clang" + patch_type: "portability" + - patch_file: "patches/0002-pretty_function-for-msvc.patch" + patch_description: "use __FUNCSIG__ instead of __PRETTY_FUNCTION__ on MSVC" + patch_type: "portability" + - patch_file: "patches/0003-support-msvc.patch" + patch_description: "fix msvc compilation error" + patch_type: "portability" + patch_source: "https://github.com/skramm/homog2d/issues/2" diff --git a/recipes/homog2d/all/conanfile.py b/recipes/homog2d/all/conanfile.py new file mode 100644 index 0000000000000..126a1b155e8d7 --- /dev/null +++ b/recipes/homog2d/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 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 Homog2dConan(ConanFile): + name = "homog2d" + description = "C++ 2D geometry library, handles points, lines, polylines, planar transformations(and other primitives), using homogeneous coordinates." + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/skramm/homog2d" + topics = ("computational-geometry", "homography", "2d-geometric", "header-only") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENCE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="homog2d.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/homog2d/all/patches/0001-include-array.patch b/recipes/homog2d/all/patches/0001-include-array.patch new file mode 100644 index 0000000000000..0e50c1abf4225 --- /dev/null +++ b/recipes/homog2d/all/patches/0001-include-array.patch @@ -0,0 +1,12 @@ +diff --git a/homog2d.hpp b/homog2d.hpp +index 64191fb..f30d150 100644 +--- a/homog2d.hpp ++++ b/homog2d.hpp +@@ -30,6 +30,7 @@ See https://github.com/skramm/homog2d + #include + #include + #include ++#include + #include + #include + #include diff --git a/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch b/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch new file mode 100644 index 0000000000000..5b68d2eeb13ec --- /dev/null +++ b/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch @@ -0,0 +1,33 @@ +diff --git a/homog2d.hpp b/homog2d.hpp +index f30d150..d82d7e5 100644 +--- a/homog2d.hpp ++++ b/homog2d.hpp +@@ -115,12 +115,18 @@ See https://github.com/skramm/homog2d + #define HOMOG2D_BIND_Y y + #endif + ++#ifdef _MSC_VER ++ #define HOMOG2D_PRETTY_FUNCTION __FUNCSIG__ ++#else ++ #define HOMOG2D_PRETTY_FUNCTION __PRETTY_FUNCTION__ ++#endif ++ + /// Error throw wrapper macro + #define HOMOG2D_THROW_ERROR_1( msg ) \ + { \ + std::ostringstream oss; \ + oss << "homog2d: line " << __LINE__ << ", function:" << __FUNCTION__ << "(): " \ +- << msg << "\n -full function name: " << __PRETTY_FUNCTION__ \ ++ << msg << "\n -full function name: " << HOMOG2D_PRETTY_FUNCTION \ + << "\n -Error count=" << ++errorCount(); \ + throw std::runtime_error( oss.str() ); \ + } +@@ -130,7 +136,7 @@ See https://github.com/skramm/homog2d + { \ + std::ostringstream oss; \ + oss << "homog2d: line " << __LINE__ << ", function:" << func << "(): " \ +- << msg << "\n -full function name: " << __PRETTY_FUNCTION__ \ ++ << msg << "\n -full function name: " << HOMOG2D_PRETTY_FUNCTION \ + << "\n -Error count=" << ++errorCount(); \ + throw std::runtime_error( oss.str() ); \ + } diff --git a/recipes/homog2d/all/patches/0003-support-msvc.patch b/recipes/homog2d/all/patches/0003-support-msvc.patch new file mode 100644 index 0000000000000..5897903f1959f --- /dev/null +++ b/recipes/homog2d/all/patches/0003-support-msvc.patch @@ -0,0 +1,22 @@ +diff --git a/homog2d.hpp b/homog2d.hpp +index 77f6841..ab8646b 100644 +--- a/homog2d.hpp ++++ b/homog2d.hpp +@@ -729,12 +729,11 @@ auto + operator << ( std::ostream&, const h2d::base::LPBase& ) + -> std::ostream&; + } +-/* +-template +-auto +-operator << ( std::ostream&, const h2d::Point2d_& ) +--> std::ostream&; +-*/ ++ ++// forward declaration, related to https://github.com/skramm/homog2d/issues/2 ++template ++Line2d_ ++operator * ( const Homogr_&, const Line2d_& ); + + namespace detail { + diff --git a/recipes/homog2d/all/test_package/CMakeLists.txt b/recipes/homog2d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5abd7206722e3 --- /dev/null +++ b/recipes/homog2d/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(homog2d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE homog2d::homog2d) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/homog2d/all/test_package/conanfile.py b/recipes/homog2d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/homog2d/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/homog2d/all/test_package/test_package.cpp b/recipes/homog2d/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bb7225471a2b4 --- /dev/null +++ b/recipes/homog2d/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include "homog2d.hpp" +using namespace h2d; + +int main() { + Line2d l1( Point2d(10,10) ); // a line passing through (0,0) and (10,10) + Line2d l2( Point2d(0,10), Point2d(10,0) ); // a line passing through (0,10) and (10,0) + auto pt = l1 * l2; // intersection point (5,5) + Homogr H(2,3); // a translation matrix + std::cout << H * pt; // prints [7,8] + + return 0; +} diff --git a/recipes/homog2d/all/test_v1_package/CMakeLists.txt b/recipes/homog2d/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/homog2d/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/homog2d/all/test_v1_package/conanfile.py b/recipes/homog2d/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/homog2d/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/homog2d/config.yml b/recipes/homog2d/config.yml new file mode 100644 index 0000000000000..7772686420d4e --- /dev/null +++ b/recipes/homog2d/config.yml @@ -0,0 +1,5 @@ +versions: + "2.10": + folder: all + "2.9": + folder: all diff --git a/recipes/http_parser/all/CMakeLists.txt b/recipes/http_parser/all/CMakeLists.txt new file mode 100644 index 0000000000000..d38794fd0cf94 --- /dev/null +++ b/recipes/http_parser/all/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.4) +project(http_parser LANGUAGES C) + +include(GNUInstallDirs) + +add_library(http_parser ${HTTP_PARSER_SRC_DIR}/http_parser.c) +set_target_properties(http_parser PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +install(TARGETS http_parser + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +install(FILES ${HTTP_PARSER_SRC_DIR}/http_parser.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/http_parser/all/conandata.yml b/recipes/http_parser/all/conandata.yml new file mode 100644 index 0000000000000..463d6f2b2bbfd --- /dev/null +++ b/recipes/http_parser/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.9.4": + url: "https://github.com/nodejs/http-parser/archive/v2.9.4.tar.gz" + sha256: "467b9e30fd0979ee301065e70f637d525c28193449e1b13fbcb1b1fab3ad224f" + "2.9.3": + url: "https://github.com/nodejs/http-parser/archive/v2.9.3.tar.gz" + sha256: "8fa0ab8770fd8425a9b431fdbf91623c4d7a9cdb842b9339289bd2b0b01b0d3d" + "2.9.2": + url: "https://github.com/nodejs/http-parser/archive/v2.9.2.tar.gz" + sha256: "5199500e352584852c95c13423edc5f0cb329297c81dd69c3c8f52a75496da08" diff --git a/recipes/http_parser/all/conanfile.py b/recipes/http_parser/all/conanfile.py new file mode 100644 index 0000000000000..0223cb4a807aa --- /dev/null +++ b/recipes/http_parser/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class HttpParserConan(ConanFile): + name = "http_parser" + description = "http request/response parser for c" + topics = ("http", "parser") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nodejs/http-parser" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + 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["HTTP_PARSER_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-MIT", 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 = ["http_parser"] diff --git a/recipes/http_parser/all/test_package/CMakeLists.txt b/recipes/http_parser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..901fc9ff7c382 --- /dev/null +++ b/recipes/http_parser/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(http_parser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE http_parser::http_parser) diff --git a/recipes/http_parser/all/test_package/conanfile.py b/recipes/http_parser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/http_parser/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/http_parser/all/test_package/test_package.c b/recipes/http_parser/all/test_package/test_package.c new file mode 100644 index 0000000000000..b1c7b81473f04 --- /dev/null +++ b/recipes/http_parser/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include + +int main() +{ + unsigned long version = http_parser_version(); + unsigned major = (version >> 16) & 255; + unsigned minor = (version >> 8) & 255; + unsigned patch = version & 255; + printf("http_parser v%u.%u.%u\n", major, minor, patch); + return 0; +} diff --git a/recipes/http_parser/all/test_v1_package/CMakeLists.txt b/recipes/http_parser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b0c36fbcd127a --- /dev/null +++ b/recipes/http_parser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(http_parser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE http_parser::http_parser) diff --git a/recipes/http_parser/all/test_v1_package/conanfile.py b/recipes/http_parser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/http_parser/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/http_parser/config.yml b/recipes/http_parser/config.yml new file mode 100644 index 0000000000000..9c27cb28da423 --- /dev/null +++ b/recipes/http_parser/config.yml @@ -0,0 +1,7 @@ +versions: + "2.9.4": + folder: all + "2.9.3": + folder: all + "2.9.2": + folder: all diff --git a/recipes/huffman/all/CMakeLists.txt b/recipes/huffman/all/CMakeLists.txt new file mode 100644 index 0000000000000..9aabf6f61cc5b --- /dev/null +++ b/recipes/huffman/all/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required (VERSION 3.4) +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") +project (huffman) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) + +if(MSVC) + add_definitions (-D_WIN32_WINNT=0x0601) + add_definitions (-D_SCL_SECURE_NO_WARNINGS=1) + add_definitions (-D_CRT_SECURE_NO_WARNINGS=1) + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /utf-8") +endif() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +add_library(huffman + source_subfolder/huffman.c +) + +if(WIN32) + target_link_libraries(huffman ws2_32) +endif() + +INSTALL(TARGETS huffman + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +set(HEADERS + source_subfolder/huffman.h +) + +INSTALL(FILES ${HEADERS} DESTINATION include/huffman) diff --git a/recipes/huffman/all/conandata.yml b/recipes/huffman/all/conandata.yml new file mode 100644 index 0000000000000..25d1ea6cda398 --- /dev/null +++ b/recipes/huffman/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.2.7": + # Don't use tar.gz because test data files in tar.gz has invalid paths on Windows. + url: "https://github.com/drichardson/huffman/archive/refs/tags/v1.2.7.zip" + sha256: "0d382f271daf47623676307710cb05d246839247370989b8ffa6fee82bea375a" + "1.2.2": + url: "https://github.com/drichardson/huffman/archive/refs/tags/v1.2.2.zip" + sha256: "7968728c4a0e2705575e9f03e0252cb5195919756d3a64343255f518548cb533" +patches: + "1.2.7": + - patch_file: "patches/1.2.7-0001-use-_WIN32.patch" + base_path: "source_subfolder" + "1.2.2": + - patch_file: "patches/1.2.2-0001-use-_WIN32.patch" + base_path: "source_subfolder" diff --git a/recipes/huffman/all/conanfile.py b/recipes/huffman/all/conanfile.py new file mode 100644 index 0000000000000..6cbfd60d77f27 --- /dev/null +++ b/recipes/huffman/all/conanfile.py @@ -0,0 +1,69 @@ +from conans import ConanFile, CMake, tools +import functools + +required_conan_version = ">=1.33.0" + +class HuffmanConan(ConanFile): + name = "huffman" + description = "huffman encoder/decoder" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/drichardson/huffman" + topics = ["huffman", "encoder", "decoder", "compression"] + settings = "os", "arch", "compiler","build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + 'shared': False, + 'fPIC': True, + } + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + 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 configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE*", dst="licenses", + src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs.append("huffman") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch b/recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch new file mode 100644 index 0000000000000..f04952ff087f5 --- /dev/null +++ b/recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch @@ -0,0 +1,13 @@ +diff --git a/a/huffman.c b/b/huffman.c +index 81959cb..ecea371 100644 +--- a/a/huffman.c ++++ b/b/huffman.c +@@ -11,7 +11,7 @@ + #include + #include + +-#ifdef WIN32 ++#if defined _WIN32 || defined __CYGWIN__ + #include + #include + #else diff --git a/recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch b/recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch new file mode 100644 index 0000000000000..9c1fe246e8193 --- /dev/null +++ b/recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch @@ -0,0 +1,13 @@ +diff --git a/a/huffman.c b/b/huffman.c +index 7cae8c1..34f3101 100644 +--- a/a/huffman.c ++++ b/b/huffman.c +@@ -6,7 +6,7 @@ + #include + #include + +-#ifdef WIN32 ++#if defined _WIN32 || defined __CYGWIN__ + #include + #include + #else diff --git a/recipes/huffman/all/test_package/CMakeLists.txt b/recipes/huffman/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cca65fc1e8c24 --- /dev/null +++ b/recipes/huffman/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(huffman REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} huffman::huffman) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/huffman/all/test_package/conanfile.py b/recipes/huffman/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/huffman/all/test_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/huffman/all/test_package/test_package.cpp b/recipes/huffman/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..341d7516dbf71 --- /dev/null +++ b/recipes/huffman/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +extern "C" { +#include "huffman/huffman.h" +} + +int main() { + uint8_t in[3] = {'a', 'b', 'c'}; + uint8_t *out = new uint8_t[10]; + uint32_t out_len = 0; + huffman_encode_memory(in, 3, &out, &out_len); + + return 0; +} diff --git a/recipes/huffman/config.yml b/recipes/huffman/config.yml new file mode 100644 index 0000000000000..1bf1c0d4bfeb0 --- /dev/null +++ b/recipes/huffman/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.7": + folder: all + "1.2.2": + folder: all diff --git a/recipes/hunspell/all/CMakeLists.txt b/recipes/hunspell/all/CMakeLists.txt new file mode 100644 index 0000000000000..b2bc98f40adab --- /dev/null +++ b/recipes/hunspell/all/CMakeLists.txt @@ -0,0 +1,69 @@ +cmake_minimum_required(VERSION 3.1) + +project(hunspell VERSION "${CONAN_hunspell_VERSION}" LANGUAGES CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) +set(src src/hunspell) + +# ---- Configure hunvisapi.h ---- + +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY) +configure_file("${src}/hunvisapi.h.in" hunvisapi.h @ONLY) + +# ---- Library target ---- + +add_library( + hunspell + "${src}/affentry.cxx" + "${src}/affixmgr.cxx" + "${src}/csutil.cxx" + "${src}/filemgr.cxx" + "${src}/hashmgr.cxx" + "${src}/hunspell.cxx" + "${src}/hunzip.cxx" + "${src}/phonet.cxx" + "${src}/replist.cxx" + "${src}/suggestmgr.cxx" +) + +if(MSVC) + target_compile_options(hunspell PRIVATE /wd4267 /wd4996) +endif() + +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(hunspell PRIVATE HUNSPELL_STATIC) +endif() +target_compile_definitions(hunspell PRIVATE BUILDING_LIBHUNSPELL) + +target_include_directories(hunspell PRIVATE "${src}" "${PROJECT_BINARY_DIR}") + +set_target_properties( + hunspell PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN YES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}" +) + +# ---- Install ---- + +include(GNUInstallDirs) + +install( + TARGETS hunspell + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) + +install( + FILES + "${src}/hunspell.hxx" + "${src}/hunspell.h" + "${src}/w_char.hxx" + "${src}/atypes.hxx" + "${PROJECT_BINARY_DIR}/hunvisapi.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hunspell" +) diff --git a/recipes/hunspell/all/conandata.yml b/recipes/hunspell/all/conandata.yml new file mode 100644 index 0000000000000..6c8c08bc2e4b0 --- /dev/null +++ b/recipes/hunspell/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.7.0": + sha256: "57be4e03ae9dd62c3471f667a0d81a14513e314d4d92081292b90435944ff951" + url: https://github.com/hunspell/hunspell/files/2573619/hunspell-1.7.0.tar.gz diff --git a/recipes/hunspell/all/conanfile.py b/recipes/hunspell/all/conanfile.py new file mode 100644 index 0000000000000..6c74ea78eaba7 --- /dev/null +++ b/recipes/hunspell/all/conanfile.py @@ -0,0 +1,67 @@ +import functools +import os + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + + +class HunspellConan(ConanFile): + name = "hunspell" + description = ( + "Hunspell is a free spell checker and morphological analyzer library" + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://hunspell.github.io/" + topics = "spell", "spell-check" + license = "MPL-1.1", "GPL-2.0-or-later", "LGPL-2.1-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + # FIXME: Remove once the pending upstream PR for CMake support is merged + exports_sources = "CMakeLists.txt" + no_copy_source = True + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True) + # NOTE: The source contains a pre-configured hunvisapi.h and it would + # prevent no_copy_source and building without patches. + h = os.path.join(self.source_folder, "src", "hunspell", "hunvisapi.h") + os.remove(h) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["CONAN_hunspell_VERSION"] = self.version + cmake.configure() + return cmake + + def build(self): + self._configure_cmake().build() + + def package(self): + self._configure_cmake().install() + self.copy("COPYING", "licenses") + self.copy("COPYING.LESSER", "licenses") + self.copy("license.hunspell", "licenses") + + def package_info(self): + self.cpp_info.libs = ["hunspell"] + if not self.options.shared: + self.cpp_info.defines = ["HUNSPELL_STATIC"] diff --git a/recipes/hunspell/all/test_package/CMakeLists.txt b/recipes/hunspell/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..73177e055de6d --- /dev/null +++ b/recipes/hunspell/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(hunspell REQUIRED CONFIG) + +add_executable(test_package test_package.cxx) +target_link_libraries(test_package PRIVATE hunspell::hunspell) diff --git a/recipes/hunspell/all/test_package/conanfile.py b/recipes/hunspell/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a8c92dea63335 --- /dev/null +++ b/recipes/hunspell/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.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/hunspell/all/test_package/test_package.cxx b/recipes/hunspell/all/test_package/test_package.cxx new file mode 100644 index 0000000000000..a504023ab95f9 --- /dev/null +++ b/recipes/hunspell/all/test_package/test_package.cxx @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const* argv[]) +{ + (void)argc; + (void)argv; + + Hunspell_destroy(NULL); + + return 0; +} diff --git a/recipes/hunspell/config.yml b/recipes/hunspell/config.yml new file mode 100644 index 0000000000000..0f57b11de8fb0 --- /dev/null +++ b/recipes/hunspell/config.yml @@ -0,0 +1,3 @@ +versions: + "1.7.0": + folder: all diff --git a/recipes/hyperscan/all/conandata.yml b/recipes/hyperscan/all/conandata.yml new file mode 100644 index 0000000000000..b46d4ac06c616 --- /dev/null +++ b/recipes/hyperscan/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "5.4.0": + url: "https://github.com/intel/hyperscan/archive/v5.4.0.tar.gz" + sha256: "e51aba39af47e3901062852e5004d127fa7763b5dbbc16bcca4265243ffa106f" +patches: + "5.4.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "modify cmake files to build with conan" + patch_type: "conan" + - patch_file: "patches/0002-use-ue2-make_unique.patch" + patch_description: "add ue2:: prefix to make_unique for name collision" + patch_type: "portability" diff --git a/recipes/hyperscan/all/conanfile.py b/recipes/hyperscan/all/conanfile.py new file mode 100644 index 0000000000000..5e30dac82fb95 --- /dev/null +++ b/recipes/hyperscan/all/conanfile.py @@ -0,0 +1,129 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class HyperscanConan(ConanFile): + name = "hyperscan" + description = "High-performance regular expression matching library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.hyperscan.io" + topics = ("regex", "regular expressions") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "optimise": [True, False, "auto"], + "debug_output": [True, False, "auto"], + "build_avx512": [True, False], + "fat_runtime": [True, False], + "build_chimera": [True, False], + "dump_support": [True, False, "auto"], + } + default_options = { + "shared": False, + "fPIC": True, + "optimise": "auto", + "debug_output": "auto", + "build_avx512": False, + "fat_runtime": False, + "build_chimera": False, + "dump_support": "auto", + } + + @property + def _min_cppstd(self): + return 11 + + 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.81.0") + if self.options.build_chimera: + self.requires("pcre/8.45") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if self.options.shared and self.options.build_chimera: + raise ConanInvalidConfiguration("Chimera build requires static building") + + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("Hyperscan only support x86 architecture") + + def build_requirements(self): + self.tool_requires("ragel/6.10") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + if self.options.optimise != "auto": + tc.variables["OPTIMISE"] = self.options.optimise + if self.options.debug_output != "auto": + tc.variables["DEBUG_OUTPUT"] = self.options.debug_output + tc.variables["BUILD_AVX512"] = self.options.build_avx512 + tc.variables["FAT_RUNTIME"] = self.options.fat_runtime + tc.variables["BUILD_CHIMERA"] = self.options.build_chimera + if self.options.dump_support != "auto": + tc.variables["DUMP_SUPPORT"] = self.options.dump_support + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.components["hs"].set_property("pkg_config_name", "libhs") + self.cpp_info.components["hs"].libs = ["hs"] + self.cpp_info.components["hs"].requires = ["boost::headers"] + + self.cpp_info.components["hs_runtime"].libs = ["hs_runtime"] + + if self.options.build_chimera: + self.cpp_info.components["chimera"].set_property("pkg_config_name", "libch") + self.cpp_info.components["chimera"].libs = ["chimera"] + self.cpp_info.components["chimera"].requires = ["pcre::libpcre", "hs"] + + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["hs"].system_libs = ["m"] + self.cpp_info.components["hs_runtime"].system_libs = ["m"] + + if self.options.build_chimera: + self.cpp_info.components["chimera"].system_libs = ["m"] diff --git a/recipes/hyperscan/all/patches/0001-fix-cmake.patch b/recipes/hyperscan/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..872966c197543 --- /dev/null +++ b/recipes/hyperscan/all/patches/0001-fix-cmake.patch @@ -0,0 +1,327 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8bc6077..0fbed25 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ set (HS_MINOR_VERSION 4) + set (HS_PATCH_VERSION 0) + set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) + +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ++list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + include(CheckCCompilerFlag) + include(CheckCXXCompilerFlag) + include(CheckCXXSymbolExists) +@@ -17,8 +17,8 @@ INCLUDE (CheckLibraryExists) + INCLUDE (CheckSymbolExists) + include (CMakeDependentOption) + include (GNUInstallDirs) +-include (${CMAKE_MODULE_PATH}/platform.cmake) +-include (${CMAKE_MODULE_PATH}/ragel.cmake) ++include (platform) ++include (ragel) + + find_package(PkgConfig QUIET) + +@@ -69,7 +69,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src) + include_directories(${PROJECT_BINARY_DIR}) + include_directories(SYSTEM include) + +-include (${CMAKE_MODULE_PATH}/boost.cmake) ++include (boost) + + # -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6) + find_package(PythonInterp) +@@ -84,7 +84,7 @@ endif() + # allow for reproducible builds - python for portability + if (DEFINED ENV{SOURCE_DATE_EPOCH}) + execute_process( +- COMMAND "${PYTHON}" "${CMAKE_MODULE_PATH}/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" ++ COMMAND "${PYTHON}" "${PROJECT_SOURCE_DIR}/cmake/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" + OUTPUT_VARIABLE BUILD_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + else () +@@ -326,7 +326,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") + message (STATUS "Building the fat runtime requires the Unix Makefiles generator, or Ninja with CMake v3.0 or higher") + set (FAT_RUNTIME_REQUISITES FALSE) + else() +- include (${CMAKE_MODULE_PATH}/attrib.cmake) ++ include (attrib) + if (NOT HAS_C_ATTR_IFUNC) + message(STATUS "Compiler does not support ifunc attribute, cannot build fat runtime") + set (FAT_RUNTIME_REQUISITES FALSE) +@@ -337,7 +337,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") + CMAKE_DEPENDENT_OPTION(FAT_RUNTIME "Build a library that supports multiple microarchitectures" ${RELEASE_BUILD} "FAT_RUNTIME_REQUISITES" OFF) + endif () + +-include (${CMAKE_MODULE_PATH}/arch.cmake) ++include (arch) + + # testing a builtin takes a little more work + CHECK_C_SOURCE_COMPILES("void *aa_test(void *x) { return __builtin_assume_aligned(x, 16);}\nint main(void) { return 0; }" HAVE_CC_BUILTIN_ASSUME_ALIGNED) +@@ -463,7 +463,7 @@ else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + +-add_subdirectory(util) ++# add_subdirectory(util) + add_subdirectory(doc/dev-reference) + + if (NOT WIN32) +@@ -472,7 +472,7 @@ if (NOT WIN32) + set(PCRE_REQUIRED_MAJOR_VERSION 8) + set(PCRE_REQUIRED_MINOR_VERSION 41) + set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) +-include (${CMAKE_MODULE_PATH}/pcre.cmake) ++include (pcre) + if (NOT CORRECT_PCRE_VERSION) + message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") + endif() +@@ -482,17 +482,19 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) + endif() + ++if(0) + add_subdirectory(unit) +-if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) + add_subdirectory(tools) + endif() +-if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) + add_subdirectory(chimera) + endif() + endif() + + # do substitutions +-configure_file(${CMAKE_MODULE_PATH}/config.h.in ${PROJECT_BINARY_DIR}/config.h) ++configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h) + configure_file(src/hs_version.h.in ${PROJECT_BINARY_DIR}/hs_version.h) + + if (NOT WIN32) +@@ -505,7 +507,7 @@ if (NOT WIN32) + endforeach() + + configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars +- install(FILES ${CMAKE_BINARY_DIR}/libhs.pc ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libhs.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() + +@@ -524,7 +526,7 @@ if (WIN32) + set(PCRE_REQUIRED_MAJOR_VERSION 8) + set(PCRE_REQUIRED_MINOR_VERSION 41) + set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) +-include (${CMAKE_MODULE_PATH}/pcre.cmake) ++include (pcre) + if (NOT CORRECT_PCRE_VERSION) + message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") + endif() +@@ -534,11 +536,13 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) + endif() + ++if(0) + add_subdirectory(unit) +-if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) + add_subdirectory(tools) + endif() +-if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) + add_subdirectory(chimera) + endif() + endif() +@@ -548,14 +552,14 @@ set(RAGEL_C_FLAGS "-Wno-unused") + endif() + + set_source_files_properties( +- ${CMAKE_BINARY_DIR}/src/parser/Parser.cpp ++ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/Parser.cpp + PROPERTIES + COMPILE_FLAGS "${RAGEL_C_FLAGS}") + + ragelmaker(src/parser/Parser.rl) + + set_source_files_properties( +- ${CMAKE_BINARY_DIR}/src/parser/control_verbs.cpp ++ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/control_verbs.cpp + PROPERTIES + COMPILE_FLAGS "${RAGEL_C_FLAGS}") + +@@ -1216,28 +1220,28 @@ else (FAT_RUNTIME) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_core2 PROPERTIES + COMPILE_FLAGS "-march=core2" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + add_library(hs_exec_corei7 OBJECT ${hs_exec_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_corei7 PROPERTIES + COMPILE_FLAGS "-march=corei7" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + add_library(hs_exec_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx2 PROPERTIES + COMPILE_FLAGS "-march=core-avx2" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + if (BUILD_AVX512) + add_library(hs_exec_avx512 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx512 PROPERTIES + COMPILE_FLAGS "${SKYLAKE_FLAG}" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512) + if (BUILD_AVX512VBMI) +@@ -1245,7 +1249,7 @@ else (FAT_RUNTIME) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx512vbmi PROPERTIES + COMPILE_FLAGS "${ICELAKE_FLAG}" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512VBMI) + +@@ -1280,21 +1284,21 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_core2 PROPERTIES + COMPILE_FLAGS "-march=core2" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + add_library(hs_exec_shared_corei7 OBJECT ${hs_exec_SRCS}) + list(APPEND RUNTIME_SHLIBS $) + set_target_properties(hs_exec_shared_corei7 PROPERTIES + COMPILE_FLAGS "-march=corei7" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + add_library(hs_exec_shared_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_SHLIBS $) + set_target_properties(hs_exec_shared_avx2 PROPERTIES + COMPILE_FLAGS "-march=core-avx2" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + if (BUILD_AVX512) +@@ -1303,7 +1307,7 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_avx512 PROPERTIES + COMPILE_FLAGS "${SKYLAKE_FLAG}" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512) + if (BUILD_AVX512VBMI) +@@ -1312,7 +1316,7 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_avx512vbmi PROPERTIES + COMPILE_FLAGS "${ICELAKE_FLAG}" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512VBMI) + add_library(hs_exec_common_shared OBJECT +diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt +index 1cd66a3..ebb3b49 100644 +--- a/chimera/CMakeLists.txt ++++ b/chimera/CMakeLists.txt +@@ -44,6 +44,6 @@ if (NOT WIN32) + set(PRIVATE_LIBS "${PRIVATE_LIBS} -L${LIBDIR} -lpcre") + + configure_file(libch.pc.in libch.pc @ONLY) # only replace @ quoted vars +- install(FILES ${CMAKE_BINARY_DIR}/chimera/libch.pc ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libch.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() +diff --git a/chimera/ch_database.h b/chimera/ch_database.h +index 28bde86..d757c82 100644 +--- a/chimera/ch_database.h ++++ b/chimera/ch_database.h +@@ -38,7 +38,7 @@ extern "C" + { + #endif + +-#define PCRE_STATIC ++/* #define PCRE_STATIC */ + #include + + #include "ch_compile.h" // for CH_MODE_ flags +diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake +index e0acda5..c3cbbc7 100644 +--- a/cmake/pcre.cmake ++++ b/cmake/pcre.cmake +@@ -1,4 +1,5 @@ + # first look in pcre-$version or pcre subdirs ++ + if (PCRE_SOURCE) + # either provided on cmdline or we've seen it already + set (PCRE_BUILD_SOURCE TRUE) +@@ -50,14 +51,10 @@ if (PCRE_BUILD_SOURCE) + set(PCRE_INCLUDE_DIRS ${PCRE_SOURCE} ${PROJECT_BINARY_DIR}/pcre) + set(PCRE_LDFLAGS -L"${LIBDIR}" -lpcre) + else () +- # pkgconf should save us +- find_package(PkgConfig) +- pkg_check_modules(PCRE libpcre>=${PCRE_REQUIRED_VERSION}) +- if (PCRE_FOUND) ++ # conan should save us ++ find_package(pcre) ++ if(pcre_FOUND AND (pcre_VERSION VERSION_GREATER_EQUAL PCRE_REQUIRED_VERSION)) + set(CORRECT_PCRE_VERSION TRUE) +- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above") +- else () +- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above not found") +- return () +- endif () ++ set(PCRE_LDFLAGS "pcre::pcre") ++ endif() + endif (PCRE_BUILD_SOURCE) +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 6ca3fd8..378afd0 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -1,3 +1,7 @@ ++ ++# Tools are not installed ++return () ++ + find_package(Threads) + + # remove some warnings +diff --git a/tools/hsbench/CMakeLists.txt b/tools/hsbench/CMakeLists.txt +index bbceda4..18545d0 100644 +--- a/tools/hsbench/CMakeLists.txt ++++ b/tools/hsbench/CMakeLists.txt +@@ -1,4 +1,4 @@ +-include (${CMAKE_MODULE_PATH}/sqlite3.cmake) ++include (sqlite3) + if (NOT SQLITE3_FOUND) + message(STATUS "sqlite3 not found, not building hsbench") + return() +diff --git a/tools/hscollider/CMakeLists.txt b/tools/hscollider/CMakeLists.txt +index a4d71b2..f733479 100644 +--- a/tools/hscollider/CMakeLists.txt ++++ b/tools/hscollider/CMakeLists.txt +@@ -5,7 +5,7 @@ endif() + + include_directories(${PCRE_INCLUDE_DIRS}) + +-include(${CMAKE_MODULE_PATH}/backtrace.cmake) ++include(backtrace) + + # we need static libs - too much deep magic for shared libs + if (NOT BUILD_STATIC_LIBS) diff --git a/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch b/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch new file mode 100644 index 0000000000000..9d4f5ee294490 --- /dev/null +++ b/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch @@ -0,0 +1,875 @@ +diff --git a/src/nfa/castlecompile.cpp b/src/nfa/castlecompile.cpp +index 5884ebb..1af6cd2 100644 +--- a/src/nfa/castlecompile.cpp ++++ b/src/nfa/castlecompile.cpp +@@ -281,7 +281,7 @@ vector> checkExclusion(u32 &streamStateSize, + size_t total = 0; + while (lower < trigSize) { + vector vertices; +- unique_ptr cg = make_unique(); ++ unique_ptr cg = ue2::make_unique(); + + vector> min_reset_dist; + size_t upper = min(lower + CLIQUE_GRAPH_MAX_SIZE, trigSize); +diff --git a/src/nfagraph/ng_equivalence.cpp b/src/nfagraph/ng_equivalence.cpp +index a42a0ac..9b1f072 100644 +--- a/src/nfagraph/ng_equivalence.cpp ++++ b/src/nfagraph/ng_equivalence.cpp +@@ -269,7 +269,7 @@ vector> getVertexInfos(const NGHolder &g) { + vertex_map.resize(num_verts); + + for (auto v : vertices_range(g)) { +- infos.push_back(make_unique(v, g)); ++ infos.push_back(ue2::make_unique(v, g)); + vertex_map[g[v].index] = infos.back().get(); + } + +@@ -516,7 +516,7 @@ void mergeClass(vector> &infos, NGHolder &g, + g[new_v].reports.clear(); /* populated as we pull in succs */ + + // store this vertex in our global vertex list +- infos.push_back(make_unique(new_v, g)); ++ infos.push_back(ue2::make_unique(new_v, g)); + VertexInfo *new_vertex_info = infos.back().get(); + + NFAVertex new_v_eod = NGHolder::null_vertex(); +@@ -525,7 +525,7 @@ void mergeClass(vector> &infos, NGHolder &g, + if (require_separate_eod_vertex(cur_class_vertices, g)) { + new_v_eod = clone_vertex(g, old_v); + g[new_v_eod].reports.clear(); +- infos.push_back(make_unique(new_v_eod, g)); ++ infos.push_back(ue2::make_unique(new_v_eod, g)); + new_vertex_info_eod = infos.back().get(); + } + +diff --git a/src/nfagraph/ng_violet.cpp b/src/nfagraph/ng_violet.cpp +index 78d7308..2807f2b 100644 +--- a/src/nfagraph/ng_violet.cpp ++++ b/src/nfagraph/ng_violet.cpp +@@ -375,7 +375,7 @@ void getSimpleRoseLiterals(const NGHolder &g, bool seeking_anchored, + + DEBUG_PRINTF("candidate is a candidate\n"); + scores[v] = score; +- lit_info[v] = make_unique(v, s, anchored); ++ lit_info[v] = ue2::make_unique(v, s, anchored); + } + + /* try to filter out cases where appending some characters produces worse +@@ -531,7 +531,7 @@ void getRegionRoseLiterals(const NGHolder &g, bool seeking_anchored, + } + + DEBUG_PRINTF("candidate is a candidate\n"); +- lits->push_back(make_unique(vv, s, anchored)); ++ lits->push_back(ue2::make_unique(vv, s, anchored)); + } + } + +@@ -1835,7 +1835,7 @@ static + unique_ptr make_chain(u32 count) { + assert(count); + +- auto rv = make_unique(NFA_INFIX); ++ auto rv = ue2::make_unique(NFA_INFIX); + + NGHolder &h = *rv; + +diff --git a/src/rose/rose_build_add.cpp b/src/rose/rose_build_add.cpp +index aa043fa..f680dbb 100644 +--- a/src/rose/rose_build_add.cpp ++++ b/src/rose/rose_build_add.cpp +@@ -1802,7 +1802,7 @@ bool RoseBuildImpl::addOutfix(const NGHolder &h, const raw_som_dfa &haig) { + + bool RoseBuildImpl::addOutfix(const raw_puff &rp) { + if (!mpv_outfix) { +- mpv_outfix = make_unique(MpvProto()); ++ mpv_outfix = ue2::make_unique(MpvProto()); + } + + auto *mpv = mpv_outfix->mpv(); +@@ -1827,7 +1827,7 @@ bool RoseBuildImpl::addOutfix(const raw_puff &rp) { + bool RoseBuildImpl::addChainTail(const raw_puff &rp, u32 *queue_out, + u32 *event_out) { + if (!mpv_outfix) { +- mpv_outfix = make_unique(MpvProto()); ++ mpv_outfix = ue2::make_unique(MpvProto()); + } + + auto *mpv = mpv_outfix->mpv(); +diff --git a/src/rose/rose_build_anchored.cpp b/src/rose/rose_build_anchored.cpp +index 8ea07c9..1f918bb 100644 +--- a/src/rose/rose_build_anchored.cpp ++++ b/src/rose/rose_build_anchored.cpp +@@ -249,7 +249,7 @@ unique_ptr populate_holder(const simple_anchored_info &sai, + const flat_set &exit_ids) { + DEBUG_PRINTF("populating holder for ^.{%u,%u}%s\n", sai.min_bound, + sai.max_bound, dumpString(sai.literal).c_str()); +- auto h_ptr = make_unique(); ++ auto h_ptr = ue2::make_unique(); + NGHolder &h = *h_ptr; + auto ends = addDotsToGraph(h, h.start, sai.min_bound, sai.max_bound, + CharReach::dot()); +diff --git a/src/rose/rose_build_exclusive.cpp b/src/rose/rose_build_exclusive.cpp +index 6a5a710..966c908 100644 +--- a/src/rose/rose_build_exclusive.cpp ++++ b/src/rose/rose_build_exclusive.cpp +@@ -280,7 +280,7 @@ void findCliques(const map> &exclusiveGroups, + } + // Construct the exclusivity graph + map vertex_map; +- unique_ptr cg = make_unique(); ++ unique_ptr cg = ue2::make_unique(); + + // Add vertices representing infixes/suffixes + for (const auto &e : exclusiveGroups) { +diff --git a/src/rose/rose_build_program.cpp b/src/rose/rose_build_program.cpp +index 96c95db..81d605b 100644 +--- a/src/rose/rose_build_program.cpp ++++ b/src/rose/rose_build_program.cpp +@@ -95,7 +95,7 @@ OffsetMap makeOffsetMap(const RoseProgram &program, u32 *total_len) { + } + + RoseProgram::RoseProgram() { +- prog.push_back(make_unique()); ++ prog.push_back(ue2::make_unique()); + } + + RoseProgram::~RoseProgram() = default; +@@ -297,28 +297,28 @@ void addEnginesEodProgram(u32 eodNfaIterOffset, RoseProgram &program) { + } + + RoseProgram block; +- block.add_before_end(make_unique(eodNfaIterOffset)); ++ block.add_before_end(ue2::make_unique(eodNfaIterOffset)); + program.add_block(move(block)); + } + + void addSuffixesEodProgram(RoseProgram &program) { + RoseProgram block; +- block.add_before_end(make_unique()); ++ block.add_before_end(ue2::make_unique()); + program.add_block(move(block)); + } + + void addMatcherEodProgram(RoseProgram &program) { + RoseProgram block; +- block.add_before_end(make_unique()); ++ block.add_before_end(ue2::make_unique()); + program.add_block(move(block)); + } + + void addFlushCombinationProgram(RoseProgram &program) { +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + void addLastFlushCombinationProgram(RoseProgram &program) { +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + static +@@ -342,11 +342,11 @@ void makeRoleCheckLeftfix(const RoseBuildImpl &build, + + unique_ptr ri; + if (is_prefix) { +- ri = make_unique(lni.queue, build.g[v].left.lag, ++ ri = ue2::make_unique(lni.queue, build.g[v].left.lag, + build.g[v].left.leftfix_report, + end_inst); + } else { +- ri = make_unique(lni.queue, build.g[v].left.lag, ++ ri = ue2::make_unique(lni.queue, build.g[v].left.lag, + build.g[v].left.leftfix_report, + end_inst); + } +@@ -384,7 +384,7 @@ void makeAnchoredLiteralDelay(const RoseBuildImpl &build, + u32 anch_id = prog_build.anchored_programs.at(lit_id); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(groups, anch_id, end_inst); ++ auto ri = ue2::make_unique(groups, anch_id, end_inst); + program.add_before_end(move(ri)); + } + +@@ -393,7 +393,7 @@ void makeDedupe(const ReportManager &rm, const Report &report, + RoseProgram &program) { + const auto *end_inst = program.end_instruction(); + auto ri = +- make_unique(report.quashSom, rm.getDkey(report), ++ ue2::make_unique(report.quashSom, rm.getDkey(report), + report.offsetAdjust, end_inst); + program.add_before_end(move(ri)); + } +@@ -402,7 +402,7 @@ static + void makeDedupeSom(const ReportManager &rm, const Report &report, + RoseProgram &program) { + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(report.quashSom, ++ auto ri = ue2::make_unique(report.quashSom, + rm.getDkey(report), + report.offsetAdjust, end_inst); + program.add_before_end(move(ri)); +@@ -428,7 +428,7 @@ void makeCatchup(const ReportManager &rm, bool needs_catchup, + return; + } + +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + static +@@ -511,12 +511,12 @@ void addLogicalSetRequired(const Report &report, ReportManager &rm, + return; + } + // set matching status of current lkey +- auto risl = make_unique(report.lkey, ++ auto risl = ue2::make_unique(report.lkey, + report.offsetAdjust); + program.add_before_end(move(risl)); + // set current lkey's corresponding ckeys active, pending to check + for (auto ckey : rm.getRelateCKeys(report.lkey)) { +- auto risc = make_unique(ckey); ++ auto risc = ue2::make_unique(ckey); + program.add_before_end(move(risc)); + } + } +@@ -532,7 +532,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + + // Handle min/max offset checks. + if (report.minOffset > 0 || report.maxOffset < MAX_OFFSET) { +- auto ri = make_unique(report.minOffset, ++ auto ri = ue2::make_unique(report.minOffset, + report.maxOffset, end_inst); + report_block.add_before_end(move(ri)); + } +@@ -540,7 +540,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // If this report has an exhaustion key, we can check it in the program + // rather than waiting until we're in the callback adaptor. + if (report.ekey != INVALID_EKEY) { +- auto ri = make_unique(report.ekey, end_inst); ++ auto ri = ue2::make_unique(report.ekey, end_inst); + report_block.add_before_end(move(ri)); + } + +@@ -548,7 +548,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // calculated. + if (isExternalSomReport(report) && + report.type != EXTERNAL_CALLBACK_SOM_PASS) { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } +@@ -556,13 +556,13 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // Min length constraint. + if (report.minLength > 0) { + assert(build.hasSom); +- auto ri = make_unique( ++ auto ri = ue2::make_unique( + report.offsetAdjust, report.minLength, end_inst); + report_block.add_before_end(move(ri)); + } + + if (report.quashSom) { +- report_block.add_before_end(make_unique()); ++ report_block.add_before_end(ue2::make_unique()); + } + + switch (report.type) { +@@ -578,7 +578,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + if (needs_dedupe) { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.quashSom, build.rm.getDkey(report), + report.onmatch, report.offsetAdjust, end_inst)); + } else { +@@ -587,7 +587,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } +@@ -597,28 +597,28 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + } + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + } else { // has_som + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + } +@@ -639,17 +639,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + addFlushCombinationProgram(report_block); + } + if (has_som) { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } else { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } + break; + case INTERNAL_ROSE_CHAIN: { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.topSquashDistance)); + break; + } +@@ -663,17 +663,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + addLogicalSetRequired(report, build.rm, report_block); +@@ -685,17 +685,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + addLogicalSetRequired(report, build.rm, report_block); +@@ -722,11 +722,11 @@ void makeRoleReports(const RoseBuildImpl &build, + assert(contains(leftfix_info, v)); + const left_build_info &lni = leftfix_info.at(v); + program.add_before_end( +- make_unique(lni.queue, g[v].left.lag)); ++ ue2::make_unique(lni.queue, g[v].left.lag)); + report_som = true; + } else if (g[v].som_adjust) { + program.add_before_end( +- make_unique(g[v].som_adjust)); ++ ue2::make_unique(g[v].som_adjust)); + report_som = true; + } + +@@ -748,7 +748,7 @@ void makeRoleSetState(const unordered_map &roleStateIndices, + if (it == end(roleStateIndices)) { + return; + } +- program.add_before_end(make_unique(it->second)); ++ program.add_before_end(ue2::make_unique(it->second)); + } + + static +@@ -772,7 +772,7 @@ void makePushDelayedInstructions(const RoseLiteralMap &literals, + }); + + for (const auto &ri : delay_instructions) { +- program.add_before_end(make_unique(ri)); ++ program.add_before_end(ue2::make_unique(ri)); + } + } + +@@ -801,10 +801,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit, + const auto *end_inst = program.end_instruction(); + unique_ptr ri; + if (lit.s.any_nocase()) { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } else { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } + program.add_before_end(move(ri)); +@@ -820,10 +820,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit, + const auto *end_inst = program.end_instruction(); + unique_ptr ri; + if (lit.s.any_nocase()) { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } else { +- ri = make_unique(lit.s.get_string(), end_inst); ++ ri = ue2::make_unique(lit.s.get_string(), end_inst); + } + program.add_before_end(move(ri)); + } +@@ -840,7 +840,7 @@ void makeRoleCheckNotHandled(ProgramBuild &prog_build, RoseVertex v, + } + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(handled_key, end_inst); ++ auto ri = ue2::make_unique(handled_key, end_inst); + program.add_before_end(move(ri)); + } + +@@ -889,7 +889,7 @@ void makeRoleCheckBounds(const RoseBuildImpl &build, RoseVertex v, + + const auto *end_inst = program.end_instruction(); + program.add_before_end( +- make_unique(min_bound, max_bound, end_inst)); ++ ue2::make_unique(min_bound, max_bound, end_inst)); + } + + static +@@ -924,7 +924,7 @@ void makeRoleGroups(const RoseGraph &g, ProgramBuild &prog_build, + return; + } + +- program.add_before_end(make_unique(groups)); ++ program.add_before_end(ue2::make_unique(groups)); + } + + static +@@ -968,7 +968,7 @@ bool makeRoleByte(const vector &look, RoseProgram &program) { + s32 checkbyte_offset = verify_s32(entry.offset); + DEBUG_PRINTF("CHECK BYTE offset=%d\n", checkbyte_offset); + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(andmask_u8, cmpmask_u8, flip, ++ auto ri = ue2::make_unique(andmask_u8, cmpmask_u8, flip, + checkbyte_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1000,7 +1000,7 @@ bool makeRoleMask(const vector &look, RoseProgram &program) { + DEBUG_PRINTF("CHECK MASK and_mask=%llx cmp_mask=%llx\n", + and_mask, cmp_mask); + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1055,7 +1055,7 @@ bool makeRoleMask32(const vector &look, + DEBUG_PRINTF("base_offset %d\n", base_offset); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1098,7 +1098,7 @@ bool makeRoleMask64(const vector &look, + DEBUG_PRINTF("base_offset %d\n", base_offset); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1235,7 +1235,7 @@ makeCheckShufti16x8(u32 offset_range, u8 bucket_idx, + copy(hi_mask.begin(), hi_mask.begin() + 16, nib_mask.begin() + 16); + copy(bucket_select_mask.begin(), bucket_select_mask.begin() + 16, + bucket_select_mask_16.begin()); +- return make_unique ++ return ue2::make_unique + (nib_mask, bucket_select_mask_16, + neg_mask & 0xffff, base_offset, end_inst); + } +@@ -1255,7 +1255,7 @@ makeCheckShufti32x8(u32 offset_range, u8 bucket_idx, + array lo_mask_16; + copy(hi_mask.begin(), hi_mask.begin() + 16, hi_mask_16.begin()); + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_16.begin()); +- return make_unique ++ return ue2::make_unique + (hi_mask_16, lo_mask_16, bucket_select_mask, + neg_mask, base_offset, end_inst); + } +@@ -1277,7 +1277,7 @@ makeCheckShufti16x16(u32 offset_range, u8 bucket_idx, + bucket_select_mask_32.begin()); + copy(bucket_select_mask_hi.begin(), bucket_select_mask_hi.begin() + 16, + bucket_select_mask_32.begin() + 16); +- return make_unique ++ return ue2::make_unique + (hi_mask, lo_mask, bucket_select_mask_32, + neg_mask & 0xffff, base_offset, end_inst); + } +@@ -1294,7 +1294,7 @@ makeCheckShufti32x16(u32 offset_range, u8 bucket_idx, + return nullptr; + } + +- return make_unique ++ return ue2::make_unique + (hi_mask, lo_mask, bucket_select_mask_hi, + bucket_select_mask_lo, neg_mask, base_offset, end_inst); + } +@@ -1321,7 +1321,7 @@ makeCheckShufti64x8(u32 offset_range, u8 bucket_idx, + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 32); + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 48); + +- return make_unique ++ return ue2::make_unique + (hi_mask_64, lo_mask_64, bucket_select_mask, + neg_mask, base_offset, end_inst); + } +@@ -1361,7 +1361,7 @@ makeCheckShufti64x16(u32 offset_range, u8 bucket_idx, + copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 32); + copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 48); + +- return make_unique ++ return ue2::make_unique + (hi_mask_1, hi_mask_2, lo_mask_1, lo_mask_2, bucket_select_mask_hi, + bucket_select_mask_lo, neg_mask, base_offset, end_inst); + } +@@ -1486,7 +1486,7 @@ void makeLookaroundInstruction(const vector &look, + if (look.size() == 1) { + s8 offset = look.begin()->offset; + const CharReach &reach = look.begin()->reach; +- auto ri = make_unique(offset, reach, ++ auto ri = ue2::make_unique(offset, reach, + program.end_instruction()); + program.add_before_end(move(ri)); + return; +@@ -1508,7 +1508,7 @@ void makeLookaroundInstruction(const vector &look, + return; + } + +- auto ri = make_unique(look, ++ auto ri = ue2::make_unique(look, + program.end_instruction()); + program.add_before_end(move(ri)); + } +@@ -1584,7 +1584,7 @@ void makeCheckLitEarlyInstruction(const RoseBuildImpl &build, u32 lit_id, + + DEBUG_PRINTF("adding lit early check, min_offset=%u\n", min_offset); + const auto *end = prog.end_instruction(); +- prog.add_before_end(make_unique(min_offset, end)); ++ prog.add_before_end(ue2::make_unique(min_offset, end)); + } + + static +@@ -1595,7 +1595,7 @@ void makeGroupCheckInstruction(const RoseBuildImpl &build, u32 lit_id, + if (!info.group_mask) { + return; + } +- prog.add_before_end(make_unique(info.group_mask)); ++ prog.add_before_end(ue2::make_unique(info.group_mask)); + } + + static +@@ -1762,7 +1762,7 @@ bool makeRoleMultipathShufti(const vector> &multi_look, + copy(begin(lo_mask), begin(lo_mask) + 16, nib_mask.begin()); + copy(begin(hi_mask), begin(hi_mask) + 16, nib_mask.begin() + 16); + +- auto ri = make_unique ++ auto ri = ue2::make_unique + (nib_mask, bucket_select_lo, data_select_mask, hi_bits_mask, + lo_bits_mask, neg_mask, base_offset, last_start, end_inst); + program.add_before_end(move(ri)); +@@ -1771,20 +1771,20 @@ bool makeRoleMultipathShufti(const vector> &multi_look, + assert(!(hi_bits_mask & ~0xffffffffULL)); + assert(!(lo_bits_mask & ~0xffffffffULL)); + if (bit_index <= 8) { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_lo, data_select_mask, + hi_bits_mask, lo_bits_mask, neg_mask, base_offset, + last_start, end_inst); + program.add_before_end(move(ri)); + } else { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_hi, bucket_select_lo, + data_select_mask, hi_bits_mask, lo_bits_mask, neg_mask, + base_offset, last_start, end_inst); + program.add_before_end(move(ri)); + } + } else { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_lo, data_select_mask, + hi_bits_mask, lo_bits_mask, neg_mask, base_offset, + last_start, end_inst); +@@ -1856,7 +1856,7 @@ void makeRoleMultipathLookaround(const vector> &multi_look, + ordered_look.emplace_back(multi_entry); + } + +- auto ri = make_unique(move(ordered_look), ++ auto ri = ue2::make_unique(move(ordered_look), + last_start, start_mask, + program.end_instruction()); + program.add_before_end(move(ri)); +@@ -1932,7 +1932,7 @@ void makeRoleSuffix(const RoseBuildImpl &build, + event = MQE_TOP; + } + +- prog.add_before_end(make_unique(queue, event)); ++ prog.add_before_end(ue2::make_unique(queue, event)); + } + + static +@@ -1945,7 +1945,7 @@ void addInfixTriggerInstructions(vector triggers, + }); + for (const auto &ti : triggers) { + prog.add_before_end( +- make_unique(ti.cancel, ti.queue, ti.event)); ++ ue2::make_unique(ti.cancel, ti.queue, ti.event)); + } + } + +@@ -2039,7 +2039,7 @@ static + void addCheckOnlyEodInstruction(RoseProgram &prog) { + DEBUG_PRINTF("only at eod\n"); + const auto *end_inst = prog.end_instruction(); +- prog.add_before_end(make_unique(end_inst)); ++ prog.add_before_end(ue2::make_unique(end_inst)); + } + + static +@@ -2164,7 +2164,7 @@ void makeGroupSquashInstruction(const RoseBuildImpl &build, u32 lit_id, + DEBUG_PRINTF("squashes 0x%llx\n", info.group_mask); + assert(info.group_mask); + /* Note: group_mask is negated. */ +- prog.add_before_end(make_unique(~info.group_mask)); ++ prog.add_before_end(ue2::make_unique(~info.group_mask)); + } + + namespace { +@@ -2209,7 +2209,7 @@ RoseProgram assembleProgramBlocks(vector &&blocks_in) { + * only set if a state has been. */ + if (!prog.empty() && reads_work_done_flag(block)) { + RoseProgram clear_block; +- clear_block.add_before_end(make_unique()); ++ clear_block.add_before_end(ue2::make_unique()); + prog.add_block(move(clear_block)); + } + +@@ -2369,7 +2369,7 @@ void makeCatchupMpv(const ReportManager &rm, bool needs_mpv_catchup, + return; + } + +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + RoseProgram makeReportProgram(const RoseBuildImpl &build, +@@ -2402,7 +2402,7 @@ RoseProgram makeBoundaryProgram(const RoseBuildImpl &build, + void addIncludedJumpProgram(RoseProgram &program, u32 child_offset, + u8 squash) { + RoseProgram block; +- block.add_before_end(make_unique(child_offset, ++ block.add_before_end(ue2::make_unique(child_offset, + squash)); + program.add_block(move(block)); + } +@@ -2413,7 +2413,7 @@ void addPredBlockSingle(u32 pred_state, RoseProgram &pred_block, + // Prepend an instruction to check the pred state is on. + const auto *end_inst = pred_block.end_instruction(); + pred_block.insert(begin(pred_block), +- make_unique(pred_state, end_inst)); ++ ue2::make_unique(pred_state, end_inst)); + program.add_block(move(pred_block)); + } + +@@ -2428,7 +2428,7 @@ void addPredBlocksAny(map &pred_blocks, u32 num_states, + } + + const RoseInstruction *end_inst = sparse_program.end_instruction(); +- auto ri = make_unique(num_states, keys, end_inst); ++ auto ri = ue2::make_unique(num_states, keys, end_inst); + sparse_program.add_before_end(move(ri)); + + RoseProgram &block = pred_blocks.begin()->second; +@@ -2451,14 +2451,14 @@ void addPredBlocksMulti(map &pred_blocks, + vector> jump_table; + + // BEGIN instruction. +- auto ri_begin = make_unique(num_states, end_inst); ++ auto ri_begin = ue2::make_unique(num_states, end_inst); + RoseInstrSparseIterBegin *begin_inst = ri_begin.get(); + sparse_program.add_before_end(move(ri_begin)); + + // NEXT instructions, one per pred program. + u32 prev_key = pred_blocks.begin()->first; + for (auto it = next(begin(pred_blocks)); it != end(pred_blocks); ++it) { +- auto ri = make_unique(prev_key, begin_inst, ++ auto ri = ue2::make_unique(prev_key, begin_inst, + end_inst); + sparse_program.add_before_end(move(ri)); + prev_key = it->first; +@@ -2539,7 +2539,7 @@ void applyFinalSpecialisation(RoseProgram &program) { + auto it = next(program.rbegin()); + if (auto *ri = dynamic_cast(it->get())) { + DEBUG_PRINTF("replacing REPORT with FINAL_REPORT\n"); +- program.replace(it, make_unique( ++ program.replace(it, ue2::make_unique( + ri->onmatch, ri->offset_adjust)); + } + } +diff --git a/src/rose/rose_in_util.cpp b/src/rose/rose_in_util.cpp +index 9fe47c2..6fa56d1 100644 +--- a/src/rose/rose_in_util.cpp ++++ b/src/rose/rose_in_util.cpp +@@ -93,7 +93,7 @@ private: + + unique_ptr cloneRoseGraph(const RoseInGraph &ig) { + assert(hasCorrectlyNumberedVertices(ig)); +- unique_ptr out = make_unique(); ++ unique_ptr out = ue2::make_unique(); + + unordered_map> graph_map; + unordered_map> haig_map; +diff --git a/src/smallwrite/smallwrite_build.cpp b/src/smallwrite/smallwrite_build.cpp +index 4eb4801..6acdf3c 100644 +--- a/src/smallwrite/smallwrite_build.cpp ++++ b/src/smallwrite/smallwrite_build.cpp +@@ -680,7 +680,7 @@ unique_ptr buildDfa(LitTrie &trie, bool nocase) { + // Construct DFA states in BFS order. + const auto state_ids = makeStateMap(trie, ordering); + +- auto rdfa = make_unique(NFA_OUTFIX); ++ auto rdfa = ue2::make_unique(NFA_OUTFIX); + + // Calculate alphabet. + array unalpha; +diff --git a/tools/hsbench/main.cpp b/tools/hsbench/main.cpp +index 1c91813..4ec793e 100644 +--- a/tools/hsbench/main.cpp ++++ b/tools/hsbench/main.cpp +@@ -1038,7 +1038,7 @@ void runBenchmark(const Engine &db, + int HS_CDECL main(int argc, char *argv[]) { + unique_ptr grey; + #if !defined(RELEASE_BUILD) +- grey = make_unique(); ++ grey = ue2::make_unique(); + #endif + setlocale(LC_ALL, ""); // use the user's locale + +diff --git a/tools/hscheck/main.cpp b/tools/hscheck/main.cpp +index 197087b..bdecab8 100644 +--- a/tools/hscheck/main.cpp ++++ b/tools/hscheck/main.cpp +@@ -664,7 +664,7 @@ int HS_CDECL main(int argc, char **argv) { + num_of_threads = max(1u, std::thread::hardware_concurrency()); + + #if !defined(RELEASE_BUILD) +- g_grey = make_unique(); ++ g_grey = ue2::make_unique(); + #endif + processArgs(argc, argv, g_grey); + +diff --git a/tools/hscollider/GraphTruth.cpp b/tools/hscollider/GraphTruth.cpp +index 0b67b11..e43beb1 100644 +--- a/tools/hscollider/GraphTruth.cpp ++++ b/tools/hscollider/GraphTruth.cpp +@@ -134,7 +134,7 @@ void CNGInfo::compile() { + auto pl = ue2::make_unique(); + pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL); + pl->logicalKeyRenumber(); +- cng = make_unique(move(pl)); ++ cng = ue2::make_unique(move(pl)); + return; + } + +@@ -193,7 +193,7 @@ void CNGInfo::compile() { + } + } + +- cng = make_unique(move(g), move(rm)); ++ cng = ue2::make_unique(move(g), move(rm)); + } catch (CompileError &e) { + throw NGCompileFailure(e.reason); + } catch (NGUnsupportedFailure &e) { +@@ -257,7 +257,7 @@ unique_ptr GraphTruth::preprocess(unsigned id, + } + } + +- auto cngi = make_unique(id, m_expr); ++ auto cngi = ue2::make_unique(id, m_expr); + cngi->utf8 = hs_flags & HS_FLAG_UTF8; + cngi->highlander = highlander; + cngi->prefilter = prefilter; +diff --git a/tools/hscollider/GroundTruth.cpp b/tools/hscollider/GroundTruth.cpp +index a267306..d9293dc 100644 +--- a/tools/hscollider/GroundTruth.cpp ++++ b/tools/hscollider/GroundTruth.cpp +@@ -331,7 +331,7 @@ GroundTruth::compile(unsigned id, bool no_callouts) { + int errloc = 0; + int errcode = 0; + +- unique_ptr compiled = make_unique(); ++ unique_ptr compiled = ue2::make_unique(); + compiled->utf8 = flags & PCRE_UTF8; + compiled->highlander = highlander; + compiled->prefilter = prefilter; +diff --git a/tools/hscollider/main.cpp b/tools/hscollider/main.cpp +index afa6ef5..c85526e 100644 +--- a/tools/hscollider/main.cpp ++++ b/tools/hscollider/main.cpp +@@ -1606,7 +1606,7 @@ void generateTests(CorporaSource &corpora_src, const ExpressionMap &exprMap, + max_generator_queue_len); + vector> generators; + for (size_t i = 0; i < numGeneratorThreads; i++) { +- auto c = make_unique(i, testq, corpq, corpora_src); ++ auto c = ue2::make_unique(i, testq, corpq, corpora_src); + c->start(); + generators.push_back(move(c)); + } +diff --git a/util/ng_corpus_generator.cpp b/util/ng_corpus_generator.cpp +index e5e8e06..2e0080a 100644 +--- a/util/ng_corpus_generator.cpp ++++ b/util/ng_corpus_generator.cpp +@@ -200,7 +200,7 @@ void findPaths(const NGHolder &g, CorpusProperties &cProps, + if (boost::next(ai) == ae) { + new_path = std::move(p); + } else { +- new_path = make_unique(*p); ++ new_path = ue2::make_unique(*p); + } + + new_path->push_back(v); diff --git a/recipes/hyperscan/all/test_package/CMakeLists.txt b/recipes/hyperscan/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8cfec33c7dfff --- /dev/null +++ b/recipes/hyperscan/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(hyperscan COMPONENTS hs REQUIRED) + +add_executable(hs_example hs_example.cpp) +target_link_libraries(hs_example PRIVATE hyperscan::hs) +target_compile_features(hs_example PRIVATE cxx_std_11) + +if(BUILD_CHIMERA) + find_package(hyperscan COMPONENTS chimera REQUIRED) + add_executable(ch_example ch_example.cpp) + target_link_libraries(ch_example PRIVATE hyperscan::chimera) + target_compile_features(ch_example PRIVATE cxx_std_11) +endif() diff --git a/recipes/hyperscan/all/test_package/ch_example.cpp b/recipes/hyperscan/all/test_package/ch_example.cpp new file mode 100644 index 0000000000000..7f6eaeecffe55 --- /dev/null +++ b/recipes/hyperscan/all/test_package/ch_example.cpp @@ -0,0 +1,100 @@ +#include +#include +#include +#include +#include "hs/ch.h" + +struct context_t +{ + const char* ref = nullptr; + int match_cnt = 0; + int capture_cnt = 0; +}; + +static int match_handler(unsigned int id, unsigned long long from, unsigned long long to, unsigned int flags, unsigned int size, const ch_capture_t *captured, void *context) +{ + std::printf("Found match %u from %llu to %llu\n", id, from, to); + if(size==2) + { + std::printf("Found capture from %llu to %llu\n", captured[1].from, captured[1].to); + if(captured[1].from == 6 && captured[1].to == 9) + { + ((context_t*)context)->capture_cnt++; + } + } + ((context_t*)context)->match_cnt++; + ++(*((int*)context)); + return 0; +} + + +static std::tuple, std::shared_ptr, ch_error_t> compile(const char* pattern) +{ + ch_compile_error_t* err = nullptr; + ch_database_t* db = nullptr; + + const auto result = ch_compile(pattern, 0, CH_MODE_GROUPS, nullptr, &db, &err); + + return std::tuple, std::shared_ptr, ch_error_t>( + std::shared_ptr(db, ch_free_database), + std::shared_ptr(err, ch_free_compile_error), + result + ); +} + +static std::pair, ch_error_t> alloc_scratch(ch_database_t& db) +{ + ch_scratch_t* scratch = nullptr; + + const auto result = ch_alloc_scratch(&db, &scratch); + + return std::pair, ch_error_t>( + std::shared_ptr(scratch, ch_free_scratch), + result + ); +} + +static ch_error_t scan(ch_database_t& db, ch_scratch_t& scratch, const char* data, ch_match_event_handler handler, void* context) +{ + const auto len = std::strlen(data); + return ch_scan(&db, data, len, 0, &scratch, match_handler, nullptr, context); +} + +int main(int argc, char **argv) +{ + printf("%s\n", ch_version()); + + context_t ctx; + ctx.ref = "123abcdefghijkl"; + std::shared_ptr err; + std::shared_ptr db; + + ch_error_t result; + + std::tie(db, err, result) = compile("abc(\\w+)ghi"); + + if (result != CH_SUCCESS) { + std::printf("Failed to compile database\n"); + std::printf("%s\n", err->message); + } + else + { + std::shared_ptr scratch; + + std::tie(scratch, result) = alloc_scratch(*db); + if (result != CH_SUCCESS) { + std::printf("Failed to allocate scratch space\n"); + } + else + { + if(scan(*db, *scratch, ctx.ref, &match_handler, &ctx) == CH_SUCCESS) + { + if (ctx.match_cnt == 1 && ctx.capture_cnt == 1) { + return 0; + } + } + } + } + + return -1; +} diff --git a/recipes/hyperscan/all/test_package/conanfile.py b/recipes/hyperscan/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5c91753bcba3 --- /dev/null +++ b/recipes/hyperscan/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_CHIMERA"] = self.dependencies["hyperscan"].options.build_chimera + 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], "hs_example") + self.run(bin_path, env="conanrun") + + if self.options["hyperscan"].build_chimera: + bin_path = os.path.join(self.cpp.build.bindirs[0], "ch_example") + self.run(bin_path, env="conanrun") diff --git a/recipes/hyperscan/all/test_package/hs_example.cpp b/recipes/hyperscan/all/test_package/hs_example.cpp new file mode 100644 index 0000000000000..428ae83a6294f --- /dev/null +++ b/recipes/hyperscan/all/test_package/hs_example.cpp @@ -0,0 +1,83 @@ +#include +#include +#include +#include +#include "hs/hs.h" + +static int match_handler(unsigned int id, unsigned long long from, unsigned long long to, unsigned int flags, void *context) +{ + std::printf("Found match %u from %llu to %llu\n", id, from, to); + ++(*((int*)context)); + return 0; +} + +static std::tuple, std::shared_ptr, hs_error_t> compile(const char* pattern) +{ + hs_compile_error_t* err = nullptr; + hs_database_t* db = nullptr; + + const auto result = hs_compile(pattern, HS_FLAG_SOM_LEFTMOST, HS_MODE_BLOCK, nullptr, &db, &err); + + return std::tuple, std::shared_ptr, hs_error_t>( + std::shared_ptr(db, hs_free_database), + std::shared_ptr(err, hs_free_compile_error), + result + ); +} + +static std::pair, hs_error_t> alloc_scratch(hs_database_t& db) +{ + hs_scratch_t* scratch = nullptr; + + const auto result = hs_alloc_scratch(&db, &scratch); + + return std::pair, hs_error_t>( + std::shared_ptr(scratch, hs_free_scratch), + result + ); +} + +static hs_error_t scan(hs_database_t& db, hs_scratch_t& scratch, const char* data, match_event_handler handler, void* context) +{ + const auto len = std::strlen(data); + return hs_scan(&db, data, len, 0, &scratch, match_handler, context); +} + +int main(int argc, char **argv) +{ + std::printf("%s\n", hs_version()); + + int retval = 0; + int match_cnt = 0; + + std::shared_ptr err; + std::shared_ptr db; + + hs_error_t result; + + std::tie(db, err, result) = compile("abc"); + + if (result != HS_SUCCESS) { + std::printf("Failed to compile database\n"); + std::printf("%s\n", err->message); + } + else + { + std::shared_ptr scratch; + + std::tie(scratch, result) = alloc_scratch(*db); + if (result != HS_SUCCESS) { + std::printf("Failed to allocate scratch space\n"); + } + else + { + if(scan(*db, *scratch, "123abcdef", &match_handler, &match_cnt) == HS_SUCCESS) + { + if (match_cnt == 1) { + return 0; + } + } + } + } + return -1; +} diff --git a/recipes/hyperscan/all/test_v1_package/CMakeLists.txt b/recipes/hyperscan/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/hyperscan/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/hyperscan/all/test_v1_package/conanfile.py b/recipes/hyperscan/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cb26b3fe15590 --- /dev/null +++ b/recipes/hyperscan/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +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.definitions["BUILD_CHIMERA"] = self.options["hyperscan"].build_chimera + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "hs_example") + self.run(bin_path, run_environment=True) + + if self.options["hyperscan"].build_chimera: + bin_path = os.path.join("bin", "ch_example") + self.run(bin_path, run_environment=True) diff --git a/recipes/hyperscan/config.yml b/recipes/hyperscan/config.yml new file mode 100644 index 0000000000000..d02161efd202b --- /dev/null +++ b/recipes/hyperscan/config.yml @@ -0,0 +1,3 @@ +versions: + "5.4.0": + folder: all diff --git a/recipes/i2c-tools/all/conandata.yml b/recipes/i2c-tools/all/conandata.yml new file mode 100644 index 0000000000000..292823f71da26 --- /dev/null +++ b/recipes/i2c-tools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.3": + url: "https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-4.3.tar.gz" + sha256: "eec464e42301d93586cbeca3845ed61bff40f560670e5b35baec57301d438148" diff --git a/recipes/i2c-tools/all/conanfile.py b/recipes/i2c-tools/all/conanfile.py new file mode 100644 index 0000000000000..869b97a3d490e --- /dev/null +++ b/recipes/i2c-tools/all/conanfile.py @@ -0,0 +1,78 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +requires_conan_version = ">=1.33.0" + + +class I2cConan(ConanFile): + name = "i2c-tools" + license = "GPL-2.0-or-later", "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://i2c.wiki.kernel.org/index.php/I2C_Tools" + description = "I2C tools for the linux kernel as well as an I2C library." + topics = ("i2c") + + 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 configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("linux-headers-generic/5.14.9") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("i2c-tools only support Linux") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile"), + "SRCDIRS := include lib eeprom stub tools $(EXTRA)", + "SRCDIRS := include lib $(EXTRA)") + + @property + def _make_args(self): + return [ + "PREFIX={}".format(self.package_folder), + "BUILD_DYNAMIC_LIB={}".format("1" if self.options.shared else "0"), + "BUILD_STATIC_LIB={}".format("0" if self.options.shared else "1"), + "USE_STATIC_LIB={}".format("0" if self.options.shared else "1"), + ] + + def build(self): + self._patch_sources() + autotools = AutoToolsBuildEnvironment(self) + autotools.flags += [f"-I{path}" for path in autotools.include_paths] + with tools.chdir(self._source_subfolder): + autotools.make(args=self._make_args) + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + self.copy("COPYING.LGPL", src=self._source_subfolder, dst="licenses") + autotools = AutoToolsBuildEnvironment(self) + autotools.flags += [f"-I{path}" for path in autotools.include_paths] + with tools.chdir(self._source_subfolder): + autotools.install(args=self._make_args) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["i2c"] diff --git a/recipes/i2c-tools/all/test_package/CMakeLists.txt b/recipes/i2c-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8e909fdb64156 --- /dev/null +++ b/recipes/i2c-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(i2c-tools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE i2c-tools::i2c-tools) diff --git a/recipes/i2c-tools/all/test_package/conanfile.py b/recipes/i2c-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2780f5433abb4 --- /dev/null +++ b/recipes/i2c-tools/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, CMake + + +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): + # For obvious reasons, don't run the test package (we don't want to write data to some device) + pass diff --git a/recipes/i2c-tools/all/test_package/test_package.c b/recipes/i2c-tools/all/test_package/test_package.c new file mode 100644 index 0000000000000..e220611d6a44b --- /dev/null +++ b/recipes/i2c-tools/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "i2c/smbus.h" + +#include +#include +#include + +int main(int argc, char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument.\n"); + return 1; + } + int fd = open(argv[1], O_RDWR); + if (fd <= 0) { + fprintf(stderr, "Could not open %s.\n", argv[1]); + return 2; + } + + // Do more checks ... + + int res = i2c_smbus_write_byte(fd, 137); + if (res < 0) { + fprintf(stderr, "i2c_smbus_write_byte failed.\n"); + return 3; + } + + res = close(fd); + if (res < 0) { + fprintf(stderr, "close failed.\n"); + return 4; + } +} diff --git a/recipes/i2c-tools/config.yml b/recipes/i2c-tools/config.yml new file mode 100644 index 0000000000000..77cec98443737 --- /dev/null +++ b/recipes/i2c-tools/config.yml @@ -0,0 +1,3 @@ +versions: + "4.3": + folder: "all" diff --git a/recipes/icecream-cpp/all/conandata.yml b/recipes/icecream-cpp/all/conandata.yml new file mode 100644 index 0000000000000..6c686db1b4509 --- /dev/null +++ b/recipes/icecream-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + '0.3.1': + url: 'https://github.com/renatoGarcia/icecream-cpp/archive/v0.3.1.tar.gz' + sha256: '51bebb040c9c7e44f443d6356256ae4d93300d2e1f01824fd219c97d168a438f' diff --git a/recipes/icecream-cpp/all/conanfile.py b/recipes/icecream-cpp/all/conanfile.py new file mode 100644 index 0000000000000..ad2f369b0f440 --- /dev/null +++ b/recipes/icecream-cpp/all/conanfile.py @@ -0,0 +1,42 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class IcecreamcppConan(ConanFile): + name = "icecream-cpp" + license = "MIT" + homepage = "https://github.com/renatoGarcia/icecream-cpp" + url = "https://github.com/conan-io/conan-center-index" + description = "A little library to help with the print debugging on C++11 and forward." + topics = ("debug", "single-header-lib", "print") + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + "icecream-cpp can't be used by {0} {1}".format( + self.settings.compiler, + self.settings.compiler.version + ) + ) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy("icecream.hpp", dst="include", src=self._source_subfolder) diff --git a/recipes/icecream-cpp/all/test_package/CMakeLists.txt b/recipes/icecream-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6aab347eddf53 --- /dev/null +++ b/recipes/icecream-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/icecream-cpp/all/test_package/conanfile.py b/recipes/icecream-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..186ee2682166d --- /dev/null +++ b/recipes/icecream-cpp/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class IcecreamcppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/icecream-cpp/all/test_package/example.cpp b/recipes/icecream-cpp/all/test_package/example.cpp new file mode 100644 index 0000000000000..289481f9c6620 --- /dev/null +++ b/recipes/icecream-cpp/all/test_package/example.cpp @@ -0,0 +1,5 @@ +#include "icecream.hpp" + +int main() { + IC(); +} diff --git a/recipes/icecream-cpp/config.yml b/recipes/icecream-cpp/config.yml new file mode 100644 index 0000000000000..b9005978dcd6c --- /dev/null +++ b/recipes/icecream-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.1": + folder: all diff --git a/recipes/iceoryx/all/CMakeLists.txt b/recipes/iceoryx/all/CMakeLists.txt new file mode 100644 index 0000000000000..ae4d7a261b19e --- /dev/null +++ b/recipes/iceoryx/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder/iceoryx_meta") diff --git a/recipes/iceoryx/all/conandata.yml b/recipes/iceoryx/all/conandata.yml new file mode 100644 index 0000000000000..638b5224b83e0 --- /dev/null +++ b/recipes/iceoryx/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "2.0.2": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.2.tar.gz" + sha256: "99871BCAA8DA4361D1BAAE9CF1507683058DE8572AC3080EDC41E590FFBA06C0" + "2.0.1": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.1.tar.gz" + sha256: "A6750992EA668786F267E4EDA5588DE4D7585F30E59DCF8512620AF509D6690F" + "2.0.0": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.0.tar.gz" + sha256: "C598DD0630F535D61EA9F8BDE5FE7DA3EF4C595419ECFBCD2384CA6FB4CA804F" + "1.0.1": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v1.0.1.tar.gz" + sha256: "c47f2e1e6cb7660a2d1c2666fa3b640a2f57275d2e524d0c80160a51a781e0dc" + "1.0.0": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/refs/tags/v1.0.0.tar.gz" + sha256: "3D7BABCF92974F6D22E8A497E31198DE1D88DF8B20C942992DBBEC5DFB06C4BB" +patches: + "2.0.2": + - base_path: "source_subfolder" + patch_file: "patches/2.0.X-0001-fix-find-toml.patch" + "2.0.1": + - base_path: "source_subfolder" + patch_file: "patches/2.0.X-0001-fix-find-toml.patch" + "2.0.0": + - base_path: "source_subfolder" + patch_file: "patches/2.0.X-0001-fix-find-toml.patch" + "1.0.1": + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0001-fix-find-toml.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0002-fix-install-bundle.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0003-no-hardcoded-libcxx.patch" + "1.0.0": + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0001-fix-find-toml.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0002-fix-install-bundle.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0003-no-hardcoded-libcxx.patch" diff --git a/recipes/iceoryx/all/conanfile.py b/recipes/iceoryx/all/conanfile.py new file mode 100644 index 0000000000000..c14f7ee13f243 --- /dev/null +++ b/recipes/iceoryx/all/conanfile.py @@ -0,0 +1,298 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class IceoryxConan(ConanFile): + name = "iceoryx" + license = "Apache-2.0" + homepage = "https://iceoryx.io/" + url = "https://github.com/conan-io/conan-center-index" + description = "Eclipse iceoryx - true zero-copy inter-process-communication" + topics = ("Shared Memory", "IPC", "ROS", "Middleware") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "toml_config": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "toml_config": True, + } + + generators = ["cmake", "cmake_find_package"] + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.toml_config: + self.requires("cpptoml/0.1.1") + if self.settings.os == "Linux": + self.requires("acl/2.3.1") + + def build_requirements(self): + if tools.Version(self.version) >= "2.0.0": + self.tool_requires("cmake/3.16.2") + + def validate(self): + compiler = self.settings.compiler + version = tools.Version(self.settings.compiler.version) + + if compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + if compiler == "Visual Studio": + if version < "16": + raise ConanInvalidConfiguration("Iceoryx is just supported for Visual Studio 2019 and higher.") + if self.options.shared: + raise ConanInvalidConfiguration( + 'Using Iceoryx with Visual Studio currently just possible with "shared=False"') + elif compiler == "gcc": + if version < "6": + raise ConanInvalidConfiguration("Using Iceoryx with gcc requires gcc 6 or higher.") + if version < "9" and compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration("gcc < 9 with libstdc++ not supported") + if version == "6": + self.output.warn("Iceoryx package is compiled with gcc 6, it is recommended to use 7 or higher") + self.output.warn("GCC 6 will build with warnings.") + elif compiler == "clang": + if compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration("clang with libstdc++ not supported") + if version == "7.0" and compiler.get_safe("libcxx") == "libc++" and \ + self.options.shared and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration("shared Debug with clang 7.0 and libc++ not supported") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + # Honor fPIC option + iceoryx_utils = "iceoryx_hoofs" if tools.Version(self.version) >= "2.0.0" else "iceoryx_utils" + for cmake_file in [ + os.path.join("iceoryx_binding_c", "CMakeLists.txt"), + os.path.join("iceoryx_posh", "CMakeLists.txt"), + os.path.join(iceoryx_utils, "CMakeLists.txt") + ]: + tools.replace_in_file(os.path.join(self._source_subfolder, cmake_file), "POSITION_INDEPENDENT_CODE ON", "") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["TOML_CONFIG"] = self.options.toml_config + if tools.Version(self.version) >= "2.0.0": + self._cmake.definitions["DOWNLOAD_TOML_LIB"] = False + self._cmake.configure() + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + if self.options.toml_config: + tools.mkdir(os.path.join(self.package_folder, "res")) + tools.rename(os.path.join(self.package_folder, "etc", "roudi_config_example.toml"), + os.path.join(self.package_folder, "res", "roudi_config.toml")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + # bring to default package structure + if (tools.Version(self.version) >= "2.0.0"): + include_paths = ["iceoryx_binding_c", "iceoryx_hoofs", "iceoryx_posh", "iceoryx_versions.hpp"] + for include_path in include_paths: + tools.rename( + os.path.join(self.package_folder, "include", "iceoryx", "v{}".format(self.version), include_path), + os.path.join(self.package_folder, "include", include_path)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + if (tools.Version(self.version) >= "2.0.0"): + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {v["target"]: "iceoryx::{}".format(k) + for k, v in self._iceoryx_components["2.0.0"].items()}) + else: + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {v["target"]: "iceoryx::{}".format(k) + for k, v in self._iceoryx_components["1.0.X"].items()}) + + @property + def _iceoryx_components(self): + + def pthread(): + return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def rt(): + return ["rt"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def atomic(): + return ["atomic"] if self.settings.os == "Linux" else [] + + def acl(): + return ["acl::acl"] if self.settings.os == "Linux" else [] + + def cpptoml(): + return ["cpptoml::cpptoml"] if self.options.toml_config else [] + + def libcxx(): + libcxx = tools.stdcpp_library(self) + return [libcxx] if libcxx and not self.options.shared else [] + + return { + "1.0.X": { + "iceoryx_platform": { + "target": "iceoryx_utils::iceoryx_platform", + "system_libs": pthread(), + "requires": [] + }, + "iceoryx_utils": { + "target": "iceoryx_utils::iceoryx_utils", + "system_libs": pthread() + rt() + atomic(), + "requires": ["iceoryx_platform"] + acl() + }, + "iceoryx_posh": { + "target": "iceoryx_posh::iceoryx_posh", + "system_libs": pthread(), + "requires": ["iceoryx_utils"] + }, + "iceoryx_posh_roudi": { + "target": "iceoryx_posh::iceoryx_posh_roudi", + "system_libs": pthread(), + "requires": ["iceoryx_utils", "iceoryx_posh"] + cpptoml() + }, + "iceoryx_posh_gateway": { + "target": "iceoryx_posh::iceoryx_posh_gateway", + "system_libs": pthread(), + "requires": ["iceoryx_utils", "iceoryx_posh"] + }, + "iceoryx_posh_config": { + "target": "iceoryx_posh::iceoryx_posh_config", + "system_libs": pthread(), + "requires": ["iceoryx_posh_roudi", "iceoryx_utils", "iceoryx_posh"] + }, + "iceoryx_binding_c": { + "target": "iceoryx_binding_c::iceoryx_binding_c", + "system_libs": pthread() + libcxx(), + "requires": ["iceoryx_utils", "iceoryx_posh"] + } + }, + "2.0.0": { + "iceoryx_platform": { + "target": "iceoryx_hoofs::iceoryx_platform", + "system_libs": pthread() + rt(), + "requires": [], + "includeDir": False + }, + "iceoryx_hoofs": { + "target": "iceoryx_hoofs::iceoryx_hoofs", + "system_libs": pthread() + rt() + atomic(), + "requires": ["iceoryx_platform"] + acl(), + "includeDir": True + }, + "iceoryx_posh": { + "target": "iceoryx_posh::iceoryx_posh", + "system_libs": pthread() + rt(), + "requires": ["iceoryx_hoofs"], + "includeDir": True + }, + "iceoryx_posh_roudi": { + "target": "iceoryx_posh::iceoryx_posh_roudi", + "system_libs": pthread(), + "requires": ["iceoryx_hoofs", "iceoryx_posh"] + cpptoml(), + "includeDir": False + }, + "iceoryx_posh_gateway": { + "target": "iceoryx_posh::iceoryx_posh_gateway", + "system_libs": pthread(), + "requires": ["iceoryx_hoofs", "iceoryx_posh"], + "includeDir": False + }, + "iceoryx_posh_config": { + "target": "iceoryx_posh::iceoryx_posh_config", + "system_libs": pthread(), + "requires": ["iceoryx_posh_roudi", "iceoryx_hoofs", "iceoryx_posh"], + "includeDir": False + }, + "iceoryx_binding_c": { + "target": "iceoryx_binding_c::iceoryx_binding_c", + "system_libs": pthread() + libcxx(), + "requires": ["iceoryx_hoofs", "iceoryx_posh"], + "includeDir": True + } + } + } + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + # FIXME: We should provide 3 CMake config files: + # iceoryx_utilsConfig.cmake, iceoryx_poshConfig.cmake and iceoryx_binding_cConfig.cmake + # It's not possible yet, see https://github.com/conan-io/conan/issues/9000 + self.cpp_info.set_property("cmake_file_name", "iceoryx") + + def _register_components(components): + for lib_name, values in components.items(): + cmake_target = values.get("target", []) + system_libs = values.get("system_libs", []) + requires = values.get("requires", []) + self.cpp_info.components[lib_name].set_property("cmake_target_name", cmake_target) + self.cpp_info.components[lib_name].libs = [lib_name] + self.cpp_info.components[lib_name].system_libs = system_libs + self.cpp_info.components[lib_name].requires = requires + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[lib_name].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[lib_name].build_modules["cmake_find_package_multi"] = [ + self._module_file_rel_path + ] + + if tools.Version(self.version) >= "2.0.0": + _register_components(self._iceoryx_components["2.0.0"]) + else: + _register_components(self._iceoryx_components["1.0.X"]) + + 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/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch b/recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch new file mode 100644 index 0000000000000..062232389f69a --- /dev/null +++ b/recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch @@ -0,0 +1,21 @@ +diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt +index 6df5429b..e7dedbc4 100644 +--- a/iceoryx_posh/CMakeLists.txt ++++ b/iceoryx_posh/CMakeLists.txt +@@ -27,8 +27,6 @@ option(TOML_CONFIG "TOML support for RouDi with dynamic configuration" ON) + option(ONE_TO_MANY_ONLY "Restricts communication to 1:n pattern" OFF) + + if(TOML_CONFIG) +- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpptoml/ ${CMAKE_BINARY_DIR}/dependencies/posh/cpptoml/prebuild) +- + find_package(cpptoml REQUIRED) + endif() + +@@ -325,7 +323,6 @@ if(TOML_CONFIG) + iceoryx_posh::iceoryx_posh + iceoryx_utils::iceoryx_utils + iceoryx_posh::iceoryx_posh_roudi +- cpptoml + ${ICEORYX_SANITIZER_FLAGS} + ) + diff --git a/recipes/iceoryx/all/patches/1.0.0-0002-fix-install-bundle.patch b/recipes/iceoryx/all/patches/1.0.0-0002-fix-install-bundle.patch new file mode 100644 index 0000000000000..bebf8b4d52e71 --- /dev/null +++ b/recipes/iceoryx/all/patches/1.0.0-0002-fix-install-bundle.patch @@ -0,0 +1,10 @@ +--- a/iceoryx_utils/cmake/IceoryxPackageHelper.cmake ++++ b/iceoryx_utils/cmake/IceoryxPackageHelper.cmake +@@ -78,6 +78,7 @@ Macro(install_target_directories_and_header) + TARGETS ${INSTALL_TARGETS} + EXPORT ${TARGETS_EXPORT_NAME} + RUNTIME DESTINATION ${DESTINATION_BINDIR} COMPONENT bin ++ BUNDLE DESTINATION ${DESTINATION_BINDIR} COMPONENT bin + LIBRARY DESTINATION ${DESTINATION_LIBDIR} COMPONENT bin + ARCHIVE DESTINATION ${DESTINATION_LIBDIR} COMPONENT bin + ) diff --git a/recipes/iceoryx/all/patches/1.0.0-0003-no-hardcoded-libcxx.patch b/recipes/iceoryx/all/patches/1.0.0-0003-no-hardcoded-libcxx.patch new file mode 100644 index 0000000000000..67d4c05d0c142 --- /dev/null +++ b/recipes/iceoryx/all/patches/1.0.0-0003-no-hardcoded-libcxx.patch @@ -0,0 +1,10 @@ +--- a/iceoryx_binding_c/CMakeLists.txt ++++ b/iceoryx_binding_c/CMakeLists.txt +@@ -88,7 +88,6 @@ target_include_directories(${PROJECT_NAME} + if(NOT (WIN32 OR QNX)) + target_link_libraries(${PROJECT_NAME} + PUBLIC +- stdc++ + pthread + PRIVATE + iceoryx_posh::iceoryx_posh diff --git a/recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch b/recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch new file mode 100644 index 0000000000000..fe7e89524991f --- /dev/null +++ b/recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch @@ -0,0 +1,12 @@ +diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt +index 8f28ac07b..c07b16b88 100644 +--- a/iceoryx_posh/CMakeLists.txt ++++ b/iceoryx_posh/CMakeLists.txt +@@ -350,7 +350,6 @@ if(TOML_CONFIG) + iceoryx_posh::iceoryx_posh + iceoryx_hoofs::iceoryx_hoofs + iceoryx_posh::iceoryx_posh_roudi +- cpptoml + ${ICEORYX_SANITIZER_FLAGS} + ) + diff --git a/recipes/iceoryx/all/test_package/CMakeLists.txt b/recipes/iceoryx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4d89e84377074 --- /dev/null +++ b/recipes/iceoryx/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if (${MSVC}) + set(CMAKE_CXX_STANDARD 17) +else() + set(CMAKE_CXX_STANDARD 14) +endif() + +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(iceoryx REQUIRED CONFIG) + +add_executable(test_package main.cpp) +target_link_libraries(test_package iceoryx_posh::iceoryx_posh + iceoryx_posh::iceoryx_posh_roudi +) diff --git a/recipes/iceoryx/all/test_package/conanfile.py b/recipes/iceoryx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..50e21d11f1ebd --- /dev/null +++ b/recipes/iceoryx/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +import os +from conans import ConanFile, CMake + +class IceoryxTestConan(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): + # ToDo : add an executable which can be + # executed in container. + # currently seems shared memory in container is + # a bad idea (checked on 3 different linux devices + # always ok - but in container get + # "fatal SIGBUS signal appeared caused by memset") + path, dirs, files = next(os.walk("bin")) + print("All %d example files are present" % (len(files))) diff --git a/recipes/iceoryx/all/test_package/main.cpp b/recipes/iceoryx/all/test_package/main.cpp new file mode 100644 index 0000000000000..84eb37579a34f --- /dev/null +++ b/recipes/iceoryx/all/test_package/main.cpp @@ -0,0 +1,24 @@ + +#include "iceoryx_posh/iceoryx_posh_config.hpp" +#include "iceoryx_posh/iceoryx_posh_types.hpp" +#include "iceoryx_posh/internal/roudi/roudi.hpp" +#include "iceoryx_posh/popo/publisher.hpp" +#include "iceoryx_posh/popo/subscriber.hpp" +#include "iceoryx_posh/roudi/iceoryx_roudi_components.hpp" +#include "iceoryx_posh/runtime/posh_runtime_single_process.hpp" + +#include +#include +#include +#include +#include +#include + +int main() { + + iox::log::LogManager::GetLogManager().SetDefaultLogLevel(iox::log::LogLevel::kError); + iox::RouDiConfig_t defaultRouDiConfig = iox::RouDiConfig_t().setDefaults(); + iox::roudi::IceOryxRouDiComponents roudiComponents(defaultRouDiConfig); + + return 0; +} diff --git a/recipes/iceoryx/config.yml b/recipes/iceoryx/config.yml new file mode 100644 index 0000000000000..bb084f4416dd3 --- /dev/null +++ b/recipes/iceoryx/config.yml @@ -0,0 +1,11 @@ +versions: + "2.0.2": + folder: all + "2.0.1": + folder: all + "2.0.0": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all diff --git a/recipes/icu/all/conandata.yml b/recipes/icu/all/conandata.yml new file mode 100644 index 0000000000000..bebf278b61b51 --- /dev/null +++ b/recipes/icu/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "73.1": + url: "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz" + sha256: "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45" + "72.1": + url: "https://github.com/unicode-org/icu/releases/download/release-72-1/icu4c-72_1-src.tgz" + sha256: "a2d2d38217092a7ed56635e34467f92f976b370e20182ad325edea6681a71d68" + "71.1": + url: "https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.tgz" + sha256: "67a7e6e51f61faf1306b6935333e13b2c48abd8da6d2f46ce6adca24b1e21ebf" + "70.1": + url: "https://github.com/unicode-org/icu/releases/download/release-70-1/icu4c-70_1-src.tgz" + sha256: "8d205428c17bf13bb535300669ed28b338a157b1c01ae66d31d0d3e2d47c3fd5" + "69.1": + url: "https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz" + sha256: "4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745" + "68.2": + url: "https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz" + sha256: "c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625" +patches: + "73.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + "72.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + "71.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + - patch_file: "patches/0001-71.1-fix-undef-strict-ansi.patch" + - patch_file: "patches/0001-71.1-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" + "70.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + "69.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + "68.2": + - patch_file: "patches/0001-67.1-fix-mingw.patch" diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py new file mode 100644 index 0000000000000..26611e98022e6 --- /dev/null +++ b/recipes/icu/all/conanfile.py @@ -0,0 +1,348 @@ +import glob +import hashlib +import os +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building, stdcpp_library +from conan.tools.env import Environment, 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.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.57.0" + + +class ICUConan(ConanFile): + name = "icu" + homepage = "http://site.icu-project.org" + license = "ICU" + description = "ICU is a mature, widely used set of C/C++ and Java libraries " \ + "providing Unicode and Globalization support for software applications." + url = "https://github.com/conan-io/conan-center-index" + topics = ("icu", "icu4c", "i see you", "unicode") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "data_packaging": ["files", "archive", "library", "static"], + "with_dyload": [True, False], + "dat_package_file": [None, "ANY"], + "with_icuio": [True, False], + "with_extras": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "data_packaging": "archive", + "with_dyload": True, + "dat_package_file": None, + "with_icuio": True, + "with_extras": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _enable_icu_tools(self): + return self.settings.os not in ["iOS", "tvOS", "watchOS", "Emscripten"] + + @property + def _with_unit_tests(self): + return not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.data_packaging + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + if self.options.dat_package_file: + if not os.path.exists(self.options.dat_package_file): + raise ConanInvalidConfiguration("Non-existent dat_package_file specified") + + def layout(self): + basic_layout(self, src_folder="src") + + @staticmethod + def _sha256sum(file_path): + m = hashlib.sha256() + with open(file_path, "rb") as fh: + for data in iter(lambda: fh.read(8192), b""): + m.update(data) + return m.hexdigest() + + def package_id(self): + if self.info.options.dat_package_file: + self.info.options.dat_package_file = self._sha256sum(str(self.info.options.dat_package_file)) + + 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 cross_building(self) and hasattr(self, "settings_build"): + self.tool_requires(str(self.ref)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + if not self.options.shared: + tc.extra_defines.append("U_STATIC_IMPLEMENTATION") + if is_apple_os(self): + tc.extra_defines.append("_DARWIN_C_SOURCE") + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--datarootdir=${prefix}/lib", # do not use share + f"--enable-release={yes_no(self.settings.build_type != 'Debug')}", + f"--enable-debug={yes_no(self.settings.build_type == 'Debug')}", + f"--enable-dyload={yes_no(self.options.with_dyload)}", + f"--enable-extras={yes_no(self.options.with_extras)}", + f"--enable-icuio={yes_no(self.options.with_icuio)}", + "--disable-layoutex", + "--disable-layout", + f"--enable-tools={yes_no(self._enable_icu_tools)}", + f"--enable-tests={yes_no(self._with_unit_tests)}", + "--disable-samples", + ]) + if cross_building(self): + base_path = unix_path(self, self.dependencies.build["icu"].package_folder) + tc.configure_args.append(f"--with-cross-build={base_path}") + if self.settings.os in ["iOS", "tvOS", "watchOS"]: + # ICU build scripts interpret all Apple platforms as 'darwin'. + # Since this can coincide with the `build` triple, we need to tweak + # the build triple to avoid the collision and ensure the scripts + # know we are cross-building. + host_triplet = f"{str(self.settings.arch)}-apple-darwin" + build_triplet = f"{str(self._settings_build.arch)}-apple" + tc.update_configure_args({"--host": host_triplet, + "--build": build_triplet}) + else: + arch64 = ["x86_64", "sparcv9", "ppc64", "ppc64le", "armv8", "armv8.3", "mips64"] + bits = "64" if self.settings.arch in arch64 else "32" + tc.configure_args.append(f"--with-library-bits={bits}") + if self.settings.os != "Windows": + # http://userguide.icu-project.org/icudata + # This is the only directly supported behavior on Windows builds. + tc.configure_args.append(f"--with-data-packaging={self.options.data_packaging}") + tc.generate() + + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + if cross_building(self): + env.define("icu_cv_host_frag", "mh-msys-msvc") + env.vars(self).save_script("conanbuild_icu_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + + if not self._with_unit_tests: + # Prevent any call to python during configuration, it's only needed for unit tests + replace_in_file( + self, + os.path.join(self.source_folder, "source", "configure"), + "if test -z \"$PYTHON\"", + "if true", + ) + + if self._settings_build.os == "Windows": + # https://unicode-org.atlassian.net/projects/ICU/issues/ICU-20545 + makeconv_cpp = os.path.join(self.source_folder, "source", "tools", "makeconv", "makeconv.cpp") + replace_in_file(self, makeconv_cpp, + "pathBuf.appendPathPart(arg, localError);", + "pathBuf.append(\"/\", localError); pathBuf.append(arg, localError);") + + # relocatable shared libs on macOS + mh_darwin = os.path.join(self.source_folder, "source", "config", "mh-darwin") + replace_in_file(self, mh_darwin, "-install_name $(libdir)/$(notdir", "-install_name @rpath/$(notdir") + replace_in_file(self, + mh_darwin, + "-install_name $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)", + "-install_name @rpath/$(notdir $(MIDDLE_SO_TARGET))", + ) + + # workaround for https://unicode-org.atlassian.net/browse/ICU-20531 + mkdir(self, os.path.join(self.build_folder, "data", "out", "tmp")) + + # workaround for "No rule to make target 'out/tmp/dirs.timestamp'" + save(self, os.path.join(self.build_folder, "data", "out", "tmp", "dirs.timestamp"), "") + + def build(self): + self._patch_sources() + + if self.options.dat_package_file: + dat_package_file = glob.glob(os.path.join(self.source_folder, "source", "data", "in", "*.dat")) + if dat_package_file: + shutil.copy(str(self.options.dat_package_file), dat_package_file[0]) + + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "source")) + autotools.make() + if self._with_unit_tests: + autotools.make(target="check") + + @property + def _data_filename(self): + vtag = Version(self.version).major + return f"icudt{vtag}l.dat" + + @property + def _data_path(self): + data_dir_name = "icu" + if self.settings.os == "Windows" and self.settings.build_type == "Debug": + data_dir_name += "d" + data_dir = os.path.join(self.package_folder, "lib", data_dir_name, str(self.version)) + return os.path.join(data_dir, self._data_filename) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + dll_files = glob.glob(os.path.join(self.package_folder, "lib", "*.dll")) + if dll_files: + bin_dir = os.path.join(self.package_folder, "bin") + mkdir(self, bin_dir) + for dll in dll_files: + dll_name = os.path.basename(dll) + rm(self, dll_name, bin_dir) + rename(self, src=dll, dst=os.path.join(bin_dir, dll_name)) + + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + mkdir(self, os.path.join(self.package_folder, "res")) + rename(self, src=self._data_path, dst=os.path.join(self.package_folder, "res", self._data_filename)) + + # Copy some files required for cross-compiling + config_dir = os.path.join(self.package_folder, "config") + copy(self, "icucross.mk", src=os.path.join(self.build_folder, "config"), dst=config_dir) + copy(self, "icucross.inc", src=os.path.join(self.build_folder, "config"), dst=config_dir) + + rmdir(self, os.path.join(self.package_folder, "lib", "icu")) + rmdir(self, os.path.join(self.package_folder, "lib", "man")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ICU") + + prefix = "s" if self.settings.os == "Windows" and not self.options.shared else "" + suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + + # icudata + self.cpp_info.components["icu-data"].set_property("cmake_target_name", "ICU::data") + icudata_libname = "icudt" if self.settings.os == "Windows" else "icudata" + self.cpp_info.components["icu-data"].libs = [f"{prefix}{icudata_libname}{suffix}"] + if not self.options.shared: + self.cpp_info.components["icu-data"].defines.append("U_STATIC_IMPLEMENTATION") + # icu uses c++, so add the c++ runtime + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["icu-data"].system_libs.append(libcxx) + + # Alias of data CMake component + self.cpp_info.components["icu-data-alias"].set_property("cmake_target_name", "ICU::dt") + self.cpp_info.components["icu-data-alias"].requires = ["icu-data"] + + # icuuc + self.cpp_info.components["icu-uc"].set_property("cmake_target_name", "ICU::uc") + self.cpp_info.components["icu-uc"].set_property("pkg_config_name", "icu-uc") + self.cpp_info.components["icu-uc"].libs = [f"{prefix}icuuc{suffix}"] + self.cpp_info.components["icu-uc"].requires = ["icu-data"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-uc"].system_libs = ["m", "pthread"] + if self.options.with_dyload: + self.cpp_info.components["icu-uc"].system_libs.append("dl") + elif self.settings.os == "Windows": + self.cpp_info.components["icu-uc"].system_libs = ["advapi32"] + + # icui18n + self.cpp_info.components["icu-i18n"].set_property("cmake_target_name", "ICU::i18n") + self.cpp_info.components["icu-i18n"].set_property("pkg_config_name", "icu-i18n") + icui18n_libname = "icuin" if self.settings.os == "Windows" else "icui18n" + self.cpp_info.components["icu-i18n"].libs = [f"{prefix}{icui18n_libname}{suffix}"] + self.cpp_info.components["icu-i18n"].requires = ["icu-uc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-i18n"].system_libs = ["m"] + + # Alias of i18n CMake component + self.cpp_info.components["icu-i18n-alias"].set_property("cmake_target_name", "ICU::in") + self.cpp_info.components["icu-i18n-alias"].requires = ["icu-i18n"] + + # icuio + if self.options.with_icuio: + self.cpp_info.components["icu-io"].set_property("cmake_target_name", "ICU::io") + self.cpp_info.components["icu-io"].set_property("pkg_config_name", "icu-io") + self.cpp_info.components["icu-io"].libs = [f"{prefix}icuio{suffix}"] + self.cpp_info.components["icu-io"].requires = ["icu-i18n", "icu-uc"] + + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + self.cpp_info.components["icu-data"].resdirs = ["res"] + data_path = os.path.join(self.package_folder, "res", self._data_filename).replace("\\", "/") + self.runenv_info.prepend_path("ICU_DATA", data_path) + if self._enable_icu_tools or self.options.with_extras: + self.buildenv_info.prepend_path("ICU_DATA", data_path) + + if self._enable_icu_tools: + # icutu + self.cpp_info.components["icu-tu"].set_property("cmake_target_name", "ICU::tu") + self.cpp_info.components["icu-tu"].libs = [f"{prefix}icutu{suffix}"] + self.cpp_info.components["icu-tu"].requires = ["icu-i18n", "icu-uc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-tu"].system_libs = ["pthread"] + + # icutest + self.cpp_info.components["icu-test"].set_property("cmake_target_name", "ICU::test") + self.cpp_info.components["icu-test"].libs = [f"{prefix}icutest{suffix}"] + self.cpp_info.components["icu-test"].requires = ["icu-tu", "icu-uc"] + + # TODO: to remove after conan v2 + self.cpp_info.names["cmake_find_package"] = "ICU" + self.cpp_info.names["cmake_find_package_multi"] = "ICU" + self.cpp_info.components["icu-data"].names["cmake_find_package"] = "data" + self.cpp_info.components["icu-data"].names["cmake_find_package_multi"] = "data" + self.cpp_info.components["icu-data-alias"].names["cmake_find_package"] = "dt" + self.cpp_info.components["icu-data-alias"].names["cmake_find_package_multi"] = "dt" + self.cpp_info.components["icu-uc"].names["cmake_find_package"] = "uc" + self.cpp_info.components["icu-uc"].names["cmake_find_package_multi"] = "uc" + self.cpp_info.components["icu-i18n"].names["cmake_find_package"] = "i18n" + self.cpp_info.components["icu-i18n"].names["cmake_find_package_multi"] = "i18n" + self.cpp_info.components["icu-i18n-alias"].names["cmake_find_package"] = "in" + self.cpp_info.components["icu-i18n-alias"].names["cmake_find_package_multi"] = "in" + if self.options.with_icuio: + self.cpp_info.components["icu-io"].names["cmake_find_package"] = "io" + self.cpp_info.components["icu-io"].names["cmake_find_package_multi"] = "io" + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + self.env_info.ICU_DATA.append(data_path) + if self._enable_icu_tools: + self.cpp_info.components["icu-tu"].names["cmake_find_package"] = "tu" + self.cpp_info.components["icu-tu"].names["cmake_find_package_multi"] = "tu" + self.cpp_info.components["icu-test"].names["cmake_find_package"] = "test" + self.cpp_info.components["icu-test"].names["cmake_find_package_multi"] = "test" + if self._enable_icu_tools or self.options.with_extras: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/icu/all/patches/0001-67.1-fix-mingw.patch b/recipes/icu/all/patches/0001-67.1-fix-mingw.patch new file mode 100644 index 0000000000000..93f5bd7f9ab8a --- /dev/null +++ b/recipes/icu/all/patches/0001-67.1-fix-mingw.patch @@ -0,0 +1,37 @@ +--- source/config/mh-mingw64 ++++ source/config/mh-mingw64 +@@ -94,7 +94,7 @@ + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,10 +102,10 @@ + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +--- source/data/Makefile.in ++++ source/data/Makefile.in +@@ -207,7 +207,7 @@ + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/recipes/icu/all/patches/0001-69.1-fix-mingw.patch b/recipes/icu/all/patches/0001-69.1-fix-mingw.patch new file mode 100644 index 0000000000000..61d3b8f65314b --- /dev/null +++ b/recipes/icu/all/patches/0001-69.1-fix-mingw.patch @@ -0,0 +1,43 @@ +--- source/config/mh-mingw64 ++++ source/config/mh-mingw64 +@@ -94,7 +94,7 @@ + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,13 +102,13 @@ + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)"" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +--- source/data/Makefile.in ++++ source/data/Makefile.in +@@ -207,7 +207,7 @@ + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/recipes/icu/all/patches/0001-71.1-fix-emscripten.patch b/recipes/icu/all/patches/0001-71.1-fix-emscripten.patch new file mode 100644 index 0000000000000..5693ab70111d5 --- /dev/null +++ b/recipes/icu/all/patches/0001-71.1-fix-emscripten.patch @@ -0,0 +1,117 @@ +diff --git a/source/acinclude.m4 b/source/acinclude.m4 +index 507f41f..2980ef1 100644 +--- a/source/acinclude.m4 ++++ b/source/acinclude.m4 +@@ -84,6 +84,7 @@ x86_64-*-cygwin) + *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; + *-*-nto*) icu_cv_host_frag=mh-qnx ;; + *-ncr-*) icu_cv_host_frag=mh-mpras ;; ++wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;; + *) icu_cv_host_frag=mh-unknown ;; + esac + ] +diff --git a/source/config/mh-emscripten b/source/config/mh-emscripten +new file mode 100644 +index 0000000..ee2b90b +--- /dev/null ++++ b/source/config/mh-emscripten +@@ -0,0 +1,86 @@ ++## Emscripten-specific setup ++## Copyright (c) 1999-2013, International Business Machines Corporation and ++## others. All Rights Reserved. ++## Commands to generate dependency files ++GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) ++GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) ++ ++## Flags for position independent code ++SHAREDLIBCFLAGS = -fPIC ++SHAREDLIBCXXFLAGS = -fPIC ++SHAREDLIBCPPFLAGS = -DPIC ++ ++## Additional flags when building libraries and with threads ++THREADSCPPFLAGS = -D_REENTRANT ++LIBCPPFLAGS = ++ ++## Compiler switch to embed a runtime search path ++LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN ++LD_RPATH_PRE = -Wl,-rpath, ++ ++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH: ++ENABLE_RPATH=YES ++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN' ++ ++## These are the library specific LDFLAGS ++#LDFLAGSICUDT=-nodefaultlibs -nostdlib ++# Debian change: linking icudata as data only causes too many problems. ++LDFLAGSICUDT= ++ ++## Compiler switch to embed a library name ++# The initial tab in the next line is to prevent icu-config from reading it. ++ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) ++#SH# # We can't depend on MIDDLE_SO_TARGET being set. ++#SH# LD_SONAME= ++ ++## Shared library options ++LD_SOOPTIONS= -Wl,-Bsymbolic-functions ++ ++## Shared object suffix ++SO = so ++## Non-shared intermediate object suffix ++STATIC_O = o ++ ++## Compilation rules ++# WASM needs -pthread for atomics support ++%.$(STATIC_O): $(srcdir)/%.c ++ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<) ++ ++%.$(STATIC_O): $(srcdir)/%.cpp ++ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<) ++ ++ ++## Dependency rules ++%.d: $(srcdir)/%.c ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.c) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${ header unless __STRICT_ANSI__ is defined. +-// __GNUC__ is set by both gcc and clang. +-#undef __STRICT_ANSI__ +-#endif +- + #include "locmap.h" + #include "unicode/ustdio.h" + diff --git a/recipes/icu/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch b/recipes/icu/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch new file mode 100644 index 0000000000000..05ecec5cd8005 --- /dev/null +++ b/recipes/icu/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch @@ -0,0 +1,22 @@ +From 6aba9344a18f4f32e8070ee53b79495630901c26 Mon Sep 17 00:00:00 2001 +From: "Shane F. Carr" +Date: Fri, 24 Apr 2020 19:23:40 -0500 +Subject: [PATCH] ICU-21081 Make U_ASSERT C++14 compatible + +--- + source/common/uassert.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source/common/uassert.h b/source/common/uassert.h +index 15cd55c8734..afd31eeffd9 100644 +--- a/source/common/uassert.h ++++ b/source/common/uassert.h +@@ -32,7 +32,7 @@ + # include + # define U_ASSERT(exp) assert(exp) + #elif U_CPLUSPLUS_VERSION +-# define U_ASSERT(exp) void() ++# define U_ASSERT(exp) (void)0 + #else + # define U_ASSERT(exp) + #endif diff --git a/recipes/icu/all/test_package/CMakeLists.txt b/recipes/icu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4275c0782ed46 --- /dev/null +++ b/recipes/icu/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ICU REQUIRED uc) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ICU::uc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/icu/all/test_package/conanfile.py b/recipes/icu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/icu/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/icu/all/test_package/test_package.cpp b/recipes/icu/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8b18aa14d87d6 --- /dev/null +++ b/recipes/icu/all/test_package/test_package.cpp @@ -0,0 +1,623 @@ + +// This is taken from ICU samples: source/samples/ustring + +/* +******************************************************************************* +* +* © 2016 and later: Unicode, Inc. and others. +* License & terms of use: http://www.unicode.org/copyright.html#License +* +******************************************************************************* +******************************************************************************* +* +* Copyright (C) 2000-2014, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: ustring.c +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 2000aug15 +* created by: Markus W. Scherer +* +* This file contains sample code that illustrates the use of Unicode strings +* with ICU. +*/ + +#include +#define U_DEFINE_FALSE_AND_TRUE 1 +#include "unicode/utypes.h" +#include "unicode/uchar.h" +#include "unicode/locid.h" +#include "unicode/ustring.h" +#include "unicode/ucnv.h" +#include "unicode/unistr.h" + +#ifndef UPRV_LENGTHOF +#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) +#endif + +// helper functions -------------------------------------------------------- *** + +// default converter for the platform encoding +static UConverter *cnv=NULL; + +using namespace icu; + +static void +printUString(const char *announce, const UChar *s, int32_t length) { + static char out[200]; + UChar32 c; + int32_t i; + UErrorCode errorCode=U_ZERO_ERROR; + + /* + * Convert to the "platform encoding". See notes in printUnicodeString(). + * ucnv_fromUChars(), like most ICU APIs understands length==-1 + * to mean that the string is NUL-terminated. + */ + ucnv_fromUChars(cnv, out, sizeof(out), s, length, &errorCode); + if(U_FAILURE(errorCode) || errorCode==U_STRING_NOT_TERMINATED_WARNING) { + printf("%sproblem converting string from Unicode: %s\n", announce, u_errorName(errorCode)); + return; + } + + printf("%s%s {", announce, out); + + /* output the code points (not code units) */ + if(length>=0) { + /* s is not NUL-terminated */ + for(i=0; i0; /* U16_PREV pre-decrements */) { + U16_PREV(input, 0, i, c); + /* Iterating backwards + Codepoint at offset 5: U+0062 + Codepoint at offset 3: U+10ffff + Codepoint at offset 2: U+dc00 -- unpaired surrogate because lead surr. overwritten + Codepoint at offset 1: U+0062 -- by this BMP code point + Codepoint at offset 0: U+0061 + */ + printf("Codepoint at offset %d: U+%04x\n", i, c); + } +} + +// sample code for Unicode strings in C ------------------------------------ *** + +static void demo_C_Unicode_strings() { + printf("\n* demo_C_Unicode_strings() --------- ***\n\n"); + + static const UChar text[]={ 0x41, 0x42, 0x43, 0 }; /* "ABC" */ + static const UChar appendText[]={ 0x61, 0x62, 0x63, 0 }; /* "abc" */ + static const UChar cmpText[]={ 0x61, 0x53, 0x73, 0x43, 0 }; /* "aSsC" */ + UChar buffer[32]; + int32_t compare; + int32_t length=u_strlen(text); /* length=3 */ + + /* simple ANSI C-style functions */ + buffer[0]=0; /* empty, NUL-terminated string */ + u_strncat(buffer, text, 1); /* append just n=1 character ('A') */ + u_strcat(buffer, appendText); /* buffer=="Aabc" */ + length=u_strlen(buffer); /* length=4 */ + printUString("should be \"Aabc\": ", buffer, -1); + + /* bitwise comparing buffer with text */ + compare=u_strcmp(buffer, text); + if(compare<=0) { + printf("String comparison error, expected \"Aabc\" > \"ABC\"\n"); + } + + /* Build "AC" in the buffer... */ + u_strcpy(buffer, text); + buffer[1]=0xdf; /* sharp s, case-compares equal to "ss" */ + printUString("should be \"AC\": ", buffer, -1); + + /* Compare two strings case-insensitively using full case folding */ + compare=u_strcasecmp(buffer, cmpText, U_FOLD_CASE_DEFAULT); + if(compare!=0) { + printf("String case insensitive comparison error, expected \"AbC\" to be equal to \"ABC\"\n"); + } +} + +// sample code for case mappings with C APIs -------------------------------- *** + +static void demoCaseMapInC() { + /* + * input= + * "aB" + * "iI " + * " " + * "" + */ + static const UChar input[]={ + 0x61, 0x42, 0x3a3, + 0x69, 0x49, 0x131, 0x130, 0x20, + 0xdf, 0x20, 0xfb03, + 0x3c2, 0x3c3, 0x3a3, 0 + }; + UChar buffer[32]; + + UErrorCode errorCode; + UChar32 c; + int32_t i, j, length; + UBool isError; + + printf("\n* demoCaseMapInC() ----------------- ***\n\n"); + + /* + * First, use simple case mapping functions which provide + * 1:1 code point mappings without context/locale ID. + * + * Note that some mappings will not be "right" because some "real" + * case mappings require context, depend on the locale ID, + * and/or result in a change in the number of code points. + */ + printUString("input string: ", input, -1); + + /* uppercase */ + isError=FALSE; + for(i=j=0; j" + * "iI " + * " " + * "" + */ + static const UChar input[]={ + 0x61, 0x42, 0x3a3, + 0x69, 0x49, 0x131, 0x130, 0x20, + 0xdf, 0x20, 0xfb03, + 0x3c2, 0x3c3, 0x3a3, 0 + }; + + printf("\n* demoCaseMapInCPlusPlus() --------- ***\n\n"); + + UnicodeString s(input), t; + const Locale &en=Locale::getEnglish(); + Locale tr("tr"); + + /* + * Full case mappings as in demoCaseMapInC(), using UnicodeString functions. + * These functions modify the string object itself. + * Since we want to keep the input string around, we copy it each time + * and case-map the copy. + */ + printUnicodeString("input string: ", s); + + /* lowercase/English */ + printUnicodeString("full-lowercased/en: ", (t=s).toLower(en)); + /* lowercase/Turkish */ + printUnicodeString("full-lowercased/tr: ", (t=s).toLower(tr)); + /* uppercase/English */ + printUnicodeString("full-uppercased/en: ", (t=s).toUpper(en)); + /* uppercase/Turkish */ + printUnicodeString("full-uppercased/tr: ", (t=s).toUpper(tr)); + /* titlecase/English */ + printUnicodeString("full-titlecased/en: ", (t=s).toTitle(NULL, en)); + /* titlecase/Turkish */ + printUnicodeString("full-titlecased/tr: ", (t=s).toTitle(NULL, tr)); + /* case-folde/default */ + printUnicodeString("full-case-folded/default: ", (t=s).foldCase(U_FOLD_CASE_DEFAULT)); + /* case-folde/Turkic */ + printUnicodeString("full-case-folded/Turkic: ", (t=s).foldCase(U_FOLD_CASE_EXCLUDE_SPECIAL_I)); +} + +// sample code for UnicodeString storage models ----------------------------- *** + +static const UChar readonly[]={ + 0x61, 0x31, 0x20ac +}; +static UChar writeable[]={ + 0x62, 0x32, 0xdbc0, 0xdc01 // includes a surrogate pair for a supplementary code point +}; +static char out[100]; + +static void +demoUnicodeStringStorage() { + // These sample code lines illustrate how to use UnicodeString, and the + // comments tell what happens internally. There are no APIs to observe + // most of this programmatically, except for stepping into the code + // with a debugger. + // This is by design to hide such details from the user. + int32_t i; + + printf("\n* demoUnicodeStringStorage() ------- ***\n\n"); + + // * UnicodeString with internally stored contents + // instantiate a UnicodeString from a single code point + // the few (2) UChars will be stored in the object itself + UnicodeString one((UChar32)0x24001); + // this copies the few UChars into the "two" object + UnicodeString two=one; + printf("length of short string copy: %d\n", two.length()); + // set "one" to contain the 3 UChars from readonly + // this setTo() variant copies the characters + one.setTo(readonly, UPRV_LENGTHOF(readonly)); + + // * UnicodeString with allocated contents + // build a longer string that will not fit into the object's buffer + one+=UnicodeString(writeable, UPRV_LENGTHOF(writeable)); + one+=one; + one+=one; + printf("length of longer string: %d\n", one.length()); + // copying will use the same allocated buffer and increment the reference + // counter + two=one; + printf("length of longer string copy: %d\n", two.length()); + + // * UnicodeString using readonly-alias to a const UChar array + // construct a string that aliases a readonly buffer + UnicodeString three(FALSE, readonly, UPRV_LENGTHOF(readonly)); + printUnicodeString("readonly-alias string: ", three); + // copy-on-write: any modification to the string results in + // a copy to either the internal buffer or to a newly allocated one + three.setCharAt(1, 0x39); + printUnicodeString("readonly-aliasing string after modification: ", three); + // the aliased array is not modified + for(i=0; i UChar * -> char * with only " + "invariant characters: \"%s\"\n", + cs2); + + // initialize a UnicodeString from a string literal that contains + // escape sequences written with invariant characters + // do not forget to duplicate the backslashes for ICU to see them + // then, count each double backslash only once! + UnicodeString german=UNICODE_STRING( + "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n", 64). + unescape(); + printUnicodeString("german UnicodeString from unescaping:\n ", german); + + /* + * C: convert and unescape a char * string with only invariant + * characters to fill a UChar * string + */ + UChar buffer[200]; + int32_t length; + length=u_unescape( + "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n", + buffer, UPRV_LENGTHOF(buffer)); + printf("german C Unicode string from char * unescaping: (length %d)\n ", length); + printUnicodeString("", UnicodeString(buffer)); +} + +extern int +main(int argc, const char *argv[]) { + UErrorCode errorCode=U_ZERO_ERROR; + + // Note: Using a global variable for any object is not exactly thread-safe... + + // You can change this call to e.g. ucnv_open("UTF-8", &errorCode) if you pipe + // the output to a file and look at it with a Unicode-capable editor. + // This will currently affect only the printUString() function, see the code above. + // printUnicodeString() could use this, too, by changing to an extract() overload + // that takes a UConverter argument. + cnv=ucnv_open(NULL, &errorCode); + if(U_FAILURE(errorCode)) { + fprintf(stderr, "error %s opening the default converter\n", u_errorName(errorCode)); + return errorCode; + } + + ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_C, NULL, NULL, &errorCode); + if(U_FAILURE(errorCode)) { + fprintf(stderr, "error %s setting the escape callback in the default converter\n", u_errorName(errorCode)); + ucnv_close(cnv); + return errorCode; + } + + demo_utf_h_macros(); + demo_C_Unicode_strings(); + demoCaseMapInC(); + demoCaseMapInCPlusPlus(); + demoUnicodeStringStorage(); + demoUnicodeStringInit(); + + ucnv_close(cnv); + return 0; +} diff --git a/recipes/icu/all/test_v1_package/CMakeLists.txt b/recipes/icu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/icu/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/icu/all/test_v1_package/conanfile.py b/recipes/icu/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9be729bcbe9ce --- /dev/null +++ b/recipes/icu/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools, CMake +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/icu/config.yml b/recipes/icu/config.yml new file mode 100644 index 0000000000000..14241e230efc1 --- /dev/null +++ b/recipes/icu/config.yml @@ -0,0 +1,13 @@ +versions: + "73.1": + folder: all + "72.1": + folder: all + "71.1": + folder: all + "70.1": + folder: all + "69.1": + folder: all + "68.2": + folder: all diff --git a/recipes/ignition-cmake/all/CMakeLists.txt b/recipes/ignition-cmake/all/CMakeLists.txt new file mode 100644 index 0000000000000..8d6da516c42c7 --- /dev/null +++ b/recipes/ignition-cmake/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/ignition-cmake/all/conandata.yml b/recipes/ignition-cmake/all/conandata.yml new file mode 100644 index 0000000000000..91e85702d37b5 --- /dev/null +++ b/recipes/ignition-cmake/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "2.5.0": + url: "https://github.com/gazebosim/gz-cmake/archive/ignition-cmake2_2.5.0.zip" + sha256: "30945958fbe598f654d30de926a798f9055b1c635f7d85441ecba1ebe0804d2d" + "2.10.0": + url: "https://github.com/gazebosim/gz-cmake/archive/refs/tags/ignition-cmake2_2.10.0.tar.gz" + sha256: "48a01131731b09c32cfc7d577c4db378fb02e49a071e24c9299624766e1d05a2" + +patches: + "2.5.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-cmake-fixes.patch" + "2.10.0": + - base_path: "source_subfolder" + patch_file: "patches/0002-ignition-cmake-2.10.0-fixes.patch" diff --git a/recipes/ignition-cmake/all/conanfile.py b/recipes/ignition-cmake/all/conanfile.py new file mode 100644 index 0000000000000..f09f2bd8badbc --- /dev/null +++ b/recipes/ignition-cmake/all/conanfile.py @@ -0,0 +1,115 @@ +from conans import CMake, ConanFile, tools, RunEnvironment +import conan.tools.files +import os +import textwrap + + +class IgnitionCmakeConan(ConanFile): + name = "ignition-cmake" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gazebosim/gz-cmake" + description = "A set of CMake modules that are used by the C++-based Ignition projects." + topics = ("ignition", "robotics", "cmake") + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + exports_sources = "CMakeLists.txt", "patches/**" + + _cmake = None + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def _configure_cmake(self): + if self._cmake is not None: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["CMAKE_INSTALL_DATAROOTDIR"] = "lib" + self._cmake.definitions["SKIP_component_name"] = False + self._cmake.configure(source_folder=self._source_subfolder) + return self._cmake + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + version_major = tools.Version(self.version).major + env_build = RunEnvironment(self) + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + version_major = tools.Version(self.version).major + cmake_config_files_dir = os.path.join(self.package_folder, "lib", "cmake",f"ignition-cmake{version_major}") + files = os.listdir(cmake_config_files_dir) + + # retain the special config file for utilities target provided by ignition-cmake + # removing it from the list + files.remove(f"ignition-cmake{version_major}-utilities-targets.cmake") + + # remove all other xxx.cmake files from the list + for file in files: + if file.endswith(".cmake"): + os.remove(os.path.join(cmake_config_files_dir, file)) + + # add version information for downstream dependencies consuming ign-cmake through cmake_find_package generators + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path), + tools.Version(self.version) + ) + + @staticmethod + def _create_cmake_module_variables(module_file, version): + # the version info is needed by downstream ignition-dependencies + content = textwrap.dedent("""\ + set(ignition-cmake{major}_VERSION_MAJOR {major}) + set(ignition-cmake{major}_VERSION_MINOR {minor}) + set(ignition-cmake{major}_VERSION_PATCH {patch}) + set(ignition-cmake{major}_VERSION_STRING "{major}.{minor}.{patch}") + """.format(major=version.major, minor=version.minor, patch=version.patch)) + tools.save(module_file, content) + + def package_info(self): + version_major = tools.Version(self.version).major + ign_cmake_component = f"ignition-cmake{version_major}" + base_module_path = os.path.join(self.package_folder, "lib", "cmake", ign_cmake_component) + ign_cmake_file = os.path.join(base_module_path, f"cmake{version_major}", "IgnCMake.cmake") + utils_targets_file = os.path.join(base_module_path, f"{ign_cmake_component}-utilities-targets.cmake") + + self.cpp_info.names["cmake_find_package"] = ign_cmake_component + self.cpp_info.names["cmake_find_package_multi"] = ign_cmake_component + self.cpp_info.names["cmake_paths"] = ign_cmake_component + + self.cpp_info.components[ign_cmake_component].names["cmake_find_package"] = ign_cmake_component + self.cpp_info.components[ign_cmake_component].names["cmake_find_package_multi"] = ign_cmake_component + self.cpp_info.components[ign_cmake_component].names["cmake_paths"] = ign_cmake_component + self.cpp_info.components[ign_cmake_component].builddirs.append(os.path.join(base_module_path, f"cmake{version_major}")) + + self.cpp_info.components[ign_cmake_component].build_modules["cmake_find_package"] = [self._module_file_rel_path, ign_cmake_file] + self.cpp_info.components[ign_cmake_component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, ign_cmake_file] + self.cpp_info.components[ign_cmake_component].build_modules["cmake_paths"] = [self._module_file_rel_path, ign_cmake_file] + + self.cpp_info.components["utilities"].names["cmake_find_package"] = "utilities" + self.cpp_info.components["utilities"].names["cmake_find_package_multi"] = "utilities" + self.cpp_info.components["utilities"].names["cmake_paths"] = "utilities" + self.cpp_info.components["utilities"].includedirs.append(f"include/ignition/cmake{version_major}") + + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path, ign_cmake_file]) + self.cpp_info.components["utilities"].build_modules["cmake_find_package"] = [self._module_file_rel_path, ign_cmake_file, utils_targets_file] + self.cpp_info.components["utilities"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, ign_cmake_file, utils_targets_file] + self.cpp_info.components["utilities"].build_modules["cmake_paths"] = [self._module_file_rel_path, ign_cmake_file, utils_targets_file] diff --git a/recipes/ignition-cmake/all/patches/0001-cmake-fixes.patch b/recipes/ignition-cmake/all/patches/0001-cmake-fixes.patch new file mode 100644 index 0000000000000..c08ee665467ac --- /dev/null +++ b/recipes/ignition-cmake/all/patches/0001-cmake-fixes.patch @@ -0,0 +1,53 @@ +--- cmake/IgnCMake.cmake ++++ cmake/IgnCMake.cmake +@@ -36,3 +36,10 @@ include(IgnPkgConfig) + #============================================================================ + include(CMakePackageConfigHelpers) + include(CMakeParseArguments) ++ ++set(IGNITION_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") ++set(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../..") ++set(IGNITION_CMAKE_DOXYGEN_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/doxygen") ++set(IGNITION_CMAKE_CODECHECK_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/codecheck") ++set(IGNITION_CMAKE_BENCHMARK_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/benchmark") ++set(IGNITION_CMAKE_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/tools") +\ No newline at end of file + +--- cmake/IgnSetCompilerFlags.cmake ++++ cmake/IgnSetCompilerFlags.cmake +@@ -77,9 +77,9 @@ macro(ign_setup_unix) + exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL + "processor type (i386 and x86_64)") +- if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") +- set(IGN_ADD_fPIC_TO_LIBRARIES true) +- endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ #if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ # set(IGN_ADD_fPIC_TO_LIBRARIES true) ++ #endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + endif(CMAKE_UNAME) + + endmacro() +@@ -93,7 +93,9 @@ macro(ign_setup_apple) + # 10.x.x = Mac OSX Snow Leopard (10.6) + # 11.x.x = Mac OSX Lion (10.7) + # 12.x.x = Mac OSX Mountain Lion (10.8) +- if(${CMAKE_SYSTEM_VERSION} LESS 10) ++ if(NOT CMAKE_SYSTEM_VERSION) ++ return() ++ elseif(${CMAKE_SYSTEM_VERSION} LESS 10) + add_definitions(-DMAC_OS_X_VERSION=1050) + elseif(${CMAKE_SYSTEM_VERSION} GREATER 10 AND ${CMAKE_SYSTEM_VERSION} LESS 11) + add_definitions(-DMAC_OS_X_VERSION=1060) + +--- cmake/IgnUtils.cmake ++++ cmake/IgnUtils.cmake +@@ -1372,7 +1372,7 @@ macro(_ign_add_library_or_component) + # Generate export macro headers + # Note: INTERFACE libraries do not need the export header + set(binary_include_dir +- "${CMAKE_BINARY_DIR}/include/${include_dir}") ++ "${PROJECT_BINARY_DIR}/include/${include_dir}") + + set(implementation_file_name "${binary_include_dir}/detail/Export.hh") + diff --git a/recipes/ignition-cmake/all/patches/0002-ignition-cmake-2.10.0-fixes.patch b/recipes/ignition-cmake/all/patches/0002-ignition-cmake-2.10.0-fixes.patch new file mode 100644 index 0000000000000..1294ad7a56c4b --- /dev/null +++ b/recipes/ignition-cmake/all/patches/0002-ignition-cmake-2.10.0-fixes.patch @@ -0,0 +1,53 @@ +--- cmake/IgnCMake.cmake ++++ cmake/IgnCMake.cmake +@@ -36,3 +36,10 @@ include(IgnPkgConfig) + #============================================================================ + include(CMakePackageConfigHelpers) + include(CMakeParseArguments) ++ ++set(IGNITION_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") ++set(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../..") ++set(IGNITION_CMAKE_DOXYGEN_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/doxygen") ++set(IGNITION_CMAKE_CODECHECK_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/codecheck") ++set(IGNITION_CMAKE_BENCHMARK_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/benchmark") ++set(IGNITION_CMAKE_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/tools") +\ No newline at end of file + +--- cmake/IgnSetCompilerFlags.cmake ++++ cmake/IgnSetCompilerFlags.cmake +@@ -77,9 +77,9 @@ macro(ign_setup_unix) + exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL + "processor type (i386 and x86_64)") +- if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") +- set(IGN_ADD_fPIC_TO_LIBRARIES true) +- endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ #if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ # set(IGN_ADD_fPIC_TO_LIBRARIES true) ++ #endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + endif(CMAKE_UNAME) + + endmacro() +@@ -93,7 +93,9 @@ macro(ign_setup_apple) + # 10.x.x = Mac OSX Snow Leopard (10.6) + # 11.x.x = Mac OSX Lion (10.7) + # 12.x.x = Mac OSX Mountain Lion (10.8) +- if(${CMAKE_SYSTEM_VERSION} LESS 10) ++ if(NOT CMAKE_SYSTEM_VERSION) ++ return() ++ elseif(${CMAKE_SYSTEM_VERSION} LESS 10) + add_definitions(-DMAC_OS_X_VERSION=1050) + elseif(${CMAKE_SYSTEM_VERSION} GREATER 10 AND ${CMAKE_SYSTEM_VERSION} LESS 11) + add_definitions(-DMAC_OS_X_VERSION=1060) + +--- cmake/IgnUtils.cmake ++++ cmake/IgnUtils.cmake +@@ -1396,7 +1396,7 @@ macro(_ign_add_library_or_component) + # Generate export macro headers + # Note: INTERFACE libraries do not need the export header + set(binary_include_dir +- "${CMAKE_BINARY_DIR}/include/${include_dir}") ++ "${PROJECT_BINARY_DIR}/include/${include_dir}") + + set(implementation_file_name "${binary_include_dir}/detail/Export.hh") + diff --git a/recipes/ignition-cmake/all/test_package/CMakeLists.txt b/recipes/ignition-cmake/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9595663869a7f --- /dev/null +++ b/recipes/ignition-cmake/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10.2) +project(test_package VERSION 1.0) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(IGN_CMAKE_VER "" CACHE STRING "Version of igition-cmake") + +if(NOT IGN_CMAKE_VER) + message(FATAL_ERROR "IGN_CMAKE_VER not set") +endif() + +find_package(ignition-cmake${IGN_CMAKE_VER} REQUIRED COMPONENTS utilities) + +ign_configure_project() +ign_configure_build() diff --git a/recipes/ignition-cmake/all/test_package/conanfile.py b/recipes/ignition-cmake/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5b49fe0a15144 --- /dev/null +++ b/recipes/ignition-cmake/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +import os + +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + test_type = "explicit" + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.definitions["IGN_CMAKE_VER"] = tools.Version(self.deps_cpp_info["ignition-cmake"].version).major + 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/ignition-cmake/all/test_package/src/CMakeLists.txt b/recipes/ignition-cmake/all/test_package/src/CMakeLists.txt new file mode 100644 index 0000000000000..e050db890afd7 --- /dev/null +++ b/recipes/ignition-cmake/all/test_package/src/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +ign_add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ignition-cmake${IGN_CMAKE_VER}::utilities) diff --git a/recipes/ignition-cmake/all/test_package/src/test_package.cpp b/recipes/ignition-cmake/all/test_package/src/test_package.cpp new file mode 100644 index 0000000000000..e46519ac61f93 --- /dev/null +++ b/recipes/ignition-cmake/all/test_package/src/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + std::cout << "Hello world!\n"; + return 0; +} diff --git a/recipes/ignition-cmake/config.yml b/recipes/ignition-cmake/config.yml new file mode 100644 index 0000000000000..90aed98c5dd74 --- /dev/null +++ b/recipes/ignition-cmake/config.yml @@ -0,0 +1,5 @@ +versions: + "2.5.0": + folder: all + "2.10.0": + folder: all diff --git a/recipes/ignition-math/all/CMakeLists.txt b/recipes/ignition-math/all/CMakeLists.txt new file mode 100644 index 0000000000000..4c95ca5e84716 --- /dev/null +++ b/recipes/ignition-math/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/ignition-math/all/conandata.yml b/recipes/ignition-math/all/conandata.yml new file mode 100644 index 0000000000000..ba2f8a5f8591e --- /dev/null +++ b/recipes/ignition-math/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "6.7.0": + url: "https://github.com/gazebosim/gz-math/archive/ignition-math6_6.7.0.tar.gz" + sha256: "e5dac5aca6a117af8bd07ebca6e4ec8255682453487bf8d706bdb0315d17d6af" + "6.10.0": + url: "https://github.com/gazebosim/gz-math/archive/ignition-math6_6.10.0.tar.gz" + sha256: "94e853e1dfba97ebec4b6152691a89af1e94660b02f4ecdf04356b763c2848bd" +patches: + "6.7.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-ign-math-6.7.0-cmake-fixes.patch" + "6.10.0": + - base_path: "source_subfolder" + patch_file: "patches/0002-ign-math-6.10.0-cmake-fixes.patch" diff --git a/recipes/ignition-math/all/conanfile.py b/recipes/ignition-math/all/conanfile.py new file mode 100644 index 0000000000000..3af2ddca7b420 --- /dev/null +++ b/recipes/ignition-math/all/conanfile.py @@ -0,0 +1,165 @@ +import os +import conan.tools.files +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import textwrap + +required_conan_version = ">=1.29.1" + + +class IgnitionMathConan(ConanFile): + name = "ignition-math" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gazebosim.org/libs/math" + description = " Math classes and functions for robot applications" + topics = ("ignition", "math", "robotics", "gazebo") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "cmake", "cmake_find_package_multi" + exports_sources = "CMakeLists.txt", "patches/**" + + _cmake = None + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + 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.settings.compiler.cppstd: + tools.check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if not min_version: + self.output.warn( + "{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler + ) + ) + else: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + "{} requires c++17 support. The current compiler {} {} does not support it.".format( + self.name, + self.settings.compiler, + self.settings.compiler.version, + ) + ) + + def requirements(self): + self.requires("eigen/3.3.9") + self.requires("doxygen/1.8.17") + self.requires("swig/4.0.2") + + def build_requirements(self): + if int(tools.Version(self.version).minor) <= 8: + self.build_requires("ignition-cmake/2.5.0") + else: + self.build_requires("ignition-cmake/2.10.0") + + 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["BUILD_TESTING"] = False + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path), + tools.Version(self.version)) + + # Remove MS runtime files + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), dll_pattern_to_remove) + + @staticmethod + def _create_cmake_module_variables(module_file, version): + content = textwrap.dedent("""\ + set(ignition-math{major}_VERSION_MAJOR {major}) + set(ignition-math{major}_VERSION_MINOR {minor}) + set(ignition-math{major}_VERSION_PATCH {patch}) + set(ignition-math{major}_VERSION_STRING "{major}.{minor}.{patch}") + set(ignition-math{major}_INCLUDE_DIRS "${{CMAKE_CURRENT_LIST_DIR}}/../../include/ignition/math{major}") + """.format(major=version.major, minor=version.minor, patch=version.patch)) + tools.save(module_file, content) + + + def package_info(self): + version_major = tools.Version(self.version).major + lib_name = f"ignition-math{version_major}" + + self.cpp_info.names["cmake_find_package"] = lib_name + self.cpp_info.names["cmake_find_package_multi"] = lib_name + self.cpp_info.names["cmake_paths"] = lib_name + + self.cpp_info.components[lib_name].names["cmake_find_package"] = lib_name + self.cpp_info.components[lib_name].names["cmake_find_package_multi"] = lib_name + self.cpp_info.components[lib_name].names["cmake_paths"] = lib_name + self.cpp_info.components[lib_name].libs = [lib_name] + self.cpp_info.components[lib_name].includedirs.append(os.path.join("include", "ignition", "math"+version_major)) + self.cpp_info.components[lib_name].requires = ["swig::swig", "eigen::eigen", "doxygen::doxygen"] + + self.cpp_info.components[lib_name].builddirs = [self._module_file_rel_dir] + self.cpp_info.components[lib_name].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[lib_name].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components[lib_name].build_modules["cmake_paths"] = [self._module_file_rel_path] + + self.cpp_info.components["eigen3"].names["cmake_find_package"] = "eigen3" + self.cpp_info.components["eigen3"].names["cmake_find_package_multi"] = "eigen3" + self.cpp_info.components["eigen3"].names["cmake_paths"] = "eigen3" + self.cpp_info.components["eigen3"].includedirs.append(os.path.join("include", "ignition", "math"+version_major)) + self.cpp_info.components["eigen3"].requires = ["eigen::eigen"] + + self.cpp_info.components["eigen3"].builddirs = [self._module_file_rel_dir] + self.cpp_info.components["eigen3"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["eigen3"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["eigen3"].build_modules["cmake_paths"] = [self._module_file_rel_path] + + def validate(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("sorry, M1 builds are not currently supported, give up!") + + @property + def _module_file_rel_dir(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_file_rel_dir, f"conan-official-{self.name}-variables.cmake") + diff --git a/recipes/ignition-math/all/patches/0001-ign-math-6.7.0-cmake-fixes.patch b/recipes/ignition-math/all/patches/0001-ign-math-6.7.0-cmake-fixes.patch new file mode 100644 index 0000000000000..d20c1234623ee --- /dev/null +++ b/recipes/ignition-math/all/patches/0001-ign-math-6.7.0-cmake-fixes.patch @@ -0,0 +1,64 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -39,7 +39,7 @@ ign_find_package( + ######################################## + # Include swig + find_package(SWIG QUIET) +-if (NOT SWIG_FOUND) ++if (1) + IGN_BUILD_WARNING("Swig is missing: Language interfaces are disabled.") + message (STATUS "Searching for swig - not found.") + else() +@@ -47,7 +47,7 @@ else() + endif() + + # Include other languages if swig was found +-if (SWIG_FOUND) ++if (0) + ######################################## + # Include ruby + find_package(Ruby 1.9 QUIET) +@@ -74,9 +74,9 @@ ign_create_packages() + #============================================================================ + # Configure documentation + #============================================================================ +-configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md) +-configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md) ++configure_file(${PROJECT_SOURCE_DIR}/api.md.in ${PROJECT_BINARY_DIR}/api.md) ++configure_file(${PROJECT_SOURCE_DIR}/tutorials.md.in ${PROJECT_BINARY_DIR}/tutorials.md) + + ign_create_docs( +- API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md" +- TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md") ++ API_MAINPAGE_MD "${PROJECT_BINARY_DIR}/api.md" ++ TUTORIALS_MAINPAGE_MD "${PROJECT_BINARY_DIR}/tutorials.md") + +--- include/ignition/math/Helpers.hh ++++ include/ignition/math/Helpers.hh +@@ -870,7 +870,7 @@ namespace ignition + // The following regex takes a time string in the general format of + // "dd hh:mm:ss.nnn" where n is milliseconds, if just one number is + // provided, it is assumed to be seconds +- static const std::regex time_regex( ++ static const char* time_regex_str = + "^([0-9]+ ){0,1}" // day: + // Any positive integer + +@@ -887,7 +887,7 @@ namespace ignition + // 0 - 9 + // 00 - 59 + +- "(\\.[0-9]{1,3}){0,1})$"); // millisecond: ++ "(\\.[0-9]{1,3}){0,1})$"; // millisecond: + // .0 - .9 + // .00 - .99 + // .000 - 0.999 +@@ -907,6 +907,7 @@ namespace ignition + uint64_t & numberMinutes, uint64_t & numberSeconds, + uint64_t & numberMilliseconds) + { ++ static const std::regex time_regex(time_regex_str); + std::smatch matches; + + // `matches` should always be a size of 6 as there are 6 matching + diff --git a/recipes/ignition-math/all/patches/0002-ign-math-6.10.0-cmake-fixes.patch b/recipes/ignition-math/all/patches/0002-ign-math-6.10.0-cmake-fixes.patch new file mode 100644 index 0000000000000..8773ec682ea55 --- /dev/null +++ b/recipes/ignition-math/all/patches/0002-ign-math-6.10.0-cmake-fixes.patch @@ -0,0 +1,35 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -49,7 +49,7 @@ ign_find_package( + ######################################## + # Include swig + find_package(SWIG QUIET) +-if (NOT SWIG_FOUND) ++if (1) + IGN_BUILD_WARNING("Swig is missing: Language interfaces are disabled.") + message (STATUS "Searching for swig - not found.") + else() +@@ -57,7 +57,7 @@ else() + endif() + + # Include other languages if swig was found +-if (SWIG_FOUND) ++if (0) + ######################################## + # Include ruby + find_package(Ruby 1.9 QUIET) +@@ -109,9 +109,9 @@ ign_create_packages() + #============================================================================ + # Configure documentation + #============================================================================ +-configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md) +-configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md) ++configure_file(${PROJECT_SOURCE_DIR}/api.md.in ${PROJECT_BINARY_DIR}/api.md) ++configure_file(${PROJECT_SOURCE_DIR}/tutorials.md.in ${PROJECT_BINARY_DIR}/tutorials.md) + + ign_create_docs( +- API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md" +- TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md") ++ API_MAINPAGE_MD "${PROJECT_BINARY_DIR}/api.md" ++ TUTORIALS_MAINPAGE_MD "${PROJECT_BINARY_DIR}/tutorials.md") + diff --git a/recipes/ignition-math/all/test_package/CMakeLists.txt b/recipes/ignition-math/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afd28de5fd4f9 --- /dev/null +++ b/recipes/ignition-math/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(IGN_MATH_MAJOR_VER "" CACHE STRING "Version of igition-math") + +if(NOT IGN_MATH_MAJOR_VER) + message(FATAL_ERROR "IGN_MAJOR_MAJOR_VER not set") +endif() + +find_package(ignition-math${IGN_MATH_MAJOR_VER} REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ignition-math${IGN_MATH_MAJOR_VER}::ignition-math${IGN_MATH_MAJOR_VER}) +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ON +) diff --git a/recipes/ignition-math/all/test_package/conanfile.py b/recipes/ignition-math/all/test_package/conanfile.py new file mode 100644 index 0000000000000..315a95800ba91 --- /dev/null +++ b/recipes/ignition-math/all/test_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.definitions["IGN_MATH_MAJOR_VER"] = tools.Version(self.deps_cpp_info["ignition-math"].version).major + 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/ignition-math/all/test_package/test_package.cpp b/recipes/ignition-math/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e12402d7867df --- /dev/null +++ b/recipes/ignition-math/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ + +/** + * @file test_package.cpp + * @author ggulglia(gajendra.gulgulia@gmail.com) + * @brief test examples to verify that conan recipe for ignition-math + * can be consumed + */ + +#include +#include +#include + +int main(int argc, char** argv) +{ + std::cout << "hello world from ignition-math test_package\n"; + + ignition::math::Vector3d point1{1, 3, 5}; + ignition::math::Vector3d point2{2, 4, 6}; + + double distance = point1.Distance(point2); + std::cout << "Distance from (" << point1 << ") to " + << point2 << " is " << distance << std::endl; +} diff --git a/recipes/ignition-math/config.yml b/recipes/ignition-math/config.yml new file mode 100644 index 0000000000000..14ea09e27cafc --- /dev/null +++ b/recipes/ignition-math/config.yml @@ -0,0 +1,5 @@ +versions: + "6.7.0": + folder: all + "6.10.0": + folder: all diff --git a/recipes/ignition-tools/all/CMakeLists.txt b/recipes/ignition-tools/all/CMakeLists.txt new file mode 100644 index 0000000000000..f980aea13cc6d --- /dev/null +++ b/recipes/ignition-tools/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.10.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory(source_subfolder) diff --git a/recipes/ignition-tools/all/conandata.yml b/recipes/ignition-tools/all/conandata.yml new file mode 100644 index 0000000000000..8a58ba77dc143 --- /dev/null +++ b/recipes/ignition-tools/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.4.0": + url: "https://github.com/ignitionrobotics/ign-tools/archive/refs/tags/ignition-tools_1.4.0.tar.gz" + sha256: "fa3f7984ebb8f412133ea93368395adce426ae36c715a9f94f9509af7dac3b03" +patches: + "1.4.0": + - base_path: "source_subfolder" + patch_file: "patches/0003-ign-tools-1.4.0-cmake-fixes.patch" diff --git a/recipes/ignition-tools/all/conanfile.py b/recipes/ignition-tools/all/conanfile.py new file mode 100644 index 0000000000000..ba8d22e6561de --- /dev/null +++ b/recipes/ignition-tools/all/conanfile.py @@ -0,0 +1,105 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.29.1" + + +class IgnitionToolsConan(ConanFile): + name = "ignition-tools" + license = "Apache-2.0" + homepage = "https://ignitionrobotics.org/libs/tools" + url = "https://github.com/conan-io/conan-center-index" + description = "Provides general purpose classes and functions designed for robotic applications.." + topics = ("ignition", "robotics", "tools") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "cmake", "cmake_find_package_multi" + exports_sources = "CMakeLists.txt", "patches/**" + _cmake = None + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if not min_version: + self.output.warn( + "{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler + ) + ) + else: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + "{} requires c++17 support. The current compiler {} {} does not support it.".format( + self.name, + self.settings.compiler, + self.settings.compiler.version, + ) + ) + + def source(self): + tools.get(**self.conan_data["sources"][self.version],destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake is not None: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + # Remove MS runtime files + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), dll_pattern_to_remove) + + def package_info(self): + version_major = tools.Version(self.version).major + self.cpp_info.names["cmake_find_package"] = "ignition-tools{}".format(version_major) + self.cpp_info.names["cmake_find_package_multi"] = "ignition-tools{}".format(version_major) + + self.cpp_info.components["libignition-tools"].libs = ["ignition-tools-backward"] + self.cpp_info.components["libignition-tools"].includedirs.append("include/ignition/tools{}".format(version_major)) + self.cpp_info.components["libignition-tools"].names["cmake_find_package"] = "ignition-tools{}".format(version_major) + self.cpp_info.components["libignition-tools"].names["cmake_find_package_multi"] = "ignition-tools{}".format(version_major) + self.cpp_info.components["libignition-tools"].names["pkg_config"] = "ignition-tools{}".format(version_major) diff --git a/recipes/ignition-tools/all/patches/0001-ign-tools-1.0.0-cmake-fixes.patch b/recipes/ignition-tools/all/patches/0001-ign-tools-1.0.0-cmake-fixes.patch new file mode 100644 index 0000000000000..a02000ed7c157 --- /dev/null +++ b/recipes/ignition-tools/all/patches/0001-ign-tools-1.0.0-cmake-fixes.patch @@ -0,0 +1,25 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -251,7 +251,7 @@ else (build_errors) + ######################################## + # Make the package config files + configure_file( +- ${CMAKE_SOURCE_DIR}/cmake/pkgconfig/ignition.in ++ ${PROJECT_SOURCE_DIR}/cmake/pkgconfig/ignition.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${PROJECT_NAME_LOWER}.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${PROJECT_NAME_LOWER}.pc + DESTINATION ${LIB_INSTALL_DIR}/pkgconfig + +--- doc/CMakeLists.txt ++++ doc/CMakeLists.txt +@@ -1,8 +1,8 @@ + find_package(Doxygen) + + if (DOXYGEN_FOUND) +- configure_file(${CMAKE_SOURCE_DIR}/doc/ignition.in +- ${CMAKE_BINARY_DIR}/ignition.dox @ONLY) ++ configure_file(${PROJECT_SOURCE_DIR}/doc/ignition.in ++ ${PROJECT_BINARY_DIR}/ignition.dox @ONLY) + + add_custom_target(doc + diff --git a/recipes/ignition-tools/all/patches/0002-ign-tools-1.2.0-cmake-fixes.patch b/recipes/ignition-tools/all/patches/0002-ign-tools-1.2.0-cmake-fixes.patch new file mode 100644 index 0000000000000..301608c99c533 --- /dev/null +++ b/recipes/ignition-tools/all/patches/0002-ign-tools-1.2.0-cmake-fixes.patch @@ -0,0 +1,25 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -257,7 +257,7 @@ else (build_errors) + "${CMAKE_INSTALL_PREFIX}" + ) + configure_file( +- ${CMAKE_SOURCE_DIR}/cmake/pkgconfig/ignition.in ++ ${PROJECT_SOURCE_DIR}/cmake/pkgconfig/ignition.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${PROJECT_NAME_LOWER}.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${PROJECT_NAME_LOWER}.pc + DESTINATION ${PC_CONFIG_INSTALL_DIR} + +--- doc/CMakeLists.txt ++++ doc/CMakeLists.txt +@@ -1,8 +1,8 @@ + find_package(Doxygen) + + if (DOXYGEN_FOUND) +- configure_file(${CMAKE_SOURCE_DIR}/doc/ignition.in +- ${CMAKE_BINARY_DIR}/ignition.dox @ONLY) ++ configure_file(${PROJECT_SOURCE_DIR}/doc/ignition.in ++ ${PROJECT_BINARY_DIR}/ignition.dox @ONLY) + + add_custom_target(doc + diff --git a/recipes/ignition-tools/all/patches/0003-ign-tools-1.4.0-cmake-fixes.patch b/recipes/ignition-tools/all/patches/0003-ign-tools-1.4.0-cmake-fixes.patch new file mode 100644 index 0000000000000..3e856a0a90956 --- /dev/null +++ b/recipes/ignition-tools/all/patches/0003-ign-tools-1.4.0-cmake-fixes.patch @@ -0,0 +1,25 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -185,7 +185,7 @@ else (build_errors) + "${CMAKE_INSTALL_PREFIX}" + ) + configure_file( +- ${CMAKE_SOURCE_DIR}/cmake/pkgconfig/ignition.in ++ ${PROJECT_SOURCE_DIR}/cmake/pkgconfig/ignition.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${PROJECT_NAME_LOWER}.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${PROJECT_NAME_LOWER}.pc + DESTINATION ${PC_CONFIG_INSTALL_DIR} + +--- doc/CMakeLists.txt ++++ doc/CMakeLists.txt +@@ -1,8 +1,8 @@ + find_package(Doxygen) + + if (DOXYGEN_FOUND) +- configure_file(${CMAKE_SOURCE_DIR}/doc/ignition.in +- ${CMAKE_BINARY_DIR}/ignition.dox @ONLY) ++ configure_file(${PROJECT_SOURCE_DIR}/doc/ignition.in ++ ${PROJECT_BINARY_DIR}/ignition.dox @ONLY) + + add_custom_target(doc + diff --git a/recipes/ignition-tools/all/test_package/CMakeLists.txt b/recipes/ignition-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..294e2c5ebc47c --- /dev/null +++ b/recipes/ignition-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(IGN_TOOLS_MAJOR_VER "" CACHE STRING "Version of igition-tools") + +if(NOT IGN_TOOLS_MAJOR_VER) + message(FATAL_ERROR "IGN_MAJOR_MAJOR_VER not set") +endif() + +find_package(ignition-tools${IGN_TOOLS_MAJOR_VER} REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ignition-tools${IGN_TOOLS_MAJOR_VER}::ignition-tools${IGN_TOOLS_MAJOR_VER}) +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ON +) diff --git a/recipes/ignition-tools/all/test_package/conanfile.py b/recipes/ignition-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ad00162038ccc --- /dev/null +++ b/recipes/ignition-tools/all/test_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.definitions["IGN_TOOLS_MAJOR_VER"] = tools.Version(self.deps_cpp_info["ignition-tools"].version).major + 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/ignition-tools/all/test_package/test_package.cpp b/recipes/ignition-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..262e67cc01fba --- /dev/null +++ b/recipes/ignition-tools/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + + +int main(int argc, char **argv) +{ + std::cout << "Hello from ignition-tools test_package\n"; +} diff --git a/recipes/ignition-tools/config.yml b/recipes/ignition-tools/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/ignition-tools/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/ignition-utils/all/CMakeLists.txt b/recipes/ignition-utils/all/CMakeLists.txt new file mode 100644 index 0000000000000..df60a2f8782db --- /dev/null +++ b/recipes/ignition-utils/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/ignition-utils/all/conandata.yml b/recipes/ignition-utils/all/conandata.yml new file mode 100644 index 0000000000000..5ab6a4db54d3c --- /dev/null +++ b/recipes/ignition-utils/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.3.0": + url: "https://github.com/gazebosim/gz-utils/archive/refs/tags/ignition-utils1_1.3.0.tar.gz" + sha256: "062bfbbdc185e1dacc4ffd9e70572fc01e32d11782e991ae027541ee02858e92" + +patches: + "1.3.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-ign-utils-1.3.0-cmake-fixes.patch" diff --git a/recipes/ignition-utils/all/conanfile.py b/recipes/ignition-utils/all/conanfile.py new file mode 100644 index 0000000000000..0086df1bf32b9 --- /dev/null +++ b/recipes/ignition-utils/all/conanfile.py @@ -0,0 +1,175 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import conan.tools.files +import textwrap + +required_conan_version = ">=1.29.1" + + +class IgnitionUitlsConan(ConanFile): + name = "ignition-utils" + license = "Apache-2.0" + homepage = "https://gazebosim.org/libs/utils" + url = "https://github.com/conan-io/conan-center-index" + description = "Provides general purpose classes and functions designed for robotic applications.." + topics = ("ignition", "robotics", "utils") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False], + "ign_utils_vendor_cli11": [True, False] + } + default_options = {"shared": False, + "fPIC": True, + "ign_utils_vendor_cli11": True + } + generators = "cmake", "cmake_find_package_multi" + exports_sources = "CMakeLists.txt", "patches/**" + _cmake = None + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("sorry, M1 builds are not currently supported, give up!") + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if not min_version: + self.output.warn( + "{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler + ) + ) + else: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + "{} requires c++17 support. The current compiler {} {} does not support it.".format( + self.name, + self.settings.compiler, + self.settings.compiler.version, + ) + ) + + def requirements(self): + self.requires("doxygen/1.9.2") + if self.options.ign_utils_vendor_cli11: + self.requires("cli11/2.1.2") + + def build_requirements(self): + self.build_requires("ignition-cmake/2.10.0") + + 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 is not None: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.definitions["IGN_UTILS_VENDOR_CLI11"] = self.options.ign_utils_vendor_cli11 + self._cmake.definitions["CMAKE_FIND_DEBUG_MODE"] = "1" + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cli_header_src = os.path.join(self._source_subfolder, "cli", "include") + if int(tools.Version(self.version).minor) == 0: + cli_header_src = os.path.join(cli_header_src, "ignition", "utils", "cli") + else: + cli_header_src = os.path.join(cli_header_src, "external-cli", "ignition", "utils", "cli") + self.copy("*.hpp", src=cli_header_src, + dst="include/ignition/utils1/ignition/utils/cli") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + # Remove MS runtime files + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), dll_pattern_to_remove) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path), + tools.Version(self.version) + ) + + @staticmethod + def _create_cmake_module_variables(module_file, version): + content = textwrap.dedent("""\ + set(ignition-utils{major}_VERSION_MAJOR {major}) + set(ignition-utils{major}_VERSION_MINOR {minor}) + set(ignition-utils{major}_VERSION_PATCH {patch}) + set(ignition-utils{major}_VERSION_STRING "{major}.{minor}.{patch}") + """.format(major=version.major, minor=version.minor, patch=version.patch)) + tools.save(module_file, content) + + def package_info(self): + version_major = tools.Version(self.version).major + lib_name = f"ignition-utils{version_major}" + build_dirs = os.path.join(self.package_folder, "lib", "cmake") + include_dir = os.path.join("include", "ignition", "utils"+version_major) + self.cpp_info.names["cmake_find_package"] = lib_name + self.cpp_info.names["cmake_find_package_multi"] = lib_name + self.cpp_info.names["cmake_paths"] = lib_name + + self.cpp_info.components[lib_name].names["cmake_find_package"] = lib_name + self.cpp_info.components[lib_name].names["cmake_find_package_multi"] = lib_name + self.cpp_info.components[lib_name].names["cmake_paths"] = lib_name + self.cpp_info.components[lib_name].libs = [lib_name] + self.cpp_info.components[lib_name].includedirs.append(include_dir) + self.cpp_info.components[lib_name].requires = ["doxygen::doxygen"] + if self.options.ign_utils_vendor_cli11: + self.cpp_info.components[lib_name].requires.append("cli11::cli11") + + self.cpp_info.components[lib_name].builddirs.append(build_dirs) + self.cpp_info.components[lib_name].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[lib_name].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components[lib_name].build_modules["cmake_paths"] = [self._module_file_rel_path] + + self.cpp_info.components["cli"].names["cmake_find_package"] = "cli" + self.cpp_info.components["cli"].names["cmake_find_package_multi"] = "cli" + self.cpp_info.components["cli"].names["cmake_paths"] = "cli" + self.cpp_info.components["cli"].includedirs.append(os.path.join(include_dir, "ignition", "utils")) + if self.options.ign_utils_vendor_cli11: + self.cpp_info.components["cli"].requires = ["cli11::cli11"] + + self.cpp_info.components["cli"].builddirs.append(build_dirs) + self.cpp_info.components["cli"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["cli"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["cli"].build_modules["cmake_paths"] = [self._module_file_rel_path] + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") diff --git a/recipes/ignition-utils/all/patches/0001-ign-utils-1.3.0-cmake-fixes.patch b/recipes/ignition-utils/all/patches/0001-ign-utils-1.3.0-cmake-fixes.patch new file mode 100644 index 0000000000000..ee8c623c903c5 --- /dev/null +++ b/recipes/ignition-utils/all/patches/0001-ign-utils-1.3.0-cmake-fixes.patch @@ -0,0 +1,17 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -50,9 +50,9 @@ ign_create_packages() + #============================================================================ + # Configure documentation + #============================================================================ +-configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md) +-configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md) ++configure_file(${PROJECT_SOURCE_DIR}/api.md.in ${PROJECT_BINARY_DIR}/api.md) ++configure_file(${PROJECT_SOURCE_DIR}/tutorials.md.in ${PROJECT_BINARY_DIR}/tutorials.md) + + ign_create_docs( +- API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md" +- TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md") ++ API_MAINPAGE_MD "${PROJECT_BINARY_DIR}/api.md" ++ TUTORIALS_MAINPAGE_MD "${PROJECT_BINARY_DIR}/tutorials.md") + diff --git a/recipes/ignition-utils/all/test_package/CMakeLists.txt b/recipes/ignition-utils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..36dc2a4e5fc15 --- /dev/null +++ b/recipes/ignition-utils/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10.0) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(IGN_UTILS_MAJOR_VER "" CACHE STRING "Version of igition-utils") + +if(NOT IGN_UTILS_MAJOR_VER) + message(FATAL_ERROR "IGN_UTILS_MAJOR_VER not set") +endif() + +find_package(ignition-cmake2 REQUIRED) +find_package(ignition-utils${IGN_UTILS_MAJOR_VER} REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ignition-utils${IGN_UTILS_MAJOR_VER}::ignition-utils${IGN_UTILS_MAJOR_VER}) +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ON +) diff --git a/recipes/ignition-utils/all/test_package/conanfile.py b/recipes/ignition-utils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..78990441f56be --- /dev/null +++ b/recipes/ignition-utils/all/test_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 requirements(self): + self.requires("ignition-cmake/2.10.0") + + def build(self): + cmake = CMake(self) + cmake.definitions["IGN_UTILS_MAJOR_VER"] = tools.Version(self.deps_cpp_info["ignition-utils"].version).major + 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/ignition-utils/all/test_package/test_package.cpp b/recipes/ignition-utils/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..918993e2bf116 --- /dev/null +++ b/recipes/ignition-utils/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +#include + + +int main(int argc, char** argv) +{ + std::cout << "Hello from ignition-utils test_package\n"; + CLI::App app{"Using ignition-utils CLI wrapper"}; + + app.add_flag_callback("-v,--version", [](){ + std::cout << IGNITION_UTILS_VERSION_FULL << std::endl; + throw CLI::Success(); + }); + + CLI11_PARSE(app, argc, argv); +} diff --git a/recipes/ignition-utils/config.yml b/recipes/ignition-utils/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/ignition-utils/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/iir1/all/conandata.yml b/recipes/iir1/all/conandata.yml new file mode 100644 index 0000000000000..dcf07a8d3050e --- /dev/null +++ b/recipes/iir1/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "1.9.1": + url: "https://github.com/berndporr/iir1/archive/refs/tags/1.9.1.tar.gz" + sha256: "97b4a7d62fa4859ac0d80283696b0d91c320b61ec2a455cdd3d8cfbb2be3ad9a" + "1.9.0": + url: "https://github.com/berndporr/iir1/archive/refs/tags/1.9.0.tar.gz" + sha256: "bf2c3cd819151d5b85e84cc8349c1aa9dd5e4157a7070bdd143130278b4375e8" +patches: + "1.9.1": + - patch_file: "patches/1.9.0-0001-no-export-static-win.patch" + patch_description: "Avoid to define __declspec(dllexport) on windows at consume time & in static lib" + patch_type: "portability" + sha256: "b29a0a2f4e6f76c57b7a8e4051173a0e82d7d154571377a0fbd75fd73e4fa73c" + - patch_file: "patches/1.9.0-0003-disable-test-demo.patch" + patch_description: "Do not build test & demo" + patch_type: "conan" + sha256: "5b866e0a6d536f12386ecc212c47a993b9e891584879fd507f8b86f596f97cdd" + "1.9.0": + - patch_file: "patches/1.9.0-0001-no-export-static-win.patch" + patch_description: "Avoid to define __declspec(dllexport) on windows at consume time & in static lib" + patch_type: "portability" + sha256: "b29a0a2f4e6f76c57b7a8e4051173a0e82d7d154571377a0fbd75fd73e4fa73c" + - patch_file: "patches/1.9.0-0002-Add-runtime-export-to-install.patch" + patch_description: "Install dll to bin folder" + patch_type: "portability" + sha256: "2f423eb1ee633a03c30d60f58a125f118cf9323402983c908708e7a6478e4bf6" + - patch_file: "patches/1.9.0-0003-disable-test-demo.patch" + patch_description: "Do not build test & demo" + patch_type: "conan" + sha256: "5b866e0a6d536f12386ecc212c47a993b9e891584879fd507f8b86f596f97cdd" diff --git a/recipes/iir1/all/conanfile.py b/recipes/iir1/all/conanfile.py new file mode 100644 index 0000000000000..26653fa6b385c --- /dev/null +++ b/recipes/iir1/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class Iir1Conan(ConanFile): + name = "iir1" + license = "MIT" + description = ( + "An infinite impulse response (IIR) filter library for Linux, Mac OSX " + "and Windows which implements Butterworth, RBJ, Chebychev filters and " + "can easily import coefficients generated by Python (scipy)." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/berndporr/iir1" + topics = ("dsp", "signals", "filtering") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "noexceptions": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "noexceptions": False, + } + + @property + def _min_cppstd(self): + return "11" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "1.9.1": + del self.options.noexceptions + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.options.get_safe("noexceptions"): + tc.preprocessor_definitions["IIR1_NO_EXCEPTIONS"] = "1" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.options.shared: + rm(self, "*iir_static.*", os.path.join(self.package_folder, "lib")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + rm(self, "*iir.*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + name = "iir" if self.options.shared else "iir_static" + self.cpp_info.set_property("cmake_file_name", "iir") + self.cpp_info.set_property("cmake_target_name", f"iir::{name}") + self.cpp_info.set_property("pkg_config_name", "iir") + # TODO: back to global scope in conan v2 + self.cpp_info.components["iir"].libs = [name] + if self.options.get_safe("noexceptions"): + self.cpp_info.components["iir"].defines.append("IIR1_NO_EXCEPTIONS") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["iir"].system_libs.append("m") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "iir" + self.cpp_info.names["cmake_find_package_multi"] = "iir" + self.cpp_info.components["iir"].names["cmake_find_package"] = name + self.cpp_info.components["iir"].names["cmake_find_package_multi"] = name + self.cpp_info.components["iir"].set_property("cmake_target_name", f"iir::{name}") diff --git a/recipes/iir1/all/patches/1.9.0-0001-no-export-static-win.patch b/recipes/iir1/all/patches/1.9.0-0001-no-export-static-win.patch new file mode 100644 index 0000000000000..d704a63ab7b58 --- /dev/null +++ b/recipes/iir1/all/patches/1.9.0-0001-no-export-static-win.patch @@ -0,0 +1,14 @@ +--- a/iir/Common.h ++++ b/iir/Common.h +@@ -46,7 +46,11 @@ + + // This exports the classes/structures to the windows DLL + #ifdef _WIN32 ++#ifdef iir_EXPORTS + #define DllExport __declspec( dllexport ) ++#else ++#define DllExport ++#endif + #define _CRT_SECURE_NO_WARNINGS + #else + #define DllExport diff --git a/recipes/iir1/all/patches/1.9.0-0002-Add-runtime-export-to-install.patch b/recipes/iir1/all/patches/1.9.0-0002-Add-runtime-export-to-install.patch new file mode 100644 index 0000000000000..e23ec48224959 --- /dev/null +++ b/recipes/iir1/all/patches/1.9.0-0002-Add-runtime-export-to-install.patch @@ -0,0 +1,24 @@ +From 2330dcc88711e4909da925c1278be2866980c071 Mon Sep 17 00:00:00 2001 +From: Wouter Zirkzee +Date: Thu, 25 Nov 2021 23:30:53 +0100 +Subject: [PATCH 2/2] Add runtime export to install + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 816a676..794aff8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,6 +68,7 @@ install(TARGETS iir EXPORT iir-targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/iir) + + configure_file(iir.pc.in iir.pc @ONLY) +-- +2.25.1 + diff --git a/recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch b/recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch new file mode 100644 index 0000000000000..18bc682ab4948 --- /dev/null +++ b/recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,9 +12,6 @@ cmake_policy(SET CMP0048 NEW) # set VERSION in project() + cmake_policy(SET CMP0042 NEW) # enable MACOSX_RPATH by default + + include(GNUInstallDirs) +-add_subdirectory(test) +-add_subdirectory(demo) +-enable_testing () + + if (MSVC) + add_compile_options(/W4) diff --git a/recipes/iir1/all/test_package/CMakeLists.txt b/recipes/iir1/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bfb108d7d9198 --- /dev/null +++ b/recipes/iir1/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(iir REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET iir::iir) + target_link_libraries(${PROJECT_NAME} PRIVATE iir::iir) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE iir::iir_static) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/iir1/all/test_package/conanfile.py b/recipes/iir1/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/iir1/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/iir1/all/test_package/test_package.cpp b/recipes/iir1/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3746899f046a0 --- /dev/null +++ b/recipes/iir1/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "Iir.h" + +int main() +{ + const int order = 8; + + // Butterworth lowpass + Iir::Butterworth::LowPass f; + + return 0; +} diff --git a/recipes/iir1/all/test_v1_package/CMakeLists.txt b/recipes/iir1/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/iir1/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/iir1/all/test_v1_package/conanfile.py b/recipes/iir1/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/iir1/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/iir1/config.yml b/recipes/iir1/config.yml new file mode 100644 index 0000000000000..8e492271b1dfd --- /dev/null +++ b/recipes/iir1/config.yml @@ -0,0 +1,5 @@ +versions: + "1.9.1": + folder: "all" + "1.9.0": + folder: "all" diff --git a/recipes/im95able-rea/all/conandata.yml b/recipes/im95able-rea/all/conandata.yml new file mode 100644 index 0000000000000..a13404bd2b981 --- /dev/null +++ b/recipes/im95able-rea/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20190225": + url: "https://github.com/im95able/Rea/archive/064d99897c9dcc547dc38853dcd917ba04a34ef4.tar.gz" + sha256: "efcf822116ea22422d2ea5249250cd5d13db54ab65b1a84a3f16c5d7413aed7e" +patches: + "cci.20190225": + - patch_file: "patches/0001-include-limits.patch" + patch_description: "include limits" + patch_type: "portability" diff --git a/recipes/im95able-rea/all/conanfile.py b/recipes/im95able-rea/all/conanfile.py new file mode 100644 index 0000000000000..74423119b2602 --- /dev/null +++ b/recipes/im95able-rea/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class Im95ableReaConan(ConanFile): + name = "im95able-rea" + description = ( + "Lightweight library of data structures implemented in C++11, " + "designed for constant time insertion, erasure, lookup, and fastest possible iteration." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/im95able/Rea/" + topics = ("slot_map", "slot_list", "header-only") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "Rea"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "rea") + self.cpp_info.set_property("cmake_target_name", "rea::rea") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "rea" + self.cpp_info.filenames["cmake_find_package_multi"] = "rea" + self.cpp_info.names["cmake_find_package"] = "rea" + self.cpp_info.names["cmake_find_package_multi"] = "rea" diff --git a/recipes/im95able-rea/all/patches/0001-include-limits.patch b/recipes/im95able-rea/all/patches/0001-include-limits.patch new file mode 100644 index 0000000000000..6b3cced25f67f --- /dev/null +++ b/recipes/im95able-rea/all/patches/0001-include-limits.patch @@ -0,0 +1,12 @@ +diff --git a/Rea/rea.h b/Rea/rea.h +index 2cc0a25..8cf57cc 100644 +--- a/Rea/rea.h ++++ b/Rea/rea.h +@@ -30,6 +30,7 @@ SOFTWARE. + #include + #include + #include ++#include + + + namespace rea { diff --git a/recipes/im95able-rea/all/test_package/CMakeLists.txt b/recipes/im95able-rea/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b670ff5e6af64 --- /dev/null +++ b/recipes/im95able-rea/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(rea REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rea::rea) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/im95able-rea/all/test_package/conanfile.py b/recipes/im95able-rea/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/im95able-rea/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/im95able-rea/all/test_package/test_package.cpp b/recipes/im95able-rea/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9f43b119dca2d --- /dev/null +++ b/recipes/im95able-rea/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "rea.h" + +int main() { + auto sl = rea::slot_list{}; + + return 0; +} diff --git a/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt b/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/im95able-rea/all/test_v1_package/conanfile.py b/recipes/im95able-rea/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/im95able-rea/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/im95able-rea/config.yml b/recipes/im95able-rea/config.yml new file mode 100644 index 0000000000000..5ed6e21978a2a --- /dev/null +++ b/recipes/im95able-rea/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190225": + folder: all diff --git a/recipes/imagemagick/all/conandata.yml b/recipes/imagemagick/all/conandata.yml new file mode 100644 index 0000000000000..2dc88685b5bf3 --- /dev/null +++ b/recipes/imagemagick/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "7.0.11-14": + source: + url: "https://github.com/ImageMagick/ImageMagick/archive/7.0.11-14.tar.gz" + sha256: "dfa5aa3f7f289f12c2f9ee6c7c19b02ae857b4eec02f40298f60f5c11048a016" + visualmagick: + "fcd198e4344576b9efc2facd952a2f0c57752c07": + url: "https://github.com/ImageMagick/VisualMagick/archive/fcd198e4344576b9efc2facd952a2f0c57752c07.zip" + sha256: "f793c1c48796ed2f295ba9cacb938f6aa7e4bf011226d96f977655911852bfda" +patches: + "7.0.11-14": + - patch_file: "patches/remove-unnecessary-dependencies.patch" + base_path: "VisualMagick" diff --git a/recipes/imagemagick/all/conanfile.py b/recipes/imagemagick/all/conanfile.py new file mode 100644 index 0000000000000..4e944b9046b3f --- /dev/null +++ b/recipes/imagemagick/all/conanfile.py @@ -0,0 +1,522 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild +from conans.errors import ConanInvalidConfiguration +import os +import glob + +required_conan_version = ">=1.33.0" + + +class ImageMagicConan(ConanFile): + name = "imagemagick" + description = ( + "ImageMagick is a free and open-source software suite for displaying, converting, and editing " + "raster image and vector image files" + ) + topics = ("imagemagick", "images", "manipulating") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://imagemagick.org" + license = "ImageMagick" + settings = "os", "arch", "compiler", "build_type" + generators = "pkg_config" + options = { + "shared": [True, False], + "fPIC": [True, False], + "hdri": [True, False], + "quantum_depth": [8, 16, 32], + "with_zlib": [True, False], + "with_bzlib": [True, False], + "with_lzma": [True, False], + "with_lcms": [True, False], + "with_openexr": [True, False], + "with_heic": [True, False], + "with_jbig": [True, False], + "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], + "with_openjp2": [True, False], + "with_pango": [True, False], + "with_png": [True, False], + "with_tiff": [True, False], + "with_webp": [True, False], + "with_xml2": [True, False], + "with_freetype": [True, False], + "with_djvu": [True, False], + "utilities": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "hdri": True, + "quantum_depth": 16, + "with_zlib": True, + "with_bzlib": True, + "with_lzma": True, + "with_lcms": True, + "with_openexr": True, + "with_heic": True, + "with_jbig": True, + "with_jpeg": "libjpeg", + "with_openjp2": True, + "with_pango": True, + "with_png": True, + "with_tiff": True, + "with_webp": False, + "with_xml2": True, + "with_freetype": True, + "with_djvu": False, + "utilities": True, + } + exports_sources = "patches/*" + + _autotools = None + + @property + def _source_subfolder(self): + return ( + "ImageMagick" # name is important, VisualMagick uses relative paths to it + ) + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + @property + def _modules(self): + return ["Magick++", "MagickWand", "MagickCore"] + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "Windows builds of ImageMagick require MFC which cannot currently be sourced from CCI." + ) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.11") + if self.options.with_bzlib: + self.requires("bzip2/1.0.8") + if self.options.with_lzma: + self.requires("xz_utils/5.2.5") + if self.options.with_lcms: + self.requires("lcms/2.11") + if self.options.with_openexr: + self.requires("openexr/2.5.7") + if self.options.with_heic: + self.requires("libheif/1.12.0") + if self.options.with_jbig: + self.requires("jbig/20160605") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9d") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.0") + if self.options.with_openjp2: + self.requires("openjpeg/2.4.0") + if self.options.with_pango: + self.requires("pango/1.50.7") + if self.options.with_png: + self.requires("libpng/1.6.37") + if self.options.with_tiff: + self.requires("libtiff/4.3.0") + if self.options.with_webp: + self.requires("libwebp/1.2.0") + if self.options.with_xml2: + self.requires("libxml2/2.9.10") + if self.options.with_freetype: + self.requires("freetype/2.10.4") + if self.options.with_djvu: + # FIXME: missing djvu recipe + self.output.warn( + "There is no djvu package available on Conan (yet). This recipe will use the one present on the system (if available)." + ) + + def source(self): + tools.get( + **self.conan_data["sources"][self.version]["source"], + destination=self._source_subfolder, + strip_root=True + ) + + if self._is_msvc: + visualmagick_version = list( + self.conan_data["sources"][self.version]["visualmagick"].keys() + )[0] + tools.get( + **self.conan_data["sources"][self.version]["visualmagick"][ + visualmagick_version + ], + destination="VisualMagick", + strip_root=True + ) + + def build(self): + if self._is_msvc: + self._build_msvc() + else: + with tools.chdir(self._source_subfolder): + env_build = self._build_configure() + env_build.make() + + def _build_msvc(self): + for patch in self.conan_data.get("patches", {}).get(self.version, {}): + tools.patch(**patch) + + # FIXME: package LiquidRescale aka liblqr + tools.replace_in_file( + os.path.join("VisualMagick", "lqr", "Config.txt"), + "#define MAGICKCORE_LQR_DELEGATE", + "", + ) + # FIXME: package LibRaw + tools.replace_in_file( + os.path.join("VisualMagick", "libraw", "Config.txt"), + "#define MAGICKCORE_RAW_R_DELEGATE", + "", + ) + + # FIXME: package FLIF (FLIF: Free Lossless Image Format) + tools.replace_in_file( + os.path.join("VisualMagick", "flif", "Config.txt"), + "#define MAGICKCORE_FLIF_DELEGATE", + "", + ) + + # FIXME: package librsvg + tools.replace_in_file( + os.path.join("VisualMagick", "librsvg", "Config.txt"), + "#define MAGICKCORE_RSVG_DELEGATE", + "", + ) + + if not self.options.shared: + for module in self._modules: + tools.replace_in_file( + os.path.join("VisualMagick", module, "Config.txt"), + "[DLL]", + "[STATIC]", + ) + tools.replace_in_file( + os.path.join("VisualMagick", "coders", "Config.txt"), + "[DLLMODULE]", + "[STATIC]\n[DEFINES]\n_MAGICKLIB_", + ) + + if self.settings.arch == "x86_64": + project = os.path.join("VisualMagick", "configure", "configure.vcxproj") + tools.replace_in_file(project, "Win32", "x64") + tools.replace_in_file(project, "/MACHINE:I386", "/MACHINE:x64") + + with tools.chdir(os.path.join("VisualMagick", "configure")): + + toolset = tools.msvs_toolset(self) + tools.replace_in_file( + "configure.vcxproj", + "v120", + "%s" % toolset, + ) + + msbuild = MSBuild(self) + # fatal error C1189: #error: Please use the /MD switch for _AFXDLL builds + msbuild.build_env.flags = ["/MD"] + msbuild.build( + project_file="configure.vcxproj", + platforms={"x86": "Win32"}, + force_vcvars=True, + ) + + # https://github.com/ImageMagick/ImageMagick-Windows/blob/master/AppVeyor/Build.ps1 + command = ["configure.exe", "/noWizard"] + msvc_version = { + 9: "/VS2002", + 10: "/VS2010", + 11: "/VS2012", + 12: "/VS2013", + 14: "/VS2015", + 15: "/VS2017", + 16: "/VS2019", + 17: "/VS2022", + }.get(int(str(self.settings.compiler.version))) + runtime = {"MT": "/smt", "MTd": "/smtd", "MD": "/dmt", "MDd": "/mdt"}.get( + str(self.settings.compiler.runtime) + ) + command.append(runtime) + command.append(msvc_version) + command.append("/hdri" if self.options.hdri else "/noHdri") + command.append("/Q%s" % self.options.quantum_depth) + if self.settings.arch == "x86_64": + command.append("/x64") + command = " ".join(command) + + self.output.info(command) + self.run(command, run_environment=True) + + # disable incorrectly detected OpenCL + baseconfig = os.path.join( + self._source_subfolder, "MagickCore", "magick-baseconfig.h" + ) + tools.replace_in_file( + baseconfig, + "#define MAGICKCORE__OPENCL", + "#undef MAGICKCORE__OPENCL", + strict=False, + ) + tools.replace_in_file( + baseconfig, + "#define MAGICKCORE_HAVE_CL_CL_H", + "#undef MAGICKCORE_HAVE_CL_CL_H", + strict=False, + ) + + suffix = { + "MT": "StaticMT", + "MTd": "StaticMTD", + "MD": "DynamicMT", + "MDd": "DynamicMT", + }.get(str(self.settings.compiler.runtime)) + + # GdiPlus requires C++, but ImageMagick has *.c files + project = ( + "IM_MOD_emf_%s.vcxproj" % suffix + if self.options.shared + else "CORE_coders_%s.vcxproj" % suffix + ) + tools.replace_in_file( + os.path.join("VisualMagick", "coders", project), + '', + '\n' + "CompileAsCpp", + ) + + for module in self._modules: + with tools.chdir(os.path.join("VisualMagick", module)): + msbuild = MSBuild(self) + msbuild.build( + project_file="CORE_%s_%s.vcxproj" % (module, suffix), + upgrade_project=False, + platforms={"x86": "Win32", "x86_64": "x64"}, + ) + + with tools.chdir(os.path.join("VisualMagick", "coders")): + pattern = ( + "IM_MOD_*_%s.vcxproj" % suffix + if self.options.shared + else "CORE_coders_%s.vcxproj" % suffix + ) + projects = glob.glob(pattern) + for project in projects: + msbuild = MSBuild(self) + msbuild.build( + project_file=project, + upgrade_project=False, + platforms={"x86": "Win32", "x86_64": "x64"}, + ) + + def _build_configure(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment( + self, win_bash=tools.os_info.is_windows + ) + + # FIXME: workaround for xorg/system adding system includes https://github.com/conan-io/conan-center-index/issues/6880 + if "/usr/include/uuid" in self._autotools.include_paths: + self._autotools.include_paths.remove("/usr/include/uuid") + + + def yes_no(o): + return "yes" if o else "no" + + args = [ + "--disable-openmp", + "--disable-docs", + "--with-perl=no", + "--with-x=no", + "--with-fontconfig=no", + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-static={}".format(yes_no(not self.options.shared)), + "--enable-hdri={}".format(yes_no(self.options.hdri)), + "--with-quantum-depth={}".format(self.options.quantum_depth), + "--with-zlib={}".format(yes_no(self.options.with_zlib)), + "--with-bzlib={}".format(yes_no(self.options.with_bzlib)), + "--with-lzma={}".format(yes_no(self.options.with_lzma)), + "--with-lcms={}".format(yes_no(self.options.with_lcms)), + "--with-openexr={}".format(yes_no(self.options.with_openexr)), + "--with-heic={}".format(yes_no(self.options.with_heic)), + "--with-jbig={}".format(yes_no(self.options.with_jbig)), + "--with-jpeg={}".format(yes_no(self.options.with_jpeg)), + "--with-openjp2={}".format(yes_no(self.options.with_openjp2)), + "--with-pango={}".format(yes_no(self.options.with_pango)), + "--with-png={}".format(yes_no(self.options.with_png)), + "--with-tiff={}".format(yes_no(self.options.with_tiff)), + "--with-webp={}".format(yes_no(self.options.with_webp)), + "--with-xml={}".format(yes_no(self.options.with_xml2)), + "--with-freetype={}".format(yes_no(self.options.with_freetype)), + "--with-djvu={}".format(yes_no(self.options.with_djvu)), + "--with-utilities={}".format(yes_no(self.options.utilities)), + ] + self._autotools.configure(args=args) + + return self._autotools + + def package(self): + with tools.chdir(self._source_subfolder): + env_build = self._build_configure() + env_build.install() + + with tools.chdir(self.package_folder): + # remove undesired files + tools.rmdir(os.path.join("lib", "pkgconfig")) # pc files + tools.rmdir("etc") + tools.rmdir("share") + tools.remove_files_by_mask("lib", "*.la") + + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + if self._is_msvc: + self.copy( + pattern="*CORE_*.lib", + dst="lib", + src=os.path.join("VisualMagick", "lib"), + keep_path=False, + ) + + self.copy( + pattern="*CORE_*.dll", + dst="bin", + src=os.path.join("VisualMagick", "bin"), + keep_path=False, + ) + self.copy( + pattern="*IM_MOD_*.dll", + dst="bin", + src=os.path.join("VisualMagick", "bin"), + keep_path=False, + ) + for module in self._modules: + self.copy( + pattern="*.h", + dst=os.path.join( + "include", + "ImageMagick-%s" % tools.Version(self.version).major, + module, + ), + src=os.path.join(self._source_subfolder, module), + ) + + def _libname(self, library): + if self._is_msvc: + infix = "DB" if self.settings.build_type == "Debug" else "RL" + return "CORE_%s_%s_" % (infix, library) + else: + suffix = "HDRI" if self.options.hdri else "" + return "%s-%s.Q%s%s" % ( + library, + tools.Version(self.version).major, + self.options.quantum_depth, + suffix, + ) + + def package_info(self): + # FIXME model official FindImageMagick https://cmake.org/cmake/help/latest/module/FindImageMagick.html + 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) + + core_requires = [] + if self.options.with_zlib: + core_requires.append("zlib::zlib") + if self.options.with_bzlib: + core_requires.append("bzip2::bzip2") + if self.options.with_lzma: + core_requires.append("xz_utils::xz_utils") + if self.options.with_lcms: + core_requires.append("lcms::lcms") + if self.options.with_openexr: + core_requires.append("openexr::openexr") + if self.options.with_heic: + core_requires.append("libheif::libheif") + if self.options.with_jbig: + core_requires.append("jbig::jbig") + if self.options.with_jpeg: + core_requires.append("{0}::{0}".format(self.options.with_jpeg)) + if self.options.with_openjp2: + core_requires.append("openjpeg::openjpeg") + if self.options.with_pango: + core_requires.append("pango::pango") + if self.options.with_png: + core_requires.append("libpng::libpng") + if self.options.with_tiff: + core_requires.append("libtiff::libtiff") + if self.options.with_webp: + core_requires.append("libwebp::libwebp") + if self.options.with_xml2: + core_requires.append("libxml2::libxml2") + if self.options.with_freetype: + core_requires.append("freetype::freetype") + + if self._is_msvc: + if not self.options.shared: + self.cpp_info.components["MagickCore"].libs.append( + self._libname("coders") + ) + if self.settings.os == "Linux": + self.cpp_info.components["MagickCore"].system_libs.append("pthread") + + self.cpp_info.components["MagickCore"].defines.append( + "MAGICKCORE_QUANTUM_DEPTH=%s" % self.options.quantum_depth + ) + self.cpp_info.components["MagickCore"].defines.append( + "MAGICKCORE_HDRI_ENABLE=%s" % int(bool(self.options.hdri)) + ) + self.cpp_info.components["MagickCore"].defines.append( + "_MAGICKDLL_=1" if self.options.shared else "_MAGICKLIB_=1" + ) + + imagemagick_include_dir = ( + "include/ImageMagick-%s" % tools.Version(self.version).major + ) + + self.cpp_info.components["MagickCore"].includedirs = [imagemagick_include_dir] + self.cpp_info.components["MagickCore"].libs.append(self._libname("MagickCore")) + self.cpp_info.components["MagickCore"].requires = core_requires + self.cpp_info.components["MagickCore"].names["pkg_config"] = ["MagicCore"] + + self.cpp_info.components[self._libname("MagickCore")].requires = ["MagickCore"] + self.cpp_info.components[self._libname("MagickCore")].names["pkg_config"] = [ + self._libname("MagickCore") + ] + + self.cpp_info.components["MagickWand"].includedirs = [ + imagemagick_include_dir + "/MagickWand" + ] + self.cpp_info.components["MagickWand"].libs = [self._libname("MagickWand")] + self.cpp_info.components["MagickWand"].requires = ["MagickCore"] + self.cpp_info.components["MagickWand"].names["pkg_config"] = ["MagickWand"] + + self.cpp_info.components[self._libname("MagickWand")].requires = ["MagickWand"] + self.cpp_info.components[self._libname("MagickWand")].names[ + "pkg_config" + ] = self._libname("MagickWand") + + self.cpp_info.components["Magick++"].includedirs = [ + imagemagick_include_dir + "/Magick++" + ] + self.cpp_info.components["Magick++"].libs = [self._libname("Magick++")] + self.cpp_info.components["Magick++"].requires = ["MagickWand"] + self.cpp_info.components["Magick++"].names["pkg_config"] = [ + "Magick++", + self._libname("Magick++"), + ] + + self.cpp_info.components[self._libname("Magick++")].requires = ["Magick++"] + self.cpp_info.components[self._libname("Magick++")].names[ + "pkg_config" + ] = self._libname("Magick++") diff --git a/recipes/imagemagick/all/patches/remove-unnecessary-dependencies.patch b/recipes/imagemagick/all/patches/remove-unnecessary-dependencies.patch new file mode 100644 index 0000000000000..081577d80fe74 --- /dev/null +++ b/recipes/imagemagick/all/patches/remove-unnecessary-dependencies.patch @@ -0,0 +1,194 @@ +diff --git a/MagickCore/Config.txt b/MagickCore/Config.txt +index e573f40..dd9b862 100644 +--- a/MagickCore/Config.txt ++++ b/MagickCore/Config.txt +@@ -24,12 +24,8 @@ vms.c + widget.c + + [DEPENDENCIES] +-bzlib + freetype +-lcms +-libxml + lqr +-zlib + + [WARNING_LEVEL] + 4 +diff --git a/coders/Config.dng.txt b/coders/Config.dng.txt +index 2e9b9d1..172ffda 100644 +--- a/coders/Config.dng.txt ++++ b/coders/Config.dng.txt +@@ -4,5 +4,4 @@ + [DEFINES_LIB] + LIBRAW_NODLL + +-[DEPENDENCIES] +-libraw +\ No newline at end of file ++[DEPENDENCIES] +\ No newline at end of file +diff --git a/coders/Config.exr.txt b/coders/Config.exr.txt +index 2624459..90f9cf0 100644 +--- a/coders/Config.exr.txt ++++ b/coders/Config.exr.txt +@@ -2,5 +2,4 @@ + ..\..\exr\openexr + ..\..\exr\openexr\IlmImf + +-[DEPENDENCIES] +-exr +\ No newline at end of file ++[DEPENDENCIES] +\ No newline at end of file +diff --git a/coders/Config.flif.txt b/coders/Config.flif.txt +index aa7d5bb..13f8be3 100644 +--- a/coders/Config.flif.txt ++++ b/coders/Config.flif.txt +@@ -2,7 +2,6 @@ + ..\..\flif\src\library + + [DEPENDENCIES] +-flif + + [VISUAL_STUDIO] + 2013 +diff --git a/coders/Config.heic.txt b/coders/Config.heic.txt +index 9684b8d..08e8633 100644 +--- a/coders/Config.heic.txt ++++ b/coders/Config.heic.txt +@@ -6,4 +6,3 @@ + LIBHEIF_STATIC_BUILD + + [DEPENDENCIES] +-libheif +diff --git a/coders/Config.jbig.txt b/coders/Config.jbig.txt +index d763d54..5d26be6 100644 +--- a/coders/Config.jbig.txt ++++ b/coders/Config.jbig.txt +@@ -2,4 +2,3 @@ + ..\..\jbig\libjbig + + [DEPENDENCIES] +-jbig +diff --git a/coders/Config.jp2.txt b/coders/Config.jp2.txt +index a991a0b..08cb26e 100644 +--- a/coders/Config.jp2.txt ++++ b/coders/Config.jp2.txt +@@ -2,4 +2,3 @@ + ..\..\openjpeg\src\lib\openjp2 + + [DEPENDENCIES] +-openjpeg +diff --git a/coders/Config.jpeg.txt b/coders/Config.jpeg.txt +index e473c26..c106aa0 100644 +--- a/coders/Config.jpeg.txt ++++ b/coders/Config.jpeg.txt +@@ -2,4 +2,3 @@ + ..\..\jpeg-turbo + + [DEPENDENCIES] +-jpeg-turbo +diff --git a/coders/Config.mat.txt b/coders/Config.mat.txt +index 8585d25..ed91809 100644 +--- a/coders/Config.mat.txt ++++ b/coders/Config.mat.txt +@@ -2,4 +2,3 @@ + ..\..\zlib + + [DEPENDENCIES] +-zlib +diff --git a/coders/Config.miff.txt b/coders/Config.miff.txt +index 92d3f74..0072180 100644 +--- a/coders/Config.miff.txt ++++ b/coders/Config.miff.txt +@@ -6,7 +6,4 @@ + [DEFINES_LIB] + LZMA_API_STATIC + +-[DEPENDENCIES] +-bzlib +-liblzma +-zlib +\ No newline at end of file ++[DEPENDENCIES] +\ No newline at end of file +diff --git a/coders/Config.msl.txt b/coders/Config.msl.txt +index d521b8f..9ebd750 100644 +--- a/coders/Config.msl.txt ++++ b/coders/Config.msl.txt +@@ -2,4 +2,3 @@ + ..\..\libxml\include + + [DEPENDENCIES] +-libxml +diff --git a/coders/Config.pango.txt b/coders/Config.pango.txt +index dbb5b72..d799970 100644 +--- a/coders/Config.pango.txt ++++ b/coders/Config.pango.txt +@@ -6,6 +6,3 @@ + ..\..\pango + + [DEPENDENCIES] +-cairo +-glib +-pango +diff --git a/coders/Config.png.txt b/coders/Config.png.txt +index e88a895..48890df 100644 +--- a/coders/Config.png.txt ++++ b/coders/Config.png.txt +@@ -3,5 +3,3 @@ + ..\..\zlib + + [DEPENDENCIES] +-png +-zlib +diff --git a/coders/Config.psd.txt b/coders/Config.psd.txt +index 8585d25..ed91809 100644 +--- a/coders/Config.psd.txt ++++ b/coders/Config.psd.txt +@@ -2,4 +2,3 @@ + ..\..\zlib + + [DEPENDENCIES] +-zlib +diff --git a/coders/Config.svg.txt b/coders/Config.svg.txt +index 44e96c7..1b32c1e 100644 +--- a/coders/Config.svg.txt ++++ b/coders/Config.svg.txt +@@ -9,7 +9,3 @@ + ..\..\librsvg\gdk-pixbuf + + [DEPENDENCIES] +-cairo +-glib +-libxml +-librsvg +diff --git a/coders/Config.tiff.txt b/coders/Config.tiff.txt +index 7e71723..619af78 100644 +--- a/coders/Config.tiff.txt ++++ b/coders/Config.tiff.txt +@@ -2,5 +2,4 @@ + ..\..\tiff\libtiff + + [DEPENDENCIES] +-tiff + coders>psd +diff --git a/coders/Config.url.txt b/coders/Config.url.txt +index d521b8f..9ebd750 100644 +--- a/coders/Config.url.txt ++++ b/coders/Config.url.txt +@@ -2,4 +2,3 @@ + ..\..\libxml\include + + [DEPENDENCIES] +-libxml +diff --git a/coders/Config.webp.txt b/coders/Config.webp.txt +index 407656f..b187605 100644 +--- a/coders/Config.webp.txt ++++ b/coders/Config.webp.txt +@@ -2,4 +2,3 @@ + ..\..\webp\src + + [DEPENDENCIES] +-webp diff --git a/recipes/imagemagick/all/test_package/CMakeLists.txt b/recipes/imagemagick/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/imagemagick/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/imagemagick/all/test_package/conanfile.py b/recipes/imagemagick/all/test_package/conanfile.py new file mode 100644 index 0000000000000..309b542d120cc --- /dev/null +++ b/recipes/imagemagick/all/test_package/conanfile.py @@ -0,0 +1,42 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + with open('delegates.txt') as f: + content = f.read() + + def check(option, token): + self.output.info('checking feature %s...' % token) + if option: + if token not in content.split(): + raise Exception("feature %s wasn't enabled!" % token) + self.output.info('checking feature %s... OK!' % token) + + check(self.options['imagemagick'].with_zlib, 'zlib') + check(self.options['imagemagick'].with_bzlib, 'bzlib') + check(self.options['imagemagick'].with_lzma, 'lzma') + check(self.options['imagemagick'].with_lcms, 'lcms') + check(self.options['imagemagick'].with_openexr, 'openexr') + check(self.options['imagemagick'].with_heic, 'heic') + check(self.options['imagemagick'].with_jbig, 'jbig') + check(self.options['imagemagick'].with_jpeg, 'jpeg') + check(self.options['imagemagick'].with_openjp2, 'jp2') + check(self.options['imagemagick'].with_pango, 'pangocairo') + check(self.options['imagemagick'].with_png, 'png') + check(self.options['imagemagick'].with_tiff, 'tiff') + check(self.options['imagemagick'].with_webp, 'webp') + check(self.options['imagemagick'].with_freetype, 'freetype') + check(self.options['imagemagick'].with_xml2, 'xml') diff --git a/recipes/imagemagick/all/test_package/test_package.c b/recipes/imagemagick/all/test_package/test_package.c new file mode 100644 index 0000000000000..bae5b33f6373e --- /dev/null +++ b/recipes/imagemagick/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include + +int main() +{ + size_t version, range, depth; + printf("Imagemagick version : %s\n", GetMagickVersion(&version)); + printf("ImageMagick release data : %s\n", GetMagickReleaseDate()); + printf("ImageMagick quantum range: %s\n", GetMagickQuantumRange(&range)); + printf("ImageMagick quantum depth: %s\n", GetMagickQuantumDepth(&depth)); + printf("ImageMagick package name : %s\n", GetMagickPackageName()); + printf("ImageMagick license : %s\n", GetMagickLicense()); + printf("ImageMagick home URL : %s\n", GetMagickHomeURL()); + printf("ImageMagick features : %s\n", GetMagickFeatures()); + printf("ImageMagick delegates : %s\n", GetMagickDelegates()); + printf("ImageMagick copyright : %s\n", GetMagickCopyright()); + + FILE *fp; + fp = fopen("delegates.txt", "w+"); + fputs(GetMagickDelegates(), fp); + fclose(fp); + + return 0; +} diff --git a/recipes/imagemagick/config.yml b/recipes/imagemagick/config.yml new file mode 100644 index 0000000000000..7d02fe0c755da --- /dev/null +++ b/recipes/imagemagick/config.yml @@ -0,0 +1,4 @@ +versions: + "7.0.11-14": + folder: all + diff --git a/recipes/imagl/all/CMakeLists.txt b/recipes/imagl/all/CMakeLists.txt new file mode 100644 index 0000000000000..434aea21733de --- /dev/null +++ b/recipes/imagl/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/imagl/all/conandata.yml b/recipes/imagl/all/conandata.yml new file mode 100644 index 0000000000000..4c28973c33e6b --- /dev/null +++ b/recipes/imagl/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "0.1.0": + url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.1.0/imagl-v0.1.0.tar.gz" + sha256: "9dcfba4c2efa8d44bf4cc9edd324794865dd6d6331467d3c69f5c5574db3844e" + "0.1.1": + url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.1.1/imagl-v0.1.1.tar.gz" + sha256: "4a7502cc733431af6423246fe5144e2eddb984454a66cca51742c852980ac862" + "0.1.2": + url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.1.2/imagl-v0.1.2.tar.gz" + sha256: "d1edf74e00f969a47dc56e4400b805600d6997270339d49e91b7c6112a2cb37e" + "0.2.1": + url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.2.1/imagl-v0.2.1.tar.gz" + sha256: "5a68cdeff4338e411695cca16c4230567de298f8efee2a9fadcc6fa644a70248" +patches: + "0.1.0": + - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" + base_path: "source_subfolder" + "0.1.1": + - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" + base_path: "source_subfolder" + "0.1.2": + - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" + base_path: "source_subfolder" + "0.2.1": + - patch_file: "patches/0001-no-unmanaged-conan-0.2.1.patch" + base_path: "source_subfolder" diff --git a/recipes/imagl/all/conanfile.py b/recipes/imagl/all/conanfile.py new file mode 100644 index 0000000000000..a8994d4c2ba67 --- /dev/null +++ b/recipes/imagl/all/conanfile.py @@ -0,0 +1,131 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class ImaglConan(ConanFile): + name = "imagl" + license = "GPL-3.0-or-later" + homepage = "https://github.com/Woazim/imaGL" + url = "https://github.com/conan-io/conan-center-index" + description = "A lightweight library to load image for OpenGL application." + topics = ("opengl", "texture", "image") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + "with_jpeg": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + "with_jpeg": True, + } + 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" + + @property + def _compilers_minimum_version(self): + minimum_versions = { + "gcc": "9", + "Visual Studio": "16.2", + "msvc": "19.22", + "clang": "10", + "apple-clang": "11" + } + if tools.Version(self.version) <= "0.1.1" or tools.Version(self.version) == "0.2.0": + minimum_versions["Visual Studio"] = "16.5" + minimum_versions["msvc"] = "19.25" + return minimum_versions + + @property + def _supports_jpeg(self): + return tools.Version(self.version) >= "0.2.0" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._supports_jpeg: + del self.options.with_jpeg + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_png: + self.requires("libpng/1.6.37") + if self._supports_jpeg and self.options.with_jpeg: + self.requires("libjpeg/9d") + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 20) + + 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] + + #Special check for clang that can only be linked to libc++ + if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": + raise ConanInvalidConfiguration("imagl requires some C++20 features, which are available in libc++ for clang compiler.") + + compiler_version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("imaGL requires C++20. Your compiler is unknown. Assuming it supports C++20.") + elif lazy_lt_semver(compiler_version, minimum_version): + raise ConanInvalidConfiguration("imaGL requires some C++20 features, which your {} {} compiler does not support.".format(str(self.settings.compiler), compiler_version)) + else: + print("Your compiler is {} {} and is compatible.".format(str(self.settings.compiler), compiler_version)) + + 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["STATIC_LIB"] = not self.options.shared + self._cmake.definitions["SUPPORT_PNG"] = self.options.with_png + if self._supports_jpeg: + self._cmake.definitions["SUPPORT_JPEG"] = self.options.with_jpeg + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + debug_suffix = "d" if self.settings.build_type == "Debug" else "" + static_suffix = "" if self.options.shared else "s" + self.cpp_info.libs = ["imaGL{}{}".format(debug_suffix, static_suffix)] + if not self.options.shared: + self.cpp_info.defines = ["IMAGL_STATIC=1"] + diff --git a/recipes/imagl/all/patches/0001-no-unmanaged-conan-0.1.x.patch b/recipes/imagl/all/patches/0001-no-unmanaged-conan-0.1.x.patch new file mode 100644 index 0000000000000..c404a6d997e59 --- /dev/null +++ b/recipes/imagl/all/patches/0001-no-unmanaged-conan-0.1.x.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,6 +23,7 @@ if(CMAKE_CXX_COMPILER MATCHES [[clang\+\+.*]]) + endif() + + # Generate conanfile.txt from current cmake cache configuration ++if(0) + file(STRINGS conanfile.in CONANFILE) + file(WRITE "${CMAKE_BINARY_DIR}/conanfile.txt" "# Do not modify this file, it is automatically generated by CMake\n") + foreach(CONANFILE_LINE ${CONANFILE}) +@@ -62,6 +63,7 @@ else() + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + endif() + conan_basic_setup(TARGETS) ++endif() + + set(CMAKE_DEBUG_POSTFIX d) + set(CMAKE_STATIC_LIBRARY_SUFFIX "s${CMAKE_STATIC_LIBRARY_SUFFIX}") diff --git a/recipes/imagl/all/patches/0001-no-unmanaged-conan-0.2.1.patch b/recipes/imagl/all/patches/0001-no-unmanaged-conan-0.2.1.patch new file mode 100644 index 0000000000000..69b7f5b75427a --- /dev/null +++ b/recipes/imagl/all/patches/0001-no-unmanaged-conan-0.2.1.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,7 @@ if(CMAKE_CXX_COMPILER MATCHES [[clang\+\+.*]]) + endif() + + # Generate conanfile.txt from current cmake cache configuration ++if(0) + file(STRINGS conanfile.in CONANFILE) + file(WRITE "${CMAKE_BINARY_DIR}/conanfile.txt" "# Do not modify this file, it is automatically generated by CMake\n") + foreach(CONANFILE_LINE ${CONANFILE}) +@@ -68,6 +69,7 @@ else() + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + endif() + conan_basic_setup(TARGETS) ++endif() + + set(CMAKE_DEBUG_POSTFIX d) + set(CMAKE_STATIC_LIBRARY_SUFFIX "s${CMAKE_STATIC_LIBRARY_SUFFIX}") diff --git a/recipes/imagl/all/test_package/CMakeLists.txt b/recipes/imagl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..15d229320021c --- /dev/null +++ b/recipes/imagl/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_target_properties(example PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/imagl/all/test_package/conanfile.py b/recipes/imagl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..156e2a8976e7c --- /dev/null +++ b/recipes/imagl/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ImaglTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/imagl/all/test_package/example.cpp b/recipes/imagl/all/test_package/example.cpp new file mode 100644 index 0000000000000..205dbf81d1b23 --- /dev/null +++ b/recipes/imagl/all/test_package/example.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() { + try { + imaGL::CImaGL img("notfound.png"); + } + catch(...) { + } + std::cout << "It works!\n"; + return 0; +} diff --git a/recipes/imagl/config.yml b/recipes/imagl/config.yml new file mode 100644 index 0000000000000..c9c8dd3f8df3b --- /dev/null +++ b/recipes/imagl/config.yml @@ -0,0 +1,9 @@ +versions: + "0.1.0": + folder: all + "0.1.1": + folder: all + "0.1.2": + folder: all + "0.2.1": + folder: all diff --git a/recipes/imake/all/conandata.yml b/recipes/imake/all/conandata.yml new file mode 100644 index 0000000000000..e9b2090bb9e33 --- /dev/null +++ b/recipes/imake/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.0.8": + url: "https://www.x.org/releases/individual/util/imake-1.0.8.tar.gz" + sha256: "8178a09bfef33ad5f61cb5cb62283df7d3a5682f014507d2e7cfd922485a5c00" +patches: + "1.0.8": + - patch_file: "patches/0001-reproducible-behavior.patch" + - patch_file: "patches/0002-msvc-debug-build_type.patch" diff --git a/recipes/imake/all/conanfile.py b/recipes/imake/all/conanfile.py new file mode 100644 index 0000000000000..5e4171b55257f --- /dev/null +++ b/recipes/imake/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +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 ImakeConan(ConanFile): + name = "imake" + description = "Obsolete C preprocessor interface to the make utility" + topics = ("xmkmf", "preprocessor", "build", "system") + license = "MIT" + homepage = "https://gitlab.freedesktop.org/xorg/util/imake" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "ccmakedep": [True, False], + "cleanlinks": [True, False], + "makeg": [True, False], + "mergelib": [True, False], + "mkdirhier": [True, False], + "mkhtmlindex": [True, False], + "revpath": [True, False], + "xmkmf": [True, False], + } + default_options = { + "ccmakedep": True, + "cleanlinks": True, + "makeg": True, + "mergelib": True, + "mkdirhier": True, + "mkhtmlindex": True, + "revpath": True, + "xmkmf": True, + } + + 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("xorg-proto/2022.2") + + def build_requirements(self): + self.tool_requires("automake/1.16.5") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def package_id(self): + del self.info.settings.compiler + + 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): + venv = VirtualBuildEnv(self) + venv.generate() + + tc = AutotoolsToolchain(self) + + if self.settings.os == "Windows": + tc.extra_defines.append("WIN32") + if is_msvc(self): + tc.extra_defines.extend([ + "_CRT_SECURE_NO_WARNINGS", + "CROSSCOMPILE_CPP", + ]) + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + + yes_no = lambda v: "yes" if v else "no" + conf_args = [ + "--enable-ccmakedep={}".format(yes_no(self.options.ccmakedep)), + "--enable-cleanlinks={}".format(yes_no(self.options.cleanlinks)), + "--enable-makeg={}".format(yes_no(self.options.makeg)), + "--enable-mergelib={}".format(yes_no(self.options.mergelib)), + "--enable-mkdirhier={}".format(yes_no(self.options.mkdirhier)), + "--enable-mkhtmlindex={}".format(yes_no(self.options.mkhtmlindex)), + "--enable-revpath={}".format(yes_no(self.options.revpath)), + "--enable-xmkmf={}".format(yes_no(self.options.xmkmf)), + ] + if "CPP" in os.environ: + conf_args.extend([ + "--with-script-preproc-cmd={}".format(os.environ["CPP"]), + ]) + + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get('user.automake:compile-wrapper')) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("CPP", f"{compile_wrapper} cl -E") + # We may be able to use AutotoolsDeps, however there are outstanding + # issues with path conversions: https://github.com/conan-io/conan/issues/12784 + xorg_proto_include = unix_path(self, self.dependencies['xorg-proto'].cpp_info.aggregated_components().includedirs[0]) + env.append("CFLAGS", f"-I{xorg_proto_include}") + tc.generate(env) + + pkgconf = PkgConfigDeps(self) + pkgconf.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make(args=["V=1"]) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + 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/imake/all/patches/0001-reproducible-behavior.patch b/recipes/imake/all/patches/0001-reproducible-behavior.patch new file mode 100644 index 0000000000000..605ae7e7b2c1f --- /dev/null +++ b/recipes/imake/all/patches/0001-reproducible-behavior.patch @@ -0,0 +1,14 @@ +Hardcode gcc instead of using `PREPROC` (=compiler used when building imake). +This leads to more reproducible behavior. +(CC can be overridden by a CC environment variable or --cc argument) +--- mdepend.cpp ++++ mdepend.cpp +@@ -21,7 +21,7 @@ + XCOMM "-" (at least, that is what the documentation implies). + XCOMM + +-CC=PREPROC ++CC=gcc + + silent='-' + diff --git a/recipes/imake/all/patches/0002-msvc-debug-build_type.patch b/recipes/imake/all/patches/0002-msvc-debug-build_type.patch new file mode 100644 index 0000000000000..8af26fe967a05 --- /dev/null +++ b/recipes/imake/all/patches/0002-msvc-debug-build_type.patch @@ -0,0 +1,57 @@ +Needed when building MSVC with build_type=Debug + compiler.runtime=MTd +- escape comments with XCOMM +- avoid C4717: '_fstat64i32': recursive on all control paths, function will cause runtime stack overflow +- /tmp/xxxx does not exist on Windows +--- mdepend.cpp ++++ mdepend.cpp +@@ -125,9 +125,9 @@ + shift + ;; + +- # Flag to tell compiler to output dependencies directly +- # For example, with Sun compilers, -xM or -xM1 or +- # with gcc, -M ++ XCOMM Flag to tell compiler to output dependencies directly ++ XCOMM For example, with Sun compilers, -xM or -xM1 or ++ XCOMM with gcc, -M + -d) + compilerlistsdepends="y" + compilerlistdependsflag="$2" +--- imake.c ++++ imake.c +@@ -159,9 +159,6 @@ + #include + #include + #include +-#ifdef WIN32 +-# include "Xw32defs.h" +-#endif + #include + #include + #ifdef X_NOT_POSIX +@@ -252,6 +249,9 @@ + #if defined(__NetBSD__) /* see code clock in init() below */ + # include + #endif ++#ifdef WIN32 ++# include "Xw32defs.h" ++#endif + + typedef unsigned char boolean; + #define TRUE 1 +@@ -303,9 +303,14 @@ + const char *cpp = NULL; + + const char *tmpMakefile; ++#ifdef _WIN32 ++const char *tmpMakefileTemplate = "Imf.XXXXXX"; /* HACK: create temporary files in current folder */ ++const char *tmpImakefileTemplate = "IIf.XXXXXX"; /* HACK: create temporary files in current folder */ ++#else + const char *tmpMakefileTemplate = "/tmp/Imf.XXXXXX"; +-const char *tmpImakefile; + const char *tmpImakefileTemplate = "/tmp/IIf.XXXXXX"; ++#endif ++const char *tmpImakefile; + const char *make_argv[ ARGUMENTS ] = { + #ifdef WIN32 + "nmake" diff --git a/recipes/imake/all/test_package/Imake.tmpl b/recipes/imake/all/test_package/Imake.tmpl new file mode 100644 index 0000000000000..3b7cb31780b8f --- /dev/null +++ b/recipes/imake/all/test_package/Imake.tmpl @@ -0,0 +1,2 @@ +default: + @echo "IMAKE_TEMPLATE:" IMAKE_TEMPLATE diff --git a/recipes/imake/all/test_package/Imakefile b/recipes/imake/all/test_package/Imakefile new file mode 100644 index 0000000000000..8a9b031f63620 --- /dev/null +++ b/recipes/imake/all/test_package/Imakefile @@ -0,0 +1 @@ +# Imakefile diff --git a/recipes/imake/all/test_package/conanfile.py b/recipes/imake/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4251d2cffa421 --- /dev/null +++ b/recipes/imake/all/test_package/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.files import copy +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, VCVars +from conan.tools.gnu import Autotools, AutotoolsToolchain + + +required_conan_version = ">=1.54.0" + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if not self.conf.get("tools.gnu:make_program", check_type=str): + self.tool_requires("make/4.3") + + def layout(self): + basic_layout(self) + + def generate(self): + tc = AutotoolsToolchain(self) + + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + ms = VCVars(self) + ms.generate(scope="run") + tc.generate(env) + + def build(self): + if can_run(self): + copy(self, "Imake*", self.source_folder, self.build_folder) + self.run("imake", env="conanrun") + autotools = Autotools(self) + autotools.make() + + def test(self): + # test is successful if we can invoke make in the build step + pass diff --git a/recipes/imake/all/test_v1_package/Imake.tmpl b/recipes/imake/all/test_v1_package/Imake.tmpl new file mode 100644 index 0000000000000..3b7cb31780b8f --- /dev/null +++ b/recipes/imake/all/test_v1_package/Imake.tmpl @@ -0,0 +1,2 @@ +default: + @echo "IMAKE_TEMPLATE:" IMAKE_TEMPLATE diff --git a/recipes/imake/all/test_v1_package/Imakefile b/recipes/imake/all/test_v1_package/Imakefile new file mode 100644 index 0000000000000..8a9b031f63620 --- /dev/null +++ b/recipes/imake/all/test_v1_package/Imakefile @@ -0,0 +1 @@ +# Imakefile diff --git a/recipes/imake/all/test_v1_package/conanfile.py b/recipes/imake/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..99bf0a8a9c2d8 --- /dev/null +++ b/recipes/imake/all/test_v1_package/conanfile.py @@ -0,0 +1,44 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import contextlib +import os +import shutil + +required_conan_version = ">=1.36.0" + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + exports_sources = "Imakefile", "Imake.tmpl" + + def build_requirements(self): + if not tools.get_env("CONAN_MAKE_PROGRAM"): + self.build_requires("make/4.2.1") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @contextlib.contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + env = { + "CC": "cl -nologo", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), os.path.join(self.build_folder, src)) + if not tools.cross_building(self): + with self._build_context(): + self.run("imake", run_environment=True) + + def test(self): + if not tools.cross_building(self): + autotools = AutoToolsBuildEnvironment(self) + autotools.make() diff --git a/recipes/imake/config.yml b/recipes/imake/config.yml new file mode 100644 index 0000000000000..28e3ee22ca8ac --- /dev/null +++ b/recipes/imake/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.8": + folder: all diff --git a/recipes/imath/all/conandata.yml b/recipes/imath/all/conandata.yml new file mode 100644 index 0000000000000..bebaaa4063645 --- /dev/null +++ b/recipes/imath/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.1.7": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.7.tar.gz" + sha256: "bff1fa140f4af0e7f02c6cb78d41b9a7d5508e6bcdfda3a583e35460eb6d4b47" + "3.1.6": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.6.tar.gz" + sha256: "ea5592230f5ab917bea3ceab266cf38eb4aa4a523078d46eac0f5a89c52304db" + "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" diff --git a/recipes/imath/all/conanfile.py b/recipes/imath/all/conanfile.py new file mode 100644 index 0000000000000..ca052909386af --- /dev/null +++ b/recipes/imath/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class ImathConan(ConanFile): + name = "imath" + description = ( + "Imath is a C++ and python library of 2D and 3D vector, matrix, and " + "math operations for computer graphics." + ) + license = "BSD-3-Clause" + topics = ("computer-graphics", "matrix", "openexr", "3d-vector") + homepage = "https://github.com/AcademySoftwareFoundation/Imath" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self) and self.settings.compiler.get_safe("cppstd"): + # when msvc is working with a C++ standard level higher + # than the default, we need the __cplusplus macro to be correct + tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + 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.set_property("cmake_file_name", "Imath") + self.cpp_info.set_property("cmake_target_name", "Imath::Imath") + self.cpp_info.set_property("pkg_config_name", "Imath") + + # Imath::ImathConfig - header only library + imath_config = self.cpp_info.components["imath_config"] + imath_config.set_property("cmake_target_name", "Imath::ImathConfig") + imath_config.includedirs.append(os.path.join("include", "Imath")) + + # Imath::Imath - linkable library + imath_lib = self.cpp_info.components["imath_lib"] + imath_lib.set_property("cmake_target_name", "Imath::Imath") + imath_lib.set_property("pkg_config_name", "Imath") + imath_lib.libs = collect_libs(self) + imath_lib.requires = ["imath_config"] + if self.settings.os == "Windows" and self.options.shared: + imath_lib.defines.append("IMATH_DLL") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Imath" + self.cpp_info.names["cmake_find_package_multi"] = "Imath" + self.cpp_info.names["pkg_config"] = "Imath" + imath_config.names["cmake_find_package"] = "ImathConfig" + imath_config.names["cmake_find_package_multi"] = "ImathConfig" + imath_lib.names["cmake_find_package"] = "Imath" + imath_lib.names["cmake_find_package_multi"] = "Imath" + imath_lib.names["pkg_config"] = "Imath" diff --git a/recipes/imath/all/test_package/CMakeLists.txt b/recipes/imath/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c646b7678695 --- /dev/null +++ b/recipes/imath/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Imath REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Imath::Imath) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/imath/all/test_package/conanfile.py b/recipes/imath/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/imath/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/imath/all/test_package/test_package.cpp b/recipes/imath/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..39d477384f30e --- /dev/null +++ b/recipes/imath/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + std::cout << Imath::half(1.0) << "\n"; + return 0; +} diff --git a/recipes/imath/all/test_v1_package/CMakeLists.txt b/recipes/imath/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/imath/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/imath/all/test_v1_package/conanfile.py b/recipes/imath/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/imath/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/imath/config.yml b/recipes/imath/config.yml new file mode 100644 index 0000000000000..a8c8ad2b073d1 --- /dev/null +++ b/recipes/imath/config.yml @@ -0,0 +1,9 @@ +versions: + "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/CMakeLists.txt b/recipes/imgui/all/CMakeLists.txt new file mode 100644 index 0000000000000..8c9bf128442ff --- /dev/null +++ b/recipes/imgui/all/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.8) +project(imgui LANGUAGES CXX) + +set(MISC_DIR ${IMGUI_SRC_DIR}/misc) +set(EXTRA_FONTS_DIR ${MISC_DIR}/fonts) +set(IMGUI_EXPORT_HEADERS imgui_export_headers.h) + +file(GLOB SOURCE_FILES ${IMGUI_SRC_DIR}/*.cpp) +file(GLOB HEADER_FILES ${IMGUI_SRC_DIR}/*.h) +file(GLOB EXTRA_FONTS_FILES ${EXTRA_FONTS_DIR}/*.ttf) +if (MSVC) + file(GLOB EXTRA_NATVIS_FILES ${MISC_DIR}/natvis/*.natvis) +endif() + +set(BINARY_TO_COMPRESSED_BIN binary_to_compressed_c) + +add_executable(${BINARY_TO_COMPRESSED_BIN} ${EXTRA_FONTS_DIR}/binary_to_compressed_c.cpp) + +add_library(${PROJECT_NAME} ${SOURCE_FILES}) +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON +) +include(GenerateExportHeader) +generate_export_header(${PROJECT_NAME} + EXPORT_MACRO_NAME IMGUI_API + EXPORT_FILE_NAME ${IMGUI_EXPORT_HEADERS} +) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ + $ +) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ${BINARY_TO_COMPRESSED_BIN} + DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ${HEADER_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${IMGUI_EXPORT_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +install(FILES ${EXTRA_FONTS_FILES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/res/fonts + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +if (MSVC) + install(FILES ${EXTRA_NATVIS_FILES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/res/natvis + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +endif() diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml new file mode 100644 index 0000000000000..1eb68f99063db --- /dev/null +++ b/recipes/imgui/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "1.89.4": + url: "https://github.com/ocornut/imgui/archive/v1.89.4.tar.gz" + sha256: "69f1e83adcab3fdd27b522f5075f407361b0d3875e3522b13d33bc2ae2c7d48c" + "1.89.3": + url: "https://github.com/ocornut/imgui/archive/v1.89.3.tar.gz" + sha256: "3b665fadd5580b7ef494d5d8bb1c12b2ec53ee723034caf43332956381f5d631" + "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" + "1.87": + url: "https://github.com/ocornut/imgui/archive/v1.87.tar.gz" + sha256: "b54ceb35bda38766e36b87c25edf7a1cd8fd2cb8c485b245aedca6fb85645a20" + "1.86": + url: "https://github.com/ocornut/imgui/archive/v1.86.tar.gz" + sha256: "6ba6ae8425a19bc52c5e067702c48b70e4403cd339cba02073a462730a63e825" + "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/all/conanfile.py b/recipes/imgui/all/conanfile.py new file mode 100644 index 0000000000000..c2583929a0dfa --- /dev/null +++ b/recipes/imgui/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.tools.files import get, copy, replace_in_file +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os +import re + +required_conan_version = ">=1.53.0" + +class IMGUIConan(ConanFile): + name = "imgui" + description = "Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ocornut/imgui" + topics = ("gui", "graphical", "bloat-free") + + 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, 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") + + 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["IMGUI_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def _patch_sources(self): + # Ensure we take into account export_headers + replace_in_file(self, + os.path.join(self.source_folder, "imgui.h"), + "#ifdef IMGUI_USER_CONFIG", + "#include \"imgui_export_headers.h\"\n\n#ifdef IMGUI_USER_CONFIG" + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + m = re.match(r'cci\.\d{8}\+(?P\d+\.\d+)\.docking', str(self.version)) + version = Version(m.group('version')) if m else Version(self.version) + backends_folder = os.path.join( + self.source_folder, + "backends" if version >= "1.80" else "examples" + ) + copy(self, pattern="imgui_impl_*", + dst=os.path.join(self.package_folder, "res", "bindings"), + src=backends_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["imgui"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("imm32") + self.cpp_info.srcdirs = [os.path.join("res", "bindings")] + + 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) diff --git a/recipes/imgui/all/test_package/CMakeLists.txt b/recipes/imgui/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3e9ea943d420e --- /dev/null +++ b/recipes/imgui/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(imgui REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE imgui::imgui) +if (DOCKING) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DDOCKING) +endif() +target_compile_definitions(${PROJECT_NAME} PUBLIC "IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/my_imgui_config.h\"") +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/imgui/all/test_package/conanfile.py b/recipes/imgui/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/imgui/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/imgui/all/test_package/my_imgui_config.h b/recipes/imgui/all/test_package/my_imgui_config.h new file mode 100644 index 0000000000000..69f4176638fd1 --- /dev/null +++ b/recipes/imgui/all/test_package/my_imgui_config.h @@ -0,0 +1,11 @@ +#pragma once + +#include + + +namespace ImGui +{ + void MyFunction(const char* name) { + printf(" ImGui::MyFunction(%s)\n", name); + } +} diff --git a/recipes/imgui/all/test_package/test_package.cpp b/recipes/imgui/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6a0a221db872e --- /dev/null +++ b/recipes/imgui/all/test_package/test_package.cpp @@ -0,0 +1,49 @@ +#include +#ifdef DOCKING + #include +#endif + +#include + +int main(int, char**) +{ + ImGuiContext* context =ImGui::CreateContext(); + ImGuiIO& io = ImGui::GetIO(); + + ImGuiTextBuffer textBuffer; + textBuffer.append("Hello, ImGui"); + + // Build atlas + unsigned char* tex_pixels = NULL; + int tex_w, tex_h; + io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); + + for (int n = 0; n < 50; n++) + { + printf("NewFrame() %d\n", n); + io.DisplaySize = ImVec2(1920, 1080); + io.DeltaTime = 1.0f / 60.0f; + ImGui::NewFrame(); + +#ifdef DOCKING + auto dockspaceID = ImGui::GetID("MyDockSpace"); + static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None; + ImGui::DockSpace(dockspaceID, ImVec2(0.0f, 0.0f), dockspace_flags); + printf(" with docking\n"); +#endif + + static float f = 0.0f; + ImGui::Text("Hello, world!"); + ImGui::Text("%s", textBuffer.begin()); + ImGui::SliderFloat("float", &f, 0.0f, 1.0f); + ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + ImGui::MyFunction("test_package"); // ensure we are using our provided IMGUI_USER_CONFIG + ImGui::ShowDemoWindow(NULL); + + ImGui::Render(); + } + + printf("DestroyContext()\n"); + ImGui::DestroyContext(context); + return 0; +} diff --git a/recipes/imgui/all/test_v1_package/CMakeLists.txt b/recipes/imgui/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/imgui/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/imgui/all/test_v1_package/conanfile.py b/recipes/imgui/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/imgui/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml new file mode 100644 index 0000000000000..ce92302f4a251 --- /dev/null +++ b/recipes/imgui/config.yml @@ -0,0 +1,27 @@ +versions: + "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": + folder: all + "1.86": + folder: all + "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/CMakeLists.txt b/recipes/imguizmo/all/CMakeLists.txt new file mode 100644 index 0000000000000..73784d828761a --- /dev/null +++ b/recipes/imguizmo/all/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.4) +project(imguizmo CXX) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +set(SOURCE_DIR source_subfolder) +file(GLOB SOURCE_FILES ${SOURCE_DIR}/*.cpp) +file(GLOB HEADER_FILES ${SOURCE_DIR}/*.h) + +add_library(${PROJECT_NAME} ${SOURCE_FILES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${SOURCE_DIR}) +target_link_libraries(${PROJECT_NAME} PUBLIC ${CONAN_LIBS}) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/recipes/imguizmo/all/conandata.yml b/recipes/imguizmo/all/conandata.yml new file mode 100644 index 0000000000000..11e9cb824cab9 --- /dev/null +++ b/recipes/imguizmo/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "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 new file mode 100644 index 0000000000000..62c65e6489c8b --- /dev/null +++ b/recipes/imguizmo/all/conanfile.py @@ -0,0 +1,61 @@ +import functools +from conans import ConanFile, CMake, tools + + +class ImGuizmoConan(ConanFile): + name = "imguizmo" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CedricGuillemet/ImGuizmo" + description = "Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui" + topics = ("imgui", "3d", "graphics", "guizmo") + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def requirements(self): + self.requires("imgui/1.87") + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["imguizmo"] diff --git a/recipes/imguizmo/all/test_package/CMakeLists.txt b/recipes/imguizmo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4db4d9b97252b --- /dev/null +++ b/recipes/imguizmo/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(imgui REQUIRED) +find_package(imguizmo REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} imgui::imgui) +target_link_libraries(${PROJECT_NAME} imguizmo::imguizmo) diff --git a/recipes/imguizmo/all/test_package/conanfile.py b/recipes/imguizmo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..23ba95e79f465 --- /dev/null +++ b/recipes/imguizmo/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/imguizmo/all/test_package/test_package.cpp b/recipes/imguizmo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c8e5c4a72e06f --- /dev/null +++ b/recipes/imguizmo/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() { + float matrix[] = { + 1.0f, 1.0f, 1.0f, 0.5f, + 2.0f, 2.0f, 2.0f, 0.5f, + 3.0f, 3.0f, 3.0f, 0.5f, + 0.0f, 0.0f, 0.0f, 1.0f, + }; + float matrixTranslation[3], matrixRotation[3], matrixScale[3]; + ImGuizmo::DecomposeMatrixToComponents(matrix, matrixTranslation, matrixRotation, matrixScale); + + return 0; +} diff --git a/recipes/imguizmo/config.yml b/recipes/imguizmo/config.yml new file mode 100644 index 0000000000000..cc1b28a70b3ee --- /dev/null +++ b/recipes/imguizmo/config.yml @@ -0,0 +1,3 @@ +versions: + "1.83": + folder: "all" diff --git a/recipes/immer/all/conandata.yml b/recipes/immer/all/conandata.yml new file mode 100644 index 0000000000000..811b858690dba --- /dev/null +++ b/recipes/immer/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.8.0": + url: "https://github.com/arximboldi/immer/archive/v0.8.0.tar.gz" + sha256: "4ed9e86a525f293e0ba053107b937d88b032674ec6e5db958816f2e412677fde" + "0.7.0": + url: "https://github.com/arximboldi/immer/archive/v0.7.0.tar.gz" + sha256: "cf67ab428aa3610eb0f72d0ea936c15cce3f91df26ee143ab783acd053507fe4" + "0.6.2": + url: "https://github.com/arximboldi/immer/archive/refs/tags/v0.6.2.tar.gz" + sha256: "c3bb8847034437dee64adacb04e1e0163ae640b596c582eb4c0aa1d7c6447cd7" diff --git a/recipes/immer/all/conanfile.py b/recipes/immer/all/conanfile.py new file mode 100644 index 0000000000000..952501519b554 --- /dev/null +++ b/recipes/immer/all/conanfile.py @@ -0,0 +1,60 @@ +from conans import ConanFile, tools, errors + +required_conan_version = ">=1.33.0" + +class ImmerConan(ConanFile): + name = "immer" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/arximboldi/immer" + description = "Postmodern immutable and persistent data structures for C++---value semantics at scale" + topics = ("header", "header-only", "persistent", "modern", "immutable", + "data structures", "functional", "value semantics", "postmodern", + "rrb-tree") + no_copy_source = True + settings = "compiler" + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, + destination=self._source_subfolder) + + def package(self): + include_folder = self._source_subfolder + self.copy(pattern="*.hpp", dst="include", src=include_folder) + self.copy(pattern="LICENSE", dst="licenses", src=include_folder) + + def package_id(self): + self.info.header_only() + + @property + def _minimum_compilers_version(self): + # Reference: https://en.cppreference.com/w/cpp/compiler_support/14 + return { + "apple-clang": "5.1", + "clang": "3.4", + "gcc": "6", + "intel": "17", + "sun-cc": "5.15", + "Visual Studio": "15" + } + + 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 errors.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)) diff --git a/recipes/immer/all/test_package/CMakeLists.txt b/recipes/immer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..870b269d2d660 --- /dev/null +++ b/recipes/immer/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(immer CONFIG REQUIRED) + +add_executable(example example.cpp) + +target_link_libraries(example immer::immer) + +target_compile_features(example PUBLIC cxx_std_14) diff --git a/recipes/immer/all/test_package/conanfile.py b/recipes/immer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0242d96a644ca --- /dev/null +++ b/recipes/immer/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/immer/all/test_package/example.cpp b/recipes/immer/all/test_package/example.cpp new file mode 100644 index 0000000000000..3778564a31082 --- /dev/null +++ b/recipes/immer/all/test_package/example.cpp @@ -0,0 +1,13 @@ +#include "immer/vector.hpp" +#include + +int main() { + const auto v0 = immer::vector{}; + const auto v1 = v0.push_back(13); + assert(v0.size() == 0 && v1.size() == 1 && v1[0] == 13); + + const auto v2 = v1.set(0, 42); + assert(v1[0] == 13 && v2[0] == 42); + + return 0; +} diff --git a/recipes/immer/config.yml b/recipes/immer/config.yml new file mode 100644 index 0000000000000..9e53a8732b403 --- /dev/null +++ b/recipes/immer/config.yml @@ -0,0 +1,7 @@ +versions: + "0.8.0": + folder: all + "0.7.0": + folder: all + "0.6.2": + folder: all diff --git a/recipes/implot/all/CMakeLists.txt b/recipes/implot/all/CMakeLists.txt new file mode 100644 index 0000000000000..ec869caed9029 --- /dev/null +++ b/recipes/implot/all/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.4) +project(implot CXX) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +file(GLOB SOURCE_FILES ${IMPLOT_SRC_DIR}/*.cpp) +file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) + +add_library(${PROJECT_NAME} ${SOURCE_FILES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${IMPLOT_SRC_DIR}) + +find_package(imgui CONFIG REQUIRED) + +target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui) + +target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_DEFINE_MATH_OPERATORS) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/implot/all/conandata.yml b/recipes/implot/all/conandata.yml new file mode 100644 index 0000000000000..21af4dfe87312 --- /dev/null +++ b/recipes/implot/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.14": + url: "https://github.com/epezent/implot/archive/v0.14.tar.gz" + sha256: "1613af3e6554c0a74de20c6e60e9bce5ce35c2d4f9e1aa5ff963f7fe2d48af88" + "0.13": + url: "https://github.com/epezent/implot/archive/v0.13.tar.gz" + sha256: "acc8b012b6761c9b7ce1599a35fd861ac6dafb01368b1e938c90a3f654bd7589" + "0.12": + url: "https://github.com/epezent/implot/archive/v0.12.tar.gz" + sha256: "f8bc3b9b58dbabe3a0c0a2ebb8307d8e850012685332a85be36fcc4d4450be56" + "0.11": + url: "https://github.com/epezent/implot/archive/v0.11.tar.gz" + sha256: "1ec4c8501f70901132a9f14409c956b508a8ea3fe457e8518325b156dceada00" diff --git a/recipes/implot/all/conanfile.py b/recipes/implot/all/conanfile.py new file mode 100644 index 0000000000000..ce2e069d3196d --- /dev/null +++ b/recipes/implot/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54" + +class ImplotConan(ConanFile): + name = "implot" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/epezent/implot" + description = "Advanced 2D Plotting for Dear ImGui" + topics = ("imgui", "plot", "graphics", ) + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC # rm_safe not needed + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + if Version(self.version) >= "0.14": + self.requires("imgui/1.89.4", transitive_headers=True) + elif Version(self.version) >= "0.13": + # imgui 1.89 renamed ImGuiKeyModFlags_* to ImGuiModFlags_* + self.requires("imgui/1.88", transitive_headers=True) + else: + self.requires("imgui/1.86", transitive_headers=True) + + 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["IMPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["implot"] diff --git a/recipes/implot/all/test_package/CMakeLists.txt b/recipes/implot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..945aea8b2724f --- /dev/null +++ b/recipes/implot/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(implot CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} implot::implot) diff --git a/recipes/implot/all/test_package/conanfile.py b/recipes/implot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4b1e5bb19a0a2 --- /dev/null +++ b/recipes/implot/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class ImplotTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/implot/all/test_package/test_package.cpp b/recipes/implot/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e66b8ef948f6 --- /dev/null +++ b/recipes/implot/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + ImPlot::GetCurrentContext(); + return 0; +} diff --git a/recipes/implot/all/test_v1_package/CMakeLists.txt b/recipes/implot/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/implot/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/implot/all/test_v1_package/conanfile.py b/recipes/implot/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4ef0320775f21 --- /dev/null +++ b/recipes/implot/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os + +from conans import ConanFile, CMake +from conans.tools import cross_building + + +class ImplotTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/implot/config.yml b/recipes/implot/config.yml new file mode 100644 index 0000000000000..d62abd0d999a8 --- /dev/null +++ b/recipes/implot/config.yml @@ -0,0 +1,9 @@ +versions: + "0.14": + folder: "all" + "0.13": + folder: "all" + "0.12": + folder: "all" + "0.11": + folder: "all" diff --git a/recipes/imutils-cpp/all/conandata.yml b/recipes/imutils-cpp/all/conandata.yml new file mode 100644 index 0000000000000..32d51c439957b --- /dev/null +++ b/recipes/imutils-cpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.1": + url: "https://github.com/thedevmanek/imutils-cpp/archive/refs/tags/v1.0.1.tar.gz" + sha256: "de79dce695a20550de1c383f74bf034ade22686f1197308ec612a1fb05fcf67a" +patches: + "1.0.1": + - patch_file: "patches/1.0.1-0001-fix-cmake.patch" + - patch_file: "patches/1.0.1-0002-unuse-bits_stdcpp_h.patch" + - patch_file: "patches/1.0.1-0003-fix-path-cast.patch" diff --git a/recipes/imutils-cpp/all/conanfile.py b/recipes/imutils-cpp/all/conanfile.py new file mode 100644 index 0000000000000..f6e8787dbdea2 --- /dev/null +++ b/recipes/imutils-cpp/all/conanfile.py @@ -0,0 +1,103 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ImutilsCppConan(ConanFile): + name = "imutils-cpp" + description = "This is a cpp version of popular python computer vision library imutils." + license = "Apache-2.0" + topics = ("opencv", "imutils", "computer vision", ) + homepage = "https://github.com/thedevmanek/imutils-cpp" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "msvc": "19.14", + "clang": "12", + "apple-clang": "10.14", + } + + 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("opencv/4.5.5", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/7.87.0") + + 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) + if not valid_min_cppstd(self, self._min_cppstd): + tc.cache_variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["imutils_cpp"] + self.cpp_info.set_property("cmake_file_name", "imutils_cpp") + self.cpp_info.set_property("cmake_target_name", "imutils_cpp::imutils_cpp") + + # TODO: Remove after Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "imutils_cpp" + self.cpp_info.names["cmake_find_package_multi"] = "imutils_cpp" diff --git a/recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..66ed5cd60c766 --- /dev/null +++ b/recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7418a34..82b1777 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,13 +1,26 @@ + cmake_minimum_required(VERSION 3.9) + project(imutils_cpp VERSION 1.0.1 DESCRIPTION "imutils_cpp A series of convenience functions to make basic image processing functions such as translation, rotation, resizing and skeletonization easier with OpenCV ") ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + find_package(OpenCV REQUIRED) ++find_package(CURL REQUIRED) + include(GNUInstallDirs) +-add_library(imutils_cpp SHARED STATIC src/text.cpp include/imutils/text.h src/paths.cpp include/imutils/paths.h src/perspective.cpp include/imutils/perspective.h src/convenience.cpp include/imutils/convenience.h) +-set_target_properties(imutils_cpp PROPERTIES VERSION ${PROJECT_VERSION}) ++add_library(imutils_cpp src/text.cpp src/paths.cpp src/perspective.cpp src/convenience.cpp) ++set(IMUTILS_HEADERS include/imutils/text.h include/imutils/paths.h include/imutils/perspective.h include/imutils/convenience.h) ++set_target_properties(imutils_cpp PROPERTIES ++ VERSION ${PROJECT_VERSION} ++ PUBLIC_HEADER "${IMUTILS_HEADERS}" ++) + target_include_directories(imutils_cpp PRIVATE include) + target_include_directories(imutils_cpp PRIVATE src) + include(GNUInstallDirs) + install(TARGETS imutils_cpp + ${PROJECT_NAME} +- DESTINATION lib/${PROJECT_NAME}) +-target_link_libraries(imutils_cpp ${OpenCV_LIBS} curl) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/imutils ++) ++target_link_libraries(imutils_cpp opencv::opencv CURL::libcurl) ++if (MSVC) ++ target_compile_options(imutils_cpp PRIVATE "/permissive-") ++endif() +diff --git b/build/.cmake/api/v1/query/client-vscode/query.json b/build/.cmake/api/v1/query/client-vscode/query.json +new file mode 100644 +index 0000000..82bb964 +--- /dev/null ++++ b/build/.cmake/api/v1/query/client-vscode/query.json +@@ -0,0 +1 @@ ++{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]} +\ No newline at end of file diff --git a/recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch b/recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch new file mode 100644 index 0000000000000..2b2214447761b --- /dev/null +++ b/recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch @@ -0,0 +1,49 @@ +diff --git a/include/imutils/paths.h b/include/imutils/paths.h +index 29bc503..56b78e5 100644 +--- a/include/imutils/paths.h ++++ b/include/imutils/paths.h +@@ -5,7 +5,8 @@ + #define PATH_H + + #include "filesystem" +-#include "bits/stdc++.h" ++#include ++#include + /** @file paths.h **/ + /***************************************************************************//** + *@class Path +@@ -39,4 +40,4 @@ public: + std::vector + listFiles(std::string basePath, std::vector validExts = {}, std::string contains = "" + ); +-}; +\ No newline at end of file ++}; +diff --git a/src/paths.cpp b/src/paths.cpp +index 380be73..d0bc7f5 100644 +--- a/src/paths.cpp ++++ b/src/paths.cpp +@@ -2,7 +2,9 @@ + // Created by jonsnow on 07/02/22. + // + #include "filesystem" +-#include "bits/stdc++.h" ++#include ++#include ++#include + #include "../include/imutils/paths.h" + + namespace fs = std::filesystem; +diff --git a/src/text.cpp b/src/text.cpp +index 73bec10..6336964 100644 +--- a/src/text.cpp ++++ b/src/text.cpp +@@ -1,5 +1,7 @@ + #include "string" +-#include "bits/stdc++.h" ++#include ++#include ++#include + #include "opencv2/core.hpp" + #include "opencv2/imgproc.hpp" + diff --git a/recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch b/recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch new file mode 100644 index 0000000000000..7658e09e6bedd --- /dev/null +++ b/recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch @@ -0,0 +1,22 @@ +diff --git a/src/paths.cpp b/src/paths.cpp +index d0bc7f5..d39ffb6 100644 +--- a/src/paths.cpp ++++ b/src/paths.cpp +@@ -19,14 +19,14 @@ std::vector Path::listFiles(std::string basePath, std::vector filesDirs; + for (const auto &dirEntry: fs::recursive_directory_iterator(basePath)) { + std::filesystem::path file = dirEntry.path(); +- if (contains != "" and ((std::string) file.filename()).find(contains) == std::string::npos) { ++ if (contains != "" and file.filename().string().find(contains) == std::string::npos) { + continue; + } + if (validExts.empty()) { +- filesDirs.push_back(dirEntry.path()); ++ filesDirs.push_back(dirEntry.path().string()); + } else { + if (std::find(validExts.begin(), validExts.end(), file.extension()) != validExts.end()){ +- filesDirs.push_back(dirEntry.path()); ++ filesDirs.push_back(dirEntry.path().string()); + + } + diff --git a/recipes/imutils-cpp/all/test_package/CMakeLists.txt b/recipes/imutils-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79460b8878562 --- /dev/null +++ b/recipes/imutils-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(imutils_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE imutils_cpp::imutils_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/imutils-cpp/all/test_package/conanfile.py b/recipes/imutils-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/imutils-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "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/imutils-cpp/all/test_package/test_package.cpp b/recipes/imutils-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..42bfe878da9e8 --- /dev/null +++ b/recipes/imutils-cpp/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + cv::Mat image1 = cv::Mat::eye(256, 256, CV_8UC3); + cv::Mat image2 = Convenience::translate(image1, 5.0, 3.0); + + return 0; +} diff --git a/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt b/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/imutils-cpp/all/test_v1_package/conanfile.py b/recipes/imutils-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/imutils-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/imutils-cpp/config.yml b/recipes/imutils-cpp/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/imutils-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/incbin/all/conandata.yml b/recipes/incbin/all/conandata.yml new file mode 100644 index 0000000000000..9da2f972ac124 --- /dev/null +++ b/recipes/incbin/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20211107": + url: "https://github.com/graphitemaster/incbin/archive/6e576cae5ab5810f25e2631f2e0b80cbe7dc8cbf.tar.gz" + sha256: "d23582689c46604cad116495dbd8aceb1974b46164114a231e8c8144ae12b230" diff --git a/recipes/incbin/all/conanfile.py b/recipes/incbin/all/conanfile.py new file mode 100644 index 0000000000000..2e27608fee20f --- /dev/null +++ b/recipes/incbin/all/conanfile.py @@ -0,0 +1,37 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class IncbinConan(ConanFile): + name = "incbin" + description = "Include binary files in C/C++" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/graphitemaster/incbin/" + topics = ("include", "binary", "preprocess", "header-only") + package_type = "header-library" + settings = "compiler" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("Currently incbin recipe is not supported for Visual Studio because it requires external command 'incbin'.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "UNLICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "incbin.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + + def package_id(self): + self.info.clear() diff --git a/recipes/incbin/all/test_package/CMakeLists.txt b/recipes/incbin/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..32f39d585f388 --- /dev/null +++ b/recipes/incbin/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(incbin CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} incbin::incbin) +target_compile_definitions(${PROJECT_NAME} PUBLIC INCBIN_FILE="${CMAKE_SOURCE_DIR}/CMakeLists.txt") diff --git a/recipes/incbin/all/test_package/conanfile.py b/recipes/incbin/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/incbin/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/incbin/all/test_package/test_package.c b/recipes/incbin/all/test_package/test_package.c new file mode 100644 index 0000000000000..c79ecf17ddd08 --- /dev/null +++ b/recipes/incbin/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#define INCBIN_PREFIX g_ +#define INCBIN_STYLE INCBIN_STYLE_SNAKE +#include "incbin.h" + +INCBIN(cmake, INCBIN_FILE); + +#include + +int main(int argc, char* argv[]) { + (void)g_cmake_data[0]; + (void)*g_cmake_end; + printf(INCBIN_FILE" size is %d\n", g_cmake_size); + + return 0; +} diff --git a/recipes/incbin/all/test_v1_package/CMakeLists.txt b/recipes/incbin/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/incbin/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/incbin/all/test_v1_package/conanfile.py b/recipes/incbin/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/incbin/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/incbin/config.yml b/recipes/incbin/config.yml new file mode 100644 index 0000000000000..a9e4060c13dfa --- /dev/null +++ b/recipes/incbin/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211107": + folder: all diff --git a/recipes/indicators/all/conandata.yml b/recipes/indicators/all/conandata.yml new file mode 100644 index 0000000000000..2d3d2eb9e7a85 --- /dev/null +++ b/recipes/indicators/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.3": + url: "https://github.com/p-ranav/indicators/archive/v2.3.tar.gz" + sha256: "70da7a693ff7a6a283850ab6d62acf628eea17d386488af8918576d0760aef7b" + "2.2": + url: "https://github.com/p-ranav/indicators/archive/v2.2.tar.gz" + sha256: "b768f1b7ca64a413503f72d5460cc617c1458c17fb7a8c0ee503d753e1f20d03" + "2.0": + url: "https://github.com/p-ranav/indicators/archive/v2.0.tar.gz" + sha256: "ef296fa614edcd798db0ac6c3c0f2990682cae8b83724a4db34eed17521c75f7" + "1.9": + url: "https://github.com/p-ranav/indicators/archive/v1.9.tar.gz" + sha256: "842e11fa542ac392a2a2ddee48620a06c3005ec38ca25cf352471e46e18f389d" diff --git a/recipes/indicators/all/conanfile.py b/recipes/indicators/all/conanfile.py new file mode 100644 index 0000000000000..e0917bf5ba07b --- /dev/null +++ b/recipes/indicators/all/conanfile.py @@ -0,0 +1,54 @@ +import os +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.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + +class IndicatorsConan(ConanFile): + name = "indicators" + description = "Activity Indicators for Modern C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/indicators" + topics = ("activity", "indicator", "loading", "spinner", "animation", "progress", "header-only") + settings = "os", "arch", "compiler", "build_type" + 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) + + if Version(self.version) < "2.0": + if is_msvc(self) or (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5"): + raise ConanInvalidConfiguration( + "indicators < 2.0 can't be used by {0} {1}".format( + self.settings.compiler, + self.settings.compiler.version + ) + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=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.append("pthread") diff --git a/recipes/indicators/all/test_package/CMakeLists.txt b/recipes/indicators/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..886f8f419992a --- /dev/null +++ b/recipes/indicators/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(indicators REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE indicators::indicators) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/indicators/all/test_package/conanfile.py b/recipes/indicators/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/indicators/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/indicators/all/test_package/test_package.cpp b/recipes/indicators/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..71cfd4f7b82c4 --- /dev/null +++ b/recipes/indicators/all/test_package/test_package.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include + +// Copied from indicators' demo + +int main() { + using namespace indicators; + + // Hide cursor + show_console_cursor(false); + + { + // + // PROGRESS BAR 1 + // + indicators::ProgressBar p{ + option::BarWidth{50}, + option::Start{"["}, + option::Fill{"■"}, + option::Lead{"■"}, + option::Remainder{" "}, + option::End{" ]"}, + option::ForegroundColor{indicators::Color::yellow}, + option::FontStyles{std::vector{indicators::FontStyle::bold}}}; + + std::atomic index{0}; + std::vector status_text = {"Rocket.exe is not responding", + "Buying more snacks", + "Finding a replacement engineer", + "Assimilating the modding community", + "Crossing fingers", + "Porting KSP to a Nokia 3310", + "Flexing struts", + "Releasing space whales", + "Watching paint dry"}; + + auto job = [&p, &index, &status_text]() { + while (true) { + if (p.is_completed()) + break; + p.set_option(option::PostfixText{status_text[index % status_text.size()]}); + p.set_progress(index * 10); + index += 1; + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + + // Show cursor + show_console_cursor(true); + + return 0; +} diff --git a/recipes/indicators/all/test_v1_package/CMakeLists.txt b/recipes/indicators/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/indicators/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/indicators/all/test_v1_package/conanfile.py b/recipes/indicators/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/indicators/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/indicators/config.yml b/recipes/indicators/config.yml new file mode 100644 index 0000000000000..e7a199ca0be29 --- /dev/null +++ b/recipes/indicators/config.yml @@ -0,0 +1,9 @@ +versions: + "2.3": + folder: "all" + "2.2": + folder: "all" + "2.0": + folder: "all" + "1.9": + folder: "all" diff --git a/recipes/indirect_value/all/conandata.yml b/recipes/indirect_value/all/conandata.yml new file mode 100644 index 0000000000000..2e011d24cdb18 --- /dev/null +++ b/recipes/indirect_value/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.1": + url: https://github.com/jbcoe/indirect_value/archive/refs/tags/v0.0.1.tar.gz + sha256: 01b61737f9e6b3601fc588a0070833f2fbb67ab5fb1d1482d5b8ca8b64f44f33 diff --git a/recipes/indirect_value/all/conanfile.py b/recipes/indirect_value/all/conanfile.py new file mode 100644 index 0000000000000..ce84972958e04 --- /dev/null +++ b/recipes/indirect_value/all/conanfile.py @@ -0,0 +1,70 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class IndirectValueConan(ConanFile): + name = "indirect_value" + homepage = "https://github.com/jbcoe/indirect_value" + description = "Production-quality reference implementation of P1950: A Free-Store-Allocated Value Type For C++" + topics = ("std", "vocabulary-type", "value-semantics") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "8", + "apple-clang": "11" + } + + 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)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="indirect_value.*", dst="include", + src=self._source_subfolder) + self.copy("*LICENSE*", dst="licenses", keep_path=False) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "indirect_value") + self.cpp_info.set_property("cmake_target_name", "indirect_value::indirect_value") + + self.cpp_info.names["cmake_find_package"] = "indirect_value" + self.cpp_info.names["cmake_find_package_multi"] = "indirect_value" diff --git a/recipes/indirect_value/all/test_package/CMakeLists.txt b/recipes/indirect_value/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd68256049f87 --- /dev/null +++ b/recipes/indirect_value/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(indirect_value REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE indirect_value::indirect_value) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/recipes/indirect_value/all/test_package/conanfile.py b/recipes/indirect_value/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9b63bd176646b --- /dev/null +++ b/recipes/indirect_value/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/indirect_value/all/test_package/test_package.cpp b/recipes/indirect_value/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c2649413b40d1 --- /dev/null +++ b/recipes/indirect_value/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +using namespace isocpp_p1950; + +int main() +{ + indirect_value result{new int(EXIT_SUCCESS)}; + return *result; +} diff --git a/recipes/indirect_value/config.yml b/recipes/indirect_value/config.yml new file mode 100644 index 0000000000000..f6f5b5679b9d4 --- /dev/null +++ b/recipes/indirect_value/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.1": + folder: all diff --git a/recipes/influxdb-cpp/all/conandata.yml b/recipes/influxdb-cpp/all/conandata.yml new file mode 100644 index 0000000000000..08568ef090742 --- /dev/null +++ b/recipes/influxdb-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 'cci.20201227': + url: 'https://github.com/orca-zhang/influxdb-cpp/archive/800e0912552bc1b261c2afc6553a95caf5e9c66d.tar.gz' + sha256: '456f0160cd6b12f88a19dcd0106dc0ba1935841f53ec642bf368843fa28def0e' diff --git a/recipes/influxdb-cpp/all/conanfile.py b/recipes/influxdb-cpp/all/conanfile.py new file mode 100644 index 0000000000000..fa5b1610b16b3 --- /dev/null +++ b/recipes/influxdb-cpp/all/conanfile.py @@ -0,0 +1,33 @@ +import os + +from conans import ConanFile, tools +import glob + + +class InfluxDBCppConan(ConanFile): + name = "influxdb-cpp" + license = "MIT" + homepage = "https://github.com/orca-zhang/influxdb-cpp" + url = "https://github.com/conan-io/conan-center-index" + description = "C++ client for InfluxDB." + topics = ("single-header-lib", "influxdb") + settings = "os" + no_copy_source = True + + _source_subfolder = "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob("influxdb-cpp-*")[0] + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy('LICENSE', dst='licenses', src=self._source_subfolder) + self.copy('influxdb.hpp', dst='include', src=self._source_subfolder) + + def package_info(self): + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + + def package_id(self): + self.info.header_only() diff --git a/recipes/influxdb-cpp/all/test_package/CMakeLists.txt b/recipes/influxdb-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6aab347eddf53 --- /dev/null +++ b/recipes/influxdb-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/influxdb-cpp/all/test_package/conanfile.py b/recipes/influxdb-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..17295afcb8561 --- /dev/null +++ b/recipes/influxdb-cpp/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class InfluxDBCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/influxdb-cpp/all/test_package/example.cpp b/recipes/influxdb-cpp/all/test_package/example.cpp new file mode 100644 index 0000000000000..101e676ebb7df --- /dev/null +++ b/recipes/influxdb-cpp/all/test_package/example.cpp @@ -0,0 +1,6 @@ +#include "influxdb.hpp" + +int main() +{ + influxdb_cpp::server_info si("127.0.0.1", 8086, "testx", "test", "test"); +} diff --git a/recipes/influxdb-cpp/config.yml b/recipes/influxdb-cpp/config.yml new file mode 100644 index 0000000000000..a58749d6e9c51 --- /dev/null +++ b/recipes/influxdb-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201227": + folder: all diff --git a/recipes/inih/all/conandata.yml b/recipes/inih/all/conandata.yml new file mode 100644 index 0000000000000..f45a313d7e7e2 --- /dev/null +++ b/recipes/inih/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "56": + url: "https://github.com/benhoyt/inih/archive/r56.tar.gz" + sha256: "4f2ba6bd122d30281a8c7a4d5723b7af90b56aa828c0e88256d7fceda03a491a" + "55": + url: "https://github.com/benhoyt/inih/archive/r55.tar.gz" + sha256: "ba55f8ae2a8caf0653f30f48567241e14ea916acfc13481f502d8a9c8f507f68" + "52": + url: "https://github.com/benhoyt/inih/archive/r52.tar.gz" + sha256: "439cff9ce9a8afc52d08772ac3e93b3cecd79c7707f871fb4534fb3a48201880" + "51": + url: "https://github.com/benhoyt/inih/archive/r51.tar.gz" + sha256: "132361da6d3172760a40319722b50244aee1b7ce7077a0dd8805881e6a8ea4aa" diff --git a/recipes/inih/all/conanfile.py b/recipes/inih/all/conanfile.py new file mode 100644 index 0000000000000..d2890dd500498 --- /dev/null +++ b/recipes/inih/all/conanfile.py @@ -0,0 +1,101 @@ +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 copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class InihConan(ConanFile): + name = "inih" + description = "Simple .INI file parser in C, good for embedded systems " + license = "BSD-3-Clause" + topics = ("ini", "configuration", "parser") + homepage = "https://github.com/benhoyt/inih" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self): + raise ConanInvalidConfiguration("Shared inih is not supported with msvc") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["distro_install"] = True + tc.project_options["with_INIReader"] = True + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "INIReader") + + self.cpp_info.components["libinih"].set_property("pkg_config_name", "inih") + self.cpp_info.components["libinih"].libs = ["inih"] + + self.cpp_info.components["inireader"].set_property("pkg_config_name", "INIReader") + self.cpp_info.components["inireader"].libs = ["INIReader"] + self.cpp_info.components["inireader"].requires = ["libinih"] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/inih/all/test_package/CMakeLists.txt b/recipes/inih/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c1fdbf05ad25 --- /dev/null +++ b/recipes/inih/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(inih CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE inih::inih) diff --git a/recipes/inih/all/test_package/conanfile.py b/recipes/inih/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8dd087fd1cbd1 --- /dev/null +++ b/recipes/inih/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os +import textwrap + + +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): + with open("test.ini", "w") as fn: + fn.write(textwrap.dedent("""\ + [protocol] + version = 1337 + [user] + name = conan-center-index + email = info@conan.io + """)) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/inih/all/test_package/test_package.c b/recipes/inih/all/test_package/test_package.c new file mode 100644 index 0000000000000..b484d425ff14f --- /dev/null +++ b/recipes/inih/all/test_package/test_package.c @@ -0,0 +1,43 @@ +#include "ini.h" + +#include +#include +#include + +typedef struct +{ + int version; + const char* name; + const char* email; +} configuration; + +static int handler(void* user, const char* section, const char* name, + const char* value) +{ + configuration* pconfig = (configuration*)user; + + #define MATCH(s, n) strcmp(section, s) == 0 && strcmp(name, n) == 0 + if (MATCH("protocol", "version")) { + pconfig->version = atoi(value); + } else if (MATCH("user", "name")) { + pconfig->name = strdup(value); + } else if (MATCH("user", "email")) { + pconfig->email = strdup(value); + } else { + return 0; /* unknown section/name, error */ + } + return 1; +} + +int main(int argc, char* argv[]) +{ + configuration config; + + if (ini_parse("test.ini", handler, &config) < 0) { + printf("Can't load 'test.ini'\n"); + return 1; + } + printf("Config loaded from 'test.ini': version=%d, name=%s, email=%s\n", + config.version, config.name, config.email); + return 0; +} diff --git a/recipes/inih/all/test_v1_package/CMakeLists.txt b/recipes/inih/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/inih/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/inih/all/test_v1_package/conanfile.py b/recipes/inih/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5e82a4d078b63 --- /dev/null +++ b/recipes/inih/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +import os +import textwrap + + +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): + with open("test.ini", "w") as fn: + fn.write(textwrap.dedent("""\ + [protocol] + version = 1337 + [user] + name = conan-center-index + email = info@conan.io + """)) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/inih/config.yml b/recipes/inih/config.yml new file mode 100644 index 0000000000000..3746836949531 --- /dev/null +++ b/recipes/inih/config.yml @@ -0,0 +1,9 @@ +versions: + "56": + folder: "all" + "55": + folder: "all" + "52": + folder: "all" + "51": + folder: "all" diff --git a/recipes/inja/all/conandata.yml b/recipes/inja/all/conandata.yml new file mode 100644 index 0000000000000..c930e439e86ca --- /dev/null +++ b/recipes/inja/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.4.0": + url: "https://github.com/pantor/inja/archive/v3.4.0.tar.gz" + sha256: "7155f944553ca6064b26e88e6cae8b71f8be764832c9c7c6d5998e0d5fd60c55" + "3.3.0": + url: "https://github.com/pantor/inja/archive/v3.3.0.tar.gz" + sha256: "e628d994762dcdaa9a97f63a9b8b73d9af51af0ffa5acea6bdbba0aceaf8ee25" + "3.2.0": + url: "https://github.com/pantor/inja/archive/v3.2.0.tar.gz" + sha256: "825e1f0076504b5aac99cc9ad8c4cbfdc33e57c06c40353f2d7b93a33caae17d" + "3.1.0": + url: "https://github.com/pantor/inja/archive/v3.1.0.tar.gz" + sha256: "f4210493e7e3c62d3050ca6e5e9dd72823ec4125a469fa9b28519d7f32fc9731" + "3.0.0": + url: "https://github.com/pantor/inja/archive/v3.0.0.tar.gz" + sha256: "99cdb0d90ab1adff9ec63b40a867ec14e1b217fe2d7ac07a6124de201de4ffd0" diff --git a/recipes/inja/all/conanfile.py b/recipes/inja/all/conanfile.py new file mode 100644 index 0000000000000..e211c74ba199b --- /dev/null +++ b/recipes/inja/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 +import os + +required_conan_version = ">=1.50.0" + + +class InjaConan(ConanFile): + name = "inja" + license = "MIT" + homepage = "https://github.com/pantor/inja" + url = "https://github.com/conan-io/conan-center-index" + description = "Inja is a template engine for modern C++, loosely inspired by jinja for python" + topics = ("jinja2", "string templates", "templates engine") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 if Version(self.version) < "3.4.0" else 17 + + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 11: + return {} + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def requirements(self): + self.requires("nlohmann_json/3.11.2") + + 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 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 + + def package(self): + copy(self, "LICENSE", 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "inja") + self.cpp_info.set_property("cmake_target_name", "pantor::inja") + 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.filenames["cmake_find_package"] = "inja" + self.cpp_info.filenames["cmake_find_package_multi"] = "inja" + self.cpp_info.names["cmake_find_package"] = "pantor" + self.cpp_info.names["cmake_find_package_multi"] = "pantor" + self.cpp_info.components["libinja"].names["cmake_find_package"] = "inja" + self.cpp_info.components["libinja"].names["cmake_find_package_multi"] = "inja" + self.cpp_info.components["libinja"].set_property("cmake_target_name", "pantor::inja") + self.cpp_info.components["libinja"].requires = ["nlohmann_json::nlohmann_json"] + self.cpp_info.components["libinja"].bindirs = [] + self.cpp_info.components["libinja"].frameworkdirs = [] + self.cpp_info.components["libinja"].libdirs = [] + self.cpp_info.components["libinja"].resdirs = [] diff --git a/recipes/inja/all/test_package/CMakeLists.txt b/recipes/inja/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..493c014fdc1c8 --- /dev/null +++ b/recipes/inja/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(inja REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pantor::inja) +if(inja_VERSION VERSION_LESS "3.4.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/inja/all/test_package/conanfile.py b/recipes/inja/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/inja/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/inja/all/test_package/test_package.cpp b/recipes/inja/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..59393673f2f4d --- /dev/null +++ b/recipes/inja/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() +{ + nlohmann::json data; + data["name"] = "world"; + std::cout << inja::render("Hello {{ name }}!", data) << "\n"; +} diff --git a/recipes/inja/all/test_v1_package/CMakeLists.txt b/recipes/inja/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b4b25bff2f0cd --- /dev/null +++ b/recipes/inja/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/inja/all/test_v1_package/conanfile.py b/recipes/inja/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/inja/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/inja/config.yml b/recipes/inja/config.yml new file mode 100644 index 0000000000000..05a145a493718 --- /dev/null +++ b/recipes/inja/config.yml @@ -0,0 +1,11 @@ +versions: + "3.4.0": + folder: all + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all diff --git a/recipes/innoextract/all/conandata.yml b/recipes/innoextract/all/conandata.yml new file mode 100644 index 0000000000000..a280c970476d1 --- /dev/null +++ b/recipes/innoextract/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.9.0": + url: + - "https://constexpr.org/innoextract/files/innoextract-1.9.tar.gz" + - "https://github.com/dscharrer/innoextract/releases/download/1.9/innoextract-1.9.tar.gz" + sha256: "6344a69fc1ed847d4ed3e272e0da5998948c6b828cb7af39c6321aba6cf88126" +patches: + "1.9.0": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/0002-remove-custom-cmake-find-modules.patch" diff --git a/recipes/innoextract/all/conanfile.py b/recipes/innoextract/all/conanfile.py new file mode 100644 index 0000000000000..c21ccf578684a --- /dev/null +++ b/recipes/innoextract/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.files import get, rmdir, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +import os + + +required_conan_version = ">=1.52.0" + + +class InnoextractConan(ConanFile): + name = "innoextract" + description = "Extract contents of Inno Setup installers" + license = "LicenseRef-LICENSE" + topics = ("inno-setup", "decompression") + homepage = "https://constexpr.org/innoextract" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.80.0") + self.requires("xz_utils/5.2.5") + self.requires("libiconv/1.17") + + def package_id(self): + del self.info.settings.compiler + self.info.requires.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=self.source_folder) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + # Turn off static library detection, which is on by default on Windows. + # This keeps the CMakeLists.txt from trying to detect static Boost + # libraries and use Boost components for zlib and BZip2. Getting the + # libraries via Conan does the correct thing without other assistance. + tc.variables["USE_STATIC_LIBS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + os.remove(os.path.join(self.source_folder, 'cmake', 'FindLZMA.cmake')) + os.remove(os.path.join(self.source_folder, 'cmake', 'Findiconv.cmake')) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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.includedirs = [] + self.cpp_info.libdirs = [] + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/recipes/innoextract/all/patches/0001-cmake-fix-module.patch b/recipes/innoextract/all/patches/0001-cmake-fix-module.patch new file mode 100644 index 0000000000000..2997e1cb0a3a5 --- /dev/null +++ b/recipes/innoextract/all/patches/0001-cmake-fix-module.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dbb64f1..a8a67e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,7 +105,7 @@ endif() + + include(CheckSymbolExists) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") # For custom cmake modules ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # For custom cmake modules + include(BuildType) + include(CompileCheck) + include(CreateSourceGroups) diff --git a/recipes/innoextract/all/patches/0002-remove-custom-cmake-find-modules.patch b/recipes/innoextract/all/patches/0002-remove-custom-cmake-find-modules.patch new file mode 100644 index 0000000000000..7c56b3841dde6 --- /dev/null +++ b/recipes/innoextract/all/patches/0002-remove-custom-cmake-find-modules.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a8a67e8..358703f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -140,10 +140,10 @@ if(USE_ARC4) + endif() + + if(USE_LZMA) +- find_package(LZMA REQUIRED) +- list(APPEND LIBRARIES ${LZMA_LIBRARIES}) +- include_directories(SYSTEM ${LZMA_INCLUDE_DIR}) +- add_definitions(${LZMA_DEFINITIONS}) ++ find_package(LibLZMA REQUIRED) ++ list(APPEND LIBRARIES ${LibLZMA_LIBRARIES}) ++ include_directories(SYSTEM ${LibLZMA_INCLUDE_DIR}) ++ add_definitions(${LibLZMA_DEFINITIONS}) + set(INNOEXTRACT_HAVE_LZMA 1) + else() + message(WARNING "\nDisabling LZMA decompression support.\n" diff --git a/recipes/innoextract/all/test_package/conanfile.py b/recipes/innoextract/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6a4e652eac543 --- /dev/null +++ b/recipes/innoextract/all/test_package/conanfile.py @@ -0,0 +1,14 @@ +from conan import ConanFile +from conan.tools.build import can_run + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type", "compiler" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("innoextract --version", env="conanrun") diff --git a/recipes/innoextract/all/test_v1_package/conanfile.py b/recipes/innoextract/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..dc77b21f20519 --- /dev/null +++ b/recipes/innoextract/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from six import StringIO +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not tools.cross_building(self): + output = StringIO() + self.run("innoextract --version", output=output, + run_environment=True) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + require_version = str(self.deps_cpp_info["innoextract"].version) + require_version = ".".join(require_version.split(".")[:2]) + self.output.info("Expected version: {}".format(require_version)) + assert_innoextract_version = "innoextract %s" % require_version + assert(assert_innoextract_version in output_str) diff --git a/recipes/innoextract/config.yml b/recipes/innoextract/config.yml new file mode 100644 index 0000000000000..95efce85442dd --- /dev/null +++ b/recipes/innoextract/config.yml @@ -0,0 +1,3 @@ +versions: + "1.9.0": + folder: "all" diff --git a/recipes/intel-neon2sse/all/conandata.yml b/recipes/intel-neon2sse/all/conandata.yml new file mode 100644 index 0000000000000..d8a2b36b77424 --- /dev/null +++ b/recipes/intel-neon2sse/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210225": + url: "https://github.com/intel/ARM_NEON_2_x86_SSE/archive/a1652fd5253afbf3e39357b012974f93511f6108.tar.gz" + sha256: "a795f7e20b7bc4cec4a23bc54af2af3333c0c4b84c4fe2479642aa391e35844f" diff --git a/recipes/intel-neon2sse/all/conanfile.py b/recipes/intel-neon2sse/all/conanfile.py new file mode 100644 index 0000000000000..a50107175e466 --- /dev/null +++ b/recipes/intel-neon2sse/all/conanfile.py @@ -0,0 +1,64 @@ +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, rmdir +from os import path + +class IntelNeon2sseConan(ConanFile): + name = "intel-neon2sse" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/intel/ARM_NEON_2_x86_SSE" + description = "Header only library intended to simplify ARM->IA32 porting" + license = "BSD-2-Clause" + topics = "neon", "sse", "port", "translation", "intrinsics" + settings = "os", "compiler", "build_type", "arch" + options = { + "SSE4": [True, False], + "disable_performance_warnings": [True, False], + } + default_options = { + "SSE4": False, + "disable_performance_warnings": False, + } + + def validate(self): + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("neon2sse only supports arch={x86,x86_64}") + + 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.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE", dst=path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, path.join(self.package_folder, "lib")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "NEON_2_SSE") + self.cpp_info.set_property("cmake_target_name", "NEON_2_SSE::NEON_2_SSE") + if self.options.SSE4: + self.cpp_info.defines.append("USE_SSE4") + if self.options.disable_performance_warnings: + self.cpp_info.defines.append("NEON2SSE_DISABLE_PERFORMANCE_WARNING") + + # TODO: remove once generators for legacy generators is no longer needed + self.cpp_info.names["cmake_find_package"] = "NEON_2_SSE" + self.cpp_info.names["cmake_find_package_multi"] = "NEON_2_SSE" diff --git a/recipes/intel-neon2sse/all/test_package/CMakeLists.txt b/recipes/intel-neon2sse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..959db15bea23b --- /dev/null +++ b/recipes/intel-neon2sse/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(NEON_2_SSE REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE NEON_2_SSE::NEON_2_SSE) diff --git a/recipes/intel-neon2sse/all/test_package/conanfile.py b/recipes/intel-neon2sse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/intel-neon2sse/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/intel-neon2sse/all/test_package/test_package.c b/recipes/intel-neon2sse/all/test_package/test_package.c new file mode 100644 index 0000000000000..32dcf22c0c202 --- /dev/null +++ b/recipes/intel-neon2sse/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +int main() +{ + uint64_t a = 0x0102030405060708; + uint64_t b = 0x0102030405060708; + union { + char c[8]; + uint64_t i; + } c; + uint8x8_t va = vcreate_u8(a); + uint8x8_t vb = vcreate_u8(b); + uint8x8_t vc = vmul_u8(va, vb); + + vst1_u8(c.c, vc); + + if (c.i != 0x0104091019243140) { + fprintf(stderr, "Wrong result\n"); + return 1; + } else { + printf("test_package ran successfully\n"); + } + + return 0; +} diff --git a/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt b/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0f78273600853 --- /dev/null +++ b/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(NEON_2_SSE REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} NEON_2_SSE::NEON_2_SSE) diff --git a/recipes/intel-neon2sse/all/test_v1_package/conanfile.py b/recipes/intel-neon2sse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5493d58611803 --- /dev/null +++ b/recipes/intel-neon2sse/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/intel-neon2sse/config.yml b/recipes/intel-neon2sse/config.yml new file mode 100644 index 0000000000000..81399ac24675e --- /dev/null +++ b/recipes/intel-neon2sse/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210225": + folder: all diff --git a/recipes/inversify-cpp/all/conandata.yml b/recipes/inversify-cpp/all/conandata.yml new file mode 100644 index 0000000000000..1d68ebc9ec1d5 --- /dev/null +++ b/recipes/inversify-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.0": + url: "https://github.com/mosure/inversify-cpp/archive/refs/tags/2.1.0.tar.gz" + sha256: "6829b45a558c7eb4e15fdc08cb0dfe3c76f708c00bbdcc06d1fcdbd0a3ef55d1" diff --git a/recipes/inversify-cpp/all/conanfile.py b/recipes/inversify-cpp/all/conanfile.py new file mode 100644 index 0000000000000..3d897954ee020 --- /dev/null +++ b/recipes/inversify-cpp/all/conanfile.py @@ -0,0 +1,50 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class InversifyCppConan(ConanFile): + name = "inversify-cpp" + description = "C++17 inversion of control and dependency injection container library" + topics = ("ioc", "container", "dependency", "injection") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mosure/inversify-cpp" + license = "MIT" + settings = "compiler" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "clang": "6", + "apple-clang": "11", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/inversify-cpp/all/test_package/CMakeLists.txt b/recipes/inversify-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fc7a3028bf1a1 --- /dev/null +++ b/recipes/inversify-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(inversify-cpp CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} inversify-cpp::inversify-cpp) + +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON +) diff --git a/recipes/inversify-cpp/all/test_package/conanfile.py b/recipes/inversify-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/inversify-cpp/all/test_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/inversify-cpp/all/test_package/test_package.cpp b/recipes/inversify-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3bf0d0cfb88a1 --- /dev/null +++ b/recipes/inversify-cpp/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include + +#include "mosure/inversify.hpp" + + +namespace inversify = mosure::inversify; + +namespace symbols { + using foo = inversify::Symbol; +} + + +int main() { + inversify::Container< + symbols::foo + > container; + + container.bind().toConstantValue(true); + + std::cout <<"working: " << container.get() << std::endl; + return 0; +} diff --git a/recipes/inversify-cpp/config.yml b/recipes/inversify-cpp/config.yml new file mode 100644 index 0000000000000..dfff490f9a9b6 --- /dev/null +++ b/recipes/inversify-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.0": + folder: all diff --git a/recipes/ios-cmake/all/cmake-wrapper b/recipes/ios-cmake/all/cmake-wrapper new file mode 100644 index 0000000000000..5cdfc4e7a0558 --- /dev/null +++ b/recipes/ios-cmake/all/cmake-wrapper @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +ALL_ARGS=$@ + +BUILD=no +for i in "$@": +do + case $i in + --build) + BUILD=yes + ;; + *) + ;; + esac +done + +if [ $BUILD == "yes" ]; then + cmake "$@" +else + # TODO check if, based on log level, some configurable outbut of these values could be nice to have + fix_cmake_flags="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=NEVER" + cmake "$@" ${CONAN_USER_CMAKE_FLAGS} ${fix_cmake_flags} +fi diff --git a/recipes/ios-cmake/all/conandata.yml b/recipes/ios-cmake/all/conandata.yml new file mode 100644 index 0000000000000..23c78241a7799 --- /dev/null +++ b/recipes/ios-cmake/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.1.2": + url: "https://github.com/leetal/ios-cmake/archive/3.1.2.zip" + sha256: "040f7de9a1b418540e1463d1c6fcd11e338ab723b9b4b660b7e7a2997f0a119b" + "4.0.0": + url: "https://github.com/leetal/ios-cmake/archive/4.0.0.zip" + sha256: "2e0dcf00cd46ae808d85666ce4ce38ecd8875925588647295d41e97c874ad0b3" + "4.1.1": + url: "https://github.com/leetal/ios-cmake/archive/4.1.1.zip" + sha256: "4011d4b363f5905041c424d11b185e99eb516c9d1c5f6d193b1d9a4b6907500e" + "4.2.0": + url: "https://github.com/leetal/ios-cmake/archive/4.2.0.zip" + sha256: "abcae0619751dd46d825f0f341d9a5c1a13bbe8fa84f9a62f09652087f64f87f" diff --git a/recipes/ios-cmake/all/conanfile.py b/recipes/ios-cmake/all/conanfile.py new file mode 100644 index 0000000000000..e082576dcdc11 --- /dev/null +++ b/recipes/ios-cmake/all/conanfile.py @@ -0,0 +1,149 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +import os + + +class IosCMakeConan(ConanFile): + name = "ios-cmake" + license = "BSD-3-Clause" + settings = "os" , "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/leetal/ios-cmake" + options = { + "enable_bitcode": [True, False], + "enable_arc": [True, False], + "enable_visibility": [True, False], + "enable_strict_try_compile": [True, False], + "toolchain_target": ["auto", "OS", "OS64", "OS64COMBINED", + "SIMULATOR", "SIMULATOR64", "SIMULATORARM64", + "TVOS", "TVOSCOMBINED", + "SIMULATOR_TVOS", "WATCHOS", + "WATCHOSCOMBINED", "SIMULATOR_WATCHOS", + "MAC", "MAC_ARM64", "MAC_CATALYST", "MAC_CATALYST_ARM64"] + } + default_options = { + "enable_bitcode": True, + "enable_arc": True, + "enable_visibility": False, + "enable_strict_try_compile": False, + "toolchain_target": "auto", + } + description = "ios Cmake toolchain to (cross) compile macOS/iOS/watchOS/tvOS" + topics = "conan", "apple", "ios", "cmake", "toolchain", "ios", "tvos", "watchos" + exports_sources = "cmake-wrapper" + + @property + def _source_subfolder(self): + return os.path.join(self.source_folder, "source_subfolder") + + @staticmethod + def _chmod_plus_x(filename): + if os.name == 'posix': + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def configure(self): + if not tools.is_apple_os(self.settings.os): + raise ConanInvalidConfiguration("This package only supports Apple operating systems") + + def _guess_toolchain_target(self, os, arch): + if os == "iOS": + if arch in ["armv8", "armv8.3"]: + return "OS64" + if arch == "x86_64": + return "SIMULATOR64" + # 32bit is dead, don't care + elif os == "watchOS": + if arch == "x86_64": + return "SIMULATOR_WATCHOS" + else: + return "WATCHOS" + elif os == "tvOS": + if arch == "x86_64": + return "TVOS" + else: + return "SIMULATOR_TVOS" + raise ConanInvalidConfiguration("Can not guess toolchain_target. Please set the option explicit (or check our os settings)") + + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("ios-cmake-{}".format(self.version), self._source_subfolder) + + def build(self): + pass # there is nothing to build + + def package(self): + self.copy("cmake-wrapper", dst="bin") + self.copy("ios.toolchain.cmake", + src=self._source_subfolder, + dst=os.path.join("lib", "cmake", "ios-cmake"), + keep_path=False) + self._chmod_plus_x(os.path.join(self.package_folder, "bin", "cmake-wrapper")) + + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder, keep_path=False) + # satisfy KB-H014 (header_only recipes require headers) + tools.save(os.path.join(self.package_folder, "include", "dummy_header.h"), "\n") + + def package_info(self): + if self.settings.os == "Macos": + if not getattr(self, "settings_target", None): + # not a build_require , but can be fine since its build as a ppr:b, but nothing to do + return + # this is where I want to be, expecting this as a build_require for a host + target_os = str(self.settings_target.os) + arch_flag = self.settings_target.arch + target_version= self.settings_target.os.version + elif self.settings.os == "iOS": # old style 1 profile, don't use + target_os = str(self.settings.os) + arch_flag = self.settings.arch + target_version = self.settings.os.version + else: + #hackingtosh ? hu + raise ConanInvalidConfiguration("Building for iOS on a non Mac platform? Please tell me how!") + + if self.options.toolchain_target == "auto": + toolchain_target = self._guess_toolchain_target(target_os, arch_flag) + else: + toolchain_target = self.options.toolchain_target + + + if arch_flag == "armv8": + arch_flag = "arm64" + elif arch_flag == "armv8.3": + arch_flag = "arm64e" + + cmake_options = "-DENABLE_BITCODE={} -DENABLE_ARC={} -DENABLE_VISIBILITY={} -DENABLE_STRICT_TRY_COMPILE={}".format( + self.options.enable_bitcode, + self.options.enable_arc, + self.options.enable_visibility, + self.options.enable_strict_try_compile + ) + # Note that this, as long as we specify (overwrite) the ARCHS, PLATFORM has just limited effect, + # but PLATFORM need to be set in the profile so it makes sense, see ios-cmake docs for more info + cmake_flags = "-DPLATFORM={} -DDEPLOYMENT_TARGET={} -DARCHS={} {}".format( + toolchain_target, target_version, arch_flag, cmake_options + ) + + self.env_info.CONAN_USER_CMAKE_FLAGS = cmake_flags + self.output.info("Setting toolchain options to: {}".format(cmake_flags)) + cmake_wrapper = os.path.join(self.package_folder, "bin", "cmake-wrapper") + self.output.info("Setting CONAN_CMAKE_PROGRAM to: {}".format(cmake_wrapper)) + self.env_info.CONAN_CMAKE_PROGRAM = cmake_wrapper + tool_chain = os.path.join(self.package_folder, + "lib", + "cmake", + "ios-cmake", + "ios.toolchain.cmake") + self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = tool_chain + # add some more env_info, for the case users generate a toolchain file via conan and want to access that info + self.env_info.CONAN_ENABLE_BITCODE_FLAG = str(self.options.enable_bitcode) + self.env_info.CONAN_ENABLE_ARC_FLAG = str(self.options.enable_arc) + self.env_info.CONAN_ENABLE_VISIBILITY_FLAG = str(self.options.enable_visibility) + self.env_info.CONAN_ENABLE_STRICT_TRY_COMPILE_FLAG = str(self.options.enable_strict_try_compile) + # the rest should be exported from profile info anyway + + def package_id(self): + self.info.header_only() + # TODO , since we have 2 profiles I am not sure that this is still required + # since this will always be / has to be a build profile diff --git a/recipes/ios-cmake/all/test_package/conanfile.py b/recipes/ios-cmake/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d17672988e89a --- /dev/null +++ b/recipes/ios-cmake/all/test_package/conanfile.py @@ -0,0 +1,14 @@ + +import os +from conans import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os" + + def test(self): + if self.settings.os == "iOS": + cmake_prog = os.environ.get("CONAN_CMAKE_PROGRAM") + toolchain = os.environ.get("CONAN_CMAKE_TOOLCHAIN_FILE") + assert (os.path.basename(cmake_prog) == "cmake-wrapper") + assert (os.path.basename(toolchain) == "ios.toolchain.cmake") diff --git a/recipes/ios-cmake/config.yml b/recipes/ios-cmake/config.yml new file mode 100644 index 0000000000000..ff109c746b106 --- /dev/null +++ b/recipes/ios-cmake/config.yml @@ -0,0 +1,9 @@ +versions: + "3.1.2": + folder: all + "4.0.0": + folder: all + "4.1.1": + folder: all + "4.2.0": + folder: all diff --git a/recipes/iqa/all/CMakeLists.txt b/recipes/iqa/all/CMakeLists.txt new file mode 100644 index 0000000000000..04c167a387fc1 --- /dev/null +++ b/recipes/iqa/all/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(MSVC AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +file(GLOB IQA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/source/*.c) +file(GLOB IQA_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/include/*.h) + +add_library(iqa ${IQA_SOURCES}) +target_include_directories(iqa PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/include) + +install(TARGETS iqa + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +install(FILES ${IQA_HEADERS} DESTINATION include) diff --git a/recipes/iqa/all/conandata.yml b/recipes/iqa/all/conandata.yml new file mode 100644 index 0000000000000..fea97f220c41f --- /dev/null +++ b/recipes/iqa/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20181227": + url: "https://github.com/tjdistler/iqa/archive/0559a8ff2acd9746864975834d35be6892cc9801.tar.gz" + sha256: "394e549585c10eb618c918d47961e5d4ed596c20e8c9745fad9e0829ce254c25" diff --git a/recipes/iqa/all/conanfile.py b/recipes/iqa/all/conanfile.py new file mode 100644 index 0000000000000..1f64617c87676 --- /dev/null +++ b/recipes/iqa/all/conanfile.py @@ -0,0 +1,77 @@ +import os +import glob +from conans import ConanFile, CMake, tools + + +class IqaConan(ConanFile): + name = "iqa" + description = "Image Quality Analysis Library" + license = "BSD-3-Clause" + topics = ("conan", "iqa", "image", "quality", "analysis") + homepage = "https://github.com/tjdistler/iqa" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob('iqa-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def _extract_license(self): + content_lines = open(os.path.join(self._source_subfolder, "include", "iqa.h")).readlines() + license_content = [] + for i in range(1, 31): + license_content.append(content_lines[i][3:-1]) + tools.save("LICENSE", "\n".join(license_content)) + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self._extract_license() + self.copy("LICENSE", dst="licenses") + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] diff --git a/recipes/iqa/all/test_package/CMakeLists.txt b/recipes/iqa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..094a38e418f47 --- /dev/null +++ b/recipes/iqa/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.c) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/iqa/all/test_package/conanfile.py b/recipes/iqa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02bdaace3b783 --- /dev/null +++ b/recipes/iqa/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/iqa/all/test_package/test_package.c b/recipes/iqa/all/test_package/test_package.c new file mode 100644 index 0000000000000..0c6aec87314e1 --- /dev/null +++ b/recipes/iqa/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include "math_utils.h" + +int main() { + _max(0, 1); + return 0; +} diff --git a/recipes/iqa/config.yml b/recipes/iqa/config.yml new file mode 100644 index 0000000000000..97e9355b0de2e --- /dev/null +++ b/recipes/iqa/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "cci.20181227": + folder: all diff --git a/recipes/irrxml/all/CMakeLists.txt b/recipes/irrxml/all/CMakeLists.txt new file mode 100644 index 0000000000000..f6e0593393ea8 --- /dev/null +++ b/recipes/irrxml/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.4) +project(IrrXML LANGUAGES CXX) + +include(GNUInstallDirs) + +add_library(IrrXML ${IRRXML_SRC_DIR}/src/irrXML.cpp) +set_target_properties(IrrXML PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + PUBLIC_HEADER ${IRRXML_SRC_DIR}/src/irrXML.h +) +if(MSVC) + target_compile_definitions(IrrXML PRIVATE _SCL_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS) +endif() + +install(TARGETS IrrXML + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/irrxml/all/conandata.yml b/recipes/irrxml/all/conandata.yml new file mode 100644 index 0000000000000..05fd6b5cd1356 --- /dev/null +++ b/recipes/irrxml/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.2": + url: "http://prdownloads.sourceforge.net/irrlicht/irrxml-1.2.zip" + sha256: "9b4f80639b2dee3caddbf75862389de684747df27bea7d25f96c7330606d7079" +patches: + "1.2": + - patch_file: patches/1.2/irrtypes_debug_vs.patch diff --git a/recipes/irrxml/all/conanfile.py b/recipes/irrxml/all/conanfile.py new file mode 100644 index 0000000000000..3cde0e710bef6 --- /dev/null +++ b/recipes/irrxml/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, save +import os + +required_conan_version = ">=1.53.0" + + +class IrrXMLConan(ConanFile): + name = "irrxml" + license = "ZLIB" + homepage = "http://www.ambiera.com/irrxml" + url = "https://github.com/conan-io/conan-center-index" + description = "irrXML is a simple and fast open source xml parser for C++" + topics = ("xml", "xml-parser", "parser", "xml-reader") + + 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, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def 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["IRRXML_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + header = load(self, os.path.join(self.source_folder, "src", "irrXML.h")) + license_contents = header[header.find(r"\section license License")+25:header.find(r"\section history", 1)] + return license_contents + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["IrrXML"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/irrxml/all/patches/1.2/irrtypes_debug_vs.patch b/recipes/irrxml/all/patches/1.2/irrtypes_debug_vs.patch new file mode 100644 index 0000000000000..d0b135a87fb13 --- /dev/null +++ b/recipes/irrxml/all/patches/1.2/irrtypes_debug_vs.patch @@ -0,0 +1,24 @@ +diff --git a/src/irrTypes.h b/src/irrTypes.h +index aa2254d..280333a 100644 +--- a/src/irrTypes.h ++++ b/src/irrTypes.h +@@ -5,6 +5,10 @@ + #ifndef __IRR_TYPES_H_INCLUDED__ + #define __IRR_TYPES_H_INCLUDED__ + ++#if defined(WIN32) && defined(_MSC_VER) ++#include ++#endif ++ + namespace irr + { + +@@ -80,7 +84,7 @@ typedef unsigned short wchar_t; + + //! define a break macro for debugging only in Win32 mode. + #if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG) +-#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3} ++#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) { DebugBreak(); } + #else + #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) + #endif diff --git a/recipes/irrxml/all/test_package/CMakeLists.txt b/recipes/irrxml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6dc6a05d353a3 --- /dev/null +++ b/recipes/irrxml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(irrxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE irrxml::irrxml) diff --git a/recipes/irrxml/all/test_package/conanfile.py b/recipes/irrxml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6ae908895e238 --- /dev/null +++ b/recipes/irrxml/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xml_path = os.path.join(self.source_folder, "config.xml") + self.run(f"{bin_path} {xml_path}", env="conanrun") diff --git a/recipes/irrxml/all/test_package/config.xml b/recipes/irrxml/all/test_package/config.xml new file mode 100644 index 0000000000000..7f67079e90ada --- /dev/null +++ b/recipes/irrxml/all/test_package/config.xml @@ -0,0 +1,26 @@ +?xml version="1.0"?> + + + +Welcome to the Mesh Viewer of the "Irrlicht Engine". This program is able to load and display all 3D geometry and models, the Irrlicht Engine can. + +Controls: +- Left mouse to rotate +- Right mouse to move +- Both buttons to zoom + +Supported formats are: +- 3D Studio (.3ds) +- Cartography shop 4 (.csm) +- DirectX (.x) +- Maya (.obj) +- Milkshape (.ms3d) +- My3D (.my3D) +- OCT (.oct) +- Pulsar LMTools (.lmts) +- Quake 3 levels (.bsp) +- Quake 2 models (.md2) + +Please note that this program is also a demo of the user interface capabilities of the engine, so for example the combo box in the toolbar has no function. + + diff --git a/recipes/irrxml/all/test_package/test_package.cpp b/recipes/irrxml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d998e7474f7dc --- /dev/null +++ b/recipes/irrxml/all/test_package/test_package.cpp @@ -0,0 +1,45 @@ +#include + +#include +#include // we use STL strings to store data in this example +#include + +int main(int argc, char const* argv[]) +{ + if (argc != 2) { + std::cerr << "usage: " << argv[0] << " " << std::endl; + return 1; + } + + irr::io::IrrXMLReader* xml = irr::io::createIrrXMLReader(argv[1]); + + // strings for storing the data we want to get out of the file + std::string modelFile; + std::string messageText; + std::string caption; + + // parse the file until end reached + while(xml && xml->read()) + { + switch(xml->getNodeType()) + { + case irr::io::EXN_TEXT: + // in this xml file, the only text which occurs is the messageText + messageText = xml->getNodeData(); + break; + case irr::io::EXN_ELEMENT: + { + if (!strcmp("startUpModel", xml->getNodeName())) + modelFile = xml->getAttributeValue("file"); + else + if (!strcmp("messageText", xml->getNodeName())) + caption = xml->getAttributeValue("caption"); + } + break; + } + } + + // delete the xml parser after usage + delete xml; + return 0; +} diff --git a/recipes/irrxml/all/test_v1_package/CMakeLists.txt b/recipes/irrxml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/irrxml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/irrxml/all/test_v1_package/conanfile.py b/recipes/irrxml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..433191cd50991 --- /dev/null +++ b/recipes/irrxml/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "config.xml") + self.run(f"{bin_path} {xml_path}", run_environment=True) diff --git a/recipes/irrxml/config.yml b/recipes/irrxml/config.yml new file mode 100644 index 0000000000000..a0777b5aa931c --- /dev/null +++ b/recipes/irrxml/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2": + folder: all diff --git a/recipes/isa-l/all/conandata.yml b/recipes/isa-l/all/conandata.yml new file mode 100644 index 0000000000000..3f7141d8278ab --- /dev/null +++ b/recipes/isa-l/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.30.0": + url: "https://github.com/intel/isa-l/archive/refs/tags/v2.30.0.tar.gz" + sha256: "bcf592c04fdfa19e723d2adf53d3e0f4efd5b956bb618fed54a1108d76a6eb56" diff --git a/recipes/isa-l/all/conanfile.py b/recipes/isa-l/all/conanfile.py new file mode 100644 index 0000000000000..56f45edf048a4 --- /dev/null +++ b/recipes/isa-l/all/conanfile.py @@ -0,0 +1,72 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.33.0" + +class LibisalConan(ConanFile): + name = "isa-l" + description = "Intel's Intelligent Storage Acceleration Library" + license = "BSD-3" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/intel/isa-l" + topics = ("isa-l", "compression") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC" :True + } + build_requires = ( + "libtool/2.4.6", + "nasm/2.15.05", + ) + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.arch not in [ "x86", "x86_64", "armv8" ]: + raise ConanInvalidConfiguration("CPU Architecture not supported") + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("Only Linux and FreeBSD builds are supported") + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + with tools.chdir(self._source_subfolder): + self.run("./autogen.sh") + env_build = AutoToolsBuildEnvironment(self) + extra_args = list() + if self.options.shared: + extra_args.extend(('--enable-static=no',)) + else: + extra_args.extend(('--enable-shared=no',)) + env_build.configure(".", args=extra_args, build=False, host=False, target=False) + env_build.make() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("*/isa-l.h", dst="include/isa-l", keep_path=False) + self.copy("*.h", dst="include/isa-l", src="%s/include" % (self._source_subfolder) , keep_path=False) + if self.options.shared: + self.copy("*.dll", dst="bin", keep_path=False) + self.copy("*.so*", dst="lib", keep_path=False, symlinks=True) + self.copy("*.dylib", dst="lib", keep_path=False) + else: + self.copy("*.a", dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/isa-l/all/test_package/CMakeLists.txt b/recipes/isa-l/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/isa-l/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/isa-l/all/test_package/conanfile.py b/recipes/isa-l/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e1f2192537436 --- /dev/null +++ b/recipes/isa-l/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from conans import ConanFile, CMake, tools, RunEnvironment +from conan.tools.build import cross_building +import os +import subprocess +import re + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/isa-l/all/test_package/test_package.cpp b/recipes/isa-l/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..56025fdcff25a --- /dev/null +++ b/recipes/isa-l/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +const uint16_t init_crc_16 = 0x8005; + +uint16_t getIsalCrc16 (unsigned char *buf, uint64_t len) { + return crc16_t10dif(init_crc_16, buf, len); +} + +int main(void) { + unsigned char buf[] = "32311E333530"; + if ( getIsalCrc16(buf, 12) != 0xb4c9 ) { + std::cout << "Failed to install ISA-L\n"; + return -1; + } + std::cout << "Success\n"; + return 0; +} diff --git a/recipes/isa-l/config.yml b/recipes/isa-l/config.yml new file mode 100644 index 0000000000000..ebe8d6f743f65 --- /dev/null +++ b/recipes/isa-l/config.yml @@ -0,0 +1,3 @@ +versions: + "2.30.0": + folder: all diff --git a/recipes/isl/all/conandata.yml b/recipes/isl/all/conandata.yml new file mode 100644 index 0000000000000..cf2c5f3fb54ee --- /dev/null +++ b/recipes/isl/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.24": + url: "https://libisl.sourceforge.io/isl-0.24.tar.gz" + sha256: "26e6e4d60ad59b3fff9948eb36743f0c874e124e410ef5bab930d0f546bc580d" + "0.23": + url: "https://libisl.sourceforge.io/isl-0.23.tar.gz" + sha256: "19e77cb562ab3da5a37f263208d6f902ae3a9d52c756bf6eb1a6b2f8a74b883c" + "0.22": + url: "https://libisl.sourceforge.io/isl-0.22.tar.gz" + sha256: "d0c6714e4427d3eb964388afe526a8e0f69687da7e944f1ad66ffa639923be46" diff --git a/recipes/isl/all/conanfile.py b/recipes/isl/all/conanfile.py new file mode 100644 index 0000000000000..139d5fc0036f3 --- /dev/null +++ b/recipes/isl/all/conanfile.py @@ -0,0 +1,133 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from contextlib import contextmanager +import os + +required_conan_version = ">=1.33.0" + + +class IslConan(ConanFile): + name = "isl" + description = "isl is a library for manipulating sets and relations of integer points bounded by linear constraints." + topics = ("isl", "integer", "set", "library") + license = "MIT" + homepage = "https://libisl.sourceforge.io" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_int": ["gmp", "imath", "imath-32"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_int": "gmp", + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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 self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("Apple M1 is not yet supported. Contributions are welcome") + if self.options.with_int != "gmp": + # FIXME: missing imath recipe + raise ConanInvalidConfiguration("imath is not (yet) available on cci") + if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < 16 and self.settings.compiler.runtime == "MDd": + # gmp.lib(bdiv_dbm1c.obj) : fatal error LNK1318: Unexpected PDB error; OK (0) + raise ConanInvalidConfiguration("isl fails to link with this version of visual studio and MDd runtime") + + def requirements(self): + if self.options.with_int == "gmp": + self.requires("gmp/6.2.1") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + if self.settings.compiler == "Visual Studio": + self.build_requires("automake/1.16.4") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + env = { + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "CC": "{} cl -nologo -{}".format(tools.unix_path(self.deps_user_info["automake"].compile), self.settings.compiler.runtime), + "CXX": "{} cl -nologo -{}".format(tools.unix_path(self.deps_user_info["automake"].compile), self.settings.compiler.runtime), + "NM": "dumpbin -symbols", + "OBJDUMP": ":", + "RANLIB": ":", + "STRIP": ":", + } + with tools.environment_append(env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + yes_no = lambda v: "yes" if v else "no" + conf_args = [ + "--with-int={}".format(self.options.with_int), + "--enable-portable-binary", + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-static={}".format(yes_no(not self.options.shared)), + ] + if self.options.with_int == "gmp": + conf_args.extend([ + "--with-gmp=system", + "--with-gmp-prefix={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), + ]) + if self.settings.compiler == "Visual Studio": + if tools.Version(self.settings.compiler.version) >= 15: + self._autotools.flags.append("-Zf") + if tools.Version(self.settings.compiler.version) >= 12: + self._autotools.flags.append("-FS") + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + + os.unlink(os.path.join(os.path.join(self.package_folder, "lib", "libisl.la"))) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "isl" + self.cpp_info.libs = ["isl"] diff --git a/recipes/isl/all/test_package/CMakeLists.txt b/recipes/isl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a403dc404b41 --- /dev/null +++ b/recipes/isl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/isl/all/test_package/conanfile.py b/recipes/isl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/isl/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/isl/all/test_package/test_package.c b/recipes/isl/all/test_package/test_package.c new file mode 100644 index 0000000000000..f10646fe56f25 --- /dev/null +++ b/recipes/isl/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "isl/ctx.h" + + +int main() { + isl_ctx *ctx = isl_ctx_alloc(); + + isl_ctx_free(ctx); + return 0; +} diff --git a/recipes/isl/config.yml b/recipes/isl/config.yml new file mode 100644 index 0000000000000..e0fa5e44a1f96 --- /dev/null +++ b/recipes/isl/config.yml @@ -0,0 +1,7 @@ +versions: + "0.24": + folder: "all" + "0.23": + folder: "all" + "0.22": + folder: "all" diff --git a/recipes/iso8601lib/all/conandata.yml b/recipes/iso8601lib/all/conandata.yml new file mode 100644 index 0000000000000..8eea2b2330999 --- /dev/null +++ b/recipes/iso8601lib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230123": + url: "https://github.com/TimSC/iso8601lib/archive/7a0cd0ff1bffd3f7a436e25860f5b461f4c35dc6.zip" + sha256: "2d6363eda2ec958bd7da735ca9520d658df11666326e96f20f278db565b9af73" diff --git a/recipes/iso8601lib/all/conanfile.py b/recipes/iso8601lib/all/conanfile.py new file mode 100644 index 0000000000000..76c226dbda05f --- /dev/null +++ b/recipes/iso8601lib/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.files import get, copy, collect_libs +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + + +class Iso8601LibConan(ConanFile): + name = "iso8601lib" + description = "Parsing a subset of ISO 8601 datetimes, dates and times in C." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TimSC/iso8601lib" + topics = ("iso8601", "date", "time", "timezone") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + + self.cpp_info.defines.append("ISO8601LIB_EXPORT") diff --git a/recipes/iso8601lib/all/test_package/CMakeLists.txt b/recipes/iso8601lib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1b48f1b1d59ba --- /dev/null +++ b/recipes/iso8601lib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(iso8601lib REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE iso8601lib::iso8601lib) diff --git a/recipes/iso8601lib/all/test_package/conanfile.py b/recipes/iso8601lib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/iso8601lib/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/iso8601lib/all/test_package/test_package.cpp b/recipes/iso8601lib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65ca7d176e2f7 --- /dev/null +++ b/recipes/iso8601lib/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include "iso8601.h" + +int main(void) +{ + const char* dateTime = "1997-07-16T19:20:30.45+01:00"; + + struct tm isoDateTime; + int timezoneOffsetMin; + if (ParseIso8601Datetime(dateTime, &isoDateTime, &timezoneOffsetMin)) + { + std::cout << "Year: " << isoDateTime.tm_year + 1900 << "\n"; + std::cout << "Month: " << isoDateTime.tm_mon + 1 << "\n"; + std::cout << "Day: " << isoDateTime.tm_mday << "\n"; + std::cout << "Hour: " << isoDateTime.tm_hour << "\n"; + std::cout << "Minute: " << isoDateTime.tm_min << "\n"; + std::cout << "Second: " << isoDateTime.tm_sec << "\n"; + std::cout << "Timezone offset: " << timezoneOffsetMin << "\n"; + } + else + { + std::cout << "Could not parse datetime " << dateTime << "\n"; + } + return EXIT_SUCCESS; +} diff --git a/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt b/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/iso8601lib/all/test_v1_package/conanfile.py b/recipes/iso8601lib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/iso8601lib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/iso8601lib/config.yml b/recipes/iso8601lib/config.yml new file mode 100644 index 0000000000000..0d07bd41f0619 --- /dev/null +++ b/recipes/iso8601lib/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230123": + folder: all diff --git a/recipes/itk/all/CMakeLists.txt b/recipes/itk/all/CMakeLists.txt new file mode 100644 index 0000000000000..7ae2d73951a0d --- /dev/null +++ b/recipes/itk/all/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +# conan created FindXXX.cmake modules that create IMPORTED targets +# that not have the GLOBAL option set. By requiring them here, +# these targets are visible in all the subprojects. +file(GLOB conan_modules "Find*.cmake") +message("modules: ${conan_modules}") +foreach(module ${conan_modules}) + get_filename_component(modname "${module}" NAME) + string(REGEX MATCH "^Find(.*).cmake$" modmatch "${modname}") + if(NOT modmatch) + message(FATAL_ERROR "Not a module?? ${module} (${modname})") + endif() + message(STATUS "requiring package ${CMAKE_MATCH_1}") + find_package("${CMAKE_MATCH_1}" REQUIRED) +endforeach() + +add_subdirectory(source_subfolder) diff --git a/recipes/itk/all/conandata.yml b/recipes/itk/all/conandata.yml new file mode 100644 index 0000000000000..3cb9b81826a59 --- /dev/null +++ b/recipes/itk/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "5.1.2": + url: "https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.1.2/InsightToolkit-5.1.2.tar.gz" + sha256: "f1e5a78e11125348f68f655c6b89b617c3a8b2c09f710081f621054811a70c98" + "5.1.0": + url: "https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.1.0/InsightToolkit-5.1.0.tar.gz" + sha256: "121020a1611508cec8123eb5226215598cec07be627d843a2e6b6da891e61d13" +patches: + "5.1.2": + - patch_file: "patches/0001-find-conan-packages.patch" + base_path: "source_subfolder" + "5.1.0": + - patch_file: "patches/0001-find-conan-packages.patch" + base_path: "source_subfolder" diff --git a/recipes/itk/all/conanfile.py b/recipes/itk/all/conanfile.py new file mode 100644 index 0000000000000..3c833fb68b446 --- /dev/null +++ b/recipes/itk/all/conanfile.py @@ -0,0 +1,508 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import glob +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class ITKConan(ConanFile): + name = "itk" + topics = ("itk", "scientific", "image", "processing") + homepage = "http://www.itk.org/" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + description = "Insight Segmentation and Registration Toolkit" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + short_paths = True + generators = "cmake", "cmake_find_package" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + # TODO: Some packages can be added as optional, but they are not in CCI: + # - mkl + # - vtk + # - opencv + + 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 + + def requirements(self): + self.requires("dcmtk/3.6.6") + self.requires("double-conversion/3.2.0") + self.requires("eigen/3.4.0") + self.requires("expat/2.4.8") + self.requires("fftw/3.3.9") + self.requires("gdcm/3.0.9") + self.requires("hdf5/1.12.0") + self.requires("icu/71.1") # TODO: to remove? Seems to be a transitivie dependency through dcmtk + self.requires("libjpeg/9d") + self.requires("libpng/1.6.37") + self.requires("libtiff/4.3.0") + self.requires("openjpeg/2.4.0") + self.requires("onetbb/2020.3") + self.requires("zlib/1.2.12") + + @property + def _minimum_cpp_standard(self): + return 11 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "14", + "gcc": "4.8.1", + "clang": "3.3", + "apple-clang": "9", + } + + def validate(self): + if self.options.shared and not self.options["hdf5"].shared: + raise ConanInvalidConfiguration("When building a shared itk, hdf5 needs to be shared too (or not linked to by the consumer).\n" + "This is because H5::DataSpace::ALL might get initialized twice, which will cause a H5::DataSpaceIException to be thrown).") + 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)) + + + 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) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["BUILD_EXAMPLES"] = False + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.definitions["BUILD_DOCUMENTATION"] = False + self._cmake.definitions["ITK_SKIP_PATH_LENGTH_CHECKS"] = True + + self._cmake.definitions["ITK_USE_SYSTEM_LIBRARIES"] = True + self._cmake.definitions["ITK_USE_SYSTEM_DCMTK"] = True + self._cmake.definitions["ITK_USE_SYSTEM_DOUBLECONVERSION"] = True + self._cmake.definitions["ITK_USE_SYSTEM_EIGEN"] = True + self._cmake.definitions["ITK_USE_SYSTEM_FFTW"] = True + self._cmake.definitions["ITK_USE_SYSTEM_GDCM"] = True + self._cmake.definitions["ITK_USE_SYSTEM_HDF5"] = True + self._cmake.definitions["ITK_USE_SYSTEM_ICU"] = True + self._cmake.definitions["ITK_USE_SYSTEM_JPEG"] = True + self._cmake.definitions["ITK_USE_SYSTEM_PNG"] = True + self._cmake.definitions["ITK_USE_SYSTEM_TIFF"] = True + self._cmake.definitions["ITK_USE_SYSTEM_ZLIB"] = True + + # FIXME: Missing Kwiml recipe + self._cmake.definitions["ITK_USE_SYSTEM_KWIML"] = False + # FIXME: Missing VXL recipe + self._cmake.definitions["ITK_USE_SYSTEM_VXL"] = False + self._cmake.definitions["GDCM_USE_SYSTEM_OPENJPEG"] = True + + self._cmake.definitions["ITK_BUILD_DEFAULT_MODULES"] = False + self._cmake.definitions["Module_ITKDeprecated"] = False + self._cmake.definitions["Module_ITKMINC"] = False + self._cmake.definitions["Module_ITKIOMINC"] = False + + self._cmake.definitions["Module_ITKVideoBridgeOpenCV"] = False + + self._cmake.definitions["Module_ITKDCMTK"] = True + self._cmake.definitions["Module_ITKIODCMTK"] = True + self._cmake.definitions["Module_ITKIOHDF5"] = True + self._cmake.definitions["Module_ITKIOTransformHDF5"] = False + self._cmake.definitions["Module_ITKAnisotropicSmoothing"] = True + self._cmake.definitions["Module_ITKAntiAlias"] = True + self._cmake.definitions["Module_ITKBiasCorrection"] = True + self._cmake.definitions["Module_ITKBinaryMathematicalMorphology"] = True + self._cmake.definitions["Module_ITKBioCell"] = True + self._cmake.definitions["Module_ITKClassifiers"] = True + self._cmake.definitions["Module_ITKColormap"] = True + self._cmake.definitions["Module_ITKConnectedComponents"] = True + self._cmake.definitions["Module_ITKConvolution"] = True + self._cmake.definitions["Module_ITKCurvatureFlow"] = True + self._cmake.definitions["Module_ITKDeconvolution"] = True + self._cmake.definitions["Module_ITKDeformableMesh"] = True + self._cmake.definitions["Module_ITKDenoising"] = True + self._cmake.definitions["Module_ITKDiffusionTensorImage"] = True + self._cmake.definitions["Module_ITKDisplacementField"] = True + self._cmake.definitions["Module_ITKDistanceMap"] = True + self._cmake.definitions["Module_ITKEigen"] = True + self._cmake.definitions["Module_ITKFEM"] = True + self._cmake.definitions["Module_ITKFEMRegistration"] = True + self._cmake.definitions["Module_ITKFFT"] = True + self._cmake.definitions["Module_ITKFastMarching"] = True + self._cmake.definitions["Module_ITKGIFTI"] = True + self._cmake.definitions["Module_ITKGPUAnisotropicSmoothing"] = True + self._cmake.definitions["Module_ITKGPUImageFilterBase"] = True + self._cmake.definitions["Module_ITKGPUPDEDeformableRegistration"] = True + self._cmake.definitions["Module_ITKGPURegistrationCommon"] = True + self._cmake.definitions["Module_ITKGPUSmoothing"] = True + self._cmake.definitions["Module_ITKGPUThresholding"] = True + self._cmake.definitions["Module_ITKIOCSV"] = True + self._cmake.definitions["Module_ITKIOGE"] = True + self._cmake.definitions["Module_ITKIOIPL"] = True + self._cmake.definitions["Module_ITKIOMesh"] = True + self._cmake.definitions["Module_ITKIOPhilipsREC"] = True + self._cmake.definitions["Module_ITKIORAW"] = True + self._cmake.definitions["Module_ITKIOSiemens"] = True + self._cmake.definitions["Module_ITKIOSpatialObjects"] = True + self._cmake.definitions["Module_ITKIOTransformBase"] = True + self._cmake.definitions["Module_ITKIOTransformInsightLegacy"] = True + self._cmake.definitions["Module_ITKIOTransformMatlab"] = True + self._cmake.definitions["Module_ITKIOXML"] = True + self._cmake.definitions["Module_ITKImageCompare"] = True + self._cmake.definitions["Module_ITKImageCompose"] = True + self._cmake.definitions["Module_ITKImageFeature"] = True + self._cmake.definitions["Module_ITKImageFusion"] = True + self._cmake.definitions["Module_ITKImageGradient"] = True + self._cmake.definitions["Module_ITKImageGrid"] = True + self._cmake.definitions["Module_ITKImageIntensity"] = True + self._cmake.definitions["Module_ITKImageLabel"] = True + self._cmake.definitions["Module_ITKImageSources"] = True + self._cmake.definitions["Module_ITKImageStatistics"] = True + self._cmake.definitions["Module_ITKIntegratedTest"] = True + self._cmake.definitions["Module_ITKKLMRegionGrowing"] = True + self._cmake.definitions["Module_ITKLabelMap"] = True + self._cmake.definitions["Module_ITKLabelVoting"] = True + self._cmake.definitions["Module_ITKLevelSets"] = True + self._cmake.definitions["Module_ITKLevelSetsv4"] = True + self._cmake.definitions["Module_ITKMarkovRandomFieldsClassifiers"] = True + self._cmake.definitions["Module_ITKMathematicalMorphology"] = True + self._cmake.definitions["Module_ITKMetricsv4"] = True + self._cmake.definitions["Module_ITKNarrowBand"] = True + self._cmake.definitions["Module_ITKNeuralNetworks"] = True + self._cmake.definitions["Module_ITKOptimizers"] = True + self._cmake.definitions["Module_ITKOptimizersv4"] = True + self._cmake.definitions["Module_ITKPDEDeformableRegistration"] = True + self._cmake.definitions["Module_ITKPath"] = True + self._cmake.definitions["Module_ITKPolynomials"] = True + self._cmake.definitions["Module_ITKQuadEdgeMeshFiltering"] = True + self._cmake.definitions["Module_ITKRegionGrowing"] = True + self._cmake.definitions["Module_ITKRegistrationCommon"] = True + self._cmake.definitions["Module_ITKRegistrationMethodsv4"] = True + self._cmake.definitions["Module_ITKReview"] = True + self._cmake.definitions["Module_ITKSignedDistanceFunction"] = True + self._cmake.definitions["Module_ITKSmoothing"] = True + self._cmake.definitions["Module_ITKSpatialFunction"] = True + self._cmake.definitions["Module_ITKTBB"] = True + self._cmake.definitions["Module_ITKThresholding"] = True + self._cmake.definitions["Module_ITKVideoCore"] = True + self._cmake.definitions["Module_ITKVideoFiltering"] = True + self._cmake.definitions["Module_ITKVideoIO"] = False + self._cmake.definitions["Module_ITKVoronoi"] = True + self._cmake.definitions["Module_ITKWatersheds"] = True + self._cmake.definitions["Module_ITKDICOMParser"] = True + + self._cmake.definitions["Module_ITKVTK"] = False + self._cmake.definitions["Module_ITKVtkGlue"] = False + + # Disabled on Linux (link errors) + self._cmake.definitions["Module_ITKLevelSetsv4Visualization"] = False + + # Disabled because Vxl vidl is not built anymore + self._cmake.definitions["Module_ITKVideoBridgeVXL"] = False + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, self._cmake_module_dir, "Modules")) + # Do not remove UseITK.cmake and *.h.in files + for cmake_file in glob.glob(os.path.join(self.package_folder, self._cmake_module_dir, "*.cmake")): + if os.path.basename(cmake_file) != "UseITK.cmake": + os.remove(cmake_file) + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {target:"ITK::{}".format(target) for target in self._itk_components.keys()}, + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join(self._cmake_module_dir, "conan-official-{}-targets.cmake".format(self.name)) + + @property + def _cmake_module_dir(self): + return os.path.join("lib", "cmake", self._itk_subdir) + + @property + def _itk_subdir(self): + v = tools.Version(self.version) + return "ITK-{}.{}".format(v.major, v.minor) + + @property + def _itk_components(self): + def libm(): + return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + return { + "itksys": {}, + "itkvcl": {"system_libs": libm()}, + "itkv3p_netlib": {"system_libs": libm()}, + "itkvnl": {"requires": ["itkvcl"]}, + "itkvnl_algo": {"requires": ["itkv3p_netlib", "itkvnl"]}, + "itktestlib": {"requires": ["itkvcl"]}, + "ITKVNLInstantiation": { + "requires": [ + "itkvnl_algo", "itkvnl", "itkv3p_netlib", "itkvcl", + ], + }, + "ITKCommon": { + "requires": [ + "itksys", "ITKVNLInstantiation", "eigen::eigen", + "onetbb::onetbb", "double-conversion::double-conversion", + ], + "system_libs": libm(), + }, + "itkNetlibSlatec": {"requires": ["itkv3p_netlib"]}, + "ITKStatistics": {"requires": ["ITKCommon", "itkNetlibSlatec"]}, + "ITKTransform": {"requires": ["ITKCommon"]}, + "ITKMesh": {"requires": ["ITKTransform"]}, + "ITKMetaIO": {"requires": ["zlib::zlib"]}, + "ITKSpatialObjects": {"requires": ["ITKTransform", "ITKCommon", "ITKMesh"]}, + "ITKPath": {"requires": ["ITKCommon"]}, + "ITKImageIntensity": {}, + "ITKLabelMap": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", + ], + }, + "ITKQuadEdgeMesh": {"requires": ["ITKMesh"]}, + "ITKFastMarching": {}, + "ITKIOImageBase": {"requires": ["ITKCommon"]}, + "ITKSmoothing": {}, + "ITKImageFeature": {"requires": ["ITKSmoothing", "ITKSpatialObjects"]}, + "ITKOptimizers": {"requires": ["ITKStatistics"]}, + "ITKPolynomials": {"requires": ["ITKCommon"]}, + "ITKBiasCorrection": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", + ], + }, + "ITKColormap": {}, + "ITKFFT": {"requires": ["ITKCommon", "fftw::fftw"]}, + "ITKConvolution": { + "requires": [ + "ITKFFT", "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", + ], + }, + "ITKDICOMParser": {}, + "ITKDeformableMesh": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", "ITKImageFeature", + "ITKSpatialObjects", "ITKPath", "ITKMesh", + ], + }, + "ITKDenoising": {}, + "ITKDiffusionTensorImage": {}, + "ITKIOXML": {"requires": ["ITKIOImageBase", "expat::expat"]}, + "ITKIOSpatialObjects": {"requires": ["ITKSpatialObjects", "ITKIOXML", "ITKMesh"]}, + "ITKFEM": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", + "ITKSmoothing", "ITKImageFeature", "ITKOptimizers", "ITKMetaIO", + ], + }, + "ITKPDEDeformableRegistration": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", "ITKSmoothing", + "ITKImageFeature", "ITKOptimizers", + ], + }, + "ITKFEMRegistration": { + "requires": [ + "ITKFEM", "ITKImageFeature", "ITKCommon", "ITKSpatialObjects", + "ITKTransform", "ITKPDEDeformableRegistration", + ], + }, + "ITKznz": {"requires": ["zlib::zlib"]}, + "ITKniftiio": {"requires": ["ITKznz"], "system_libs": libm()}, + "ITKgiftiio": {"requires": ["ITKznz", "ITKniftiio", "expat::expat"]}, + "ITKIOBMP": {"requires": ["ITKIOImageBase"]}, + "ITKIOBioRad": {"requires": ["ITKIOImageBase"]}, + "ITKIOCSV": {"requires": ["ITKIOImageBase"]}, + "ITKIODCMTK": {"requires": ["ITKIOImageBase", "dcmtk::dcmtk", "icu::icu"]}, + "ITKIOGDCM": {"requires": ["ITKCommon", "ITKIOImageBase", "gdcm::gdcmDICT", "gdcm::gdcmMSFF"]}, + "ITKIOIPL": {"requires": ["ITKIOImageBase"]}, + "ITKIOGE": {"requires": ["ITKIOIPL", "ITKIOImageBase"]}, + "ITKIOGIPL": {"requires": ["ITKIOImageBase", "zlib::zlib"]}, + "ITKIOHDF5": {"requires": ["ITKIOImageBase", "hdf5::hdf5"]}, + "ITKIOJPEG": {"requires": ["ITKIOImageBase", "libjpeg::libjpeg"]}, + "ITKIOMeshBase": { + "requires": [ + "ITKCommon", "ITKIOImageBase", "ITKMesh", "ITKQuadEdgeMesh", + ], + }, + "ITKIOMeshBYU": {"requires": ["ITKCommon", "ITKIOMeshBase"]}, + "ITKIOMeshFreeSurfer": {"requires": ["ITKCommon", "ITKIOMeshBase"]}, + "ITKIOMeshGifti": {"requires": ["ITKCommon", "ITKIOMeshBase", "ITKgiftiio"]}, + "ITKIOMeshOBJ": {"requires": ["ITKCommon", "ITKIOMeshBase"]}, + "ITKIOMeshOFF": {"requires": ["ITKCommon", "ITKIOMeshBase"]}, + "ITKIOMeshVTK": {"requires": ["ITKCommon", "ITKIOMeshBase", "double-conversion::double-conversion"]}, + "ITKIOMeta": {"requires": ["ITKIOImageBase", "ITKMetaIO"]}, + "ITKIONIFTI": {"requires": ["ITKIOImageBase", "ITKznz", "ITKniftiio", "ITKTransform"]}, + "ITKNrrdIO": {"requires": ["zlib::zlib"]}, + "ITKIONRRD": {"requires": ["ITKIOImageBase", "ITKNrrdIO"]}, + "ITKIOPNG": {"requires": ["ITKIOImageBase", "libpng::libpng"]}, + "ITKIOPhilipsREC": {"requires": ["zlib::zlib"]}, + "ITKIOSiemens": {"requires": ["ITKIOImageBase", "ITKIOIPL"]}, + "ITKIOStimulate": {"requires": ["ITKIOImageBase"]}, + "ITKIOTIFF": {"requires": ["ITKIOImageBase", "libtiff::libtiff"]}, + "ITKTransformFactory": {"requires": ["ITKCommon", "ITKTransform"]}, + "ITKIOTransformBase": {"requires": ["ITKCommon", "ITKTransform", "ITKTransformFactory"]}, + "ITKIOTransformHDF5": {"requires": ["ITKIOTransformBase", "hdf5::hdf5"]}, + "ITKIOTransformInsightLegacy": {"requires": ["ITKIOTransformBase", "double-conversion::double-conversion"]}, + "ITKIOTransformMatlab": {"requires": ["ITKIOTransformBase"]}, + "ITKIOVTK": {"requires": ["ITKIOImageBase"]}, + "ITKKLMRegionGrowing": {"requires": ["ITKCommon"]}, + "itklbfgs": {}, + "ITKMarkovRandomFieldsClassifiers": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", + ], + }, + "ITKOptimizersv4": {"requires": ["ITKOptimizers", "itklbfgs"]}, + "itkopenjpeg": {"header_only": True, "requires": ["openjpeg::openjpeg"]}, + "ITKQuadEdgeMeshFiltering": {"requires": ["ITKMesh"]}, + "ITKRegionGrowing": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", + ], + }, + "ITKRegistrationMethodsv4": { + "requires": [ + "ITKCommon", "ITKOptimizersv4", "ITKStatistics", "ITKTransform", + "ITKSpatialObjects", "ITKPath", "ITKSmoothing", "ITKImageFeature", + "ITKOptimizers", + ], + }, + "ITKVTK": {"requires": ["ITKCommon"]}, + "ITKWatersheds": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", "ITKSpatialObjects", + "ITKPath", "ITKSmoothing", + ], + }, + "ITKReview": { + "requires": [ + "ITKCommon", "ITKStatistics", "ITKTransform", "ITKLabelMap", + "ITKSpatialObjects", "ITKPath", "ITKFastMarching", "ITKIOImageBase", + "ITKImageFeature", "ITKOptimizers", "ITKBiasCorrection", + "ITKDeformableMesh", "ITKDiffusionTensorImage", "ITKSmoothing", + "ITKFFT", "ITKIOBMP", "ITKIOBioRad", "ITKIOGDCM", "ITKIOGE", + "ITKIOGIPL", "ITKIOIPL", "ITKIOJPEG", "ITKIOMeta", "ITKIONIFTI", + "ITKIONRRD", "ITKIOPNG", "ITKIOSiemens", "ITKIOStimulate", "ITKIOTIFF", + "ITKIOTransformHDF5", "ITKIOTransformInsightLegacy", + "ITKIOTransformMatlab", "ITKIOVTK", "ITKIOXML", "ITKKLMRegionGrowing", + "ITKMarkovRandomFieldsClassifiers", "ITKMesh", "ITKPDEDeformableRegistration", + "ITKPolynomials", "ITKQuadEdgeMesh", "ITKQuadEdgeMeshFiltering", + "ITKRegionGrowing", "ITKVTK", "ITKWatersheds", "itkopenjpeg", + ], + }, + "ITKTestKernel": { + "requires": [ + "ITKCommon", "ITKIOImageBase", "ITKIOBMP", "ITKIOGDCM", "ITKIOGIPL", + "ITKIOJPEG", "ITKIOMeshBYU", "ITKIOMeshFreeSurfer", "ITKIOMeshGifti", + "ITKIOMeshOBJ", "ITKIOMeshOFF", "ITKIOMeshVTK", "ITKIOMeta", "ITKIONIFTI", + "ITKIONRRD", "ITKIOPNG", "ITKIOTIFF", "ITKIOVTK", + ], + }, + "ITKVideoCore": {"requires": ["ITKCommon"]}, + } + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ITK") + self.cpp_info.set_property("cmake_build_modules", [os.path.join(self._cmake_module_dir, "UseITK.cmake")]) + + itk_version = tools.Version(self.version) + lib_suffix = "-{}.{}".format(itk_version.major, itk_version.minor) + + for name, values in self._itk_components.items(): + is_header_only = values.get("header_only", False) + system_libs = values.get("system_libs", []) + requires = values.get("requires", []) + self.cpp_info.components[name].set_property("cmake_target_name", name) + self.cpp_info.components[name].builddirs.append(self._cmake_module_dir) + self.cpp_info.components[name].includedirs.append(os.path.join("include", self._itk_subdir)) + if not is_header_only: + self.cpp_info.components[name].libs = ["{}{}".format(name, lib_suffix)] + self.cpp_info.components[name].system_libs = system_libs + self.cpp_info.components[name].requires = requires + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[name].names["cmake_find_package"] = name + self.cpp_info.components[name].names["cmake_find_package_multi"] = name + self.cpp_info.components[name].build_modules.append(os.path.join(self._cmake_module_dir, "UseITK.cmake")) + self.cpp_info.components[name].build_modules["cmake_find_package"].append(self._module_file_rel_path) + self.cpp_info.components[name].build_modules["cmake_find_package_multi"].append(self._module_file_rel_path) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "ITK" + self.cpp_info.names["cmake_find_package_multi"] = "ITK" diff --git a/recipes/itk/all/patches/0001-find-conan-packages.patch b/recipes/itk/all/patches/0001-find-conan-packages.patch new file mode 100644 index 0000000000000..7cd839b147933 --- /dev/null +++ b/recipes/itk/all/patches/0001-find-conan-packages.patch @@ -0,0 +1,172 @@ +--- Modules/ThirdParty/Eigen3/itk-module-init.cmake ++++ Modules/ThirdParty/Eigen3/itk-module-init.cmake +@@ -1,3 +1,3 @@ + if(ITK_USE_SYSTEM_EIGEN) +- find_package(Eigen3 REQUIRED CONFIG) ++ find_package(Eigen3 REQUIRED) + endif() +--- Modules/ThirdParty/DCMTK/itk-module-init.cmake ++++ Modules/ThirdParty/DCMTK/itk-module-init.cmake +@@ -24,7 +24,7 @@ + if(ITK_USE_SYSTEM_DCMTK) + # Use local FindDCMTK.cmake. + list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/CMake") +- find_package(DCMTK REQUIRED NO_MODULE) ++ find_package(DCMTK REQUIRED) + else(ITK_USE_SYSTEM_DCMTK) + # Copied and mofified from DCMTK/CMake/3rdparty.cmake + if(NOT DEFINED DCMTK_USE_ICU) +--- Modules/ThirdParty/Eigen3/CMakeLists.txt ++++ Modules/ThirdParty/Eigen3/CMakeLists.txt +@@ -52,9 +52,9 @@ + + if(ITK_USE_SYSTEM_EIGEN) + set(_Eigen3_SYSTEM_OR_INTERNAL "Eigen3") +- find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) +- set(Eigen3_DIR_INSTALL ${Eigen3_DIR}) +- set(Eigen3_DIR_BUILD ${Eigen3_DIR}) ++ find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED) ++ set(Eigen3_DIR_INSTALL ${Eigen3_INCLUDE_DIR}) ++ set(Eigen3_DIR_BUILD ${Eigen3_INCLUDE_DIR}) + else() + set(_Eigen3_SYSTEM_OR_INTERNAL "ITKInternalEigen3") + find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) +@@ -66,7 +66,7 @@ + # Eigen3 is header only, but there are compile definitions that we want to provide + # to enforce use of MPL only code, and to disable warnings. + # We only need to add the location of the header itk_eigen.h used internally. +-get_target_property(Eigen_INCLUDE_DIRS ${_eigen_itk_target} INTERFACE_INCLUDE_DIRECTORIES) ++set(Eigen_INCLUDE_DIRS ${Eigen3_INCLUDE_DIRS}) + set(ITKEigen3_INCLUDE_DIRS + ${Eigen_INCLUDE_DIRS} + ${ITKEigen3_BINARY_DIR}/src # For the generated itk_eigen.h +@@ -75,14 +75,10 @@ + # When this module is loaded by an app, load Eigen too. + # Load ITKInternalEigen3 or Eigen3 depending on ITK_USE_SYSTEM_EIGEN + set(ITKEigen3_EXPORT_CODE_INSTALL " +-set(ITK_USE_SYSTEM_EIGEN \"${ITK_USE_SYSTEM_EIGEN}\") +-set(${_Eigen3_SYSTEM_OR_INTERNAL}_DIR \"${Eigen3_DIR_INSTALL}\") +-find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) ++find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED) + ") + set(ITKEigen3_EXPORT_CODE_BUILD " +-set(ITK_USE_SYSTEM_EIGEN \"${ITK_USE_SYSTEM_EIGEN}\") +-set(${_Eigen3_SYSTEM_OR_INTERNAL}_DIR \"${Eigen3_DIR_BUILD}\") +-find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) ++find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED) + ") + + # Eigen3 targets are not installed if ITK_USE_SYSTEM_EIGEN==True +--- Modules/ThirdParty/Eigen3/src/itk_eigen.h.in ++++ Modules/ThirdParty/Eigen3/src/itk_eigen.h.in +@@ -43,10 +43,10 @@ + set(Eigen3_DIR ${ITKInternalEigen3_DIR}) + endif() + message(STATUS "From ITK: Eigen3_DIR: ${Eigen3_DIR}") +-find_package(Eigen3 REQUIRED CONFIG) ++find_package(Eigen3 REQUIRED) + add_executable(main main.cpp) + target_link_libraries(main PUBLIC ${ITK_LIBRARIES}) + target_link_libraries(main PUBLIC Eigen3::Eigen) + \endcode + * + * Then, the user can use Eigen3 as usual: +--- Modules/ThirdParty/JPEG/CMakeLists.txt ++++ Modules/ThirdParty/JPEG/CMakeLists.txt +@@ -6,13 +6,13 @@ + + if(ITK_USE_SYSTEM_JPEG) + find_package(JPEG REQUIRED) + set(ITKJPEG_INCLUDE_DIRS + ${ITKJPEG_BINARY_DIR}/src + ) + set(ITKJPEG_SYSTEM_INCLUDE_DIRS + ${JPEG_INCLUDE_DIR} + ) +- set(ITKJPEG_LIBRARIES "${JPEG_LIBRARIES}") ++ set(ITKJPEG_LIBRARIES JPEG::JPEG) + set(ITKJPEG_NO_SRC 1) + else() + set(ITKJPEG_INCLUDE_DIRS +--- Modules/ThirdParty/DoubleConversion/CMakeLists.txt ++++ Modules/ThirdParty/DoubleConversion/CMakeLists.txt +@@ -8,8 +8,8 @@ + + if(ITK_USE_SYSTEM_DOUBLECONVERSION) + find_package(double-conversion REQUIRED) +- get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES) +- get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION) ++ set(ITKDoubleConversion_INCLUDE_DIRS ${double-conversion_INCLUDE_DIRS}) ++ set(ITKDoubleConversion_LIBRARIES ${double-conversion_LIBRARIES}) + else() + set(ITKDoubleConversion_INCLUDE_DIRS + ${ITKDoubleConversion_SOURCE_DIR}/src +--- Modules/ThirdParty/Expat/CMakeLists.txt ++++ Modules/ThirdParty/Expat/CMakeLists.txt +@@ -6,9 +6,9 @@ + + if(ITK_USE_SYSTEM_EXPAT) + find_package(EXPAT REQUIRED) +- set(ITKExpat_INCLUDE_DIRS ${ITKExpat_BINARY_DIR}/src ) +- set(ITKExpat_SYSTEM_INCLUDE_DIRS "${EXPAT_INCLUDE_DIR}") +- set(ITKExpat_LIBRARIES "${EXPAT_LIBRARY}") ++ set(ITKExpat_INCLUDE_DIRS ${EXPAT_INCLUDE_DIRECTORIES}) ++ set(ITKExpat_SYSTEM_INCLUDE_DIRS ${EXPAT_INCLUDE_DIRECTORIES}) ++ set(ITKExpat_LIBRARIES EXPAT::EXPAT) + set(ITKExpat_NO_SRC 1) + else() + set(ITKExpat_INCLUDE_DIRS +--- Modules/ThirdParty/HDF5/CMakeLists.txt ++++ Modules/ThirdParty/HDF5/CMakeLists.txt +@@ -11,7 +11,9 @@ + + if(ITK_USE_SYSTEM_HDF5) +- +- if(HDF5_DIR) ++find_package(HDF5 REQUIRED) ++set(HDF5_C_SHARED_LIBRARY HDF5::HDF5) ++set(HDF5_C_STATIC_LIBRARY HDF5::HDF5) ++ if(0) + # When ITK's config is loaded, load HDF5 too. + set(ITKHDF5_EXPORT_CODE_INSTALL " + set(HDF5_DIR \"${HDF5_DIR}\") +--- Modules/ThirdParty/OpenJPEG/src/CMakeLists.txt ++++ Modules/ThirdParty/OpenJPEG/src/CMakeLists.txt +@@ -4,5 +4,8 @@ + set(ITK3P_INSTALL_RUNTIME_DIR "${ITKOpenJPEG_INSTALL_RUNTIME_DIR}") + set(ITK3P_INSTALL_LIBRARY_DIR "${ITKOpenJPEG_INSTALL_LIBRARY_DIR}") + set(ITK3P_INSTALL_ARCHIVE_DIR "${ITKOpenJPEG_INSTALL_ARCHIVE_DIR}") +-add_subdirectory(openjpeg) +-itk_module_target(itkopenjpeg NO_INSTALL) ++find_package(OpenJPEG REQUIRED) ++add_library(itkopenjpeg INTERFACE) ++set_property(TARGET itkopenjpeg PROPERTY INTERFACE_LINK_LIBRARIES openjp2) ++#target_compile_definitions(itkopenjpeg INTERFACE) ++install(TARGETS itkopenjpeg EXPORT ${ITK3P_INSTALL_EXPORT_NAME}) +--- Modules/ThirdParty/TBB/CMakeLists.txt ++++ Modules/ThirdParty/TBB/CMakeLists.txt +@@ -8,14 +8,14 @@ set(ITKTBB_NO_SRC 1) + # When this module is loaded by an app, load TBB too. + set(ITKTBB_EXPORT_CODE_INSTALL " + set(TBB_DIR \"${TBB_DIR}\") +-find_package(TBB REQUIRED CONFIG) ++find_package(TBB REQUIRED) + ") + + # When this module is configured by an app, configure TBB too. + set(ITKTBB_EXPORT_CODE_BUILD " + if(NOT ITK_BINARY_DIR) + set(TBB_DIR \"${TBB_DIR}\") +- find_package(TBB REQUIRED CONFIG) ++ find_package(TBB REQUIRED) + endif() + ") + +diff --git a/Modules/ThirdParty/TBB/itk-module-init.cmake b/Modules/ThirdParty/TBB/itk-module-init.cmake +index 1b7ee20a..0859ef33 100644 +--- a/Modules/ThirdParty/TBB/itk-module-init.cmake ++++ b/Modules/ThirdParty/TBB/itk-module-init.cmake +@@ -1,2 +1,2 @@ +-find_package(TBB REQUIRED CONFIG) # must have TBBConfig.cmake, provided since version tbb2017_20170604oss ++find_package(TBB REQUIRED) + get_target_property(TBB_INCLUDE_DIRS TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) diff --git a/recipes/itk/all/test_package/CMakeLists.txt b/recipes/itk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9c2acebbb0bb --- /dev/null +++ b/recipes/itk/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ITK REQUIRED CONFIG) +find_package(HDF5 COMPONENTS CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ITKCommon hdf5::hdf5_cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/itk/all/test_package/conanfile.py b/recipes/itk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/itk/all/test_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/itk/all/test_package/test_package.cpp b/recipes/itk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef775457ccc9c --- /dev/null +++ b/recipes/itk/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include "itkLightObject.h" + +#include +#include + +#include + +class Test : public itk::LightObject { +public: + typedef itk::SmartPointer Pointer; + static Pointer New() { return new Test(); } + const char *GetNameOfClass() { return "Test"; } +}; + +int main(int, char **) try { + //Test::Pointer test = Test::New(); + //std::cout << test->GetNameOfClass() << std::endl; + return 0; +} catch(const H5::DataSpaceIException &e) { + std::cerr << "CAUGHT\n"; + e.printErrorStack(); + return 0; +} diff --git a/recipes/itk/config.yml b/recipes/itk/config.yml new file mode 100644 index 0000000000000..989b5ee90fe13 --- /dev/null +++ b/recipes/itk/config.yml @@ -0,0 +1,5 @@ +versions: + "5.1.2": + folder: "all" + "5.1.0": + folder: "all" diff --git a/recipes/itlib/all/conandata.yml b/recipes/itlib/all/conandata.yml new file mode 100644 index 0000000000000..961e113df7bb6 --- /dev/null +++ b/recipes/itlib/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.9.1": + url: "https://github.com/iboB/itlib/archive/v1.9.1.tar.gz" + sha256: "3d87b841d85dc30fac2a5157955d685c37fd32a5ecff2e9df330b147fdc3da39" + "1.9.0": + url: "https://github.com/iboB/itlib/archive/v1.9.0.tar.gz" + sha256: "62b8c01f208a39c22462cde285dd84c60a8141cfbbc94f5fc1d991685a724228" + "1.8.3": + url: "https://github.com/iboB/itlib/archive/v1.8.3.tar.gz" + sha256: "2323e2abf5827651097c563a19d8f82c7fd222a8740ff3421681da967b59277e" + "1.8.2": + url: "https://github.com/iboB/itlib/archive/v1.8.2.tar.gz" + sha256: "2b4d206ed0de31a4e6042fada0aa7cee54c95220d98666381f0402046e95304f" + "1.8.1": + url: "https://github.com/iboB/itlib/archive/v1.8.1.tar.gz" + sha256: "7a8619073d0bbd5a5cea0ee9bb1b3b749348cbab1d12e4e0c234215f26388aef" + "1.8.0": + url: "https://github.com/iboB/itlib/archive/v1.8.0.tar.gz" + sha256: "70b6493b0cc3a720ffd48e98e3f009e8d94003380800bf07e61f167e813a9add" + "1.7.0": + url: "https://github.com/iboB/itlib/archive/v1.7.0.tar.gz" + sha256: "9a27138cfa8554eb69436bb1afacfafc5a3888b6e05f9124b2d20da7ab55b723" + "1.6.3": + url: "https://github.com/iboB/itlib/archive/v1.6.3.tar.gz" + sha256: "d2e320d9218269c421407d6df819ca0bfae3ea5bc897b341b9babaedc0b7103f" + "1.5.2": + url: "https://github.com/iboB/itlib/archive/v1.5.2.tar.gz" + sha256: "9ebff09fcdc873d2b01d8a2d0de2a7d7bd11844ef632f80ec5041f78bdc6ddec" + "1.4.5": + url: "https://github.com/iboB/itlib/archive/v1.4.5.tar.gz" + sha256: "f1d3533014433316475b6196cd2b1890bb42db1ae3059616538788712e1a33aa" + "1.3.0": + url: "https://github.com/iboB/itlib/archive/v1.3.0.tar.gz" + sha256: "d3af2ea3cf0dae63fe1e186af79562e584bfb86bf02f358cab9675662fb9b5ef" diff --git a/recipes/itlib/all/conanfile.py b/recipes/itlib/all/conanfile.py new file mode 100644 index 0000000000000..e92c4b5b3a2f4 --- /dev/null +++ b/recipes/itlib/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.50.0" + +class ItlibConan(ConanFile): + name = "itlib" + description = "A collection of small single-header C++ libraries similar to or extending the C++ standard library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/iboB/itlib" + topics = ("template", "flatmatp", "static-vector") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/itlib/all/test_package/CMakeLists.txt b/recipes/itlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..11bad027c5a7e --- /dev/null +++ b/recipes/itlib/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(itlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE itlib::itlib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/itlib/all/test_package/conanfile.py b/recipes/itlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/itlib/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/itlib/all/test_package/test_package.cpp b/recipes/itlib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65b58fcbcb286 --- /dev/null +++ b/recipes/itlib/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#include + +struct my_pod +{ + int number; +}; + +int main() +{ + itlib::pod_vector vector; + vector.insert(vector.begin(), { 10 }); + + my_pod pod = vector[0]; + std::cout << "Number is " << pod.number << std::endl; + return 0; +} diff --git a/recipes/itlib/all/test_v1_package/CMakeLists.txt b/recipes/itlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/itlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/itlib/all/test_v1_package/conanfile.py b/recipes/itlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/itlib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/itlib/config.yml b/recipes/itlib/config.yml new file mode 100644 index 0000000000000..b00faa3f0c243 --- /dev/null +++ b/recipes/itlib/config.yml @@ -0,0 +1,23 @@ +versions: + "1.9.1": + folder: all + "1.9.0": + folder: all + "1.8.3": + folder: all + "1.8.2": + folder: all + "1.8.1": + folder: all + "1.8.0": + folder: all + "1.7.0": + folder: all + "1.6.3": + folder: all + "1.5.2": + folder: all + "1.4.5": + folder: all + "1.3.0": + folder: all diff --git a/recipes/ittapi/all/conandata.yml b/recipes/ittapi/all/conandata.yml new file mode 100644 index 0000000000000..425388a0a3b63 --- /dev/null +++ b/recipes/ittapi/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.24.0": + url: "https://github.com/intel/ittapi/archive/v3.24.0.tar.gz" + sha256: "36c42d3f2446ddfaa2d7dfa02dfaa79615933f1a68a72d7e4f1d70de7b56e2c9" + "3.23.0": + url: "https://github.com/intel/ittapi/archive/v3.23.0.tar.gz" + sha256: "9af1231808c602c2f7a66924c8798b1741d3aa4b15f3874d82ca7a89b5dbb1b1" diff --git a/recipes/ittapi/all/conanfile.py b/recipes/ittapi/all/conanfile.py new file mode 100644 index 0000000000000..dc49d467bcae0 --- /dev/null +++ b/recipes/ittapi/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file +import os + +required_conan_version = ">=1.47.0" + + +class IttApiConan(ConanFile): + name = "ittapi" + license = ("BSD-3-Clause", "GPL-2.0-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/intel/ittapi" + description = ( + "The Instrumentation and Tracing Technology (ITT) API enables your application" + " to generate and control the collection of trace data during its execution" + " across different Intel tools." + ) + topics = ("itt", "ittapi", "vtune", "profiler", "profiling") + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "ptmark": [True, False], + } + default_options = { + "fPIC": True, + "ptmark": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + # We have no C++ files, so we delete unused options. + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + 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 _patch_sources(self): + # Don't force PIC + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -fPIC\")", + "" + ) + + def generate(self): + self._patch_sources() + toolchain = CMakeToolchain(self) + toolchain.variables["ITT_API_IPT_SUPPORT"] = self.options.ptmark + toolchain.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + if self.settings.os == "Windows": + copy(self, "libittnotify.lib", src=f"bin/{self.settings.build_type}", dst=os.path.join(self.package_folder, "lib")) + else: + copy(self, "libittnotify.a", src="bin", dst=os.path.join(self.package_folder, "lib")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "BSD-3-Clause.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "GPL-2.0-only.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + if self.settings.os == "Windows": + self.cpp_info.libs = ['libittnotify'] + else: + self.cpp_info.libs = ['ittnotify'] + self.cpp_info.system_libs = ['dl'] diff --git a/recipes/ittapi/all/test_package/CMakeLists.txt b/recipes/ittapi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ac9d09057495e --- /dev/null +++ b/recipes/ittapi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ittapi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ittapi::ittapi) diff --git a/recipes/ittapi/all/test_package/conanfile.py b/recipes/ittapi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/ittapi/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/ittapi/all/test_package/test_package.cpp b/recipes/ittapi/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..630124964c151 --- /dev/null +++ b/recipes/ittapi/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +// @note Domains cannot be destroyed. +__itt_domain* itt_domain = __itt_domain_create("Global Domain"); + +int main(){ + __itt_string_handle* nameHandle = __itt_string_handle_create("My name"); + __itt_task_begin(itt_domain, __itt_null, __itt_null, nameHandle); + std::cout << "Inside ITT range." << std::endl; + __itt_task_end(itt_domain); + + return 0; +} diff --git a/recipes/ittapi/all/test_v1_package/CMakeLists.txt b/recipes/ittapi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bb7640b6417bb --- /dev/null +++ b/recipes/ittapi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ittapi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ittapi::ittapi) diff --git a/recipes/ittapi/all/test_v1_package/conanfile.py b/recipes/ittapi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/ittapi/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ittapi/config.yml b/recipes/ittapi/config.yml new file mode 100644 index 0000000000000..e8e090e18ce3e --- /dev/null +++ b/recipes/ittapi/config.yml @@ -0,0 +1,5 @@ +versions: + "3.24.0": + folder: all + "3.23.0": + folder: all diff --git a/recipes/ixwebsocket/all/conandata.yml b/recipes/ixwebsocket/all/conandata.yml new file mode 100644 index 0000000000000..f9b0b0853afce --- /dev/null +++ b/recipes/ixwebsocket/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "11.4.3": + url: "https://github.com/machinezone/IXWebSocket/archive/refs/tags/v11.4.3.tar.gz" + sha256: "aa2d02c9c71339943cc61eb4efeb2ffc3a5a0011128a67027b9251b7d8a6e0ac" + "11.2.4": + url: "https://github.com/machinezone/IXWebSocket/archive/refs/tags/v11.2.4.tar.gz" + sha256: "e9d4bfc6192c5390f43a9e0534ef7e3a2821bc062a1ff8c94f80884df3b412a9" + "11.0.9": + url: "https://github.com/machinezone/IXWebSocket/archive/v11.0.9.tar.gz" + sha256: "bb355b54add3de14fa645ac9c16c49d1cd8324fdeea959a64071ca9aec64da7e" + "11.0.4": + url: "https://github.com/machinezone/IXWebSocket/archive/v11.0.4.tar.gz" + sha256: "deebfa04bd6bd930b2f7c0daba8674c8e8bc273a3d735b1877b1f4bb2c0e8596" + "10.4.0": + url: "https://github.com/machinezone/IXWebSocket/archive/v10.4.0.tar.gz" + sha256: "5bdeef08a66d3c143e7fd8b02820ed5ee5c7848e4fa043132cbeef4ea18cd326" + "10.2.5": + url: "https://github.com/machinezone/IXWebSocket/archive/v10.2.5.tar.gz" + sha256: "5db57c7327dc0764151038dc71d9ae7d9859fe3f1c182f35b4e2dfec43a5224e" + "9.6.4": + url: "https://github.com/machinezone/IXWebSocket/archive/v9.6.4.zip" + sha256: "b249b3bd0323f5b9aa4808852266f17073afd9f1f3a89815205a39604230f0ea" + "9.1.9": + url: "https://github.com/machinezone/IXWebSocket/archive/v9.1.9.zip" + sha256: "dd83b4855882b538ca9782b42e80be4ebf96f978974e2615def673fb9d58c33b" + "7.9.2": + url: "https://github.com/machinezone/IXWebSocket/archive/v7.9.2.zip" + sha256: "b5224c1dec64e25933f2dc547c278265a1b335c4516f1b11fac81f0ac99b747e" diff --git a/recipes/ixwebsocket/all/conanfile.py b/recipes/ixwebsocket/all/conanfile.py new file mode 100644 index 0000000000000..c627577a9f00e --- /dev/null +++ b/recipes/ixwebsocket/all/conanfile.py @@ -0,0 +1,153 @@ +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 collect_libs, copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class IXWebSocketConan(ConanFile): + name = "ixwebsocket" + description = "IXWebSocket is a C++ library for WebSocket client and server development" + topics = ("socket", "websocket") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/machinezone/IXWebSocket" + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tls": ["mbedtls", "openssl", "applessl", False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tls": "mbedtls", + "with_zlib": True, + } + + short_paths = True + + @property + def _min_cppstd(self): + # After version 11.0.8, IXWebSocket is fully compatible with C++ 11. + # https://github.com/machinezone/IXWebSocket/commit/ee5a2eb46ee0e109415dc02b0db85a9c76256090 + return "14" if Version(self.version) < "11.0.8" else "11" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "10.1.5": + # zlib is always required before 10.1.5 + del self.options.with_zlib + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_zlib", True): + self.requires("zlib/1.2.13") + if self.options.tls == "openssl": + self.requires("openssl/1.1.1s") + elif self.options.tls == "mbedtls": + self.requires("mbedtls/2.25.0") + + @property + def _can_use_openssl(self): + if self.settings.os == "Windows": + # Future: support for OpenSSL on Windows was introduced in 7.9.3. Earlier versions force MbedTLS + return Version(self.version) >= "7.9.3" + # The others do, by default, support OpenSSL and MbedTLS. Non-standard operating systems might + # be a challenge. + # Older versions doesn't support OpenSSL on Mac, but those are unlikely to be built now. + return True + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.options.tls == "applessl" and not is_apple_os(self): + raise ConanInvalidConfiguration("Can only use Apple SSL on Apple.") + elif not self._can_use_openssl and self.options.tls == "openssl": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support OpenSSL with Windows; use v7.9.3 or newer for this to be valid") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_TLS"] = bool(self.options.tls) + tc.variables["USE_MBED_TLS"] = self.options.tls == "mbedtls" + tc.variables["USE_OPEN_SSL"] = self.options.tls == "openssl" + # Apple configures itself if USE_TLS True, and USE_MBED_TLS + USE_OPEN_SSL False + if Version(self.version) >= "10.1.5": + tc.variables["USE_ZLIB"] = self.options.with_zlib + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Use CMake variables from MbedTLSConfig.cmake generated by conan + replace_in_file(self, cmakelists, "${MBEDTLS_INCLUDE_DIRS}", "${MbedTLS_INCLUDE_DIRS}") + replace_in_file(self, cmakelists, "${MBEDTLS_LIBRARIES}", "MbedTLS::mbedtls") + # Do not force PIC + if Version(self.version) >= "9.5.7": + replace_in_file(self, cmakelists, "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + # Allow shared + if Version(self.version) < "11.1.4": + replace_in_file(self, cmakelists, "add_library( ixwebsocket STATIC", "add_library( ixwebsocket") + if Version(self.version) < "9.8.5": + replace_in_file(self, cmakelists, + "ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib", + "ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin") + elif Version(self.version) < "11.4.3": + replace_in_file(self, cmakelists, + "ARCHIVE DESTINATION lib", + "ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin") + else: + replace_in_file(self, cmakelists, + "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}", + "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION bin") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ixwebsocket") + self.cpp_info.set_property("cmake_target_name", "ixwebsocket::ixwebsocket") + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["wsock32", "ws2_32", "shlwapi"]) + if bool(self.options.tls): + self.cpp_info.system_libs.append("crypt32") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + if self.options.get_safe("with_zlib", False): + self.cpp_info.defines.append("IXWEBSOCKET_USE_ZLIB") + if self.options.tls == "mbedtls": + self.cpp_info.defines.append("IXWEBSOCKET_USE_MBED_TLS") + elif self.options.tls == "openssl": + self.cpp_info.defines.append("IXWEBSOCKET_USE_OPEN_SSL") + elif self.options.tls == "applessl": + self.cpp_info.frameworks = ["Security", "CoreFoundation"] + self.cpp_info.defines.append("IXWEBSOCKET_USE_SECURE_TRANSPORT") diff --git a/recipes/ixwebsocket/all/test_package/CMakeLists.txt b/recipes/ixwebsocket/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba3bcd0a31277 --- /dev/null +++ b/recipes/ixwebsocket/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ixwebsocket REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ixwebsocket::ixwebsocket) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/ixwebsocket/all/test_package/conanfile.py b/recipes/ixwebsocket/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ixwebsocket/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/ixwebsocket/all/test_package/test_package.cpp b/recipes/ixwebsocket/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b23d596cddbdd --- /dev/null +++ b/recipes/ixwebsocket/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +int main() { + std::string url = "https://github.com"; + std::string protocol, host, path, query; + int port; + + bool res = ix::UrlParser::parse(url, protocol, host, path, query, port); + + std::cout + << "URL parse result: \n" + << "Protocol: " << protocol + << "\nHost: " << host + << "\nPath: " << path + << "\nQuery: " << query + << "\nPort: " << port << std::endl; +} diff --git a/recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt b/recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ixwebsocket/all/test_v1_package/conanfile.py b/recipes/ixwebsocket/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ixwebsocket/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/ixwebsocket/config.yml b/recipes/ixwebsocket/config.yml new file mode 100644 index 0000000000000..c72c054440963 --- /dev/null +++ b/recipes/ixwebsocket/config.yml @@ -0,0 +1,19 @@ +versions: + "11.4.3": + folder: all + "11.2.4": + folder: all + "11.0.9": + folder: all + "11.0.4": + folder: all + "10.4.0": + folder: all + "10.2.5": + folder: all + "9.6.4": + folder: all + "9.1.9": + folder: all + "7.9.2": + folder: all diff --git a/recipes/jansson/all/conandata.yml b/recipes/jansson/all/conandata.yml new file mode 100644 index 0000000000000..35410003207e3 --- /dev/null +++ b/recipes/jansson/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.14": + url: "https://github.com/akheron/jansson/releases/download/v2.14/jansson-2.14.tar.bz2" + sha256: "fba956f27c6ae56ce6dfd52fbf9d20254aad42821f74fa52f83957625294afb9" + "2.13.1": + url: "https://github.com/akheron/jansson/releases/download/v2.13.1/jansson-2.13.1.tar.bz2" + sha256: "ee90a0f879d2b7b7159124ff22b937a2a9a8c36d3bb65d1da7dd3f04370a10bd" + "2.12": + url: "https://github.com/akheron/jansson/releases/download/v2.12/jansson-2.12.tar.bz2" + sha256: "645d72cc5dbebd4df608d33988e55aa42a7661039e19a379fcbe5c79d1aee1d2" diff --git a/recipes/jansson/all/conanfile.py b/recipes/jansson/all/conanfile.py new file mode 100644 index 0000000000000..32444b958cc2e --- /dev/null +++ b/recipes/jansson/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class JanssonConan(ConanFile): + name = "jansson" + description = "C library for encoding, decoding and manipulating JSON data" + topics = ("json", "encoding", "decoding", "manipulation") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.digip.org/jansson/" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_urandom": [True, False], + "use_windows_cryptoapi": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_urandom": True, + "use_windows_cryptoapi": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JANSSON_BUILD_DOCS"] = False + tc.variables["JANSSON_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["JANSSON_EXAMPLES"] = False + tc.variables["JANSSON_WITHOUT_TESTS"] = True + tc.variables["USE_URANDOM"] = self.options.use_urandom + tc.variables["USE_WINDOWS_CRYPTOAPI"] = self.options.use_windows_cryptoapi + if is_msvc(self): + tc.variables["JANSSON_STATIC_CRT"] = is_msvc_static_runtime(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")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "jansson") + self.cpp_info.set_property("cmake_target_name", "jansson::jansson") + self.cpp_info.set_property("pkg_config_name", "jansson") + suffix = "_d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"jansson{suffix}"] diff --git a/recipes/jansson/all/test_package/CMakeLists.txt b/recipes/jansson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a833e6d5ed4b --- /dev/null +++ b/recipes/jansson/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(jansson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jansson::jansson) diff --git a/recipes/jansson/all/test_package/conanfile.py b/recipes/jansson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/jansson/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/jansson/all/test_package/test_package.c b/recipes/jansson/all/test_package/test_package.c new file mode 100644 index 0000000000000..f0fae99fbafb2 --- /dev/null +++ b/recipes/jansson/all/test_package/test_package.c @@ -0,0 +1,201 @@ +/* + * Simple example of parsing and printing JSON using jansson. + * + * SYNOPSIS: + * $ examples/simple_parse + * Type some JSON > [true, false, null, 1, 0.0, -0.0, "", {"name": "barney"}] + * JSON Array of 8 elements: + * JSON True + * JSON False + * JSON Null + * JSON Integer: "1" + * JSON Real: 0.000000 + * JSON Real: -0.000000 + * JSON String: "" + * JSON Object of 1 pair: + * JSON Key: "name" + * JSON String: "barney" + * + * Copyright (c) 2014 Robert Poor + * + * Jansson is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#include +#include +#include + +/* forward refs */ +void print_json(json_t *root); +void print_json_aux(json_t *element, int indent); +void print_json_indent(int indent); +const char *json_plural(int count); +void print_json_object(json_t *element, int indent); +void print_json_array(json_t *element, int indent); +void print_json_string(json_t *element, int indent); +void print_json_integer(json_t *element, int indent); +void print_json_real(json_t *element, int indent); +void print_json_true(json_t *element, int indent); +void print_json_false(json_t *element, int indent); +void print_json_null(json_t *element, int indent); + +void print_json(json_t *root) { + print_json_aux(root, 0); +} + +void print_json_aux(json_t *element, int indent) { + switch (json_typeof(element)) { + case JSON_OBJECT: + print_json_object(element, indent); + break; + case JSON_ARRAY: + print_json_array(element, indent); + break; + case JSON_STRING: + print_json_string(element, indent); + break; + case JSON_INTEGER: + print_json_integer(element, indent); + break; + case JSON_REAL: + print_json_real(element, indent); + break; + case JSON_TRUE: + print_json_true(element, indent); + break; + case JSON_FALSE: + print_json_false(element, indent); + break; + case JSON_NULL: + print_json_null(element, indent); + break; + default: + fprintf(stderr, "unrecognized JSON type %d\n", json_typeof(element)); + } +} + +void print_json_indent(int indent) { + int i; + for (i = 0; i < indent; i++) { putchar(' '); } +} + +const char *json_plural(int count) { + return count == 1 ? "" : "s"; +} + +void print_json_object(json_t *element, int indent) { + size_t size; + const char *key; + json_t *value; + + print_json_indent(indent); + size = json_object_size(element); + + printf("JSON Object of %ld pair%s:\n", size, json_plural(size)); + json_object_foreach(element, key, value) { + print_json_indent(indent + 2); + printf("JSON Key: \"%s\"\n", key); + print_json_aux(value, indent + 2); + } + +} + +void print_json_array(json_t *element, int indent) { + size_t i; + size_t size = json_array_size(element); + print_json_indent(indent); + + printf("JSON Array of %ld element%s:\n", size, json_plural(size)); + for (i = 0; i < size; i++) { + print_json_aux(json_array_get(element, i), indent + 2); + } +} + +void print_json_string(json_t *element, int indent) { + print_json_indent(indent); + printf("JSON String: \"%s\"\n", json_string_value(element)); +} + +void print_json_integer(json_t *element, int indent) { + print_json_indent(indent); + printf("JSON Integer: \"%" JSON_INTEGER_FORMAT "\"\n", json_integer_value(element)); +} + +void print_json_real(json_t *element, int indent) { + print_json_indent(indent); + printf("JSON Real: %f\n", json_real_value(element)); +} + +void print_json_true(json_t *element, int indent) { + (void)element; + print_json_indent(indent); + printf("JSON True\n"); +} + +void print_json_false(json_t *element, int indent) { + (void)element; + print_json_indent(indent); + printf("JSON False\n"); +} + +void print_json_null(json_t *element, int indent) { + (void)element; + print_json_indent(indent); + printf("JSON Null\n"); +} + +/* + * Parse text into a JSON object. If text is valid JSON, returns a + * json_t structure, otherwise prints and error and returns null. + */ +json_t *load_json(const char *text) { + json_t *root; + json_error_t error; + + root = json_loads(text, 0, &error); + + if (root) { + return root; + } else { + fprintf(stderr, "json error on line %d: %s\n", error.line, error.text); + return (json_t *)0; + } +} + +/* + * Print a prompt and return (by reference) a null-terminated line of + * text. Returns NULL on eof or some error. + */ +char *read_line(char *line, int max_chars) { + printf("Type some JSON > "); + fflush(stdout); + return fgets(line, max_chars, stdin); +} + +/* ================================================================ + * main + */ + +#define MAX_CHARS 4096 + +int main(int argc, char *argv[]) { + char line[MAX_CHARS] = "{\"conan\": \"rules\"}"; + + if (argc != 1) { + fprintf(stderr, "Usage: %s\n", argv[0]); + exit(-1); + } + + + /* parse text into JSON structure */ + json_t *root = load_json(line); + + if (root) { + /* print and release the JSON structure */ + print_json(root); + json_decref(root); + } + + return 0; +} diff --git a/recipes/jansson/all/test_v1_package/CMakeLists.txt b/recipes/jansson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/jansson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jansson/all/test_v1_package/conanfile.py b/recipes/jansson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jansson/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/jansson/config.yml b/recipes/jansson/config.yml new file mode 100644 index 0000000000000..d0ee1feed8bfc --- /dev/null +++ b/recipes/jansson/config.yml @@ -0,0 +1,7 @@ +versions: + "2.14": + folder: all + "2.13.1": + folder: all + "2.12": + folder: all diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml new file mode 100644 index 0000000000000..249c9d8054efc --- /dev/null +++ b/recipes/jasper/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "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.0.0": + - patch_file: "patches/4.0.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.0.0-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + patch_type: "conan" + - 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-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + 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" + - patch_file: "patches/2.0.33-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py new file mode 100644 index 0000000000000..86a1c7f3eefd5 --- /dev/null +++ b/recipes/jasper/all/conanfile.py @@ -0,0 +1,145 @@ +from conan import ConanFile +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, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class JasperConan(ConanFile): + name = "jasper" + license = "JasPer-2.0" + homepage = "https://jasper-software.github.io/jasper" + url = "https://github.com/conan-io/conan-center-index" + topics = ("toolkit", "coding", "jpeg", "images") + description = "JasPer Image Processing/Coding Tool Kit" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libjpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libjpeg": "libjpeg", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + 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_DOC"] = False + tc.variables["JAS_ENABLE_LATEX"] = False + tc.variables["JAS_ENABLE_PROGRAMS"] = False + tc.variables["JAS_ENABLE_SHARED"] = self.options.shared + tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" + tc.variables["JAS_ENABLE_LIBJPEG"] = bool(self.options.with_libjpeg) + if Version(self.version) >= "3.0.0": + tc.variables["JAS_ENABLE_LIBHEIF"] = False + tc.variables["JAS_ENABLE_OPENGL"] = False + + if cross_building(self): + tc.cache_variables["JAS_CROSSCOMPILING"] = True + tc.cache_variables["JAS_STDC_VERSION"] = "199901L" + + # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 + # C3I workaround to force CMake to choose the highest version of + # the windows SDK available in the system + if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + + tc.generate() + + cmakedeps = CMakeDeps(self) + cmakedeps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYRIGHT*", 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, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.settings.os == "Windows": + for dll_prefix in ["concrt", "msvcp", "vcruntime"]: + rm(self, f"{dll_prefix}*.dll", os.path.join(self.package_folder, "bin")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_file_rel_path)) + + # FIXME: Missing CMake alias variables. See https://github.com/conan-io/conan/issues/7691 + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(JASPER_FOUND TRUE) + if(DEFINED Jasper_INCLUDE_DIR) + set(JASPER_INCLUDE_DIR ${{Jasper_INCLUDE_DIR}}) + endif() + if(DEFINED Jasper_LIBRARIES) + set(JASPER_LIBRARIES ${{Jasper_LIBRARIES}}) + endif() + set(JASPER_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", "Jasper") + self.cpp_info.set_property("cmake_target_name", "Jasper::Jasper") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "jasper") + self.cpp_info.libs = ["jasper"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + self.cpp_info.requires = [] + if self.options.with_libjpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.with_libjpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "Jasper" + self.cpp_info.names["cmake_find_package_multi"] = "Jasper" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] 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 new file mode 100644 index 0000000000000..eb9d47cbbb014 --- /dev/null +++ b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch @@ -0,0 +1,24 @@ +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/2.0.33-0002-find-libjpeg.patch b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..e95e029549359 --- /dev/null +++ b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 79081c2..38b6238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,12 +244,7 @@ if (JAS_ENABLE_LIBJPEG AND JPEG_FOUND) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR}) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + include_directories(${JPEG_INCLUDE_DIR}) 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 new file mode 100644 index 0000000000000..959d169bd49ad --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch @@ -0,0 +1,24 @@ +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-0002-find-libjpeg.patch b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..47a8350d738d4 --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a0d253d..19518af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -680,12 +680,7 @@ if(JAS_ENABLE_LIBJPEG) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + set(JAS_LIBJPEG_TARGET JPEG::JPEG) 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 new file mode 100644 index 0000000000000..567ff16e021a4 --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch @@ -0,0 +1,11 @@ +--- 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.0.0-0001-skip-rpath.patch b/recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch new file mode 100644 index 0000000000000..4be85edcc1149 --- /dev/null +++ b/recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -793,19 +793,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/4.0.0-0002-find-libjpeg.patch b/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..b98de65fb7adf --- /dev/null +++ b/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -731,12 +731,7 @@ if(JAS_ENABLE_LIBJPEG) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + set(JAS_LIBJPEG_TARGET JPEG::JPEG) diff --git a/recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..d2b29d21cbd98 --- /dev/null +++ b/recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -262,7 +262,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/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7722c78a71d35 --- /dev/null +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Jasper REQUIRED) + +set(_custom_vars + JASPER_FOUND + JASPER_INCLUDE_DIR + JASPER_LIBRARIES + JASPER_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.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) diff --git a/recipes/jasper/all/test_package/conanfile.py b/recipes/jasper/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/jasper/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jasper/all/test_package/test_package.c b/recipes/jasper/all/test_package/test_package.c new file mode 100644 index 0000000000000..1391fde1806e7 --- /dev/null +++ b/recipes/jasper/all/test_package/test_package.c @@ -0,0 +1,43 @@ +#include + +#include + +int main(int argc, char **argv) +{ + int i; + jas_tmr_t tmr; + jas_tmr_t dummytmr; + double t; + int numiters; + + numiters = 2; + + jas_tmr_start(&tmr); + for (i = numiters; i > 0; --i) { + jas_tmr_start(&dummytmr); + } + jas_tmr_stop(&tmr); + t = jas_tmr_get(&tmr); + t /= numiters; + printf("jas_tmr_start %.3f us\n", t * 1e6); + + jas_tmr_start(&tmr); + for (i = numiters; i > 0; --i) { + jas_tmr_stop(&dummytmr); + } + jas_tmr_stop(&tmr); + t = jas_tmr_get(&tmr); + t /= numiters; + printf("jas_tmr_stop %.3f us\n", t * 1e6); + + t = 0; + for (i = numiters; i > 0; --i) { + jas_tmr_start(&tmr); + jas_tmr_stop(&tmr); + t += jas_tmr_get(&tmr); + } + t /= numiters; + printf("zero time %.3f us\n", t * 1e6); + + return 0; +} diff --git a/recipes/jasper/all/test_v1_package/CMakeLists.txt b/recipes/jasper/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f6b1a2f7ec79 --- /dev/null +++ b/recipes/jasper/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/jasper/all/test_v1_package/conanfile.py b/recipes/jasper/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/jasper/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml new file mode 100644 index 0000000000000..4a60a36eef3ae --- /dev/null +++ b/recipes/jasper/config.yml @@ -0,0 +1,7 @@ +versions: + "4.0.0": + folder: all + "3.0.6": + folder: all + "2.0.33": + folder: all diff --git a/recipes/jbig/all/CMakeLists.txt b/recipes/jbig/all/CMakeLists.txt new file mode 100644 index 0000000000000..d25dfd93d7dcd --- /dev/null +++ b/recipes/jbig/all/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.15) +project(jbig LANGUAGES C) + +include(GNUInstallDirs) + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +add_library(jbig + ${JBIG_SRC_DIR}/libjbig/jbig.c + ${JBIG_SRC_DIR}/libjbig/jbig_tab.c +) +target_include_directories(jbig PUBLIC ${JBIG_SRC_DIR}/libjbig) +if(MSVC AND BUILD_SHARED_LIBS) + target_compile_definitions(jbig PUBLIC _JBIGDLL_) +endif() + +install(TARGETS jbig + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${JBIG_SRC_DIR}/libjbig/jbig.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +if(BUILD_EXECUTABLES) + add_executable(pbmtojbg ${JBIG_SRC_DIR}/pbmtools/pbmtojbg.c) + target_link_libraries(pbmtojbg PRIVATE jbig) + + add_executable(jbgtopbm ${JBIG_SRC_DIR}/pbmtools/jbgtopbm.c) + target_link_libraries(jbgtopbm PRIVATE jbig) + + install(TARGETS pbmtojbg jbgtopbm DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/jbig/all/conandata.yml b/recipes/jbig/all/conandata.yml new file mode 100644 index 0000000000000..4d9eab51a4edd --- /dev/null +++ b/recipes/jbig/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "20160605": + sha256: "2669b49ee000150af7709b21c7656f1f6cbea09fd33116c40b41310adeb2b73e" + url: "https://github.com/ImageMagick/jbig/archive/5d8f5f6fa71766ced5e828bf7bfff642ddb8a6ad.zip" +patches: + "20160605": + - patch_file: patches/0001-add-missing-export.patch + - patch_file: patches/0002-fix-msvc-export.patch diff --git a/recipes/jbig/all/conanfile.py b/recipes/jbig/all/conanfile.py new file mode 100644 index 0000000000000..7e4815f880d7d --- /dev/null +++ b/recipes/jbig/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class JBigConan(ConanFile): + name = "jbig" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ImageMagick/jbig" + description = "jbig for the Windows build of ImageMagick" + topics = ("jbig", "imagemagick", "window", "graphic") + license = "GPL-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_executables": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executables": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JBIG_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BUILD_EXECUTABLES"] = self.options.build_executables + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "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 = ["jbig"] + if self.options.shared and is_msvc(self): + self.cpp_info.defines = ["_JBIGDLL_"] + + # TODO: to remove in conan v2 + if self.options.build_executables: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/jbig/all/patches/0001-add-missing-export.patch b/recipes/jbig/all/patches/0001-add-missing-export.patch new file mode 100644 index 0000000000000..2f7ab982071ca --- /dev/null +++ b/recipes/jbig/all/patches/0001-add-missing-export.patch @@ -0,0 +1,9 @@ +--- a/libjbig/jbig.h ++++ b/libjbig/jbig.h +@@ -307,5 +309,6 @@ + const unsigned char *src, unsigned char **dest, + int use_graycode); + extern JBIGEXPORT int jbg_newlen(unsigned char *bie, size_t len); ++extern JBIGEXPORT unsigned char *jbg_next_pscdms(unsigned char *p, size_t len); + + #endif /* JBG_H */ diff --git a/recipes/jbig/all/patches/0002-fix-msvc-export.patch b/recipes/jbig/all/patches/0002-fix-msvc-export.patch new file mode 100644 index 0000000000000..1e6829742e5af --- /dev/null +++ b/recipes/jbig/all/patches/0002-fix-msvc-export.patch @@ -0,0 +1,41 @@ +diff --git a/libjbig/jbig.h b/libjbig/jbig.h +index 214105a..a4f7781 100644 +--- a/libjbig/jbig.h ++++ b/libjbig/jbig.h +@@ -246,24 +246,26 @@ struct jbg_dec_state { + * Under VISUALC we have single threaded static libraries, or + * multi-threaded DLLs using the multithreaded runtime DLLs. + **/ +- +-#if defined(_MT) && defined(_DLL) && !defined(_JBIGDLL_) && !defined(_LIB) +-# define _JBIGDLL_ ++ ++#if defined(_MSC_VER) ++# if defined(jbig_EXPORTS) ++# define SHARED_EXPORT_PREFIX __declspec(dllexport) ++# else ++# define SHARED_EXPORT_PREFIX __declspec(dllimport) ++# endif ++#else ++# define SHARED_EXPORT_PREFIX + #endif + #if defined(_JBIGDLL_) +-# if defined(_VISUALC_) ++# if defined(_MSC_VER) + # pragma warning( disable : 4273 ) + # endif +-# if !defined(_JBIGLIB_) +-# define JBIGEXPORT __declspec(dllimport) +-# else +-# define JBIGEXPORT __declspec(dllexport) +-# endif ++# define JBIGEXPORT SHARED_EXPORT_PREFIX + #else + # define JBIGEXPORT + #endif + +-#if defined(_VISUALC_) ++#if defined(_MSC_VER) + # pragma warning( disable : 4018 ) + # pragma warning( disable : 4244 ) + # pragma warning( disable : 4142 ) diff --git a/recipes/jbig/all/test_package/CMakeLists.txt b/recipes/jbig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..df5582d8098ae --- /dev/null +++ b/recipes/jbig/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(jbig REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jbig::jbig) diff --git a/recipes/jbig/all/test_package/conanfile.py b/recipes/jbig/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/jbig/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/jbig/all/test_package/test_package.c b/recipes/jbig/all/test_package/test_package.c new file mode 100644 index 0000000000000..7126beec2c990 --- /dev/null +++ b/recipes/jbig/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include "jbig.h" + +int main() { + struct jbg_dec_state state; + + jbg_dec_init(&state); + jbg_dec_getplanes(&state); + jbg_dec_free(&state); + + return EXIT_SUCCESS; +} diff --git a/recipes/jbig/all/test_v1_package/CMakeLists.txt b/recipes/jbig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/jbig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jbig/all/test_v1_package/conanfile.py b/recipes/jbig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jbig/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/jbig/config.yml b/recipes/jbig/config.yml new file mode 100644 index 0000000000000..431c8d420608d --- /dev/null +++ b/recipes/jbig/config.yml @@ -0,0 +1,3 @@ +versions: + "20160605": + folder: all diff --git a/recipes/jeaiii-itoa/all/conandata.yml b/recipes/jeaiii-itoa/all/conandata.yml new file mode 100644 index 0000000000000..4d3c9e2b824e9 --- /dev/null +++ b/recipes/jeaiii-itoa/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220602": + url: "https://github.com/jeaiii/itoa/archive/84f25b835c8bbcf69eb97802216f8095bf94ef13.tar.gz" + sha256: "a116159f9b49922124b1c87f9989a7a8592f582904d98a3d6398e9013eca3f0f" diff --git a/recipes/jeaiii-itoa/all/conanfile.py b/recipes/jeaiii-itoa/all/conanfile.py new file mode 100644 index 0000000000000..e7cabf3b1a327 --- /dev/null +++ b/recipes/jeaiii-itoa/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy +import os + + +required_conan_version = ">=1.50.0" + + +class ItoaConan(ConanFile): + name = "jeaiii-itoa" + description = "Fast integer to ascii / integer to string conversion" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeaiii/itoa/" + topics = ("string-conversion", "itona", "integer-conversion",) + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d27bc00b65615 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(jeaiii-itoa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jeaiii-itoa::jeaiii-itoa) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jeaiii-itoa/all/test_package/conanfile.py b/recipes/jeaiii-itoa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/jeaiii-itoa/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/jeaiii-itoa/all/test_package/test_package.cpp b/recipes/jeaiii-itoa/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..144466c23b699 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include + +#include "itoa/jeaiii_to_text.h" + +template +void itoa(T n, char* b) { + *jeaiii::to_text_from_integer(b, n) = '\0'; +} + +template +void show(T n) { + char text[32]; + itoa(n, text); + std::cout << text << "\n"; +} + +int main(void) { + show(-1); + show(1 << 31); + show(0x7fffffff); + show(-0x7fffffff - 1); + show(17999999999999999999ULL); + show(-5999999999999999999LL); + + return 0; +} diff --git a/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f35b931b51133 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jeaiii-itoa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jeaiii-itoa::jeaiii-itoa) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py b/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jeaiii-itoa/config.yml b/recipes/jeaiii-itoa/config.yml new file mode 100644 index 0000000000000..68b626ef915e2 --- /dev/null +++ b/recipes/jeaiii-itoa/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220602": + folder: all diff --git a/recipes/jemalloc/all/conandata.yml b/recipes/jemalloc/all/conandata.yml new file mode 100644 index 0000000000000..01ec764057557 --- /dev/null +++ b/recipes/jemalloc/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "5.3.0": + url: "https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2" + sha256: "2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa" + "5.2.1": + url: "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2" + sha256: "34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6" + +patches: + "5.2.1": + - patch_file: "patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch" diff --git a/recipes/jemalloc/all/conanfile.py b/recipes/jemalloc/all/conanfile.py new file mode 100644 index 0000000000000..03cf37de219b0 --- /dev/null +++ b/recipes/jemalloc/all/conanfile.py @@ -0,0 +1,226 @@ +from conan import ConanFile +from conans import AutoToolsBuildEnvironment, MSBuild +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conans import tools as tools_legacy +from conan.tools.files import apply_conandata_patches, get, rename, replace_in_file +from conan.tools.layout import basic_layout +import os +import shutil +import string + +required_conan_version = ">=1.51.3" + +class JemallocConan(ConanFile): + name = "jemalloc" + description = "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support." + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-2-Clause" + homepage = "http://jemalloc.net/" + topics = ("conan", "jemalloc", "malloc", "free") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "prefix": "ANY", + "enable_cxx": [True, False], + "enable_fill": [True, False], + "enable_xmalloc": [True, False], + "enable_readlinkat": [True, False], + "enable_syscall": [True, False], + "enable_lazy_lock": [True, False], + "enable_debug_logging": [True, False], + "enable_initial_exec_tls": [True, False], + "enable_libdl": [True, False], + "enable_prof": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "prefix": "", + "enable_cxx": True, + "enable_fill": True, + "enable_xmalloc": False, + "enable_readlinkat": False, + "enable_syscall": True, + "enable_lazy_lock": False, + "enable_debug_logging": False, + "enable_initial_exec_tls": True, + "enable_libdl": True, + "enable_prof": False, + } + exports_sources = ["patches/**"] + + _autotools = None + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + if not self.options.enable_cxx: + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.options.enable_cxx and \ + self.settings.compiler.get_safe("libcxx") == "libc++" and \ + self.settings.compiler == "clang" and \ + Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("clang and libc++ version {} (< 10) is missing a mutex implementation".format(self.settings.compiler.version)) + if self.settings.compiler == "Visual Studio" and \ + self.options.shared and \ + "MT" in self.settings.compiler.runtime: + raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") + if self.settings.compiler == "Visual Studio" and self.settings.compiler.version != "15": + # https://github.com/jemalloc/jemalloc/issues/1703 + raise ConanInvalidConfiguration("Only Visual Studio 15 2017 is supported. Please fix this if other versions are supported") + if self.settings.build_type not in ("Release", "Debug", None): + raise ConanInvalidConfiguration("Only Release and Debug build_types are supported") + if self.settings.compiler == "Visual Studio" and self.settings.arch not in ("x86_64", "x86"): + raise ConanInvalidConfiguration("Unsupported arch") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) <= "3.9": + raise ConanInvalidConfiguration("Unsupported compiler version") + if self.settings.os == "Macos" and self.settings.arch not in ("x86_64", "x86"): + raise ConanInvalidConfiguration("Unsupported arch") + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.build_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + @property + def _autotools_args(self): + conf_args = [ + "--with-jemalloc-prefix={}".format(self.options.prefix), + "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", + "--enable-cxx" if self.options.enable_cxx else "--disable-cxx", + "--enable-fill" if self.options.enable_fill else "--disable-fill", + "--enable-xmalloc" if self.options.enable_cxx else "--disable-xmalloc", + "--enable-readlinkat" if self.options.enable_readlinkat else "--disable-readlinkat", + "--enable-syscall" if self.options.enable_syscall else "--disable-syscall", + "--enable-lazy-lock" if self.options.enable_lazy_lock else "--disable-lazy-lock", + "--enable-log" if self.options.enable_debug_logging else "--disable-log", + "--enable-initial-exec-tls" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls", + "--enable-libdl" if self.options.enable_libdl else "--disable-libdl", + ] + if self.options.enable_prof: + conf_args.append("--enable-prof") + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + return conf_args + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools_legacy.os_info.is_windows) + self._autotools.configure(args=self._autotools_args, configure_dir=self.source_folder) + return self._autotools + + @property + def _msvc_build_type(self): + build_type = str(self.settings.build_type) or "Release" + if not self.options.shared: + build_type += "-static" + return build_type + + def _patch_sources(self): + if self.settings.os == "Windows": + makefile_in = os.path.join(self.source_folder, "Makefile.in") + replace_in_file(self, makefile_in, + "DSO_LDFLAGS = @DSO_LDFLAGS@", + "DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a", strict=False) + replace_in_file(self, makefile_in, + "\t$(INSTALL) -d $(LIBDIR)\n" + "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)", + "\t$(INSTALL) -d $(BINDIR)\n" + "\t$(INSTALL) -d $(LIBDIR)\n" + "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n" + "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)", strict=False) + + apply_conandata_patches(self) + + + def build(self): + self._patch_sources() + if self.settings.compiler == "Visual Studio": + with tools_legacy.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): + with tools_legacy.environment_append({"CC": "cl", "CXX": "cl"}) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): + with tools_legacy.chdir(self.source_folder): + # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure + self.run("./configure {}".format(" ".join(self._autotools_args)), win_bash=tools_legacy.os_info.is_windows) + msbuild = MSBuild(self) + # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook + sln_file = os.path.join(self.source_folder, "msvc", "jemalloc_vc2017.sln") + msbuild.build(sln_file, targets=["jemalloc"], build_type=self._msvc_build_type) + else: + autotools = self._configure_autotools() + autotools.make() + + @property + def _library_name(self): + libname = "jemalloc" + if self.settings.compiler == "Visual Studio": + if self.options.shared: + if self.settings.build_type == "Debug": + libname += "d" + else: + toolset = tools_legacy.msvs_toolset(self.settings) + toolset_number = "".join(c for c in toolset if c in string.digits) + libname += "-vc{}-{}".format(toolset_number, self._msvc_build_type) + else: + if self.settings.os == "Windows": + if not self.options.shared: + libname += "_s" + else: + if not self.options.shared and self.options.fPIC: + libname += "_pic" + return libname + + def package(self): + self.copy(pattern="COPYING", src=self.source_folder, dst="licenses") + if self.settings.compiler == "Visual Studio": + arch_subdir = { + "x86_64": "x64", + "x86": "x86", + }[str(self.settings.arch)] + self.copy("*.lib", src=os.path.join(self.source_folder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "lib")) + self.copy("*.dll", src=os.path.join(self.source_folder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "bin")) + self.copy("jemalloc.h", src=os.path.join(self.source_folder, "include", "jemalloc"), dst=os.path.join(self.package_folder, "include", "jemalloc"), keep_path=True) + shutil.copytree(os.path.join(self.source_folder, "include", "msvc_compat"), + os.path.join(self.package_folder, "include", "msvc_compat")) + else: + autotools = self._configure_autotools() + # Use install_lib_XXX and install_include to avoid mixing binaries and dll's + autotools.make(target="install_lib_shared" if self.options.shared else "install_lib_static") + autotools.make(target="install_include") + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + rename(self, os.path.join(self.package_folder, "lib", "{}.lib".format(self._library_name)), + os.path.join(self.package_folder, "lib", "lib{}.a".format(self._library_name))) + if not self.options.shared: + os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "jemalloc" + self.cpp_info.libs = [self._library_name] + self.cpp_info.includedirs = [os.path.join(self.package_folder, "include"), + os.path.join(self.package_folder, "include", "jemalloc")] + if self.settings.compiler == "Visual Studio": + self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "msvc_compat")) + if not self.options.shared: + self.cpp_info.defines = ["JEMALLOC_EXPORT="] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "pthread", "rt"]) diff --git a/recipes/jemalloc/all/patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch b/recipes/jemalloc/all/patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch new file mode 100644 index 0000000000000..d4442cb45bfdd --- /dev/null +++ b/recipes/jemalloc/all/patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch @@ -0,0 +1,90 @@ +diff --git a/include/jemalloc/jemalloc_macros.h.in b/include/jemalloc/jemalloc_macros.h.in +index 59e29558..1ceb7b17 100644 +--- a/include/jemalloc/jemalloc_macros.h.in ++++ b/include/jemalloc/jemalloc_macros.h.in +@@ -71,6 +71,7 @@ + # endif + # define JEMALLOC_FORMAT_ARG(i) + # define JEMALLOC_FORMAT_PRINTF(s, i) ++# define JEMALLOC_FALLTHROUGH + # define JEMALLOC_NOINLINE __declspec(noinline) + # ifdef __cplusplus + # define JEMALLOC_NOTHROW __declspec(nothrow) +@@ -109,6 +110,11 @@ + # else + # define JEMALLOC_FORMAT_PRINTF(s, i) + # endif ++# ifdef JEMALLOC_HAVE_ATTR_FALLTHROUGH ++# define JEMALLOC_FALLTHROUGH JEMALLOC_ATTR(fallthrough) ++# else ++# define JEMALLOC_FALLTHROUGH ++# endif + # define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline) + # define JEMALLOC_NOTHROW JEMALLOC_ATTR(nothrow) + # define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s)) +@@ -121,9 +127,16 @@ + # define JEMALLOC_ALLOC_SIZE2(s1, s2) + # define JEMALLOC_EXPORT + # define JEMALLOC_FORMAT_PRINTF(s, i) ++# define JEMALLOC_FALLTHROUGH + # define JEMALLOC_NOINLINE + # define JEMALLOC_NOTHROW + # define JEMALLOC_SECTION(s) + # define JEMALLOC_RESTRICT_RETURN + # define JEMALLOC_ALLOCATOR + #endif ++ ++#if defined(__APPLE__) && !defined(JEMALLOC_NO_RENAME) ++# define JEMALLOC_SYS_NOTHROW ++#else ++# define JEMALLOC_SYS_NOTHROW JEMALLOC_NOTHROW ++#endif +diff --git a/include/jemalloc/jemalloc_protos.h.in b/include/jemalloc/jemalloc_protos.h.in +index a78414b1..d75b2224 100644 +--- a/include/jemalloc/jemalloc_protos.h.in ++++ b/include/jemalloc/jemalloc_protos.h.in +@@ -8,21 +8,22 @@ extern JEMALLOC_EXPORT void (*@je_@malloc_message)(void *cbopaque, + const char *s); + + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +- void JEMALLOC_NOTHROW *@je_@malloc(size_t size) ++ void JEMALLOC_SYS_NOTHROW *@je_@malloc(size_t size) + JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1); + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +- void JEMALLOC_NOTHROW *@je_@calloc(size_t num, size_t size) ++ void JEMALLOC_SYS_NOTHROW *@je_@calloc(size_t num, size_t size) + JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE2(1, 2); +-JEMALLOC_EXPORT int JEMALLOC_NOTHROW @je_@posix_memalign(void **memptr, +- size_t alignment, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(nonnull(1)); ++JEMALLOC_EXPORT int JEMALLOC_SYS_NOTHROW @je_@posix_memalign( ++ void **memptr, size_t alignment, size_t size) JEMALLOC_CXX_THROW ++ JEMALLOC_ATTR(nonnull(1)); + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +- void JEMALLOC_NOTHROW *@je_@aligned_alloc(size_t alignment, ++ void JEMALLOC_SYS_NOTHROW *@je_@aligned_alloc(size_t alignment, + size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) + JEMALLOC_ALLOC_SIZE(2); + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +- void JEMALLOC_NOTHROW *@je_@realloc(void *ptr, size_t size) ++ void JEMALLOC_SYS_NOTHROW *@je_@realloc(void *ptr, size_t size) + JEMALLOC_CXX_THROW JEMALLOC_ALLOC_SIZE(2); +-JEMALLOC_EXPORT void JEMALLOC_NOTHROW @je_@free(void *ptr) ++JEMALLOC_EXPORT void JEMALLOC_SYS_NOTHROW @je_@free(void *ptr) + JEMALLOC_CXX_THROW; + + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +@@ -55,12 +56,12 @@ JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW @je_@malloc_usable_size( + + #ifdef JEMALLOC_OVERRIDE_MEMALIGN + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +- void JEMALLOC_NOTHROW *@je_@memalign(size_t alignment, size_t size) ++ void JEMALLOC_SYS_NOTHROW *@je_@memalign(size_t alignment, size_t size) + JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc); + #endif + + #ifdef JEMALLOC_OVERRIDE_VALLOC + JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN +- void JEMALLOC_NOTHROW *@je_@valloc(size_t size) JEMALLOC_CXX_THROW ++ void JEMALLOC_SYS_NOTHROW *@je_@valloc(size_t size) JEMALLOC_CXX_THROW + JEMALLOC_ATTR(malloc); + #endif diff --git a/recipes/jemalloc/all/test_package/CMakeLists.txt b/recipes/jemalloc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0cc486467b601 --- /dev/null +++ b/recipes/jemalloc/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/jemalloc/all/test_package/conanfile.py b/recipes/jemalloc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/jemalloc/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jemalloc/all/test_package/test_package.cpp b/recipes/jemalloc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5d19fec4f824a --- /dev/null +++ b/recipes/jemalloc/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +#include + +void +do_something(size_t i) { + // Leak some memory. + malloc(i * 100); +} + +int +main(int argc, char **argv) { + for (size_t i = 0; i < 1000; i++) { + do_something(i); + } + + // Dump allocator statistics to stderr. + malloc_stats_print(NULL, NULL, NULL); + + return 0; +} diff --git a/recipes/jemalloc/config.yml b/recipes/jemalloc/config.yml new file mode 100644 index 0000000000000..28cb9a5ecdcdf --- /dev/null +++ b/recipes/jemalloc/config.yml @@ -0,0 +1,5 @@ +versions: + "5.2.1": + folder: all + "5.3.0": + folder: all diff --git a/recipes/jerryscript/all/CMakeLists.txt b/recipes/jerryscript/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/jerryscript/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/jerryscript/all/conandata.yml b/recipes/jerryscript/all/conandata.yml new file mode 100644 index 0000000000000..f587b0a08830d --- /dev/null +++ b/recipes/jerryscript/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.2.0": + sha256: ce76f716972d111587d36451c438b65dd2b8f7e9853c5f5a2b59229b05df6b0b + url: https://github.com/jerryscript-project/jerryscript/archive/v2.2.0.zip + "2.3.0": + sha256: 59b31bf519fcfd7c250815848820bf64439843bbfe54452b4060df2079e01d83 + url: https://github.com/jerryscript-project/jerryscript/archive/v2.3.0.zip + "2.4.0": + sha256: 08c950b8689f1229e9796a7beb2e6c5c911f49666db7712ddf006d76a0766b79 + url: https://github.com/jerryscript-project/jerryscript/archive/v2.4.0.zip +patches: + "2.2.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-2.3.0-remove-werror.patch" + "2.3.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-2.3.0-remove-werror.patch" + "2.4.0": + - base_path: "source_subfolder" + patch_file: "patches/0002-2.4.0-remove-werror.patch" + - base_path: "source_subfolder" + patch_file: "patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch" diff --git a/recipes/jerryscript/all/conanfile.py b/recipes/jerryscript/all/conanfile.py new file mode 100644 index 0000000000000..d7fc6037445eb --- /dev/null +++ b/recipes/jerryscript/all/conanfile.py @@ -0,0 +1,250 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class JerryScriptStackConan(ConanFile): + name = "jerryscript" + license = "Apache-2.0" + homepage = "https://github.com/jerryscript-project/jerryscript" + url = "https://github.com/conan-io/conan-center-index" + description = "Ultra-lightweight JavaScript engine for the Internet of Things" + topics = ["javascript", "iot", "jerryscript", "javascript-engine"] + exports_sources = "CMakeLists.txt", "patches/**" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tool_cmdline": [True, False], + "tool_cmdline_test": [True, False], + "tool_cmdline_snapshot": [True, False], + "default_port_implementation": [True, False], + "jerry_ext": [True, False], + "jerry_math": [True, False], + "link_time_optimization": [True, False], + "strip_symbols": [True, False], + "amalgamated": [True, False], + "debugger": [True, False], + "keep_line_info": [True, False], + "profile": "ANY", + "promise_callback": [True, False], + "external_context": [True, False], + "snapshot_execution": [True, False], + "snapshot_saving": [True, False], + "parser": [True, False], + "enable_dump_bytecode": [True, False], + "enable_dump_regexp_bytecode": [True, False], + "strict_regexp": [True, False], + "error_messages": [True, False], + "logging": [True, False], + "memory_statistics": [True, False], + "heap_size": "ANY", + "gc_limit": "ANY", + "gc_mark_limit": "ANY", + "stack_limit": "ANY", + "cpointer_32_bit": [True, False], + "system_allocator": [True, False], + "valgrind": [True, False], + "gc_before_each_alloc": [True, False], + "vm_exec_stop": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tool_cmdline": True, + "tool_cmdline_test": False, + "tool_cmdline_snapshot": False, + "default_port_implementation": True, + "jerry_ext": True, + "jerry_math": False, # Initialized in `config_options` + "link_time_optimization": False, # Enabled by upstream, but disabled to be confirm cci (add -flto in your profile) + "strip_symbols": True, + "amalgamated": False, + "debugger": False, + "keep_line_info": False, + "profile": None, # Initialized in `config_options` + "promise_callback": False, + "external_context": False, + "snapshot_execution": False, + "snapshot_saving": False, + "parser": True, + "enable_dump_bytecode": False, + "enable_dump_regexp_bytecode": False, + "strict_regexp": False, + "error_messages": False, + "logging": False, + "memory_statistics": False, + "heap_size": 512, + "gc_limit": 0, + "gc_mark_limit": 8, + "stack_limit": 0, + "cpointer_32_bit": False, + "system_allocator": False, + "valgrind": False, + "gc_before_each_alloc": False, + "vm_exec_stop": False, + } + generators = "cmake" + short_paths = True + + _cmake = None + _predefined_profiles = ["es.next", "es5.1", "minimal"] + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _jerry_math(self): + return self.options.get_safe("jerry_math", False) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # profile and jerry_match default option value depend on version + if tools.Version(self.version) < "2.4.0": + self.options.profile = "es5.1" + self.options.jerry_math = True + if self.settings.compiler == "Visual Studio": + del self.options.jerry_math # forced to False + else: + self.options.profile = "es.next" + self.options.jerry_math = False + + if self.settings.os == "Macos": + del self.options.jerry_math # forced to False + del self.options.link_time_optimization # forced to False + del self.options.strip # forced to False + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + if not self.options.debugger: + del self.options.keep_line_info + + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("jerryscript shared lib is not yet supported under windows") + + def validate(self): + # validate integers + try: + checks = ( + (0 <= int(self.options.heap_size), "heap_size must be bigger than or equal to 0"), + (0 <= int(self.options.gc_limit) <= 8192, "gc_limit must be in the range [0, 8192]"), + (0 <= int(self.options.gc_mark_limit), "gc_mark_limit must be bigger than or equal to 0"), + (0 <= int(self.options.stack_limit), "stack_limit must be bigger than or equal to 0"), + ) + for check_res, txt in checks: + if not check_res: + raise ConanInvalidConfiguration(txt) + except ValueError as e: + raise ConanInvalidConfiguration("jerryscript heap size, gc mark limit, stack limit, gc limit should be a positive integer") + # validate profile file + if self.options.profile not in self._predefined_profiles and not os.path.isfile(str(self.options.profile)): + raise ConanInvalidConfiguration("Invalid profile option. Feature profile must either be a valid file or one of these: es.next, es5.1, minimal") + # validate the use of the system allocator option + if self.settings.arch == "x86_64" and self.options.system_allocator: + raise ConanInvalidConfiguration("jerryscript system allocator not available on 64bit systems") + if self.options.system_allocator and not self.options.cpointer_32_bit: + raise ConanInvalidConfiguration("jerryscript system allocator must be used with 32 bit pointers") + + def package_id(self): + if self.options.profile not in self._predefined_profiles: + self.info.options.profile = tools.load(str(self.options.profile)) + + 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["patches"][self.version]: + tools.patch(**patch) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + amalgamation_definition = "ENABLE_AMALGAM" + libmath_definition = "JERRY_MATH" + if tools.Version(self.version) < tools.Version("2.4.0"): + amalgamation_definition = "ENABLE_ALL_IN_ONE" + libmath_definition = "JERRY_LIBM" + self._cmake.definitions["JERRY_CMDLINE"] = self.options.tool_cmdline + self._cmake.definitions["JERRY_CMDLINE_TEST"] = self.options.tool_cmdline_test + self._cmake.definitions["JERRY_CMDLINE_SNAPSHOT"] = self.options.tool_cmdline_snapshot + self._cmake.definitions["JERRY_PORT_DEFAULT"] = self.options.default_port_implementation + self._cmake.definitions["JERRY_EXT"] = self.options.jerry_ext + self._cmake.definitions[libmath_definition] = self._jerry_math + self._cmake.definitions["ENABLE_STRIP"] = self.options.get_safe("jerry_strip", False) + self._cmake.definitions["ENABLE_LTO"] = self.options.get_safe("link_time_optimization", False) + self._cmake.definitions[amalgamation_definition] = self.options.amalgamated + self._cmake.definitions["JERRY_DEBUGGER"] = self.options.debugger + self._cmake.definitions["JERRY_LINE_INFO"] = self.options.get_safe("keep_line_info", False) + self._cmake.definitions["JERRY_PROFILE"] = self.options.profile + self._cmake.definitions["JERRY_EXTERNAL_CONTEXT"] = self.options.external_context + self._cmake.definitions["JERRY_SNAPSHOT_EXEC"] = self.options.snapshot_execution + self._cmake.definitions["JERRY_SNAPSHOT_SAVE"] = self.options.snapshot_saving + self._cmake.definitions["JERRY_PARSER"] = self.options.parser + self._cmake.definitions["JERRY_PARSER_DUMP_BYTE_CODE"] = self.options.enable_dump_bytecode + self._cmake.definitions["JERRY_REGEXP_DUMP_BYTE_CODE"] = self.options.enable_dump_regexp_bytecode + self._cmake.definitions["JERRY_REGEXP_STRICT_MODE"] = self.options.strict_regexp + self._cmake.definitions["JERRY_ERROR_MESSAGES"] = self.options.error_messages + self._cmake.definitions["JERRY_LOGGING"] = self.options.logging + self._cmake.definitions["JERRY_MEM_STATS"] = self.options.memory_statistics + self._cmake.definitions["JERRY_GLOBAL_HEAP_SIZE"] = "(%s)" % self.options.heap_size + self._cmake.definitions["JERRY_GC_LIMIT"] = "(%s)" % self.options.gc_limit + self._cmake.definitions["JERRY_GC_MARK_LIMIT"] = "(%s)" % self.options.gc_mark_limit + self._cmake.definitions["JERRY_STACK_LIMIT"] = "(%s)" % self.options.stack_limit + self._cmake.definitions["JERRY_CPOINTER_32_BIT"] = self.options.cpointer_32_bit + self._cmake.definitions["JERRY_SYSTEM_ALLOCATOR"] = self.options.system_allocator + self._cmake.definitions["JERRY_VALGRIND"] = self.options.valgrind + self._cmake.definitions["JERRY_MEM_GC_BEFORE_EACH_ALLOC"] = self.options.gc_before_each_alloc + self._cmake.definitions["JERRY_VM_EXEC_STOP"] = self.options.vm_exec_stop + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.components["libjerry-port-default"].names["pkg_config"] = ["libjerry-port-default"] + self.cpp_info.components["libjerry-port-default"].libs = ["jerry-port-default"] + + if self._jerry_math: + mathlibname = "jerry-libm" if tools.Version(self.version) < "2.4.0" else "jerry-math" + self.cpp_info.components["libjerry-math"].names["pkg_config"] = "lib{}".format(mathlibname) + self.cpp_info.components["libjerry-math"].libs = [mathlibname] + self.cpp_info.components["libjerry-math"].requires = ["libjerry-port-default"] + self.cpp_info.components["libjerry-core"].requires.append("libjerry-math") + + if tools.Version(self.version) < "2.4.0": + self.cpp_info.components["libjerry-port-default-minimal"].names["pkg_config"] = ["libjerry-port-default-minimal"] + self.cpp_info.components["libjerry-port-default-minimal"].libs = ["jerry-port-default-minimal"] + self.cpp_info.components["libjerry-port-default"].requires.append("libjerry-port-default-minimal") + + self.cpp_info.components["libjerry-core"].names["pkg_config"] = "libjerry-core" + self.cpp_info.components["libjerry-core"].libs = ["jerry-core"] + # The pc file does not explicitly add the port. But it's needed for the test + self.cpp_info.components["libjerry-core"].requires = ["libjerry-port-default"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["libjerry-core"].system_libs.append("m") + + self.cpp_info.components["libjerry-ext"].names["pkg_config"] = "libjerry-ext" + self.cpp_info.components["libjerry-ext"].libs = ["jerry-ext"] + self.cpp_info.components["libjerry-ext"].requires = ["libjerry-core"] diff --git a/recipes/jerryscript/all/patches/0001-2.3.0-remove-werror.patch b/recipes/jerryscript/all/patches/0001-2.3.0-remove-werror.patch new file mode 100644 index 0000000000000..34a7e6d102dfc --- /dev/null +++ b/recipes/jerryscript/all/patches/0001-2.3.0-remove-werror.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c37734d1..54cf7478 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -150,7 +150,6 @@ endmacro() + macro(jerry_add_compile_warnings) + foreach(_warning ${ARGV}) + jerry_add_compile_flags(-W${_warning}) +- jerry_add_compile_flags(-Werror=${_warning}) + endforeach() + endmacro() + +@@ -194,7 +193,7 @@ if(USING_GCC OR USING_CLANG) + # Turn off stack protector + jerry_add_compile_flags(-fno-builtin -fno-stack-protector) + jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition) +- jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror) ++ jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes) + endif() + + if(USING_GCC) diff --git a/recipes/jerryscript/all/patches/0002-2.4.0-remove-werror.patch b/recipes/jerryscript/all/patches/0002-2.4.0-remove-werror.patch new file mode 100644 index 0000000000000..1a78f4990c52e --- /dev/null +++ b/recipes/jerryscript/all/patches/0002-2.4.0-remove-werror.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 43ac22ea..3002c869 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -167,7 +167,6 @@ endmacro() + macro(jerry_add_compile_warnings) + foreach(_warning ${ARGV}) + jerry_add_compile_flags(-W${_warning}) +- jerry_add_compile_flags(-Werror=${_warning}) + endforeach() + endmacro() + +@@ -212,7 +211,7 @@ if(USING_GCC OR USING_CLANG) + jerry_add_compile_flags(-fno-builtin) + endif() + jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition) +- jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror) ++ jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes) + endif() + + if(USING_GCC) diff --git a/recipes/jerryscript/all/patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch b/recipes/jerryscript/all/patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch new file mode 100644 index 0000000000000..49c14b7b568df --- /dev/null +++ b/recipes/jerryscript/all/patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -16,7 +16,7 @@ + project (Jerry C) + + # Determining version +-execute_process(COMMAND python ${CMAKE_SOURCE_DIR}/tools/version.py ++execute_process(COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/tools/version.py + OUTPUT_VARIABLE JERRY_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + diff --git a/recipes/jerryscript/all/test_package/CMakeLists.txt b/recipes/jerryscript/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/jerryscript/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/jerryscript/all/test_package/conanfile.py b/recipes/jerryscript/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bbf2351737349 --- /dev/null +++ b/recipes/jerryscript/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jerryscript/all/test_package/test_package.c b/recipes/jerryscript/all/test_package/test_package.c new file mode 100644 index 0000000000000..6fb91c9d18268 --- /dev/null +++ b/recipes/jerryscript/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "jerryscript.h" + +int main() +{ + const jerry_char_t script[] = "var str = 'Hello, World!';"; + + bool ret_value = jerry_run_simple(script, sizeof(script) - 1, JERRY_INIT_EMPTY); + + return (ret_value ? 0 : 1); +} diff --git a/recipes/jerryscript/config.yml b/recipes/jerryscript/config.yml new file mode 100644 index 0000000000000..096f3e543ee8d --- /dev/null +++ b/recipes/jerryscript/config.yml @@ -0,0 +1,7 @@ +versions: + "2.2.0": + folder: "all" + "2.3.0": + folder: "all" + "2.4.0": + folder: "all" diff --git a/recipes/jfalcou-eve/all/conandata.yml b/recipes/jfalcou-eve/all/conandata.yml new file mode 100644 index 0000000000000..1564d67865638 --- /dev/null +++ b/recipes/jfalcou-eve/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "v2023.02.15": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2023.02.15.tar.gz" + sha256: "7a5fb59c0e6ef3bef3e8b36d62e138d31e7f2a9f1bdfe95a8e96512b207f84c5" + "v2022.09.1": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.09.1.tar.gz" + sha256: "d8d3ae55f0ca2690f8a22883eaaa8251275b76702da0267e8e1725b22c51e978" + "v2022.09.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.09.0.tar.gz" + sha256: "53a4e1944a1080c67380a6d7f4fb42998f1c1db35e2370e02d7853c3ac1e0a33" + "v2022.03.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.03.0.tar.gz" + sha256: "8bf9faea516806e7dd468e778dcedc81c51f0b2c6a70b9c75987ce12bb759911" + "v2021.10.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2021.10.0.tar.gz" + sha256: "580c40a8244039a700b93ea49fb0affc1c8d3c100eb6dc66368e101753f51e5c" diff --git a/recipes/jfalcou-eve/all/conanfile.py b/recipes/jfalcou-eve/all/conanfile.py new file mode 100644 index 0000000000000..dbd0bf0ff0d12 --- /dev/null +++ b/recipes/jfalcou-eve/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +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 +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.50.0" + + +class JfalcouEveConan(ConanFile): + name = "jfalcou-eve" + description = ("Expressive Velocity Engine - reimplementation of the old " + "Boost.SIMD on C++20" + ) + license = ("MIT", "BSL-1.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://jfalcou.github.io/eve/" + topics = ("cpp", "simd", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "Visual Studio": "16.9", + "msvc": "192", + "clang": "13", + "apple-clang": "14", + } + + def configure(self): + if Version(self.version.strip("v")) < "2022.09.0": + self.license = "MIT" + else: + self.license = "BSL-1.0" + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if is_msvc(self) and Version(self.version.strip("v")) < "2023.02.15": + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC. See https://github.com/jfalcou/eve/issues/1022") + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + 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="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "eve") + self.cpp_info.set_property("cmake_target_name", "eve::eve") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "eve" + self.cpp_info.names["cmake_find_package_multi"] = "eve" diff --git a/recipes/jfalcou-eve/all/test_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..27bf0e618e9af --- /dev/null +++ b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(eve REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eve::eve) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/jfalcou-eve/all/test_package/conanfile.py b/recipes/jfalcou-eve/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/jfalcou-eve/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/jfalcou-eve/all/test_package/test_package.cpp b/recipes/jfalcou-eve/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4ce2503134165 --- /dev/null +++ b/recipes/jfalcou-eve/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() +{ + eve::wide> p{1.f,2.f,3.f,4.f}; + std::cout << "eve test: " << p + 10 * p << "\n"; + return 0; +} diff --git a/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..999a4a03ed9c9 --- /dev/null +++ b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/jfalcou-eve/all/test_v1_package/conanfile.py b/recipes/jfalcou-eve/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..daab8195118f1 --- /dev/null +++ b/recipes/jfalcou-eve/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class JfalcouEveConan(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(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/jfalcou-eve/config.yml b/recipes/jfalcou-eve/config.yml new file mode 100644 index 0000000000000..7bff48f980652 --- /dev/null +++ b/recipes/jfalcou-eve/config.yml @@ -0,0 +1,11 @@ +versions: + "v2023.02.15": + folder: all + "v2022.09.1": + folder: all + "v2022.09.0": + folder: all + "v2022.03.0": + folder: all + "v2021.10.0": + folder: all diff --git a/recipes/jinja2cpp/all/CMakeLists.txt b/recipes/jinja2cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..4b0bc06c8282d --- /dev/null +++ b/recipes/jinja2cpp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/jinja2cpp/all/conandata.yml b/recipes/jinja2cpp/all/conandata.yml new file mode 100644 index 0000000000000..ba871764ca5c4 --- /dev/null +++ b/recipes/jinja2cpp/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.2.1": + url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/refs/tags/1.2.1.tar.gz" + sha256: "2e61516fd4fd77452c8dd7a6f958ad47c42990df9b7bdc62cf2deb8aa7819b6c" + "1.1.0": + url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.1.0.tar.gz" + sha256: "3d321a144f3774702d3a6252e3a6370cdaff9c96d8761d850bb79cdb45b372c5" +patches: + "1.2.1": + - patch_file: "patches/fix-cmake-1.2.1.patch" + base_path: "source_subfolder" + "1.1.0": + - patch_file: "patches/fix-cmake-1.1.0.patch" + base_path: "source_subfolder" diff --git a/recipes/jinja2cpp/all/conanfile.py b/recipes/jinja2cpp/all/conanfile.py new file mode 100644 index 0000000000000..5ccade1cbf22f --- /dev/null +++ b/recipes/jinja2cpp/all/conanfile.py @@ -0,0 +1,148 @@ +from conan.tools.microsoft import msvc_runtime_flag +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class Jinja2cppConan(ConanFile): + name = "jinja2cpp" + license = "MIT" + homepage = "https://jinja2cpp.dev/" + url = "https://github.com/conan-io/conan-center-index" + description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation" + topics = ("cpp14", "cpp17", "jinja2", "string templates", "templates engine") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "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 _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + + def requirements(self): + self.requires("boost/1.78.0") + self.requires("expected-lite/0.5.0") + self.requires("optional-lite/3.5.0") + self.requires("rapidjson/cci.20211112") + self.requires("string-view-lite/1.6.0") + self.requires("variant-lite/2.0.0") + if self.version == "1.1.0": + self.requires("fmt/6.2.1") # not compatible with fmt >= 7.0.0 + else: + self.requires("nlohmann_json/3.10.5") + self.requires("fmt/8.1.1") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + 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) + # Don't force MD for shared lib, allow to honor runtime from profile + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "set(JINJA2CPP_MSVC_RUNTIME_TYPE \"/MD\")", "") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["JINJA2CPP_BUILD_TESTS"] = False + self._cmake.definitions["JINJA2CPP_STRICT_WARNINGS"] = False + self._cmake.definitions["JINJA2CPP_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["JINJA2CPP_DEPS_MODE"] = "conan-build" + self._cmake.definitions["JINJA2CPP_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", 14) + # Conan cmake generator omits the build_type flag for MSVC multiconfiguration CMake, + # but provide build-type-specific runtime type flag. For now, Jinja2C++ build scripts + # need to know the build type is being built in order to setup internal flags correctly + self._cmake.definitions["CMAKE_BUILD_TYPE"] = self.settings.build_type + if self._is_msvc: + # Runtime type configuration for Jinja2C++ should be strictly '/MT' or '/MD' + runtime = "/MD" if "MD" in msvc_runtime_flag(self) else "/MT" + self._cmake.definitions["JINJA2CPP_MSVC_RUNTIME_TYPE"] = runtime + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + if self.version == "1.1.0": + if tools.Version(self.deps_cpp_info["fmt"].version) >= "7.0.0": + raise ConanInvalidConfiguration("jinja2cpp requires fmt < 7.0.0") + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "jinja2cpp")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"jinja2cpp": "jinja2cpp::jinja2cpp"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "jinja2cpp") + self.cpp_info.set_property("cmake_target_name", "jinja2cpp") + self.cpp_info.libs = ["jinja2cpp"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch new file mode 100644 index 0000000000000..2c9056e924d37 --- /dev/null +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,10 +21,6 @@ option(JINJA2CPP_STRICT_WARNINGS "Enable additional warnings and treat them as e + option(JINJA2CPP_BUILD_SHARED "Build shared linkage version of Jinja2Cpp" OFF) + option(JINJA2CPP_PIC "Control -fPIC option for library build" OFF) + +-if (DEFINED BUILD_SHARED_LIBS) +- set(JINJA2CPP_BUILD_SHARED BUILD_SHARED_LIBS) +-endif () +- + if (JINJA2CPP_BUILD_SHARED) + set(JINJA2CPP_PIC ON) + set(JINJA2CPP_MSVC_RUNTIME_TYPE "/MD") +@@ -219,7 +215,7 @@ set_target_properties(${LIB_TARGET_NAME} PROPERTIES + + set_property(TARGET ${LIB_TARGET_NAME} PROPERTY PUBLIC_HEADER ${PublicHeaders} ${JINJA2CPP_EXTRA_PUBLIC_HEADERS}) + +-configure_file(jinja2cpp.pc.in jinja2cpp.pc @ONLY) ++configure_file(jinja2cpp.pc.in ${CMAKE_BINARY_DIR}/jinja2cpp.pc @ONLY) + + if (JINJA2CPP_BUILD_TESTS) + enable_testing() +@@ -281,7 +277,7 @@ install( + InstallTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jinja2cpp + ) + +--- a/thirdparty/thirdparty-conan-build.cmake ++++ b/thirdparty/thirdparty-conan-build.cmake +@@ -8,7 +8,11 @@ find_package(string-view-lite) + find_package(Boost) + set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) + find_package(fmt) +-find_package(rapidjson) ++find_package(RapidJSON) + +-set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson) +-set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite) ++# TODO: replace conan targets by official imported targets when fixed in corresponding recipes: ++# - CONAN_PKG::rapidjson => rapidjson ++# - CONAN_PKG::optional-lite => nonstd::optional-lite ++# - CONAN_PKG::variant-lite => nonstd::variant-lite ++set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt CONAN_PKG::rapidjson) ++set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite CONAN_PKG::variant-lite CONAN_PKG::optional-lite nonstd::string-view-lite) diff --git a/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch new file mode 100644 index 0000000000000..d355b60a17daa --- /dev/null +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bf603b0..6229f02 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -282,7 +282,7 @@ install( + InstallTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jinja2cpp + ) + +diff --git a/src/helpers.h b/src/helpers.h +index 3af280f..a6a3205 100644 +--- a/src/helpers.h ++++ b/src/helpers.h +@@ -32,12 +32,21 @@ struct MultiStringLiteral + #endif + } + ++#if defined(_MSC_VER) && (_MSC_VER <= 1900) ++ template ++ auto GetValueStr() const ++ { ++ auto memPtr = SelectMemberPtr::GetPtr(); ++ return std::basic_string(this->*memPtr); ++ } ++#else + template + constexpr auto GetValueStr() const + { + constexpr auto memPtr = SelectMemberPtr::GetPtr(); + return std::basic_string(this->*memPtr); + } ++#endif + + template + struct SelectMemberPtr; diff --git a/recipes/jinja2cpp/all/test_package/CMakeLists.txt b/recipes/jinja2cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5f02285c2de3e --- /dev/null +++ b/recipes/jinja2cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jinja2cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} jinja2cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/jinja2cpp/all/test_package/conanfile.py b/recipes/jinja2cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jinja2cpp/all/test_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/jinja2cpp/all/test_package/test_package.cpp b/recipes/jinja2cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8b70df874ff00 --- /dev/null +++ b/recipes/jinja2cpp/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main() +{ + std::string source = R"( +{{ ("Hello", 'world') | join }}!!! +{{ ("Hello", 'world') | join(', ') }}!!! +{{ ("Hello", 'world') | join(d = '; ') }}!!! +{{ ("Hello", 'world') | join(d = '; ') | lower }}!!!)"; + + jinja2::Template tpl; + tpl.Load(source); + + std::string result = tpl.RenderAsString(jinja2::ValuesMap()).value(); + std::cout << result << "\n"; +} diff --git a/recipes/jinja2cpp/config.yml b/recipes/jinja2cpp/config.yml new file mode 100644 index 0000000000000..97294286ce46b --- /dev/null +++ b/recipes/jinja2cpp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.1": + folder: all + "1.1.0": + folder: all diff --git a/recipes/joltphysics/all/conandata.yml b/recipes/joltphysics/all/conandata.yml new file mode 100644 index 0000000000000..7c5580239b9ad --- /dev/null +++ b/recipes/joltphysics/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.0.1": + url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v2.0.1.tar.gz" + sha256: "96ae2e8691c4802e56bf2587da30f2cc86b8abe82a78bc2398065bd87dd718af" +patches: + "2.0.1": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "Fix CMakeLists: no warnings as errors, allow shared, add install target, and add profile & debug_renderer options" + patch_type: "conan" diff --git a/recipes/joltphysics/all/conanfile.py b/recipes/joltphysics/all/conanfile.py new file mode 100644 index 0000000000000..dc05fc97bdff2 --- /dev/null +++ b/recipes/joltphysics/all/conanfile.py @@ -0,0 +1,160 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class JoltPhysicsConan(ConanFile): + name = "joltphysics" + description = ( + "A multi core friendly rigid body physics and collision detection " + "library, written in C++, suitable for games and VR applications." + ) + license = "MIT" + topics = ("physics", "simulation", "physics-engine", "physics-simulation", "rigid-body", "game", "collision") + homepage = "https://github.com/jrouwe/JoltPhysics" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "simd": ["sse", "sse41", "sse42", "avx", "avx2", "avx512"], + "debug_renderer": [True, False], + "profile": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "simd": "sse42", + "debug_renderer": False, + "profile": False, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "9.2", # due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429 + "clang": "5", + "apple-clang": "12", + } + + @property + def _has_sse41(self): + return self.options.get_safe("simd") in ("sse41", "sse42", "avx", "avx2", "avx512") + + @property + def _has_sse42(self): + return self.options.get_safe("simd") in ("sse42", "avx", "avx2", "avx512") + + @property + def _has_avx(self): + return self.options.get_safe("simd") in ("avx", "avx2", "avx512") + + @property + def _has_avx2(self): + return self.options.get_safe("simd") in ("avx2", "avx512") + + @property + def _has_avx512(self): + return self.options.get_safe("simd") == "avx512" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ("x86", "x86_64"): + del self.options.simd + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TARGET_UNIT_TESTS"] = False + tc.variables["TARGET_HELLO_WORLD"] = False + tc.variables["TARGET_PERFORMANCE_TEST"] = False + tc.variables["TARGET_SAMPLES"] = False + tc.variables["TARGET_VIEWER"] = False + tc.variables["GENERATE_DEBUG_SYMBOLS"] = False + tc.variables["TARGET_UNIT_TESTS"] = False + tc.variables["USE_SSE4_1"] = self._has_sse41 + tc.variables["USE_SSE4_2"] = self._has_sse42 + tc.variables["USE_AVX"] = self._has_avx + tc.variables["USE_AVX2"] = self._has_avx2 + tc.variables["USE_AVX512"] = self._has_avx512 + if is_msvc(self): + tc.variables["USE_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) + tc.variables["JPH_DEBUG_RENDERER"] = self.options.debug_renderer + tc.variables["JPH_PROFILE_ENABLED"] = self.options.profile + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "Build")) + 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 = ["Jolt"] + if self._has_sse41: + self.cpp_info.defines.append("JPH_USE_SSE4_1") + if self._has_sse42: + self.cpp_info.defines.append("JPH_USE_SSE4_2") + if self._has_avx: + self.cpp_info.defines.append("JPH_USE_AVX") + if self._has_avx2: + self.cpp_info.defines.append("JPH_USE_AVX2") + if self._has_avx512: + self.cpp_info.defines.append("JPH_USE_AVX512") + if self.options.debug_renderer: + self.cpp_info.defines.append("JPH_DEBUG_RENDERER") + if self.options.profile: + self.cpp_info.defines.append("JPH_PROFILE_ENABLED") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/joltphysics/all/patches/0001-fix-cmake.patch b/recipes/joltphysics/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..2be9454d8f5f9 --- /dev/null +++ b/recipes/joltphysics/all/patches/0001-fix-cmake.patch @@ -0,0 +1,90 @@ +--- a/Build/CMakeLists.txt ++++ b/Build/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.16 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.15) + + project(JoltPhysics CXX) + +@@ -32,11 +32,6 @@ include(CMakeDependentOption) + # Windows Store only supports the DLL version + cmake_dependent_option(USE_STATIC_MSVC_RUNTIME_LIBRARY "Use the static MSVC runtime library" ON "MSVC;NOT WINDOWS_STORE" OFF) + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Distribution") +-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;ReleaseASAN;ReleaseUBSAN;ReleaseCoverage;Distribution") +-endif() + + if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW) + # Fill in the path to the asan libraries +@@ -53,7 +48,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + endif() + + # Set general compiler flags +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Zc:__cplusplus /Gm- /Wall /WX /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline /Zi") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /Wall /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline /Zi") + + # Remove any existing compiler flag that enables RTTI + string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +@@ -76,8 +71,6 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + + if (NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64") AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM")) + # On ARM, whole program optimization triggers an internal compiler error during code gen, so we don't turn it on +- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL") +- set(CMAKE_CXX_FLAGS_DISTRIBUTION "${CMAKE_CXX_FLAGS_DISTRIBUTION} /GL") + endif() + + # Set linker flags +@@ -118,7 +111,6 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DJPH_FLOATING_POINT_EXCEPTIONS_ENABLED") # Clang turns Float2 into a vector sometimes causing floating point exceptions + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /DJPH_FLOATING_POINT_EXCEPTIONS_ENABLED") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO /LTCG:incremental /OPT:ICF /OPT:REF") +- set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /showFilenames") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") # Clang emits warnings about unused arguments such as /MP and /GL +@@ -153,7 +145,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + endif() + elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR MINGW OR EMSCRIPTEN) + # Set general compiler flags +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++17 -I. -Wall -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -I. -Wall") + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Somehow -Wcomment doesn't want to be turned off from code and we need this because Doxygen MathJax uses it +--- a/Jolt/Jolt.cmake ++++ b/Jolt/Jolt.cmake +@@ -410,12 +410,26 @@ endif() + source_group(TREE ${JOLT_PHYSICS_ROOT} FILES ${JOLT_PHYSICS_SRC_FILES}) + + # Create Jolt lib +-add_library(Jolt STATIC ${JOLT_PHYSICS_SRC_FILES}) ++add_library(Jolt ${JOLT_PHYSICS_SRC_FILES}) ++target_compile_features(Jolt PUBLIC cxx_std_17) ++include(GNUInstallDirs) ++install( ++ TARGETS Jolt ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install(DIRECTORY ${JOLT_PHYSICS_ROOT} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING REGEX "(.*).(h|inl)$") ++if(JPH_DEBUG_RENDERER) ++ target_compile_definitions(Jolt PUBLIC JPH_DEBUG_RENDERER) ++endif() ++if(JPH_PROFILE_ENABLED) ++ target_compile_definitions(Jolt PUBLIC JPH_PROFILE_ENABLED) ++endif() + target_include_directories(Jolt PUBLIC ${PHYSICS_REPO_ROOT}) +-target_precompile_headers(Jolt PRIVATE ${JOLT_PHYSICS_ROOT}/Jolt.h) +-target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") diff --git a/recipes/joltphysics/all/test_package/CMakeLists.txt b/recipes/joltphysics/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b69831ca4aa0 --- /dev/null +++ b/recipes/joltphysics/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(joltphysics REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE joltphysics::joltphysics) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/joltphysics/all/test_package/conanfile.py b/recipes/joltphysics/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/joltphysics/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/joltphysics/all/test_package/test_package.cpp b/recipes/joltphysics/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..73d3685c494f5 --- /dev/null +++ b/recipes/joltphysics/all/test_package/test_package.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static void TraceImpl(const char *inFMT, ...) +{ + va_list list; + va_start(list, inFMT); + char buffer[1024]; + std::vsnprintf(buffer, sizeof(buffer), inFMT, list); + va_end(list); + + std::cout << buffer << std::endl; +} + +#ifdef JPH_ENABLE_ASSERTS +static bool AssertFailedImpl(const char *inExpression, const char *inMessage, const char *inFile, JPH::uint inLine) +{ + std::cout << inFile << ":" << inLine << ": (" << inExpression << ") " << (inMessage != nullptr? inMessage : "") << std::endl; + return true; +}; +#endif + +int main() +{ + JPH::RegisterDefaultAllocator(); + + JPH::Trace = TraceImpl; +#ifdef JPH_ENABLE_ASSERTS + JPH::AssertFailed = AssertFailedImpl; +#endif + + JPH::Factory::sInstance = new JPH::Factory(); + + JPH::RegisterTypes(); + + JPH::TempAllocatorImpl temp_allocator(10 * 1024 * 1024); + JPH::JobSystemThreadPool job_system(JPH::cMaxPhysicsJobs, JPH::cMaxPhysicsBarriers, std::thread::hardware_concurrency() - 1); + + delete JPH::Factory::sInstance; + JPH::Factory::sInstance = nullptr; + + return 0; +} diff --git a/recipes/joltphysics/all/test_v1_package/CMakeLists.txt b/recipes/joltphysics/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/joltphysics/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/joltphysics/all/test_v1_package/conanfile.py b/recipes/joltphysics/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/joltphysics/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/joltphysics/config.yml b/recipes/joltphysics/config.yml new file mode 100644 index 0000000000000..bb7eb85dfac49 --- /dev/null +++ b/recipes/joltphysics/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.1": + folder: all diff --git a/recipes/jom/all/conandata.yml b/recipes/jom/all/conandata.yml new file mode 100644 index 0000000000000..0fe464cf0c395 --- /dev/null +++ b/recipes/jom/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.3": + sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" + url: "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" diff --git a/recipes/jom/all/conanfile.py b/recipes/jom/all/conanfile.py new file mode 100644 index 0000000000000..4962bc3e3e42f --- /dev/null +++ b/recipes/jom/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.files import copy, download, get +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.47.0" + +class JomInstallerConan(ConanFile): + name = "jom" + description = "jom is a clone of nmake to support the execution of multiple independent commands in parallel" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://wiki.qt.io/Jom" + license = "GPL-3.0-only" + topics = ("build", "make", "makefile", "nmake") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + 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(f"{self.ref} only supports Windows") + + 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") + + def package(self): + copy(self, "LICENSE.GPL", self.build_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.exe", self.build_folder, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 + bin_folder = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_folder) diff --git a/recipes/jom/all/test_package/conanfile.py b/recipes/jom/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2c855138b84ae --- /dev/null +++ b/recipes/jom/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + pass + + def test(self): + self.run("jom /VERSION") diff --git a/recipes/jom/all/test_v1_package/conanfile.py b/recipes/jom/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..524a49a286047 --- /dev/null +++ b/recipes/jom/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile +from conan.tools.build import can_run + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def build(self): + pass + + def test(self): + if can_run(self): + self.run("jom /VERSION", run_environment=True) diff --git a/recipes/jom/config.yml b/recipes/jom/config.yml new file mode 100644 index 0000000000000..e1c4f3be24983 --- /dev/null +++ b/recipes/jom/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.3": + folder: all diff --git a/recipes/jpcre2/all/conandata.yml b/recipes/jpcre2/all/conandata.yml new file mode 100644 index 0000000000000..eafde8567d90c --- /dev/null +++ b/recipes/jpcre2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "10.32.01": + sha256: 668cbc6d2c0a065bb6abe8494d5a1bb3549a14cd956a44a2df9095045623ea47 + url: https://github.com/jpcre2/jpcre2/archive/refs/tags/10.32.01.tar.gz diff --git a/recipes/jpcre2/all/conanfile.py b/recipes/jpcre2/all/conanfile.py new file mode 100644 index 0000000000000..f0f2f817d89da --- /dev/null +++ b/recipes/jpcre2/all/conanfile.py @@ -0,0 +1,33 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class Jpcre2Conan(ConanFile): + name = "jpcre2" + homepage = "https://github.com/jpcre2/jpcre2" + description = "Header-only C++ wrapper for PCRE2 library." + topics = ("regex", "pcre2", "header-only", "single-header") + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("pcre2/10.37") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + self.copy("jpcre2.hpp", dst="include", src=os.path.join(self._source_subfolder, "src")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/jpcre2/all/test_package/CMakeLists.txt b/recipes/jpcre2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c2f7a55ce01f3 --- /dev/null +++ b/recipes/jpcre2/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jpcre2 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jpcre2::jpcre2) diff --git a/recipes/jpcre2/all/test_package/conanfile.py b/recipes/jpcre2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3da371b660e0a --- /dev/null +++ b/recipes/jpcre2/all/test_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" + + 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/jpcre2/all/test_package/test_package.cpp b/recipes/jpcre2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dbaa3accd96c7 --- /dev/null +++ b/recipes/jpcre2/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +typedef jpcre2::select jp; + +int main(int, char**) +{ + jp::Regex re; + re.setPattern("Hello (\\S+?)").compile(); + if (!re.match("Hello conan-center-index")) + { + return 1; + } + + return 0; +} diff --git a/recipes/jpcre2/config.yml b/recipes/jpcre2/config.yml new file mode 100644 index 0000000000000..37404362b8cc6 --- /dev/null +++ b/recipes/jpcre2/config.yml @@ -0,0 +1,3 @@ +versions: + "10.32.01": + folder: all diff --git a/recipes/jpeg-compressor/all/CMakeLists.txt b/recipes/jpeg-compressor/all/CMakeLists.txt new file mode 100644 index 0000000000000..dfd323b394ceb --- /dev/null +++ b/recipes/jpeg-compressor/all/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.8) +project(jpeg-compressor LANGUAGES CXX) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +# jpgd lib +set(JPGD_HDR_LIST ${JPEGCOMPRESSOR_SRC_DIR}/jpgd.h ${JPEGCOMPRESSOR_SRC_DIR}/jpgd_idct.h) +add_library(jpgd ${JPEGCOMPRESSOR_SRC_DIR}/jpgd.cpp) +target_include_directories(jpgd PUBLIC ${JPEGCOMPRESSOR_SRC_DIR}) +target_compile_features(jpgd PRIVATE cxx_std_11) + +# jpge lib +set(JPGE_HDR_LIST ${JPEGCOMPRESSOR_SRC_DIR}/jpge.h ${JPEGCOMPRESSOR_SRC_DIR}/jpge.h) +add_library(jpge ${JPEGCOMPRESSOR_SRC_DIR}/jpge.cpp) +target_include_directories(jpge PUBLIC ${JPEGCOMPRESSOR_SRC_DIR}) +target_compile_features(jpge PRIVATE cxx_std_11) + +include(GNUInstallDirs) +install( + TARGETS jpgd jpge + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES ${JPGD_HDR_LIST} ${JPGE_HDR_LIST} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/jpeg-compressor/all/conandata.yml b/recipes/jpeg-compressor/all/conandata.yml new file mode 100644 index 0000000000000..5118d6cb5cb15 --- /dev/null +++ b/recipes/jpeg-compressor/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20200507": + url: "https://github.com/richgel999/jpeg-compressor/archive/aeb7d3b463aa8228b87a28013c15ee50a7e6fcf3.zip" + sha256: "9ecc563e56d7fc18328aa421f7d5c6287e306d14bb8e4c562f439afe32b8a6bd" +patches: + "cci.20200507": + - patch_file: "patches/pr-18-remove-include-malloc.patch" diff --git a/recipes/jpeg-compressor/all/conanfile.py b/recipes/jpeg-compressor/all/conanfile.py new file mode 100644 index 0000000000000..da12e25b8e6e5 --- /dev/null +++ b/recipes/jpeg-compressor/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.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, save +from conan.tools.microsoft import is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class JpegCompressorConan(ConanFile): + name = "jpeg-compressor" + description = "C++ JPEG compression/fuzzed low-RAM JPEG decompression codec with Public Domain or Apache 2.0 license" + homepage = "https://github.com/richgel999/jpeg-compressor" + topics = ("jpeg", "image", "compression", "decompression") + url = "https://github.com/conan-io/conan-center-index" + license = "Unlicense", "Apache-2.0", "MIT" + + 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) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.info.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") + + 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["JPEGCOMPRESSOR_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + with open(os.path.join(self.source_folder, "jpge.cpp")) as f: + content_lines = f.readlines() + license_content = [] + for i in range(4, 20): + license_content.append(content_lines[i][3:-1]) + return "\n".join(license_content) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENCE.txt"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["jpgd", "jpge"] diff --git a/recipes/jpeg-compressor/all/patches/pr-18-remove-include-malloc.patch b/recipes/jpeg-compressor/all/patches/pr-18-remove-include-malloc.patch new file mode 100644 index 0000000000000..4eb98708eb68c --- /dev/null +++ b/recipes/jpeg-compressor/all/patches/pr-18-remove-include-malloc.patch @@ -0,0 +1,13 @@ +# Upstream pull request: https://github.com/richgel999/jpeg-compressor/pull/18 +diff --git a/jpge.cpp b/jpge.cpp +index fd32f2f..221c65b 100644 +--- a/jpge.cpp ++++ b/jpge.cpp +@@ -32,7 +32,6 @@ + + #include + #include +-#include + + #define JPGE_MAX(a,b) (((a)>(b))?(a):(b)) + #define JPGE_MIN(a,b) (((a)<(b))?(a):(b)) diff --git a/recipes/jpeg-compressor/all/test_package/CMakeLists.txt b/recipes/jpeg-compressor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..25752a9cef844 --- /dev/null +++ b/recipes/jpeg-compressor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(jpeg-compressor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jpeg-compressor::jpeg-compressor) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jpeg-compressor/all/test_package/conanfile.py b/recipes/jpeg-compressor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea70607af0172 --- /dev/null +++ b/recipes/jpeg-compressor/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + img_path = os.path.join(self.source_folder, "testimg.jpg") + self.run(f"{bin_path} {img_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 new file mode 100644 index 0000000000000..ef3f49c1a1fba --- /dev/null +++ b/recipes/jpeg-compressor/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#include + +#include "jpge.h" +#include "jpgd.h" + +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 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; + } + + 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; + } + + free(pBuf); + free(pImage_data); + + return EXIT_SUCCESS; +} diff --git a/recipes/jpeg-compressor/all/test_package/testimg.jpg b/recipes/jpeg-compressor/all/test_package/testimg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a026e486f57de704ac5e9344ea20bb9973935e1d GIT binary patch literal 5764 zcmbW)XH*kRmjK{|fOM1+q<0V!iu7It={1x<0{9}GptML;LlnJ7?z4+%xAsGk@+}PG2qpu9+AZ8vuYn008)B050bM zdH|X$SE#R0(NI%U)6&w=F|aW*(9<(;vanudH_NTmw)5K_CiB5ET_A<)7@xKl=bmW-1mz z*;`jwVRxy80@>uEGs|d%bsM|E*5d~v@~%NoY3bOnb8vEriro;GfG8*`DXXZe>D|^h zFf=kYv9Yy-+dCkTZtfnQUfw<^^n>7#(6I1`nAm4=@d=4ZS=l+cdHDs;3tyF2U@EJs zvA8!)%`L5M?fADJdwL0d{R4wT#0k>m)R*a**`?(b^6J|9#^%=H(ecUY*|+aM&i`=% z0ib`g{;dCo{SO!O9~T8BC5V#x9~Y1!^v?t_Q&I`aUSYWfqrMx+DkK+8!={^A*4Rxe zEN^`Pb`2V*V;50a5l8+P z&|Jd&xqhlewzE;Ptp$mALApmGS*is~KNEX0PtwOZelDm7JCBX)ZDlT*ZTz9Hc;(XhfPQY}(U+!{BFx+N8LaMk}uNC4xz=i^*sB-F(Wbp|-LBoXNLwfk&e@cgV~q zHXHeL_6omt;H1IT?>4S);)HnTMm2Nl0q5t$^?0=Z&V`<@Ilpz;#2)(;w9-sZLeNnw zSCYO+ypA%o9S!0W5$03@q?ImNBjzMr-K}x)Yg)gb;^fVpRtR^uY;f2Kdwi(*uL0+2 z5NV3^K|>SzqR@z(0ex+yawiN78B;L4XWh=ZAm)1hq zI#-{=d+^x%<)gi*E&;N}VlyA6`qDJ%l4e;VnSy&17f%Y?MvjiTCCIRrcTl3(_&phA znHf9I=xz&|Z{X3d-q+#si~VbcrFr_C)Z3d#T$Pv%v?gu}*&w8S6=})1JTJEtNbHz< zIJKBU=Bg?C9*(BdI(5ix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z*F`N_XW>1FQU%bHe!cQHfS+fd+?PkeZ)9^ZWu#Qc=h$HFZ z_fCk+`|1hRWBC}n;*iz+G8{R^+E4)G`vA9U>Xv>#n!_t;UqMx4PG97JDu5|YY5qe< zhm_co)B^$X#f}O%H|$u77JHCiU;k(`fqL~0)y)sXNuOAcOOdaMy9szrD)dpo^jOJX ze`{-Q)Y7M#y@>Cx15fNAoKm*DU!qOnA%Hq_78*}dneqF*2)Ij~Id`!IFl7~2ekkO* zla40dld9b*KXTJCA!k4cq%}z@PDQ>P%spXBx1`7=dd~YF>&qLVuDLrqXKCe6^#k)t z=zNP|`_6;&QFNPb?LY1Mb4I_mEk)neVQ-4{-3lTT$W+gZi*Rn&Y}U7`8>WcIb{SI2+lxgCIV z#LoI!)vCcwAY=rGm#PNLCYN(l{{fmkq>*7_=!y3${CEIYB-E`ZwawbFOVpALhSXcu z#WwD-qnWG9-HPC1*y_<^@h)ERS4kad6dUIerZPoGvTmcn^q=X(YvMmT^;@&*v&mU8 zq3!lU{nLGOImt{XFcU{6^}L7Hvdc;0r5}6SG%Q!>R(h4(G$KpSzZ92TSAaRC2c0u+ z6O0+(4vG(M1?sbX?ej-hc77IUAzo~d{pC5O(%w&w&^okE47^IRnxy0%5KBd8$l7_o zYD?>u4IEW9RDjv))Zz>w5L1qF- + +int main() { + jsmn_parser parser; + jsmn_init(&parser); + return 0; +} diff --git a/recipes/jsmn/all/test_v1_package/CMakeLists.txt b/recipes/jsmn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/jsmn/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jsmn/all/test_v1_package/conanfile.py b/recipes/jsmn/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jsmn/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/jsmn/config.yml b/recipes/jsmn/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/jsmn/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/json-c/all/conandata.yml b/recipes/json-c/all/conandata.yml new file mode 100644 index 0000000000000..7ed706059e17c --- /dev/null +++ b/recipes/json-c/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.16": + url: "https://github.com/json-c/json-c/archive/json-c-0.16-20220414.tar.gz" + sha256: "3ecaeedffd99a60b1262819f9e60d7d983844073abc74e495cb822b251904185" + "0.15": + url: "https://github.com/json-c/json-c/archive/json-c-0.15-20200726.tar.gz" + sha256: "4ba9a090a42cf1e12b84c64e4464bb6fb893666841d5843cc5bef90774028882" + "0.14": + url: "https://github.com/json-c/json-c/archive/json-c-0.14-20200419.tar.gz" + sha256: "ec4eb70e0f6c0d707b9b1ec646cf7c860f4abb3562a90ea6e4d78d177fd95303" diff --git a/recipes/json-c/all/conanfile.py b/recipes/json-c/all/conanfile.py new file mode 100644 index 0000000000000..8963e15ae1e8f --- /dev/null +++ b/recipes/json-c/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class JSONCConan(ConanFile): + name = "json-c" + package_type = "library" + description = "JSON-C - A JSON implementation in C" + topics = ("json", "encoding", "decoding", "manipulation") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/json-c/json-c" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "0.15": + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["DISABLE_STATIC_FPIC"] = not self.options.get_safe("fPIC", True) + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "json-c") + self.cpp_info.set_property("cmake_target_name", "json-c::json-c") + self.cpp_info.set_property("pkg_config_name", "json-c") + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/json-c/all/test_package/CMakeLists.txt b/recipes/json-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e91efdaa1c1c --- /dev/null +++ b/recipes/json-c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(json-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE json-c::json-c) diff --git a/recipes/json-c/all/test_package/conanfile.py b/recipes/json-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/json-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/json-c/all/test_package/test_package.c b/recipes/json-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..00498b7373492 --- /dev/null +++ b/recipes/json-c/all/test_package/test_package.c @@ -0,0 +1,29 @@ +#include +#include +#include + +int main() { + /*Creating a json object*/ + json_object * jobj = json_object_new_object(); + + /*Creating a json array*/ + json_object *jarray = json_object_new_array(); + + /*Creating json strings*/ + json_object *jstring1 = json_object_new_string("c"); + json_object *jstring2 = json_object_new_string("c++"); + json_object *jstring3 = json_object_new_string("php"); + + /*Adding the above created json strings to the array*/ + json_object_array_add(jarray,jstring1); + json_object_array_add(jarray,jstring2); + json_object_array_add(jarray,jstring3); + + /*Form the json object*/ + json_object_object_add(jobj,"Categories", jarray); + + /*Now printing the json object*/ + printf ("The json object created: %s\n",json_object_to_json_string(jobj)); + + return EXIT_SUCCESS; +} diff --git a/recipes/json-c/all/test_v1_package/CMakeLists.txt b/recipes/json-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/json-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/json-c/all/test_v1_package/conanfile.py b/recipes/json-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/json-c/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/json-c/config.yml b/recipes/json-c/config.yml new file mode 100644 index 0000000000000..1e4023fe84046 --- /dev/null +++ b/recipes/json-c/config.yml @@ -0,0 +1,7 @@ +versions: + "0.16": + folder: all + "0.15": + folder: all + "0.14": + folder: all diff --git a/recipes/json-schema-validator/all/conandata.yml b/recipes/json-schema-validator/all/conandata.yml new file mode 100644 index 0000000000000..122476811e03f --- /dev/null +++ b/recipes/json-schema-validator/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "2.2.0": + url: "https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.2.0.tar.gz" + sha256: "03897867bd757ecac1db7545babf0c6c128859655b496582a9cea4809c2260aa" + "2.1.0": + url: "https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.1.0.tar.gz" + sha256: "83f61d8112f485e0d3f1e72d51610ba3924b179926a8376aef3c038770faf202" + "2.0.0": + url: "https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.0.0.tar.gz" + sha256: "ca8e4ca5a88c49ea52b5f5c2a08a293dbf02b2fc66cb8c09d4cce5810ee98b57" +patches: + "2.2.0": + - patch_file: "patches/2.2.0-signed-char.patch" + patch_type: "portability" + patch_description: "Fix for PowerPC and ARM" + patch_source: "https://github.com/pboettch/json-schema-validator/pull/242" + "2.1.0": + - patch_file: "patches/2.1.0-cmake_minimum_version.patch" + patch_type: "conan" + patch_description: "CMake: cmake_minimum_version() before project()" + "2.0.0": + - patch_file: "patches/2.0.0-cmake_minimum_version.patch" + patch_type: "conan" + patch_description: "CMake: cmake_minimum_version() before project()" diff --git a/recipes/json-schema-validator/all/conanfile.py b/recipes/json-schema-validator/all/conanfile.py new file mode 100644 index 0000000000000..116cea1b74c21 --- /dev/null +++ b/recipes/json-schema-validator/all/conanfile.py @@ -0,0 +1,142 @@ +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, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class JsonSchemaValidatorConan(ConanFile): + name = "json-schema-validator" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pboettch/json-schema-validator" + description = "JSON schema validator for JSON for Modern C++ " + topics = ("modern-json", "schema-validation", "json") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + short_paths = True + + @property + def _min_cppstd(self): + return "17" if is_msvc(self) and Version(self.version) < "2.1.0" else "11" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15" if Version(self.version) < "2.1.0" else "14", + "msvc": "191" if Version(self.version) < "2.1.0" else "190", + "gcc": "5" if Version(self.version) < "2.1.0" else "4.9", + "clang": "4", + "apple-clang": "9" + } + + 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("nlohmann_json/3.11.2", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "2.2.0": + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_EXAMPLES"] = False + else: + tc.variables["JSON_VALIDATOR_BUILD_TESTS"] = False + tc.variables["JSON_VALIDATOR_BUILD_EXAMPLES"] = False + if Version(self.version) < "2.1.0": + nlohmann_json_includedirs = self.dependencies["nlohmann_json"].cpp_info.aggregated_components().includedirs + tc.variables["NLOHMANN_JSON_DIR"] = ";".join([p.replace("\\", "/") for p in nlohmann_json_includedirs]) + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if Version(self.version) < "2.1.0": + copy(self, "json-schema.hpp", + dst=os.path.join(self.package_folder, "include", "nlohmann"), + src=os.path.join(self.source_folder, "src")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"nlohmann_json_schema_validator": "nlohmann_json_schema_validator::nlohmann_json_schema_validator"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "nlohmann_json_schema_validator") + self.cpp_info.set_property("cmake_target_name", "nlohmann_json_schema_validator") + self.cpp_info.libs = ["json-schema-validator" if Version(self.version) < "2.1.0" else "nlohmann_json_schema_validator"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "nlohmann_json_schema_validator" + self.cpp_info.names["cmake_find_package_multi"] = "nlohmann_json_schema_validator" + 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/json-schema-validator/all/patches/2.0.0-cmake_minimum_version.patch b/recipes/json-schema-validator/all/patches/2.0.0-cmake_minimum_version.patch new file mode 100644 index 0000000000000..511a6d5522051 --- /dev/null +++ b/recipes/json-schema-validator/all/patches/2.0.0-cmake_minimum_version.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt 2019-04-02 10:39:55.000000000 -0000 ++++ b/CMakeLists.txt 2022-11-07 17:09:53.295000000 -0000 +@@ -1,10 +1,10 @@ ++cmake_minimum_required(VERSION 3.2) ++ + project(json-schema-validator + LANGUAGES CXX) + + set(PROJECT_VERSION 2.0.0) + +-cmake_minimum_required(VERSION 3.2) +- + option(BUILD_TESTS "Build tests" ON) + option(BUILD_EXAMPLES "Build examples" ON) + diff --git a/recipes/json-schema-validator/all/patches/2.1.0-cmake_minimum_version.patch b/recipes/json-schema-validator/all/patches/2.1.0-cmake_minimum_version.patch new file mode 100644 index 0000000000000..7936e2adcfe40 --- /dev/null +++ b/recipes/json-schema-validator/all/patches/2.1.0-cmake_minimum_version.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt 2020-05-15 09:04:12.000000000 -0000 ++++ b/CMakeLists.txt 2022-11-07 16:57:29.655000000 -0000 +@@ -1,10 +1,10 @@ ++cmake_minimum_required(VERSION 3.2) ++ + project(nlohmann_json_schema_validator + LANGUAGES CXX) + + set(PROJECT_VERSION 2.1.0) + +-cmake_minimum_required(VERSION 3.2) +- + option(BUILD_TESTS "Build tests" ON) + option(BUILD_EXAMPLES "Build examples" ON) + diff --git a/recipes/json-schema-validator/all/patches/2.2.0-signed-char.patch b/recipes/json-schema-validator/all/patches/2.2.0-signed-char.patch new file mode 100644 index 0000000000000..ffea4bf7ef2e7 --- /dev/null +++ b/recipes/json-schema-validator/all/patches/2.2.0-signed-char.patch @@ -0,0 +1,64 @@ +From 3918616faf989fcf4a9206a34e3b87c23642a96a Mon Sep 17 00:00:00 2001 +From: Robert Joslyn +Date: Wed, 30 Nov 2022 13:07:29 -0800 +Subject: [PATCH] Fix assumed signed char + +The code assumes that char is signed, but whether char is signed or +unsigned is implementation defined. On some architectures like PowerPC, +GCC treats char as unsigned resulting in compile errors: + + smtp-address-validator.cpp:213:1: error: narrowing conversion of '-32' from 'int' to 'char' [-Wnarrowing] + +Fix this by specifying signed char. +--- + src/smtp-address-validator.cpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/smtp-address-validator.cpp b/src/smtp-address-validator.cpp +index a63ead0..3903b51 100644 +--- a/src/smtp-address-validator.cpp ++++ b/src/smtp-address-validator.cpp +@@ -63,7 +63,7 @@ static const short _address_key_offsets[] = { + 1363, 1365, 1367, 1368, 1370, 1388, 0 + }; + +-static const char _address_trans_keys[] = { ++static const signed char _address_trans_keys[] = { + -32, -19, -16, -12, 34, 45, 61, 63, + -62, -33, -31, -17, -15, -13, 33, 39, + 42, 43, 47, 57, 65, 90, 94, 126, +@@ -711,7 +711,7 @@ bool is_address(const char* p, const char* pe) + { + int _klen; + unsigned int _trans = 0; +- const char * _keys; ++ const signed char * _keys; + const signed char * _acts; + unsigned int _nacts; + _resume: {} +@@ -728,9 +728,9 @@ bool is_address(const char* p, const char* pe) + + _klen = (int)_address_single_lengths[cs]; + if ( _klen > 0 ) { +- const char *_lower = _keys; +- const char *_upper = _keys + _klen - 1; +- const char *_mid; ++ const signed char *_lower = _keys; ++ const signed char *_upper = _keys + _klen - 1; ++ const signed char *_mid; + while ( 1 ) { + if ( _upper < _lower ) { + _keys += _klen; +@@ -752,9 +752,9 @@ bool is_address(const char* p, const char* pe) + + _klen = (int)_address_range_lengths[cs]; + if ( _klen > 0 ) { +- const char *_lower = _keys; +- const char *_upper = _keys + (_klen<<1) - 2; +- const char *_mid; ++ const signed char *_lower = _keys; ++ const signed char *_upper = _keys + (_klen<<1) - 2; ++ const signed char *_mid; + while ( 1 ) { + if ( _upper < _lower ) { + _trans += (unsigned int)_klen; diff --git a/recipes/json-schema-validator/all/test_package/CMakeLists.txt b/recipes/json-schema-validator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c2d764c121782 --- /dev/null +++ b/recipes/json-schema-validator/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(nlohmann_json_schema_validator CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} nlohmann_json_schema_validator) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/json-schema-validator/all/test_package/conanfile.py b/recipes/json-schema-validator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/json-schema-validator/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/json-schema-validator/all/test_package/test_package.cpp b/recipes/json-schema-validator/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..00b56ef69b36e --- /dev/null +++ b/recipes/json-schema-validator/all/test_package/test_package.cpp @@ -0,0 +1,65 @@ +#include +#include + +#include "nlohmann/json-schema.hpp" + +using nlohmann::json; +using nlohmann::json_schema::json_validator; + +// The schema is defined based upon a string literal +static json person_schema = R"( +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "A person", + "properties": { + "name": { + "description": "Name", + "type": "string" + }, + "age": { + "description": "Age of the person", + "type": "number", + "minimum": 2, + "maximum": 200 + } + }, + "required": [ + "name", + "age" + ], + "type": "object" +} +)"_json; + +// The people are defined with brace initialization +static json bad_person = {{"age", 42}}; +static json good_person = {{"name", "Albert"}, {"age", 42}}; + +int main() +{ + /* json-parse the schema */ + + json_validator validator; // create validator + + try { + validator.set_root_schema(person_schema); // insert root-schema + } catch (const std::exception &e) { + std::cerr << "Validation of schema failed, here is why: " << e.what() << "\n"; + return EXIT_FAILURE; + } + + /* json-parse the people - API of 1.0.0, default throwing error handler */ + + for (auto &person : {bad_person, good_person}) { + std::cout << "About to validate this person:\n" + << std::setw(2) << person << std::endl; + try { + validator.validate(person); // validate the document - uses the default throwing error-handler + std::cout << "Validation succeeded\n"; + } catch (const std::exception &e) { + std::cerr << "Validation failed, here is why: " << e.what() << "\n"; + } + } + + return EXIT_SUCCESS; +} diff --git a/recipes/json-schema-validator/all/test_v1_package/CMakeLists.txt b/recipes/json-schema-validator/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/json-schema-validator/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/json-schema-validator/all/test_v1_package/conanfile.py b/recipes/json-schema-validator/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/json-schema-validator/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/json-schema-validator/config.yml b/recipes/json-schema-validator/config.yml new file mode 100644 index 0000000000000..ddf20dd4ca819 --- /dev/null +++ b/recipes/json-schema-validator/config.yml @@ -0,0 +1,7 @@ +versions: + "2.2.0": + folder: all + "2.1.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/json_dto/all/conandata.yml b/recipes/json_dto/all/conandata.yml new file mode 100644 index 0000000000000..3d6e5b35876d7 --- /dev/null +++ b/recipes/json_dto/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.2.11": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.11.tar.gz" + sha256: "9ce409a8210ee78ef5b1e60dfb919186ba6a2e928e391e46f0e1d36049e06b1c" + "0.2.12": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.12.tar.gz" + sha256: "3b1ca412a74c339c01bcbf739542fa69b2391d24c321742098a2d6dfa7402d84" + "0.2.13": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.13.tar.gz" + sha256: "ed4138bf86e0724c95508a9c74bed6fa0c98814b96f4cb3a1b540857e2302663" + "0.2.14": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.14.tar.gz" + sha256: "d885fe16cf621f7470a45fb6e955e8aded02958bb2212819dc151feac930905b" + "0.2.15": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.15.tar.gz" + sha256: "d7631d21785ddddc81b2fe04a7998d0d49323c2224168568cb80cc32093da3ac" + "0.3.0": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.3.0.tar.gz" + sha256: "cd497c9ee5556c45aaa3402a23ab935e6a90c1e62076562efd0708d1ec8f4c30" + "0.3.1": + url: "https://github.com/Stiffstream/json_dto/archive/v.0.3.1.tar.gz" + sha256: "515a2d1510d3d8f8b240eb2149f44aeb47a70d26a7071609cca45c0ee198d1d1" diff --git a/recipes/json_dto/all/conanfile.py b/recipes/json_dto/all/conanfile.py new file mode 100644 index 0000000000000..44aa1adf3256a --- /dev/null +++ b/recipes/json_dto/all/conanfile.py @@ -0,0 +1,74 @@ +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 PackageConan(ConanFile): + name = "json_dto" + license = "BSD-3-Clause" + homepage = "https://github.com/Stiffstream/json_dto" + url = "https://github.com/conan-io/conan-center-index" + description = "A small header-only helper for converting data between json representation and c++ structs" + topics = ("json", "dto", "serialization") + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "4", + "apple-clang": "8", + "Visual Studio": "14", + "msvc": "190", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("rapidjson/1.1.0", transitive_headers=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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, 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", "json_dto"), + src=os.path.join(self.source_folder, "dev", "json_dto"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "json-dto") + self.cpp_info.set_property("cmake_target_name", "json-dto::json-dto") + self.cpp_info.names["cmake_find_package"] = "json-dto" + self.cpp_info.names["cmake_find_package_multi"] = "json-dto" diff --git a/recipes/json_dto/all/test_package/CMakeLists.txt b/recipes/json_dto/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..45401a5b844ae --- /dev/null +++ b/recipes/json_dto/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(json-dto REQUIRED CONFIG) + +add_executable(example example.cpp) +target_link_libraries(example json-dto::json-dto) +set_property(TARGET example PROPERTY CXX_STANDARD 14) diff --git a/recipes/json_dto/all/test_package/conanfile.py b/recipes/json_dto/all/test_package/conanfile.py new file mode 100644 index 0000000000000..21d7adcc4bb1c --- /dev/null +++ b/recipes/json_dto/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class JsondtoTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/json_dto/all/test_package/example.cpp b/recipes/json_dto/all/test_package/example.cpp new file mode 100644 index 0000000000000..959a2eed78a41 --- /dev/null +++ b/recipes/json_dto/all/test_package/example.cpp @@ -0,0 +1,76 @@ +#include +#include +#include + +#include +#include + +// Message. +struct message_t +{ + message_t() {} + + message_t( + std::string from, + std::int64_t when, + std::string text ) + : m_from{ std::move( from ) } + , m_when{ when } + , m_text{ std::move( text ) } + {} + + // Who sent a message. + std::string m_from; + // When the message was sent (unixtime). + std::int64_t m_when; + // Message text. + std::string m_text; + + template< typename Json_Io > + void json_io( Json_Io & io ) + { + io & json_dto::mandatory( "from", m_from ) + & json_dto::mandatory( "when", m_when ) + & json_dto::mandatory( "text", m_text ); + } +}; + +const std::string json_data{ +R"JSON({ + "from" : "json_dto", + "when" : 1474884330, + "text" : "Hello world!" +})JSON" }; + +int +main( int , char *[] ) +{ + try + { + { + auto msg = json_dto::from_json< message_t >( json_data ); + + const auto t = static_cast< std::time_t >( msg.m_when ); + std::cout + << "Deserialized from JSON:\n" + << "\tfrom: " << msg.m_from << "\n" + << "\twhen: " << std::ctime( &t ) + << "\ttext: " << msg.m_text << std::endl; + } + + { + const message_t msg{ "json_dto", std::time( nullptr ), "Hello once again!" }; + + std::cout + << "\nSerialized to JSON:\n" + << json_dto::to_json( msg ) << std::endl; + } + } + catch( const std::exception & ex ) + { + std::cerr << "Error: " << ex.what() << "." << std::endl; + return 1; + } + + return 0; +} diff --git a/recipes/json_dto/config.yml b/recipes/json_dto/config.yml new file mode 100644 index 0000000000000..464caddcd4136 --- /dev/null +++ b/recipes/json_dto/config.yml @@ -0,0 +1,15 @@ +versions: + "0.2.11": + folder: all + "0.2.12": + folder: all + "0.2.13": + folder: all + "0.2.14": + folder: all + "0.2.15": + folder: all + "0.3.0": + folder: all + "0.3.1": + folder: all diff --git a/recipes/jsoncons/all/conandata.yml b/recipes/jsoncons/all/conandata.yml new file mode 100644 index 0000000000000..522f8707b0c51 --- /dev/null +++ b/recipes/jsoncons/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.169.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.169.0.tar.gz" + sha256: 423dc99d6950056fb55782513daf74adf37501eaf01b977b2415873cd0c44243 diff --git a/recipes/jsoncons/all/conanfile.py b/recipes/jsoncons/all/conanfile.py new file mode 100644 index 0000000000000..32d3c9bc0d9c9 --- /dev/null +++ b/recipes/jsoncons/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class JsonconsConan(ConanFile): + name = "jsoncons" + description = "A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/danielaparker/jsoncons" + topics = ("json", "csv", "cpp", "json-serialization", "cbor", "json-parser", "messagepack", "json-pointer", "json-patch", "json-diff", "bson", "ubjson", "json-parsing", "jsonpath", "jmespath", "csv-parser", "csv-reader", "jsonschema", "json-construction", "streaming-json-read", "header-only") + 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 + ) + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + # Folders not used for header-only + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "jsoncons") + self.cpp_info.set_property("cmake_target_name", "jsoncons") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "jsoncons" + self.cpp_info.names["cmake_find_package_multi"] = "jsoncons" diff --git a/recipes/jsoncons/all/test_package/CMakeLists.txt b/recipes/jsoncons/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a15fe60ff614b --- /dev/null +++ b/recipes/jsoncons/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(jsoncons CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jsoncons) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jsoncons/all/test_package/conanfile.py b/recipes/jsoncons/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a803ae0923ba5 --- /dev/null +++ b/recipes/jsoncons/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 + +required_conan_version = ">=1.50.0" + +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/jsoncons/all/test_package/test_package.cpp b/recipes/jsoncons/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c0ab09763124a --- /dev/null +++ b/recipes/jsoncons/all/test_package/test_package.cpp @@ -0,0 +1,49 @@ +#include +#include +#include + +using namespace jsoncons; // for convenience + +std::string data = R"( + { + "application": "hiking", + "reputons": [ + { + "rater": "HikingAsylum", + "assertion": "advanced", + "rated": "Marilyn C", + "rating": 0.90, + "generated": 1514862245 + } + ] + } +)"; + +int main() +{ + // Parse the string of data into a json value + json j = json::parse(data); + + // Does object member reputons exist? + std::cout << "(1) " << std::boolalpha << j.contains("reputons") << "\n\n"; + + // Get a reference to reputons array + const json& v = j["reputons"]; + + // Iterate over reputons array + std::cout << "(2)\n"; + for (const auto& item : v.array_range()) + { + // Access rated as string and rating as double + std::cout << item["rated"].as() << ", " << item["rating"].as() << "\n"; + } + std::cout << "\n"; + + // Select all "rated" with JSONPath + std::cout << "(3)\n"; + json result = jsonpath::json_query(j,"$..rated"); + std::cout << pretty_print(result) << "\n\n"; + + // Serialize back to JSON + std::cout << "(4)\n" << pretty_print(j) << "\n\n"; +} diff --git a/recipes/jsoncons/all/test_v1_package/CMakeLists.txt b/recipes/jsoncons/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2e4adc0eddf16 --- /dev/null +++ b/recipes/jsoncons/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jsoncons CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jsoncons::jsoncons) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jsoncons/all/test_v1_package/conanfile.py b/recipes/jsoncons/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8037a9296cc42 --- /dev/null +++ b/recipes/jsoncons/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jsoncons/config.yml b/recipes/jsoncons/config.yml new file mode 100644 index 0000000000000..0354650b51267 --- /dev/null +++ b/recipes/jsoncons/config.yml @@ -0,0 +1,3 @@ +versions: + "0.169.0": + folder: "all" diff --git a/recipes/jsoncpp/all/conandata.yml b/recipes/jsoncpp/all/conandata.yml new file mode 100644 index 0000000000000..b5b4f5372dd99 --- /dev/null +++ b/recipes/jsoncpp/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "1.9.5": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.5.tar.gz + sha256: f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2 + "1.9.4": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.4.tar.gz + sha256: e34a628a8142643b976c7233ef381457efad79468c67cb1ae0b83a33d7493999 + "1.9.3": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.3.tar.gz + sha256: 8593c1d69e703563d94d8c12244e2e18893eeb9a8a9f8aa3d09a327aa45c8f7d + "1.9.2": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.2.tar.gz + sha256: 77a402fb577b2e0e5d0bdc1cf9c65278915cdb25171e3452c68b6da8a561f8f0 + "1.9.1": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.1.tar.gz + sha256: c7b40f5605dd972108f503f031b20186f5e5bca2b65cd4b8bd6c3e4ba8126697 + "1.8.3": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.8.3.tar.gz + sha256: 3671ba6051e0f30849942cc66d1798fdf0362d089343a83f704c09ee7156604f +patches: + "1.9.3": + - patch_file: "patches/dont-force-pic-1.9.3.patch" + "1.9.2": + - patch_file: "patches/dont-force-pic-1.9.2.patch" + - patch_file: "patches/no-examples.patch" + "1.9.1": + - patch_file: "patches/implicit-conversion-1.9.1.patch" + - patch_file: "patches/dont-force-pic-1.9.1.patch" + "1.8.3": + - patch_file: "patches/implicit-conversion-1.8.3.patch" diff --git a/recipes/jsoncpp/all/conanfile.py b/recipes/jsoncpp/all/conanfile.py new file mode 100644 index 0000000000000..1354ccb9d1943 --- /dev/null +++ b/recipes/jsoncpp/all/conanfile.py @@ -0,0 +1,131 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, save +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class JsoncppConan(ConanFile): + name = "jsoncpp" + license = "MIT" + homepage = "https://github.com/open-source-parsers/jsoncpp" + url = "https://github.com/conan-io/conan-center-index" + topics = ("json", "parser", "config") + description = "A C++ library for interacting with JSON." + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JSONCPP_WITH_TESTS"] = False + tc.variables["JSONCPP_WITH_WARNING_AS_ERROR"] = False + tc.variables["JSONCPP_WITH_CMAKE_PACKAGE"] = False + tc.variables["JSONCPP_WITH_STRICT_ISO"] = False + tc.variables["JSONCPP_WITH_PKGCONFIG_SUPPORT"] = False + jsoncpp_version = Version(self.version) + if jsoncpp_version < "1.9.0" or jsoncpp_version >= "1.9.4": + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + if jsoncpp_version >= "1.9.3": + tc.variables["JSONCPP_WITH_EXAMPLE"] = False + if jsoncpp_version >= "1.9.4": + tc.variables["BUILD_OBJECT_LIBS"] = False + if jsoncpp_version < "1.9.0": + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + # No opt-out of ccache + if Version(self.version) < "1.9.3": + tc.cache_variables["CCACHE_FOUND"] = "" + else: + tc.cache_variables["CCACHE_EXECUTABLE"] = "" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if is_msvc(self) and str(self.settings.compiler.version) in ("11", "170"): + replace_in_file(self, os.path.join(self.source_folder, "include", "json", "value.h"), + "explicit operator bool()", + "operator bool()") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "JsonCpp::JsonCpp": "jsoncpp::jsoncpp", # alias target since 1.9.5 + "jsoncpp_lib": "jsoncpp::jsoncpp", # imported target for shared lib, but also static between 1.9.0 & 1.9.3 + "jsoncpp_static": "jsoncpp::jsoncpp", # imported target for static lib if >= 1.9.4 + "jsoncpp_lib_static": "jsoncpp::jsoncpp", # imported target for static lib if < 1.9.0 + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "jsoncpp") + self.cpp_info.set_property("cmake_target_name", "JsonCpp::JsonCpp") + self.cpp_info.set_property( + "cmake_target_aliases", + ["jsoncpp_lib"] if self.options.shared else ["jsoncpp_lib", "jsoncpp_static", "jsoncpp_lib_static"], + ) + self.cpp_info.set_property("pkg_config_name", "jsoncpp") + self.cpp_info.libs = ["jsoncpp"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("JSON_DLL") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/jsoncpp/all/patches/dont-force-pic-1.9.1.patch b/recipes/jsoncpp/all/patches/dont-force-pic-1.9.1.patch new file mode 100644 index 0000000000000..0f009a95efb8a --- /dev/null +++ b/recipes/jsoncpp/all/patches/dont-force-pic-1.9.1.patch @@ -0,0 +1,10 @@ +--- a/src/lib_json/CMakeLists.txt ++++ b/src/lib_json/CMakeLists.txt +@@ -76,7 +76,6 @@ add_library(jsoncpp_lib ${PUBLIC_HEADERS} ${jsoncpp_sources}) + set_target_properties( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_SOVERSION}) + set_target_properties( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp + DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} ) +-set_target_properties( jsoncpp_lib PROPERTIES POSITION_INDEPENDENT_CODE ON) + + # Set library's runtime search path on OSX + if(APPLE) diff --git a/recipes/jsoncpp/all/patches/dont-force-pic-1.9.2.patch b/recipes/jsoncpp/all/patches/dont-force-pic-1.9.2.patch new file mode 100644 index 0000000000000..f2fecc6dd68cd --- /dev/null +++ b/recipes/jsoncpp/all/patches/dont-force-pic-1.9.2.patch @@ -0,0 +1,10 @@ +--- a/src/lib_json/CMakeLists.txt ++++ b/src/lib_json/CMakeLists.txt +@@ -84,7 +84,6 @@ add_library(jsoncpp_lib ${PUBLIC_HEADERS} ${jsoncpp_sources}) + set_target_properties( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_SOVERSION}) + set_target_properties( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp + DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} ) +-set_target_properties( jsoncpp_lib PROPERTIES POSITION_INDEPENDENT_CODE ON) + + # Set library's runtime search path on OSX + if(APPLE) diff --git a/recipes/jsoncpp/all/patches/dont-force-pic-1.9.3.patch b/recipes/jsoncpp/all/patches/dont-force-pic-1.9.3.patch new file mode 100644 index 0000000000000..f3f9c742693cb --- /dev/null +++ b/recipes/jsoncpp/all/patches/dont-force-pic-1.9.3.patch @@ -0,0 +1,10 @@ +--- a/src/lib_json/CMakeLists.txt ++++ b/src/lib_json/CMakeLists.txt +@@ -79,7 +79,6 @@ set_target_properties( jsoncpp_lib PROPERTIES + OUTPUT_NAME jsoncpp + VERSION ${JSONCPP_VERSION} + SOVERSION ${JSONCPP_SOVERSION} +- POSITION_INDEPENDENT_CODE ON + ) + + # Set library's runtime search path on OSX diff --git a/recipes/jsoncpp/all/patches/implicit-conversion-1.8.3.patch b/recipes/jsoncpp/all/patches/implicit-conversion-1.8.3.patch new file mode 100644 index 0000000000000..76ce6a4de728a --- /dev/null +++ b/recipes/jsoncpp/all/patches/implicit-conversion-1.8.3.patch @@ -0,0 +1,13 @@ +fixed in 1.9.2 by https://github.com/open-source-parsers/jsoncpp/pull/1023 + +--- a/src/lib_json/json_value.cpp ++++ b/src/lib_json/json_value.cpp +@@ -70,7 +70,7 @@ static inline bool InRange(double d, T min, U max) { + // The casts can lose precision, but we are looking only for + // an approximate range. Might fail on edge cases though. ~cdunn + //return d >= static_cast(min) && d <= static_cast(max); +- return d >= min && d <= max; ++ return d >= static_cast(min) && d <= static_cast(max); + } + #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + static inline double integerToDouble(Json::UInt64 value) { diff --git a/recipes/jsoncpp/all/patches/implicit-conversion-1.9.1.patch b/recipes/jsoncpp/all/patches/implicit-conversion-1.9.1.patch new file mode 100644 index 0000000000000..54460b3a5e1f3 --- /dev/null +++ b/recipes/jsoncpp/all/patches/implicit-conversion-1.9.1.patch @@ -0,0 +1,13 @@ +fixed in 1.9.2 by https://github.com/open-source-parsers/jsoncpp/pull/1023 + +--- a/src/lib_json/json_value.cpp ++++ b/src/lib_json/json_value.cpp +@@ -112,7 +112,7 @@ static inline bool InRange(double d, T min, U max) { + // The casts can lose precision, but we are looking only for + // an approximate range. Might fail on edge cases though. ~cdunn + // return d >= static_cast(min) && d <= static_cast(max); +- return d >= min && d <= max; ++ return d >= static_cast(min) && d <= static_cast(max); + } + #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + static inline double integerToDouble(Json::UInt64 value) { diff --git a/recipes/jsoncpp/all/patches/no-examples.patch b/recipes/jsoncpp/all/patches/no-examples.patch new file mode 100644 index 0000000000000..ab1e2b327ebc6 --- /dev/null +++ b/recipes/jsoncpp/all/patches/no-examples.patch @@ -0,0 +1,7 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -228,4 +228,3 @@ add_subdirectory( src ) + add_subdirectory( include ) + + #install the example +-add_subdirectory( example ) diff --git a/recipes/jsoncpp/all/test_package/CMakeLists.txt b/recipes/jsoncpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a610a43f2758 --- /dev/null +++ b/recipes/jsoncpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(jsoncpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE JsonCpp::JsonCpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jsoncpp/all/test_package/conanfile.py b/recipes/jsoncpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/jsoncpp/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/jsoncpp/all/test_package/test_package.cpp b/recipes/jsoncpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3a9cbd0c491db --- /dev/null +++ b/recipes/jsoncpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) +{ + Json::Value value("Hello, World"); + std::cout << value.asString() << std::endl; + return 0; +} diff --git a/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt b/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jsoncpp/all/test_v1_package/conanfile.py b/recipes/jsoncpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jsoncpp/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/jsoncpp/config.yml b/recipes/jsoncpp/config.yml new file mode 100644 index 0000000000000..e11b41080c02a --- /dev/null +++ b/recipes/jsoncpp/config.yml @@ -0,0 +1,13 @@ +versions: + "1.9.5": + folder: all + "1.9.4": + folder: all + "1.9.3": + folder: all + "1.9.2": + folder: all + "1.9.1": + folder: all + "1.8.3": + folder: all diff --git a/recipes/jsonformoderncpp/all/conandata.yml b/recipes/jsonformoderncpp/all/conandata.yml new file mode 100644 index 0000000000000..4a57b4331cec4 --- /dev/null +++ b/recipes/jsonformoderncpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.7.0": + sha256: D51A3A8D3EFBB1139D7608E28782EA9EFEA7E7933157E8FF8184901EFD8EE760 + url: https://github.com/nlohmann/json/archive/v3.7.0.tar.gz diff --git a/recipes/jsonformoderncpp/all/conanfile.py b/recipes/jsonformoderncpp/all/conanfile.py new file mode 100644 index 0000000000000..cd09e5d797c73 --- /dev/null +++ b/recipes/jsonformoderncpp/all/conanfile.py @@ -0,0 +1,54 @@ +from conans import ConanFile, tools, CMake +import os + +required_conan_version = ">=1.28.0" + +class JsonformoderncppConan(ConanFile): + name = "jsonformoderncpp" + homepage = "https://github.com/nlohmann/json" + description = "JSON for Modern C++ parser and generator." + topics = ("conan", "jsonformoderncpp", "json", "header-only") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "arch", "build_type" + no_copy_source = True + license = "MIT" + deprecated = "nlohmann_json" + options = { + "multiple_headers": [True, False] + } + default_options = { + "multiple_headers": False + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "json-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["JSON_BuildTests"] = False + cmake.definitions["JSON_MultipleHeaders"] = self.options.multiple_headers + cmake.configure(source_folder=self._source_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib")) + try: + os.remove(os.path.join(self.package_folder, "nlohmann_json.natvis")) + except FileNotFoundError: + pass + + def package_id(self): + self.info.header_only() diff --git a/recipes/jsonformoderncpp/all/test_package/CMakeLists.txt b/recipes/jsonformoderncpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/jsonformoderncpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/jsonformoderncpp/all/test_package/conanfile.py b/recipes/jsonformoderncpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/jsonformoderncpp/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jsonformoderncpp/all/test_package/test_package.cpp b/recipes/jsonformoderncpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e7ea2ba241a83 --- /dev/null +++ b/recipes/jsonformoderncpp/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include + +using json = nlohmann::json; + +int main() { + const json data = { + {"pi", 3.141}, + {"happy", true}, + {"name", "Niels"}, + {"nothing", nullptr}, + {"answer", { + {"everything", 42} + }}, + {"list", {1, 0, 2}}, + {"object", { + {"currency", "USD"}, + {"value", 42.99} + }} + }; + + std::cout << data.dump(4) << std::endl; + return 0; +} diff --git a/recipes/jsonformoderncpp/config.yml b/recipes/jsonformoderncpp/config.yml new file mode 100644 index 0000000000000..20ddf579e6d44 --- /dev/null +++ b/recipes/jsonformoderncpp/config.yml @@ -0,0 +1,3 @@ +versions: + "3.7.0": + folder: all diff --git a/recipes/jsonnet/all/CMakeLists.txt b/recipes/jsonnet/all/CMakeLists.txt new file mode 100644 index 0000000000000..881b1cb39250b --- /dev/null +++ b/recipes/jsonnet/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory(source_subfolder) diff --git a/recipes/jsonnet/all/conandata.yml b/recipes/jsonnet/all/conandata.yml new file mode 100644 index 0000000000000..af6fab5053143 --- /dev/null +++ b/recipes/jsonnet/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "0.19.1": + url: "https://github.com/google/jsonnet/archive/v0.19.1.tar.gz" + sha256: "f5a20f2dc98fdebd5d42a45365f52fa59a7e6b174e43970fea4f9718a914e887" + "0.18.0": + url: "https://github.com/google/jsonnet/archive/v0.18.0.tar.gz" + sha256: "85c240c4740f0c788c4d49f9c9c0942f5a2d1c2ae58b2c71068107bc80a3ced4" + "0.17.0": + url: "https://github.com/google/jsonnet/archive/v0.17.0.tar.gz" + sha256: "076b52edf888c01097010ad4299e3b2e7a72b60a41abbc65af364af1ed3c8dbe" +patches: + "0.19.1": + - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" + base_path: "source_subfolder" + - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" + base_path: "source_subfolder" + "0.18.0": + - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" + base_path: "source_subfolder" + - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" + base_path: "source_subfolder" + "0.17.0": + - patch_file: "patches/0.17.0/0001-fix-nlohmann-include.patch" + base_path: "source_subfolder" + - patch_file: "patches/0.17.0/0002-cmake-fixes.patch" + base_path: "source_subfolder" diff --git a/recipes/jsonnet/all/conanfile.py b/recipes/jsonnet/all/conanfile.py new file mode 100644 index 0000000000000..ff9c2346a3e5f --- /dev/null +++ b/recipes/jsonnet/all/conanfile.py @@ -0,0 +1,109 @@ +import functools +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc, msvc_runtime_flag + +required_conan_version = ">=1.33.0" + + +class JsonnetConan(ConanFile): + name = "jsonnet" + description = "Jsonnet - The data templating language" + topics = ("config", "json", "functional", "configuration") + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/jsonnet" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake", "cmake_find_package" + + @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): + if self.options.shared: + del self.options.fPIC + # This is a workround. + # If jsonnet is shared, rapidyaml must be built as shared, + # or the c4core functions that rapidyaml depends on will not be able to be found. + # This seems to be a issue of rapidyaml. + # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 + if tools.Version(self.version) >= "0.18.0": + self.options["rapidyaml"].shared = True + + def requirements(self): + self.requires("nlohmann_json/3.10.5") + if tools.Version(self.version) >= "0.18.0": + self.requires("rapidyaml/0.4.1") + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("jsonnet does not support cross building") + + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "11") + + if self.options.shared and is_msvc(self) and "d" in msvc_runtime_flag(self): + raise ConanInvalidConfiguration("shared {} is not supported with MTd/MDd runtime".format(self.name)) + + 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 source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_TESTS"] = False + cmake.definitions["BUILD_STATIC_LIBS"] = not self.options.shared + cmake.definitions["BUILD_SHARED_BINARIES"] = False + cmake.definitions["BUILD_JSONNET"] = False + cmake.definitions["BUILD_JSONNETFMT"] = False + cmake.definitions["USE_SYSTEM_JSON"] = True + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.components["libjsonnet"].libs = ["jsonnet"] + self.cpp_info.components["libjsonnet"].requires = ["nlohmann_json::nlohmann_json"] + if tools.Version(self.version) >= "0.18.0": + self.cpp_info.components["libjsonnet"].requires.append("rapidyaml::rapidyaml") + + if tools.stdcpp_library(self): + self.cpp_info.components["libjsonnet"].system_libs.append(tools.stdcpp_library(self)) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libjsonnet"].system_libs.append("m") + + self.cpp_info.components["libjsonnetpp"].libs = ["jsonnet++"] + self.cpp_info.components["libjsonnetpp"].requires = ["libjsonnet"] diff --git a/recipes/jsonnet/all/patches/0.17.0/0001-fix-nlohmann-include.patch b/recipes/jsonnet/all/patches/0.17.0/0001-fix-nlohmann-include.patch new file mode 100644 index 0000000000000..71f250f322ba7 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.17.0/0001-fix-nlohmann-include.patch @@ -0,0 +1,11 @@ +--- a/core/vm.cpp ++++ b/core/vm.cpp +@@ -23,7 +23,7 @@ limitations under the License. + + #include "desugarer.h" + #include "json.h" +-#include "json.hpp" ++#include + #include "md5.h" + #include "parser.h" + #include "state.h" diff --git a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch new file mode 100644 index 0000000000000..6d8e892eb89a7 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch @@ -0,0 +1,87 @@ +- install headers +- optionally disable shared build +- add md5 objects to c library +- allow MSVC +--- core/CMakeLists.txt ++++ core/CMakeLists.txt +@@ -16,8 +16,8 @@ set(LIBJSONNET_HEADERS + string_utils.h + unicode.h + vm.h) +- +-set(LIBJSONNET_SOURCE ++install(FILES ../include/libjsonnet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++set(LIBJSONNET_SOURCE $ + desugarer.cpp + formatter.cpp + lexer.cpp +@@ -27,7 +27,7 @@ set(LIBJSONNET_SOURCE + static_analysis.cpp + string_utils.cpp + vm.cpp) +- ++if (NOT BUILD_STATIC_LIBS) + add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) + add_dependencies(libjsonnet md5 stdlib) + target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json) +@@ -50,7 +50,7 @@ install(TARGETS libjsonnet +- PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + target_include_directories(libjsonnet INTERFACE + $) +- ++endif() + if (BUILD_STATIC_LIBS) + # Static library for jsonnet command-line tool. + add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) +--- cpp/CMakeLists.txt ++++ cpp/CMakeLists.txt +@@ -3,11 +3,11 @@ + set(LIBJSONNETPP_HEADERS + ../include/libjsonnet++.h + ) +- ++install(FILES ${LIBJSONNETPP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + set(LIBJSONNETPP_SOURCE + libjsonnet++.cpp + ) +- ++if (NOT BUILD_STATIC_LIBS) + add_library(libjsonnet++ SHARED ${LIBJSONNETPP_HEADERS} ${LIBJSONNETPP_SOURCE}) + add_dependencies(libjsonnet++ jsonnet) +-# target_link_libraries(libjsonnet libjsonnet) ++target_link_libraries(libjsonnet++ libjsonnet) +@@ -24,7 +24,7 @@ +- PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + target_include_directories(libjsonnet++ INTERFACE + $) +- ++endif() + if (BUILD_STATIC_LIBS) + # Static library for jsonnet command-line tool. + add_library(libjsonnet++_static STATIC ${LIBJSONNETPP_SOURCE}) +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -40,7 +40,7 @@ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") + else() + # TODO: Windows support. +- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") ++ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + + set(CMAKE_CXX_STANDARD 11) +--- stdlib/CMakeLists.txt ++++ stdlib/CMakeLists.txt +@@ -5,7 +5,7 @@ + # Custom command that will only build stdlib when it changes. + add_custom_command( + OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h +- COMMAND ${GLOBAL_OUTPUT_PATH}/to_c_array ++ COMMAND to_c_array + ${PROJECT_SOURCE_DIR}/stdlib/std.jsonnet + ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h + DEPENDS to_c_array std.jsonnet) + + diff --git a/recipes/jsonnet/all/patches/0.18.0/0001-fix-nlohmann-include.patch b/recipes/jsonnet/all/patches/0.18.0/0001-fix-nlohmann-include.patch new file mode 100644 index 0000000000000..7f3a0ce643004 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.18.0/0001-fix-nlohmann-include.patch @@ -0,0 +1,13 @@ +diff --git a/core/vm.cpp b/core/vm.cpp +index 1fd8ab9..636d227 100644 +--- a/core/vm.cpp ++++ b/core/vm.cpp +@@ -23,7 +23,7 @@ limitations under the License. + + #include "desugarer.h" + #include "json.h" +-#include "json.hpp" ++#include + #include "md5.h" + #include "parser.h" + #include "ryml_std.hpp" // include this before any other ryml header diff --git a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch new file mode 100644 index 0000000000000..505ce96c21e93 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch @@ -0,0 +1,103 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5df20ca..c14c93c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,7 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") + else() + # TODO: Windows support. +- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") ++ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + + set(CMAKE_CXX_STANDARD 11) +@@ -121,7 +121,6 @@ endif() + add_subdirectory(include) + add_subdirectory(stdlib) + add_subdirectory(third_party/md5) +-add_subdirectory(third_party/rapidyaml/rapidyaml ryml) + add_subdirectory(core) + add_subdirectory(cpp) + add_subdirectory(cmd) +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index e62a858..c0389f8 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS + unicode.h + vm.h) + +-set(LIBJSONNET_SOURCE ++install(FILES ../include/libjsonnet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++set(LIBJSONNET_SOURCE $ + desugarer.cpp + formatter.cpp + lexer.cpp +@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE + string_utils.cpp + vm.cpp) + ++if (NOT BUILD_STATIC_LIBS) + add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) + add_dependencies(libjsonnet md5 stdlib) + target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) +@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet + install(TARGETS libjsonnet + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + target_include_directories(libjsonnet INTERFACE + $) +- ++endif() + if (BUILD_STATIC_LIBS) + # Static library for jsonnet command-line tool. + add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index eb7686c..cbf21bb 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -4,13 +4,15 @@ set(LIBJSONNETPP_HEADERS + ../include/libjsonnet++.h + ) + ++install(FILES ${LIBJSONNETPP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + set(LIBJSONNETPP_SOURCE + libjsonnet++.cpp + ) + ++if (NOT BUILD_STATIC_LIBS) + add_library(libjsonnet++ SHARED ${LIBJSONNETPP_HEADERS} ${LIBJSONNETPP_SOURCE}) + add_dependencies(libjsonnet++ jsonnet) +-# target_link_libraries(libjsonnet libjsonnet) ++target_link_libraries(libjsonnet++ libjsonnet) + + # CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without + # this step the output would be |liblibjsonnet|. +@@ -21,10 +23,10 @@ set_target_properties(libjsonnet++ PROPERTIES OUTPUT_NAME jsonnet++ + install(TARGETS libjsonnet++ + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + target_include_directories(libjsonnet++ INTERFACE + $) +- ++endif() + if (BUILD_STATIC_LIBS) + # Static library for jsonnet command-line tool. + add_library(libjsonnet++_static STATIC ${LIBJSONNETPP_SOURCE}) +diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt +index a481d9f..00ff502 100644 +--- a/stdlib/CMakeLists.txt ++++ b/stdlib/CMakeLists.txt +@@ -5,7 +5,7 @@ add_executable(to_c_array to_c_array.cpp) + # Custom command that will only build stdlib when it changes. + add_custom_command( + OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h +- COMMAND ${GLOBAL_OUTPUT_PATH}/to_c_array ++ COMMAND to_c_array + ${PROJECT_SOURCE_DIR}/stdlib/std.jsonnet + ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h + DEPENDS to_c_array std.jsonnet) diff --git a/recipes/jsonnet/all/test_package/CMakeLists.txt b/recipes/jsonnet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b1f60f164ad79 --- /dev/null +++ b/recipes/jsonnet/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jsonnet CONFIG REQUIRED) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c jsonnet::libjsonnet) + +add_executable(${PROJECT_NAME}_cxx test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cxx jsonnet::libjsonnetpp) +set_property(TARGET ${PROJECT_NAME}_cxx PROPERTY CXX_STANDARD 11) diff --git a/recipes/jsonnet/all/test_package/conanfile.py b/recipes/jsonnet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1460ef0546803 --- /dev/null +++ b/recipes/jsonnet/all/test_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): + self.run(os.path.join("bin", "test_package_c"), run_environment=True) + self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) diff --git a/recipes/jsonnet/all/test_package/test_package.c b/recipes/jsonnet/all/test_package/test_package.c new file mode 100644 index 0000000000000..0ea235af13aac --- /dev/null +++ b/recipes/jsonnet/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +#include + +int main() { + struct JsonnetVm* vm = jsonnet_make(); + jsonnet_max_stack(vm, 10); + printf("%s\n", jsonnet_version()); + return 0; +} + diff --git a/recipes/jsonnet/all/test_package/test_package.cpp b/recipes/jsonnet/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62c5fc4ccecc9 --- /dev/null +++ b/recipes/jsonnet/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +#include + +int main() { + // C++ library + jsonnet::Jsonnet j; + if (!j.init()) { + return 1; + } + std::cout << jsonnet::Jsonnet::version() << "\n"; + return 0; +} diff --git a/recipes/jsonnet/config.yml b/recipes/jsonnet/config.yml new file mode 100644 index 0000000000000..d98d76db4349a --- /dev/null +++ b/recipes/jsonnet/config.yml @@ -0,0 +1,7 @@ +versions: + "0.19.1": + folder: all + "0.18.0": + folder: all + "0.17.0": + folder: all diff --git a/recipes/jthread-lite/all/conandata.yml b/recipes/jthread-lite/all/conandata.yml new file mode 100644 index 0000000000000..89098bae1b3b5 --- /dev/null +++ b/recipes/jthread-lite/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: https://github.com/martinmoene/jthread-lite/archive/v0.1.0.tar.gz + sha256: 05d8f591a83b5c3ea7361c178ddad6cb91ab7ab4c07a792c273667a004843ecd diff --git a/recipes/jthread-lite/all/conanfile.py b/recipes/jthread-lite/all/conanfile.py new file mode 100644 index 0000000000000..efd2ef2fde6ab --- /dev/null +++ b/recipes/jthread-lite/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class JthreadLiteConan(ConanFile): + name = "jthread-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/jthread-lite" + description = "jthread lite - C++20's jthread for C++11 and later in a single-file header-only library " + topics = ("jthread-lite", "jthread", "cpp11") + license = "BSL-1.0" + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.txt", 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "jthread-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::jthread-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + # TODO: back to global scope once cmake_find_package* generators removed + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["jthreadlite"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "jthread-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "jthread-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["jthreadlite"].names["cmake_find_package"] = "jthread-lite" + self.cpp_info.components["jthreadlite"].names["cmake_find_package_multi"] = "jthread-lite" + self.cpp_info.components["jthreadlite"].set_property("cmake_target_name", "nonstd::jthread-lite") + self.cpp_info.components["jthreadlite"].bindirs = [] + self.cpp_info.components["jthreadlite"].libdirs = [] diff --git a/recipes/jthread-lite/all/test_package/CMakeLists.txt b/recipes/jthread-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4310ed8c6ce1f --- /dev/null +++ b/recipes/jthread-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(jthread-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::jthread-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jthread-lite/all/test_package/conanfile.py b/recipes/jthread-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/jthread-lite/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/jthread-lite/all/test_package/test_package.cpp b/recipes/jthread-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fdb2234e59574 --- /dev/null +++ b/recipes/jthread-lite/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include "nonstd/jthread.hpp" +#include + +using nonstd::jthread; + +int main() +{ + int product = 0; + const int six = 6; + const int seven = 7; + + { + nonstd::jthread thr{[&](int x, int y){ product = x * y; }, six, seven }; + + // automatically join thread here, making sure it has executed: + } + + return !( product == six * seven ); +} diff --git a/recipes/jthread-lite/all/test_v1_package/CMakeLists.txt b/recipes/jthread-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/jthread-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jthread-lite/all/test_v1_package/conanfile.py b/recipes/jthread-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jthread-lite/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/jthread-lite/config.yml b/recipes/jthread-lite/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/jthread-lite/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/jungle/all/CMakeLists.txt b/recipes/jungle/all/CMakeLists.txt new file mode 100644 index 0000000000000..d2b01e47d9d63 --- /dev/null +++ b/recipes/jungle/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.11) +project(jungle) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory("source_subfolder") diff --git a/recipes/jungle/all/conandata.yml b/recipes/jungle/all/conandata.yml new file mode 100644 index 0000000000000..bd27aef1a8932 --- /dev/null +++ b/recipes/jungle/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "cci.20220801": + url: "https://github.com/eBay/Jungle/archive/f41b7123489f1bc942a6b76dc54485391485cd27.tar.gz" + sha256: 8667a114bcef661b2a93e627a68b0584931f182dc8b96693ce6901d903584ab8 + "cci.20221201": + url: "https://github.com/eBay/Jungle/archive/289105763172418eeb37fbeeb6d2fe2a58834715.tar.gz" + sha256: df07fff42e2c4087d96e617d8d976c2856b9dfcef95a0a7255004ed272ca2361 +patches: + "cci.20220801": + - patch_file: "patches/0001-cmake-alterations.patch" + patch_description: "CMake dependency discovery outside subtree." + patch_type: "conan" + base_path: "source_subfolder" + sha256: "a7111a290e145717ae0cbdace9866db69c70782731c8568a806f8579e30759eb" + - patch_file: "patches/0002-forestdb-path.patch" + patch_description: "Update include macros for ForestDB headers." + patch_type: "conan" + base_path: "source_subfolder" + sha256: "84ec45a312c52e2fa8cb7ab615aaa11088f24dcb4e4b880340b46c2763900d6b" + - patch_file: "patches/0003-stdatomic.patch" + patch_description: "Include std::atomic from all compilers." + patch_type: "portability" + base_path: "source_subfolder" + sha256: "3ca66676f89e2425255eeb15bf18a77ae21c4f383124013bd6d1cb660cbc1544" + "cci.20221201": + - patch_file: "patches/0004-cmake-alterations-cci.20221201.patch" + patch_description: "CMake dependency discovery outside subtree." + patch_type: "conan" + base_path: "source_subfolder" + sha256: "a7111a290e145717ae0cbdace9866db69c70782731c8568a806f8579e30759eb" + - patch_file: "patches/0002-forestdb-path.patch" + patch_description: "Update include macros for ForestDB headers." + patch_type: "conan" + base_path: "source_subfolder" + sha256: "84ec45a312c52e2fa8cb7ab615aaa11088f24dcb4e4b880340b46c2763900d6b" + - patch_file: "patches/0003-stdatomic.patch" + patch_description: "Include std::atomic from all compilers." + patch_type: "portability" + base_path: "source_subfolder" + sha256: "3ca66676f89e2425255eeb15bf18a77ae21c4f383124013bd6d1cb660cbc1544" diff --git a/recipes/jungle/all/conanfile.py b/recipes/jungle/all/conanfile.py new file mode 100644 index 0000000000000..5350d8f70668d --- /dev/null +++ b/recipes/jungle/all/conanfile.py @@ -0,0 +1,76 @@ +from os.path import join +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.build import check_min_cppstd +from conans import CMake + +required_conan_version = ">=1.50.0" + +class JungleConan(ConanFile): + name = "jungle" + homepage = "https://github.com/eBay/Jungle" + description = "Key-value storage library, based on a combined index of LSM-tree and copy-on-write B+tree" + topics = ("kv-store", "cow") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch_file in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch_file["patch_file"]) + + def requirements(self): + self.requires("forestdb/cci.20220727") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + src_dir = join(self.source_folder, self._source_subfolder) + copy(self, "LICENSE*", src_dir, join(self.package_folder, "licenses")) + + hdr_src = join(src_dir, "include") + copy(self, "*.h", hdr_src, join(self.package_folder, "include"), keep_path=True) + + lib_dir = join(self.package_folder, "lib") + copy(self, "*.a", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.lib", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.so*", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.dylib*", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.dll*", self.build_folder, join(self.package_folder, "bin"), keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["jungle"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl"]) diff --git a/recipes/jungle/all/patches/0001-cmake-alterations.patch b/recipes/jungle/all/patches/0001-cmake-alterations.patch new file mode 100644 index 0000000000000..77f5f46560539 --- /dev/null +++ b/recipes/jungle/all/patches/0001-cmake-alterations.patch @@ -0,0 +1,52 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,7 +100,8 @@ if (TESTSUITE_NO_COLOR GREATER 0) + add_definitions(-DTESTSUITE_NO_COLOR=1) + endif() + +-file(COPY ${CMAKE_SOURCE_DIR}/scripts/runtests.sh ++find_package(forestdb REQUIRED) ++file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/runtests.sh + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + + # === CUSTOM LOGGER === +@@ -187,16 +191,16 @@ set(JUNGLE_DEPS + ${LIBDL}) + + add_library(static_lib ${JUNGLE_CORE}) +-target_link_libraries(static_lib ${JUNGLE_DEPS}) ++target_link_libraries(static_lib forestdb::forestdb) + set_target_properties(static_lib PROPERTIES OUTPUT_NAME jungle + CLEAN_DIRECT_OUTPUT 1) + if (DETACH_LOGGER GREATER 0) + add_dependencies(static_lib simplelogger_lib) + endif () + +-add_subdirectory("${PROJECT_SOURCE_DIR}/examples") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/examples") +-add_subdirectory("${PROJECT_SOURCE_DIR}/tests") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/tests") +-add_subdirectory("${PROJECT_SOURCE_DIR}/tools") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/tools") + + if (CODE_COVERAGE GREATER 0) + SETUP_TARGET_FOR_COVERAGE( +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -1,14 +1,11 @@ + set(TEST_DIR ${PROJECT_SOURCE_DIR}/tests) + set(UNIT_TEST_DIR ${TEST_DIR}/unit) + set(JUNGLE_TEST_DIR ${TEST_DIR}/jungle) + set(STRESS_TEST_DIR ${TEST_DIR}/stress) + + set(JUNGLE_TEST_DEPS +- ${CMAKE_CURRENT_BINARY_DIR}/../libjungle.a +- ${LIBSIMPLELOGGER} +- ${FDB_LIB_DIR}/libforestdb.a +- ${LIBSNAPPY} +- ${LIBDL}) ++ static_lib ++ forestdb::forestdb) + + set(FILEOPS_TEST ${TEST_DIR}/unit/fileops_test.cc) + add_executable(fileops_test ${FILEOPS_TEST}) diff --git a/recipes/jungle/all/patches/0002-forestdb-path.patch b/recipes/jungle/all/patches/0002-forestdb-path.patch new file mode 100644 index 0000000000000..547b2635d3042 --- /dev/null +++ b/recipes/jungle/all/patches/0002-forestdb-path.patch @@ -0,0 +1,62 @@ +diff --git a/src/cmd_handler.cc b/src/cmd_handler.cc +index 12cf591..14c42b4 100644 +--- a/src/cmd_handler.cc ++++ b/src/cmd_handler.cc +@@ -22,7 +22,7 @@ limitations under the License. + #include "skiplist.h" + #include "table_mgr.h" + +-#include ++#include + + #include + #include +diff --git a/src/table_file.cc b/src/table_file.cc +index 69ca237..80c7648 100644 +--- a/src/table_file.cc ++++ b/src/table_file.cc +@@ -21,7 +21,7 @@ limitations under the License. + #include "internal_helper.h" + #include "table_mgr.h" + +-#include ++#include + + #include _MACRO_TO_STR(LOGGER_H) + +diff --git a/src/table_file.h b/src/table_file.h +index ab7a29d..fd4bc4c 100644 +--- a/src/table_file.h ++++ b/src/table_file.h +@@ -21,7 +21,7 @@ limitations under the License. + #include "table_lookup_booster.h" + + #include +-#include ++#include + + #include + #include +@@ -450,4 +450,3 @@ private: + + + } // namespace jungle +- +--- a/tests/jungle/builder_test.cc ++++ b/tests/jungle/builder_test.cc +@@ -16,7 +16,7 @@ limitations under the License. + + #include "jungle_test_common.h" + +-#include "jungle_builder.h" ++#include "tools/jungle_builder.h" + #include "libjungle/iterator.h" + #include "libjungle/jungle.h" + #include "libjungle/sized_buf.h" +@@ -275,4 +275,4 @@ int main(int argc, char** argv) { + ts.doTest("build an empty db test", build_an_empty_db_test); + + return 0; +-} +\ No newline at end of file ++} diff --git a/recipes/jungle/all/patches/0003-stdatomic.patch b/recipes/jungle/all/patches/0003-stdatomic.patch new file mode 100644 index 0000000000000..f56b9cb06270b --- /dev/null +++ b/recipes/jungle/all/patches/0003-stdatomic.patch @@ -0,0 +1,13 @@ +diff --git a/src/skiplist.h b/src/skiplist.h +index 15f5fb7..5c24461 100644 +--- a/src/skiplist.h ++++ b/src/skiplist.h +@@ -29,7 +29,7 @@ limitations under the License. + struct _skiplist_node; + + //#define _STL_ATOMIC (1) +-#ifdef __APPLE__ ++#if __has_include() + #define _STL_ATOMIC (1) + #endif + #if defined(_STL_ATOMIC) && defined(__cplusplus) diff --git a/recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch b/recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch new file mode 100644 index 0000000000000..ae047df397a10 --- /dev/null +++ b/recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,7 +106,8 @@ if (LOGGER_NO_BACKTRACE GREATER 0) + message(STATUS "---- NO BACKTRACE BY LOGGER ----") + endif() + +-file(COPY ${CMAKE_SOURCE_DIR}/scripts/runtests.sh ++find_package(forestdb REQUIRED) ++file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/runtests.sh + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + + # === CUSTOM LOGGER === +@@ -193,16 +194,16 @@ set(JUNGLE_DEPS + ${LIBDL}) + + add_library(static_lib ${JUNGLE_CORE}) +-target_link_libraries(static_lib ${JUNGLE_DEPS}) ++target_link_libraries(static_lib forestdb::forestdb) + set_target_properties(static_lib PROPERTIES OUTPUT_NAME jungle + CLEAN_DIRECT_OUTPUT 1) + if (DETACH_LOGGER GREATER 0) + add_dependencies(static_lib simplelogger_lib) + endif () + +-add_subdirectory("${PROJECT_SOURCE_DIR}/examples") +-add_subdirectory("${PROJECT_SOURCE_DIR}/tests") +-add_subdirectory("${PROJECT_SOURCE_DIR}/tools") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/examples") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/tests") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/tools") + + if (CODE_COVERAGE GREATER 0) + SETUP_TARGET_FOR_COVERAGE( +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -5,10 +5,7 @@ set(STRESS_TEST_DIR ${TEST_DIR}/stress) + + set(JUNGLE_TEST_DEPS + static_lib +- ${LIBSIMPLELOGGER} +- ${FDB_LIB_DIR}/libforestdb.a +- ${LIBSNAPPY} +- ${LIBDL}) ++ forestdb:forestdb) + + set(FILEOPS_TEST ${TEST_DIR}/unit/fileops_test.cc) + add_executable(fileops_test ${FILEOPS_TEST}) + diff --git a/recipes/jungle/all/test_package/CMakeLists.txt b/recipes/jungle/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..354670d11c755 --- /dev/null +++ b/recipes/jungle/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.11) +set(CMAKE_CXX_STANDARD 11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jungle CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} jungle::jungle) diff --git a/recipes/jungle/all/test_package/conanfile.py b/recipes/jungle/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9ebf26743f34b --- /dev/null +++ b/recipes/jungle/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile +from conan.tools.build import cross_building +from conans import CMake +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jungle/all/test_package/test_package.cpp b/recipes/jungle/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..756f927a89ccd --- /dev/null +++ b/recipes/jungle/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +#include +#include + +int main(void) { + jungle::DB *dbInst; + jungle::Status s; + jungle::DBConfig db_config; + + s = jungle::DB::open(&dbInst, ".", db_config); + + assert(s.ok()); + + std::cout << "Success\n"; + return 0; +} diff --git a/recipes/jungle/config.yml b/recipes/jungle/config.yml new file mode 100644 index 0000000000000..f95f42a22df32 --- /dev/null +++ b/recipes/jungle/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220801": + folder: all + "cci.20221201": + folder: all diff --git a/recipes/jwasm/all/conandata.yml b/recipes/jwasm/all/conandata.yml new file mode 100644 index 0000000000000..b89fdd80dcbde --- /dev/null +++ b/recipes/jwasm/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.13": + url: "https://github.com/JWasm/JWasm/archive/2.13.tar.gz" + sha256: "82bc14860ec1d0552daeffbd202f83f9bba6a2756056b5e21ef81fabdb8e83a4" +patches: + "2.13": + - patch_file: "patches/0001-2.13-fix-fatal-errors-msvc.patch" + patch_description: "Fix 64-bit MSVC" + patch_type: "backport" + patch_source: "https://github.com/Baron-von-Riedesel/JWasm/pull/10" + - patch_file: "patches/0002-fix-cmake.patch" + patch_description: "Fix CMake to add an install target & honor vc runtime" + patch_type: "compatibility" diff --git a/recipes/jwasm/all/conanfile.py b/recipes/jwasm/all/conanfile.py new file mode 100644 index 0000000000000..682db91532894 --- /dev/null +++ b/recipes/jwasm/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get +import os + +required_conan_version = ">=1.46.0" + + +class JwasmConan(ConanFile): + name = "jwasm" + description = "JWasm is intended to be a free Masm-compatible assembler." + license = "Watcom-1.0" + topics = ("jwasm", "masm", "assembler") + homepage = "https://github.com/JWasm/JWasm" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def configure(self): + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def package_id(self): + del self.info.settings.compiler + + 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.generate() + + 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.frameworkdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + 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) diff --git a/recipes/jwasm/all/patches/0001-2.13-fix-fatal-errors-msvc.patch b/recipes/jwasm/all/patches/0001-2.13-fix-fatal-errors-msvc.patch new file mode 100644 index 0000000000000..c21adbbcdf316 --- /dev/null +++ b/recipes/jwasm/all/patches/0001-2.13-fix-fatal-errors-msvc.patch @@ -0,0 +1,21 @@ +--- main.c ++++ main.c +@@ -69,7 +69,7 @@ int main( int argc, char **argv ) + /* v2.11: _findfirst/next/close() handle, should be of type intptr_t. + * since this type isn't necessarily defined, type long is used as substitute. + */ +- long fh; ++ intptr_t fh; + const char *pfn; + int dirsize; + struct _finddata_t finfo; +--- parser.c ++++ parser.c +@@ -2794,6 +2794,7 @@ ret_code ParseLine( struct asm_tok tokenarray[] ) + Token_Count, GetCurrOffset() )); + + i = 0; ++ oldofs = 0; + + /* Does line start with a code label? */ + if ( tokenarray[0].token == T_ID && ( tokenarray[1].token == T_COLON || tokenarray[1].token == T_DBL_COLON ) ) { diff --git a/recipes/jwasm/all/patches/0002-fix-cmake.patch b/recipes/jwasm/all/patches/0002-fix-cmake.patch new file mode 100644 index 0000000000000..74477754d1d0c --- /dev/null +++ b/recipes/jwasm/all/patches/0002-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,20 +1,9 @@ +-cmake_minimum_required (VERSION 2.8) ++cmake_minimum_required (VERSION 3.1) + +-project(jwasm) ++project(jwasm LANGUAGES C) + + include_directories(H) + if (WIN32) +-set(CompilerFlags +- CMAKE_CXX_FLAGS +- CMAKE_CXX_FLAGS_DEBUG +- CMAKE_CXX_FLAGS_RELEASE +- CMAKE_C_FLAGS +- CMAKE_C_FLAGS_DEBUG +- CMAKE_C_FLAGS_RELEASE +- ) +-foreach(CompilerFlag ${CompilerFlags}) +- string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") +-endforeach() + add_definitions(-D__NT__ -DNDEBUG -DDEBUG_OUT -D_CRT_SECURE_NO_WARNINGS) + else() + add_definitions(-D__UNIX__ -DNDEBUG -DDEBUG_OUT) +@@ -23,3 +12,5 @@ endif() + FILE(GLOB all_c_files *.c) + LIST(REMOVE_ITEM all_c_files ${CMAKE_CURRENT_SOURCE_DIR}/trmem.c) + add_executable(jwasm ${all_c_files}) ++include(GNUInstallDirs) ++install(TARGETS jwasm DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/recipes/jwasm/all/test_package/Lin64_1.asm b/recipes/jwasm/all/test_package/Lin64_1.asm new file mode 100644 index 0000000000000..eae422aded44a --- /dev/null +++ b/recipes/jwasm/all/test_package/Lin64_1.asm @@ -0,0 +1,24 @@ +;--- "hello world" for 64-bit Linux, using SYSCALL. +;--- assemble: JWasm -elf64 -Fo=Lin64_1.o Lin64_1.asm +;--- link: gcc Lin64_1.o -o Lin64_1 + +stdout equ 1 +SYS_WRITE equ 1 +SYS_EXIT equ 60 + + .data + +string db 10,"Hello, world!",10 + + .code + +_start: + mov edx, sizeof string + mov rsi, offset string + mov edi, stdout + mov eax, SYS_WRITE + syscall + mov eax, SYS_EXIT + syscall + + end _start diff --git a/recipes/jwasm/all/test_package/conanfile.py b/recipes/jwasm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ab2cfc01b81ac --- /dev/null +++ b/recipes/jwasm/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def test(self): + self.run("jwasm -h", ignore_errors=True) + obj_file = os.path.join(self.build_folder, "Lin64_1.o") + asm_file = os.path.join(self.source_folder, "Lin64_1.asm") # content from https://www.japheth.de/JWasm/Lin64_1.html + self.run(f"jwasm -elf64 -Fo={obj_file} {asm_file}") + if self._settings_build.os == "Linux" and self._settings_build.arch == "x86_64": + bin_file = os.path.join(self.build_folder, "Lin64_1") + self.run(f"ld {obj_file} -o {bin_file}") + self.run(bin_file, ignore_errors=True) diff --git a/recipes/jwasm/all/test_v1_package/conanfile.py b/recipes/jwasm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2f48a81c3461c --- /dev/null +++ b/recipes/jwasm/all/test_v1_package/conanfile.py @@ -0,0 +1,24 @@ +from conans import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def test(self): + self.run("jwasm -h", ignore_errors=True) + obj_file = os.path.join(self.build_folder, "Lin64_1.o") + asm_file = os.path.join(self.source_folder, os.pardir, "test_package", "Lin64_1.asm") # content from https://www.japheth.de/JWasm/Lin64_1.html + self.run(f"jwasm -elf64 -Fo={obj_file} {asm_file}") + if self._settings_build.os == "Linux" and self._settings_build.arch == "x86_64": + bin_file = os.path.join(self.build_folder, "Lin64_1") + self.run(f"ld {obj_file} -o {bin_file}") + self.run(bin_file, ignore_errors=True) diff --git a/recipes/jwasm/config.yml b/recipes/jwasm/config.yml new file mode 100644 index 0000000000000..f059e28ae48aa --- /dev/null +++ b/recipes/jwasm/config.yml @@ -0,0 +1,3 @@ +versions: + "2.13": + folder: all diff --git a/recipes/jwt-cpp/all/conandata.yml b/recipes/jwt-cpp/all/conandata.yml new file mode 100644 index 0000000000000..bf093248fb260 --- /dev/null +++ b/recipes/jwt-cpp/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "0.6.0": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.6.0.tar.gz" + sha256: "0227bd6e0356b211341075c7997c837f0b388c01379bd256aa525566a5553f03" + "0.5.1": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.5.1.tar.gz" + sha256: "d8f5ffb361824630b3b6f4aad26c730c915081071040c232ac57947d6177ef4f" + "0.5.0": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.5.0.tar.gz" + sha256: "079a273f070dd11213e301712319a65881e51ab81535cc436d5313191df852a2" + "0.4.0": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.4.0.tar.gz" + sha256: "f0dcc7b0e8bef8f9c3f434e7121f9941145042c9fe3055a5bdd709085a4f2be4" + "0.3.1": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.3.1.tar.gz" + sha256: "399345e81883f2959df658cd945de39548ddfefdab2acf7b23ee07b9e9a02938" +patches: + "0.6.0": + - patch_file: "patches/0005-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" + "0.5.1": + - patch_file: "patches/0004-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" + "0.5.0": + - patch_file: "patches/0004-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" + "0.4.0": + - patch_file: "patches/0003-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" + "0.3.1": + - patch_file: "patches/0002-fix-openssl-change-version.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py new file mode 100644 index 0000000000000..75e913785ea24 --- /dev/null +++ b/recipes/jwt-cpp/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class JwtCppConan(ConanFile): + name = "jwt-cpp" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Thalhammer/jwt-cpp" + description = "A C++ JSON Web Token library for encoding/decoding" + topics = ("json", "jwt", "jws", "jwe", "jwk", "jwks", "jose", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _supports_generic_json(self): + return Version(self.version) >= "0.5.0" + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + self.requires("openssl/1.1.1s") + if not self._supports_generic_json: + self.requires("picojson/1.3.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def layout(self): + basic_layout(self, src_folder="src") + + def build(self): + apply_conandata_patches(self) + + def package(self): + header_dir = os.path.join(self.source_folder, "include", "jwt-cpp") + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "jwt-cpp"), src=header_dir, keep_path=True) + copy(self, "LICENSE", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "jwt-cpp") + self.cpp_info.set_property("cmake_target_name", "jwt-cpp::jwt-cpp") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "jwt-cpp" + self.cpp_info.names["cmake_find_package_multi"] = "jwt-cpp" + + if self._supports_generic_json: + self.cpp_info.defines.append("JWT_DISABLE_PICOJSON") + + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/jwt-cpp/all/patches/0002-fix-openssl-change-version.patch b/recipes/jwt-cpp/all/patches/0002-fix-openssl-change-version.patch new file mode 100644 index 0000000000000..5f7ebf5039c2d --- /dev/null +++ b/recipes/jwt-cpp/all/patches/0002-fix-openssl-change-version.patch @@ -0,0 +1,12 @@ +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -75,7 +75,7 @@ namespace jwt { + inline + std::string extract_pubkey_from_cert(const std::string& certstr, const std::string& pw = "") { + // TODO: Cannot find the exact version this change happended +-#if OPENSSL_VERSION_NUMBER <= 0x1000114fL ++#if OPENSSL_VERSION_NUMBER <= 0x10100003L + std::unique_ptr certbio(BIO_new_mem_buf(const_cast(certstr.data()), certstr.size()), BIO_free_all); + #else + std::unique_ptr certbio(BIO_new_mem_buf(certstr.data(), certstr.size()), BIO_free_all); diff --git a/recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch b/recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch new file mode 100644 index 0000000000000..f39c242b85498 --- /dev/null +++ b/recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch @@ -0,0 +1,6 @@ +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -3,1 +3,1 @@ +-#include "picojson/picojson.h" ++#include "picojson.h" diff --git a/recipes/jwt-cpp/all/patches/0004-fix-picojson-header-location-for-conan.patch b/recipes/jwt-cpp/all/patches/0004-fix-picojson-header-location-for-conan.patch new file mode 100644 index 0000000000000..73eec6e1ac73c --- /dev/null +++ b/recipes/jwt-cpp/all/patches/0004-fix-picojson-header-location-for-conan.patch @@ -0,0 +1,6 @@ +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -8,1 +8,1 @@ +-#include "picojson/picojson.h" ++#include "picojson.h" diff --git a/recipes/jwt-cpp/all/patches/0005-fix-picojson-header-location-for-conan.patch b/recipes/jwt-cpp/all/patches/0005-fix-picojson-header-location-for-conan.patch new file mode 100644 index 0000000000000..af50870b9da7f --- /dev/null +++ b/recipes/jwt-cpp/all/patches/0005-fix-picojson-header-location-for-conan.patch @@ -0,0 +1,12 @@ +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -8,1 +8,1 @@ +-#include "picojson/picojson.h" ++#include "picojson.h" +diff --git a/include/jwt-cpp/traits/kazuho-picojson/traits.h b/include/jwt-cpp/traits/kazuho-picojson/traits.h +--- a/include/jwt-cpp/traits/kazuho-picojson/traits.h ++++ b/include/jwt-cpp/traits/kazuho-picojson/traits.h +@@ -7,1 +7,1 @@ +-#include "picojson/picojson.h" ++#include "picojson.h" diff --git a/recipes/jwt-cpp/all/test_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..020cb1aab4c7d --- /dev/null +++ b/recipes/jwt-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(jwt-cpp REQUIRED CONFIG) +find_package(picojson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jwt-cpp::jwt-cpp picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if (jwt-cpp_VERSION VERSION_GREATER 0.4.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE JSON_TRAITS_NEEDED) +endif() + +if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.6.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_DEFAULT_TRAITS) +endif() diff --git a/recipes/jwt-cpp/all/test_package/conanfile.py b/recipes/jwt-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8c80e56ec63d3 --- /dev/null +++ b/recipes/jwt-cpp/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 + + +class JsonCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("picojson/1.3.0") + + 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/jwt-cpp/all/test_package/test_package.cpp b/recipes/jwt-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a7af84c85dc7c --- /dev/null +++ b/recipes/jwt-cpp/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include + +#ifdef JSON_TRAITS_NEEDED + #ifndef HAS_DEFAULT_TRAITS + #include "traits/defaults.h" + #else + #include + #endif +#endif + +#include + +int main() { + auto token = jwt::create() + .set_issuer("auth0") + .set_issued_at(std::chrono::system_clock::now()) + .set_expires_at(std::chrono::system_clock::now() + std::chrono::seconds{3600}) + .sign(jwt::algorithm::hs256{"secret"}); + + auto decoded = jwt::decode(token); + for(auto& e : decoded.get_payload_claims()) + std::cout << e.first << " = " << e.second.to_json() << std::endl; + + auto verifier = jwt::verify() + .allow_algorithm(jwt::algorithm::hs256{"secret"}) + .with_issuer("auth0"); + + verifier.verify(decoded); +} diff --git a/recipes/jwt-cpp/all/test_package/traits/defaults.h b/recipes/jwt-cpp/all/test_package/traits/defaults.h new file mode 100644 index 0000000000000..7ec119bedd233 --- /dev/null +++ b/recipes/jwt-cpp/all/test_package/traits/defaults.h @@ -0,0 +1,58 @@ +#ifndef JWT_CPP_KAZUHO_PICOJSON_DEFAULTS_H +#define JWT_CPP_KAZUHO_PICOJSON_DEFAULTS_H + +#include "traits.h" + +namespace jwt { + /** + * \brief a class to store a generic [picojson](https://github.com/kazuho/picojson) value as claim + * + * This type is the specialization of the \ref basic_claim class which + * uses the standard template types. + */ + using claim = basic_claim; + + /** + * Create a verifier using the default clock + * \return verifier instance + */ + inline verifier verify() { + return verify(default_clock{}); + } + + /** + * Return a builder instance to create a new token + */ + inline builder create() { return builder(); } + +#ifndef JWT_DISABLE_BASE64 + /** + * Decode a token + * \param token Token to decode + * \return Decoded token + * \throw std::invalid_argument Token is not in correct format + * \throw std::runtime_error Base64 decoding failed or invalid json + */ + inline decoded_jwt decode(const std::string& token) { + return decoded_jwt(token); + } +#endif + + /** + * Decode a token + * \tparam Decode is callabled, taking a string_type and returns a string_type. + * It should ensure the padding of the input and then base64url decode and + * return the results. + * \param token Token to decode + * \param decode The token to parse + * \return Decoded token + * \throw std::invalid_argument Token is not in correct format + * \throw std::runtime_error Base64 decoding failed or invalid json + */ + template + decoded_jwt decode(const std::string& token, Decode decode) { + return decoded_jwt(token, decode); + } +} // namespace jwt + +#endif // JWT_CPP_KAZUHO_PICOJSON_DEFAULTS_H diff --git a/recipes/jwt-cpp/all/test_package/traits/traits.h b/recipes/jwt-cpp/all/test_package/traits/traits.h new file mode 100644 index 0000000000000..099f0dc26ce34 --- /dev/null +++ b/recipes/jwt-cpp/all/test_package/traits/traits.h @@ -0,0 +1,76 @@ +#ifndef JWT_CPP_PICOJSON_TRAITS_H +#define JWT_CPP_PICOJSON_TRAITS_H + +#ifndef PICOJSON_USE_INT64 +#define PICOJSON_USE_INT64 +#endif +#include + +#ifndef JWT_DISABLE_PICOJSON +#define JWT_DISABLE_PICOJSON +#endif +#include "jwt-cpp/jwt.h" + +namespace jwt { + namespace traits { + struct kazuho_picojson { + using value_type = picojson::value; + using object_type = picojson::object; + using array_type = picojson::array; + using string_type = std::string; + using number_type = double; + using integer_type = int64_t; + using boolean_type = bool; + + static json::type get_type(const picojson::value& val) { + using json::type; + if (val.is()) return type::boolean; + if (val.is()) return type::integer; + if (val.is()) return type::number; + if (val.is()) return type::string; + if (val.is()) return type::array; + if (val.is()) return type::object; + + throw std::logic_error("invalid type"); + } + + static picojson::object as_object(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static std::string as_string(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static picojson::array as_array(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static int64_t as_int(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static bool as_bool(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static double as_number(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static bool parse(picojson::value& val, const std::string& str) { + return picojson::parse(val, str).empty(); + } + + static std::string serialize(const picojson::value& val) { return val.serialize(); } + }; + } // namespace traits +} // namespace jwt + +#endif diff --git a/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d58f9a64ba28e --- /dev/null +++ b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(jwt-cpp REQUIRED CONFIG) +find_package(picojson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jwt-cpp::jwt-cpp picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if (jwt-cpp_VERSION VERSION_GREATER 0.4.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE JSON_TRAITS_NEEDED) +endif() + +if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.6.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_DEFAULT_TRAITS) +endif() diff --git a/recipes/jwt-cpp/all/test_v1_package/conanfile.py b/recipes/jwt-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3f782b39bbd4f --- /dev/null +++ b/recipes/jwt-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +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 requirements(self): + self.requires("picojson/1.3.0") + + 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/jwt-cpp/config.yml b/recipes/jwt-cpp/config.yml new file mode 100644 index 0000000000000..49536ba2e770d --- /dev/null +++ b/recipes/jwt-cpp/config.yml @@ -0,0 +1,11 @@ +versions: + "0.6.0": + folder: all + "0.5.1": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all + "0.3.1": + folder: all diff --git a/recipes/jxrlib/all/CMakeLists.txt b/recipes/jxrlib/all/CMakeLists.txt new file mode 100644 index 0000000000000..f4e654c29be7f --- /dev/null +++ b/recipes/jxrlib/all/CMakeLists.txt @@ -0,0 +1,89 @@ +cmake_minimum_required(VERSION 3.1) +project(jxrlib LANGUAGES C) + +include(GNUInstallDirs) +include(TestBigEndian) + +if(NOT MSVC) + add_definitions(-D__ANSI__) +endif() + +test_big_endian(ISBIGENDIAN) +if(ISBIGENDIAN) + set(DEF_ENDIAN _BIG__ENDIAN_) +endif() + +include_directories( + ${JPEGXR_FOLDER}/common/include + ${JPEGXR_FOLDER}/image/sys + ${JPEGXR_FOLDER}/jxrgluelib + ${JPEGXR_FOLDER}/jxrtestlib +) + +# JPEG-XR + +set(JPEGXR_SOURCES + ${JPEGXR_FOLDER}/image/sys/adapthuff.c + ${JPEGXR_FOLDER}/image/sys/image.c + ${JPEGXR_FOLDER}/image/sys/strcodec.c + ${JPEGXR_FOLDER}/image/sys/strPredQuant.c + ${JPEGXR_FOLDER}/image/sys/strTransform.c + ${JPEGXR_FOLDER}/image/sys/perfTimerANSI.c + + ${JPEGXR_FOLDER}/image/decode/decode.c + ${JPEGXR_FOLDER}/image/decode/postprocess.c + ${JPEGXR_FOLDER}/image/decode/segdec.c + ${JPEGXR_FOLDER}/image/decode/strdec.c + ${JPEGXR_FOLDER}/image/decode/strInvTransform.c + ${JPEGXR_FOLDER}/image/decode/strPredQuantDec.c + ${JPEGXR_FOLDER}/image/decode/JXRTranscode.c + + ${JPEGXR_FOLDER}/image/encode/encode.c + ${JPEGXR_FOLDER}/image/encode/segenc.c + ${JPEGXR_FOLDER}/image/encode/strenc.c + ${JPEGXR_FOLDER}/image/encode/strFwdTransform.c + ${JPEGXR_FOLDER}/image/encode/strPredQuantEnc.c +) +add_library(jpegxr ${JPEGXR_SOURCES}) +set_property(TARGET jpegxr PROPERTY COMPILE_DEFINITIONS DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN}) +set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") +install(TARGETS jpegxr + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +# JXR-GLUE + +set(JXRGLUE_SOURCES + ${JPEGXR_FOLDER}/jxrgluelib/JXRGlue.c + ${JPEGXR_FOLDER}/jxrgluelib/JXRMeta.c + ${JPEGXR_FOLDER}/jxrgluelib/JXRGluePFC.c + ${JPEGXR_FOLDER}/jxrgluelib/JXRGlueJxr.c + + ${JPEGXR_FOLDER}/jxrtestlib/JXRTest.c + ${JPEGXR_FOLDER}/jxrtestlib/JXRTestBmp.c + ${JPEGXR_FOLDER}/jxrtestlib/JXRTestHdr.c + ${JPEGXR_FOLDER}/jxrtestlib/JXRTestPnm.c + ${JPEGXR_FOLDER}/jxrtestlib/JXRTestTif.c + ${JPEGXR_FOLDER}/jxrtestlib/JXRTestYUV.c +) +add_library(jxrglue ${JXRGLUE_SOURCES}) +target_link_libraries(jxrglue jpegxr) +set_property(TARGET jxrglue PROPERTY COMPILE_DEFINITIONS DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN}) +set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") +install(TARGETS jxrglue + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES + ${JPEGXR_FOLDER}/jxrgluelib/JXRGlue.h + ${JPEGXR_FOLDER}/jxrgluelib/JXRMeta.h + ${JPEGXR_FOLDER}/jxrtestlib/JXRTest.h + ${JPEGXR_FOLDER}/image/sys/windowsmediaphoto.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Headers +) +install(DIRECTORY ${JPEGXR_FOLDER}/common/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h" +) diff --git a/recipes/jxrlib/all/conandata.yml b/recipes/jxrlib/all/conandata.yml new file mode 100644 index 0000000000000..478aec5f4b6b6 --- /dev/null +++ b/recipes/jxrlib/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20170615": + url: "https://github.com/4creators/jxrlib/archive/f7521879862b9085318e814c6157490dd9dbbdb4.tar.gz" + sha256: "8ab20a21f6c3f8cfdedd2511b03a2009e52cce7fa6550202c355063d0d83213e" +patches: + "cci.20170615": + - patch_file: patches/0001-missing-declarations.patch diff --git a/recipes/jxrlib/all/conanfile.py b/recipes/jxrlib/all/conanfile.py new file mode 100644 index 0000000000000..d4c71b54de455 --- /dev/null +++ b/recipes/jxrlib/all/conanfile.py @@ -0,0 +1,89 @@ +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 +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + + +class JxrlibConan(ConanFile): + name = "jxrlib" + description = "jxrlib is JPEG XR Image Codec reference implementation library released by Microsoft under BSD-2-Clause License." + homepage = "https://jxrlib.codeplex.com/" + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-2-Clause" + topics = ("jxr", "jpeg", "xr") + + 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, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + + 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["JPEGXR_FOLDER"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libjxr") + self.cpp_info.libs = ["jxrglue", "jpegxr"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if not is_msvc(self): + self.cpp_info.defines.append("__ANSI__") + + # TODO: to remove in conan v2, and do not port this to CMakeDeps, it was a mistake + self.cpp_info.names["cmake_find_package"] = "JXR" + self.cpp_info.names["cmake_find_package_multi"] = "JXR" diff --git a/recipes/jxrlib/all/patches/0001-missing-declarations.patch b/recipes/jxrlib/all/patches/0001-missing-declarations.patch new file mode 100644 index 0000000000000..767eec49ea788 --- /dev/null +++ b/recipes/jxrlib/all/patches/0001-missing-declarations.patch @@ -0,0 +1,26 @@ +--- a/image/decode/segdec.c ++++ b/image/decode/segdec.c +@@ -52,6 +52,13 @@ static Int DecodeSignificantAbsLevel (struct CAdaptiveHuffman *pAHexpt, BitIOInf + //================================================================ + // Memory access functions + //================================================================ ++#ifndef _BIG__ENDIAN_ ++#if (defined(WIN32) && !defined(UNDER_CE)) || (defined(UNDER_CE) && defined(_ARM_)) ++// WinCE ARM and Desktop x86 ++#else ++U32 _byteswap_ulong(U32 bits); ++#endif ++#endif + static U32 _FORCEINLINE _load4(void* pv) + { + #ifdef _BIG__ENDIAN_ +--- a/jxrgluelib/JXRGlueJxr.c ++++ b/jxrgluelib/JXRGlueJxr.c +@@ -27,6 +27,7 @@ + // + //*@@@---@@@@****************************************************************** + #include ++#include + #include + + diff --git a/recipes/jxrlib/all/test_package/CMakeLists.txt b/recipes/jxrlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e7689f4130d27 --- /dev/null +++ b/recipes/jxrlib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(jxrlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jxrlib::jxrlib) diff --git a/recipes/jxrlib/all/test_package/conanfile.py b/recipes/jxrlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b8d2e695e4b3a --- /dev/null +++ b/recipes/jxrlib/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + img_path = os.path.join(self.source_folder, "test.jxr") + self.run(f"{bin_path} {img_path}", env="conanrun") diff --git a/recipes/jxrlib/all/test_package/test.jxr b/recipes/jxrlib/all/test_package/test.jxr new file mode 100644 index 0000000000000000000000000000000000000000..4f66a2e27671a7a1a392b9b19d8b646f7fc883fa GIT binary patch literal 167308 zcmYhiWl$T;7xo>3gZ`-uPq|DOPe{U84)1LFS2!2dYDpZtF@gPIBdKOX#FOwxb(L;quv z4B-E(W@BWkYhq~vpg|1=5%dudI0FU&0E+*l{}#aitwwTc!u$(BV3+srzb%2IN3?ZY zc}xUv-@B0Z68L3dttv2rflvK0Q;(@(k*+k2*Q_RoUKJLn9OvyJzQjt zg1kuv5B&&h%}Smg#Ls9mwzYvx_tE-xznH&q^^VzU&*+cN{X&LoL}wxcUuWERQe7G= zS8WKf5R^T^z_C-B?&KCgT-PikLVa zZ^UD8c^|-qFO*j`n6_CSnWXo$sl&t=*0xwH?Rd0;r1X0tW#|$s*0o6{pz)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&t;{eD4li^I wG$O1dX<8fh8-fYPLl&Geoz|SQLscf0U>%Yl%iOV$860+a-NwB0yIz9-0zs*w%>V!Z literal 0 HcmV?d00001 diff --git a/recipes/jxrlib/all/test_package/test_package.c b/recipes/jxrlib/all/test_package/test_package.c new file mode 100644 index 0000000000000..122b6c2fd1cc3 --- /dev/null +++ b/recipes/jxrlib/all/test_package/test_package.c @@ -0,0 +1,32 @@ +#include + +#include + +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)); + + PKPixelFormatGUID pix_frmt; + Call(pDecoder->GetPixelFormat(pDecoder, &pix_frmt)); + + Cleanup: + if(pDecoder) pDecoder->Release(&pDecoder); + if(pCodecFactory) pCodecFactory->Release(&pCodecFactory); + } + + return 0; +} diff --git a/recipes/jxrlib/all/test_v1_package/CMakeLists.txt b/recipes/jxrlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb386b8f18cc0 --- /dev/null +++ b/recipes/jxrlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(JXR REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE JXR::JXR) diff --git a/recipes/jxrlib/all/test_v1_package/conanfile.py b/recipes/jxrlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ffd0b1c74921b --- /dev/null +++ b/recipes/jxrlib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.jxr") + self.run(f"{bin_path} {img_path}", run_environment=True) diff --git a/recipes/jxrlib/config.yml b/recipes/jxrlib/config.yml new file mode 100644 index 0000000000000..2e93ba5582525 --- /dev/null +++ b/recipes/jxrlib/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20170615": + folder: all diff --git a/recipes/kainjow-mustache/all/conandata.yml b/recipes/kainjow-mustache/all/conandata.yml new file mode 100644 index 0000000000000..d08813965566b --- /dev/null +++ b/recipes/kainjow-mustache/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.1": + url: "https://github.com/kainjow/Mustache/archive/v4.1.tar.gz" + sha256: "acd66359feb4318b421f9574cfc5a511133a77d916d0b13c7caa3783c0bfe167" diff --git a/recipes/kainjow-mustache/all/conanfile.py b/recipes/kainjow-mustache/all/conanfile.py new file mode 100644 index 0000000000000..5a235a430af98 --- /dev/null +++ b/recipes/kainjow-mustache/all/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, tools +import os +import glob + + +class KainjowMustacheConan(ConanFile): + name = "kainjow-mustache" + description = "Mustache text templates for modern C++" + topics = ("conan", "mustache", "template") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kainjow/Mustache" + license = "BSL-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename( + "Mustache-{}".format(self.version), + self._source_subfolder + ) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("mustache.hpp", dst=os.path.join("include", "kainjow"), src=self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "kainjow_mustache" + self.cpp_info.names["cmake_find_package_multi"] = "kainjow_mustache" diff --git a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..10c7c5ddbef7f --- /dev/null +++ b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.9) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/kainjow-mustache/all/test_package/conanfile.py b/recipes/kainjow-mustache/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/kainjow-mustache/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/kainjow-mustache/all/test_package/test_package.cpp b/recipes/kainjow-mustache/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e2d83b0f477ec --- /dev/null +++ b/recipes/kainjow-mustache/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include "kainjow/mustache.hpp" + + +int main() { + using namespace kainjow::mustache; + + mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; + data employees{data::type::list}; + employees + << object{{"name", "Steve"}, {"comma", true}} + << object{{"name", "Bill"}}; + + if( tmpl.render({"employees", employees}) == "Steve, Bill" ) { + return 0; + } + return 1; +} diff --git a/recipes/kainjow-mustache/config.yml b/recipes/kainjow-mustache/config.yml new file mode 100644 index 0000000000000..40e0e6fae10f3 --- /dev/null +++ b/recipes/kainjow-mustache/config.yml @@ -0,0 +1,3 @@ +versions: + "4.1": + folder: all diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml b/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml new file mode 100644 index 0000000000000..1a2d17950129d --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.10": + url: "https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/archive/refs/tags/0.10.tar.gz" + sha256: "9a7d382b2acbbe6498ecca23fc7b6b98cbcc418af83fb569f94395f29712171c" + "cci.20210701": + url: "https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/archive/cb09b3a84c7e905c6a3fecfe9617cf864d9af781.zip" + sha256: "058c01828692bf193cb862372651c572fcc43babbf2d664674409511b9f54e5b" +patches: + "0.10": + - patch_file: "patches/0001-cmake-minimum-required.patch" + patch_description: "declare cmake_minimum_required first" + patch_type: "portability" + "cci.20210701": + - patch_file: "patches/0001-cmake-minimum-required.patch" + patch_description: "declare cmake_minimum_required first" + patch_type: "portability" diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py b/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py new file mode 100644 index 0000000000000..4940a6da6e857 --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class KaitaiStructCppStlRuntimeConan(ConanFile): + name = "kaitai_struct_cpp_stl_runtime" + description = "kaitai struct c++ runtime library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://kaitai.io/" + topics = ("parsers", "streams", "dsl", "kaitai struct") + settings = "os", "arch", "compiler", "build_type" + options = { + "with_zlib": [True, False], + "with_iconv": [True, False], + } + default_options = { + "with_zlib": False, + "with_iconv": False, + } + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_iconv: + self.requires("libiconv/1.17") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.options.with_iconv: + tc.variables["STRING_ENCODING_TYPE"] = "ICONV" + else: + tc.variables["STRING_ENCODING_TYPE"] = "NONE" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["kaitai_struct_cpp_stl_runtime"] diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0001-cmake-minimum-required.patch b/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..d2ea72d0b994f --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0001-cmake-minimum-required.patch @@ -0,0 +1,11 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f72825..fa3d4e4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-project (kaitai_struct_cpp_stl_runtime CXX) + cmake_minimum_required (VERSION 3.3) ++project (kaitai_struct_cpp_stl_runtime CXX) + + set (CMAKE_INCLUDE_CURRENT_DIR ON) + diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt b/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..330bfac9e2511 --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(kaitai_struct_cpp_stl_runtime REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE kaitai_struct_cpp_stl_runtime::kaitai_struct_cpp_stl_runtime) diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/conanfile.py b/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/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/kaitai_struct_cpp_stl_runtime/all/test_package/test_package.cpp b/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f1a6bf26f36bc --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + std::string buf; + std::istringstream is(buf); + kaitai::kstream ks(&is); +} diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt b/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py b/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/kaitai_struct_cpp_stl_runtime/config.yml b/recipes/kaitai_struct_cpp_stl_runtime/config.yml new file mode 100644 index 0000000000000..25aabe969604c --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/config.yml @@ -0,0 +1,5 @@ +versions: + "0.10": + folder: all + "cci.20210701": + folder: all diff --git a/recipes/kangaru/all/conandata.yml b/recipes/kangaru/all/conandata.yml new file mode 100644 index 0000000000000..7cacb93f9b616 --- /dev/null +++ b/recipes/kangaru/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.3.0": + url: "https://github.com/gracicot/kangaru/archive/refs/tags/v4.3.0.tar.gz" + sha256: "98a0d7f2e5ac65d93fe83615ead1627fab2237b173e18151fb68d50234ed6eaf" + "4.2.4": + url: "https://github.com/gracicot/kangaru/archive/refs/tags/v4.2.4.tar.gz" + sha256: "0ef74825d98165c26919ce01026533b6594faa584ea93c2f275e1f275bda9dc5" +patches: + "4.2.4": + - patch_file: "patches/fix-cmake.patch" diff --git a/recipes/kangaru/all/conanfile.py b/recipes/kangaru/all/conanfile.py new file mode 100644 index 0000000000000..b9d9319294b90 --- /dev/null +++ b/recipes/kangaru/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class KangaruConan(ConanFile): + name = "kangaru" + description = "A dependency injection container for C++11, C++14 and later" + license = "MIT" + topics = ("DI", "IoC", "inversion of control") + homepage = "https://github.com/gracicot/kangaru/wiki" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "reverse_destruction": [True, False], + "no_exception": [True, False], + } + default_options = { + "reverse_destruction": True, + "no_exception": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.settings.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["KANGARU_REVERSE_DESTRUCTION"] = self.options.reverse_destruction + tc.variables["KANGARU_NO_EXCEPTION"] = self.options.no_exception + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"kangaru": "kangaru::kangaru"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "kangaru") + self.cpp_info.set_property("cmake_target_name", "kangaru") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # 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/kangaru/all/patches/fix-cmake.patch b/recipes/kangaru/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..2ff30aa7919c7 --- /dev/null +++ b/recipes/kangaru/all/patches/fix-cmake.patch @@ -0,0 +1,38 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,7 +31,7 @@ endif() + + configure_file( + cmake/config/config.hpp.in +- generated/include/kangaru/detail/config.hpp ++ ${CMAKE_CURRENT_BINARY_DIR}/generated/include/kangaru/detail/config.hpp + @ONLY + ) + +@@ -48,7 +48,7 @@ target_compile_features(kangaru INTERFACE cxx_std_11) + target_include_directories(kangaru INTERFACE + $ + $ +- $ ++ $ + ) + + if(KANGARU_BUILD_EXAMPLES) +@@ -82,7 +82,7 @@ if(KANGARU_INSTALL) + # build tree package config + configure_file( + cmake/config/kangaruBuildConfig.cmake.in +- kangaruConfig.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/kangaruConfig.cmake + @ONLY + ) + +@@ -95,7 +95,7 @@ if(KANGARU_INSTALL) + ) + + install( +- DIRECTORY include/kangaru ${CMAKE_BINARY_DIR}/generated/include/kangaru ++ DIRECTORY include/kangaru ${CMAKE_CURRENT_BINARY_DIR}/generated/include/kangaru + DESTINATION ${KANGARU_INSTALL_INCLUDE_DIR} FILES_MATCHING PATTERN "*.hpp" + ) + diff --git a/recipes/kangaru/all/test_package/CMakeLists.txt b/recipes/kangaru/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c2fae203f0d0c --- /dev/null +++ b/recipes/kangaru/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(kangaru REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE kangaru) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/kangaru/all/test_package/conanfile.py b/recipes/kangaru/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/kangaru/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, run=True) + + 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/kangaru/all/test_package/test_package.cpp b/recipes/kangaru/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dd1d217f4c24d --- /dev/null +++ b/recipes/kangaru/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#include +#include + +/** + * This example only show basic usage of services and the conatainer. + */ + +// Normal classes with dependency between them +struct Camera {}; + +struct Scene { + Camera& camera; +}; + +// This is the configuration of our classes. +// Structure and dependency graph is defined here. + +// Camera is a single service so the service has a shared instance. +struct CameraService : kgr::single_service {}; + +// Scene is not single, so the container return scenes by value. +// Also, we depends on a camera to be constructed. +struct SceneService : kgr::service> {}; + +int main() +{ + kgr::container container; + + // The service function return instances of the normal classes. + Scene scene = container.service(); + Camera& camera = container.service(); + + std::cout + << std::boolalpha + << (&scene.camera == &camera) << std::endl; // outputs true +} diff --git a/recipes/kangaru/all/test_v1_package/CMakeLists.txt b/recipes/kangaru/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/kangaru/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/kangaru/all/test_v1_package/conanfile.py b/recipes/kangaru/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/kangaru/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/kangaru/config.yml b/recipes/kangaru/config.yml new file mode 100644 index 0000000000000..f77751b7637b4 --- /dev/null +++ b/recipes/kangaru/config.yml @@ -0,0 +1,5 @@ +versions: + "4.3.0": + folder: all + "4.2.4": + folder: all diff --git a/recipes/kcov/all/CMakeLists.txt b/recipes/kcov/all/CMakeLists.txt new file mode 100644 index 0000000000000..a69305eb3971f --- /dev/null +++ b/recipes/kcov/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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/conandata.yml b/recipes/kcov/all/conandata.yml new file mode 100644 index 0000000000000..b98fb5f6098f5 --- /dev/null +++ b/recipes/kcov/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "40": + url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v40.tar.gz" + sha256: "6b1c11b066d57426d61375a31c3816f1fcd2610b447050c86d9920e22d5200b3" + "38": + url: "https://github.com/SimonKagstrom/kcov/archive/38.tar.gz" + sha256: "b37af60d81a9b1e3b140f9473bdcb7975af12040feb24cc666f9bb2bb0be68b4" +patches: + "40": [] + "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 new file mode 100644 index 0000000000000..563b33b2f010e --- /dev/null +++ b/recipes/kcov/all/conanfile.py @@ -0,0 +1,63 @@ +import os +from conan import ConanFile +from conans import CMake, tools +from conans.errors import ConanInvalidConfiguration + +class KcovConan(ConanFile): + name = "kcov" + license = "GPL-2.0" + 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): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "kcov can not be built on windows.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + 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 build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("COPYING*", dst="licenses", src=self._source_subfolder) + + def package_info(self): + 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/0001-fix-SOLIB-path.patch b/recipes/kcov/all/patches/0001-fix-SOLIB-path.patch new file mode 100644 index 0000000000000..5c9183cb1848e --- /dev/null +++ b/recipes/kcov/all/patches/0001-fix-SOLIB-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3c120aa..259a53d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -308,7 +308,7 @@ target_link_libraries(kcov_system_lib + add_custom_command( + OUTPUT library.cc + COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/bin-to-c-source.py" +- lib${SOLIB}.so ++ $ + __library + > library.cc + DEPENDS diff --git a/recipes/kcov/all/patches/0002-fix-missing-libssl-dependency.patch b/recipes/kcov/all/patches/0002-fix-missing-libssl-dependency.patch new file mode 100644 index 0000000000000..14411b863bcb1 --- /dev/null +++ b/recipes/kcov/all/patches/0002-fix-missing-libssl-dependency.patch @@ -0,0 +1,19 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 259a53d..541bd3b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -118,7 +118,10 @@ if (KCOV_STATIC_BUILD) + set (CURL_LIBRARIES "") + # Coveralls doesn't work in a static setting + set (coveralls_SRCS writers/dummy-coveralls-writer.cc) +- set (CMAKE_EXE_LINKER_FLAGS "-static") ++ set (CMAKE_EXE_LINKER_FLAGS "-static") ++else() ++ find_package(OpenSSL REQUIRED) ++ list( APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES} ) + endif (KCOV_STATIC_BUILD) + + set (ELF_SRCS +-- +2.20.1 + diff --git a/recipes/kcov/all/test_package/conanfile.py b/recipes/kcov/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea5ad0c50ed3e --- /dev/null +++ b/recipes/kcov/all/test_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 new file mode 100644 index 0000000000000..b36ca0e497b00 --- /dev/null +++ b/recipes/kcov/config.yml @@ -0,0 +1,5 @@ +versions: + "40": + folder: all + "38": + folder: all diff --git a/recipes/kcp/all/CMakeLists.txt b/recipes/kcp/all/CMakeLists.txt new file mode 100644 index 0000000000000..0feb437e18418 --- /dev/null +++ b/recipes/kcp/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/kcp/all/conandata.yml b/recipes/kcp/all/conandata.yml new file mode 100644 index 0000000000000..da8ca059669a3 --- /dev/null +++ b/recipes/kcp/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.5": + url: "https://github.com/skywind3000/kcp/archive/1.5.tar.gz" + sha256: "14c1dfb3485cab635299a698f35db261ab7e74505efd0ec579b71fc7af0dff06" + "1.7": + url: "https://github.com/skywind3000/kcp/archive/1.7.tar.gz" + sha256: "b4d26994d95599ab0c44e1f93002f9fda275094a879d66c192d79d596529199e" +patches: + "1.5": + - patch_file: "patches/0001-kcp-remove-add_library-STATIC.patch" + base_path: "source_subfolder" + "1.7": + - patch_file: "patches/0001-kcp-remove-add_library-STATIC.patch" + base_path: "source_subfolder" diff --git a/recipes/kcp/all/conanfile.py b/recipes/kcp/all/conanfile.py new file mode 100644 index 0000000000000..ea23c3a999a55 --- /dev/null +++ b/recipes/kcp/all/conanfile.py @@ -0,0 +1,74 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class KcpConan(ConanFile): + name = "kcp" + description = "A Fast and Reliable ARQ Protocol" + topics = ("conan", "kcp", "ARQ", "TCP", "protocol") + homepage = "https://github.com/skywind3000/kcp" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + exports_sources = "CMakeLists.txt", "patches/**" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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["BUILD_TESTING"] = False + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["kcp"] diff --git a/recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch b/recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch new file mode 100644 index 0000000000000..b8c9f32e1e658 --- /dev/null +++ b/recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch @@ -0,0 +1,18 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -5,12 +5,14 @@ + include(CTest) + include(GNUInstallDirs) + +-add_library(kcp STATIC ikcp.c) ++add_library(kcp ikcp.c) + + install(FILES ikcp.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install(TARGETS kcp + EXPORT kcp-targets ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) diff --git a/recipes/kcp/all/test_package/CMakeLists.txt b/recipes/kcp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5b08913be93b --- /dev/null +++ b/recipes/kcp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(kcp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} kcp::kcp) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/kcp/all/test_package/conanfile.py b/recipes/kcp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f8eeed898d7bd --- /dev/null +++ b/recipes/kcp/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/kcp/all/test_package/test_package.cpp b/recipes/kcp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1699db281867c --- /dev/null +++ b/recipes/kcp/all/test_package/test_package.cpp @@ -0,0 +1,82 @@ +#include "ikcp.h" + +#include +#include +#include +#include +#include +#include + +class Channel { + std::deque buffer_; +public: + void send(const char *buf, size_t len) { + std::back_insert_iterator> back_it{buffer_}; + std::copy(buf, buf+len, back_it); + } + std::vector recv(size_t len) { + std::vector res; + len = std::min(len, buffer_.size()); + if (len == 0) len = buffer_.size(); + std::back_insert_iterator> back_it{res}; + std::copy(std::begin(buffer_), std::end(buffer_), back_it); + buffer_.erase(std::begin(buffer_), std::begin(buffer_)+len); + return res; + } +}; + +struct Connection { + Channel *input; + Channel *output; + int id; +}; + +static int net_output(const char *buf, int len, ikcpcb *kcp, void *user) +{ + Connection *conn = static_cast(user); + std::cerr << "net_output(len=" << len << ", id=" << conn->id << ")\n"; + conn->output->send(buf, len); + return 0; +} + +int main() { + std::default_random_engine random{0}; + + Channel net1; + Channel net2; + Connection c1{&net1, &net2, 1}; + Connection c2{&net2, &net1, 2}; + + ikcpcb *kcp1 = ikcp_create(0x11223344, &c1); + ikcpcb *kcp2 = ikcp_create(0x11223344, &c2); + + kcp1->output = net_output; + kcp2->output = net_output; + + ikcp_wndsize(kcp1, 128, 128); + ikcp_wndsize(kcp2, 128, 128); + + char buffer[2048]; + + for (size_t time=0; time != 10000; time += 1) { + ikcp_update(kcp1, time); + ikcp_update(kcp2, time); + + while (random() % 3) { + ikcp_send(kcp1, buffer, 512); + } + + while (true) { + auto data = c2.input->recv(512); + if (data.size() == 0) break; + ikcp_input(kcp2, data.data(), data.size()); + } + + while (true) { + auto data = c1.input->recv(512); + if (data.size() == 0) break; + ikcp_input(kcp2, data.data(), data.size()); + } + } + return 0; +} diff --git a/recipes/kcp/config.yml b/recipes/kcp/config.yml new file mode 100644 index 0000000000000..da14cb6d520d4 --- /dev/null +++ b/recipes/kcp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.5": + folder: all + "1.7": + folder: all diff --git a/recipes/kealib/all/CMakeLists.txt b/recipes/kealib/all/CMakeLists.txt new file mode 100644 index 0000000000000..fd2f93f3b4298 --- /dev/null +++ b/recipes/kealib/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..f812df3cfab60 --- /dev/null +++ b/recipes/kealib/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "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 new file mode 100644 index 0000000000000..292c817544c7d --- /dev/null +++ b/recipes/kealib/all/conanfile.py @@ -0,0 +1,74 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.32.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 + + @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): + if self.options.shared: + del self.options.fPIC + self.options["hdf5"].enable_cxx = True + self.options["hdf5"].hl = True + + def requirements(self): + self.requires("hdf5/1.12.0") + + 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.") + + 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 + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/kealib/all/patches/fix-cmake-1.4.14.patch b/recipes/kealib/all/patches/fix-cmake-1.4.14.patch new file mode 100644 index 0000000000000..40e8ed0c1a606 --- /dev/null +++ b/recipes/kealib/all/patches/fix-cmake-1.4.14.patch @@ -0,0 +1,20 @@ +--- 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 new file mode 100644 index 0000000000000..0107ba1879496 --- /dev/null +++ b/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch @@ -0,0 +1,219 @@ +--- 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 new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/kealib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/kealib/all/test_package/conanfile.py b/recipes/kealib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/kealib/all/test_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" + + 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/all/test_package/test_package.cpp b/recipes/kealib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ed6447aec5e35 --- /dev/null +++ b/recipes/kealib/all/test_package/test_package.cpp @@ -0,0 +1,84 @@ +/* + * test1.cpp + * LibKEA + * + * Created by Pete Bunting on 02/07/2012. + * Copyright 2012 LibKEA. All rights reserved. + * + * 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 + * 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 "libkea/KEAImageIO.h" + +#define IMG_XSIZE 20 +#define IMG_YSIZE 20 +#define TEST_FIELD "test" +#define RAT_SIZE 256 + +int main() +{ + try + { + kealib::KEAImageIO io; + H5::H5File *h5file = kealib::KEAImageIO::createKEAImage("bob.kea", + kealib::kea_8uint, IMG_XSIZE, IMG_YSIZE, 1); + + io.openKEAImageHeader(h5file); + + unsigned char *pData = (unsigned char*)calloc(IMG_XSIZE * IMG_YSIZE, sizeof(unsigned char)); + for( int i = 0; i < (IMG_XSIZE * IMG_YSIZE); i++ ) + { + pData[i] = rand() % 255; + } + io.writeImageBlock2Band(1, pData, 0, 0, IMG_XSIZE, IMG_YSIZE, + IMG_XSIZE, IMG_YSIZE, kealib::kea_8uint); + free(pData); + + io.setImageBandLayerType(1, kealib::kea_thematic); + kealib::KEAAttributeTable *pRat = io.getAttributeTable(kealib::kea_att_file, 1); + pRat->addAttIntField(TEST_FIELD, 0); + size_t colIdx = pRat->getFieldIndex(TEST_FIELD); + + int64_t *pRATData = (int64_t*)calloc(RAT_SIZE, sizeof(int64_t)); + for( int i = 0; i < RAT_SIZE; i++ ) + { + pRATData[i] = rand() % 100; + } + + pRat->addRows(RAT_SIZE); + pRat->setIntFields(0, RAT_SIZE, colIdx, pRATData); + + free(pRATData); + io.close(); + } + catch(kealib::KEAException &e) + { + fprintf(stderr, "Exception raised: %s\n", e.what()); + return 1; + } + printf("Success\n"); + + return 0; +} diff --git a/recipes/kealib/config.yml b/recipes/kealib/config.yml new file mode 100644 index 0000000000000..46b5f6a142b86 --- /dev/null +++ b/recipes/kealib/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.14": + folder: all + "1.4.13": + folder: all diff --git a/recipes/keychain/all/CMakeLists.txt b/recipes/keychain/all/CMakeLists.txt new file mode 100644 index 0000000000000..1848ca5a77c35 --- /dev/null +++ b/recipes/keychain/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/keychain/all/conandata.yml b/recipes/keychain/all/conandata.yml new file mode 100644 index 0000000000000..b28baa662e7b6 --- /dev/null +++ b/recipes/keychain/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.0": + url: "https://github.com/hrantzsch/keychain/archive/v1.2.0.tar.gz" + sha256: "82cc66a7fa12af43f3e2efeb378bacb0a514056617e369430f252da2392acaae" diff --git a/recipes/keychain/all/conanfile.py b/recipes/keychain/all/conanfile.py new file mode 100644 index 0000000000000..d6ff7829ddf3c --- /dev/null +++ b/recipes/keychain/all/conanfile.py @@ -0,0 +1,62 @@ +from conans import ConanFile, CMake, tools +import os + +class KeychainConan(ConanFile): + name = "keychain" + homepage = "https://github.com/hrantzsch/keychain" + description = "A cross-platform wrapper for the operating system's credential storage" + topics = ("conan", "keychain", "security", "credentials", "password", "cpp11") + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "pkg_config" + options = {'fPIC': [False, True]} + default_options = {'fPIC': True} + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def requirements(self): + if self.settings.os == "Linux": + self.requires("libsecret/0.20.4") + + def build_requirements(self): + if self.settings.os == "Linux": + self.build_requires("pkgconf/1.7.3") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_TESTS"] = False + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + + if self.settings.os == 'Macos': + self.cpp_info.frameworks = ['Security', 'CoreFoundation'] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ['crypt32'] diff --git a/recipes/keychain/all/test_package/CMakeLists.txt b/recipes/keychain/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a9dd0b5b3015 --- /dev/null +++ b/recipes/keychain/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/keychain/all/test_package/conanfile.py b/recipes/keychain/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/keychain/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/keychain/all/test_package/test_package.cpp b/recipes/keychain/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b28378d16ed4a --- /dev/null +++ b/recipes/keychain/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +using namespace keychain; + +// Make sure we actually link keychain +// Note: We cannot make a real call to a keychain function in the CI on Linux. +// It would call to libsecret, which would fail because gnome-keyring-daemon is +// not running on the agent. See also the Keychain CI: +// https://github.com/hrantzsch/keychain/blob/6a4db6048559516fb2f30ad449152a0a3c7138a0/.github/workflows/ci.yml#L49:L53 +void never_called(Error &error) { + getPassword("conan-test-pkg", "conan-test-srv", "conan-test-user", error); +} + +int main() { + Error error; + return error.type == ErrorType::NoError ? 0 : 1; +} diff --git a/recipes/keychain/config.yml b/recipes/keychain/config.yml new file mode 100644 index 0000000000000..7ed1f1b6fc695 --- /dev/null +++ b/recipes/keychain/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.0": + folder: all diff --git a/recipes/khrplatform/all/conandata.yml b/recipes/khrplatform/all/conandata.yml new file mode 100644 index 0000000000000..f72ccbe3528fa --- /dev/null +++ b/recipes/khrplatform/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200529": + url: "https://github.com/KhronosGroup/EGL-Registry/raw/f636b23410dd4db5055dffbe499f4754013759d5/api/KHR/khrplatform.h" + sha256: "e206a6931f98ffe1c5c7ece69c4f94bbe1c9279243f40cbe7782848a0d3fa2de" diff --git a/recipes/khrplatform/all/conanfile.py b/recipes/khrplatform/all/conanfile.py new file mode 100644 index 0000000000000..4125f97c39bdb --- /dev/null +++ b/recipes/khrplatform/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import copy, download, load, save +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class KhrplatformConan(ConanFile): + name = "khrplatform" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.khronos.org/registry/EGL/" + description = "Khronos EGL platform interfaces" + topics = ("opengl", "gl", "egl", "khr", "khronos") + 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): + download(self, filename="khrplatform.h", **self.conan_data["sources"][self.version]) + + def build(self): + pass + + def _extract_license(self): + license_data = load(self, os.path.join(self.source_folder, "khrplatform.h")) + begin = license_data.find("/*") + len("/*") + end = license_data.find("*/") + return license_data[begin:end].replace("**", "") + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + copy(self, "khrplatform.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "KHR")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/khrplatform/all/test_package/CMakeLists.txt b/recipes/khrplatform/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34fae3a337730 --- /dev/null +++ b/recipes/khrplatform/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(khrplatform REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE khrplatform::khrplatform) diff --git a/recipes/khrplatform/all/test_package/conanfile.py b/recipes/khrplatform/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/khrplatform/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/khrplatform/all/test_package/test_package.c b/recipes/khrplatform/all/test_package/test_package.c new file mode 100644 index 0000000000000..54e5982027830 --- /dev/null +++ b/recipes/khrplatform/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() +{ + khronos_int32_t value = KHRONOS_TRUE; + printf("KHRONOS_TRUE: %d\n", value); + return EXIT_SUCCESS; +} diff --git a/recipes/khrplatform/all/test_v1_package/CMakeLists.txt b/recipes/khrplatform/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/khrplatform/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/khrplatform/all/test_v1_package/conanfile.py b/recipes/khrplatform/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/khrplatform/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/khrplatform/config.yml b/recipes/khrplatform/config.yml new file mode 100644 index 0000000000000..2690f821c7da8 --- /dev/null +++ b/recipes/khrplatform/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200529": + folder: "all" diff --git a/recipes/kissfft/all/conandata.yml b/recipes/kissfft/all/conandata.yml new file mode 100644 index 0000000000000..1b752db3ca778 --- /dev/null +++ b/recipes/kissfft/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "131.1.0": + url: "https://github.com/mborgerding/kissfft/archive/131.1.0.tar.gz" + sha256: "76c1aac87ddb7258f34b08a13f0eebf9e53afa299857568346aa5c82bcafaf1a" diff --git a/recipes/kissfft/all/conanfile.py b/recipes/kissfft/all/conanfile.py new file mode 100644 index 0000000000000..b88b580065423 --- /dev/null +++ b/recipes/kissfft/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class KissfftConan(ConanFile): + name = "kissfft" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mborgerding/kissfft" + description = "a Fast Fourier Transform (FFT) library that tries to Keep it Simple, Stupid" + topics = ("fft", "kiss", "frequency-domain", "fast-fourier-transform") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "datatype": ["float", "double", "int16_t", "int32_t", "simd"], + "openmp": [True, False], + "use_alloca": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "datatype": "float", + "openmp": False, + "use_alloca": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["KISSFFT_PKGCONFIG"] = False + tc.variables["KISSFFT_STATIC"] = not self.options.shared + tc.variables["KISSFFT_TEST"] = False + tc.variables["KISSFFT_TOOLS"] = False + tc.variables["KISSFFT_DATATYPE"] = self.options.datatype + tc.variables["KISSFFT_OPENMP"] = self.options.openmp + tc.variables["KISSFFT_USE_ALLOCA"] = self.options.use_alloca + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + lib_name = "kissfft-{datatype}{openmp}".format( + datatype=self.options.datatype, + openmp="-openmp" if self.options.openmp else "", + ) + + self.cpp_info.set_property("cmake_file_name", "kissfft") + self.cpp_info.set_property("cmake_target_name", "kissfft::kissfft") + self.cpp_info.set_property("cmake_target_aliases", [f"kissfft::{lib_name}"]) + self.cpp_info.set_property("pkg_config_name", lib_name) + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libkissfft"].includedirs.append(os.path.join("include", "kissfft")) + self.cpp_info.components["libkissfft"].libs = [lib_name] + + # got to duplicate the logic from kissfft/CMakeLists.txt + if self.options.datatype in ["float", "double"]: + self.cpp_info.components["libkissfft"].defines.append(f"kiss_fft_scalar={self.options.datatype}") + elif self.options.datatype == "int16_t": + self.cpp_info.components["libkissfft"].defines.append("FIXED_POINT=16") + elif self.options.datatype == "int32_t": + self.cpp_info.components["libkissfft"].defines.append("FIXED_POINT=32") + elif self.options.datatype == "simd": + self.cpp_info.components["libkissfft"].defines.append("USE_SIMD") + + if self.options.use_alloca: + self.cpp_info.components["libkissfft"].defines.append("KISS_FFT_USE_ALLOCA") + + if self.options.shared: + self.cpp_info.components["libkissfft"].defines.append("KISS_FFT_SHARED") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libkissfft"].system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["pkg_config"] = lib_name + self.cpp_info.components["libkissfft"].names["cmake_find_package"] = lib_name + self.cpp_info.components["libkissfft"].names["cmake_find_package_multi"] = lib_name + self.cpp_info.components["libkissfft"].set_property("cmake_target_name", "kissfft::kissfft") + self.cpp_info.components["libkissfft"].set_property("pkg_config_name", lib_name) diff --git a/recipes/kissfft/all/test_package/CMakeLists.txt b/recipes/kissfft/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..71865c254e395 --- /dev/null +++ b/recipes/kissfft/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(kissfft REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE kissfft::kissfft) diff --git a/recipes/kissfft/all/test_package/conanfile.py b/recipes/kissfft/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/kissfft/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/kissfft/all/test_package/test_package.c b/recipes/kissfft/all/test_package/test_package.c new file mode 100644 index 0000000000000..f3592a535fe9a --- /dev/null +++ b/recipes/kissfft/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include + +int main() +{ + printf("kiss_fft_next_fast_size(1) = %i\n", kiss_fft_next_fast_size(1)); + return 0; +} diff --git a/recipes/kissfft/all/test_v1_package/CMakeLists.txt b/recipes/kissfft/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/kissfft/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/kissfft/all/test_v1_package/conanfile.py b/recipes/kissfft/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/kissfft/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/kissfft/config.yml b/recipes/kissfft/config.yml new file mode 100644 index 0000000000000..d7856e11518ab --- /dev/null +++ b/recipes/kissfft/config.yml @@ -0,0 +1,3 @@ +versions: + "131.1.0": + folder: "all" diff --git a/recipes/kitten/all/CMakeLists.txt b/recipes/kitten/all/CMakeLists.txt new file mode 100644 index 0000000000000..d17aaff199b4a --- /dev/null +++ b/recipes/kitten/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/kitten/all/conandata.yml b/recipes/kitten/all/conandata.yml new file mode 100644 index 0000000000000..dcc23d90b8201 --- /dev/null +++ b/recipes/kitten/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.1.0": + url: "https://github.com/rvarago/kitten/archive/0.1.0.tar.gz" + sha256: "fe04a3f58cd521effef2503ac6137eac37684d2d442034e9d19d77a2a01afd57" + "0.0.1": + url: "https://github.com/rvarago/kitten/archive/0.0.1.tar.gz" + sha256: "6627bf4f5baad3be1ebb9c904b0a13fc67d9211f8c874ecab7f05cc38da3d083" diff --git a/recipes/kitten/all/conanfile.py b/recipes/kitten/all/conanfile.py new file mode 100644 index 0000000000000..7db05a55fbcac --- /dev/null +++ b/recipes/kitten/all/conanfile.py @@ -0,0 +1,88 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class KittenConan(ConanFile): + name = "kitten" + description = "A small C++ library inspired by Category Theory focused on functional composition." + homepage = "https://github.com/rvarago/kitten" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + topics = ("category-theory", "composition", "monadic-interface", "declarative-programming") + + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + exports_sources = "CMakeLists.txt" + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @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"): + tools.check_min_cppstd(self, 17) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and loose_lt_semver(str(self.settings.compiler.version), min_version): + raise ConanInvalidConfiguration( + "{} requires C++17, which your compiler does not support.".format(self.name) + ) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_TESTS"] = False + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "kitten") + self.cpp_info.set_property("cmake_target_name", "rvarago::kitten") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "kitten" + self.cpp_info.filenames["cmake_find_package_multi"] = "kitten" + self.cpp_info.names["cmake_find_package"] = "rvarago" + self.cpp_info.names["cmake_find_package_multi"] = "rvarago" + self.cpp_info.components["libkitten"].names["cmake_find_package"] = "kitten" + self.cpp_info.components["libkitten"].names["cmake_find_package_multi"] = "kitten" + self.cpp_info.components["libkitten"].set_property("cmake_target_name", "rvarago::kitten") diff --git a/recipes/kitten/all/test_package/CMakeLists.txt b/recipes/kitten/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..60b5b3b426db6 --- /dev/null +++ b/recipes/kitten/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(kitten REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_link_libraries(${PROJECT_NAME} rvarago::kitten) diff --git a/recipes/kitten/all/test_package/conanfile.py b/recipes/kitten/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/kitten/all/test_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/kitten/all/test_package/test_package.cpp b/recipes/kitten/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8ddfae2423dd7 --- /dev/null +++ b/recipes/kitten/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +#include "kitten/kitten.h" +#include "kitten/instances/optional.h" + +using namespace rvarago::kitten; + +int main() { + auto constexpr maybe_an_approximate_answer = std::optional{41}; + auto constexpr exact_answer = (maybe_an_approximate_answer | [](auto const& el) { return el + 1; }).value(); + static_assert(42 == exact_answer); + std::cout << "rvarago::kitten works! The exact answer is: " << exact_answer << '\n'; + return 0; +} diff --git a/recipes/kitten/config.yml b/recipes/kitten/config.yml new file mode 100644 index 0000000000000..fb992cd538525 --- /dev/null +++ b/recipes/kitten/config.yml @@ -0,0 +1,5 @@ +versions: + "0.1.0": + folder: all + "0.0.1": + folder: all diff --git a/recipes/kmod/all/conandata.yml b/recipes/kmod/all/conandata.yml new file mode 100644 index 0000000000000..cc817fbafc1ad --- /dev/null +++ b/recipes/kmod/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "30": + url: "https://kernel.org/pub/linux/utils/kernel/kmod/kmod-30.tar.xz" + sha256: "f897dd72698dc6ac1ef03255cd0a5734ad932318e4adbaebc7338ef2f5202f9f" + "29": + url: "https://kernel.org/pub/linux/utils/kernel/kmod/kmod-29.tar.xz" + sha256: "0b80eea7aa184ac6fd20cafa2a1fdf290ffecc70869a797079e2cc5c6225a52a" diff --git a/recipes/kmod/all/conanfile.py b/recipes/kmod/all/conanfile.py new file mode 100644 index 0000000000000..f60d2ebc28242 --- /dev/null +++ b/recipes/kmod/all/conanfile.py @@ -0,0 +1,110 @@ +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, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class KModConan(ConanFile): + name = "kmod" + description = "linux kernel module handling library" + topics = ("libkmod", "linux", "kernel", "module") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kmod-project/kmod" + license = "LGPL-2.1-only" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_zstd": [True, False], + "with_xz": [True, False], + "with_zlib": [True, False], + "with_openssl": [True, False], + "experimental": [True, False], + "logging": [True, False], + } + default_options = { + "with_zstd": True, + "with_xz": True, + "with_zlib": True, + "with_openssl": True, + "experimental": False, + "logging": False, + } + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_xz: + self.requires("xz_utils/5.4.2") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("kmod is Linux-only!") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.append("--with-zstd=%s" % yes_no(self.options.with_zstd)) + tc.configure_args.append("--with-xz=%s" % yes_no(self.options.with_xz)) + tc.configure_args.append("--with-zlib=%s" % yes_no(self.options.with_zlib)) + tc.configure_args.append("--with-openssl=%s" % yes_no(self.options.with_openssl)) + tc.configure_args.append("--enable-experimental=%s" % yes_no(self.options.experimental)) + tc.configure_args.append("--enable-logging=%s" % yes_no(self.options.logging)) + tc.configure_args.append("--enable-debug=%s" % yes_no(self.settings.build_type == "Debug")) + tc.configure_args.append("--enable-tools=no") + tc.configure_args.append("--enable-manpages=no") + tc.configure_args.append("--enable-test-modules=no") + tc.configure_args.append("--enable-python=no") + tc.configure_args.append("--enable-coverage=no") + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libkmod") + self.cpp_info.libs = ["kmod"] + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/kmod/all/test_package/CMakeLists.txt b/recipes/kmod/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fb2eee3127d3e --- /dev/null +++ b/recipes/kmod/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(kmod REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE kmod::kmod) diff --git a/recipes/kmod/all/test_package/conanfile.py b/recipes/kmod/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/kmod/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/kmod/all/test_package/test_package.c b/recipes/kmod/all/test_package/test_package.c new file mode 100644 index 0000000000000..227ead0ea1cd1 --- /dev/null +++ b/recipes/kmod/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include +#include +#include "libkmod.h" + +int main(int argc, char * argv[]) +{ + struct kmod_ctx *ctx = kmod_new(NULL, NULL); + if (ctx) + { + struct kmod_list * list, * mod; + if (kmod_module_new_from_loaded(ctx, &list) >= 0) + { + kmod_list_foreach(mod, list) + { + struct kmod_module *kmod = kmod_module_get_module(mod); + printf("%s\n", kmod_module_get_name(kmod)); + } + kmod_module_unref_list(list); + } + kmod_unref(ctx); + } + return EXIT_SUCCESS; +} diff --git a/recipes/kmod/all/test_v1_package/CMakeLists.txt b/recipes/kmod/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/kmod/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/kmod/all/test_v1_package/conanfile.py b/recipes/kmod/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/kmod/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/kmod/config.yml b/recipes/kmod/config.yml new file mode 100644 index 0000000000000..61353908a11fc --- /dev/null +++ b/recipes/kmod/config.yml @@ -0,0 +1,5 @@ +versions: + "30": + folder: all + "29": + folder: all diff --git a/recipes/kplot/all/CMakeLists.txt b/recipes/kplot/all/CMakeLists.txt new file mode 100644 index 0000000000000..632b160c48691 --- /dev/null +++ b/recipes/kplot/all/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 3.8) +project(kplot LANGUAGES C) + +find_package(cairo REQUIRED CONFIG) + +set(kplot_src + ${KPLOT_SRC_DIR}/colours.c + ${KPLOT_SRC_DIR}/array.c + ${KPLOT_SRC_DIR}/border.c + ${KPLOT_SRC_DIR}/bucket.c + ${KPLOT_SRC_DIR}/buffer.c + ${KPLOT_SRC_DIR}/draw.c + ${KPLOT_SRC_DIR}/grid.c + ${KPLOT_SRC_DIR}/hist.c + ${KPLOT_SRC_DIR}/label.c + ${KPLOT_SRC_DIR}/kdata.c + ${KPLOT_SRC_DIR}/kplot.c + ${KPLOT_SRC_DIR}/margin.c + ${KPLOT_SRC_DIR}/mean.c + ${KPLOT_SRC_DIR}/plotctx.c + ${KPLOT_SRC_DIR}/reallocarray.c + ${KPLOT_SRC_DIR}/stddev.c + ${KPLOT_SRC_DIR}/tic.c + ${KPLOT_SRC_DIR}/vector.c +) + +set(kplot_inc + ${KPLOT_SRC_DIR}/compat.h + ${KPLOT_SRC_DIR}/extern.h + ${KPLOT_SRC_DIR}/kplot.h +) + +include_directories(KPLOT_SRC_DIR) + +try_run(HAVE_reallocarray COMPIE_reallocarray ${CMAKE_BINARY_DIR} ${KPLOT_SRC_DIR}/test-reallocarray.c) + +file(READ "${KPLOT_SRC_DIR}/compat.pre.h" COMPAT_CONTENTS) +file(WRITE "${KPLOT_SRC_DIR}/compat.h" "${COMPAT_CONTENTS}") +if (${COMPIE_reallocarray} AND NOT ${HAVE_reallocarray}) + file(APPEND "${KPLOT_SRC_DIR}/compat.h" "#define HAVE_REALLOCARRAY") +endif() +file(READ "${KPLOT_SRC_DIR}/compat.post.h" COMPAT_CONTENTS) +file(APPEND "${KPLOT_SRC_DIR}/compat.h" "${COMPAT_CONTENTS}") + +add_library(kplot ${kplot_src}) + +target_compile_features(kplot PRIVATE c_std_99) +set_target_properties(kplot PROPERTIES + PUBLIC_HEADER "${kplot_inc}" + WINDOWS_EXPORT_ALL_SYMBOLS ON + C_EXTENSIONS OFF +) +target_compile_features(kplot PRIVATE c_std_99) +target_link_libraries(kplot PRIVATE cairo::cairo) + +include(GNUInstallDirs) + +install( + TARGETS kplot + 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/kplot/all/conandata.yml b/recipes/kplot/all/conandata.yml new file mode 100644 index 0000000000000..d0e63f3ee2c14 --- /dev/null +++ b/recipes/kplot/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.15": + url: "https://github.com/kristapsdz/kplot/archive/refs/tags/VERSION_0_1_15.tar.gz" + sha256: "602ebaac9b67dc7c7e84d8112df887c95ba0a1c4ed71fbab6671f8c5ecf4ba2a" diff --git a/recipes/kplot/all/conanfile.py b/recipes/kplot/all/conanfile.py new file mode 100644 index 0000000000000..47e24a0f5cdf8 --- /dev/null +++ b/recipes/kplot/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + +class KplotConan(ConanFile): + name = "kplot" + description = "open source Cairo plotting library" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kristapsdz/kplot/" + topics = ("plot", "cairo", "chart") # no "conan" and project name in topics + settings = "os", "arch", "compiler", "build_type" # even for header only + 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") + # for plain C projects only + 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 is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be built on Visual Studio and msvc.") + + def requirements(self): + self.requires("cairo/1.17.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["KPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.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, pattern="LICENSE.md", 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 = ["kplot"] diff --git a/recipes/kplot/all/test_package/CMakeLists.txt b/recipes/kplot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e61521b15e2af --- /dev/null +++ b/recipes/kplot/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(kplot REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE kplot::kplot) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/kplot/all/test_package/conanfile.py b/recipes/kplot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/kplot/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/kplot/all/test_package/test_package.c b/recipes/kplot/all/test_package/test_package.c new file mode 100644 index 0000000000000..2bc672875372a --- /dev/null +++ b/recipes/kplot/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include + +#include "cairo.h" +#include "kplot.h" + +int main() { + struct kpair points1[50]; + struct kdata* d1 = kdata_array_alloc(points1, 50); + + kdata_destroy(d1); + + return 0; +} diff --git a/recipes/kplot/all/test_v1_package/CMakeLists.txt b/recipes/kplot/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/kplot/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/kplot/all/test_v1_package/conanfile.py b/recipes/kplot/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/kplot/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/kplot/config.yml b/recipes/kplot/config.yml new file mode 100644 index 0000000000000..d90a2c03c7832 --- /dev/null +++ b/recipes/kplot/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.15": + folder: all diff --git a/recipes/ktx/all/conandata.yml b/recipes/ktx/all/conandata.yml new file mode 100644 index 0000000000000..bc8cca1018446 --- /dev/null +++ b/recipes/ktx/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.0.0": + url: "https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/v4.0.0.tar.gz" + sha256: "6091f5064d0cfd54c6155bb6c0d2ba7287f312d109010e9b702839ac78529fd3" +patches: + "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" diff --git a/recipes/ktx/all/conanfile.py b/recipes/ktx/all/conanfile.py new file mode 100644 index 0000000000000..872df15047bc5 --- /dev/null +++ b/recipes/ktx/all/conanfile.py @@ -0,0 +1,130 @@ +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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class KtxConan(ConanFile): + name = "ktx" + description = "Khronos Texture library and tool." + license = "Apache-2.0" + topics = ("texture", "khronos") + homepage = "https://github.com/KhronosGroup/KTX-Software" + 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], + "sse": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "sse": True, + "tools": True, + } + + @property + def _has_sse_support(self): + return self.settings.arch in ["x86", "x86_64"] + + 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_sse_support: + del self.options.sse + if self.settings.os in ["iOS", "Android", "Emscripten"]: + # tools are not build by default if iOS, Android or Emscripten + self.options.tools = 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): + self.requires("lodepng/cci.20200615") + self.requires("zstd/1.5.5") + + 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["KTX_FEATURE_TOOLS"] = self.options.tools + tc.variables["KTX_FEATURE_DOC"] = False + tc.variables["KTX_FEATURE_LOADTEST_APPS"] = False + tc.variables["KTX_FEATURE_STATIC_LIBRARY"] = not self.options.shared + tc.variables["KTX_FEATURE_TESTS"] = False + tc.variables["BASISU_SUPPORT_SSE"] = self.options.get_safe("sse", False) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(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")) + ## zstd + rmdir(self, os.path.join(basisu_dir, "zstd")) + + 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")) + copy(self, "*", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Ktx") + self.cpp_info.set_property("cmake_target_name", "KTX::ktx") + # TODO: back to root level in conan v2 + self.cpp_info.components["libktx"].libs = ["ktx"] + self.cpp_info.components["libktx"].defines = [ + "KTX_FEATURE_KTX1", "KTX_FEATURE_KTX2", "KTX_FEATURE_WRITE" + ] + if not self.options.shared: + self.cpp_info.components["libktx"].defines.append("KHRONOS_STATIC") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["libktx"].system_libs.append(libcxx) + if self.settings.os == "Windows": + self.cpp_info.components["libktx"].defines.append("BASISU_NO_ITERATOR_DEBUG_LEVEL") + elif self.settings.os == "Linux": + self.cpp_info.components["libktx"].system_libs.extend(["m", "dl", "pthread"]) + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "Ktx" + self.cpp_info.filenames["cmake_find_package_multi"] = "Ktx" + self.cpp_info.names["cmake_find_package"] = "KTX" + self.cpp_info.names["cmake_find_package_multi"] = "KTX" + 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"] + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/ktx/all/patches/0001-objutil-cxx-std.patch b/recipes/ktx/all/patches/0001-objutil-cxx-std.patch new file mode 100644 index 0000000000000..1859eafc9c101 --- /dev/null +++ b/recipes/ktx/all/patches/0001-objutil-cxx-std.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -550,6 +550,7 @@ target_include_directories( + PUBLIC + utils + ) ++target_compile_features(objUtil PUBLIC cxx_std_11) + + add_subdirectory(interface/basisu_c_binding) + diff --git a/recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch b/recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch new file mode 100644 index 0000000000000..746a33dd93151 --- /dev/null +++ b/recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch @@ -0,0 +1,16 @@ +--- a/lib/internalexport_write.def ++++ b/lib/internalexport_write.def +@@ -12,13 +12,6 @@ EXPORTS + ??0Resampler@basisu@@QEAA@HHHHW4Boundary_Op@01@MMPEBDPEAUContrib_List@01@2MMMM@Z + ?put_line@Resampler@basisu@@QEAA_NPEBM@Z + ?get_line@Resampler@basisu@@QEAAPEBMXZ +- ?lodepng_error_text@@YAPEBDI@Z +- ?lodepng_get_raw_size@@YA_KIIPEBULodePNGColorMode@@@Z +- ?lodepng_decode@@YAIPEAPEAEPEAI1PEAULodePNGState@@PEBE_K@Z +- ?lodepng_inspect@@YAIPEAI0PEAULodePNGState@@PEBE_K@Z +- ?lodepng_chunk_find_const@@YAPEBEPEBE0QEBD@Z +- ??0State@lodepng@@QEAA@XZ +- ??1State@lodepng@@UEAA@XZ + ??0jpeg_decoder_file_stream@jpgd@@QEAA@XZ + ??1jpeg_decoder_file_stream@jpgd@@UEAA@XZ + ?decompress_jpeg_image_from_stream@jpgd@@YAPEAEPEAVjpeg_decoder_stream@1@PEAH11HI@Z diff --git a/recipes/ktx/all/patches/0003-clamp-include-algorithm.patch b/recipes/ktx/all/patches/0003-clamp-include-algorithm.patch new file mode 100644 index 0000000000000..8ac2fc8e9c6db --- /dev/null +++ b/recipes/ktx/all/patches/0003-clamp-include-algorithm.patch @@ -0,0 +1,23 @@ +from https://github.com/KhronosGroup/KTX-Software/pull/422 + +--- a/utils/ktxapp.h ++++ b/utils/ktxapp.h +@@ -5,6 +5,9 @@ + // SPDX-License-Identifier: Apache-2.0 + + #include ++#if (_MSVC_LANG >= 201703L || __cplusplus >= 201703L) ++#include ++#endif + #include + #include + +@@ -24,7 +27,7 @@ + using namespace std; + + // clamp is in std:: from c++17. +-#if ((defined(_MSVC_LANG) && _MSVC_LANG < 201703L) || __cplusplus < 201703L) ++#if !(_MSVC_LANG >= 201703L || __cplusplus >= 201703L) + template inline T clamp(T value, T low, T high) { + return (value < low) ? low : ((value > high) ? high : value); + } diff --git a/recipes/ktx/all/patches/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/0004-unvendor-dependencies.patch new file mode 100644 index 0000000000000..d09e2d811a873 --- /dev/null +++ b/recipes/ktx/all/patches/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_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/test_package/CMakeLists.txt b/recipes/ktx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d08193e7ed87 --- /dev/null +++ b/recipes/ktx/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Ktx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE KTX::ktx) diff --git a/recipes/ktx/all/test_package/conanfile.py b/recipes/ktx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5ec8993308c18 --- /dev/null +++ b/recipes/ktx/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "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") + ktx_path = os.path.join(self.source_folder, "etc1.ktx") + self.run(f"{bin_path} {ktx_path}", env="conanrun") diff --git a/recipes/ktx/all/test_package/etc1.ktx b/recipes/ktx/all/test_package/etc1.ktx new file mode 100644 index 0000000000000000000000000000000000000000..ff6f8186fd1db5a827b4b1bc17a92f51f3363cbc GIT binary patch literal 8260 zcmZ8`eOwb)_WsS>m_$I5k@`Zl8fG*B+$xX?y0#K95J0M;Qb4N)gz%!}MT7vlW`YV6 zKp^JmEJ^=vV695YR%zpjv#oqtldw>{#KS!>c zD|CP#4<3J;>)<@N8LnI-hVBl>8!1WhO^zi~s`wyy|2~ehIN8BG$6waUdId4LD5o-1A{#GkU)=`tMOzCDl_bKrOV{JnVY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!O%@&vesJQ0bof|nCF_+~Fz~p2X(h2z4sR2|E z0A5M6=Oxp?QBj>338zGft7=tp*XTim$N983R!pja;C%iYkQ@jlS~PJmz!!iP&2C5% zT!eA(X`2`{W^LxP=lF(6&XGuxM}IEB!9W( za*SP5bGX~BmRjt$Uyji|W*tuxKqXyx=MegT+-|JB`4Dtdo8D|HRV7tDS}d@jdBx4? zH{3&OA#Dco@zL7=-d3z`5omW{(W&GG2e#zSYbm}AP0anU*{3dLE<2@3G&L3*L^ z!9Nh7^Ijfcbvs{4h@5Vq8~r{%u(+~CtHyG3*Stz6h46&gTEWGR65h>A1-I&o;!-p( zS>2h`usNx@psYGQ!WErg0mHs1gvS(R8OkuO!d%gQrXcL&Senz?Oey!*|C1g-@nl@6 z=nHK}dA%q64-A;A2)&>7h5pVGA+z{`2(6{MrC3Bys~)?*lG%ysf+Tf+TNug<{`b5s zu6^bbL9XA+cPs^2kglRDEQs$oP1Bv)RA{DV#hJ3>F}qEV;=G4nL<0_!v6Vk}|BYD0 zJ9GpWa1dXTLg&XU0$>NdjE-;r4Ee}JOIZJ)>u8SSIFT<<|BX4351>=@(7i#ko5#rk z3%gp2$bT+syN&9#WHOPn1@$LnQRCtOOz)w`8!9}{%pmlxWa50TlSwpURf!#}V}6x7{G h@e^yQg6{4rtae?_uD0eP{`hBnk)^4SG^p=U{|Aoz@XY`K literal 0 HcmV?d00001 diff --git a/recipes/ktx/all/test_package/test_package.c b/recipes/ktx/all/test_package/test_package.c new file mode 100644 index 0000000000000..f877690cdb0d6 --- /dev/null +++ b/recipes/ktx/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include + +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], + KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT, + &texture); + + return 0; +} diff --git a/recipes/ktx/all/test_v1_package/CMakeLists.txt b/recipes/ktx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ktx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ktx/all/test_v1_package/conanfile.py b/recipes/ktx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d6484909910f3 --- /dev/null +++ b/recipes/ktx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + ktx_path = os.path.join(self.source_folder, os.pardir, "test_package", "etc1.ktx") + self.run(f"{bin_path} {ktx_path}", run_environment=True) diff --git a/recipes/ktx/config.yml b/recipes/ktx/config.yml new file mode 100644 index 0000000000000..d2be8f453d7c0 --- /dev/null +++ b/recipes/ktx/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.0": + folder: all diff --git a/recipes/kuba-zip/all/conandata.yml b/recipes/kuba-zip/all/conandata.yml new file mode 100644 index 0000000000000..687b00ee7e238 --- /dev/null +++ b/recipes/kuba-zip/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.2.6": + url: "https://github.com/kuba--/zip/archive/v0.2.6.tar.gz" + sha256: "6a00e10dc5242f614f76f1bd1d814726a41ee6e3856ef3caf7c73de0b63acf0b" + "0.2.5": + url: "https://github.com/kuba--/zip/archive/v0.2.5.tar.gz" + sha256: "e052f6cbe6713f69f8caec61214fda4e5ae5150d1fcba02c9e79f1a05d939305" + "0.2.4": + url: "https://github.com/kuba--/zip/archive/v0.2.4.tar.gz" + sha256: "a3dd762129d58c7ca7a6462f509d29388dbdb25bec559cb4dc03f75523d69cf2" + "0.2.3": + url: "https://github.com/kuba--/zip/archive/v0.2.3.tar.gz" + sha256: "800e9dc2d2834d92ad333dac29b438dfb495c765bc4e97c7b10101f4f22d53d4" + "0.2.2": + url: "https://github.com/kuba--/zip/archive/refs/tags/v0.2.2.tar.gz" + sha256: "f278b1da5e5382c7a1a1db1502cfa1f6df6b1e05e36253d661344d30277f9895" + "0.2.0": + url: "https://github.com/kuba--/zip/archive/refs/tags/v0.2.0.tar.gz" + sha256: "59ee52b717933b90ea1fff53d5381b612bab8ffbcb3b5f65d2cdfd0814b3068a" + "0.1.31": + url: "https://github.com/kuba--/zip/archive/refs/tags/v0.1.31.tar.gz" + sha256: "65ad5e63497e48ee773fdec86a4c36752a92e53da9cd8da4f1f77b5d743794f1" diff --git a/recipes/kuba-zip/all/conanfile.py b/recipes/kuba-zip/all/conanfile.py new file mode 100644 index 0000000000000..7d777e775d48f --- /dev/null +++ b/recipes/kuba-zip/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class ZipConan(ConanFile): + name = "kuba-zip" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kuba--/zip" + description = "A portable, simple zip library written in C" + topics = ("zip", "compression", "c", "miniz", "portable", "hacking") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_DISABLE_TESTING"] = True + tc.variables["ZIP_STATIC_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["ZIP_BUILD_DOCS"] = False + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-Werror", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "UNLICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "zip") + self.cpp_info.set_property("cmake_target_name", "zip::zip") + + self.cpp_info.names["cmake_find_package"] = "zip" + self.cpp_info.names["cmake_find_package_multi"] = "zip" + + self.cpp_info.libs = ["zip"] + if self.options.shared: + self.cpp_info.defines.append("ZIP_SHARED") diff --git a/recipes/kuba-zip/all/test_package/CMakeLists.txt b/recipes/kuba-zip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e346717f7b6ff --- /dev/null +++ b/recipes/kuba-zip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(zip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zip::zip) diff --git a/recipes/kuba-zip/all/test_package/conanfile.py b/recipes/kuba-zip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/kuba-zip/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/kuba-zip/all/test_package/test_package.c b/recipes/kuba-zip/all/test_package/test_package.c new file mode 100644 index 0000000000000..1d86100685f9c --- /dev/null +++ b/recipes/kuba-zip/all/test_package/test_package.c @@ -0,0 +1,28 @@ +#include + +#include +#include + +int main() +{ + struct zip_t *zip = zip_open("foo.zip", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w'); + { + zip_entry_open(zip, "foo-1.txt"); + { + const char *buf = "Some data here...\0"; + zip_entry_write(zip, buf, strlen(buf)); + } + zip_entry_close(zip); + + zip_entry_open(zip, "foo-2.txt"); + { + // merge 3 files into one entry and compress them on-the-fly. + zip_entry_fwrite(zip, "foo-2.1.txt"); + zip_entry_fwrite(zip, "foo-2.2.txt"); + zip_entry_fwrite(zip, "foo-2.3.txt"); + } + zip_entry_close(zip); + } + zip_close(zip); + return EXIT_SUCCESS; +} diff --git a/recipes/kuba-zip/all/test_v1_package/CMakeLists.txt b/recipes/kuba-zip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/kuba-zip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/kuba-zip/all/test_v1_package/conanfile.py b/recipes/kuba-zip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/kuba-zip/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/kuba-zip/config.yml b/recipes/kuba-zip/config.yml new file mode 100644 index 0000000000000..7244cf3b53ff7 --- /dev/null +++ b/recipes/kuba-zip/config.yml @@ -0,0 +1,15 @@ +versions: + "0.2.6": + folder: "all" + "0.2.5": + folder: "all" + "0.2.4": + folder: "all" + "0.2.3": + folder: "all" + "0.2.2": + folder: "all" + "0.2.0": + folder: "all" + "0.1.31": + folder: "all" diff --git a/recipes/laszip/all/conandata.yml b/recipes/laszip/all/conandata.yml new file mode 100644 index 0000000000000..ec975a7f08b7b --- /dev/null +++ b/recipes/laszip/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "3.4.3": + url: "https://github.com/LASzip/LASzip/releases/download/3.4.3/laszip-src-3.4.3.tar.bz2" + sha256: "5775eb0b97de1b77514d47534cc65c6cfb5bebdd8aed0e47a23af8e75b7ea887" +patches: + "3.4.3": + - patch_file: "patches/0001-no-build-laszip-api.patch" + - patch_file: "patches/0002-no-rpath-and-relocatable-macos.patch" diff --git a/recipes/laszip/all/conanfile.py b/recipes/laszip/all/conanfile.py new file mode 100644 index 0000000000000..a88e4d8aa5712 --- /dev/null +++ b/recipes/laszip/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.build import stdcpp_library +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 +import os + +required_conan_version = ">=1.54.0" + + +class LaszipConan(ConanFile): + name = "laszip" + description = "C++ library for lossless LiDAR compression." + license = "LGPL-2.1" + topics = ("las", "laz", "lidar", "compression", "decompression") + homepage = "https://github.com/LASzip/LASzip" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LASZIP_BUILD_STATIC"] = not self.options.shared + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + suffix = Version(self.version).major if self.settings.os == "Windows" else "" + self.cpp_info.libs = [f"laszip{suffix}"] + if self.options.shared: + self.cpp_info.defines.append("LASZIP_DYN_LINK") + else: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/laszip/all/patches/0001-no-build-laszip-api.patch b/recipes/laszip/all/patches/0001-no-build-laszip-api.patch new file mode 100644 index 0000000000000..b8fb1f96ec6fc --- /dev/null +++ b/recipes/laszip/all/patches/0001-no-build-laszip-api.patch @@ -0,0 +1,9 @@ +--- a/dll/CMakeLists.txt ++++ b/dll/CMakeLists.txt +@@ -3,6 +3,5 @@ set(LASZIP_API_SOURCES + laszip_api.c + ) + +-LASZIP_ADD_LIBRARY(${LASZIP_API_LIB_NAME} ${LASZIP_API_SOURCES}) + LASZIP_ADD_INCLUDES("laszip" "${LASZIP_HEADERS_DIR}/laszip_api.h" ${LASZIP_API_VERSION_H}) + diff --git a/recipes/laszip/all/patches/0002-no-rpath-and-relocatable-macos.patch b/recipes/laszip/all/patches/0002-no-rpath-and-relocatable-macos.patch new file mode 100644 index 0000000000000..68022a79a6394 --- /dev/null +++ b/recipes/laszip/all/patches/0002-no-rpath-and-relocatable-macos.patch @@ -0,0 +1,29 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,15 +80,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/test_package/CMakeLists.txt b/recipes/laszip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2732324131a2f --- /dev/null +++ b/recipes/laszip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(laszip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE laszip::laszip) diff --git a/recipes/laszip/all/test_package/conanfile.py b/recipes/laszip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/laszip/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/laszip/all/test_package/test_package.c b/recipes/laszip/all/test_package/test_package.c new file mode 100644 index 0000000000000..b520d62915635 --- /dev/null +++ b/recipes/laszip/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include + +int main() { + laszip_U8 version_major, version_minor; + laszip_U16 version_revision; + laszip_U32 version_build; + laszip_get_version(&version_major, &version_minor, &version_revision, &version_build); + printf("LASzip version %u.%u.%u - build %u\n", version_major, version_minor, version_revision, version_build); + + return 0; +} diff --git a/recipes/laszip/all/test_v1_package/CMakeLists.txt b/recipes/laszip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/laszip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/laszip/all/test_v1_package/conanfile.py b/recipes/laszip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/laszip/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/laszip/config.yml b/recipes/laszip/config.yml new file mode 100644 index 0000000000000..0d0a2f21c9983 --- /dev/null +++ b/recipes/laszip/config.yml @@ -0,0 +1,3 @@ +versions: + "3.4.3": + folder: all diff --git a/recipes/lcms/all/conandata.yml b/recipes/lcms/all/conandata.yml new file mode 100644 index 0000000000000..5dfb1d726c592 --- /dev/null +++ b/recipes/lcms/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.14": + url: "https://github.com/mm2/Little-CMS/releases/download/lcms2.14/lcms2-2.14.tar.gz" + sha256: "28474ea6f6591c4d4cee972123587001a4e6e353412a41b3e9e82219818d5740" + "2.13.1": + url: "https://github.com/mm2/Little-CMS/releases/download/lcms2.13.1/lcms2-2.13.1.tar.gz" + sha256: "d473e796e7b27c5af01bd6d1552d42b45b43457e7182ce9903f38bb748203b88" +patches: + "2.14": + - patch_file: "patches/2.13.1-0001-fix-msvc-import-lib.patch" + patch_description: "Fix msvc import lib" + patch_type: "portability" + "2.13.1": + - patch_file: "patches/2.13.1-0001-fix-msvc-import-lib.patch" + patch_description: "Fix msvc import lib" + patch_type: "portability" diff --git a/recipes/lcms/all/conanfile.py b/recipes/lcms/all/conanfile.py new file mode 100644 index 0000000000000..6a996a28f1758 --- /dev/null +++ b/recipes/lcms/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.57.0" + + +class LcmsConan(ConanFile): + name = "lcms" + url = "https://github.com/conan-io/conan-center-index" + description = "A free, open source, CMM engine." + license = "MIT" + homepage = "https://github.com/mm2/Little-CMS" + topics = ("littlecms", "little-cms", "cmm", "icc", "cmm-engine", "color-management-engine") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if check_min_vs(self, "190", raise_invalid=False): + # since VS2015 vsnprintf is built-in + path = os.path.join(self.source_folder, "src", "lcms2_internal.h") + replace_in_file(self, path, "# define vsnprintf _vsnprintf", "") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "lcms2") + self.cpp_info.libs = ["lcms2"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("CMS_DLL") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.extend(["m", "pthread"]) + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/lcms/all/patches/2.13.1-0001-fix-msvc-import-lib.patch b/recipes/lcms/all/patches/2.13.1-0001-fix-msvc-import-lib.patch new file mode 100644 index 0000000000000..6200fe4cf44ee --- /dev/null +++ b/recipes/lcms/all/patches/2.13.1-0001-fix-msvc-import-lib.patch @@ -0,0 +1,10 @@ +--- a/meson.build ++++ b/meson.build +@@ -73,7 +73,6 @@ liblcms2_lib = library('lcms2', lcms2_srcs, + dependencies: deps, + c_args: cargs, + version: library_version, +- vs_module_defs: 'src/lcms2.def', + install: true, + ) + diff --git a/recipes/lcms/all/test_package/CMakeLists.txt b/recipes/lcms/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c0d476f344024 --- /dev/null +++ b/recipes/lcms/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lcms REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lcms::lcms) diff --git a/recipes/lcms/all/test_package/conanfile.py b/recipes/lcms/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/lcms/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lcms/all/test_package/test_package.c b/recipes/lcms/all/test_package/test_package.c new file mode 100644 index 0000000000000..36caa135ab730 --- /dev/null +++ b/recipes/lcms/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "lcms2.h" + +int main() +{ + cmsUInt16Number linear[2] = { 0, 0xffff }; + cmsToneCurve * curve = cmsBuildTabulatedToneCurve16(0, 2, linear); + cmsFreeToneCurve(curve); +} diff --git a/recipes/lcms/all/test_v1_package/CMakeLists.txt b/recipes/lcms/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/lcms/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/lcms/all/test_v1_package/conanfile.py b/recipes/lcms/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/lcms/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/lcms/config.yml b/recipes/lcms/config.yml new file mode 100644 index 0000000000000..8a6c0dd7e6e99 --- /dev/null +++ b/recipes/lcms/config.yml @@ -0,0 +1,5 @@ +versions: + "2.14": + folder: all + "2.13.1": + folder: all diff --git a/recipes/ldns/all/conandata.yml b/recipes/ldns/all/conandata.yml new file mode 100644 index 0000000000000..a5e4b6259dffa --- /dev/null +++ b/recipes/ldns/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.8.1": + url: "https://nlnetlabs.nl/downloads/ldns/ldns-1.8.1.tar.gz" + sha256: "958229abce4d3aaa19a75c0d127666564b17216902186e952ca4aef47c6d7fa3" diff --git a/recipes/ldns/all/conanfile.py b/recipes/ldns/all/conanfile.py new file mode 100644 index 0000000000000..b6e94e58b15d8 --- /dev/null +++ b/recipes/ldns/all/conanfile.py @@ -0,0 +1,116 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import XCRun +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 +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.54.0" + + +class LdnsConan(ConanFile): + name = "ldns" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.nlnetlabs.nl/projects/ldns" + description = "LDNS is a DNS library that facilitates DNS tool programming" + topics = ("dns") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + 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") + 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("openssl/1.1.1t") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported by the ldns recipe. Contributions are welcome.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsDeps(self) + try: + # This fixes an issue of linking against ldns in combination of openssl:shared=False, ldns:shared=True, and an older GCC: + # > hidden symbol `pthread_atfork' in /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO + # OpenSSL adds -lpthread to link with POSIX thread library. Instead, it should use -pthread compiler flag which additionally + # sets required macros at compile time. + tc.environment.remove("LIBS", "-lpthread") + tc.environment.append("CFLAGS", "-pthread") + except ValueError: + pass + tc.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-rpath", + f"--with-ssl={self.dependencies['openssl'].package_folder}", + # DNSSEC algorithm support + "--enable-ecdsa", + "--enable-ed25519", + "--enable-ed448", + "--disable-dsa", + "--disable-gost", + "--enable-full-dane", + # tooling + "--disable-ldns-config", + "--without-drill", + "--without-examples", + # library bindings + "--without-pyldns", + "--without-p5-dns-ldns", + ]) + if self.settings.compiler == "apple-clang": + tc.configure_args.append(f"--with-xcode-sdk={XCRun(self).sdk_version}") + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + for target in ["install-h", "install-lib"]: + autotools.install(target=target) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = ["ldns"] diff --git a/recipes/ldns/all/test_package/CMakeLists.txt b/recipes/ldns/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a7ad4d67ebd49 --- /dev/null +++ b/recipes/ldns/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +find_package(PkgConfig) +pkg_check_modules(LDNS REQUIRED "ldns") + +add_executable(example example.c) +target_include_directories(example PUBLIC ${LDNS_INCLUDE_DIRS}) +target_link_libraries(example PUBLIC ${LDNS_LDFLAGS}) diff --git a/recipes/ldns/all/test_package/conanfile.py b/recipes/ldns/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b741b0a2b795c --- /dev/null +++ b/recipes/ldns/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", "compiler", "build_type", "arch" + generators = "PkgConfigDeps", "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): + example = os.path.join(self.cpp.build.bindir, "example") + self.run(example, env="conanrun") diff --git a/recipes/ldns/all/test_package/example.c b/recipes/ldns/all/test_package/example.c new file mode 100644 index 0000000000000..59b8be97c822b --- /dev/null +++ b/recipes/ldns/all/test_package/example.c @@ -0,0 +1,46 @@ +#include +#include + +static ldns_rr_list *rrset_from_str(const char *str) +{ + ldns_rr *rr = NULL; + if (ldns_rr_new_frm_str(&rr, str, 0, NULL, NULL) != LDNS_STATUS_OK) { + return NULL; + } + + ldns_rr_list *rrset = ldns_rr_list_new(); + if (rrset == NULL) { + ldns_rr_free(rr); + return NULL; + } + + if (!ldns_rr_list_push_rr(rrset, rr)) { + ldns_rr_free(rr); + ldns_rr_list_deep_free(rrset); + return NULL; + } + + return rrset; +} + + +int main(int argc, char *argv[]) +{ + ldns_rr_list *data = rrset_from_str("nlnetlabs.nl. 240 IN AAAA 2a04:b900::1:0:0:10"); + ldns_rr_list *rrsigs = rrset_from_str("nlnetlabs.nl. 240 IN RRSIG AAAA 8 2 240 20210316015010 20210216015010 42393 nlnetlabs.nl. sZ24Gr6kcWVUMU+pFsoEiW+R7TeE2f3g9EcuIq3Rh+aA38ZslHIv41fFjN9KdfQOdivHlgZ+d6cvhJfXczaHHYRTpLdvkz6s/mbJ7z+NnvpJdQa7g1qWXD6f2rHyC0TjyV15divsK+aogSs/xXuRZfUlPxqe5Lrwtaxp0r471GU="); + ldns_rr_list *dnskeys = rrset_from_str("nlnetlabs.nl. 3205 IN DNSKEY 256 3 8 AwEAAdR7XR95OaAN9Rz7TbtPalQ9guQk7zfxTHYNKhsiwTZA9z+F16nD0VeBlk7dNik3ETpT2GLAwr9sntG898JwurCDe353wHPvjZtMCdiTVp3cRCrjuCEvoFpmZNN82H0gaH/4v8mkv/QBDAkDSncYjz/FqHKAeYy3cMcjY6RyVweh"); + + int ret = ldns_verify_notime(data, rrsigs, dnskeys, NULL); + + ldns_rr_list_deep_free(data); + ldns_rr_list_deep_free(rrsigs); + ldns_rr_list_deep_free(dnskeys); + + if (ret != LDNS_STATUS_OK) { + printf("failed\n"); + return 1; + } + + printf("ok\n"); + return 0; +} diff --git a/recipes/ldns/all/test_v1_package/CMakeLists.txt b/recipes/ldns/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3c9553de48e54 --- /dev/null +++ b/recipes/ldns/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ldns/all/test_v1_package/conanfile.py b/recipes/ldns/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..648cf88ac9c76 --- /dev/null +++ b/recipes/ldns/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conans.tools import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "pkg_config" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + example = os.path.join("test_package", "example") + self.run(example, run_environment=True) diff --git a/recipes/ldns/config.yml b/recipes/ldns/config.yml new file mode 100644 index 0000000000000..c3578038cb2a3 --- /dev/null +++ b/recipes/ldns/config.yml @@ -0,0 +1,3 @@ +versions: + "1.8.1": + folder: all diff --git a/recipes/lely-core/all/conandata.yml b/recipes/lely-core/all/conandata.yml new file mode 100644 index 0000000000000..cc7e4931e5ec2 --- /dev/null +++ b/recipes/lely-core/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.2": + url: "https://gitlab.com/lely_industries/lely-core/-/archive/v2.3.2/lely-core-v2.3.2.tar.gz" + sha256: "c37eb6f004ad1a1ec1f891e31a09b72f588da361fa92888e8edfcf215a1d707a" diff --git a/recipes/lely-core/all/conanfile.py b/recipes/lely-core/all/conanfile.py new file mode 100644 index 0000000000000..f57056df76197 --- /dev/null +++ b/recipes/lely-core/all/conanfile.py @@ -0,0 +1,241 @@ +import os + +from conan import ConanFile +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import ( + export_conandata_patches, + apply_conandata_patches, + get, + copy, + rmdir, + rm, +) +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + + +class LelyConan(ConanFile): + name = "lely-core" + + # Optional metadata + 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." + topics = ("canopen",) + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "rt": [True, False], + "threads": [True, False], + "ecss-compliance": [True, False], + "errno": [True, False], + "malloc": [True, False], + "stdio": [True, False], + "cxx": [True, False], + "daemon": [True, False], + "diag": [True, False], + "canfd": [True, False], + "dcf": [True, False], + "dcf-restore": [True, False], + "obj-default": [True, False], + "obj-file": [True, False], + "obj-limits": [True, False], + "obj-name": [True, False], + "obj-upload": [True, False], + "sdev": [True, False], + "csdo": [True, False], + "rpdo": [True, False], + "tpdo": [True, False], + "mpdo": [True, False], + "sync": [True, False], + "time": [True, False], + "emcy": [True, False], + "lss": [True, False], + "wtm": [True, False], + "master": [True, False], + "ng": [True, False], + "nmt-boot": [True, False], + "nmt-cfg": [True, False], + "gw": [True, False], + "gw-txt": [True, False], + "coapp-master": [True, False], + "coapp-slave": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "rt": True, + "threads": True, + "ecss-compliance": False, + "errno": True, + "malloc": True, + "stdio": True, + "cxx": True, + "daemon": True, + "diag": True, + "canfd": True, + "dcf": True, + "dcf-restore": True, + "obj-default": True, + "obj-file": True, + "obj-limits": True, + "obj-name": True, + "obj-upload": True, + "sdev": True, + "csdo": True, + "rpdo": True, + "tpdo": True, + "mpdo": True, + "sync": True, + "time": True, + "emcy": True, + "lss": True, + "wtm": True, + "master": True, + "ng": True, + "nmt-boot": True, + "nmt-cfg": True, + "gw": True, + "gw-txt": True, + "coapp-master": True, + "coapp-slave": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration( + f"{self.ref} is only compatible with Linux. " + "Windows requires proprietary software from https://www.ixxat.com/technical-support/support/windows-driver-software " + "hence support for it will be skipped for now " + ) + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration( + f"{self.ref} can only be compiled with GCC currently" + ) + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + strip_root=True, + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + at_toolchain = AutotoolsToolchain(self) + at_toolchain.configure_args += [ + "--disable-cython", + "--disable-python", + "--disable-tools", + "--disable-dependency-tracking", + "--disable-maintainer-mode", + ] + if self.options.get_safe("ecss-compliance"): + at_toolchain.configure_args.append("--enable-ecss-compliance") + + disable_options = { + "threads", + "rt", + "errno", + "malloc", + "stdio", + "cxx", + "daemon", + "diag", + "canfd", + "dcf", + "dcf-restore", + "obj-default", + "obj-file", + "obj-limits", + "obj-name", + "obj-upload", + "sdev", + "csdo", + "rpdo", + "tpdo", + "mpdo", + "sync", + "time", + "emcy", + "lss", + "wtm", + "master", + "ng", + "nmt-boot", + "nmt-cfg", + "gw", + "gw-txt", + "coapp-master", + "coapp-slave", + } + for option in disable_options: + if not self.options.get_safe(option): + at_toolchain.configure_args.append(f"--disable-{option}") + + at_toolchain.generate() + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + + copy( + self, + "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + components = { + "can": {"requires": ["libc", "util"]}, + "co": {"requires": ["libc", "util", "can"]}, + "coapp": {"requires": ["libc", "io2", "co"]}, + "ev": {"requires": ["libc", "util"]}, + "io2": {"requires": ["libc", "util", "can", "ev"]}, + "libc": { + "requires": [], + "system_libs": ["pthread"] if self.options.threads else [], + }, + "tap": {"requires": ["libc"]}, + "util": {"requires": ["libc"], "system_libs": ["m"]}, + } + for component, dependencies in components.items(): + self.cpp_info.components[component].libs = [f"lely-{component}"] + self.cpp_info.components[component].requires = dependencies.get( + "requires", [] + ) + self.cpp_info.components[component].system_libs = dependencies.get( + "system_libs", [] + ) diff --git a/recipes/lely-core/all/test_package/CMakeLists.txt b/recipes/lely-core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c8be0aec2f07e --- /dev/null +++ b/recipes/lely-core/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.2) +project(test_package) + +find_package(lely-core REQUIRED) + +add_executable("${PROJECT_NAME}" test_package.cpp) +target_link_libraries("${PROJECT_NAME}" PRIVATE lely-core::lely-core) +target_compile_features("${PROJECT_NAME}" PRIVATE cxx_std_11) diff --git a/recipes/lely-core/all/test_package/conanfile.py b/recipes/lely-core/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1276db634e491 --- /dev/null +++ b/recipes/lely-core/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 + + +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/lely-core/all/test_package/test_package.cpp b/recipes/lely-core/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..70748728b4af4 --- /dev/null +++ b/recipes/lely-core/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include + +using namespace lely; + +int main() { + io::IoGuard io_guard{}; + io::Context context{}; + io::Poll poll{context}; + + ev::Loop loop{poll.get_poll()}; + + loop.run(); +} diff --git a/recipes/lely-core/all/test_v1_package/CMakeLists.txt b/recipes/lely-core/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ce0ee43ce03ba --- /dev/null +++ b/recipes/lely-core/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.2) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory("${CMAKE_SOURCE_DIR}/../test_package" "${CMAKE_BINARY_DIR}/test_package") diff --git a/recipes/lely-core/all/test_v1_package/conanfile.py b/recipes/lely-core/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0245c9a8028a3 --- /dev/null +++ b/recipes/lely-core/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/lely-core/config.yml b/recipes/lely-core/config.yml new file mode 100644 index 0000000000000..aee8de619ec30 --- /dev/null +++ b/recipes/lely-core/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.2": + folder: all diff --git a/recipes/lemon/all/CMakeLists.txt b/recipes/lemon/all/CMakeLists.txt new file mode 100644 index 0000000000000..5faeac922c385 --- /dev/null +++ b/recipes/lemon/all/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(Lemon LANGUAGES C) + +add_executable(lemon ${LEMON_SRC_DIR}/tool/lemon.c) + +include(GNUInstallDirs) +install(TARGETS lemon DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ${LEMON_SRC_DIR}/tool/lempar.c DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/recipes/lemon/all/conandata.yml b/recipes/lemon/all/conandata.yml new file mode 100644 index 0000000000000..c28ab14ba08ac --- /dev/null +++ b/recipes/lemon/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.32.3": + url: "https://sqlite.org/2020/sqlite-src-3320300.zip" + sha256: "9312f0865d3692384d466048f746d18f88e7ffd1758b77d4f07904e03ed5f5b9" +patches: + "3.32.3": + - patch_file: "patches/0001-use-executable-template-path.patch" diff --git a/recipes/lemon/all/conanfile.py b/recipes/lemon/all/conanfile.py new file mode 100644 index 0000000000000..648e6e06bd3a0 --- /dev/null +++ b/recipes/lemon/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, save +import os + +required_conan_version = ">=1.53.0" + + +class LemonConan(ConanFile): + name = "lemon" + description = "The Lemon program reads a grammar of the input language and emits C-code to implement a parser for that language." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sqlite.org/lemon.html" + topics = ("grammar", "lexer", "lalr", "parser", "generator", "sqlite") + license = "Unlicense" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LEMON_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license_text(self): + header = load(self, os.path.join(self.source_folder, "tool", "lempar.c")) + return "\n".join(line.strip(" \n*") for line in header[3:header.find("*******", 1)].splitlines()) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license_text()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/lemon/all/patches/0001-use-executable-template-path.patch b/recipes/lemon/all/patches/0001-use-executable-template-path.patch new file mode 100644 index 0000000000000..031dc360a18b7 --- /dev/null +++ b/recipes/lemon/all/patches/0001-use-executable-template-path.patch @@ -0,0 +1,65 @@ +--- tool/lemon.c ++++ tool/lemon.c +@@ -3502,11 +3502,53 @@ + } + } + ++#ifdef _WIN32 ++# define WIN32_LEAN_AND_MEAN ++# include ++#else ++# include ++# include ++#endif ++#include ++ ++#define DEFAULT_PATH "." ++ ++static char *get_default_template_path(const char *filename) { ++ static char static_path[8192]; ++#ifdef _WIN32 ++# define JOINER "\\" ++ SetLastError(ERROR_SUCCESS); ++ int result = GetModuleFileNameA(NULL, static_path, sizeof(static_path)); ++ if (GetLastError() != ERROR_SUCCESS) { ++ memcpy(static_path, DEFAULT_PATH, strlen(DEFAULT_PATH)); ++ } ++ char *pos = strrchr(static_path, '\\'); ++ if (pos) { ++ *pos = '\0'; ++ } ++#else ++# define JOINER "/" ++ ssize_t nb = readlink("/proc/self/exe", static_path, sizeof(static_path)); ++ if (nb != -1) { ++ static_path[nb] = '\0'; ++ dirname(static_path); ++ } else { ++ memcpy(static_path, DEFAULT_PATH, strlen(DEFAULT_PATH)); ++ } ++#endif ++ if (sizeof(static_path) < (strlen(static_path) + sizeof(JOINER) + strlen(filename) + 1)) { ++ strcpy(static_path, DEFAULT_PATH); ++ } ++ strncat(static_path, JOINER, sizeof(JOINER)); ++ strncat(static_path, filename, sizeof(filename)); ++ return static_path; ++} ++ + /* The next function finds the template file and opens it, returning + ** a pointer to the opened file. */ + PRIVATE FILE *tplt_open(struct lemon *lemp) + { +- static char templatename[] = "lempar.c"; ++ char *templatename; + char buf[1000]; + FILE *in; + char *tpltname; +@@ -3530,6 +3572,7 @@ + return in; + } + ++ templatename = get_default_template_path("lempar.c"); + cp = strrchr(lemp->filename,'.'); + if( cp ){ + lemon_sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); diff --git a/recipes/lemon/all/test_package/CMakeLists.txt b/recipes/lemon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..939f259b3d4dd --- /dev/null +++ b/recipes/lemon/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.2) +project(test_package LANGUAGES C) + +find_program(LEMON_PROGRAM NAMES lemon) + +add_custom_command( + OUTPUT gram.c gram.h + COMMAND ${LEMON_PROGRAM} -s "${PROJECT_SOURCE_DIR}/gram.y" -d"${PROJECT_BINARY_DIR}" + BYPRODUCTS gram.out +) + +add_executable(${PROJECT_NAME} gram.c) diff --git a/recipes/lemon/all/test_package/conanfile.py b/recipes/lemon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a1b9a2d470968 --- /dev/null +++ b/recipes/lemon/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", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_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/lemon/all/test_package/gram.y b/recipes/lemon/all/test_package/gram.y new file mode 100644 index 0000000000000..ffdacdab9288b --- /dev/null +++ b/recipes/lemon/all/test_package/gram.y @@ -0,0 +1,71 @@ +%include { +#include +#include +} + +%extra_argument {double *res} +%token_type {double} + +res ::= expr(B). { *res = B; } +expr(A) ::= expr(B) PLUS expr(C). { A = B + C; } +expr(A) ::= expr(B) MINUS expr(C). { A = B - C; } +expr(A) ::= expr(B) TIMES expr(C). { A = B * C; } +expr(A) ::= expr(B) DIVIDE expr(C). { A = B / C;} +expr(A) ::= expr(B) MOD expr(C). { A = modf(B, &C); } +expr(A) ::= LPAREN expr(B) RPAREN. { A = B; } +expr(A) ::= VALUE(B). { A = B; } +expr(A) ::= MINUS expr(B). [UMINUS] { A = -B; } + +%left PLUS MINUS. +%left TIMES DIVIDE MOD. +%right UMINUS. + +%code { + +#include "gram.h" + +typedef struct { + int id; + double val; +} input_item_t; + +static input_item_t test_input[] = { + {VALUE, 1.}, + {PLUS, 0.}, + {VALUE, 2.}, + {PLUS, 0.}, + {VALUE, 3.}, + {TIMES, 0.}, + {VALUE, 4.}, + {TIMES, 0.}, + {VALUE, 5.}, + {TIMES, 0.}, + {LPAREN, 0.}, + {VALUE, 6.}, + {MINUS, 0.}, + {VALUE, 7.}, + {RPAREN, 0.}, + {0., 0.}, +}; + +#include +#include + +int main(int argc, const char *argv[]) { + void *pParser = ParseAlloc(malloc); + double result = -123456.; + double val; + input_item_t *input = test_input; + while (1) { + Parse(pParser, input->id, input->val, &result); + if (input->id == 0) { + break; + } + ++input; + } + ParseFree(pParser, free); + printf("Result is %g.\n", result); + return 0; +} + +} diff --git a/recipes/lemon/all/test_v1_package/CMakeLists.txt b/recipes/lemon/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/lemon/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/lemon/all/test_v1_package/conanfile.py b/recipes/lemon/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..02ecf312299d6 --- /dev/null +++ b/recipes/lemon/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + test_type = "explicit" + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + 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/lemon/config.yml b/recipes/lemon/config.yml new file mode 100644 index 0000000000000..65d307f5d363d --- /dev/null +++ b/recipes/lemon/config.yml @@ -0,0 +1,3 @@ +versions: + "3.32.3": + folder: "all" diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml new file mode 100644 index 0000000000000..2902df5b0c405 --- /dev/null +++ b/recipes/leptonica/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "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 new file mode 100644 index 0000000000000..109404f2d8984 --- /dev/null +++ b/recipes/leptonica/all/conanfile.py @@ -0,0 +1,256 @@ +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, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.55.0" + + +class LeptonicaConan(ConanFile): + name = "leptonica" + url = "https://github.com/conan-io/conan-center-index" + description = "Library containing software that is broadly useful for " \ + "image processing and image analysis applications." + topics = ("image", "multimedia", "format", "graphics") + homepage = "http://leptonica.org" + license = "BSD 2-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "with_gif": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "with_png": [True, False], + "with_tiff": [True, False], + "with_openjpeg": [True, False], + "with_webp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_gif": True, + "with_jpeg": "libjpeg", + "with_png": True, + "with_tiff": True, + "with_openjpeg": True, + "with_webp": 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") + if bool(self.options.with_jpeg): + self.options["*"].jpeg = self.options.with_jpeg + self.options["*"].with_jpeg = self.options.with_jpeg + self.options["*"].with_libjpeg = self.options.with_jpeg + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_gif: + self.requires("giflib/5.2.1") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + if self.options.with_png: + self.requires("libpng/1.6.39") + if self.options.with_tiff: + self.requires("libtiff/4.4.0") + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + if self.options.with_webp: + self.requires("libwebp/1.3.0") + + def build_requirements(self): + if self.options.with_webp or self.options.with_openjpeg: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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": + tc.variables["LIBWEBP_SUPPORT"] = self.options.with_webp + tc.variables["OPENJPEG_SUPPORT"] = self.options.with_openjpeg + tc.generate() + deps = CMakeDeps(self) + deps.generate() + if self.options.with_webp or self.options.with_openjpeg: + pc = PkgConfigDeps(self) + pc.generate() + env = VirtualBuildEnv(self) + env.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + cmakelists_src = os.path.join(self.source_folder, "src", "CMakeLists.txt") + cmake_configure = os.path.join(self.source_folder, "cmake", "Configure.cmake") + + # Honor options and inject dependencies definitions + # TODO: submit a patch upstream + ## zlib + replace_in_file(self, cmakelists_src, "${ZLIB_LIBRARIES}", "ZLIB::ZLIB") + if not self.options.with_zlib: + replace_in_file(self, cmakelists_src, "if (ZLIB_LIBRARIES)", "if(0)") + replace_in_file(self, cmake_configure, "if (ZLIB_FOUND)", "if(0)") + ## giflib + 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)") + ## 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)") + ## 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)") + ## 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)") + ## 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)", "") + # 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: + replace_in_file(self, cmakelists_src, "if (JP2K_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") + 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)") + + ## 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)") + 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})") + replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") + + # Remove detection of fmemopen() on macOS < 10.13 + # CheckFunctionExists will find it in the link library. + # There's no error because it's not including the header with the + # deprecation macros. + if self.settings.os == "Macos" and self.settings.os.version: + if Version(self.settings.os.version) < "10.13": + replace_in_file(self, cmake_configure, + "set(functions_list\n " + "fmemopen\n fstatat\n)", + "set(functions_list\n " + "fstatat\n)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "leptonica-license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # since 1.81.0 + rmdir(self, os.path.join(self.package_folder, "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"leptonica": "Leptonica::Leptonica"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Leptonica") + self.cpp_info.set_property("cmake_target_name", "leptonica") + self.cpp_info.set_property("pkg_config_name", "lept") + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + self.cpp_info.includedirs.append(os.path.join("include", "leptonica")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Leptonica" + self.cpp_info.names["cmake_find_package_multi"] = "Leptonica" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "lept" diff --git a/recipes/leptonica/all/patches/fix-find-modules-variables.patch b/recipes/leptonica/all/patches/fix-find-modules-variables.patch new file mode 100644 index 0000000000000..3dc86df7e707e --- /dev/null +++ b/recipes/leptonica/all/patches/fix-find-modules-variables.patch @@ -0,0 +1,48 @@ +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/all/test_package/CMakeLists.txt b/recipes/leptonica/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b498b89f556d8 --- /dev/null +++ b/recipes/leptonica/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Leptonica REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE leptonica) diff --git a/recipes/leptonica/all/test_package/conanfile.py b/recipes/leptonica/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/leptonica/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/leptonica/all/test_package/test_package.c b/recipes/leptonica/all/test_package/test_package.c new file mode 100644 index 0000000000000..078444172a153 --- /dev/null +++ b/recipes/leptonica/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) { + printf("Leptonica version: %d.%d.%d\n", LIBLEPT_MAJOR_VERSION, LIBLEPT_MINOR_VERSION, LIBLEPT_PATCH_VERSION); + printf("Lib versions: %s\n", getImagelibVersions()); + return 0; +} diff --git a/recipes/leptonica/all/test_v1_package/CMakeLists.txt b/recipes/leptonica/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/leptonica/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/leptonica/all/test_v1_package/conanfile.py b/recipes/leptonica/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/leptonica/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/leptonica/config.yml b/recipes/leptonica/config.yml new file mode 100644 index 0000000000000..36297367918ec --- /dev/null +++ b/recipes/leptonica/config.yml @@ -0,0 +1,13 @@ +versions: + "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/lerc/all/conandata.yml b/recipes/lerc/all/conandata.yml new file mode 100644 index 0000000000000..f1d58df7a46b7 --- /dev/null +++ b/recipes/lerc/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "4.0.0": + url: "https://github.com/Esri/lerc/archive/refs/tags/v4.0.0.tar.gz" + sha256: "91431c2b16d0e3de6cbaea188603359f87caed08259a645fd5a3805784ee30a0" + "2.2": + url: "https://github.com/Esri/lerc/archive/v2.2.tar.gz" + sha256: "abc0c5c149144d39a8b351ff5a9a5940c0f66ba908ecf717d58f8f71065d11fe" + "2.1": + url: "https://github.com/Esri/lerc/archive/v2.1.tar.gz" + sha256: "7c48de40cd5f09319de4b39c417ff4eec4ad4b6aa5d6144f6ffa9b10d18ec94e" +patches: + "4.0.0": + - patch_file: "patches/4.0.0-include-algorithm.patch" + patch_description: "include algorithm header for std::min/max" + patch_type: "portability" + "2.2": + - patch_file: "patches/2.1-add-CMakeLists-and-static.patch" + patch_description: "create CMakeLists.txt, redefine LERCDLL_API for static build" + patch_type: "conan" + "2.1": + - patch_file: "patches/2.1-add-CMakeLists-and-static.patch" + patch_description: "create CMakeLists.txt, redefine LERCDLL_API for static build" + patch_type: "conan" diff --git a/recipes/lerc/all/conanfile.py b/recipes/lerc/all/conanfile.py new file mode 100644 index 0000000000000..c64435c5746f7 --- /dev/null +++ b/recipes/lerc/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LercConan(ConanFile): + name = "lerc" + description = "C++ library for limited Error Raster Compression." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Esri/lerc" + topics = ("lerclib", "compression", "decompression", "image", "raster") + 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 export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + if Version(self.version) >= "3.0": + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["LercLib" if Version(self.version) < "4.0.0" else "Lerc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if Version(self.version) >= "3.0": + self.cpp_info.set_property("pkg_config_name", "Lerc") + if not self.options.shared: + self.cpp_info.defines = ["LERC_STATIC"] diff --git a/recipes/lerc/all/patches/2.1-add-CMakeLists-and-static.patch b/recipes/lerc/all/patches/2.1-add-CMakeLists-and-static.patch new file mode 100644 index 0000000000000..8a5e59a7c1157 --- /dev/null +++ b/recipes/lerc/all/patches/2.1-add-CMakeLists-and-static.patch @@ -0,0 +1,61 @@ +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,24 @@ ++cmake_minimum_required(VERSION 3.8) ++project(Lerc) ++ ++file(GLOB SOURCES ++ "src/LercLib/*" ++ "src/LercLib/Lerc1Decode/*" ++) ++ ++add_library(LercLib ${SOURCES}) ++target_compile_features(LercLib PRIVATE cxx_std_11) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(LercLib PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN TRUE) ++ if(WIN32) ++ target_compile_definitions(LercLib PRIVATE LERC_EXPORTS) ++ endif() ++endif() ++ ++set(HEADER_FILES include/Lerc_c_api.h include/Lerc_types.h) ++install(FILES ${HEADER_FILES} DESTINATION include) ++install(TARGETS LercLib ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++) +--- a/include/Lerc_c_api.h ++++ b/include/Lerc_c_api.h +@@ -28,13 +28,7 @@ Contributors: Thomas Maurer + extern "C" { + #endif + +-#if defined(_MSC_VER) +- #define LERCDLL_API __declspec(dllexport) +-#elif __GNUC__ >= 4 +- #define LERCDLL_API __attribute__((visibility("default"))) +-#else +- #define LERCDLL_API +-#endif ++#define LERCDLL_API + + + //! C-API for LERC library +--- a/src/LercLib/Lerc_c_api.h ++++ b/src/LercLib/Lerc_c_api.h +@@ -28,8 +28,12 @@ Contributors: Thomas Maurer + extern "C" { + #endif + +-#if defined(_MSC_VER) +- #define LERCDLL_API __declspec(dllexport) ++#ifdef _WIN32 ++ #ifdef LERC_EXPORTS ++ #define LERCDLL_API __declspec(dllexport) ++ #else ++ #define LERCDLL_API ++ #endif + #elif __GNUC__ >= 4 + #define LERCDLL_API __attribute__((visibility("default"))) + #else diff --git a/recipes/lerc/all/patches/4.0.0-include-algorithm.patch b/recipes/lerc/all/patches/4.0.0-include-algorithm.patch new file mode 100644 index 0000000000000..dea8f0292de5d --- /dev/null +++ b/recipes/lerc/all/patches/4.0.0-include-algorithm.patch @@ -0,0 +1,24 @@ +diff --git a/src/LercLib/fpl_EsriHuffman.cpp b/src/LercLib/fpl_EsriHuffman.cpp +index b72bd44..2f6ae7f 100644 +--- a/src/LercLib/fpl_EsriHuffman.cpp ++++ b/src/LercLib/fpl_EsriHuffman.cpp +@@ -28,6 +28,7 @@ Original coding 2021 Yuriy Yakimenko + #include + #include + #include ++#include + + USING_NAMESPACE_LERC + +diff --git a/src/LercLib/fpl_Lerc2Ext.cpp b/src/LercLib/fpl_Lerc2Ext.cpp +index b07104c..df184f5 100644 +--- a/src/LercLib/fpl_Lerc2Ext.cpp ++++ b/src/LercLib/fpl_Lerc2Ext.cpp +@@ -28,6 +28,7 @@ Original coding 2021 Yuriy Yakimenko + #include + #include + #include ++#include + + USING_NAMESPACE_LERC + diff --git a/recipes/lerc/all/test_package/CMakeLists.txt b/recipes/lerc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..50d07b3052d3e --- /dev/null +++ b/recipes/lerc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(lerc REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE lerc::lerc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(lerc_VERSION VERSION_GREATER_EQUAL "3.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE -DLERC_VER3_LATER) +endif() diff --git a/recipes/lerc/all/test_package/conanfile.py b/recipes/lerc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/lerc/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/lerc/all/test_package/test_package.cpp b/recipes/lerc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c399abcf8d219 --- /dev/null +++ b/recipes/lerc/all/test_package/test_package.cpp @@ -0,0 +1,140 @@ +#include + +#include +#include +#include +#include +#include + +typedef unsigned char Byte; // convenience +typedef unsigned int uint32; + +enum lerc_DataType { dt_char = 0, dt_uchar, dt_short, dt_ushort, dt_int, dt_uint, dt_float, dt_double }; + +void BlobInfo_Print(const uint32* infoArr) +{ + const uint32* ia = infoArr; + printf("version = %d, dataType = %d, nDim = %d, nCols = %d, nRows = %d, nBands = %d, nValidPixels = %d, blobSize = %d\n", + ia[0], ia[1], ia[2], ia[3], ia[4], ia[5], ia[6], ia[7]); +} + +bool BlobInfo_Equal(const uint32* infoArr, uint32 nDim, uint32 nCols, uint32 nRows, uint32 nBands, uint32 dataType) +{ + const uint32* ia = infoArr; + return ia[1] == dataType && ia[2] == nDim && ia[3] == nCols && ia[4] == nRows && ia[5] == nBands; +} + +// Sample 1: float image, 1 band, with some pixels set to invalid / void, maxZError = 0.1 +void sample1() { + const int h = 512; + const int w = 512; + + std::vector zImg(w * h); + std::vector maskByteImg(w * h); + for (int k = 0, i = 0; i < h; ++i) { + for (int j = 0; j < w; ++j, ++k) { + zImg[k] = std::sqrt(static_cast(i * i + j * j)); // smooth surface + zImg[k] += std::rand() % 20; // add some small amplitude noise + + if (j % 100 == 0 || i % 100 == 0) // set some void points + maskByteImg[k] = 0; + else + maskByteImg[k] = 1; + } + } + + + // compress into byte arr + + double maxZErrorWanted = 0.1; + double eps = 0.0001; // safety margin (optional), to account for finite floating point accuracy + double maxZError = maxZErrorWanted - eps; + + uint32 numBytesNeeded = 0; + uint32 numBytesWritten = 0; + + lerc_status hr = lerc_computeCompressedSize(reinterpret_cast(&zImg[0]), // raw image data, row by row, band by band + static_cast(dt_float), 1, w, h, 1, +#ifdef LERC_VER3_LATER + 1, +#endif + maskByteImg.data(), // can give nullptr if all pixels are valid + maxZError, // max coding error per pixel, or precision + &numBytesNeeded); // size of outgoing Lerc blob + + if (hr) + std::cout << "lerc_computeCompressedSize(...) failed" << std::endl; + + uint32 numBytesBlob = numBytesNeeded; + std::vector pLercBlob(numBytesBlob); + + hr = lerc_encode(reinterpret_cast(&zImg[0]), // raw image data, row by row, band by band + static_cast(dt_float), 1, w, h, 1, +#ifdef LERC_VER3_LATER + 1, +#endif + maskByteImg.data(), // can give nullptr if all pixels are valid + maxZError, // max coding error per pixel, or precision + &pLercBlob[0], // buffer to write to, function will fail if buffer too small + numBytesBlob, // buffer size + &numBytesWritten); // num bytes written to buffer + + if (hr) + std::cout << "lerc_encode(...) failed" << std::endl; + + double ratio = w * h * (0.125 + sizeof(float)) / numBytesBlob; + std::cout << "sample 1 compression ratio = " << ratio << std::endl; + + + // decompress + + uint32 infoArr[10]; + double dataRangeArr[3]; + hr = lerc_getBlobInfo(&pLercBlob[0], numBytesBlob, infoArr, dataRangeArr, 10, 3); + if (hr) + std::cout << "lerc_getBlobInfo(...) failed" << std::endl; + + BlobInfo_Print(infoArr); + + if (!BlobInfo_Equal(infoArr, 1, w, h, 1, static_cast(dt_float))) + std::cout << "got wrong lerc info" << std::endl; + + // new empty data storage + std::vector zImg3(w * h); + + std::vector maskByteImg3(w * h); + +#ifdef LERC_VER3_LATER + hr = lerc_decode(&pLercBlob[0], numBytesBlob, 1, maskByteImg3.data(), 1, w, h, 1, static_cast(dt_float), reinterpret_cast(&zImg3[0])); +#else + hr = lerc_decode(&pLercBlob[0], numBytesBlob, &maskByteImg3[0], 1, w, h, 1, static_cast(dt_float), reinterpret_cast(&zImg3[0])); +#endif + if (hr) + std::cout << "lerc_decode(...) failed" << std::endl; + + // compare to orig + + double maxDelta = 0; + for (int k = 0, i = 0; i < h; i++) + { + for (int j = 0; j < w; j++, k++) + { + if (maskByteImg3[k] != maskByteImg[k]) + std::cout << "Error in main: decoded valid bytes differ from encoded valid bytes" << std::endl; + + if (maskByteImg3[k]) + { + double delta = std::fabs(zImg3[k] - zImg[k]); + if (delta > maxDelta) + maxDelta = delta; + } + } + } + + std::cout << "max z error per pixel = " << maxDelta << std::endl; +} + +int main() { + sample1(); + return 0; +} diff --git a/recipes/lerc/all/test_v1_package/CMakeLists.txt b/recipes/lerc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/lerc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/lerc/all/test_v1_package/conanfile.py b/recipes/lerc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/lerc/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/lerc/config.yml b/recipes/lerc/config.yml new file mode 100644 index 0000000000000..6bcfdf0332e1f --- /dev/null +++ b/recipes/lerc/config.yml @@ -0,0 +1,7 @@ +versions: + "4.0.0": + folder: all + "2.2": + folder: all + "2.1": + folder: all diff --git a/recipes/lest/all/conandata.yml b/recipes/lest/all/conandata.yml new file mode 100644 index 0000000000000..0c06b134376db --- /dev/null +++ b/recipes/lest/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.35.1": + url: "https://github.com/martinmoene/lest/archive/v1.35.1.tar.gz" + sha256: "ca715833563f983c81d86623c2d1911d7a2aa04ce00459b0f3794a8e441265e0" diff --git a/recipes/lest/all/conanfile.py b/recipes/lest/all/conanfile.py new file mode 100644 index 0000000000000..64f52a3c5b929 --- /dev/null +++ b/recipes/lest/all/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conans import ConanFile, tools + +class LestConan(ConanFile): + name = "lest" + description = "A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD." + license = "BSL-1.0" + topics = ("conan", "testing", "testing-framework", "unit-testing", "header-only") + homepage = "https://github.com/martinmoene/lest" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/lest/all/test_package/CMakeLists.txt b/recipes/lest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/lest/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lest/all/test_package/conanfile.py b/recipes/lest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/lest/all/test_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" + + 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/lest/all/test_package/test_package.cpp b/recipes/lest/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7b3f62f3908f8 --- /dev/null +++ b/recipes/lest/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "lest/lest.hpp" + + +const lest::test specification[] = +{ + CASE( "Empty string has length zero (succeed)" ) + { + EXPECT( 0 == std::string( ).length() ); + EXPECT( 0 == std::string("").length() ); + }, +}; + +int main( int argc, char * argv[] ) +{ + return lest::run( specification, argc, argv ); +} + diff --git a/recipes/lest/config.yml b/recipes/lest/config.yml new file mode 100644 index 0000000000000..1e86bc3f93bdf --- /dev/null +++ b/recipes/lest/config.yml @@ -0,0 +1,3 @@ +versions: + "1.35.1": + folder: all diff --git a/recipes/leveldb/all/conandata.yml b/recipes/leveldb/all/conandata.yml new file mode 100644 index 0000000000000..904735bb768f7 --- /dev/null +++ b/recipes/leveldb/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.23": + sha256: 9a37f8a6174f09bd622bc723b55881dc541cd50747cbd08831c2a82d620f6d76 + url: https://github.com/google/leveldb/archive/1.23.tar.gz + "1.22": + sha256: 55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2 + url: https://github.com/google/leveldb/archive/1.22.tar.gz +patches: + "1.23": + - patch_file: "patches/check_library_exists.1.23.patch" + "1.22": + - patch_file: "patches/check_library_exists.1.22.patch" diff --git a/recipes/leveldb/all/conanfile.py b/recipes/leveldb/all/conanfile.py new file mode 100644 index 0000000000000..25822de4f07a9 --- /dev/null +++ b/recipes/leveldb/all/conanfile.py @@ -0,0 +1,95 @@ +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, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LevelDBCppConan(ConanFile): + name = "leveldb" + description = ( + "LevelDB is a fast key-value storage library written at Google that " + "provides an ordered mapping from string keys to string values." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/leveldb" + topics = ("google", "db") + license = ("BSD-3-Clause",) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_snappy": [True, False], + "with_crc32c": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_snappy": True, + "with_crc32c": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # FIXME: tcmalloc is also conditionally included in leveldb, but + # there is no "official" conan package yet; when that is available, we + # can add similar with options for those + if self.options.with_snappy: + self.requires("snappy/1.1.9") + if self.options.with_crc32c: + self.requires("crc32c/1.1.2") + + 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["LEVELDB_BUILD_TESTS"] = False + tc.variables["LEVELDB_BUILD_BENCHMARKS"] = False + tc.variables["HAVE_SNAPPY"] = self.options.with_snappy + tc.variables["HAVE_CRC32C"] = self.options.with_crc32c + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "leveldb") + self.cpp_info.set_property("cmake_target_name", "leveldb::leveldb") + self.cpp_info.libs = ["leveldb"] + if self.options.shared: + self.cpp_info.defines.append("LEVELDB_SHARED_LIBRARY") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/leveldb/all/patches/check_library_exists.1.22.patch b/recipes/leveldb/all/patches/check_library_exists.1.22.patch new file mode 100644 index 0000000000000..2c1857272519f --- /dev/null +++ b/recipes/leveldb/all/patches/check_library_exists.1.22.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,8 +35,12 @@ include(CheckIncludeFile) + check_include_file("unistd.h" HAVE_UNISTD_H) + + include(CheckLibraryExists) +-check_library_exists(crc32c crc32c_value "" HAVE_CRC32C) +-check_library_exists(snappy snappy_compress "" HAVE_SNAPPY) ++if(HAVE_CRC32C) ++ find_package(Crc32c REQUIRED CONFIG) ++endif() ++if(HAVE_SNAPPY) ++ find_package(Snappy REQUIRED CONFIG) ++endif() + check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC) + + include(CheckCXXSymbolExists) +@@ -246,10 +250,10 @@ if(HAVE_CLANG_THREAD_SAFETY) + endif(HAVE_CLANG_THREAD_SAFETY) + + if(HAVE_CRC32C) +- target_link_libraries(leveldb crc32c) ++ target_link_libraries(leveldb Crc32c::crc32c) + endif(HAVE_CRC32C) + if(HAVE_SNAPPY) +- target_link_libraries(leveldb snappy) ++ target_link_libraries(leveldb Snappy::snappy) + endif(HAVE_SNAPPY) + if(HAVE_TCMALLOC) + target_link_libraries(leveldb tcmalloc) diff --git a/recipes/leveldb/all/patches/check_library_exists.1.23.patch b/recipes/leveldb/all/patches/check_library_exists.1.23.patch new file mode 100644 index 0000000000000..f94de65f96893 --- /dev/null +++ b/recipes/leveldb/all/patches/check_library_exists.1.23.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -38,8 +38,12 @@ include(CheckIncludeFile) + check_include_file("unistd.h" HAVE_UNISTD_H) + + include(CheckLibraryExists) +-check_library_exists(crc32c crc32c_value "" HAVE_CRC32C) +-check_library_exists(snappy snappy_compress "" HAVE_SNAPPY) ++if(HAVE_CRC32C) ++ find_package(Crc32c REQUIRED CONFIG) ++endif() ++if(HAVE_SNAPPY) ++ find_package(Snappy REQUIRED CONFIG) ++endif() + check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC) + + include(CheckCXXSymbolExists) +@@ -268,10 +272,10 @@ if(HAVE_CLANG_THREAD_SAFETY) + endif(HAVE_CLANG_THREAD_SAFETY) + + if(HAVE_CRC32C) +- target_link_libraries(leveldb crc32c) ++ target_link_libraries(leveldb Crc32c::crc32c) + endif(HAVE_CRC32C) + if(HAVE_SNAPPY) +- target_link_libraries(leveldb snappy) ++ target_link_libraries(leveldb Snappy::snappy) + endif(HAVE_SNAPPY) + if(HAVE_TCMALLOC) + target_link_libraries(leveldb tcmalloc) diff --git a/recipes/leveldb/all/test_package/CMakeLists.txt b/recipes/leveldb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c55600d5161fd --- /dev/null +++ b/recipes/leveldb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(leveldb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE leveldb::leveldb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/leveldb/all/test_package/conanfile.py b/recipes/leveldb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/leveldb/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/leveldb/all/test_package/test_package.cpp b/recipes/leveldb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c140702c5b7c2 --- /dev/null +++ b/recipes/leveldb/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "leveldb/db.h" +#include + +int main() +{ + leveldb::DB *db; + leveldb::Options options; + options.create_if_missing = true; + leveldb::Status status = leveldb::DB::Open(options, "testdb", &db); + + if (status.ok()) + { + std::cout << "ok" << std::endl; + } + else + { + std::cout << "not ok" << std::endl; + } + return 0; +} diff --git a/recipes/leveldb/all/test_v1_package/CMakeLists.txt b/recipes/leveldb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/leveldb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/leveldb/all/test_v1_package/conanfile.py b/recipes/leveldb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/leveldb/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/leveldb/config.yml b/recipes/leveldb/config.yml new file mode 100644 index 0000000000000..97b6b5c89c235 --- /dev/null +++ b/recipes/leveldb/config.yml @@ -0,0 +1,5 @@ +versions: + "1.23": + folder: "all" + "1.22": + folder: "all" diff --git a/recipes/lexbor/all/conandata.yml b/recipes/lexbor/all/conandata.yml new file mode 100644 index 0000000000000..ae25e89b70b28 --- /dev/null +++ b/recipes/lexbor/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.2.0": + url: "https://github.com/lexbor/lexbor/archive/v2.2.0.zip" + sha256: "837d75e253c9dc157e20246984d7357a7288e2bd2a2b53f371ac047fec3b88e9" + "2.1.0": + url: "https://github.com/lexbor/lexbor/archive/v2.1.0.zip" + sha256: "58d684d19cec689e40d8d443b3b953697cfa677a0ca59a2cf1fc14cd37ac2404" diff --git a/recipes/lexbor/all/conanfile.py b/recipes/lexbor/all/conanfile.py new file mode 100644 index 0000000000000..edf0b7a768ab8 --- /dev/null +++ b/recipes/lexbor/all/conanfile.py @@ -0,0 +1,97 @@ +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 +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class LexborConan(ConanFile): + name = "lexbor" + description = "Lexbor is development of an open source HTML Renderer library" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lexbor/lexbor/" + topics = ("html5", "css", "parser", "renderer") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_separately": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_separately": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + # static build on Windows will be support by future release. (https://github.com/lexbor/lexbor/issues/69) + if str(self.version) == "2.1.0" and self.options.shared == False and (is_msvc(self) or self._is_mingw): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support static build on Windows(please use 2.2.0).") + + if self.options.build_separately: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support build_separately option(yet).") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["LEXBOR_BUILD_SHARED"] = self.options.shared + tc.cache_variables["LEXBOR_BUILD_STATIC"] = not self.options.shared + tc.variables["LEXBOR_TESTS_CPP"] = False + tc.variables["LEXBOR_BUILD_SEPARATELY"] = self.options.build_separately + tc.variables["LEXBOR_INSTALL_HEADERS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + target = "lexbor" if self.options.shared else "lexbor_static" + self.cpp_info.names["cmake_find_package"] = "lexbor" + self.cpp_info.names["cmake_find_package_multi"] = "lexbor" + + self.cpp_info.components["_lexbor"].set_property("cmake_target_name", f"lexbor::{target}") + + self.cpp_info.components["_lexbor"].libs = [target] + self.cpp_info.components["_lexbor"].defines = ["LEXBOR_BUILD_SHARED" if self.options.shared else "LEXBOR_BUILD_STATIC"] + + if not self.options.shared: + self.cpp_info.components["_lexbor"].defines.append("LEXBOR_STATIC") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_lexbor"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.set_property("cmake_file_name", "lexbor") + self.cpp_info.set_property("cmake_target_name", f"lexbor::{target}") + self.cpp_info.components["_lexbor"].names["cmake_find_package"] = target + self.cpp_info.components["_lexbor"].names["cmake_find_package_multi"] = target diff --git a/recipes/lexbor/all/test_package/CMakeLists.txt b/recipes/lexbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ac27dcd72792 --- /dev/null +++ b/recipes/lexbor/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lexbor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) + +if(TARGET lexbor::lexbor_static) + target_link_libraries(${PROJECT_NAME} PRIVATE lexbor::lexbor_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE lexbor::lexbor) +endif() diff --git a/recipes/lexbor/all/test_package/conanfile.py b/recipes/lexbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/lexbor/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/lexbor/all/test_package/test_package.c b/recipes/lexbor/all/test_package/test_package.c new file mode 100644 index 0000000000000..0143cae07e5b6 --- /dev/null +++ b/recipes/lexbor/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +int main() { + lxb_html_document_t* document = lxb_html_document_create(); + lxb_html_document_destroy(document); + + return 0; +} diff --git a/recipes/lexbor/all/test_v1_package/CMakeLists.txt b/recipes/lexbor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/lexbor/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/lexbor/all/test_v1_package/conanfile.py b/recipes/lexbor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/lexbor/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lexbor/config.yml b/recipes/lexbor/config.yml new file mode 100644 index 0000000000000..ca654973c9512 --- /dev/null +++ b/recipes/lexbor/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.0": + folder: "all" + "2.1.0": + folder: "all" diff --git a/recipes/libaec/all/conandata.yml b/recipes/libaec/all/conandata.yml new file mode 100644 index 0000000000000..f02aae783d14c --- /dev/null +++ b/recipes/libaec/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.0.6": + url: "https://gitlab.dkrz.de/k202009/libaec/uploads/45b10e42123edd26ab7b3ad92bcf7be2/libaec-1.0.6.tar.gz" + sha256: "032961877231113bb094ef224085e6d66fd670f85a3e17f53d0f131abf24f2fd" + "1.0.4": + url: "https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/libaec-1.0.4.tar.gz" + sha256: "f2b1b232083bd8beaf8a54a024225de3dd72a673a9bcdf8c3ba96c39483f4309" +patches: + "1.0.4": + - patch_file: "patches/1.0.4-0001-Fix-static-library-builds.patch" + patch_type: "conan" + patch_description: "Fix static library builds" + - patch_file: "patches/1.0.4-0002-fix-install-ios.patch" + patch_type: "conan" + patch_description: "Fix install iOS" + "1.0.6": + - patch_file: "patches/1.0.6-0001-fix-library-builds.patch" + patch_type: "conan" + patch_description: "Fix library builds" + - patch_file: "patches/1.0.6-0002-fix-cmake-build-with-ninja.patch" + patch_type: "conan" + patch_description: "Ninja needs 'aec' binary to be put in a separate folder to an imaginary 'aec' object output" diff --git a/recipes/libaec/all/conanfile.py b/recipes/libaec/all/conanfile.py new file mode 100644 index 0000000000000..e624f9f76f9b5 --- /dev/null +++ b/recipes/libaec/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.52.0" + + +class LibaecConan(ConanFile): + name = "libaec" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.dkrz.de/k202009/libaec" + description = "Adaptive Entropy Coding library" + topics = "dsp", "encoding", "decoding" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if Version(self.version) >= "1.0.6" and is_msvc(self): + # libaec/1.0.6 uses "restrict" keyword which seems to be supported since Visual Studio 16. + if Version(self.settings.compiler.version) < "16": + raise ConanInvalidConfiguration("{} does not support Visual Studio {}".format(self.name, self.settings.compiler.version)) + # In libaec/1.0.6, fail to build aec_client command with debug and shared settings in Visual Studio. + # Temporary, this recipe doesn't support these settings. + if self.options.shared and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration("{} does not support debug and shared build in Visual Studio(currently)".format(self.name)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(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" + tc.generate() + + def build(self): + apply_conandata_patches(self) + if Version(self.version) < "1.0.6": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(tests)", "") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + if Version(self.version) < "1.0.6": + copy(self, pattern="Copyright.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + else: + copy(self, pattern="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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + aec_name = "aec" + if self.settings.os == "Windows" and Version(self.version) >= "1.0.6" and not self.options.shared: + aec_name = "aec_static" + szip_name = "sz" + if self.settings.os == "Windows": + if Version(self.version) >= "1.0.6": + szip_name = "szip" if self.options.shared else "szip_static" + elif self.options.shared: + szip_name = "szip" + self.cpp_info.libs = [szip_name, aec_name] + 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/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch b/recipes/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch new file mode 100644 index 0000000000000..ba756f64d8e76 --- /dev/null +++ b/recipes/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch @@ -0,0 +1,135 @@ +From 6df13969e6967dbed660271011e872c9c366037a Mon Sep 17 00:00:00 2001 +From: Brennan Ashton +Date: Tue, 28 Jan 2020 03:59:02 -0800 +Subject: [PATCH] Fix static library builds + +Signed-off-by: Brennan Ashton +--- + CMakeLists.txt | 3 --- + src/CMakeLists.txt | 10 +++++++++- + src/libaec.h | 28 ++++++++++------------------ + src/szlib.h | 6 +++--- + 4 files changed, 22 insertions(+), 25 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d71d26c..4f38618 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,9 +43,6 @@ option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) + if(BUILD_SHARED_LIBS) + set (LIB_TYPE SHARED) + else(BUILD_SHARED_LIBS) +- if(WIN32) +- message(WARNING "You will have to modify libaec.h for static libs.") +- endif(WIN32) + set(LIB_TYPE STATIC) + endif(BUILD_SHARED_LIBS) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ed6053e..93a78f2 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,5 +1,13 @@ ++include (GenerateExportHeader) + add_library(aec ${LIB_TYPE} ${libaec_SRCS}) + set_target_properties(aec PROPERTIES VERSION 0.0.10 SOVERSION 0) ++generate_export_header(aec ++ BASE_NAME libaec ++ EXPORT_MACRO_NAME libaec_EXPORT ++ EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/libaec_Export.h ++ STATIC_DEFINE libaec_BUILT_AS_STATIC ++) ++ + add_library(sz ${LIB_TYPE} sz_compat.c) + set_target_properties(sz PROPERTIES VERSION 2.0.1 SOVERSION 2) + +@@ -41,7 +49,7 @@ else(WIN32) + DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 COMPONENT doc) + endif(WIN32) + +-install(FILES libaec.h szlib.h ++install(FILES libaec.h szlib.h ${PROJECT_BINARY_DIR}/libaec_Export.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT headers) + install(TARGETS aec_client +diff --git a/src/libaec.h b/src/libaec.h +index bb43be9..44505e4 100644 +--- a/src/libaec.h ++++ b/src/libaec.h +@@ -52,20 +52,12 @@ + + #include + ++#include "libaec_Export.h" ++ + #ifdef __cplusplus + extern "C"{ + #endif + +-#if BUILDING_LIBAEC && HAVE_VISIBILITY +-# define LIBAEC_DLL_EXPORTED __attribute__((__visibility__("default"))) +-#elif BUILDING_LIBAEC && defined _MSC_VER +-# define LIBAEC_DLL_EXPORTED __declspec(dllexport) +-#elif defined _MSC_VER +-# define LIBAEC_DLL_EXPORTED __declspec(dllimport) +-#else +-# define LIBAEC_DLL_EXPORTED +-#endif +- + struct internal_state; + + struct aec_stream { +@@ -155,19 +147,19 @@ struct aec_stream { + /*********************************************/ + /* Streaming encoding and decoding functions */ + /*********************************************/ +-LIBAEC_DLL_EXPORTED int aec_encode_init(struct aec_stream *strm); +-LIBAEC_DLL_EXPORTED int aec_encode(struct aec_stream *strm, int flush); +-LIBAEC_DLL_EXPORTED int aec_encode_end(struct aec_stream *strm); ++libaec_EXPORT int aec_encode_init(struct aec_stream *strm); ++libaec_EXPORT int aec_encode(struct aec_stream *strm, int flush); ++libaec_EXPORT int aec_encode_end(struct aec_stream *strm); + +-LIBAEC_DLL_EXPORTED int aec_decode_init(struct aec_stream *strm); +-LIBAEC_DLL_EXPORTED int aec_decode(struct aec_stream *strm, int flush); +-LIBAEC_DLL_EXPORTED int aec_decode_end(struct aec_stream *strm); ++libaec_EXPORT int aec_decode_init(struct aec_stream *strm); ++libaec_EXPORT int aec_decode(struct aec_stream *strm, int flush); ++libaec_EXPORT int aec_decode_end(struct aec_stream *strm); + + /***************************************************************/ + /* Utility functions for encoding or decoding a memory buffer. */ + /***************************************************************/ +-LIBAEC_DLL_EXPORTED int aec_buffer_encode(struct aec_stream *strm); +-LIBAEC_DLL_EXPORTED int aec_buffer_decode(struct aec_stream *strm); ++libaec_EXPORT int aec_buffer_encode(struct aec_stream *strm); ++libaec_EXPORT int aec_buffer_decode(struct aec_stream *strm); + + #ifdef __cplusplus + } +diff --git a/src/szlib.h b/src/szlib.h +index 1eaa577..18b6a3c 100644 +--- a/src/szlib.h ++++ b/src/szlib.h +@@ -80,15 +80,15 @@ typedef struct SZ_com_t_s + int pixels_per_scanline; + } SZ_com_t; + +-LIBAEC_DLL_EXPORTED int SZ_BufftoBuffCompress( ++libaec_EXPORT int SZ_BufftoBuffCompress( + void *dest, size_t *destLen, + const void *source, size_t sourceLen, + SZ_com_t *param); +-LIBAEC_DLL_EXPORTED int SZ_BufftoBuffDecompress( ++libaec_EXPORT int SZ_BufftoBuffDecompress( + void *dest, size_t *destLen, + const void *source, size_t sourceLen, + SZ_com_t *param); + +-LIBAEC_DLL_EXPORTED int SZ_encoder_enabled(void); ++libaec_EXPORT int SZ_encoder_enabled(void); + + #endif /* SZLIB_H */ +-- +2.24.1 + diff --git a/recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch b/recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch new file mode 100644 index 0000000000000..7d7d56d1f60b6 --- /dev/null +++ b/recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch @@ -0,0 +1,10 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -53,7 +53,6 @@ install(FILES libaec.h szlib.h ${PROJECT_BINARY_DIR}/libaec_Export.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT headers) + install(TARGETS aec_client +- RUNTIME + DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT applications) + diff --git a/recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch b/recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch new file mode 100644 index 0000000000000..500c20a889d8c --- /dev/null +++ b/recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch @@ -0,0 +1,113 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6f75ead..c974cce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,7 @@ project(libaec LANGUAGES C VERSION 1.0.6) + # Automatically export symbols for Windows DLLs + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +-set(CMAKE_C_STANDARD 99) ++set(CMAKE_C_STANDARD 11) + set(CMAKE_C_VISIBILITY_PRESET hidden) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + include(CTest) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a26f9b7..3cd8f72 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -10,12 +10,17 @@ target_include_directories(aec + "$" + "$") + +-# Create both static and shared aec library. ++if (NOT BUILD_SHARED_LIBS) ++ ++# Create aec library. + add_library(aec_static STATIC "$") + target_link_libraries(aec_static PUBLIC aec) + set_target_properties(aec_static + PROPERTIES +- OUTPUT_NAME $,aec_static,aec>) ++ OUTPUT_NAME $,aec_static,aec> ++ PUBLIC_HEADER ../include/libaec.h) ++ ++else() + + add_library(aec_shared SHARED "$") + target_link_libraries(aec_shared PUBLIC aec) +@@ -26,17 +31,24 @@ set_target_properties(aec_shared + OUTPUT_NAME aec + PUBLIC_HEADER ../include/libaec.h) + ++endif() ++ + # Wrapper for compatibility with szip + add_library(sz OBJECT sz_compat.c) + target_link_libraries(sz PUBLIC aec) + +-# Create both static and shared szip library. ++# Create szip library. ++if (NOT BUILD_SHARED_LIBS) ++ + add_library(sz_static STATIC "$" "$") + set_target_properties(sz_static + PROPERTIES +- OUTPUT_NAME $,szip_static,sz>) ++ OUTPUT_NAME $,szip_static,sz> ++ PUBLIC_HEADER ../include/szlib.h) + target_link_libraries(sz_static PUBLIC sz) + ++else() ++ + add_library(sz_shared SHARED "$" "$") + target_link_libraries(sz_shared PUBLIC sz) + set_target_properties(sz_shared +@@ -46,11 +58,16 @@ set_target_properties(sz_shared + OUTPUT_NAME $,szip,sz> + PUBLIC_HEADER ../include/szlib.h) + ++endif() ++ + # Simple client for testing and benchmarking. + # Can also be used stand-alone + add_executable(aec_client aec.c) + set_target_properties(aec_client PROPERTIES OUTPUT_NAME aec) + target_link_libraries(aec_client PUBLIC aec) ++if (MSVC) ++ target_compile_options(aec_client PUBLIC /FS /Z7) ++endif() + + include(GNUInstallDirs) + if(UNIX) +@@ -61,23 +78,14 @@ if(UNIX) + PROPERTIES + COMPILE_DEFINITIONS + "HAVE_VISIBILITY=$;BUILDING_LIBAEC") +- +- # The shell scripts for benchmarking are supported on unix only +- add_executable(utime EXCLUDE_FROM_ALL utime.c) +- target_include_directories(utime PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/..") +- add_custom_target(bench +- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/benc.sh +- ${CMAKE_CURRENT_SOURCE_DIR}/../data/typical.rz +- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bdec.sh +- DEPENDS aec_client utime) + endif() + +-if(UNIX OR MINGW) +- # Install manpage +- install( +- FILES aec.1 +- DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 +- COMPONENT doc) +-endif() ++if (NOT BUILD_SHARED_LIBS) + +-install(TARGETS aec_static aec_shared sz_static sz_shared aec_client) ++install(TARGETS aec_static sz_static aec_client) ++ ++else() ++ ++install(TARGETS aec_shared sz_shared aec_client) ++ ++endif() diff --git a/recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch b/recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch new file mode 100644 index 0000000000000..b3782f6654ad3 --- /dev/null +++ b/recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2021-09-17 19:28:01.000000000 +0800 ++++ b/CMakeLists.txt 2022-11-04 07:43:58.413439439 +0800 +@@ -12,6 +12,8 @@ + include(TestBigEndian) + test_big_endian(WORDS_BIGENDIAN) + ++set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) ++ + # Check for __builtin_clzll for faster decoding + include(CheckCSourceCompiles) + check_c_source_compiles( diff --git a/recipes/libaec/all/test_package/CMakeLists.txt b/recipes/libaec/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f87e0b5ca8eb9 --- /dev/null +++ b/recipes/libaec/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1.3) +project(test_package C) + +find_package(libaec CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libaec::libaec) diff --git a/recipes/libaec/all/test_package/conanfile.py b/recipes/libaec/all/test_package/conanfile.py new file mode 100644 index 0000000000000..75526b1d02b79 --- /dev/null +++ b/recipes/libaec/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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +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 generate(self): + tc = CMakeToolchain(self) + if Version(self.dependencies["libaec"].ref.version) >= "1.0.6": + tc.variables["CMAKE_C_STANDARD"] = "11" + 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/libaec/all/test_package/test_package.c b/recipes/libaec/all/test_package/test_package.c new file mode 100644 index 0000000000000..af55874275190 --- /dev/null +++ b/recipes/libaec/all/test_package/test_package.c @@ -0,0 +1,55 @@ +#include +#include + +/* Modified from the encoding example in the readme */ + +int main(void) { + struct aec_stream strm; + size_t source_length = 1024; + size_t dest_length = 4096; + int32_t source[1024]; + unsigned char dest[4096]; + size_t idx; + + for(idx=0;idx= "1.0.6": + cmake.definitions["CMAKE_C_STANDARD"] = "11" + 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/libaec/config.yml b/recipes/libaec/config.yml new file mode 100644 index 0000000000000..a41a7cbb0ffc2 --- /dev/null +++ b/recipes/libaec/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.6": + folder: all + "1.0.4": + folder: all diff --git a/recipes/libaio/all/conandata.yml b/recipes/libaio/all/conandata.yml new file mode 100644 index 0000000000000..e5229e2bd9bde --- /dev/null +++ b/recipes/libaio/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.113": + url: "https://pagure.io/libaio/archive/libaio-0.3.113/libaio-libaio-0.3.113.tar.gz" + sha256: "716c7059703247344eb066b54ecbc3ca2134f0103307192e6c2b7dab5f9528ab" diff --git a/recipes/libaio/all/conanfile.py b/recipes/libaio/all/conanfile.py new file mode 100644 index 0000000000000..1c6d39e998e82 --- /dev/null +++ b/recipes/libaio/all/conanfile.py @@ -0,0 +1,77 @@ +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 copy, get, chdir, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + +class LibaioConan(ConanFile): + name = "libaio" + description = "libaio provides the Linux-native API for async I/O." + license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pagure.io/libaio" + topics = ("asynchronous", "aio", "async") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.info.settings.os}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make(target="all") + + def package(self): + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make(target="install", args=["prefix=" + self.package_folder]) + + if self.options.shared: + rm(self, "libaio.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "libaio.so*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["aio"] diff --git a/recipes/libaio/all/test_package/CMakeLists.txt b/recipes/libaio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4515d52910142 --- /dev/null +++ b/recipes/libaio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libaio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libaio::libaio) diff --git a/recipes/libaio/all/test_package/conanfile.py b/recipes/libaio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libaio/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libaio/all/test_package/test_package.c b/recipes/libaio/all/test_package/test_package.c new file mode 100644 index 0000000000000..e8a44ee3d19dd --- /dev/null +++ b/recipes/libaio/all/test_package/test_package.c @@ -0,0 +1,93 @@ +#include +#include +#include +#include +#include +#include +#include + +#define FATAL(...)\ + do {\ + fprintf(stderr, __VA_ARGS__);\ + fprintf(stderr, "\n");\ + assert(0);\ + exit(-1);\ + } while (0) + +static const void handle_error(int err) { +#define DECL_ERR(X) case -X: FATAL("Error "#X"\n"); break; + switch (err) { + DECL_ERR(EFAULT); + DECL_ERR(EINVAL); + DECL_ERR(ENOSYS); + DECL_ERR(EAGAIN); + }; + if (err < 0) FATAL("Unknown error"); +#undef DECL_ERR +} + +#define IO_RUN(F, ...)\ + do {\ + int err = F(__VA_ARGS__);\ + handle_error(err);\ + } while (0) + +#define MB(X) (X * 1024 * 1024) +#define SZ MB(50) + +static const int maxEvents = 10; +char *dst = NULL; // data we are reading +char *src = NULL; // data we are writing +int fd = -1; // file to open + +void check(io_context_t ctx, struct iocb *iocb, long res, long res2) { + size_t i; + if (res2 || res != SZ) FATAL("Error in async IO"); + for (i = 0; i < SZ; ++i) + if (dst[i] != src[i]) FATAL("Error in async copy"); + printf("DONE\n"); + fflush(stdout); +} + +int main (int argc, char *argv[]) { + size_t i; + /* Create a file and fill it with random crap */ + FILE *file = fopen("crap.dat", "wb"); + if (file == NULL) FATAL("Unable to create crap.dat"); + src = (char*)malloc(sizeof(char) * SZ); + for (i = 0; i < SZ; ++i) src[i] = rand(); + size_t nr = fwrite(src, SZ, 1, file); + if (nr != 1) FATAL("Unable to fill crap.dat"); + fclose(file); + + /* Prepare the file to read */ + int fd = open("crap.dat", O_NONBLOCK, 0); + if (fd < 0) FATAL("Error opening file"); + dst = (char*)malloc(sizeof(char) * SZ); + + /* Now use *real* asynchronous IO to read back the file */ + io_context_t ctx; + memset(&ctx, 0, sizeof(ctx)); + IO_RUN (io_queue_init, maxEvents, &ctx); + + /* This is the read job we asynchronously run */ + struct iocb *job = (struct iocb*)malloc(sizeof(struct iocb) * 1); + io_prep_pread(job, fd, dst, SZ, 0); + io_set_callback(job, check); + + /* Issue it now */ + IO_RUN (io_submit, ctx, 1, &job); + + /* Wait for it */ + struct io_event evt; + IO_RUN (io_getevents, ctx, 1, 1, &evt, NULL); + check(ctx, evt.obj, evt.res, evt.res2); + + close(fd); + + free(src); + free(dst); + free(job); + io_destroy(ctx); + return 0; +} diff --git a/recipes/libaio/all/test_v1_package/CMakeLists.txt b/recipes/libaio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libaio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libaio/all/test_v1_package/conanfile.py b/recipes/libaio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libaio/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libaio/config.yml b/recipes/libaio/config.yml new file mode 100644 index 0000000000000..88b2313b77c9b --- /dev/null +++ b/recipes/libaio/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.113": + folder: all diff --git a/recipes/libalsa/all/conandata.yml b/recipes/libalsa/all/conandata.yml new file mode 100644 index 0000000000000..55a14a6d4051e --- /dev/null +++ b/recipes/libalsa/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.2.7.2": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.7.2.tar.gz" + sha256: "2ed6d908120beb4a91c2271b01489181b28dc9f35f32229ef83bcd5ac8817654" + "1.2.7": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.7.tar.gz" + sha256: "d76ac42f678b198d754c072fb6d0ce89f880a9bb9fd6a45f97d7be762ac0a384" + "1.2.5.1": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.5.1.tar.gz" + sha256: "bc1d9ed505e183fc59413425d34e8106322a0e399befcde8466bd96e6764e6c8" + "1.2.4": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.4.tar.gz" + sha256: "0c6ab052d7ea980a01d0208da5e5e10849bd16c4c9961bbd5d2665083b74a6c0" + "1.2.2": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.2.tar.gz" + sha256: "ad4fa29e3927c5bec0f71b24b6a88523f4e386905341fc9047abef5744805023" + "1.1.9": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.1.9.tar.gz" + sha256: "be3443c69dd2cb86e751c0abaa4b74343c75db28ef13d11d19a3130a5b0ff78d" +patches: + "1.2.5.1": + - patch_file: "patches/1.2.5.1-0001-control-empty-fix-the-static-build.patch" diff --git a/recipes/libalsa/all/conanfile.py b/recipes/libalsa/all/conanfile.py new file mode 100644 index 0000000000000..8c3046d892f5a --- /dev/null +++ b/recipes/libalsa/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibalsaConan(ConanFile): + name = "libalsa" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/alsa-project/alsa-lib" + topics = ("alsa", "sound", "audio", "midi") + description = "Library of ALSA: The Advanced Linux Sound Architecture, that provides audio " \ + "and MIDI functionality to the Linux operating system" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_python": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "disable_python": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + + 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() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-python={yes_no(not self.options.disable_python)}", + "--datarootdir=${prefix}/res", + "--datadir=${prefix}/res", + ]) + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + if Version(self.version) > "1.2.4": + autotools.autoreconf() + autotools.configure() + autotools.make() + else: + with chdir(self, self.source_folder): + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", 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")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ALSA") + self.cpp_info.set_property("cmake_target_name", "ALSA::ALSA") + self.cpp_info.set_property("pkg_config_name", "alsa") + self.cpp_info.libs = ["asound"] + self.cpp_info.resdirs = ["res"] + self.cpp_info.system_libs = ["dl", "m", "rt", "pthread"] + alsa_config_dir = os.path.join(self.package_folder, "res", "alsa") + self.runenv_info.define_path("ALSA_CONFIG_DIR", alsa_config_dir) + + # TODO: to remove in conan v2? + self.cpp_info.names["cmake_find_package"] = "ALSA" + self.cpp_info.names["cmake_find_package_multi"] = "ALSA" + self.cpp_info.names["pkg_config"] = "alsa" + self.env_info.ALSA_CONFIG_DIR = alsa_config_dir diff --git a/recipes/libalsa/all/patches/1.2.5.1-0001-control-empty-fix-the-static-build.patch b/recipes/libalsa/all/patches/1.2.5.1-0001-control-empty-fix-the-static-build.patch new file mode 100644 index 0000000000000..c39bc736320b5 --- /dev/null +++ b/recipes/libalsa/all/patches/1.2.5.1-0001-control-empty-fix-the-static-build.patch @@ -0,0 +1,25 @@ +From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 15 Jun 2021 23:21:42 +0200 +Subject: [PATCH] control: empty - fix the static build + +Reported-by: Jan Palus +Fixes: https://github.com/alsa-project/alsa-lib/issues/157 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_empty.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/control/control_empty.c b/src/control/control_empty.c +index 49d1026c..c9b048c1 100644 +--- a/src/control/control_empty.c ++++ b/src/control/control_empty.c +@@ -30,7 +30,7 @@ + + #ifndef PIC + /* entry for static linking */ +-const char *_snd_module_ctl_empty = ""; ++const char *_snd_module_control_empty = ""; + #endif + + /*! \page control_plugins diff --git a/recipes/libalsa/all/test_package/CMakeLists.txt b/recipes/libalsa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ab0ad880535ac --- /dev/null +++ b/recipes/libalsa/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ALSA REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ALSA::ALSA) diff --git a/recipes/libalsa/all/test_package/conanfile.py b/recipes/libalsa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libalsa/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/libalsa/all/test_package/test_package.c b/recipes/libalsa/all/test_package/test_package.c new file mode 100644 index 0000000000000..5fe270f6f4fcc --- /dev/null +++ b/recipes/libalsa/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("libalsa version %s\n", snd_asoundlib_version()); + return 0; +} diff --git a/recipes/libalsa/all/test_v1_package/CMakeLists.txt b/recipes/libalsa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libalsa/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libalsa/all/test_v1_package/conanfile.py b/recipes/libalsa/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libalsa/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libalsa/config.yml b/recipes/libalsa/config.yml new file mode 100644 index 0000000000000..b1fdda2825fa6 --- /dev/null +++ b/recipes/libalsa/config.yml @@ -0,0 +1,13 @@ +versions: + "1.2.7.2": + folder: all + "1.2.7": + folder: all + "1.2.5.1": + folder: all + "1.2.4": + folder: all + "1.2.2": + folder: all + "1.1.9": + folder: all diff --git a/recipes/libaom-av1/all/conandata.yml b/recipes/libaom-av1/all/conandata.yml new file mode 100644 index 0000000000000..17b677e8b1c9a --- /dev/null +++ b/recipes/libaom-av1/all/conandata.yml @@ -0,0 +1,51 @@ +sources: + "3.6.0": + url: "https://storage.googleapis.com/aom-releases/libaom-3.6.0.tar.gz" + sha256: "a4a6c0fab685da743b796662a928fcdf7ae60594edc306efb73e78a17ea6cde6" + "3.5.0": + url: "https://storage.googleapis.com/aom-releases/libaom-3.5.0.tar.gz" + sha256: "d37dbee372e2430a7efde813984ae6d78bdf1fc4080ebe32457c9115408b0738" + "3.4.0": + url: "https://storage.googleapis.com/aom-releases/libaom-3.4.0.tar.gz" + sha256: "bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354" + "3.3.0": + url: "https://storage.googleapis.com/aom-releases/libaom-3.3.0.tar.gz" + sha256: "1dafde32bc2237bf0570294661ae61db30e818840f77dc4e90d1ebf5a6286664" + "3.1.2": + url: "https://storage.googleapis.com/aom-releases/libaom-3.1.2.tar.gz" + sha256: "a295eb3779657fad7d34217091ee4c6257d02580a82012231afef72792330075" + "3.1.1": + url: "https://storage.googleapis.com/aom-releases/libaom-3.1.1.tar.gz" + sha256: "7cd5e8e469268c37241df93fe61557ea0dc46980ca21b37e786e92a3d0729276" + "2.0.1": + url: "https://storage.googleapis.com/aom-releases/libaom-2.0.1.tar.gz" + sha256: "a0cff299621e2ef885aba219c498fa39a7d9a7ddf47585a118fd66c64ad1b312" +patches: + "3.6.0": + - patch_file: "patches/0001-3.4.0-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. + "3.5.0": + - patch_file: "patches/0001-3.4.0-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. + "3.4.0": + - patch_file: "patches/0001-3.4.0-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. + "3.3.0": + - patch_file: "patches/0001-3.3.0-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. + "3.1.2": + - patch_file: "patches/0001-3.1.1-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. + "3.1.1": + - patch_file: "patches/0001-3.1.1-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. + "2.0.1": + - patch_file: "patches/0001-2.0.1-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. diff --git a/recipes/libaom-av1/all/conanfile.py b/recipes/libaom-av1/all/conanfile.py new file mode 100644 index 0000000000000..714ea1c7238dd --- /dev/null +++ b/recipes/libaom-av1/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, 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.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibaomAv1Conan(ConanFile): + name = "libaom-av1" + description = "AV1 Codec Library" + topics = ("av1", "codec", "video", "encoding", "decoding") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://aomedia.googlesource.com/aom" + license = "BSD-2-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "assembly": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "assembly": False, + } + + @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 + if self.settings.arch not in ("x86", "x86_64"): + del self.options.assembly + + 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.options.get_safe("assembly", False): + self.tool_requires("nasm/2.15.05") + if self._settings_build.os == "Windows": + self.tool_requires("strawberryperl/5.30.0.1") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=Version(self.version) >= "3.3.0") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + tc.variables["ENABLE_EXAMPLES"] = False + tc.variables["ENABLE_TESTS"] = False + tc.variables["ENABLE_DOCS"] = False + tc.variables["ENABLE_TOOLS"] = False + if not self.options.get_safe("assembly", False): + # make non-assembly build + tc.variables["AOM_TARGET_CPU"] = "generic" + # libyuv is used for examples, tests and non-essential 'dump_obu' tool so it is disabled + # required to be 1/0 instead of False + tc.variables["CONFIG_LIBYUV"] = 0 + # webm is not yet packaged + tc.variables["CONFIG_WEBM_IO"] = 0 + # Requires C99 or higher + tc.variables["CMAKE_C_STANDARD"] = "99" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "aom") + self.cpp_info.libs = ["aom"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libaom-av1/all/patches/0001-2.0.1-fix-install.patch b/recipes/libaom-av1/all/patches/0001-2.0.1-fix-install.patch new file mode 100644 index 0000000000000..128bfeb7c4ea2 --- /dev/null +++ b/recipes/libaom-av1/all/patches/0001-2.0.1-fix-install.patch @@ -0,0 +1,34 @@ +--- a/build/cmake/aom_install.cmake ++++ b/build/cmake/aom_install.cmake +@@ -27,7 +27,7 @@ endif() + # Note: aom.pc generation uses GNUInstallDirs: + # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + macro(setup_aom_install_targets) +- if(NOT (MSVC OR XCODE)) ++ if(1) + include("GNUInstallDirs") + set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") + +@@ -73,7 +73,8 @@ macro(setup_aom_install_targets) + endif() + + if(BUILD_SHARED_LIBS) +- set(AOM_INSTALL_LIBS aom aom_static) ++ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) ++ set(AOM_INSTALL_LIBS aom) + else() + set(AOM_INSTALL_LIBS aom) + endif() +@@ -85,8 +86,10 @@ macro(setup_aom_install_targets) + install( + FILES "${AOM_PKG_CONFIG_FILE}" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig") +- install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++ install(TARGETS ${AOM_INSTALL_LIBS} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if(ENABLE_EXAMPLES) + install(TARGETS ${AOM_INSTALL_BINS} DESTINATION diff --git a/recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch b/recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch new file mode 100644 index 0000000000000..af10132d05fe7 --- /dev/null +++ b/recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch @@ -0,0 +1,34 @@ +--- a/build/cmake/aom_install.cmake ++++ b/build/cmake/aom_install.cmake +@@ -26,7 +26,7 @@ endif() + # Note: aom.pc generation uses GNUInstallDirs: + # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + macro(setup_aom_install_targets) +- if(NOT (MSVC OR XCODE)) ++ if(1) + include("GNUInstallDirs") + set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") + +@@ -76,7 +76,8 @@ macro(setup_aom_install_targets) + endif() + + if(BUILD_SHARED_LIBS) +- set(AOM_INSTALL_LIBS aom aom_static) ++ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) ++ set(AOM_INSTALL_LIBS aom) + else() + set(AOM_INSTALL_LIBS aom) + endif() +@@ -88,8 +89,10 @@ macro(setup_aom_install_targets) + install( + FILES "${AOM_PKG_CONFIG_FILE}" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig") +- install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++ install(TARGETS ${AOM_INSTALL_LIBS} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if(ENABLE_EXAMPLES) + install(TARGETS ${AOM_INSTALL_BINS} DESTINATION diff --git a/recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch b/recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch new file mode 100644 index 0000000000000..0dc76d16fc7f5 --- /dev/null +++ b/recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch @@ -0,0 +1,21 @@ +--- a/build/cmake/aom_install.cmake ++++ b/build/cmake/aom_install.cmake +@@ -27,7 +27,7 @@ endif() + # Note: aom.pc generation uses GNUInstallDirs: + # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + macro(setup_aom_install_targets) +- if(NOT XCODE) ++ if(1) + include("GNUInstallDirs") + set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") + +@@ -77,7 +77,8 @@ macro(setup_aom_install_targets) + endif() + + if(BUILD_SHARED_LIBS) +- set(AOM_INSTALL_LIBS aom aom_static) ++ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) ++ set(AOM_INSTALL_LIBS aom) + else() + set(AOM_INSTALL_LIBS aom) + endif() diff --git a/recipes/libaom-av1/all/patches/0001-3.4.0-fix-install.patch b/recipes/libaom-av1/all/patches/0001-3.4.0-fix-install.patch new file mode 100644 index 0000000000000..cdf8395c587c8 --- /dev/null +++ b/recipes/libaom-av1/all/patches/0001-3.4.0-fix-install.patch @@ -0,0 +1,21 @@ +--- a/build/cmake/aom_install.cmake ++++ b/build/cmake/aom_install.cmake +@@ -27,7 +27,7 @@ endif() + # Note: aom.pc generation uses GNUInstallDirs: + # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + macro(setup_aom_install_targets) +- if(NOT XCODE) ++ if(1) + include("GNUInstallDirs") + set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") + +@@ -78,7 +78,8 @@ macro(setup_aom_install_targets) + endif() + + if(BUILD_SHARED_LIBS) +- set(AOM_INSTALL_LIBS aom aom_static) ++ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) ++ set(AOM_INSTALL_LIBS aom) + else() + set(AOM_INSTALL_LIBS aom) + endif() diff --git a/recipes/libaom-av1/all/test_package/CMakeLists.txt b/recipes/libaom-av1/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5305ced8fb6c --- /dev/null +++ b/recipes/libaom-av1/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libaom-av1 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libaom-av1::libaom-av1) diff --git a/recipes/libaom-av1/all/test_package/conanfile.py b/recipes/libaom-av1/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libaom-av1/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/libaom-av1/all/test_package/test_package.c b/recipes/libaom-av1/all/test_package/test_package.c new file mode 100644 index 0000000000000..eca39e0b4e6f9 --- /dev/null +++ b/recipes/libaom-av1/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include "aom/aom_codec.h" +#include + +int main() { + printf("Version: %s\n", aom_codec_version_str()); + return 0; +} diff --git a/recipes/libaom-av1/all/test_v1_package/CMakeLists.txt b/recipes/libaom-av1/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libaom-av1/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libaom-av1/all/test_v1_package/conanfile.py b/recipes/libaom-av1/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libaom-av1/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/libaom-av1/config.yml b/recipes/libaom-av1/config.yml new file mode 100644 index 0000000000000..55199e7891956 --- /dev/null +++ b/recipes/libaom-av1/config.yml @@ -0,0 +1,15 @@ +versions: + "3.6.0": + folder: all + "3.5.0": + folder: all + "3.4.0": + folder: all + "3.3.0": + folder: all + "3.1.2": + folder: all + "3.1.1": + folder: all + "2.0.1": + folder: all diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml new file mode 100644 index 0000000000000..9a164839a427b --- /dev/null +++ b/recipes/libarchive/all/conandata.yml @@ -0,0 +1,84 @@ +sources: + "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.6.2": + - patch_file: "patches/0001-3.6.2-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.6.2-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" + - patch_file: "patches/0005-3.6.2-try-compile-cmakedeps.patch" + patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" + patch_type: "conan" + "3.6.1": + - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.6.0-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" + - patch_file: "patches/0004-3.6.0-android.patch" + patch_description: "Add missing include directory for Android" + patch_type: "portability" + "3.6.0": + - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.6.0-cmake.patch" + patch_description: "Make CMake cooperate with Conan" + patch_type: "conan" + - patch_file: "patches/0004-3.6.0-android.patch" + patch_description: "Add missing include directory for Android" + patch_type: "portability" + "3.5.2": + - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.5.2-cmake.patch" + patch_description: "Make CMake cooperate with Conan" + patch_type: "conan" + "3.5.1": + - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.4.3-cmake.patch" + patch_description: "Make CMake cooperate with Conan" + patch_type: "conan" + "3.4.3": + - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.4.3-cmake.patch" + patch_description: "Make CMake cooperate with Conan" + patch_type: "conan" + "3.4.0": + - patch_file: "patches/0001-3.4.0-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0002-3.4.0-msvc-no-we4061.patch" + patch_description: "Remove MSVC compiler warning e4061" + patch_type: "portability" + - patch_file: "patches/0003-3.4.0-cmake.patch" + patch_description: "Make CMake cooperate with Conan" + patch_type: "conan" diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py new file mode 100644 index 0000000000000..7b3f2cc70c9d0 --- /dev/null +++ b/recipes/libarchive/all/conanfile.py @@ -0,0 +1,185 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class LibarchiveConan(ConanFile): + name = "libarchive" + description = "Multi-format archive and compression library" + topics = "archive", "compression", "tar", "data-compressor", "file-compression" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libarchive.org" + license = "BSD-2-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_acl": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "with_libxml2": [True, False], + "with_expat": [True, False], + "with_iconv": [True, False], + "with_pcreposix": [True, False], + "with_cng": [True, False], + "with_nettle": [True, False], + "with_openssl": [True, False], + "with_libb2": [True, False], + "with_lz4": [True, False], + "with_lzo": [True, False], + "with_lzma": [True, False], + "with_zstd": [True, False], + "with_mbedtls": [True, False], + "with_xattr": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_acl": True, + "with_zlib": True, + "with_bzip2": False, + "with_libxml2": False, + "with_expat": False, + "with_iconv": True, + "with_pcreposix": False, + "with_cng": False, + "with_nettle": False, + "with_openssl": False, + "with_libb2": False, + "with_lz4": False, + "with_lzo": False, + "with_lzma": False, + "with_zstd": False, + "with_mbedtls": False, + "with_xattr": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "3.4.2": + del self.options.with_mbedtls + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.with_libxml2: + self.requires("libxml2/2.10.4") + if self.options.with_expat: + self.requires("expat/2.5.0") + if self.options.with_iconv: + self.requires("libiconv/1.17") + if self.options.with_pcreposix: + self.requires("pcre/8.45") + if self.options.with_nettle: + self.requires("nettle/3.8.1") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_libb2: + self.requires("libb2/20190723") + if self.options.with_lz4: + self.requires("lz4/1.9.4") + if self.options.with_lzo: + self.requires("lzo/2.10") + if self.options.with_lzma: + self.requires("xz_utils/5.4.2") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.get_safe("with_mbedtls"): + self.requires("mbedtls/3.2.1") + + def validate(self): + if self.settings.os != "Windows" and self.options.with_cng: + # TODO: add cng when available in CCI + raise ConanInvalidConfiguration("cng recipe not yet available in CCI.") + if self.options.with_expat and self.options.with_libxml2: + raise ConanInvalidConfiguration("libxml2 and expat options are exclusive. They cannot be used together as XML engine") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + tc = CMakeToolchain(self) + # turn off deps to avoid picking up them accidentally + tc.variables["ENABLE_NETTLE"] = self.options.with_nettle + tc.variables["ENABLE_OPENSSL"] = self.options.with_openssl + tc.variables["ENABLE_LIBB2"] = self.options.with_libb2 + tc.variables["ENABLE_LZ4"] = self.options.with_lz4 + tc.variables["ENABLE_LZO"] = self.options.with_lzo + tc.variables["ENABLE_LZMA"] = self.options.with_lzma + tc.variables["ENABLE_ZSTD"] = self.options.with_zstd + tc.variables["ENABLE_ZLIB"] = self.options.with_zlib + tc.variables["ENABLE_BZip2"] = self.options.with_bzip2 + # requires LibXml2 cmake name + tc.variables["ENABLE_LIBXML2"] = self.options.with_libxml2 + tc.variables["ENABLE_ICONV"] = self.options.with_iconv + tc.variables["ENABLE_EXPAT"] = self.options.with_expat + tc.variables["ENABLE_PCREPOSIX"] = self.options.with_pcreposix + if self.options.with_pcreposix: + tc.variables["POSIX_REGEX_LIB"] = "LIBPCREPOSIX" + tc.variables["ENABLE_LibGCC"] = False + tc.variables["ENABLE_CNG"] = self.options.with_cng + # turn off features + tc.variables["ENABLE_ACL"] = self.options.with_acl + # turn off components + tc.variables["ENABLE_TAR"] = False + tc.variables["ENABLE_CPIO"] = False + tc.variables["ENABLE_CAT"] = False + tc.variables["ENABLE_TEST"] = 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_XATTR"] = self.options.with_xattr + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", 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, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "LibArchive") + self.cpp_info.set_property("cmake_target_name", "LibArchive::LibArchive") + self.cpp_info.set_property("pkg_config_name", "libarchive") + + self.cpp_info.names["cmake_find_package"] = "LibArchive" + self.cpp_info.names["cmake_find_package_multi"] = "LibArchive" + + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows" and self.options.with_cng: + self.cpp_info.system_libs.append("bcrypt") + if is_msvc(self) and not self.options.shared: + self.cpp_info.defines = ["LIBARCHIVE_STATIC"] 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 new file mode 100644 index 0000000000000..5acce6e86c2cd --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000000000..b0d70de9dec3b --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000000000..dceed2848f701 --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000000000..62dd3ef819875 --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 713e3bc..2315da5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -430,14 +430,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/0002-3.4.0-msvc-no-we4061.patch b/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch new file mode 100644 index 0000000000000..ff6f218ef3e36 --- /dev/null +++ b/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000000..7b724f1fba164 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch @@ -0,0 +1,101 @@ +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) +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 new file mode 100644 index 0000000000000..5c46b58290b77 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch @@ -0,0 +1,101 @@ +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) +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 new file mode 100644 index 0000000000000..5584b5f1606bc --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch @@ -0,0 +1,101 @@ +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) +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 new file mode 100644 index 0000000000000..436c8194e3e4d --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch @@ -0,0 +1,112 @@ +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) +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 new file mode 100644 index 0000000000000..80d49396aac87 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch @@ -0,0 +1,103 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2315da5..1d8de96 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) + set(ZLIB_WINAPI yes) + IF(ZLIB_WINAPI) +@@ -490,7 +490,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}) +@@ -507,7 +507,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) + + # +@@ -577,7 +577,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) +@@ -799,7 +799,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 ff7ade0..1438819 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -243,11 +243,14 @@ 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}) +@@ -257,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 +- 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/0004-3.6.0-android.patch b/recipes/libarchive/all/patches/0004-3.6.0-android.patch new file mode 100644 index 0000000000000..c4c91d3ecb18a --- /dev/null +++ b/recipes/libarchive/all/patches/0004-3.6.0-android.patch @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000000..4bca48088c19b --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1d8de96f..d54975b7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -829,6 +829,8 @@ ENDIF(NOT OPENSSL_FOUND) + # + MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + FOREACH(ALGORITHM ${ALGORITHMS}) ++ include(CMakePushCheckState) ++ cmake_push_check_state() + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) +@@ -849,8 +851,7 @@ 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}") +@@ -927,6 +928,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/test_package/CMakeLists.txt b/recipes/libarchive/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..925a2be0857c5 --- /dev/null +++ b/recipes/libarchive/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(LibArchive REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibArchive::LibArchive) diff --git a/recipes/libarchive/all/test_package/conanfile.py b/recipes/libarchive/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libarchive/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/libarchive/all/test_package/test_package.c b/recipes/libarchive/all/test_package/test_package.c new file mode 100644 index 0000000000000..42ef77c45fcc9 --- /dev/null +++ b/recipes/libarchive/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char *argv[]) { + printf("libarchive version: %s\n", archive_version_string()); + printf("libarchive details: %s\n", archive_version_details()); + return 0; +} diff --git a/recipes/libarchive/all/test_v1_package/CMakeLists.txt b/recipes/libarchive/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libarchive/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libarchive/all/test_v1_package/conanfile.py b/recipes/libarchive/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libarchive/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml new file mode 100644 index 0000000000000..2cfb62acf5228 --- /dev/null +++ b/recipes/libarchive/config.yml @@ -0,0 +1,15 @@ +versions: + "3.6.2": + folder: all + "3.6.1": + folder: all + "3.6.0": + folder: all + "3.5.2": + folder: all + "3.5.1": + folder: all + "3.4.3": + folder: all + "3.4.0": + folder: all diff --git a/recipes/libatomic_ops/all/conandata.yml b/recipes/libatomic_ops/all/conandata.yml new file mode 100644 index 0000000000000..04ee70160921a --- /dev/null +++ b/recipes/libatomic_ops/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "7.8.0": + url: "https://github.com/ivmai/libatomic_ops/releases/download/v7.8.0/libatomic_ops-7.8.0.tar.gz" + sha256: "15676e7674e11bda5a7e50a73f4d9e7d60452271b8acf6fd39a71fefdf89fa31" diff --git a/recipes/libatomic_ops/all/conanfile.py b/recipes/libatomic_ops/all/conanfile.py new file mode 100644 index 0000000000000..8bdc55215ddd6 --- /dev/null +++ b/recipes/libatomic_ops/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir, export_conandata_patches +import os + + +required_conan_version = ">=1.52.0" + + +class Atomic_opsConan(ConanFile): + name = "libatomic_ops" + homepage = "https://github.com/ivmai/libatomic_ops" + description = "The atomic_ops project (Atomic memory update operations portable implementation)" + topics = ("conan", "fmt", "format", "iostream", "printf") + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-2.0-or-later" + settings = "os", "compiler", "build_type", "arch" + + _cmake_options_defaults = ( + ("assertions", False,), + ("atomic_intrinsics", True,), + ) + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + for option, default in _cmake_options_defaults: + options[option] = [True, False] + default_options[option] = default + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + 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) + for option, _ in self._cmake_options_defaults: + tc.variables["enable_{}".format(option)] = self.options.get_safe(option) + tc.variables["install_headers"] = True + tc.variables["build_tests"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + 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, "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, "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.set_property("cmake_file_name", "Atomic_ops") + self.cpp_info.set_property("cmake_target_name", "Atomic_ops::atomic_ops_gpl") # workaround to not define an unofficial target + + # TODO: Remove on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "Atomic_ops" + self.cpp_info.names["cmake_find_package_multi"] = "Atomic_ops" + + self.cpp_info.components["atomic_ops"].set_property("cmake_target_name", "Atomic_ops::atomic_ops") + self.cpp_info.components["atomic_ops"].set_property("pkg_config_name", "atomic_ops") + self.cpp_info.components["atomic_ops"].libs = ["atomic_ops"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["atomic_ops"].system_libs = ["pthread"] + + self.cpp_info.components["atomic_ops_gpl"].set_property("cmake_target_name", "Atomic_ops::atomic_ops_gpl") + self.cpp_info.components["atomic_ops_gpl"].libs = ["atomic_ops_gpl"] + self.cpp_info.components["atomic_ops_gpl"].requires = ["atomic_ops"] diff --git a/recipes/libatomic_ops/all/test_package/CMakeLists.txt b/recipes/libatomic_ops/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f1810f818b79 --- /dev/null +++ b/recipes/libatomic_ops/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(Atomic_ops CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Atomic_ops::atomic_ops Atomic_ops::atomic_ops_gpl) diff --git a/recipes/libatomic_ops/all/test_package/conanfile.py b/recipes/libatomic_ops/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fde7967ed16f1 --- /dev/null +++ b/recipes/libatomic_ops/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run + + +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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/libatomic_ops/all/test_package/test_package.c b/recipes/libatomic_ops/all/test_package/test_package.c new file mode 100644 index 0000000000000..07113fb9c2ab1 --- /dev/null +++ b/recipes/libatomic_ops/all/test_package/test_package.c @@ -0,0 +1,54 @@ +#include "atomic_ops_stack.h" + +#include +#include + +AO_t globalElement; + +AO_stack_t globalStack = AO_STACK_INITIALIZER; + +typedef struct { + AO_t head; + unsigned val; +} my_stack_t; + +int main() +{ + AO_store_full(&globalElement, 1337); + { + AO_t val = AO_load_full(&globalElement); + if (val != 1337) { + fprintf(stderr, "Unexpected element after store/load: %u\n", (unsigned) val); + return EXIT_FAILURE; + } + } + + { + my_stack_t *newElem = (my_stack_t *) malloc(sizeof(my_stack_t)); + newElem->val = 4242; + AO_stack_push_release(&globalStack, &newElem->head); + } + { + my_stack_t *newElem = (my_stack_t *) malloc(sizeof(my_stack_t)); + newElem->val = 8484; + AO_stack_push_release(&globalStack, &newElem->head); + } + + { + my_stack_t *fetchElement = (my_stack_t *) AO_stack_pop_acquire(&globalStack); + if (fetchElement->val != 8484) { + fprintf(stderr, "Unexpected element from stack: %u\n", (unsigned) fetchElement->val); + return EXIT_FAILURE; + } + free(fetchElement); + } + { + my_stack_t *fetchElement = (my_stack_t *) AO_stack_pop_acquire(&globalStack); + if (fetchElement->val != 4242) { + fprintf(stderr, "Unexpected element from stack: %u\n", (unsigned) fetchElement->val); + return EXIT_FAILURE; + } + free(fetchElement); + } + return EXIT_SUCCESS; +} diff --git a/recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt b/recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c7f2e8e2e3a34 --- /dev/null +++ b/recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Atomic_ops CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Atomic_ops::atomic_ops Atomic_ops::atomic_ops_gpl) diff --git a/recipes/libatomic_ops/all/test_v1_package/conanfile.py b/recipes/libatomic_ops/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/libatomic_ops/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libatomic_ops/config.yml b/recipes/libatomic_ops/config.yml new file mode 100644 index 0000000000000..95536563a1815 --- /dev/null +++ b/recipes/libatomic_ops/config.yml @@ -0,0 +1,3 @@ +versions: + "7.8.0": + folder: all diff --git a/recipes/libattr/all/conandata.yml b/recipes/libattr/all/conandata.yml new file mode 100644 index 0000000000000..186ef69a97394 --- /dev/null +++ b/recipes/libattr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.1": + url: "http://download.savannah.nongnu.org/releases/attr/attr-2.5.1.tar.gz" + sha256: "bae1c6949b258a0d68001367ce0c741cebdacdd3b62965d17e5eb23cd78adaf8" diff --git a/recipes/libattr/all/conanfile.py b/recipes/libattr/all/conanfile.py new file mode 100644 index 0000000000000..8e2a7e6466753 --- /dev/null +++ b/recipes/libattr/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, mkdir, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibAttrConan(ConanFile): + name = "libattr" + description = "Commands for Manipulating Filesystem Extended Attributes" + topics = ("attr", "filesystem") + license = "GPL-2.0-or-later" + homepage = "https://savannah.nongnu.org/projects/attr/" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libattr is just supported on Linux") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=os.path.join(self.source_folder, "doc"), dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + mkdir(self, os.path.join(self.package_folder, "res")) + rename(self, os.path.join(self.package_folder, "etc", "xattr.conf"), + os.path.join(self.package_folder, "res", "xattr.conf")) + rmdir(self, os.path.join(self.package_folder, "etc")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libattr") + self.cpp_info.libs = ["attr"] + self.cpp_info.resdirs = ["res"] diff --git a/recipes/libattr/all/test_package/CMakeLists.txt b/recipes/libattr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..731d92a3c2e3b --- /dev/null +++ b/recipes/libattr/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libattr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libattr::libattr) diff --git a/recipes/libattr/all/test_package/conanfile.py b/recipes/libattr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libattr/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/libattr/all/test_package/test_package.c b/recipes/libattr/all/test_package/test_package.c new file mode 100644 index 0000000000000..23f2ef2fb85c1 --- /dev/null +++ b/recipes/libattr/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char* argv[]) +{ + char value[255]; + int len = sizeof(value); + const char *path = "file_not_exist.txt"; + const char *attr = "attr_not_exist"; + attr_get(path, attr, value, &len, 0); + return 0; +} diff --git a/recipes/libattr/all/test_v1_package/CMakeLists.txt b/recipes/libattr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libattr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libattr/all/test_v1_package/conanfile.py b/recipes/libattr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libattr/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/libattr/config.yml b/recipes/libattr/config.yml new file mode 100644 index 0000000000000..b14f238429c81 --- /dev/null +++ b/recipes/libattr/config.yml @@ -0,0 +1,4 @@ +versions: + "2.5.1": + folder: all + diff --git a/recipes/libavif/all/conandata.yml b/recipes/libavif/all/conandata.yml new file mode 100644 index 0000000000000..1889bd2ede18f --- /dev/null +++ b/recipes/libavif/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "0.11.1": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.11.1.tar.gz" + sha256: "0eb49965562a0e5e5de58389650d434cff32af84c34185b6c9b7b2fccae06d4e" + "0.9.3": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.9.3.tar.gz" + sha256: "bcd9a1f57f982a9615eb7e2faf87236dc88eb1d0c886f3471c7440ead605060d" +patches: + "0.11.1": + - patch_file: patches/0.11.1-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" + "0.9.3": + - patch_file: patches/0.9.3-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" + - patch_file: patches/0.9.3-0002-fix-libyuv-version-handling.patch + patch_description: "support libyuv API modification" + patch_type: "backport" + patch_source: "https://github.com/AOMediaCodec/libavif/issues/781" diff --git a/recipes/libavif/all/conanfile.py b/recipes/libavif/all/conanfile.py new file mode 100644 index 0000000000000..dc46d0267dd99 --- /dev/null +++ b/recipes/libavif/all/conanfile.py @@ -0,0 +1,137 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class LibAVIFConan(ConanFile): + name = "libavif" + description = "Library for encoding and decoding .avif files" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AOMediaCodec/libavif" + topics = ("avif") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_decoder": ["aom", "dav1d"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_decoder": "dav1d", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + @property + def _has_dav1d(self): + return self.options.with_decoder == "dav1d" + + def requirements(self): + self.requires("libaom-av1/3.5.0") + self.requires("libyuv/1854") + if self._has_dav1d: + self.requires("dav1d/1.0.0") + + 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["AVIF_ENABLE_WERROR"] = False + tc.variables["AVIF_CODEC_AOM"] = True + tc.variables["AVIF_CODEC_DAV1D"] = self.options.with_decoder == "dav1d" + tc.variables["AVIF_CODEC_AOM_DECODE"] = self.options.with_decoder == "aom" + tc.variables["LIBYUV_VERSION"] = self.dependencies["libyuv"].ref.version + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(libyuv QUIET)", "find_package(libyuv REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${LIBYUV_LIBRARY}", "libyuv::libyuv") + replace_in_file(self, cmakelists, "find_package(dav1d REQUIRED)", "find_package(dav1d REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${DAV1D_LIBRARY}", "dav1d::dav1d") + replace_in_file(self, cmakelists, "find_package(aom REQUIRED)", "find_package(libaom-av1 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${AOM_LIBRARIES}", "libaom-av1::libaom-av1") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _alias_path(self): + return os.path.join("lib", "conan-official-avif-targets.cmake") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: remove in conan v2 + alias = os.path.join(self.package_folder, self._alias_path) + content = textwrap.dedent("""\ + if(TARGET avif::avif AND NOT TARGET avif) + add_library(avif INTERFACE IMPORTED) + set_property( + TARGET avif PROPERTY + INTERFACE_LINK_LIBRARIES avif::avif + ) + endif() + """) + save(self, alias, content) + + def package_info(self): + self.cpp_info.requires = ["libyuv::libyuv", "libaom-av1::libaom-av1"] + if self._has_dav1d: + self.cpp_info.requires.append("dav1d::dav1d") + + self.cpp_info.libs = ["avif"] + if self.options.shared: + self.cpp_info.defines = ["AVIF_DLL"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + if self._has_dav1d: + self.cpp_info.system_libs.append("dl") + + self.cpp_info.set_property("cmake_file_name", "libavif") + self.cpp_info.set_property("cmake_target_name", "avif") + self.cpp_info.set_property("pkg_config_name", "libavif") + + # TODO: remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "avif" + self.cpp_info.names["cmake_find_package_multi"] = "avif" + self.cpp_info.filenames["cmake_find_package"] = "libavif" + self.cpp_info.filenames["cmake_find_package_multi"] = "libavif" + self.cpp_info.build_modules["cmake_find_package"] = [self._alias_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = \ + [self._alias_path] + diff --git a/recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch new file mode 100644 index 0000000000000..b6e2a81df709c --- /dev/null +++ b/recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d9431c..0f3a1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,11 +64,13 @@ if(AVIF_LOCAL_LIBGAV1) + enable_language(CXX) + endif() + ++if(0) + if(APPLE) + set(XCRUN xcrun) + else() + set(XCRUN) + endif() ++endif() + + # --------------------------------------------------------------------------------------- + # This insanity is for people embedding libavif or making fully static or Windows builds. +@@ -141,6 +143,7 @@ if(AVIF_LOCAL_LIBSHARPYUV) + endif() + # --------------------------------------------------------------------------------------- + ++if(0) + # Enable all warnings + include(CheckCCompilerFlag) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") +@@ -189,6 +192,7 @@ if(AVIF_ENABLE_COVERAGE) + message(WARNING "libavif: Ignoring request for coverage (AVIF_ENABLE_COVERAGE); only clang is currently supported.") + endif() + endif() ++endif() + + set(AVIF_SRCS + src/alpha.c diff --git a/recipes/libavif/all/patches/0.9.3-0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/0.9.3-0001-disable-developer-only-codepaths.patch new file mode 100644 index 0000000000000..fe78a8cebb343 --- /dev/null +++ b/recipes/libavif/all/patches/0.9.3-0001-disable-developer-only-codepaths.patch @@ -0,0 +1,20 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -48,7 +48,7 @@ + if(AVIF_LOCAL_LIBGAV1) + enable_language(CXX) + endif() +- ++if("0") + if(APPLE) + set(XCRUN xcrun) + else() +@@ -193,7 +193,7 @@ + message(WARNING "libavif: Ignoring request for coverage (AVIF_ENABLE_COVERAGE); only clang is currently supported.") + endif() + endif() +- ++endif() + set(AVIF_SRCS + src/alpha.c + src/avif.c diff --git a/recipes/libavif/all/patches/0.9.3-0002-fix-libyuv-version-handling.patch b/recipes/libavif/all/patches/0.9.3-0002-fix-libyuv-version-handling.patch new file mode 100644 index 0000000000000..2198cabaca744 --- /dev/null +++ b/recipes/libavif/all/patches/0.9.3-0002-fix-libyuv-version-handling.patch @@ -0,0 +1,73 @@ +From ded15fb7b41b0513e138ba457034a2fb91c1f2c9 Mon Sep 17 00:00:00 2001 +From: Bruno Pagani +Date: Thu, 4 Nov 2021 21:05:15 +0400 +Subject: [PATCH] =?UTF-8?q?Fix=20compilation=20with=201755=20=E2=89=A4=20L?= + =?UTF-8?q?IBYUV=5FVERSION=20<=201774?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +ScalePlane_12 only provide optimization for 2x scale up using +linear/bilinear filter (when scaling up, box and bilinear are the same), +and for the rest cases, it simply calls ScalePlane_16, which handles 2x +scale up just fine (slower though). + +This optimization is thus optional and compilation can be allowed for +libyuv versions not providing it. + +Fixes GH-781 (the function was introduced in libavif +https://github.com/AOMediaCodec/libavif/commit/46104d6db42ec2a94a7da6fc0693f24fa90a1b98). +--- + CMakeLists.txt | 4 ++++ + src/scale.c | 8 ++++++++ + 2 files changed, 12 insertions(+) + + diff --git a/CMakeLists.txt b/CMakeLists.txt + index 3fc76dfb..e18156d4 100644 + --- a/CMakeLists.txt + +++ b/CMakeLists.txt + @@ -233,12 +233,16 @@ endif() + find_package(libyuv QUIET) # not required + if(libyuv_FOUND) + # libyuv 1755 exposed all of the I*Matrix() functions, which libavif relies on. + + # libyuv 1774 exposed ScalePlane_12 function, which libavif can use for some additional optimizations. + if(NOT LIBYUV_VERSION) + message(STATUS "libavif: libyuv found, but version unknown; libyuv-based fast paths disabled.") + elseif(LIBYUV_VERSION LESS 1755) + message(STATUS "libavif: libyuv (${LIBYUV_VERSION}) found, but is too old; libyuv-based fast paths disabled.") + else() + message(STATUS "libavif: libyuv (${LIBYUV_VERSION}) found; libyuv-based fast paths enabled.") + + if(LIBYUV_VERSION LESS 1774) + + message(STATUS "libavif: some libyuv optimizations require at least version 1774 to work.") + + endif() + set(AVIF_PLATFORM_DEFINITIONS ${AVIF_PLATFORM_DEFINITIONS} -DAVIF_LIBYUV_ENABLED=1) + set(AVIF_PLATFORM_INCLUDES ${AVIF_PLATFORM_INCLUDES} ${LIBYUV_INCLUDE_DIR}) + set(AVIF_PLATFORM_LIBRARIES ${AVIF_PLATFORM_LIBRARIES} ${LIBYUV_LIBRARY}) +diff --git a/src/scale.c b/src/scale.c +index 6ca651b2..1bbbdd86 100644 +--- a/src/scale.c ++++ b/src/scale.c +@@ -107,7 +107,11 @@ avifBool avifImageScale(avifImage * image, uint32_t dstWidth, uint32_t dstHeight + const uint32_t srcStride = srcYUVRowBytes[i] / 2; + uint16_t * const dstPlane = (uint16_t *)image->yuvPlanes[i]; + const uint32_t dstStride = image->yuvRowBytes[i] / 2; ++#if LIBYUV_VERSION >= 1774 + ScalePlane_12(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE); ++#else ++ ScalePlane_16(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE); ++#endif + } else { + uint8_t * const srcPlane = srcYUVPlanes[i]; + const uint32_t srcStride = srcYUVRowBytes[i]; +@@ -130,7 +134,11 @@ avifBool avifImageScale(avifImage * image, uint32_t dstWidth, uint32_t dstHeight + const uint32_t srcStride = srcAlphaRowBytes / 2; + uint16_t * const dstPlane = (uint16_t *)image->alphaPlane; + const uint32_t dstStride = image->alphaRowBytes / 2; ++#if LIBYUV_VERSION >= 1774 + ScalePlane_12(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE); ++#else ++ ScalePlane_16(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE); ++#endif + } else { + uint8_t * const srcPlane = srcAlphaPlane; + const uint32_t srcStride = srcAlphaRowBytes; diff --git a/recipes/libavif/all/test_package/CMakeLists.txt b/recipes/libavif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b46c3a250bddb --- /dev/null +++ b/recipes/libavif/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libavif REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE avif) diff --git a/recipes/libavif/all/test_package/conanfile.py b/recipes/libavif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libavif/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/libavif/all/test_package/test_package.c b/recipes/libavif/all/test_package/test_package.c new file mode 100644 index 0000000000000..178cbce61af42 --- /dev/null +++ b/recipes/libavif/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const* argv[]) +{ + (void)argc; + (void)argv; + + avifFree(NULL); + + return 0; +} diff --git a/recipes/libavif/all/test_v1_package/CMakeLists.txt b/recipes/libavif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libavif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libavif/all/test_v1_package/conanfile.py b/recipes/libavif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libavif/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/libavif/config.yml b/recipes/libavif/config.yml new file mode 100644 index 0000000000000..f3e6d6038f1fa --- /dev/null +++ b/recipes/libavif/config.yml @@ -0,0 +1,5 @@ +versions: + "0.11.1": + folder: all + "0.9.3": + folder: all diff --git a/recipes/libavrocpp/all/conandata.yml b/recipes/libavrocpp/all/conandata.yml new file mode 100644 index 0000000000000..4db9766f42d9f --- /dev/null +++ b/recipes/libavrocpp/all/conandata.yml @@ -0,0 +1,70 @@ +sources: + "1.11.1": + url: "https://github.com/apache/avro/archive/release-1.11.1.tar.gz" + sha256: "599f96bb405f72a35154b2477caa6254d723bb4e3f6a0e54e9ae540664321752" + "1.11.0": + url: "https://github.com/apache/avro/archive/release-1.11.0.tar.gz" + sha256: "c205140e7936d552286ba7131122a34e522d66f601ee912f272109d801f89773" + "1.10.2": + url: "https://github.com/apache/avro/archive/release-1.10.2.tar.gz" + sha256: "c849ef7f7af58ce66e7b999b8d9815507d69ae434e7e058a44f7818515455a03" + "1.10.1": + url: "https://github.com/apache/avro/archive/release-1.10.1.tar.gz" + sha256: "8fd1f850ce37e60835e6d8335c0027a959aaa316773da8a9660f7d33a66ac142" +patches: + "1.11.1": + - patch_file: "patches/0001-add-iterator-include-1-11-0.patch" + patch_description: "include iterator" + patch_type: "portability" + - patch_file: "patches/0002-disable-tests-1-11-1.patch" + patch_description: "disable tests" + patch_type: "conan" + - patch_file: "patches/0003-allow-static-boost-linkage-1-11-0.patch" + patch_description: "remove boost linkage definitions" + patch_type: "conan" + - patch_file: "patches/0004-fix-windows-shared-installation-1-11-1.patch" + patch_description: "fix runtime installation path" + patch_type: "portability" + - patch_file: "patches/0005-fix-breaking-include-1-11-1.patch" + patch_description: "move impl/json/jsonDom.h to api/json" + patch_type: "backport" + patch_source: "https://issues.apache.org/jira/browse/AVRO-3601" + "1.11.0": + - patch_file: "patches/0001-add-iterator-include-1-11-0.patch" + patch_description: "include iterator" + patch_type: "portability" + - patch_file: "patches/0002-disable-tests-1-11-0.patch" + patch_description: "disable tests" + patch_type: "conan" + - patch_file: "patches/0003-allow-static-boost-linkage-1-11-0.patch" + patch_description: "remove boost linkage definitions" + patch_type: "conan" + - patch_file: "patches/0004-fix-windows-shared-installation-1-11-0.patch" + patch_description: "fix runtime installation path" + patch_type: "portability" + "1.10.2": + - patch_file: "patches/0001-add-iterator-include.patch" + patch_description: "include iterator" + patch_type: "portability" + - patch_file: "patches/0002-disable-tests-1-10-2.patch" + patch_description: "disable tests" + patch_type: "conan" + - patch_file: "patches/0003-allow-static-boost-linkage.patch" + patch_description: "remove boost linkage definitions" + patch_type: "conan" + - patch_file: "patches/0004-fix-windows-shared-installation-1-10-2.patch" + patch_description: "fix runtime installation path" + patch_type: "portability" + "1.10.1": + - patch_file: "patches/0001-add-iterator-include.patch" + patch_description: "include iterator" + patch_type: "portability" + - patch_file: "patches/0002-disable-tests-1-10-1.patch" + patch_description: "disable tests" + patch_type: "conan" + - patch_file: "patches/0003-allow-static-boost-linkage.patch" + patch_description: "remove boost linkage definitions" + patch_type: "conan" + - patch_file: "patches/0004-fix-windows-shared-installation-1-10-1.patch" + patch_description: "fix runtime installation path" + patch_type: "portability" diff --git a/recipes/libavrocpp/all/conanfile.py b/recipes/libavrocpp/all/conanfile.py new file mode 100644 index 0000000000000..d9c7f619040a6 --- /dev/null +++ b/recipes/libavrocpp/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.54.0" + + +class LibavrocppConan(ConanFile): + name = "libavrocpp" + description = "Avro is a data serialization system." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://avro.apache.org/" + topics = ("serialization", "deserialization","avro") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + short_paths = True + + @property + def _min_cppstd(self): + return 11 + + 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.81.0") + self.requires("snappy/1.1.9") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "lang", "c++", "CMakeLists.txt") + # Fix discovery & link to Snappy + replace_in_file(self, cmakelists, "SNAPPY_FOUND", "Snappy_FOUND") + replace_in_file(self, cmakelists, "${SNAPPY_LIBRARIES}", "Snappy::snappy") + replace_in_file( + self, cmakelists, + "target_include_directories(avrocpp_s PRIVATE ${SNAPPY_INCLUDE_DIR})", + "target_link_libraries(avrocpp_s PRIVATE Snappy::snappy)", + ) + # Install either static or shared + target = "avrocpp" if self.options.shared else "avrocpp_s" + replace_in_file(self, cmakelists, "install (TARGETS avrocpp avrocpp_s" , f"install (TARGETS {target}") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "lang", "c++")) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="NOTICE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + if self.settings.os == "Windows": + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, dll_pattern_to_remove, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["avrocpp" if self.options.shared else "avrocpp_s"] + if self.options.shared: + self.cpp_info.defines.append("AVRO_DYN_LINK") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.requires = [ + "boost::headers", "boost::filesystem", "boost::iostreams", "boost::program_options", + "boost::regex", "boost::system", "snappy::snappy", + ] diff --git a/recipes/libavrocpp/all/patches/0001-add-iterator-include-1-11-0.patch b/recipes/libavrocpp/all/patches/0001-add-iterator-include-1-11-0.patch new file mode 100644 index 0000000000000..40a93c52bb80f --- /dev/null +++ b/recipes/libavrocpp/all/patches/0001-add-iterator-include-1-11-0.patch @@ -0,0 +1,96 @@ +diff --git a/lang/c++/api/buffer/detail/BufferDetail.hh b/lang/c++/api/buffer/detail/BufferDetail.hh +index b487cdb..89783fb 100644 +--- a/lang/c++/api/buffer/detail/BufferDetail.hh ++++ b/lang/c++/api/buffer/detail/BufferDetail.hh +@@ -30,6 +30,7 @@ + #endif + #include + #include ++#include + #include + + /** +diff --git a/lang/c++/impl/DataFile.cc b/lang/c++/impl/DataFile.cc +index 18fb3f6..f8679a2 100644 +--- a/lang/c++/impl/DataFile.cc ++++ b/lang/c++/impl/DataFile.cc +@@ -20,6 +20,7 @@ + #include "Compiler.hh" + #include "Exception.hh" + ++#include + #include + + #include // for boost::crc_32_type +diff --git a/lang/c++/impl/Stream.cc b/lang/c++/impl/Stream.cc +index 63a8b4e..39556d1 100644 +--- a/lang/c++/impl/Stream.cc ++++ b/lang/c++/impl/Stream.cc +@@ -17,6 +17,7 @@ + */ + + #include "Stream.hh" ++#include + #include + + namespace avro { +diff --git a/lang/c++/impl/parsing/JsonCodec.cc b/lang/c++/impl/parsing/JsonCodec.cc +index 4fd0481..3de5150 100644 +--- a/lang/c++/impl/parsing/JsonCodec.cc ++++ b/lang/c++/impl/parsing/JsonCodec.cc +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + + #include "Decoder.hh" +diff --git a/lang/c++/impl/parsing/ResolvingDecoder.cc b/lang/c++/impl/parsing/ResolvingDecoder.cc +index d86f6e5..3b961ea 100644 +--- a/lang/c++/impl/parsing/ResolvingDecoder.cc ++++ b/lang/c++/impl/parsing/ResolvingDecoder.cc +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "Decoder.hh" + #include "Encoder.hh" +diff --git a/lang/c++/impl/parsing/ValidatingCodec.cc b/lang/c++/impl/parsing/ValidatingCodec.cc +index cfb8222..8a0817a 100644 +--- a/lang/c++/impl/parsing/ValidatingCodec.cc ++++ b/lang/c++/impl/parsing/ValidatingCodec.cc +@@ -19,6 +19,7 @@ + #include "ValidatingCodec.hh" + + #include ++#include + #include + #include + #include +diff --git a/lang/c++/test/CodecTests.cc b/lang/c++/test/CodecTests.cc +index a99cdd6..07f560c 100644 +--- a/lang/c++/test/CodecTests.cc ++++ b/lang/c++/test/CodecTests.cc +@@ -25,6 +25,7 @@ + #include "Specific.hh" + #include "ValidSchema.hh" + ++#include + #include + #include + #include +diff --git a/lang/c++/test/DataFileTests.cc b/lang/c++/test/DataFileTests.cc +index fec7f31..aced825 100644 +--- a/lang/c++/test/DataFileTests.cc ++++ b/lang/c++/test/DataFileTests.cc +@@ -24,6 +24,7 @@ + #include + + #include ++#include + #include + + #include diff --git a/recipes/libavrocpp/all/patches/0001-add-iterator-include.patch b/recipes/libavrocpp/all/patches/0001-add-iterator-include.patch new file mode 100644 index 0000000000000..f62d60b0c67cc --- /dev/null +++ b/recipes/libavrocpp/all/patches/0001-add-iterator-include.patch @@ -0,0 +1,115 @@ +From 7cd46cc46a5742d91933eee75d2504022d2ab48f Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Sat, 29 May 2021 07:31:46 +0200 +Subject: [PATCH] add iterator include + +--- + lang/c++/api/buffer/detail/BufferDetail.hh | 1 + + lang/c++/impl/DataFile.cc | 1 + + lang/c++/impl/Stream.cc | 1 + + lang/c++/impl/parsing/JsonCodec.cc | 1 + + lang/c++/impl/parsing/ResolvingDecoder.cc | 1 + + lang/c++/impl/parsing/ValidatingCodec.cc | 1 + + lang/c++/test/CodecTests.cc | 1 + + lang/c++/test/DataFileTests.cc | 1 + + 8 files changed, 8 insertions(+) + +diff --git a/lang/c++/api/buffer/detail/BufferDetail.hh b/lang/c++/api/buffer/detail/BufferDetail.hh +index 03e237ef..b0a4b4b2 100644 +--- a/lang/c++/api/buffer/detail/BufferDetail.hh ++++ b/lang/c++/api/buffer/detail/BufferDetail.hh +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + /** + * \file BufferDetail.hh +diff --git a/lang/c++/impl/DataFile.cc b/lang/c++/impl/DataFile.cc +index e20e6058..4c56d06b 100644 +--- a/lang/c++/impl/DataFile.cc ++++ b/lang/c++/impl/DataFile.cc +@@ -20,6 +20,7 @@ + #include "Compiler.hh" + #include "Exception.hh" + ++#include + #include + + #include +diff --git a/lang/c++/impl/Stream.cc b/lang/c++/impl/Stream.cc +index 7023f3f2..e8b2cf2f 100644 +--- a/lang/c++/impl/Stream.cc ++++ b/lang/c++/impl/Stream.cc +@@ -17,6 +17,7 @@ + */ + + #include "Stream.hh" ++#include + #include + + namespace avro { +diff --git a/lang/c++/impl/parsing/JsonCodec.cc b/lang/c++/impl/parsing/JsonCodec.cc +index 8bca2984..eda76141 100644 +--- a/lang/c++/impl/parsing/JsonCodec.cc ++++ b/lang/c++/impl/parsing/JsonCodec.cc +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + + #include "ValidatingCodec.hh" +diff --git a/lang/c++/impl/parsing/ResolvingDecoder.cc b/lang/c++/impl/parsing/ResolvingDecoder.cc +index f6dbacab..b4987045 100644 +--- a/lang/c++/impl/parsing/ResolvingDecoder.cc ++++ b/lang/c++/impl/parsing/ResolvingDecoder.cc +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include "ValidatingCodec.hh" + #include "Symbol.hh" +diff --git a/lang/c++/impl/parsing/ValidatingCodec.cc b/lang/c++/impl/parsing/ValidatingCodec.cc +index fdf6ef89..974427f8 100644 +--- a/lang/c++/impl/parsing/ValidatingCodec.cc ++++ b/lang/c++/impl/parsing/ValidatingCodec.cc +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + #include "ValidSchema.hh" +diff --git a/lang/c++/test/CodecTests.cc b/lang/c++/test/CodecTests.cc +index a1949a05..50eef90b 100644 +--- a/lang/c++/test/CodecTests.cc ++++ b/lang/c++/test/CodecTests.cc +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + + #include +diff --git a/lang/c++/test/DataFileTests.cc b/lang/c++/test/DataFileTests.cc +index 8c4605f4..d74802d1 100644 +--- a/lang/c++/test/DataFileTests.cc ++++ b/lang/c++/test/DataFileTests.cc +@@ -25,6 +25,7 @@ + + #include + #include ++#include + + #include + +-- +2.32.0.rc0 + diff --git a/recipes/libavrocpp/all/patches/0002-disable-tests-1-10-1.patch b/recipes/libavrocpp/all/patches/0002-disable-tests-1-10-1.patch new file mode 100644 index 0000000000000..0b5170d594ad8 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0002-disable-tests-1-10-1.patch @@ -0,0 +1,33 @@ +From e0961af7bfb69c1129a0347a8c8ccbd9608098cf Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Tue, 2 Feb 2021 20:29:05 -0500 +Subject: [PATCH] Update CMakeLists.txt + +--- + lang/c++/CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 69feee5b11..435d680e22 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -160,10 +160,6 @@ target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIE + enable_testing() + + macro (unittest name) +- add_executable (${name} test/${name}.cc) +- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) +- add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) + endmacro (unittest) + + unittest (buffertest) +@@ -178,7 +178,7 @@ unittest (JsonTests) + unittest (AvrogencppTests) + unittest (CompilerTests) + +-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh ++add_dependencies (bigrecord_hh bigrecord_r_hh bigrecord2_hh + tweet_hh + union_array_union_hh union_map_union_hh union_conflict_hh + recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh diff --git a/recipes/libavrocpp/all/patches/0002-disable-tests-1-10-2.patch b/recipes/libavrocpp/all/patches/0002-disable-tests-1-10-2.patch new file mode 100644 index 0000000000000..3e8dc4d43028d --- /dev/null +++ b/recipes/libavrocpp/all/patches/0002-disable-tests-1-10-2.patch @@ -0,0 +1,42 @@ +From 322a40e54b4cc1296a405c7fbf920101397d7f37 Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Tue, 2 Feb 2021 20:29:05 -0500 +Subject: [PATCH] Update CMakeLists.txt + +--- + lang/c++/CMakeLists.txt | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 4a1ac660..0d1ec70e 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -161,10 +161,6 @@ target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIE + enable_testing() + + macro (unittest name) +- add_executable (${name} test/${name}.cc) +- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) +- add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) + endmacro (unittest) + + unittest (buffertest) +@@ -180,14 +176,6 @@ unittest (AvrogencppTests) + unittest (CompilerTests) + unittest (AvrogencppTestReservedWords) + +-add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh) +- +-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh +- tweet_hh +- union_array_union_hh union_map_union_hh union_conflict_hh +- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh +- primitivetypes_hh empty_record_hh) +- + include (InstallRequiredSystemLibraries) + + set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") +-- +2.32.0.rc0 + diff --git a/recipes/libavrocpp/all/patches/0002-disable-tests-1-11-0.patch b/recipes/libavrocpp/all/patches/0002-disable-tests-1-11-0.patch new file mode 100644 index 0000000000000..2e7b54bab02b8 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0002-disable-tests-1-11-0.patch @@ -0,0 +1,30 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 4a37931..f371590 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -168,10 +168,6 @@ target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIE + enable_testing() + + macro (unittest name) +- add_executable (${name} test/${name}.cc) +- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) +- add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) + endmacro (unittest) + + unittest (buffertest) +@@ -187,14 +183,6 @@ unittest (AvrogencppTests) + unittest (CompilerTests) + unittest (AvrogencppTestReservedWords) + +-add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh) +- +-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh +- tweet_hh +- union_array_union_hh union_map_union_hh union_conflict_hh +- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh +- primitivetypes_hh empty_record_hh) +- + include (InstallRequiredSystemLibraries) + + set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") diff --git a/recipes/libavrocpp/all/patches/0002-disable-tests-1-11-1.patch b/recipes/libavrocpp/all/patches/0002-disable-tests-1-11-1.patch new file mode 100644 index 0000000000000..a1505a597e4da --- /dev/null +++ b/recipes/libavrocpp/all/patches/0002-disable-tests-1-11-1.patch @@ -0,0 +1,30 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 6098613..c27fab7 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -171,10 +171,6 @@ target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIE + enable_testing() + + macro (unittest name) +- add_executable (${name} test/${name}.cc) +- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) +- add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) + endmacro (unittest) + + unittest (buffertest) +@@ -190,14 +186,6 @@ unittest (AvrogencppTests) + unittest (CompilerTests) + unittest (AvrogencppTestReservedWords) + +-add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh) +- +-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh +- tweet_hh +- union_array_union_hh union_map_union_hh union_conflict_hh +- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh +- primitivetypes_hh empty_record_hh) +- + include (InstallRequiredSystemLibraries) + + set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") diff --git a/recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage-1-11-0.patch b/recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage-1-11-0.patch new file mode 100644 index 0000000000000..695b26eb3ea4e --- /dev/null +++ b/recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage-1-11-0.patch @@ -0,0 +1,18 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index f371590..7f8c09a 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -55,12 +55,7 @@ if (WIN32 AND NOT CYGWIN AND NOT MSYS) + add_definitions (/EHa) + add_definitions ( + -DNOMINMAX +- -DBOOST_REGEX_DYN_LINK +- -DBOOST_FILESYSTEM_DYN_LINK +- -DBOOST_SYSTEM_DYN_LINK +- -DBOOST_IOSTREAMS_DYN_LINK +- -DBOOST_PROGRAM_OPTIONS_DYN_LINK +- -DBOOST_ALL_NO_LIB) ++ ) + endif() + + if (CMAKE_COMPILER_IS_GNUCXX) diff --git a/recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage.patch b/recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage.patch new file mode 100644 index 0000000000000..a8cec2f0d1c59 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0003-allow-static-boost-linkage.patch @@ -0,0 +1,29 @@ +From 902717b4aa557b60d3450a1397cae728d44ebb07 Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Tue, 2 Feb 2021 20:55:08 -0500 +Subject: [PATCH] allow static linkage to boost + +--- + lang/c++/CMakeLists.txt | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 435d680e22..770a9e8df5 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -44,14 +44,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}) + + if (WIN32 AND NOT CYGWIN AND NOT MSYS) + add_definitions (/EHa) +- add_definitions ( +- -DNOMINMAX +- -DBOOST_REGEX_DYN_LINK +- -DBOOST_FILESYSTEM_DYN_LINK +- -DBOOST_SYSTEM_DYN_LINK +- -DBOOST_IOSTREAMS_DYN_LINK +- -DBOOST_PROGRAM_OPTIONS_DYN_LINK +- -DBOOST_ALL_NO_LIB) ++ add_definitions (-DNOMINMAX) + else() + # Replease c++11 with c++17 below in case C++ 17 should be used + add_definitions(-std=c++11 -fPIC) diff --git a/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-1.patch b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-1.patch new file mode 100644 index 0000000000000..97a164248c4aa --- /dev/null +++ b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-1.patch @@ -0,0 +1,31 @@ +From 2b1a4c4fe21bbb581d6f01794a465fe0cea2f167 Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Tue, 2 Feb 2021 21:27:31 -0500 +Subject: [PATCH] fix windows shared installation + +--- + lang/c++/CMakeLists.txt | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 770a9e8df5..3ed26fa27d 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -173,8 +173,6 @@ add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh + recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh + primitivetypes_hh empty_record_hh) + +-include (InstallRequiredSystemLibraries) +- + set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") + + include (CPack) +@@ -182,7 +180,7 @@ include (CPack) + install (TARGETS avrocpp avrocpp_s + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + + install (TARGETS avrogencpp RUNTIME DESTINATION bin) + diff --git a/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-2.patch b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-2.patch new file mode 100644 index 0000000000000..adc06812e15e7 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-10-2.patch @@ -0,0 +1,34 @@ +From 303259ea4480493e148187193e8c0f6833a61aea Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Tue, 2 Feb 2021 21:27:31 -0500 +Subject: [PATCH] fix windows shared installation + +--- + lang/c++/CMakeLists.txt | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index ee59f806..e0f855c1 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -169,8 +169,6 @@ unittest (AvrogencppTests) + unittest (CompilerTests) + unittest (AvrogencppTestReservedWords) + +-include (InstallRequiredSystemLibraries) +- + set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") + + include (CPack) +@@ -178,7 +176,7 @@ include (CPack) + install (TARGETS avrocpp avrocpp_s + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + + install (TARGETS avrogencpp RUNTIME DESTINATION bin) + +-- +2.32.0.rc0 + diff --git a/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-0.patch b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-0.patch new file mode 100644 index 0000000000000..0a5a35defb0d5 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-0.patch @@ -0,0 +1,13 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 7f8c09a..aff0447 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -187,7 +187,7 @@ include (CPack) + install (TARGETS avrocpp avrocpp_s + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + + install (TARGETS avrogencpp RUNTIME DESTINATION bin) + diff --git a/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-1.patch b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-1.patch new file mode 100644 index 0000000000000..842c3ca3ec866 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0004-fix-windows-shared-installation-1-11-1.patch @@ -0,0 +1,13 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 5ceb045..e19b5a9 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -190,7 +190,7 @@ include (CPack) + install (TARGETS avrocpp avrocpp_s + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + + install (TARGETS avrogencpp RUNTIME DESTINATION bin) + diff --git a/recipes/libavrocpp/all/patches/0005-fix-breaking-include-1-11-1.patch b/recipes/libavrocpp/all/patches/0005-fix-breaking-include-1-11-1.patch new file mode 100644 index 0000000000000..778bdf6bbbdab --- /dev/null +++ b/recipes/libavrocpp/all/patches/0005-fix-breaking-include-1-11-1.patch @@ -0,0 +1,473 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index e19b5a9..0249c37 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -106,7 +106,7 @@ set (AVRO_SOURCE_FILES + impl/json/JsonIO.cc + impl/json/JsonDom.cc + impl/Resolver.cc impl/Validator.cc +- impl/CustomFields.cc ++ impl/CustomAttributes.cc + ) + + add_library (avrocpp SHARED ${AVRO_SOURCE_FILES}) +diff --git b/lang/c++/api/CustomAttributes.hh b/lang/c++/api/CustomAttributes.hh +new file mode 100644 +index 0000000..2bd572c +--- /dev/null ++++ b/lang/c++/api/CustomAttributes.hh +@@ -0,0 +1,55 @@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one ++ * or more contributor license agreements. See the NOTICE file ++ * distributed with this work for additional information ++ * regarding copyright ownership. The ASF licenses this file ++ * to you under the Apache License, Version 2.0 (the ++ * "License"); you may not use this file except in compliance ++ * with the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef avro_CustomAttributes_hh__ ++#define avro_CustomAttributes_hh__ ++ ++#include ++#include ++#include ++#include "Config.hh" ++ ++namespace avro { ++ ++// CustomAttributes class stores avro custom attributes. ++// Each attribute is represented by a unique name and value. ++// User is supposed to create CustomAttributes object and then add it to Schema. ++class AVRO_DECL CustomAttributes { ++ public: ++ // Retrieves the custom attribute json entity for that attributeName, returns an ++ // null if the attribute doesn't exist. ++ std::string getAttribute(const std::string &name) const; ++ ++ // Adds a custom attribute. If the attribute already exists, throw an exception. ++ void addAttribute(const std::string &name, const std::string &value); ++ ++ // Provides a way to iterate over the custom attributes or check attribute size. ++ const std::map &attributes() const { ++ return attributes_; ++ } ++ ++ // Prints the attribute value for the specific attribute. ++ void printJson(std::ostream& os, const std::string &name) const; ++ ++ private: ++ std::map attributes_; ++}; ++ ++} // namespace avro ++ ++#endif +diff --git a/lang/c++/api/CustomFields.hh a/lang/c++/api/CustomFields.hh +deleted file mode 100644 +index 01468ff..0000000 +--- a/lang/c++/api/CustomFields.hh ++++ /dev/null +@@ -1,55 +0,0 @@ +-/* +- * Licensed to the Apache Software Foundation (ASF) under one +- * or more contributor license agreements. See the NOTICE file +- * distributed with this work for additional information +- * regarding copyright ownership. The ASF licenses this file +- * to you under the Apache License, Version 2.0 (the +- * "License"); you may not use this file except in compliance +- * with the License. You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#ifndef avro_CustomFields_hh__ +-#define avro_CustomFields_hh__ +- +-#include +- +-#include "../impl/json/JsonDom.hh" +- +-namespace avro { +- +-// CustomFields class stores avro custom attributes. +-// Each field is represented by a unique name and value. +-// User is supposed to create CustomFields object and then add it to Schema. +-class AVRO_DECL CustomFields { +- public: +- // Retrieves the custom field json entity for that fieldName, returns an +- // null Entity if the field doesn't exist. +- json::Entity getField(const std::string &fieldName) const; +- +- // Adds a custom field. If the field already exists, throw an exception. +- void addField(const std::string &fieldName, const json::Entity &fieldValue); +- void addField(const std::string &fieldName, const std::string &fieldValue); +- +- // Provides a way to iterate over the custom fields or check field size. +- const std::map &fields() const { +- return fields_; +- } +- +- // Prints the json string for the specific field. +- void printJson(std::ostream& os, const std::string &fieldName) const; +- +- private: +- std::map fields_; +-}; +- +-} // namespace avro +- +-#endif +diff --git a/lang/c++/api/Node.hh b/lang/c++/api/Node.hh +index c9af126..3f5fe5b 100644 +--- a/lang/c++/api/Node.hh ++++ b/lang/c++/api/Node.hh +@@ -26,7 +26,7 @@ + #include + #include + +-#include "CustomFields.hh" ++#include "CustomAttributes.hh" + #include "Exception.hh" + #include "LogicalType.hh" + #include "SchemaResolution.hh" +@@ -154,7 +154,7 @@ public: + } + virtual size_t fixedSize() const = 0; + +- void addCustomAttributesForField(const CustomFields& customAttributes) { ++ void addCustomAttributesForField(const CustomAttributes& customAttributes) { + checkLock(); + doAddCustomAttribute(customAttributes); + } +@@ -191,7 +191,7 @@ protected: + virtual void doAddLeaf(const NodePtr &newLeaf) = 0; + virtual void doAddName(const std::string &name) = 0; + virtual void doSetFixedSize(size_t size) = 0; +- virtual void doAddCustomAttribute(const CustomFields& customFields) = 0; ++ virtual void doAddCustomAttribute(const CustomAttributes& customAttributes) = 0; + + private: + const Type type_; +diff --git a/lang/c++/api/NodeImpl.hh b/lang/c++/api/NodeImpl.hh +index 62e62eb..bf0e352 100644 +--- a/lang/c++/api/NodeImpl.hh ++++ b/lang/c++/api/NodeImpl.hh +@@ -32,7 +32,7 @@ + + #include "Node.hh" + #include "NodeConcepts.hh" +-#include "CustomFields.hh" ++#include "CustomAttributes.hh" + + namespace avro { + +@@ -160,8 +160,8 @@ protected: + + void setLeafToSymbolic(size_t index, const NodePtr &node) override; + +- void doAddCustomAttribute(const CustomFields &customfields) override { +- customAttributes_.add(customfields); ++ void doAddCustomAttribute(const CustomAttributes &customAttributes) override { ++ customAttributes_.add(customAttributes); + } + + SchemaResolution furtherResolution(const Node &reader) const { +@@ -223,8 +223,8 @@ using MultiLeaves = concepts::MultiAttribute; + + using NoLeafNames = concepts::NoAttribute; + using LeafNames = concepts::MultiAttribute; +-using MultiAttributes = concepts::MultiAttribute; +-using NoAttributes = concepts::NoAttribute; ++using MultiAttributes = concepts::MultiAttribute; ++using NoAttributes = concepts::NoAttribute; + + using NoSize = concepts::NoAttribute; + using HasSize = concepts::SingleAttribute; +diff --git a/lang/c++/api/Schema.hh b/lang/c++/api/Schema.hh +index fa50481..b0d1e39 100644 +--- a/lang/c++/api/Schema.hh ++++ b/lang/c++/api/Schema.hh +@@ -21,7 +21,7 @@ + + #include "Config.hh" + #include "NodeImpl.hh" +-#include "CustomFields.hh" ++#include "CustomAttributes.hh" + #include + + /// \file +@@ -103,7 +103,7 @@ public: + void addField(const std::string &name, const Schema &fieldSchema); + // Add a field with custom attributes + void addField(const std::string &name, const Schema &fieldSchema, +- const CustomFields &customFields); ++ const CustomAttributes &customFields); + + std::string getDoc() const; + void setDoc(const std::string &); +diff --git a/lang/c++/impl/Compiler.cc b/lang/c++/impl/Compiler.cc +index 014229e..383798c 100644 +--- a/lang/c++/impl/Compiler.cc ++++ b/lang/c++/impl/Compiler.cc +@@ -21,7 +21,7 @@ + #include + + #include "Compiler.hh" +-#include "CustomFields.hh" ++#include "CustomAttributes.hh" + #include "NodeConcepts.hh" + #include "Schema.hh" + #include "Stream.hh" +@@ -149,8 +149,8 @@ struct Field { + const string name; + const NodePtr schema; + const GenericDatum defaultValue; +- const CustomFields customFields; +- Field(string n, NodePtr v, GenericDatum dv, const CustomFields& cf) : name(std::move(n)), schema(std::move(v)), defaultValue(std::move(dv)), customFields(std::move(cf)) {} ++ const CustomAttributes customAttributes; ++ Field(string n, NodePtr v, GenericDatum dv, const CustomAttributes& ca) : name(std::move(n)), schema(std::move(v)), defaultValue(std::move(dv)), customAttributes(std::move(ca)) {} + }; + + static void assertType(const Entity &e, EntityType et) { +@@ -268,14 +268,14 @@ static const std::unordered_set& getKnownFields() { + return kKnownFields; + } + +-static void getCustomAttributes(const Object& m, CustomFields &customAttributes) ++static void getCustomAttributes(const Object& m, CustomAttributes &customAttributes) + { + // Don't add known fields on primitive type and fixed type into custom + // fields. + const std::unordered_set& kKnownFields = getKnownFields(); + for (const auto &entry : m) { + if (kKnownFields.find(entry.first) == kKnownFields.end()) { +- customAttributes.addField(entry.first, entry.second); ++ customAttributes.addAttribute(entry.first, entry.second.stringValue()); + } + } + } +@@ -291,7 +291,7 @@ static Field makeField(const Entity &e, SymbolTable &st, const string &ns) { + } + GenericDatum d = (it2 == m.end()) ? GenericDatum() : makeGenericDatum(node, it2->second, st); + // Get custom attributes +- CustomFields customAttributes; ++ CustomAttributes customAttributes; + getCustomAttributes(m, customAttributes); + + return Field(n, node, d, customAttributes); +@@ -304,7 +304,7 @@ static NodePtr makeRecordNode(const Entity &e, const Name &name, + const Array &v = getArrayField(e, m, "fields"); + concepts::MultiAttribute fieldNames; + concepts::MultiAttribute fieldValues; +- concepts::MultiAttribute customAttributes; ++ concepts::MultiAttribute customAttributes; + vector defaultValues; + + for (const auto &it : v) { +@@ -312,7 +312,7 @@ static NodePtr makeRecordNode(const Entity &e, const Name &name, + fieldNames.add(f.name); + fieldValues.add(f.schema); + defaultValues.push_back(f.defaultValue); +- customAttributes.add(f.customFields); ++ customAttributes.add(f.customAttributes); + } + NodeRecord *node; + if (doc == nullptr) { +diff --git b/lang/c++/impl/CustomAttributes.cc b/lang/c++/impl/CustomAttributes.cc +new file mode 100644 +index 0000000..bb56438 +--- /dev/null ++++ b/lang/c++/impl/CustomAttributes.cc +@@ -0,0 +1,51 @@ ++ ++/** ++ * Licensed to the Apache Software Foundation (ASF) under one ++ * or more contributor license agreements. See the NOTICE file ++ * distributed with this work for additional information ++ * regarding copyright ownership. The ASF licenses this file ++ * to you under the Apache License, Version 2.0 (the ++ * "License"); you may not use this file except in compliance ++ * with the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++#include "CustomAttributes.hh" ++#include ++#include ++#include "Exception.hh" ++ ++namespace avro { ++ ++std::string CustomAttributes::getAttribute(const std::string &name) const { ++ std::map::const_iterator iter = ++ attributes_.find(name); ++ if (iter == attributes_.end()) { ++ return NULL; ++ } ++ return iter->second; ++} ++ ++void CustomAttributes::addAttribute(const std::string& name, ++ const std::string& value) { ++ auto iter_and_find = ++ attributes_.insert(std::pair(name, value)); ++ if (!iter_and_find.second) { ++ throw Exception(name + " already exists and cannot be added"); ++ } ++} ++ ++void CustomAttributes::printJson(std::ostream& os, ++ const std::string& name) const { ++ if (attributes().find(name) == attributes().end()) { ++ throw Exception(name + " doesn't exist"); ++ } ++ os << "\"" << name << "\": \"" << attributes().at(name) << "\""; ++} ++} // namespace avro +diff --git a/lang/c++/impl/CustomFields.cc a/lang/c++/impl/CustomFields.cc +deleted file mode 100644 +index 04541da..0000000 +--- a/lang/c++/impl/CustomFields.cc ++++ /dev/null +@@ -1,59 +0,0 @@ +- +-/** +- * Licensed to the Apache Software Foundation (ASF) under one +- * or more contributor license agreements. See the NOTICE file +- * distributed with this work for additional information +- * regarding copyright ownership. The ASF licenses this file +- * to you under the Apache License, Version 2.0 (the +- * "License"); you may not use this file except in compliance +- * with the License. You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +-#include "CustomFields.hh" +-#include +-#include +-#include "Exception.hh" +- +-namespace avro { +- +-using json::Entity; +- +-Entity CustomFields::getField(const std::string &fieldName) const { +- std::map::const_iterator iter = +- fields_.find(fieldName); +- if (iter == fields_.end()) { +- return Entity(); +- } +- return iter->second; +-} +- +-void CustomFields::addField(const std::string& fieldName, +- const std::string& fieldValue) { +- addField(fieldName, +- json::Entity(std::make_shared(fieldValue))); +-} +- +-void CustomFields::addField(const std::string& fieldName, +- const Entity& fieldValue) { +- auto iter_and_find = +- fields_.insert(std::pair(fieldName, fieldValue)); +- if (!iter_and_find.second) { +- throw Exception(fieldName + " already exists and cannot be added"); +- } +-} +- +-void CustomFields::printJson(std::ostream& os, +- const std::string& fieldName) const { +- if (fields_.find(fieldName) == fields_.end()) { +- throw Exception(fieldName + " doesn't exist"); +- } +- os << "\"" << fieldName << "\": " << fields_.at(fieldName).toString(); +-} +-} // namespace avro +diff --git a/lang/c++/impl/NodeImpl.cc b/lang/c++/impl/NodeImpl.cc +index 37c8555..5549c68 100644 +--- a/lang/c++/impl/NodeImpl.cc ++++ b/lang/c++/impl/NodeImpl.cc +@@ -83,13 +83,13 @@ std::ostream &operator<<(std::ostream &os, indent x) { + return os; + } + +-void printCustomFields(const CustomFields& customFields, int depth, ++void printCustomAttributes(const CustomAttributes& customAttributes, int depth, + std::ostream &os) { +- std::map::const_iterator iter = +- customFields.fields().begin(); +- while (iter != customFields.fields().end()) { ++ std::map::const_iterator iter = ++ customAttributes.attributes().begin(); ++ while (iter != customAttributes.attributes().end()) { + os << ",\n" << indent(depth); +- customFields.printJson(os, iter->first); ++ customAttributes.printJson(os, iter->first); + ++iter; + } + } +@@ -287,7 +287,7 @@ void NodeRecord::printJson(std::ostream &os, size_t depth) const { + } + } + if(customAttributes_.size() == fields) { +- printCustomFields(customAttributes_.get(i), depth, os); ++ printCustomAttributes(customAttributes_.get(i), depth, os); + } + os << '\n'; + os << indent(--depth) << '}'; +diff --git a/lang/c++/impl/Schema.cc b/lang/c++/impl/Schema.cc +index fa90d34..3315f25 100644 +--- a/lang/c++/impl/Schema.cc ++++ b/lang/c++/impl/Schema.cc +@@ -19,7 +19,7 @@ + #include + + #include "Schema.hh" +-#include "CustomFields.hh" ++#include "CustomAttributes.hh" + + namespace avro { + +@@ -28,11 +28,11 @@ RecordSchema::RecordSchema(const std::string &name) : Schema(new NodeRecord) { + } + + void RecordSchema::addField(const std::string &name, const Schema &fieldSchema) { +- const CustomFields emptyCustomField; +- addField(name, fieldSchema, emptyCustomField); ++ const CustomAttributes emptyCustomAttribute; ++ addField(name, fieldSchema, emptyCustomAttribute); + } + +-void RecordSchema::addField(const std::string &name, const Schema &fieldSchema, const CustomFields &customFields) { ++void RecordSchema::addField(const std::string &name, const Schema &fieldSchema, const CustomAttributes &customFields) { + // add the name first. it will throw if the name is a duplicate, preventing + // the leaf from being added + node_->addName(name); diff --git a/recipes/libavrocpp/all/test_package/CMakeLists.txt b/recipes/libavrocpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d86e652771773 --- /dev/null +++ b/recipes/libavrocpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libavrocpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libavrocpp::libavrocpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libavrocpp/all/test_package/conanfile.py b/recipes/libavrocpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libavrocpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libavrocpp/all/test_package/test_package.cpp b/recipes/libavrocpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..660025de06682 --- /dev/null +++ b/recipes/libavrocpp/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +#include "avro/Decoder.hh" +#include "avro/Encoder.hh" +#include "avro/Specific.hh" + +namespace c { +struct cpx { + double re; + double im; +}; + +} +namespace avro { +template<> struct codec_traits { + static void encode(Encoder& e, const c::cpx& v) { + avro::encode(e, v.re); + avro::encode(e, v.im); + } + static void decode(Decoder& d, c::cpx& v) { + avro::decode(d, v.re); + avro::decode(d, v.im); + } +}; + +} + +int main() +{ + std::unique_ptr out = avro::memoryOutputStream(128); + avro::EncoderPtr e = avro::binaryEncoder(); + e->init(*out); + c::cpx c1; + c1.re = 1.0; + c1.im = 2.13; + avro::encode(*e, c1); + + std::unique_ptr in = avro::memoryInputStream(*out); + avro::DecoderPtr d = avro::binaryDecoder(); + d->init(*in); + + c::cpx c2{}; + avro::decode(*d, c2); + std::cout << '(' << c2.re << ", " << c2.im << ')' << std::endl; + return 0; +} diff --git a/recipes/libavrocpp/all/test_v1_package/CMakeLists.txt b/recipes/libavrocpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libavrocpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libavrocpp/all/test_v1_package/conanfile.py b/recipes/libavrocpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libavrocpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libavrocpp/config.yml b/recipes/libavrocpp/config.yml new file mode 100644 index 0000000000000..9fcb2d236146c --- /dev/null +++ b/recipes/libavrocpp/config.yml @@ -0,0 +1,9 @@ +versions: + 1.11.1: + folder: all + 1.11.0: + folder: all + 1.10.2: + folder: all + 1.10.1: + folder: all diff --git a/recipes/libb2/all/CMakeLists.txt b/recipes/libb2/all/CMakeLists.txt new file mode 100644 index 0000000000000..ba9b7e9e27948 --- /dev/null +++ b/recipes/libb2/all/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.4) +project(b2 C) + +include("conanbuildinfo.cmake") +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS AND MSVC) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +option(USE_SSE "Optimized for speed on CPUs supporting SSE2, SSSE3, SSE4.1, AVX, or XOP" OFF) +option(USE_NEON "Optimiced for arm CPUs" OFF) + +if (USE_NEON) + message(STATUS "Using neon sources") + set(SOURCE_FILES source_subfolder/neon/blake2b-neon.c + source_subfolder/neon/blake2bp.c + source_subfolder/neon/blake2s-neon.c + source_subfolder/neon/blake2xb.c + source_subfolder/neon/blake2sp.c + source_subfolder/neon/blake2xs.c) +elseif (USE_SSE) + message(STATUS "Using sse sources") + set(SOURCE_FILES source_subfolder/sse/blake2b.c + source_subfolder/sse/blake2bp.c + source_subfolder/sse/blake2s.c + source_subfolder/sse/blake2sp.c + source_subfolder/sse/blake2xb.c + source_subfolder/sse/blake2xs.c) +else () + message(STATUS "Using ref sources") + set(SOURCE_FILES source_subfolder/ref/blake2bp-ref.c + source_subfolder/ref/blake2b-ref.c + source_subfolder/ref/blake2sp-ref.c + source_subfolder/ref/blake2s-ref.c + source_subfolder/ref/blake2xb-ref.c + source_subfolder/ref/blake2xs-ref.c) +endif() + +add_library(${CMAKE_PROJECT_NAME} ${SOURCE_FILES}) +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER source_subfolder/ref/blake2.h) + +install(TARGETS ${CMAKE_PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libb2 + ) diff --git a/recipes/libb2/all/conandata.yml b/recipes/libb2/all/conandata.yml new file mode 100644 index 0000000000000..ff9b980cbfc48 --- /dev/null +++ b/recipes/libb2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20190723": + url: "https://github.com/BLAKE2/BLAKE2/archive/997fa5b.zip" + sha256: "56dafe9512f65728ce7abc78900272f8bf8e95ca04439b362d2dc461927b2a17" diff --git a/recipes/libb2/all/conanfile.py b/recipes/libb2/all/conanfile.py new file mode 100644 index 0000000000000..88ad67891d73b --- /dev/null +++ b/recipes/libb2/all/conanfile.py @@ -0,0 +1,65 @@ +import os +import glob +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration + +class libb2Conan(ConanFile): + name = "libb2" + license = ["CC0-1.0", "OpenSSL", "APSL-2.0"] + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/BLAKE2/BLAKE2" + description = ("libb2 is a library that implemets the BLAKE2 cryptographic hash function, which is faster than MD5, \ + SHA-1, SHA-2, and SHA-3, yet is at least as secure as the latest standard SHA-3") + settings = "os", "arch", "compiler", "build_type" + topics = ("conan", "blake2", "hash") + exports_sources = ["CMakeLists.txt"] + generators = ["cmake"] + options = {"fPIC": [True, False], "shared": [True, False], "use_sse": [True, False], "use_neon": [True, False]} + default_options = {"fPIC": True, "shared": False, "use_sse": False, "use_neon": False} + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.use_neon and not "arm" in self.settings.arch: + raise ConanInvalidConfiguration("Neon sources only supported on arm-based CPUs") + if self.options.use_neon and self.options.use_sse: + raise ConanInvalidConfiguration("Neon and SSE can not be used together.") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob("BLAKE2-*")[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["USE_SSE"] = self.options.use_sse + self._cmake.definitions["USE_NEON"] = self.options.use_neon + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs = ["include", os.path.join("include","libb2")] diff --git a/recipes/libb2/all/test_package/CMakeLists.txt b/recipes/libb2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6aab347eddf53 --- /dev/null +++ b/recipes/libb2/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/libb2/all/test_package/conanfile.py b/recipes/libb2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0383b1729b064 --- /dev/null +++ b/recipes/libb2/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class blake2TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libb2/all/test_package/example.cpp b/recipes/libb2/all/test_package/example.cpp new file mode 100644 index 0000000000000..9e3dcff163b4b --- /dev/null +++ b/recipes/libb2/all/test_package/example.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include + +int main() { + + const std::string input = "Conan"; + const std::string key = "C++"; + const std::string expected_hash = "aff48ebab1a2b9947c811248b52a157738159af3a2599993188fd3977d20c58e67a98636717e13b62b95183ff779abdb2dcad039599f5e54588d83a7b2fc3827"; + std::array output; + int result; // Zero if OK + + result = blake2(output.data(), output.size(), input.data(), input.size(), key.data(), key.size()); + + std::cout << "Hashing string: " << input.data() << std::endl; + std::cout << "Using key: " << key.data() << std::endl; + std::cout << "Expected hash: " << expected_hash.data() << std::endl; + + if (result != 0){ + std::cout << "Error during hashing"; + } else { + std::cout << "Computed hash: "; + std::cout << std::setfill('0') << std::hex; + for (auto byte : output) + std::cout << std::setw(2) << static_cast(byte); + std::cout << std::endl; + } +} diff --git a/recipes/libb2/config.yml b/recipes/libb2/config.yml new file mode 100644 index 0000000000000..dd4ab8c0b0b3b --- /dev/null +++ b/recipes/libb2/config.yml @@ -0,0 +1,3 @@ +versions: + "20190723": + folder: all diff --git a/recipes/libbacktrace/all/conandata.yml b/recipes/libbacktrace/all/conandata.yml new file mode 100644 index 0000000000000..56d79ce7402eb --- /dev/null +++ b/recipes/libbacktrace/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20210118": + url: "https://github.com/ianlancetaylor/libbacktrace/archive/dedbe13fda00253fe5d4f2fb812c909729ed5937.tar.gz" + sha256: "dc8c167f48f3de5ae318c528b26b72f300edb6e33744e55394674fd4b7cdd21d" +patches: + "cci.20210118": + - patch_file: "patches/0001-pointer-arithmetic.patch" + - patch_file: "patches/0002-msvc-unistd-alternative.patch" diff --git a/recipes/libbacktrace/all/conanfile.py b/recipes/libbacktrace/all/conanfile.py new file mode 100644 index 0000000000000..2fa71b8e36228 --- /dev/null +++ b/recipes/libbacktrace/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class LibbacktraceConan(ConanFile): + name = "libbacktrace" + description = "A C library that may be linked into a C/C++ program to produce symbolic backtraces." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ianlancetaylor/libbacktrace" + license = "BSD-3-Clause" + topics = ("backtrace", "stack-trace") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "180") + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("libbacktrace shared is not supported with Visual Studio") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + # https://github.com/conan-io/conan/issues/6514 + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper")) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + lib_folder = os.path.join(self.package_folder, "lib") + rm(self, "*.la", lib_folder) + fix_apple_shared_install_name(self) + if is_msvc(self): + rename(self, os.path.join(lib_folder, "libbacktrace.lib"), + os.path.join(lib_folder, "backtrace.lib")) + + def package_info(self): + self.cpp_info.libs = ["backtrace"] diff --git a/recipes/libbacktrace/all/patches/0001-pointer-arithmetic.patch b/recipes/libbacktrace/all/patches/0001-pointer-arithmetic.patch new file mode 100644 index 0000000000000..062c4cdb4f089 --- /dev/null +++ b/recipes/libbacktrace/all/patches/0001-pointer-arithmetic.patch @@ -0,0 +1,29 @@ +--- a/pecoff.c ++++ b/pecoff.c +@@ -648,7 +648,7 @@ coff_add (struct backtrace_state *state, int descriptor, + magic_ok = memcmp (magic, "PE\0", 4) == 0; + fhdr_off += 4; + +- memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr); ++ memcpy (&fhdr, (char *)fhdr_view.data + 4, sizeof fhdr); + } + else + { +@@ -682,7 +682,7 @@ coff_add (struct backtrace_state *state, int descriptor, + sects_view_valid = 1; + opt_hdr = (const b_coff_optional_header *) sects_view.data; + sects = (const b_coff_section_header *) +- (sects_view.data + fhdr.size_of_optional_header); ++ ((b_coff_optional_header *)sects_view.data + fhdr.size_of_optional_header); + + is_64 = 0; + if (fhdr.size_of_optional_header > sizeof (*opt_hdr)) +@@ -726,7 +726,7 @@ coff_add (struct backtrace_state *state, int descriptor, + goto fail; + syms_view_valid = 1; + +- str_size = coff_read4 (syms_view.data + syms_size); ++ str_size = coff_read4 ((const unsigned char *)((char *)syms_view.data + syms_size)); + + str_off = syms_off + syms_size; + diff --git a/recipes/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch b/recipes/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch new file mode 100644 index 0000000000000..988e538fc511d --- /dev/null +++ b/recipes/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch @@ -0,0 +1,54 @@ +--- a/allocfail.c ++++ b/allocfail.c +@@ -33,7 +33,6 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include +-#include + + #include "filenames.h" + +--- a/fileline.c ++++ b/fileline.c +@@ -37,7 +37,11 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++#else + #include ++#endif + + #if defined (HAVE_KERN_PROC_ARGS) || defined (HAVE_KERN_PROC) + #include +--- a/posix.c ++++ b/posix.c +@@ -36,7 +36,11 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++#else + #include ++#endif + + #include "backtrace.h" + #include "internal.h" +--- a/read.c ++++ b/read.c +@@ -35,7 +35,13 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++#include ++typedef SSIZE_T ssize_t; ++#else + #include ++#endif + + #include "backtrace.h" + #include "internal.h" diff --git a/recipes/libbacktrace/all/test_package/CMakeLists.txt b/recipes/libbacktrace/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..81b50a3407418 --- /dev/null +++ b/recipes/libbacktrace/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libbacktrace REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libbacktrace::libbacktrace) diff --git a/recipes/libbacktrace/all/test_package/conanfile.py b/recipes/libbacktrace/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libbacktrace/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libbacktrace/all/test_package/test_package.c b/recipes/libbacktrace/all/test_package/test_package.c new file mode 100644 index 0000000000000..c707f358d11f1 --- /dev/null +++ b/recipes/libbacktrace/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#include +#include + +#include +#include +#include + +void +error_callback(void* data, const char* msg, int errnum) +{ + fprintf(stderr, "%s", msg); + if (errnum > 0) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + exit(0); +} + +int +simple_callback(void* data, uintptr_t pc) +{ + printf(" 0x%016llx\n", pc); + return 1; +} + +int +main(int argc, char** argv) +{ + void* state; + + state = backtrace_create_state(argv[0], BACKTRACE_SUPPORTS_THREADS, error_callback, NULL); + printf("Top stack frame:\n"); + backtrace_simple(state, 0, simple_callback, error_callback, NULL); + printf("Done\n"); + + return 0; +} diff --git a/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt b/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libbacktrace/all/test_v1_package/conanfile.py b/recipes/libbacktrace/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e0a85886fc12c --- /dev/null +++ b/recipes/libbacktrace/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libbacktrace/config.yml b/recipes/libbacktrace/config.yml new file mode 100644 index 0000000000000..bc0e7ddecd921 --- /dev/null +++ b/recipes/libbacktrace/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210118": + folder: all diff --git a/recipes/libbasisu/all/CMakeLists.txt b/recipes/libbasisu/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd4164cb5c1c7 --- /dev/null +++ b/recipes/libbasisu/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libbasisu/all/conandata.yml b/recipes/libbasisu/all/conandata.yml new file mode 100644 index 0000000000000..7cca98d66479b --- /dev/null +++ b/recipes/libbasisu/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.15.0": + url: "https://github.com/BinomialLLC/basis_universal/archive/refs/tags/v1_15.tar.gz" + sha256: "1f8de889beb2b8d899320693b651a6b8b62a954a9b86962aaa41007ee2dbe02b" +patches: + "1.15.0": + - patch_file: "patches/cmakelist_build_lib.patch" + base_path: "source_subfolder" diff --git a/recipes/libbasisu/all/conanfile.py b/recipes/libbasisu/all/conanfile.py new file mode 100644 index 0000000000000..6dfaf4ee7f3de --- /dev/null +++ b/recipes/libbasisu/all/conanfile.py @@ -0,0 +1,114 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class LibBasisUniversalConan(ConanFile): + name = "libbasisu" + description = "Basis Universal Supercompressed GPU Texture Codec" + homepage = "https://github.com/BinomialLLC/basis_universal" + topics = ("conan", "basis", "textures", "compression") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + exports_sources = ["CMakeLists.txt", "patches/*"] + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "shared": [True, False], + "use_sse4": [True, False], + "with_zstd": [True, False], + "enable_encoder": [True, False], + "custom_iterator_debug_level": [True, False] + } + default_options = { + "fPIC": True, + "shared": False, + "use_sse4": False, + "with_zstd": True, + "enable_encoder": True, + "custom_iterator_debug_level": False + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _use_custom_iterator_debug_level(self): + return self.options.get_safe("custom_iterator_debug_level", default=self.default_options["custom_iterator_debug_level"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.compiler != "Visual Studio": + del self.options.custom_iterator_debug_level + + def _minimum_compiler_version(self) -> bool: + return { + "Visual Studio": "15", + "gcc": "5.4", + "clang": "3.9", + "apple-clang": "10" + } + + def validate(self): + min_version = self._minimum_compiler_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("{} {} does not support compiler with version {} {}, minimum supported compiler version is {} ".format(self.name, self.version, self.settings.compiler, self.settings.compiler.version, min_version)) + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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["SSE4"] = self.options.use_sse4 + self._cmake.definitions["ZSTD"] = self.options.with_zstd + self._cmake.definitions["ENABLE_ENCODER"] = self.options.enable_encoder + self._cmake.definitions["NO_ITERATOR_DEBUG_LEVEL"] = not self._use_custom_iterator_debug_level() + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst=os.path.join("include", self.name, "transcoder"), src=os.path.join(self._source_subfolder, "transcoder")) + if self.options.enable_encoder: + self.copy("*.h", dst=os.path.join("include", self.name, "encoder"), src=os.path.join(self._source_subfolder, "encoder")) + self.copy(pattern="*.a", dst="lib", keep_path=False) + self.copy(pattern="*.so", dst="lib", keep_path=False) + self.copy(pattern="*.dylib*", dst="lib", keep_path=False) + self.copy(pattern="*.lib", dst="lib", keep_path=False) + self.copy(pattern="*.dll", dst="bin", keep_path=False) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.names["cmake_find_package"] = self.name + self.cpp_info.names["cmake_find_package_multi"] = self.name + self.cpp_info.includedirs = ["include", os.path.join("include", self.name)] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m", "pthread"] + self.cpp_info.defines.append("BASISU_NO_ITERATOR_DEBUG_LEVEL={}".format("1" if self._use_custom_iterator_debug_level() else "0")) diff --git a/recipes/libbasisu/all/patches/cmakelist_build_lib.patch b/recipes/libbasisu/all/patches/cmakelist_build_lib.patch new file mode 100644 index 0000000000000..043a9778c605d --- /dev/null +++ b/recipes/libbasisu/all/patches/cmakelist_build_lib.patch @@ -0,0 +1,205 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,39 +1,11 @@ +-project(basisu) +- + cmake_minimum_required(VERSION 3.0) +-option(BUILD_X64 "build 64-bit" TRUE) +-option(STATIC "static linking" FALSE) +-option(SSE "SSE 4.1 support" FALSE) +-option(ZSTD "ZSTD support for KTX2 transcoding/encoding" TRUE) + +-message("Initial BUILD_X64=${BUILD_X64}") +-message("Initial CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") +-message("Initial SSE=${SSE}") +-message("Initial ZSTD=${ZSTD}") +- +-if( NOT CMAKE_BUILD_TYPE ) +- set( CMAKE_BUILD_TYPE Release ) +-endif() ++project(basisu VERSION 1.15.0 LANGUAGES CXX) + +-message( ${PROJECT_NAME} " build type: " ${CMAKE_BUILD_TYPE} ) +- +-if (BUILD_X64) +- message("Building 64-bit") +-else() +- message("Building 32-bit") +-endif() +- +-if (SSE) +- message("SSE enabled") +-else() +- message("SSE disabled") +-endif() +- +-if (ZSTD) +- message("Zstandard enabled") +-else() +- message("Zstandard disabled") +-endif() ++option(SSE4 "SSE4 4.1 support" FALSE) ++option(ZSTD "ZSTD support for KTX2 transcoding/encoding" TRUE) ++option(NO_ITERATOR_DEBUG_LEVEL "Change Iterator debug level" FALSE) ++option(ENABLE_ENCODER "Build also encoder part of basisu library" TRUE) + + if (NOT MSVC) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") +@@ -42,38 +14,24 @@ if (NOT MSVC) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + +- set(CMAKE_CXX_FLAGS -std=c++11) +- set(GCC_COMPILE_FLAGS "-fvisibility=hidden -fPIC -fno-strict-aliasing -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wno-unused-local-typedefs -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable") +- +- if (NOT BUILD_X64) +- set(GCC_COMPILE_FLAGS "${GCC_COMPILE_FLAGS} -m32") +- endif() ++ set(GCC_COMPILE_FLAGS "-fPIC -fno-strict-aliasing -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wno-unused-local-typedefs -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable") + +- if (EMSCRIPTEN) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -DBASISU_SUPPORT_SSE=0") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -DBASISU_SUPPORT_SSE=0") +- +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS}") +- elseif (STATIC) +- if (SSE) ++ if (NOT BUILD_SHARED_LIBS) ++ if (SSE4) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=1 -msse4.1") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=1 -msse4.1") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=0") +- endif() +- +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -static-libgcc -static-libstdc++ -static") ++ endif() + else() +- if (SSE) ++ if (SSE4) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=1 -msse4.1") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=1 -msse4.1") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=0") +- endif() +- +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -Wl,-rpath .") ++ endif() + endif() + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COMPILE_FLAGS}") +@@ -84,7 +42,7 @@ if (NOT MSVC) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GCC_COMPILE_FLAGS}") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GCC_COMPILE_FLAGS} -D_DEBUG") + else() +- if (SSE) ++ if (SSE4) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=1") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=1") + else() +@@ -93,64 +51,57 @@ else() + endif() + endif() + +-set(BASISU_SRC_LIST ${COMMON_SRC_LIST} +- basisu_tool.cpp +- encoder/basisu_backend.cpp +- encoder/basisu_basis_file.cpp +- encoder/basisu_comp.cpp +- encoder/basisu_enc.cpp +- encoder/basisu_etc.cpp +- encoder/basisu_frontend.cpp +- encoder/basisu_global_selector_palette_helpers.cpp +- encoder/basisu_gpu_texture.cpp +- encoder/basisu_pvrtc1_4.cpp +- encoder/basisu_resampler.cpp +- encoder/basisu_resample_filters.cpp +- encoder/basisu_ssim.cpp +- encoder/basisu_astc_decomp.cpp +- encoder/basisu_uastc_enc.cpp +- encoder/basisu_bc7enc.cpp +- encoder/lodepng.cpp +- encoder/apg_bmp.c +- encoder/jpgd.cpp +- encoder/basisu_kernels_sse.cpp +- transcoder/basisu_transcoder.cpp ++set(BASISU_SRC_LIST ${COMMON_SRC_LIST} transcoder/basisu_transcoder.cpp) ++ ++if (ENABLE_ENCODER) ++ set(BASISU_SRC_LIST ${BASISU_SRC_LIST} ++ encoder/basisu_backend.cpp ++ encoder/basisu_basis_file.cpp ++ encoder/basisu_comp.cpp ++ encoder/basisu_enc.cpp ++ encoder/basisu_etc.cpp ++ encoder/basisu_frontend.cpp ++ encoder/basisu_global_selector_palette_helpers.cpp ++ encoder/basisu_gpu_texture.cpp ++ encoder/basisu_pvrtc1_4.cpp ++ encoder/basisu_resampler.cpp ++ encoder/basisu_resample_filters.cpp ++ encoder/basisu_ssim.cpp ++ encoder/basisu_astc_decomp.cpp ++ encoder/basisu_uastc_enc.cpp ++ encoder/basisu_bc7enc.cpp ++ encoder/lodepng.cpp ++ encoder/apg_bmp.c ++ encoder/jpgd.cpp ++ encoder/basisu_kernels_sse.cpp + ) ++endif() + + if (ZSTD) + set(BASISU_SRC_LIST ${BASISU_SRC_LIST} zstd/zstd.c) + endif() + +-if (APPLE) +- set(BIN_DIRECTORY "bin_osx") ++add_library(${PROJECT_NAME} ${BASISU_SRC_LIST}) ++ ++if (NO_ITERATOR_DEBUG_LEVEL) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE BASISU_NO_ITERATOR_DEBUG_LEVEL=1) + else() +- set(BIN_DIRECTORY "bin") ++ target_compile_definitions(${PROJECT_NAME} PRIVATE BASISU_NO_ITERATOR_DEBUG_LEVEL=0) + endif() + +-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${BIN_DIRECTORY}) +- +-add_executable(basisu ${BASISU_SRC_LIST}) +- + if (ZSTD) +- target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1) + else() +- target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0) + endif() + +-if (NOT MSVC) +- target_link_libraries(basisu m pthread) ++if (WIN32) ++ set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) ++else() ++ set(THREADS_PREFER_PTHREAD_FLAG ON) ++ find_package(Threads REQUIRED) ++ target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads m) + endif() + +-if (NOT EMSCRIPTEN) +- install(TARGETS basisu DESTINATION bin) +- +- if (UNIX) +- if (CMAKE_BUILD_TYPE STREQUAL Release) +- if (APPLE) +- add_custom_command(TARGET basisu POST_BUILD COMMAND strip -X -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/basisu) +- else() +- add_custom_command(TARGET basisu POST_BUILD COMMAND strip -g -X -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/basisu) +- endif() +- endif() +- endif() +-endif() ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) ++set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF) diff --git a/recipes/libbasisu/all/test_package/CMakeLists.txt b/recipes/libbasisu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2adca01f3e68a --- /dev/null +++ b/recipes/libbasisu/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::libbasisu) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/libbasisu/all/test_package/conanfile.py b/recipes/libbasisu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..12dd810a6ab3b --- /dev/null +++ b/recipes/libbasisu/all/test_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" + + 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/libbasisu/all/test_package/test_package.cpp b/recipes/libbasisu/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..15a9d4d02650c --- /dev/null +++ b/recipes/libbasisu/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() { + basist::basisu_transcoder_init(); + std::cout << "Basisu successfuly initialized, format localized: " + << basist::basis_get_format_name(basist::transcoder_texture_format::cTFETC2_RGBA) + << std::endl; + return 0; +} diff --git a/recipes/libbasisu/config.yml b/recipes/libbasisu/config.yml new file mode 100644 index 0000000000000..d268f882f43e4 --- /dev/null +++ b/recipes/libbasisu/config.yml @@ -0,0 +1,3 @@ +versions: + "1.15.0": + folder: all diff --git a/recipes/libbigwig/all/conandata.yml b/recipes/libbigwig/all/conandata.yml new file mode 100644 index 0000000000000..e1b88454d66c1 --- /dev/null +++ b/recipes/libbigwig/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.7": + sha256: 8e057797011d93fa00e756600898af4fe6ca2d48959236efc9f296abe94916d9 + url: https://github.com/dpryan79/libBigWig/archive/refs/tags/0.4.7.tar.gz diff --git a/recipes/libbigwig/all/conanfile.py b/recipes/libbigwig/all/conanfile.py new file mode 100644 index 0000000000000..0f28a5364da62 --- /dev/null +++ b/recipes/libbigwig/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +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 + +required_conan_version = ">=1.53.0" + + +class LibBigWigConan(ConanFile): + name = "libbigwig" + description = "A C library for handling bigWig files" + topics = ("bioinformatics", "bigwig", "bigbed") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dpryan79/libBigWig" + license = "MIT" + package_type = "library" + settings = "arch", "build_type", "compiler", "os" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_curl": [True, False], + "with_zlibng": [True, False] + } + + default_options = { + "shared": False, + "fPIC": True, + "with_curl": True, + "with_zlibng": False + } + + 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_curl: + # transitive_headers=True is required due to includes in bigWigIO.h + # https://github.com/dpryan79/libBigWig/blob/master/bigWigIO.h#L5 + self.requires("libcurl/8.0.1", transitive_headers=True) + if self.options.with_zlibng: + self.requires("zlib-ng/2.0.7") + else: + self.requires("zlib/1.2.13") + + def validate(self): + if self.info.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows.") + + if self.info.options.with_zlibng: + zlib_ng = self.dependencies["zlib-ng"] + if not zlib_ng.options.zlib_compat: + raise ConanInvalidConfiguration(f"{self.ref} requires the dependency option zlib-ng:zlib_compat=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTING"] = False + tc.variables["WITH_CURL"] = self.options.with_curl + tc.variables["WITH_ZLIBNG"] = self.options.with_zlibng + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" # honor BUILD_SHARED_LIBS + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "BigWig") + self.cpp_info.set_property("cmake_target_name", "BigWig::BigWig") + self.cpp_info.libs = ["BigWig"] + self.cpp_info.system_libs = ["m"] + + + if not self.options.with_curl: + self.cpp_info.defines = ["NOCURL"] + + # TODO: Remove in Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "BigWig" + self.cpp_info.names["cmake_find_package_multi"] = "BigWig" diff --git a/recipes/libbigwig/all/test_package/CMakeLists.txt b/recipes/libbigwig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fae2a97e9d90d --- /dev/null +++ b/recipes/libbigwig/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(BigWig REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BigWig::BigWig) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/libbigwig/all/test_package/conanfile.py b/recipes/libbigwig/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c76c01456ca00 --- /dev/null +++ b/recipes/libbigwig/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 = "arch", "build_type", "compiler", "os" + 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/libbigwig/all/test_package/test_package.c b/recipes/libbigwig/all/test_package/test_package.c new file mode 100644 index 0000000000000..7bf2175d15e63 --- /dev/null +++ b/recipes/libbigwig/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include "libbigwig/bigWig.h" + + +int main(void) { + bigWigFile_t *fp = NULL; + + bwInit(1<<17); + fp = bwOpen("test_package.bw", NULL, "w"); + bwCreateHdr(fp, 10); + bwClose(fp); + bwCleanup(); + + return EXIT_SUCCESS; +} diff --git a/recipes/libbigwig/all/test_v1_package/CMakeLists.txt b/recipes/libbigwig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..70375bb9b607e --- /dev/null +++ b/recipes/libbigwig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(BigWig REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BigWig::BigWig) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/libbigwig/all/test_v1_package/conanfile.py b/recipes/libbigwig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e8dacc213db5b --- /dev/null +++ b/recipes/libbigwig/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import CMake, ConanFile + + +class TestPackageConan(ConanFile): + settings = "arch", "build_type", "compiler", "os" + 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/libbigwig/config.yml b/recipes/libbigwig/config.yml new file mode 100644 index 0000000000000..0435ca37310c1 --- /dev/null +++ b/recipes/libbigwig/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.7": + folder: all diff --git a/recipes/libbpf/all/conandata.yml b/recipes/libbpf/all/conandata.yml new file mode 100644 index 0000000000000..dced81ebf510c --- /dev/null +++ b/recipes/libbpf/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.7.0": + url: "https://github.com/libbpf/libbpf/archive/refs/tags/v0.7.0.tar.gz" + sha256: "5083588ce5a3a620e395ee1e596af77b4ec5771ffc71cff2af49dfee38c06361" + "0.5.0": + url: "https://github.com/libbpf/libbpf/archive/v0.5.0.tar.gz" + sha256: "d5b27980ceab9a80b6f28d3e67b51cea526fda49bd13151ba966e33548feb4f4" + "0.4.0": + url: "https://github.com/libbpf/libbpf/archive/refs/tags/v0.4.0.tar.gz" + sha256: "21cbee4df093e7fd29e76ed429650d3f3abe3a893f35e346ab9bc3484f6e68c0" diff --git a/recipes/libbpf/all/conanfile.py b/recipes/libbpf/all/conanfile.py new file mode 100644 index 0000000000000..fcb6be22798a8 --- /dev/null +++ b/recipes/libbpf/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.54.0" + +class LibbpfConan(ConanFile): + name = "libbpf" + description = "eBPF helper library" + license = "LGPL-2.1-only", "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libbpf/libbpf" + topics = ("berkeley-packet-filter", "bpf", "ebpf", "network", "tracing") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("linux-headers-generic/5.14.9") + self.requires("libelf/0.8.13") + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is only available on Linux") + + def build_requirements(self): + self.tool_requires("make/4.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.make_args.extend([ + "PREFIX={}".format(""), + "DESTDIR={}".format(self.package_folder), + "LIBSUBDIR={}".format("lib"), + ]) + if not self.options.shared: + tc.configure_args.append("BUILD_STATIC_ONLY={}".format(1)) + tc.generate() + + pkgdeps = PkgConfigDeps(self) + pkgdeps.generate() + + autotoolsdeps = AutotoolsDeps(self) + autotoolsdeps.generate() + + def build(self): + with chdir(self, os.path.join(self.source_folder, "src")): + autotools = Autotools(self) + autotools.make() + + def package(self): + copy(self, pattern="LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, os.path.join(self.source_folder, "src")): + autotools = Autotools(self) + autotools.install() + + if self.options.shared: + rm(self, "libbpf.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "libbpf.so*", os.path.join(self.package_folder, "lib")) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libbpf" + self.cpp_info.libs = ["bpf"] diff --git a/recipes/libbpf/all/test_package/CMakeLists.txt b/recipes/libbpf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1edce78120390 --- /dev/null +++ b/recipes/libbpf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libbpf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libbpf::libbpf) diff --git a/recipes/libbpf/all/test_package/conanfile.py b/recipes/libbpf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/libbpf/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/libbpf/all/test_package/test_package.c b/recipes/libbpf/all/test_package/test_package.c new file mode 100644 index 0000000000000..01f2adac98de4 --- /dev/null +++ b/recipes/libbpf/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "bpf/libbpf.h" + +int main(int argc, char** argv) +{ + const char buffer[1] = { '\0' }; + struct bpf_object* obj = bpf_object__open_mem(buffer, 1, NULL); + bpf_object__close(obj); + return 0; +} diff --git a/recipes/libbpf/all/test_v1_package/CMakeLists.txt b/recipes/libbpf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/libbpf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libbpf/all/test_v1_package/conanfile.py b/recipes/libbpf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/libbpf/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libbpf/config.yml b/recipes/libbpf/config.yml new file mode 100644 index 0000000000000..4383f9baf5229 --- /dev/null +++ b/recipes/libbpf/config.yml @@ -0,0 +1,7 @@ +versions: + "0.7.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/libbsd/all/conandata.yml b/recipes/libbsd/all/conandata.yml new file mode 100644 index 0000000000000..5c7d8675d858e --- /dev/null +++ b/recipes/libbsd/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.10.0": + url: "https://libbsd.freedesktop.org/releases/libbsd-0.10.0.tar.xz" + sha256: "34b8adc726883d0e85b3118fa13605e179a62b31ba51f676136ecb2d0bc1a887" +patches: + "0.10.0": + - patch_file: "patches/0001-support-macosx.patch" + patch_description: "Enables building on MacOS" + patch_type: "portability" + patch_source: "https://github.com/NixOS/nixpkgs/blob/1016bfcff1df163aff75d908df1e00f897a29b9b/pkgs/development/libraries/libbsd/darwin.patch" diff --git a/recipes/libbsd/all/conanfile.py b/recipes/libbsd/all/conanfile.py new file mode 100644 index 0000000000000..468a858c4a3dc --- /dev/null +++ b/recipes/libbsd/all/conanfile.py @@ -0,0 +1,100 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + +class LibBsdConan(ConanFile): + name = "libbsd" + description = "This library provides useful functions commonly found on BSD systems, and lacking on others like GNU systems, " \ + "thus making it easier to port projects with strong BSD origins, without needing to embed the same code over and over again on each project." + topics = ("conan", "libbsd", "useful", "functions", "bsd", "GNU") + license = ("ISC", "MIT", "Beerware", "BSD-2-clause", "BSD-3-clause", "BSD-4-clause") + homepage = "https://libbsd.freedesktop.org/wiki/" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + if is_apple_os(self): + tc.extra_cflags.append("-Wno-error=implicit-function-declaration") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if not is_apple_os(self) and self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is only available for GNU-like operating systems (e.g. Linux)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + os.unlink(os.path.join(os.path.join(self.package_folder, "lib", "libbsd.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) + + def package_info(self): + self.cpp_info.components["bsd"].libs = ["bsd"] + self.cpp_info.components["bsd"].set_property("pkg_config_name", "libbsd") + + self.cpp_info.components["libbsd-overlay"].libs = [] + self.cpp_info.components["libbsd-overlay"].requires = ["bsd"] + self.cpp_info.components["libbsd-overlay"].includedirs.append(os.path.join("include", "bsd")) + self.cpp_info.components["libbsd-overlay"].defines = ["LIBBSD_OVERLAY"] + self.cpp_info.components["libbsd-overlay"].set_property("pkg_config_name", "libbsd-overlay") + + # on apple-clang, GNU .init_array section is not supported + if self.settings.compiler != "apple-clang": + self.cpp_info.components["libbsd-ctor"].libs = ["bsd-ctor"] + self.cpp_info.components["libbsd-ctor"].requires = ["bsd"] + if self.settings.os == "Linux": + self.cpp_info.components["libbsd-ctor"].exelinkflags = ["-Wl,-z,nodlopen", "-Wl,-u,libbsd_init_func"] + self.cpp_info.components["libbsd-ctor"].sharedlinkflags = ["-Wl,-z,nodlopen", "-Wl,-u,libbsd_init_func"] + self.cpp_info.components["libbsd-ctor"].set_property("pkg_config_name", "libbsd-ctor") + diff --git a/recipes/libbsd/all/patches/0001-support-macosx.patch b/recipes/libbsd/all/patches/0001-support-macosx.patch new file mode 100644 index 0000000000000..87ba280b57a51 --- /dev/null +++ b/recipes/libbsd/all/patches/0001-support-macosx.patch @@ -0,0 +1,456 @@ +https://gitlab.freedesktop.org/libbsd/libbsd/-/merge_requests/3 + +diff --git a/configure.ac b/configure.ac +index 6e9496d5775742d68d38ebfb4bead730bb0e1fe1..60b6e4cc0eaeb86dd7132f9410a929dc59c6637b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -44,6 +44,8 @@ AC_SUBST([TESTU01_LIBS]) + AM_CONDITIONAL([HAVE_LIBTESTU01], + [test "x$ac_cv_lib_testu01_unif01_CreateExternGenBits" = "xyes"]) + ++AX_CHECK_VSCRIPT ++ + is_windows=no + AS_CASE([$host_os], + [*-gnu*], [ +@@ -68,7 +70,7 @@ AS_CASE([$host_os], + AM_CONDITIONAL([OS_WINDOWS], [test "x$is_windows" = "xyes"]) + + # Checks for header files. +-AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h grp.h]) ++AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h grp.h nlist.h]) + + # Checks for typedefs, structures, and compiler characteristics. + AC_C_INLINE +@@ -169,7 +171,8 @@ AC_LINK_IFELSE( + + AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \ + getauxval getentropy getexecname getline \ +- pstat_getproc sysconf]) ++ pstat_getproc sysconf \ ++ strlcpy strlcat strnstr strmode fpurge]) + AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"]) + + AC_CONFIG_FILES([ +diff --git a/include/bsd/string.h b/include/bsd/string.h +index f987fee3ed3c6c2ad0e5ec9aba1fcb2897a45f9f..a1e17ed2a1c2f9340450ae6a2e7c6130b658bdb9 100644 +--- a/include/bsd/string.h ++++ b/include/bsd/string.h +@@ -41,10 +41,21 @@ + #include + + __BEGIN_DECLS ++#if !HAVE_STRLCPY + size_t strlcpy(char *dst, const char *src, size_t siz); ++#endif ++ ++#if !HAVE_STRLCAT + size_t strlcat(char *dst, const char *src, size_t siz); ++#endif ++ ++#if !HAVE_STRNSTR + char *strnstr(const char *str, const char *find, size_t str_len); ++#endif ++ ++#if !HAVE_STRMODE + void strmode(mode_t mode, char *str); ++#endif + + #if !defined(__GLIBC__) || \ + (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE))) +diff --git a/m4/ax_check_vscript.m4 b/m4/ax_check_vscript.m4 +new file mode 100644 +index 0000000000000000000000000000000000000000..9851f322551e959b98385668220056959c386ad9 +--- /dev/null ++++ b/m4/ax_check_vscript.m4 +@@ -0,0 +1,142 @@ ++# =========================================================================== ++# https://www.gnu.org/software/autoconf-archive/ax_check_vscript.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CHECK_VSCRIPT ++# ++# DESCRIPTION ++# ++# Check whether the linker supports version scripts. Version scripts are ++# used when building shared libraries to bind symbols to version nodes ++# (helping to detect incompatibilities) or to limit the visibility of ++# non-public symbols. ++# ++# Output: ++# ++# If version scripts are supported, VSCRIPT_LDFLAGS will contain the ++# appropriate flag to pass to the linker. On GNU systems this would ++# typically be "-Wl,--version-script", and on Solaris it would typically ++# be "-Wl,-M". ++# ++# Two Automake conditionals are also set: ++# ++# HAVE_VSCRIPT is true if the linker supports version scripts with ++# entries that use simple wildcards, like "local: *". ++# ++# HAVE_VSCRIPT_COMPLEX is true if the linker supports version scripts with ++# pattern matching wildcards, like "global: Java_*". ++# ++# On systems that do not support symbol versioning, such as Mac OS X, both ++# conditionals will be false. They will also be false if the user passes ++# "--disable-symvers" on the configure command line. ++# ++# Example: ++# ++# configure.ac: ++# ++# AX_CHECK_VSCRIPT ++# ++# Makefile.am: ++# ++# if HAVE_VSCRIPT ++# libfoo_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libfoo.map ++# endif ++# ++# if HAVE_VSCRIPT_COMPLEX ++# libbar_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbar.map ++# endif ++# ++# LICENSE ++# ++# Copyright (c) 2014 Kevin Cernekee ++# ++# Copying and distribution of this file, with or without modification, are ++# permitted in any medium without royalty provided the copyright notice ++# and this notice are preserved. This file is offered as-is, without any ++# warranty. ++ ++#serial 2 ++ ++# _AX_CHECK_VSCRIPT(flag, global-sym, action-if-link-succeeds, [junk-file=no]) ++AC_DEFUN([_AX_CHECK_VSCRIPT], [ ++ AC_LANG_PUSH([C]) ++ ax_check_vscript_save_flags="$LDFLAGS" ++ echo "V1 { global: $2; local: *; };" > conftest.map ++ AS_IF([test x$4 = xyes], [ ++ echo "{" >> conftest.map ++ ]) ++ LDFLAGS="$LDFLAGS -Wl,$1,conftest.map" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[int show, hide;]], [])], [$3]) ++ LDFLAGS="$ax_check_vscript_save_flags" ++ rm -f conftest.map ++ AC_LANG_POP([C]) ++]) dnl _AX_CHECK_VSCRIPT ++ ++AC_DEFUN([AX_CHECK_VSCRIPT], [ ++ ++ AC_ARG_ENABLE([symvers], ++ AS_HELP_STRING([--disable-symvers], ++ [disable library symbol versioning [default=auto]]), ++ [want_symvers=$enableval], ++ [want_symvers=yes] ++ ) ++ ++ AS_IF([test x$want_symvers = xyes], [ ++ ++ dnl First test --version-script and -M with a simple wildcard. ++ ++ AC_CACHE_CHECK([linker version script flag], ax_cv_check_vscript_flag, [ ++ ax_cv_check_vscript_flag=unsupported ++ _AX_CHECK_VSCRIPT([--version-script], [show], [ ++ ax_cv_check_vscript_flag=--version-script ++ ]) ++ AS_IF([test x$ax_cv_check_vscript_flag = xunsupported], [ ++ _AX_CHECK_VSCRIPT([-M], [show], [ax_cv_check_vscript_flag=-M]) ++ ]) ++ ++ dnl The linker may interpret -M (no argument) as "produce a load map." ++ dnl If "-M conftest.map" doesn't fail when conftest.map contains ++ dnl obvious syntax errors, assume this is the case. ++ ++ AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [ ++ _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [show], ++ [ax_cv_check_vscript_flag=unsupported], [yes]) ++ ]) ++ ]) ++ ++ dnl If the simple wildcard worked, retest with a complex wildcard. ++ ++ AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [ ++ ax_check_vscript_flag=$ax_cv_check_vscript_flag ++ AC_CACHE_CHECK([if version scripts can use complex wildcards], ++ ax_cv_check_vscript_complex_wildcards, [ ++ ax_cv_check_vscript_complex_wildcards=no ++ _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [sh*], [ ++ ax_cv_check_vscript_complex_wildcards=yes]) ++ ]) ++ ax_check_vscript_complex_wildcards="$ax_cv_check_vscript_complex_wildcards" ++ ], [ ++ ax_check_vscript_flag= ++ ax_check_vscript_complex_wildcards=no ++ ]) ++ ], [ ++ AC_MSG_CHECKING([linker version script flag]) ++ AC_MSG_RESULT([disabled]) ++ ++ ax_check_vscript_flag= ++ ax_check_vscript_complex_wildcards=no ++ ]) ++ ++ AS_IF([test x$ax_check_vscript_flag != x], [ ++ VSCRIPT_LDFLAGS="-Wl,$ax_check_vscript_flag" ++ AC_SUBST([VSCRIPT_LDFLAGS]) ++ ]) ++ ++ AM_CONDITIONAL([HAVE_VSCRIPT], ++ [test x$ax_check_vscript_flag != x]) ++ AM_CONDITIONAL([HAVE_VSCRIPT_COMPLEX], ++ [test x$ax_check_vscript_complex_wildcards = xyes]) ++ ++]) dnl AX_CHECK_VSCRIPT +diff --git a/src/Makefile.am b/src/Makefile.am +index 8384b92ce57a206a9f59e44a3cd748d8ee93c004..e2c8e15095d9bdf46e134f9553e2f03a00afe0ad 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -65,8 +65,11 @@ libbsd_la_LIBADD = \ + $(ARC4RANDOM_ATFORK_LIBS) \ + $(nil) + libbsd_la_LDFLAGS = \ +- -Wl,--version-script=$(srcdir)/libbsd.map \ + -version-number $(LIBBSD_ABI) ++if HAVE_VSCRIPT ++libbsd_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbsd.map ++endif ++ + libbsd_la_SOURCES = \ + arc4random.c \ + arc4random.h \ +diff --git a/src/fpurge.c b/src/fpurge.c +index 462535ab506d6f72785986ee053e8606421c0ecc..a8941dbc3214fbe8eea3fd32c0889c2c9dfa1746 100644 +--- a/src/fpurge.c ++++ b/src/fpurge.c +@@ -26,9 +26,10 @@ + + #include + #include +-#include + + #ifdef HAVE___FPURGE ++#include ++ + int + fpurge(FILE *fp) + { +@@ -41,6 +42,36 @@ fpurge(FILE *fp) + + return 0; + } ++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */ ++#elif HAVE_FPURGE ++int ++fpurge(FILE *fp) ++{ ++ if (fp == NULL || fileno(fp) < 0) { ++ errno = EBADF; ++ return EOF; ++ } ++ ++ /* Call the system's fpurge function. */ ++#undef fpurge ++#if !HAVE_DECL_FPURGE ++ extern int fpurge (FILE *); ++#endif ++ int result = fpurge (fp); ++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ ++#if defined(__sferror) || defined(__DragonFly__) ++ if (result == 0) ++ /* Correct the invariants that fpurge broke. ++ on BSD systems says: ++ "The following always hold: if _flags & __SRD, _w is 0." ++ If this invariant is not fulfilled and the stream is read-write but ++ currently reading, subsequent putc or fputc calls will write directly ++ into the buffer, although they shouldn't be allowed to. */ ++ if ((fp->_flags & __SRD) != 0) ++ fp->_w = 0; ++#endif ++ return result; ++} + #else + #error "Function fpurge() needs to be ported." + #endif +diff --git a/src/funopen.c b/src/funopen.c +index 1e05c7e75188b14974d30ce8f6b74d67d44541b7..65ba5a8d1b60cb8d95200212ccec44b123f4a6c2 100644 +--- a/src/funopen.c ++++ b/src/funopen.c +@@ -143,6 +143,7 @@ funopen(const void *cookie, + * they will not add the needed support to implement it. Just ignore this + * interface there, as it has never been provided anyway. + */ ++#elif defined(__MACH__) + #else + #error "Function funopen() needs to be ported or disabled." + #endif +diff --git a/src/hash/sha512.h b/src/hash/sha512.h +index 4f368a14bb68790662f7587d1c269001978f31ea..7632e25ad2cf8c40e9338d9babfbcdf3ba0822d3 100644 +--- a/src/hash/sha512.h ++++ b/src/hash/sha512.h +@@ -29,7 +29,11 @@ + #ifndef _SHA512_H_ + #define _SHA512_H_ + ++#ifdef __MACH__ ++#include ++#else + #include ++#endif + + #define SHA512_DIGEST_LENGTH 64 + +diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c +index b3c8d5e75ed95cca24be2ed999bd70c76bf2d5a9..602f54e339870ad6215075949de9b517164bc4af 100644 +--- a/src/hash/sha512c.c ++++ b/src/hash/sha512c.c +@@ -25,7 +25,12 @@ + */ + + #include ++ ++#ifdef __MACH__ ++#include ++#else + #include ++#endif + #include + + #include +diff --git a/src/local-link.h b/src/local-link.h +index 0d4351a3cb6ff7d8bd5a76b2222b37470b21b70b..fc520af61fbfa888f45d168666d5b33e1c8a13d2 100644 +--- a/src/local-link.h ++++ b/src/local-link.h +@@ -27,6 +27,11 @@ + #ifndef LIBBSD_LOCAL_LINK_H + #define LIBBSD_LOCAL_LINK_H + ++#ifdef __MACH__ ++#define libbsd_link_warning(symbol, msg) ++#define libbsd_symver_default(alias, symbol, version) ++#define libbsd_symver_variant(alias, symbol, version) ++#else + #define libbsd_link_warning(symbol, msg) \ + static const char libbsd_emit_link_warning_##symbol[] \ + __attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg; +@@ -45,3 +50,4 @@ + #endif + + #endif ++#endif +diff --git a/src/nlist.c b/src/nlist.c +index 228c220973bdc9bde20ae2e5827d868e56a9a70e..46c2d779cf7f028739b80ca8eccac37c02a522c9 100644 +--- a/src/nlist.c ++++ b/src/nlist.c +@@ -41,6 +41,7 @@ + #include + #include + ++#if !HAVE_NLIST_H + #include "local-elf.h" + + #define SIZE_T_MAX 0xffffffffU +@@ -280,3 +281,4 @@ nlist(const char *name, struct nlist *list) + (void)close(fd); + return (n); + } ++#endif +diff --git a/src/readpassphrase.c b/src/readpassphrase.c +index f9f61950d17436f5550c2426701e5d22557eb642..2bc5fb4bca42dc650c13c1f2a8e98373349222aa 100644 +--- a/src/readpassphrase.c ++++ b/src/readpassphrase.c +@@ -36,6 +36,14 @@ + #define TCSASOFT 0 + #endif + ++#ifndef _SIGMAX ++#define _SIGMAX 64 ++#endif ++ ++#ifndef _NSIG ++#define _NSIG (_SIGMAX + 1) ++#endif ++ + static volatile sig_atomic_t signo[_NSIG]; + + static void handler(int); +diff --git a/src/setproctitle.c b/src/setproctitle.c +index ff32aa3a08a31563198cb7651cd5e665bafeee34..51ed833b68ba550614ccea4711c8bb3c292b5531 100644 +--- a/src/setproctitle.c ++++ b/src/setproctitle.c +@@ -33,6 +33,10 @@ + #include + #include "local-link.h" + ++#ifdef __MACH__ ++extern char **environ; ++#endif ++ + static struct { + /* Original value. */ + const char *arg0; +@@ -287,7 +291,8 @@ libbsd_symver_default(setproctitle, setproctitle_impl, LIBBSD_0.5); + * in 0.5, make the implementation available in the old version as an alias + * for code linking against that version, and change the default to use the + * new version, so that new code depends on the implemented version. */ +-#ifdef HAVE_TYPEOF ++#ifdef __MACH__ ++#elif defined(HAVE_TYPEOF) + extern __typeof__(setproctitle_impl) + setproctitle_stub + __attribute__((__alias__("setproctitle_impl"))); +diff --git a/src/strlcat.c b/src/strlcat.c +index 14c53a1f69c2fd43b66f504b6682383f5542a86d..5961c17ace0d1de875de5d3751e6d7dcc724d8ca 100644 +--- a/src/strlcat.c ++++ b/src/strlcat.c +@@ -26,6 +26,7 @@ + * Returns strlen(src) + MIN(dsize, strlen(initial dst)). + * If retval >= dsize, truncation occurred. + */ ++#if !HAVE_STRLCAT + size_t + strlcat(char *dst, const char *src, size_t dsize) + { +@@ -53,3 +54,4 @@ strlcat(char *dst, const char *src, size_t dsize) + + return(dlen + (src - osrc)); /* count does not include NUL */ + } ++#endif +diff --git a/src/strlcpy.c b/src/strlcpy.c +index e9a7fe4be7359d0d4226952e174ff64eb4d52b18..5137acb632044e26dfbbec7b33f59773ec474763 100644 +--- a/src/strlcpy.c ++++ b/src/strlcpy.c +@@ -24,6 +24,7 @@ + * chars will be copied. Always NUL terminates (unless dsize == 0). + * Returns strlen(src); if retval >= dsize, truncation occurred. + */ ++#if !HAVE_STRLCPY + size_t + strlcpy(char *dst, const char *src, size_t dsize) + { +@@ -48,3 +49,4 @@ strlcpy(char *dst, const char *src, size_t dsize) + + return(src - osrc - 1); /* count does not include NUL */ + } ++#endif +diff --git a/src/strmode.c b/src/strmode.c +index e6afde5a6ca0ff1ee8145d8b7451dcfc9b858451..da680c917c110f365159f2f4fc068203b6fee4e8 100644 +--- a/src/strmode.c ++++ b/src/strmode.c +@@ -32,6 +32,7 @@ + #include + #include + ++#if !HAVE_STRMODE + void + strmode(mode_t mode, char *p) + { +@@ -141,3 +142,4 @@ strmode(mode_t mode, char *p) + *p++ = ' '; /* will be a '+' if ACL's implemented */ + *p = '\0'; + } ++#endif diff --git a/recipes/libbsd/all/test_package/CMakeLists.txt b/recipes/libbsd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4aafe28c716a --- /dev/null +++ b/recipes/libbsd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(libbsd REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libbsd::libbsd-overlay) diff --git a/recipes/libbsd/all/test_package/conanfile.py b/recipes/libbsd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ec1844a785913 --- /dev/null +++ b/recipes/libbsd/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/libbsd/all/test_package/test_package.c b/recipes/libbsd/all/test_package/test_package.c new file mode 100644 index 0000000000000..eb7c8092f11ac --- /dev/null +++ b/recipes/libbsd/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include "bsd/libutil.h" + +#include + +int main() { + char buffer[256]; + const int nb = 123456789; + int res = humanize_number(buffer, 8, nb, "b", HN_AUTOSCALE, 0); + if (res == -1) { + fprintf(stderr, "humanize_number failed\n"); + return 1; + } + printf("%d -> %s\n", nb, buffer); + return 0; +} diff --git a/recipes/libbsd/all/test_v1_package/CMakeLists.txt b/recipes/libbsd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd6f4a15c06e7 --- /dev/null +++ b/recipes/libbsd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libbsd/all/test_v1_package/conanfile.py b/recipes/libbsd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6128ac2ebae8f --- /dev/null +++ b/recipes/libbsd/all/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package", "pkg_config" + + def build(self): + pcfiles = ["libbsd", "libbsd-overlay"] + if self.settings.compiler != "apple-clang": + pcfiles.append("libbsd-ctor") + for f in pcfiles: + pc = "{}.pc".format(f) + if not os.path.isfile(pc): + raise ConanException("{} not created by pkg_config generator".format(pc)) + 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/libbsd/config.yml b/recipes/libbsd/config.yml new file mode 100644 index 0000000000000..48da55da242ca --- /dev/null +++ b/recipes/libbsd/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.0": + folder: "all" diff --git a/recipes/libcap/all/conandata.yml b/recipes/libcap/all/conandata.yml new file mode 100644 index 0000000000000..5d119b718f418 --- /dev/null +++ b/recipes/libcap/all/conandata.yml @@ -0,0 +1,102 @@ +sources: + "2.68": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.68.tar.xz" + sha256: "90be3b6d41be5f81ae4b03ec76012b0d27c829293684f6c05b65d5f9cce724b2" + "2.66": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.66.tar.xz" + sha256: "15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2" + "2.65": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.65.tar.xz" + sha256: "73e350020cc31fe15360879d19384ffa3395a825f065fcf6bda3a5cdf965bebd" + "2.62": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.62.tar.xz" + sha256: "190c5baac9bee06a129eae20d3e827de62f664fe3507f0bf6c50a9a59fbd83a2" + "2.58": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.58.tar.xz" + sha256: "41399a7d77497d348d20475dc9b2046f53e6b9755bf858ec78cc235101a11d4b" + "2.57": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.57.tar.xz" + sha256: "750221e347689e779a0ce2b22746ee9987d229712da934acb81b2d280684b7ab" + "2.50": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.50.tar.xz" + sha256: "47a57b8bd238b84c93c921a9b4ff82337551dbcb0cca071316aadf3e23b19261" + "2.48": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.48.tar.xz" + sha256: "4de9590ee09a87c282d558737ffb5b6175ccbfd26d580add10df44d0f047f6c2" + "2.46": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.46.tar.xz" + sha256: "4ed3d11413fa6c9667e49f819808fbb581cd8864b839f87d7c2a02c70f21d8b4" + "2.45": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.45.tar.xz" + sha256: "d66639f765c0e10557666b00f519caf0bd07a95f867dddaee131cd284fac3286" +patches: + "2.68": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.66": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.65": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.62": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.58": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.57": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.50": + - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.48": + - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.46": + - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.45": + - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" diff --git a/recipes/libcap/all/conanfile.py b/recipes/libcap/all/conanfile.py new file mode 100644 index 0000000000000..0b95333fdd78f --- /dev/null +++ b/recipes/libcap/all/conanfile.py @@ -0,0 +1,104 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.files import apply_conandata_patches, copy, chdir, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + + +class LibcapConan(ConanFile): + name = "libcap" + license = ("GPL-2.0-only", "BSD-3-Clause") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.kernel.org/pub/scm/libs/libcap/libcap.git" + description = "This is a library for getting and setting POSIX.1e" \ + " (formerly POSIX 6) draft 15 capabilities" + topics = ("capabilities") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "psx_syscals": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "psx_syscals": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.name} only supports Linux") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.fpic = self.options.get_safe("fPIC", True) + env = tc.environment() + env.define("SHARED", "yes" if self.options.shared else "no") + env.define("PTHREADS", "yes" if self.options.psx_syscals else "no") + env.define("DESTDIR", self.package_folder) + env.define("prefix", "/") + env.define("lib", "lib") + + if cross_building(self): + # libcap needs to run an executable that is compiled from sources + # during the build - so it needs a native compiler (it doesn't matter which) + # Assume the `cc` command points to a working C compiler + env.define("BUILD_CC", "cc") + + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder, "libcap")): + autotools.make() + + def package(self): + copy(self, "License", self.source_folder, os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder, "libcap")): + autotools.make(target="install-common-cap") + install_cap = ("install-shared-cap" if self.options.shared + else "install-static-cap") + autotools.make(target=install_cap) + + if self.options.psx_syscals: + autotools.make(target="install-common-psx") + install_psx = ("install-shared-psx" if self.options.shared + else "install-static-psx") + autotools.make(target=install_psx) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.components["cap"].set_property("pkg_config_name", "libcap") + self.cpp_info.components["cap"].libs = ["cap"] + if self.options.psx_syscals: + self.cpp_info.components["psx"].set_property("pkg_config_name", "libpsx") + self.cpp_info.components["psx"].libs = ["psx"] + self.cpp_info.components["psx"].system_libs = ["pthread"] + self.cpp_info.components["psx"].exelinkflags = ["-Wl,-wrap,pthread_create"] + # trick to avoid conflicts with cap component + self.cpp_info.set_property("pkg_config_name", "libcap-do-not-use") diff --git a/recipes/libcap/all/patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch b/recipes/libcap/all/patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch new file mode 100644 index 0000000000000..b32820b0fbb55 --- /dev/null +++ b/recipes/libcap/all/patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch @@ -0,0 +1,26 @@ +From bb2c4e80928e8221a31c3631f5a802c7b022aebd Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Sun, 29 Aug 2021 12:02:23 +0300 +Subject: [PATCH 1/2] Make.Rules: Remove hardcoded -fPIC + +Signed-off-by: Sergey Bobrenok +--- + Make.Rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Make.Rules b/Make.Rules +index cc6f95b..91099c6 100644 +--- a/Make.Rules ++++ b/Make.Rules +@@ -52,7 +52,7 @@ GOMAJOR=0 + # Compilation specifics + + KERNEL_HEADERS := $(topdir)/libcap/include/uapi +-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include ++IPATH += -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include + + CC := $(CROSS_COMPILE)gcc + DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 +-- +2.31.1 + diff --git a/recipes/libcap/all/patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch b/recipes/libcap/all/patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch new file mode 100644 index 0000000000000..5ac5d36200e61 --- /dev/null +++ b/recipes/libcap/all/patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch @@ -0,0 +1,36 @@ +From 76e637ad20faa811f4091a8a08af4b29c528697b Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Sun, 29 Aug 2021 12:06:18 +0300 +Subject: [PATCH 2/2] Make.Rules: Make compile tools configurable + +Signed-off-by: Sergey Bobrenok +--- + Make.Rules | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Make.Rules b/Make.Rules +index 91099c6..cd25495 100644 +--- a/Make.Rules ++++ b/Make.Rules +@@ -54,15 +54,15 @@ GOMAJOR=0 + KERNEL_HEADERS := $(topdir)/libcap/include/uapi + IPATH += -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include + +-CC := $(CROSS_COMPILE)gcc ++CC ?= $(CROSS_COMPILE)gcc + DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + COPTS ?= -O2 + CFLAGS ?= $(COPTS) $(DEFINES) + BUILD_CC ?= $(CC) + BUILD_COPTS ?= -O2 + BUILD_CFLAGS ?= $(BUILD_COPTS) $(DEFINES) $(IPATH) +-AR := $(CROSS_COMPILE)ar +-RANLIB := $(CROSS_COMPILE)ranlib ++AR ?= $(CROSS_COMPILE)ar ++RANLIB ?= $(CROSS_COMPILE)ranlib + DEBUG = -g #-DDEBUG + WARNINGS=-Wall -Wwrite-strings \ + -Wpointer-arith -Wcast-qual -Wcast-align \ +-- +2.31.1 + diff --git a/recipes/libcap/all/patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch b/recipes/libcap/all/patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch new file mode 100644 index 0000000000000..bc612d7d38f9f --- /dev/null +++ b/recipes/libcap/all/patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch @@ -0,0 +1,27 @@ +From b70454fccba1816b14d50813b1715e9a50d7cca0 Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Sat, 11 Sep 2021 20:39:49 +0300 +Subject: [PATCH 1/2] libcap: Remove hardcoded -fPIC + +Signed-off-by: Sergey Bobrenok +--- + libcap/Makefile | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/libcap/Makefile b/libcap/Makefile +index 7706063..1b52eb9 100644 +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -18,9 +18,6 @@ CAPMAGICOBJ=cap_magic.o + PSXFILES=../psx/psx + PSXMAGICOBJ=psx_magic.o + +-# Always build libcap sources this way: +-CFLAGS += -fPIC +- + # The linker magic needed to build a dynamic library as independently + # executable + MAGIC=-Wl,-e,__so_start +-- +2.31.1 + diff --git a/recipes/libcap/all/patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch b/recipes/libcap/all/patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch new file mode 100644 index 0000000000000..2807835a24217 --- /dev/null +++ b/recipes/libcap/all/patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch @@ -0,0 +1,33 @@ +From a38f5a330d65cc877fcc1da02836526d11ead4f0 Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Sat, 11 Sep 2021 20:44:07 +0300 +Subject: [PATCH 2/2] Make.Rules: Make compile tools configurable + +Signed-off-by: Sergey Bobrenok +--- + Make.Rules | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Make.Rules b/Make.Rules +index 00f2a03..34831ae 100644 +--- a/Make.Rules ++++ b/Make.Rules +@@ -66,11 +66,11 @@ DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + SYSTEM_HEADERS = /usr/include + + SUDO := sudo +-CC := $(CROSS_COMPILE)gcc ++CC ?= $(CROSS_COMPILE)gcc + LD := $(CC) -Wl,-x -shared +-AR := $(CROSS_COMPILE)ar +-RANLIB := $(CROSS_COMPILE)ranlib +-OBJCOPY := $(CROSS_COMPILE)objcopy ++AR ?= $(CROSS_COMPILE)ar ++RANLIB ?= $(CROSS_COMPILE)ranlib ++OBJCOPY ?= $(CROSS_COMPILE)objcopy + + # Reference: + # CPPFLAGS used for building .o files from .c & .h files +-- +2.31.1 + diff --git a/recipes/libcap/all/test_package/CMakeLists.txt b/recipes/libcap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9cf6b90066410 --- /dev/null +++ b/recipes/libcap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(CAP REQUIRED IMPORTED_TARGET libcap) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::CAP) diff --git a/recipes/libcap/all/test_package/conanfile.py b/recipes/libcap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..000b95ab28ae5 --- /dev/null +++ b/recipes/libcap/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +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 = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("pkgconf/1.9.3") + + 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/libcap/all/test_package/test_package.c b/recipes/libcap/all/test_package/test_package.c new file mode 100644 index 0000000000000..432f01f2ea533 --- /dev/null +++ b/recipes/libcap/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include + +#include + +int main(void) { + puts("Allocate cap state"); + cap_t cap = cap_get_proc(); + if (!cap) { + puts("Failed"); + return EXIT_FAILURE; + } + puts("Success"); + cap_free(cap); +} diff --git a/recipes/libcap/all/test_v1_package/CMakeLists.txt b/recipes/libcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libcap/all/test_v1_package/conanfile.py b/recipes/libcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f480305272e38 --- /dev/null +++ b/recipes/libcap/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +import os + +from conans import ConanFile, tools +from conans import CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/libcap/config.yml b/recipes/libcap/config.yml new file mode 100644 index 0000000000000..24a13cbb3bd22 --- /dev/null +++ b/recipes/libcap/config.yml @@ -0,0 +1,21 @@ +versions: + "2.68": + folder: all + "2.66": + folder: all + "2.65": + folder: all + "2.62": + folder: all + "2.58": + folder: all + "2.57": + folder: all + "2.50": + folder: all + "2.48": + folder: all + "2.46": + folder: all + "2.45": + folder: all diff --git a/recipes/libcbor/all/conandata.yml b/recipes/libcbor/all/conandata.yml new file mode 100644 index 0000000000000..e1d0e5f6211c5 --- /dev/null +++ b/recipes/libcbor/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "0.10.2": + url: "https://github.com/PJK/libcbor/archive/v0.10.2.tar.gz" + sha256: "e75f712215d7b7e5c89ef322a09b701f7159f028b8b48978865725f00f79875b" + "0.10.1": + url: "https://github.com/PJK/libcbor/archive/v0.10.1.tar.gz" + sha256: "e8fa0a726b18861c24428561c80b3c95aca95f468df4e2f3e3ac618be12d3047" + "0.10.0": + url: "https://github.com/PJK/libcbor/archive/v0.10.0.tar.gz" + sha256: "4f79c6a9e587aaf877f1c4e74a842a599f2b56b5afb6bf59e51bc643b4f69ba0" + "0.9.0": + url: "https://github.com/PJK/libcbor/archive/v0.9.0.tar.gz" + sha256: "da81e4f9333e0086d4e2745183c7052f04ecc4dbcffcf910029df24f103c15d1" + "0.7.0": + url: https://github.com/PJK/libcbor/archive/v0.7.0.tar.gz + sha256: "fb731afe0a9980581d85e4b8d4ef128b175f782d92e0cd898935f3d26dd3dde7" +patches: + "0.9.0": + - patch_file: "patches/0.7.0/002_fix_cmake_module_path.patch" + patch_description: "fix cmake module path" + patch_type: "portability" + "0.7.0": + - patch_file: "patches/0.7.0/001_fix_shared_build.patch" + patch_description: "fix shared build compilation error" + patch_type: "conan" + - patch_file: "patches/0.7.0/002_fix_cmake_module_path.patch" + patch_description: "fix cmake module path" + patch_type: "portability" diff --git a/recipes/libcbor/all/conanfile.py b/recipes/libcbor/all/conanfile.py new file mode 100644 index 0000000000000..2dcedcee9a1fc --- /dev/null +++ b/recipes/libcbor/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibCborStackConan(ConanFile): + name = "libcbor" + license = "MIT" + homepage = "https://github.com/PJK/libcbor" + url = "https://github.com/conan-io/conan-center-index" + description = "CBOR protocol implementation for C" + topics = ("cbor", "serialization", "messaging") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "custom_alloc": [True, False], + "pretty_printer": [True, False], + "buffer_growth_factor": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "custom_alloc": False, + "pretty_printer": True, + "buffer_growth_factor": 2, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_EXAMPLES"] = False + tc.variables["SANITIZE"] = False + tc.variables["CBOR_CUSTOM_ALLOC"] = self.options.custom_alloc + tc.variables["CBOR_PRETTY_PRINTER"] = self.options.pretty_printer + tc.variables["CBOR_BUFFER_GROWTH"] = self.options.buffer_growth_factor + # Relocatable shared libs on macOS + tc.variables["CMAKE_MACOSX_RPATH"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libcbor") + self.cpp_info.libs = ["cbor"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libcbor/all/patches/0.7.0/001_fix_shared_build.patch b/recipes/libcbor/all/patches/0.7.0/001_fix_shared_build.patch new file mode 100644 index 0000000000000..a1b16eb425caf --- /dev/null +++ b/recipes/libcbor/all/patches/0.7.0/001_fix_shared_build.patch @@ -0,0 +1,1609 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 00a718e..2a1492b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -11,16 +11,19 @@ if (NOT DEFINED CMAKE_MACOSX_RPATH) + set(CMAKE_MACOSX_RPATH 0) + endif() + +-add_library(cbor STATIC ${SOURCES}) +-add_library(cbor_shared SHARED ${SOURCES}) ++add_library(cbor ${SOURCES}) ++target_include_directories(cbor PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + ++include(GenerateExportHeader) ++generate_export_header(cbor EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/cbor/cbor_export.h) ++target_include_directories(cbor PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cbor/cbor_export.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cbor) + + if (NOT ${CBOR_VERSION_MAJOR} EQUAL 0) + MESSAGE(FATAL_ERROR "Change the shared library version scheme to reflect https://github.com/PJK/libcbor/issues/52.") + endif() + +-set_target_properties(cbor_shared PROPERTIES +- OUTPUT_NAME cbor ++set_target_properties(cbor PROPERTIES + VERSION ${CBOR_VERSION} + MACHO_COMPATIBILITY_VERSION ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.0 + SOVERSION ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}) +@@ -28,15 +31,15 @@ set_target_properties(cbor_shared PROPERTIES + configure_file(libcbor.pc.in libcbor.pc @ONLY) + + # http://www.cmake.org/Wiki/CMake:Install_Commands +-install(TARGETS cbor_shared ++install(TARGETS cbor + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +-install(DIRECTORY cbor DESTINATION include ++install(DIRECTORY cbor DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") + +-install(FILES cbor.h DESTINATION include) ++install(FILES cbor.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libcbor.pc" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig") +diff --git a/src/allocators.c b/src/allocators.c +index 273e093..43c5440 100644 +--- a/src/allocators.c ++++ b/src/allocators.c +@@ -7,9 +7,9 @@ + + #include "cbor/common.h" + +-_cbor_malloc_t _cbor_malloc = malloc; +-_cbor_realloc_t _cbor_realloc = realloc; +-_cbor_free_t _cbor_free = free; ++CBOR_EXPORT _cbor_malloc_t _cbor_malloc = malloc; ++CBOR_EXPORT _cbor_realloc_t _cbor_realloc = realloc; ++CBOR_EXPORT _cbor_free_t _cbor_free = free; + + void cbor_set_allocs(_cbor_malloc_t custom_malloc, + _cbor_realloc_t custom_realloc, _cbor_free_t custom_free) { +diff --git a/src/cbor.h b/src/cbor.h +index f4dfc9e..1f4f23d 100644 +--- a/src/cbor.h ++++ b/src/cbor.h +@@ -23,6 +23,7 @@ + #include "cbor/encoding.h" + #include "cbor/serialization.h" + #include "cbor/streaming.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -42,8 +43,8 @@ extern "C" { + * @return **new** CBOR item or `NULL` on failure. In that case, \p result + * contains location and description of the error. + */ +-cbor_item_t* cbor_load(cbor_data source, size_t source_size, +- struct cbor_load_result* result); ++CBOR_EXPORT cbor_item_t* cbor_load(cbor_data source, size_t source_size, ++ struct cbor_load_result* result); + + /** Deep copy of an item + * +@@ -52,12 +53,12 @@ cbor_item_t* cbor_load(cbor_data source, size_t source_size, + * @param item[borrow] item to copy + * @return **new** CBOR deep copy + */ +-cbor_item_t* cbor_copy(cbor_item_t* item); ++CBOR_EXPORT cbor_item_t* cbor_copy(cbor_item_t* item); + + #if CBOR_PRETTY_PRINTER + #include + +-void cbor_describe(cbor_item_t* item, FILE* out); ++CBOR_EXPORT void cbor_describe(cbor_item_t* item, FILE* out); + #endif + + #ifdef __cplusplus +diff --git a/src/cbor/arrays.h b/src/cbor/arrays.h +index 3851975..883e948 100644 +--- a/src/cbor/arrays.h ++++ b/src/cbor/arrays.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_ARRAYS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -19,14 +20,14 @@ extern "C" { + * @param item[borrow] An array + * @return The number of members + */ +-size_t cbor_array_size(const cbor_item_t* item); ++CBOR_EXPORT size_t cbor_array_size(const cbor_item_t* item); + + /** Get the size of the allocated storage + * + * @param item[borrow] An array + * @return The size of the allocated storage (number of items) + */ +-size_t cbor_array_allocated(const cbor_item_t* item); ++CBOR_EXPORT size_t cbor_array_allocated(const cbor_item_t* item); + + /** Get item by index + * +@@ -34,7 +35,7 @@ size_t cbor_array_allocated(const cbor_item_t* item); + * @param index The index + * @return **incref** The item, or `NULL` in case of boundary violation + */ +-cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index); ++CBOR_EXPORT cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index); + + /** Set item by index + * +@@ -45,7 +46,8 @@ cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index); + * @param index The index, first item is 0. + * @return true on success, false on allocation failure. + */ +-bool cbor_array_set(cbor_item_t* item, size_t index, cbor_item_t* value); ++CBOR_EXPORT bool cbor_array_set(cbor_item_t* item, size_t index, ++ cbor_item_t* value); + + /** Replace item at an index + * +@@ -56,21 +58,22 @@ bool cbor_array_set(cbor_item_t* item, size_t index, cbor_item_t* value); + * @param index The index, first item is 0. + * @return true on success, false on allocation failure. + */ +-bool cbor_array_replace(cbor_item_t* item, size_t index, cbor_item_t* value); ++CBOR_EXPORT bool cbor_array_replace(cbor_item_t* item, size_t index, ++ cbor_item_t* value); + + /** Is the array definite? + * + * @param item[borrow] An array + * @return Is the array definite? + */ +-bool cbor_array_is_definite(const cbor_item_t* item); ++CBOR_EXPORT bool cbor_array_is_definite(const cbor_item_t* item); + + /** Is the array indefinite? + * + * @param item[borrow] An array + * @return Is the array indefinite? + */ +-bool cbor_array_is_indefinite(const cbor_item_t* item); ++CBOR_EXPORT bool cbor_array_is_indefinite(const cbor_item_t* item); + + /** Get the array contents + * +@@ -80,20 +83,20 @@ bool cbor_array_is_indefinite(const cbor_item_t* item); + * @param item[borrow] An array + * @return #cbor_array_size items + */ +-cbor_item_t** cbor_array_handle(const cbor_item_t* item); ++CBOR_EXPORT cbor_item_t** cbor_array_handle(const cbor_item_t* item); + + /** Create new definite array + * + * @param size Number of slots to preallocate + * @return **new** array or `NULL` upon malloc failure + */ +-cbor_item_t* cbor_new_definite_array(size_t size); ++CBOR_EXPORT cbor_item_t* cbor_new_definite_array(size_t size); + + /** Create new indefinite array + * + * @return **new** array or `NULL` upon malloc failure + */ +-cbor_item_t* cbor_new_indefinite_array(); ++CBOR_EXPORT cbor_item_t* cbor_new_indefinite_array(); + + /** Append to the end + * +@@ -104,7 +107,7 @@ cbor_item_t* cbor_new_indefinite_array(); + * @param pushee[incref] The item to push + * @return true on success, false on failure + */ +-bool cbor_array_push(cbor_item_t* array, cbor_item_t* pushee); ++CBOR_EXPORT bool cbor_array_push(cbor_item_t* array, cbor_item_t* pushee); + + #ifdef __cplusplus + } +diff --git a/src/cbor/bytestrings.h b/src/cbor/bytestrings.h +index 9f9322c..7324441 100644 +--- a/src/cbor/bytestrings.h ++++ b/src/cbor/bytestrings.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_BYTESTRINGS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -27,21 +28,21 @@ extern "C" { + * @param item[borrow] a definite bytestring + * @return length of the binary data. Zero if no chunk has been attached yet + */ +-size_t cbor_bytestring_length(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_bytestring_length(const cbor_item_t *item); + + /** Is the byte string definite? + * + * @param item[borrow] a byte string + * @return Is the byte string definite? + */ +-bool cbor_bytestring_is_definite(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_bytestring_is_definite(const cbor_item_t *item); + + /** Is the byte string indefinite? + * + * @param item[borrow] a byte string + * @return Is the byte string indefinite? + */ +-bool cbor_bytestring_is_indefinite(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_bytestring_is_indefinite(const cbor_item_t *item); + + /** Get the handle to the binary data + * +@@ -52,7 +53,7 @@ bool cbor_bytestring_is_indefinite(const cbor_item_t *item); + * @return The address of the binary data. `NULL` if no data have been assigned + * yet. + */ +-cbor_mutable_data cbor_bytestring_handle(const cbor_item_t *item); ++CBOR_EXPORT cbor_mutable_data cbor_bytestring_handle(const cbor_item_t *item); + + /** Set the handle to the binary data + * +@@ -61,9 +62,9 @@ cbor_mutable_data cbor_bytestring_handle(const cbor_item_t *item); + * libcbor will deallocate it when appropriate using its free function + * @param length Length of the data block + */ +-void cbor_bytestring_set_handle(cbor_item_t *item, +- cbor_mutable_data CBOR_RESTRICT_POINTER data, +- size_t length); ++CBOR_EXPORT void cbor_bytestring_set_handle(cbor_item_t *item, ++ cbor_mutable_data CBOR_RESTRICT_POINTER data, ++ size_t length); + + /** Get the handle to the array of chunks + * +@@ -73,14 +74,15 @@ void cbor_bytestring_set_handle(cbor_item_t *item, + * @param item[borrow] A indefinite byte string + * @return array of #cbor_bytestring_chunk_count definite bytestrings + */ +-cbor_item_t **cbor_bytestring_chunks_handle(const cbor_item_t *item); ++CBOR_EXPORT cbor_item_t **cbor_bytestring_chunks_handle( ++ const cbor_item_t *item); + + /** Get the number of chunks this string consist of + * + * @param item[borrow] A indefinite bytestring + * @return The chunk count. 0 for freshly created items. + */ +-size_t cbor_bytestring_chunk_count(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_bytestring_chunk_count(const cbor_item_t *item); + + /** Appends a chunk to the bytestring + * +@@ -93,7 +95,8 @@ size_t cbor_bytestring_chunk_count(const cbor_item_t *item); + * @return true on success, false on realloc failure. In that case, the refcount + * of `chunk` is not increased and the `item` is left intact. + */ +-bool cbor_bytestring_add_chunk(cbor_item_t *item, cbor_item_t *chunk); ++CBOR_EXPORT bool cbor_bytestring_add_chunk(cbor_item_t *item, ++ cbor_item_t *chunk); + + /** Creates a new definite byte string + * +@@ -101,7 +104,7 @@ bool cbor_bytestring_add_chunk(cbor_item_t *item, cbor_item_t *chunk); + * + * @return **new** definite bytestring. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_new_definite_bytestring(); ++CBOR_EXPORT cbor_item_t *cbor_new_definite_bytestring(); + + /** Creates a new indefinite byte string + * +@@ -109,7 +112,7 @@ cbor_item_t *cbor_new_definite_bytestring(); + * + * @return **new** indefinite bytestring. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_new_indefinite_bytestring(); ++CBOR_EXPORT cbor_item_t *cbor_new_indefinite_bytestring(); + + /** Creates a new byte string and initializes it + * +@@ -120,7 +123,7 @@ cbor_item_t *cbor_new_indefinite_bytestring(); + * @return A **new** byte string with content `handle`. `NULL` on malloc + * failure. + */ +-cbor_item_t *cbor_build_bytestring(cbor_data handle, size_t length); ++CBOR_EXPORT cbor_item_t *cbor_build_bytestring(cbor_data handle, size_t length); + + #ifdef __cplusplus + } +diff --git a/src/cbor/callbacks.c b/src/cbor/callbacks.c +index 7d0f1c6..3f1f547 100644 +--- a/src/cbor/callbacks.c ++++ b/src/cbor/callbacks.c +@@ -69,7 +69,7 @@ void cbor_null_uint8_callback(void *_ctx, uint8_t _val) CBOR_DUMMY_CALLBACK + + void cbor_null_indef_break_callback(void *_ctx) CBOR_DUMMY_CALLBACK + +- const struct cbor_callbacks cbor_empty_callbacks = { ++ CBOR_EXPORT const struct cbor_callbacks cbor_empty_callbacks = { + /* Type 0 - Unsigned integers */ + .uint8 = cbor_null_uint8_callback, + .uint16 = cbor_null_uint16_callback, +diff --git a/src/cbor/callbacks.h b/src/cbor/callbacks.h +index 1d37f3e..ea6a9a8 100644 +--- a/src/cbor/callbacks.h ++++ b/src/cbor/callbacks.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_CALLBACKS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -105,79 +106,79 @@ struct cbor_callbacks { + }; + + /** Dummy callback implementation - does nothing */ +-void cbor_null_uint8_callback(void *, uint8_t); ++CBOR_EXPORT void cbor_null_uint8_callback(void *, uint8_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_uint16_callback(void *, uint16_t); ++CBOR_EXPORT void cbor_null_uint16_callback(void *, uint16_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_uint32_callback(void *, uint32_t); ++CBOR_EXPORT void cbor_null_uint32_callback(void *, uint32_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_uint64_callback(void *, uint64_t); ++CBOR_EXPORT void cbor_null_uint64_callback(void *, uint64_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_negint8_callback(void *, uint8_t); ++CBOR_EXPORT void cbor_null_negint8_callback(void *, uint8_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_negint16_callback(void *, uint16_t); ++CBOR_EXPORT void cbor_null_negint16_callback(void *, uint16_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_negint32_callback(void *, uint32_t); ++CBOR_EXPORT void cbor_null_negint32_callback(void *, uint32_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_negint64_callback(void *, uint64_t); ++CBOR_EXPORT void cbor_null_negint64_callback(void *, uint64_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_string_callback(void *, cbor_data, size_t); ++CBOR_EXPORT void cbor_null_string_callback(void *, cbor_data, size_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_string_start_callback(void *); ++CBOR_EXPORT void cbor_null_string_start_callback(void *); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_byte_string_callback(void *, cbor_data, size_t); ++CBOR_EXPORT void cbor_null_byte_string_callback(void *, cbor_data, size_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_byte_string_start_callback(void *); ++CBOR_EXPORT void cbor_null_byte_string_start_callback(void *); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_array_start_callback(void *, size_t); ++CBOR_EXPORT void cbor_null_array_start_callback(void *, size_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_indef_array_start_callback(void *); ++CBOR_EXPORT void cbor_null_indef_array_start_callback(void *); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_map_start_callback(void *, size_t); ++CBOR_EXPORT void cbor_null_map_start_callback(void *, size_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_indef_map_start_callback(void *); ++CBOR_EXPORT void cbor_null_indef_map_start_callback(void *); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_tag_callback(void *, uint64_t); ++CBOR_EXPORT void cbor_null_tag_callback(void *, uint64_t); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_float2_callback(void *, float); ++CBOR_EXPORT void cbor_null_float2_callback(void *, float); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_float4_callback(void *, float); ++CBOR_EXPORT void cbor_null_float4_callback(void *, float); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_float8_callback(void *, double); ++CBOR_EXPORT void cbor_null_float8_callback(void *, double); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_null_callback(void *); ++CBOR_EXPORT void cbor_null_null_callback(void *); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_undefined_callback(void *); ++CBOR_EXPORT void cbor_null_undefined_callback(void *); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_boolean_callback(void *, bool); ++CBOR_EXPORT void cbor_null_boolean_callback(void *, bool); + + /** Dummy callback implementation - does nothing */ +-void cbor_null_indef_break_callback(void *); ++CBOR_EXPORT void cbor_null_indef_break_callback(void *); + + /** Dummy callback bundle - does nothing */ +-extern const struct cbor_callbacks cbor_empty_callbacks; ++CBOR_EXPORT extern const struct cbor_callbacks cbor_empty_callbacks; + + #ifdef __cplusplus + } +diff --git a/src/cbor/common.h b/src/cbor/common.h +index d54a23c..1070fae 100644 +--- a/src/cbor/common.h ++++ b/src/cbor/common.h +@@ -15,6 +15,7 @@ + #include + #include "cbor/configuration.h" + #include "data.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -87,9 +88,9 @@ typedef void *(*_cbor_malloc_t)(size_t); + typedef void *(*_cbor_realloc_t)(void *, size_t); + typedef void (*_cbor_free_t)(void *); + +-extern _cbor_malloc_t _cbor_malloc; +-extern _cbor_realloc_t _cbor_realloc; +-extern _cbor_free_t _cbor_free; ++CBOR_EXPORT extern _cbor_malloc_t _cbor_malloc; ++CBOR_EXPORT extern _cbor_realloc_t _cbor_realloc; ++CBOR_EXPORT extern _cbor_free_t _cbor_free; + + /** Sets the memory management routines to use. + * +@@ -108,8 +109,9 @@ extern _cbor_free_t _cbor_free; + * @param custom_realloc realloc implementation + * @param custom_free free implementation + */ +-void cbor_set_allocs(_cbor_malloc_t custom_malloc, +- _cbor_realloc_t custom_realloc, _cbor_free_t custom_free); ++CBOR_EXPORT void cbor_set_allocs(_cbor_malloc_t custom_malloc, ++ _cbor_realloc_t custom_realloc, ++ _cbor_free_t custom_free); + + #define _CBOR_MALLOC _cbor_malloc + #define _CBOR_REALLOC _cbor_realloc +@@ -134,7 +136,7 @@ void cbor_set_allocs(_cbor_malloc_t custom_malloc, + * @param item[borrow] + * @return The type + */ +-cbor_type cbor_typeof( ++CBOR_EXPORT cbor_type cbor_typeof( + const cbor_item_t *item); /* Will be inlined iff link-time opt is enabled */ + + /* Standard item types as described by the RFC */ +@@ -143,49 +145,49 @@ cbor_type cbor_typeof( + * @param item[borrow] the item + * @return Is the item an #CBOR_TYPE_UINT? + */ +-bool cbor_isa_uint(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_uint(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_NEGINT? + */ +-bool cbor_isa_negint(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_negint(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_BYTESTRING? + */ +-bool cbor_isa_bytestring(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_bytestring(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_STRING? + */ +-bool cbor_isa_string(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_string(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item an #CBOR_TYPE_ARRAY? + */ +-bool cbor_isa_array(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_array(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_MAP? + */ +-bool cbor_isa_map(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_map(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_TAG? + */ +-bool cbor_isa_tag(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_tag(const cbor_item_t *item); + + /** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_FLOAT_CTRL? + */ +-bool cbor_isa_float_ctrl(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_isa_float_ctrl(const cbor_item_t *item); + + /* Practical types with respect to their semantics (but not tag values) */ + +@@ -193,19 +195,19 @@ bool cbor_isa_float_ctrl(const cbor_item_t *item); + * @param item[borrow] the item + * @return Is the item an integer, either positive or negative? + */ +-bool cbor_is_int(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_is_int(const cbor_item_t *item); + + /** Is the item an a floating point number? + * @param item[borrow] the item + * @return Is the item a floating point number? + */ +-bool cbor_is_float(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_is_float(const cbor_item_t *item); + + /** Is the item an a boolean? + * @param item[borrow] the item + * @return Is the item a boolean? + */ +-bool cbor_is_bool(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_is_bool(const cbor_item_t *item); + + /** Does this item represent `null` + * \rst +@@ -214,7 +216,7 @@ bool cbor_is_bool(const cbor_item_t *item); + * @param item[borrow] the item + * @return Is the item (CBOR logical) null? + */ +-bool cbor_is_null(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_is_null(const cbor_item_t *item); + + /** Does this item represent `undefined` + * \rst +@@ -223,7 +225,7 @@ bool cbor_is_null(const cbor_item_t *item); + * @param item[borrow] the item + * @return Is the item (CBOR logical) undefined? + */ +-bool cbor_is_undef(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_is_undef(const cbor_item_t *item); + + /* + * ============================================================================ +@@ -238,7 +240,7 @@ bool cbor_is_undef(const cbor_item_t *item); + * @param item[incref] item the item + * @return the input reference + */ +-cbor_item_t *cbor_incref(cbor_item_t *item); ++CBOR_EXPORT cbor_item_t *cbor_incref(cbor_item_t *item); + + /** Decreases the reference count by one, deallocating the item if needed + * +@@ -247,7 +249,7 @@ cbor_item_t *cbor_incref(cbor_item_t *item); + * + * @param item[take] the item. Set to `NULL` if deallocated + */ +-void cbor_decref(cbor_item_t **item); ++CBOR_EXPORT void cbor_decref(cbor_item_t **item); + + /** Decreases the reference count by one, deallocating the item if needed + * +@@ -256,7 +258,7 @@ void cbor_decref(cbor_item_t **item); + * + * @param item[take] the item + */ +-void cbor_intermediate_decref(cbor_item_t *item); ++CBOR_EXPORT void cbor_intermediate_decref(cbor_item_t *item); + + /** Get the reference count + * +@@ -267,7 +269,7 @@ void cbor_intermediate_decref(cbor_item_t *item); + * @param item[borrow] the item + * @return the reference count + */ +-size_t cbor_refcount(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_refcount(const cbor_item_t *item); + + /** Provides CPP-like move construct + * +@@ -283,7 +285,7 @@ size_t cbor_refcount(const cbor_item_t *item); + * @param item[take] the item + * @return the item with reference count decreased by one + */ +-cbor_item_t *cbor_move(cbor_item_t *item); ++CBOR_EXPORT cbor_item_t *cbor_move(cbor_item_t *item); + + #ifdef __cplusplus + } +diff --git a/src/cbor/data.h b/src/cbor/data.h +index 7f703bc..646ca48 100644 +--- a/src/cbor/data.h ++++ b/src/cbor/data.h +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +diff --git a/src/cbor/encoding.h b/src/cbor/encoding.h +index 34a7382..ec0b65d 100644 +--- a/src/cbor/encoding.h ++++ b/src/cbor/encoding.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_ENCODING_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -20,49 +21,50 @@ extern "C" { + * ============================================================================ + */ + +-size_t cbor_encode_uint8(uint8_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_uint8(uint8_t, unsigned char *, size_t); + +-size_t cbor_encode_uint16(uint16_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_uint16(uint16_t, unsigned char *, size_t); + +-size_t cbor_encode_uint32(uint32_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_uint32(uint32_t, unsigned char *, size_t); + +-size_t cbor_encode_uint64(uint64_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_uint64(uint64_t, unsigned char *, size_t); + +-size_t cbor_encode_uint(uint64_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_uint(uint64_t, unsigned char *, size_t); + +-size_t cbor_encode_negint8(uint8_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_negint8(uint8_t, unsigned char *, size_t); + +-size_t cbor_encode_negint16(uint16_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_negint16(uint16_t, unsigned char *, size_t); + +-size_t cbor_encode_negint32(uint32_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_negint32(uint32_t, unsigned char *, size_t); + +-size_t cbor_encode_negint64(uint64_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_negint64(uint64_t, unsigned char *, size_t); + +-size_t cbor_encode_negint(uint64_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_negint(uint64_t, unsigned char *, size_t); + +-size_t cbor_encode_bytestring_start(size_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_bytestring_start(size_t, unsigned char *, ++ size_t); + +-size_t cbor_encode_indef_bytestring_start(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_indef_bytestring_start(unsigned char *, size_t); + +-size_t cbor_encode_string_start(size_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_string_start(size_t, unsigned char *, size_t); + +-size_t cbor_encode_indef_string_start(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_indef_string_start(unsigned char *, size_t); + +-size_t cbor_encode_array_start(size_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_array_start(size_t, unsigned char *, size_t); + +-size_t cbor_encode_indef_array_start(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_indef_array_start(unsigned char *, size_t); + +-size_t cbor_encode_map_start(size_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_map_start(size_t, unsigned char *, size_t); + +-size_t cbor_encode_indef_map_start(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_indef_map_start(unsigned char *, size_t); + +-size_t cbor_encode_tag(uint64_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_tag(uint64_t, unsigned char *, size_t); + +-size_t cbor_encode_bool(bool, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_bool(bool, unsigned char *, size_t); + +-size_t cbor_encode_null(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_null(unsigned char *, size_t); + +-size_t cbor_encode_undef(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_undef(unsigned char *, size_t); + + /** Encodes a half-precision float + * +@@ -90,15 +92,15 @@ size_t cbor_encode_undef(unsigned char *, size_t); + * @param buffer_size Available space in the buffer + * @return number of bytes written + */ +-size_t cbor_encode_half(float, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_half(float, unsigned char *, size_t); + +-size_t cbor_encode_single(float, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_single(float, unsigned char *, size_t); + +-size_t cbor_encode_double(double, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_double(double, unsigned char *, size_t); + +-size_t cbor_encode_break(unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_break(unsigned char *, size_t); + +-size_t cbor_encode_ctrl(uint8_t, unsigned char *, size_t); ++CBOR_EXPORT size_t cbor_encode_ctrl(uint8_t, unsigned char *, size_t); + + #ifdef __cplusplus + } +diff --git a/src/cbor/floats_ctrls.h b/src/cbor/floats_ctrls.h +index 7e60620..82449da 100644 +--- a/src/cbor/floats_ctrls.h ++++ b/src/cbor/floats_ctrls.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_FLOATS_CTRLS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -25,14 +26,14 @@ extern "C" { + * @param item[borrow] A float or ctrl item + * @return Is this a ctrl value? + */ +-bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item); + + /** Get the float width + * + * @param item[borrow] A float or ctrl item + * @return The width. + */ +-cbor_float_width cbor_float_get_width(const cbor_item_t *item); ++CBOR_EXPORT cbor_float_width cbor_float_get_width(const cbor_item_t *item); + + /** Get a half precision float + * +@@ -41,7 +42,7 @@ cbor_float_width cbor_float_get_width(const cbor_item_t *item); + * @param[borrow] A half precision float + * @return half precision value + */ +-float cbor_float_get_float2(const cbor_item_t *item); ++CBOR_EXPORT float cbor_float_get_float2(const cbor_item_t *item); + + /** Get a single precision float + * +@@ -50,7 +51,7 @@ float cbor_float_get_float2(const cbor_item_t *item); + * @param[borrow] A signle precision float + * @return single precision value + */ +-float cbor_float_get_float4(const cbor_item_t *item); ++CBOR_EXPORT float cbor_float_get_float4(const cbor_item_t *item); + + /** Get a double precision float + * +@@ -59,7 +60,7 @@ float cbor_float_get_float4(const cbor_item_t *item); + * @param[borrow] A double precision float + * @return double precision value + */ +-double cbor_float_get_float8(const cbor_item_t *item); ++CBOR_EXPORT double cbor_float_get_float8(const cbor_item_t *item); + + /** Get the float value represented as double + * +@@ -68,14 +69,14 @@ double cbor_float_get_float8(const cbor_item_t *item); + * @param[borrow] Any float + * @return double precision value + */ +-double cbor_float_get_float(const cbor_item_t *item); ++CBOR_EXPORT double cbor_float_get_float(const cbor_item_t *item); + + /** Get value from a boolean ctrl item + * + * @param item[borrow] A ctrl item + * @return boolean value + */ +-bool cbor_get_bool(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_get_bool(const cbor_item_t *item); + + /** Constructs a new ctrl item + * +@@ -83,7 +84,7 @@ bool cbor_get_bool(const cbor_item_t *item); + * + * @return **new** 1B ctrl or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_new_ctrl(); ++CBOR_EXPORT cbor_item_t *cbor_new_ctrl(); + + /** Constructs a new float item + * +@@ -91,7 +92,7 @@ cbor_item_t *cbor_new_ctrl(); + * + * @return **new** 2B float or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_new_float2(); ++CBOR_EXPORT cbor_item_t *cbor_new_float2(); + + /** Constructs a new float item + * +@@ -99,7 +100,7 @@ cbor_item_t *cbor_new_float2(); + * + * @return **new** 4B float or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_new_float4(); ++CBOR_EXPORT cbor_item_t *cbor_new_float4(); + + /** Constructs a new float item + * +@@ -107,26 +108,26 @@ cbor_item_t *cbor_new_float4(); + * + * @return **new** 8B float or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_new_float8(); ++CBOR_EXPORT cbor_item_t *cbor_new_float8(); + + /** Constructs new null ctrl item + * + * @return **new** null ctrl item or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_new_null(); ++CBOR_EXPORT cbor_item_t *cbor_new_null(); + + /** Constructs new undef ctrl item + * + * @return **new** undef ctrl item or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_new_undef(); ++CBOR_EXPORT cbor_item_t *cbor_new_undef(); + + /** Constructs new boolean ctrl item + * + * @param value The value to use + * @return **new** boolen ctrl item or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_build_bool(bool value); ++CBOR_EXPORT cbor_item_t *cbor_build_bool(bool value); + + /** Assign a control value + * +@@ -139,70 +140,70 @@ cbor_item_t *cbor_build_bool(bool value); + * @param value The simple value to assign. Please consult the standard for + * allowed values + */ +-void cbor_set_ctrl(cbor_item_t *item, uint8_t value); ++CBOR_EXPORT void cbor_set_ctrl(cbor_item_t *item, uint8_t value); + + /** Assign a boolean value to a boolean ctrl item + * + * @param item[borrow] A ctrl item + * @param value The simple value to assign. + */ +-void cbor_set_bool(cbor_item_t *item, bool value); ++CBOR_EXPORT void cbor_set_bool(cbor_item_t *item, bool value); + + /** Assigns a float value + * + * @param item[borrow] A half precision float + * @param value The value to assign + */ +-void cbor_set_float2(cbor_item_t *item, float value); ++CBOR_EXPORT void cbor_set_float2(cbor_item_t *item, float value); + + /** Assigns a float value + * + * @param item[borrow] A single precision float + * @param value The value to assign + */ +-void cbor_set_float4(cbor_item_t *item, float value); ++CBOR_EXPORT void cbor_set_float4(cbor_item_t *item, float value); + + /** Assigns a float value + * + * @param item[borrow] A double precision float + * @param value The value to assign + */ +-void cbor_set_float8(cbor_item_t *item, double value); ++CBOR_EXPORT void cbor_set_float8(cbor_item_t *item, double value); + + /** Reads the control value + * + * @param item[borrow] A ctrl item + * @return the simple value + */ +-uint8_t cbor_ctrl_value(const cbor_item_t *item); ++CBOR_EXPORT uint8_t cbor_ctrl_value(const cbor_item_t *item); + + /** Constructs a new float + * + * @param value the value to use + * @return **new** float + */ +-cbor_item_t *cbor_build_float2(float value); ++CBOR_EXPORT cbor_item_t *cbor_build_float2(float value); + + /** Constructs a new float + * + * @param value the value to use + * @return **new** float or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_build_float4(float value); ++CBOR_EXPORT cbor_item_t *cbor_build_float4(float value); + + /** Constructs a new float + * + * @param value the value to use + * @return **new** float or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_build_float8(double value); ++CBOR_EXPORT cbor_item_t *cbor_build_float8(double value); + + /** Constructs a ctrl item + * + * @param value the value to use + * @return **new** ctrl item or `NULL` upon memory allocation failure + */ +-cbor_item_t *cbor_build_ctrl(uint8_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_ctrl(uint8_t value); + + #ifdef __cplusplus + } +diff --git a/src/cbor/ints.h b/src/cbor/ints.h +index f965c29..793882e 100644 +--- a/src/cbor/ints.h ++++ b/src/cbor/ints.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_INTS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -25,35 +26,35 @@ extern "C" { + * @param item[borrow] positive or negative integer + * @return the value + */ +-uint8_t cbor_get_uint8(const cbor_item_t *item); ++CBOR_EXPORT uint8_t cbor_get_uint8(const cbor_item_t *item); + + /** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +-uint16_t cbor_get_uint16(const cbor_item_t *item); ++CBOR_EXPORT uint16_t cbor_get_uint16(const cbor_item_t *item); + + /** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +-uint32_t cbor_get_uint32(const cbor_item_t *item); ++CBOR_EXPORT uint32_t cbor_get_uint32(const cbor_item_t *item); + + /** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +-uint64_t cbor_get_uint64(const cbor_item_t *item); ++CBOR_EXPORT uint64_t cbor_get_uint64(const cbor_item_t *item); + + /** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value, extended to `uint64_t` + */ +-uint64_t cbor_get_int(const cbor_item_t *item); ++CBOR_EXPORT uint64_t cbor_get_int(const cbor_item_t *item); + + /** Assigns the integer value + * +@@ -61,7 +62,7 @@ uint64_t cbor_get_int(const cbor_item_t *item); + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +-void cbor_set_uint8(cbor_item_t *item, uint8_t value); ++CBOR_EXPORT void cbor_set_uint8(cbor_item_t *item, uint8_t value); + + /** Assigns the integer value + * +@@ -69,7 +70,7 @@ void cbor_set_uint8(cbor_item_t *item, uint8_t value); + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +-void cbor_set_uint16(cbor_item_t *item, uint16_t value); ++CBOR_EXPORT void cbor_set_uint16(cbor_item_t *item, uint16_t value); + + /** Assigns the integer value + * +@@ -77,7 +78,7 @@ void cbor_set_uint16(cbor_item_t *item, uint16_t value); + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +-void cbor_set_uint32(cbor_item_t *item, uint32_t value); ++CBOR_EXPORT void cbor_set_uint32(cbor_item_t *item, uint32_t value); + + /** Assigns the integer value + * +@@ -85,14 +86,14 @@ void cbor_set_uint32(cbor_item_t *item, uint32_t value); + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +-void cbor_set_uint64(cbor_item_t *item, uint64_t value); ++CBOR_EXPORT void cbor_set_uint64(cbor_item_t *item, uint64_t value); + + /** Queries the integer width + * + * @param item[borrow] positive or negative integer item + * @return the width + */ +-cbor_int_width cbor_int_get_width(const cbor_item_t *item); ++CBOR_EXPORT cbor_int_width cbor_int_get_width(const cbor_item_t *item); + + /** Marks the integer item as a positive integer + * +@@ -100,7 +101,7 @@ cbor_int_width cbor_int_get_width(const cbor_item_t *item); + * + * @param item[borrow] positive or negative integer item + */ +-void cbor_mark_uint(cbor_item_t *item); ++CBOR_EXPORT void cbor_mark_uint(cbor_item_t *item); + + /** Marks the integer item as a negative integer + * +@@ -108,7 +109,7 @@ void cbor_mark_uint(cbor_item_t *item); + * + * @param item[borrow] positive or negative integer item + */ +-void cbor_mark_negint(cbor_item_t *item); ++CBOR_EXPORT void cbor_mark_negint(cbor_item_t *item); + + /** Allocates new integer with 1B width + * +@@ -117,7 +118,7 @@ void cbor_mark_negint(cbor_item_t *item); + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +-cbor_item_t *cbor_new_int8(); ++CBOR_EXPORT cbor_item_t *cbor_new_int8(); + + /** Allocates new integer with 2B width + * +@@ -126,7 +127,7 @@ cbor_item_t *cbor_new_int8(); + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +-cbor_item_t *cbor_new_int16(); ++CBOR_EXPORT cbor_item_t *cbor_new_int16(); + + /** Allocates new integer with 4B width + * +@@ -135,7 +136,7 @@ cbor_item_t *cbor_new_int16(); + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +-cbor_item_t *cbor_new_int32(); ++CBOR_EXPORT cbor_item_t *cbor_new_int32(); + + /** Allocates new integer with 8B width + * +@@ -144,63 +145,63 @@ cbor_item_t *cbor_new_int32(); + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +-cbor_item_t *cbor_new_int64(); ++CBOR_EXPORT cbor_item_t *cbor_new_int64(); + + /** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_uint8(uint8_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_uint8(uint8_t value); + + /** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_uint16(uint16_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_uint16(uint16_t value); + + /** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_uint32(uint32_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_uint32(uint32_t value); + + /** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_uint64(uint64_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_uint64(uint64_t value); + + /** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_negint8(uint8_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_negint8(uint8_t value); + + /** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_negint16(uint16_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_negint16(uint16_t value); + + /** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_negint32(uint32_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_negint32(uint32_t value); + + /** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +-cbor_item_t *cbor_build_negint64(uint64_t value); ++CBOR_EXPORT cbor_item_t *cbor_build_negint64(uint64_t value); + + #ifdef __cplusplus + } +diff --git a/src/cbor/maps.h b/src/cbor/maps.h +index 4e27eef..0e54bfd 100644 +--- a/src/cbor/maps.h ++++ b/src/cbor/maps.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_MAPS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -25,28 +26,28 @@ extern "C" { + * @param item[borrow] A map + * @return The number of pairs + */ +-size_t cbor_map_size(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_map_size(const cbor_item_t *item); + + /** Get the size of the allocated storage + * + * @param item[borrow] A map + * @return Allocated storage size (as the number of #cbor_pair items) + */ +-size_t cbor_map_allocated(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_map_allocated(const cbor_item_t *item); + + /** Create a new definite map + * + * @param size The number of slots to preallocate + * @return **new** definite map. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_new_definite_map(size_t size); ++CBOR_EXPORT cbor_item_t *cbor_new_definite_map(size_t size); + + /** Create a new indefinite map + * + * @param size The number of slots to preallocate + * @return **new** definite map. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_new_indefinite_map(); ++CBOR_EXPORT cbor_item_t *cbor_new_indefinite_map(); + + /** Add a pair to the map + * +@@ -58,7 +59,7 @@ cbor_item_t *cbor_new_indefinite_map(); + * @return `true` on success, `false` if either reallocation failed or the + * preallcoated storage is full + */ +-bool cbor_map_add(cbor_item_t *item, struct cbor_pair pair); ++CBOR_EXPORT bool cbor_map_add(cbor_item_t *item, struct cbor_pair pair); + + /** Add a key to the map + * +@@ -69,7 +70,7 @@ bool cbor_map_add(cbor_item_t *item, struct cbor_pair pair); + * @return `true` on success, `false` if either reallocation failed or the + * preallcoated storage is full + */ +-bool _cbor_map_add_key(cbor_item_t *item, cbor_item_t *key); ++CBOR_EXPORT bool _cbor_map_add_key(cbor_item_t *item, cbor_item_t *key); + + /** Add a value to the map + * +@@ -80,21 +81,21 @@ bool _cbor_map_add_key(cbor_item_t *item, cbor_item_t *key); + * @return `true` on success, `false` if either reallocation failed or the + * preallcoated storage is full + */ +-bool _cbor_map_add_value(cbor_item_t *item, cbor_item_t *value); ++CBOR_EXPORT bool _cbor_map_add_value(cbor_item_t *item, cbor_item_t *value); + + /** Is this map definite? + * + * @param item[borrow] A map + * @return Is this map definite? + */ +-bool cbor_map_is_definite(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_map_is_definite(const cbor_item_t *item); + + /** Is this map indefinite? + * + * @param item[borrow] A map + * @return Is this map indefinite? + */ +-bool cbor_map_is_indefinite(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_map_is_indefinite(const cbor_item_t *item); + + /** Get the pairs storage + * +@@ -102,7 +103,7 @@ bool cbor_map_is_indefinite(const cbor_item_t *item); + * @return Array of #cbor_map_size pairs. Manipulation is possible as long as + * references remain valid. + */ +-struct cbor_pair *cbor_map_handle(const cbor_item_t *item); ++CBOR_EXPORT struct cbor_pair *cbor_map_handle(const cbor_item_t *item); + + #ifdef __cplusplus + } +diff --git a/src/cbor/serialization.h b/src/cbor/serialization.h +index ef68cf8..4ba4a7a 100644 +--- a/src/cbor/serialization.h ++++ b/src/cbor/serialization.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_SERIALIZATION_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -27,8 +28,9 @@ extern "C" { + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize(const cbor_item_t *item, cbor_mutable_data buffer, +- size_t buffer_size); ++CBOR_EXPORT size_t cbor_serialize(const cbor_item_t *item, ++ cbor_mutable_data buffer, ++ size_t buffer_size); + + /** Serialize the given item, allocating buffers as needed + * +@@ -42,8 +44,9 @@ size_t cbor_serialize(const cbor_item_t *item, cbor_mutable_data buffer, + * @return Length of the result. 0 on failure, in which case \p buffer is + * ``NULL``. + */ +-size_t cbor_serialize_alloc(const cbor_item_t *item, cbor_mutable_data *buffer, +- size_t *buffer_size); ++CBOR_EXPORT size_t cbor_serialize_alloc(const cbor_item_t *item, ++ cbor_mutable_data *buffer, ++ size_t *buffer_size); + + /** Serialize an uint + * +@@ -52,7 +55,8 @@ size_t cbor_serialize_alloc(const cbor_item_t *item, cbor_mutable_data *buffer, + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data, size_t); ++CBOR_EXPORT size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data, ++ size_t); + + /** Serialize a negint + * +@@ -61,7 +65,8 @@ size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data, size_t); + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data, size_t); ++CBOR_EXPORT size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data, ++ size_t); + + /** Serialize a bytestring + * +@@ -70,7 +75,8 @@ size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data, size_t); + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_bytestring(const cbor_item_t *, cbor_mutable_data, ++CBOR_EXPORT size_t cbor_serialize_bytestring(const cbor_item_t *, ++ cbor_mutable_data, + size_t); + + /** Serialize a string +@@ -80,7 +86,8 @@ size_t cbor_serialize_bytestring(const cbor_item_t *, cbor_mutable_data, + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data, size_t); ++CBOR_EXPORT size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data, ++ size_t); + + /** Serialize an array + * +@@ -89,7 +96,8 @@ size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data, size_t); + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data, size_t); ++CBOR_EXPORT size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data, ++ size_t); + + /** Serialize a map + * +@@ -98,7 +106,8 @@ size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data, size_t); + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data, size_t); ++CBOR_EXPORT size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data, ++ size_t); + + /** Serialize a tag + * +@@ -107,7 +116,8 @@ size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data, size_t); + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data, size_t); ++CBOR_EXPORT size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data, ++ size_t); + + /** Serialize a + * +@@ -116,8 +126,9 @@ size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data, size_t); + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +-size_t cbor_serialize_float_ctrl(const cbor_item_t *, cbor_mutable_data, +- size_t); ++CBOR_EXPORT size_t cbor_serialize_float_ctrl(const cbor_item_t *, ++ cbor_mutable_data, ++ size_t); + + #ifdef __cplusplus + } +diff --git a/src/cbor/streaming.h b/src/cbor/streaming.h +index d9d54b8..afdc835 100644 +--- a/src/cbor/streaming.h ++++ b/src/cbor/streaming.h +@@ -10,6 +10,7 @@ + + #include "callbacks.h" + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -25,7 +26,7 @@ extern "C" { + * @param callbacks The callback bundle + * @param context An arbitrary pointer to allow for maintaining context. + */ +-struct cbor_decoder_result cbor_stream_decode( ++CBOR_EXPORT struct cbor_decoder_result cbor_stream_decode( + cbor_data buffer, size_t buffer_size, + const struct cbor_callbacks* callbacks, void* context); + +diff --git a/src/cbor/strings.h b/src/cbor/strings.h +index 342d098..4930d4b 100644 +--- a/src/cbor/strings.h ++++ b/src/cbor/strings.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_STRINGS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -27,7 +28,7 @@ extern "C" { + * @param item[borrow] a definite string + * @return length of the string. Zero if no chunk has been attached yet + */ +-size_t cbor_string_length(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_string_length(const cbor_item_t *item); + + /** The number of codepoints in this string + * +@@ -36,21 +37,21 @@ size_t cbor_string_length(const cbor_item_t *item); + * @param item[borrow] A string + * @return The number of codepoints in this string + */ +-size_t cbor_string_codepoint_count(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_string_codepoint_count(const cbor_item_t *item); + + /** Is the string definite? + * + * @param item[borrow] a string + * @return Is the string definite? + */ +-bool cbor_string_is_definite(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_string_is_definite(const cbor_item_t *item); + + /** Is the string indefinite? + * + * @param item[borrow] a string + * @return Is the string indefinite? + */ +-bool cbor_string_is_indefinite(const cbor_item_t *item); ++CBOR_EXPORT bool cbor_string_is_indefinite(const cbor_item_t *item); + + /** Get the handle to the underlying string + * +@@ -61,7 +62,7 @@ bool cbor_string_is_indefinite(const cbor_item_t *item); + * @return The address of the underlying string. `NULL` if no data have been + * assigned yet. + */ +-cbor_mutable_data cbor_string_handle(const cbor_item_t *item); ++CBOR_EXPORT cbor_mutable_data cbor_string_handle(const cbor_item_t *item); + + /** Set the handle to the underlying string + * +@@ -76,9 +77,9 @@ cbor_mutable_data cbor_string_handle(const cbor_item_t *item); + * libcbor will deallocate it when appropriate using its free function + * @param length Length of the data block + */ +-void cbor_string_set_handle(cbor_item_t *item, +- cbor_mutable_data CBOR_RESTRICT_POINTER data, +- size_t length); ++CBOR_EXPORT void cbor_string_set_handle(cbor_item_t *item, ++ cbor_mutable_data CBOR_RESTRICT_POINTER data, ++ size_t length); + + /** Get the handle to the array of chunks + * +@@ -88,14 +89,14 @@ void cbor_string_set_handle(cbor_item_t *item, + * @param item[borrow] A indefinite string + * @return array of #cbor_string_chunk_count definite strings + */ +-cbor_item_t **cbor_string_chunks_handle(const cbor_item_t *item); ++CBOR_EXPORT cbor_item_t **cbor_string_chunks_handle(const cbor_item_t *item); + + /** Get the number of chunks this string consist of + * + * @param item[borrow] A indefinite string + * @return The chunk count. 0 for freshly created items. + */ +-size_t cbor_string_chunk_count(const cbor_item_t *item); ++CBOR_EXPORT size_t cbor_string_chunk_count(const cbor_item_t *item); + + /** Appends a chunk to the string + * +@@ -108,7 +109,7 @@ size_t cbor_string_chunk_count(const cbor_item_t *item); + * @return true on success. false on realloc failure. In that case, the refcount + * of `chunk` is not increased and the `item` is left intact. + */ +-bool cbor_string_add_chunk(cbor_item_t *item, cbor_item_t *chunk); ++CBOR_EXPORT bool cbor_string_add_chunk(cbor_item_t *item, cbor_item_t *chunk); + + /** Creates a new definite string + * +@@ -116,7 +117,7 @@ bool cbor_string_add_chunk(cbor_item_t *item, cbor_item_t *chunk); + * + * @return **new** definite string. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_new_definite_string(); ++CBOR_EXPORT cbor_item_t *cbor_new_definite_string(); + + /** Creates a new indefinite string + * +@@ -124,7 +125,7 @@ cbor_item_t *cbor_new_definite_string(); + * + * @return **new** indefinite string. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_new_indefinite_string(); ++CBOR_EXPORT cbor_item_t *cbor_new_indefinite_string(); + + /** Creates a new string and initializes it + * +@@ -133,7 +134,7 @@ cbor_item_t *cbor_new_indefinite_string(); + * @param val A null-terminated UTF-8 string + * @return A **new** string with content `handle`. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_build_string(const char *val); ++CBOR_EXPORT cbor_item_t *cbor_build_string(const char *val); + + /** Creates a new string and initializes it + * +@@ -142,7 +143,7 @@ cbor_item_t *cbor_build_string(const char *val); + * @param val A UTF-8 string, at least \p length long (excluding the null byte) + * @return A **new** string with content `handle`. `NULL` on malloc failure. + */ +-cbor_item_t *cbor_build_stringn(const char *val, size_t length); ++CBOR_EXPORT cbor_item_t *cbor_build_stringn(const char *val, size_t length); + + #ifdef __cplusplus + } +diff --git a/src/cbor/tags.h b/src/cbor/tags.h +index 6e76c82..6b8f871 100644 +--- a/src/cbor/tags.h ++++ b/src/cbor/tags.h +@@ -9,6 +9,7 @@ + #define LIBCBOR_TAGS_H + + #include "cbor/common.h" ++#include "cbor/cbor_export.h" + + #ifdef __cplusplus + extern "C" { +@@ -26,28 +27,28 @@ extern "C" { + * @return **new** tag. Item reference is `NULL`. Returns `NULL` upon + * memory allocation failure + */ +-cbor_item_t *cbor_new_tag(uint64_t value); ++CBOR_EXPORT cbor_item_t *cbor_new_tag(uint64_t value); + + /** Get the tagged item + * + * @param item[borrow] A tag + * @return **incref** the tagged item + */ +-cbor_item_t *cbor_tag_item(const cbor_item_t *item); ++CBOR_EXPORT cbor_item_t *cbor_tag_item(const cbor_item_t *item); + + /** Get tag value + * + * @param item[borrow] A tag + * @return The tag value. Please consult the tag repository + */ +-uint64_t cbor_tag_value(const cbor_item_t *item); ++CBOR_EXPORT uint64_t cbor_tag_value(const cbor_item_t *item); + + /** Set the tagged item + * + * @param item[borrow] A tag + * @param tagged_item[incref] The item to tag + */ +-void cbor_tag_set_item(cbor_item_t *item, cbor_item_t *tagged_item); ++CBOR_EXPORT void cbor_tag_set_item(cbor_item_t *item, cbor_item_t *tagged_item); + + /** Build a new tag + * +@@ -55,7 +56,7 @@ void cbor_tag_set_item(cbor_item_t *item, cbor_item_t *tagged_item); + * @param value Tag value + * @return **new** tag item + */ +-cbor_item_t *cbor_build_tag(uint64_t value, cbor_item_t *item); ++CBOR_EXPORT cbor_item_t *cbor_build_tag(uint64_t value, cbor_item_t *item); + + #ifdef __cplusplus + } diff --git a/recipes/libcbor/all/patches/0.7.0/002_fix_cmake_module_path.patch b/recipes/libcbor/all/patches/0.7.0/002_fix_cmake_module_path.patch new file mode 100644 index 0000000000000..3c9e0c835ddbe --- /dev/null +++ b/recipes/libcbor/all/patches/0.7.0/002_fix_cmake_module_path.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7552c0f..52185e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ + cmake_minimum_required(VERSION 2.8) + project(libcbor) +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/") ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/") + include(CTest) + + SET(CBOR_VERSION_MAJOR "0") diff --git a/recipes/libcbor/all/test_package/CMakeLists.txt b/recipes/libcbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..94fca8fa66406 --- /dev/null +++ b/recipes/libcbor/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libcbor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libcbor::libcbor) + +if(libcbor_VERSION VERSION_GREATER_EQUAL "0.10.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE -DLIBCBOR_DEPRECATE_CUSTOM_ALLOC) +endif() diff --git a/recipes/libcbor/all/test_package/conanfile.py b/recipes/libcbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libcbor/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/libcbor/all/test_package/test_package.c b/recipes/libcbor/all/test_package/test_package.c new file mode 100644 index 0000000000000..63def1fbfb9b0 --- /dev/null +++ b/recipes/libcbor/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include +#include + +int main(int argc, char *argv[]) { + printf("Hello from libcbor %s\n", CBOR_VERSION); +#ifndef LIBCBOR_DEPRECATE_CUSTOM_ALLOC + printf("Custom allocation support: %s\n", CBOR_CUSTOM_ALLOC ? "yes" : "no"); +#endif + printf("Pretty-printer support: %s\n", CBOR_PRETTY_PRINTER ? "yes" : "no"); + printf("Buffer growth factor: %f\n", (float)CBOR_BUFFER_GROWTH); + cbor_item_t *array = cbor_new_definite_array(4); + cbor_array_push(array, cbor_move(cbor_build_uint8(4))); + cbor_array_push(array, cbor_move(cbor_build_uint8(3))); + cbor_array_push(array, cbor_move(cbor_build_uint8(1))); + cbor_array_push(array, cbor_move(cbor_build_uint8(2))); + + cbor_describe(array, stdout); + fflush(stdout); + /* Preallocate the map structure */ +} diff --git a/recipes/libcbor/all/test_v1_package/CMakeLists.txt b/recipes/libcbor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libcbor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libcbor/all/test_v1_package/conanfile.py b/recipes/libcbor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libcbor/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/libcbor/config.yml b/recipes/libcbor/config.yml new file mode 100644 index 0000000000000..7eceffdad45cc --- /dev/null +++ b/recipes/libcbor/config.yml @@ -0,0 +1,11 @@ +versions: + "0.10.2": + folder: "all" + "0.10.1": + folder: "all" + "0.10.0": + folder: "all" + "0.9.0": + folder: "all" + "0.7.0": + folder: "all" diff --git a/recipes/libccd/all/conandata.yml b/recipes/libccd/all/conandata.yml new file mode 100644 index 0000000000000..d40aeb4acea25 --- /dev/null +++ b/recipes/libccd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1": + url: "https://github.com/danfis/libccd/archive/v2.1.tar.gz" + sha256: "542b6c47f522d581fbf39e51df32c7d1256ac0c626e7c2b41f1040d4b9d50d1e" diff --git a/recipes/libccd/all/conanfile.py b/recipes/libccd/all/conanfile.py new file mode 100644 index 0000000000000..16be5e2915439 --- /dev/null +++ b/recipes/libccd/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class LibccdConan(ConanFile): + name = "libccd" + description = "Library for collision detection between two convex shapes." + license = "BSD-3-Clause" + topics = ("collision", "3d") + homepage = "https://github.com/danfis/libccd" + 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], + "enable_double_precision": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_double_precision": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["ENABLE_DOUBLE_PRECISION"] = self.options.enable_double_precision + tc.variables["CCD_HIDE_ALL_SYMBOLS"] = not self.options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "BSD-LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "ccd")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"ccd": "ccd::ccd"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ccd") + self.cpp_info.set_property("cmake_target_name", "ccd") + self.cpp_info.set_property("pkg_config_name", "ccd") + + self.cpp_info.libs = ["ccd"] + if not self.options.shared: + self.cpp_info.defines.append("CCD_STATIC_DEFINE") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "ccd" + self.cpp_info.names["cmake_find_package_multi"] = "ccd" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "ccd" diff --git a/recipes/libccd/all/test_package/CMakeLists.txt b/recipes/libccd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..776995184ae2f --- /dev/null +++ b/recipes/libccd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ccd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ccd) diff --git a/recipes/libccd/all/test_package/conanfile.py b/recipes/libccd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libccd/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/libccd/all/test_package/test_package.c b/recipes/libccd/all/test_package/test_package.c new file mode 100644 index 0000000000000..eac9c4c40726d --- /dev/null +++ b/recipes/libccd/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main() { + ccd_t ccd; + CCD_INIT(&ccd); + + return 0; +} diff --git a/recipes/libccd/all/test_v1_package/CMakeLists.txt b/recipes/libccd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libccd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libccd/all/test_v1_package/conanfile.py b/recipes/libccd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libccd/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/libccd/config.yml b/recipes/libccd/config.yml new file mode 100644 index 0000000000000..adf6918baab9c --- /dev/null +++ b/recipes/libccd/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1": + folder: all diff --git a/recipes/libcds/all/conandata.yml b/recipes/libcds/all/conandata.yml new file mode 100644 index 0000000000000..2c037db058371 --- /dev/null +++ b/recipes/libcds/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.3.3": + url: "https://github.com/khizmax/libcds/archive/v2.3.3.tar.gz" + sha256: "f090380ecd6b63a3c2b2f0bdb27260de2ccb22486ef7f47cc1175b70c6e4e388" +patches: + "2.3.3": + - patch_file: "patches/fix-cmake.patch" diff --git a/recipes/libcds/all/conanfile.py b/recipes/libcds/all/conanfile.py new file mode 100644 index 0000000000000..4e60a137e0fd6 --- /dev/null +++ b/recipes/libcds/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibcdsConan(ConanFile): + name = "libcds" + description = "C++11 library of Concurrent Data Structures." + license = "BSL-1.0" + topics = ("concurrent", "lock-free", "containers", "hazard-pointer", "rcu") + homepage = "https://github.com/khizmax/libcds" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("Macos M1 not supported (yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_TESTS"] = False + tc.variables["WITH_TESTS_COVERAGE"] = False + tc.variables["WITH_BOOST_ATOMIC"] = False + tc.variables["WITH_ASAN"] = False + tc.variables["WITH_TSAN"] = False + tc.variables["ENABLE_UNIT_TEST"] = False + tc.variables["ENABLE_STRESS_TEST"] = False + 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, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + cmake_target = "cds" if self.options.shared else "cds-s" + self.cpp_info.set_property("cmake_file_name", "LibCDS") + self.cpp_info.set_property("cmake_target_name", f"LibCDS::{cmake_target}") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_libcds"].libs = collect_libs(self) + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.components["_libcds"].defines = ["CDS_BUILD_STATIC_LIB"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_libcds"].system_libs = ["m", "pthread"] + if self.settings.compiler in ["gcc", "clang", "apple-clang"] and self.settings.arch == "x86_64": + self.cpp_info.components["_libcds"].cxxflags = ["-mcx16"] + self.cpp_info.components["_libcds"].requires = ["boost::boost"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "LibCDS" + self.cpp_info.names["cmake_find_package_multi"] = "LibCDS" + self.cpp_info.components["_libcds"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["_libcds"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["_libcds"].set_property("cmake_target_name", f"LibCDS::{cmake_target}") diff --git a/recipes/libcds/all/patches/fix-cmake.patch b/recipes/libcds/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..e607df33f84ee --- /dev/null +++ b/recipes/libcds/all/patches/fix-cmake.patch @@ -0,0 +1,57 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -85,7 +85,6 @@ endif(WITH_TESTS_COVERAGE) + set(CDS_SHARED_LIBRARY ${PROJECT_NAME}) + set(CDS_STATIC_LIBRARY ${PROJECT_NAME}-s) + +-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + + if(CDS_BIN_DIR) +@@ -162,33 +161,35 @@ set(SOURCES src/init.cpp + src/topology_osx.cpp + src/dllmain.cpp) + ++if(BUILD_SHARED_LIBS) + add_library(${CDS_SHARED_LIBRARY} SHARED ${SOURCES}) + set_target_properties(${CDS_SHARED_LIBRARY} PROPERTIES VERSION ${PROJECT_VERSION} + DEBUG_POSTFIX "_d") +-if(MINGW) ++if(WIN32) + set_target_properties(${CDS_SHARED_LIBRARY} PROPERTIES DEFINE_SYMBOL CDS_BUILD_LIB) + endif() + ++target_link_libraries(${CDS_SHARED_LIBRARY} PRIVATE ${CMAKE_THREAD_LIBS_INIT}) ++target_include_directories(${CDS_SHARED_LIBRARY} INTERFACE "$" ++ $) ++target_compile_options(${CDS_SHARED_LIBRARY} PUBLIC "${LIBCDS_PUBLIC_CXX_FLAGS}") ++target_compile_options(${CDS_SHARED_LIBRARY} PRIVATE "${LIBCDS_PRIVATE_CXX_FLAGS}") ++install(TARGETS ${CDS_SHARED_LIBRARY} EXPORT LibCDSConfig LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) ++else() + add_library(${CDS_STATIC_LIBRARY} STATIC ${SOURCES}) + set_target_properties(${CDS_STATIC_LIBRARY} PROPERTIES DEBUG_POSTFIX "_d") +-if(MINGW) +- target_compile_definitions(${CDS_STATIC_LIBRARY} PRIVATE CDS_BUILD_STATIC_LIB) ++if(WIN32) ++ target_compile_definitions(${CDS_STATIC_LIBRARY} PUBLIC CDS_BUILD_STATIC_LIB) + endif() + +-target_link_libraries(${CDS_SHARED_LIBRARY} PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(${CDS_STATIC_LIBRARY} PRIVATE ${CMAKE_THREAD_LIBS_INIT}) +-target_include_directories(${CDS_SHARED_LIBRARY} INTERFACE "$" +- $) + target_include_directories(${CDS_STATIC_LIBRARY} INTERFACE "$" + $) +-target_compile_options(${CDS_SHARED_LIBRARY} PUBLIC "${LIBCDS_PUBLIC_CXX_FLAGS}") + target_compile_options(${CDS_STATIC_LIBRARY} PUBLIC "${LIBCDS_PUBLIC_CXX_FLAGS}") +-target_compile_options(${CDS_SHARED_LIBRARY} PRIVATE "${LIBCDS_PRIVATE_CXX_FLAGS}") + target_compile_options(${CDS_STATIC_LIBRARY} PRIVATE "${LIBCDS_PRIVATE_CXX_FLAGS}") ++install(TARGETS ${CDS_STATIC_LIBRARY} EXPORT LibCDSConfig LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) ++endif() + +-install(TARGETS ${CDS_SHARED_LIBRARY} EXPORT LibCDSConfig LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT ${LIBRARIES_COMPONENT} NAMELINK_SKIP RUNTIME DESTINATION lib${LIB_SUFFIX}) +-install(TARGETS ${CDS_SHARED_LIBRARY} EXPORT LibCDSConfig LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT ${HEADERS_COMPONENT} NAMELINK_ONLY) +-install(TARGETS ${CDS_STATIC_LIBRARY} EXPORT LibCDSConfig DESTINATION lib${LIB_SUFFIX} COMPONENT ${LIBRARIES_COMPONENT}) + install(EXPORT LibCDSConfig FILE LibCDSConfig.cmake NAMESPACE LibCDS:: DESTINATION lib/cmake/LibCDS) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/cds DESTINATION include COMPONENT ${HEADERS_COMPONENT}) + diff --git a/recipes/libcds/all/test_package/CMakeLists.txt b/recipes/libcds/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..481acf254620b --- /dev/null +++ b/recipes/libcds/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(LibCDS REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET LibCDS::cds-s) + target_link_libraries(${PROJECT_NAME} PRIVATE LibCDS::cds-s) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LibCDS::cds) +endif() diff --git a/recipes/libcds/all/test_package/conanfile.py b/recipes/libcds/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libcds/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/libcds/all/test_package/test_package.cpp b/recipes/libcds/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..21abb4e2d396b --- /dev/null +++ b/recipes/libcds/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() { + cds::Initialize(); + { + cds::gc::HP hpGC; + cds::threading::Manager::attachThread(); + } + cds::Terminate(); + return 0; +} diff --git a/recipes/libcds/all/test_v1_package/CMakeLists.txt b/recipes/libcds/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libcds/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libcds/all/test_v1_package/conanfile.py b/recipes/libcds/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libcds/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/libcds/config.yml b/recipes/libcds/config.yml new file mode 100644 index 0000000000000..2f70bfab6adbf --- /dev/null +++ b/recipes/libcds/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.3": + folder: all diff --git a/recipes/libcheck/all/CMakeLists.txt b/recipes/libcheck/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/libcheck/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libcheck/all/conandata.yml b/recipes/libcheck/all/conandata.yml new file mode 100644 index 0000000000000..767df99b3d51a --- /dev/null +++ b/recipes/libcheck/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.15.2": + url: "https://github.com/libcheck/check/releases/download/0.15.2/check-0.15.2.tar.gz" + sha256: "a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a" +patches: + "0.15.2": + - patch_file: "patches/0001-remove-check-h-header.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-disable-cmake-subproject-check.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-don-t-check-subunit-dependency.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-install-shared-static-exclusive.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-add-missing-lib-pthread_mutex-c.patch" + base_path: "source_subfolder" diff --git a/recipes/libcheck/all/conanfile.py b/recipes/libcheck/all/conanfile.py new file mode 100644 index 0000000000000..5113b075852b0 --- /dev/null +++ b/recipes/libcheck/all/conanfile.py @@ -0,0 +1,119 @@ +from conans import CMake, ConanFile, tools +import os + +required_conan_version = ">=1.43.0" + + +class LibCheckConan(ConanFile): + name = "libcheck" + description = "A unit testing framework for C" + topics = ("libcheck", "unit", "testing", "framework", "C") + license = "LGPL-2.1-or-later" + homepage = "https://github.com/libcheck/check" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_subunit": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_subunit": 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 _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_subunit: + self.requires("subunit/1.4.0") + + 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["CHECK_ENABLE_TESTS"] = False + self._cmake.definitions["ENABLE_MEMORY_LEAKING_TESTS"] = False + self._cmake.definitions["CHECK_ENABLE_TIMEOUT_TESTS"] = False + self._cmake.definitions["HAVE_SUBUNIT"] = self.options.with_subunit + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING.LESSER", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + target = "checkShared" if self.options.shared else "check" + self.cpp_info.set_property("cmake_file_name", "check") + self.cpp_info.set_property("cmake_target_name", "Check::{}".format(target)) + self.cpp_info.set_property("pkg_config_name", "check") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + libsuffix = "Dynamic" if self._is_msvc and self.options.shared else "" + self.cpp_info.components["liblibcheck"].libs = ["check{}".format(libsuffix)] + if self.options.with_subunit: + self.cpp_info.components["liblibcheck"].requires.append("subunit::libsubunit") + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["liblibcheck"].system_libs = ["m", "pthread", "rt"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "check" + self.cpp_info.filenames["cmake_find_package_multi"] = "check" + self.cpp_info.names["cmake_find_package"] = "Check" + self.cpp_info.names["cmake_find_package_multi"] = "Check" + self.cpp_info.names["pkg_config"] = "check" + self.cpp_info.components["liblibcheck"].names["cmake_find_package"] = target + self.cpp_info.components["liblibcheck"].names["cmake_find_package_multi"] = target + self.cpp_info.components["liblibcheck"].set_property("cmake_target_name", "Check::{}".format(target)) + self.cpp_info.components["liblibcheck"].set_property("pkg_config_name", "check") diff --git a/recipes/libcheck/all/patches/0001-remove-check-h-header.patch b/recipes/libcheck/all/patches/0001-remove-check-h-header.patch new file mode 100644 index 0000000000000..9a50d373efec5 --- /dev/null +++ b/recipes/libcheck/all/patches/0001-remove-check-h-header.patch @@ -0,0 +1,2372 @@ +--- src/check.h ++++ /dev/null +@@ -1,2366 +0,0 @@ +-/*-*- mode:C; -*- */ +-/* +- * Check: a unit test framework for C +- * Copyright (C) 2001, 2002 Arien Malec +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the +- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +- * MA 02110-1301, USA. +- */ +- +-#ifndef CHECK_H +-#define CHECK_H +- +-#include +-#include +-#include +-#include +- +-#include +- +-/* +- Macros and functions starting with _ (underscore) are internal and +- may change without notice. You have been warned!. +-*/ +- +- +-#ifdef __cplusplus +-#define CK_CPPSTART extern "C" { +-#define CK_CPPEND } +-CK_CPPSTART +-#endif +- +-/** +- * __GNUC_PATCHLEVEL__ is new to GCC 3.0; +- * it is also present in the widely-used development snapshots leading up to 3.0 +- * (which identify themselves as GCC 2.96 or 2.97, depending on which snapshot you have). +- * +- * https://stackoverflow.com/questions/1936719/what-are-the-gcc-predefined-macros-for-the-compilers-version-number/1936745#1936745 +- */ +- +-#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +-#define GCC_VERSION_AT_LEAST(major, minor, patch) \ +-((__GNUC__ > (major)) || \ +- (__GNUC__ == (major) && __GNUC_MINOR__ > (minor)) || \ +- (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patch)) ) +-#elif defined(__GNUC__) && defined(__GNUC_MINOR__) +-#define GCC_VERSION_AT_LEAST(major, minor, patch) \ +-((__GNUC__ > (major)) || \ +- (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) +-#else +-#define GCC_VERSION_AT_LEAST(major, minor, patch) 0 +-#endif +- +-#if GCC_VERSION_AT_LEAST(2,95,3) +-#define CK_ATTRIBUTE_UNUSED __attribute__ ((unused)) +-#define CK_ATTRIBUTE_FORMAT(a, b, c) __attribute__ ((format (a, b, c))) +-#else +-#define CK_ATTRIBUTE_UNUSED +-#define CK_ATTRIBUTE_FORMAT(a, b, c) +-#endif /* GCC 2.95 */ +- +-#if GCC_VERSION_AT_LEAST(2,5,0) +-#define CK_ATTRIBUTE_NORETURN __attribute__ ((noreturn)) +-#else +-#define CK_ATTRIBUTE_NORETURN +-#endif /* GCC 2.5 */ +- +-#if GCC_VERSION_AT_LEAST(4,7,4) && (__STDC_VERSION__ >= 199901L) +-/* Operator _Pragma introduced in C99 */ +-#define CK_DIAGNOSTIC_STRINGIFY(x) #x +-#define CK_DIAGNOSTIC_HELPER1(y) CK_DIAGNOSTIC_STRINGIFY(GCC diagnostic ignored y) +-#define CK_DIAGNOSTIC_HELPER2(z) CK_DIAGNOSTIC_HELPER1(#z) +-#define CK_DIAGNOSTIC_PUSH_IGNORE(w) \ +- _Pragma("GCC diagnostic push") \ +- _Pragma(CK_DIAGNOSTIC_HELPER2(w)) +-#define CK_DIAGNOSTIC_POP(w) _Pragma ("GCC diagnostic pop") +-#else +-#define CK_DIAGNOSTIC_PUSH_IGNORE(w) +-#define CK_DIAGNOSTIC_POP(w) +-#endif /* GCC 4.7.4 */ +- +-#undef GCC_VERSION_AT_LEAST +- +-#include +- +-#if defined(_MSC_VER) +-/* define pid_t for Windows, as it is needed later */ +-#define pid_t int +-#endif /* _MSC_VER */ +- +-/* +- * Used to create the linker script for hiding lib-local symbols. Shall +- * be put directly in front of the exported symbol. +- */ +-#define CK_EXPORT +- +-/* +- * Used for MSVC to create the export attribute +- * CK_DLL_EXP is defined during the compilation of the library +- * on the command line. +- * +- * This definition is only used when building or linking to +- * the shared library, i.e. libcheck.so. When building the library +- * the value must be "_declspec(dllexport)". +- * When linking with the library, the value must be "_declspec(dllimport)" +- * +- * This is only used with Microsoft Visual C. In other systems +- * the value is empty. In MSVC the value is empty when linking with +- * a static library. +- */ +-#ifndef CK_DLL_EXP +-#define CK_DLL_EXP +-#endif +- +-/* check version numbers */ +- +-#define CHECK_MAJOR_VERSION (0) +-#define CHECK_MINOR_VERSION (15) +-#define CHECK_MICRO_VERSION (2) +- +-CK_DLL_EXP extern int CK_EXPORT check_major_version; +-CK_DLL_EXP extern int CK_EXPORT check_minor_version; +-CK_DLL_EXP extern int CK_EXPORT check_micro_version; +- +-#ifndef NULL +-#define NULL ((void*)0) +-#endif +- +-/** +- * Type for a test case +- * +- * A TCase represents a test case. Create with tcase_create, free +- * with tcase_free. For the moment, test cases can only be run +- * through a suite +-*/ +-typedef struct TCase TCase; +- +-/** +- * Type for a test function +- */ +-typedef void (*TFun) (int); +- +-/** +- * Type for a setup/teardown function +- */ +-typedef void (*SFun) (void); +- +-/** +- * Type for a test suite +- */ +-typedef struct Suite Suite; +- +-/** +- * Type for a test, which wraps a test function +- */ +-typedef struct TTest { +- const char *name; +- TFun fn; +- const char *file; +- int line; +-} TTest; +- +-/** +- * Creates a test suite with the given name. +- * +- * Create a suite, which will contain test cases. Once +- * created, use suite_add_tcase() to add test cases. +- * When finished, create a suite runner from the +- * suite using srunner_create() +- * +- * @param name name of the suite +- * +- * @return suite +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP Suite *CK_EXPORT suite_create(const char *name); +- +-/** +- * Determines whether a given test suite contains a case named after a +- * given string. +- * +- * @param s suite to check +- * @param tcname test case to look for +- * +- * @return 1 iff the given test case is within the given suite; +- * 0 otherwise +- * +- * @since 0.9.9 +- */ +-CK_DLL_EXP int CK_EXPORT suite_tcase(Suite * s, const char *tcname); +- +-/** +- * Add a test case to a suite. +- * +- * Note that if the TCase has already been added attempting +- * to add it again will be ignored. +- * +- * @param s suite to add test case to +- * @param tc test case to add to suite +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP void CK_EXPORT suite_add_tcase(Suite * s, TCase * tc); +- +-/** +- * Create a test case. +- * +- * Once created, tests can be added with the tcase_add_test() +- * function, and the test case assigned to a suite with the +- * suite_add_tcase() function. +- * +- * @param name name of the test case +- * +- * @return test case containing no tests +- * +- * @since 0.6.0 +- * */ +-CK_DLL_EXP TCase *CK_EXPORT tcase_create(const char *name); +- +-/** +- * Associate a test case with certain tags. +- * Replaces any existing tags with the new set. +- * +- * @param tc the test case +- * +- * @param tags string containing arbitrary tags separated by spaces. +- * This will be copied. Passing NULL clears all tags. +- * +- * @since 0.11.0 +- * */ +-CK_DLL_EXP void CK_EXPORT tcase_set_tags(TCase * tc, +- const char *tags); +-/** +- * Add a test function to a test case +- * +- * @param tc test case to add test to +- * @param tf test function to add to test case +- * +- * @since 0.6.0 +- * */ +-#define tcase_add_test(tc,tf) tcase_add_test_raise_signal(tc,tf,0) +- +-/** +- * Add a test function with signal handling to a test case +- * +- * The added test is expected to terminate by throwing the given signal +- * +- * @param tc test case to add test to +- * @param tf test function to add to test case +- * @param signal expected signal for test function to throw in order for +- * the test to be considered passing +- * +- * @since 0.9.2 +- * */ +-#define tcase_add_test_raise_signal(tc,ttest,signal) \ +- _tcase_add_test((tc),(ttest),(signal), 0, 0, 1) +- +-/** +- * Add a test function with an expected exit value to a test case +- * +- * The added test is expected to terminate by exiting with the given value +- * +- * @param tc test case to add test to +- * @param tf test function to add to test case +- * @param expected_exit_value exit value for test function to return in +- * order for the test to be considered passing +- * +- * @since 0.9.7 +- */ +-#define tcase_add_exit_test(tc, ttest, expected_exit_value) \ +- _tcase_add_test((tc),(ttest),0,(expected_exit_value),0,1) +- +-/** +- * Add a looping test function to a test case +- * +- * The test will be called in a for(i = s; i < e; i++) loop with each +- * iteration being executed in a new context. The loop variable 'i' is +- * available in the test. +- * +- * @param tc test case to add test to +- * @param tf function to add to test case +- * @param s starting index for value "i" in test +- * @param e ending index for value "i" in test +- * +- * @since 0.9.4 +- */ +-#define tcase_add_loop_test(tc,ttest,s,e) \ +- _tcase_add_test((tc),(ttest),0,0,(s),(e)) +- +-/** +- * Add a looping test function with signal handling to a test case +- * +- * The test will be called in a for(i = s; i < e; i++) loop with each +- * iteration being executed in a new context. The loop variable 'i' is +- * available in the test. +- * +- * The added test is expected to terminate by throwing the given signal +- * +- * @param tc test case to add test to +- * @param tf function to add to test case +- * @param signal expected signal for test function to throw in order for +- * the test to be considered passing +- * @param s starting index for value "i" in test +- * @param e ending index for value "i" in test +- * +- * @since 0.9.5 +- */ +-#define tcase_add_loop_test_raise_signal(tc,ttest,signal,s,e) \ +- _tcase_add_test((tc),(ttest),(signal),0,(s),(e)) +- +-/** +- * Add a looping test function with an expected exit value to a test case +- * +- * The test will be called in a for(i = s; i < e; i++) loop with each +- * iteration being executed in a new context. The loop variable 'i' is +- * available in the test. +- * +- * The added test is expected to terminate by exiting with the given value +- * +- * @param tc test case to add test to +- * @param tf function to add to test case +- * @param expected_exit_value exit value for test function to return in +- * order for the test to be considered passing +- * @param s starting index for value "i" in test +- * @param e ending index for value "i" in test +- * +- * @since 0.9.7 +- */ +-#define tcase_add_loop_exit_test(tc,ttest,expected_exit_value,s,e) \ +- _tcase_add_test((tc),(ttest),0,(expected_exit_value),(s),(e)) +- +-/* Add a test function to a test case +- (function version -- use this when the macro won't work +-*/ +-CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest, +- int _signal, int allowed_exit_value, +- int start, int end); +- +-/** +- * Add unchecked fixture setup/teardown functions to a test case +- * +- * Unchecked fixture functions are run at the start and end of the +- * test case, and not before and after unit tests. Further, +- * unchecked fixture functions are not run in a separate address space, +- * like test functions, and so must not exit or signal (e.g., +- * segfault). +- * +- * Also, when run in CK_NOFORK mode, unchecked fixture functions may +- * lead to different unit test behavior if unit tests change data +- * setup by the fixture functions. +- * +- * Note that if a setup function fails, the remaining setup functions +- * will be omitted, as will the test case and the teardown functions. +- * If a teardown function fails the remaining teardown functins will be +- * omitted. +- * +- * @param tc test case to add unchecked fixture setup/teardown to +- * @param setup function to add to be executed before the test case; +- * if NULL no setup function is added +- * @param teardown function to add to be executed after the test case; +- * if NULL no teardown function is added +- * @since 0.8.0 +- */ +-CK_DLL_EXP void CK_EXPORT tcase_add_unchecked_fixture(TCase * tc, SFun setup, +- SFun teardown); +- +-/** +- * Add checked fixture setup/teardown functions to a test case +- * +- * Checked fixture functions are run before and after each unit test inside +- * of the address space of the test. Thus, if using CK_FORK +- * mode the separate process running the unit test will survive signals +- * or unexpected exits in the fixture function. Also, if the setup +- * function is idempotent, unit test behavior will be the same in +- * CK_FORK and CK_NOFORK modes. +- * +- * However, since fixture functions are run before and after each unit +- * test, they should not be expensive code. +- * +- * Note that if a setup function fails, the remaining setup functions +- * will be omitted, as will the test and the teardown functions. If a +- * teardown function fails the remaining teardown functins will be +- * omitted. +- * +- * @param tc test case to add checked fixture setup/teardown to +- * @param setup function to add to be executed before each unit test in +- * the test case; if NULL no setup function is added +- * @param teardown function to add to be executed after each unit test in +- * the test case; if NULL no teardown function is added +- * +- * @since 0.8.0 +-*/ +-CK_DLL_EXP void CK_EXPORT tcase_add_checked_fixture(TCase * tc, SFun setup, +- SFun teardown); +- +-/** +- * Set the timeout for all tests in a test case. +- * +- * A test that lasts longer than the timeout (in seconds) will be killed +- * and thus fail with an error. +- * +- * If not set, the default timeout is one assigned at compile time. If +- * the environment variable CK_DEFAULT_TIMEOUT is defined and no timeout +- * is set, the value in the environment variable is used. +- * +- * If Check is compile without fork() support this call is ignored, +- * as timeouts are not possible. +- * +- * @param tc test case to assign timeout to +- * @param timeout to use, in seconds. If the value contains a decimal +- * portion, but no high resolution timer is available, +- * the value is rounded up to the nearest second. +- * +- * @since 0.9.2 +- */ +-CK_DLL_EXP void CK_EXPORT tcase_set_timeout(TCase * tc, double timeout); +- +-/* Internal function to mark the start of a test function */ +-CK_DLL_EXP void CK_EXPORT tcase_fn_start(const char *fname, const char *file, +- int line); +- +-/** +- * Retreive the name of the current running test. This is the name +- * of the test passed to START_TEST. This is only valid when called +- * from a running test. The value return outside of a running test is +- * undefined. +- * +- * @since 0.11.0 +- */ +-CK_DLL_EXP const char* CK_EXPORT tcase_name(void); +- +-/** +- * Start a unit test with START_TEST(unit_name), end with END_TEST. +- * +- * One must use braces within a START_/END_ pair to declare new variables +- * +- * @since 0.6.0 +- */ +-#define START_TEST(__testname)\ +-static void __testname ## _fn (int _i CK_ATTRIBUTE_UNUSED);\ +-static const TTest __testname ## _ttest = {""# __testname, __testname ## _fn, __FILE__, __LINE__};\ +-static const TTest * __testname = & __testname ## _ttest;\ +-static void __testname ## _fn (int _i CK_ATTRIBUTE_UNUSED) +- +-/** +- * End a unit test +- * +- * @since 0.6.0 +- */ +-#define END_TEST +- +-/* +- * Fail the test case unless expr is false +- * +- * This call is deprecated. +- */ +-#define fail_unless(expr, ...) \ +- (expr) ? \ +- _mark_point(__FILE__, __LINE__) : \ +- _ck_assert_failed(__FILE__, __LINE__, "Assertion '"#expr"' failed" , ## __VA_ARGS__, NULL) +- +-/* +- * Fail the test case if expr is false +- * +- * This call is deprecated. +- * +- * NOTE: The space before the comma sign before ## is essential to be compatible +- * with gcc 2.95.3 and earlier. +- * FIXME: these macros may conflict with C89 if expr is +- * FIXME: strcmp (str1, str2) due to excessive string length. +- */ +-#define fail_if(expr, ...)\ +- (expr) ? \ +- _ck_assert_failed(__FILE__, __LINE__, "Failure '"#expr"' occurred" , ## __VA_ARGS__, NULL) \ +- : _mark_point(__FILE__, __LINE__) +- +-/* +- * Fail the test +- * +- * This call is deprecated. +- */ +-#define fail(...) _ck_assert_failed(__FILE__, __LINE__, "Failed" , ## __VA_ARGS__, NULL) +- +-/* +- * This is called whenever an assertion fails. +- * Note that it only has the noreturn modifier when +- * using fork. If fork is unavailable, the function +- * calls longjmp() when a test assertion fails. Marking +- * the function as noreturn causes gcc to make assumptions +- * which are not valid, as longjmp() is like a return. +- */ +-#if 1 +-CK_DLL_EXP void CK_EXPORT _ck_assert_failed(const char *file, int line, +- const char *expr, const char *msg, +- ...) CK_ATTRIBUTE_NORETURN CK_ATTRIBUTE_FORMAT(printf, 4, 5); +-#else +-CK_DLL_EXP void CK_EXPORT _ck_assert_failed(const char *file, int line, +- const char *expr, const char *msg, +- ...) CK_ATTRIBUTE_FORMAT(printf, 4, 5); +-#endif +- +-/** +- * Fail the test if expression is false +- * +- * @param expr expression to evaluate +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_assert(expr) ck_assert_msg(expr, NULL) +- +-/* The space before the comma sign before ## is essential to be compatible +- with gcc 2.95.3 and earlier. +-*/ +-/** +- * Fail the test if the expression is false; print message on failure +- * +- * @param expr expression to evaluate +- * @param ... message to print (in printf format) if expression is false +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_assert_msg(expr, ...) \ +- (expr) ? \ +- _mark_point(__FILE__, __LINE__) : \ +- _ck_assert_failed(__FILE__, __LINE__, "Assertion '"#expr"' failed" , ## __VA_ARGS__) +- +-/** +- * Unconditionally fail the test +- * +- * @note Once called, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_abort() ck_abort_msg(NULL) +-/** +- * Unconditionally fail the test; print a message +- * +- * @param ... message to print (in printf format) +- * +- * @note Once called, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_abort_msg(...) _ck_assert_failed(__FILE__, __LINE__, "Failed" , ## __VA_ARGS__) +- +-/* Signed and unsigned integer comparison macros with improved output compared to ck_assert(). */ +-/* OP may be any comparison operator. */ +-#define _ck_assert_int(X, OP, Y) do { \ +- intmax_t _ck_x = (X); \ +- intmax_t _ck_y = (Y); \ +- ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s == %jd, %s == %jd", #X" "#OP" "#Y, #X, _ck_x, #Y, _ck_y); \ +-} while (0) +- +-/** +- * Check two signed integers to determine if X==Y +- * +- * If not X==Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_assert_int_eq(X, Y) _ck_assert_int(X, ==, Y) +-/** +- * Check two signed integers to determine if X!=Y +- * +- * If not X!=Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_assert_int_ne(X, Y) _ck_assert_int(X, !=, Y) +-/** +- * Check two signed integers to determine if XY +- * +- * If not X>Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_int_gt(X, Y) _ck_assert_int(X, >, Y) +-/** +- * Check two signed integers to determine if X>=Y +- * +- * If not X>=Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_int_ge(X, Y) _ck_assert_int(X, >=, Y) +- +-#define _ck_assert_uint(X, OP, Y) do { \ +- uintmax_t _ck_x = (X); \ +- uintmax_t _ck_y = (Y); \ +- ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s == %ju, %s == %ju", #X" "#OP" "#Y, #X, _ck_x, #Y, _ck_y); \ +-} while (0) +-/** +- * Check two unsigned integers to determine if X==Y +- * +- * If not X==Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_uint_eq(X, Y) _ck_assert_uint(X, ==, Y) +-/** +- * Check two unsigned integers to determine if X!=Y +- * +- * If not X!=Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_uint_ne(X, Y) _ck_assert_uint(X, !=, Y) +-/** +- * Check two unsigned integers to determine if XY +- * +- * If not X>Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_uint_gt(X, Y) _ck_assert_uint(X, >, Y) +-/** +- * Check two unsigned integers to determine if X>=Y +- * +- * If not X>=Y, the test fails. +- * +- * @param X signed integer +- * @param Y signed integer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_uint_ge(X, Y) _ck_assert_uint(X, >=, Y) +- +-/* Number of digits after the decimal point to output via printf */ +-#ifndef CK_FLOATING_DIG +-# define CK_FLOATING_DIG 6 +-#endif /* CK_FLOATING_DIG */ +- +-/* Floating point number comparison macros with improved output +- * compared to ck_assert(). */ +-/* OP may be any comparison operator, TP is type, TM is type modifier. */ +-#define _ck_assert_floating(X, OP, Y, TP, TM) do { \ +- TP _ck_x = (X); \ +- TP _ck_y = (Y); \ +- ck_assert_msg(_ck_x OP _ck_y, \ +- "Assertion '%s' failed: %s == %.*" TM "g, %s == %.*" TM "g", \ +- #X" "#OP" "#Y, \ +- #X, (int)CK_FLOATING_DIG, _ck_x, \ +- #Y, (int)CK_FLOATING_DIG, _ck_y); \ +-} while (0) +- +-/* Check floating point number is finise. */ +-/* TP is type, TM is type modifier. */ +-#define _ck_assert_floating_finite(X, TP, TM) \ +-do { \ +- TP _ck_x = (X); \ +- ck_assert_msg(isfinite(_ck_x), \ +- "Assertion '%s' failed: %s == %.*" TM "g", \ +- #X" is finite", \ +- #X, (int)CK_FLOATING_DIG, _ck_x); \ +-} while (0) +- +-/* Check floating point number is infinise. */ +-/* TP is type, TM is type modifier. */ +-#define _ck_assert_floating_infinite(X, TP, TM) \ +-do { \ +- TP _ck_x = (X); \ +- ck_assert_msg(isinf(_ck_x), \ +- "Assertion '%s' failed: %s == %.*" TM "g", \ +- #X" is infinite", \ +- #X, (int)CK_FLOATING_DIG, _ck_x); \ +-} while (0) +- +-/* Check floating point number is "Not a Number". */ +-/* TP is type, TM is type modifier. */ +-#define _ck_assert_floating_nan(X, TP, TM) \ +-do { \ +- TP _ck_x = (X); \ +- ck_assert_msg(isnan(_ck_x), \ +- "Assertion '%s' failed: %s == %.*" TM "g", \ +- #X" is NaN", \ +- #X, (int)CK_FLOATING_DIG, _ck_x); \ +-} while (0) +- +-/* Check floating point number is not "Not a Number". */ +-/* TP is type, TM is type modifier. */ +-#define _ck_assert_floating_nonnan(X, TP, TM) \ +-do { \ +- TP _ck_x = (X); \ +- ck_assert_msg(!isnan(_ck_x), \ +- "Assertion '%s' failed: %s == %.*" TM "g", \ +- #X" is not NaN", \ +- #X, (int)CK_FLOATING_DIG, _ck_x); \ +-} while (0) +- +-/* Floating point tolerance comparison macros with improved output +- * compared to ck_assert(). */ +-/* OP, D can have values: >, -1; <, 1. */ +-#define _ck_assert_floating_op_tol(X, OP, Y, T, D, TP, TM) do { \ +- TP _ck_x = (X); \ +- TP _ck_y = (Y); \ +- TP _ck_t = (T); \ +- ck_assert_msg((_ck_x - _ck_y) OP _ck_t * (D), \ +- "Assertion '%s' failed: %s == %.*" TM "g, %s == %.*" TM "g, %s == %.*" TM "g", \ +- #X" "#OP"= "#Y", error < "#T, \ +- #X, (int)CK_FLOATING_DIG, _ck_x, \ +- #Y, (int)CK_FLOATING_DIG, _ck_y, \ +- #T, (int)CK_FLOATING_DIG, _ck_t); \ +-} while (0) +- +-/* Floating point tolerance comparison macros with improved output +- * compared to ck_assert(). */ +-/* OP can have values: <; >=. */ +-#define _ck_assert_floating_absdiff_op_tol(X, Y, OP, T, TP, TM) \ +-do { \ +- TP _ck_x = (X); \ +- TP _ck_y = (Y); \ +- TP _ck_t = (T); \ +- ck_assert_msg(fabsl(_ck_y - _ck_x) OP _ck_t, \ +- "Assertion '%s' failed: %s == %.*" TM "g, %s == %.*" TM "g, %s == %.*" TM "g", \ +- "fabsl("#Y" - "#X") "#OP" "#T, \ +- #X, (int)CK_FLOATING_DIG, _ck_x, \ +- #Y, (int)CK_FLOATING_DIG, _ck_y, \ +- #T, (int)CK_FLOATING_DIG, _ck_t); \ +-} while (0) +- +-/** +- * Check two single precision floating point numbers to determine if X == Y. +- * +- * Note that the usefulness of this assertion is very limited. If you +- * want to compare two floating point numbers for equality, you probably +- * want to use ck_assert_float_eq_tol instead. +- * +- * If not X == Y, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_eq(X, Y) _ck_assert_floating(X, ==, Y, float, "") +-/** +- * Check two single precision floating point numbers to determine if X != Y. +- * +- * Note that the usefulness of this assertion is very limited. If you +- * want to compare two floating point numbers for equality, you probably +- * want to use ck_assert_float_ne_tol instead. +- * +- * If not X != Y, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_ne(X, Y) _ck_assert_floating(X, !=, Y, float, "") +-/** +- * Check two single precision floating point numbers to determine if X < Y +- * +- * If not X < Y, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_lt(X, Y) _ck_assert_floating(X, <, Y, float, "") +-/** +- * Check two single precision floating point numbers to determine if X <= Y +- * +- * If not X <= Y, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_le(X, Y) _ck_assert_floating(X, <=, Y, float, "") +-/** +- * Check two single precision floating point numbers to determine if X > Y +- * +- * If not X > Y, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_gt(X, Y) _ck_assert_floating(X, >, Y, float, "") +-/** +- * Check two single precision floating point numbers to determine if X >= Y +- * +- * If not X >= Y, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_ge(X, Y) _ck_assert_floating(X, >=, Y, float, "") +- +-/** +- * Check two single precision floating point numbers to determine if X≈Y +- * with specified tolerance +- * +- * If not X ≈ Y with error < T, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * @param T tolerance (float) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_eq_tol(X, Y, T) _ck_assert_floating_absdiff_op_tol(X, Y, <, T, float, "") +- +-/** +- * Check two single precision floating point numbers to determine if not X≈Y +- * with specified tolerance +- * +- * If X ≈ Y with error < T, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * @param T tolerance (float) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_ne_tol(X, Y, T) _ck_assert_floating_absdiff_op_tol(X, Y, >=, T, float, "") +- +-/** +- * Check two single precision floating point numbers to determine if X>≈Y +- * with specified tolerance +- * +- * If not X >≈ Y with error < T, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * @param T tolerance (float) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_ge_tol(X, Y, T) _ck_assert_floating_op_tol(X, >, Y, T, -1, float, "") +- +-/** +- * Check two single precision floating point numbers to determine if X<≈Y +- * with specified tolerance +- * +- * If not X <≈ Y with error < T, the test fails. +- * +- * @param X floating point number (float) +- * @param Y floating point number (float) to compare against X +- * @param T tolerance (float) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_le_tol(X, Y, T) _ck_assert_floating_op_tol(X, <, Y, T, 1, float, "") +- +-/** +- * Check that a single precision floating point number is finite; i.e. is +- * not +infinity, -infinity, or "Not a Number" (NaN) +- * +- * If X is +INFINITY or X is -INFINITY, or X is NaN, the test fails. +- * +- * @param X floating point number (float) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_finite(X) _ck_assert_floating_finite(X, float, "") +- +-/** +- * Check that a single precision floating point number is infinite, +- * either +infinity or -infinity +- * +- * If X is not +INFINITY and X is not -INFINITY, the test fails. +- * +- * @param X floating point number (float) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_infinite(X) _ck_assert_floating_infinite(X, float, "") +- +-/** +- * Check that a single precision floating point number +- * is "Not a Number" (NaN) +- * +- * If X is not NaN, the test fails. +- * +- * @param X floating point number (float) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_nan(X) _ck_assert_floating_nan(X, float, "") +- +-/** +- * Check that a single precision floating point number is +- * not "Not a Number" (NaN) +- * +- * If X is NaN, the test fails. +- * +- * @param X floating point number (float) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_float_nonnan(X) _ck_assert_floating_nonnan(X, float, "") +- +-/** +- * Check two double precision floating point numbers to determine if X == Y. +- * +- * Note that the usefulness of this assertion is very limited. If you +- * want to compare two floating point numbers for equality, you probably +- * want to use ck_assert_double_eq_tol instead. +- * +- * If not X == Y, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_eq(X, Y) _ck_assert_floating(X, ==, Y, double, "") +-/** +- * Check two double precision floating point numbers to determine if X != Y. +- * +- * Note that the usefulness of this assertion is very limited. If you +- * want to compare two floating point numbers for equality, you probably +- * want to use ck_assert_double_ne_tol instead. +- * +- * If not X != Y, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_ne(X, Y) _ck_assert_floating(X, !=, Y, double, "") +-/** +- * Check two double precision floating point numbers to determine if X < Y +- * +- * If not X < Y, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_lt(X, Y) _ck_assert_floating(X, <, Y, double, "") +-/** +- * Check two double precision floating point numbers to determine if X <= Y +- * +- * If not X <= Y, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_le(X, Y) _ck_assert_floating(X, <=, Y, double, "") +-/** +- * Check two double precision floating point numbers to determine if X > Y +- * +- * If not X > Y, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_gt(X, Y) _ck_assert_floating(X, >, Y, double, "") +-/** +- * Check two double precision floating point numbers to determine if X >= Y +- * +- * If not X >= Y, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_ge(X, Y) _ck_assert_floating(X, >=, Y, double, "") +- +-/** +- * Check two double precision floating point numbers to determine if X≈Y +- * with specified tolerance +- * +- * If not X ≈ Y with error < T, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * @param T tolerance (double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_eq_tol(X, Y, T) _ck_assert_floating_absdiff_op_tol(X, Y, <, T, double, "") +- +-/** +- * Check two double precision floating point numbers to determine if not X≈Y +- * with specified tolerance +- * +- * If X ≈ Y with error < T, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * @param T tolerance (double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_ne_tol(X, Y, T) _ck_assert_floating_absdiff_op_tol(X, Y, >=, T, double, "") +- +-/** +- * Check two double precision floating point numbers to determine if X>≈Y +- * with specified tolerance +- * +- * If not X >≈ Y with error < T, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * @param T tolerance (double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_ge_tol(X, Y, T) _ck_assert_floating_op_tol(X, >, Y, T, -1, double, "") +- +-/** +- * Check two double precision floating point numbers to determine if X<≈Y +- * with specified tolerance +- * +- * If not X <≈ Y with error < T, the test fails. +- * +- * @param X floating point number (double) +- * @param Y floating point number (double) to compare against X +- * @param T tolerance (double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_le_tol(X, Y, T) _ck_assert_floating_op_tol(X, <, Y, T, 1, double, "") +- +-/** +- * Check that a double precision floating point number is finite; i.e. is +- * not +infinity, -infinity, or "Not a Number" (NaN) +- * +- * If X is +INFINITY or X is -INFINITY, or X is NaN, the test fails. +- * +- * @param X floating point number (double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_finite(X) _ck_assert_floating_finite(X, double, "") +- +-/** +- * Check that a double precision floating point number is infinite, +- * either +infinity or -infinity +- * +- * If X is not +INFINITY and X is not -INFINITY, the test fails. +- * +- * @param X floating point number (double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_infinite(X) _ck_assert_floating_infinite(X, double, "") +- +-/** +- * Check that a double precision floating point number +- * is "Not a Number" (NaN) +- * +- * If X is not NaN, the test fails. +- * +- * @param X floating point number (double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_nan(X) _ck_assert_floating_nan(X, double, "") +- +-/** +- * Check that a double precision floating point number is +- * not "Not a Number" (NaN) +- * +- * If X is NaN, the test fails. +- * +- * @param X floating point number (double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_double_nonnan(X) _ck_assert_floating_nonnan(X, double, "") +- +-/** +- * Check two double precision floating point numbers to determine if X == Y. +- * +- * Note that the usefulness of this assertion is very limited. If you +- * want to compare two floating point numbers for equality, you probably +- * want to use ck_assert_ldouble_eq_tol instead. +- * +- * If not X == Y, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_eq(X, Y) _ck_assert_floating(X, ==, Y, long double, "L") +-/** +- * Check two double precision floating point numbers to determine if X != Y. +- * +- * Note that the usefulness of this assertion is very limited. If you +- * want to compare two floating point numbers for equality, you probably +- * want to use ck_assert_ldouble_ne_tol instead. +- * +- * If not X != Y, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_ne(X, Y) _ck_assert_floating(X, !=, Y, long double, "L") +-/** +- * Check two double precision floating point numbers to determine if X < Y +- * +- * If not X < Y, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_lt(X, Y) _ck_assert_floating(X, <, Y, long double, "L") +-/** +- * Check two double precision floating point numbers to determine if X <= Y +- * +- * If not X <= Y, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_le(X, Y) _ck_assert_floating(X, <=, Y, long double, "L") +-/** +- * Check two double precision floating point numbers to determine if X > Y +- * +- * If not X > Y, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_gt(X, Y) _ck_assert_floating(X, >, Y, long double, "L") +-/** +- * Check two double precision floating point numbers to determine if X >= Y +- * +- * If not X >= Y, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_ge(X, Y) _ck_assert_floating(X, >=, Y, long double, "L") +- +-/** +- * Check two double precision floating point numbers to determine if X≈Y +- * with specified tolerance +- * +- * If not X ≈ Y with error < T, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * @param T tolerance (long double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_eq_tol(X, Y, T) _ck_assert_floating_absdiff_op_tol(X, Y, <, T, long double, "L") +- +-/** +- * Check two double precision floating point numbers to determine if not X≈Y +- * with specified tolerance +- * +- * If X ≈ Y with error < T, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * @param T tolerance (long double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_ne_tol(X, Y, T) _ck_assert_floating_absdiff_op_tol(X, Y, >=, T, long double, "L") +- +-/** +- * Check two double precision floating point numbers to determine if X>≈Y +- * with specified tolerance +- * +- * If not X >≈ Y with error < T, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * @param T tolerance (long double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_ge_tol(X, Y, T) _ck_assert_floating_op_tol(X, >, Y, T, -1, long double, "L") +- +-/** +- * Check two double precision floating point numbers to determine if X<≈Y +- * with specified tolerance +- * +- * If not X <≈ Y with error < T, the test fails. +- * +- * @param X floating point number (long double) +- * @param Y floating point number (long double) to compare against X +- * @param T tolerance (long double) +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_le_tol(X, Y, T) _ck_assert_floating_op_tol(X, <, Y, T, 1, long double, "L") +- +-/** +- * Check that a double precision floating point number is finite; i.e. is +- * not +infinity, -infinity, or "Not a Number" (NaN) +- * +- * If X is +INFINITY or X is -INFINITY, or X is NaN, the test fails. +- * +- * @param X floating point number (long double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_finite(X) _ck_assert_floating_finite(X, long double, "L") +- +-/** +- * Check that a double precision floating point number is infinite, +- * either +infinity or -infinity +- * +- * If X is not +INFINITY and X is not -INFINITY, the test fails. +- * +- * @param X floating point number (long double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_infinite(X) _ck_assert_floating_infinite(X, long double, "L") +- +-/** +- * Check that a double precision floating point number +- * is "Not a Number" (NaN) +- * +- * If X is not NaN, the test fails. +- * +- * @param X floating point number (long double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_nan(X) _ck_assert_floating_nan(X, long double, "L") +- +-/** +- * Check that a double precision floating point number is +- * not "Not a Number" (NaN) +- * +- * If X is NaN, the test fails. +- * +- * @param X floating point number (long double) to be checked +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ldouble_nonnan(X) _ck_assert_floating_nonnan(X, long double, "L") +- +-/* String comparison macros with improved output compared to ck_assert() */ +-/* OP might be any operator that can be used in '0 OP strcmp(X,Y)' comparison. */ +-/* String pointer could be compared againts NULL with == (NULLEQ = 1) and != (NULLNE = 1) operators. */ +-/* The x and y parameter swap in strcmp() is needed to handle >, >=, <, <= operators. */ +-/* If the x or y parameter is NULL its value will be printed without quotes. */ +-#define _ck_assert_str(X, OP, Y, NULLEQ, NULLNE) do { \ +- const char* _ck_x = (X); \ +- const char* _ck_y = (Y); \ +- const char* _ck_x_s; \ +- const char* _ck_y_s; \ +- const char* _ck_x_q; \ +- const char* _ck_y_q; \ +- if (_ck_x != NULL) { \ +- _ck_x_q = "\""; \ +- _ck_x_s = _ck_x; \ +- } else { \ +- _ck_x_q = ""; \ +- _ck_x_s = "(null)"; \ +- } \ +- if (_ck_y != NULL) { \ +- _ck_y_q = "\""; \ +- _ck_y_s = _ck_y; \ +- } else { \ +- _ck_y_q = ""; \ +- _ck_y_s = "(null)"; \ +- } \ +- ck_assert_msg( \ +- (NULLEQ && (_ck_x == NULL) && (_ck_y == NULL)) || \ +- (NULLNE && ((_ck_x == NULL) || (_ck_y == NULL)) && (_ck_x != _ck_y)) || \ +- ((_ck_x != NULL) && (_ck_y != NULL) && (0 OP strcmp(_ck_y, _ck_x))), \ +- "Assertion '%s' failed: %s == %s%s%s, %s == %s%s%s", \ +- #X" "#OP" "#Y, \ +- #X, _ck_x_q, _ck_x_s, _ck_x_q, \ +- #Y, _ck_y_q, _ck_y_s, _ck_y_q); \ +-} while (0) +- +-/** +- * Check two strings to determine if 0==strcmp(X,Y) +- * +- * If X or Y is NULL the test fails. +- * If not 0==strcmp(X,Y), the test fails. +- * +- * @param X string +- * @param Y string to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_assert_str_eq(X, Y) _ck_assert_str(X, ==, Y, 0, 0) +- +-/** +- * Check two strings to determine if 0!=strcmp(X,Y) +- * +- * If X or Y is NULL the test fails. +- * If not 0!=strcmp(X,Y), the test fails. +- * +- * @param X string +- * @param Y string to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.6 +- */ +-#define ck_assert_str_ne(X, Y) _ck_assert_str(X, !=, Y, 0, 0) +- +-/** +- * Check two strings to determine if 00) +- * +- * If X or Y is NULL the test fails. +- * If not 0=0) +- * +- * If X or Y is NULL the test fails. +- * If not 0<=strcmp(X,Y), the test fails. +- * +- * @param X string +- * @param Y string to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_str_le(X, Y) _ck_assert_str(X, <=, Y, 0, 0) +- +-/** +- * Check two strings to determine if 00) +- * +- * If X or Y is NULL the test fails. +- * If not 0, Y, 0, 0) +- +-/** +- * Check two strings to determine if 0>=strcmp(X,Y) (e.g. strcmp(X,Y)<=0) +- * +- * If X or Y is NULL the test fails. +- * If not 0>=strcmp(X,Y), the test fails. +- * +- * @param X string +- * @param Y string to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_str_ge(X, Y) _ck_assert_str(X, >=, Y, 0, 0) +- +-/** +- * Check two strings to determine if 0==strcmp(X,Y) or if both are undefined +- * +- * If both X and Y are NULL the test passes. However, if only one is NULL +- * the test fails. +- * If not ((X==NULL)&&(Y==NULL)) || (0==strcmp(X,Y)), the test fails. +- * +- * @param X string +- * @param Y string to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_pstr_eq(X, Y) _ck_assert_str(X, ==, Y, 1, 0) +- +-/** +- * Check two strings to determine if 0!=strcmp(X,Y) or one of them is undefined +- * +- * If either X or Y is NULL the test passes, however if both are NULL +- * the test fails. +- * If not (X!=NULL)&&(Y!=NULL)&&(0!=strcmp(X,Y)), the test fails. +- * +- * @param X string +- * @param Y string to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_pstr_ne(X, Y) _ck_assert_str(X, !=, Y, 0, 1) +- +-/* Memory location comparison macros with improved output compared to ck_assert() */ +-/* OP might be any operator that can be used in '0 OP memcmp(X,Y,L)' comparison */ +-/* The x and y parameter swap in memcmp() is needed to handle >, >=, <, <= operators */ +-/* Output is limited to CK_MAX_ASSERT_MEM_PRINT_SIZE bytes */ +-#ifndef CK_MAX_ASSERT_MEM_PRINT_SIZE +-#define CK_MAX_ASSERT_MEM_PRINT_SIZE 64 +-#endif +- +-/* Memory location comparison macros with improved output compared to ck_assert() */ +-/* OP might be any operator that can be used in '0 OP memcmp(X,Y,L)' comparison */ +-/* The x and y parameter swap in memcmp() is needed to handle >, >=, <, <= operators */ +-/* Output is limited to CK_MAX_ASSERT_MEM_PRINT_SIZE bytes */ +-#ifndef CK_MAX_ASSERT_MEM_PRINT_SIZE +-#define CK_MAX_ASSERT_MEM_PRINT_SIZE 64 +-#endif +- +-#define _ck_assert_mem(X, OP, Y, L) do { \ +- const uint8_t* _ck_x = (const uint8_t*)(X); \ +- const uint8_t* _ck_y = (const uint8_t*)(Y); \ +- size_t _ck_l = (L); \ +- char _ck_x_str[CK_MAX_ASSERT_MEM_PRINT_SIZE * 2 + 1]; \ +- char _ck_y_str[CK_MAX_ASSERT_MEM_PRINT_SIZE * 2 + 1]; \ +- static const char _ck_hexdigits[] = "0123456789abcdef"; \ +- size_t _ck_i; \ +- size_t _ck_maxl = (_ck_l > CK_MAX_ASSERT_MEM_PRINT_SIZE) ? CK_MAX_ASSERT_MEM_PRINT_SIZE : _ck_l; \ +- for (_ck_i = 0; _ck_i < _ck_maxl; _ck_i++) { \ +- _ck_x_str[_ck_i * 2 ] = _ck_hexdigits[(_ck_x[_ck_i] >> 4) & 0xF]; \ +- _ck_y_str[_ck_i * 2 ] = _ck_hexdigits[(_ck_y[_ck_i] >> 4) & 0xF]; \ +- _ck_x_str[_ck_i * 2 + 1] = _ck_hexdigits[_ck_x[_ck_i] & 0xF]; \ +- _ck_y_str[_ck_i * 2 + 1] = _ck_hexdigits[_ck_y[_ck_i] & 0xF]; \ +- } \ +- _ck_x_str[_ck_i * 2] = 0; \ +- _ck_y_str[_ck_i * 2] = 0; \ +- if (_ck_maxl != _ck_l) { \ +- _ck_x_str[_ck_i * 2 - 2] = '.'; \ +- _ck_y_str[_ck_i * 2 - 2] = '.'; \ +- _ck_x_str[_ck_i * 2 - 1] = '.'; \ +- _ck_y_str[_ck_i * 2 - 1] = '.'; \ +- } \ +- ck_assert_msg(0 OP memcmp(_ck_y, _ck_x, _ck_l), \ +- "Assertion '%s' failed: %s == \"%s\", %s == \"%s\"", #X" "#OP" "#Y, #X, _ck_x_str, #Y, _ck_y_str); \ +-} while (0) +-/** +- * Check two memory locations to determine if 0==memcmp(X,Y,L) +- * +- * If not 0==memcmp(X,Y,L), the test fails. +- * +- * @param X memory location +- * @param Y memory location to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_mem_eq(X, Y, L) _ck_assert_mem(X, ==, Y, L) +-/** +- * Check two memory locations to determine if 0!=memcmp(X,Y,L) +- * +- * If not 0!=memcmp(X,Y,L), the test fails. +- * +- * @param X memory location +- * @param Y memory location to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_mem_ne(X, Y, L) _ck_assert_mem(X, !=, Y, L) +-/** +- * Check two memory locations to determine if 00) +- * +- * If not 0=0) +- * +- * If not 0<=memcmp(X,Y,L), the test fails. +- * +- * @param X memory location +- * @param Y memory location to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_mem_le(X, Y, L) _ck_assert_mem(X, <=, Y, L) +-/** +- * Check two memory locations to determine if 00) +- * +- * If not 0, Y, L) +-/** +- * Check two memory locations to determine if 0>=memcmp(X,Y,L) (e.g. memcmp(X,Y,L)<=0) +- * +- * If not 0>=memcmp(X,Y,L), the test fails. +- * +- * @param X memory location +- * @param Y memory location to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_mem_ge(X, Y, L) _ck_assert_mem(X, >=, Y, L) +- +-/* Pointer comparison macros with improved output compared to ck_assert(). */ +-/* OP may only be == or != */ +-#define _ck_assert_ptr(X, OP, Y) do { \ +- const void* _ck_x = (X); \ +- const void* _ck_y = (Y); \ +- ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s == %#lx, %s == %#lx", #X" "#OP" "#Y, #X, (unsigned long)(uintptr_t)_ck_x, #Y, (unsigned long)(uintptr_t)_ck_y); \ +-} while (0) +- +-/* Pointer against NULL comparison macros with improved output +- * compared to ck_assert(). */ +-/* OP may only be == or != */ +-#define _ck_assert_ptr_null(X, OP) do { \ +- const void* _ck_x = (X); \ +- ck_assert_msg(_ck_x OP NULL, \ +- "Assertion '%s' failed: %s == %#lx", \ +- #X" "#OP" NULL", \ +- #X, (unsigned long)(uintptr_t)_ck_x); \ +-} while (0) +- +-/** +- * Check if two pointers are equal. +- * +- * If the two passed pointers are not equal, the test +- * fails. +- * +- * @param X pointer +- * @param Y pointer to compare against X +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.9.10 +- */ +-#define ck_assert_ptr_eq(X, Y) _ck_assert_ptr(X, ==, Y) +- +-/** +- * Check if two pointers are not. +- * +- * If the two passed pointers are equal, the test fails. +- * +- * @param X pointer +- * @param Y pointer to compare against X +- * +- * @since 0.9.10 +- */ +-#define ck_assert_ptr_ne(X, Y) _ck_assert_ptr(X, !=, Y) +- +-/** +- * Check if a pointer is equal to NULL. +- * +- * If X != NULL, the test fails. +- * +- * @param X pointer to compare against NULL +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ptr_null(X) _ck_assert_ptr_null(X, ==) +- +-/** +- * Check if a pointer is not equal to NULL. +- * +- * If X == NULL, the test fails. +- * +- * @param X pointer to compare against NULL +- * +- * @note If the check fails, the remaining of the test is aborted +- * +- * @since 0.11.0 +- */ +-#define ck_assert_ptr_nonnull(X) _ck_assert_ptr_null(X, !=) +- +-/** +- * Mark the last point reached in a unit test. +- * +- * If the test throws a signal or exits, the location noted with the +- * failure is the last location of a ck_assert*() or ck_abort() call. +- * Use mark_point() to record intermediate locations (useful for tracking down +- * crashes or exits). +- * +- * @since 0.6.0 +-*/ +-#define mark_point() _mark_point(__FILE__,__LINE__) +- +-/* Non macro version of #mark_point */ +-CK_DLL_EXP void CK_EXPORT _mark_point(const char *file, int line); +- +-/** +- * Enum describing the possible results of a test +- */ +-enum test_result +-{ +- CK_TEST_RESULT_INVALID, /**< Default value; should not encounter this */ +- CK_PASS, /**< Test passed */ +- CK_FAILURE, /**< Test completed but failed */ +- CK_ERROR /**< Test failed to complete +- (unexpected signal or non-zero early exit) */ +-}; +- +-/** +- * Enum specifying the verbosity of output a SRunner should produce +- */ +-enum print_output +-{ +- CK_SILENT, /**< No output */ +- CK_MINIMAL, /**< Only summary output */ +- CK_NORMAL, /**< All failed tests */ +- CK_VERBOSE, /**< All tests */ +- CK_ENV, /**< Look at environment var CK_VERBOSITY +- for what verbosity to use, which can be +- either "silent", "minimal", "normal", +- or "verbose". If the environment variable +- is not set, then CK_NORMAL will be used.*/ +-#if 0 +- CK_SUBUNIT, /**< Run as a subunit child process */ +-#endif +- CK_LAST /**< Not a valid option */ +-}; +- +-/** +- * Holds state for a running of a test suite +- */ +-typedef struct SRunner SRunner; +- +-/** +- * Opaque type for a test failure +- */ +-typedef struct TestResult TestResult; +- +-/** +- * Enum representing the types of contexts for a test +- */ +-enum ck_result_ctx +-{ +- CK_CTX_INVALID, /**< Default value; should not encounter this */ +- CK_CTX_SETUP, /**< Setup before a test */ +- CK_CTX_TEST, /**< Body of test itself */ +- CK_CTX_TEARDOWN /**< Teardown after a test */ +-}; +- +-/** +- * Retrieve type of result that the given test result represents. +- * +- * This is a member of test_result, and can represent a +- * pass, failure, or error. +- * +- * @param tr test result to retrieve result from +- * +- * @return result of given test +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP int CK_EXPORT tr_rtype(TestResult * tr); +- +-/** +- * Retrieve context in which the result occurred for the given test result. +- * +- * The types of contents include the test setup, teardown, or the +- * body of the test itself. +- * +- * @param tr test result to retrieve context from +- * +- * @return context to which the given test result applies +- * +- * @since 0.8.0 +- */ +-CK_DLL_EXP enum ck_result_ctx CK_EXPORT tr_ctx(TestResult * tr); +- +-/** +- * Retrieve failure message from test result, if applicable. +- * +- * @return pointer to a message, if one exists. NULL otherwise. +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP const char *CK_EXPORT tr_msg(TestResult * tr); +- +-/** +- * Retrieve line number at which a failure occurred, if applicable. +- * +- * @return If the test resulted in a failure, returns the line number +- * that the failure occurred on; otherwise returns -1. +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP int CK_EXPORT tr_lno(TestResult * tr); +- +-/** +- * Retrieve file name at which a failure occurred, if applicable. +- * +- * @return If the test resulted in a failure, returns a string +- * containing the name of the file where the failure +- * occurred; otherwise returns NULL. +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP const char *CK_EXPORT tr_lfile(TestResult * tr); +- +-/** +- * Retrieve test case name in which a failure occurred, if applicable. +- * +- * @return If the test resulted in a failure, returns a string +- * containing the name of the test suite where the failure +- * occurred; otherwise returns NULL. +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP const char *CK_EXPORT tr_tcname(TestResult * tr); +- +-/** +- * Creates a suite runner for the given suite. +- * +- * Once created, additional suites can be added to the +- * suite runner using srunner_add_suite(), and the suite runner can be +- * run with srunner_run_all(). Once finished, the suite runner +- * must be freed with srunner_free(). +- * +- * @param s suite to generate a suite runner for +- * +- * @return suite runner for the given suite +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP SRunner *CK_EXPORT srunner_create(Suite * s); +- +-/** +- * Add an additional suite to a suite runner. +- * +- * The first suite in a suite runner is always added in srunner_create(). +- * This call adds additional suites to a suite runner. +- * +- * @param sr suite runner to add the given suite +- * @param s suite to add to the given suite runner +- * +- * @since 0.7.0 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_add_suite(SRunner * sr, Suite * s); +- +-/** +- * Frees a suite runner, including all contained suite and test cases. +- * +- * This call is responsible for freeing all resources related to a +- * suite runner and all contained suites and test cases. Suite and +- * test cases need not be freed individually, as this call handles that. +- * +- * @param sr suite runner to free +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_free(SRunner * sr); +- +-/** +- * Runs a suite runner and all contained suite, printing results to +- * stdout as specified by the print_mode. +- * +- * In addition to running all suites, if the suite runner has been +- * configured to output to a log, that is also performed. +- * +- * Note that if the CK_RUN_CASE, CK_RUN_SUITE, CK_INCLUDE_TAGS and/or +- * CK_EXCLUDE_TAGS environment variables are defined, then only the +- * named suites or test cases will run. +- * +- * @param sr suite runner to run all suites from +- * @param print_mode the verbosity in which to report results to stdout +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_run_all(SRunner * sr, +- enum print_output print_mode); +- +-/** +- * Run a specific suite or test case from a suite runner, printing results +- * to stdout as specified by the print_mode. +- * +- * In addition to running any applicable suites or test cases, if the +- * suite runner has been configured to output to a log, that is also +- * performed. +- * +- * Note that if the sname and tcname parameters are passed as null +- * then the function will fallback to using the environment variables +- * CK_RUN_SUITE and CK_RUN_CASE respectively in order to select the +- * suite/cases. +- * +- * Similarly if the CK_INCLUDE_TAGS and/or CK_EXCLUDE_TAGS environment +- * variables are defined then these will further filter the test cases +- * (see srunner_run_tagged, below). +- * +- * @param sr suite runner where the given suite or test case must be +- * @param sname suite name to run. A NULL means use the value of the +- * environment variable CK_RUN_SUITE if set, otherwise run "any/every +- * suite". +- * @param tcname test case name to run. A NULL means use the value of +- * the environment variable CK_RUN_CASE if set, otherwise run +- * "any/every case". +- * @param print_mode the verbosity in which to report results to stdout +- * +- * @since 0.9.9 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_run(SRunner * sr, const char *sname, +- const char *tcname, +- enum print_output print_mode); +- +- +-/** +- * Run a specific suite or test case or testcases with specific tags +- * from a suite runner, printing results to stdout as specified by the +- * print_mode. +- * +- * In addition to running any applicable suites or test cases, if the +- * suite runner has been configured to output to a log, that is also +- * performed. +- * +- * Note that if sname, tcname, include_tags, exclude_tags parameters +- * are passed as NULL then if the environment variables CK_RUN_SUITE, +- * CK_RUN_CASE, CK_INCLUDE_TAGS, CK_EXCLUDE_TAGS are defined then these +- * values will be used instead. +- * +- * @param sr suite runner where the given suite or test case must be +- * @param sname suite name to run. A NULL means use the value of the +- * environment variable CK_RUN_SUITE if set, otherwise run "any/every +- * suite". +- * @param tcname test case name to run. A NULL means use the value of +- * the environment variable CK_RUN_CASE if set, otherwise run +- * "any/every case". +- * @param include_tags space separate list of tags. Only run test +- * cases that share one of these tags. A NULL means use the value of +- * the environment variable CK_INCLUDE_TAGS if set, otherwise run +- * "any/every test case". +- * @param exclude_tags space separate list of tags. Only run test +- * cases that do not share one of these tags even if they are selected +- * by an included tag. A NULL means use the value of the environment +- * variable CK_EXCLUDE_TAGS if set, otherwise run "any/every test +- * case". +- * @param print_mode the verbosity in which to report results to stdout +- * +- * @since 0.11.0 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_run_tagged(SRunner * sr, const char *sname, +- const char *tcname, +- const char *include_tags, +- const char *exclude_tags, +- enum print_output print_mode); +- +-/** +- * Retrieve the number of failed tests executed by a suite runner. +- * +- * This value represents both test failures and errors. +- * +- * @param sr suite runner to query for all failed tests +- * +- * @return number of test failures and errors found by the suite runner +- * +- * @since 0.6.1 +- */ +-CK_DLL_EXP int CK_EXPORT srunner_ntests_failed(SRunner * sr); +- +-/** +- * Retrieve the total number of tests run by a suite runner. +- * +- * @param sr suite runner to query for all tests run +- * +- * @return number of all tests run by the suite runner +- * +- * @since 0.6.1 +- */ +-CK_DLL_EXP int CK_EXPORT srunner_ntests_run(SRunner * sr); +- +-/** +- * Return an array of results for all failures found by a suite runner. +- * +- * Number of results is equal to srunner_nfailed_tests(). +- * +- * Information about individual results can be queried using: +- * tr_rtype(), tr_ctx(), tr_msg(), tr_lno(), tr_lfile(), and tr_tcname(). +- * +- * Memory is malloc'ed and must be freed; however free the entire structure +- * instead of individual test cases. +- * +- * @param sr suite runner to retrieve results from +- * +- * @return array of TestResult objects +- * +- * @since 0.6.0 +- */ +-CK_DLL_EXP TestResult **CK_EXPORT srunner_failures(SRunner * sr); +- +-/** +- * Return an array of results for all tests run by a suite runner. +- * +- * Number of results is equal to srunner_ntests_run(), and excludes +- * failures due to setup function failure. +- * +- * Information about individual results can be queried using: +- * tr_rtype(), tr_ctx(), tr_msg(), tr_lno(), tr_lfile(), and tr_tcname(). +- * +- * Memory is malloc'ed and must be freed; however free the entire structure +- * instead of individual test cases. +- * +- * @param sr suite runner to retrieve results from +- * +- * @return array of TestResult objects +- * +- * @since 0.6.1 +-*/ +-CK_DLL_EXP TestResult **CK_EXPORT srunner_results(SRunner * sr); +- +-/** +- * Print the results contained in an SRunner to stdout. +- * +- * @param sr suite runner to print results for to stdout +- * @param print_mode the print_output (verbosity) to use to report +- * the result +- * +- * @since 0.7.0 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_print(SRunner * sr, +- enum print_output print_mode); +- +-/** +- * Set the suite runner to output the result in log format to the +- * given file. +- * +- * Note: log file setting is an initialize only operation -- it should +- * be done immediately after SRunner creation, and the log file can't be +- * changed after being set. +- * +- * This setting does not conflict with the other log output types; +- * all logging types can occur concurrently if configured. +- * +- * @param sr suite runner to log results of in log format +- * @param fname file name to output log results to +- * +- * @since 0.7.1 +-*/ +-CK_DLL_EXP void CK_EXPORT srunner_set_log(SRunner * sr, const char *fname); +- +-/** +- * Checks if the suite runner is assigned a file for log output. +- * +- * @param sr suite runner to check +- * +- * @return 1 iff the suite runner currently is configured to output +- * in log format; 0 otherwise +- * +- * @since 0.7.1 +- */ +-CK_DLL_EXP int CK_EXPORT srunner_has_log(SRunner * sr); +- +-/** +- * Retrieves the name of the currently assigned file +- * for log output, if any exists. +- * +- * @return the name of the log file, or NULL if none is configured +- * +- * @since 0.7.1 +- */ +-CK_DLL_EXP const char *CK_EXPORT srunner_log_fname(SRunner * sr); +- +-/** +- * Set the suite runner to output the result in XML format to the +- * given file. +- * +- * Note: XML file setting is an initialize only operation -- it should +- * be done immediately after SRunner creation, and the XML file can't be +- * changed after being set. +- * +- * This setting does not conflict with the other log output types; +- * all logging types can occur concurrently if configured. +- * +- * @param sr suite runner to log results of in XML format +- * @param fname file name to output XML results to +- * +- * @since 0.9.1 +-*/ +-CK_DLL_EXP void CK_EXPORT srunner_set_xml(SRunner * sr, const char *fname); +- +-/** +- * Checks if the suite runner is assigned a file for XML output. +- * +- * @param sr suite runner to check +- * +- * @return 1 iff the suite runner currently is configured to output +- * in XML format; 0 otherwise +- * +- * @since 0.9.1 +- */ +-CK_DLL_EXP int CK_EXPORT srunner_has_xml(SRunner * sr); +- +-/** +- * Retrieves the name of the currently assigned file +- * for XML output, if any exists. +- * +- * @return the name of the XML file, or NULL if none is configured +- * +- * @since 0.9.1 +- */ +-CK_DLL_EXP const char *CK_EXPORT srunner_xml_fname(SRunner * sr); +- +-/** +- * Set the suite runner to output the result in TAP format to the +- * given file. +- * +- * Note: TAP file setting is an initialize only operation -- it should +- * be done immediately after SRunner creation, and the TAP file can't be +- * changed after being set. +- * +- * This setting does not conflict with the other log output types; +- * all logging types can occur concurrently if configured. +- * +- * @param sr suite runner to log results of in TAP format +- * @param fname file name to output TAP results to +- * +- * @since 0.9.12 +-*/ +-CK_DLL_EXP void CK_EXPORT srunner_set_tap(SRunner * sr, const char *fname); +- +-/** +- * Checks if the suite runner is assigned a file for TAP output. +- * +- * @param sr suite runner to check +- * +- * @return 1 iff the suite runner currently is configured to output +- * in TAP format; 0 otherwise +- * +- * @since 0.9.12 +- */ +-CK_DLL_EXP int CK_EXPORT srunner_has_tap(SRunner * sr); +- +-/** +- * Retrieves the name of the currently assigned file +- * for TAP output, if any exists. +- * +- * @return the name of the TAP file, or NULL if none is configured +- * +- * @since 0.9.12 +- */ +-CK_DLL_EXP const char *CK_EXPORT srunner_tap_fname(SRunner * sr); +- +-/** +- * Enum describing the current fork usage. +- */ +-enum fork_status +-{ +- CK_FORK_GETENV, /**< look in the environment for CK_FORK */ +- CK_FORK, /**< call fork to run tests */ +- CK_NOFORK /**< don't call fork */ +-}; +- +-/** +- * Retrieve the current fork status for the given suite runner +- * +- * @param sr suite runner to check fork status of +- * +- * @since 0.8.0 +- */ +-CK_DLL_EXP enum fork_status CK_EXPORT srunner_fork_status(SRunner * sr); +- +-/** +- * Set the fork status for a given suite runner. +- * +- * The default fork status is CK_FORK_GETENV, which will look +- * for the CK_FORK environment variable, which can be set to +- * "yes" or "no". If the environment variable is not present, +- * CK_FORK will be used if fork() is available on the system, +- * otherwise CK_NOFORK is used. +- * +- * If set to CK_FORK or CK_NOFORK, the environment variable +- * if defined is ignored. +- * +- * If Check is compiled without support for fork(), attempting +- * to set the status to CK_FORK is ignored. +- * +- * @param sr suite runner to assign the fork status to +- * @param fstat fork status to assign +- * +- * @since 0.8.0 +- */ +-CK_DLL_EXP void CK_EXPORT srunner_set_fork_status(SRunner * sr, +- enum fork_status fstat); +- +-/** +- * Invoke fork() during a test and assign the child to the same +- * process group that the rest of the test case uses. +- * +- * One can invoke fork() directly during a test; however doing so +- * may not guarantee that any children processes are destroyed once +- * the test finishes. Once a test has completed, all processes in +- * the process group will be killed; using this wrapper will prevent +- * orphan processes. +- * +- * If Check is compiled without fork() support this call simply +- * return -1 and does nothing. +- * +- * @return On success, the PID of the child process is returned in +- * the parent, and 0 is returned in the child. On failure, +- * a value of -1 is returned to the parent process and no +- * child process is created. +- * +- * @since 0.9.3 +- */ +-CK_DLL_EXP pid_t CK_EXPORT check_fork(void); +- +-/** +- * Wait for the pid and exit. +- * +- * This is to be used in conjunction with check_fork(). When called, +- * will wait for the given process to terminate. If the process +- * exited without error, exit(EXIT_SUCCESS) is invoked; otherwise +- * exit(EXIT_FAILURE) is invoked. +- * +- * If Check is compiled without support for fork(), this invokes +- * exit(EXIT_FAILURE). +- * +- * @param pid process to wait for, created by check_fork() +- * +- * @since 0.9.3 +- */ +-CK_DLL_EXP void CK_EXPORT check_waitpid_and_exit(pid_t pid) CK_ATTRIBUTE_NORETURN; +- +-/** +- * Set the maximal assertion message size. +- * +- * This protects the code against unintentional extremely large assertion messages +- * (values of up to 4GB were seen in the wild). +- * The usual size for a message is less than 80 bytes. +- * +- * If the environment variable CK_MAX_MSG_SIZE is defined to a positive value, it is used. +- * Otherwise, if a positive maximal message size is set via this function, it is used. +- * Otherwise, the maximal message size is one assigned at compile time (4K bytes). +- * +- * @param max_msg_size the maximal assertion message size. +- * +- * @since 0.12.0 +- */ +-CK_DLL_EXP void CK_EXPORT check_set_max_msg_size(size_t max_msg_size); +- +-#ifdef __cplusplus +-CK_CPPEND +-#endif +- +-#endif /* CHECK_H */ +-- +2.21.3 + diff --git a/recipes/libcheck/all/patches/0002-disable-cmake-subproject-check.patch b/recipes/libcheck/all/patches/0002-disable-cmake-subproject-check.patch new file mode 100644 index 0000000000000..0cb7325f8c8aa --- /dev/null +++ b/recipes/libcheck/all/patches/0002-disable-cmake-subproject-check.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -27,7 +27,7 @@ + # Detect if Check is being used in another build as a subproject + # probably with command FetchContent*(). + set(THIS_IS_SUBPROJECT FALSE) +-if(DEFINED PROJECT_NAME) ++if(0) + set(THIS_IS_SUBPROJECT TRUE) + message(STATUS "Turned off installing because Check is a subproject.") + message(STATUS "Turned off building tests because Check is a subproject.") diff --git a/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch b/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch new file mode 100644 index 0000000000000..320eb687dab0f --- /dev/null +++ b/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch @@ -0,0 +1,12 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -393,7 +393,7 @@ + ADD_DEFINITIONS(-DHAVE_LIBRT=1) + endif (HAVE_LIBRT) + +-check_library_exists(subunit subunit_test_start "" HAVE_SUBUNIT) ++option(HAVE_SUBUNIT "Do you have subunit" ON) + if (HAVE_SUBUNIT) + set(SUBUNIT "subunit") + set(ENABLE_SUBUNIT 1) + diff --git a/recipes/libcheck/all/patches/0004-install-shared-static-exclusive.patch b/recipes/libcheck/all/patches/0004-install-shared-static-exclusive.patch new file mode 100644 index 0000000000000..c00e495d9f9d8 --- /dev/null +++ b/recipes/libcheck/all/patches/0004-install-shared-static-exclusive.patch @@ -0,0 +1,15 @@ +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -188,7 +188,7 @@ + ) +- ++if(BUILD_SHARED_LIBS) ++set(libsuffix Shared) ++endif() + if(NOT THIS_IS_SUBPROJECT) +- install(TARGETS check checkShared +- EXPORT check-targets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ install(TARGETS check${libsuffix} ++ EXPORT check-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/libcheck/all/patches/0005-add-missing-lib-pthread_mutex-c.patch b/recipes/libcheck/all/patches/0005-add-missing-lib-pthread_mutex-c.patch new file mode 100644 index 0000000000000..55a57a7ccfef3 --- /dev/null +++ b/recipes/libcheck/all/patches/0005-add-missing-lib-pthread_mutex-c.patch @@ -0,0 +1,74 @@ +--- /dev/null ++++ lib/pthread_mutex.c +@@ -0,0 +1,71 @@ ++/* ++ * Check: a unit test framework for C ++ * Copyright (C) 2020 Wander Lairson Costa ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++ ++#include "libcompat.h" ++ ++#ifdef HAVE_WIN32_INIT_ONCE ++ ++static int mutex_init(pthread_mutex_t *mutex) ++{ ++ BOOL pending; ++ int ret = 0; ++ ++ if (!InitOnceBeginInitialize(&mutex->init, 0, &pending, NULL)) ++ return -1; ++ ++ if (pending) ++ { ++ mutex->mutex = CreateMutexW(NULL, FALSE, NULL); ++ if (!mutex->mutex) ++ ret = -1; ++ } ++ ++ InitOnceComplete(&mutex->init, 0, NULL); ++ ++ return ret; ++} ++ ++int pthread_mutex_init(pthread_mutex_t *mutex, pthread_mutexattr_t *attr) ++{ ++ InitOnceInitialize(&mutex->init); ++ return mutex_init(mutex); ++} ++ ++int pthread_mutex_destroy(pthread_mutex_t *mutex) ++{ ++ return CloseHandle(mutex->mutex) ? 0 : -1; ++} ++ ++int pthread_mutex_lock(pthread_mutex_t *mutex) ++{ ++ if (mutex_init(mutex) != 0) ++ return -1; ++ ++ return WaitForSingleObject(mutex->mutex, INFINITE) != WAIT_OBJECT_0 ++ ? -1 : 0; ++} ++ ++int pthread_mutex_unlock(pthread_mutex_t *mutex) ++{ ++ return ReleaseMutex(mutex->mutex) ? 0 : -1; ++} ++ ++#endif ++ diff --git a/recipes/libcheck/all/test_package/CMakeLists.txt b/recipes/libcheck/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d0ea6b764c70f --- /dev/null +++ b/recipes/libcheck/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(check REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET Check::checkShared) + target_link_libraries(${PROJECT_NAME} Check::checkShared) +else() + target_link_libraries(${PROJECT_NAME} Check::check) +endif() diff --git a/recipes/libcheck/all/test_package/conanfile.py b/recipes/libcheck/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libcheck/all/test_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/libcheck/all/test_package/test_package.c b/recipes/libcheck/all/test_package/test_package.c new file mode 100644 index 0000000000000..968b0afdca5d1 --- /dev/null +++ b/recipes/libcheck/all/test_package/test_package.c @@ -0,0 +1,46 @@ +#include "check.h" + +#include + +static int f(void) { + return 5; +} + +static const char *s(void) { + return "EUR"; +} + + +START_TEST (test_name) +{ + ck_assert_int_eq(f(), 5); + ck_assert_str_eq(s(), "USD"); +} +END_TEST + +Suite *test_package_suite(void) +{ + Suite *s; + TCase *tc_core; + + s = suite_create("test_package"); + + tc_core = tcase_create("test_name"); + + tcase_add_test(tc_core, test_name); + suite_add_tcase(s, tc_core); + + return s; +} + +int main(void) { + Suite *s = test_package_suite(); + SRunner *sr = srunner_create(s); + + srunner_run_all(sr, CK_VERBOSE); + int number_failed = srunner_ntests_failed(sr); + srunner_free(sr); + printf("number failed: %d\n", number_failed); + printf("Ignore this intentional failure!\n"); + return 0; +} diff --git a/recipes/libcheck/config.yml b/recipes/libcheck/config.yml new file mode 100644 index 0000000000000..ddd1d5eaaf275 --- /dev/null +++ b/recipes/libcheck/config.yml @@ -0,0 +1,3 @@ +versions: + "0.15.2": + folder: "all" diff --git a/recipes/libcoap/all/CMakeLists.txt b/recipes/libcoap/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/libcoap/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libcoap/all/conandata.yml b/recipes/libcoap/all/conandata.yml new file mode 100644 index 0000000000000..933f8a2810d53 --- /dev/null +++ b/recipes/libcoap/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20200424": + sha256: 8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab + url: https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip + "4.3.0": + url: https://github.com/obgm/libcoap/archive/refs/tags/v4.3.0.tar.gz + sha256: 1a195adacd6188d3b71c476e7b21706fef7f3663ab1fb138652e8da49a9ec556 diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py new file mode 100644 index 0000000000000..016cb1a3f6f02 --- /dev/null +++ b/recipes/libcoap/all/conanfile.py @@ -0,0 +1,111 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class LibCoapConan(ConanFile): + name = "libcoap" + license = "BSD-2-Clause" + homepage = "https://github.com/obgm/libcoap" + url = "https://github.com/conan-io/conan-center-index" + description = """A CoAP (RFC 7252) implementation in C""" + topics = ("coap") + exports_sources = "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_epoll": [True, False], + "dtls_backend": [None, "openssl", "gnutls", "tinydtls", "mbedtls"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_epoll": False, + "dtls_backend": "openssl", + } + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + if self.options.dtls_backend == "openssl": + self.requires("openssl/1.1.1q") + elif self.options.dtls_backend == "mbedtls": + self.requires("mbedtls/2.25.0") + elif self.options.dtls_backend == "gnutls": + raise ConanInvalidConfiguration("gnu tls not available yet") + elif self.options.dtls_backend == "tinydtls": + raise ConanInvalidConfiguration("tinydtls not available yet") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.os in ("Windows", "Macos"): + raise ConanInvalidConfiguration("Platform is currently not supported") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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["WITH_EPOLL"] = self.options.with_epoll + self._cmake.definitions["ENABLE_DTLS"] = self.options.dtls_backend != None + self._cmake.definitions["DTLS_BACKEND"] = self.options.dtls_backend + + if self.version != "cci.20200424": + self._cmake.definitions["ENABLE_DOCS"] = False + self._cmake.definitions["ENABLE_EXAMPLES"] = False + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + library_name = "" + pkgconfig_name = "" + if self.version == "cci.20200424": + library_name = "coap" + pkgconfig_name = "libcoap-2" + else: + library_name = "coap-3" + pkgconfig_name = "libcoap-3" + + self.cpp_info.components["coap"].names["cmake_find_package"] = "coap" + self.cpp_info.components["coap"].names["cmake_find_package_multi"] = "coap" + pkgconfig_filename = "{}{}".format(pkgconfig_name, "-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "") + self.cpp_info.components["coap"].names["pkg_config"] = pkgconfig_filename + self.cpp_info.components["coap"].libs = [library_name] + + if self.settings.os == "Linux": + self.cpp_info.components["coap"].system_libs = ["pthread"] + if self.options.dtls_backend == "openssl": + self.cpp_info.components["coap"].requires = ["openssl::openssl"] + elif self.options.dtls_backend == "mbedtls": + self.cpp_info.components["coap"].requires = ["mbedtls::mbedtls"] diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b81eef988f5b5 --- /dev/null +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(libcoap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} libcoap::coap) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_compile_definitions(${PROJECT_NAME} PUBLIC LIB_VERSION=${LIB_VERSION}) diff --git a/recipes/libcoap/all/test_package/conanfile.py b/recipes/libcoap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8bd5d5d915f3d --- /dev/null +++ b/recipes/libcoap/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + + version = self.deps_cpp_info["libcoap"].version; + if version == "cci.20200424": + cmake.definitions["LIB_VERSION"] = 2 + else: + cmake.definitions["LIB_VERSION"] = 3 + + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/libcoap/all/test_package/test_package.cpp b/recipes/libcoap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..889e1c8fa6d20 --- /dev/null +++ b/recipes/libcoap/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#if LIB_VERSION == 2 +#include "coap2/coap.h" +#elif LIB_VERSION == 3 +#include "coap3/coap.h" +#else +#error "Version not supported" +#endif + +#include + +int main() { + std::cout << "starting" << std::endl; + coap_startup(); + + // create CoAP context and a client session + coap_context_t *ctx = coap_new_context(nullptr); + + coap_free_context(ctx); + coap_cleanup(); + std::cout << "stopping" << std::endl; + return 0; +} diff --git a/recipes/libcoap/config.yml b/recipes/libcoap/config.yml new file mode 100644 index 0000000000000..2b90fe3a049b9 --- /dev/null +++ b/recipes/libcoap/config.yml @@ -0,0 +1,6 @@ +--- +versions: + "cci.20200424": + folder: "all" + "4.3.0": + folder: "all" diff --git a/recipes/libconfig/all/conandata.yml b/recipes/libconfig/all/conandata.yml new file mode 100644 index 0000000000000..9da3354cf812a --- /dev/null +++ b/recipes/libconfig/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.7.3": + url: "https://github.com/hyperrealm/libconfig/archive/refs/tags/v1.7.3.tar.gz" + sha256: "68757e37c567fd026330c8a8449aa5f9cac08a642f213f2687186b903bd7e94e" + "1.7.2": + url: "https://github.com/hyperrealm/libconfig/archive/refs/tags/v1.7.2.tar.gz" + sha256: "f67ac44099916ae260a6c9e290a90809e7d782d96cdd462cac656ebc5b685726" diff --git a/recipes/libconfig/all/conanfile.py b/recipes/libconfig/all/conanfile.py new file mode 100644 index 0000000000000..7cdaef7bf5f57 --- /dev/null +++ b/recipes/libconfig/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + +class LibconfigConan(ConanFile): + name = "libconfig" + description = "C/C++ library for processing configuration files" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://hyperrealm.github.io/libconfig/" + topics = ("conf", "config", "cfg", "configuration") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['BUILD_EXAMPLES'] = False + tc.variables['BUILD_TESTS'] = False + if is_apple_os(self): + tc.preprocessor_definitions["HAVE_XLOCALE_H"] = 1 + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + if Version(self.version) == "1.7.2": + # https://github.com/hyperrealm/libconfig/issues/119 + replace_in_file(self, + os.path.join(self.source_folder, "lib", "CMakeLists.txt"), + "_STDLIB_H", + "") + if Version(self.version) == "1.7.3": + replace_in_file(self, + os.path.join(self.source_folder, "lib", "CMakeLists.txt"), + "target_compile_definitions(${libname}++ PUBLIC LIBCONFIGXX_STATIC)", + "target_compile_definitions(${libname}++ PUBLIC LIBCONFIG_STATIC LIBCONFIGXX_STATIC)") + + 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="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + prefix = "lib" if Version(self.version) < "1.7.3" or self.settings.os == "Windows" else "" + + self.cpp_info.components["libconfig_"].set_property("cmake_file_name", "libconfig") + self.cpp_info.components["libconfig_"].set_property("cmake_target_name", "libconfig::libconfig") + self.cpp_info.components["libconfig_"].set_property("pkg_config_name", "libconfig") + self.cpp_info.components["libconfig_"].libs = [f"{prefix}config"] + + self.cpp_info.components["libconfig++"].set_property("cmake_file_name", "libconfig") + self.cpp_info.components["libconfig++"].set_property("cmake_target_name", "libconfig::libconfig++") + self.cpp_info.components["libconfig++"].set_property("pkg_config_name", "libconfig++") + self.cpp_info.components["libconfig++"].libs = [f"{prefix}config++"] + self.cpp_info.components["libconfig++"].requires = ["libconfig_"] + + if not self.options.shared: + self.cpp_info.components["libconfig_"].defines.append("LIBCONFIG_STATIC") + self.cpp_info.components["libconfig++"].defines.append("LIBCONFIGXX_STATIC") + if self.settings.os == "Windows": + self.cpp_info.components["libconfig_"].system_libs.append("shlwapi") + self.cpp_info.components["libconfig++"].system_libs.append("shlwapi") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libconfig_"].names["cmake_find_package"] = "libconfig" + self.cpp_info.components["libconfig_"].names["cmake_find_package_multi"] = "libconfig" + self.cpp_info.components["libconfig_"].names["pkg_config"] = "libconfig" + + self.cpp_info.components["libconfig++"].names["cmake_find_package"] = "libconfig++" + self.cpp_info.components["libconfig++"].names["cmake_find_package_multi"] = "libconfig++" + self.cpp_info.components["libconfig++"].names["pkg_config"] = "libconfig++" diff --git a/recipes/libconfig/all/test_package/CMakeLists.txt b/recipes/libconfig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d094678d52a36 --- /dev/null +++ b/recipes/libconfig/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C CXX) + +find_package(libconfig REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libconfig::libconfig) + +add_executable(${PROJECT_NAME}++ test_package.cpp) +target_link_libraries(${PROJECT_NAME}++ libconfig::libconfig++) diff --git a/recipes/libconfig/all/test_package/conanfile.py b/recipes/libconfig/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8e52f315e8745 --- /dev/null +++ b/recipes/libconfig/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_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") + bin_path_pp = os.path.join(self.cpp.build.bindirs[0], "test_package++") + self.run(bin_path_pp, env="conanrun") diff --git a/recipes/libconfig/all/test_package/test_package.c b/recipes/libconfig/all/test_package/test_package.c new file mode 100644 index 0000000000000..0a4f5e7628f8c --- /dev/null +++ b/recipes/libconfig/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + config_t cfg; + config_init(&cfg); + return EXIT_SUCCESS; +} diff --git a/recipes/libconfig/all/test_package/test_package.cpp b/recipes/libconfig/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a109d5218f482 --- /dev/null +++ b/recipes/libconfig/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() +{ + libconfig::Config cfg; + + cfg.setOptions(libconfig::Config::OptionFsync + | libconfig::Config::OptionSemicolonSeparators + | libconfig::Config::OptionColonAssignmentForGroups + | libconfig::Config::OptionOpenBraceOnSeparateLine); + return EXIT_SUCCESS; +} diff --git a/recipes/libconfig/all/test_v1_package/CMakeLists.txt b/recipes/libconfig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libconfig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libconfig/all/test_v1_package/conanfile.py b/recipes/libconfig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8ba7c272305b9 --- /dev/null +++ b/recipes/libconfig/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +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) + bin_path_pp = os.path.join("bin", "test_package++") + self.run(bin_path_pp, run_environment=True) diff --git a/recipes/libconfig/config.yml b/recipes/libconfig/config.yml new file mode 100644 index 0000000000000..4f945b4c70677 --- /dev/null +++ b/recipes/libconfig/config.yml @@ -0,0 +1,5 @@ +versions: + "1.7.3": + folder: "all" + "1.7.2": + folder: "all" diff --git a/recipes/libconfuse/all/conandata.yml b/recipes/libconfuse/all/conandata.yml new file mode 100644 index 0000000000000..d999ffda52886 --- /dev/null +++ b/recipes/libconfuse/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.3": + url: "https://github.com/martinh/libconfuse/releases/download/v3.3/confuse-3.3.tar.gz" + sha256: "3a59ded20bc652eaa8e6261ab46f7e483bc13dad79263c15af42ecbb329707b8" + "3.2.2": + url: "https://github.com/martinh/libconfuse/releases/download/v3.2.2/confuse-3.2.2.tar.gz" + sha256: "71316b55592f8d0c98924242c98dbfa6252153a8b6e7d89e57fe6923934d77d0" diff --git a/recipes/libconfuse/all/conanfile.py b/recipes/libconfuse/all/conanfile.py new file mode 100644 index 0000000000000..05cfd416ce7a5 --- /dev/null +++ b/recipes/libconfuse/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import 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 check_min_vs, is_msvc +import os + +required_conan_version = ">=1.57.0" + + +class LibConfuseConan(ConanFile): + name = "libconfuse" + description = "Small configuration file parser library for C" + topics = ("configuration", "parser") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinh/libconfuse" + license = "ISC" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + tc.generate(env) + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), + "SUBDIRS = m4 po src $(EXAMPLES) tests doc", + "SUBDIRS = m4 src") + if not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "src", "confuse.h"), + "__declspec (dllimport)", "") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + 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")) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "confuse.dll.lib"), + os.path.join(self.package_folder, "lib", "confuse.lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libconfuse") + self.cpp_info.libs = ["confuse"] diff --git a/recipes/libconfuse/all/test_package/CMakeLists.txt b/recipes/libconfuse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c98d1db7c151d --- /dev/null +++ b/recipes/libconfuse/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libconfuse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libconfuse::libconfuse) diff --git a/recipes/libconfuse/all/test_package/conanfile.py b/recipes/libconfuse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bead96008a67b --- /dev/null +++ b/recipes/libconfuse/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from io import StringIO +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") + config_path = os.path.join(self.source_folder, "hello.conf") + output = StringIO() + self.run(f"{bin_path} {config_path}", output, env="conanrun") + text = output.getvalue() + print(text) + assert "Neighbour" in text diff --git a/recipes/libconfuse/all/test_package/hello.conf b/recipes/libconfuse/all/test_package/hello.conf new file mode 100644 index 0000000000000..ed2f2dae753c2 --- /dev/null +++ b/recipes/libconfuse/all/test_package/hello.conf @@ -0,0 +1,3 @@ +# this is the configuration file for the test_package program + +target = "Neighbour" diff --git a/recipes/libconfuse/all/test_package/test_package.c b/recipes/libconfuse/all/test_package/test_package.c new file mode 100644 index 0000000000000..3251e37c4a7f7 --- /dev/null +++ b/recipes/libconfuse/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "confuse.h" + +#include +#include +#include + +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Need at least one argument\n"); + return EXIT_FAILURE; + } + + cfg_opt_t opts[] = + { + CFG_STR("target", "World", CFGF_NONE), + CFG_END() + }; + + cfg_t *cfg = cfg_init(opts, CFGF_NONE); + if (cfg_parse(cfg, argv[1]) != CFG_SUCCESS) { + fprintf(stderr, "cfg_parse failed\n"); + return EXIT_FAILURE; + } + + char *target = cfg_getstr(cfg, "target"); + printf("Hello, %s!\n", target); + + cfg_free(cfg); + return EXIT_SUCCESS; +} diff --git a/recipes/libconfuse/all/test_v1_package/CMakeLists.txt b/recipes/libconfuse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libconfuse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libconfuse/all/test_v1_package/conanfile.py b/recipes/libconfuse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6f8d199faef5a --- /dev/null +++ b/recipes/libconfuse/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conans import ConanFile, CMake, tools +from io import StringIO +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") + config_path = os.path.join(self.source_folder, os.pardir, "test_package", "hello.conf") + output = StringIO() + self.run(f"{bin_path} {config_path}", run_environment=True, output=output) + text = output.getvalue() + print(text) + assert "Neighbour" in text diff --git a/recipes/libconfuse/config.yml b/recipes/libconfuse/config.yml new file mode 100644 index 0000000000000..ed8415be53cb7 --- /dev/null +++ b/recipes/libconfuse/config.yml @@ -0,0 +1,5 @@ +versions: + "3.3": + folder: all + "3.2.2": + folder: all diff --git a/recipes/libcoro/all/conandata.yml b/recipes/libcoro/all/conandata.yml new file mode 100644 index 0000000000000..b59d551a8df2f --- /dev/null +++ b/recipes/libcoro/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "0.7": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.7.tar.gz" + sha256: "ce1f3f1c4fa21b53d1cd195a29bd5a2313e53aa35637b402db04207d02316e51" +patches: + "0.7": + - patch_file: "patches/allow-shared-lib.patch" + patch_type: "conan" + patch_description: "Allow to build the library as a shared library" + - patch_file: "patches/disable-git-config.patch" + patch_type: "conan" + patch_description: "Comment out invocation of git config command" + - patch_file: "patches/fix-dependencies.patch" + patch_type: "conan" + patch_description: "Replace add_subdirectory dependencies with find_package" diff --git a/recipes/libcoro/all/conanfile.py b/recipes/libcoro/all/conanfile.py new file mode 100644 index 0000000000000..2d097def986f0 --- /dev/null +++ b/recipes/libcoro/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibcoroConan(ConanFile): + name = "libcoro" + description = "C++20 coroutine library" + homepage = "https://github.com/jbaldwin/libcoro" + topics = ("coroutines", "concurrency", "tasks", "executors", "networking") + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + 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 _minimum_compilers_version(self): + return { + "gcc": "10.2.1", + } + + 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("openssl/3.1.0", transitive_headers=True) + self.requires("c-ares/1.19.0", transitive_headers=True) + self.requires("tl-expected/1.1.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration("gcc is the only compiler supported by libcoro.") + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBCORO_BUILD_TESTS"] = False + tc.variables["LIBCORO_BUILD_EXAMPLES"] = 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", 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libcoro") + self.cpp_info.set_property("cmake_target_name", "libcoro::libcoro") + self.cpp_info.libs = ["libcoro"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/libcoro/all/patches/allow-shared-lib.patch b/recipes/libcoro/all/patches/allow-shared-lib.patch new file mode 100644 index 0000000000000..9c3ca8de19231 --- /dev/null +++ b/recipes/libcoro/all/patches/allow-shared-lib.patch @@ -0,0 +1,9 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,4 +69,4 @@ + ) + +-add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES}) ++add_library(${PROJECT_NAME} ${LIBCORO_SOURCE_FILES}) + set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) diff --git a/recipes/libcoro/all/patches/disable-git-config.patch b/recipes/libcoro/all/patches/disable-git-config.patch new file mode 100644 index 0000000000000..6753e7e98b819 --- /dev/null +++ b/recipes/libcoro/all/patches/disable-git-config.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,9 +7,9 @@ + + # Set the githooks directory to auto format and update the readme. +-message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks") +-execute_process( +- COMMAND git config --local core.hooksPath .githooks +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +-) ++#message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks") ++#execute_process( ++# COMMAND git config --local core.hooksPath .githooks ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++#) + + option(LIBCORO_BUILD_TESTS "Build the tests, Default=ON." ON) diff --git a/recipes/libcoro/all/patches/fix-dependencies.patch b/recipes/libcoro/all/patches/fix-dependencies.patch new file mode 100644 index 0000000000000..5c46168e06145 --- /dev/null +++ b/recipes/libcoro/all/patches/fix-dependencies.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,8 +24,11 @@ set(CARES_STATIC ON CACHE INTERNAL "") + set(CARES_SHARED OFF CACHE INTERNAL "") + set(CARES_INSTALL OFF CACHE INTERNAL "") + +-add_subdirectory(vendor/c-ares/c-ares) +-add_subdirectory(vendor/tartanllama/expected) ++include(GNUInstallDirs) ++ ++find_package(c-ares CONFIG REQUIRED) ++find_package(tl-expected CONFIG REQUIRED) ++find_package(OpenSSL REQUIRED) + + set(LIBCORO_SOURCE_FILES + inc/coro/concepts/awaitable.hpp +@@ -72,7 +75,7 @@ add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES}) + set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) + target_include_directories(${PROJECT_NAME} PUBLIC inc) +-target_link_libraries(${PROJECT_NAME} PUBLIC pthread c-ares expected ssl crypto) ++target_link_libraries(${PROJECT_NAME} PUBLIC pthread c-ares::cares tl::expected OpenSSL::SSL OpenSSL::Crypto) + + if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.2.0") +@@ -105,4 +108,4 @@ configure_file(libcoro.pc.in libcoro.pc @ONLY) + + install(TARGETS libcoro) + install(DIRECTORY inc/coro TYPE INCLUDE) +-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcoro.pc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/../lib/pkgconfig) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcoro.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/recipes/libcoro/all/test_package/CMakeLists.txt b/recipes/libcoro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5b603835dec1 --- /dev/null +++ b/recipes/libcoro/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(libcoro REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libcoro::libcoro) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/libcoro/all/test_package/conanfile.py b/recipes/libcoro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libcoro/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/libcoro/all/test_package/test_package.cpp b/recipes/libcoro/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c1c44f942c456 --- /dev/null +++ b/recipes/libcoro/all/test_package/test_package.cpp @@ -0,0 +1,35 @@ +#include +#include +#include + +int main() +{ + auto task = []() -> coro::task { + auto fibonacci = []() -> coro::generator { + int a = 0; + int b = 1; + while (true) + { + co_yield b; + int tmp = a; + a = b; + b += tmp; + } + }; + + size_t i = 0; + for (int x : fibonacci()) + { + std::cout << x << std::endl; + + if (i++ == 10) + { + break; + } + } + co_return; + }; + + coro::sync_wait(task()); + return 0; +} diff --git a/recipes/libcoro/all/test_v1_package/CMakeLists.txt b/recipes/libcoro/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libcoro/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libcoro/all/test_v1_package/conanfile.py b/recipes/libcoro/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libcoro/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/libcoro/config.yml b/recipes/libcoro/config.yml new file mode 100644 index 0000000000000..0536885a53045 --- /dev/null +++ b/recipes/libcoro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7": + folder: all diff --git a/recipes/libcorrect/all/conandata.yml b/recipes/libcorrect/all/conandata.yml new file mode 100644 index 0000000000000..bbabb165203bc --- /dev/null +++ b/recipes/libcorrect/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "20181010": + url: "https://github.com/quiet/libcorrect/archive/f5a28c74fba7a99736fe49d3a5243eca29517ae9.tar.gz" + sha256: 5a4305aabe6c7d5b58f6677c41c54ad5e8d9003f7a5998f7344d93534e4c5760 +patches: + "20181010": + - patch_file: "patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch" + - patch_file: "patches/0002-Export-symbols-for-windows.patch" diff --git a/recipes/libcorrect/all/conanfile.py b/recipes/libcorrect/all/conanfile.py new file mode 100644 index 0000000000000..a2cd26c5b3b8e --- /dev/null +++ b/recipes/libcorrect/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file +import os + +required_conan_version = ">=1.52.0" + + +class LibcorrectConan(ConanFile): + name = "libcorrect" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/quiet/libcorrect" + description = "C library for Convolutional codes and Reed-Solomon" + topics = ("fec", "reed-solomon", "viterbi", "convolutional") + + 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: + 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 + + 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["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-fPIC", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-fsanitize=address", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["correct"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libcorrect/all/patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch b/recipes/libcorrect/all/patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch new file mode 100644 index 0000000000000..c798436304a5a --- /dev/null +++ b/recipes/libcorrect/all/patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch @@ -0,0 +1,65 @@ +From 8e78ae35eaf7bfc4f262a61da2e810f2ef2d8a9d Mon Sep 17 00:00:00 2001 +From: Brennan Ashton +Date: Tue, 28 Jan 2020 22:10:37 -0800 +Subject: [PATCH 1/2] Support CMake BUILD_SHARED_LIBS + +Signed-off-by: Brennan Ashton +--- + CMakeLists.txt | 30 ++++++++++++++++-------------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2e8e07e..f7f8a38 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -72,12 +72,17 @@ if(HAVE_SSE) + else() + set(correct_obj_files $ $) + endif() +-add_library(correct SHARED ${correct_obj_files}) +-add_library(correct_static ${correct_obj_files}) +-set_target_properties(correct_static PROPERTIES OUTPUT_NAME "correct") ++ ++option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) ++if(BUILD_SHARED_LIBS) ++ set (LIB_TYPE SHARED) ++else(BUILD_SHARED_LIBS) ++ set(LIB_TYPE STATIC) ++endif(BUILD_SHARED_LIBS) ++ ++add_library(correct ${LIB_TYPE} ${correct_obj_files}) + if(HAVE_SSE) + target_compile_definitions(correct PUBLIC HAVE_SSE=1) +- target_compile_definitions(correct_static PUBLIC HAVE_SSE=1) + endif() + + add_subdirectory(util) +@@ -85,18 +90,15 @@ add_subdirectory(tests) + add_subdirectory(tools) + # add_subdirectory(benchmarks) + +-install(TARGETS correct correct_static +- DESTINATION lib) ++install(TARGETS correct ++ ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) + install(FILES ${INSTALL_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include") + +-add_library(fec_shim_static EXCLUDE_FROM_ALL src/fec_shim.c ${correct_obj_files}) +-set_target_properties(fec_shim_static PROPERTIES OUTPUT_NAME "fec") +-add_library(fec_shim_shared SHARED EXCLUDE_FROM_ALL src/fec_shim.c ${correct_obj_files}) +-set_target_properties(fec_shim_shared PROPERTIES OUTPUT_NAME "fec") ++add_library(fec_shim ${LIB_TYPE} EXCLUDE_FROM_ALL src/fec_shim.c ${correct_obj_files}) ++set_target_properties(fec_shim PROPERTIES OUTPUT_NAME "fec") + add_custom_target(fec-shim-h COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/include/fec_shim.h ${PROJECT_BINARY_DIR}/include/fec.h) +-add_custom_target(shim DEPENDS fec_shim_static fec_shim_shared fec-shim-h) ++add_custom_target(shim DEPENDS fec_shim fec-shim-h) + +-install(TARGETS fec_shim_static fec_shim_shared +- DESTINATION lib +- OPTIONAL) ++install(TARGETS fec_shim OPTIONAL ++ ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) + install(FILES ${PROJECT_BINARY_DIR}/include/fec.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include" OPTIONAL) +-- +2.24.1 + diff --git a/recipes/libcorrect/all/patches/0002-Export-symbols-for-windows.patch b/recipes/libcorrect/all/patches/0002-Export-symbols-for-windows.patch new file mode 100644 index 0000000000000..3b04d058780cd --- /dev/null +++ b/recipes/libcorrect/all/patches/0002-Export-symbols-for-windows.patch @@ -0,0 +1,296 @@ +From 30dc7af903b156f8b5abf5e139a7ca7e4eee2205 Mon Sep 17 00:00:00 2001 +From: Brennan Ashton +Date: Wed, 29 Jan 2020 00:03:04 -0800 +Subject: [PATCH 2/2] Export symbols for windows + +Signed-off-by: Brennan Ashton +--- + CMakeLists.txt | 10 ++++++++- + include/correct-sse.h | 20 ++++++++++------- + include/correct.h | 49 +++++++++++++++++++++--------------------- + include/fec_shim.h | 50 +++++++++++++++++++++---------------------- + 4 files changed, 71 insertions(+), 58 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f7f8a38..b251c65 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,7 @@ include(CheckIncludeFiles) + include(CheckCSourceCompiles) + include(CMakePushCheckState) + include(CheckCCompilerFlag) ++include(GenerateExportHeader) + + if(MSVC) + set(LIBM "") +@@ -58,10 +59,11 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) + ++include_directories("${PROJECT_BINARY_DIR}") + include_directories(${PROJECT_SOURCE_DIR}/include) + add_subdirectory(src) + +-set(INSTALL_HEADERS "${PROJECT_BINARY_DIR}/include/correct.h") ++set(INSTALL_HEADERS "${PROJECT_BINARY_DIR}/include/correct.h" "${PROJECT_BINARY_DIR}/libcorrect_Export.h") + + add_custom_target(correct-h ALL COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/include/correct.h ${PROJECT_BINARY_DIR}/include/correct.h) + +@@ -81,6 +83,12 @@ else(BUILD_SHARED_LIBS) + endif(BUILD_SHARED_LIBS) + + add_library(correct ${LIB_TYPE} ${correct_obj_files}) ++generate_export_header(correct ++ BASE_NAME libcorrect ++ EXPORT_MACRO_NAME libcorrect_EXPORT ++ EXPORT_FILE_NAME libcorrect_Export.h ++ STATIC_DEFINE libcorrect_BUILT_AS_STATIC ++) + if(HAVE_SSE) + target_compile_definitions(correct PUBLIC HAVE_SSE=1) + endif() +diff --git a/include/correct-sse.h b/include/correct-sse.h +index 9372f19..c6dcfb9 100644 +--- a/include/correct-sse.h ++++ b/include/correct-sse.h +@@ -10,20 +10,24 @@ typedef struct correct_convolutional_sse correct_convolutional_sse; + * and non-sse instances should not be used with the sse functions. + */ + +-correct_convolutional_sse *correct_convolutional_sse_create( ++libcorrect_EXPORT correct_convolutional_sse *correct_convolutional_sse_create( + size_t rate, size_t order, const correct_convolutional_polynomial_t *poly); + +-void correct_convolutional_sse_destroy(correct_convolutional_sse *conv); ++libcorrect_EXPORT void correct_convolutional_sse_destroy(correct_convolutional_sse *conv); + +-size_t correct_convolutional_sse_encode_len(correct_convolutional_sse *conv, size_t msg_len); ++libcorrect_EXPORT size_t correct_convolutional_sse_encode_len(correct_convolutional_sse *conv, ++ size_t msg_len); + +-size_t correct_convolutional_sse_encode(correct_convolutional_sse *conv, const uint8_t *msg, +- size_t msg_len, uint8_t *encoded); ++libcorrect_EXPORT size_t correct_convolutional_sse_encode(correct_convolutional_sse *conv, ++ const uint8_t *msg, size_t msg_len, ++ uint8_t *encoded); + +-ssize_t correct_convolutional_sse_decode(correct_convolutional_sse *conv, const uint8_t *encoded, +- size_t num_encoded_bits, uint8_t *msg); ++libcorrect_EXPORT ssize_t correct_convolutional_sse_decode(correct_convolutional_sse *conv, ++ const uint8_t *encoded, ++ size_t num_encoded_bits, ++ uint8_t *msg); + +-ssize_t correct_convolutional_sse_decode_soft(correct_convolutional_sse *conv, ++libcorrect_EXPORT ssize_t correct_convolutional_sse_decode_soft(correct_convolutional_sse *conv, + const correct_convolutional_soft_t *encoded, + size_t num_encoded_bits, uint8_t *msg); + +diff --git a/include/correct.h b/include/correct.h +index 12d817d..5d89fec 100644 +--- a/include/correct.h ++++ b/include/correct.h +@@ -9,7 +9,7 @@ + typedef ptrdiff_t ssize_t; + #endif + +- ++#include "libcorrect_Export.h" + + // Convolutional Codes + +@@ -41,14 +41,14 @@ typedef struct correct_convolutional correct_convolutional; + * + * If this call is successful, it returns a non-NULL pointer. + */ +-correct_convolutional *correct_convolutional_create(size_t inv_rate, size_t order, ++libcorrect_EXPORT correct_convolutional *correct_convolutional_create(size_t inv_rate, size_t order, + const correct_convolutional_polynomial_t *poly); + + /* correct_convolutional_destroy releases all resources associated + * with conv. This pointer should not be used for further calls + * after calling destroy. + */ +-void correct_convolutional_destroy(correct_convolutional *conv); ++libcorrect_EXPORT void correct_convolutional_destroy(correct_convolutional *conv); + + /* correct_convolutional_encode_len returns the number of *bits* + * in a msg_len of given size, in *bytes*. In order to convert +@@ -57,7 +57,7 @@ void correct_convolutional_destroy(correct_convolutional *conv); + * length/8 + 1. If it is zero, then the length is just + * length/8. + */ +-size_t correct_convolutional_encode_len(correct_convolutional *conv, size_t msg_len); ++libcorrect_EXPORT size_t correct_convolutional_encode_len(correct_convolutional *conv, size_t msg_len); + + /* correct_convolutional_encode uses the given conv instance to + * encode a block of data and write it to encoded. The length of +@@ -70,8 +70,8 @@ size_t correct_convolutional_encode_len(correct_convolutional *conv, size_t msg_ + * this is not an exact multiple of 8, then it occupies an additional + * byte. + */ +-size_t correct_convolutional_encode(correct_convolutional *conv, const uint8_t *msg, size_t msg_len, +- uint8_t *encoded); ++libcorrect_EXPORT size_t correct_convolutional_encode(correct_convolutional *conv, const uint8_t *msg, ++ size_t msg_len, uint8_t *encoded); + + /* correct_convolutional_decode uses the given conv instance to + * decode a block encoded by correct_convolutional_encode. This +@@ -96,8 +96,8 @@ size_t correct_convolutional_encode(correct_convolutional *conv, const uint8_t * + * This function returns the number of bytes written to msg. If + * it fails, it returns -1. + */ +-ssize_t correct_convolutional_decode(correct_convolutional *conv, const uint8_t *encoded, +- size_t num_encoded_bits, uint8_t *msg); ++libcorrect_EXPORT ssize_t correct_convolutional_decode(correct_convolutional *conv, const uint8_t *encoded, ++ size_t num_encoded_bits, uint8_t *msg); + + /* correct_convolutional_decode_soft uses the given conv instance + * to decode a block encoded by correct_convolutional_encode and +@@ -120,9 +120,9 @@ ssize_t correct_convolutional_decode(correct_convolutional *conv, const uint8_t + * This function returns the number of bytes written to msg. If + * it fails, it returns -1. + */ +-ssize_t correct_convolutional_decode_soft(correct_convolutional *conv, +- const correct_convolutional_soft_t *encoded, +- size_t num_encoded_bits, uint8_t *msg); ++libcorrect_EXPORT ssize_t correct_convolutional_decode_soft(correct_convolutional *conv, ++ const correct_convolutional_soft_t *encoded, ++ size_t num_encoded_bits, uint8_t *msg); + + // Reed-Solomon + +@@ -195,10 +195,10 @@ static const uint16_t correct_rs_primitive_polynomial_ccsds = + * generator_root_gap are 1 and 1. Not all combinations of + * values produce valid codes. + */ +-correct_reed_solomon *correct_reed_solomon_create(uint16_t primitive_polynomial, +- uint8_t first_consecutive_root, +- uint8_t generator_root_gap, +- size_t num_roots); ++libcorrect_EXPORT correct_reed_solomon *correct_reed_solomon_create(uint16_t primitive_polynomial, ++ uint8_t first_consecutive_root, ++ uint8_t generator_root_gap, ++ size_t num_roots); + + /* correct_reed_solomon_encode uses the rs instance to encode + * parity information onto a block of data. msg_length should be +@@ -214,8 +214,8 @@ correct_reed_solomon *correct_reed_solomon_create(uint16_t primitive_polynomial, + * + * This function returns the number of bytes written to encoded. + */ +-ssize_t correct_reed_solomon_encode(correct_reed_solomon *rs, const uint8_t *msg, size_t msg_length, +- uint8_t *encoded); ++libcorrect_EXPORT ssize_t correct_reed_solomon_encode(correct_reed_solomon *rs, const uint8_t *msg, ++ size_t msg_length, uint8_t *encoded); + + /* correct_reed_solomon_decode uses the rs instance to decode + * a payload from a block containing payload and parity bytes. +@@ -232,8 +232,8 @@ ssize_t correct_reed_solomon_encode(correct_reed_solomon *rs, const uint8_t *msg + * This function returns a positive number of bytes written to msg + * if it has decoded or -1 if it has encountered an error. + */ +-ssize_t correct_reed_solomon_decode(correct_reed_solomon *rs, const uint8_t *encoded, +- size_t encoded_length, uint8_t *msg); ++libcorrect_EXPORT ssize_t correct_reed_solomon_decode(correct_reed_solomon *rs, const uint8_t *encoded, ++ size_t encoded_length, uint8_t *msg); + + /* correct_reed_solomon_decode_with_erasures uses the rs + * instance to decode a payload from a block containing payload +@@ -262,16 +262,17 @@ ssize_t correct_reed_solomon_decode(correct_reed_solomon *rs, const uint8_t *enc + * This function returns a positive number of bytes written to msg + * if it has decoded or -1 if it has encountered an error. + */ +-ssize_t correct_reed_solomon_decode_with_erasures(correct_reed_solomon *rs, const uint8_t *encoded, +- size_t encoded_length, +- const uint8_t *erasure_locations, +- size_t erasure_length, uint8_t *msg); ++libcorrect_EXPORT ssize_t correct_reed_solomon_decode_with_erasures(correct_reed_solomon *rs, ++ const uint8_t *encoded, ++ size_t encoded_length, ++ const uint8_t *erasure_locations, ++ size_t erasure_length, uint8_t *msg); + + /* correct_reed_solomon_destroy releases the resources + * associated with rs. This pointer should not be + * used for any functions after this call. + */ +-void correct_reed_solomon_destroy(correct_reed_solomon *rs); ++libcorrect_EXPORT void correct_reed_solomon_destroy(correct_reed_solomon *rs); + + #endif + +diff --git a/include/fec_shim.h b/include/fec_shim.h +index b06e463..5f76ddd 100644 +--- a/include/fec_shim.h ++++ b/include/fec_shim.h +@@ -6,11 +6,11 @@ + #include + + // Reed-Solomon +-void *init_rs_char(int symbol_size, int primitive_polynomial, int first_consecutive_root, +- int root_gap, int number_roots, unsigned int pad); +-void free_rs_char(void *rs); +-void encode_rs_char(void *rs, const unsigned char *msg, unsigned char *parity); +-void decode_rs_char(void *rs, unsigned char *block, int *erasure_locations, int num_erasures); ++libcorrect_EXPORT void *init_rs_char(int symbol_size, int primitive_polynomial, int first_consecutive_root, ++ int root_gap, int number_roots, unsigned int pad); ++libcorrect_EXPORT void free_rs_char(void *rs); ++libcorrect_EXPORT void encode_rs_char(void *rs, const unsigned char *msg, unsigned char *parity); ++libcorrect_EXPORT void decode_rs_char(void *rs, unsigned char *block, int *erasure_locations, int num_erasures); + + // Convolutional Codes + +@@ -37,29 +37,29 @@ void decode_rs_char(void *rs, unsigned char *block, int *erasure_locations, int + #define V615POLYF 064537 + + // Convolutional Methods +-void *create_viterbi27(int num_decoded_bits); +-int init_viterbi27(void *vit, int _mystery); +-int update_viterbi27_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); +-int chainback_viterbi27(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); +-void delete_viterbi27(void *vit); ++libcorrect_EXPORT void *create_viterbi27(int num_decoded_bits); ++libcorrect_EXPORT int init_viterbi27(void *vit, int _mystery); ++libcorrect_EXPORT int update_viterbi27_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); ++libcorrect_EXPORT int chainback_viterbi27(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); ++libcorrect_EXPORT void delete_viterbi27(void *vit); + +-void *create_viterbi29(int num_decoded_bits); +-int init_viterbi29(void *vit, int _mystery); +-int update_viterbi29_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); +-int chainback_viterbi29(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); +-void delete_viterbi29(void *vit); ++libcorrect_EXPORT void *create_viterbi29(int num_decoded_bits); ++libcorrect_EXPORT int init_viterbi29(void *vit, int _mystery); ++libcorrect_EXPORT int update_viterbi29_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); ++libcorrect_EXPORT int chainback_viterbi29(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); ++libcorrect_EXPORT void delete_viterbi29(void *vit); + +-void *create_viterbi39(int num_decoded_bits); +-int init_viterbi39(void *vit, int _mystery); +-int update_viterbi39_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); +-int chainback_viterbi39(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); +-void delete_viterbi39(void *vit); ++libcorrect_EXPORT void *create_viterbi39(int num_decoded_bits); ++libcorrect_EXPORT int init_viterbi39(void *vit, int _mystery); ++libcorrect_EXPORT int update_viterbi39_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); ++libcorrect_EXPORT int chainback_viterbi39(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); ++libcorrect_EXPORT void delete_viterbi39(void *vit); + +-void *create_viterbi615(int num_decoded_bits); +-int init_viterbi615(void *vit, int _mystery); +-int update_viterbi615_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); +-int chainback_viterbi615(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); +-void delete_viterbi615(void *vit); ++libcorrect_EXPORT void *create_viterbi615(int num_decoded_bits); ++libcorrect_EXPORT int init_viterbi615(void *vit, int _mystery); ++libcorrect_EXPORT int update_viterbi615_blk(void *vit, unsigned char *encoded_soft, int n_encoded_groups); ++libcorrect_EXPORT int chainback_viterbi615(void *vit, unsigned char *decoded, unsigned int n_decoded_bits, unsigned int _mystery); ++libcorrect_EXPORT void delete_viterbi615(void *vit); + + // Misc other + static inline int parity(unsigned int x) { +-- +2.24.1 + diff --git a/recipes/libcorrect/all/test_package/CMakeLists.txt b/recipes/libcorrect/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..37ccc2fe5dfaa --- /dev/null +++ b/recipes/libcorrect/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libcorrect REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libcorrect::libcorrect) diff --git a/recipes/libcorrect/all/test_package/conanfile.py b/recipes/libcorrect/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libcorrect/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/libcorrect/all/test_package/test_package.c b/recipes/libcorrect/all/test_package/test_package.c new file mode 100644 index 0000000000000..975b75cfa1461 --- /dev/null +++ b/recipes/libcorrect/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(void) { + correct_convolutional *conv; + + conv = correct_convolutional_create(2, 6, correct_conv_r12_6_polynomial); + correct_convolutional_destroy(conv); + + return 0; +} diff --git a/recipes/libcorrect/all/test_v1_package/CMakeLists.txt b/recipes/libcorrect/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..37041d4cb4431 --- /dev/null +++ b/recipes/libcorrect/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libcorrect REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libcorrect::libcorrect) diff --git a/recipes/libcorrect/all/test_v1_package/conanfile.py b/recipes/libcorrect/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libcorrect/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/libcorrect/config.yml b/recipes/libcorrect/config.yml new file mode 100644 index 0000000000000..744ebfad43c85 --- /dev/null +++ b/recipes/libcorrect/config.yml @@ -0,0 +1,3 @@ +versions: + "20181010": + folder: all diff --git a/recipes/libcpuid/all/CMakeLists.txt b/recipes/libcpuid/all/CMakeLists.txt new file mode 100644 index 0000000000000..dcbf69112bb06 --- /dev/null +++ b/recipes/libcpuid/all/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +include(GNUInstallDirs) + +if(MSVC AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/libcpuid/all/conandata.yml b/recipes/libcpuid/all/conandata.yml new file mode 100644 index 0000000000000..133cbeb595d14 --- /dev/null +++ b/recipes/libcpuid/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "0.5.1": + url: "https://github.com/anrieff/libcpuid/archive/v0.5.1.tar.gz" + sha256: "36d62842ef43c749c0ba82237b10ede05b298d79a0e39ef5fd1115ba1ff8e126" + "0.5.0": + url: "https://github.com/anrieff/libcpuid/archive/v0.5.0.tar.gz" + sha256: "49893f31475510aa0ebe2ad3a29fad95e2a592cc5f48451c95271c536f89a157" +patches: + "0.5.1": + - patch_file: "patches/0.5.0-cmake-fixes.patch" + base_path: "source_subfolder" + "0.5.0": + - patch_file: "patches/0.5.0-cmake-fixes.patch" + base_path: "source_subfolder" diff --git a/recipes/libcpuid/all/conanfile.py b/recipes/libcpuid/all/conanfile.py new file mode 100644 index 0000000000000..68d83bcf3f7fc --- /dev/null +++ b/recipes/libcpuid/all/conanfile.py @@ -0,0 +1,93 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class LibCpuidConan(ConanFile): + name = "libcpuid" + description = "libcpuid is a small C library for x86 CPU detection and feature extraction" + topics = ("libcpuid", "detec", "cpu", "intel", "amd", "x86_64") + license = "https://github.com/anrieff/libcpuid" + homepage = "https://github.com/anrieff/libcpuid" + 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, + } + + 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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("libcpuid is only available for x86 and x86_64 architecture") + + 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["ENABLE_DOCS"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpuid") + self.cpp_info.set_property("cmake_target_name", "cpuid::cpuid") + self.cpp_info.set_property("pkg_config_name", "libcpuid") + self.cpp_info.libs = ["cpuid"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "cpuid" + self.cpp_info.names["cmake_find_package_multi"] = "cpuid" diff --git a/recipes/libcpuid/all/patches/0.5.0-cmake-fixes.patch b/recipes/libcpuid/all/patches/0.5.0-cmake-fixes.patch new file mode 100644 index 0000000000000..31d0f27ec5aad --- /dev/null +++ b/recipes/libcpuid/all/patches/0.5.0-cmake-fixes.patch @@ -0,0 +1,45 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,4 +27,3 @@ endif(UNIX) + # Include subdirectories + add_subdirectory(libcpuid) + add_subdirectory(cpuid_tool) +-add_subdirectory(tests) +--- a/cpuid_tool/CMakeLists.txt ++++ b/cpuid_tool/CMakeLists.txt +@@ -2,7 +2,7 @@ add_executable(cpuid_tool cpuid_tool.c) + + target_link_libraries(cpuid_tool cpuid) + +-if(WIN32) ++if(0) + install( + TARGETS cpuid_tool + CONFIGURATIONS Debug +@@ -12,5 +12,5 @@ if(WIN32) + CONFIGURATIONS Release + RUNTIME DESTINATION bin/Release) + else() +- install(TARGETS cpuid_tool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ install(TARGETS cpuid_tool DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() +--- a/libcpuid/CMakeLists.txt ++++ b/libcpuid/CMakeLists.txt +@@ -13,7 +13,7 @@ if("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64") + endif() + + if(UNIX) +- add_library(cpuid SHARED ${cpuid_sources}) ++ add_library(cpuid ${cpuid_sources}) + else() + add_library(cpuid ${cpuid_sources}) + endif() +@@ -67,7 +67,7 @@ include(CMakePackageConfigHelpers) + write_basic_package_version_file("${version_config}" COMPATIBILITY SameMajorVersion) + + # Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * PROJECT_NAME +-configure_package_config_file("${CMAKE_MODULE_PATH}/Config.cmake.in" "${project_config}" ++configure_package_config_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" + INSTALL_DESTINATION "${config_install_dir}") + + # Installation diff --git a/recipes/libcpuid/all/test_package/CMakeLists.txt b/recipes/libcpuid/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bbffbda24bead --- /dev/null +++ b/recipes/libcpuid/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(cpuid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} cpuid::cpuid) diff --git a/recipes/libcpuid/all/test_package/conanfile.py b/recipes/libcpuid/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a2a865893b40b --- /dev/null +++ b/recipes/libcpuid/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + + self.run("cpuid_tool --report", run_environment=True) diff --git a/recipes/libcpuid/all/test_package/test_package.c b/recipes/libcpuid/all/test_package/test_package.c new file mode 100644 index 0000000000000..0e75da0442bbc --- /dev/null +++ b/recipes/libcpuid/all/test_package/test_package.c @@ -0,0 +1,51 @@ +#include "libcpuid/libcpuid.h" + +#include + +int main(void) +{ + if (!cpuid_present()) { // check for CPUID presence + printf("Sorry, your CPU doesn't support CPUID!\n"); + return -1; + } + + + struct cpu_raw_data_t raw; // contains only raw data + struct cpu_id_t data; // contains recognized CPU features data + + + if (cpuid_get_raw_data(&raw) < 0) { // obtain the raw CPUID data + printf("Sorry, cannot get the CPUID raw data.\n"); + printf("Error: %s\n", cpuid_error()); // cpuid_error() gives the last error description + return -2; + } + + + if (cpu_identify(&raw, &data) < 0) { // identify the CPU, using the given raw data. + printf("Sorrry, CPU identification failed.\n"); + printf("Error: %s\n", cpuid_error()); + return -3; + } + + + printf("Found: %s CPU\n", data.vendor_str); // print out the vendor string (e.g. `GenuineIntel') + printf("Processor model is `%s'\n", data.cpu_codename); // print out the CPU code name (e.g. `Pentium 4 (Northwood)') + printf("The full brand string is `%s'\n", data.brand_str); // print out the CPU brand string + printf("The processor has %dK L1 cache and %dK L2 cache\n", + data.l1_data_cache, data.l2_cache); // print out cache size information + printf("The processor has %d cores and %d logical processors\n", + data.num_cores, data.num_logical_cpus); // print out CPU cores information + + printf("Supported multimedia instruction sets:\n"); + printf(" MMX : %s\n", data.flags[CPU_FEATURE_MMX] ? "present" : "absent"); + printf(" MMX-extended: %s\n", data.flags[CPU_FEATURE_MMXEXT] ? "present" : "absent"); + printf(" SSE : %s\n", data.flags[CPU_FEATURE_SSE] ? "present" : "absent"); + printf(" SSE2 : %s\n", data.flags[CPU_FEATURE_SSE2] ? "present" : "absent"); + printf(" 3DNow! : %s\n", data.flags[CPU_FEATURE_3DNOW] ? "present" : "absent"); + + printf("CPU clock is: %d MHz (according to your OS)\n", + cpu_clock_by_os()); // print out the CPU clock, according to the OS + printf("CPU clock is: %d MHz (tested)\n", cpu_clock_measure(200, 0)); // print out the CPU clock, measured with RDTSC. + + return 0; +} diff --git a/recipes/libcpuid/config.yml b/recipes/libcpuid/config.yml new file mode 100644 index 0000000000000..d8b7ba4046e10 --- /dev/null +++ b/recipes/libcpuid/config.yml @@ -0,0 +1,5 @@ +versions: + "0.5.1": + folder: "all" + "0.5.0": + folder: "all" diff --git a/recipes/libcuckoo/all/conandata.yml b/recipes/libcuckoo/all/conandata.yml new file mode 100644 index 0000000000000..499f61880ad61 --- /dev/null +++ b/recipes/libcuckoo/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.3.1": + sha256: "a87122b963ef6b7eadca3e41cb4b533f3b6ad9b588ab2f2140eb6ab0db9a7ba8" + url: "https://github.com/efficient/libcuckoo/archive/refs/tags/v0.3.1.tar.gz" + "0.3.0": + sha256: "b91b77c49577059cd47b258e783f60d5b07dccc5e47258fea00cdedffd84afbe" + url: "https://github.com/efficient/libcuckoo/archive/refs/tags/v0.3.tar.gz" diff --git a/recipes/libcuckoo/all/conanfile.py b/recipes/libcuckoo/all/conanfile.py new file mode 100644 index 0000000000000..bca46ac3eb7a8 --- /dev/null +++ b/recipes/libcuckoo/all/conanfile.py @@ -0,0 +1,70 @@ +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, rmdir + +required_conan_version = ">=1.53.0" + + +class LibCuckooConan(ConanFile): + name = "libcuckoo" + description = "A high-performance, concurrent hash table" + license = "Apache-2.0" + homepage = "https://github.com/efficient/libcuckoo" + url = "https://github.com/conan-io/conan-center-index" + topics = ("concurrency", "hashmap", "header-only", "library", "cuckoo") + package_type = "header-library" + settings = "arch", "build_type", "compiler", "os" + + @property + def _minimum_cpp_standard(self): + return 11 + + 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._minimum_cpp_standard) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_STRESS_TESTS"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_UNIT_TESTS"] = False + tc.variables["BUILD_UNIVERSAL_BENCHMARK"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # Install with CMake + 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", "libcuckoo") + self.cpp_info.set_property("cmake_target_name", "libcuckoo::libcuckoo") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/libcuckoo/all/test_package/CMakeLists.txt b/recipes/libcuckoo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bbb37dc967899 --- /dev/null +++ b/recipes/libcuckoo/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) + +find_package(libcuckoo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libcuckoo::libcuckoo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) diff --git a/recipes/libcuckoo/all/test_package/conanfile.py b/recipes/libcuckoo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..45ce88cf52fa9 --- /dev/null +++ b/recipes/libcuckoo/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 LibcuckooTestConan(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/libcuckoo/all/test_package/test_package.cpp b/recipes/libcuckoo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8df18dd175648 --- /dev/null +++ b/recipes/libcuckoo/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include + +#include + +int main() { + libcuckoo::cuckoohash_map Table; + + for (int i = 0; i < 10; i++) { + Table.insert(i, "found"); + } + + std::string out; + for (int i = 0; i < 11; i++) { + + if (Table.find(i, out)) { + std::cout << i << " " << out << '\n'; + } else { + std::cout << i << " NOT FOUND\n"; + } + } +} diff --git a/recipes/libcuckoo/all/test_v1_package/CMakeLists.txt b/recipes/libcuckoo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4368c23dc75f --- /dev/null +++ b/recipes/libcuckoo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libcuckoo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libcuckoo::libcuckoo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) diff --git a/recipes/libcuckoo/all/test_v1_package/conanfile.py b/recipes/libcuckoo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8a5678ccbf761 --- /dev/null +++ b/recipes/libcuckoo/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +import os + +from conans import CMake, ConanFile, 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("{0}".format(bin_path), run_environment=True) diff --git a/recipes/libcuckoo/config.yml b/recipes/libcuckoo/config.yml new file mode 100644 index 0000000000000..f9de643fda854 --- /dev/null +++ b/recipes/libcuckoo/config.yml @@ -0,0 +1,5 @@ +versions: + "0.3.1": + folder: all + "0.3.0": + folder: all diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml new file mode 100644 index 0000000000000..98dd67e54de0e --- /dev/null +++ b/recipes/libcurl/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "8.0.1": + url: "https://curl.se/download/curl-8.0.1.tar.gz" + sha256: "5fd29000a4089934f121eff456101f0a5d09e2a3e89da1d714adf06c4be887cb" + "7.88.1": + url: "https://curl.se/download/curl-7.88.1.tar.gz" + sha256: "cdb38b72e36bc5d33d5b8810f8018ece1baa29a8f215b4495e495ded82bbf3c7" + "7.87.0": + url: "https://curl.se/download/curl-7.87.0.tar.gz" + sha256: "8a063d664d1c23d35526b87a2bf15514962ffdd8ef7fd40519191b3c23e39548" + "7.86.0": + url: "https://curl.se/download/curl-7.86.0.tar.gz" + sha256: "3dfdd39ba95e18847965cd3051ea6d22586609d9011d91df7bc5521288987a82" + "7.85.0": + url: "https://curl.se/download/curl-7.85.0.tar.gz" + sha256: "78a06f918bd5fde3c4573ef4f9806f56372b32ec1829c9ec474799eeee641c27" + "7.84.0": + url: "https://curl.se/download/curl-7.84.0.tar.gz" + sha256: "3c6893d38d054d4e378267166858698899e9d87258e8ff1419d020c395384535" + "7.83.1": + url: "https://curl.se/download/curl-7.83.1.tar.gz" + sha256: "93fb2cd4b880656b4e8589c912a9fd092750166d555166370247f09d18f5d0c0" + "7.82.0": + url: "https://curl.se/download/curl-7.82.0.tar.gz" + sha256: "910cc5fe279dc36e2cca534172c94364cf3fcf7d6494ba56e6c61a390881ddce" + "7.80.0": + url: "https://curl.se/download/curl-7.80.0.tar.gz" + sha256: "dab997c9b08cb4a636a03f2f7f985eaba33279c1c52692430018fae4a4878dc7" + "7.79.1": + url: "https://curl.se/download/curl-7.79.1.tar.gz" + sha256: "370b11201349816287fb0ccc995e420277fbfcaf76206e309b3f60f0eda090c2" + "7.78.0": + url: "https://curl.se/download/curl-7.78.0.tar.gz" + sha256: "ed936c0b02c06d42cf84b39dd12bb14b62d77c7c4e875ade022280df5dcc81d7" + "7.77.0": + url: "https://curl.se/download/curl-7.77.0.tar.gz" + sha256: "b0a3428acb60fa59044c4d0baae4e4fc09ae9af1d8a3aa84b2e3fbcd99841f77" + "7.76.0": + url: "https://curl.se/download/curl-7.76.0.tar.gz" + sha256: "3b4378156ba09e224008e81dcce854b7ce4d182b1f9cfb97fe5ed9e9c18c6bd3" diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py new file mode 100644 index 0000000000000..cca1e3740917d --- /dev/null +++ b/recipes/libcurl/all/conanfile.py @@ -0,0 +1,717 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, download, export_conandata_patches, get, load, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version + +import os +import re + +required_conan_version = ">=1.54.0" + + +class LibcurlConan(ConanFile): + name = "libcurl" + description = "command line tool and library for transferring data with URLs" + license = "curl" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://curl.se" + topics = ("curl", "data-transfer", + "ftp", "gopher", "http", "imap", "ldap", "mqtt", "pop3", "rtmp", "rtsp", + "scp", "sftp", "smb", "smtp", "telnet", "tftp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [False, "openssl", "wolfssl", "schannel", "darwinssl"], + "with_file": [True, False], + "with_ftp": [True, False], + "with_http": [True, False], + "with_ldap": [True, False], + "with_rtsp": [True, False], + "with_dict": [True, False], + "with_telnet": [True, False], + "with_tftp": [True, False], + "with_pop3": [True, False], + "with_imap": [True, False], + "with_smb": [True, False], + "with_smtp": [True, False], + "with_gopher": [True, False], + "with_mqtt": [True, False], + "with_libssh2": [True, False], + "with_libidn": [True, False], + "with_librtmp": [True, False], + "with_libgsasl": [True, False], + "with_libmetalink": [True, False], + "with_libpsl": [True, False], + "with_largemaxwritesize": [True, False], + "with_nghttp2": [True, False], + "with_zlib": [True, False], + "with_brotli": [True, False], + "with_zstd": [True, False], + "with_c_ares": [True, False], + "with_threaded_resolver": [True, False], + "with_proxy": [True, False], + "with_crypto_auth": [True, False], + "with_ntlm": [True, False], + "with_ntlm_wb": [True, False], + "with_cookies": [True, False], + "with_ipv6": [True, False], + "with_docs": [True, False], + "with_verbose_debug": [True, False], + "with_symbol_hiding": [True, False], + "with_unix_sockets": [True, False], + "with_verbose_strings": [True, False], + "with_ca_bundle": [False, "auto", "ANY"], + "with_ca_path": [False, "auto", "ANY"], + "with_ca_fallback": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": "openssl", + "with_dict": True, + "with_file": True, + "with_ftp": True, + "with_gopher": True, + "with_http": True, + "with_imap": True, + "with_ldap": False, + "with_mqtt": True, + "with_pop3": True, + "with_rtsp": True, + "with_smb": True, + "with_smtp": True, + "with_telnet": True, + "with_tftp": True, + "with_libssh2": False, + "with_libidn": False, + "with_librtmp": False, + "with_libgsasl": False, + "with_libmetalink": False, + "with_libpsl": False, + "with_largemaxwritesize": False, + "with_nghttp2": False, + "with_zlib": True, + "with_brotli": False, + "with_zstd": False, + "with_c_ares": False, + "with_threaded_resolver": True, + "with_proxy": True, + "with_crypto_auth": True, + "with_ntlm": True, + "with_ntlm_wb": True, + "with_cookies": True, + "with_ipv6": True, + "with_docs": False, + "with_verbose_debug": True, + "with_symbol_hiding": False, + "with_unix_sockets": True, + "with_verbose_strings": True, + "with_ca_bundle": "auto", + "with_ca_path": "auto", + "with_ca_fallback": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_win_x_android(self): + return self.settings.os == "Android" and self._settings_build.os == "Windows" + + @property + def _is_using_cmake_build(self): + return is_msvc(self) or self._is_win_x_android + + @property + def _has_metalink_option(self): + # Support for metalink was removed in version 7.78.0 https://github.com/curl/curl/pull/7176 + return Version(self.version) < "7.78.0" and not self._is_using_cmake_build + + @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) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_metalink_option: + del self.options.with_libmetalink + 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 + + # Default options + self.options.with_ssl = "darwinssl" if is_apple_os(self) else "openssl" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + if self._is_using_cmake_build: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.with_ssl == "wolfssl": + self.requires("wolfssl/5.5.1") + if self.options.with_nghttp2: + self.requires("libnghttp2/1.51.0") + if self.options.with_libssh2: + self.requires("libssh2/1.10.0") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_c_ares: + self.requires("c-ares/1.19.0") + if self.options.get_safe("with_libpsl"): + self.requires("libpsl/0.21.1") + + def validate(self): + if self.options.with_ssl == "schannel" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("schannel only suppported on Windows.") + if self.options.with_ssl == "darwinssl" and not is_apple_os(self): + raise ConanInvalidConfiguration("darwinssl only suppported on Apple like OS (Macos, iOS, watchOS or tvOS).") + if self.options.with_ssl == "openssl": + openssl = self.dependencies["openssl"] + if self.options.with_ntlm and openssl.options.no_des: + raise ConanInvalidConfiguration("option with_ntlm=True requires openssl:no_des=False") + + def build_requirements(self): + if self._is_using_cmake_build: + if self._is_win_x_android: + self.tool_requires("ninja/1.11.1") + else: + self.tool_requires("libtool/2.4.7") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self.settings.os in [ "tvOS", "watchOS" ]: + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + download(self, "https://curl.se/ca/cacert-2023-01-10.pem", "cacert.pem", verify=True, sha256="fb1ecd641d0a02c01bc9036d513cb658bbda62a75e246bedbc01764560a639f0") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self._is_using_cmake_build: + self._generate_with_cmake() + else: + self._generate_with_autotools() + + def build(self): + self._patch_sources() + if self._is_using_cmake_build: + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.autoreconf() + # autoreconf is caalled with "--force" which regenerate all files. + # Because we want to use a patched config.sub for tvOS/watchOS, we + # need to call this patch after autoreconf. + self._patch_autoreconf() + autotools.configure() + autotools.make() + + def _patch_autoreconf(self): + # Fix config.sub for tvOS/watchOS + if self.settings.os in [ "tvOS", "watchOS" ]: + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + + def _patch_sources(self): + apply_conandata_patches(self) + self._patch_misc_files() + self._patch_autotools() + self._patch_cmake() + + def _patch_misc_files(self): + if self.options.with_largemaxwritesize: + replace_in_file(self, os.path.join(self.source_folder, "include", "curl", "curl.h"), + "define CURL_MAX_WRITE_SIZE 16384", + "define CURL_MAX_WRITE_SIZE 10485760") + + # https://github.com/curl/curl/issues/2835 + # for additional info, see this comment https://github.com/conan-io/conan-center-index/pull/1008#discussion_r386122685 + if self.settings.compiler == "apple-clang" and self.settings.compiler.version == "9.1": + if self.options.with_ssl == "darwinssl": + replace_in_file(self, os.path.join(self.source_folder, "lib", "vtls", "sectransp.c"), + "#define CURL_BUILD_MAC_10_13 MAC_OS_X_VERSION_MAX_ALLOWED >= 101300", + "#define CURL_BUILD_MAC_10_13 0") + + def _patch_autotools(self): + if self._is_using_cmake_build: + return + + # Disable curl tool for these reasons: + # - link errors if mingw shared or iOS/tvOS/watchOS + # - it makes recipe consistent with CMake build where we don't build curl tool + top_makefile = os.path.join(self.source_folder, "Makefile.am") + replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") + replace_in_file(self, top_makefile, "include src/Makefile.inc", "") + + # zlib naming is not always very consistent + if self.options.with_zlib: + configure_ac = os.path.join(self.source_folder, "configure.ac") + zlib_name = self.dependencies["zlib"].cpp_info.aggregated_components().libs[0] + replace_in_file(self, configure_ac, + "AC_CHECK_LIB(z,", + f"AC_CHECK_LIB({zlib_name},") + replace_in_file(self, configure_ac, + "-lz ", + f"-l{zlib_name} ") + + if self._is_mingw and self.options.shared: + # patch for shared mingw build + lib_makefile = os.path.join(self.source_folder, "lib", "Makefile.am") + replace_in_file(self, lib_makefile, + "noinst_LTLIBRARIES = libcurlu.la", + "") + replace_in_file(self, lib_makefile, + "noinst_LTLIBRARIES =", + "") + replace_in_file(self, lib_makefile, + "lib_LTLIBRARIES = libcurl.la", + "noinst_LTLIBRARIES = libcurl.la") + # add directives to build dll + # used only for native mingw-make + if not cross_building(self): + # The patch file is located in the base src folder + added_content = load(self, os.path.join(self.folders.base_source, "lib_Makefile_add.am")) + save(self, lib_makefile, added_content, append=True) + + def _patch_cmake(self): + if not self._is_using_cmake_build: + return + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # TODO: check this patch, it's suspicious + replace_in_file(self, cmakelists, + "include(CurlSymbolHiding)", "") + + # brotli + replace_in_file(self, cmakelists, "find_package(Brotli QUIET)", "find_package(brotli REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "if(BROTLI_FOUND)", "if(brotli_FOUND)") + replace_in_file(self, cmakelists, "${BROTLI_LIBRARIES}", "brotli::brotli") + replace_in_file(self, cmakelists, "${BROTLI_INCLUDE_DIRS}", "${brotli_INCLUDE_DIRS}") + + # zstd + # Use upstream FindZstd.cmake because check_symbol_exists() is called + # afterwards and it would fail with zstd_LIBRARIES generated by CMakeDeps + replace_in_file(self, cmakelists, "find_package(Zstd REQUIRED)", "find_package(Zstd REQUIRED MODULE)") + replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(0)") + + # c-ares + replace_in_file(self, cmakelists, "find_package(CARES REQUIRED)", "find_package(c-ares REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares") + + # libpsl + 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}") + + # libssh2 + replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "if(LIBSSH2_FOUND)", "if(Libssh2_FOUND)") + replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARY}", "Libssh2::libssh2") + replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIR}", "${Libssh2_INCLUDE_DIRS}") + + # libnghttp2 + replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${NGHTTP2_INCLUDE_DIRS}", "${libnghttp2_INCLUDE_DIRS}") + replace_in_file(self, cmakelists, "${NGHTTP2_LIBRARIES}", "libnghttp2::nghttp2") + + # wolfssl + replace_in_file(self, cmakelists, "find_package(WolfSSL REQUIRED)", "find_package(wolfssl REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${WolfSSL_LIBRARIES}", "${wolfssl_LIBRARIES}") + replace_in_file(self, cmakelists, "${WolfSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}") + + # INTERFACE_LIBRARY (generated by the cmake_find_package generator) targets doesn't have the LOCATION property. + # So skipp the LOCATION check in the CMakeLists.txt + if Version(self.version) >= "7.80.0": + replace_in_file(self, + cmakelists, + 'get_target_property(_lib "${_libname}" LOCATION)', + """get_target_property(_type "${_libname}" TYPE) + if(${_type} STREQUAL "INTERFACE_LIBRARY") + # Reading the INTERFACE_LIBRARY property on non-imported target will error out. + continue() + endif() + get_target_property(_lib "${_libname}" LOCATION)""", + ) + + def _yes_no(self, value): + return "yes" if value else "no" + + def _generate_with_autotools(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--with-libidn2={self._yes_no(self.options.with_libidn)}", + f"--with-librtmp={self._yes_no(self.options.with_librtmp)}", + f"--with-libpsl={self._yes_no(self.options.with_libpsl)}", + f"--with-libgsasl={self._yes_no(self.options.with_libgsasl)}", + f"--with-schannel={self._yes_no(self.options.with_ssl == 'schannel')}", + f"--with-secure-transport={self._yes_no(self.options.with_ssl == 'darwinssl')}", + f"--with-brotli={self._yes_no(self.options.with_brotli)}", + f"--enable-shared={self._yes_no(self.options.shared)}", + f"--enable-static={self._yes_no(not self.options.shared)}", + f"--enable-dict={self._yes_no(self.options.with_dict)}", + f"--enable-file={self._yes_no(self.options.with_file)}", + f"--enable-ftp={self._yes_no(self.options.with_ftp)}", + f"--enable-gopher={self._yes_no(self.options.with_gopher)}", + f"--enable-http={self._yes_no(self.options.with_http)}", + f"--enable-imap={self._yes_no(self.options.with_imap)}", + f"--enable-ldap={self._yes_no(self.options.with_ldap)}", + f"--enable-mqtt={self._yes_no(self.options.with_mqtt)}", + f"--enable-pop3={self._yes_no(self.options.with_pop3)}", + f"--enable-rtsp={self._yes_no(self.options.with_rtsp)}", + f"--enable-smb={self._yes_no(self.options.with_smb)}", + f"--enable-smtp={self._yes_no(self.options.with_smtp)}", + f"--enable-telnet={self._yes_no(self.options.with_telnet)}", + f"--enable-tftp={self._yes_no(self.options.with_tftp)}", + f"--enable-debug={self._yes_no(self.settings.build_type == 'Debug')}", + f"--enable-ares={self._yes_no(self.options.with_c_ares)}", + f"--enable-threaded-resolver={self._yes_no(self.options.with_threaded_resolver)}", + f"--enable-cookies={self._yes_no(self.options.with_cookies)}", + f"--enable-ipv6={self._yes_no(self.options.with_ipv6)}", + f"--enable-manual={self._yes_no(self.options.with_docs)}", + f"--enable-verbose={self._yes_no(self.options.with_verbose_debug)}", + f"--enable-symbol-hiding={self._yes_no(self.options.with_symbol_hiding)}", + f"--enable-unix-sockets={self._yes_no(self.options.get_safe('with_unix_sockets'))}", + f"--with-zstd={self._yes_no(self.options.with_zstd)}", + ]) + + # Since 7.77.0, disabling TLS must be explicitly requested otherwise it fails + if Version(self.version) >= "7.77.0" and not self.options.with_ssl: + tc.configure_args.append("--without-ssl") + + openssl_option = "ssl" if Version(self.version) < "7.77.0" else "openssl" + if self.options.with_ssl == "openssl": + path = unix_path(self, self.dependencies["openssl"].package_folder) + tc.configure_args.append(f"--with-{openssl_option}={path}") + else: + tc.configure_args.append(f"--without-{openssl_option}") + + if self.options.with_ssl == "wolfssl": + path = unix_path(self, self.dependencies["wolfssl"].package_folder) + tc.configure_args.append(f"--with-wolfssl={path}") + else: + tc.configure_args.append("--without-wolfssl") + + if self.options.with_libssh2: + path = unix_path(self, self.dependencies["libssh2"].package_folder) + tc.configure_args.append(f"--with-libssh2={path}") + else: + tc.configure_args.append("--without-libssh2") + + if self.options.with_nghttp2: + path = unix_path(self, self.dependencies["libnghttp2"].package_folder) + tc.configure_args.append(f"--with-nghttp2={path}") + else: + tc.configure_args.append("--without-nghttp2") + + if self.options.with_zlib: + path = unix_path(self, self.dependencies["zlib"].package_folder) + tc.configure_args.append(f"--with-zlib={path}") + else: + tc.configure_args.append("--without-zlib") + + if self._has_metalink_option: + tc.configure_args.append(f"--with-libmetalink={self._yes_no(self.options.with_libmetalink)}") + + if not self.options.with_proxy: + tc.configure_args.append("--disable-proxy") + + if not self.options.with_rtsp: + tc.configure_args.append("--disable-rtsp") + + if not self.options.with_crypto_auth: + tc.configure_args.append("--disable-crypto-auth") # also disables NTLM in versions of curl prior to 7.78.0 + + # ntlm will default to enabled if any SSL options are enabled + if not self.options.with_ntlm: + if Version(self.version) <= "7.77.0": + tc.configure_args.append("--disable-crypto-auth") + else: + tc.configure_args.append("--disable-ntlm") + + if not self.options.with_ntlm_wb: + tc.configure_args.append("--disable-ntlm-wb") + + if not self.options.with_ca_bundle: + tc.configure_args.append("--without-ca-bundle") + elif self.options.with_ca_bundle != "auto": + tc.configure_args.append(f"--with-ca-bundle={str(self.options.with_ca_bundle)}") + + if not self.options.with_ca_path: + tc.configure_args.append("--without-ca-path") + elif self.options.with_ca_path != "auto": + tc.configure_args.append(f"--with-ca-path={str(self.options.with_ca_path)}") + + tc.configure_args.append(f"--with-ca-fallback={self._yes_no(self.options.with_ca_fallback)}") + + # Cross building flags + if cross_building(self): + if self.settings.os == "Linux" and "arm" in self.settings.arch: + tc.configure_args.append(f"--host={self._get_linux_arm_host()}") + elif self.settings.os == "iOS": + tc.configure_args.append("--enable-threaded-resolver") + tc.configure_args.append("--disable-verbose") + elif self.settings.os == "Android": + pass # this just works, conan is great! + + env = tc.environment() + + # tweaks for mingw + if self._is_mingw: + rcflags = "-O COFF" + if self.settings.arch == "x86": + rcflags += " --target=pe-i386" + elif self.settings.arch == "x86_64": + rcflags += " --target=pe-x86-64" + tc.extra_defines.append("_AMD64_") + env.define("RCFLAGS", rcflags) + + if self.settings.os != "Windows": + tc.fpic = self.options.get_safe("fPIC", True) + + + if cross_building(self) and is_apple_os(self): + tc.extra_defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) + + tc.generate(env) + tc = PkgConfigDeps(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def _get_linux_arm_host(self): + arch = None + if self.settings.os == "Linux": + arch = "arm-linux-gnu" + # aarch64 could be added by user + if "aarch64" in self.settings.arch: + arch = "aarch64-linux-gnu" + elif "arm" in self.settings.arch and "hf" in self.settings.arch: + arch = "arm-linux-gnueabihf" + elif "arm" in self.settings.arch and self._arm_version(str(self.settings.arch)) > 4: + arch = "arm-linux-gnueabi" + return arch + + # TODO, this should be a inner fuction of _get_linux_arm_host since it is only used from there + # it should not polute the class namespace, since there are iOS and Android arm aritectures also + def _arm_version(self, arch): + version = None + match = re.match(r"arm\w*(\d)", arch) + if match: + version = int(match.group(1)) + return version + + def _generate_with_cmake(self): + if self._is_win_x_android: + tc = CMakeToolchain(self, generator="Ninja") + else: + tc = CMakeToolchain(self) + tc.variables["ENABLE_UNICODE"] = True + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_CURL_EXE"] = False + tc.variables["CURL_DISABLE_LDAP"] = not self.options.with_ldap + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["CURL_STATICLIB"] = not self.options.shared + tc.variables["CMAKE_DEBUG_POSTFIX"] = "" + 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" + 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["ENABLE_ARES"] = self.options.with_c_ares + if not self.options.with_c_ares: + tc.variables["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver + tc.variables["CURL_DISABLE_PROXY"] = not self.options.with_proxy + tc.variables["USE_LIBRTMP"] = self.options.with_librtmp + tc.variables["USE_LIBIDN2"] = self.options.with_libidn + tc.variables["CURL_DISABLE_RTSP"] = not self.options.with_rtsp + tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = not self.options.with_crypto_auth + tc.variables["CURL_DISABLE_VERBOSE_STRINGS"] = not self.options.with_verbose_strings + + # Also disables NTLM_WB if set to false + if not self.options.with_ntlm: + if Version(self.version) <= "7.77.0": + tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = True + else: + tc.variables["CURL_DISABLE_NTLM"] = True + tc.variables["NTLM_WB_ENABLED"] = self.options.with_ntlm_wb + + if self.options.with_ca_bundle: + tc.cache_variables["CURL_CA_BUNDLE"] = str(self.options.with_ca_bundle) + else: + tc.cache_variables["CURL_CA_BUNDLE"] = "none" + + if self.options.with_ca_path: + tc.cache_variables["CURL_CA_PATH"] = str(self.options.with_ca_path) + else: + tc.cache_variables["CURL_CA_PATH"] = "none" + + tc.cache_variables["CURL_CA_FALLBACK"] = self.options.with_ca_fallback + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "cacert.pem", src=self.source_folder, dst=os.path.join(self.package_folder, "res")) + if self._is_using_cmake_build: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + if self._is_mingw and self.options.shared: + # Handle only mingw libs + copy(self, pattern="*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, pattern="*.dll.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CURL") + self.cpp_info.set_property("cmake_target_name", "CURL::libcurl") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("pkg_config_name", "libcurl") + + self.cpp_info.components["curl"].resdirs = ["res"] + if is_msvc(self): + self.cpp_info.components["curl"].libs = ["libcurl_imp"] if self.options.shared else ["libcurl"] + else: + self.cpp_info.components["curl"].libs = ["curl"] + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.with_libidn: + self.cpp_info.components["curl"].libs.append("idn") + if self.options.with_librtmp: + self.cpp_info.components["curl"].libs.append("rtmp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["curl"].system_libs = ["rt", "pthread"] + elif self.settings.os == "Windows": + # used on Windows for VS build, native and cross mingw build + self.cpp_info.components["curl"].system_libs = ["ws2_32"] + if self.options.with_ldap: + self.cpp_info.components["curl"].system_libs.append("wldap32") + if self.options.with_ssl == "schannel": + self.cpp_info.components["curl"].system_libs.append("crypt32") + elif is_apple_os(self): + if Version(self.version) >= "7.78.0" or self.options.with_ssl == "darwinssl": + self.cpp_info.components["curl"].frameworks.append("CoreFoundation") + if Version(self.version) >= "7.77.0": + self.cpp_info.components["curl"].frameworks.append("SystemConfiguration") + if self.options.with_ldap: + self.cpp_info.components["curl"].system_libs.append("ldap") + if self.options.with_ssl == "darwinssl": + self.cpp_info.components["curl"].frameworks.append("Security") + + if self._is_mingw: + # provide pthread for dependent packages + self.cpp_info.components["curl"].cflags.append("-pthread") + self.cpp_info.components["curl"].exelinkflags.append("-pthread") + self.cpp_info.components["curl"].sharedlinkflags.append("-pthread") + + if not self.options.shared: + self.cpp_info.components["curl"].defines.append("CURL_STATICLIB=1") + + if self.options.with_ssl == "openssl": + self.cpp_info.components["curl"].requires.append("openssl::openssl") + if self.options.with_ssl == "wolfssl": + self.cpp_info.components["curl"].requires.append("wolfssl::wolfssl") + if self.options.with_nghttp2: + self.cpp_info.components["curl"].requires.append("libnghttp2::libnghttp2") + if self.options.with_libssh2: + self.cpp_info.components["curl"].requires.append("libssh2::libssh2") + if self.options.with_zlib: + self.cpp_info.components["curl"].requires.append("zlib::zlib") + if self.options.with_brotli: + self.cpp_info.components["curl"].requires.append("brotli::brotli") + if self.options.with_zstd: + self.cpp_info.components["curl"].requires.append("zstd::zstd") + if self.options.with_c_ares: + self.cpp_info.components["curl"].requires.append("c-ares::c-ares") + if self.options.get_safe("with_libpsl"): + self.cpp_info.components["curl"].requires.append("libpsl::libpsl") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "CURL" + self.cpp_info.names["cmake_find_package_multi"] = "CURL" + self.cpp_info.components["curl"].names["cmake_find_package"] = "libcurl" + self.cpp_info.components["curl"].names["cmake_find_package_multi"] = "libcurl" + self.cpp_info.components["curl"].set_property("cmake_target_name", "CURL::libcurl") + self.cpp_info.components["curl"].set_property("pkg_config_name", "libcurl") diff --git a/recipes/libcurl/all/lib_Makefile_add.am b/recipes/libcurl/all/lib_Makefile_add.am new file mode 100644 index 0000000000000..ab1b697fe638c --- /dev/null +++ b/recipes/libcurl/all/lib_Makefile_add.am @@ -0,0 +1,24 @@ + +libcurl_dll_LIBRARY = libcurl.dll +libcurl_dll_a_LIBRARY = libcurl.dll.a + +LIBCURL_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES))) + +RESOURCE = libcurl.res + +RC = windres + +all-local: $(libcurl_dll_LIBRARY) + + +$(libcurl_dll_LIBRARY): $(LIBCURL_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENCIES) + @$(call DEL, $@) + $(CC) $(LDFLAGS) -shared -o $@ \ + -Wl,--output-def,$(@:.dll=.def),--out-implib,$(libcurl_dll_a_LIBRARY) \ + $(LIBCURL_OBJECTS) $(RESOURCE) $(LIBCURL_LIBS) + +%.o: %.c $(PROOT)/include/curl/curlbuild.h + $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ + +%.res: %.rc + $(RC) $(RCFLAGS) -i $< -o $@ diff --git a/recipes/libcurl/all/patches/004-no-checksrc.patch b/recipes/libcurl/all/patches/004-no-checksrc.patch new file mode 100644 index 0000000000000..7a5cb866faa93 --- /dev/null +++ b/recipes/libcurl/all/patches/004-no-checksrc.patch @@ -0,0 +1,12 @@ +diff -ruN a/lib/Makefile.am b/lib/Makefile.am +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -138,8 +138,6 @@ + CS_ = $(CS_0) + + checksrc: +- $(CHECKSRC)(@PERL@ $(srcdir)/checksrc.pl -D$(srcdir) -W$(srcdir)/curl_config.h \ +- $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch]) + + if CURLDEBUG + # for debug builds, we scan the sources on all regular make invokes diff --git a/recipes/libcurl/all/test_package/CMakeLists.txt b/recipes/libcurl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cbc46379aedd1 --- /dev/null +++ b/recipes/libcurl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(CURL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl) diff --git a/recipes/libcurl/all/test_package/conanfile.py b/recipes/libcurl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b0f5c0aed58a5 --- /dev/null +++ b/recipes/libcurl/all/test_package/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os +import subprocess +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _test_executable(self): + return os.path.join(self.cpp.build.bindirs[0], "test_package") + + def test(self): + if can_run(self): + self.run(self._test_executable, env="conanrun") + else: + # We will dump information for the generated executable + if self.settings.os in ["Android", "iOS"]: + # FIXME: Check output for these hosts + return + + output = subprocess.check_output(["file", self._test_executable]).decode() + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" + + elif self.settings.os == "Linux": + if self.settings.arch == "armv8_32": + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + elif "armv8" in self.settings.arch: + assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" + elif "arm" in self.settings.arch: + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + + elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW + assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" diff --git a/recipes/libcurl/all/test_package/test_package.c b/recipes/libcurl/all/test_package/test_package.c new file mode 100644 index 0000000000000..309b36d2e45f9 --- /dev/null +++ b/recipes/libcurl/all/test_package/test_package.c @@ -0,0 +1,35 @@ +#include +#include + +int main(void) +{ + CURL *curl; + int retval = 0; + const char *const *proto; + curl_version_info_data* id = curl_version_info(CURLVERSION_NOW); + if (!id) + return 1; + + printf("protocols: "); + for(proto = id->protocols; *proto; proto++) { + printf("%s ", *proto); + } + printf("\nversion: %s\nssl version: %s\nfeatures: %d\n", id->version, id->ssl_version, id->features); + + curl = curl_easy_init(); + if(curl) { + char errbuf[CURL_ERROR_SIZE]; + + /* provide a buffer to store errors in */ + curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf); + + /* always cleanup */ + curl_easy_cleanup(curl); + printf("Succeed\n"); + } else { + printf("Failed to init curl\n"); + retval = 3; + } + + return retval; +} diff --git a/recipes/libcurl/all/test_v1_package/CMakeLists.txt b/recipes/libcurl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..448a8a5aaf0d7 --- /dev/null +++ b/recipes/libcurl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) + diff --git a/recipes/libcurl/all/test_v1_package/conanfile.py b/recipes/libcurl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7ebb558a2d5e3 --- /dev/null +++ b/recipes/libcurl/all/test_v1_package/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, CMake, tools +import os +import subprocess +import re + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _test_executable(self): + return os.path.join("bin", "test_package") + + def test(self): + if not tools.cross_building(self): + self.run(self._test_executable, run_environment=True) + else: + # We will dump information for the generated executable + if self.settings.os in ["Android", "iOS"]: + # FIXME: Check output for these hosts + return + + output = subprocess.check_output(["file", self._test_executable]).decode() + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" + + elif self.settings.os == "Linux": + if self.settings.arch == "armv8_32": + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + elif "armv8" in self.settings.arch: + assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" + elif "arm" in self.settings.arch: + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + + elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW + assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml new file mode 100644 index 0000000000000..8e9856b18ba3a --- /dev/null +++ b/recipes/libcurl/config.yml @@ -0,0 +1,27 @@ +versions: + "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 + "7.77.0": + folder: all + "7.76.0": + folder: all diff --git a/recipes/libdaemon/all/conandata.yml b/recipes/libdaemon/all/conandata.yml new file mode 100644 index 0000000000000..0521f8ab5a13a --- /dev/null +++ b/recipes/libdaemon/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.14": + url: "http://0pointer.de/lennart/projects/libdaemon/libdaemon-0.14.tar.gz" + sha256: "fd23eb5f6f986dcc7e708307355ba3289abe03cc381fc47a80bca4a50aa6b834" diff --git a/recipes/libdaemon/all/conanfile.py b/recipes/libdaemon/all/conanfile.py new file mode 100644 index 0000000000000..92f0ca045e87d --- /dev/null +++ b/recipes/libdaemon/all/conanfile.py @@ -0,0 +1,100 @@ +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 +from conan.tools.files import 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 +import os + +required_conan_version = ">=1.53.0" + + +class LibDaemonConan(ConanFile): + name = "libdaemon" + description = "a lightweight C library that eases the writing of UNIX daemons" + topics = ("daemon") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://0pointer.de/lennart/projects/libdaemon/" + license = "LGPL-2.1-or-later" + + 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 validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("Visual Studio not supported") + + def build_requirements(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") + + 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() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-examples") + if cross_building(self): + tc.configure_args.append("ac_cv_func_setpgrp_void=yes") + tc.generate() + + def _patch_sources(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libdaemon") + self.cpp_info.libs = ["daemon"] diff --git a/recipes/libdaemon/all/test_package/CMakeLists.txt b/recipes/libdaemon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..23288e5f6af93 --- /dev/null +++ b/recipes/libdaemon/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libdaemon REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdaemon::libdaemon) diff --git a/recipes/libdaemon/all/test_package/conanfile.py b/recipes/libdaemon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c46f4c5ac93f7 --- /dev/null +++ b/recipes/libdaemon/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run(f"{bin_path} -k", env="conanrun") diff --git a/recipes/libdaemon/all/test_package/test_package.c b/recipes/libdaemon/all/test_package/test_package.c new file mode 100644 index 0000000000000..0a230a261b754 --- /dev/null +++ b/recipes/libdaemon/all/test_package/test_package.c @@ -0,0 +1,195 @@ +/*** + This file is part of libdaemon. + + Copyright 2003-2008 Lennart Poettering + + libdaemon is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 2.1 of the + License, or (at your option) any later version. + + libdaemon is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libdaemon. If not, see + . +***/ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +const char *daemon_pid_file_proc_tmp(void) { + return "/tmp/test_package.pid"; +} + +int main(int argc, char *argv[]) { + daemon_pid_file_proc = daemon_pid_file_proc_tmp; + + pid_t pid; + + /* Reset signal handlers */ + if (daemon_reset_sigs(-1) < 0) { + daemon_log(LOG_ERR, "Failed to reset all signal handlers: %s", strerror(errno)); + return 1; + } + + /* Unblock signals */ + if (daemon_unblock_sigs(-1) < 0) { + daemon_log(LOG_ERR, "Failed to unblock all signals: %s", strerror(errno)); + return 1; + } + + /* Set indetification string for the daemon for both syslog and PID file */ + daemon_pid_file_ident = daemon_log_ident = daemon_ident_from_argv0(argv[0]); + + /* Check if we are called with -k parameter */ + if (argc >= 2 && !strcmp(argv[1], "-k")) { + int ret; + + /* Kill daemon with SIGTERM */ + + /* Check if the new function daemon_pid_file_kill_wait() is available, if it is, use it. */ + if ((ret = daemon_pid_file_kill_wait(SIGTERM, 5)) < 0) + daemon_log(LOG_WARNING, "Failed to kill daemon: %s", strerror(errno)); + + return ret < 0 ? 1 : 0; + } + + /* Check that the daemon is not rung twice a the same time */ + if ((pid = daemon_pid_file_is_running()) >= 0) { + daemon_log(LOG_ERR, "Daemon already running on PID file %u", pid); + return 1; + } + + /* Prepare for return value passing from the initialization procedure of the daemon process */ + if (daemon_retval_init() < 0) { + daemon_log(LOG_ERR, "Failed to create pipe."); + return 1; + } + + /* Do the fork */ + if ((pid = daemon_fork()) < 0) { + + /* Exit on error */ + daemon_retval_done(); + return 1; + + } else if (pid) { /* The parent */ + int ret; + + /* Wait for 20 seconds for the return value passed from the daemon process */ + if ((ret = daemon_retval_wait(20)) < 0) { + daemon_log(LOG_ERR, "Could not recieve return value from daemon process: %s", strerror(errno)); + return 255; + } + + daemon_log(ret != 0 ? LOG_ERR : LOG_INFO, "Daemon returned %i as return value.", ret); + return ret; + + } else { /* The daemon */ + int fd, quit = 0; + fd_set fds; + + /* Close FDs */ + if (daemon_close_all(-1) < 0) { + daemon_log(LOG_ERR, "Failed to close all file descriptors: %s", strerror(errno)); + + /* Send the error condition to the parent process */ + daemon_retval_send(1); + goto finish; + } + + /* Create the PID file */ + if (daemon_pid_file_create() < 0) { + daemon_log(LOG_ERR, "Could not create PID file (%s).", strerror(errno)); + daemon_retval_send(2); + goto finish; + } + + /* Initialize signal handling */ + if (daemon_signal_init(SIGINT, SIGTERM, SIGQUIT, SIGHUP, 0) < 0) { + daemon_log(LOG_ERR, "Could not register signal handlers (%s).", strerror(errno)); + daemon_retval_send(3); + goto finish; + } + + /*... do some further init work here */ + + + /* Send OK to parent process */ + daemon_retval_send(0); + + daemon_log(LOG_INFO, "Sucessfully started"); + + /* Prepare for select() on the signal fd */ + FD_ZERO(&fds); + fd = daemon_signal_fd(); + FD_SET(fd, &fds); + + while (!quit) { + fd_set fds2 = fds; + + /* Wait for an incoming signal */ + if (select(FD_SETSIZE, &fds2, 0, 0, 0) < 0) { + + /* If we've been interrupted by an incoming signal, continue */ + if (errno == EINTR) + continue; + + daemon_log(LOG_ERR, "select(): %s", strerror(errno)); + break; + } + + /* Check if a signal has been recieved */ + if (FD_ISSET(fd, &fds2)) { + int sig; + + /* Get signal */ + if ((sig = daemon_signal_next()) <= 0) { + daemon_log(LOG_ERR, "daemon_signal_next() failed: %s", strerror(errno)); + break; + } + + /* Dispatch signal */ + switch (sig) { + + case SIGINT: + case SIGQUIT: + case SIGTERM: + daemon_log(LOG_WARNING, "Got SIGINT, SIGQUIT or SIGTERM."); + quit = 1; + break; + + case SIGHUP: + daemon_log(LOG_INFO, "Got a HUP"); + daemon_exec("/", NULL, "/bin/ls", "ls", (char*) NULL); + break; + + } + } + } + + /* Do a cleanup */ +finish: + daemon_log(LOG_INFO, "Exiting..."); + daemon_retval_send(255); + daemon_signal_done(); + daemon_pid_file_remove(); + + return 0; + } +} diff --git a/recipes/libdaemon/all/test_v1_package/CMakeLists.txt b/recipes/libdaemon/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libdaemon/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libdaemon/all/test_v1_package/conanfile.py b/recipes/libdaemon/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..93fc246e84e20 --- /dev/null +++ b/recipes/libdaemon/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + self.run(f"{bin_path} -k", run_environment=True) diff --git a/recipes/libdaemon/config.yml b/recipes/libdaemon/config.yml new file mode 100644 index 0000000000000..b4e28d5df14d5 --- /dev/null +++ b/recipes/libdaemon/config.yml @@ -0,0 +1,3 @@ +versions: + "0.14": + folder: all diff --git a/recipes/libdb/all/conandata.yml b/recipes/libdb/all/conandata.yml new file mode 100644 index 0000000000000..0707d6df726bf --- /dev/null +++ b/recipes/libdb/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "5.3.28": + url: "https://download.oracle.com/berkeley-db/db-5.3.28.tar.gz" + sha256: "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628" +patches: + "5.3.28": + - patch_file: "patches/0001-rename_atomic_compare_exchange.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-no-conditional-tcl-include.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-msvc-db_tcl-add-static-configuration.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-msvc-tcl-include-conanbuildinfo-props.patch" + base_path: "source_subfolder" diff --git a/recipes/libdb/all/conanfile.py b/recipes/libdb/all/conanfile.py new file mode 100644 index 0000000000000..2500bfb57361a --- /dev/null +++ b/recipes/libdb/all/conanfile.py @@ -0,0 +1,272 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, rename, rm, rmdir +from conan.tools.microsoft import is_msvc, check_min_vs, unix_path +from conan.tools.scm import Version +# FIXME: Needs to be migrted to Conan v2 +from conans import AutoToolsBuildEnvironment, MSBuild +from conans import tools as legacy_tools + +import glob +import os + +required_conan_version = ">=1.55.0" + + +class LibdbConan(ConanFile): + name = "libdb" + description = "Berkeley DB is a family of embedded key-value database libraries providing scalable high-performance data management services to applications" + topics = ("gdbm", "dbm", "hash", "database") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.oracle.com/database/berkeley-db" + license = ("BSD-3-Clause") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tcl": [True, False], + "with_cxx": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tcl": False, + "with_cxx": False, + } + + generators = "visual_studio" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _mingw_build(self): + return self.settings.compiler == "gcc" and self.settings.os == "Windows" + + @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): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.compiler == "Visual Studio": + del self.options.with_cxx + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.get_safe("with_cxx", False): + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") + + def requirements(self): + if self.options.with_tcl: + self.requires("tcl/8.6.10") + + def validate(self): + if is_msvc(self) and check_min_vs(self, "191", raise_invalid=False): + # FIXME: it used to work with previous versions of Visual Studio 2019 in CI of CCI. + raise ConanInvalidConfiguration(f"{self.ref} Visual Studio 2019 is currently not supported. Contributions are welcomed!") + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration(f"{self.ref} Macos Apple Sillicon is currently not supported. Contributions are welcomed!") + + if self.options.get_safe("with_cxx"): + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration(f"{self.ref} does no support clang<6 with_cxx=True") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration(f"{self.ref} does no support apple-clang<10 with_cxx=True") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + if is_msvc(self): + for subdir in [ + "dist", + os.path.join("lang", "sql", "jdbc"), + os.path.join("lang", "sql", "odbc"), + os.path.join("lang", "sql", "sqlite"), + ]: + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=os.path.join(self._source_subfolder, subdir)) + + for file in glob.glob(os.path.join(self._source_subfolder, "build_windows", "VS10", "*.vcxproj")): + replace_in_file(self, file, + "", + "10.0.17763.0") + + dist_configure = os.path.join(self._source_subfolder, "dist", "configure") + replace_in_file(self, dist_configure, "../$sqlite_dir", "$sqlite_dir") + replace_in_file(self, dist_configure, + "\n --disable-option-checking)", + "\n --datarootdir=*)" + "\n ;;" + "\n --disable-option-checking)") + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=legacy_tools.os_info.is_windows) + if self.settings.compiler in ["apple-clang", "clang"] and Version(self.settings.compiler.version) >= "12": + self._autotools.flags.append("-Wno-error=implicit-function-declaration") + conf_args = [ + "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", + "--enable-mingw" if self._mingw_build else "--disable-mingw", + "--enable-compat185", + "--enable-sql", + ] + if self.options.with_cxx: + conf_args.extend(["--enable-cxx", "--enable-stl"]) + else: + conf_args.extend(["--disable-cxx", "--disable-stl"]) + + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + if self.options.with_tcl: + conf_args.append("--with-tcl={}".format(unix_path(self, os.path.join(self.deps_cpp_info["tcl"].rootpath, "lib")))) + self._autotools.configure(configure_dir=os.path.join(self.source_folder, self._source_subfolder, "dist"), args=conf_args) + if self.settings.os == "Windows" and self.options.shared: + replace_in_file(self, os.path.join(self.build_folder, "libtool"), + "\ndeplibs_check_method=", + "\ndeplibs_check_method=pass_all\n#deplibs_check_method=") + replace_in_file(self, os.path.join(self.build_folder, "Makefile"), + ".a", + ".dll.a") + return self._autotools + + @property + def _msvc_build_type(self): + return ("" if self.options.shared else "Static ") + ("Debug" if self.settings.build_type == "Debug" else "Release") + + _msvc_platforms = { + "x86": "win32", + "x86_64": "x64", + } + + @property + def _msvc_arch(self): + return self._msvc_platforms[str(self.settings.arch)] + + def _build_msvc(self): + projects = ["db", "db_sql", "db_stl"] + if self.options.with_tcl: + projects.append("db_tcl") + msbuild = MSBuild(self) + upgraded = False + for project in projects: + msbuild.build(os.path.join(self._source_subfolder, "build_windows", "VS10", "{}.vcxproj".format(project)), + build_type=self._msvc_build_type, platforms=self._msvc_platforms, + upgrade_project=not upgraded) + upgraded = True + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_msvc() + else: + autotools = self._configure_autotools() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + bindir = os.path.join(self.package_folder, "bin") + libdir = os.path.join(self.package_folder, "lib") + if is_msvc(self): + build_windows = os.path.join(self._source_subfolder, "build_windows") + build_dir = os.path.join(self._source_subfolder, "build_windows", self._msvc_arch, self._msvc_build_type) + copy(self, "*.lib", src=build_dir, dst=libdir) + copy(self, "*.dll", src=build_dir, dst=bindir) + for fn in ("db.h", "db.cxx", "db_int.h", "dbstl_common.h"): + copy(self, fn, src=build_windows, dst=os.path.join(self.package_folder, "include")) + + def _lib_to_msvc_lib(lib): + shared_suffix = "" if self.options.shared else "s" + debug_suffix = "d" if self.settings.build_type == "Debug" else "" + version_suffix = "".join(self._major_minor_version) + return "{}{}{}{}".format(lib, version_suffix, shared_suffix, debug_suffix) + + msvc_libs = [_lib_to_msvc_lib(lib) for lib in self._libs] + for lib, msvc_lib in zip(self._libs, msvc_libs): + rename(self, os.path.join(libdir, "{}.lib".format(msvc_lib)), + os.path.join(libdir, "{}.lib".format(lib))) + else: + autotools = self._configure_autotools() + autotools.install() + + if self.settings.os == "Windows": + for fn in os.listdir(libdir): + if fn.endswith(".dll"): + rename(self, os.path.join(libdir, fn), os.path.join(bindir, fn)) + for fn in os.listdir(bindir): + if not fn.endswith(".dll"): + binpath = os.path.join(bindir, fn) + os.chmod(binpath, 0o755) # Fixes PermissionError(errno.EACCES) on mingw + os.remove(binpath) + if self.options.shared: + dlls = ["lib{}-{}.dll".format(lib, ".".join(self._major_minor_version)) for lib in self._libs] + for fn in os.listdir(bindir): + if fn not in dlls: + print("removing", fn, "in bin") + os.remove(os.path.join(bindir, fn)) + + if not os.listdir(bindir): + rmdir(self, bindir) + + rmdir(self, os.path.join(self.package_folder, "docs")) + rm(self, "*.la", libdir) + if not self.options.shared: + # autotools installs the static libraries twice as libXXX.a and libXXX-5.3.a ==> remove libXXX-5.3.a + rm(self, "*-{}.a".format(".".join(self._major_minor_version)), libdir) + + @property + def _major_minor_version(self): + [major, minor, _] = self.version.split(".", 2) + return major, minor + + @property + def _libs(self): + libs = [] + if self.options.with_tcl: + libs.append("db_tcl") + if self.options.get_safe("with_cxx"): + libs.extend(["db_cxx", "db_stl"]) + libs.extend(["db_sql", "db"]) + if self.settings.compiler == "Visual Studio": + libs = ["lib{}".format(lib) for lib in libs] + return libs + + def package_info(self): + self.cpp_info.libs = self._libs + if is_msvc(self) and self.options.shared: + self.cpp_info.defines = ["DB_USE_DLL"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "pthread"]) + elif self.settings.os == "Windows" : + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libdb/all/patches/0001-rename_atomic_compare_exchange.patch b/recipes/libdb/all/patches/0001-rename_atomic_compare_exchange.patch new file mode 100644 index 0000000000000..5ebd64ef4afe1 --- /dev/null +++ b/recipes/libdb/all/patches/0001-rename_atomic_compare_exchange.patch @@ -0,0 +1,20 @@ +--- src/dbinc/atomic.h ++++ src/dbinc/atomic.h +@@ -144,7 +144,7 @@ + #define atomic_inc(env, p) __atomic_inc(p) + #define atomic_dec(env, p) __atomic_dec(p) + #define atomic_compare_exchange(env, p, o, n) \ +- __atomic_compare_exchange((p), (o), (n)) ++ __atomic_compare_exchange_db((p), (o), (n)) + static inline int __atomic_inc(db_atomic_t *p) + { + int temp; +@@ -176,7 +176,7 @@ + * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html + * which configure could be changed to use. + */ +-static inline int __atomic_compare_exchange( ++static inline int __atomic_compare_exchange_db( + db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) + { + atomic_value_t was; diff --git a/recipes/libdb/all/patches/0002-no-conditional-tcl-include.patch b/recipes/libdb/all/patches/0002-no-conditional-tcl-include.patch new file mode 100644 index 0000000000000..92664f41a420b --- /dev/null +++ b/recipes/libdb/all/patches/0002-no-conditional-tcl-include.patch @@ -0,0 +1,197 @@ +This is required on Windows mingw. +--- lang/tcl/tcl_compat.c ++++ lang/tcl/tcl_compat.c +@@ -10,9 +10,9 @@ + #ifdef CONFIG_TEST + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + /* +--- lang/tcl/tcl_db.c ++++ lang/tcl/tcl_db.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/db_page.h" + #include "dbinc/db_am.h" + #include "dbinc/tcl_db.h" +--- lang/tcl/tcl_db_pkg.c ++++ lang/tcl/tcl_db_pkg.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/db_page.h" + #include "dbinc/hash.h" + #include "dbinc/tcl_db.h" +--- lang/tcl/tcl_dbcursor.c ++++ lang/tcl/tcl_dbcursor.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + /* +--- lang/tcl/tcl_env.c ++++ lang/tcl/tcl_env.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/lock.h" + #include "dbinc/txn.h" + #include "dbinc/tcl_db.h" +--- lang/tcl/tcl_internal.c ++++ lang/tcl/tcl_internal.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + #include "dbinc/db_page.h" + #include "dbinc/db_am.h" +--- lang/tcl/tcl_lock.c ++++ lang/tcl/tcl_lock.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + /* +--- lang/tcl/tcl_log.c ++++ lang/tcl/tcl_log.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/log.h" + #include "dbinc/tcl_db.h" + +--- lang/tcl/tcl_mp.c ++++ lang/tcl/tcl_mp.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + /* +--- lang/tcl/tcl_mutex.c ++++ lang/tcl/tcl_mutex.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + #ifdef CONFIG_TEST +--- lang/tcl/tcl_rep.c ++++ lang/tcl/tcl_rep.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + #ifdef CONFIG_TEST +--- lang/tcl/tcl_seq.c ++++ lang/tcl/tcl_seq.c +@@ -10,9 +10,9 @@ + #ifdef HAVE_64BIT_TYPES + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + #include "dbinc_auto/sequence_ext.h" + +--- lang/tcl/tcl_txn.c ++++ lang/tcl/tcl_txn.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + static int tcl_TxnCommit __P((Tcl_Interp *, +--- lang/tcl/tcl_util.c ++++ lang/tcl/tcl_util.c +@@ -9,9 +9,9 @@ + #include "db_config.h" + + #include "db_int.h" +-#ifdef HAVE_SYSTEM_INCLUDE_FILES ++//#ifdef HAVE_SYSTEM_INCLUDE_FILES + #include +-#endif ++//#endif + #include "dbinc/tcl_db.h" + + /* diff --git a/recipes/libdb/all/patches/0003-msvc-db_tcl-add-static-configuration.patch b/recipes/libdb/all/patches/0003-msvc-db_tcl-add-static-configuration.patch new file mode 100644 index 0000000000000..84995a1f2edaa --- /dev/null +++ b/recipes/libdb/all/patches/0003-msvc-db_tcl-add-static-configuration.patch @@ -0,0 +1,169 @@ +--- build_windows/Berkeley_DB_vs2010.sln ++++ build_windows/Berkeley_DB_vs2010.sln +@@ -308,14 +308,22 @@ + {19D3A4CB-1C12-43D4-A94B-D2B387AD43E5}.Static Debug|x64.ActiveCfg = Debug|x64 + {19D3A4CB-1C12-43D4-A94B-D2B387AD43E5}.Static Release|Win32.ActiveCfg = Release|Win32 + {19D3A4CB-1C12-43D4-A94B-D2B387AD43E5}.Static Release|x64.ActiveCfg = Release|x64 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Debug|Win32.ActiveCfg = Debug|Win32 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Debug|x64.ActiveCfg = Debug|x64 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Release|Win32.ActiveCfg = Release|Win32 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Release|x64.ActiveCfg = Release|x64 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Debug|Win32.ActiveCfg = Debug|Win32 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Debug|x64.ActiveCfg = Debug|x64 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Release|Win32.ActiveCfg = Release|Win32 +- {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Release|x64.ActiveCfg = Release|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Debug|Win32.ActiveCfg = Debug|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Debug|Win32.Build.0 = Debug|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Debug|x64.ActiveCfg = Debug|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Debug|x64.Build.0 = Debug|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Release|Win32.ActiveCfg = Release|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Release|Win32.Build.0 = Release|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Release|x64.ActiveCfg = Release|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Release|x64.Build.0 = Release|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Debug|Win32.ActiveCfg = Static Debug|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Debug|Win32.Build.0 = Static Debug|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Debug|x64.ActiveCfg = Static Debug|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Debug|x64.Build.0 = Static Debug|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Release|Win32.ActiveCfg = Static Release|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Release|Win32.Build.0 = Static Release|Win32 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Release|x64.ActiveCfg = Static Release|x64 ++ {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1}.Static Release|x64.Build.0 = Static Release|x64 + {B17B933F-6F75-4095-BE51-12666358163A}.Debug|Win32.ActiveCfg = Debug|Win32 + {B17B933F-6F75-4095-BE51-12666358163A}.Debug|x64.ActiveCfg = Debug|x64 + {B17B933F-6F75-4095-BE51-12666358163A}.Release|Win32.ActiveCfg = Release|Win32 +--- build_windows/VS10/db_tcl.vcxproj ++++ build_windows/VS10/db_tcl.vcxproj +@@ -9,6 +9,14 @@ + Debug + x64 + ++ ++ Static Debug ++ Win32 ++ ++ ++ Static Debug ++ x64 ++ + + Release + Win32 +@@ -17,6 +25,14 @@ + Release + x64 + ++ ++ Static Release ++ Win32 ++ ++ ++ Static Release ++ x64 ++ + + + {7F3D3EEE-2ABB-4F0F-A2A7-DE88C1989BE1} +@@ -27,21 +43,41 @@ + false + MultiByte + ++ ++ StaticLibrary ++ false ++ MultiByte ++ + + DynamicLibrary + false + MultiByte + ++ ++ StaticLibrary ++ false ++ MultiByte ++ + + DynamicLibrary + false + MultiByte + ++ ++ StaticLibrary ++ false ++ MultiByte ++ + + DynamicLibrary + false + MultiByte + ++ ++ StaticLibrary ++ false ++ MultiByte ++ + + + +@@ -60,37 +98,57 @@ + DB_CREATE_DLL;_UNICODE;DB_TCL_SUPPORT;CONFIG_TEST;%(PreprocessorDefinitions) + + +- libdb53d.lib;tcl85g.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + ..\..\build_windows\libdb_tcl.def + + ++ ++ ++ _UNICODE;DB_TCL_SUPPORT;CONFIG_TEST;%(PreprocessorDefinitions) ++ ++ + + + DB_CREATE_DLL;_UNICODE;DB_TCL_SUPPORT;%(PreprocessorDefinitions) + + +- libdb53.lib;tcl85.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + ..\..\build_windows\libdb_tcl.def + + ++ ++ ++ _UNICODE;DB_TCL_SUPPORT;%(PreprocessorDefinitions) ++ ++ + + + DB_CREATE_DLL;_UNICODE;DB_TCL_SUPPORT;CONFIG_TEST;%(PreprocessorDefinitions) + + +- libdb53d.lib;tcl85g.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + ..\..\build_windows\libdb_tcl.def + + ++ ++ ++ _UNICODE;DB_TCL_SUPPORT;CONFIG_TEST;%(PreprocessorDefinitions) ++ ++ + + + DB_CREATE_DLL;_UNICODE;DB_TCL_SUPPORT;%(PreprocessorDefinitions) + + +- libdb53.lib;tcl85.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + ..\..\build_windows\libdb_tcl.def + + ++ ++ ++ DB_CREATE_DLL;_UNICODE;DB_TCL_SUPPORT;%(PreprocessorDefinitions) ++ ++ + + + diff --git a/recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch b/recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch new file mode 100644 index 0000000000000..742431d50ece2 --- /dev/null +++ b/recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch @@ -0,0 +1,9 @@ +--- build_windows/VS10/db_tcl.vcxproj ++++ build_windows/VS10/db_tcl.vcxproj +@@ -1,5 +2,5 @@ + +- ++ + + + Debug diff --git a/recipes/libdb/all/test_package/CMakeLists.txt b/recipes/libdb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libdb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libdb/all/test_package/conanfile.py b/recipes/libdb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d919133e5c230 --- /dev/null +++ b/recipes/libdb/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/libdb/all/test_package/test_package.c b/recipes/libdb/all/test_package/test_package.c new file mode 100644 index 0000000000000..d94592e5c75f1 --- /dev/null +++ b/recipes/libdb/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include + +#include +#include + +int main(int argc, char *argv[]) { + DB *dbp; + int res; + res = db_create(&dbp, NULL, 0); + if (res != 0) { + puts("db_create failed\n"); + return EXIT_FAILURE; + } + + res = dbp->close(dbp, 0); + if (res != 0) { + puts("DP->close failed\n"); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/libdb/config.yml b/recipes/libdb/config.yml new file mode 100644 index 0000000000000..a8f0d67560aca --- /dev/null +++ b/recipes/libdb/config.yml @@ -0,0 +1,3 @@ +versions: + "5.3.28": + folder: all diff --git a/recipes/libdc1394/all/conandata.yml b/recipes/libdc1394/all/conandata.yml new file mode 100644 index 0000000000000..f12a9d3794e20 --- /dev/null +++ b/recipes/libdc1394/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.6": + url: "https://sourceforge.net/projects/libdc1394/files/libdc1394-2/2.2.6/libdc1394-2.2.6.tar.gz" + sha256: "2b905fc9aa4eec6bdcf6a2ae5f5ba021232739f5be047dec8fe8dd6049c10fed" diff --git a/recipes/libdc1394/all/conanfile.py b/recipes/libdc1394/all/conanfile.py new file mode 100644 index 0000000000000..f52cb3b808339 --- /dev/null +++ b/recipes/libdc1394/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class Libdc1394Conan(ConanFile): + name = "libdc1394" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://damien.douxchamps.net/ieee1394/libdc1394/" + description = "libdc1394 provides a complete high level API to control IEEE 1394 based cameras" + topics = ("ieee1394", "camera", "iidc", "dcam") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libusb/1.0.26") + + def validate(self): + if self.info.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported yet in this recipe") + if self.info.settings.compiler == "clang": + raise ConanInvalidConfiguration("Clang doesn't support VLA") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-examples") + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + + def build(self): + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", f"libdc1394-{Version(self.version).major}") + self.cpp_info.libs = ["dc1394"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreServices", "IOKit"]) diff --git a/recipes/libdc1394/all/test_package/CMakeLists.txt b/recipes/libdc1394/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..97fa5a2906309 --- /dev/null +++ b/recipes/libdc1394/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libdc1394 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdc1394::libdc1394) diff --git a/recipes/libdc1394/all/test_package/conanfile.py b/recipes/libdc1394/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libdc1394/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/libdc1394/all/test_package/test_package.c b/recipes/libdc1394/all/test_package/test_package.c new file mode 100644 index 0000000000000..2c287d6db1fe6 --- /dev/null +++ b/recipes/libdc1394/all/test_package/test_package.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include + +int main() +{ + dc1394_t *dc1394 = NULL; + dc1394error_t error; + dc1394camera_list_t *cameras = NULL; + + dc1394 = dc1394_new(); + if (!dc1394) + { + fprintf(stderr, "cannot create dc1394!\n"); + fprintf(stderr, "This is a test package, so ignore!\n"); + return EXIT_SUCCESS; + } + error = dc1394_camera_enumerate(dc1394, &cameras); + if ((error > 0) || (error <= -DC1394_ERROR_NUM)) + { + fprintf(stderr, "failed to enumerate cameras!\n"); + dc1394_free(dc1394); + fprintf(stderr, "This is a test package, so ignore! (better luck next time)\n"); + return EXIT_SUCCESS; + } + if (cameras->num == 0) + { + fprintf(stderr, "no cameras were found!\n"); + } + else + { + int i = 0; + for (i = 0; i < cameras->num; ++i) + { + dc1394camera_t *camera = NULL; + camera = dc1394_camera_new(dc1394, cameras->ids[i].guid); + if (!camera) + { + fprintf(stderr, "failed to initialize camera %d\n", i); + } + else + { + printf("camera %s vendor %s\n", camera->model, camera->vendor); + dc1394_camera_free(camera); + } + } + } + dc1394_camera_free_list(cameras); + dc1394_free(dc1394); + return EXIT_SUCCESS; +} diff --git a/recipes/libdc1394/all/test_v1_package/CMakeLists.txt b/recipes/libdc1394/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libdc1394/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libdc1394/all/test_v1_package/conanfile.py b/recipes/libdc1394/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libdc1394/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/libdc1394/config.yml b/recipes/libdc1394/config.yml new file mode 100644 index 0000000000000..02d886e69e974 --- /dev/null +++ b/recipes/libdc1394/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.6": + folder: all diff --git a/recipes/libde265/all/conandata.yml b/recipes/libde265/all/conandata.yml new file mode 100644 index 0000000000000..1536fa75197a7 --- /dev/null +++ b/recipes/libde265/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.0.11": + url: "https://github.com/strukturag/libde265/releases/download/v1.0.11/libde265-1.0.11.tar.gz" + sha256: "2f8f12cabbdb15e53532b7c1eb964d4e15d444db1be802505e6ac97a25035bab" + "1.0.9": + url: "https://github.com/strukturag/libde265/releases/download/v1.0.9/libde265-1.0.9.tar.gz" + sha256: "29bc6b64bf658d81a4446a3f98e0e4636fd4fd3d971b072d440cef987d5439de" + "1.0.8": + url: "https://github.com/strukturag/libde265/releases/download/v1.0.8/libde265-1.0.8.tar.gz" + sha256: "24c791dd334fa521762320ff54f0febfd3c09fc978880a8c5fbc40a88f21d905" +patches: + "1.0.9": + - patch_file: "patches/0002-fix-out-of-source-build.patch" + "1.0.8": + - patch_file: "patches/0001-optional-sdl.patch" + - patch_file: "patches/0002-fix-out-of-source-build.patch" diff --git a/recipes/libde265/all/conanfile.py b/recipes/libde265/all/conanfile.py new file mode 100644 index 0000000000000..286e6952e05dc --- /dev/null +++ b/recipes/libde265/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class Libde265Conan(ConanFile): + name = "libde265" + description = "Open h.265 video codec implementation." + license = "LGPL-3.0-or-later" + topics = ("codec", "video", "h.265") + homepage = "https://github.com/strukturag/libde265" + 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], + "sse": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "sse": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.sse + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.variables["ENABLE_SDL"] = False + tc.variables["DISABLE_SSE"] = not self.options.get_safe("sse", False) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "de265": "libde265::libde265", + "libde265": "libde265::libde265", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libde265") + self.cpp_info.set_property("cmake_target_name", "de265") + self.cpp_info.set_property("cmake_target_aliases", ["libde265"]) # official imported target before 1.0.10 + self.cpp_info.set_property("pkg_config_name", "libde265") + prefix = "lib" if Version(self.version) < "1.0.10" else "" + self.cpp_info.libs = [f"{prefix}de265"] + if not self.options.shared: + self.cpp_info.defines = ["LIBDE265_STATIC_BUILD"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libde265/all/patches/0001-optional-sdl.patch b/recipes/libde265/all/patches/0001-optional-sdl.patch new file mode 100644 index 0000000000000..f6878ac98a294 --- /dev/null +++ b/recipes/libde265/all/patches/0001-optional-sdl.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,10 @@ include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) + include(GNUInstallDirs) + include(CheckFunctionExists) + ++option(ENABLE_SDL "Enable SDL" ON) ++if(ENABLE_SDL) + find_package(SDL) ++endif() + find_package(Threads REQUIRED) + + CHECK_INCLUDE_FILE(malloc.h HAVE_MALLOC_H) diff --git a/recipes/libde265/all/patches/0002-fix-out-of-source-build.patch b/recipes/libde265/all/patches/0002-fix-out-of-source-build.patch new file mode 100644 index 0000000000000..80209c09038f2 --- /dev/null +++ b/recipes/libde265/all/patches/0002-fix-out-of-source-build.patch @@ -0,0 +1,10 @@ +--- a/libde265/CMakeLists.txt ++++ b/libde265/CMakeLists.txt +@@ -43,7 +43,6 @@ set (libde265_headers + bitstream.h + cabac.h + configparam.h +- de265-version.h + contextmodel.h + de265.h + deblock.h diff --git a/recipes/libde265/all/test_package/CMakeLists.txt b/recipes/libde265/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..51ad6d4f5df34 --- /dev/null +++ b/recipes/libde265/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libde265 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libde265) diff --git a/recipes/libde265/all/test_package/conanfile.py b/recipes/libde265/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libde265/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/libde265/all/test_package/test_package.c b/recipes/libde265/all/test_package/test_package.c new file mode 100644 index 0000000000000..52a628aec3017 --- /dev/null +++ b/recipes/libde265/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() { + de265_decoder_context *ctx = de265_new_decoder(); + de265_free_decoder(ctx); + return 0; +} diff --git a/recipes/libde265/all/test_v1_package/CMakeLists.txt b/recipes/libde265/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libde265/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libde265/all/test_v1_package/conanfile.py b/recipes/libde265/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libde265/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/libde265/config.yml b/recipes/libde265/config.yml new file mode 100644 index 0000000000000..d32ffee4c65d8 --- /dev/null +++ b/recipes/libde265/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.11": + folder: all + "1.0.9": + folder: all + "1.0.8": + folder: all diff --git a/recipes/libdeflate/all/conandata.yml b/recipes/libdeflate/all/conandata.yml new file mode 100644 index 0000000000000..01ec059a63c20 --- /dev/null +++ b/recipes/libdeflate/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.18": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz" + sha256: "225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd" + "1.17": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.17.tar.gz" + sha256: "fa4615af671513fa2a53dc2e7a89ff502792e2bdfc046869ef35160fcc373763" + "1.15": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.15.tar.gz" + sha256: "58b95040df7383dc0413defb700d9893c194732474283cc4c8f144b00a68154b" diff --git a/recipes/libdeflate/all/conanfile.py b/recipes/libdeflate/all/conanfile.py new file mode 100644 index 0000000000000..b72d35d422049 --- /dev/null +++ b/recipes/libdeflate/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibdeflateConan(ConanFile): + name = "libdeflate" + description = "Heavily optimized library for DEFLATE/zlib/gzip compression and decompression." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ebiggers/libdeflate" + topics = ("compression", "decompression", "deflate", "zlib", "gzip") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBDEFLATE_BUILD_STATIC_LIB"] = not self.options.shared + tc.variables["LIBDEFLATE_BUILD_SHARED_LIB"] = self.options.shared + tc.variables["LIBDEFLATE_BUILD_GZIP"] = False + tc.variables["LIBDEFLATE_BUILD_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libdeflate") + target_suffix = "_shared" if self.options.shared else "_static" + self.cpp_info.set_property("cmake_target_name", f"libdeflate::libdeflate{target_suffix}") + self.cpp_info.set_property("cmake_target_aliases", ["libdeflate::libdeflate"]) # not official, avoid to break users + self.cpp_info.set_property("pkg_config_name", "libdeflate") + # TODO: back to global scope in conan v2 + self.cpp_info.components["_libdeflate"].libs = collect_libs(self) + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_libdeflate"].defines.append("LIBDEFLATE_DLL") + + # TODO: to remove in conan v2 + self.cpp_info.components["_libdeflate"].names["cmake_find_package"] = f"libdeflate{target_suffix}" + self.cpp_info.components["_libdeflate"].names["cmake_find_package_multi"] = f"libdeflate{target_suffix}" + self.cpp_info.components["_libdeflate"].set_property("cmake_target_name", f"libdeflate::libdeflate{target_suffix}") + self.cpp_info.components["_libdeflate"].set_property("pkg_config_name", "libdeflate") diff --git a/recipes/libdeflate/all/test_package/CMakeLists.txt b/recipes/libdeflate/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba0dfeb9e192f --- /dev/null +++ b/recipes/libdeflate/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libdeflate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET libdeflate::libdeflate_static) + target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate_shared) +endif() diff --git a/recipes/libdeflate/all/test_package/conanfile.py b/recipes/libdeflate/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libdeflate/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdeflate/all/test_package/test_package.c b/recipes/libdeflate/all/test_package/test_package.c new file mode 100644 index 0000000000000..9fe99b840f34d --- /dev/null +++ b/recipes/libdeflate/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main () { + struct libdeflate_compressor *c; + c = libdeflate_alloc_compressor(12); + libdeflate_free_compressor(c); + return 0; +} diff --git a/recipes/libdeflate/all/test_v1_package/CMakeLists.txt b/recipes/libdeflate/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libdeflate/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdeflate/all/test_v1_package/conanfile.py b/recipes/libdeflate/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libdeflate/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/libdeflate/config.yml b/recipes/libdeflate/config.yml new file mode 100644 index 0000000000000..2ecdca807a8d6 --- /dev/null +++ b/recipes/libdeflate/config.yml @@ -0,0 +1,19 @@ +versions: + "1.18": + folder: "all" + "1.17": + folder: "all" + "1.15": + folder: "all" + "1.14": + folder: "pre_1.15" + "1.12": + folder: "pre_1.15" + "1.10": + folder: "pre_1.15" + "1.9": + folder: "pre_1.15" + "1.8": + folder: "pre_1.15" + "1.7": + folder: "pre_1.15" diff --git a/recipes/libdeflate/pre_1.15/conandata.yml b/recipes/libdeflate/pre_1.15/conandata.yml new file mode 100644 index 0000000000000..a438f626651c7 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/conandata.yml @@ -0,0 +1,44 @@ +sources: + "1.14": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.14.tar.gz" + sha256: "89e7df898c37c3427b0f39aadcf733731321a278771d20fc553f92da8d4808ac" + "1.12": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.12.tar.gz" + sha256: "ba89fb167a5ab6bbdfa6ee3b1a71636e8140fa8471cce8a311697584948e4d06" + "1.10": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.10.tar.gz" + sha256: "5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533" + "1.9": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.9.tar.gz" + sha256: "a537ab6125c226b874c02b166488b326aece954930260dbf682d88fc339137e3" + "1.8": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.8.tar.gz" + sha256: "50711ad4e9d3862f8dfb11b97eb53631a86ee3ce49c0e68ec2b6d059a9662f61" + "1.7": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.7.tar.gz" + sha256: "a5e6a0a9ab69f40f0f59332106532ca76918977a974e7004977a9498e3f11350" +patches: + "1.14": + - patch_file: "patches/1.14-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.12": + - patch_file: "patches/1.12-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.10": + - patch_file: "patches/1.9-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.9": + - patch_file: "patches/1.9-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.8": + - patch_file: "patches/1.7-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.7": + - patch_file: "patches/1.7-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" diff --git a/recipes/libdeflate/pre_1.15/conanfile.py b/recipes/libdeflate/pre_1.15/conanfile.py new file mode 100644 index 0000000000000..02ec8db904133 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/conanfile.py @@ -0,0 +1,120 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path, NMakeToolchain +import os + +required_conan_version = ">=1.55.0" + + +class LibdeflateConan(ConanFile): + name = "libdeflate" + description = "Heavily optimized library for DEFLATE/zlib/gzip compression and decompression." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ebiggers/libdeflate" + topics = ("compression", "decompression", "deflate", "zlib", "gzip") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_clangcl(self): + return self.settings.compiler == "clang" and self.settings.os == "Windows" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not (is_msvc(self) or self._is_clangcl): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self) or self._is_clangcl: + tc = NMakeToolchain(self) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + + def _build_nmake(self): + with chdir(self, self.source_folder): + target = "libdeflate.dll" if self.options.shared else "libdeflatestatic.lib" + self.run(f"nmake /f Makefile.msc {target}") + + def _build_make(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self) or self._is_clangcl: + self._build_nmake() + else: + self._build_make() + + def _package_windows(self): + copy(self, "libdeflate.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + if self.options.shared: + copy(self, "*deflate.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder) + copy(self, "*deflate.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + else: + copy(self, "*deflatestatic.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder) + + def _package_make(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): + # Note: not actually an autotools project, is a Makefile project. + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}", "PREFIX=/"]) + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.a" if self.options.shared else "*.[so|dylib]*", os.path.join(self.package_folder, "lib") ) + + def package(self): + copy(self, "COPYING", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + self._package_windows() + else: + self._package_make() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libdeflate") + prefix = "lib" if self.settings.os == "Windows" else "" + suffix = "static" if self.settings.os == "Windows" and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}deflate{suffix}"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines = ["LIBDEFLATE_DLL"] diff --git a/recipes/libdeflate/pre_1.15/patches/1.12-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.12-0001-fix-makefiles.patch new file mode 100644 index 0000000000000..fec83886e9dc1 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/patches/1.12-0001-fix-makefiles.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index 9e55d0c..917b6db 100644 +--- a/Makefile ++++ b/Makefile +@@ -54,7 +54,7 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ + 1>&2 2>/dev/null; then echo $(1); fi) + + override CFLAGS := \ +- -O2 -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ ++ -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ + $(call cc-option,-Wpedantic) \ + $(call cc-option,-Wdeclaration-after-statement) \ + $(call cc-option,-Wmissing-prototypes) \ +@@ -124,7 +124,7 @@ else ifneq ($(findstring -darwin,$(TARGET_MACHINE)),) + SHARED_LIB := libdeflate.$(SOVERSION).dylib + SHARED_LIB_SYMLINK := libdeflate.dylib + SHARED_LIB_CFLAGS := -fPIC +- SHARED_LIB_LDFLAGS := -install_name $(LIBDIR)/$(SHARED_LIB) ++ SHARED_LIB_LDFLAGS := -install_name @rpath/$(SHARED_LIB) + + # Compiling for Android? + else ifneq ($(findstring -android,$(TARGET_MACHINE)),) +diff --git a/Makefile.msc b/Makefile.msc +index 1449618..a61c034 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -7,11 +7,10 @@ + + .SUFFIXES: .c .obj .dllobj + +-CC = cl ++CC = $(CC) + LD = link + AR = lib +-CFLAGS = /MD /O2 -I. +-LDFLAGS = ++CFLAGS = /nologo $(CFLAGS) -I. + + STATIC_LIB = libdeflatestatic.lib + SHARED_LIB = libdeflate.dll diff --git a/recipes/libdeflate/pre_1.15/patches/1.14-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.14-0001-fix-makefiles.patch new file mode 100644 index 0000000000000..6f2656728ddc6 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/patches/1.14-0001-fix-makefiles.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index a08c945..36876b5 100644 +--- a/Makefile ++++ b/Makefile +@@ -54,7 +54,7 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ + 1>&2 2>/dev/null; then echo $(1); fi) + + override CFLAGS := \ +- -O2 -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ ++ -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ + $(call cc-option,-Wdeclaration-after-statement) \ + $(call cc-option,-Wimplicit-fallthrough) \ + $(call cc-option,-Wmissing-prototypes) \ +@@ -120,7 +120,7 @@ else ifneq ($(findstring -darwin,$(TARGET_MACHINE)),) + SHARED_LIB := libdeflate.$(SOVERSION).dylib + SHARED_LIB_SYMLINK := libdeflate.dylib + SHARED_LIB_CFLAGS := -fPIC +- SHARED_LIB_LDFLAGS := -install_name $(LIBDIR)/$(SHARED_LIB) ++ SHARED_LIB_LDFLAGS := -install_name @rpath/$(SHARED_LIB) + + # Compiling for Android? + else ifneq ($(findstring -android,$(TARGET_MACHINE)),) +diff --git a/Makefile.msc b/Makefile.msc +index 1449618..a61c034 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -7,11 +7,10 @@ + + .SUFFIXES: .c .obj .dllobj + +-CC = cl ++CC = $(CC) + LD = link + AR = lib +-CFLAGS = /MD /O2 -I. +-LDFLAGS = ++CFLAGS = /nologo $(CFLAGS) -I. + + STATIC_LIB = libdeflatestatic.lib + SHARED_LIB = libdeflate.dll diff --git a/recipes/libdeflate/pre_1.15/patches/1.7-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.7-0001-fix-makefiles.patch new file mode 100644 index 0000000000000..b5b9679431bb2 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/patches/1.7-0001-fix-makefiles.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index 276d75d..641e726 100644 +--- a/Makefile ++++ b/Makefile +@@ -48,7 +48,7 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ + 1>&2 2>/dev/null; then echo $(1); fi) + + override CFLAGS := \ +- -O2 -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ ++ -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ + $(call cc-option,-Wpedantic) \ + $(call cc-option,-Wdeclaration-after-statement) \ + $(call cc-option,-Wmissing-prototypes) \ +@@ -111,7 +111,7 @@ else ifeq ($(shell uname),Darwin) + SHARED_LIB := libdeflate.$(SOVERSION).dylib + SHARED_LIB_SYMLINK := libdeflate.dylib + SHARED_LIB_CFLAGS := -fPIC +- SHARED_LIB_LDFLAGS := -install_name $(SHARED_LIB) ++ SHARED_LIB_LDFLAGS := -install_name @rpath/$(SHARED_LIB) + + # Linux, FreeBSD, etc. + else +diff --git a/Makefile.msc b/Makefile.msc +index 1449618..a61c034 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -7,11 +7,10 @@ + + .SUFFIXES: .c .obj .dllobj + +-CC = cl ++CC = $(CC) + LD = link + AR = lib +-CFLAGS = /MD /O2 -I. +-LDFLAGS = ++CFLAGS = /nologo $(CFLAGS) -I. + + STATIC_LIB = libdeflatestatic.lib + SHARED_LIB = libdeflate.dll diff --git a/recipes/libdeflate/pre_1.15/patches/1.9-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.9-0001-fix-makefiles.patch new file mode 100644 index 0000000000000..295b117c5c67f --- /dev/null +++ b/recipes/libdeflate/pre_1.15/patches/1.9-0001-fix-makefiles.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index 0e8b008..d184a4a 100644 +--- a/Makefile ++++ b/Makefile +@@ -54,7 +54,7 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ + 1>&2 2>/dev/null; then echo $(1); fi) + + override CFLAGS := \ +- -O2 -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ ++ -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ + $(call cc-option,-Wpedantic) \ + $(call cc-option,-Wdeclaration-after-statement) \ + $(call cc-option,-Wmissing-prototypes) \ +@@ -119,7 +119,7 @@ else ifneq ($(findstring -darwin,$(TARGET_MACHINE)),) + SHARED_LIB := libdeflate.$(SOVERSION).dylib + SHARED_LIB_SYMLINK := libdeflate.dylib + SHARED_LIB_CFLAGS := -fPIC +- SHARED_LIB_LDFLAGS := -install_name $(SHARED_LIB) ++ SHARED_LIB_LDFLAGS := -install_name @rpath/$(SHARED_LIB) + + # Compiling for Android? + else ifneq ($(findstring -android,$(TARGET_MACHINE)),) +diff --git a/Makefile.msc b/Makefile.msc +index 1449618..a61c034 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -7,11 +7,10 @@ + + .SUFFIXES: .c .obj .dllobj + +-CC = cl ++CC = $(CC) + LD = link + AR = lib +-CFLAGS = /MD /O2 -I. +-LDFLAGS = ++CFLAGS = /nologo $(CFLAGS) -I. + + STATIC_LIB = libdeflatestatic.lib + SHARED_LIB = libdeflate.dll diff --git a/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt b/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4fdc2b4814ab3 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(libdeflate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate) diff --git a/recipes/libdeflate/pre_1.15/test_package/conanfile.py b/recipes/libdeflate/pre_1.15/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdeflate/pre_1.15/test_package/test_package.c b/recipes/libdeflate/pre_1.15/test_package/test_package.c new file mode 100644 index 0000000000000..9fe99b840f34d --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main () { + struct libdeflate_compressor *c; + c = libdeflate_alloc_compressor(12); + libdeflate_free_compressor(c); + return 0; +} diff --git a/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt b/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py b/recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/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/libdisasm/all/conandata.yml b/recipes/libdisasm/all/conandata.yml new file mode 100644 index 0000000000000..971ffe003e8b2 --- /dev/null +++ b/recipes/libdisasm/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.23": + url: "http://downloads.sourceforge.net/project/bastard/libdisasm/0.23/libdisasm-0.23.tar.gz" + sha256: "de3e578aa582af6e1d7729f39626892fb72dc6573658a221e0905f42a65433da" +patches: + "0.23": + - patch_file: "patches/0001-fix-size-of-void.patch" + - patch_file: "patches/0002-only-build-libdisasm-by-default.patch" + - patch_file: "patches/0003-libdisasm-no-undefined.patch" diff --git a/recipes/libdisasm/all/conanfile.py b/recipes/libdisasm/all/conanfile.py new file mode 100644 index 0000000000000..59fcdff727fe9 --- /dev/null +++ b/recipes/libdisasm/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class LibdisasmConan(ConanFile): + name = "libdisasm" + description = "The libdisasm library provides basic disassembly of Intel x86 instructions from a binary stream." + homepage = "http://bastard.sourceforge.net/libdisasm.html" + url = "https://github.com/conan-io/conan-center-index" + topics = ("disassembler", "x86", "asm") + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + automake_conf = self.dependencies.build["automake"].conf_info + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("CPP", "cl -E -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("NM", "dumpbin -symbols") + env.define("STRIP", ":") + env.define("RANLIB", ":") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + if self.settings.os != "Windows": + autotools.make(args=["-C", "x86dis"]) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + if self.settings.os != "Windows": + autotools.install(args=["-C", "x86dis"]) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: + dlllib = os.path.join(self.package_folder, "lib", "disasm.dll.lib") + if os.path.exists(dlllib): + rename(self, dlllib, os.path.join(self.package_folder, "lib", "disasm.lib")) + + def package_info(self): + self.cpp_info.libs = ["disasm"] + + if self.settings.os != "Windows": + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libdisasm/all/patches/0001-fix-size-of-void.patch b/recipes/libdisasm/all/patches/0001-fix-size-of-void.patch new file mode 100644 index 0000000000000..1e4e008fc4826 --- /dev/null +++ b/recipes/libdisasm/all/patches/0001-fix-size-of-void.patch @@ -0,0 +1,27 @@ +--- a/libdisasm/x86_disasm.c ++++ b/libdisasm/x86_disasm.c +@@ -35,7 +35,7 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len, + + if ( offset >= buf_len ) { + /* another caller screwup ;) */ +- x86_report_error(report_disasm_bounds, (void*)(long)buf_rva+offset); ++ x86_report_error(report_disasm_bounds, (void*)(long)(buf_rva+offset)); + return 0; + } + +@@ -53,13 +53,13 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len, + + /* check and see if we had an invalid instruction */ + if (! size ) { +- x86_report_error(report_invalid_insn, (void*)(long)buf_rva+offset ); ++ x86_report_error(report_invalid_insn, (void*)(long)(buf_rva+offset)); + return 0; + } + + /* check if we overran the end of the buffer */ + if ( size > len ) { +- x86_report_error( report_insn_bounds, (void*)(long)buf_rva + offset ); ++ x86_report_error( report_insn_bounds, (void*)(long)(buf_rva + offset)); + MAKE_INVALID( insn, bytes ); + return 0; + } diff --git a/recipes/libdisasm/all/patches/0002-only-build-libdisasm-by-default.patch b/recipes/libdisasm/all/patches/0002-only-build-libdisasm-by-default.patch new file mode 100644 index 0000000000000..5468d7c959637 --- /dev/null +++ b/recipes/libdisasm/all/patches/0002-only-build-libdisasm-by-default.patch @@ -0,0 +1,8 @@ +--- Makefile.am ++++ Makefile.am +@@ -1,4 +1,4 @@ +-SUBDIRS = libdisasm x86dis test doc man perl ++SUBDIRS = libdisasm #x86dis test doc man perl + + EXTRA_DIST = \ + LICENSE autogen.sh diff --git a/recipes/libdisasm/all/patches/0003-libdisasm-no-undefined.patch b/recipes/libdisasm/all/patches/0003-libdisasm-no-undefined.patch new file mode 100644 index 0000000000000..57a76549b74d5 --- /dev/null +++ b/recipes/libdisasm/all/patches/0003-libdisasm-no-undefined.patch @@ -0,0 +1,11 @@ +--- libdisasm/Makefile.am ++++ libdisasm/Makefile.am +@@ -27,7 +27,7 @@ + x86_misc.c \ + x86_operand_list.c \ + x86_operand_list.h +- ++AM_LDFLAGS = -no-undefined + # Cheat to get non-autoconf swig into tarball, + # even if it doesn't build by default. + EXTRA_DIST = \ diff --git a/recipes/libdisasm/all/test_package/CMakeLists.txt b/recipes/libdisasm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d243e526c276c --- /dev/null +++ b/recipes/libdisasm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libdisasm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdisasm::libdisasm) diff --git a/recipes/libdisasm/all/test_package/conanfile.py b/recipes/libdisasm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1c3cd9bc22a9e --- /dev/null +++ b/recipes/libdisasm/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if 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": + self.run("x86dis -h", env="conanrun") diff --git a/recipes/libdisasm/all/test_package/test_package.c b/recipes/libdisasm/all/test_package/test_package.c new file mode 100644 index 0000000000000..cb52011e1d62f --- /dev/null +++ b/recipes/libdisasm/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() +{ + x86_init(opt_none, NULL, NULL); + x86_cleanup(); + return 0; +} diff --git a/recipes/libdisasm/all/test_v1_package/CMakeLists.txt b/recipes/libdisasm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libdisasm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libdisasm/all/test_v1_package/conanfile.py b/recipes/libdisasm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1381fb8880ef2 --- /dev/null +++ b/recipes/libdisasm/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.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("x86dis -h", run_environment=True) diff --git a/recipes/libdisasm/config.yml b/recipes/libdisasm/config.yml new file mode 100644 index 0000000000000..f8afc9abd1d4a --- /dev/null +++ b/recipes/libdisasm/config.yml @@ -0,0 +1,3 @@ +versions: + "0.23": + folder: all diff --git a/recipes/libdispatch/all/CMakeLists.txt b/recipes/libdispatch/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/libdispatch/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libdispatch/all/conandata.yml b/recipes/libdispatch/all/conandata.yml new file mode 100644 index 0000000000000..af8dbb5acf2f1 --- /dev/null +++ b/recipes/libdispatch/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "5.3.2": + sha256: d18ad8f24e3461108d8e2e0c838c8fca671f808ab8d06a2c32a7065f321995a1 + url: https://github.com/apple/swift-corelibs-libdispatch/archive/swift-5.3.2-RELEASE.tar.gz diff --git a/recipes/libdispatch/all/conanfile.py b/recipes/libdispatch/all/conanfile.py new file mode 100644 index 0000000000000..e88fe5b5ab8e0 --- /dev/null +++ b/recipes/libdispatch/all/conanfile.py @@ -0,0 +1,66 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.32.0" + +class LibDispatchConan(ConanFile): + name = "libdispatch" + homepage = "https://github.com/apple/swift-corelibs-libdispatch" + description = "Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware." + topics = ("conan", "libdispatch", "apple", "GCD", "concurrency") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + _cmake = None + + def validate(self): + if self.settings.compiler != "clang": + raise ConanInvalidConfiguration("Clang compiler is required.") + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "swift-corelibs-{}-swift-{}-RELEASE".format(self.name, self.version) + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + if self.settings.os == "Macos": + self.cpp_info.libs = ["dispatch"] + else: + self.cpp_info.libs = ["dispatch", "BlocksRuntime"] + + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["shlwapi", "ws2_32", "winmm", "synchronization"] diff --git a/recipes/libdispatch/all/test_package/CMakeLists.txt b/recipes/libdispatch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d66f5d5a5a432 --- /dev/null +++ b/recipes/libdispatch/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1.2) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(libdispatch REQUIRED) + +# TEST_PACKAGE ################################################################# +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${CMAKE_PROJECT_NAME} libdispatch::libdispatch) diff --git a/recipes/libdispatch/all/test_package/conanfile.py b/recipes/libdispatch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9294e13566895 --- /dev/null +++ b/recipes/libdispatch/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/libdispatch/all/test_package/test_package.cpp b/recipes/libdispatch/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b959db5ada8bd --- /dev/null +++ b/recipes/libdispatch/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + dispatch_queue_t main_q = dispatch_get_main_queue(); + return 0; +} diff --git a/recipes/libdispatch/config.yml b/recipes/libdispatch/config.yml new file mode 100644 index 0000000000000..fde093ec842e6 --- /dev/null +++ b/recipes/libdispatch/config.yml @@ -0,0 +1,3 @@ +versions: + "5.3.2": + folder: all diff --git a/recipes/libdivide/all/conandata.yml b/recipes/libdivide/all/conandata.yml new file mode 100644 index 0000000000000..6b1811615bec8 --- /dev/null +++ b/recipes/libdivide/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "5.0": + url: "https://github.com/ridiculousfish/libdivide/archive/refs/tags/5.0.tar.gz" + sha256: "01ffdf90bc475e42170741d381eb9cfb631d9d7ddac7337368bcd80df8c98356" + "3.0": + url: "https://github.com/ridiculousfish/libdivide/archive/v3.0.tar.gz" + sha256: "7c0baed201e78f12f290d3f8c22c974d2fa44aefd9820f8484f7972a431ff264" diff --git a/recipes/libdivide/all/conanfile.py b/recipes/libdivide/all/conanfile.py new file mode 100644 index 0000000000000..47e6ad87f66f6 --- /dev/null +++ b/recipes/libdivide/all/conanfile.py @@ -0,0 +1,82 @@ +from conans import ConanFile, tools + +required_conan_version = ">=1.33.0" + +class LibdivideConan(ConanFile): + name = "libdivide" + description = "Header-only C/C++ library for optimizing integer division." + topics = ("libdivide", "division", "integer", ) + license = ["Zlib", "BSL-1.0"] + homepage = "http://libdivide.com/" + url = "https://github.com/conan-io/conan-center-index" + settings = "arch", "compiler" + no_copy_source = True + options = { + "simd_intrinsics": [False, "sse2", "avx2", "avx512"], + "sse2": [True, False], + "avx2": [True, False], + "avx512": [True, False], + "neon": [True, False], + } + default_options = { + "simd_intrinsics": False, + "sse2": False, + "avx2": False, + "avx512": False, + "neon": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if tools.Version(self.version) < "4.0.0": + del self.options.sse2 + del self.options.avx2 + del self.options.avx512 + del self.options.neon + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.simd_intrinsics + else: + del self.options.simd_intrinsics + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.sse2 + del self.options.avx2 + del self.options.avx512 + if not str(self.settings.arch).startswith("arm"): + del self.options.neon + + def configure(self): + if tools.Version(self.version) < "4.0.0" and self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy("libdivide.h", dst="include", src=self._source_subfolder) + self.copy("constant_fast_div.h", dst="include", src=self._source_subfolder) + self.copy("s16_ldparams.h", dst="include", src=self._source_subfolder) + self.copy("u16_ldparams.h", dst="include", src=self._source_subfolder) + + def package_info(self): + simd = self.options.get_safe("simd_intrinsics", False) + if bool(simd): + self.cpp_info.defines = [ + {"sse2": "LIBDIVIDE_SSE2", + "avx2": "LIBDIVIDE_AVX2", + "avx512": "LIBDIVIDE_AVX512"}[str(simd)] + ] + if self.options.get_safe("sse2", False): + self.cpp_info.defines.append("LIBDIVIDE_SSE2") + if self.options.get_safe("avx2", False): + self.cpp_info.defines.append("LIBDIVIDE_AVX2") + if self.options.get_safe("avx512", False): + self.cpp_info.defines.append("LIBDIVIDE_AVX512") + if self.options.get_safe("neon", False): + self.cpp_info.defines.append("LIBDIVIDE_NEON") diff --git a/recipes/libdivide/all/test_package/CMakeLists.txt b/recipes/libdivide/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c08b1cebc6009 --- /dev/null +++ b/recipes/libdivide/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libdivide REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c libdivide::libdivide) +set_property(TARGET ${PROJECT_NAME}_c PROPERTY C_STANDARD 99) + +add_executable(${PROJECT_NAME}_cpp test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp libdivide::libdivide) +set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) diff --git a/recipes/libdivide/all/test_package/conanfile.py b/recipes/libdivide/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0eee35d285cde --- /dev/null +++ b/recipes/libdivide/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_c_path = os.path.join("bin", "test_package_c") + self.run(bin_c_path, run_environment=True) + bin_cpp_path = os.path.join("bin", "test_package_cpp") + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/libdivide/all/test_package/test_package.c b/recipes/libdivide/all/test_package/test_package.c new file mode 100644 index 0000000000000..dc8a5151154fd --- /dev/null +++ b/recipes/libdivide/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main() { + struct libdivide_s64_t fast_d = libdivide_s64_gen(30); + int64_t a = 60; + printf("%" PRId64 "\n", libdivide_s64_do(a, &fast_d)); + return 0; +} diff --git a/recipes/libdivide/all/test_package/test_package.cpp b/recipes/libdivide/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..418f08c5aee98 --- /dev/null +++ b/recipes/libdivide/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include +#include + +int main() { + libdivide::divider fast_d(30); + int64_t a = 60; + std::cout << a / fast_d << std::endl; + return 0; +} diff --git a/recipes/libdivide/config.yml b/recipes/libdivide/config.yml new file mode 100644 index 0000000000000..c374cc0645132 --- /dev/null +++ b/recipes/libdivide/config.yml @@ -0,0 +1,5 @@ +versions: + "5.0": + folder: all + "3.0": + folder: all diff --git a/recipes/libdmtx/all/conandata.yml b/recipes/libdmtx/all/conandata.yml new file mode 100644 index 0000000000000..bf0c94a4bc46b --- /dev/null +++ b/recipes/libdmtx/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.7.7": + url: "https://github.com/dmtx/libdmtx/archive/refs/tags/v0.7.7.tar.gz" + sha256: "7aa62adcefdd6e24bdabeb82b3ce41a8d35f4a0c95ab0c4438206aecafd6e1a1" +patches: + "0.7.7": + - patch_file: "patches/0001-0.7.7-fix-version.patch" + patch_description: "update version in CMakeLists.txt" + patch_type: "conan" + - patch_file: "patches/0002-0.7.7-add-install.patch" + patch_description: "add install command to CMakeLists.txt" + patch_type: "conan" diff --git a/recipes/libdmtx/all/conanfile.py b/recipes/libdmtx/all/conanfile.py new file mode 100644 index 0000000000000..3f81f847317dd --- /dev/null +++ b/recipes/libdmtx/all/conanfile.py @@ -0,0 +1,86 @@ +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 +import os + + +required_conan_version = ">=1.53.0" + + +class libdmtxConan(ConanFile): + name = "libdmtx" + description = ( + "software library that enables programs to read" + "and write Data Matrix barcodes of the modern ECC200 variety" + ) + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dmtx/libdmtx" + topics = ("data matrix", "ECC200", "barcode") + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + strip_root=True + ) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + 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() + + def package_info(self): + self.cpp_info.libs = ["dmtx"] + + self.cpp_info.set_property("pkg_config_name", "libdmtx") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch b/recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch new file mode 100644 index 0000000000000..1e9681706bf43 --- /dev/null +++ b/recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch @@ -0,0 +1,11 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6420a81..a98e68f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + cmake_minimum_required(VERSION 3.0) +-project(DMTX VERSION 0.7.5 LANGUAGES C) ++project(DMTX VERSION 0.7.7 LANGUAGES C) + + # DMTX library + option(DMTX_SHARED "Build DMTX as shared library" ${BUILD_SHARED_LIBS}) diff --git a/recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch b/recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch new file mode 100644 index 0000000000000..3e2bff94dbde1 --- /dev/null +++ b/recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a98e68f..0531d40 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,6 +19,9 @@ else() + target_link_libraries(dmtx PUBLIC -lm) + endif() + ++set_target_properties(dmtx PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/dmtx.h") ++install(TARGETS dmtx LIBRARY ARCHIVE RUNTIME PUBLIC_HEADER) ++ + # Add tests if DMTX is the main project + if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + include(CTest) diff --git a/recipes/libdmtx/all/test_package/CMakeLists.txt b/recipes/libdmtx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bfac09c051b74 --- /dev/null +++ b/recipes/libdmtx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +find_package(libdmtx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdmtx::libdmtx) diff --git a/recipes/libdmtx/all/test_package/conanfile.py b/recipes/libdmtx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libdmtx/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/libdmtx/all/test_package/test_package.c b/recipes/libdmtx/all/test_package/test_package.c new file mode 100644 index 0000000000000..76e0814c2514e --- /dev/null +++ b/recipes/libdmtx/all/test_package/test_package.c @@ -0,0 +1,100 @@ +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + size_t width, height, bytesPerPixel; + unsigned char str[] = "30Q324343430794image, DmtxPropWidth); + height = dmtxImageGetProp(enc->image, DmtxPropHeight); + bytesPerPixel = dmtxImageGetProp(enc->image, DmtxPropBytesPerPixel); + + pxl = (unsigned char *)malloc(width * height * bytesPerPixel); + assert(pxl != NULL); + memcpy(pxl, enc->image->pxl, width * height * bytesPerPixel); + + dmtxEncodeDestroy(&enc); + + fprintf(stdout, "width: \"%zd\"\n", width); + fprintf(stdout, "height: \"%zd\"\n", height); + fprintf(stdout, "bpp: \"%zd\"\n", bytesPerPixel); + + for (int i=0; iarraySize : \"%zd\"\n", msg->arraySize ); + fprintf(stdout, "msg->codeSize : \"%zd\"\n", msg->codeSize ); + fprintf(stdout, "msg->outputSize: \"%zd\"\n", msg->outputSize); + int oned = sqrt(msg->arraySize); + for (int i=0; iarraySize; i++){ + fprintf(stdout, " %c.", msg->array[i]); + if (i%oned==oned-1){ + fprintf(stdout, "\n"); + } + } + fprintf(stdout, "\n\n"); + for (int j=0; jcodeSize; j++){ + fprintf(stdout, " %c.", msg->code[j]); + } + fprintf(stdout, "\n\n"); + for (int k=0; koutputSize; k++){ + fprintf(stdout, " %c.", msg->output[k]); + } + fprintf(stdout, "\n\n"); + + if(msg != NULL) { + fputs("output: \"", stdout); + fwrite(msg->output, sizeof(unsigned char), msg->outputIdx, stdout); + fputs("\"\n", stdout); + dmtxMessageDestroy(&msg); + } + dmtxRegionDestroy(®); + } + + dmtxDecodeDestroy(&dec); + dmtxImageDestroy(&img); + free(pxl); + + fprintf(stdout, "%d\n", getSizeIdxFromSymbolDimension(12, 12)); + + exit(0); +} diff --git a/recipes/libdmtx/all/test_v1_package/CMakeLists.txt b/recipes/libdmtx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/libdmtx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdmtx/all/test_v1_package/conanfile.py b/recipes/libdmtx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libdmtx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libdmtx/config.yml b/recipes/libdmtx/config.yml new file mode 100644 index 0000000000000..356debf98276f --- /dev/null +++ b/recipes/libdmtx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.7": + folder: all diff --git a/recipes/libdrm/all/conandata.yml b/recipes/libdrm/all/conandata.yml new file mode 100644 index 0000000000000..c664ae449755d --- /dev/null +++ b/recipes/libdrm/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.4.114": + url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.114.tar.xz" + sha256: "3049cf843a47d12e5eeefbc3be3496d782fa09f42346bf0b7defe3d1e598d026" + "2.4.109": + url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.109.tar.xz" + sha256: "629352e08c1fe84862ca046598d8a08ce14d26ab25ee1f4704f993d074cb7f26" diff --git a/recipes/libdrm/all/conanfile.py b/recipes/libdrm/all/conanfile.py new file mode 100644 index 0000000000000..aad89cccd5bf6 --- /dev/null +++ b/recipes/libdrm/all/conanfile.py @@ -0,0 +1,188 @@ +import os +import re + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, load, mkdir, rmdir, save +from conan.tools.scm import Version +from conans import Meson + + +class LibdrmConan(ConanFile): + name = "libdrm" + description = "User space library for accessing the Direct Rendering Manager, on operating systems that support the ioctl interface" + topics = ("libdrm", "graphics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.freedesktop.org/mesa/drm" + license = "MIT" + generators = "PkgConfigDeps" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "libkms": [True, False], + "intel": [True, False], + "radeon": [True, False], + "amdgpu": [True, False], + "nouveau": [True, False], + "vmwgfx": [True, False], + "omap": [True, False], + "exynos": [True, False], + "freedreno": [True, False], + "tegra": [True, False], + "vc4": [True, False], + "etnaviv": [True, False], + "valgrind": [True, False], + "freedreno-kgsl": [True, False], + "udev": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "libkms": True, + "intel": True, + "radeon": True, + "amdgpu": True, + "nouveau": True, + "vmwgfx": True, + "omap": False, + "exynos": False, + "freedreno": True, + "tegra": False, + "vc4": True, + "etnaviv": False, + "valgrind": False, + "freedreno-kgsl": False, + "udev": False + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def build_requirements(self): + self.build_requires("meson/0.64.1") + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + if Version(self.version) >= "2.4.111": + del self.options.libkms + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.intel: + self.requires("libpciaccess/0.16") + if self.settings.os == "Linux": + self.requires("linux-headers-generic/5.14.9") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("libdrm supports only Linux or FreeBSD") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _configure_meson(self): + meson = Meson(self) + + defs={ + "cairo-tests" : "disabled" if Version(self.version) >= "2.4.113" else "false", + "install-test-programs": "false" + } + if Version(self.version) < "2.4.111": + defs["libkms"] = "true" if self.options.libkms else "false" + + defs["freedreno-kgsl"] = "true" if getattr(self.options, "freedreno-kgsl") else "false" + defs["udev"] = "true" if self.options.udev else "false" + + for o in ["intel", "radeon", "amdgpu","nouveau", "vmwgfx", "omap", "exynos", + "freedreno", "tegra", "vc4", "etnaviv", "valgrind"]: + if Version(self.version) >= "2.4.113": + defs[o] = "enabled" if getattr(self.options, o) else "disabled" + else: + defs[o] = "true" if getattr(self.options, o) else "false" + + defs["datadir"] = os.path.join(self.package_folder, "res") + defs["mandir"] = os.path.join(self.package_folder, "res", "man") + + meson.configure( + defs = defs, + source_folder=self._source_subfolder, + build_folder=self._build_subfolder) + return meson + + def build(self): + meson = self._configure_meson() + meson.build() + + def package(self): + meson = self._configure_meson() + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + mkdir(self, os.path.join(self.package_folder, "licenses")) + # Extract the License/s from the header to a file + tmp = load(self, os.path.join(self._source_subfolder, "include", "drm", "drm.h")) + license_contents = re.search("\*\/.*(\/\*(\*(?!\/)|[^*])*\*\/)", tmp, re.DOTALL)[1] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + 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 == "Linux": + self.cpp_info.components["libdrm_libdrm"].requires = ["linux-headers-generic::linux-headers-generic"] + + if Version(self.version) < "2.4.111": + if self.options.libkms: + self.cpp_info.components["libdrm_libkms"].libs = ["kms"] + self.cpp_info.components["libdrm_libkms"].includedirs.append(os.path.join('include', 'libkms')) + self.cpp_info.components["libdrm_libkms"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_libkms"].set_property("pkg_config_name", "libkms") + + if self.options.vc4: + self.cpp_info.components["libdrm_vc4"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_vc4"].set_property("pkg_config_name", "libdrm_vc4") + + if self.options.freedreno: + self.cpp_info.components["libdrm_freedreno"].libs = ["drm_freedreno"] + self.cpp_info.components["libdrm_freedreno"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_freedreno"].includedirs.append(os.path.join('include', 'freedreno')) + self.cpp_info.components["libdrm_freedreno"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_freedreno"].set_property("pkg_config_name", "libdrm_freedreno") + + if self.options.amdgpu: + self.cpp_info.components["libdrm_amdgpu"].libs = ["drm_amdgpu"] + self.cpp_info.components["libdrm_amdgpu"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_amdgpu"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_amdgpu"].set_property("pkg_config_name", "libdrm_amdgpu") + + if self.options.nouveau: + self.cpp_info.components["libdrm_nouveau"].libs = ["drm_nouveau"] + self.cpp_info.components["libdrm_nouveau"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_nouveau"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_nouveau"].set_property("pkg_config_name", "libdrm_nouveau") + + if self.options.intel: + self.cpp_info.components["libdrm_intel"].libs = ["drm_intel"] + self.cpp_info.components["libdrm_intel"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_intel"].requires = ["libdrm_libdrm", "libpciaccess::libpciaccess"] + self.cpp_info.components["libdrm_intel"].set_property("pkg_config_name", "libdrm_intel") + + if self.options.radeon: + self.cpp_info.components["libdrm_radeon"].libs = ["drm_radeon"] + self.cpp_info.components["libdrm_radeon"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_radeon"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_radeon"].set_property("pkg_config_name", "libdrm_radeon") + diff --git a/recipes/libdrm/all/test_package/CMakeLists.txt b/recipes/libdrm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afa2476357074 --- /dev/null +++ b/recipes/libdrm/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +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/libdrm/all/test_package/conanfile.py b/recipes/libdrm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8e9e5fdc7aa40 --- /dev/null +++ b/recipes/libdrm/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/libdrm/all/test_package/test_package.c b/recipes/libdrm/all/test_package/test_package.c new file mode 100644 index 0000000000000..9de39b71a65f1 --- /dev/null +++ b/recipes/libdrm/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include "xf86drm.h" + +int main() +{ + drmVersionPtr v = drmGetLibVersion(0); + printf("drm version: %d.%d.%d\n", v->version_major, v->version_minor, v->version_patchlevel); + drmFree(v); + printf("drm available: %d\n", drmAvailable()); + return 0; +} diff --git a/recipes/libdrm/config.yml b/recipes/libdrm/config.yml new file mode 100644 index 0000000000000..90fca8a547e3e --- /dev/null +++ b/recipes/libdrm/config.yml @@ -0,0 +1,5 @@ +versions: + "2.4.114": + folder: all + "2.4.109": + folder: all diff --git a/recipes/libdwarf/all/conandata.yml b/recipes/libdwarf/all/conandata.yml new file mode 100644 index 0000000000000..75d6fc5547c89 --- /dev/null +++ b/recipes/libdwarf/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.5.0": + url: "https://www.prevanders.net/libdwarf-0.5.0.tar.xz" + sha256: "11fa822c60317fa00e1a01a2ac9e8388f6693e8662ab72d352c5f50c7e0112a9" + "20191104": + url: "https://www.prevanders.net/libdwarf-20191104.tar.gz" + sha256: "45f50a966314421b7dab525859853616df6c9680f0ccf2f44b030c505236eaba" +patches: + "0.5.0": + - patch_file: "patches/0.5.0-0001-fix-cmake.patch" + patch_description: "use cci package, remove lib64/bin64 install folders" + patch_type: "conan" + - patch_file: "patches/0.5.0-0001-fix-DW_API.patch" + patch_description: "fix DW_API definition" + patch_type: "portability" + "20191104": + - patch_file: "patches/20191104-0001-patch.patch" + patch_description: "use cci package, remove lib64/bin64 install folders" + patch_type: "conan" diff --git a/recipes/libdwarf/all/conanfile.py b/recipes/libdwarf/all/conanfile.py new file mode 100644 index 0000000000000..ddc9a73438a95 --- /dev/null +++ b/recipes/libdwarf/all/conanfile.py @@ -0,0 +1,107 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rename +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class LibdwarfConan(ConanFile): + name = "libdwarf" + description = "A library and a set of command-line tools for reading and writing DWARF2" + license = ("LGPL-2.1-only", "BSD-2-Clause-Views") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.prevanders.net/dwarf.html" + topics = ("debug", "dwarf", "dwarf2", "elf") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_dwarfgen": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_dwarfgen": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + if not self.options.with_dwarfgen: + self.license = "LGPL-2.1-only" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libelf/0.8.13") + self.requires("zlib/1.2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BUILD_NON_SHARED"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_DWARFGEN"] = self.options.with_dwarfgen + tc.variables["BUILD_DWARFEXAMPLE"] = False + if cross_building(self): + tc.variables["HAVE_UNUSED_ATTRIBUTE_EXITCODE"] = "0" + tc.variables["HAVE_UNUSED_ATTRIBUTE_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + if self.version == "20191104": + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "libdwarf")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-libdwarf")) + if self.options.with_dwarfgen: + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "dwarfgen")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfgen")) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + else: + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "lib", "libdwarf")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-libdwarf")) + if self.options.with_dwarfgen: + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "bin", "dwarfgen")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfgen")) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["dwarf"] + + if self.options.with_dwarfgen: + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f'Appending PATH environment variable: {bindir}') + self.env_info.PATH.append(bindir) + + if self.version != "20191104": + self.cpp_info.libs.append = ["dwarfp"] diff --git a/recipes/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch b/recipes/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch new file mode 100644 index 0000000000000..09c3ab0c030c1 --- /dev/null +++ b/recipes/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h +index 9a59eb1..fa5e68e 100644 +--- a/src/lib/libdwarf/libdwarf.h ++++ b/src/lib/libdwarf/libdwarf.h +@@ -50,7 +50,7 @@ + #undef DW_API + #endif /* DW_API */ + +-#if defined(_WIN32) || defined(__CYGWIN__) ++#if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__)) + # ifdef LIBDWARF_BUILD + # define DW_API __declspec(dllexport) + # else /* !LIBDWARF_BUILD */ diff --git a/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch b/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..fce5a0373f748 --- /dev/null +++ b/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch @@ -0,0 +1,105 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4f58f43..69e0238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -129,6 +129,7 @@ check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) + + ### cmake provides no way to guarantee uint32_t present. + ### configure does guarantee that. ++find_package(libelf REQUIRED) + if(HAVE_STDINT_H) + check_c_source_compiles(" + #include +@@ -192,7 +193,8 @@ elseif(HAVE_LIBELF_LIBELF_H) + endif() + + if (HAVE_LIBELF_H OR HAVE_LIBELF_LIBELF_H) +- set (CMAKE_REQUIRED_LIBRARIES elf) ++ set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getehdr") + check_symbol_exists( elf64_getehdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETEHDR) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getshdr") +@@ -216,6 +218,9 @@ if (DWARF_WITH_LIBELF) + message(STATUS "checking using elf header ... ${HAVE_LOCATION_OF_LIBELFHEADER}") + message(STATUS "checking using libelf header ... ${JUST_LIBELF}") + ++set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) ++ + check_c_source_compiles(" + #include ${HAVE_LOCATION_OF_LIBELFHEADER} + int main() +@@ -361,7 +366,6 @@ message(STATUS "Building api tests ... ${DOTESTS}") + ### end what was configure.cmake + + # This references cmake/FindLibElf.cmake. See cmake documentation. +-find_package(LibElf REQUIRED) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) + + configure_file(cmake/config.h.cmake config.h) +@@ -384,7 +388,6 @@ if(BUILD_SHARED) + endif() + + add_subdirectory(src/lib/libdwarf) +-add_subdirectory(src/bin/dwarfdump) + + if ( BUILD_DWARFEXAMPLE ) + add_subdirectory(src/bin/dwarfexample) +diff --git a/src/bin/dwarfdump/CMakeLists.txt b/src/bin/dwarfdump/CMakeLists.txt +index f6f5376..22c5977 100644 +--- a/src/bin/dwarfdump/CMakeLists.txt ++++ b/src/bin/dwarfdump/CMakeLists.txt +@@ -65,7 +65,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${DW_FZLIB} ${DW_FZSTD} ) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git a/src/bin/dwarfgen/CMakeLists.txt b/src/bin/dwarfgen/CMakeLists.txt +index 5c2c192..fc3428e 100644 +--- a/src/bin/dwarfgen/CMakeLists.txt ++++ b/src/bin/dwarfgen/CMakeLists.txt +@@ -28,7 +28,7 @@ target_include_directories(dwarfgen PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/libdwarfp) + + target_link_libraries(dwarfgen PRIVATE ${dwarfp-target} +- ${dwarf-target} ${DW_FZLIB}) ++ ${dwarf-target} ${DW_FZLIB} libelf::libelf) + + set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 0b7d578..62b67da 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -67,7 +67,7 @@ set_source_group(CONFIGURATION_FILES "Configuration Files" + + list(LENGTH DWARF_TARGETS targetCount) + math(EXPR targetCount "${targetCount} - 1") +-list(APPEND DWARF_LIBS ${LIBELF_LIBRARIES}) ++list(APPEND DWARF_LIBS ${libelf_LIBRARIES}) + if (DW_FZLIB) + list(APPEND DWARF_LIBS z) + endif() +@@ -85,13 +85,15 @@ foreach(i RANGE ${targetCount}) + ${LIBELF_INCLUDE_DIRS}) + target_compile_options(${target} PRIVATE -DLIBDWARF_BUILD + ${DW_FWALL}) +- msvc_posix(${target}) ++ if(BUILD_SHARED) ++ target_compile_definitions(${target} PRIVATE LIBDWARF_SHARED) ++ endif() ++ msvc_posix(${target}) + + target_link_libraries(${target} PUBLIC ${LIBELF_LIBRARIES} ${DW_FZLIB} ${DW_FZSTD} ) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +- set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + diff --git a/recipes/libdwarf/all/patches/20191104-0001-patch.patch b/recipes/libdwarf/all/patches/20191104-0001-patch.patch new file mode 100644 index 0000000000000..aadcac9dfe8fd --- /dev/null +++ b/recipes/libdwarf/all/patches/20191104-0001-patch.patch @@ -0,0 +1,178 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2607e56..3ca4ac5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -73,9 +73,9 @@ check_include_file( "unistd.h" HAVE_UNISTD_H ) + check_include_file( "sgidefs.h" HAVE_SGIDEFS_H ) + check_include_file( "stdafx.h" HAVE_STDAFX_H ) + check_include_file( "Windows.h" HAVE_WINDOWS_H ) +-check_include_file( "elf.h" HAVE_ELF_H ) +-check_include_file( "libelf.h" HAVE_LIBELF_H ) +-check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) ++set(HAVE_ELF_H FALSE) ++set(HAVE_LIBELF_H FALSE) ++set(HAVE_LIBELF_LIBELF_H TRUE) + check_include_file( "alloca.h" HAVE_ALLOCA_H ) + check_include_file( "elfaccess.h" HAVE_ELFACCESS_H) + check_include_file( "sys/elf_386.h" HAVE_SYS_ELF_386_H ) +@@ -128,6 +128,8 @@ endif() + # It's not really setting the location of libelfheader, + # it is really # either elf.h, or if that is missing + # it is assuming elf.h data is in the supplied libelf. ++find_package(libelf REQUIRED CONFIG) ++find_package(ZLIB REQUIRED CONFIG) + + if(HAVE_ELF_H) + set(HAVE_LOCATION_OF_LIBELFHEADER "") +@@ -146,12 +148,13 @@ elseif(HAVE_LIBELF_LIBELF_H) + endif() + + if (HAVE_LIBELF_H OR HAVE_LIBELF_LIBELF_H) +- set (CMAKE_REQUIRED_LIBRARIES elf) ++ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getehdr") + check_symbol_exists( elf64_getehdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETEHDR) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getshdr") + check_symbol_exists( elf64_getshdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETSHDR) + set (CMAKE_REQUIRED_LIBRARIES) ++ set (CMAKE_REQUIRED_DEFINITIONS) + endif() + + option(DWARF_WITH_LIBELF "Use libelf (default is YES)" TRUE) +@@ -166,6 +169,9 @@ if (DWARF_WITH_LIBELF) + message(STATUS "checking using HAVE_ELF_H ... ${HAVE_ELF_H}") + message(STATUS "checking using elf header ... ${HAVE_LOCATION_OF_LIBELFHEADER}") + message(STATUS "checking using libelf header ... ${JUST_LIBELF}") ++ ++ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) ++ + check_c_source_compiles(" + #include ${HAVE_LOCATION_OF_LIBELFHEADER} + int main() +@@ -202,7 +208,7 @@ if (DWARF_WITH_LIBELF) + # to set HAVE_LIBELF_OFF64_OK at present. + check_c_source_compiles(" + #define _GNU_SOURCE 1 +- #include ${JUST_LIBELF} ++ #include <${JUST_LIBELF}> + int main() + { + off64_t p; p = 0; +@@ -210,7 +216,7 @@ if (DWARF_WITH_LIBELF) + }" HAVE_LIBELF_OFF64_OK) + + check_c_source_compiles(" +- #include ${JUST_LIBELF} ++ #include <${JUST_LIBELF}> + /* This must be at global scope */ + struct _Elf; + typedef struct _Elf Elf; +@@ -220,6 +226,10 @@ if (DWARF_WITH_LIBELF) + int i = 12; + return 0; + }" HAVE_STRUCT_UNDERSCORE_ELF) ++ ++ set (CMAKE_REQUIRED_LIBRARIES) ++ set (CMAKE_REQUIRED_DEFINITIONS) ++ + endif() + message(STATUS "Assuming struct Elf for the default libdwarf.h") + # Because cmake treats ; in an interesting way attempting +@@ -378,10 +388,9 @@ message(STATUS "Checking producer generates only 32bit... ${HAVE_STRICT_DWARF2_3 + + + # This references cmake/FindLibElf.cmake. See cmake documentation. +-find_package(LibElf REQUIRED) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) + +-configure_file(config.h.in.cmake config.h) ++configure_file(${CMAKE_SOURCE_DIR}/config.h.in.cmake ${CMAKE_BINARY_DIR}/config.h) + + if(BUILD_NON_SHARED) + set(DWARF_TARGETS dwarf-static) +@@ -395,7 +404,6 @@ if(BUILD_SHARED) + endif() + + add_subdirectory(libdwarf) +-add_subdirectory(dwarfdump) + if ( BUILD_DWARFGEN ) + if ( DWARF_WITH_LIBELF ) + add_subdirectory(dwarfgen) +diff --git a/dwarfdump/CMakeLists.txt b/dwarfdump/CMakeLists.txt +index b94f6c8..6bdb57f 100644 +--- a/dwarfdump/CMakeLists.txt ++++ b/dwarfdump/CMakeLists.txt +@@ -31,7 +31,7 @@ set_source_group(CONFIGURATION_FILES "Configuration Files" + ${CMAKE_SOURCE_DIR}/config.h.in.cmake + ${CMAKE_BINARY_DIR}/config.h) + +-add_executable(dwarfdump ${SOURCES} ${HEADERS} ${CONFIGURATION_FILES}) ++add_executable(dwarfdump ${SOURCES} ${HEADERS} ${CONFIGURATION_FILES} ${libelf_LIBRARIES}) + + set_folder(dwarfdump dwarfdump) + +diff --git a/dwarfgen/CMakeLists.txt b/dwarfgen/CMakeLists.txt +index 488b820..5bde9eb 100644 +--- a/dwarfgen/CMakeLists.txt ++++ b/dwarfgen/CMakeLists.txt +@@ -20,16 +20,16 @@ set_folder(dwarfgen dwarfgen) + + target_compile_options(dwarfgen PRIVATE ${DW_FWALLXX}) + +-target_link_libraries(dwarfgen PRIVATE ${dwarf-target} ${DW_FZLIB}) ++target_link_libraries(dwarfgen PRIVATE ${dwarf-target} ${DW_FZLIB} ${libelf_LIBRARIES}) + + set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + + install(TARGETS dwarfgen DESTINATION +- RUNTIME DESTINATION ${BINDIR} +- LIBRARY DESTINATION ${LIBDIR} +- ARCHIVE DESTINATION ${LIBDIR}) ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + #install(FILES dwarfgen.conf DESTINATION lib) + +diff --git a/libdwarf/CMakeLists.txt b/libdwarf/CMakeLists.txt +index c610522..3a69533 100644 +--- a/libdwarf/CMakeLists.txt ++++ b/libdwarf/CMakeLists.txt +@@ -81,12 +81,9 @@ foreach(i RANGE ${targetCount}) + ${GENNAMES_OUTPUT} ${CONFIGURATION_FILES}) + + set_folder(${target} libdwarf) +- target_include_directories(${target} PUBLIC +- ${LIBELF_INCLUDE_DIRS}) +- target_compile_options(${target} PRIVATE ${DW_FWALL}) + msvc_posix(${target}) + +- target_link_libraries(${target} PUBLIC ${LIBELF_LIBRARIES}) ++ target_link_libraries(${target} PUBLIC ${libelf_LIBRARIES} ${ZLIB_LIBRARIES}) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +@@ -95,15 +92,14 @@ foreach(i RANGE ${targetCount}) + set(BINDIR bin${SUFFIX}) + + install(TARGETS ${target} +- RUNTIME DESTINATION ${BINDIR} +- LIBRARY DESTINATION ${LIBDIR} +- ARCHIVE DESTINATION ${LIBDIR}) ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + endforeach() + +-if(UNIX AND BUILD_SHARED) +- target_link_libraries(dwarf-shared PUBLIC z) +-endif() +- ++install(FILES ${CMAKE_BINARY_DIR}/libdwarf/libdwarf.h DESTINATION include) ++install(FILES dwarf.h DESTINATION include) ++ + if (DO_TESTING) + set_source_group(TESTLEB "Source Files" dwarf_leb_test.c + dwarf_leb.c pro_encode_nm.c ) diff --git a/recipes/libdwarf/all/test_package/CMakeLists.txt b/recipes/libdwarf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a2fbbf0a474e1 --- /dev/null +++ b/recipes/libdwarf/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libdwarf REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdwarf::libdwarf) + +if(NOT libdwarf_VERSION MATCHES "^[0-9]*$") + target_compile_definitions(${PROJECT_NAME} PRIVATE "LIBDWARF_NEW_STRUCTURE") +endif() diff --git a/recipes/libdwarf/all/test_package/conanfile.py b/recipes/libdwarf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/libdwarf/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdwarf/all/test_package/test_package.c b/recipes/libdwarf/all/test_package/test_package.c new file mode 100644 index 0000000000000..33cfec6d8bf91 --- /dev/null +++ b/recipes/libdwarf/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include + +#ifndef LIBDWARF_NEW_STRUCTURE + #include "dwarf.h" + #include "libdwarf.h" +#else + #include "libdwarf/libdwarf.h" +#endif + +void example1(Dwarf_Die somedie) { + Dwarf_Debug dbg = 0; + Dwarf_Signed atcount; + Dwarf_Attribute *atlist; + Dwarf_Error error = 0; + Dwarf_Signed i = 0; + int errv; + errv = dwarf_attrlist(somedie, &atlist, &atcount, &error); + if (errv == DW_DLV_OK) { + for (i = 0; i < atcount; ++i) { + dwarf_dealloc(dbg, atlist[i], DW_DLA_ATTR); + } + dwarf_dealloc(dbg, atlist, DW_DLA_LIST); + } + else if(errv == DW_DLV_ERROR){ + dwarf_dealloc(dbg, error, DW_DLA_ERROR); + } +} +int main(void){ + Dwarf_Die somedie; + memset(&somedie, 0, sizeof(somedie)); + example1(somedie); + return EXIT_SUCCESS; +} diff --git a/recipes/libdwarf/all/test_v1_package/CMakeLists.txt b/recipes/libdwarf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/libdwarf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdwarf/all/test_v1_package/conanfile.py b/recipes/libdwarf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libdwarf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libdwarf/config.yml b/recipes/libdwarf/config.yml new file mode 100644 index 0000000000000..aa4d403dacd89 --- /dev/null +++ b/recipes/libdwarf/config.yml @@ -0,0 +1,5 @@ +versions: + "0.5.0": + folder: all + "20191104": + folder: all diff --git a/recipes/libdxfrw/all/conandata.yml b/recipes/libdxfrw/all/conandata.yml new file mode 100644 index 0000000000000..163bfa884b042 --- /dev/null +++ b/recipes/libdxfrw/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.2.0": + url: "https://github.com/LibreCAD/libdxfrw/archive/refs/tags/LC2.2.0.tar.gz" + sha256: "b56535f8c234bb119b94e11b2436651531869ba0171bb10166b007588e97d69f" + "1.0.1": + url: "https://github.com/LibreCAD/libdxfrw/archive/1.0.1.tar.gz" + sha256: "eea1021b296cb9ba4cab4417106e41d53a8fadfffe2cd108efe46afb04e2ec34" diff --git a/recipes/libdxfrw/all/conanfile.py b/recipes/libdxfrw/all/conanfile.py new file mode 100644 index 0000000000000..22166b390cae7 --- /dev/null +++ b/recipes/libdxfrw/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir, replace_in_file +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 LibdxfrwConan(ConanFile): + name = "libdxfrw" + description = "C++ library to read/write DXF and read DWG files" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/LibreCAD/libdxfrw" + topics = ("dxf", "dwg", "cad") + 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.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBDXFRW_BUILD_DOC"] = False + tc.generate() + + def build(self): + if Version(self.version) >= "2.2.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-Werror", "") + + 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["dxfrw"] + + self.cpp_info.set_property("pkg_config_name", "libdxfrw") + + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var: {bin_path}") + self.env_info.PATH.append(bin_path) diff --git a/recipes/libdxfrw/all/test_package/CMakeLists.txt b/recipes/libdxfrw/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3fefb4e7b7d8a --- /dev/null +++ b/recipes/libdxfrw/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libdxfrw REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libdxfrw::libdxfrw) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libdxfrw/all/test_package/conanfile.py b/recipes/libdxfrw/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libdxfrw/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/libdxfrw/all/test_package/test_package.cpp b/recipes/libdxfrw/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fa082a97608df --- /dev/null +++ b/recipes/libdxfrw/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + dxfRW dxfW(""); +} diff --git a/recipes/libdxfrw/all/test_v1_package/CMakeLists.txt b/recipes/libdxfrw/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libdxfrw/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdxfrw/all/test_v1_package/conanfile.py b/recipes/libdxfrw/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libdxfrw/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libdxfrw/config.yml b/recipes/libdxfrw/config.yml new file mode 100644 index 0000000000000..a9f4753aaca71 --- /dev/null +++ b/recipes/libdxfrw/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.0": + folder: all + "1.0.1": + folder: all diff --git a/recipes/libe57format/all/conandata.yml b/recipes/libe57format/all/conandata.yml new file mode 100644 index 0000000000000..857bfbb53a2a6 --- /dev/null +++ b/recipes/libe57format/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.2.0": + sha256: "19df04af07925bf43e1793534b0c77cb1346a2bee7746859d2fe1714a24f1c7d" + url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.2.0.tar.gz" + "2.3.0": + sha256: "124cc8f7dda84e8686ff2bcffc524ee4677eba3183631ec847a5f4a6ea60b254" + url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.tar.gz" +patches: + "2.2.0": + - patch_file: "patches/0001-fix-pic.patch" + - patch_file: "patches/0002-missing-include.patch" + "2.3.0": + - patch_file: "patches/2.3.0-0001-fix-pic.patch" diff --git a/recipes/libe57format/all/conanfile.py b/recipes/libe57format/all/conanfile.py new file mode 100644 index 0000000000000..479e129d3bbf3 --- /dev/null +++ b/recipes/libe57format/all/conanfile.py @@ -0,0 +1,111 @@ +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, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class LibE57FormatConan(ConanFile): + name = "libe57format" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/asmaloney/libE57Format" + description = "Library for reading & writing the E57 file format" + topics = ("e57", "io", "point-cloud") + + 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: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("xerces-c/3.2.3") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USING_STATIC_XERCES"] = not self.dependencies["xerces-c"].options.shared + 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.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"E57Format": "E57Format::E57Format"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "e57format") + self.cpp_info.set_property("cmake_target_name", "E57Format") + suffix = "-d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"E57Format{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.shared: + self.cpp_info.system_libs.extend(["m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "e57format" + self.cpp_info.filenames["cmake_find_package_multi"] = "e57format" + self.cpp_info.names["cmake_find_package"] = "E57Format" + self.cpp_info.names["cmake_find_package_multi"] = "E57Format" + 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/libe57format/all/patches/0001-fix-pic.patch b/recipes/libe57format/all/patches/0001-fix-pic.patch new file mode 100644 index 0000000000000..76ed8c2509a69 --- /dev/null +++ b/recipes/libe57format/all/patches/0001-fix-pic.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -104,7 +104,6 @@ + CXX_STANDARD_REQUIRED YES + CXX_EXTENSIONS NO + DEBUG_POSTFIX "-d" +- POSITION_INDEPENDENT_CODE ON + ) + + # Target definitions diff --git a/recipes/libe57format/all/patches/0002-missing-include.patch b/recipes/libe57format/all/patches/0002-missing-include.patch new file mode 100644 index 0000000000000..50253b05d6c2a --- /dev/null +++ b/recipes/libe57format/all/patches/0002-missing-include.patch @@ -0,0 +1,11 @@ +--- a/src/E57XmlParser.cpp ++++ b/src/E57XmlParser.cpp +@@ -42,6 +42,8 @@ + #include "StringNodeImpl.h" + #include "VectorNodeImpl.h" + ++#include ++ + using namespace e57; + using namespace XERCES_CPP_NAMESPACE; + diff --git a/recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch b/recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch new file mode 100644 index 0000000000000..a2ecc0de60e33 --- /dev/null +++ b/recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,7 +127,6 @@ + CXX_STANDARD_REQUIRED YES + CXX_EXTENSIONS NO + DEBUG_POSTFIX "-d" +- POSITION_INDEPENDENT_CODE ON + ) + + # Target definitions diff --git a/recipes/libe57format/all/test_package/CMakeLists.txt b/recipes/libe57format/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b8de16fa4046c --- /dev/null +++ b/recipes/libe57format/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(e57format REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE E57Format) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libe57format/all/test_package/conanfile.py b/recipes/libe57format/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libe57format/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/libe57format/all/test_package/test_package.cpp b/recipes/libe57format/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..25f1f5f3bc705 --- /dev/null +++ b/recipes/libe57format/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include + +int main() { + e57::Writer writer("file.e57"); + e57::Image2D image_header; + std::int64_t index = writer.NewImage2D(image_header); + std::vector image_bytes(100, 1); + std::int64_t n_bytes = writer.WriteImage2DData(index, e57::E57_JPEG_IMAGE, e57::E57_NO_PROJECTION, + image_bytes.data(), 0, image_bytes.size()); + + try { + e57::Reader reader("invalid-file.e57"); + } catch (const e57::E57Exception& e) { } + + return 0; +} diff --git a/recipes/libe57format/all/test_v1_package/CMakeLists.txt b/recipes/libe57format/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2bf6344a5bafd --- /dev/null +++ b/recipes/libe57format/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(e57format REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE E57Format) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libe57format/all/test_v1_package/conanfile.py b/recipes/libe57format/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libe57format/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/libe57format/config.yml b/recipes/libe57format/config.yml new file mode 100644 index 0000000000000..137671316c059 --- /dev/null +++ b/recipes/libe57format/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.0": + folder: all + "2.3.0": + folder: all diff --git a/recipes/libelf/all/CMakeLists.txt b/recipes/libelf/all/CMakeLists.txt new file mode 100644 index 0000000000000..272a6d59618a2 --- /dev/null +++ b/recipes/libelf/all/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.4) +project(elf LANGUAGES C) + +if(EXISTS "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32") + file(RENAME "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32" "${LIBELF_SRC_DIR}/lib/sys_elf.h") + file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/config.h") +endif() + +file(GLOB_RECURSE SOURCES "${LIBELF_SRC_DIR}/lib/*.c") +file(GLOB_RECURSE HEADERS "${LIBELF_SRC_DIR}/lib/*.h") + +add_library(${PROJECT_NAME} ${SOURCES}) +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${LIBELF_SRC_DIR}/lib") +target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelf +) + +install(FILES "${LIBELF_SRC_DIR}/lib/libelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/gelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/nlist.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/libelf/all/conandata.yml b/recipes/libelf/all/conandata.yml new file mode 100644 index 0000000000000..68a80e3aa9464 --- /dev/null +++ b/recipes/libelf/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.8.13": + url: [ + "http://repository.timesys.com/buildsources/l/libelf/libelf-0.8.13/libelf-0.8.13.tar.gz", + "https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz", + ] + sha256: "591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d" diff --git a/recipes/libelf/all/conanfile.py b/recipes/libelf/all/conanfile.py new file mode 100644 index 0000000000000..c93a47a212b33 --- /dev/null +++ b/recipes/libelf/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path +import os + +required_conan_version = ">=1.54.0" + + +class LibelfConan(ConanFile): + name = "libelf" + description = "ELF object file access library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://directory.fsf.org/wiki/Libelf" + license = "LGPL-2.0" + topics = ("elf", "fsf", "libelf", "object-file") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.os not in ["Linux", "FreeBSD", "Windows"]: + self.options.rm_safe("shared") + self.package_type = "static-library" + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self.settings.os != "Windows": + self.tool_requires("autoconf/2.71") + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["LIBELF_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + # it's required, libelf doesnt seem to understand DESTDIR + f"--prefix={unix_path(self, self.package_folder)}", + ]) + tc.generate() + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + else: + replace_in_file(self, os.path.join(self.source_folder, "lib", "Makefile.in"), + "$(LINK_SHLIB)", + "$(LINK_SHLIB) $(LDFLAGS)") + # libelf sources contains really outdated 'config.sub' and + # 'config.guess' files. It not allows to build libelf for armv8 arch. + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "locale")) + if self.options.get_safe("shared"): + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libelf") + self.cpp_info.libs = ["elf"] + self.cpp_info.includedirs.append(os.path.join("include", "libelf")) diff --git a/recipes/libelf/all/test_package/CMakeLists.txt b/recipes/libelf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..715677f6fc466 --- /dev/null +++ b/recipes/libelf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libelf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libelf::libelf) diff --git a/recipes/libelf/all/test_package/conanfile.py b/recipes/libelf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libelf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libelf/all/test_package/test_package.c b/recipes/libelf/all/test_package/test_package.c new file mode 100644 index 0000000000000..2cf36fdf9b081 --- /dev/null +++ b/recipes/libelf/all/test_package/test_package.c @@ -0,0 +1,114 @@ +#include +#include + +#include +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "libelf.h" + +int main(int argc , char **argv) { + int fd; + Elf *e; + const char *k; + Elf_Kind ek; + + if (elf_version(EV_CURRENT) == EV_NONE) { + printf("ELF library initialization failed: %s\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + +#ifdef _WIN32 + return EXIT_SUCCESS; +#endif + +#ifdef _MSVC_VER + if ((fd = _open(argv[0], _O_RDONLY , 0)) < 0) { +#else + if ((fd = open(argv[0], O_RDONLY , 0)) < 0) { +#endif + printf("open %s failed\n", argv [0]); + return EXIT_FAILURE; + } + + if(ELF_C_NULL != 0) + { + printf("ELF_C_NULL has wrong value: %d\n", ELF_C_NULL); + return EXIT_FAILURE; + } + if(ELF_C_READ != 1) + { + printf("ELF_C_READ has wrong value: %d\n", ELF_C_READ); + return EXIT_FAILURE; + } + if(ELF_C_WRITE != 2) + { + printf("ELF_C_WRITE has wrong value: %d\n", ELF_C_WRITE); + return EXIT_FAILURE; + } + if(ELF_C_CLR != 3) + { + printf("ELF_C_CLR has wrong value: %d\n", ELF_C_CLR); + return EXIT_FAILURE; + } + if(ELF_C_SET != 4) + { + printf("ELF_C_SET has wrong value: %d\n", ELF_C_SET); + return EXIT_FAILURE; + } + if(ELF_C_FDDONE != 5) + { + printf("ELF_C_FDDONE has wrong value: %d\n", ELF_C_FDDONE); + return EXIT_FAILURE; + } + if(ELF_C_FDREAD != 6) + { + printf("ELF_C_FDREAD has wrong value: %d\n", ELF_C_FDREAD); + return EXIT_FAILURE; + } + if(ELF_C_RDWR != 7) + { + printf("ELF_C_RDWR has wrong value: %d\n", ELF_C_RDWR); + return EXIT_FAILURE; + } + if(ELF_C_NUM != 8) + { + printf("ELF_C_NUM has wrong value: %d\n", ELF_C_NUM); + return EXIT_FAILURE; + } + + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + printf("elf_begin () failed: %s.\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + + ek = elf_kind(e); + + switch (ek) { + case ELF_K_AR: + k = "ar(1) archive"; + break; + case ELF_K_ELF: + k = "elf object"; + break; + case ELF_K_NONE: + k = "data"; + break; + default: + k = "unrecognized"; + } + + printf("%s: %s\n", argv[0], k); + elf_end(e); + +#ifdef _MSVC_VER + _close(fd); +#else + close(fd); +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/libelf/all/test_v1_package/CMakeLists.txt b/recipes/libelf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libelf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libelf/all/test_v1_package/conanfile.py b/recipes/libelf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libelf/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libelf/config.yml b/recipes/libelf/config.yml new file mode 100644 index 0000000000000..f55c7c32d1dc8 --- /dev/null +++ b/recipes/libelf/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.13": + folder: all diff --git a/recipes/libelfin/all/CMakeLists.txt b/recipes/libelfin/all/CMakeLists.txt new file mode 100644 index 0000000000000..eb2aa34b81ac8 --- /dev/null +++ b/recipes/libelfin/all/CMakeLists.txt @@ -0,0 +1,77 @@ +cmake_minimum_required(VERSION 3.1) +project(libelfin CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(PythonInterp 3 REQUIRED) + +file(GLOB_RECURSE elf_sources source_subfolder/elf/*.cc) +set(elf_headers + source_subfolder/elf/common.hh + source_subfolder/elf/data.hh + source_subfolder/elf/elf++.hh) +file(GLOB_RECURSE dwarf_sources source_subfolder/dwarf/*.cc) +set(dwarf_headers + source_subfolder/dwarf/data.hh + source_subfolder/dwarf/dwarf++.hh + source_subfolder/dwarf/small_vector.hh) + +add_custom_command( + OUTPUT source_subfolder/elf/to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '// Automatically generated' > to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '// DO NOT EDIT' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '\#include \"data.hh\"' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '\#include \"to_hex.hh\"' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo 'ELFPP_BEGIN_NAMESPACE' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc + COMMAND ${PYTHON_EXECUTABLE} enum-print.py -u --hex --no-type --mask shf --mask pf -x loos -x hios -x loproc -x hiproc < data.hh >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo 'ELFPP_END_NAMESPACE' >> to_string.cc + DEPENDS source_subfolder/elf/enum-print.py source_subfolder/elf/data.hh + WORKING_DIRECTORY source_subfolder/elf) + +add_custom_command( + OUTPUT source_subfolder/dwarf/to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '// Automatically generated' > to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '// DO NOT EDIT' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo '\#include \"internal.hh\"' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo 'DWARFPP_BEGIN_NAMESPACE' >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc + COMMAND ${PYTHON_EXECUTABLE} ../elf/enum-print.py < dwarf++.hh >> to_string.cc + COMMAND ${PYTHON_EXECUTABLE} ../elf/enum-print.py -s _ -u --hex -x hi_user -x lo_user < data.hh >> to_string.cc + COMMAND ${CMAKE_COMMAND} -E echo 'DWARFPP_END_NAMESPACE' >> to_string.cc + DEPENDS source_subfolder/elf/enum-print.py source_subfolder/dwarf/data.hh + WORKING_DIRECTORY source_subfolder/dwarf) + +add_library(elf++ ${elf_sources} source_subfolder/elf/to_string.cc) +set_target_properties(elf++ PROPERTIES + PUBLIC_HEADER "${elf_headers}" + VERSION ${CONAN_PACKAGE_VERSION}) + +add_library(dwarf++ ${dwarf_sources} source_subfolder/dwarf/to_string.cc) +set_target_properties(dwarf++ PROPERTIES + PUBLIC_HEADER "${dwarf_headers}" + VERSION ${CONAN_PACKAGE_VERSION}) + +include(GNUInstallDirs) +install(TARGETS elf++ + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelfin/elf) +install(TARGETS dwarf++ + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelfin/dwarf) + +install(FILES source_subfolder/LICENSE DESTINATION licenses) diff --git a/recipes/libelfin/all/conandata.yml b/recipes/libelfin/all/conandata.yml new file mode 100644 index 0000000000000..e1b6341e83185 --- /dev/null +++ b/recipes/libelfin/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.3": + url: "https://github.com/aclements/libelfin/archive/v0.3.tar.gz" + sha256: "c338942b967582922b3514b54b93175ca9051a9668db92dd8ef619824d443ac7" +patches: + "0.3": + - patch_file: "patches/commit-9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch" + base_path: "source_subfolder" + - patch_file: "patches/const-fix.patch" + base_path: "source_subfolder" + # patch_source: https://github.com/aclements/libelfin/pull/54 diff --git a/recipes/libelfin/all/conanfile.py b/recipes/libelfin/all/conanfile.py new file mode 100644 index 0000000000000..d53acbbfd0abe --- /dev/null +++ b/recipes/libelfin/all/conanfile.py @@ -0,0 +1,64 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class LibelfinConan(ConanFile): + name = "libelfin" + description = "C++11 library for reading ELF binaries and DWARFv4 debug information" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aclements/libelfin" + license = "MIT" + topics = ("conan", "elf", "dwarf", "libelfin") + + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + exports_sources = "CMakeLists.txt", "patches/*" + generators = "cmake" + + _cmake = None + _source_subfolder = "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("libelfin doesn't support compiler: {} on OS: {}.". + format(self.settings.compiler, self.settings.os)) + if self.options.shared: + del self.options.fPIC + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.components["libelf++"].names["pkg_config"] = "libelf++" + self.cpp_info.components["libelf++"].libs = ["elf++"] + self.cpp_info.components["libdwarf++"].names["pkg_config"] = "libdwarf++" + self.cpp_info.components["libdwarf++"].libs = ["dwarf++"] + self.cpp_info.components["libdwarf++"].requires = ["libelf++"] diff --git a/recipes/libelfin/all/patches/commit-9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch b/recipes/libelfin/all/patches/commit-9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch new file mode 100644 index 0000000000000..5a53079e6b0a6 --- /dev/null +++ b/recipes/libelfin/all/patches/commit-9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch @@ -0,0 +1,173 @@ +# +# Updates v0.3 to the commit 9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2: +# 9d0db16 fix data initialization of elf segment +# 74f1116 ignore dwarf extensions of gcc in the line table +# ac45a09 Added #include to files that use errno. +# 4a678c7 Don't mandate that compilation units need a DW_AT_comp_dir for line table parsing +# 85812f6 Fix typos +# +diff --git a/dwarf/abbrev.cc b/dwarf/abbrev.cc +index c780b8e..f77dc0c 100644 +--- a/dwarf/abbrev.cc ++++ b/dwarf/abbrev.cc +@@ -133,6 +133,10 @@ resolve_type(DW_AT name, DW_FORM form) + case DW_AT::ranges: + return value::type::rangelist; + ++ case DW_AT::lo_user...DW_AT::hi_user: ++ //HACK: ignore vendor extensions ++ return value::type::invalid; ++ + default: + throw format_error("DW_FORM_sec_offset not expected for attribute " + + to_string(name)); +diff --git a/dwarf/dwarf.cc b/dwarf/dwarf.cc +index fe9b947..2465eef 100644 +--- a/dwarf/dwarf.cc ++++ b/dwarf/dwarf.cc +@@ -289,8 +289,7 @@ compilation_unit::get_line_table() const + { + if (!m->lt.valid()) { + const die &d = root(); +- if (!d.has(DW_AT::stmt_list) || !d.has(DW_AT::name) || +- !d.has(DW_AT::comp_dir)) ++ if (!d.has(DW_AT::stmt_list) || !d.has(DW_AT::name)) + goto done; + + shared_ptr
sec; +@@ -300,8 +299,10 @@ compilation_unit::get_line_table() const + goto done; + } + ++ auto comp_dir = d.has(DW_AT::comp_dir) ? at_comp_dir(d) : ""; ++ + m->lt = line_table(sec, d[DW_AT::stmt_list].as_sec_offset(), +- m->subsec->addr_size, at_comp_dir(d), ++ m->subsec->addr_size, comp_dir, + at_name(d)); + } + done: +diff --git a/elf/elf++.hh b/elf/elf++.hh +index 562d1de..ee59ed0 100644 +--- a/elf/elf++.hh ++++ b/elf/elf++.hh +@@ -48,7 +48,7 @@ public: + * section data. Hence, callers must ensure that the loader passed to + * this file remains live as long as any such pointer is in use. + * Keeping any object that can return such a pointer live is +- * sufficieint to keep the loader live. ++ * sufficient to keep the loader live. + */ + class elf + { +@@ -204,7 +204,7 @@ public: + + /** + * Return the in-memory size of this segment in bytes. +- * Bytes between file_size() and mem_size() are implicity zeroes. ++ * Bytes between file_size() and mem_size() are implicitly zeroes. + */ + size_t mem_size() const; + +diff --git a/elf/elf.cc b/elf/elf.cc +index 587329f..61172ac 100644 +--- a/elf/elf.cc ++++ b/elf/elf.cc +@@ -167,12 +167,10 @@ elf::get_segment(unsigned index) const + + struct segment::impl { + impl(const elf &f) +- : f(f) { } ++ : f(f), data(nullptr) { } + + const elf f; + Phdr<> hdr; +- // const char *name; +- // size_t name_len; + const void *data; + }; + +diff --git a/elf/mmap_loader.cc b/elf/mmap_loader.cc +index 69d8acb..875d7bd 100644 +--- a/elf/mmap_loader.cc ++++ b/elf/mmap_loader.cc +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + +diff --git a/examples/dump-lines.cc b/examples/dump-lines.cc +index ec58be1..9fed1fa 100644 +--- a/examples/dump-lines.cc ++++ b/examples/dump-lines.cc +@@ -1,6 +1,7 @@ + #include "elf++.hh" + #include "dwarf++.hh" + ++#include + #include + #include + +diff --git a/examples/dump-sections.cc b/examples/dump-sections.cc +index 12e7569..22526ec 100644 +--- a/examples/dump-sections.cc ++++ b/examples/dump-sections.cc +@@ -2,6 +2,7 @@ + + #include + #include ++#include + #include + #include + +diff --git a/examples/dump-segments.cc b/examples/dump-segments.cc +index f9e07d3..4c6319f 100644 +--- a/examples/dump-segments.cc ++++ b/examples/dump-segments.cc +@@ -2,6 +2,7 @@ + + #include + #include ++#include + #include + #include + +diff --git a/examples/dump-syms.cc b/examples/dump-syms.cc +index e7c2c3b..af7f484 100644 +--- a/examples/dump-syms.cc ++++ b/examples/dump-syms.cc +@@ -2,6 +2,7 @@ + + #include + #include ++#include + #include + #include + +diff --git a/examples/dump-tree.cc b/examples/dump-tree.cc +index 57d2b70..8bf2a63 100644 +--- a/examples/dump-tree.cc ++++ b/examples/dump-tree.cc +@@ -1,6 +1,7 @@ + #include "elf++.hh" + #include "dwarf++.hh" + ++#include + #include + #include + +diff --git a/examples/find-pc.cc b/examples/find-pc.cc +index dc40b85..2e324fc 100644 +--- a/examples/find-pc.cc ++++ b/examples/find-pc.cc +@@ -1,6 +1,7 @@ + #include "elf++.hh" + #include "dwarf++.hh" + ++#include + #include + #include + #include diff --git a/recipes/libelfin/all/patches/const-fix.patch b/recipes/libelfin/all/patches/const-fix.patch new file mode 100644 index 0000000000000..08953c915ef21 --- /dev/null +++ b/recipes/libelfin/all/patches/const-fix.patch @@ -0,0 +1,19 @@ +commit 8d00031176c2025e53336992c1575d73b4f66b2b (smertig/fix_wrong_const) +Author: Smertig +Date: Sun Sep 6 20:19:00 2020 +0300 + + Remove const qualifier from setter + +diff --git a/elf/data.hh b/elf/data.hh +index ed5c7a1..4a60944 100644 +--- a/elf/data.hh ++++ b/elf/data.hh +@@ -553,7 +553,7 @@ struct Sym + return (stb)(info >> 4); + } + +- void set_binding(stb v) const ++ void set_binding(stb v) + { + info = (info & 0xF) | ((unsigned char)v << 4); + } diff --git a/recipes/libelfin/all/test_package/CMakeLists.txt b/recipes/libelfin/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..36df85d833b7f --- /dev/null +++ b/recipes/libelfin/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON) diff --git a/recipes/libelfin/all/test_package/Makefile b/recipes/libelfin/all/test_package/Makefile new file mode 100644 index 0000000000000..ccf962b53e8bc --- /dev/null +++ b/recipes/libelfin/all/test_package/Makefile @@ -0,0 +1,5 @@ +# 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 new file mode 100644 index 0000000000000..e2a48eb337ec0 --- /dev/null +++ b/recipes/libelfin/all/test_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" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self.settings): + return + bin_path = os.path.join("bin", "test_package") + elf_path = os.path.join(self.source_folder, "hello") + self.run("{} {}".format(bin_path, elf_path), run_environment=True) diff --git a/recipes/libelfin/all/test_package/hello b/recipes/libelfin/all/test_package/hello new file mode 100644 index 0000000000000000000000000000000000000000..7202f6f7d512e8c01b1232fcd5add1c235e17609 GIT binary patch literal 8468 zcmeI2u}T9$5QgW>MG|eavK_3FX3-GrEfkAjC8WOO781xAxLeT9djty~z{iN@8S+lf zf9IyM5p0Bi;Ady&ANJtu_I6%wCbvnFNQ?vNNV9uQdt)n3v~|X!<_x4OY3rk0r#Ce;!|&=XKC(e!S0iPR011!)36KB@kN^pg011!)36KB@{AU7pOP#LE zRemH73$OP+JS}st*Hz_<*~*tXau-+S{Bk7Xsznvbkj=ye{~W~SS;)lA*G1tU!*3WI zTQmMGH1GYG5wJIZ%m>7XBLJsXKwk$2W(BmJ6TlYH%p2HxWMi3 HfA0GNLVqe< literal 0 HcmV?d00001 diff --git a/recipes/libelfin/all/test_package/hello.asm b/recipes/libelfin/all/test_package/hello.asm new file mode 100644 index 0000000000000..0cc26b9d3a4a8 --- /dev/null +++ b/recipes/libelfin/all/test_package/hello.asm @@ -0,0 +1,16 @@ + 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 new file mode 100644 index 0000000000000..41843df23299f --- /dev/null +++ b/recipes/libelfin/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#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'; + + return 0; +} diff --git a/recipes/libelfin/config.yml b/recipes/libelfin/config.yml new file mode 100644 index 0000000000000..1d91bf4e0169c --- /dev/null +++ b/recipes/libelfin/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3": + folder: all diff --git a/recipes/libepoxy/all/conandata.yml b/recipes/libepoxy/all/conandata.yml new file mode 100644 index 0000000000000..89156c34887db --- /dev/null +++ b/recipes/libepoxy/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.5.10": + url: "https://github.com/anholt/libepoxy/archive/1.5.10.tar.gz" + sha256: "a7ced37f4102b745ac86d6a70a9da399cc139ff168ba6b8002b4d8d43c900c15" + "1.5.9": + url: "https://github.com/anholt/libepoxy/archive/1.5.9.tar.gz" + sha256: "ee8048d20179a2e86156ac842ddb6428732d9cd7a2cfc2eca905165bf24887a2" + "1.5.8": + url: "https://github.com/anholt/libepoxy/archive/1.5.8.tar.gz" + sha256: "0cd80cb040b75cbe77fadd45c48282ebab82d845c597ce11ee5e8cb9c1efeabb" +patches: + "1.5.9": + - patch_file: "patches/0001-fix-for-building-on-non-English-locale.patch" + "1.5.8": + - patch_file: "patches/0001-fix-for-building-on-non-English-locale.patch" diff --git a/recipes/libepoxy/all/conanfile.py b/recipes/libepoxy/all/conanfile.py new file mode 100644 index 0000000000000..c8c1d778cd360 --- /dev/null +++ b/recipes/libepoxy/all/conanfile.py @@ -0,0 +1,119 @@ +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.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 EpoxyConan(ConanFile): + name = "libepoxy" + description = "libepoxy is a library for handling OpenGL function pointer management" + topics = ("opengl",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/anholt/libepoxy" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "glx": [True, False], + "egl": [True, False], + "x11": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "glx": True, + "egl": True, + "x11": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.shared = True + if self.settings.os != "Linux": + del self.options.glx + del self.options.egl + del self.options.x11 + + 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("opengl/system") + if self.settings.os == "Linux": + if self.options.x11: + self.requires("xorg/system") + if self.options.egl: + self.requires("egl/system") + + def validate(self): + if self.settings.os == "Windows" and not self.options.shared: + raise ConanInvalidConfiguration("Static builds on Windows are not supported") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["docs"] = "false" + tc.project_options["tests"] = "false" + for opt in ["glx", "egl"]: + tc.project_options[opt] = "yes" if self.options.get_safe(opt, False) else "no" + for opt in ["x11"]: + tc.project_options[opt] = "true" if self.options.get_safe(opt, False) else "false" + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["epoxy"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] + self.cpp_info.set_property("pkg_config_name", "epoxy") + pkgconfig_variables = { + 'epoxy_has_glx': '1' if self.options.get_safe("glx") else '0', + 'epoxy_has_egl': '1' if self.options.get_safe("egl") else '0', + 'epoxy_has_wgl': '1' if self.settings.os == "Windows" else '0', + } + self.cpp_info.set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items()), + ) diff --git a/recipes/libepoxy/all/patches/0001-fix-for-building-on-non-English-locale.patch b/recipes/libepoxy/all/patches/0001-fix-for-building-on-non-English-locale.patch new file mode 100644 index 0000000000000..d46502b06b34f --- /dev/null +++ b/recipes/libepoxy/all/patches/0001-fix-for-building-on-non-English-locale.patch @@ -0,0 +1,23 @@ +Revision: a07b9b33832df2261ace6b84e6a041d14e390a75 +Author: Seungha Yang +Date: 2021/10/12 1:41:41 +Message: +meson: Fix for building on non-English locale + +Specify utf-8 encoding to fix building on non-English locale + +diff --git a/meson.build b/meson.build +index e0228d1..182a3c9 100644 +--- a/meson.build ++++ b/meson.build +@@ -95,6 +95,7 @@ if cc.get_id() == 'msvc' + '-we4053', # an expression of type void was used as an operand + '-we4071', # no function prototype given + '-we4819', # the file contains a character that cannot be represented in the current code page ++ '/utf-8', # Set the input and exec encoding to utf-8, like is the default with GCC + ] + elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' + test_cflags = [ +-- +2.35.1.windows.2 + diff --git a/recipes/libepoxy/all/test_package/CMakeLists.txt b/recipes/libepoxy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5f3fa704d559 --- /dev/null +++ b/recipes/libepoxy/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libepoxy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libepoxy::libepoxy) diff --git a/recipes/libepoxy/all/test_package/conanfile.py b/recipes/libepoxy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/libepoxy/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, run=True) + + 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/libepoxy/all/test_package/test_package.c b/recipes/libepoxy/all/test_package/test_package.c new file mode 100644 index 0000000000000..43f7a05535142 --- /dev/null +++ b/recipes/libepoxy/all/test_package/test_package.c @@ -0,0 +1,90 @@ +/* + * Copyright © 2018 Broadcom + * + * 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 (including the next + * paragraph) 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 "epoxy/gl.h" + +GLenum mock_enum; +const char *mock_gl_version; +const char *mock_glsl_version; + +static const GLubyte * EPOXY_CALLSPEC override_glGetString(GLenum name) +{ + switch (name) { + case GL_VERSION: + return (GLubyte *)mock_gl_version; + case GL_SHADING_LANGUAGE_VERSION: + return (GLubyte *)mock_glsl_version; + default: + assert(!"unexpected glGetString() enum"); + return 0; + } +} + +static bool +test_version(const char *gl_string, int gl_version, + const char *glsl_string, int glsl_version) +{ + int epoxy_version; + + mock_gl_version = gl_string; + mock_glsl_version = glsl_string; + + epoxy_version = epoxy_gl_version(); + if (epoxy_version != gl_version) { + fprintf(stderr, + "glGetString(GL_VERSION) = \"%s\" returned epoxy_gl_version() " + "%d instead of %d\n", gl_string, epoxy_version, gl_version); + return false; + } + + + epoxy_version = epoxy_glsl_version(); + if (epoxy_version != glsl_version) { + fprintf(stderr, + "glGetString() = \"%s\" returned epoxy_glsl_version() " + "%d instead of %d\n", glsl_string, epoxy_version, glsl_version); + return false; + } + + return true; +} + +int +main(int argc, char **argv) +{ + epoxy_glGetString = override_glGetString; + + if(!test_version("3.0 Mesa 13.0.6", 30, + "1.30", 130)) + return -1; + if(!test_version("OpenGL ES 3.2 Mesa 18.3.0-devel", 32, + "OpenGL ES GLSL ES 3.20", 320)) + return -1; + if(!test_version("4.5.0 NVIDIA 384.130", 45, + "4.50", 450)) + return -1; + + return 0; +} diff --git a/recipes/libepoxy/all/test_v1_package/CMakeLists.txt b/recipes/libepoxy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libepoxy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libepoxy/all/test_v1_package/conanfile.py b/recipes/libepoxy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libepoxy/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/libepoxy/config.yml b/recipes/libepoxy/config.yml new file mode 100644 index 0000000000000..44f12cc4cf91c --- /dev/null +++ b/recipes/libepoxy/config.yml @@ -0,0 +1,7 @@ +versions: + "1.5.10": + folder: all + "1.5.9": + folder: all + "1.5.8": + folder: all diff --git a/recipes/libest/all/conandata.yml b/recipes/libest/all/conandata.yml new file mode 100644 index 0000000000000..b9d0db8b23c2b --- /dev/null +++ b/recipes/libest/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.2.0": + url: "https://github.com/cisco/libest/archive/r3.2.0.tar.gz" + sha256: "324b3a2b16cd14ea4234d75fa90f08b29509bac9cd3795c44268e22f906ee0ad" +patches: + "3.2.0": + - patch_file: "patches/0001-examples-are-broken-don-t-build-them.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-add-extern.patch" + base_path: "source_subfolder" diff --git a/recipes/libest/all/conanfile.py b/recipes/libest/all/conanfile.py new file mode 100644 index 0000000000000..c3b2b423c3d32 --- /dev/null +++ b/recipes/libest/all/conanfile.py @@ -0,0 +1,80 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + + +class LibEstConan(ConanFile): + name = "libest" + license = "BSD-3-Clause" + description = "EST is used for secure certificate enrollment" + topics = ("conan", "EST", "RFC 7030", "certificate enrollment") + homepage = "https://github.com/cisco/libest" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + exports_sources = "patches/**" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.os in ("Windows", "Macos"): + raise ConanInvalidConfiguration( + "Platform is currently not supported by this recipe") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("openssl/1.1.1q") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-r" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_autotools(self): + if not self._autotools: + self._autotools = AutoToolsBuildEnvironment(self) + # TODO: + # - Static only build: https://github.com/cisco/libest/blob/70824ddc09bee661329b9416082d88566efefb32/intro.txt#L140 + # - Release build: https://github.com/cisco/libest/blob/70824ddc09bee661329b9416082d88566efefb32/intro.txt#L253 + args = [] + if self.options.shared: + args.extend(["--enable-shared", "--disable-static"]) + else: + args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(args=args) + return self._autotools + + 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() + + def package(self): + self.copy("*LICENSE", src=self._source_subfolder, dst="licenses") + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.install() + os.unlink(os.path.join(self.package_folder, "lib", "libest.la")) + + def package_info(self): + self.cpp_info.libs = ["est"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl", "pthread"] diff --git a/recipes/libest/all/patches/0001-examples-are-broken-don-t-build-them.patch b/recipes/libest/all/patches/0001-examples-are-broken-don-t-build-them.patch new file mode 100644 index 0000000000000..7a9d8dc8bf706 --- /dev/null +++ b/recipes/libest/all/patches/0001-examples-are-broken-don-t-build-them.patch @@ -0,0 +1,27 @@ +--- Makefile.am ++++ Makefile.am +@@ -1,9 +1,9 @@ + ACLOCAL_AMFLAGS = -I m4 + + if ENABLE_CLIENT_ONLY +-SUBDIRS = safe_c_stub src java/jni example/client example/client-simple example/client-brski ++SUBDIRS = safe_c_stub src + else +-SUBDIRS = safe_c_stub src java/jni example/client example/client-simple example/server example/proxy example/client-brski ++SUBDIRS = safe_c_stub src + endif + + EXTRA_DIST = autogen.sh example/util LICENSE README.brski $(srcdir)/build.gradle $(srcdir)/example/build_examples.gradle +--- Makefile.in ++++ Makefile.in +@@ -334,8 +334,8 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + ACLOCAL_AMFLAGS = -I m4 +-@ENABLE_CLIENT_ONLY_FALSE@SUBDIRS = safe_c_stub src java/jni example/client example/client-simple example/server example/proxy example/client-brski +-@ENABLE_CLIENT_ONLY_TRUE@SUBDIRS = safe_c_stub src java/jni example/client example/client-simple example/client-brski ++@ENABLE_CLIENT_ONLY_FALSE@SUBDIRS = safe_c_stub src ++@ENABLE_CLIENT_ONLY_TRUE@SUBDIRS = safe_c_stub src + EXTRA_DIST = autogen.sh example/util LICENSE README.brski $(srcdir)/build.gradle $(srcdir)/example/build_examples.gradle + all: all-recursive + diff --git a/recipes/libest/all/patches/0002-add-extern.patch b/recipes/libest/all/patches/0002-add-extern.patch new file mode 100644 index 0000000000000..f33a51e7c7b76 --- /dev/null +++ b/recipes/libest/all/patches/0002-add-extern.patch @@ -0,0 +1,13 @@ +diff --git a/src/est/est_locl.h b/src/est/est_locl.h +index 62dcbea..b16f62d 100644 +--- a/src/est/est_locl.h ++++ b/src/est/est_locl.h +@@ -590,7 +590,7 @@ typedef struct est_oid_list { + /* + * Index used to link the EST Ctx into the SSL structures + */ +-int e_ctx_ssl_exdata_index; ++extern int e_ctx_ssl_exdata_index; + + LIBEST_TEST_API void est_log (EST_LOG_LEVEL lvl, char *format, ...); + LIBEST_TEST_API void est_log_backtrace (void); diff --git a/recipes/libest/all/test_package/CMakeLists.txt b/recipes/libest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..48b855b8a30aa --- /dev/null +++ b/recipes/libest/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.c) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/libest/all/test_package/conanfile.py b/recipes/libest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f2b070b59136 --- /dev/null +++ b/recipes/libest/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class CAresTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libest/all/test_package/example.c b/recipes/libest/all/test_package/example.c new file mode 100644 index 0000000000000..5ad30f850c8a9 --- /dev/null +++ b/recipes/libest/all/test_package/example.c @@ -0,0 +1,123 @@ +#include +#include + +unsigned char *BIO_copy_data(BIO *out, int *data_lenp) { + unsigned char *data, *tdata; + int data_len; + + data_len = BIO_get_mem_data(out, &tdata); + data = malloc(data_len+1); + if (data) { + memcpy(data, tdata, data_len); + data[data_len]='\0'; // Make sure it's \0 terminated, in case used as string + if (data_lenp) { + *data_lenp = data_len; + } + } else { + printf("\nmalloc failed\n"); + } + return data; +} + + +#define EST_PRIVATE_KEY_ENC EVP_aes_128_cbc() + +char *generate_private_RSA_key (int key_size, pem_password_cb *cb) +{ + char *key_data = NULL; + + RSA *rsa = RSA_new(); + if (!rsa) { + return NULL; + } + BIGNUM *bn = BN_new(); + if (!bn) { + RSA_free(rsa); + return NULL; + } + + BN_set_word(bn, 0x10001); + RSA_generate_key_ex(rsa, key_size, bn, NULL); + + do { + BIO *out = BIO_new(BIO_s_mem()); + if (!out) { + break; + } + PEM_write_bio_RSAPrivateKey(out, rsa, cb ? EST_PRIVATE_KEY_ENC : NULL, NULL, 0, cb, NULL); + key_data = (char *)BIO_copy_data(out, NULL); + BIO_free(out); + if (key_data && !key_data[0]) { + // happens if passphrase entered via STDIN does not verify or has less than 4 characters + free(key_data); + key_data = NULL; + } + } while (cb && !key_data); + + RSA_free(rsa); + BN_free(bn); + return (key_data); +} + +EVP_PKEY *load_private_key (const unsigned char *key, int key_len, int format, pem_password_cb *cb) +{ + BIO *in = NULL; + EVP_PKEY *pkey = NULL; + + if (key == NULL) { + printf("\nNo key data provided\n"); + return NULL; + } + + in = BIO_new_mem_buf((unsigned char *)key, key_len); + if (in == NULL) { + printf("\nUnable to open the provided key buffer\n"); + return (NULL); + } + + switch (format) { + case EST_FORMAT_PEM: + pkey = PEM_read_bio_PrivateKey(in, NULL, cb, NULL); + break; + case EST_FORMAT_DER: + pkey = d2i_PrivateKey_bio(in, NULL); + break; + default: + printf("\nInvalid key format\n"); + break; + } + BIO_free(in); + + return (pkey); +} + +#define load_clear_private_key_PEM(key) load_private_key((unsigned char*)(key),strlen(key),EST_FORMAT_PEM, NULL) + +int main(void) +{ + /* + * Initialize the library, including OpenSSL + */ + est_apps_startup(); + + char *key_data; + EVP_PKEY *key; + + key_data = generate_private_RSA_key(2048, NULL /* no password_cb */); + key = load_clear_private_key_PEM(key_data); + + if (!key) + { + printf("\nUnable to load newly created key from PEM file\n"); + exit(1); + } + memset(key_data, 0, strlen(key_data)); + free(key_data); + key_data = NULL; + EVP_PKEY_free(key); + + est_apps_shutdown(); + + printf("\n"); + return 0; +} diff --git a/recipes/libest/config.yml b/recipes/libest/config.yml new file mode 100644 index 0000000000000..b230719ccee73 --- /dev/null +++ b/recipes/libest/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2.0": + folder: all diff --git a/recipes/libev/all/CMakeLists.txt b/recipes/libev/all/CMakeLists.txt new file mode 100644 index 0000000000000..e3473fd877dd1 --- /dev/null +++ b/recipes/libev/all/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.14) +project(ev C) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +set(EV_PUBLIC_HEADERS + "${EV_SRC_DIR}/ev.h" + "${EV_SRC_DIR}/config.h") +add_library(ev "${EV_SRC_DIR}/ev.c") +target_link_libraries(ev PUBLIC ws2_32) +target_compile_definitions(ev PRIVATE HAVE_CONFIG_H=1) +target_include_directories(ev PUBLIC ${EV_SRC_DIR}) + +set_target_properties(ev PROPERTIES PUBLIC_HEADER "${EV_PUBLIC_HEADERS}") +include(GNUInstallDirs) + +install(TARGETS ev + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/libev/all/conandata.yml b/recipes/libev/all/conandata.yml new file mode 100644 index 0000000000000..4c0f72ea1b262 --- /dev/null +++ b/recipes/libev/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.33": + sha256: 507eb7b8d1015fbec5b935f34ebed15bf346bed04a11ab82b8eee848c4205aea + url: http://dist.schmorp.de/libev/Attic/libev-4.33.tar.gz + "4.27": + sha256: 2d5526fc8da4f072dd5c73e18fbb1666f5ef8ed78b73bba12e195cfdd810344e + url: http://dist.schmorp.de/libev/Attic/libev-4.27.tar.gz + "4.25": + sha256: 78757e1c27778d2f3795251d9fe09715d51ce0422416da4abb34af3929c02589 + url: http://dist.schmorp.de/libev/Attic/libev-4.25.tar.gz diff --git a/recipes/libev/all/conanfile.py b/recipes/libev/all/conanfile.py new file mode 100644 index 0000000000000..87c991f808229 --- /dev/null +++ b/recipes/libev/all/conanfile.py @@ -0,0 +1,109 @@ +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 copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class LibevConan(ConanFile): + name = "libev" + description = "A full-featured and high-performance event loop that is loosely modelled after libevent" + topics = ("event", "event-loop", "periodic-timer", "notify") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://software.schmorp.de/pkg/libev.html" + license = ["BSD-2-Clause", "GPL-2.0-or-later"] + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, dst=self.export_sources_folder) + copy(self, "config.h", self.recipe_folder, 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows" and not is_msvc(self) and self.options.shared: + # libtool: error: can't build i686-pc-mingw32 shared library unless -no-undefined is specified + raise ConanInvalidConfiguration(f"{self.ref} can't be built as shared on Windows without Visual Studio") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = CMakeToolchain(self) + tc.variables["EV_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if is_msvc(self): + base_folder = os.path.join(self.source_folder, os.pardir) + copy(self, "config.h", src=base_folder, dst=self.source_folder) + cmake = CMake(self) + cmake.configure(build_script_folder=base_folder) + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["ev"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libev/all/config.h b/recipes/libev/all/config.h new file mode 100644 index 0000000000000..083271233c6a7 --- /dev/null +++ b/recipes/libev/all/config.h @@ -0,0 +1,128 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 to use the syscall interface for clock_gettime */ +#undef HAVE_CLOCK_SYSCALL + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `epoll_ctl' function. */ +#undef HAVE_EPOLL_CTL + +/* Define to 1 if you have the `eventfd' function. */ +#undef HAVE_EVENTFD + +/* Define to 1 if the floor function is available */ +#undef HAVE_FLOOR + +/* Define to 1 if you have the `inotify_init' function. */ +#undef HAVE_INOTIFY_INIT + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `kqueue' function. */ +#undef HAVE_KQUEUE + +/* Define to 1 if you have the `rt' library (-lrt). */ +#undef HAVE_LIBRT + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + +/* Define to 1 if you have the `poll' function. */ +#undef HAVE_POLL + +/* Define to 1 if you have the header file. */ +#undef HAVE_POLL_H + +/* Define to 1 if you have the `port_create' function. */ +#undef HAVE_PORT_CREATE + +/* Define to 1 if you have the header file. */ +#undef HAVE_PORT_H + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `signalfd' function. */ +#undef HAVE_SIGNALFD + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_EPOLL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_EVENTFD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_EVENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_INOTIFY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNALFD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +#define HAVE_SELECT 1 +#define HAVE_SYS_SELECT_H 1 diff --git a/recipes/libev/all/test_package/CMakeLists.txt b/recipes/libev/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ace0979b2a703 --- /dev/null +++ b/recipes/libev/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libev REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libev::libev) diff --git a/recipes/libev/all/test_package/conanfile.py b/recipes/libev/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libev/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/libev/all/test_package/test_package.c b/recipes/libev/all/test_package/test_package.c new file mode 100644 index 0000000000000..540122465c3bc --- /dev/null +++ b/recipes/libev/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("libev ver=%d.%d\n", ev_version_major(), ev_version_minor()); + return 0; +} diff --git a/recipes/libev/all/test_v1_package/CMakeLists.txt b/recipes/libev/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libev/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libev/all/test_v1_package/conanfile.py b/recipes/libev/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libev/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/libev/config.yml b/recipes/libev/config.yml new file mode 100644 index 0000000000000..1d6221845ef91 --- /dev/null +++ b/recipes/libev/config.yml @@ -0,0 +1,7 @@ +versions: + "4.33": + folder: all + "4.27": + folder: all + "4.25": + folder: all diff --git a/recipes/libevent/all/conandata.yml b/recipes/libevent/all/conandata.yml new file mode 100644 index 0000000000000..f2a195cfe79c1 --- /dev/null +++ b/recipes/libevent/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.1.12": + url: "https://github.com/libevent/libevent/archive/release-2.1.12-stable.tar.gz" + sha256: "7180a979aaa7000e1264da484f712d403fcf7679b1e9212c4e3d09f5c93efc24" + "2.1.11": + url: "https://github.com/libevent/libevent/archive/release-2.1.11-stable.tar.gz" + sha256: "229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e" +patches: + "2.1.12": + - patch_file: patches/fix-cmake-2.1.12.patch + "2.1.11": + - patch_file: patches/fix-cmake-2.1.11.patch diff --git a/recipes/libevent/all/conanfile.py b/recipes/libevent/all/conanfile.py new file mode 100644 index 0000000000000..2d107e409da17 --- /dev/null +++ b/recipes/libevent/all/conanfile.py @@ -0,0 +1,132 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class LibeventConan(ConanFile): + name = "libevent" + description = "libevent - an event notification library" + topics = ("event", "notification", "networking", "async") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libevent/libevent" + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "disable_threads": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": True, + "disable_threads": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.options.with_openssl: + tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.cache_variables["EVENT__LIBRARY_TYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.variables["EVENT__DISABLE_DEBUG_MODE"] = self.settings.build_type == "Release" + tc.variables["EVENT__DISABLE_OPENSSL"] = not self.options.with_openssl + tc.variables["EVENT__DISABLE_THREAD_SUPPORT"] = self.options.disable_threads + tc.variables["EVENT__DISABLE_BENCHMARK"] = True + tc.variables["EVENT__DISABLE_TESTS"] = True + tc.variables["EVENT__DISABLE_REGRESS"] = True + tc.variables["EVENT__DISABLE_SAMPLES"] = True + # libevent uses static runtime (MT) for static builds by default + if is_msvc(self): + tc.variables["EVENT__MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # relocatable shared libs on macOS + replace_in_file(self, os.path.join(self.source_folder, "cmake", "AddEventLibrary.cmake"), + "INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/lib\"", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Libevent") + self.cpp_info.set_property("pkg_config_name", "libevent") # exist in libevent for historical reason + + # core + self.cpp_info.components["core"].set_property("cmake_target_name", "libevent::core") + self.cpp_info.components["core"].set_property("pkg_config_name", "libevent_core") + self.cpp_info.components["core"].libs = ["event_core"] + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.disable_threads: + self.cpp_info.components["core"].system_libs = ["pthread"] + if self.settings.os == "Windows": + self.cpp_info.components["core"].system_libs = ["ws2_32", "advapi32", "iphlpapi"] + + # extra + self.cpp_info.components["extra"].set_property("cmake_target_name", "libevent::extra") + self.cpp_info.components["extra"].set_property("pkg_config_name", "libevent_extra") + self.cpp_info.components["extra"].libs = ["event_extra"] + if self.settings.os == "Windows": + self.cpp_info.components["extra"].system_libs = ["shell32"] + self.cpp_info.components["extra"].requires = ["core"] + + # openssl + if self.options.with_openssl: + self.cpp_info.components["openssl"].set_property("cmake_target_name", "libevent::openssl") + self.cpp_info.components["openssl"].set_property("pkg_config_name", "libevent_openssl") + self.cpp_info.components["openssl"].libs = ["event_openssl"] + self.cpp_info.components["openssl"].requires = ["core", "openssl::openssl"] + + # pthreads + if self.settings.os != "Windows" and not self.options.disable_threads: + self.cpp_info.components["pthreads"].set_property("cmake_target_name", "libevent::pthreads") + self.cpp_info.components["pthreads"].set_property("pkg_config_name", "libevent_pthreads") + self.cpp_info.components["pthreads"].libs = ["event_pthreads"] + self.cpp_info.components["pthreads"].requires = ["core"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Libevent" + self.cpp_info.filenames["cmake_find_package_multi"] = "Libevent" diff --git a/recipes/libevent/all/patches/fix-cmake-2.1.11.patch b/recipes/libevent/all/patches/fix-cmake-2.1.11.patch new file mode 100644 index 0000000000000..e006cba6ff04d --- /dev/null +++ b/recipes/libevent/all/patches/fix-cmake-2.1.11.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,7 +46,7 @@ set(EVENT__LIBRARY_TYPE DEFAULT CACHE STRING + + project(libevent C) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") ++list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") + string(REGEX MATCH "SunOS" SOLARIS "${CMAKE_SYSTEM_NAME}") + + +@@ -946,7 +946,6 @@ endif() + # library exists for historical reasons; it contains the contents of + # both libevent_core and libevent_extra. You shouldn’t use it; it may + # go away in a future version of Libevent. +-add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA}) + + set(WIN32_GETOPT) + if (WIN32) +--- a/cmake/AddEventLibrary.cmake ++++ b/cmake/AddEventLibrary.cmake +@@ -127,7 +127,7 @@ macro(add_event_library LIB_NAME) + COMMAND ${CMAKE_COMMAND} -E create_symlink + "$" + "${LIB_LINK_NAME}" +- WORKING_DIRECTORY "lib") ++ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + endif() + + list(APPEND LIBEVENT_SHARED_LIBRARIES "${LIB_NAME}_shared") +@@ -145,7 +145,7 @@ macro(add_event_library LIB_NAME) + EXPORT LibeventTargets + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT lib + PUBLIC_HEADER DESTINATION "include/event2" + COMPONENT dev + ) diff --git a/recipes/libevent/all/patches/fix-cmake-2.1.12.patch b/recipes/libevent/all/patches/fix-cmake-2.1.12.patch new file mode 100644 index 0000000000000..e6fa0d8f20609 --- /dev/null +++ b/recipes/libevent/all/patches/fix-cmake-2.1.12.patch @@ -0,0 +1,41 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -970,16 +970,15 @@ endif() + # library exists for historical reasons; it contains the contents of + # both libevent_core and libevent_extra. You shouldn’t use it; it may + # go away in a future version of Libevent. +-add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA}) + + set(WIN32_GETOPT) + if (WIN32) + set(_TMPLIBS) + if (${EVENT_LIBRARY_STATIC}) +- list(APPEND _TMPLIBS event_core_static event_static) ++ list(APPEND _TMPLIBS event_core_static) + endif() + if (${EVENT_LIBRARY_SHARED}) +- list(APPEND _TMPLIBS event_core_shared event_shared) ++ list(APPEND _TMPLIBS event_core_shared) + endif() + foreach(lib ${_TMPLIBS}) + target_link_libraries(${lib} iphlpapi) +--- a/cmake/AddEventLibrary.cmake ++++ b/cmake/AddEventLibrary.cmake +@@ -42,7 +42,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + install(TARGETS "${LIB_NAME}_${TYPE}" + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT lib + COMPONENT dev + ) + else() +@@ -69,7 +69,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + EXPORT LibeventTargets-${TYPE} + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT lib + COMPONENT dev + ) + endif() diff --git a/recipes/libevent/all/test_package/CMakeLists.txt b/recipes/libevent/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dc7570c75d1b5 --- /dev/null +++ b/recipes/libevent/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Libevent REQUIRED core CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core) diff --git a/recipes/libevent/all/test_package/conanfile.py b/recipes/libevent/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libevent/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libevent/all/test_package/test_package.c b/recipes/libevent/all/test_package/test_package.c new file mode 100644 index 0000000000000..e564e1b809cf4 --- /dev/null +++ b/recipes/libevent/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#ifndef _WIN32 +#include +# ifdef _XOPEN_SOURCE_EXTENDED +# include +# endif +#include +#endif + +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) +{ + struct event_base *base; + const char* version = event_get_version(); + + base = event_base_new(); + if (!base) { + fprintf(stderr, "Could not initialize libevent!\n"); + return 1; + } + + event_base_free(base); + + printf("Version %s\n", version); + printf("done\n"); + return 0; +} diff --git a/recipes/libevent/all/test_v1_package/CMakeLists.txt b/recipes/libevent/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libevent/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libevent/all/test_v1_package/conanfile.py b/recipes/libevent/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libevent/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libevent/config.yml b/recipes/libevent/config.yml new file mode 100644 index 0000000000000..479e85bbe42a5 --- /dev/null +++ b/recipes/libevent/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.12": + folder: all + "2.1.11": + folder: all diff --git a/recipes/libexif/all/conandata.yml b/recipes/libexif/all/conandata.yml new file mode 100644 index 0000000000000..32d97fe499da7 --- /dev/null +++ b/recipes/libexif/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.6.24": + url: "https://github.com/libexif/libexif/releases/download/v0.6.24/libexif-0.6.24.tar.bz2" + sha256: "d47564c433b733d83b6704c70477e0a4067811d184ec565258ac563d8223f6ae" + "0.6.23": + url: "https://github.com/libexif/libexif/releases/download/v0.6.23/libexif-0.6.23.tar.gz" + sha256: "9271cf58cb46b00f9e2e9b968c7d81c008a69e5457f7d1a50dbf1786eac61b52" +patches: + "0.6.24": + - patch_file: patches/replace_ssize_t_windows.patch + "0.6.23": + - patch_file: patches/replace_ssize_t_windows.patch diff --git a/recipes/libexif/all/conanfile.py b/recipes/libexif/all/conanfile.py new file mode 100644 index 0000000000000..91af84ac4770f --- /dev/null +++ b/recipes/libexif/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rename, rmdir, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class LibexifConan(ConanFile): + name = "libexif" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libexif.github.io/" + license = "LGPL-2.1" + description = "libexif is a library for parsing, editing, and saving EXIF data." + topics = ("exif", "metadata", "parse", "edit") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-docs", + "--disable-nls", + "--disable-rpath", + ]) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "compile")) + ar_wrapper = unix_path(self, os.path.join(self.source_folder, "ar-lib")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("LD", f"{compile_wrapper} link -nologo") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "exif.dll.lib"), + os.path.join(self.package_folder, "lib", "exif.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", "libexif") + self.cpp_info.libs = ["exif"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libexif/all/patches/replace_ssize_t_windows.patch b/recipes/libexif/all/patches/replace_ssize_t_windows.patch new file mode 100644 index 0000000000000..874c1abae6654 --- /dev/null +++ b/recipes/libexif/all/patches/replace_ssize_t_windows.patch @@ -0,0 +1,16 @@ +diff --git a/libexif/exif-loader.c b/libexif/exif-loader.c +index bf4f97c..1587121 100644 +--- a/libexif/exif-loader.c ++++ b/libexif/exif-loader.c +@@ -29,6 +29,11 @@ + #include + #include + ++#if defined _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#endif ++ + #undef JPEG_MARKER_DCT + #define JPEG_MARKER_DCT 0xc0 + #undef JPEG_MARKER_DHT diff --git a/recipes/libexif/all/test_package/CMakeLists.txt b/recipes/libexif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..66acda03b0317 --- /dev/null +++ b/recipes/libexif/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libexif REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libexif::libexif) diff --git a/recipes/libexif/all/test_package/conanfile.py b/recipes/libexif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libexif/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/libexif/all/test_package/test_package.c b/recipes/libexif/all/test_package/test_package.c new file mode 100644 index 0000000000000..ecd70802e1db0 --- /dev/null +++ b/recipes/libexif/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include "libexif/exif-data.h" + +int main() { + ExifData *exif = exif_data_new(); + exif_data_free(exif); + return 0; +} diff --git a/recipes/libexif/all/test_v1_package/CMakeLists.txt b/recipes/libexif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libexif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libexif/all/test_v1_package/conanfile.py b/recipes/libexif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libexif/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/libexif/config.yml b/recipes/libexif/config.yml new file mode 100644 index 0000000000000..d4a99779aab91 --- /dev/null +++ b/recipes/libexif/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.24": + folder: all + "0.6.23": + folder: all diff --git a/recipes/libfabric/all/conandata.yml b/recipes/libfabric/all/conandata.yml new file mode 100644 index 0000000000000..1eedb4da16c00 --- /dev/null +++ b/recipes/libfabric/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.12.1": + url: https://github.com/ofiwg/libfabric/releases/download/v1.12.1/libfabric-1.12.1.tar.bz2 + sha256: db3c8e0a495e6e9da6a7436adab905468aedfbd4579ee3da5232a5c111ba642c diff --git a/recipes/libfabric/all/conanfile.py b/recipes/libfabric/all/conanfile.py new file mode 100644 index 0000000000000..96dbea392e3a6 --- /dev/null +++ b/recipes/libfabric/all/conanfile.py @@ -0,0 +1,99 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.35.0" + +class LibfabricConan(ConanFile): + name = "libfabric" + description = "Open Fabric Interfaces" + topics = ("fabric", "communication", "framework", "service") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://libfabric.org" + license = "BSD-2-Clause", "GPL-2.0-or-later" + settings = "os", "arch", "compiler", "build_type" + _providers = ['gni', 'psm', 'psm2', 'psm3', 'rxm', 'sockets', 'tcp', 'udp', 'usnic', 'verbs', 'bgq'] + options = { + **{ p: "ANY" for p in _providers }, + **{ + "shared": [True, False], + "fPIC": [True, False], + "with_libnl": "ANY", + "with_bgq_progress": [None, "auto", "manual"], + "with_bgq_mr": [None, "basic", "scalable"] + } + } + default_options = { + **{ p: "auto" for p in _providers }, + **{ + "shared": False, + "fPIC": True, + "with_libnl": None, + "with_bgq_progress": None, + "with_bgq_mr": None + } + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + _autotools = None + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration("libfabric only builds on Linux, Macos, and FreeBSD.") + for p in self._providers: + if self.options.get_safe(p) not in ["auto", "yes", "no", "dl"] and not os.path.isdir(str(self.options.get_safe(p))): + raise ConanInvalidConfiguration("Option {} can only be one of 'auto', 'yes', 'no', 'dl' or a directory path") + if self.options.get_safe('with_libnl') and not os.path.isdir(str(self.options.with_libnl)): + raise ConanInvalidConfiguration("Value of with_libnl must be an existing directory") + + 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) + args = [] + for p in self._providers: + args.append('--enable-{}={}'.format(p, self.options.get_safe(p))) + if self.options.with_libnl: + args.append('--with-libnl={}'.format(self.options.with_libnl)) + if self.options.with_bgq_progress: + args.append('--with-bgq-progress={}'.format(self.options.with_bgq_progress)) + if self.options.with_bgq_mr: + args.append('--with-bgq-mr={}'.format(self.options.with_bgq_mr)) + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libfabric" + self.cpp_info.libs = self.collect_libs() + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libfabric/all/test_package/CMakeLists.txt b/recipes/libfabric/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/libfabric/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libfabric/all/test_package/conanfile.py b/recipes/libfabric/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/libfabric/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libfabric/all/test_package/test_package.cpp b/recipes/libfabric/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c67d1067dcfcd --- /dev/null +++ b/recipes/libfabric/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +/* example was taken from https://www.gnu.org/ghm/2011/paris/slides/andreas-enge-mpc.pdf */ + +#include +#include + +int main () { + const uint32_t version = fi_version(); + std::cout << "hello libfabric version " << FI_MAJOR(version) << "." << FI_MINOR(version) << "\n"; +} diff --git a/recipes/libfabric/config.yml b/recipes/libfabric/config.yml new file mode 100644 index 0000000000000..daa3a213a56fa --- /dev/null +++ b/recipes/libfabric/config.yml @@ -0,0 +1,3 @@ +versions: + "1.12.1": + folder: all diff --git a/recipes/libfdk_aac/all/conandata.yml b/recipes/libfdk_aac/all/conandata.yml new file mode 100644 index 0000000000000..130e5570f8cdf --- /dev/null +++ b/recipes/libfdk_aac/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.0.2": + url: "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.2.tar.gz" + sha256: "c9e8630cf9d433f3cead74906a1520d2223f89bcd3fa9254861017440b8eb22f" + "2.0.1": + url: "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.1.tar.gz" + sha256: "840133aa9412153894af03b27b03dde1188772442c316a4ce2a24ed70093f271" + "2.0.0": + url: "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.0.tar.gz" + sha256: "f7d6e60f978ff1db952f7d5c3e96751816f5aef238ecf1d876972697b85fd96c" diff --git a/recipes/libfdk_aac/all/conanfile.py b/recipes/libfdk_aac/all/conanfile.py new file mode 100644 index 0000000000000..ea032fb6c5ddd --- /dev/null +++ b/recipes/libfdk_aac/all/conanfile.py @@ -0,0 +1,158 @@ +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.env import VirtualBuildEnv +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, NMakeToolchain +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class LibFDKAACConan(ConanFile): + name = "libfdk_aac" + url = "https://github.com/conan-io/conan-center-index" + description = "A standalone library of the Fraunhofer FDK AAC code from Android" + license = "https://github.com/mstorsjo/fdk-aac/blob/master/NOTICE" + homepage = "https://sourceforge.net/projects/opencore-amr/" + topics = ("multimedia", "audio", "fraunhofer", "aac", "decoder", "encoding", "decoding") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _use_cmake(self): + return Version(self.version) >= "2.0.2" + + 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): + if self._use_cmake: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def build_requirements(self): + if not self._use_cmake and 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) + + def generate(self): + if self._use_cmake: + tc = CMakeToolchain(self) + tc.variables["BUILD_PROGRAMS"] = False + tc.variables["FDK_AAC_INSTALL_CMAKE_CONFIG_MODULE"] = False + tc.variables["FDK_AAC_INSTALL_PKGCONFIG_MODULE"] = False + tc.generate() + elif is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if self._use_cmake: + cmake = CMake(self) + cmake.configure() + cmake.build() + elif is_msvc(self): + makefile_vc = os.path.join(self.source_folder, "Makefile.vc") + replace_in_file(self, makefile_vc, "CFLAGS = /nologo /W3 /Ox /MT", "CFLAGS = /nologo") + replace_in_file(self, makefile_vc, "MKDIR_FLAGS = -p", "MKDIR_FLAGS =") + # Build either shared or static, and don't build utility (it always depends on static lib) + replace_in_file(self, makefile_vc, "copy $(PROGS) $(bindir)", "") + replace_in_file(self, makefile_vc, "copy $(LIB_DEF) $(libdir)", "") + if self.options.shared: + replace_in_file( + self, makefile_vc, + "all: $(LIB_DEF) $(STATIC_LIB) $(SHARED_LIB) $(IMP_LIB) $(PROGS)", + "all: $(LIB_DEF) $(SHARED_LIB) $(IMP_LIB)", + ) + replace_in_file(self, makefile_vc, "copy $(STATIC_LIB) $(libdir)", "") + else: + replace_in_file( + self, makefile_vc, + "all: $(LIB_DEF) $(STATIC_LIB) $(SHARED_LIB) $(IMP_LIB) $(PROGS)", + "all: $(STATIC_LIB)", + ) + replace_in_file(self, makefile_vc, "copy $(IMP_LIB) $(libdir)", "") + replace_in_file(self, makefile_vc, "copy $(SHARED_LIB) $(bindir)", "") + with chdir(self, self.source_folder): + self.run("nmake -f Makefile.vc") + else: + autotools = Autotools(self) + autotools.autoreconf() + if self.settings.os == "Android" and self._settings_build.os == "Windows": + # remove escape for quotation marks, to make ndk on windows happy + replace_in_file( + self, os.path.join(self.source_folder, "configure"), + "s/[ `~#$^&*(){}\\\\|;'\\\''\"<>?]/\\\\&/g", "s/[ `~#$^&*(){}\\\\|;<>?]/\\\\&/g", + ) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self._use_cmake: + cmake = CMake(self) + cmake.install() + elif is_msvc(self): + with chdir(self, self.source_folder): + self.run(f"nmake -f Makefile.vc prefix=\"{self.package_folder}\" install") + if self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "fdk-aac.dll.lib"), + os.path.join(self.package_folder, "lib", "fdk-aac.lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fdk-aac") + self.cpp_info.set_property("cmake_target_name", "FDK-AAC::fdk-aac") + self.cpp_info.set_property("pkg_config_name", "fdk-aac") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["fdk-aac"].libs = ["fdk-aac"] + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.components["fdk-aac"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "fdk-aac" + self.cpp_info.filenames["cmake_find_package_multi"] = "fdk-aac" + self.cpp_info.names["cmake_find_package"] = "FDK-AAC" + self.cpp_info.names["cmake_find_package_multi"] = "FDK-AAC" + self.cpp_info.components["fdk-aac"].names["cmake_find_package"] = "fdk-aac" + self.cpp_info.components["fdk-aac"].names["cmake_find_package_multi"] = "fdk-aac" + self.cpp_info.components["fdk-aac"].set_property("cmake_target_name", "FDK-AAC::fdk-aac") diff --git a/recipes/libfdk_aac/all/test_package/CMakeLists.txt b/recipes/libfdk_aac/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..609976265e86c --- /dev/null +++ b/recipes/libfdk_aac/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(fdk-aac REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE FDK-AAC::fdk-aac) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libfdk_aac/all/test_package/conanfile.py b/recipes/libfdk_aac/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libfdk_aac/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/libfdk_aac/all/test_package/test_package.c b/recipes/libfdk_aac/all/test_package/test_package.c new file mode 100644 index 0000000000000..ecb0777f900d9 --- /dev/null +++ b/recipes/libfdk_aac/all/test_package/test_package.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +int main() +{ + LIB_INFO info[FDK_MODULE_LAST]; + memset(&info, 0, sizeof(info)); + int ret = aacDecoder_GetLibInfo(info); + if (0 != ret) { + fprintf(stderr, "aacDecoder_GetLibInfo failed with %u\n", ret); + return EXIT_FAILURE; + } + ret = aacEncGetLibInfo(info); + if (0 != ret) { + fprintf(stderr, "aacEncGetLibInfo failed with %u\n", ret); + return EXIT_FAILURE; + } + + for (int i = 0; i < FDK_MODULE_LAST; ++i) { + if (FDK_AACDEC == info[i].module_id || FDK_AACENC == info[i].module_id) { + printf("title: %s\n", info[i].title); + printf("build date: %s\n", info[i].build_date); + printf("build time: %s\n", info[i].build_time); + printf("version: %s\n", info[i].versionStr); + printf("========================================\n"); + } + } + + return EXIT_SUCCESS; +} diff --git a/recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt b/recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfdk_aac/all/test_v1_package/conanfile.py b/recipes/libfdk_aac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libfdk_aac/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/libfdk_aac/config.yml b/recipes/libfdk_aac/config.yml new file mode 100644 index 0000000000000..e850754933d82 --- /dev/null +++ b/recipes/libfdk_aac/config.yml @@ -0,0 +1,7 @@ +versions: + "2.0.2": + folder: all + "2.0.1": + folder: all + "2.0.0": + folder: all diff --git a/recipes/libffi/all/conandata.yml b/recipes/libffi/all/conandata.yml new file mode 100644 index 0000000000000..5984134b2d8b9 --- /dev/null +++ b/recipes/libffi/all/conandata.yml @@ -0,0 +1,42 @@ +sources: + "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.4": + - 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.4-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.4.4-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.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" + - patch_file: "patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.3-library-no-version-suffix.patch" diff --git a/recipes/libffi/all/conanfile.py b/recipes/libffi/all/conanfile.py new file mode 100644 index 0000000000000..e46a94d1b4462 --- /dev/null +++ b/recipes/libffi/all/conanfile.py @@ -0,0 +1,173 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, replace_in_file, 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 +from conan.tools.scm import Version +import glob +import os +import shutil + +required_conan_version = ">=1.57.0" + + +class LibffiConan(ConanFile): + name = "libffi" + description = "A portable, high level programming interface to various calling conventions" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceware.org/libffi/" + topics = ("runtime", "foreign-function-interface", "runtime-library") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + # TODO: Remove for Conan v2 + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + 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") + + 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() + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--enable-debug={yes_no(self.settings.build_type == 'Debug')}", + "--enable-builddir=no", + "--enable-docs=no", + ]) + + 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") + + env = tc.environment() + if self._settings_build.os == "Windows" and (is_msvc(self) or self.settings.compiler == "clang"): + build = "{}-{}-{}".format( + "x86_64" if self._settings_build.arch == "x86_64" else "i686", + "pc" if self._settings_build.arch == "x86" else "win64", + "mingw64") + host = "{}-{}-{}".format( + "x86_64" if self.settings.arch == "x86_64" else "i686", + "pc" if self.settings.arch == "x86" else "win64", + "mingw64") + tc.update_configure_args({ + "--build": build, + "--host": host + }) + + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + # https://github.com/conan-io/conan/issues/6514 + tc.extra_cflags.append("-FS") + + if is_msvc_static_runtime(self): + tc.extra_defines.append("USE_STATIC_RTL") + if "d" in msvc_runtime_flag(self): + tc.extra_defines.append("USE_DEBUG_RTL") + + architecture_flag = "" + if is_msvc(self): + if self.settings.arch == "x86_64": + architecture_flag = "-m64" + elif self.settings.arch == "x86": + architecture_flag = "-m32" + elif self.settings.compiler == "clang": + architecture_flag = "-clang-cl" + + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "msvcc.sh")) + if architecture_flag: + compile_wrapper = f"{compile_wrapper} {architecture_flag}" + + ar_wrapper = unix_path(self, self.dependencies.build["automake"].conf_info.get("user.automake:lib-wrapper")) + env.define("CC", f"{compile_wrapper}") + env.define("CXX", f"{compile_wrapper}") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.define("CXXCPP", "cl -nologo -EP") + env.define("CPP", "cl -nologo -EP") + env.define("LIBTOOL", unix_path(self, os.path.join(self.source_folder, "ltmain.sh"))) + env.define("INSTALL", unix_path(self, os.path.join(self.source_folder, "install-sh"))) + tc.generate(env=env) + + def _patch_source(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() + + def package(self): + autotools = Autotools(self) + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) # Need to specify the `DESTDIR` as a Unix path, aware of the subsystem + fix_apple_shared_install_name(self) + mkdir(self, os.path.join(self.package_folder, "bin")) + for dll in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): + shutil.move(dll, os.path.join(self.package_folder, "bin")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + 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"] diff --git a/recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch new file mode 100644 index 0000000000000..dc7d92d567975 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -8964,7 +8964,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -9057,7 +9057,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.2-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch new file mode 100644 index 0000000000000..fad9e64adff17 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- 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.3-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch new file mode 100644 index 0000000000000..f7d0c10680b69 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -9940,7 +9940,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -10032,7 +10032,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.3-fix-complex-type-msvc.patch b/recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch new file mode 100644 index 0000000000000..009281cadd562 --- /dev/null +++ b/recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch @@ -0,0 +1,56 @@ +--- src/types.c ++++ src/types.c +@@ -31,6 +31,8 @@ + #include + #include + ++#include ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id, maybe_const)\ +@@ -45,17 +47,17 @@ + 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,10 +101,20 @@ + 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(float, FLOAT_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(double, DOUBLE_COMPLEX, const); + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +-FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); ++FFI_COMPLEX_TYPEDEF(longdouble, LDOUBLE_COMPLEX, FFI_LDBL_CONST); + #endif + #endif diff --git a/recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch new file mode 100644 index 0000000000000..009a32d923c30 --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -510,7 +510,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.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 new file mode 100644 index 0000000000000..8e14796ab662a --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000000000..e82abf24a4fb1 --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,11 @@ +--- 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/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch new file mode 100644 index 0000000000000..b97912cd6bba1 --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 86eb4a5..450200a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -521,7 +521,7 @@ target_os = @target_os@ + 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.3-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch new file mode 100644 index 0000000000000..520542ddca094 --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -613,7 +613,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.2-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch new file mode 100644 index 0000000000000..80c36df06441e --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000000000..0ad4d29b1c4ce --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch @@ -0,0 +1,11 @@ +--- 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.4-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.4-library-no-version-suffix.patch new file mode 100644 index 0000000000000..3e7be9c15fb0d --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.4-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 +@@ -616,7 +616,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/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch b/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch new file mode 100644 index 0000000000000..a2e9d8e2661aa --- /dev/null +++ b/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch @@ -0,0 +1,30 @@ +diff --git a/include/ffi_common.h b/include/ffi_common.h +index 2bd31b0..c53a794 100644 +--- a/include/ffi_common.h ++++ b/include/ffi_common.h +@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; + static trampoline. */ + int ffi_tramp_is_present (void *closure) FFI_HIDDEN; + ++/* Return a file descriptor of a temporary zero-sized file in a ++ writable and executable filesystem. */ ++int open_temp_exec_file(void) FFI_HIDDEN; ++ + /* Extended cif, used in callback from assembly routine */ + typedef struct + { +diff --git a/src/tramp.c b/src/tramp.c +index b9d273a..c3f4c99 100644 +--- a/src/tramp.c ++++ b/src/tramp.c +@@ -39,6 +39,10 @@ + #ifdef __linux__ + #define _GNU_SOURCE 1 + #endif ++ ++#include ++#include ++ + #include + #include + #include diff --git a/recipes/libffi/all/test_package/CMakeLists.txt b/recipes/libffi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..80fe7087b6f9f --- /dev/null +++ b/recipes/libffi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES C) + +find_package(libffi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libffi::libffi) diff --git a/recipes/libffi/all/test_package/conanfile.py b/recipes/libffi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2d636399fa711 --- /dev/null +++ b/recipes/libffi/all/test_package/conanfile.py @@ -0,0 +1,37 @@ +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 VirtualRunEnv +from conan.tools.microsoft import msvc_runtime_flag +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + tc = CMakeToolchain(self) + if "d" in msvc_runtime_flag(self): + tc.preprocessor_definitions["DISABLE_FFI_CALL"] = 1 + tc.generate() + virtual_run_env = VirtualRunEnv(self) + virtual_run_env.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/libffi/all/test_package/test_package.c b/recipes/libffi/all/test_package/test_package.c new file mode 100644 index 0000000000000..ec8d8480055a3 --- /dev/null +++ b/recipes/libffi/all/test_package/test_package.c @@ -0,0 +1,99 @@ +#if defined(_MSC_VER) +#pragma runtime_checks("s", off) +#endif + +#include + +#include +#include +#include + +unsigned print_uint(unsigned arg) { + printf("print_int(%u)\n", arg); + return 3 * arg; +} + +typedef struct { + FILE *stream; +} puts_binding_userdata; + +void puts_binding(ffi_cif *cif, void *ret, void** args, void *userdata) +{ + fputs(*(char **)args[0], ((puts_binding_userdata *)userdata)->stream); + *((unsigned*)ret) = 1337; +} + +int main() +{ + { + ffi_type *argtypes[1] = {&ffi_type_uint32}; + ffi_cif cif; + ffi_status status = FFI_BAD_ABI; + status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint32, argtypes); + if (status != FFI_OK) + { + puts("1 ffi_prep_cif FAILED.\n\n"); + return EXIT_FAILURE; + } + #ifndef DISABLE_FFI_CALL + // this fails on msvc debug runtime because of https://github.com/libffi/libffi/issues/456 + unsigned rvalue = 0; + unsigned arg1 = 13; + const unsigned expected_ret = 3 * arg1; + void *args[] = {(void*)(&arg1)}; + ffi_call(&cif, FFI_FN(&print_uint), (void *) &rvalue, args); + printf("ffi_call returns %d (should be %d)\n", rvalue, expected_ret); + if (rvalue != expected_ret) { + printf("ffi_call FAILED. Expected %d, but got %d.\n", expected_ret, rvalue); + return EXIT_FAILURE; + } + #endif + return EXIT_SUCCESS; + } + { + #ifdef FFI_CLOSURES + ffi_type *argtypes[1] = {&ffi_type_uint}; + ffi_cif cif; + ffi_status status = FFI_BAD_ABI; + status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint32, argtypes); + if (status != FFI_OK) + { + puts("2 ffi_prep_cif FAILED.\n\n"); + return EXIT_FAILURE; + } + unsigned (*bound_puts)(const char *) = NULL; + ffi_closure *closure = NULL; + closure = (ffi_closure *) ffi_closure_alloc(sizeof(ffi_closure), (void **)&bound_puts); + if (closure == NULL) { + puts("ffi_closure_alloc FAILED\n"); + return EXIT_FAILURE; + } + + puts_binding_userdata userdata; + userdata.stream = stdout; + status = ffi_prep_closure_loc(closure, &cif, puts_binding, + &userdata, (void *) bound_puts); + if (status != FFI_OK) { + puts("ffi_prep_closure_loc FAILED\n"); + return EXIT_FAILURE; + } + puts("Start calling bound_put():"); + bound_puts("Hello"); + bound_puts(" "); + bound_puts("World"); + unsigned rc = bound_puts("\n"); + printf("bounds_puts returned %d.\n", rc); + if (rc != 1337) { + puts("bounds_put returned wrong number."); + return EXIT_FAILURE; + } + + ffi_closure_free(closure); + #endif + } + return EXIT_SUCCESS; +} + +#if defined(_MSC_VER) +#pragma runtime_checks("s", restore) +#endif diff --git a/recipes/libffi/all/test_v1_package/CMakeLists.txt b/recipes/libffi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5b6f863b5bbc1 --- /dev/null +++ b/recipes/libffi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() +if(CONAN_SETTINGS_COMPILER_RUNTIME MATCHES ".*d") + add_compile_definitions(DISABLE_FFI_CALL) +endif() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libffi/all/test_v1_package/conanfile.py b/recipes/libffi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/libffi/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libffi/config.yml b/recipes/libffi/config.yml new file mode 100644 index 0000000000000..af3a9af92b306 --- /dev/null +++ b/recipes/libffi/config.yml @@ -0,0 +1,9 @@ +versions: + "3.4.4": + folder: "all" + "3.4.3": + folder: "all" + "3.4.2": + folder: "all" + "3.3": + folder: "all" diff --git a/recipes/libfreenect/all/conandata.yml b/recipes/libfreenect/all/conandata.yml new file mode 100644 index 0000000000000..d95c75077fd15 --- /dev/null +++ b/recipes/libfreenect/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.6.2": + url: "https://github.com/OpenKinect/libfreenect/archive/refs/tags/v0.6.2.tar.gz" + sha256: "e135f5e60ae290bf1aa403556211f0a62856a9e34f12f12400ec593620a36bfa" +patches: + "0.6.2": + - patch_file: "patches/0.6.2-fix-cmake.patch" diff --git a/recipes/libfreenect/all/conanfile.py b/recipes/libfreenect/all/conanfile.py new file mode 100644 index 0000000000000..66b03d96a8717 --- /dev/null +++ b/recipes/libfreenect/all/conanfile.py @@ -0,0 +1,86 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class LibfreenectConan(ConanFile): + name = "libfreenect" + license = ("Apache-2.0", "GPL-2.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OpenKinect/libfreenect" + description = "Drivers and libraries for the Xbox Kinect device." + topics = ("usb", "camera", "kinect") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libusb/1.0.26") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_REDIST_PACKAGE"] = True + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_FAKENECT"] = False + tc.variables["BUILD_C_SYNC"] = False + tc.variables["BUILD_CPP"] = False + tc.variables["BUILD_CV"] = False + tc.variables["BUILD_AS3_SERVER"] = False + tc.variables["BUILD_PYTHON"] = False + tc.variables["BUILD_PYTHON2"] = False + tc.variables["BUILD_PYTHON3"] = False + tc.variables["BUILD_OPENNI2_DRIVER"] = False + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "APACHE20", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "GPL", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libfreenect") + self.cpp_info.libs = ["freenect"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libfreenect/all/patches/0.6.2-fix-cmake.patch b/recipes/libfreenect/all/patches/0.6.2-fix-cmake.patch new file mode 100644 index 0000000000000..bc6cf92f90057 --- /dev/null +++ b/recipes/libfreenect/all/patches/0.6.2-fix-cmake.patch @@ -0,0 +1,60 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 98283aa..c95fd4e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -75,7 +75,7 @@ ENDIF(PROJECT_OS_LINUX) + ###################################################################################### + + # Find packages needed to build library +-find_package(libusb-1.0 REQUIRED) ++find_package(libusb REQUIRED) + + # Check the endianness of the system + include (TestBigEndian) +@@ -106,6 +106,7 @@ endif (MSVC) + + set(C_CXX_FLAGS_DEFAULT "${C_FLAGS_WARNING} -O2") + ++if (0) + # These defaults can be overriden by -DCMAKE_C_FLAGS="" + set(CMAKE_C_FLAGS "${C_CXX_FLAGS_DEFAULT} ${CMAKE_C_FLAGS}") + # C Configurations +@@ -119,6 +120,7 @@ set(CMAKE_CXX_FLAGS "${C_CXX_FLAGS_DEFAULT} ${CMAKE_CXX_FLAGS}") + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g -DDEBUG=1") + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS}") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g") ++endif () + + # Pretty much everyone is going to need the main includes + include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 841873a..08a3bb5 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,13 +21,15 @@ ENDIF() + + LIST(APPEND SRC core.c tilt.c cameras.c flags.c usb_libusb10.c registration.c audio.c loader.c) + +-add_library (freenect SHARED ${SRC}) ++add_library (freenect ${SRC}) ++target_link_libraries (freenect libusb::libusb) + set_target_properties ( freenect PROPERTIES + VERSION ${PROJECT_VER} + SOVERSION ${PROJECT_APIVER}) +-install (TARGETS freenect +- DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}") ++install (TARGETS freenect) ++ + ++if (0) + add_library (freenectstatic STATIC ${SRC}) + set_target_properties (freenectstatic PROPERTIES OUTPUT_NAME freenect) + IF(UNIX AND NOT APPLE) +@@ -38,6 +40,7 @@ install (TARGETS freenectstatic + + target_link_libraries (freenect ${LIBUSB_1_LIBRARIES}) + target_link_libraries (freenectstatic ${LIBUSB_1_LIBRARIES}) ++endif () + + # Install the header files + install (FILES "../include/libfreenect.h" "../include/libfreenect_registration.h" "../include/libfreenect_audio.h" diff --git a/recipes/libfreenect/all/test_package/CMakeLists.txt b/recipes/libfreenect/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..46d01bd2584df --- /dev/null +++ b/recipes/libfreenect/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libfreenect REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libfreenect::libfreenect) diff --git a/recipes/libfreenect/all/test_package/conanfile.py b/recipes/libfreenect/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/libfreenect/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, run=True) + + 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/libfreenect/all/test_package/test_package.c b/recipes/libfreenect/all/test_package/test_package.c new file mode 100644 index 0000000000000..00989f9d18c1e --- /dev/null +++ b/recipes/libfreenect/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int main(int argc, char** argv) +{ + freenect_context* fn_ctx = NULL; + int ret = freenect_init(&fn_ctx, NULL); + if (ret < 0) + return ret; + + freenect_shutdown(fn_ctx); + return 0; +} diff --git a/recipes/libfreenect/all/test_v1_package/CMakeLists.txt b/recipes/libfreenect/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libfreenect/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfreenect/all/test_v1_package/conanfile.py b/recipes/libfreenect/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libfreenect/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/libfreenect/config.yml b/recipes/libfreenect/config.yml new file mode 100644 index 0000000000000..a09c617182ab2 --- /dev/null +++ b/recipes/libfreenect/config.yml @@ -0,0 +1,3 @@ +versions: + "0.6.2": + folder: all diff --git a/recipes/libfreenect2/all/CMakeLists.txt b/recipes/libfreenect2/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/libfreenect2/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libfreenect2/all/conandata.yml b/recipes/libfreenect2/all/conandata.yml new file mode 100644 index 0000000000000..7fab4fd83db66 --- /dev/null +++ b/recipes/libfreenect2/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.2.1": + url: "https://github.com/OpenKinect/libfreenect2/archive/refs/tags/v0.2.1.tar.gz" + sha256: "c09e52c97b0e90335f4762ed5363293ad0fc1ea0064e578b879e7d15cc3559df" +patches: + "0.2.1": + - patch_file: "patches/0.2.1-fix-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/0.2.1-generate-resources.patch" + base_path: "source_subfolder" diff --git a/recipes/libfreenect2/all/conanfile.py b/recipes/libfreenect2/all/conanfile.py new file mode 100644 index 0000000000000..dbb951cc733d9 --- /dev/null +++ b/recipes/libfreenect2/all/conanfile.py @@ -0,0 +1,110 @@ +from conans import ConanFile, CMake, tools +import os + + +class Libfreenect2Conan(ConanFile): + name = "libfreenect2" + license = ("Apache-2.0", "GPL-2.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OpenKinect/libfreenect2" + description = "Open source drivers for the Kinect for Windows v2 device." + topics = ("usb", "camera", "kinect") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_opencl": [True, False], + "with_opengl": [True, False], + "with_vaapi": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_opencl": True, + "with_opengl": True, + "with_vaapi": True, + } + generators = "cmake", "cmake_find_package" + exports_sources = ["CMakeLists.txt", "patches/*"] + + _cmake = None + + @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 + if self.settings.os != "Linux": + del self.options.with_vaapi + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("libusb/1.0.24") + self.requires("libjpeg-turbo/2.1.1") + if self.options.with_opencl: + self.requires("opencl-headers/2021.04.29") + self.requires("opencl-icd-loader/2021.04.29") + if self.options.with_opengl: + self.requires("opengl/system") + self.requires("glfw/3.3.4") + if self.options.get_safe("with_vaapi"): + self.requires("vaapi/system") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_EXAMPLES"] = False + self._cmake.definitions["BUILD_OPENNI2_DRIVER"] = False + self._cmake.definitions["ENABLE_CXX11"] = True + self._cmake.definitions["ENABLE_OPENCL"] = self.options.with_opencl + self._cmake.definitions["ENABLE_CUDA"] = False # TODO: CUDA + self._cmake.definitions["ENABLE_OPENGL"] = self.options.with_opengl + self._cmake.definitions["ENABLE_VAAPI"] = self.options.get_safe("with_vaapi", False) + self._cmake.definitions["ENABLE_TEGRAJPEG"] = False # TODO: TegraJPEG + self._cmake.definitions["ENABLE_PROFILING"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("APACHE20", src=self._source_subfolder, dst="licenses", keep_path=False) + self.copy("GPL2", src=self._source_subfolder, dst="licenses", keep_path=False) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "freenect2" + self.cpp_info.names["cmake_find_package_multi"] = "freenect2" + self.cpp_info.names["pkg_config"] = "freenect2" + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) + elif self.settings.os == "Macos": + self.cpp_info.frameworks.extend(["VideoToolbox", "CoreFoundation", "CoreMedia", "CoreVideo"]) diff --git a/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch b/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch new file mode 100644 index 0000000000000..93324460a3d71 --- /dev/null +++ b/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch @@ -0,0 +1,203 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d8ef047..a81aa8e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -90,8 +90,7 @@ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + + # dependencies +-FIND_PACKAGE(PkgConfig) # try find PKGConfig as it will be used if found +-FIND_PACKAGE(LibUSB REQUIRED) ++find_package(libusb REQUIRED) + + # Add includes + INCLUDE_DIRECTORIES( +@@ -99,7 +98,7 @@ INCLUDE_DIRECTORIES( + "${MY_DIR}/include/internal" + ${PROJECT_BINARY_DIR} # for generated headers + ${LIBFREENECT2_THREADING_INCLUDE_DIR} +- ${LibUSB_INCLUDE_DIRS} ++ # ${LibUSB_INCLUDE_DIRS} + ) + + SET(RESOURCES_INC_FILE "${PROJECT_BINARY_DIR}/resources.inc.h") +@@ -157,12 +156,12 @@ SET(SOURCES + ) + + SET(LIBRARIES +- ${LibUSB_LIBRARIES} ++ libusb::libusb + ${LIBFREENECT2_THREADING_LIBRARIES} + ) + + SET(LIBFREENECT2_DLLS +- ${LibUSB_DLL} ++ #${LibUSB_DLL} + ) + + SET(HAVE_VideoToolbox "no (Apple only)") +@@ -193,13 +192,14 @@ ENDIF(APPLE) + + SET(HAVE_VAAPI disabled) + IF(ENABLE_VAAPI) +- IF(PKG_CONFIG_FOUND) +- PKG_CHECK_MODULES(VAAPI libva libva-drm) +- ENDIF() +- FIND_PACKAGE(JPEG) ++ # IF(PKG_CONFIG_FOUND) ++ # PKG_CHECK_MODULES(VAAPI libva libva-drm) ++ # ENDIF() ++ find_package(vaapi REQUIRED) ++ find_package(libjpeg-turbo REQUIRED) + + SET(HAVE_VAAPI no) +- IF(VAAPI_FOUND AND JPEG_FOUND) ++ # IF(VAAPI_FOUND AND JPEG_FOUND) + SET(LIBFREENECT2_WITH_VAAPI_SUPPORT 1) + SET(HAVE_VAAPI yes) + +@@ -209,10 +209,10 @@ IF(ENABLE_VAAPI) + src/vaapi_rgb_packet_processor.cpp + ) + LIST(APPEND LIBRARIES +- ${VAAPI_LIBRARIES} +- ${JPEG_LIBRARY} ++ vaapi::vaapi ++ libjpeg-turbo::libjpeg-turbo + ) +- ENDIF() ++ # ENDIF() + ENDIF(ENABLE_VAAPI) + + SET(HAVE_TegraJPEG disabled) +@@ -237,38 +237,38 @@ IF(ENABLE_TEGRAJPEG) + ENDIF() + + IF(LIBFREENECT2_WITH_VT_SUPPORT) +- FIND_PACKAGE(TurboJPEG) ++ find_package(libjpeg-turbo REQUIRED) + ELSE() + # VAAPI can fail to start at runtime. It must have a fallback. +- FIND_PACKAGE(TurboJPEG REQUIRED) ++ find_package(libjpeg-turbo REQUIRED) + ENDIF() + + SET(HAVE_TurboJPEG no) +-IF(TurboJPEG_FOUND) ++IF(libjpeg-turbo_FOUND) + SET(LIBFREENECT2_WITH_TURBOJPEG_SUPPORT 1) + SET(HAVE_TurboJPEG yes) + +- INCLUDE_DIRECTORIES(${TurboJPEG_INCLUDE_DIRS}) ++ #INCLUDE_DIRECTORIES(${TurboJPEG_INCLUDE_DIRS}) + + LIST(APPEND SOURCES + src/turbo_jpeg_rgb_packet_processor.cpp + ) + + LIST(APPEND LIBRARIES +- ${TurboJPEG_LIBRARIES} ++ libjpeg-turbo::libjpeg-turbo + ) + + LIST(APPEND LIBFREENECT2_DLLS +- ${TurboJPEG_DLL} ++ #${TurboJPEG_DLL} + ) + ENDIF() + + SET(HAVE_OpenGL disabled) + IF(ENABLE_OPENGL) +- FIND_PACKAGE(GLFW3) +- FIND_PACKAGE(OpenGL) ++ find_package(glfw3 REQUIRED) ++ find_package(opengl_system REQUIRED) + SET(HAVE_OpenGL no) +- IF(GLFW3_FOUND AND OPENGL_FOUND) ++ # IF(GLFW3_FOUND AND OPENGL_FOUND) + SET(LIBFREENECT2_WITH_OPENGL_SUPPORT 1) + SET(HAVE_OpenGL yes) + +@@ -276,8 +276,8 @@ IF(ENABLE_OPENGL) + + LIST(APPEND LIBFREENECT2_DLLS ${GLFW3_DLL}) + LIST(APPEND LIBRARIES +- ${GLFW3_LIBRARIES} +- ${OPENGL_gl_LIBRARY} ++ glfw::glfw ++ opengl::opengl + ) + LIST(APPEND SOURCES + src/flextGL.cpp +@@ -292,19 +292,19 @@ IF(ENABLE_OPENGL) + src/shader/stage1.fs + src/shader/stage2.fs + ) +- ENDIF() ++ # ENDIF() + ENDIF(ENABLE_OPENGL) + + SET(HAVE_OpenCL disabled) + IF(ENABLE_OPENCL) +- FIND_PACKAGE(OpenCL) ++ find_package(opencl-icd-loader REQUIRED) + + SET(HAVE_OpenCL no) +- IF(OpenCL_FOUND) ++ #IF(OpenCL_FOUND) + SET(LIBFREENECT2_WITH_OPENCL_SUPPORT 1) + SET(HAVE_OpenCL yes) + +- IF(UNIX AND NOT APPLE) ++ IF(0) + INCLUDE(CheckOpenCLICDLoader) + IF(OpenCL_C_WORKS AND NOT OpenCL_CXX_WORKS) + SET(LIBFREENECT2_OPENCL_ICD_LOADER_IS_OLD 1) +@@ -312,7 +312,7 @@ IF(ENABLE_OPENCL) + MESSAGE(WARNING "Your libOpenCL.so is incompatible with CL/cl.h. Install ocl-icd-opencl-dev to update libOpenCL.so?") + ENDIF() + ENDIF() +- INCLUDE_DIRECTORIES(${OpenCL_INCLUDE_DIRS}) ++ #INCLUDE_DIRECTORIES(${OpenCL_INCLUDE_DIRS}) + + LIST(APPEND SOURCES + src/opencl_depth_packet_processor.cpp +@@ -320,7 +320,7 @@ IF(ENABLE_OPENCL) + ) + + LIST(APPEND LIBRARIES +- ${OpenCL_LIBRARIES} ++ opencl-icd-loader::opencl-icd-loader + ) + + LIST(APPEND RESOURCES +@@ -334,7 +334,7 @@ IF(ENABLE_OPENCL) + IF(UNIX AND NOT APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + ENDIF() +- ENDIF(OpenCL_FOUND) ++ #ENDIF(OpenCL_FOUND) + ENDIF(ENABLE_OPENCL) + + SET(HAVE_CUDA disabled) +@@ -385,7 +385,7 @@ IF(ENABLE_CUDA) + ENDIF(ENABLE_CUDA) + + # RPATH handling for CUDA 8.0 libOpenCL.so conflict. See #804. +-IF(HAVE_OpenCL STREQUAL yes AND UNIX AND NOT APPLE) ++IF(0) + FILE(GLOB CUDA_ld_so_conf /etc/ld.so.conf.d/cuda*.conf) + IF(CUDA_ld_so_conf) + MESSAGE(WARNING "Your CUDA installation overrides OpenCL system library path.") +@@ -403,9 +403,9 @@ ENDIF() + # Both command line -DCMAKE_INSTALL_RPATH=... and CMake GUI settings are accepted. + # + # Anyway if wrong versions of libusb is used, errors will be reported explicitly. +-IF(NOT DEFINED CMAKE_INSTALL_RPATH AND NOT ${LibUSB_LIBDIR} MATCHES "^/usr/lib") ++IF(0 AND NOT DEFINED CMAKE_INSTALL_RPATH AND NOT ${LibUSB_LIBDIR} MATCHES "^/usr/lib") + SET(CMAKE_INSTALL_RPATH ${LibUSB_LIBDIR} CACHE STRING "Set RPATH for a private libusb") +-ELSEIF(DEFINED CMAKE_INSTALL_RPATH) ++ELSEIF(0 AND DEFINED CMAKE_INSTALL_RPATH) + SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} CACHE STRING "Set RPATH for a private libusb") + ENDIF() + IF(DEFINED CMAKE_INSTALL_RPATH) diff --git a/recipes/libfreenect2/all/patches/0.2.1-generate-resources.patch b/recipes/libfreenect2/all/patches/0.2.1-generate-resources.patch new file mode 100644 index 0000000000000..36258bc3f57ef --- /dev/null +++ b/recipes/libfreenect2/all/patches/0.2.1-generate-resources.patch @@ -0,0 +1,41 @@ +This patch avoids compiling 'generate_resources_tool' to generate C sources of binary resources +and instead uses CMake functionality to generate the files. This patch is necessary to enable +cross-compiling without setting up host compiling environment. @sh0 + +diff --git a/cmake_modules/GenerateResources.cmake b/cmake_modules/GenerateResources.cmake +index 8616e38..6deea9a 100644 +--- a/cmake_modules/GenerateResources.cmake ++++ b/cmake_modules/GenerateResources.cmake +@@ -1,14 +1,23 @@ + FUNCTION(GENERATE_RESOURCES OUTPUT BASE_FOLDER) + +-ADD_EXECUTABLE(generate_resources_tool +- tools/generate_resources.cpp +-) +- +-ADD_CUSTOM_COMMAND( +- OUTPUT ${OUTPUT} +- COMMAND generate_resources_tool ${BASE_FOLDER} ${ARGN} > ${OUTPUT} +- WORKING_DIRECTORY ${BASE_FOLDER} +- DEPENDS generate_resources_tool ${ARGN} ++set(RES_INDEX "0") ++foreach (SRC_ENTRY ${ARGN}) ++ set(SRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_ENTRY}") ++ get_filename_component(SRC_NAME "${SRC_ENTRY}" NAME) ++ file(SIZE "${SRC_PATH}" DATA_SIZE) ++ file(READ "${SRC_PATH}" DATA_BIN HEX) ++ string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," DATA_HEX ${DATA_BIN}) ++ string(APPEND RES_CONTENT "static unsigned char resource${RES_INDEX}[] = {\n ${DATA_HEX}\n};\n") ++ string(APPEND RES_DESCRIPTOR " { \"${SRC_NAME}\", resource${RES_INDEX}, sizeof(resource${RES_INDEX}) },\n") ++ math(EXPR RES_INDEX "${RES_INDEX} + 1") ++endforeach () ++file(WRITE "${OUTPUT}" ++ "${RES_CONTENT}" ++ "static ResourceDescriptor resource_descriptors[] = {\n" ++ "${RES_DESCRIPTOR}" ++ " {NULL, NULL, 0},\n" ++ "};\n" ++ "static int resource_descriptors_length = ${RES_INDEX};\n" + ) + + ENDFUNCTION(GENERATE_RESOURCES) diff --git a/recipes/libfreenect2/all/test_package/CMakeLists.txt b/recipes/libfreenect2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5742a7e29c0d5 --- /dev/null +++ b/recipes/libfreenect2/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(freenect2 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${freenect2_LIBRARIES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${freenect2_INCLUDE_DIRS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/libfreenect2/all/test_package/conanfile.py b/recipes/libfreenect2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3da371b660e0a --- /dev/null +++ b/recipes/libfreenect2/all/test_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" + + 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/libfreenect2/all/test_package/test_package.cpp b/recipes/libfreenect2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..043111f826b8f --- /dev/null +++ b/recipes/libfreenect2/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + libfreenect2::Freenect2 freenect2; + return EXIT_SUCCESS; +} diff --git a/recipes/libfreenect2/config.yml b/recipes/libfreenect2/config.yml new file mode 100644 index 0000000000000..f975c1e3261f7 --- /dev/null +++ b/recipes/libfreenect2/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/libftdi/0.x/CMakeLists.txt b/recipes/libftdi/0.x/CMakeLists.txt new file mode 100644 index 0000000000000..5b33131a68c48 --- /dev/null +++ b/recipes/libftdi/0.x/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +link_libraries(CONAN_PKG::libusb-compat) +include_directories(${CONAN_INCLUDE_DIRS_BOOST}) + +add_subdirectory(source_subfolder) diff --git a/recipes/libftdi/0.x/conandata.yml b/recipes/libftdi/0.x/conandata.yml new file mode 100644 index 0000000000000..87f1338e3ed67 --- /dev/null +++ b/recipes/libftdi/0.x/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.20": + url: "https://www.intra2net.com/en/developer/libftdi/download/libftdi-0.20.tar.gz" + sha256: "3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e" +patches: + "0.20": + - patch_file: "patches/0001-cmake-fixes.patch" + base_path: "source_subfolder" diff --git a/recipes/libftdi/0.x/conanfile.py b/recipes/libftdi/0.x/conanfile.py new file mode 100644 index 0000000000000..bdc298e883977 --- /dev/null +++ b/recipes/libftdi/0.x/conanfile.py @@ -0,0 +1,90 @@ +from conans import CMake, ConanFile, tools +from contextlib import contextmanager +import os + + +class LibFtdi(ConanFile): + name = "libftdi" + description = "libFTDI - FTDI USB driver with bitbang mode" + topics = ("conan", "libconfuse", "configuration", "parser") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.intra2net.com/en/developer/libftdi" + license = "LGPL-2.0" + exports_sources = "CMakeLists.txt", "patches/**" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_cpp_wrapper": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_cpp_wrapper": True, + } + generators = "cmake" + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + if not self.options.enable_cpp_wrapper: + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("libftdi-{}".format(self.version), self._source_subfolder) + + def requirements(self): + self.requires("libusb-compat/0.1.7") + if self.options.enable_cpp_wrapper: + self.requires("boost/1.74.0") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["FTDIPP"] = self.options.enable_cpp_wrapper + self._cmake.definitions["PYTHON_BINDINGS"] = False + self._cmake.definitions["EXAMPLES"] = False + self._cmake.definitions["DOCUMENTATION"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "CMAKE_BINARY_DIR", "PROJECT_BINARY_DIR") + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") + tools.replace_in_file(os.path.join(self._source_subfolder, "ftdipp", "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="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): + if self.options.enable_cpp_wrapper: + self.cpp_info.libs.append("ftdipp") + self.cpp_info.libs.append("ftdi") diff --git a/recipes/libftdi/0.x/patches/0001-cmake-fixes.patch b/recipes/libftdi/0.x/patches/0001-cmake-fixes.patch new file mode 100644 index 0000000000000..fd212022d36d0 --- /dev/null +++ b/recipes/libftdi/0.x/patches/0001-cmake-fixes.patch @@ -0,0 +1,164 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -44,7 +44,7 @@ + SET(LIB_SUFFIX "") + SET(PACK_ARCH "") + ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) +- SET(LIB_SUFFIX 64) ++ SET(LIB_SUFFIX "") + SET(PACK_ARCH .x86_64) + endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + +--- ftdipp/CMakeLists.txt ++++ ftdipp/CMakeLists.txt +@@ -16,7 +16,8 @@ + set(cpp_headers ftdi.hpp) + + # Find Boost +- find_package(Boost) ++ find_package(Boost REQUIRED) ++ include_directories(${CONAN_INCLUDE_DIRS_BOOST}) + if(Boost_FOUND) + set(FTDI_BUILD_CPP True PARENT_SCOPE) + message(STATUS "Building libftdi++") +@@ -26,6 +27,7 @@ + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdipp PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 1) ++ set_target_properties(ftdipp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # Static library + add_library(ftdipp-static STATIC ${cpp_sources}) +@@ -38,19 +40,28 @@ + # Dependencies + target_link_libraries(ftdipp ftdi ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES}) + ++ if(BUILD_SHARED_LIBS) ++ set_property(TARGET ftdipp-static PROPERTY EXCLUDE_FROM_ALL ON) ++ else() ++ set_property(TARGET ftdipp PROPERTY EXCLUDE_FROM_ALL ON) ++ endif() + # Install + if(${UNIX}) +- ++ if(BUILD_SHARED_LIBS) + install( TARGETS ftdipp +- LIBRARY DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT sharedlibs + ) +- ++ else() + install( TARGETS ftdipp-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT staticlibs + ) +- ++ endif() + install( FILES ${cpp_headers} + DESTINATION include + COMPONENT headers +@@ -59,17 +70,21 @@ + endif(${UNIX}) + + if(${WIN32}) +- ++ if(BUILD_SHARED_LIBS) + install( TARGETS ftdipp +- DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT sharedlibs + ) +- ++ else() + install( TARGETS ftdipp-static +- DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT staticlibs + ) +- ++ endif() + install( FILES ${cpp_headers} + DESTINATION include + COMPONENT headers +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -11,6 +11,7 @@ + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdi PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 1) ++set_target_properties(ftdi PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # Static library + add_library(ftdi-static STATIC ${c_sources}) +@@ -23,19 +24,29 @@ + # Dependencies + target_link_libraries(ftdi ${LIBUSB_LIBRARIES}) + ++if(BUILD_SHARED_LIBS) ++ set_property(TARGET ftdi-static PROPERTY EXCLUDE_FROM_ALL ON) ++else() ++ set_property(TARGET ftdi PROPERTY EXCLUDE_FROM_ALL ON) ++endif() ++ + # Install + if(${UNIX}) +- ++if(BUILD_SHARED_LIBS) + install( TARGETS ftdi +- LIBRARY DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT sharedlibs + ) +- ++else() + install( TARGETS ftdi-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT staticlibs + ) +- ++endif() + install( FILES ${c_headers} + DESTINATION include + COMPONENT headers +@@ -44,17 +55,21 @@ + endif(${UNIX}) + + if(${WIN32}) +- ++if(BUILD_SHARED_LIBS) + install( TARGETS ftdi +- DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT sharedlibs + ) +- ++else() + install( TARGETS ftdi-static +- DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT staticlibs + ) +- ++endif() + install( FILES ${c_headers} + DESTINATION include + COMPONENT headers diff --git a/recipes/libftdi/0.x/test_package/CMakeLists.txt b/recipes/libftdi/0.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libftdi/0.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libftdi/0.x/test_package/conanfile.py b/recipes/libftdi/0.x/test_package/conanfile.py new file mode 100644 index 0000000000000..8c64bd2e6fd24 --- /dev/null +++ b/recipes/libftdi/0.x/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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") + config_path = os.path.join(self.source_folder, "hello.conf") + self.run("{} {}".format(bin_path, config_path), run_environment=True) diff --git a/recipes/libftdi/0.x/test_package/test_package.c b/recipes/libftdi/0.x/test_package/test_package.c new file mode 100644 index 0000000000000..f03b8080c1fe2 --- /dev/null +++ b/recipes/libftdi/0.x/test_package/test_package.c @@ -0,0 +1,47 @@ +/* simple.c + + Simple libftdi usage example + + This program is distributed under the GPL, version 2 +*/ + +#include +#include + +int main(void) +{ + int ret; + struct ftdi_context ftdic; + if (ftdi_init(&ftdic) < 0) + { + fprintf(stderr, "ftdi_init failed\n"); + return EXIT_FAILURE; + } + + if ((ret = ftdi_usb_open(&ftdic, 0x0403, 0x6001)) < 0) + { + fprintf(stderr, "unable to open ftdi device: %d (%s)\n", ret, ftdi_get_error_string(&ftdic)); + goto failure; + } + + // Read out FTDIChip-ID of R type chips + if (ftdic.type == TYPE_R) + { + unsigned int chipid; + printf("ftdi_read_chipid: %d\n", ftdi_read_chipid(&ftdic, &chipid)); + printf("FTDI chipid: %X\n", chipid); + } + + if ((ret = ftdi_usb_close(&ftdic)) < 0) + { + fprintf(stderr, "unable to close ftdi device: %d (%s)\n", ret, ftdi_get_error_string(&ftdic)); + goto failure; + } + + ftdi_deinit(&ftdic); + + return EXIT_SUCCESS; +failure: + printf("This is a test package ==> ignoring the error.\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/libftdi/1.x/conandata.yml b/recipes/libftdi/1.x/conandata.yml new file mode 100644 index 0000000000000..3548dde53d918 --- /dev/null +++ b/recipes/libftdi/1.x/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.5": + sha256: 7c7091e9c86196148bd41177b4590dccb1510bfe6cea5bf7407ff194482eb049 + url: "https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.5.tar.bz2" +patches: + "1.5": + - patch_file: "patches/0001-cmake-targets.patch" + patch_description: "Fix cmake targets and call project after cmake_minimum_required." + patch_type: "conan" diff --git a/recipes/libftdi/1.x/conanfile.py b/recipes/libftdi/1.x/conanfile.py new file mode 100644 index 0000000000000..16c0bb3e46d34 --- /dev/null +++ b/recipes/libftdi/1.x/conanfile.py @@ -0,0 +1,111 @@ +import os +from conan import ConanFile +from conan.tools.files import get, rmdir, export_conandata_patches +from conan.tools.files import apply_conandata_patches, copy +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + +class LibFtdiConan(ConanFile): + name = "libftdi" + description = "A library to talk to FTDI chips" + license = "LGPL-2.0-only", "GPLv2-or-later" + topics = "ftdi" + homepage = "https://www.intra2net.com/en/developer/libftdi/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared" : [True, False], + "fPIC" : [True, False], + "enable_cpp_wrapper" : [True, False], + "build_eeprom_tool" : [True, False], + "use_streaming" : [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_cpp_wrapper": True, + "build_eeprom_tool" : False, + "use_streaming" : True, + } + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if is_msvc(self): + self.options.use_streaming = False + + def layout(self): + cmake_layout(self, src_folder="src") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.license = ("LGPL-2.1-only", "GPL-2.0-only") if self.options.build_eeprom_tool or self.options.enable_cpp_wrapper else ("LGPL-2.1-only") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["EXAMPLES"] = False + tc.variables["FTDI_EEPROM"] = self.options.build_eeprom_tool + tc.variables["FTDIPP"] = self.options.enable_cpp_wrapper + tc.variables["ENABLE_STREAMING"] = self.options.use_streaming + tc.variables["LIB_SUFFIX"] = "" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def requirements(self): + self.requires("libusb/1.0.26") + if self.options.enable_cpp_wrapper: + self.requires("boost/1.80.0") + + def validate(self): + if is_msvc(self) and self.options.use_streaming: + raise ConanInvalidConfiguration("VS doesn't not compile with enabled option use_streaming") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.LIB", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + if self.options.build_eeprom_tool or self.options.enable_cpp_wrapper: + copy(self, "COPYING.GPL", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + lib_folder = os.path.join(self.package_folder, "lib") + rmdir(self, os.path.join(lib_folder, "cmake")) + rmdir(self, os.path.join(lib_folder, "pkgconfig")) + + def package_info(self): + # Remove "self.cpp_info.filenames.." statements in Conan V2 + self.cpp_info.filenames['cmake_find_package'] = "LibFTDI1" + self.cpp_info.filenames['cmake_find_package_multi'] = "LibFTDI1" + + self.cpp_info.set_property("cmake_file_name", "LibFTDI1") + self.cpp_info.components["ftdi"].set_property("pkg_config_name", "libftdi1") + self.cpp_info.components["ftdi"].libs = ["ftdi1"] + self.cpp_info.components["ftdi"].requires = ["libusb::libusb"] + self.cpp_info.components["ftdi"].includedirs.append(os.path.join("include", "libftdi1")) + self.cpp_info.components["ftdi"].names["pkg_config"] = "libftdi1" + + if self.options.enable_cpp_wrapper: + self.cpp_info.components["ftdipp"].set_property("pkg_config_name", "libftdipp1") + self.cpp_info.components["ftdipp"].libs = ["ftdipp1"] + self.cpp_info.components["ftdipp"].requires = ["ftdi", "boost::headers"] + self.cpp_info.components["ftdipp"].names["pkg_config"] = "libftdipp1" + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ftdipp"].system_libs.append("m") diff --git a/recipes/libftdi/1.x/patches/0001-cmake-targets.patch b/recipes/libftdi/1.x/patches/0001-cmake-targets.patch new file mode 100644 index 0000000000000..9ca28ffd1fc5e --- /dev/null +++ b/recipes/libftdi/1.x/patches/0001-cmake-targets.patch @@ -0,0 +1,830 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5aecafc..abb133f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,36 +1,54 @@ +-# Project +-project(libftdi1 C) ++cmake_minimum_required(VERSION 3.15 FATAL_ERROR) ++project(libftdi1) ++ + set(MAJOR_VERSION 1) + set(MINOR_VERSION 5) + set(PACKAGE libftdi1) + set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) + set(VERSION ${VERSION_STRING}) +-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) ++list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +-# CMake + if("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE RelWithDebInfo) + endif("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_COLOR_MAKEFILE ON) +-cmake_minimum_required(VERSION 2.6 FATAL_ERROR) ++ ++if(POLICY CMP0057) ++ cmake_policy(SET CMP0057 NEW) ++endif() ++if(POLICY CMP0011) ++ cmake_policy(SET CMP0011 NEW) ++endif() ++if(POLICY CMP0099) ++ cmake_policy(SET CMP0099 NEW) ++endif() + + add_definitions(-Wall) + + include(CMakeOptions.txt) + ++set(as_subproject LibFTDI) ++macro(find_package) ++ if(NOT ${ARGV0} IN_LIST as_subproject) ++ _find_package(${ARGV}) ++ endif() ++endmacro() ++ + # Debug build +-message("-- Build type: ${CMAKE_BUILD_TYPE}") ++message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") + if(${CMAKE_BUILD_TYPE} STREQUAL Debug) + add_definitions(-DDEBUG) + endif(${CMAKE_BUILD_TYPE} STREQUAL Debug) + +-# find libusb +-find_package ( USB1 REQUIRED ) +-include_directories ( ${LIBUSB_INCLUDE_DIR} ) ++find_package (libusb REQUIRED) ++ ++if (FTDIPP) ++ find_package(Boost REQUIRED) ++endif() + +-# Find Boost +-if (FTDIPP OR BUILD_TESTS) +- find_package( Boost REQUIRED ) ++if (APPLE) ++ find_library(APPLE_CF CoreFoundation) ++ find_library(APPLE_IOK IOKit) + endif() + + # Set components +@@ -97,7 +115,7 @@ if ( WIN32 ) + set ( CPACK_NSIS_MODIFY_PATH ON ) + endif () + +-set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) ++set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) + + set(CPACK_SOURCE_GENERATOR TGZ) + set(CPACK_SOURCE_IGNORE_FILES "\\\\.git;~$;build/") +@@ -136,7 +154,7 @@ endif () + + add_subdirectory(src) + if ( FTDIPP ) +- project(libftdipp1 C CXX) ++ project(libftdi1 C CXX) + add_subdirectory(ftdipp) + endif () + if ( PYTHON_BINDINGS ) +@@ -150,6 +168,9 @@ if ( EXAMPLES ) + endif () + add_subdirectory(packages) + if ( BUILD_TESTS ) ++ project(libftdi1 C CXX) ++ find_package(Boost COMPONENTS unit_test_framework REQUIRED) ++ enable_testing() + add_subdirectory(test) + endif () + +@@ -165,8 +186,8 @@ if(${WIN32}) + set(libdir ${CMAKE_INSTALL_PREFIX}/bin) + endif(${WIN32}) + +-configure_file(${CMAKE_SOURCE_DIR}/libftdi1.pc.in ${CMAKE_BINARY_DIR}/libftdi1.pc @ONLY) +-configure_file(${CMAKE_SOURCE_DIR}/libftdipp1.pc.in ${CMAKE_BINARY_DIR}/libftdipp1.pc @ONLY) ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libftdi1.pc.in ${CMAKE_BINARY_DIR}/libftdi1.pc @ONLY) ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libftdipp1.pc.in ${CMAKE_BINARY_DIR}/libftdipp1.pc @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/libftdi1.pc ${CMAKE_BINARY_DIR}/libftdipp1.pc + DESTINATION lib${LIB_SUFFIX}/pkgconfig) + +@@ -202,30 +223,25 @@ set ( LIBFTDI_VERSION_MINOR ${MINOR_VERSION} ) + + set ( LIBFTDI_USE_FILE ${CMAKE_INSTALL_PREFIX}/${LIBFTDI_CMAKE_CONFIG_DIR}/UseLibFTDI1.cmake ) + +-if(CMAKE_VERSION VERSION_LESS 2.8.8) +- configure_file ( cmake/LibFTDI1Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake @ONLY ) +- configure_file ( cmake/LibFTDI1ConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1ConfigVersion.cmake @ONLY ) +-else () +- include(CMakePackageConfigHelpers) +- +- configure_package_config_file ( +- cmake/LibFTDI1Config.cmake.in +- ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake +- INSTALL_DESTINATION ${LIBFTDI_CMAKE_CONFIG_DIR} +- PATH_VARS +- LIBFTDI_USE_FILE +- LIBFTDI_ROOT_DIR +- LIBFTDI_INCLUDE_DIR +- LIBFTDI_INCLUDE_DIRS +- LIBFTDI_LIBRARY_DIRS +- NO_CHECK_REQUIRED_COMPONENTS_MACRO +- ) +- write_basic_package_version_file ( +- LibFTDI1ConfigVersion.cmake +- VERSION ${LIBFTDI_VERSION_STRING} +- COMPATIBILITY AnyNewerVersion +- ) +-endif () ++include(CMakePackageConfigHelpers) ++ ++configure_package_config_file ( ++cmake/LibFTDI1Config.cmake.in ++${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake ++INSTALL_DESTINATION ${LIBFTDI_CMAKE_CONFIG_DIR} ++PATH_VARS ++ LIBFTDI_USE_FILE ++ LIBFTDI_ROOT_DIR ++ LIBFTDI_INCLUDE_DIR ++ LIBFTDI_INCLUDE_DIRS ++ LIBFTDI_LIBRARY_DIRS ++NO_CHECK_REQUIRED_COMPONENTS_MACRO ++) ++write_basic_package_version_file ( ++LibFTDI1ConfigVersion.cmake ++VERSION ${LIBFTDI_VERSION_STRING} ++COMPATIBILITY AnyNewerVersion ++) + + + install ( FILES +@@ -240,7 +256,7 @@ include(CPack) + + message (STATUS "Summary of build options: + +- Build static libs: ${STATICLIBS} ++ Build shared libs: ${BUILD_SHARED_LIBS} + Build C++ bindings: ${FTDIPP} + Build Python bindings: ${PYTHON_BINDINGS} + Build ftdi_eeprom: ${FTDI_EEPROM} +diff --git a/CMakeOptions.txt b/CMakeOptions.txt +index 07b5887..1088090 100644 +--- a/CMakeOptions.txt ++++ b/CMakeOptions.txt +@@ -1,4 +1,4 @@ +-option ( STATICLIBS "Build static libraries" ON ) ++option ( BUILD_SHARED_LIBS "Build static libraries" OFF ) + option ( BUILD_TESTS "Build unit tests with Boost Unit Test framework" OFF ) + option ( DOCUMENTATION "Generate API documentation with Doxygen" OFF ) + option ( EXAMPLES "Build example programs" ON ) +@@ -6,3 +6,4 @@ option ( FTDIPP "Build C++ binding library libftdi1++" OFF ) + option ( FTDI_EEPROM "Build ftdi_eeprom" ON ) + option ( PYTHON_BINDINGS "Build python bindings via swig" OFF ) + option ( LINK_PYTHON_LIBRARY "Link against python libraries" OFF ) ++option ( ENABLE_STREAMING "Enable data streaming" OFF ) +\ No newline at end of file +diff --git a/cmake/FindConfuse.cmake b/cmake/FindConfuse.cmake +deleted file mode 100644 +index f6af7d5..0000000 +--- a/cmake/FindConfuse.cmake ++++ /dev/null +@@ -1,74 +0,0 @@ +-# libConfuse is a configuration file parser library +-# available at http://www.nongnu.org/confuse/ +-# +-# The module defines the following variables: +-# CONFUSE_FOUND - the system has Confuse +-# CONFUSE_INCLUDE_DIR - where to find confuse.h +-# CONFUSE_INCLUDE_DIRS - confuse includes +-# CONFUSE_LIBRARY - where to find the Confuse library +-# CONFUSE_LIBRARIES - additional libraries +-# CONFUSE_ROOT_DIR - root dir (ex. /usr/local) +- +-#============================================================================= +-# Copyright 2010-2013, Julien Schueller +-# 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 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. +- +-# The views and conclusions contained in the software and documentation are those +-# of the authors and should not be interpreted as representing official policies, +-# either expressed or implied, of the FreeBSD Project. +-#============================================================================= +- +- +-find_path ( CONFUSE_INCLUDE_DIR +- NAMES confuse.h +-) +- +-set ( CONFUSE_INCLUDE_DIRS ${CONFUSE_INCLUDE_DIR} ) +- +-find_library ( CONFUSE_LIBRARY +- NAMES confuse +-) +- +-set ( CONFUSE_LIBRARIES ${CONFUSE_LIBRARY} ) +- +- +-# try to guess root dir from include dir +-if ( CONFUSE_INCLUDE_DIR ) +- string ( REGEX REPLACE "(.*)/include.*" "\\1" CONFUSE_ROOT_DIR ${CONFUSE_INCLUDE_DIR} ) +-# try to guess root dir from library dir +-elseif ( CONFUSE_LIBRARY ) +- string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" CONFUSE_ROOT_DIR ${CONFUSE_LIBRARY} ) +-endif () +- +- +-# handle the QUIETLY and REQUIRED arguments +-include ( FindPackageHandleStandardArgs ) +-find_package_handle_standard_args( Confuse DEFAULT_MSG CONFUSE_LIBRARY CONFUSE_INCLUDE_DIR ) +- +-mark_as_advanced ( +- CONFUSE_LIBRARY +- CONFUSE_LIBRARIES +- CONFUSE_INCLUDE_DIR +- CONFUSE_INCLUDE_DIRS +- CONFUSE_ROOT_DIR +-) +diff --git a/cmake/FindLibConfuse.cmake b/cmake/FindLibConfuse.cmake +new file mode 100644 +index 0000000..19e63c5 +--- /dev/null ++++ b/cmake/FindLibConfuse.cmake +@@ -0,0 +1,21 @@ ++find_package(PkgConfig) ++pkg_check_modules(PC_LibConfuse libconfuse) ++ ++find_path(LibConfuse_INCLUDE_DIR confuse.h ++ PATHS ${PC_LibConfuse_INCLUDEDIR} ${PC_LibConfuse_INCLUDE_DIRS}) ++ ++find_library(LibConfuse_LIBRARY NAMES confuse ++ PATHS ${PC_LibConfuse_LIBDIR} ${PC_LibConfuse_LIBRARY_DIRS}) ++ ++include(FindPackageHandleStandardArgs) ++find_package_handle_standard_args(LibConfuse DEFAULT_MSG LibConfuse_LIBRARY LibConfuse_INCLUDE_DIR) ++ ++if (LibConfuse_FOUND AND NOT TARGET LibConfuse::LibConfuse) ++ add_library(LibConfuse::LibConfuse INTERFACE IMPORTED) ++ set_target_properties(LibConfuse::LibConfuse PROPERTIES ++ INTERFACE_LINK_LIBRARIES "${LibConfuse_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${LibConfuse_INCLUDE_DIR}" ++ ) ++endif() ++ ++mark_as_advanced(LibConfuse_INCLUDE_DIR LibConfuse_LIBRARY) +diff --git a/cmake/FindLibintl.cmake b/cmake/FindLibintl.cmake +deleted file mode 100644 +index 65ed91c..0000000 +--- a/cmake/FindLibintl.cmake ++++ /dev/null +@@ -1,47 +0,0 @@ +-# Try to find Libintl functionality +-# Once done this will define +-# +-# LIBINTL_FOUND - system has Libintl +-# LIBINTL_INCLUDE_DIR - Libintl include directory +-# LIBINTL_LIBRARIES - Libraries needed to use Libintl +-# +-# TODO: This will enable translations only if Gettext functionality is +-# present in libc. Must have more robust system for release, where Gettext +-# functionality can also reside in standalone Gettext library, or the one +-# embedded within kdelibs (cf. gettext.m4 from Gettext source). +- +-# Copyright (c) 2006, Chusslove Illich, +-# Copyright (c) 2007, Alexander Neundorf, +-# +-# Redistribution and use is allowed according to the terms of the BSD license. +-# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +- +-if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND) +- set(Libintl_FIND_QUIETLY TRUE) +-endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND) +- +-find_path(LIBINTL_INCLUDE_DIR libintl.h) +- +-set(LIBINTL_LIB_FOUND FALSE) +- +-if(LIBINTL_INCLUDE_DIR) +- include(CheckFunctionExists) +- check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT) +- +- if (LIBINTL_LIBC_HAS_DGETTEXT) +- set(LIBINTL_LIBRARIES) +- set(LIBINTL_LIB_FOUND TRUE) +- else (LIBINTL_LIBC_HAS_DGETTEXT) +- find_library(LIBINTL_LIBRARIES NAMES intl libintl ) +- if(LIBINTL_LIBRARIES) +- set(LIBINTL_LIB_FOUND TRUE) +- endif(LIBINTL_LIBRARIES) +- endif (LIBINTL_LIBC_HAS_DGETTEXT) +- +-endif(LIBINTL_INCLUDE_DIR) +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND) +- +-mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND) +- +diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake +deleted file mode 100644 +index b90e297..0000000 +--- a/cmake/FindUSB1.cmake ++++ /dev/null +@@ -1,37 +0,0 @@ +-# - Try to find the freetype library +-# Once done this defines +-# +-# LIBUSB_FOUND - system has libusb +-# LIBUSB_INCLUDE_DIR - the libusb include directory +-# LIBUSB_LIBRARIES - Link these to use libusb +- +-# Copyright (c) 2006, 2008 Laurent Montel, +-# +-# Redistribution and use is allowed according to the terms of the BSD license. +-# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +- +- +-if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) +- +- # in cache already +- set(LIBUSB_FOUND TRUE) +- +-else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) +- # use pkg-config to get the directories and then use these values +- # in the FIND_PATH() and FIND_LIBRARY() calls +- find_package(PkgConfig) +- pkg_check_modules(PC_LIBUSB libusb-1.0) +- +- FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h +- PATH_SUFFIXES libusb-1.0 +- PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) +- +- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 +- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) +- +- include(FindPackageHandleStandardArgs) +- FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) +- +- MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) +- +-endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 6fc3c09..0d6a6c1 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -1,9 +1,3 @@ +-# Includes +-include_directories( ${CMAKE_CURRENT_SOURCE_DIR} +- ${CMAKE_CURRENT_BINARY_DIR} +- ) +- +-# Targets + add_executable(simple simple.c) + add_executable(bitbang bitbang.c) + add_executable(bitbang2 bitbang2.c) +@@ -15,33 +9,28 @@ add_executable(baud_test baud_test.c) + add_executable(stream_test stream_test.c) + add_executable(eeprom eeprom.c) + add_executable(async async.c) +-add_executable(purge_test purge_test.c) ++if(NOT MINGW) ++ add_executable(purge_test purge_test.c) ++endif(NOT MINGW) + +-# Linkage +-target_link_libraries(simple ftdi1) +-target_link_libraries(bitbang ftdi1) +-target_link_libraries(bitbang2 ftdi1) +-target_link_libraries(bitbang_cbus ftdi1) +-target_link_libraries(bitbang_ft2232 ftdi1) +-target_link_libraries(find_all ftdi1) +-target_link_libraries(serial_test ftdi1) +-target_link_libraries(baud_test ftdi1) +-target_link_libraries(stream_test ftdi1) +-target_link_libraries(eeprom ftdi1) +-target_link_libraries(async ftdi1) +-target_link_libraries(purge_test ftdi1) ++find_package(LibFTDI REQUIRED) + +-# libftdi++ examples +-if( FTDIPP ) +- include_directories(BEFORE ${CMAKE_SOURCE_DIR}/ftdipp +- ${Boost_INCLUDE_DIRS}) ++target_link_libraries(simple PRIVATE LibFTDI::ftdi1) ++target_link_libraries(bitbang PRIVATE LibFTDI::ftdi1) ++target_link_libraries(bitbang2 PRIVATE LibFTDI::ftdi1) ++target_link_libraries(bitbang_cbus PRIVATE LibFTDI::ftdi1) ++target_link_libraries(bitbang_ft2232 PRIVATE LibFTDI::ftdi1) ++target_link_libraries(find_all PRIVATE LibFTDI::ftdi1) ++target_link_libraries(serial_test PRIVATE LibFTDI::ftdi1) ++target_link_libraries(baud_test PRIVATE LibFTDI::ftdi1) ++target_link_libraries(stream_test PRIVATE LibFTDI::ftdi1) ++target_link_libraries(eeprom PRIVATE LibFTDI::ftdi1) ++target_link_libraries(async PRIVATE LibFTDI::ftdi1) ++if(NOT MINGW) ++ target_link_libraries(purge_test PRIVATE LibFTDI::ftdi1) ++endif(NOT MINGW) + +- # Target ++if( FTDIPP ) + add_executable(find_all_pp find_all_pp.cpp) +- +- # Linkage +- target_link_libraries(find_all_pp ftdipp1) ++ target_link_libraries(find_all_pp PRIVATE LibFTDI::ftdipp1) + endif( FTDIPP ) +- +-# Source includes +-include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src) +diff --git a/examples/bitbang_cbus.c b/examples/bitbang_cbus.c +index b902b50..359097e 100644 +--- a/examples/bitbang_cbus.c ++++ b/examples/bitbang_cbus.c +@@ -60,8 +60,9 @@ int main(void) + while (1) + { + // Set bitmask from input +- fgets(input, sizeof(input) - 1, stdin); +- if (input[0] == '\n') break; ++ char *s = fgets(input, sizeof(input) - 1, stdin); ++ if (s == NULL || input[0] == '\n') ++ break; + bitmask = strtol(input, NULL, 0); + printf("Using bitmask 0x%02x\n", bitmask); + f = ftdi_set_bitmode(ftdi, bitmask, BITMODE_CBUS); +diff --git a/examples/cmake_example/CMakeLists.txt b/examples/cmake_example/CMakeLists.txt +index fe203ed..99571a0 100644 +--- a/examples/cmake_example/CMakeLists.txt ++++ b/examples/cmake_example/CMakeLists.txt +@@ -1,13 +1,10 @@ +-cmake_minimum_required ( VERSION 2.8 ) +- ++cmake_minimum_required ( VERSION 3.0 ) + project ( example C ) + +-find_package ( LibFTDI1 NO_MODULE REQUIRED ) +-include ( ${LIBFTDI_USE_FILE} ) ++find_package ( LibFTDI NO_MODULE REQUIRED ) + + add_executable ( example main.c ) +-target_link_libraries( example ${LIBFTDI_LIBRARIES} ) ++target_link_libraries( example PRIVATE LibFTDI::ftdi1 ) + +-install ( TARGETS example +- DESTINATION bin ) ++install ( TARGETS example DESTINATION bin ) + +diff --git a/ftdi_eeprom/CMakeLists.txt b/ftdi_eeprom/CMakeLists.txt +index 8737c4b..e83a0fc 100644 +--- a/ftdi_eeprom/CMakeLists.txt ++++ b/ftdi_eeprom/CMakeLists.txt +@@ -1,5 +1,5 @@ +-find_package ( Confuse REQUIRED ) +-find_package ( Libintl ) ++find_package (LibConfuse REQUIRED ) ++find_package (Intl) + + # determine docdir + include(GNUInstallDirs) +@@ -13,32 +13,30 @@ endif(NOT CMAKE_INSTALL_DOCDIR) + + message(STATUS "Building ftdi_eeprom") + +-include_directories ( ${CONFUSE_INCLUDE_DIRS} ) +-list ( APPEND libs ${CONFUSE_LIBRARIES} ) +- +-if ( LIBINTL_FOUND ) +- include_directories ( ${LIBINTL_INCLUDE_DIR} ) +- list ( APPEND libs ${LIBINTL_LIBRARIES} ) +-endif () +- +- + # Version defines + set ( EEPROM_MAJOR_VERSION 0 ) + set ( EEPROM_MINOR_VERSION 17 ) + set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} ) + +-include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src ) +-include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) +- + configure_file( + ftdi_eeprom_version.h.in + ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h + ) + + add_executable ( ftdi_eeprom main.c ) +-target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} ) +-if ( LIBINTL_FOUND ) +- target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} ) ++find_package(Threads) ++target_link_libraries ( ftdi_eeprom ++ PRIVATE ++ LibFTDI::ftdi1 ++ LibConfuse::LibConfuse ++ libusb::libusb ++ ) ++target_include_directories(ftdi_eeprom PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ++ ++if ( Intl_FOUND ) ++ target_link_libraries ( ftdi_eeprom PRIVATE ${Intl_LIBRARIES} ) ++ target_include_directories ( ftdi_eeprom PRIVATE ${Intl_INCLUDE_DIRS}) + endif () ++ + install ( TARGETS ftdi_eeprom DESTINATION bin ) + install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} ) +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index fac5bcc..cde211b 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -4,24 +4,29 @@ + set(cpp_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.cpp CACHE INTERNAL "List of cpp sources" ) + set(cpp_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.hpp CACHE INTERNAL "List of cpp headers" ) + +-# Includes +-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR} +- ${CMAKE_SOURCE_DIR}/src) +- +-include_directories(${Boost_INCLUDE_DIRS}) +- + # Shared library +-add_library(ftdipp1 SHARED ${cpp_sources}) ++add_library(ftdipp1 ${cpp_sources}) ++add_library(LibFTDI::ftdipp1 ALIAS ftdipp1) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3) + + # Prevent clobbering each other during the build + set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1) ++set_target_properties(ftdipp1 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # Dependencies +-target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES}) ++target_link_libraries(ftdipp1 ++ PRIVATE ++ libusb::libusb ++ PUBLIC ++ LibFTDI::ftdi1 ++ Boost::headers ++) ++target_include_directories(ftdipp1 PUBLIC ++ $ ++ $ ++ ) + + install ( TARGETS ftdipp1 + RUNTIME DESTINATION bin +@@ -29,18 +34,6 @@ install ( TARGETS ftdipp1 + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + +-# Static library +-if ( STATICLIBS ) +- add_library(ftdipp1-static STATIC ${cpp_sources}) +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- +- install ( TARGETS ftdipp1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +-endif () +- + install ( FILES ${cpp_headers} + DESTINATION include/${PROJECT_NAME} + COMPONENT headers +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 17b3617..3148e02 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,36 +1,57 @@ +-# Includes +-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR} +- ) + + # Version information + set(SNAPSHOT_VERSION "unknown") + execute_process(COMMAND git describe + OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT + RESULT_VARIABLE GIT_DESCRIBE_RESULT ++ ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(${GIT_DESCRIBE_RESULT} STREQUAL 0) + set(SNAPSHOT_VERSION ${GIT_DESCRIBE_OUTPUT}) +-endif () ++endif() + message(STATUS "Detected git snapshot version: ${SNAPSHOT_VERSION}") + + configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h" @ONLY) + + # Targets +-set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) +-set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) ++set(c_sources ++ ftdi.c ++) ++if(ENABLE_STREAMING) ++ set(c_sources ++ ftdi_stream.c ++ ${c_sources} ++ ) ++endif() + +-add_library(ftdi1 SHARED ${c_sources}) ++set(c_headers ++ ftdi.h ++ "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h" ++) ++ ++add_library(ftdi1 ${c_sources} ${c_headers}) ++add_library(LibFTDI::ftdi1 ALIAS ftdi1) ++target_include_directories(ftdi1 PUBLIC ++ $ ++ $ ++ $ ++ ) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) + # Prevent clobbering each other during the build + set_target_properties ( ftdi1 PROPERTIES CLEAN_DIRECT_OUTPUT 1 ) ++set_target_properties ( ftdi1 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + ++target_link_libraries(ftdi1 PRIVATE libusb::libusb) ++if (APPLE) ++ target_link_libraries(ftdi1 PRIVATE ${APPLE_CF} ${APPLE_IOK}) ++endif() + +-# Dependencies +-target_link_libraries(ftdi1 ${LIBUSB_LIBRARIES}) ++if(ENABLE_STREAMING) ++target_compile_definitions(ftdi1 PUBLIC ENABLE_STREAMING) ++endif() + + install ( TARGETS ftdi1 + RUNTIME DESTINATION bin +@@ -38,17 +59,6 @@ install ( TARGETS ftdi1 + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + +-if ( STATICLIBS ) +- add_library(ftdi1-static STATIC ${c_sources}) +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- install ( TARGETS ftdi1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +-endif () +- + install ( FILES ${c_headers} + DESTINATION include/${PROJECT_NAME} + COMPONENT headers +diff --git a/src/ftdi.c b/src/ftdi.c +index f5b7018..03d7b07 100644 +--- a/src/ftdi.c ++++ b/src/ftdi.c +@@ -1328,7 +1328,7 @@ static int ftdi_to_clkbits_AM(int baudrate, unsigned long *encoded_divisor) + AM Type chips have only four fractional subdivisors at value[15:14] + for subdivisors 0, 0.5, 0.25, 0.125 + */ +-static int ftdi_to_clkbits(int baudrate, unsigned int clk, int clk_div, unsigned long *encoded_divisor) ++static int ftdi_to_clkbits(int baudrate, int clk, int clk_div, unsigned long *encoded_divisor) + { + static const char frac_code[8] = {0, 3, 2, 4, 1, 5, 6, 7}; + int best_baud = 0; +@@ -3044,10 +3044,13 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) + case TYPE_2232H: + case TYPE_4232H: + i += 2; ++ /* Fall through*/ + case TYPE_R: + i += 2; ++ /* Fall through*/ + case TYPE_2232C: + i += 2; ++ /* Fall through*/ + case TYPE_AM: + case TYPE_BM: + i += 0x94; +@@ -3438,15 +3441,20 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) + { + case TYPE_230X: + free_start += 2; ++ /* Fall through*/ + case TYPE_232H: + free_start += 6; ++ /* Fall through*/ + case TYPE_2232H: + case TYPE_4232H: + free_start += 2; ++ /* Fall through*/ + case TYPE_R: + free_start += 2; ++ /* Fall through*/ + case TYPE_2232C: + free_start++; ++ /* Fall through*/ + case TYPE_AM: + case TYPE_BM: + free_start += 0x14; +diff --git a/src/ftdi.h b/src/ftdi.h +index fb45008..d2eed07 100644 +--- a/src/ftdi.h ++++ b/src/ftdi.h +@@ -19,6 +19,7 @@ + #define __libftdi_h__ + + #include ++#include + #ifndef _WIN32 + #include + #endif +@@ -475,6 +476,7 @@ enum ftdi_cbusx_func + /** + \brief Progress Info for streaming read + */ ++#ifdef ENABLE_STREAMING + struct size_and_time + { + uint64_t totalBytes; +@@ -483,17 +485,17 @@ struct size_and_time + + typedef struct + { +- struct size_and_time first; +- struct size_and_time prev; +- struct size_and_time current; +- double totalTime; +- double totalRate; +- double currentRate; ++ struct size_and_time first; ++ struct size_and_time prev; ++ struct size_and_time current; ++ double totalTime; ++ double totalRate; ++ double currentRate; + } FTDIProgressInfo; + + typedef int (FTDIStreamCallback)(uint8_t *buffer, int length, + FTDIProgressInfo *progress, void *userdata); +- ++#endif + /** + * Provide libftdi version information + * major: Library major version +@@ -580,8 +582,8 @@ extern "C" + int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize); + int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize); + +- int ftdi_readstream(struct ftdi_context *ftdi, FTDIStreamCallback *callback, +- void *userdata, int packetsPerTransfer, int numTransfers); ++ //int ftdi_readstream(struct ftdi_context *ftdi, FTDIStreamCallback *callback, ++ // void *userdata, int packetsPerTransfer, int numTransfers); + struct ftdi_transfer_control *ftdi_write_data_submit(struct ftdi_context *ftdi, unsigned char *buf, int size); + + struct ftdi_transfer_control *ftdi_read_data_submit(struct ftdi_context *ftdi, unsigned char *buf, int size); +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 392c910..6e7ecaa 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -1,13 +1,7 @@ +-find_package(Boost COMPONENTS unit_test_framework REQUIRED) +- +-enable_testing() +- +-INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/src ${Boost_INCLUDE_DIRS}) +- + set(cpp_tests basic.cpp baudrate.cpp) + + add_executable(test_libftdi1 ${cpp_tests}) +-target_link_libraries(test_libftdi1 ftdi1 ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) ++target_link_libraries(test_libftdi1 PRIVATE LibFTDI::ftdi1 Boost::unit_test_framework) + + add_test(test_libftdi1 test_libftdi1) + +-- +2.31.0.windows.1 + diff --git a/recipes/libftdi/1.x/test_package/CMakeLists.txt b/recipes/libftdi/1.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..efdfd6bd92c12 --- /dev/null +++ b/recipes/libftdi/1.x/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package LANGUAGES CXX) + + +find_package(LibFTDI1 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} + PRIVATE libftdi::ftdipp) + diff --git a/recipes/libftdi/1.x/test_package/conanfile.py b/recipes/libftdi/1.x/test_package/conanfile.py new file mode 100644 index 0000000000000..39f848c25cab4 --- /dev/null +++ b/recipes/libftdi/1.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/libftdi/1.x/test_package/test_package.cpp b/recipes/libftdi/1.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..41ed25029fe83 --- /dev/null +++ b/recipes/libftdi/1.x/test_package/test_package.cpp @@ -0,0 +1,49 @@ +/* final_all_pp.cpp + + Simple libftdi-cpp usage + + This program is distributed under the GPL, version 2 +*/ + +#include + +#include + +int main(int argc, char **argv) +{ + int vid = 0x0403; + int pid = 0x6001; + + // Print whole list + ftdi_version_info version = ftdi_get_library_version(); + std::cout << "FTDI Library Version: " << version.version_str << "\n"; + + Ftdi::Context context; + Ftdi::List *devices = Ftdi::List::find_all(context, vid, pid); + + if (devices->empty()) { + std::cout << "No FTDI devices found" << std::endl; + } + + for (Ftdi::List::iterator it = devices->begin(); it != devices->end(); ++it) { + std::cout << "FTDI (" << &*it << "): " + << it->vendor() << ", " + << it->description() << ", " + << it->serial(); + + // Open test + if(it->open() == 0) { + std::cout << " (Open OK)"; + } + else { + std::cout << " (Open FAILED)"; + } + + it->close(); + + std::cout << "\n"; + } + std::cout << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt b/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb26d0c1b0943 --- /dev/null +++ b/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +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/libftdi/1.x/test_v1_package/conanfile.py b/recipes/libftdi/1.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90c431a11ee68 --- /dev/null +++ b/recipes/libftdi/1.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libftdi/config.yml b/recipes/libftdi/config.yml new file mode 100644 index 0000000000000..f2732cd4daf56 --- /dev/null +++ b/recipes/libftdi/config.yml @@ -0,0 +1,5 @@ +versions: + "0.20": + folder: 0.x + "1.5": + folder: "1.x" diff --git a/recipes/libfuse/2.x.x/conandata.yml b/recipes/libfuse/2.x.x/conandata.yml new file mode 100644 index 0000000000000..b9d8ff65471e6 --- /dev/null +++ b/recipes/libfuse/2.x.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.9.9": + url: "https://github.com/libfuse/libfuse/releases/download/fuse-2.9.9/fuse-2.9.9.tar.gz" + sha256: "d0e69d5d608cc22ff4843791ad097f554dd32540ddc9bed7638cc6fea7c1b4b5" diff --git a/recipes/libfuse/2.x.x/conanfile.py b/recipes/libfuse/2.x.x/conanfile.py new file mode 100644 index 0000000000000..4cc77383a646b --- /dev/null +++ b/recipes/libfuse/2.x.x/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibfuseConan(ConanFile): + name = "libfuse" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libfuse/libfuse" + license = "LGPL-2.1" + description = "The reference implementation of the Linux FUSE interface" + topics = ("fuse", "libfuse", "filesystem", "linux") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def configure(self): + if self.options.shared: + del self.options.fPIC + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os not in ("Linux", "FreeBSD"): + raise ConanInvalidConfiguration("libfuse supports only Linux and FreeBSD") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--enable-lib", + "--disable-util", + ]) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + 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")) + # remove ulockmgr stuff lib and header file + rm(self, "*ulockmgr*", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "fuse") + self.cpp_info.libs = ["fuse"] + self.cpp_info.includedirs = [os.path.join("include", "fuse")] + self.cpp_info.system_libs = ["pthread"] + # libfuse requires this define to compile successfully + self.cpp_info.defines = ["_FILE_OFFSET_BITS=64"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("dl") + diff --git a/recipes/libfuse/2.x.x/test_package/CMakeLists.txt b/recipes/libfuse/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..701d331873021 --- /dev/null +++ b/recipes/libfuse/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libfuse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libfuse::libfuse) +target_compile_definitions(${PROJECT_NAME} PRIVATE FUSE_USE_VERSION=29) diff --git a/recipes/libfuse/2.x.x/test_package/conanfile.py b/recipes/libfuse/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libfuse/2.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/libfuse/2.x.x/test_package/test_package.c b/recipes/libfuse/2.x.x/test_package/test_package.c new file mode 100644 index 0000000000000..5175057625d5c --- /dev/null +++ b/recipes/libfuse/2.x.x/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + fuse_get_context(); + return 0; +} diff --git a/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt b/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfuse/2.x.x/test_v1_package/conanfile.py b/recipes/libfuse/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libfuse/2.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libfuse/all/conandata.yml b/recipes/libfuse/all/conandata.yml new file mode 100644 index 0000000000000..c5d2a101abf4a --- /dev/null +++ b/recipes/libfuse/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.10.5": + url: "https://github.com/libfuse/libfuse/releases/download/fuse-3.10.5/fuse-3.10.5.tar.xz" + sha256: "b2e283485d47404ac896dd0bb7f7ba81e1470838e677e45f659804c3a3b69666" diff --git a/recipes/libfuse/all/conanfile.py b/recipes/libfuse/all/conanfile.py new file mode 100644 index 0000000000000..0f2c7852403e0 --- /dev/null +++ b/recipes/libfuse/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + +required_conan_version = ">=1.53.0" + + +class LibfuseConan(ConanFile): + name = "libfuse" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libfuse/libfuse" + license = "LGPL-2.1" + description = "The reference implementation of the Linux FUSE interface" + topics = ("fuse", "libfuse", "filesystem", "linux") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def configure(self): + if self.options.shared: + del self.options.fPIC + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os not in ("Linux", "FreeBSD"): + raise ConanInvalidConfiguration("libfuse supports only Linux and FreeBSD") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["examples"] = False + tc.project_options["utils"] = False + tc.project_options["tests"] = False + tc.project_options["useroot"] = False + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=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.set_property("pkg_config_name", "fuse3") + self.cpp_info.libs = ["fuse3"] + self.cpp_info.includedirs = [os.path.join("include", "fuse3")] + self.cpp_info.system_libs = ["pthread"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["dl", "rt"]) + diff --git a/recipes/libfuse/all/test_package/CMakeLists.txt b/recipes/libfuse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c8bc174f2164d --- /dev/null +++ b/recipes/libfuse/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libfuse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libfuse::libfuse) +target_compile_definitions(${PROJECT_NAME} PRIVATE FUSE_USE_VERSION=34) diff --git a/recipes/libfuse/all/test_package/conanfile.py b/recipes/libfuse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libfuse/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/libfuse/all/test_package/test_package.c b/recipes/libfuse/all/test_package/test_package.c new file mode 100644 index 0000000000000..5175057625d5c --- /dev/null +++ b/recipes/libfuse/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + fuse_get_context(); + return 0; +} diff --git a/recipes/libfuse/all/test_v1_package/CMakeLists.txt b/recipes/libfuse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libfuse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfuse/all/test_v1_package/conanfile.py b/recipes/libfuse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libfuse/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/libfuse/config.yml b/recipes/libfuse/config.yml new file mode 100644 index 0000000000000..3f5d2920bcb10 --- /dev/null +++ b/recipes/libfuse/config.yml @@ -0,0 +1,5 @@ +versions: + "3.10.5": + folder: all + "2.9.9": + folder: 2.x.x diff --git a/recipes/libgcrypt/all/conandata.yml b/recipes/libgcrypt/all/conandata.yml new file mode 100644 index 0000000000000..ec37a3b999a57 --- /dev/null +++ b/recipes/libgcrypt/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.8.4": + url: "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.gz" + sha256: "fc3c49cc8611068e6008482c3bbee6c66b9287808bbb4e14a473f4cc347b78ce" diff --git a/recipes/libgcrypt/all/conanfile.py b/recipes/libgcrypt/all/conanfile.py new file mode 100644 index 0000000000000..5ec59b6726d5f --- /dev/null +++ b/recipes/libgcrypt/all/conanfile.py @@ -0,0 +1,84 @@ +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 copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibgcryptConan(ConanFile): + name = "libgcrypt" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnupg.org/download/index.html#libgcrypt" + description = "Libgcrypt is a general purpose cryptographic library originally based on code from GnuPG" + topics = ("gcrypt", "gnupg", "gpg", "crypto", "cryptography") + license = "LGPL-2.1-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def configure(self): + if self.options.shared: + del self.options.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("libcap/2.66") + self.requires("libgpg-error/1.36", transitive_headers=True) + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("This recipe only support Linux. You can contribute Windows and/or Macos support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-doc", + f"--with-libgpg-error-prefix={self.dependencies['libgpg-error'].package_folder}", + ]) + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["gcrypt"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libgcrypt/all/test_package/CMakeLists.txt b/recipes/libgcrypt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1a3fbb3bbed04 --- /dev/null +++ b/recipes/libgcrypt/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libgcrypt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libgcrypt::libgcrypt) diff --git a/recipes/libgcrypt/all/test_package/conanfile.py b/recipes/libgcrypt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libgcrypt/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/libgcrypt/all/test_package/test_package.c b/recipes/libgcrypt/all/test_package/test_package.c new file mode 100644 index 0000000000000..205414b7c95c5 --- /dev/null +++ b/recipes/libgcrypt/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "gcrypt.h" + +int main() { + gcry_md_hd_t handle; + gcry_error_t result = gcry_md_open(&handle, 0, GCRY_MD_FLAG_HMAC); + if (result) { + return result; + } + return 0; +} diff --git a/recipes/libgcrypt/all/test_v1_package/CMakeLists.txt b/recipes/libgcrypt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libgcrypt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libgcrypt/all/test_v1_package/conanfile.py b/recipes/libgcrypt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libgcrypt/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/libgcrypt/config.yml b/recipes/libgcrypt/config.yml new file mode 100644 index 0000000000000..f058837ee5cb1 --- /dev/null +++ b/recipes/libgcrypt/config.yml @@ -0,0 +1,3 @@ +versions: + "1.8.4": + folder: all diff --git a/recipes/libgd/all/conandata.yml b/recipes/libgd/all/conandata.yml new file mode 100644 index 0000000000000..e4acad43d15b2 --- /dev/null +++ b/recipes/libgd/all/conandata.yml @@ -0,0 +1,61 @@ +sources: + "2.3.3": + url: "https://github.com/libgd/libgd/archive/gd-2.3.3.tar.gz" + sha256: "24429f9d0dbe0f865aaa4b1a63558242396ba9134e6cfd32ca5e486a84483350" + "2.3.2": + url: "https://github.com/libgd/libgd/archive/gd-2.3.2.tar.gz" + sha256: "dcc22244d775f469bee21dce1ea42552adbb72ba0cc423f9fa6a64601b3a1893" + "2.3.1": + url: "https://github.com/libgd/libgd/archive/gd-2.3.1.tar.gz" + sha256: "795978dcec1bf931148ebcdca9ed1e9cdfa9e71acff8bf035a8867dd1f7af6cd" + "2.3.0": + url: "https://github.com/libgd/libgd/archive/gd-2.3.0.tar.gz" + sha256: "a77dfbbf8bfa7f19c935c11f3b939321f8c1059953a91203158cb2dbf27a0f9e" + "2.2.5": + url: "https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz" + sha256: "a66111c9b4a04e818e9e2a37d7ae8d4aae0939a100a36b0ffb52c706a09074b5" +patches: + "2.3.3": + - patch_file: "patches/2.3.3-qualify-nondll.patch" + patch_description: "use BGD_NONDLL instead NONDLL" + patch_type: "portability" + - patch_file: "patches/2.3.x-png-msvc.patch" + patch_description: "support png on msvc" + patch_type: "portability" + "2.3.2": + - patch_file: "patches/remove-unistd-h.patch" + patch_description: "remove unistd.h to fix build error" + patch_type: "portability" + - patch_file: "patches/2.3.2-qualify-nondll.patch" + patch_description: "use BGD_NONDLL instead NONDLL" + patch_type: "portability" + - patch_file: "patches/2.3.x-png-msvc.patch" + patch_description: "support png on msvc" + patch_type: "portability" + "2.3.1": + - patch_file: "patches/remove-unistd-h.patch" + patch_description: "remove unistd.h to fix build error" + patch_type: "portability" + - patch_file: "patches/qualify-nondll.patch" + patch_description: "use BGD_NONDLL instead NONDLL" + patch_type: "portability" + - patch_file: "patches/2.3.x-png-msvc.patch" + patch_description: "support png on msvc" + patch_type: "portability" + "2.3.0": + - patch_file: "patches/remove-unistd-h.patch" + patch_description: "remove unistd.h to fix build error" + patch_type: "portability" + - patch_file: "patches/qualify-nondll.patch" + patch_description: "use BGD_NONDLL instead NONDLL" + patch_type: "portability" + - patch_file: "patches/2.3.x-png-msvc.patch" + patch_description: "support png on msvc" + patch_type: "conan" + "2.2.5": + - patch_file: "patches/2.2.5-msvc-static-lib.patch" + patch_description: "support static build on msvc" + patch_type: "conan" + - patch_file: "patches/2.2.5-qualify-nondll.patch" + patch_description: "use BGD_NONDLL instead NONDLL" + patch_type: "conan" diff --git a/recipes/libgd/all/conanfile.py b/recipes/libgd/all/conanfile.py new file mode 100644 index 0000000000000..169f9e3ba1f8c --- /dev/null +++ b/recipes/libgd/all/conanfile.py @@ -0,0 +1,138 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +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 LibgdConan(ConanFile): + name = "libgd" + description = ("GD is an open source code library for the dynamic" + "creation of images by programmers.") + license = "BSD-like" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libgd.github.io" + topics = ("images", "graphics") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + "with_jpeg": [True, False], + "with_tiff": [True, False], + "with_freetype": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": False, + "with_jpeg": False, + "with_tiff": False, + "with_freetype": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + if self.options.with_png: + self.requires("libpng/1.6.39") + if is_msvc(self): + self.requires("getopt-for-visual-studio/20200201") + if self.options.with_jpeg: + self.requires("libjpeg/9e") + if self.options.with_tiff: + self.requires("libtiff/4.4.0") + if self.options.with_freetype: + self.requires("freetype/2.12.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_C_STANDARD"] = "99" + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + if Version(self.version) >= "2.3.0": + tc.variables["ENABLE_GD_FORMATS"] = True + tc.variables["ENABLE_PNG"] = self.options.with_png + tc.variables["ENABLE_LIQ"] = False + tc.variables["ENABLE_JPEG"] = self.options.with_jpeg + tc.variables["ENABLE_TIFF"] = self.options.with_tiff + tc.variables["ENABLE_ICONV"] = False + tc.variables["ENABLE_XPM"] = False + tc.variables["ENABLE_FREETYPE"] = self.options.with_freetype + tc.variables["ENABLE_FONTCONFIG"] = False + tc.variables["ENABLE_WEBP"] = False + if Version(self.version) >= "2.3.2": + tc.variables["ENABLE_HEIF"] = False + tc.variables["ENABLE_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.generate() + + def _patch(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "${CMAKE_SOURCE_DIR}", + "${CMAKE_CURRENT_SOURCE_DIR}") + replace_in_file(self, cmakelists, + "SET(CMAKE_MODULE_PATH \"${GD_SOURCE_DIR}/cmake/modules\")", + "LIST(APPEND CMAKE_MODULE_PATH \"${GD_SOURCE_DIR}/cmake/modules\")") + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "RUNTIME DESTINATION bin", + "RUNTIME DESTINATION bin BUNDLE DESTINATION bin") + + def build(self): + self._patch() + 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, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + prefix_libs = "lib" if self.settings.os == "Windows" else "" + suffix_libs = "_static" if self.settings.os == "Windows" and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix_libs}gd{suffix_libs}"] + self.cpp_info.set_property("pkg_config_name", "gdlib") + + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("BGD_NONDLL") + self.cpp_info.defines.append("BGDWIN32") + if self.settings.os in ("FreeBSD", "Linux", "Android", "SunOS", "AIX"): + self.cpp_info.system_libs.append("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 once cmake_find_package_* generators removed + self.cpp_info.names["pkg_config"]= "gdlib" diff --git a/recipes/libgd/all/patches/2.2.5-msvc-static-lib.patch b/recipes/libgd/all/patches/2.2.5-msvc-static-lib.patch new file mode 100644 index 0000000000000..682dd2a2d7684 --- /dev/null +++ b/recipes/libgd/all/patches/2.2.5-msvc-static-lib.patch @@ -0,0 +1,17 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 08fd699..cae9cb6 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -94,7 +94,11 @@ endif() + + if (WIN32 AND NOT MINGW AND NOT MSYS) + # SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib") +- SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1) ++ ++ if (BUILD_STATIC_LIBS) ++ SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1) ++ endif() ++ + ENDIF(WIN32 AND NOT MINGW AND NOT MSYS) + + if (MINGW OR MSYS) diff --git a/recipes/libgd/all/patches/2.2.5-qualify-nondll.patch b/recipes/libgd/all/patches/2.2.5-qualify-nondll.patch new file mode 100644 index 0000000000000..f048af312f44b --- /dev/null +++ b/recipes/libgd/all/patches/2.2.5-qualify-nondll.patch @@ -0,0 +1,30 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -96,7 +96,7 @@ if (WIN32 AND NOT MINGW AND NOT MSYS) + # SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib") + + if (BUILD_STATIC_LIBS) +- SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1) ++ SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS BGD_NONDLL=1) + endif() + + ENDIF(WIN32 AND NOT MINGW AND NOT MSYS) +--- a/src/gd.h ++++ b/src/gd.h +@@ -40,14 +40,14 @@ extern "C" { + and other languages. This breaks ABI compatibility + with previous DLL revs, but it's necessary. */ + +-/* 2.0.29: WIN32 programmers can declare the NONDLL macro if they ++/* 2.0.29: WIN32 programmers can declare the BGD_NONDLL macro if they + wish to build gd as a static library or by directly including + the gd sources in a project. */ + + /* http://gcc.gnu.org/wiki/Visibility */ + #if defined(_WIN32) || defined(CYGWIN) || defined(_WIN32_WCE) + # ifdef BGDWIN32 +-# ifdef NONDLL ++# ifdef BGD_NONDLL + # define BGD_EXPORT_DATA_PROT + # else + # ifdef __GNUC__ diff --git a/recipes/libgd/all/patches/2.3.2-qualify-nondll.patch b/recipes/libgd/all/patches/2.3.2-qualify-nondll.patch new file mode 100644 index 0000000000000..0eccaf9b59f38 --- /dev/null +++ b/recipes/libgd/all/patches/2.3.2-qualify-nondll.patch @@ -0,0 +1,34 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 509c422..1d1be42 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -106,7 +106,7 @@ if (WIN32 AND NOT MINGW AND NOT MSYS) + # SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib") + + if (BUILD_STATIC_LIBS) +- SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1) ++ SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS BGD_NONDLL=1) + endif() + + ENDIF(WIN32 AND NOT MINGW AND NOT MSYS) +diff --git a/src/gd.h b/src/gd.h +index 4302812..e4a1c0b 100644 +--- a/src/gd.h ++++ b/src/gd.h +@@ -40,14 +40,14 @@ extern "C" { + and other languages. This breaks ABI compatibility + with previous DLL revs, but it's necessary. */ + +-/* 2.0.29: WIN32 programmers can declare the NONDLL macro if they ++/* 2.0.29: WIN32 programmers can declare the BGD_NONDLL macro if they + wish to build gd as a static library or by directly including + the gd sources in a project. */ + + /* http://gcc.gnu.org/wiki/Visibility */ + #if defined(_WIN32) || defined(CYGWIN) || defined(_WIN32_WCE) + # ifdef BGDWIN32 +-# ifdef NONDLL ++# ifdef BGD_NONDLL + # define BGD_EXPORT_DATA_PROT + # else + # ifdef __GNUC__ diff --git a/recipes/libgd/all/patches/2.3.3-qualify-nondll.patch b/recipes/libgd/all/patches/2.3.3-qualify-nondll.patch new file mode 100644 index 0000000000000..8dfcac14807e1 --- /dev/null +++ b/recipes/libgd/all/patches/2.3.3-qualify-nondll.patch @@ -0,0 +1,26 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3839bc7..3b271a8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -86,7 +86,7 @@ if (WIN32 AND NOT MINGW AND NOT MSYS) + # SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib") + + if (BUILD_STATIC_LIBS) +- SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1) ++ SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS BGD_NONDLL=1) + endif() + + ENDIF(WIN32 AND NOT MINGW AND NOT MSYS) +diff --git a/src/gd.h b/src/gd.h +index 3056039..e3635ab 100644 +--- a/src/gd.h ++++ b/src/gd.h +@@ -47,7 +47,7 @@ extern "C" { + /* http://gcc.gnu.org/wiki/Visibility */ + #if defined(_WIN32) || defined(CYGWIN) || defined(_WIN32_WCE) + # ifdef BGDWIN32 +-# ifdef NONDLL ++# ifdef BGD_NONDLL + # define BGD_EXPORT_DATA_PROT + # else + # ifdef __GNUC__ diff --git a/recipes/libgd/all/patches/2.3.x-png-msvc.patch b/recipes/libgd/all/patches/2.3.x-png-msvc.patch new file mode 100644 index 0000000000000..48ec2476a4c9b --- /dev/null +++ b/recipes/libgd/all/patches/2.3.x-png-msvc.patch @@ -0,0 +1,54 @@ +--- src/webpng.c ++++ src/webpng.c +@@ -19,7 +19,7 @@ + + /* Bring in the gd library functions */ + #include "gd.h" +- ++#include + #define KEEP_TRANS (-100) + + static const char argv0[] = "webpng"; +@@ -64,7 +64,7 @@ + FILE *in; + FILE *out; + const char *infile; +- char *tmpfile; ++ char *tmppath; + int i; + int use_stdin_stdout = 0; + +@@ -258,19 +258,24 @@ + size_t len = filelen + 8; + int outfd; + +- tmpfile = malloc(len); +- if (tmpfile == NULL) ++#ifdef _MSC_VER ++ out = tmpfile(); ++ if (out == NULL) ++ err("could not create temporary file"); ++#else ++ tmppath = malloc(len); ++ if (tmppath == NULL) + err("could not create a tempfile"); +- memcpy(tmpfile, infile, filelen); +- strcpy(tmpfile + filelen, ".XXXXXX"); +- +- outfd = mkstemp(tmpfile); ++ memcpy(tmppath, infile, filelen); ++ strcpy(tmppath + filelen, ".XXXXXX"); ++ tmpnam(tmppath); ++ outfd = mkstemp(tmppath); + if (outfd == -1) +- err("could not open %s", tmpfile); +- ++ err("could not open %s", tmppath); + out = fdopen(outfd, "wb"); + if (!out) +- err("could not open %s", tmpfile); ++ err("could not open %s", tmppath); ++#endif + } + + /* Write the new PNG. */ diff --git a/recipes/libgd/all/patches/qualify-nondll.patch b/recipes/libgd/all/patches/qualify-nondll.patch new file mode 100644 index 0000000000000..872372de7994c --- /dev/null +++ b/recipes/libgd/all/patches/qualify-nondll.patch @@ -0,0 +1,30 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -109,7 +109,7 @@ if (WIN32 AND NOT MINGW AND NOT MSYS) + # SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib") + + if (BUILD_STATIC_LIBS) +- SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1) ++ SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS BGD_NONDLL=1) + endif() + + ENDIF(WIN32 AND NOT MINGW AND NOT MSYS) +--- a/src/gd.h ++++ b/src/gd.h +@@ -40,14 +40,14 @@ extern "C" { + and other languages. This breaks ABI compatibility + with previous DLL revs, but it's necessary. */ + +-/* 2.0.29: WIN32 programmers can declare the NONDLL macro if they ++/* 2.0.29: WIN32 programmers can declare the BGD_NONDLL macro if they + wish to build gd as a static library or by directly including + the gd sources in a project. */ + + /* http://gcc.gnu.org/wiki/Visibility */ + #if defined(_WIN32) || defined(CYGWIN) || defined(_WIN32_WCE) + # ifdef BGDWIN32 +-# ifdef NONDLL ++# ifdef BGD_NONDLL + # define BGD_EXPORT_DATA_PROT + # else + # ifdef __GNUC__ diff --git a/recipes/libgd/all/patches/remove-unistd-h.patch b/recipes/libgd/all/patches/remove-unistd-h.patch new file mode 100644 index 0000000000000..da69a5501e744 --- /dev/null +++ b/recipes/libgd/all/patches/remove-unistd-h.patch @@ -0,0 +1,12 @@ +diff --git a/src/getopt.c b/src/getopt.c +index 8651b87..b5eaa18 100644 +--- a/src/getopt.c ++++ b/src/getopt.c +@@ -33,7 +33,6 @@ + #include + #include + #include +-#include + + int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ diff --git a/recipes/libgd/all/test_package/CMakeLists.txt b/recipes/libgd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc37e91faebeb --- /dev/null +++ b/recipes/libgd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(libgd CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libgd::libgd) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libgd/all/test_package/conanfile.py b/recipes/libgd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libgd/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/libgd/all/test_package/test_package.c b/recipes/libgd/all/test_package/test_package.c new file mode 100644 index 0000000000000..4fed890149612 --- /dev/null +++ b/recipes/libgd/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "gd.h" + +int main() { + gdImagePtr im; + im = gdImageCreate(10, 10); + gdImageDestroy (im); + return 0; +} diff --git a/recipes/libgd/all/test_v1_package/CMakeLists.txt b/recipes/libgd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libgd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libgd/all/test_v1_package/conanfile.py b/recipes/libgd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libgd/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libgd/config.yml b/recipes/libgd/config.yml new file mode 100644 index 0000000000000..5343c7968ac52 --- /dev/null +++ b/recipes/libgd/config.yml @@ -0,0 +1,11 @@ +versions: + "2.3.3": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.5": + folder: all diff --git a/recipes/libgeotiff/all/conandata.yml b/recipes/libgeotiff/all/conandata.yml new file mode 100644 index 0000000000000..d67cfa6fff858 --- /dev/null +++ b/recipes/libgeotiff/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.7.1": + url: "https://github.com/OSGeo/libgeotiff/releases/download/1.7.1/libgeotiff-1.7.1.tar.gz" + sha256: "05ab1347aaa471fc97347d8d4269ff0c00f30fa666d956baba37948ec87e55d6" + "1.7.0": + url: "https://github.com/OSGeo/libgeotiff/releases/download/1.7.0/libgeotiff-1.7.0.tar.gz" + sha256: "fc304d8839ca5947cfbeb63adb9d1aa47acef38fc6d6689e622926e672a99a7e" + "1.6.0": + url: "https://github.com/OSGeo/libgeotiff/releases/download/1.6.0/libgeotiff-1.6.0.tar.gz" + sha256: "9311017e5284cffb86f2c7b7a9df1fb5ebcdc61c30468fb2e6bca36e4272ebca" + "1.5.1": + url: "https://github.com/OSGeo/libgeotiff/releases/download/1.5.1/libgeotiff-1.5.1.tar.gz" + sha256: "f9e99733c170d11052f562bcd2c7cb4de53ed405f7acdde4f16195cd3ead612c" +patches: + "1.7.1": + - patch_file: "patches/fix-cmake-1.7.1.patch" + "1.7.0": + - patch_file: "patches/fix-cmake-1.6.0.patch" + "1.6.0": + - patch_file: "patches/fix-cmake-1.6.0.patch" + "1.5.1": + - patch_file: "patches/fix-cmake-1.5.1.patch" diff --git a/recipes/libgeotiff/all/conanfile.py b/recipes/libgeotiff/all/conanfile.py new file mode 100644 index 0000000000000..dd7258309aa60 --- /dev/null +++ b/recipes/libgeotiff/all/conanfile.py @@ -0,0 +1,126 @@ +from conan import ConanFile +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, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class LibgeotiffConan(ConanFile): + name = "libgeotiff" + description = "Libgeotiff is an open source library normally hosted on top " \ + "of libtiff for reading, and writing GeoTIFF information tags." + license = ["MIT", "BSD-3-Clause"] + topics = ("geotiff", "tiff") + homepage = "https://github.com/OSGeo/libgeotiff" + 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, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libtiff/4.4.0") + self.requires("proj/9.1.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_UTILITIES"] = False + tc.variables["WITH_TOWGS84"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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, "doc")) + rmdir(self, os.path.join(self.package_folder, "share")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_vars_file) + ) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_target_file), + {"geotiff_library": "geotiff::geotiff"} + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent("""\ + set(GEOTIFF_FOUND ${GeoTIFF_FOUND}) + if(DEFINED GeoTIFF_INCLUDE_DIR) + set(GEOTIFF_INCLUDE_DIR ${GeoTIFF_INCLUDE_DIR}) + endif() + if(DEFINED GeoTIFF_LIBRARIES) + set(GEOTIFF_LIBRARIES ${GeoTIFF_LIBRARIES}) + endif() + """) + 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(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_vars_file(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_target_file(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "GeoTIFF") + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_file]) + self.cpp_info.set_property("cmake_file_name", "geotiff") + self.cpp_info.set_property("cmake_target_name", "geotiff_library") + + self.cpp_info.names["cmake_find_package"] = "GeoTIFF" + self.cpp_info.names["cmake_find_package_multi"] = "geotiff" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_vars_file] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_target_file] + + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch b/recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch new file mode 100644 index 0000000000000..ad58c3306c406 --- /dev/null +++ b/recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch @@ -0,0 +1,102 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,7 @@ + # Author: Mateusz Loskot + # + ############################################################################### ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(GeoTIFF) + + SET(GEOTIFF_LIB_NAME geotiff) +@@ -12,7 +13,6 @@ SET(GEOTIFF_LIBRARY_TARGET geotiff_library) + + ############################################################################## + # CMake settings +-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) + + SET(CMAKE_COLOR_MAKEFILE ON) + +@@ -54,7 +54,7 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug) + SET(GEOTIFF_BUILD_PEDANTIC TRUE) + ENDIF() + +-if (CMAKE_MAJOR_VERSION GREATER 2) ++if(0) # No ! we want CMP0042 NEW for relocatable shared lib on macOS + cmake_policy(SET CMP0022 OLD) # interface link libraries + cmake_policy(SET CMP0042 OLD) # osx rpath + endif() +@@ -80,8 +80,9 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + + IF(WIN32) + IF(MSVC) +- ADD_DEFINITIONS(-DBUILD_AS_DLL=1) +- ADD_DEFINITIONS(/DW4) ++ IF(BUILD_SHARED_LIBS) ++ ADD_DEFINITIONS(-DBUILD_AS_DLL=1) ++ ENDIF() + if (NOT (MSVC_VERSION VERSION_LESS 1400)) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) +@@ -92,7 +93,7 @@ IF(WIN32) + ENDIF() + + IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +- SET(COMPILE_FLAGS "-fPIC -Wall -Wno-long-long") ++ SET(COMPILE_FLAGS "-Wall -Wno-long-long") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98") + IF(GEOTIFF_BUILD_PEDANTIC) +@@ -120,6 +121,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) + INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff) + + # TIFF support - required, default=ON ++if(0) + SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built") + + FIND_PACKAGE(PROJ NO_MODULE QUIET) +@@ -192,6 +194,7 @@ IF(WITH_TIFF) + ADD_DEFINITIONS(-DHAVE_TIFF=1) + ENDIF(TIFF_FOUND) + ENDIF(WITH_TIFF) ++endif() + + # Turn off TOWGS84 support + SET(WITH_TOWGS84 TRUE CACHE BOOL "Build with TOWGS84 support") +@@ -300,7 +303,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include) + ############################################################################### + # Build libxtiff library + +-ADD_SUBDIRECTORY(libxtiff) + + ############################################################################### + # Build libgeotiff library +@@ -345,7 +347,7 @@ IF(UNIX) + VERSION ${LINK_VERSION} + SOVERSION ${LINK_SOVERSION} + CLEAN_DIRECT_OUTPUT 1 ) +- if (APPLE) ++ if (0) # no custom install_name, we want @rpath + set_target_properties( + ${GEOTIFF_LIBRARY_TARGET} + PROPERTIES +@@ -361,11 +363,15 @@ ENDIF(UNIX) + SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES + OUTPUT_NAME ${GEOTIFF_LIB_NAME}) + +-TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET} +- ${TIFF_LIBRARIES} +- ${PROJ_LIBRARIES} +- ${ZLIB_LIBRARIES} +- ${JPEG_LIBRARIES}) ++find_package(TIFF REQUIRED) ++target_link_libraries(${GEOTIFF_LIBRARY_TARGET} TIFF::TIFF) ++find_package(proj4 QUIET CONFIG) ++if(TARGET PROJ4::proj) ++ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ4::proj) ++else() ++ find_package(proj REQUIRED CONFIG) ++ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ::proj) ++endif() + + # INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET} + # RUNTIME DESTINATION ${GEOTIFF_BIN_DIR} diff --git a/recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch b/recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch new file mode 100644 index 0000000000000..b6dc6db8f9dce --- /dev/null +++ b/recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch @@ -0,0 +1,102 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,7 @@ + # Author: Mateusz Loskot + # + ############################################################################### ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(GeoTIFF) + + SET(GEOTIFF_LIB_NAME geotiff) +@@ -12,7 +13,6 @@ SET(GEOTIFF_LIBRARY_TARGET geotiff_library) + + ############################################################################## + # CMake settings +-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) + + SET(CMAKE_COLOR_MAKEFILE ON) + +@@ -54,7 +54,7 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug) + SET(GEOTIFF_BUILD_PEDANTIC TRUE) + ENDIF() + +-if (CMAKE_MAJOR_VERSION GREATER 2) ++if(0) # No ! we want CMP0042 NEW for relocatable shared lib on macOS + cmake_policy(SET CMP0022 OLD) # interface link libraries + cmake_policy(SET CMP0042 OLD) # osx rpath + endif() +@@ -80,8 +80,9 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + + IF(WIN32) + IF(MSVC) +- ADD_DEFINITIONS(-DBUILD_AS_DLL=1) +- ADD_DEFINITIONS(/DW4) ++ IF(BUILD_SHARED_LIBS) ++ ADD_DEFINITIONS(-DBUILD_AS_DLL=1) ++ ENDIF() + if (NOT (MSVC_VERSION VERSION_LESS 1400)) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) +@@ -92,7 +93,7 @@ IF(WIN32) + ENDIF() + + IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +- SET(COMPILE_FLAGS "-fPIC -Wall -Wno-long-long") ++ SET(COMPILE_FLAGS "-Wall -Wno-long-long") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98") + IF(GEOTIFF_BUILD_PEDANTIC) +@@ -120,6 +121,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) + INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff) + + # TIFF support - required, default=ON ++if(0) + SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built") + + FIND_PACKAGE(PROJ NO_MODULE QUIET) +@@ -192,6 +194,7 @@ IF(WITH_TIFF) + ADD_DEFINITIONS(-DHAVE_TIFF=1) + ENDIF(TIFF_FOUND) + ENDIF(WITH_TIFF) ++endif() + + # Turn off TOWGS84 support + SET(WITH_TOWGS84 TRUE CACHE BOOL "Build with TOWGS84 support") +@@ -301,7 +304,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include) + ############################################################################### + # Build libxtiff library + +-ADD_SUBDIRECTORY(libxtiff) + + ############################################################################### + # Build libgeotiff library +@@ -346,7 +348,7 @@ IF(UNIX) + VERSION ${LINK_VERSION} + SOVERSION ${LINK_SOVERSION} + CLEAN_DIRECT_OUTPUT 1 ) +- if (APPLE) ++ if (0) # no custom install_name, we want @rpath + set_target_properties( + ${GEOTIFF_LIBRARY_TARGET} + PROPERTIES +@@ -362,11 +364,15 @@ ENDIF(UNIX) + SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES + OUTPUT_NAME ${GEOTIFF_LIB_NAME}) + +-TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET} +- ${TIFF_LIBRARIES} +- ${PROJ_LIBRARIES} +- ${ZLIB_LIBRARIES} +- ${JPEG_LIBRARIES}) ++find_package(TIFF REQUIRED) ++target_link_libraries(${GEOTIFF_LIBRARY_TARGET} TIFF::TIFF) ++find_package(proj4 QUIET CONFIG) ++if(TARGET PROJ4::proj) ++ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ4::proj) ++else() ++ find_package(proj REQUIRED CONFIG) ++ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ::proj) ++endif() + + # INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET} + # RUNTIME DESTINATION ${GEOTIFF_BIN_DIR} diff --git a/recipes/libgeotiff/all/patches/fix-cmake-1.7.1.patch b/recipes/libgeotiff/all/patches/fix-cmake-1.7.1.patch new file mode 100644 index 0000000000000..4922575766992 --- /dev/null +++ b/recipes/libgeotiff/all/patches/fix-cmake-1.7.1.patch @@ -0,0 +1,78 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,7 @@ + # Author: Mateusz Loskot + # + ############################################################################### ++CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) + PROJECT(GeoTIFF) + + SET(GEOTIFF_LIB_NAME geotiff) +@@ -12,7 +13,6 @@ SET(GEOTIFF_LIBRARY_TARGET geotiff_library) + + ############################################################################## + # CMake settings +-CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) + + SET(CMAKE_COLOR_MAKEFILE ON) + +@@ -88,7 +88,7 @@ IF(WIN32) + ENDIF() + + IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +- SET(COMPILE_FLAGS "-fPIC -Wall -Wno-long-long") ++ SET(COMPILE_FLAGS "-Wall -Wno-long-long") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98") + IF(GEOTIFF_BUILD_PEDANTIC) +@@ -115,15 +115,14 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff) + # TIFF support - required, default=ON + SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built") + +-FIND_PACKAGE(PROJ NO_MODULE QUIET) +-if (NOT PROJ_FOUND) ++FIND_PACKAGE(proj NO_MODULE QUIET) ++if (0) + FIND_PACKAGE(PROJ) + endif () + + IF(PROJ_FOUND) + INCLUDE_DIRECTORIES(${PROJ_INCLUDE_DIR}) + ELSE() +- MESSAGE(FATAL_ERROR "Failed to detect PROJ >= 6") + ENDIF() + + # Zlib support - optional, default=OFF +@@ -164,6 +163,7 @@ IF(WITH_TIFF) + FIND_PACKAGE(TIFF REQUIRED) + endif () + ++ if(0) + IF(TIFF_FOUND) + # Confirm required API is available + INCLUDE(CheckFunctionExists) +@@ -184,6 +184,7 @@ IF(WITH_TIFF) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) + ADD_DEFINITIONS(-DHAVE_TIFF=1) + ENDIF(TIFF_FOUND) ++ endif() + ENDIF(WITH_TIFF) + + # Turn off TOWGS84 support +@@ -275,7 +276,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR}) + ############################################################################### + # Build libxtiff library + +-ADD_SUBDIRECTORY(libxtiff) + + ############################################################################### + # Build libgeotiff library +@@ -319,7 +319,7 @@ if(UNIX) + VERSION ${LINK_VERSION} + SOVERSION ${LINK_SOVERSION} + CLEAN_DIRECT_OUTPUT 1 ) +- if (APPLE) ++ if (0) # no custom install_name, we want @rpath + set_target_properties( + ${GEOTIFF_LIBRARY_TARGET} + PROPERTIES diff --git a/recipes/libgeotiff/all/test_package/CMakeLists.txt b/recipes/libgeotiff/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6f7f6667348cb --- /dev/null +++ b/recipes/libgeotiff/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(geotiff REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE geotiff_library) diff --git a/recipes/libgeotiff/all/test_package/conanfile.py b/recipes/libgeotiff/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libgeotiff/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/libgeotiff/all/test_package/test_package.c b/recipes/libgeotiff/all/test_package/test_package.c new file mode 100644 index 0000000000000..93799f1d7b5ea --- /dev/null +++ b/recipes/libgeotiff/all/test_package/test_package.c @@ -0,0 +1,98 @@ +/* + * makegeo.c -- example client code for LIBGEO geographic + * TIFF tag support. + * + * Author: Niles D. Ritter + * + * Revision History: + * 31 October, 1995 Fixed reversed lat-long coordinates NDR + * + */ + +#include "geotiffio.h" +#include "xtiffio.h" +#include +#include + +void SetUpTIFFDirectory(TIFF *tif); +void SetUpGeoKeys(GTIF *gtif); +void WriteImage(TIFF *tif); + +#define WIDTH 20L +#define HEIGHT 20L + +int main() +{ + char *fname = "newgeo.tif"; + TIFF *tif; /* TIFF-level descriptor */ + GTIF *gtif; /* GeoKey-level descriptor */ + + tif=XTIFFOpen(fname,"w"); + if (!tif) goto failure; + + gtif = GTIFNew(tif); + if (!gtif) + { + printf("failed in GTIFNew\n"); + goto failure; + } + + SetUpTIFFDirectory(tif); + SetUpGeoKeys(gtif); + WriteImage(tif); + + GTIFWriteKeys(gtif); + GTIFFree(gtif); + XTIFFClose(tif); + return 0; + +failure: + printf("failure in makegeo\n"); + if (tif) TIFFClose(tif); + if (gtif) GTIFFree(gtif); + return -1; +} + + +void SetUpTIFFDirectory(TIFF *tif) +{ + double tiepoints[6]={0,0,0,130.0,32.0,0.0}; + double pixscale[3]={1,1,0}; + + TIFFSetField(tif,TIFFTAG_IMAGEWIDTH, WIDTH); + TIFFSetField(tif,TIFFTAG_IMAGELENGTH, HEIGHT); + TIFFSetField(tif,TIFFTAG_COMPRESSION, COMPRESSION_NONE); + TIFFSetField(tif,TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(tif,TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(tif,TIFFTAG_ROWSPERSTRIP, 20L); + + TIFFSetField(tif,TIFFTAG_GEOTIEPOINTS, 6,tiepoints); + TIFFSetField(tif,TIFFTAG_GEOPIXELSCALE, 3,pixscale); +} + +void SetUpGeoKeys(GTIF *gtif) +{ + GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelGeographic); + GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea); + GTIFKeySet(gtif, GTCitationGeoKey, TYPE_ASCII, 0, "Just An Example"); + GTIFKeySet(gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, KvUserDefined); + GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII, 0, "Everest Ellipsoid Used."); + GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT, 1, Angular_Degree); + GTIFKeySet(gtif, GeogLinearUnitsGeoKey, TYPE_SHORT, 1, Linear_Meter); + GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1, KvUserDefined); + GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1, Ellipse_Everest_1830_1967_Definition); + GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey, TYPE_DOUBLE, 1, (double)6377298.556); + GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)300.8017); +} + +void WriteImage(TIFF *tif) +{ + int i; + char buffer[WIDTH]; + + memset(buffer,0,(size_t)WIDTH); + for (i=0;i= "12") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags += ["-FS"] + tc.make_args += ["-C", "intl"] + env = tc.environment() + if is_msvc(self) or self._is_clang_cl: + def programs(): + rc = None + if self.settings.arch == "x86_64": + rc = "windres --target=pe-x86-64" + elif self.settings.arch == "x86": + rc = "windres --target=pe-i386" + if self._is_clang_cl: + return os.environ.get("CC", "clang-cl"), os.environ.get("AR", "llvm-lib"), os.environ.get("LD", "lld-link"), rc + if is_msvc(self): + return "cl -nologo", "lib", "link", rc + + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + cc, ar, link, rc = programs() + env.define("CC", f"{compile_wrapper} {cc}") + env.define("CXX", f"{compile_wrapper} {cc}") + env.define("LD", link) + env.define("AR", f"{ar_wrapper} {ar}") + env.define("NM", "dumpbin -symbols") + env.define("RANLIB", ":") + env.define("STRIP", ":") + if rc is not None: + env.define("RC", rc) + env.define("WINDRES", rc) + tc.generate(env) + + if is_msvc(self) or self._is_clang_cl: + # 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 build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure("gettext-tools") + autotools.make() + + def package(self): + dest_lib_dir = os.path.join(self.package_folder, "lib") + dest_runtime_dir = os.path.join(self.package_folder, "bin") + dest_include_dir = os.path.join(self.package_folder, "include") + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*gnuintl*.dll", self.build_folder, dest_runtime_dir, keep_path=False) + copy(self, "*gnuintl*.lib", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*gnuintl*.a", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*gnuintl*.so*", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*gnuintl*.dylib", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*libgnuintl.h", self.build_folder, dest_include_dir, keep_path=False) + rename(self, os.path.join(dest_include_dir, "libgnuintl.h"), os.path.join(dest_include_dir, "libintl.h")) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Intl") + self.cpp_info.set_property("cmake_target_name", "Intl::Intl") + self.cpp_info.libs = ["gnuintl"] + if is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") + + self.cpp_info.names["cmake_find_package"] = "Intl" + self.cpp_info.names["cmake_find_package_multi"] = "Intl" + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch b/recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch new file mode 100644 index 0000000000000..194989aac247c --- /dev/null +++ b/recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch @@ -0,0 +1,362 @@ +From b33dca8eecdc1eb30bb3747df563faabf729f001 Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Thu, 4 Jul 2019 16:27:33 +0200 +Subject: [PATCH 1/2] build: Fix build errors with MSVC. + +* gettext-tools/libgettextpo/exported.sh.in: Remove one level of eval. +* gettext-tools/libgettextpo/Makefile.am (config.h): Redirect compiler output to +stderr. Remove symbols that contain an '@'. +* libtextstyle/lib/Makefile.am (config.h): Likewise. + +build: Fix build error with MSVC. + +* gettext-runtime/intl/export.h (LIBINTL_DLL_EXPORTED): Define differently for +MSVC. + +build: Fix build error with MSVC. + +* gettext-runtime/intl/Makefile.am (INTL_WINDOWS_LIBS): New variable. +(OTHER_LDFLAGS): Add it. + +build: Fix build errors with MSVC. + +* gettext-tools/src/lang-table.h (language_table, language_variant_table): +Declare with C linkage. +* gettext-tools/src/read-po.h (input_format_po): Likewise. +* gettext-tools/src/read-properties.h (input_format_properties): Likewise. +* gettext-tools/src/read-stringtable.h (input_format_stringtable): Likewise. +* gettext-tools/src/write-properties.h (output_format_properties): Likewise. +* gettext-tools/src/write-stringtable.h (output_format_stringtable): Likewise. + +intl: Don't export the glwthread* symbols from libintl on native Windows. + +* gettext-runtime/intl/Makefile.am (OTHER_LDFLAGS): Add an -export-symbols-regex +option. +--- + gettext-runtime/intl/Makefile.in | 10 +++++++++- + gettext-runtime/intl/export.h | 2 ++ + gettext-tools/intl/Makefile.in | 10 +++++++++- + gettext-tools/libgettextpo/Makefile.in | 4 ++-- + gettext-tools/libgettextpo/exported.sh.in | 5 ++--- + gettext-tools/src/lang-table.h | 14 +++++++++++++- + gettext-tools/src/read-po.h | 14 +++++++++++++- + gettext-tools/src/read-properties.h | 14 +++++++++++++- + gettext-tools/src/read-stringtable.h | 14 +++++++++++++- + gettext-tools/src/write-properties.h | 14 +++++++++++++- + gettext-tools/src/write-stringtable.h | 14 +++++++++++++- + libtextstyle/lib/Makefile.in | 4 ++-- + 12 files changed, 104 insertions(+), 15 deletions(-) + +diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in +index fe59cd4aa..10aaa89fe 100644 +--- a/gettext-runtime/intl/Makefile.in ++++ b/gettext-runtime/intl/Makefile.in +@@ -1416,6 +1416,11 @@ libintl_la_DEPENDENCIES = $(WOE32_LIBADD) + libgnuintl_la_LIBADD = $(WOE32_LIBADD) + libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD) + ++# langprefs.c (_nl_language_preferences_win32_95) uses functions from ++# advapi32.dll. ++@WOE32_TRUE@INTL_WINDOWS_LIBS = -ladvapi32 ++@WOE32_FALSE@INTL_WINDOWS_LIBS = ++ + # Libtool's library version information for libintl. + # Before making a gettext release, you must change this according to the + # libtool documentation, section "Library interface versions". +@@ -1424,8 +1429,11 @@ LTV_REVISION = 6 + LTV_AGE = 1 + + # How to build libintl.la and libgnuintl.la. ++# Limit the exported symbols: Don't export glwthread* (from gnulib modules). + OTHER_LDFLAGS = \ +- @LTLIBICONV@ @INTL_MACOSX_LIBS@ @LTLIBTHREAD@ -no-undefined \ ++ @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \ ++ -no-undefined \ ++ -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) + +diff --git a/gettext-runtime/intl/export.h b/gettext-runtime/intl/export.h +index b5c47ad5b..10253e338 100644 +--- a/gettext-runtime/intl/export.h ++++ b/gettext-runtime/intl/export.h +@@ -1,6 +1,8 @@ + + #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL + #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBINTL ++#define LIBINTL_DLL_EXPORTED __declspec(dllexport) + #else + #define LIBINTL_DLL_EXPORTED + #endif +diff --git a/gettext-tools/intl/Makefile.in b/gettext-tools/intl/Makefile.in +index 9bdfe2238..6eabf22af 100644 +--- a/gettext-tools/intl/Makefile.in ++++ b/gettext-tools/intl/Makefile.in +@@ -2120,6 +2120,11 @@ libintl_la_DEPENDENCIES = $(WOE32_LIBADD) + libgnuintl_la_LIBADD = $(WOE32_LIBADD) + libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD) + ++# langprefs.c (_nl_language_preferences_win32_95) uses functions from ++# advapi32.dll. ++@WOE32_TRUE@INTL_WINDOWS_LIBS = -ladvapi32 ++@WOE32_FALSE@INTL_WINDOWS_LIBS = ++ + # Libtool's library version information for libintl. + # Before making a gettext release, you must change this according to the + # libtool documentation, section "Library interface versions". +@@ -2128,8 +2133,11 @@ LTV_REVISION = 6 + LTV_AGE = 1 + + # How to build libintl.la and libgnuintl.la. ++# Limit the exported symbols: Don't export glwthread* (from gnulib modules). + OTHER_LDFLAGS = \ +- @LTLIBICONV@ @INTL_MACOSX_LIBS@ @LTLIBTHREAD@ -no-undefined \ ++ @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \ ++ -no-undefined \ ++ -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) + +diff --git a/gettext-tools/libgettextpo/Makefile.in b/gettext-tools/libgettextpo/Makefile.in +index 59356fa1d..444ef7807 100644 +--- a/gettext-tools/libgettextpo/Makefile.in ++++ b/gettext-tools/libgettextpo/Makefile.in +@@ -2942,8 +2942,8 @@ config.h: $(BUILT_SOURCES) + ;; \ + esac; \ + done; \ +- } 5>&1 \ +- | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \ ++ } 5>&1 1>&2 \ ++ | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | sed -e 's,^obstack_free$$,__obstack_free,' \ + | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \ + if test -f config.h; then \ +diff --git a/gettext-tools/libgettextpo/exported.sh.in b/gettext-tools/libgettextpo/exported.sh.in +index 2e6b89ab6..be7fb38bd 100644 +--- a/gettext-tools/libgettextpo/exported.sh.in ++++ b/gettext-tools/libgettextpo/exported.sh.in +@@ -1,6 +1,6 @@ + #! /bin/sh + # +-# Copyright (C) 2006 Free Software Foundation, Inc. ++# Copyright (C) 2006, 2009, 2019 Free Software Foundation, Inc. + # + # 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 +@@ -20,5 +20,4 @@ + # This is a separate script because $(GLOBAL_SYMBOL_PIPE) cannot be used in a + # Makefile, since it may contain dollar signs. + +-nm_cmd="@NM@ $1 | @GLOBAL_SYMBOL_PIPE@" +-eval $nm_cmd ++@NM@ "$1" | @GLOBAL_SYMBOL_PIPE@ +diff --git a/gettext-tools/src/lang-table.h b/gettext-tools/src/lang-table.h +index 7ac197669..ebf193b98 100644 +--- a/gettext-tools/src/lang-table.h ++++ b/gettext-tools/src/lang-table.h +@@ -1,5 +1,5 @@ + /* Table of languages. +- Copyright (C) 2001-2007 Free Software Foundation, Inc. ++ Copyright (C) 2001-2007, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2005. + + This program is free software: you can redistribute it and/or modify +@@ -20,6 +20,12 @@ + + #include + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + struct language_table_entry + { + const char *code; +@@ -32,4 +38,10 @@ extern const size_t language_table_size; + extern struct language_table_entry language_variant_table[]; + extern const size_t language_variant_table_size; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _LANG_TABLE_H */ +diff --git a/gettext-tools/src/read-po.h b/gettext-tools/src/read-po.h +index 6852a22a0..98fc893b2 100644 +--- a/gettext-tools/src/read-po.h ++++ b/gettext-tools/src/read-po.h +@@ -1,5 +1,5 @@ + /* Reading PO files. +- Copyright (C) 2006 Free Software Foundation, Inc. ++ Copyright (C) 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2006. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .po / .pot file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_po; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_PO_H */ +diff --git a/gettext-tools/src/read-properties.h b/gettext-tools/src/read-properties.h +index e04abe524..9c299e6c2 100644 +--- a/gettext-tools/src/read-properties.h ++++ b/gettext-tools/src/read-properties.h +@@ -1,5 +1,5 @@ + /* Reading Java .properties files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .properties file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_properties; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_PROPERTIES_H */ +diff --git a/gettext-tools/src/read-stringtable.h b/gettext-tools/src/read-stringtable.h +index 43d1ba505..4a107f2ff 100644 +--- a/gettext-tools/src/read-stringtable.h ++++ b/gettext-tools/src/read-stringtable.h +@@ -1,5 +1,5 @@ + /* Reading NeXTstep/GNUstep .strings files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .strings file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_stringtable; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_STRINGTABLE_H */ +diff --git a/gettext-tools/src/write-properties.h b/gettext-tools/src/write-properties.h +index f0d18a7e4..7671afb30 100644 +--- a/gettext-tools/src/write-properties.h ++++ b/gettext-tools/src/write-properties.h +@@ -1,5 +1,5 @@ + /* Writing Java .properties files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "write-catalog.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a PO file in Java .properties syntax. */ + extern DLL_VARIABLE const struct catalog_output_format output_format_properties; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _WRITE_PROPERTIES_H */ +diff --git a/gettext-tools/src/write-stringtable.h b/gettext-tools/src/write-stringtable.h +index 7d4981826..af0b081c8 100644 +--- a/gettext-tools/src/write-stringtable.h ++++ b/gettext-tools/src/write-stringtable.h +@@ -1,5 +1,5 @@ + /* Writing NeXTstep/GNUstep .strings files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "write-catalog.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a PO file in .strings syntax. */ + extern DLL_VARIABLE const struct catalog_output_format output_format_stringtable; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _WRITE_STRINGTABLE_H */ +diff --git a/libtextstyle/lib/Makefile.in b/libtextstyle/lib/Makefile.in +index 4a11d73a1..ebee4845a 100644 +--- a/libtextstyle/lib/Makefile.in ++++ b/libtextstyle/lib/Makefile.in +@@ -4536,8 +4536,8 @@ config.h: $(BUILT_SOURCES) libtextstyle.sym + ;; \ + esac; \ + done; \ +- } 5>&1 \ +- | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \ ++ } 5>&1 1>&2 \ ++ | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | LC_ALL=C join -v 1 - libtextstyle.sym \ + | sed -e 's,^\(.*\)$$,#define \1 libtextstyle_\1,' > config.h-t; \ + } 6>&1 && \ +-- +2.21.0.windows.1 + diff --git a/recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch b/recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch new file mode 100644 index 0000000000000..dbbf7b795a53e --- /dev/null +++ b/recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch @@ -0,0 +1,72 @@ +From 9b2e480278d36c4d7b6f988621a3a9f699cc730f Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 10 Jul 2019 03:55:56 -0700 +Subject: [PATCH 2/2] - memmove is intrinsic function on MSVC + +Signed-off-by: SSE4 +--- + gettext-runtime/gnulib-lib/memmove.c | 4 ++++ + gettext-tools/gnulib-lib/memmove.c | 4 ++++ + gettext-tools/gnulib-lib/memset.c | 4 ++++ + 3 files changed, 12 insertions(+) + +diff --git a/gettext-runtime/gnulib-lib/memmove.c b/gettext-runtime/gnulib-lib/memmove.c +index 0f040540c..bc8883ae4 100644 +--- a/gettext-runtime/gnulib-lib/memmove.c ++++ b/gettext-runtime/gnulib-lib/memmove.c +@@ -7,6 +7,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memmove (void *dest0, void const *source0, size_t length) + { +@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) + } + return dest0; + } ++ ++#endif +diff --git a/gettext-tools/gnulib-lib/memmove.c b/gettext-tools/gnulib-lib/memmove.c +index 0f040540c..bc8883ae4 100644 +--- a/gettext-tools/gnulib-lib/memmove.c ++++ b/gettext-tools/gnulib-lib/memmove.c +@@ -7,6 +7,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memmove (void *dest0, void const *source0, size_t length) + { +@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) + } + return dest0; + } ++ ++#endif +diff --git a/gettext-tools/gnulib-lib/memset.c b/gettext-tools/gnulib-lib/memset.c +index 4e60124e7..b595fa966 100644 +--- a/gettext-tools/gnulib-lib/memset.c ++++ b/gettext-tools/gnulib-lib/memset.c +@@ -18,6 +18,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memset (void *str, int c, size_t len) + { +@@ -27,3 +29,5 @@ memset (void *str, int c, size_t len) + *st++ = c; + return str; + } ++ ++#endif +-- +2.21.0.windows.1 + diff --git a/recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch b/recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch new file mode 100644 index 0000000000000..f5e7045d82247 --- /dev/null +++ b/recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch @@ -0,0 +1,29 @@ +From e81ca090d69837e4f1a3c41fe2345c77b38f756a Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Fri, 12 Jul 2019 13:11:06 +0200 +Subject: [PATCH 3/3] Reported by Gabor Z. Papp . + +This is a regression from 2018-11-25. + +* gettext-tools/configure.ac (PRELOADABLE_LIBINTL): Set to false if +--disable-shared was specified. +--- + gettext-tools/configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gettext-tools/configure b/gettext-tools/configure +index 5a831d6da..4be36c383 100755 +--- a/gettext-tools/configure ++++ b/gettext-tools/configure +@@ -23901,7 +23901,7 @@ else + PACKAGE_IS_GETTEXT_TOOLS_FALSE= + fi + +- if test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes; then ++ if test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test $enable_shared = yes; then + PRELOADABLE_LIBINTL_TRUE= + PRELOADABLE_LIBINTL_FALSE='#' + else +-- +2.21.0 + diff --git a/recipes/libgettext/all/test_package/CMakeLists.txt b/recipes/libgettext/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1ef1f4a228330 --- /dev/null +++ b/recipes/libgettext/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(Intl CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Intl::Intl) diff --git a/recipes/libgettext/all/test_package/conanfile.py b/recipes/libgettext/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9667f823f2c1 --- /dev/null +++ b/recipes/libgettext/all/test_package/conanfile.py @@ -0,0 +1,49 @@ +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 + +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + 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}") 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 new file mode 100644 index 0000000000000000000000000000000000000000..f2f426b3ff66be496a47be5a10794d6a9337ac64 GIT binary patch literal 460 zcmZvYO-{ow5QPJRO_r=#m>ozAB&DduZ4uC>YDG&!NnyjrBtsHN$C2$KI0#qb7@P&C zMRdcHKWm=#{4@UE+4^*>HZ8lBL(8_MZK)JmDt~LC4aa%-^4ZwY zU~FKRz&$FROX4h+B#8M(o;$@-Dg$Gk<_TOaQVo&h%nc_IbQKC?, 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 new file mode 100644 index 0000000000000000000000000000000000000000..941535abc76d20c56afab0cb7f58834a7fd5226c GIT binary patch literal 460 zcmZvX!A=4(5QbNympyv+P;Z(z+C_|5z^JeUBFGAhUcA)Zad)+}o3j8JU(`7AF5YW(18t8jQmAh}Cc%B`r$#?nmhcu=s9| zOTi1-BuUP-LEE0iJ!q_R)&HJRLnsrK7BXX`@l;qp5(~`*^pu_(Mr64xO}o}4zqY+E Q$zGcT2TkA0l@Q$f0R^9Yi~s-t literal 0 HcmV?d00001 diff --git a/recipes/libgettext/all/test_package/po/es/conan.po b/recipes/libgettext/all/test_package/po/es/conan.po new file mode 100644 index 0000000000000..29a2b6106de38 --- /dev/null +++ b/recipes/libgettext/all/test_package/po/es/conan.po @@ -0,0 +1,23 @@ +# 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 new file mode 100644 index 0000000000000000000000000000000000000000..8f1f836a04c91ffbcc8bdc6228dad1d0a417ba13 GIT binary patch literal 535 zcmZutO-~y!5M3(DVNZy255u9Tkr?U?shT=jzJovzSkeV9T-;>XY`fSi+lxTrZ}4CG zYxpgULxD@5^z3=|d$z|(bCvm#*=Gi1%%IPhf9Im;lII2HA_rK`5VCKW zQdOBKv*tIAJswW*f~+fzmM}J2X-L*YJfhlIk3(0K6WnPEhq;juXQw&tT2h|vxTicx zXp7_ritm^tAl7B4%e4?}#1Y+=;n@HBzWwtZE9Wt{O1nyVV$nvnbBO^ws37NqKp_*m(pQ3YX6>PEt-ajsPQZCQeC;^E}(#KiVSXJS^u{TbF zu4mGv>pgfW(=YmSBGNR0l@$o3SWfwyHbDT}S#PB6*R6iq3FRyy`iX#thnEO@M2j;C PXWFe^9M!hGB_BNl`X-CV literal 0 HcmV?d00001 diff --git a/recipes/libgettext/all/test_package/po/ru/conan.po b/recipes/libgettext/all/test_package/po/ru/conan.po new file mode 100644 index 0000000000000..34ecc9f75cf1e --- /dev/null +++ b/recipes/libgettext/all/test_package/po/ru/conan.po @@ -0,0 +1,24 @@ +# 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 new file mode 100644 index 0000000000000..615e9408bed47 --- /dev/null +++ b/recipes/libgettext/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#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")); + return 0; +} diff --git a/recipes/libgettext/all/test_v1_package/CMakeLists.txt b/recipes/libgettext/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9bddeec6f96a --- /dev/null +++ b/recipes/libgettext/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +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 new file mode 100644 index 0000000000000..36bfb4bd5c2c9 --- /dev/null +++ b/recipes/libgettext/all/test_v1_package/conanfile.py @@ -0,0 +1,31 @@ +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/libgettext/config.yml b/recipes/libgettext/config.yml new file mode 100644 index 0000000000000..dc03f51a1d462 --- /dev/null +++ b/recipes/libgettext/config.yml @@ -0,0 +1,5 @@ +versions: + "0.21": + folder: all + "0.20.1": + folder: all diff --git a/recipes/libgit2/0.27.x/CMakeLists.txt b/recipes/libgit2/0.27.x/CMakeLists.txt new file mode 100644 index 0000000000000..c502da172e7b8 --- /dev/null +++ b/recipes/libgit2/0.27.x/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..dddcd1d95b8f4 --- /dev/null +++ b/recipes/libgit2/0.27.x/conandata.yml @@ -0,0 +1,4 @@ +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 new file mode 100644 index 0000000000000..07e2765904500 --- /dev/null +++ b/recipes/libgit2/0.27.x/conanfile.py @@ -0,0 +1,156 @@ +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 new file mode 100644 index 0000000000000..912bdc647f324 --- /dev/null +++ b/recipes/libgit2/0.27.x/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +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/conanfile.py b/recipes/libgit2/0.27.x/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libgit2/0.27.x/test_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/libgit2/0.27.x/test_package/test_package.c b/recipes/libgit2/0.27.x/test_package/test_package.c new file mode 100644 index 0000000000000..1ea125101cdc8 --- /dev/null +++ b/recipes/libgit2/0.27.x/test_package/test_package.c @@ -0,0 +1,34 @@ +#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 new file mode 100644 index 0000000000000..c502da172e7b8 --- /dev/null +++ b/recipes/libgit2/0.28.x/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..25994eed756a3 --- /dev/null +++ b/recipes/libgit2/0.28.x/conandata.yml @@ -0,0 +1,4 @@ +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 new file mode 100644 index 0000000000000..7e3da960a3cb2 --- /dev/null +++ b/recipes/libgit2/0.28.x/conanfile.py @@ -0,0 +1,160 @@ +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 new file mode 100644 index 0000000000000..912bdc647f324 --- /dev/null +++ b/recipes/libgit2/0.28.x/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +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/conanfile.py b/recipes/libgit2/0.28.x/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libgit2/0.28.x/test_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/libgit2/0.28.x/test_package/test_package.c b/recipes/libgit2/0.28.x/test_package/test_package.c new file mode 100644 index 0000000000000..96e8eda89c73b --- /dev/null +++ b/recipes/libgit2/0.28.x/test_package/test_package.c @@ -0,0 +1,34 @@ +#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 new file mode 100644 index 0000000000000..c502da172e7b8 --- /dev/null +++ b/recipes/libgit2/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..7725b775b39de --- /dev/null +++ b/recipes/libgit2/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "1.5.0": + url: "https://github.com/libgit2/libgit2/archive/v1.5.0.tar.gz" + sha256: "8de872a0f201b33d9522b817c92e14edb4efad18dae95cf156cf240b2efff93e" + "1.4.3": + url: "https://github.com/libgit2/libgit2/archive/v1.4.3.tar.gz" + sha256: "f48b961e463a9e4e7e7e58b21a0fb5a9b2a1d24d9ba4d15870a0c9b8ad965163" + "1.3.0": + url: "https://github.com/libgit2/libgit2/archive/v1.3.0.tar.gz" + sha256: "192eeff84596ff09efb6b01835a066f2df7cd7985e0991c79595688e6b36444e" + "1.2.0": + url: "https://github.com/libgit2/libgit2/archive/v1.2.0.tar.gz" + sha256: "701a5086a968a46f25e631941b99fc23e4755ca2c56f59371ce1d94b9a0cc643" + "1.1.1": + url: "https://github.com/libgit2/libgit2/archive/v1.1.1.tar.gz" + sha256: "13a525373f64c711a00a058514d890d1512080265f98e0935ab279393f21a620" + "1.0.1": + url: "https://github.com/libgit2/libgit2/archive/v1.0.1.tar.gz" + sha256: "1775427a6098f441ddbaa5bd4e9b8a043c7401e450ed761e69a415530fea81d2" +patches: + "1.5.0": + - patch_file: "patches/1.4.3-0001-fix-cmake.patch" + base_path: "source_subfolder" + "1.4.3": + - patch_file: "patches/1.4.3-0001-fix-cmake.patch" + base_path: "source_subfolder" + "1.3.0": + - patch_file: "patches/1.3.0-0001-fix-cmake.patch" + base_path: "source_subfolder" + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-cmake.patch" + base_path: "source_subfolder" + "1.1.1": + - patch_file: "patches/1.1.1-0001-fix-cmake.patch" + base_path: "source_subfolder" + "1.0.1": + - patch_file: "patches/1.0.1-0001-fix-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/libgit2/all/conanfile.py b/recipes/libgit2/all/conanfile.py new file mode 100644 index 0000000000000..c042b13f51df6 --- /dev/null +++ b/recipes/libgit2/all/conanfile.py @@ -0,0 +1,181 @@ +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"], + "with_ntlmclient": [True, False], + "with_regex": ["builtin", "pcre", "pcre2", "regcomp_l", "regcomp"], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": True, + "with_iconv": False, + "with_libssh2": True, + "with_https": "openssl", + "with_sha1": "collisiondetection", + "with_ntlmclient": True, + "with_regex": "builtin", + } + 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"]) + + 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 + + if self.settings.os == "Windows": + del self.options.with_ntlmclient + + if self.settings.os == "Macos": + self.options.with_regex = "regcomp_l" + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + 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 self.options.get_safe("with_iconv"): + self.requires("libiconv/1.16") + if self.options.with_regex == "pcre": + self.requires("pcre/8.45") + elif self.options.with_regex == "pcre2": + self.requires("pcre2/10.40") + + @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 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") + + if self.options.with_regex == "regcomp" or self.options.with_regex == "regcomp_l": + if self.settings.compiler == "Visual Studio": + 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) + + _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["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 + + if is_msvc(self): + cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) + + cmake.configure() + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("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/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..2f0d05b998d5d --- /dev/null +++ b/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch @@ -0,0 +1,33 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index dff1d94..abd9c45 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -158,11 +158,11 @@ ENDIF() + + # Optional external dependency: http-parser + IF(USE_HTTP_PARSER STREQUAL "system") +- FIND_PACKAGE(HTTP_Parser) ++ 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_LIBS ${HTTP_PARSER_LIBRARIES}) ++ IF (http_parser_FOUND) ++ LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ LIST(APPEND LIBGIT2_LIBS ${http_parser_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + ADD_FEATURE_INFO(http-parser ON "http-parser support (system)") + ELSE() +@@ -201,7 +201,11 @@ ENDIF() + + # Optional external dependency: libssh2 + IF (USE_SSH) +- FIND_PKGLIBRARIES(LIBSSH2 libssh2) ++ 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}) + ENDIF() + IF (LIBSSH2_FOUND) + SET(GIT_SSH 1) 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 new file mode 100644 index 0000000000000..5dc56b1a31b92 --- /dev/null +++ b/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch @@ -0,0 +1,33 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d01cc64..0941cbd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -167,11 +167,11 @@ ENDIF() + + # Optional external dependency: http-parser + IF(USE_HTTP_PARSER STREQUAL "system") +- FIND_PACKAGE(HTTP_Parser) ++ 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_LIBS ${HTTP_PARSER_LIBRARIES}) ++ IF (http_parser_FOUND) ++ LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ LIST(APPEND LIBGIT2_LIBS ${http_parser_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + ADD_FEATURE_INFO(http-parser ON "http-parser support (system)") + ELSE() +@@ -210,7 +210,11 @@ ENDIF() + + # Optional external dependency: libssh2 + IF (USE_SSH) +- FIND_PKGLIBRARIES(LIBSSH2 libssh2) ++ 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}) + ENDIF() + IF (LIBSSH2_FOUND) + SET(GIT_SSH 1) 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 new file mode 100644 index 0000000000000..0fbbd568d7b10 --- /dev/null +++ b/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch @@ -0,0 +1,33 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 45dec27..783c657 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -178,11 +178,11 @@ ENDIF() + + # Optional external dependency: http-parser + IF(USE_HTTP_PARSER STREQUAL "system") +- FIND_PACKAGE(HTTP_Parser) ++ 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_LIBS ${HTTP_PARSER_LIBRARIES}) ++ IF (http_parser_FOUND) ++ LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ LIST(APPEND LIBGIT2_LIBS ${http_parser_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + ADD_FEATURE_INFO(http-parser ON "http-parser support (system)") + ELSE() +@@ -231,7 +231,11 @@ ENDIF() + + # Optional external dependency: libssh2 + IF (USE_SSH) +- FIND_PKGLIBRARIES(LIBSSH2 libssh2) ++ 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}) + ENDIF() + IF (LIBSSH2_FOUND) + SET(GIT_SSH 1) 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 new file mode 100644 index 0000000000000..997b6dd7759b0 --- /dev/null +++ b/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch @@ -0,0 +1,40 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index fdb3673..783c657 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -178,11 +178,11 @@ ENDIF() + + # Optional external dependency: http-parser + IF(USE_HTTP_PARSER STREQUAL "system") +- FIND_PACKAGE(HTTP_Parser) ++ 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_LIBS ${HTTP_PARSER_LIBRARIES}) ++ IF (http_parser_FOUND) ++ LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ LIST(APPEND LIBGIT2_LIBS ${http_parser_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + ADD_FEATURE_INFO(http-parser ON "http-parser support (system)") + ELSE() +@@ -231,14 +231,11 @@ ENDIF() + + # 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}) + ENDIF() + IF (LIBSSH2_FOUND) + SET(GIT_SSH 1) 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 new file mode 100644 index 0000000000000..459414c1a9584 --- /dev/null +++ b/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch @@ -0,0 +1,42 @@ +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/SelectSSH.cmake b/cmake/SelectSSH.cmake +index 23dfc97..a094cc7 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.") diff --git a/recipes/libgit2/all/test_package/CMakeLists.txt b/recipes/libgit2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..912bdc647f324 --- /dev/null +++ b/recipes/libgit2/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +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/all/test_package/conanfile.py b/recipes/libgit2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libgit2/all/test_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/libgit2/all/test_package/test_package.c b/recipes/libgit2/all/test_package/test_package.c new file mode 100644 index 0000000000000..96e8eda89c73b --- /dev/null +++ b/recipes/libgit2/all/test_package/test_package.c @@ -0,0 +1,34 @@ +#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/config.yml b/recipes/libgit2/config.yml new file mode 100644 index 0000000000000..c472349adb3cc --- /dev/null +++ b/recipes/libgit2/config.yml @@ -0,0 +1,17 @@ +versions: + "1.5.0": + folder: "all" + "1.4.3": + folder: "all" + "1.3.0": + folder: "all" + "1.2.0": + folder: "all" + "1.1.1": + 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/conandata.yml b/recipes/libglvnd/all/conandata.yml new file mode 100644 index 0000000000000..930441157c427 --- /dev/null +++ b/recipes/libglvnd/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.5.0": + url: "https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v1.5.0/libglvnd-v1.5.0.tar.gz" + sha256: "8c246d573bdaabbab32874befa79c8b92b12c05d3eb4bbefbe62afa630842793" + "1.4.0": + url: "https://gitlab.freedesktop.org/glvnd/libglvnd/uploads/ca5bf4295beb39bb324f692c481ac8a1/libglvnd-1.4.0.tar.gz" + sha256: "c4a884503d2412dc1fa209613aa8a77193aeb7065b823fe1775dc8b6f3e45211" diff --git a/recipes/libglvnd/all/conanfile.py b/recipes/libglvnd/all/conanfile.py new file mode 100644 index 0000000000000..7d1919c184d04 --- /dev/null +++ b/recipes/libglvnd/all/conanfile.py @@ -0,0 +1,166 @@ +from conan import ConanFile +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.files import get, rmdir, save +from conan.errors import ConanInvalidConfiguration +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + +class LibGlvndConan(ConanFile): + name = "libglvnd" + description = "The GL Vendor-Neutral Dispatch library" + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.freedesktop.org/glvnd/libglvnd" + topics = ("gl", "vendor-neutral", "dispatch") + settings = "os", "arch", "compiler", "build_type" + options = { + "asm": [True, False], + "x11": [True, False], + "egl": [True, False], + "glx": [True, False], + "gles1": [True, False], + "gles2": [True, False], + "tls": [True, False], + "dispatch_tls": [True, False], + "headers": [True, False], + "entrypoint_patching": [True, False], + } + default_options = { + "asm" : True, + "x11": True, + "egl": True, + "glx": True, + "gles1": True, + "gles2": True, + "tls": True, + "dispatch_tls": True, + "headers": True, + "entrypoint_patching": True, + } + + generators = "PkgConfigDeps" + + # don't use self.settings_build + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + # don't use self.user_info_build + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.x11: + self.requires("xorg/system") + if self.options.glx: + self.requires("xorg-proto/2022.2") + + def validate(self): + if self.settings.os not in ['Linux', 'FreeBSD']: + raise ConanInvalidConfiguration("libglvnd is only compatible with Linux and FreeBSD") + + def build_requirements(self): + self.build_requires("meson/0.63.2") + self.build_requires("pkgconf/1.9.3") + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["asm"] = "enabled" if self.options.asm else "disabled" + tc.project_options["x11"] = "enabled" if self.options.x11 else "disabled" + tc.project_options["egl"] = self.options.egl + tc.project_options["glx"] = "enabled" if self.options.glx else "disabled" + tc.project_options["gles1"] = self.options.gles1 + tc.project_options["gles2"] = self.options.gles2 + tc.project_options["tls"] = self.options.tls + tc.project_options["dispatch-tls"] = self.options.dispatch_tls + 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" + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), textwrap.dedent('''\ + Copyright (c) 2013, NVIDIA CORPORATION. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + unaltered in all copies or substantial portions of the Materials. + Any additions, deletions, or changes to the original source files + must be clearly indicated in accompanying documentation. + + THE MATERIALS ARE 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 + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ''')) + + def package_info(self): + self.cpp_info.components['gldispatch'].libs = ["GLdispatch"] + self.cpp_info.components['gldispatch'].system_libs.extend(["pthread", "dl"]) + + self.cpp_info.components['opengl'].libs = ["OpenGL"] + self.cpp_info.components['opengl'].requires.extend(["gldispatch"]) + self.cpp_info.components['opengl'].set_property("pkg_config_name", "opengl") + + if self.options.egl: + self.cpp_info.components['egl'].libs = ["EGL"] + self.cpp_info.components['egl'].system_libs.extend(["pthread", "dl", "m"]) + self.cpp_info.components['egl'].requires.extend(["xorg::x11", "gldispatch"]) + self.cpp_info.components['egl'].set_property("pkg_config_name", "egl") + + if self.options.glx: + self.cpp_info.components['glx'].libs = ["GLX"] + self.cpp_info.components['glx'].system_libs.extend(["dl"]) + self.cpp_info.components['glx'].requires.extend(["xorg::x11", "xorg-proto::glproto", "gldispatch"]) + self.cpp_info.components['glx'].set_property("pkg_config_name", "glx") + + self.cpp_info.components['gl'].libs = ["GL"] + self.cpp_info.components['gl'].system_libs.extend(["dl"]) + self.cpp_info.components['gl'].requires.extend(["xorg::x11", "glx", "gldispatch"]) + self.cpp_info.components['gl'].set_property("pkg_config_name", "gl") + + if self.options.gles1: + self.cpp_info.components['gles1'].libs = ["GLESv1_CM"] + self.cpp_info.components['gles1'].requires.extend(["gldispatch"]) + self.cpp_info.components['gles1'].set_property("pkg_config_name", "glesv1_cm") + + if self.options.gles2: + self.cpp_info.components['gles2'].libs = ["GLESv2"] + self.cpp_info.components['gles2'].requires.extend(["gldispatch"]) + self.cpp_info.components['gles2'].set_property("pkg_config_name", "glesv2") diff --git a/recipes/libglvnd/all/test_package/CMakeLists.txt b/recipes/libglvnd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/libglvnd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libglvnd/all/test_package/conanfile.py b/recipes/libglvnd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8b7f471a280d5 --- /dev/null +++ b/recipes/libglvnd/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libglvnd/all/test_package/test_package.c b/recipes/libglvnd/all/test_package/test_package.c new file mode 100644 index 0000000000000..7da8b927f842e --- /dev/null +++ b/recipes/libglvnd/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include + +#include + + +int main() +{ + const char * gl_vendor = (const char *) glGetString(GL_VENDOR); + const char * gl_renderer = (const char *) glGetString(GL_RENDERER); + const char * gl_version = (const char *) glGetString(GL_VERSION); + const char * gl_extensions = (const char *) glGetString(GL_EXTENSIONS); + printf( "GL_VENDOR: %s\n", gl_vendor ? gl_vendor : "(null)"); + printf( "GL_RENDERER: %s\n", gl_renderer ? gl_renderer : "(null)"); + printf( "GL_VERSION: %s\n", gl_version ? gl_version : "(null)"); + printf( "GL_EXTENSIONS: %s\n", gl_extensions ? gl_extensions : "(null)"); + return 0; +} diff --git a/recipes/libglvnd/config.yml b/recipes/libglvnd/config.yml new file mode 100644 index 0000000000000..bd6887e2cfe66 --- /dev/null +++ b/recipes/libglvnd/config.yml @@ -0,0 +1,5 @@ +versions: + "1.5.0": + folder: "all" + "1.4.0": + folder: "all" diff --git a/recipes/libgpg-error/all/conandata.yml b/recipes/libgpg-error/all/conandata.yml new file mode 100644 index 0000000000000..256bc1f28533a --- /dev/null +++ b/recipes/libgpg-error/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.36": + url: "https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.36.tar.gz" + sha256: "493a3a5e0ac0eb4df8501039f351459d8901d213a834d8c5a453a8ed94858ba5" +patches: + "1.36": + - patch_file: "patches/0001-gawk-namespace.patch" diff --git a/recipes/libgpg-error/all/conanfile.py b/recipes/libgpg-error/all/conanfile.py new file mode 100644 index 0000000000000..630c80e0b9233 --- /dev/null +++ b/recipes/libgpg-error/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.57.0" + + +class GPGErrorConan(ConanFile): + name = "libgpg-error" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gnupg.org/software/libgpg-error/index.html" + topics = ("gpg", "gnupg", "encrypt", "pgp", "openpgp") + description = "Libgpg-error is a small library that originally defined common error values for all GnuPG " \ + "components." + license = "GPL-2.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 configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("This recipe only support Linux. You can contribute Windows and/or Macos support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-dependency-tracking", + "--disable-nls", + "--disable-languages", + "--disable-doc", + "--disable-tests", + ]) + if self.options.get_safe("fPIC", True): + tc.configure_args.append("--with-pic") + host = None + if self.settings.os == "Linux" and self.settings.arch == "x86": + host = "i686-linux-gnu" + tc.update_configure_args({"--host": host}) + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "gpg-error") + self.cpp_info.libs = ["gpg-error"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/libgpg-error/all/patches/0001-gawk-namespace.patch b/recipes/libgpg-error/all/patches/0001-gawk-namespace.patch new file mode 100644 index 0000000000000..a9e25cf6acf3f --- /dev/null +++ b/recipes/libgpg-error/all/patches/0001-gawk-namespace.patch @@ -0,0 +1,53 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -293,7 +293,7 @@ + + errnos-sym.h: Makefile mkstrtable.awk errnos.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \ +- -v prefix=GPG_ERR_ -v namespace=errnos_ \ ++ -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \ + $(srcdir)/errnos.in >$@ + + + +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -1615,7 +1615,7 @@ + + errnos-sym.h: Makefile mkstrtable.awk errnos.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \ +- -v prefix=GPG_ERR_ -v namespace=errnos_ \ ++ -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \ + $(srcdir)/errnos.in >$@ + + mkheader$(EXEEXT_FOR_BUILD): mkheader.c Makefile +diff --color -Naur libgpg-error-1.36/src/mkstrtable.awk libgpg-error-1.36.new/src/mkstrtable.awk +--- a/src/mkstrtable.awk ++++ b/src/mkstrtable.awk +@@ -102,7 +102,7 @@ + print "/* The purpose of this complex string table is to produce"; + print " optimal code with a minimum of relocations. */"; + print ""; +- print "static const char " namespace "msgstr[] = "; ++ print "static const char " pkg_namespace "msgstr[] = "; + header = 0; + } + else +@@ -150,7 +150,7 @@ + else + print " gettext_noop (\"" last_msgstr "\");"; + print ""; +- print "static const int " namespace "msgidx[] ="; ++ print "static const int " pkg_namespace "msgidx[] ="; + print " {"; + for (i = 0; i < coded_msgs; i++) + print " " pos[i] ","; +@@ -158,7 +158,7 @@ + print " };"; + print ""; + print "static GPG_ERR_INLINE int"; +- print namespace "msgidxof (int code)"; ++ print pkg_namespace "msgidxof (int code)"; + print "{"; + print " return (0 ? 0"; + diff --git a/recipes/libgpg-error/all/test_package/CMakeLists.txt b/recipes/libgpg-error/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9b783d3fcee67 --- /dev/null +++ b/recipes/libgpg-error/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libgpg-error REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libgpg-error::libgpg-error) diff --git a/recipes/libgpg-error/all/test_package/conanfile.py b/recipes/libgpg-error/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libgpg-error/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/libgpg-error/all/test_package/test_package.c b/recipes/libgpg-error/all/test_package/test_package.c new file mode 100644 index 0000000000000..241b49be7ac6d --- /dev/null +++ b/recipes/libgpg-error/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include "gpg-error.h" + +int main() { + gpgrt_printf(""); + return 0; +} diff --git a/recipes/libgpg-error/all/test_v1_package/CMakeLists.txt b/recipes/libgpg-error/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libgpg-error/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libgpg-error/all/test_v1_package/conanfile.py b/recipes/libgpg-error/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libgpg-error/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/libgpg-error/config.yml b/recipes/libgpg-error/config.yml new file mode 100644 index 0000000000000..f10713a7746e2 --- /dev/null +++ b/recipes/libgpg-error/config.yml @@ -0,0 +1,3 @@ +versions: + "1.36": + folder: all diff --git a/recipes/libgphoto2/all/conandata.yml b/recipes/libgphoto2/all/conandata.yml new file mode 100644 index 0000000000000..1f142a35cee75 --- /dev/null +++ b/recipes/libgphoto2/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.5.27": + url: "https://github.com/gphoto/libgphoto2/releases/download/v2.5.27/libgphoto2-2.5.27.tar.xz" + sha256: "a7253bd18c6ef65352150ac36a668f883a5ad2634eb6455b3ca9aa6ac98d0073" +patches: + "2.5.27": + - patch_file: "patches/2.5.27-0001-macos_snprintf.patch" diff --git a/recipes/libgphoto2/all/conanfile.py b/recipes/libgphoto2/all/conanfile.py new file mode 100644 index 0000000000000..e3382ba23526b --- /dev/null +++ b/recipes/libgphoto2/all/conanfile.py @@ -0,0 +1,131 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, 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 LibGphoto2(ConanFile): + name = "libgphoto2" + url = "https://github.com/conan-io/conan-center-index" + description = "The libgphoto2 camera access and control library." + homepage = "http://www.gphoto.org/" + license = "LGPL-2.1" + topics = ("gphoto2", "libgphoto2", "libgphoto", "photo") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_libusb": [True, False], + "with_libcurl": [True, False], + "with_libxml2": [True, False], + "with_libexif": [True, False], + "with_libjpeg": [True, False], + } + default_options = { + "with_libusb": True, + "with_libcurl": True, + "with_libxml2": True, + "with_libexif": True, + "with_libjpeg": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libtool/2.4.7") + if self.options.with_libusb: + self.requires("libusb/1.0.26") + if self.options.with_libcurl: + self.requires("libcurl/8.0.0") + if self.options.with_libxml2: + self.requires("libxml2/2.10.3") + if self.options.with_libexif: + self.requires("libexif/0.6.23") + if self.options.with_libjpeg: + self.requires("libjpeg/9e") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("Visual Studio not supported yet") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], 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) + auto_no = lambda v: "auto" if v else "no" + tc.configure_args.extend([ + f"--with-libcurl={auto_no(self.options.with_libcurl)}", + f"--with-libexif={auto_no(self.options.with_libexif)}", + f"--with-libxml-2.0={auto_no(self.options.with_libxml2)}", + "--disable-nls", + "--datadir=${prefix}/res", + "udevscriptdir=${prefix}/res", + "utilsdir=${prefix}/bin", + ]) + if not self.options.with_libjpeg: + tc.configure_args.append("--without-jpeg") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + 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", "libgphoto2") + self.cpp_info.libs = ["gphoto2", "gphoto2_port"] + self.cpp_info.includedirs.append(os.path.join("include", "gphoto2")) + self.cpp_info.resdirs = ["res"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libgphoto2/all/patches/2.5.27-0001-macos_snprintf.patch b/recipes/libgphoto2/all/patches/2.5.27-0001-macos_snprintf.patch new file mode 100644 index 0000000000000..b3dd8d4275c0c --- /dev/null +++ b/recipes/libgphoto2/all/patches/2.5.27-0001-macos_snprintf.patch @@ -0,0 +1,12 @@ +diff --git a/libgphoto2_port/libusb1/libusb1.c b/libgphoto2_port/libusb1/libusb1.c +index d3da30f..1342855 100644 +--- a/libgphoto2_port/libusb1/libusb1.c ++++ b/libgphoto2_port/libusb1/libusb1.c +@@ -20,6 +20,7 @@ + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ ++#define _DARWIN_C_SOURCE + #include "config.h" + #include + diff --git a/recipes/libgphoto2/all/test_package/CMakeLists.txt b/recipes/libgphoto2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..55da1ef125aa5 --- /dev/null +++ b/recipes/libgphoto2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libgphoto2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libgphoto2::libgphoto2) diff --git a/recipes/libgphoto2/all/test_package/conanfile.py b/recipes/libgphoto2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libgphoto2/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/libgphoto2/all/test_package/test_package.c b/recipes/libgphoto2/all/test_package/test_package.c new file mode 100644 index 0000000000000..bda4b5344b90c --- /dev/null +++ b/recipes/libgphoto2/all/test_package/test_package.c @@ -0,0 +1,27 @@ +#include +#include + +int main() { + GPContext* context; + CameraAbilitiesList* list; + Camera* camera; + int ret; + + context = gp_context_new(); + ret = gp_abilities_list_new(&list); + if (ret != GP_OK) { + return 1; + } + ret = gp_abilities_list_load(list, context); + if (ret != GP_OK) { + return 1; + } + int count = gp_abilities_list_count(list); + if (count < 0) { + return 1; + } + gp_camera_new(&camera); + gp_camera_free(camera); + gp_abilities_list_free(list); + return 0; +} diff --git a/recipes/libgphoto2/all/test_v1_package/CMakeLists.txt b/recipes/libgphoto2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libgphoto2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libgphoto2/all/test_v1_package/conanfile.py b/recipes/libgphoto2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libgphoto2/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/libgphoto2/config.yml b/recipes/libgphoto2/config.yml new file mode 100644 index 0000000000000..5139145403d46 --- /dev/null +++ b/recipes/libgphoto2/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.27": + folder: all diff --git a/recipes/libgpiod/all/conandata.yml b/recipes/libgpiod/all/conandata.yml new file mode 100644 index 0000000000000..851ae98da0f81 --- /dev/null +++ b/recipes/libgpiod/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.6.3": + url: "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-1.6.3.tar.gz" + sha256: "eb446070be1444fd7d32d32bbca53c2f3bbb0a21193db86198cf6050b7a28441" diff --git a/recipes/libgpiod/all/conanfile.py b/recipes/libgpiod/all/conanfile.py new file mode 100644 index 0000000000000..99787ae3af1c0 --- /dev/null +++ b/recipes/libgpiod/all/conanfile.py @@ -0,0 +1,87 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class LibgpiodConan(ConanFile): + name = "libgpiod" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/" + license = "LGPL-2.1-or-later" + description = "C library and tools for interacting with the linux GPIO character device" + topics = ("gpio", "libgpiod", "libgpiodcxx", "linux") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_bindings_cxx": [True, False], + "enable_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_bindings_cxx": False, + "enable_tools": False, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libgpiod supports only Linux") + + def configure(self): + if self.options.shared: + del self.options.fPIC + if not self.options.enable_bindings_cxx: + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + self.build_requires("pkgconf/1.7.4") + self.build_requires("autoconf-archive/2021.02.19") + self.build_requires("linux-headers-generic/5.13.9") + + 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) + 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)), + "--enable-bindings-cxx={}".format(yes_no(self.options.enable_bindings_cxx)), + "--enable-tools={}".format(yes_no(self.options.enable_tools)), + ] + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + with tools.chdir(os.path.join(self._source_subfolder)): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True) + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(self.package_folder, "*.la") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.components["gpiod"].libs = ["gpiod"] + self.cpp_info.components["gpiod"].names["pkg_config"] = "gpiod" + if self.options.enable_bindings_cxx: + self.cpp_info.components["gpiodcxx"].libs = ["gpiodcxx"] + self.cpp_info.components["gpiodcxx"].names["pkg_config"] = "gpiodcxx" + self.cpp_info.components["gpiodcxx"].requires = ["gpiod"] diff --git a/recipes/libgpiod/all/test_package/CMakeLists.txt b/recipes/libgpiod/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a5ffd526aaea7 --- /dev/null +++ b/recipes/libgpiod/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.c) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libgpiod/all/test_package/conanfile.py b/recipes/libgpiod/all/test_package/conanfile.py new file mode 100644 index 0000000000000..db57f3bb0d17f --- /dev/null +++ b/recipes/libgpiod/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libgpiod/all/test_package/test_package.c b/recipes/libgpiod/all/test_package/test_package.c new file mode 100644 index 0000000000000..686dc9682cd7d --- /dev/null +++ b/recipes/libgpiod/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include "gpiod.h" + +int main(int argc, char *argv[]) { + struct gpiod_chip *chip; + chip = gpiod_chip_open_by_name("gpiochip0"); + return 0; +} diff --git a/recipes/libgpiod/config.yml b/recipes/libgpiod/config.yml new file mode 100644 index 0000000000000..bfd56b0a1b59f --- /dev/null +++ b/recipes/libgpiod/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.3": + folder: all diff --git a/recipes/libgta/all/CMakeLists.txt b/recipes/libgta/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/libgta/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libgta/all/conandata.yml b/recipes/libgta/all/conandata.yml new file mode 100644 index 0000000000000..3822224446527 --- /dev/null +++ b/recipes/libgta/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.1": + url: "https://marlam.de/gta/releases/libgta-1.2.1.tar.xz" + sha256: "d445667e145f755f0bc34ac89b63a6bfdce1eea943f87ee7a3f23dc0dcede8b1" diff --git a/recipes/libgta/all/conanfile.py b/recipes/libgta/all/conanfile.py new file mode 100644 index 0000000000000..a0064e504c27d --- /dev/null +++ b/recipes/libgta/all/conanfile.py @@ -0,0 +1,69 @@ +import os + +from conans import ConanFile, CMake, tools + +class LibgtaConan(ConanFile): + name = "libgta" + description = "Library that reads and writes GTA (Generic Tagged Arrays) files." + license = "LGPL-2.1-or-later" + topics = ("conan", "libgta", "gta") + homepage = "https://marlam.de/gta" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = "CMakeLists.txt" + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + _cmake = None + + @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.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def build(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "${CMAKE_SOURCE_DIR}", "${CMAKE_CURRENT_SOURCE_DIR}") + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["GTA_BUILD_STATIC_LIB"] = not self.options.shared + self._cmake.definitions["GTA_BUILD_SHARED_LIB"] = self.options.shared + self._cmake.definitions["GTA_BUILD_DOCUMENTATION"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "GTA" + self.cpp_info.names["cmake_find_package_multi"] = "GTA" + self.cpp_info.names["pkg_config"] = "gta" + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.compiler == "Visual Studio" and not self.options.shared: + self.cpp_info.defines.append("GTA_STATIC") diff --git a/recipes/libgta/all/test_package/CMakeLists.txt b/recipes/libgta/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libgta/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libgta/all/test_package/conanfile.py b/recipes/libgta/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/libgta/all/test_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" + + 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/libgta/all/test_package/test_package.c b/recipes/libgta/all/test_package/test_package.c new file mode 100644 index 0000000000000..248aa022405c3 --- /dev/null +++ b/recipes/libgta/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include +#include + +int main() { + gta_header_t *header; + gta_result_t r = gta_create_header(&header); + if (r != GTA_OK) { + fprintf(stderr, "failed to create header"); + exit(1); + } + + return 0; +} diff --git a/recipes/libgta/config.yml b/recipes/libgta/config.yml new file mode 100644 index 0000000000000..b230418434b61 --- /dev/null +++ b/recipes/libgta/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.1": + folder: all diff --git a/recipes/libhal/all/conandata.yml b/recipes/libhal/all/conandata.yml new file mode 100644 index 0000000000000..0a5fcff604fbd --- /dev/null +++ b/recipes/libhal/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.0": + url: "https://github.com/libhal/libhal/archive/refs/tags/0.0.0.tar.gz" + sha256: "f49d6cee9adfe9d98212ba77aa955c88994693185d4870b86a6e12bad4eb9915" diff --git a/recipes/libhal/all/conanfile.py b/recipes/libhal/all/conanfile.py new file mode 100644 index 0000000000000..c9f4762f7af23 --- /dev/null +++ b/recipes/libhal/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.50.0" + + +class LibHALConan(ConanFile): + name = "libhal" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libhal.github.io/libhal" + description = ("A collection of interfaces and abstractions for embedded " + "peripherals and devices using modern C++") + topics = ("peripherals", "hardware", "abstraction", "devices", "hal") + settings = "os", "compiler", "arch", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "Visual Studio": "17", + "msvc": "193", + "clang": "13", + "apple-clang": "13.1.6" + } + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + minimum_version = self._compilers_minimum_version.get(compiler, False) + + if minimum_version and lazy_lt_semver(version, minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "LICENSE", dst=os.path.join( + self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.hpp", dst=os.path.join(self.package_folder, + "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/libhal/all/test_package/CMakeLists.txt b/recipes/libhal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e2cd1b5424ba3 --- /dev/null +++ b/recipes/libhal/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(libhal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} PRIVATE libhal::libhal) diff --git a/recipes/libhal/all/test_package/conanfile.py b/recipes/libhal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/libhal/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libhal/all/test_package/main.cpp b/recipes/libhal/all/test_package/main.cpp new file mode 100644 index 0000000000000..4fb5e3cdcdfd4 --- /dev/null +++ b/recipes/libhal/all/test_package/main.cpp @@ -0,0 +1,30 @@ +#include + +#include +#include + +class test_pwm : public hal::pwm +{ +private: + hal::status driver_frequency(hal::hertz p_frequency) noexcept override + { + std::printf("frequency = %f Hz\n", p_frequency); + return {}; + } + hal::status driver_duty_cycle(hal::percentage p_position) noexcept override + { + std::printf("duty cycle = %f %%\n", p_position.value()); + return {}; + } +}; + +int main() +{ + test_pwm pwm; + auto rc_servo = hal::rc_servo::create(pwm).value(); + rc_servo.position(0.25).value(); + rc_servo.position(0.50).value(); + rc_servo.position(-0.25).value(); + rc_servo.position(-1.0).value(); + return 0; +} diff --git a/recipes/libhal/all/test_v1_package/CMakeLists.txt b/recipes/libhal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c60d16c7a716 --- /dev/null +++ b/recipes/libhal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libhal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/main.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) +target_link_libraries(${PROJECT_NAME} PRIVATE libhal::libhal) diff --git a/recipes/libhal/all/test_v1_package/conanfile.py b/recipes/libhal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6adc2a597302e --- /dev/null +++ b/recipes/libhal/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class LibhalTestPackageConan(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 cross_building(self): + bin_path = os.path.join(self.build_folder, "bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libhal/config.yml b/recipes/libhal/config.yml new file mode 100644 index 0000000000000..ecbb76a96ea8d --- /dev/null +++ b/recipes/libhal/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.0": + folder: "all" diff --git a/recipes/libharu/all/conandata.yml b/recipes/libharu/all/conandata.yml new file mode 100644 index 0000000000000..29a286d695d61 --- /dev/null +++ b/recipes/libharu/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.4.3": + url: "https://github.com/libharu/libharu/archive/refs/tags/v2.4.3.tar.gz" + sha256: "a2c3ae4261504a0fda25b09e7babe5df02b21803dd1308fdf105588f7589d255" + "2.3.0": + url: "https://github.com/libharu/libharu/archive/RELEASE_2_3_0.tar.gz" + sha256: "8f9e68cc5d5f7d53d1bc61a1ed876add1faf4f91070dbc360d8b259f46d9a4d2" +patches: + "2.3.0": + - patch_file: "patches/0001-allow-cmake-subproject.patch" + patch_type: "conan" + patch_description: "Allow cmake subproject" + - patch_file: "patches/0002-linux-add-m-system-library.patch" + patch_type: "conan" + patch_description: "Linux: add m system library" + - patch_file: "patches/0003-rename-tiff-symbols.patch" + patch_type: "conan" + patch_description: "Rename TIFF symbols" diff --git a/recipes/libharu/all/conanfile.py b/recipes/libharu/all/conanfile.py new file mode 100644 index 0000000000000..fc6fd0d3335fc --- /dev/null +++ b/recipes/libharu/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, load, save +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os +import re + + +required_conan_version = ">=1.53.0" + + + +class LibharuConan(ConanFile): + name = "libharu" + description = "Haru is a free, cross platform, open-sourced software library for generating PDF." + topics = "pdf", "generate", "generator" + license = "Zlib" + homepage = "http://libharu.org/" + 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, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + # src_folder must use the same source folder name the project + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + self.requires("libpng/1.6.39") + + 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["LIBHPDF_SHARED"] = self.options.shared + tc.variables["LIBHPDF_STATIC"] = not self.options.shared + # 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() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _v230_extract_license(self): + readme = load(save, os.path.join(self.source_folder, "README")) + match = next(re.finditer("\n[^\n]*license[^\n]*\n", readme, flags=re.I | re.A)) + return readme[match.span()[1]:].strip("*").strip() + + def package(self): + cmake = CMake(self) + cmake.install() + + if Version(self.version) == "2.3.0": + rm(self, "CHANGES", os.path.join(self.package_folder)) + rm(self, "INSTALL", os.path.join(self.package_folder)) + rm(self, "README", os.path.join(self.package_folder)) + + rmdir(self, os.path.join(self.package_folder, "if")) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._v230_extract_license()) + else: + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + libprefix = "" + libsuffix = "" + if Version(self.version) == "2.3.0": + libprefix = "lib" if is_msvc(self) else "" + libsuffix = "{}{}".format( + "" if self.options.shared else "s", + "d" if is_msvc(self) and self.settings.build_type == "Debug" else "", + ) + self.cpp_info.libs = [f"{libprefix}hpdf{libsuffix}"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines = ["HPDF_DLL"] + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.shared: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libharu/all/patches/0001-allow-cmake-subproject.patch b/recipes/libharu/all/patches/0001-allow-cmake-subproject.patch new file mode 100644 index 0000000000000..2f042378b59fd --- /dev/null +++ b/recipes/libharu/all/patches/0001-allow-cmake-subproject.patch @@ -0,0 +1,82 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1,3 +1,5 @@ ++cmake_minimum_required(VERSION 3.10) ++ + # CMakeLists.txt + # + # Copyright (C) 2008 Werner Smekal +@@ -31,11 +33,8 @@ + set(LIBHPDF_DESCRIPTION "libHaru is a free, cross platform, open source library for generating PDF files.") + set(LIBHPDF_PACKAGE_NAME "libHaru-${LIBHPDF_VERSION}-${COMPILER_LABEL}") + +-# we want cmake version 2.4.8 at least +-cmake_minimum_required(VERSION 2.4.8 FATAL_ERROR) +- + # Location where the haru cmake build system first looks for cmake modules +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) + + # set library name, msvc does not append 'lib' automatically + if(MSVC) +@@ -110,7 +109,7 @@ + if(MSVC_VERSION GREATER 1399) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE) + endif(MSVC_VERSION GREATER 1399) +-include_directories(${CMAKE_SOURCE_DIR}/include) ++include_directories(${PROJECT_SOURCE_DIR}/include) + + + # these are options +@@ -149,16 +148,16 @@ + + # create hpdf_config.h + configure_file( +- ${CMAKE_SOURCE_DIR}/include/hpdf_config.h.cmake +- ${CMAKE_BINARY_DIR}/include/hpdf_config.h ++ ${PROJECT_SOURCE_DIR}/include/hpdf_config.h.cmake ++ ${PROJECT_BINARY_DIR}/include/hpdf_config.h + ) +-include_directories(${CMAKE_BINARY_DIR}/include) ++include_directories(${PROJECT_BINARY_DIR}/include) + + # create DevPackage file + if(DEVPAK) + configure_file( +- ${CMAKE_SOURCE_DIR}/libharu.DevPackage.cmake +- ${CMAKE_BINARY_DIR}/libharu.DevPackage ++ ${PROJECT_SOURCE_DIR}/libharu.DevPackage.cmake ++ ${PROJECT_BINARY_DIR}/libharu.DevPackage + ) + endif(DEVPAK) + # ======================================================================= +@@ -203,7 +202,7 @@ + include/hpdf_pdfa.h + include/hpdf_3dmeasure.h + include/hpdf_exdata.h +- ${CMAKE_BINARY_DIR}/include/hpdf_config.h ++ ${PROJECT_BINARY_DIR}/include/hpdf_config.h + ) + + # install header files +@@ -215,7 +214,7 @@ + install(DIRECTORY if DESTINATION .) + endif(NOT DEVPAK) + if(DEVPAK) +- install(FILES ${CMAKE_BINARY_DIR}/libharu.DevPackage DESTINATION .) ++ install(FILES ${PROJECT_BINARY_DIR}/libharu.DevPackage DESTINATION .) + endif(DEVPAK) + + # ======================================================================= +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -79,7 +79,7 @@ + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) +- if(WIN32 AND NOT CYGWIN) ++ if(0) + foreach(addlib ${ADDITIONAL_LIBRARIES}) + install(FILES ${addlib} DESTINATION lib) + endforeach(addlib) + diff --git a/recipes/libharu/all/patches/0002-linux-add-m-system-library.patch b/recipes/libharu/all/patches/0002-linux-add-m-system-library.patch new file mode 100644 index 0000000000000..d4baac11198b8 --- /dev/null +++ b/recipes/libharu/all/patches/0002-linux-add-m-system-library.patch @@ -0,0 +1,19 @@ +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -87,7 +88,7 @@ + endif(LIBHPDF_STATIC) + if(LIBHPDF_SHARED) + add_library(${LIBHPDF_NAME} SHARED ${LIBHPDF_SRCS}) +- target_link_libraries(${LIBHPDF_NAME} ${ADDITIONAL_LIBRARIES}) ++ target_link_libraries(${LIBHPDF_NAME} PUBLIC ${ADDITIONAL_LIBRARIES}) + if(WIN32 AND NOT CYGWIN) + set_target_properties(${LIBHPDF_NAME} PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE) + endif(WIN32 AND NOT CYGWIN) +@@ -97,4 +98,7 @@ + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) ++ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") ++ target_link_libraries(${LIBHPDF_NAME} PRIVATE m) ++ endif() + endif(LIBHPDF_SHARED) diff --git a/recipes/libharu/all/patches/0003-rename-tiff-symbols.patch b/recipes/libharu/all/patches/0003-rename-tiff-symbols.patch new file mode 100644 index 0000000000000..415067335587d --- /dev/null +++ b/recipes/libharu/all/patches/0003-rename-tiff-symbols.patch @@ -0,0 +1,46 @@ +--- src/hpdf_image_ccitt.c ++++ src/hpdf_image_ccitt.c +@@ -578,11 +578,11 @@ HPDF_Fax3Encode2DRow(struct _HPDF_CCITT_Data *pData, unsigned char* bp, unsigned + a2 = finddiff2(bp, a1, bits, PIXEL(bp,a1)); + putcode(pData, &horizcode); + if (a0+a1 == 0 || PIXEL(bp, a0) == 0) { +- putspan(pData, a1-a0, TIFFFaxWhiteCodes); +- putspan(pData, a2-a1, TIFFFaxBlackCodes); ++ putspan(pData, a1-a0, HPDF_TIFFFaxWhiteCodes); ++ putspan(pData, a2-a1, HPDF_TIFFFaxBlackCodes); + } else { +- putspan(pData, a1-a0, TIFFFaxBlackCodes); +- putspan(pData, a2-a1, TIFFFaxWhiteCodes); ++ putspan(pData, a1-a0, HPDF_TIFFFaxBlackCodes); ++ putspan(pData, a2-a1, HPDF_TIFFFaxWhiteCodes); + } + a0 = a2; + } else { /* vertical mode */ +--- src/t4.h ++++ src/t4.h +@@ -55,7 +55,7 @@ typedef struct tableentry { + * during state generation (see mkg3states.c). + */ + #ifdef G3CODES +-const tableentry TIFFFaxWhiteCodes[] = { ++const tableentry HPDF_TIFFFaxWhiteCodes[] = { + { 8, 0x35, 0 }, /* 0011 0101 */ + { 6, 0x7, 1 }, /* 0001 11 */ + { 4, 0x7, 2 }, /* 0111 */ +@@ -167,7 +167,7 @@ const tableentry TIFFFaxWhiteCodes[] = { + { 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */ + }; + +-const tableentry TIFFFaxBlackCodes[] = { ++const tableentry HPDF_TIFFFaxBlackCodes[] = { + { 10, 0x37, 0 }, /* 0000 1101 11 */ + { 3, 0x2, 1 }, /* 010 */ + { 2, 0x3, 2 }, /* 11 */ +@@ -281,5 +281,7 @@ const tableentry TIFFFaxBlackCodes[] = { + #else + extern const tableentry TIFFFaxWhiteCodes[]; + extern const tableentry TIFFFaxBlackCodes[]; ++const tableentry *HPDF_TIFFFaxWhiteCodes = TIFFFaxWhiteCodes; ++const tableentry *HPDF_TIFFFaxBlackCodes = TIFFFaxBlackCodes; + #endif + #endif /* _T4_ */ diff --git a/recipes/libharu/all/test_package/CMakeLists.txt b/recipes/libharu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b0aef7cdad89b --- /dev/null +++ b/recipes/libharu/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +find_package(libharu REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libharu::libharu) diff --git a/recipes/libharu/all/test_package/conanfile.py b/recipes/libharu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..470ed63c2164f --- /dev/null +++ b/recipes/libharu/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from conan.errors import ConanException +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + if not os.path.isfile("test.pdf"): + raise ConanException("test did not create test.pdf") diff --git a/recipes/libharu/all/test_package/test_package.c b/recipes/libharu/all/test_package/test_package.c new file mode 100644 index 0000000000000..3c3a5d802098a --- /dev/null +++ b/recipes/libharu/all/test_package/test_package.c @@ -0,0 +1,149 @@ +#include "hpdf.h" + +#include +#include +#include +#include + + +void +error_handler (HPDF_STATUS error_no, + HPDF_STATUS detail_no, + void *user_data) +{ + printf ("ERROR: error_no=%04X, detail_no=%u\n", (HPDF_UINT)error_no, + (HPDF_UINT)detail_no); + abort(); +} + +void +print_grid (HPDF_Doc pdf, + HPDF_Page page) +{ + HPDF_REAL height = HPDF_Page_GetHeight (page); + HPDF_REAL width = HPDF_Page_GetWidth (page); + HPDF_Font font = HPDF_GetFont (pdf, "Helvetica", NULL); + HPDF_UINT x, y; + + HPDF_Page_SetFontAndSize (page, font, 5); + HPDF_Page_SetGrayFill (page, 0.5); + HPDF_Page_SetGrayStroke (page, 0.8); + + /* Draw horizontal lines */ + y = 0; + while (y < height) { + if (y % 10 == 0) + HPDF_Page_SetLineWidth (page, 0.5); + else { + if (HPDF_Page_GetLineWidth (page) != 0.25) + HPDF_Page_SetLineWidth (page, 0.25); + } + + HPDF_Page_MoveTo (page, 0, y); + HPDF_Page_LineTo (page, width, y); + HPDF_Page_Stroke (page); + + if (y % 10 == 0 && y > 0) { + HPDF_Page_SetGrayStroke (page, 0.5); + + HPDF_Page_MoveTo (page, 0, y); + HPDF_Page_LineTo (page, 5, y); + HPDF_Page_Stroke (page); + + HPDF_Page_SetGrayStroke (page, 0.8); + } + + y += 5; + } + + + /* Draw vertical lines */ + x = 0; + while (x < width) { + if (x % 10 == 0) + HPDF_Page_SetLineWidth (page, 0.5); + else { + if (HPDF_Page_GetLineWidth (page) != 0.25) + HPDF_Page_SetLineWidth (page, 0.25); + } + + HPDF_Page_MoveTo (page, x, 0); + HPDF_Page_LineTo (page, x, height); + HPDF_Page_Stroke (page); + + if (x % 50 == 0 && x > 0) { + HPDF_Page_SetGrayStroke (page, 0.5); + + HPDF_Page_MoveTo (page, x, 0); + HPDF_Page_LineTo (page, x, 5); + HPDF_Page_Stroke (page); + + HPDF_Page_MoveTo (page, x, height); + HPDF_Page_LineTo (page, x, height - 5); + HPDF_Page_Stroke (page); + + HPDF_Page_SetGrayStroke (page, 0.8); + } + + x += 5; + } + + /* Draw horizontal text */ + y = 0; + while (y < height) { + if (y % 10 == 0 && y > 0) { + char buf[12]; + + HPDF_Page_BeginText (page); + HPDF_Page_MoveTextPos (page, 5, y - 2); + snprintf (buf, 12, "%u", y); + HPDF_Page_ShowText (page, buf); + HPDF_Page_EndText (page); + } + + y += 5; + } + + + /* Draw vertical text */ + x = 0; + while (x < width) { + if (x % 50 == 0 && x > 0) { + char buf[12]; + + HPDF_Page_BeginText (page); + HPDF_Page_MoveTextPos (page, x, 5); + snprintf (buf, 12, "%u", x); + HPDF_Page_ShowText (page, buf); + HPDF_Page_EndText (page); + + HPDF_Page_BeginText (page); + HPDF_Page_MoveTextPos (page, x, height - 10); + HPDF_Page_ShowText (page, buf); + HPDF_Page_EndText (page); + } + + x += 5; + } + + HPDF_Page_SetGrayFill (page, 0); + HPDF_Page_SetGrayStroke (page, 0); +} + + +int main() { + HPDF_Doc pdf; + HPDF_Page page; + + pdf = HPDF_New (error_handler, NULL); + if (!pdf) { + fprintf(stderr, "error: cannot create PdfDoc object\n"); + return 1; + } + page = HPDF_AddPage (pdf); + print_grid (pdf, page); + HPDF_SaveToFile (pdf, "test.pdf"); + + HPDF_Free (pdf); + return 0; +} diff --git a/recipes/libharu/all/test_v1_package/CMakeLists.txt b/recipes/libharu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libharu/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libharu/all/test_v1_package/conanfile.py b/recipes/libharu/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4651d31d881e8 --- /dev/null +++ b/recipes/libharu/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_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) + if not os.path.isfile("test.pdf"): + raise ConanException("test did not create test.pdf") diff --git a/recipes/libharu/config.yml b/recipes/libharu/config.yml new file mode 100644 index 0000000000000..39ca57fe00f3b --- /dev/null +++ b/recipes/libharu/config.yml @@ -0,0 +1,5 @@ +versions: + "2.4.3": + folder: "all" + "2.3.0": + folder: "all" diff --git a/recipes/libheif/all/conandata.yml b/recipes/libheif/all/conandata.yml new file mode 100644 index 0000000000000..c5668b6d3c93a --- /dev/null +++ b/recipes/libheif/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.13.0": + url: "https://github.com/strukturag/libheif/releases/download/v1.13.0/libheif-1.13.0.tar.gz" + sha256: "c20ae01bace39e89298f6352f1ff4a54b415b33b9743902da798e8a1e51d7ca1" + "1.12.0": + url: "https://github.com/strukturag/libheif/releases/download/v1.12.0/libheif-1.12.0.tar.gz" + sha256: "e1ac2abb354fdc8ccdca71363ebad7503ad731c84022cf460837f0839e171718" + "1.11.0": + url: "https://github.com/strukturag/libheif/releases/download/v1.11.0/libheif-1.11.0.tar.gz" + sha256: "c550938f56ff6dac83702251a143f87cb3a6c71a50d8723955290832d9960913" + "1.9.1": + url: "https://github.com/strukturag/libheif/releases/download/v1.9.1/libheif-1.9.1.tar.gz" + sha256: "5f65ca2bd2510eed4e13bdca123131c64067e9dd809213d7aef4dc5e37948bca" +patches: + "1.13.0": + - patch_file: "patches/0001-cmake_1.13.0.patch" + "1.12.0": + - patch_file: "patches/0001-cmake_1.12.0.patch" + "1.11.0": + - patch_file: "patches/0001-cmake_1.11.0.patch" + "1.9.1": + - patch_file: "patches/0001-cmake-1.9.1.patch" diff --git a/recipes/libheif/all/conanfile.py b/recipes/libheif/all/conanfile.py new file mode 100644 index 0000000000000..55d521d49ca38 --- /dev/null +++ b/recipes/libheif/all/conanfile.py @@ -0,0 +1,119 @@ +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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class LibheifConan(ConanFile): + name = "libheif" + description = "libheif is an HEIF and AVIF file format decoder and encoder." + topics = ("heif", "codec", "video") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/strukturag/libheif" + license = ("LGPL-3.0-only", "GPL-3.0-or-later", "MIT") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libde265": [True, False], + "with_x265": [True, False], + "with_libaomav1": [True, False], + "with_dav1d": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libde265": True, + "with_x265": False, + "with_libaomav1": False, + "with_dav1d": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_libde265: + self.requires("libde265/1.0.9") + if self.options.with_x265: + self.requires("libx265/3.4") + if self.options.with_libaomav1: + self.requires("libaom-av1/3.5.0") + if self.options.with_dav1d: + self.requires("dav1d/1.0.0") + + 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["WITH_LIBDE265"] = self.options.with_libde265 + tc.variables["WITH_X265"] = self.options.with_x265 + tc.variables["WITH_AOM"] = self.options.with_libaomav1 + tc.variables["WITH_RAV1E"] = False + tc.variables["WITH_DAV1D"] = self.options.with_dav1d + tc.variables["WITH_EXAMPLES"] = 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, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libheif") + self.cpp_info.set_property("cmake_target_name", "libheif::heif") + self.cpp_info.set_property("pkg_config_name", "libheif") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["heif"].libs = ["heif"] + if not self.options.shared: + self.cpp_info.components["heif"].defines = ["LIBHEIF_STATIC_BUILD"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["heif"].system_libs.extend(["m", "pthread"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["heif"].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["heif"].set_property("cmake_target_name", "libheif::heif") + self.cpp_info.components["heif"].set_property("pkg_config_name", "libheif") + self.cpp_info.components["heif"].requires = [] + if self.options.with_libde265: + self.cpp_info.components["heif"].requires.append("libde265::libde265") + if self.options.with_x265: + self.cpp_info.components["heif"].requires.append("libx265::libx265") + if self.options.with_libaomav1: + self.cpp_info.components["heif"].requires.append("libaom-av1::libaom-av1") + if self.options.with_dav1d: + self.cpp_info.components["heif"].requires.append("dav1d::dav1d") diff --git a/recipes/libheif/all/patches/0001-cmake-1.9.1.patch b/recipes/libheif/all/patches/0001-cmake-1.9.1.patch new file mode 100644 index 0000000000000..65b0f3637413f --- /dev/null +++ b/recipes/libheif/all/patches/0001-cmake-1.9.1.patch @@ -0,0 +1,146 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,14 +34,10 @@ if(NOT MSVC) + add_definitions(-Wno-error=deprecated-declarations) + endif() + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # Create the compile command database for clang by default + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +@@ -55,10 +51,20 @@ if (has_potentially_evaluated_expression) + endif() + + LIST (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") +-find_package(Libde265 REQUIRED) +-find_package(X265) +-find_package(LibAOM) ++if(WITH_LIBDE265) ++find_package(libde265 REQUIRED CONFIG) ++endif() ++if(WITH_X265) ++find_package(libx265 REQUIRED CONFIG) ++endif() ++if(WITH_AOM) ++find_package(libaom-av1 REQUIRED CONFIG) ++endif() ++if(WITH_DAV1D) ++find_package(dav1d REQUIRED CONFIG) ++endif() + ++if(0) + if (LIBDE265_FOUND) + message("HEIF decoder, libde265: found") + else () +@@ -88,6 +94,7 @@ if (USE_LOCAL_DAV1D) + else () + message("AVIF decoder, use local dav1d: no") + endif () ++endif() + + + # Create libheif pkgconfig file +@@ -128,4 +135,3 @@ if(WITH_EXAMPLES) + add_subdirectory (examples) + endif() + add_subdirectory (libheif) +-add_subdirectory (gdk-pixbuf) +--- a/libheif/CMakeLists.txt ++++ b/libheif/CMakeLists.txt +@@ -59,45 +59,36 @@ target_compile_definitions(heif + LIBHEIF_EXPORTS + HAVE_VISIBILITY) + +-if(LIBDE265_FOUND) ++target_compile_features(heif PRIVATE cxx_std_11) ++if(WITH_LIBDE265) + target_compile_definitions(heif PRIVATE HAVE_LIBDE265=1) + target_sources(heif + PRIVATE + heif_decoder_libde265.cc + heif_decoder_libde265.h) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBDE265_CFLAGS}") + +- if (NOT "${LIBDE265_LIBRARY_DIRS}" STREQUAL "") +- set(LIBDE265_LINKDIR "-L${LIBDE265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${LIBDE265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${LIBDE265_LIBRARIES} ${LIBDE265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libde265) + + install(FILES heif_decoder_libde265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + endif() + +-if(X265_FOUND) ++if(WITH_X265) + target_compile_definitions(heif PRIVATE HAVE_X265=1) + target_sources(heif PRIVATE + heif_encoder_x265.cc + heif_encoder_x265.h + ) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${X265_CFLAGS}") + +- if (NOT "${X265_LIBRARY_DIRS}" STREQUAL "") +- set(X265_LINKDIR "-L${X265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${X265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${X265_LIBRARIES} ${X265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libx265::libx265) + + install(FILES heif_encoder_x265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + endif() + +-if(AOM_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM=1) + target_sources(heif PRIVATE + heif_decoder_aom.cc +@@ -105,15 +96,9 @@ if(AOM_FOUND) + heif_encoder_aom.cc + heif_encoder_aom.h + ) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AOM_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AOM_CFLAGS}") + +- if (NOT "${AOM_LIBRARY_DIRS}" STREQUAL "") +- set(AOM_LINKDIR "-L${AOM_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${AOM_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${AOM_LIBRARIES} ${AOM_LINKDIR}) ++ target_link_libraries(heif PRIVATE libaom-av1::libaom-av1) + endif() + + if(USE_LOCAL_RAV1E) +@@ -126,18 +111,14 @@ if(USE_LOCAL_RAV1E) + target_link_libraries(heif PRIVATE ${CMAKE_SOURCE_DIR}/third-party/rav1e/target/release/librav1e.a -ldl) + endif() + +-if(USE_LOCAL_DAV1D) ++if(WITH_DAV1D) + target_compile_definitions(heif PRIVATE HAVE_DAV1D=1) + target_sources(heif PRIVATE + heif_decoder_dav1d.cc + heif_decoder_dav1d.h + ) +- target_include_directories(heif PRIVATE ${CMAKE_SOURCE_DIR}/third-party/dav1d/build +- ${CMAKE_SOURCE_DIR}/third-party/dav1d/build/include +- ${CMAKE_SOURCE_DIR}/third-party/dav1d/build/include/dav1d +- ${CMAKE_SOURCE_DIR}/third-party/dav1d/include) + +- target_link_libraries(heif PRIVATE ${CMAKE_SOURCE_DIR}/third-party/dav1d/build/src/libdav1d.a -ldl) ++ target_link_libraries(heif PRIVATE dav1d::dav1d) + endif () + + write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake COMPATIBILITY ExactVersion) diff --git a/recipes/libheif/all/patches/0001-cmake_1.11.0.patch b/recipes/libheif/all/patches/0001-cmake_1.11.0.patch new file mode 100644 index 0000000000000..1bf34c06d1da8 --- /dev/null +++ b/recipes/libheif/all/patches/0001-cmake_1.11.0.patch @@ -0,0 +1,162 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,14 +31,10 @@ if(NOT MSVC) + add_definitions(-Wno-error=deprecated-declarations) + endif() + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # Create the compile command database for clang by default + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +@@ -55,17 +51,17 @@ LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") + + option(WITH_LIBDE265 "Build libde265 decoder" ON) + if (WITH_LIBDE265) +- find_package(Libde265) ++ find_package(libde265 REQUIRED CONFIG) + endif () + + option(WITH_X265 "Build x265 encoder" ON) + if (WITH_X265) +- find_package(X265) ++ find_package(libx265 REQUIRED CONFIG) + endif () + + option(WITH_AOM "Build aom encoder/decoder" ON) + if (WITH_AOM) +- find_package(LibAOM) ++ find_package(libaom-av1 REQUIRED CONFIG) + endif() + + option(WITH_RAV1E "Build rav1e encoder" ON) +@@ -75,9 +71,10 @@ endif () + + option(WITH_DAV1D "Build dav1e decoder" ON) + if (WITH_DAV1D) +- find_package(Dav1d) ++ find_package(dav1d REQUIRED CONFIG) + endif () + ++if(0) + if (LIBDE265_FOUND) + message("HEIF decoder, libde265: found") + else () +@@ -113,6 +110,7 @@ if (DAV1D_FOUND) + else () + message("AVIF decoder, dav1d: not found") + endif () ++endif() + + + # Create libheif pkgconfig file +@@ -165,4 +163,3 @@ if(WITH_EXAMPLES) + add_subdirectory (examples) + endif() + add_subdirectory (libheif) +-add_subdirectory (gdk-pixbuf) +--- a/libheif/CMakeLists.txt ++++ b/libheif/CMakeLists.txt +@@ -59,63 +59,48 @@ target_compile_definitions(heif + LIBHEIF_EXPORTS + HAVE_VISIBILITY) + +-if(LIBDE265_FOUND) ++target_compile_features(heif PRIVATE cxx_std_11) ++if(WITH_LIBDE265) + target_compile_definitions(heif PRIVATE HAVE_LIBDE265=1) + target_sources(heif + PRIVATE + heif_decoder_libde265.cc + heif_decoder_libde265.h) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBDE265_CFLAGS}") + +- if (NOT "${LIBDE265_LIBRARY_DIRS}" STREQUAL "") +- set(LIBDE265_LINKDIR "-L${LIBDE265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${LIBDE265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${LIBDE265_LIBRARIES} ${LIBDE265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libde265) + + install(FILES heif_decoder_libde265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + endif() + +-if(X265_FOUND) ++if(WITH_X265) + target_compile_definitions(heif PRIVATE HAVE_X265=1) + target_sources(heif PRIVATE + heif_encoder_x265.cc + heif_encoder_x265.h + ) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${X265_CFLAGS}") + +- if (NOT "${X265_LIBRARY_DIRS}" STREQUAL "") +- set(X265_LINKDIR "-L${X265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${X265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${X265_LIBRARIES} ${X265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libx265::libx265) + + install(FILES heif_encoder_x265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + endif() + +-if(AOM_ENCODER_FOUND OR AOM_DECODER_FOUND) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AOM_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AOM_CFLAGS}") ++if(WITH_AOM) + +- if (NOT "${AOM_LIBRARY_DIRS}" STREQUAL "") +- set(AOM_LINKDIR "-L${AOM_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${AOM_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${AOM_LIBRARIES} ${AOM_LINKDIR}) ++ target_link_libraries(heif PRIVATE libaom-av1::libaom-av1) + endif() +-if(AOM_ENCODER_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM_ENCODER=1) + target_sources(heif PRIVATE + heif_encoder_aom.cc + heif_encoder_aom.h + ) + endif() +-if(AOM_DECODER_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM_DECODER=1) + target_sources(heif PRIVATE + heif_decoder_aom.cc +@@ -140,21 +125,15 @@ if(RAV1E_FOUND) + target_link_libraries(heif PRIVATE ${RAV1E_LIBRARIES} ${RAV1E_LINKDIR}) + endif() + +-if(DAV1D_FOUND) ++if(WITH_DAV1D) + target_compile_definitions(heif PRIVATE HAVE_DAV1D=1) + target_sources(heif PRIVATE + heif_decoder_dav1d.cc + heif_decoder_dav1d.h + ) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DAV1D_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DAV1D_CFLAGS}") + +- if (NOT "${DAV1D_LIBRARY_DIRS}" STREQUAL "") +- set(DAV1D_LINKDIR "-L${DAV1D_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${DAV1D_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${DAV1D_LIBRARIES} ${DAV1D_LINKDIR}) ++ target_link_libraries(heif PRIVATE dav1d::dav1d) + endif () + + write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake COMPATIBILITY ExactVersion) diff --git a/recipes/libheif/all/patches/0001-cmake_1.12.0.patch b/recipes/libheif/all/patches/0001-cmake_1.12.0.patch new file mode 100644 index 0000000000000..7504a4c708fcd --- /dev/null +++ b/recipes/libheif/all/patches/0001-cmake_1.12.0.patch @@ -0,0 +1,162 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,14 +31,10 @@ if(NOT MSVC) + add_definitions(-Wno-error=deprecated-declarations) + endif() + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # Create the compile command database for clang by default + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +@@ -55,17 +51,17 @@ LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") + + option(WITH_LIBDE265 "Build libde265 decoder" ON) + if (WITH_LIBDE265) +- find_package(Libde265) ++ find_package(libde265 REQUIRED CONFIG) + endif () + + option(WITH_X265 "Build x265 encoder" ON) + if (WITH_X265) +- find_package(X265) ++ find_package(libx265 REQUIRED CONFIG) + endif () + + option(WITH_AOM "Build aom encoder/decoder" ON) + if (WITH_AOM) +- find_package(LibAOM) ++ find_package(libaom-av1 REQUIRED CONFIG) + endif() + + option(WITH_RAV1E "Build rav1e encoder" ON) +@@ -75,9 +71,10 @@ endif () + + option(WITH_DAV1D "Build dav1d decoder" ON) + if (WITH_DAV1D) +- find_package(Dav1d) ++ find_package(dav1d REQUIRED CONFIG) + endif () + ++if(0) + if (LIBDE265_FOUND) + message("HEIF decoder, libde265: found") + else () +@@ -113,6 +110,7 @@ if (DAV1D_FOUND) + else () + message("AVIF decoder, dav1d: not found") + endif () ++endif() + + + # Create libheif pkgconfig file +@@ -165,4 +163,3 @@ if(WITH_EXAMPLES) + add_subdirectory (examples) + endif() + add_subdirectory (libheif) +-add_subdirectory (gdk-pixbuf) +--- a/libheif/CMakeLists.txt ++++ b/libheif/CMakeLists.txt +@@ -59,63 +59,48 @@ target_compile_definitions(heif + LIBHEIF_EXPORTS + HAVE_VISIBILITY) + +-if(LIBDE265_FOUND) ++target_compile_features(heif PRIVATE cxx_std_11) ++if(WITH_LIBDE265) + target_compile_definitions(heif PRIVATE HAVE_LIBDE265=1) + target_sources(heif + PRIVATE + heif_decoder_libde265.cc + heif_decoder_libde265.h) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBDE265_CFLAGS}") + +- if (NOT "${LIBDE265_LIBRARY_DIRS}" STREQUAL "") +- set(LIBDE265_LINKDIR "-L${LIBDE265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${LIBDE265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${LIBDE265_LIBRARIES} ${LIBDE265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libde265) + + install(FILES heif_decoder_libde265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + endif() + +-if(X265_FOUND) ++if(WITH_X265) + target_compile_definitions(heif PRIVATE HAVE_X265=1) + target_sources(heif PRIVATE + heif_encoder_x265.cc + heif_encoder_x265.h + ) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${X265_CFLAGS}") + +- if (NOT "${X265_LIBRARY_DIRS}" STREQUAL "") +- set(X265_LINKDIR "-L${X265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${X265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${X265_LIBRARIES} ${X265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libx265::libx265) + + install(FILES heif_encoder_x265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + endif() + +-if(AOM_ENCODER_FOUND OR AOM_DECODER_FOUND) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AOM_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AOM_CFLAGS}") ++if(WITH_AOM) + +- if (NOT "${AOM_LIBRARY_DIRS}" STREQUAL "") +- set(AOM_LINKDIR "-L${AOM_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${AOM_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${AOM_LIBRARIES} ${AOM_LINKDIR}) ++ target_link_libraries(heif PRIVATE libaom-av1::libaom-av1) + endif() +-if(AOM_ENCODER_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM_ENCODER=1) + target_sources(heif PRIVATE + heif_encoder_aom.cc + heif_encoder_aom.h + ) + endif() +-if(AOM_DECODER_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM_DECODER=1) + target_sources(heif PRIVATE + heif_decoder_aom.cc +@@ -140,21 +125,15 @@ if(RAV1E_FOUND) + target_link_libraries(heif PRIVATE ${RAV1E_LIBRARIES} ${RAV1E_LINKDIR}) + endif() + +-if(DAV1D_FOUND) ++if(WITH_DAV1D) + target_compile_definitions(heif PRIVATE HAVE_DAV1D=1) + target_sources(heif PRIVATE + heif_decoder_dav1d.cc + heif_decoder_dav1d.h + ) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DAV1D_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DAV1D_CFLAGS}") + +- if (NOT "${DAV1D_LIBRARY_DIRS}" STREQUAL "") +- set(DAV1D_LINKDIR "-L${DAV1D_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${DAV1D_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${DAV1D_LIBRARIES} ${DAV1D_LINKDIR}) ++ target_link_libraries(heif PRIVATE dav1d::dav1d) + endif () + + write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake COMPATIBILITY ExactVersion) diff --git a/recipes/libheif/all/patches/0001-cmake_1.13.0.patch b/recipes/libheif/all/patches/0001-cmake_1.13.0.patch new file mode 100644 index 0000000000000..ce89cda4b5c16 --- /dev/null +++ b/recipes/libheif/all/patches/0001-cmake_1.13.0.patch @@ -0,0 +1,159 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,14 +35,10 @@ if(NOT MSVC) + endif () + endif() + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # Create the compile command database for clang by default + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +@@ -59,17 +55,17 @@ LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") + + option(WITH_LIBDE265 "Build libde265 decoder" ON) + if (WITH_LIBDE265) +- find_package(Libde265) ++ find_package(libde265 REQUIRED CONFIG) + endif () + + option(WITH_X265 "Build x265 encoder" ON) + if (WITH_X265) +- find_package(X265) ++ find_package(libx265 REQUIRED CONFIG) + endif () + + option(WITH_AOM "Build aom encoder/decoder" ON) + if (WITH_AOM) +- find_package(LibAOM) ++ find_package(libaom-av1 REQUIRED CONFIG) + endif() + + option(WITH_RAV1E "Build rav1e encoder" ON) +@@ -79,9 +75,10 @@ endif () + + option(WITH_DAV1D "Build dav1d decoder" ON) + if (WITH_DAV1D) +- find_package(Dav1d) ++ find_package(dav1d REQUIRED CONFIG) + endif () + ++if(0) + if (LIBDE265_FOUND) + message("HEIF decoder, libde265: found") + else () +@@ -117,6 +114,7 @@ if (DAV1D_FOUND) + else () + message("AVIF decoder, dav1d: not found") + endif () ++endif() + + + # Create libheif pkgconfig file +@@ -169,5 +167,3 @@ if(WITH_EXAMPLES) + add_subdirectory (examples) + endif() + add_subdirectory (libheif) +-add_subdirectory (gdk-pixbuf) +-add_subdirectory (gnome) +--- a/libheif/CMakeLists.txt ++++ b/libheif/CMakeLists.txt +@@ -60,59 +60,44 @@ target_compile_definitions(heif + LIBHEIF_EXPORTS + HAVE_VISIBILITY) + +-if(LIBDE265_FOUND) ++target_compile_features(heif PRIVATE cxx_std_11) ++if(WITH_LIBDE265) + target_compile_definitions(heif PRIVATE HAVE_LIBDE265=1) + target_sources(heif + PRIVATE + heif_decoder_libde265.cc + heif_decoder_libde265.h) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBDE265_CFLAGS}") + +- if (NOT "${LIBDE265_LIBRARY_DIRS}" STREQUAL "") +- set(LIBDE265_LINKDIR "-L${LIBDE265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${LIBDE265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${LIBDE265_LIBRARIES} ${LIBDE265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libde265) + endif() + +-if(X265_FOUND) ++if(WITH_X265) + target_compile_definitions(heif PRIVATE HAVE_X265=1) + target_sources(heif PRIVATE + heif_encoder_x265.cc + heif_encoder_x265.h + ) + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${X265_CFLAGS}") + +- if (NOT "${X265_LIBRARY_DIRS}" STREQUAL "") +- set(X265_LINKDIR "-L${X265_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${X265_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${X265_LIBRARIES} ${X265_LINKDIR}) ++ target_link_libraries(heif PRIVATE libx265::libx265) + endif() + +-if(AOM_ENCODER_FOUND OR AOM_DECODER_FOUND) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AOM_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AOM_CFLAGS}") ++if(WITH_AOM) + +- if (NOT "${AOM_LIBRARY_DIRS}" STREQUAL "") +- set(AOM_LINKDIR "-L${AOM_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${AOM_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${AOM_LIBRARIES} ${AOM_LINKDIR}) ++ target_link_libraries(heif PRIVATE libaom-av1::libaom-av1) + endif() +-if(AOM_ENCODER_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM_ENCODER=1) + target_sources(heif PRIVATE + heif_encoder_aom.cc + heif_encoder_aom.h + ) + endif() +-if(AOM_DECODER_FOUND) ++if(WITH_AOM) + target_compile_definitions(heif PRIVATE HAVE_AOM_DECODER=1) + target_sources(heif PRIVATE + heif_decoder_aom.cc +@@ -137,21 +122,15 @@ if(RAV1E_FOUND) + target_link_libraries(heif PRIVATE ${RAV1E_LIBRARIES} ${RAV1E_LINKDIR}) + endif() + +-if(DAV1D_FOUND) ++if(WITH_DAV1D) + target_compile_definitions(heif PRIVATE HAVE_DAV1D=1) + target_sources(heif PRIVATE + heif_decoder_dav1d.cc + heif_decoder_dav1d.h + ) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DAV1D_CFLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DAV1D_CFLAGS}") + +- if (NOT "${DAV1D_LIBRARY_DIRS}" STREQUAL "") +- set(DAV1D_LINKDIR "-L${DAV1D_LIBRARY_DIRS}") +- endif() + +- include_directories(SYSTEM ${DAV1D_INCLUDE_DIR}) +- target_link_libraries(heif PRIVATE ${DAV1D_LIBRARIES} ${DAV1D_LINKDIR}) ++ target_link_libraries(heif PRIVATE dav1d::dav1d) + endif () + + write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake COMPATIBILITY ExactVersion) diff --git a/recipes/libheif/all/test_package/CMakeLists.txt b/recipes/libheif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..13ebf8fab7134 --- /dev/null +++ b/recipes/libheif/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libheif REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libheif::heif) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libheif/all/test_package/conanfile.py b/recipes/libheif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libheif/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/libheif/all/test_package/test_package.cpp b/recipes/libheif/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8e7f173867ba4 --- /dev/null +++ b/recipes/libheif/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include "libheif/heif.h" + +int main() { + std::cout << heif_get_version() << std::endl; + return 0; +} diff --git a/recipes/libheif/all/test_v1_package/CMakeLists.txt b/recipes/libheif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libheif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libheif/all/test_v1_package/conanfile.py b/recipes/libheif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libheif/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/libheif/config.yml b/recipes/libheif/config.yml new file mode 100644 index 0000000000000..1b1bac20e2e23 --- /dev/null +++ b/recipes/libheif/config.yml @@ -0,0 +1,9 @@ +versions: + "1.13.0": + folder: all + "1.12.0": + folder: all + "1.11.0": + folder: all + "1.9.1": + folder: all diff --git a/recipes/libhydrogen/all/conandata.yml b/recipes/libhydrogen/all/conandata.yml new file mode 100644 index 0000000000000..23536a9b5f306 --- /dev/null +++ b/recipes/libhydrogen/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20221115": + url: "https://github.com/jedisct1/libhydrogen/archive/580da280c59f72ca67e56333f5122f8ef040c74d.tar.gz" + sha256: "cf52deeb31f83302acfc784e9dab4b93e9c13e77aad3f629cf0761d30cae7e72" +patches: + "cci.20221115": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "CMake: Use C99 or higher, avoid to inject arch specific flags, fix dll install & don't build tests" + patch_type: "portability" diff --git a/recipes/libhydrogen/all/conanfile.py b/recipes/libhydrogen/all/conanfile.py new file mode 100644 index 0000000000000..5b5dc91e28942 --- /dev/null +++ b/recipes/libhydrogen/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibhydrogenConan(ConanFile): + name = "libhydrogen" + description = "A lightweight, secure, easy-to-use crypto library suitable for constrained environments." + license = "ISC" + topics = ("cryptography", "crypto", "gimli") + homepage = "https://github.com/jedisct1/libhydrogen" + 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, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "hydrogen") + self.cpp_info.set_property("cmake_target_name", "hydrogen::hydrogen") + self.cpp_info.libs = ["hydrogen"] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "hydrogen" + self.cpp_info.names["cmake_find_package_multi"] = "hydrogen" diff --git a/recipes/libhydrogen/all/patches/0001-fix-cmake.patch b/recipes/libhydrogen/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..6fb76a8526ead --- /dev/null +++ b/recipes/libhydrogen/all/patches/0001-fix-cmake.patch @@ -0,0 +1,46 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.8) + + project(hydrogen LANGUAGES C) + +@@ -39,6 +39,7 @@ set(arduino_files "library.properties") + + # Compile options + ++if(0) + get_setting(target_arch STRING "Target system architecture (fed to the compiler's -march=XXX).") + if(NOT target_arch AND NOT CMAKE_CROSSCOMPILING) + set(target_arch native) +@@ -84,6 +85,7 @@ set(compile_options + # unsigned" + /wd4310 # * suppress warning "cast truncates constant value" + >) ++endif() + + # Prefix project files with the project root + +@@ -106,6 +108,7 @@ set(targets_export_name "${PROJECT_NAME}-targets") + + install(TARGETS "${PROJECT_NAME}" + EXPORT "${targets_export_name}" ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +@@ -134,6 +137,8 @@ install(FILES "${config_file}" DESTINATION "${install_config_dir}") + + export(EXPORT "${targets_export_name}" FILE "${targets_export_file}" NAMESPACE "${PROJECT_NAME}::") + ++target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) ++if(0) + export(PACKAGE "${PROJECT_NAME}") + + # Tests +@@ -191,3 +196,4 @@ add_custom_command(OUTPUT "${arduino_package_file}" + VERBATIM) + + add_custom_target("${PROJECT_NAME}-arduino-package" DEPENDS "${arduino_package_file}" VERBATIM) ++endif() diff --git a/recipes/libhydrogen/all/test_package/CMakeLists.txt b/recipes/libhydrogen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2090c80502872 --- /dev/null +++ b/recipes/libhydrogen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(hydrogen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hydrogen::hydrogen) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libhydrogen/all/test_package/conanfile.py b/recipes/libhydrogen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libhydrogen/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/libhydrogen/all/test_package/test_package.c b/recipes/libhydrogen/all/test_package/test_package.c new file mode 100644 index 0000000000000..2fc97802ccc3e --- /dev/null +++ b/recipes/libhydrogen/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("%lu\n", (unsigned long)hydro_random_u32()); + return 0; +} diff --git a/recipes/libhydrogen/all/test_v1_package/CMakeLists.txt b/recipes/libhydrogen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libhydrogen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libhydrogen/all/test_v1_package/conanfile.py b/recipes/libhydrogen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libhydrogen/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/libhydrogen/config.yml b/recipes/libhydrogen/config.yml new file mode 100644 index 0000000000000..7bdf816a5ffbd --- /dev/null +++ b/recipes/libhydrogen/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221115": + folder: all diff --git a/recipes/libiberty/all/conandata.yml b/recipes/libiberty/all/conandata.yml new file mode 100644 index 0000000000000..b3c320fd46551 --- /dev/null +++ b/recipes/libiberty/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "9.1.0": + url: "https://ftp.gnu.org/pub/gnu/gcc/gcc-9.1.0/gcc-9.1.0.tar.gz" + sha256: "be303f7a8292982a35381489f5a9178603cbe9a4715ee4fa4a815d6bcd2b658d" diff --git a/recipes/libiberty/all/conanfile.py b/recipes/libiberty/all/conanfile.py new file mode 100644 index 0000000000000..34588a0782655 --- /dev/null +++ b/recipes/libiberty/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rename, rmdir +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.53.0" + + +class LibibertyConan(ConanFile): + name = "libiberty" + description = "A collection of subroutines used by various GNU programs" + topics = ("gnu", "gnu-collection") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gcc.gnu.org/onlinedocs/libiberty" + license = "LGPL-2.1" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _libiberty_folder(self): + return os.path.join(self.source_folder, "libiberty") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("libiberty can not be built by Visual Studio.") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + rmdir(self, os.path.join(self.source_folder, "gcc")) + rmdir(self, os.path.join(self.source_folder, "libstdc++-v3")) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-install-libiberty") + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure(build_script_folder=self._libiberty_folder) + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", src=self._libiberty_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + self._package_xx(32) + self._package_xx(64) + + def _package_xx(self, arch): + lib_arch_dir = os.path.join(self.package_folder, f"lib{arch}") + if os.path.exists(lib_arch_dir): + libdir = os.path.join(self.package_folder, "lib") + rmdir(self, libdir) + rename(self, lib_arch_dir, libdir) + + def package_info(self): + self.cpp_info.libs = ["iberty"] diff --git a/recipes/libiberty/all/test_package/CMakeLists.txt b/recipes/libiberty/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c618a0e2a663b --- /dev/null +++ b/recipes/libiberty/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libiberty REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libiberty::libiberty) diff --git a/recipes/libiberty/all/test_package/conanfile.py b/recipes/libiberty/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libiberty/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libiberty/all/test_package/test_package.c b/recipes/libiberty/all/test_package/test_package.c new file mode 100644 index 0000000000000..0d3850d960d09 --- /dev/null +++ b/recipes/libiberty/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include +#include "libiberty/libiberty.h" + +int main(void) { + printf("GETPWD: %s\n", getpwd()); + printf("CONCAT (FOO + BAR): %s\n", concat("FOO", "BAR", NULL)); + return EXIT_SUCCESS; +} diff --git a/recipes/libiberty/all/test_v1_package/CMakeLists.txt b/recipes/libiberty/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libiberty/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libiberty/all/test_v1_package/conanfile.py b/recipes/libiberty/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libiberty/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libiberty/config.yml b/recipes/libiberty/config.yml new file mode 100644 index 0000000000000..64c225286692e --- /dev/null +++ b/recipes/libiberty/config.yml @@ -0,0 +1,3 @@ +versions: + "9.1.0": + folder: all diff --git a/recipes/libiconv/all/conandata.yml b/recipes/libiconv/all/conandata.yml new file mode 100644 index 0000000000000..445cf39835a93 --- /dev/null +++ b/recipes/libiconv/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.17": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz" + sha256: "8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313" + "1.16": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.16.tar.gz" + sha256: "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04" + "1.15": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.15.tar.gz" + sha256: "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178" +patches: + "1.16": + - patch_file: "patches/0001-libcharset-fix-linkage.patch" diff --git a/recipes/libiconv/all/conanfile.py b/recipes/libiconv/all/conanfile.py new file mode 100644 index 0000000000000..544fb2b4ab962 --- /dev/null +++ b/recipes/libiconv/all/conanfile.py @@ -0,0 +1,149 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rename, + rm, + rmdir +) +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LibiconvConan(ConanFile): + name = "libiconv" + description = "Convert text to and from Unicode" + license = ("LGPL-2.0-or-later", "LGPL-2.1-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libiconv/" + topics = ("iconv", "text", "encoding", "locale", "unicode", "conversion") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_clang_cl(self): + return self.settings.compiler == "clang" and self.settings.os == "Windows" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _msvc_tools(self): + return ("clang-cl", "llvm-lib", "lld-link") if self._is_clang_cl else ("cl", "lib", "link") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if Version(self.version) >= "1.17": + self.license = "LGPL-2.1-or-later" + else: + self.license = "LGPL-2.0-or-later" + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + self.win_bash = True + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + msvc_version = {"Visual Studio": "12", "msvc": "180"} + if is_msvc(self) and Version(self.settings.compiler.version) >= msvc_version[str(self.settings.compiler)]: + # https://github.com/conan-io/conan/issues/6514 + tc.extra_cflags.append("-FS") + if cross_building(self) and is_msvc(self): + triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"} + # ICU doesn't like GNU triplet of conan for msvc (see https://github.com/conan-io/conan/issues/12546) + host_arch = triplet_arch_windows.get(str(self.settings.arch)) + build_arch = triplet_arch_windows.get(str(self._settings_build.arch)) + + if host_arch and build_arch: + host = f"{host_arch}-w64-mingw32" + build = f"{build_arch}-w64-mingw32" + tc.configure_args.extend([ + f"--host={host}", + f"--build={build}", + ]) + env = tc.environment() + if is_msvc(self) or self._is_clang_cl: + cc, lib, link = self._msvc_tools + build_aux_path = os.path.join(self.source_folder, "build-aux") + lt_compile = unix_path(self, os.path.join(build_aux_path, "compile")) + lt_ar = unix_path(self, os.path.join(build_aux_path, "ar-lib")) + env.define("CC", f"{lt_compile} {cc} -nologo") + env.define("CXX", f"{lt_compile} {cc} -nologo") + env.define("LD", link) + env.define("STRIP", ":") + env.define("AR", f"{lt_ar} {lib}") + env.define("RANLIB", ":") + env.define("NM", "dumpbin -symbols") + env.define("win32_target", "_WIN32_WINNT_VISTA") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + if (is_msvc(self) or self._is_clang_cl) and self.options.shared: + for import_lib in ["iconv", "charset"]: + rename(self, os.path.join(self.package_folder, "lib", f"{import_lib}.dll.lib"), + os.path.join(self.package_folder, "lib", f"{import_lib}.lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Iconv") + self.cpp_info.set_property("cmake_target_name", "Iconv::Iconv") + self.cpp_info.libs = ["iconv", "charset"] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "Iconv" + self.cpp_info.names["cmake_find_package_multi"] = "Iconv" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libiconv/all/patches/0001-libcharset-fix-linkage.patch b/recipes/libiconv/all/patches/0001-libcharset-fix-linkage.patch new file mode 100644 index 0000000000000..f39e0b72f32e7 --- /dev/null +++ b/recipes/libiconv/all/patches/0001-libcharset-fix-linkage.patch @@ -0,0 +1,155 @@ +diff --git a/libcharset/Makefile.in b/libcharset/Makefile.in +index 5f599fe..e6ba91a 100644 +--- a/libcharset/Makefile.in ++++ b/libcharset/Makefile.in +@@ -30,25 +30,22 @@ mkinstalldirs = $(SHELL) @top_srcdir@/build-aux/mkinstalldirs + + SHELL = @SHELL@ + +-all : include/libcharset.h force ++all : force + cd lib && $(MAKE) all + +-include/libcharset.h : +- if [ ! -d include ] ; then mkdir include ; fi +- $(CP) $(srcdir)/include/libcharset.h.in include/libcharset.h +- + # Installs the library and include files only. Typically called with only + # $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here. + install-lib : all force + cd lib && $(MAKE) install-lib libdir='$(libdir)' includedir='$(includedir)' + $(mkinstalldirs) $(includedir) +- $(INSTALL_DATA) include/libcharset.h $(includedir)/libcharset.h +- $(INSTALL_DATA) include/localcharset.h.inst $(includedir)/localcharset.h ++ $(INSTALL_DATA) include/libcharset.h.inst $(includedir)/libcharset.h ++# Here, use the include file that contains LIBCHARSET_DLL_EXPORTED annotations. ++ $(INSTALL_DATA) include/localcharset.h $(includedir)/localcharset.h + +-install : include/libcharset.h include/localcharset.h force ++install : all force + cd lib && $(MAKE) install prefix='$(prefix)' exec_prefix='$(exec_prefix)' libdir='$(libdir)' + $(mkinstalldirs) $(DESTDIR)$(includedir) +- $(INSTALL_DATA) include/libcharset.h $(DESTDIR)$(includedir)/libcharset.h ++ $(INSTALL_DATA) include/libcharset.h.inst $(DESTDIR)$(includedir)/libcharset.h + $(INSTALL_DATA) include/localcharset.h.inst $(DESTDIR)$(includedir)/localcharset.h + + install-strip : install +@@ -73,12 +70,12 @@ clean : force + + distclean : force + cd lib && if test -f Makefile; then $(MAKE) distclean; fi +- $(RM) include/libcharset.h include/localcharset.h include/localcharset.h.inst ++ $(RM) include/libcharset.h include/libcharset.h.inst include/localcharset.h include/localcharset.h.inst + $(RM) config.status config.log config.cache Makefile config.h libtool + + maintainer-clean : force + cd lib && if test -f Makefile; then $(MAKE) maintainer-clean; fi +- $(RM) include/libcharset.h include/localcharset.h include/localcharset.h.inst ++ $(RM) include/libcharset.h include/libcharset.h.inst include/localcharset.h include/localcharset.h.inst + $(RM) config.status config.log config.cache Makefile config.h libtool + + # List of source files. +@@ -133,6 +130,7 @@ IMPORTED_FILES = \ + # List of distributed files generated by autotools or Makefile.devel. + GENERATED_FILES = \ + autoconf/aclocal.m4 configure config.h.in \ ++ include/libcharset.h.build.in \ + include/localcharset.h.build.in + # List of distributed files generated by "make". + DISTRIBUTED_BUILT_FILES = +diff --git a/libcharset/configure b/libcharset/configure +index cf4f9d2..8844aca 100755 +--- a/libcharset/configure ++++ b/libcharset/configure +@@ -12346,6 +12346,10 @@ ac_config_files="$ac_config_files Makefile" + + ac_config_files="$ac_config_files lib/Makefile" + ++ac_config_files="$ac_config_files include/libcharset.h:include/libcharset.h.build.in" ++ ++ac_config_files="$ac_config_files include/libcharset.h.inst:include/libcharset.h.in" ++ + ac_config_files="$ac_config_files include/localcharset.h:include/localcharset.h.build.in" + + ac_config_files="$ac_config_files include/localcharset.h.inst:include/localcharset.h.in" +@@ -13346,6 +13350,8 @@ do + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; ++ "include/libcharset.h") CONFIG_FILES="$CONFIG_FILES include/libcharset.h:include/libcharset.h.build.in" ;; ++ "include/libcharset.h.inst") CONFIG_FILES="$CONFIG_FILES include/libcharset.h.inst:include/libcharset.h.in" ;; + "include/localcharset.h") CONFIG_FILES="$CONFIG_FILES include/localcharset.h:include/localcharset.h.build.in" ;; + "include/localcharset.h.inst") CONFIG_FILES="$CONFIG_FILES include/localcharset.h.inst:include/localcharset.h.in" ;; + +diff --git a/libcharset/configure.ac b/libcharset/configure.ac +index 362bde3..a071d25 100644 +--- a/libcharset/configure.ac ++++ b/libcharset/configure.ac +@@ -60,6 +60,8 @@ AC_CHECK_FUNCS([setlocale]) + + AC_CONFIG_FILES([Makefile]) + AC_CONFIG_FILES([lib/Makefile]) ++AC_CONFIG_FILES([include/libcharset.h:include/libcharset.h.build.in]) ++AC_CONFIG_FILES([include/libcharset.h.inst:include/libcharset.h.in]) + AC_CONFIG_FILES([include/localcharset.h:include/localcharset.h.build.in]) + AC_CONFIG_FILES([include/localcharset.h.inst:include/localcharset.h.in]) + AC_OUTPUT +diff --git a/libcharset/include/libcharset.h.build.in b/libcharset/include/libcharset.h.build.in +new file mode 100644 +index 0000000..46e911a +--- /dev/null ++++ b/libcharset/include/libcharset.h.build.in +@@ -0,0 +1,53 @@ ++/* Copyright (C) 2003 Free Software Foundation, Inc. ++ This file is part of the GNU CHARSET Library. ++ ++ The GNU CHARSET Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2 of the ++ License, or (at your option) any later version. ++ ++ The GNU CHARSET Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with the GNU CHARSET Library; see the file COPYING.LIB. If not, ++ see . */ ++ ++#ifndef _LIBCHARSET_H ++#define _LIBCHARSET_H ++ ++#if @HAVE_VISIBILITY@ && BUILDING_LIBCHARSET ++#define LIBCHARSET_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBCHARSET ++#define LIBCHARSET_DLL_EXPORTED __declspec(dllexport) ++#else ++#define LIBCHARSET_DLL_EXPORTED ++#endif ++ ++#include ++ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++/* Support for relocatable packages. */ ++ ++/* Sets the original and the current installation prefix of the package. ++ Relocation simply replaces a pathname starting with the original prefix ++ by the corresponding pathname with the current prefix instead. Both ++ prefixes should be directory names without trailing slash (i.e. use "" ++ instead of "/"). */ ++extern LIBCHARSET_DLL_EXPORTED void libcharset_set_relocation_prefix (const char *orig_prefix, ++ const char *curr_prefix); ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ ++#endif /* _LIBCHARSET_H */ diff --git a/recipes/libiconv/all/test_package/CMakeLists.txt b/recipes/libiconv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..64fa90dede848 --- /dev/null +++ b/recipes/libiconv/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(Iconv REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Iconv::Iconv) diff --git a/recipes/libiconv/all/test_package/conanfile.py b/recipes/libiconv/all/test_package/conanfile.py new file mode 100644 index 0000000000000..12a4269e5efa4 --- /dev/null +++ b/recipes/libiconv/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libiconv/all/test_package/test_package.c b/recipes/libiconv/all/test_package/test_package.c new file mode 100644 index 0000000000000..2b5cf12485b6d --- /dev/null +++ b/recipes/libiconv/all/test_package/test_package.c @@ -0,0 +1,50 @@ +#include +#include +#include //for EXIT_FAILURE +#include + +#if _MSC_VER && _MSC_VER < 1600 +typedef unsigned __int32 uint32_t; +#else +#include +#endif + +#include "iconv.h" +#include "libcharset.h" + +int main() +{ + // Test libiconv + char in_bytes[4] = {'c', 'i', 'a', 'o'}; + char *in_buffer = (char *)&in_bytes; + size_t in_bytes_left = sizeof(char) * 4; + uint32_t ou_bytes[4] = {(uint32_t)-1, (uint32_t)-1, (uint32_t)-1, (uint32_t)-1}; + size_t ou_bytes_left = sizeof(uint32_t) * 4; + char *ou_buffer = (char *)&ou_bytes; + iconv_t context; + size_t rv; + + context = iconv_open("UCS-4-INTERNAL", "US-ASCII"); + if ((iconv_t)(-1) == context) + { + fprintf(stderr, "iconv_open failed\n"); + return EXIT_FAILURE; + } + + rv = iconv(context, &in_buffer, &in_bytes_left, &ou_buffer, &ou_bytes_left); + if ((size_t)(-1) == rv) + { + fprintf(stderr, "icon failed\n"); + return EXIT_FAILURE; + } + + printf("retval libiconv: %lu %u %u %u %u\n", rv, ou_bytes[0], ou_bytes[1], ou_bytes[2], ou_bytes[3]); + + iconv_close(context); + + // Test libcharset + setlocale(LC_ALL, ""); + printf("retval libcharset: %s\n", locale_charset()); + + return EXIT_SUCCESS; +} diff --git a/recipes/libiconv/all/test_v1_package/CMakeLists.txt b/recipes/libiconv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libiconv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libiconv/all/test_v1_package/conanfile.py b/recipes/libiconv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a831367c532bc --- /dev/null +++ b/recipes/libiconv/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/libiconv/config.yml b/recipes/libiconv/config.yml new file mode 100644 index 0000000000000..107f427ec4419 --- /dev/null +++ b/recipes/libiconv/config.yml @@ -0,0 +1,7 @@ +versions: + "1.17": + folder: all + "1.16": + folder: all + "1.15": + folder: all diff --git a/recipes/libid3tag/all/conandata.yml b/recipes/libid3tag/all/conandata.yml new file mode 100644 index 0000000000000..e1a2be66778cb --- /dev/null +++ b/recipes/libid3tag/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.15.1b": + url: "https://downloads.sourceforge.net/project/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz" + sha256: 63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151 diff --git a/recipes/libid3tag/all/conanfile.py b/recipes/libid3tag/all/conanfile.py new file mode 100644 index 0000000000000..ec346961d3ce4 --- /dev/null +++ b/recipes/libid3tag/all/conanfile.py @@ -0,0 +1,124 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild +from conans.errors import ConanInvalidConfiguration +import os +import shutil + +required_conan_version = ">=1.33.0" + + +class LibId3TagConan(ConanFile): + name = "libid3tag" + description = "ID3 tag manipulation library." + topics = ("conan", "mad", "id3", "MPEG", "audio", "decoder") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.underbit.com/products/mad/" + license = "GPL-2.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generator = "pkg_config", "visual_studio" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("zlib/1.2.11") + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" or ( + self.settings.compiler == "clang" and self.settings.os == "Windows" + ) + + def validate(self): + if self._is_msvc and self.options.shared: + raise ConanInvalidConfiguration("libid3tag does not support shared library for MSVC") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + if self._is_msvc: + self._build_msvc() + else: + self._build_autotools() + + def _build_msvc(self): + kwargs = {} + with tools.chdir(os.path.join(self._source_subfolder, "msvc++")): + # cl : Command line error D8016: '/ZI' and '/Gy-' command-line options are incompatible + tools.replace_in_file("libid3tag.dsp", "/ZI ", "") + if self.settings.compiler == "clang": + tools.replace_in_file("libid3tag.dsp", "CPP=cl.exe", "CPP=clang-cl.exe") + tools.replace_in_file("libid3tag.dsp", "RSC=rc.exe", "RSC=llvm-rc.exe") + kwargs["toolset"] = "ClangCl" + if self.settings.arch == "x86_64": + tools.replace_in_file("libid3tag.dsp", "Win32", "x64") + with tools.vcvars(self.settings): + self.run("devenv /Upgrade libid3tag.dsp") + msbuild = MSBuild(self) + msbuild.build(project_file="libid3tag.vcxproj", **kwargs) + + def _configure_autotools(self): + if not self._autotools: + if self.options.shared: + args = ["--disable-static", "--enable-shared"] + else: + args = ["--disable-shared", "--enable-static"] + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def _build_autotools(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")) + autotools = self._configure_autotools() + autotools.make() + + def _install_autotools(self): + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package(self): + self.copy("COPYRIGHT", dst="licenses", src=self._source_subfolder) + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + self.copy("CREDITS", dst="licenses", src=self._source_subfolder) + if self._is_msvc: + self.copy(pattern="*.lib", dst="lib", src=self._source_subfolder, keep_path=False) + self.copy(pattern="id3tag.h", dst="include", src=self._source_subfolder) + else: + self._install_autotools() + + def package_info(self): + self.cpp_info.libs = ["libid3tag" if self._is_msvc else "id3tag"] diff --git a/recipes/libid3tag/all/test_package/CMakeLists.txt b/recipes/libid3tag/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libid3tag/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libid3tag/all/test_package/conanfile.py b/recipes/libid3tag/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/libid3tag/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libid3tag/all/test_package/test_package.c b/recipes/libid3tag/all/test_package/test_package.c new file mode 100644 index 0000000000000..ef86650029180 --- /dev/null +++ b/recipes/libid3tag/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include + +#include + +int main() +{ + printf("id3tag version: %s\n", id3_version); + printf("id3tag copyright: %s\n", id3_copyright); + printf("id3tag author: %s\n", id3_author); + printf("id3tag build: %s\n", id3_build); + + struct id3_tag tag; + id3_tag_version(&tag); + + return 0; +} diff --git a/recipes/libid3tag/config.yml b/recipes/libid3tag/config.yml new file mode 100644 index 0000000000000..e7028aaa1acf5 --- /dev/null +++ b/recipes/libid3tag/config.yml @@ -0,0 +1,3 @@ +versions: + "0.15.1b": + folder: all diff --git a/recipes/libidn/all/conandata.yml b/recipes/libidn/all/conandata.yml new file mode 100644 index 0000000000000..8be8baf6f09f3 --- /dev/null +++ b/recipes/libidn/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.36": + url: "https://ftp.gnu.org/gnu/libidn/libidn-1.36.tar.gz" + sha256: "14b67108344d81ba844631640df77c9071d9fb0659b080326ff5424e86b14038" +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 new file mode 100644 index 0000000000000..6305a5795dac0 --- /dev/null +++ b/recipes/libidn/all/conanfile.py @@ -0,0 +1,142 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import contextlib +import functools +import os + +required_conan_version = ">=1.33.0" + + +class LibIdnConan(ConanFile): + name = "libidn" + 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") + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threads": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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 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.3") + + def source(self): + tools.get(**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 + + @functools.lru_cache(1) + def _configure_autotools(self): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + if not self.options.shared: + autotools.defines.append("LIBIDN_STATIC") + if self.settings.compiler == "Visual Studio": + if tools.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) + 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)), + "--enable-threads={}".format(yes_no(self.options.threads)), + "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + "--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 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"]) + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + 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")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package_info(self): + self.cpp_info.libs = ["idn"] + self.cpp_info.names["pkg_config"] = "libidn" + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.threads: + self.cpp_info.system_libs = ["pthread"] + if self.settings.os == "Windows": + if not self.options.shared: + self.cpp_info.defines = ["LIBIDN_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/libidn/all/patches/0001-unconditional-system-stdint-h.patch b/recipes/libidn/all/patches/0001-unconditional-system-stdint-h.patch new file mode 100644 index 0000000000000..80c98fc3182d7 --- /dev/null +++ b/recipes/libidn/all/patches/0001-unconditional-system-stdint-h.patch @@ -0,0 +1,19 @@ +--- lib/Makefile.in ++++ lib/Makefile.in +@@ -2000,11 +2000,11 @@ + + + idn-int.h: +- if test -n "$(STDINT_H)"; then \ +- sed -e s/include_next/include/ gl/stdint.h > idn-int.h; \ +- else \ +- echo '#include ' > idn-int.h; \ +- fi ++ # if test -n "$(STDINT_H)"; then \ ++ # sed -e s/include_next/include/ gl/stdint.h > idn-int.h; \ ++ # else ++ echo '#include ' > idn-int.h; ++ # fi + @HAVE_LD_OUTPUT_DEF_TRUE@libidn-$(DLL_VERSION).def: libidn.la + + #nfkc.c: gunibreak.h gunicomp.h gunidecomp.h diff --git a/recipes/libidn/all/test_package/CMakeLists.txt b/recipes/libidn/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libidn/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libidn/all/test_package/conanfile.py b/recipes/libidn/all/test_package/conanfile.py new file mode 100644 index 0000000000000..07c965844de9b --- /dev/null +++ b/recipes/libidn/all/test_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" + + 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/libidn/all/test_package/test_package.c b/recipes/libidn/all/test_package/test_package.c new file mode 100644 index 0000000000000..5ed5d8df80e06 --- /dev/null +++ b/recipes/libidn/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "stringprep.h" + +#include + +int main() +{ + printf("Locale charset: %s\n", stringprep_locale_charset()); + return 0; +} diff --git a/recipes/libidn/config.yml b/recipes/libidn/config.yml new file mode 100644 index 0000000000000..e1d88d0421678 --- /dev/null +++ b/recipes/libidn/config.yml @@ -0,0 +1,3 @@ +versions: + "1.36": + folder: "all" diff --git a/recipes/libidn2/all/conandata.yml b/recipes/libidn2/all/conandata.yml new file mode 100644 index 0000000000000..b710e69645f11 --- /dev/null +++ b/recipes/libidn2/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.3.0": + url: "https://ftp.gnu.org/gnu/libidn/libidn2-2.3.0.tar.gz" + sha256: "e1cb1db3d2e249a6a3eb6f0946777c2e892d5c5dc7bd91c74394fc3a01cab8b5" +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 new file mode 100644 index 0000000000000..0a83958ffe3fd --- /dev/null +++ b/recipes/libidn2/all/conanfile.py @@ -0,0 +1,131 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from contextlib import contextmanager +import os + +required_conan_version = ">=1.33.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") + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + settings = "os", "arch", "compiler", "build_type" + + _autotools = None + + @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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + if self.settings.compiler == "Visual Studio": + self.build_requires("automake/1.16.4") + + 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 + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + if 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)), + "--disable-nls", + "--disable-rpath", + ] + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + return self._autotools + + 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() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + + os.unlink(os.path.join(self.package_folder, "lib", "libidn2.la")) + + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["idn2"] + self.cpp_info.names["pkg_config"] = "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/patches/0001-no-versioning-of-symbols.patch b/recipes/libidn2/all/patches/0001-no-versioning-of-symbols.patch new file mode 100644 index 0000000000000..2f1edb0368035 --- /dev/null +++ b/recipes/libidn2/all/patches/0001-no-versioning-of-symbols.patch @@ -0,0 +1,22 @@ +--- lib/puny_decode.c ++++ lib/puny_decode.c +@@ -224,7 +224,7 @@ + + /* Create a compatibility symbol if supported. Hidden references make + the target symbol hidden, hence the alias. */ +-#ifdef HAVE_SYMVER_ALIAS_SUPPORT ++#if 0 //def HAVE_SYMVER_ALIAS_SUPPORT + __typeof__ (_idn2_punycode_decode_internal) _idn2_punycode_decode + __attribute__ ((visibility ("default"), + alias ("_idn2_punycode_decode_internal"))); +--- lib/puny_encode.c ++++ lib/puny_encode.c +@@ -225,7 +225,7 @@ + + /* Create a compatibility symbol if supported. Hidden references make + the target symbol hidden, hence the alias. */ +-#ifdef HAVE_SYMVER_ALIAS_SUPPORT ++#if 0 //def HAVE_SYMVER_ALIAS_SUPPORT + __typeof__ (_idn2_punycode_encode_internal) _idn2_punycode_encode + __attribute__ ((visibility ("default"), + alias ("_idn2_punycode_encode_internal"))); diff --git a/recipes/libidn2/all/test_package/CMakeLists.txt b/recipes/libidn2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libidn2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libidn2/all/test_package/conanfile.py b/recipes/libidn2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ae0c2ab3c933c --- /dev/null +++ b/recipes/libidn2/all/test_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" + + 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/libidn2/all/test_package/test_package.c b/recipes/libidn2/all/test_package/test_package.c new file mode 100644 index 0000000000000..5f5b4b1d9bef9 --- /dev/null +++ b/recipes/libidn2/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include "idn2.h" + +#include +#include + +int main() +{ + char *output = NULL; + int rc = idn2_to_ascii_lz("conan.io", &output, IDN2_TRANSITIONAL |IDN2_NFC_INPUT); + + printf("returned: %s\n", output); + printf("strerror: %s\n", idn2_strerror(rc)); + idn2_free(output); + + if (rc != IDN2_OK) { + return 1; + } + + return 0; +} diff --git a/recipes/libidn2/config.yml b/recipes/libidn2/config.yml new file mode 100644 index 0000000000000..33ababb05e322 --- /dev/null +++ b/recipes/libidn2/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.0": + folder: "all" diff --git a/recipes/libigl/2.x.x/CMakeLists.txt b/recipes/libigl/2.x.x/CMakeLists.txt new file mode 100644 index 0000000000000..64994fe16fd84 --- /dev/null +++ b/recipes/libigl/2.x.x/CMakeLists.txt @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000000..1ac5bf040c202 --- /dev/null +++ b/recipes/libigl/2.x.x/conandata.yml @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000000000..f5ac50b8841ac --- /dev/null +++ b/recipes/libigl/2.x.x/conanfile.py @@ -0,0 +1,140 @@ +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 new file mode 100644 index 0000000000000..6a5a6c38650c0 --- /dev/null +++ b/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000000000..174c1ae49d642 --- /dev/null +++ b/recipes/libigl/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +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/2.x.x/test_package/conanfile.py b/recipes/libigl/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..321eb52ae4077 --- /dev/null +++ b/recipes/libigl/2.x.x/test_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conans import ConanFile, CMake, tools + + +class LibiglTestConan(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", "example") + self.run(bin_path, run_environment=True) + diff --git a/recipes/libigl/2.x.x/test_package/example.cpp b/recipes/libigl/2.x.x/test_package/example.cpp new file mode 100644 index 0000000000000..c6ae0f0a33a39 --- /dev/null +++ b/recipes/libigl/2.x.x/test_package/example.cpp @@ -0,0 +1,31 @@ +// This test is not representative of all the library capabilities. +// It is extracted from the example 002[1] of the tutorial +// +// [1] https://github.com/libigl/libigl/blob/master/tutorial/202_GaussianCurvature/main.cpp +#include +#include +#include +#include + +int main() +{ + using namespace Eigen; + MatrixXd V(3, 3); + + V << 0, 0, 0, + 1, 1, 0, + -1, 1, 0; + + MatrixXi F(1, 3); + F << 0, 1, 2; + + // Compute integral of Gaussian curvature + VectorXd K; + igl::gaussian_curvature(V, F, K); + + // Compute mass matrix + SparseMatrix M, Minv; + igl::massmatrix(V, F, igl::MASSMATRIX_TYPE_DEFAULT, M); + + igl::invert_diag(M, Minv); +} diff --git a/recipes/libigl/config.yml b/recipes/libigl/config.yml new file mode 100644 index 0000000000000..58d1203871eb7 --- /dev/null +++ b/recipes/libigl/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.0": + folder: "2.x.x" diff --git a/recipes/libinterpolate/all/conandata.yml b/recipes/libinterpolate/all/conandata.yml new file mode 100644 index 0000000000000..04998351d32b8 --- /dev/null +++ b/recipes/libinterpolate/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "2.6.2": + url: + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.2.tar.gz" + sha256: "42f40c9b77fda6e0c52ed39b522458456e89fb4981d63f812aa158c6f4be8ab0" diff --git a/recipes/libinterpolate/all/conanfile.py b/recipes/libinterpolate/all/conanfile.py new file mode 100644 index 0000000000000..62e7baa6e4ea4 --- /dev/null +++ b/recipes/libinterpolate/all/conanfile.py @@ -0,0 +1,101 @@ +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 PackageConan(ConanFile): + name = "libinterpolate" + description = "A C++ interpolation library with a simple interface that supports multiple interpolation methods." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CD3/libInterpolate" + topics = ("math", "spline", "interpolation", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "19.0", + "gcc": "7", + "clang": "4", + "apple-clang": "10", + } + + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.80.0", transitive_headers=True) + self.requires("eigen/3.3.7", transitive_headers=True) + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libInterpolate currently only supports Linux. Upstream PR's are welcome (https://github.com/CD3/libInterpolate/issues/14).") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False + ) + if ( + minimum_version + and Version(self.settings.compiler.version) < minimum_version + ): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy( + self, + pattern="LICENSE.md", + 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, "src"), + ) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "libInterpolate") + self.cpp_info.set_property( + "cmake_target_name", "libInterpolate::Interpolate" + ) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libInterpolate" + self.cpp_info.filenames["cmake_find_package_multi"] = "libInterpolate" + self.cpp_info.names["cmake_find_package"] = "libInterpolate" + self.cpp_info.names["cmake_find_package_multi"] = "libInterpolate" + self.cpp_info.components["Interpolate"].names["cmake_find_package"] = "Interpolate" + self.cpp_info.components["Interpolate"].names["cmake_find_package_multi"] = "Interpolate" + self.cpp_info.components["Interpolate"].requires = ["eigen::eigen","boost::boost"] diff --git a/recipes/libinterpolate/all/test_package/CMakeLists.txt b/recipes/libinterpolate/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05a0c0e049e56 --- /dev/null +++ b/recipes/libinterpolate/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libInterpolate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libInterpolate::Interpolate) diff --git a/recipes/libinterpolate/all/test_package/conanfile.py b/recipes/libinterpolate/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/libinterpolate/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libinterpolate/all/test_package/test_package.cpp b/recipes/libinterpolate/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c42798ca5d0d0 --- /dev/null +++ b/recipes/libinterpolate/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include + +#include + +int main(void) +{ + std::vector x(2), y(2); + + x[0] = 0; + x[1] = 1; + y[0] = 10; + y[1] = 20; + + _1D::LinearInterpolator interp; + interp.setData(x, y); + + std::cout << "f(0.5) = " << interp(0.5) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/libinterpolate/all/test_v1_package/CMakeLists.txt b/recipes/libinterpolate/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5b37b01b534c --- /dev/null +++ b/recipes/libinterpolate/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) + diff --git a/recipes/libinterpolate/all/test_v1_package/conanfile.py b/recipes/libinterpolate/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/libinterpolate/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libinterpolate/config.yml b/recipes/libinterpolate/config.yml new file mode 100644 index 0000000000000..8296a371553be --- /dev/null +++ b/recipes/libinterpolate/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.2": + folder: all diff --git a/recipes/libipt/all/CMakeLists.txt b/recipes/libipt/all/CMakeLists.txt new file mode 100644 index 0000000000000..f62f6ae283c5f --- /dev/null +++ b/recipes/libipt/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/libipt/all/conandata.yml b/recipes/libipt/all/conandata.yml new file mode 100644 index 0000000000000..91a36f41590f6 --- /dev/null +++ b/recipes/libipt/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.5": + url: https://github.com/intel/libipt/archive/refs/tags/v2.0.5.tar.gz + sha256: 95acf499fdf0a0f5ebd07587bb443c702b1fd79f7d869749824234388b9bff80 diff --git a/recipes/libipt/all/conanfile.py b/recipes/libipt/all/conanfile.py new file mode 100644 index 0000000000000..73c8a14fe3622 --- /dev/null +++ b/recipes/libipt/all/conanfile.py @@ -0,0 +1,74 @@ +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + +class LibIptConan(ConanFile): + name = "libipt" + license = "BSD-3-Clause" + homepage = "https://github.com/intel/libipt" + url = "https://github.com/conan-io/conan-center-index" + description = "Intel(R) Processor Trace Decoder Library" + topics = ("profiling", "tracing") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + pass + + 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.configure() + return self._cmake + + 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 _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["libipt"] if self.settings.os == "Windows" else ["ipt"] + self.cpp_info.set_property("cmake_file_name", "libipt") + self.cpp_info.set_property("cmake_target_name", "libipt::libipt") + diff --git a/recipes/libipt/all/test_package/CMakeLists.txt b/recipes/libipt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..614fc23d88dda --- /dev/null +++ b/recipes/libipt/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libipt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(test_package PRIVATE cxx_std_11 cxx_constexpr) +target_link_libraries(${PROJECT_NAME} libipt::libipt) diff --git a/recipes/libipt/all/test_package/conanfile.py b/recipes/libipt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a8c92dea63335 --- /dev/null +++ b/recipes/libipt/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.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/libipt/all/test_package/test_package.cpp b/recipes/libipt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6b9e18b8eb133 --- /dev/null +++ b/recipes/libipt/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main(int argc, char **argv) +{ + pt_config cfg; + pt_config_init(&cfg); + + return 0; +} diff --git a/recipes/libipt/config.yml b/recipes/libipt/config.yml new file mode 100644 index 0000000000000..16ab573dd6bd3 --- /dev/null +++ b/recipes/libipt/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.5": + folder: all diff --git a/recipes/libjpeg-turbo/all/conandata.yml b/recipes/libjpeg-turbo/all/conandata.yml new file mode 100644 index 0000000000000..1821235633f65 --- /dev/null +++ b/recipes/libjpeg-turbo/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "2.1.5": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.5/libjpeg-turbo-2.1.5.tar.gz" + sha256: "bc12bc9dce55300c6bf4342bc233bcc26bd38bf289eedf147360d731c668ddaf" + "2.1.4": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.4/libjpeg-turbo-2.1.4.tar.gz" + sha256: "d3ed26a1131a13686dfca4935e520eb7c90ae76fbc45d98bb50a8dc86230342b" + "2.1.3": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.3/libjpeg-turbo-2.1.3.tar.gz" + sha256: "467b310903832b033fe56cd37720d1b73a6a3bd0171dbf6ff0b620385f4f76d0" + "2.1.2": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.2/libjpeg-turbo-2.1.2.tar.gz" + sha256: "09b96cb8cbff9ea556a9c2d173485fd19488844d55276ed4f42240e1e2073ce5" + "2.1.1": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.1/libjpeg-turbo-2.1.1.tar.gz" + sha256: "b76aaedefb71ba882cbad4e9275b30c2ae493e3195be0a099425b5c6b99bd510" + "2.1.0": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.0/libjpeg-turbo-2.1.0.tar.gz" + sha256: "bef89803e506f27715c5627b1e3219c95b80fc31465d4452de2a909d382e4444" + "2.0.6": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.0.6/libjpeg-turbo-2.0.6.tar.gz" + sha256: "d74b92ac33b0e3657123ddcf6728788c90dc84dcb6a52013d758af3c4af481bb" + "2.0.5": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.0.5/libjpeg-turbo-2.0.5.tar.gz" + sha256: "16f8f6f2715b3a38ab562a84357c793dd56ae9899ce130563c72cd93d8357b5d" diff --git a/recipes/libjpeg-turbo/all/conanfile.py b/recipes/libjpeg-turbo/all/conanfile.py new file mode 100644 index 0000000000000..afc30df36cff2 --- /dev/null +++ b/recipes/libjpeg-turbo/all/conanfile.py @@ -0,0 +1,174 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibjpegTurboConan(ConanFile): + name = "libjpeg-turbo" + description = "SIMD-accelerated libjpeg-compatible JPEG codec library" + license = "BSD-3-Clause, Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libjpeg-turbo.org" + topics = ("jpeg", "libjpeg", "image", "multimedia", "format", "graphics") + provides = "libjpeg" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "SIMD": [True, False], + "arithmetic_encoder": [True, False], + "arithmetic_decoder": [True, False], + "libjpeg7_compatibility": [True, False], + "libjpeg8_compatibility": [True, False], + "mem_src_dst": [True, False], + "turbojpeg": [True, False], + "java": [True, False], + "enable12bit": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "SIMD": True, + "arithmetic_encoder": True, + "arithmetic_decoder": True, + "libjpeg7_compatibility": True, + "libjpeg8_compatibility": True, + "mem_src_dst": True, + "turbojpeg": True, + "java": False, + "enable12bit": False, + } + + 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") + + if self.options.enable12bit: + del self.options.java + del self.options.turbojpeg + if self.options.enable12bit or self.settings.os == "Emscripten": + del self.options.SIMD + if self.options.enable12bit or self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility: + del self.options.arithmetic_encoder + del self.options.arithmetic_decoder + if self.options.libjpeg8_compatibility: + del self.options.mem_src_dst + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.enable12bit and (self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility): + raise ConanInvalidConfiguration("12-bit samples is not allowed with libjpeg v7/v8 API/ABI") + if self.options.get_safe("java") and not self.options.shared: + raise ConanInvalidConfiguration("java wrapper requires shared libjpeg-turbo") + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} shared can't be built with static vc runtime") + + def build_requirements(self): + if self.options.get_safe("SIMD") and self.settings.arch in ["x86", "x86_64"]: + self.tool_requires("nasm/2.15.05") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _is_arithmetic_encoding_enabled(self): + return self.options.get_safe("arithmetic_encoder", False) or \ + self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility + + @property + def _is_arithmetic_decoding_enabled(self): + return self.options.get_safe("arithmetic_decoder", False) or \ + self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.variables["WITH_SIMD"] = self.options.get_safe("SIMD", False) + tc.variables["WITH_ARITH_ENC"] = self._is_arithmetic_encoding_enabled + tc.variables["WITH_ARITH_DEC"] = self._is_arithmetic_decoding_enabled + tc.variables["WITH_JPEG7"] = self.options.libjpeg7_compatibility + tc.variables["WITH_JPEG8"] = self.options.libjpeg8_compatibility + tc.variables["WITH_MEM_SRCDST"] = self.options.get_safe("mem_src_dst", False) + tc.variables["WITH_TURBOJPEG"] = self.options.get_safe("turbojpeg", False) + tc.variables["WITH_JAVA"] = self.options.get_safe("java", False) + tc.variables["WITH_12BIT"] = self.options.enable12bit + if is_msvc(self): + tc.variables["WITH_CRT_DLL"] = True # avoid replacing /MD by /MT in compiler flags + if Version(self.version) <= "2.1.0": + tc.variables["CMAKE_MACOSX_BUNDLE"] = False # avoid configuration error if building for iOS/tvOS/watchOS + tc.generate() + + def _patch_sources(self): + # use standard GNUInstallDirs.cmake - custom one is broken + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "include(cmakescripts/GNUInstallDirs.cmake)", + "include(GNUInstallDirs)") + # do not override /MT by /MD if shared + replace_in_file(self, os.path.join(self.source_folder, "sharedlib", "CMakeLists.txt"), + """string(REGEX REPLACE "/MT" "/MD" ${var} "${${var}}")""", + "") + + 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() + # remove unneeded directories + 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")) + rmdir(self, os.path.join(self.package_folder, "doc")) + # remove binaries and pdb files + for pattern_to_remove in ["cjpeg*", "djpeg*", "jpegtran*", "tjbench*", "wrjpgcom*", "rdjpgcom*", "*.pdb"]: + rm(self, pattern_to_remove, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "JPEG") + self.cpp_info.set_property("cmake_file_name", "libjpeg-turbo") + + cmake_target_suffix = "-static" if not self.options.shared else "" + lib_suffix = "-static" if is_msvc(self) and not self.options.shared else "" + + self.cpp_info.components["jpeg"].set_property("cmake_module_target_name", "JPEG::JPEG") + self.cpp_info.components["jpeg"].set_property("cmake_target_name", f"libjpeg-turbo::jpeg{cmake_target_suffix}") + self.cpp_info.components["jpeg"].set_property("pkg_config_name", "libjpeg") + self.cpp_info.components["jpeg"].libs = [f"jpeg{lib_suffix}"] + + if self.options.get_safe("turbojpeg"): + self.cpp_info.components["turbojpeg"].set_property("cmake_target_name", f"libjpeg-turbo::turbojpeg{cmake_target_suffix}") + self.cpp_info.components["turbojpeg"].set_property("pkg_config_name", "libturbojpeg") + self.cpp_info.components["turbojpeg"].libs = [f"turbojpeg{lib_suffix}"] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "JPEG" + self.cpp_info.names["cmake_find_package_multi"] = "libjpeg-turbo" + self.cpp_info.components["jpeg"].names["cmake_find_package"] = "JPEG" + self.cpp_info.components["jpeg"].names["cmake_find_package_multi"] = f"jpeg{cmake_target_suffix}" + if self.options.get_safe("turbojpeg"): + self.cpp_info.components["turbojpeg"].names["cmake_find_package"] = f"turbojpeg{cmake_target_suffix}" + self.cpp_info.components["turbojpeg"].names["cmake_find_package_multi"] = f"turbojpeg{cmake_target_suffix}" diff --git a/recipes/libjpeg-turbo/all/test_package/CMakeLists.txt b/recipes/libjpeg-turbo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8715b08bc7f76 --- /dev/null +++ b/recipes/libjpeg-turbo/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(libjpeg-turbo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET libjpeg-turbo::jpeg) + target_link_libraries(${PROJECT_NAME} PRIVATE libjpeg-turbo::jpeg) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE libjpeg-turbo::jpeg-static) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libjpeg-turbo/all/test_package/conanfile.py b/recipes/libjpeg-turbo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fb5d85902cc52 --- /dev/null +++ b/recipes/libjpeg-turbo/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + img_name = os.path.join(self.source_folder, "testimg.jpg") + self.run(f"{bin_path} {img_name}", env="conanrun") diff --git a/recipes/libjpeg-turbo/all/test_package/test_package.c b/recipes/libjpeg-turbo/all/test_package/test_package.c new file mode 100644 index 0000000000000..2f94478d7ef6f --- /dev/null +++ b/recipes/libjpeg-turbo/all/test_package/test_package.c @@ -0,0 +1,528 @@ +/* + * 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 */ +} diff --git a/recipes/libjpeg-turbo/all/test_package/testimg.jpg b/recipes/libjpeg-turbo/all/test_package/testimg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a026e486f57de704ac5e9344ea20bb9973935e1d GIT binary patch literal 5764 zcm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HCiU;k(`fqL~0)y)sXNuOAcOOdaMy9szrD)dpo^jOJX ze`{-Q)Y7M#y@>Cx15fNAoKm*DU!qOnA%Hq_78*}dneqF*2)Ij~Id`!IFl7~2ekkO* zla40dld9b*KXTJCA!k4cq%}z@PDQ>P%spXBx1`7=dd~YF>&qLVuDLrqXKCe6^#k)t z=zNP|`_6;&QFNPb?LY1Mb4I_mEk)neVQ-4{-3lTT$W+gZi*Rn&Y}U7`8>WcIb{SI2+lxgCIV z#LoI!)vCcwAY=rGm#PNLCYN(l{{fmkq>*7_=!y3${CEIYB-E`ZwawbFOVpALhSXcu z#WwD-qnWG9-HPC1*y_<^@h)ERS4kad6dUIerZPoGvTmcn^q=X(YvMmT^;@&*v&mU8 zq3!lU{nLGOImt{XFcU{6^}L7Hvdc;0r5}6SG%Q!>R(h4(G$KpSzZ92TSAaRC2c0u+ z6O0+(4vG(M1?sbX?ej-hc77IUAzo~d{pC5O(%w&w&^okE47^IRnxy0%5KBd8$l7_o zYD?>u4IEW9RDjv))Zz>w5L1qF- +# ------------------------------------------------------------------------- +# +# 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 new file mode 100644 index 0000000000000..b147d8fb1dd7d --- /dev/null +++ b/recipes/libjpeg/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "9e": + url: "http://ijg.org/files/jpegsrc.v9e.tar.gz" + sha256: "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d" + "9d": + url: "http://ijg.org/files/jpegsrc.v9d.tar.gz" + sha256: "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a" + "9c": + url: "http://ijg.org/files/jpegsrc.v9c.tar.gz" + sha256: "682aee469c3ca857c4c38c37a6edadbfca4b04d42e56613b11590ec6aa4a278d" +patches: + "9e": + - patch_file: "patches/0001-9e-libjpeg-add-msvc-dll-support.patch" + patch_description: "Add support to generate DLL on Windows" + patch_type: "portability" + "9d": + - 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 new file mode 100644 index 0000000000000..dd93ec3f8004c --- /dev/null +++ b/recipes/libjpeg/all/conanfile.py @@ -0,0 +1,175 @@ +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 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 +import os +import re +import shutil + + +required_conan_version = ">=1.55.0" + + +class LibjpegConan(ConanFile): + name = "libjpeg" + description = "Libjpeg is a widely used C library for reading and writing JPEG image files." + url = "https://github.com/conan-io/conan-center-index" + topics = ("image", "format", "jpg", "jpeg", "picture", "multimedia", "graphics") + license = "IJG" + homepage = "http://ijg.org" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + @property + 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): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not (is_msvc(self) or self. _is_clang_cl): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self) 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) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(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() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "README", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self) or self._is_clang_cl: + for filename in ["jpeglib.h", "jerror.h", "jconfig.h", "jmorecfg.h"]: + copy(self, filename, src=self.source_folder, dst=os.path.join(self.package_folder, "include"), keep_path=False) + + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + if self.options.shared: + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + if self.settings.os == "Windows" and self.options.shared: + rm(self, "*[!.dll]", os.path.join(self.package_folder, "bin")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + 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) + + for fn in ("jpegint.h", "transupp.h",): + copy(self, fn, src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + for fn in ("jinclude.h", "transupp.c",): + copy(self, fn, src=self.source_folder, dst=os.path.join(self.package_folder, "res")) + + # Remove export decorations of transupp symbols + for relpath in os.path.join("include", "transupp.h"), os.path.join("res", "transupp.c"): + path = os.path.join(self.package_folder, relpath) + save(self, path, re.subn(r"(?:EXTERN|GLOBAL)\(([^)]+)\)", r"\1", load(self, path))[0]) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "JPEG") + self.cpp_info.set_property("cmake_target_name", "JPEG::JPEG") + self.cpp_info.set_property("pkg_config_name", "libjpeg") + prefix = "lib" if is_msvc(self) or self._is_clang_cl else "" + self.cpp_info.libs = [f"{prefix}jpeg"] + self.cpp_info.resdirs = ["res"] + if not self.options.shared: + self.cpp_info.defines.append("LIBJPEG_STATIC") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "JPEG" + self.cpp_info.names["cmake_find_package_multi"] = "JPEG" diff --git a/recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch b/recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch new file mode 100644 index 0000000000000..c3f634ab1ed84 --- /dev/null +++ b/recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch @@ -0,0 +1,92 @@ +--- 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. + +--- makefile.vc ++++ makefile.vc +@@ -30,6 +30,7 @@ + # miscellaneous OS-dependent stuff + # file deletion command + RM= del ++MKDIR=mkdir + + # End of configurable options. + +@@ -108,20 +109,30 @@ + $(cc) $(CFLAGS) $*.c + + +-all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe ++all: shared/libjpeg.lib static/libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +-libjpeg.lib: $(LIBOBJECTS) +- $(RM) libjpeg.lib +- lib -out:libjpeg.lib $(LIBOBJECTS) ++shared: ++ $(MKDIR) shared ++ ++static: ++ $(MKDIR) static ++ ++static/libjpeg.lib: $(LIBOBJECTS) static ++ $(RM) static\libjpeg.lib ++ lib -out:static/libjpeg.lib $(LIBOBJECTS) ++ ++shared/libjpeg.lib shared/libjpeg-9.dll: $(LIBOBJECTS) shared ++ $(RM) shared\libjpeg.lib shared\libjpeg-9.dll ++ link -DLL -out:shared/libjpeg-9.dll -implib:shared/libjpeg.lib $(LIBOBJECTS) + +-cjpeg.exe: $(COBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS) ++cjpeg.exe: $(COBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) static/libjpeg.lib $(LDLIBS) + +-djpeg.exe: $(DOBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS) ++djpeg.exe: $(DOBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) static/libjpeg.lib $(LDLIBS) + +-jpegtran.exe: $(TROBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS) ++jpegtran.exe: $(TROBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) static/libjpeg.lib $(LDLIBS) + + rdjpgcom.exe: rdjpgcom.obj + $(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS) +@@ -131,7 +142,7 @@ + + + clean: +- $(RM) *.obj *.exe libjpeg.lib ++ $(RM) *.obj *.exe static\libjpeg.lib shared\libjpeg.lib shared\libjpeg-9.dll + $(RM) testout* + + setup-vc6: diff --git a/recipes/libjpeg/all/patches/0001-libjpeg-add-msvc-dll-support.patch b/recipes/libjpeg/all/patches/0001-libjpeg-add-msvc-dll-support.patch new file mode 100644 index 0000000000000..ee3ef544a67c5 --- /dev/null +++ b/recipes/libjpeg/all/patches/0001-libjpeg-add-msvc-dll-support.patch @@ -0,0 +1,92 @@ +--- 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. + +--- makefile.vc ++++ makefile.vc +@@ -30,6 +30,7 @@ + # miscellaneous OS-dependent stuff + # file deletion command + RM= del ++MKDIR=mkdir + + # End of configurable options. + +@@ -105,20 +106,30 @@ + $(cc) $(CFLAGS) $*.c + + +-all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe ++all: shared/libjpeg.lib static/libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +-libjpeg.lib: $(LIBOBJECTS) +- $(RM) libjpeg.lib +- lib -out:libjpeg.lib $(LIBOBJECTS) ++shared: ++ $(MKDIR) shared ++ ++static: ++ $(MKDIR) static ++ ++static/libjpeg.lib: $(LIBOBJECTS) static ++ $(RM) static\libjpeg.lib ++ lib -out:static/libjpeg.lib $(LIBOBJECTS) ++ ++shared/libjpeg.lib shared/libjpeg-9.dll: $(LIBOBJECTS) shared ++ $(RM) shared\libjpeg.lib shared\libjpeg-9.dll ++ link -DLL -out:shared/libjpeg-9.dll -implib:shared/libjpeg.lib $(LIBOBJECTS) + +-cjpeg.exe: $(COBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS) ++cjpeg.exe: $(COBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) static/libjpeg.lib $(LDLIBS) + +-djpeg.exe: $(DOBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS) ++djpeg.exe: $(DOBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) static/libjpeg.lib $(LDLIBS) + +-jpegtran.exe: $(TROBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS) ++jpegtran.exe: $(TROBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) static/libjpeg.lib $(LDLIBS) + + rdjpgcom.exe: rdjpgcom.obj + $(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS) +@@ -128,7 +139,7 @@ + + + clean: +- $(RM) *.obj *.exe libjpeg.lib ++ $(RM) *.obj *.exe static\libjpeg.lib shared\libjpeg.lib shared\libjpeg-9.dll + $(RM) testout* + + setup-vc6: diff --git a/recipes/libjpeg/all/test_package/CMakeLists.txt b/recipes/libjpeg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7885c9011ac59 --- /dev/null +++ b/recipes/libjpeg/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(JPEG REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE JPEG::JPEG) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +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 new file mode 100644 index 0000000000000..0243933ba22dd --- /dev/null +++ b/recipes/libjpeg/all/test_package/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + 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() + cmake.build() + + 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") diff --git a/recipes/libjpeg/all/test_package/test_package.c b/recipes/libjpeg/all/test_package/test_package.c new file mode 100644 index 0000000000000..2f94478d7ef6f --- /dev/null +++ b/recipes/libjpeg/all/test_package/test_package.c @@ -0,0 +1,528 @@ +/* + * 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 */ +} diff --git a/recipes/libjpeg/all/test_package/test_transupp.c b/recipes/libjpeg/all/test_package/test_transupp.c new file mode 100644 index 0000000000000..188c5655a0762 --- /dev/null +++ b/recipes/libjpeg/all/test_package/test_transupp.c @@ -0,0 +1,96 @@ +#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 new file mode 100644 index 0000000000000000000000000000000000000000..a026e486f57de704ac5e9344ea20bb9973935e1d GIT binary patch literal 5764 zcmbW)XH*kRmjK{|fOM1+q<0V!iu7It={1x<0{9}GptML;LlnJ7?z4+%xAsGk@+}PG2qpu9+AZ8vuYn008)B050bM zdH|X$SE#R0(NI%U)6&w=F|aW*(9<(;vanudH_NTmw)5K_CiB5ET_A<)7@xKl=bmW-1mz z*;`jwVRxy80@>uEGs|d%bsM|E*5d~v@~%NoY3bOnb8vEriro;GfG8*`DXXZe>D|^h zFf=kYv9Yy-+dCkTZtfnQUfw<^^n>7#(6I1`nAm4=@d=4ZS=l+cdHDs;3tyF2U@EJs zvA8!)%`L5M?fADJdwL0d{R4wT#0k>m)R*a**`?(b^6J|9#^%=H(ecUY*|+aM&i`=% z0ib`g{;dCo{SO!O9~T8BC5V#x9~Y1!^v?t_Q&I`aUSYWfqrMx+DkK+8!={^A*4Rxe zEN^`Pb`2V*V;50a5l8+P z&|Jd&xqhlewzE;Ptp$mALApmGS*is~KNEX0PtwOZelDm7JCBX)ZDlT*ZTz9Hc;(XhfPQY}(U+!{BFx+N8LaMk}uNC4xz=i^*sB-F(Wbp|-LBoXNLwfk&e@cgV~q zHXHeL_6omt;H1IT?>4S);)HnTMm2Nl0q5t$^?0=Z&V`<@Ilpz;#2)(;w9-sZLeNnw zSCYO+ypA%o9S!0W5$03@q?ImNBjzMr-K}x)Yg)gb;^fVpRtR^uY;f2Kdwi(*uL0+2 z5NV3^K|>SzqR@z(0ex+yawiN78B;L4XWh=ZAm)1hq zI#-{=d+^x%<)gi*E&;N}VlyA6`qDJ%l4e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RZBxJE(D+_ovu6Xl&HMD!m2~8ormyuu zx(qe8wsjk+d#2IpYJ&Mp^pRksj7EwCwhF3LNJ^yiPN41FZpb3A!uL!{VYjH_0Ov5q z&h(q=7Lx*vCu}>WnVsz*F`N_XW>1FQU%bHe!cQHfS+fd+?PkeZ)9^ZWu#Qc=h$HFZ z_fCk+`|1hRWBC}n;*iz+G8{R^+E4)G`vA9U>Xv>#n!_t;UqMx4PG97JDu5|YY5qe< zhm_co)B^$X#f}O%H|$u77JHCiU;k(`fqL~0)y)sXNuOAcOOdaMy9szrD)dpo^jOJX ze`{-Q)Y7M#y@>Cx15fNAoKm*DU!qOnA%Hq_78*}dneqF*2)Ij~Id`!IFl7~2ekkO* zla40dld9b*KXTJCA!k4cq%}z@PDQ>P%spXBx1`7=dd~YF>&qLVuDLrqXKCe6^#k)t z=zNP|`_6;&QFNPb?LY1Mb4I_mEk)neVQ-4{-3lTT$W+gZi*Rn&Y}U7`8>WcIb{SI2+lxgCIV z#LoI!)vCcwAY=rGm#PNLCYN(l{{fmkq>*7_=!y3${CEIYB-E`ZwawbFOVpALhSXcu z#WwD-qnWG9-HPC1*y_<^@h)ERS4kad6dUIerZPoGvTmcn^q=X(YvMmT^;@&*v&mU8 zq3!lU{nLGOImt{XFcU{6^}L7Hvdc;0r5}6SG%Q!>R(h4(G$KpSzZ92TSAaRC2c0u+ z6O0+(4vG(M1?sbX?ej-hc77IUAzo~d{pC5O(%w&w&^okE47^IRnxy0%5KBd8$l7_o zYD?>u4IEW9RDjv))Zz>w5L1qF- +- $ + ) + 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 new file mode 100644 index 0000000000000..b4ff403da499f --- /dev/null +++ b/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch @@ -0,0 +1,126 @@ +--- 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 new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libjxl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libjxl/all/test_package/conanfile.py b/recipes/libjxl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..138d4f5333429 --- /dev/null +++ b/recipes/libjxl/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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") + img_path = os.path.join(self.source_folder, "test.jxl") + self.run(bin_path + " " + img_path, run_environment=True) diff --git a/recipes/libjxl/all/test_package/test.jxl b/recipes/libjxl/all/test_package/test.jxl new file mode 100644 index 0000000000000000000000000000000000000000..a0f419a98a426a0a8b0d8fe30023d7824b7865e2 GIT binary patch literal 21274 zcmV(*K;FOq3J3^xgM`YxRTKdL5{Lo-1QYc_+c}MaN*KZ+RSy6Fs8E@)F-m*0sQ^yj z$0vZAstN!A002CIe}xptvqi~tR1B(Oj4?8D2rvME6GZnP9RQfW9CMIPo8PSJPsJf1 zMaocV;cl2GqX^KABalY2i)P=XprD|jprD{&<+p8HwUQ*Yt=qPej`?$Dgia#~php1J z#o)|YTL8dyOOfP}GZ{b5PYn7PjF<346D!@e+qRM zUo#v4nR3-8xQ*}KU~|9$DM@4{{DDc}4dKqNKtnf}-W1C_`sTnXNpbn*bjx z(Gg1j^AN`E!0`Y=Wrl)Pnw(3&@@F6o3pu%5Utl|@T^rzd=$>7%>e-y+236O%qegWO z${phF2C>IN{yBb^YR;GR;h2F2A-T2QfY{hh21AEcS)dE-c7mKC?x9kwzlUVr*P)Sr zPN<))*NbT6o%J#jNHeqt9~h4YM^!U;uw2Zn;w9(gRPF!Sfakl_*e>y$ny)Qy=eRT{ zF1{qSyktcmt}#(?k(v6FNyCK)xD2+Iw=H+FR{yc4fWOhT-wSsAa;^j~{GT*DHchVl zWg^?9Xe4-WX0WitqVe{btjqpX+`sZ)RG%Xv(V* z{w1ap2@pq$knb2Kgd?R-q;R8yUdVMUB4=;YUN8jUaYhP|v9l{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~$~*ERvZg|(APpIghRS$R*wqOPj*w$HdHW^&s^51O@j z^f#IQ{CCdMl4C(`7F<4gPIt@A--FUDE=f74g@S)Z#?Yna5E55jU>wwXQ40E2?Y ztE+fczvlx&0~omr02gc^4lk6jSy+uWHGss zvm~^js0R!-K7N~)bgk5l=vCiVbVU3DD2;|Z=^%UgT1>&|_(Cb#j-mt<6XSgsE~r$! z_Z=DY%J6t4B0K=2>}l_|Ovffl+4&>hmKr1hLm{ZlC~~2ZrHKJRuo?lE>5ZxdRXKRJ zzg?Lq!_JeZO{4- +#include + +#include "jxl/decode.h" +#include "jxl/thread_parallel_runner.h" + +static int ReadFile(const char filename[], uint8_t *data[], size_t *size) +{ + 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; +} diff --git a/recipes/libjxl/config.yml b/recipes/libjxl/config.yml new file mode 100644 index 0000000000000..c79a1af3be31f --- /dev/null +++ b/recipes/libjxl/config.yml @@ -0,0 +1,5 @@ +versions: + "0.5.0": + folder: all + "0.6.1": + folder: all diff --git a/recipes/libkml/all/conandata.yml b/recipes/libkml/all/conandata.yml new file mode 100644 index 0000000000000..deea781fb42fe --- /dev/null +++ b/recipes/libkml/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.3.0": + url: "https://github.com/libkml/libkml/archive/1.3.0.zip" + sha256: "ac2a61b4bca105cbed9ad8d0d6d5536dc7c2a11abcecf86431d023e2f3ae96db" +patches: + "1.3.0": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-fix-for-mingw-and-empty-literal-for-vc.patch" + - patch_file: "patches/0003-export-extern-symbols-for-msvc.patch" + - patch_file: "patches/0004-minizip-no-crypt-header.patch" diff --git a/recipes/libkml/all/conanfile.py b/recipes/libkml/all/conanfile.py new file mode 100644 index 0000000000000..1b2a9bb8fba8b --- /dev/null +++ b/recipes/libkml/all/conanfile.py @@ -0,0 +1,152 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class LibkmlConan(ConanFile): + name = "libkml" + description = "Reference implementation of OGC KML 2.2" + license = "BSD-3-Clause" + topics = ("kml", "ogc", "geospatial") + homepage = "https://github.com/libkml/libkml" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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.81.0", transitive_headers=True) + self.requires("expat/2.5.0") + self.requires("minizip/1.2.13") + self.requires("uriparser/0.9.7") + self.requires("zlib/1.2.13") + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "kmlbase": "LibKML::kmlbase", + "kmlxsd": "LibKML::kmlxsd", + "kmldom": "LibKML::kmldom", + "kmlengine": "LibKML::kmlengine", + "kmlconvenience": "LibKML::kmlconvenience", + "kmlregionator": "LibKML::kmlregionator", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LibKML") + self.cpp_info.set_property("pkg_config_name", "libkml") + + self.cpp_info.names["cmake_find_package"] = "LibKML" + self.cpp_info.names["cmake_find_package_multi"] = "LibKML" + + self._register_components({ + "kmlbase": { + "defines": ["LIBKML_DLL"] if self.settings.os == "Windows" and self.options.shared else [], + "system_libs": ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [], + "requires": ["boost::headers", "expat::expat", "minizip::minizip", + "uriparser::uriparser", "zlib::zlib"], + }, + "kmlxsd": { + "requires": ["boost::headers", "kmlbase"], + }, + "kmldom": { + "requires": ["boost::headers", "kmlbase"], + }, + "kmlengine": { + "system_libs": ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [], + "requires": ["boost::headers", "kmldom", "kmlbase"], + }, + "kmlconvenience": { + "requires": ["boost::headers", "kmlengine", "kmldom", "kmlbase"], + }, + "kmlregionator": { + "requires": ["kmlconvenience", "kmlengine", "kmldom", "kmlbase"], + }, + }) + + def _register_components(self, components): + for comp_cmake_lib_name, values in components.items(): + defines = values.get("defines", []) + system_libs = values.get("system_libs", []) + requires = values.get("requires", []) + self.cpp_info.components[comp_cmake_lib_name].set_property("cmake_target_name", comp_cmake_lib_name) + self.cpp_info.components[comp_cmake_lib_name].names["cmake_find_package"] = comp_cmake_lib_name + self.cpp_info.components[comp_cmake_lib_name].names["cmake_find_package_multi"] = comp_cmake_lib_name + self.cpp_info.components[comp_cmake_lib_name].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[comp_cmake_lib_name].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components[comp_cmake_lib_name].libs = [comp_cmake_lib_name] + self.cpp_info.components[comp_cmake_lib_name].defines = defines + self.cpp_info.components[comp_cmake_lib_name].system_libs = system_libs + self.cpp_info.components[comp_cmake_lib_name].requires = requires diff --git a/recipes/libkml/all/patches/0001-fix-cmake.patch b/recipes/libkml/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..e7ab69a15ddc3 --- /dev/null +++ b/recipes/libkml/all/patches/0001-fix-cmake.patch @@ -0,0 +1,69 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,7 +30,6 @@ set(TEST_FLAGS "-Wall -Wextra -Wno-unused-parameter -fno-rtti -DGTEST_HAS_RTTI=0 + else() + if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DUNICODE /D_UNICODE") +- set(BUILD_SHARED_LIBS OFF) + endif() + endif() + +@@ -93,7 +92,7 @@ set(MINIZIP_DEPENDS "" CACHE INTERNAL "MINIZIP_DEPENDS") + + set(LIBKML_TARGETS) + +-find_package(EXPAT) ++find_package(EXPAT REQUIRED MODULE) + if(EXPAT_FOUND) + include_directories(${EXPAT_INCLUDE_DIR}) + else() +@@ -110,16 +109,16 @@ else() + list(APPEND MINIZIP_DEPENDS ZLIB) + endif() + +-find_package(MiniZip) +-if(MINIZIP_FOUND) ++find_package(minizip REQUIRED CONFIG) ++if(minizip_FOUND) + include_directories(${MINIZIP_INCLUDE_DIR}) + else() + include(External_minizip) + list(APPEND KMLBASE_DEPENDS MINIZIP) + endif() + +-find_package(UriParser) +-if(URIPARSER_FOUND) ++find_package(uriparser REQUIRED CONFIG) ++if(uriparser_FOUND) + include_directories(${URIPARSER_INCLUDE_DIR}) + else() + include(External_uriparser) +@@ -149,10 +148,11 @@ if(WITH_SWIG) + endif() + endif() + +-list(APPEND KMLBASE_LINK_LIBS ${EXPAT_LIBRARY}) +-list(APPEND KMLBASE_LINK_LIBS ${ZLIB_LIBRARY}) +-list(APPEND KMLBASE_LINK_LIBS ${MINIZIP_LIBRARY}) +-list(APPEND KMLBASE_LINK_LIBS ${URIPARSER_LIBRARY}) ++list(APPEND KMLBASE_LINK_LIBS Boost::headers) ++list(APPEND KMLBASE_LINK_LIBS EXPAT::EXPAT) ++list(APPEND KMLBASE_LINK_LIBS ZLIB::ZLIB) ++list(APPEND KMLBASE_LINK_LIBS minizip::minizip) ++list(APPEND KMLBASE_LINK_LIBS uriparser::uriparser) + + include_directories(${CMAKE_SOURCE_DIR}/src) + +diff --git a/src/kml/base/CMakeLists.txt b/src/kml/base/CMakeLists.txt +index dc3e9c4..895930b 100644 +--- a/src/kml/base/CMakeLists.txt ++++ b/src/kml/base/CMakeLists.txt +@@ -3,7 +3,7 @@ if(HAVE_SYSTEM_EXPAT) + include_directories(${EXPAT_INCLUDE_DIR}) + endif() + +-list(APPEND KMLBASE_LINK_LIBS ${EXPAT_LIBRARY}) ++list(APPEND KMLBASE_LINK_LIBS EXPAT::EXPAT) + + file(GLOB SRCS "*.cc" + contrib/minizip/unzip.c diff --git a/recipes/libkml/all/patches/0002-fix-for-mingw-and-empty-literal-for-vc.patch b/recipes/libkml/all/patches/0002-fix-for-mingw-and-empty-literal-for-vc.patch new file mode 100644 index 0000000000000..c1a6e3f7b53bf --- /dev/null +++ b/recipes/libkml/all/patches/0002-fix-for-mingw-and-empty-literal-for-vc.patch @@ -0,0 +1,67 @@ +--- a/src/kml/base/file_win32.cc ++++ b/src/kml/base/file_win32.cc +@@ -34,15 +34,18 @@ + #include "kml/base/file.h" + #include + #include ++#ifndef __MINGW32__ + #include ++#endif + #include + + namespace kmlbase { + ++#ifndef __MINGW32__ + // Internal to the win32 file class. We need a conversion from string to + // LPCWSTR. + static std::wstring Str2Wstr(const string& str) { +- std::wstring wstr(str.length(), L''); ++ std::wstring wstr(str.length(), L' '); // fix for msvc: empty literal + std::copy(str.begin(), str.end(), wstr.begin()); + return wstr; + } +@@ -56,13 +59,18 @@ string Wstr2Str(const std::wstring& wstr) { + static_cast(s), NULL, NULL); + return str; + } ++#endif + + bool File::Exists(const string& full_path) { + if (full_path.empty()) { + return false; + } ++#ifndef __MINGW32__ + std::wstring wstr = Str2Wstr(full_path); + DWORD attrs = ::GetFileAttributes(wstr.c_str()); ++#else ++ DWORD attrs = ::GetFileAttributes(full_path.c_str()); ++#endif + return (attrs != INVALID_FILE_ATTRIBUTES) && + ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0); + } +@@ -71,8 +79,12 @@ bool File::Delete(const string& filepath) { + if (filepath.empty()) { + return false; + } ++#ifndef __MINGW32__ + std::wstring wstr = Str2Wstr(filepath); + return ::DeleteFile(wstr.c_str()) ? true : false; ++#else ++ return ::DeleteFile(filepath.c_str()) ? true : false; ++#endif + } + + static const unsigned int BUFSIZE = 1024; +@@ -97,8 +109,12 @@ bool File::CreateNewTempFile(string* path) { + if (uRetVal == 0) { + return false; + } ++#ifndef __MINGW32__ + string str = Wstr2Str(szTempName); + path->assign(str.c_str(), strlen(str.c_str())); ++#else ++ path->assign(szTempName, strlen(szTempName)); ++#endif + return true; + } + diff --git a/recipes/libkml/all/patches/0003-export-extern-symbols-for-msvc.patch b/recipes/libkml/all/patches/0003-export-extern-symbols-for-msvc.patch new file mode 100644 index 0000000000000..2ee7de8a9f3dd --- /dev/null +++ b/recipes/libkml/all/patches/0003-export-extern-symbols-for-msvc.patch @@ -0,0 +1,61 @@ +--- a/src/kml/base/CMakeLists.txt ++++ b/src/kml/base/CMakeLists.txt +@@ -49,3 +49,7 @@ build_target( + INCS ${INCS} + DEPENDS ${KMLBASE_DEPENDS} + LINKS ${KMLBASE_LINK_LIBS} ) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(kmlbase PUBLIC "LIBKML_DLL") ++endif() +--- a/src/kml/base/mimetypes.cc ++++ b/src/kml/base/mimetypes.cc +@@ -25,14 +25,15 @@ + + // This defines some common KML-related mimetype strings. + ++#define KML_BASE_MIMETYPE_EXPORTS + #include "kml/base/mimetypes.h" + + namespace kmlbase { + +-const char* kAtomMimeType = "application/atom+xml"; +-const char* kCsvMimeType = "text/csv"; +-const char* kKmlMimeType = "application/vnd.google-earth.kml+xml"; +-const char* kKmzMimeType = "application/vnd.google-earth.kmz"; ++KML_BASE_MIMETYPE_API const char* kAtomMimeType = "application/atom+xml"; ++KML_BASE_MIMETYPE_API const char* kCsvMimeType = "text/csv"; ++KML_BASE_MIMETYPE_API const char* kKmlMimeType = "application/vnd.google-earth.kml+xml"; ++KML_BASE_MIMETYPE_API const char* kKmzMimeType = "application/vnd.google-earth.kmz"; + + } + +--- a/src/kml/base/mimetypes.h ++++ b/src/kml/base/mimetypes.h +@@ -28,12 +28,22 @@ + #ifndef KML_BASE_MIMETYPES_H__ + #define KML_BASE_MIMETYPES_H__ + ++#if defined(_MSC_VER) && defined(LIBKML_DLL) ++ #ifdef KML_BASE_MIMETYPE_EXPORTS ++ #define KML_BASE_MIMETYPE_API __declspec(dllexport) ++ #else ++ #define KML_BASE_MIMETYPE_API __declspec(dllimport) ++ #endif ++#else ++ #define KML_BASE_MIMETYPE_API ++#endif ++ + namespace kmlbase { + +-extern const char* kAtomMimeType; +-extern const char* kCsvMimeType; +-extern const char* kKmlMimeType; +-extern const char* kKmzMimeType; ++KML_BASE_MIMETYPE_API extern const char* kAtomMimeType; ++KML_BASE_MIMETYPE_API extern const char* kCsvMimeType; ++KML_BASE_MIMETYPE_API extern const char* kKmlMimeType; ++KML_BASE_MIMETYPE_API extern const char* kKmzMimeType; + + } // end namespace kmlbase + diff --git a/recipes/libkml/all/patches/0004-minizip-no-crypt-header.patch b/recipes/libkml/all/patches/0004-minizip-no-crypt-header.patch new file mode 100644 index 0000000000000..cad69c9937c61 --- /dev/null +++ b/recipes/libkml/all/patches/0004-minizip-no-crypt-header.patch @@ -0,0 +1,16 @@ +Do not include crypt.h from minizip as it is not packaged in minizip recipe +Taken from https://github.com/libkml/libkml/commit/a03adc24bc8cf5ab76a0e65f2756172a72c28b7a + +--- a/src/kml/base/contrib/minizip/unzip.c ++++ b/src/kml/base/contrib/minizip/unzip.c +@@ -42,7 +42,9 @@ woven in by Terry Thorsen 1/2003. + #include //RR + #include "unzip.h" + #include "iomem_simple.h" +-#undef NOUNCRYPT ++#ifndef NOUNCRYPT ++#define NOUNCRYPT ++#endif + + #ifdef STDC + # include diff --git a/recipes/libkml/all/test_package/CMakeLists.txt b/recipes/libkml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c68b8c6d04753 --- /dev/null +++ b/recipes/libkml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(LibKML REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE kmlbase kmlconvenience kmldom kmlengine) diff --git a/recipes/libkml/all/test_package/conanfile.py b/recipes/libkml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libkml/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libkml/all/test_package/test_package.cpp b/recipes/libkml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d3f387d5e67c4 --- /dev/null +++ b/recipes/libkml/all/test_package/test_package.cpp @@ -0,0 +1,98 @@ +#include +#include + +#include +#include +#include +#include + +void test_kmlbase() { + double lat_from = 23.27; + double lng_from = 47.05; + double alt_from = 10.07; + double lat_to = -17.80; + double lng_to = 174.41; + double alt_to = 89.24; + + std::cout << "#=======================================#\n"; + std::cout << "# test_kmlbase #\n"; + std::cout << "#=======================================#\n"; + std::cout << kmlbase::AzimuthBetweenPoints(lat_from, lng_from, lat_to, lng_to) << '\n'; + std::cout << kmlbase::DistanceBetweenPoints(lat_from, lng_from, lat_to, lng_to) << '\n'; + std::cout << kmlbase::DistanceBetweenPoints3d(lat_from, lng_from, alt_from, lat_to, lng_to, alt_to) << '\n'; +} + +kmldom::PointPtr createPointCoordinates(double lat, double lon) { + kmldom::KmlFactory *kml_factory = kmldom::KmlFactory::GetFactory(); + kmldom::PointPtr point = kml_factory->CreatePoint(); + kmldom::CoordinatesPtr coordinates = kmldom::KmlFactory::GetFactory()->CreateCoordinates(); + coordinates->add_latlng(lat, lon); + point->set_coordinates(coordinates); + return point; +} + +void test_kmlengine() { + const double kLat = -22.22; + const double kLon = 42.123; + + kmldom::PointPtr point = createPointCoordinates(kLat, kLon); + double pointLat, pointLon; + kmlengine::GetPointLatLon(point, &pointLat, &pointLon); + + kmldom::KmlFactory *factory = kmldom::KmlFactory::GetFactory(); + kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); + placemark->set_geometry(point); + double placemarkLat, placemarkLon; + bool resultPlacemark = kmlengine::GetFeatureLatLon(placemark, &placemarkLat, &placemarkLon); + + std::cout << "#=======================================#\n"; + std::cout << "# test_kmlengine #\n"; + std::cout << "#=======================================#\n"; + std::cout << "Input (Latitude, Longitude)=(" << kLat << ", " << kLon << ")\n"; + std::cout << "Created Point at (Latitude, Longitude)=(" << pointLat << ", " << pointLon << ")\n"; + std::cout << "Created Placemark at (Latitude, Longitude)=(" << placemarkLat << ", " << placemarkLon << ")\n"; +} + +void test_kmlconvenience() { + kmldom::KmlFactory* kml_factory = kmldom::KmlFactory::GetFactory(); + kmldom::FolderPtr folder = kml_factory->CreateFolder(); + folder->set_id("f0"); + folder->set_name("Folder 0"); + kmldom::PlacemarkPtr placemark = kml_factory->CreatePlacemark(); + placemark->set_id("pm0"); + placemark->set_name("Placemark 0"); + folder->add_feature(placemark); + placemark = kml_factory->CreatePlacemark(); + placemark->set_id("pm1"); + placemark->set_name("Placemark 1"); + folder->add_feature(placemark); + kmldom::KmlPtr kml = kml_factory->CreateKml(); + kml->set_feature(folder); + + kmlengine::KmlFilePtr kml_file = kmlengine::KmlFile::CreateFromImport(kml); + + kmldom::ChangePtr change = kml_factory->CreateChange(); + placemark = kmlconvenience::CreatePointPlacemark("new name", 38, -120); + placemark->set_targetid("pm0"); + change->add_object(placemark); + kmldom::UpdatePtr update = kml_factory->CreateUpdate(); + update->add_updateoperation(change); + + kmlengine::ProcessUpdate(update, kml_file); + + std::string xml; + kml_file->SerializeToString(&xml); + + std::cout << "#=======================================#\n"; + std::cout << "# test_kmlconvenience #\n"; + std::cout << "#=======================================#\n"; + std::cout << xml << std::endl; +} + +int main() { + test_kmlbase(); + test_kmlengine(); + test_kmlconvenience(); + + return 0; +} diff --git a/recipes/libkml/all/test_v1_package/CMakeLists.txt b/recipes/libkml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libkml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libkml/all/test_v1_package/conanfile.py b/recipes/libkml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libkml/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/libkml/config.yml b/recipes/libkml/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/libkml/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/liblsl/all/CMakeLists.txt b/recipes/liblsl/all/CMakeLists.txt new file mode 100644 index 0000000000000..79a17945e58b4 --- /dev/null +++ b/recipes/liblsl/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/liblsl/all/conandata.yml b/recipes/liblsl/all/conandata.yml new file mode 100644 index 0000000000000..2cf8655a17765 --- /dev/null +++ b/recipes/liblsl/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.16.1": + url: "https://github.com/sccn/liblsl/archive/refs/tags/v1.16.1.tar.gz" + sha256: "7410620c26f8e86ae431e7476bf685918e180bd676982a7f7a7817299c8707c5" + "1.16.0": + url: "https://github.com/sccn/liblsl/archive/refs/tags/v1.16.0.tar.gz" + sha256: "57d9ab0451d6d1a2068f45e4609c67d52c9c0c76d06c07e625034bea4bc01720" diff --git a/recipes/liblsl/all/conanfile.py b/recipes/liblsl/all/conanfile.py new file mode 100644 index 0000000000000..706061d8712ff --- /dev/null +++ b/recipes/liblsl/all/conanfile.py @@ -0,0 +1,129 @@ +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, rm, rmdir, replace_in_file +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LiblslConan(ConanFile): + name = "liblsl" + description = "Lab Streaming Layer is a C++ library for multi-modal " \ + "time-synched data transmission over the local network" + license = "MIT" + topics = ("labstreaminglayer", "lsl", "network", "stream", "signal", + "transmission") + homepage = "https://github.com/sccn/liblsl" + 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 _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "3.5", + "apple-clang": "10", + } + + def requirements(self): + self.requires("boost/1.81.0") + self.requires("pugixml/1.13") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LSL_BUILD_STATIC"] = not self.options.shared + tc.variables["LSL_BUNDLED_BOOST"] = False + tc.variables["LSL_BUNDLED_PUGIXML"] = False + tc.variables["lslgitrevision"] = "v" + self.version + tc.variables["lslgitbranch"] = "master" + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + if not self.options.shared: + # Do not force PIC + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", + "" + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + rm(self, "lslver*", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LSL") + self.cpp_info.set_property("cmake_target_name", "LSL::lsl") + # TODO: back to global scope in conan v2 + self.cpp_info.components["_liblsl"].requires = ["boost::boost", "pugixml::pugixml"] + self.cpp_info.components["_liblsl"].libs = ["lsl"] + self.cpp_info.components["_liblsl"].defines = ["LSLNOAUTOLINK"] + if not self.options.shared: + self.cpp_info.components["_liblsl"].defines.append("LIBLSL_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_liblsl"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["_liblsl"].system_libs = ["iphlpapi", "winmm", "mswsock", "ws2_32"] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "LSL" + self.cpp_info.names["cmake_find_package_multi"] = "LSL" + self.cpp_info.components["_liblsl"].names["cmake_find_package"] = "lsl" + self.cpp_info.components["_liblsl"].names["cmake_find_package_multi"] = "lsl" + self.cpp_info.components["_liblsl"].set_property("cmake_target_name", "LSL::lsl") diff --git a/recipes/liblsl/all/test_package/CMakeLists.txt b/recipes/liblsl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0ebdf94800cf2 --- /dev/null +++ b/recipes/liblsl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(LSL CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LSL::lsl) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/liblsl/all/test_package/conanfile.py b/recipes/liblsl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/liblsl/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/liblsl/all/test_package/test_package.cpp b/recipes/liblsl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f4dbc97bfb2c0 --- /dev/null +++ b/recipes/liblsl/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include "lsl_cpp.h" + +#include +#include + +int main() { + std::cout << "Resolving streams..." << std::endl; + std::vector streams = lsl::resolve_streams(); + std::cout << streams.size() << " streams found:" << std::endl; + for (auto &stream : streams) { + std::cout << stream.as_xml() << std::endl; + } + return 0; +} diff --git a/recipes/liblsl/all/test_v1_package/CMakeLists.txt b/recipes/liblsl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/liblsl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/liblsl/all/test_v1_package/conanfile.py b/recipes/liblsl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/liblsl/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/liblsl/config.yml b/recipes/liblsl/config.yml new file mode 100644 index 0000000000000..eb92f3dd2dc5e --- /dev/null +++ b/recipes/liblsl/config.yml @@ -0,0 +1,5 @@ +versions: + "1.16.1": + folder: all + "1.16.0": + folder: all diff --git a/recipes/libltc/all/conandata.yml b/recipes/libltc/all/conandata.yml new file mode 100644 index 0000000000000..c5fe4d5f5d812 --- /dev/null +++ b/recipes/libltc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.3.2": + url: "https://github.com/x42/libltc/releases/download/v1.3.2/libltc-1.3.2.tar.gz" + sha256: "0a6d42cd6c21e925a27fa560dc45ac80057d275f23342102825909c02d3b1249" + "1.3.1": + url: "https://github.com/x42/libltc/releases/download/v1.3.1/libltc-1.3.1.tar.gz" + sha256: "50e63eb3b767151bc0159a3cc5d426d03a42fd69029bc9b3b7c346555f4b709c" diff --git a/recipes/libltc/all/conanfile.py b/recipes/libltc/all/conanfile.py new file mode 100644 index 0000000000000..0497fcf230bbe --- /dev/null +++ b/recipes/libltc/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class LibltcConan(ConanFile): + name = "libltc" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://x42.github.io/libltc/" + description = "Linear/Longitudinal Time Code (LTC) Library" + topics = ("timecode", "smpte", "ltc") + license = "LGPL-3.0" + 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 layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.dependencies.build["automake"].conf_info.get("user.automake:compile-wrapper")) + lib_wrapper = unix_path(self, self.dependencies.build["automake"].conf_info.get("user.automake:lib-wrapper")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("AR", f"{lib_wrapper} lib") + env.define("LD", f"{compile_wrapper} link -nologo") + tc.generate(env) + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "ltc.dll.lib"), + os.path.join(self.package_folder, "lib", "ltc.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "ltc") + self.cpp_info.libs = ["ltc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libltc/all/test_package/CMakeLists.txt b/recipes/libltc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2e228217c2a41 --- /dev/null +++ b/recipes/libltc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libltc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libltc::libltc) diff --git a/recipes/libltc/all/test_package/conanfile.py b/recipes/libltc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libltc/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/libltc/all/test_package/test_package.c b/recipes/libltc/all/test_package/test_package.c new file mode 100644 index 0000000000000..506b4f1319b1b --- /dev/null +++ b/recipes/libltc/all/test_package/test_package.c @@ -0,0 +1,9 @@ +/* example was taken from https://www.gnu.org/ghm/2011/paris/slides/andreas-enge-mpc.pdf */ + +#include + +int main (void) { + LTCDecoder *decoder = ltc_decoder_create(1920, 1920 * 2); + ltc_decoder_free(decoder); + return 0; +} diff --git a/recipes/libltc/all/test_v1_package/CMakeLists.txt b/recipes/libltc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libltc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libltc/all/test_v1_package/conanfile.py b/recipes/libltc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libltc/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/libltc/config.yml b/recipes/libltc/config.yml new file mode 100644 index 0000000000000..27e13c88ce850 --- /dev/null +++ b/recipes/libltc/config.yml @@ -0,0 +1,5 @@ +versions: + "1.3.2": + folder: "all" + "1.3.1": + folder: "all" diff --git a/recipes/liblzf/all/CMakeLists.txt b/recipes/liblzf/all/CMakeLists.txt new file mode 100644 index 0000000000000..a501b15938468 --- /dev/null +++ b/recipes/liblzf/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.15) +project(liblzf LANGUAGES C) + +add_library(liblzf + src/lzf_c.c + src/lzf_d.c +) +set_target_properties(liblzf PROPERTIES OUTPUT_NAME lzf) + +# The original autotools config specified -O3 -funroll-all-loops for GCC +if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR + CMAKE_C_COMPILER_ID STREQUAL "Clang") + target_compile_options(liblzf PRIVATE "$<$:-O3>") + target_compile_options(liblzf PRIVATE "$<$:-O3>") +elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") + target_compile_options(liblzf PRIVATE "$<$:/O2>") + target_compile_options(liblzf PRIVATE "$<$:/O2>") +endif() +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 +) + +install(TARGETS liblzf + 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/liblzf/all/conandata.yml b/recipes/liblzf/all/conandata.yml new file mode 100644 index 0000000000000..4379b9bd34879 --- /dev/null +++ b/recipes/liblzf/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "3.6": + url: + - "http://dist.schmorp.de/liblzf/liblzf-3.6.tar.gz" + - "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/liblzf/3.6-3/liblzf_3.6.orig.tar.gz" + sha256: "9c5de01f7b9ccae40c3f619d26a7abec9986c06c36d260c179cedd04b89fb46a" +patches: + "3.6": + - patch_file: "patches/0001-add-extern-c.patch" + patch_description: "C++: link using C symbol names by adding 'extern \"C\"'" + patch_type: "portability" + - patch_file: "patches/0002-fix-macro-expansion-ub.patch" + patch_description: "Clang: fix \"macro expansion producing 'defined' has undefined behaviour\" warning" + patch_type: "portability" diff --git a/recipes/liblzf/all/conanfile.py b/recipes/liblzf/all/conanfile.py new file mode 100644 index 0000000000000..70d2ac9f7171b --- /dev/null +++ b/recipes/liblzf/all/conanfile.py @@ -0,0 +1,67 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class LiblzfConan(ConanFile): + name = "liblzf" + description = ( + "LZF is an extremely fast (not that much slower than a pure memcpy) " + "compression algorithm. It is ideal for applications where you want to " + "save *some* space but not at the cost of speed." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://software.schmorp.de/pkg/liblzf.html" + topics = ("lzf", "compression") + license = "BSD-2-Clause", "GPL-2.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): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["lzf"] diff --git a/recipes/liblzf/all/patches/0001-add-extern-c.patch b/recipes/liblzf/all/patches/0001-add-extern-c.patch new file mode 100644 index 0000000000000..903705a40884d --- /dev/null +++ b/recipes/liblzf/all/patches/0001-add-extern-c.patch @@ -0,0 +1,23 @@ +--- a/lzf.h ++++ b/lzf.h +@@ -48,6 +48,10 @@ + + #define LZF_VERSION 0x0105 /* 1.5, API version */ + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ + /* + * Compress in_len bytes stored at the memory block starting at + * in_data and write the result to out_data, up to a maximum length +@@ -96,5 +100,9 @@ unsigned int + lzf_decompress (const void *const in_data, unsigned int in_len, + void *out_data, unsigned int out_len); + ++#ifdef __cplusplus ++} ++#endif ++ + #endif + diff --git a/recipes/liblzf/all/patches/0002-fix-macro-expansion-ub.patch b/recipes/liblzf/all/patches/0002-fix-macro-expansion-ub.patch new file mode 100644 index 0000000000000..018c4e6810151 --- /dev/null +++ b/recipes/liblzf/all/patches/0002-fix-macro-expansion-ub.patch @@ -0,0 +1,15 @@ +--- a/lzfP.h ++++ b/lzfP.h +@@ -79,7 +79,11 @@ + * Unconditionally aligning does not cost very much, so do it if unsure + */ + #ifndef STRICT_ALIGN +-# define STRICT_ALIGN !(defined(__i386) || defined (__amd64)) ++# if !(defined(__i386) || defined (__amd64)) ++# define STRICT_ALIGN 1 ++# else ++# define STRICT_ALIGN 0 ++# endif + #endif + + /* diff --git a/recipes/liblzf/all/test_package/CMakeLists.txt b/recipes/liblzf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c587e08f822f4 --- /dev/null +++ b/recipes/liblzf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(liblzf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE liblzf::liblzf) diff --git a/recipes/liblzf/all/test_package/conanfile.py b/recipes/liblzf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/recipes/liblzf/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/liblzf/all/test_package/test_package.cpp b/recipes/liblzf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fa8baf612976d --- /dev/null +++ b/recipes/liblzf/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(void) { + const char in_data[] = "AAAAAAAAAAAAAAAAAAAAA"; + const unsigned int buf_len = 100; + char compressed_data[buf_len]; + char decompressed_data[buf_len]; + unsigned int compressed_len = lzf_compress(in_data, sizeof(in_data), compressed_data, buf_len); + unsigned int decompressed_len = lzf_decompress(compressed_data, compressed_len, decompressed_data, buf_len); + if (compressed_len >= 10 || decompressed_len != sizeof(in_data)) { + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/liblzf/all/test_v1_package/CMakeLists.txt b/recipes/liblzf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/liblzf/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/liblzf/all/test_v1_package/conanfile.py b/recipes/liblzf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/liblzf/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/liblzf/config.yml b/recipes/liblzf/config.yml new file mode 100644 index 0000000000000..86c7a0c01bf99 --- /dev/null +++ b/recipes/liblzf/config.yml @@ -0,0 +1,3 @@ +versions: + "3.6": + folder: all diff --git a/recipes/libmad/all/conandata.yml b/recipes/libmad/all/conandata.yml new file mode 100644 index 0000000000000..15cdb9fb19a6e --- /dev/null +++ b/recipes/libmad/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.15.1b": + url: "https://sourceforge.net/projects/mad/files/libmad/0.15.1b/libmad-0.15.1b.tar.gz" + sha256: bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 diff --git a/recipes/libmad/all/conanfile.py b/recipes/libmad/all/conanfile.py new file mode 100644 index 0000000000000..fb912e50ed5eb --- /dev/null +++ b/recipes/libmad/all/conanfile.py @@ -0,0 +1,114 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild +from conans.errors import ConanInvalidConfiguration +import os +import shutil + +required_conan_version = ">=1.33.0" + + +class LibmadConan(ConanFile): + name = "libmad" + description = "MAD is a high-quality MPEG audio decoder." + topics = ("conan", "mad", "MPEG", "audio", "decoder") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.underbit.com/products/mad/" + license = "GPL-2.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return self.settings.compiler == "Visual Studio" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.options.shared and self._is_msvc: + raise ConanInvalidConfiguration("libmad does not support shared library for MSVC") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + if self._is_msvc: + self._build_msvc() + else: + self._build_autotools() + + def _build_msvc(self): + with tools.chdir(os.path.join(self._source_subfolder, "msvc++")): + # cl : Command line error D8016: '/ZI' and '/Gy-' command-line options are incompatible + tools.replace_in_file("libmad.dsp", "/ZI ", "") + if self.settings.arch == "x86_64": + tools.replace_in_file("libmad.dsp", "Win32", "x64") + tools.replace_in_file("libmad.dsp", "FPM_INTEL", "FPM_DEFAULT") + tools.replace_in_file("mad.h", "# define FPM_INTEL", "# define FPM_DEFAULT") + with tools.vcvars(self.settings): + self.run("devenv libmad.dsp /upgrade") + msbuild = MSBuild(self) + msbuild.build(project_file="libmad.vcxproj") + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def _build_autotools(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")) + autotools = self._configure_autotools() + autotools.make() + + def _configure_autotools(self): + if self._autotools: + return self._autotools + args = [] + if self.options.shared: + args = ["--disable-static", "--enable-shared"] + else: + args = ["--disable-shared", "--enable-static"] + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.configure(configure_dir=self._source_subfolder, args=args) + return self._autotools + + def package(self): + self.copy("COPYRIGHT", dst="licenses", src=self._source_subfolder) + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + self.copy("CREDITS", dst="licenses", src=self._source_subfolder) + if self._is_msvc: + self.copy(pattern="*.lib", dst="lib", src=self._source_subfolder, keep_path=False) + self.copy(pattern="mad.h", dst="include", src=os.path.join(self._source_subfolder, "msvc++")) + else: + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package_info(self): + self.cpp_info.libs = ["libmad" if self._is_msvc else "mad"] diff --git a/recipes/libmad/all/test_package/CMakeLists.txt b/recipes/libmad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/libmad/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libmad/all/test_package/conanfile.py b/recipes/libmad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/libmad/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libmad/all/test_package/test_package.c b/recipes/libmad/all/test_package/test_package.c new file mode 100644 index 0000000000000..2fa0527f145bd --- /dev/null +++ b/recipes/libmad/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include + +int main() +{ + printf("mad version: %s\n", mad_version); + printf("mad copyright: %s\n", mad_copyright); + printf("mad author: %s\n", mad_author); + printf("mad build: %s\n", mad_build); + return 0; +} diff --git a/recipes/libmad/config.yml b/recipes/libmad/config.yml new file mode 100644 index 0000000000000..e7028aaa1acf5 --- /dev/null +++ b/recipes/libmad/config.yml @@ -0,0 +1,3 @@ +versions: + "0.15.1b": + folder: all diff --git a/recipes/libmaxminddb/all/conandata.yml b/recipes/libmaxminddb/all/conandata.yml new file mode 100644 index 0000000000000..83c876364326d --- /dev/null +++ b/recipes/libmaxminddb/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.7.1": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.7.1/libmaxminddb-1.7.1.tar.gz" + sha256: "e8414f0dedcecbc1f6c31cb65cd81650952ab0677a4d8c49cab603b3b8fb083e" + "1.6.0": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.6.0/libmaxminddb-1.6.0.tar.gz" + sha256: "7620ac187c591ce21bcd7bf352376a3c56a933e684558a1f6bef4bd4f3f98267" +patches: + "1.6.0": + - patch_file: "patches/0001-fix-cmake-bundle.patch" diff --git a/recipes/libmaxminddb/all/conanfile.py b/recipes/libmaxminddb/all/conanfile.py new file mode 100644 index 0000000000000..7afd56f70e087 --- /dev/null +++ b/recipes/libmaxminddb/all/conanfile.py @@ -0,0 +1,89 @@ +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 +import os + +required_conan_version = ">=1.52.0" + +class LibmaxminddbConan(ConanFile): + name = "libmaxminddb" + description = "C library for the MaxMind DB file format" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://maxmind.github.io/libmaxminddb/" + topics = ("maxmind", "geoip") + 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: + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "maxminddb") + self.cpp_info.set_property("cmake_target_name", "maxminddb::maxminddb") + self.cpp_info.set_property("pkg_config_name", "libmaxminddb") + self.cpp_info.libs = ["maxminddb"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + + if self.settings.os != "Windows": + 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 + self.cpp_info.names["cmake_find_package"] = "maxminddb" + self.cpp_info.names["cmake_find_package_multi"] = "maxminddb" diff --git a/recipes/libmaxminddb/all/patches/0001-fix-cmake-bundle.patch b/recipes/libmaxminddb/all/patches/0001-fix-cmake-bundle.patch new file mode 100644 index 0000000000000..f6d788650838f --- /dev/null +++ b/recipes/libmaxminddb/all/patches/0001-fix-cmake-bundle.patch @@ -0,0 +1,10 @@ +--- a/bin/CMakeLists.txt ++++ b/bin/CMakeLists.txt +@@ -8,6 +8,6 @@ if(NOT WIN32) + + install( + TARGETS mmdblookup +- RUNTIME DESTINATION bin ++ DESTINATION bin + ) + endif() diff --git a/recipes/libmaxminddb/all/test_package/CMakeLists.txt b/recipes/libmaxminddb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1d23aba68bcc6 --- /dev/null +++ b/recipes/libmaxminddb/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(maxminddb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE maxminddb::maxminddb) diff --git a/recipes/libmaxminddb/all/test_package/conanfile.py b/recipes/libmaxminddb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/libmaxminddb/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/libmaxminddb/all/test_package/test_package.c b/recipes/libmaxminddb/all/test_package/test_package.c new file mode 100644 index 0000000000000..0d1c8c47cefab --- /dev/null +++ b/recipes/libmaxminddb/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + printf("version: %s\n", MMDB_lib_version()); + return 0; +} diff --git a/recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt b/recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f31d3904fb26f --- /dev/null +++ b/recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(maxminddb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE maxminddb::maxminddb) diff --git a/recipes/libmaxminddb/all/test_v1_package/conanfile.py b/recipes/libmaxminddb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmaxminddb/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/libmaxminddb/config.yml b/recipes/libmaxminddb/config.yml new file mode 100644 index 0000000000000..9efd2189b76e9 --- /dev/null +++ b/recipes/libmaxminddb/config.yml @@ -0,0 +1,5 @@ +versions: + "1.7.1": + folder: all + "1.6.0": + folder: all diff --git a/recipes/libmbus/all/CMakeLists.txt b/recipes/libmbus/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/libmbus/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libmbus/all/conandata.yml b/recipes/libmbus/all/conandata.yml new file mode 100644 index 0000000000000..5028471b34dc5 --- /dev/null +++ b/recipes/libmbus/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20200424": + sha256: 0357e8795b1685a493399414a676827f4084fcee7806648af65e753ef5734b34 + url: https://github.com/rscada/libmbus/archive/baf03e2a47500e088161471829a05a3f42f45a0b.zip + "20200515": + sha256: 80cce810e9d9f3e2c3715e5e07b8f48cca82601a423ebd6eef6b6ee6bb846077 + url: https://github.com/rscada/libmbus/archive/b5e59aa52f9067a5c18862f9651c592fb56a9219.zip diff --git a/recipes/libmbus/all/conanfile.py b/recipes/libmbus/all/conanfile.py new file mode 100644 index 0000000000000..5c3ff6e87aae2 --- /dev/null +++ b/recipes/libmbus/all/conanfile.py @@ -0,0 +1,80 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class LibMbusConan(ConanFile): + name = "libmbus" + license = "BSD-3-Clause" + homepage = "https://github.com/rscada/libmbus" + url = "https://github.com/conan-io/conan-center-index" + description = """Meter-bus library and utility programs""" + topics = "conan", "mbus", "metering", "iot", "meter", "bus", "protocol" + exports_sources = "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def 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.settings.os not in ["Linux"]: + raise ConanInvalidConfiguration("Only Linux supported") + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + \ + os.path.basename( + self.conan_data["sources"][self.version]["url"]).split(".")[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions['LIBMBUS_ENABLE_COVERAGE'] = False + self._cmake.definitions['LIBMBUS_BUILD_TESTS'] = False + self._cmake.definitions['LIBMBUS_BUILD_EXAMPLES'] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, + "lib", "libmbus", "cmake")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libmbus/all/test_package/CMakeLists.txt b/recipes/libmbus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/libmbus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libmbus/all/test_package/conanfile.py b/recipes/libmbus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..933dbf96533ae --- /dev/null +++ b/recipes/libmbus/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/libmbus/all/test_package/test_package.c b/recipes/libmbus/all/test_package/test_package.c new file mode 100644 index 0000000000000..1828aa2f0f5c3 --- /dev/null +++ b/recipes/libmbus/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include +#include + +int main() { + mbus_handle *handle; + char *host = "localhost"; + long port = 8000; + + if ((handle = mbus_context_tcp(host, port)) == NULL) { + fprintf(stderr, "Scan failed: Could not initialize M-Bus context: %s\n", + mbus_error_str()); + return 0; + } + + mbus_context_free(handle); + + return 0; +} diff --git a/recipes/libmbus/config.yml b/recipes/libmbus/config.yml new file mode 100644 index 0000000000000..da79af3f4a5a5 --- /dev/null +++ b/recipes/libmbus/config.yml @@ -0,0 +1,6 @@ +--- +versions: + "20200424": + folder: "all" + "20200515": + folder: "all" diff --git a/recipes/libmediainfo/all/CMakeLists.txt b/recipes/libmediainfo/all/CMakeLists.txt new file mode 100644 index 0000000000000..8f32238b21da5 --- /dev/null +++ b/recipes/libmediainfo/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_definitions(${CONAN_DEFINES}) +set(ZenLib_LIBRARY ${CONAN_LIBS_LIBZEN}) +set(TinyXML_FOUND ON) + +add_subdirectory(source_subfolder/Project/CMake) diff --git a/recipes/libmediainfo/all/conandata.yml b/recipes/libmediainfo/all/conandata.yml new file mode 100644 index 0000000000000..c54a0606f82a2 --- /dev/null +++ b/recipes/libmediainfo/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "22.03": + url: "https://mediaarea.net/download/source/libmediainfo/22.03/libmediainfo_22.03.tar.xz" + sha256: "fc50babb628e9cfba655288dae06d5c342b0d7e6941a32d64fbbb113248c80b9" + "21.09": + url: "https://mediaarea.net/download/source/libmediainfo/21.09/libmediainfo_21.09.tar.xz" + sha256: "69be9444f6a03a1bdf56713ee31d56e987c502a7ec18eb54ee70fcc171b7f126" + "21.03": + url: "https://mediaarea.net/download/source/libmediainfo/21.03/libmediainfo_21.03.tar.xz" + sha256: "56b7e9abf80cba48032165cd7a46fd8d43dd63e3af35765f66c3f134caaca4ca" + "20.03": + url: "https://mediaarea.net/download/source/libmediainfo/20.03/libmediainfo_20.03.tar.xz" + sha256: "6848310eb7050efe7f90f18191dacfcc220c924390b8088fdf0d553274917f72" +patches: + "22.03": + - patch_file: "patches/0002-cmake-get-property-location.patch" + base_path: "source_subfolder" + "20.03": + - patch_file: "patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch" + base_path: "source_subfolder" diff --git a/recipes/libmediainfo/all/conanfile.py b/recipes/libmediainfo/all/conanfile.py new file mode 100644 index 0000000000000..37d62638387b4 --- /dev/null +++ b/recipes/libmediainfo/all/conanfile.py @@ -0,0 +1,149 @@ +from conan.tools.files import rename +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class LibmediainfoConan(ConanFile): + name = "libmediainfo" + license = ("BSD-2-Clause", "Apache-2.0", "GLPL-2.1+", "GPL-2.0-or-later", "MPL-2.0") + homepage = "https://mediaarea.net/en/MediaInfo" + url = "https://github.com/conan-io/conan-center-index" + description = "MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files" + topics = ("libmediainfo", "video", "audio", "metadata", "tag") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("libcurl/7.82.0") + self.requires("libzen/0.4.38") + self.requires("tinyxml2/9.0.0") + self.requires("zlib/1.2.12") + + def validate(self): + if not self.options["libzen"].enable_unicode: + raise ConanInvalidConfiguration("This package requires libzen with unicode support") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_ZENLIB"] = False + cmake.definitions["BUILD_ZLIB"] = False + # Generate a relocatable shared lib on Macos + cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + cmake.configure() + return cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + rename(self, "Findtinyxml2.cmake", "FindTinyXML.cmake") + tools.replace_in_file("FindTinyXML.cmake", "tinyxml2_LIBRARIES", "TinyXML_LIBRARIES") + + # TODO: move this to a patch (see how https://github.com/MediaArea/MediaInfoLib/issues/1408 if addressed by upstream) + postfix = "" + if self.settings.build_type == "Debug": + if self.settings.os == "Windows": + postfix += "d" + elif tools.is_apple_os(self.settings.os): + postfix += "_debug" + tools.replace_in_file(os.path.join(self._source_subfolder, "Source", "MediaInfoDLL", "MediaInfoDLL.h"), + "MediaInfo.dll", + "MediaInfo{}.dll".format(postfix)) + tools.replace_in_file(os.path.join(self._source_subfolder, "Source", "MediaInfoDLL", "MediaInfoDLL.h"), + "libmediainfo.0.dylib", + "libmediainfo{}.0.dylib".format(postfix)) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("License.html", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + tools.rmdir(os.path.join(self.package_folder, "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"mediainfo": "MediaInfoLib::MediaInfoLib"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "MediaInfoLib") + self.cpp_info.set_property("cmake_target_name", "mediainfo") + self.cpp_info.set_property("pkg_config_name", "libmediainfo") + postfix = "" + if self.settings.build_type == "Debug": + if self.settings.os == "Windows": + postfix += "d" + elif tools.is_apple_os(self.settings.os): + postfix += "_debug" + self.cpp_info.libs = ["mediainfo" + postfix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "MediaInfoLib" + self.cpp_info.names["cmake_find_package_multi"] = "MediaInfoLib" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "libmediainfo" diff --git a/recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch b/recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch new file mode 100644 index 0000000000000..0a6c4f7b41354 --- /dev/null +++ b/recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch @@ -0,0 +1,24 @@ +--- Project/CMake/CMakeLists.txt ++++ Project/CMake/CMakeLists.txt +@@ -2,7 +2,7 @@ + + cmake_minimum_required(VERSION 2.8.11) + +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + + set(MediaInfoLib_MAJOR_VERSION 20) + set(MediaInfoLib_MINOR_VERSION 03) +@@ -85,10 +85,10 @@ + endif() + + # use bundled tinyxml only if no system +-find_package(TinyXML) ++find_package(TinyXML REQUIRED) + + # use system curl if is present +-find_package(CURL) ++find_package(CURL REQUIRED) + + include_directories(${MediaInfoLib_SOURCES_PATH}) + include_directories(${MediaInfoLib_SOURCES_PATH}/ThirdParty/md5/) diff --git a/recipes/libmediainfo/all/patches/0002-cmake-get-property-location.patch b/recipes/libmediainfo/all/patches/0002-cmake-get-property-location.patch new file mode 100644 index 0000000000000..24922cedf1da7 --- /dev/null +++ b/recipes/libmediainfo/all/patches/0002-cmake-get-property-location.patch @@ -0,0 +1,41 @@ +From fad30ccb4e31d66dd196aae0897788ecab02de07 Mon Sep 17 00:00:00 2001 +From: Maxime Gervais +Date: Tue, 5 Apr 2022 15:16:12 +0200 +Subject: [PATCH] CMake: remove use of LOCATION property + +Signed-off-by: Maxime Gervais +--- + Project/CMake/CMakeLists.txt | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/Project/CMake/CMakeLists.txt b/Project/CMake/CMakeLists.txt +index 5c49030d6..5e061c4a3 100644 +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -56,10 +56,8 @@ if (NOT BUILD_ZLIB) + find_package(ZLIB REQUIRED) + else() + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib) +- get_target_property(ZLIB_LIBRARIES zlibstatic LOCATION) + if(NOT BUILD_SHARED_LIBS) +- get_filename_component(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} NAME) +- set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/${ZLIB_LIBRARIES}") ++ set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/$") + endif() + if(UNIX AND BUILD_SHARED_LIBS) + target_compile_options(zlibstatic PRIVATE -fPIC) +@@ -405,13 +403,7 @@ endif() + target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) + + if(MSVC AND BUILD_SHARED_LIBS) +- get_target_property(LOCATION mediainfo LOCATION_DEBUG) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) +- +- get_target_property(LOCATION mediainfo LOCATION_RELWITHDEBINFO) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) ++ install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) + endif() + + if (APPLE) diff --git a/recipes/libmediainfo/all/test_package/CMakeLists.txt b/recipes/libmediainfo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ddd72d9a23de2 --- /dev/null +++ b/recipes/libmediainfo/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(MediaInfoLib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} mediainfo) + +option(LIBMEDIAINFO_SHARED "Is libmediainfo a shared library?") +if(LIBMEDIAINFO_SHARED) + target_compile_definitions(${PROJECT_NAME} PRIVATE LIBMEDIAINFO_SHARED) +endif() diff --git a/recipes/libmediainfo/all/test_package/conanfile.py b/recipes/libmediainfo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f658082513f60 --- /dev/null +++ b/recipes/libmediainfo/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake, tools +import os + +# testsrc.mp4 generated with: +# ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=30 -c:v libx265 testsrc.mp4 + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["LIBMEDIAINFO_SHARED"] = self.options["libmediainfo"].shared + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + testsrc = os.path.join(self.source_folder, "testsrc.mp4") + self.run("{} {}".format(bin_path, testsrc), run_environment=True) diff --git a/recipes/libmediainfo/all/test_package/test_package.cpp b/recipes/libmediainfo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d4de9d263a0bc --- /dev/null +++ b/recipes/libmediainfo/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#if defined(LIBMEDIAINFO_SHARED) +# include "MediaInfoDLL/MediaInfoDLL.h" +# define MEDIAINFO_NS MediaInfoDLL +#else +# include "MediaInfo/MediaInfo.h" +# define MEDIAINFO_NS MediaInfoLib +#endif +#include "ZenLib/Ztring.h" + +#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; + } + MEDIAINFO_NS::String info = mediainfo.Inform(); +#ifdef UNICODE + std::wcout << info; +#else + std::cout << info; +#endif + return 0; +} diff --git a/recipes/libmediainfo/all/test_package/testsrc.mp4 b/recipes/libmediainfo/all/test_package/testsrc.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..7e12ea126587e4aa3bc609e8dd84b40ff70a7601 GIT binary patch literal 119619 zcmb@tWmKF^)9-r??h-UO1b6q~1P|`+PJrNq;0}S{?k>UI-3e|9PH=ahJ@>QU{XTNe zdDmHc-Lq!a^rxBncXj=`x~^&f0EjGHJRPk+f3gPvDB!Pe$cNqDk&_Jo00awXb8`UH z%586E>;eGve`rBf2x1g-={i_Vq1d6w{;;FifWwB0CN~~VXN$p`^Q4csd(RPV z56?demYbvdkJiK9zU%rObk>gXh!=9+gKS_m7T&ktL|mSJcJgZRhx2sX-CMPt5$v>W z`}Vz;5*2FVF*>iWsg81qR~zi18?0}OoixhY#mz6gZIKbO?8`o*&@9rw=pPut+R>%_j~g=M)bg-M(J)~a2A$&*=4zN0 z2UfY2@pA`ngDxsM#*2qje34+nb$&DjHS~oU)X!6$d=UxX+sEYk9KC-d`08-T+>7z#eYeOJd#t(oY#6a(x zu;t|hKxXIS_dJp>)Pk}m>v8DK!DBTy2w;_b!zwa`KB;CzMPZ+a1k7Nq%`Crff+A`$9d(ufUiNOZ#BpInkQ!KnqyA`5+B z$m{j9x{c?esK^s!T*XFwh?r8crF{JnygK8<%iiPFCUtQ1d|Q-ynrW}$=qpFV-)n1a zp_HF~^PqkuZ8~bdA+G$WducVStZ&y;I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k?l*c|;pKN$S&9SC>@K}?$d3YHO}n36i~U{<77XUtx^*LU zroJ@x?|+DXvx_uWJjaLkB3^%37NQD=MH4~t6m`vcI0%N|fY}J8v=nPpgHK8^igzdL z#7g}1fMk14bCg2nY`{iou3hdbSRYFga?e72*^~99Hwiuo2_d6HNT#j-%mUL^tovIn z!yZL2s}y`VjPf1txSGTF&!t+VN?CO`e0j-00GJR~@86{!C=JQ!FPD-Q7<+bXPF2=p z^YUcm)ul)vf~y0Y=~Fgrr^02HSkJV0+vRxUf{JGOdK8v7R|Y@OKwBl?kQC;05IbrT zT$lR>I7m3<#|SsKYf5xG&spTr*(TNdxo%Lwo?N;tr=jRiAA1%Tbs1vLYV*^)Xb8`T zA`Q1*EBR3>Ap2+zuHKi)A`v#2G4+->(iMqcPN@4JA;CP4Kg!D;>hm-|pDUCUoINk< zL~hs_kmCBG?>M$MdD;*=z

My CD Collection

+ + + + + + + + + + + +
TitleArtist
+ + + diff --git a/recipes/libxslt/all/test_package/libxslt_tutorial.c b/recipes/libxslt/all/test_package/libxslt_tutorial.c new file mode 100644 index 0000000000000..c107811f3048c --- /dev/null +++ b/recipes/libxslt/all/test_package/libxslt_tutorial.c @@ -0,0 +1,77 @@ +/* + * libxslt_tutorial.c: demo program for the XSL Transformation 1.0 engine + * + * based on xsltproc.c, by Daniel.Veillard@imag.fr + * by John Fleck + * + * See Copyright for the status of this software. + * + */ + +#include +#include +#include +#include +#include +#include + + + +extern int xmlLoadExtDtdDefaultValue; + +static void usage(const char *name) { + printf("Usage: %s [options] stylesheet file [file ...]\n", name); + printf(" --param name value : pass a (parameter,value) pair\n"); + +} + +int +main(int argc, char **argv) { + int i; + const char *params[16 + 1]; + int nbparams = 0; + xsltStylesheetPtr cur = NULL; + xmlDocPtr doc, res; + + if (argc <= 1) { + usage(argv[0]); + return(1); + } + + for (i = 1; i < argc; i++) { + if (argv[i][0] != '-') + break; + if ((!strcmp(argv[i], "-param")) || + (!strcmp(argv[i], "--param"))) { + i++; + params[nbparams++] = argv[i++]; + params[nbparams++] = argv[i]; + if (nbparams >= 16) { + fprintf(stderr, "too many params\n"); + return (1); + } + } else { + fprintf(stderr, "Unknown option %s\n", argv[i]); + usage(argv[0]); + return (1); + } + } + + params[nbparams] = NULL; + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile((const xmlChar *)argv[i]); + i++; + doc = xmlParseFile(argv[i]); + res = xsltApplyStylesheet(cur, doc, params); + xsltSaveResultToFile(stdout, res, cur); + + xsltFreeStylesheet(cur); + xmlFreeDoc(res); + xmlFreeDoc(doc); + + xsltCleanupGlobals(); + xmlCleanupParser(); + return(0); + +} diff --git a/recipes/libxslt/all/test_v1_package/CMakeLists.txt b/recipes/libxslt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libxslt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libxslt/all/test_v1_package/conanfile.py b/recipes/libxslt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1529b5e368db7 --- /dev/null +++ b/recipes/libxslt/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + 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") + xsl_path = os.path.join(self.source_folder, os.pardir, "test_package", "example.xsl") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "example.xml") + self.run(f"{bin_path} {xsl_path} {xml_path}", run_environment=True) + self.run("xsltproc -V", run_environment=True) diff --git a/recipes/libxslt/config.yml b/recipes/libxslt/config.yml new file mode 100644 index 0000000000000..9aafb604e965b --- /dev/null +++ b/recipes/libxslt/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.34": + folder: all diff --git a/recipes/libyaml/all/conandata.yml b/recipes/libyaml/all/conandata.yml new file mode 100644 index 0000000000000..774b23b9f97b2 --- /dev/null +++ b/recipes/libyaml/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.5": + url: "https://github.com/yaml/libyaml/archive/0.2.5.tar.gz" + sha256: "fa240dbf262be053f3898006d502d514936c818e422afdcf33921c63bed9bf2e" + "0.2.2": + url: "https://github.com/yaml/libyaml/archive/0.2.2.tar.gz" + sha256: "46bca77dc8be954686cff21888d6ce10ca4016b360ae1f56962e6882a17aa1fe" diff --git a/recipes/libyaml/all/conanfile.py b/recipes/libyaml/all/conanfile.py new file mode 100644 index 0000000000000..cccd3e0ddb5e0 --- /dev/null +++ b/recipes/libyaml/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class LibYAMLConan(ConanFile): + name = "libyaml" + description = "LibYAML is a YAML parser and emitter library." + topics = ("yaml", "parser", "emitter") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yaml/libyaml" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["INSTALL_CMAKE_DIR"] = "lib/cmake/libyaml" + tc.variables["YAML_STATIC_LIB_NAME"] = "yaml" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + # 0.2.2 has LICENSE, 0.2.5 has License, so ignore case + copy(self, pattern="License", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), ignore_case=True) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"yaml": "yaml::yaml"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "yaml") + self.cpp_info.set_property("cmake_target_name", "yaml") + self.cpp_info.libs = ["yaml"] + if is_msvc(self): + self.cpp_info.defines = [ + "YAML_DECLARE_EXPORT" if self.options.shared + else "YAML_DECLARE_STATIC" + ] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "yaml" + self.cpp_info.names["cmake_find_package_multi"] = "yaml" + 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/libyaml/all/test_package/CMakeLists.txt b/recipes/libyaml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ebfddbde01104 --- /dev/null +++ b/recipes/libyaml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(yaml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE yaml) diff --git a/recipes/libyaml/all/test_package/conanfile.py b/recipes/libyaml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libyaml/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/libyaml/all/test_package/test_package.c b/recipes/libyaml/all/test_package/test_package.c new file mode 100644 index 0000000000000..48a0bf7b68b8a --- /dev/null +++ b/recipes/libyaml/all/test_package/test_package.c @@ -0,0 +1,101 @@ +#include +#include +#include +#include + +struct fruit { + char *name; + char *color; + int count; +}; +struct fruit data[] = { + {"apple", "red", 12}, + {"orange", "orange", 3}, + {"banana", "yellow", 4}, + {"mango", "green", 1}, + {NULL, NULL, 0} +}; + +int main(void) +{ + yaml_emitter_t emitter; + yaml_event_t event; + struct fruit *f; + char buffer[64]; + + yaml_emitter_initialize(&emitter); + yaml_emitter_set_output_file(&emitter, stdout); + + yaml_stream_start_event_initialize(&event, YAML_UTF8_ENCODING); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_document_start_event_initialize(&event, NULL, NULL, NULL, 0); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_mapping_start_event_initialize(&event, NULL, (yaml_char_t *)YAML_MAP_TAG, + 1, YAML_ANY_MAPPING_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG, + (yaml_char_t *)"fruit", strlen("fruit"), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_sequence_start_event_initialize(&event, NULL, (yaml_char_t *)YAML_SEQ_TAG, + 1, YAML_ANY_SEQUENCE_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + for (f = data; f->name; f++) { + yaml_mapping_start_event_initialize(&event, NULL, (yaml_char_t *)YAML_MAP_TAG, + 1, YAML_ANY_MAPPING_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG, + (yaml_char_t *)"name", strlen("name"), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG, + (yaml_char_t *)f->name, strlen(f->name), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG, + (yaml_char_t *)"color", strlen("color"), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG, + (yaml_char_t *)f->color, strlen(f->color), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG, + (yaml_char_t *)"count", strlen("count"), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + sprintf(buffer, "%d", f->count); + yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_INT_TAG, + (yaml_char_t *)buffer, strlen(buffer), 1, 0, YAML_PLAIN_SCALAR_STYLE); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_mapping_end_event_initialize(&event); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + } + + yaml_sequence_end_event_initialize(&event); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_mapping_end_event_initialize(&event); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_document_end_event_initialize(&event, 0); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_stream_end_event_initialize(&event); + if (!yaml_emitter_emit(&emitter, &event)) goto error; + + yaml_emitter_delete(&emitter); + return 0; + +error: + fprintf(stderr, "Failed to emit event %d: %s\n", event.type, emitter.problem); + yaml_emitter_delete(&emitter); + return 1; +} + diff --git a/recipes/libyaml/all/test_v1_package/CMakeLists.txt b/recipes/libyaml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libyaml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libyaml/all/test_v1_package/conanfile.py b/recipes/libyaml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libyaml/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/libyaml/config.yml b/recipes/libyaml/config.yml new file mode 100644 index 0000000000000..71fa772f6ab99 --- /dev/null +++ b/recipes/libyaml/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.5": + folder: all + "0.2.2": + folder: all diff --git a/recipes/libyuv/all/conandata.yml b/recipes/libyuv/all/conandata.yml new file mode 100644 index 0000000000000..e839599c0c5fc --- /dev/null +++ b/recipes/libyuv/all/conandata.yml @@ -0,0 +1,28 @@ +# Versions from LIBYUV_VERSION definition in include/libyuv/version.h +# Pay attention to package commits incrementing this definition +sources: + "1854": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/3abd6f36b6e4f5a2e0ce236580a8bc1da3c7cf7e.tar.gz" + "1845": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/b9adaef1133ee835efc8970d1dcdcf23a5b68eba.tar.gz" + "1841": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/f71c83552d373f0ff41833b17e2880632d8561d7.tar.gz" + "1768": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/dfaf7534e0e536f7e5ef8ddd7326797bd09b8622.tar.gz" +patches: + "1854": + - patch_file: "patches/1854-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" + "1845": + - patch_file: "patches/1841-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" + "1841": + - patch_file: "patches/1841-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" + "1768": + - patch_file: "patches/1768-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" diff --git a/recipes/libyuv/all/conanfile.py b/recipes/libyuv/all/conanfile.py new file mode 100644 index 0000000000000..5e5b8c258b2f3 --- /dev/null +++ b/recipes/libyuv/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class LibyuvConan(ConanFile): + name = "libyuv" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://chromium.googlesource.com/libyuv/libyuv/" + description = "libyuv is an open source project that includes YUV scaling and conversion functionality." + topics = ["YUV", "libyuv", "google", "chromium"] + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_jpeg": "libjpeg", + } + + 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): + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + + def validate(self): + if is_msvc(self) and self.options.shared: + # Injecting CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is not sufficient since there are global symbols + raise ConanInvalidConfiguration(f"{self.ref} shared not supported for msvc.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TEST"] = False + tc.variables["LIBYUV_WITH_JPEG"] = bool(self.options.with_jpeg) + 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", 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 = ["yuv"] + self.cpp_info.requires = [] + if self.options.with_jpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libyuv/all/patches/1768-0001-fix-cmake.patch b/recipes/libyuv/all/patches/1768-0001-fix-cmake.patch new file mode 100644 index 0000000000000..d3f63b9343331 --- /dev/null +++ b/recipes/libyuv/all/patches/1768-0001-fix-cmake.patch @@ -0,0 +1,58 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.8 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) + OPTION( TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -23,23 +23,22 @@ LIST ( SORT ly_unittest_sources ) + INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) + + # this creates the static library (.a) +-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) + + # this creates the shared library (.so) +-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) + + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + + +-INCLUDE ( FindJPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) +- add_definitions( -DHAVE_JPEG ) ++option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" ON) ++if (LIBYUV_WITH_JPEG) ++ find_package(JPEG REQUIRED) ++ target_link_libraries(${ly_lib_static} JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) + endif() + + if(TEST) +@@ -81,11 +81,9 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert DESTINATION bin) ++INSTALL ( TARGETS ${ly_lib_static} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack +-INCLUDE ( CM_linux_packages.cmake ) + diff --git a/recipes/libyuv/all/patches/1841-0001-fix-cmake.patch b/recipes/libyuv/all/patches/1841-0001-fix-cmake.patch new file mode 100644 index 0000000000000..2ec00308ee93f --- /dev/null +++ b/recipes/libyuv/all/patches/1841-0001-fix-cmake.patch @@ -0,0 +1,61 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.8 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) + OPTION( TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -27,26 +27,22 @@ if(MSVC) + endif() + + # this creates the static library (.a) +-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) + + # this creates the shared library (.so) +-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) +-if(WIN32) +- SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) +-endif() + + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + + +-INCLUDE ( FindJPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) +- add_definitions( -DHAVE_JPEG ) ++option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" ON) ++if (LIBYUV_WITH_JPEG) ++ find_package(JPEG REQUIRED) ++ target_link_libraries(${ly_lib_static} JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) + endif() + + if(TEST) +@@ -82,11 +79,9 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert DESTINATION bin) ++INSTALL ( TARGETS ${ly_lib_static} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack +-INCLUDE ( CM_linux_packages.cmake ) + diff --git a/recipes/libyuv/all/patches/1854-0001-fix-cmake.patch b/recipes/libyuv/all/patches/1854-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e6f0d06d43a39 --- /dev/null +++ b/recipes/libyuv/all/patches/1854-0001-fix-cmake.patch @@ -0,0 +1,68 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.8 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) + OPTION( TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -27,15 +27,10 @@ if(MSVC) + endif() + + # this creates the static library (.a) +-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) + + # this creates the shared library (.so) +-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) +-if(WIN32) +- SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) +-endif() + + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) +@@ -44,12 +40,18 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + # this creates the yuvconstants tool + ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c ) + TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} ) ++include(CheckFunctionExists) ++check_function_exists(round HAVE_MATH_SYSTEM) ++if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(yuvconstants m) ++endif() + +-find_package ( JPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} ) +- add_definitions( -DHAVE_JPEG ) ++option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" ON) ++if (LIBYUV_WITH_JPEG) ++ find_package(JPEG REQUIRED) ++ target_link_libraries(${ly_lib_static} JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) + endif() + + if(TEST) +@@ -91,11 +93,9 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert yuvconstants DESTINATION bin) ++INSTALL ( TARGETS ${ly_lib_static} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack +-INCLUDE ( CM_linux_packages.cmake ) + diff --git a/recipes/libyuv/all/test_package/CMakeLists.txt b/recipes/libyuv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..639163e3b7c5c --- /dev/null +++ b/recipes/libyuv/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libyuv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libyuv::libyuv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libyuv/all/test_package/conanfile.py b/recipes/libyuv/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libyuv/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/libyuv/all/test_package/test_package.cpp b/recipes/libyuv/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c8f607bc623dd --- /dev/null +++ b/recipes/libyuv/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "libyuv.h" + +int main() { + uint8_t in[16] = {}; + uint8_t out[16] = {}; + libyuv::ConvertToARGB(in, 16, out, 0, 0, 0, 1, 1, 0, 0, + libyuv::RotationMode::kRotate0, 0); + return 0; +} diff --git a/recipes/libyuv/all/test_v1_package/CMakeLists.txt b/recipes/libyuv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libyuv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libyuv/all/test_v1_package/conanfile.py b/recipes/libyuv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libyuv/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/libyuv/config.yml b/recipes/libyuv/config.yml new file mode 100644 index 0000000000000..c1f0cfd37130f --- /dev/null +++ b/recipes/libyuv/config.yml @@ -0,0 +1,9 @@ +versions: + "1854": + folder: all + "1845": + folder: all + "1841": + folder: all + "1768": + folder: all diff --git a/recipes/libzen/all/conandata.yml b/recipes/libzen/all/conandata.yml new file mode 100644 index 0000000000000..c0b761db1ccf7 --- /dev/null +++ b/recipes/libzen/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.4.38": + url: "https://mediaarea.net/download/source/libzen/0.4.38/libzen_0.4.38.tar.bz2" + sha256: "594e07bb4a0472cd9da258b3c4e050e9a37a39cccd85e3d8b5bf597d027b7eda" +patches: + "0.4.38": + - patch_file: "patches/0001-enable-WIN32-shared-libraries.patch" + - patch_file: "patches/0002-export-data-in-windows-dlls.patch" diff --git a/recipes/libzen/all/conanfile.py b/recipes/libzen/all/conanfile.py new file mode 100644 index 0000000000000..c2222bfee137d --- /dev/null +++ b/recipes/libzen/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class LibzenConan(ConanFile): + name = "libzen" + license = "ZLIB" + homepage = "https://github.com/MediaArea/ZenLib" + url = "https://github.com/conan-io/conan-center-index" + description = "Small C++ derivate classes to have an easier life" + topics = ("c++", "helper", "util") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_unicode": [True, False], + "enable_large_files": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_unicode": True, + "enable_large_files": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_UNICODE"] = self.options.enable_unicode + tc.variables["LARGE_FILES"] = self.options.enable_large_files + # Export symbols for msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "Project", "CMake")) + cmake.build() + + def package(self): + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"zen": "ZenLib::ZenLib"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ZenLib") + self.cpp_info.set_property("cmake_target_name", "zen") + self.cpp_info.set_property("pkg_config_name", "libzen") + suffix = "" + if self.settings.build_type == "Debug": + if self.settings.os == "Windows": + suffix = "d" + elif is_apple_os(self): + suffix = "_debug" + self.cpp_info.libs = [f"zen{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + if self.options.enable_unicode: + self.cpp_info.defines.extend(["UNICODE", "_UNICODE"]) + if self.options.shared: + self.cpp_info.defines.append("LIBZEN_SHARED") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "ZenLib" + self.cpp_info.names["cmake_find_package_multi"] = "ZenLib" + 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/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch b/recipes/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch new file mode 100644 index 0000000000000..f40a66c0fca2f --- /dev/null +++ b/recipes/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch @@ -0,0 +1,11 @@ +--- Project/CMake/CMakeLists.txt ++++ Project/CMake/CMakeLists.txt +@@ -7,7 +7,7 @@ + set(ZenLib_PATCH_VERSION 38) + set(ZenLib_VERSION ${ZenLib_MAJOR_VERSION}.${ZenLib_MINOR_VERSION}.${ZenLib_PATCH_VERSION}) + +-if(WIN32) ++if(0) + set(BUILD_SHARED_LIBS OFF) + else() + option(BUILD_SHARED_LIBS "Build shared libs" ON) diff --git a/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch b/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch new file mode 100644 index 0000000000000..17b22fd745f02 --- /dev/null +++ b/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch @@ -0,0 +1,42 @@ +--- Source/ZenLib/Conf.cpp ++++ Source/ZenLib/Conf.cpp +@@ -24,8 +24,8 @@ + + //End of line + #ifdef WINDOWS +- const Char* EOL=__T("\r\n"); +- const Char PathSeparator=__T('\\'); ++ ZEN_IMPEXP const Char* EOL=__T("\r\n"); ++ ZEN_IMPEXP const Char PathSeparator=__T('\\'); + #endif + #ifdef UNIX + const Char* EOL=__T("\n"); +diff --git a/source_subfolder/Source/ZenLib/Conf.h b/source_subfolder/Source/ZenLib/Conf.h +index 18264cf..d989fdb 100644 +--- Source/ZenLib/Conf.h ++++ Source/ZenLib/Conf.h +@@ -234,9 +234,22 @@ + // Platform differences + //*************************************************************************** + ++#ifdef WINDOWS ++# ifdef zen_EXPORTS ++# define ZEN_IMPEXP __declspec(dllexport) ++# else ++# ifdef LIBZEN_SHARED ++# define ZEN_IMPEXP __declspec(dllimport) ++# endif ++# endif ++#endif ++#ifndef ZEN_IMPEXP ++# define ZEN_IMPEXP ++#endif ++ + //End of line +-extern const Char* EOL; +-extern const Char PathSeparator; ++ZEN_IMPEXP extern const Char* EOL; ++ZEN_IMPEXP extern const Char PathSeparator; + + //*************************************************************************** + // Types diff --git a/recipes/libzen/all/test_package/CMakeLists.txt b/recipes/libzen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..761c4f457a6d2 --- /dev/null +++ b/recipes/libzen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ZenLib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zen) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libzen/all/test_package/conanfile.py b/recipes/libzen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libzen/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/libzen/all/test_package/test_package.cpp b/recipes/libzen/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6cabb4da6b3bc --- /dev/null +++ b/recipes/libzen/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include "ZenLib/Utils.h" + +#include +#include + +int main() { + const std::uint8_t data[8] = {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe}; + std::uint64_t be64 = ZenLib::BigEndian2int64u(data); + std::uint64_t le64 = ZenLib::LittleEndian2int64u(data); + + if (be64 != 0xdeadbeefcafebabeULL) { + std::cerr << "BigEndian incorrect! Got 0x" << std::hex << be64 << "\n"; + return 1; + } + + if (le64 != 0xbebafecaefbeaddeULL) { + std::cerr << "LittleEndian incorrect! Got 0x" << std::hex << le64 << "\n"; + return 1; + } + + std::cout << "path separator on this platform is '"; +#ifdef UNICODE + std::wcout << ZenLib::PathSeparator; +#else + std::cout << ZenLib::PathSeparator; +#endif + std::cout << "'\n"; +} diff --git a/recipes/libzen/all/test_v1_package/CMakeLists.txt b/recipes/libzen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libzen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libzen/all/test_v1_package/conanfile.py b/recipes/libzen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libzen/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/libzen/config.yml b/recipes/libzen/config.yml new file mode 100644 index 0000000000000..49eb7f8b8da5a --- /dev/null +++ b/recipes/libzen/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.38": + folder: "all" diff --git a/recipes/libzip/all/conandata.yml b/recipes/libzip/all/conandata.yml new file mode 100644 index 0000000000000..567f243d79a98 --- /dev/null +++ b/recipes/libzip/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "1.9.2": + url: [ + "https://libzip.org/download/libzip-1.9.2.tar.gz", + "https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz", + ] + sha256: "fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f" + "1.8.0": + url: [ + "https://libzip.org/download/libzip-1.8.0.tar.gz", + "https://github.com/nih-at/libzip/releases/download/v1.8.0/libzip-1.8.0.tar.gz", + ] + sha256: "30ee55868c0a698d3c600492f2bea4eb62c53849bcf696d21af5eb65f3f3839e" + "1.7.3": + url: [ + "https://libzip.org/download/libzip-1.7.3.tar.gz", + "https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz", + ] + sha256: "0e2276c550c5a310d4ebf3a2c3dfc43fb3b4602a072ff625842ad4f3238cb9cc" +patches: + "1.9.2": + - patch_file: "patches/0001-cmake-install-bundle.patch" + "1.8.0": + - patch_file: "patches/0001-cmake-install-bundle.patch" + "1.7.3": + - patch_file: "patches/0001-cmake-install-bundle.patch" diff --git a/recipes/libzip/all/conanfile.py b/recipes/libzip/all/conanfile.py new file mode 100644 index 0000000000000..466b104bf29b9 --- /dev/null +++ b/recipes/libzip/all/conanfile.py @@ -0,0 +1,186 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LibZipConan(ConanFile): + name = "libzip" + description = "A C library for reading, creating, and modifying zip archives" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nih-at/libzip" + license = "BSD-3-Clause" + topics = ("zip", "zip-archives", "zip-editing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_bzip2": [True, False], + "with_lzma": [True, False], + "with_zstd": [True, False], + "crypto": [False, "win32", "openssl", "mbedtls"], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_bzip2": True, + "with_lzma": True, + "with_zstd": True, + "crypto": "openssl", + "tools": True, + } + + @property + def _has_zstd_support(self): + return Version(self.version) >= "1.8.0" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_zstd_support: + del self.options.with_zstd + # Default crypto backend on windows + if self.settings.os == "Windows": + self.options.crypto = "win32" + + 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): + self.requires("zlib/1.2.13") + + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + + if self.options.with_lzma: + self.requires("xz_utils/5.4.2") + + if self.options.get_safe("with_zstd"): + self.requires("zstd/1.5.5") + + if self.options.crypto == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.crypto == "mbedtls": + self.requires("mbedtls/3.2.1") + + def validate(self): + if self.options.crypto == "win32" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("Windows is required to use win32 crypto libraries") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TOOLS"] = self.options.tools + tc.variables["BUILD_REGRESS"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_DOC"] = False + tc.variables["ENABLE_LZMA"] = self.options.with_lzma + tc.variables["ENABLE_BZIP2"] = self.options.with_bzip2 + if self._has_zstd_support: + tc.variables["ENABLE_ZSTD"] = self.options.with_zstd + tc.variables["ENABLE_COMMONCRYPTO"] = False # TODO: We need CommonCrypto package + tc.variables["ENABLE_GNUTLS"] = False # TODO: We need GnuTLS package + tc.variables["ENABLE_MBEDTLS"] = self.options.crypto == "mbedtls" + tc.variables["ENABLE_OPENSSL"] = self.options.crypto == "openssl" + tc.variables["ENABLE_WINDOWS_CRYPTO"] = self.options.crypto == "win32" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + top_cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Honor zstd enabled + if self._has_zstd_support: + def zstd_find_package_pattern(version): + if version >= "1.9.2": + return "find_package(Zstd 1.3.6)" + else: + return "find_package(Zstd)" + lib_cmakelists = os.path.join(self.source_folder, "lib", "CMakeLists.txt") + replace_in_file(self, top_cmakelists, zstd_find_package_pattern(Version(self.version)), "find_package(zstd)") + replace_in_file(self, top_cmakelists, "Zstd_FOUND", "zstd_FOUND") + replace_in_file( + self, + lib_cmakelists, + "Zstd::Zstd", + "$,zstd::libzstd_shared,zstd::libzstd_static>", + ) + # Do not pollute rpath of installed binaries + replace_in_file( + self, + top_cmakelists, + "set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})", + "", + ) + replace_in_file( + self, + top_cmakelists, + "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libzip") + self.cpp_info.set_property("cmake_target_name", "libzip::zip") + self.cpp_info.set_property("pkg_config_name", "libzip") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_libzip"].libs = ["zip"] + if self.settings.os == "Windows": + self.cpp_info.components["_libzip"].system_libs = ["advapi32"] + if self.options.crypto == "win32": + self.cpp_info.components["_libzip"].system_libs.append("bcrypt") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "libzip" + self.cpp_info.names["cmake_find_package_multi"] = "libzip" + self.cpp_info.components["_libzip"].names["cmake_find_package"] = "zip" + self.cpp_info.components["_libzip"].names["cmake_find_package_multi"] = "zip" + self.cpp_info.components["_libzip"].set_property("cmake_target_name", "libzip::zip") + self.cpp_info.components["_libzip"].set_property("pkg_config_name", "libzip") + self.cpp_info.components["_libzip"].requires = ["zlib::zlib"] + if self.options.with_bzip2: + self.cpp_info.components["_libzip"].requires.append("bzip2::bzip2") + if self.options.with_lzma: + self.cpp_info.components["_libzip"].requires.append("xz_utils::xz_utils") + if self.options.get_safe("with_zstd"): + self.cpp_info.components["_libzip"].requires.append("zstd::zstd") + if self.options.crypto == "openssl": + self.cpp_info.components["_libzip"].requires.append("openssl::crypto") + elif self.options.crypto == "mbedtls": + self.cpp_info.components["_libzip"].requires.append("mbedtls::mbedtls") + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libzip/all/patches/0001-cmake-install-bundle.patch b/recipes/libzip/all/patches/0001-cmake-install-bundle.patch new file mode 100644 index 0000000000000..ef45169f8e52a --- /dev/null +++ b/recipes/libzip/all/patches/0001-cmake-install-bundle.patch @@ -0,0 +1,11 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -4,7 +4,7 @@ foreach(PROGRAM zipcmp zipmerge ziptool) + target_link_libraries(${PROGRAM} zip) + target_include_directories(${PROGRAM} PRIVATE BEFORE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}) + if(LIBZIP_DO_INSTALL) +- install(TARGETS ${PROGRAM} EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION bin) ++ install(TARGETS ${PROGRAM} EXPORT ${PROJECT_NAME}-targets DESTINATION bin) + endif() + if(NOT HAVE_GETOPT) + target_sources(${PROGRAM} PRIVATE getopt.c) diff --git a/recipes/libzip/all/test_package/CMakeLists.txt b/recipes/libzip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c95ee806189e5 --- /dev/null +++ b/recipes/libzip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libzip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libzip::zip) diff --git a/recipes/libzip/all/test_package/conanfile.py b/recipes/libzip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libzip/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/libzip/all/test_package/test_package.c b/recipes/libzip/all/test_package/test_package.c new file mode 100644 index 0000000000000..f5e6615b5faea --- /dev/null +++ b/recipes/libzip/all/test_package/test_package.c @@ -0,0 +1,100 @@ +/* + in-memory.c -- modify zip file in memory + Copyright (C) 2014-2015 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + 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. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h" + +int +main(int argc, char *argv[]) +{ + zip_source_t *src; + zip_t *za; + zip_error_t error; + const char data [] = {"conan-center-index"}; + const size_t size = sizeof(data); + char buffer [256] = {0}; + + zip_error_init(&error); + /* create source from buffer */ + if ((src = zip_source_buffer_create(data, size, 1, &error)) == NULL) { + zip_error_fini(&error); + return 1; + } + + /* open zip archive from source */ + if ((za = zip_open_from_source(src, 0, &error)) == NULL) { + zip_error_fini(&error); + return 0; + } + zip_error_fini(&error); + + /* we'll want to read the data back after zip_close */ + zip_source_keep(src); + + + /* close archive */ + if (zip_close(za) < 0) { + return 1; + } + + + /* copy new archive to buffer */ + + if (zip_source_is_deleted(src)) { + } + else { + zip_stat_t zst; + + if (zip_source_stat(src, &zst) < 0) { + return 1; + } + + if (zip_source_open(src) < 0) { + return 1; + } + + if ((zip_uint64_t)zip_source_read(src, buffer, zst.size) < zst.size) { + zip_source_close(src); + return 1; + } + zip_source_close(src); + } + + /* we're done with src */ + zip_source_free(src); + + return 0; +} diff --git a/recipes/libzip/all/test_v1_package/CMakeLists.txt b/recipes/libzip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libzip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libzip/all/test_v1_package/conanfile.py b/recipes/libzip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/libzip/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/libzip/config.yml b/recipes/libzip/config.yml new file mode 100644 index 0000000000000..63ddbcf63ff11 --- /dev/null +++ b/recipes/libzip/config.yml @@ -0,0 +1,7 @@ +versions: + "1.9.2": + folder: all + "1.8.0": + folder: all + "1.7.3": + folder: all diff --git a/recipes/libzippp/all/conandata.yml b/recipes/libzippp/all/conandata.yml new file mode 100644 index 0000000000000..f31401deb346d --- /dev/null +++ b/recipes/libzippp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "6.0-1.9.2": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v6.0-1.9.2.tar.gz" + sha256: "f9aef9811802a18e69cd50527381d70c2e0f0d8a839f1d41914f6234f5964fc3" + "5.0-1.8.0": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v5.0-1.8.0.tar.gz" + sha256: "b70f2d0f64eb68b00a16290bac40ac1a3fd3d2896cfddc93e370a7fa28c591c5" + "4.0": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v4.0-1.7.3.tar.gz" + sha256: "7560c2d8bbace39245ba6e89c5454b8bc5eb753bb13451bca2c7b5810c0a2f2d" diff --git a/recipes/libzippp/all/conanfile.py b/recipes/libzippp/all/conanfile.py new file mode 100644 index 0000000000000..e0c0670ea25f1 --- /dev/null +++ b/recipes/libzippp/all/conanfile.py @@ -0,0 +1,112 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibZipppConan(ConanFile): + name = "libzippp" + description = "A simple basic C++ wrapper around the libzip library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ctabin/libzippp" + topics = ("zip", "zlib", "libzip", "zip-archives", "zip-editing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_encryption": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_encryption": False, + } + + @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 requirements(self): + self.requires("zlib/1.2.13") + if Version(self.version) == "4.0": + self.requires("libzip/1.7.3") + else: + versions = str(self.version).split("-") + if len(versions) == 2: + self.requires(f"libzip/{versions[1]}") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + libzippp_version = str(self.version) + if libzippp_version != "4.0" and len(libzippp_version.split("-")) != 2: + raise ConanInvalidConfiguration(f"{self.ref}: version number must include '-'. (ex. '5.0-1.8.0')") + + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libc++. Use libstdc++ instead.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.variables["LIBZIPPP_INSTALL"] = True + tc.variables["LIBZIPPP_INSTALL_HEADERS"] = True + tc.variables["LIBZIPPP_BUILD_TESTS"] = False + tc.variables["LIBZIPPP_ENABLE_ENCRYPTION"] = self.options.with_encryption + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_source(self): + replace_in_file(self, os.path.join(self.source_folder, 'CMakeLists.txt'), + 'find_package(LIBZIP MODULE REQUIRED)', + 'find_package(libzip REQUIRED CONFIG)') + + def build(self): + self._patch_source() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENCE", 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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libzippp") + self.cpp_info.set_property("cmake_target_name", "libzippp::libzippp") + prefix = "lib" if self.settings.os == "Windows" else "" + postfix = "" if self.options.shared else "_static" + self.cpp_info.libs = [f"{prefix}zippp{postfix}"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if self.options.with_encryption: + self.cpp_info.defines.append("LIBZIPPP_WITH_ENCRYPTION") diff --git a/recipes/libzippp/all/test_package/CMakeLists.txt b/recipes/libzippp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5514f16e5d6bb --- /dev/null +++ b/recipes/libzippp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libzippp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libzippp::libzippp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libzippp/all/test_package/conanfile.py b/recipes/libzippp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libzippp/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/libzippp/all/test_package/test_package.cpp b/recipes/libzippp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5263ce3888531 --- /dev/null +++ b/recipes/libzippp/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +/* + in-memory.c -- modify zip file in memory + Copyright (C) 2014-2015 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + 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. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 + +using namespace libzippp; + +int main(int argc, char *argv[]) +{ + ZipArchive z1("test.zip"); + z1.open(ZipArchive::Write); + z1.addData("test.txt", "hello world\n", 13); + z1.close(); + + ZipArchive z2("test.zip"); + z2.open(ZipArchive::ReadOnly); + auto entry = z2.getEntry("test.txt"); + std::cout << entry.readAsText(); + z2.close(); +} diff --git a/recipes/libzippp/all/test_v1_package/CMakeLists.txt b/recipes/libzippp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libzippp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libzippp/all/test_v1_package/conanfile.py b/recipes/libzippp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libzippp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libzippp/config.yml b/recipes/libzippp/config.yml new file mode 100644 index 0000000000000..4ba054a3032a9 --- /dev/null +++ b/recipes/libzippp/config.yml @@ -0,0 +1,7 @@ +versions: + "6.0-1.9.2": + folder: all + "5.0-1.8.0": + folder: all + "4.0": + folder: all diff --git a/recipes/lief/all/conandata.yml b/recipes/lief/all/conandata.yml new file mode 100644 index 0000000000000..322361c8a5bce --- /dev/null +++ b/recipes/lief/all/conandata.yml @@ -0,0 +1,46 @@ +sources: + "0.12.3": + url: "https://github.com/lief-project/LIEF/archive/0.12.3.tar.gz" + sha256: "762925ad2eed642a6e7ef2cc899bcd3e93a40a2ce1dd2391d9b9ecadfe6438cf" + "0.12.2": + url: "https://github.com/lief-project/LIEF/archive/0.12.2.tar.gz" + sha256: "d779c802ba1f80d0e93765e038e0a198fb5ffe4662afe467e33102cb44a06e99" + "0.10.1": + url: "https://github.com/lief-project/LIEF/archive/0.10.1.tar.gz" + sha256: "6f30c98a559f137e08b25bcbb376c0259914b33c307b8b901e01ca952241d00a" +patches: + "0.12.3": + - patch_file: "patches/0.12.3-001_link_to_conan.patch" + patch_description: "find conan package and link these" + patch_type: "conan" + - patch_file: "patches/0.12.2-002_support_older_gcc.patch" + patch_description: "fix name look up issue" + patch_type: "portability" + patch_source: "https://github.com/lief-project/LIEF/pull/815" + "0.12.2": + - patch_file: "patches/0.12.2-001_link_to_conan.patch" + patch_description: "find conan package and link these" + patch_type: "conan" + - patch_file: "patches/0.12.2-002_support_older_gcc.patch" + patch_description: "fix name look up issue" + patch_type: "portability" + patch_source: "https://github.com/lief-project/LIEF/pull/815" + "0.10.1": + - patch_file: "patches/001_link_to_conan.patch" + patch_description: "find conan package and link these" + patch_type: "conan" + - patch_file: "patches/002_fix_resources_manager.patch" + patch_description: "use rang for colorizing" + patch_type: "backport" + - patch_file: "patches/003_fix_json_include_path.patch" + patch_description: "fix include path for conan package" + patch_type: "conan" + - patch_file: "patches/004_fix_elf_parser.patch" + patch_description: "remove LIEF_API" + patch_type: "backport" + - patch_file: "patches/005_fix_compiler_detection.patch" + patch_description: "fix check logic for compiler C++17 support" + patch_type: "backport" + - patch_file: "patches/006_fix_binary_cpp.patch" + patch_description: "include cctype" + patch_type: "backport" diff --git a/recipes/lief/all/conanfile.py b/recipes/lief/all/conanfile.py new file mode 100644 index 0000000000000..06891925739de --- /dev/null +++ b/recipes/lief/all/conanfile.py @@ -0,0 +1,159 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.57.0" + +class LiefConan(ConanFile): + name = "lief" + description = "Library to Instrument Executable Formats" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lief-project/LIEF" + topics = ("executable", "elf", "pe", "mach-o") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_c_api": [True, False], + "with_frozen": [True, False], + "with_json": [True, False], + "with_art": [True, False], + "with_dex": [True, False], + "with_elf": [True, False], + "with_macho": [True, False], + "with_oat": [True, False], + "with_pe": [True, False], + "with_vdex": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_frozen": True, + "with_json": True, + "with_c_api": True, + "with_art": True, + "with_dex": True, + "with_elf": True, + "with_macho": True, + "with_oat": True, + "with_pe": True, + "with_vdex": True, + } + + @property + def _min_cppstd(self): + return "11" + + 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("mbedtls/3.2.1") + if Version(self.version) < "0.12.2": + self.requires("rang/3.2") + else: + self.requires("utfcpp/3.2.3") + # lief doesn't supprot spdlog/1.11.0 with fmt/9.x yet. + self.requires("spdlog/1.10.0") + self.requires("boost/1.81.0", transitive_headers=True) + self.requires("tcb-span/cci.20220616", transitive_headers=True) + if self.options.with_json: + self.requires("nlohmann_json/3.11.2") + if self.options.with_frozen: + self.requires("frozen/1.1.1") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if self.options.shared and is_msvc(self) and not check_min_vs(self, "191", raise_invalid=False): + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio < 15 with shared:True") + + if self.settings.compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration(f"{self.ref} does not support libstdc++") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIEF_ART"] = self.options.with_art + tc.variables["LIEF_DEX"] = self.options.with_dex + tc.variables["LIEF_ELF"] = self.options.with_elf + tc.variables["LIEF_OAT"] = self.options.with_oat + tc.variables["LIEF_PE"] = self.options.with_pe + tc.variables["LIEF_VDEX"] = self.options.with_vdex + tc.variables["LIEF_MACHO"] = self.options.with_macho + tc.variables["LIEF_ENABLE_JSON"] = self.options.with_json + tc.variables["LIEF_DISABLE_FROZEN"] = not self.options.with_frozen + tc.variables["LIEF_C_API"] = self.options.with_c_api + tc.variables["LIEF_EXAMPLES"] = False + tc.variables["LIEF_TESTS"] = False + tc.variables["LIEF_DOC"] = False + tc.variables["LIEF_LOGGING"] = False + tc.variables["LIEF_PYTHON_API"] = False + if Version(self.version) >= "0.12.2": + tc.variables["LIEF_USE_CCACHE"] = False + tc.variables["LIEF_OPT_MBEDTLS_EXTERNAL"] = True + tc.variables["LIEF_OPT_NLOHMANN_JSON_EXTERNAL"] = True + tc.variables["LIEF_OPT_FROZEN_EXTERNAL"] = True + tc.variables["LIEF_OPT_UTFCPP_EXTERNAL"] = True + tc.variables["LIEF_EXTERNAL_SPDLOG"] = True + tc.variables["LIEF_OPT_EXTERNAL_LEAF"] = True + tc.variables["LIEF_OPT_EXTERNAL_SPAN"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["LIEF"] + + self.cpp_info.set_property("cmake_file_name", "LIEF") + self.cpp_info.set_property("cmake_target_name", "LIEF::LIEF") + self.cpp_info.set_property("pkg_config_name", "LIEF") + + if self.options.shared: + self.cpp_info.defines.append("LIEF_IMPORT") + if is_msvc(self): + self.cpp_info.cxxflags += ["/FIiso646.h"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.system_libs = ["ws2_32"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "LIEF" + self.cpp_info.names["cmake_find_package_multi"] = "LIEF" diff --git a/recipes/lief/all/patches/0.12.2-001_link_to_conan.patch b/recipes/lief/all/patches/0.12.2-001_link_to_conan.patch new file mode 100644 index 0000000000000..f5fad544a589a --- /dev/null +++ b/recipes/lief/all/patches/0.12.2-001_link_to_conan.patch @@ -0,0 +1,96 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d59f14..9fdfe43 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,6 @@ endif() + + + if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) +- include(ChooseMSVCCRT) + endif() + include(CheckCXXCompilerFlag) + include(CheckCCompilerFlag) +@@ -70,7 +69,6 @@ endif() + + # Dependencies + # ============ +-set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") + include(LIEFDependencies) + + # iOS specific config +@@ -376,12 +374,14 @@ endif() + # Leaf + # ======================================= + if(LIEF_EXTERNAL_LEAF) ++ find_package(Boost REQUIRED CONFIG) + message(STATUS "Using external LEAF version") + if(LIEF_EXTERNAL_LEAF_DIR) + message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") + target_include_directories(LIB_LIEF SYSTEM PUBLIC + "$") + endif() ++ target_link_libraries(LIB_LIEF PRIVATE Boost::headers) + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp + COMMAND +@@ -425,6 +425,8 @@ if(LIEF_EXTERNAL_SPAN) + target_include_directories(LIB_LIEF SYSTEM PUBLIC + "$") + endif() ++ find_package(tcb-span REQUIRED CONFIG) ++ target_link_libraries(LIB_LIEF PRIVATE tcb-span::tcb-span) + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp + COMMAND +@@ -439,7 +441,6 @@ else() + endif() + + +- + target_link_libraries(LIB_LIEF PRIVATE lief_spdlog) + + # Flags definition +@@ -448,8 +449,7 @@ target_link_libraries(LIB_LIEF PRIVATE lief_spdlog) + # cmake-format: off + set_target_properties( + LIB_LIEF +- PROPERTIES POSITION_INDEPENDENT_CODE ON +- CXX_STANDARD 11 ++ PROPERTIES CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_VISIBILITY_PRESET hidden + C_VISIBILITY_PRESET hidden) +@@ -667,8 +667,9 @@ endif() + # Installation + # ====================== + ++include(GNUInstallDirs) ++if(0) + if(UNIX) +- include(GNUInstallDirs) + set(CMAKE_INSTALL_LIBDIR "lib") + else() + if(WIN32) +@@ -682,13 +683,14 @@ else() + message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet") + endif() + endif() ++endif() + + install( + TARGETS LIB_LIEF lief_spdlog + EXPORT LIEFExport + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install( +@@ -727,6 +729,3 @@ export( + NAMESPACE LIEF:: + FILE LIEFExport-${lib_type}.cmake) + +-# Package +-# ====================== +-add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package") diff --git a/recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch b/recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch new file mode 100644 index 0000000000000..2ab323a4fbd5c --- /dev/null +++ b/recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch @@ -0,0 +1,13 @@ +diff --git a/src/PE/Binary.cpp b/src/PE/Binary.cpp +index 0e032c3..d2eaae9 100644 +--- a/src/PE/Binary.cpp ++++ b/src/PE/Binary.cpp +@@ -1732,7 +1732,7 @@ std::ostream& Binary::print(std::ostream& os) const { + if (has_debug()) { + os << "Debug" << std::endl; + os << "=====" << std::endl; +- for (const Debug& debug : debug()) { ++ for (const Debug& debug : this->debug()) { + os << debug << std::endl; + } + os << std::endl; diff --git a/recipes/lief/all/patches/0.12.3-001_link_to_conan.patch b/recipes/lief/all/patches/0.12.3-001_link_to_conan.patch new file mode 100644 index 0000000000000..b614ea503a68c --- /dev/null +++ b/recipes/lief/all/patches/0.12.3-001_link_to_conan.patch @@ -0,0 +1,89 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index eadac9a..5ad254c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,7 +17,6 @@ endif() + + + if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) +- include(ChooseMSVCCRT) + endif() + include(CheckCXXCompilerFlag) + include(CheckCCompilerFlag) +@@ -75,7 +74,6 @@ endif() + + # Dependencies + # ============ +-set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") + include(LIEFDependencies) + + # iOS specific config +@@ -381,12 +379,14 @@ endif() + # Leaf + # ======================================= + if(LIEF_EXTERNAL_LEAF) ++ find_package(Boost REQUIRED CONFIG) + message(STATUS "Using external LEAF version") + if(LIEF_EXTERNAL_LEAF_DIR) + message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") + target_include_directories(LIB_LIEF SYSTEM PUBLIC + "$") + endif() ++ target_link_libraries(LIB_LIEF PRIVATE Boost::headers) + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp + COMMAND +@@ -430,6 +430,8 @@ if(LIEF_EXTERNAL_SPAN) + target_include_directories(LIB_LIEF SYSTEM PUBLIC + "$") + endif() ++ find_package(tcb-span REQUIRED CONFIG) ++ target_link_libraries(LIB_LIEF PRIVATE tcb-span::tcb-span) + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp + COMMAND +@@ -453,8 +455,7 @@ target_link_libraries(LIB_LIEF PRIVATE lief_spdlog) + # cmake-format: off + set_target_properties( + LIB_LIEF +- PROPERTIES POSITION_INDEPENDENT_CODE ON +- CXX_STANDARD 11 ++ PROPERTIES CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_VISIBILITY_PRESET hidden + C_VISIBILITY_PRESET hidden) +@@ -672,8 +673,9 @@ endif() + # Installation + # ====================== + ++include(GNUInstallDirs) ++if(0) + if(UNIX) +- include(GNUInstallDirs) + set(CMAKE_INSTALL_LIBDIR "lib") + else() + if(WIN32) +@@ -687,13 +689,14 @@ else() + message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet") + endif() + endif() ++endif() + + install( + TARGETS LIB_LIEF lief_spdlog + EXPORT LIEFExport + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install( +@@ -731,7 +734,3 @@ export( + EXPORT LIEFExport + NAMESPACE LIEF:: + FILE LIEFExport-${lib_type}.cmake) +- +-# Package +-# ====================== +-add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package") diff --git a/recipes/lief/all/patches/001_link_to_conan.patch b/recipes/lief/all/patches/001_link_to_conan.patch new file mode 100644 index 0000000000000..e999cd3dd9317 --- /dev/null +++ b/recipes/lief/all/patches/001_link_to_conan.patch @@ -0,0 +1,155 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9b168d9..243bbc2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + # Modules + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") + if (WIN32) +- include(ChooseMSVCCRT) + endif() + include(CheckCXXCompilerFlag) + include(CheckCCompilerFlag) +@@ -49,14 +48,14 @@ endif() + + # Dependencies + # ============ +-set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") +-include(LIEFDependencies) ++set(LIEF_FROZEN_ENABLED 0) ++if (LIEF_SUPPORT_CXX14 AND NOT LIEF_DISABLE_FROZEN) ++ message(STATUS "Enable Frozen (C++14 support)") ++ set(LIEF_FROZEN_ENABLED 1) ++endif() + + # LIEF Source definition + # ====================== +-set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE) +-set_source_files_properties(${mbedtls_src_x509} PROPERTIES GENERATED TRUE) +-set_source_files_properties(${mbedtls_src_tls} PROPERTIES GENERATED TRUE) + + if (LIEF_LOGGING) + set_source_files_properties(${ELG_SOURCE_DIR}/easylogging++.cc PROPERTIES GENERATED TRUE) +@@ -73,9 +72,6 @@ set(LIEF_PRIVATE_INCLUDE_FILES) + + set(LIBLIEF_SOURCE_FILES + "${ELG_CC_PATH}" +- "${mbedtls_src_crypto}" +- "${mbedtls_src_x509}" +- "${mbedtls_src_tls}" + "${LIBFUZZER_SRC_FILES}" + "${CMAKE_CURRENT_SOURCE_DIR}/src/logging.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/exception.cpp" +@@ -126,13 +122,11 @@ set(LIEF_INCLUDE_FILES + set(LIEF_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/json.cpp") + set(LIEF_JSON_HDR + "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/json.hpp" +- "${LIBJSON_SOURCE_DIR}/json.hpp" + ) + + if (LIEF_ENABLE_JSON) + list(APPEND LIBLIEF_SOURCE_FILES "${LIEF_JSON_SRC}") + list(APPEND LIEF_INC_FILES "${LIEF_JSON_HDR}") +- list(APPEND LIEF_PUBLIC_INCLUDE_DIR "${LIBJSON_SOURCE_DIR}/") + endif() + + source_group("Header Files" FILES ${LIEF_INC_FILES}) +@@ -224,9 +218,6 @@ endif() + + # Frozen Configuration + # ==================== +-if (LIEF_FROZEN_ENABLED) +- list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${FROZEN_INCLUDE_DIR}") +-endif() + + # OAT part + # ======== +@@ -292,19 +283,15 @@ list(APPEND LIEF_PUBLIC_INCLUDE_DIR + list(APPEND LIEF_PRIVATE_INCLUDE_DIR + "${LIEF_PUBLIC_INCLUDE_DIR}" + "${LIEF_PUBLIC_INCLUDE_DIR}" +- "${LIBRANG_SOURCE_DIR}/include" + "${CMAKE_CURRENT_SOURCE_DIR}/src" + "${CMAKE_BINARY_DIR}" ++ "${CMAKE_CURRENT_BINARY_DIR}" + "${ELG_SOURCE_DIR}" +- "${MBEDTLS_INCLUDE_DIRS}" + ) + + + # Grouping external projects + # ========================== +-source_group("mbedtls\\crypto" FILES ${mbedtls_src_crypto}) +-source_group("mbedtls\\x509" FILES ${mbedtls_src_x509}) +-source_group("mbedtls\\tls" FILES ${mbedtls_src_tls}) + if (LIEF_LOGGING) + source_group("easylogging" FILES ${ELG_SOURCE_DIR}/easylogging++.cc) + endif() +@@ -316,7 +303,8 @@ target_include_directories(LIB_LIEF + PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") + + if (LIEF_ENABLE_JSON) +- add_dependencies(LIB_LIEF lief_libjson) ++ find_package(nlohmann_json REQUIRED CONFIG) ++ target_link_libraries(LIB_LIEF nlohmann_json::nlohmann_json) + endif() + + if (LIEF_LOGGING) +@@ -324,18 +312,20 @@ if (LIEF_LOGGING) + endif() + + if (LIEF_FROZEN_ENABLED) +- add_dependencies(LIB_LIEF lief_frozen) ++ find_package(frozen REQUIRED CONFIG) ++ target_link_libraries(LIB_LIEF frozen::frozen) + endif() + +-add_dependencies(LIB_LIEF lief_rang_cpp_color) ++find_package(rang REQUIRED CONFIG) ++target_link_libraries(LIB_LIEF rang::rang) + +-add_dependencies(LIB_LIEF lief_mbed_tls) ++find_package(MbedTLS REQUIRED CONFIG) ++target_link_libraries(LIB_LIEF MbedTLS::mbedtls) + + # Flags definition + # ---------------- + set_property(TARGET LIB_LIEF PROPERTY CXX_STANDARD 11) + set_property(TARGET LIB_LIEF PROPERTY CXX_STANDARD_REQUIRED ON) +-set_property(TARGET LIB_LIEF PROPERTY POSITION_INDEPENDENT_CODE ON) + set_property(TARGET LIB_LIEF PROPERTY CXX_VISIBILITY_PRESET hidden) + + target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1) +@@ -345,11 +335,6 @@ target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1) + # with the SpcSpAgencyInfo Critical Extension, which mbed TLS doesn't + # support, so set MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION to + # have it skip this extension. +-add_definitions( +- -DMBEDTLS_MD2_C +- -DMBEDTLS_MD4_C +- -DMBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION +-) + + + # ASAN - LSAN - TSAN - USAN +@@ -512,16 +497,16 @@ endif() + + install(TARGETS LIB_LIEF + ARCHIVE +- DESTINATION lib ++ DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY +- DESTINATION lib ++ DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME +- DESTINATION lib ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT libraries) + + install( + DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT headers + FILES_MATCHING REGEX "(.*).(hpp|h|def)$") + diff --git a/recipes/lief/all/patches/002_fix_resources_manager.patch b/recipes/lief/all/patches/002_fix_resources_manager.patch new file mode 100644 index 0000000000000..e48ad364b747b --- /dev/null +++ b/recipes/lief/all/patches/002_fix_resources_manager.patch @@ -0,0 +1,10 @@ +--- src/PE/ResourcesManager.cpp ++++ src/PE/ResourcesManager.cpp +@@ -1174,7 +1174,6 @@ + + std::string ResourcesManager::print(uint32_t depth) const { + std::ostringstream oss; +- oss << rang::control::forceColor; + uint32_t current_depth = 0; + this->print_tree(*this->resources_, oss, current_depth, depth); + return oss.str(); diff --git a/recipes/lief/all/patches/003_fix_json_include_path.patch b/recipes/lief/all/patches/003_fix_json_include_path.patch new file mode 100644 index 0000000000000..9cc16bdbe0687 --- /dev/null +++ b/recipes/lief/all/patches/003_fix_json_include_path.patch @@ -0,0 +1,11 @@ +--- include/LIEF/json.hpp ++++ include/LIEF/json.hpp +@@ -19,7 +19,7 @@ + #include + + #ifdef LIEF_JSON_SUPPORT +-#include ++#include + + using json = nlohmann::json; + #endif diff --git a/recipes/lief/all/patches/004_fix_elf_parser.patch b/recipes/lief/all/patches/004_fix_elf_parser.patch new file mode 100644 index 0000000000000..888201dd7b727 --- /dev/null +++ b/recipes/lief/all/patches/004_fix_elf_parser.patch @@ -0,0 +1,20 @@ +--- include/LIEF/ELF/Parser.hpp ++++ include/LIEF/ELF/Parser.hpp +@@ -73,7 +73,7 @@ + //! @param[in] file Path to the ELF binary + //! @param[in] count_mtd Method used to count dynamic symbols. Default: LIEF::ELF::DYNSYM_COUNT_METHODS::COUNT_AUTO + //! @Return LIEF::ELF::Binary +- LIEF_API static std::unique_ptr parse(const std::string& file, DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); ++ static std::unique_ptr parse(const std::string& file, DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); + + //! @brief Parse the given raw data as an ELF binary and return a LIEF::ELF::Binary object + //! +@@ -83,7 +83,7 @@ + //! @param[in] name Binary name (optional) + //! @param[in] count_mtd Method used to count dynamic symbols. Default: LIEF::ELF::DYNSYM_COUNT_METHODS::COUNT_AUTO + //! @Return LIEF::ELF::Binary +- LIEF_API static std::unique_ptr parse(const std::vector& data, const std::string& name = "", DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); ++ static std::unique_ptr parse(const std::vector& data, const std::string& name = "", DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); + + Parser& operator=(const Parser& copy) = delete; + Parser(const Parser& copy) = delete; diff --git a/recipes/lief/all/patches/005_fix_compiler_detection.patch b/recipes/lief/all/patches/005_fix_compiler_detection.patch new file mode 100644 index 0000000000000..ba9d025be00ad --- /dev/null +++ b/recipes/lief/all/patches/005_fix_compiler_detection.patch @@ -0,0 +1,26 @@ +--- cmake/LIEFCompilerDetection.cmake ++++ cmake/LIEFCompilerDetection.cmake +@@ -12,13 +12,21 @@ + endif() + + if (cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES) +- set(LIEF_SUPPORT_CXX14 1) ++ if (${MSVC} AND ${MSVC_TOOLSET_VERSION} GREATER_EQUAL 141) ++ set(LIEF_SUPPORT_CXX14 1) ++ elseif(NOT ${MSVC}) ++ set(LIEF_SUPPORT_CXX14 1) ++ endif() + endif() + + if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) +- set(LIEF_SUPPORT_CXX17 1) ++ if (${MSVC} AND ${MSVC_TOOLSET_VERSION} GREATER_EQUAL 142) ++ set(LIEF_SUPPORT_CXX17 1) ++ elseif(NOT ${MSVC}) ++ set(LIEF_SUPPORT_CXX17 1) ++ endif() + endif() + + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/src/compiler_support.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/compiler_support.h" diff --git a/recipes/lief/all/patches/006_fix_binary_cpp.patch b/recipes/lief/all/patches/006_fix_binary_cpp.patch new file mode 100644 index 0000000000000..54bf6ed4544d3 --- /dev/null +++ b/recipes/lief/all/patches/006_fix_binary_cpp.patch @@ -0,0 +1,10 @@ +--- src/ELF/Binary.cpp ++++ src/ELF/Binary.cpp +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "LIEF/DWARF/enums.hpp" + diff --git a/recipes/lief/all/test_package/CMakeLists.txt b/recipes/lief/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..21ece2b1f32cb --- /dev/null +++ b/recipes/lief/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(LIEF REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LIEF::LIEF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +# It is required for gcc 5 +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lief/all/test_package/conanfile.py b/recipes/lief/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5bef6136fec8e --- /dev/null +++ b/recipes/lief/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_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") + arg_path = bin_path + if self.settings.os == "Windows": + arg_path += ".exe" + self.run(f"{bin_path} {arg_path}", env="conanrun") diff --git a/recipes/lief/all/test_package/test_package.cpp b/recipes/lief/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c2566738c9ce0 --- /dev/null +++ b/recipes/lief/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include "LIEF/LIEF.hpp" +#include "LIEF/version.h" + +int main(int argc, char **argv) +{ + if (argc < 2) { + std::cerr << "Need at least one argument\n" << std::endl; + return 1; + } + + std::cout << LIEF_NAME << HUMAN_VERSION << std::endl; + +#if defined(_WIN32) + std::unique_ptr pe = LIEF::PE::Parser::parse(argv[1]); +#elif defined(__linux__) + std::unique_ptr elf = LIEF::ELF::Parser::parse(argv[1]); +#elif defined(__APPLE__) + std::unique_ptr macho = LIEF::MachO::Parser::parse(argv[1]); +#else + #warning "Non efficient test." +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/lief/all/test_v1_package/CMakeLists.txt b/recipes/lief/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/lief/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/lief/all/test_v1_package/conanfile.py b/recipes/lief/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..326a291210aff --- /dev/null +++ b/recipes/lief/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + arg_path = bin_path + if self.settings.os == "Windows": + arg_path += ".exe" + self.run(f"{bin_path} {arg_path}", run_environment=True) diff --git a/recipes/lief/config.yml b/recipes/lief/config.yml new file mode 100644 index 0000000000000..f24eac175f18c --- /dev/null +++ b/recipes/lief/config.yml @@ -0,0 +1,7 @@ +versions: + "0.12.3": + folder: "all" + "0.12.2": + folder: "all" + "0.10.1": + folder: "all" diff --git a/recipes/lightgbm/all/CMakeLists.txt b/recipes/lightgbm/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/lightgbm/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/lightgbm/all/conandata.yml b/recipes/lightgbm/all/conandata.yml new file mode 100644 index 0000000000000..2fac2e54523aa --- /dev/null +++ b/recipes/lightgbm/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "3.3.2": + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v3.3.2.tar.gz" + sha256: "d7c0f842e94165578d5a0c046ca942838d1574149f98c84400ce511239d17b9f" + "3.3.5": + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v3.3.5.tar.gz" + sha256: "16fb9e299ced37be5ac69dd510e7323337e623019c9c578628c43b285f764be7" +patches: + "3.3.2": + - patch_file: "patches/0001-fix-includes.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-openmp-clang.patch" + base_path: "source_subfolder" + "3.3.5": + - patch_file: "patches/0001-fix-includes.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-fix-openmp-clang.patch" + base_path: "source_subfolder" diff --git a/recipes/lightgbm/all/conanfile.py b/recipes/lightgbm/all/conanfile.py new file mode 100644 index 0000000000000..d00e21c352364 --- /dev/null +++ b/recipes/lightgbm/all/conanfile.py @@ -0,0 +1,105 @@ +from conans import CMake, ConanFile, tools +from conan.tools.microsoft import is_msvc +import functools + +required_conan_version = ">=1.33.0" + + +class LightGBMConan(ConanFile): + name = "lightgbm" + description = "A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks." + topics = ("machine-learning", "boosting") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/LightGBM" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake", "cmake_find_package" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openmp": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": True + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("eigen/3.4.0") + self.requires("fast_double_parser/0.6.0") + self.requires("fmt/9.0.0") + if self.options.with_openmp and self.settings.compiler in ("clang", "apple-clang"): + self.requires("llvm-openmp/11.1.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + 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) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_STATIC_LIB"] = not self.options.shared + cmake.definitions["USE_DEBUG"] = self.settings.build_type == "Debug" + cmake.definitions["USE_OPENMP"] = self.options.with_openmp + if self.settings.os == "Macos": + cmake.definitions["APPLE_OUTPUT_DYLIB"] = True + cmake.configure() + return cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LightGBM") + self.cpp_info.set_property("cmake_target_name", "LightGBM::LightGBM") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "LightGBM" + self.cpp_info.names["cmake_find_package_multi"] = "LightGBM" + + self.cpp_info.libs = ["lib_lightgbm"] if is_msvc(self) else ["_lightgbm"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + elif self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") + if not self.options.shared and self.options.with_openmp: + if is_msvc(self): + openmp_flags = ["-openmp"] + elif self.settings.compiler == "gcc": + openmp_flags = ["-fopenmp"] + elif self.settings.compiler in ("clang", "apple-clang"): + openmp_flags = ["-Xpreprocessor", "-fopenmp"] + else: + openmp_flags = [] + self.cpp_info.exelinkflags.extend(openmp_flags) + self.cpp_info.sharedlinkflags.extend(openmp_flags) diff --git a/recipes/lightgbm/all/patches/0001-fix-includes.patch b/recipes/lightgbm/all/patches/0001-fix-includes.patch new file mode 100644 index 0000000000000..13fa0fe43a998 --- /dev/null +++ b/recipes/lightgbm/all/patches/0001-fix-includes.patch @@ -0,0 +1,16 @@ +diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h +index af981062..097f20d4 100644 +--- a/include/LightGBM/utils/common.h ++++ b/include/LightGBM/utils/common.h +@@ -33,9 +33,9 @@ + + #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))) + #define FMT_HEADER_ONLY +-#include "../../../external_libs/fmt/include/fmt/format.h" ++#include + #endif +-#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h" ++#include + + #ifdef _MSC_VER + #include diff --git a/recipes/lightgbm/all/patches/0002-fix-openmp-clang.patch b/recipes/lightgbm/all/patches/0002-fix-openmp-clang.patch new file mode 100644 index 0000000000000..092e8d05ac946 --- /dev/null +++ b/recipes/lightgbm/all/patches/0002-fix-openmp-clang.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 109a252d..e5d46bce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -415,7 +415,7 @@ if(USE_MPI) + endif(USE_MPI) + + if(USE_OPENMP) +- if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") ++ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang") + TARGET_LINK_LIBRARIES(lightgbm OpenMP::OpenMP_CXX) + TARGET_LINK_LIBRARIES(_lightgbm OpenMP::OpenMP_CXX) + endif() diff --git a/recipes/lightgbm/all/patches/0003-fix-openmp-clang.patch b/recipes/lightgbm/all/patches/0003-fix-openmp-clang.patch new file mode 100644 index 0000000000000..0fbe29eced0c4 --- /dev/null +++ b/recipes/lightgbm/all/patches/0003-fix-openmp-clang.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 95610d55..2b48507d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -444,7 +444,7 @@ if(USE_MPI) + endif(USE_MPI) + + if(USE_OPENMP) +- if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") ++ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang") + TARGET_LINK_LIBRARIES(lightgbm OpenMP::OpenMP_CXX) + TARGET_LINK_LIBRARIES(_lightgbm OpenMP::OpenMP_CXX) + endif() diff --git a/recipes/lightgbm/all/test_package/CMakeLists.txt b/recipes/lightgbm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..12b8a397ff5d3 --- /dev/null +++ b/recipes/lightgbm/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(LightGBM CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} LightGBM::LightGBM) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lightgbm/all/test_package/conanfile.py b/recipes/lightgbm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..746d011e4501a --- /dev/null +++ b/recipes/lightgbm/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LightGBMTestConan(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/lightgbm/all/test_package/test_package.cpp b/recipes/lightgbm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..760df80d7067b --- /dev/null +++ b/recipes/lightgbm/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +int main() { + float mat[] = {1, 2, 3, 4, 5, 6}; + DatasetHandle datasetHandle = nullptr; + LGBM_DatasetCreateFromMat(mat, C_API_DTYPE_FLOAT32, 1, 6, 0, "", nullptr, &datasetHandle); + BoosterHandle boosterHandle = nullptr; + LGBM_BoosterCreate(datasetHandle, "", &boosterHandle); + LGBM_BoosterFree(boosterHandle); + LGBM_DatasetFree(datasetHandle); + return 0; +} diff --git a/recipes/lightgbm/config.yml b/recipes/lightgbm/config.yml new file mode 100644 index 0000000000000..185a3ba9f96e0 --- /dev/null +++ b/recipes/lightgbm/config.yml @@ -0,0 +1,5 @@ +versions: + "3.3.2": + folder: all + "3.3.5": + folder: all diff --git a/recipes/lightpcapng/all/CMakeLists.txt b/recipes/lightpcapng/all/CMakeLists.txt new file mode 100644 index 0000000000000..5cfb924ad4de7 --- /dev/null +++ b/recipes/lightpcapng/all/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) + diff --git a/recipes/lightpcapng/all/conandata.yml b/recipes/lightpcapng/all/conandata.yml new file mode 100644 index 0000000000000..7ce2c4d401088 --- /dev/null +++ b/recipes/lightpcapng/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20211005": + url: "https://github.com/Technica-Engineering/LightPcapNg/archive/58b8dd687bd462aba9d6e6d8a46209f0d1236213.zip" + sha256: 3634a2840f7bf43ebb293a9fbdfe0619ab7f233f9f774aac54b058dd5ab1320b diff --git a/recipes/lightpcapng/all/conanfile.py b/recipes/lightpcapng/all/conanfile.py new file mode 100644 index 0000000000000..ea6e74e5ca99f --- /dev/null +++ b/recipes/lightpcapng/all/conanfile.py @@ -0,0 +1,82 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + +class LightPcapNgConan(ConanFile): + name = "lightpcapng" + homepage = "https://github.com/Technica-Engineering/LightPcapNg" + description = "Library for general-purpose tracing based on PCAPNG file format" + topics = ("pcapng", "pcap") + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zstd": True, + } + generators = "cmake", "cmake_paths", "cmake_find_package" + exports_sources = "CMakeLists.txt" + _cmake = None + + @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): + if self.options.with_zstd: + self.options["zstd"].shared = self.options.shared + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_zstd: + self.requires("zstd/1.4.5") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["LIGHT_USE_ZSTD"] = self.options.with_zstd + 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() + cmake.install() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "light_pcapng" + self.cpp_info.names["cmake_find_package_multi"] = "light_pcapng" + self.cpp_info.components["liblight_pcapng"].names["cmake_find_package"] = "light_pcapng" + self.cpp_info.components["liblight_pcapng"].names["cmake_find_package_multi"] = "light_pcapng" + self.cpp_info.components["liblight_pcapng"].libs = ["light_pcapng"] + + if self.options.with_zstd: + self.cpp_info.components["liblight_pcapng"].requires = ["zstd::zstd"] + diff --git a/recipes/lightpcapng/all/test_package/CMakeLists.txt b/recipes/lightpcapng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8927c32d3f4ef --- /dev/null +++ b/recipes/lightpcapng/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(light_pcapng REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} light_pcapng::light_pcapng) diff --git a/recipes/lightpcapng/all/test_package/conanfile.py b/recipes/lightpcapng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3da371b660e0a --- /dev/null +++ b/recipes/lightpcapng/all/test_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" + + 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/lightpcapng/all/test_package/test_package.c b/recipes/lightpcapng/all/test_package/test_package.c new file mode 100644 index 0000000000000..5a7fa763b3c1f --- /dev/null +++ b/recipes/lightpcapng/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include "light_pcapng_ext.h" + +int main(void) { + const char* outfile = "conan_test.pcapng"; + light_pcapng writer = light_pcapng_open(outfile, "wb"); + light_pcapng_close(writer); + return EXIT_SUCCESS; +} + diff --git a/recipes/lightpcapng/config.yml b/recipes/lightpcapng/config.yml new file mode 100644 index 0000000000000..627e5733a23f8 --- /dev/null +++ b/recipes/lightpcapng/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211005": + folder: "all" diff --git a/recipes/linmath.h/all/conandata.yml b/recipes/linmath.h/all/conandata.yml new file mode 100644 index 0000000000000..c521734fe3fb8 --- /dev/null +++ b/recipes/linmath.h/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220619": + url: "https://github.com/datenwolf/linmath.h/archive/3eef82841046507e16a0f6194a61cee2eadd34b3.tar.gz" + sha256: "786c3f9c5e415cc1607d377242759eca736ea1002dcf6312a7f6ae08bc3d6e87" diff --git a/recipes/linmath.h/all/conanfile.py b/recipes/linmath.h/all/conanfile.py new file mode 100644 index 0000000000000..72dbc48e507a8 --- /dev/null +++ b/recipes/linmath.h/all/conanfile.py @@ -0,0 +1,41 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class LinmathConan(ConanFile): + name = "linmath.h" + description = ( + "A lean linear math library, aimed at graphics programming. Supports " + "vec3, vec4, mat4x4 and quaternions" + ) + license = "WTFPL" + topics = ("math", "graphics", "linear-algebra", "vector", "matrix", "quaternion") + homepage = "https://github.com/datenwolf/linmath.h" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENCE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "linmath.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/linmath.h/all/test_package/CMakeLists.txt b/recipes/linmath.h/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5ff54df0112b2 --- /dev/null +++ b/recipes/linmath.h/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(linmath.h REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE linmath.h::linmath.h) diff --git a/recipes/linmath.h/all/test_package/conanfile.py b/recipes/linmath.h/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/linmath.h/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/linmath.h/all/test_package/test_package.c b/recipes/linmath.h/all/test_package/test_package.c new file mode 100644 index 0000000000000..1f59cf9ccad91 --- /dev/null +++ b/recipes/linmath.h/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + quat q; + quat_identity(q); + return 0; +} diff --git a/recipes/linmath.h/all/test_v1_package/CMakeLists.txt b/recipes/linmath.h/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/linmath.h/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/linmath.h/all/test_v1_package/conanfile.py b/recipes/linmath.h/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/linmath.h/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/linmath.h/config.yml b/recipes/linmath.h/config.yml new file mode 100644 index 0000000000000..5d463c9509aed --- /dev/null +++ b/recipes/linmath.h/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220619": + folder: all diff --git a/recipes/linux-headers-generic/all/conandata.yml b/recipes/linux-headers-generic/all/conandata.yml new file mode 100644 index 0000000000000..ecc5fdb03690f --- /dev/null +++ b/recipes/linux-headers-generic/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "5.14.9": + url: "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.9.tar.gz" + sha256: "b5cd37e6d193c8f6a98e41ce6f9d97260d178e0a3cfc43d7ff684f67c6c25f29" + "5.13.9": + url: "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.13.9.tar.gz" + sha256: "cc82e4461d5f759c820b74079164450d1f1ad09def9f3356a58814abd0268787" diff --git a/recipes/linux-headers-generic/all/conanfile.py b/recipes/linux-headers-generic/all/conanfile.py new file mode 100644 index 0000000000000..32a14abb318da --- /dev/null +++ b/recipes/linux-headers-generic/all/conanfile.py @@ -0,0 +1,43 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class LinuxHeadersGenericConan(ConanFile): + name = "linux-headers-generic" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.kernel.org/" + license = "GPL-2.0-only" + description = "Generic Linux kernel headers" + topics = ("linux", "headers", "generic") + settings = "os", "arch", "build_type", "compiler" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + del self.info.settings.os + del self.info.settings.build_type + del self.info.settings.compiler + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("linux-headers-generic supports only Linux") + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("linux-headers-generic can not be cross-compiled") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + with tools.chdir(os.path.join(self._source_subfolder)): + autotools = AutoToolsBuildEnvironment(self) + autotools.make(target="headers") + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + self.copy("include/*.h", src=os.path.join(self._source_subfolder, "usr")) diff --git a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/linux-headers-generic/all/test_package/conanfile.py b/recipes/linux-headers-generic/all/test_package/conanfile.py new file mode 100644 index 0000000000000..92074169bcc74 --- /dev/null +++ b/recipes/linux-headers-generic/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + +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/linux-headers-generic/all/test_package/test_package.c b/recipes/linux-headers-generic/all/test_package/test_package.c new file mode 100644 index 0000000000000..91fa42aac7003 --- /dev/null +++ b/recipes/linux-headers-generic/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "linux/gpio.h" +#include "linux/fs.h" +#include "linux/dma-buf.h" +#include "linux/io_uring.h" + +int main() { + return 0; +} diff --git a/recipes/linux-headers-generic/config.yml b/recipes/linux-headers-generic/config.yml new file mode 100644 index 0000000000000..a8d9d5e7bbfa8 --- /dev/null +++ b/recipes/linux-headers-generic/config.yml @@ -0,0 +1,5 @@ +versions: + "5.14.9": + folder: all + "5.13.9": + folder: all diff --git a/recipes/linux-syscall-support/all/conandata.yml b/recipes/linux-syscall-support/all/conandata.yml new file mode 100644 index 0000000000000..e2cbe519dc5b7 --- /dev/null +++ b/recipes/linux-syscall-support/all/conandata.yml @@ -0,0 +1,3 @@ +sources: + "cci.20200813": + url: "https://chromium.googlesource.com/linux-syscall-support/+archive/29f7c7e018f4ce706a709f0b0afbf8bacf869480.tar.gz" diff --git a/recipes/linux-syscall-support/all/conanfile.py b/recipes/linux-syscall-support/all/conanfile.py new file mode 100644 index 0000000000000..4f6891e057476 --- /dev/null +++ b/recipes/linux-syscall-support/all/conanfile.py @@ -0,0 +1,49 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.50.0" + + +class LinuxSyscallSupportConan(ConanFile): + name = "linux-syscall-support" + description = "Linux Syscall Support provides a header file that can be included into your application whenever you need to make direct system calls." + license = "BSD-3-Clause" + topics = ("linux", "syscall", "chromium") + homepage = "https://chromium.googlesource.com/linux-syscall-support" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "header-library" + settings = "os" + no_copy_source = True + + def configure(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("{} supported only on Linux".format(self.name)) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def package_id(self): + self.info.clear() + + def _extract_license(self): + with open(os.path.join(self.source_folder, "linux_syscall_support.h")) as f: + content_lines = f.readlines() + license_content = [] + for i in range(0, 29): + license_content.append(content_lines[i][3:-1]) + return "\n".join(license_content) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + copy(self, "linux_syscall_support.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/linux-syscall-support/all/test_package/CMakeLists.txt b/recipes/linux-syscall-support/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d0ccff7dbe735 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(linux-syscall-support REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE linux-syscall-support::linux-syscall-support) diff --git a/recipes/linux-syscall-support/all/test_package/conanfile.py b/recipes/linux-syscall-support/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/linux-syscall-support/all/test_package/test_package.c b/recipes/linux-syscall-support/all/test_package/test_package.c new file mode 100644 index 0000000000000..876ec71259465 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include "linux_syscall_support.h" + +#define BUFFER_SIZE 256 + +int main() +{ + char buffer[BUFFER_SIZE]; + memset(buffer, 0, BUFFER_SIZE); + int buffer_contains_all_zeros = 0; + const ssize_t r = sys_getrandom(buffer, BUFFER_SIZE, 0); + return 0; +} diff --git a/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt b/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..961b416af6b07 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/linux-syscall-support/all/test_v1_package/conanfile.py b/recipes/linux-syscall-support/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/linux-syscall-support/config.yml b/recipes/linux-syscall-support/config.yml new file mode 100644 index 0000000000000..701f50987ccf0 --- /dev/null +++ b/recipes/linux-syscall-support/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200813": + folder: all diff --git a/recipes/liquid-dsp/all/conandata.yml b/recipes/liquid-dsp/all/conandata.yml new file mode 100644 index 0000000000000..23e1bf444316a --- /dev/null +++ b/recipes/liquid-dsp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.3.2": + url: "https://github.com/jgaeddert/liquid-dsp/archive/refs/tags/v1.3.2.tar.gz" + sha256: "85093624EF9CB90EAD64C836D2F42690197EDACE1A86257D6524C4E4DC870483" +patches: + "1.3.2": + - patch_file: "patches/1.3.2/0001-Remove-headers-check.patch" + base_path: "source_subfolder" diff --git a/recipes/liquid-dsp/all/conanfile.py b/recipes/liquid-dsp/all/conanfile.py new file mode 100644 index 0000000000000..26e149f068f7a --- /dev/null +++ b/recipes/liquid-dsp/all/conanfile.py @@ -0,0 +1,186 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from contextlib import contextmanager +import os + +required_conan_version = ">=1.33.0" + +class LiquidDspConan(ConanFile): + name = "liquid-dsp" + description = ( + "Digital signal processing library for software-defined radios (and more)" + ) + topics = ("dsp", "sdr", "liquid-dsp") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jgaeddert/liquid-dsp" + license = ("MIT",) + settings = "os", "arch", "build_type", "compiler" + exports_sources = ["generate_link_library.bat"] + options = { + "shared": [True, False], + "simdoverride": [True, False], + } + default_options = { + "shared": False, + "simdoverride": False, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _libname(self): + if self.settings.os == "Windows": + return "libliquid" + return "liquid" + + @property + def _target_name(self): + if self.settings.os == "Macos": + if not self.options.shared: + return "libliquid.ar" + return "libliquid.dylib" + if not self.options.shared: + return "libliquid.a" + return "libliquid.so" + + @property + def _lib_pattern(self): + if self.settings.os == "Macos" and not self.options.shared: + return "libliquid.a" + if self.settings.os != "Windows": + return self._target_name + return "libliquid.lib" + + def configure(self): + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + if self.settings.compiler == "Visual Studio": + self.build_requires("mingw-w64/8.1") + self.build_requires("automake/1.16.4") + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome") + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + destination=self._source_subfolder, + strip_root=True, + ) + + def _patch_sources(self): + if self.settings.os == "Windows": + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def _gen_link_library(self): + if self.settings.compiler != "Visual Studio" or (not self.options.shared): + return + self.run("cmd /c generate_link_library.bat") + with tools.chdir(self._source_subfolder): + self.run( + "{} /def:libliquid.def /out:libliquid.lib /machine:{}".format( + os.getenv("AR"), "X86" if self.settings.arch == "x86" else "X64" + ), + win_bash=tools.os_info.is_windows, + ) + + def _rename_libraries(self): + with tools.chdir(self._source_subfolder): + if self.settings.os == "Windows" and self.options.shared: + tools.rename("libliquid.so", "libliquid.dll") + elif self.settings.os == "Windows" and not self.options.shared: + tools.rename("libliquid.a", "libliquid.lib") + elif self.settings.os == "Macos" and not self.options.shared: + tools.rename("libliquid.ar", "libliquid.a") + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + env = { + "CC": "gcc", + "CXX": "g++", + "LD": "ld", + "AR": "ar", + } + with tools.environment_append(env): + yield + else: + yield + + @contextmanager + def _msvc_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + env = { + "CC": "cl -nologo", + "CXX": "cl -nologo", + "AR": "lib", + "LD": "link", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + self._patch_sources() + ncpus = tools.cpu_count() + configure_args = [] + cflags = ["-static-libgcc"] + if self.settings.build_type == "Debug": + configure_args.append("--enable-debug-messages") + cflags.extend(["-g", "-O0"]) + else: + cflags.extend(["-s", "-O2", "-DNDEBUG"]) + if self.options.simdoverride: + configure_args.append("--enable-simdoverride") + if self.settings.compiler == "Visual Studio": + configure_args.append("CFLAGS='{}'".format(" ".join(cflags))) + configure_args_str = " ".join(configure_args) + with self._build_context(): + with tools.chdir(self._source_subfolder): + self.run("./bootstrap.sh", win_bash=tools.os_info.is_windows) + self.run( + "./configure {}".format(configure_args_str), + win_bash=tools.os_info.is_windows, + ) + self.run( + "make {} -j{}".format(self._target_name, ncpus), + win_bash=tools.os_info.is_windows, + ) + self._rename_libraries() + with self._msvc_context(): + self._gen_link_library() + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy( + pattern="liquid.h", + dst=os.path.join("include", "liquid"), + src=os.path.join(self._source_subfolder, "include"), + ) + self.copy(pattern="libliquid.dll", dst="bin", src=self._source_subfolder) + self.copy(pattern=self._lib_pattern, dst="lib", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = [self._libname] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") diff --git a/recipes/liquid-dsp/all/generate_link_library.bat b/recipes/liquid-dsp/all/generate_link_library.bat new file mode 100644 index 0000000000000..fb20541a4c46c --- /dev/null +++ b/recipes/liquid-dsp/all/generate_link_library.bat @@ -0,0 +1,4 @@ +@echo off +echo Generating link library for MSVC... +echo EXPORTS >> source_subfolder\libliquid.def +for /f "skip=19 tokens=4" %%A in ('%LD% /dump /EXPORTS source_subfolder\libliquid.dll') do echo %%A >> source_subfolder\libliquid.def diff --git a/recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch b/recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch new file mode 100644 index 0000000000000..ad10a374ed0d9 --- /dev/null +++ b/recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch @@ -0,0 +1,37 @@ +From 8a99b1c6853193c1f518bc81b705d7094225e114 Mon Sep 17 00:00:00 2001 +From: Rui Oliveira +Date: Fri, 18 Jun 2021 09:37:46 +0100 +Subject: [PATCH] Remove headers check + +--- + configure.ac | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index e6bc297e..5b591c87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -81,20 +81,12 @@ AC_FUNC_ERROR_AT_LINE + AC_FUNC_MALLOC + AC_FUNC_REALLOC + +-# AC_CHECK_LIB (library, function, [action-if-found], [action-if-not-found], [other-libraries]) +-AC_CHECK_LIB([c],[main],[],[AC_MSG_ERROR(Could not use standard C library)], []) +-AC_CHECK_LIB([m],[main],[],[AC_MSG_ERROR(Could not use standard math library)],[]) +- + # AC_CHECK_FUNC(function, [action-if-found], [action-if-not-found]) + AC_CHECK_FUNCS([malloc realloc free memset memmove],[], + [AC_MSG_ERROR(Could not use memory allocation functions)]) + AC_CHECK_FUNCS([sinf cosf expf cargf cexpf crealf cimagf sqrtf],[], + [AC_MSG_ERROR(Could not use special math functions)],) + +-# Check for necessary header files +-AC_CHECK_HEADERS([stdio.h stdlib.h complex.h string.h getopt.h sys/resource.h float.h inttypes.h limits.h stdlib.h string.h unistd.h],[], +- [AC_MSG_ERROR(Could not use standard headers)]) +- + # Check for optional header files, libraries, programs + AC_CHECK_HEADERS(fec.h fftw3.h) + AC_CHECK_LIB([fftw3f], [fftwf_plan_dft_1d], [], +-- +2.32.0.windows.1 + diff --git a/recipes/liquid-dsp/all/test_package/CMakeLists.txt b/recipes/liquid-dsp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2859677acfc5b --- /dev/null +++ b/recipes/liquid-dsp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/liquid-dsp/all/test_package/conanfile.py b/recipes/liquid-dsp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/liquid-dsp/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/liquid-dsp/all/test_package/test_package.cpp b/recipes/liquid-dsp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4df4fdf1a1f16 --- /dev/null +++ b/recipes/liquid-dsp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "liquid/liquid.h" + +#include + +int main(int argc, char **argv) +{ + std::cout << liquid_libversion(); + return 0; +} diff --git a/recipes/liquid-dsp/config.yml b/recipes/liquid-dsp/config.yml new file mode 100644 index 0000000000000..906e859d7afd8 --- /dev/null +++ b/recipes/liquid-dsp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.2": + folder: "all" diff --git a/recipes/litehtml/all/conandata.yml b/recipes/litehtml/all/conandata.yml new file mode 100644 index 0000000000000..db5e01516c1d0 --- /dev/null +++ b/recipes/litehtml/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20211028": + url: "https://github.com/litehtml/litehtml/archive/b095539f8dc5a723c2226b353e6815423b36e0c8.tar.gz" + sha256: "c3795594fabeb060e21b9128ff22051986b393bd0b4e6000a5e171c71cabe224" +patches: + "cci.20211028": + - patch_file: "patches/0001-icu.patch" diff --git a/recipes/litehtml/all/conanfile.py b/recipes/litehtml/all/conanfile.py new file mode 100644 index 0000000000000..c3158edb62025 --- /dev/null +++ b/recipes/litehtml/all/conanfile.py @@ -0,0 +1,141 @@ +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, save +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class LitehtmlConan(ConanFile): + name = "litehtml" + description = "litehtml is the lightweight HTML rendering engine with CSS2/CSS3 support." + license = "BSD-3-Clause" + topics = ("render engine", "html", "parser") + homepage = "https://github.com/litehtml/litehtml" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "utf8": [True, False], + "with_icu": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "utf8": False, + "with_icu": False, + } + + @property + def _with_xxd(self): + # FIXME: create conan recipe for xxd, and use it unconditionally (returning False means cross build doesn't work) + return self.settings.os != "Windows" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # FIXME: add gumbo requirement (it is vendored right now) + if self.options.with_icu: + self.requires("icu/72.1") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.info.options.shared and is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") + + def build_requirements(self): + # FIXME: add unconditional xxd build requirement + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["LITEHTML_UTF8"] = self.options.utf8 + tc.variables["USE_ICU"] = self.options.with_icu + tc.variables["EXTERNAL_GUMBO"] = False # FIXME: add cci recipe, and use it unconditionally (option value should be True) + tc.variables["EXTERNAL_XXD"] = self._with_xxd # FIXME: should be True unconditionally + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "litehtml": "litehtml::litehtml", + "gumbo": "litehtml::gumbo", + } + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "litehtml") + self.cpp_info.set_property("cmake_target_name", "litehtml") + + self.cpp_info.components["litehtml_litehtml"].set_property("cmake_target_name", "litehtml") + self.cpp_info.components["litehtml_litehtml"].libs = ["litehtml"] + self.cpp_info.components["litehtml_litehtml"].requires = ["gumbo"] + if self.options.with_icu: + self.cpp_info.components["litehtml_litehtml"].requires.append("icu::icu") + + if True: # FIXME: remove once we use a vendored gumbo library + self.cpp_info.components["gumbo"].set_property("cmake_target_name", "gumbo") + self.cpp_info.components["gumbo"].libs = ["gumbo"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["litehtml_litehtml"].names["cmake_find_package"] = "litehtml" + self.cpp_info.components["litehtml_litehtml"].names["cmake_find_package_multi"] = "litehtml" + self.cpp_info.components["litehtml_litehtml"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["litehtml_litehtml"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if True: + self.cpp_info.components["gumbo"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["gumbo"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/litehtml/all/patches/0001-icu.patch b/recipes/litehtml/all/patches/0001-icu.patch new file mode 100644 index 0000000000000..1e3ee0090b33d --- /dev/null +++ b/recipes/litehtml/all/patches/0001-icu.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20bd474232d734ca30f3e690de6d94fc498bbbc0..9c56fd35d3d332915a5adef83626e5a5a41df1a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -159,8 +159,9 @@ endif() + # ICU + option(USE_ICU "Use ICU to locate word boundaries in text elements" OFF) + if (USE_ICU) ++ find_package(ICU COMPONENTS i18n uc data) + target_compile_definitions(${PROJECT_NAME} PUBLIC USE_ICU) +- target_link_libraries(${PROJECT_NAME} PUBLIC icui18n icuuc icudata) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ICU::i18n ICU::uc ICU::data) + endif() + + # Gumbo diff --git a/recipes/litehtml/all/test_package/CMakeLists.txt b/recipes/litehtml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..01d00c41e24f2 --- /dev/null +++ b/recipes/litehtml/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(litehtml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE litehtml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/litehtml/all/test_package/conanfile.py b/recipes/litehtml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/litehtml/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/litehtml/all/test_package/test_package.cpp b/recipes/litehtml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cce35fe42eaa9 --- /dev/null +++ b/recipes/litehtml/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "litehtml/litehtml.h" +#include "litehtml/tstring_view.h" + +#include + +int main() { + constexpr size_t offset = 5; + constexpr size_t length = 10; + + litehtml::tstring string = _t("the quick brown fox jumps over the lazy dog"); + litehtml::tstring_view view(string.data() + offset, length); + + for (auto c : view) { + std::cout << c << std::endl; + } + return 0; +} diff --git a/recipes/litehtml/all/test_v1_package/CMakeLists.txt b/recipes/litehtml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/litehtml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/litehtml/all/test_v1_package/conanfile.py b/recipes/litehtml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/litehtml/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/litehtml/config.yml b/recipes/litehtml/config.yml new file mode 100644 index 0000000000000..6a05e08e87321 --- /dev/null +++ b/recipes/litehtml/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211028": + folder: all diff --git a/recipes/llhttp/all/CMakeLists.txt b/recipes/llhttp/all/CMakeLists.txt new file mode 100644 index 0000000000000..881b1cb39250b --- /dev/null +++ b/recipes/llhttp/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory(source_subfolder) diff --git a/recipes/llhttp/all/conandata.yml b/recipes/llhttp/all/conandata.yml new file mode 100644 index 0000000000000..c2671d44c5a50 --- /dev/null +++ b/recipes/llhttp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "6.0.6": + url: https://github.com/nodejs/llhttp/archive/refs/tags/release/v6.0.6.tar.gz + sha256: "14023d0efce07a996a197d3b6b15020b26526605277e521f5aa10dacc3af67ad" +patches: + "6.0.6": + - patch_file: "patches/cmake_install_dirs.patch" + base_path: "source_subfolder" diff --git a/recipes/llhttp/all/conanfile.py b/recipes/llhttp/all/conanfile.py new file mode 100644 index 0000000000000..df6177221446b --- /dev/null +++ b/recipes/llhttp/all/conanfile.py @@ -0,0 +1,87 @@ +from conans import ConanFile, tools, CMake +from conan.tools.files import patch +import os + +required_conan_version = ">=1.43.0" + + +class LlhttpParserConan(ConanFile): + name = "llhttp" + description = "http request/response parser for c " + topics = ("http", "parser") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nodejs/llhttp" + license = ("MIT",) + generators = ("cmake",) + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports_sources = "CMakeLists.txt", "patches/*" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + destination=self._source_subfolder, + strip_root=True, + ) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy( + "LICENSE-MIT", + src=os.path.join(self.source_folder, self._source_subfolder), + dst="licenses", + ) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "llhttp") + self.cpp_info.set_property("cmake_target_name", "llhttp::llhttp") + self.cpp_info.set_property("pkg_config_name", "libllhttp") + self.cpp_info.libs = ["llhttp"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "llhttp" + self.cpp_info.names["cmake_find_package_multi"] = "llhttp" + self.cpp_info.names["pkg_config"] = "libllhttp" diff --git a/recipes/llhttp/all/patches/cmake_install_dirs.patch b/recipes/llhttp/all/patches/cmake_install_dirs.patch new file mode 100644 index 0000000000000..6119c7509e39e --- /dev/null +++ b/recipes/llhttp/all/patches/cmake_install_dirs.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +40,8 @@ set_target_properties(llhttp PROPERTIES PUBLIC_HEADER ${LLHTTP_HEADERS}) + install(TARGETS llhttp + EXPORT llhttp + ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include/ + ) + diff --git a/recipes/llhttp/all/test_package/CMakeLists.txt b/recipes/llhttp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e55d928fc7b95 --- /dev/null +++ b/recipes/llhttp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(llhttp REQUIRED CONFIG) + + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} llhttp::llhttp) diff --git a/recipes/llhttp/all/test_package/conanfile.py b/recipes/llhttp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/llhttp/all/test_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/llhttp/all/test_package/test_package.c b/recipes/llhttp/all/test_package/test_package.c new file mode 100644 index 0000000000000..4d16a6691ce5e --- /dev/null +++ b/recipes/llhttp/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include + +#include + +int main() +{ + unsigned major = LLHTTP_VERSION_MAJOR; + unsigned minor = LLHTTP_VERSION_MINOR; + unsigned patch = LLHTTP_VERSION_PATCH; + printf("llhttp v%u.%u.%u\n", major, minor, patch); + printf("Sample function call: " + "llhttp_method_name(llhttp_method::HTTP_GET) = \"%s\"...\n", + llhttp_method_name(HTTP_GET) ); + + return 0; +} diff --git a/recipes/llhttp/config.yml b/recipes/llhttp/config.yml new file mode 100644 index 0000000000000..158212133c56d --- /dev/null +++ b/recipes/llhttp/config.yml @@ -0,0 +1,3 @@ +versions: + "6.0.6": + folder: all diff --git a/recipes/llvm-core/all/CMakeLists.txt b/recipes/llvm-core/all/CMakeLists.txt new file mode 100644 index 0000000000000..e88dcfa953495 --- /dev/null +++ b/recipes/llvm-core/all/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13.4) +project(conanllvm) + +include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +if(LLVM_ENABLE_ZLIB) + find_package(ZLIB QUIET) + + # The FindZLIB find module provided by CMake behaves differently than the FindZLIB.cmake script generated by CONAN. + # So the following two lines fill in the needed properties. + list(GET ZLIB_LIBRARIES 0 ZLIB_LIBRARY) + set_property(TARGET ZLIB::ZLIB PROPERTY LOCATION "${ZLIB_LIBRARY}") + + # Additionally LLVM 11.1.0 requires the zlib lib dir to be in the library path. + # This is not needed for later versions and can be removed once + # LLVM-12 becomes the oldest supported version. + if(UNIX) + set(ENV{LIBRARY_PATH} "${CONAN_LIB_DIRS_ZLIB}:$ENV{LIBRARY_PATH}") + elseif(WIN32) + file(TO_NATIVE_PATH "${CONAN_LIB_DIRS_ZLIB}" WINDOWS_ZLIB_PATH) + string(APPEND CMAKE_EXE_LINKER_FLAGS " /LIBPATH:${WINDOWS_ZLIB_PATH}") + endif() +endif() + +add_subdirectory("source") diff --git a/recipes/llvm-core/all/conandata.yml b/recipes/llvm-core/all/conandata.yml new file mode 100644 index 0000000000000..331f5f3a1903f --- /dev/null +++ b/recipes/llvm-core/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "13.0.0": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz + sha256: 408d11708643ea826f519ff79761fcdfc12d641a2510229eec459e72f8163020 + "12.0.0": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/llvm-12.0.0.src.tar.xz + sha256: 49dc47c8697a1a0abd4ee51629a696d7bfe803662f2a7252a3b16fc75f3a8b50 + "11.1.0": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/llvm-11.1.0.src.tar.xz + sha256: ce8508e318a01a63d4e8b3090ab2ded3c598a50258cc49e2625b9120d4c03ea5 + +patches: + "11.1.0": + - base_path: "source" + patch_file: "patches/11x/11.1.0-cmake.patch" + - base_path: "source" + patch_file: "patches/11x/11.1.0-native.patch" + "12.0.0": + - base_path: "source" + patch_file: "patches/12x/12.0.0-cmake.patch" + - base_path: "source" + patch_file: "patches/12x/12.0.0-native.patch" + "13.0.0": + - base_path: "source" + patch_file: "patches/13x/13.0.0-cmake.patch" + - base_path: "source" + patch_file: "patches/13x/13.0.0-native.patch" diff --git a/recipes/llvm-core/all/conanfile.py b/recipes/llvm-core/all/conanfile.py new file mode 100644 index 0000000000000..263cb7360506c --- /dev/null +++ b/recipes/llvm-core/all/conanfile.py @@ -0,0 +1,429 @@ +from conan.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.files import apply_conandata_patches, chdir, collect_libs, get, load, rename, replace_in_file, rm, rmdir, save +from conan.tools.scm import Version +from conans import CMake +from collections import defaultdict +import json +import re +import os.path +import os +import textwrap + +required_conan_version = ">=1.50.2" # Due to conan.tools.scm.Version + + +class LLVMCoreConan(ConanFile): + name = 'llvm-core' + description = ( + 'A toolkit for the construction of highly optimized compilers,' + 'optimizers, and runtime environments.' + ) + license = 'Apache-2.0 WITH LLVM-exception' + topics = ('llvm', 'compiler') + homepage = 'https://llvm.org' + url = 'https://github.com/conan-io/conan-center-index' + + settings = ('os', 'arch', 'compiler', 'build_type') + options = { + 'shared': [True, False], + 'fPIC': [True, False], + 'components': 'ANY', + 'targets': 'ANY', + 'exceptions': [True, False], + 'rtti': [True, False], + 'threads': [True, False], + 'lto': ['On', 'Off', 'Full', 'Thin'], + 'static_stdlib': [True, False], + 'unwind_tables': [True, False], + 'expensive_checks': [True, False], + 'use_perf': [True, False], + 'use_sanitizer': [ + 'Address', + 'Memory', + 'MemoryWithOrigins', + 'Undefined', + 'Thread', + 'DataFlow', + 'Address;Undefined', + 'None' + ], + 'with_ffi': [True, False], + 'with_zlib': [True, False], + 'with_xml2': [True, False], + 'use_llvm_cmake_files': [True, False], + } + default_options = { + 'shared': False, + 'fPIC': True, + 'components': 'all', + 'targets': 'all', + 'exceptions': True, + 'rtti': True, + 'threads': True, + 'lto': 'Off', + 'static_stdlib': False, + 'unwind_tables': True, + 'expensive_checks': False, + 'use_perf': False, + 'use_sanitizer': 'None', + 'with_ffi': False, + 'with_zlib': True, + 'with_xml2': True, + 'use_llvm_cmake_files': False, + } + + # Older cmake versions may have issues generating the graphviz output used + # to model the components + build_requires = [ + 'cmake/3.20.5' + ] + + generators = 'cmake', 'cmake_find_package' + no_copy_source = True + short_paths = True + + @property + def _source_subfolder(self): + return 'source' + + def _supports_compiler(self): + compiler = self.settings.compiler.value + version = Version(self.settings.compiler.version) + major_rev, minor_rev = version.major, (version.minor or 0) + + unsupported_combinations = [ + [compiler == 'gcc', major_rev == 5, minor_rev < 1], + [compiler == 'gcc', major_rev < 5], + [compiler == 'clang', major_rev < 4], + [compiler == 'apple-clang', major_rev < 9], + [compiler == 'Visual Studio', major_rev < 15] + ] + if any(all(combination) for combination in unsupported_combinations): + message = 'unsupported compiler: "{}", version "{}"' + raise ConanInvalidConfiguration(message.format(compiler, version)) + + def _patch_sources(self): + apply_conandata_patches(self) + + def _patch_build(self): + if os.path.exists('FindIconv.cmake'): + replace_in_file(self, 'FindIconv.cmake', 'iconv charset', 'iconv') + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions['BUILD_SHARED_LIBS'] = False + cmake.definitions['CMAKE_SKIP_RPATH'] = True + cmake.definitions['CMAKE_POSITION_INDEPENDENT_CODE'] = \ + self.options.get_safe('fPIC', default=False) or self.options.shared + + if not self.options.shared: + cmake.definitions['DISABLE_LLVM_LINK_LLVM_DYLIB'] = True + # cmake.definitions['LLVM_LINK_DYLIB'] = self.options.shared + + cmake.definitions['LLVM_TARGET_ARCH'] = 'host' + cmake.definitions['LLVM_TARGETS_TO_BUILD'] = self.options.targets + cmake.definitions['LLVM_BUILD_LLVM_DYLIB'] = self.options.shared + cmake.definitions['LLVM_DYLIB_COMPONENTS'] = self.options.components + cmake.definitions['LLVM_ENABLE_PIC'] = \ + self.options.get_safe('fPIC', default=False) + + if self.settings.compiler == 'Visual Studio': + build_type = str(self.settings.build_type).upper() + cmake.definitions['LLVM_USE_CRT_{}'.format(build_type)] = \ + self.settings.compiler.runtime + + cmake.definitions['LLVM_ABI_BREAKING_CHECKS'] = 'WITH_ASSERTS' + cmake.definitions['LLVM_ENABLE_WARNINGS'] = True + cmake.definitions['LLVM_ENABLE_PEDANTIC'] = True + cmake.definitions['LLVM_ENABLE_WERROR'] = False + + cmake.definitions['LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN'] = True + cmake.definitions['LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO'] = False + cmake.definitions['LLVM_BUILD_INSTRUMENTED_COVERAGE'] = False + cmake.definitions['LLVM_OPTIMIZED_TABLEGEN'] = True + cmake.definitions['LLVM_REVERSE_ITERATION'] = False + cmake.definitions['LLVM_ENABLE_BINDINGS'] = False + cmake.definitions['LLVM_CCACHE_BUILD'] = False + + cmake.definitions['LLVM_INCLUDE_TOOLS'] = self.options.shared + cmake.definitions['LLVM_INCLUDE_EXAMPLES'] = False + cmake.definitions['LLVM_INCLUDE_TESTS'] = False + cmake.definitions['LLVM_INCLUDE_BENCHMARKS'] = False + cmake.definitions['LLVM_APPEND_VC_REV'] = False + cmake.definitions['LLVM_BUILD_DOCS'] = False + cmake.definitions['LLVM_ENABLE_IDE'] = False + cmake.definitions['LLVM_ENABLE_TERMINFO'] = False + + cmake.definitions['LLVM_ENABLE_EH'] = self.options.exceptions + cmake.definitions['LLVM_ENABLE_RTTI'] = self.options.rtti + cmake.definitions['LLVM_ENABLE_THREADS'] = self.options.threads + cmake.definitions['LLVM_ENABLE_LTO'] = self.options.lto + cmake.definitions['LLVM_STATIC_LINK_CXX_STDLIB'] = \ + self.options.static_stdlib + cmake.definitions['LLVM_ENABLE_UNWIND_TABLES'] = \ + self.options.unwind_tables + cmake.definitions['LLVM_ENABLE_EXPENSIVE_CHECKS'] = \ + self.options.expensive_checks + cmake.definitions['LLVM_ENABLE_ASSERTIONS'] = \ + self.settings.build_type == 'Debug' + + cmake.definitions['LLVM_USE_NEWPM'] = False + cmake.definitions['LLVM_USE_OPROFILE'] = False + cmake.definitions['LLVM_USE_PERF'] = self.options.use_perf + if self.options.use_sanitizer == 'None': + cmake.definitions['LLVM_USE_SANITIZER'] = '' + else: + cmake.definitions['LLVM_USE_SANITIZER'] = \ + self.options.use_sanitizer + + cmake.definitions['LLVM_ENABLE_Z3_SOLVER'] = False + cmake.definitions['LLVM_ENABLE_LIBPFM'] = False + cmake.definitions['LLVM_ENABLE_LIBEDIT'] = False + cmake.definitions['LLVM_ENABLE_FFI'] = self.options.with_ffi + cmake.definitions['LLVM_ENABLE_ZLIB'] = "FORCE_ON" if \ + self.options.get_safe('with_zlib', False) else False + cmake.definitions['LLVM_ENABLE_LIBXML2'] = \ + self.options.get_safe('with_xml2', False) + return cmake + + 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 + del self.options.with_xml2 + + def requirements(self): + if self.options.with_ffi: + self.requires('libffi/3.3') + if self.options.get_safe('with_zlib', False): + self.requires('zlib/1.2.12') + if self.options.get_safe('with_xml2', False): + self.requires('libxml2/2.9.10') + + def package_id(self): + del self.info.options.use_llvm_cmake_files + + def validate(self): + if self.options.shared: # Shared builds disabled just due to the CI + message = 'Shared builds not currently supported' + raise ConanInvalidConfiguration(message) + # del self.options.fPIC + # if self.settings.os == 'Windows' and self.options.shared: + # message = 'Shared builds not supported on Windows' + # raise ConanInvalidConfiguration(message) + if self.options.exceptions and not self.options.rtti: + message = 'Cannot enable exceptions without rtti support' + raise ConanInvalidConfiguration(message) + self._supports_compiler() + if cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration('Cross-building not implemented') + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=self._source_subfolder) + self._patch_sources() + + def build(self): + self._patch_build() + cmake = self._configure_cmake() + cmake.configure() + cmake.build() + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake", "llvm") + + @property + def _alias_module_file_rel_path(self): + return os.path.join(self._module_subfolder, "conan-official-{}-targets.cmake".format(self.name)) + + @property + def _old_alias_module_file_rel_path(self): + return os.path.join(self._module_subfolder, "conan-official-{}-old-targets.cmake".format(self.name)) + + 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) + + def package(self): + self.copy('LICENSE.TXT', dst='licenses', src=self._source_subfolder) + lib_path = os.path.join(self.package_folder, 'lib') + + cmake = self._configure_cmake() + cmake.install() + + if not self.options.shared: + for ext in ['.a', '.lib']: + lib = '**/lib/*LLVMTableGenGlobalISel{}'.format(ext) + self.copy(lib, dst='lib', keep_path=False) + lib = '*LLVMTableGenGlobalISel{}'.format(ext) + self.copy(lib, dst='lib', src='lib') + + CMake(self).configure(args=['--graphviz=graph/llvm.dot'], source_dir='.', build_dir='.') + with chdir(self, 'graph'): + dot_text = load(self, 'llvm.dot').replace('\r\n', '\n') + + dep_regex = re.compile(r'//\s(.+)\s->\s(.+)$', re.MULTILINE) + deps = re.findall(dep_regex, dot_text) + + dummy_targets = defaultdict(list) + for target, dep in deps: + if not target.startswith('LLVM'): + dummy_targets[target].append(dep) + + cmake_targets = { + 'libffi::libffi': 'ffi', + 'ZLIB::ZLIB': 'z', + 'Iconv::Iconv': 'iconv', + 'LibXml2::LibXml2': 'xml2' + } + + components = defaultdict(list) + for lib, dep in deps: + if not lib.startswith('LLVM'): + continue + elif dep.startswith('-delayload:'): + continue + elif dep.startswith('LLVM'): + components[dep] + elif dep in cmake_targets: + dep = cmake_targets[dep] + elif os.path.exists(dep): + dep = os.path.splitext(os.path.basename(dep))[0] + dep = dep.replace('lib', '') + dep = dep.replace('-l', '') + + if dep in dummy_targets.keys(): + components[lib].extend(dummy_targets[dep]) + components[lib] = list(set(components[lib])) + else: + components[lib].append(dep) + + alias_targets = {} + old_alias_targets = {} + for component, _ in components.items(): + alias_targets[component] = "LLVM::{}".format(component) + old_alias_targets["llvm-core::{}".format(component[4:].replace('LLVM', '').lower())] = "LLVM::{}".format(component) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._alias_module_file_rel_path), + alias_targets + ) + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._old_alias_module_file_rel_path), + old_alias_targets + ) + + rmdir(self, os.path.join(self.package_folder, 'share')) + + rm(self, "LLVMExports*.cmake", self.package_folder, recursive=True) + rename(self, os.path.join(self.package_folder, self._module_subfolder, 'LLVM-Config.cmake'), + os.path.join(self.package_folder, self._module_subfolder, 'LLVM-ConfigInternal.cmake')) + rename(self, os.path.join(self.package_folder, self._module_subfolder, 'LLVMConfig.cmake'), + os.path.join(self.package_folder, self._module_subfolder, 'LLVMConfigInternal.cmake')) + + replace_in_file(self, os.path.join(self.package_folder, self._module_subfolder, 'AddLLVM.cmake'), + "include(LLVM-Config)", + "include(LLVM-ConfigInternal)") + replace_in_file(self, os.path.join(self.package_folder, self._module_subfolder, 'LLVMConfigInternal.cmake'), + "LLVM-Config.cmake", + "LLVM-ConfigInternal.cmake") + + for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: + rm(self, mask, self.package_folder, recursive=True) + + for name in os.listdir(lib_path): + fullname = os.path.join(lib_path, name) + if 'LLVM' not in name and os.path.isfile(fullname): + os.remove(fullname) + + if not self.options.shared: + if self.options.get_safe('with_zlib', False): + if not 'z' in components['LLVMSupport']: + components['LLVMSupport'].append('z') + components_path = \ + os.path.join(self.package_folder, 'lib', 'components.json') + with open(components_path, 'w') as components_file: + json.dump(components, components_file, indent=4) + else: + suffixes = ['.dylib', '.so'] + for name in os.listdir(lib_path): + if not any(suffix in name for suffix in suffixes): + os.remove(os.path.join(lib_path, name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LLVM") + + if self.options.shared: + self.cpp_info.libs = collect_libs(self) + if self.settings.os == 'Linux': + self.cpp_info.system_libs = ['pthread', 'rt', 'dl', 'm'] + elif self.settings.os == 'Macos': + self.cpp_info.system_libs = ['m'] + return + + components_path = \ + os.path.join(self.package_folder, 'lib', 'components.json') + with open(components_path, 'r') as components_file: + components = json.load(components_file) + + dependencies = ['ffi', 'z', 'iconv', 'xml2'] + targets = { + 'ffi': 'libffi::libffi', + 'z': 'zlib::zlib', + 'xml2': 'libxml2::libxml2' + } + + for component, deps in components.items(): + self.cpp_info.components[component].libs = [component] + self.cpp_info.components[component].requires.extend(dep for dep in deps if dep.startswith('LLVM')) + + for lib, target in targets.items(): + if lib in deps: + self.cpp_info.components[component].requires.append(target) + + self.cpp_info.components[component].system_libs = [ + dep for dep in deps + if not dep.startswith('LLVM') and dep not in dependencies + ] + + self.cpp_info.components[component].set_property("cmake_target_name", component) + self.cpp_info.components[component].builddirs.append(self._module_subfolder) + + self.cpp_info.components[component].names["cmake_find_package"] = component + self.cpp_info.components[component].names["cmake_find_package_multi"] = component + self.cpp_info.components[component].build_modules["cmake_find_package"].extend([ + self._alias_module_file_rel_path, + self._old_alias_module_file_rel_path, + ]) + self.cpp_info.components[component].build_modules["cmake_find_package_multi"].extend([ + self._alias_module_file_rel_path, + self._old_alias_module_file_rel_path, + ]) + + if self.options.use_llvm_cmake_files: + self.cpp_info.components[component].build_modules["cmake_find_package"].append( + os.path.join(self._module_subfolder, "LLVMConfigInternal.cmake") + ) + self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append( + os.path.join(self._module_subfolder, "LLVMConfigInternal.cmake") + ) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "LLVM" + self.cpp_info.names["cmake_find_package_multi"] = "LLVM" diff --git a/recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch b/recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch new file mode 100644 index 0000000000000..6f2c7682aa4e0 --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch @@ -0,0 +1,57 @@ +--- cmake/config-ix.cmake ++++ cmake/config-ix.cmake +@@ -159,6 +159,9 @@ + set(LIBXML2_FOUND 0) + if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE)) + find_package(LibXml2) ++ set(LIBXML2_FOUND 1) ++ list(GET LibXml2_INCLUDE_DIRS -1 LIBXML2_INCLUDE_DIR) ++ set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) + if (LIBXML2_FOUND) + set(LLVM_LIBXML2_ENABLED 1) + if ((CMAKE_OSX_SYSROOT) AND (EXISTS ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR})) +@@ -321,7 +321,7 @@ + message(FATAL_ERROR "libffi includes are not found.") + endif() + +- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) ++ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR}) + if( NOT FFI_LIBRARY_PATH ) + message(FATAL_ERROR "libffi is not found.") + endif() +--- cmake/modules/TableGen.cmake ++++ cmake/modules/TableGen.cmake +@@ -138,12 +138,7 @@ + macro(add_tablegen target project) + set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) + set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) +- +- # CMake-3.9 doesn't let compilation units depend on their dependent libraries. +- if(NOT (CMAKE_GENERATOR STREQUAL "Ninja" AND NOT CMAKE_VERSION VERSION_LESS 3.9) AND NOT XCODE) +- # FIXME: It leaks to user, callee of add_tablegen. +- set(LLVM_ENABLE_OBJLIB ON) +- endif() ++ set(LLVM_ENABLE_OBJLIB OFF) + + add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) + set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) +--- lib/WindowsManifest/CMakeLists.txt ++++ lib/WindowsManifest/CMakeLists.txt +@@ -8,16 +8,6 @@ + if(LIBXML2_LIBRARIES) + target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES}) + +- get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME) +- if (CMAKE_STATIC_LIBRARY_PREFIX AND +- xml2_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$") +- string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" xml2_library ${xml2_library}) +- string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library}) +- elseif (CMAKE_SHARED_LIBRARY_PREFIX AND +- xml2_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$") +- string(REGEX REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "" xml2_library ${xml2_library}) +- string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library}) +- endif() + set_property(TARGET LLVMWindowsManifest PROPERTY +- LLVM_SYSTEM_LIBS ${xml2_library}) ++ LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) + endif() diff --git a/recipes/llvm-core/all/patches/11x/11.1.0-native.patch b/recipes/llvm-core/all/patches/11x/11.1.0-native.patch new file mode 100644 index 0000000000000..c541a76820341 --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/11.1.0-native.patch @@ -0,0 +1,81 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -942,10 +942,6 @@ + include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) + + # when crosscompiling import the executable targets from a file +-if(LLVM_USE_HOST_TOOLS) +- include(CrossCompile) +- llvm_create_cross_target(LLVM NATIVE "" Release) +-endif(LLVM_USE_HOST_TOOLS) + if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) + # Dummy use to avoid CMake Warning: Manually-specified variables were not used + # (this is a variable that CrossCompile sets on recursive invocations) +--- cmake/modules/TableGen.cmake ++++ cmake/modules/TableGen.cmake +@@ -150,33 +150,6 @@ + set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE) + set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE) + +- if(LLVM_USE_HOST_TOOLS) +- if( ${${project}_TABLEGEN} STREQUAL "${target}" ) +- # The NATIVE tablegen executable *must* depend on the current target one +- # otherwise the native one won't get rebuilt when the tablgen sources +- # change, and we end up with incorrect builds. +- build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target}) +- set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) +- +- add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) +- set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE) +- +- # Create an artificial dependency between tablegen projects, because they +- # compile the same dependencies, thus using the same build folders. +- # FIXME: A proper fix requires sequentially chaining tablegens. +- if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host AND +- TARGET LLVM-tablegen-host) +- add_dependencies(${project}-tablegen-host LLVM-tablegen-host) +- endif() +- +- # If we're using the host tablegen, and utils were not requested, we have no +- # need to build this tablegen. +- if ( NOT LLVM_BUILD_UTILS ) +- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON) +- endif() +- endif() +- endif() +- + if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) + set(export_to_llvmexports) + if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +--- tools/llvm-config/CMakeLists.txt ++++ tools/llvm-config/CMakeLists.txt +@@ -77,11 +77,3 @@ + + # Add the dependency on the generation step. + add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) +- +-if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH) +- build_native_tool(llvm-config LLVM_CONFIG_PATH) +- set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "") +- +- add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH}) +- add_dependencies(llvm-config NativeLLVMConfig) +-endif() +--- tools/llvm-shlib/CMakeLists.txt ++++ tools/llvm-shlib/CMakeLists.txt +@@ -155,13 +155,8 @@ + + set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) + if(NOT LLVM_NM) +- if(CMAKE_CROSSCOMPILING) +- build_native_tool(llvm-nm llvm_nm) +- set(llvm_nm_target "${llvm_nm}") +- else() +- set(llvm_nm $) +- set(llvm_nm_target llvm-nm) +- endif() ++ set(llvm_nm $) ++ set(llvm_nm_target llvm-nm) + else() + set(llvm_nm ${LLVM_NM}) + set(llvm_nm_target "") diff --git a/recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch b/recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch new file mode 100644 index 0000000000000..8d3f7dbf7cf98 --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch @@ -0,0 +1,55 @@ +--- cmake/config-ix.cmake ++++ cmake/config-ix.cmake +@@ -143,6 +143,9 @@ + elseif(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + find_package(LibXml2) + endif() ++ set(LIBXML2_FOUND 1) ++ list(GET LibXml2_INCLUDE_DIRS -1 LIBXML2_INCLUDE_DIR) ++ set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) + if(LibXml2_FOUND) + # Check if libxml2 we found is usable; for example, we may have found a 32-bit + # library on a 64-bit system which would result in a link-time failure. +@@ -335,7 +335,7 @@ + message(FATAL_ERROR "libffi includes are not found.") + endif() + +- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) ++ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR}) + if( NOT FFI_LIBRARY_PATH ) + message(FATAL_ERROR "libffi is not found.") + endif() +--- cmake/modules/TableGen.cmake ++++ cmake/modules/TableGen.cmake +@@ -132,12 +132,7 @@ + macro(add_tablegen target project) + set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) + set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) +- +- # CMake doesn't let compilation units depend on their dependent libraries on some generators. +- if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT XCODE) +- # FIXME: It leaks to user, callee of add_tablegen. +- set(LLVM_ENABLE_OBJLIB ON) +- endif() ++ set(LLVM_ENABLE_OBJLIB OFF) + + add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) + set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) +--- lib/WindowsManifest/CMakeLists.txt ++++ lib/WindowsManifest/CMakeLists.txt +@@ -21,14 +21,5 @@ + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_LIBXML2) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zlib_library) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) +- endif() +- get_library_name(${libxml2_library} libxml2_library) +- set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) ++ set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) + endif() diff --git a/recipes/llvm-core/all/patches/12x/12.0.0-native.patch b/recipes/llvm-core/all/patches/12x/12.0.0-native.patch new file mode 100644 index 0000000000000..f5c6d542fab8f --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/12.0.0-native.patch @@ -0,0 +1,81 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -891,10 +891,6 @@ + include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) + + # when crosscompiling import the executable targets from a file +-if(LLVM_USE_HOST_TOOLS) +- include(CrossCompile) +- llvm_create_cross_target(LLVM NATIVE "" Release) +-endif(LLVM_USE_HOST_TOOLS) + if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) + # Dummy use to avoid CMake Warning: Manually-specified variables were not used + # (this is a variable that CrossCompile sets on recursive invocations) +--- cmake/modules/TableGen.cmake ++++ cmake/modules/TableGen.cmake +@@ -144,33 +144,6 @@ + set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE) + set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE) + +- if(LLVM_USE_HOST_TOOLS) +- if( ${${project}_TABLEGEN} STREQUAL "${target}" ) +- # The NATIVE tablegen executable *must* depend on the current target one +- # otherwise the native one won't get rebuilt when the tablgen sources +- # change, and we end up with incorrect builds. +- build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target}) +- set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) +- +- add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) +- set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE) +- +- # Create an artificial dependency between tablegen projects, because they +- # compile the same dependencies, thus using the same build folders. +- # FIXME: A proper fix requires sequentially chaining tablegens. +- if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host AND +- TARGET LLVM-tablegen-host) +- add_dependencies(${project}-tablegen-host LLVM-tablegen-host) +- endif() +- +- # If we're using the host tablegen, and utils were not requested, we have no +- # need to build this tablegen. +- if ( NOT LLVM_BUILD_UTILS ) +- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON) +- endif() +- endif() +- endif() +- + if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) + set(export_to_llvmexports) + if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +--- tools/llvm-config/CMakeLists.txt ++++ tools/llvm-config/CMakeLists.txt +@@ -75,11 +75,3 @@ + + # Add the dependency on the generation step. + add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) +- +-if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH) +- build_native_tool(llvm-config LLVM_CONFIG_PATH) +- set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "") +- +- add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH}) +- add_dependencies(llvm-config NativeLLVMConfig) +-endif() +--- tools/llvm-shlib/CMakeLists.txt ++++ tools/llvm-shlib/CMakeLists.txt +@@ -155,13 +155,8 @@ + + set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) + if(NOT LLVM_NM) +- if(CMAKE_CROSSCOMPILING) +- build_native_tool(llvm-nm llvm_nm) +- set(llvm_nm_target "${llvm_nm}") +- else() +- set(llvm_nm $) +- set(llvm_nm_target llvm-nm) +- endif() ++ set(llvm_nm $) ++ set(llvm_nm_target llvm-nm) + else() + set(llvm_nm ${LLVM_NM}) + set(llvm_nm_target "") diff --git a/recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch b/recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch new file mode 100644 index 0000000000000..981f067a21505 --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch @@ -0,0 +1,54 @@ +--- cmake/config-ix.cmake ++++ cmake/config-ix.cmake +@@ -143,6 +143,9 @@ if(LLVM_ENABLE_LIBXML2) + elseif(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + find_package(LibXml2) + endif() ++ set(LIBXML2_FOUND 1) ++ list(GET LibXml2_INCLUDE_DIRS -1 LIBXML2_INCLUDE_DIR) ++ set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) + if(LibXml2_FOUND) + # Check if libxml2 we found is usable; for example, we may have found a 32-bit + # library on a 64-bit system which would result in a link-time failure. +@@ -343,7 +346,7 @@ if( LLVM_ENABLE_FFI ) + message(FATAL_ERROR "libffi includes are not found.") + endif() + +- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) ++ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR}) + if( NOT FFI_LIBRARY_PATH ) + message(FATAL_ERROR "libffi is not found.") + endif() +--- cmake/modules/TableGen.cmake ++++ cmake/modules/TableGen.cmake +@@ -135,11 +135,7 @@ macro(add_tablegen target project) + set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) + set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) + +- # CMake doesn't let compilation units depend on their dependent libraries on some generators. +- if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT XCODE) +- # FIXME: It leaks to user, callee of add_tablegen. +- set(LLVM_ENABLE_OBJLIB ON) +- endif() ++ set(LLVM_ENABLE_OBJLIB OFF) + + add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) + set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) +--- lib/WindowsManifest/CMakeLists.txt ++++ lib/WindowsManifest/CMakeLists.txt +@@ -21,14 +21,5 @@ add_llvm_component_library(LLVMWindowsManifest + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_LIBXML2) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zlib_library) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) +- endif() +- get_library_name(${libxml2_library} libxml2_library) +- set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) ++ set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) + endif() diff --git a/recipes/llvm-core/all/patches/13x/13.0.0-native.patch b/recipes/llvm-core/all/patches/13x/13.0.0-native.patch new file mode 100644 index 0000000000000..fa8482ce0493b --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/13.0.0-native.patch @@ -0,0 +1,78 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -931,10 +931,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) + include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) + + # when crosscompiling import the executable targets from a file +-if(LLVM_USE_HOST_TOOLS) +- include(CrossCompile) +- llvm_create_cross_target(LLVM NATIVE "" Release) +-endif(LLVM_USE_HOST_TOOLS) + if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) + # Dummy use to avoid CMake Warning: Manually-specified variables were not used + # (this is a variable that CrossCompile sets on recursive invocations) +--- cmake/modules/TableGen.cmake ++++ cmake/modules/TableGen.cmake +@@ -147,32 +147,6 @@ macro(add_tablegen target project) + set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE) + set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE) + +- if(LLVM_USE_HOST_TOOLS) +- if( ${${project}_TABLEGEN} STREQUAL "${target}" ) +- # The NATIVE tablegen executable *must* depend on the current target one +- # otherwise the native one won't get rebuilt when the tablgen sources +- # change, and we end up with incorrect builds. +- build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target}) +- set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) +- +- add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) +- set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE) +- +- # Create an artificial dependency between tablegen projects, because they +- # compile the same dependencies, thus using the same build folders. +- # FIXME: A proper fix requires sequentially chaining tablegens. +- if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host AND +- TARGET LLVM-tablegen-host) +- add_dependencies(${project}-tablegen-host LLVM-tablegen-host) +- endif() +- +- # If we're using the host tablegen, and utils were not requested, we have no +- # need to build this tablegen. +- if ( NOT LLVM_BUILD_UTILS ) +- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON) +- endif() +- endif() +- endif() + + if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) + set(export_to_llvmexports) +--- tools/llvm-config/CMakeLists.txt ++++ tools/llvm-config/CMakeLists.txt +@@ -75,11 +75,3 @@ endif() + + # Add the dependency on the generation step. + add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) +- +-if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH) +- build_native_tool(llvm-config LLVM_CONFIG_PATH) +- set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "") +- +- add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH}) +- add_dependencies(llvm-config NativeLLVMConfig) +-endif() +--- tools/llvm-shlib/CMakeLists.txt ++++ tools/llvm-shlib/CMakeLists.txt +@@ -162,13 +162,6 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC) + + set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) + if(NOT LLVM_NM) +- if(CMAKE_CROSSCOMPILING) +- build_native_tool(llvm-nm llvm_nm) +- set(llvm_nm_target "${llvm_nm}") +- else() +- set(llvm_nm $) +- set(llvm_nm_target llvm-nm) +- endif() + else() + set(llvm_nm ${LLVM_NM}) + set(llvm_nm_target "") diff --git a/recipes/llvm-core/all/test_package/CMakeLists.txt b/recipes/llvm-core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..726aa5975f221 --- /dev/null +++ b/recipes/llvm-core/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.13.4) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(LLVM REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) + +if(TARGET LLVMInterpreter) # static libraries + target_link_libraries(${PROJECT_NAME} PRIVATE + LLVMInterpreter + LLVMIRReader + LLVMX86CodeGen + ) +else() # shared library + target_link_libraries(${PROJECT_NAME} LLVM) +endif() diff --git a/recipes/llvm-core/all/test_package/conanfile.py b/recipes/llvm-core/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e0ca8f6b664cb --- /dev/null +++ b/recipes/llvm-core/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +from conans import ConanFile, CMake, tools + +import os.path + + +class LLVMCoreTestPackageConan(ConanFile): + settings = ('os', 'arch', 'compiler', 'build_type') + generators = ('cmake', 'cmake_find_package') + + def build(self): + build_system = CMake(self) + build_system.configure() + build_system.build() + + def test(self): + test_package = not tools.cross_building(self.settings) + if 'x86' not in str(self.settings.arch).lower(): + test_package = False + elif str(self.options['llvm-core'].targets) not in ['all', 'X86']: + test_package = False + elif self.options['llvm-core'].shared: + if self.options['llvm-core'].components != 'all': + requirements = ['interpreter', 'irreader', 'x86codegen'] + targets = str(self.options['llvm-core'].components) + if self.settings.os == 'Windows': + requirements.append('demangle') + if not all([target in components for target in requirements]): + test_package = False + + if test_package: + command = [ + os.path.join('bin', 'test_package'), + os.path.join(os.path.dirname(__file__), 'test_function.ll') + ] + self.run(command, run_environment=True) + + llvm_path = self.deps_cpp_info['llvm-core'].rootpath + license_path = os.path.join(llvm_path, 'licenses', 'LICENSE.TXT') + assert os.path.exists(license_path) diff --git a/recipes/llvm-core/all/test_package/test_function.ll b/recipes/llvm-core/all/test_package/test_function.ll new file mode 100644 index 0000000000000..6e62088cd308d --- /dev/null +++ b/recipes/llvm-core/all/test_package/test_function.ll @@ -0,0 +1,6 @@ +@.str = private unnamed_addr constant [25 x i8] c"LLVM IR interpreter ok!\0A\00", align 1 +define i32 @test() #0 { + call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)) + ret i32 0 +} +declare i32 @printf(i8*, ...) #1 diff --git a/recipes/llvm-core/all/test_package/test_package.cpp b/recipes/llvm-core/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e5de3a64aa80d --- /dev/null +++ b/recipes/llvm-core/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +#include +#include + +#include + + +int main(int argc, char const* argv[]) { + if (argc < 2) + return 0; + + llvm::InitializeNativeTarget(); + llvm::SMDiagnostic smd; + llvm::LLVMContext context; + std::string error; + + llvm::EngineBuilder engine_builder{ + llvm::parseIRFile(argv[1], smd, context) + }; + engine_builder.setEngineKind(llvm::EngineKind::Interpreter); + engine_builder.setErrorStr(&error); + + auto execution_engine = std::unique_ptr( + engine_builder.create() + ); + execution_engine->runStaticConstructorsDestructors(false); + + auto test_function = execution_engine->FindFunctionNamed("test"); + auto result = execution_engine->runFunction( + test_function, + llvm::ArrayRef() + ); + return result.IntVal.getSExtValue(); +} diff --git a/recipes/llvm-core/config.yml b/recipes/llvm-core/config.yml new file mode 100644 index 0000000000000..bc979f696a102 --- /dev/null +++ b/recipes/llvm-core/config.yml @@ -0,0 +1,7 @@ +versions: + "13.0.0": + folder: all + "12.0.0": + folder: all + "11.1.0": + folder: all diff --git a/recipes/llvm-openmp/all/CMakeLists.txt b/recipes/llvm-openmp/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/llvm-openmp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/llvm-openmp/all/conandata.yml b/recipes/llvm-openmp/all/conandata.yml new file mode 100644 index 0000000000000..499e8f40e5c34 --- /dev/null +++ b/recipes/llvm-openmp/all/conandata.yml @@ -0,0 +1,36 @@ +sources: + "12.0.1": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/openmp-12.0.1.src.tar.xz" + sha256: "60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091" + "11.1.0": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/openmp-11.1.0.src.tar.xz" + sha256: "d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e" + "10.0.0": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/openmp-10.0.0.src.tar.xz" + sha256: "3b9ff29a45d0509a1e9667a0feb43538ef402ea8cfc7df3758a01f20df08adfa" + "9.0.1": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/openmp-9.0.1.src.tar.xz" + sha256: "5c94060f846f965698574d9ce22975c0e9f04c9b14088c3af5f03870af75cace" + "8.0.1": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/openmp-8.0.1.src.tar.xz" + sha256: "3e85dd3cad41117b7c89a41de72f2e6aa756ea7b4ef63bb10dcddf8561a7722c" +patches: + "12.0.1": + - patch_file: "patches/0001-disable-build-testing_12.0.1.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-disable-omp-target_12.0.1.patch" + base_path: "source_subfolder" + "11.1.0": + - patch_file: "patches/0001-disable-build-testing_11.1.0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-fix-armv8-build_11.1.0.patch" + base_path: "source_subfolder" + "10.0.0": + - patch_file: "patches/0001-disable-build-testing_10.0.0.patch" + base_path: "source_subfolder" + "9.0.1": + - patch_file: "patches/0001-disable-build-testing.patch" + base_path: "source_subfolder" + "8.0.1": + - patch_file: "patches/0001-disable-build-testing.patch" + base_path: "source_subfolder" diff --git a/recipes/llvm-openmp/all/conanfile.py b/recipes/llvm-openmp/all/conanfile.py new file mode 100644 index 0000000000000..4f1ee354a647e --- /dev/null +++ b/recipes/llvm-openmp/all/conanfile.py @@ -0,0 +1,141 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import functools +import textwrap + +required_conan_version = ">=1.43.0" + + +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.") + license = "Apache-2.0 WITH LLVM-exception" + topics = ("conan", "llvm", "openmp", "parallelism") + homepage = "https://github.com/llvm/llvm-project/tree/master/openmp" + 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} + generators = "cmake" + + @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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _supports_compiler(self): + supported_compilers_by_os = \ + {"Linux": ["clang", "gcc", "intel"], + "Macos": ["apple-clang", "clang", "gcc", "intel"], + "Windows": ["intel"]} + the_compiler, the_os = self.settings.compiler.value, self.settings.os.value + return the_compiler in supported_compilers_by_os.get(the_os, []) + + def configure(self): + if self.options.shared: + del self.options.fPIC + if not self._supports_compiler(): + raise ConanInvalidConfiguration("llvm-openmp doesn't support compiler: {} on OS: {}.". + format(self.settings.compiler, self.settings.os)) + + def validate(self): + if ( + tools.Version(self.version) <= "10.0.0" + and self.settings.os == "Macos" + and self.settings.arch == "armv8" + ): + raise ConanInvalidConfiguration("ARM v8 not supported") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "openmp-{}.src".format(self.version) + os.rename(extracted_dir, self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["OPENMP_STANDALONE_BUILD"] = True + cmake.definitions["LIBOMP_ENABLE_SHARED"] = self.options.shared + if self.settings.os == "Linux": + cmake.definitions["OPENMP_ENABLE_LIBOMPTARGET"] = self.options.shared + cmake.configure() + return cmake + + def build(self): + self._patch_sources() + tools.replace_in_file(os.path.join(self._source_subfolder, "runtime/CMakeLists.txt"), + "add_subdirectory(test)", "") + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE.txt", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + { + "OpenMP::OpenMP_C": "OpenMP::OpenMP", + "OpenMP::OpenMP_CXX": "OpenMP::OpenMP" + } + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "OpenMP") + self.cpp_info.set_property("cmake_target_name", "OpenMP::OpenMP") + self.cpp_info.set_property("cmake_target_aliases", ["OpenMP::OpenMP_C", "OpenMP::OpenMP_CXX"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "OpenMP" + self.cpp_info.names["cmake_find_package_multi"] = "OpenMP" + self.cpp_info.builddirs.append(os.path.join(self.package_folder, 'lib', 'cmake')) + 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] + + if self.settings.compiler in ("clang", "apple-clang"): + self.cpp_info.cxxflags = ["-Xpreprocessor", "-fopenmp"] + elif self.settings.compiler == 'gcc': + self.cpp_info.cxxflags = ["-fopenmp"] + elif self.settings.compiler == 'intel': + self.cpp_info.cxxflags = ["/Qopenmp"] if self.settings.os == 'Windows' else ["-Qopenmp"] + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl", "m", "pthread", "rt"] diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch new file mode 100644 index 0000000000000..2266bee5e1d73 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch @@ -0,0 +1,38 @@ +diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt +index 597eedcec0b..4395761dac4 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S + # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. + set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") + +- # Group test settings. +- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING +- "C compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING +- "C++ compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") + else() + set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) + # If building in tree, we honor the same install suffix LLVM uses. +@@ -45,14 +39,6 @@ endif() + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- + + # Build host runtime library. + add_subdirectory(runtime) +@@ -79,5 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + add_subdirectory(libomptarget) + endif() + +-# Now that we have seen all testuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch new file mode 100644 index 0000000000000..09c16d7b0bef6 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt_dum +index 9825183..4b4359b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S + # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. + set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") + +- # Group test settings. +- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING +- "C compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING +- "C++ compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") + else() + set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) + # If building in tree, we honor the same install suffix LLVM uses. +@@ -45,14 +39,6 @@ endif() + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- + + # Build host runtime library. + add_subdirectory(runtime) +@@ -79,17 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + add_subdirectory(libomptarget) + endif() + +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-# Now that we have seen all testuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch new file mode 100644 index 0000000000000..910ab03dc90e1 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch @@ -0,0 +1,52 @@ +diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt +index 6f0d9e728002..cf7bd7590f43 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S + # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. + set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") + +- # Group test settings. +- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING +- "C compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING +- "C++ compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") + else() + set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) + # If building in tree, we honor the same install suffix LLVM uses. +@@ -45,15 +39,6 @@ endif() + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- +- + # Build host runtime library. + add_subdirectory(runtime) + +@@ -78,18 +63,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch new file mode 100644 index 0000000000000..a1716382cf4d8 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists_orig.txt b/CMakeLists.txt +index b8a2822..7950dde 100644 +--- a/CMakeLists_orig.txt ++++ b/CMakeLists.txt +@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S + # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. + set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") + +- # Group test settings. +- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING +- "C compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING +- "C++ compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") + else() + set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) + # If building in tree, we honor the same install suffix LLVM uses. +@@ -47,14 +41,6 @@ endif() + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- + set(ENABLE_LIBOMPTARGET ON) + # Currently libomptarget cannot be compiled on Windows or MacOS X. + # Since the device plugins are only supported on Linux anyway, +@@ -97,22 +83,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +- +-# Build documentation +-add_subdirectory(docs) +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch b/recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch new file mode 100644 index 0000000000000..cd1c4ba9b8096 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch @@ -0,0 +1,15 @@ +diff --git a/libomptarget/CMakeLists.txt b/libomptarget/CMakeLists.txt +index 6c90ced..629e20a 100644 +--- a/libomptarget/CMakeLists.txt ++++ b/libomptarget/CMakeLists.txt +@@ -30,10 +30,6 @@ include(LibomptargetUtils) + # Get dependencies for the different components of the project. + include(LibomptargetGetDependencies) + +-# LLVM source tree is required at build time for libomptarget +-if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS) +- message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS") +-endif() + + # This is a list of all the targets that are supported/tested right now. + set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} aarch64-unknown-linux-gnu") diff --git a/recipes/llvm-openmp/all/patches/0003-fix-armv8-build_11.1.0.patch b/recipes/llvm-openmp/all/patches/0003-fix-armv8-build_11.1.0.patch new file mode 100644 index 0000000000000..a0ff6484f924e --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0003-fix-armv8-build_11.1.0.patch @@ -0,0 +1,19 @@ +diff --git a/openmp/runtime/src/z_Linux_asm.S b/openmp/runtime/src/z_Linux_asm.S +index 8090ff759fe1..d50019c299fc 100644 +--- a/runtime/src/z_Linux_asm.S ++++ b/runtime/src/z_Linux_asm.S +@@ -1746,10 +1746,12 @@ __kmp_unnamed_critical_addr: + .comm .gomp_critical_user_,32,8 + .data + .align 8 +- .global __kmp_unnamed_critical_addr +-__kmp_unnamed_critical_addr: ++ .global KMP_PREFIX_UNDERSCORE(__kmp_unnamed_critical_addr) ++KMP_PREFIX_UNDERSCORE(__kmp_unnamed_critical_addr): + .8byte .gomp_critical_user_ ++#ifdef __ELF__ + .size __kmp_unnamed_critical_addr,8 ++#endif + #endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64 || + KMP_ARCH_RISCV64 */ + diff --git a/recipes/llvm-openmp/all/test_package/CMakeLists.txt b/recipes/llvm-openmp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2d9a8574cc4d4 --- /dev/null +++ b/recipes/llvm-openmp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(OpenMP CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package OpenMP::OpenMP_CXX) diff --git a/recipes/llvm-openmp/all/test_package/conanfile.py b/recipes/llvm-openmp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5ac3af772bdc0 --- /dev/null +++ b/recipes/llvm-openmp/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LLVMOpenMpTestConan(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/llvm-openmp/all/test_package/test_package.cpp b/recipes/llvm-openmp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f6316471238aa --- /dev/null +++ b/recipes/llvm-openmp/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include + +int main() +{ + int num_threads = std::max(5, omp_get_num_procs()); + omp_set_num_threads(num_threads); + int actual_number; + #pragma omp parallel + { + #pragma omp single + { + actual_number = omp_get_num_threads(); + } + } + if(actual_number != num_threads){ + std::cout << "Something went wrong. Expecting " << num_threads << " threads but found " << actual_number << ".\n"; + std::cout << "There are probably missing compiler flags.\n" ; + return 1; + } + return 0; +} diff --git a/recipes/llvm-openmp/config.yml b/recipes/llvm-openmp/config.yml new file mode 100644 index 0000000000000..5f6a2e2df9402 --- /dev/null +++ b/recipes/llvm-openmp/config.yml @@ -0,0 +1,11 @@ +versions: + "12.0.1": + folder: all + "11.1.0": + folder: all + "10.0.0": + folder: all + "9.0.1": + folder: all + "8.0.1": + folder: all diff --git a/recipes/lmdb/all/CMakeLists.txt b/recipes/lmdb/all/CMakeLists.txt new file mode 100644 index 0000000000000..888afb35a88e0 --- /dev/null +++ b/recipes/lmdb/all/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.4) +project(lmdb LANGUAGES C) + +include(GNUInstallDirs) + +# LMDB library: + +add_library(lmdb + ${LMDB_SRC_DIR}/lmdb.h + ${LMDB_SRC_DIR}/mdb.c + ${LMDB_SRC_DIR}/midl.c + ${LMDB_SRC_DIR}/midl.h +) + +set_target_properties(lmdb PROPERTIES + PUBLIC_HEADER ${LMDB_SRC_DIR}/lmdb.h + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +find_package(Threads REQUIRED) +target_link_libraries(lmdb PUBLIC Threads::Threads) + +install(TARGETS lmdb + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +if (LMDB_ENABLE_ROBUST_MUTEX) + target_compile_definitions(lmdb PUBLIC MDB_USE_ROBUST=1) +else (LMDB_ENABLE_ROBUST_MUTEX) + target_compile_definitions(lmdb PUBLIC MDB_USE_ROBUST=0) +endif (LMDB_ENABLE_ROBUST_MUTEX) + +# LMDB utilities: + +if(NOT WIN32) + foreach(TOOL mdb_stat mdb_copy mdb_dump mdb_load) + add_executable(${TOOL} ${LMDB_SRC_DIR}/${TOOL}.c) + target_link_libraries(${TOOL} lmdb) + install(TARGETS ${TOOL} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() +endif() diff --git a/recipes/lmdb/all/conandata.yml b/recipes/lmdb/all/conandata.yml new file mode 100644 index 0000000000000..924b591216793 --- /dev/null +++ b/recipes/lmdb/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.29": + url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.29/openldap-LMDB_0.9.29.tar.gz" + sha256: "d4c668167a2d703ef91db733b4069b8b74dbc374405855be6626b45e2a7e2dd3" diff --git a/recipes/lmdb/all/conanfile.py b/recipes/lmdb/all/conanfile.py new file mode 100644 index 0000000000000..7700c885b181c --- /dev/null +++ b/recipes/lmdb/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.46.0" + + +class lmdbConan(ConanFile): + name = "lmdb" + license = "OLDAP-2.8" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://symas.com/lmdb/" + description = "Fast and compat memory-mapped key-value database" + topics = ("database", "key-value", "memory-mapped") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_robust_mutex": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_robust_mutex": True, + } + + exports_sources = ["CMakeLists.txt"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os in ("Linux", "FreeBSD"): + self.options.enable_robust_mutex = True + else: + self.options.enable_robust_mutex = False + + 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 + + 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["LMDB_SRC_DIR"] = os.path.join(self.source_folder, "libraries", "liblmdb").replace("\\", "/") + tc.variables["LMDB_ENABLE_ROBUST_MUTEX"] = self.options.enable_robust_mutex + 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=os.path.join(self.source_folder, "libraries", "liblmdb"), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "lmdb") + self.cpp_info.libs = ["lmdb"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + + 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) diff --git a/recipes/lmdb/all/test_package/CMakeLists.txt b/recipes/lmdb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3342cb59e0fea --- /dev/null +++ b/recipes/lmdb/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lmdb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lmdb::lmdb) diff --git a/recipes/lmdb/all/test_package/conanfile.py b/recipes/lmdb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/lmdb/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/lmdb/all/test_package/test_package.c b/recipes/lmdb/all/test_package/test_package.c new file mode 100644 index 0000000000000..495ec52e11e0c --- /dev/null +++ b/recipes/lmdb/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() +{ + const char *version = mdb_version(NULL, NULL, NULL); + printf("%s\n", version); + return 0; +} diff --git a/recipes/lmdb/all/test_v1_package/CMakeLists.txt b/recipes/lmdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..20645081348a3 --- /dev/null +++ b/recipes/lmdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lmdb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lmdb::lmdb) diff --git a/recipes/lmdb/all/test_v1_package/conanfile.py b/recipes/lmdb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/lmdb/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/lmdb/config.yml b/recipes/lmdb/config.yml new file mode 100644 index 0000000000000..34b7a75931b22 --- /dev/null +++ b/recipes/lmdb/config.yml @@ -0,0 +1,3 @@ +"versions": + "0.9.29": + "folder": "all" diff --git a/recipes/lodepng/all/CMakeLists.txt b/recipes/lodepng/all/CMakeLists.txt new file mode 100644 index 0000000000000..151ff6e29fe1c --- /dev/null +++ b/recipes/lodepng/all/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.4) +project(lodepng LANGUAGES CXX) + +add_library(lodepng ${LODEPNG_SRC_DIR}/lodepng.cpp) +set_target_properties(lodepng PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(GNUInstallDirs) +install(TARGETS lodepng + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") +install(FILES ${LODEPNG_SRC_DIR}/lodepng.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/lodepng/all/conandata.yml b/recipes/lodepng/all/conandata.yml new file mode 100644 index 0000000000000..bc34ea30306f5 --- /dev/null +++ b/recipes/lodepng/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200615": + url: "https://github.com/lvandeve/lodepng/archive/34628e89e80cd007179b25b0b2695e6af0f57fac.tar.gz" + sha256: "486ece0b661e83e509f1c6c9a05ca8dd1dd0008eec47d2aad9359e3609ab44a9" diff --git a/recipes/lodepng/all/conanfile.py b/recipes/lodepng/all/conanfile.py new file mode 100644 index 0000000000000..cf5e7257fe6f8 --- /dev/null +++ b/recipes/lodepng/all/conanfile.py @@ -0,0 +1,68 @@ +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class LodepngConan(ConanFile): + name = "lodepng" + description = "PNG encoder and decoder in C and C++, without dependencies." + license = "Zlib" + topics = ("png", "encoder", "decoder") + homepage = "https://github.com/lvandeve/lodepng" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("lodepng shared doesn't support Visual Studio with static runtime") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LODEPNG_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 = ["lodepng"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/lodepng/all/test_package/CMakeLists.txt b/recipes/lodepng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3b1ba39df32d9 --- /dev/null +++ b/recipes/lodepng/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(lodepng REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lodepng::lodepng) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lodepng/all/test_package/bees.png b/recipes/lodepng/all/test_package/bees.png new file mode 100644 index 0000000000000000000000000000000000000000..11640c7488fb114127f869572d7ffec132e77746 GIT binary patch literal 177424 zcmV)7K*zs{P)b{WyyIZw$}P$?~|Ez>27vYyoe$-l%W|7Y|jApvke&j<$g8%GPZ2YcqB?9 zMT(d1s;;ie%yV{pYxyB|w%|gex-N-Rxi9g>x(2^~_n&}`9Ptr6i*JDhAG`k!3H23u zpG@g9@y`GOoqS_|kUj%mgF$Y=NB2AGP4Jw)_I&^D5C8n@-~8sE-~H~%$8$gb$A7c^ z`@i`S^6EeT-N$YI?0#d?N8G3b?s=X4VIx0(c=h&jx!<){actT5j0@_u>ND^&@)b}Z z0K*@V=imsM*r3jf zqx3^`ItVOW4hDV?!z{bY5-)400IVu5(Eke zV1h8h05d_{LECZc*p3f(Je_IJZUb!u0Yz4c7Yz+ml_b>qLj!gi2!r7bmXEOGmJiR_ zbGonb)$vPsVV7#AstSuC1r;XZy)HoN098BL|%6d9-`>JbF$a9d{5C?5Rv7UCh|_ zyKOw|`>R)%hs(Iz_lNs^-^U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Yc9@Oa4Vq5 zDh4fx0v-XMcy1`J#FVI7v8q**Kx|1F3oS^tL-syhC)j02;ym?oU^KTaV69 zcnG5En1ih2R4(|IC+`>nP3lVB=rVyFSHzN-G9!D_$5Y G)%+j+EyZpC literal 0 HcmV?d00001 diff --git a/recipes/opus/all/test_package/test_package.c b/recipes/opus/all/test_package/test_package.c new file mode 100644 index 0000000000000..a39ea4aacd883 --- /dev/null +++ b/recipes/opus/all/test_package/test_package.c @@ -0,0 +1,159 @@ +/* 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 + +/*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; +} diff --git a/recipes/opus/all/test_v1_package/CMakeLists.txt b/recipes/opus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/opus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/opus/all/test_v1_package/conanfile.py b/recipes/opus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9534054c99e3c --- /dev/null +++ b/recipes/opus/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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) diff --git a/recipes/opus/config.yml b/recipes/opus/config.yml new file mode 100644 index 0000000000000..59334d5077368 --- /dev/null +++ b/recipes/opus/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.1": + folder: all diff --git a/recipes/opusfile/all/conandata.yml b/recipes/opusfile/all/conandata.yml new file mode 100644 index 0000000000000..6248280777374 --- /dev/null +++ b/recipes/opusfile/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "0.12": + url: "https://github.com/xiph/opusfile/archive/v0.12.tar.gz" + sha256: "a20a1dff1cdf0719d1e995112915e9966debf1470ee26bb31b2f510ccf00ef40" + "0.11": + url: "https://github.com/xiph/opusfile/archive/v0.11.tar.gz" + sha256: "c2105cffc59545ffc0d2a65069e2f222a1712bbe579911ac0a3d3660edbbec57" +patches: + "0.12": + - patch_file: "patches/001-disable-cert-store-integration.patch" + patch_description: "Allow to build with OpenSSL 1.1" + patch_type: "portability" + patch_source: "https://github.com/xiph/opusfile/issues/13#issuecomment-425349836" + "0.11": + - patch_file: "patches/001-disable-cert-store-integration.patch" + patch_description: "Allow to build with OpenSSL 1.1" + patch_type: "portability" + patch_source: "https://github.com/xiph/opusfile/issues/13#issuecomment-425349836" diff --git a/recipes/opusfile/all/conanfile.py b/recipes/opusfile/all/conanfile.py new file mode 100644 index 0000000000000..ec4750c742092 --- /dev/null +++ b/recipes/opusfile/all/conanfile.py @@ -0,0 +1,175 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildDeps, MSBuildToolchain +import os + +required_conan_version = ">=1.54.0" + + +class OpusFileConan(ConanFile): + name = "opusfile" + description = "stand-alone decoder library for .opus streams" + topics = ("opus", "opusfile", "audio", "decoder", "decoding", "multimedia", "sound") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xiph/opusfile" + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "http": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "http": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + 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): + self.requires("ogg/1.3.5", transitive_headers=True) + self.requires("opus/1.3.1", transitive_headers=True) + if self.options.http: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support building as shared with Visual Studio") + + 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") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.properties["WholeProgramOptimization"] = "false" + tc.generate() + deps = MSBuildDeps(self) + deps.configuration = self._msbuild_configuration + deps.generate() + else: + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-http={yes_no(self.options.http)}", + "--disable-examples", + ]) + tc.generate() + PkgConfigDeps(self).generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + sln_folder = os.path.join(self.source_folder, "win32", "VS2015") + vcxproj = os.path.join(sln_folder, "opusfile.vcxproj") + if not self.options.http: + replace_in_file(self, vcxproj, "OP_ENABLE_HTTP;", "") + + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + replace_in_file( + self, vcxproj, + "true", + "", + ) + replace_in_file( + self, vcxproj, + "v140", + f"{MSBuildToolchain(self).toolset}", + ) + import_conan_generators = "" + for props_file in [MSBuildToolchain.filename, "conandeps.props"]: + props_path = os.path.join(self.generators_folder, props_file) + if os.path.exists(props_path): + import_conan_generators += f"" + replace_in_file( + self, vcxproj, + "", + f"{import_conan_generators}", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(sln_folder, "opusfile.sln"), targets=["opusfile"]) + else: + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + include_folder = os.path.join(self.source_folder, "include") + copy(self, "*", src=include_folder, dst=os.path.join(self.package_folder, "include", "opus")) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.components["libopusfile"].set_property("pkg_config_name", "opusfile") + self.cpp_info.components["libopusfile"].libs = ["opusfile"] + self.cpp_info.components["libopusfile"].includedirs.append(os.path.join("include", "opus")) + self.cpp_info.components["libopusfile"].requires = ["ogg::ogg", "opus::opus"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["libopusfile"].system_libs = ["m", "dl", "pthread"] + + if is_msvc(self): + if self.options.http: + self.cpp_info.components["libopusfile"].requires.append("openssl::openssl") + else: + self.cpp_info.set_property("pkg_config_name", "opusfile-do-not-use") + self.cpp_info.components["opusurl"].set_property("pkg_config_name", "opusurl") + self.cpp_info.components["opusurl"].libs = ["opusurl"] + self.cpp_info.components["opusurl"].requires = ["libopusfile"] + if self.options.http: + self.cpp_info.components["opusurl"].requires.append("openssl::openssl") diff --git a/recipes/opusfile/all/patches/001-disable-cert-store-integration.patch b/recipes/opusfile/all/patches/001-disable-cert-store-integration.patch new file mode 100644 index 0000000000000..d6aaf58d662c6 --- /dev/null +++ b/recipes/opusfile/all/patches/001-disable-cert-store-integration.patch @@ -0,0 +1,33 @@ +diff -Nur opusfile-0.11/src/http.c opusfile-0.11-patched/src/http.c +--- a/src/http.c 2018-09-14 23:25:45.000000000 +0200 ++++ b/src/http.c 2018-09-27 15:42:55.161531800 +0200 +@@ -327,10 +327,12 @@ + typedef ptrdiff_t ssize_t; + # endif + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + /*Load certificates from the built-in certificate store.*/ + int SSL_CTX_set_default_verify_paths_win32(SSL_CTX *_ssl_ctx); + # define SSL_CTX_set_default_verify_paths \ + SSL_CTX_set_default_verify_paths_win32 ++#endif + + # else + /*Normal Berkeley sockets.*/ +diff -Nur opusfile-0.11/src/wincerts.c opusfile-0.11-patched/src/wincerts.c +--- a/src/wincerts.c 2017-04-22 06:01:35.000000000 +0200 ++++ b/src/wincerts.c 2018-09-27 15:42:23.832739900 +0200 +@@ -33,6 +33,8 @@ + # include + # include + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ + static int op_capi_new(X509_LOOKUP *_lu){ + HCERTSTORE h_store; + h_store=CertOpenStore(CERT_STORE_PROV_SYSTEM_A,0,0, +@@ -171,3 +173,4 @@ + } + + #endif ++#endif diff --git a/recipes/opusfile/all/test_package/CMakeLists.txt b/recipes/opusfile/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..70e83b74bb91b --- /dev/null +++ b/recipes/opusfile/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(opusfile REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE opusfile::opusfile) diff --git a/recipes/opusfile/all/test_package/conanfile.py b/recipes/opusfile/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/opusfile/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opusfile/all/test_package/test_package.c b/recipes/opusfile/all/test_package/test_package.c new file mode 100644 index 0000000000000..09418deb2e44d --- /dev/null +++ b/recipes/opusfile/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + OpusHead head; + static const unsigned char opus_data[] = { + 0x4f, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd4, + 0xd3, 0x35, 0x00, 0x00, 0x00, 0x00, 0x89, 0xe8, 0x55, 0x88, 0x01, 0x13, 0x4f, 0x70, 0x75, 0x73, + 0x48, 0x65, 0x61, 0x64, 0x00, 0x01, 0x38, 0x01, 0x80, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, + 0x67, 0x67, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd4, 0xd3 + }; + printf("opus test result: %s\n", (op_test(&head, opus_data, sizeof(opus_data)) == 0) ? "success" : "fail"); + return 0; +} diff --git a/recipes/opusfile/all/test_v1_package/CMakeLists.txt b/recipes/opusfile/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/opusfile/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/opusfile/all/test_v1_package/conanfile.py b/recipes/opusfile/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/opusfile/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/opusfile/config.yml b/recipes/opusfile/config.yml new file mode 100644 index 0000000000000..77cc7883ae5c9 --- /dev/null +++ b/recipes/opusfile/config.yml @@ -0,0 +1,5 @@ +versions: + "0.12": + folder: all + "0.11": + folder: all diff --git a/recipes/orcania/all/conandata.yml b/recipes/orcania/all/conandata.yml new file mode 100644 index 0000000000000..a6c92d3317bea --- /dev/null +++ b/recipes/orcania/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "2.3.1": + url: "https://github.com/babelouest/orcania/archive/refs/tags/v2.3.1.tar.gz" + sha256: "bbf08d563528b8ab88dd4b0e67aeb4e7c4fc9f19dcd1a0346b773cf492f7612b" +patches: + "2.3.1": + - patch_file: "patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch" + patch_description: "Fixes -Werror=stringop-truncation error when building with MinGW@Linux" + patch_type: "conan" + - patch_file: "patches/2.3.1-0002-no-m.patch" + patch_description: "m math library is not really needed" + patch_type: "conan" + - patch_file: "patches/2.3.1-0003-shared-static-conan.patch" + patch_description: "Build shared and static libraries + fix MSVC support" + patch_type: "conan" diff --git a/recipes/orcania/all/conanfile.py b/recipes/orcania/all/conanfile.py new file mode 100644 index 0000000000000..610d680187019 --- /dev/null +++ b/recipes/orcania/all/conanfile.py @@ -0,0 +1,144 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class OrcaniaConan(ConanFile): + name = "orcania" + description = "Potluck with different functions for different purposes that can be shared among C programs" + homepage = "https://github.com/babelouest/orcania" + topics = ("utility", "functions", ) + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_base64url": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_base64url": True, + } + + 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 + + def requirements(self): + if is_msvc(self) and self.options.enable_base64url: + self.requires("getopt-for-visual-studio/20200201") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BASE64URL"] = self.options.enable_base64url + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + 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, "LICENSE", os.path.join(self.source_folder), 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + save(self, os.path.join(self.package_folder, self._variable_file_rel_path), + textwrap.dedent(f"""\ + set(ORCANIA_VERSION_STRING "{self.version}") + """)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {} if self.options.shared else {"Orcania::Orcania-static": "Orcania::Orcania"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _variable_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + libname = "orcania" + if is_msvc(self) and not self.options.shared: + libname += "-static" + self.cpp_info.libs = [libname] + + target_name = "Orcania::Orcania" if self.options.shared else "Orcania::Orcania-static" + self.cpp_info.set_property("cmake_file_name", "Orcania") + self.cpp_info.set_property("cmake_target_name", target_name) + self.cpp_info.set_property("cmake_module_file_name", "Orcania") + self.cpp_info.set_property("cmake_module_target_name", target_name) + self.cpp_info.set_property("pkg_config_name", "liborcania") + self.cpp_info.set_property("cmake_build_modules", [self._variable_file_rel_path]) + + 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.filenames["cmake_find_package"] = "Orcania" + self.cpp_info.filenames["cmake_find_package_multi"] = "Orcania" + self.cpp_info.names["cmake_find_package"] = "Orcania" + self.cpp_info.names["cmake_find_package_multi"] = "Orcania" + self.cpp_info.names["pkg_config"] = "liborcania" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path, self._variable_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, self._variable_file_rel_path] diff --git a/recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch b/recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch new file mode 100644 index 0000000000000..d44e1abf5481a --- /dev/null +++ b/recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch @@ -0,0 +1,25 @@ +Fixes: +In function 'o_strncpy', + inlined from 'mstrcatf' at /home/maarten/programming/orcania/src/orcania.c:131:11: +/home/maarten/programming/orcania/src/orcania.c:208:12: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] + 208 | return strncpy(p1, p2, n); + | ^~~~~~~~~~~~~~~~~~ +/home/maarten/programming/orcania/src/orcania.c: In function 'mstrcatf': +/home/maarten/programming/orcania/src/orcania.c:343:12: note: length computed here + 343 | return strlen(s); + | ^~~~~~~~~ + + +--- src/orcania.c ++++ src/src/orcania.c +@@ -148,8 +148,8 @@ char * mstrcatf(char * source, const char * message, ...) { + out = o_malloc(source_len+message_formatted_len+sizeof(char)); + vsnprintf(message_formatted, (message_formatted_len+sizeof(char)), message, argp_cpy); + if (out != NULL) { +- o_strncpy(out, source, source_len); +- o_strncpy(out+source_len, message_formatted, message_formatted_len); ++ memcpy(out, source, source_len); ++ memcpy(out+source_len, message_formatted, message_formatted_len); + out[source_len+message_formatted_len] = '\0'; + } + o_free(message_formatted); diff --git a/recipes/orcania/all/patches/2.3.1-0002-no-m.patch b/recipes/orcania/all/patches/2.3.1-0002-no-m.patch new file mode 100644 index 0000000000000..30c401f4a359d --- /dev/null +++ b/recipes/orcania/all/patches/2.3.1-0002-no-m.patch @@ -0,0 +1,9 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -34,1 +34,1 @@ +-set(LIBS "-lm") ++set(LIBS ) +--- src/base64.c ++++ src/base64.c +@@ -10,1 +11,0 @@ +-#include diff --git a/recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch b/recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch new file mode 100644 index 0000000000000..ff2311a44bd70 --- /dev/null +++ b/recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch @@ -0,0 +1,156 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -112,29 +112,47 @@ + + # static library + ++option(BUILD_SHARED "Build shared library." ON) + option(BUILD_STATIC "Build static library." OFF) + ++if (NOT BUILD_STATIC AND NOT BUILD_SHARED) ++ message(FATAL_ERROR "BUILD_SHAREDand BUILD_STATIC cannot be both disabled") ++endif () ++ + if (BUILD_STATIC) + add_library(orcania_static STATIC ${LIB_SRC}) ++ set_target_properties(orcania_static PROPERTIES ++ PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h") + target_compile_definitions(orcania_static PUBLIC -DO_STATIC_LIBRARY) + set_target_properties(orcania_static PROPERTIES + OUTPUT_NAME orcania) ++ if (MSVC) ++ set_target_properties(orcania_static PROPERTIES ++ OUTPUT_NAME orcania-static) ++ endif () ++ set(orcania_lib orcania_static) + endif () + + # shared library + +-add_library(orcania SHARED ${LIB_SRC}) +-if (NOT MSVC) ++if (BUILD_SHARED) ++ add_library(orcania SHARED ${LIB_SRC}) + set_target_properties(orcania PROPERTIES +- COMPILE_OPTIONS -Wextra +- PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h" +- VERSION "${LIBRARY_VERSION}" +- SOVERSION "${LIBRARY_SOVERSION}") +-endif() +-if (WIN32) +- set_target_properties(orcania PROPERTIES SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll") ++ PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h") ++ if (NOT MSVC) ++ set_target_properties(orcania PROPERTIES ++ COMPILE_OPTIONS -Wextra ++ VERSION "${LIBRARY_VERSION}" ++ SOVERSION "${LIBRARY_SOVERSION}") ++ endif() ++ if (WIN32) ++ set_target_properties(orcania PROPERTIES ++ SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll" ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++ endif () ++ target_link_libraries(orcania ${LIBS}) ++ set(orcania_lib orcania) + endif () +-target_link_libraries(orcania ${LIBS}) + + # documentation + +@@ -165,10 +183,14 @@ + if (BUILD_BASE64URL) + add_executable(base64url ${BASE64URL_DIR}/base64url.c ${INC_DIR}/orcania.h ${PROJECT_BINARY_DIR}/orcania-cfg.h) + set_target_properties(base64url PROPERTIES SKIP_BUILD_RPATH TRUE) +- add_dependencies(base64url orcania) +- target_link_libraries(base64url orcania ${LIBS}) ++ add_dependencies(base64url ${orcania_lib}) ++ target_link_libraries(base64url ${orcania_lib} ${LIBS}) + install(TARGETS base64url RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES ${BASE64URL_DIR}/base64url.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT runtime) ++ if(MSVC) ++ find_package(getopt-for-visual-studio REQUIRED) ++ target_link_libraries(base64url getopt-for-visual-studio::getopt-for-visual-studio) ++ endif() + endif () + + # tests +@@ -244,9 +266,12 @@ + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liborcania.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +-set(TARGETS orcania) ++set(TARGETS ) ++if (BUILD_SHARED) ++ list(APPEND TARGETS orcania) ++endif () + if (BUILD_STATIC) +- set(TARGETS ${TARGETS} orcania_static) ++ list(APPEND TARGETS orcania_static) + endif () + + if (INSTALL_HEADER) +@@ -320,6 +345,7 @@ + COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + + message(STATUS "Force inline implementation of strstr: ${WITH_STRSTR}") ++message(STATUS "Build shared library: ${BUILD_SHARED}") + message(STATUS "Build static library: ${BUILD_STATIC}") + message(STATUS "Build testing tree: ${BUILD_ORCANIA_TESTING}") + message(STATUS "Install the header files: ${INSTALL_HEADER}") +--- src/orcania.c ++++ src/orcania.c +@@ -38,6 +38,13 @@ + #define strcasecmp _stricmp + #endif + ++#ifdef _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#else ++#include ++#endif ++ + /** + * + * Orcania library +--- tools/base64url/base64url.c ++++ tools/base64url/base64url.c +@@ -19,13 +19,20 @@ + * + */ + +-#include + #include + #include + #include + #include + #include + ++#ifdef _MSC_VER ++#include ++#include ++typedef SSIZE_T ssize_t; ++#else ++#include ++#endif ++ + #define _BASE64URL_VERSION "0.9" + + #define ACTION_ENCODE 0 +@@ -98,12 +105,12 @@ + } + + static unsigned char * get_stdin_content(size_t * length) { +- int size = 100; +- unsigned char * out = NULL, buffer[size]; ++#define SIZE 100 ++ unsigned char * out = NULL, buffer[SIZE]; + ssize_t read_length; + + *length = 0; +- while ((read_length = read(0, buffer, size)) > 0) { ++ while ((read_length = read(0, buffer, SIZE)) > 0) { + out = o_realloc(out, (*length)+read_length+1); + memcpy(out+(*length), buffer, read_length); + (*length) += read_length; diff --git a/recipes/orcania/all/test_package/CMakeLists.txt b/recipes/orcania/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3fa9c9d5af35f --- /dev/null +++ b/recipes/orcania/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Orcania REQUIRED CONFIG) + +option(ORCANIA_SHARED "Orcania is built as a shared library") + +add_executable(${PROJECT_NAME} test_package.c) +if(ORCANIA_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania-static) +endif() diff --git a/recipes/orcania/all/test_package/conanfile.py b/recipes/orcania/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0fc1e7b663eaf --- /dev/null +++ b/recipes/orcania/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ORCANIA_SHARED"] = self.dependencies["orcania"].options.shared + 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/orcania/all/test_package/test_package.c b/recipes/orcania/all/test_package/test_package.c new file mode 100644 index 0000000000000..f8bd394a51f33 --- /dev/null +++ b/recipes/orcania/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int main() { + const char *mystring = "Hello world!"; + char* str2 = o_strdup(mystring); + puts(str2); + free(str2); + return 0; +} diff --git a/recipes/orcania/all/test_v1_package/CMakeLists.txt b/recipes/orcania/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..08501e6ccb845 --- /dev/null +++ b/recipes/orcania/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Orcania REQUIRED CONFIG) + +option(ORCANIA_SHARED "Orcania is built as a shared library") + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(ORCANIA_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania-static) +endif() diff --git a/recipes/orcania/all/test_v1_package/conanfile.py b/recipes/orcania/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..79db5a07b9c06 --- /dev/null +++ b/recipes/orcania/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ORCANIA_SHARED"] = self.options["orcania"].shared + 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/orcania/config.yml b/recipes/orcania/config.yml new file mode 100644 index 0000000000000..215bc57fe4993 --- /dev/null +++ b/recipes/orcania/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.1": + folder: all diff --git a/recipes/osgearth/all/CMakeLists.txt b/recipes/osgearth/all/CMakeLists.txt new file mode 100644 index 0000000000000..1dc2e9e4778f3 --- /dev/null +++ b/recipes/osgearth/all/CMakeLists.txt @@ -0,0 +1,85 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32) + add_compile_definitions(NOGDI) +endif() + +if(MSVC) + add_compile_options(/bigobj) +endif() + +# osgearth ships with custom cmake find modules. Unfortunately these set +# different variables than the ones generated by conan (most notably *_LIBRARY +# instead of *_LIBRARIES, but also different names). In the following +# these different variables are set using the variables set by conan's +# find modules. + +# OSG +find_package(OpenSceneGraph REQUIRED) + +set(OSG_PLUGINS "osgPlugins-${OPENSCENEGRAPH_VERSION}" CACHE STRING "" FORCE) +set(OSG_LIBRARY ${OPENSCENEGRAPH_LIBRARIES}) +set(OSG_FOUND ${OPENSCENEGRAPH_FOUND}) +set(OSG_INCLUDE_DIRS ${OPENSCENEGRAPH_INCLUDE_DIRS}) +set(OSG_INCLUDE_DIR "${OPENSCENEGRAPH_INCLUDE_DIRS}") +set(OSG_GEN_INCLUDE_DIR "${OPENSCENEGRAPH_INCLUDE_DIRS}") + +# gdal +find_package(GDAL REQUIRED) +set(GDAL_LIBRARY ${GDAL_LIBRARIES}) + +# curl +find_package(CURL REQUIRED) +set(CURL_LIBRARY ${CURL_LIBRARIES}) + +# protobuf +find_package(Protobuf) +set(Protobuf_INCLUDE_DIR ${protobuf_INCLUDE_DIR}) +set(Protobuf_LIBRARIES ${protobuf_LIBRARIES}) + +# GEOS +if (OSGEARTH_WITH_GEOS) + find_package(geos) +endif () +set(GEOS_LIBRARY ${GEOS_LIBS}) +set(GEOS_FOUND ${GEOS_LIBRARY}) + +# SQLite3 +if (OSGEARTH_WITH_SQLITE3) + find_package(SQLite3) +endif () +set(SQLITE3_FOUND ${SQLite3_FOUND}) +set(SQLITE3_LIBRARY ${SQLite_LIBRARIES}) +set(SQLITE3_INCLUDE_DIR ${SQLite_INCLUDE_DIR}) + +# WebP +if (OSGEARTH_WITH_WEBP) + find_package(WebP) +endif () +set(WEBP_FOUND ${WebP_FOUND}) +set(WEBP_LIBRARY ${WebP_LIBRARIES}) +set(WEBP_INCLUDE_DIR ${WebP_INCLUDE_DIR}) + +# libzip +if (OSGEARTH_BUILD_ZIP_PLUGIN) + find_package(LIBZIP) +endif () +set(LIBZIP_FOUND ${libzip_FOUND}) +set(LIBZIP_LIBRARY ${libzip_LIBRARIES}) +set(LIBZIP_INCLUDE_DIR ${libzip_INCLUDE_DIR}) + +# leveldb +find_package(leveldb) +set(LEVELDB_FOUND ${leveldb_FOUND}) +set(LEVELDB_LIBRARY ${leveldb_LIBRARIES}) +set(LEVELDB_INCLUDE_DIR ${leveldb_INCLUDE_DIR}) + +find_package(RapidJSON) + +find_package(lerc) + +add_subdirectory(source_subfolder) diff --git a/recipes/osgearth/all/conandata.yml b/recipes/osgearth/all/conandata.yml new file mode 100644 index 0000000000000..ac17a453ee754 --- /dev/null +++ b/recipes/osgearth/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + '3.3': + sha256: 4b4a8ba70e707c6aae7d2fe2904b8761e9827398ddeb60633938fe486f5fa622 + url: https://github.com/gwaldron/osgearth/archive/refs/tags/osgearth-3.3.tar.gz + '3.2': + sha256: 7e1dd643b1f3b8d1ba9561b899c18176af988342b86c42d89a70be924cb747f6 + url: https://github.com/gwaldron/osgearth/archive/refs/tags/osgearth-3.2.tar.gz +patches: + '3.2': + - patch_file: patches/3.2-osgearth.patch + base_path: source_subfolder + '3.3': + - patch_file: patches/3.3-osgearth.patch + base_path: source_subfolder diff --git a/recipes/osgearth/all/conanfile.py b/recipes/osgearth/all/conanfile.py new file mode 100644 index 0000000000000..5e59c1a6652d9 --- /dev/null +++ b/recipes/osgearth/all/conanfile.py @@ -0,0 +1,302 @@ +from conans import ConanFile, CMake, tools +from conan.tools.files import rename +from conans.errors import ConanInvalidConfiguration +from conans.tools import os_info +import os +import functools + +required_conan_version = ">=1.33.0" + +class OsgearthConan(ConanFile): + name = "osgearth" + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + description = "osgEarth is a C++ geospatial SDK and terrain engine. \ + Just create a simple XML file, point it at your map data, \ + and go! osgEarth supports all kinds of data and comes with \ + lots of examples to help you get up and running quickly \ + and easily." + topics = "openscenegraph", "graphics" + settings = "os", "compiler", "build_type", "arch" + homepage = "http://osgearth.org/" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_procedural_nodekit": [True, False], + # "build_triton_nodekit": [True, False], + # "build_silverlining_nodekit": [True, False], + "build_leveldb_cache": [True, False], + "build_rocksdb_cache": [True, False], + "build_zip_plugin": [True, False], + "enable_geocoder": [True, False], + "with_geos": [True, False], + "with_sqlite3": [True, False], + "with_draco": [True, False], + # "with_basisu": [True, False], + # "with_glew": [True, False], + "with_protobuf": [True, False], + "with_webp": [True, False], + "install_shaders": [True, False], + "enable_nvtt_cpu_mipmaps": [True, False], + "enable_wininet_for_http": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "build_procedural_nodekit": True, + # "build_triton_nodekit": False, + # "build_silverlining_nodekit": False, + "build_leveldb_cache": False, + "build_rocksdb_cache": False, + "build_zip_plugin": True, + "enable_geocoder": False, + "with_geos": True, + "with_sqlite3": True, + "with_draco": False, + # "with_basisu": False, + # "with_glew": True, + "with_protobuf": True, + "with_webp": True, + "install_shaders": True, + "enable_nvtt_cpu_mipmaps": False, + "enable_wininet_for_http": False, + } + + short_paths = True + exports_sources = "CMakeLists.txt", "patches/*.patch" + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + elif self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("With apple-clang cppstd needs to be set, since default is not at least c++11.") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def config_options(self): + if self.settings.os != "Windows": + self.options.enable_wininet_for_http = False + + if self.settings.os == "Windows": + del self.options.fPIC + + if self.settings.compiler == "Visual Studio": + self.options.build_procedural_nodekit = False + + if self.settings.compiler == "gcc" and self.settings.compiler.version == "11": + # need draco >= 1.4.0 for gcc11 + # https://github.com/google/draco/issues/635 + self.options.with_draco = False + + def requirements(self): + + self.requires("opengl/system") + self.requires("gdal/3.4.3") + self.requires("openscenegraph/3.6.5") + self.requires("libcurl/7.83.1") + self.requires("lerc/2.2") + self.requires("rapidjson/1.1.0") + + self.requires("zlib/1.2.12", override=True) + self.requires("libtiff/4.3.0", override=True) + self.requires("openssl/1.1.1l", override=True) + + # if self.options.build_triton_nodekit: + # self.requires("triton_nodekit") + # if self.options.build_silverlining_nodekit: + # self.requires("silverlining_nodekit") + if self.options.build_leveldb_cache: + self.requires("leveldb/1.22") + if self.options.build_rocksdb_cache: + self.requires("rocksdb/6.20.3") + if self.options.build_zip_plugin: + self.requires("zstd/1.4.9") # override + if self.options.with_geos: + self.requires("geos/3.10.2") + if self.options.with_sqlite3: + self.requires("sqlite3/3.38.5") + if self.options.with_draco: + self.requires("draco/1.4.3") + # if self.options.with_basisu: + # self.requires("basisu") + # if self.options.with_glew: + # self.requires("glew/2.2.0") + if self.options.with_protobuf: + self.requires("protobuf/3.17.1") + if self.options.with_webp: + self.requires("libwebp/1.2.0") + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + for package in ("Draco", "GEOS", "LevelDB", "OSG", "RocksDB", "Sqlite3", "WEBP"): + # Prefer conan's find package scripts over osgEarth's + os.unlink(os.path.join(self._source_subfolder, "CMakeModules", "Find{}.cmake".format(package))) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + self._patch_sources() + + @functools.lru_cache(1) + def _configured_cmake(self): + cmake = CMake(self) + cmake.definitions["OSGEARTH_BUILD_SHARED_LIBS"] = self.options.shared + cmake.definitions["OSGEARTH_BUILD_TOOLS"] = False + cmake.definitions["OSGEARTH_BUILD_EXAMPLES"] = False + cmake.definitions["OSGEARTH_BUILD_TESTS"] = False + + cmake.definitions["OSGEARTH_BUILD_PROCEDURAL_NODEKIT"] = self.options.build_procedural_nodekit + # cmake.definitions["OSGEARTH_BUILD_TRITON_NODEKIT"] = self.options.build_triton_nodekit + # cmake.definitions["OSGEARTH_BUILD_SILVERLINING_NODEKIT"] = self.options.build_silverlining_nodekit + cmake.definitions["OSGEARTH_BUILD_LEVELDB_CACHE"] = self.options.build_leveldb_cache + cmake.definitions["OSGEARTH_BUILD_ROCKSDB_CACHE"] = self.options.build_rocksdb_cache + cmake.definitions["OSGEARTH_BUILD_ZIP_PLUGIN"] = self.options.build_zip_plugin + cmake.definitions["OSGEARTH_ENABLE_GEOCODER"] = self.options.enable_geocoder + + cmake.definitions["WITH_EXTERNAL_DUKTAPE"] = False + cmake.definitions["WITH_EXTERNAL_TINYXML"] = False + cmake.definitions["CURL_IS_STATIC"] = not self.options["libcurl"].shared + cmake.definitions["CURL_INCLUDE_DIR"] = self.deps_cpp_info["libcurl"].include_paths[0] + cmake.definitions["OSGEARTH_INSTALL_SHADERS"] = self.options.install_shaders + cmake.definitions["OSGEARTH_ENABLE_NVTT_CPU_MIPMAPS"] = self.options.enable_nvtt_cpu_mipmaps + cmake.definitions["OSGEARTH_ENABLE_WININET_FOR_HTTP"] = self.options.enable_wininet_for_http + + # our own defines for using in our top-level CMakeLists.txt + cmake.definitions["OSGEARTH_WITH_GEOS"] = self.options.with_geos + cmake.definitions["OSGEARTH_WITH_SQLITE3"] = self.options.with_sqlite3 + cmake.definitions["OSGEARTH_WITH_WEBP"] = self.options.with_webp + + cmake.configure() + + return cmake + + def build(self): + self._configured_cmake().build() + + def package(self): + self._configured_cmake().install() + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + + if self.options.install_shaders: + rename(self, os.path.join(self.package_folder, "resources"), os.path.join(self.package_folder, "res")) + + if os_info.is_linux: + rename(self, os.path.join(self.package_folder, "lib64"), os.path.join(self.package_folder, "lib")) + + tools.rmdir(os.path.join(self.package_folder, "cmake")) + + def package_info(self): + if self.settings.build_type == "Debug": + postfix = "d" + elif self.settings.build_type == "RelWithDebInfo": + postfix = "rd" + elif self.settings.build_type == "MinSizeRel": + postfix = "s" + else: + postfix = "" + + def setup_lib(library, required_components): + lib = self.cpp_info.components[library] + lib.libs = [library + postfix] + + for source_lib, components in required_components.items(): + lib.requires += [source_lib + "::" + comp for comp in components] + + return lib + + # osgEarth the main lib + required_libs = {"openscenegraph": ["osg", "osgUtil", "osgSim", "osgViewer", "osgText", "osgGA", "osgShadow", + "OpenThreads", "osgManipulator"], + "libcurl": ["libcurl"], + "gdal": ["gdal"], + "opengl": ["opengl"], + } + + osgearth = setup_lib("osgEarth", required_libs) + + if not self.options.shared and self.settings.compiler == "Visual Studio": + osgearth.defines += ["OSGEARTH_LIBRARY_STATIC"] + if self.options.build_zip_plugin: + osgearth.requires += ["zstd::zstd"] + if self.options.with_geos: + osgearth.requires += ["geos::geos"] + if self.options.with_sqlite3: + osgearth.requires += ["sqlite3::sqlite3"] + if self.options.with_protobuf: + osgearth.requires += ["protobuf::protobuf"] + if self.options.with_webp: + osgearth.requires += ["libwebp::libwebp"] + + # osgEarthProcedural + if self.options.build_procedural_nodekit: + setup_lib("osgEarthProcedural", {}).requires.append("osgEarth") + + # plugins + def setup_plugin(plugin): + libname = "osgdb_" + plugin + plugin_library = self.cpp_info.components[libname] + plugin_library.libs = [] if self.options.shared else [libname + postfix] + plugin_library.requires = ["osgEarth"] + if not self.options.shared: + plugin_library.libdirs = [os.path.join("lib", "osgPlugins-{}" + .format(self.deps_cpp_info["openscenegraph"].version))] + return plugin_library + + setup_plugin("osgearth_bumpmap") + setup_plugin("osgearth_cache_filesystem") + + if self.options.build_leveldb_cache: + setup_plugin("osgearth_cache_leveldb").requires.append("leveldb::leveldb") + + if self.options.build_rocksdb_cache: + setup_plugin("osgearth_cache_rocksdb").requires.append("rocksdb::rocksdb") + + setup_plugin("osgearth_bumpmap") + setup_plugin("osgearth_cache_filesystem") + setup_plugin("osgearth_colorramp") + setup_plugin("osgearth_detail") + setup_plugin("earth") + setup_plugin("osgearth_engine_rex") + setup_plugin("osgearth_featurefilter_intersect") + setup_plugin("osgearth_featurefilter_join") + setup_plugin("gltf").requires.append("rapidjson::rapidjson") + setup_plugin("kml") + setup_plugin("osgearth_mapinspector") + setup_plugin("osgearth_monitor") + setup_plugin("osgearth_scriptengine_javascript") + setup_plugin("osgearth_sky_gl") + setup_plugin("osgearth_sky_simple") + setup_plugin("template") + setup_plugin("osgearth_terrainshader") + + if self.options.with_webp: + setup_plugin("webp").requires.append("libwebp::libwebp") + + setup_plugin("lerc").requires.append("lerc::lerc") + setup_plugin("osgearth_vdatum_egm2008") + setup_plugin("osgearth_vdatum_egm84") + setup_plugin("osgearth_vdatum_egm96") + setup_plugin("osgearth_viewpoints") + setup_plugin("fastdxt") + + if self.settings.os == "Windows": + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin/osgPlugins-{}" + .format(self.deps_cpp_info["openscenegraph"].version))) + elif self.settings.os == "Linux": + self.env_info.LD_LIBRARY_PATH.append(os.path.join(self.package_folder, "lib")) diff --git a/recipes/osgearth/all/patches/3.2-osgearth.patch b/recipes/osgearth/all/patches/3.2-osgearth.patch new file mode 100644 index 0000000000000..868d3cb626660 --- /dev/null +++ b/recipes/osgearth/all/patches/3.2-osgearth.patch @@ -0,0 +1,197 @@ +diff --git a/src/osgEarthDrivers/lerc/CMakeLists.txt b/src/osgEarthDrivers/lerc/CMakeLists.txt +--- a/src/osgEarthDrivers/lerc/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthDrivers/lerc/CMakeLists.txt (date 1653145387687) +@@ -1,17 +1,11 @@ +-INCLUDE_DIRECTORIES( ../../third_party/lerc ) ++INCLUDE_DIRECTORIES( ${lerc_INCLUDE_DIR} ) + + SET(TARGET_SRC + ReaderWriterLERC.cpp +- ../../third_party/lerc/BitMask.cpp +- ../../third_party/lerc/BitStuffer2.cpp +- ../../third_party/lerc/Huffman.cpp +- ../../third_party/lerc/Lerc.cpp +- ../../third_party/lerc/Lerc_c_api_impl.cpp +- ../../third_party/lerc/Lerc2.cpp +- ../../third_party/lerc/RLE.cpp +- ../../third_party/lerc/Lerc1Decode/BitStuffer.cpp +- ../../third_party/lerc/Lerc1Decode/CntZImage.cpp + ) ++ ++ ++SET(TARGET_LIBRARIES_VARS lerc_LIBRARIES) + + #### end var setup ### + SETUP_PLUGIN(lerc) +\ No newline at end of file +diff --git a/src/osgEarthProcedural/GroundCoverLayer.cpp b/src/osgEarthProcedural/GroundCoverLayer.cpp +--- a/src/osgEarthProcedural/GroundCoverLayer.cpp (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthProcedural/GroundCoverLayer.cpp (date 1639490999900) +@@ -1329,7 +1329,8 @@ + void + GroundCoverLayer::Renderer::releaseGLObjects(osg::State* state) const + { +- _cameraState.forEach(CameraStateRGLO(state)); ++ CameraStateRGLO state_rglo(state); ++ _cameraState.forEach(state_rglo); + + if (_texArena.valid()) + { +diff --git a/src/osgEarthProcedural/LifeMapLayer.cpp b/src/osgEarthProcedural/LifeMapLayer.cpp +--- a/src/osgEarthProcedural/LifeMapLayer.cpp (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthProcedural/LifeMapLayer.cpp (date 1639490999912) +@@ -206,7 +206,7 @@ + std::vector> hits; + + if (_index.Search(a_min, a_max, &hits, ~0) == 0) +- return false; ++ return nullptr; + + const LifeMapValue* result = nullptr; + +@@ -223,7 +223,7 @@ + return result; + } + } +- return false; ++ return nullptr; + } + }; + } +diff --git a/src/osgEarth/Units b/src/osgEarth/Units +--- a/src/osgEarth/Units (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarth/Units (date 1639490999868) +@@ -196,17 +196,17 @@ + class qualified_double + { + public: +- qualified_double( double value, const Units& units ) : _value(value), _units(units) { } ++ qualified_double( double value, const Units& units ) : _value(value), _units(units) { } + +- qualified_double( const T& rhs ) : _value(rhs._value), _units(rhs._units) { } ++ qualified_double( const T& rhs ) : _value(rhs._value), _units(rhs._units) { } + + // parses the qualified number from a parseable string (e.g., "123km") +- qualified_double(const std::string& parseable, const Units& defaultUnits) : _value(0.0), _units(defaultUnits) { ++ qualified_double(const std::string& parseable, const Units& defaultUnits) : _value(0.0), _units(defaultUnits) { + Units::parse( parseable, _value, _units, defaultUnits ); + } + + // loads the qualified number from an old-school config (e.g., { value="123" units="km" } ) +- qualified_double( const Config& conf, const Units& defaultUnits ) : _value(0.0) { ++ qualified_double( const Config& conf, const Units& defaultUnits ) : _value(0.0) { + if ( conf.hasValue("value") ) { + _value = conf.value("value", 0.0); + if ( !Units::parse( conf.value("units"), _units ) ) +diff --git a/src/osgEarthProcedural/CMakeLists.txt b/src/osgEarthProcedural/CMakeLists.txt +--- a/src/osgEarthProcedural/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthProcedural/CMakeLists.txt (date 1639490999885) +@@ -102,4 +102,5 @@ + # Add this project to the NodeKits solution folder + set_property( TARGET ${LIB_NAME} PROPERTY FOLDER "NodeKits" ) + +-INCLUDE(ModuleInstall OPTIONAL) +\ No newline at end of file ++INCLUDE(ModuleInstall OPTIONAL) ++INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/source_subfolder/src/osgEarth) +\ No newline at end of file +diff --git a/src/osgEarth/CMakeLists.txt b/src/osgEarth/CMakeLists.txt +--- a/src/osgEarth/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarth/CMakeLists.txt (date 1639490999857) +@@ -494,7 +494,7 @@ + + + SET(VERSION_GIT_SOURCE "") +-find_package(git) ++find_package(Git) + if (GIT_FOUND) + option(OSGEARTH_EMBED_GIT_SHA "Encode the SHA in the Version header code" OFF) + if(OSGEARTH_EMBED_GIT_SHA) +diff --git a/src/osgEarthDrivers/fastdxt/dxt.cpp b/src/osgEarthDrivers/fastdxt/dxt.cpp +--- a/src/osgEarthDrivers/fastdxt/dxt.cpp (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthDrivers/fastdxt/dxt.cpp (date 1639491170857) +@@ -119,7 +119,11 @@ + int &outputBytes ) + { + byte *tmpBuf; ++#ifdef __MINGW32__ ++ tmpBuf = (byte*)__mingw_aligned_malloc(width*height*4,16); ++#else + tmpBuf = (byte*)memalign(16, width*height*4); ++#endif + memset(tmpBuf, 0, width*height*4); + RGBAtoYCoCg(inBuf, tmpBuf, width, height); + CompressImageDXT5(tmpBuf, outBuf, width, height, outputBytes); +diff --git a/CMakeModules/OsgEarthMacroUtils.cmake b/CMakeModules/OsgEarthMacroUtils.cmake +--- a/CMakeModules/OsgEarthMacroUtils.cmake (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/CMakeModules/OsgEarthMacroUtils.cmake (date 1639490999842) +@@ -505,7 +505,7 @@ + + # generate the build-time script that will create out cpp file with inline shaders: + configure_file( +- "${CMAKE_SOURCE_DIR}/CMakeModules/ConfigureShaders.cmake.in" ++ "${CMAKE_SOURCE_DIR}/source_subfolder/CMakeModules/ConfigureShaders.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureShaders.cmake" + @ONLY) + +@@ -518,7 +518,7 @@ + DEPENDS + ${GLSL_FILES} + "${TEMPLATE_FILE}" +- "${CMAKE_SOURCE_DIR}/CMakeModules/ConfigureShaders.cmake.in" ) ++ "${CMAKE_SOURCE_DIR}/source_subfolder/CMakeModules/ConfigureShaders.cmake.in" ) + + endmacro(configure_shaders) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/CMakeLists.txt (date 1639490999923) +@@ -127,29 +127,14 @@ + find_package(OpenGL) + ENDIF (OSGEARTH_USE_GLES) + +-# required +-find_package(OSG REQUIRED) +-find_package(CURL REQUIRED) +-find_package(GDAL REQUIRED) +- + # optional +-find_package(GEOS) +-find_package(Sqlite3) +-find_package(Draco) +-find_package(BASISU) + find_package(GLEW) +-find_package(Protobuf) +-find_package(WEBP) + find_package(Blend2D) + + if(OSGEARTH_ENABLE_PROFILING) + find_package(Tracy) + endif() + +-if(OSGEARTH_BUILD_ZIP_PLUGIN) +- find_package(LIBZIP) +-endif() +- + if(OSGEARTH_BUILD_TRITON_NODEKIT) + find_package(Triton QUIET) + endif() +@@ -216,7 +201,8 @@ + INCLUDE(OsgEarthMacroUtils) + + # OpenSceneGraph is the 3D rendering toolkit +-DETECT_OSG_VERSION() ++set(OPENSCENEGRAPH_VERSION "3.6.5") ++set(OSG_PLUGINS "osgPlugins-${OPENSCENEGRAPH_VERSION}" CACHE STRING "" FORCE) + + IF (NOT OPENSCENEGRAPH_VERSION) + SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) +diff --git a/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt b/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt +--- a/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt (date 1639490999877) +@@ -1,5 +1,3 @@ +-FIND_PACKAGE(LevelDB) +- + IF(LEVELDB_FOUND) + + INCLUDE_DIRECTORIES( ${LEVELDB_INCLUDE_DIR} ) diff --git a/recipes/osgearth/all/patches/3.3-osgearth.patch b/recipes/osgearth/all/patches/3.3-osgearth.patch new file mode 100644 index 0000000000000..c32207741b221 --- /dev/null +++ b/recipes/osgearth/all/patches/3.3-osgearth.patch @@ -0,0 +1,165 @@ +diff --git a/src/osgEarthDrivers/lerc/CMakeLists.txt b/src/osgEarthDrivers/lerc/CMakeLists.txt +--- a/src/osgEarthDrivers/lerc/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthDrivers/lerc/CMakeLists.txt (date 1653145387687) +@@ -1,17 +1,11 @@ +-INCLUDE_DIRECTORIES( ../../third_party/lerc/include ) ++INCLUDE_DIRECTORIES( ${lerc_INCLUDE_DIR} ) + + SET(TARGET_SRC + ReaderWriterLERC.cpp +- ../../third_party/lerc/src/LercLib/BitMask.cpp +- ../../third_party/lerc/src/LercLib/BitStuffer2.cpp +- ../../third_party/lerc/src/LercLib/Huffman.cpp +- ../../third_party/lerc/src/LercLib/Lerc.cpp +- ../../third_party/lerc/src/LercLib/Lerc_c_api_impl.cpp +- ../../third_party/lerc/src/LercLib/Lerc2.cpp +- ../../third_party/lerc/src/LercLib/RLE.cpp +- ../../third_party/lerc/src/LercLib/Lerc1Decode/BitStuffer.cpp +- ../../third_party/lerc/src/LercLib/Lerc1Decode/CntZImage.cpp + ) ++ ++ ++SET(TARGET_LIBRARIES_VARS lerc_LIBRARIES) + + #### end var setup ### + SETUP_PLUGIN(lerc) +\ No newline at end of file +diff --git a/src/osgEarth/CMakeLists.txt b/src/osgEarth/CMakeLists.txt +--- a/src/osgEarth/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarth/CMakeLists.txt (date 1652372070543) +@@ -503,7 +503,7 @@ + + + SET(VERSION_GIT_SOURCE "") +-find_package(git) ++find_package(Git) + if (GIT_FOUND) + option(OSGEARTH_EMBED_GIT_SHA "Encode the SHA in the Version header code" OFF) + if(OSGEARTH_EMBED_GIT_SHA) +diff --git a/src/osgEarthProcedural/GroundCoverLayer.cpp b/src/osgEarthProcedural/GroundCoverLayer.cpp +--- a/src/osgEarthProcedural/GroundCoverLayer.cpp (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthProcedural/GroundCoverLayer.cpp (date 1652372070576) +@@ -1302,7 +1302,8 @@ + void + GroundCoverLayer::Renderer::releaseGLObjects(osg::State* state) const + { +- _cameraState.forEach(CameraStateRGLO(state)); ++ CameraStateRGLO state_rglo(state); ++ _cameraState.forEach(state_rglo); + + if (_texArena.valid()) + { +diff --git a/src/osgEarthProcedural/CMakeLists.txt b/src/osgEarthProcedural/CMakeLists.txt +--- a/src/osgEarthProcedural/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthProcedural/CMakeLists.txt (date 1652372099890) +@@ -107,4 +107,5 @@ + # Place it in the NodeKits solution folder + set_property( TARGET ${LIB_NAME} PROPERTY FOLDER "NodeKits" ) + +-INCLUDE(ModuleInstall OPTIONAL) +\ No newline at end of file ++INCLUDE(ModuleInstall OPTIONAL) ++INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/source_subfolder/src/osgEarth) +\ No newline at end of file +diff --git a/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt b/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt +--- a/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt (date 1652372099900) +@@ -1,5 +1,3 @@ +-FIND_PACKAGE(LevelDB) +- + IF(LEVELDB_FOUND) + + INCLUDE_DIRECTORIES( ${LEVELDB_INCLUDE_DIR} ) +diff --git a/CMakeModules/OsgEarthMacroUtils.cmake b/CMakeModules/OsgEarthMacroUtils.cmake +--- a/CMakeModules/OsgEarthMacroUtils.cmake (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/CMakeModules/OsgEarthMacroUtils.cmake (date 1652372099916) +@@ -512,7 +512,7 @@ + + # generate the build-time script that will create out cpp file with inline shaders: + configure_file( +- "${CMAKE_SOURCE_DIR}/CMakeModules/ConfigureShaders.cmake.in" ++ "${CMAKE_SOURCE_DIR}/source_subfolder/CMakeModules/ConfigureShaders.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureShaders.cmake" + @ONLY) + +@@ -525,7 +525,7 @@ + DEPENDS + ${GLSL_FILES} + "${TEMPLATE_FILE}" +- "${CMAKE_SOURCE_DIR}/CMakeModules/ConfigureShaders.cmake.in" ) ++ "${CMAKE_SOURCE_DIR}/source_subfolder/CMakeModules/ConfigureShaders.cmake.in" ) + + endmacro(configure_shaders) + +diff --git a/src/osgEarthDrivers/gltf/CMakeLists.txt b/src/osgEarthDrivers/gltf/CMakeLists.txt +--- a/src/osgEarthDrivers/gltf/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthDrivers/gltf/CMakeLists.txt (date 1653145502470) +@@ -11,7 +11,7 @@ + + INCLUDE_DIRECTORIES( + ${OSGEARTH_EMBEDDED_THIRD_PARTY_DIR}/tinygltf +- ${OSGEARTH_EMBEDDED_THIRD_PARTY_DIR}/rapidjson/include/rapidjson ++ ${RapidJSON_INCLUDE_DIR}/rapidjson + ) + + IF(draco_FOUND) +diff --git a/src/osgEarthDrivers/fastdxt/dxt.cpp b/src/osgEarthDrivers/fastdxt/dxt.cpp +--- a/src/osgEarthDrivers/fastdxt/dxt.cpp (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/src/osgEarthDrivers/fastdxt/dxt.cpp (date 1652372326143) +@@ -119,7 +119,12 @@ + int &outputBytes ) + { + byte *tmpBuf; ++ ++#ifdef __MINGW32__ ++ tmpBuf = (byte*)__mingw_aligned_malloc(width*height*4,16); ++#else + tmpBuf = (byte*)memalign(16, width*height*4); ++#endif + memset(tmpBuf, 0, width*height*4); + RGBAtoYCoCg(inBuf, tmpBuf, width, height); + CompressImageDXT5(tmpBuf, outBuf, width, height, outputBytes); +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (revision 6b5fb806a9190f7425c32db65d3ea905a55a9c16) ++++ b/CMakeLists.txt (date 1652372963746) +@@ -143,30 +143,14 @@ + endif() + endif() + +-# required +-find_package(OSG REQUIRED) +-find_package(CURL REQUIRED) +-find_package(GDAL REQUIRED) +- + # optional +-find_package(GEOS) +-find_package(Sqlite3) +-find_package(Draco) +-find_package(BASISU) + find_package(GLEW) +-find_package(Protobuf) +-find_package(WEBP) + find_package(Blend2D) +-find_package(blosc) + + if(OSGEARTH_ENABLE_PROFILING) + find_package(Tracy) + endif() + +-if(OSGEARTH_BUILD_ZIP_PLUGIN) +- find_package(LIBZIP) +-endif() +- + if(OSGEARTH_BUILD_TRITON_NODEKIT) + find_package(Triton QUIET) + endif() +@@ -237,7 +221,8 @@ + INCLUDE(OsgEarthMacroUtils) + + # OpenSceneGraph is the 3D rendering toolkit +-DETECT_OSG_VERSION() ++set(OPENSCENEGRAPH_VERSION "3.6.5") ++set(OSG_PLUGINS "osgPlugins-${OPENSCENEGRAPH_VERSION}" CACHE STRING "" FORCE) + + IF (NOT OPENSCENEGRAPH_VERSION) + SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) diff --git a/recipes/osgearth/all/test_package/CMakeLists.txt b/recipes/osgearth/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3737cad073075 --- /dev/null +++ b/recipes/osgearth/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CONAN_PKG::osgearth) diff --git a/recipes/osgearth/all/test_package/conanfile.py b/recipes/osgearth/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/osgearth/all/test_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/osgearth/all/test_package/test_package.cpp b/recipes/osgearth/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..84fb80ae0a602 --- /dev/null +++ b/recipes/osgearth/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main( int argc, char** argv ) +{ + osgEarth::initialize(); +} diff --git a/recipes/osgearth/config.yml b/recipes/osgearth/config.yml new file mode 100644 index 0000000000000..3c2acf896fd29 --- /dev/null +++ b/recipes/osgearth/config.yml @@ -0,0 +1,5 @@ +versions: + '3.2': + folder: all + '3.3': + folder: all diff --git a/recipes/osmanip/all/CMakeLists.txt b/recipes/osmanip/all/CMakeLists.txt new file mode 100644 index 0000000000000..ae515532d7df7 --- /dev/null +++ b/recipes/osmanip/all/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.13) +project(osmanip LANGUAGES CXX) + +find_package(arsenalgear REQUIRED CONFIG) + +add_library(osmanip) +target_sources(osmanip PRIVATE + ${OSMANIP_SRC_DIR}/src/graphics/canvas.cpp + ${OSMANIP_SRC_DIR}/src/graphics/plot_2D.cpp + $<$: + ${OSMANIP_SRC_DIR}/src/manipulators/colsty.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/common.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/cursor.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/decorator.cpp + > + $<$,$>: + ${OSMANIP_SRC_DIR}/src/manipulators/colsty.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/common.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/cursor.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/printer.cpp + > + $<$: + ${OSMANIP_SRC_DIR}/src/manipulators/csmanip.cpp + > + $<$: + ${OSMANIP_SRC_DIR}/src/progressbar/progress_bar.cpp + > + ${OSMANIP_SRC_DIR}/src/utility/windows.cpp +) +target_include_directories(osmanip PUBLIC ${OSMANIP_SRC_DIR}/include/) +target_compile_features(osmanip PUBLIC cxx_std_17) +set_target_properties(osmanip PROPERTIES + PUBLIC_HEADER "${osmanip_inc}" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +target_link_libraries(osmanip PRIVATE arsenalgear::arsenalgear) + +find_library(LIBM m) +target_link_libraries(osmanip PRIVATE $<$:${LIBM}>) + +include(GNUInstallDirs) + +install( + TARGETS osmanip + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install( + DIRECTORY ${OSMANIP_SRC_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/osmanip +) diff --git a/recipes/osmanip/all/conandata.yml b/recipes/osmanip/all/conandata.yml new file mode 100644 index 0000000000000..02c907a3fa56b --- /dev/null +++ b/recipes/osmanip/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "4.4.0": + url: "https://github.com/JustWhit3/osmanip/archive/v4.3.0.tar.gz" + sha256: "e0d982d19792c3e438e3be99f789434b66788f9a7114f217b3c5f28d0121af7f" + "4.3.0": + url: "https://github.com/JustWhit3/osmanip/archive/v4.3.0.tar.gz" + sha256: "e0d982d19792c3e438e3be99f789434b66788f9a7114f217b3c5f28d0121af7f" + "4.2.2": + url: "https://github.com/JustWhit3/osmanip/archive/v4.2.2.tar.gz" + sha256: "841b76bb4f44b66d714858e62661cee75c4fef553300b6da2a6720509421a5fe" + "4.2.1": + url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.2.1.tar.gz" + sha256: "1d1ba3fac66edc7a7e4c480a0c080493d19193f9b63b70d417e2683f8741bf1c" + "4.1.0": + url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.1.0.tar.gz" + sha256: "9830316fea29300aeebadb0cd6cddd6f291a8fa04c397bca9666d045815d1d53" + "4.0.0": + url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.0.0.tar.gz" + sha256: "c6848e1d9b15eb409af88efeee7cd1ce87374ea7ac87424f5d2cf30104f098a0" + +patches: + "4.0.0": + - patch_file: "patches/0001-replace-runtime_error_func.patch" + patch_description: "following function renaming on arsenalgear/1.2.2" + patch_type: "conan" diff --git a/recipes/osmanip/all/conanfile.py b/recipes/osmanip/all/conanfile.py new file mode 100644 index 0000000000000..ccea62899d710 --- /dev/null +++ b/recipes/osmanip/all/conanfile.py @@ -0,0 +1,101 @@ +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.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 OsmanipConan(ConanFile): + name = "osmanip" + description = "Library with useful output stream tools like: color and style manipulators, progress bars and terminal graphics." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/JustWhit3/osmanip" + topics = ("manipulator", "iostream", "output-stream", "iomanip") + 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) + 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): + self.requires("boost/1.81.0") + if Version(self.version) < "4.2.0": + self.requires("arsenalgear/1.2.2") + else: + self.requires("arsenalgear/2.0.1") + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compiler_required_cpp17(self): + return { + "Visual Studio": "16", + "msvc": "191", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + minimum_version = self._compiler_required_cpp17.get(str(self.info.settings.compiler), False) + if minimum_version: + if Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + else: + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}") + + 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["OSMANIP_VERSION"] = str(self.version) + tc.variables["OSMANIP_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["osmanip"] diff --git a/recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch b/recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch new file mode 100644 index 0000000000000..8b8b155a0e865 --- /dev/null +++ b/recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch @@ -0,0 +1,102 @@ +diff --git a/src/manipulators/csmanip.cpp b/src/manipulators/csmanip.cpp +index 064c7ba..6363226 100644 +--- a/src/manipulators/csmanip.cpp ++++ b/src/manipulators/csmanip.cpp +@@ -208,7 +208,7 @@ namespace osm + { + if( generic_map.find( feat_string ) == generic_map.end() ) + { +- throw agr::runtime_error_func( generic_map.at( "error" ), feat_string, "is not supported!" ); ++ throw agr::except_error_func( generic_map.at( "error" ), feat_string, "is not supported!" ); + } + return generic_map.at( feat_string ); + } +@@ -228,7 +228,7 @@ namespace osm + { + if( generic_map.find( feat_string ) == generic_map.end() ) + { +- throw agr::runtime_error_func( generic_map.at( "error" ).first, feat_string, "is not supported!" ); ++ throw agr::except_error_func( generic_map.at( "error" ).first, feat_string, "is not supported!" ); + } + else + { +@@ -255,7 +255,7 @@ namespace osm + { + if( rst.find( reset_string ) == rst.end() ) + { +- throw agr::runtime_error_func( rst.at( "error" ), reset_string, "is not supported!" ); ++ throw agr::except_error_func( rst.at( "error" ), reset_string, "is not supported!" ); + } + return rst.at( reset_string ); + } +@@ -295,4 +295,4 @@ namespace osm + std::to_string( g ) + ";"s + + std::to_string( b ) + "m"s; + } +- } +\ No newline at end of file ++ } +diff --git a/src/progressbar/progress_bar.cpp b/src/progressbar/progress_bar.cpp +index 485009f..b12aee4 100644 +--- a/src/progressbar/progress_bar.cpp ++++ b/src/progressbar/progress_bar.cpp +@@ -163,16 +163,16 @@ namespace osm + } + else if( styles_map_.at( type ).find( style ) == styles_map_.at( type ).end() ) + { +- throw agr::runtime_error_func( "Inserted ProgressBar style", style, "is not supported for this type!" ); ++ throw agr::except_error_func( "Inserted ProgressBar style", style, "is not supported for this type!" ); + } + else + { +- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is not supported!" ); ++ throw agr::except_error_func( "Inserted ProgressBar type", type, "is not supported!" ); + } + } + catch ( std::out_of_range const& exception ) + { +- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is not supported!" ); ++ throw agr::except_error_func( "Inserted ProgressBar type", type, "is not supported!" ); + } + } + +@@ -201,15 +201,15 @@ namespace osm + } + else if( styles_map_.at( "indicator" ).find( style_p ) == styles_map_.at( "indicator" ).end() ) + { +- throw agr::runtime_error_func( "Inserted indicator style", style_p, "is not supported for this type!" ); ++ throw agr::except_error_func( "Inserted indicator style", style_p, "is not supported for this type!" ); + } + else if( styles_map_.at( "loader" ).find( style_l ) == styles_map_.at( "loader" ).end() ) + { +- throw agr::runtime_error_func( "Inserted loader style", style_l, "is not supported for this type!" ); ++ throw agr::except_error_func( "Inserted loader style", style_l, "is not supported for this type!" ); + } + else + { +- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is not supported!" ); ++ throw agr::except_error_func( "Inserted ProgressBar type", type, "is not supported!" ); + } + } + +@@ -834,11 +834,11 @@ namespace osm + } + else if( styles_map_.at( type ).find( style ) != styles_map_.at( type ).end() ) + { +- throw agr::runtime_error_func( "Inserted ProgressBar style", style, "is already available!" ); ++ throw agr::except_error_func( "Inserted ProgressBar style", style, "is already available!" ); + } + else + { +- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is already available!" ); ++ throw agr::except_error_func( "Inserted ProgressBar type", type, "is already available!" ); + } + } + +@@ -869,4 +869,4 @@ namespace osm + * + */ + BOOST_PP_SEQ_FOR_EACH( PROGRESSBAR, _, ARGS( int, long, long long, double, long double, float ) ); +- } +\ No newline at end of file ++ } diff --git a/recipes/osmanip/all/test_package/CMakeLists.txt b/recipes/osmanip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..02a74d2349c2e --- /dev/null +++ b/recipes/osmanip/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(osmanip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE osmanip::osmanip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/osmanip/all/test_package/conanfile.py b/recipes/osmanip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/osmanip/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/osmanip/all/test_package/test_package.cpp b/recipes/osmanip/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..40b8aeea9e04b --- /dev/null +++ b/recipes/osmanip/all/test_package/test_package.cpp @@ -0,0 +1,113 @@ +// This code is a part of upstream example code. +// https://github.com/JustWhit3/osmanip/blob/v4.0.0/examples/progressbar.cpp + +// My headers +#include "osmanip/progressbar/multi_progress_bar.hpp" +#include "osmanip/progressbar/progress_bar.hpp" +#ifdef _WIN32 +#include "osmanip/utility/windows.hpp" +#endif + +// Since 4.1.0, options.hpp for `osm::OPTION` is added. +#if __has_include("osmanip/utility/options.hpp") +# include "osmanip/utility/options.hpp" +#endif + +// STD headers +#include +#include +#include + +//==================================================== +// Percentage bar +//==================================================== +void +perc_bars() { + std::cout << "\n" + << "======================================================" + << "\n" + << " PERCENTAGE BARS " + << "\n" + << "======================================================" + << "\n\n"; + + // Normal percentage bar. + osm::ProgressBar percentage_bar; + percentage_bar.setMin(5); + percentage_bar.setMax(46); + percentage_bar.setStyle("indicator", "%"); + + std::cout << "This is a normal percentage bar: " + << "\n"; + for (int i = percentage_bar.getMin(); i < percentage_bar.getMax(); i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + percentage_bar.update(i); + // Do some operations... + } + std::cout << "\n\n"; + + // Percentage bar with message and different style: + osm::ProgressBar percentage_bar_2(1.2f, 4.4f); + percentage_bar_2.setMessage("processing..."); + percentage_bar_2.setStyle("indicator", "/100"); + + std::cout << "This is a percentage bar with message and the /100 style: " + << "\n"; + for (float i = percentage_bar_2.getMin(); i < percentage_bar_2.getMax(); i += 0.1f) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + percentage_bar_2.update(i); + // Do some operations... + } + std::cout << "\n\n"; + + // Percentage bar with time consuming info: + percentage_bar.resetMessage(); + percentage_bar.setStyle("indicator", "%"); + + std::cout << "This is a percentage bar with time consuming info: " + << "\n"; + for (int i = percentage_bar.getMin(); i < percentage_bar.getMax(); i++) { + percentage_bar.setBegin(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + percentage_bar.update(i); + // Do some operations... + percentage_bar.setEnd(); + } + std::cout << "\n" + << "Time needed to complete the previous loop: " << percentage_bar.getTime() << " ms." + << "\n\n"; + + // Percentage bar with estimated time left: + percentage_bar.setMin(2); + percentage_bar.setMax(121); + percentage_bar.setRemainingTimeFlag("on"); + percentage_bar.resetRemainingTime(); + + std::cout << "This is a percentage bar with time-remaining info: " + << "\n"; + for (int i = percentage_bar.getMin(); i < percentage_bar.getMax(); i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + percentage_bar.update(i); + // Do some operations... + } + std::cout << "\n\n"; +} + +//==================================================== +// Main +//==================================================== +int main() { +#ifdef _WIN32 + osm::enableANSI(); +#endif + + osm::OPTION(osm::CURSOR::OFF); + + perc_bars(); // Percentage bar. + + osm::OPTION(osm::CURSOR::ON); + +#ifdef _WIN32 + osm::disableANSI(); +#endif +} diff --git a/recipes/osmanip/all/test_v1_package/CMakeLists.txt b/recipes/osmanip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..426dbc1aa18df --- /dev/null +++ b/recipes/osmanip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package 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/osmanip/all/test_v1_package/conanfile.py b/recipes/osmanip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/osmanip/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/osmanip/config.yml b/recipes/osmanip/config.yml new file mode 100644 index 0000000000000..50f7633ad31f3 --- /dev/null +++ b/recipes/osmanip/config.yml @@ -0,0 +1,13 @@ +versions: + "4.4.0": + folder: all + "4.3.0": + folder: all + "4.2.2": + folder: all + "4.2.1": + folder: all + "4.1.0": + folder: all + "4.0.0": + folder: all diff --git a/recipes/osqp/all/conandata.yml b/recipes/osqp/all/conandata.yml new file mode 100644 index 0000000000000..905d89304cb35 --- /dev/null +++ b/recipes/osqp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.6.2": + url: "https://github.com/osqp/osqp/releases/download/v0.6.2/complete_sources.tar.gz" + sha256: "0a7ade2fa19f13e13bc12f6ea0046ef764049023efb4997a4e72a76534f623ec" diff --git a/recipes/osqp/all/conanfile.py b/recipes/osqp/all/conanfile.py new file mode 100644 index 0000000000000..19c7954ec0859 --- /dev/null +++ b/recipes/osqp/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class OsqpConan(ConanFile): + name = "osqp" + package_type = "library" + description = "The OSQP (Operator Splitting Quadratic Program) solver is a numerical optimization package." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://osqp.org/" + topics = ("machine-learning", "control", "optimization", "svm", "solver", "lasso", "portfolio-optimization", + "numerical-optimization", "quadratic-programming", "convex-optimization", "model-predictive-control") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['UNITTESTS'] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.variables["PRINTING"] = True + tc.variables["PROFILING"] = True + tc.variables["CTRLC"] = True + tc.variables["DFLOAT"] = False + tc.variables["DLONG"] = True + tc.variables["COVERAGE"] = False + tc.variables["ENABLE_MKL_PARDISO"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + if self.settings.os == "Windows": + if self.options.shared: + rm(self, "qdldl.dll", os.path.join(self.package_folder, "bin")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + else: + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.so", os.path.join(self.package_folder, "lib")) + rm(self, "*.dylib", os.path.join(self.package_folder, "lib")) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "include", "qdldl")) + rm(self, "*qdldl.*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "osqp") + self.cpp_info.set_property("cmake_target_name", "osqp::osqp") + self.cpp_info.libs = ["osqp"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("rt") + self.cpp_info.system_libs.append("dl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "osqp" + self.cpp_info.filenames["cmake_find_package_multi"] = "osqp" + self.cpp_info.names["cmake_find_package"] = "osqp" + self.cpp_info.names["cmake_find_package_multi"] = "osqp" diff --git a/recipes/osqp/all/test_package/CMakeLists.txt b/recipes/osqp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e2ad808df3b71 --- /dev/null +++ b/recipes/osqp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(osqp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE osqp::osqp) diff --git a/recipes/osqp/all/test_package/conanfile.py b/recipes/osqp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/osqp/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/osqp/all/test_package/test_package.cpp b/recipes/osqp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c966b1083c67d --- /dev/null +++ b/recipes/osqp/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ +/** + * Below is a demo copied from an upstream example code, + * It shows how to setup and solve an optimization problem. + * Source code: https://github.com/osqp/osqp/blob/master/examples/osqp_demo.c + * Problem definition: https://osqp.org/docs/examples/setup-and-solve.html +*/ +#include "osqp/osqp.h" + + +int main(void) { + // Load problem data + c_float P_x[3] = {4.0, 1.0, 2.0, }; + c_int P_nnz = 3; + c_int P_i[3] = {0, 0, 1, }; + c_int P_p[3] = {0, 1, 3, }; + c_float q[2] = {1.0, 1.0, }; + c_float A_x[4] = {1.0, 1.0, 1.0, 1.0, }; + c_int A_nnz = 4; + c_int A_i[4] = {0, 1, 0, 2, }; + c_int A_p[3] = {0, 2, 4, }; + c_float l[3] = {1.0, 0.0, 0.0, }; + c_float u[3] = {1.0, 0.7, 0.7, }; + c_int n = 2; + c_int m = 3; + + // Exitflag + c_int exitflag = 0; + + // Workspace structures + OSQPWorkspace *work; + OSQPSettings *settings = (OSQPSettings *)c_malloc(sizeof(OSQPSettings)); + OSQPData *data = (OSQPData *)c_malloc(sizeof(OSQPData)); + + // Populate data + if (data) { + data->n = n; + data->m = m; + data->P = csc_matrix(data->n, data->n, P_nnz, P_x, P_i, P_p); + data->q = q; + data->A = csc_matrix(data->m, data->n, A_nnz, A_x, A_i, A_p); + data->l = l; + data->u = u; + } + + // Define solver settings as default + if (settings) { + osqp_set_default_settings(settings); + settings->alpha = 1.0; // Change alpha parameter + } + + // Setup workspace + exitflag = osqp_setup(&work, data, settings); + + // Solve Problem + osqp_solve(work); + + // Cleanup + osqp_cleanup(work); + if (data) { + if (data->A) c_free(data->A); + if (data->P) c_free(data->P); + c_free(data); + } + if (settings) c_free(settings); + + return exitflag; + + return EXIT_SUCCESS; +} diff --git a/recipes/osqp/all/test_v1_package/CMakeLists.txt b/recipes/osqp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/osqp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/osqp/all/test_v1_package/conanfile.py b/recipes/osqp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/osqp/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/osqp/config.yml b/recipes/osqp/config.yml new file mode 100644 index 0000000000000..a09c617182ab2 --- /dev/null +++ b/recipes/osqp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.6.2": + folder: all diff --git a/recipes/out_ptr/all/conandata.yml b/recipes/out_ptr/all/conandata.yml new file mode 100644 index 0000000000000..46689f1283088 --- /dev/null +++ b/recipes/out_ptr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20211119": + sha256: e9f757051069b10c162bafc16517a4beb1473fb37044d94b56459a2783af23e0 + url: https://github.com/soasis/out_ptr/archive/ea379b2f35e28d6ee894e05ad4c26ed60a613d30.zip diff --git a/recipes/out_ptr/all/conanfile.py b/recipes/out_ptr/all/conanfile.py new file mode 100644 index 0000000000000..ec1798a3de6ab --- /dev/null +++ b/recipes/out_ptr/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class OutPtrConan(ConanFile): + name = "out_ptr" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/soasis/out_ptr" + description = "a C++11 implementation of std::out_ptr (p1132), as a standalone library" + topics = ("utility", "backport") + package_type = "header-library" + settings = "os", "arch", "build_type", "compiler" + no_copy_source = True + + def 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, "*.hpp", src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/out_ptr/all/test_package/CMakeLists.txt b/recipes/out_ptr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5198790e5ad46 --- /dev/null +++ b/recipes/out_ptr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(out_ptr CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE out_ptr::out_ptr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/out_ptr/all/test_package/conanfile.py b/recipes/out_ptr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/out_ptr/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/out_ptr/all/test_package/test_package.cpp b/recipes/out_ptr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..147792db5e704 --- /dev/null +++ b/recipes/out_ptr/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include + +#include +#include +#include + +#ifndef _WIN32 + +// Some functions to achieve cross-platform parity + +int fopen_s(FILE **f, const char *name, const char *mode) +{ + auto ret = 0; + *f = std::fopen(name, mode); + /* Can't be sure about 1-to-1 mapping of errno and MS' errno_t */ + if (!*f) + ret = errno; + return ret; +} + +#endif // Windows + +struct fclose_deleter +{ + void operator()(FILE *f) const + { + std::fclose(f); + } +}; + +int main() +{ + std::unique_ptr my_unique_fptr; + + // open file, stuff it in this deleter + auto err = fopen_s(ztd::out_ptr::out_ptr(my_unique_fptr), "no such file", "r+b"); + assert(err != 0); +} diff --git a/recipes/out_ptr/all/test_v1_package/CMakeLists.txt b/recipes/out_ptr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/out_ptr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/out_ptr/all/test_v1_package/conanfile.py b/recipes/out_ptr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/out_ptr/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/out_ptr/config.yml b/recipes/out_ptr/config.yml new file mode 100644 index 0000000000000..6c757a1361008 --- /dev/null +++ b/recipes/out_ptr/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20211119": + folder: all diff --git a/recipes/outcome/all/conandata.yml b/recipes/outcome/all/conandata.yml new file mode 100644 index 0000000000000..862ef733ccf23 --- /dev/null +++ b/recipes/outcome/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.2.3": + url: "https://github.com/ned14/outcome/archive/v2.2.3.tar.gz" + sha256: "31cc987d73b2625a70f35083ccff26d1c2634d89304f1ea606a294da36cb2958" + "2.2.2": + url: "https://github.com/ned14/outcome/archive/v2.2.2.tar.gz" + sha256: "fc16bc24f8a7d10dc24b9cc3abd1609f67b29aab2c8da546d123d518e9c29dbb" + "2.2.1": + url: "https://github.com/ned14/outcome/archive/v2.2.1.tar.gz" + sha256: "cf21a9cba8c7d943a6310012626344618923f2ea367ccee6cb499eee8bb97147" + "2.2.0": + url: "https://github.com/ned14/outcome/archive/v2.2.0.tar.gz" + sha256: "eb7a54e74c7ed7e208ab4a610a56e619c82b2797236aee7cff3303a649f24e0e" + "2.1.5": + url: "https://github.com/ned14/outcome/archive/v2.1.5.tar.gz" + sha256: "e238e545753e2b00a7eefabeb677c9918c7a5402ad347b67de328089b4e15493" + "2.1.4": + url: "https://github.com/ned14/outcome/archive/v2.1.4.tar.gz" + sha256: "19463d2c9bb0bcdc1c0334b02b344caeb5fc723ab060155c959be8e0b551cf76" + "2.1.3": + url: "https://github.com/ned14/outcome/archive/v2.1.3.tar.gz" + sha256: "45ee2f720bd0965047c35bd0ea719656c9de51c49d13c6a82797fca325b8426a" diff --git a/recipes/outcome/all/conanfile.py b/recipes/outcome/all/conanfile.py new file mode 100644 index 0000000000000..910063cd4cd17 --- /dev/null +++ b/recipes/outcome/all/conanfile.py @@ -0,0 +1,66 @@ +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.50.0" + + +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",) + 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 { + "clang": "3.9", + "gcc": "6", + "Visual Studio": "15", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "Licence.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "outcome.hpp", src=os.path.join(self.source_folder, "single-header"), + dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/outcome/all/test_package/CMakeLists.txt b/recipes/outcome/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a2128b64a829 --- /dev/null +++ b/recipes/outcome/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(outcome REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE outcome::outcome) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/outcome/all/test_package/conanfile.py b/recipes/outcome/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/outcome/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/outcome/all/test_package/test_package.cpp b/recipes/outcome/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..491575afb8d4c --- /dev/null +++ b/recipes/outcome/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +namespace outcome = OUTCOME_V2_NAMESPACE; + +outcome::result test2(int x) +{ + return x; +} + +outcome::result test1(int x) +{ + OUTCOME_TRY(test2(x)); + return 0; +} + +int main(void) +{ + return test1(5).value(); +} diff --git a/recipes/outcome/all/test_v1_package/CMakeLists.txt b/recipes/outcome/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/outcome/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/outcome/all/test_v1_package/conanfile.py b/recipes/outcome/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/outcome/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/outcome/config.yml b/recipes/outcome/config.yml new file mode 100644 index 0000000000000..5e58124a1d058 --- /dev/null +++ b/recipes/outcome/config.yml @@ -0,0 +1,15 @@ +versions: + "2.2.3": + folder: all + "2.2.2": + folder: all + "2.2.1": + folder: all + "2.2.0": + folder: all + "2.1.5": + folder: all + "2.1.4": + folder: all + "2.1.3": + folder: all diff --git a/recipes/ozz-animation/all/CMakeLists.txt b/recipes/ozz-animation/all/CMakeLists.txt new file mode 100644 index 0000000000000..73c551783746d --- /dev/null +++ b/recipes/ozz-animation/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory("source_subfolder") diff --git a/recipes/ozz-animation/all/conandata.yml b/recipes/ozz-animation/all/conandata.yml new file mode 100644 index 0000000000000..548e0d6eb8858 --- /dev/null +++ b/recipes/ozz-animation/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.12.1": + url: "https://github.com/guillaumeblanc/ozz-animation/archive/0.12.1.tar.gz" + sha256: "1c0df65d9802a200e0aed60e5b5d8bbcec9c36cd3c666d252376bba6a220e079" + "0.13.0": + url: "https://github.com/guillaumeblanc/ozz-animation/archive/0.13.0.tar.gz" + sha256: "2677f28d83bb4be00f92537ee3fb2573f9e99fc82fb1777a1b8a6131aa9b96a4" diff --git a/recipes/ozz-animation/all/conanfile.py b/recipes/ozz-animation/all/conanfile.py new file mode 100644 index 0000000000000..7266f8b1ea03c --- /dev/null +++ b/recipes/ozz-animation/all/conanfile.py @@ -0,0 +1,66 @@ +import os +from conans import ConanFile, CMake, tools + +class OzzAnimationConan(ConanFile): + name = "ozz-animation" + description = "Open source c++ skeletal animation library and toolset." + license = "MIT" + topics = ("conan", "ozz", "animation", "skeletal") + homepage = "https://github.com/guillaumeblanc/ozz-animation" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + short_paths = True + + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["ozz_build_fbx"] = False + cmake.definitions["ozz_build_data"] = False + cmake.definitions["ozz_build_samples"] = False + cmake.definitions["ozz_build_howtos"] = False + cmake.definitions["ozz_build_tests"] = False + cmake.definitions["ozz_build_cpp11"] = True + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + for before, after in [('string(REGEX REPLACE "/MT" "/MD" ${flag} "${${flag}}")', ""), ('string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")', "")]: + tools.replace_in_file(os.path.join(self._source_subfolder, "build-utils", "cmake", "compiler_settings.cmake"), before, after) + + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "animation", "offline", "tools", "CMakeLists.txt"), + "if(NOT EMSCRIPTEN)", + "if(NOT CMAKE_CROSSCOMPILING)") + + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + + os.remove(os.path.join(self.package_folder, "CHANGES.md")) + os.remove(os.path.join(self.package_folder, "LICENSE.md")) + os.remove(os.path.join(self.package_folder, "README.md")) + self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/ozz-animation/all/test_package/CMakeLists.txt b/recipes/ozz-animation/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ef4d8f93d6c96 --- /dev/null +++ b/recipes/ozz-animation/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/ozz-animation/all/test_package/conanfile.py b/recipes/ozz-animation/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4903f1a7e8fa0 --- /dev/null +++ b/recipes/ozz-animation/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/ozz-animation/all/test_package/test_package.cpp b/recipes/ozz-animation/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9202b08874e2c --- /dev/null +++ b/recipes/ozz-animation/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include "ozz/base/log.h" +#include "ozz/base/io/stream.h" + +int main() +{ + ozz::io::File file("test.ozz", "rb"); + + if (!file.opened()) { + } +} diff --git a/recipes/ozz-animation/config.yml b/recipes/ozz-animation/config.yml new file mode 100644 index 0000000000000..a9085cf3fa2b2 --- /dev/null +++ b/recipes/ozz-animation/config.yml @@ -0,0 +1,5 @@ +versions: + "0.12.1": + folder: all + "0.13.0": + folder: all diff --git a/recipes/p-ranav-glob/all/conandata.yml b/recipes/p-ranav-glob/all/conandata.yml new file mode 100644 index 0000000000000..4321482d21fbc --- /dev/null +++ b/recipes/p-ranav-glob/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.1": + url: "https://github.com/p-ranav/glob/archive/refs/tags/v0.0.1.tar.gz" + sha256: "f0b74df0417d04a0116bceeca2f2401a77a1d44e7ea75b369b98b87b791853ae" diff --git a/recipes/p-ranav-glob/all/conanfile.py b/recipes/p-ranav-glob/all/conanfile.py new file mode 100644 index 0000000000000..3db82dd1c8225 --- /dev/null +++ b/recipes/p-ranav-glob/all/conanfile.py @@ -0,0 +1,50 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class PRanavGlobConan(ConanFile): + name = "p-ranav-glob" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/glob" + description = "Glob for C++17" + topics = ("c++17", "config", "filesystem", "header-only") + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "clang": "7", + "apple-clang": "11", + } + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "single_include")) diff --git a/recipes/p-ranav-glob/all/test_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..481262167c9f5 --- /dev/null +++ b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/p-ranav-glob/all/test_package/conanfile.py b/recipes/p-ranav-glob/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4903f1a7e8fa0 --- /dev/null +++ b/recipes/p-ranav-glob/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/p-ranav-glob/all/test_package/test_package.cpp b/recipes/p-ranav-glob/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..34920436a1526 --- /dev/null +++ b/recipes/p-ranav-glob/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + glob::glob(""); + return 0; +} diff --git a/recipes/p-ranav-glob/config.yml b/recipes/p-ranav-glob/config.yml new file mode 100644 index 0000000000000..f6f5b5679b9d4 --- /dev/null +++ b/recipes/p-ranav-glob/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.1": + folder: all diff --git a/recipes/p7zip/all/conandata.yml b/recipes/p7zip/all/conandata.yml new file mode 100644 index 0000000000000..5693cc1e321ba --- /dev/null +++ b/recipes/p7zip/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "16.02": + url: https://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2 + sha256: "5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f" +patches: + "16.02": + - patch_file: "patches/12-CVE-2016-9296.patch" + patch_source: "https://github.com/conda-forge/p7zip-feedstock/tree/main/recipe" + patch_description: "Addresses CVE-2016-9296: null pointer check for the variable folders.PackPositions in function CInArchive::ReadAndDecodePackedStreams" + - patch_file: "patches/13-CVE-2017-17969.patch" + patch_source: "https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7" + patch_description: "Addresses CVE-2017-17969: Heap-based buffer overflow in the NCompress::NShrink::CDecoder::CodeReal method" + - patch_file: "patches/14-Fix-g++-warning.patch" + patch_source: "https://github.com/conda-forge/p7zip-feedstock/tree/main/recipe" + patch_description: "Addresses gcc warning: use of an operand of type 'bool' in 'operator++' is deprecated" + - patch_file: "patches/clang.diff" + patch_source: "https://github.com/conda-forge/p7zip-feedstock/tree/main/recipe" + patch_description: "Addresses clang 6.x error: case value evaluates to -2147024809" + - patch_file: "patches/06-CVE-2018-5996.patch" + patch_source: "https://salsa.debian.org/debian/p7zip-rar/-/tree/debian/16.02-3/debian/patches" + patch_description: "Addresses CVE-2018-5996: RAR memory corruptions fix" + - patch_file: "patches/CVE-2018-10115.patch" + patch_source: "https://salsa.debian.org/debian/p7zip-rar/-/tree/debian/16.02-3/debian/patches" + patch_description: "Addresses CVE-2018-10115: Incorrect initialization logic of RAR decoder objects" diff --git a/recipes/p7zip/all/conanfile.py b/recipes/p7zip/all/conanfile.py new file mode 100644 index 0000000000000..0923c8b9413a3 --- /dev/null +++ b/recipes/p7zip/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, replace_in_file, chdir +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.apple import is_apple_os, to_apple_arch +import os + + +required_conan_version = ">=1.52.0" + + +class PSevenZipConan(ConanFile): + name = "p7zip" + url = "https://github.com/conan-io/conan-center-index" + description = "p7zip is a quick port of 7z.exe and 7za.exe (command line version of 7zip, see www.7-zip.org) for Unix" + license = ("LGPL-2.1", "Unrar") + homepage = "https://sourceforge.net/projects/p7zip/" + topics = ("7zip", "zip", "compression", "decompression") + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if self.info.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows - use `7zip` instead") + if self.info.settings.arch not in ("armv8", "x86_64"): + raise ConanInvalidConfiguration(f"{self.ref} is only supported by x86_64 and armv8") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def _patch_compiler(self): + optflags = '' + if is_apple_os(self): + optflags = '-arch ' + to_apple_arch(self) + cc = "clang" if "clang" in str(self.settings.compiler) else str(self.settings.compiler) + cxx = "clang++" if "clang" in str(self.settings.compiler) else str(self.settings.compiler) + if self.settings.compiler == "gcc": + cxx = "g++" + # Replace the hard-coded compilers instead of using the 40 different Makefile permutations + replace_in_file(self, os.path.join(self.source_folder, "makefile.machine"), + "CC=gcc", f"CC={cc}") + replace_in_file(self, os.path.join(self.source_folder, "makefile.machine"), + "CXX=g++", f"CXX={cxx}") + # Manually modify the -O flag here based on the build type + optflags += " -O2" if self.settings.build_type == "Release" else " -O0" + # Silence the warning about `-s` not being valid on clang + if cc != "clang": + optflags += ' -s' + replace_in_file(self, os.path.join(self.source_folder, "makefile.machine"), + "OPTFLAGS=-O -s", "OPTFLAGS=" + optflags) + + def _patch_sources(self): + apply_conandata_patches(self) + self._patch_compiler() + + def build(self): + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() + + def package(self): + copy(self, "License.txt", src=os.path.join(self.source_folder, "DOC"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "unRarLicense.txt", src=os.path.join(self.source_folder, "DOC"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "7za", src=os.path.join(self.source_folder, "bin"), dst=os.path.join(self.package_folder, "bin")) + + 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/p7zip/all/patches/06-CVE-2018-5996.patch b/recipes/p7zip/all/patches/06-CVE-2018-5996.patch new file mode 100644 index 0000000000000..6733bff918956 --- /dev/null +++ b/recipes/p7zip/all/patches/06-CVE-2018-5996.patch @@ -0,0 +1,221 @@ +From: Robert Luberda +Date: Sun, 28 Jan 2018 23:47:40 +0100 +Subject: CVE-2018-5996 + +Hopefully fix Memory Corruptions via RAR PPMd (CVE-2018-5996) by +applying a few changes from 7Zip 18.00-beta. + +Bug-Debian: https://bugs.debian.org/#888314 +--- + CPP/7zip/Compress/Rar1Decoder.cpp | 13 +++++++++---- + CPP/7zip/Compress/Rar1Decoder.h | 1 + + CPP/7zip/Compress/Rar2Decoder.cpp | 10 +++++++++- + CPP/7zip/Compress/Rar2Decoder.h | 1 + + CPP/7zip/Compress/Rar3Decoder.cpp | 23 ++++++++++++++++++++--- + CPP/7zip/Compress/Rar3Decoder.h | 2 ++ + 6 files changed, 42 insertions(+), 8 deletions(-) + +diff --git a/CPP/7zip/Compress/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar1Decoder.cpp +index 1aaedcc..68030c7 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.cpp ++++ b/CPP/7zip/Compress/Rar1Decoder.cpp +@@ -29,7 +29,7 @@ public: + }; + */ + +-CDecoder::CDecoder(): m_IsSolid(false) { } ++CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { } + + void CDecoder::InitStructures() + { +@@ -406,9 +406,14 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + InitData(); + if (!m_IsSolid) + { ++ _errorMode = false; + InitStructures(); + InitHuff(); + } ++ ++ if (_errorMode) ++ return S_FALSE; ++ + if (m_UnpackSize > 0) + { + GetFlagsBuf(); +@@ -477,9 +482,9 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress) + { + try { return CodeReal(inStream, outStream, inSize, outSize, progress); } +- catch(const CInBufferException &e) { return e.ErrorCode; } +- catch(const CLzOutWindowException &e) { return e.ErrorCode; } +- catch(...) { return S_FALSE; } ++ catch(const CInBufferException &e) { _errorMode = true; return e.ErrorCode; } ++ catch(const CLzOutWindowException &e) { _errorMode = true; return e.ErrorCode; } ++ catch(...) { _errorMode = true; return S_FALSE; } + } + + STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) +diff --git a/CPP/7zip/Compress/Rar1Decoder.h b/CPP/7zip/Compress/Rar1Decoder.h +index 630f089..01b606b 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.h ++++ b/CPP/7zip/Compress/Rar1Decoder.h +@@ -39,6 +39,7 @@ public: + + Int64 m_UnpackSize; + bool m_IsSolid; ++ bool _errorMode; + + UInt32 ReadBits(int numBits); + HRESULT CopyBlock(UInt32 distance, UInt32 len); +diff --git a/CPP/7zip/Compress/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar2Decoder.cpp +index b3f2b4b..0580c8d 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.cpp ++++ b/CPP/7zip/Compress/Rar2Decoder.cpp +@@ -80,7 +80,8 @@ static const UInt32 kHistorySize = 1 << 20; + static const UInt32 kWindowReservSize = (1 << 22) + 256; + + CDecoder::CDecoder(): +- m_IsSolid(false) ++ m_IsSolid(false), ++ m_TablesOK(false) + { + } + +@@ -100,6 +101,8 @@ UInt32 CDecoder::ReadBits(unsigned numBits) { return m_InBitStream.ReadBits(numB + + bool CDecoder::ReadTables(void) + { ++ m_TablesOK = false; ++ + Byte levelLevels[kLevelTableSize]; + Byte newLevels[kMaxTableSize]; + m_AudioMode = (ReadBits(1) == 1); +@@ -170,6 +173,8 @@ bool CDecoder::ReadTables(void) + } + + memcpy(m_LastLevels, newLevels, kMaxTableSize); ++ m_TablesOK = true; ++ + return true; + } + +@@ -344,6 +349,9 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + return S_FALSE; + } + ++ if (!m_TablesOK) ++ return S_FALSE; ++ + UInt64 startPos = m_OutWindowStream.GetProcessedSize(); + while (pos < unPackSize) + { +diff --git a/CPP/7zip/Compress/Rar2Decoder.h b/CPP/7zip/Compress/Rar2Decoder.h +index 3a0535c..0e9005f 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.h ++++ b/CPP/7zip/Compress/Rar2Decoder.h +@@ -139,6 +139,7 @@ class CDecoder : + + UInt64 m_PackSize; + bool m_IsSolid; ++ bool m_TablesOK; + + void InitStructures(); + UInt32 ReadBits(unsigned numBits); +diff --git a/CPP/7zip/Compress/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar3Decoder.cpp +index 3bf2513..6cb8a6a 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.cpp ++++ b/CPP/7zip/Compress/Rar3Decoder.cpp +@@ -92,7 +92,8 @@ CDecoder::CDecoder(): + _writtenFileSize(0), + _vmData(0), + _vmCode(0), +- m_IsSolid(false) ++ m_IsSolid(false), ++ _errorMode(false) + { + Ppmd7_Construct(&_ppmd); + } +@@ -545,6 +546,9 @@ HRESULT CDecoder::ReadTables(bool &keepDecompressing) + return InitPPM(); + } + ++ TablesRead = false; ++ TablesOK = false; ++ + _lzMode = true; + PrevAlignBits = 0; + PrevAlignCount = 0; +@@ -606,6 +610,9 @@ HRESULT CDecoder::ReadTables(bool &keepDecompressing) + } + } + } ++ if (InputEofError()) ++ return S_FALSE; ++ + TablesRead = true; + + // original code has check here: +@@ -623,6 +630,9 @@ HRESULT CDecoder::ReadTables(bool &keepDecompressing) + RIF(m_LenDecoder.Build(&newLevels[kMainTableSize + kDistTableSize + kAlignTableSize])); + + memcpy(m_LastLevels, newLevels, kTablesSizesSum); ++ ++ TablesOK = true; ++ + return S_OK; + } + +@@ -824,7 +834,12 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + PpmEscChar = 2; + PpmError = true; + InitFilters(); ++ _errorMode = false; + } ++ ++ if (_errorMode) ++ return S_FALSE; ++ + if (!m_IsSolid || !TablesRead) + { + bool keepDecompressing; +@@ -838,6 +853,8 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + bool keepDecompressing; + if (_lzMode) + { ++ if (!TablesOK) ++ return S_FALSE; + RINOK(DecodeLZ(keepDecompressing)) + } + else +@@ -901,8 +918,8 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + _unpackSize = outSize ? *outSize : (UInt64)(Int64)-1; + return CodeReal(progress); + } +- catch(const CInBufferException &e) { return e.ErrorCode; } +- catch(...) { return S_FALSE; } ++ catch(const CInBufferException &e) { _errorMode = true; return e.ErrorCode; } ++ catch(...) { _errorMode = true; return S_FALSE; } + // CNewException is possible here. But probably CNewException is caused + // by error in data stream. + } +diff --git a/CPP/7zip/Compress/Rar3Decoder.h b/CPP/7zip/Compress/Rar3Decoder.h +index c130cec..2f72d7d 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.h ++++ b/CPP/7zip/Compress/Rar3Decoder.h +@@ -192,6 +192,7 @@ class CDecoder: + UInt32 _lastFilter; + + bool m_IsSolid; ++ bool _errorMode; + + bool _lzMode; + bool _unsupportedFilter; +@@ -200,6 +201,7 @@ class CDecoder: + UInt32 PrevAlignCount; + + bool TablesRead; ++ bool TablesOK; + + CPpmd7 _ppmd; + int PpmEscChar; diff --git a/recipes/p7zip/all/patches/12-CVE-2016-9296.patch b/recipes/p7zip/all/patches/12-CVE-2016-9296.patch new file mode 100644 index 0000000000000..42245c92c0aae --- /dev/null +++ b/recipes/p7zip/all/patches/12-CVE-2016-9296.patch @@ -0,0 +1,23 @@ +From: Robert Luberda +Date: Sat, 19 Nov 2016 08:48:08 +0100 +Subject: Fix nullptr dereference (CVE-2016-9296) + +Patch taken from https://sourceforge.net/p/p7zip/bugs/185/ +--- + CPP/7zip/Archive/7z/7zIn.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp +index b0c6b98..7c6dde2 100644 +--- a/CPP/7zip/Archive/7z/7zIn.cpp ++++ b/CPP/7zip/Archive/7z/7zIn.cpp +@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams( + if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i]) + ThrowIncorrect(); + } +- HeadersSize += folders.PackPositions[folders.NumPackStreams]; ++ if (folders.PackPositions) ++ HeadersSize += folders.PackPositions[folders.NumPackStreams]; + return S_OK; + } + diff --git a/recipes/p7zip/all/patches/13-CVE-2017-17969.patch b/recipes/p7zip/all/patches/13-CVE-2017-17969.patch new file mode 100644 index 0000000000000..a9787c4a90886 --- /dev/null +++ b/recipes/p7zip/all/patches/13-CVE-2017-17969.patch @@ -0,0 +1,35 @@ +From: =?utf-8?q?Antoine_Beaupr=C3=A9?= +Date: Fri, 2 Feb 2018 11:11:41 +0100 +Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp + +Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch +Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7 +Bug: https://sourceforge.net/p/p7zip/bugs/204/ +Bug-Debian: https://bugs.debian.org/888297 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969 +Reviewed-by: Salvatore Bonaccorso +Last-Update: 2018-02-01 +Applied-Upstream: 18.00-beta +--- + CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp +index 80b7e67..ca37764 100644 +--- a/CPP/7zip/Compress/ShrinkDecoder.cpp ++++ b/CPP/7zip/Compress/ShrinkDecoder.cpp +@@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + { + _stack[i++] = _suffixes[cur]; + cur = _parents[cur]; ++ if (cur >= kNumItems || i >= kNumItems) ++ break; + } +- ++ ++ if (cur >= kNumItems || i >= kNumItems) ++ break; ++ + _stack[i++] = (Byte)cur; + lastChar2 = (Byte)cur; + diff --git a/recipes/p7zip/all/patches/14-Fix-g++-warning.patch b/recipes/p7zip/all/patches/14-Fix-g++-warning.patch new file mode 100644 index 0000000000000..226e239ee990d --- /dev/null +++ b/recipes/p7zip/all/patches/14-Fix-g++-warning.patch @@ -0,0 +1,24 @@ +From: Robert Luberda +Date: Sun, 28 Jan 2018 22:19:13 +0100 +Subject: Fix g++ warning + +Fix for "use of an operand of type 'bool' in 'operator++' +is deprecated [-Wdeprecated]" warning taken from 7zip 18.00.beta +package. +--- + CPP/7zip/Archive/Wim/WimHandler.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CPP/7zip/Archive/Wim/WimHandler.cpp b/CPP/7zip/Archive/Wim/WimHandler.cpp +index 27d3298..4ff5cfe 100644 +--- a/CPP/7zip/Archive/Wim/WimHandler.cpp ++++ b/CPP/7zip/Archive/Wim/WimHandler.cpp +@@ -298,7 +298,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) + + AString res; + +- bool numMethods = 0; ++ unsigned numMethods = 0; + for (unsigned i = 0; i < ARRAY_SIZE(k_Methods); i++) + { + if (methodMask & ((UInt32)1 << i)) diff --git a/recipes/p7zip/all/patches/CVE-2018-10115.patch b/recipes/p7zip/all/patches/CVE-2018-10115.patch new file mode 100644 index 0000000000000..7d9c4bf81f000 --- /dev/null +++ b/recipes/p7zip/all/patches/CVE-2018-10115.patch @@ -0,0 +1,311 @@ +From: Robert Luberda +Date: Tue, 29 May 2018 23:59:09 +0200 +Subject: Fix CVE-2018-10115 + +Apply "patch" taken from https://landave.io/files/patch_7zip_CVE-2018-10115.txt + + +Bugs-Debian: https://bugs.debian.org/897674 +--- + CPP/7zip/Compress/Rar1Decoder.cpp | 16 +++++++++++----- + CPP/7zip/Compress/Rar1Decoder.h | 3 ++- + CPP/7zip/Compress/Rar2Decoder.cpp | 17 +++++++++++++---- + CPP/7zip/Compress/Rar2Decoder.h | 3 ++- + CPP/7zip/Compress/Rar3Decoder.cpp | 19 +++++++++++++++---- + CPP/7zip/Compress/Rar3Decoder.h | 3 ++- + CPP/7zip/Compress/Rar5Decoder.cpp | 8 ++++++++ + CPP/7zip/Compress/Rar5Decoder.h | 1 + + 8 files changed, 54 insertions(+), 16 deletions(-) + +diff --git a/CPP/7zip/Compress/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar1Decoder.cpp +index 68030c7..8c890c8 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.cpp ++++ b/CPP/7zip/Compress/Rar1Decoder.cpp +@@ -29,7 +29,7 @@ public: + }; + */ + +-CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { } ++CDecoder::CDecoder(): _isSolid(false), _solidAllowed(false), _errorMode(false) { } + + void CDecoder::InitStructures() + { +@@ -345,7 +345,7 @@ void CDecoder::GetFlagsBuf() + + void CDecoder::InitData() + { +- if (!m_IsSolid) ++ if (!_isSolid) + { + AvrPlcB = AvrLn1 = AvrLn2 = AvrLn3 = NumHuf = Buf60 = 0; + AvrPlc = 0x3500; +@@ -391,6 +391,11 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + if (inSize == NULL || outSize == NULL) + return E_INVALIDARG; + ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ ++ _solidAllowed = false; ++ + if (!m_OutWindowStream.Create(kHistorySize)) + return E_OUTOFMEMORY; + if (!m_InBitStream.Create(1 << 20)) +@@ -398,13 +403,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + + m_UnpackSize = (Int64)*outSize; + m_OutWindowStream.SetStream(outStream); +- m_OutWindowStream.Init(m_IsSolid); ++ m_OutWindowStream.Init(_isSolid); + m_InBitStream.SetStream(inStream); + m_InBitStream.Init(); + + // CCoderReleaser coderReleaser(this); + InitData(); +- if (!m_IsSolid) ++ if (!_isSolid) + { + _errorMode = false; + InitStructures(); +@@ -475,6 +480,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + } + if (m_UnpackSize < 0) + return S_FALSE; ++ _solidAllowed = true; + return m_OutWindowStream.Flush(); + } + +@@ -491,7 +497,7 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) + { + if (size < 1) + return E_INVALIDARG; +- m_IsSolid = ((data[0] & 1) != 0); ++ _isSolid = ((data[0] & 1) != 0); + return S_OK; + } + +diff --git a/CPP/7zip/Compress/Rar1Decoder.h b/CPP/7zip/Compress/Rar1Decoder.h +index 01b606b..8abb3a3 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.h ++++ b/CPP/7zip/Compress/Rar1Decoder.h +@@ -38,7 +38,8 @@ public: + UInt32 LastLength; + + Int64 m_UnpackSize; +- bool m_IsSolid; ++ bool _isSolid; ++ bool _solidAllowed; + bool _errorMode; + + UInt32 ReadBits(int numBits); +diff --git a/CPP/7zip/Compress/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar2Decoder.cpp +index 0580c8d..be8d842 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.cpp ++++ b/CPP/7zip/Compress/Rar2Decoder.cpp +@@ -80,7 +80,8 @@ static const UInt32 kHistorySize = 1 << 20; + static const UInt32 kWindowReservSize = (1 << 22) + 256; + + CDecoder::CDecoder(): +- m_IsSolid(false), ++ _isSolid(false), ++ _solidAllowed(false), + m_TablesOK(false) + { + } +@@ -320,6 +321,10 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + if (inSize == NULL || outSize == NULL) + return E_INVALIDARG; + ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ _solidAllowed = false; ++ + if (!m_OutWindowStream.Create(kHistorySize)) + return E_OUTOFMEMORY; + if (!m_InBitStream.Create(1 << 20)) +@@ -330,12 +335,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + UInt64 pos = 0, unPackSize = *outSize; + + m_OutWindowStream.SetStream(outStream); +- m_OutWindowStream.Init(m_IsSolid); ++ m_OutWindowStream.Init(_isSolid); + m_InBitStream.SetStream(inStream); + m_InBitStream.Init(); + + // CCoderReleaser coderReleaser(this); +- if (!m_IsSolid) ++ if (!_isSolid) + { + InitStructures(); + if (unPackSize == 0) +@@ -343,6 +348,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + if (m_InBitStream.GetProcessedSize() + 2 <= m_PackSize) // test it: probably incorrect; + if (!ReadTables()) + return S_FALSE; ++ _solidAllowed = true; + return S_OK; + } + if (!ReadTables()) +@@ -386,6 +392,9 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + + if (!ReadLastTables()) + return S_FALSE; ++ ++ _solidAllowed = true; ++ + return m_OutWindowStream.Flush(); + } + +@@ -402,7 +411,7 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) + { + if (size < 1) + return E_INVALIDARG; +- m_IsSolid = ((data[0] & 1) != 0); ++ _isSolid = ((data[0] & 1) != 0); + return S_OK; + } + +diff --git a/CPP/7zip/Compress/Rar2Decoder.h b/CPP/7zip/Compress/Rar2Decoder.h +index 0e9005f..370bce2 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.h ++++ b/CPP/7zip/Compress/Rar2Decoder.h +@@ -138,7 +138,8 @@ class CDecoder : + Byte m_LastLevels[kMaxTableSize]; + + UInt64 m_PackSize; +- bool m_IsSolid; ++ bool _isSolid; ++ bool _solidAllowed; + bool m_TablesOK; + + void InitStructures(); +diff --git a/CPP/7zip/Compress/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar3Decoder.cpp +index 6cb8a6a..7b85833 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.cpp ++++ b/CPP/7zip/Compress/Rar3Decoder.cpp +@@ -92,7 +92,8 @@ CDecoder::CDecoder(): + _writtenFileSize(0), + _vmData(0), + _vmCode(0), +- m_IsSolid(false), ++ _isSolid(false), ++ _solidAllowed(false), + _errorMode(false) + { + Ppmd7_Construct(&_ppmd); +@@ -821,7 +822,7 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + { + _writtenFileSize = 0; + _unsupportedFilter = false; +- if (!m_IsSolid) ++ if (!_isSolid) + { + _lzSize = 0; + _winPos = 0; +@@ -840,12 +841,15 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + if (_errorMode) + return S_FALSE; + +- if (!m_IsSolid || !TablesRead) ++ if (!_isSolid || !TablesRead) + { + bool keepDecompressing; + RINOK(ReadTables(keepDecompressing)); + if (!keepDecompressing) ++ { ++ _solidAllowed = true; + return S_OK; ++ } + } + + for (;;) +@@ -870,6 +874,9 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + if (!keepDecompressing) + break; + } ++ ++ _solidAllowed = true; ++ + RINOK(WriteBuf()); + UInt64 packSize = m_InBitStream.BitDecoder.GetProcessedSize(); + RINOK(progress->SetRatioInfo(&packSize, &_writtenFileSize)); +@@ -890,6 +897,10 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + if (!inSize) + return E_INVALIDARG; + ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ _solidAllowed = false; ++ + if (!_vmData) + { + _vmData = (Byte *)::MidAlloc(kVmDataSizeMax + kVmCodeSizeMax); +@@ -928,7 +939,7 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) + { + if (size < 1) + return E_INVALIDARG; +- m_IsSolid = ((data[0] & 1) != 0); ++ _isSolid = ((data[0] & 1) != 0); + return S_OK; + } + +diff --git a/CPP/7zip/Compress/Rar3Decoder.h b/CPP/7zip/Compress/Rar3Decoder.h +index 2f72d7d..32c8943 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.h ++++ b/CPP/7zip/Compress/Rar3Decoder.h +@@ -191,7 +191,8 @@ class CDecoder: + CRecordVector _tempFilters; + UInt32 _lastFilter; + +- bool m_IsSolid; ++ bool _isSolid; ++ bool _solidAllowed; + bool _errorMode; + + bool _lzMode; +diff --git a/CPP/7zip/Compress/Rar5Decoder.cpp b/CPP/7zip/Compress/Rar5Decoder.cpp +index dc8830f..a826d5a 100644 +--- a/CPP/7zip/Compress/Rar5Decoder.cpp ++++ b/CPP/7zip/Compress/Rar5Decoder.cpp +@@ -72,6 +72,7 @@ CDecoder::CDecoder(): + _writtenFileSize(0), + _dictSizeLog(0), + _isSolid(false), ++ _solidAllowed(false), + _wasInit(false), + _inputBuf(NULL) + { +@@ -801,7 +802,10 @@ HRESULT CDecoder::CodeReal() + */ + + if (res == S_OK) ++ { ++ _solidAllowed = true; + res = res2; ++ } + + if (res == S_OK && _unpackSize_Defined && _writtenFileSize != _unpackSize) + return S_FALSE; +@@ -821,6 +825,10 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + { + try + { ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ _solidAllowed = false; ++ + if (_dictSizeLog >= sizeof(size_t) * 8) + return E_NOTIMPL; + +diff --git a/CPP/7zip/Compress/Rar5Decoder.h b/CPP/7zip/Compress/Rar5Decoder.h +index b0a4dd1..3db5018 100644 +--- a/CPP/7zip/Compress/Rar5Decoder.h ++++ b/CPP/7zip/Compress/Rar5Decoder.h +@@ -271,6 +271,7 @@ class CDecoder: + Byte _dictSizeLog; + bool _tableWasFilled; + bool _isSolid; ++ bool _solidAllowed; + bool _wasInit; + + UInt32 _reps[kNumReps]; diff --git a/recipes/p7zip/all/patches/clang.diff b/recipes/p7zip/all/patches/clang.diff new file mode 100644 index 0000000000000..38056ac99eefe --- /dev/null +++ b/recipes/p7zip/all/patches/clang.diff @@ -0,0 +1,49 @@ +From b6b1782af4aa7f9084d32e4144738dc2535c8d6f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 23 Apr 2018 23:07:21 -0700 +Subject: [PATCH] Fix narrowing errors -Wc++11-narrowing + +Clang 6.x finds these errors + + ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') +[-Wc++11-arrowing] + case E_INVALIDARG : txt = "E_INVALIDARG"; break ; + ^ + +HRESULT causes the macro to be parsed as a signed long, so we need to force it +to be checked as an unsigned long instead. + +also reported here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224930 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + CPP/Windows/ErrorMsg.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp +index 99684ae..78a64ba 100644 +--- a/CPP/Windows/ErrorMsg.cpp ++++ b/CPP/Windows/ErrorMsg.cpp +@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) + + switch(errorCode) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; +- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; +- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; +- case E_ABORT : txt = "E_ABORT"; break ; +- case E_FAIL : txt = "E_FAIL"; break ; +- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; +- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; +- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ++ case (DWORD) E_NOTIMPL : txt = "E_NOTIMPL"; break ; ++ case (DWORD) E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; ++ case (DWORD) E_ABORT : txt = "E_ABORT"; break ; ++ case (DWORD) E_FAIL : txt = "E_FAIL"; break ; ++ case (DWORD) STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; ++ case (DWORD) E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; ++ case (DWORD) E_INVALIDARG : txt = "E_INVALIDARG"; break ; + case ERROR_DIRECTORY : txt = "Error Directory"; break ; + default: + txt = strerror(errorCode); diff --git a/recipes/p7zip/all/test_package/conanfile.py b/recipes/p7zip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..45e5a32aba828 --- /dev/null +++ b/recipes/p7zip/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("7za", env="conanrun") diff --git a/recipes/p7zip/all/test_v1_package/conanfile.py b/recipes/p7zip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..58d9c6f21e0ce --- /dev/null +++ b/recipes/p7zip/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("7za", run_environment=True) diff --git a/recipes/p7zip/config.yml b/recipes/p7zip/config.yml new file mode 100644 index 0000000000000..cd6dd6982cb15 --- /dev/null +++ b/recipes/p7zip/config.yml @@ -0,0 +1,3 @@ +versions: + "16.02": + folder: "all" diff --git a/recipes/packio/all/conandata.yml b/recipes/packio/all/conandata.yml new file mode 100644 index 0000000000000..883472bb39dd2 --- /dev/null +++ b/recipes/packio/all/conandata.yml @@ -0,0 +1,46 @@ +sources: + 1.0.1: + sha256: 873ebd2ce8c8dbf8a4e7b777b1aa735fe4da3863131a5d6c938e339ee7e0a4d1 + url: https://github.com/qchateau/packio/archive/1.0.1.tar.gz + 1.0.2: + sha256: 040389f2de4a6da5df1cc323cdd80bc21bfc6a7f9bb9e56090d1ea0b1260226d + url: https://github.com/qchateau/packio/archive/1.0.2.tar.gz + 1.1.0: + sha256: fb8baeeb903335b71b4241433faaff895e42e671da1c15b100e24b060f1d3784 + url: https://github.com/qchateau/packio/archive/1.1.0.tar.gz + 1.1.1: + sha256: 5f77bcbb843cc7dd7731c37db586e9e4f3997ebf04a8d1eccb9eae21841c7e55 + url: https://github.com/qchateau/packio/archive/1.1.1.tar.gz + 1.2.0: + sha256: b459c50a2ae7b90b45cd99a727dcd133e48602634571378491533148e642c511 + url: https://github.com/qchateau/packio/archive/1.2.0.tar.gz + 1.2.1: + sha256: 1b3f1654e8321148dd58172fcc6807451382dff30bb803967449a318b33101c5 + url: https://github.com/qchateau/packio/archive/1.2.1.tar.gz + 1.3.0: + sha256: adb723ef14b4a3ec41e9a7c17c48c8ee58712604b678b24f44e6a8aa471f18e5 + url: https://github.com/qchateau/packio/archive/1.3.0.tar.gz + 2.0.0: + sha256: b647b3088830c127a1d5d475a95476cc00c81675244cf7d17c9ca1f12e88740e + url: https://github.com/qchateau/packio/archive/2.0.0.tar.gz + 2.0.1: + sha256: 081d378be922262c39218e115eabdf77f257e4773928011dff95795b8146b520 + url: https://github.com/qchateau/packio/archive/2.0.1.tar.gz + 2.1.0: + sha256: d13be083cd5a133b02fdd1da0d89fb75988c16109ccdcd631d53f9ca2457ad42 + url: https://github.com/qchateau/packio/archive/2.1.0.tar.gz + "2.2.0": + url: "https://github.com/qchateau/packio/archive/2.2.0.tar.gz" + sha256: "ac9f33d5e8dd92bd3cdec106e10453424060bae9c4cd97281aa5d20fb20476f7" + "2.3.0": + url: "https://github.com/qchateau/packio/archive/2.3.0.tar.gz" + sha256: "4ef3bc76934855cc1a17eb00311bb42f5f14f616c75d4d1cc35151efcc988358" + "2.4.0": + url: "https://github.com/qchateau/packio/archive/2.4.0.tar.gz" + sha256: "2815d7772ef8d2360c5e15de7738ec7267e1e54a7afb817bf42a18a9f100ff52" + "2.4.1": + url: "https://github.com/qchateau/packio/archive/2.4.1.tar.gz" + sha256: "c115548146d6da432048265037b30f77ba6ad7a39350693c4fb36fd896bc7a4b" + "2.5.0": + url: "https://github.com/qchateau/packio/archive/2.5.0.tar.gz" + sha256: "5aa29313ac37be2fb66ff01af9413d9f9931cd4566f1400b00fac107552558ae" diff --git a/recipes/packio/all/conanfile.py b/recipes/packio/all/conanfile.py new file mode 100644 index 0000000000000..1b6fc91c9312b --- /dev/null +++ b/recipes/packio/all/conanfile.py @@ -0,0 +1,107 @@ +import os +from conan import ConanFile +from conan.tools import files, scm, build +from conan.errors import ConanInvalidConfiguration + + +class PackioConan(ConanFile): + name = "packio" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/qchateau/packio" + description = "An asynchronous msgpack-RPC and JSON-RPC library built on top of Boost.Asio." + topics = ("rpc", "msgpack", "json", "asio", "async", "cpp17", "cpp20", "coroutines") + settings = "compiler" + no_copy_source = True + options = { + "standalone_asio": [True, False], + "msgpack": [True, False], + "nlohmann_json": [True, False], + "boost_json": [True, False, "default"], + } + default_options = { + "standalone_asio": False, + "msgpack": True, + "nlohmann_json": True, + "boost_json": "default", + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + if scm.Version(self.version) < "2.4.0": + return { + "apple-clang": 10, + "clang": 6, + "gcc": 7, + "Visual Studio": 16, + } + return { + "apple-clang": 13, + "clang": 11, + "gcc": 9, + "Visual Studio": 16, + } + + def config_options(self): + if scm.Version(self.version) < "1.2.0": + del self.options.standalone_asio + if scm.Version(self.version) < "2.0.0": + del self.options.msgpack + del self.options.nlohmann_json + if scm.Version(self.version) < "2.1.0": + del self.options.boost_json + + def requirements(self): + if self.options.get_safe("msgpack") or scm.Version(self.version) < "2.0.0": + self.requires("msgpack/3.2.1") + + if self.options.get_safe("nlohmann_json"): + self.requires("nlohmann_json/3.9.1") + + # defaults to True if using boost.asio, False if using asio + if self.options.get_safe("boost_json") == "default": + self.options.boost_json = not self.options.standalone_asio + + if self.options.get_safe("boost_json") or not self.options.get_safe("standalone_asio"): + self.requires("boost/1.75.0") + + if self.options.get_safe("standalone_asio"): + self.requires("asio/1.18.1") + + def source(self): + files.get(conanfile=self, **self.conan_data["sources"][self.version]) + extracted_dir = "packio-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + if self.settings.compiler.cppstd: + build.check_min_cppstd(self, "17") + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if scm.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("packio requires C++17, which your compiler does not support.") + else: + self.output.warn("packio requires C++17. Your compiler is unknown. Assuming it supports C++17.") + + def package(self): + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + if scm.Version(self.version) < "2.1.0": + if self.options.get_safe("standalone_asio"): + self.cpp_info.defines.append("PACKIO_STANDALONE_ASIO") + else: + # Starting from 2.1.0, preprocessor defines can be defined to 0 to force-disable + self.cpp_info.defines.append(f"PACKIO_STANDALONE_ASIO={1 if self.options.get_safe('standalone_asio') else 0}") + self.cpp_info.defines.append(f"PACKIO_HAS_MSGPACK={1 if self.options.get_safe('msgpack') else 0}") + self.cpp_info.defines.append(f"PACKIO_HAS_NLOHMANN_JSON={1 if self.options.get_safe('nlohmann_json') else 0}") + self.cpp_info.defines.append(f"PACKIO_HAS_BOOST_JSON={1 if self.options.get_safe('boost_json') else 0}") diff --git a/recipes/packio/all/test_package/1.0.x-1.1.x.cpp b/recipes/packio/all/test_package/1.0.x-1.1.x.cpp new file mode 100644 index 0000000000000..f4ef879ba2126 --- /dev/null +++ b/recipes/packio/all/test_package/1.0.x-1.1.x.cpp @@ -0,0 +1,16 @@ +#include // missing include in recent versions of MSVC + +#include + +namespace ip = boost::asio::ip; + +int main(int, char **) { + boost::asio::io_context io; + + ip::tcp::endpoint bind_ep{ip::make_address("127.0.0.1"), 0}; + auto server = + std::make_shared>(ip::tcp::acceptor{io, bind_ep}); + auto client = std::make_shared>(ip::tcp::socket{io}); + + return 0; +} diff --git a/recipes/packio/all/test_package/1.2.x.cpp b/recipes/packio/all/test_package/1.2.x.cpp new file mode 100644 index 0000000000000..4d1bd032ed004 --- /dev/null +++ b/recipes/packio/all/test_package/1.2.x.cpp @@ -0,0 +1,19 @@ +#include // missing include in recent versions of MSVC + +#include + +#if defined(PACKIO_STANDALONE_ASIO) +namespace net = ::asio; +#else // defined(PACKIO_STANDALONE_ASIO) +namespace net = ::boost::asio; +#endif // defined(PACKIO_STANDALONE_ASIO) + +int main(int, char **) { + net::io_context io; + + net::ip::tcp::endpoint bind_ep{net::ip::make_address("127.0.0.1"), 0}; + auto server = packio::make_server(net::ip::tcp::acceptor{io, bind_ep}); + auto client = packio::make_client(net::ip::tcp::socket{io}); + + return 0; +} diff --git a/recipes/packio/all/test_package/CMakeLists.txt b/recipes/packio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f7a1923821168 --- /dev/null +++ b/recipes/packio/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(TestPackage CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +if (PACKIO_VERSION VERSION_LESS "1.2.0") + add_executable(main 1.0.x-1.1.x.cpp) +elseif (PACKIO_VERSION VERSION_LESS "2.0.0") + add_executable(main 1.2.x.cpp) +else () + add_executable(main latest.cpp) +endif () + +target_link_libraries(main ${CONAN_LIBS}) +set_property(TARGET main PROPERTY CXX_STANDARD 17) diff --git a/recipes/packio/all/test_package/conanfile.py b/recipes/packio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..aef41dfda73a3 --- /dev/null +++ b/recipes/packio/all/test_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" + + def build(self): + packio_version = self.deps_cpp_info["packio"].version + cmake = CMake(self) + cmake.configure(defs={"PACKIO_VERSION": packio_version}) + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "main"), run_environment=True) diff --git a/recipes/packio/all/test_package/latest.cpp b/recipes/packio/all/test_package/latest.cpp new file mode 100644 index 0000000000000..381f2263eed02 --- /dev/null +++ b/recipes/packio/all/test_package/latest.cpp @@ -0,0 +1,20 @@ +#include // missing include in recent versions of MSVC + +#include + +namespace net = packio::net; + +int main(int, char **) { + net::io_context io; + + net::ip::tcp::endpoint bind_ep{net::ip::make_address("127.0.0.1"), 0}; + auto msgpack_server = + packio::msgpack_rpc::make_server(net::ip::tcp::acceptor{io, bind_ep}); + auto msgpack_client = + packio::msgpack_rpc::make_client(net::ip::tcp::socket{io}); + auto json_server = + packio::nl_json_rpc::make_server(net::ip::tcp::acceptor{io, bind_ep}); + auto json_client = packio::nl_json_rpc::make_client(net::ip::tcp::socket{io}); + + return 0; +} diff --git a/recipes/packio/config.yml b/recipes/packio/config.yml new file mode 100644 index 0000000000000..4e4071772582c --- /dev/null +++ b/recipes/packio/config.yml @@ -0,0 +1,31 @@ +versions: + 1.0.1: + folder: all + 1.0.2: + folder: all + 1.1.0: + folder: all + 1.1.1: + folder: all + 1.2.0: + folder: all + 1.2.1: + folder: all + 1.3.0: + folder: all + 2.0.0: + folder: all + 2.0.1: + folder: all + 2.1.0: + folder: all + "2.2.0": + folder: all + "2.3.0": + folder: all + "2.4.0": + folder: all + "2.4.1": + folder: all + "2.5.0": + folder: all diff --git a/recipes/pagmo2/all/CMakeLists.txt b/recipes/pagmo2/all/CMakeLists.txt new file mode 100644 index 0000000000000..b71c882d9d33f --- /dev/null +++ b/recipes/pagmo2/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/pagmo2/all/conandata.yml b/recipes/pagmo2/all/conandata.yml new file mode 100644 index 0000000000000..a610a9ffc5a7b --- /dev/null +++ b/recipes/pagmo2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "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 new file mode 100644 index 0000000000000..08b268962bb1c --- /dev/null +++ b/recipes/pagmo2/all/conanfile.py @@ -0,0 +1,153 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.43.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" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_eigen": [True, False], + "with_nlopt": [True, False], + "with_ipopt": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_eigen": False, + "with_nlopt": False, + "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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("boost/1.78.0") + self.requires("onetbb/2020.3") + if self.options.with_eigen: + self.requires("eigen/3.4.0") + 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" + } + + @property + def _required_boost_components(self): + return ["serialization"] + + 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] + + 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)) + + # 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 source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + 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)") + # 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 + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYING.*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(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") + # 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.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 new file mode 100644 index 0000000000000..e512e2207b158 --- /dev/null +++ b/recipes/pagmo2/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pagmo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} Pagmo::pagmo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/pagmo2/all/test_package/conanfile.py b/recipes/pagmo2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pagmo2/all/test_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/pagmo2/all/test_package/test_package.cpp b/recipes/pagmo2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2a7861aea6447 --- /dev/null +++ b/recipes/pagmo2/all/test_package/test_package.cpp @@ -0,0 +1,42 @@ +// From first_udp_ver0.cpp in tutorials of pagmo2 + +#include +#include + +#include +#include +#include +#include + +// Our simple example problem, version 0. +struct problem_v0 { + // Implementation of the objective function. + pagmo::vector_double fitness(const pagmo::vector_double &dv) const + { + return {dv[0] * dv[3] * (dv[0] + dv[1] + dv[2]) + dv[2]}; + } + // Implementation of the box bounds. + std::pair get_bounds() const + { + return {{1., 1., 1., 1.}, {5., 5., 5., 5.}}; + } +}; + +int main() +{ + // Construct a pagmo::problem from our example problem. + pagmo::problem p{problem_v0{}}; + + // Compute the value of the objective function + // in the point (1, 2, 3, 4). + std::cout << "Value of the objfun in (1, 2, 3, 4): " << p.fitness({1, 2, 3, 4})[0] << '\n'; + + // Fetch the lower/upper bounds for the first variable. + std::cout << "Lower bounds: [" << p.get_lb()[0] << "]\n"; + std::cout << "Upper bounds: [" << p.get_ub()[0] << "]\n\n"; + + // Print p to screen. + std::cout << p << "\n"; + + return 0; +} diff --git a/recipes/pagmo2/config.yml b/recipes/pagmo2/config.yml new file mode 100644 index 0000000000000..0daf1d812658e --- /dev/null +++ b/recipes/pagmo2/config.yml @@ -0,0 +1,5 @@ +versions: + "2.17.0": + folder: all + "2.10": + folder: pre_2.11 diff --git a/recipes/pagmo2/pre_2.11/CMakeLists.txt b/recipes/pagmo2/pre_2.11/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..fb48c3245b653 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.10": + url: "https://github.com/esa/pagmo2/archive/refs/tags/v2.10.tar.gz" + sha256: "2fa95e2b464ddeadb9fc09bd314081293f02a1b6abc11c0b05064729a077227c" +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 new file mode 100644 index 0000000000000..eeacc0b3752d5 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/conanfile.py @@ -0,0 +1,111 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.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" + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_eigen": [True, False], + "with_nlopt": [True, False], + "with_ipopt": [True, False], + } + default_options = { + "with_eigen": False, + "with_nlopt": False, + "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"]) + + def requirements(self): + self.requires("boost/1.78.0") + self.requires("onetbb/2020.3") + if self.options.with_eigen: + self.requires("eigen/3.4.0") + if self.options.with_nlopt: + self.requires("nlopt/2.7.1") + + @property + def _required_boost_components(self): + return ["serialization"] + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.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() + + 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 + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def package(self): + self.copy(pattern="COPYING.*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(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") + # 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"] + 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/patches/0001-fix-cmake-module-path-2-10.patch b/recipes/pagmo2/pre_2.11/patches/0001-fix-cmake-module-path-2-10.patch new file mode 100644 index 0000000000000..ab88571e5ab44 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/patches/0001-fix-cmake-module-path-2-10.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8f9f1822..6d310a2c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ + cmake_minimum_required(VERSION 3.2) + + # Module path setup. +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules" "${CMAKE_SOURCE_DIR}/cmake_modules/yacma") ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/yacma") + + # Set default build type to "Release". + if(NOT CMAKE_BUILD_TYPE) diff --git a/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt b/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7439694a33876 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pagmo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} Pagmo::pagmo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/pagmo2/pre_2.11/test_package/conanfile.py b/recipes/pagmo2/pre_2.11/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/test_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/pagmo2/pre_2.11/test_package/test_package.cpp b/recipes/pagmo2/pre_2.11/test_package/test_package.cpp new file mode 100644 index 0000000000000..4e2ad1dec677b --- /dev/null +++ b/recipes/pagmo2/pre_2.11/test_package/test_package.cpp @@ -0,0 +1,42 @@ +// From first_udp_ver0.cpp in tutorials of pagmo2 + +#include +#include + +#include +#include +#include +#include + +// Our simple example problem, version 0. +struct problem_v0 { + // Implementation of the objective function. + pagmo::vector_double fitness(const pagmo::vector_double &dv) const + { + return {dv[0] * dv[3] * (dv[0] + dv[1] + dv[2]) + dv[2]}; + } + // Implementation of the box bounds. + std::pair get_bounds() const + { + return {{1., 1., 1., 1.}, {5., 5., 5., 5.}}; + } +}; + +int main() +{ + // Construct a pagmo::problem from our example problem. + pagmo::problem p{problem_v0{}}; + + // Getting its dimensions + std::cout << "Calling the dimension getter: " << p.get_nx() << '\n'; + std::cout << "Calling the fitness dimension getter: " << p.get_nobj() << '\n'; + + // Compute the value of the objective function + // in the point (1, 2, 3, 4). + std::cout << "Value of the objfun in (1, 2, 3, 4): " << p.fitness({1, 2, 3, 4})[0] << '\n'; + + // Print p to screen. + std::cout << p << "\n"; + + return 0; +} diff --git a/recipes/paho-mqtt-c/all/conandata.yml b/recipes/paho-mqtt-c/all/conandata.yml new file mode 100644 index 0000000000000..97257e57f3eab --- /dev/null +++ b/recipes/paho-mqtt-c/all/conandata.yml @@ -0,0 +1,46 @@ +sources: + "1.3.12": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.12.tar.gz" + sha256: "6a70a664ed3bbcc1eafdc45a5dc11f3ad70c9bac12a54c2f8cef15c0e7d0a93b" + "1.3.11": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.11.tar.gz" + sha256: "d7bba3f8b8978802e11e2b1f28e96e6b7f4ed5d8a268af52a4d3b1bcbd1db16b" + "1.3.10": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.10.tar.gz" + sha256: "c70db96e66adacae411d5d875fbb08bca6ff9945de3d215b3af93cbd22792db5" + "1.3.9": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.9.tar.gz" + sha256: "386c9b5fa1cf6d0d516db12d57fd8f6a410dd0fdc5e9a2da870aae437a2535ed" + "1.3.8": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.8.tar.gz" + sha256: "4920ff685344cdb0272568bc4414dcf48fcdfc4a98c78b1f3ca49c38417bf391" + "1.3.6": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.6.tar.gz" + sha256: "ecbc2c2000c6d8dcf1a76325312c61ed29db0b010acbd40cb92fcd4c014cd017" + "1.3.5": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.5.tar.gz" + sha256: "996eef9e498519da79108f58a887a34abc50cd76770b19b0300b27783706c71f" + "1.3.4": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.4.tar.gz" + sha256: "1ae9b657b693254ed0710350df3dcf5232d1f479409a52861b5e5bb5cc3da046" +patches: + "1.3.9": + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" + patch_description: "disable forced multi threaded DLL(-MD)" + patch_type: "conan" + "1.3.8": + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" + patch_description: "disable forced multi threaded DLL(-MD)" + patch_type: "conan" + "1.3.6": + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" + patch_description: "disable forced multi threaded DLL(-MD)" + patch_type: "conan" + "1.3.5": + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" + patch_description: "disable forced multi threaded DLL(-MD)" + patch_type: "conan" + "1.3.4": + - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch" + patch_description: "disable cpack, link win32 libs more, source patches for MinGW/OSX" + patch_type: "conan" diff --git a/recipes/paho-mqtt-c/all/conanfile.py b/recipes/paho-mqtt-c/all/conanfile.py new file mode 100644 index 0000000000000..7af37a8f2229f --- /dev/null +++ b/recipes/paho-mqtt-c/all/conanfile.py @@ -0,0 +1,163 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file +import os + +required_conan_version = ">=1.53.0" + + +class PahoMqttcConan(ConanFile): + name = "paho-mqtt-c" + description = "Eclipse Paho MQTT C client library for Linux, Windows and MacOS" + license = "EPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eclipse/paho.mqtt.c" + topics = ("mqtt", "iot", "eclipse", "ssl", "tls", "paho") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ssl": [True, False], + "asynchronous": [True, False], + "high_performance": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "ssl": True, + "asynchronous": True, + "high_performance": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.ssl: + # Headers are exposed https://github.com/eclipse/paho.mqtt.c/blob/f7799da95e347bbc930b201b52a1173ebbad45a7/src/SSLSocket.h#L29 + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PAHO_ENABLE_TESTING"] = False + tc.variables["PAHO_BUILD_DOCUMENTATION"] = False + tc.variables["PAHO_ENABLE_CPACK"] = False + tc.variables["PAHO_BUILD_DEB_PACKAGE"] = False + tc.variables["PAHO_BUILD_ASYNC"] = self.options.asynchronous + tc.variables["PAHO_BUILD_STATIC"] = not self.options.shared + tc.variables["PAHO_BUILD_SHARED"] = self.options.shared + tc.variables["PAHO_BUILD_SAMPLES"] = False + tc.variables["PAHO_WITH_SSL"] = self.options.ssl + if self.options.ssl: + tc.cache_variables["OPENSSL_SEARCH_PATH"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.cache_variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.variables["PAHO_HIGH_PERFORMANCE"] = self.options.high_performance + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_source(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "SET(CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}/cmake/modules\")", + "LIST(APPEND CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}/cmake/modules\")") + if not self.options.get_safe("fPIC", True): + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "POSITION_INDEPENDENT_CODE ON", "") + + def build(self): + self._patch_source() + cmake = CMake(self) + cmake.configure() + cmake.build(target=self._cmake_target) + + def package(self): + copy(self, "edl-v10", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, self._epl_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "notice.html", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + # Manually copy since the CMake installs everything + copy(self, pattern="MQTT*.h", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + + for suffix in ["lib", "a", "dylib"]: + copy(self, pattern=f"*.{suffix}", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern=f"*{self._lib_target}.so*", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern=f"*{self._lib_target}.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "*.cmake", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "eclipse-paho-mqtt-c") + self.cpp_info.set_property("cmake_target_name", f"eclipse-paho-mqtt-c::{self._cmake_target}") + + # TODO: back to global scope in conan v2 + self.cpp_info.components["_paho-mqtt-c"].libs = [self._lib_target] + if self.settings.os == "Windows": + if not self.options.shared: + self.cpp_info.components["_paho-mqtt-c"].system_libs.append("ws2_32") + if self.settings.compiler == "gcc": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend( + ["wsock32", "uuid", "crypt32", "rpcrt4"]) + elif self.settings.os == "Linux": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["anl", "c", "dl", "pthread"]) + elif self.settings.os == "FreeBSD": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["compat", "pthread"]) + elif self.settings.os == "Android": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c"]) + else: + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c", "pthread"]) + + if self.options.ssl: + self.cpp_info.components["_paho-mqtt-c"].requires = ["openssl::openssl"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "eclipse-paho-mqtt-c" + self.cpp_info.names["cmake_find_package_multi"] = "eclipse-paho-mqtt-c" + self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package"] = self._cmake_target + self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package_multi"] = self._cmake_target + self.cpp_info.components["_paho-mqtt-c"].set_property("cmake_target_name", f"eclipse-paho-mqtt-c::{self._cmake_target}") + + @property + def _epl_file(self): + return "epl-v10" if self.version in ['1.3.0', '1.3.1'] else "epl-v20" # EPL changed to V2 + + @property + def _cmake_target(self): + target = "paho-mqtt3" + target += "a" if self.options.asynchronous else "c" + if self.options.ssl: + target += "s" + if not self.options.shared: + target += "-static" + return target + + @property + def _lib_target(self): + target = "paho-mqtt3" + target += "a" if self.options.asynchronous else "c" + if self.options.ssl: + target += "s" + if not self.options.shared: + # https://github.com/eclipse/paho.mqtt.c/blob/317fb008e1541838d1c29076d2bc5c3e4b6c4f53/src/CMakeLists.txt#L154 + if self.settings.os == "Windows": + target += "-static" + return target diff --git a/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch b/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch new file mode 100644 index 0000000000000..ed177c3dd470f --- /dev/null +++ b/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch @@ -0,0 +1,98 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b53745b..d8787d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,7 @@ + ENDIF() + + IF(WIN32) +- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD) ++ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN) + ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + ADD_DEFINITIONS(-DOSX) + ENDIF() +@@ -73,33 +73,6 @@ + ADD_SUBDIRECTORY(doc) + ENDIF() + +-IF (PAHO_ENABLE_CPACK) +- ### packaging settings +- FILE(GLOB samples "src/samples/*.c") +- INSTALL(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}/samples) +- +- SET(CPACK_PACKAGE_VENDOR "Eclipse Paho") +- SET(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C") +- INSTALL(FILES CONTRIBUTING.md epl-v20 edl-v10 README.md notice.html DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- +- IF (WIN32) +- SET(CPACK_GENERATOR "ZIP") +- ELSEIF(PAHO_BUILD_DEB_PACKAGE) +- INSTALL(FILES CONTRIBUTING.md epl-v20 edl-v10 README.md notice.html DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- +- SET(CPACK_GENERATOR "DEB") +- CONFIGURE_FILE(${CMAKE_SCRIPTS}/CPackDebConfig.cmake.in +- ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake @ONLY) +- SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake) +- ADD_SUBDIRECTORY(debian) +- ELSE() +- SET(CPACK_GENERATOR "TGZ") +- ENDIF() +-ELSE() +- FILE(GLOB samples "src/samples/*.c") +- INSTALL(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}) +-ENDIF() +- + SET(CPACK_PACKAGE_VERSION_MAJOR ${PAHO_VERSION_MAJOR}) + SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR}) + SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b46eaca..399b37d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -57,7 +57,7 @@ + ENDIF() + + IF (WIN32) +- SET(LIBS_SYSTEM ws2_32 crypt32 RpcRT4) ++ SET(LIBS_SYSTEM ws2_32 crypt32 RpcRT4 wsock32) + ELSEIF (UNIX) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET(LIBS_SYSTEM c dl pthread rt) +diff --git a/src/Thread.c b/src/Thread.c +index 4cb2f16..40ce8dc 100644 +--- a/src/Thread.c ++++ b/src/Thread.c +@@ -419,9 +419,16 @@ + struct timespec cond_timeout; + + FUNC_ENTRY; ++#if defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 ++ struct timeval cur_time; ++ gettimeofday(&cur_time, NULL); ++ cond_timeout.tv_sec = cur_time.tv_sec + timeout; ++ cond_timeout.tv_nsec = cur_time.tv_usec * 1000; ++#else + clock_gettime(CLOCK_REALTIME, &cond_timeout); + + cond_timeout.tv_sec += timeout; ++#endif + pthread_mutex_lock(&condvar->mutex); + rc = pthread_cond_timedwait(&condvar->cond, &condvar->mutex, &cond_timeout); + pthread_mutex_unlock(&condvar->mutex); +diff --git a/src/WebSocket.c b/src/WebSocket.c +index 47b1dad..3f96dac 100644 +--- a/src/WebSocket.c ++++ b/src/WebSocket.c +@@ -37,6 +37,11 @@ + #include "SocketBuffer.h" + #include "StackTrace.h" + ++#ifdef __MINGW32__ ++#define htonll __builtin_bswap64 ++#define ntohll __builtin_bswap64 ++#endif ++ + #if defined(__linux__) + # include + #elif defined(__APPLE__) + diff --git a/recipes/paho-mqtt-c/all/patches/0003-allow-static-windows-runtimes.patch b/recipes/paho-mqtt-c/all/patches/0003-allow-static-windows-runtimes.patch new file mode 100644 index 0000000000000..5b7463e270abf --- /dev/null +++ b/recipes/paho-mqtt-c/all/patches/0003-allow-static-windows-runtimes.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 531c39c..3f5517a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,7 @@ IF (PAHO_HIGH_PERFORMANCE) + ENDIF() + + IF(WIN32) +- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD) ++ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN) + ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + ADD_DEFINITIONS(-DOSX) + ENDIF() + + diff --git a/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt b/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1e82b16d05ff --- /dev/null +++ b/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(eclipse-paho-mqtt-c REQUIRED CONFIG) + +if(PAHO_MQTT_C_ASYNC) + add_executable(${PROJECT_NAME} test_package_async.c) + if(PAHO_MQTT_C_WITH_SSL) + if(TARGET eclipse-paho-mqtt-c::paho-mqtt3as) + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3as) + else() + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3as-static) + endif() + else() + if(TARGET eclipse-paho-mqtt-c::paho-mqtt3a) + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3a) + else() + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3a-static) + endif() + endif() +else() + add_executable(${PROJECT_NAME} test_package_client.c) + if(PAHO_MQTT_C_WITH_SSL) + if(TARGET eclipse-paho-mqtt-c::paho-mqtt3cs) + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3cs) + else() + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3cs-static) + endif() + else() + if(TARGET eclipse-paho-mqtt-c::paho-mqtt3c) + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3c) + else() + target_link_libraries(${PROJECT_NAME} PRIVATE eclipse-paho-mqtt-c::paho-mqtt3c-static) + endif() + endif() +endif() diff --git a/recipes/paho-mqtt-c/all/test_package/conanfile.py b/recipes/paho-mqtt-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e4c1cfef62d63 --- /dev/null +++ b/recipes/paho-mqtt-c/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PAHO_MQTT_C_ASYNC"] = self.dependencies["paho-mqtt-c"].options.asynchronous + tc.variables["PAHO_MQTT_C_WITH_SSL"] = self.dependencies["paho-mqtt-c"].options.ssl + 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/paho-mqtt-c/all/test_package/test_package_async.c b/recipes/paho-mqtt-c/all/test_package/test_package_async.c new file mode 100644 index 0000000000000..82636f10b9b8c --- /dev/null +++ b/recipes/paho-mqtt-c/all/test_package/test_package_async.c @@ -0,0 +1,122 @@ +// This example does not work for library option 'paho-mqtt-c:async=False' +#include +#include +#include +#include "MQTTAsync.h" + +#if !defined(WIN32) +#include +#else +#include +#endif + +#if defined(_WRS_KERNEL) +#include +#endif + +#define ADDRESS "tcp://iot.eclipse.org:1883" +#define CLIENTID "ExampleClientPub" +#define TOPIC "MQTT Examples" +#define PAYLOAD "Hello World!" +#define QOS 1 +#define TIMEOUT 10000L + +volatile MQTTAsync_token deliveredtoken; + +int finished = 0; + +void connlost(void *context, char *cause) +{ + MQTTAsync client = (MQTTAsync)context; + MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer; + int rc; + + printf("\nConnection lost\n"); + printf(" cause: %s\n", cause); + + printf("Reconnecting\n"); + conn_opts.keepAliveInterval = 20; + conn_opts.cleansession = 1; + if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS) + { + printf("Failed to start connect, return code %d\n", rc); + finished = 1; + } +} + +void onDisconnect(void *context, MQTTAsync_successData *response) +{ + printf("Successful disconnection\n"); + finished = 1; +} + +void onSend(void *context, MQTTAsync_successData *response) +{ + MQTTAsync client = (MQTTAsync)context; + MQTTAsync_disconnectOptions opts = MQTTAsync_disconnectOptions_initializer; + int rc; + + printf("Message with token value %d delivery confirmed\n", response->token); + + opts.onSuccess = onDisconnect; + opts.context = client; + + if ((rc = MQTTAsync_disconnect(client, &opts)) != MQTTASYNC_SUCCESS) + { + printf("Failed to start sendMessage, return code %d\n", rc); + exit(EXIT_FAILURE); + } +} + +void onConnectFailure(void *context, MQTTAsync_failureData *response) +{ + printf("Connect failed, rc %d\n", response ? response->code : 0); + finished = 1; +} + +void onConnect(void *context, MQTTAsync_successData *response) +{ + MQTTAsync client = (MQTTAsync)context; + MQTTAsync_responseOptions opts = MQTTAsync_responseOptions_initializer; + MQTTAsync_message pubmsg = MQTTAsync_message_initializer; + int rc; + + printf("Successful connection\n"); + + opts.onSuccess = onSend; + opts.context = client; + + pubmsg.payload = PAYLOAD; + pubmsg.payloadlen = strlen(PAYLOAD); + pubmsg.qos = QOS; + pubmsg.retained = 0; + deliveredtoken = 0; + + if ((rc = MQTTAsync_sendMessage(client, TOPIC, &pubmsg, &opts)) != MQTTASYNC_SUCCESS) + { + printf("Failed to start sendMessage, return code %d\n", rc); + exit(EXIT_FAILURE); + } +} + +int main(int argc, char *argv[]) +{ + MQTTAsync client; + MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer; + int rc; + + MQTTAsync_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); + + MQTTAsync_setCallbacks(client, NULL, connlost, NULL, NULL); + + conn_opts.keepAliveInterval = 20; + conn_opts.cleansession = 1; + conn_opts.onSuccess = onConnect; + conn_opts.onFailure = onConnectFailure; + conn_opts.context = client; + + printf("finished!\n"); + + MQTTAsync_destroy(&client); + return 0; +} diff --git a/recipes/paho-mqtt-c/all/test_package/test_package_client.c b/recipes/paho-mqtt-c/all/test_package/test_package_client.c new file mode 100644 index 0000000000000..b7c7b88423a11 --- /dev/null +++ b/recipes/paho-mqtt-c/all/test_package/test_package_client.c @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2012, 2017 IBM Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Eclipse Distribution License v1.0 which accompany this distribution. + * + * The Eclipse Public License is available at + * http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Ian Craggs - initial contribution + *******************************************************************************/ + +#include +#include +#include +#include "MQTTClient.h" + +#define CLIENTID "conanpahoc" +#define ADDRESS "tcp://iot.eclipse.org:1883" + +void connlost(void *context, char *cause) +{ + printf("\nConnection lost\n"); + printf(" cause: %s\n", cause); +} + +int main(int argc, char* argv[]) +{ + MQTTClient client; + MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; + int rc; + + printf("Connecting client %s to address %s\n", CLIENTID, ADDRESS); + rc = MQTTClient_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); + if (rc == MQTTCLIENT_SUCCESS) { + conn_opts.keepAliveInterval = 20; + conn_opts.cleansession = 1; + + printf("Set callbacks\n"); + MQTTClient_setCallbacks(client, NULL, connlost, NULL, NULL); + + MQTTClient_destroy(&client); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt b/recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/paho-mqtt-c/all/test_v1_package/conanfile.py b/recipes/paho-mqtt-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d8c4480cdc666 --- /dev/null +++ b/recipes/paho-mqtt-c/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["PAHO_MQTT_C_ASYNC"] = self.options["paho-mqtt-c"].asynchronous + cmake.definitions["PAHO_MQTT_C_WITH_SSL"] = self.options["paho-mqtt-c"].ssl + 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/paho-mqtt-c/config.yml b/recipes/paho-mqtt-c/config.yml new file mode 100644 index 0000000000000..7d5e8aea45866 --- /dev/null +++ b/recipes/paho-mqtt-c/config.yml @@ -0,0 +1,17 @@ +versions: + "1.3.12": + folder: "all" + "1.3.11": + folder: "all" + "1.3.10": + folder: "all" + "1.3.9": + folder: "all" + "1.3.8": + folder: "all" + "1.3.6": + folder: "all" + "1.3.5": + folder: "all" + "1.3.4": + folder: "all" diff --git a/recipes/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml new file mode 100644 index 0000000000000..82fdb49cadc6c --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "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 +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" + patch_type: "conan" + "1.1": + - patch_file: "patches/1.1-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" + patch_type: "conan" diff --git a/recipes/paho-mqtt-cpp/all/conanfile.py b/recipes/paho-mqtt-cpp/all/conanfile.py new file mode 100644 index 0000000000000..a2003509d5dc7 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, rmdir, get +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class PahoMqttCppConan(ConanFile): + name = "paho-mqtt-cpp" + description = "The open-source client implementations of MQTT and MQTT-SN" + license = "EPL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eclipse/paho.mqtt.cpp" + topics = ("mqtt", "iot", "eclipse", "ssl", "paho", "cpp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + 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 + def _min_cppstd(self): + return 11 + + 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") + + 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 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PAHO_BUILD_DOCUMENTATION"] = False + tc.variables["PAHO_BUILD_SAMPLES"] = False + tc.variables["PAHO_BUILD_STATIC"] = not self.options.shared + tc.variables["PAHO_BUILD_SHARED"] = self.options.shared + 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") + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "edl-v10", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "epl-v10", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "notice.html", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + target = "paho-mqttpp3" if self.options.shared else "paho-mqttpp3-static" + self.cpp_info.set_property("cmake_file_name", "PahoMqttCpp") + self.cpp_info.set_property("cmake_target_name", f"PahoMqttCpp::{target}") + # TODO: back to root level once conan v1 support removed + if self.settings.os == "Windows": + self.cpp_info.components["paho-mqttpp"].libs = [target] + else: + self.cpp_info.components["paho-mqttpp"].libs = ["paho-mqttpp3"] + + # TODO: to remove once conan v1 support removed + self.cpp_info.names["cmake_find_package"] = "PahoMqttCpp" + self.cpp_info.names["cmake_find_package_multi"] = "PahoMqttCpp" + self.cpp_info.components["paho-mqttpp"].names["cmake_find_package"] = target + self.cpp_info.components["paho-mqttpp"].names["cmake_find_package_multi"] = target + self.cpp_info.components["paho-mqttpp"].set_property("cmake_target_name", f"PahoMqttCpp::{target}") + self.cpp_info.components["paho-mqttpp"].requires = ["paho-mqtt-c::paho-mqtt-c"] 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 new file mode 100644 index 0000000000000..e22c0033d4b91 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch @@ -0,0 +1,13 @@ +--- 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 new file mode 100644 index 0000000000000..dbcbfa21fd7ce --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch @@ -0,0 +1,26 @@ +--- 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 new file mode 100644 index 0000000000000..4aec911f54ce3 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch @@ -0,0 +1,360 @@ +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.2.0-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..060c0957c43a8 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.2.0-0001-fix-cmake.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -57,7 +57,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 +@@ -73,9 +73,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/test_package/CMakeLists.txt b/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..110f1d17cc392 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C 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() diff --git a/recipes/paho-mqtt-cpp/all/test_package/conanfile.py b/recipes/paho-mqtt-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6b882c937645a --- /dev/null +++ b/recipes/paho-mqtt-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_layout, CMake, CMakeToolchain, CMakeDeps +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "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.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() + + 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/paho-mqtt-cpp/all/test_package/test_package.cpp b/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..79865e445a31c --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include "mqtt/async_client.h" +#include "mqtt/client.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 + + 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 new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py b/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df31aee370d9b --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +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.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() + + 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/paho-mqtt-cpp/config.yml b/recipes/paho-mqtt-cpp/config.yml new file mode 100644 index 0000000000000..e1306dc2a1d9a --- /dev/null +++ b/recipes/paho-mqtt-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.0": + folder: "all" + "1.1": + folder: "all" + "1.0.1": + folder: "all" diff --git a/recipes/pango/all/conandata.yml b/recipes/pango/all/conandata.yml new file mode 100644 index 0000000000000..1d8c33548e913 --- /dev/null +++ b/recipes/pango/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.48.9": + url: "https://github.com/GNOME/pango/archive/1.48.9.tar.gz" + sha256: "6c78162507debd3389dab9f045cfa0b03cb44c432fb21979d4acf45db1b93781" + "1.49.3": + url: "https://github.com/GNOME/pango/archive/1.49.3.tar.gz" + sha256: "2bba081ba680b900a1285d7c9699c0058bf93c3c6b25acaa77214708fb7cb19b" + "1.50.7": + url: "https://github.com/GNOME/pango/archive/1.50.7.tar.gz" + sha256: "4964dc5f1a17464de3c1b91c16a0153429e2f73e81cfdea3229a6370b9ab8e5a" + "1.50.8": + url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.8.tar.xz" + sha256: "cf626f59dd146c023174c4034920e9667f1d25ac2c1569516d63136c311255fa" + "1.50.10": + url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.10.tar.xz" + sha256: "7e5d2f1e40854d24a9a2c4d093bafe75dcdbeccdf1de43e4437332eabed64966" diff --git a/recipes/pango/all/conanfile.py b/recipes/pango/all/conanfile.py new file mode 100644 index 0000000000000..7c23b65c48a80 --- /dev/null +++ b/recipes/pango/all/conanfile.py @@ -0,0 +1,207 @@ +import os +import glob + +from conans import tools, Meson, VisualStudioBuildEnvironment +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools.files import get, replace_in_file, chdir, rmdir, rm, rename +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.51.3" + +class PangoConan(ConanFile): + name = "pango" + license = "LGPL-2.0-and-later" + url = "https://github.com/conan-io/conan-center-index" + description = "Internationalized text layout and rendering library" + homepage = "https://www.pango.org/" + topics = ("conan", "fontconfig", "fonts", "freedesktop") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False], "with_libthai": [True, False], "with_cairo": [True, False], "with_xft": [True, False, "auto"], "with_freetype": [True, False, "auto"], "with_fontconfig": [True, False, "auto"]} + default_options = {"shared": False, "fPIC": True, "with_libthai": False, "with_cairo": True, "with_xft": "auto", "with_freetype": "auto", "with_fontconfig": "auto"} + generators = "pkg_config" + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def validate(self): + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("this recipe does not support GCC before version 5. contributions are welcome") + if self.options.with_xft and not self.settings.os in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("Xft can only be used on Linux and FreeBSD") + + if self.options.with_xft and (not self.options.with_freetype or not self.options.with_fontconfig): + raise ConanInvalidConfiguration("Xft requires freetype and fontconfig") + + if self.options.shared and (not self.options["glib"].shared + or not self.options["harfbuzz"].shared or + (self.options.with_cairo + and not self.options["cairo"].shared)): + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + if self.options.with_xft == "auto": + self.options.with_xft = self.settings.os in ["Linux", "FreeBSD"] + if self.options.with_freetype == "auto": + self.options.with_freetype = not self.settings.os in ["Windows", "Macos"] + if self.options.with_fontconfig == "auto": + self.options.with_fontconfig = not self.settings.os in ["Windows", "Macos"] + if self.options.shared: + self.options["glib"].shared = True + self.options["harfbuzz"].shared = True + if self.options.with_cairo: + self.options["cairo"].shared = True + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + self.build_requires("meson/0.63.2") + + def requirements(self): + if self.options.with_freetype: + self.requires("freetype/2.12.1") + + if self.options.with_fontconfig: + self.requires("fontconfig/2.13.93") + if self.options.with_xft: + self.requires("libxft/2.3.4") + if self.options.with_xft and self.options.with_fontconfig and self.options.with_freetype: + self.requires("xorg/system") # for xorg::xrender + if self.options.with_cairo: + self.requires("cairo/1.17.4") + self.requires("harfbuzz/5.1.0") + self.requires("glib/2.73.3") + self.requires("fribidi/1.0.12") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _configure_meson(self): + defs = {} + defs["introspection"] = "disabled" + + defs["libthai"] = "enabled" if self.options.with_libthai else "disabled" + defs["cairo"] = "enabled" if self.options.with_cairo else "disabled" + defs["xft"] = "enabled" if self.options.with_xft else "disabled" + defs["fontconfig"] = "enabled" if self.options.with_fontconfig else "disabled" + defs["freetype"] = "enabled" if self.options.with_freetype else "disabled" + + meson = Meson(self) + meson.configure(build_folder=self._build_subfolder, source_folder=self._source_subfolder, defs=defs, args=['--wrap-mode=nofallback']) + return meson + + def build(self): + meson_build = os.path.join(self._source_subfolder, "meson.build") + replace_in_file(self, meson_build, "subdir('tests')", "") + replace_in_file(self, meson_build, "subdir('tools')", "") + replace_in_file(self, meson_build, "subdir('utils')", "") + replace_in_file(self, meson_build, "subdir('examples')", "") + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if is_msvc(self) else tools.no_op(): + meson = self._configure_meson() + meson.build() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if is_msvc(self) else tools.no_op(): + meson = self._configure_meson() + meson.install() + if is_msvc(self): + with chdir(self, os.path.join(self.package_folder, "lib")): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info(f"rename {filename_old} into {filename_new}") + rename(self, filename_old, filename_new) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.components['pango_'].libs = ['pango-1.0'] + self.cpp_info.components['pango_'].names['pkg_config'] = 'pango' + if self.settings.os in ["Linux","FreeBSD"]: + self.cpp_info.components['pango_'].system_libs.append("m") + self.cpp_info.components['pango_'].requires.append('glib::glib-2.0') + self.cpp_info.components['pango_'].requires.append('glib::gobject-2.0') + self.cpp_info.components['pango_'].requires.append('glib::gio-2.0') + self.cpp_info.components['pango_'].requires.append('fribidi::fribidi') + self.cpp_info.components['pango_'].requires.append('harfbuzz::harfbuzz') + if self.options.with_fontconfig: + self.cpp_info.components['pango_'].requires.append('fontconfig::fontconfig') + + + if self.options.with_xft: + self.cpp_info.components['pango_'].requires.append('libxft::libxft') + # Pango only uses xrender when Xft, fontconfig and freetype are enabled + if self.options.with_fontconfig and self.options.with_freetype: + self.cpp_info.components['pango_'].requires.append('xorg::xrender') + if self.options.with_cairo: + self.cpp_info.components['pango_'].requires.append('cairo::cairo_') + self.cpp_info.components['pango_'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] + + if self.options.with_freetype: + self.cpp_info.components['pangoft2'].libs = ['pangoft2-1.0'] + self.cpp_info.components['pangoft2'].names['pkg_config'] = 'pangoft2' + self.cpp_info.components['pangoft2'].requires = ['pango_', 'freetype::freetype'] + self.cpp_info.components['pangoft2'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] + + if self.options.with_fontconfig: + self.cpp_info.components['pangofc'].names['pkg_config'] = 'pangofc' + if self.options.with_freetype: + self.cpp_info.components['pangofc'].requires = ['pangoft2'] + + if self.settings.os != "Windows": + self.cpp_info.components['pangoroot'].names['pkg_config'] = 'pangoroot' + if self.options.with_freetype: + self.cpp_info.components['pangoroot'].requires = ['pangoft2'] + + if self.options.with_xft: + self.cpp_info.components['pangoxft'].libs = ['pangoxft-1.0'] + self.cpp_info.components['pangoxft'].names['pkg_config'] = 'pangoxft' + self.cpp_info.components['pangoxft'].requires = ['pango_', 'pangoft2'] + self.cpp_info.components['pangoxft'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] + + if self.settings.os == "Windows": + self.cpp_info.components['pangowin32'].libs = ['pangowin32-1.0'] + self.cpp_info.components['pangowin32'].names['pkg_config'] = 'pangowin32' + self.cpp_info.components['pangowin32'].requires = ['pango_'] + self.cpp_info.components['pangowin32'].system_libs.append('gdi32') + + if self.options.with_cairo: + self.cpp_info.components['pangocairo'].libs = ['pangocairo-1.0'] + self.cpp_info.components['pangocairo'].names['pkg_config'] = 'pangocairo' + self.cpp_info.components['pangocairo'].requires = ['pango_'] + if self.options.with_freetype: + self.cpp_info.components['pangocairo'].requires.append('pangoft2') + if self.settings.os == "Windows": + self.cpp_info.components['pangocairo'].requires.append('pangowin32') + self.cpp_info.components['pangocairo'].system_libs.append('gdi32') + self.cpp_info.components['pangocairo'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] + + self.env_info.PATH.append(os.path.join(self.package_folder, 'bin')) + + def package_id(self): + if not self.options["glib"].shared: + self.info.requires["glib"].full_package_mode() + if not self.options["harfbuzz"].shared: + self.info.requires["harfbuzz"].full_package_mode() + if self.options.with_cairo and not self.options["cairo"].shared: + self.info.requires["cairo"].full_package_mode() diff --git a/recipes/pango/all/test_package/CMakeLists.txt b/recipes/pango/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b2859c25bddd --- /dev/null +++ b/recipes/pango/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(pango) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} pango::pango) diff --git a/recipes/pango/all/test_package/conanfile.py b/recipes/pango/all/test_package/conanfile.py new file mode 100644 index 0000000000000..baecd8fdba2aa --- /dev/null +++ b/recipes/pango/all/test_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", "pkg_config", "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/pango/all/test_package/test_package.cpp b/recipes/pango/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..17022445e9087 --- /dev/null +++ b/recipes/pango/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + std::cout << "pango version: " << pango_version_string() << std::endl; + return 0; +} diff --git a/recipes/pango/config.yml b/recipes/pango/config.yml new file mode 100644 index 0000000000000..40891312baffc --- /dev/null +++ b/recipes/pango/config.yml @@ -0,0 +1,11 @@ +versions: + "1.48.9": + folder: all + "1.49.3": + folder: all + "1.50.7": + folder: all + "1.50.8": + folder: all + "1.50.10": + folder: all diff --git a/recipes/pangomm/all/conandata.yml b/recipes/pangomm/all/conandata.yml new file mode 100644 index 0000000000000..9a20d26f2b3c6 --- /dev/null +++ b/recipes/pangomm/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.50.0": + url: "https://download.gnome.org/sources/pangomm/2.50/pangomm-2.50.0.tar.xz" + sha256: "a27aa77e017b9afce9e751d85bd1cf890abbb3a58bf59d0fac917eef82db3b5b" + "2.46.2": + url: "https://download.gnome.org/sources/pangomm/2.46/pangomm-2.46.2.tar.xz" + sha256: "57442ab4dc043877bfe3839915731ab2d693fc6634a71614422fb530c9eaa6f4" +patches: + "2.50.0": + - patch_file: "patches/enable_static_libs_2_50_0.patch" + base_path: "source_subfolder" + - patch_file: "patches/fix_exporting_pango_init.patch" + base_path: "source_subfolder" + "2.46.2": + - patch_file: "patches/enable_static_libs_2_46_2.patch" + base_path: "source_subfolder" + - patch_file: "patches/fix_exporting_pango_init.patch" + base_path: "source_subfolder" diff --git a/recipes/pangomm/all/conanfile.py b/recipes/pangomm/all/conanfile.py new file mode 100644 index 0000000000000..d7541583cf89d --- /dev/null +++ b/recipes/pangomm/all/conanfile.py @@ -0,0 +1,189 @@ +from conans import ConanFile, Meson, tools +from conan.tools.files import rename +from conan.tools.microsoft import is_msvc +from conans.errors import ConanInvalidConfiguration +import os +import shutil + + +class PangommConan(ConanFile): + name = "pangomm" + homepage = "https://gitlab.gnome.org/GNOME/pangomm" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + description = "pangomm is a C++ API for Pango: a library for layout and rendering of text." + topics = ["pango", "wrapper", "text rendering", "fonts", "freedesktop"] + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + generators = "pkg_config" + exports_sources = "patches/**" + + @property + def _is_2_48_api(self): + return tools.Version(self.version) >= "2.48.0" + + @property + def _is_1_4_api(self): + return tools.Version(self.version) >= "1.4.0" and tools.Version( + self.version) < "2.48.0" + + @property + def _api_version(self): + return "2.48" if self._is_2_48_api else "1.4" + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + + if self.settings.compiler.get_safe("cppstd"): + if self._is_2_48_api: + tools.check_min_cppstd(self, 17) + elif self._is_1_4_api: + tools.check_min_cppstd(self, 11) + + @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 build_requirements(self): + self.build_requires("meson/0.59.1") + self.build_requires("pkgconf/1.7.4") + + def requirements(self): + self.requires("pango/1.50.7") + + # FIXME: temporary fix for dependency versions mismatch + # once dependencies versions are bumped remove these requirements + self.requires("expat/2.4.8") + self.requires("zlib/1.2.12") + self.requires("glib/2.72.1") + + if self._is_2_48_api: + self.requires("glibmm/2.72.1") + self.requires("cairomm/1.16.1") + elif self._is_1_4_api: + self.requires("glibmm/2.66.4") + self.requires("cairomm/1.14.3") + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + strip_root=True, + destination=self._source_subfolder, + ) + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + # glibmm_generate_extra_defs library does not provide any standard way + # for discovery, which is why pangomm uses "find_library" method instead + # of "dependency". this patch adds a hint to where this library is + glibmm_generate_extra_defs_dir = [ + os.path.join(self.deps_cpp_info["glibmm"].rootpath, libdir) for + libdir in self.deps_cpp_info["glibmm"].libdirs] + + tools.replace_in_file( + os.path.join(self._source_subfolder, "tools", + "extra_defs_gen", "meson.build"), + "required: glibmm_dep.type_name() != 'internal',", + f"required: glibmm_dep.type_name() != 'internal', dirs: {glibmm_generate_extra_defs_dir}") + + if is_msvc(self): + # 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 + # conformant! see: + # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 + tools.replace_in_file( + os.path.join(self._source_subfolder, "meson.build"), + "cpp_std=c++", "cpp_std=vc++") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def build(self): + self._patch_sources() + with tools.environment_append(tools.RunEnvironment(self).vars): + meson = self._configure_meson() + meson.build() + + def _configure_meson(self): + meson = Meson(self) + defs = { + "build-documentation": "false", + "msvc14x-parallel-installable": "false", + "default_library": "shared" if self.options.shared else "static", + } + + meson.configure( + defs=defs, + build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + pkg_config_paths=[self.install_folder], + ) + + return meson + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + meson.install() + + shutil.move( + os.path.join(self.package_folder, "lib", + f"pangomm-{self._api_version}", "include", + "pangommconfig.h"), + os.path.join(self.package_folder, "include", + f"pangomm-{self._api_version}", "pangommconfig.h")) + + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir( + os.path.join(self.package_folder, "lib", + "pangomm-{self._api_version}", "include")) + + if is_msvc(self): + tools.remove_files_by_mask( + os.path.join(self.package_folder, "bin"), "*.pdb") + if not self.options.shared: + rename( + self, + os.path.join(self.package_folder, "lib", + f"libpangomm-{self._api_version}.a"), + os.path.join(self.package_folder, "lib", + f"pangomm-{self._api_version}.lib"), + ) + + + def package_info(self): + pangomm_lib = f"pangomm-{self._api_version}" + glibmm_lib = "glibmm::glibmm-2.68" if self._is_2_48_api else "glibmm::glibmm-2.4" + giomm_lib = "glibmm::giomm-2.68" if self._is_2_48_api else "glibmm::giomm-2.4" + cairomm_lib = "cairomm::cairomm-1.16" if self._is_2_48_api else "cairomm::cairomm-1.0" + + self.cpp_info.components[pangomm_lib].names["pkg_config"] = pangomm_lib + self.cpp_info.components[pangomm_lib].libs = [pangomm_lib] + self.cpp_info.components[pangomm_lib].includedirs = [ + os.path.join("include", pangomm_lib) + ] + self.cpp_info.components[pangomm_lib].requires = [ + "pango::pangocairo", glibmm_lib, giomm_lib, cairomm_lib + ] + self.cpp_info.components[pangomm_lib].set_property( + "pkg_config_custom_content", + f"gmmprocm4dir=${{libdir}}/{pangomm_lib}/proc/m4") + + # FIXME: remove once dependency mismatch issues are solved + self.cpp_info.components[pangomm_lib].requires.extend( + ["expat::expat", "zlib::zlib", "glib::glib-2.0"]) diff --git a/recipes/pangomm/all/patches/enable_static_libs_2_46_2.patch b/recipes/pangomm/all/patches/enable_static_libs_2_46_2.patch new file mode 100644 index 0000000000000..a2f63194728a9 --- /dev/null +++ b/recipes/pangomm/all/patches/enable_static_libs_2_46_2.patch @@ -0,0 +1,29 @@ +diff --git a/pango/meson.build b/pango/meson.build +index f2df13e..0d379b7 100644 +--- a/pango/meson.build ++++ b/pango/meson.build +@@ -29,6 +29,10 @@ pkg_conf_data.set('PANGOMM_MAJOR_VERSION', pangomm_major_version) + pkg_conf_data.set('PANGOMM_MINOR_VERSION', pangomm_minor_version) + pkg_conf_data.set('PANGOMM_MICRO_VERSION', pangomm_micro_version) + ++if get_option('default_library') == 'static' ++ pkg_conf_data.set('PANGOMM_STATIC_LIB', 1) ++endif ++ + configure_file( + input: 'pangomm.pc.in', + output: pangomm_pcname + '.pc', +diff --git a/pango/pangommconfig.h.meson b/pango/pangommconfig.h.meson +index 5eb895f..692d58f 100644 +--- a/pango/pangommconfig.h.meson ++++ b/pango/pangommconfig.h.meson +@@ -16,6 +16,9 @@ + /* Micro version number of pangomm. */ + #mesondefine PANGOMM_MICRO_VERSION + ++/* Define if pangomm is built as a static library */ ++#mesondefine PANGOMM_STATIC_LIB ++ + /* Enable DLL-specific stuff only when not building a static library */ + #if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined (_MSC_VER)) && !defined(PANGOMM_STATIC_LIB) && !defined (PANGOMM_USE_GENDEF) + # define PANGOMM_DLL 1 diff --git a/recipes/pangomm/all/patches/enable_static_libs_2_50_0.patch b/recipes/pangomm/all/patches/enable_static_libs_2_50_0.patch new file mode 100644 index 0000000000000..345850fa59bba --- /dev/null +++ b/recipes/pangomm/all/patches/enable_static_libs_2_50_0.patch @@ -0,0 +1,29 @@ +diff --git a/pango/meson.build b/pango/meson.build +index f2df13e..0d379b7 100644 +--- a/pango/meson.build ++++ b/pango/meson.build +@@ -29,6 +29,10 @@ pkg_conf_data.set('PANGOMM_MAJOR_VERSION', pangomm_major_version) + pkg_conf_data.set('PANGOMM_MINOR_VERSION', pangomm_minor_version) + pkg_conf_data.set('PANGOMM_MICRO_VERSION', pangomm_micro_version) + ++if get_option('default_library') == 'static' ++ pkg_conf_data.set('PANGOMM_STATIC_LIB', 1) ++endif ++ + configure_file( + input: 'pangomm.pc.in', + output: pangomm_pcname + '.pc', +diff --git a/pango/pangommconfig.h.meson b/pango/pangommconfig.h.meson +index 58fa4d8..4f5363c 100644 +--- a/pango/pangommconfig.h.meson ++++ b/pango/pangommconfig.h.meson +@@ -16,6 +16,9 @@ + /* Micro version number of pangomm. */ + #mesondefine PANGOMM_MICRO_VERSION + ++/* Define if pangomm is built as a static library */ ++#mesondefine PANGOMM_STATIC_LIB ++ + /* Enable DLL-specific stuff only when not building a static library */ + #if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined (_MSC_VER)) && !defined(PANGOMM_STATIC_LIB) + # define PANGOMM_DLL 1 diff --git a/recipes/pangomm/all/patches/fix_exporting_pango_init.patch b/recipes/pangomm/all/patches/fix_exporting_pango_init.patch new file mode 100644 index 0000000000000..2000c8a97eea2 --- /dev/null +++ b/recipes/pangomm/all/patches/fix_exporting_pango_init.patch @@ -0,0 +1,24 @@ +commit 17ecf1ec0d15089d66b6cec0d01d31e3118e1a8a +Author: Hesham Essam +Date: Mon May 30 18:40:53 2022 +0200 + + Fix exporting Pango::init + + Pangomm does not export the method "Pango::init" (by forgetting to + include the header that adds the export declspec clause), which isn't + really an issue since gtk uses Pango::init_wrap, but let's fix this + all the same since the test I wrote initially uses it (how unlucky to + stumble upon (maybe) the only unexported symbol) + +diff --git a/pango/pangomm/init.cc b/pango/pangomm/init.cc +index 3dc4f2b..2ff927b 100644 +--- a/pango/pangomm/init.cc ++++ b/pango/pangomm/init.cc +@@ -19,6 +19,7 @@ + */ + + #include ++#include + #include + + namespace Pango diff --git a/recipes/pangomm/all/test_package/CMakeLists.txt b/recipes/pangomm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..52162944c94e0 --- /dev/null +++ b/recipes/pangomm/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGET) + +find_package(pangomm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +if (TARGET pangomm::pangomm-2.48) + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + target_link_libraries(${PROJECT_NAME} pangomm::pangomm-2.48) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + target_link_libraries(${PROJECT_NAME} pangomm::pangomm-1.4) +endif() + diff --git a/recipes/pangomm/all/test_package/conanfile.py b/recipes/pangomm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pangomm/all/test_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/pangomm/all/test_package/test_package.cpp b/recipes/pangomm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2250e62128f2b --- /dev/null +++ b/recipes/pangomm/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int +main(int, char**) +{ + Pango::init(); + return 0; +} diff --git a/recipes/pangomm/config.yml b/recipes/pangomm/config.yml new file mode 100644 index 0000000000000..542faba51fd70 --- /dev/null +++ b/recipes/pangomm/config.yml @@ -0,0 +1,5 @@ +versions: + "2.50.0": + folder: all + "2.46.2": + folder: all diff --git a/recipes/panzi-portable-endian/all/conandata.yml b/recipes/panzi-portable-endian/all/conandata.yml new file mode 100644 index 0000000000000..5cba065a6c822 --- /dev/null +++ b/recipes/panzi-portable-endian/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20150416": + url: "https://gist.github.com/panzi/6856583/archive/1eca2ab34f2301b9641aa73d1016b951fff3fc39.zip" + sha256: "488d5d08215f657e769b31764013ef845355832cc6f1d165e1809fa5fe168eeb" diff --git a/recipes/panzi-portable-endian/all/conanfile.py b/recipes/panzi-portable-endian/all/conanfile.py new file mode 100644 index 0000000000000..9c18999c225be --- /dev/null +++ b/recipes/panzi-portable-endian/all/conanfile.py @@ -0,0 +1,34 @@ +import os +from conans import ConanFile, tools + + +class PanziPortableEndian(ConanFile): + name = "panzi-portable-endian" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gist.github.com/panzi/6856583" + description = "This provides the endian conversion functions form endian.h on Windows, Linux, *BSD, and Mac OS X" + topics = ("conan", "endian") + license = "Unlicense" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _extract_license(self): + header = tools.load(os.path.join( + self._source_subfolder, "portable_endian.h")) + license_contents = header[0:(header.find("#ifndef", 1))] + tools.save("LICENSE", license_contents) + + def package(self): + self._extract_license() + self.copy("LICENSE", dst="licenses") + self.copy(pattern="*.h", dst="include", + src=self._source_subfolder, keep_path=False) + + def package_id(self): + self.info.header_only() diff --git a/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt b/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..454c47bb2cbab --- /dev/null +++ b/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/panzi-portable-endian/all/test_package/conanfile.py b/recipes/panzi-portable-endian/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a59a26a52c8dc --- /dev/null +++ b/recipes/panzi-portable-endian/all/test_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" + + 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/panzi-portable-endian/all/test_package/test_package.cpp b/recipes/panzi-portable-endian/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d5884326032ea --- /dev/null +++ b/recipes/panzi-portable-endian/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + uint64_t num = 100; + le64toh(num); +} diff --git a/recipes/panzi-portable-endian/config.yml b/recipes/panzi-portable-endian/config.yml new file mode 100644 index 0000000000000..5b6ed6e7fb074 --- /dev/null +++ b/recipes/panzi-portable-endian/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20150416": + folder: all diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml new file mode 100644 index 0000000000000..e810473c6e2e7 --- /dev/null +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "1.3.11": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.11.tar.gz" + sha256: "0515a681bfb24207013786a7737e9d8561302e656689d8a65ea480bbabab460f" + "1.3.8": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/v1.3.8.tar.gz" + sha256: "c4562ea360dc1dcaddd96a0494c753400364a52c7aa9750de49d8e6a222d28d3" + "1.37": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.37.tar.gz" + sha256: "2ac652be0552fcb53a1163c08c1f28f29f0756594fcc587eebb4d8b363153709" + "1.36": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.36.tar.gz" + sha256: "33acf44158a9661a9d630d13f9250a2aa27a770cb3771df77b1ba1a661c0b766" + "1.35": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.35.tar.gz" + sha256: "308ab6f92e4c6f49304562e352890cf7140de85ce723c097e74fbdec88e0e1ce" + "1.34": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.34.tar.gz" + sha256: "da4939f5948229abe58acc833b111862411d45669310239b8a163bb73d0197aa" + "1.33": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.33.tar.gz" + sha256: "f6e4d0508c4d935fa25dcbaec63fbe0d7503435797e275ec109e8a3f1462a4cd" + "1.32": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.32.tar.gz" + sha256: "50cc7abc08f78c6396a33a334e5bc0b3ade121af8604690dae13a1bad47cf07c" + "1.31": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.31.tar.gz" + sha256: "1826589041140837f91ab0e3421abbf7e9184454bb83403b5a0359a0bf87bd68" + "1.30": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.30.tar.gz" + sha256: "ae14fa41110b5fe211d3f7599318fb1a3e862353c7110cd8370cdc044a98d815" diff --git a/recipes/parallel-hashmap/all/conanfile.py b/recipes/parallel-hashmap/all/conanfile.py new file mode 100644 index 0000000000000..d8dcf1537c358 --- /dev/null +++ b/recipes/parallel-hashmap/all/conanfile.py @@ -0,0 +1,76 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class ParallelHashmapConan(ConanFile): + name = "parallel-hashmap" + description = "A family of header-only, very fast and memory-friendly hashmap and btree containers." + license = "Apache-2.0" + topics = ("parallel-hashmap", "parallel", "hashmap", "btree") + homepage = "https://github.com/greg7mdp/parallel-hashmap" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + 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=os.path.join(self.source_folder, "parallel_hashmap"), + dst=os.path.join(self.package_folder, "include", "parallel_hashmap")) + copy(self, "phmap.natvis", src=self.source_folder, dst=os.path.join(self.source_folder, "res")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"phmap": "phmap::phmap"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "phmap") + self.cpp_info.set_property("cmake_target_name", "phmap") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "phmap" + self.cpp_info.names["cmake_find_package_multi"] = "phmap" + 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/parallel-hashmap/all/test_package/CMakeLists.txt b/recipes/parallel-hashmap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a67b28e572c3c --- /dev/null +++ b/recipes/parallel-hashmap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(phmap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE phmap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/parallel-hashmap/all/test_package/conanfile.py b/recipes/parallel-hashmap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/parallel-hashmap/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/parallel-hashmap/all/test_package/test_package.cpp b/recipes/parallel-hashmap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..db1405a69dfcd --- /dev/null +++ b/recipes/parallel-hashmap/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +#include +#include + +using phmap::flat_hash_map; + +int main() { + // Create an unordered_map of three strings (that map to strings) + flat_hash_map email = { + {"tom", "tom@gmail.com"}, + {"jeff", "jk@gmail.com"}, + {"jim", "jimg@microsoft.com"} + }; + + // Iterate and print keys and values + for (const auto &n : email) { + std::cout << n.first << "'s email is: " << n.second << "\n"; + } + + // Add a new entry + email["bill"] = "bg@whatever.com"; + + // and print it + std::cout << "bill's email is: " << email["bill"] << "\n"; + + return 0; +} diff --git a/recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt b/recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..35b992baf41ca --- /dev/null +++ b/recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(phmap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE phmap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/parallel-hashmap/all/test_v1_package/conanfile.py b/recipes/parallel-hashmap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/parallel-hashmap/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/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml new file mode 100644 index 0000000000000..a8a50d11cadad --- /dev/null +++ b/recipes/parallel-hashmap/config.yml @@ -0,0 +1,21 @@ +versions: + "1.3.11": + folder: all + "1.3.8": + folder: all + "1.37": + folder: all + "1.36": + folder: all + "1.35": + folder: all + "1.34": + folder: all + "1.33": + folder: all + "1.32": + folder: all + "1.31": + folder: all + "1.30": + folder: all diff --git a/recipes/parg/all/CMakeLists.txt b/recipes/parg/all/CMakeLists.txt new file mode 100644 index 0000000000000..ea07630def81d --- /dev/null +++ b/recipes/parg/all/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup() +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory("source_subfolder") + +set_target_properties(parg PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/parg.h") + +install(TARGETS parg) diff --git a/recipes/parg/all/conandata.yml b/recipes/parg/all/conandata.yml new file mode 100644 index 0000000000000..799c3f613ca57 --- /dev/null +++ b/recipes/parg/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/jibsen/parg/archive/refs/tags/v1.0.2.tar.gz" + sha256: "3c728affd1442c5778cf548d53339132ce033c92fd61f7522d1e59fe6b1b36a8" diff --git a/recipes/parg/all/conanfile.py b/recipes/parg/all/conanfile.py new file mode 100644 index 0000000000000..0e70a696cc039 --- /dev/null +++ b/recipes/parg/all/conanfile.py @@ -0,0 +1,60 @@ +import os +from conans import ConanFile, CMake, tools + + +class PargConan(ConanFile): + name = "parg" + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jibsen/parg" + description = "Parser for argv that works similarly to getopt" + topics = ("conan", 'getopt', 'c') + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False]} + default_options = {"shared": False, + "fPIC": True} + exports_sources = ["CMakeLists.txt"] + generators = "cmake", + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @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: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _configure_cmake(self): + if self._cmake: + return self._cmake + cmake = CMake(self) + cmake.configure(build_folder=self._build_subfolder) + self._cmake = cmake + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["parg"] diff --git a/recipes/parg/all/test_package/CMakeLists.txt b/recipes/parg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..187d95623fba1 --- /dev/null +++ b/recipes/parg/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(parg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} parg::parg) diff --git a/recipes/parg/all/test_package/conanfile.py b/recipes/parg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..86f0279553123 --- /dev/null +++ b/recipes/parg/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run("%s -h" % bin_path, run_environment=True) diff --git a/recipes/parg/all/test_package/test_package.c b/recipes/parg/all/test_package/test_package.c new file mode 100644 index 0000000000000..e15a327df25dc --- /dev/null +++ b/recipes/parg/all/test_package/test_package.c @@ -0,0 +1,50 @@ +#include +#include + +#include "parg.h" + +int main(int argc, char *argv[]) +{ + struct parg_state ps; + int c; + + parg_init(&ps); + + while ((c = parg_getopt(&ps, argc, argv, "hs:v")) != -1) { + switch (c) { + case 1: + printf("nonoption '%s'\n", ps.optarg); + break; + case 'h': + printf("Usage: testparg [-h] [-v] [-s STRING]\n"); + return EXIT_SUCCESS; + break; + case 's': + printf("option -s with argument '%s'\n", ps.optarg); + break; + case 'v': + printf("testparg 1.0.0\n"); + return EXIT_SUCCESS; + break; + case '?': + if (ps.optopt == 's') { + printf("option -s requires an argument\n"); + } + else { + printf("unknown option -%c\n", ps.optopt); + } + return EXIT_FAILURE; + break; + default: + printf("error: unhandled option -%c\n", c); + return EXIT_FAILURE; + break; + } + } + + for (c = ps.optind; c < argc; ++c) { + printf("nonoption '%s'\n", argv[c]); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/parg/config.yml b/recipes/parg/config.yml new file mode 100644 index 0000000000000..732f7eb9a62dd --- /dev/null +++ b/recipes/parg/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: "all" diff --git a/recipes/parson/all/conandata.yml b/recipes/parson/all/conandata.yml new file mode 100644 index 0000000000000..a375832975a4d --- /dev/null +++ b/recipes/parson/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/kgabis/parson/archive/a34e72528224fe2a97fa89d8115fedc870df6fd3.tar.gz" + sha256: "ab37b30396e621246d05bdaafb2ab178adb92f5c599f9723cf1c9fbec6a8f037" diff --git a/recipes/parson/all/conanfile.py b/recipes/parson/all/conanfile.py new file mode 100644 index 0000000000000..029c0fb72bae0 --- /dev/null +++ b/recipes/parson/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class ParsonConan(ConanFile): + name = "parson" + description = "Lightweight JSON library written in C." + license = "MIT" + topics = ("json", "parser") + homepage = "https://github.com/kgabis/parson" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "parson") + self.cpp_info.set_property("cmake_target_name", "parson::parson") + self.cpp_info.libs = ["parson"] diff --git a/recipes/parson/all/test_package/CMakeLists.txt b/recipes/parson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b79634dc14200 --- /dev/null +++ b/recipes/parson/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(parson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE parson::parson) diff --git a/recipes/parson/all/test_package/conanfile.py b/recipes/parson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/parson/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/parson/all/test_package/test_package.c b/recipes/parson/all/test_package/test_package.c new file mode 100644 index 0000000000000..3ed5534e94a9d --- /dev/null +++ b/recipes/parson/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include + +int main() { + JSON_Value *root_value = json_value_init_object(); + JSON_Object *root_object = json_value_get_object(root_value); + json_object_set_string(root_object, "name", "John Smith"); + json_object_set_number(root_object, "age", 25); + json_object_dotset_string(root_object, "address.city", "Cupertino"); + json_object_dotset_value(root_object, "contact.emails", json_parse_string("[\"email@example.com\",\"email2@example.com\"]")); + char *serialized_string = json_serialize_to_string_pretty(root_value); + printf("%s\n", serialized_string); + + json_free_serialized_string(serialized_string); + json_value_free(root_value); + + return 0; +} diff --git a/recipes/parson/all/test_v1_package/CMakeLists.txt b/recipes/parson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/parson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/parson/all/test_v1_package/conanfile.py b/recipes/parson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/parson/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/parson/config.yml b/recipes/parson/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/parson/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/patchelf/all/conandata.yml b/recipes/patchelf/all/conandata.yml new file mode 100644 index 0000000000000..9385c94daf7b2 --- /dev/null +++ b/recipes/patchelf/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.13": + url: "https://github.com/NixOS/patchelf/archive/0.13.tar.gz" + sha256: "60c6aeadb673de9cc1838b630c81f61e31c501de324ef7f1e8094a2431197d09" + "0.12": + url: "https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz" + sha256: "3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56" diff --git a/recipes/patchelf/all/conanfile.py b/recipes/patchelf/all/conanfile.py new file mode 100644 index 0000000000000..904e2cf4472db --- /dev/null +++ b/recipes/patchelf/all/conanfile.py @@ -0,0 +1,74 @@ +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 VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.54.0" + +class PatchElfConan(ConanFile): + name = "patchelf" + package_type = "application" + description = "A small utility to modify the dynamic linker and RPATH of ELF executables" + topics = ("conan", "elf", "linker", "interpreter", "RPATH", "binaries") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/NixOS/patchelf" + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("libtool/2.4.6") + + def validate(self): + if not is_apple_os(self) and self.settings.os not in ("FreeBSD", "Linux"): + raise ConanInvalidConfiguration("PatchELF is only available for GNU-like operating systems (e.g. Linux)") + + 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) + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_id(self): + del self.info.settings.compiler + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + 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/patchelf/all/test_package/conanfile.py b/recipes/patchelf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4af4d75258f3f --- /dev/null +++ b/recipes/patchelf/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", "compiler", "build_type", "arch" + 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("patchelf --version") diff --git a/recipes/patchelf/all/test_v1_package/conanfile.py b/recipes/patchelf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7effccfd4383a --- /dev/null +++ b/recipes/patchelf/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, CMake, tools + + +class TestPackageV1Conan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("patchelf --version", run_environment=True) diff --git a/recipes/patchelf/config.yml b/recipes/patchelf/config.yml new file mode 100644 index 0000000000000..0782807cb46ce --- /dev/null +++ b/recipes/patchelf/config.yml @@ -0,0 +1,5 @@ +versions: + "0.13": + folder: all + "0.12": + folder: all diff --git a/recipes/pbc/all/conandata.yml b/recipes/pbc/all/conandata.yml new file mode 100644 index 0000000000000..af6c41c5d370b --- /dev/null +++ b/recipes/pbc/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.5.14": + url: "https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz" + sha256: "772527404117587560080241cedaf441e5cac3269009cdde4c588a1dce4c23d2" +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 new file mode 100644 index 0000000000000..cef849369307b --- /dev/null +++ b/recipes/pbc/all/conanfile.py @@ -0,0 +1,98 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +import os + +required_conan_version = ">=1.33.0" + + +class PbcConan(ConanFile): + name = "pbc" + topics = ("pbc", "crypto", "cryptography", "security", "pairings", "cryptographic") + 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." + + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + _autotools = None + exports_sources = "patches/**" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("gmp/6.2.1") + + def build_requirements(self): + self.build_requires("bison/3.7.6") + self.build_requires("flex/2.6.4") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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"]) + + # 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" + ): + + xcr = tools.XCRun(self.settings) + target = tools.to_apple_arch(self.settings.arch) + "-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 + ) + ) + + self._autotools.configure(args=args) + return self._autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + autotools = self._configure_autotools() + 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") + + def package_info(self): + self.cpp_info.libs = ["pbc"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] diff --git a/recipes/pbc/all/patches/0.5.14-0001-fix-config-sub-ios.patch b/recipes/pbc/all/patches/0.5.14-0001-fix-config-sub-ios.patch new file mode 100644 index 0000000000000..7acab4a41cb9c --- /dev/null +++ b/recipes/pbc/all/patches/0.5.14-0001-fix-config-sub-ios.patch @@ -0,0 +1,3128 @@ +--- config.sub.org 2013-06-15 11:43:04.000000000 +0800 ++++ config.sub 2022-04-20 15:27:08.000000000 +0800 +@@ -1,36 +1,33 @@ + #! /bin/sh + # Configuration validation subroutine script. +-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +-# 2011, 2012 Free Software Foundation, Inc. +- +-timestamp='2012-02-10' +- +-# This file is (in principle) common to ALL GNU software. +-# The presence of a machine in this file suggests that SOME GNU software +-# can handle that machine. It does not imply ALL GNU software can. +-# +-# This file 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 ++# Copyright 1992-2022 Free Software Foundation, Inc. ++ ++# shellcheck disable=SC2006,SC2268 # see below for rationale ++ ++timestamp='2022-01-03' ++ ++# This file 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 3 of the License, or + # (at your option) any later version. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, see . ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). + + +-# Please send patches to . Submit a context +-# diff and a properly formatted GNU ChangeLog entry. ++# Please send patches to . + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. +@@ -38,7 +35,7 @@ + # Otherwise, we print the canonical config type on stdout and succeed. + + # You can get the latest version of this script from: +-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD ++# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases +@@ -55,15 +52,21 @@ + # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + # It is wrong to echo any other type of specification. + ++# The "shellcheck disable" line above the timestamp inhibits complaints ++# about features and limitations of the classic Bourne shell that were ++# superseded or lifted in POSIX. However, this script identifies a wide ++# variety of pre-POSIX systems that do not have POSIX shells at all, and ++# even some reasonably current systems (Solaris 10 as case-in-point) still ++# have a pre-POSIX /bin/sh. ++ + me=`echo "$0" | sed -e 's,.*/,,'` + + usage="\ +-Usage: $0 [OPTION] CPU-MFR-OPSYS +- $0 [OPTION] ALIAS ++Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + + Canonicalize a configuration name. + +-Operation modes: ++Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit +@@ -73,9 +76,7 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +-Free Software Foundation, Inc. ++Copyright 1992-2022 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -97,12 +98,12 @@ + - ) # Use stdin as input. + break ;; + -* ) +- echo "$me: invalid option $1$help" ++ echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. +- echo $1 ++ echo "$1" + exit ;; + + * ) +@@ -118,1190 +119,1186 @@ + exit 1;; + esac + +-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +-# Here we must recognize all the valid KERNEL-OS combinations. +-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +-case $maybe_os in +- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ +- knetbsd*-gnu* | netbsd*-gnu* | \ +- kopensolaris*-gnu* | \ +- storm-chaos* | os2-emx* | rtmk-nova*) +- os=-$maybe_os +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` +- ;; +- android-linux) +- os=-linux-android +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown +- ;; +- *) +- basic_machine=`echo $1 | sed 's/-[^-]*$//'` +- if [ $basic_machine != $1 ] +- then os=`echo $1 | sed 's/.*-/-/'` +- else os=; fi +- ;; +-esac +- +-### Let's recognize common machines as not being operating systems so +-### that things like config.sub decstation-3100 work. We also +-### recognize some manufacturers as not being operating systems, so we +-### can provide default operating systems below. +-case $os in +- -sun*os*) +- # Prevent following clause from handling this invalid input. +- ;; +- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ +- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ +- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ +- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ +- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ +- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis | -knuth | -cray | -microblaze) +- os= +- basic_machine=$1 +- ;; +- -bluegene*) +- os=-cnk +- ;; +- -sim | -cisco | -oki | -wec | -winbond) +- os= +- basic_machine=$1 +- ;; +- -scout) +- ;; +- -wrs) +- os=-vxworks +- basic_machine=$1 +- ;; +- -chorusos*) +- os=-chorusos +- basic_machine=$1 +- ;; +- -chorusrdb) +- os=-chorusrdb +- basic_machine=$1 +- ;; +- -hiux*) +- os=-hiuxwe2 +- ;; +- -sco6) +- os=-sco5v6 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5) +- os=-sco3.2v5 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco4) +- os=-sco3.2v4 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2.[4-9]*) +- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2v[4-9]*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5v6*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco*) +- os=-sco3.2v2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -udk*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -isc) +- os=-isc2.2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -clix*) +- basic_machine=clipper-intergraph +- ;; +- -isc*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -lynx*) +- os=-lynxos ++# Split fields of configuration type ++# shellcheck disable=SC2162 ++saved_IFS=$IFS ++IFS="-" read field1 field2 field3 field4 <&2 ++ exit 1 + ;; +- -ptx*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ++ *-*-*-*) ++ basic_machine=$field1-$field2 ++ basic_os=$field3-$field4 + ;; +- -windowsnt*) +- os=`echo $os | sed -e 's/windowsnt/winnt/'` ++ *-*-*) ++ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two ++ # parts ++ maybe_os=$field2-$field3 ++ case $maybe_os in ++ nto-qnx* | linux-* | uclinux-uclibc* \ ++ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ ++ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ ++ | storm-chaos* | os2-emx* | rtmk-nova*) ++ basic_machine=$field1 ++ basic_os=$maybe_os ++ ;; ++ android-linux) ++ basic_machine=$field1-unknown ++ basic_os=linux-android ++ ;; ++ *) ++ basic_machine=$field1-$field2 ++ basic_os=$field3 ++ ;; ++ esac + ;; +- -psos*) +- os=-psos ++ *-*) ++ # A lone config we happen to match not fitting any pattern ++ case $field1-$field2 in ++ decstation-3100) ++ basic_machine=mips-dec ++ basic_os= ++ ;; ++ *-*) ++ # Second component is usually, but not always the OS ++ case $field2 in ++ # Prevent following clause from handling this valid os ++ sun*os*) ++ basic_machine=$field1 ++ basic_os=$field2 ++ ;; ++ zephyr*) ++ basic_machine=$field1-unknown ++ basic_os=$field2 ++ ;; ++ # Manufacturers ++ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ ++ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ ++ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ ++ | convergent* | ncr* | news | 32* | 3600* | 3100* \ ++ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ ++ | ultra | tti* | harris | dolphin | highlevel | gould \ ++ | cbm | ns | masscomp | apple | axis | knuth | cray \ ++ | microblaze* | sim | cisco \ ++ | oki | wec | wrs | winbond) ++ basic_machine=$field1-$field2 ++ basic_os= ++ ;; ++ *) ++ basic_machine=$field1 ++ basic_os=$field2 ++ ;; ++ esac ++ ;; ++ esac + ;; +- -mint | -mint[0-9]*) +- basic_machine=m68k-atari +- os=-mint ++ *) ++ # Convert single-component short-hands not valid as part of ++ # multi-component configurations. ++ case $field1 in ++ 386bsd) ++ basic_machine=i386-pc ++ basic_os=bsd ++ ;; ++ a29khif) ++ basic_machine=a29k-amd ++ basic_os=udi ++ ;; ++ adobe68k) ++ basic_machine=m68010-adobe ++ basic_os=scout ++ ;; ++ alliant) ++ basic_machine=fx80-alliant ++ basic_os= ++ ;; ++ altos | altos3068) ++ basic_machine=m68k-altos ++ basic_os= ++ ;; ++ am29k) ++ basic_machine=a29k-none ++ basic_os=bsd ++ ;; ++ amdahl) ++ basic_machine=580-amdahl ++ basic_os=sysv ++ ;; ++ amiga) ++ basic_machine=m68k-unknown ++ basic_os= ++ ;; ++ amigaos | amigados) ++ basic_machine=m68k-unknown ++ basic_os=amigaos ++ ;; ++ amigaunix | amix) ++ basic_machine=m68k-unknown ++ basic_os=sysv4 ++ ;; ++ apollo68) ++ basic_machine=m68k-apollo ++ basic_os=sysv ++ ;; ++ apollo68bsd) ++ basic_machine=m68k-apollo ++ basic_os=bsd ++ ;; ++ aros) ++ basic_machine=i386-pc ++ basic_os=aros ++ ;; ++ aux) ++ basic_machine=m68k-apple ++ basic_os=aux ++ ;; ++ balance) ++ basic_machine=ns32k-sequent ++ basic_os=dynix ++ ;; ++ blackfin) ++ basic_machine=bfin-unknown ++ basic_os=linux ++ ;; ++ cegcc) ++ basic_machine=arm-unknown ++ basic_os=cegcc ++ ;; ++ convex-c1) ++ basic_machine=c1-convex ++ basic_os=bsd ++ ;; ++ convex-c2) ++ basic_machine=c2-convex ++ basic_os=bsd ++ ;; ++ convex-c32) ++ basic_machine=c32-convex ++ basic_os=bsd ++ ;; ++ convex-c34) ++ basic_machine=c34-convex ++ basic_os=bsd ++ ;; ++ convex-c38) ++ basic_machine=c38-convex ++ basic_os=bsd ++ ;; ++ cray) ++ basic_machine=j90-cray ++ basic_os=unicos ++ ;; ++ crds | unos) ++ basic_machine=m68k-crds ++ basic_os= ++ ;; ++ da30) ++ basic_machine=m68k-da30 ++ basic_os= ++ ;; ++ decstation | pmax | pmin | dec3100 | decstatn) ++ basic_machine=mips-dec ++ basic_os= ++ ;; ++ delta88) ++ basic_machine=m88k-motorola ++ basic_os=sysv3 ++ ;; ++ dicos) ++ basic_machine=i686-pc ++ basic_os=dicos ++ ;; ++ djgpp) ++ basic_machine=i586-pc ++ basic_os=msdosdjgpp ++ ;; ++ ebmon29k) ++ basic_machine=a29k-amd ++ basic_os=ebmon ++ ;; ++ es1800 | OSE68k | ose68k | ose | OSE) ++ basic_machine=m68k-ericsson ++ basic_os=ose ++ ;; ++ gmicro) ++ basic_machine=tron-gmicro ++ basic_os=sysv ++ ;; ++ go32) ++ basic_machine=i386-pc ++ basic_os=go32 ++ ;; ++ h8300hms) ++ basic_machine=h8300-hitachi ++ basic_os=hms ++ ;; ++ h8300xray) ++ basic_machine=h8300-hitachi ++ basic_os=xray ++ ;; ++ h8500hms) ++ basic_machine=h8500-hitachi ++ basic_os=hms ++ ;; ++ harris) ++ basic_machine=m88k-harris ++ basic_os=sysv3 ++ ;; ++ hp300 | hp300hpux) ++ basic_machine=m68k-hp ++ basic_os=hpux ++ ;; ++ hp300bsd) ++ basic_machine=m68k-hp ++ basic_os=bsd ++ ;; ++ hppaosf) ++ basic_machine=hppa1.1-hp ++ basic_os=osf ++ ;; ++ hppro) ++ basic_machine=hppa1.1-hp ++ basic_os=proelf ++ ;; ++ i386mach) ++ basic_machine=i386-mach ++ basic_os=mach ++ ;; ++ isi68 | isi) ++ basic_machine=m68k-isi ++ basic_os=sysv ++ ;; ++ m68knommu) ++ basic_machine=m68k-unknown ++ basic_os=linux ++ ;; ++ magnum | m3230) ++ basic_machine=mips-mips ++ basic_os=sysv ++ ;; ++ merlin) ++ basic_machine=ns32k-utek ++ basic_os=sysv ++ ;; ++ mingw64) ++ basic_machine=x86_64-pc ++ basic_os=mingw64 ++ ;; ++ mingw32) ++ basic_machine=i686-pc ++ basic_os=mingw32 ++ ;; ++ mingw32ce) ++ basic_machine=arm-unknown ++ basic_os=mingw32ce ++ ;; ++ monitor) ++ basic_machine=m68k-rom68k ++ basic_os=coff ++ ;; ++ morphos) ++ basic_machine=powerpc-unknown ++ basic_os=morphos ++ ;; ++ moxiebox) ++ basic_machine=moxie-unknown ++ basic_os=moxiebox ++ ;; ++ msdos) ++ basic_machine=i386-pc ++ basic_os=msdos ++ ;; ++ msys) ++ basic_machine=i686-pc ++ basic_os=msys ++ ;; ++ mvs) ++ basic_machine=i370-ibm ++ basic_os=mvs ++ ;; ++ nacl) ++ basic_machine=le32-unknown ++ basic_os=nacl ++ ;; ++ ncr3000) ++ basic_machine=i486-ncr ++ basic_os=sysv4 ++ ;; ++ netbsd386) ++ basic_machine=i386-pc ++ basic_os=netbsd ++ ;; ++ netwinder) ++ basic_machine=armv4l-rebel ++ basic_os=linux ++ ;; ++ news | news700 | news800 | news900) ++ basic_machine=m68k-sony ++ basic_os=newsos ++ ;; ++ news1000) ++ basic_machine=m68030-sony ++ basic_os=newsos ++ ;; ++ necv70) ++ basic_machine=v70-nec ++ basic_os=sysv ++ ;; ++ nh3000) ++ basic_machine=m68k-harris ++ basic_os=cxux ++ ;; ++ nh[45]000) ++ basic_machine=m88k-harris ++ basic_os=cxux ++ ;; ++ nindy960) ++ basic_machine=i960-intel ++ basic_os=nindy ++ ;; ++ mon960) ++ basic_machine=i960-intel ++ basic_os=mon960 ++ ;; ++ nonstopux) ++ basic_machine=mips-compaq ++ basic_os=nonstopux ++ ;; ++ os400) ++ basic_machine=powerpc-ibm ++ basic_os=os400 ++ ;; ++ OSE68000 | ose68000) ++ basic_machine=m68000-ericsson ++ basic_os=ose ++ ;; ++ os68k) ++ basic_machine=m68k-none ++ basic_os=os68k ++ ;; ++ paragon) ++ basic_machine=i860-intel ++ basic_os=osf ++ ;; ++ parisc) ++ basic_machine=hppa-unknown ++ basic_os=linux ++ ;; ++ psp) ++ basic_machine=mipsallegrexel-sony ++ basic_os=psp ++ ;; ++ pw32) ++ basic_machine=i586-unknown ++ basic_os=pw32 ++ ;; ++ rdos | rdos64) ++ basic_machine=x86_64-pc ++ basic_os=rdos ++ ;; ++ rdos32) ++ basic_machine=i386-pc ++ basic_os=rdos ++ ;; ++ rom68k) ++ basic_machine=m68k-rom68k ++ basic_os=coff ++ ;; ++ sa29200) ++ basic_machine=a29k-amd ++ basic_os=udi ++ ;; ++ sei) ++ basic_machine=mips-sei ++ basic_os=seiux ++ ;; ++ sequent) ++ basic_machine=i386-sequent ++ basic_os= ++ ;; ++ sps7) ++ basic_machine=m68k-bull ++ basic_os=sysv2 ++ ;; ++ st2000) ++ basic_machine=m68k-tandem ++ basic_os= ++ ;; ++ stratus) ++ basic_machine=i860-stratus ++ basic_os=sysv4 ++ ;; ++ sun2) ++ basic_machine=m68000-sun ++ basic_os= ++ ;; ++ sun2os3) ++ basic_machine=m68000-sun ++ basic_os=sunos3 ++ ;; ++ sun2os4) ++ basic_machine=m68000-sun ++ basic_os=sunos4 ++ ;; ++ sun3) ++ basic_machine=m68k-sun ++ basic_os= ++ ;; ++ sun3os3) ++ basic_machine=m68k-sun ++ basic_os=sunos3 ++ ;; ++ sun3os4) ++ basic_machine=m68k-sun ++ basic_os=sunos4 ++ ;; ++ sun4) ++ basic_machine=sparc-sun ++ basic_os= ++ ;; ++ sun4os3) ++ basic_machine=sparc-sun ++ basic_os=sunos3 ++ ;; ++ sun4os4) ++ basic_machine=sparc-sun ++ basic_os=sunos4 ++ ;; ++ sun4sol2) ++ basic_machine=sparc-sun ++ basic_os=solaris2 ++ ;; ++ sun386 | sun386i | roadrunner) ++ basic_machine=i386-sun ++ basic_os= ++ ;; ++ sv1) ++ basic_machine=sv1-cray ++ basic_os=unicos ++ ;; ++ symmetry) ++ basic_machine=i386-sequent ++ basic_os=dynix ++ ;; ++ t3e) ++ basic_machine=alphaev5-cray ++ basic_os=unicos ++ ;; ++ t90) ++ basic_machine=t90-cray ++ basic_os=unicos ++ ;; ++ toad1) ++ basic_machine=pdp10-xkl ++ basic_os=tops20 ++ ;; ++ tpf) ++ basic_machine=s390x-ibm ++ basic_os=tpf ++ ;; ++ udi29k) ++ basic_machine=a29k-amd ++ basic_os=udi ++ ;; ++ ultra3) ++ basic_machine=a29k-nyu ++ basic_os=sym1 ++ ;; ++ v810 | necv810) ++ basic_machine=v810-nec ++ basic_os=none ++ ;; ++ vaxv) ++ basic_machine=vax-dec ++ basic_os=sysv ++ ;; ++ vms) ++ basic_machine=vax-dec ++ basic_os=vms ++ ;; ++ vsta) ++ basic_machine=i386-pc ++ basic_os=vsta ++ ;; ++ vxworks960) ++ basic_machine=i960-wrs ++ basic_os=vxworks ++ ;; ++ vxworks68) ++ basic_machine=m68k-wrs ++ basic_os=vxworks ++ ;; ++ vxworks29k) ++ basic_machine=a29k-wrs ++ basic_os=vxworks ++ ;; ++ xbox) ++ basic_machine=i686-pc ++ basic_os=mingw32 ++ ;; ++ ymp) ++ basic_machine=ymp-cray ++ basic_os=unicos ++ ;; ++ *) ++ basic_machine=$1 ++ basic_os= ++ ;; ++ esac + ;; + esac + +-# Decode aliases for certain CPU-COMPANY combinations. ++# Decode 1-component or ad-hoc basic machines + case $basic_machine in +- # Recognize the basic CPU types without company name. +- # Some are omitted here because they have special meanings below. +- 1750a | 580 \ +- | a29k \ +- | aarch64 | aarch64_be \ +- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ +- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | am33_2.0 \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ +- | be32 | be64 \ +- | bfin \ +- | c4x | clipper \ +- | d10v | d30v | dlx | dsp16xx \ +- | epiphany \ +- | fido | fr30 | frv \ +- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ +- | hexagon \ +- | i370 | i860 | i960 | ia64 \ +- | ip2k | iq2000 \ +- | le32 | le64 \ +- | lm32 \ +- | m32c | m32r | m32rle | m68000 | m68k | m88k \ +- | maxq | mb | microblaze | mcore | mep | metag \ +- | mips | mipsbe | mipseb | mipsel | mipsle \ +- | mips16 \ +- | mips64 | mips64el \ +- | mips64octeon | mips64octeonel \ +- | mips64orion | mips64orionel \ +- | mips64r5900 | mips64r5900el \ +- | mips64vr | mips64vrel \ +- | mips64vr4100 | mips64vr4100el \ +- | mips64vr4300 | mips64vr4300el \ +- | mips64vr5000 | mips64vr5000el \ +- | mips64vr5900 | mips64vr5900el \ +- | mipsisa32 | mipsisa32el \ +- | mipsisa32r2 | mipsisa32r2el \ +- | mipsisa64 | mipsisa64el \ +- | mipsisa64r2 | mipsisa64r2el \ +- | mipsisa64sb1 | mipsisa64sb1el \ +- | mipsisa64sr71k | mipsisa64sr71kel \ +- | mipstx39 | mipstx39el \ +- | mn10200 | mn10300 \ +- | moxie \ +- | mt \ +- | msp430 \ +- | nds32 | nds32le | nds32be \ +- | nios | nios2 \ +- | ns16k | ns32k \ +- | open8 \ +- | or32 \ +- | pdp10 | pdp11 | pj | pjl \ +- | powerpc | powerpc64 | powerpc64le | powerpcle \ +- | pyramid \ +- | rl78 | rx \ +- | score \ +- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ +- | sh64 | sh64le \ +- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ +- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ +- | spu \ +- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ +- | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ +- | we32k \ +- | x86 | xc16x | xstormy16 | xtensa \ +- | z8k | z80) +- basic_machine=$basic_machine-unknown +- ;; +- c54x) +- basic_machine=tic54x-unknown +- ;; +- c55x) +- basic_machine=tic55x-unknown +- ;; +- c6x) +- basic_machine=tic6x-unknown +- ;; +- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) +- ;; +- ms1) +- basic_machine=mt-unknown +- ;; +- +- strongarm | thumb | xscale) +- basic_machine=arm-unknown +- ;; +- xgate) +- basic_machine=$basic_machine-unknown +- os=-none ++ # Here we handle the default manufacturer of certain CPU types. It is in ++ # some cases the only manufacturer, in others, it is the most popular. ++ w89k) ++ cpu=hppa1.1 ++ vendor=winbond + ;; +- xscaleeb) +- basic_machine=armeb-unknown ++ op50n) ++ cpu=hppa1.1 ++ vendor=oki + ;; +- +- xscaleel) +- basic_machine=armel-unknown ++ op60c) ++ cpu=hppa1.1 ++ vendor=oki + ;; +- +- # We use `pc' rather than `unknown' +- # because (1) that's what they normally are, and +- # (2) the word "unknown" tends to confuse beginning users. +- i*86 | x86_64) +- basic_machine=$basic_machine-pc +- ;; +- # Object if more than one company name word. +- *-*-*) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 +- exit 1 ++ ibm*) ++ cpu=i370 ++ vendor=ibm ++ ;; ++ orion105) ++ cpu=clipper ++ vendor=highlevel + ;; +- # Recognize the basic CPU types with company name. +- 580-* \ +- | a29k-* \ +- | aarch64-* | aarch64_be-* \ +- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ +- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ +- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ +- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* | avr32-* \ +- | be32-* | be64-* \ +- | bfin-* | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* \ +- | clipper-* | craynv-* | cydra-* \ +- | d10v-* | d30v-* | dlx-* \ +- | elxsi-* \ +- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ +- | h8300-* | h8500-* \ +- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ +- | hexagon-* \ +- | i*86-* | i860-* | i960-* | ia64-* \ +- | ip2k-* | iq2000-* \ +- | le32-* | le64-* \ +- | lm32-* \ +- | m32c-* | m32r-* | m32rle-* \ +- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ +- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ +- | mips16-* \ +- | mips64-* | mips64el-* \ +- | mips64octeon-* | mips64octeonel-* \ +- | mips64orion-* | mips64orionel-* \ +- | mips64r5900-* | mips64r5900el-* \ +- | mips64vr-* | mips64vrel-* \ +- | mips64vr4100-* | mips64vr4100el-* \ +- | mips64vr4300-* | mips64vr4300el-* \ +- | mips64vr5000-* | mips64vr5000el-* \ +- | mips64vr5900-* | mips64vr5900el-* \ +- | mipsisa32-* | mipsisa32el-* \ +- | mipsisa32r2-* | mipsisa32r2el-* \ +- | mipsisa64-* | mipsisa64el-* \ +- | mipsisa64r2-* | mipsisa64r2el-* \ +- | mipsisa64sb1-* | mipsisa64sb1el-* \ +- | mipsisa64sr71k-* | mipsisa64sr71kel-* \ +- | mipstx39-* | mipstx39el-* \ +- | mmix-* \ +- | mt-* \ +- | msp430-* \ +- | nds32-* | nds32le-* | nds32be-* \ +- | nios-* | nios2-* \ +- | none-* | np1-* | ns16k-* | ns32k-* \ +- | open8-* \ +- | orion-* \ +- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ +- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ +- | pyramid-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ +- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ +- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ +- | sparclite-* \ +- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ +- | tahoe-* \ +- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ +- | tron-* \ +- | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ +- | we32k-* \ +- | x86-* | x86_64-* | xc16x-* | xps100-* \ +- | xstormy16-* | xtensa*-* \ +- | ymp-* \ +- | z8k-* | z80-*) +- ;; +- # Recognize the basic CPU types without company name, with glob match. +- xtensa*) +- basic_machine=$basic_machine-unknown ++ mac | mpw | mac-mpw) ++ cpu=m68k ++ vendor=apple + ;; ++ pmac | pmac-mpw) ++ cpu=powerpc ++ vendor=apple ++ ;; ++ + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. +- 386bsd) +- basic_machine=i386-unknown +- os=-bsd +- ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) +- basic_machine=m68000-att ++ cpu=m68000 ++ vendor=att + ;; + 3b*) +- basic_machine=we32k-att +- ;; +- a29khif) +- basic_machine=a29k-amd +- os=-udi +- ;; +- abacus) +- basic_machine=abacus-unknown +- ;; +- adobe68k) +- basic_machine=m68010-adobe +- os=-scout +- ;; +- alliant | fx80) +- basic_machine=fx80-alliant +- ;; +- altos | altos3068) +- basic_machine=m68k-altos +- ;; +- am29k) +- basic_machine=a29k-none +- os=-bsd +- ;; +- amd64) +- basic_machine=x86_64-pc +- ;; +- amd64-*) +- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- amdahl) +- basic_machine=580-amdahl +- os=-sysv +- ;; +- amiga | amiga-*) +- basic_machine=m68k-unknown +- ;; +- amigaos | amigados) +- basic_machine=m68k-unknown +- os=-amigaos +- ;; +- amigaunix | amix) +- basic_machine=m68k-unknown +- os=-sysv4 +- ;; +- apollo68) +- basic_machine=m68k-apollo +- os=-sysv +- ;; +- apollo68bsd) +- basic_machine=m68k-apollo +- os=-bsd +- ;; +- aros) +- basic_machine=i386-pc +- os=-aros +- ;; +- aux) +- basic_machine=m68k-apple +- os=-aux +- ;; +- balance) +- basic_machine=ns32k-sequent +- os=-dynix +- ;; +- blackfin) +- basic_machine=bfin-unknown +- os=-linux +- ;; +- blackfin-*) +- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux ++ cpu=we32k ++ vendor=att + ;; + bluegene*) +- basic_machine=powerpc-ibm +- os=-cnk +- ;; +- c54x-*) +- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c55x-*) +- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c6x-*) +- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c90) +- basic_machine=c90-cray +- os=-unicos +- ;; +- cegcc) +- basic_machine=arm-unknown +- os=-cegcc +- ;; +- convex-c1) +- basic_machine=c1-convex +- os=-bsd +- ;; +- convex-c2) +- basic_machine=c2-convex +- os=-bsd +- ;; +- convex-c32) +- basic_machine=c32-convex +- os=-bsd +- ;; +- convex-c34) +- basic_machine=c34-convex +- os=-bsd +- ;; +- convex-c38) +- basic_machine=c38-convex +- os=-bsd +- ;; +- cray | j90) +- basic_machine=j90-cray +- os=-unicos +- ;; +- craynv) +- basic_machine=craynv-cray +- os=-unicosmp +- ;; +- cr16 | cr16-*) +- basic_machine=cr16-unknown +- os=-elf +- ;; +- crds | unos) +- basic_machine=m68k-crds +- ;; +- crisv32 | crisv32-* | etraxfs*) +- basic_machine=crisv32-axis +- ;; +- cris | cris-* | etrax*) +- basic_machine=cris-axis +- ;; +- crx) +- basic_machine=crx-unknown +- os=-elf +- ;; +- da30 | da30-*) +- basic_machine=m68k-da30 +- ;; +- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) +- basic_machine=mips-dec ++ cpu=powerpc ++ vendor=ibm ++ basic_os=cnk + ;; + decsystem10* | dec10*) +- basic_machine=pdp10-dec +- os=-tops10 ++ cpu=pdp10 ++ vendor=dec ++ basic_os=tops10 + ;; + decsystem20* | dec20*) +- basic_machine=pdp10-dec +- os=-tops20 ++ cpu=pdp10 ++ vendor=dec ++ basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) +- basic_machine=m68k-motorola ++ cpu=m68k ++ vendor=motorola + ;; +- delta88) +- basic_machine=m88k-motorola +- os=-sysv3 +- ;; +- dicos) +- basic_machine=i686-pc +- os=-dicos +- ;; +- djgpp) +- basic_machine=i586-pc +- os=-msdosdjgpp +- ;; +- dpx20 | dpx20-*) +- basic_machine=rs6000-bull +- os=-bosx +- ;; +- dpx2* | dpx2*-bull) +- basic_machine=m68k-bull +- os=-sysv3 +- ;; +- ebmon29k) +- basic_machine=a29k-amd +- os=-ebmon +- ;; +- elxsi) +- basic_machine=elxsi-elxsi +- os=-bsd ++ dpx2*) ++ cpu=m68k ++ vendor=bull ++ basic_os=sysv3 + ;; + encore | umax | mmax) +- basic_machine=ns32k-encore ++ cpu=ns32k ++ vendor=encore + ;; +- es1800 | OSE68k | ose68k | ose | OSE) +- basic_machine=m68k-ericsson +- os=-ose ++ elxsi) ++ cpu=elxsi ++ vendor=elxsi ++ basic_os=${basic_os:-bsd} + ;; + fx2800) +- basic_machine=i860-alliant ++ cpu=i860 ++ vendor=alliant + ;; + genix) +- basic_machine=ns32k-ns +- ;; +- gmicro) +- basic_machine=tron-gmicro +- os=-sysv +- ;; +- go32) +- basic_machine=i386-pc +- os=-go32 ++ cpu=ns32k ++ vendor=ns + ;; + h3050r* | hiux*) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 +- ;; +- h8300hms) +- basic_machine=h8300-hitachi +- os=-hms +- ;; +- h8300xray) +- basic_machine=h8300-hitachi +- os=-xray +- ;; +- h8500hms) +- basic_machine=h8500-hitachi +- os=-hms +- ;; +- harris) +- basic_machine=m88k-harris +- os=-sysv3 +- ;; +- hp300-*) +- basic_machine=m68k-hp +- ;; +- hp300bsd) +- basic_machine=m68k-hp +- os=-bsd +- ;; +- hp300hpux) +- basic_machine=m68k-hp +- os=-hpux ++ cpu=hppa1.1 ++ vendor=hitachi ++ basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) +- basic_machine=hppa1.0-hp ++ cpu=hppa1.0 ++ vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) +- basic_machine=m68000-hp ++ cpu=m68000 ++ vendor=hp + ;; + hp9k3[2-9][0-9]) +- basic_machine=m68k-hp ++ cpu=m68k ++ vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) +- basic_machine=hppa1.0-hp ++ cpu=hppa1.0 ++ vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hppa-next) +- os=-nextstep3 +- ;; +- hppaosf) +- basic_machine=hppa1.1-hp +- os=-osf +- ;; +- hppro) +- basic_machine=hppa1.1-hp +- os=-proelf +- ;; +- i370-ibm* | ibm*) +- basic_machine=i370-ibm ++ cpu=hppa1.0 ++ vendor=hp + ;; + i*86v32) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv32 ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=sysv32 + ;; + i*86v4*) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv4 ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=sysv4 + ;; + i*86v) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=sysv + ;; + i*86sol2) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-solaris2 +- ;; +- i386mach) +- basic_machine=i386-mach +- os=-mach +- ;; +- i386-vsta | vsta) +- basic_machine=i386-unknown +- os=-vsta ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=solaris2 ++ ;; ++ j90 | j90-cray) ++ cpu=j90 ++ vendor=cray ++ basic_os=${basic_os:-unicos} + ;; + iris | iris4d) +- basic_machine=mips-sgi +- case $os in +- -irix*) ++ cpu=mips ++ vendor=sgi ++ case $basic_os in ++ irix*) + ;; + *) +- os=-irix4 ++ basic_os=irix4 + ;; + esac + ;; +- isi68 | isi) +- basic_machine=m68k-isi +- os=-sysv +- ;; +- m68knommu) +- basic_machine=m68k-unknown +- os=-linux +- ;; +- m68knommu-*) +- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- m88k-omron*) +- basic_machine=m88k-omron +- ;; +- magnum | m3230) +- basic_machine=mips-mips +- os=-sysv +- ;; +- merlin) +- basic_machine=ns32k-utek +- os=-sysv +- ;; +- microblaze) +- basic_machine=microblaze-xilinx +- ;; +- mingw32) +- basic_machine=i386-pc +- os=-mingw32 +- ;; +- mingw32ce) +- basic_machine=arm-unknown +- os=-mingw32ce +- ;; + miniframe) +- basic_machine=m68000-convergent +- ;; +- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) +- basic_machine=m68k-atari +- os=-mint +- ;; +- mips3*-*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ++ cpu=m68000 ++ vendor=convergent + ;; +- mips3*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown +- ;; +- monitor) +- basic_machine=m68k-rom68k +- os=-coff +- ;; +- morphos) +- basic_machine=powerpc-unknown +- os=-morphos +- ;; +- msdos) +- basic_machine=i386-pc +- os=-msdos +- ;; +- ms1-*) +- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` +- ;; +- msys) +- basic_machine=i386-pc +- os=-msys +- ;; +- mvs) +- basic_machine=i370-ibm +- os=-mvs +- ;; +- nacl) +- basic_machine=le32-unknown +- os=-nacl +- ;; +- ncr3000) +- basic_machine=i486-ncr +- os=-sysv4 +- ;; +- netbsd386) +- basic_machine=i386-unknown +- os=-netbsd +- ;; +- netwinder) +- basic_machine=armv4l-rebel +- os=-linux +- ;; +- news | news700 | news800 | news900) +- basic_machine=m68k-sony +- os=-newsos +- ;; +- news1000) +- basic_machine=m68030-sony +- os=-newsos ++ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) ++ cpu=m68k ++ vendor=atari ++ basic_os=mint + ;; + news-3600 | risc-news) +- basic_machine=mips-sony +- os=-newsos +- ;; +- necv70) +- basic_machine=v70-nec +- os=-sysv +- ;; +- next | m*-next ) +- basic_machine=m68k-next +- case $os in +- -nextstep* ) ++ cpu=mips ++ vendor=sony ++ basic_os=newsos ++ ;; ++ next | m*-next) ++ cpu=m68k ++ vendor=next ++ case $basic_os in ++ openstep*) ++ ;; ++ nextstep*) + ;; +- -ns2*) +- os=-nextstep2 ++ ns2*) ++ basic_os=nextstep2 + ;; + *) +- os=-nextstep3 ++ basic_os=nextstep3 + ;; + esac + ;; +- nh3000) +- basic_machine=m68k-harris +- os=-cxux +- ;; +- nh[45]000) +- basic_machine=m88k-harris +- os=-cxux +- ;; +- nindy960) +- basic_machine=i960-intel +- os=-nindy +- ;; +- mon960) +- basic_machine=i960-intel +- os=-mon960 +- ;; +- nonstopux) +- basic_machine=mips-compaq +- os=-nonstopux +- ;; + np1) +- basic_machine=np1-gould +- ;; +- neo-tandem) +- basic_machine=neo-tandem +- ;; +- nse-tandem) +- basic_machine=nse-tandem +- ;; +- nsr-tandem) +- basic_machine=nsr-tandem ++ cpu=np1 ++ vendor=gould + ;; + op50n-* | op60c-*) +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- openrisc | openrisc-*) +- basic_machine=or32-unknown +- ;; +- os400) +- basic_machine=powerpc-ibm +- os=-os400 +- ;; +- OSE68000 | ose68000) +- basic_machine=m68000-ericsson +- os=-ose +- ;; +- os68k) +- basic_machine=m68k-none +- os=-os68k ++ cpu=hppa1.1 ++ vendor=oki ++ basic_os=proelf + ;; + pa-hitachi) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 +- ;; +- paragon) +- basic_machine=i860-intel +- os=-osf +- ;; +- parisc) +- basic_machine=hppa-unknown +- os=-linux +- ;; +- parisc-*) +- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux ++ cpu=hppa1.1 ++ vendor=hitachi ++ basic_os=hiuxwe2 + ;; + pbd) +- basic_machine=sparc-tti ++ cpu=sparc ++ vendor=tti + ;; + pbb) +- basic_machine=m68k-tti ++ cpu=m68k ++ vendor=tti + ;; +- pc532 | pc532-*) +- basic_machine=ns32k-pc532 ++ pc532) ++ cpu=ns32k ++ vendor=pc532 + ;; +- pc98) +- basic_machine=i386-pc +- ;; +- pc98-*) +- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium | p5 | k5 | k6 | nexgen | viac3) +- basic_machine=i586-pc +- ;; +- pentiumpro | p6 | 6x86 | athlon | athlon_*) +- basic_machine=i686-pc +- ;; +- pentiumii | pentium2 | pentiumiii | pentium3) +- basic_machine=i686-pc +- ;; +- pentium4) +- basic_machine=i786-pc +- ;; +- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) +- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ++ pn) ++ cpu=pn ++ vendor=gould + ;; +- pentiumpro-* | p6-* | 6x86-* | athlon-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ++ power) ++ cpu=power ++ vendor=ibm + ;; +- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ps2) ++ cpu=i386 ++ vendor=ibm + ;; +- pentium4-*) +- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ++ rm[46]00) ++ cpu=mips ++ vendor=siemens + ;; +- pn) +- basic_machine=pn-gould ++ rtpc | rtpc-*) ++ cpu=romp ++ vendor=ibm + ;; +- power) basic_machine=power-ibm ++ sde) ++ cpu=mipsisa32 ++ vendor=sde ++ basic_os=${basic_os:-elf} ++ ;; ++ simso-wrs) ++ cpu=sparclite ++ vendor=wrs ++ basic_os=vxworks + ;; +- ppc | ppcbe) basic_machine=powerpc-unknown ++ tower | tower-32) ++ cpu=m68k ++ vendor=ncr + ;; +- ppc-* | ppcbe-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ++ vpp*|vx|vx-*) ++ cpu=f301 ++ vendor=fujitsu + ;; +- ppcle | powerpclittle | ppc-le | powerpc-little) +- basic_machine=powerpcle-unknown ++ w65) ++ cpu=w65 ++ vendor=wdc + ;; +- ppcle-* | powerpclittle-*) +- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ++ w89k-*) ++ cpu=hppa1.1 ++ vendor=winbond ++ basic_os=proelf + ;; +- ppc64) basic_machine=powerpc64-unknown ++ none) ++ cpu=none ++ vendor=none + ;; +- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ leon|leon[3-9]) ++ cpu=sparc ++ vendor=$basic_machine ++ ;; ++ leon-*|leon[3-9]-*) ++ cpu=sparc ++ vendor=`echo "$basic_machine" | sed 's/-.*//'` ++ ;; ++ ++ *-*) ++ # shellcheck disable=SC2162 ++ saved_IFS=$IFS ++ IFS="-" read cpu vendor <&2 +- exit 1 ++ # Recognize the canonical CPU types that are allowed with any ++ # company name. ++ case $cpu in ++ 1750a | 580 \ ++ | a29k \ ++ | aarch64 | aarch64_be \ ++ | abacus \ ++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ ++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ ++ | alphapca5[67] | alpha64pca5[67] \ ++ | am33_2.0 \ ++ | amdgcn \ ++ | arc | arceb | arc32 | arc64 \ ++ | arm | arm[lb]e | arme[lb] | armv* \ ++ | avr | avr32 \ ++ | asmjs \ ++ | ba \ ++ | be32 | be64 \ ++ | bfin | bpf | bs2000 \ ++ | c[123]* | c30 | [cjt]90 | c4x \ ++ | c8051 | clipper | craynv | csky | cydra \ ++ | d10v | d30v | dlx | dsp16xx \ ++ | e2k | elxsi | epiphany \ ++ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ ++ | h8300 | h8500 \ ++ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ ++ | hexagon \ ++ | i370 | i*86 | i860 | i960 | ia16 | ia64 \ ++ | ip2k | iq2000 \ ++ | k1om \ ++ | le32 | le64 \ ++ | lm32 \ ++ | loongarch32 | loongarch64 | loongarchx32 \ ++ | m32c | m32r | m32rle \ ++ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ ++ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ ++ | m88110 | m88k | maxq | mb | mcore | mep | metag \ ++ | microblaze | microblazeel \ ++ | mips | mipsbe | mipseb | mipsel | mipsle \ ++ | mips16 \ ++ | mips64 | mips64eb | mips64el \ ++ | mips64octeon | mips64octeonel \ ++ | mips64orion | mips64orionel \ ++ | mips64r5900 | mips64r5900el \ ++ | mips64vr | mips64vrel \ ++ | mips64vr4100 | mips64vr4100el \ ++ | mips64vr4300 | mips64vr4300el \ ++ | mips64vr5000 | mips64vr5000el \ ++ | mips64vr5900 | mips64vr5900el \ ++ | mipsisa32 | mipsisa32el \ ++ | mipsisa32r2 | mipsisa32r2el \ ++ | mipsisa32r3 | mipsisa32r3el \ ++ | mipsisa32r5 | mipsisa32r5el \ ++ | mipsisa32r6 | mipsisa32r6el \ ++ | mipsisa64 | mipsisa64el \ ++ | mipsisa64r2 | mipsisa64r2el \ ++ | mipsisa64r3 | mipsisa64r3el \ ++ | mipsisa64r5 | mipsisa64r5el \ ++ | mipsisa64r6 | mipsisa64r6el \ ++ | mipsisa64sb1 | mipsisa64sb1el \ ++ | mipsisa64sr71k | mipsisa64sr71kel \ ++ | mipsr5900 | mipsr5900el \ ++ | mipstx39 | mipstx39el \ ++ | mmix \ ++ | mn10200 | mn10300 \ ++ | moxie \ ++ | mt \ ++ | msp430 \ ++ | nds32 | nds32le | nds32be \ ++ | nfp \ ++ | nios | nios2 | nios2eb | nios2el \ ++ | none | np1 | ns16k | ns32k | nvptx \ ++ | open8 \ ++ | or1k* \ ++ | or32 \ ++ | orion \ ++ | picochip \ ++ | pdp10 | pdp11 | pj | pjl | pn | power \ ++ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ ++ | pru \ ++ | pyramid \ ++ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ ++ | rl78 | romp | rs6000 | rx \ ++ | s390 | s390x \ ++ | score \ ++ | sh | shl \ ++ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ ++ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ ++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ ++ | sparclite \ ++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ ++ | spu \ ++ | tahoe \ ++ | thumbv7* \ ++ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ ++ | tron \ ++ | ubicom32 \ ++ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ ++ | vax \ ++ | visium \ ++ | w65 \ ++ | wasm32 | wasm64 \ ++ | we32k \ ++ | x86 | x86_64 | xc16x | xgate | xps100 \ ++ | xstormy16 | xtensa* \ ++ | ymp \ ++ | z8k | z80) ++ ;; ++ ++ *) ++ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 ++ exit 1 ++ ;; ++ esac + ;; + esac + + # Here we canonicalize certain aliases for manufacturers. +-case $basic_machine in +- *-digital*) +- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ++case $vendor in ++ digital*) ++ vendor=dec + ;; +- *-commodore*) +- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ++ commodore*) ++ vendor=cbm + ;; + *) + ;; +@@ -1309,203 +1306,215 @@ + + # Decode manufacturer-specific aliases for certain operating systems. + +-if [ x"$os" != x"" ] ++if test x$basic_os != x + then +-case $os in +- # First match some system type aliases +- # that might get confused with valid system types. +- # -solaris* is a basic system type, with this one exception. +- -auroraux) +- os=-auroraux ++ ++# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just ++# set os. ++case $basic_os in ++ gnu/linux*) ++ kernel=linux ++ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ++ ;; ++ os2-emx) ++ kernel=os2 ++ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ++ ;; ++ nto-qnx*) ++ kernel=nto ++ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ++ ;; ++ *-*) ++ # shellcheck disable=SC2162 ++ saved_IFS=$IFS ++ IFS="-" read kernel os <&2 +- exit 1 ++ # No normalization, but not necessarily accepted, that comes below. + ;; + esac ++ + else + + # Here we handle the default operating systems that come with various machines. +@@ -1518,255 +1527,363 @@ + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + +-case $basic_machine in ++kernel= ++case $cpu-$vendor in + score-*) +- os=-elf ++ os=elf + ;; + spu-*) +- os=-elf ++ os=elf + ;; + *-acorn) +- os=-riscix1.2 ++ os=riscix1.2 + ;; + arm*-rebel) +- os=-linux ++ kernel=linux ++ os=gnu + ;; + arm*-semi) +- os=-aout ++ os=aout + ;; + c4x-* | tic4x-*) +- os=-coff ++ os=coff ++ ;; ++ c8051-*) ++ os=elf ++ ;; ++ clipper-intergraph) ++ os=clix ++ ;; ++ hexagon-*) ++ os=elf + ;; + tic54x-*) +- os=-coff ++ os=coff + ;; + tic55x-*) +- os=-coff ++ os=coff + ;; + tic6x-*) +- os=-coff ++ os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) +- os=-tops20 ++ os=tops20 + ;; + pdp11-*) +- os=-none ++ os=none + ;; + *-dec | vax-*) +- os=-ultrix4.2 ++ os=ultrix4.2 + ;; + m68*-apollo) +- os=-domain ++ os=domain + ;; + i386-sun) +- os=-sunos4.0.2 ++ os=sunos4.0.2 + ;; + m68000-sun) +- os=-sunos3 ++ os=sunos3 + ;; + m68*-cisco) +- os=-aout ++ os=aout + ;; + mep-*) +- os=-elf ++ os=elf + ;; + mips*-cisco) +- os=-elf ++ os=elf + ;; + mips*-*) +- os=-elf ++ os=elf + ;; + or32-*) +- os=-coff ++ os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. +- os=-sysv3 ++ os=sysv3 + ;; + sparc-* | *-sun) +- os=-sunos4.1.1 ++ os=sunos4.1.1 + ;; +- *-be) +- os=-beos ++ pru-*) ++ os=elf + ;; +- *-haiku) +- os=-haiku ++ *-be) ++ os=beos + ;; + *-ibm) +- os=-aix ++ os=aix + ;; + *-knuth) +- os=-mmixware ++ os=mmixware + ;; + *-wec) +- os=-proelf ++ os=proelf + ;; + *-winbond) +- os=-proelf ++ os=proelf + ;; + *-oki) +- os=-proelf ++ os=proelf + ;; + *-hp) +- os=-hpux ++ os=hpux + ;; + *-hitachi) +- os=-hiux ++ os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) +- os=-sysv ++ os=sysv + ;; + *-cbm) +- os=-amigaos ++ os=amigaos + ;; + *-dg) +- os=-dgux ++ os=dgux + ;; + *-dolphin) +- os=-sysv3 ++ os=sysv3 + ;; + m68k-ccur) +- os=-rtu ++ os=rtu + ;; + m88k-omron*) +- os=-luna ++ os=luna + ;; +- *-next ) +- os=-nextstep ++ *-next) ++ os=nextstep + ;; + *-sequent) +- os=-ptx ++ os=ptx + ;; + *-crds) +- os=-unos ++ os=unos + ;; + *-ns) +- os=-genix ++ os=genix + ;; + i370-*) +- os=-mvs +- ;; +- *-next) +- os=-nextstep3 ++ os=mvs + ;; + *-gould) +- os=-sysv ++ os=sysv + ;; + *-highlevel) +- os=-bsd ++ os=bsd + ;; + *-encore) +- os=-bsd ++ os=bsd + ;; + *-sgi) +- os=-irix ++ os=irix + ;; + *-siemens) +- os=-sysv4 ++ os=sysv4 + ;; + *-masscomp) +- os=-rtu ++ os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) +- os=-uxpv ++ os=uxpv + ;; + *-rom68k) +- os=-coff ++ os=coff + ;; + *-*bug) +- os=-coff ++ os=coff + ;; + *-apple) +- os=-macos ++ os=macos + ;; + *-atari*) +- os=-mint ++ os=mint ++ ;; ++ *-wrs) ++ os=vxworks + ;; + *) +- os=-none ++ os=none + ;; + esac ++ + fi + ++# Now, validate our (potentially fixed-up) OS. ++case $os in ++ # Sometimes we do "kernel-libc", so those need to count as OSes. ++ musl* | newlib* | relibc* | uclibc*) ++ ;; ++ # Likewise for "kernel-abi" ++ eabi* | gnueabi*) ++ ;; ++ # VxWorks passes extra cpu info in the 4th filed. ++ simlinux | simwindows | spe) ++ ;; ++ # Now accept the basic system types. ++ # The portable systems comes first. ++ # Each alternative MUST end in a * to match a version number. ++ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ ++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ ++ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ ++ | hiux* | abug | nacl* | netware* | windows* \ ++ | os9* | macos* | osx* | ios* \ ++ | mpw* | magic* | mmixware* | mon960* | lnews* \ ++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ ++ | aos* | aros* | cloudabi* | sortix* | twizzler* \ ++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ ++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ ++ | mirbsd* | netbsd* | dicos* | openedition* | ose* \ ++ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ ++ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ ++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ ++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ ++ | udi* | lites* | ieee* | go32* | aux* | hcos* \ ++ | chorusrdb* | cegcc* | glidix* | serenity* \ ++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ ++ | midipix* | mingw32* | mingw64* | mint* \ ++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ ++ | interix* | uwin* | mks* | rhapsody* | darwin* \ ++ | openstep* | oskit* | conix* | pw32* | nonstopux* \ ++ | storm-chaos* | tops10* | tenex* | tops20* | its* \ ++ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ ++ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ ++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ ++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ ++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ ++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ ++ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ ++ | fiwix* ) ++ ;; ++ # This one is extra strict with allowed versions ++ sco3.2v2 | sco3.2v[4-9]* | sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ ;; ++ none) ++ ;; ++ *) ++ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 ++ exit 1 ++ ;; ++esac ++ ++# As a final step for OS-related things, validate the OS-kernel combination ++# (given a valid OS), if there is a kernel. ++case $kernel-$os in ++ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ ++ | linux-musl* | linux-relibc* | linux-uclibc* ) ++ ;; ++ uclinux-uclibc* ) ++ ;; ++ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) ++ # These are just libc implementations, not actual OSes, and thus ++ # require a kernel. ++ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 ++ exit 1 ++ ;; ++ kfreebsd*-gnu* | kopensolaris*-gnu*) ++ ;; ++ vxworks-simlinux | vxworks-simwindows | vxworks-spe) ++ ;; ++ nto-qnx*) ++ ;; ++ os2-emx) ++ ;; ++ *-eabi* | *-gnueabi*) ++ ;; ++ -*) ++ # Blank kernel with real OS is always fine. ++ ;; ++ *-*) ++ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 ++ exit 1 ++ ;; ++esac ++ + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. +-vendor=unknown +-case $basic_machine in +- *-unknown) +- case $os in +- -riscix*) ++case $vendor in ++ unknown) ++ case $cpu-$os in ++ *-riscix*) + vendor=acorn + ;; +- -sunos*) ++ *-sunos*) + vendor=sun + ;; +- -cnk*|-aix*) ++ *-cnk* | *-aix*) + vendor=ibm + ;; +- -beos*) ++ *-beos*) + vendor=be + ;; +- -hpux*) ++ *-hpux*) + vendor=hp + ;; +- -mpeix*) ++ *-mpeix*) + vendor=hp + ;; +- -hiux*) ++ *-hiux*) + vendor=hitachi + ;; +- -unos*) ++ *-unos*) + vendor=crds + ;; +- -dgux*) ++ *-dgux*) + vendor=dg + ;; +- -luna*) ++ *-luna*) + vendor=omron + ;; +- -genix*) ++ *-genix*) + vendor=ns + ;; +- -mvs* | -opened*) ++ *-clix*) ++ vendor=intergraph ++ ;; ++ *-mvs* | *-opened*) ++ vendor=ibm ++ ;; ++ *-os400*) + vendor=ibm + ;; +- -os400*) ++ s390-* | s390x-*) + vendor=ibm + ;; +- -ptx*) ++ *-ptx*) + vendor=sequent + ;; +- -tpf*) ++ *-tpf*) + vendor=ibm + ;; +- -vxsim* | -vxworks* | -windiss*) ++ *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; +- -aux*) ++ *-aux*) + vendor=apple + ;; +- -hms*) ++ *-hms*) + vendor=hitachi + ;; +- -mpw* | -macos*) ++ *-mpw* | *-macos*) + vendor=apple + ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; +- -vos*) ++ *-vos*) + vendor=stratus + ;; + esac +- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + +-echo $basic_machine$os ++echo "$cpu-$vendor-${kernel:+$kernel-}$os" + exit + + # Local variables: +-# eval: (add-hook 'write-file-hooks 'time-stamp) ++# eval: (add-hook 'before-save-hook 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" diff --git a/recipes/pbc/all/test_package/CMakeLists.txt b/recipes/pbc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c67cb318985e8 --- /dev/null +++ b/recipes/pbc/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pbc CONFIG REQUIRED) + +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 new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/pbc/all/test_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/pbc/all/test_package/test_package.c b/recipes/pbc/all/test_package/test_package.c new file mode 100644 index 0000000000000..e7f56ec58433c --- /dev/null +++ b/recipes/pbc/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#include + +#include +#include + +#define TYPE_A "type a\n" \ +"q 8780710799663312522437781984754049815806883199414208211028653399266475630880222957078625179422662221423155858769582317459277713367317481324925129998224791\n" \ +"h 12016012264891146079388821366740534204802954401251311822919615131047207289359704531102844802183906537786776\n" \ +"r 730750818665451621361119245571504901405976559617\n" \ +"exp2 159\n" \ +"exp1 107\n" \ +"sign1 1\n" \ +"sign0 1\n" \ + +int main (void) { + pairing_t pairing; + pairing_init_set_buf(pairing, TYPE_A, sizeof(TYPE_A)); + + element_t g, g2, h, h2, a, gt1, gt2; + element_init_G1(g, pairing); + element_init_G1(g2, pairing); + element_init_G2(h, pairing); + element_init_G2(h2, pairing); + element_init_Zr(a, pairing); + element_init_GT(gt1, pairing); + element_init_GT(gt2, pairing); + + element_from_hash(g, "FEDCBA9876", 10); + element_from_hash(h, "0123456789", 10); + element_pow_zn(g2, g, a); + element_pow_zn(h2, h, a); + pairing_apply(gt1, g, h2, pairing); + pairing_apply(gt2, g2, h, pairing); + + return element_cmp(gt1, gt2); +} diff --git a/recipes/pbc/config.yml b/recipes/pbc/config.yml new file mode 100644 index 0000000000000..7b14e37d57121 --- /dev/null +++ b/recipes/pbc/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.14": + folder: all diff --git a/recipes/pbtools/all/CMakeLists.txt b/recipes/pbtools/all/CMakeLists.txt new file mode 100644 index 0000000000000..432799d5aaab2 --- /dev/null +++ b/recipes/pbtools/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder/lib) diff --git a/recipes/pbtools/all/conandata.yml b/recipes/pbtools/all/conandata.yml new file mode 100644 index 0000000000000..529d052902f81 --- /dev/null +++ b/recipes/pbtools/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.45.2": + url: "https://github.com/eerimoq/pbtools/archive/0.45.2.tar.gz" + sha256: "723967fff6e1d51a078ce7328f937cafe0c32b4e9ab19735cf591d15afc281d3" + "0.45.0": + url: "https://github.com/eerimoq/pbtools/archive/refs/tags/0.45.0.zip" + sha256: 84b17003f1c7b6c62061e93e11abe8729480338f5f106948ebfefa303c163b75 diff --git a/recipes/pbtools/all/conanfile.py b/recipes/pbtools/all/conanfile.py new file mode 100644 index 0000000000000..9aee2f753fe6d --- /dev/null +++ b/recipes/pbtools/all/conanfile.py @@ -0,0 +1,54 @@ +import functools +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class PbtoolsConan(ConanFile): + name = "pbtools" + description = "A Google Protocol Buffers C library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eerimoq/pbtools" + license = "MIT" + topics = ("protobuf", "serialization", "rpc", "protocol-buffers") + settings = ("os", "compiler", "build_type", "arch") + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + exports_sources = "CMakeLists.txt" + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("This library is not compatible with Windows") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["pbtools"] diff --git a/recipes/pbtools/all/test_package/CMakeLists.txt b/recipes/pbtools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9f0ff5e7f11af --- /dev/null +++ b/recipes/pbtools/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pbtools REQUIRED CONFIG) + +add_executable(test_package test_package.c hello_world.c) +target_link_libraries(test_package pbtools::pbtools) diff --git a/recipes/pbtools/all/test_package/conanfile.py b/recipes/pbtools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1ed584307b354 --- /dev/null +++ b/recipes/pbtools/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os + +from conans import ConanFile, CMake, tools + + +class PbtoolsTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + self.build_requires("cmake/3.20.1") + + def 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/pbtools/all/test_package/hello_world.c b/recipes/pbtools/all/test_package/hello_world.c new file mode 100644 index 0000000000000..e3685d3182886 --- /dev/null +++ b/recipes/pbtools/all/test_package/hello_world.c @@ -0,0 +1,134 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 Erik Moqvist + * + * 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 file was generated by pbtools. + */ + +#include +#include "hello_world.h" + +#if CHAR_BIT != 8 +# error "Number of bits in a char must be 8." +#endif + +void hello_world_foo_init( + struct hello_world_foo_t *self_p, + struct pbtools_heap_t *heap_p) +{ + self_p->base.heap_p = heap_p; + self_p->bar = 0; +} + +void hello_world_foo_encode_inner( + struct pbtools_encoder_t *encoder_p, + struct hello_world_foo_t *self_p) +{ + pbtools_encoder_write_int32(encoder_p, 1, self_p->bar); +} + +void hello_world_foo_decode_inner( + struct pbtools_decoder_t *decoder_p, + struct hello_world_foo_t *self_p) +{ + int wire_type; + + while (pbtools_decoder_available(decoder_p)) { + switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) { + + case 1: + self_p->bar = pbtools_decoder_read_int32(decoder_p, wire_type); + break; + + default: + pbtools_decoder_skip_field(decoder_p, wire_type); + break; + } + } +} + +void hello_world_foo_encode_repeated_inner( + struct pbtools_encoder_t *encoder_p, + int field_number, + struct hello_world_foo_repeated_t *repeated_p) +{ + pbtools_encode_repeated_inner( + encoder_p, + field_number, + (struct pbtools_repeated_message_t *)repeated_p, + sizeof(struct hello_world_foo_t), + (pbtools_message_encode_inner_t)hello_world_foo_encode_inner); +} + +void hello_world_foo_decode_repeated_inner( + struct pbtools_decoder_t *decoder_p, + struct pbtools_repeated_info_t *repeated_info_p, + struct hello_world_foo_repeated_t *repeated_p) +{ + pbtools_decode_repeated_inner( + decoder_p, + repeated_info_p, + (struct pbtools_repeated_message_t *)repeated_p, + sizeof(struct hello_world_foo_t), + (pbtools_message_init_t)hello_world_foo_init, + (pbtools_message_decode_inner_t)hello_world_foo_decode_inner); +} + +struct hello_world_foo_t * +hello_world_foo_new( + void *workspace_p, + size_t size) +{ + return (pbtools_message_new( + workspace_p, + size, + sizeof(struct hello_world_foo_t), + (pbtools_message_init_t)hello_world_foo_init)); +} + +int hello_world_foo_encode( + struct hello_world_foo_t *self_p, + uint8_t *encoded_p, + size_t size) +{ + return (pbtools_message_encode( + &self_p->base, + encoded_p, + size, + (pbtools_message_encode_inner_t)hello_world_foo_encode_inner)); +} + +int hello_world_foo_decode( + struct hello_world_foo_t *self_p, + const uint8_t *encoded_p, + size_t size) +{ + return (pbtools_message_decode( + &self_p->base, + encoded_p, + size, + (pbtools_message_decode_inner_t)hello_world_foo_decode_inner)); +} diff --git a/recipes/pbtools/all/test_package/hello_world.h b/recipes/pbtools/all/test_package/hello_world.h new file mode 100644 index 0000000000000..60df4f878b4ba --- /dev/null +++ b/recipes/pbtools/all/test_package/hello_world.h @@ -0,0 +1,99 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 Erik Moqvist + * + * 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 file was generated by pbtools. + */ + +#ifndef HELLO_WORLD_H +#define HELLO_WORLD_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "pbtools.h" + +/** + * Message hello_world.Foo. + */ +struct hello_world_foo_repeated_t { + int length; + struct hello_world_foo_t *items_p; +}; + +struct hello_world_foo_t { + struct pbtools_message_base_t base; + int32_t bar; +}; + +/** + * Encoding and decoding of hello_world.Foo. + */ +struct hello_world_foo_t * +hello_world_foo_new( + void *workspace_p, + size_t size); + +int hello_world_foo_encode( + struct hello_world_foo_t *self_p, + uint8_t *encoded_p, + size_t size); + +int hello_world_foo_decode( + struct hello_world_foo_t *self_p, + const uint8_t *encoded_p, + size_t size); + +/* Internal functions. Do not use! */ + +void hello_world_foo_init( + struct hello_world_foo_t *self_p, + struct pbtools_heap_t *heap_p); + +void hello_world_foo_encode_inner( + struct pbtools_encoder_t *encoder_p, + struct hello_world_foo_t *self_p); + +void hello_world_foo_decode_inner( + struct pbtools_decoder_t *decoder_p, + struct hello_world_foo_t *self_p); + +void hello_world_foo_encode_repeated_inner( + struct pbtools_encoder_t *encoder_p, + int field_number, + struct hello_world_foo_repeated_t *repeated_p); + +void hello_world_foo_decode_repeated_inner( + struct pbtools_decoder_t *decoder_p, + struct pbtools_repeated_info_t *repeated_info_p, + struct hello_world_foo_repeated_t *repeated_p); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/recipes/pbtools/all/test_package/test_package.c b/recipes/pbtools/all/test_package/test_package.c new file mode 100644 index 0000000000000..6e5658143a23a --- /dev/null +++ b/recipes/pbtools/all/test_package/test_package.c @@ -0,0 +1,45 @@ +#include +#include +#include "hello_world.h" + +int main(int argc, const char *argv[]) +{ + int size; + uint8_t workspace[64]; + uint8_t encoded[16]; + struct hello_world_foo_t *foo_p; + + /* Encode. */ + foo_p = hello_world_foo_new(&workspace[0], sizeof(workspace)); + + if (foo_p == NULL) { + return (EXIT_FAILURE); + } + + foo_p->bar = 78; + size = hello_world_foo_encode(foo_p, &encoded[0], sizeof(encoded)); + + if (size < 0) { + return (EXIT_FAILURE); + } + + printf("Successfully encoded Foo into %d bytes.\n", size); + + /* Decode. */ + foo_p = hello_world_foo_new(&workspace[0], sizeof(workspace)); + + if (foo_p == NULL) { + return (EXIT_FAILURE); + } + + size = hello_world_foo_decode(foo_p, &encoded[0], size); + + if (size < 0) { + return (EXIT_FAILURE); + } + + printf("Successfully decoded %d bytes into Foo.\n", size); + printf("Foo.bar: %d\n", foo_p->bar); + + return (EXIT_SUCCESS); +} diff --git a/recipes/pbtools/config.yml b/recipes/pbtools/config.yml new file mode 100644 index 0000000000000..81c0b9ecee392 --- /dev/null +++ b/recipes/pbtools/config.yml @@ -0,0 +1,5 @@ +versions: + "0.45.2": + folder: "all" + "0.45.0": + folder: "all" diff --git a/recipes/pcapplusplus/all/conandata.yml b/recipes/pcapplusplus/all/conandata.yml new file mode 100644 index 0000000000000..66c9439d2be66 --- /dev/null +++ b/recipes/pcapplusplus/all/conandata.yml @@ -0,0 +1,48 @@ +sources: + "21.05": + url: "https://github.com/seladb/PcapPlusPlus/archive/v21.05.tar.gz" + sha256: "f7bc2caea72544f42e3547c8acf65fca07ddd4cd45f7be2f5132dd1826ea27bb" + "21.11": + url: "https://github.com/seladb/PcapPlusPlus/archive/v21.11.tar.gz" + sha256: "56b8566b14b2586b8afc358e7c98268bc1dd6192197b29a3917b9df2120c51b0" + "22.05": + url: "https://github.com/seladb/PcapPlusPlus/archive/v22.05.tar.gz" + sha256: "5f299c4503bf5d3c29f82b8d876a19be7dea29c2aadcb52f2f3b394846c21da9" + "22.11": + url: "https://github.com/seladb/PcapPlusPlus/archive/v22.11.tar.gz" + sha256: "3172f12f2f8a8902ae1ad6be5d65c3059c42c49c1a28e97e5d8d25a48b05e44f" +patches: + "21.05": + - patch_file: "patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan + - patch_file: "patches/0003-Use-pthreads4w.patch" + patch_description: Use pthreads4w from conan center + patch_type: conan + - patch_file: patches/0004-Fix-md5-include.patch + patch_description: Fix md5 include configuration + patch_type: conan + "21.11": + - patch_file: "patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan + - patch_file: "patches/0003-Use-pthreads4w.patch" + patch_description: Use pthreads4w from conan center + patch_type: conan + - patch_file: patches/0005-Fix-md5-include.patch + patch_description: Fix md5 include configuration + patch_type: conan + "22.05": + - patch_file: "patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan + - patch_file: "patches/0003-Use-pthreads4w.patch" + patch_description: Use pthreads4w from conan center + patch_type: conan + - patch_file: patches/0006-Fix-md5-include.patch + patch_description: Fix md5 include configuration + patch_type: conan + "22.11": + - patch_file: "patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan diff --git a/recipes/pcapplusplus/all/conanfile.py b/recipes/pcapplusplus/all/conanfile.py new file mode 100644 index 0000000000000..398650c106206 --- /dev/null +++ b/recipes/pcapplusplus/all/conanfile.py @@ -0,0 +1,145 @@ +import glob +import os + +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.files import apply_conandata_patches, copy, chdir, export_conandata_patches, get, rename, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path, MSBuild, MSBuildToolchain +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.57.0" + + +class PcapplusplusConan(ConanFile): + name = "pcapplusplus" + package_type = "static-library" + license = "Unlicense" + description = "PcapPlusPlus is a multiplatform C++ library for capturing, parsing and crafting of network packets" + topics = ("pcap", "network", "security", "packet") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seladb/PcapPlusPlus" + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "immediate_mode": [True, False], + } + default_options = { + "fPIC": True, + "immediate_mode": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os == "Windows": + self.requires("npcap/1.70") + if self.version < "22.11": + self.requires("pthreads4w/3.0.0") + else: + self.requires("libpcap/1.10.1") + + # TODO: use conan recipe instead of embedded one + # self.requires("hash-library/8.0") + + def validate(self): + if self.settings.os == "Windows" and not is_msvc(self): + raise ConanInvalidConfiguration("Can not build on Windows: only msvc compiler is supported.") + if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"): + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + @property + def _configure_sh_script(self): + return { + "Android": "configure-android.sh", + "Linux": "configure-linux.sh", + "Macos": "configure-mac_os_x.sh", + "FreeBSD": "configure-freebsd.sh", + }[str(self.settings.os)] + + def _patch_sources(self): + if not self.options.get_safe("fPIC") and self.settings.os != "Windows": + replace_in_file(self, os.path.join(self.source_folder, "PcapPlusPlus.mk.common"), + "-fPIC", "") + apply_conandata_patches(self) + if self.settings.os != "Windows": + rename(self, os.path.join(self.source_folder, self._configure_sh_script), os.path.join(self.source_folder, "configure")) + else: + props_file = os.path.join(self.generators_folder, "conantoolchain.props") + vcxproj_templates = glob.glob(f"{self.source_folder}/mk/vs/*.vcxproj.template") + for template_file in vcxproj_templates: + # Load conan-generated conantoolchain.props before Microsoft.Cpp.props + # so that we have precedence over PlatformToolset version + replace_in_file(self, template_file, '', + f'\n') + + def generate(self): + if self.settings.os == "Windows": + tc = MSBuildToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.configure_args.clear() # this configure script does not accept the typical arguments + tc.configure_args.extend([ + "--libpcap-include-dir", unix_path(self, self.dependencies["libpcap"].cpp_info.aggregated_components().includedirs[0]), + "--libpcap-lib-dir", unix_path(self, self.dependencies["libpcap"].cpp_info.aggregated_components().includedirs[0]), + ]) + + if self.options.immediate_mode: + tc.configure_args.append("--use-immediate-mode") + if is_apple_os(self) and "arm" in self.settings.arch: + tc.configure_args.append("--arm64") + + tc.generate() + + def build(self): + self._patch_sources() + if self.settings.os == "Windows": + self._build_windows() + else: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make(target="libs") + + def _build_windows(self): + with chdir(self, self.source_folder): + config_args = [ + "configure-windows-visual-studio.bat", + "--pcap-sdk", self.dependencies["npcap"].package_folder, + "--vs-version", "vs2015", # this will be later overridden by the props file generated by MSBuildToolchain + ] + if self.version < "22.11": + config_args += ["--pthreads-home", self.dependencies["pthreads4w"].package_folder] + self.run(" ".join(config_args), env="conanbuild") + msbuild = MSBuild(self) + targets = ['Common++', 'Packet++', 'Pcap++'] + msbuild.build("mk/vs2015/PcapPlusPlus.sln", targets=targets) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + copy(self, "*.h", src=os.path.join(self.source_folder, "Dist", "header"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.a", src=os.path.join(self.source_folder, "Dist"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.lib", src=os.path.join(self.source_folder, "Dist"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["Pcap++", "Packet++", "Common++"] + if self.version < "22.11" and self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("pthread") + if self.settings.os == "Macos": + self.cpp_info.frameworks.extend(["CoreFoundation", "Security", "SystemConfiguration"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch b/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch new file mode 100644 index 0000000000000..9f23a37847f60 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch @@ -0,0 +1,22 @@ +--- 3rdParty/LightPcapNg/Makefile ++++ 3rdParty/LightPcapNg/Makefile +@@ -15,7 +15,7 @@ + + Obj/%.o: LightPcapNg/src/%.c + @echo Building file: $< +- @$(CC) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" ++ @$(CC) $(CPPFLAGS) $(CLFAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" + + CUR_TARGET := $(notdir $(shell pwd)) + +--- 3rdParty/hash-library/Makefile ++++ 3rdParty/hash-library/Makefile +@@ -13,7 +13,7 @@ DEFS := -DUNIVERSAL -fPIC + + Obj/%.o: %.cpp + @echo Building file: $< +- @$(CXX) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" ++ @$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" + + CUR_TARGET := $(notdir $(shell pwd)) + diff --git a/recipes/pcapplusplus/all/patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch b/recipes/pcapplusplus/all/patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch new file mode 100644 index 0000000000000..a3df9981b3b4b --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch @@ -0,0 +1,11 @@ +--- 3rdParty/LightPcapNg/Makefile ++++ 3rdParty/LightPcapNg/Makefile +@@ -15,7 +15,7 @@ + + Obj/%.o: LightPcapNg/src/%.c + @echo Building file: $< +- @$(CC) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" ++ @$(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" + + CUR_TARGET := $(notdir $(shell pwd)) + diff --git a/recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch b/recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch new file mode 100644 index 0000000000000..d44a98ef07be3 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch @@ -0,0 +1,18 @@ +--- mk/vs/PcapPlusPlusPropertySheet.props.template ++++ mk/vs/PcapPlusPlusPropertySheet.props.template +@@ -23,12 +23,11 @@ + + + +- $(PThreadWin32Home)\Pre-built.2\include;%(AdditionalIncludeDirectories) ++ $(PThreadWin32Home)\include;%(AdditionalIncludeDirectories) + HAVE_STRUCT_TIMESPEC;%(PreprocessorDefinitions) + + +- $(PThreadWin32Home)\Pre-built.2\lib\x86;%(AdditionalLibraryDirectories) +- $(PThreadWin32Home)\Pre-built.2\lib\x64;%(AdditionalLibraryDirectories) ++ $(PThreadWin32Home)\lib;%(AdditionalLibraryDirectories) +- pthreadVC2.lib;%(AdditionalDependencies) ++ pthreadVC3.lib;%(AdditionalDependencies) + + diff --git a/recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch b/recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch new file mode 100644 index 0000000000000..4232648a089d4 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch @@ -0,0 +1,11 @@ +--- mk/vs/Packet++.vcxproj.template ++++ mk/vs/Packet++.vcxproj.template +@@ -271,7 +271,7 @@ + + + +- ++ + + + diff --git a/recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch b/recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch new file mode 100644 index 0000000000000..4bb47fbc85d17 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch @@ -0,0 +1,11 @@ +--- mk/vs/Packet++.vcxproj.template ++++ mk/vs/Packet++.vcxproj.template +@@ -273,7 +273,7 @@ + + + +- ++ + + + diff --git a/recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch b/recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch new file mode 100644 index 0000000000000..115ab8bfc2026 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch @@ -0,0 +1,11 @@ +--- mk/vs/Packet++.vcxproj.template ++++ mk/vs/Packet++.vcxproj.template +@@ -275,7 +275,7 @@ + + + +- ++ + + + diff --git a/recipes/pcapplusplus/all/test_package/CMakeLists.txt b/recipes/pcapplusplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8c5f8b3c73c1f --- /dev/null +++ b/recipes/pcapplusplus/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(pcapplusplus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} pcapplusplus::pcapplusplus) diff --git a/recipes/pcapplusplus/all/test_package/conanfile.py b/recipes/pcapplusplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/pcapplusplus/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/pcapplusplus/all/test_package/test_package.cpp b/recipes/pcapplusplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a39e3bf39bee1 --- /dev/null +++ b/recipes/pcapplusplus/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + std::cout << "PCAP++ VERSION: " << pcpp::getPcapPlusPlusVersionFull() << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt b/recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pcapplusplus/all/test_v1_package/conanfile.py b/recipes/pcapplusplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/pcapplusplus/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pcapplusplus/config.yml b/recipes/pcapplusplus/config.yml new file mode 100644 index 0000000000000..26e119bb00764 --- /dev/null +++ b/recipes/pcapplusplus/config.yml @@ -0,0 +1,9 @@ +versions: + "21.05": + folder: all + "21.11": + folder: all + "22.05": + folder: all + "22.11": + folder: all diff --git a/recipes/pcg-cpp/all/conandata.yml b/recipes/pcg-cpp/all/conandata.yml new file mode 100644 index 0000000000000..372c7daee9c81 --- /dev/null +++ b/recipes/pcg-cpp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20220409": + url: "https://github.com/imneme/pcg-cpp/archive/428802d1a5634f96bcd0705fab379ff0113bcf13.tar.gz" + sha256: "79f23706ed0cbc1bb57ea35d50d0abed66898b8f7b0bcf2aaecdfd234863b060" + "cci.20210406": + url: "https://github.com/imneme/pcg-cpp/archive/ffd522e7188bef30a00c74dc7eb9de5faff90092.tar.gz" + sha256: "81e4ab1936971627e6cc49fba279d0891b657d4397fc7940f6e751a37e4fdc94" diff --git a/recipes/pcg-cpp/all/conanfile.py b/recipes/pcg-cpp/all/conanfile.py new file mode 100644 index 0000000000000..d470b1eadd1c2 --- /dev/null +++ b/recipes/pcg-cpp/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PcgcppConan(ConanFile): + name = "pcg-cpp" + description = "C++ implementation of the PCG family of random number generators." + license = ("MIT", "Apache-2.0") + topics = ("pcg-cpp", "pcg", "rng", "random", "header-only") + homepage = "https://github.com/imneme/pcg-cpp" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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], 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, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pcg-cpp/all/test_package/CMakeLists.txt b/recipes/pcg-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..55749779d0824 --- /dev/null +++ b/recipes/pcg-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(pcg-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pcg-cpp::pcg-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/pcg-cpp/all/test_package/conanfile.py b/recipes/pcg-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/pcg-cpp/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/pcg-cpp/all/test_package/test_package.cpp b/recipes/pcg-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9a061e43f0ebd --- /dev/null +++ b/recipes/pcg-cpp/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include +#include + +int main() { + pcg32 rng(pcg_extras::seed_seq_from{}); + std::cout << "RNG used: " << rng << "\n\n"; + return 0; +} diff --git a/recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt b/recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1cca9abb1563 --- /dev/null +++ b/recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pcg-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pcg-cpp::pcg-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/pcg-cpp/all/test_v1_package/conanfile.py b/recipes/pcg-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pcg-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pcg-cpp/config.yml b/recipes/pcg-cpp/config.yml new file mode 100644 index 0000000000000..5055373e8abfa --- /dev/null +++ b/recipes/pcg-cpp/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220409": + folder: "all" + "cci.20210406": + folder: "all" diff --git a/recipes/pciutils/all/conandata.yml b/recipes/pciutils/all/conandata.yml new file mode 100644 index 0000000000000..01d5f5a0e9de5 --- /dev/null +++ b/recipes/pciutils/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.7.0": + sha256: ea768aa0187ba349391c6c157445ecc2b42e7d671fc1ce8c53ff5ef513f1e2ab + url: https://github.com/pciutils/pciutils/archive/v3.7.0.tar.gz diff --git a/recipes/pciutils/all/conanfile.py b/recipes/pciutils/all/conanfile.py new file mode 100644 index 0000000000000..7de2b56523367 --- /dev/null +++ b/recipes/pciutils/all/conanfile.py @@ -0,0 +1,76 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + + +class PciUtilsConan(ConanFile): + name = "pciutils" + license = "BSD-3-Clause" + description = "The PCI Utilities package contains a library for portable access to PCI bus" + topics = ("pci", "pci-bus", "hardware", "local-bus") + homepage = "https://github.com/pciutils/pciutils" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False], "with_zlib": [True, False], "with_udev": [True, False]} + default_options = {"shared": False, "fPIC": True, "with_zlib": True, "with_udev": False} + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("Platform {} is currently not supported by this recipe".format(self.settings.os)) + + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.11") + if self.options.with_udev: + # TODO: Enable libudev option when available + raise ConanInvalidConfiguration("libudev requires conan-io/conan-center-index#2468") + self.requires("systemd/system") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + tools.rename(extracted_dir, self._source_subfolder) + + def _make(self, targets): + yes_no = lambda v: "yes" if v else "no" + autotools = AutoToolsBuildEnvironment(self) + autotools.make(args=["SHARED={}".format(yes_no(self.options.shared)), + "ZLIB={}".format(yes_no(self.options.with_zlib)), + "HWDB={}".format(yes_no(self.options.with_udev)), + "PREFIX={}".format(self.package_folder), + "OPT={}".format("{} {}".format( + autotools.vars["CPPFLAGS"], autotools.vars["CFLAGS"])), + "DNS=no"], + target=" ".join(targets)) + + def build(self): + with tools.chdir(self._source_subfolder): + self._make(["all"]) + + def package(self): + with tools.chdir(self._source_subfolder): + self._make(["install", "install-pcilib"]) + + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + self.copy("*.h", src=self._source_subfolder, dst="include", keep_path=True) + + if self.options.shared: + tools.rename(src=os.path.join(self._source_subfolder, "lib", "libpci.so.3.7.0"), + dst=os.path.join(self.package_folder, "lib", "libpci.so")) + + tools.rmdir(os.path.join(self.package_folder, "sbin")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "man")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libpci" + self.cpp_info.libs = ["pci"] diff --git a/recipes/pciutils/all/test_package/CMakeLists.txt b/recipes/pciutils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..48b855b8a30aa --- /dev/null +++ b/recipes/pciutils/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.c) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/pciutils/all/test_package/conanfile.py b/recipes/pciutils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f2b070b59136 --- /dev/null +++ b/recipes/pciutils/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class CAresTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/pciutils/all/test_package/example.c b/recipes/pciutils/all/test_package/example.c new file mode 100644 index 0000000000000..239397b239da0 --- /dev/null +++ b/recipes/pciutils/all/test_package/example.c @@ -0,0 +1,30 @@ +#include + +#include "lib/pci.h" + +int main(void) +{ + struct pci_access *pacc; + struct pci_dev *dev; + unsigned int c; + char namebuf[1024], *name; + + pacc = pci_alloc(); /* Get the pci_access structure */ + /* Set all options you want -- here we stick with the defaults */ + pci_init(pacc); /* Initialize the PCI library */ + pci_scan_bus(pacc); /* We want to get the list of devices */ + for (dev=pacc->devices; dev; dev=dev->next) /* Iterate over all devices */ + { + pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); /* Fill in header info we need */ + c = pci_read_byte(dev, PCI_INTERRUPT_PIN); /* Read config register directly */ + printf("%04x:%02x:%02x.%d vendor=%04x device=%04x class=%04x irq=%d (pin %d) base0=%lx", + dev->domain, dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id, + dev->device_class, dev->irq, c, (long) dev->base_addr[0]); + + /* Look up and print the full name of the device */ + name = pci_lookup_name(pacc, namebuf, sizeof(namebuf), PCI_LOOKUP_DEVICE, dev->vendor_id, dev->device_id); + printf(" (%s)\n", name); + } + pci_cleanup(pacc); /* Close everything */ + return 0; +} diff --git a/recipes/pciutils/config.yml b/recipes/pciutils/config.yml new file mode 100644 index 0000000000000..20ddf579e6d44 --- /dev/null +++ b/recipes/pciutils/config.yml @@ -0,0 +1,3 @@ +versions: + "3.7.0": + folder: all diff --git a/recipes/pcre/all/conandata.yml b/recipes/pcre/all/conandata.yml new file mode 100644 index 0000000000000..3ef6900fa4374 --- /dev/null +++ b/recipes/pcre/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "8.45": + url: "https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2" + sha256: "4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8" + "8.44": + url: "https://sourceforge.net/projects/pcre/files/pcre/8.44/pcre-8.44.tar.bz2" + sha256: "19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d" + "8.41": + url: "https://sourceforge.net/projects/pcre/files/pcre/8.41/pcre-8.41.tar.bz2" + sha256: "e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530" +patches: + "8.45": + - patch_file: "patches/0001-fix-cmake-8.45.patch" + "8.44": + - patch_file: "patches/0001-fix-cmake-8.41.patch" + "8.41": + - patch_file: "patches/0001-fix-cmake-8.41.patch" diff --git a/recipes/pcre/all/conanfile.py b/recipes/pcre/all/conanfile.py new file mode 100644 index 0000000000000..8d0c74976c81b --- /dev/null +++ b/recipes/pcre/all/conanfile.py @@ -0,0 +1,193 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class PCREConan(ConanFile): + name = "pcre" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.pcre.org" + description = "Perl Compatible Regular Expressions" + topics = ("regex", "regexp", "PCRE") + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_pcre_8": [True, False], + "build_pcre_16": [True, False], + "build_pcre_32": [True, False], + "build_pcrecpp": [True, False], + "build_pcregrep": [True, False], + "with_bzip2": [True, False], + "with_zlib": [True, False], + "with_jit": [True, False], + "with_utf": [True, False], + "with_unicode_properties": [True, False], + "with_stack_for_recursion": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_pcre_8": True, + "build_pcre_16": True, + "build_pcre_32": True, + "build_pcrecpp": False, + "build_pcregrep": True, + "with_bzip2": True, + "with_zlib": True, + "with_jit": False, + "with_utf": True, + "with_unicode_properties": True, + "with_stack_for_recursion": 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") + if not self.options.build_pcrecpp: + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.build_pcregrep: + del self.options.with_bzip2 + del self.options.with_zlib + if self.options.with_unicode_properties: + self.options.with_utf = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_bzip2"): + self.requires("bzip2/1.0.8") + if self.options.get_safe("with_zlib"): + self.requires("zlib/1.2.13") + + def validate(self): + if not self.options.build_pcre_8 and not self.options.build_pcre_16 and not self.options.build_pcre_32: + raise ConanInvalidConfiguration("At least one of build_pcre_8, build_pcre_16 or build_pcre_32 must be enabled") + if self.options.build_pcrecpp and not self.options.build_pcre_8: + raise ConanInvalidConfiguration("build_pcre_8 must be enabled for the C++ library support") + if self.options.build_pcregrep and not self.options.build_pcre_8: + raise ConanInvalidConfiguration("build_pcre_8 must be enabled for the pcregrep program") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PCRE_BUILD_TESTS"] = False + tc.variables["PCRE_BUILD_PCRE8"] = self.options.build_pcre_8 + tc.variables["PCRE_BUILD_PCRE16"] = self.options.build_pcre_16 + tc.variables["PCRE_BUILD_PCRE32"] = self.options.build_pcre_32 + tc.variables["PCRE_BUILD_PCREGREP"] = self.options.build_pcregrep + tc.variables["PCRE_BUILD_PCRECPP"] = self.options.build_pcrecpp + tc.variables["PCRE_SUPPORT_LIBZ"] = self.options.get_safe("with_zlib", False) + tc.variables["PCRE_SUPPORT_LIBBZ2"] = self.options.get_safe("with_bzip2", False) + tc.variables["PCRE_SUPPORT_JIT"] = self.options.with_jit + tc.variables["PCRE_SUPPORT_UTF"] = self.options.with_utf + tc.variables["PCRE_SUPPORT_UNICODE_PROPERTIES"] = self.options.with_unicode_properties + tc.variables["PCRE_SUPPORT_LIBREADLINE"] = False + tc.variables["PCRE_SUPPORT_LIBEDIT"] = False + tc.variables["PCRE_NO_RECURSE"] = not self.options.with_stack_for_recursion + if is_msvc(self): + tc.variables["PCRE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS since upstream CMakeLists overrides it as a CACHE variable. + # Issue quite similar to https://github.com/conan-io/conan/issues/11840 + tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmake_file = os.path.join(self.source_folder, "CMakeLists.txt") + # Avoid man and share during install stage + replace_in_file(self, cmake_file, "INSTALL(FILES ${man1} DESTINATION man/man1)", "") + replace_in_file(self, cmake_file, "INSTALL(FILES ${man3} DESTINATION man/man3)", "") + replace_in_file(self, cmake_file, "INSTALL(FILES ${html} DESTINATION share/doc/pcre/html)", "") + # Do not override CMAKE_MODULE_PATH and do not add ${PROJECT_SOURCE_DIR}/cmake + # because it contains a custom FindPackageHandleStandardArgs.cmake which + # can break conan generators + replace_in_file(self, cmake_file, "SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)", "") + # Avoid CMP0006 error (macos bundle) + replace_in_file( + self, + cmake_file, + "RUNTIME DESTINATION bin", + "RUNTIME DESTINATION bin\n BUNDLE DESTINATION bin", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENCE", 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")) + + def package_info(self): + suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + + if self.options.build_pcre_8: + # pcre + self.cpp_info.components["libpcre"].set_property("pkg_config_name", "libpcre") + self.cpp_info.components["libpcre"].libs = [f"pcre{suffix}"] + if not self.options.shared: + self.cpp_info.components["libpcre"].defines.append("PCRE_STATIC=1") + # pcreposix + self.cpp_info.components["libpcreposix"].set_property("pkg_config_name", "libpcreposix") + self.cpp_info.components["libpcreposix"].libs = [f"pcreposix{suffix}"] + self.cpp_info.components["libpcreposix"].requires = ["libpcre"] + # pcrecpp + if self.options.build_pcrecpp: + self.cpp_info.components["libpcrecpp"].set_property("pkg_config_name", "libpcrecpp") + self.cpp_info.components["libpcrecpp"].libs = [f"pcrecpp{suffix}"] + self.cpp_info.components["libpcrecpp"].requires = ["libpcre"] + # pcre16 + if self.options.build_pcre_16: + self.cpp_info.components["libpcre16"].set_property("pkg_config_name", "libpcre16") + self.cpp_info.components["libpcre16"].libs = [f"pcre16{suffix}"] + if not self.options.shared: + self.cpp_info.components["libpcre16"].defines.append("PCRE_STATIC=1") + # pcre32 + if self.options.build_pcre_32: + self.cpp_info.components["libpcre32"].set_property("pkg_config_name", "libpcre32") + self.cpp_info.components["libpcre32"].libs = [f"pcre32{suffix}"] + if not self.options.shared: + self.cpp_info.components["libpcre32"].defines.append("PCRE_STATIC=1") + + if self.options.build_pcregrep: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + # FIXME: This is a workaround to avoid ConanException. zlib and bzip2 + # are optional requirements of pcregrep executable, not of any pcre lib. + if self.options.with_bzip2: + self.cpp_info.components["libpcre"].requires.append("bzip2::bzip2") + if self.options.with_zlib: + self.cpp_info.components["libpcre"].requires.append("zlib::zlib") + + # TODO: to remove in conan v2 once legacy generators removed + # DO NOT port this name to cmake_file_name/cmake_target_name properties, it was a mistake + self.cpp_info.names["cmake_find_package"] = "PCRE" + self.cpp_info.names["cmake_find_package_multi"] = "PCRE" diff --git a/recipes/pcre/all/patches/0001-fix-cmake-8.41.patch b/recipes/pcre/all/patches/0001-fix-cmake-8.41.patch new file mode 100644 index 0000000000000..811ef30aa37cc --- /dev/null +++ b/recipes/pcre/all/patches/0001-fix-cmake-8.41.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,13 +68,13 @@ + # 2016-03-01 PH applied Chris Wilson's patch for MSVC static build + # 2016-06-24 PH applied Chris Wilson's revised patch (adds a separate option) + +-PROJECT(PCRE C CXX) + + # Increased minimum to 2.8.0 to support newer add_test features. Set policy + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) + CMAKE_POLICY(SET CMP0026 OLD) ++PROJECT(PCRE C CXX) + + SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake + diff --git a/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch b/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch new file mode 100644 index 0000000000000..2d4e61286f2d9 --- /dev/null +++ b/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -71,13 +71,13 @@ + # 2021-06-14 PH applied Wolfgang Stöggl's patch for generating pcre-config and + # libpcre*.pc files (Bugzilla #2583) + +-PROJECT(PCRE C CXX) + + # Increased minimum to 2.8.5 to support GNUInstallDirs. Set policy + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) + CMAKE_POLICY(SET CMP0026 OLD) ++PROJECT(PCRE C CXX) + + # For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH + # on the command line. diff --git a/recipes/pcre/all/test_package/CMakeLists.txt b/recipes/pcre/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..13c466091c9ad --- /dev/null +++ b/recipes/pcre/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(pcre REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pcre::pcre) diff --git a/recipes/pcre/all/test_package/conanfile.py b/recipes/pcre/all/test_package/conanfile.py new file mode 100644 index 0000000000000..931afd6db544f --- /dev/null +++ b/recipes/pcre/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + arguments = "{}w+ conan-center-index".format("\\" if self.settings.os == "Windows" else "\\\\") + self.run(f"{bin_path} {arguments}", env="conanrun") diff --git a/recipes/pcre/all/test_package/test_package.c b/recipes/pcre/all/test_package/test_package.c new file mode 100644 index 0000000000000..6de33185f4840 --- /dev/null +++ b/recipes/pcre/all/test_package/test_package.c @@ -0,0 +1,406 @@ +/************************************************* +* PCRE DEMONSTRATION PROGRAM * +*************************************************/ + +/* This is a demonstration program to illustrate the most straightforward ways +of calling the PCRE regular expression library from a C program. See the +pcresample documentation for a short discussion ("man pcresample" if you have +the PCRE man pages installed). + +In Unix-like environments, if PCRE is installed in your standard system +libraries, you should be able to compile this program using this command: + +gcc -Wall pcredemo.c -lpcre -o pcredemo + +If PCRE is not installed in a standard place, it is likely to be installed with +support for the pkg-config mechanism. If you have pkg-config, you can compile +this program using this command: + +gcc -Wall pcredemo.c `pkg-config --cflags --libs libpcre` -o pcredemo + +If you do not have pkg-config, you may have to use this: + +gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \ + -R/usr/local/lib -lpcre -o pcredemo + +Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and +library files for PCRE are installed on your system. Only some operating +systems (e.g. Solaris) use the -R option. + +Building under Windows: + +If you want to statically link this program against a non-dll .a file, you must +define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and +pcre_free() exported functions will be declared __declspec(dllimport), with +unwanted results. So in this environment, uncomment the following line. */ + +/* #define PCRE_STATIC */ + +#include +#include +#include "pcre.h" + +#define OVECCOUNT 30 /* should be a multiple of 3 */ + + +int main(int argc, char **argv) +{ +pcre *re; +const char *error; +char *pattern; +char *subject; +unsigned char *name_table; +unsigned int option_bits; +int erroffset; +int find_all; +int crlf_is_newline; +int namecount; +int name_entry_size; +int ovector[OVECCOUNT]; +int subject_length; +int rc, i; +int utf8; + + +/************************************************************************** +* First, sort out the command line. There is only one possible option at * +* the moment, "-g" to request repeated matching to find all occurrences, * +* like Perl's /g option. We set the variable find_all to a non-zero value * +* if the -g option is present. Apart from that, there must be exactly two * +* arguments. * +**************************************************************************/ + +find_all = 0; +for (i = 1; i < argc; i++) + { + if (strcmp(argv[i], "-g") == 0) find_all = 1; + else break; + } + +/* After the options, we require exactly two arguments, which are the pattern, +and the subject string. */ + +if (argc - i != 2) + { + printf("Two arguments required: a regex and a subject string\n"); + return 1; + } + +pattern = argv[i]; +subject = argv[i+1]; +subject_length = (int)strlen(subject); + + +/************************************************************************* +* Now we are going to compile the regular expression pattern, and handle * +* and errors that are detected. * +*************************************************************************/ + +re = pcre_compile( + pattern, /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ + +/* Compilation failed: print the error message and exit */ + +if (re == NULL) + { + printf("PCRE compilation failed at offset %d: %s\n", erroffset, error); + return 1; + } + + +/************************************************************************* +* If the compilation succeeded, we call PCRE again, in order to do a * +* pattern match against the subject string. This does just ONE match. If * +* further matching is needed, it will be done below. * +*************************************************************************/ + +rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + subject, /* the subject string */ + subject_length, /* the length of the subject */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + +/* Matching failed: handle error cases */ + +if (rc < 0) + { + switch(rc) + { + case PCRE_ERROR_NOMATCH: printf("No match\n"); break; + /* + Handle other special cases if you like + */ + default: printf("Matching error %d\n", rc); break; + } + pcre_free(re); /* Release memory used for the compiled pattern */ + return 1; + } + +/* Match succeded */ + +printf("\nMatch succeeded at offset %d\n", ovector[0]); + + +/************************************************************************* +* We have found the first match within the subject string. If the output * +* vector wasn't big enough, say so. Then output any substrings that were * +* captured. * +*************************************************************************/ + +/* The output vector wasn't big enough */ + +if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\n", rc - 1); + } + +/* Show substrings stored in the output vector by number. Obviously, in a real +application you might want to do things other than print them. */ + +for (i = 0; i < rc; i++) + { + char *substring_start = subject + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\n", i, substring_length, substring_start); + } + + +/************************************************************************** +* That concludes the basic part of this demonstration program. We have * +* compiled a pattern, and performed a single match. The code that follows * +* shows first how to access named substrings, and then how to code for * +* repeated matches on the same subject. * +**************************************************************************/ + +/* See if there are any named substrings, and if so, show them by name. First +we have to extract the count of named parentheses from the pattern. */ + +(void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMECOUNT, /* number of named substrings */ + &namecount); /* where to put the answer */ + +if (namecount <= 0) printf("No named substrings\n"); else + { + unsigned char *tabptr; + printf("Named substrings\n"); + + /* Before we can access the substrings, we must extract the table for + translating names to numbers, and the size of each entry in the table. */ + + (void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMETABLE, /* address of the table */ + &name_table); /* where to put the answer */ + + (void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMEENTRYSIZE, /* size of each entry in the table */ + &name_entry_size); /* where to put the answer */ + + /* Now we can scan the table and, for each entry, print the number, the name, + and the substring itself. */ + + tabptr = name_table; + for (i = 0; i < namecount; i++) + { + int n = (tabptr[0] << 8) | tabptr[1]; + printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2, + ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); + tabptr += name_entry_size; + } + } + + +/************************************************************************* +* If the "-g" option was given on the command line, we want to continue * +* to search for additional matches in the subject string, in a similar * +* way to the /g option in Perl. This turns out to be trickier than you * +* might think because of the possibility of matching an empty string. * +* What happens is as follows: * +* * +* If the previous match was NOT for an empty string, we can just start * +* the next match at the end of the previous one. * +* * +* If the previous match WAS for an empty string, we can't do that, as it * +* would lead to an infinite loop. Instead, a special call of pcre_exec() * +* is made with the PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED flags set. * +* The first of these tells PCRE that an empty string at the start of the * +* subject is not a valid match; other possibilities must be tried. The * +* second flag restricts PCRE to one match attempt at the initial string * +* position. If this match succeeds, an alternative to the empty string * +* match has been found, and we can print it and proceed round the loop, * +* advancing by the length of whatever was found. If this match does not * +* succeed, we still stay in the loop, advancing by just one character. * +* In UTF-8 mode, which can be set by (*UTF8) in the pattern, this may be * +* more than one byte. * +* * +* However, there is a complication concerned with newlines. When the * +* newline convention is such that CRLF is a valid newline, we must * +* advance by two characters rather than one. The newline convention can * +* be set in the regex by (*CR), etc.; if not, we must find the default. * +*************************************************************************/ + +if (!find_all) /* Check for -g */ + { + pcre_free(re); /* Release the memory used for the compiled pattern */ + return 0; /* Finish unless -g was given */ + } + +/* Before running the loop, check for UTF-8 and whether CRLF is a valid newline +sequence. First, find the options with which the regex was compiled; extract +the UTF-8 state, and mask off all but the newline options. */ + +(void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits); +utf8 = option_bits & PCRE_UTF8; +option_bits &= PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|PCRE_NEWLINE_CRLF| + PCRE_NEWLINE_ANY|PCRE_NEWLINE_ANYCRLF; + +/* If no newline options were set, find the default newline convention from the +build configuration. */ + +if (option_bits == 0) + { + int d; + (void)pcre_config(PCRE_CONFIG_NEWLINE, &d); + /* Note that these values are always the ASCII ones, even in + EBCDIC environments. CR = 13, NL = 10. */ + option_bits = (d == 13)? PCRE_NEWLINE_CR : + (d == 10)? PCRE_NEWLINE_LF : + (d == (13<<8 | 10))? PCRE_NEWLINE_CRLF : + (d == -2)? PCRE_NEWLINE_ANYCRLF : + (d == -1)? PCRE_NEWLINE_ANY : 0; + } + +/* See if CRLF is a valid newline sequence. */ + +crlf_is_newline = + option_bits == PCRE_NEWLINE_ANY || + option_bits == PCRE_NEWLINE_CRLF || + option_bits == PCRE_NEWLINE_ANYCRLF; + +/* Loop for second and subsequent matches */ + +for (;;) + { + int options = 0; /* Normally no options */ + int start_offset = ovector[1]; /* Start at end of previous match */ + + /* If the previous match was for an empty string, we are finished if we are + at the end of the subject. Otherwise, arrange to run another match at the + same point to see if a non-empty match can be found. */ + + if (ovector[0] == ovector[1]) + { + if (ovector[0] == subject_length) break; + options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED; + } + + /* Run the next matching operation */ + + rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + subject, /* the subject string */ + subject_length, /* the length of the subject */ + start_offset, /* starting offset in the subject */ + options, /* options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + + /* This time, a result of NOMATCH isn't an error. If the value in "options" + is zero, it just means we have found all possible matches, so the loop ends. + Otherwise, it means we have failed to find a non-empty-string match at a + point where there was a previous empty-string match. In this case, we do what + Perl does: advance the matching position by one character, and continue. We + do this by setting the "end of previous match" offset, because that is picked + up at the top of the loop as the point at which to start again. + + There are two complications: (a) When CRLF is a valid newline sequence, and + the current position is just before it, advance by an extra byte. (b) + Otherwise we must ensure that we skip an entire UTF-8 character if we are in + UTF-8 mode. */ + + if (rc == PCRE_ERROR_NOMATCH) + { + if (options == 0) break; /* All matches found */ + ovector[1] = start_offset + 1; /* Advance one byte */ + if (crlf_is_newline && /* If CRLF is newline & */ + start_offset < subject_length - 1 && /* we are at CRLF, */ + subject[start_offset] == '\r' && + subject[start_offset + 1] == '\n') + ovector[1] += 1; /* Advance by one more. */ + else if (utf8) /* Otherwise, ensure we */ + { /* advance a whole UTF-8 */ + while (ovector[1] < subject_length) /* character. */ + { + if ((subject[ovector[1]] & 0xc0) != 0x80) break; + ovector[1] += 1; + } + } + continue; /* Go round the loop again */ + } + + /* Other matching errors are not recoverable. */ + + if (rc < 0) + { + printf("Matching error %d\n", rc); + pcre_free(re); /* Release memory used for the compiled pattern */ + return 1; + } + + /* Match succeded */ + + printf("\nMatch succeeded again at offset %d\n", ovector[0]); + + /* The match succeeded, but the output vector wasn't big enough. */ + + if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\n", rc - 1); + } + + /* As before, show substrings stored in the output vector by number, and then + also any named substrings. */ + + for (i = 0; i < rc; i++) + { + char *substring_start = subject + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\n", i, substring_length, substring_start); + } + + if (namecount <= 0) printf("No named substrings\n"); else + { + unsigned char *tabptr = name_table; + printf("Named substrings\n"); + for (i = 0; i < namecount; i++) + { + int n = (tabptr[0] << 8) | tabptr[1]; + printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2, + ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); + tabptr += name_entry_size; + } + } + } /* End of loop to find second and subsequent matches */ + +printf("\n"); +pcre_free(re); /* Release memory used for the compiled pattern */ +return 0; +} + +/* End of pcredemo.c */ diff --git a/recipes/pcre/all/test_v1_package/CMakeLists.txt b/recipes/pcre/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..35d9bf22ada5f --- /dev/null +++ b/recipes/pcre/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PCRE REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PCRE::PCRE) diff --git a/recipes/pcre/all/test_v1_package/conanfile.py b/recipes/pcre/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5ffb0c5afa8b0 --- /dev/null +++ b/recipes/pcre/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + arguments = "{}w+ conan-center-index".format("\\" if self.settings.os == "Windows" else "\\\\") + self.run(f"{bin_path} {arguments}", run_environment=True) diff --git a/recipes/pcre/config.yml b/recipes/pcre/config.yml new file mode 100644 index 0000000000000..32df8d6a2f636 --- /dev/null +++ b/recipes/pcre/config.yml @@ -0,0 +1,7 @@ +versions: + "8.45": + folder: all + "8.44": + folder: all + "8.41": + folder: all diff --git a/recipes/pcre2/all/conandata.yml b/recipes/pcre2/all/conandata.yml new file mode 100644 index 0000000000000..344830544b429 --- /dev/null +++ b/recipes/pcre2/all/conandata.yml @@ -0,0 +1,71 @@ +sources: + "10.42": + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2" + sha256: "8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840" + "10.40": + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.bz2" + sha256: "14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68" + "10.39": + url: "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.tar.bz2" + sha256: "0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d440" + "10.37": + url: + - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.37/pcre2-10.37.tar.bz2" + - "https://sourceforge.net/projects/pcre/files/pcre2/10.37/pcre2-10.37.tar.bz2" + sha256: "4d95a96e8b80529893b4562be12648d798b957b1ba1aae39606bbc2ab956d270" + "10.36": + url: + - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.36/pcre2-10.36.tar.bz2" + - "https://sourceforge.net/projects/pcre/files/pcre2/10.36/pcre2-10.36.tar.bz2" + sha256: "a9ef39278113542968c7c73a31cfcb81aca1faa64690f400b907e8ab6b4a665c" + "10.35": + url: + - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.35/pcre2-10.35.tar.bz2" + - "https://sourceforge.net/projects/pcre/files/pcre2/10.35/pcre2-10.35.tar.bz2" + sha256: "9ccba8e02b0ce78046cdfb52e5c177f0f445e421059e43becca4359c669d4613" + "10.33": + url: + - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.33/pcre2-10.33.tar.bz2" + - "https://sourceforge.net/projects/pcre/files/pcre2/10.33/pcre2-10.33.tar.bz2" + sha256: "35514dff0ccdf02b55bd2e9fa586a1b9d01f62332c3356e379eabb75f789d8aa" + "10.32": + url: + - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.32/pcre2-10.32.tar.bz2" + - "https://sourceforge.net/projects/pcre/files/pcre2/10.32/pcre2-10.32.tar.bz2" + sha256: "f29e89cc5de813f45786580101aaee3984a65818631d4ddbda7b32f699b87c2e" +patches: + "10.40": + - patch_file: "patches/0001-fix-cmake-1.39.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.39": + - patch_file: "patches/0001-fix-cmake-1.39.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.37": + - patch_file: "patches/0001-fix-cmake-1.36.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.36": + - patch_file: "patches/0001-fix-cmake-1.36.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.35": + - patch_file: "patches/0001-fix-cmake-1.35.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.33": + - patch_file: "patches/0001-fix-cmake-1.33.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.32": + - patch_file: "patches/0001-fix-cmake-1.32.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py new file mode 100644 index 0000000000000..5982290e7cdbe --- /dev/null +++ b/recipes/pcre2/all/conanfile.py @@ -0,0 +1,204 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class PCRE2Conan(ConanFile): + name = "pcre2" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.pcre.org/" + description = "Perl Compatible Regular Expressions" + topics = ("regex", "regexp", "perl") + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_pcre2_8": [True, False], + "build_pcre2_16": [True, False], + "build_pcre2_32": [True, False], + "build_pcre2grep": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "support_jit": [True, False], + "grep_support_callout_fork": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_pcre2_8": True, + "build_pcre2_16": True, + "build_pcre2_32": True, + "build_pcre2grep": True, + "with_zlib": True, + "with_bzip2": True, + "support_jit": False, + "grep_support_callout_fork": 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") + if not self.options.build_pcre2grep: + del self.options.with_zlib + del self.options.with_bzip2 + del self.options.grep_support_callout_fork + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_zlib"): + self.requires("zlib/1.2.13") + if self.options.get_safe("with_bzip2"): + self.requires("bzip2/1.0.8") + + def validate(self): + if not self.options.build_pcre2_8 and not self.options.build_pcre2_16 and not self.options.build_pcre2_32: + raise ConanInvalidConfiguration("At least one of build_pcre2_8, build_pcre2_16 or build_pcre2_32 must be enabled") + if self.options.build_pcre2grep and not self.options.build_pcre2_8: + raise ConanInvalidConfiguration("build_pcre2_8 must be enabled for the pcre2grep program") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Mandatory because upstream CMakeLists overrides BUILD_SHARED_LIBS as a CACHE variable + # (see https://github.com/conan-io/conan/issues/11840) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + if Version(self.version) >= "10.38": + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["PCRE2_BUILD_PCRE2GREP"] = self.options.build_pcre2grep + tc.variables["PCRE2_SUPPORT_LIBZ"] = self.options.get_safe("with_zlib", False) + tc.variables["PCRE2_SUPPORT_LIBBZ2"] = self.options.get_safe("with_bzip2", False) + tc.variables["PCRE2_BUILD_TESTS"] = False + if is_msvc(self): + tc.variables["PCRE2_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.variables["PCRE2_DEBUG"] = self.settings.build_type == "Debug" + tc.variables["PCRE2_BUILD_PCRE2_8"] = self.options.build_pcre2_8 + 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["PCRE2GREP_SUPPORT_CALLOUT_FORK"] = self.options.get_safe("grep_support_callout_fork", False) + if Version(self.version) < "10.38": + # relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Do not add ${PROJECT_SOURCE_DIR}/cmake because it contains a custom + # FindPackageHandleStandardArgs.cmake which can break conan generators + if Version(self.version) < "10.34": + replace_in_file(self, cmakelists, "SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)", "") + else: + replace_in_file(self, cmakelists, "LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)", "") + # Avoid CMP0006 error (macos bundle) + replace_in_file(self, cmakelists, + "RUNTIME DESTINATION bin", + "RUNTIME DESTINATION bin BUNDLE DESTINATION bin") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENCE", 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, "man")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PCRE2") + self.cpp_info.set_property("pkg_config_name", "libpcre2") + if self.options.build_pcre2_8: + # pcre2-8 + self.cpp_info.components["pcre2-8"].set_property("cmake_target_name", "PCRE2::8BIT") + self.cpp_info.components["pcre2-8"].set_property("pkg_config_name", "libpcre2-8") + self.cpp_info.components["pcre2-8"].libs = [self._lib_name("pcre2-8")] + if not self.options.shared: + self.cpp_info.components["pcre2-8"].defines.append("PCRE2_STATIC") + # pcre2-posix + self.cpp_info.components["pcre2-posix"].set_property("cmake_target_name", "PCRE2::POSIX") + self.cpp_info.components["pcre2-posix"].set_property("pkg_config_name", "libpcre2-posix") + self.cpp_info.components["pcre2-posix"].libs = [self._lib_name("pcre2-posix")] + self.cpp_info.components["pcre2-posix"].requires = ["pcre2-8"] + # pcre2-16 + if self.options.build_pcre2_16: + self.cpp_info.components["pcre2-16"].set_property("cmake_target_name", "PCRE2::16BIT") + self.cpp_info.components["pcre2-16"].set_property("pkg_config_name", "libpcre2-16") + self.cpp_info.components["pcre2-16"].libs = [self._lib_name("pcre2-16")] + if not self.options.shared: + self.cpp_info.components["pcre2-16"].defines.append("PCRE2_STATIC") + # pcre2-32 + if self.options.build_pcre2_32: + self.cpp_info.components["pcre2-32"].set_property("cmake_target_name", "PCRE2::32BIT") + self.cpp_info.components["pcre2-32"].set_property("pkg_config_name", "libpcre2-32") + self.cpp_info.components["pcre2-32"].libs = [self._lib_name("pcre2-32")] + if not self.options.shared: + self.cpp_info.components["pcre2-32"].defines.append("PCRE2_STATIC") + + 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.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. + if self.options.with_zlib: + self.cpp_info.components["pcre2-8"].requires.append("zlib::zlib") + if self.options.with_bzip2: + self.cpp_info.components["pcre2-8"].requires.append("bzip2::bzip2") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generator removed + self.cpp_info.names["cmake_find_package"] = "PCRE2" + self.cpp_info.names["cmake_find_package_multi"] = "PCRE2" + self.cpp_info.names["pkg_config"] = "libpcre2" + if self.options.build_pcre2_8: + self.cpp_info.components["pcre2-8"].names["cmake_find_package"] = "8BIT" + self.cpp_info.components["pcre2-8"].names["cmake_find_package_multi"] = "8BIT" + self.cpp_info.components["pcre2-posix"].names["cmake_find_package"] = "POSIX" + self.cpp_info.components["pcre2-posix"].names["cmake_find_package_multi"] = "POSIX" + if self.options.build_pcre2_16: + self.cpp_info.components["pcre2-16"].names["cmake_find_package"] = "16BIT" + self.cpp_info.components["pcre2-16"].names["cmake_find_package_multi"] = "16BIT" + if self.options.build_pcre2_32: + self.cpp_info.components["pcre2-32"].names["cmake_find_package"] = "32BIT" + self.cpp_info.components["pcre2-32"].names["cmake_find_package_multi"] = "32BIT" + + def _lib_name(self, name): + libname = name + if Version(self.version) >= "10.38" and is_msvc(self) and not self.options.shared: + libname += "-static" + if self.settings.os == "Windows": + if self.settings.build_type == "Debug": + libname += "d" + if self.settings.compiler == "gcc" and self.options.shared: + libname += ".dll" + return libname diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch new file mode 100644 index 0000000000000..c4932b9175ed2 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -83,13 +83,13 @@ + # 2018-06-19 PH added checks for stdint.h and inttypes.h + # 2018-06-27 PH added Daniel's patch to increase the stack for MSVC + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.0 to support newer add_test features. Set policy + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) + CMAKE_POLICY(SET CMP0026 OLD) ++PROJECT(PCRE2 C) + + SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake + diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch new file mode 100644 index 0000000000000..a2ac76a61927b --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,10 +86,10 @@ + # 2018-11-16 PH added PCRE2GREP_SUPPORT_CALLOUT_FORK support and tidied + # 2019-02-16 PH hacked to avoid CMP0026 policy issue (see comments below) + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.0 to support newer add_test features. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch new file mode 100644 index 0000000000000..e09e604228494 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -93,10 +93,10 @@ + # 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator + # 2020-04-28 PH added function check for memfd_create based on Carlo's patch + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.0 to support newer add_test features. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch new file mode 100644 index 0000000000000..9990a60eb1c8f --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,10 +95,10 @@ + # 2020-05-25 PH added a check for Intel CET + # 2020-12-03 PH altered the definition of pcre2test as suggested by Daniel + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.5 to support GNUInstallDirs. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch new file mode 100644 index 0000000000000..a9d33c9057734 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,11 +100,11 @@ + # 2021-08-28 PH increased minimum version + # 2021-08-28 PH added test for realpath() + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.5 to support GNUInstallDirs. + # Increased minimum to 3.0.0 because older than 2.8.12 is deprecated. + CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/test_package/CMakeLists.txt b/recipes/pcre2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..016db5b530e0c --- /dev/null +++ b/recipes/pcre2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(PCRE2 REQUIRED 8BIT CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PCRE2::8BIT) diff --git a/recipes/pcre2/all/test_package/conanfile.py b/recipes/pcre2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pcre2/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/pcre2/all/test_package/test_package.c b/recipes/pcre2/all/test_package/test_package.c new file mode 100644 index 0000000000000..9f42714f4f8da --- /dev/null +++ b/recipes/pcre2/all/test_package/test_package.c @@ -0,0 +1,34 @@ +#include +#include +#include + +#define PCRE2_CODE_UNIT_WIDTH 8 +#include + + +int main() { + pcre2_code *re; + int rc; + PCRE2_SIZE erroffset; + int errcode; + PCRE2_SIZE* ovector; + const char *pattern = "\\w+"; + size_t pattern_size = strlen(pattern); + const char *subject = "conan"; + size_t subject_size = strlen(subject); + uint32_t options = 0; + pcre2_match_data *match_data; + uint32_t ovecsize = 128; + + re = pcre2_compile(pattern, pattern_size, options, &errcode, &erroffset, NULL); + match_data = pcre2_match_data_create(ovecsize, NULL); + rc = pcre2_match(re, subject, subject_size, 0, options, match_data, NULL); + ovector = pcre2_get_ovector_pointer(match_data); + PCRE2_SPTR start = subject + ovector[0]; + PCRE2_SIZE slen = ovector[1] - ovector[0]; + printf("match: %.*s\n", (int)slen, (char *)start ); + pcre2_match_data_free(match_data); + pcre2_code_free(re); + + return EXIT_SUCCESS; +} diff --git a/recipes/pcre2/all/test_v1_package/CMakeLists.txt b/recipes/pcre2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pcre2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pcre2/all/test_v1_package/conanfile.py b/recipes/pcre2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pcre2/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/pcre2/config.yml b/recipes/pcre2/config.yml new file mode 100644 index 0000000000000..f488a0ecff8cb --- /dev/null +++ b/recipes/pcre2/config.yml @@ -0,0 +1,17 @@ +versions: + "10.42": + folder: all + "10.40": + folder: all + "10.39": + folder: all + "10.37": + folder: all + "10.36": + folder: all + "10.35": + folder: all + "10.33": + folder: all + "10.32": + folder: all diff --git a/recipes/pdal/all/CMakeLists.txt b/recipes/pdal/all/CMakeLists.txt new file mode 100644 index 0000000000000..974652d0aae1b --- /dev/null +++ b/recipes/pdal/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +find_package(Boost REQUIRED filesystem) + +add_subdirectory("source_subfolder") diff --git a/recipes/pdal/all/conandata.yml b/recipes/pdal/all/conandata.yml new file mode 100644 index 0000000000000..fdb57cb0833f5 --- /dev/null +++ b/recipes/pdal/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "2.3.0": + url: "https://github.com/PDAL/PDAL/releases/download/2.3.0/PDAL-2.3.0-src.tar.bz2" + sha256: "63d8d4fee491675f0fa3dca58c26d57fb2afcaa37c24b10f595b3fbff174996e" + "2.2.0": + url: "https://github.com/PDAL/PDAL/releases/download/2.2.0/PDAL-2.2.0-src.tar.bz2" + sha256: "7f6406d8f6536701f28f215d7b77c2c476f2fa100c1a391ebbcc868210114273" +patches: + "2.3.0": + - patch_file: "patches/0001-cmakelists.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-cmake-deps-2.3.0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-vendor-nanoflann.patch" + base_path: "source_subfolder" + "2.2.0": + - patch_file: "patches/0001-cmakelists.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-cmake-deps-2.2.0.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-stdexcept.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-cstdlib.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-vendor-nanoflann.patch" + base_path: "source_subfolder" + - patch_file: "patches/0006-pointview.patch" + base_path: "source_subfolder" diff --git a/recipes/pdal/all/conanfile.py b/recipes/pdal/all/conanfile.py new file mode 100644 index 0000000000000..863224e39f2ff --- /dev/null +++ b/recipes/pdal/all/conanfile.py @@ -0,0 +1,283 @@ +from conan.tools.microsoft import msvc_runtime_flag +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration +import functools +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class PdalConan(ConanFile): + name = "pdal" + description = "PDAL is Point Data Abstraction Library. GDAL for point cloud data." + topics = ("pdal", "gdal", "point-cloud-data", "lidar") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pdal.io" + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_unwind": [True, False], + "with_xml": [True, False], + "with_lazperf": [True, False], + "with_laszip": [True, False], + "with_zlib": [True, False], + "with_lzma": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "with_unwind": False, + "with_xml": True, + "with_lazperf": False, # TODO: should be True + "with_laszip": True, + "with_zlib": True, + "with_lzma": False, + "with_zstd": True, + } + + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_unwind + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + # TODO package improvements: + # - switch from vendored arbiter (not in CCI). disabled openssl and curl are deps of arbiter + # - switch from vendor/nlohmann to nlohmann_json (in CCI) + self.requires("boost/1.78.0") + self.requires("eigen/3.4.0") + self.requires("gdal/3.4.1") + self.requires("libcurl/7.80.0") # mandatory dependency of arbiter (to remove if arbiter is unvendored) + self.requires("libgeotiff/1.7.1") + self.requires("nanoflann/1.4.2") + if self.options.with_xml: + self.requires("libxml2/2.9.13") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + if self.options.with_laszip: + self.requires("laszip/3.4.3") + if self.options.with_zlib: + self.requires("zlib/1.2.12") + if self.options.with_lzma: + self.requires("xz_utils/5.2.5") + if self.options.get_safe("with_unwind"): + self.requires("libunwind/1.6.2") + + @property + def _required_boost_components(self): + return ["filesystem"] + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < 5: + raise ConanInvalidConfiguration ("This compiler version is unsupported") + if self.options.shared and self._is_msvc and "MT" in msvc_runtime_flag(self): + raise ConanInvalidConfiguration("pdal shared doesn't support MT runtime with Visual Studio") + 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))) + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("pdal doesn't support cross-build yet") + if self.options.with_lazperf: + raise ConanInvalidConfiguration("lazperf recipe not yet available in CCI") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["PDAL_BUILD_STATIC"] = not self.options.shared + cmake.definitions["WITH_TESTS"] = False + cmake.definitions["WITH_LAZPERF"] = self.options.with_lazperf + cmake.definitions["WITH_LASZIP"] = self.options.with_laszip + cmake.definitions["WITH_STATIC_LASZIP"] = True # doesn't really matter but avoids to inject useless definition + cmake.definitions["WITH_ZSTD"] = self.options.with_zstd + cmake.definitions["WITH_ZLIB"] = self.options.with_zlib + cmake.definitions["WITH_LZMA"] = self.options.with_lzma + # disable plugin that requires postgresql + cmake.definitions["BUILD_PLUGIN_PGPOINTCLOUD"] = False + cmake.configure() + return cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + # drop conflicting CMake files + # LASzip works fine + for module in ("ZSTD", "ICONV", "GeoTIFF", "Curl"): + os.remove(os.path.join(self._source_subfolder, "cmake", "modules", "Find"+module+".cmake")) + + top_cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") + util_cmakelists = os.path.join(self._source_subfolder, "pdal", "util", "CMakeLists.txt") + + # disabling libxml2 support is only done via patching + if not self.options.with_xml: + tools.replace_in_file(top_cmakelists, "include(${PDAL_CMAKE_DIR}/libxml2.cmake)", "") + # disabling libunwind support is only done via patching + if not self.options.get_safe("with_unwind", False): + tools.replace_in_file(util_cmakelists, "include(${PDAL_CMAKE_DIR}/unwind.cmake)", "") + # remove vendored eigen + tools.rmdir(os.path.join(self._source_subfolder, "vendor", "eigen")) + # remove vendored nanoflann. include path is patched + tools.rmdir(os.path.join(self._source_subfolder, "vendor", "nanoflann")) + # remove vendored boost + tools.rmdir(os.path.join(self._source_subfolder, "vendor", "pdalboost")) + tools.replace_in_file(top_cmakelists, "add_subdirectory(vendor/pdalboost)", "") + tools.replace_in_file(util_cmakelists, "${PDAL_BOOST_LIB_NAME}", "Boost::filesystem") + tools.replace_in_file(os.path.join(self._source_subfolder, "pdal", "util", "FileUtils.cpp"), + "pdalboost::", "boost::") + # No rpath manipulation + tools.replace_in_file(top_cmakelists, "include(${PDAL_CMAKE_DIR}/rpath.cmake)", "") + # No reexport + tools.replace_in_file(top_cmakelists, + "set(PDAL_REEXPORT \"-Wl,-reexport_library,$\")", + "") + # fix static build + if not self.options.shared: + tools.replace_in_file(top_cmakelists, "add_definitions(\"-DPDAL_DLL_EXPORT=1\")", "") + tools.replace_in_file(top_cmakelists, + "${PDAL_BASE_LIB_NAME} ${PDAL_UTIL_LIB_NAME}", + "${PDAL_BASE_LIB_NAME} ${PDAL_UTIL_LIB_NAME} ${PDAL_ARBITER_LIB_NAME} ${PDAL_KAZHDAN_LIB_NAME}") + tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "macros.cmake"), + " install(TARGETS ${_name}", + " endif()\n if (PDAL_LIB_TYPE STREQUAL \"STATIC\" OR NOT ${_library_type} STREQUAL \"STATIC\")\n install(TARGETS ${_name}") + tools.replace_in_file(util_cmakelists, + "PDAL_ADD_FREE_LIBRARY(${PDAL_UTIL_LIB_NAME} SHARED ${PDAL_UTIL_SOURCES})", + "PDAL_ADD_FREE_LIBRARY(${PDAL_UTIL_LIB_NAME} ${PDAL_LIB_TYPE} ${PDAL_UTIL_SOURCES})") + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "pdal-config*") + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_vars_file) + ) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_target_file), + { + f"{self._pdal_base_name}": f"PDAL::{self._pdal_base_name}", + "pdal_util": "PDAL::pdal_util", + } + ) + + def _create_cmake_module_variables(self, module_file): + pdal_version = tools.Version(self.version) + content = textwrap.dedent(f"""\ + set(PDAL_LIBRARIES {self._pdal_base_name} pdal_util) + set(PDAL_VERSION_MAJOR {pdal_version.major}) + set(PDAL_VERSION_MINOR {pdal_version.minor}) + set(PDAL_VERSION_PATCH {pdal_version.patch}) + """) + tools.save(module_file, content) + + @property + def _module_vars_file(self): + return os.path.join("lib", "cmake", "conan-official-{}-variables.cmake".format(self.name)) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_target_file(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + @property + def _pdal_base_name(self): + return "pdalcpp" if self.settings.os == "Windows" or tools.is_apple_os(self.settings.os) else "pdal_base" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PDAL") + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_file]) + self.cpp_info.set_property("pkg_config_name", "pdal") + + # pdal_base + self.cpp_info.components["pdal_base"].set_property("cmake_target_name", self._pdal_base_name) + self.cpp_info.components["pdal_base"].libs = [self._pdal_base_name] + if not self.options.shared: + self.cpp_info.components["pdal_base"].libs.extend(["pdal_arbiter", "pdal_kazhdan"]) + if self.settings.os == "Windows": + # dependency of pdal_arbiter + self.cpp_info.components["pdal_base"].system_libs.append("shlwapi") + self.cpp_info.components["pdal_base"].requires = [ + "pdal_util", "eigen::eigen", "gdal::gdal", "libcurl::libcurl", + "libgeotiff::libgeotiff", "nanoflann::nanoflann" + ] + if self.options.with_xml: + self.cpp_info.components["pdal_base"].requires.append("libxml2::libxml2") + if self.options.with_zstd: + self.cpp_info.components["pdal_base"].requires.append("zstd::zstd") + if self.options.with_laszip: + self.cpp_info.components["pdal_base"].requires.append("laszip::laszip") + if self.options.with_zlib: + self.cpp_info.components["pdal_base"].requires.append("zlib::zlib") + if self.options.with_lzma: + self.cpp_info.components["pdal_base"].requires.append("xz_utils::xz_utils") + + # pdal_util + self.cpp_info.components["pdal_util"].set_property("cmake_target_name", "pdal_util") + self.cpp_info.components["pdal_util"].libs = ["pdal_util"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["pdal_util"].system_libs.extend(["dl", "m"]) + self.cpp_info.components["pdal_util"].requires = ["boost::filesystem"] + if self.options.get_safe("with_unwind"): + self.cpp_info.components["pdal_util"].requires.append("libunwind::libunwind") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "PDAL" + self.cpp_info.names["cmake_find_package_multi"] = "PDAL" + self.cpp_info.components["pdal_base"].names["cmake_find_package"] = self._pdal_base_name + self.cpp_info.components["pdal_base"].names["cmake_find_package_multi"] = self._pdal_base_name + self.cpp_info.components["pdal_base"].build_modules["cmake_find_package"] = [ + self._module_target_file, self._module_vars_file, + ] + self.cpp_info.components["pdal_base"].build_modules["cmake_find_package_multi"] = [ + self._module_target_file, self._module_vars_file, + ] diff --git a/recipes/pdal/all/patches/0001-cmakelists.patch b/recipes/pdal/all/patches/0001-cmakelists.patch new file mode 100644 index 0000000000000..2448b3ca9127d --- /dev/null +++ b/recipes/pdal/all/patches/0001-cmakelists.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1496d7f97..d56481cb8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -139,7 +139,12 @@ include(${PDAL_CMAKE_DIR}/libxml2.cmake) + include(${PDAL_CMAKE_DIR}/dimension.cmake) + include(${PDAL_CMAKE_DIR}/arbiter.cmake) + include(${PDAL_CMAKE_DIR}/nlohmann.cmake) +-include(${PDAL_CMAKE_DIR}/openssl.cmake) # Optional ++# disable openssl support for arbiter ++#include(${PDAL_CMAKE_DIR}/openssl.cmake) # Optional ++ ++# Set aliases for widely used variables ++set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) ++set(LIBXML2_INCLUDE_DIR ${LibXml2_INCLUDE_DIR}) + + #------------------------------------------------------------------------------ + # generate the pdal_features.hpp header +@@ -270,7 +275,7 @@ target_include_directories(${PDAL_BASE_LIB_NAME} + ${PDAL_VENDOR_DIR}/eigen + ${PDAL_VENDOR_DIR}/pdalboost + ${LIBXML2_INCLUDE_DIR} +- ${ZSTD_INCLUDE_DIRS} ++ ${zstd_INCLUDE_DIRS} + ${NLOHMANN_INCLUDE_DIR} + ${GDAL_INCLUDE_DIR} + ${LASZIP_INCLUDE_DIR} +@@ -278,13 +283,13 @@ target_include_directories(${PDAL_BASE_LIB_NAME} + target_link_libraries(${PDAL_BASE_LIB_NAME} + PRIVATE + ${CMAKE_THREAD_LIBS_INIT} +- ${GDAL_LIBRARY} +- ${GEOTIFF_LIBRARY} ++ ${GDAL_LIBRARIES} ++ ${GeoTIFF_LIBRARY} + ${LASZIP_LIBRARY} + ${LIBXML2_LIBRARIES} + ${ZLIB_LIBRARIES} + ${LIBLZMA_LIBRARIES} +- ${ZSTD_LIBRARIES} ++ ${zstd_LIBRARIES} + ${WINSOCK_LIBRARY} + ${PDAL_REEXPORT} + ${PDAL_UTIL_LIB_NAME} diff --git a/recipes/pdal/all/patches/0002-cmake-deps-2.2.0.patch b/recipes/pdal/all/patches/0002-cmake-deps-2.2.0.patch new file mode 100644 index 0000000000000..677573723bb1a --- /dev/null +++ b/recipes/pdal/all/patches/0002-cmake-deps-2.2.0.patch @@ -0,0 +1,44 @@ +diff --git a/cmake/unwind.cmake b/cmake/unwind.cmake +index 460a43c15..aa4356070 100644 +--- a/cmake/unwind.cmake ++++ b/cmake/unwind.cmake +@@ -1,4 +1,4 @@ + # + # Unwind + # +-find_package(Libunwind QUIET) ++find_package(libunwind QUIET) +diff --git a/cmake/zstd.cmake b/cmake/zstd.cmake +index bfaa5b20e..afba1f5d8 100644 +--- a/cmake/zstd.cmake ++++ b/cmake/zstd.cmake +@@ -4,10 +4,10 @@ + option(WITH_ZSTD + "Build support for compression/decompression with Zstd." TRUE) + if (WITH_ZSTD) +- find_package(ZSTD QUIET) +- set_package_properties(ZSTD PROPERTIES TYPE ++ find_package(zstd QUIET) ++ set_package_properties(zstd PROPERTIES TYPE + PURPOSE "General compression support") +- if (ZSTD_FOUND) ++ if (zstd_FOUND) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} + "${ZSTD_STATIC_LIB}") + mark_as_advanced(CLEAR ZSTD_INCLUDE_DIRS) +diff --git a/pdal/util/CMakeLists.txt b/pdal/util/CMakeLists.txt +index db42c7f53..c28f08046 100644 +--- a/pdal/util/CMakeLists.txt ++++ b/pdal/util/CMakeLists.txt +@@ -9,9 +9,9 @@ endif() + include(${PDAL_CMAKE_DIR}/execinfo.cmake) + include(${PDAL_CMAKE_DIR}/unwind.cmake) + +-if(LIBUNWIND_FOUND) ++if(libunwind_FOUND) + set(BACKTRACE_SOURCE BacktraceUnwind.cpp) +- set(BACKTRACE_LIBRARIES ${LIBUNWIND_LIBRARIES}) ++ set(BACKTRACE_LIBRARIES ${libunwind_LIBRARIES}) + elseif(LIBEXECINFO_FOUND) + set(BACKTRACE_SOURCE BacktraceExecinfo.cpp) + set(BACKTRACE_LIBRARIES ${LIBEXECINFO_LIBRARIES}) diff --git a/recipes/pdal/all/patches/0002-cmake-deps-2.3.0.patch b/recipes/pdal/all/patches/0002-cmake-deps-2.3.0.patch new file mode 100644 index 0000000000000..c6bb356ccfc2c --- /dev/null +++ b/recipes/pdal/all/patches/0002-cmake-deps-2.3.0.patch @@ -0,0 +1,40 @@ +--- a/cmake/unwind.cmake ++++ b/cmake/unwind.cmake +@@ -3,6 +3,6 @@ + # + + set(FPHSA_NAME_MISMATCHED 1) # Suppress warnings, see https://cmake.org/cmake/help/v3.17/module/FindPackageHandleStandardArgs.html +-find_package(Libunwind QUIET) ++find_package(libunwind QUIET) + set(FPHSA_NAME_MISMATCHED 0) + +--- a/cmake/zstd.cmake ++++ b/cmake/zstd.cmake +@@ -4,10 +4,10 @@ + option(WITH_ZSTD + "Build support for compression/decompression with Zstd." TRUE) + if (WITH_ZSTD) +- find_package(ZSTD QUIET) +- set_package_properties(ZSTD PROPERTIES TYPE ++ find_package(zstd QUIET) ++ set_package_properties(zstd PROPERTIES TYPE + PURPOSE "General compression support") +- if (ZSTD_FOUND) ++ if (zstd_FOUND) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} + "${ZSTD_STATIC_LIB}") + mark_as_advanced(CLEAR ZSTD_INCLUDE_DIRS) +--- a/pdal/util/CMakeLists.txt ++++ b/pdal/util/CMakeLists.txt +@@ -10,9 +10,9 @@ include(${PDAL_CMAKE_DIR}/execinfo.cmake) + include(${PDAL_CMAKE_DIR}/threads.cmake) + include(${PDAL_CMAKE_DIR}/unwind.cmake) + +-if(LIBUNWIND_FOUND) ++if(libunwind_FOUND) + set(BACKTRACE_SOURCE BacktraceUnwind.cpp) +- set(BACKTRACE_LIBRARIES ${LIBUNWIND_LIBRARIES}) ++ set(BACKTRACE_LIBRARIES ${libunwind_LIBRARIES}) + elseif(LIBEXECINFO_FOUND) + set(BACKTRACE_SOURCE BacktraceExecinfo.cpp) + set(BACKTRACE_LIBRARIES ${LIBEXECINFO_LIBRARIES}) diff --git a/recipes/pdal/all/patches/0003-stdexcept.patch b/recipes/pdal/all/patches/0003-stdexcept.patch new file mode 100644 index 0000000000000..ad296ad08b60e --- /dev/null +++ b/recipes/pdal/all/patches/0003-stdexcept.patch @@ -0,0 +1,14 @@ +Forwared to upstream and fixed in pdal>2.2.0 +--- +diff --git a/pdal/util/Bounds.hpp b/pdal/util/Bounds.hpp +index 7d9e60b64..f40731f16 100644 +--- a/pdal/util/Bounds.hpp ++++ b/pdal/util/Bounds.hpp +@@ -36,6 +36,7 @@ + + #include + #include ++#include + + #include "pdal_util_export.hpp" + diff --git a/recipes/pdal/all/patches/0004-cstdlib.patch b/recipes/pdal/all/patches/0004-cstdlib.patch new file mode 100644 index 0000000000000..20d0117036c80 --- /dev/null +++ b/recipes/pdal/all/patches/0004-cstdlib.patch @@ -0,0 +1,14 @@ +Forwared to upstream and fixed in pdal>2.2.0 +--- +diff --git a/filters/private/expr/Lexer.cpp b/filters/private/expr/Lexer.cpp +index 0c3dbe6b3..854d4c693 100644 +--- a/filters/private/expr/Lexer.cpp ++++ b/filters/private/expr/Lexer.cpp +@@ -1,6 +1,7 @@ + + #include + #include ++#include + + #include "Lexer.hpp" + diff --git a/recipes/pdal/all/patches/0005-vendor-nanoflann.patch b/recipes/pdal/all/patches/0005-vendor-nanoflann.patch new file mode 100644 index 0000000000000..5b4e3055556c4 --- /dev/null +++ b/recipes/pdal/all/patches/0005-vendor-nanoflann.patch @@ -0,0 +1,13 @@ +diff --git a/pdal/private/KDImpl.hpp b/pdal/private/KDImpl.hpp +index 473ffba36..3617c4f4e 100644 +--- a/pdal/private/KDImpl.hpp ++++ b/pdal/private/KDImpl.hpp +@@ -34,7 +34,7 @@ + + #pragma once + +-#include ++#include + + namespace pdal + { diff --git a/recipes/pdal/all/patches/0006-pointview.patch b/recipes/pdal/all/patches/0006-pointview.patch new file mode 100644 index 0000000000000..4e44fbeab1229 --- /dev/null +++ b/recipes/pdal/all/patches/0006-pointview.patch @@ -0,0 +1,26 @@ +Adapted from vcpkg recipe +--- +diff --git a/pdal/PointView.hpp b/pdal/PointView.hpp +index 837cd25b8..ac9c8bbb6 100644 +--- a/pdal/PointView.hpp ++++ b/pdal/PointView.hpp +@@ -668,7 +668,7 @@ public: + + bool operator==(const PointViewIter& i) + { return m_id == i.m_id; } +- bool operator!=(const PointViewIter& i) ++ bool operator!=(const PointViewIter& i) const + { return m_id != i.m_id; } + bool operator<(const PointViewIter& i) + { return m_id < i.m_id; } +@@ -679,9 +679,7 @@ public: + bool operator>=(const PointViewIter& i) + { return m_id >= i.m_id; } + +- reference operator*() +- { return PointRef(*m_view, m_id); } +- const reference operator*() const ++ reference operator*() const + { return PointRef(*m_view, m_id); } + pointer operator->() + { return nullptr; } diff --git a/recipes/pdal/all/test_package/CMakeLists.txt b/recipes/pdal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b38ffb363410b --- /dev/null +++ b/recipes/pdal/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +# keep close to the upstream example docs +find_package(PDAL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${PDAL_LIBRARIES}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/pdal/all/test_package/conanfile.py b/recipes/pdal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pdal/all/test_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/pdal/all/test_package/test_package.cpp b/recipes/pdal/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..300c3da256480 --- /dev/null +++ b/recipes/pdal/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +int main() +{ + std::cout << pdal::Config::fullVersionString() << std::endl; + std::cout << pdal::Config::debugInformation() << std::endl; + + std::cout << "Available plugins:" << std::endl; + for (auto const &name : pdal::PluginManager::names()) { + std::cout << "- " << name << std::endl; + } + + return 0; +} diff --git a/recipes/pdal/config.yml b/recipes/pdal/config.yml new file mode 100644 index 0000000000000..1189a9f0d6328 --- /dev/null +++ b/recipes/pdal/config.yml @@ -0,0 +1,5 @@ +versions: + "2.3.0": + folder: all + "2.2.0": + folder: all diff --git a/recipes/pdcurses/all/CMakeLists.txt b/recipes/pdcurses/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/pdcurses/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/pdcurses/all/conandata.yml b/recipes/pdcurses/all/conandata.yml new file mode 100644 index 0000000000000..7dc87815ef432 --- /dev/null +++ b/recipes/pdcurses/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.9": + url: "https://github.com/wmcbrine/PDCurses/archive/3.9.tar.gz" + sha256: "590dbe0f5835f66992df096d3602d0271103f90cf8557a5d124f693c2b40d7ec" diff --git a/recipes/pdcurses/all/conanfile.py b/recipes/pdcurses/all/conanfile.py new file mode 100644 index 0000000000000..c9fb1fa9f32f7 --- /dev/null +++ b/recipes/pdcurses/all/conanfile.py @@ -0,0 +1,149 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanException, ConanInvalidConfiguration +import os +import re + + +class PDCursesConan(ConanFile): + name = "pdcurses" + description = "PDCurses - a curses library for environments that don't fit the termcap/terminfo model" + topics = ("conan", "pdcurses", "curses", "ncurses") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pdcurses.org/" + license = "Unlicense", "MITX", "CC-BY-4.0", "GPL", "FSFUL" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_widec": [True, False], + "with_sdl": [None, "1", "2"], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_widec": False, + "with_sdl": None, + } + + _autotools = None + + @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 + if self.settings.os not in ("FreeBSD", "Linux"): + del self.options.enable_widec + + def configure(self): + if tools.is_apple_os(self.settings.os): + raise ConanInvalidConfiguration("pdcurses does not support Apple") + if self.options.with_sdl: + raise ConanInvalidConfiguration("conan-center-index has no packages for sdl (yet)") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def requirements(self): + if self.settings.os in ("FreeBSD", "Linux"): + self.requires("xorg/system") + + def build_requirements(self): + if self.settings.compiler != "Visual Studio": + self.build_requires("make/4.2.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("PDCurses-{}".format(self.version), self._source_subfolder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + conf_args = [ + "--enable-shared" if self.options.shared else "--disable-shared", + "--enable-widec" if self.options.enable_widec else "--disable-widec", + ] + self._autotools.configure(args=conf_args) + return self._autotools + + def _build_windows(self): + with tools.chdir(os.path.join(self._source_subfolder, "wincon")): + args = [] + if self.options.shared: + args.append("DLL=Y") + args = " ".join(args) + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + self.run("nmake -f Makefile.vc {}".format(args)) + else: + self.run("{} libs {}".format(os.environ["CONAN_MAKE_PROGRAM"], args)) + + def _patch_sources(self): + if self.settings.compiler == "Visual Studio": + tools.replace_in_file(os.path.join(self._source_subfolder, "wincon", "Makefile.vc"), + "$(CFLAGS)", + "$(CFLAGS) -{}".format(self.settings.compiler.runtime)) + tools.replace_in_file(os.path.join(self._source_subfolder, "x11", "Makefile.in"), + "$(INSTALL) -c -m 644 $(osdir)/libXCurses.a $(libdir)/libXCurses.a", + "-$(INSTALL) -c -m 644 $(osdir)/libXCurses.a $(libdir)/libXCurses.a") + tools.replace_in_file(os.path.join(self._source_subfolder, "x11", "Makefile.in"), + "\nall:\t", + "\nall:\t{}\t#".format("@SHL_TARGETS@" if self.options.shared else "$(LIBCURSES)")) + + def build(self): + self._patch_sources() + if self.settings.os == "Windows": + self._build_windows() + else: + with tools.chdir(os.path.join(self._source_subfolder, "x11")): + autotools = self._configure_autotools() + autotools.make() + + @property + def _subsystem_folder(self): + return { + "Windows": "wincon", + }.get(str(self.settings.os), "x11") + + @property + def _license_text(self): + readme = tools.load(os.path.join(self._source_subfolder, self._subsystem_folder, "README.md")) + match = re.search(r"Distribution Status\n[\-]+(?:[\r\n])+((?:[0-9a-z .,;*]+[\r\n])+)", readme, + re.IGNORECASE | re.MULTILINE) + if not match: + raise ConanException("Cannot extract distribution status") + return match.group(1).strip() + "\n" + + def package(self): + tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + + if self.settings.os == "Windows": + self.copy(pattern="curses.h", src=self._source_subfolder, dst="include") + self.copy(pattern="*.dll", dst="bin", keep_path=False) + self.copy(pattern="*.lib", dst="lib", keep_path=False) + self.copy(pattern="*.a", dst="lib", keep_path=False) + + if self.settings.compiler != "Visual Studio": + os.rename(os.path.join(self.package_folder, "lib", "pdcurses.a"), + os.path.join(self.package_folder, "lib", "libpdcurses.a")) + else: + with tools.chdir(os.path.join(self._source_subfolder, "x11")): + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "bin")) + + def package_info(self): + if self.settings.os == "Windows": + self.cpp_info.libs = ["pdcurses"] + elif self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.includedirs.append(os.path.join("include", "xcurses")) + self.cpp_info.libs = ["XCurses"] diff --git a/recipes/pdcurses/all/test_package/CMakeLists.txt b/recipes/pdcurses/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/pdcurses/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/pdcurses/all/test_package/conanfile.py b/recipes/pdcurses/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4aebe114eeb59 --- /dev/null +++ b/recipes/pdcurses/all/test_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" + + 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/pdcurses/all/test_package/test_package.c b/recipes/pdcurses/all/test_package/test_package.c new file mode 100644 index 0000000000000..4f8fba7d80a6d --- /dev/null +++ b/recipes/pdcurses/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "curses.h" + +#include +#include + +int main() +{ + printf("PDCurses version %s\n", curses_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/pdcurses/config.yml b/recipes/pdcurses/config.yml new file mode 100644 index 0000000000000..0e141012b0ca6 --- /dev/null +++ b/recipes/pdcurses/config.yml @@ -0,0 +1,3 @@ +versions: + "3.9": + folder: all diff --git a/recipes/pdfgen/all/CMakeLists.txt b/recipes/pdfgen/all/CMakeLists.txt new file mode 100644 index 0000000000000..7f6aaaf0116da --- /dev/null +++ b/recipes/pdfgen/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(pdfgen LANGUAGES C) + +add_library(pdfgen ${PDFGEN_SRC_DIR}/pdfgen.c) +set_target_properties(pdfgen PROPERTIES + PUBLIC_HEADER ${PDFGEN_SRC_DIR}/pdfgen.h + WINDOWS_EXPORT_ALL_SYMBOLS ON + C_EXTENSIONS OFF + C_STANDARD 99 +) + +include(GNUInstallDirs) + +install( + TARGETS pdfgen + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/pdfgen/all/conandata.yml b/recipes/pdfgen/all/conandata.yml new file mode 100644 index 0000000000000..cdaa13edf4bdb --- /dev/null +++ b/recipes/pdfgen/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/AndreRenaud/PDFGen/archive/refs/tags/0.1.0.tar.gz" + sha256: "606f6dfab90e80ccb21bab558351c783e3791dc85217ada766c1aa352917aea8" diff --git a/recipes/pdfgen/all/conanfile.py b/recipes/pdfgen/all/conanfile.py new file mode 100644 index 0000000000000..d690844af85f7 --- /dev/null +++ b/recipes/pdfgen/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class PdfgenConan(ConanFile): + name = "pdfgen" + description = "Simple C PDF Writer/Generation library" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AndreRenaud/PDFGen" + topics = ("pdf", "generation") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports_sources = ["CMakeLists.txt"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PDFGEN_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["pdfgen"] diff --git a/recipes/pdfgen/all/test_package/CMakeLists.txt b/recipes/pdfgen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e3c8b32c96da --- /dev/null +++ b/recipes/pdfgen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(pdfgen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pdfgen::pdfgen) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/pdfgen/all/test_package/conanfile.py b/recipes/pdfgen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/pdfgen/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pdfgen/all/test_package/test_package.c b/recipes/pdfgen/all/test_package/test_package.c new file mode 100644 index 0000000000000..097335494c13b --- /dev/null +++ b/recipes/pdfgen/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "pdfgen.h" + +int main() { + struct pdf_info info = { + .creator = "My software", + .producer = "My software", + .title = "My document", + .author = "My name", + .subject = "My subject", + .date = "Today" + }; + struct pdf_doc *pdf = pdf_create(PDF_A4_WIDTH, PDF_A4_HEIGHT, &info); + + pdf_destroy(pdf); + + return 0; +} diff --git a/recipes/pdfgen/all/test_v1_package/CMakeLists.txt b/recipes/pdfgen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/pdfgen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pdfgen/all/test_v1_package/conanfile.py b/recipes/pdfgen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/pdfgen/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pdfgen/config.yml b/recipes/pdfgen/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/pdfgen/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/pdfium/all/CMakeLists.txt b/recipes/pdfium/all/CMakeLists.txt new file mode 100644 index 0000000000000..f083cc38ef65c --- /dev/null +++ b/recipes/pdfium/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(pdfium-cmake/cmake) diff --git a/recipes/pdfium/all/conandata.yml b/recipes/pdfium/all/conandata.yml new file mode 100644 index 0000000000000..06bb1b45201c1 --- /dev/null +++ b/recipes/pdfium/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "cci.20210730": + pdfium-cmake: + # FIXME: create release + use hash + url: "https://github.com/madebr/pdfium-cmake/archive/0abc6ac8b3ecd2faac45bf46ee79bf381b5b5890.zip" + sha256: "8bcbb1eb6ec171604d669585f289c609d3b6c95045525d0e510c3fee7851d44e" + pdfium: + url: "https://pdfium.googlesource.com/pdfium/+archive/6c8cd905587809a0ff299d1edb34fc85bed4c976.tar.gz" + # sha256 is volatile on googlesource, no up-to-date github fork + trace_event: + url: "https://chromium.googlesource.com/chromium/src/base/trace_event/common/+archive/ad56859ef8c85cc09a3d8e95dcedadb5109a0af8.tar.gz" + # sha256 is volatile on googlesource, no up-to-date github fork + chromium_build: + url: "https://chromium.googlesource.com/chromium/src/build/+archive/95667421554b672f9330df8efb8148b6c2d00594.tar.gz" + # sha256 is volatile on googlesource, no up-to-date github fork diff --git a/recipes/pdfium/all/conanfile.py b/recipes/pdfium/all/conanfile.py new file mode 100644 index 0000000000000..e8af8fb6f31c4 --- /dev/null +++ b/recipes/pdfium/all/conanfile.py @@ -0,0 +1,107 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PdfiumConan(ConanFile): + name = "pdfium" + description = "PDF generation and rendering library." + license = "BSD-3-Clause" + topics = ("conan", "pdfium", "generate", "generation", "rendering", "pdf", "document", "print") + homepage = "https://opensource.google/projects/pdfium" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libjpeg": "libjpeg", + } + + exports_sources = "CMakeLists.txt" + generators = "cmake", "cmake_find_package", "pkg_config" + short_paths = True + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("freetype/2.10.4") + self.requires("icu/69.1") + self.requires("lcms/2.11") + self.requires("openjpeg/2.4.0") + if self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9d") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.0") + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 14) + minimum_compiler_versions = { + "gcc": 8, + "Visual Studio": 15, + } + min_compiler_version = minimum_compiler_versions.get(str(self.settings.compiler)) + if min_compiler_version: + if tools.Version(self.settings.compiler.version) < min_compiler_version: + raise ConanInvalidConfiguration("pdfium needs at least compiler version {}".format(min_compiler_version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]["pdfium-cmake"], + destination="pdfium-cmake", strip_root=True) + tools.get(**self.conan_data["sources"][self.version]["pdfium"], + destination=self._source_subfolder) + tools.get(**self.conan_data["sources"][self.version]["trace_event"], + destination=os.path.join(self._source_subfolder, "base", "trace_event", "common")) + tools.get(**self.conan_data["sources"][self.version]["chromium_build"], + destination=os.path.join(self._source_subfolder, "build")) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["PDFIUM_ROOT"] = os.path.join(self.source_folder, self._source_subfolder).replace("\\", "/") + self._cmake.definitions["PDF_LIBJPEG_TURBO"] = self.options.with_libjpeg == "libjpeg-turbo" + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + cmake.configure() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["pdfium"] + if tools.is_apple_os(self.settings.os): + self.cpp_info.frameworks.extend(["Appkit", "CoreFoundation", "CoreGraphics"]) + + stdcpp_library = tools.stdcpp_library(self) + if stdcpp_library: + self.cpp_info.system_libs.append(stdcpp_library) diff --git a/recipes/pdfium/all/test_package/CMakeLists.txt b/recipes/pdfium/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/pdfium/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/pdfium/all/test_package/conanfile.py b/recipes/pdfium/all/test_package/conanfile.py new file mode 100644 index 0000000000000..32e61b0a20959 --- /dev/null +++ b/recipes/pdfium/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pdfium/all/test_package/test_package.c b/recipes/pdfium/all/test_package/test_package.c new file mode 100644 index 0000000000000..d24c2186091b2 --- /dev/null +++ b/recipes/pdfium/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include "fpdfview.h" + +int main() { + FPDF_InitLibrary(); + FPDF_DestroyLibrary(); + return 0; +} diff --git a/recipes/pdfium/config.yml b/recipes/pdfium/config.yml new file mode 100644 index 0000000000000..a851713f93a20 --- /dev/null +++ b/recipes/pdfium/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210730": + folder: all diff --git a/recipes/pdqsort/all/conandata.yml b/recipes/pdqsort/all/conandata.yml new file mode 100644 index 0000000000000..ad55de6e7ed19 --- /dev/null +++ b/recipes/pdqsort/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210314": + url: "https://github.com/orlp/pdqsort/archive/b1ef26a55cdb60d236a5cb199c4234c704f46726.zip" + sha256: "1d3233bb341d70db17006487a53602b2b1596a5ba8fd496001610a30af066060" diff --git a/recipes/pdqsort/all/conanfile.py b/recipes/pdqsort/all/conanfile.py new file mode 100644 index 0000000000000..c6b4987b3d5ef --- /dev/null +++ b/recipes/pdqsort/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.50.0" + + +class PdqsortConan(ConanFile): + name = "pdqsort" + description = "Pattern-defeating quicksort." + license = "Zlib" + topics = ("pdqsort", "sort") + homepage = "https://github.com/orlp/pdqsort" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "pdqsort.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/pdqsort/all/test_package/CMakeLists.txt b/recipes/pdqsort/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5cfbb3202e0a --- /dev/null +++ b/recipes/pdqsort/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(pdqsort REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pdqsort::pdqsort) diff --git a/recipes/pdqsort/all/test_package/conanfile.py b/recipes/pdqsort/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/pdqsort/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/pdqsort/all/test_package/test_package.cpp b/recipes/pdqsort/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cd3fe658f6d2e --- /dev/null +++ b/recipes/pdqsort/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include + +int main() { + int v[10] = {3, -102, 4, 30, 432, -13531, -43, 1, 0, -3}; + + pdqsort(v, v + 10); + for (int i = 0; i < 10; ++i) { + std::cout << v[i] << ' '; + } + std::cout << std::endl; + + return 0; +} diff --git a/recipes/pdqsort/all/test_v1_package/CMakeLists.txt b/recipes/pdqsort/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..400c3982bde1a --- /dev/null +++ b/recipes/pdqsort/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pdqsort REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pdqsort::pdqsort) diff --git a/recipes/pdqsort/all/test_v1_package/conanfile.py b/recipes/pdqsort/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pdqsort/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/pdqsort/config.yml b/recipes/pdqsort/config.yml new file mode 100644 index 0000000000000..f68bd3d138f36 --- /dev/null +++ b/recipes/pdqsort/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210314": + folder: all diff --git a/recipes/perf/all/conandata.yml b/recipes/perf/all/conandata.yml new file mode 100644 index 0000000000000..72be9d8648e78 --- /dev/null +++ b/recipes/perf/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "5.13": + url: https://github.com/torvalds/linux/archive/refs/tags/v5.13.tar.gz + sha256: 9ce4c15b10d4dc9e353f3105dd11b9d2d2ef83e24772d68d3cf0830fe5f527a1 +patches: + "5.13": + - patch_file: patches/0001-Wno-strict-prototypes.patch + base_path: source_subfolder diff --git a/recipes/perf/all/conanfile.py b/recipes/perf/all/conanfile.py new file mode 100644 index 0000000000000..2b1346904f2b5 --- /dev/null +++ b/recipes/perf/all/conanfile.py @@ -0,0 +1,51 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class Perf(ConanFile): + name = "perf" + description = "Linux profiling with performance counters" + topics = ("linux", "profiling") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://perf.wiki.kernel.org/index.php" + license = "GPL-2.0 WITH Linux-syscall-note" + settings = "os", "compiler", "build_type", "arch" + exports_sources = "patches/*" + + @property + def _source_subfolder(self): + return "source_subfolder" + + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("perf is supported only on Linux") + + def build_requirements(self): + self.build_requires("flex/2.6.4") + self.build_requires("bison/3.5.3") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + autotools = AutoToolsBuildEnvironment(self) + with tools.chdir(os.path.join(self.build_folder, self._source_subfolder, "tools", "perf")): + vars=autotools.vars + vars["NO_LIBPYTHON"] = "1" + autotools.make(vars=vars) + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + self.copy("LICENSES/**", src=self._source_subfolder, dst="licenses") + + self.copy("perf", src=os.path.join(self._source_subfolder, "tools", "perf"), dst="bin") + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: %s" % bin_path) + self.env_info.PATH.append(bin_path) diff --git a/recipes/perf/all/patches/0001-Wno-strict-prototypes.patch b/recipes/perf/all/patches/0001-Wno-strict-prototypes.patch new file mode 100644 index 0000000000000..30af7d5941574 --- /dev/null +++ b/recipes/perf/all/patches/0001-Wno-strict-prototypes.patch @@ -0,0 +1,14 @@ +diff --git a/tools/perf/util/Build b/tools/perf/util/Build +--- tools/perf/util/Build ++++ tools/perf/util/Build +@@ -255,9 +255,9 @@ + + bison_flags := -DYYENABLE_NLS=0 + BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35) + ifeq ($(BISON_GE_35),1) +- bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum ++ bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum -Wno-strict-prototypes + else + bison_flags += -w + endif + CFLAGS_parse-events-bison.o += $(bison_flags) diff --git a/recipes/perf/all/test_package/conanfile.py b/recipes/perf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4001f8991b676 --- /dev/null +++ b/recipes/perf/all/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackage(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("perf version") diff --git a/recipes/perf/config.yml b/recipes/perf/config.yml new file mode 100644 index 0000000000000..86319c51bb244 --- /dev/null +++ b/recipes/perf/config.yml @@ -0,0 +1,3 @@ +versions: + "5.13": + folder: all diff --git a/recipes/perfetto/all/CMakeLists.txt b/recipes/perfetto/all/CMakeLists.txt new file mode 100644 index 0000000000000..9fc76922c46c1 --- /dev/null +++ b/recipes/perfetto/all/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.8) +project(perfetto LANGUAGES CXX) + +set(PUBLIC_HEADERS ${PERFETTO_SRC_DIR}/sdk/perfetto.h) + +add_library(perfetto ${PERFETTO_SRC_DIR}/sdk/perfetto.cc) +target_compile_features(perfetto PRIVATE ${PERFETTO_CXX_STANDARD}) +set_target_properties(perfetto PROPERTIES + PUBLIC_HEADER "${PUBLIC_HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) + +if(PERFETTO_DISABLE_LOGGING) + target_compile_definitions(perfetto PUBLIC PERFETTO_DISABLE_LOG) +endif() + +if (WIN32) + # Disable legacy features in windows.h. + target_compile_definitions(perfetto PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) + # On Windows we should link to WinSock2. + target_link_libraries(perfetto PRIVATE ws2_32) +endif (WIN32) + +if (MSVC) + # The perfetto library contains many symbols, so it needs the big object + # format. + target_compile_options(perfetto PRIVATE "/bigobj") + # The perfetto library needs permissive flag on MSVC + target_compile_options(perfetto PRIVATE "/permissive-") + # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ + target_compile_options(perfetto PRIVATE "/Zc:__cplusplus") +endif (MSVC) + +include(GNUInstallDirs) +install( + TARGETS perfetto + 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/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml new file mode 100644 index 0000000000000..2fbc0e9ee87b3 --- /dev/null +++ b/recipes/perfetto/all/conandata.yml @@ -0,0 +1,60 @@ +sources: + "34.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v34.0.tar.gz" + sha256: "81dbf2fac446a0389c80e309b2060dcccd926012ce2a61621a47e3e432aee8c1" + "32.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v32.1.tar.gz" + sha256: "0d1088b4758b3d5f3813178c6de22386329d42407d23aa1479f20dce96e49d78" + "31.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v31.0.tar.gz" + sha256: "544c68293590f53391ea4267d5a9b1a4594e1c8216fc5f5ce9d0f1227797922e" + "30.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v30.0.tar.gz" + sha256: "d1883793a2adb2a4105fc083478bf781badd566d72da45caa99095b61f938a2e" + "27.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v27.1.tar.gz" + sha256: "9edbafd6e2d9feaced4c0153e2f48dbb1da38429c5b1b17dfee70a91fd3101b2" + "27.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v27.0.tar.gz" + sha256: "c22750dd21419cf58132d55d634b88d9947bd0c7244dd98854b0248c7637a98c" + "26.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v26.1.tar.gz" + sha256: "cce387e82e2a137fce2eba927f80f20407764b77637a1a92b9b24065a500ce6d" + "25.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v25.0.tar.gz" + sha256: "73a4b895df9222ddb231b8d903099d6da08cd079f27983f540e89156fa88ba67" + "24.2": + url: "https://github.com/google/perfetto/archive/refs/tags/v24.2.tar.gz" + sha256: "b296d0a939e694fd2e73ed6c6418b774b5ef6809ddf60988989416e5cbf90b41" + "23.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v23.0.tar.gz" + sha256: "9d2955736ce9d234e0f5153acfefea8facfa762c9167024902ea98f9010207aa" + "22.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v22.1.tar.gz" + sha256: "013ba743019a1ca04627f7ce8bf424b60ed7f0f57e232eff719ae879be4c90fd" + "22.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v22.0.tar.gz" + sha256: "c62e9059a566136665b0c69e1f9901fc747b1eca813cd59a76e941bc2772340c" + "21.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v21.0.tar.gz" + sha256: "8ce7d7c3dd8a2edd6d37092eb139e11bbf9c7e33a9964bab96c0505def6e1ad4" + "20.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v20.1.tar.gz" + sha256: "d681bb76e2b73e6ba46db53c1502f31f4f16c36cd6e91d4ae839a3b44272f646" +patches: + "31.0": + - patch_file: "patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch" + patch_description: "Fix compilation on MSVC" + patch_type: "backport" + patch_source: "https://android-review.googlesource.com/c/platform/external/perfetto/+/2355222" + sha256: "ad253a9bba3941bd8d1f206422d60eb1c06cb6d75d60eff5b5b8ae0f2ec7e15c" + "25.0": + - patch_file: "patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch" + "22.1": + - patch_file: "patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" + "22.0": + - patch_file: "patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" + "21.0": + - patch_file: "patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" + "20.1": + - patch_file: "patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" diff --git a/recipes/perfetto/all/conanfile.py b/recipes/perfetto/all/conanfile.py new file mode 100644 index 0000000000000..44d0edf055cd6 --- /dev/null +++ b/recipes/perfetto/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 CMake, 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 PerfettoConan(ConanFile): + name = "perfetto" + license = "Apache-2.0" + homepage = "https://perfetto.dev" + url = "https://github.com/conan-io/conan-center-index" + description = "Performance instrumentation and tracing for Android, Linux and Chrome" + topics = ("linux", "profiling", "tracing") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_logging": [True, False], # switches PERFETTO_DISABLE_LOG + } + default_options = { + "shared": False, + "fPIC": True, + "disable_logging": False, + } + + short_paths = True + + @property + def _minimum_cpp_standard(self): + return 11 if Version(self.version) < "31.0" else 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15" if Version(self.version) < "31.0" else "16", + "msvc": "190", + "gcc": "7", + "clang": "3.3" if Version(self.version) < "31.0" else "5", + "apple-clang": "5.0" if Version(self.version) < "31.0" else "9.1", + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = self.info.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 {compiler} {min_version}. The current compiler is {compiler} {compiler.version}." + ) + + 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["PERFETTO_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["PERFETTO_DISABLE_LOGGING"] = self.options.disable_logging + tc.variables["PERFETTO_CXX_STANDARD"] = f"cxx_std_{self._minimum_cpp_standard}" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["perfetto"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:__cplusplus") + diff --git a/recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch b/recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch new file mode 100644 index 0000000000000..27f4b089cd4fd --- /dev/null +++ b/recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch @@ -0,0 +1,14 @@ +diff --git a/sdk/perfetto.h b/sdk/perfetto.h +index a362342d0..d5fb9e997 100644 +--- a/sdk/perfetto.h ++++ b/sdk/perfetto.h +@@ -580,7 +580,8 @@ PERFETTO_EXPORT void LogMessage(LogLev, + __LINE__, ##__VA_ARGS__); \ + } while (0) + #elif defined(PERFETTO_DISABLE_LOG) +-#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__) ++#define PERFETTO_XLOG(level, fmt, ...) ::perfetto::base::ignore_result(level, \ ++ fmt, ##__VA_ARGS__) + #else + #define PERFETTO_XLOG(level, fmt, ...) \ + ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \ diff --git a/recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch b/recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch new file mode 100644 index 0000000000000..56e86bb66c9e9 --- /dev/null +++ b/recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch @@ -0,0 +1,14 @@ +diff --git a/sdk/perfetto.h b/sdk/perfetto.h +index 4509cbda5..7cd41d570 100644 +--- a/sdk/perfetto.h ++++ b/sdk/perfetto.h +@@ -622,7 +622,8 @@ inline void MaybeSerializeLastLogsForCrashReporting() {} + __LINE__, ##__VA_ARGS__); \ + } while (0) + #elif defined(PERFETTO_DISABLE_LOG) +-#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__) ++#define PERFETTO_XLOG(level, fmt, ...) ::perfetto::base::ignore_result(level, \ ++ fmt, ##__VA_ARGS__) + #else + #define PERFETTO_XLOG(level, fmt, ...) \ + ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \ diff --git a/recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch b/recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch new file mode 100644 index 0000000000000..5e4004e7ada01 --- /dev/null +++ b/recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch @@ -0,0 +1,14 @@ +diff --git a/sdk/perfetto.h b/sdk/perfetto.h +index f88ac9728..a242b37a4 100644 +--- a/sdk/perfetto.h ++++ b/sdk/perfetto.h +@@ -623,7 +623,8 @@ inline void MaybeSerializeLastLogsForCrashReporting() {} + __LINE__, ##__VA_ARGS__); \ + } while (0) + #elif defined(PERFETTO_DISABLE_LOG) +-#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__) ++#define PERFETTO_XLOG(level, fmt, ...) ::perfetto::base::ignore_result(level, \ ++ fmt, ##__VA_ARGS__) + #else + #define PERFETTO_XLOG(level, fmt, ...) \ + ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \ diff --git a/recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch b/recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch new file mode 100644 index 0000000000000..d109447e2946e --- /dev/null +++ b/recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch @@ -0,0 +1,13 @@ +diff --git a/sdk/perfetto.h b/sdk/perfetto.h +index 677e0e2..df0de12 100644 +--- a/sdk/perfetto.h ++++ b/sdk/perfetto.h +@@ -16140,7 +16140,7 @@ template <> + struct TraceTimestampTraits { + static inline TraceTimestamp ConvertTimestampToTraceTimeNs( + const uint64_t& timestamp) { +- return {internal::TrackEventInternal::GetClockId(), timestamp}; ++ return {static_cast(internal::TrackEventInternal::GetClockId()), timestamp}; + } + }; + diff --git a/recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch b/recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch new file mode 100644 index 0000000000000..0ad8e6cb604c6 --- /dev/null +++ b/recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch @@ -0,0 +1,19 @@ +diff --git a/sdk/perfetto.h b/sdk/perfetto.h +index 175c092..682cea7 100644 +--- a/sdk/perfetto.h ++++ b/sdk/perfetto.h +@@ -18090,8 +18090,9 @@ class TrackEventDataSource + } while (false) + + // C++17 doesn't like a move constructor being defined for the EventFinalizer +-// class but C++11 doesn't compile without it being defined so support both. +-#if PERFETTO_IS_AT_LEAST_CPP17() ++// class but C++11 and MSVC doesn't compile without it being defined so support ++// both. ++#if PERFETTO_IS_AT_LEAST_CPP17() && !PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC) + #define PERFETTO_INTERNAL_EVENT_FINALIZER_KEYWORD delete + #else + #define PERFETTO_INTERNAL_EVENT_FINALIZER_KEYWORD default +-- +2.24.3 (Apple Git-128) + diff --git a/recipes/perfetto/all/test_package/CMakeLists.txt b/recipes/perfetto/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ad42eab5529ea --- /dev/null +++ b/recipes/perfetto/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(perfetto REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(perfetto_VERSION VERSION_LESS "31.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() +target_link_libraries(${PROJECT_NAME} PRIVATE perfetto::perfetto) diff --git a/recipes/perfetto/all/test_package/conanfile.py b/recipes/perfetto/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/perfetto/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/perfetto/all/test_package/test_package.cpp b/recipes/perfetto/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b02829747a6db --- /dev/null +++ b/recipes/perfetto/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +int main(int argv, char** argc) { + perfetto::TracingInitArgs args; + + // The backends determine where trace events are recorded. You may select one + // or more of: + + // 1) The in-process backend only records within the app itself. + args.backends |= perfetto::kInProcessBackend; + + // 2) The system backend writes events into a system Perfetto daemon, + // allowing merging app and system events (e.g., ftrace) on the same + // timeline. Requires the Perfetto `traced` daemon to be running (e.g., + // on Android Pie and newer). + args.backends |= perfetto::kSystemBackend; + + perfetto::Tracing::Initialize(args); +} diff --git a/recipes/perfetto/all/test_v1_package/CMakeLists.txt b/recipes/perfetto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/perfetto/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/perfetto/all/test_v1_package/conanfile.py b/recipes/perfetto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/perfetto/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/perfetto/config.yml b/recipes/perfetto/config.yml new file mode 100644 index 0000000000000..0c134a6c0d779 --- /dev/null +++ b/recipes/perfetto/config.yml @@ -0,0 +1,29 @@ +versions: + "34.0": + folder: all + "32.1": + folder: all + "31.0": + folder: all + "30.0": + folder: all + "27.1": + folder: all + "27.0": + folder: all + "26.1": + folder: all + "25.0": + folder: all + "24.2": + folder: all + "23.0": + folder: all + "22.1": + folder: all + "22.0": + folder: all + "21.0": + folder: all + "20.1": + folder: all diff --git a/recipes/perlinnoise/all/conandata.yml b/recipes/perlinnoise/all/conandata.yml new file mode 100644 index 0000000000000..9b1218cce4fb3 --- /dev/null +++ b/recipes/perlinnoise/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + url: "https://github.com/Reputeless/PerlinNoise/archive/refs/tags/v3.0.0.tar.gz" + sha256: "1fea1e7ebeb3c66b79d60c2c398aa83ccfadcef343bd396c0f0a684380e827fc" diff --git a/recipes/perlinnoise/all/conanfile.py b/recipes/perlinnoise/all/conanfile.py new file mode 100644 index 0000000000000..5c27415325d35 --- /dev/null +++ b/recipes/perlinnoise/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class PerlinnoiseConan(ConanFile): + name = "perlinnoise" + description = "Header-only Perlin noise library for modern C++ " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Reputeless/PerlinNoise/" + topics = ("noise", "perlin", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compiler_required_cpp(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compiler_required_cpp.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.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{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 = [] + + self.cpp_info.set_property("cmake_file_name", "PerlinNoise") + self.cpp_info.set_property("cmake_target_name", "siv::PerlinNoise") + + self.cpp_info.components["siv"].set_property("cmake_target_name", "siv::PerlinNoise") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PerlinNoise" + self.cpp_info.filenames["cmake_find_package_multi"] = "PerlinNoise" + self.cpp_info.names["cmake_find_package"] = "siv" + self.cpp_info.names["cmake_find_package_multi"] = "siv" + + self.cpp_info.components["siv"].names["cmake_find_package"] = "PerlinNoise" + self.cpp_info.components["siv"].names["cmake_find_package_multi"] = "PerlinNoise" diff --git a/recipes/perlinnoise/all/test_package/CMakeLists.txt b/recipes/perlinnoise/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18878f56fc9d5 --- /dev/null +++ b/recipes/perlinnoise/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PerlinNoise REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE siv::PerlinNoise) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/perlinnoise/all/test_package/conanfile.py b/recipes/perlinnoise/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/perlinnoise/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/perlinnoise/all/test_package/test_package.cpp b/recipes/perlinnoise/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..082d3dfe07931 --- /dev/null +++ b/recipes/perlinnoise/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include "PerlinNoise.hpp" + +int main(int argc, const char** argv) { + auto frequency = 32.f; + auto octaves = 9; + auto seed = siv::PerlinNoise::seed_type{74524}; + + auto generator = siv::PerlinNoise{seed}; + + auto width = 32; + auto height = 16; + + auto fx = width / frequency; + auto fy = height / frequency; + + for (auto y = 0; y < height; ++y) { + for (auto x = 0; x < width; ++x) { + auto color = generator.octave2D(x / fx, y / fy, octaves); + std::cout << color << " "; + } + std::cout << std::endl; + } + + return 0; +} diff --git a/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt b/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/perlinnoise/all/test_v1_package/conanfile.py b/recipes/perlinnoise/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/perlinnoise/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/perlinnoise/config.yml b/recipes/perlinnoise/config.yml new file mode 100644 index 0000000000000..c6ac749e0b234 --- /dev/null +++ b/recipes/perlinnoise/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.0": + folder: all diff --git a/recipes/pexports/all/conandata.yml b/recipes/pexports/all/conandata.yml new file mode 100644 index 0000000000000..5b08eb793f8dc --- /dev/null +++ b/recipes/pexports/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.47": + url: "https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/pexports-0.47/pexports-0.47-mingw32-src.tar.xz/download" + sha256: "fe12853979bd7335aa771c934ddee913c987554f9dc11266262b7fd68e0aa884" +patches: + "0.47": + - patch_file: "patches/0001-add-help.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-MSVC-stack-overflow.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-fix-MSVC-x86.patch" + base_path: "source_subfolder" diff --git a/recipes/pexports/all/conanfile.py b/recipes/pexports/all/conanfile.py new file mode 100644 index 0000000000000..44edf44c3e48f --- /dev/null +++ b/recipes/pexports/all/conanfile.py @@ -0,0 +1,94 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import contextlib +import os + +required_conan_version = ">=1.33.0" + + +class PExportsConan(ConanFile): + name = "pexports" + description = "pexports is a program to extract exported symbols from a PE image (executable)." + homepage = "https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/" + license = "GPL-2.0-or-later" + topics = ("windows", "dll", "PE", "symbols", "import", "library") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + 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 configure(self): + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def build_requirements(self): + 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 package_id(self): + del self.info.settings.compiler + + def source(self): + filename = "pexports.tar.xz" + tools.get(**self.conan_data["sources"][self.version], filename=filename, + destination=self._source_subfolder, strip_root=True) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + @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._user_info_build["automake"].compile)), + "LD": "{} link -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), + } + with tools.environment_append(env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + host = build = None + if self.settings.compiler == "Visual Studio": + self._autotools.defines.append("YY_NO_UNISTD_H") + host = build = False + self._autotools.configure(configure_dir=self._source_subfolder, host=host, build=build) + return self._autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + + def package_info(self): + self.cpp_info.libdirs = [] + + 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/pexports/all/patches/0001-add-help.patch b/recipes/pexports/all/patches/0001-add-help.patch new file mode 100644 index 0000000000000..a210150e08d0b --- /dev/null +++ b/recipes/pexports/all/patches/0001-add-help.patch @@ -0,0 +1,32 @@ +--- pexports.c ++++ pexports.c +@@ -68,7 +68,7 @@ + IMAGE_SECTION_HEADER *section; + uint32_t exp_rva, exp_size; + int i; +- ++ int help = 0; + # if defined(_WIN32) && !defined(_WIN64) + /* + * If running on 64-bit Windows and built as a 32-bit process, try +@@ -106,7 +106,7 @@ + if (argv[i][0] == '-') + { + switch (argv[i][1]) +- { ++ { case 'H': help = 1; break; + case 'v': + verbose = 1; + break; +@@ -153,9 +153,9 @@ + " -o\tprint ordinals\n" + " -p\tset preprocessor program\n" +- " -v\tverbose mode\n" ++ " -v\tverbose mode\n" " -H\tthis help\n" + "\nReport bugs as directed at %s\n", + PACKAGE_VERSION_STRING, program_name, PACKAGE_BUG_REPORT); +- return 1; ++ return help?0:1; + } + + /* parse headers and build symbol tree */ diff --git a/recipes/pexports/all/patches/0002-fix-MSVC-stack-overflow.patch b/recipes/pexports/all/patches/0002-fix-MSVC-stack-overflow.patch new file mode 100644 index 0000000000000..00d8d1fdef840 --- /dev/null +++ b/recipes/pexports/all/patches/0002-fix-MSVC-stack-overflow.patch @@ -0,0 +1,12 @@ +__report_gsfailure would end up being called when buidling pexports with build_type=Debug +--- pexports.c ++++ pexports.c +@@ -354,7 +354,7 @@ + IMAGE_DOS_HEADER *load_pe_image(const char *filename) + { + #ifdef _MSC_VER +- struct _stat32 st; ++ struct stat st; + #else + struct stat st; + #endif diff --git a/recipes/pexports/all/patches/0003-fix-MSVC-x86.patch b/recipes/pexports/all/patches/0003-fix-MSVC-x86.patch new file mode 100644 index 0000000000000..a99752f798ae7 --- /dev/null +++ b/recipes/pexports/all/patches/0003-fix-MSVC-x86.patch @@ -0,0 +1,7 @@ +--- pexports.c ++++ pexports.c +@@ -81,2 +81,2 @@ +- extern __declspec(dllimport) void __stdcall *GetModuleHandleA(char *name); +- extern __declspec(dllimport) void __stdcall *GetProcAddress(void *module, char *name); ++ extern __declspec(dllimport) void * __stdcall GetModuleHandleA(char *name); ++ extern __declspec(dllimport) void * __stdcall GetProcAddress(void *module, char *name); diff --git a/recipes/pexports/all/test_package/CMakeLists.txt b/recipes/pexports/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7345b4f993eae --- /dev/null +++ b/recipes/pexports/all/test_package/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +if(NOT WIN32) + message(FATAL_ERROR "pexports only supports Windows") +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_program(PEXPORTS_BIN "pexports") +set(EXPORTS_DEF_PATH "${CMAKE_BINARY_DIR}/exports.def") +if(MSVC) + set(IMPORT_LIB "${CMAKE_BINARY_DIR}/my_import.lib") + set(LIB_BIN ${CMAKE_AR}) + if(NOT LIB_BIN) + set(LIB_BIN lib) + endif() + separate_arguments(IMPORT_LIB_ARGS WINDOWS_COMMAND ${CMAKE_EXE_LINKER_FLAGS}) + set(CREATE_IMPORT_LIB_CMD ${LIB_BIN} -def:${EXPORTS_DEF_PATH} -out:${IMPORT_LIB} ${IMPORT_LIB_ARGS}) +elseif(MINGW) + set(IMPORT_LIB "${CMAKE_BINARY_DIR}/libmy_import.a") + set(LIB_BIN ${CMAKE_DLLTOOL}) + if(NOT LIB_BIN) + set(LIB_BIN dlltool) + endif() + set(CREATE_IMPORT_LIB_CMD ${LIB_BIN} -d ${EXPORTS_DEF_PATH} -l ${IMPORT_LIB}) +else() + message(FATAL_ERROR "Unknown toolchain targeting Windows. Don't know how to create an import library.") +endif() + +add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/dllname.txt" + COMMAND "${CMAKE_COMMAND}" -E echo "$" >"${CMAKE_BINARY_DIR}/dllname.txt" + COMMENT "[debug] Write path of dll to ${CMAKE_BINARY_DIR}/dllname.txt (for debug purposes)" + DEPENDS test_library +) + +add_custom_command(OUTPUT "${EXPORTS_DEF_PATH}" + COMMAND "${PEXPORTS_BIN}" "$">${EXPORTS_DEF_PATH} + COMMENT "[pexports] Create ${EXPORTS_DEF_PATH}" + DEPENDS test_library +) + +add_custom_command(OUTPUT "${IMPORT_LIB}" + COMMAND ${CREATE_IMPORT_LIB_CMD} + COMMENT "[import] Create import library ${IMPORT_LIB}" + DEPENDS "${EXPORTS_DEF_PATH}" +) + +add_custom_target(create_import_library ALL DEPENDS "${CMAKE_BINARY_DIR}/dllname.txt" "${IMPORT_LIB}") + +add_library(test_library SHARED test_library.c) + +add_executable(${PROJECT_NAME} test_package) +target_link_libraries(${PROJECT_NAME} PRIVATE my_import) +target_link_directories(${PROJECT_NAME} PRIVATE "${CMAKE_BINARY_DIR}") +add_dependencies(${PROJECT_NAME} create_import_library) diff --git a/recipes/pexports/all/test_package/conanfile.py b/recipes/pexports/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cd2e47277e1d7 --- /dev/null +++ b/recipes/pexports/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("pexports -H", run_environment=True) + if self.settings.os == "Windows": + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + exports_def_path = os.path.join(self.build_folder, "exports.def") + exports_def_contents = tools.load(exports_def_path) + self.output.info("{} contents:\n{}".format(exports_def_path, exports_def_contents)) + if not "test_package_function" in exports_def_contents: + raise ConanException("pexport could not detect `test_package_function` in the dll") diff --git a/recipes/pexports/all/test_package/test_library.c b/recipes/pexports/all/test_package/test_library.c new file mode 100644 index 0000000000000..2c04ec90b9487 --- /dev/null +++ b/recipes/pexports/all/test_package/test_library.c @@ -0,0 +1,4 @@ +__declspec(dllexport) +int test_package_function(void) { + return 1337; +} diff --git a/recipes/pexports/all/test_package/test_package.c b/recipes/pexports/all/test_package/test_package.c new file mode 100644 index 0000000000000..d20a5414e4545 --- /dev/null +++ b/recipes/pexports/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +int test_package_function(void); + +int main() { + int var = test_package_function(); + if (var != 1337) { + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/pexports/config.yml b/recipes/pexports/config.yml new file mode 100644 index 0000000000000..05071d8ddb823 --- /dev/null +++ b/recipes/pexports/config.yml @@ -0,0 +1,3 @@ +versions: + "0.47": + folder: all diff --git a/recipes/pffft/all/CMakeLists.txt b/recipes/pffft/all/CMakeLists.txt new file mode 100644 index 0000000000000..d32357140dd71 --- /dev/null +++ b/recipes/pffft/all/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.4) +project(pffft LANGUAGES C) + +include(GNUInstallDirs) + +option(DISABLE_SIMD "Use scalar code instead of simd code" OFF) + +add_library(pffft ${PFFFT_SRC_DIR}/pffft.c) +if(DISABLE_SIMD) + target_compile_definitions(pffft PRIVATE PFFFT_SIMD_DISABLE) +endif() +if(MSVC) + target_compile_definitions(pffft PRIVATE _USE_MATH_DEFINES) + set_property(TARGET pffft PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +endif() +include(CheckFunctionExists) +check_function_exists(round HAVE_MATH_SYSTEM) +if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(pffft PRIVATE m) +endif() + +install( + TARGETS pffft + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${PFFFT_SRC_DIR}/pffft.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/pffft/all/conandata.yml b/recipes/pffft/all/conandata.yml new file mode 100644 index 0000000000000..8edcfcf55d08a --- /dev/null +++ b/recipes/pffft/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210511": + url: "https://bitbucket.org/jpommier/pffft/get/ed78751d751e.zip" + sha256: "af4ac1f9e148348b492686491f2235b5b4dd210148fac29ceca6fb629e563b53" + "cci.20201015": + url: "https://bitbucket.org/jpommier/pffft/get/2b2bd45bbf9b.zip" + sha256: "f21913b96eb0f87839dcb363992cd619e7a9c4333685ad9627bc3da205e36a89" diff --git a/recipes/pffft/all/conanfile.py b/recipes/pffft/all/conanfile.py new file mode 100644 index 0000000000000..a9e20b61b7a16 --- /dev/null +++ b/recipes/pffft/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 get, load, save +import os + +required_conan_version = ">=1.53.0" + + +class PffftConan(ConanFile): + name = "pffft" + description = "PFFFT, a pretty fast Fourier Transform." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bitbucket.org/jpommier/pffft/src/master/" + topics = ("fft", "pffft") + license = "BSD-like (FFTPACK license)" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_simd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "disable_simd": False, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PFFFT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["DISABLE_SIMD"] = self.options.disable_simd + 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): + header = load(self, os.path.join(self.source_folder, "pffft.h")) + license_content = header[: header.find("*/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_content) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["pffft"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/pffft/all/test_package/CMakeLists.txt b/recipes/pffft/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de2c147a71f2b --- /dev/null +++ b/recipes/pffft/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(pffft REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pffft::pffft) diff --git a/recipes/pffft/all/test_package/conanfile.py b/recipes/pffft/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pffft/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/pffft/all/test_package/test_package.c b/recipes/pffft/all/test_package/test_package.c new file mode 100644 index 0000000000000..f4d52a7007f1c --- /dev/null +++ b/recipes/pffft/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include + +int main() { + + int s = pffft_simd_size(); + printf("%d\n",s); + return 0; +} diff --git a/recipes/pffft/all/test_v1_package/CMakeLists.txt b/recipes/pffft/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pffft/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pffft/all/test_v1_package/conanfile.py b/recipes/pffft/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pffft/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/pffft/config.yml b/recipes/pffft/config.yml new file mode 100644 index 0000000000000..71ee80dbeda95 --- /dev/null +++ b/recipes/pffft/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210511": + folder: all + "cci.20201015": + folder: all diff --git a/recipes/pfr/all/conandata.yml b/recipes/pfr/all/conandata.yml new file mode 100644 index 0000000000000..a92db9416c3b3 --- /dev/null +++ b/recipes/pfr/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.1.0": + url: "https://github.com/boostorg/pfr/archive/refs/tags/2.1.0.tar.gz" + sha256: "7c18a4ab73b70f8b3513fa3a836c6f4310f627bbf55f62b89bdd7aa787c7da31" + "2.0.3": + url: "https://github.com/boostorg/pfr/archive/refs/tags/2.0.3.tar.gz" + sha256: "c7d1950b56a07678423759f0bcdf37312f9861e3e9e59c45331903891213e2f2" + "2.0.2": + url: "https://github.com/boostorg/pfr/archive/refs/tags/2.0.2.tar.gz" + sha256: "1f03ebd3728d7df166d40d992ac071927d483474aa0f947e78a573c4ca288c04" + "1.0.4": + url: "https://github.com/boostorg/pfr/archive/refs/tags/1.0.4.tar.gz" + sha256: "01ecb27c850f50c589bad9a741ec9af6b06fe07ed673946c4bbb1960eb0f126e" +patches: + "1.0.4": + - patch_file: "patches/50_add_license.patch" diff --git a/recipes/pfr/all/conanfile.py b/recipes/pfr/all/conanfile.py new file mode 100644 index 0000000000000..ce6b5d6b573d9 --- /dev/null +++ b/recipes/pfr/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.52.0" + + +class PfrConan(ConanFile): + name = "pfr" + description = "std::tuple like methods for user defined types without any macro or boilerplate code" + topics = ("boost", "reflection", "magic_get") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/boostorg/pfr" + license = "BSL-1.0" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "apple-clang": "9.4", + "clang": "3.8", + "gcc": "5.5", + "Visual Studio": "14", + "msvc": "190", + } + + 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.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def 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_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pfr/all/patches/50_add_license.patch b/recipes/pfr/all/patches/50_add_license.patch new file mode 100644 index 0000000000000..2e7bbce232b9b --- /dev/null +++ b/recipes/pfr/all/patches/50_add_license.patch @@ -0,0 +1,39 @@ +From 19c4eead83a3c03d578c98ce34da24f93bb22fd5 Mon Sep 17 00:00:00 2001 +From: ericLemanissier +Date: Fri, 2 Oct 2020 13:53:59 +0200 +Subject: [PATCH] add license + +--- + LICENSE_1_0.txt | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + create mode 100644 LICENSE_1_0.txt + +diff --git a/LICENSE_1_0.txt b/LICENSE_1_0.txt +new file mode 100644 +index 0000000..36b7cd9 +--- /dev/null ++++ b/LICENSE_1_0.txt +@@ -0,0 +1,23 @@ ++Boost Software License - Version 1.0 - August 17th, 2003 ++ ++Permission is hereby granted, free of charge, to any person or organization ++obtaining a copy of the software and accompanying documentation covered by ++this license (the "Software") to use, reproduce, display, distribute, ++execute, and transmit the Software, and to prepare derivative works of the ++Software, and to permit third-parties to whom the Software is furnished to ++do so, all subject to the following: ++ ++The copyright notices in the Software and this entire statement, including ++the above license grant, this restriction and the following disclaimer, ++must be included in all copies of the Software, in whole or in part, and ++all derivative works of the Software, unless such copies or derivative ++works are solely in the form of machine-executable object code generated by ++a source language processor. ++ ++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, TITLE AND NON-INFRINGEMENT. IN NO EVENT ++SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE ++FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ++ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. diff --git a/recipes/pfr/all/test_package/CMakeLists.txt b/recipes/pfr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d786461ba037e --- /dev/null +++ b/recipes/pfr/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(pfr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package_${PfrMajorVersion}.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pfr::pfr) + +# PFR 1.0.4 doesn't support Visual Studio in C++14 mode, requires C++17. +# Otherwise, at least C++14 is required. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND ${PfrMajorVersion} EQUAL 1) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_PFR_USE_CPP17=1 BOOST_PFR_USE_LOOPHOLE=0) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/pfr/all/test_package/conanfile.py b/recipes/pfr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..06c6a80cfff92 --- /dev/null +++ b/recipes/pfr/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PfrMajorVersion"] = Version(self.dependencies["pfr"].ref.version).major + 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/pfr/all/test_package/test_package_1.cpp b/recipes/pfr/all/test_package/test_package_1.cpp new file mode 100644 index 0000000000000..9978af7ba34cf --- /dev/null +++ b/recipes/pfr/all/test_package/test_package_1.cpp @@ -0,0 +1,129 @@ +// Copyright 2016-2020 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +#include + + +//[pfr_intro +#include + +struct nested_t { char c; }; +struct foo_t { int i; nested_t nested; }; + + +static_assert(std::is_same< + boost::pfr::flat_tuple_element_t<1, foo_t>, // Flat reflection. + char // `char`, not `nested_t`! +>::value, ""); + + +// Requires C++17 or Loophole enabled: +//<- +#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE //-> +static_assert(std::is_same< + boost::pfr::tuple_element_t<1, foo_t>, // Precise reflection. + nested_t +>::value, ""); //<- +#endif //-> +//] [/pfr_intro] + + +//[pfr_example_get +/*` + The following example shows how to access structure fields by index using [funcref boost::pfr::get]. + + Let's define some structure: +*/ +#include + +struct foo { // defining structure + int some_integer; + char c; +}; + +/*` + We can access fields of that structure by index: +*/ +foo f {777, '!'}; +auto& r1 = boost::pfr::get<0>(f); // accessing field with index 0, returns reference to `foo::some_integer` +auto& r2 = boost::pfr::get<1>(f); // accessing field with index 1, returns reference to `foo::c` +//] [/pfr_example_get] + +//[pfr_example_tuple_size +/*` + The following example shows how to count fields using [classref boost::pfr::tuple_size]. +*/ +#include + +struct foo2 { // defining structure + int some_integer; + char c; + short some_other_field; +}; + + +static_assert( + boost::pfr::tuple_size::value // returns total count of fields in `foo2` + == 3, "" +); + +static_assert( + boost::pfr::tuple_size::value // works with arrays too! + == 100, "" +); +//] [/pfr_example_tuple_size] + + + +//[pfr_example_flattening +/*` +[warning All the functions and metafunctions in Boost.PFR that start with `flat_` represent template parameter type as flat structure without static members! ] + +Take a look at the `struct my_struct`: +*/ +#include + +struct my_struct_nested { short a1; int a2; }; + +struct my_struct { + int a0; + static const int cvalue = 1000; + my_struct_nested nested; + short a3_a4[2]; +}; + +/*` It will be flattened and represented as: */ + +struct my_struct_flat { + int a0; + short a1; + int a2; + short a3; + short a4; +}; +//] [/pfr_example_flattening] + +void example_get() { +//[pfr_example_flattening_2 +/*` +It means, that: +*/ +boost::pfr::flat_get<2>(my_struct{}); // ... will return `my_struct::my_struct_nested::a2` field. +boost::pfr::flat_get<3>(my_struct{}); // ... will return `my_struct::a3_a4[0]` field. + +/*` Exactly the same story with arrays: */ + +int i[2][2] = {{10, 11}, {12, 13} }; +const int& r = boost::pfr::flat_get<1>(i); +assert(r == 11); +//] [/pfr_example_flattening_2] +(void)r; +} + + +int main() { + example_get(); +} diff --git a/recipes/pfr/all/test_package/test_package_2.cpp b/recipes/pfr/all/test_package/test_package_2.cpp new file mode 100644 index 0000000000000..41d16d9f0e64b --- /dev/null +++ b/recipes/pfr/all/test_package/test_package_2.cpp @@ -0,0 +1,184 @@ +// Copyright 2016-2021 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +#include +#include +#include +#include + +#include + +// boost-no-inspect +void test_examples() +{ + +#if BOOST_PFR_USE_CPP17 + { + //[pfr_quick_examples_ops + // Assert equality. + // Note that the equality operator for structure is not defined. + + struct test + { + std::string f1; + std::string_view f2; + }; + + assert( + boost::pfr::eq(test{"aaa", "zomg"}, test{"aaa", "zomg"})); + //] + } +#endif + + { + //[pfr_quick_examples_for_each + // Increment each field of the variable on 1 and + // output the content of the variable. + + struct test + { + int f1; + long f2; + }; + + test var{42, 43}; + + boost::pfr::for_each_field(var, [](auto &field) + { field += 1; }); + + // Outputs: {43, 44} + std::cout << boost::pfr::io(var); + //] + } + + { + //[pfr_quick_examples_tuple_size + // Getting fields count of some structure + + struct some + { + int a, b, c, d, e; + }; + + std::cout << "Fields count in structure: " + << boost::pfr::tuple_size::value // Outputs: 5 + << '\n'; + //] + } + + { + //[pfr_quick_examples_get + // Get field by index and assign new value to that field + + struct sample + { + char c; + float f; + }; + + sample var{}; + boost::pfr::get<1>(var) = 42.01f; + + std::cout << var.f; // Outputs: 42.01 + //] + } + +#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE + { + //[pfr_quick_examples_structure_to_tuple + // Getting a std::tuple of values from structures fields + + struct foo + { + int a, b; + }; + struct other + { + char c; + foo nested; + }; + + other var{'A', {3, 4}}; + std::tuple t = boost::pfr::structure_to_tuple(var); + assert(std::get<0>(t) == 'A'); + assert( + boost::pfr::eq(std::get<1>(t), foo{3, 4})); + //] + } +#endif + +#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE + { + //[pfr_quick_examples_structure_tie + // Getting a std::tuple of references to structure fields + + struct foo + { + int a, b; + }; + struct other + { + char c; + foo f; + }; + + other var{'A', {14, 15}}; + std::tuple t = boost::pfr::structure_tie(var); + std::get<1>(t) = foo{1, 2}; + + std::cout << boost::pfr::io(var.f); // Outputs: {1, 2} + //] + } +#endif + +} // void test_examples() + +//[pfr_quick_examples_functions_for +// Define all the comparison and IO operators for my_structure type along +// with hash_value function. + +#include + +namespace my_namespace +{ + struct my_structure + { + int a, b, c, d, e, f, g; + // ... + }; + BOOST_PFR_FUNCTIONS_FOR(my_structure) +} +//] + +//[pfr_quick_examples_eq_fields +// Define only the equality and inequality operators for my_eq_ne_structure. + +#include + +namespace my_namespace +{ + struct my_eq_ne_structure + { + float a, b, c, d, e, f, g; + // ... + }; + + inline bool operator==(const my_eq_ne_structure &x, const my_eq_ne_structure &y) + { + return boost::pfr::eq_fields(x, y); + } + + inline bool operator!=(const my_eq_ne_structure &x, const my_eq_ne_structure &y) + { + return boost::pfr::ne_fields(x, y); + } +} +//] + +int main() +{ + test_examples(); +} diff --git a/recipes/pfr/all/test_v1_package/CMakeLists.txt b/recipes/pfr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..700251d5bc8f3 --- /dev/null +++ b/recipes/pfr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1.0) +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/pfr/all/test_v1_package/conanfile.py b/recipes/pfr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c3a9c315455ca --- /dev/null +++ b/recipes/pfr/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["PfrMajorVersion"] = Version( + self.deps_cpp_info["pfr"].version).major + 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/pfr/config.yml b/recipes/pfr/config.yml new file mode 100644 index 0000000000000..656874f312592 --- /dev/null +++ b/recipes/pfr/config.yml @@ -0,0 +1,9 @@ +versions: + "2.1.0": + folder: "all" + "2.0.3": + folder: "all" + "2.0.2": + folder: "all" + "1.0.4": + folder: "all" diff --git a/recipes/pgm-index/all/conandata.yml b/recipes/pgm-index/all/conandata.yml new file mode 100644 index 0000000000000..80ff098e39ad7 --- /dev/null +++ b/recipes/pgm-index/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220801": + url: "https://github.com/gvinciguerra/PGM-index/archive/0d4567e7a643f8f967636b9cdc44756f6a8e7cc6.tar.gz" + sha256: "f6d44f90150087423b9e6699162c79ebe9c1e3905f208f4e773d511f9ae4e014" diff --git a/recipes/pgm-index/all/conanfile.py b/recipes/pgm-index/all/conanfile.py new file mode 100644 index 0000000000000..0169b4f5c8cc9 --- /dev/null +++ b/recipes/pgm-index/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class PgmIndexConan(ConanFile): + name = "pgm-index" + description = ( + "State-of-the-art learned data structure that enables fast lookup, " + "predecessor, range searches and updates in arrays" + ) + license = "Apache-2.0" + topics = ("data-structure", "spatial-index", "b-tree", "compression", "database", "machine-learning") + homepage = "https://pgm.di.unipi.it" + url = "https://github.com/conan-io/conan-center-index" + 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", + "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 is_msvc(self): + # see https://github.com/gvinciguerra/PGM-index/issues/19 + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pgm-index/all/test_package/CMakeLists.txt b/recipes/pgm-index/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3edd6e9dffe4c --- /dev/null +++ b/recipes/pgm-index/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(pgm-index REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pgm-index::pgm-index) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/pgm-index/all/test_package/conanfile.py b/recipes/pgm-index/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pgm-index/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/pgm-index/all/test_package/test_package.cpp b/recipes/pgm-index/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a1a5a55b7c88c --- /dev/null +++ b/recipes/pgm-index/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include +#include +#include +#include + +int main() { + // Generate some random data + std::vector data(1000000); + std::generate(data.begin(), data.end(), std::rand); + data.push_back(42); + std::sort(data.begin(), data.end()); + + // Construct the PGM-index + const int epsilon = 128; // space-time trade-off parameter + pgm::PGMIndex index(data); + + // Query the PGM-index + auto q = 42; + auto range = index.search(q); + auto lo = data.begin() + range.lo; + auto hi = data.begin() + range.hi; + std::cout << *std::lower_bound(lo, hi, q) << std::endl; + + return 0; +} diff --git a/recipes/pgm-index/all/test_v1_package/CMakeLists.txt b/recipes/pgm-index/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pgm-index/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pgm-index/all/test_v1_package/conanfile.py b/recipes/pgm-index/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pgm-index/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/pgm-index/config.yml b/recipes/pgm-index/config.yml new file mode 100644 index 0000000000000..2499184dd3f4b --- /dev/null +++ b/recipes/pgm-index/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220801": + folder: all diff --git a/recipes/physfs/all/conandata.yml b/recipes/physfs/all/conandata.yml new file mode 100644 index 0000000000000..5504750a8f897 --- /dev/null +++ b/recipes/physfs/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "3.0.2": + url: "https://icculus.org/physfs/downloads/physfs-3.0.2.tar.bz2" + sha256: "304df76206d633df5360e738b138c94e82ccf086e50ba84f456d3f8432f9f863" +patches: + "3.0.2": + - patch_file: "patches/0001-fix-export-import-symbols.patch" + - patch_file: "patches/0002-cmake-doc-option.patch" diff --git a/recipes/physfs/all/conanfile.py b/recipes/physfs/all/conanfile.py new file mode 100644 index 0000000000000..995258a27fa05 --- /dev/null +++ b/recipes/physfs/all/conanfile.py @@ -0,0 +1,146 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class PhysfsConan(ConanFile): + name = "physfs" + description = ( + "PhysicsFS is a library to provide abstract access to various " + "archives. It is intended for use in video games." + ) + license = "Zlib" + topics = ("physicsfs", "file", "filesystem", "io") + homepage = "https://icculus.org/physfs" + 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], + "zip": [True, False], + "sevenzip": [True, False], + "grp": [True, False], + "wad": [True, False], + "hog": [True, False], + "mvl": [True, False], + "qpak": [True, False], + "slb": [True, False], + "iso9660": [True, False], + "vdf": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "zip": True, + "sevenzip": True, + "grp": True, + "wad": True, + "hog": True, + "mvl": True, + "qpak": True, + "slb": True, + "iso9660": True, + "vdf": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PHYSFS_ARCHIVE_ZIP"] = self.options.zip + tc.variables["PHYSFS_ARCHIVE_7Z"] = self.options.sevenzip + tc.variables["PHYSFS_ARCHIVE_GRP"] = self.options.grp + tc.variables["PHYSFS_ARCHIVE_WAD"] = self.options.wad + tc.variables["PHYSFS_ARCHIVE_HOG"] = self.options.hog + tc.variables["PHYSFS_ARCHIVE_MVL"] = self.options.mvl + tc.variables["PHYSFS_ARCHIVE_QPAK"] = self.options.qpak + tc.variables["PHYSFS_ARCHIVE_SLB"] = self.options.slb + tc.variables["PHYSFS_ARCHIVE_ISO9660"] = self.options.iso9660 + tc.variables["PHYSFS_ARCHIVE_VDF"] = self.options.vdf + tc.variables["PHYSFS_BUILD_STATIC"] = not self.options.shared + tc.variables["PHYSFS_BUILD_SHARED"] = self.options.shared + tc.variables["PHYSFS_BUILD_TEST"] = False + tc.variables["PHYSFS_BUILD_DOCS"] = False + tc.generate() + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._physfs_target: "physfs::physfs"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _physfs_target(self): + return "physfs" if self.options.shared else "physfs-static" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PhysFS") + self.cpp_info.set_property("cmake_target_name", self._physfs_target) + self.cpp_info.set_property("pkg_config_name", "physfs") + suffix = "-static" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"physfs{suffix}"] + if self.options.shared: + self.cpp_info.defines.append("PHYSFS_SHARED") + else: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["Foundation", "IOKit"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PhysFS" + self.cpp_info.filenames["cmake_find_package_multi"] = "PhysFS" + 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/physfs/all/patches/0001-fix-export-import-symbols.patch b/recipes/physfs/all/patches/0001-fix-export-import-symbols.patch new file mode 100644 index 0000000000000..a723fe794b0bc --- /dev/null +++ b/recipes/physfs/all/patches/0001-fix-export-import-symbols.patch @@ -0,0 +1,41 @@ +see https://github.com/icculus/physfs/pull/15 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,6 +171,7 @@ endif() + option(PHYSFS_BUILD_SHARED "Build shared library" TRUE) + if(PHYSFS_BUILD_SHARED) + add_library(physfs SHARED ${PHYSFS_SRCS}) ++ target_compile_definitions(physfs PRIVATE PHYSFS_BUILD_SHARED PUBLIC PHYSFS_SHARED) + set_target_properties(physfs PROPERTIES MACOSX_RPATH 1) + set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) + set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) +--- a/src/physfs.h ++++ b/src/physfs.h +@@ -223,10 +223,13 @@ + extern "C" { + #endif + +-#if defined(PHYSFS_DECL) +-/* do nothing. */ +-#elif defined(_MSC_VER) ++#ifdef PHYSFS_SHARED ++#ifdef _MSC_VER ++#ifdef PHYSFS_BUILD_SHARED + #define PHYSFS_DECL __declspec(dllexport) ++#else ++#define PHYSFS_DECL __declspec(dllimport) ++#endif + #elif defined(__SUNPRO_C) + #define PHYSFS_DECL __global + #elif ((__GNUC__ >= 3) && (!defined(__EMX__)) && (!defined(sun))) +@@ -234,6 +237,9 @@ extern "C" { + #else + #define PHYSFS_DECL + #endif ++#else ++#define PHYSFS_DECL ++#endif + + #if defined(PHYSFS_DEPRECATED) + /* do nothing. */ diff --git a/recipes/physfs/all/patches/0002-cmake-doc-option.patch b/recipes/physfs/all/patches/0002-cmake-doc-option.patch new file mode 100644 index 0000000000000..cf6d290d21969 --- /dev/null +++ b/recipes/physfs/all/patches/0002-cmake-doc-option.patch @@ -0,0 +1,20 @@ +from https://github.com/icculus/physfs/pull/10 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -220,6 +220,7 @@ install(TARGETS ${PHYSFS_INSTALL_TARGETS} + ARCHIVE DESTINATION lib${LIB_SUFFIX}) + install(FILES src/physfs.h DESTINATION include) + ++if(PHYSFS_BUILD_DOCS) + find_package(Doxygen) + if(DOXYGEN_FOUND) + set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") +@@ -243,6 +244,7 @@ if(DOXYGEN_FOUND) + else() + message(STATUS "Doxygen not found. You won't be able to build documentation.") + endif() ++endif() + + if(UNIX) + set(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.bz2") diff --git a/recipes/physfs/all/test_package/CMakeLists.txt b/recipes/physfs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6832af4367fda --- /dev/null +++ b/recipes/physfs/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(PhysFS REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET physfs-static) + target_link_libraries(${PROJECT_NAME} PRIVATE physfs-static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE physfs) +endif() diff --git a/recipes/physfs/all/test_package/conanfile.py b/recipes/physfs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/physfs/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/physfs/all/test_package/test_package.c b/recipes/physfs/all/test_package/test_package.c new file mode 100644 index 0000000000000..e44780335a0af --- /dev/null +++ b/recipes/physfs/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + struct PHYSFS_Version physfs_version; + PHYSFS_getLinkedVersion(&physfs_version); + printf("PhysicsFS version %i.%i.%i", physfs_version.major, physfs_version.minor, physfs_version.patch); + return 0; +} diff --git a/recipes/physfs/all/test_v1_package/CMakeLists.txt b/recipes/physfs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/physfs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/physfs/all/test_v1_package/conanfile.py b/recipes/physfs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/physfs/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/physfs/config.yml b/recipes/physfs/config.yml new file mode 100644 index 0000000000000..12c582e98f963 --- /dev/null +++ b/recipes/physfs/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.2": + folder: all diff --git a/recipes/physx/4.x.x/conandata.yml b/recipes/physx/4.x.x/conandata.yml new file mode 100644 index 0000000000000..6ce5c7aca0b19 --- /dev/null +++ b/recipes/physx/4.x.x/conandata.yml @@ -0,0 +1,21 @@ +sources: + "4.1.1": + url: "https://github.com/NVIDIAGameWorks/PhysX/archive/ae80dede0546d652040ae6260a810e53e20a06fa.zip" + sha256: "dd7db4c7879659658753029de57d04b18047ec04687b60f70335cde148a48d68" +patches: + "4.1.1": + - patch_file: "patches/0001-PsAllocator-include-typeinfo.patch" + patch_description: "Fixed typeinfo inclusion for some VS versions" + patch_type: "portability" + - patch_file: "patches/0002-GuGJKType-const-discard-qualifiers.patch" + patch_description: "Add missing const qualifier to GuGJKType" + patch_type: "portability" + - patch_file: "patches/0003-PsWindowsInlineAoS-msvc142-bug-workaround.patch" + patch_description: "Workaround for a MSVC 142 bug on V3LoadA" + patch_type: "portability" + - patch_file: "patches/0004-Conan-PhysXGpu-name-workaround.patch" + patch_description: "Fix PhysXGpu library name" + patch_type: "conan" + - patch_file: "patches/0005-CMake-macos-ios-android-install-targets.patch" + patch_description: "Add installation targets for iOS, MacOS, Android" + patch_type: "portability" diff --git a/recipes/physx/4.x.x/conanfile.py b/recipes/physx/4.x.x/conanfile.py new file mode 100644 index 0000000000000..809257b1a0342 --- /dev/null +++ b/recipes/physx/4.x.x/conanfile.py @@ -0,0 +1,359 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import load, get, apply_conandata_patches, export_conandata_patches, rm, rmdir, copy, replace_in_file, save +from conan.tools.build import valid_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import msvc_runtime_flag, is_msvc +import os + +required_conan_version = ">=1.53.0" + +class PhysXConan(ConanFile): + name = "physx" + description = "The NVIDIA PhysX SDK is a scalable multi-platform " \ + "physics solution supporting a wide range of devices, " \ + "from smartphones to high-end multicore CPUs and GPUs." + license = "BSD-3-Clause" + topics = ("physx", "physics", "physics-engine", "physics-simulation", "game-development", "cuda") + homepage = "https://github.com/NVIDIAGameWorks/PhysX" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "compiler", "arch", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "release_build_type": ["profile", "release"], + "enable_simd": [True, False], + "enable_float_point_precise_math": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "release_build_type": "release", + "enable_simd": True, + "enable_float_point_precise_math": False, + } + + no_copy_source = True + short_paths = True + + generators = "CMakeDeps" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.build_type != "Release": + del self.options.release_build_type + if self.settings.os != "Windows": + del self.options.enable_float_point_precise_math + if self.settings.os not in ["Windows", "Android"]: + del self.options.enable_simd + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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 == "Macos": + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("{} only supports x86 and x86_64 on macOS".format(self.name)) + + if valid_min_cppstd(self, 17): + raise ConanInvalidConfiguration("{} is not supported with C++ 17. Contributions are welcome.".format(self.name)) + + 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 == "Windows" and not is_msvc(self): + raise ConanInvalidConfiguration("{} only supports Visual Studio on Windows".format(self.name)) + + if is_msvc(self): + allowed_runtimes = ["MDd", "MTd"] if build_type == "Debug" else ["MD", "MT"] + if msvc_runtime_flag(self) not in allowed_runtimes: + raise ConanInvalidConfiguration( + "Visual Studio runtime {0} is required for {1} build type".format( + " or ".join(allowed_runtimes), + build_type, + ) + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + + # Needed. See https://github.com/conan-io/conan-center-index/pull/16583#discussion_r1188548265 for details + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + + # Options defined in physx/compiler/public/CMakeLists.txt + tc.cache_variables["TARGET_BUILD_PLATFORM"] = self._get_target_build_platform() + tc.cache_variables["PX_BUILDSNIPPETS"] = False + tc.cache_variables["PX_BUILDPUBLICSAMPLES"] = False + tc.cache_variables["PX_CMAKE_SUPPRESS_REGENERATION"] = False + cmakemodules_abspath = os.path.join( + self.build_folder, + self.source_folder, + "externals", + self._get_cmakemodules_subfolder() + ) + tc.cache_variables["CMAKEMODULES_PATH"] = cmakemodules_abspath.replace("\\", "/") + tc.cache_variables["PHYSX_ROOT_DIR"] = os.path.join(self.source_folder, "physx").replace("\\", "/") + + # Options defined in physx/source/compiler/cmake/CMakeLists.txt + if self.settings.os in ["Windows", "Android"]: + tc.cache_variables["PX_SCALAR_MATH"] = not self.options.enable_simd # this value doesn't matter on other os + tc.cache_variables["PX_GENERATE_STATIC_LIBRARIES"] = not self.options.shared + tc.cache_variables["PX_EXPORT_LOWLEVEL_PDB"] = False + tc.cache_variables["PXSHARED_PATH"] = os.path.join(self.source_folder, "pxshared").replace("\\", "/") + tc.cache_variables["PXSHARED_INSTALL_PREFIX"] = self.package_folder.replace("\\", "/") + tc.cache_variables["PX_GENERATE_SOURCE_DISTRO"] = False + + # Options defined in externals/cmakemodules/NVidiaBuildOptions.cmake + tc.cache_variables["NV_APPEND_CONFIG_NAME"] = False + tc.cache_variables["NV_USE_GAMEWORKS_OUTPUT_DIRS"] = False + if is_msvc(self): + tc.cache_variables["NV_USE_STATIC_WINCRT"] = "MT" in msvc_runtime_flag(self) + tc.cache_variables["NV_USE_DEBUG_WINCRT"] = "d" in msvc_runtime_flag(self) + tc.cache_variables["NV_FORCE_64BIT_SUFFIX"] = False + tc.cache_variables["NV_FORCE_32BIT_SUFFIX"] = False + tc.cache_variables["PX_ROOT_LIB_DIR"] = os.path.join(self.package_folder, "lib").replace("\\", "/") + + if self.settings.os == "Windows": + # Options defined in physx/source/compiler/cmake/windows/CMakeLists.txt + tc.cache_variables["PX_COPY_EXTERNAL_DLL"] = False # External dll copy disabled, PhysXDevice dll copy is handled afterward during conan packaging + tc.cache_variables["PX_FLOAT_POINT_PRECISE_MATH"] = self.options.enable_float_point_precise_math + tc.cache_variables["PX_USE_NVTX"] = False # Could be controlled by an option if NVTX had a recipe, disabled for the moment + tc.cache_variables["GPU_DLL_COPIED"] = True # PhysXGpu dll copy disabled, this copy is handled afterward during conan packaging + + # Options used in physx/source/compiler/cmake/windows/PhysX.cmake + tc.cache_variables["PX_GENERATE_GPU_PROJECTS"] = False + + tc.generate() + + def build(self): + self._patch_sources() + + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "physx/compiler/public")) + cmake.build(build_type=self._get_physx_build_type()) + + def _get_cmakemodules_subfolder(self): + return "CMakeModules" if self.settings.os == "Windows" else "cmakemodules" + + def _patch_sources(self): + apply_conandata_patches(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 + 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!") + + physx_source_cmake_dir = os.path.join(self.source_folder, "physx", "source", "compiler", "cmake") + + # Remove global and specifics hard-coded PIC settings + # (conan's CMake build helper properly sets CMAKE_POSITION_INDEPENDENT_CODE + # depending on options) + replace_in_file(self, os.path.join(physx_source_cmake_dir, "CMakeLists.txt"), + "SET(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + for cmake_file in ( + "FastXml.cmake", + "LowLevel.cmake", + "LowLevelAABB.cmake", + "LowLevelDynamics.cmake", + "PhysX.cmake", + "PhysXCharacterKinematic.cmake", + "PhysXCommon.cmake", + "PhysXCooking.cmake", + "PhysXExtensions.cmake", + "PhysXFoundation.cmake", + "PhysXPvdSDK.cmake", + "PhysXTask.cmake", + "PhysXVehicle.cmake", + "SceneQuery.cmake", + "SimulationController.cmake", + ): + target, _ = os.path.splitext(os.path.basename(cmake_file)) + replace_in_file(self, os.path.join(physx_source_cmake_dir, cmake_file), + "SET_TARGET_PROPERTIES({} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)".format(target), + "") + + # No error for compiler warnings + replace_in_file(self, os.path.join(physx_source_cmake_dir, "windows", "CMakeLists.txt"), + "/WX", "") + for cmake_os in ("linux", "mac", "android", "ios"): + replace_in_file(self, os.path.join(physx_source_cmake_dir, cmake_os, "CMakeLists.txt"), + "-Werror", "") + + def _get_physx_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": + if self.options.release_build_type == "profile": + return "profile" + else: + return "release" + + def _get_target_build_platform(self): + return { + "Windows" : "windows", + "Linux" : "linux", + "Macos" : "mac", + "Android" : "android", + "iOS" : "ios" + }.get(str(self.settings.os)) + + def package(self): + cmake = CMake(self) + cmake.install(build_type=self._get_physx_build_type()) + + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._get_license()) + + cmake_installation_dir = os.path.join(self.package_folder, "lib", self._get_physx_build_type()) + package_dst_lib_dir = os.path.join(self.package_folder, "lib") + package_dst_bin_dir = os.path.join(self.package_folder, "bin") + + copy(self, pattern="*.a", dst=package_dst_lib_dir, src=cmake_installation_dir, keep_path=False) + copy(self, pattern="*.so", dst=package_dst_lib_dir, src=cmake_installation_dir, keep_path=False) + copy(self, pattern="*.dylib*", dst=package_dst_lib_dir, src=cmake_installation_dir, keep_path=False) + copy(self, pattern="*.lib", dst=package_dst_lib_dir, src=cmake_installation_dir, keep_path=False) + copy(self, pattern="*.dll", dst=package_dst_bin_dir, src=cmake_installation_dir, keep_path=False) + + rmdir(self, os.path.join(self.package_folder, "source")) + rmdir(self, cmake_installation_dir) + + self._copy_external_bin() + + def _get_license(self): + readme = load(self, os.path.join(self.source_folder, "README.md")) + begin = readme.find("Copyright") + end = readme.find("\n## Introduction", begin) + return readme[begin:end] + + def _copy_external_bin(self): + # For Windows and Linux 64 bits, PhysXGpu (and PhysXDevice on Windows) + # precompiled shared libs must also be provided to end-user if + # application uses GPU features. + external_bin_dir = os.path.join(self.source_folder, "physx", "bin") + physx_build_type = self._get_physx_build_type() + compiler_version = self.settings.compiler.version + + if self.settings.os == "Linux" and self.settings.arch == "x86_64": + package_dst_lib_dir = os.path.join(self.package_folder, "lib") + physx_gpu_dir = os.path.join(external_bin_dir, "linux.clang", physx_build_type) + copy(self, pattern="*PhysXGpu*.so", dst=package_dst_lib_dir, src=physx_gpu_dir, keep_path=False) + elif self.settings.os == "Windows" and is_msvc(self): + physx_arch = {"x86": "x86_32", "x86_64": "x86_64"}.get(str(self.settings.arch)) + dll_info_list = [{ + "pattern": "PhysXGpu*.dll", + "vc_ver": {"x86": "vc120", "x86_64": "vc140"}.get(str(self.settings.arch)) + }, { + "pattern": "PhysXDevice*.dll", + "vc_ver": {"180": "vc120", "190": "vc140", "191": "vc141"}.get(str(compiler_version), "vc142") + }] + + package_dst_bin_dir = os.path.join(self.package_folder, "bin") + + for dll_info in dll_info_list: + dll_subdir = "win.{0}.{1}.mt".format(physx_arch, dll_info.get("vc_ver")) + dll_dir = os.path.join(external_bin_dir, dll_subdir, physx_build_type) + copy(self, pattern=dll_info.get("pattern"), dst=package_dst_bin_dir, src=dll_dir, keep_path=False) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PhysX") + + # PhysXFoundation + self.cpp_info.components["physxfoundation"].set_property("cmake_target_name", "PhysX::PhysXFoundation") + self.cpp_info.components["physxfoundation"].libs = ["PhysXFoundation"] + if self.settings.os == "Linux": + self.cpp_info.components["physxfoundation"].system_libs = ["m", "pthread", "rt"] + elif self.settings.os == "Android": + self.cpp_info.components["physxfoundation"].system_libs = ["log"] + elif self.settings.os == "Windows": + self.cpp_info.components["physxfoundation"].system_libs = ["ws2_32"] + + # PhysXCommon + self.cpp_info.components["physxcommon"].set_property("cmake_target_name", "PhysX::PhysXCommon") + self.cpp_info.components["physxcommon"].libs = ["PhysXCommon"] + if self.settings.os == "Linux": + self.cpp_info.components["physxcommon"].system_libs = ["m"] + self.cpp_info.components["physxcommon"].requires = ["physxfoundation"] + + # PhysXPvdSDK + self.cpp_info.components["physxpvdsdk"].set_property("cmake_target_name", "PhysX::PhysXPvdSDK") + self.cpp_info.components["physxpvdsdk"].libs = ["PhysXPvdSDK"] + self.cpp_info.components["physxpvdsdk"].requires = ["physxfoundation"] + + # PhysX + self.cpp_info.components["physxmain"].set_property("cmake_target_name", "PhysX::PhysX") + self.cpp_info.components["physxmain"].libs = ["PhysX"] + if self.settings.os == "Linux": + self.cpp_info.components["physxmain"].system_libs = ["m"] + if self.settings.arch == "x86_64": + self.cpp_info.components["physxmain"].system_libs.append("dl") + self.cpp_info.components["physxmain"].requires = ["physxpvdsdk", "physxcommon", "physxfoundation"] + + # PhysXTask + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["physxtask"].set_property("cmake_target_name", "PhysX::PhysXTask") + self.cpp_info.components["physxtask"].libs = ["PhysXTask"] + self.cpp_info.components["physxmain"].requires.append("physxtask") + + # PhysXCharacterKinematic + self.cpp_info.components["physxcharacterkinematic"].set_property("cmake_target_name", "PhysX::PhysXCharacterKinematic") + self.cpp_info.components["physxcharacterkinematic"].libs = ["PhysXCharacterKinematic"] + self.cpp_info.components["physxcharacterkinematic"].requires = ["physxfoundation", "physxcommon", "physxextensions"] + + # PhysXCooking + self.cpp_info.components["physxcooking"].set_property("cmake_target_name", "PhysX::PhysXCooking") + self.cpp_info.components["physxcooking"].libs = ["PhysXCooking"] + if self.settings.os == "Linux": + self.cpp_info.components["physxcooking"].system_libs = ["m"] + self.cpp_info.components["physxcooking"].requires = ["physxfoundation", "physxcommon"] + + # PhysXVehicle + self.cpp_info.components["physxvehicle"].set_property("cmake_target_name", "PhysX::PhysXVehicle") + self.cpp_info.components["physxvehicle"].libs = ["PhysXVehicle"] + self.cpp_info.components["physxvehicle"].requires = ["physxfoundation", "physxpvdsdk", "physxextensions"] + + # PhysXExtensions + self.cpp_info.components["physxextensions"].set_property("cmake_target_name", "PhysX::PhysXExtensions") + self.cpp_info.components["physxextensions"].libs = ["PhysXExtensions"] + self.cpp_info.components["physxextensions"].requires = ["physxfoundation", "physxpvdsdk", "physxmain", "physxcommon"] + + # TODO: remove in conan v2 once cmake_find_package* removed + self.cpp_info.names["cmake_find_package"] = "PhysX" + self.cpp_info.names["cmake_find_package_multi"] = "PhysX" + self.cpp_info.components["physxfoundation"].names["cmake_find_package"] = "PhysXFoundation" + self.cpp_info.components["physxfoundation"].names["cmake_find_package_multi"] = "PhysXFoundation" + self.cpp_info.components["physxcommon"].names["cmake_find_package"] = "PhysXCommon" + self.cpp_info.components["physxcommon"].names["cmake_find_package_multi"] = "PhysXCommon" + self.cpp_info.components["physxpvdsdk"].names["cmake_find_package"] = "PhysXPvdSDK" + self.cpp_info.components["physxpvdsdk"].names["cmake_find_package_multi"] = "PhysXPvdSDK" + self.cpp_info.components["physxmain"].names["cmake_find_package"] = "PhysX" + self.cpp_info.components["physxmain"].names["cmake_find_package_multi"] = "PhysX" + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["physxtask"].names["cmake_find_package"] = "PhysXTask" + self.cpp_info.components["physxtask"].names["cmake_find_package_multi"] = "PhysXTask" + self.cpp_info.components["physxcharacterkinematic"].names["cmake_find_package"] = "PhysXCharacterKinematic" + self.cpp_info.components["physxcharacterkinematic"].names["cmake_find_package_multi"] = "PhysXCharacterKinematic" + self.cpp_info.components["physxcooking"].names["cmake_find_package"] = "PhysXCooking" + self.cpp_info.components["physxcooking"].names["cmake_find_package_multi"] = "PhysXCooking" + self.cpp_info.components["physxvehicle"].names["cmake_find_package"] = "PhysXVehicle" + self.cpp_info.components["physxvehicle"].names["cmake_find_package_multi"] = "PhysXVehicle" + self.cpp_info.components["physxextensions"].names["cmake_find_package"] = "PhysXExtensions" + self.cpp_info.components["physxextensions"].names["cmake_find_package_multi"] = "PhysXExtensions" diff --git a/recipes/physx/4.x.x/patches/0001-PsAllocator-include-typeinfo.patch b/recipes/physx/4.x.x/patches/0001-PsAllocator-include-typeinfo.patch new file mode 100644 index 0000000000000..06b32d37634a0 --- /dev/null +++ b/recipes/physx/4.x.x/patches/0001-PsAllocator-include-typeinfo.patch @@ -0,0 +1,17 @@ +diff --git a/physx/source/foundation/include/PsAllocator.h b/physx/source/foundation/include/PsAllocator.h +index 38b70fc3..e831ca65 100644 +--- a/physx/source/foundation/include/PsAllocator.h ++++ b/physx/source/foundation/include/PsAllocator.h +@@ -37,8 +37,12 @@ + + #if(PX_WINDOWS_FAMILY || PX_XBOXONE) + #include ++#if(_MSC_VER >= 1923) ++ #include ++#else + #include + #endif ++#endif + #if(PX_APPLE_FAMILY) + #include + #endif diff --git a/recipes/physx/4.x.x/patches/0002-GuGJKType-const-discard-qualifiers.patch b/recipes/physx/4.x.x/patches/0002-GuGJKType-const-discard-qualifiers.patch new file mode 100644 index 0000000000000..26b716277253c --- /dev/null +++ b/recipes/physx/4.x.x/patches/0002-GuGJKType-const-discard-qualifiers.patch @@ -0,0 +1,13 @@ +diff --git a/physx/source/geomutils/src/gjk/GuGJKType.h b/physx/source/geomutils/src/gjk/GuGJKType.h +index a0099e2f..f5cac3b9 100644 +--- a/physx/source/geomutils/src/gjk/GuGJKType.h ++++ b/physx/source/geomutils/src/gjk/GuGJKType.h +@@ -151,7 +151,7 @@ namespace Gu + + virtual Ps::aos::Vec3V getCenter() const { return mAToB.transform(getConvex().getCenter()); } + +- PX_FORCE_INLINE Ps::aos::PsMatTransformV& getRelativeTransform(){ return mAToB; } ++ PX_FORCE_INLINE const Ps::aos::PsMatTransformV& getRelativeTransform() const { return mAToB; } + + //ML: we can't force inline function, otherwise win modern will throw compiler error + PX_INLINE RelativeConvex::Type > getGjkConvex() const diff --git a/recipes/physx/4.x.x/patches/0003-PsWindowsInlineAoS-msvc142-bug-workaround.patch b/recipes/physx/4.x.x/patches/0003-PsWindowsInlineAoS-msvc142-bug-workaround.patch new file mode 100644 index 0000000000000..3cef3a39938dd --- /dev/null +++ b/recipes/physx/4.x.x/patches/0003-PsWindowsInlineAoS-msvc142-bug-workaround.patch @@ -0,0 +1,13 @@ +diff --git a/physx/source/foundation/include/windows/PsWindowsInlineAoS.h b/physx/source/foundation/include/windows/PsWindowsInlineAoS.h +index 881dffb7..b7d60573 100644 +--- a/physx/source/foundation/include/windows/PsWindowsInlineAoS.h ++++ b/physx/source/foundation/include/windows/PsWindowsInlineAoS.h +@@ -363,7 +363,7 @@ PX_FORCE_INLINE Vec3V V3LoadUnsafeA(const PxVec3& f) + PX_FORCE_INLINE Vec3V V3LoadA(const PxF32* const f) + { + ASSERT_ISALIGNED16(f); +- return V4ClearW(_mm_load_ps(f)); ++ return [ & ](){ return V4ClearW(_mm_load_ps(f)); }(); // MSVC 142 bug workaround + } + + PX_FORCE_INLINE Vec3V V3LoadU(const PxF32* const i) diff --git a/recipes/physx/4.x.x/patches/0004-Conan-PhysXGpu-name-workaround.patch b/recipes/physx/4.x.x/patches/0004-Conan-PhysXGpu-name-workaround.patch new file mode 100644 index 0000000000000..d36b2f013f152 --- /dev/null +++ b/recipes/physx/4.x.x/patches/0004-Conan-PhysXGpu-name-workaround.patch @@ -0,0 +1,37 @@ +diff --git a/physx/source/compiler/cmake/linux/PhysX.cmake b/physx/source/compiler/cmake/linux/PhysX.cmake +index 48a4e53a..c4565e4a 100644 +--- a/physx/source/compiler/cmake/linux/PhysX.cmake ++++ b/physx/source/compiler/cmake/linux/PhysX.cmake +@@ -89,13 +89,12 @@ IF(NV_USE_GAMEWORKS_OUTPUT_DIRS) + ENDIF() + SET(PHYSX_GPU_SHARED_LIB_NAME_DEF PX_PHYSX_GPU_SHARED_LIB_NAME=libPhysXGpu_${BITNESS_STRING}.so) + ELSE() +- SET(CONFIG_STRING $<$:DEBUG>$<$:CHECKED>$<$:PROFILE>) + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) +- SET(BITNESS_STRING "x64") ++ SET(BITNESS_STRING "64") + ELSE() +- SET(BITNESS_STRING "x86") ++ SET(BITNESS_STRING "32") + ENDIF() +- SET(PHYSX_GPU_SHARED_LIB_NAME_DEF PX_PHYSX_GPU_SHARED_LIB_NAME=libPhysXGpu${CONFIG_STRING}_${BITNESS_STRING}.so) ++ SET(PHYSX_GPU_SHARED_LIB_NAME_DEF PX_PHYSX_GPU_SHARED_LIB_NAME=libPhysXGpu_${BITNESS_STRING}.so) + ENDIF() + + SET(PHYSX_COMPILE_DEFS +diff --git a/physx/source/compiler/cmake/windows/PhysX.cmake b/physx/source/compiler/cmake/windows/PhysX.cmake +index 6abd6f39..7f44cf02 100644 +--- a/physx/source/compiler/cmake/windows/PhysX.cmake ++++ b/physx/source/compiler/cmake/windows/PhysX.cmake +@@ -112,9 +112,8 @@ IF(NV_USE_GAMEWORKS_OUTPUT_DIRS) + SET(BITNESS_STRING $<$:64>$<$:32>) + SET(PHYSX_GPU_SHARED_LIB_NAME_DEF PX_PHYSX_GPU_SHARED_LIB_NAME=PhysXGpu_${BITNESS_STRING}.dll) + ELSE() +- SET(CONFIG_STRING $<$:DEBUG>$<$:CHECKED>$<$:PROFILE>) +- SET(BITNESS_STRING $<$:x64>$<$:x86>) +- SET(PHYSX_GPU_SHARED_LIB_NAME_DEF PX_PHYSX_GPU_SHARED_LIB_NAME=PhysXGpu${CONFIG_STRING}_${BITNESS_STRING}.dll) ++ SET(BITNESS_STRING $<$:64>$<$:32>) ++ SET(PHYSX_GPU_SHARED_LIB_NAME_DEF PX_PHYSX_GPU_SHARED_LIB_NAME=PhysXGpu_${BITNESS_STRING}.dll) + ENDIF() + + IF(NOT PX_GENERATE_STATIC_LIBRARIES) diff --git a/recipes/physx/4.x.x/patches/0005-CMake-macos-ios-android-install-targets.patch b/recipes/physx/4.x.x/patches/0005-CMake-macos-ios-android-install-targets.patch new file mode 100644 index 0000000000000..92fddc6f44761 --- /dev/null +++ b/recipes/physx/4.x.x/patches/0005-CMake-macos-ios-android-install-targets.patch @@ -0,0 +1,54 @@ +diff --git a/physx/source/compiler/cmake/android/CMakeLists.txt b/physx/source/compiler/cmake/android/CMakeLists.txt +index d0874b3c..ec2d6da4 100644 +--- a/physx/source/compiler/cmake/android/CMakeLists.txt ++++ b/physx/source/compiler/cmake/android/CMakeLists.txt +@@ -111,4 +111,12 @@ SET_PROPERTY(TARGET SimulationController PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET FastXml PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXPvdSDK PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXTask PROPERTY FOLDER "PhysX SDK") +-SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK") +\ No newline at end of file ++SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK") ++ ++SET(PHYSXDISTRO_LIBS PhysXFoundation PhysX PhysXCharacterKinematic PhysXPvdSDK PhysXCommon PhysXCooking PhysXExtensions PhysXVehicle) ++ ++INSTALL( ++ TARGETS ${PHYSXDISTRO_LIBS} ++ EXPORT PhysXSDK ++ DESTINATION $<$:${PX_ROOT_LIB_DIR}/debug>$<$:${PX_ROOT_LIB_DIR}/release>$<$:${PX_ROOT_LIB_DIR}/checked>$<$:${PX_ROOT_LIB_DIR}/profile> ++ ) +diff --git a/physx/source/compiler/cmake/ios/CMakeLists.txt b/physx/source/compiler/cmake/ios/CMakeLists.txt +index 9d713c91..20e4c12c 100644 +--- a/physx/source/compiler/cmake/ios/CMakeLists.txt ++++ b/physx/source/compiler/cmake/ios/CMakeLists.txt +@@ -89,4 +89,12 @@ SET_PROPERTY(TARGET SimulationController PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET FastXml PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXPvdSDK PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXTask PROPERTY FOLDER "PhysX SDK") +-SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK") +\ No newline at end of file ++SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK") ++ ++SET(PHYSXDISTRO_LIBS PhysXFoundation PhysX PhysXCharacterKinematic PhysXPvdSDK PhysXCommon PhysXCooking PhysXExtensions PhysXVehicle) ++ ++INSTALL( ++ TARGETS ${PHYSXDISTRO_LIBS} ++ EXPORT PhysXSDK ++ DESTINATION $<$:${PX_ROOT_LIB_DIR}/debug>$<$:${PX_ROOT_LIB_DIR}/release>$<$:${PX_ROOT_LIB_DIR}/checked>$<$:${PX_ROOT_LIB_DIR}/profile> ++ ) +diff --git a/physx/source/compiler/cmake/mac/CMakeLists.txt b/physx/source/compiler/cmake/mac/CMakeLists.txt +index a5c6dedc..5b51f354 100644 +--- a/physx/source/compiler/cmake/mac/CMakeLists.txt ++++ b/physx/source/compiler/cmake/mac/CMakeLists.txt +@@ -97,3 +97,11 @@ SET_PROPERTY(TARGET FastXml PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXPvdSDK PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXTask PROPERTY FOLDER "PhysX SDK") + SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK") ++ ++SET(PHYSXDISTRO_LIBS PhysXFoundation PhysX PhysXCharacterKinematic PhysXPvdSDK PhysXCommon PhysXCooking PhysXExtensions PhysXVehicle) ++ ++INSTALL( ++ TARGETS ${PHYSXDISTRO_LIBS} ++ EXPORT PhysXSDK ++ DESTINATION $<$:${PX_ROOT_LIB_DIR}/debug>$<$:${PX_ROOT_LIB_DIR}/release>$<$:${PX_ROOT_LIB_DIR}/checked>$<$:${PX_ROOT_LIB_DIR}/profile> ++ ) diff --git a/recipes/physx/4.x.x/test_package/CMakeLists.txt b/recipes/physx/4.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b7cd3b4aec9e9 --- /dev/null +++ b/recipes/physx/4.x.x/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(PhysX REQUIRED PhysX PhysXExtensions CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PhysX::PhysX PhysX::PhysXExtensions) + +option(TEST_SHARED_LIBRARY "Build a test shared library") +if(TEST_SHARED_LIBRARY) + find_package(PhysX REQUIRED PhysXFoundation CONFIG) + add_library(${PROJECT_NAME}_lib SHARED test_library.cpp) + target_link_libraries(${PROJECT_NAME}_lib PhysX::PhysXFoundation PhysX::PhysXExtensions) +endif() diff --git a/recipes/physx/4.x.x/test_package/conanfile.py b/recipes/physx/4.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..3bc1fe0a67f9f --- /dev/null +++ b/recipes/physx/4.x.x/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TEST_SHARED_LIBRARY"] = True if "fPIC" not in self.options["physx"].fields else self.options["physx"].fPIC + 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/physx/4.x.x/test_package/test_library.cpp b/recipes/physx/4.x.x/test_package/test_library.cpp new file mode 100644 index 0000000000000..dbd8a536f547c --- /dev/null +++ b/recipes/physx/4.x.x/test_package/test_library.cpp @@ -0,0 +1,25 @@ +#include "PxConfig.h" +#include "PxPhysicsAPI.h" + +using namespace physx; + +#if defined(_WINDOWS) +#include + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + return TRUE; +} + +#define EXPORTS __declspec(dllexport) +#else +#define EXPORTS +#endif + +PxDefaultAllocator gAllocator; +PxDefaultErrorCallback gErrorCallback; + +EXPORTS +void some_func(void) { + PxFoundation *gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback); + gFoundation->release(); +} diff --git a/recipes/physx/4.x.x/test_package/test_package.cpp b/recipes/physx/4.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..984f48894974c --- /dev/null +++ b/recipes/physx/4.x.x/test_package/test_package.cpp @@ -0,0 +1,143 @@ +#include + +#include "PxConfig.h" +#include "PxPhysicsAPI.h" + +#define PVD_HOST "127.0.0.1" +#define PX_RELEASE(x) if (x) {x->release(); x = NULL;} + +using namespace physx; + +PxDefaultAllocator gAllocator; +PxDefaultErrorCallback gErrorCallback; + +PxFoundation *gFoundation = NULL; +PxPhysics *gPhysics = NULL; + +PxDefaultCpuDispatcher *gDispatcher = NULL; +PxScene *gScene = NULL; + +PxMaterial *gMaterial = NULL; + +PxPvd *gPvd = NULL; + +#if PX_SUPPORT_GPU_PHYSX +PxCudaContextManager *gCudaContextManager = NULL; +#endif + +PxReal stackZ = 10.0f; + +PxRigidDynamic *createDynamic(const PxTransform &t, const PxGeometry &geometry, const PxVec3 &velocity = PxVec3(0)) { + PxRigidDynamic *dynamic = PxCreateDynamic(*gPhysics, t, geometry, *gMaterial, 10.0f); + dynamic->setAngularDamping(0.5f); + dynamic->setLinearVelocity(velocity); + gScene->addActor(*dynamic); + return dynamic; +} + +void createStack(const PxTransform &t, PxU32 size, PxReal halfExtent) { + PxShape *shape = gPhysics->createShape(PxBoxGeometry(halfExtent, halfExtent, halfExtent), *gMaterial); + for (PxU32 i = 0; i < size; ++i) { + for (PxU32 j = 0;j < size - i; ++j) { + PxTransform localTm(PxVec3(PxReal(j * 2) - PxReal(size - i), PxReal(i * 2 + 1), 0) * halfExtent); + PxRigidDynamic *body = gPhysics->createRigidDynamic(t.transform(localTm)); + body->attachShape(*shape); + PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); + gScene->addActor(*body); + } + } + shape->release(); +} + +void initPhysics() { + gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback); + + gPvd = PxCreatePvd(*gFoundation); + PxPvdTransport *transport = PxDefaultPvdSocketTransportCreate(PVD_HOST, 5425, 10); + gPvd->connect(*transport, PxPvdInstrumentationFlag::ePROFILE); + + gPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, PxTolerancesScale(), true, gPvd); + + PxSceneDesc sceneDesc(gPhysics->getTolerancesScale()); + sceneDesc.gravity = PxVec3(0.0f, -9.81f, 0.0f); + gDispatcher = PxDefaultCpuDispatcherCreate(4); + sceneDesc.cpuDispatcher = gDispatcher; + sceneDesc.filterShader = PxDefaultSimulationFilterShader; + +#if PX_SUPPORT_GPU_PHYSX + PxCudaContextManagerDesc cudaContextManagerDesc; + cudaContextManagerDesc.interopMode = PxCudaInteropMode::NO_INTEROP; + gCudaContextManager = PxCreateCudaContextManager(*gFoundation, cudaContextManagerDesc, PxGetProfilerCallback()); //Create the CUDA context manager, required for GRB to dispatch CUDA kernels. + if (gCudaContextManager) { + if (!gCudaContextManager->contextIsValid()) { + gCudaContextManager->release(); + gCudaContextManager = NULL; + } + } + sceneDesc.cudaContextManager = gCudaContextManager; //Set the CUDA context manager, used by GRB. + + sceneDesc.flags |= PxSceneFlag::eENABLE_GPU_DYNAMICS; //Enable GPU dynamics - without this enabled, simulation (contact gen and solver) will run on the CPU. + sceneDesc.flags |= PxSceneFlag::eENABLE_PCM; //Enable PCM. PCM NP is supported on GPU. Legacy contact gen will fall back to CPU + sceneDesc.flags |= PxSceneFlag::eENABLE_STABILIZATION; //Improve solver stability by enabling post-stabilization. + sceneDesc.broadPhaseType = PxBroadPhaseType::eGPU; //Enable GPU broad phase. Without this set, broad phase will run on the CPU. + sceneDesc.gpuMaxNumPartitions = 8; //Defines the maximum number of partitions used by the solver. Only power-of-2 values are valid. + //A value of 8 generally gives best balance between performance and stability. +#endif + + gScene = gPhysics->createScene(sceneDesc); + + PxPvdSceneClient *pvdClient = gScene->getScenePvdClient(); + if (pvdClient) { + pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true); + pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_CONTACTS, true); + pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true); + } + gMaterial = gPhysics->createMaterial(0.5f, 0.5f, 0.6f); + + PxRigidStatic *groundPlane = PxCreatePlane(*gPhysics, PxPlane(0,1,0,0), *gMaterial); + gScene->addActor(*groundPlane); + + for (PxU32 i = 0; i < 40; ++i) { + createStack(PxTransform(PxVec3(0, 0, stackZ -= 10.0f)), 20, 1.0f); + } + + PxRigidDynamic *ball = createDynamic(PxTransform(PxVec3(0,20,100)), PxSphereGeometry(5), PxVec3(0,-25,-100)); + PxRigidBodyExt::updateMassAndInertia(*ball, 1000.f); +} + +void stepPhysics() { + gScene->simulate(1.0f / 60.0f); + gScene->fetchResults(true); +} + +void cleanupPhysics() { + PX_RELEASE(gScene); + PX_RELEASE(gDispatcher); + PX_RELEASE(gPhysics); + if (gPvd) { + PxPvdTransport *transport = gPvd->getTransport(); + gPvd->release(); + gPvd = NULL; + PX_RELEASE(transport); + } +#if PX_SUPPORT_GPU_PHYSX + PX_RELEASE(gCudaContextManager); +#endif + PX_RELEASE(gFoundation); +} + +int main(int, char **) { + static const PxU32 frameCount = 100; + initPhysics(); + for (PxU32 i = 0; i < frameCount; ++i) { + stepPhysics(); + } + cleanupPhysics(); + + std::cout << "Test of PhysX " + << PX_PHYSICS_VERSION_MAJOR << "." << PX_PHYSICS_VERSION_MINOR << "." << PX_PHYSICS_VERSION_BUGFIX + << " done.\n" + << std::endl; + + return 0; +} diff --git a/recipes/physx/4.x.x/test_v1_package/CMakeLists.txt b/recipes/physx/4.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6ab5b97e050a --- /dev/null +++ b/recipes/physx/4.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PhysX REQUIRED PhysX PhysXExtensions CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PhysX::PhysX PhysX::PhysXExtensions) + +option(TEST_SHARED_LIBRARY "Build a test shared library") +if(TEST_SHARED_LIBRARY) + find_package(PhysX REQUIRED PhysXFoundation) + add_library(${PROJECT_NAME}_lib SHARED test_library.cpp) + target_link_libraries(${PROJECT_NAME}_lib PhysX::PhysXFoundation PhysX::PhysXExtensions) +endif() diff --git a/recipes/physx/4.x.x/test_v1_package/conanfile.py b/recipes/physx/4.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4cdfb6a5e4042 --- /dev/null +++ b/recipes/physx/4.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["TEST_SHARED_LIBRARY"] = True if "fPIC" not in self.options["physx"].fields else self.options["physx"].fPIC + 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/physx/4.x.x/test_v1_package/test_library.cpp b/recipes/physx/4.x.x/test_v1_package/test_library.cpp new file mode 100644 index 0000000000000..dbd8a536f547c --- /dev/null +++ b/recipes/physx/4.x.x/test_v1_package/test_library.cpp @@ -0,0 +1,25 @@ +#include "PxConfig.h" +#include "PxPhysicsAPI.h" + +using namespace physx; + +#if defined(_WINDOWS) +#include + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + return TRUE; +} + +#define EXPORTS __declspec(dllexport) +#else +#define EXPORTS +#endif + +PxDefaultAllocator gAllocator; +PxDefaultErrorCallback gErrorCallback; + +EXPORTS +void some_func(void) { + PxFoundation *gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback); + gFoundation->release(); +} diff --git a/recipes/physx/4.x.x/test_v1_package/test_package.cpp b/recipes/physx/4.x.x/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..984f48894974c --- /dev/null +++ b/recipes/physx/4.x.x/test_v1_package/test_package.cpp @@ -0,0 +1,143 @@ +#include + +#include "PxConfig.h" +#include "PxPhysicsAPI.h" + +#define PVD_HOST "127.0.0.1" +#define PX_RELEASE(x) if (x) {x->release(); x = NULL;} + +using namespace physx; + +PxDefaultAllocator gAllocator; +PxDefaultErrorCallback gErrorCallback; + +PxFoundation *gFoundation = NULL; +PxPhysics *gPhysics = NULL; + +PxDefaultCpuDispatcher *gDispatcher = NULL; +PxScene *gScene = NULL; + +PxMaterial *gMaterial = NULL; + +PxPvd *gPvd = NULL; + +#if PX_SUPPORT_GPU_PHYSX +PxCudaContextManager *gCudaContextManager = NULL; +#endif + +PxReal stackZ = 10.0f; + +PxRigidDynamic *createDynamic(const PxTransform &t, const PxGeometry &geometry, const PxVec3 &velocity = PxVec3(0)) { + PxRigidDynamic *dynamic = PxCreateDynamic(*gPhysics, t, geometry, *gMaterial, 10.0f); + dynamic->setAngularDamping(0.5f); + dynamic->setLinearVelocity(velocity); + gScene->addActor(*dynamic); + return dynamic; +} + +void createStack(const PxTransform &t, PxU32 size, PxReal halfExtent) { + PxShape *shape = gPhysics->createShape(PxBoxGeometry(halfExtent, halfExtent, halfExtent), *gMaterial); + for (PxU32 i = 0; i < size; ++i) { + for (PxU32 j = 0;j < size - i; ++j) { + PxTransform localTm(PxVec3(PxReal(j * 2) - PxReal(size - i), PxReal(i * 2 + 1), 0) * halfExtent); + PxRigidDynamic *body = gPhysics->createRigidDynamic(t.transform(localTm)); + body->attachShape(*shape); + PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); + gScene->addActor(*body); + } + } + shape->release(); +} + +void initPhysics() { + gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback); + + gPvd = PxCreatePvd(*gFoundation); + PxPvdTransport *transport = PxDefaultPvdSocketTransportCreate(PVD_HOST, 5425, 10); + gPvd->connect(*transport, PxPvdInstrumentationFlag::ePROFILE); + + gPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, PxTolerancesScale(), true, gPvd); + + PxSceneDesc sceneDesc(gPhysics->getTolerancesScale()); + sceneDesc.gravity = PxVec3(0.0f, -9.81f, 0.0f); + gDispatcher = PxDefaultCpuDispatcherCreate(4); + sceneDesc.cpuDispatcher = gDispatcher; + sceneDesc.filterShader = PxDefaultSimulationFilterShader; + +#if PX_SUPPORT_GPU_PHYSX + PxCudaContextManagerDesc cudaContextManagerDesc; + cudaContextManagerDesc.interopMode = PxCudaInteropMode::NO_INTEROP; + gCudaContextManager = PxCreateCudaContextManager(*gFoundation, cudaContextManagerDesc, PxGetProfilerCallback()); //Create the CUDA context manager, required for GRB to dispatch CUDA kernels. + if (gCudaContextManager) { + if (!gCudaContextManager->contextIsValid()) { + gCudaContextManager->release(); + gCudaContextManager = NULL; + } + } + sceneDesc.cudaContextManager = gCudaContextManager; //Set the CUDA context manager, used by GRB. + + sceneDesc.flags |= PxSceneFlag::eENABLE_GPU_DYNAMICS; //Enable GPU dynamics - without this enabled, simulation (contact gen and solver) will run on the CPU. + sceneDesc.flags |= PxSceneFlag::eENABLE_PCM; //Enable PCM. PCM NP is supported on GPU. Legacy contact gen will fall back to CPU + sceneDesc.flags |= PxSceneFlag::eENABLE_STABILIZATION; //Improve solver stability by enabling post-stabilization. + sceneDesc.broadPhaseType = PxBroadPhaseType::eGPU; //Enable GPU broad phase. Without this set, broad phase will run on the CPU. + sceneDesc.gpuMaxNumPartitions = 8; //Defines the maximum number of partitions used by the solver. Only power-of-2 values are valid. + //A value of 8 generally gives best balance between performance and stability. +#endif + + gScene = gPhysics->createScene(sceneDesc); + + PxPvdSceneClient *pvdClient = gScene->getScenePvdClient(); + if (pvdClient) { + pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true); + pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_CONTACTS, true); + pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true); + } + gMaterial = gPhysics->createMaterial(0.5f, 0.5f, 0.6f); + + PxRigidStatic *groundPlane = PxCreatePlane(*gPhysics, PxPlane(0,1,0,0), *gMaterial); + gScene->addActor(*groundPlane); + + for (PxU32 i = 0; i < 40; ++i) { + createStack(PxTransform(PxVec3(0, 0, stackZ -= 10.0f)), 20, 1.0f); + } + + PxRigidDynamic *ball = createDynamic(PxTransform(PxVec3(0,20,100)), PxSphereGeometry(5), PxVec3(0,-25,-100)); + PxRigidBodyExt::updateMassAndInertia(*ball, 1000.f); +} + +void stepPhysics() { + gScene->simulate(1.0f / 60.0f); + gScene->fetchResults(true); +} + +void cleanupPhysics() { + PX_RELEASE(gScene); + PX_RELEASE(gDispatcher); + PX_RELEASE(gPhysics); + if (gPvd) { + PxPvdTransport *transport = gPvd->getTransport(); + gPvd->release(); + gPvd = NULL; + PX_RELEASE(transport); + } +#if PX_SUPPORT_GPU_PHYSX + PX_RELEASE(gCudaContextManager); +#endif + PX_RELEASE(gFoundation); +} + +int main(int, char **) { + static const PxU32 frameCount = 100; + initPhysics(); + for (PxU32 i = 0; i < frameCount; ++i) { + stepPhysics(); + } + cleanupPhysics(); + + std::cout << "Test of PhysX " + << PX_PHYSICS_VERSION_MAJOR << "." << PX_PHYSICS_VERSION_MINOR << "." << PX_PHYSICS_VERSION_BUGFIX + << " done.\n" + << std::endl; + + return 0; +} diff --git a/recipes/physx/config.yml b/recipes/physx/config.yml new file mode 100644 index 0000000000000..ff5afb6866457 --- /dev/null +++ b/recipes/physx/config.yml @@ -0,0 +1,3 @@ +versions: + "4.1.1": + folder: "4.x.x" diff --git a/recipes/picobench/all/conandata.yml b/recipes/picobench/all/conandata.yml new file mode 100644 index 0000000000000..0bbacb7273fdf --- /dev/null +++ b/recipes/picobench/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.02": + url: "https://github.com/iboB/picobench/archive/refs/tags/v2.02.tar.gz" + sha256: "22a896535d0e2fd8793cdc6c14bef42275f8de8d24ce2cfc55442ed1e0973c83" + "2.01": + url: "https://github.com/iboB/picobench/archive/refs/tags/v2.01.tar.gz" + sha256: "164cb3b2d72a9b31e7559f6829ae38b6b955840571531117e0d6f53d669d3a2b" +patches: + "2.02": + - patch_file: "patches/2.02-0001-add-install.patch" + patch_description: "add installer" + patch_type: "conan" + "2.01": + - patch_file: "patches/2.01-0001-add-install.patch" + patch_description: "add installer" + patch_type: "conan" diff --git a/recipes/picobench/all/conanfile.py b/recipes/picobench/all/conanfile.py new file mode 100644 index 0000000000000..62918f33d6e78 --- /dev/null +++ b/recipes/picobench/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.52.0" + + +class PicobenchConan(ConanFile): + name = "picobench" + description = "A micro microbenchmarking library for C++11 in a single header file" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/iboB/picobench" + topics = ("benchmark", "header-only") + settings = "os", "arch", "compiler", "build_type" + options = { + "with_cli": [True, False], + } + default_options = { + "with_cli": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.with_cli: + del self.info.settings.compiler + else: + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PICOBENCH_BUILD_TOOLS"] = self.options.with_cli + tc.variables["PICOBENCH_BUILD_TESTS"] = False + tc.variables["PICOBENCH_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + 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.configure() + cmake.install() + + def package_info(self): + if self.options.with_cli: + # TODO: Legacy, to be removed on Conan 2.0 + binpath = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH env var: {}".format(binpath)) + self.env_info.PATH.append(binpath) + else: + self.cpp_info.bindirs = [] + + self.cpp_info.libdirs = [] diff --git a/recipes/picobench/all/patches/2.01-0001-add-install.patch b/recipes/picobench/all/patches/2.01-0001-add-install.patch new file mode 100644 index 0000000000000..9194bba894eef --- /dev/null +++ b/recipes/picobench/all/patches/2.01-0001-add-install.patch @@ -0,0 +1,30 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index eae8eaa..5e0e9ee 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -25,6 +25,11 @@ target_compile_features(picobench INTERFACE + cxx_right_angle_brackets + ) + ++include(GNUInstallDirs) ++ ++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/picobench ++ DESTINATION include/) ++ + if(PICOBENCH_BUILD_TOOLS) + add_subdirectory(tools) + endif() +diff --git a/a/tools/CMakeLists.txt b/b/tools/CMakeLists.txt +index cb7f584..f03ffa5 100644 +--- a/a/tools/CMakeLists.txt ++++ b/b/tools/CMakeLists.txt +@@ -10,3 +10,9 @@ add_executable(picobench-cli picobench.cpp) + target_link_libraries(picobench-cli picobench) + set_target_properties(picobench-cli PROPERTIES OUTPUT_NAME picobench) + set_target_properties(picobench-cli PROPERTIES FOLDER tools) ++ ++include(GNUInstallDirs) ++ ++install(TARGETS picobench-cli ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) diff --git a/recipes/picobench/all/patches/2.02-0001-add-install.patch b/recipes/picobench/all/patches/2.02-0001-add-install.patch new file mode 100644 index 0000000000000..e3daaea325e76 --- /dev/null +++ b/recipes/picobench/all/patches/2.02-0001-add-install.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 68bd3f9..32ef1ea 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,6 +28,11 @@ add_library(picobench INTERFACE) + add_library(picobench::picobench ALIAS picobench) + target_include_directories(picobench INTERFACE include) + ++include(GNUInstallDirs) ++ ++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/picobench ++ DESTINATION include/) ++ + if(PICOBENCH_BUILD_TOOLS) + add_subdirectory(tools) + endif() +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index cb7f584..cfefe5c 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -10,3 +10,7 @@ add_executable(picobench-cli picobench.cpp) + target_link_libraries(picobench-cli picobench) + set_target_properties(picobench-cli PROPERTIES OUTPUT_NAME picobench) + set_target_properties(picobench-cli PROPERTIES FOLDER tools) ++ ++install(TARGETS picobench-cli ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) diff --git a/recipes/picobench/all/test_package/CMakeLists.txt b/recipes/picobench/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a9856af9c67e --- /dev/null +++ b/recipes/picobench/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(picobench REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE picobench::picobench) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picobench/all/test_package/conanfile.py b/recipes/picobench/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/picobench/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/picobench/all/test_package/test_package.cpp b/recipes/picobench/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6fbf9259fc9dc --- /dev/null +++ b/recipes/picobench/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#define PICOBENCH_DEBUG +#define PICOBENCH_IMPLEMENT_WITH_MAIN +#include "picobench/picobench.hpp" + +#include +#include +#include + +void rand_vector(picobench::state& s) +{ + std::vector v; + for (auto _ : s) + { + v.push_back(rand()); + } +} +PICOBENCH(rand_vector); + +void rand_vector_reserve(picobench::state& s) +{ + std::vector v; + v.reserve(s.iterations()); + for (auto _ : s) + { + v.push_back(rand()); + } +} +PICOBENCH(rand_vector_reserve); + +void rand_deque(picobench::state& s) +{ + std::deque v; + for (auto _ : s) + { + v.push_back(rand()); + } +} +PICOBENCH(rand_deque); diff --git a/recipes/picobench/all/test_v1_package/CMakeLists.txt b/recipes/picobench/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/picobench/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/picobench/all/test_v1_package/conanfile.py b/recipes/picobench/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/picobench/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/picobench/config.yml b/recipes/picobench/config.yml new file mode 100644 index 0000000000000..d9b367577730d --- /dev/null +++ b/recipes/picobench/config.yml @@ -0,0 +1,5 @@ +versions: + "2.02": + folder: all + "2.01": + folder: all diff --git a/recipes/picojson/all/conandata.yml b/recipes/picojson/all/conandata.yml new file mode 100644 index 0000000000000..64e533b3e850a --- /dev/null +++ b/recipes/picojson/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210117": + url: "https://github.com/kazuho/picojson/archive/111c9be5188f7350c2eac9ddaedd8cca3d7bf394.zip" + sha256: "9937fc918d32a2e802a32e1565f48b04850ece0389ce22e8e3acba54aee13c99" + "1.3.0": + url: "https://github.com/kazuho/picojson/archive/v1.3.0.zip" + sha256: "58fff34589d93b0cef208a456788b9de6c7d04cfa9a7be576328ca7b48f10069" diff --git a/recipes/picojson/all/conanfile.py b/recipes/picojson/all/conanfile.py new file mode 100644 index 0000000000000..d6af3be3fb2be --- /dev/null +++ b/recipes/picojson/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PicoJSONConan(ConanFile): + name = "picojson" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kazuho/picojson" + description = "A C++ JSON parser/serializer" + topics = ("picojson", "json", "header-only") + 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) + + def build(self): + pass + + def package(self): + copy(self, "picojson.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/picojson/all/test_package/CMakeLists.txt b/recipes/picojson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..26a59553dbe52 --- /dev/null +++ b/recipes/picojson/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(picojson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picojson/all/test_package/conanfile.py b/recipes/picojson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/picojson/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/picojson/all/test_package/test_package.cpp b/recipes/picojson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65130d09a8e90 --- /dev/null +++ b/recipes/picojson/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +int main() { + std::string json{ "{ \"picojson_test\" : { \"number\" : 13, \"array\" : [1, 2, 3] } }" }; + picojson::value json_value; + + std::string error{ picojson::parse(json_value, json) }; + if (error.empty()) { + std::cout << json_value << std::endl; + std::cout << "Package test completed successfully"; + return 0; + } + + std::cout << "Package test completed, errors occurred:" << std::endl; + std::cerr << error << std::endl; + return 1; +} diff --git a/recipes/picojson/all/test_v1_package/CMakeLists.txt b/recipes/picojson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..76b4af39af45d --- /dev/null +++ b/recipes/picojson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(picojson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picojson/all/test_v1_package/conanfile.py b/recipes/picojson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/picojson/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/picojson/config.yml b/recipes/picojson/config.yml new file mode 100644 index 0000000000000..3bca60b62a2dc --- /dev/null +++ b/recipes/picojson/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210117": + folder: all + "1.3.0": + folder: all diff --git a/recipes/picosha2/all/conandata.yml b/recipes/picosha2/all/conandata.yml new file mode 100644 index 0000000000000..22dc3aff4c7d2 --- /dev/null +++ b/recipes/picosha2/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20220808": + url: "https://github.com/okdshin/PicoSHA2/archive/27fcf6979298949e8a462e16d09a0351c18fcaf2.tar.gz" + sha256: "18d82bb79c021ccf4ce58125b64691accef54237ba5194462740bacf8b39d8a9" + "1.0.0": + url: "https://github.com/okdshin/PicoSHA2/archive/refs/tags/v1.0.0.tar.gz" + sha256: "dec99b43440157847cf5dadfad060b9154749523da28eb1599872f87d1ea8e4b" diff --git a/recipes/picosha2/all/conanfile.py b/recipes/picosha2/all/conanfile.py new file mode 100644 index 0000000000000..dbbe31f41d82d --- /dev/null +++ b/recipes/picosha2/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, load, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class PicoSHA2Conan(ConanFile): + name = "picosha2" + description = "a header-file-only, SHA256 hash generator in C++ " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/okdshin/PicoSHA2" + topics = ("sha256", "hash", "header-only") + 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], destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + if Version(self.version) == "1.0.0": + filename = os.path.join(self.source_folder, self.source_folder, "picosha2.h") + file_content = load(save, filename) + license_start = "/*" + license_end = "*/" + license_contents = file_content[file_content.find(license_start)+len(license_start):file_content.find(license_end)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + else: + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/picosha2/all/test_package/CMakeLists.txt b/recipes/picosha2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a40eed23da8b --- /dev/null +++ b/recipes/picosha2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(picosha2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE picosha2::picosha2) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picosha2/all/test_package/conanfile.py b/recipes/picosha2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/picosha2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/picosha2/all/test_package/test_package.cpp b/recipes/picosha2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8c12c7c779d20 --- /dev/null +++ b/recipes/picosha2/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "picosha2.h" + +void CalcAndOutput(const std::string& src){ + std::cout << "src : \"" << src << "\"\n"; + std::cout << "hash: " << picosha2::hash256_hex_string(src) << "\n" << std::endl; +} + +int main(int argc, char* argv[]) +{ + CalcAndOutput(""); + + return 0; +} diff --git a/recipes/picosha2/all/test_v1_package/CMakeLists.txt b/recipes/picosha2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..145dcc03e0f3d --- /dev/null +++ b/recipes/picosha2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/picosha2/all/test_v1_package/conanfile.py b/recipes/picosha2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/picosha2/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/picosha2/config.yml b/recipes/picosha2/config.yml new file mode 100644 index 0000000000000..ce51ba5c3a9f5 --- /dev/null +++ b/recipes/picosha2/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220808": + folder: all + "1.0.0": + folder: all diff --git a/recipes/pipes/all/conandata.yml b/recipes/pipes/all/conandata.yml new file mode 100644 index 0000000000000..c7641b40591cf --- /dev/null +++ b/recipes/pipes/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/joboccara/pipes/archive/v1.0.0.tar.gz" + sha256: "f1d477e2627701e34a966be72530e3a243333632f09fb89df27e91f1c55fad0a" diff --git a/recipes/pipes/all/conanfile.py b/recipes/pipes/all/conanfile.py new file mode 100644 index 0000000000000..70bc84cbc789f --- /dev/null +++ b/recipes/pipes/all/conanfile.py @@ -0,0 +1,53 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +class PipesConan(ConanFile): + name = "pipes" + description = "Pipelines for expressive code on collections in C++" + license = "MIT" + topics = ("pipes", "functional-programming") + homepage = "https://github.com/joboccara/pipes" + url = "https://github.com/conan-io/conan-center-index" + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "3.4", + "apple-clang": "5.1", + } + + def configure(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)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("pipes-{}".format(self.version), self._source_subfolder) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include"), keep_path=True) diff --git a/recipes/pipes/all/test_package/CMakeLists.txt b/recipes/pipes/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f24c18a1bb2e1 --- /dev/null +++ b/recipes/pipes/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pipes REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} pipes::pipes) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/pipes/all/test_package/conanfile.py b/recipes/pipes/all/test_package/conanfile.py new file mode 100644 index 0000000000000..910ae60d10438 --- /dev/null +++ b/recipes/pipes/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +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/pipes/all/test_package/test_package.cpp b/recipes/pipes/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5279bc00ec63c --- /dev/null +++ b/recipes/pipes/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main() { + auto source = std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + auto destination = std::vector{}; + + source >>= pipes::filter([](int i){ return i % 2 == 0; }) + >>= pipes::transform([](int i){ return i * 2; }) + >>= pipes::push_back(destination); + + auto expected = std::vector{0, 4, 8, 12, 16}; + bool success = destination == expected; + + return success ? 0 : 1; +} diff --git a/recipes/pipes/config.yml b/recipes/pipes/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/pipes/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/pistache/all/conandata.yml b/recipes/pistache/all/conandata.yml new file mode 100644 index 0000000000000..4badc3fded984 --- /dev/null +++ b/recipes/pistache/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "0.0.5": + url: "https://github.com/pistacheio/pistache/archive/refs/tags/0.0.5.tar.gz" + sha256: "e2da87ebc01367e33bd8d7800cb2bf5c23e9fb4e6f49dce2cab5f8756df8dca0" + "cci.20201127": + url: "https://github.com/pistacheio/pistache/archive/a3c5c68e0f08e19331d53d12846079ad761fe974.tar.gz" + sha256: "f1abb9e43ff847ebff8edb72623c9942162df134bccfb571af9c7817d3261fae" +patches: + "cci.20201127": + - patch_file: "patches/0001-remove-fpic.patch" + patch_description: "disable fPIC" + patch_type: "conan" + - patch_file: "patches/0002-include-stddef.patch" + patch_description: "include " + patch_type: "portability" diff --git a/recipes/pistache/all/conanfile.py b/recipes/pistache/all/conanfile.py new file mode 100644 index 0000000000000..f80811935c92f --- /dev/null +++ b/recipes/pistache/all/conanfile.py @@ -0,0 +1,169 @@ +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, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.layout import basic_layout +from conan.tools.gnu import PkgConfigDeps + +import os + +required_conan_version = ">=1.53.0" + +class PistacheConan(ConanFile): + name = "pistache" + license = "Apache-2.0" + homepage = "https://github.com/pistacheio/pistache" + url = "https://github.com/conan-io/conan-center-index" + topics = ("http", "rest", "framework", "networking") + description = "Pistache is a modern and elegant HTTP and REST framework for C++" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": 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") + + def layout(self): + if self.version == "cci.20201127": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("rapidjson/cci.20220822") + if self.options.with_ssl: + self.requires("openssl/1.1.1s") + if self.version != "cci.20201127": + self.requires("date/3.0.1") + + def validate(self): + compilers = { + "gcc": "7", + "clang": "6", + } + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is only support on Linux.") + + if self.settings.compiler == "clang": + raise ConanInvalidConfiguration("Clang support is broken. See pistacheio/pistache#835.") + + if self.settings.compiler.cppstd: + check_min_cppstd(self, 17) + minimum_compiler = compilers.get(str(self.settings.compiler)) + if minimum_compiler: + if Version(self.settings.compiler.version) < minimum_compiler: + raise ConanInvalidConfiguration(f"{self.ref} requires c++17, which your compiler does not support.") + else: + self.output.warn(f"{self.ref} requires c++17, but this compiler is unknown to this recipe. Assuming your compiler supports c++17.") + + def build_requirements(self): + if self.version != "cci.20201127": + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.version == "cci.20201127": + tc = CMakeToolchain(self) + tc.variables["PISTACHE_ENABLE_NETWORK_TESTS"] = False + tc.variables["PISTACHE_USE_SSL"] = self.options.with_ssl + # pistache requires explicit value for fPIC + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + else: + tc = MesonToolchain(self) + tc.project_options["PISTACHE_USE_SSL"] = self.options.with_ssl + tc.project_options["PISTACHE_BUILD_EXAMPLES"] = False + tc.project_options["PISTACHE_BUILD_TESTS"] = False + tc.project_options["PISTACHE_BUILD_DOCS"] = False + tc.generate() + + tc = PkgConfigDeps(self) + tc.generate() + + env = VirtualBuildEnv(self) + env.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + if self.version != "cci.20201127": + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "dependency('RapidJSON', fallback: ['rapidjson', 'rapidjson_dep']),", + "dependency('rapidjson', fallback: ['rapidjson', 'rapidjson_dep']),") + + if self.version == "cci.20201127": + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + 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) + if self.version == "cci.20201127": + cmake = CMake(self) + cmake.install() + else: + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + # TODO: Pistache does not use namespace + # TODO: Pistache variables are CamelCase e.g Pistache_BUILD_DIRS + self.cpp_info.set_property("cmake_file_name", "Pistache") + self.cpp_info.set_property("cmake_target_name", "Pistache::Pistache") + # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "libpistache") + + self.cpp_info.components["libpistache"].libs = collect_libs(self) + self.cpp_info.components["libpistache"].requires = ["rapidjson::rapidjson"] + if self.options.with_ssl: + self.cpp_info.components["libpistache"].requires.append("openssl::openssl") + self.cpp_info.components["libpistache"].defines = ["PISTACHE_USE_SSL=1"] + if self.settings.os == "Linux": + self.cpp_info.components["libpistache"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Pistache" + self.cpp_info.filenames["cmake_find_package_multi"] = "Pistache" + self.cpp_info.names["cmake_find_package"] = "Pistache" + self.cpp_info.names["cmake_find_package_multi"] = "Pistache" + self.cpp_info.names["pkg_config"] = "libpistache" + suffix = "_{}".format("shared" if self.options.shared else "static") + self.cpp_info.components["libpistache"].names["cmake_find_package"] = "pistache" + suffix + self.cpp_info.components["libpistache"].names["cmake_find_package_multi"] = "pistache" + suffix diff --git a/recipes/pistache/all/patches/0001-remove-fpic.patch b/recipes/pistache/all/patches/0001-remove-fpic.patch new file mode 100644 index 0000000000000..fa8d26ee36728 --- /dev/null +++ b/recipes/pistache/all/patches/0001-remove-fpic.patch @@ -0,0 +1,12 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9cdac6b..b2d13b4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -12,7 +12,6 @@ set(SOURCE_FILES + ) + + add_library(pistache OBJECT ${SOURCE_FILES}) +-set_target_properties(pistache PROPERTIES POSITION_INDEPENDENT_CODE 1) + add_definitions(-DONLY_C_LOCALE=1) + + set(PISTACHE_INCLUDE diff --git a/recipes/pistache/all/patches/0002-include-stddef.patch b/recipes/pistache/all/patches/0002-include-stddef.patch new file mode 100644 index 0000000000000..1f4d2425cd4c8 --- /dev/null +++ b/recipes/pistache/all/patches/0002-include-stddef.patch @@ -0,0 +1,12 @@ +fixed upstream https://github.com/pistacheio/pistache/pull/965 + +--- a/include/pistache/typeid.h ++++ b/include/pistache/typeid.h +@@ -11,6 +11,7 @@ + + #pragma once + ++#include + #include + + namespace Pistache { diff --git a/recipes/pistache/all/test_package/CMakeLists.txt b/recipes/pistache/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..879baa5c03bf1 --- /dev/null +++ b/recipes/pistache/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Pistache REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} Pistache::Pistache) +if(Pistache_VERSION EQUAL "cci.20201127") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/pistache/all/test_package/conanfile.py b/recipes/pistache/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/pistache/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pistache/all/test_package/test_package.cpp b/recipes/pistache/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f29b0d71a6edb --- /dev/null +++ b/recipes/pistache/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include "pistache/endpoint.h" + +using namespace Pistache; + +class HelloHandler : public Http::Handler { +public: + + HTTP_PROTOTYPE(HelloHandler) + + void onRequest(const Http::Request& request, Http::ResponseWriter response) override{ + response.send(Pistache::Http::Code::Ok, "Hello World\n"); + } +}; + +int main() { + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(9080)); + auto opts = Pistache::Http::Endpoint::options() + .threads(1); + + Http::Endpoint server(addr); + server.init(opts); + server.setHandler(Http::make_handler()); + server.serveThreaded(); + server.shutdown(); + + return 0; +} diff --git a/recipes/pistache/all/test_v1_package/CMakeLists.txt b/recipes/pistache/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/pistache/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pistache/all/test_v1_package/conanfile.py b/recipes/pistache/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/pistache/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pistache/config.yml b/recipes/pistache/config.yml new file mode 100644 index 0000000000000..7515a206bd537 --- /dev/null +++ b/recipes/pistache/config.yml @@ -0,0 +1,5 @@ +versions: + "0.0.5": + folder: all + "cci.20201127": + folder: all diff --git a/recipes/pixman/all/conandata.yml b/recipes/pixman/all/conandata.yml new file mode 100644 index 0000000000000..1f4279689a6c3 --- /dev/null +++ b/recipes/pixman/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "0.40.0": + url: "https://www.cairographics.org/releases/pixman-0.40.0.tar.gz" + sha256: "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc" + "0.38.4": + url: "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" + sha256: "da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7" +patches: + "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" + "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 new file mode 100644 index 0000000000000..94146c6c721b7 --- /dev/null +++ b/recipes/pixman/all/conanfile.py @@ -0,0 +1,100 @@ +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, collect_libs, copy, export_conandata_patches, get, + rename, replace_in_file, rm, rmdir +) +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + + +class PixmanConan(ConanFile): + name = "pixman" + description = "Pixman is a low-level software library for pixel manipulation" + topics = ("graphics", "compositing", "rasterization") + 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], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("pixman can only be built as a static library on Windows") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options.update({ + "libpng": "disabled", + "gtk": "disabled" + }) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "") + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('demos')", "") + + def build(self): + self._patch_sources() + 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() + lib_folder = os.path.join(self.package_folder, "lib") + rmdir(self, os.path.join(lib_folder, "pkgconfig")) + rm(self, "*.la", lib_folder) + fix_apple_shared_install_name(self) + if is_msvc(self): + prefix = "libpixman-1" + rename(self, os.path.join(lib_folder, f"{prefix}.a"), os.path.join(lib_folder, f"{prefix}.lib")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.includedirs.append(os.path.join("include", "pixman-1")) + self.cpp_info.set_property("pkg_config_name", "pixman-1") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch new file mode 100644 index 0000000000000..ee95a8b091433 --- /dev/null +++ b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000000000..6063b377301a8 --- /dev/null +++ b/recipes/pixman/all/patches/0002-meson-build.patch @@ -0,0 +1,253 @@ +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/test_package/CMakeLists.txt b/recipes/pixman/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f938457c94703 --- /dev/null +++ b/recipes/pixman/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(pixman CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pixman::pixman) diff --git a/recipes/pixman/all/test_package/conanfile.py b/recipes/pixman/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e2fd2bc866104 --- /dev/null +++ b/recipes/pixman/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 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/pixman/all/test_package/test_package.c b/recipes/pixman/all/test_package/test_package.c new file mode 100644 index 0000000000000..80ec8bdd377a9 --- /dev/null +++ b/recipes/pixman/all/test_package/test_package.c @@ -0,0 +1,52 @@ +#include +#include + +#include +#include + +#define SIZE 128 +#define GRADIENTS_PER_ROW 7 +#define NUM_ROWS ((NUM_GRADIENTS + GRADIENTS_PER_ROW - 1) / GRADIENTS_PER_ROW) +#define WIDTH (SIZE * GRADIENTS_PER_ROW) +#define HEIGHT (SIZE * NUM_ROWS) +#define NUM_GRADIENTS 35 + +#define double_to_color(x) \ + (((uint32_t) ((x)*65536)) - (((uint32_t) ((x)*65536)) >> 16)) + +#define PIXMAN_STOP(offset,r,g,b,a) \ + { pixman_double_to_fixed (offset), \ + { \ + double_to_color (r), \ + double_to_color (g), \ + double_to_color (b), \ + double_to_color (a) \ + } \ + } + + +static const pixman_gradient_stop_t stops[] = { + PIXMAN_STOP (0.25, 1, 0, 0, 0.7), + PIXMAN_STOP (0.5, 1, 1, 0, 0.7), + PIXMAN_STOP (0.75, 0, 1, 0, 0.7), + PIXMAN_STOP (1.0, 0, 0, 1, 0.7) +}; + +#define NUM_STOPS (sizeof (stops) / sizeof (stops[0])) + +int main() { + pixman_point_fixed_t c; + double angle; + pixman_image_t *src_img; + + printf("pixman version: %s\n", PIXMAN_VERSION_STRING); + + c.x = pixman_double_to_fixed (0); + c.y = pixman_double_to_fixed (0); + + angle = (0.5 / NUM_GRADIENTS + 1 / (double)NUM_GRADIENTS) * 720 - 180; + src_img = pixman_image_create_conical_gradient (&c, pixman_double_to_fixed(angle), stops, NUM_STOPS); + pixman_image_unref (src_img); + + return EXIT_SUCCESS; +} diff --git a/recipes/pixman/all/test_v1_package/CMakeLists.txt b/recipes/pixman/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pixman/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pixman/all/test_v1_package/conanfile.py b/recipes/pixman/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/pixman/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/pixman/config.yml b/recipes/pixman/config.yml new file mode 100644 index 0000000000000..b237af91644c9 --- /dev/null +++ b/recipes/pixman/config.yml @@ -0,0 +1,5 @@ +versions: + "0.40.0": + folder: "all" + "0.38.4": + folder: "all" diff --git a/recipes/pkgconf/all/conandata.yml b/recipes/pkgconf/all/conandata.yml new file mode 100644 index 0000000000000..e18df3ec61ad1 --- /dev/null +++ b/recipes/pkgconf/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.9.3": + url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.9.3.tar.xz" + sha256: "5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d" + "1.7.4": + url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz" + sha256: "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab" + "1.7.3": + url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.3.tar.xz" + sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" +patches: + "1.9.3": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "1.7.4": + - patch_file: "patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch" + - patch_file: "patches/1.7.4-0002-fix-static-link.patch" + - patch_file: "patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "1.7.3": + - patch_file: "patches/1.7.3-0001-meson-use-declare-dependencies.patch" + - patch_file: "patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch" + - patch_file: "patches/1.7.3-0003-meson-use-library.patch" + - patch_file: "patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" diff --git a/recipes/pkgconf/all/conanfile.py b/recipes/pkgconf/all/conanfile.py new file mode 100644 index 0000000000000..33928609ef2e5 --- /dev/null +++ b/recipes/pkgconf/all/conanfile.py @@ -0,0 +1,149 @@ +import os + +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc, unix_path_package_info_legacy +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.57.0" + + +class PkgConfConan(ConanFile): + name = "pkgconf" + url = "https://github.com/conan-io/conan-center-index" + topics = ("build", "configuration") + homepage = "https://git.sr.ht/~kaniini/pkgconf" + license = "ISC" + description = "package compiler and linker metadata toolkit" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_lib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_lib": False, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if not self.options.enable_lib: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + elif self.options.shared: + self.options.rm_safe("fPIC") + + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + if not self.options.get_safe("shared", False): + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "'-DLIBPKGCONF_EXPORT'", + "'-DPKGCONFIG_IS_STATIC'") + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "project('pkgconf', 'c',", + "project('pkgconf', 'c',\ndefault_options : ['c_std=gnu99'],") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = MesonToolchain(self) + tc.project_options["tests"] = False + if not self.options.enable_lib: + tc.project_options["default_library"] = "static" + tc.generate() + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder,"licenses")) + + meson = Meson(self) + meson.install() + + if is_msvc(self): + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.enable_lib and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libpkgconf.a"), + os.path.join(self.package_folder, "lib", "pkgconf.lib"),) + + if not self.options.enable_lib: + rmdir(self, os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "include")) + + + rmdir(self, os.path.join(self.package_folder, "share", "man")) + rename(self, os.path.join(self.package_folder, "share", "aclocal"), + os.path.join(self.package_folder, "bin", "aclocal")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_id(self): + if not self.info.options.enable_lib: + del self.info.settings.compiler + + def package_info(self): + if self.options.enable_lib: + self.cpp_info.set_property("pkg_config_name", "libpkgconf") + if Version(self.version) >= "1.7.4": + self.cpp_info.includedirs.append(os.path.join("include", "pkgconf")) + self.cpp_info.libs = ["pkgconf"] + if not self.options.shared: + self.cpp_info.defines = ["PKGCONFIG_IS_STATIC"] + else: + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH env var: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + exesuffix = ".exe" if self.settings.os == "Windows" else "" + pkg_config = os.path.join(bindir, "pkgconf" + exesuffix).replace("\\", "/") + self.output.info("Setting PKG_CONFIG env var: {}".format(pkg_config)) + self.buildenv_info.define_path("PKG_CONFIG", pkg_config) + + pkgconf_aclocal = os.path.join(self.package_folder, "bin", "aclocal") + self.buildenv_info.prepend_path("ACLOCAL_PATH", pkgconf_aclocal) + # TODO: evaluate if `ACLOCAL_PATH` is enough and we can stop using `AUTOMAKE_CONAN_INCLUDES` + self.buildenv_info.prepend_path("AUTOMAKE_CONAN_INCLUDES", pkgconf_aclocal) + + # TODO: remove in conanv2 + automake_extra_includes = unix_path_package_info_legacy(self, pkgconf_aclocal.replace("\\", "/")) + self.output.info("Appending AUTOMAKE_CONAN_INCLUDES env var: {}".format(automake_extra_includes)) + self.env_info.PKG_CONFIG = pkg_config + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(automake_extra_includes) + + # TODO: to remove in conan v2 once pkg_config generator removed + if self.options.enable_lib: + self.cpp_info.names["pkg_config"] = "libpkgconf" diff --git a/recipes/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch b/recipes/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch new file mode 100644 index 0000000000000..1e4ed6fbf953f --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch @@ -0,0 +1,20 @@ +--- meson.build ++++ meson.build +@@ -84,12 +84,16 @@ + soversion : '3', + ) + ++libpkgconf_dep = declare_dependency( ++ link_with: libpkgconf, ++ compile_args: '-DLIBPKGCONF_EXPORT', ++) + + pkgconf_exe = executable('pkgconf', + 'cli/main.c', + 'cli/getopt_long.c', + 'cli/renderer-msvc.c', +- link_with : libpkgconf, ++ dependencies: libpkgconf_dep, + install : true) + + if get_option('tests') diff --git a/recipes/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch b/recipes/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch new file mode 100644 index 0000000000000..6ac86aa65fa51 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch @@ -0,0 +1,19 @@ +--- meson.build ++++ meson.build +@@ -31,11 +31,11 @@ +- ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', 'sys/cygwin.h'], +- ['HAVE_STRLCAT', 'strlcat', 'string.h'], +- ['HAVE_STRLCPY', 'strlcpy', 'string.h'], +- ['HAVE_STRNDUP', 'strndup', 'string.h'], ++ ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path(CCP_POSIX_TO_WIN_A, (void*)0, (void*)0, 0)', 'sys/cygwin.h'], ++ ['HAVE_STRLCAT', 'strlcat((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRLCPY', 'strlcpy((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRNDUP', 'strndup((void*)0, 0)', 'string.h'], + ] + + foreach f : check_functions +- if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) ++ if cc.links('#include <' + f.get(2) + '>\nint main() { ' + f.get(1) + ';}') + cdata.set(f.get(0), 1) + endif + endforeach diff --git a/recipes/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch b/recipes/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch new file mode 100644 index 0000000000000..0bc7ebcae7e40 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch @@ -0,0 +1,11 @@ +--- meson.build ++++ meson.build +@@ -63,7 +63,7 @@ + + subdir('libpkgconf') + +-libpkgconf = shared_library('pkgconf', ++libpkgconf = library('pkgconf', + 'libpkgconf/argvsplit.c', + 'libpkgconf/audit.c', + 'libpkgconf/bsdstubs.c', diff --git a/recipes/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000000000..c0bee016060c0 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -146,7 +146,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/recipes/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch b/recipes/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch new file mode 100644 index 0000000000000..68442e9ada001 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch @@ -0,0 +1,19 @@ +--- meson.build ++++ meson.build +@@ -13,11 +13,11 @@ +- ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', 'sys/cygwin.h'], +- ['HAVE_STRLCAT', 'strlcat', 'string.h'], +- ['HAVE_STRLCPY', 'strlcpy', 'string.h'], +- ['HAVE_STRNDUP', 'strndup', 'string.h'], ++ ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path(CCP_POSIX_TO_WIN_A, (void*)0, (void*)0, 0)', 'sys/cygwin.h'], ++ ['HAVE_STRLCAT', 'strlcat((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRLCPY', 'strlcpy((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRNDUP', 'strndup((void*)0, 0)', 'string.h'], + ] + + foreach f : check_functions +- if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) ++ if cc.links('#include <' + f.get(2) + '>\nint main() { ' + f.get(1) + ';}') + cdata.set(f.get(0), 1) + endif + endforeach diff --git a/recipes/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch b/recipes/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch new file mode 100644 index 0000000000000..dd92515da0a62 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch @@ -0,0 +1,44 @@ +diff --git a/meson.build b/meson.build +index e7822b8da..8f7aa0075 100644 +--- a/meson.build ++++ b/meson.build +@@ -45,6 +45,13 @@ cdata.set('abs_top_builddir', meson.build_root()) + + subdir('libpkgconf') + ++libtype = get_option('default_library') ++if libtype == 'static' ++ build_static = '-DPKGCONFIG_IS_STATIC' ++else ++ build_static = '-DLIBPKGCONF_EXPORT' ++endif ++ + libpkgconf = library('pkgconf', + 'libpkgconf/argvsplit.c', + 'libpkgconf/audit.c', +@@ -60,7 +67,7 @@ libpkgconf = library('pkgconf', + 'libpkgconf/pkg.c', + 'libpkgconf/queue.c', + 'libpkgconf/tuple.c', +- c_args: '-DLIBPKGCONF_EXPORT', ++ c_args: build_static, + install : true, + version : '3.0.0', + soversion : '3', +@@ -73,13 +80,16 @@ pkg.generate(libpkgconf, + url: 'http://github.com/pkgconf/pkgconf', + filebase : 'libpkgconf', + subdirs: ['pkgconf'], ++ extra_cflags : build_static + ) + ++ + pkgconf_exe = executable('pkgconf', + 'cli/main.c', + 'cli/getopt_long.c', + 'cli/renderer-msvc.c', + link_with : libpkgconf, ++ c_args: build_static, + install : true) + + if get_option('tests') diff --git a/recipes/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000000000..6c8cd857aecda --- /dev/null +++ b/recipes/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -142,7 +142,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000000000..8c6738a233a52 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -138,7 +138,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/recipes/pkgconf/all/test_package/conanfile.py b/recipes/pkgconf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bf269283d5b1b --- /dev/null +++ b/recipes/pkgconf/all/test_package/conanfile.py @@ -0,0 +1,92 @@ +from io import StringIO +import os +from pathlib import Path +import re + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import unix_path + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + 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") + + 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}") + env.prepend_path("PKG_CONFIG_PATH", self.source_folder) + env.vars(self, scope="build").save_script("pkgconf-config-path") + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + # CMake project to test that we can link against the library, + # when the library is built + if self.dependencies[self.tested_reference_str].options.enable_lib: + ct = CMakeToolchain(self) + ct.generate() + deps = CMakeDeps(self) + deps.generate() + + @property + def _testing_library(self): + # Workaround, in Conan >=2.0 we should be able to remove this in favour of: + # self.dependencies[self.tested_reference_str].options.enable_lib + has_toolchain = sorted(Path(self.build_folder).rglob('conan_toolchain.cmake')) + return has_toolchain + + def build(self): + # 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() + cmake.build() + + 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() + + # Test that executable linked against library runs as expected + if can_run(self) and self._testing_library: + test_executable = unix_path(self, os.path.join(self.cpp.build.bindirs[0], "test_package")) + self.run(test_executable, env="conanrun") diff --git a/recipes/pkgconf/all/test_package/src/CMakeLists.txt b/recipes/pkgconf/all/test_package/src/CMakeLists.txt new file mode 100644 index 0000000000000..04e3aa2d2e36a --- /dev/null +++ b/recipes/pkgconf/all/test_package/src/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(pkgconf REQUIRED) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pkgconf::pkgconf) diff --git a/recipes/pkgconf/all/test_package/src/configure.ac b/recipes/pkgconf/all/test_package/src/configure.ac new file mode 100644 index 0000000000000..9b58503d96f4d --- /dev/null +++ b/recipes/pkgconf/all/test_package/src/configure.ac @@ -0,0 +1,9 @@ +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_package/src/libexample1.pc b/recipes/pkgconf/all/test_package/src/libexample1.pc new file mode 100644 index 0000000000000..5fc1beac53aac --- /dev/null +++ b/recipes/pkgconf/all/test_package/src/libexample1.pc @@ -0,0 +1,6 @@ +Name: libexample1 +Description: This is a description of libexample1. +Requires: +Version: 0.42 +Libs: -L/usr/lib -lexample1 +Cflags: -I/usr/include/libexample1 -I/usr/include -DEXAMPLE1_STATIC diff --git a/recipes/pkgconf/all/test_package/src/test_package.c b/recipes/pkgconf/all/test_package/src/test_package.c new file mode 100644 index 0000000000000..f8fd8ee550059 --- /dev/null +++ b/recipes/pkgconf/all/test_package/src/test_package.c @@ -0,0 +1,24 @@ +#include "libpkgconf/libpkgconf.h" + +#include +#include +#include + +bool error_callback(const char *msg, const pkgconf_client_t *client, const void *data) { + printf("error callback: %s\n", msg); + fflush(stdout); + return 1; // 1/true means message handled +} + +int main() { + pkgconf_client_t client; + memset(&client, 0, sizeof(client)); + + pkgconf_client_init(&client, error_callback, NULL, pkgconf_cross_personality_default()); + + pkgconf_error(&client, "%s:%d %s: %s", __FILE__, __LINE__, __FUNCTION__, "test error"); + + pkgconf_client_deinit(&client); + + return 0; +} diff --git a/recipes/pkgconf/all/test_v1_package/CMakeLists.txt b/recipes/pkgconf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f8b971e2db377 --- /dev/null +++ b/recipes/pkgconf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_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 new file mode 100644 index 0000000000000..b2a27f28edf88 --- /dev/null +++ b/recipes/pkgconf/all/test_v1_package/conanfile.py @@ -0,0 +1,56 @@ +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 new file mode 100644 index 0000000000000..f9bf1936b8123 --- /dev/null +++ b/recipes/pkgconf/all/test_v1_package/configure.ac @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000000..5fc1beac53aac --- /dev/null +++ b/recipes/pkgconf/all/test_v1_package/libexample1.pc @@ -0,0 +1,6 @@ +Name: libexample1 +Description: This is a description of libexample1. +Requires: +Version: 0.42 +Libs: -L/usr/lib -lexample1 +Cflags: -I/usr/include/libexample1 -I/usr/include -DEXAMPLE1_STATIC diff --git a/recipes/pkgconf/all/test_v1_package/test_package.c b/recipes/pkgconf/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..f8fd8ee550059 --- /dev/null +++ b/recipes/pkgconf/all/test_v1_package/test_package.c @@ -0,0 +1,24 @@ +#include "libpkgconf/libpkgconf.h" + +#include +#include +#include + +bool error_callback(const char *msg, const pkgconf_client_t *client, const void *data) { + printf("error callback: %s\n", msg); + fflush(stdout); + return 1; // 1/true means message handled +} + +int main() { + pkgconf_client_t client; + memset(&client, 0, sizeof(client)); + + pkgconf_client_init(&client, error_callback, NULL, pkgconf_cross_personality_default()); + + pkgconf_error(&client, "%s:%d %s: %s", __FILE__, __LINE__, __FUNCTION__, "test error"); + + pkgconf_client_deinit(&client); + + return 0; +} diff --git a/recipes/pkgconf/config.yml b/recipes/pkgconf/config.yml new file mode 100644 index 0000000000000..9816b088e4d7b --- /dev/null +++ b/recipes/pkgconf/config.yml @@ -0,0 +1,7 @@ +versions: + "1.9.3": + folder: "all" + "1.7.4": + folder: "all" + "1.7.3": + folder: "all" diff --git a/recipes/platform.converters/all/conandata.yml b/recipes/platform.converters/all/conandata.yml new file mode 100644 index 0000000000000..dbc2ae3eae699 --- /dev/null +++ b/recipes/platform.converters/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: https://github.com/linksplatform/Converters/archive/refs/tags/cpp_0.1.0.zip + sha256: a1a9e566b6628b1e09875f9ee93fb7fb600a8371d07e00a25c127e1609375d96 diff --git a/recipes/platform.converters/all/conanfile.py b/recipes/platform.converters/all/conanfile.py new file mode 100644 index 0000000000000..4991da89bae2c --- /dev/null +++ b/recipes/platform.converters/all/conanfile.py @@ -0,0 +1,65 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PlatformConvertersConan(ConanFile): + name = "platform.converters" + license = "MIT" + homepage = "https://github.com/linksplatform/Converters" + url = "https://github.com/conan-io/conan-center-index" + description = "platform.converters is one of the libraries of the LinksPlatform modular framework, " \ + "to provide conversions between different types" + topics = ("linksplatform", "cpp20", "converters", "any", "native") + settings = "compiler", "arch" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _internal_cpp_subfolder(self): + return os.path.join(self._source_subfolder, "cpp", "Platform.Converters") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "16", + "clang": "14", + "apple-clang": "14" + } + + @property + def _minimum_cpp_standard(self): + return 20 + + def validate(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + + if not minimum_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler)) + + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{}/{} requires c++{}, " + "which is not supported by {} {}.".format( + self.name, self.version, self._minimum_cpp_standard, self.settings.compiler, + self.settings.compiler.version)) + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*.h", dst="include", src=self._internal_cpp_subfolder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) diff --git a/recipes/platform.converters/all/test_package/CMakeLists.txt b/recipes/platform.converters/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..80c8108b7c3f7 --- /dev/null +++ b/recipes/platform.converters/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(platform.converters CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} platform.converters::platform.converters) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) diff --git a/recipes/platform.converters/all/test_package/conanfile.py b/recipes/platform.converters/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/platform.converters/all/test_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/platform.converters/all/test_package/test_package.cpp b/recipes/platform.converters/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..283e7f59b558b --- /dev/null +++ b/recipes/platform.converters/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +using namespace Platform::Converters; + +int main() { + int source {48}; + char to = Converter::Convert(source); + std::cout<<"int value: "< + +#include +using namespace Platform::Delegates; + +template +struct EventfulSet : public std::set +{ + using base = std::set; + + template + EventfulSet(Args&&... args) : base(args...) {} + + MulticastDelegate InsertEvent{}; + MulticastDelegate InsertDuplicateEvent{}; + + void insert(T&& item) + { + InsertEvent(std::forward(item)); + + if (this->find(std::forward(item)) != this->end()) { + InsertDuplicateEvent(std::forward(item)); + } + + base::insert(std::forward(item)); + } +}; + +int main() +{ + std::list duplicates; + + EventfulSet set; + set.InsertEvent += std::function{[](int&& item) { std::cout << "insert to list: " << item << std::endl; }}; + set.InsertDuplicateEvent += std::function{[&](int&& item) { duplicates.push_back(item); }}; + + set.insert(1); + set.insert(2); + set.insert(3); + set.insert(1); + set.insert(0); + set.insert(2); + set.insert(3); + + std::cout << "set is: "; + for (auto item : set) { + std::cout << item << " "; + } + std::cout << std::endl; + + std::cout << "captured duplicates: "; + for (auto item : duplicates) { + std::cout << item << " "; + } + std::cout << std::endl; + return 0; +} diff --git a/recipes/platform.delegates/config.yml b/recipes/platform.delegates/config.yml new file mode 100644 index 0000000000000..b1a51775b387a --- /dev/null +++ b/recipes/platform.delegates/config.yml @@ -0,0 +1,5 @@ +versions: + "0.1.3": + folder: all + "0.2.7": + folder: all diff --git a/recipes/platform.equality/all/conandata.yml b/recipes/platform.equality/all/conandata.yml new file mode 100644 index 0000000000000..c8818584c1233 --- /dev/null +++ b/recipes/platform.equality/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.1": + url: https://github.com/linksplatform/Equality/archive/refs/tags/0.0.1.zip + sha256: 84c363152ab7eef69a9d72a1aebcfabcd63fc889efce591350ec56ddec544981 diff --git a/recipes/platform.equality/all/conanfile.py b/recipes/platform.equality/all/conanfile.py new file mode 100644 index 0000000000000..ce4633881f0af --- /dev/null +++ b/recipes/platform.equality/all/conanfile.py @@ -0,0 +1,66 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PlatformInterfacesConan(ConanFile): + name = "platform.equality" + license = "LGPL-3.0-or-later" + homepage = "https://github.com/linksplatform/Equality" + url = "https://github.com/conan-io/conan-center-index" + description = "platform.delegates is one of the libraries of the LinksPlatform modular framework, " \ + "which uses innovations from the C++20 standard, for slow parody any typing dictionary and others." + topics = ("linksplatform", "cpp20", "equality", "ranges", "any", "header-only") + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _internal_cpp_subfolder(self): + return os.path.join(self._source_subfolder, "cpp", "Platform.Equality") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "16", + "clang": "11", + "apple-clang": "11" + } + + @property + def _minimum_cpp_standard(self): + return 20 + + def validate(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + + if not minimum_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler)) + + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("platform.equality/{} " + "requires C++{} with {}, " + "which is not supported " + "by {} {}.".format( + self.version, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler, + self.settings.compiler.version)) + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy("*.h", dst="include", src=self._internal_cpp_subfolder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/platform.equality/all/test_package/CMakeLists.txt b/recipes/platform.equality/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c6c4cb78292be --- /dev/null +++ b/recipes/platform.equality/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) diff --git a/recipes/platform.equality/all/test_package/conanfile.py b/recipes/platform.equality/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/platform.equality/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/platform.equality/all/test_package/test_package.cpp b/recipes/platform.equality/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fa88538c2fc86 --- /dev/null +++ b/recipes/platform.equality/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include + +auto main() -> int { + boolalpha(std::cout); + + #define eval(expr) #expr << ": " << (expr) + + using std::any; + std::cout << eval(any(5) == any(5)) << std::endl; + std::cout << eval(any(5) == any(5u)) << std::endl; + + #undef eval +} diff --git a/recipes/platform.equality/config.yml b/recipes/platform.equality/config.yml new file mode 100644 index 0000000000000..f6f5b5679b9d4 --- /dev/null +++ b/recipes/platform.equality/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.1": + folder: all diff --git a/recipes/platform.exceptions/all/conandata.yml b/recipes/platform.exceptions/all/conandata.yml new file mode 100644 index 0000000000000..9d13e79d6d995 --- /dev/null +++ b/recipes/platform.exceptions/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.0": + url: https://github.com/linksplatform/Exceptions/archive/refs/tags/0.4.0_0.2.0.zip + sha256: 9e4513da667e41f0bbe776123747ac63958972edb00eaee300c495ae3b39eb9b + "0.3.0": + url: https://github.com/linksplatform/Exceptions/archive/refs/tags/cpp_0.3.0.zip + sha256: 08506f334098e8c9106ff357efd7f68b83a3c1f4dc03b6b97b6229b14737d0ce diff --git a/recipes/platform.exceptions/all/conanfile.py b/recipes/platform.exceptions/all/conanfile.py new file mode 100644 index 0000000000000..e352e58aa4f01 --- /dev/null +++ b/recipes/platform.exceptions/all/conanfile.py @@ -0,0 +1,71 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PlatformExceptionsConan(ConanFile): + name = "platform.exceptions" + license = "MIT" + homepage = "https://github.com/linksplatform/Exceptions" + url = "https://github.com/conan-io/conan-center-index" + description = "platform.exceptions is one of the libraries of the LinksPlatform modular framework, " \ + "to ensure exceptions" + topics = ("linksplatform", "cpp20", "exceptions", "any", "ranges", "native") + settings = "compiler", "arch" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _internal_cpp_subfolder(self): + return os.path.join(self._source_subfolder, "cpp", "Platform.Exceptions") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "16", + "clang": "11", + "apple-clang": "11" + } + + @property + def _minimum_cpp_standard(self): + return 20 + + def requirements(self): + if tools.Version(self.version) >= "0.3.0": + self.requires("platform.delegates/0.2.7") + else: + self.requires("platform.delegates/0.1.3") + + def validate(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + + if not minimum_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler)) + + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{}/{} requires c++{}, " + "which is not supported by {} {}.".format( + self.name, self.version, self._minimum_cpp_standard, self.settings.compiler, + self.settings.compiler.version)) + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*.h", dst="include", src=self._internal_cpp_subfolder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) diff --git a/recipes/platform.exceptions/all/test_package/CMakeLists.txt b/recipes/platform.exceptions/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dadfcbe5ecf0a --- /dev/null +++ b/recipes/platform.exceptions/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) diff --git a/recipes/platform.exceptions/all/test_package/conanfile.py b/recipes/platform.exceptions/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/platform.exceptions/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/platform.exceptions/all/test_package/test_package.cpp b/recipes/platform.exceptions/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2073426622826 --- /dev/null +++ b/recipes/platform.exceptions/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +#include + +using namespace Platform::Exceptions; + +auto main() -> int { + try { + Ensure::Always::ArgumentNotNull(nullptr); + } catch (std::exception& e) { + std::cout << e.what() << std::endl; + } +} diff --git a/recipes/platform.exceptions/config.yml b/recipes/platform.exceptions/config.yml new file mode 100644 index 0000000000000..0906286bf1225 --- /dev/null +++ b/recipes/platform.exceptions/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.0": + folder: all + "0.3.0": + folder: all diff --git a/recipes/platform.hashing/all/conandata.yml b/recipes/platform.hashing/all/conandata.yml new file mode 100644 index 0000000000000..82435a6d7e4a8 --- /dev/null +++ b/recipes/platform.hashing/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.2.0": + url: https://github.com/linksplatform/Hashing/archive/refs/tags/0.2.0.zip + sha256: 8e34a10d2768d0f2d9ba0cbb88ce193b32245c5a46f14f7ec860c9fddbe8f39f + "0.3.0": + url: https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.3.0.zip + sha256: 8f7d6d401eaec1a78d1f10bfa3783b31ac6189a6ea8edf1ef7f300c47c0e5cb1 + "0.4.0": + url: https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.4.0.zip + sha256: afb8a27a483f636515ca4289f2bfa80fbd37c8416631f0b3ff7001d17a054320 diff --git a/recipes/platform.hashing/all/conanfile.py b/recipes/platform.hashing/all/conanfile.py new file mode 100644 index 0000000000000..7e465451b8a23 --- /dev/null +++ b/recipes/platform.hashing/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +try: + from conan.tools.build import check_min_cppstd +except ImportError: + from conans.tools import check_min_cppstd # FIXME : not in 1.49 +from conan.tools.files import get +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PlatformInterfacesConan(ConanFile): + name = "platform.hashing" + license = "LGPL-3.0-only" + homepage = "https://github.com/linksplatform/Hashing" + url = "https://github.com/conan-io/conan-center-index" + description = "platform.hashing is one of the libraries of the LinksPlatform modular framework, " \ + "which contains std::hash specializations for:\n" \ + " - trivial and standard-layout types\n" \ + " - types constrained by std::ranges::range\n" \ + " - std::any" + topics = ("linksplatform", "cpp20", "hashing", "any", "ranges", "native") + settings = "compiler", "arch" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _internal_cpp_subfolder(self): + return os.path.join(self._source_subfolder, "cpp", "Platform.Hashing") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "16", + "clang": "14", + "apple-clang": "14" + } + + @property + def _minimum_cpp_standard(self): + return 20 + + def validate(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + + if not minimum_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler)) + + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{}/{} requires c++{}, " + "which is not supported by {} {}.".format( + self.name, self.version, self._minimum_cpp_standard, self.settings.compiler, + self.settings.compiler.version)) + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + if self.settings.arch in ("x86", ): + raise ConanInvalidConfiguration("{} does not support arch={}".format(self.name, self.settings.arch)) + + def package_id(self): + self.info.header_only() + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*.h", dst="include", src=self._internal_cpp_subfolder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libdirs = [] + suggested_flags = "" + if self.settings.compiler != "Visual Studio": + suggested_flags = { + "x86_64": "-march=haswell", + "armv7": "-march=armv7", + "armv8": "-march=armv8-a", + }.get(str(self.settings.arch), "") + self.user_info.suggested_flags = suggested_flags + + if "-march" not in "{} {}".format(os.environ.get("CPPFLAGS", ""), os.environ.get("CXXFLAGS", "")): + self.output.warn("platform.hashing needs to have `-march=ARCH` added to CPPFLAGS/CXXFLAGS. " + "A suggestion is available in deps_user_info[{name}].suggested_flags.".format(name=self.name)) diff --git a/recipes/platform.hashing/all/test_package/CMakeLists.txt b/recipes/platform.hashing/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f3ca06da8ddf9 --- /dev/null +++ b/recipes/platform.hashing/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +set(EXTRA_FLAGS "" CACHE STRING "Extra compiler flags") +separate_arguments(EXTRA_FLAGS UNIX_COMMAND ${EXTRA_FLAGS}) +if(EXTRA_FLAGS) + add_compile_options(${EXTRA_FLAGS}) +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) diff --git a/recipes/platform.hashing/all/test_package/conanfile.py b/recipes/platform.hashing/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef7d3547638fa --- /dev/null +++ b/recipes/platform.hashing/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + @property + def _extra_flags(self): + return self.deps_user_info["platform.hashing"].suggested_flags + + def build(self): + if self.settings.compiler != "Visual Studio": + if not self._extra_flags: + raise ConanException("Suggested flags are not available for os={}/arch={}".format(self.settings.os, self.settings.arch)) + + cmake = CMake(self) + if self.settings.compiler != "Visual Studio": + cmake.definitions["EXTRA_FLAGS"] = self._extra_flags + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/platform.hashing/all/test_package/test_package.cpp b/recipes/platform.hashing/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e03e275857d10 --- /dev/null +++ b/recipes/platform.hashing/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include +#include +#include + +using namespace Platform::Hashing; + +auto main() -> int { + std::cout << Hash(std::any{1}) << std::endl; + std::cout << Hash(std::any{1}, std::any{1}) << std::endl; + std::cout << Hash(std::vector{1}) << std::endl; + std::cout << Hash(std::array{1}) << std::endl; +} diff --git a/recipes/platform.hashing/config.yml b/recipes/platform.hashing/config.yml new file mode 100644 index 0000000000000..ee25f0e067a38 --- /dev/null +++ b/recipes/platform.hashing/config.yml @@ -0,0 +1,7 @@ +versions: + "0.2.0": + folder: all + "0.3.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/platform.interfaces/all/conandata.yml b/recipes/platform.interfaces/all/conandata.yml new file mode 100644 index 0000000000000..25b51e862badd --- /dev/null +++ b/recipes/platform.interfaces/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.3.41": + source: + url: "https://github.com/linksplatform/Interfaces/releases/download/cpp_0.3.41/platform.interfaces_0.3.41.zip" + sha256: "26bfb96f8918db86390cf326eba5c76cfc29f06a785d30c789445fe59371bab4" + license: + url: "https://raw.githubusercontent.com/linksplatform/Interfaces/cpp_0.3.41/LICENSE" + sha256: "79d0fc44716007dddc375601bca8879ad45bc1165bf9342b7a16572b4f41abe8" + "0.1.2": + source: + url: "https://github.com/linksplatform/Interfaces/archive/refs/tags/0.4.0_0.1.2.tar.gz" + sha256: "61283bf6488b9051e9f9e80e89ab0d1f85b76a1dbee3fd27f193e678f23903e2" diff --git a/recipes/platform.interfaces/all/conanfile.py b/recipes/platform.interfaces/all/conanfile.py new file mode 100644 index 0000000000000..b269b0438ae49 --- /dev/null +++ b/recipes/platform.interfaces/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, download +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class PlatformInterfacesConan(ConanFile): + name = "platform.interfaces" + description = """platform.interfaces is one of the libraries of the LinksPlatform modular framework, which uses + innovations from the C++20 standard, for easier use of static polymorphism. It also includes some auxiliary + structures for more convenient work with containers.""" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/linksplatform/Interfaces" + topics = ("platform", "concepts", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _subfolder_sources(self): + return os.path.join(self.source_folder, "cpp", "Platform.Interfaces") + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "Visual Studio": "16", + "msvc": "193", + "clang": "13", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, " + "which is not supported " + f"by {self.settings.compiler}.") + + 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 Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, " + "which is not supported " + "by {self.settings.compiler} {self.settings.compiler.version}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) + if Version(self.version) >= "0.3.41": + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + if Version(self.version) < "0.3.41": + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "cpp", "Platform.Interfaces"), + ) + else: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Platform.Interfaces") + self.cpp_info.set_property("cmake_target_name", "Platform.Interfaces::Platform.Interfaces") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Platform.Interfaces" + self.cpp_info.names["cmake_find_package_multi"] = "Platform.Interfaces" diff --git a/recipes/platform.interfaces/all/test_package/CMakeLists.txt b/recipes/platform.interfaces/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b54dd14513b95 --- /dev/null +++ b/recipes/platform.interfaces/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(Platform.Interfaces REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Platform.Interfaces::Platform.Interfaces) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(Platform.Interfaces_VERSION VERSION_GREATER_EQUAL "0.2.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE -DPLATFORM_INTERFACES_0_2_0_LATER) +endif() diff --git a/recipes/platform.interfaces/all/test_package/conanfile.py b/recipes/platform.interfaces/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/platform.interfaces/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/platform.interfaces/all/test_package/test_package.cpp b/recipes/platform.interfaces/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..58843ae8a5fa9 --- /dev/null +++ b/recipes/platform.interfaces/all/test_package/test_package.cpp @@ -0,0 +1,101 @@ +#include +#include +#include +#include + +#include + +using namespace Platform::Interfaces; + +#if not defined (PLATFORM_INTERFACES_0_2_0_LATER) + +void print(IEnumerable auto&& enumerable) +{ + auto size = std::ranges::size(enumerable); + + std::cout << '['; + for (int i = 0; auto&& item : enumerable) + { + std::cout << item; + if (i < size - 1) + { + std::cout << ", "; + } + + i++; + } + std::cout << ']' << std::endl; +} + +template::Item> +requires + IList || + ISet || + IDictionary +void add(Collection& collection, const std::same_as auto& item) +{ + if constexpr (IList) + { + collection.push_back(item); + } + else + { + collection.insert(item); + } +} + +#else + +void print(CEnumerable auto&& enumerable) +{ + auto size = std::ranges::size(enumerable); + + std::cout << '['; + for (int i = 0; auto&& item : enumerable) + { + std::cout << item; + if (i < size - 1) + { + std::cout << ", "; + } + + i++; + } + std::cout << ']' << std::endl; +} + +template::Item> +requires + CList || + CSet || + CDictionary +void add(Collection& collection, const std::same_as auto& item) +{ + if constexpr (CList) + { + collection.push_back(item); + } + else + { + collection.insert(item); + } +} + +#endif + +int main() +{ + std::vector v { 1, 2, 3 }; + std::set s { 1, 2, 3 }; + + add(v, 2); // 1 2 3 2 + add(v, 1); // 1 2 3 2 1 + + add(s, 2); // 1 2 3 + add(s, 1); // 1 2 3 + add(s, 0); // 0 1 2 3 + + + print(v); // print: [1, 2, 3, 2, 1] + print(s); // print: [0, 1, 2, 3] +} diff --git a/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt b/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/platform.interfaces/all/test_v1_package/conanfile.py b/recipes/platform.interfaces/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/platform.interfaces/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/platform.interfaces/config.yml b/recipes/platform.interfaces/config.yml new file mode 100644 index 0000000000000..6293fc3390096 --- /dev/null +++ b/recipes/platform.interfaces/config.yml @@ -0,0 +1,5 @@ +versions: + "0.3.41": + folder: all + "0.1.2": + folder: all diff --git a/recipes/playrho/all/CMakeLists.txt b/recipes/playrho/all/CMakeLists.txt new file mode 100644 index 0000000000000..7d5ba25565b0a --- /dev/null +++ b/recipes/playrho/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory(source_subfolder) diff --git a/recipes/playrho/all/conandata.yml b/recipes/playrho/all/conandata.yml new file mode 100644 index 0000000000000..03bf919319da8 --- /dev/null +++ b/recipes/playrho/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.1.0": + url: "https://github.com/louis-langholtz/PlayRho/archive/refs/tags/v1.1.0.tar.gz" + sha256: "45c0337440387a85a97a4b7907b79f780233bf2062635471b71a32245b0c0158" + +patches: + "1.1.0": + - patch_file: "patches/1.1.0-0001-fix-target-name.patch" + base_path: "source_subfolder" diff --git a/recipes/playrho/all/conanfile.py b/recipes/playrho/all/conanfile.py new file mode 100644 index 0000000000000..9aab4b29f12b3 --- /dev/null +++ b/recipes/playrho/all/conanfile.py @@ -0,0 +1,103 @@ +from conans import ConanFile, CMake, tools +from conans.tools import ConanInvalidConfiguration +import os +import functools + +required_conan_version = ">=1.43.0" + +class PlayrhoConan(ConanFile): + name = "playrho" + description = "Real-time oriented physics engine and library that's currently best suited for 2D games. " + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/louis-langholtz/PlayRho/" + topics = ("physics-engine", "collision-detection", "box2d") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + + @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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + @property + def _compilers_minimum_versions(self): + return { + "gcc": "8", + "Visual Studio": "16", + "clang": "7", + "apple-clang": "12", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 17) + + compilers_minimum_version = self._compilers_minimum_versions + minimum_version = compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["PLAYRHO_BUILD_SHARED"] = self.options.shared + cmake.definitions["PLAYRHO_BUILD_STATIC"] = not self.options.shared + cmake.definitions["PLAYRHO_INSTALL"] = True + cmake.configure() + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "PlayRho")) + + def package_info(self): + self.cpp_info.libs = ["PlayRho"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + self.cpp_info.set_property("cmake_file_name", "PlayRho") + self.cpp_info.set_property("cmake_target_name", "PlayRho::PlayRho") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PlayRho" + self.cpp_info.filenames["cmake_find_package_multi"] = "PlayRho" + self.cpp_info.names["cmake_find_package"] = "PlayRho" + self.cpp_info.names["cmake_find_package_multi"] = "PlayRho" diff --git a/recipes/playrho/all/patches/1.1.0-0001-fix-target-name.patch b/recipes/playrho/all/patches/1.1.0-0001-fix-target-name.patch new file mode 100644 index 0000000000000..a3fb954096035 --- /dev/null +++ b/recipes/playrho/all/patches/1.1.0-0001-fix-target-name.patch @@ -0,0 +1,24 @@ +diff --git a/PlayRho/CMakeLists.txt b/PlayRho/CMakeLists.txt +index 423a8ac..b0528ad 100644 +--- a/PlayRho/CMakeLists.txt ++++ b/PlayRho/CMakeLists.txt +@@ -90,10 +90,9 @@ if(PLAYRHO_BUILD_SHARED) + ${PLAYRHO_Rope_SRCS} + ${PLAYRHO_Rope_HDRS} + ) +- target_compile_features(PlayRho PUBLIC cxx_std_17) ++ target_compile_features(PlayRho_shared PUBLIC cxx_std_17) + set_target_properties(PlayRho_shared PROPERTIES + OUTPUT_NAME "PlayRho" +- CLEAN_DIRECT_OUTPUT 1 + VERSION ${PLAYRHO_VERSION} + ) + endif() +@@ -118,7 +117,6 @@ if(PLAYRHO_BUILD_STATIC) + ) + target_compile_features(PlayRho PUBLIC cxx_std_17) + set_target_properties(PlayRho PROPERTIES +- CLEAN_DIRECT_OUTPUT 1 + VERSION ${PLAYRHO_VERSION} + ) + endif() diff --git a/recipes/playrho/all/test_package/CMakeLists.txt b/recipes/playrho/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf755d3555681 --- /dev/null +++ b/recipes/playrho/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PlayRho REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PlayRho::PlayRho) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/playrho/all/test_package/conanfile.py b/recipes/playrho/all/test_package/conanfile.py new file mode 100644 index 0000000000000..61ac8b9318290 --- /dev/null +++ b/recipes/playrho/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building + +class PlayrhoTestConan(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/playrho/all/test_package/test_package.cpp b/recipes/playrho/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2537c9e98d01f --- /dev/null +++ b/recipes/playrho/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include "PlayRho/PlayRho.hpp" + +int main() { + auto world = playrho::d2::World{}; +} diff --git a/recipes/playrho/config.yml b/recipes/playrho/config.yml new file mode 100644 index 0000000000000..11b7aff3a5ac4 --- /dev/null +++ b/recipes/playrho/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: "all" diff --git a/recipes/plf_colony/all/conandata.yml b/recipes/plf_colony/all/conandata.yml new file mode 100644 index 0000000000000..7d323fe98a8c9 --- /dev/null +++ b/recipes/plf_colony/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "7.06": + url: "https://github.com/mattreecebentley/plf_colony/archive/348174f0da2ea65b7a561b08412e81ce1f5e6161.tar.gz" + sha256: "c6a34d08d4946f0ce54a9836b564b329afffc7ce173720282c7e2b0b57cbc484" + "7.03": + url: "https://github.com/mattreecebentley/plf_colony/archive/f182529ea6f125fc9cee5ca57f499284c777cecb.tar.gz" + sha256: "8fa98993283a158779596f0de17217bd7ef2923fbfc116861172f4ba20f4bc81" + "7.00": + url: "https://github.com/mattreecebentley/plf_colony/archive/b648c57dab032d326d1487f812e6dbda23b42d20.tar.gz" + sha256: "6faae2a68c49ac237c0dff3b1abc2d9b0ebf936ea883d3553c6e6adb6eaa2b4d" + "6.25": + url: "https://github.com/mattreecebentley/plf_colony/archive/848305c2f83fbd5407e6e3fdb9c3e3e8dcfa2ea6.tar.gz" + sha256: "4d298dbd9266201be9733ef276046e9a55d7f35a8c16378fc1dcb687ca8ab4ad" +patches: + "7.06": + - patch_file: "patches/7.06-0001-disable-cxx20-from-apple-clang14.patch" + patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little" + patch_type: "portability" + "7.03": + - patch_file: "patches/7.00-0001-disable-cxx20-from-apple-clang14.patch" + patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little" + patch_type: "portability" + "7.00": + - patch_file: "patches/7.00-0001-disable-cxx20-from-apple-clang14.patch" + patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little" + patch_type: "portability" diff --git a/recipes/plf_colony/all/conanfile.py b/recipes/plf_colony/all/conanfile.py new file mode 100644 index 0000000000000..888ed08055ad9 --- /dev/null +++ b/recipes/plf_colony/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PlfcolonyConan(ConanFile): + name = "plf_colony" + description = "An unordered data container providing fast iteration/insertion/erasure " \ + "while maintaining pointer/iterator/reference validity to non-erased elements." + license = "Zlib" + topics = ("container", "bucket", "unordered", "header-only") + homepage = "https://github.com/mattreecebentley/plf_colony" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def package_id(self): + self.info.clear() + + 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): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "plf_colony.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/plf_colony/all/patches/7.00-0001-disable-cxx20-from-apple-clang14.patch b/recipes/plf_colony/all/patches/7.00-0001-disable-cxx20-from-apple-clang14.patch new file mode 100644 index 0000000000000..cba605fff0fbf --- /dev/null +++ b/recipes/plf_colony/all/patches/7.00-0001-disable-cxx20-from-apple-clang14.patch @@ -0,0 +1,13 @@ +diff --git a/plf_colony.h b/plf_colony.h +index a9911f3..c707edc 100644 +--- a/plf_colony.h ++++ b/plf_colony.h +@@ -165,7 +165,7 @@ + #define PLF_CONSTEXPR constexpr + #endif + +- #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) ++ #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((!defined(__APPLE_CC__) && defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) + #define PLF_CPP20_SUPPORT + #undef PLF_CONSTFUNC + #define PLF_CONSTFUNC constexpr diff --git a/recipes/plf_colony/all/patches/7.06-0001-disable-cxx20-from-apple-clang14.patch b/recipes/plf_colony/all/patches/7.06-0001-disable-cxx20-from-apple-clang14.patch new file mode 100644 index 0000000000000..3992b1b8c3069 --- /dev/null +++ b/recipes/plf_colony/all/patches/7.06-0001-disable-cxx20-from-apple-clang14.patch @@ -0,0 +1,13 @@ +diff --git a/plf_colony.h b/plf_colony.h +index e789331..2e2005b 100644 +--- a/plf_colony.h ++++ b/plf_colony.h +@@ -176,7 +176,7 @@ + #define PLF_CONSTEXPR constexpr + #endif + +- #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) ++ #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((!defined(__APPLE_CC__) && defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) + #define PLF_CPP20_SUPPORT + #undef PLF_CONSTFUNC + #define PLF_CONSTFUNC constexpr diff --git a/recipes/plf_colony/all/test_package/CMakeLists.txt b/recipes/plf_colony/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34e86e5b98356 --- /dev/null +++ b/recipes/plf_colony/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plf_colony REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_colony::plf_colony) diff --git a/recipes/plf_colony/all/test_package/conanfile.py b/recipes/plf_colony/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/plf_colony/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/plf_colony/all/test_package/test_package.cpp b/recipes/plf_colony/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bde5b1111a533 --- /dev/null +++ b/recipes/plf_colony/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include + +int main() { + plf::colony i_colony; + + // Insert 100 ints: + for (int i = 0; i != 100; ++i) { + i_colony.insert(i); + } + + // Erase half of them: + for (plf::colony::iterator it = i_colony.begin(); it != i_colony.end(); ++it) { + it = i_colony.erase(it); + } + + // Total the remaining ints: + int total = 0; + + for (plf::colony::iterator it = i_colony.begin(); it != i_colony.end(); ++it) { + total += *it; + } + + std::cout << "Total: " << total << std::endl; + return 0; +} diff --git a/recipes/plf_colony/all/test_v1_package/CMakeLists.txt b/recipes/plf_colony/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plf_colony/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plf_colony/all/test_v1_package/conanfile.py b/recipes/plf_colony/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/plf_colony/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/plf_colony/config.yml b/recipes/plf_colony/config.yml new file mode 100644 index 0000000000000..d7dde26d155d4 --- /dev/null +++ b/recipes/plf_colony/config.yml @@ -0,0 +1,9 @@ +versions: + "7.06": + folder: all + "7.03": + folder: all + "7.00": + folder: all + "6.25": + folder: all diff --git a/recipes/plf_indiesort/all/conandata.yml b/recipes/plf_indiesort/all/conandata.yml new file mode 100644 index 0000000000000..8b79bf367fbc1 --- /dev/null +++ b/recipes/plf_indiesort/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.18": + url: "https://github.com/mattreecebentley/plf_indiesort/archive/1999a3017b3a3699f426608841a5a66e0849880d.tar.gz" + sha256: "1c035243adbd63d89a61f8a0e8bbea1911ab9421467da9e5d618c30f10f16f91" + "1.15": + url: "https://github.com/mattreecebentley/plf_indiesort/archive/b28d376cda4b3c06201a04e9a1698f8b98687ec3.tar.gz" + sha256: "607afcec499c9a1ed097f0cdc0c9b4ea3af6b3db675d3b873c9e4e5827a5bc0e" diff --git a/recipes/plf_indiesort/all/conanfile.py b/recipes/plf_indiesort/all/conanfile.py new file mode 100644 index 0000000000000..c13c8aaa71120 --- /dev/null +++ b/recipes/plf_indiesort/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PlfindiesortConan(ConanFile): + name = "plf_indiesort" + description = ( + "A sort wrapper enabling both use of random-access sorting on non-random " + "access containers, and increased performance for the sorting of large types." + ) + license = "Zlib" + topics = ("algorithm", "sort", "header-only") + homepage = "https://plflib.org/indiesort.htm" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "plf_indiesort.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/plf_indiesort/all/test_package/CMakeLists.txt b/recipes/plf_indiesort/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..16762d24eeb1e --- /dev/null +++ b/recipes/plf_indiesort/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plf_indiesort REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_indiesort::plf_indiesort) diff --git a/recipes/plf_indiesort/all/test_package/conanfile.py b/recipes/plf_indiesort/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/plf_indiesort/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/plf_indiesort/all/test_package/test_package.cpp b/recipes/plf_indiesort/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..347968c58355d --- /dev/null +++ b/recipes/plf_indiesort/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +int main() { + std::vector vec; + for (int i = 0; i < 60; ++i) { + vec.push_back(60 - i); + } + plf::indiesort(vec); + return 0; +} diff --git a/recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt b/recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plf_indiesort/all/test_v1_package/conanfile.py b/recipes/plf_indiesort/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/plf_indiesort/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/plf_indiesort/config.yml b/recipes/plf_indiesort/config.yml new file mode 100644 index 0000000000000..5b4c7706184cf --- /dev/null +++ b/recipes/plf_indiesort/config.yml @@ -0,0 +1,5 @@ +versions: + "1.18": + folder: all + "1.15": + folder: all diff --git a/recipes/plf_list/all/conandata.yml b/recipes/plf_list/all/conandata.yml new file mode 100644 index 0000000000000..69ea21b761e16 --- /dev/null +++ b/recipes/plf_list/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "2.57": + url: "https://github.com/mattreecebentley/plf_list/archive/d7a06d7497dc01261dd2c2fe675a8b605acb7a56.tar.gz" + sha256: "4297c7578fe5ea2c6346541b28a57d87ec311522fa55bc8a5ab069921fc073e9" + "2.52": + url: "https://github.com/mattreecebentley/plf_list/archive/76115adac11a5f362b7a8eea8362314d547284df.tar.gz" + sha256: "897ff5309c399ec0f7c875b398c7eb07ebe3cd80a75ce337a0bd70456668116b" + "2.50": + url: "https://github.com/mattreecebentley/plf_list/archive/b520008d5d076402da2344994dd2c1e3cc097460.tar.gz" + sha256: "086a1ecad544202c93a3fa4bb7d26cf4140db7ebc2bb39af3e75620050c78f23" + "2.03": + url: "https://github.com/mattreecebentley/plf_list/archive/cc579a5cc828d8a0da6715ef075d560e4de89901.tar.gz" + sha256: "4ab3f7ca41e3567710a64ede3a9f708b388f3ae52e09b3ee1a45d6b4fd89dd09" +patches: + "2.57": + - patch_file: "patches/2.57-0001-disable-cxx20-from-apple-clang14.patch" + patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little" + patch_type: "portability" + "2.52": + - patch_file: "patches/2.50-0001-disable-cxx20-from-apple-clang14.patch" + patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little" + patch_type: "portability" + "2.50": + - patch_file: "patches/2.50-0001-disable-cxx20-from-apple-clang14.patch" + patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little" + patch_type: "portability" diff --git a/recipes/plf_list/all/conanfile.py b/recipes/plf_list/all/conanfile.py new file mode 100644 index 0000000000000..93c3eafa9a2e2 --- /dev/null +++ b/recipes/plf_list/all/conanfile.py @@ -0,0 +1,42 @@ +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PlflistConan(ConanFile): + name = "plf_list" + description = "plf::list is a drop-in higher-performance replacement for std::list" + license = "Zlib" + topics = ("container", "linked-list", "list", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mattreecebentley/plf_list" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def package_id(self): + self.info.clear() + + 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): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "plf_list.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/plf_list/all/patches/2.50-0001-disable-cxx20-from-apple-clang14.patch b/recipes/plf_list/all/patches/2.50-0001-disable-cxx20-from-apple-clang14.patch new file mode 100644 index 0000000000000..27e0ab94b61af --- /dev/null +++ b/recipes/plf_list/all/patches/2.50-0001-disable-cxx20-from-apple-clang14.patch @@ -0,0 +1,13 @@ +diff --git a/plf_list.h b/plf_list.h +index a9e3711..8357582 100644 +--- a/plf_list.h ++++ b/plf_list.h +@@ -168,7 +168,7 @@ + #define PLF_CONSTEXPR constexpr + #endif + +- #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) ++ #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && (!defined(__APPLE_CC__) && (defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) + #define PLF_CPP20_SUPPORT + #undef PLF_CONSTFUNC + #define PLF_CONSTFUNC constexpr diff --git a/recipes/plf_list/all/patches/2.57-0001-disable-cxx20-from-apple-clang14.patch b/recipes/plf_list/all/patches/2.57-0001-disable-cxx20-from-apple-clang14.patch new file mode 100644 index 0000000000000..6d93f43be4b9a --- /dev/null +++ b/recipes/plf_list/all/patches/2.57-0001-disable-cxx20-from-apple-clang14.patch @@ -0,0 +1,13 @@ +diff --git a/plf_list.h b/plf_list.h +index c729efe..1d0eb67 100644 +--- a/plf_list.h ++++ b/plf_list.h +@@ -176,7 +176,7 @@ + #define PLF_CONSTEXPR constexpr + #endif + +- #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) ++ #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && (!defined(__APPLE_CC__) && (defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__))) + #define PLF_CPP20_SUPPORT + #undef PLF_CONSTFUNC + #define PLF_CONSTFUNC constexpr diff --git a/recipes/plf_list/all/test_package/CMakeLists.txt b/recipes/plf_list/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9871eca4a6f1f --- /dev/null +++ b/recipes/plf_list/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plf_list REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_list::plf_list) diff --git a/recipes/plf_list/all/test_package/conanfile.py b/recipes/plf_list/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/plf_list/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/plf_list/all/test_package/test_package.cpp b/recipes/plf_list/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a2df3357e5004 --- /dev/null +++ b/recipes/plf_list/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + int arr[] = {1, 2, 3, 4, 5}; + plf::list list1(arr, arr + sizeof(arr) / sizeof(int)); + plf::list::iterator it = --(list1.end()); + list1.splice(list1.begin(), it); + return 0; +} diff --git a/recipes/plf_list/all/test_v1_package/CMakeLists.txt b/recipes/plf_list/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plf_list/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plf_list/all/test_v1_package/conanfile.py b/recipes/plf_list/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/plf_list/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/plf_list/config.yml b/recipes/plf_list/config.yml new file mode 100644 index 0000000000000..ca1f4fbf159c4 --- /dev/null +++ b/recipes/plf_list/config.yml @@ -0,0 +1,9 @@ +versions: + "2.57": + folder: all + "2.52": + folder: all + "2.50": + folder: all + "2.03": + folder: all diff --git a/recipes/plf_nanotimer/all/conandata.yml b/recipes/plf_nanotimer/all/conandata.yml new file mode 100644 index 0000000000000..fe0caa85fa6a3 --- /dev/null +++ b/recipes/plf_nanotimer/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.07": + url: "https://github.com/mattreecebentley/plf_nanotimer/archive/55e0fcb135ec8db874a0656f94d1f1780d7c75a7.tar.gz" + sha256: "986c1f45d8c23237b5ed84b6a875a022335a9aa61a3b01dd613cabb3ee2c14ab" diff --git a/recipes/plf_nanotimer/all/conanfile.py b/recipes/plf_nanotimer/all/conanfile.py new file mode 100644 index 0000000000000..7aa98cf9ba62f --- /dev/null +++ b/recipes/plf_nanotimer/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.50.0" + + +class PlfnanotimerConan(ConanFile): + name = "plf_nanotimer" + description = "A simple C++ 03/11/etc timer class for ~microsecond-precision cross-platform benchmarking." + license = "Zlib" + topics = ("plf_nanotimer", "timer", "benchmark") + homepage = "https://plflib.org/nanotimer.htm" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "plf_nanotimer.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/plf_nanotimer/all/test_package/CMakeLists.txt b/recipes/plf_nanotimer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0cbc43c2bace1 --- /dev/null +++ b/recipes/plf_nanotimer/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plf_nanotimer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_nanotimer::plf_nanotimer) diff --git a/recipes/plf_nanotimer/all/test_package/conanfile.py b/recipes/plf_nanotimer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/plf_nanotimer/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/plf_nanotimer/all/test_package/test_package.cpp b/recipes/plf_nanotimer/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..22b59f4dcf402 --- /dev/null +++ b/recipes/plf_nanotimer/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include + +int main() { + plf::nanotimer timer; + timer.start(); + double results = timer.get_elapsed_ns(); + std::cout << "Timing: " << results << " nanoseconds." << std::endl; + return 0; +} diff --git a/recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt b/recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6121431de33af --- /dev/null +++ b/recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(plf_nanotimer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_nanotimer::plf_nanotimer) diff --git a/recipes/plf_nanotimer/all/test_v1_package/conanfile.py b/recipes/plf_nanotimer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/plf_nanotimer/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/plf_nanotimer/config.yml b/recipes/plf_nanotimer/config.yml new file mode 100644 index 0000000000000..cefc46dd34c38 --- /dev/null +++ b/recipes/plf_nanotimer/config.yml @@ -0,0 +1,3 @@ +versions: + "1.07": + folder: all diff --git a/recipes/plf_queue/all/conandata.yml b/recipes/plf_queue/all/conandata.yml new file mode 100644 index 0000000000000..c563552517b10 --- /dev/null +++ b/recipes/plf_queue/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.22": + url: "https://github.com/mattreecebentley/plf_queue/archive/bef2bda67cb4cadfd5dceaaf2c8f037c540a12bc.tar.gz" + sha256: "96da3d7f27c62b39a147bc38a8d9f3a1a5f1cb0bfcc3b37d5ee2c7c056ad368e" + "1.21": + url: "https://github.com/mattreecebentley/plf_queue/archive/67c5de0cc2c21a865dd1fae180eb765d39f2d2c5.tar.gz" + sha256: "baa01a5b0709e5742b87b1bcd7ddbb116e0c841beb22c4553f0d64f54e5a829d" + "1.19": + url: "https://github.com/mattreecebentley/plf_queue/archive/991661f3674ff30c3f469120f6973556804b8a00.tar.gz" + sha256: "7e9a36c0fde9c131c4552d61bd4cf3a71dc78536fba4dc60d8f33b92bf5f4e8d" diff --git a/recipes/plf_queue/all/conanfile.py b/recipes/plf_queue/all/conanfile.py new file mode 100644 index 0000000000000..eb89a396e2710 --- /dev/null +++ b/recipes/plf_queue/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.50.0" + + +class PlfqueueConan(ConanFile): + name = "plf_queue" + description = "A C++ data container replicating std::queue functionality but with better performance." + license = "Zlib" + topics = ("container", "queue", "header-only") + homepage = "https://plflib.org/queue.htm" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "plf_queue.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/plf_queue/all/test_package/CMakeLists.txt b/recipes/plf_queue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a3b7c5dfd549 --- /dev/null +++ b/recipes/plf_queue/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plf_queue REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_queue::plf_queue) diff --git a/recipes/plf_queue/all/test_package/conanfile.py b/recipes/plf_queue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/plf_queue/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/plf_queue/all/test_package/test_package.cpp b/recipes/plf_queue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d2eac87e5fe5 --- /dev/null +++ b/recipes/plf_queue/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +#include + +int main() { + plf::queue i_queue; + for (int i = 0; i < 100; ++i) { + i_queue.push(i); + } + + int total = 0; + while (!i_queue.empty()) { + total += i_queue.front(); + i_queue.pop(); + } + + std::cout << "Total: " << total << std::endl; + return 0; +} diff --git a/recipes/plf_queue/all/test_v1_package/CMakeLists.txt b/recipes/plf_queue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plf_queue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plf_queue/all/test_v1_package/conanfile.py b/recipes/plf_queue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/plf_queue/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/plf_queue/config.yml b/recipes/plf_queue/config.yml new file mode 100644 index 0000000000000..60c525e6c3382 --- /dev/null +++ b/recipes/plf_queue/config.yml @@ -0,0 +1,7 @@ +versions: + "1.22": + folder: all + "1.21": + folder: all + "1.19": + folder: all diff --git a/recipes/plf_stack/all/conandata.yml b/recipes/plf_stack/all/conandata.yml new file mode 100644 index 0000000000000..cf7e7157c6209 --- /dev/null +++ b/recipes/plf_stack/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.64": + url: "https://github.com/mattreecebentley/plf_stack/archive/c9d8fae0a66d1d0a19c3d0bf690a2776710511fe.tar.gz" + sha256: "8dcca43043a3c5e91a642a3ae84f3acca657c3775536569302bbccc6b70d24e6" + "1.63": + url: "https://github.com/mattreecebentley/plf_stack/archive/96184693b8dcc904b07cf4e97e848be9fe8b2c4e.tar.gz" + sha256: "8789f97d217e9f97ffefc700f14b87f960aaaad25d0c9a27e6d8577d7a52a939" + "1.60": + url: "https://github.com/mattreecebentley/plf_stack/archive/775456d32a0919bc2a6df9ab9b2b5e96b76c6c24.tar.gz" + sha256: "ac09619bef8aa1c946ccf8bebbf623187627b7bb31ad85c60384ad450f0dd0fa" diff --git a/recipes/plf_stack/all/conanfile.py b/recipes/plf_stack/all/conanfile.py new file mode 100644 index 0000000000000..c8872d80acc3f --- /dev/null +++ b/recipes/plf_stack/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PlfstackConan(ConanFile): + name = "plf_stack" + description = ( + "A C++ data container replicating std::stack functionality but with " + "better performance than standard library containers in a stack context." + ) + license = "Zlib" + topics = ("container", "stack", "header-only") + homepage = "https://plflib.org/stack.htm" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "plf_stack.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/plf_stack/all/test_package/CMakeLists.txt b/recipes/plf_stack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a8cd4817de983 --- /dev/null +++ b/recipes/plf_stack/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plf_stack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE plf_stack::plf_stack) diff --git a/recipes/plf_stack/all/test_package/conanfile.py b/recipes/plf_stack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/plf_stack/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/plf_stack/all/test_package/test_package.cpp b/recipes/plf_stack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e39d07d817cc9 --- /dev/null +++ b/recipes/plf_stack/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +#include + +int main() { + plf::stack i_stack; + for (int i = 0; i != 100; ++i) { + i_stack.push(i); + } + + int total = 0; + while (!i_stack.empty()) { + total += i_stack.top(); + i_stack.pop(); + } + + std::cout << "Total: " << total << std::endl; + return 0; +} diff --git a/recipes/plf_stack/all/test_v1_package/CMakeLists.txt b/recipes/plf_stack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plf_stack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plf_stack/all/test_v1_package/conanfile.py b/recipes/plf_stack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/plf_stack/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/plf_stack/config.yml b/recipes/plf_stack/config.yml new file mode 100644 index 0000000000000..88575a7de5458 --- /dev/null +++ b/recipes/plf_stack/config.yml @@ -0,0 +1,7 @@ +versions: + "1.64": + folder: all + "1.63": + folder: all + "1.60": + folder: all diff --git a/recipes/plog/all/conandata.yml b/recipes/plog/all/conandata.yml new file mode 100644 index 0000000000000..a2d1cb2b746a6 --- /dev/null +++ b/recipes/plog/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.9": + url: "https://github.com/SergiusTheBest/plog/archive/1.1.9.tar.gz" + sha256: "058315b9ec9611b659337d4333519ab4783fad3f2f23b1cc7bb84d977ea38055" + "1.1.5": + url: "https://github.com/SergiusTheBest/plog/archive/1.1.5.tar.gz" + sha256: "6c80b4701183d2415bec927e1f5ca9b1761b3b5c65d3e09fb29c743e016d5609" diff --git a/recipes/plog/all/conanfile.py b/recipes/plog/all/conanfile.py new file mode 100644 index 0000000000000..791d275909919 --- /dev/null +++ b/recipes/plog/all/conanfile.py @@ -0,0 +1,37 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class PlogConan(ConanFile): + name = "plog" + description = "Pretty powerful logging library in about 1000 lines of code" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SergiusTheBest/plog" + topics = ("logging", "header-only", "portable") + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/plog/all/test_package/CMakeLists.txt b/recipes/plog/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..690cbc43fe694 --- /dev/null +++ b/recipes/plog/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(plog REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE plog::plog) + +if(plog_VERSION VERSION_GREATER_EQUAL "1.1.6") + target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE -DPLOG_EXPLICIT_INIT) +endif() diff --git a/recipes/plog/all/test_package/conanfile.py b/recipes/plog/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/plog/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/plog/all/test_package/test_package.cpp b/recipes/plog/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7f43b93383455 --- /dev/null +++ b/recipes/plog/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +#include +#ifdef PLOG_EXPLICIT_INIT +# include +#endif + +int main() { + plog::init(plog::debug, "log.txt"); + PLOG(plog::info) << "Hello world!"; + return 0; +} + diff --git a/recipes/plog/all/test_v1_package/CMakeLists.txt b/recipes/plog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plog/all/test_v1_package/conanfile.py b/recipes/plog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/plog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/plog/config.yml b/recipes/plog/config.yml new file mode 100644 index 0000000000000..c3432fc6b2f2a --- /dev/null +++ b/recipes/plog/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.9": + folder: all + "1.1.5": + folder: all diff --git a/recipes/plusaes/all/conandata.yml b/recipes/plusaes/all/conandata.yml new file mode 100644 index 0000000000000..539b28539b874 --- /dev/null +++ b/recipes/plusaes/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.10.0": + url: "https://github.com/kkAyataka/plusaes/archive/refs/tags/v0.10.0.tar.gz" + sha256: "092d64f372f5b732c8e35ab8f1049d4c6ef2eaa4c6ababc56b541b26f4095e51" diff --git a/recipes/plusaes/all/conanfile.py b/recipes/plusaes/all/conanfile.py new file mode 100644 index 0000000000000..5d1248265e161 --- /dev/null +++ b/recipes/plusaes/all/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + +class PlusaesConan(ConanFile): + name = "plusaes" + description = "Header only C++ AES cipher library" + topics = ("encryption", "header-only") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kkAyataka/plusaes" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + root_dir = self._source_subfolder + include_dir = os.path.join(root_dir, "include") + self.copy(pattern="LICENSE_1_0.txt", dst="licenses", src=root_dir) + self.copy(pattern="*plusaes.hpp", dst="include", src=include_dir) diff --git a/recipes/plusaes/all/test_package/CMakeLists.txt b/recipes/plusaes/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0a4d2fae5c706 --- /dev/null +++ b/recipes/plusaes/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(plusaes REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} plusaes::plusaes) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/plusaes/all/test_package/conanfile.py b/recipes/plusaes/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/plusaes/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/plusaes/all/test_package/test_package.cpp b/recipes/plusaes/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..146e80ed4a759 --- /dev/null +++ b/recipes/plusaes/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include "plusaes/plusaes.hpp" + +#include +#include + +int main() { + // AES-CBC 128-bit + + // parameters + const std::string raw_data = "Hello, plusaes"; + const std::vector key = plusaes::key_from_string(&"EncryptionKey128"); // 16-char = 128-bit + const unsigned char iv[16] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + }; + + // encrypt + const unsigned long encrypted_size = plusaes::get_padded_encrypted_size(raw_data.size()); + std::vector encrypted(encrypted_size); + + plusaes::encrypt_cbc((unsigned char*)raw_data.data(), raw_data.size(), &key[0], key.size(), &iv, &encrypted[0], encrypted.size(), true); + // fb 7b ae 95 d5 0f c5 6f 43 7d 14 6b 6a 29 15 70 + + // decrypt + unsigned long padded_size = 0; + std::vector decrypted(encrypted_size); + + plusaes::decrypt_cbc(&encrypted[0], encrypted.size(), &key[0], key.size(), &iv, &decrypted[0], decrypted.size(), &padded_size); + // Hello, plusaes +} diff --git a/recipes/plusaes/config.yml b/recipes/plusaes/config.yml new file mode 100644 index 0000000000000..1b582dcf6716b --- /dev/null +++ b/recipes/plusaes/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.0": + folder: all diff --git a/recipes/plutovg/all/conandata.yml b/recipes/plutovg/all/conandata.yml new file mode 100644 index 0000000000000..dbcdf0e92b441 --- /dev/null +++ b/recipes/plutovg/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20221030": + url: "https://github.com/sammycage/plutovg/archive/4d0eee77ce7d1850aac4d90e20ddaaa313d83e6a.tar.gz" + sha256: "bb44b1107d1cd41032fecdf3e16cff59a1a06f15a92527029aacb73c5c4d059e" + "cci.20220103": + url: "https://github.com/sammycage/plutovg/archive/51f1a79e04fbb42ec9e93499a18869eea06f3054.tar.gz" + sha256: "c2ce39b8085e0a8795263666f62af15239c36964330865fd54b9db25c67e063b" diff --git a/recipes/plutovg/all/conanfile.py b/recipes/plutovg/all/conanfile.py new file mode 100644 index 0000000000000..13289c4f9dd84 --- /dev/null +++ b/recipes/plutovg/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.files import get, copy, replace_in_file +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.52.0" + +class PlutoVGConan(ConanFile): + name = "plutovg" + description = "Tiny 2D vector graphics library in C" + topics = ("vector", "graphics", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sammycage/plutovg" + license = "MIT", + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_library(plutovg STATIC)", "add_library(plutovg)") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(example)", "") + 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", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dylib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["plutovg"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] diff --git a/recipes/plutovg/all/test_package/CMakeLists.txt b/recipes/plutovg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05f05dd40b2ba --- /dev/null +++ b/recipes/plutovg/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(plutovg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE plutovg::plutovg) diff --git a/recipes/plutovg/all/test_package/conanfile.py b/recipes/plutovg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/plutovg/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/plutovg/all/test_package/test_package.c b/recipes/plutovg/all/test_package/test_package.c new file mode 100644 index 0000000000000..528e8031367ec --- /dev/null +++ b/recipes/plutovg/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include "plutovg.h" + +int main(void) { + const int width = 150; + const int height = 150; + + plutovg_surface_t* surface = plutovg_surface_create(width, height); + plutovg_t* pluto = plutovg_create(surface); + + plutovg_surface_destroy(surface); + plutovg_destroy(pluto); + + return 0; +} diff --git a/recipes/plutovg/all/test_v1_package/CMakeLists.txt b/recipes/plutovg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/plutovg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plutovg/all/test_v1_package/conanfile.py b/recipes/plutovg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/plutovg/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/plutovg/config.yml b/recipes/plutovg/config.yml new file mode 100644 index 0000000000000..b7f8945df864d --- /dev/null +++ b/recipes/plutovg/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20221030": + folder: all + "cci.20220103": + folder: all diff --git a/recipes/pngpp/all/conandata.yml b/recipes/pngpp/all/conandata.yml new file mode 100644 index 0000000000000..02dc7457e1b89 --- /dev/null +++ b/recipes/pngpp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.10": + url: "https://download.savannah.nongnu.org/releases/pngpp/png++-0.2.10.tar.gz" + sha256: "998af216ab16ebb88543fbaa2dbb9175855e944775b66f2996fc945c8444eee1" +patches: + "0.2.10": + - patch_file: "patches/0001-fix-windows.patch" diff --git a/recipes/pngpp/all/conanfile.py b/recipes/pngpp/all/conanfile.py new file mode 100644 index 0000000000000..9693d59416e60 --- /dev/null +++ b/recipes/pngpp/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class PngppConan(ConanFile): + name = "pngpp" + description = "A C++ wrapper for libpng library." + license = "BSD-3-Clause" + topics = ("png++", "png") + homepage = "https://www.nongnu.org/pngpp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libpng/1.6.38") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "png++")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pngpp/all/patches/0001-fix-windows.patch b/recipes/pngpp/all/patches/0001-fix-windows.patch new file mode 100644 index 0000000000000..2e05f1e133a42 --- /dev/null +++ b/recipes/pngpp/all/patches/0001-fix-windows.patch @@ -0,0 +1,11 @@ +--- a/error.hpp ++++ b/error.hpp +@@ -32,7 +32,7 @@ + #define PNGPP_ERROR_HPP_INCLUDED + + /* check if we have strerror_s or strerror_r, prefer the former which is C11 std */ +-#ifdef __STDC_LIB_EXT1__ ++#if defined(__STDC_LIB_EXT1__) || defined(_WIN32) + #define __STDC_WANT_LIB_EXT1__ 1 + #include + diff --git a/recipes/pngpp/all/test_package/CMakeLists.txt b/recipes/pngpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5ee715eea307 --- /dev/null +++ b/recipes/pngpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(pngpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pngpp::pngpp) diff --git a/recipes/pngpp/all/test_package/conanfile.py b/recipes/pngpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pngpp/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/pngpp/all/test_package/test_package.cpp b/recipes/pngpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7c74c1d575226 --- /dev/null +++ b/recipes/pngpp/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +int main() { + png::image image(128, 128); + for (png::uint_32 y = 0; y < image.get_height(); ++y) { + for (png::uint_32 x = 0; x < image.get_width(); ++x) { + image[y][x] = png::rgb_pixel(x, y, x + y); + } + } + image.write("rgb.png"); + return 0; +} diff --git a/recipes/pngpp/all/test_v1_package/CMakeLists.txt b/recipes/pngpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..abf75b3c1f51a --- /dev/null +++ b/recipes/pngpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pngpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pngpp::pngpp) diff --git a/recipes/pngpp/all/test_v1_package/conanfile.py b/recipes/pngpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pngpp/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/pngpp/config.yml b/recipes/pngpp/config.yml new file mode 100644 index 0000000000000..2b6204e74adb5 --- /dev/null +++ b/recipes/pngpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.10": + folder: all diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml new file mode 100644 index 0000000000000..c1b33d73bc83f --- /dev/null +++ b/recipes/poco/all/conandata.yml @@ -0,0 +1,82 @@ +sources: + "1.12.4": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.4-release.tar.gz" + sha256: "71ef96c35fced367d6da74da294510ad2c912563f12cd716ab02b6ed10a733ef" + "1.12.3": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.3-release.tar.gz" + sha256: "3b2056ddef17164b896cda0613e2f2b3d6b857f49c3e464b5d0f655017f2231d" + "1.12.2": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.2-release.tar.gz" + sha256: "30442ccb097a0074133f699213a59d6f8c77db5b2c98a7c1ad9c5eeb3a2b06f3" + "1.12.1": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.1-release.tar.gz" + sha256: "debc6d5d5eb946bb14e47cffc33db4fffb4f11765f34f8db04e71e866d1af8f9" + "1.12.0": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.0-release.tar.gz" + sha256: "33b5acd5a09a9466c2710f6f2e3bd2492dd3372b655ea83f62520ac8fc213631" + "1.11.3": + url: "https://github.com/pocoproject/poco/archive/poco-1.11.3-release.tar.gz" + sha256: "fb5e8e70c7dbc8f3b59ec8560140a267b4eaf06ee519dc21f312d0eb195cba37" + "1.11.2": + url: "https://github.com/pocoproject/poco/archive/poco-1.11.2-release.tar.gz" + sha256: "9774651a02e4cfa79fc43b7db617e45d353ede00b7be8afd0e74e6afb23d3793" + "1.11.1": + url: "https://github.com/pocoproject/poco/archive/poco-1.11.1-release.tar.gz" + sha256: "2412a5819a239ff2ee58f81033bcc39c40460d7a8b330013a687c8c0bd2b4ac0" + "1.11.0": + url: "https://github.com/pocoproject/poco/archive/poco-1.11.0-release.tar.gz" + sha256: "8a7bfd0883ee95e223058edce8364c7d61026ac1882e29643822ce9b753f3602" + "1.10.1": + url: "https://github.com/pocoproject/poco/archive/poco-1.10.1-release.tar.gz" + sha256: "44592a488d2830c0b4f3bfe4ae41f0c46abbfad49828d938714444e858a00818" + "1.10.0": + url: "https://github.com/pocoproject/poco/archive/poco-1.10.0-release.tar.gz" + sha256: "8047800d5a965d3177e614b4a4a162381e2638220b24d1d15ff5d6cac1738be8" + "1.9.4": + url: "https://github.com/pocoproject/poco/archive/poco-1.9.4-release.tar.gz" + sha256: "367014cdbcfe9df8f1d746239902149d2398af9b49ba2c1aaaa88616fd538f61" + "1.9.3": + url: "https://github.com/pocoproject/poco/archive/poco-1.9.3-release.tar.gz" + sha256: "73b9dfd1f57106eefb9b451d223579281acfb50b031424e9d0c6486ebb824d01" + "1.8.1": + url: "https://github.com/pocoproject/poco/archive/poco-1.8.1-release.tar.gz" + sha256: "43cc469c01d1f799efc51e2bfde6ffdf467b98a8a0901e6b33db86958619b3af" +patches: + "1.12.4": + - patch_file: patches/1.12.4.patch + - patch_file: patches/0002-mysql-include.patch + "1.12.3": + - patch_file: patches/1.12.3.patch + - patch_file: patches/0002-mysql-include.patch + "1.12.2": + - patch_file: patches/1.12.2.patch + - patch_file: patches/0002-mysql-include.patch + "1.12.1": + - patch_file: patches/1.12.1.patch + - patch_file: patches/0002-mysql-include.patch + "1.12.0": + - patch_file: patches/1.12.0.patch + - patch_file: patches/0002-mysql-include.patch + "1.11.3": + - patch_file: patches/1.11.1.patch + - patch_file: patches/0002-mysql-include.patch + "1.11.2": + - patch_file: patches/1.11.1.patch + - patch_file: patches/0002-mysql-include.patch + "1.11.1": + - patch_file: patches/1.11.1.patch + - patch_file: patches/0002-mysql-include.patch + "1.11.0": + - patch_file: patches/1.11.0.patch + - patch_file: patches/0002-mysql-include.patch + "1.10.1": + - patch_file: patches/1.10.1.patch + "1.10.0": + - patch_file: patches/1.10.0.patch + - patch_file: patches/1.10.0-set-missing-cmake-variable.patch + "1.9.4": + - patch_file: patches/1.9.2.patch + "1.9.3": + - patch_file: patches/1.9.2.patch + "1.8.1": + - patch_file: patches/1.8.1.patch diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py new file mode 100644 index 0000000000000..4c42e9050c2aa --- /dev/null +++ b/recipes/poco/all/conanfile.py @@ -0,0 +1,325 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, VCVars +from conan.tools.scm import Version +from collections import namedtuple +import os + +required_conan_version = ">=1.54.0" + + +class PocoConan(ConanFile): + name = "poco" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pocoproject.org" + topics = ("building", "networking", "server", "mobile", "embedded") + license = "BSL-1.0" + description = ( + "Modern, powerful open source C++ class libraries for building " + "network- and internet-based applications that run on desktop, server, " + "mobile and embedded systems." + ) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_fork": [True, False], + "enable_active_record": [True, False, "deprecated"], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_fork": True, + "enable_active_record": "deprecated", + } + + _PocoComponent = namedtuple("_PocoComponent", ("option", "default_option", "dependencies", "external_dependencies", "is_lib")) + _poco_component_tree = { + "mod_poco": _PocoComponent("enable_apacheconnector", False, ["Util", "Net"], ["apr::apr", "apr-util::apr-util"], False), + "CppParser": _PocoComponent("enable_cppparser", False, ["Foundation"], [], False), + # "CppUnit": _PocoComponent("enable_cppunit", False, ["Foundation"], [], False)), + "Crypto": _PocoComponent("enable_crypto", True, ["Foundation"], ["openssl::openssl"], True), + "Data": _PocoComponent("enable_data", True, ["Foundation"], [], True), + "DataMySQL": _PocoComponent("enable_data_mysql", True, ["Data"], ["libmysqlclient::libmysqlclient"], True), + "DataODBC": _PocoComponent("enable_data_odbc", False, ["Data"], [], True), # requires odbc but conditional, see package_info() + "DataPostgreSQL": _PocoComponent("enable_data_postgresql", True, ["Data"], ["libpq::libpq"], True), + "DataSQLite": _PocoComponent("enable_data_sqlite", True, ["Data"], ["sqlite3::sqlite3"], True), + "Encodings": _PocoComponent("enable_encodings", True, ["Foundation"], [], True), + # "EncodingsCompiler": _PocoComponent("enable_encodingscompiler", False, ["Net", "Util"], [], False), + "Foundation": _PocoComponent(None, "Foundation", [], ["pcre::pcre", "zlib::zlib"], True), + "JSON": _PocoComponent("enable_json", True, ["Foundation"], [], True), + "JWT": _PocoComponent("enable_jwt", True, ["JSON", "Crypto"], [], True), + "MongoDB": _PocoComponent("enable_mongodb", True, ["Net"], [], True), + "Net": _PocoComponent("enable_net", True, ["Foundation"], [], True), + "NetSSL": _PocoComponent("enable_netssl", True, ["Crypto", "Util", "Net"], [], True), + "NetSSLWin": _PocoComponent("enable_netssl_win", False, ["Net", "Util"], [], True), + "PDF": _PocoComponent("enable_pdf", False, ["XML", "Util"], [], True), + "PageCompiler": _PocoComponent("enable_pagecompiler", False, ["Net", "Util"], [], False), + "File2Page": _PocoComponent("enable_pagecompiler_file2page", False, ["Net", "Util", "XML", "JSON"], [], False), + "PocoDoc": _PocoComponent("enable_pocodoc", False, ["Util", "XML", "CppParser"], [], False), + "Redis": _PocoComponent("enable_redis", True, ["Net"], [], True), + "SevenZip": _PocoComponent("enable_sevenzip", False, ["Util", "XML"], [], True), + "Util": _PocoComponent("enable_util", True, ["Foundation", "XML", "JSON"], [], True), + "XML": _PocoComponent("enable_xml", True, ["Foundation"], ["expat::expat"], True), + "Zip": _PocoComponent("enable_zip", True, ["Util", "XML"], [], True), + "ActiveRecord": _PocoComponent("enable_activerecord", True, ["Foundation", "Data"], [], True), + "ActiveRecordCompiler": _PocoComponent("enable_activerecord_compiler", False, ["Util", "XML"], [], False), + "Prometheus": _PocoComponent("enable_prometheus", False, ["Foundation", "Net"], [], True), + } + + for comp in _poco_component_tree.values(): + if comp.option: + options[comp.option] = [True, False] + default_options[comp.option] = comp.default_option + del comp + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.enable_fork + else: + del self.options.enable_netssl_win + if Version(self.version) < "1.9.0": + del self.options.enable_encodings + if Version(self.version) < "1.10.0": + del self.options.enable_data_mysql + del self.options.enable_data_postgresql + del self.options.enable_jwt + if Version(self.version) < "1.11.0": + del self.options.enable_activerecord + del self.options.enable_activerecord_compiler + if Version(self.version) < "1.12.0": + del self.options.enable_prometheus + + def configure(self): + if self.options.enable_active_record != "deprecated": + self.output.warning("enable_active_record option is deprecated, use 'enable_activerecord' instead") + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.enable_xml: + util_dependencies = self._poco_component_tree["Util"].dependencies + self._poco_component_tree["Util"] = self._poco_component_tree["Util"]._replace(dependencies = [x for x in util_dependencies if x != "XML"]) + if not self.options.enable_json: + util_dependencies = self._poco_component_tree["Util"].dependencies + self._poco_component_tree["Util"] = self._poco_component_tree["Util"]._replace(dependencies = [x for x in util_dependencies if x != "JSON"]) + if Version(self.version) >= "1.12.0": + foundation_external_dependencies = self._poco_component_tree["Foundation"].external_dependencies + self._poco_component_tree["Foundation"] = self._poco_component_tree["Foundation"]._replace(external_dependencies = list(map(lambda x: 'pcre2::pcre2' if x == 'pcre::pcre' else x, foundation_external_dependencies))) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "1.12.0": + self.requires("pcre/8.45") + else: + self.requires("pcre2/10.42") + self.requires("zlib/1.2.13") + if self.options.enable_xml: + self.requires("expat/2.5.0") + if self.options.enable_data_sqlite: + self.requires("sqlite3/3.40.1") + if self.options.enable_apacheconnector: + self.requires("apr/1.7.0") + self.requires("apr-util/1.6.1") + if self.options.enable_netssl or self.options.enable_crypto or \ + self.options.get_safe("enable_jwt"): + self.requires("openssl/1.1.1t", transitive_headers=True) + if self.options.enable_data_odbc and self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("enable_data_postgresql"): + self.requires("libpq/14.5") + if self.options.get_safe("enable_data_mysql"): + self.requires("libmysqlclient/8.0.31") + + def package_id(self): + del self.info.options.enable_active_record + + def validate(self): + if self.options.enable_apacheconnector: + # FIXME: missing apache2 recipe + few issues + raise ConanInvalidConfiguration("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764") + if is_msvc(self) and self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Cannot build shared poco libraries with MT(d) runtime") + for compopt in self._poco_component_tree.values(): + if not compopt.option: + continue + if self.options.get_safe(compopt.option, False): + for compdep in compopt.dependencies: + if not self._poco_component_tree[compdep].option: + continue + if not self.options.get_safe(self._poco_component_tree[compdep].option, False): + raise ConanInvalidConfiguration(f"option {compopt.option} requires also option {self._poco_component_tree[compdep].option}") + if self.options.enable_data_sqlite: + if self.dependencies["sqlite3"].options.threadsafe == 0: + raise ConanInvalidConfiguration("sqlite3 must be built with threadsafe enabled") + if self.options.enable_netssl and self.options.get_safe("enable_netssl_win", False): + raise ConanInvalidConfiguration("Conflicting enable_netssl[_win] settings") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _dep_include_paths(self, dep_name): + dep = self.dependencies[dep_name] + dep_cpp_info = dep.cpp_info.aggregated_components() + return [os.path.join(dep.package_folder, dir).replace("\\", "/") for dir in dep_cpp_info.includedirs] + + def _dep_lib_paths(self, dep_name): + dep = self.dependencies[dep_name] + dep_cpp_info = dep.cpp_info.aggregated_components() + return [os.path.join(dep.package_folder, dir).replace("\\", "/") for dir in dep_cpp_info.libdirs] + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type + if Version(self.version) < "1.10.1": + tc.variables["POCO_STATIC"] = not self.options.shared + for comp in self._poco_component_tree.values(): + if comp.option: + tc.variables[comp.option.upper()] = self.options.get_safe(comp.option, False) + tc.variables["POCO_UNBUNDLED"] = True + tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + if is_msvc(self): + tc.variables["POCO_MT"] = is_msvc_static_runtime(self) + if self.options.get_safe("enable_data_postgresql", False): + tc.variables["PostgreSQL_ROOT_DIR"] = self.dependencies["libpq"].package_folder.replace("\\", "/") + tc.variables["PostgreSQL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("libpq")) + tc.variables["PostgreSQL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("libpq")) + if self.options.get_safe("enable_data_mysql", False): + tc.variables["MYSQL_ROOT_DIR"] = self.dependencies["libmysqlclient"].package_folder.replace("\\", "/") + tc.variables["MYSQL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("libmysqlclient")) + tc.variables["MYSQL_INCLUDE_DIR"] = ";".join(self._dep_include_paths("libmysqlclient")) + tc.variables["MYSQL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("libmysqlclient")) + if self.options.enable_apacheconnector: + tc.variables["APR_ROOT_DIR"] = self.dependencies["apr"].package_folder.replace("\\", "/") + tc.variables["APR_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("apr")) + tc.variables["APR_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("apr")) + tc.variables["APRUTIL_ROOT_DIR"] = self.dependencies["apr-util"].package_folder.replace("\\", "/") + tc.variables["APRUTIL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("apr-util")) + tc.variables["APRUTIL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("apr-util")) + # Disable fork + if not self.options.get_safe("enable_fork", True): + tc.variables["POCO_NO_FORK_EXEC"] = True + # Disable automatic linking on MSVC + tc.preprocessor_definitions["POCO_NO_AUTOMATIC_LIBS"] = "1" + # Picked up from conan v1 CMake wrapper, don't know the rationale + if Version(self.version) >= "1.11.0": + tc.preprocessor_definitions["XML_DTD"] = "1" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if is_msvc(self): + # On Windows, Poco needs a message (MC) compiler. + vcvars = VCVars(self) + vcvars.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # mysql + if self.options.get_safe("enable_data_mysql"): + mysql_cpp_info = self.dependencies["libmysqlclient"].cpp_info + mysql_config_file = mysql_cpp_info.get_property("cmake_file_name") or "libmysqlclient" + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(MySQL REQUIRED)", + f"find_package({mysql_config_file} REQUIRED CONFIG)\nset(MYSQL_FOUND TRUE)", + ) + mysql_target_name = mysql_cpp_info.get_property("cmake_target_name") or "libmysqlclient::libmysqlclient" + replace_in_file( + self, + os.path.join(self.source_folder, "Data", "MySQL", "CMakeLists.txt"), + "MySQL::client", + mysql_target_name, + ) + # libpq + if self.options.get_safe("enable_data_postgresql"): + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(PostgreSQL REQUIRED)", + "find_package(PostgreSQL REQUIRED)\nset(POSTGRESQL_FOUND TRUE)", + ) + replace_in_file( + self, + os.path.join(self.source_folder, "Data", "PostgreSQL", "CMakeLists.txt"), + "PostgreSQL::client", + "PostgreSQL::PostgreSQL", + ) + # Ensure to use FindEXPAT.cmake instead of expat-config.cmake + # (side effect of CMAKE_FIND_PACKAGE_PREFER_CONFIG ON, see https://github.com/conan-io/conan/issues/10387) + replace_in_file( + self, + os.path.join(self.source_folder, "XML", "CMakeLists.txt"), + "find_package(EXPAT REQUIRED)", + "find_package(EXPAT REQUIRED MODULE)", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Poco") + self.cpp_info.set_property("cmake_target_name", "Poco::Poco") + + self.cpp_info.filenames["cmake_find_package"] = "Poco" + self.cpp_info.filenames["cmake_find_package_multi"] = "Poco" + self.cpp_info.names["cmake_find_package"] = "Poco" + self.cpp_info.names["cmake_find_package_multi"] = "Poco" + + suffix = msvc_runtime_flag(self).lower() \ + if is_msvc(self) and not self.options.shared \ + else ("d" if self.settings.build_type == "Debug" else "") + + for compname, comp in self._poco_component_tree.items(): + if comp.option is None or self.options.get_safe(comp.option): + conan_component = f"poco_{compname.lower()}" + requires = [f"poco_{dependency.lower()}" for dependency in comp.dependencies] + comp.external_dependencies + self.cpp_info.components[conan_component].set_property("cmake_target_name", f"Poco::{compname}") + self.cpp_info.components[conan_component].set_property("cmake_file_name", compname) + self.cpp_info.components[conan_component].names["cmake_find_package"] = compname + self.cpp_info.components[conan_component].names["cmake_find_package_multi"] = compname + if comp.is_lib: + self.cpp_info.components[conan_component].libs = [f"Poco{compname}{suffix}"] + self.cpp_info.components[conan_component].requires = requires + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["poco_foundation"].system_libs.extend(["pthread", "dl", "rt"]) + + if is_msvc(self): + self.cpp_info.components["poco_foundation"].defines.append("POCO_NO_AUTOMATIC_LIBS") + if not self.options.shared: + self.cpp_info.components["poco_foundation"].defines.append("POCO_STATIC=ON") + if self.settings.os == "Windows": + self.cpp_info.components["poco_foundation"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) + if self.options.enable_data_odbc: + if self.settings.os == "Windows": + self.cpp_info.components["poco_dataodbc"].system_libs.extend(["odbc32", "odbccp32"]) + else: + self.cpp_info.components["poco_dataodbc"].requires.append("odbc::odbc") + self.cpp_info.components["poco_foundation"].defines.append("POCO_UNBUNDLED") + if self.options.enable_util: + if not self.options.enable_json: + self.cpp_info.components["poco_util"].defines.append("POCO_UTIL_NO_JSONCONFIGURATION") + if not self.options.enable_xml: + self.cpp_info.components["poco_util"].defines.append("POCO_UTIL_NO_XMLCONFIGURATION") diff --git a/recipes/poco/all/patches/0002-mysql-include.patch b/recipes/poco/all/patches/0002-mysql-include.patch new file mode 100644 index 0000000000000..1b3c4f453a712 --- /dev/null +++ b/recipes/poco/all/patches/0002-mysql-include.patch @@ -0,0 +1,156 @@ +diff --git a/Data/MySQL/include/Poco/Data/MySQL/Binder.h b/Data/MySQL/include/Poco/Data/MySQL/Binder.h +index 82fa617..dd7bf60 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/Binder.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/Binder.h +@@ -22,7 +22,7 @@ + #include "Poco/Data/AbstractBinder.h" + #include "Poco/Data/LOB.h" + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/include/Poco/Data/MySQL/MySQL.h b/Data/MySQL/include/Poco/Data/MySQL/MySQL.h +index 6ddcd39..7f4cd22 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/MySQL.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/MySQL.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Foundation.h" +-#include ++#include + + + // +diff --git a/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h b/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h +index 67692df..2d28da3 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h +@@ -20,7 +20,7 @@ + + #include "Poco/Data/MySQL/MySQL.h" + #include "Poco/Data/DataException.h" +-#include ++#include + #include + #include + +diff --git a/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h b/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h +index 3a45387..9361dcf 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Data/MetaColumn.h" +-#include ++#include + #include + + +diff --git a/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h b/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h +index 4f65ae5..f9df7ad 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h b/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h +index 6767b68..55f0991 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/include/Poco/Data/MySQL/Utility.h b/Data/MySQL/include/Poco/Data/MySQL/Utility.h +index 79c13c3..4fba2c9 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/Utility.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/Utility.h +@@ -20,7 +20,7 @@ + + #include "Poco/Data/MySQL/MySQL.h" + #include "Poco/Data/Session.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/src/Connector.cpp b/Data/MySQL/src/Connector.cpp +index b90abab..43e2432 100644 +--- a/Data/MySQL/src/Connector.cpp ++++ b/Data/MySQL/src/Connector.cpp +@@ -16,7 +16,7 @@ + #include "Poco/Data/MySQL/SessionImpl.h" + #include "Poco/Data/SessionFactory.h" + #include "Poco/Exception.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/src/MySQLException.cpp b/Data/MySQL/src/MySQLException.cpp +index bffdaae..d8fe137 100644 +--- a/Data/MySQL/src/MySQLException.cpp ++++ b/Data/MySQL/src/MySQLException.cpp +@@ -18,7 +18,7 @@ + + + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + #include + + +diff --git a/Data/MySQL/src/StatementExecutor.cpp b/Data/MySQL/src/StatementExecutor.cpp +index b7e8dbc..d1b512d 100644 +--- a/Data/MySQL/src/StatementExecutor.cpp ++++ b/Data/MySQL/src/StatementExecutor.cpp +@@ -14,7 +14,7 @@ + + #include "Poco/Data/MySQL/StatementExecutor.h" + #include "Poco/Format.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/src/Utility.cpp b/Data/MySQL/src/Utility.cpp +index 84e5cfc..b711901 100644 +--- a/Data/MySQL/src/Utility.cpp ++++ b/Data/MySQL/src/Utility.cpp +@@ -15,7 +15,7 @@ + + + #include "Poco/Data/MySQL/Utility.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/testsuite/src/SQLExecutor.cpp b/Data/MySQL/testsuite/src/SQLExecutor.cpp +index 27beb6f..1987659 100644 +--- a/Data/MySQL/testsuite/src/SQLExecutor.cpp ++++ b/Data/MySQL/testsuite/src/SQLExecutor.cpp +@@ -29,7 +29,7 @@ + #include + #endif + +-#include ++#include + #include + #include + diff --git a/recipes/poco/all/patches/1.10.0-set-missing-cmake-variable.patch b/recipes/poco/all/patches/1.10.0-set-missing-cmake-variable.patch new file mode 100644 index 0000000000000..83c11982c1cfa --- /dev/null +++ b/recipes/poco/all/patches/1.10.0-set-missing-cmake-variable.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -436,7 +436,7 @@ + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) +- ++set(PocoConfigPackageLocation "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}") + configure_file(cmake/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" @ONLY) + install( + FILES diff --git a/recipes/poco/all/patches/1.10.0.patch b/recipes/poco/all/patches/1.10.0.patch new file mode 100644 index 0000000000000..a293b75b06fea --- /dev/null +++ b/recipes/poco/all/patches/1.10.0.patch @@ -0,0 +1,51 @@ +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -40,7 +40,7 @@ if(WIN32) + endforeach() + endif (X64) + endif () +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if (NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") +@@ -278,7 +278,7 @@ + + if (MSVC) + # install the targets pdb +- POCO_INSTALL_PDB(${target_name}) ++ # POCO_INSTALL_PDB(${target_name}) + endif() + + endmacro() +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if (POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation + ) + + if (POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif (POCO_UNBUNDLED) + +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -21,7 +21,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib ws2_32 ) + target_include_directories(NetSSLWin + PUBLIC + $ diff --git a/recipes/poco/all/patches/1.10.1.patch b/recipes/poco/all/patches/1.10.1.patch new file mode 100644 index 0000000000000..60675d563d9b5 --- /dev/null +++ b/recipes/poco/all/patches/1.10.1.patch @@ -0,0 +1,51 @@ +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -40,7 +40,7 @@ if(WIN32) + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") +@@ -279,7 +279,7 @@ + + if(MSVC) + # install the targets pdb +- POCO_INSTALL_PDB(${target_name}) ++ # POCO_INSTALL_PDB(${target_name}) + endif() + + endmacro() +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if(POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -21,7 +21,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib ws2_32 ) + target_include_directories(NetSSLWin + PUBLIC + $ diff --git a/recipes/poco/all/patches/1.11.0.patch b/recipes/poco/all/patches/1.11.0.patch new file mode 100644 index 0000000000000..1e07c041d0c68 --- /dev/null +++ b/recipes/poco/all/patches/1.11.0.patch @@ -0,0 +1,120 @@ +diff --git a/ActiveRecord/Compiler/CMakeLists.txt b/ActiveRecord/Compiler/CMakeLists.txt +index 06749c1..40a8b23 100644 +--- a/ActiveRecord/Compiler/CMakeLists.txt ++++ b/ActiveRecord/Compiler/CMakeLists.txt +@@ -21,5 +21,6 @@ install( + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION bin ++ BUNDLE DESTINATION bin + INCLUDES DESTINATION include + ) +diff --git a/Encodings/Compiler/CMakeLists.txt b/Encodings/Compiler/CMakeLists.txt +index 97eecfe..fa4e85b 100644 +--- a/Encodings/Compiler/CMakeLists.txt ++++ b/Encodings/Compiler/CMakeLists.txt +@@ -15,5 +15,6 @@ install( + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION bin ++ BUNDLE DESTINATION bin + INCLUDES DESTINATION include + ) +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 6b276bef5..92ea97727 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if(POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +index 3e2b5ff..2ab7590 100644 +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ +diff --git a/PageCompiler/CMakeLists.txt b/PageCompiler/CMakeLists.txt +index d80fe73..48379eb 100644 +--- a/PageCompiler/CMakeLists.txt ++++ b/PageCompiler/CMakeLists.txt +@@ -23,5 +23,6 @@ install( + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION bin ++ BUNDLE DESTINATION bin + INCLUDES DESTINATION include + ) +diff --git a/PocoDoc/CMakeLists.txt b/PocoDoc/CMakeLists.txt +index 92f37a9..49ad7b4 100644 +--- a/PocoDoc/CMakeLists.txt ++++ b/PocoDoc/CMakeLists.txt +@@ -11,5 +11,6 @@ install( + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION bin ++ BUNDLE DESTINATION bin + INCLUDES DESTINATION include + ) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4e0527296..f6ceb699d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -204,6 +204,15 @@ endif() + + include(DefinePlatformSpecifc) + ++# Disable fork exec ++option(POCO_NO_FORK_EXEC ++ "Set to OFF|ON (default is OFF) to control disable fork exec" OFF) ++ ++if(POCO_NO_FORK_EXEC) ++ add_definitions(-DPOCO_NO_FORK_EXEC=1) ++ message(STATUS "Building with fork exec disabled") ++endif() ++ + # Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file + set(Poco_COMPONENTS "") + +diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +index 038779ec9..fa7afdb1b 100644 +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -40,7 +40,7 @@ if(WIN32) + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") +@@ -274,6 +274,7 @@ install( + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION bin ++ BUNDLE DESTINATION bin + INCLUDES DESTINATION include + ) + diff --git a/recipes/poco/all/patches/1.11.1.patch b/recipes/poco/all/patches/1.11.1.patch new file mode 100644 index 0000000000000..e5f552582596d --- /dev/null +++ b/recipes/poco/all/patches/1.11.1.patch @@ -0,0 +1,50 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 6b276bef5..92ea97727 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if(POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +index 3e2b5ff..2ab7590 100644 +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ + +diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +index 038779ec9..fa7afdb1b 100644 +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -40,7 +40,7 @@ if(WIN32) + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") + diff --git a/recipes/poco/all/patches/1.12.0.patch b/recipes/poco/all/patches/1.12.0.patch new file mode 100644 index 0000000000000..0f5458cd155b5 --- /dev/null +++ b/recipes/poco/all/patches/1.12.0.patch @@ -0,0 +1,36 @@ +diff -ruN a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake 2022-07-08 18:28:44.000000000 +0200 ++++ b/cmake/PocoMacros.cmake 2022-07-11 17:50:48.547610971 +0200 +@@ -40,7 +40,7 @@ + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") +diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +--- a/Foundation/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 ++++ b/Foundation/CMakeLists.txt 2022-07-11 17:54:24.035097782 +0200 +@@ -107,7 +107,7 @@ + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff -ruN a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +--- a/NetSSL_Win/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 ++++ b/NetSSL_Win/CMakeLists.txt 2022-07-11 17:50:09.841223897 +0200 +@@ -21,7 +21,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ diff --git a/recipes/poco/all/patches/1.12.1.patch b/recipes/poco/all/patches/1.12.1.patch new file mode 100644 index 0000000000000..0f5458cd155b5 --- /dev/null +++ b/recipes/poco/all/patches/1.12.1.patch @@ -0,0 +1,36 @@ +diff -ruN a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake 2022-07-08 18:28:44.000000000 +0200 ++++ b/cmake/PocoMacros.cmake 2022-07-11 17:50:48.547610971 +0200 +@@ -40,7 +40,7 @@ + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") +diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +--- a/Foundation/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 ++++ b/Foundation/CMakeLists.txt 2022-07-11 17:54:24.035097782 +0200 +@@ -107,7 +107,7 @@ + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff -ruN a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +--- a/NetSSL_Win/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 ++++ b/NetSSL_Win/CMakeLists.txt 2022-07-11 17:50:09.841223897 +0200 +@@ -21,7 +21,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ diff --git a/recipes/poco/all/patches/1.12.2.patch b/recipes/poco/all/patches/1.12.2.patch new file mode 100644 index 0000000000000..0f5458cd155b5 --- /dev/null +++ b/recipes/poco/all/patches/1.12.2.patch @@ -0,0 +1,36 @@ +diff -ruN a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake 2022-07-08 18:28:44.000000000 +0200 ++++ b/cmake/PocoMacros.cmake 2022-07-11 17:50:48.547610971 +0200 +@@ -40,7 +40,7 @@ + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") +diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +--- a/Foundation/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 ++++ b/Foundation/CMakeLists.txt 2022-07-11 17:54:24.035097782 +0200 +@@ -107,7 +107,7 @@ + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff -ruN a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +--- a/NetSSL_Win/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 ++++ b/NetSSL_Win/CMakeLists.txt 2022-07-11 17:50:09.841223897 +0200 +@@ -21,7 +21,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ diff --git a/recipes/poco/all/patches/1.12.3.patch b/recipes/poco/all/patches/1.12.3.patch new file mode 100644 index 0000000000000..f1fb7b37a7386 --- /dev/null +++ b/recipes/poco/all/patches/1.12.3.patch @@ -0,0 +1,39 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index f504bc1a3..8fe9acf37 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -107,7 +107,7 @@ set_target_properties(Foundation + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +index c6325eb4f..8541ffcb5 100644 +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ +diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +index 0ef354e9e..f57e39c3c 100644 +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -40,7 +40,7 @@ if(WIN32) + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") diff --git a/recipes/poco/all/patches/1.12.4.patch b/recipes/poco/all/patches/1.12.4.patch new file mode 100644 index 0000000000000..f1fb7b37a7386 --- /dev/null +++ b/recipes/poco/all/patches/1.12.4.patch @@ -0,0 +1,39 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index f504bc1a3..8fe9acf37 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -107,7 +107,7 @@ set_target_properties(Foundation + ) + + if(POCO_UNBUNDLED) +- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) + endif(POCO_UNBUNDLED) + +diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt +index c6325eb4f..8541ffcb5 100644 +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) ++target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) + target_include_directories(NetSSLWin + PUBLIC + $ +diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +index 0ef354e9e..f57e39c3c 100644 +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -40,7 +40,7 @@ if(WIN32) + endforeach() + endif(X64) + endif() +- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} ++ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} + DOC "path to message compiler") + if(NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") diff --git a/recipes/poco/all/patches/1.8.1.patch b/recipes/poco/all/patches/1.8.1.patch new file mode 100644 index 0000000000000..a13cf433b0cbd --- /dev/null +++ b/recipes/poco/all/patches/1.8.1.patch @@ -0,0 +1,81 @@ +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -265,7 +265,7 @@ + + if (MSVC) + # install the targets pdb +- POCO_INSTALL_PDB(${target_name}) ++ # POCO_INSTALL_PDB(${target_name}) + endif() + + endmacro() +--- a/Crypto/CMakeLists.txt ++++ b/Crypto/CMakeLists.txt +@@ -20,7 +20,7 @@ + DEFINE_SYMBOL Crypto_EXPORTS + ) + +-target_link_libraries( "${LIBNAME}" Foundation ${OPENSSL_LIBRARIES} ) ++target_link_libraries( "${LIBNAME}" Foundation OpenSSL::SSL OpenSSL::Crypto) + target_include_directories( "${LIBNAME}" + PUBLIC + $ +--- a/Data/SQLite/CMakeLists.txt ++++ b/Data/SQLite/CMakeLists.txt +@@ -10,9 +10,9 @@ + POCO_HEADERS_AUTO( SQLITE_SRCS ${HDRS_G}) + + if (POCO_UNBUNDLED) +- find_package(SQLite3) +- set(DATASQLITELIBS ${SQLITE3_LIBRARIES}) +- include_directories("${SQLITE3_INCLUDE_DIRS}") ++ find_package(SQLite3 REQUIRED) ++ set(DATASQLITELIBS SQLite::SQLite3) ++ #include_directories(${SQLite3_INCLUDE_DIRS}) + else() + # sqlite3 + POCO_SOURCES( SQLITE_SRCS sqlite3 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -32,9 +32,8 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if (POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) +- set(SYSLIBS ${SYSLIBS} ${PCRE_LIBRARIES}) +- include_directories(${PCRE_INCLUDE_DIRS}) ++ find_package(pcre REQUIRED CONFIG) ++ set(SYSLIBS ${SYSLIBS} pcre::libpcre) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library + POCO_SOURCES( SRCS RegExp +@@ -106,7 +105,6 @@ if(ANDROID) + endif(ANDROID) + + # TODO: Why is this here? +-add_definitions( -DPCRE_STATIC) + + # For SetAffinity + if(UNIX AND NOT APPLE) +--- a/NetSSL_OpenSSL/CMakeLists.txt ++++ b/NetSSL_OpenSSL/CMakeLists.txt +@@ -18,7 +18,7 @@ set_target_properties( "${LIBNAME}" + DEFINE_SYMBOL NetSSL_EXPORTS + ) + +-target_link_libraries( "${LIBNAME}" Crypto Net Util Foundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) ++target_link_libraries( "${LIBNAME}" Crypto Net Util Foundation OpenSSL::SSL OpenSSL::Crypto ) + target_include_directories( "${LIBNAME}" + PUBLIC + $ +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -18,7 +18,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries( "${LIBNAME}" Net Util Foundation Crypt32.lib ) ++target_link_libraries( "${LIBNAME}" Net Util Foundation Crypt32.lib ws2_32 ) + target_include_directories( "${LIBNAME}" + PUBLIC + $ diff --git a/recipes/poco/all/patches/1.9.2.patch b/recipes/poco/all/patches/1.9.2.patch new file mode 100644 index 0000000000000..2eab9fab22f69 --- /dev/null +++ b/recipes/poco/all/patches/1.9.2.patch @@ -0,0 +1,81 @@ +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -278,7 +278,7 @@ + + if (MSVC) + # install the targets pdb +- POCO_INSTALL_PDB(${target_name}) ++ # POCO_INSTALL_PDB(${target_name}) + endif() + + endmacro() +--- a/Crypto/CMakeLists.txt ++++ b/Crypto/CMakeLists.txt +@@ -24,7 +24,7 @@ + DEFINE_SYMBOL Crypto_EXPORTS + ) + +-target_link_libraries( "${LIBNAME}" Foundation ${OPENSSL_LIBRARIES} ) ++target_link_libraries( "${LIBNAME}" Foundation OpenSSL::SSL OpenSSL::Crypto) + target_include_directories( "${LIBNAME}" + PUBLIC + $ +--- a/Data/SQLite/CMakeLists.txt ++++ b/Data/SQLite/CMakeLists.txt +@@ -16,9 +16,9 @@ + endif() + + if (POCO_UNBUNDLED) +- find_package(SQLite3) +- set(DATASQLITELIBS ${SQLITE3_LIBRARIES}) +- include_directories("${SQLITE3_INCLUDE_DIRS}") ++ find_package(SQLite3 REQUIRED) ++ set(DATASQLITELIBS SQLite::SQLite3) ++ #include_directories(${SQLite3_INCLUDE_DIRS}) + else() + # sqlite3 + POCO_SOURCES( SQLITE_SRCS sqlite3 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -38,9 +38,8 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if (POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) +- set(SYSLIBS ${SYSLIBS} ${PCRE_LIBRARIES}) +- include_directories(${PCRE_INCLUDE_DIRS}) ++ find_package(pcre REQUIRED CONFIG) ++ set(SYSLIBS ${SYSLIBS} pcre::libpcre) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library + POCO_SOURCES( SRCS RegExp +@@ -112,7 +111,6 @@ if(ANDROID) + endif(ANDROID) + + # TODO: Why is this here? +-add_definitions( -DPCRE_STATIC) + + # For SetAffinity + if(UNIX AND NOT APPLE) +--- a/NetSSL_OpenSSL/CMakeLists.txt ++++ b/NetSSL_OpenSSL/CMakeLists.txt +@@ -24,7 +24,7 @@ set_target_properties( "${LIBNAME}" + DEFINE_SYMBOL NetSSL_EXPORTS + ) + +-target_link_libraries( "${LIBNAME}" Crypto Net Util Foundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) ++target_link_libraries( "${LIBNAME}" Crypto Net Util Foundation OpenSSL::SSL OpenSSL::Crypto ) + target_include_directories( "${LIBNAME}" + PUBLIC + $ +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt +@@ -24,7 +24,7 @@ + DEFINE_SYMBOL NetSSL_Win_EXPORTS + ) + +-target_link_libraries( "${LIBNAME}" Net Util Foundation Crypt32.lib ) ++target_link_libraries( "${LIBNAME}" Net Util Foundation Crypt32.lib ws2_32 ) + target_include_directories( "${LIBNAME}" + PUBLIC + $ diff --git a/recipes/poco/all/test_package/CMakeLists.txt b/recipes/poco/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..42eba4251a7ef --- /dev/null +++ b/recipes/poco/all/test_package/CMakeLists.txt @@ -0,0 +1,111 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +enable_testing() + +option(TEST_UTIL "Test Util" ON) +option(TEST_CRYPTO "Test crypto" ON) +option(TEST_NET "Test Net" ON) +option(TEST_NETSSL "Test NetSSL" ON) +option(TEST_SQLITE "Test Sqlite" ON) +option(TEST_ENCODINGS "Test Encodings" ON) +option(TEST_JWT "Test JWT" ON) +option(TEST_PROMETHEUS "Test Prometheus" ON) + +set(POCO_COMPONENTS Foundation) +if(TEST_UTIL) + list(APPEND POCO_COMPONENTS Util) +endif() +if(TEST_CRYPTO) + list(APPEND POCO_COMPONENTS Crypto) +endif() +if(TEST_NET) + list(APPEND POCO_COMPONENTS Net) +endif() +if(TEST_NETSSL) + list(APPEND POCO_COMPONENTS NetSSL) +endif() +if(TEST_SQLITE) + list(APPEND POCO_COMPONENTS DataSQLite) +endif() +if(TEST_ENCODINGS) + list(APPEND POCO_COMPONENTS Encodings) +endif() +if(TEST_JWT) + list(APPEND POCO_COMPONENTS JWT) +endif() +if(TEST_PROMETHEUS) + list(APPEND POCO_COMPONENTS Prometheus) +endif() + +find_package(Poco REQUIRED ${POCO_COMPONENTS} CONFIG) + +add_executable(core test_core.cpp) +target_link_libraries(core PRIVATE Poco::Foundation) +target_compile_features(core PRIVATE cxx_std_11) + +if(TEST_UTIL) + add_executable(util test_util.cpp) + target_link_libraries(util PRIVATE Poco::Util) + target_compile_features(util PRIVATE cxx_std_11) + if(MINGW) + target_link_options(util PRIVATE -municode) + endif() + add_test(NAME util COMMAND util) +endif() + +if(TEST_CRYPTO) + add_executable(tcrypto test_crypto.cpp) + target_link_libraries(tcrypto PRIVATE Poco::Crypto) + target_compile_features(tcrypto PRIVATE cxx_std_11) + add_test(NAME tcrypto COMMAND tcrypto ${CMAKE_CURRENT_SOURCE_DIR}/conanfile.py) +endif() + +if(TEST_NET) + add_executable(net test_net.cpp) + target_link_libraries(net PRIVATE Poco::Net) + target_compile_features(net PRIVATE cxx_std_11) + add_test(NAME net COMMAND net) + + if(TEST_UTIL) + add_executable(net_2 test_net_2.cpp) + target_link_libraries(net_2 PRIVATE Poco::Net Poco::Util) + target_compile_features(net_2 PRIVATE cxx_std_11) + add_test(NAME net_2 COMMAND net_2) + endif() +endif() + +if(TEST_NETSSL) + add_executable(netssl test_netssl.cpp) + target_link_libraries(netssl PRIVATE Poco::NetSSL) + target_compile_features(netssl PRIVATE cxx_std_11) + add_test(NAME netssl COMMAND netssl) +endif() + +if(TEST_SQLITE) + add_executable(sqlite test_sqlite.cpp) + target_link_libraries(sqlite PRIVATE Poco::DataSQLite) + target_compile_features(sqlite PRIVATE cxx_std_11) + add_test(NAME sqlite COMMAND sqlite) +endif() + +if(TEST_ENCODINGS) + add_executable(encodings test_encodings.cpp) + target_link_libraries(encodings PRIVATE Poco::Encodings) + target_compile_features(encodings PRIVATE cxx_std_11) + add_test(NAME encodings COMMAND encodings) +endif() + +if(TEST_JWT) + add_executable(jwt test_jwt.cpp) + target_link_libraries(jwt PRIVATE Poco::JWT) + target_compile_features(jwt PRIVATE cxx_std_11) + add_test(NAME jwt COMMAND jwt) +endif() + +if(TEST_PROMETHEUS) + add_executable(prometheus test_prometheus.cpp) + target_link_libraries(prometheus PRIVATE Poco::Prometheus) + target_compile_features(prometheus PRIVATE cxx_std_11) + add_test(NAME prometheus COMMAND prometheus) +endif() diff --git a/recipes/poco/all/test_package/conanfile.py b/recipes/poco/all/test_package/conanfile.py new file mode 100644 index 0000000000000..db2773f5ca2c2 --- /dev/null +++ b/recipes/poco/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.build import build_jobs, can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "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) + poco_options = self.dependencies["poco"].options + tc.variables["TEST_CRYPTO"] = poco_options.enable_crypto + tc.variables["TEST_UTIL"] = poco_options.enable_util + tc.variables["TEST_NET"] = poco_options.enable_net + tc.variables["TEST_NETSSL"] = poco_options.get_safe("enable_netssl") or poco_options.get_safe("enable_netssl_win") + tc.variables["TEST_SQLITE"] = poco_options.enable_data_sqlite + tc.variables["TEST_ENCODINGS"] = poco_options.get_safe("enable_encodings", False) + tc.variables["TEST_JWT"] = poco_options.get_safe("enable_jwt", False) + tc.variables["TEST_PROMETHEUS"] = poco_options.get_safe("enable_prometheus", False) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/poco/all/test_package/test_core.cpp b/recipes/poco/all/test_package/test_core.cpp new file mode 100644 index 0000000000000..0a2855d0b432e --- /dev/null +++ b/recipes/poco/all/test_package/test_core.cpp @@ -0,0 +1,55 @@ +// +// Timer.cpp +// +// This sample demonstrates the Timer and Stopwatch classes. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Timer.h" +#include "Poco/Thread.h" +#include "Poco/Stopwatch.h" +#include + + +using Poco::Timer; +using Poco::TimerCallback; +using Poco::Thread; +using Poco::Stopwatch; + + +class TimerExample +{ +public: + TimerExample() + { + _sw.start(); + } + + void onTimer(Timer& timer) + { + std::cout << "Callback called after " << _sw.elapsed()/1000 << " milliseconds." << std::endl; + } + +private: + Stopwatch _sw; +}; + + +int main(int argc, char** argv) +{ + TimerExample example; + + Timer timer(25, 50); + timer.start(TimerCallback(example, &TimerExample::onTimer)); + + Thread::sleep(500); + + timer.stop(); + + return 0; +} diff --git a/recipes/poco/all/test_package/test_crypto.cpp b/recipes/poco/all/test_package/test_crypto.cpp new file mode 100644 index 0000000000000..81b417bea088e --- /dev/null +++ b/recipes/poco/all/test_package/test_crypto.cpp @@ -0,0 +1,54 @@ +// +// md5.cpp +// +// $Id: //poco/1.4/Foundation/samples/md5/src/md5.cpp#1 $ +// +// This sample demonstrates the DigestEngine, DigestOutputStream and +// MD5Engine classes. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/MD5Engine.h" +#include "Poco/DigestStream.h" +#include "Poco/StreamCopier.h" +#include +#include + + +using Poco::DigestEngine; +using Poco::MD5Engine; +using Poco::DigestOutputStream; +using Poco::StreamCopier; + + +int main(int argc, char** argv) +{ + if (argc != 2) + { + std::cout << "usage: " << argv[0] << ": " << std::endl + << " create the MD5 digest for " << std::endl; + return 1; + } + + std::ifstream istr(argv[1], std::ios::binary); + if (!istr) + { + std::cerr << "cannot open input file: " << argv[1] << std::endl; + return 2; + } + + MD5Engine md5; + DigestOutputStream dos(md5); + + StreamCopier::copyStream(istr, dos); + dos.close(); + + std::cout << DigestEngine::digestToHex(md5.digest()) << std::endl; + + return 0; +} diff --git a/recipes/poco/all/test_package/test_encodings.cpp b/recipes/poco/all/test_package/test_encodings.cpp new file mode 100644 index 0000000000000..2bee0df8223b3 --- /dev/null +++ b/recipes/poco/all/test_package/test_encodings.cpp @@ -0,0 +1,21 @@ +#include "Poco/TextEncoding.h" + +#include + +using namespace Poco; + +int main() { + auto encoding = TextEncoding::find("utf8"); + const unsigned char utf8_bytes[] = {0xf0, 0x9f, 0x92, 0x90, 0x00}; + const int expected_unicode = 0x1f490; + int unicode = encoding->convert(utf8_bytes); + + if (unicode != expected_unicode) { + std::cerr << "Wrong unicode point!\n" + << "Expected " << expected_unicode << ", got " << unicode << "\n"; + return 1; + } + std::cout << "decoded unicode point correct!\n"; + + return 0; +} diff --git a/recipes/poco/all/test_package/test_jwt.cpp b/recipes/poco/all/test_package/test_jwt.cpp new file mode 100644 index 0000000000000..52087eab44031 --- /dev/null +++ b/recipes/poco/all/test_package/test_jwt.cpp @@ -0,0 +1,34 @@ +#include "Poco/JWT/Signer.h" +#include "Poco/JWT/Token.h" + +#include + +using namespace Poco::JSON; +using namespace Poco::JWT; + +//JWT: JSON Web Token + +int main() { + // create and sign a JWT + Token token; + token.setType("JWT"); + token.setSubject("1234567890"); + token.payload().set("name", std::string("John Doe")); + token.setIssuedAt(Poco::Timestamp()); + + Signer signer("0123456789ABCDEF0123456789ABCDEF"); + std::string jwt_tx = signer.sign(token, Signer::ALGO_HS256); + + std::cout << "json web token: " << jwt_tx << "\n"; + + std::string jwt_rx( + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9." + "eyJpYXQiOjE1MTYyMzkwMjIsIm5hbWUiOiJKb2huIERvZSIsInN1YiI6IjEyMzQ1Njc4OTAifQ." + "qn9G7NwFEOjIh-7hfCUDZA1aJeQmf7I7YvzCBcdenGw"); + + Token token_rx = signer.verify(jwt_rx); + + std::cout << "token contents: "; + token_rx.payload().stringify(std::cout); + std::cout << "\n"; +} diff --git a/recipes/poco/all/test_package/test_net.cpp b/recipes/poco/all/test_package/test_net.cpp new file mode 100644 index 0000000000000..a3fbeedb40f21 --- /dev/null +++ b/recipes/poco/all/test_package/test_net.cpp @@ -0,0 +1,5 @@ +#include "Poco/Net/ServerSocket.h" + +int main() { + Poco::Net::ServerSocket sock(8189); +} diff --git a/recipes/poco/all/test_package/test_net_2.cpp b/recipes/poco/all/test_package/test_net_2.cpp new file mode 100644 index 0000000000000..527b9ce741486 --- /dev/null +++ b/recipes/poco/all/test_package/test_net_2.cpp @@ -0,0 +1,255 @@ +// +// EchoServer.cpp +// +// $Id: //poco/1.4/Net/samples/EchoServer/src/EchoServer.cpp#1 $ +// +// This sample demonstrates the SocketReactor and SocketAcceptor classes. +// +// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Net/SocketReactor.h" +#include "Poco/Net/SocketAcceptor.h" +#include "Poco/Net/SocketNotification.h" +#include "Poco/Net/StreamSocket.h" +#include "Poco/Net/ServerSocket.h" +#include "Poco/NObserver.h" +#include "Poco/Exception.h" +#include "Poco/Thread.h" +#include "Poco/FIFOBuffer.h" +#include "Poco/Delegate.h" +#include "Poco/Util/ServerApplication.h" +#include "Poco/Util/Option.h" +#include "Poco/Util/OptionSet.h" +#include "Poco/Util/HelpFormatter.h" +#include + + +using Poco::Net::SocketReactor; +using Poco::Net::SocketAcceptor; +using Poco::Net::ReadableNotification; +using Poco::Net::WritableNotification; +using Poco::Net::ShutdownNotification; +using Poco::Net::ServerSocket; +using Poco::Net::StreamSocket; +using Poco::NObserver; +using Poco::AutoPtr; +using Poco::Thread; +using Poco::FIFOBuffer; +using Poco::delegate; +using Poco::Util::ServerApplication; +using Poco::Util::Application; +using Poco::Util::Option; +using Poco::Util::OptionSet; +using Poco::Util::HelpFormatter; + + +class EchoServiceHandler + /// I/O handler class. This class (un)registers handlers for I/O based on + /// data availability. To ensure non-blocking behavior and alleviate spurious + /// socket writability callback triggering when no data to be sent is available, + /// FIFO buffers are used. I/O FIFOBuffer sends notifications on transitions + /// from [1] non-readable (i.e. empty) to readable, [2] writable to non-writable + /// (i.e. full) and [3] non-writable (i.e. full) to writable. + /// Based on these notifications, the handler member functions react by + /// enabling/disabling respective reactor framework notifications. +{ +public: + EchoServiceHandler(StreamSocket& socket, SocketReactor& reactor): + _socket(socket), + _reactor(reactor), + _fifoIn(BUFFER_SIZE, true), + _fifoOut(BUFFER_SIZE, true) + { + Application& app = Application::instance(); + app.logger().information("Connection from " + socket.peerAddress().toString()); + + _reactor.addEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketReadable)); + _reactor.addEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketShutdown)); + + _fifoOut.readable += delegate(this, &EchoServiceHandler::onFIFOOutReadable); + _fifoIn.writable += delegate(this, &EchoServiceHandler::onFIFOInWritable); + } + + ~EchoServiceHandler() + { + Application& app = Application::instance(); + try + { + app.logger().information("Disconnecting " + _socket.peerAddress().toString()); + } + catch (...) + { + } + _reactor.removeEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketReadable)); + _reactor.removeEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketWritable)); + _reactor.removeEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketShutdown)); + + _fifoOut.readable -= delegate(this, &EchoServiceHandler::onFIFOOutReadable); + _fifoIn.writable -= delegate(this, &EchoServiceHandler::onFIFOInWritable); + } + + void onFIFOOutReadable(bool& b) + { + if (b) + _reactor.addEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketWritable)); + else + _reactor.removeEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketWritable)); + } + + void onFIFOInWritable(bool& b) + { + if (b) + _reactor.addEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketReadable)); + else + _reactor.removeEventHandler(_socket, NObserver(*this, &EchoServiceHandler::onSocketReadable)); + } + + void onSocketReadable(const AutoPtr& pNf) + { + // some socket implementations (windows) report available + // bytes on client disconnect, so we double-check here + if (_socket.available()) + { + int len = _socket.receiveBytes(_fifoIn); + _fifoIn.drain(_fifoOut.write(_fifoIn.buffer())); + } + } + + void onSocketWritable(const AutoPtr& pNf) + { + _socket.sendBytes(_fifoOut); + } + + void onSocketShutdown(const AutoPtr& pNf) + { + delete this; + } + +private: + enum + { + BUFFER_SIZE = 1024 + }; + + StreamSocket _socket; + SocketReactor& _reactor; + FIFOBuffer _fifoIn; + FIFOBuffer _fifoOut; +}; + + +class EchoServer: public Poco::Util::ServerApplication + /// The main application class. + /// + /// This class handles command-line arguments and + /// configuration files. + /// Start the EchoServer executable with the help + /// option (/help on Windows, --help on Unix) for + /// the available command line options. + /// + /// To use the sample configuration file (EchoServer.properties), + /// copy the file to the directory where the EchoServer executable + /// resides. If you start the debug version of the EchoServer + /// (EchoServerd[.exe]), you must also create a copy of the configuration + /// file named EchoServerd.properties. In the configuration file, you + /// can specify the port on which the server is listening (default + /// 9977) and the format of the date/time string sent back to the client. + /// + /// To test the EchoServer you can use any telnet client (telnet localhost 9977). +{ +public: + EchoServer(): _helpRequested(false) + { + } + + ~EchoServer() + { + } + +protected: + void initialize(Application& self) + { + loadConfiguration(); // load default configuration files, if present + ServerApplication::initialize(self); + } + + void uninitialize() + { + ServerApplication::uninitialize(); + } + + void defineOptions(OptionSet& options) + { + ServerApplication::defineOptions(options); + + options.addOption( + Option("help", "h", "display help information on command line arguments") + .required(false) + .repeatable(false)); + } + + void handleOption(const std::string& name, const std::string& value) + { + ServerApplication::handleOption(name, value); + + if (name == "help") + _helpRequested = true; + } + + void displayHelp() + { + HelpFormatter helpFormatter(options()); + helpFormatter.setCommand(commandName()); + helpFormatter.setUsage("OPTIONS"); + helpFormatter.setHeader("An echo server implemented using the Reactor and Acceptor patterns."); + helpFormatter.format(std::cout); + } + + int main(const std::vector& args) + { + if (_helpRequested) + { + displayHelp(); + } + else + { + // get parameters from configuration file + unsigned short port = (unsigned short) config().getInt("EchoServer.port", 9977); + + // set-up a server socket + ServerSocket svs(port); + // set-up a SocketReactor... + SocketReactor reactor; + // ... and a SocketAcceptor + SocketAcceptor acceptor(svs, reactor); + // run the reactor in its own thread so that we can wait for + // a termination request + Thread thread; + thread.start(reactor); + // wait for CTRL-C or kill + + // Don't wait for TerminationRequest and stop immediately (This is a bad server) + //waitForTerminationRequest(); + + // Stop the SocketReactor + reactor.stop(); + thread.join(); + } + return Application::EXIT_OK; + } + +private: + bool _helpRequested; +}; + + +int main(int argc, char** argv) +{ + EchoServer app; + return app.run(argc, argv); +} diff --git a/recipes/poco/all/test_package/test_netssl.cpp b/recipes/poco/all/test_package/test_netssl.cpp new file mode 100644 index 0000000000000..94c0782ed05b7 --- /dev/null +++ b/recipes/poco/all/test_package/test_netssl.cpp @@ -0,0 +1,47 @@ +#include "Poco/StreamCopier.h" +#include "Poco/URI.h" +#include "Poco/Exception.h" +#include "Poco/SharedPtr.h" +#include "Poco/Net/SSLManager.h" +#include "Poco/Net/KeyConsoleHandler.h" +#include "Poco/Net/AcceptCertificateHandler.h" +#include "Poco/Net/HTTPSClientSession.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include +#include + +using namespace Poco; +using namespace Poco::Net; + +class SSLInitializer { +public: + SSLInitializer() { Poco::Net::initializeSSL(); } + + ~SSLInitializer() { Poco::Net::uninitializeSSL(); } +}; + +int main(int argc, char** argv) { + SSLInitializer sslInitializer; + + SharedPtr ptrCert = new AcceptCertificateHandler(false); + Context::Ptr ptrContext = new Context(Context::CLIENT_USE, "", Context::VERIFY_NONE); + SSLManager::instance().initializeClient(0, ptrCert, ptrContext); + + try { + URI uri("https://httpbin.org/user-agent"); + HTTPSClientSession s(uri.getHost(), uri.getPort()); + HTTPRequest request(HTTPRequest::HTTP_GET, uri.getPath()); + request.set("user-agent", "Poco HTTPSClientSession"); + // FIXME: CCI Jenkins blocks the request making the build fail + //s.sendRequest(request); + //HTTPResponse response; + //std::istream& rs = s.receiveResponse(response); + //StreamCopier::copyStream(rs, std::cout); + } catch (const Exception& ex) { + std::cout << ex.displayText() << std::endl; + return 1; + } + + return 0; +} diff --git a/recipes/poco/all/test_package/test_prometheus.cpp b/recipes/poco/all/test_package/test_prometheus.cpp new file mode 100644 index 0000000000000..1b40926009ee7 --- /dev/null +++ b/recipes/poco/all/test_package/test_prometheus.cpp @@ -0,0 +1,21 @@ +#include "Poco/Prometheus/MetricsServer.h" +#include "Poco/Prometheus/ProcessCollector.h" +#include "Poco/Prometheus/ThreadPoolCollector.h" + +using Poco::Prometheus::MetricsServer; +using Poco::Prometheus::ProcessCollector; +using Poco::Prometheus::ThreadPoolCollector; + +int main() { + ProcessCollector pc; + ThreadPoolCollector collectorForDefaultThreadPool(); + + const Poco::UInt16 metricsPort = 9177; // hope this does not clash + MetricsServer server(metricsPort); + server.start(); + + // Don't wait for TerminationRequest and stop immediately (This is a test server) + //waitForTerminationRequest(); + + server.stop(); +} diff --git a/recipes/poco/all/test_package/test_sqlite.cpp b/recipes/poco/all/test_package/test_sqlite.cpp new file mode 100644 index 0000000000000..29640dc63d49c --- /dev/null +++ b/recipes/poco/all/test_package/test_sqlite.cpp @@ -0,0 +1,68 @@ +#include "Poco/Data/Session.h" +#include "Poco/Data/SQLite/Connector.h" +#include +#include + +using namespace Poco::Data::Keywords; +using Poco::Data::Session; +using Poco::Data::Statement; + +struct Person +{ + std::string name; + std::string address; + int age; +}; + +int main(int argc, char** argv) +{ + // register SQLite connector + Poco::Data::SQLite::Connector::registerConnector(); + + // create a session + Session session("SQLite", "sample.db"); + + // drop sample table, if it exists + session << "DROP TABLE IF EXISTS Person", now; + + // (re)create table + session << "CREATE TABLE Person (Name VARCHAR(30), Address VARCHAR, Age INTEGER(3))", now; + + // insert some rows + Person person = + { + "Bart Simpson", + "Springfield", + 12 + }; + + Statement insert(session); + insert << "INSERT INTO Person VALUES(?, ?, ?)", + use(person.name), + use(person.address), + use(person.age); + + insert.execute(); + + person.name = "Lisa Simpson"; + person.address = "Springfield"; + person.age = 10; + + insert.execute(); + + // a simple query + Statement select(session); + select << "SELECT Name, Address, Age FROM Person", + into(person.name), + into(person.address), + into(person.age), + range(0, 1); // iterate over result set one row at a time + + while (!select.done()) + { + select.execute(); + std::cout << person.name << " " << person.address << " " << person.age << std::endl; + } + + return 0; +} diff --git a/recipes/poco/all/test_package/test_util.cpp b/recipes/poco/all/test_package/test_util.cpp new file mode 100644 index 0000000000000..583fa1d477bef --- /dev/null +++ b/recipes/poco/all/test_package/test_util.cpp @@ -0,0 +1,192 @@ +// +// SampleApp.cpp +// +// $Id: //poco/1.4/Util/samples/SampleApp/src/SampleApp.cpp#1 $ +// +// This sample demonstrates the Application class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Util/Application.h" +#include "Poco/Util/Option.h" +#include "Poco/Util/OptionSet.h" +#include "Poco/Util/HelpFormatter.h" +#include "Poco/Util/AbstractConfiguration.h" +#include "Poco/AutoPtr.h" +#include +#include + + +using Poco::Util::Application; +using Poco::Util::Option; +using Poco::Util::OptionSet; +using Poco::Util::HelpFormatter; +using Poco::Util::AbstractConfiguration; +using Poco::Util::OptionCallback; +using Poco::AutoPtr; + + +class SampleApp: public Application + /// This sample demonstrates some of the features of the Util::Application class, + /// such as configuration file handling and command line arguments processing. + /// + /// Try SampleApp --help (on Unix platforms) or SampleApp /help (elsewhere) for + /// more information. +{ +public: + SampleApp(): _helpRequested(false) + { + } + +protected: + void initialize(Application& self) + { + loadConfiguration(); // load default configuration files, if present + Application::initialize(self); + // add your own initialization code here + } + + void uninitialize() + { + // add your own uninitialization code here + Application::uninitialize(); + } + + void reinitialize(Application& self) + { + Application::reinitialize(self); + // add your own reinitialization code here + } + + void defineOptions(OptionSet& options) + { + Application::defineOptions(options); + + options.addOption( + Option("help", "h", "display help information on command line arguments") + .required(false) + .repeatable(false) + .callback(OptionCallback(this, &SampleApp::handleHelp))); + + options.addOption( + Option("define", "D", "define a configuration property") + .required(false) + .repeatable(true) + .argument("name=value") + .callback(OptionCallback(this, &SampleApp::handleDefine))); + + options.addOption( + Option("config-file", "f", "load configuration data from a file") + .required(false) + .repeatable(true) + .argument("file") + .callback(OptionCallback(this, &SampleApp::handleConfig))); + + options.addOption( + Option("bind", "b", "bind option value to test.property") + .required(false) + .repeatable(false) + .argument("value") + .binding("test.property")); + } + + void handleHelp(const std::string& name, const std::string& value) + { + _helpRequested = true; + displayHelp(); + stopOptionsProcessing(); + } + + void handleDefine(const std::string& name, const std::string& value) + { + defineProperty(value); + } + + void handleConfig(const std::string& name, const std::string& value) + { + loadConfiguration(value); + } + + void displayHelp() + { + HelpFormatter helpFormatter(options()); + helpFormatter.setCommand(commandName()); + helpFormatter.setUsage("OPTIONS"); + helpFormatter.setHeader("A sample application that demonstrates some of the features of the Poco::Util::Application class."); + helpFormatter.format(std::cout); + } + + void defineProperty(const std::string& def) + { + std::string name; + std::string value; + std::string::size_type pos = def.find('='); + if (pos != std::string::npos) + { + name.assign(def, 0, pos); + value.assign(def, pos + 1, def.length() - pos); + } + else name = def; + config().setString(name, value); + } + + int main(const ArgVec& args) + { + if (!_helpRequested) + { + logger().information("Command line:"); + std::ostringstream ostr; + for (ArgVec::const_iterator it = argv().begin(); it != argv().end(); ++it) + { + ostr << *it << ' '; + } + logger().information(ostr.str()); + logger().information("Arguments to main():"); + for (ArgVec::const_iterator it = args.begin(); it != args.end(); ++it) + { + logger().information(*it); + } + logger().information("Application properties:"); + printProperties(""); + } + return Application::EXIT_OK; + } + + void printProperties(const std::string& base) + { + AbstractConfiguration::Keys keys; + config().keys(base, keys); + if (keys.empty()) + { + if (config().hasProperty(base)) + { + std::string msg; + msg.append(base); + msg.append(" = "); + msg.append(config().getString(base)); + logger().information(msg); + } + } + else + { + for (AbstractConfiguration::Keys::const_iterator it = keys.begin(); it != keys.end(); ++it) + { + std::string fullKey = base; + if (!fullKey.empty()) fullKey += '.'; + fullKey.append(*it); + printProperties(fullKey); + } + } + } + +private: + bool _helpRequested; +}; + + +POCO_APP_MAIN(SampleApp) diff --git a/recipes/poco/all/test_v1_package/CMakeLists.txt b/recipes/poco/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/poco/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/poco/all/test_v1_package/conanfile.py b/recipes/poco/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3bca6441d5a9a --- /dev/null +++ b/recipes/poco/all/test_v1_package/conanfile.py @@ -0,0 +1,30 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def _poco_option(self, name, default): + try: + return getattr(self.options["poco"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + cmake = CMake(self) + cmake.definitions["TEST_CRYPTO"] = self.options["poco"].enable_crypto + cmake.definitions["TEST_UTIL"] = self.options["poco"].enable_util + cmake.definitions["TEST_NET"] = self.options["poco"].enable_net + cmake.definitions["TEST_NETSSL"] = self._poco_option("enable_netssl", False) or self._poco_option("enable_netssl_win", False) + cmake.definitions["TEST_SQLITE"] = self.options["poco"].enable_data_sqlite + cmake.definitions["TEST_ENCODINGS"] = self._poco_option("enable_encodings", False) + cmake.definitions["TEST_JWT"] = self._poco_option("enable_jwt", False) + cmake.definitions["TEST_PROMETHEUS"] = self._poco_option("enable_prometheus", False) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/poco/config.yml b/recipes/poco/config.yml new file mode 100644 index 0000000000000..a8a61444c2607 --- /dev/null +++ b/recipes/poco/config.yml @@ -0,0 +1,29 @@ +versions: + "1.12.4": + folder: all + "1.12.3": + folder: all + "1.12.2": + folder: all + "1.12.1": + folder: all + "1.12.0": + folder: all + "1.11.3": + folder: all + "1.11.2": + folder: all + "1.11.1": + folder: all + "1.11.0": + folder: all + "1.10.1": + folder: all + "1.10.0": + folder: all + "1.9.3": + folder: all + "1.9.4": + folder: all + "1.8.1": + folder: all diff --git a/recipes/podofo/all/conandata.yml b/recipes/podofo/all/conandata.yml new file mode 100644 index 0000000000000..2735fdd5d425b --- /dev/null +++ b/recipes/podofo/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.9.7": + url: "https://netcologne.dl.sourceforge.net/project/podofo/podofo/0.9.7/podofo-0.9.7.tar.gz" + sha256: "7cf2e716daaef89647c54ffcd08940492fd40c385ef040ce7529396bfadc1eb8" + "0.9.6": + url: "https://netcologne.dl.sourceforge.net/project/podofo/podofo/0.9.6/podofo-0.9.6.tar.gz" + sha256: "e9163650955ab8e4b9532e7aa43b841bac45701f7b0f9b793a98c8ca3ef14072" +patches: + "0.9.7": + - patch_file: "patches/0001-fix-cmake-0.9.7.patch" + patch_description: "Link to conan libs and allow to build the tools without the tests and the examples" + patch_type: "conan" + "0.9.6": + - patch_file: "patches/0001-fix-cmake-0.9.6.patch" + patch_description: "Link to conan libs and allow to build the tools without the tests and the examples" + patch_type: "conan" diff --git a/recipes/podofo/all/conanfile.py b/recipes/podofo/all/conanfile.py new file mode 100644 index 0000000000000..5046d4d4b8974 --- /dev/null +++ b/recipes/podofo/all/conanfile.py @@ -0,0 +1,138 @@ +from conan import ConanFile +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class PodofoConan(ConanFile): + name = "podofo" + license = "GPL-3.0", "LGPL-3.0" + homepage = "http://podofo.sourceforge.net" + url = "https://github.com/conan-io/conan-center-index" + description = "PoDoFo is a library to work with the PDF file format." + topics = ("pdf") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threadsafe": [True, False], + "with_openssl": [True, False], + "with_libidn": [True, False], + "with_jpeg": [True, False], + "with_tiff": [True, False], + "with_png": [True, False], + "with_unistring": [True, False], + "with_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": True, + "with_openssl": True, + "with_libidn": True, + "with_jpeg": True, + "with_tiff": True, + "with_png": True, + "with_unistring": True, + "with_tools": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if is_msvc(self): + # libunistring recipe raises for Visual Studio + # TODO: Enable again when fixed? + self.options.with_unistring = 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): + self.requires("freetype/2.12.1") + self.requires("zlib/1.2.13") + if self.settings.os != "Windows": + self.requires("fontconfig/2.13.93") + if self.options.with_openssl: + self.requires("openssl/1.1.1s") + if self.options.with_libidn: + self.requires("libidn/1.36") + if self.options.with_jpeg: + self.requires("libjpeg/9e") + if self.options.with_tiff: + self.requires("libtiff/4.4.0") + if self.options.with_png: + self.requires("libpng/1.6.38") + if self.options.with_unistring: + self.requires("libunistring/0.9.10") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd") and Version(self.version) >= "0.9.7": + check_min_cppstd(self, 11) + + 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["PODOFO_BUILD_TOOLS"] = self.options.with_tools + tc.variables["PODOFO_BUILD_SHARED"] = self.options.shared + tc.variables["PODOFO_BUILD_STATIC"] = not self.options.shared + if not self.options.threadsafe: + tc.variables["PODOFO_NO_MULTITHREAD"] = True + if Version(self.version) >= "0.9.7" and not valid_min_cppstd(self, 11): + tc.cache_variables["CMAKE_CXX_STANDARD"] = 11 + + # To install relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + + # Custom CMake options injected in our patch, required to ensure reproducible builds + tc.variables["PODOFO_WITH_OPENSSL"] = self.options.with_openssl + tc.variables["PODOFO_WITH_LIBIDN"] = self.options.with_libidn + tc.variables["PODOFO_WITH_LIBJPEG"] = self.options.with_jpeg + tc.variables["PODOFO_WITH_TIFF"] = self.options.with_tiff + tc.variables["PODOFO_WITH_PNG"] = self.options.with_png + tc.variables["PODOFO_WITH_UNISTRING"] = self.options.with_unistring + tc.variables["PODOFO_HAVE_OPENSSL_1_1"] = Version(self.dependencies["openssl"].ref.version) >= "1.1" + if self.options.with_openssl and ("no_rc4" in self.dependencies["openssl"].options): + tc.variables["PODOFO_HAVE_OPENSSL_NO_RC4"] = self.dependencies["openssl"].options.no_rc4 + 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, "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")) + + def package_info(self): + podofo_version = Version(self.version) + pkg_config_name = f"libpodofo-{podofo_version.major}" if podofo_version < "0.9.7" else "libpodofo" + self.cpp_info.set_property("pkg_config_name", pkg_config_name) + self.cpp_info.libs = ["podofo"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("USING_SHARED_PODOFO") + if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch b/recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch new file mode 100644 index 0000000000000..5667931589e54 --- /dev/null +++ b/recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch @@ -0,0 +1,183 @@ +--- a/CMakeLists.txt 2018-07-08 12:33:27.000000000 +0200 ++++ b/CMakeLists.txt 2022-09-02 09:21:58.513547800 +0200 +@@ -37,7 +37,7 @@ + endif() + + # Load modules from our source tree too +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") ++LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + + + # Builds must use this CMakeLists.txt, not the one in src/ or somewhere else. +@@ -313,73 +313,55 @@ + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + + FIND_PACKAGE(ZLIB REQUIRED) ++LINK_LIBRARIES(ZLIB::ZLIB) + MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at ${ZLIB_LIBRARIES}") + +-FIND_PACKAGE(LIBCRYPTO) +- +-IF(LIBCRYPTO_FOUND) ++if(PODOFO_WITH_OPENSSL) ++ FIND_PACKAGE(OpenSSL REQUIRED) + SET(PODOFO_HAVE_OPENSSL TRUE) +- INCLUDE_DIRECTORIES(${LIBCRYPTO_INCLUDE_DIR}) +- MESSAGE("Found OpenSSL's libCrypto headers in ${LIBCRYPTO_INCLUDE_DIR}, library at ${LIBCRYPTO_LIBRARIES}") +-ELSE(LIBCRYPTO_FOUND) +- MESSAGE("OpenSSL's libCrypto not found. Encryption support will be disabled") +-ENDIF(LIBCRYPTO_FOUND) +- +-FIND_PACKAGE(LIBIDN) +- +-IF(LIBIDN_FOUND) +- MESSAGE("Found libidn headers in ${LIBIDN_INCLUDE_DIR}, library at ${LIBIDN_LIBRARIES}") +-ENDIF(LIBIDN_FOUND) ++ LINK_LIBRARIES(OpenSSL::SSL OpenSSL::Crypto) ++ INCLUDE(CheckCSourceCompiles) ++ ++ SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + +-IF(LIBIDN_FOUND) ++ UNSET(CMAKE_REQUIRED_INCLUDES) ++ UNSET(CMAKE_REQUIRED_LIBRARIES) ++ENDIF() ++ ++if(PODOFO_WITH_LIBIDN) ++ FIND_PACKAGE(LIBIDN) + SET(PODOFO_HAVE_LIBIDN TRUE) +- INCLUDE_DIRECTORIES(${LIBIDN_INCLUDE_DIR}) +- MESSAGE("Libidn found. AES-256 Encryption support will be enabled") +-ELSE(LIBIDN_FOUND) +- MESSAGE("Libidn not found. AES-256 Encryption support will be disabled") +-ENDIF(LIBIDN_FOUND) ++ LINK_LIBRARIES(libidn::libidn) ++ENDIF() + +-FIND_PACKAGE(LIBJPEG) + +-IF(LIBJPEG_FOUND) +- MESSAGE("Found libjpeg headers in ${LIBJPEG_INCLUDE_DIR}, library at ${LIBJPEG_LIBRARIES}") ++IF(PODOFO_WITH_LIBJPEG) ++ FIND_PACKAGE(JPEG REQUIRED) + SET(PODOFO_HAVE_JPEG_LIB TRUE) +- INCLUDE_DIRECTORIES(${LIBJPEG_INCLUDE_DIR}) +-ELSE(LIBJPEG_FOUND) +- MESSAGE("Libjpeg not found. JPEG support will be disabled") +-ENDIF(LIBJPEG_FOUND) ++ LINK_LIBRARIES(JPEG::JPEG) ++ENDIF() + +-FIND_PACKAGE(TIFF) + +-IF(TIFF_FOUND) +- MESSAGE("Found libtiff headers in ${TIFF_INCLUDE_DIR}, library at ${TIFF_LIBRARIES}") ++IF(PODOFO_WITH_TIFF) ++ FIND_PACKAGE(TIFF REQUIRED) + SET(PODOFO_HAVE_TIFF_LIB TRUE) +- INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) +-ELSE(TIFF_FOUND) +- MESSAGE("Libtiff not found. TIFF support will be disabled") +-ENDIF(TIFF_FOUND) ++ LINK_LIBRARIES(TIFF::TIFF) ++ENDIF() + +-FIND_PACKAGE(PNG) + +-IF(PNG_FOUND) +- MESSAGE("Found LibPng headers in ${PNG_INCLUDE_DIR}, library at ${PNG_LIBRARIES}") ++IF(PODOFO_WITH_PNG) ++ FIND_PACKAGE(PNG REQUIRED) + SET(PODOFO_HAVE_PNG_LIB TRUE) +- INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) +-ELSE(PNG_FOUND) +- MESSAGE("LibPng not found. PNG support will be disabled") +- SET(PNG_LIBRARIES "") +-ENDIF(PNG_FOUND) ++ LINK_LIBRARIES(PNG::PNG) ++ENDIF() + +-FIND_PACKAGE(UNISTRING) + +-IF(UNISTRING_FOUND) +- MESSAGE("Found LibUnistring headers in ${UNISTRING_INCLUDE_DIR}, library at ${UNISTRING_LIBRARY}") ++IF(PODOFO_WITH_UNISTRING) + SET(PODOFO_HAVE_UNISTRING_LIB TRUE) +- INCLUDE_DIRECTORIES(${UNISTRING_INCLUDE_DIR}) +-ELSE(UNISTRING_FOUND) +- MESSAGE("LibUnistring not found. Unistring support will be disabled") +- SET(UNISTRING_LIBRARY "") +-ENDIF(UNISTRING_FOUND) ++ FIND_PACKAGE(libunistring REQUIRED) ++ LINK_LIBRARIES(libunistring::libunistring) ++ENDIF() + + + IF(NOT PODOFO_BUILD_LIB_ONLY) +@@ -396,11 +378,11 @@ + + ENDIF(NOT PODOFO_BUILD_LIB_ONLY) + +-FIND_PACKAGE(OpenSSL) + +-FIND_PACKAGE(FREETYPE REQUIRED) +-MESSAGE("Found freetype library at ${FREETYPE_LIBRARIES}, headers ${FREETYPE_INCLUDE_DIR}") ++FIND_PACKAGE(Freetype REQUIRED MODULE) ++LINK_LIBRARIES(Freetype::Freetype) + ++if(0) + FIND_PACKAGE(LIBSTLPORT) + SET(stlport_libraries_if_use_stlport) + IF(USE_STLPORT) +@@ -415,16 +397,13 @@ + MESSAGE(FATAL_ERROR "STLPort use requested, but STLPort not found.") + ENDIF(LIBSTLPORT_FOUND) + ENDIF(USE_STLPORT) ++endif() + + IF(WANT_FONTCONFIG) +- FIND_PACKAGE(FONTCONFIG REQUIRED) ++ FIND_PACKAGE(Fontconfig REQUIRED) + SET(PODOFO_HAVE_FONTCONFIG TRUE) ++ LINK_LIBRARIES(Fontconfig::Fontconfig) + SET(PODOFO_LIB_FONTCONFIG:STRING fontconfig) +- IF(FONTCONFIG_FOUND) +- MESSAGE("Found fontconfig headers in ${FONTCONFIG_INCLUDE_DIR}, library at ${FONTCONFIG_LIBRARIES}") +- ELSE(FONTCONFIG_FOUND) +- MESSAGE("Could not find fontconfig.") +- ENDIF(FONTCONFIG_FOUND) + ELSE(WANT_FONTCONFIG) + # Might as well look for it anyway. This also sets the appropriate + # variables to empty values. +@@ -516,6 +495,7 @@ + INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR}) + ENDIF(FONTCONFIG_FOUND AND WANT_FONTCONFIG) + ++LINK_DIRECTORIES(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + IF(WIN32 OR PODOFO_BUILD_STATIC) + SET(PODOFO_LIB + podofo +@@ -546,10 +526,18 @@ + + ADD_SUBDIRECTORY(src) + IF(NOT PODOFO_BUILD_LIB_ONLY) +-ADD_SUBDIRECTORY(test) +-ADD_SUBDIRECTORY(tools) +-ADD_SUBDIRECTORY(examples) +-ADD_SUBDIRECTORY(man) ++IF(PODOFO_BUILD_TEST) ++ ADD_SUBDIRECTORY(test) ++ENDIF(PODOFO_BUILD_TEST) ++IF(PODOFO_BUILD_TOOLS) ++ ADD_SUBDIRECTORY(tools) ++ENDIF(PODOFO_BUILD_TOOLS) ++IF(PODOFO_BUILD_EXAMPLES) ++ ADD_SUBDIRECTORY(examples) ++ENDIF(PODOFO_BUILD_EXAMPLES) ++IF(PODOFO_BUILD_MAN) ++ ADD_SUBDIRECTORY(man) ++ENDIF(PODOFO_BUILD_MAN) + ENDIF(NOT PODOFO_BUILD_LIB_ONLY) + + # Generate our configure file diff --git a/recipes/podofo/all/patches/0001-fix-cmake-0.9.7.patch b/recipes/podofo/all/patches/0001-fix-cmake-0.9.7.patch new file mode 100644 index 0000000000000..043b4089a12c7 --- /dev/null +++ b/recipes/podofo/all/patches/0001-fix-cmake-0.9.7.patch @@ -0,0 +1,183 @@ +--- a/CMakeLists.txt 2021-01-05 17:56:54.000000000 +0100 ++++ b/CMakeLists.txt 2022-09-02 09:31:40.383547800 +0200 +@@ -38,7 +38,7 @@ + endif() + + # Load modules from our source tree too +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") ++LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + + + # Builds must use this CMakeLists.txt, not the one in src/ or somewhere else. +@@ -322,73 +322,55 @@ + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + + FIND_PACKAGE(ZLIB REQUIRED) ++LINK_LIBRARIES(ZLIB::ZLIB) + MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at ${ZLIB_LIBRARIES}") + +-FIND_PACKAGE(LIBCRYPTO) +- +-IF(LIBCRYPTO_FOUND) ++if(PODOFO_WITH_OPENSSL) ++ FIND_PACKAGE(OpenSSL REQUIRED) + SET(PODOFO_HAVE_OPENSSL TRUE) +- INCLUDE_DIRECTORIES(${LIBCRYPTO_INCLUDE_DIR}) +- MESSAGE("Found OpenSSL's libCrypto headers in ${LIBCRYPTO_INCLUDE_DIR}, library at ${LIBCRYPTO_LIBRARIES}") +-ELSE(LIBCRYPTO_FOUND) +- MESSAGE("OpenSSL's libCrypto not found. Encryption support will be disabled") +-ENDIF(LIBCRYPTO_FOUND) +- +-FIND_PACKAGE(LIBIDN) +- +-IF(LIBIDN_FOUND) +- MESSAGE("Found libidn headers in ${LIBIDN_INCLUDE_DIR}, library at ${LIBIDN_LIBRARIES}") +-ENDIF(LIBIDN_FOUND) ++ LINK_LIBRARIES(OpenSSL::SSL OpenSSL::Crypto) ++ INCLUDE(CheckCSourceCompiles) ++ ++ SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + +-IF(LIBIDN_FOUND) ++ UNSET(CMAKE_REQUIRED_INCLUDES) ++ UNSET(CMAKE_REQUIRED_LIBRARIES) ++ENDIF() ++ ++if(PODOFO_WITH_LIBIDN) ++ FIND_PACKAGE(LIBIDN) + SET(PODOFO_HAVE_LIBIDN TRUE) +- INCLUDE_DIRECTORIES(${LIBIDN_INCLUDE_DIR}) +- MESSAGE("Libidn found. AES-256 Encryption support will be enabled") +-ELSE(LIBIDN_FOUND) +- MESSAGE("Libidn not found. AES-256 Encryption support will be disabled") +-ENDIF(LIBIDN_FOUND) ++ LINK_LIBRARIES(libidn::libidn) ++ENDIF() + +-FIND_PACKAGE(LIBJPEG) + +-IF(LIBJPEG_FOUND) +- MESSAGE("Found libjpeg headers in ${LIBJPEG_INCLUDE_DIR}, library at ${LIBJPEG_LIBRARIES}") ++IF(PODOFO_WITH_LIBJPEG) ++ FIND_PACKAGE(JPEG REQUIRED) + SET(PODOFO_HAVE_JPEG_LIB TRUE) +- INCLUDE_DIRECTORIES(${LIBJPEG_INCLUDE_DIR}) +-ELSE(LIBJPEG_FOUND) +- MESSAGE("Libjpeg not found. JPEG support will be disabled") +-ENDIF(LIBJPEG_FOUND) ++ LINK_LIBRARIES(JPEG::JPEG) ++ENDIF() + +-FIND_PACKAGE(TIFF) + +-IF(TIFF_FOUND) +- MESSAGE("Found libtiff headers in ${TIFF_INCLUDE_DIR}, library at ${TIFF_LIBRARIES}") ++IF(PODOFO_WITH_TIFF) ++ FIND_PACKAGE(TIFF REQUIRED) + SET(PODOFO_HAVE_TIFF_LIB TRUE) +- INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) +-ELSE(TIFF_FOUND) +- MESSAGE("Libtiff not found. TIFF support will be disabled") +-ENDIF(TIFF_FOUND) ++ LINK_LIBRARIES(TIFF::TIFF) ++ENDIF() + +-FIND_PACKAGE(PNG) + +-IF(PNG_FOUND) +- MESSAGE("Found LibPng headers in ${PNG_INCLUDE_DIR}, library at ${PNG_LIBRARIES}") ++IF(PODOFO_WITH_PNG) ++ FIND_PACKAGE(PNG REQUIRED) + SET(PODOFO_HAVE_PNG_LIB TRUE) +- INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) +-ELSE(PNG_FOUND) +- MESSAGE("LibPng not found. PNG support will be disabled") +- SET(PNG_LIBRARIES "") +-ENDIF(PNG_FOUND) ++ LINK_LIBRARIES(PNG::PNG) ++ENDIF() + +-FIND_PACKAGE(UNISTRING) + +-IF(UNISTRING_FOUND) +- MESSAGE("Found LibUnistring headers in ${UNISTRING_INCLUDE_DIR}, library at ${UNISTRING_LIBRARY}") ++IF(PODOFO_WITH_UNISTRING) + SET(PODOFO_HAVE_UNISTRING_LIB TRUE) +- INCLUDE_DIRECTORIES(${UNISTRING_INCLUDE_DIR}) +-ELSE(UNISTRING_FOUND) +- MESSAGE("LibUnistring not found. Unistring support will be disabled") +- SET(UNISTRING_LIBRARY "") +-ENDIF(UNISTRING_FOUND) ++ FIND_PACKAGE(libunistring REQUIRED) ++ LINK_LIBRARIES(libunistring::libunistring) ++ENDIF() + + + IF(NOT PODOFO_BUILD_LIB_ONLY) +@@ -405,11 +387,11 @@ + + ENDIF(NOT PODOFO_BUILD_LIB_ONLY) + +-FIND_PACKAGE(OpenSSL) + +-FIND_PACKAGE(FREETYPE REQUIRED) +-MESSAGE("Found freetype library at ${FREETYPE_LIBRARIES}, headers ${FREETYPE_INCLUDE_DIR}") ++FIND_PACKAGE(Freetype REQUIRED MODULE) ++LINK_LIBRARIES(Freetype::Freetype) + ++if(0) + FIND_PACKAGE(LIBSTLPORT) + SET(stlport_libraries_if_use_stlport) + IF(USE_STLPORT) +@@ -424,16 +406,13 @@ + MESSAGE(FATAL_ERROR "STLPort use requested, but STLPort not found.") + ENDIF(LIBSTLPORT_FOUND) + ENDIF(USE_STLPORT) ++endif() + + IF(WANT_FONTCONFIG) +- FIND_PACKAGE(FONTCONFIG REQUIRED) ++ FIND_PACKAGE(Fontconfig REQUIRED) + SET(PODOFO_HAVE_FONTCONFIG TRUE) ++ LINK_LIBRARIES(Fontconfig::Fontconfig) + SET(PODOFO_LIB_FONTCONFIG:STRING fontconfig) +- IF(FONTCONFIG_FOUND) +- MESSAGE("Found fontconfig headers in ${FONTCONFIG_INCLUDE_DIR}, library at ${FONTCONFIG_LIBRARIES}") +- ELSE(FONTCONFIG_FOUND) +- MESSAGE("Could not find fontconfig.") +- ENDIF(FONTCONFIG_FOUND) + ELSE(WANT_FONTCONFIG) + # Might as well look for it anyway. This also sets the appropriate + # variables to empty values. +@@ -525,6 +504,7 @@ + INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR}) + ENDIF(FONTCONFIG_FOUND AND WANT_FONTCONFIG) + ++LINK_DIRECTORIES(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + IF(WIN32 OR PODOFO_BUILD_STATIC) + SET(PODOFO_LIB + podofo +@@ -555,10 +535,18 @@ + + ADD_SUBDIRECTORY(src/podofo) + IF(NOT PODOFO_BUILD_LIB_ONLY) +-ADD_SUBDIRECTORY(test) +-ADD_SUBDIRECTORY(tools) +-ADD_SUBDIRECTORY(examples) +-ADD_SUBDIRECTORY(man) ++IF(PODOFO_BUILD_TEST) ++ ADD_SUBDIRECTORY(test) ++ENDIF(PODOFO_BUILD_TEST) ++IF(PODOFO_BUILD_TOOLS) ++ ADD_SUBDIRECTORY(tools) ++ENDIF(PODOFO_BUILD_TOOLS) ++IF(PODOFO_BUILD_EXAMPLES) ++ ADD_SUBDIRECTORY(examples) ++ENDIF(PODOFO_BUILD_EXAMPLES) ++IF(PODOFO_BUILD_MAN) ++ ADD_SUBDIRECTORY(man) ++ENDIF(PODOFO_BUILD_MAN) + ENDIF(NOT PODOFO_BUILD_LIB_ONLY) + + # Generate our configure file diff --git a/recipes/podofo/all/test_package/CMakeLists.txt b/recipes/podofo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..447fbc933a4fb --- /dev/null +++ b/recipes/podofo/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(podofo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE podofo::podofo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/podofo/all/test_package/conanfile.py b/recipes/podofo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/podofo/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/podofo/all/test_package/test_package.cpp b/recipes/podofo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5d5ed07c8e7c2 --- /dev/null +++ b/recipes/podofo/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + + PoDoFo::PdfPainter painter; + PoDoFo::PdfEncrypt::GetEnabledEncryptionAlgorithms(); + + return 0; +} diff --git a/recipes/podofo/all/test_v1_package/CMakeLists.txt b/recipes/podofo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/podofo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/podofo/all/test_v1_package/conanfile.py b/recipes/podofo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/podofo/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/podofo/config.yml b/recipes/podofo/config.yml new file mode 100644 index 0000000000000..ca2128b57488a --- /dev/null +++ b/recipes/podofo/config.yml @@ -0,0 +1,5 @@ +versions: + "0.9.7": + folder: all + "0.9.6": + folder: all diff --git a/recipes/poly2tri/all/CMakeLists.txt b/recipes/poly2tri/all/CMakeLists.txt new file mode 100644 index 0000000000000..584d7ebc98cae --- /dev/null +++ b/recipes/poly2tri/all/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.4) +project(poly2tri LANGUAGES CXX) + +include(GNUInstallDirs) + +add_library(poly2tri + ${POLY2TRI_SRC_DIR}/common/shapes.cc + ${POLY2TRI_SRC_DIR}/sweep/advancing_front.cc + ${POLY2TRI_SRC_DIR}/sweep/cdt.cc + ${POLY2TRI_SRC_DIR}/sweep/sweep.cc + ${POLY2TRI_SRC_DIR}/sweep/sweep_context.cc +) + +if(MSVC AND BUILD_SHARED_LIBS) + set_property(TARGET poly2tri PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +install( + TARGETS poly2tri + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install( + DIRECTORY ${POLY2TRI_SRC_DIR} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h" +) diff --git a/recipes/poly2tri/all/conandata.yml b/recipes/poly2tri/all/conandata.yml new file mode 100644 index 0000000000000..ec9f1ad3199da --- /dev/null +++ b/recipes/poly2tri/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20130502": + url: "https://github.com/greenm01/poly2tri/archive/88de49021b6d9bef6faa1bc94ceb3fbd85c3c204.zip" + sha256: "2bd25eb2b8f467382c5bc3384c8c62ab3e6c10de26be8019aa94d93f7b65806d" diff --git a/recipes/poly2tri/all/conanfile.py b/recipes/poly2tri/all/conanfile.py new file mode 100644 index 0000000000000..d43ae54e6e9c6 --- /dev/null +++ b/recipes/poly2tri/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class Poly2triConan(ConanFile): + name = "poly2tri" + description = "Poly2Tri is a sweepline constrained Delaunay Polygon Triangulation Library." + license = "BSD-3-Clause" + topics = ("triangulation", "delaunay", "polygon") + homepage = "https://github.com/greenm01/poly2tri" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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["POLY2TRI_SRC_DIR"] = os.path.join(self.source_folder, "poly2tri").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 = ["poly2tri"] diff --git a/recipes/poly2tri/all/test_package/CMakeLists.txt b/recipes/poly2tri/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..091cd7218487c --- /dev/null +++ b/recipes/poly2tri/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(poly2tri REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE poly2tri::poly2tri) diff --git a/recipes/poly2tri/all/test_package/conanfile.py b/recipes/poly2tri/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/poly2tri/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/poly2tri/all/test_package/test_package.cpp b/recipes/poly2tri/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7b99d3ce05a09 --- /dev/null +++ b/recipes/poly2tri/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +int main() { + p2t::Point p1(0.0, 0.0); + p2t::Point p2(1.0, 0.0); + p2t::Point p3(0.0, 1.0); + + p2t::Triangle triangle(p1, p2, p3); + + return 0; +} diff --git a/recipes/poly2tri/all/test_v1_package/CMakeLists.txt b/recipes/poly2tri/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/poly2tri/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/poly2tri/all/test_v1_package/conanfile.py b/recipes/poly2tri/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/poly2tri/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/poly2tri/config.yml b/recipes/poly2tri/config.yml new file mode 100644 index 0000000000000..03b3ef27a365d --- /dev/null +++ b/recipes/poly2tri/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20130502": + folder: all diff --git a/recipes/polylabel/all/conandata.yml b/recipes/polylabel/all/conandata.yml new file mode 100644 index 0000000000000..efb6a522362e3 --- /dev/null +++ b/recipes/polylabel/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "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 new file mode 100644 index 0000000000000..402d5fbafc219 --- /dev/null +++ b/recipes/polylabel/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +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" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("mapbox-geometry/2.0.3", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/polylabel/all/test_package/CMakeLists.txt b/recipes/polylabel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..90669593bc3f0 --- /dev/null +++ b/recipes/polylabel/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(polylabel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} 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/all/test_package/conanfile.py b/recipes/polylabel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/polylabel/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/polylabel/all/test_package/test_package.cpp b/recipes/polylabel/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b6eac4b929142 --- /dev/null +++ b/recipes/polylabel/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() { + mapbox::geometry::linear_ring ring{ + mapbox::geometry::point(0.0, 0.0), + mapbox::geometry::point(210.0, 50.7), + mapbox::geometry::point(-70.3, -40.9), + }; + mapbox::geometry::polygon polygon; + polygon.push_back(ring); + mapbox::geometry::point p = mapbox::polylabel(polygon, 1.0); + std::cout << "x: " << p.x << " y: " << p.y << std::endl; + return 0; +} diff --git a/recipes/polylabel/all/test_v1_package/CMakeLists.txt b/recipes/polylabel/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c0d215f97b42 --- /dev/null +++ b/recipes/polylabel/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +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/all/test_v1_package/conanfile.py b/recipes/polylabel/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/polylabel/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/polylabel/config.yml b/recipes/polylabel/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/polylabel/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/polylineencoder/all/conandata.yml b/recipes/polylineencoder/all/conandata.yml new file mode 100644 index 0000000000000..f829af8f47167 --- /dev/null +++ b/recipes/polylineencoder/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.1.2": + url: "https://github.com/vahancho/polylineencoder/archive/v1.1.2.zip" + sha256: "fed2eb5cfc747c9aa98a8399d0536ddb52035f8dc9bcb53d9c5404ec2d57bac1" + "1.0.0": + url: "https://github.com/vahancho/polylineencoder/archive/1.0.0.zip" + sha256: "1e02cff3f65bac68ffeca2651fca829c8b2e0d6f674ebe074bc6b9706d71a91b" +patches: + "1.1.2": + - patch_file: "patches/1.1.2/0001-cmake.patch" + - patch_file: "patches/1.1.2/0002-backward-compatibility.patch" + "1.0.0": + - patch_file: "patches/1.0.0/0001-cmake-target-name.patch" + - patch_file: "patches/1.0.0/0002-include-limits.patch" + - patch_file: "patches/1.0.0/0003-cmake-install.patch" diff --git a/recipes/polylineencoder/all/conanfile.py b/recipes/polylineencoder/all/conanfile.py new file mode 100644 index 0000000000000..679878a309f30 --- /dev/null +++ b/recipes/polylineencoder/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class PolylineencoderConan(ConanFile): + name = "polylineencoder" + description = "Google Encoded Polyline Algorithm Format library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vahancho/polylineencoder" + topics = ("gepaf", "encoded-polyline", "google-polyline") + 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") + if Version(self.version) >= "1.1.1": + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if Version(self.version) >= "1.1.1": + self.info.clear() + + 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = "ON" + 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): + if Version(self.version) < "1.1.1": + self.cpp_info.libs = ["polylineencoder"] + if self.settings.os in ["Linux", "FreeBSD"] and self.options.shared: + self.cpp_info.system_libs.append("m") + else: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/polylineencoder/all/patches/1.0.0/0001-cmake-target-name.patch b/recipes/polylineencoder/all/patches/1.0.0/0001-cmake-target-name.patch new file mode 100644 index 0000000000000..90008a516bb66 --- /dev/null +++ b/recipes/polylineencoder/all/patches/1.0.0/0001-cmake-target-name.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 04a1541..2963045 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.12) + project(polylineencoder) + set (CMAKE_CXX_STANDARD 11) + +-add_library(encoder ++add_library(polylineencoder + src/polylineencoder.h + src/polylineencoder.cpp + ) +@@ -13,7 +13,7 @@ add_executable(poly_test + ) + + target_link_libraries(poly_test +- PRIVATE encoder ++ PRIVATE polylineencoder + ) + + enable_testing() diff --git a/recipes/polylineencoder/all/patches/1.0.0/0002-include-limits.patch b/recipes/polylineencoder/all/patches/1.0.0/0002-include-limits.patch new file mode 100644 index 0000000000000..8c1ab930f5913 --- /dev/null +++ b/recipes/polylineencoder/all/patches/1.0.0/0002-include-limits.patch @@ -0,0 +1,12 @@ +diff --git a/src/polylineencoder.cpp b/src/polylineencoder.cpp +index 202bc65..4e1f7c5 100644 +--- a/src/polylineencoder.cpp ++++ b/src/polylineencoder.cpp +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "polylineencoder.h" + diff --git a/recipes/polylineencoder/all/patches/1.0.0/0003-cmake-install.patch b/recipes/polylineencoder/all/patches/1.0.0/0003-cmake-install.patch new file mode 100644 index 0000000000000..086e01577a764 --- /dev/null +++ b/recipes/polylineencoder/all/patches/1.0.0/0003-cmake-install.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2963045..197c813 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ add_library(polylineencoder + src/polylineencoder.cpp + ) + ++if (BUILD_TESTING) + add_executable(poly_test + test/main.cpp + ) +@@ -18,3 +19,11 @@ target_link_libraries(poly_test + + enable_testing() + add_test(NAME Test COMMAND poly_test) ++endif() ++ ++install(TARGETS polylineencoder ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++install(DIRECTORY src/ DESTINATION include ++ FILES_MATCHING PATTERN "*.h") diff --git a/recipes/polylineencoder/all/patches/1.1.2/0001-cmake.patch b/recipes/polylineencoder/all/patches/1.1.2/0001-cmake.patch new file mode 100644 index 0000000000000..b7968a273a2ef --- /dev/null +++ b/recipes/polylineencoder/all/patches/1.1.2/0001-cmake.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ce59bf2..5dea7fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,41 +3,4 @@ cmake_minimum_required(VERSION 3.9) + project(polylineencoder) + set (CMAKE_CXX_STANDARD 11) + +-add_executable(poly_test +- test/main.cpp +- src/polylineencoder.h +-) +- +-# Includes +-target_include_directories(poly_test PRIVATE src) +- +-enable_testing() +- +-find_package(GTest CONFIG REQUIRED) +-target_link_libraries(poly_test PRIVATE GTest::gtest) +- +-add_test(NAME Test COMMAND poly_test) +- +-# Copy GTest libraries to the target directory. +-add_custom_command( +- TARGET poly_test POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy_if_different +- $ +- $ +-) +- +-# Coverage support. +-option(CODE_COVERAGE "Enable coverage reporting" ON) +-if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") +- # Add required flags (GCC & LLVM/Clang) +- target_compile_options(poly_test PUBLIC +- -O0 # no optimization +- -g # generate debug info +- --coverage # sets all required flags +- ) +- if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) +- target_link_options(poly_test PUBLIC --coverage) +- else() +- target_link_libraries(poly_test PUBLIC --coverage) +- endif() +-endif() ++install(DIRECTORY src/ DESTINATION include FILES_MATCHING PATTERN "*.h") diff --git a/recipes/polylineencoder/all/patches/1.1.2/0002-backward-compatibility.patch b/recipes/polylineencoder/all/patches/1.1.2/0002-backward-compatibility.patch new file mode 100644 index 0000000000000..4dd2ba71bc4c1 --- /dev/null +++ b/recipes/polylineencoder/all/patches/1.1.2/0002-backward-compatibility.patch @@ -0,0 +1,24 @@ +diff --git a/src/polylineencoder.h b/src/polylineencoder.h +index 7a05c95..55adc6d 100644 +--- a/src/polylineencoder.h ++++ b/src/polylineencoder.h +@@ -32,7 +32,7 @@ + #include + #include + +-namespace gepaf ++namespace gepaf2 + { + + //! Implements Google's Encoded Polyline Algorithm Format +@@ -306,5 +306,10 @@ void PolylineEncoder::clear() + + } // namespace + ++namespace gepaf ++{ ++ using PolylineEncoder = gepaf2::PolylineEncoder<5>; ++} ++ + #endif // POLYLINEENCODER_H + diff --git a/recipes/polylineencoder/all/test_package/CMakeLists.txt b/recipes/polylineencoder/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..55b8c21b9d7cb --- /dev/null +++ b/recipes/polylineencoder/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(polylineencoder REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE polylineencoder::polylineencoder) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/polylineencoder/all/test_package/conanfile.py b/recipes/polylineencoder/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/polylineencoder/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/polylineencoder/all/test_package/test_package.cpp b/recipes/polylineencoder/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..50ecddd28a38f --- /dev/null +++ b/recipes/polylineencoder/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include "polylineencoder.h" + +int main(void) +{ + gepaf::PolylineEncoder encoder; + + // Poles and equator. + encoder.addPoint(-90.0, -180.0); + encoder.addPoint(.0, .0); + encoder.addPoint(90.0, 180.0); + + auto res = encoder.encode(); // "~bidP~fsia@_cidP_gsia@_cidP_gsia@" + encoder.clear(); // Clear the list of points. + + // Decode a string using static function. + auto polyline = gepaf::PolylineEncoder::decode("~bidP~fsia@_cidP_gsia@_cidP_gsia@"); + + // Iterate over all points and print coordinates of each. + for (const auto& point : polyline) { + printf("(%f, %f)\n", point.latitude(), point.longitude()); + } + return 0; +} diff --git a/recipes/polylineencoder/all/test_v1_package/CMakeLists.txt b/recipes/polylineencoder/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/polylineencoder/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/polylineencoder/all/test_v1_package/conanfile.py b/recipes/polylineencoder/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/polylineencoder/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/polylineencoder/config.yml b/recipes/polylineencoder/config.yml new file mode 100644 index 0000000000000..5741c8d1666f8 --- /dev/null +++ b/recipes/polylineencoder/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.2": + folder: all + "1.0.0": + folder: all diff --git a/recipes/polymorphic_value/all/conandata.yml b/recipes/polymorphic_value/all/conandata.yml new file mode 100644 index 0000000000000..3c6cac8097e97 --- /dev/null +++ b/recipes/polymorphic_value/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.0": + url: https://github.com/jbcoe/polymorphic_value/archive/refs/tags/v1.3.0.tar.gz + sha256: 61ce07d1b76b1409ceaa34dc88f2c5dc8c4c51c0c62387b97857f5b7eef7382e diff --git a/recipes/polymorphic_value/all/conanfile.py b/recipes/polymorphic_value/all/conanfile.py new file mode 100644 index 0000000000000..a500ed7dae408 --- /dev/null +++ b/recipes/polymorphic_value/all/conanfile.py @@ -0,0 +1,75 @@ +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.50.0" + + +class PolymorphictValueConan(ConanFile): + name = "polymorphic_value" + homepage = "https://github.com/jbcoe/polymorphic_value" + description = "Production-quality reference implementation of P0201r2: A polymorphic value-type for C++" + topics = ("std", "vocabulary-type", "value-semantics") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "8", + "apple-clang": "11" + } + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + 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.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)) + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "polymorphic_value.*", self.source_folder, + os.path.join(self.package_folder, "include")) + copy(self, "*LICENSE*", self.source_folder, + os.path.join(self.package_folder, "licenses"), keep_path=False) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "polymorphic_value") + self.cpp_info.set_property( + "cmake_target_name", "polymorphic_value::polymorphic_value") + + self.cpp_info.names["cmake_find_package"] = "polymorphic_value" + self.cpp_info.names["cmake_find_package_multi"] = "polymorphic_value" diff --git a/recipes/polymorphic_value/all/test_package/CMakeLists.txt b/recipes/polymorphic_value/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6cc8838b8f43 --- /dev/null +++ b/recipes/polymorphic_value/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +find_package(polymorphic_value REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE polymorphic_value::polymorphic_value) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/recipes/polymorphic_value/all/test_package/conanfile.py b/recipes/polymorphic_value/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e418ee7701960 --- /dev/null +++ b/recipes/polymorphic_value/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 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/polymorphic_value/all/test_package/test_package.cpp b/recipes/polymorphic_value/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dd22dabd286d9 --- /dev/null +++ b/recipes/polymorphic_value/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +using namespace isocpp_p0201; + +struct BaseType { + virtual int getValue() const = 0; + virtual ~BaseType() = default; +}; + +struct DerivedType : BaseType { + int value = EXIT_SUCCESS; + int getValue() const override { return value; } +}; + +int main() +{ + polymorphic_value result{new DerivedType()}; + return result->getValue(); +} diff --git a/recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt b/recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8e2bfa718d864 --- /dev/null +++ b/recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(polymorphic_value REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE polymorphic_value::polymorphic_value) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/recipes/polymorphic_value/all/test_v1_package/conanfile.py b/recipes/polymorphic_value/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fa6afacf5620e --- /dev/null +++ b/recipes/polymorphic_value/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +import os + +from conan.tools.build import cross_building +from conans import CMake, ConanFile + + +# 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/polymorphic_value/config.yml b/recipes/polymorphic_value/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/polymorphic_value/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/poppler-data/all/conandata.yml b/recipes/poppler-data/all/conandata.yml new file mode 100644 index 0000000000000..77bee83d512e5 --- /dev/null +++ b/recipes/poppler-data/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "0.4.11": + url: "https://poppler.freedesktop.org/poppler-data-0.4.11.tar.gz" + sha256: "2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c" + "0.4.10": + url: "https://poppler.freedesktop.org/poppler-data-0.4.10.tar.gz" + sha256: "6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30" + "0.4.9": + url: "https://poppler.freedesktop.org/poppler-data-0.4.9.tar.gz" + sha256: "1f9c7e7de9ecd0db6ab287349e31bf815ca108a5a175cf906a90163bdbe32012" +patches: + "0.4.11": + - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" + "0.4.10": + - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" + "0.4.9": + - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" diff --git a/recipes/poppler-data/all/conanfile.py b/recipes/poppler-data/all/conanfile.py new file mode 100644 index 0000000000000..e414a6fa6dc4b --- /dev/null +++ b/recipes/poppler-data/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.52.0" + + +class PopplerDataConan(ConanFile): + name = "poppler-data" + description = "encoding files for use with poppler, enable CJK and Cyrrilic" + homepage = "https://poppler.freedesktop.org/" + topics = "poppler", "pdf", "rendering" + license = "BSD-3-Clause", "GPL-2.0-or-later", "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_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) + + @property + def _datadir(self): + return os.path.join(self.package_folder, "res") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["datadir"] = self._datadir.replace("\\", "/") + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self._datadir, "pkgconfig")) + + @property + def _poppler_datadir(self): + return os.path.join(self._datadir, "poppler") + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "poppler-data") + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] + self.cpp_info.defines = ["POPPLER_DATADIR={}".format(self._poppler_datadir.replace("\\", "//"))] + self.conf_info.define("user.poppler-data:datadir", self._poppler_datadir) + + # TODO: to remove in conan v2 + self.user_info.datadir = self._poppler_datadir diff --git a/recipes/poppler-data/all/patches/0001-cmake-use-GNUInstallDirs.patch b/recipes/poppler-data/all/patches/0001-cmake-use-GNUInstallDirs.patch new file mode 100644 index 0000000000000..6f02f01c47eb5 --- /dev/null +++ b/recipes/poppler-data/all/patches/0001-cmake-use-GNUInstallDirs.patch @@ -0,0 +1,7 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -6,1 +6,3 @@ +-set(datadir ${CMAKE_INSTALL_PREFIX}/share) ++if(NOT datadir) ++ set(datadir ${CMAKE_INSTALL_PREFIX}/share) ++endif() diff --git a/recipes/poppler-data/all/test_package/conanfile.py b/recipes/poppler-data/all/test_package/conanfile.py new file mode 100644 index 0000000000000..87a69bb15fafe --- /dev/null +++ b/recipes/poppler-data/all/test_package/conanfile.py @@ -0,0 +1,14 @@ +from conan import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if not os.path.isdir(self.conf.get("user.poppler-data:datadir", check_type=str)): + raise AssertionError("datadir is not a directory") diff --git a/recipes/poppler-data/all/test_v1_package/conanfile.py b/recipes/poppler-data/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8a2bb2447ea7b --- /dev/null +++ b/recipes/poppler-data/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not os.path.isdir(self.deps_user_info["poppler-data"].datadir): + raise AssertionError("datadir is not a directory") diff --git a/recipes/poppler-data/config.yml b/recipes/poppler-data/config.yml new file mode 100644 index 0000000000000..90c1e0e0b3910 --- /dev/null +++ b/recipes/poppler-data/config.yml @@ -0,0 +1,7 @@ +versions: + "0.4.11": + folder: all + "0.4.10": + folder: all + "0.4.9": + folder: all diff --git a/recipes/poppler/all/CMakeLists.txt b/recipes/poppler/all/CMakeLists.txt new file mode 100644 index 0000000000000..39855e44c30cd --- /dev/null +++ b/recipes/poppler/all/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(BUILD_SHARED_LIBS) + if(MSVC) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif() +else() + add_definitions(-DPOPPLER_STATIC) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/poppler/all/conandata.yml b/recipes/poppler/all/conandata.yml new file mode 100644 index 0000000000000..f7e3961db56f3 --- /dev/null +++ b/recipes/poppler/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "20.09.0": + url: "https://poppler.freedesktop.org/poppler-20.09.0.tar.xz" + sha256: "4ed6eb5ddc4c37f2435c9d78ff9c7c4036455aea3507d1ce8400070aab745363" + "21.07.0": + url: "https://poppler.freedesktop.org/poppler-21.07.0.tar.xz" + sha256: "e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4" +patches: + "20.09.0": + - patch_file: "patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch" + base_path: "source_subfolder" + - patch_file: "patches/20/0002-cmake-use_CONAN_PKG-targets.patch" + base_path: "source_subfolder" + - patch_file: "patches/20/0003-cmake-disable-tests.patch" + base_path: "source_subfolder" + - patch_file: "patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch" + base_path: "source_subfolder" + - patch_file: "patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch" + base_path: "source_subfolder" + - patch_file: "patches/20/0006-missing-symbol-dll-windows.patch" + base_path: "source_subfolder" + - patch_file: "patches/20/0007-cmake-use_conan_qt.patch" + base_path: "source_subfolder" + "21.07.0": + - patch_file: "patches/21/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch" + base_path: "source_subfolder" + - patch_file: "patches/21/0002-cmake-use_CONAN_PKG-targets.patch" + base_path: "source_subfolder" + - patch_file: "patches/21/0004-add-POPPLER_DATADIR-environment-variable.patch" + base_path: "source_subfolder" + - patch_file: "patches/21/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch" + base_path: "source_subfolder" + - patch_file: "patches/21/0007-cmake-use_conan_qt.patch" + base_path: "source_subfolder" diff --git a/recipes/poppler/all/conanfile.py b/recipes/poppler/all/conanfile.py new file mode 100644 index 0000000000000..b7d61c3e69e7e --- /dev/null +++ b/recipes/poppler/all/conanfile.py @@ -0,0 +1,322 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PopplerConan(ConanFile): + name = "poppler" + description = "Poppler is a PDF rendering library based on the xpdf-3.0 code base" + homepage = "https://poppler.freedesktop.org/" + topics = ("conan", "poppler", "pdf", "rendering") + license = "GPL-2.0-or-later", "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cpp": [True, False], + "fontconfiguration": ["generic", "fontconfig", "win32"], + "splash": [True, False], + "float": [True, False], + "with_cairo": [True, False], + "with_glib": [True, False], + "with_gobject_introspection": [True, False], + "with_qt": [True, False], + "with_gtk": [True, False], + "with_libiconv": [True, False], + "with_openjpeg": [True, False], + "with_lcms": [True, False], + "with_libjpeg": ["libjpeg", False], + "with_png": [True, False], + "with_nss": [True, False], + "with_tiff": [True, False], + "with_libcurl": [True, False], + "with_zlib": [True, False], + + } + default_options = { + "shared": False, + "fPIC": True, + "cpp": True, + "fontconfiguration": "generic", + "with_cairo": False, + "splash": True, + "with_glib": False, + "with_gobject_introspection": True, + "with_qt": False, + "with_gtk": False, + "with_libiconv": True, + "with_openjpeg": True, + "with_lcms": True, + "with_libjpeg": "libjpeg", + "with_png": True, + "with_nss": False, + "with_tiff": True, + "with_libcurl": True, + "with_zlib": True, + "float": False, + } + + exports_sources = "CMakeLists.txt", "patches/**" + generators = "cmake", "cmake_find_package", "pkg_config" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + if not self.options.with_cairo: + del self.options.with_glib + if not self.options.get_safe("with_glib"): + del self.options.with_gobject_introspection + del self.options.with_gtk + if not self.options.cpp: + del self.options.with_libiconv + + def requirements(self): + self.requires("poppler-data/0.4.11") + self.requires("freetype/2.12.1") + if self.options.get_safe("with_libiconv"): + self.requires("libiconv/1.17") + if self.options.fontconfiguration == "fontconfig": + self.requires("fontconfig/2.13.93") + if self.options.with_cairo: + self.requires("cairo/1.17.4") + if self.options.get_safe("with_glib"): + self.requires("glib/2.73.2") + if self.options.get_safe("with_gobject_introspection"): + self.requires("gobject-introspection/1.72.0") + if self.options.with_qt: + self.requires("qt/6.3.1") + if self.options.get_safe("with_gtk"): + self.requires("gtk/4.7.0") + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + if self.options.with_lcms: + self.requires("lcms/2.13.1") + if self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9d") + if self.options.with_png: + self.requires("libpng/1.6.37") + if self.options.with_tiff: + self.requires("libtiff/4.3.0") + if self.options.splash: + self.requires("boost/1.79.0") + if self.options.with_libcurl: + self.requires("libcurl/7.84.0") + if self.options.with_zlib: + self.requires("zlib/1.2.12") + + @property + def _minimum_compilers_version(self): + # Poppler requires C++14 + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1" + } + + def validate(self): + if self.options.fontconfiguration == "win32" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("'win32' option of fontconfig is only available on Windows") + + # C++ standard required + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("C++14 support required. Your compiler is unknown. Assuming it supports C++14.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("C++14 support required, which your compiler does not support.") + + if self.options.with_nss: + # FIXME: missing nss recipe + raise ConanInvalidConfiguration("nss is not (yet) available on cci") + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @property + def _dct_decoder(self): + if self.options.with_libjpeg == False: + return "none" + else: + return str(self.options.with_libjpeg) + + @property + def _cppstd_required(self): + if self.options.with_qt and tools.Version(self.deps_cpp_info["qt"].version).major == "6": + return 17 + else: + return 14 + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + self._cmake.definitions["CMAKE_CXX_STANDARD"] = self._cppstd_required + + self._cmake.definitions["ENABLE_UNSTABLE_API_ABI_HEADERS"] = True + self._cmake.definitions["BUILD_GTK_TESTS"] = False + self._cmake.definitions["BUILD_QT5_TESTS"] = False + self._cmake.definitions["BUILD_QT6_TESTS"] = False + self._cmake.definitions["BUILD_CPP_TESTS"] = False + self._cmake.definitions["BUILD_MANUAL_TESTS"] = False + + self._cmake.definitions["ENABLE_UTILS"] = False + self._cmake.definitions["ENABLE_CPP"] = self.options.cpp + + self._cmake.definitions["ENABLE_SPLASH"] = self.options.splash + self._cmake.definitions["FONT_CONFIGURATION"] = self.options.fontconfiguration + self._cmake.definitions["ENABLE_JPEG"] = self.options.with_libjpeg + self._cmake.definitions["WITH_PNG"] = self.options.with_png + self._cmake.definitions["WITH_TIFF"] = self.options.with_tiff + self._cmake.definitions["WITH_NSS3"] = self.options.with_nss + self._cmake.definitions["WITH_Cairo"] = self.options.with_cairo + self._cmake.definitions["ENABLE_GLIB"] = self.options.get_safe("with_glib", False) + self._cmake.definitions["ENABLE_GOBJECT_INTROSPECTION"] = self.options.get_safe("with_gobject_introspection", False) + self._cmake.definitions["WITH_GTK"] = self.options.get_safe("with_gtk", False) + self._cmake.definitions["WITH_Iconv"] = self.options.get_safe("with_libiconv") + self._cmake.definitions["ENABLE_ZLIB"] = self.options.with_zlib + self._cmake.definitions["ENABLE_LIBOPENJPEG"] = "openjpeg2" if self.options.with_openjpeg else "none" + if self.options.with_openjpeg: + # FIXME: openjpeg's cmake_find_package should provide these variables + self._cmake.definitions["OPENJPEG_MAJOR_VERSION"] = tools.Version(self.requires["openjpeg"].ref.version).major + self._cmake.definitions["ENABLE_CMS"] = "lcms2" if self.options.with_lcms else "none" + self._cmake.definitions["ENABLE_LIBCURL"] = self.options.with_libcurl + + self._cmake.definitions["POPPLER_DATADIR"] = self.deps_user_info["poppler-data"].datadir.replace("\\", "/") + self._cmake.definitions["FONT_CONFIGURATION"] = self.options.fontconfiguration + self._cmake.definitions["BUILD_CPP_TESTS"] = False + self._cmake.definitions["ENABLE_GTK_DOC"] = False + self._cmake.definitions["ENABLE_QT5"] = self.options.with_qt and tools.Version(self.deps_cpp_info["qt"].version).major == "5" + self._cmake.definitions["ENABLE_QT6"] = self.options.with_qt and tools.Version(self.deps_cpp_info["qt"].version).major == "6" + + self._cmake.definitions["ENABLE_CMS"] = "lcms2" if self.options.with_lcms else "none" + self._cmake.definitions["ENABLE_DCTDECODER"] = self._dct_decoder + self._cmake.definitions["USE_FLOAT"] = self.options.float + self._cmake.definitions["RUN_GPERF_IF_PRESENT"] = False + if self.settings.os == "Windows": + self._cmake.definitions["ENABLE_RELOCATABLE"] = self.options.shared + self._cmake.definitions["EXTRA_WARN"] = False + + # Workaround for cross-build to at least iOS/tvOS/watchOS, + # when dependencies are found with find_path() and find_library() + if tools.cross_building(self): + self._cmake.definitions["CMAKE_FIND_ROOT_PATH_MODE_INCLUDE"] = "BOTH" + self._cmake.definitions["CMAKE_FIND_ROOT_PATH_MODE_LIBRARY"] = "BOTH" + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def _patch_sources(self): + for patchdata in self.conan_data["patches"][self.version]: + tools.patch(**patchdata) + if tools.Version(self.version) < "21.07.0" and not self.options.shared: + poppler_global = os.path.join(self._source_subfolder, "cpp", "poppler-global.h") + tools.replace_in_file(poppler_global, "__declspec(dllimport)", "") + tools.replace_in_file(poppler_global, "__declspec(dllexport)", "") + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "FREETYPE_INCLUDE_DIRS", + "Freetype_INCLUDE_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.components["libpoppler"].libs = ["poppler"] + self.cpp_info.components["libpoppler"].includedirs.append(os.path.join("include", "poppler")) + self.cpp_info.components["libpoppler"].names["pkg_config"] = "poppler" + if not self.options.shared: + self.cpp_info.components["libpoppler"].defines = ["POPPLER_STATIC"] + + if self.settings.os == "Linux": + self.cpp_info.components["libpoppler"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["libpoppler"].system_libs = ["gdi32"] + + self.cpp_info.components["libpoppler"].requires = ["poppler-data::poppler-data", "freetype::freetype"] + if self.options.fontconfiguration == "fontconfig": + self.cpp_info.components["libpoppler"].requires.append("fontconfig::fontconfig") + if self.options.with_openjpeg: + self.cpp_info.components["libpoppler"].requires.append("openjpeg::openjpeg") + if self.options.with_lcms: + self.cpp_info.components["libpoppler"].requires.append("lcms::lcms") + if self.options.with_libjpeg == "libjpeg": + self.cpp_info.components["libpoppler"].requires.append("libjpeg::libjpeg") + if self.options.with_png: + self.cpp_info.components["libpoppler"].requires.append("libpng::libpng") + if self.options.with_nss: + self.cpp_info.components["libpoppler"].requires.append("nss::nss") + if self.options.with_tiff: + self.cpp_info.components["libpoppler"].requires.append("libtiff::libtiff") + if self.options.with_libcurl: + self.cpp_info.components["libpoppler"].requires.append("libcurl::libcurl") + if self.options.with_zlib: + self.cpp_info.components["libpoppler"].requires.append("zlib::zlib") + + if self.options.cpp: + self.cpp_info.components["libpoppler-cpp"].libs = ["poppler-cpp"] + self.cpp_info.components["libpoppler-cpp"].includedirs.append(os.path.join("include", "poppler", "cpp")) + self.cpp_info.components["libpoppler-cpp"].names["pkg_config"] = "poppler-cpp" + self.cpp_info.components["libpoppler-cpp"].requires = ["libpoppler"] + if self.options.get_safe("with_libiconv"): + self.cpp_info.components["libpoppler-cpp"].requires.append("libiconv::libiconv") + + if self.options.splash: + self.cpp_info.components["libpoppler-splash"].libs = [] + self.cpp_info.components["libpoppler-splash"].names["pkg_config"] = "poppler-splash" + self.cpp_info.components["libpoppler-splash"].requires = ["libpoppler", "boost::boost"] # FIXME: should be boost::headers, see https://github.com/conan-io/conan-center-index/pull/2097 + + if self.options.with_cairo: + self.cpp_info.components["libpoppler-cairo"].libs = [] + self.cpp_info.components["libpoppler-cairo"].names["pkg_config"] = "poppler-cairo" + self.cpp_info.components["libpoppler-cairo"].requires = ["libpoppler", "cairo::cairo"] + + if self.options.get_safe("with_glib"): + self.cpp_info.components["libpoppler-glib"].libs = ["poppler-glib"] + self.cpp_info.components["libpoppler-glib"].names["pkg_config"] = "poppler-glib" + self.cpp_info.components["libpoppler-glib"].requires = ["libpoppler-cairo", "glib::glib"] + if self.options.get_safe("with_gtk"): + self.cpp_info.components["libpoppler-glib"].requires.append("gtk::gtk") + if self.options.get_safe("with_gobject_introspection"): + self.cpp_info.components["libpoppler-glib"].requires.append("gobject-introspection::gobject-introspection") + + if self.options.with_qt: + qt_major = tools.Version(self.deps_cpp_info["qt"].version).major + self.cpp_info.components["libpoppler-qt"].libs = ["poppler-qt{}".format(qt_major)] + self.cpp_info.components["libpoppler-qt"].names["pkg_config"] = "poppler-qt{}".format(qt_major) + self.cpp_info.components["libpoppler-qt"].requires = ["libpoppler", "qt::qtCore", "qt::qtGui", "qt::qtWidgets"] + + datadir = self.deps_user_info["poppler-data"].datadir + self.output.info("Setting POPPLER_DATADIR env var: {}".format(datadir)) + self.env_info.POPPLER_DATADIR = datadir diff --git a/recipes/poppler/all/patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch b/recipes/poppler/all/patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch new file mode 100644 index 0000000000000..b560d1cc9b020 --- /dev/null +++ b/recipes/poppler/all/patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch @@ -0,0 +1,118 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -4,5 +4,5 @@ + +-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) + + include(PopplerDefaults) + include(PopplerMacros) +@@ -78,7 +78,7 @@ + + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +-set(TESTDATADIR "${CMAKE_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.") ++set(TESTDATADIR "${PROJECT_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.") + if(NOT (EXISTS ${TESTDATADIR} AND EXISTS ${TESTDATADIR}/test-poppler.c)) + message(WARNING " + No test data found in $testdatadir. +@@ -546,1 +546,1 @@ +-add_library(poppler STATIC ${poppler_SRCS}) ++add_library(poppler ${poppler_SRCS}) +@@ -832,4 +832,4 @@ + COMMAND tar -C ${CMAKE_BINARY_DIR} -rf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar ChangeLog --transform='s,,${ARCHIVE_NAME}/,' --owner root:0 --group root:0 + COMMAND tar -C ${CMAKE_BINARY_DIR} -rf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar glib/reference/html --transform='s,,${ARCHIVE_NAME}/,' --owner root:0 --group root:0 + COMMAND xz -9 ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar +- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) ++ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) +--- cpp/CMakeLists.txt ++++ cpp/CMakeLists.txt +@@ -33,1 +33,1 @@ +-target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES}) ++target_link_libraries(poppler-cpp poppler CONAN_PKG::libiconv) +--- cpp/tests/CMakeLists.txt ++++ cpp/tests/CMakeLists.txt +@@ -2,7 +2,7 @@ + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR}/.. +- ${CMAKE_SOURCE_DIR}/utils ++ ${PROJECT_SOURCE_DIR}/utils + ) + + macro(CPP_ADD_SIMPLETEST exe) +@@ -17,8 +17,8 @@ + endif() + endmacro(CPP_ADD_SIMPLETEST) + +-cpp_add_simpletest(poppler-dump poppler-dump.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc) +-cpp_add_simpletest(poppler-render poppler-render.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc) ++cpp_add_simpletest(poppler-dump poppler-dump.cpp ${PROJECT_SOURCE_DIR}/utils/parseargs.cc) ++cpp_add_simpletest(poppler-render poppler-render.cpp ${PROJECT_SOURCE_DIR}/utils/parseargs.cc) + + if(ENABLE_FUZZER) + cpp_add_simpletest(pdf_fuzzer pdf_fuzzer.cc) +--- glib/CMakeLists.txt ++++ glib/CMakeLists.txt +@@ -82,8 +82,8 @@ + ) + set(poppler_glib_generated_SRCS + ${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.c +- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc + ) + add_library(poppler-glib ${poppler_glib_SRCS} ${poppler_glib_generated_SRCS}) +--- glib/reference/CMakeLists.txt ++++ glib/reference/CMakeLists.txt +@@ -1,7 +1,7 @@ + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp + DEPENDS poppler-glib +- COMMAND ${CMAKE_SOURCE_DIR}/make-glib-api-docs --src-dir=${CMAKE_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR} ++ COMMAND ${PROJECT_SOURCE_DIR}/make-glib-api-docs --src-dir=${PROJECT_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR} + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp + ) + +--- test/CMakeLists.txt 2020-02-12 16:51:20.275862392 +0100 ++++ test/CMakeLists.txt 2020-02-12 16:51:52.713018074 +0100 +@@ -23,7 +23,7 @@ + ) + + include_directories( +- ${CMAKE_SOURCE_DIR}/glib ++ ${PROJECT_SOURCE_DIR}/glib + ${CMAKE_BINARY_DIR}/glib + ) + +@@ -37,9 +37,9 @@ + + set (pdf_inspector_SRCS + pdf-inspector.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc + ) + poppler_add_test(pdf-inspector BUILD_GTK_TESTS ${pdf_inspector_SRCS}) + target_link_libraries(pdf-inspector ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${common_libs} ${GTK3_LIBRARIES} poppler) +--- utils/CMakeLists.txt ++++ utils/CMakeLists.txt +@@ -26,9 +26,9 @@ + set(pdftocairo_SOURCES ${common_srcs} + pdftocairo.cc + pdftocairo-win32.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc + ) + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/recipes/poppler/all/patches/20/0002-cmake-use_CONAN_PKG-targets.patch b/recipes/poppler/all/patches/20/0002-cmake-use_CONAN_PKG-targets.patch new file mode 100644 index 0000000000000..bbef4663aac6f --- /dev/null +++ b/recipes/poppler/all/patches/20/0002-cmake-use_CONAN_PKG-targets.patch @@ -0,0 +1,78 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -29,1 +29,1 @@ +-find_package (ECM 1.6.0 QUIET NO_MODULE) ++#find_package (ECM 1.6.0 QUIET NO_MODULE) +@@ -204,1 +204,1 @@ +- macro_optional_find_package(Iconv) ++ macro_optional_find_package(Iconv REQUIRED) +@@ -218,1 +218,1 @@ +- find_package(OpenJPEG) ++ find_package(OpenJPEG REQUIRED) +@@ -235,1 +235,1 @@ +- find_package(LCMS2) ++ find_package(LCMS2 REQUIRED) +@@ -241,1 +241,1 @@ +- find_package(CURL) ++ find_package(CURL REQUIRED) +@@ -417,1 +417,1 @@ +-set(poppler_LIBS ${FREETYPE_LIBRARIES}) ++set(poppler_LIBS CONAN_PKG::freetype) +@@ -439,2 +439,2 @@ +-if(FONTCONFIG_FOUND) ++if(WITH_FONTCONFIGURATION_FONTCONFIG) +- set(poppler_LIBS ${poppler_LIBS} ${FONTCONFIG_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::fontconfig) +@@ -443,5 +443,5 @@if(JPEG_FOUND) +-if(JPEG_FOUND) ++if(ENABLE_JPEG) + set(poppler_SRCS ${poppler_SRCS} + poppler/DCTStream.cc + ) +- set(poppler_LIBS ${poppler_LIBS} ${JPEG_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::libjpeg) +@@ -466,1 +466,1 @@ +- set(poppler_LIBS ${poppler_LIBS} ${CURL_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::libcurl) +@@ -476,4 +476,4 @@ +- set(poppler_LIBS ${poppler_LIBS} ${NSS3_LIBRARIES}) +- include_directories(SYSTEM ${NSS3_INCLUDE_DIRS}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::nss3) ++ #include_directories(SYSTEM ${NSS3_INCLUDE_DIRS}) + else() +- set(poppler_LIBS ${poppler_LIBS} PkgConfig::NSS3) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::nss3) +@@ -482,5 +482,5 @@ +-if (OpenJPEG_FOUND) ++if (ENABLE_LIBOPENJPEG STREQUAL "libopenjpeg2") + set(poppler_SRCS ${poppler_SRCS} + poppler/JPEG2000Stream.cc + ) +- set(poppler_LIBS ${poppler_LIBS} openjp2) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::openjpeg) +@@ -493,1 +493,1 @@ +- set(poppler_LIBS ${poppler_LIBS} ${LCMS2_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::lcms) +--- qt5/src/CMakeLists.txt ++++ qt5/src/CMakeLists.txt +@@ -48,1 +48,1 @@ +-target_link_libraries(poppler-qt5 poppler ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Xml_LIBRARIES} ${FREETYPE_LIBRARIES}) ++target_link_libraries(poppler-qt5 poppler ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Xml_LIBRARIES} CONAN_PKG::freetype) +--- qt6/src/CMakeLists.txt ++++ qt6/src/CMakeLists.txt +@@ -45,1 +45,1 @@ +-target_link_libraries(poppler-qt6 poppler Qt6::Core Qt6::Gui ${FREETYPE_LIBRARIES}) ++target_link_libraries(poppler-qt6 poppler Qt6::Core Qt6::Gui CONAN_PKG::freetype) +--- cmake/modules/FindLCMS2.cmake ++++ cmake/modules/FindLCMS2.cmake +@@ -19,5 +19,5 @@ +-if(NOT WIN32) ++if(1) + find_package(PkgConfig) + pkg_check_modules(PC_LCMS2 lcms2) + set(LCMS2_DEFINITIONS ${PC_LCMS2_CFLAGS_OTHER}) +-endif(NOT WIN32) ++endif() +@@ -32,1 +32,1 @@ +-find_library(LCMS2_LIBRARIES NAMES lcms2 liblcms2 lcms-2 liblcms-2 ++find_library(LCMS2_LIBRARIES NAMES lcms2 liblcms2 lcms-2 liblcms-2 lcms2_static diff --git a/recipes/poppler/all/patches/20/0003-cmake-disable-tests.patch b/recipes/poppler/all/patches/20/0003-cmake-disable-tests.patch new file mode 100644 index 0000000000000..5f141b79df177 --- /dev/null +++ b/recipes/poppler/all/patches/20/0003-cmake-disable-tests.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -727,7 +727,7 @@ + if(ENABLE_GLIB) + add_subdirectory(glib) + endif() +-add_subdirectory(test) ++# add_subdirectory(test) + if(ENABLE_QT5) + add_subdirectory(qt5) + endif() diff --git a/recipes/poppler/all/patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch b/recipes/poppler/all/patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch new file mode 100644 index 0000000000000..0566e9cbeb24d --- /dev/null +++ b/recipes/poppler/all/patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch @@ -0,0 +1,11 @@ +--- poppler/GlobalParams.cc ++++ poppler/GlobalParams.cc +@@ -377,5 +377,8 @@ + GlobalParams::GlobalParams(const char *customPopplerDataDir) : popplerDataDir(customPopplerDataDir) + { ++ if (!popplerDataDir) { ++ popplerDataDir = ::getenv("POPPLER_DATADIR"); ++ } + // scan the encoding in reverse because we want the lowest-numbered + // index for each char name ('space' is encoded twice) + macRomanReverseMap = new NameToCharCode(); diff --git a/recipes/poppler/all/patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch b/recipes/poppler/all/patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch new file mode 100644 index 0000000000000..06c5eeb991a91 --- /dev/null +++ b/recipes/poppler/all/patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch @@ -0,0 +1,21 @@ +On Visual Studio, +openjpeg typedefs a INT32, as does Windows' basetsd.h through some code in poppler/Error.h. +openjpeg conditionally does not typedef it, when basetsd.h is first, so change the include order. + +--- goo/JpegWriter.cc ++++ goo/JpegWriter.cc +@@ -19,12 +19,12 @@ + + #ifdef ENABLE_LIBJPEG + ++#include "poppler/Error.h" ++ + extern "C" { + # include + } + +-# include "poppler/Error.h" +- + struct JpegWriterPrivate + { + bool progressive; diff --git a/recipes/poppler/all/patches/20/0006-missing-symbol-dll-windows.patch b/recipes/poppler/all/patches/20/0006-missing-symbol-dll-windows.patch new file mode 100644 index 0000000000000..d0c7fb1127b13 --- /dev/null +++ b/recipes/poppler/all/patches/20/0006-missing-symbol-dll-windows.patch @@ -0,0 +1,25 @@ +--- poppler/GlobalParams.h ++++ poppler/GlobalParams.h +@@ -60,14 +60,14 @@ + class GfxFont; + class Stream; + class SysFontList; +- +-//------------------------------------------------------------------------ +- +-// The global parameters object. +-extern std::unique_ptr globalParams; ++#if defined(_WIN32) && defined(poppler_EXPORTS) ++#define POPPLER_API __declspec(dllexport) ++#elif defined(_WIN32) && !defined(POPPLER_STATIC) ++#define POPPLER_API __declspec(dllimport) ++#else ++#define POPPLER_API ++#endif ++extern POPPLER_API std::unique_ptr globalParams; +- +-//------------------------------------------------------------------------ +- + enum SysFontType + { + sysFontPFA, diff --git a/recipes/poppler/all/patches/20/0007-cmake-use_conan_qt.patch b/recipes/poppler/all/patches/20/0007-cmake-use_conan_qt.patch new file mode 100644 index 0000000000000..4bd01768d587b --- /dev/null +++ b/recipes/poppler/all/patches/20/0007-cmake-use_conan_qt.patch @@ -0,0 +1,63 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -43,8 +43,10 @@ string(REGEX REPLACE "^0?(.+)$" "\\1" POPPLER_MINOR_VERSION "${POPPLER_MINOR_VER + set(POPPLER_MICRO_VERSION "0") + set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION_STRING}.${POPPLER_MICRO_VERSION}") + +-set (CMAKE_CXX_STANDARD 14) +-set (CMAKE_CXX_EXTENSIONS OFF) ++if (NOT CMAKE_CXX_STANDARD) ++ set (CMAKE_CXX_STANDARD 14) ++ set (CMAKE_CXX_EXTENSIONS OFF) ++endif() + + # command line switches + option(ENABLE_UNSTABLE_API_ABI_HEADERS "Install API/ABI unstable xpdf headers." OFF) +@@ -154,23 +156,11 @@ else() + endif() + + if (ENABLE_QT5) +- find_package(Qt5Core 5.5) # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this +- find_package(Qt5Gui) +- find_package(Qt5Xml) +- find_package(Qt5Widgets) +- find_package(Qt5Test) +- if (NOT (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)) +- message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found") +- set(ENABLE_QT5 OFF) +- endif() ++ find_package(qt 5.5 COMPONENTS Core Gui Xml Widgets Test REQUIRED) # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this + endif() + + if (ENABLE_QT6) +- find_package(Qt6 COMPONENTS Core Gui Widgets Test QUIET) +- if (NOT (Qt6Core_FOUND AND Qt6Gui_FOUND AND Qt6Widgets_FOUND AND Qt6Test_FOUND)) +- message("-- Package Qt6Core or Qt6Gui or Qt6Widgets or Qt6Test not found") +- set(ENABLE_QT6 OFF) +- endif() ++ find_package(Qt6 COMPONENTS Core Gui Widgets Test REQUIRED) + endif() + + macro_optional_find_package(Cairo ${CAIRO_VERSION}) +--- qt5/src/CMakeLists.txt ++++ qt5/src/CMakeLists.txt +@@ -1,10 +1,7 @@ +-add_definitions(${QT5_DEFINITIONS}) +-add_definitions(${Qt5Core_DEFINITIONS}) + add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS) + + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} +- ${Qt5Core_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ) + +@@ -45,7 +42,7 @@ if(MINGW AND BUILD_SHARED_LIBS) + get_target_property(POPPLER_QT5_SOVERSION poppler-qt5 SOVERSION) + set_target_properties(poppler-qt5 PROPERTIES SUFFIX "-${POPPLER_QT5_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() +-target_link_libraries(poppler-qt5 poppler ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Xml_LIBRARIES} CONAN_PKG::freetype) ++target_link_libraries(poppler-qt5 poppler CONAN_PKG::qt CONAN_PKG::freetype) + if(MSVC) + target_link_libraries(poppler-qt5 poppler ${poppler_LIBS}) + endif() diff --git a/recipes/poppler/all/patches/21/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch b/recipes/poppler/all/patches/21/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch new file mode 100644 index 0000000000000..ed9a2fac6b059 --- /dev/null +++ b/recipes/poppler/all/patches/21/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch @@ -0,0 +1,125 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d1d3653..3d61503 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ project(poppler) + + cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR) + +-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) + + include(PopplerDefaults) + include(PopplerMacros) +@@ -85,7 +85,7 @@ option(EXTRA_WARN "Enable extra compile warnings" OFF) + + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +-set(TESTDATADIR "${CMAKE_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.") ++set(TESTDATADIR "${PROJECT_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.") + if(NOT (EXISTS ${TESTDATADIR} AND EXISTS ${TESTDATADIR}/test-poppler.c)) + message(WARNING " + No test data found in $testdatadir. +@@ -837,4 +837,4 @@ add_custom_target(dist + COMMAND tar -C ${CMAKE_BINARY_DIR} -rf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar ChangeLog --transform='s,,${ARCHIVE_NAME}/,' --owner root:0 --group root:0 + COMMAND tar -C ${CMAKE_BINARY_DIR} -rf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar glib/reference/html --transform='s,,${ARCHIVE_NAME}/,' --owner root:0 --group root:0 + COMMAND xz -9 ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar +- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) ++ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) +diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt +index 10ac0b3..adbcfcd 100644 +--- a/cpp/tests/CMakeLists.txt ++++ b/cpp/tests/CMakeLists.txt +@@ -2,7 +2,7 @@ include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR}/.. +- ${CMAKE_SOURCE_DIR}/utils ++ ${PROJECT_SOURCE_DIR}/utils + ) + + macro(CPP_ADD_SIMPLETEST exe) +@@ -17,8 +17,8 @@ macro(CPP_ADD_SIMPLETEST exe) + endif() + endmacro(CPP_ADD_SIMPLETEST) + +-cpp_add_simpletest(poppler-dump poppler-dump.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc) +-cpp_add_simpletest(poppler-render poppler-render.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc) ++cpp_add_simpletest(poppler-dump poppler-dump.cpp ${PROJECT_SOURCE_DIR}/utils/parseargs.cc) ++cpp_add_simpletest(poppler-render poppler-render.cpp ${PROJECT_SOURCE_DIR}/utils/parseargs.cc) + + if(ENABLE_FUZZER) + cpp_add_simpletest(doc_fuzzer ./fuzzing/doc_fuzzer.cc) +diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt +index 007b2b9..75ecb35 100644 +--- a/glib/CMakeLists.txt ++++ b/glib/CMakeLists.txt +@@ -81,9 +81,9 @@ set(poppler_glib_SRCS + ) + set(poppler_glib_generated_SRCS + ${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.c +- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc + ) + add_library(poppler-glib ${poppler_glib_SRCS} ${poppler_glib_generated_SRCS}) + generate_export_header(poppler-glib EXPORT_MACRO_NAME POPPLER_PUBLIC EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/poppler-macros.h") +diff --git a/glib/reference/CMakeLists.txt b/glib/reference/CMakeLists.txt +index 1551540..e309186 100644 +--- a/glib/reference/CMakeLists.txt ++++ b/glib/reference/CMakeLists.txt +@@ -1,7 +1,7 @@ + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp + DEPENDS poppler-glib +- COMMAND ${CMAKE_SOURCE_DIR}/make-glib-api-docs --src-dir=${CMAKE_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR} ++ COMMAND ${PROJECT_SOURCE_DIR}/make-glib-api-docs --src-dir=${PROJECT_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR} + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp + ) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index b9251e0..4d3562d 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -19,7 +19,7 @@ if (GTK_FOUND) + ) + + include_directories( +- ${CMAKE_SOURCE_DIR}/glib ++ ${PROJECT_SOURCE_DIR}/glib + ${CMAKE_BINARY_DIR}/glib + ) + +@@ -33,9 +33,9 @@ if (GTK_FOUND) + + set (pdf_inspector_SRCS + pdf-inspector.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc + ) + poppler_add_test(pdf-inspector BUILD_GTK_TESTS ${pdf_inspector_SRCS}) + target_link_libraries(pdf-inspector ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${common_libs} ${GTK3_LIBRARIES} poppler) +diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt +index ce0ce16..5a6645f 100644 +--- a/utils/CMakeLists.txt ++++ b/utils/CMakeLists.txt +@@ -25,9 +25,9 @@ if (HAVE_CAIRO) + set(pdftocairo_SOURCES ${common_srcs} + pdftocairo.cc + pdftocairo-win32.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc +- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc ++ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc + ) + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/recipes/poppler/all/patches/21/0002-cmake-use_CONAN_PKG-targets.patch b/recipes/poppler/all/patches/21/0002-cmake-use_CONAN_PKG-targets.patch new file mode 100644 index 0000000000000..7d19afb269cb3 --- /dev/null +++ b/recipes/poppler/all/patches/21/0002-cmake-use_CONAN_PKG-targets.patch @@ -0,0 +1,158 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d1d3653..dadcd02 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,7 +25,7 @@ include(GNUInstallDirs) + + set(ENABLE_FUZZER FALSE) + +-find_package (ECM 1.6.0 QUIET NO_MODULE) ++find_package (ECM 1.6.0 QUIET NO_MODULE) + if (ECM_FOUND) + include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake") + +@@ -235,7 +235,7 @@ if(ENABLE_GTK_DOC) + endif() + + if(ENABLE_CPP) +- macro_optional_find_package(Iconv) ++ macro_optional_find_package(Iconv REQUIRED) + set(ENABLE_CPP ${ICONV_FOUND}) + set(HAVE_ICONV ${ICONV_FOUND}) + endif() +@@ -249,7 +249,7 @@ if(ENABLE_ZLIB_UNCOMPRESS AND NOT ENABLE_ZLIB) + endif() + set(WITH_OPENJPEG FALSE) + if(ENABLE_LIBOPENJPEG STREQUAL "openjpeg2") +- find_package(OpenJPEG) ++ find_package(OpenJPEG REQUIRED) + set(WITH_OPENJPEG ${OpenJPEG_FOUND}) + if(NOT OpenJPEG_FOUND OR OPENJPEG_MAJOR_VERSION VERSION_LESS 2) + message(FATAL_ERROR "Install libopenjpeg2 before trying to build poppler. You can also decide to use the internal unmaintained JPX decoder or none at all.") +@@ -266,13 +266,13 @@ else() + endif() + set(ENABLE_LIBOPENJPEG "${WITH_OPENJPEG}") + if(ENABLE_CMS STREQUAL "lcms2") +- find_package(LCMS2) ++ find_package(LCMS2 REQUIRED) + set(USE_CMS ${LCMS2_FOUND}) + elseif(NOT ENABLE_CMS STREQUAL "none") + message(FATAL_ERROR "Invalid ENABLE_CMS value: ${ENABLE_CMS}") + endif() + if(ENABLE_LIBCURL) +- find_package(CURL) ++ find_package(CURL REQUIRED) + if(CURL_FOUND) + include_directories(SYSTEM ${CURL_INCLUDE_DIR}) + set(POPPLER_HAS_CURL_SUPPORT ON) +@@ -458,16 +458,16 @@ set(poppler_SRCS + splash/SplashXPath.cc + splash/SplashXPathScanner.cc + ) +-set(poppler_LIBS ${FREETYPE_LIBRARIES}) +-if(FONTCONFIG_FOUND) +- set(poppler_LIBS ${poppler_LIBS} ${FONTCONFIG_LIBRARIES}) ++set(poppler_LIBS CONAN_PKG::freetype) ++if(WITH_FONTCONFIGURATION_FONTCONFIG) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::fontconfig) + endif() + +-if(JPEG_FOUND) ++if(ENABLE_JPEG) + set(poppler_SRCS ${poppler_SRCS} + poppler/DCTStream.cc + ) +- set(poppler_LIBS ${poppler_LIBS} ${JPEG_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::libjpeg) + endif() + if(ENABLE_ZLIB) + set(poppler_SRCS ${poppler_SRCS} +@@ -486,7 +486,7 @@ if(ENABLE_LIBCURL) + poppler/CurlPDFDocBuilder.cc + ) + if(${CMAKE_VERSION} VERSION_LESS "3.12.0") +- set(poppler_LIBS ${poppler_LIBS} ${CURL_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::libcurl) + else() + set(poppler_LIBS ${poppler_LIBS} CURL::libcurl) + endif() +@@ -497,18 +497,18 @@ if (ENABLE_NSS3) + ) + set(poppler_LIBS ${poppler_LIBS} PkgConfig::NSS3) + endif() +-if (OpenJPEG_FOUND) ++if (ENABLE_LIBOPENJPEG STREQUAL "libopenjpeg2") + set(poppler_SRCS ${poppler_SRCS} + poppler/JPEG2000Stream.cc + ) +- set(poppler_LIBS ${poppler_LIBS} openjp2) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::openjpeg) + else () + set(poppler_SRCS ${poppler_SRCS} + poppler/JPXStream.cc + ) + endif() + if(USE_CMS) +- set(poppler_LIBS ${poppler_LIBS} ${LCMS2_LIBRARIES}) ++ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::lcms) + endif() + if(WIN32) + # use clean APIs +diff --git a/cmake/modules/FindLCMS2.cmake b/cmake/modules/FindLCMS2.cmake +index 2ec91d0..ec2c80b 100644 +--- a/cmake/modules/FindLCMS2.cmake ++++ b/cmake/modules/FindLCMS2.cmake +@@ -16,11 +16,11 @@ + + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls +-if(NOT WIN32) ++if(1) + find_package(PkgConfig) + pkg_check_modules(PC_LCMS2 lcms2) + set(LCMS2_DEFINITIONS ${PC_LCMS2_CFLAGS_OTHER}) +-endif(NOT WIN32) ++endif() + + find_path(LCMS2_INCLUDE_DIR lcms2.h + PATHS +@@ -29,7 +29,7 @@ find_path(LCMS2_INCLUDE_DIR lcms2.h + PATH_SUFFIXES lcms2 liblcms2 + ) + +-find_library(LCMS2_LIBRARIES NAMES lcms2 liblcms2 lcms-2 liblcms-2 ++find_library(LCMS2_LIBRARIES NAMES lcms2 liblcms2 lcms-2 liblcms-2 lcms2_static + PATHS + ${PC_LCMS2_LIBDIR} + ${PC_LCMS2_LIBRARY_DIRS} +--- cpp/CMakeLists.txt ++++ cpp/CMakeLists.txt +@@ -34,1 +34,1 @@ +-target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES}) ++target_link_libraries(poppler-cpp poppler CONAN_PKG::libiconv) +diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt +index d80c81f..01d3e3e 100644 +--- a/qt5/src/CMakeLists.txt ++++ b/qt5/src/CMakeLists.txt +@@ -43,7 +43,7 @@ if(MINGW AND BUILD_SHARED_LIBS) + get_target_property(POPPLER_QT5_SOVERSION poppler-qt5 SOVERSION) + set_target_properties(poppler-qt5 PROPERTIES SUFFIX "-${POPPLER_QT5_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() +-target_link_libraries(poppler-qt5 poppler Qt5::Core Qt5::Gui Qt5::Xml ${FREETYPE_LIBRARIES}) ++target_link_libraries(poppler-qt5 poppler Qt5::Core Qt5::Gui Qt5::Xml CONAN_PKG::freetype) + if(MSVC) + target_link_libraries(poppler-qt5 poppler ${poppler_LIBS}) + endif() +diff --git a/qt6/src/CMakeLists.txt b/qt6/src/CMakeLists.txt +index f30b1a8..6337173 100644 +--- a/qt6/src/CMakeLists.txt ++++ b/qt6/src/CMakeLists.txt +@@ -43,7 +43,7 @@ if(MINGW AND BUILD_SHARED_LIBS) + get_target_property(POPPLER_QT6_SOVERSION poppler-qt6 SOVERSION) + set_target_properties(poppler-qt6 PROPERTIES SUFFIX "-${POPPLER_QT6_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() +-target_link_libraries(poppler-qt6 poppler Qt6::Core Qt6::Gui ${FREETYPE_LIBRARIES}) ++target_link_libraries(poppler-qt6 poppler Qt6::Core Qt6::Gui CONAN_PKG::freetype}) + if(MSVC) + target_link_libraries(poppler-qt6 poppler ${poppler_LIBS}) + endif() diff --git a/recipes/poppler/all/patches/21/0004-add-POPPLER_DATADIR-environment-variable.patch b/recipes/poppler/all/patches/21/0004-add-POPPLER_DATADIR-environment-variable.patch new file mode 100644 index 0000000000000..0566e9cbeb24d --- /dev/null +++ b/recipes/poppler/all/patches/21/0004-add-POPPLER_DATADIR-environment-variable.patch @@ -0,0 +1,11 @@ +--- poppler/GlobalParams.cc ++++ poppler/GlobalParams.cc +@@ -377,5 +377,8 @@ + GlobalParams::GlobalParams(const char *customPopplerDataDir) : popplerDataDir(customPopplerDataDir) + { ++ if (!popplerDataDir) { ++ popplerDataDir = ::getenv("POPPLER_DATADIR"); ++ } + // scan the encoding in reverse because we want the lowest-numbered + // index for each char name ('space' is encoded twice) + macRomanReverseMap = new NameToCharCode(); diff --git a/recipes/poppler/all/patches/21/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch b/recipes/poppler/all/patches/21/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch new file mode 100644 index 0000000000000..06c5eeb991a91 --- /dev/null +++ b/recipes/poppler/all/patches/21/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch @@ -0,0 +1,21 @@ +On Visual Studio, +openjpeg typedefs a INT32, as does Windows' basetsd.h through some code in poppler/Error.h. +openjpeg conditionally does not typedef it, when basetsd.h is first, so change the include order. + +--- goo/JpegWriter.cc ++++ goo/JpegWriter.cc +@@ -19,12 +19,12 @@ + + #ifdef ENABLE_LIBJPEG + ++#include "poppler/Error.h" ++ + extern "C" { + # include + } + +-# include "poppler/Error.h" +- + struct JpegWriterPrivate + { + bool progressive; diff --git a/recipes/poppler/all/patches/21/0007-cmake-use_conan_qt.patch b/recipes/poppler/all/patches/21/0007-cmake-use_conan_qt.patch new file mode 100644 index 0000000000000..ef2fb2d41d9ec --- /dev/null +++ b/recipes/poppler/all/patches/21/0007-cmake-use_conan_qt.patch @@ -0,0 +1,70 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 16e3070..fba2259 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,8 +42,10 @@ string(REGEX REPLACE "^0?(.+)$" "\\1" POPPLER_MINOR_VERSION "${POPPLER_MINOR_VER + set(POPPLER_MICRO_VERSION "0") + set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION_STRING}.${POPPLER_MICRO_VERSION}") + +-set(CMAKE_CXX_STANDARD 14) +-set(CMAKE_CXX_EXTENSIONS OFF) ++if(NOT CMAKE_CXX_SANDARD) ++ set(CMAKE_CXX_STANDARD 14) ++ set(CMAKE_CXX_EXTENSIONS OFF) ++endif() + set(CMAKE_C_STANDARD 11) + set(CMAKE_C_EXTENSIONS OFF) + set(CMAKE_LINK_DEPENDS_NO_SHARED TRUE) +@@ -162,24 +164,12 @@ else() + endif() + + if (ENABLE_QT5) +- find_package(Qt5Core 5.9) # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this +- find_package(Qt5Gui) +- find_package(Qt5Xml) +- find_package(Qt5Widgets) +- find_package(Qt5Test) +- if (NOT (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)) +- message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found") +- set(ENABLE_QT5 OFF) +- endif() ++ find_package(qt 5.5 COMPONENTS Core Gui Xml Widgets Test REQUIRED) # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this + endif() + + if (ENABLE_QT6) + SET(QT_NO_CREATE_VERSIONLESS_TARGETS ON) +- find_package(Qt6 COMPONENTS Core Gui Widgets Test QUIET) +- if (NOT (Qt6Core_FOUND AND Qt6Gui_FOUND AND Qt6Widgets_FOUND AND Qt6Test_FOUND)) +- message("-- Package Qt6Core or Qt6Gui or Qt6Widgets or Qt6Test not found") +- set(ENABLE_QT6 OFF) +- endif() ++ find_package(Qt6 COMPONENTS Core Gui Widgets Test REQUIRED) + endif() + + # Check for Cairo rendering backend +diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt +index 01d3e3e..dc1c662 100644 +--- a/qt5/src/CMakeLists.txt ++++ b/qt5/src/CMakeLists.txt +@@ -43,7 +43,7 @@ if(MINGW AND BUILD_SHARED_LIBS) + get_target_property(POPPLER_QT5_SOVERSION poppler-qt5 SOVERSION) + set_target_properties(poppler-qt5 PROPERTIES SUFFIX "-${POPPLER_QT5_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() +-target_link_libraries(poppler-qt5 poppler Qt5::Core Qt5::Gui Qt5::Xml CONAN_PKG::freetype) ++target_link_libraries(poppler-qt5 poppler CONAN_PKG::qt CONAN_PKG::freetype) + if(MSVC) + target_link_libraries(poppler-qt5 poppler ${poppler_LIBS}) + endif() +diff --git a/qt6/src/CMakeLists.txt b/qt6/src/CMakeLists.txt +index 6337173..f275c92 100644 +--- a/qt6/src/CMakeLists.txt ++++ b/qt6/src/CMakeLists.txt +@@ -43,7 +43,7 @@ if(MINGW AND BUILD_SHARED_LIBS) + get_target_property(POPPLER_QT6_SOVERSION poppler-qt6 SOVERSION) + set_target_properties(poppler-qt6 PROPERTIES SUFFIX "-${POPPLER_QT6_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() +-target_link_libraries(poppler-qt6 poppler Qt6::Core Qt6::Gui CONAN_PKG::freetype}) ++target_link_libraries(poppler-qt6 poppler CONAN_PKG::qt CONAN_PKG::freetype}) + if(MSVC) + target_link_libraries(poppler-qt6 poppler ${poppler_LIBS}) + endif() diff --git a/recipes/poppler/all/test_package/CMakeLists.txt b/recipes/poppler/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/poppler/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/poppler/all/test_package/conanfile.py b/recipes/poppler/all/test_package/conanfile.py new file mode 100644 index 0000000000000..af1c12797cdae --- /dev/null +++ b/recipes/poppler/all/test_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" + + 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") + pdf_path = os.path.join(self.source_folder, "sample.pdf") + self.run("{} {}".format(bin_path, pdf_path), run_environment=True) + diff --git a/recipes/poppler/all/test_package/sample.pdf b/recipes/poppler/all/test_package/sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1227127e9078101ac1b9ca424dc8926a39872cf3 GIT binary patch literal 21355 zcmdS=WmH|u7Bz}4+})kv8W!&E?k>S4xH|-QcXxMpcXxM(0Kr1=aLL~1>~rq-&U@|M zpSPHeR~uS^GbbE6DT`> z(G5)pMzBYCSq)voLitEV| z-Lvv8HU2&+GFZGKd23P%WvlqC(PNv)DyP6kgF+#1b~beSb1!LaU}nOgZeje#XdLXs3=$?5X68=Bj6fD*1|bV4M+FlHVOwiE zTN@J_Ct?m_24Pz(TL)!310xd#5fc{+BNHWYp?@1%L|El-GyfX~c2<^;A(dqf94(1i z|3E_g9{}E0-**AXQeu)~01yxmK=Q{A;C%xi3;+WK{d0X3@Q(`u8Ug|w90C>!3KAL~ z79JiB77h*p5fvE$5d{$r4jB^}1q~eo0|Ooj3mX$18x=uY1Ple_eGq^L00Dq~{Iwu}e+oDRBp4_N)JG@oNAsV~ zf4Tqw5YUeaK)$a7;K4uupvYjzA5G7EBZs~J^~}Gjd}q{F%MrS|6U{aW-u?H3pQ)dj z-~=tX>6s%up-s`aw`no$6>;pRDXKop3~6);{4+w!)^B^t3~PepueN;cnMYj|?A?7b zmEWfeW@@rJdn$Y^o^9kOemW=q`rY=cvU@^ozL}6Umbu9l?)fhAYnABPlf*Bt+J8nP z9}8hhaoMlj?2jWNC{)*2)@u?j$a)aQLMZ#a@sOIUySz?{YAZ2PF#ZKP+kyzCuW)*K zTlaOlGl669Mmh}W@&G+X!n~P}cF~Wvc-yuy*;XV9st=_nG_hp7u5}*5Wp$sXX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y{eIPHKCv+C_{CPxUc_Pq!R-h;}m>bCw___s(0hc8jOiUmE z>+u6j_`$0fwx;7J6l5G`Rh6({+p^gZM5ThB2F#DfQg0X?f)EITfJk+XN>iU>K#vBl zsrF28jDosAN;x96-2ZEe@}^2q56y-!1vWxP1t!<=BEtnjKhYbTAPyiJQS}=)h~uf; zr7_fY2=_5ihz6R55%vjv3b4xrDF6Wye`6LU;)}Tawne}N3;}8&=KUnTytjH(qNPBG z26R>WK#vMc6Yi)s;u>(BXaZ1yD1@7~U{BamRS9k^3*;g+VXa084FpDD9L5pa3J6{f zLCa0Y1xy6E!CDXrL9~FSH$M^$MJXuBpQM(-bQ}kvO#DdvH!^Tc45djjWC}eB^j=vU z0yEU4vN#n56VC*Dz;hG?&;%KTQ?bcWL#%Tf>o zJR2v +#include + +using namespace poppler; + +int main(int argc, char **argv) { + if (argc < 2) { + std::cerr << "Need an argument\n"; + return EXIT_FAILURE; + } + + auto doc = document::load_from_file(argv[1]); + std::cout << "#pages: " << doc->pages() << '\n'; + std::cout << "title: " << doc->get_title().to_latin1() << '\n'; + std::cout << "author: " << doc->get_author().to_latin1() << '\n'; + std::cout << "subject: " << doc->get_subject().to_latin1() << '\n'; + std::cout << "keywords: " << doc->get_keywords().to_latin1() << '\n'; + + return EXIT_SUCCESS; +} diff --git a/recipes/poppler/config.yml b/recipes/poppler/config.yml new file mode 100644 index 0000000000000..d7e7c61afeead --- /dev/null +++ b/recipes/poppler/config.yml @@ -0,0 +1,5 @@ +versions: + "20.09.0": + folder: "all" + "21.07.0": + folder: "all" diff --git a/recipes/popt/all/conandata.yml b/recipes/popt/all/conandata.yml new file mode 100644 index 0000000000000..943e3728397d7 --- /dev/null +++ b/recipes/popt/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.16": + url: "https://ftp.openbsd.org/pub/OpenBSD/distfiles/popt-1.16.tar.gz" + sha256: "e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8" +patches: + "1.16": + - patch_file: "patches/0004-vcpkg-fixmsvc.patch" + patch_description: "Windows portability" + patch_type: "portability" + patch_source: "https://github.com/microsoft/vcpkg/blob/master/ports/libpopt/0004-vcpkg-fixmsvc.patch" diff --git a/recipes/popt/all/conanfile.py b/recipes/popt/all/conanfile.py new file mode 100644 index 0000000000000..ce3a9a4e859ec --- /dev/null +++ b/recipes/popt/all/conanfile.py @@ -0,0 +1,131 @@ +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 Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + + +required_conan_version = ">=1.54.0" + +class PoptConan(ConanFile): + name = "popt" + description = "Library for parsing command line parameters" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rpm-software-management/popt" + topics = ("command line", "options", "parsing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + def build_requirements(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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.configure_args.extend([ + "--disable-dependency-tracking", + "--disable-nls", + ]) + tc.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=self.source_folder) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + 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.libs = ["libpopt"] if self.settings.os == "Windows" else ["popt"] + + self.cpp_info.set_property("pkg_config_name", "popt") + + if is_apple_os(self): + self.cpp_info.system_libs = ["iconv"] diff --git a/recipes/popt/all/patches/0004-vcpkg-fixmsvc.patch b/recipes/popt/all/patches/0004-vcpkg-fixmsvc.patch new file mode 100644 index 0000000000000..d9bc082f3b53e --- /dev/null +++ b/recipes/popt/all/patches/0004-vcpkg-fixmsvc.patch @@ -0,0 +1,62 @@ +diff -Naur a/poptconfig.c b/poptconfig.c +--- a/poptconfig.c 2009-05-20 16:18:07.000000000 +0300 ++++ b/poptconfig.c 2017-01-21 03:10:17.116120500 +0300 +@@ -141,17 +141,23 @@ + int poptSaneFile(const char * fn) + { + struct stat sb; +- uid_t uid = getuid(); ++#ifndef _MSC_VER ++ uid_t uid = getuid(); ++#endif // ! _MSC_VER + + if (stat(fn, &sb) == -1) + return 1; ++#ifndef _MSC_VER + if ((uid_t)sb.st_uid != uid) + return 0; ++#endif // ! _MSC_VER + if (!S_ISREG(sb.st_mode)) + return 0; + /*@-bitwisesigned@*/ +- if (sb.st_mode & (S_IWGRP|S_IWOTH)) +- return 0; ++#ifndef _MSC_VER ++ if (sb.st_mode & (S_IWGRP | S_IWOTH)) ++ return 0; ++#endif // ! _MSC_VER + /*@=bitwisesigned@*/ + return 1; + } +diff -Naur a/popthelp.c b/popthelp.c +--- a/popthelp.c 2009-08-28 03:06:33.000000000 +0300 ++++ b/popthelp.c 2017-01-21 02:59:26.665695800 +0300 +@@ -10,7 +10,10 @@ + + #include "system.h" + +-#define POPT_USE_TIOCGWINSZ ++#ifndef _MSC_VER ++#define POPT_USE_TIOCGWINSZ ++#endif ++ + #ifdef POPT_USE_TIOCGWINSZ + #include + #endif +diff -Naur a/system.h b/system.h +--- a/system.h 2008-12-18 19:09:49.000000000 +0200 ++++ b/system.h 2017-01-21 03:10:59.195367500 +0300 +@@ -100,4 +100,13 @@ + #endif + #define UNUSED(x) x __attribute__((__unused__)) + ++#if defined(_MSC_VER) ++#define X_OK 0 ++ ++#include ++typedef SSIZE_T ssize_t; ++ ++#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) ++#endif ++ + #include "popt.h" diff --git a/recipes/popt/all/test_package/CMakeLists.txt b/recipes/popt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..22ec2254e31d1 --- /dev/null +++ b/recipes/popt/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(popt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE popt::popt) diff --git a/recipes/popt/all/test_package/conanfile.py b/recipes/popt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/popt/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/popt/all/test_package/test_package.c b/recipes/popt/all/test_package/test_package.c new file mode 100644 index 0000000000000..1ba85997582a9 --- /dev/null +++ b/recipes/popt/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include +#include +#include "popt.h" + + +int main(int argc, const char* argv[]) { + struct poptOption table[] = { + POPT_AUTOHELP + POPT_TABLEEND + }; + + poptContext context = poptGetContext(NULL, argc, argv, table, 0); + poptGetNextOpt(context); + poptFreeContext(context); + + return EXIT_SUCCESS; +} diff --git a/recipes/popt/all/test_v1_package/CMakeLists.txt b/recipes/popt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cbe79d4195d31 --- /dev/null +++ b/recipes/popt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(popt REQUIRED CONFIG) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/popt/all/test_v1_package/conanfile.py b/recipes/popt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/popt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/popt/config.yml b/recipes/popt/config.yml new file mode 100644 index 0000000000000..b41d4f764c9b5 --- /dev/null +++ b/recipes/popt/config.yml @@ -0,0 +1,3 @@ +versions: + "1.16": + folder: all diff --git a/recipes/portable-file-dialogs/all/conandata.yml b/recipes/portable-file-dialogs/all/conandata.yml new file mode 100644 index 0000000000000..5f101e63fc17d --- /dev/null +++ b/recipes/portable-file-dialogs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/samhocevar/portable-file-dialogs/archive/0.1.0.tar.gz" + sha256: "db57f02a45b169613c41d1fb94edab5f03020cc5cdc5033f538c08b4982cd5d4" diff --git a/recipes/portable-file-dialogs/all/conanfile.py b/recipes/portable-file-dialogs/all/conanfile.py new file mode 100644 index 0000000000000..c45d2c0106dee --- /dev/null +++ b/recipes/portable-file-dialogs/all/conanfile.py @@ -0,0 +1,36 @@ +import os +from conans import ConanFile, tools + + +class PortableFileDialogsConan(ConanFile): + name = "portable-file-dialogs" + license = "WTFPL" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/samhocevar/portable-file-dialogs" + description = "Portable GUI dialogs library, C++11, single-header" + topics = ("conan", "gui", "dialogs") + no_copy_source = True + settings = "compiler" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy("portable-file-dialogs.h", dst="include", src=self._source_subfolder) + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.libdirs = [] diff --git a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/portable-file-dialogs/all/test_package/conanfile.py b/recipes/portable-file-dialogs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/portable-file-dialogs/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/portable-file-dialogs/all/test_package/test_package.cpp b/recipes/portable-file-dialogs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d89a440de512a --- /dev/null +++ b/recipes/portable-file-dialogs/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "portable-file-dialogs.h" + +#include +#include + +int main() +{ + pfd::settings::verbose(true); + + return EXIT_SUCCESS; +} diff --git a/recipes/portable-file-dialogs/config.yml b/recipes/portable-file-dialogs/config.yml new file mode 100644 index 0000000000000..5e5e3d8a61814 --- /dev/null +++ b/recipes/portable-file-dialogs/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: "all" diff --git a/recipes/poshlib/all/CMakeLists.txt b/recipes/poshlib/all/CMakeLists.txt new file mode 100644 index 0000000000000..7e123f6b4b780 --- /dev/null +++ b/recipes/poshlib/all/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +file(GLOB SRCS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.c) +file(GLOB HDRS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.h) + +add_library(posh ${SRCS_FILES}) +target_include_directories(posh PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) + +install(TARGETS posh + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +install(FILES ${HDRS_FILES} DESTINATION include) diff --git a/recipes/poshlib/all/conandata.yml b/recipes/poshlib/all/conandata.yml new file mode 100644 index 0000000000000..ab75b8a2341c3 --- /dev/null +++ b/recipes/poshlib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.002": + url: "https://github.com/PhilipLudington/poshlib/archive/v1.3.002.tar.gz" + sha256: "64ee27930ef92f3f8851261b3c108169ece8e2f5d48262336feedd607faae735" diff --git a/recipes/poshlib/all/conanfile.py b/recipes/poshlib/all/conanfile.py new file mode 100644 index 0000000000000..8a2c26baad724 --- /dev/null +++ b/recipes/poshlib/all/conanfile.py @@ -0,0 +1,68 @@ +import os +import glob +from conans import ConanFile, CMake, tools + + +class PoshlibConan(ConanFile): + name = "poshlib" + description = "Posh is a software framework used in cross-platform software development." + homepage = "https://github.com/PhilipLudington/poshlib" + url = "https://github.com/conan-io/conan-center-index" + topics = ("conan", "posh", "framework", "cross-platform") + license = "BSD-2-Clause" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob('poshlib-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + 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 + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "posh.h"), + "defined _ARM", + "defined _ARM || defined __arm64") + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == 'Windows' and self.options.shared: + self.cpp_info.defines.append("POSH_DLL") diff --git a/recipes/poshlib/all/test_package/CMakeLists.txt b/recipes/poshlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/poshlib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/poshlib/all/test_package/conanfile.py b/recipes/poshlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..16ec9f68ef974 --- /dev/null +++ b/recipes/poshlib/all/test_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" + + 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/poshlib/all/test_package/test_package.c b/recipes/poshlib/all/test_package/test_package.c new file mode 100644 index 0000000000000..779e0416d2d93 --- /dev/null +++ b/recipes/poshlib/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include "posh.h" + +int main() +{ + printf("%s", POSH_GetArchString()); + return 0; +} diff --git a/recipes/poshlib/config.yml b/recipes/poshlib/config.yml new file mode 100644 index 0000000000000..e73cbe6999316 --- /dev/null +++ b/recipes/poshlib/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.002": + folder: all diff --git a/recipes/pprint/all/conandata.yml b/recipes/pprint/all/conandata.yml new file mode 100644 index 0000000000000..741749f188e27 --- /dev/null +++ b/recipes/pprint/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "0.9.1": + url: "https://github.com/p-ranav/pprint/archive/v0.9.1.tar.gz" + sha256: "b9cc0d42f7be4abbb50b2e3b6a89589c5399201a3dc1fd7cfa72d412afdb2f86" + diff --git a/recipes/pprint/all/conanfile.py b/recipes/pprint/all/conanfile.py new file mode 100644 index 0000000000000..bff4a1689bd94 --- /dev/null +++ b/recipes/pprint/all/conanfile.py @@ -0,0 +1,48 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class PprintConan(ConanFile): + name = "pprint" + homepage = "https://github.com/p-ranav/pprint" + url = "https://github.com/conan-io/conan-center-index" + description = "Pretty Printer for Modern C++" + license = "MIT" + settings = "os", "compiler" + topics = ("conan", "pprint", "pretty", "printer") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + + min_compiler_version = { + "gcc": 7, + "clang": 7, + "apple-clang": 10, + "Visual Studio": 15, + }.get(str(self.settings.compiler), None) + + if min_compiler_version: + if tools.Version(self.settings.compiler.version) < min_compiler_version: + raise ConanInvalidConfiguration("The compiler does not support c++17") + else: + self.output.warn("pprint needs a c++17 capable compiler") + + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") + self.copy(pattern="*.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + + def package_id(self): + self.info.header_only() diff --git a/recipes/pprint/all/test_package/CMakeLists.txt b/recipes/pprint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3572b806e9a79 --- /dev/null +++ b/recipes/pprint/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/pprint/all/test_package/conanfile.py b/recipes/pprint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/pprint/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pprint/all/test_package/test_package.cpp b/recipes/pprint/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e286b74298d11 --- /dev/null +++ b/recipes/pprint/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include +#include + +int main() { + pprint::PrettyPrinter printer(std::cout); + printer.print(std::vector>{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); + + printer.compact(true); + printer.print(std::set>{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); + + return 0; +} diff --git a/recipes/pprint/config.yml b/recipes/pprint/config.yml new file mode 100644 index 0000000000000..d25f7a4b69da5 --- /dev/null +++ b/recipes/pprint/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.1": + folder: "all" diff --git a/recipes/pranav-csv2/all/conandata.yml b/recipes/pranav-csv2/all/conandata.yml new file mode 100644 index 0000000000000..e65dccae90167 --- /dev/null +++ b/recipes/pranav-csv2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1": + url: "https://github.com/p-ranav/csv2/archive/refs/tags/v0.1.tar.gz" + sha256: "e185d0378a95edb2ad0f2473970d8fe8579c87326640340d42bdf6327fd96791" diff --git a/recipes/pranav-csv2/all/conanfile.py b/recipes/pranav-csv2/all/conanfile.py new file mode 100644 index 0000000000000..f73a81dd87306 --- /dev/null +++ b/recipes/pranav-csv2/all/conanfile.py @@ -0,0 +1,100 @@ +import os +import functools +import textwrap + +from conans.errors import ConanInvalidConfiguration +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + +class PranavCSV2Conan(ConanFile): + name = "pranav-csv2" + license = "MIT" + description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" + topics = ("csv", "iterator", "header-only", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/csv2" + settings = "os", "arch", "compiler", "build_type", + generators = "cmake", + no_copy_source = True + + _compiler_required_cpp11 = { + "Visual Studio": "16", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, "11") + + minimum_version = self._compiler_required_cpp11.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++11, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{0} requires C++11. Your compiler is unknown. Assuming it supports C++11.".format(self.name)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(source_folder=self._source_subfolder) + return cmake + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + "conan-official-{}-targets.cmake".format(self.name)) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + def package(self): + self.copy("LICENSE*", "licenses", self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"csv2": "csv2::csv2"} + ) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "csv2") + self.cpp_info.set_property("cmake_target_name", "csv2::csv2") + + self.cpp_info.filenames["cmake_find_package"] = "csv2" + self.cpp_info.filenames["cmake_find_package_multi"] = "csv2" + self.cpp_info.names["cmake_find_package"] = "csv2" + self.cpp_info.names["cmake_find_package_multi"] = "csv2" + + self.cpp_info.builddirs.append(self._module_subfolder) + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/pranav-csv2/all/test_package/CMakeLists.txt b/recipes/pranav-csv2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f958b282d05ea --- /dev/null +++ b/recipes/pranav-csv2/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(csv2 CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} csv2) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/pranav-csv2/all/test_package/conanfile.py b/recipes/pranav-csv2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0197f07f63c5d --- /dev/null +++ b/recipes/pranav-csv2/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class DawHeaderLibrariesTestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pranav-csv2/all/test_package/test_package.cpp b/recipes/pranav-csv2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6119ae1a3e0f9 --- /dev/null +++ b/recipes/pranav-csv2/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "csv2/reader.hpp" + +int main() { + csv2::Reader< + csv2::delimiter<','>, + csv2::quote_character<'"'>, + csv2::first_row_is_header, + csv2::trim_policy::trim_whitespace> csv; + + csv.rows(); + + return 0; +} diff --git a/recipes/pranav-csv2/config.yml b/recipes/pranav-csv2/config.yml new file mode 100644 index 0000000000000..7a80eeb3e9b32 --- /dev/null +++ b/recipes/pranav-csv2/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1": + folder: all diff --git a/recipes/premake/5.x/conandata.yml b/recipes/premake/5.x/conandata.yml new file mode 100644 index 0000000000000..d96239dcf6113 --- /dev/null +++ b/recipes/premake/5.x/conandata.yml @@ -0,0 +1,14 @@ +sources: + "5.0.0-alpha15": + url: "https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-src.zip" + sha256: "880f56e7cb9f4945d1cb879f059189462c1b7bf62ef43ac7d25842dfb177dd53" + "5.0.0-alpha14": + url: "https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-src.zip" + sha256: "7c9fa4488156625c819dd03f2b48bfd4712fbfabdc2b5768e8c7f52dd7d16608" +patches: + "5.0.0-alpha15": + - patch_file: "patches/0001-5.0.0-alpha15-mingw.patch" + base_path: "source_subfolder" + "5.0.0-alpha14": + - patch_file: "patches/0001-5.0.0-alpha14-mingw.patch" + base_path: "source_subfolder" diff --git a/recipes/premake/5.x/conanfile.py b/recipes/premake/5.x/conanfile.py new file mode 100644 index 0000000000000..f0834e0449cd2 --- /dev/null +++ b/recipes/premake/5.x/conanfile.py @@ -0,0 +1,125 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild +from conans.errors import ConanInvalidConfiguration +import glob +import os +import re + + +class PremakeConan(ConanFile): + name = "premake" + topics = ("conan", "premake", "build", "build-systems") + description = "Describe your software project just once, using Premake's simple and easy to read syntax, and build it everywhere" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://premake.github.io" + license = "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + exports_sources = "patches/**" + options = { + "lto": [True, False], + } + default_options = { + "lto": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def config_options(self): + if self.settings.os != "Windows" or self.settings.compiler == "Visual Studio": + del self.options.lto + + def validate(self): + if hasattr(self, 'settings_build') and tools.cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross-building not implemented") + + @property + def _msvc_version(self): + return { + "12": "2013", + "14": "2015", + "15": "2017", + "16": "2019", + }.get(str(self.settings.compiler.version), "2017") + + @property + def _msvc_build_dirname(self): + return "vs{}".format(self._msvc_version) + + def _version_info(self, version): + res = [] + for p in re.split("[.-]|(alpha|beta)", version): + if p is None: + continue + try: + res.append(int(p)) + continue + except ValueError: + res.append(p) + return tuple(res) + + @property + def _gmake_directory_name_prefix(self): + if self._version_info(self.version) <= self._version_info("5.0.0-alpha14"): + return "gmake" + else: + return "gmake2" + + @property + def _gmake_platform(self): + return { + "FreeBSD": "bsd", + "Windows": "windows", + "Linux": "unix", + "Macos": "macosx", + }[str(self.settings.os)] + + @property + def _gmake_build_dirname(self): + return "{}.{}".format(self._gmake_directory_name_prefix, self._gmake_platform) + + @property + def _gmake_config(self): + build_type = "debug" if self.settings.build_type == "Debug" else "release" + if self.settings.os == "Windows": + arch = { + "x86": "x86", + "x86_64": "x64", + }[str(self.settings.arch)] + config = "{}_{}".format(build_type, arch) + else: + config = build_type + return config + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if self.options.get_safe("lto", None) == False: + for fn in glob.glob(os.path.join(self._source_subfolder, "build", self._gmake_build_dirname, "*.make")): + tools.replace_in_file(fn, "-flto", "", strict=False) + + def build(self): + self._patch_sources() + if self.settings.compiler == "Visual Studio": + with tools.chdir(os.path.join(self._source_subfolder, "build", self._msvc_build_dirname)): + msbuild = MSBuild(self) + msbuild.build("Premake5.sln", platforms={"x86": "Win32", "x86_64": "x64"}) + else: + with tools.chdir(os.path.join(self._source_subfolder, "build", self._gmake_build_dirname)): + env_build = AutoToolsBuildEnvironment(self) + env_build.make(target="Premake5", args=["verbose=1", "config={}".format(self._gmake_config)]) + + def package(self): + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*premake5.exe", dst="bin", keep_path=False) + self.copy(pattern="*premake5", dst="bin", keep_path=False) + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch b/recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch new file mode 100644 index 0000000000000..0dd121be8b2ae --- /dev/null +++ b/recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch @@ -0,0 +1,72 @@ +--- a/contrib/curl/lib/select.h ++++ b/contrib/curl/lib/select.h +@@ -36,7 +36,8 @@ + + #if !defined(HAVE_STRUCT_POLLFD) && \ + !defined(HAVE_SYS_POLL_H) && \ +- !defined(HAVE_POLL_H) ++ !defined(HAVE_POLL_H) && \ ++ !defined(POLLIN) + + #define POLLIN 0x01 + #define POLLPRI 0x02 +--- src/host/os_isdir.c ++++ src/host/os_isdir.c +@@ -9,7 +9,7 @@ + #include "premake.h" + + #ifdef _WIN32 +-#include ++#include + #endif + + int os_isdir(lua_State* L) +--- src/host/os_uuid.c ++++ src/host/os_uuid.c +@@ -7,7 +7,7 @@ + #include "premake.h" + + #if PLATFORM_WINDOWS +-#include ++#include + #endif + + +--- build/gmake.windows/Premake5.make ++++ build/gmake.windows/Premake5.make +@@ -22,7 +22,7 @@ + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -flto -O3 -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -flto -O3 -Wall -Wextra -fno-stack-protector + ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +- LIBS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 ++ LIBS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -flto -s + LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +@@ -49,7 +49,7 @@ ifeq ($(config),release_x64) + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -flto -O3 -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -flto -O3 -Wall -Wextra -fno-stack-protector + ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +- LIBS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 ++ LIBS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -flto -s + LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +@@ -76,7 +76,7 @@ + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra + ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +- LIBS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 ++ LIBS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 + LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +@@ -103,7 +103,7 @@ + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra + ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +- LIBS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 ++ LIBS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) diff --git a/recipes/premake/5.x/patches/0001-5.0.0-alpha15-mingw.patch b/recipes/premake/5.x/patches/0001-5.0.0-alpha15-mingw.patch new file mode 100644 index 0000000000000..3a7db692b8b86 --- /dev/null +++ b/recipes/premake/5.x/patches/0001-5.0.0-alpha15-mingw.patch @@ -0,0 +1,72 @@ +--- a/contrib/curl/lib/select.h ++++ b/contrib/curl/lib/select.h +@@ -36,7 +36,8 @@ + + #if !defined(HAVE_STRUCT_POLLFD) && \ + !defined(HAVE_SYS_POLL_H) && \ +- !defined(HAVE_POLL_H) ++ !defined(HAVE_POLL_H) && \ ++ !defined(POLLIN) + + #define POLLIN 0x01 + #define POLLPRI 0x02 +--- src/host/os_isdir.c ++++ src/host/os_isdir.c +@@ -9,7 +9,7 @@ + #include "premake.h" + + #ifdef _WIN32 +-#include ++#include + #endif + + int os_isdir(lua_State* L) +--- src/host/os_uuid.c ++++ src/host/os_uuid.c +@@ -7,7 +7,7 @@ + #include "premake.h" + + #if PLATFORM_WINDOWS +-#include ++#include + #endif + + +--- build/gmake2.windows/Premake5.make ++++ build/gmake2.windows/Premake5.make +@@ -38,7 +38,7 @@ + DEFINES += -DPREMAKE_COMPRESSION -DCURL_STATICLIB -DPREMAKE_CURL -DNDEBUG + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -flto -O3 -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -flto -O3 -Wall -Wextra -fno-stack-protector +-LIBS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion ++LIBS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -flto -s + +@@ -49,7 +49,7 @@ + DEFINES += -DPREMAKE_COMPRESSION -DCURL_STATICLIB -DPREMAKE_CURL -DNDEBUG + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -flto -O3 -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -flto -O3 -Wall -Wextra -fno-stack-protector +-LIBS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion ++LIBS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -flto -s + +@@ -60,7 +60,7 @@ + DEFINES += -DPREMAKE_COMPRESSION -DCURL_STATICLIB -DPREMAKE_CURL -D_DEBUG + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra +-LIBS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion ++LIBS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 + +@@ -71,7 +71,7 @@ + DEFINES += -DPREMAKE_COMPRESSION -DCURL_STATICLIB -DPREMAKE_CURL -D_DEBUG + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra +-LIBS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion ++LIBS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 + LDDEPS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib + ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + diff --git a/recipes/premake/5.x/test_package/conanfile.py b/recipes/premake/5.x/test_package/conanfile.py new file mode 100644 index 0000000000000..c300eaeb0abb7 --- /dev/null +++ b/recipes/premake/5.x/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self.settings): + self.run("premake5 --version", run_environment=True) diff --git a/recipes/premake/config.yml b/recipes/premake/config.yml new file mode 100644 index 0000000000000..e529cc98c1a62 --- /dev/null +++ b/recipes/premake/config.yml @@ -0,0 +1,5 @@ +versions: + "5.0.0-alpha14": + folder: "5.x" + "5.0.0-alpha15": + folder: "5.x" diff --git a/recipes/pretty-name/all/conandata.yml b/recipes/pretty-name/all/conandata.yml new file mode 100644 index 0000000000000..c7744bae01900 --- /dev/null +++ b/recipes/pretty-name/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/Rechip/pretty-name/archive/refs/tags/v1.0.0.zip" + sha256: "cb439a856df8042a7daacd4eafbf68e437ca439c46777f7804add67be7d6ddd8" diff --git a/recipes/pretty-name/all/conanfile.py b/recipes/pretty-name/all/conanfile.py new file mode 100644 index 0000000000000..994d455d12104 --- /dev/null +++ b/recipes/pretty-name/all/conanfile.py @@ -0,0 +1,58 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class PrettyNameConan(ConanFile): + name = "pretty-name" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Rechip/pretty-name" + description = "An easy and consistent way how to get type names in C++" + topics = ("cpp", "typename") + settings = ["compiler"] + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + self.copy(pattern="*", dst="include", + src=os.path.join(self._source_subfolder, "include")) + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "14") + minimum_version = self._minimum_compilers_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warn( + "pretty-name requires C++14. Your compiler is unknown. Assuming it supports C++14.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + "pretty-name requires C++14, which your compiler does not support.") + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "pretty-name" + self.cpp_info.names["cmake_find_package_multi"] = "pretty-name" diff --git a/recipes/pretty-name/all/test_package/CMakeLists.txt b/recipes/pretty-name/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..036c165068273 --- /dev/null +++ b/recipes/pretty-name/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pretty-name CONFIG REQUIRED) +add_executable(${PROJECT_NAME} src/test.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pretty-name::pretty-name) + +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) diff --git a/recipes/pretty-name/all/test_package/conanfile.py b/recipes/pretty-name/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/pretty-name/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + self.cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pretty-name/all/test_package/src/test.cpp b/recipes/pretty-name/all/test_package/src/test.cpp new file mode 100644 index 0000000000000..8c761f54ec31c --- /dev/null +++ b/recipes/pretty-name/all/test_package/src/test.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +struct Test { + int a; + int b; +}; + +namespace Namespace { +template +struct Test { + A a; + B b; +}; +} // namespace Namespace + +int main() { + std::cout << pretty_name::pretty_name() << std::endl; + std::cout << pretty_name::pretty_name>() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/pretty-name/config.yml b/recipes/pretty-name/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/pretty-name/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/pro-mdnsd/all/CMakeLists.txt b/recipes/pro-mdnsd/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/pro-mdnsd/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..f4bf0e41133c5 --- /dev/null +++ b/recipes/pro-mdnsd/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.8.4": + url: "https://github.com/Pro/mdnsd/archive/v0.8.4.tar.gz" + sha256: "e2d740d59b71b1b4478471c71fe5c2c96eea9296d42385b6e6525526a487d158" +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 new file mode 100644 index 0000000000000..8d1745ad0e35c --- /dev/null +++ b/recipes/pro-mdnsd/all/conanfile.py @@ -0,0 +1,110 @@ +from conans import ConanFile, CMake, tools +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class mdnsdConan(ConanFile): + name = "pro-mdnsd" + 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" + topics = ("dns", "daemon", "multicast", "embedded", "c") + + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "shared": [True, False], + "compile_as_cpp": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "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"]) + + 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 not self.options.compile_as_cpp: + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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 + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + 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) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"libmdnsd": "mdnsd::mdnsd"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + 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.libs = ["mdnsd"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "mdnsd" + self.cpp_info.names["cmake_find_package_multi"] = "mdnsd" + 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/pro-mdnsd/all/patches/0001-cmake-install-bundle.patch b/recipes/pro-mdnsd/all/patches/0001-cmake-install-bundle.patch new file mode 100644 index 0000000000000..d1d588e9b7f85 --- /dev/null +++ b/recipes/pro-mdnsd/all/patches/0001-cmake-install-bundle.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,7 +61,7 @@ configure_package_config_file(mdnsdConfig.cmake.in mdnsdConfig.cmake + install( + TARGETS mdnsd mquery + EXPORT mdnsd +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + install( + FILES "${PROJECT_SOURCE_DIR}/LICENSE" diff --git a/recipes/pro-mdnsd/all/test_package/CMakeLists.txt b/recipes/pro-mdnsd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ff7f7e8ca3d71 --- /dev/null +++ b/recipes/pro-mdnsd/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +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) diff --git a/recipes/pro-mdnsd/all/test_package/conanfile.py b/recipes/pro-mdnsd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pro-mdnsd/all/test_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/pro-mdnsd/all/test_package/test_package.c b/recipes/pro-mdnsd/all/test_package/test_package.c new file mode 100644 index 0000000000000..7153392f78afc --- /dev/null +++ b/recipes/pro-mdnsd/all/test_package/test_package.c @@ -0,0 +1,129 @@ +#include "libmdnsd/mdnsd.h" + +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#include +#include + +static int my_inet_pton(int af, const char *src, void *dst) { + struct sockaddr_storage ss; + int size = sizeof(ss); + char src_copy[INET6_ADDRSTRLEN + 1]; + + ZeroMemory(&ss, sizeof(ss)); + /* stupid non-const API */ + strncpy(src_copy, src, INET6_ADDRSTRLEN + 1); + src_copy[INET6_ADDRSTRLEN] = 0; + + if (WSAStringToAddress(src_copy, af, NULL, (struct sockaddr *)&ss, &size) == + 0) { + switch (af) { + case AF_INET: + *(struct in_addr *)dst = ((struct sockaddr_in *)&ss)->sin_addr; + return 1; + case AF_INET6: + *(struct in6_addr *)dst = ((struct sockaddr_in6 *)&ss)->sin6_addr; + return 1; + } + } + return 0; +} + +#define INET_PTON my_inet_pton +#define CLOSESOCKET(S) closesocket((SOCKET)S) +#define ssize_t int +#else +#include +#include +#include +#include +#include +#define INET_PTON inet_pton +#define CLOSESOCKET(S) close(S) +#endif + +void cross_sleep(int seconds) { +#ifdef _WIN32 + Sleep(seconds); +#else + sleep(seconds); +#endif +} + +static void socket_set_nonblocking(int sockfd) { +#ifdef _WIN32 + u_long iMode = 1; + ioctlsocket(sockfd, FIONBIO, &iMode); +#else + int opts = fcntl(sockfd, F_GETFL); + fcntl(sockfd, F_SETFL, opts | O_NONBLOCK); +#endif +} + +int msock(void) { +#ifdef _WIN32 + WSADATA Data; + WSAStartup(MAKEWORD(2, 2), &Data); +#endif + int s, flag = 1, ittl = 255; + struct sockaddr_in in; + struct ip_mreq mc; + unsigned char ttl = 255; // send to any reachable net, not only the subnet + + memset(&in, 0, sizeof(in)); + in.sin_family = AF_INET; + in.sin_port = htons(5353); + in.sin_addr.s_addr = 0; + + if ((s = (int)socket(AF_INET, SOCK_DGRAM, 0)) < 0) + return 0; + +#ifdef SO_REUSEPORT + setsockopt(s, SOL_SOCKET, SO_REUSEPORT, (char *)&flag, sizeof(flag)); +#endif + setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&flag, sizeof(flag)); + if (bind(s, (struct sockaddr *)&in, sizeof(in))) { + CLOSESOCKET(s); + return 0; + } + + mc.imr_multiaddr.s_addr = inet_addr("224.0.0.251"); + mc.imr_interface.s_addr = htonl(INADDR_ANY); +#ifndef _WIN32 + setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mc, sizeof(mc)); + setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&ttl, sizeof(ttl)); + setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&ittl, sizeof(ittl)); +#endif + + socket_set_nonblocking(s); + + return s; +} + +int main() { + + mdns_daemon_t *daemon = mdnsd_new(QCLASS_IN, 1000); + if (msock() == 0) { + printf("can't create socket: %s\n", strerror(errno)); + return 1; + } + + cross_sleep(1); + mdnsd_shutdown(daemon); + if (write(0, "\0", 1) == -1) { + printf("Could not write zero byte to socket\n"); + } + mdnsd_free(daemon); + + return 0; +} diff --git a/recipes/pro-mdnsd/config.yml b/recipes/pro-mdnsd/config.yml new file mode 100644 index 0000000000000..c7d05600a57c0 --- /dev/null +++ b/recipes/pro-mdnsd/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.4": + folder: all diff --git a/recipes/procxx-boost-ext-simd/all/conandata.yml b/recipes/procxx-boost-ext-simd/all/conandata.yml new file mode 100644 index 0000000000000..71a0eec18347e --- /dev/null +++ b/recipes/procxx-boost-ext-simd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.17.6.0": + url: "https://github.com/procxx/boost.simd/archive/refs/tags/v4.17.6.0.tar.gz" + sha256: "31E9847BAE2FD38C86AF891EA17223E1F5EB385F327FABED4B40DA3B37C8218A" diff --git a/recipes/procxx-boost-ext-simd/all/conanfile.py b/recipes/procxx-boost-ext-simd/all/conanfile.py new file mode 100644 index 0000000000000..beacde6952502 --- /dev/null +++ b/recipes/procxx-boost-ext-simd/all/conanfile.py @@ -0,0 +1,61 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class ProCxxBoostExSimdConan(ConanFile): + name = "procxx-boost-ext-simd" + description = ("Portable SIMD computation library - was proposed as a " + "Boost library" + ) + homepage = "https://github.com/procxx/boost.simd" + topics = ("conan", "boost", "simd") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _min_cppstd(self): + return "11" + + def requirements(self): + self.requires("boost/1.76.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._min_cppstd) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_folder = "boost.simd-" + self.version + os.rename(extracted_folder, self._source_subfolder) + + def package(self): + self.copy(pattern="*", dst="include", + src=os.path.join(self._source_subfolder, "include")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + # this technique was inspired by conan-center's "boost-ex-ut" recipe, + # and has been fixed to use the upstream Capitalized `Boost::` + # namespace for components + self.cpp_info.names["cmake_find_package"] = "Boost" + self.cpp_info.names["cmake_find_package_multi"] = "Boost" + + # The original find_package() name here: + self.cpp_info.filenames["cmake_find_package"] = "Boost.SIMD" + self.cpp_info.filenames["cmake_find_package_multi"] = "Boost.SIMD" + self.cpp_info.components["SIMD"].names["cmake_find_package"] = "SIMD" + self.cpp_info.components["SIMD"].names["cmake_find_package_multi"] = \ + "SIMD" + self.cpp_info.components["SIMD"].requires = ["boost::headers"] diff --git a/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt b/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..36ff666d5a74f --- /dev/null +++ b/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.1.0) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Boost.SIMD REQUIRED) + +# FIXME: components from Boost.SIMD (target Boost::SIMD) don't work. +# It should be: +# find_package(BOOST REQUIRED COMPONENTS SIMD) +# See https://github.com/conan-io/conan-center-index/issues/6682 for details. +find_package(Boost REQUIRED COMPONENTS date_time) # COMPONENTS SIMD) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} Boost::headers Boost::SIMD) +# FIXME: recipe should transitively sets proper minimum cxx standard. +# See https://github.com/conan-io/conan/issues/7772 about revising cxx std model. +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/procxx-boost-ext-simd/all/test_package/conanfile.py b/recipes/procxx-boost-ext-simd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3be12b2d6b0c5 --- /dev/null +++ b/recipes/procxx-boost-ext-simd/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class ProCxxBoostExSimdConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp b/recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ddf7bb1fb383a --- /dev/null +++ b/recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +// This source file should check the imported headers and do the simple things, +// like querying library version. It doesn't intended to do some lengthy work +// or running library tests - just only check that package is properly created. +// See docs for details: +// https://docs.conan.io/en/latest/creating_packages/getting_started.html#the-test-package-folder +#include +#include +#include + +namespace bs = boost::simd; + +int main() +{ + using namespace boost::date_time; + bs::pack p{1.f,2.f,3.f,4.f}; + std::cout << "Boost.SIMD test from README.md : " << p + 10*p << "\n"; + std::cout << "Boost.date_time interop test: " << boost::gregorian::date(2021, Aug, 4) << "\n"; + return 0; +} diff --git a/recipes/procxx-boost-ext-simd/config.yml b/recipes/procxx-boost-ext-simd/config.yml new file mode 100644 index 0000000000000..6a9af399c7e0e --- /dev/null +++ b/recipes/procxx-boost-ext-simd/config.yml @@ -0,0 +1,3 @@ +versions: + 4.17.6.0: + folder: all diff --git a/recipes/proj/all/conandata.yml b/recipes/proj/all/conandata.yml new file mode 100644 index 0000000000000..6a5d57f6c5cd3 --- /dev/null +++ b/recipes/proj/all/conandata.yml @@ -0,0 +1,55 @@ +sources: + "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" + "7.2.1": + url: "https://github.com/OSGeo/PROJ/releases/download/7.2.1/proj-7.2.1.tar.gz" + sha256: "b384f42e5fb9c6d01fe5fa4d31da2e91329668863a684f97be5d4760dbbf0a14" + "6.3.1": + url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz" + sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8" +patches: + "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" + patch_description: "Use cmake targets" + "7.2.1": + - patch_file: "patches/0001-use-cmake-targets-7.2.1.patch" + patch_type: "conan" + patch_description: "Use cmake targets" + "6.3.1": + - patch_file: "patches/0001-use-cmake-targets-6.x.x.patch" + patch_type: "conan" + patch_description: "Use cmake targets" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py new file mode 100644 index 0000000000000..d65efd41b63cf --- /dev/null +++ b/recipes/proj/all/conanfile.py @@ -0,0 +1,227 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, collect_libs, rm, rename +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.54.0" + + +class ProjConan(ConanFile): + name = "proj" + description = "Cartographic Projections and Coordinate Transformations Library." + license = "MIT" + topics = "dsp", "proj", "proj4", "projections", "gis", "geospatial" + homepage = "https://proj.org" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threadsafe": [True, False], + "with_tiff": [True, False], + "with_curl": [True, False], + "build_executables": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": True, + "with_tiff": True, + "with_curl": True, + "build_executables": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "7.0.0": + del self.options.with_tiff + del self.options.with_curl + + 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("nlohmann_json/3.11.2") + self.requires("sqlite3/3.41.1", run=can_run(self)) + if self.options.get_safe("with_tiff"): + self.requires("libtiff/4.4.0") + if self.options.get_safe("with_curl"): + self.requires("libcurl/7.88.1") + + def build_requirements(self): + if not can_run(self): + self.tool_requires("sqlite3/3.41.1") + + 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 can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["USE_THREAD"] = self.options.threadsafe + tc.variables["BUILD_CCT"] = self.options.build_executables + tc.variables["BUILD_CS2CS"] = self.options.build_executables + tc.variables["BUILD_GEOD"] = self.options.build_executables + tc.variables["BUILD_GIE"] = self.options.build_executables + tc.variables["BUILD_PROJ"] = self.options.build_executables + tc.variables["BUILD_PROJINFO"] = self.options.build_executables + if Version(self.version) < "9.1.0": + tc.variables["PROJ_DATA_SUBDIR"] = "res" + if Version(self.version) < "7.0.0": + tc.variables["PROJ_TESTS"] = False + tc.variables["BUILD_LIBPROJ_SHARED"] = self.options.shared + tc.variables["ENABLE_LTO"] = False + tc.variables["JNI_SUPPORT"] = False + else: + tc.variables["ENABLE_TIFF"] = self.options.with_tiff + tc.variables["ENABLE_CURL"] = self.options.with_curl + tc.variables["BUILD_TESTING"] = False + tc.variables["ENABLE_IPO"] = False + tc.variables["BUILD_PROJSYNC"] = self.options.build_executables and self.options.with_curl + if Version(self.version) >= "8.1.0": + tc.variables["NLOHMANN_JSON_ORIGIN"] = "external" + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + 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)") + + # 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)", + "") + + # Aggressive workaround against SIP on macOS, to handle sqlite3 executable + # linked to shared sqlite3 lib + if is_apple_os(self): + if Version(self.version) < "8.1.0": + cmake_sqlite_call = "CMakeLists.txt" + pattern = "${EXE_SQLITE3}" + else: + cmake_sqlite_call = "generate_proj_db.cmake" + pattern = "\"${EXE_SQLITE3}\"" + if can_run(self): + lib_paths = self.dependencies["sqlite3"].cpp_info.libdirs + else: + lib_paths = self.dependencies.build["sqlite3"].cpp_info.libdirs + replace_in_file(self, + os.path.join(self.source_folder, "data", cmake_sqlite_call), + f"COMMAND {pattern}", + f"COMMAND ${{CMAKE_COMMAND}} -E env \"DYLD_LIBRARY_PATH={':'.join(lib_paths)}\" {pattern}" + ) + + # unvendor nlohmann_json + if Version(self.version) < "8.1.0": + rmdir(self, os.path.join(self.source_folder, "include", "proj", "internal", "nlohmann")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + # recover the data ... 9.1.0 saves into share/proj rather than res directly + # the new PROJ_DATA_PATH can't seem to be controlled from conan. + if Version(self.version) >= "9.1.0": + rename(self, src=os.path.join(self.package_folder, "share", "proj"), dst=os.path.join(self.package_folder, "res")) + # delete the rest of the deployed data + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + + def package_info(self): + proj_version = Version(self.version) + cmake_config_filename = "proj" if proj_version >= "7.0.0" else "proj4" + cmake_namespace = "PROJ" if proj_version >= "7.0.0" else "PROJ4" + self.cpp_info.set_property("cmake_file_name", cmake_config_filename) + self.cpp_info.set_property("cmake_target_name", f"{cmake_namespace}::proj") + self.cpp_info.set_property("pkg_config_name", "proj") + self.cpp_info.components["projlib"].set_property("cmake_target_name", f"{cmake_namespace}::proj") + self.cpp_info.components["projlib"].set_property("pkg_config_name", "proj") + + self.cpp_info.components["projlib"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["projlib"].system_libs.append("m") + if self.options.threadsafe: + self.cpp_info.components["projlib"].system_libs.append("pthread") + elif self.settings.os == "Windows": + if proj_version >= "7.0.0": + self.cpp_info.components["projlib"].system_libs.append("shell32") + if proj_version >= "7.1.0": + self.cpp_info.components["projlib"].system_libs.append("ole32") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["projlib"].system_libs.append(libcxx) + self.cpp_info.components["projlib"].requires.extend(["nlohmann_json::nlohmann_json", "sqlite3::sqlite3"]) + if self.options.get_safe("with_tiff"): + self.cpp_info.components["projlib"].requires.append("libtiff::libtiff") + if self.options.get_safe("with_curl"): + self.cpp_info.components["projlib"].requires.append("libcurl::libcurl") + if Version(self.version) < "8.2.0": + if self.options.shared and is_msvc(self): + self.cpp_info.components["projlib"].defines.append("PROJ_MSVC_DLL_IMPORT") + else: + if not self.options.shared: + self.cpp_info.components["projlib"].defines.append("PROJ_DLL=") + + # see https://proj.org/usage/environmentvars.html#envvar-PROJ_DATA + proj_data_env_var_name = "PROJ_LIB" if Version(self.version) < "9.1.0" else "PROJ_DATA" + res_path = os.path.join(self.package_folder, "res") + self.runenv_info.prepend_path(proj_data_env_var_name, res_path) + if self.options.build_executables: + self.buildenv_info.prepend_path(proj_data_env_var_name, res_path) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = cmake_config_filename + self.cpp_info.filenames["cmake_find_package_multi"] = cmake_config_filename + self.cpp_info.names["cmake_find_package"] = cmake_namespace + self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace + self.cpp_info.components["projlib"].names["cmake_find_package"] = "proj" + self.cpp_info.components["projlib"].names["cmake_find_package_multi"] = "proj" + if Version(self.version) < "9.1.0": + self.env_info.PROJ_LIB.append(res_path) + else: + self.env_info.PROJ_DATA.append(res_path) + if self.options.build_executables: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch b/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch new file mode 100644 index 0000000000000..6bec96d49f9b3 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch @@ -0,0 +1,34 @@ +diff -ru a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2020-02-10 17:29:51.000000000 +0800 ++++ b/CMakeLists.txt 2022-12-14 21:05:09.821289235 +0800 +@@ -114,6 +114,8 @@ + include(ProjMac) + include(policies) + ++find_package(nlohmann_json REQUIRED) ++ + ################################################################################ + # Check for sqlite3 + ################################################################################ +diff -ru a/src/lib_proj.cmake b/src/lib_proj.cmake +--- a/src/lib_proj.cmake 2019-12-29 06:23:06.000000000 +0800 ++++ b/src/lib_proj.cmake 2022-12-14 20:58:56.856752193 +0800 +@@ -311,7 +311,7 @@ + source_group("Source Files\\ISO19111" + FILES ${SRC_LIBPROJ_ISO19111}) + +-include_directories(${CMAKE_SOURCE_DIR}/include) ++include_directories(${PROJ4_SOURCE_DIR}/include) + + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + source_group("CMake Files" FILES CMakeLists.txt) +@@ -440,8 +440,7 @@ + target_link_libraries(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT}) + endif() + +-include_directories(${SQLITE3_INCLUDE_DIR}) +-target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) ++target_link_libraries(${PROJ_CORE_TARGET} nlohmann_json::nlohmann_json SQLite::SQLite3) + + if(MSVC AND BUILD_LIBPROJ_SHARED) + target_compile_definitions(${PROJ_CORE_TARGET} diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch new file mode 100644 index 0000000000000..6ee348ac9ddd0 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch @@ -0,0 +1,37 @@ +diff -ru a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2020-12-27 02:57:21.000000000 +0800 ++++ b/CMakeLists.txt 2022-12-14 21:21:31.516729458 +0800 +@@ -121,6 +121,8 @@ + include(ProjMac) + include(policies) + ++find_package(nlohmann_json REQUIRED) ++ + ################################################################################ + # Check for sqlite3 + ################################################################################ +--- a/src/lib_proj.cmake ++++ b/src/lib_proj.cmake +@@ -414,19 +414,16 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) + target_link_libraries(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT}) + endif() + +-target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_INCLUDE_DIR}) +-target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) ++target_link_libraries(${PROJ_CORE_TARGET} nlohmann_json::nlohmann_json SQLite::SQLite3) + + if(TIFF_ENABLED) + target_compile_definitions(${PROJ_CORE_TARGET} PRIVATE -DTIFF_ENABLED) +- target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${TIFF_INCLUDE_DIR}) +- target_link_libraries(${PROJ_CORE_TARGET} ${TIFF_LIBRARY}) ++ target_link_libraries(${PROJ_CORE_TARGET} TIFF::TIFF) + endif() + + if(CURL_ENABLED) + target_compile_definitions(${PROJ_CORE_TARGET} PRIVATE -DCURL_ENABLED) +- target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${CURL_INCLUDE_DIR}) +- target_link_libraries(${PROJ_CORE_TARGET} ${CURL_LIBRARY}) ++ target_link_libraries(${PROJ_CORE_TARGET} CURL::libcurl) + endif() + + if(MSVC AND BUILD_SHARED_LIBS) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch new file mode 100644 index 0000000000000..8ce7c1895ee22 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch @@ -0,0 +1,31 @@ +--- a/src/lib_proj.cmake ++++ b/src/lib_proj.cmake +@@ -453,8 +453,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) +@@ -464,16 +463,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.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch new file mode 100644 index 0000000000000..c7cf8eab51037 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch @@ -0,0 +1,31 @@ +--- 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 new file mode 100644 index 0000000000000..6920410551838 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch @@ -0,0 +1,31 @@ +--- 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 new file mode 100644 index 0000000000000..ddd144b4ef122 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch @@ -0,0 +1,31 @@ +--- 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 new file mode 100644 index 0000000000000..e39909dc403a9 --- /dev/null +++ b/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch @@ -0,0 +1,13 @@ +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/all/test_package/CMakeLists.txt b/recipes/proj/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..68d47d66efc39 --- /dev/null +++ b/recipes/proj/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +add_executable(test_package test_package.c) +if(PROJ_VERSION_GE_7) + find_package(proj REQUIRED CONFIG) + target_link_libraries(test_package PRIVATE PROJ::proj) +else() + find_package(proj4 REQUIRED CONFIG) + target_link_libraries(test_package PRIVATE PROJ4::proj) +endif() diff --git a/recipes/proj/all/test_package/conanfile.py b/recipes/proj/all/test_package/conanfile.py new file mode 100644 index 0000000000000..69dbaead1cf8c --- /dev/null +++ b/recipes/proj/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version +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.variables["PROJ_VERSION_GE_7"] = Version(self.dependencies["proj"].ref.version) >= "7.0.0" + 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/proj/all/test_package/test_package.c b/recipes/proj/all/test_package/test_package.c new file mode 100644 index 0000000000000..3a5964a2652a9 --- /dev/null +++ b/recipes/proj/all/test_package/test_package.c @@ -0,0 +1,52 @@ +/* From PROJ quickstart */ + +#include +#include + +int main (void) { + PJ_CONTEXT *C; + PJ *P; + PJ* P_for_GIS; + PJ_COORD a, b; + + /* or you may set C=PJ_DEFAULT_CTX if you are sure you will */ + /* use PJ objects from only one thread */ + C = proj_context_create(); + + P = proj_create_crs_to_crs (C, + "EPSG:4326", + "+proj=utm +zone=32 +datum=WGS84", /* or EPSG:32632 */ + NULL); + + if (0==P) { + fprintf(stderr, "Oops\n"); + return 1; + } + + /* This will ensure that the order of coordinates for the input CRS */ + /* will be longitude, latitude, whereas EPSG:4326 mandates latitude, */ + /* longitude */ + P_for_GIS = proj_normalize_for_visualization(C, P); + if( 0 == P_for_GIS ) { + fprintf(stderr, "Oops\n"); + return 1; + } + proj_destroy(P); + P = P_for_GIS; + + /* a coordinate union representing Copenhagen: 55d N, 12d E */ + /* Given that we have used proj_normalize_for_visualization(), the order of */ + /* coordinates is longitude, latitude, and values are expressed in degrees. */ + a = proj_coord (12, 55, 0, 0); + + /* transform to UTM zone 32, then back to geographical */ + b = proj_trans (P, PJ_FWD, a); + printf ("easting: %.3f, northing: %.3f\n", b.enu.e, b.enu.n); + b = proj_trans (P, PJ_INV, b); + printf ("longitude: %g, latitude: %g\n", b.lp.lam, b.lp.phi); + + /* Clean up */ + proj_destroy (P); + proj_context_destroy (C); /* may be omitted in the single threaded case */ + return 0; +} diff --git a/recipes/proj/all/test_v1_package/CMakeLists.txt b/recipes/proj/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/proj/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/proj/all/test_v1_package/conanfile.py b/recipes/proj/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0a0d55e2ef660 --- /dev/null +++ b/recipes/proj/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["PROJ_VERSION_GE_7"] = tools.Version(self.deps_cpp_info["proj"].version) >= "7.0.0" + 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/config.yml b/recipes/proj/config.yml new file mode 100644 index 0000000000000..b8b070a608bed --- /dev/null +++ b/recipes/proj/config.yml @@ -0,0 +1,15 @@ +versions: + "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": + folder: "all" + "6.3.1": + folder: "all" diff --git a/recipes/prometheus-cpp/all/conandata.yml b/recipes/prometheus-cpp/all/conandata.yml new file mode 100644 index 0000000000000..a1e0c249c424c --- /dev/null +++ b/recipes/prometheus-cpp/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.1.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.1.0.tar.gz" + sha256: "397544fe91e183029120b4eebcfab24ed9ec833d15850aae78fd5db19062d13a" + "1.0.1": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.0.1.tar.gz" + sha256: "593e028d401d3298eada804d252bc38d8cab3ea1c9e88bcd72095281f85e6d16" + "1.0.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.0.0.tar.gz" + sha256: "07018db604ea3e61f5078583e87c80932ea10c300d979061490ee1b7dc8e3a41" + "0.12.3": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.12.3.tar.gz" + sha256: "e021e76e8e933672f1af0d223307282004f585a054354f8d894db39debddff8e" + "0.12.1": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.12.1.tar.gz" + sha256: "2102609457f812dbeaaafd55736461fd0538fc7e7568174b1cdec43399dbded4" + "0.11.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.11.0.tar.gz" + sha256: "aab4ef8342319f631969e01b8c41e355704847cbe76131cb1dd5ea1862000bda" +patches: + "0.11.0": + - patch_file: "patches/0001-include-limits.patch" diff --git a/recipes/prometheus-cpp/all/conanfile.py b/recipes/prometheus-cpp/all/conanfile.py new file mode 100644 index 0000000000000..77a024b271ec1 --- /dev/null +++ b/recipes/prometheus-cpp/all/conanfile.py @@ -0,0 +1,159 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc, check_min_vs + +import os + +required_conan_version = ">=1.53.0" + +class PrometheusCppConan(ConanFile): + name = "prometheus-cpp" + description = "Prometheus Client Library for Modern C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jupp0r/prometheus-cpp" + topics = ("metrics", "prometheus", "networking") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_pull": [True, False], + "with_push": [True, False], + "with_compression": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_pull": True, + "with_push": True, + "with_compression": True, + } + + @property + def _min_cppstd(self): + return 11 if Version(self.version) < "1.1.0" else 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.with_pull: + self.options.rm_safe("with_compression") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_pull: + self.requires("civetweb/1.16") + if self.options.with_push: + self.requires("libcurl/8.0.1") + if self.options.get_safe("with_compression"): + self.requires("zlib/1.2.13") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if Version(self.version) < "1.1.0": + return + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_THIRDPARTY_LIBRARIES"] = False + tc.variables["ENABLE_TESTING"] = False + tc.variables["OVERRIDE_CXX_STANDARD_FLAGS"] = not valid_min_cppstd(self, self._min_cppstd) + tc.variables["ENABLE_PULL"] = self.options.with_pull + tc.variables["ENABLE_PUSH"] = self.options.with_push + if self.options.with_pull: + tc.variables["ENABLE_COMPRESSION"] = self.options.with_compression + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "prometheus-cpp") + + self.cpp_info.components["prometheus-cpp-core"].set_property("cmake_target_name", "prometheus-cpp::core") + self.cpp_info.components["prometheus-cpp-core"].set_property("pkg_config_name", "prometheus-cpp-core") + self.cpp_info.components["prometheus-cpp-core"].libs = ["prometheus-cpp-core"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["prometheus-cpp-core"].system_libs = ["pthread", "rt"] + + if self.options.with_push: + self.cpp_info.components["prometheus-cpp-push"].set_property("cmake_target_name", "prometheus-cpp::push") + self.cpp_info.components["prometheus-cpp-push"].set_property("pkg_config_name", "prometheus-cpp-push") + self.cpp_info.components["prometheus-cpp-push"].libs = ["prometheus-cpp-push"] + self.cpp_info.components["prometheus-cpp-push"].requires = [ + "prometheus-cpp-core", + "libcurl::libcurl", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["prometheus-cpp-push"].system_libs = ["pthread", "rt"] + + if self.options.with_pull: + self.cpp_info.components["prometheus-cpp-pull"].set_property("cmake_target_name", "prometheus-cpp::pull") + self.cpp_info.components["prometheus-cpp-pull"].set_property("pkg_config_name", "prometheus-cpp-pull") + self.cpp_info.components["prometheus-cpp-pull"].libs = ["prometheus-cpp-pull"] + self.cpp_info.components["prometheus-cpp-pull"].requires = [ + "prometheus-cpp-core", + "civetweb::civetweb-cpp" + ] + if self.options.with_compression: + self.cpp_info.components["prometheus-cpp-pull"].requires.append("zlib::zlib") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["prometheus-cpp-pull"].system_libs = ["pthread", "rt"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["prometheus-cpp-core"].names["cmake_find_package"] = "core" + self.cpp_info.components["prometheus-cpp-core"].names["cmake_find_package_multi"] = "core" + if self.options.with_push: + self.cpp_info.components["prometheus-cpp-push"].names["cmake_find_package"] = "push" + self.cpp_info.components["prometheus-cpp-push"].names["cmake_find_package_multi"] = "push" + if self.options.with_pull: + self.cpp_info.components["prometheus-cpp-pull"].names["cmake_find_package"] = "pull" + self.cpp_info.components["prometheus-cpp-pull"].names["cmake_find_package_multi"] = "pull" diff --git a/recipes/prometheus-cpp/all/patches/0001-include-limits.patch b/recipes/prometheus-cpp/all/patches/0001-include-limits.patch new file mode 100644 index 0000000000000..d8d94b995659a --- /dev/null +++ b/recipes/prometheus-cpp/all/patches/0001-include-limits.patch @@ -0,0 +1,10 @@ +--- a/core/src/histogram.cc ++++ b/core/src/histogram.cc +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/prometheus-cpp/all/test_package/CMakeLists.txt b/recipes/prometheus-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0df7da5ba0a1f --- /dev/null +++ b/recipes/prometheus-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(prometheus-cpp CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE prometheus-cpp::push prometheus-cpp::pull) +if(${prometheus-cpp_VERSION} VERSION_LESS "1.1.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/prometheus-cpp/all/test_package/conanfile.py b/recipes/prometheus-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/prometheus-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/prometheus-cpp/all/test_package/test_package.cpp b/recipes/prometheus-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..eff7662ed887d --- /dev/null +++ b/recipes/prometheus-cpp/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +using namespace prometheus; + +int main(int argc, char** argv) { + auto registry = std::make_shared(); + auto& counter_family = BuildCounter() + .Name("time_running_seconds_total") + .Help("How many seconds is this server running?") + .Labels({{"label", "value"}}) + .Register(*registry); + auto& second_counter = counter_family.Add( + {{"another_label", "value"}, {"yet_another_label", "value"}}); + second_counter.Increment(); + return 0; +} diff --git a/recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt b/recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/prometheus-cpp/all/test_v1_package/conanfile.py b/recipes/prometheus-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/prometheus-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/prometheus-cpp/config.yml b/recipes/prometheus-cpp/config.yml new file mode 100644 index 0000000000000..3bfa3902dafa5 --- /dev/null +++ b/recipes/prometheus-cpp/config.yml @@ -0,0 +1,13 @@ +versions: + "1.1.0": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all + "0.12.3": + folder: all + "0.12.1": + folder: all + "0.11.0": + folder: all diff --git a/recipes/proposal/all/conandata.yml b/recipes/proposal/all/conandata.yml new file mode 100644 index 0000000000000..0fd8a065192d9 --- /dev/null +++ b/recipes/proposal/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "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 new file mode 100644 index 0000000000000..99caccadb2b21 --- /dev/null +++ b/recipes/proposal/all/conanfile.py @@ -0,0 +1,116 @@ +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, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class PROPOSALConan(ConanFile): + name = "proposal" + homepage = "https://github.com/tudo-astroparticlephysics/PROPOSAL" + license = "LGPL-3.0" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + description = "monte Carlo based lepton and photon propagator" + topics = ("propagator", "lepton", "photon", "stochastic") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_python": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_python": False, + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5", + } + + 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 requirements(self): + # cubicinterpolation: headers are transitively included, and function calls are made + # 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) + # nlohmann_json: public headers include json.hpp and json_fwd.hpp + self.requires("nlohmann_json/3.11.2", transitive_headers=True) + if self.options.with_python: + self.requires("pybind11/2.10.1") + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration( + "Can not build shared library on Visual Studio." + ) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get( + str(self.settings.compiler), False + ) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["BUILD_PYTHON"] = self.options.with_python + tc.cache_variables["BUILD_DOCUMENTATION"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PROPOSAL") + self.cpp_info.set_property("cmake_target_name", "PROPOSAL::PROPOSAL") + self.cpp_info.libs = ["PROPOSAL"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "PROPOSAL" + self.cpp_info.names["cmake_find_package_multi"] = "PROPOSAL" diff --git a/recipes/proposal/all/test_package/CMakeLists.txt b/recipes/proposal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7263fd9e7da18 --- /dev/null +++ b/recipes/proposal/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PROPOSAL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PROPOSAL::PROPOSAL) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/proposal/all/test_package/conanfile.py b/recipes/proposal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ab249f266b429 --- /dev/null +++ b/recipes/proposal/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +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 = "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/proposal/all/test_package/test_package.cpp b/recipes/proposal/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..76ca13b1a3245 --- /dev/null +++ b/recipes/proposal/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include "PROPOSAL/PROPOSAL.h" +#include "PROPOSAL/Logging.h" +#include +#include + +int main() +{ + auto particle = PROPOSAL::MuMinusDef(); + auto target = PROPOSAL::Ice(); + auto cut = std::make_shared(500, 0.05, false); + auto cross = PROPOSAL::GetStdCrossSections(particle, target, cut, false); + + auto energy = 1e4; + for (auto c : cross) { + auto type = c->GetInteractionType(); + auto name = PROPOSAL::Type_Interaction_Name_Map.at(type); + auto dEdx = c->CalculatedEdx(energy); + std::cout << "The " << name << " average loss for a " << energy << " MeV " + << particle.name << " in " << target.GetName() + << " is: " << dEdx << " MeV * cm^2 / g" << std::endl; + } + + PROPOSAL::Logging::Get("proposal.conan_test_package")->warn("logging test"); +} diff --git a/recipes/proposal/all/test_v1_package/CMakeLists.txt b/recipes/proposal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ea0378c83fe1 --- /dev/null +++ b/recipes/proposal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package 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/proposal/all/test_v1_package/conanfile.py b/recipes/proposal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/proposal/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/proposal/config.yml b/recipes/proposal/config.yml new file mode 100644 index 0000000000000..279c6cb19e836 --- /dev/null +++ b/recipes/proposal/config.yml @@ -0,0 +1,29 @@ +versions: + "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 new file mode 100644 index 0000000000000..502de4a7d6777 --- /dev/null +++ b/recipes/protobuf/all/conandata.yml @@ -0,0 +1,66 @@ +sources: + "3.21.9": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.9.tar.gz" + sha256: "1add10f9bd92775b91f326da259f243881e904dd509367d5031d4c782ba82810" + "3.21.4": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.21.4.tar.gz" + sha256: "85d42d4485f36f8cec3e475a3b9e841d7d78523cd775de3a86dba77081f4ca25" + "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.19.4": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.19.4.tar.gz" + sha256: "3bd7828aa5af4b13b99c191e8b1e884ebfa9ad371b0ce264605d347f135d2568" + "3.18.1": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.18.1.tar.gz" + sha256: "9111bf0b542b631165fadbd80aa60e7fb25b25311c532139ed2089d76ddf6dd7" + "3.17.1": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.1.tar.gz" + sha256: "036d66d6eec216160dd898cfb162e9d82c1904627642667cc32b104d407bb411" +patches: + "3.21.9": + - patch_file: "patches/protobuf-3.21.9-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.21.4": + - patch_file: "patches/protobuf-3.21.4-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.20.0": + - patch_file: "patches/protobuf-3.20.0-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.19.6": + - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" + patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" + patch_type: "portability" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/9437" + - patch_file: "patches/protobuf-3.19.6-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.19.4": + - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" + patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" + patch_type: "portability" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/9437" + - patch_file: "patches/protobuf-3.19.4-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.18.1": + - patch_file: "patches/protobuf-3.18.1-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.17.1": + - patch_file: "patches/protobuf-3.17.1-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" diff --git a/recipes/protobuf/all/conanfile.py b/recipes/protobuf/all/conanfile.py new file mode 100644 index 0000000000000..d12aca6f2317c --- /dev/null +++ b/recipes/protobuf/all/conanfile.py @@ -0,0 +1,262 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import 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" + + +class ProtobufConan(ConanFile): + name = "protobuf" + description = "Protocol Buffers - Google's data interchange format" + topics = ("protocol-buffers", "protocol-compiler", "serialization", "rpc", "protocol-compiler") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/protocolbuffers/protobuf" + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "with_rtti": [True, False], + "lite": [True, False], + "debug_suffix": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_rtti": True, + "lite": False, + "debug_suffix": True, + } + + short_paths = True + + @property + def _is_clang_cl(self): + return self.settings.compiler == "clang" and self.settings.os == "Windows" + + @property + def _is_clang_x86(self): + return self.settings.compiler == "clang" and self.settings.arch == "x86" + + @property + def _can_disable_rtti(self): + return Version(self.version) >= "3.15.4" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._can_disable_rtti: + del self.options.with_rtti + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + + 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") + + check_min_vs(self, "190") + + if self.settings.compiler == "clang": + if Version(self.version) >= "3.15.4" and Version(self.settings.compiler.version) < "4": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _cmake_install_base_path(self): + return os.path.join("lib", "cmake", "protobuf") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_INSTALL_CMAKEDIR"] = self._cmake_install_base_path.replace("\\", "/") + tc.cache_variables["protobuf_WITH_ZLIB"] = self.options.with_zlib + tc.cache_variables["protobuf_BUILD_TESTS"] = False + tc.cache_variables["protobuf_BUILD_PROTOC_BINARIES"] = self.settings.os != "tvOS" + if not self.options.debug_suffix: + tc.cache_variables["protobuf_DEBUG_POSTFIX"] = "" + if Version(self.version) >= "3.14.0": + tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS" + if self._can_disable_rtti: + tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti + if is_msvc(self) or self._is_clang_cl: + runtime = msvc_runtime_flag(self) + if not runtime: + runtime = self.settings.get_safe("compiler.runtime") + tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime + if is_apple_os(self) and self.options.shared: + # Workaround against SIP on macOS for consumers while invoking protoc when protobuf lib is shared + tc.variables["CMAKE_INSTALL_RPATH"] = "@loader_path/../lib" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + 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("""\ + if(NOT TARGET protobuf::protoc) + if(CMAKE_CROSSCOMPILING) + find_program(PROTOC_PROGRAM protoc PATHS ENV PATH NO_DEFAULT_PATH) + endif() + if(NOT PROTOC_PROGRAM) + set(PROTOC_PROGRAM \"${{CMAKE_CURRENT_LIST_DIR}}/{protoc_rel_path}\") + endif() + get_filename_component(PROTOC_PROGRAM \"${{PROTOC_PROGRAM}}\" ABSOLUTE) + set(Protobuf_PROTOC_EXECUTABLE ${{PROTOC_PROGRAM}} CACHE FILEPATH \"The protoc compiler\") + add_executable(protobuf::protoc IMPORTED) + set_property(TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION ${{Protobuf_PROTOC_EXECUTABLE}}) + endif() + """.format(protoc_rel_path=protoc_rel_path)) + replace_in_file(self, + protobuf_config_cmake, + "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", + protoc_target + ) + + # Disable a potential warning in protobuf-module.cmake.in + # TODO: remove this patch? Is it really useful? + protobuf_module_cmake = os.path.join(self.source_folder, "cmake", "protobuf-module.cmake.in") + replace_in_file(self, + protobuf_module_cmake, + "if(DEFINED Protobuf_SRC_ROOT_FOLDER)", + "if(0)\nif(DEFINED Protobuf_SRC_ROOT_FOLDER)", + ) + replace_in_file(self, + protobuf_module_cmake, + "# Define upper case versions of output variables", + "endif()", + ) + + # 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) + cmake_root = "cmake" if Version(self.version) < "3.21" else None + cmake.configure(build_script_folder=cmake_root) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + 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")) + + if not self.options.lite: + rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "lib")) + rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "Protobuf") + self.cpp_info.set_property("cmake_file_name", "protobuf") + self.cpp_info.set_property("pkg_config_name", "protobuf_full_package") # unofficial, but required to avoid side effects (libprotobuf component "steals" the default global pkg_config name) + + build_modules = [ + os.path.join(self._cmake_install_base_path, "protobuf-generate.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-module.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-options.cmake"), + ] + 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 "" + + # libprotobuf + self.cpp_info.components["libprotobuf"].set_property("cmake_target_name", "protobuf::libprotobuf") + self.cpp_info.components["libprotobuf"].set_property("pkg_config_name", "protobuf") + self.cpp_info.components["libprotobuf"].builddirs.append(self._cmake_install_base_path) + self.cpp_info.components["libprotobuf"].libs = [lib_prefix + "protobuf" + lib_suffix] + if self.options.with_zlib: + self.cpp_info.components["libprotobuf"].requires = ["zlib::zlib"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libprotobuf"].system_libs.extend(["m", "pthread"]) + if self._is_clang_x86 or "arm" in str(self.settings.arch): + self.cpp_info.components["libprotobuf"].system_libs.append("atomic") + if self.settings.os == "Android": + self.cpp_info.components["libprotobuf"].system_libs.append("log") + if self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["libprotobuf"].defines = ["PROTOBUF_USE_DLLS"] + + # libprotoc + if self.settings.os != "tvOS": + self.cpp_info.components["libprotoc"].set_property("cmake_target_name", "protobuf::libprotoc") + self.cpp_info.components["libprotoc"].libs = [lib_prefix + "protoc" + lib_suffix] + self.cpp_info.components["libprotoc"].requires = ["libprotobuf"] + + # libprotobuf-lite + if self.options.lite: + self.cpp_info.components["libprotobuf-lite"].set_property("cmake_target_name", "protobuf::libprotobuf-lite") + self.cpp_info.components["libprotobuf-lite"].set_property("pkg_config_name", "protobuf-lite") + self.cpp_info.components["libprotobuf-lite"].builddirs.append(self._cmake_install_base_path) + self.cpp_info.components["libprotobuf-lite"].libs = [lib_prefix + "protobuf-lite" + lib_suffix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libprotobuf-lite"].system_libs.extend(["m", "pthread"]) + if self._is_clang_x86 or "arm" in str(self.settings.arch): + self.cpp_info.components["libprotobuf-lite"].system_libs.append("atomic") + if self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["libprotobuf-lite"].defines = ["PROTOBUF_USE_DLLS"] + if self.settings.os == "Android": + self.cpp_info.components["libprotobuf-lite"].system_libs.append("log") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "Protobuf" + self.cpp_info.filenames["cmake_find_package_multi"] = "protobuf" + self.cpp_info.names["pkg_config"] ="protobuf_full_package" + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["libprotobuf"].build_modules[generator] = build_modules + if self.options.lite: + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["libprotobuf-lite"].build_modules[generator] = build_modules + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch new file mode 100644 index 0000000000000..d8f8f14a25361 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 61f0859..d673519 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -616,6 +616,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 82fe794..dfbbf5b 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -112,6 +112,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch new file mode 100644 index 0000000000000..4825966e01d9d --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 01384c8..8f8a44d 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -736,6 +736,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 5fef6e4..9efd5d6 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -128,6 +128,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch new file mode 100644 index 0000000000000..b0f3ddc092047 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 37632cf..561fd0f 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -763,6 +763,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 579eb41..7a179f9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -129,6 +129,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch new file mode 100644 index 0000000000000..5aadd2a257043 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 30af1cf..4ddf5dc 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -763,6 +763,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 579eb41..7a179f9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -129,6 +129,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch new file mode 100644 index 0000000000000..df772b5958879 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch @@ -0,0 +1,29 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index bdb2eec..e8d7dbc 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -816,6 +816,11 @@ + #undef TRUE + #pragma push_macro("FALSE") + #undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 58136a4..eb0fdc8 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -134,6 +134,8 @@ + #pragma pop_macro("DOMAIN") + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch new file mode 100644 index 0000000000000..6cf85b0ac3941 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index b7af780..d50ac87 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch new file mode 100644 index 0000000000000..3a152f62bca69 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index f00daf7..d956db2 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch b/recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch new file mode 100644 index 0000000000000..e55d642882aa3 --- /dev/null +++ b/recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch @@ -0,0 +1,15 @@ +upstream PR: https://github.com/protocolbuffers/protobuf/pull/9153 + +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -182,7 +182,9 @@ 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>) ++ 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/patches/upstream-pr-9437-msvc-runtime.patch b/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch new file mode 100644 index 0000000000000..06cb0a97681d1 --- /dev/null +++ b/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch @@ -0,0 +1,17 @@ +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/test_package/CMakeLists.txt b/recipes/protobuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a5240f3215abb --- /dev/null +++ b/recipes/protobuf/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.15) + +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) +target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") +if (protobuf_LITE) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf) +endif() + +if(TARGET protobuf::libprotoc) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) +endif() + +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS TARGET ${PROJECT_NAME}) +protobuf_generate(LANGUAGE cpp TARGET ${PROJECT_NAME} PROTOS addressbook.proto) diff --git a/recipes/protobuf/all/test_package/addressbook.proto b/recipes/protobuf/all/test_package/addressbook.proto new file mode 100644 index 0000000000000..be5732b3317e5 --- /dev/null +++ b/recipes/protobuf/all/test_package/addressbook.proto @@ -0,0 +1,64 @@ +// See README.txt for information and build instructions. +// +// Note: START and END tags are used in comments to define sections used in +// tutorials. They are not part of the syntax for Protocol Buffers. +// +// To get an in-depth walkthrough of this file and the related examples, see: +// https://developers.google.com/protocol-buffers/docs/tutorials + +// [START declaration] +syntax = "proto3"; +package tutorial; + +import "google/protobuf/timestamp.proto"; +// [END declaration] + +// [START java_declaration] +option java_package = "com.example.tutorial"; +option java_outer_classname = "AddressBookProtos"; +// [END java_declaration] + +// [START csharp_declaration] +option csharp_namespace = "Google.Protobuf.Examples.AddressBook"; +// [END csharp_declaration] + +// [START messages] +message Person { + string name = 1; + int32 id = 2; // Unique ID number for this person. + string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + string number = 1; + PhoneType type = 2; + } + + repeated PhoneNumber phones = 4; + + google.protobuf.Timestamp last_updated = 5; +} + +// Our address book file is just one of these. +message AddressBook { + repeated Person people = 1; +} +// [END messages] + +// Artibrary message with a GID type, to cause +// the .pb.h file to define `GID_MAX`, which +// may conflict with a macro defined by system +// headers on macOS. +message FooBar { + enum GID { + FOO = 0; + } + enum UID { + BAR = 0; + } +} diff --git a/recipes/protobuf/all/test_package/conanfile.py b/recipes/protobuf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3823d923c4684 --- /dev/null +++ b/recipes/protobuf/all/test_package/conanfile.py @@ -0,0 +1,41 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if cross_building(self) and hasattr(self, "settings_build"): + self.tool_requires(self.tested_reference_str) + + def generate(self): + VirtualRunEnv(self).generate() + if cross_building(self) and hasattr(self, "settings_build"): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") + tc = CMakeToolchain(self) + tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite + 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/protobuf/all/test_package/test_package.cpp b/recipes/protobuf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aee0c47205eed --- /dev/null +++ b/recipes/protobuf/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +#include "addressbook.pb.h" + +int main() +{ + std::cout << "Bincrafters\n"; + + tutorial::Person p; + p.set_id(21); + p.set_name("conan-center-index"); + p.set_email("info@conan.io"); + + std::cout << p.SerializeAsString() << "\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/protobuf/all/test_v1_package/CMakeLists.txt b/recipes/protobuf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f16bc97992e86 --- /dev/null +++ b/recipes/protobuf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000000000..f31e33d3b0ff4 --- /dev/null +++ b/recipes/protobuf/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +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 new file mode 100644 index 0000000000000..c22211a7a9d4e --- /dev/null +++ b/recipes/protobuf/config.yml @@ -0,0 +1,15 @@ +versions: + "3.21.9": + folder: all + "3.21.4": + folder: all + "3.20.0": + folder: all + "3.19.6": + folder: all + "3.19.4": + folder: all + "3.18.1": + folder: all + "3.17.1": + folder: all diff --git a/recipes/protopuf/all/conandata.yml b/recipes/protopuf/all/conandata.yml new file mode 100644 index 0000000000000..e3a4a402d6c55 --- /dev/null +++ b/recipes/protopuf/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.2.1": + url: "https://github.com/PragmaTwice/protopuf/archive/v2.2.1.tar.gz" + sha256: "8d4940206d8e8664f75ae1cdfff8c14fa9a196c03967d520725284429744c19c" + "2.2.0": + url: "https://github.com/PragmaTwice/protopuf/archive/refs/tags/v2.2.0.tar.gz" + sha256: "f19aed66c7ff44fee2ae980f869746e2000fb484893f53f2e4ea021352444ea9" diff --git a/recipes/protopuf/all/conanfile.py b/recipes/protopuf/all/conanfile.py new file mode 100644 index 0000000000000..0bd58c86f61b8 --- /dev/null +++ b/recipes/protopuf/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.50.0" + + +class ProtopufConan(ConanFile): + name = "protopuf" + description = "Protocol Puffers: A little, highly templated, and protobuf-compatible serialization/deserialization header-only library written in C++20" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/PragmaTwice/protopuf" + topics = ("serialization", "protobuf", "metaprogramming", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "10", + "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 == "apple-clang": + raise ConanInvalidConfiguration( + f"{self.ref} does not yet support apple-clang." + ) + + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, 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 + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/protopuf/all/test_package/CMakeLists.txt b/recipes/protopuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c049a9a330ddf --- /dev/null +++ b/recipes/protopuf/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +find_package(protopuf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE protopuf::protopuf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/protopuf/all/test_package/conanfile.py b/recipes/protopuf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/protopuf/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/protopuf/all/test_package/test_package.cpp b/recipes/protopuf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4204c6dc97e2a --- /dev/null +++ b/recipes/protopuf/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include + +#include "protopuf/message.h" + +using namespace pp; +using namespace std; + +using Student = message< + uint32_field<"id", 1>, + string_field<"name", 3> +>; + +using Class = message< + string_field<"name", 8>, + message_field<"students", 3, Student, repeated> +>; + +int main() { + // serialization + Student twice{123, "twice"}, tom{456, "tom"}, jerry{123456, "jerry"}; + Class myClass{"class 101", {tom, jerry}}; + myClass["students"_f].push_back(twice); + + array buffer{}; + auto bufferEnd = message_coder::encode(myClass, buffer); + + // deserialization + auto [yourClass, bufferEnd2] = message_coder::decode(buffer); + + + return 0; +} diff --git a/recipes/protopuf/all/test_v1_package/CMakeLists.txt b/recipes/protopuf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4bda6274e3037 --- /dev/null +++ b/recipes/protopuf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(protopuf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE protopuf::protopuf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/protopuf/all/test_v1_package/conanfile.py b/recipes/protopuf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/protopuf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/protopuf/config.yml b/recipes/protopuf/config.yml new file mode 100644 index 0000000000000..346088b2bbe5f --- /dev/null +++ b/recipes/protopuf/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.1": + folder: all + "2.2.0": + folder: all diff --git a/recipes/protozero/all/conandata.yml b/recipes/protozero/all/conandata.yml new file mode 100644 index 0000000000000..65a491cfa087d --- /dev/null +++ b/recipes/protozero/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.7.1": + url: "https://github.com/mapbox/protozero/archive/refs/tags/v1.7.1.tar.gz" + sha256: "27e0017d5b3ba06d646a3ec6391d5ccc8500db821be480aefd2e4ddc3de5ff99" diff --git a/recipes/protozero/all/conanfile.py b/recipes/protozero/all/conanfile.py new file mode 100644 index 0000000000000..774022d576c71 --- /dev/null +++ b/recipes/protozero/all/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class ProtozeroConan(ConanFile): + name = "protozero" + description = "Minimalist protocol buffer decoder and encoder in C++." + topics = ("protozero", "protobuf") + license = "BSD-2-Clause" + homepage = "https://github.com/mapbox/protozero" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + 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, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/protozero/all/test_package/CMakeLists.txt b/recipes/protozero/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a60635cc715c --- /dev/null +++ b/recipes/protozero/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(protozero REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE protozero::protozero) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/protozero/all/test_package/conanfile.py b/recipes/protozero/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/protozero/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/protozero/all/test_package/test_package.cpp b/recipes/protozero/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1fb774b0e080b --- /dev/null +++ b/recipes/protozero/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + protozero::data_view dv; + return 0; +} diff --git a/recipes/protozero/all/test_v1_package/CMakeLists.txt b/recipes/protozero/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c2f5bc742311b --- /dev/null +++ b/recipes/protozero/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(protozero REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE protozero::protozero) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/protozero/all/test_v1_package/conanfile.py b/recipes/protozero/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/protozero/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/protozero/config.yml b/recipes/protozero/config.yml new file mode 100644 index 0000000000000..4821864cf318a --- /dev/null +++ b/recipes/protozero/config.yml @@ -0,0 +1,3 @@ +versions: + "1.7.1": + folder: all diff --git a/recipes/psimd/all/conandata.yml b/recipes/psimd/all/conandata.yml new file mode 100644 index 0000000000000..5db35374c3c62 --- /dev/null +++ b/recipes/psimd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200517": + url: "https://github.com/Maratyszcza/psimd/archive/072586a71b55b7f8c584153d223e95687148a900.zip" + sha256: "dc615342bcbe51ca885323e51b68b90ed9bb9fa7df0f4419dbfa0297d5e837b7" diff --git a/recipes/psimd/all/conanfile.py b/recipes/psimd/all/conanfile.py new file mode 100644 index 0000000000000..138520809226b --- /dev/null +++ b/recipes/psimd/all/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class PsimdConan(ConanFile): + name = "psimd" + description = "Portable 128-bit SIMD intrinsics." + license = "MIT" + topics = ("psimd", "simd") + homepage = "https://github.com/Maratyszcza/psimd" + url = "https://github.com/conan-io/conan-center-index" + 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) + + def build(self): + pass + + 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/psimd/all/test_package/CMakeLists.txt b/recipes/psimd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05b88bb3a3986 --- /dev/null +++ b/recipes/psimd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(psimd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE psimd::psimd) diff --git a/recipes/psimd/all/test_package/conanfile.py b/recipes/psimd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/psimd/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/psimd/all/test_package/test_package.c b/recipes/psimd/all/test_package/test_package.c new file mode 100644 index 0000000000000..df931cf110b83 --- /dev/null +++ b/recipes/psimd/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() { +#if defined(__GNUC__) || defined(__clang__) + psimd_u32 a = psimd_splat_u32(UINT32_C(0x80000000)); +#endif + return 0; +} diff --git a/recipes/psimd/all/test_v1_package/CMakeLists.txt b/recipes/psimd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e8cb47d9d69b7 --- /dev/null +++ b/recipes/psimd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(psimd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE psimd::psimd) diff --git a/recipes/psimd/all/test_v1_package/conanfile.py b/recipes/psimd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/psimd/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/psimd/config.yml b/recipes/psimd/config.yml new file mode 100644 index 0000000000000..65fc944d6dfca --- /dev/null +++ b/recipes/psimd/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200517": + folder: all diff --git a/recipes/psyinf-gmtl/all/conandata.yml b/recipes/psyinf-gmtl/all/conandata.yml new file mode 100644 index 0000000000000..42931963c125d --- /dev/null +++ b/recipes/psyinf-gmtl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.1": + url: "https://github.com/psyinf/gmtl/archive/refs/tags/0.7.1.tar.gz" + sha256: "e7fbc98d8714251655c1f2ab60d35500ca6c1c57e4887419c99ffb4a49fc5030" diff --git a/recipes/psyinf-gmtl/all/conanfile.py b/recipes/psyinf-gmtl/all/conanfile.py new file mode 100644 index 0000000000000..11203a16c2294 --- /dev/null +++ b/recipes/psyinf-gmtl/all/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.50.0" + + +class PackageConan(ConanFile): + name = "psyinf-gmtl" + description = "The Generic Math Template Library. A math library designed to be high-performance, extensible, and generic." + license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/psyinf/gmtl" + topics = ("linear-algebra", "collision", "vector", "matrix", "template", "math", "header-only") + 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) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.names["cmake_find_package"] = "gmtl" + self.cpp_info.names["cmake_find_package_multi"] = "gmtl" + + self.cpp_info.set_property("cmake_file_name", "gmtl") + self.cpp_info.set_property("cmake_target_name", "gmtl::gmtl") + self.cpp_info.set_property("pkg_config_name", "gmtl") + + diff --git a/recipes/psyinf-gmtl/all/test_package/CMakeLists.txt b/recipes/psyinf-gmtl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5bb1ba95fb7cc --- /dev/null +++ b/recipes/psyinf-gmtl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(gmtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gmtl::gmtl) diff --git a/recipes/psyinf-gmtl/all/test_package/conanfile.py b/recipes/psyinf-gmtl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/psyinf-gmtl/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/psyinf-gmtl/all/test_package/test_package.cpp b/recipes/psyinf-gmtl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..221f6d72428d5 --- /dev/null +++ b/recipes/psyinf-gmtl/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include "gmtl/gmtl.h" + + +int main(void) { + + gmtl::Vec4f homogeneousVec; + gmtl::Vec4f homogeneousVec2; + gmtl::Matrix44f mat; + + homogeneousVec2 = mat * homogeneousVec; + + gmtl::xform(homogeneousVec2, mat, homogeneousVec); + return EXIT_SUCCESS; +} diff --git a/recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt b/recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de05e55dc1517 --- /dev/null +++ b/recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gmtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gmtl::gmtl) diff --git a/recipes/psyinf-gmtl/all/test_v1_package/conanfile.py b/recipes/psyinf-gmtl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/psyinf-gmtl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/psyinf-gmtl/config.yml b/recipes/psyinf-gmtl/config.yml new file mode 100644 index 0000000000000..5232c857fcc80 --- /dev/null +++ b/recipes/psyinf-gmtl/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.1": + folder: all diff --git a/recipes/ptex/all/conandata.yml b/recipes/ptex/all/conandata.yml new file mode 100644 index 0000000000000..7a294e96324ee --- /dev/null +++ b/recipes/ptex/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.4.0": + url: "https://github.com/wdas/ptex/archive/refs/tags/v2.4.0.tar.gz" + sha256: "690d66b72f34a92488d63134ad1f5736078677356b0004070b0169b9e3240f8e" +patches: + "2.4.0": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/ptex/all/conanfile.py b/recipes/ptex/all/conanfile.py new file mode 100644 index 0000000000000..f8059fec65c6b --- /dev/null +++ b/recipes/ptex/all/conanfile.py @@ -0,0 +1,88 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class PtexConan(ConanFile): + name = "ptex" + description = "Ptex is a texture mapping system developed by Walt Disney " \ + "Animation Studios for production-quality rendering." + license = "BSD-3-Clause" + topics = ("texture-mapping") + homepage = "https://ptex.us" + 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, + } + + 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("zlib/1.2.13") + + 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["PTEX_BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["PTEX_BUILD_SHARED_LIBS"] = self.options.shared + 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, "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, "share")) + + def package_info(self): + cmake_target = "Ptex_dynamic" if self.options.shared else "Ptex_static" + self.cpp_info.set_property("cmake_file_name", "ptex") + self.cpp_info.set_property("cmake_target_name", f"Ptex::{cmake_target}") + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["_ptex"].libs = ["Ptex"] + if not self.options.shared: + self.cpp_info.components["_ptex"].defines.append("PTEX_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_ptex"].system_libs.append("pthread") + self.cpp_info.components["_ptex"].requires = ["zlib::zlib"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "ptex" + self.cpp_info.filenames["cmake_find_package_multi"] = "ptex" + self.cpp_info.names["cmake_find_package"] = "Ptex" + self.cpp_info.names["cmake_find_package_multi"] = "Ptex" + self.cpp_info.components["_ptex"].set_property("cmake_target_name", f"Ptex::{cmake_target}") + self.cpp_info.components["_ptex"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["_ptex"].names["cmake_find_package_multi"] = cmake_target diff --git a/recipes/ptex/all/patches/0001-fix-cmake.patch b/recipes/ptex/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..f6481be77aa84 --- /dev/null +++ b/recipes/ptex/all/patches/0001-fix-cmake.patch @@ -0,0 +1,57 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,10 @@ enable_testing() + # Setup platform-specific threading flags. + find_package(Threads REQUIRED) + ++find_package(ZLIB REQUIRED) ++add_library(PkgConfig::Ptex_ZLIB INTERFACE IMPORTED) ++set_property(TARGET PkgConfig::Ptex_ZLIB PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) ++if(0) + # Use pkg-config to create a PkgConfig::Ptex_ZLIB imported target + find_package(PkgConfig REQUIRED) + pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET) +@@ -59,6 +63,7 @@ if (NOT DEFINED PTEX_VER) + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif () + endif () ++endif() + # Provide a fallback version when the Git repository is unavailable. + if (NOT PTEX_VER) + set(PTEX_VER "v2.3.X") +@@ -76,7 +81,7 @@ endif () + list(GET PTEX_VER_LIST 0 PTEX_MAJOR_VERSION) + list(GET PTEX_VER_LIST 1 PTEX_MINOR_VERSION) + +-if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ++if (0) + # Detect the build type from the $FLAVOR environment variable + # Default to optimized Release builds when unspecified. + if ("$ENV{FLAVOR}" MATCHES "debug") +@@ -116,7 +121,4 @@ endif () + include_directories(src/ptex) + + add_subdirectory(src/ptex) +-add_subdirectory(src/utils) +-add_subdirectory(src/tests) +-add_subdirectory(src/doc) + add_subdirectory(src/build) +--- a/src/ptex/CMakeLists.txt ++++ b/src/ptex/CMakeLists.txt +@@ -21,6 +21,7 @@ if(PTEX_BUILD_STATIC_LIBS) + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}) ++ target_compile_definitions(Ptex_static PUBLIC PTEX_STATIC) + target_link_libraries(Ptex_static + PUBLIC Threads::Threads PkgConfig::Ptex_ZLIB) + install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) +@@ -39,7 +40,7 @@ if(PTEX_BUILD_SHARED_LIBS) + target_compile_definitions(Ptex_dynamic PRIVATE PTEX_EXPORTS) + target_link_libraries(Ptex_dynamic + PUBLIC Threads::Threads PkgConfig::Ptex_ZLIB) +- install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS Ptex_dynamic EXPORT Ptex RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + install(FILES diff --git a/recipes/ptex/all/test_package/CMakeLists.txt b/recipes/ptex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9028e1867020b --- /dev/null +++ b/recipes/ptex/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(ptex REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET Ptex::Ptex_static) + target_link_libraries(${PROJECT_NAME} PRIVATE Ptex::Ptex_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Ptex::Ptex_dynamic) +endif() diff --git a/recipes/ptex/all/test_package/conanfile.py b/recipes/ptex/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ptex/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/ptex/all/test_package/test_package.cpp b/recipes/ptex/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4ee1b9d8afa37 --- /dev/null +++ b/recipes/ptex/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + PtexPtr c(PtexCache::create(0, 1024 * 1024)); + return 0; +} diff --git a/recipes/ptex/all/test_v1_package/CMakeLists.txt b/recipes/ptex/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ptex/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ptex/all/test_v1_package/conanfile.py b/recipes/ptex/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ptex/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/ptex/config.yml b/recipes/ptex/config.yml new file mode 100644 index 0000000000000..e1d4aed9fe78f --- /dev/null +++ b/recipes/ptex/config.yml @@ -0,0 +1,3 @@ +versions: + "2.4.0": + folder: all diff --git a/recipes/pthreadpool/all/CMakeLists.txt b/recipes/pthreadpool/all/CMakeLists.txt new file mode 100644 index 0000000000000..4a9151537d740 --- /dev/null +++ b/recipes/pthreadpool/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +find_package(fxdiv REQUIRED CONFIG) +if(NOT TARGET fxdiv) + add_library(fxdiv INTERFACE IMPORTED) + set_property(TARGET fxdiv PROPERTY INTERFACE_LINK_LIBRARIES fxdiv::fxdiv) +endif() + +add_subdirectory(src) diff --git a/recipes/pthreadpool/all/conandata.yml b/recipes/pthreadpool/all/conandata.yml new file mode 100644 index 0000000000000..4a1b5d58d8c57 --- /dev/null +++ b/recipes/pthreadpool/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210218": + url: "https://github.com/Maratyszcza/pthreadpool/archive/b4589998be9a0f794236cf46f1b5b232b2b15ca3.zip" + sha256: "b09f79d1b609239861bce5ed4ba4fbcf04f36e2c31471276158c44e5e15fde95" diff --git a/recipes/pthreadpool/all/conanfile.py b/recipes/pthreadpool/all/conanfile.py new file mode 100644 index 0000000000000..23a05b7d46fd2 --- /dev/null +++ b/recipes/pthreadpool/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file +import os + +required_conan_version = ">=1.53.0" + + +class PthreadpoolConan(ConanFile): + name = "pthreadpool" + description = "pthreadpool is a portable and efficient thread pool " \ + "implementation. It provides similar functionality to " \ + "#pragma omp parallel for, but with additional features." + license = "BSD-2-Clause" + topics = ("multi-threading", "pthreads", "multi-core", "threadpool") + homepage = "https://github.com/Maratyszcza/pthreadpool" + 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], + "sync_primitive": ["default", "condvar", "futex", "gcd", "event"], + } + default_options = { + "shared": False, + "fPIC": True, + "sync_primitive": "default", + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fxdiv/cci.20200417") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["PTHREADPOOL_LIBRARY_TYPE"] = "default" + tc.variables["PTHREADPOOL_ALLOW_DEPRECATED_API"] = True + tc.cache_variables["PTHREADPOOL_SYNC_PRIMITIVE"] = self.options.sync_primitive + tc.variables["PTHREADPOOL_BUILD_TESTS"] = False + tc.variables["PTHREADPOOL_BUILD_BENCHMARKS"] = False + tc.cache_variables["FXDIV_SOURCE_DIR"] = "dummy" # this value doesn't really matter, it's just to avoid a download + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + 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}") + + def build(self): + self._patch_sources() + 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 = ["pthreadpool"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/pthreadpool/all/test_package/CMakeLists.txt b/recipes/pthreadpool/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..722ec454f1c79 --- /dev/null +++ b/recipes/pthreadpool/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(pthreadpool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pthreadpool::pthreadpool) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/pthreadpool/all/test_package/conanfile.py b/recipes/pthreadpool/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pthreadpool/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/pthreadpool/all/test_package/test_package.c b/recipes/pthreadpool/all/test_package/test_package.c new file mode 100644 index 0000000000000..cc1c5f20660c0 --- /dev/null +++ b/recipes/pthreadpool/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() { + pthreadpool_t threadpool = pthreadpool_create(2); + pthreadpool_destroy(threadpool); + return 0; +} diff --git a/recipes/pthreadpool/all/test_v1_package/CMakeLists.txt b/recipes/pthreadpool/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pthreadpool/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pthreadpool/all/test_v1_package/conanfile.py b/recipes/pthreadpool/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pthreadpool/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/pthreadpool/config.yml b/recipes/pthreadpool/config.yml new file mode 100644 index 0000000000000..888d588d579dc --- /dev/null +++ b/recipes/pthreadpool/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210218": + folder: all diff --git a/recipes/pthreads4w/all/conandata.yml b/recipes/pthreads4w/all/conandata.yml new file mode 100644 index 0000000000000..23e0679cb8781 --- /dev/null +++ b/recipes/pthreads4w/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + sha256: "b81136effb7185c77601fe2e0e6ac19bd996912e4814cebdd3010b0fac9e259b" + url: https://sourceforge.net/projects/pthreads4w/files/pthreads4w-code-v3.0.0.zip/download diff --git a/recipes/pthreads4w/all/conanfile.py b/recipes/pthreads4w/all/conanfile.py new file mode 100644 index 0000000000000..2b65df1658831 --- /dev/null +++ b/recipes/pthreads4w/all/conanfile.py @@ -0,0 +1,130 @@ +from conan import ConanFile +from conan.tools.files import chdir, collect_libs, copy, get, mkdir, replace_in_file +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.57.0" + +class Pthreads4WConan(ConanFile): + name = "pthreads4w" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/pthreads4w/" + description = "POSIX Threads for Windows" + license = "Apache-2.0" + topics = ("pthreads", "windows", "posix") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "exception_scheme": ["CPP", "SEH", "default"], + } + default_options = { + "shared": False, + "exception_scheme": "default", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def build_requirements(self): + if not is_msvc(self): + self.build_requires("autoconf/2.71") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("pthreads4w can only target os=Windows") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + with chdir(self, self.source_folder): + if is_msvc(self): + makefile = os.path.join(self.source_folder, "Makefile") + replace_in_file(self, makefile, + " copy pthreadV*.lib $(LIBDEST)", + " if exist pthreadV*.lib copy pthreadV*.lib $(LIBDEST)") + replace_in_file(self, makefile, + " copy libpthreadV*.lib $(LIBDEST)", + " if exist libpthreadV*.lib copy libpthreadV*.lib $(LIBDEST)") + replace_in_file(self, makefile, "XCFLAGS=\"/MD\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MDd\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MT\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MTd\"", "") + target = { + "CPP": "VCE", + "SEH": "SSE", + }.get(str(self.options.exception_scheme), "VC") + if not self.options.shared: + target += "-static" + if self.settings.build_type == "Debug": + target += "-debug" + + self.run(f"nmake {target}") + else: + autotools = Autotools(self) + self.run("autoheader") + autotools.autoreconf() + autotools.configure() + + make_target = "GCE" if self.options.exception_scheme == "CPP" else "GC" + if not self.options.shared: + make_target += "-static" + if self.settings.build_type == "Debug": + make_target += "-debug" + autotools.make(target=make_target, args=["-j1"]) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + if is_msvc(self): + self.run("nmake install DESTROOT={}".format(self.package_folder), env="conanbuild") + else: + autotools = Autotools(self) + mkdir(self, os.path.join(self.package_folder, "include")) + mkdir(self, os.path.join(self.package_folder, "lib")) + autotools.install(target="install-headers") + if self.options.shared: + mkdir(self, os.path.join(self.package_folder, "bin")) + autotools.install(target="install-dlls") + autotools.install(target="install-implib-default") + else: + autotools.install(target="install-lib-default") + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.defines.append(self._exception_scheme_definition) + if not self.options.shared: + self.cpp_info.defines.append("__PTW32_STATIC_LIB") + + @property + def _exception_scheme_definition(self): + return { + "CPP": "__PTW32_CLEANUP_CXX", + "SEH": "__PTW32_CLEANUP_SEH", + "default": "__PTW32_CLEANUP_C", + }[str(self.options.exception_scheme)] diff --git a/recipes/pthreads4w/all/test_package/CMakeLists.txt b/recipes/pthreads4w/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c870341fd9666 --- /dev/null +++ b/recipes/pthreads4w/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(pthreads4w REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) + +target_link_libraries(${PROJECT_NAME} PRIVATE pthreads4w::pthreads4w) diff --git a/recipes/pthreads4w/all/test_package/conanfile.py b/recipes/pthreads4w/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/pthreads4w/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pthreads4w/all/test_package/test_package.c b/recipes/pthreads4w/all/test_package/test_package.c new file mode 100644 index 0000000000000..4a21d0db9a1af --- /dev/null +++ b/recipes/pthreads4w/all/test_package/test_package.c @@ -0,0 +1,29 @@ +#include +#include +#include + +void* threadFunc(void* data) +{ + printf("threadFunc() called\n"); + fflush(stdout); + return NULL; +} + +int main() +{ + pthread_t thread; + if (pthread_create(&thread, NULL, threadFunc, NULL)) { + printf("Error creating thread\n"); + fflush(stdout); + return 1; + + } + + if (pthread_join(thread, NULL)) { + printf("Error joining thread\n"); + fflush(stdout); + return 2; + } + + return 0; +} diff --git a/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt b/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..993b1d536d435 --- /dev/null +++ b/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/pthreads4w/all/test_v1_package/conanfile.py b/recipes/pthreads4w/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/pthreads4w/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pthreads4w/config.yml b/recipes/pthreads4w/config.yml new file mode 100644 index 0000000000000..c15b1724f5d03 --- /dev/null +++ b/recipes/pthreads4w/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.0": + folder: all diff --git a/recipes/pugixml/all/conandata.yml b/recipes/pugixml/all/conandata.yml new file mode 100644 index 0000000000000..0e56e7f953dbc --- /dev/null +++ b/recipes/pugixml/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.13": + url: "https://github.com/zeux/pugixml/releases/download/v1.13/pugixml-1.13.tar.gz" + sha256: "40c0b3914ec131485640fa57e55bf1136446026b41db91c1bef678186a12abbe" + "1.12.1": + url: "https://github.com/zeux/pugixml/releases/download/v1.12.1/pugixml-1.12.1.tar.gz" + sha256: "dcf671a919cc4051210f08ffd3edf9e4247f79ad583c61577a13ee93af33afc7" + "1.11": + url: "https://github.com/zeux/pugixml/releases/download/v1.11/pugixml-1.11.tar.gz" + sha256: "26913d3e63b9c07431401cf826df17ed832a20d19333d043991e611d23beaa2c" + "1.10": + url: "https://github.com/zeux/pugixml/releases/download/v1.10/pugixml-1.10.tar.gz" + sha256: "55f399fbb470942410d348584dc953bcaec926415d3462f471ef350f29b5870a" diff --git a/recipes/pugixml/all/conanfile.py b/recipes/pugixml/all/conanfile.py new file mode 100644 index 0000000000000..c5890f6dbab55 --- /dev/null +++ b/recipes/pugixml/all/conanfile.py @@ -0,0 +1,116 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, load, replace_in_file, rmdir, save +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.54.0" + + +class PugiXmlConan(ConanFile): + name = "pugixml" + description = "Light-weight, simple and fast XML parser for C++ with XPath support" + topics = ("xml-parser", "xpath", "xml", "dom") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pugixml.org/" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "wchar_mode": [True, False], + "no_exceptions": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "wchar_mode": False, + "no_exceptions": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + if self.options.get_safe("shared") and self.options.wchar_mode: + # The app crashes with error "The procedure entry point ... could not be located in the dynamic link library" + raise ConanInvalidConfiguration("Combination of 'shared' and 'wchar_mode' options is not supported") + + 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.variables["BUILD_TESTS"] = False + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + if not self.options.header_only: + header_file = os.path.join(self.source_folder, "src", "pugiconfig.hpp") + # For the library build mode, options applied via change the configuration file + if self.options.wchar_mode: + replace_in_file(self, header_file, "// #define PUGIXML_WCHAR_MODE", "#define PUGIXML_WCHAR_MODE") + if self.options.no_exceptions: + replace_in_file(self, header_file, "// #define PUGIXML_NO_EXCEPTIONS", "#define PUGIXML_NO_EXCEPTIONS") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + readme_contents = load(self, os.path.join(self.source_folder, "readme.txt")) + license_contents = readme_contents[readme_contents.find("This library is"):] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + if self.options.header_only: + source_dir = os.path.join(self.source_folder, "src") + copy(self, "*", src=source_dir, dst=os.path.join(self.package_folder, "include")) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "pugixml") + self.cpp_info.set_property("cmake_target_name", "pugixml::pugixml") + self.cpp_info.set_property("pkg_config_name", "pugixml") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.options.header_only: + # For the "header_only" mode, options applied via global definitions + self.cpp_info.defines.append("PUGIXML_HEADER_ONLY") + if self.options.wchar_mode: + self.cpp_info.defines.append("PUGIXML_WCHAR_MODE") + if self.options.no_exceptions: + self.cpp_info.defines.append("PUGIXML_NO_EXCEPTIONS") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + else: + self.cpp_info.set_property( + "cmake_target_aliases", + ["pugixml::shared"] if self.options.shared else ["pugixml::static"], + ) + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/pugixml/all/test_package/CMakeLists.txt b/recipes/pugixml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..793d1941f61be --- /dev/null +++ b/recipes/pugixml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(pugixml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pugixml::pugixml) diff --git a/recipes/pugixml/all/test_package/conanfile.py b/recipes/pugixml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pugixml/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/pugixml/all/test_package/test_package.cpp b/recipes/pugixml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a2f23c36e349f --- /dev/null +++ b/recipes/pugixml/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include +#include +#include "pugixml.hpp" + +int main() { + const unsigned majorVersion = PUGIXML_VERSION / 1000; + const unsigned minorVersion = PUGIXML_VERSION % 1000 / 10; + const unsigned maintenanceVersion = PUGIXML_VERSION % 1000 % 10; + + std::basic_stringstream version; + version << majorVersion << '.' << minorVersion; + if (maintenanceVersion) + version << '.' << maintenanceVersion; + + pugi::xml_document doc; + pugi::xml_node node = doc.append_child(PUGIXML_TEXT("PugiXml")); + node.append_attribute(PUGIXML_TEXT("Version")) + .set_value(version.str().c_str()); + + node.append_attribute(PUGIXML_TEXT("wchar_mode")) + .set_value(sizeof(PUGIXML_CHAR) != 1); + + node.append_attribute(PUGIXML_TEXT("header_only")) +#ifdef PUGIXML_HEADER_ONLY + .set_value(true); +#else + .set_value(false); +#endif + + node.append_attribute(PUGIXML_TEXT("no_exceptions")) +#ifdef PUGIXML_NO_EXCEPTIONS + .set_value(true); +#else + .set_value(false); +#endif + + doc.print(std::cout); +} diff --git a/recipes/pugixml/all/test_v1_package/CMakeLists.txt b/recipes/pugixml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pugixml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pugixml/all/test_v1_package/conanfile.py b/recipes/pugixml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pugixml/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/pugixml/config.yml b/recipes/pugixml/config.yml new file mode 100644 index 0000000000000..191cc957e0c3b --- /dev/null +++ b/recipes/pugixml/config.yml @@ -0,0 +1,9 @@ +versions: + "1.13": + folder: "all" + "1.12.1": + folder: "all" + "1.11": + folder: "all" + "1.10": + folder: "all" diff --git a/recipes/pulseaudio/all/conandata.yml b/recipes/pulseaudio/all/conandata.yml new file mode 100644 index 0000000000000..1f7fbe0e59229 --- /dev/null +++ b/recipes/pulseaudio/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "14.2": + url: "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-14.2.tar.xz" + sha256: "75d3f7742c1ae449049a4c88900e454b8b350ecaa8c544f3488a2562a9ff66f1" + "14.0": + url: "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-14.0.tar.xz" + sha256: "a834775d9382b055504e5ee7625dc50768daac29329531deb6597bf05e06c261" + "13.0": + url: "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-13.0.tar.xz" + sha256: "961b23ca1acfd28f2bc87414c27bb40e12436efcf2158d29721b1e89f3f28057" diff --git a/recipes/pulseaudio/all/conanfile.py b/recipes/pulseaudio/all/conanfile.py new file mode 100644 index 0000000000000..84e7c6bf375e7 --- /dev/null +++ b/recipes/pulseaudio/all/conanfile.py @@ -0,0 +1,167 @@ +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, 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" + + +class PulseAudioConan(ConanFile): + name = "pulseaudio" + description = "PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy for sound applications." + topics = ("sound",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://pulseaudio.org/" + license = "LGPL-2.1" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_alsa": [True, False], + "with_glib": [True, False], + "with_fftw": [True, False], + "with_x11": [True, False], + "with_openssl": [True, False], + "with_dbus": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_alsa": True, + "with_glib": False, + "with_fftw": False, + "with_x11": True, + "with_openssl": True, + "with_dbus": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if not self.options.with_dbus: + del self.options.with_fftw + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + self.requires("libsndfile/1.2.0") + self.requires("libcap/2.66") + self.requires("libtool/2.4.7") + if self.options.with_alsa: + self.requires("libalsa/1.2.7.2") + if self.options.with_glib: + self.requires("glib/2.76.1") + if self.options.get_safe("with_fftw"): + self.requires("fftw/3.3.10") + if self.options.with_x11: + self.requires("xorg/system") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_dbus: + self.requires("dbus/1.15.2") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("pulseaudio supports only linux currently") + + if self.options.get_safe("with_fftw"): + fftw_precision = self.dependencies["fftw"].options.precision + if fftw_precision != "single": + raise ConanInvalidConfiguration( + f"Pulse audio cannot use fftw {fftw_precision} precision. " + "Either set option fftw:precision=single or pulseaudio:with_fftw=False" + ) + + def build_requirements(self): + self.tool_requires("gettext/0.21") + 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") + + 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)}", + f"--enable-glib2={yes_no(self.options.with_glib)}", + f"--with-fftw={yes_no(self.options.get_safe('with_fftw'))}", + "--with-udev-rules-dir=${prefix}/bin/udev/rules.d", + f"--with-systemduserunitdir={os.path.join(self.build_folder, 'ignore')}", + ]) + for lib in ["alsa", "x11", "openssl", "dbus"]: + tc.configure_args.append(f"--enable-{lib}={yes_no(getattr(self.options, f'with_{lib}'))}") + # TODO: to remove when automatically handled by AutotoolsToolchain + tc.configure_args.append("--libexecdir=${prefix}/bin") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + + def package_info(self): + self.cpp_info.components["pulse"].set_property("pkg_config_name", "libpulse") + self.cpp_info.components["pulse"].libs = ["pulse", f"pulsecommon-{self.version}"] + self.cpp_info.components["pulse"].libdirs.append(os.path.join("lib", "pulseaudio")) + self.cpp_info.components["pulse"].requires = ["libiconv::libiconv", "libsndfile::libsndfile", "libcap::libcap", "libtool::libtool"] + if self.options.with_alsa: + self.cpp_info.components["pulse"].requires.append("libalsa::libalsa") + if self.options.get_safe("with_fftw"): + self.cpp_info.components["pulse"].requires.append("fftw::fftw") + if self.options.with_x11: + self.cpp_info.components["pulse"].requires.append("xorg::xorg") + if self.options.with_openssl: + self.cpp_info.components["pulse"].requires.append("openssl::openssl") + if self.options.with_dbus: + self.cpp_info.components["pulse"].requires.append("dbus::dbus") + + self.cpp_info.components["pulse-simple"].set_property("pkg_config_name", "libpulse-simple") + self.cpp_info.components["pulse-simple"].libs = ["pulse-simple"] + self.cpp_info.components["pulse-simple"].defines.append("_REENTRANT") + self.cpp_info.components["pulse-simple"].requires = ["pulse"] + + if self.options.with_glib: + self.cpp_info.components["pulse-mainloop-glib"].set_property("pkg_config_name", "libpulse-mainloop-glib") + self.cpp_info.components["pulse-mainloop-glib"].libs = ["pulse-mainloop-glib"] + self.cpp_info.components["pulse-mainloop-glib"].defines.append("_REENTRANT") + self.cpp_info.components["pulse-mainloop-glib"].requires = ["pulse", "glib::glib-2.0"] + + # FIXME: add cmake generators when conan can generate PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY vars diff --git a/recipes/pulseaudio/all/test_package/CMakeLists.txt b/recipes/pulseaudio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a9b88d597549a --- /dev/null +++ b/recipes/pulseaudio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(pulseaudio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pulseaudio::pulseaudio) diff --git a/recipes/pulseaudio/all/test_package/conanfile.py b/recipes/pulseaudio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/pulseaudio/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pulseaudio/all/test_package/test_package.c b/recipes/pulseaudio/all/test_package/test_package.c new file mode 100644 index 0000000000000..bb944137b6045 --- /dev/null +++ b/recipes/pulseaudio/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("pulse audio verions %s\n", pa_get_library_version()); + return 0; +} diff --git a/recipes/pulseaudio/all/test_v1_package/CMakeLists.txt b/recipes/pulseaudio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/pulseaudio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pulseaudio/all/test_v1_package/conanfile.py b/recipes/pulseaudio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a691174f8ed16 --- /dev/null +++ b/recipes/pulseaudio/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/pulseaudio/config.yml b/recipes/pulseaudio/config.yml new file mode 100644 index 0000000000000..4aaa9c6cc7082 --- /dev/null +++ b/recipes/pulseaudio/config.yml @@ -0,0 +1,7 @@ +versions: + "14.2": + folder: all + "14.0": + folder: all + "13.0": + folder: all diff --git a/recipes/pupnp/all/conandata.yml b/recipes/pupnp/all/conandata.yml new file mode 100644 index 0000000000000..388307853302a --- /dev/null +++ b/recipes/pupnp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.12.1": + url: https://github.com/pupnp/pupnp/archive/release-1.12.1.tar.gz + sha256: b4fc8f8e78d5d3259f321aecab1bc9d9ef7b9cea816c4b4d850b264120773290 + "1.14.2": + url: https://github.com/pupnp/pupnp/archive/release-1.14.2.tar.gz + sha256: e1487800425e47a26998593c42256a61caa1cd1ec210029fe8050cf6bab9c334 + "1.14.12": + url: "https://github.com/pupnp/pupnp/archive/release-1.14.12.tar.gz" + sha256: "6a7f26818d5aa3949bc2e68739387a261c564430ba612f793c61d31619dde1e4" diff --git a/recipes/pupnp/all/conanfile.py b/recipes/pupnp/all/conanfile.py new file mode 100644 index 0000000000000..be3c8ca6dae34 --- /dev/null +++ b/recipes/pupnp/all/conanfile.py @@ -0,0 +1,140 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class PupnpConan(ConanFile): + name = "pupnp" + description = ( + "The portable Universal Plug and Play (UPnP) SDK " + "provides support for building UPnP-compliant control points, " + "devices, and bridges on several operating systems." + ) + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pupnp/pupnp" + topics = ("conan", "upnp", "networking") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ipv6": [True, False], + "reuseaddr": [True, False], + "webserver": [True, False], + "client": [True, False], + "device": [True, False], + "largefile": [True, False], + "tools": [True, False], + "blocking-tcp": [True, False], + "debug": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "ipv6": True, + "reuseaddr": True, + "webserver": True, + "client": True, + "device": True, + "largefile": True, + "tools": True, + "blocking-tcp": False, + "debug": True # Actually enables logging routines... + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.compiler == "Visual Studio": + # Note, pupnp has build instructions for Visual Studio but they + # include VC 6 and require pthreads-w32 library. + # Someone who needs it and has possibility to build it could step in. + raise ConanInvalidConfiguration("Visual Studio not supported yet in this recipe") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + self.build_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_autotools(self): + if not self._autotools: + args = [ + "--enable-static=%s" % ("no" if self.options.shared else "yes"), + "--enable-shared=%s" % ("yes" if self.options.shared else "no"), + "--disable-samples", + ] + + def enable_disable(opt): + what = "enable" if getattr(self.options, opt) else "disable" + return "--{}-{}".format(what, opt) + + args.extend( + map( + enable_disable, + ( + "ipv6", + "reuseaddr", + "webserver", + "client", + "device", + "largefile", + "tools", + "debug" + ), + ) + ) + + args.append("--%s-blocking_tcp_connections" % ("enable" if getattr(self.options, "blocking-tcp") else "disable")) + + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.configure(configure_dir=self._source_subfolder, args=args) + return self._autotools + + def build(self): + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libupnp" + self.cpp_info.libs = ["upnp", "ixml"] + self.cpp_info.includedirs.append(os.path.join("include", "upnp")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread"]) + self.cpp_info.cflags.extend(["-pthread"]) + self.cpp_info.cxxflags.extend(["-pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["iphlpapi", "ws2_32"]) diff --git a/recipes/pupnp/all/test_package/CMakeLists.txt b/recipes/pupnp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4715fd995b522 --- /dev/null +++ b/recipes/pupnp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pupnp REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} pupnp::pupnp) +set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99) diff --git a/recipes/pupnp/all/test_package/conanfile.py b/recipes/pupnp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..91263ae215697 --- /dev/null +++ b/recipes/pupnp/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import CMake, ConanFile, tools + + +class PupnpTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/pupnp/all/test_package/test_package.c b/recipes/pupnp/all/test_package/test_package.c new file mode 100644 index 0000000000000..42739f3885f90 --- /dev/null +++ b/recipes/pupnp/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include +#include + +int main() +{ + int ret = UpnpInit2(NULL, 0); + if (ret != UPNP_E_SUCCESS) + { + return EXIT_FAILURE; + } + int port = UpnpGetServerPort(); + printf("Bound at %s:%d\n", UpnpGetServerIpAddress(), port); + return EXIT_SUCCESS; +} diff --git a/recipes/pupnp/config.yml b/recipes/pupnp/config.yml new file mode 100644 index 0000000000000..700325f13fdc8 --- /dev/null +++ b/recipes/pupnp/config.yml @@ -0,0 +1,7 @@ +versions: + "1.12.1": + folder: all + "1.14.2": + folder: all + "1.14.12": + folder: all diff --git a/recipes/pybind11/all/conandata.yml b/recipes/pybind11/all/conandata.yml new file mode 100644 index 0000000000000..d2814f09ff728 --- /dev/null +++ b/recipes/pybind11/all/conandata.yml @@ -0,0 +1,19 @@ +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.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" diff --git a/recipes/pybind11/all/conanfile.py b/recipes/pybind11/all/conanfile.py new file mode 100644 index 0000000000000..4ca688fce0b2b --- /dev/null +++ b/recipes/pybind11/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy, replace_in_file, rm, rmdir +import os + + +required_conan_version = ">=1.52.0" + + +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" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["PYBIND11_INSTALL"] = True + tc.variables["PYBIND11_TEST"] = False + tc.variables["PYBIND11_CMAKECONFIG_INSTALL_DIR"] = "lib/cmake/pybind11" + 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() + for filename in ["pybind11Targets.cmake", "pybind11Config.cmake", "pybind11ConfigVersion.cmake"]: + rm(self, filename, os.path.join(self.package_folder, "lib", "cmake", "pybind11")) + + rmdir(self, os.path.join(self.package_folder, "share")) + + replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), + "if(TARGET pybind11::lto)", + "if(FALSE)") + replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), + "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") + self.cpp_info.components["headers"].includedirs = ["include"] + self.cpp_info.components["pybind11_"].set_property("cmake_target_name", "pybind11::pybind11") + self.cpp_info.components["pybind11_"].set_property("cmake_module_file_name", "pybind11") + self.cpp_info.components["pybind11_"].names["cmake_find_package"] = "pybind11" + self.cpp_info.components["pybind11_"].builddirs = [cmake_base_path] + self.cpp_info.components["pybind11_"].requires = ["headers"] + cmake_file = os.path.join(cmake_base_path, "pybind11Common.cmake") + self.cpp_info.set_property("cmake_build_modules", [cmake_file]) + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["pybind11_"].build_modules[generator].append(cmake_file) + self.cpp_info.components["embed"].requires = ["pybind11_"] + self.cpp_info.components["module"].requires = ["pybind11_"] + self.cpp_info.components["python_link_helper"].requires = ["pybind11_"] + self.cpp_info.components["windows_extras"].requires = ["pybind11_"] + self.cpp_info.components["lto"].requires = ["pybind11_"] + self.cpp_info.components["thin_lto"].requires = ["pybind11_"] + self.cpp_info.components["opt_size"].requires = ["pybind11_"] + self.cpp_info.components["python2_no_register"].requires = ["pybind11_"] diff --git a/recipes/pybind11/all/test_package/CMakeLists.txt b/recipes/pybind11/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d142acb135035 --- /dev/null +++ b/recipes/pybind11/all/test_package/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package 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/all/test_package/conanfile.py b/recipes/pybind11/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8c98920d26587 --- /dev/null +++ b/recipes/pybind11/all/test_package/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualRunEnv +from conan.tools.build import can_run + +import os +from pathlib import PurePath +import sys + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + toolchain = CMakeToolchain(self) + toolchain.variables["PYTHON_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + toolchain.generate() + + env = Environment() + env.append_path("PYTHONPATH", os.path.join(self.build_folder, self.cpp.build.libdirs[0])) + env.vars(self, scope="run").save_script("testrun") + + run = VirtualRunEnv(self) + run.generate() + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def test(self): + if can_run(self): + module_path = os.path.join(self.source_folder, "test.py") + self.run(f"{self._python_interpreter} {module_path}", env="conanrun") diff --git a/recipes/pybind11/all/test_package/test.py b/recipes/pybind11/all/test_package/test.py new file mode 100644 index 0000000000000..9b04318ad0f94 --- /dev/null +++ b/recipes/pybind11/all/test_package/test.py @@ -0,0 +1,5 @@ +import test_package + +print("Adding 2 + 3 = {}".format(test_package.add(2, 3))) + +print("Message: '{}'".format(test_package.msg())) diff --git a/recipes/pybind11/all/test_package/test_package.cpp b/recipes/pybind11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3c603471c8cb5 --- /dev/null +++ b/recipes/pybind11/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +static int add(int i, int j) { + return i + j; +} + +static const char *hello() { + return "Hello from the C++ world!"; +} + +PYBIND11_MODULE(test_package, m) { + m.doc() = "pybind11 example plugin"; // optional module docstring + + m.def("add", &add, "A function which adds two numbers"); + m.def("msg", &hello, "A function returning a message"); +} diff --git a/recipes/pybind11/all/test_v1_package/CMakeLists.txt b/recipes/pybind11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3cee2617c4143 --- /dev/null +++ b/recipes/pybind11/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_output_dirs_setup() +conan_set_rpath() +conan_set_std() +conan_set_fpic() +conan_check_compiler() +conan_set_libcxx() +conan_set_vs_runtime() + +find_package(Python COMPONENTS Interpreter Development) +find_package(pybind11 REQUIRED CONFIG) + +Python_add_library(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE pybind11::headers) +set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/pybind11/all/test_v1_package/conanfile.py b/recipes/pybind11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..922ac10548541 --- /dev/null +++ b/recipes/pybind11/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, CMake, tools +import os +import sys +from platform import python_version + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["PYTHON_EXECUTABLE"] = self._python_interpreter + cmake.configure() + cmake.build() + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def test(self): + if not tools.cross_building(self): + with tools.environment_append({"PYTHONPATH": "lib"}): + python_module = os.path.join(self.source_folder, "..", "test_package", "test.py") + self.run(f"{self._python_interpreter} {python_module}", run_environment=True) diff --git a/recipes/pybind11/config.yml b/recipes/pybind11/config.yml new file mode 100644 index 0000000000000..d015836d04db4 --- /dev/null +++ b/recipes/pybind11/config.yml @@ -0,0 +1,13 @@ +versions: + "2.7.1": + folder: all + "2.8.1": + folder: all + "2.9.1": + folder: all + "2.9.2": + folder: all + "2.10.0": + folder: all + "2.10.1": + folder: all diff --git a/recipes/pybind11_json/all/conandata.yml b/recipes/pybind11_json/all/conandata.yml new file mode 100644 index 0000000000000..58e86b8427d45 --- /dev/null +++ b/recipes/pybind11_json/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.2.13": + url: "https://github.com/pybind/pybind11_json/archive/0.2.13.tar.gz" + sha256: "6b12ddb4930a3135322890318fc15c4a69134f21120ea82163827c11411107a3" + "0.2.12": + url: "https://github.com/pybind/pybind11_json/archive/0.2.12.tar.gz" + sha256: "a9e308d4cf3de16d192cd0baf641bfe17a3a3046e8652e6724204afa3e736db7" + "0.2.11": + sha256: 7fbf30c2f184decf3987f4e177d0fb29a72adc86160e43907b18f0d93c935b36 + url: https://github.com/pybind/pybind11_json/archive/refs/tags/0.2.11.tar.gz diff --git a/recipes/pybind11_json/all/conanfile.py b/recipes/pybind11_json/all/conanfile.py new file mode 100644 index 0000000000000..4c4feedd8416a --- /dev/null +++ b/recipes/pybind11_json/all/conanfile.py @@ -0,0 +1,48 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class Pybind11JsonConan(ConanFile): + name = "pybind11_json" + homepage = "https://github.com/pybind/pybind11_json" + description = "An nlohmann_json to pybind11 bridge" + topics = ( + "conan", + "header-only", + "json", + "nlohmann_json", + "pybind11", + "pybind11_json", + "python", + "python-binding", + ) + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + license = "BSD-3-Clause" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def requirements(self): + self.requires("nlohmann_json/3.9.1") + self.requires("pybind11/2.6.2") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE*", src=self._source_subfolder, dst="licenses") + self.copy( + "*", dst="include", src=os.path.join(self._source_subfolder, "include") + ) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "pybind11_json" + self.cpp_info.names["cmake_find_package_multi"] = "pybind11_json" diff --git a/recipes/pybind11_json/all/test_package/CMakeLists.txt b/recipes/pybind11_json/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1ca457a18f13 --- /dev/null +++ b/recipes/pybind11_json/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(CMAKE_CXX_STANDARD 11) + +find_package(pybind11_json REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PUBLIC pybind11_json::pybind11_json) # FIXME: target should be pybind11_json diff --git a/recipes/pybind11_json/all/test_package/conanfile.py b/recipes/pybind11_json/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/pybind11_json/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pybind11_json/all/test_package/test_package.cpp b/recipes/pybind11_json/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e50fae0cd666 --- /dev/null +++ b/recipes/pybind11_json/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include "pybind11_json/pybind11_json.hpp" + +#include "nlohmann/json.hpp" + +#include "pybind11/embed.h" +#include "pybind11/pybind11.h" + +#include +#include + +namespace nl = nlohmann; +namespace py = pybind11; +using namespace pybind11::literals; + +int main() { + // Required to run a standalone C++ application (https://pybind11.readthedocs.io/en/stable/advanced/embedding.html) + py::scoped_interpreter guard{}; + + const py::dict original_py_dict{"number"_a=1234, "hello"_a="world"}; + + const nl::json converted_nl_json{original_py_dict}; + std::cout << "Converted nlohmann::json contents: " << converted_nl_json << std::endl; + + const py::dict converted_py_dict = converted_nl_json.front(); // assigning the only list element + + std::cout << "Converted py::dict contents: {hello:" << converted_py_dict["hello"].cast() + << ", number:" << converted_py_dict["number"].cast() << "}" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/pybind11_json/config.yml b/recipes/pybind11_json/config.yml new file mode 100644 index 0000000000000..d889e66f48c37 --- /dev/null +++ b/recipes/pybind11_json/config.yml @@ -0,0 +1,7 @@ +versions: + "0.2.13": + folder: all + "0.2.12": + folder: all + "0.2.11": + folder: all diff --git a/recipes/pystring/all/CMakeLists.txt b/recipes/pystring/all/CMakeLists.txt new file mode 100644 index 0000000000000..cde5a5799d904 --- /dev/null +++ b/recipes/pystring/all/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.4) +project(pystring LANGUAGES CXX) + +include(GNUInstallDirs) + +add_library(pystring ${PYSTRING_SRC_DIR}/pystring.cpp) +set_property(TARGET pystring PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +install(TARGETS pystring + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${PYSTRING_SRC_DIR}/pystring.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/pystring/all/conandata.yml b/recipes/pystring/all/conandata.yml new file mode 100644 index 0000000000000..38de0bc9db7af --- /dev/null +++ b/recipes/pystring/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.4": + url: "https://github.com/imageworks/pystring/archive/refs/tags/v1.1.4.tar.gz" + sha256: "49da0fe2a049340d3c45cce530df63a2278af936003642330287b68cefd788fb" + "1.1.3": + url: "https://github.com/imageworks/pystring/archive/refs/tags/v1.1.3.tar.gz" + sha256: "358a56e756e701836b69a31c75d3d9d41c34d447cf7b3775bbd5620dcd3203d9" diff --git a/recipes/pystring/all/conanfile.py b/recipes/pystring/all/conanfile.py new file mode 100644 index 0000000000000..aae1b97c58843 --- /dev/null +++ b/recipes/pystring/all/conanfile.py @@ -0,0 +1,61 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class PystringConan(ConanFile): + name = "pystring" + description = "Pystring is a collection of C++ functions which match the " \ + "interface and behavior of python's string class methods using std::string." + license = "BSD-3-Clause" + topics = ("pystring", "string") + homepage = "https://github.com/imageworks/pystring" + 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, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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["PYSTRING_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 = ["pystring"] diff --git a/recipes/pystring/all/test_package/CMakeLists.txt b/recipes/pystring/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..56a7416627067 --- /dev/null +++ b/recipes/pystring/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(pystring REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pystring::pystring) diff --git a/recipes/pystring/all/test_package/conanfile.py b/recipes/pystring/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/pystring/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/pystring/all/test_package/test_package.cpp b/recipes/pystring/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d0d9b4674527 --- /dev/null +++ b/recipes/pystring/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << pystring::capitalize("conan-center-index") << std::endl; + return 0; +} diff --git a/recipes/pystring/all/test_v1_package/CMakeLists.txt b/recipes/pystring/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/pystring/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pystring/all/test_v1_package/conanfile.py b/recipes/pystring/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pystring/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/pystring/config.yml b/recipes/pystring/config.yml new file mode 100644 index 0000000000000..7f3d713ab8481 --- /dev/null +++ b/recipes/pystring/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.4": + folder: all + "1.1.3": + folder: all diff --git a/recipes/qarchive/all/conandata.yml b/recipes/qarchive/all/conandata.yml new file mode 100644 index 0000000000000..da2432b9b6e33 --- /dev/null +++ b/recipes/qarchive/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "2.2.4": + url: "https://github.com/antony-jr/QArchive/archive/v2.2.4.tar.gz" + sha256: "7c7f0e3bf3d6fb5130aa4632201873511944cd98ab16b273da5072198f53ad7b" + "2.2.3": + url: "https://github.com/antony-jr/QArchive/archive/v2.2.3.tar.gz" + sha256: "2ada10efda34fe96c25744dd67e74ec68587d30ab01cc20be25cbcfb1e6262c4" + "2.1.1": + url: "https://github.com/antony-jr/QArchive/archive/v2.1.1.tar.gz" + sha256: "4ed51121a5bc9b5981d2fa3927f951a6a91ccca233d6b6dc4fef55b4ca5a2d92" + "2.0.2": + url: "https://github.com/antony-jr/QArchive/archive/v2.0.2.tar.gz" + sha256: "f59207c0da2d68bbbdaca79751f08018226d3b587e3f97156b3aee994db018f6" + "2.0.1": + url: "https://github.com/antony-jr/QArchive/archive/v2.0.1.tar.gz" + sha256: "ee8e259795f4f991c0465c3d95cf018bea2a72e9a31f744f2344aaa43201f369" +patches: + "2.1.1": + - patch_file: "patches/0001-cmake-conan-compatibility.patch" + - patch_file: "patches/0002-export-symbols.patch" + "2.0.2": + - patch_file: "patches/0001-cmake-conan-compatibility.patch" + - patch_file: "patches/0002-export-symbols.patch" + "2.0.1": + - patch_file: "patches/0001-cmake-conan-compatibility.patch" + - patch_file: "patches/0002-export-symbols.patch" diff --git a/recipes/qarchive/all/conanfile.py b/recipes/qarchive/all/conanfile.py new file mode 100644 index 0000000000000..b299a0c2ae050 --- /dev/null +++ b/recipes/qarchive/all/conanfile.py @@ -0,0 +1,114 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class QarchiveConan(ConanFile): + name = "qarchive" + license = "BSD-3-Clause" + homepage = "https://antonyjr.in/QArchive/" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "QArchive is a cross-platform C++ library that modernizes libarchive, " + "This library helps you to extract and compress archives supported by libarchive" + ) + topics = ("qt", "compress", "libarchive") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _qt_major(self): + return Version(self.dependencies["qt"].ref.version).major + + 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("libarchive/3.6.2") + self.requires("qt/5.15.9") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.17 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QARCHIVE_QT_VERSION_MAJOR"] = self._qt_major + 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, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"QArchive": "QArchive::QArchive"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "QArchive") + self.cpp_info.set_property("cmake_target_name", "QArchive") + self.cpp_info.set_property("pkg_config_name", "QArchive") + self.cpp_info.libs = ["QArchive"] + self.cpp_info.includedirs = [os.path.join("include", "QArchive")] + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "QArchive" + self.cpp_info.names["cmake_find_package_multi"] = "QArchive" + self.cpp_info.names["pkg_config"] = "QArchive" + 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/qarchive/all/patches/0001-cmake-conan-compatibility.patch b/recipes/qarchive/all/patches/0001-cmake-conan-compatibility.patch new file mode 100644 index 0000000000000..bb5d55c47afca --- /dev/null +++ b/recipes/qarchive/all/patches/0001-cmake-conan-compatibility.patch @@ -0,0 +1,18 @@ +--- CMakeLists.txt 2021-03-08 15:56:55.000000000 -0300 ++++ CMakeLists_fix.txt 2021-03-09 22:08:29.715545030 -0300 +@@ -11,13 +11,11 @@ + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + +-set(CMAKE_CXX_FLAGS_DEBUG "-g") +-set(CMAKE_CXX_FLAGS_RELEASE "-O3") + option(QARCHIVE_STATIC "Static Build of QArchive" ON) + + # Find the QtCore library and libarchive. +-find_package(LibArchive) +-find_package(Qt5Core) ++find_package(LibArchive REQUIRED) ++find_package(Qt5 REQUIRED COMPONENTS Core) + + # cmake macros used + include(GNUInstallDirs) diff --git a/recipes/qarchive/all/patches/0002-export-symbols.patch b/recipes/qarchive/all/patches/0002-export-symbols.patch new file mode 100644 index 0000000000000..1ca6edf716eac --- /dev/null +++ b/recipes/qarchive/all/patches/0002-export-symbols.patch @@ -0,0 +1,15 @@ +--- a/include/qarchive_enums.hpp ++++ b/include/qarchive_enums.hpp +@@ -1,10 +1,11 @@ + #ifndef QARCHIVE_ENUMS_HPP_INCLUDED + #define QARCHIVE_ENUMS_HPP_INCLUDED ++#include "qarchive_global.hpp" + class QString; + namespace QArchive { + /* A function that converts the enum value to its variable + * name to be used by users. + */ +-QString errorCodeToString(short); ++QARCHIVE_EXPORT QString errorCodeToString(short); + + /* diff --git a/recipes/qarchive/all/test_package/CMakeLists.txt b/recipes/qarchive/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb399371778cf --- /dev/null +++ b/recipes/qarchive/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(QArchive REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} QArchive) +# Must compile with "-fPIC" since Qt was built with -reduce-relocations. +target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/qarchive/all/test_package/conanfile.py b/recipes/qarchive/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8e6ae76816f4e --- /dev/null +++ b/recipes/qarchive/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "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/qarchive/all/test_package/test_package.cpp b/recipes/qarchive/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7ab801d5a5a15 --- /dev/null +++ b/recipes/qarchive/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +int main(int argc, char **argv) +{ + QArchive::DiskExtractor Extractor("Test.7z"); + + Extractor.start(); + Extractor.cancel(); + + return 0; +} diff --git a/recipes/qarchive/all/test_v1_package/CMakeLists.txt b/recipes/qarchive/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/qarchive/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/qarchive/all/test_v1_package/conanfile.py b/recipes/qarchive/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/qarchive/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qarchive/config.yml b/recipes/qarchive/config.yml new file mode 100644 index 0000000000000..3db8c0c3676e9 --- /dev/null +++ b/recipes/qarchive/config.yml @@ -0,0 +1,11 @@ +versions: + "2.2.4": + folder: all + "2.2.3": + folder: all + "2.1.1": + folder: all + "2.0.2": + folder: all + "2.0.1": + folder: all diff --git a/recipes/qcbor/all/conandata.yml b/recipes/qcbor/all/conandata.yml new file mode 100644 index 0000000000000..5b5b4f359cdd2 --- /dev/null +++ b/recipes/qcbor/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "1.2": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.2.tar.gz" + sha256: "0f706ad90ada600bd1ddbdf8dc6f2f5910e11de355bb4454b9b4123f0e4ff525" + "1.1": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.1.tar.gz" + sha256: "1e7e8986bf918eafb11f5373df9b80fd56811d2cd39c7630d8171130802199b6" + "1.0": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.0.tar.gz" + sha256: "961a46eb5a599cc040bfce4f4fade4427e046f1748f37ba4ebbc097fb9cdf1d3" +patches: + "1.2": + - patch_file: "patches/1.2-0001-fix-cmake.patch" + patch_description: "disable fix fPIC and add installation" + patch_type: "conan" + "1.1": + - patch_file: "patches/1.1-0001-fix-cmake.patch" + patch_description: "link mathlib and add installation" + patch_type: "conan" + "1.0": + - patch_file: "patches/1.0-0001-fix-cmake.patch" + patch_description: "link mathlib and add installation" + patch_type: "conan" diff --git a/recipes/qcbor/all/conanfile.py b/recipes/qcbor/all/conanfile.py new file mode 100644 index 0000000000000..7d87de4445169 --- /dev/null +++ b/recipes/qcbor/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, load, save +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version + +import os +import re + +required_conan_version = ">=1.53.0" + +class QCBORConan(ConanFile): + name = "qcbor" + description = "Comprehensive, powerful, commercial-quality CBOR encoder/decoder that is still suited for small devices." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/laurencelundblade/QCBOR" + topics = ("serialization", "cbor", "rfc-7049", "rfc-8949") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_float": [False, "HW_USE", "PREFERRED", "ALL"], + } + default_options = { + "shared": False, + "fPIC": True, + "disable_float": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + if Version(self.version) < "1.2": + del self.options.disable_float + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "1.2": + tc.variables["QCBOR_OPT_DISABLE_FLOAT_HW_USE"] = self.options.disable_float in ["HW_USE", "PREFERRED", "ALL"] + tc.variables["QCBOR_OPT_DISABLE_FLOAT_PREFERRED"] = self.options.disable_float in ["PREFERRED", "ALL"] + tc.variables["QCBOR_OPT_DISABLE_FLOAT_ALL"] = self.options.disable_float == "ALL" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # Extract the License/s from README.md to a file + tmp = load(self, os.path.join(self.source_folder, "inc", "qcbor", "qcbor.h")) + license_contents = re.search("( Copyright.*) =====", tmp, re.DOTALL)[1] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + def package_info(self): + self.cpp_info.libs = ["qcbor"] + if self.settings.os in ["Linux", "FreeBSD"] and \ + (Version(self.version) < "1.2" or self.options.disable_float == False): + self.cpp_info.system_libs.append("m") diff --git a/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..d5f6fcb7e4dba --- /dev/null +++ b/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8a5bcd0..744662e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,3 +17,18 @@ set(SOURCE + ) + + add_library(qcbor ${SOURCE}) ++set_target_properties(qcbor PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++) ++ ++find_library(LIBM m) ++target_link_libraries(qcbor PRIVATE $<$:${LIBM}>) ++ ++include(GNUInstallDirs) ++install(TARGETS qcbor ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++install(DIRECTORY "inc/qcbor" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e5969488c2420 --- /dev/null +++ b/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f0b67b9..4b00b8b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,3 +17,19 @@ set(SOURCE + add_library(qcbor ${SOURCE}) + + target_include_directories(qcbor PUBLIC inc) ++ ++set_target_properties(qcbor PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++) ++ ++find_library(LIBM m) ++target_link_libraries(qcbor PRIVATE $<$:${LIBM}>) ++ ++include(GNUInstallDirs) ++install(TARGETS qcbor ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++install(DIRECTORY "inc/qcbor" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8b659e24ca0a3 --- /dev/null +++ b/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 486946c..4234a59 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,10 +58,14 @@ target_compile_definitions(qcbor + $<$:USEFULBUF_DISABLE_ALL_FLOAT> + ) + +-if (BUILD_SHARED_LIBS) ++if (0) + target_compile_options(qcbor PRIVATE -Os -fPIC) + endif() + ++set_target_properties(qcbor PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++) ++ + # The math library is needed for floating-point support. + # To avoid need for it #define QCBOR_DISABLE_FLOAT_HW_USE + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") +@@ -75,3 +79,12 @@ endif() + if (NOT BUILD_QCBOR_TEST STREQUAL "OFF") + add_subdirectory(test) + endif() ++ ++include(GNUInstallDirs) ++install(TARGETS qcbor ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++install(DIRECTORY "inc/qcbor" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/qcbor/all/test_package/CMakeLists.txt b/recipes/qcbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc1e8dfcced62 --- /dev/null +++ b/recipes/qcbor/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(qcbor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE qcbor::qcbor) diff --git a/recipes/qcbor/all/test_package/conanfile.py b/recipes/qcbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/qcbor/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/qcbor/all/test_package/test_package.c b/recipes/qcbor/all/test_package/test_package.c new file mode 100644 index 0000000000000..5209a291a657d --- /dev/null +++ b/recipes/qcbor/all/test_package/test_package.c @@ -0,0 +1,18 @@ +#include + +#include "qcbor/qcbor_encode.h" +#include "qcbor/qcbor_decode.h" +#include "qcbor/qcbor_spiffy_decode.h" + +int main() { + UsefulBuf_MAKE_STACK_UB(EngineBuffer, 300); + UsefulBufC EncodedEngine; + + QCBOREncodeContext EncodeCtx; + QCBOREncode_Init(&EncodeCtx, EngineBuffer); + + QCBOREncode_CloseArray(&EncodeCtx); + QCBOREncode_CloseMap(&EncodeCtx); + + return 0; +} diff --git a/recipes/qcbor/all/test_v1_package/CMakeLists.txt b/recipes/qcbor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..46fc5f986a893 --- /dev/null +++ b/recipes/qcbor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_packages) + +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/qcbor/all/test_v1_package/conanfile.py b/recipes/qcbor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/qcbor/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qcbor/config.yml b/recipes/qcbor/config.yml new file mode 100644 index 0000000000000..db25e2b16686a --- /dev/null +++ b/recipes/qcbor/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2": + folder: all + "1.1": + folder: all + "1.0": + folder: all diff --git a/recipes/qcoro/all/CMakeLists.txt b/recipes/qcoro/all/CMakeLists.txt new file mode 100644 index 0000000000000..434aea21733de --- /dev/null +++ b/recipes/qcoro/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/qcoro/all/conandata.yml b/recipes/qcoro/all/conandata.yml new file mode 100644 index 0000000000000..f303943d3a6a1 --- /dev/null +++ b/recipes/qcoro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.0": + url: "https://github.com/danvratil/qcoro/archive/refs/tags/v0.4.0.tar.gz" + sha256: "0e68b3f0ce7bf521ffbdd731464d2d60d8d7a39a749b551ed26855a1707d86d1" diff --git a/recipes/qcoro/all/conanfile.py b/recipes/qcoro/all/conanfile.py new file mode 100644 index 0000000000000..75c84c084c061 --- /dev/null +++ b/recipes/qcoro/all/conanfile.py @@ -0,0 +1,146 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class QCoroConan(ConanFile): + name = "qcoro" + license = "MIT" + homepage = "https://github.com/danvratil/qcoro" + url = "https://github.com/conan-io/conan-center-index" + description = "C++ Coroutines for Qt." + topics = ("coroutines", "qt") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "asan": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "asan": False, + } + generators = "cmake", "cmake_find_package_multi" + exports_sources = ["CMakeLists.txt"] + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _compilers_minimum_version(self): + minimum_versions = { + "gcc": "10", + "Visual Studio": "17", + "msvc": "19.29", + "clang": "8", + "apple-clang": "13" + } + return minimum_versions + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def build_requirements(self): + self.build_requires("cmake/3.23.2") + + def requirements(self): + self.requires("qt/6.3.1") + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 20) + + 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] + + #Special check for clang that can only be linked to libc++ + if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": + raise ConanInvalidConfiguration("imagl requires some C++20 features, which are available in libc++ for clang compiler.") + + compiler_version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("qcoro requires C++20. Your compiler is unknown. Assuming it supports C++20.") + elif lazy_lt_semver(compiler_version, minimum_version): + raise ConanInvalidConfiguration("qcoro requires some C++20 features, which your {} {} compiler does not support.".format(str(self.settings.compiler), compiler_version)) + else: + print("Your compiler is {} {} and is compatible.".format(str(self.settings.compiler), compiler_version)) + + 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["QCORO_BUILD_EXAMPLES"] = False + self._cmake.definitions["QCORO_ENABLE_ASAN"] = self.options.asan + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.definitions["QCORO_WITH_QTDBUS"] = self.options["qt"].with_dbus + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("*", dst="licenses", src=os.path.join(self._source_subfolder, "LICENSES")) + cmake = self._configure_cmake() + cmake.install() + + for mask in ["Find*.cmake", "*Config*.cmake", "*-config.cmake", "*Targets*.cmake"]: + tools.remove_files_by_mask(self.package_folder, mask) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "QCoro6" + self.cpp_info.filenames["cmake_find_package_multi"] = "QCoro6" + self.cpp_info.set_property("cmake_file_name", "QCoro6") + self.cpp_info.names["cmake_find_package"] = "QCoro" + self.cpp_info.names["cmake_find_package_multi"] = "QCoro" + + self.cpp_info.components["qcoro-core"].set_property("cmake_target_name", "QCoro::Core") + self.cpp_info.components["qcoro-core"].names["cmake_find_package"] = "Core" + self.cpp_info.components["qcoro-core"].names["cmake_find_package_multi"] = "Core" + self.cpp_info.components["qcoro-core"].libs = ["QCoro6Core"] + self.cpp_info.components["qcoro-core"].includedirs.append(os.path.join("include", "qcoro6", "qcoro")) + self.cpp_info.components["qcoro-core"].requires = ["qt::qtCore"] + self.cpp_info.components["qcoro-core"].build_modules["cmake_find_package"].append(os.path.join("lib", "cmake", "QCoro6Coro", "QCoroMacros.cmake")) + self.cpp_info.components["qcoro-core"].build_modules["cmake_find_package_multi"].append(os.path.join("lib", "cmake", "QCoro6Coro", "QCoroMacros.cmake")) + self.cpp_info.components["qcoro-core"].builddirs.append(os.path.join("lib", "cmake", "QCoro6Coro")) + + self.cpp_info.components["qcoro-network"].set_property("cmake_target_name", "QCoro::Network") + self.cpp_info.components["qcoro-network"].names["cmake_find_package"] = "Network" + self.cpp_info.components["qcoro-network"].names["cmake_find_package_multi"] = "Network" + self.cpp_info.components["qcoro-network"].libs = ["QCoro6Network"] + self.cpp_info.components["qcoro-network"].requires = ["qt::qtNetwork"] + + if self.options["qt"].with_dbus: + self.cpp_info.components["qcoro-dbus"].set_property("cmake_target_name", "QCoro::DBus") + self.cpp_info.components["qcoro-dbus"].names["cmake_find_package"] = "DBus" + self.cpp_info.components["qcoro-dbus"].names["cmake_find_package_multi"] = "DBus" + self.cpp_info.components["qcoro-dbus"].libs = ["QCoroDBus"] + self.cpp_info.components["qcoro-core"].requires = ["qt::qtDBus"] diff --git a/recipes/qcoro/all/test_package/CMakeLists.txt b/recipes/qcoro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07490bf8a1415 --- /dev/null +++ b/recipes/qcoro/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(QCoro6 REQUIRED COMPONENTS Core) +qcoro_enable_coroutines() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} QCoro::Core + Qt6::Core + Qt6::Concurrent) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) diff --git a/recipes/qcoro/all/test_package/conanfile.py b/recipes/qcoro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..93bd98dd9415a --- /dev/null +++ b/recipes/qcoro/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build_requirements(self): + self.build_requires("cmake/3.23.2") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/qcoro/all/test_package/test_package.cpp b/recipes/qcoro/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a01824f987d94 --- /dev/null +++ b/recipes/qcoro/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: 2021 Daniel Vrátil +// +// SPDX-License-Identifier: MIT + +#include "qcorofuture.h" + +#include +#include +#include + +#include +#include + +QCoro::Task<> startTask() { + const auto data = co_await QtConcurrent::run([]() { + QVector data; + std::random_device rd{}; + std::mt19937 gen{rd()}; + data.reserve(10'000'000); + for (int i = 0; i < 10'000'000; ++i) { + data.push_back(gen()); + } + return data; + }); + + std::cout << "Generated " << data.size() << " random numbers" << std::endl; + + const auto sum = co_await QtConcurrent::filteredReduced( + data, [](const auto &) { return true; }, + [](std::uint64_t &interm, std::uint64_t val) { interm += val; }, + QtConcurrent::UnorderedReduce); + + std::cout << "Calculated result: " << sum << std::endl; + qApp->quit(); +} + +int main(int argc, char **argv) { + QCoreApplication app(argc, argv); + QTimer::singleShot(0, startTask); + return app.exec(); +} diff --git a/recipes/qcoro/config.yml b/recipes/qcoro/config.yml new file mode 100644 index 0000000000000..af29e78bd9b25 --- /dev/null +++ b/recipes/qcoro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.0": + folder: all diff --git a/recipes/qcustomplot/all/CMakeLists.txt b/recipes/qcustomplot/all/CMakeLists.txt new file mode 100644 index 0000000000000..108a85b9380f1 --- /dev/null +++ b/recipes/qcustomplot/all/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required(VERSION 3.8) +project(qcustomplot LANGUAGES CXX) + +option(QCUSTOMPLOT_USE_OPENGL "Use OpenGL" OFF) + +add_library(${PROJECT_NAME} ${QCUSTOMPLOT_SRC_DIR}/qcustomplot.cpp) +set_target_properties(${PROJECT_NAME} + PROPERTIES + AUTOMOC ON + DEBUG_POSTFIX "d" + VERSION ${QCUSTOMPLOT_VERSION} + SOVERSION ${QCUSTOMPLOT_VERSION_MAJOR} +) +if(BUILD_SHARED_LIBS) + target_compile_definitions(${PROJECT_NAME} + PRIVATE QCUSTOMPLOT_COMPILE_LIBRARY + INTERFACE QCUSTOMPLOT_USE_LIBRARY + ) + set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON + ) +endif() + +if(QCUSTOMPLOT_USE_OPENGL) + target_compile_definitions(${PROJECT_NAME} PUBLIC QCUSTOMPLOT_USE_OPENGL) + + # Set a variable to ensure that OpenGL is found through the find_package statements below. + set(OPENGL_COMPONENT "OpenGL") + + # QCustomPlot does not use the QOpenGLFunctions class, and instead needs to link directly + # to OpenGL32.lib on Windows, regardless of whether qt:opengl is 'dynamic' or 'desktop' + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + find_package(OpenGL REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL) + endif() +endif() + +if(QT_VERSION VERSION_GREATER_EQUAL "6.0.0") + find_package(Qt6 COMPONENTS Core Gui Widgets PrintSupport ${OPENGL_COMPONENT} REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PUBLIC Qt6::Core Qt6::Gui Qt6::Widgets Qt6::PrintSupport + $<$:Qt6::OpenGL>) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +elseif(QT_VERSION VERSION_GREATER_EQUAL "5.0.0") + find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport ${OPENGL_COMPONENT} REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport + $<$:Qt5::OpenGL>) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +else() + message(FATAL_ERROR "Qt < 5 not yet supported in this recipe") +endif() + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install(FILES ${QCUSTOMPLOT_SRC_DIR}/qcustomplot.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/qcustomplot/all/conandata.yml b/recipes/qcustomplot/all/conandata.yml new file mode 100644 index 0000000000000..9655ef7e13aab --- /dev/null +++ b/recipes/qcustomplot/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.1.1": + url: "https://www.qcustomplot.com/release/2.1.1/QCustomPlot-source.tar.gz" + sha256: "5e2d22dec779db8f01f357cbdb25e54fbcf971adaee75eae8d7ad2444487182f" + "2.1.0": + url: "https://www.qcustomplot.com/release/2.1.0fixed/QCustomPlot-source.tar.gz" + sha256: "357b78be0f52b2d01c17ec3e2e1271255761810af7e8a9476cef51fccf1a0f44" + "1.3.2": + url: "https://www.qcustomplot.com/release/1.3.2/QCustomPlot.tar.gz" + sha256: "ea2ed5712c2020b25f40eacabd0926ef71a7f07e2a3771c32d53ace1f47123eb" +patches: + "2.1.0": + - patch_file: "patches/0001-fix-for-qt6.2.patch" diff --git a/recipes/qcustomplot/all/conanfile.py b/recipes/qcustomplot/all/conanfile.py new file mode 100644 index 0000000000000..067cd911c84e9 --- /dev/null +++ b/recipes/qcustomplot/all/conanfile.py @@ -0,0 +1,109 @@ +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, get, export_conandata_patches, replace_in_file +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class QCustomPlotConan(ConanFile): + name = "qcustomplot" + description = "QCustomPlot is a Qt C++ widget for plotting and data visualization." + license = "GPL-3.0-only" + topics = ("chart", "data-visualization", "graph", "plot", "qt") + homepage = "https://www.qcustomplot.com" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_opengl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_opengl": False, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + # FIXME: we shouldn't have to force shared in qt, but config file + # generated by conan in qt static is likely broken, or maybe env vars. + self.options["qt"].shared = True + + def requirements(self): + if Version(self.version) >= "2.0.0": + self.requires("qt/6.4.1") + else: + self.requires("qt/5.15.7") + if self.options.with_opengl and self.settings.os == "Windows": + self.requires("opengl/system") + + def validate(self): + if self.info.settings.compiler.cppstd: + min_cppstd = "11" if Version(self.dependencies["qt"].ref.version) < "6.0.0" else "17" + check_min_cppstd(self, min_cppstd) + if not (self.dependencies["qt"].options.gui and self.dependencies["qt"].options.widgets): + raise ConanInvalidConfiguration(f"{self.ref} requires qt gui and widgets") + if self.info.options.with_opengl and self.dependencies["qt"].options.opengl == "no": + raise ConanInvalidConfiguration(f"{self.ref} with opengl requires Qt with opengl enabled") + + 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["QCUSTOMPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["QCUSTOMPLOT_VERSION"] = self.version + tc.variables["QCUSTOMPLOT_VERSION_MAJOR"] = str(Version(self.version).major) + tc.variables["QT_VERSION"] = self.dependencies["qt"].ref.version + tc.variables["QCUSTOMPLOT_USE_OPENGL"] = self.options.with_opengl + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) >= "2.0.0": + # allow static qcustomplot with shared qt, and vice versa + replace_in_file(self, os.path.join(self.source_folder, "qcustomplot.h"), + "#if defined(QT_STATIC_BUILD)", + "#if 0" if self.options.shared else "#if 1") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "GPL.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + postfix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"qcustomplot{postfix}"] + self.cpp_info.requires = ["qt::qtCore", "qt::qtGui", "qt::qtWidgets", "qt::qtPrintSupport"] + if self.options.shared: + self.cpp_info.defines.append("QCUSTOMPLOT_USE_LIBRARY") + if self.options.with_opengl: + self.cpp_info.defines.append("QCUSTOMPLOT_USE_OPENGL") + if self.settings.os == "Windows": + self.cpp_info.requires.append("opengl::opengl") diff --git a/recipes/qcustomplot/all/patches/0001-fix-for-qt6.2.patch b/recipes/qcustomplot/all/patches/0001-fix-for-qt6.2.patch new file mode 100644 index 0000000000000..3b6c2b58a1b8a --- /dev/null +++ b/recipes/qcustomplot/all/patches/0001-fix-for-qt6.2.patch @@ -0,0 +1,78 @@ +patch from https://www.qcustomplot.com/index.php/support/forum/2380 + +--- a/qcustomplot.h ++++ b/qcustomplot.h +@@ -156,26 +156,8 @@ class QCPPolarGraph; + + It provides QMetaObject-based reflection of its enums and flags via \a QCP::staticMetaObject. + */ +-#ifndef Q_MOC_RUN + namespace QCP { +-#else +-class QCP { // when in moc-run, make it look like a class, so we get Q_GADGET, Q_ENUMS/Q_FLAGS features in namespace +- Q_GADGET +- Q_ENUMS(ExportPen) +- Q_ENUMS(ResolutionUnit) +- Q_ENUMS(SignDomain) +- Q_ENUMS(MarginSide) +- Q_FLAGS(MarginSides) +- Q_ENUMS(AntialiasedElement) +- Q_FLAGS(AntialiasedElements) +- Q_ENUMS(PlottingHint) +- Q_FLAGS(PlottingHints) +- Q_ENUMS(Interaction) +- Q_FLAGS(Interactions) +- Q_ENUMS(SelectionRectMode) +- Q_ENUMS(SelectionType) +-public: +-#endif ++ Q_NAMESPACE + + /*! + Defines the different units in which the image resolution can be specified in the export +@@ -318,6 +300,20 @@ enum SelectionType { stNone ///< The plottable is not selectable + ,stMultipleDataRanges ///< Any combination of data points/ranges can be selected + }; + ++ Q_ENUM_NS(ExportPen) ++ Q_ENUM_NS(ResolutionUnit) ++ Q_ENUM_NS(SignDomain) ++ Q_ENUM_NS(MarginSide) ++ Q_FLAG_NS(MarginSides) ++ Q_ENUM_NS(AntialiasedElement) ++ Q_FLAG_NS(AntialiasedElements) ++ Q_ENUM_NS(PlottingHint) ++ Q_FLAG_NS(PlottingHints) ++ Q_ENUM_NS(Interaction) ++ Q_FLAG_NS(Interactions) ++ Q_ENUM_NS(SelectionRectMode) ++ Q_ENUM_NS(SelectionType) ++ + /*! \internal + + Returns whether the specified \a value is considered an invalid data value for plottables (i.e. +@@ -378,23 +374,12 @@ inline int getMarginValue(const QMargins &margins, QCP::MarginSide side) + return 0; + } + +- +-extern const QMetaObject staticMetaObject; // in moc-run we create a static meta object for QCP "fake" object. This line is the link to it via QCP::staticMetaObject in normal operation as namespace +- + } // end of namespace QCP + Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements) + Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints) + Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides) + Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions) +-Q_DECLARE_METATYPE(QCP::ExportPen) +-Q_DECLARE_METATYPE(QCP::ResolutionUnit) +-Q_DECLARE_METATYPE(QCP::SignDomain) +-Q_DECLARE_METATYPE(QCP::MarginSide) +-Q_DECLARE_METATYPE(QCP::AntialiasedElement) +-Q_DECLARE_METATYPE(QCP::PlottingHint) +-Q_DECLARE_METATYPE(QCP::Interaction) +-Q_DECLARE_METATYPE(QCP::SelectionRectMode) +-Q_DECLARE_METATYPE(QCP::SelectionType) ++//no need to use Q_DECLARE_METATYPE on enum since Q_ENUM_NS adds enum as metatype automatically + + /* end of 'src/global.h' */ + diff --git a/recipes/qcustomplot/all/test_package/CMakeLists.txt b/recipes/qcustomplot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c4ecbcbc5832 --- /dev/null +++ b/recipes/qcustomplot/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(qcustomplot REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE qcustomplot::qcustomplot) + +if(QT_VERSION VERSION_GREATER_EQUAL "6.0.0") + find_package(Qt6 COMPONENTS Core Widgets REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +elseif(QT_VERSION VERSION_GREATER_EQUAL "5.0.0") + find_package(Qt5 COMPONENTS Core Widgets REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Widgets) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +else() + message(FATAL_ERROR "Qt < 5 not yet supported in this recipe") +endif() diff --git a/recipes/qcustomplot/all/test_package/conanfile.py b/recipes/qcustomplot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..82919b2651add --- /dev/null +++ b/recipes/qcustomplot/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QT_VERSION"] = self.dependencies["qt"].ref.version + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + # can't run in Linux agents (headless) + if can_run(self) and self.settings.os != "Linux": + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qcustomplot/all/test_package/test_package.cpp b/recipes/qcustomplot/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d8704b43d7898 --- /dev/null +++ b/recipes/qcustomplot/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include +#include +#include + +int main(int argc, char *argv[]) { + QApplication app(argc, argv); + QMainWindow window; + + QCustomPlot customPlot; + window.setCentralWidget(&customPlot); + + QVector x(101), y(101); + for (int i = 0; i < 101; ++i) { + x[i] = i / 50.0 - 1; + y[i] = x[i] * x[i]; + } + customPlot.addGraph(); + customPlot.graph(0)->setData(x, y); + customPlot.xAxis->setLabel("x"); + customPlot.yAxis->setLabel("y"); + customPlot.rescaleAxes(); + + window.setGeometry(100, 100, 500, 400); + return 0; +} diff --git a/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt b/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/qcustomplot/all/test_v1_package/conanfile.py b/recipes/qcustomplot/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c63b02a1ac710 --- /dev/null +++ b/recipes/qcustomplot/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + with tools.run_environment(self): + cmake = CMake(self) + cmake.definitions["QT_VERSION"] = self.deps_cpp_info["qt"].version + cmake.configure() + cmake.build() + + def test(self): + # can't run in Linux agents (headless) + if not (tools.cross_building(self) or self.settings.os == "Linux"): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qcustomplot/config.yml b/recipes/qcustomplot/config.yml new file mode 100644 index 0000000000000..a7d0cc4f0654b --- /dev/null +++ b/recipes/qcustomplot/config.yml @@ -0,0 +1,7 @@ +versions: + "2.1.1": + folder: all + "2.1.0": + folder: all + "1.3.2": + folder: all diff --git a/recipes/qdbm/all/CMakeLists.txt b/recipes/qdbm/all/CMakeLists.txt new file mode 100644 index 0000000000000..39427c2f3ccc3 --- /dev/null +++ b/recipes/qdbm/all/CMakeLists.txt @@ -0,0 +1,85 @@ +cmake_minimum_required(VERSION 3.1) + +project(qdbm_wrapper VERSION "${CONAN_qdbm_VERSION}" LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +set(QDBM_SRC_DIR ${PROJECT_SOURCE_DIR}/source_subfolder) + +# ---- Dependencies ---- + +option(THREADS_PREFER_PTHREAD_FLAG "" ON) + +macro(find_package_if condition name) + option("${condition}" "Enable ${condition}" OFF) + if(${condition}) + find_package("${name}" REQUIRED ${ARGN}) + link_libraries("${name}::${name}") + add_definitions("-D${condition}") + endif() +endmacro() + +find_package_if(MYICONV Iconv) +find_package_if(MYZLIB ZLIB) +find_package_if(MYPTHREAD Threads) + +# ---- Library ---- + +add_library( + qdbm + ${QDBM_SRC_DIR}/depot.c + ${QDBM_SRC_DIR}/curia.c + ${QDBM_SRC_DIR}/relic.c + ${QDBM_SRC_DIR}/hovel.c + ${QDBM_SRC_DIR}/cabin.c + ${QDBM_SRC_DIR}/villa.c + ${QDBM_SRC_DIR}/vista.c + ${QDBM_SRC_DIR}/odeum.c + ${QDBM_SRC_DIR}/myconf.c +) + +if(WIN32) + target_sources(qdbm PRIVATE ${QDBM_SRC_DIR}/qdbm.def) +endif() + +# Too noisy +if(MSVC) + target_compile_definitions( + qdbm PRIVATE + _CRT_SECURE_NO_WARNINGS + _CRT_SECURE_NO_DEPRECATE + ) + target_compile_options(qdbm PRIVATE /wd4267 /wd4996 /wd4244) +endif() + +target_include_directories(qdbm PRIVATE "${QDBM_SRC_DIR}") + +set_target_properties( + qdbm PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}" +) + +# ---- Install ---- + +include(GNUInstallDirs) + +install( + TARGETS qdbm + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) + +install( + FILES + ${QDBM_SRC_DIR}/cabin.h + ${QDBM_SRC_DIR}/curia.h + ${QDBM_SRC_DIR}/depot.h + ${QDBM_SRC_DIR}/odeum.h + ${QDBM_SRC_DIR}/relic.h + ${QDBM_SRC_DIR}/villa.h + ${QDBM_SRC_DIR}/vista.h + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qdbm" +) diff --git a/recipes/qdbm/all/conandata.yml b/recipes/qdbm/all/conandata.yml new file mode 100644 index 0000000000000..c04a6ca2954e6 --- /dev/null +++ b/recipes/qdbm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.8.78": + sha256: "b466fe730d751e4bfc5900d1f37b0fb955f2826ac456e70012785e012cdcb73e" + url: http://fallabs.com/qdbm/qdbm-1.8.78.tar.gz diff --git a/recipes/qdbm/all/conanfile.py b/recipes/qdbm/all/conanfile.py new file mode 100644 index 0000000000000..476d0ec62783b --- /dev/null +++ b/recipes/qdbm/all/conanfile.py @@ -0,0 +1,81 @@ +from conans import ConanFile, CMake, tools +import functools + +required_conan_version = ">=1.33.0" + + +class QDBMConan(ConanFile): + name = "qdbm" + description = "QDBM is a library of routines for managing a database." + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://fallabs.com/qdbm/" + topics = ("qdbm", "database", "db") + license = "LGPL-2.1-or-later" + settings = ("os", "arch", "compiler", "build_type") + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_pthread": [True, False], + "with_iconv": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_pthread": True, + "with_iconv": True, + "with_zlib": True, + } + + generators = "cmake", "cmake_find_package" + exports_sources = "CMakeLists.txt" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.with_pthread + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_iconv: + self.requires("libiconv/1.16") + if self.options.with_zlib: + self.requires("zlib/1.2.12") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["CONAN_qdbm_VERSION"] = self.version + cmake.definitions["MYICONV"] = self.options.with_iconv + cmake.definitions["MYZLIB"] = self.options.with_zlib + cmake.definitions["MYPTHREAD"] = self.options\ + .get_safe("with_pthread", False) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["qdbm"] + if self.options.get_safe("with_pthread"): + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/qdbm/all/test_package/CMakeLists.txt b/recipes/qdbm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ea1c210104fb1 --- /dev/null +++ b/recipes/qdbm/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +find_package(qdbm REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE qdbm::qdbm) diff --git a/recipes/qdbm/all/test_package/conanfile.py b/recipes/qdbm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ec80e0c5cc134 --- /dev/null +++ b/recipes/qdbm/all/test_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/qdbm/all/test_package/test_package.c b/recipes/qdbm/all/test_package/test_package.c new file mode 100644 index 0000000000000..68bad9e85cf15 --- /dev/null +++ b/recipes/qdbm/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const* argv[]) +{ + (void)argc; + (void)argv; + + cbfree(NULL); + + return 0; +} diff --git a/recipes/qdbm/config.yml b/recipes/qdbm/config.yml new file mode 100644 index 0000000000000..0c77df852f6f0 --- /dev/null +++ b/recipes/qdbm/config.yml @@ -0,0 +1,3 @@ +versions: + "1.8.78": + folder: all diff --git a/recipes/qhull/all/conandata.yml b/recipes/qhull/all/conandata.yml new file mode 100644 index 0000000000000..d9b28c7eb65e2 --- /dev/null +++ b/recipes/qhull/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "8.0.1": + url: "https://github.com/qhull/qhull/archive/v8.0.1.tar.gz" + sha256: "33c442518b033862978089776a3ec29cd771ebb535c2b4a6d604fcef043c4264" + "8.0.0": + url: "https://github.com/qhull/qhull/archive/v8.0.0.tar.gz" + sha256: "0a1b26607b28b1cf6f90c8dbb0132a0e087f85baea03ec2dcdc4100a0646dead" + "7.3.2": + url: "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz" + sha256: "619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0" +patches: + "8.0.1": + - patch_file: "patches/0002-fix-cmake-minimum-required-location-8.0.1.patch" + patch_description: "Fix cmake_minimum_required() position" + patch_type: "backport" + patch_source: "https://github.com/qhull/qhull/pull/120" + - patch_file: "patches/0003-fix-cmake-8.0.x.patch" + "8.0.0": + - patch_file: "patches/0002-fix-cmake-minimum-required-location-8.0.0.patch" + patch_description: "Fix cmake_minimum_required() position" + patch_type: "backport" + patch_source: "https://github.com/qhull/qhull/pull/120" + - patch_file: "patches/0003-fix-cmake-8.0.x.patch" + - patch_file: "patches/0004-no-cpp11.patch" + "7.3.2": + - patch_file: "patches/0001-fix-cmake-conflict-exec-dir.patch" + patch_description: "Fix build failure on macOS due to conflict between an exec & dir name" + patch_type: "backport" + patch_source: "https://github.com/qhull/qhull/pull/49" + - patch_file: "patches/0002-fix-cmake-minimum-required-location-7.3.2.patch" + patch_description: "Fix cmake_minimum_required() position" + patch_type: "backport" + patch_source: "https://github.com/qhull/qhull/pull/120" + - patch_file: "patches/0003-fix-cmake-7.3.2.patch" diff --git a/recipes/qhull/all/conanfile.py b/recipes/qhull/all/conanfile.py new file mode 100644 index 0000000000000..79132e14aac7c --- /dev/null +++ b/recipes/qhull/all/conanfile.py @@ -0,0 +1,128 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class QhullConan(ConanFile): + name = "qhull" + description = "Qhull computes the convex hull, Delaunay triangulation, " \ + "Voronoi diagram, halfspace intersection about a point, " \ + "furthest-site Delaunay triangulation, and furthest-site " \ + "Voronoi diagram." + license = "Qhull" + topics = ("geometry", "convex", "triangulation", "intersection") + homepage = "http://www.qhull.org" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "reentrant": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "reentrant": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.reentrant + + 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): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "man")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Qhull") + self.cpp_info.set_property("cmake_target_name", f"Qhull::{self._qhull_cmake_name}") + self.cpp_info.set_property("pkg_config_name", self._qhull_pkgconfig_name) + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["libqhull"].libs = [self._qhull_lib_name] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libqhull"].system_libs.append("m") + if is_msvc(self) and self.options.shared: + self.cpp_info.components["libqhull"].defines.extend(["qh_dllimport"]) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "Qhull" + self.cpp_info.names["cmake_find_package_multi"] = "Qhull" + self.cpp_info.names["pkg_config"] = self._qhull_pkgconfig_name + self.cpp_info.components["libqhull"].names["cmake_find_package"] = self._qhull_cmake_name + self.cpp_info.components["libqhull"].names["cmake_find_package_multi"] = self._qhull_cmake_name + self.cpp_info.components["libqhull"].names["pkg_config"] = self._qhull_pkgconfig_name + self.cpp_info.components["libqhull"].set_property("cmake_target_name", f"Qhull::{self._qhull_cmake_name}") + self.cpp_info.components["libqhull"].set_property("pkg_config_name", self._qhull_pkgconfig_name) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + + @property + def _qhull_cmake_name(self): + name = "" + if self.options.reentrant: + name = "qhull_r" if self.options.shared else "qhullstatic_r" + else: + name = "libqhull" if self.options.shared else "qhullstatic" + return name + + @property + def _qhull_pkgconfig_name(self): + name = "qhull" + if not self.options.shared: + name += "static" + if self.options.reentrant: + name += "_r" + return name + + @property + def _qhull_lib_name(self): + name = "qhull" + if not self.options.shared: + name += "static" + if self.settings.build_type == "Debug" or self.options.reentrant: + name += "_" + if self.options.reentrant: + name += "r" + if self.settings.build_type == "Debug": + name += "d" + return name diff --git a/recipes/qhull/all/patches/0001-fix-cmake-conflict-exec-dir.patch b/recipes/qhull/all/patches/0001-fix-cmake-conflict-exec-dir.patch new file mode 100644 index 0000000000000..1c1a5366ac7c9 --- /dev/null +++ b/recipes/qhull/all/patches/0001-fix-cmake-conflict-exec-dir.patch @@ -0,0 +1,35 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -626,18 +626,18 @@ install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets + include(CMakePackageConfigHelpers) + + write_basic_package_version_file( +- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake" + VERSION ${qhull_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + export(EXPORT QhullTargets +- FILE "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullTargets.cmake" ++ FILE "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullTargets.cmake" + NAMESPACE Qhull:: + ) + + configure_file(${PROJECT_SOURCE_DIR}/build/config.cmake.in +- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake" + @ONLY + ) + +@@ -652,8 +652,8 @@ install(EXPORT QhullTargets + ) + install( + FILES +- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake" + DESTINATION + ${ConfigPackageLocation} + COMPONENT diff --git a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch new file mode 100644 index 0000000000000..a371b31b3073b --- /dev/null +++ b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,8 +64,8 @@ + # $Id: //main/2019/qhull/CMakeLists.txt#5 $$Change: 2711 $ + # $DateTime: 2019/06/27 22:34:56 $$Author: bbarber $ + +-project(qhull) + cmake_minimum_required(VERSION 3.0) ++project(qhull) + + # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt, + # Makefile, qhull-exports.def, qhull_p-exports.def, qhull_r-exports.def, qhull-warn.pri diff --git a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch new file mode 100644 index 0000000000000..7acfbbddeb621 --- /dev/null +++ b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,8 +64,8 @@ + # $Id: //main/2019/qhull/CMakeLists.txt#12 $$Change: 2961 $ + # $DateTime: 2020/06/01 22:17:03 $$Author: bbarber $ + +-project(qhull) + cmake_minimum_required(VERSION 3.0) ++project(qhull) + + # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt + # qhull-zip.sh (twice), qhull-wiki.md, qhull-news.htm, File_id.diz, index.htm diff --git a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch new file mode 100644 index 0000000000000..ed6a2832b5ba8 --- /dev/null +++ b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,8 +64,8 @@ + # $Id: //main/2019/qhull/CMakeLists.txt#16 $$Change: 3008 $ + # $DateTime: 2020/07/30 13:54:27 $$Author: bbarber $ + +-project(qhull) + cmake_minimum_required(VERSION 3.0) ++project(qhull) + + # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt + # qhull-zip.sh (twice), qhull-wiki.md, qhull-news.htm, File_id.diz, index.htm diff --git a/recipes/qhull/all/patches/0003-fix-cmake-7.3.2.patch b/recipes/qhull/all/patches/0003-fix-cmake-7.3.2.patch new file mode 100644 index 0000000000000..7e98340b01e3e --- /dev/null +++ b/recipes/qhull/all/patches/0003-fix-cmake-7.3.2.patch @@ -0,0 +1,170 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -333,30 +333,29 @@ set( + index.htm + ) + +-include_directories(${CMAKE_SOURCE_DIR}/src) +- +-if(CMAKE_BUILD_TYPE MATCHES "[dD]ebug") +- set(qhull_CPP qhullcpp_d) +- set(qhull_SHARED qhull_d) +- set(qhull_SHAREDP qhull_pd) +- set(qhull_SHAREDR qhull_rd) +- set(qhull_STATIC qhullstatic_d) +- set(qhull_STATICR qhullstatic_rd) +-else() +- set(qhull_CPP qhullcpp) +- set(qhull_SHARED libqhull) # Temporarily avoid name conflict with qhull executable +- set(qhull_SHAREDP qhull_p) +- set(qhull_SHAREDR qhull_r) +- set(qhull_STATIC qhullstatic) +- set(qhull_STATICR qhullstatic_r) +-endif() ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) ++ ++set(qhull_CPP qhullcpp) ++set(qhull_SHARED libqhull) # Temporarily avoid name conflict with qhull executable ++set(qhull_SHAREDP qhull_p) ++set(qhull_SHAREDR qhull_r) ++set(qhull_STATIC qhullstatic) ++set(qhull_STATICR qhullstatic_r) + ++if(BUILD_SHARED_LIBS) ++set( ++ qhull_TARGETS_INSTALL ++ ${qhull_SHAREDR} ++ qhull rbox qconvex qdelaunay qvoronoi qhalf ++ ${qhull_SHARED} ++) ++else() + set( + qhull_TARGETS_INSTALL +- ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR} ${qhull_SHAREDR} ++ ${qhull_STATIC} ${qhull_STATICR} + qhull rbox qconvex qdelaunay qvoronoi qhalf +- ${qhull_SHARED} ${qhull_SHAREDP} # Deprecated, use qhull_r instead + ) ++endif() + set( + qhull_TARGETS_TEST # Unused + user_eg user_eg2 user_eg3 user_egp testqset testqset_r +@@ -371,10 +370,12 @@ add_library(${qhull_SHAREDR} SHARED + src/libqhull_r/qhull_r-exports.def) + set_target_properties(${qhull_SHAREDR} PROPERTIES + SOVERSION ${qhull_SOVERSION} +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_SHAREDR}$<$:d>") + + if(UNIX) + target_link_libraries(${qhull_SHAREDR} m) ++ if(0) + if(APPLE) + set_target_properties(${qhull_SHAREDR} PROPERTIES + INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") +@@ -384,6 +385,7 @@ if(UNIX) + INSTALL_RPATH_USE_LINK_PATH TRUE + BUILD_WITH_INSTALL_RPATH FALSE) + endif() ++ endif() + endif(UNIX) + + # --------------------------------------- +@@ -394,18 +396,15 @@ add_library(${qhull_SHARED} SHARED + ${libqhull_SOURCES} + src/libqhull/qhull-exports.def) + +-if(qhull_SHARED MATCHES "libqhull") +- set(qhull_OUTPUT_NAME qhull) +- set_target_properties(${qhull_SHARED} PROPERTIES +- OUTPUT_NAME "${qhull_OUTPUT_NAME}" ) +-endif() + + set_target_properties(${qhull_SHARED} PROPERTIES + SOVERSION ${qhull_SOVERSION} +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "qhull$<$:_d>") + + if(UNIX) + target_link_libraries(${qhull_SHARED} m) ++ if(0) + if(APPLE) + set_target_properties(${qhull_SHARED} PROPERTIES + INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") +@@ -415,6 +414,7 @@ if(UNIX) + INSTALL_RPATH_USE_LINK_PATH TRUE + BUILD_WITH_INSTALL_RPATH FALSE) + endif() ++ endif() + endif(UNIX) + + # --------------------------------------- +@@ -427,10 +427,12 @@ add_library(${qhull_SHAREDP} SHARED + set_target_properties(${qhull_SHAREDP} PROPERTIES + COMPILE_DEFINITIONS "qh_QHpointer" + SOVERSION ${qhull_SOVERSION} +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_SHAREDP}$<$:d>") + + if(UNIX) + target_link_libraries(${qhull_SHAREDP} m) ++ if(0) + if(APPLE) + set_target_properties(${qhull_SHAREDP} PROPERTIES + INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") +@@ -440,6 +442,7 @@ if(UNIX) + INSTALL_RPATH_USE_LINK_PATH TRUE + BUILD_WITH_INSTALL_RPATH FALSE) + endif() ++ endif() + endif(UNIX) + + # --------------------------------------- +@@ -448,11 +451,13 @@ endif(UNIX) + + add_library(${qhull_STATIC} STATIC ${libqhull_SOURCES}) + set_target_properties(${qhull_STATIC} PROPERTIES +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_STATIC}$<$:_d>") + + add_library(${qhull_STATICR} STATIC ${libqhullr_SOURCES}) + set_target_properties(${qhull_STATICR} PROPERTIES +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_STATICR}$<$:d>") + + if(UNIX) + target_link_libraries(${qhull_STATIC} m) +@@ -466,7 +471,8 @@ endif(UNIX) + + add_library(${qhull_CPP} STATIC ${libqhullcpp_SOURCES}) + set_target_properties(${qhull_CPP} PROPERTIES +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_CPP}$<$:_d>") + + # --------------------------------------- + # Define qhull executables linked to qhullstatic library +@@ -619,6 +625,7 @@ add_test(NAME user_eg3 + + install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets + RUNTIME DESTINATION ${BIN_INSTALL_DIR} ++ BUNDLE DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + INCLUDES DESTINATION include) +@@ -661,10 +668,7 @@ install( + ) + + install(FILES ${libqhull_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) +-install(FILES ${libqhull_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) + install(FILES ${libqhullr_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull_r) +-install(FILES ${libqhullr_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull_r) +-install(FILES ${libqhullcpp_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhullcpp) + install(FILES html/qhull.man DESTINATION ${MAN_INSTALL_DIR} RENAME qhull.1) + install(FILES html/rbox.man DESTINATION ${MAN_INSTALL_DIR} RENAME rbox.1) + install(FILES ${doc_FILES} DESTINATION ${DOC_INSTALL_DIR}) diff --git a/recipes/qhull/all/patches/0003-fix-cmake-8.0.x.patch b/recipes/qhull/all/patches/0003-fix-cmake-8.0.x.patch new file mode 100644 index 0000000000000..9dfe28e7114f0 --- /dev/null +++ b/recipes/qhull/all/patches/0003-fix-cmake-8.0.x.patch @@ -0,0 +1,184 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -339,28 +339,28 @@ set( + + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) + +-if(CMAKE_BUILD_TYPE MATCHES "[dD]ebug") +- set(qhull_CPP qhullcpp_d) +- set(qhull_SHARED qhull_d) +- set(qhull_SHAREDP qhull_pd) +- set(qhull_SHAREDR qhull_rd) +- set(qhull_STATIC qhullstatic_d) +- set(qhull_STATICR qhullstatic_rd) ++set(qhull_CPP qhullcpp) ++set(qhull_SHARED libqhull) # Temporarily avoid name conflict with qhull executable ++set(qhull_SHAREDP qhull_p) ++set(qhull_SHAREDR qhull_r) ++set(qhull_STATIC qhullstatic) ++set(qhull_STATICR qhullstatic_r) ++ ++if(BUILD_SHARED_LIBS) ++set( ++ qhull_TARGETS_INSTALL ++ ${qhull_SHAREDR} ++ qhull rbox qconvex qdelaunay qvoronoi qhalf ++ ${qhull_SHARED} ++) + else() +- set(qhull_CPP qhullcpp) +- set(qhull_SHARED libqhull) # Temporarily avoid name conflict with qhull executable +- set(qhull_SHAREDP qhull_p) +- set(qhull_SHAREDR qhull_r) +- set(qhull_STATIC qhullstatic) +- set(qhull_STATICR qhullstatic_r) +-endif() + + set( + qhull_TARGETS_INSTALL +- ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR} ${qhull_SHAREDR} ++ ${qhull_STATIC} ${qhull_STATICR} + qhull rbox qconvex qdelaunay qvoronoi qhalf +- ${qhull_SHARED} ${qhull_SHAREDP} # Deprecated, use qhull_r instead + ) ++endif() + set( + qhull_TARGETS_TEST # Unused + user_eg user_eg2 user_eg3 user_egp testqset testqset_r +@@ -375,10 +375,12 @@ add_library(${qhull_SHAREDR} SHARED + src/libqhull_r/qhull_r-exports.def) + set_target_properties(${qhull_SHAREDR} PROPERTIES + SOVERSION ${qhull_SOVERSION} +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_SHAREDR}$<$:d>") + + if(UNIX) + target_link_libraries(${qhull_SHAREDR} m) ++ if(0) + if(APPLE) + set_target_properties(${qhull_SHAREDR} PROPERTIES + INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") +@@ -388,6 +390,7 @@ if(UNIX) + INSTALL_RPATH_USE_LINK_PATH TRUE + BUILD_WITH_INSTALL_RPATH FALSE) + endif() ++ endif() + endif(UNIX) + + # --------------------------------------- +@@ -398,18 +401,15 @@ add_library(${qhull_SHARED} SHARED + ${libqhull_SOURCES} + src/libqhull/qhull-exports.def) + +-if(qhull_SHARED MATCHES "libqhull") +- set(qhull_OUTPUT_NAME qhull) +- set_target_properties(${qhull_SHARED} PROPERTIES +- OUTPUT_NAME "${qhull_OUTPUT_NAME}" ) +-endif() + + set_target_properties(${qhull_SHARED} PROPERTIES + SOVERSION ${qhull_SOVERSION} +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "qhull$<$:_d>") + + if(UNIX) + target_link_libraries(${qhull_SHARED} m) ++ if(0) + if(APPLE) + set_target_properties(${qhull_SHARED} PROPERTIES + INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") +@@ -419,6 +419,7 @@ if(UNIX) + INSTALL_RPATH_USE_LINK_PATH TRUE + BUILD_WITH_INSTALL_RPATH FALSE) + endif() ++ endif() + endif(UNIX) + + # --------------------------------------- +@@ -431,10 +432,12 @@ add_library(${qhull_SHAREDP} SHARED + set_target_properties(${qhull_SHAREDP} PROPERTIES + COMPILE_DEFINITIONS "qh_QHpointer" + SOVERSION ${qhull_SOVERSION} +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_SHAREDP}$<$:d>") + + if(UNIX) + target_link_libraries(${qhull_SHAREDP} m) ++ if(0) + if(APPLE) + set_target_properties(${qhull_SHAREDP} PROPERTIES + INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") +@@ -444,6 +447,7 @@ if(UNIX) + INSTALL_RPATH_USE_LINK_PATH TRUE + BUILD_WITH_INSTALL_RPATH FALSE) + endif() ++ endif() + endif(UNIX) + + # --------------------------------------- +@@ -452,11 +456,13 @@ endif(UNIX) + + add_library(${qhull_STATIC} STATIC ${libqhull_SOURCES}) + set_target_properties(${qhull_STATIC} PROPERTIES +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_STATIC}$<$:_d>") + + add_library(${qhull_STATICR} STATIC ${libqhullr_SOURCES}) + set_target_properties(${qhull_STATICR} PROPERTIES +- VERSION ${qhull_VERSION}) ++ VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_STATICR}$<$:d>") + + if(UNIX) + target_link_libraries(${qhull_STATIC} m) +@@ -471,6 +477,7 @@ endif(UNIX) + add_library(${qhull_CPP} STATIC ${libqhullcpp_SOURCES}) + set_target_properties(${qhull_CPP} PROPERTIES + VERSION ${qhull_VERSION} ++ OUTPUT_NAME "${qhull_CPP}$<$:_d>" + POSITION_INDEPENDENT_CODE "TRUE") + + # --------------------------------------- +@@ -561,10 +568,8 @@ target_link_libraries(user_eg2 ${qhull_STATICR}) + + set(user_eg3_SOURCES src/user_eg3/user_eg3_r.cpp) + +-add_executable(user_eg3 ${user_eg3_SOURCES}) + # qhull_STATICR must be last, otherwise qh_fprintf,etc. are not loaded from qhull_CPP + # user_eg3 may be linked to qhull_SHAREDR if user_eg3_DEFINES is added +-target_link_libraries(user_eg3 ${qhull_CPP} ${qhull_STATICR}) + + # --------------------------------------- + # qhullp is qhull/unix.c linked to deprecated qh_QHpointer libqhull_p +@@ -615,8 +620,6 @@ add_test(NAME user_eg + COMMAND sh -c "./user_eg") + add_test(NAME user_eg2 + COMMAND sh -c "./user_eg2") +-add_test(NAME user_eg3 +- COMMAND sh -c "./user_eg3 rbox '10 D2' '2 D2' qhull 's p' facets") + + # --------------------------------------- + # Define install +@@ -624,6 +627,7 @@ add_test(NAME user_eg3 + + install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets + RUNTIME DESTINATION ${BIN_INSTALL_DIR} ++ BUNDLE DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + INCLUDES DESTINATION include) +@@ -681,10 +685,7 @@ foreach(pkgconfig IN ITEMS "${qhull_SHARED};Qhull shared library" + endforeach() + + install(FILES ${libqhull_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) +-install(FILES ${libqhull_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) + install(FILES ${libqhullr_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull_r) +-install(FILES ${libqhullr_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull_r) +-install(FILES ${libqhullcpp_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhullcpp) + install(FILES html/qhull.man DESTINATION ${MAN_INSTALL_DIR} RENAME qhull.1) + install(FILES html/rbox.man DESTINATION ${MAN_INSTALL_DIR} RENAME rbox.1) + install(FILES ${doc_FILES} DESTINATION ${DOC_INSTALL_DIR}) diff --git a/recipes/qhull/all/patches/0004-no-cpp11.patch b/recipes/qhull/all/patches/0004-no-cpp11.patch new file mode 100644 index 0000000000000..435f34dace4a1 --- /dev/null +++ b/recipes/qhull/all/patches/0004-no-cpp11.patch @@ -0,0 +1,46 @@ +--- a/src/libqhullcpp/QhullUser.cpp ++++ b/src/libqhullcpp/QhullUser.cpp +@@ -11,6 +11,7 @@ + #include "libqhullcpp/QhullError.h" + + #include ++#include + + using std::cerr; + using std::endl; +@@ -98,7 +99,7 @@ captureOff() + throw QhullError(10080, "Qhull error: QhullUser::captureOn not call before QhullUser::captureOff for QhullUser 0x%llx", 0, 0, 0.0, this); + } + if(qh()->cpp_user!=this){ +- throw QhullError(10081, "Qhull error: conflicting QhullUser (0x%llx) for QhullUser::captureOff(). Does not match 'this' (0x...%X)", int((uintptr_t)this), 0, 0.0, qh()->cpp_user); ++ throw QhullError(10081, "Qhull error: conflicting QhullUser (0x%llx) for QhullUser::captureOff(). Does not match 'this' (0x...%X)", int(0xffff&(intptr_t)this), 0, 0.0, qh()->cpp_user); + } + qh()->cpp_user= NULL; + }//captureOff +--- a/src/libqhullcpp/QhullUser.h ++++ b/src/libqhullcpp/QhullUser.h +@@ -36,8 +36,8 @@ namespace orgQhull{ + #//!\name Fields + QhullQh * qh_qh; //!< QhullQh/qhT for access to libqhull_r + void * previous_user; //!< previous qh.cpp_user, restored on deconstruction +- std::vector< std::vector< double>> doubles_vector; //! vectors for capturing ints and doubles +- std::vector< std::vector< int>> ints_vector; ++ std::vector< std::vector< double> > doubles_vector; //! vectors for capturing ints and doubles ++ std::vector< std::vector< int> > ints_vector; + std::vector< int> fprintf_ints; + std::vector< double> fprintf_doubles; + std::vector< int> fprintf_codes; +@@ -77,11 +77,11 @@ namespace orgQhull{ + void clearIntsVector() { ints_vector.clear(); } + const std::vector< int> &codes() const { return fprintf_codes; } + int delaunayDim() const { return delaunay_dim; } +- const std::vector< std::vector< double>> &doublesVector() const { return doubles_vector; } ++ const std::vector< std::vector< double> > &doublesVector() const { return doubles_vector; } + const std::vector< double> &doubles() const { return fprintf_doubles; } + int firstCode() const { return (fprintf_codes.size() == 0 ? -1 : fprintf_codes[0]); } + const std::vector< int> &ints() const { return fprintf_ints; } +- const std::vector< std::vector< int>> &intsVector() const { return ints_vector; } ++ const std::vector< std::vector< int> > &intsVector() const { return ints_vector; } + int numDoubles() const { return (int)doubles_vector.size(); } + int numFacets() const { return num_facets; } + int numInts() const { return (int)ints_vector.size(); } diff --git a/recipes/qhull/all/test_package/CMakeLists.txt b/recipes/qhull/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..014682f4bed09 --- /dev/null +++ b/recipes/qhull/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Qhull REQUIRED CONFIG) + +if(QHULL_REENTRANT) + add_executable(${PROJECT_NAME} test_package_r.c) + if(TARGET Qhull::qhull_r) + target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::qhull_r) + else() + target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::qhullstatic_r) + endif() +else() + add_executable(${PROJECT_NAME} test_package.c) + if(TARGET Qhull::libqhull) + target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::libqhull) + else() + target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::qhullstatic) + endif() +endif() diff --git a/recipes/qhull/all/test_package/conanfile.py b/recipes/qhull/all/test_package/conanfile.py new file mode 100644 index 0000000000000..66e70cb957d6a --- /dev/null +++ b/recipes/qhull/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QHULL_REENTRANT"] = self.dependencies["qhull"].options.reentrant + 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/qhull/all/test_package/test_package.c b/recipes/qhull/all/test_package/test_package.c new file mode 100644 index 0000000000000..b3fedd751d934 --- /dev/null +++ b/recipes/qhull/all/test_package/test_package.c @@ -0,0 +1,308 @@ +#include "libqhull/qhull_a.h" + +/*------------------------------------------------- +-internal function prototypes +*/ +void print_summary(void); +void makecube(coordT *points, int numpoints, int dim); +void makeDelaunay(coordT *points, int numpoints, int dim, int seed); +void findDelaunay(int dim); +void makehalf(coordT *points, int numpoints, int dim); + +/*------------------------------------------------- +-print_summary( ) +*/ +void print_summary(void) { + facetT *facet; + int k; + + printf("\n%d vertices and %d facets with normals:\n", + qh num_vertices, qh num_facets); + FORALLfacets { + for (k=0; k < qh hull_dim; k++) + printf("%6.2g ", facet->normal[k]); + printf("\n"); + } +} + +/*-------------------------------------------------- +-makecube- set points to vertices of cube + points is numpoints X dim +*/ +void makecube(coordT *points, int numpoints, int dim) { + int j,k; + coordT *point; + + for (j=0; jlocate a facet with qh_findbestfacet() + calls qh_setdelaunay() to project the point to a parabaloid +warning: + Errors if it finds a tricoplanar facet ('Qt'). The corresponding Delaunay triangle + is in the set of tricoplanar facets or one of their neighbors. This search + is not implemented here. +*/ +void findDelaunay(int dim) { + int k; + coordT point[ 100]; + boolT isoutside; + realT bestdist; + facetT *facet; + vertexT *vertex, **vertexp; + + for (k=0; k < dim; k++) + point[k]= 0.5; + qh_setdelaunay(dim+1, 1, point); + facet= qh_findbestfacet(point, qh_ALL, &bestdist, &isoutside); + if (facet->tricoplanar) { + fprintf(stderr, "findDelaunay: search not implemented for triangulated, non-simplicial Delaunay regions (tricoplanar facet, f%d).\n", + facet->id); + qh_errexit(qh_ERRqhull, facet, NULL); + } + FOREACHvertex_(facet->vertices) { + for (k=0; k < dim; k++) + printf("%5.2f ", vertex->point[k]); + printf("\n"); + } +} /*.findDelaunay.*/ + +/*-------------------------------------------------- +-makehalf- set points to halfspaces for a (dim)-dimensional diamond + points is numpoints X dim+1 + + each halfspace consists of dim coefficients followed by an offset +*/ +void makehalf(coordT *points, int numpoints, int dim) { + int j,k; + coordT *point; + + for (j=0; j= 2 ? argv[1] : ""); + numpoints= SIZEcube; + makecube(points, numpoints, DIM); + for (i=numpoints; i--; ) + rows[i]= points+dim*i; + qh_printmatrix(outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) { /* if no error */ + /* 'qh facet_list' contains the convex hull */ + print_summary(); + FORALLfacets { + /* ... your code ... */ + } + } +#ifdef qh_NOmem + qh_freeqhull(qh_ALL); +#else + qh_freeqhull(!qh_ALL); /* free long memory */ + qh_memfreeshort(&curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + + /* + Run 2: Delaunay triangulation, reusing the previous qh/qh_qh + */ + + printf( "\n========\ncompute %d-d Delaunay triangulation\n", dim); + sprintf(flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : ""); + numpoints= SIZEcube; + makeDelaunay(points, numpoints, dim, (int)time(NULL)); + for (i=numpoints; i--; ) + rows[i]= points+dim*i; + qh_printmatrix(outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) { /* if no error */ + /* 'qh facet_list' contains the convex hull */ + /* If you want a Voronoi diagram ('v') and do not request output (i.e., outfile=NULL), + call qh_setvoronoi_all() after qh_new_qhull(). */ + print_summary(); + FORALLfacets { + /* ... your code ... */ + } + printf( "\nfind %d-d Delaunay triangle or adjacent triangle closest to [0.5, 0.5, ...]\n", dim); + exitcode= setjmp(qh errexit); + if (!exitcode) { + /* Trap Qhull errors from findDelaunay(). Without the setjmp(), Qhull + will exit() after reporting an error */ + qh NOerrexit= False; + findDelaunay(DIM); + } + qh NOerrexit= True; + } +#if qh_QHpointer /* see user.h */ + { + qhT *oldqhA, *oldqhB; + coordT pointsB[DIM*TOTpoints]; /* array of coordinates for each point */ + + printf( "\n========\nCompute a new triangulation as a separate instance of Qhull\n"); + oldqhA= qh_save_qhull(); + sprintf(flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : ""); + numpoints= SIZEcube; + makeDelaunay(pointsB, numpoints, dim, (int)time(NULL)+1); + for (i=numpoints; i--; ) + rows[i]= pointsB+dim*i; + qh_printmatrix(outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(dim, numpoints, pointsB, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) + print_summary(); + printf( "\n========\nFree memory allocated by the new instance of Qhull, and redisplay the old results.\n"); + oldqhB= qh_save_qhull(); + qh_restore_qhull(&oldqhA); + print_summary(); + printf( "\nfree first triangulation and restore second one.\n"); + qh_freeqhull(qh_ALL); /* free short and long memory used by first call */ + /* do not use qh_memfreeshort */ + qh_restore_qhull(&oldqhB); + printf( "\n\n"); + print_summary(); + } +#endif + +#ifdef qh_NOmem + qh_freeqhull(qh_ALL); +#else + qh_freeqhull(!qh_ALL); /* free long memory */ + qh_memfreeshort(&curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + + /* + Run 3: halfspace intersection about the origin + */ + printf( "\n========\ncompute halfspace intersection about the origin for a diamond\n"); + sprintf(flags, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "Fp"); + numpoints= SIZEcube; + makehalf(points, numpoints, dim); + for (i=numpoints; i--; ) + rows[i]= points+(dim+1)*i; + qh_printmatrix(outfile, "input as halfspace coefficients + offsets", rows, numpoints, dim+1); + fflush(NULL); + /* use qh_sethalfspace_all to transform the halfspaces yourself. + If so, set 'qh feasible_point and do not use option 'Hn,...' [it would retransform the halfspaces] + */ + exitcode= qh_new_qhull(dim+1, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) + print_summary(); +#ifdef qh_NOmem + qh_freeqhull(qh_ALL); +#else + qh_freeqhull(!qh_ALL); + qh_memfreeshort(&curlong, &totlong); + if (curlong || totlong) /* could also check previous runs */ + fprintf(stderr, "qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n", + totlong, curlong); +#endif + return exitcode; +} /* main */ diff --git a/recipes/qhull/all/test_package/test_package_r.c b/recipes/qhull/all/test_package/test_package_r.c new file mode 100644 index 0000000000000..ca78b45c7a4c6 --- /dev/null +++ b/recipes/qhull/all/test_package/test_package_r.c @@ -0,0 +1,304 @@ +#include "libqhull_r/qhull_ra.h" + +/*------------------------------------------------- +-internal function prototypes +*/ +void print_summary(qhT *qh); +void makecube(coordT *points, int numpoints, int dim); +void makeDelaunay(qhT *qh, coordT *points, int numpoints, int dim, int seed); +void findDelaunay(qhT *qh, int dim); +void makehalf(coordT *points, int numpoints, int dim); + +/*------------------------------------------------- +-print_summary(qh) +*/ +void print_summary(qhT *qh) { + facetT *facet; + int k; + + printf("\n%d vertices and %d facets with normals:\n", + qh->num_vertices, qh->num_facets); + FORALLfacets { + for (k=0; k < qh->hull_dim; k++) + printf("%6.2g ", facet->normal[k]); + printf("\n"); + } +} + +/*-------------------------------------------------- +-makecube- set points to vertices of cube + points is numpoints X dim +*/ +void makecube(coordT *points, int numpoints, int dim) { + int j,k; + coordT *point; + + for (j=0; jlocate a facet with qh_findbestfacet() + calls qh_setdelaunay() to project the point to a parabaloid +warning: + Errors if it finds a tricoplanar facet ('Qt'). The corresponding Delaunay triangle + is in the set of tricoplanar facets or one of their neighbors. This search + is not implemented here. +*/ +void findDelaunay(qhT *qh, int dim) { + int k; + coordT point[ 100]; + boolT isoutside; + realT bestdist; + facetT *facet; + vertexT *vertex, **vertexp; + + for (k=0; k < dim; k++) + point[k]= 0.5; + qh_setdelaunay(qh, dim+1, 1, point); + facet= qh_findbestfacet(qh, point, qh_ALL, &bestdist, &isoutside); + if (facet->tricoplanar) { + fprintf(stderr, "findDelaunay: search not implemented for triangulated, non-simplicial Delaunay regions (tricoplanar facet, f%d).\n", + facet->id); + qh_errexit(qh, qh_ERRqhull, facet, NULL); + } + FOREACHvertex_(facet->vertices) { + for (k=0; k < dim; k++) + printf("%5.2f ", vertex->point[k]); + printf("\n"); + } +} /*.findDelaunay.*/ + +/*-------------------------------------------------- +-makehalf- set points to halfspaces for a (dim)-dimensional diamond + points is numpoints X dim+1 + + each halfspace consists of dim coefficients followed by an offset +*/ +void makehalf(coordT *points, int numpoints, int dim) { + int j,k; + coordT *point; + + for (j=0; j= 2 ? argv[1] : ""); + numpoints= SIZEcube; + makecube(points, numpoints, DIM); + for (i=numpoints; i--; ) + rows[i]= points+dim*i; + qh_printmatrix(qh, outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(qh, dim, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) { /* if no error */ + /* 'qh->facet_list' contains the convex hull */ + print_summary(qh); + FORALLfacets { + /* ... your code ... */ + } + } +#ifdef qh_NOmem + qh_freeqhull(qh, qh_ALL); +#else + qh_freeqhull(qh, !qh_ALL); /* free long memory */ + qh_memfreeshort(qh, &curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + + /* + Run 2: Delaunay triangulation, reusing the previous qh/qh_qh + */ + + printf( "\n========\ncompute %d-d Delaunay triangulation\n", dim); + sprintf(flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : ""); + numpoints= SIZEcube; + makeDelaunay(qh, points, numpoints, dim, (int)time(NULL)); + for (i=numpoints; i--; ) + rows[i]= points+dim*i; + qh_printmatrix(qh, outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(qh, dim, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) { /* if no error */ + /* 'qh->facet_list' contains the convex hull */ + /* If you want a Voronoi diagram ('v') and do not request output (i.e., outfile=NULL), + call qh_setvoronoi_all() after qh_new_qhull(). */ + print_summary(qh); + FORALLfacets { + /* ... your code ... */ + } + printf( "\nfind %d-d Delaunay triangle or adjacent triangle closest to [0.5, 0.5, ...]\n", dim); + exitcode= setjmp(qh->errexit); + if (!exitcode) { + /* Trap Qhull errors from findDelaunay(). Without the setjmp(), Qhull + will exit() after reporting an error */ + qh->NOerrexit= False; + findDelaunay(qh, DIM); + } + qh->NOerrexit= True; + } + { + coordT pointsB[DIM*TOTpoints]; /* array of coordinates for each point */ + + qhT qh_qhB; /* Create a new instance of Qhull (qhB) */ + qhT *qhB= &qh_qhB; + qh_zero(qhB, errfile); + + printf( "\n========\nCompute a new triangulation as a separate instance of Qhull\n"); + sprintf(flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : ""); + numpoints= SIZEcube; + makeDelaunay(qhB, pointsB, numpoints, dim, (int)time(NULL)+1); + for (i=numpoints; i--; ) + rows[i]= pointsB+dim*i; + qh_printmatrix(qhB, outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(qhB, dim, numpoints, pointsB, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) + print_summary(qhB); + printf( "\n========\nFree memory allocated by the new instance of Qhull, and redisplay the old results.\n"); +#ifdef qh_NOmem + qh_freeqhull(qh, qh_ALL); +#else + qh_freeqhull(qhB, !qh_ALL); /* free long memory */ + qh_memfreeshort(qhB, &curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #4): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + printf( "\n\n"); + print_summary(qh); /* The other instance is unchanged */ + /* Exiting the block frees qh_qhB */ + } +#ifdef qh_NOmem + qh_freeqhull(qh, qh_ALL); +#else + qh_freeqhull(qh, !qh_ALL); /* free long memory */ + qh_memfreeshort(qh, &curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + + /* + Run 3: halfspace intersection about the origin + */ + printf( "\n========\ncompute halfspace intersection about the origin for a diamond\n"); + sprintf(flags, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "Fp"); + numpoints= SIZEcube; + makehalf(points, numpoints, dim); + for (i=numpoints; i--; ) + rows[i]= points+(dim+1)*i; + qh_printmatrix(qh, outfile, "input as halfspace coefficients + offsets", rows, numpoints, dim+1); + fflush(NULL); + /* use qh_sethalfspace_all to transform the halfspaces yourself. + If so, set 'qh->feasible_point and do not use option 'Hn,...' [it would retransform the halfspaces] + */ + exitcode= qh_new_qhull(qh, dim+1, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) + print_summary(qh); +#ifdef qh_NOmem + qh_freeqhull(qh, qh_ALL); +#else + qh_freeqhull(qh, !qh_ALL); + qh_memfreeshort(qh, &curlong, &totlong); + if (curlong || totlong) /* could also check previous runs */ + fprintf(stderr, "qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n", + totlong, curlong); +#endif + return exitcode; +} /* main */ diff --git a/recipes/qhull/all/test_v1_package/CMakeLists.txt b/recipes/qhull/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/qhull/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/qhull/all/test_v1_package/conanfile.py b/recipes/qhull/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b2da31bf488a2 --- /dev/null +++ b/recipes/qhull/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["QHULL_REENTRANT"] = self.options["qhull"].reentrant + 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/qhull/config.yml b/recipes/qhull/config.yml new file mode 100644 index 0000000000000..8e6bb4cf5cfcb --- /dev/null +++ b/recipes/qhull/config.yml @@ -0,0 +1,7 @@ +versions: + "8.0.1": + folder: all + "8.0.0": + folder: all + "7.3.2": + folder: all diff --git a/recipes/qpdf/all/conandata.yml b/recipes/qpdf/all/conandata.yml new file mode 100644 index 0000000000000..6a5e7ead04475 --- /dev/null +++ b/recipes/qpdf/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "11.1.1": + url: "https://github.com/qpdf/qpdf/archive/refs/tags/v11.1.1.tar.gz" + sha256: "785edab622a1bc7e25e1537ad2c325005d48c5c7957f7abedff405deb80fa59a" +patches: + "11.1.1": + - patch_file: "patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch" + patch_description: "Inject Conan Deps, disable qpdf-dep handling: update libqpdf/CMakeLists.txt by disabling cmake fails, caused by pkg_config fail to find dependencies. Add conan generated cmake dependencies instead." + patch_type: "conan" + - patch_file: "patches/0002-exclude-unnecessary-cmake-subprojects.patch" + patch_description: "Exclude unnecessary targets: update CMakeLists.txt removing subdir includes for binaries, tests, examples, docs and fuzzing" + patch_type: "conan" diff --git a/recipes/qpdf/all/conanfile.py b/recipes/qpdf/all/conanfile.py new file mode 100644 index 0000000000000..d5b0654a5d179 --- /dev/null +++ b/recipes/qpdf/all/conanfile.py @@ -0,0 +1,185 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class QpdfConan(ConanFile): + name = "qpdf" + description = "QPDF is a command-line tool and C++ library that performs content-preserving transformations on PDF files." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/qpdf/qpdf" + topics = ("pdf",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": ["internal", "openssl", "gnutls"], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": "openssl", + "with_jpeg": "libjpeg", + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14", + "msvc": "190", + } + + 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): + # https://qpdf.readthedocs.io/en/stable/installation.html#basic-dependencies + self.requires("zlib/1.2.13") + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + + 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_ssl == "gnutls": + raise ConanInvalidConfiguration("GnuTLS is not available in Conan Center yet.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + # https://qpdf.readthedocs.io/en/latest/installation.html#build-time-crypto-selection + tc.variables["USE_IMPLICIT_CRYPTO"] = False + tc.cache_variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + if self.options.with_ssl == "internal": + tc.variables["REQUIRE_CRYPTO_NATIVE"] = True + tc.variables["REQUIRE_CRYPTO_GNUTLS"] = False + tc.variables["REQUIRE_CRYPTO_OPENSSL"] = False + if self.options.with_ssl == "openssl": + tc.variables["REQUIRE_CRYPTO_NATIVE"] = False + tc.variables["REQUIRE_CRYPTO_GNUTLS"] = False + tc.variables["REQUIRE_CRYPTO_OPENSSL"] = True + if self.options.with_ssl == "gnutls": + tc.variables["REQUIRE_CRYPTO_NATIVE"] = False + tc.variables["REQUIRE_CRYPTO_GNUTLS"] = True + tc.variables["REQUIRE_CRYPTO_OPENSSL"] = False + tc.generate() + # TODO: after https://github.com/conan-io/conan/issues/11962 is solved + # we might obsolete here cmake deps generation and cmake patching and get + # the possibility to go for to pkg_config based dependency discovery instead. + # At the moment, even with the linked work-around, the linkage is mixed-up + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # we generally expect to have one crypto in-place, but need to patch the found mechanics + # since we avoid currently the correct pkg_config + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(FOUND_CRYPTO OFF)", "set(FOUND_CRYPTO ON)") + if self.options.with_ssl == "openssl": + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(USE_CRYPTO_OPENSSL OFF)", "set(USE_CRYPTO_OPENSSL ON)") + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "find_package(ZLIB REQUIRED)", + "find_package(ZLIB REQUIRED)\nfind_package(OpenSSL REQUIRED)\n") + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "PUBLIC JPEG::JPEG ZLIB::ZLIB", "PUBLIC JPEG::JPEG ZLIB::ZLIB OpenSSL::SSL") + if self.options.with_ssl == "gnutls": + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(USE_CRYPTO_GNUTLS OFF)", "set(USE_CRYPTO_GNUTLS ON)") + if self.options.with_ssl == "internal": + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(USE_CRYPTO_NATIVE OFF)", "set(USE_CRYPTO_NATIVE ON)") + + def build(self): + self._patch_sources() + 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() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "qpdf") + self.cpp_info.set_property("cmake_target_name", "qpdf::libqpdf") + self.cpp_info.set_property("pkg_config_name", "libqpdf") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libqpdf"].libs = ["qpdf"] + self.cpp_info.components["libqpdf"].requires.append("zlib::zlib") + if self.options.with_jpeg == "libjpeg": + self.cpp_info.components["libqpdf"].requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.components["libqpdf"].requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.components["libqpdf"].requires.append("mozjpeg::libjpeg") + if self.options.with_ssl == "openssl": + self.cpp_info.components["libqpdf"].requires.append("openssl::openssl") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libqpdf"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "qpdf" + self.cpp_info.names["cmake_find_package_multi"] = "qpdf" + self.cpp_info.components["libqpdf"].names["cmake_find_package"] = "libqpdf" + self.cpp_info.components["libqpdf"].names["cmake_find_package_multi"] = "libqpdf" + self.cpp_info.components["libqpdf"].set_property("pkg_config_name", "libqpdf") + self.cpp_info.components["libqpdf"].set_property("cmake_target_name", "qpdf::libqpdf") diff --git a/recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch b/recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch new file mode 100644 index 0000000000000..0d8edceb557a6 --- /dev/null +++ b/recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch @@ -0,0 +1,113 @@ +diff --git a/libqpdf/CMakeLists.txt b/libqpdf/CMakeLists.txt +index 7053e205..9f5962f7 100644 +--- a/libqpdf/CMakeLists.txt ++++ b/libqpdf/CMakeLists.txt +@@ -128,13 +128,8 @@ include(CheckSymbolExists) + set(dep_include_directories) + set(dep_link_directories) + set(dep_link_libraries) +-set(ANYTHING_MISSING 0) + +-if(WIN32 AND (EXISTS ${qpdf_SOURCE_DIR}/external-libs)) +- set(EXTERNAL_LIBS 1) +-else() +- set(EXTERNAL_LIBS 0) +-endif() ++set(EXTERNAL_LIBS 0) + + if(EXTERNAL_LIBS) + set(EXTLIBDIR ${qpdf_SOURCE_DIR}/external-libs) +@@ -161,9 +156,6 @@ if(NOT EXTERNAL_LIBS) + if(ZLIB_H_PATH AND ZLIB_LIB_PATH) + list(APPEND dep_include_directories ${ZLIB_H_PATH}) + list(APPEND dep_link_libraries ${ZLIB_LIB_PATH}) +- else() +- message(SEND_ERROR "zlib not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -182,9 +174,6 @@ if(NOT EXTERNAL_LIBS) + list(APPEND dep_include_directories ${LIBJPEG_H_PATH}) + list(APPEND dep_link_libraries ${LIBJPEG_LIB_PATH}) + set(JPEG_INCLUDE ${LIBJPEG_H_PATH}) +- else() +- message(SEND_ERROR "libjpeg not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -220,9 +209,6 @@ if(USE_IMPLICIT_CRYPTO OR REQUIRE_CRYPTO_OPENSSL) + list(APPEND dep_link_libraries ${OPENSSL_LIB_PATH}) + set(USE_CRYPTO_OPENSSL ON) + set(FOUND_CRYPTO ON) +- elseif(REQUIRE_CRYPTO_OPENSSL) +- message(SEND_ERROR "openssl not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -241,9 +227,6 @@ if(USE_IMPLICIT_CRYPTO OR REQUIRE_CRYPTO_GNUTLS) + list(APPEND dep_link_libraries ${GNUTLS_LIB_PATH}) + set(USE_CRYPTO_GNUTLS ON) + set(FOUND_CRYPTO ON) +- elseif(REQUIRE_CRYPTO_GNUTLS) +- message(SEND_ERROR "gnutls not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -268,14 +251,9 @@ if(FOUND_CRYPTO) + set(DEFAULT_CRYPTO "native") + endif() + endif() +-else() +- message(SEND_ERROR "no crypto provider is available") +- set(ANYTHING_MISSING 1) +-endif() +-if(ANYTHING_MISSING) +- message(FATAL_ERROR "Missing dependencies; unable to continue") + endif() + ++ + message(STATUS "") + message(STATUS "*** Crypto Summary ***") + message(STATUS " GNU TLS crypto enabled: " ${USE_CRYPTO_GNUTLS}) +@@ -403,6 +381,10 @@ endif() + # use PIC for the object library so we don't have to compile twice. + set(OBJECT_LIB libqpdf_object) + add_library(${OBJECT_LIB} OBJECT ${libqpdf_SOURCES}) ++find_package(JPEG REQUIRED) ++find_package(ZLIB REQUIRED) ++target_link_libraries(${OBJECT_LIB} PUBLIC JPEG::JPEG ZLIB::ZLIB) ++ + if(OBJECT_LIB_IS_PIC) + target_compile_definitions(${OBJECT_LIB} PRIVATE libqpdf_EXPORTS) + endif() +@@ -498,8 +480,6 @@ if(BUILD_SHARED_LIBS) + PUBLIC + $ + $) +- target_link_directories(${SHARED_LIB} PRIVATE ${dep_link_directories}) +- target_link_libraries(${SHARED_LIB} PRIVATE ${dep_link_libraries}) + if(ATOMIC_LIBRARY) + target_link_libraries(${SHARED_LIB} PRIVATE ${ATOMIC_LIBRARY}) + endif() +@@ -507,6 +487,8 @@ if(BUILD_SHARED_LIBS) + target_link_options(${SHARED_LIB} PRIVATE ${LD_VERSION_FLAGS}) + endif() + ++ target_link_libraries(${SHARED_LIB} PUBLIC JPEG::JPEG ZLIB::ZLIB) ++ + target_include_directories(${SHARED_LIB} + PRIVATE ${qpdf_SOURCE_DIR}/libqpdf ${CMAKE_CURRENT_BINARY_DIR}) + +@@ -544,6 +526,8 @@ if(BUILD_STATIC_LIBS) + target_link_libraries(${STATIC_LIB} INTERFACE ${ATOMIC_LIBRARY}) + endif() + ++ target_link_libraries(${STATIC_LIB} PUBLIC JPEG::JPEG ZLIB::ZLIB) ++ + # Avoid name clashes on Windows with the the DLL import library. + if(NOT DEFINED STATIC_SUFFIX AND BUILD_SHARED_LIBS) + if (WIN32) diff --git a/recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch b/recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch new file mode 100644 index 0000000000000..2e40ca26d687e --- /dev/null +++ b/recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5c0915f3..6c4945d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -323,12 +323,6 @@ add_test( + # add_subdirectory order affects test order + add_subdirectory(include) + add_subdirectory(libqpdf) +-add_subdirectory(qpdf) +-add_subdirectory(libtests) +-add_subdirectory(examples) +-add_subdirectory(zlib-flate) +-add_subdirectory(manual) +-add_subdirectory(fuzz) + + # We don't need to show everything -- just the things that we really + # need to be sure are right or that are turned on or off with complex diff --git a/recipes/qpdf/all/test_package/CMakeLists.txt b/recipes/qpdf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2892d11ff1f83 --- /dev/null +++ b/recipes/qpdf/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(qpdf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qpdf::libqpdf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +# msvc has problems consuming #warning macro +# therefore we need a code-path in the include avoiding this warning https://github.com/qpdf/qpdf/issues/804 +target_compile_definitions(${PROJECT_NAME} PUBLIC POINTERHOLDER_TRANSITION=4) diff --git a/recipes/qpdf/all/test_package/conanfile.py b/recipes/qpdf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..57b63cfec4d16 --- /dev/null +++ b/recipes/qpdf/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/qpdf/all/test_package/test_package.cpp b/recipes/qpdf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f79386dd766bb --- /dev/null +++ b/recipes/qpdf/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + std::cout << "QPDF_VERSION " << QPDF_VERSION << "\n"; + + try { + QPDF pdf; + pdf.emptyPDF(); + QPDFWriter w(pdf, "empty_example.pdf"); + w.write(); + } catch (std::exception& e) { + std::cerr << e.what() << "\n"; + exit(2); + } + + return 0; +} diff --git a/recipes/qpdf/all/test_v1_package/CMakeLists.txt b/recipes/qpdf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/qpdf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/qpdf/all/test_v1_package/conanfile.py b/recipes/qpdf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/qpdf/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qpdf/config.yml b/recipes/qpdf/config.yml new file mode 100644 index 0000000000000..35a13df3f72ef --- /dev/null +++ b/recipes/qpdf/config.yml @@ -0,0 +1,3 @@ +versions: + "11.1.1": + folder: all diff --git a/recipes/qpoases/all/conandata.yml b/recipes/qpoases/all/conandata.yml new file mode 100644 index 0000000000000..84a9b6ebffb36 --- /dev/null +++ b/recipes/qpoases/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.2.1": + url: "https://github.com/coin-or/qpOASES/archive/releases/3.2.1.tar.gz" + sha256: "a7d153b4e23ee66bd50cdb6e84291d0084d9967a9c788a4d873440a6b10ca13b" diff --git a/recipes/qpoases/all/conanfile.py b/recipes/qpoases/all/conanfile.py new file mode 100644 index 0000000000000..3f8123bb2aabd --- /dev/null +++ b/recipes/qpoases/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.46.0" + + +class ConanRecipe(ConanFile): + name = "qpoases" + description = "Open-source C++ implementation of the recently proposed online active set strategy." + topics = ("container", "parametric", "quadratic", "programming") + homepage = "https://github.com/coin-or/qpOASES" + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-2.1" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QPOASES_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["qpOASES"] diff --git a/recipes/qpoases/all/test_package/CMakeLists.txt b/recipes/qpoases/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b4cf698456e7 --- /dev/null +++ b/recipes/qpoases/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(qpoases REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qpoases::qpoases) diff --git a/recipes/qpoases/all/test_package/conanfile.py b/recipes/qpoases/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/qpoases/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/qpoases/all/test_package/test_package.cpp b/recipes/qpoases/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4cc35c7cad9d1 --- /dev/null +++ b/recipes/qpoases/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +// from: https://github.com/coin-or/qpOASES/blob/master/examples/example1.cpp + +#include + + +/** Example for qpOASES main function using the QProblem class. */ +int main( ) +{ + USING_NAMESPACE_QPOASES + + /* Setup data of first QP. */ + real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; + real_t A[1*2] = { 1.0, 1.0 }; + real_t g[2] = { 1.5, 1.0 }; + real_t lb[2] = { 0.5, -2.0 }; + real_t ub[2] = { 5.0, 2.0 }; + real_t lbA[1] = { -1.0 }; + real_t ubA[1] = { 2.0 }; + + /* Setup data of second QP. */ + real_t g_new[2] = { 1.0, 1.5 }; + real_t lb_new[2] = { 0.0, -1.0 }; + real_t ub_new[2] = { 5.0, -0.5 }; + real_t lbA_new[1] = { -2.0 }; + real_t ubA_new[1] = { 1.0 }; + + + /* Setting up QProblem object. */ + QProblem example( 2,1 ); + + Options options; + example.setOptions( options ); + + /* Solve first QP. */ + int_t nWSR = 10; + example.init( H,g,A,lb,ub,lbA,ubA, nWSR ); + + /* Get and print solution of first QP. */ + real_t xOpt[2]; + real_t yOpt[2+1]; + example.getPrimalSolution( xOpt ); + example.getDualSolution( yOpt ); + printf( "\nxOpt = [ %e, %e ]; yOpt = [ %e, %e, %e ]; objVal = %e\n\n", + xOpt[0],xOpt[1],yOpt[0],yOpt[1],yOpt[2],example.getObjVal() ); + + /* Solve second QP. */ + nWSR = 10; + example.hotstart( g_new,lb_new,ub_new,lbA_new,ubA_new, nWSR ); + + /* Get and print solution of second QP. */ + example.getPrimalSolution( xOpt ); + example.getDualSolution( yOpt ); + printf( "\nxOpt = [ %e, %e ]; yOpt = [ %e, %e, %e ]; objVal = %e\n\n", + xOpt[0],xOpt[1],yOpt[0],yOpt[1],yOpt[2],example.getObjVal() ); + + example.printOptions(); + /*example.printProperties();*/ + + /*getGlobalMessageHandler()->listAllMessages();*/ + + return 0; +} diff --git a/recipes/qpoases/all/test_v1_package/CMakeLists.txt b/recipes/qpoases/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/qpoases/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/qpoases/all/test_v1_package/conanfile.py b/recipes/qpoases/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/qpoases/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/qpoases/config.yml b/recipes/qpoases/config.yml new file mode 100644 index 0000000000000..c09805f11822d --- /dev/null +++ b/recipes/qpoases/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2.1": + folder: all diff --git a/recipes/qr-code-generator/all/CMakeLists.txt b/recipes/qr-code-generator/all/CMakeLists.txt new file mode 100644 index 0000000000000..60ddaa9f6b380 --- /dev/null +++ b/recipes/qr-code-generator/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(QR-Code-Generator) + +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/conandata.yml b/recipes/qr-code-generator/all/conandata.yml new file mode 100644 index 0000000000000..d6af66ca5f3e4 --- /dev/null +++ b/recipes/qr-code-generator/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "1.8.0": + url: "https://github.com/nayuki/QR-Code-generator/archive/v1.8.0.tar.gz" + sha256: "2ec0a4d33d6f521c942eeaf473d42d5fe139abcfa57d2beffe10c5cf7d34ae60" + "1.7.0": + url: "https://github.com/nayuki/QR-Code-generator/archive/v1.7.0.tar.gz" + sha256: "a8138d84a2adbc9168bfadfb9db5272c89b69fb87f72a88ecd08ce7f402ee710" + "1.6.0": + url: "https://github.com/nayuki/QR-Code-generator/archive/v1.6.0.tar.gz" + sha256: "8acee5a77325e075b910747ad4b1fdb1491b7e22d0b8f1b5a6ea15ea08ba33a8" + "1.5.0": + url: "https://github.com/nayuki/QR-Code-generator/archive/v1.5.0.tar.gz" + sha256: "6cf993c10fbf96b5e8f8e4eaad8ea1ca3bbc58fb4d00a4728b4f818c27fb4d5e" + "1.4.0": + url: "https://github.com/nayuki/QR-Code-generator/archive/v1.4.0.tar.gz" + sha256: "fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a" +patches: + "1.8.0": + - patch_file: "patches/004-cmake-1.7.patch" + patch_description: "add library name and list of source files" + patch_type: conan + "1.7.0": + - patch_file: "patches/004-cmake-1.7.patch" + patch_description: "add library name and list of source files" + patch_type: conan + "1.6.0": + - patch_file: "patches/003-cmake-1.6.patch" + patch_description: "add library name and list of source files" + patch_type: conan + "1.5.0": + - patch_file: "patches/002-cmake-pre-1.6.patch" + patch_description: "add library name and list of source files" + patch_type: conan + "1.4.0": + - patch_file: "patches/001-qrcode-1_4.patch" + patch_description: "add missing include" + patch_type: backport + patch_source: "https://github.com/nayuki/QR-Code-generator/commit/ec729bf2695300691f4b3a96ba5eaba083ebec00" + - patch_file: "patches/002-cmake-pre-1.6.patch" + patch_description: "add library name and list of source files" + patch_type: conan diff --git a/recipes/qr-code-generator/all/conanfile.py b/recipes/qr-code-generator/all/conanfile.py new file mode 100644 index 0000000000000..84430d69ae1d0 --- /dev/null +++ b/recipes/qr-code-generator/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import ( + 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 QrCodeGeneratorConan(ConanFile): + name = "qr-code-generator" + description = "High-quality QR Code generator library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nayuki/QR-Code-generator" + topics = ("qr", "qr-code", "qr-generator") + 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 export_sources(self): + copy( + self, + "CMakeLists.txt", + src=self.recipe_folder, + dst=self.export_sources_folder, + ) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + strip_root=True + ) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os == "Windows" and self.options.shared: + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + header_name = ( + "QrCode.hpp" if Version(self.version) < "1.7.0" else "qrcodegen.hpp" + ) + header = load(self, os.path.join(self.source_folder, "cpp", header_name)) + license_contents = header[2 : header.find("*/", 1)] + return license_contents + + def package(self): + save( + self, + os.path.join(self.package_folder, "licenses", "LICENSE"), + self._extract_license(), + ) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = [ + "qrcodegen" if Version(self.version) < "1.7.0" else "qrcodegencpp" + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/qr-code-generator/all/patches/001-qrcode-1_4.patch b/recipes/qr-code-generator/all/patches/001-qrcode-1_4.patch new file mode 100644 index 0000000000000..10649d86ea1cb --- /dev/null +++ b/recipes/qr-code-generator/all/patches/001-qrcode-1_4.patch @@ -0,0 +1,10 @@ +--- cpp/QrCode.hpp ++++ cpp/QrCode.hpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include "QrSegment.hpp" + + diff --git a/recipes/qr-code-generator/all/patches/002-cmake-pre-1.6.patch b/recipes/qr-code-generator/all/patches/002-cmake-pre-1.6.patch new file mode 100644 index 0000000000000..6ddcd335e9d9b --- /dev/null +++ b/recipes/qr-code-generator/all/patches/002-cmake-pre-1.6.patch @@ -0,0 +1,6 @@ +--- /dev/null ++++ b/files.cmake +@@ -0,0 +1,3 @@ ++set(SRC src/cpp/QrCode.cpp src/cpp/QrSegment.cpp src/cpp/BitBuffer.cpp) ++set(HEADERS src/cpp/QrCode.hpp src/cpp/QrSegment.hpp src/cpp/BitBuffer.hpp) ++set(LIBRARY_NAME qrcodegen) diff --git a/recipes/qr-code-generator/all/patches/003-cmake-1.6.patch b/recipes/qr-code-generator/all/patches/003-cmake-1.6.patch new file mode 100644 index 0000000000000..f568f008c5f58 --- /dev/null +++ b/recipes/qr-code-generator/all/patches/003-cmake-1.6.patch @@ -0,0 +1,6 @@ +--- /dev/null ++++ b/files.cmake +@@ -0,0 +1,3 @@ ++set(SRC src/cpp/QrCode.cpp) ++set(HEADERS src/cpp/QrCode.hpp) ++set(LIBRARY_NAME qrcodegen) diff --git a/recipes/qr-code-generator/all/patches/004-cmake-1.7.patch b/recipes/qr-code-generator/all/patches/004-cmake-1.7.patch new file mode 100644 index 0000000000000..d7ed7f6baa7c3 --- /dev/null +++ b/recipes/qr-code-generator/all/patches/004-cmake-1.7.patch @@ -0,0 +1,6 @@ +--- /dev/null ++++ b/files.cmake +@@ -0,0 +1,3 @@ ++set(SRC src/cpp/qrcodegen.cpp) ++set(HEADERS src/cpp/qrcodegen.hpp) ++set(LIBRARY_NAME qrcodegencpp) diff --git a/recipes/qr-code-generator/all/test_package/CMakeLists.txt b/recipes/qr-code-generator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f7fc3218bd3f1 --- /dev/null +++ b/recipes/qr-code-generator/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package CXX) + +find_package(qr-code-generator REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qr-code-generator::qr-code-generator) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if (qr-code-generator_VERSION VERSION_LESS "1.7.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE QR_USE_OLD_INCLUDE) +endif() diff --git a/recipes/qr-code-generator/all/test_package/conanfile.py b/recipes/qr-code-generator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/qr-code-generator/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/qr-code-generator/all/test_package/test_package.cpp b/recipes/qr-code-generator/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..701d4d2ec7131 --- /dev/null +++ b/recipes/qr-code-generator/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#if QR_USE_OLD_INCLUDE +#include "qrcodegen/QrCode.hpp" +#else +#include "qrcodegen/qrcodegen.hpp" +#endif + +#include +#include +#include +#include +#include + +namespace { + // Returns a string of SVG code for an image depicting the given QR Code, with the given number + // of border modules. The string always uses Unix newlines (\n), regardless of the platform. + std::string toSvgString(const qrcodegen::QrCode &qr, int border) { + if (border < 0) + throw std::domain_error("Border must be non-negative"); + if (border > std::numeric_limits::max() / 2 || border * 2 > std::numeric_limits::max() - qr.getSize()) + throw std::overflow_error("Border too large"); + + std::ostringstream sb; + sb << "\n"; + sb << "\n"; + sb << "\n"; + sb << "\t\n"; + sb << "\t\n"; + sb << "\n"; + return sb.str(); + } +} + +int main() { + std::cout << toSvgString(qrcodegen::QrCode::encodeText("test", qrcodegen::QrCode::Ecc::MEDIUM), 0); + return 0; +} diff --git a/recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt b/recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/qr-code-generator/all/test_v1_package/conanfile.py b/recipes/qr-code-generator/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/qr-code-generator/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qr-code-generator/config.yml b/recipes/qr-code-generator/config.yml new file mode 100644 index 0000000000000..9c24e0b4ae1b0 --- /dev/null +++ b/recipes/qr-code-generator/config.yml @@ -0,0 +1,11 @@ +versions: + "1.8.0": + folder: all + "1.7.0": + folder: all + "1.6.0": + folder: all + "1.5.0": + folder: all + "1.4.0": + folder: all diff --git a/recipes/qt-advanced-docking-system/all/CMakeLists.txt b/recipes/qt-advanced-docking-system/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/qt-advanced-docking-system/all/conandata.yml b/recipes/qt-advanced-docking-system/all/conandata.yml new file mode 100644 index 0000000000000..4dc01c8789b06 --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "3.8.3": + url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.3.tar.gz" + sha256: "bd5a9469b755bedf33baefd0b3dda6d167b7917a2888e2794eed5abee7d78f74" + "3.8.2": + url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.2.tar.gz" + sha256: "e56811228fb4d5f5703c31cd83cb39ab2d5a849f581719d383db72f9322ec7f2" +patches: + "3.8.2": + - patch_file: "patches/fix-cmake-license-install.patch" + base_path: "source_subfolder" diff --git a/recipes/qt-advanced-docking-system/all/conanfile.py b/recipes/qt-advanced-docking-system/all/conanfile.py new file mode 100644 index 0000000000000..332361aaf6862 --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir +from conans import CMake +import os + +required_conan_version = ">=1.52.0" + +class QtADS(ConanFile): + name = "qt-advanced-docking-system" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System" + topics = ("qt", "gui") + description = ( + "Qt Advanced Docking System lets you create customizable layouts " + "using a full featured window docking system similar to what is found " + "in many popular integrated development environments (IDEs) such as " + "Visual Studio." + ) + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + + _cmake = None + _qt_version = "5.15.6" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires(f"qt/{self._qt_version}") + + def source(self): + get(self, **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["ADS_VERSION"] = self.version + self._cmake.definitions["BUILD_EXAMPLES"] = "OFF" + self._cmake.definitions["BUILD_STATIC"] = not self.options.shared + + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + apply_conandata_patches(self) + + replace_in_file(self, + f"{self.source_folder}/{self._source_subfolder}/src/ads_globals.cpp", + "#include ", + f"#include <{self._qt_version}/QtGui/qpa/qplatformnativeinterface.h>" + ) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + rmdir(self, os.path.join(self.package_folder, "license")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + if self.options.shared: + self.cpp_info.libs = ["qtadvanceddocking"] + else: + self.cpp_info.defines.append("ADS_STATIC") + self.cpp_info.libs = ["qtadvanceddocking_static"] diff --git a/recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch b/recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch new file mode 100644 index 0000000000000..737536558a9ac --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch @@ -0,0 +1,15 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 49cd799..d601aaa 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -87,8 +87,8 @@ install(FILES ${ads_HEADERS} + COMPONENT headers + ) + install(FILES +- "${CMAKE_SOURCE_DIR}/LICENSE" +- "${CMAKE_SOURCE_DIR}/gnu-lgpl-v2.1.md" ++ "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE" ++ "${CMAKE_CURRENT_SOURCE_DIR}/../gnu-lgpl-v2.1.md" + DESTINATION license + COMPONENT license + ) diff --git a/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt b/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0451993feb016 --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(qt-advanced-docking-system CONFIG REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example qt-advanced-docking-system::qt-advanced-docking-system) diff --git a/recipes/qt-advanced-docking-system/all/test_package/conanfile.py b/recipes/qt-advanced-docking-system/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fd42f214c6b30 --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class AdsTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/qt-advanced-docking-system/all/test_package/example.cpp b/recipes/qt-advanced-docking-system/all/test_package/example.cpp new file mode 100644 index 0000000000000..38c7987a29f64 --- /dev/null +++ b/recipes/qt-advanced-docking-system/all/test_package/example.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + qDebug() << ads::CDockManager::configFlags(); + + return 0; +} diff --git a/recipes/qt-advanced-docking-system/config.yml b/recipes/qt-advanced-docking-system/config.yml new file mode 100644 index 0000000000000..63dc53b34436f --- /dev/null +++ b/recipes/qt-advanced-docking-system/config.yml @@ -0,0 +1,5 @@ +versions: + "3.8.3": + folder: "all" + "3.8.2": + folder: "all" diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml new file mode 100644 index 0000000000000..353dd22d4b636 --- /dev/null +++ b/recipes/qt/5.x.x/conandata.yml @@ -0,0 +1,188 @@ +sources: + "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" + "5.15.8": + url: + - "https://download.qt.io/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" + sha256: "776a9302c336671f9406a53bd30b8e36f825742b2ec44a57c08217bff0fa86b9" + "5.15.7": + url: + - "https://download.qt.io/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" + sha256: "8a71986676a3f37a198a9113acedbfd5bc5606a459b6b85816d951458adbe9a0" + "5.15.6": + url: + - "https://download.qt.io/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + sha256: "ebc77d27934b70b25b3dc34fbec7c4471eb451848e891c42b32409ea30fe309f" + "5.15.5": + url: + - "https://download.qt.io/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" + sha256: "5a97827bdf9fd515f43bc7651defaf64fecb7a55e051c79b8f80510d0e990f06" +patches: + "5.15.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" + "5.15.8": + - patch_file: "patches/aa2a39dea5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c72097e.diff" + base_path: "qt5/qtwebengine" + - patch_file: "patches/fix-macdeployqt.diff" + base_path: "qt5/qttools" + - patch_file: "patches/chromium-v8-missing-constexpr.patch" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" + - patch_file: "patches/chromium-skia-missing-iterator-include.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/skia-cd397f3.diff" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" + - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/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" + base_path: "qt5/qtbase" + "5.15.7": + - patch_file: "patches/337f28c9ab.patch" + base_path: "qt5/qtbase" + - patch_file: "patches/aa2a39dea5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c72097e.diff" + base_path: "qt5/qtwebengine" + - patch_file: "patches/fix-macdeployqt.diff" + base_path: "qt5/qttools" + - patch_file: "patches/dece6f5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/QTBUG-98813.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/d3396fb6fc.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/107ed30ec5.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/chromium-v8-missing-constexpr.patch" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" + - patch_file: "patches/chromium-skia-missing-iterator-include.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/skia-cd397f3.diff" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" + - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/android-backtrace.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/android-openssl.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/android-new-ndk.diff" + base_path: "qt5/qtbase" + "5.15.6": + - patch_file: "patches/337f28c9ab.patch" + base_path: "qt5/qtbase" + - patch_file: "patches/aa2a39dea5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c72097e.diff" + base_path: "qt5/qtwebengine" + - patch_file: "patches/fix-macdeployqt.diff" + base_path: "qt5/qttools" + - patch_file: "patches/dece6f5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/QTBUG-98813.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/d3396fb6fc.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/107ed30ec5.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/chromium-v8-missing-constexpr.patch" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" + - patch_file: "patches/chromium-skia-missing-iterator-include.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/skia-cd397f3.diff" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" + - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/android-backtrace.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/android-openssl.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/android-new-ndk.diff" + base_path: "qt5/qtbase" + "5.15.5": + - patch_file: "patches/337f28c9ab-5.15.5.patch" + base_path: "qt5/qtbase" + - patch_file: "patches/aa2a39dea5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c72097e.diff" + base_path: "qt5/qtwebengine" + - patch_file: "patches/fix-macdeployqt.diff" + base_path: "qt5/qttools" + - patch_file: "patches/dece6f5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/QTBUG-98813.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/d3396fb6fc.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/107ed30ec5.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/chromium-v8-missing-constexpr.patch" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" + - patch_file: "patches/chromium-skia-missing-iterator-include.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/skia-cd397f3.diff" + base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" + - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + - patch_file: "patches/android-backtrace.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/android-openssl.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/android-new-ndk.diff" + base_path: "qt5/qtbase" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py new file mode 100644 index 0000000000000..145542ecbe345 --- /dev/null +++ b/recipes/qt/5.x.x/conanfile.py @@ -0,0 +1,1513 @@ +from conan import ConanFile +from conan.errors import 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 +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, load, replace_in_file, rm, rmdir, save, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import msvc_runtime_flag, is_msvc, VCVars +from conan.tools.scm import Version +import configparser +import glob +import itertools +import os +import textwrap +import shutil + +required_conan_version = ">=1.59.0" + + +class QtConan(ConanFile): + _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtscript", "qtmultimedia", "qttools", "qtxmlpatterns", + "qttranslations", "qtdoc", "qtlocation", "qtsensors", "qtconnectivity", "qtwayland", + "qt3d", "qtimageformats", "qtgraphicaleffects", "qtquickcontrols", "qtserialbus", "qtserialport", "qtx11extras", + "qtmacextras", "qtwinextras", "qtandroidextras", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", + "qtquickcontrols2", "qtpurchasing", "qtcharts", "qtdatavis3d", "qtvirtualkeyboard", "qtgamepad", "qtscxml", + "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d", + "qtknx", "qtmqtt", "qtcoap", "qtopcua"] + + name = "qt" + description = "Qt is a cross-platform framework for graphical user interfaces." + topics = ("ui", "framework") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.qt.io" + license = "LGPL-3.0-only" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "commercial": [True, False], + + "opengl": ["no", "es2", "desktop", "dynamic"], + "with_vulkan": [True, False], + "openssl": [True, False], + "with_pcre2": [True, False], + "with_glib": [True, False], + # "with_libiconv": [True, False], # QTBUG-84708 Qt tests failure "invalid conversion from const char** to char**" + "with_doubleconversion": [True, False], + "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_icu": [True, False], + "with_harfbuzz": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], + "with_libpng": [True, False], + "with_sqlite3": [True, False], + "with_mysql": [True, False], + "with_pq": [True, False], + "with_odbc": [True, False], + "with_libalsa": [True, False], + "with_openal": [True, False], + "with_zstd": [True, False], + "with_gstreamer": [True, False], + "with_pulseaudio": [True, False], + "with_dbus": [True, False], + "with_gssapi": [True, False], + "with_atspi": [True, False], + "with_md4c": [True, False], + "with_x11": [True, False], + + "gui": [True, False], + "widgets": [True, False], + + "android_sdk": [None, "ANY"], + "device": [None, "ANY"], + "cross_compile": [None, "ANY"], + "sysroot": [None, "ANY"], + "config": [None, "ANY"], + "multiconfiguration": [True, False] + } + options.update({module: [True, False] for module in _submodules}) + + default_options = { + "shared": False, + "commercial": False, + "opengl": "desktop", + "with_vulkan": False, + "openssl": True, + "with_pcre2": True, + "with_glib": False, + # "with_libiconv": True, # QTBUG-84708 + "with_doubleconversion": True, + "with_freetype": True, + "with_fontconfig": True, + "with_icu": True, + "with_harfbuzz": False, + "with_libjpeg": "libjpeg", + "with_libpng": True, + "with_sqlite3": True, + "with_mysql": True, + "with_pq": True, + "with_odbc": True, + "with_libalsa": False, + "with_openal": True, + "with_zstd": True, + "with_gstreamer": False, + "with_pulseaudio": False, + "with_dbus": False, + "with_gssapi": False, + "with_atspi": False, + "with_md4c": True, + "with_x11": True, + + "gui": True, + "widgets": True, + + "android_sdk": None, + "device": None, + "cross_compile": None, + "sysroot": None, + "config": None, + "multiconfiguration": False + } + + no_copy_source = True + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export(self): + copy(self, f"qtmodules{self.version}.conf", self.recipe_folder, self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + def validate_build(self): + if self.options.qtwebengine: + # Check if a valid python2 is available in PATH or it will failflex + # Start by checking if python2 can be found + python_exe = shutil.which("python2") + if not python_exe: + # Fall back on regular python + python_exe = shutil.which("python") + + if not python_exe: + msg = ("Python2 must be available in PATH " + "in order to build Qt WebEngine") + raise ConanInvalidConfiguration(msg) + + # In any case, check its actual version for compatibility + from six import StringIO # Python 2 and 3 compatible + mybuf = StringIO() + cmd_v = f"\"{python_exe}\" --version" + self.run(cmd_v, mybuf) + verstr = mybuf.getvalue().strip().split("Python ")[1] + if verstr.endswith("+"): + verstr = verstr[:-1] + version = Version(verstr) + # >= 2.7.5 & < 3 + v_min = "2.7.5" + v_max = "3.0.0" + if (version >= v_min) and (version < v_max): + msg = ("Found valid Python 2 required for QtWebengine:" + f" version={mybuf.getvalue()}, path={python_exe}") + self.output.success(msg) + else: + msg = (f"Found Python 2 in path, but with invalid version {verstr}" + f" (QtWebEngine requires >= {v_min} & < {v_max})\n" + "If you have both Python 2 and 3 installed, copy the python 2 executable to" + "python2(.exe)") + raise ConanInvalidConfiguration(msg) + + def config_options(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_icu + del self.options.with_fontconfig + del self.options.with_libalsa + del self.options.with_x11 + del self.options.qtx11extras + if self.settings.compiler == "apple-clang": + if Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") + if self.settings.compiler in ["gcc", "clang"]: + if Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0") + if self.settings.compiler in ["gcc", "clang"] and Version(self.settings.compiler.version) < "5.3": + del self.options.with_mysql + if self.settings.os == "Windows": + self.options.with_mysql = False + self.options.opengl = "dynamic" + del self.options.with_gssapi + if self.settings.os != "Linux": + self.options.qtwayland = False + self.options.with_atspi = False + + if self.settings.os != "Windows": + del self.options.qtwinextras + del self.options.qtactiveqt + + if self.settings.os != "Macos": + del self.options.qtmacextras + + if self.settings.os != "Android": + del self.options.android_sdk + + def configure(self): + # if self.settings.os != "Linux": + # self.options.with_libiconv = False # QTBUG-84708 + + if not self.options.gui: + del self.options.opengl + del self.options.with_vulkan + del self.options.with_freetype + del self.options.with_fontconfig + del self.options.with_harfbuzz + del self.options.with_libjpeg + del self.options.with_libpng + del self.options.with_md4c + del self.options.with_x11 + + 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 + + config = configparser.ConfigParser() + config.read(os.path.join(self.recipe_folder, f"qtmodules{self.version}.conf")) + submodules_tree = {} + assert config.sections(), f"no qtmodules.conf file for version {self.version}" + for s in config.sections(): + section = str(s) + assert section.startswith("submodule ") + assert section.count('"') == 2 + modulename = section[section.find('"') + 1: section.rfind('"')] + status = str(config.get(section, "status")) + if status not in ("obsolete", "ignore"): + submodules_tree[modulename] = {"status": status, + "path": str(config.get(section, "path")), "depends": []} + if config.has_option(section, "depends"): + submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] + + for m in submodules_tree: + assert m in ["qtbase", "qtqa", "qtrepotools"] or m in self._submodules, "module %s is not present in recipe options : (%s)" % (m, ",".join(self._submodules)) + + for m in self._submodules: + if m not in submodules_tree: + delattr(self.options, m) + + def _enablemodule(mod): + if mod != "qtbase": + setattr(self.options, mod, True) + for req in submodules_tree[mod]["depends"]: + _enablemodule(req) + + for module in self._submodules: + if self.options.get_safe(module): + _enablemodule(module) + + for module in self._submodules: + if module in self.options and not self.options.get_safe(module): + setattr(self.options, module, False) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + if self.options.widgets and not self.options.gui: + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") + + if self.options.qtwebengine: + if not self.options.shared: + raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") + + if not (self.options.gui and self.options.qtdeclarative and self.options.qtlocation and self.options.qtwebchannel): + raise ConanInvalidConfiguration("option qt:qtwebengine requires also qt:gui, qt:qtdeclarative, qt:qtlocation and qt:qtwebchannel") + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported") + + if self.settings.os == "Android": + if self.options.get_safe("opengl", "no") == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") + if not self.options.get_safe("android_sdk", ""): + raise ConanInvalidConfiguration("Path to Android SDK is required to build Qt") + + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if not self.options.with_doubleconversion and str(self.settings.compiler.libcxx) != "libc++": + raise ConanInvalidConfiguration("Qt without libc++ needs qt:with_doubleconversion. " + "Either enable qt:with_doubleconversion or switch to libc++") + + if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: + raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + + if self.settings.compiler == "apple-clang": + if Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") + if self.settings.compiler in ["gcc", "clang"]: + if Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0") + + if self.options.get_safe("with_pulseaudio", default=False) and not self.dependencies["pulseaudio"].options.with_glib: + # https://bugreports.qt.io/browse/QTBUG-95952 + raise ConanInvalidConfiguration("Pulseaudio needs to be built with glib option or qt's configure script won't detect it") + + if self.settings.os in ['Linux', 'FreeBSD']: + if self.options.with_gssapi: + raise ConanInvalidConfiguration("gssapi cannot be enabled until conan-io/conan-center-index#4102 is closed") + + if self.options.get_safe("with_x11", False) and not self.dependencies.direct_host["xkbcommon"].options.with_x11: + raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must be enabled when the 'with_x11' option is enabled") + if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland: + raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled") + + if cross_building(self) and self.options.cross_compile == "None" and not is_apple_os(self) and self.settings.os != "Android": + raise ConanInvalidConfiguration("option cross_compile must be set for cross compilation " + "cf https://doc.qt.io/qt-5/configure-options.html#cross-compilation-options") + + if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: + raise ConanInvalidConfiguration("sqlite3 option enable_column_metadata must be enabled for qt") + + def requirements(self): + self.requires("zlib/1.2.13") + if self.options.openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_pcre2: + self.requires("pcre2/10.42") + if self.options.get_safe("with_vulkan"): + self.requires("vulkan-loader/1.3.239.0") + if is_apple_os(self): + self.requires("moltenvk/1.2.2") + if self.options.with_glib: + self.requires("glib/2.76.2") + # if self.options.with_libiconv: # QTBUG-84708 + # self.requires("libiconv/1.16")# QTBUG-84708 + if self.options.with_doubleconversion and not self.options.multiconfiguration: + self.requires("double-conversion/3.2.1") + if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: + self.requires("freetype/2.13.0") + if self.options.get_safe("with_fontconfig", False): + self.requires("fontconfig/2.14.2") + if self.options.get_safe("with_icu", False): + self.requires("icu/73.1") + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + self.requires("harfbuzz/7.1.0") + if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + else: + self.requires("libjpeg/9e") + if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: + self.requires("libpng/1.6.39") + if self.options.with_sqlite3 and not self.options.multiconfiguration: + self.requires("sqlite3/3.41.2") + if self.options.get_safe("with_mysql", False): + self.requires("libmysqlclient/8.0.31") + if self.options.with_pq: + self.requires("libpq/14.7") + if self.options.with_odbc: + if self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("with_openal", False): + self.requires("openal-soft/1.22.2") + if self.options.get_safe("with_libalsa", False): + self.requires("libalsa/1.2.7.2") + if self.options.get_safe("with_x11", False): + self.requires("xkbcommon/1.5.0") + self.requires("xorg/system") + if self.options.get_safe("opengl", "no") != "no": + self.requires("opengl/system") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: + self.requires("expat/2.5.0") + self.requires("opus/1.3.1") + if not self.options.qtwayland: + self.requires("xorg-proto/2022.2") + self.requires("libxshmfence/1.3") + self.requires("nss/3.89") + self.requires("libdrm/2.4.114") + self.requires("egl/system") + if self.options.get_safe("with_gstreamer", False): + self.requires("gst-plugins-base/1.19.2") + if self.options.get_safe("with_pulseaudio", False): + self.requires("pulseaudio/14.2") + if self.options.with_dbus: + self.requires("dbus/1.15.2") + if self.options.qtwayland: + self.requires("wayland/1.21.0") + self.requires("xkbcommon/1.5.0") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 + if self.options.get_safe("with_atspi"): + self.requires("at-spi2-core/2.48.0") + if self.options.get_safe("with_md4c", False): + self.requires("md4c/0.4.8") + + def package_id(self): + del self.info.options.cross_compile + del self.info.options.sysroot + if self.info.options.multiconfiguration: + if self.info.settings.compiler == "Visual Studio": + if "MD" in self.info.settings.compiler.runtime: + self.info.settings.compiler.runtime = "MD/MDd" + else: + self.info.settings.compiler.runtime = "MT/MTd" + elif self.info.settings.compiler == "msvc": + self.info.settings.compiler.runtime_type = "Release/Debug" + if self.info.settings.os == "Android": + del self.info.options.android_sdk + + def build_requirements(self): + if self._settings_build.os == "Windows" and is_msvc(self): + self.tool_requires("jom/1.1.3") + if self.options.qtwebengine: + self.tool_requires("ninja/1.11.1") + self.tool_requires("nodejs/18.15.0") + self.tool_requires("gperf/3.1") + # gperf, bison, flex, python >= 2.7.5 & < 3 + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + if self.options.qtwayland: + self.tool_requires("wayland/1.21.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination="qt5") + + apply_conandata_patches(self) + for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: + replace_in_file(self, os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + " if (enable_precompiled_headers) {\n if (is_win) {", + " if (enable_precompiled_headers) {\n if (false) {" + ) + replace_in_file(self, os.path.join(self.source_folder, "qt5", "qtbase", "configure.json"), + "-ldbus-1d", + "-ldbus-1" + ) + save(self, os.path.join(self.source_folder, "qt5", "qtbase", "mkspecs", "features", "uikit", "bitcode.prf"), "") + + def generate(self): + pc = PkgConfigDeps(self) + pc.generate() + ms = VCVars(self) + ms.generate() + vbe = VirtualBuildEnv(self) + vbe.generate() + if not cross_building(self): + vre = VirtualRunEnv(self) + vre.generate(scope="build") + env = Environment() + env.define("MAKEFLAGS", f"j{build_jobs(self)}") + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + if self.settings.os == "Windows": + env.prepend_path("PATH", os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")) + if self._settings_build.os == "Macos": + # On macOS, SIP resets DYLD_LIBRARY_PATH injected by VirtualBuildEnv & VirtualRunEnv + dyld_library_path = "$DYLD_LIBRARY_PATH" + dyld_library_path_build = vbe.vars().get("DYLD_LIBRARY_PATH") + if dyld_library_path_build: + dyld_library_path = f"{dyld_library_path_build}:{dyld_library_path}" + if not cross_building(self): + dyld_library_path_host = vre.vars().get("DYLD_LIBRARY_PATH") + if dyld_library_path_host: + dyld_library_path = f"{dyld_library_path_host}:{dyld_library_path}" + save(self, "bash_env", f'export DYLD_LIBRARY_PATH="{dyld_library_path}"') + env.define_path("BASH_ENV", os.path.abspath("bash_env")) + env.vars(self).save_script("conan_qt_env_file") + + def _make_program(self): + if is_msvc(self): + return "jom" + elif self._settings_build.os == "Windows": + return "mingw32-make" + else: + return "make" + + def _xplatform(self): + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + return {"x86": "linux-g++-32", + "armv6": "linux-arm-gnueabi-g++", + "armv7": "linux-arm-gnueabi-g++", + "armv7hf": "linux-arm-gnueabi-g++", + "armv8": "linux-aarch64-gnu-g++"}.get(str(self.settings.arch), "linux-g++") + elif self.settings.compiler == "clang": + if self.settings.arch == "x86": + return "linux-clang-libc++-32" if self.settings.compiler.libcxx == "libc++" else "linux-clang-32" + elif self.settings.arch == "x86_64": + return "linux-clang-libc++" if self.settings.compiler.libcxx == "libc++" else "linux-clang" + + elif self.settings.os == "Macos": + return {"clang": "macx-clang", + "apple-clang": "macx-clang", + "gcc": "macx-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "iOS": + if self.settings.compiler == "apple-clang": + return "macx-ios-clang" + + elif self.settings.os == "watchOS": + if self.settings.compiler == "apple-clang": + return "macx-watchos-clang" + + elif self.settings.os == "tvOS": + if self.settings.compiler == "apple-clang": + return "macx-tvos-clang" + + elif self.settings.os == "Android": + if self.settings.compiler == "clang": + return "android-clang" + + elif self.settings.os == "Windows": + return { + "Visual Studio": "win32-msvc", + "msvc": "win32-msvc", + "gcc": "win32-g++", + "clang": "win32-clang-g++", + }.get(str(self.settings.compiler)) + + elif self.settings.os == "WindowsStore": + if is_msvc(self): + if str(self.settings.compiler) == "Visual Studio": + msvc_version = str(self.settings.compiler.version) + else: + msvc_version = { + "190": "14", + "191": "15", + "192": "16", + }.get(str(self.settings.compiler.version)) + return { + "14": { + "armv7": "winrt-arm-msvc2015", + "x86": "winrt-x86-msvc2015", + "x86_64": "winrt-x64-msvc2015", + }, + "15": { + "armv7": "winrt-arm-msvc2017", + "x86": "winrt-x86-msvc2017", + "x86_64": "winrt-x64-msvc2017", + }, + "16": { + "armv7": "winrt-arm-msvc2019", + "x86": "winrt-x86-msvc2019", + "x86_64": "winrt-x64-msvc2019", + } + }.get(msvc_version).get(str(self.settings.arch)) + + elif self.settings.os == "FreeBSD": + return {"clang": "freebsd-clang", + "gcc": "freebsd-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "SunOS": + if self.settings.compiler == "sun-cc": + if self.settings.arch == "sparc": + return "solaris-cc-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc" + elif self.settings.arch == "sparcv9": + return "solaris-cc64-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc64" + elif self.settings.compiler == "gcc": + return {"sparc": "solaris-g++", + "sparcv9": "solaris-g++-64"}.get(str(self.settings.arch)) + elif self.settings.os == "Neutrino" and self.settings.compiler == "qcc": + return {"armv8": "qnx-aarch64le-qcc", + "armv8.3": "qnx-aarch64le-qcc", + "armv7": "qnx-armle-v7-qcc", + "armv7hf": "qnx-armle-v7-qcc", + "armv7s": "qnx-armle-v7-qcc", + "armv7k": "qnx-armle-v7-qcc", + "x86": "qnx-x86-qcc", + "x86_64": "qnx-x86-64-qcc"}.get(str(self.settings.arch)) + elif self.settings.os == "Emscripten" and self.settings.arch == "wasm": + return "wasm-emscripten" + + return None + + def build(self): + args = ["-confirm-license", "-silent", "-nomake examples", "-nomake tests", + f"-prefix {self.package_folder}"] + 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: + args.append("-opensource") + if not self.options.gui: + args.append("-no-gui") + if not self.options.widgets: + args.append("-no-widgets") + if not self.options.shared: + args.insert(0, "-static") + if is_msvc(self) and "MT" in msvc_runtime_flag(self): + args.append("-static-runtime") + else: + args.insert(0, "-shared") + if self.options.multiconfiguration: + args.append("-debug-and-release") + elif self.settings.build_type == "Debug": + args.append("-debug") + elif self.settings.build_type == "Release": + args.append("-release") + elif self.settings.build_type == "RelWithDebInfo": + args.append("-release") + args.append("-force-debug-info") + elif self.settings.build_type == "MinSizeRel": + args.append("-release") + args.append("-optimize-size") + + for module in self._submodules: + if module in self.options and not self.options.get_safe(module): + args.append("-skip " + module) + + args.append("--zlib=system") + + # openGL + opengl = self.options.get_safe("opengl", "no") + if opengl == "no": + args += ["-no-opengl"] + elif opengl == "es2": + args += ["-opengl es2"] + elif opengl == "desktop": + args += ["-opengl desktop"] + elif opengl == "dynamic": + args += ["-opengl dynamic"] + + if self.options.get_safe("with_vulkan", False): + args.append("-vulkan") + else: + args.append("-no-vulkan") + + # openSSL + if not self.options.openssl: + args += ["-no-openssl"] + else: + if self.dependencies["openssl"].options.shared: + args += ["-openssl-runtime"] + else: + args += ["-openssl-linked"] + + # args.append("--iconv=" + ("gnu" if self.options.with_libiconv else "no"))# QTBUG-84708 + + args.append("--glib=" + ("yes" if self.options.with_glib else "no")) + args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) + args.append("--fontconfig=" + ("yes" if self.options.get_safe("with_fontconfig", False) else "no")) + args.append("--icu=" + ("yes" if self.options.get_safe("with_icu", False) else "no")) + args.append("--sql-mysql=" + ("yes" if self.options.get_safe("with_mysql", False) else "no")) + args.append("--sql-psql=" + ("yes" if self.options.with_pq else "no")) + args.append("--sql-odbc=" + ("yes" if self.options.with_odbc else "no")) + args.append("--zstd=" + ("yes" if self.options.with_zstd else "no")) + + if self.options.qtmultimedia: + args.append("--alsa=" + ("yes" if self.options.get_safe("with_libalsa", False) else "no")) + args.append("--gstreamer" if self.options.get_safe("with_gstreamer", False) else "--no-gstreamer") + args.append("--pulseaudio" if self.options.get_safe("with_pulseaudio", False) else "--no-pulseaudio") + + if self.options.with_dbus: + args.append("-dbus-linked") + else: + args.append("-no-dbus") + + args.append("-feature-gssapi" if self.options.get_safe("with_gssapi", False) else "-no-feature-gssapi") + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_sqlite3", "sqlite"), + ("with_md4c", "libmd4c")]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + args += ["-qt-" + conf_arg] + else: + args += ["-system-" + conf_arg] + else: + args += ["-no-" + conf_arg] + + libmap = [("zlib", "ZLIB"), + ("openssl", "OPENSSL"), + ("pcre2", "PCRE2"), + ("glib", "GLIB"), + # ("libiconv", "ICONV"),# QTBUG-84708 + ("double-conversion", "DOUBLECONVERSION"), + ("freetype", "FREETYPE"), + ("fontconfig", "FONTCONFIG"), + ("icu", "ICU"), + ("harfbuzz", "HARFBUZZ"), + ("libjpeg", "LIBJPEG"), + ("libjpeg-turbo", "LIBJPEG"), + ("libpng", "LIBPNG"), + ("sqlite3", "SQLITE"), + ("libmysqlclient", "MYSQL"), + ("libpq", "PSQL"), + ("odbc", "ODBC"), + ("sdl2", "SDL2"), + ("openal-soft", "OPENAL"), + ("zstd", "ZSTD"), + ("libalsa", "ALSA"), + ("xkbcommon", "XKBCOMMON"), + ("md4c", "LIBMD4C")] + for package, var in libmap: + if package in [d.ref.name for d in self.dependencies.direct_host.values()]: + p = self.dependencies[package] + if package == "freetype": + args.append("\"%s_INCDIR=%s\"" % (var, p.cpp_info.aggregated_components().includedirs[-1])) + args.append("\"%s_LIBS=%s\"" % (var, " ".join(self._gather_libs(p)))) + + for dependency in self.dependencies.direct_host.values(): + args += [f"-I \"{s}\"" for s in dependency.cpp_info.aggregated_components().includedirs] + args += [f"-D {s}" for s in dependency.cpp_info.aggregated_components().defines] + + libdirs = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] + args.append("QMAKE_LIBDIR+=\"%s\"" % " ".join(libdirs)) + if not is_msvc(self): + args.append("QMAKE_RPATHLINKDIR+=\"%s\"" % ":".join(libdirs)) + + if "libmysqlclient" in [d.ref.name for d in self.dependencies.direct_host.values()]: + args.append("-mysql_config \"%s\"" % os.path.join(self.dependencies["libmysqlclient"].package_folder, "bin", "mysql_config")) + if "libpq" in [d.ref.name for d in self.dependencies.direct_host.values()]: + args.append("-psql_config \"%s\"" % os.path.join(self.dependencies["libpq"].package_folder, "bin", "pg_config")) + if self.settings.os == "Macos": + args += ["-no-framework"] + if self.settings.arch == "armv8": + args.append('QMAKE_APPLE_DEVICE_ARCHS="arm64"') + elif self.settings.os == "Android": + args += [f"-android-ndk-platform android-{self.settings.os.api_level}"] + args += [f"-android-abis {android_abi(self)}"] + + if self.settings.get_safe("compiler.libcxx") == "libstdc++": + args += ["-D_GLIBCXX_USE_CXX11_ABI=0"] + elif self.settings.get_safe("compiler.libcxx") == "libstdc++11": + args += ["-D_GLIBCXX_USE_CXX11_ABI=1"] + + if self.options.get_safe("android_sdk", ""): + args += [f"-android-sdk {self.options.android_sdk}"] + if self.options.sysroot: + args += [f"-sysroot {self.options.sysroot}"] + + if self.options.device: + args += [f"-device {self.options.device}"] + else: + xplatform_val = self._xplatform() + if xplatform_val: + if not cross_building(self, skip_x64_x86=True): + args += [f"-platform {xplatform_val}"] + else: + args += [f"-xplatform {xplatform_val}"] + else: + self.output.warn("host not supported: %s %s %s %s" % + (self.settings.os, self.settings.compiler, + self.settings.compiler.version, self.settings.arch)) + if self.options.cross_compile: + args += [f"-device-option CROSS_COMPILE={self.options.cross_compile}"] + + def _getenvpath(var): + val = os.getenv(var) + if val and self._settings_build.os == "Windows": + val = val.replace("\\", "/") + os.environ[var] = val + return val + + if not is_msvc(self): + value = _getenvpath("CC") + if value: + args += ['QMAKE_CC="' + value + '"', + 'QMAKE_LINK_C="' + value + '"', + 'QMAKE_LINK_C_SHLIB="' + value + '"'] + + value = _getenvpath('CXX') + if value: + args += ['QMAKE_CXX="' + value + '"', + 'QMAKE_LINK="' + value + '"', + 'QMAKE_LINK_SHLIB="' + value + '"'] + + if self._settings_build.os == "Linux" and self.settings.compiler == "clang": + args += ['QMAKE_CXXFLAGS+="-ftemplate-depth=1024"'] + + if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: + args += ["-qt-webengine-ffmpeg", + "-system-webengine-opus", + "-webengine-jumbo-build 0"] + + if self.options.config: + args.append(str(self.options.config)) + + os.mkdir("build_folder") + with chdir(self, "build_folder"): + if self._settings_build.os == "Macos": + save(self, ".qmake.stash" , "") + save(self, ".qmake.super" , "") + + self.run("%s %s" % (os.path.join(self.source_folder, "qt5", "configure"), " ".join(args))) + self.run(self._make_program()) + + @property + def _cmake_core_extras_file(self): + return os.path.join("lib", "cmake", "Qt5Core", "conan_qt_core_extras.cmake") + + def _cmake_qt5_private_file(self, module): + return os.path.join("lib", "cmake", f"Qt5{module}", f"conan_qt_qt5_{module.lower()}private.cmake") + + 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""") + copy(self, "*LICENSE*", os.path.join(self.source_folder, "qt5/"), os.path.join(self.package_folder, "licenses")) + for module in self._submodules: + if not self.options.get_safe(module): + rmdir(self, os.path.join(self.package_folder, "licenses", module)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: + rm(self, mask, self.package_folder, recursive=True) + 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) + # "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*")): + os.remove(fl) + + for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")): + module = os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake") + if not os.path.isfile(module): + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", m)) + + extension = "" + if self._settings_build.os == "Windows": + extension = ".exe" + v = Version(self.version) + filecontents = textwrap.dedent(f"""\ + set(QT_CMAKE_EXPORT_NAMESPACE Qt5) + set(QT_VERSION_MAJOR {v.major}) + set(QT_VERSION_MINOR {v.minor}) + set(QT_VERSION_PATCH {v.patch}) + """) + targets = {} + targets["Core"] = ["moc", "rcc", "qmake"] + targets["DBus"] = ["qdbuscpp2xml", "qdbusxml2cpp"] + if self.options.widgets: + targets["Widgets"] = ["uic"] + if self.options.qttools: + targets["Tools"] = ["qhelpgenerator", "qcollectiongenerator", "qdoc", "qtattributionsscanner"] + targets[""] = ["lconvert", "lrelease", "lupdate"] + if self.options.qtremoteobjects: + targets["RemoteObjects"] = ["repc"] + if self.options.qtscxml: + targets["Scxml"] = ["qscxmlc"] + for namespace, targets in targets.items(): + for target in targets: + filecontents += textwrap.dedent("""\ + if(NOT TARGET ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) + add_executable(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} IMPORTED) + set_target_properties(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} PROPERTIES IMPORTED_LOCATION ${{CMAKE_CURRENT_LIST_DIR}}/../../../bin/{target}{ext}) + set(Qt5{namespace}_{uppercase_target}_EXECUTABLE ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) + endif() + """.format(target=target, ext=extension, namespace=namespace, uppercase_target=target.upper())) + + if self.settings.os == "Windows": + filecontents += textwrap.dedent("""\ + set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain) + if (NOT Qt5_NO_LINK_QTMAIN) + set(_isExe $,EXECUTABLE>) + set(_isWin32 $>) + set(_isNotExcluded $>>) + set(_isPolicyNEW $) + set_property(TARGET Qt5::Core APPEND PROPERTY + INTERFACE_LINK_LIBRARIES + $<$:Qt5::WinMain> + ) + unset(_isExe) + unset(_isWin32) + unset(_isNotExcluded) + unset(_isPolicyNEW) + endif() + """) + + filecontents += textwrap.dedent(f"""\ + if(NOT DEFINED QT_DEFAULT_MAJOR_VERSION) + set(QT_DEFAULT_MAJOR_VERSION {v.major}) + endif() + """) + filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n' + save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents) + + def _create_private_module(module, dependencies=[]): + if "Core" not in dependencies: + dependencies.append("Core") + dependencies_string = ';'.join(f'Qt5::{dependency}' for dependency in dependencies) + contents = textwrap.dedent("""\ + if(NOT TARGET Qt5::{0}Private) + add_library(Qt5::{0}Private INTERFACE IMPORTED) + set_target_properties(Qt5::{0}Private PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{0}/{1};${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{0}/{1}/Qt{0}" + INTERFACE_LINK_LIBRARIES "{2}" + ) + + add_library(Qt::{0}Private INTERFACE IMPORTED) + set_target_properties(Qt::{0}Private PROPERTIES + INTERFACE_LINK_LIBRARIES "Qt5::{0}Private" + _qt_is_versionless_target "TRUE" + ) + endif()""".format(module, self.version, dependencies_string)) + + save(self, os.path.join(self.package_folder, self._cmake_qt5_private_file(module)), contents) + + _create_private_module("Core") + + if self.options.gui: + _create_private_module("Gui", ["CorePrivate", "Gui"]) + + if self.options.widgets: + _create_private_module("Widgets", ["CorePrivate", "Gui", "GuiPrivate"]) + + if self.options.qtdeclarative: + _create_private_module("Qml", ["CorePrivate", "Qml"]) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Qt5") + + self.cpp_info.names["cmake_find_package"] = "Qt5" + self.cpp_info.names["cmake_find_package_multi"] = "Qt5" + + build_modules = {} + + def _add_build_module(component, module): + if component not in build_modules: + build_modules[component] = [] + build_modules[component].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package"].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append(module) + + libsuffix = "" + if self.settings.os == "Android": + libsuffix = f"_{android_abi(self)}" + if not self.options.multiconfiguration: + if self.settings.build_type == "Debug": + if self.settings.os == "Windows" and is_msvc(self): + libsuffix = "d" + elif is_apple_os(self): + libsuffix = "_debug" + + def _get_corrected_reqs(requires): + reqs = [] + for r in requires: + if "::" in r: + corrected_req = r + else: + corrected_req = f"qt{r}" + assert corrected_req in self.cpp_info.components, f"{corrected_req} required but not yet present in self.cpp_info.components" + reqs.append(corrected_req) + return reqs + + def _create_module(module, requires=[], has_include_dir=True): + componentname = f"qt{module}" + assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}") + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + if module.endswith("Private"): + libname = module[:-7] + else: + libname = module + self.cpp_info.components[componentname].libs = [f"Qt5{libname}{libsuffix}"] + if has_include_dir: + self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", f"Qt{module}")] + self.cpp_info.components[componentname].defines = [f"QT_{module.upper()}_LIB"] + if module != "Core" and "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + def _create_plugin(pluginname, libname, plugintype, requires): + componentname = f"qt{pluginname}" + assert componentname not in self.cpp_info.components, f"Plugin {pluginname} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{pluginname}") + self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname + 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].includedirs = [] + if "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + core_reqs = ["zlib::zlib"] + if self.options.with_pcre2: + core_reqs.append("pcre2::pcre2") + if self.options.with_doubleconversion: + core_reqs.append("double-conversion::double-conversion") + if self.options.get_safe("with_icu", False): + core_reqs.append("icu::icu") + if self.options.with_zstd: + core_reqs.append("zstd::zstd") + if self.options.with_glib: + core_reqs.append("glib::glib-2.0") + + _create_module("Core", core_reqs) + if self.settings.os == "Windows": + module = "WinMain" + componentname = f"qt{module}" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}") + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + self.cpp_info.components[componentname].libs = [f"qtmain{libsuffix}"] + self.cpp_info.components[componentname].includedirs = [] + self.cpp_info.components[componentname].defines = [] + + if self.options.with_dbus: + _create_module("DBus", ["dbus::dbus"]) + if self.options.gui: + gui_reqs = [] + if self.options.with_dbus: + gui_reqs.append("DBus") + if self.options.with_freetype: + gui_reqs.append("freetype::freetype") + if self.options.with_libpng: + gui_reqs.append("libpng::libpng") + if self.options.get_safe("with_fontconfig", False): + gui_reqs.append("fontconfig::fontconfig") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.qtwayland or self.options.get_safe("with_x11", False): + gui_reqs.append("xkbcommon::xkbcommon") + if self.options.get_safe("with_x11", False): + gui_reqs.append("xorg::xorg") + if self.options.get_safe("opengl", "no") != "no": + gui_reqs.append("opengl::opengl") + if self.options.get_safe("with_vulkan", False): + gui_reqs.append("vulkan-loader::vulkan-loader") + if is_apple_os(self): + gui_reqs.append("moltenvk::moltenvk") + if self.options.with_harfbuzz: + gui_reqs.append("harfbuzz::harfbuzz") + if self.options.with_libjpeg == "libjpeg-turbo": + gui_reqs.append("libjpeg-turbo::libjpeg-turbo") + if self.options.with_libjpeg == "libjpeg": + gui_reqs.append("libjpeg::libjpeg") + if self.options.with_md4c: + gui_reqs.append("md4c::md4c") + _create_module("Gui", gui_reqs) + _add_build_module("qtGui", self._cmake_qt5_private_file("Gui")) + + event_dispatcher_reqs = ["Core", "Gui"] + if self.options.with_glib: + event_dispatcher_reqs.append("glib::glib") + _create_module("EventDispatcherSupport", event_dispatcher_reqs) + _create_module("FontDatabaseSupport", ["Core", "Gui"]) + if self.settings.os == "Windows": + self.cpp_info.components["qtFontDatabaseSupport"].system_libs.extend(["advapi32", "ole32", "user32", "gdi32"]) + elif is_apple_os(self): + self.cpp_info.components["qtFontDatabaseSupport"].frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText","Foundation"]) + self.cpp_info.components["qtFontDatabaseSupport"].frameworks.append("AppKit" if self.settings.os == "Macos" else "UIKit") + if self.options.get_safe("with_fontconfig"): + self.cpp_info.components["qtFontDatabaseSupport"].requires.append("fontconfig::fontconfig") + if self.options.get_safe("with_freetype"): + self.cpp_info.components["qtFontDatabaseSupport"].requires.append("freetype::freetype") + + + _create_module("ThemeSupport", ["Core", "Gui"]) + _create_module("AccessibilitySupport", ["Core", "Gui"]) + if self.options.get_safe("with_vulkan"): + _create_module("VulkanSupport", ["Core", "Gui"]) + + if self.options.widgets: + _create_module("Widgets", ["Gui"]) + _add_build_module("qtWidgets", self._cmake_qt5_private_file("Widgets")) + if self.settings.os not in ["iOS", "watchOS", "tvOS"]: + _create_module("PrintSupport", ["Gui", "Widgets"]) + if self.settings.os == "Macos" and not self.options.shared: + self.cpp_info.components["qtPrintSupport"].system_libs.append("cups") + + if is_apple_os(self): + _create_module("ClipboardSupport", ["Core", "Gui"]) + self.cpp_info.components["qtClipboardSupport"].frameworks = ["ImageIO"] + if self.settings.os == "Macos": + self.cpp_info.components["qtClipboardSupport"].frameworks.append("AppKit") + _create_module("GraphicsSupport", ["Core", "Gui"]) + + if self.settings.os in ["Android", "Emscripten"]: + _create_module("EglSupport", ["Core", "Gui"]) + + if self.settings.os == "Windows": + windows_reqs = ["Core", "Gui"] + windows_reqs.extend(["EventDispatcherSupport", "FontDatabaseSupport", "ThemeSupport", "AccessibilitySupport"]) + _create_module("WindowsUIAutomationSupport", ["Core", "Gui"]) + windows_reqs.append("WindowsUIAutomationSupport") + if self.options.get_safe("with_vulkan"): + windows_reqs.append("VulkanSupport") + _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", windows_reqs) + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", windows_reqs) + self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs = ["advapi32", "dwmapi", "gdi32", "imm32", + "ole32", "oleaut32", "shell32", "shlwapi", "user32", "winmm", "winspool", "wtsapi32"] + elif self.settings.os == "Android": + android_reqs = ["Core", "Gui", "EventDispatcherSupport", "AccessibilitySupport", "FontDatabaseSupport", "EglSupport"] + if self.options.get_safe("with_vulkan"): + android_reqs.append("VulkanSupport") + _create_plugin("QAndroidIntegrationPlugin", "qtforandroid", "platforms", android_reqs) + self.cpp_info.components["qtQAndroidIntegrationPlugin"].system_libs = ["android", "jnigraphics"] + elif self.settings.os == "Macos": + cocoa_reqs = ["Core", "Gui", "ClipboardSupport", "ThemeSupport", "FontDatabaseSupport", "GraphicsSupport", "AccessibilitySupport"] + if self.options.get_safe("with_vulkan"): + cocoa_reqs.append("VulkanSupport") + if self.options.widgets: + cocoa_reqs.append("PrintSupport") + _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", cocoa_reqs) + _create_plugin("QMacStylePlugin", "qmacstyle", "styles", cocoa_reqs) + self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = ["AppKit", "Carbon", "CoreServices", "CoreVideo", + "IOKit", "IOSurface", "Metal", "QuartzCore"] + elif self.settings.os in ["iOS", "tvOS"]: + _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", ["ClipboardSupport", "FontDatabaseSupport", "GraphicsSupport"]) + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = ["AudioToolbox", "Foundation", "Metal", + "MobileCoreServices", "OpenGLES", "QuartzCore", "UIKit"] + elif self.settings.os == "watchOS": + _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", ["EventDispatcherSupport", "FontDatabaseSupport"]) + elif self.settings.os == "Emscripten": + _create_plugin("QWasmIntegrationPlugin", "qwasm", "platforms", ["Core", "Gui", "EventDispatcherSupport", "FontDatabaseSupport", "EglSupport"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + service_support_reqs = ["Core", "Gui"] + if self.options.with_dbus: + service_support_reqs.append("DBus") + _create_module("ServiceSupport", service_support_reqs) + _create_module("EdidSupport") + if self.options.get_safe("with_x11", False): + _create_module("XkbCommonSupport", ["Core", "Gui", "xkbcommon::libxkbcommon-x11"]) + xcb_qpa_reqs = ["Core", "Gui", "ServiceSupport", "ThemeSupport", "FontDatabaseSupport", "EdidSupport", "XkbCommonSupport", "xorg::xorg"] + elif self.options.qtwayland: + _create_module("XkbCommonSupport", ["Core", "Gui", "xkbcommon::libxkbcommon"]) + if self.options.with_dbus and self.options.with_atspi: + _create_module("LinuxAccessibilitySupport", ["Core", "DBus", "Gui", "AccessibilitySupport", "at-spi2-core::at-spi2-core"]) + xcb_qpa_reqs.append("LinuxAccessibilitySupport") + if self.options.get_safe("with_vulkan"): + xcb_qpa_reqs.append("VulkanSupport") + if self.options.get_safe("with_x11", False): + _create_module("XcbQpa", xcb_qpa_reqs, has_include_dir=False) + _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpa"]) + + if self.options.with_sqlite3: + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) + if self.options.with_pq: + _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) + if self.options.get_safe("with_mysql", False): + _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["libmysqlclient::libmysqlclient"]) + if self.options.with_odbc: + if self.settings.os != "Windows": + _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) + networkReqs = [] + if self.options.openssl: + networkReqs.append("openssl::openssl") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + networkReqs.append("krb5::krb5-gssapi") + _create_module("Network", networkReqs) + _create_module("Sql") + _create_module("Test") + if self.options.get_safe("opengl", "no") != "no" and self.options.gui: + _create_module("OpenGL", ["Gui"]) + if self.options.widgets and self.options.get_safe("opengl", "no") != "no": + _create_module("OpenGLExtensions", ["Gui"]) + _create_module("Concurrent") + _create_module("Xml") + + if self.options.qtdeclarative: + _create_module("Qml", ["Network"]) + _add_build_module("qtQml", self._cmake_qt5_private_file("Qml")) + _create_module("QmlModels", ["Qml"]) + self.cpp_info.components["qtQmlImportScanner"].set_property("cmake_target_name", "Qt5::QmlImportScanner") + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" + self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) + if self.options.gui: + _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + if self.options.widgets: + _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) + _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) + _create_module("QmlWorkerScript", ["Qml"]) + _create_module("QuickTest", ["Test"]) + + if self.options.qttools and self.options.gui and self.options.widgets: + self.cpp_info.components["qtLinguistTools"].set_property("cmake_target_name", "Qt5::LinguistTools") + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package"] = "LinguistTools" + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package_multi"] = "LinguistTools" + _create_module("UiPlugin", ["Gui", "Widgets"]) + self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only + self.cpp_info.components["qtUiPlugin"].libdirs = [] + _create_module("UiTools", ["UiPlugin", "Gui", "Widgets"]) + if not cross_building(self): + _create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) + _create_module("Help", ["Gui", "Sql", "Widgets"]) + + if self.options.qtquick3d and self.options.gui: + _create_module("Quick3DUtils", ["Gui"]) + _create_module("Quick3DRender", ["Quick3DUtils", "Quick"]) + _create_module("Quick3DAssetImport", ["Gui", "Qml", "Quick3DRender", "Quick3DUtils"]) + _create_module("Quick3DRuntimeRender", ["Quick3DRender", "Quick3DAssetImport", "Quick3DUtils"]) + _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"]) + + if self.options.qtquickcontrols2 and self.options.gui: + _create_module("QuickControls2", ["Gui", "Quick"]) + _create_module("QuickTemplates2", ["Gui", "Quick"]) + + if self.options.qtsvg and self.options.gui: + _create_module("Svg", ["Gui"]) + + if self.options.qtwayland and self.options.gui: + _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) + _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) + + if self.options.qtlocation: + _create_module("Positioning") + _create_module("Location", ["Gui", "Quick"]) + _create_plugin("QGeoServiceProviderFactoryMapbox", "qtgeoservices_mapbox", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryMapboxGL", "qtgeoservices_mapboxgl", "geoservices", []) + _create_plugin("GeoServiceProviderFactoryEsri", "qtgeoservices_esri", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryItemsOverlay", "qtgeoservices_itemsoverlay", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryNokia", "qtgeoservices_nokia", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryOsm", "qtgeoservices_osm", "geoservices", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue", "qtposition_geoclue", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue2", "qtposition_geoclue2", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryPoll", "qtposition_positionpoll", "position", []) + _create_plugin("QGeoPositionInfoSourceFactorySerialNmea", "qtposition_serialnmea", "position", []) + + if self.options.qtwebchannel: + _create_module("WebChannel", ["Qml"]) + + if self.options.qtwebengine: + webenginereqs = ["Gui", "Quick", "WebChannel", "Positioning"] + if self.settings.os in ["Linux", "FreeBSD"]: + webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \ + "nss::nss", "libdrm::libdrm", "egl::egl"]) + _create_module("WebEngineCore", webenginereqs) + if self.settings.os != "Windows": + self.cpp_info.components["WebEngineCore"].system_libs.append("resolv") + _create_module("WebEngine", ["WebEngineCore"]) + _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) + + if self.options.qtserialport: + _create_module("SerialPort") + + if self.options.qtserialbus: + _create_module("SerialBus", ["SerialPort"] if self.options.get_safe("qtserialport") else []) + _create_plugin("PassThruCanBusPlugin", "qtpassthrucanbus", "canbus", []) + _create_plugin("PeakCanBusPlugin", "qtpeakcanbus", "canbus", []) + _create_plugin("SocketCanBusPlugin", "qtsocketcanbus", "canbus", []) + _create_plugin("TinyCanBusPlugin", "qttinycanbus", "canbus", []) + _create_plugin("VirtualCanBusPlugin", "qtvirtualcanbus", "canbus", []) + + if self.options.qtsensors: + _create_module("Sensors") + _create_plugin("genericSensorPlugin", "qtsensors_generic", "sensors", []) + _create_plugin("IIOSensorProxySensorPlugin", "qtsensors_iio-sensor-proxy", "sensors", []) + if self.settings.os == "Linux": + _create_plugin("LinuxSensorPlugin", "qtsensors_linuxsys", "sensors", []) + _create_plugin("QtSensorGesturePlugin", "qtsensorgestures_plugin", "sensorgestures", []) + _create_plugin("QShakeSensorGesturePlugin", "qtsensorgestures_shakeplugin", "sensorgestures", []) + + if self.options.qtscxml: + _create_module("Scxml", ["Qml"]) + + if self.options.qtpurchasing: + _create_module("Purchasing") + + if self.options.qtcharts: + _create_module("Charts", ["Gui", "Widgets"]) + + if self.options.qtgamepad: + _create_module("Gamepad", ["Gui"]) + if self.settings.os == "Linux": + _create_plugin("QEvdevGamepadBackendPlugin", "evdevgamepad", "gamepads", []) + if self.settings.os == "Macos": + _create_plugin("QDarwinGamepadBackendPlugin", "darwingamepad", "gamepads", []) + if self.settings.os =="Windows": + _create_plugin("QXInputGamepadBackendPlugin", "xinputgamepad", "gamepads", []) + + if self.options.qt3d: + _create_module("3DCore", ["Gui", "Network"]) + + _create_module("3DRender", ["3DCore"]) + _create_plugin("DefaultGeometryLoaderPlugin", "defaultgeometryloader", "geometryloaders", []) + _create_plugin("GLTFGeometryLoaderPlugin", "gltfgeometryloader", "geometryloaders", []) + _create_plugin("GLTFSceneExportPlugin", "gltfsceneexport", "sceneparsers", []) + _create_plugin("GLTFSceneImportPlugin", "gltfsceneimport", "sceneparsers", []) + _create_plugin("OpenGLRendererPlugin", "openglrenderer", "renderers", []) + _create_plugin("Scene2DPlugin", "scene2d", "renderplugins", []) + + _create_module("3DAnimation", ["3DRender", "3DCore", "Gui"]) + _create_module("3DInput", ["3DCore", "Gamepad", "Gui"]) + _create_module("3DLogic", ["3DCore", "Gui"]) + _create_module("3DExtras", ["3DRender", "3DInput", "3DLogic", "3DCore", "Gui"]) + _create_module("3DQuick", ["3DCore", "Quick", "Gui", "Qml"]) + _create_module("3DQuickAnimation", ["3DAnimation", "3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickExtras", ["3DExtras", "3DInput", "3DQuick", "3DRender", "3DLogic", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickInput", ["3DInput", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickRender", ["3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickScene2D", ["3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + + if self.options.qtmultimedia: + multimedia_reqs = ["Network", "Gui"] + if self.options.get_safe("with_libalsa", False): + multimedia_reqs.append("libalsa::libalsa") + if self.options.with_openal: + multimedia_reqs.append("openal-soft::openal-soft") + if self.options.get_safe("with_pulseaudio", False): + multimedia_reqs.append("pulseaudio::pulse") + _create_module("Multimedia", multimedia_reqs) + _create_module("MultimediaWidgets", ["Multimedia", "Widgets", "Gui"]) + if self.options.qtdeclarative and self.options.gui: + _create_module("MultimediaQuick", ["Multimedia", "Quick"]) + _create_plugin("QM3uPlaylistPlugin", "qtmultimedia_m3u", "playlistformats", []) + if self.options.with_gstreamer: + _create_module("MultimediaGstTools", ["Multimedia", "MultimediaWidgets", "Gui", "gst-plugins-base::gst-plugins-base"]) + _create_plugin("QGstreamerAudioDecoderServicePlugin", "gstaudiodecoder", "mediaservice", []) + _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.settings.os == "Windows": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) + _create_plugin("QWindowsAudioPlugin", "qtaudio_windows", "audio", []) + if self.settings.os == "Macos": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("AVFMediaPlayerServicePlugin", "qavfmediaplayer", "mediaservice", []) + _create_plugin("AVFServicePlugin", "qavfcamera", "mediaservice", []) + _create_plugin("CoreAudioPlugin", "qtaudio_coreaudio", "audio", []) + + if self.options.qtwebsockets: + _create_module("WebSockets", ["Network"]) + + if self.options.qtconnectivity: + _create_module("Bluetooth", ["Network"]) + _create_module("Nfc", []) + + if self.options.qtdatavis3d: + _create_module("DataVisualization", ["Gui"]) + + if self.options.qtnetworkauth: + _create_module("NetworkAuth", ["Network"]) + + if self.settings.os != "Windows": + self.cpp_info.components["qtCore"].cxxflags.append("-fPIC") + + if self.options.get_safe("qtx11extras"): + _create_module("X11Extras") + + if self.options.qtremoteobjects: + _create_module("RemoteObjects") + + if self.options.get_safe("qtwinextras"): + _create_module("WinExtras") + + if self.options.get_safe("qtmacextras"): + _create_module("MacExtras") + + if self.options.qtxmlpatterns: + _create_module("XmlPatterns", ["Network"]) + + if self.options.get_safe("qtactiveqt"): + _create_module("AxBase", ["Gui", "Widgets"]) + self.cpp_info.components["qtAxBase"].includedirs = ["include", os.path.join("include", "ActiveQt")] + self.cpp_info.components["qtAxBase"].system_libs.extend(["ole32", "oleaut32", "user32", "gdi32", "advapi32"]) + if self.settings.compiler == "gcc": + self.cpp_info.components["qtAxBase"].system_libs.append("uuid") + _create_module("AxContainer", ["Core", "Gui", "Widgets", "AxBase"]) + self.cpp_info.components["qtAxContainer"].includedirs = [os.path.join("include", "ActiveQt")] + _create_module("AxServer", ["Core", "Gui", "Widgets", "AxBase"]) + self.cpp_info.components["qtAxServer"].includedirs = [os.path.join("include", "ActiveQt")] + self.cpp_info.components["qtAxServer"].system_libs.append("shell32") + + if self.options.qtscript: + _create_module("Script") + if self.options.widgets: + _create_module("ScriptTools", ["Gui", "Widgets", "Script"]) + + if self.options.qtandroidextras: + _create_module("AndroidExtras") + + if self.options.qtwebview: + _create_module("WebView", ["Gui", "Quick"]) + + if self.options.qtvirtualkeyboard: + _create_module("VirtualKeyboard", ["Qml", "Quick", "Gui"]) + + if self.options.qtspeech: + _create_module("TextToSpeech") + + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.components["qtCore"].system_libs.append("version") # qtcore requires "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library + self.cpp_info.components["qtCore"].system_libs.append("winmm") # qtcore requires "__imp_timeSetEvent" which is in "Winmm.lib" library + self.cpp_info.components["qtCore"].system_libs.append("netapi32") # qtcore requires "NetApiBufferFree" which is in "Netapi32.lib" library + self.cpp_info.components["qtCore"].system_libs.append("userenv") # qtcore requires "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library + self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("iphlpapi") + if self.options.widgets: + self.cpp_info.components["qtWidgets"].system_libs.append("uxtheme") + self.cpp_info.components["qtWidgets"].system_libs.append("dwmapi") + if self.options.get_safe("qtwinextras"): + self.cpp_info.components["qtWinExtras"].system_libs.append("dwmapi") # qtwinextras requires "DwmGetColorizationColor" which is in "dwmapi.lib" library + + if is_apple_os(self): + self.cpp_info.components["qtCore"].frameworks.append("CoreServices" if self.settings.os == "Macos" else "MobileCoreServices") + self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") + if self.options.with_gssapi: + self.cpp_info.components["qtNetwork"].frameworks.append("GSS") + if not self.options.openssl: # with SecureTransport + self.cpp_info.components["qtNetwork"].frameworks.append("Security") + if self.settings.os == "Macos" or (self.settings.os == "iOS" and Version(self.settings.compiler.version) >= "14.0"): + self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework + if self.settings.os == "Macos": + 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")) + _add_build_module("qtCore", self._cmake_core_extras_file) + _add_build_module("qtCore", self._cmake_qt5_private_file("Core")) + + for m in os.listdir(os.path.join("lib", "cmake")): + module = os.path.join("lib", "cmake", m, f"{m}Macros.cmake") + component_name = m.replace("Qt5", "qt") + if os.path.isfile(module): + _add_build_module(component_name, module) + self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) + + qt5core_config_extras_mkspec_dir_cmake = load(self, + 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) + assert os.path.exists(mkspecs_path) + self.cpp_info.components["qtCore"].includedirs.append(mkspecs_path) + + objects_dirs = glob.glob(os.path.join(self.package_folder, "lib", "objects-*/")) + for object_dir in objects_dirs: + for m in os.listdir(object_dir): + 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)] + self.cpp_info.components[component].exelinkflags.extend(obj_files) + self.cpp_info.components[component].sharedlinkflags.extend(obj_files) + + build_modules_list = [] + + def _add_build_modules_for_component(component): + for req in self.cpp_info.components[component].requires: + if "::" in req: # not a qt component + continue + _add_build_modules_for_component(req) + build_modules_list.extend(build_modules.pop(component, [])) + + for c in self.cpp_info.components: + _add_build_modules_for_component(c) + + self.cpp_info.set_property("cmake_build_modules", build_modules_list) + + @staticmethod + def _remove_duplicate(l): + seen = set() + seen_add = seen.add + for element in itertools.filterfalse(seen.__contains__, l): + seen_add(element) + yield element + + def _gather_libs(self, p): + libs = ["-l" + i for i in p.cpp_info.aggregated_components().libs + p.cpp_info.aggregated_components().system_libs] + if is_apple_os(self): + libs += ["-framework " + i for i in p.cpp_info.aggregated_components().frameworks] + libs += p.cpp_info.aggregated_components().sharedlinkflags + for dep in p.dependencies.direct_host.values(): + libs += self._gather_libs(dep) + return self._remove_duplicate(libs) diff --git a/recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch b/recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch new file mode 100644 index 0000000000000..816922033dc93 --- /dev/null +++ b/recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch @@ -0,0 +1,56 @@ +From fb103459151fcf02706dd5abda95c716a934d610 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen +Date: Mon, 9 May 2022 10:32:24 +0200 +Subject: [PATCH] Find fontconfig using pkg-config + +We already verify that it can be found like that during configure + +Task-number: QTBUG-61158 +Change-Id: I569590e96a490c4ed6e6dc560fbd110d86d77956 +Reviewed-by: Michal Klocek +(cherry picked from commit 357dcbf7d9510b5282a18e8211e2494f353b4e5e) +Reviewed-by: Qt Cherry-pick Bot +(cherry picked from commit 43329f9d7f38a5092a9c054c5d450072b236c6f8) +--- + chromium/components/services/font/BUILD.gn | 1 + + chromium/third_party/fontconfig/BUILD.gn | 5 +++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git chromium/components/services/font/BUILD.gn chromium/components/services/font/BUILD.gn +index b065131e035..f3e544ed29f 100644 +--- chromium/components/services/font/BUILD.gn ++++ chromium/components/services/font/BUILD.gn +@@ -42,6 +42,7 @@ if ((is_linux || is_chromeos) && enable_plugins) { + "//base:base", + "//ppapi/buildflags:buildflags", + "//ppapi/c", ++ "//third_party/fontconfig", + ] + } + } +diff --git chromium/third_party/fontconfig/BUILD.gn chromium/third_party/fontconfig/BUILD.gn +index 1bee7acb6b9..4cc32d62774 100644 +--- chromium/third_party/fontconfig/BUILD.gn ++++ chromium/third_party/fontconfig/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/sanitizers/sanitizers.gni") ++import("//build/config/linux/pkg_config.gni") + import("//third_party/fontconfig/fontconfig.gni") + + assert(is_linux || is_chromeos) +@@ -110,8 +111,8 @@ if (use_bundled_fontconfig) { + } + } + } else { +- config("fontconfig_config") { +- libs = [ "fontconfig" ] ++ pkg_config("fontconfig_config") { ++ packages = [ "fontconfig" ] + } + + group("fontconfig") { +-- +2.36.1 + diff --git a/recipes/qt/5.x.x/patches/107ed30ec5.patch b/recipes/qt/5.x.x/patches/107ed30ec5.patch new file mode 100644 index 0000000000000..3dd48a20a04ce --- /dev/null +++ b/recipes/qt/5.x.x/patches/107ed30ec5.patch @@ -0,0 +1,35 @@ +From 107ed30ec505f20f166cf7df3b99c5c73a680796 Mon Sep 17 00:00:00 2001 +From: Peter Varga +Date: Fri, 4 Mar 2022 10:42:25 +0100 +Subject: [PATCH] [Backport] Fix for non-constant SIGSTKSZ + +On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case +it expands to a call to `sysconf` which returns a `long int`); see +https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html + +Pass unsigned explicitly to std::max, to avoid relying on template +argument deduction. This works both with the old-style constant +`SIGSTKSZ` and the new configurable one. + +Initially based on https://chromium-review.googlesource.com/c/2776379 + +Change-Id: I2279e8423aa70987ce4537674c7291216d23062f +Review-URL: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721 +Reviewed-by: Allan Sandfeld Jensen +--- + .../breakpad/src/client/linux/handler/exception_handler.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +index ca353c40997..4c73053c513 100644 +--- a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() { + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); ++ static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. diff --git a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch new file mode 100644 index 0000000000000..a2ea249c1db5f --- /dev/null +++ b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch @@ -0,0 +1,40 @@ +From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= +Date: Tue, 5 Jul 2022 15:38:33 +0200 +Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with + equivalent + +We can't use the replacement kIOMainPortDefault yet, as it's not +available in operating system versions we still support, but the +kIOMasterPortDefault documentation explicitly says that passing +NULL as a port argument indicates "use the default". + +As the underlying type of a mach_port_t is potentially either +a pointer or an unsigned int, we initialize the default to 0. + +Pick-to: 6.2 6.3 6.4 5.15 +Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 +Reviewed-by: Alexandru Croitor +--- + src/corelib/global/qglobal.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'src/corelib/global/qglobal.cpp') + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index 738e39658f..c894471ad6 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3059,7 +3059,8 @@ QByteArray QSysInfo::machineUniqueId() + { + #if defined(Q_OS_DARWIN) && __has_include() + char uuid[UuidStringLen + 1]; +- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); ++ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault ++ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +-- +cgit v1.2.1 + diff --git a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch new file mode 100644 index 0000000000000..053e6afa62e83 --- /dev/null +++ b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch @@ -0,0 +1,39 @@ +From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= +Date: Tue, 5 Jul 2022 15:38:33 +0200 +Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with + equivalent + +We can't use the replacement kIOMainPortDefault yet, as it's not +available in operating system versions we still support, but the +kIOMasterPortDefault documentation explicitly says that passing +NULL as a port argument indicates "use the default". + +As the underlying type of a mach_port_t is potentially either +a pointer or an unsigned int, we initialize the default to 0. + +Pick-to: 6.2 6.3 6.4 5.15 +Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 +Reviewed-by: Alexandru Croitor +--- + src/corelib/global/qglobal.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'src/corelib/global/qglobal.cpp') + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index 738e39658f..c894471ad6 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3077,7 +3077,8 @@ QByteArray QSysInfo::machineUniqueId() + { + #if defined(Q_OS_DARWIN) && __has_include() + char uuid[UuidStringLen + 1]; +- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); ++ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault ++ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +-- +cgit v1.2.1 diff --git a/recipes/qt/5.x.x/patches/337f28c9ab.patch b/recipes/qt/5.x.x/patches/337f28c9ab.patch new file mode 100644 index 0000000000000..6784be15b8cfe --- /dev/null +++ b/recipes/qt/5.x.x/patches/337f28c9ab.patch @@ -0,0 +1,40 @@ +From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= +Date: Tue, 5 Jul 2022 15:38:33 +0200 +Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with + equivalent + +We can't use the replacement kIOMainPortDefault yet, as it's not +available in operating system versions we still support, but the +kIOMasterPortDefault documentation explicitly says that passing +NULL as a port argument indicates "use the default". + +As the underlying type of a mach_port_t is potentially either +a pointer or an unsigned int, we initialize the default to 0. + +Pick-to: 6.2 6.3 6.4 5.15 +Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 +Reviewed-by: Alexandru Croitor +--- + src/corelib/global/qglobal.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'src/corelib/global/qglobal.cpp') + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index 738e39658f..c894471ad6 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3067,7 +3067,8 @@ QByteArray QSysInfo::machineUniqueId() + { + #if defined(Q_OS_DARWIN) && __has_include() + char uuid[UuidStringLen + 1]; +- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); ++ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault ++ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +-- +cgit v1.2.1 + diff --git a/recipes/qt/5.x.x/patches/QTBUG-98813.patch b/recipes/qt/5.x.x/patches/QTBUG-98813.patch new file mode 100644 index 0000000000000..c7d6fe522ebcf --- /dev/null +++ b/recipes/qt/5.x.x/patches/QTBUG-98813.patch @@ -0,0 +1,38 @@ +From 7ff159da128c4f249b468f3ff972f864d243c742 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen +Date: Tue, 7 Dec 2021 10:44:51 +0100 +Subject: [PATCH] Try to fix build on Apple Monterey +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +std::basic_string::shrink_to_fit appears to not be inline + +Change-Id: I5bca251bdde433e917879947f97659973c430f54 +Fixes: QTBUG-98813 +Reviewed-by: Peter Varga +Reviewed-by: Allan Sandfeld Jensen +Reviewed-by: Michael Brüning +--- + chromium/base/strings/utf_string_conversions.cc | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/chromium/base/strings/utf_string_conversions.cc b/chromium/base/strings/utf_string_conversions.cc +index 0b55cd9e59d..12ed1f3e010 100644 +--- a/chromium/base/strings/utf_string_conversions.cc ++++ b/chromium/base/strings/utf_string_conversions.cc +@@ -15,6 +15,14 @@ + #include "base/third_party/icu/icu_utf.h" + #include "build/build_config.h" + ++#if defined(OS_MAC) ++namespace std { ++inline namespace __1 { ++template class basic_string; ++} // namespace __1 ++} // namespace std ++#endif // defined(OS_MAC) ++ + namespace base { + + namespace { diff --git a/recipes/qt/5.x.x/patches/aa2a39dea5.diff b/recipes/qt/5.x.x/patches/aa2a39dea5.diff new file mode 100644 index 0000000000000..3fe3827463641 --- /dev/null +++ b/recipes/qt/5.x.x/patches/aa2a39dea5.diff @@ -0,0 +1,29 @@ +From aa2a39dea5918c63045310b0d2a7e34ce9934e0c Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 26 Nov 2019 12:47:47 +0100 +Subject: [PATCH] add inline source detection to glib + +this allows to use static version of glib (pkg-config only works with shared libraries) + +Change-Id: If9b0054985b87b8da43269425b32c2e4ffb65f5a +--- + src/corelib/configure.json | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/corelib/configure.json b/src/corelib/configure.json +index ae360239c6..998687dc4e 100644 +--- a/src/corelib/configure.json ++++ b/src/corelib/configure.json +@@ -45,7 +45,8 @@ + }, + "headers": "glib.h", + "sources": [ +- { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ++ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }, ++ "-lgthread-2.0 -lglib-2.0" + ] + }, + "posix_iconv": { +-- +2.23.0.windows.1 + diff --git a/recipes/qt/5.x.x/patches/android-backtrace.diff b/recipes/qt/5.x.x/patches/android-backtrace.diff new file mode 100644 index 0000000000000..0fba728e174c6 --- /dev/null +++ b/recipes/qt/5.x.x/patches/android-backtrace.diff @@ -0,0 +1,19 @@ +diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp +index 89f49324c..dedf78fe5 100644 +--- a/src/corelib/global/qlogging.cpp ++++ b/src/corelib/global/qlogging.cpp +@@ -107,7 +107,13 @@ + # define QLOGGING_HAVE_BACKTRACE + # endif + # elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include() && __has_include()) +-# define QLOGGING_HAVE_BACKTRACE ++# ifdef __ANDROID_API__ ++# if __ANDROID_API__ >= 33 ++# define QLOGGING_HAVE_BACKTRACE ++# endif ++# else ++# define QLOGGING_HAVE_BACKTRACE ++# endif + # endif + #endif + diff --git a/recipes/qt/5.x.x/patches/android-new-ndk.diff b/recipes/qt/5.x.x/patches/android-new-ndk.diff new file mode 100644 index 0000000000000..44b38b694fe19 --- /dev/null +++ b/recipes/qt/5.x.x/patches/android-new-ndk.diff @@ -0,0 +1,27 @@ +From 49f62e8c5a8aef4c0b7fd6867a30e653d2f5dd98 Mon Sep 17 00:00:00 2001 +From: Alexey Edelev +Date: Mon, 21 Nov 2022 15:03:17 +0100 +Subject: [PATCH] Remove QMAKE_RANLIB and QMAKE_LINK_SHLIB from android/default_pre.prf + +The values should come from android-clang mkspecs. The hardcoded +values don't work correctly with recent Android NDKs. + +Pick-to: 6.4 6.2 5.15 +Fixes: QTBUG-108662 +Change-Id: Ie153a50ee0c49bd4f0704b588a4e2c87a05c1063 +Reviewed-by: Assam Boudjelthia +--- + +diff --git a/mkspecs/features/android/default_pre.prf b/mkspecs/features/android/default_pre.prf +index 9f90dcb..2328b72 100644 +--- a/mkspecs/features/android/default_pre.prf ++++ b/mkspecs/features/android/default_pre.prf +@@ -76,8 +76,6 @@ + else: equals(QT_ARCH, arm64-v8a): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/aarch64-linux-android- + else: CROSS_COMPILE = $$NDK_LLVM_PATH/bin/arm-linux-androideabi- + +-QMAKE_RANLIB = $${CROSS_COMPILE}ranlib +-QMAKE_LINK_SHLIB = $$QMAKE_LINK + QMAKE_LFLAGS = + + QMAKE_LIBS_PRIVATE = -llog -lz -lm -ldl -lc diff --git a/recipes/qt/5.x.x/patches/android-openssl.diff b/recipes/qt/5.x.x/patches/android-openssl.diff new file mode 100644 index 0000000000000..6091b9f19c46b --- /dev/null +++ b/recipes/qt/5.x.x/patches/android-openssl.diff @@ -0,0 +1,13 @@ +diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri +index 230c45c26..d7527949e 100644 +--- a/src/network/ssl/ssl.pri ++++ b/src/network/ssl/ssl.pri +@@ -117,7 +117,7 @@ qtConfig(ssl) { + + qtConfig(openssl-linked): { + android { +- build_pass|single_android_abi: LIBS_PRIVATE += -lssl_$${QT_ARCH} -lcrypto_$${QT_ARCH} ++ build_pass|single_android_abi: LIBS_PRIVATE += -lssl -lcrypto + } else: QMAKE_USE_FOR_PRIVATE += openssl + } else: \ + QMAKE_USE_FOR_PRIVATE += openssl/nolink diff --git a/recipes/qt/5.x.x/patches/c72097e.diff b/recipes/qt/5.x.x/patches/c72097e.diff new file mode 100644 index 0000000000000..56b2679d626fb --- /dev/null +++ b/recipes/qt/5.x.x/patches/c72097e.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +@@ -119,9 +119,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch b/recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch new file mode 100644 index 0000000000000..053880472184d --- /dev/null +++ b/recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch @@ -0,0 +1,10 @@ +diff --git a/chromium/third_party/skia/src/utils/SkParseColor.cpp b/chromium/third_party/skia/src/utils/SkParseColor.cpp +index 7260365b2c6..96f46dd67f9 100644 +--- a/chromium/third_party/skia/src/utils/SkParseColor.cpp ++++ b/chromium/third_party/skia/src/utils/SkParseColor.cpp +@@ -9,3 +0,5 @@ + #include "include/utils/SkParse.h" + ++#include // std::lower_bound ++ + static constexpr const char* gColorNames[] = { diff --git a/recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch b/recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch new file mode 100644 index 0000000000000..c373947e23f3f --- /dev/null +++ b/recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch @@ -0,0 +1,46 @@ +From a5cea1bfc38ceafc74f4baddd6ab94ea13757ef8 Mon Sep 17 00:00:00 2001 +From: Lei Zhang +Date: Fri, 21 May 2021 10:55:53 -0700 +Subject: [PATCH] Mark Node::opcode() and Operator::opcode() as constexpr. + +Without the explicit constexpr keyword, Clang seems to be able to treat +these methods as constexpr, whereas MSVC will not. + +Bug: v8:11760 +Change-Id: I9f6492f38fb50dcaf7a4f09da0bd79c0da6a50eb +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2912916 +Reviewed-by: Clemens Backes +Reviewed-by: Maya Lekova +Commit-Queue: Lei Zhang +Cr-Commit-Position: refs/heads/master@{#74791} +--- + src/compiler/node.h | 2 +- + src/compiler/operator.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/compiler/node.h b/src/compiler/node.h +index 37b45c403f1..57d49fe1ac0 100644 +--- a/src/compiler/node.h ++++ b/src/compiler/node.h +@@ -50,7 +50,7 @@ class V8_EXPORT_PRIVATE Node final { + + const Operator* op() const { return op_; } + +- IrOpcode::Value opcode() const { ++ constexpr IrOpcode::Value opcode() const { + DCHECK_GE(IrOpcode::kLast, op_->opcode()); + return static_cast(op_->opcode()); + } +diff --git a/src/compiler/operator.h b/src/compiler/operator.h +index 4206e753f1e..f641394eb1f 100644 +--- a/src/compiler/operator.h ++++ b/src/compiler/operator.h +@@ -69,7 +69,7 @@ class V8_EXPORT_PRIVATE Operator : public NON_EXPORTED_BASE(ZoneObject) { + // A small integer unique to all instances of a particular kind of operator, + // useful for quick matching for specific kinds of operators. For fast access + // the opcode is stored directly in the operator object. +- Opcode opcode() const { return opcode_; } ++ constexpr Opcode opcode() const { return opcode_; } + + // Returns a constant string representing the mnemonic of the operator, + // without the static parameters. Useful for debugging. diff --git a/recipes/qt/5.x.x/patches/d3396fb6fc.patch b/recipes/qt/5.x.x/patches/d3396fb6fc.patch new file mode 100644 index 0000000000000..5f832ae4c3873 --- /dev/null +++ b/recipes/qt/5.x.x/patches/d3396fb6fc.patch @@ -0,0 +1,30 @@ +From d3396fb6fcf9e1846de3091ada99284e10e9ee54 Mon Sep 17 00:00:00 2001 +From: Peter Varga +Date: Fri, 10 Dec 2021 14:40:20 +0100 +Subject: [PATCH] [Backport] abseil-cpp: Fixes build with latest glibc + +Fixes https://github.com/abseil/abseil-cpp/issues/952 + +This fix is extracted from: +https://github.com/abseil/abseil-cpp/commit/a9831f1cbf93fb18dd951453635f488037454ce9 + +Change-Id: I337c8c900ef569853046bb9adc3807a3ed12b13b +Reviewed-by: Allan Sandfeld Jensen +--- + .../abseil-cpp/absl/debugging/failure_signal_handler.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc b/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc +index 5d13bdbbbd1..2ed137b58f1 100644 +--- a/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc ++++ b/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc +@@ -135,7 +135,8 @@ static bool SetupAlternateStackOnce() { + #else + const size_t page_mask = sysconf(_SC_PAGESIZE) - 1; + #endif +- size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask; ++ size_t stack_size = ++ (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask; + #if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \ + defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER) + // Account for sanitizer instrumentation requiring additional stack space. diff --git a/recipes/qt/5.x.x/patches/dece6f5.diff b/recipes/qt/5.x.x/patches/dece6f5.diff new file mode 100644 index 0000000000000..cd70c3d8f67ab --- /dev/null +++ b/recipes/qt/5.x.x/patches/dece6f5.diff @@ -0,0 +1,14 @@ +diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h +index e070ba977d..35a62f59e3 100644 +--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h ++++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h +@@ -43,6 +43,9 @@ + #include + #include + ++ ++#include ++ + QT_BEGIN_NAMESPACE + + class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer diff --git a/recipes/qt/5.x.x/patches/fix-macdeployqt.diff b/recipes/qt/5.x.x/patches/fix-macdeployqt.diff new file mode 100644 index 0000000000000..a6e5f960578ba --- /dev/null +++ b/recipes/qt/5.x.x/patches/fix-macdeployqt.diff @@ -0,0 +1,66 @@ +From 03abcbabbd4caa11048d19d95b23f165cd7a5361 Mon Sep 17 00:00:00 2001 +From: Seth Parker +Date: Wed, 31 Mar 2021 15:34:10 -0400 +Subject: [PATCH] macdeployqt: Fix plugin resolution bugs for non-standard + installs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Uses QLibraryInfo to resolve plugins at installed locations. + +[ChangeLog][macOS][macdeployqt] Uses QLibraryInfo to resolve plugins at install locations. + +Fixes: QTBUG-91644 +Change-Id: Ie309061024abd7a58ea62d707716342c99897c26 +Reviewed-by: Morten Johan Sørvig +--- + src/macdeployqt/macdeployqt/main.cpp | 30 ++++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 6 deletions(-) + +diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp +index 8914e835b..628a71378 100644 +--- a/src/macdeployqt/macdeployqt/main.cpp ++++ b/src/macdeployqt/macdeployqt/main.cpp +@@ -27,6 +27,7 @@ + ****************************************************************************/ + #include + #include ++#include + + #include "../shared/shared.h" + +@@ -236,10 +237,28 @@ int main(int argc, char **argv) + } + +- if (plugins && !deploymentInfo.qtPath.isEmpty()) { +- deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins"; +- LogNormal(); +- deployPlugins(appBundlePath, deploymentInfo, useDebugLibs); +- createQtConf(appBundlePath); ++ // Handle plugins ++ if (plugins) { ++ // Set the plugins search directory ++ deploymentInfo.pluginPath = QLibraryInfo::location(QLibraryInfo::PluginsPath); ++ ++ // Sanity checks ++ if (deploymentInfo.pluginPath.isEmpty()) { ++ LogError() << "Missing Qt plugins path\n"; ++ return 1; ++ } ++ ++ if (!QDir(deploymentInfo.pluginPath).exists()) { ++ LogError() << "Plugins path does not exist" << deploymentInfo.pluginPath << "\n"; ++ return 1; ++ } ++ ++ // Deploy plugins ++ Q_ASSERT(!deploymentInfo.pluginPath.isEmpty()); ++ if (!deploymentInfo.pluginPath.isEmpty()) { ++ LogNormal(); ++ deployPlugins(appBundlePath, deploymentInfo, useDebugLibs); ++ createQtConf(appBundlePath); ++ } + } + + if (runStripEnabled) diff --git a/recipes/qt/5.x.x/patches/skia-cd397f3.diff b/recipes/qt/5.x.x/patches/skia-cd397f3.diff new file mode 100644 index 0000000000000..ae4ccdd0b3582 --- /dev/null +++ b/recipes/qt/5.x.x/patches/skia-cd397f3.diff @@ -0,0 +1,25 @@ +From cd397f3c4738beb61cfd1c611544d096a6f4fa36 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 26 Apr 2022 11:44:31 -0500 +Subject: [PATCH] Add missing include for std::begin and std::end in SkParseColor.cpp + +Change-Id: I51f6766271cfcc2dff7fc30e3f7439c4580cbb6a +Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533981 +Reviewed-by: Brian Salomon +Commit-Queue: Brian Salomon +--- + + # Trusted service accounts. + Recipe roller SA +diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp +index 3164650..0dc3497 100644 +--- a/src/utils/SkParseColor.cpp ++++ b/src/utils/SkParseColor.cpp +@@ -9,6 +9,7 @@ + #include "include/utils/SkParse.h" + + #include // std::lower_bound ++#include + + static constexpr const char* gColorNames[] = { + "aliceblue", diff --git a/recipes/qt/5.x.x/qtmodules5.15.5.conf b/recipes/qt/5.x.x/qtmodules5.15.5.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.5.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/qtmodules5.15.6.conf b/recipes/qt/5.x.x/qtmodules5.15.6.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.6.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/qtmodules5.15.7.conf b/recipes/qt/5.x.x/qtmodules5.15.7.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.7.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/qtmodules5.15.8.conf b/recipes/qt/5.x.x/qtmodules5.15.8.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.8.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/qtmodules5.15.9.conf b/recipes/qt/5.x.x/qtmodules5.15.9.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.9.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/CMakeLists.txt b/recipes/qt/5.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d11db68fc293 --- /dev/null +++ b/recipes/qt/5.x.x/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Qt5 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 Qt5::Core Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTORCC ON) diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..5a7b088d4aa41 --- /dev/null +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -0,0 +1,58 @@ +import os +import textwrap + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, save + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + 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): + qt_install_prefix = self.dependencies["qt"].package_folder.replace("\\", "/") + 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) + + VirtualRunEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + copy(self, "qt.conf", src=self.generators_folder, dst=os.path.join(self.cpp.build.bindirs[0])) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qt/5.x.x/test_package/example.qrc b/recipes/qt/5.x.x/test_package/example.qrc new file mode 100644 index 0000000000000..7060adfb034fe --- /dev/null +++ b/recipes/qt/5.x.x/test_package/example.qrc @@ -0,0 +1,5 @@ + + + resource.txt + + diff --git a/recipes/qt/5.x.x/test_package/greeter.h b/recipes/qt/5.x.x/test_package/greeter.h new file mode 100644 index 0000000000000..85052e081d4fb --- /dev/null +++ b/recipes/qt/5.x.x/test_package/greeter.h @@ -0,0 +1,26 @@ +#include +#include +#include + +class Greeter : public QObject +{ + Q_OBJECT +public: + Greeter(const QString& name, QObject *parent = 0) + : QObject(parent) + , mName(name) {} + +public slots: + void run() + { + qDebug() << QString("Hello %1!").arg(mName); + + emit finished(); + } + +signals: + void finished(); + +private: + const QString& mName; +}; diff --git a/recipes/qt/5.x.x/test_package/resource.txt b/recipes/qt/5.x.x/test_package/resource.txt new file mode 100644 index 0000000000000..ab281a2c44284 --- /dev/null +++ b/recipes/qt/5.x.x/test_package/resource.txt @@ -0,0 +1 @@ +Hello World From Resource diff --git a/recipes/qt/5.x.x/test_package/test_package.cpp b/recipes/qt/5.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..80265894dfd6f --- /dev/null +++ b/recipes/qt/5.x.x/test_package/test_package.cpp @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include "greeter.h" +#include + +#include +#include +#include +#include + +#include + +void f() +{ + qDebug() << "inside f"; +} + +int main(int argc, char *argv[]){ + QCoreApplication app(argc, argv); + QCoreApplication::setApplicationName("Application Example"); + QCoreApplication::setApplicationVersion("1.0.0"); + + QString name = argc > 0 ? argv[1] : ""; + if (name.isEmpty()) { + name = "World"; + } + + Greeter* greeter = new Greeter(name, &app); + QObject::connect(greeter, SIGNAL(finished()), &app, SLOT(quit())); + QTimer::singleShot(0, greeter, SLOT(run())); + + QFile f(":/resource.txt"); + if(!f.open(QIODevice::ReadOnly)) + qFatal("Could not open resource file"); + qDebug() << "Resource content:" << f.readAll(); + f.close(); + + qDebug() << W_OK; + + QNetworkAccessManager networkTester; + + QSqlDatabase sqlTester; + + QFuture future = QtConcurrent::run(::f); + future.waitForFinished(); + + QDomText xmlTester; + + return app.exec(); +} diff --git a/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt b/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5866335fec6a --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.1.0) + +set(CMAKE_CXX_STANDARD 11) + +project(test_package) + +cmake_policy(SET CMP0020 NEW) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +find_package(Qt5 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(SOURCES ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) + +add_executable(${PROJECT_NAME} WIN32 ${SOURCES}) + +target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml) diff --git a/recipes/qt/5.x.x/test_v1_package/conanfile.py b/recipes/qt/5.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cc3b35ad8bcbd --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/conanfile.py @@ -0,0 +1,145 @@ +import os +import shutil + +from conan import ConanFile +from conans import tools, Meson, RunEnvironment, CMake +from conan.tools.build import cross_building +from conan.tools.files import save +from conan.errors import ConanInvalidConfiguration + + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi", "qmake" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and self.settings.compiler == "Visual Studio": + self.build_requires("jom/1.1.3") + if self._meson_supported(): + self.build_requires("meson/1.1.0") + + 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('\\', '/'))) + + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def _meson_supported(self): + return self.options["qt"].shared and\ + not cross_building(self) and\ + not tools.os_info.is_macos and\ + not self._is_mingw() + + def _qmake_supported(self): + return self.options["qt"].shared + + def _build_with_qmake(self): + if not self._qmake_supported(): + return + tools.mkdir("qmake_folder") + with tools.chdir("qmake_folder"): + self.output.info("Building with qmake") + + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + args = [self.source_folder, "DESTDIR=bin"] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath("CC") + if value: + args += ['QMAKE_CC="' + value + '"', + 'QMAKE_LINK_C="' + value + '"', + 'QMAKE_LINK_C_SHLIB="' + value + '"'] + + value = _getenvpath('CXX') + if value: + args += ['QMAKE_CXX="' + value + '"', + 'QMAKE_LINK="' + value + '"', + 'QMAKE_LINK_SHLIB="' + value + '"'] + + self.run("qmake %s" % " ".join(args), run_environment=True) + if tools.os_info.is_windows: + if self.settings.compiler == "Visual Studio": + self.run("jom", run_environment=True) + else: + self.run("mingw32-make", run_environment=True) + else: + self.run("make", run_environment=True) + + def _build_with_meson(self): + if self._meson_supported(): + self.output.info("Building with Meson") + tools.mkdir("meson_folder") + with tools.environment_append(RunEnvironment(self).vars): + meson = Meson(self) + try: + meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) + except ConanInvalidConfiguration: + self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) + raise + meson.build() + + def _build_with_cmake_find_package_multi(self): + self.output.info("Building with cmake_find_package_multi") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.14' + + cmake.configure() + cmake.build() + + def build(self): + self._build_with_qmake() + self._build_with_meson() + self._build_with_cmake_find_package_multi() + + def _test_with_qmake(self): + if not self._qmake_supported(): + return + self.output.info("Testing qmake") + bin_path = os.path.join("qmake_folder", "bin") + if tools.os_info.is_macos: + bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") + shutil.copy(os.path.join(self.generators_folder, "qt.conf"), bin_path) + self.run(os.path.join(bin_path, "test_package"), run_environment=True) + + def _test_with_meson(self): + if self._meson_supported(): + self.output.info("Testing Meson") + shutil.copy(os.path.join(self.generators_folder, "qt.conf"), "meson_folder") + self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake_find_package_multi(self): + self.output.info("Testing CMake_find_package_multi") + shutil.copy(os.path.join(self.generators_folder, "qt.conf"), "bin") + self.run(os.path.join("bin", "test_package"), run_environment=True) + + def test(self): + if not cross_building(self, skip_x64_x86=True): + self._test_with_qmake() + self._test_with_meson() + self._test_with_cmake_find_package_multi() diff --git a/recipes/qt/5.x.x/test_v1_package/meson.build b/recipes/qt/5.x.x/test_v1_package/meson.build new file mode 100644 index 0000000000000..cc717d4f23da5 --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/meson.build @@ -0,0 +1,6 @@ +project('test_package', 'cpp') +qt5 = import('qt5') +qt5_dep = dependency('qt5', modules: ['Core', 'Network', 'Sql', 'Concurrent', 'Xml']) +moc_files = qt5.preprocess(moc_headers : '../test_package/greeter.h', qresources : '../test_package/example.qrc') +executable('test_package', '../test_package/test_package.cpp', moc_files, + dependencies : qt5_dep) diff --git a/recipes/qt/5.x.x/test_v1_package/test_package.pro b/recipes/qt/5.x.x/test_v1_package/test_package.pro new file mode 100644 index 0000000000000..3b3ce9cba0343 --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/test_package.pro @@ -0,0 +1,14 @@ +SOURCES += ../test_package/test_package.cpp + +HEADERS += ../test_package/greeter.h + +RESOURCES = ../test_package/example.qrc + +QT -= gui +QT += network sql concurrent xml + +CONFIG += console + +CONFIG += conan_basic_setup +include($$OUT_PWD/../conanbuildinfo.pri) +LIBS -= $$CONAN_LIBS_QT diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml new file mode 100644 index 0000000000000..b3b89583f4ce5 --- /dev/null +++ b/recipes/qt/6.x.x/conandata.yml @@ -0,0 +1,122 @@ +sources: + "6.5.0": + url: + - "https://download.qt.io/official_releases/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://download.qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://ftp1.nluug.nl/languages/qt/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://ftp2.nluug.nl/languages/qt/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://master.qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" + sha256: "dba376e110e53895c7c827eea389dc12aa9c45862cd197d2f0d37ee472baf0b0" + "6.4.2": + url: + - "https://download.qt.io/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" + sha256: "689f53e6652da82fccf7c2ab58066787487339f28d1ec66a8765ad357f4976be" + "6.4.1": + url: + - "https://download.qt.io/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" + sha256: "e20b850b6134098a7f2e7701cfddfb213c6cf394b9e848e6fbc5b0e89dcfcc09" + "6.3.2": + url: + - "https://download.qt.io/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" + sha256: "b90524f686224a0e5a945c1d65307e16a375348dbe275c9ac11de171fe31374a" + "6.2.4": + url: + - "https://download.qt.io/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" + sha256: "cfe41905b6bde3712c65b102ea3d46fc80a44c9d1487669f14e4a6ee82ebb8fd" +patches: + "6.5.0": + - base_path: "qtwebengine" + patch_description: "Workaround for too long .rps file name" + patch_file: "patches/c72097e.diff" + "6.4.2": + - base_path: "qtbase/cmake" + patch_description: "Fix pri helpers" + patch_file: "patches/qt6-pri-helpers-fix.diff" + - patch_file: "patches/c72097e.diff" + base_path: "qtwebengine" + patch_description: "Workaround for too long .rps file name" + - patch_file: "patches/d13958d.diff" + base_path: "qtbase" + patch_description: "Fix PCRE2 detection" + patch_type: "bugfix" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" + "6.4.1": + - base_path: "qtbase/cmake" + patch_description: "Fix pri helpers" + patch_file: "patches/qt6-pri-helpers-fix.diff" + - patch_file: "patches/c72097e.diff" + base_path: "qtwebengine" + patch_description: "Workaround for too long .rps file name" + - patch_file: "patches/d13958d.diff" + base_path: "qtbase" + patch_description: "Fix PCRE2 detection" + patch_type: "bugfix" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" + - patch_file: "patches/3801bba82.patch" + base_path: "qtwebengine/src/3rdparty" + patch_description: "fix qtwebengine with MSVC2022" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/444132" + "6.3.2": + - base_path: "qtbase/cmake" + patch_description: "Fix pri helpers" + patch_file: "patches/qt6-pri-helpers-fix.diff" + - patch_file: "patches/c72097e.diff" + base_path: "qtwebengine" + patch_description: "Workaround for too long .rps file name" + - patch_file: "patches/d13958d.diff" + base_path: "qtbase" + patch_description: "Fix PCRE2 detection" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" + patch_type: "bugfix" + "6.2.4": + - base_path: "qtdeclarative" + patch_description: "Directly include Unicode.h in YarrCanonicalize.h" + patch_file: "patches/32451d5.diff" + - base_path: "qtbase/cmake" + patch_description: "Fix pri helpers" + patch_file: "patches/qt6-pri-helpers-fix.diff" + - patch_file: "patches/c72097e.diff" + base_path: "qtwebengine" + patch_description: "Workaround for too long .rps file name" + - patch_file: "patches/138a720.diff" + base_path: "qtwebengine/src/3rdparty" + patch_description: "Fix build with msvc2019 16.8.0" + - patch_file: "patches/CVE-2022-1096-qtwebengine-6.2.diff" + base_path: "qtwebengine" + patch_description: "Fix Chromium callback" + - patch_file: "patches/CVE-2022-25255-qprocess6-2.diff" + base_path: "qtbase" + patch_description: "Fix executable path resolution" + - patch_file: "patches/CVE-2022-25643-6.2.diff" + base_path: "qtbase" + patch_description: "Fix DLL path" + - patch_file: "patches/d13958d_.diff" + base_path: "qtbase" + patch_description: "Fix PCRE2 detection" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py new file mode 100644 index 0000000000000..5511bfa479f30 --- /dev/null +++ b/recipes/qt/6.x.x/conanfile.py @@ -0,0 +1,1449 @@ +from contextlib import contextmanager + +import configparser +import glob +import os +import textwrap + +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.build import cross_building, check_min_cppstd, build_jobs, default_cppstd +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.files import copy, get, replace_in_file, apply_conandata_patches, save, rm, rmdir, export_conandata_patches +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 conans import RunEnvironment, tools +from conans.model import Generator + +required_conan_version = ">=1.55.0" + + +class qt(Generator): + @staticmethod + def content_template(path, folder, os_): + bin_folder = "bin" if os_ == "Windows" else "libexec" + return textwrap.dedent(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""") + + @property + def filename(self): + return "qt.conf" + + @property + def content(self): + return qt.content_template( + self.conanfile.deps_cpp_info["qt"].rootpath.replace("\\", "/"), + "res", + self.conanfile.settings.os) + + +class QtConan(ConanFile): + _submodules = ["qtsvg", "qtdeclarative", "qttools", "qttranslations", "qtdoc", + "qtwayland","qtquickcontrols2", "qtquicktimeline", "qtquick3d", "qtshadertools", "qt5compat", + "qtactiveqt", "qtcharts", "qtdatavis3d", "qtlottie", "qtscxml", "qtvirtualkeyboard", + "qt3d", "qtimageformats", "qtnetworkauth", "qtcoap", "qtmqtt", "qtopcua", + "qtmultimedia", "qtlocation", "qtsensors", "qtconnectivity", "qtserialbus", + "qtserialport", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", + "qtremoteobjects", "qtpositioning", "qtlanguageserver", + "qtspeech", "qthttpserver", "qtquick3dphysics", "qtgrpc", "qtquickeffectmaker"] + + name = "qt" + description = "Qt is a cross-platform framework for graphical user interfaces." + topics = ("framework", "ui") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.qt.io" + license = "LGPL-3.0-only" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "opengl": ["no", "desktop", "dynamic"], + "with_vulkan": [True, False], + "openssl": [True, False], + "with_pcre2": [True, False], + "with_glib": [True, False], + "with_doubleconversion": [True, False], + "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_icu": [True, False], + "with_harfbuzz": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], + "with_libpng": [True, False], + "with_sqlite3": [True, False], + "with_mysql": [True, False], + "with_pq": [True, False], + "with_odbc": [True, False], + "with_zstd": [True, False], + "with_brotli": [True, False], + "with_dbus": [True, False], + "with_libalsa": [True, False], + "with_openal": [True, False], + "with_gstreamer": [True, False], + "with_pulseaudio": [True, False], + "with_gssapi": [True, False], + "with_md4c": [True, False], + "with_x11": [True, False], + + "gui": [True, False], + "widgets": [True, False], + + "device": "ANY", + "cross_compile": "ANY", + "sysroot": "ANY", + "multiconfiguration": [True, False], + "disabled_features": "ANY", + } + options.update({module: [True, False] for module in _submodules}) + + # this significantly speeds up windows builds + no_copy_source = True + + default_options = { + "shared": False, + "opengl": "desktop", + "with_vulkan": False, + "openssl": True, + "with_pcre2": True, + "with_glib": False, + "with_doubleconversion": True, + "with_freetype": True, + "with_fontconfig": True, + "with_icu": True, + "with_harfbuzz": True, + "with_libjpeg": False, + "with_libpng": True, + "with_sqlite3": True, + "with_mysql": False, + "with_pq": True, + "with_odbc": True, + "with_zstd": False, + "with_brotli": True, + "with_dbus": False, + "with_libalsa": False, + "with_openal": True, + "with_gstreamer": False, + "with_pulseaudio": False, + "with_gssapi": False, + "with_md4c": True, + "with_x11": True, + + "gui": True, + "widgets": True, + + "device": None, + "cross_compile": None, + "sysroot": None, + "multiconfiguration": False, + "disabled_features": "", + } + default_options.update({module: False for module in _submodules}) + + short_paths = True + + _submodules_tree = None + + @property + def _get_module_tree(self): + if self._submodules_tree: + return self._submodules_tree + config = configparser.ConfigParser() + config.read(os.path.join(self.recipe_folder, f"qtmodules{self.version}.conf")) + self._submodules_tree = {} + assert config.sections(), f"no qtmodules.conf file for version {self.version}" + for s in config.sections(): + section = str(s) + assert section.startswith("submodule ") + assert section.count('"') == 2 + modulename = section[section.find('"') + 1: section.rfind('"')] + status = str(config.get(section, "status")) + if status not in ["obsolete", "ignore", "additionalLibrary"]: + self._submodules_tree[modulename] = {"status": status, + "path": str(config.get(section, "path")), "depends": []} + if config.has_option(section, "depends"): + self._submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] + + for m in self._submodules_tree: + assert m in ["qtbase", "qtqa", "qtrepotools"] or m in self._submodules, f"module {m} not in self._submodules" + + return self._submodules_tree + + def export_sources(self): + export_conandata_patches(self) + + def export(self): + copy(self, f"qtmodules{self.version}.conf", self.recipe_folder, self.export_folder) + + def config_options(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_icu + del self.options.with_fontconfig + self.options.with_glib = False + del self.options.with_libalsa + del self.options.with_x11 + + if self.settings.os == "Windows": + self.options.opengl = "dynamic" + del self.options.with_gssapi + if self.settings.os != "Linux": + self.options.qtwayland = False + + for m in self._submodules: + if m not in self._get_module_tree: + delattr(self.options, m) + + @property + def _minimum_compilers_version(self): + # Qt6 requires C++17 + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "9", + "apple-clang": "12" if Version(self.version) >= "6.5.0" else "11" + } + + def configure(self): + if not self.options.gui: + del self.options.opengl + del self.options.with_vulkan + del self.options.with_freetype + del self.options.with_fontconfig + del self.options.with_harfbuzz + del self.options.with_libjpeg + del self.options.with_libpng + del self.options.with_md4c + del self.options.with_x11 + + if not self.options.get_safe("qtmultimedia"): + del self.options.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 + + def _enablemodule(mod): + if mod != "qtbase": + setattr(self.options, mod, True) + for req in self._get_module_tree[mod]["depends"]: + _enablemodule(req) + + for module in self._get_module_tree: + if self.options.get_safe(module): + _enablemodule(module) + + def validate(self): + if os.getenv('NOT_ON_C3I', '0') == '0': + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ + self.info.settings.compiler == "clang" and Version(self.info.settings.compiler.version) >= "12": + raise ConanInvalidConfiguration("qt is not supported on gcc11 and clang >= 12 on C3I until conan-io/conan-center-index#13472 is fixed\n"\ + "If your distro is modern enough (xcb >= 1.12), set environment variable NOT_ON_C3I=1") + + # C++ minimum standard required + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 17) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("C++17 support required. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.") + + if Version(self.version) >= "6.5.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "9": + raise ConanInvalidConfiguration("qt 6.5.0 cannot be built with gcc 9, cf QTBUG-112920") + + if Version(self.version) >= "6.4.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("apple-clang >= 12 required by qt >= 6.4.0") + + if Version(self.version) >= "6.3.0" and self.settings.compiler == "clang" and "libstdc++" in str(self.settings.compiler.libcxx): + raise ConanInvalidConfiguration("Qt needs recent libstdc++, with charconv. please switch to gcc, or to libc++") + + if Version(self.version) < "6.3.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) >= "11": + raise ConanInvalidConfiguration("Qt lower then 6.3.0 needs to be compiled for gcc with a version lower then 11") + + if self.options.get_safe("qtwebengine"): + if not self.options.shared: + raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") + + if not (self.options.gui and self.options.qtdeclarative and self.options.qtwebchannel): + raise ConanInvalidConfiguration("option qt:qtwebengine requires also qt:gui, qt:qtdeclarative and qt:qtwebchannel") + if not self.options.with_dbus and self.settings.os == "Linux": + raise ConanInvalidConfiguration("option qt:webengine requires also qt:with_dbus on Linux") + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") + + if Version(self.version) < "6.3.0": + # Check if a valid python2 is available in PATH or it will failflex + # Start by checking if python2 can be found + python_exe = tools.which("python2") + if not python_exe: + # Fall back on regular python + python_exe = tools.which("python") + + if not python_exe: + msg = ("Python2 must be available in PATH " + "in order to build Qt WebEngine") + raise ConanInvalidConfiguration(msg) + + # In any case, check its actual version for compatibility + from six import StringIO # Python 2 and 3 compatible + mybuf = StringIO() + cmd_v = f"\"{python_exe}\" --version" + self.run(cmd_v, output=mybuf) + verstr = mybuf.getvalue().strip().split("Python ")[1] + if verstr.endswith("+"): + verstr = verstr[:-1] + version = Version(verstr) + # >= 2.7.5 & < 3 + v_min = "2.7.5" + v_max = "3.0.0" + if v_min <= version < v_max: + msg = ("Found valid Python 2 required for QtWebengine:" + f" version={mybuf.getvalue()}, path={python_exe}") + self.output.success(msg) + else: + msg = (f"Found Python 2 in path, but with invalid version {verstr}" + f" (QtWebEngine requires >= {v_min} & < " + f"{v_max})\nIf you have both Python 2 and 3 installed, copy the python 2 executable to" + f"python2(.exe)") + raise ConanInvalidConfiguration(msg) + + if self.options.widgets and not self.options.gui: + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") + if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android.") + + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: + raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + + if self.options.get_safe("with_pulseaudio", False) or self.options.get_safe("with_libalsa", False): + raise ConanInvalidConfiguration("alsa and pulseaudio are not supported (QTBUG-95116), please disable them.") + if not self.options.with_pcre2: + raise ConanInvalidConfiguration("pcre2 is actually required by qt (QTBUG-92454). please use option qt:with_pcre2=True") + + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + raise ConanInvalidConfiguration("gssapi cannot be enabled until conan-io/conan-center-index#4102 is closed") + + if self.options.get_safe("with_x11", False) and not self.dependencies.direct_host["xkbcommon"].options.with_x11: + raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must be enabled when the 'with_x11' option is enabled") + if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland: + raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled") + + if cross_building(self): + raise ConanInvalidConfiguration("cross compiling qt 6 is not yet supported. Contributions are welcome") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + if self.options.openssl: + self.requires("openssl/1.1.1t") + if self.options.with_pcre2: + self.requires("pcre2/10.42") + if self.options.get_safe("with_vulkan"): + self.requires("vulkan-loader/1.3.239.0") + if is_apple_os(self): + self.requires("moltenvk/1.2.2") + if self.options.with_glib: + self.requires("glib/2.76.1") + if self.options.with_doubleconversion and not self.options.multiconfiguration: + self.requires("double-conversion/3.2.1") + if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: + self.requires("freetype/2.13.0") + if self.options.get_safe("with_fontconfig", False): + self.requires("fontconfig/2.13.93") + if self.options.get_safe("with_icu", False): + self.requires("icu/72.1") + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + self.requires("harfbuzz/6.0.0") + if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + else: + self.requires("libjpeg/9e") + if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: + self.requires("libpng/1.6.39") + if self.options.with_sqlite3 and not self.options.multiconfiguration: + self.requires("sqlite3/3.41.1") + self.options["sqlite3"].enable_column_metadata = True + if self.options.get_safe("with_mysql", False): + self.requires("libmysqlclient/8.0.31") + if self.options.with_pq: + self.requires("libpq/14.7") + if self.options.with_odbc: + if self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("with_openal", False): + self.requires("openal/1.22.2") + if self.options.get_safe("with_libalsa", False): + self.requires("libalsa/1.2.7.2") + if self.options.get_safe("with_x11", False): + self.requires("xkbcommon/1.5.0") + self.requires("xorg/system") + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + self.requires("opengl/system") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.qtwayland: + self.requires("xkbcommon/1.5.0") + self.requires("wayland/1.21.0") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + if self.options.get_safe("qtwebengine") and self.settings.os == "Linux": + self.requires("expat/2.5.0") + self.requires("opus/1.3.1") + self.requires("xorg-proto/2022.2") + self.requires("libxshmfence/1.3") + self.requires("nss/3.89") + self.requires("libdrm/2.4.114") + if self.options.get_safe("with_gstreamer", False): + self.requires("gst-plugins-base/1.19.2") + if self.options.get_safe("with_pulseaudio", False): + self.requires("pulseaudio/14.2") + if self.options.with_dbus: + self.requires("dbus/1.15.2") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 + if self.options.get_safe("with_md4c", False): + self.requires("md4c/0.4.8") + + def build_requirements(self): + self.tool_requires("cmake/3.25.3") + self.tool_requires("ninja/1.11.1") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self.settings.os == "Windows": + self.tool_requires('strawberryperl/5.32.1.1') + + if self.options.get_safe("qtwebengine"): + self.tool_requires("nodejs/16.3.0") + self.tool_requires("gperf/3.1") + # gperf, bison, flex, python >= 2.7.5 & < 3 + if self.settings.os != "Windows": + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + else: + self.tool_requires("winflexbison/2.5.24") + + if self.options.qtwayland: + self.tool_requires("wayland/1.21.0") + if cross_building(self): + self.tool_requires(f"qt/{self.version}") + + def generate(self): + ms = VirtualBuildEnv(self) + ms.generate() + + tc = CMakeDeps(self) + tc.set_property("libdrm", "cmake_file_name", "Libdrm") + tc.set_property("libdrm::libdrm_libdrm", "cmake_target_name", "Libdrm::Libdrm") + tc.set_property("wayland", "cmake_file_name", "Wayland") + tc.set_property("wayland::wayland-client", "cmake_target_name", "Wayland::Client") + tc.set_property("wayland::wayland-server", "cmake_target_name", "Wayland::Server") + tc.set_property("wayland::wayland-cursor", "cmake_target_name", "Wayland::Cursor") + tc.set_property("wayland::wayland-egl", "cmake_target_name", "Wayland::Egl") + tc.generate() + + for f in glob.glob("*.cmake"): + replace_in_file(self, f, + " IMPORTED)\n", + " IMPORTED GLOBAL)\n", strict=False) + + pc = PkgConfigDeps(self) + pc.generate() + + # TODO: to remove when properly handled by conan (see https://github.com/conan-io/conan/issues/11962) + env = Environment() + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuildenv_pkg_config_path") + + 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.variables["QT_BUILD_TESTS"] = "OFF" + tc.variables["QT_BUILD_EXAMPLES"] = "OFF" + + if is_msvc(self) and "MT" in msvc_runtime_flag(self): + tc.variables["FEATURE_static_runtime"] = "ON" + + if self.options.multiconfiguration: + tc.variables["CMAKE_CONFIGURATION_TYPES"] = "Release;Debug" + tc.variables["FEATURE_optimize_size"] = ("ON" if self.settings.build_type == "MinSizeRel" else "OFF") + + for module in self._get_module_tree: + if module != 'qtbase': + tc.variables[f"BUILD_{module}"] = ("ON" if self.options.get_safe(module) else "OFF") + + tc.variables["FEATURE_system_zlib"] = "ON" + + tc.variables["INPUT_opengl"] = self.options.get_safe("opengl", "no") + + # openSSL + if not self.options.openssl: + tc.variables["INPUT_openssl"] = "no" + else: + tc.variables["HAVE_openssl"] = "ON" + if self.options["openssl"].shared: + tc.variables["INPUT_openssl"] = "runtime" + tc.variables["QT_FEATURE_openssl_runtime"] = "ON" + else: + tc.variables["INPUT_openssl"] = "linked" + tc.variables["QT_FEATURE_openssl_linked"] = "ON" + + # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + + if self.options.with_dbus: + tc.variables["INPUT_dbus"] = "linked" + else: + tc.variables["FEATURE_dbus"] = "OFF" + tc.variables["CMAKE_FIND_DEBUG_MODE"] = "FALSE" + + + for opt, conf_arg in [("with_glib", "glib"), + ("with_icu", "icu"), + ("with_fontconfig", "fontconfig"), + ("with_mysql", "sql_mysql"), + ("with_pq", "sql_psql"), + ("with_odbc", "sql_odbc"), + ("gui", "gui"), + ("widgets", "widgets"), + ("with_zstd", "zstd"), + ("with_vulkan", "vulkan"), + ("with_brotli", "brotli"), + ("with_gssapi", "gssapi")]: + tc.variables[f"FEATURE_{conf_arg}"] = ("ON" if self.options.get_safe(opt, False) else "OFF") + + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "jpeg"), + ("with_libpng", "png"), + ("with_sqlite3", "sqlite"), + ("with_pcre2", "pcre2"),]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + tc.variables[f"FEATURE_{conf_arg}"] = "ON" + else: + tc.variables[f"FEATURE_system_{conf_arg}"] = "ON" + else: + tc.variables[f"FEATURE_{conf_arg}"] = "OFF" + tc.variables[f"FEATURE_system_{conf_arg}"] = "OFF" + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_md4c", "libmd4c"), + ("with_pcre2", "pcre"),]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + tc.variables[f"INPUT_{conf_arg}"] = "qt" + else: + tc.variables[f"INPUT_{conf_arg}"] = "system" + else: + tc.variables[f"INPUT_{conf_arg}"] = "no" + + for feature in str(self.options.disabled_features).split(): + tc.variables[f"FEATURE_{feature}"] = "OFF" + + if self.settings.os == "Macos": + tc.variables["FEATURE_framework"] = "OFF" + elif self.settings.os == "Android": + tc.variables["CMAKE_ANDROID_NATIVE_API_LEVEL"] = self.settings.os.api_level + tc.variables["ANDROID_ABI"] = {"armv7": "armeabi-v7a", + "armv8": "arm64-v8a", + "x86": "x86", + "x86_64": "x86_64"}.get(str(self.settings.arch)) + + if self.options.sysroot: + tc.variables["CMAKE_SYSROOT"] = self.options.sysroot + + if self.options.device: + tc.variables["QT_QMAKE_TARGET_MKSPEC"] = f"devices/{self.options.device}" + else: + xplatform_val = self._xplatform() + if xplatform_val: + tc.variables["QT_QMAKE_TARGET_MKSPEC"] = xplatform_val + else: + self.output.warn(f"host not supported: {self.settings.os} {self.settings.compiler} {self.settings.compiler.version} {self.settings.arch}") + if self.options.cross_compile: + tc.variables["QT_QMAKE_DEVICE_OPTIONS"] = f"CROSS_COMPILE={self.options.cross_compile}" + + tc.variables["FEATURE_pkg_config"] = "ON" + if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and not self.options.shared: + tc.variables["BUILD_WITH_PCH"]= "OFF" # disabling PCH to save disk space + + if self.settings.os == "Windows": + tc.variables["HOST_PERL"] = getattr(self, "user_info_build", self.deps_user_info)["strawberryperl"].perl + #"set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" + #"set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" + #"set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" + + current_cpp_std = self.settings.get_safe("compiler.cppstd", default_cppstd(self)) + current_cpp_std = str(current_cpp_std).replace("gnu", "") + cpp_std_map = { + "20": "FEATURE_cxx20" + } + if Version(self.version) >= "6.5.0": + cpp_std_map["23"] = "FEATURE_cxx2b" + + tc.variables[cpp_std_map.get(current_cpp_std, "FEATURE_cxx17")] = "ON" + + tc.generate() + + def source(self): + destination = self.source_folder + if self.settings.os == "Windows": + # Don't use os.path.join, or it removes the \\?\ prefix, which enables long paths + destination = f"\\\\?\\{self.source_folder}" + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=destination) + + # patching in source method because of no_copy_source attribute + + apply_conandata_patches(self) + if Version(self.version) >= "6.2.0": + for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: + replace_in_file(self, os.path.join(self.source_folder, "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + " if (enable_precompiled_headers) {\n if (is_win) {", + " 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): + os.remove(file) + + # workaround QTBUG-94356 + if Version(self.version) >= "6.1.1": + zlib_file_name = "FindWrapSystemZLIB.cmake" if Version(self.version) >= "6.3.1" else "FindWrapZLIB.cmake" + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", zlib_file_name), '"-lz"', 'ZLIB::ZLIB') + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "configure.cmake"), + "set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)", + "") + if Version(self.version) <= "6.4.0": + # use official variable name https://cmake.org/cmake/help/latest/module/FindFontconfig.html + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "src", "gui", "configure.cmake"), "FONTCONFIG_FOUND", "Fontconfig_FOUND") + + def _xplatform(self): + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + return {"x86": "linux-g++-32", + "armv6": "linux-arm-gnueabi-g++", + "armv7": "linux-arm-gnueabi-g++", + "armv7hf": "linux-arm-gnueabi-g++", + "armv8": "linux-aarch64-gnu-g++"}.get(str(self.settings.arch), "linux-g++") + if self.settings.compiler == "clang": + if self.settings.arch == "x86": + return "linux-clang-libc++-32" if self.settings.compiler.libcxx == "libc++" else "linux-clang-32" + if self.settings.arch == "x86_64": + return "linux-clang-libc++" if self.settings.compiler.libcxx == "libc++" else "linux-clang" + + elif self.settings.os == "Macos": + return {"clang": "macx-clang", + "apple-clang": "macx-clang", + "gcc": "macx-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "iOS": + if self.settings.compiler == "apple-clang": + return "macx-ios-clang" + + elif self.settings.os == "watchOS": + if self.settings.compiler == "apple-clang": + return "macx-watchos-clang" + + elif self.settings.os == "tvOS": + if self.settings.compiler == "apple-clang": + return "macx-tvos-clang" + + elif self.settings.os == "Android": + if self.settings.compiler == "clang": + return "android-clang" + + elif self.settings.os == "Windows": + return { + "Visual Studio": "win32-msvc", + "msvc": "win32-msvc", + "gcc": "win32-g++", + "clang": "win32-clang-g++", + }.get(str(self.settings.compiler)) + + elif self.settings.os == "WindowsStore": + if is_msvc(self): + if self.settings.compiler == "Visual Studio": + msvc_version = str(self.settings.compiler.version) + else: + msvc_version = { + "190": "14", + "191": "15", + "192": "16", + }.get(str(self.settings.compiler.version)) + return { + "14": { + "armv7": "winrt-arm-msvc2015", + "x86": "winrt-x86-msvc2015", + "x86_64": "winrt-x64-msvc2015", + }, + "15": { + "armv7": "winrt-arm-msvc2017", + "x86": "winrt-x86-msvc2017", + "x86_64": "winrt-x64-msvc2017", + }, + "16": { + "armv7": "winrt-arm-msvc2019", + "x86": "winrt-x86-msvc2019", + "x86_64": "winrt-x64-msvc2019", + } + }.get(msvc_version).get(str(self.settings.arch)) + + elif self.settings.os == "FreeBSD": + return {"clang": "freebsd-clang", + "gcc": "freebsd-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "SunOS": + if self.settings.compiler == "sun-cc": + if self.settings.arch == "sparc": + return "solaris-cc-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc" + if self.settings.arch == "sparcv9": + return "solaris-cc64-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc64" + elif self.settings.compiler == "gcc": + return {"sparc": "solaris-g++", + "sparcv9": "solaris-g++-64"}.get(str(self.settings.arch)) + elif self.settings.os == "Neutrino" and self.settings.compiler == "qcc": + return {"armv8": "qnx-aarch64le-qcc", + "armv8.3": "qnx-aarch64le-qcc", + "armv7": "qnx-armle-v7-qcc", + "armv7hf": "qnx-armle-v7-qcc", + "armv7s": "qnx-armle-v7-qcc", + "armv7k": "qnx-armle-v7-qcc", + "x86": "qnx-x86-qcc", + "x86_64": "qnx-x86-64-qcc"}.get(str(self.settings.arch)) + elif self.settings.os == "Emscripten" and self.settings.arch == "wasm": + return "wasm-emscripten" + + return None + + @contextmanager + def _build_context(self): + with tools.vcvars(self) if is_msvc(self) else tools.no_op(): + # next lines force cmake package to be in PATH before the one provided by visual studio (vcvars) + build_env = tools.RunEnvironment(self).vars if is_msvc(self) else {} + build_env["MAKEFLAGS"] = f"j{build_jobs(self)}" + build_env["PKG_CONFIG_PATH"] = [self.build_folder] + if self.settings.os == "Windows": + if "PATH" not in build_env: + build_env["PATH"] = [] + build_env["PATH"].append(os.path.join(self.source_folder, "gnuwin32", "bin")) + if is_msvc(self): + # this avoids cmake using gcc from strawberryperl + build_env["CC"] = "cl" + build_env["CXX"] = "cl" + with tools.environment_append(build_env): + + if self.settings.os == "Macos": + save(self, ".qmake.stash" , "") + save(self, ".qmake.super" , "") + yield + + def build(self): + with self._build_context(): + cmake = CMake(self) + cmake.configure() + if self.settings.os == "Macos": + dyld_library_path = ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"]) + save(self, "bash_env", f"export DYLD_LIBRARY_PATH=\"{dyld_library_path}\"") + with tools.environment_append({ + "BASH_ENV": os.path.abspath("bash_env") + }) if self.settings.os == "Macos" else tools.no_op(): + with tools.run_environment(self): + with tools.remove_from_path("perl") if self.settings.os == "Windows" else tools.no_op(): + cmake.build() + + @property + def _cmake_executables_file(self): + return os.path.join("lib", "cmake", "Qt6Core", "conan_qt_executables_variables.cmake") + + @property + def _cmake_entry_point_file(self): + return os.path.join("lib", "cmake", "Qt6Core", "conan_qt_entry_point.cmake") + + def _cmake_qt6_private_file(self, module): + return os.path.join("lib", "cmake", f"Qt6{module}", f"conan_qt_qt6_{module.lower()}private.cmake") + + def package(self): + with self._build_context(): + cmake = CMake(self) + cmake.install() + save(self, os.path.join(self.package_folder, "bin", "qt.conf"), qt.content_template("..", "res", self.settings.os)) + copy(self, "*LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses")) + for module in self._get_module_tree: + if module != "qtbase" and not self.options.get_safe(module): + rmdir(self, os.path.join(self.package_folder, "licenses", module)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: + rm(self, mask, self.package_folder, recursive=True) + 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")) + + for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")): + module = os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake") + helper_modules = glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")) + if not os.path.isfile(module) and not helper_modules: + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", m)) + + extension = "" + if self.settings.os == "Windows": + extension = ".exe" + filecontents = "set(QT_CMAKE_EXPORT_NAMESPACE Qt6)\n" + ver = Version(self.version) + filecontents += f"set(QT_VERSION_MAJOR {ver.major})\n" + filecontents += f"set(QT_VERSION_MINOR {ver.minor})\n" + filecontents += f"set(QT_VERSION_PATCH {ver.patch})\n" + targets = ["moc", "rcc", "tracegen", "cmake_automoc_parser", "qlalr", "qmake"] + if self.options.with_dbus: + targets.extend(["qdbuscpp2xml", "qdbusxml2cpp"]) + if self.options.gui: + targets.append("qvkgen") + if self.options.widgets: + targets.append("uic") + if self.options.qttools: + targets.extend(["qhelpgenerator", "qtattributionsscanner"]) + if self.settings.os == "Windows": + targets.extend(["windeployqt"]) + targets.extend(["lconvert", "lprodump", "lrelease", "lrelease-pro", "lupdate", "lupdate-pro"]) + if self.options.qtshadertools: + targets.append("qsb") + if self.options.qtdeclarative: + targets.extend(["qmltyperegistrar", "qmlcachegen", "qmllint", "qmlimportscanner"]) + targets.extend(["qmlformat", "qml", "qmlprofiler", "qmlpreview", "qmltestrunner"]) + if self.options.get_safe("qtremoteobjects"): + targets.append("repc") + if self.options.get_safe("qtscxml"): + targets.append("qscxmlc") + for target in targets: + exe_path = None + for path_ in [f"bin/{target}{extension}", + f"lib/{target}{extension}"]: + if os.path.isfile(os.path.join(self.package_folder, path_)): + exe_path = path_ + break + if not exe_path: + self.output.warn(f"Could not find path to {target}{extension}") + filecontents += textwrap.dedent(f"""\ + if(NOT TARGET ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) + add_executable(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} IMPORTED) + set_target_properties(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} PROPERTIES IMPORTED_LOCATION ${{CMAKE_CURRENT_LIST_DIR}}/../../../{exe_path}) + endif() + """) + + filecontents += textwrap.dedent(f"""\ + if(NOT DEFINED QT_DEFAULT_MAJOR_VERSION) + set(QT_DEFAULT_MAJOR_VERSION {ver.major}) + endif() + """) + filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n' + save(self, os.path.join(self.package_folder, self._cmake_executables_file), filecontents) + + def _create_private_module(module, dependencies): + dependencies_string = ';'.join(f"Qt6::{dependency}" for dependency in dependencies) + contents = textwrap.dedent(f"""\ + if(NOT TARGET Qt6::{module}Private) + add_library(Qt6::{module}Private INTERFACE IMPORTED) + + set_target_properties(Qt6::{module}Private PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{module}/{self.version};${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{module}/{self.version}/Qt{module}" + INTERFACE_LINK_LIBRARIES "{dependencies_string}" + ) + + add_library(Qt::{module}Private INTERFACE IMPORTED) + set_target_properties(Qt::{module}Private PROPERTIES + INTERFACE_LINK_LIBRARIES "Qt6::{module}Private" + _qt_is_versionless_target "TRUE" + ) + endif()""") + + save(self, os.path.join(self.package_folder, self._cmake_qt6_private_file(module)), contents) + + _create_private_module("Core", ["Core"]) + + if self.options.gui: + _create_private_module("Gui", ["CorePrivate", "Gui"]) + + if self.options.widgets: + _create_private_module("Widgets", ["CorePrivate", "GuiPrivate", "Widgets"]) + + if self.options.qtdeclarative: + _create_private_module("Qml", ["CorePrivate", "Qml"]) + + if self.settings.os in ["Windows", "iOS"]: + contents = textwrap.dedent("""\ + set(entrypoint_conditions "$>>") + list(APPEND entrypoint_conditions "$,EXECUTABLE>") + if(WIN32) + list(APPEND entrypoint_conditions "$>") + endif() + list(JOIN entrypoint_conditions "," entrypoint_conditions) + set(entrypoint_conditions "$") + set_property( + TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::Core + APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<${entrypoint_conditions}:${QT_CMAKE_EXPORT_NAMESPACE}::EntryPointPrivate>" + )""") + save(self, os.path.join(self.package_folder, self._cmake_entry_point_file), contents) + + def package_id(self): + del self.info.options.cross_compile + del self.info.options.sysroot + if self.options.multiconfiguration and is_msvc(self): + if self.settings.compiler == "Visual Studio": + if "MD" in self.settings.compiler.runtime: + self.info.settings.compiler.runtime = "MD/MDd" + else: + self.info.settings.compiler.runtime = "MT/MTd" + else: + self.info.settings.compiler.runtime_type = "Release/Debug" + + @property + def _has_positioning(self): + return (self.options.get_safe("qtlocation") and Version(self.version) < "6.2.2") or \ + (self.options.get_safe("qtpositioning") and Version(self.version) >= "6.2.2") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Qt6") + + self.cpp_info.names["cmake_find_package"] = "Qt6" + 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.buildenv_info.define("QT_HOST_PATH", self.package_folder) + + build_modules = {} + def _add_build_module(component, module): + if component not in build_modules: + build_modules[component] = [] + build_modules[component].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package"].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append(module) + + libsuffix = "" + if self.settings.build_type == "Debug": + if is_msvc(self): + libsuffix = "d" + if is_apple_os(self): + libsuffix = "_debug" + + def _get_corrected_reqs(requires): + reqs = [] + for r in requires: + if "::" in r: + corrected_req = r + else: + corrected_req = f"qt{r}" + assert corrected_req in self.cpp_info.components, f"{corrected_req} required but not yet present in self.cpp_info.components" + reqs.append(corrected_req) + return reqs + + def _create_module(module, requires, has_include_dir=True): + componentname = f"qt{module}" + assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt6::{module}") + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + if module.endswith("Private"): + libname = module[:-7] + else: + libname = module + self.cpp_info.components[componentname].libs = [f"Qt6{libname}{libsuffix}"] + if has_include_dir: + self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", f"Qt{module}")] + self.cpp_info.components[componentname].defines = [f"QT_{module.upper()}_LIB"] + if module != "Core" and "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + def _create_plugin(pluginname, libname, plugintype, requires): + componentname = f"qt{pluginname}" + assert componentname not in self.cpp_info.components, f"Plugin {pluginname} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt6::{pluginname}") + self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname + 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].includedirs = [] + if "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + core_reqs = ["zlib::zlib"] + if self.options.with_pcre2: + core_reqs.append("pcre2::pcre2") + if self.options.with_doubleconversion: + core_reqs.append("double-conversion::double-conversion") + if self.options.get_safe("with_icu", False): + core_reqs.append("icu::icu") + if self.options.with_zstd: + core_reqs.append("zstd::zstd") + if self.options.with_glib: + core_reqs.append("glib::glib") + + _create_module("Core", core_reqs) + if self.settings.os == "Windows": + if Version(self.version) >= "6.3.0": + self.cpp_info.components["qtCore"].system_libs.append("authz") + if is_msvc(self): + if Version(self.version) >= "6.3.0": + self.cpp_info.components["qtCore"].cxxflags.append("-permissive-") + if Version(self.version) >= "6.2.0": + self.cpp_info.components["qtCore"].cxxflags.append("-Zc:__cplusplus") + self.cpp_info.components["qtCore"].system_libs.append("synchronization") + if Version(self.version) >= "6.2.1": + self.cpp_info.components["qtCore"].system_libs.append("runtimeobject") + 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())] + if Version(self.version) < "6.1.0": + self.cpp_info.components["qtCore"].libs.append(f"Qt6Core_qobject{libsuffix}") + if self.options.with_dbus: + _create_module("DBus", ["dbus::dbus"]) + if self.options.gui: + gui_reqs = [] + if self.options.with_dbus: + gui_reqs.append("DBus") + if self.options.with_freetype: + gui_reqs.append("freetype::freetype") + if self.options.with_libpng: + gui_reqs.append("libpng::libpng") + if self.options.get_safe("with_fontconfig", False): + gui_reqs.append("fontconfig::fontconfig") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.qtwayland or self.options.get_safe("with_x11", False): + gui_reqs.append("xkbcommon::xkbcommon") + if self.options.get_safe("with_x11", False): + gui_reqs.append("xorg::xorg") + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + gui_reqs.append("opengl::opengl") + if self.options.get_safe("with_vulkan", False): + gui_reqs.append("vulkan-loader::vulkan-loader") + if is_apple_os(self): + gui_reqs.append("moltenvk::moltenvk") + if self.options.with_harfbuzz: + gui_reqs.append("harfbuzz::harfbuzz") + if self.options.with_glib: + gui_reqs.append("glib::glib") + if self.options.with_md4c: + gui_reqs.append("md4c::md4c") + _create_module("Gui", gui_reqs) + + _add_build_module("qtGui", self._cmake_qt6_private_file("Gui")) + + if self.settings.os == "Windows": + self.cpp_info.components["qtGui"].system_libs = ["advapi32", "gdi32", "ole32", "shell32", "user32", "d3d11", + "dxgi", "dxguid", "d2d1", "dwrite"] + if self.settings.compiler == "gcc": + self.cpp_info.components["qtGui"].system_libs.append("uuid") + _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) + self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs = ["advapi32", "dwmapi", "gdi32", "imm32", + "ole32", "oleaut32", "shell32", "shlwapi", "user32", "winmm", "winspool", "wtsapi32"] + elif self.settings.os == "Android": + _create_plugin("QAndroidIntegrationPlugin", "qtforandroid", "platforms", ["Core", "Gui"]) + self.cpp_info.components["qtQAndroidIntegrationPlugin"].system_libs = ["android", "jnigraphics"] + elif self.settings.os == "Macos": + _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", ["Core", "Gui"]) + self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = ["AppKit", "Carbon", "CoreServices", "CoreVideo", + "IOKit", "IOSurface", "Metal", "QuartzCore"] + elif self.settings.os in ["iOS", "tvOS"]: + _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", []) + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = ["AudioToolbox", "Foundation", "Metal", + "QuartzCore", "UIKit"] + elif self.settings.os == "watchOS": + _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", []) + elif self.settings.os == "Emscripten": + _create_plugin("QWasmIntegrationPlugin", "qwasm", "platforms", ["Core", "Gui"]) + elif self.options.get_safe("with_x11", False): + _create_module("XcbQpaPrivate", ["xkbcommon::libxkbcommon-x11", "xorg::xorg"], has_include_dir=False) + _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpaPrivate"]) + + _create_plugin("QGifPlugin", "qgif", "imageformats", ["Gui"]) + _create_plugin("QIcoPlugin", "qico", "imageformats", ["Gui"]) + if self.options.get_safe("with_libjpeg"): + jpeg_reqs = ["Gui"] + if self.options.with_libjpeg == "libjpeg-turbo": + jpeg_reqs.append("libjpeg-turbo::libjpeg-turbo") + if self.options.with_libjpeg == "libjpeg": + jpeg_reqs.append("libjpeg::libjpeg") + _create_plugin("QJpegPlugin", "qjpeg", "imageformats", jpeg_reqs) + + if self.options.with_sqlite3: + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) + if self.options.with_pq: + _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) + if self.options.with_odbc: + if self.settings.os != "Windows": + _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) + networkReqs = [] + if self.options.openssl: + networkReqs.append("openssl::openssl") + if self.options.with_brotli: + networkReqs.append("brotli::brotli") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + networkReqs.append("krb5::krb5-gssapi") + _create_module("Network", networkReqs) + _create_module("Sql", []) + _create_module("Test", []) + if self.options.widgets: + _create_module("Widgets", ["Gui"]) + _add_build_module("qtWidgets", self._cmake_qt6_private_file("Widgets")) + if self.options.gui and self.options.widgets: + _create_module("PrintSupport", ["Gui", "Widgets"]) + if self.options.get_safe("opengl", "no") != "no" and self.options.gui: + _create_module("OpenGL", ["Gui"]) + if self.options.widgets and self.options.get_safe("opengl", "no") != "no": + _create_module("OpenGLWidgets", ["OpenGL", "Widgets"]) + _create_module("Concurrent", []) + _create_module("Xml", []) + + if self.options.qt5compat: + _create_module("Core5Compat", []) + + # since https://github.com/qt/qtdeclarative/commit/4fb84137f1c0a49d64b8bef66fef8a4384cc2a68 + qt_quick_enabled = self.options.gui and (Version(self.version) < "6.2.0" or self.options.qtshadertools) + + if self.options.qtdeclarative: + _create_module("Qml", ["Network"]) + _add_build_module("qtQml", self._cmake_qt6_private_file("Qml")) + _create_module("QmlModels", ["Qml"]) + self.cpp_info.components["qtQmlImportScanner"].set_property("cmake_target_name", "Qt6::QmlImportScanner") + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" + self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) + if qt_quick_enabled: + _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + if self.options.widgets: + _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) + _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) + _create_module("QmlWorkerScript", ["Qml"]) + + if self.options.qttools and self.options.gui and self.options.widgets: + self.cpp_info.components["qtLinguistTools"].set_property("cmake_target_name", "Qt6::LinguistTools") + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package"] = "LinguistTools" + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package_multi"] = "LinguistTools" + _create_module("UiPlugin", ["Gui", "Widgets"]) + self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only + self.cpp_info.components["qtUiPlugin"].libdirs = [] + _create_module("UiTools", ["UiPlugin", "Gui", "Widgets"]) + _create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) + _create_module("Help", ["Gui", "Sql", "Widgets"]) + + if self.options.qtshadertools and self.options.gui: + _create_module("ShaderTools", ["Gui"]) + + if self.options.qtquick3d and qt_quick_enabled: + _create_module("Quick3DUtils", ["Gui"]) + _create_module("Quick3DAssetImport", ["Gui", "Qml", "Quick3DUtils"]) + _create_module("Quick3DRuntimeRender", ["Gui", "Quick", "Quick3DAssetImport", "Quick3DUtils", "ShaderTools"]) + _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"]) + + if (self.options.get_safe("qtquickcontrols2") or \ + (self.options.qtdeclarative and Version(self.version) >= "6.2.0")) and qt_quick_enabled: + _create_module("QuickControls2", ["Gui", "Quick"]) + _create_module("QuickTemplates2", ["Gui", "Quick"]) + + if self.options.qtsvg and self.options.gui: + _create_module("Svg", ["Gui"]) + if self.options.widgets: + _create_module("SvgWidgets", ["Gui", "Svg", "Widgets"]) + + if self.options.qtwayland and self.options.gui: + _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) + _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) + + if self.options.get_safe("qtactiveqt") and self.settings.os == "Windows": + _create_module("AxBase", ["Gui", "Widgets"]) + _create_module("AxServer", ["AxBase"]) + self.cpp_info.components["qtAxServer"].system_libs.append("shell32") + self.cpp_info.components["qtAxServer"].defines.append("QAXSERVER") + _create_module("AxContainer", ["AxBase"]) + if self.options.get_safe("qtcharts"): + _create_module("Charts", ["Gui", "Widgets"]) + if self.options.get_safe("qtdatavis3d") and qt_quick_enabled: + _create_module("DataVisualization", ["Gui", "OpenGL", "Qml", "Quick"]) + if self.options.get_safe("qtlottie"): + _create_module("Bodymovin", ["Gui"]) + if self.options.get_safe("qtscxml"): + _create_module("StateMachine", []) + _create_module("StateMachineQml", ["StateMachine", "Qml"]) + _create_module("Scxml", []) + _create_plugin("QScxmlEcmaScriptDataModelPlugin", "qscxmlecmascriptdatamodel", "scxmldatamodel", ["Scxml", "Qml"]) + _create_module("ScxmlQml", ["Scxml", "Qml"]) + if self.options.get_safe("qtvirtualkeyboard") and qt_quick_enabled: + _create_module("VirtualKeyboard", ["Gui", "Qml", "Quick"]) + _create_plugin("QVirtualKeyboardPlugin", "qtvirtualkeyboardplugin", "platforminputcontexts", ["Gui", "Qml", "VirtualKeyboard"]) + _create_plugin("QtVirtualKeyboardHangulPlugin", "qtvirtualkeyboard_hangul", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"]) + _create_plugin("QtVirtualKeyboardMyScriptPlugin", "qtvirtualkeyboard_myscript", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"]) + _create_plugin("QtVirtualKeyboardThaiPlugin", "qtvirtualkeyboard_thai", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"]) + if self.options.get_safe("qt3d"): + _create_module("3DCore", ["Gui", "Network"]) + _create_module("3DRender", ["3DCore", "OpenGL"]) + _create_module("3DAnimation", ["3DCore", "3DRender", "Gui"]) + _create_module("3DInput", ["3DCore", "Gui"]) + _create_module("3DLogic", ["3DCore", "Gui"]) + _create_module("3DExtras", ["Gui", "3DCore", "3DInput", "3DLogic", "3DRender"]) + _create_plugin("DefaultGeometryLoaderPlugin", "defaultgeometryloader", "geometryloaders", ["3DCore", "3DRender", "Gui"]) + _create_plugin("fbxGeometryLoaderPlugin", "fbxgeometryloader", "geometryloaders", ["3DCore", "3DRender", "Gui"]) + if qt_quick_enabled: + _create_module("3DQuick", ["3DCore", "Gui", "Qml", "Quick"]) + _create_module("3DQuickAnimation", ["3DAnimation", "3DCore", "3DQuick", "3DRender", "Gui", "Qml"]) + _create_module("3DQuickExtras", ["3DCore", "3DExtras", "3DInput", "3DQuick", "3DRender", "Gui", "Qml"]) + _create_module("3DQuickInput", ["3DCore", "3DInput", "3DQuick", "Gui", "Qml"]) + _create_module("3DQuickRender", ["3DCore", "3DQuick", "3DRender", "Gui", "Qml"]) + _create_module("3DQuickScene2D", ["3DCore", "3DQuick", "3DRender", "Gui", "Qml"]) + if self.options.get_safe("qtimageformats"): + _create_plugin("ICNSPlugin", "qicns", "imageformats", ["Gui"]) + _create_plugin("QJp2Plugin", "qjp2", "imageformats", ["Gui"]) + _create_plugin("QMacHeifPlugin", "qmacheif", "imageformats", ["Gui"]) + _create_plugin("QMacJp2Plugin", "qmacjp2", "imageformats", ["Gui"]) + _create_plugin("QMngPlugin", "qmng", "imageformats", ["Gui"]) + _create_plugin("QTgaPlugin", "qtga", "imageformats", ["Gui"]) + _create_plugin("QTiffPlugin", "qtiff", "imageformats", ["Gui"]) + _create_plugin("QWbmpPlugin", "qwbmp", "imageformats", ["Gui"]) + _create_plugin("QWebpPlugin", "qwebp", "imageformats", ["Gui"]) + if self.options.get_safe("qtnetworkauth"): + _create_module("NetworkAuth", ["Network"]) + if self.options.get_safe("qtcoap"): + _create_module("Coap", ["Network"]) + if self.options.get_safe("qtmqtt"): + _create_module("Mqtt", ["Network"]) + if self.options.get_safe("qtopcua"): + _create_module("OpcUa", ["Network"]) + _create_plugin("QOpen62541Plugin", "open62541_backend", "opcua", ["Network", "OpcUa"]) + _create_plugin("QUACppPlugin", "uacpp_backend", "opcua", ["Network", "OpcUa"]) + + if self.options.get_safe("qtmultimedia"): + multimedia_reqs = ["Network", "Gui"] + if self.options.get_safe("with_libalsa", False): + multimedia_reqs.append("libalsa::libalsa") + if self.options.with_openal: + multimedia_reqs.append("openal::openal") + if self.options.get_safe("with_pulseaudio", False): + multimedia_reqs.append("pulseaudio::pulse") + _create_module("Multimedia", multimedia_reqs) + _create_module("MultimediaWidgets", ["Multimedia", "Widgets", "Gui"]) + if self.options.qtdeclarative and qt_quick_enabled: + _create_module("MultimediaQuick", ["Multimedia", "Quick"]) + _create_plugin("QM3uPlaylistPlugin", "qtmultimedia_m3u", "playlistformats", []) + if self.options.with_gstreamer: + _create_module("MultimediaGstTools", ["Multimedia", "MultimediaWidgets", "Gui", "gst-plugins-base::gst-plugins-base"]) + _create_plugin("QGstreamerAudioDecoderServicePlugin", "gstaudiodecoder", "mediaservice", []) + _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.settings.os == "Windows": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) + _create_plugin("QWindowsAudioPlugin", "qtaudio_windows", "audio", []) + if self.settings.os == "Macos": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("AVFMediaPlayerServicePlugin", "qavfmediaplayer", "mediaservice", []) + _create_plugin("AVFServicePlugin", "qavfcamera", "mediaservice", []) + _create_plugin("CoreAudioPlugin", "qtaudio_coreaudio", "audio", []) + + if self._has_positioning: + _create_module("Positioning", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue2", "qtposition_geoclue2", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryPoll", "qtposition_positionpoll", "position", []) + + if self.options.get_safe("qtsensors"): + _create_module("Sensors", []) + _create_plugin("genericSensorPlugin", "qtsensors_generic", "sensors", []) + _create_plugin("IIOSensorProxySensorPlugin", "qtsensors_iio-sensor-proxy", "sensors", []) + if self.settings.os == "Linux": + _create_plugin("LinuxSensorPlugin", "qtsensors_linuxsys", "sensors", []) + _create_plugin("QtSensorGesturePlugin", "qtsensorgestures_plugin", "sensorgestures", []) + _create_plugin("QShakeSensorGesturePlugin", "qtsensorgestures_shakeplugin", "sensorgestures", []) + + if self.options.get_safe("qtconnectivity"): + _create_module("Bluetooth", ["Network"]) + _create_module("Nfc", []) + + if self.options.get_safe("qtserialport"): + _create_module("SerialPort", []) + + if self.options.get_safe("qtserialbus"): + _create_module("SerialBus", ["SerialPort"] if self.options.get_safe("qtserialport") else []) + _create_plugin("PassThruCanBusPlugin", "qtpassthrucanbus", "canbus", []) + _create_plugin("PeakCanBusPlugin", "qtpeakcanbus", "canbus", []) + _create_plugin("SocketCanBusPlugin", "qtsocketcanbus", "canbus", []) + _create_plugin("TinyCanBusPlugin", "qttinycanbus", "canbus", []) + _create_plugin("VirtualCanBusPlugin", "qtvirtualcanbus", "canbus", []) + + if self.options.get_safe("qtwebsockets"): + _create_module("WebSockets", ["Network"]) + + if self.options.get_safe("qtwebchannel"): + _create_module("WebChannel", ["Qml"]) + + if self.options.get_safe("qtwebengine") and qt_quick_enabled: + webenginereqs = ["Gui", "Quick", "WebChannel"] + if self._has_positioning: + webenginereqs.append("Positioning") + if self.settings.os == "Linux": + webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \ + "nss::nss", "libdrm::libdrm"]) + _create_module("WebEngineCore", webenginereqs) + _create_module("WebEngineQuick", ["WebEngineCore"]) + _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) + + if self.options.get_safe("qtremoteobjects"): + _create_module("RemoteObjects", []) + + if self.options.get_safe("qtwebview"): + _create_module("WebView", ["Core", "Gui"]) + + if self.settings.os in ["Windows", "iOS"]: + if self.settings.os == "Windows": + self.cpp_info.components["qtEntryPointImplementation"].set_property("cmake_target_name", "Qt6::EntryPointImplementation") + self.cpp_info.components["qtEntryPointImplementation"].names["cmake_find_package"] = "EntryPointImplementation" + self.cpp_info.components["qtEntryPointImplementation"].names["cmake_find_package_multi"] = "EntryPointImplementation" + self.cpp_info.components["qtEntryPointImplementation"].libs = [f"Qt6EntryPoint{libsuffix}"] + self.cpp_info.components["qtEntryPointImplementation"].system_libs = ["shell32"] + + if self.settings.compiler == "gcc": + self.cpp_info.components["qtEntryPointMinGW32"].set_property("cmake_target_name", "Qt6::EntryPointMinGW32") + self.cpp_info.components["qtEntryPointMinGW32"].names["cmake_find_package"] = "EntryPointMinGW32" + self.cpp_info.components["qtEntryPointMinGW32"].names["cmake_find_package_multi"] = "EntryPointMinGW32" + self.cpp_info.components["qtEntryPointMinGW32"].system_libs = ["mingw32"] + self.cpp_info.components["qtEntryPointMinGW32"].requires = ["qtEntryPointImplementation"] + + self.cpp_info.components["qtEntryPointPrivate"].set_property("cmake_target_name", "Qt6::EntryPointPrivate") + self.cpp_info.components["qtEntryPointPrivate"].names["cmake_find_package"] = "EntryPointPrivate" + self.cpp_info.components["qtEntryPointPrivate"].names["cmake_find_package_multi"] = "EntryPointPrivate" + if self.settings.os == "Windows": + if self.settings.compiler == "gcc": + self.cpp_info.components["qtEntryPointPrivate"].defines.append("QT_NEEDS_QMAIN") + self.cpp_info.components["qtEntryPointPrivate"].requires.append("qtEntryPointMinGW32") + else: + self.cpp_info.components["qtEntryPointPrivate"].requires.append("qtEntryPointImplementation") + if self.settings.os == "iOS": + self.cpp_info.components["qtEntryPointPrivate"].exelinkflags.append("-Wl,-e,_qt_main_wrapper") + + if self.settings.os != "Windows": + self.cpp_info.components["qtCore"].cxxflags.append("-fPIC") + + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.components["qtCore"].system_libs.append("version") # qtcore requires "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library + self.cpp_info.components["qtCore"].system_libs.append("winmm") # qtcore requires "__imp_timeSetEvent" which is in "Winmm.lib" library + self.cpp_info.components["qtCore"].system_libs.append("netapi32") # qtcore requires "NetApiBufferFree" which is in "Netapi32.lib" library + self.cpp_info.components["qtCore"].system_libs.append("userenv") # qtcore requires "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library + self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("iphlpapi") + self.cpp_info.components["qtNetwork"].system_libs.extend(["winhttp", "secur32"]) + + + if self.settings.os == "Macos": + self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework + 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["qtNetwork"].frameworks.append("SystemConfiguration") + if self.options.with_gssapi: + self.cpp_info.components["qtNetwork"].frameworks.append("GSS") + if self.options.gui and self.options.widgets: + self.cpp_info.components["qtPrintSupport"].system_libs.append("cups") + + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("res","archdatadir","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"]: + _add_build_module("qtCore", self._cmake_entry_point_file) + + for m in os.listdir(os.path.join("lib", "cmake")): + module = os.path.join("lib", "cmake", m, f"{m}Macros.cmake") + component_name = m.replace("Qt6", "qt") + if component_name == "qt": + component_name = "qtCore" + if os.path.isfile(module): + _add_build_module(component_name, module) + + for helper_modules in glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")): + _add_build_module(component_name, helper_modules) + self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) + + objects_dirs = glob.glob(os.path.join(self.package_folder, "lib", "objects-*/")) + for object_dir in objects_dirs: + for m in os.listdir(object_dir): + 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)] + self.cpp_info.components[component].exelinkflags.extend(obj_files) + self.cpp_info.components[component].sharedlinkflags.extend(obj_files) + + build_modules_list = [] + + def _add_build_modules_for_component(component): + for req in self.cpp_info.components[component].requires: + if "::" in req: # not a qt component + continue + _add_build_modules_for_component(req) + build_modules_list.extend(build_modules.pop(component, [])) + + for c in self.cpp_info.components: + _add_build_modules_for_component(c) + + self.cpp_info.set_property("cmake_build_modules", build_modules_list) diff --git a/recipes/qt/6.x.x/patches/138a720.diff b/recipes/qt/6.x.x/patches/138a720.diff new file mode 100644 index 0000000000000..0d48b6636dade --- /dev/null +++ b/recipes/qt/6.x.x/patches/138a720.diff @@ -0,0 +1,21 @@ +From 138a7203f16cf356e9d4dac697920a22437014b0 Mon Sep 17 00:00:00 2001 +From: Peter Varga +Date: Fri, 13 Nov 2020 11:09:23 +0100 +Subject: [PATCH] Fix build with msvc2019 16.8.0 + +Fixes: QTBUG-88708 +Change-Id: I3554ceec0437801b4861f68edd504d01fc01cf93 +Reviewed-by: Allan Sandfeld Jensen +--- + +diff --git a/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h b/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h +index 78c316e..136c796 100644 +--- a/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h ++++ b/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h +@@ -145,5 +145,5 @@ + // https://en.wikipedia.org/wiki/CIELAB_color_space#Forward_transformation. + SkV3 ToXYZ(const SkV3& lab) const { + auto invf = [](float x) -> float { +- return x > kSigma ? pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); ++ return x > kSigma ? (float)pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); + }; diff --git a/recipes/qt/6.x.x/patches/311d29d.patch b/recipes/qt/6.x.x/patches/311d29d.patch new file mode 100644 index 0000000000000..600bcca81e265 --- /dev/null +++ b/recipes/qt/6.x.x/patches/311d29d.patch @@ -0,0 +1,30 @@ +From bb01fe6bdf2e52939698de928a1fbeaf3cce4259 Mon Sep 17 00:00:00 2001 +From: Ilya Fedin +Date: Tue, 12 Apr 2022 14:02:36 +0400 +Subject: [PATCH] Fix build on CentOS 7 + +This little change fixes the build on CentOS 7 + +Pick-to: 6.3 +Change-Id: Ic9717147c10ca78e36d6311944de417c6420211d +Reviewed-by: Thiago Macieira +--- + src/corelib/plugin/qelfparser_p.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp +index c6ccda92fb..def1e2494a 100644 +--- a/src/corelib/plugin/qelfparser_p.cpp ++++ b/src/corelib/plugin/qelfparser_p.cpp +@@ -409,7 +409,9 @@ Q_DECL_UNUSED Q_DECL_COLD_FUNCTION static QDebug &operator<<(QDebug &d, ElfHeade + case EM_NONE: d << ", no machine"; break; + case EM_ARM: d << ", ARM"; break; + case EM_AARCH64: d << ", AArch64"; break; ++#ifdef EM_BLACKFIN + case EM_BLACKFIN: d << ", Blackfin"; break; ++#endif + case EM_IA_64: d << ", IA-64"; break; + case EM_MIPS: d << ", MIPS"; break; + case EM_PPC: d << ", PowerPC"; break; +-- +2.34.1 diff --git a/recipes/qt/6.x.x/patches/32451d5.diff b/recipes/qt/6.x.x/patches/32451d5.diff new file mode 100644 index 0000000000000..f9388cbc4f1b8 --- /dev/null +++ b/recipes/qt/6.x.x/patches/32451d5.diff @@ -0,0 +1,32 @@ +From 32451d5c9126921180aad4bf78ec6af5eb27ec2a Mon Sep 17 00:00:00 2001 +From: Ulf Hermann +Date: Tue, 13 Jul 2021 11:05:51 +0200 +Subject: [PATCH] Directly include Unicode.h in YarrCanonicalize.h + +The redirection via utypes.h can be problematic if you have another +utypes.h around in a prominent place. It's easily avoided, though. + +Fixes: QTBUG-77528 +Change-Id: I50368f56b0d7eb957955900a32dbb625a38d02af +--- + +diff --git a/src/3rdparty/masm/stubs/wtf/unicode/utypes.h b/src/3rdparty/masm/stubs/wtf/unicode/utypes.h +deleted file mode 100644 +index e1b4ff9..0000000 +--- a/src/3rdparty/masm/stubs/wtf/unicode/utypes.h ++++ /dev/null +@@ -1 +0,0 @@ +-#include +diff --git a/src/3rdparty/masm/yarr/YarrCanonicalize.h b/src/3rdparty/masm/yarr/YarrCanonicalize.h +index cbd279e..17c9831 100644 +--- a/src/3rdparty/masm/yarr/YarrCanonicalize.h ++++ b/src/3rdparty/masm/yarr/YarrCanonicalize.h +@@ -26,7 +26,7 @@ + #pragma once + + #include +-#include ++#include + + namespace JSC { namespace Yarr { + diff --git a/recipes/qt/6.x.x/patches/3801bba82.patch b/recipes/qt/6.x.x/patches/3801bba82.patch new file mode 100644 index 0000000000000..79b347ce90a23 --- /dev/null +++ b/recipes/qt/6.x.x/patches/3801bba82.patch @@ -0,0 +1,27 @@ +From 3801bba822bf88c202a348d3e01dd493c0ca0551 Mon Sep 17 00:00:00 2001 +From: Nadim Asaduzzaman +Date: Fri, 18 Nov 2022 04:34:38 -0700 +Subject: [PATCH] skia: fix compilation with MSVC2022 + +compilation with MSVC2022 failed due to missing string definition within std namespace + +Fixes: QTBUG-108532 +Change-Id: I2119952d5809895e2511ce1c2c262022af3ba191 +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/444132 +Reviewed-by: Allan Sandfeld Jensen +--- + chromium/third_party/skia/src/core/SkShaderCodeDictionary.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h b/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h +index 3a54bbe22e7..8612a469862 100644 +--- a/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h ++++ b/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h +@@ -9,6 +9,7 @@ + #define SkShaderCodeDictionary_DEFINED + + #include ++#include + #include + #include + #include "include/core/SkSpan.h" diff --git a/recipes/qt/6.x.x/patches/5fe0b82.patch b/recipes/qt/6.x.x/patches/5fe0b82.patch new file mode 100644 index 0000000000000..ae2f8aae34ea9 --- /dev/null +++ b/recipes/qt/6.x.x/patches/5fe0b82.patch @@ -0,0 +1,23 @@ +From bb01af1c36cebd08d407c9a06e5a3c906bd9a660 Mon Sep 17 00:00:00 2001 +From: Mark Jan van Kampen +Date: Wed, 27 Oct 2021 06:49:11 +0200 +Subject: [PATCH] Adds missing includes to utf8_strings.h + +--- + include/litehtml/utf8_strings.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/litehtml/utf8_strings.h b/include/litehtml/utf8_strings.h +index c5b2421..35d474f 100644 +--- a/include/litehtml/utf8_strings.h ++++ b/include/litehtml/utf8_strings.h +@@ -1,6 +1,9 @@ + #ifndef LH_UTF8_STRINGS_H + #define LH_UTF8_STRINGS_H + ++#include "os_types.h" ++#include "types.h" ++ + namespace litehtml + { + class utf8_to_wchar diff --git a/recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff b/recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff new file mode 100644 index 0000000000000..157d0781d4702 --- /dev/null +++ b/recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff @@ -0,0 +1,27 @@ +--- a/src/3rdparty/chromium/v8/src/objects/objects.cc ++++ b/src/3rdparty/chromium/v8/src/objects/objects.cc +@@ -2513,6 +2513,12 @@ Maybe Object::SetPropertyInternal(LookupIterator* it, + Maybe result = + JSObject::SetPropertyWithInterceptor(it, should_throw, value); + if (result.IsNothing() || result.FromJust()) return result; ++ // Assuming that the callback have side effects, we use ++ // Object::SetSuperProperty() which works properly regardless on ++ // whether the property was present on the receiver or not when ++ // storing to the receiver. ++ // Proceed lookup from the next state. ++ it->Next(); + } else { + Maybe maybe_attributes = + JSObject::GetPropertyAttributesWithInterceptor(it); +@@ -2533,10 +2539,8 @@ Maybe Object::SetPropertyInternal(LookupIterator* it, + // property to the receiver. + it->NotFound(); + } +- return Object::SetSuperProperty(it, value, store_origin, +- should_throw); + } +- break; ++ return Object::SetSuperProperty(it, value, store_origin, should_throw); + } + + case LookupIterator::ACCESSOR: { diff --git a/recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff b/recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff new file mode 100644 index 0000000000000..3a566b1b64daa --- /dev/null +++ b/recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff @@ -0,0 +1,25 @@ +--- a/src/corelib/io/qprocess_unix.cpp ++++ b/src/corelib/io/qprocess_unix.cpp +@@ -1,7 +1,7 @@ + /**************************************************************************** + ** + ** Copyright (C) 2020 The Qt Company Ltd. +-** Copyright (C) 2021 Intel Corporation. ++** Copyright (C) 2022 Intel Corporation. + ** Copyright (C) 2021 Alex Trotsenko. + ** Contact: https://www.qt.io/licensing/ + ** +@@ -437,9 +437,10 @@ static QString resolveExecutable(const QString &program) + #endif + + if (!program.contains(QLatin1Char('/'))) { +- QString exeFilePath = QStandardPaths::findExecutable(program); +- if (!exeFilePath.isEmpty()) +- return exeFilePath; ++ // findExecutable() returns its argument if it's an absolute path, ++ // otherwise it searches $PATH; returns empty if not found (we handle ++ // that case much later) ++ return QStandardPaths::findExecutable(program); + } + return program; + } diff --git a/recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff b/recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff new file mode 100644 index 0000000000000..c71c32e4002b3 --- /dev/null +++ b/recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff @@ -0,0 +1,73 @@ +diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp +index 1a7be0d271..9a8506d971 100644 +--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp ++++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp +@@ -47,7 +47,7 @@ + #include + #include + #include +- ++#include + #include + + #include +@@ -162,19 +162,25 @@ QFunctionPointer QWindowsOpengl32DLL::resolve(const char *name) + + bool QWindowsOpengl32DLL::init(bool softwareRendering) + { +- const QByteArray opengl32 = QByteArrayLiteral("opengl32.dll"); +- const QByteArray swopengl = QByteArrayLiteral("opengl32sw.dll"); ++ const QByteArray opengl32 = QByteArrayLiteral("opengl32"); ++ const QByteArray swopengl = QByteArrayLiteral("opengl32sw"); ++ bool useSystemLib = false; + + QByteArray openglDll = qgetenv("QT_OPENGL_DLL"); +- if (openglDll.isEmpty()) ++ if (openglDll.isEmpty()) { + openglDll = softwareRendering ? swopengl : opengl32; ++ useSystemLib = !softwareRendering; ++ } + + openglDll = openglDll.toLower(); + m_nonOpengl32 = openglDll != opengl32; + + qCDebug(lcQpaGl) << "Qt: Using WGL and OpenGL from" << openglDll; + +- m_lib = ::LoadLibraryA(openglDll.constData()); ++ if (useSystemLib) ++ m_lib = QSystemLibrary::load((wchar_t*)(QString::fromLatin1(openglDll).utf16())); ++ else ++ m_lib = LoadLibraryA(openglDll.constData()); + if (!m_lib) { + qErrnoWarning(::GetLastError(), "Failed to load %s", openglDll.constData()); + return false; +@@ -184,7 +190,7 @@ bool QWindowsOpengl32DLL::init(bool softwareRendering) + // Load opengl32.dll always. GDI functions like ChoosePixelFormat do + // GetModuleHandle for opengl32.dll and behave differently (and call back into + // opengl32) when the module is present. This is fine for dummy contexts and windows. +- ::LoadLibraryA("opengl32.dll"); ++ QSystemLibrary::load(L"opengl32"); + } + + wglCreateContext = reinterpret_cast(resolve("wglCreateContext")); +diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp +index 0b1af47a65..1757b6a0dc 100644 +--- a/src/plugins/platforms/windows/qwindowsopengltester.cpp ++++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp +@@ -49,6 +49,7 @@ + #include + #include + #include ++#include + + #ifndef QT_NO_OPENGL + #include +@@ -358,7 +359,7 @@ bool QWindowsOpenGLTester::testDesktopGL() + + // Test #1: Load opengl32.dll and try to resolve an OpenGL 2 function. + // This will typically fail on systems that do not have a real OpenGL driver. +- lib = LoadLibraryA("opengl32.dll"); ++ lib = QSystemLibrary::load(L"opengl32"); + if (lib) { + CreateContext = reinterpret_cast( + reinterpret_cast(::GetProcAddress(lib, "wglCreateContext"))); diff --git a/recipes/qt/6.x.x/patches/c72097e.diff b/recipes/qt/6.x.x/patches/c72097e.diff new file mode 100644 index 0000000000000..0f21c1797317d --- /dev/null +++ b/recipes/qt/6.x.x/patches/c72097e.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/src/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tosrcols/gn/ninja_action_target_writer.cc +@@ -122,9 +122,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/6.x.x/patches/c76d2f6.patch b/recipes/qt/6.x.x/patches/c76d2f6.patch new file mode 100644 index 0000000000000..8c701061dd5d0 --- /dev/null +++ b/recipes/qt/6.x.x/patches/c76d2f6.patch @@ -0,0 +1,70 @@ +From c76d2f6e997d84d81b0b22e0bd3afdaf7acfe3b3 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen +Date: Wed, 13 Oct 2021 12:36:02 +0200 +Subject: [PATCH] Fix build with Win10 21H1 SDK and Win11 SDK + +Different parts are not fully defined + +Task-number: QTBUG-96533 +Change-Id: I4fcb795cea33c519ee082aa69a63660e581a2759 +Reviewed-by: Allan Sandfeld Jensen +--- + chromium/media/gpu/windows/d3d11_av1_accelerator.cc | 2 ++ + chromium/sandbox/win/src/process_mitigations.h | 13 +++++++++---- + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/chromium/media/gpu/windows/d3d11_av1_accelerator.cc b/chromium/media/gpu/windows/d3d11_av1_accelerator.cc +index 8d2d808ed2a..a4d3a79d7c5 100644 +--- a/chromium/media/gpu/windows/d3d11_av1_accelerator.cc ++++ b/chromium/media/gpu/windows/d3d11_av1_accelerator.cc +@@ -15,6 +15,7 @@ + #include "media/gpu/codec_picture.h" + #include "media/gpu/windows/d3d11_picture_buffer.h" + ++#if !defined(NTDDI_WIN10_FE) // Windows 10.0.20348.0 + // These are from in a newer SDK than the one Chrome ships with. They + // should be deleted once Chrome switches to the updated SDK; they have been + // copied from: https://www.microsoft.com/en-us/download/details.aspx?id=101577 +@@ -279,6 +280,7 @@ typedef struct _DXVA_Tile_AV1 { + UCHAR Reserved8Bits; + } DXVA_Tile_AV1, *LPDXVA_Tile_AV1; + #pragma pack(pop) ++#endif // !defined(NTDDI_WIN10_FE) + + namespace media { + +diff --git a/chromium/sandbox/win/src/process_mitigations.h b/chromium/sandbox/win/src/process_mitigations.h +index 3b511fe2bd9..72b314c335e 100644 +--- a/chromium/sandbox/win/src/process_mitigations.h ++++ b/chromium/sandbox/win/src/process_mitigations.h +@@ -12,21 +12,26 @@ + #include "sandbox/win/src/security_level.h" + + // This will be defined in an upcoming Windows SDK release +-#ifndef COMPONENT_KTM ++#ifndef PROC_THREAD_ATTRIBUTE_MACHINE_TYPE + ++#ifndef COMPONENT_KTM + #define COMPONENT_KTM 0x01 + #define COMPONENT_VALID_FLAGS (COMPONENT_KTM) +-#define ProcThreadAttributeComponentFilter 26 + + typedef struct _COMPONENT_FILTER { + ULONG ComponentFlags; + } COMPONENT_FILTER, *PCOMPONENT_FILTER; ++#endif // COMPONENT_KTM + ++#define ProcThreadAttributeComponentFilter 26 ++#endif // PROC_THREAD_ATTRIBUTE_MACHINE_TYPE ++ ++// This seems to remain undefined in newer SDKs ++#ifndef PROC_THREAD_ATTRIBUTE_COMPONENT_FILTER + #define PROC_THREAD_ATTRIBUTE_COMPONENT_FILTER \ + ProcThreadAttributeValue(ProcThreadAttributeComponentFilter, FALSE, TRUE, \ + FALSE) +- +-#endif // COMPONENT_KTM ++#endif + + namespace sandbox { + diff --git a/recipes/qt/6.x.x/patches/d13958d.diff b/recipes/qt/6.x.x/patches/d13958d.diff new file mode 100644 index 0000000000000..1da1b661fd733 --- /dev/null +++ b/recipes/qt/6.x.x/patches/d13958d.diff @@ -0,0 +1,26 @@ +From d13958dabb9f5542d772c6312cd33e4960bf1137 Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 29 Nov 2022 09:15:58 +0000 +Subject: [PATCH] fix pcre2 detection + +Pick-to: 6.3 +Change-Id: I89f167e11bf1c72c9fae474ddd12380636ac5df8 +--- + +diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake +index f8516d3..3ac04b8 100644 +--- a/cmake/FindWrapSystemPCRE2.cmake ++++ b/cmake/FindWrapSystemPCRE2.cmake +@@ -6,11 +6,7 @@ + + find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT QUIET) + +-# TODO: pcre2-16 is not the target name provided by the upstream Config file. It is PCRE2::16BIT. +-# https://github.com/PCRE2Project/pcre2/blob/2410fbe3869cab403f02b94caa9ab37ee9f5854b/cmake/pcre2-config.cmake.in#L122 +-# We don't strictly need to handle that though, because the pkg-config code path below still +-# finds the correct libraries. +-set(__pcre2_target_name "PCRE2::pcre2-16") ++set(__pcre2_target_name "PCRE2::16BIT") + if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}") + # Hunter case. + set(__pcre2_found TRUE) diff --git a/recipes/qt/6.x.x/patches/d13958d_.diff b/recipes/qt/6.x.x/patches/d13958d_.diff new file mode 100644 index 0000000000000..2e9d40bd0efc0 --- /dev/null +++ b/recipes/qt/6.x.x/patches/d13958d_.diff @@ -0,0 +1,23 @@ +From d13958dabb9f5542d772c6312cd33e4960bf1137 Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 29 Nov 2022 09:15:58 +0000 +Subject: [PATCH] fix pcre2 detection + +Pick-to: 6.3 +Change-Id: I89f167e11bf1c72c9fae474ddd12380636ac5df8 +--- + +diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake +index f8516d3..3ac04b8 100644 +--- a/cmake/FindWrapSystemPCRE2.cmake ++++ b/cmake/FindWrapSystemPCRE2.cmake +@@ -6,7 +6,7 @@ + +-find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG QUIET) ++find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT QUIET) + +-set(__pcre2_target_name "PCRE2::pcre2-16") ++set(__pcre2_target_name "PCRE2::16BIT") + if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}") + # Hunter case. + set(__pcre2_found TRUE) diff --git a/recipes/qt/6.x.x/patches/dece6f5.patch b/recipes/qt/6.x.x/patches/dece6f5.patch new file mode 100644 index 0000000000000..16a69952d4016 --- /dev/null +++ b/recipes/qt/6.x.x/patches/dece6f5.patch @@ -0,0 +1,25 @@ +From dece6f5840463ae2ddf927d65eb1b3680e34a547 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=98ystein=20Heskestad?= +Date: Wed, 27 Oct 2021 13:07:46 +0200 +Subject: Add missing macOS header file that was indirectly included before + +Change-Id: I4d4c7d4f957fc36dea5e06eb6d661aeecf6385f1 +Reviewed-by: Timur Pocheptsov +--- + src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h | 1 + + 1 file changed, 1 insertion(+) + +(limited to 'src/plugins/platforms/cocoa') + +diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h +index 5d4b6d6a71..cc7193d8b7 100644 +--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h ++++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h +@@ -43,6 +43,7 @@ + #include + #include + ++#include + #include + + QT_BEGIN_NAMESPACE diff --git a/recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff b/recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff new file mode 100644 index 0000000000000..8038f41a59874 --- /dev/null +++ b/recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff @@ -0,0 +1,15 @@ +--- QtPriHelpers.cmake.original 2021-08-03 23:38:06.343653948 +0300 ++++ QtPriHelpers.cmake 2021-08-03 23:26:24.483637483 +0300 +@@ -30,7 +30,11 @@ + if(lib_target_type STREQUAL "INTERFACE_LIBRARY") + get_target_property(iface_libs ${lib_target} INTERFACE_LINK_LIBRARIES) + if(iface_libs) +- list(PREPEND lib_targets ${iface_libs}) ++ foreach (iface_lib ${iface_libs}) ++ if (NOT "${iface_lib}" STREQUAL "${lib_target}") ++ list(PREPEND lib_targets ${iface_lib}) ++ endif () ++ endforeach () + endif() + else() + list(APPEND lib_libs "$") diff --git a/recipes/qt/6.x.x/qtmodules6.2.4.conf b/recipes/qt/6.x.x/qtmodules6.2.4.conf new file mode 100644 index 0000000000000..92bee3c5b0551 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.2.4.conf @@ -0,0 +1,299 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.2.4 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.2.4 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.2.4 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.2.4 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.2.4 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.2.4 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 6.2.4 + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.2.4 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia + path = qtdoc + url = ../qtdoc.git + branch = 6.2.4 + 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.2.4 + status = ignore +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.2.4 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.2.4 + 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.2.4 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.2.4 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.2.4 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.2.4 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.2.4 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.2.4 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.2.4 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.2.4 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.2.4 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = 6.2.4 + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.2.4 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.2.4 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.2.4 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.2.4 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 6.2.4 + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.2.4 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.2.4 + status = ignore +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.2.4 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.2.4 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 6.2.4 + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.2.4 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.2.4 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.2.4 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.2.4 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.2.4 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.2.4 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.2.4 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.2.4 + status = addon \ No newline at end of file diff --git a/recipes/qt/6.x.x/qtmodules6.3.2.conf b/recipes/qt/6.x.x/qtmodules6.3.2.conf new file mode 100644 index 0000000000000..b0e0878e68e97 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.3.2.conf @@ -0,0 +1,305 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.3.2 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.3.2 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.3.2 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.3.2 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.3.2 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.3.2 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 6.3 + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.3.2 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia + path = qtdoc + url = ../qtdoc.git + branch = 6.3.2 + 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.3 + status = ignore +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.3.2 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.3.2 + 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.3.2 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.3.2 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.3.2 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.3.2 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.3.2 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.3.2 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.3.2 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.3.2 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.3.2 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = 6.3 + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.3.2 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.3.2 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.3.2 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.3.2 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 6.3 + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.3.2 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.3.2 + status = ignore +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.3.2 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.3.2 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 6.3 + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.3.2 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.3.2 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.3.2 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.3.2 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.3.2 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.3.2 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.3.2 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.3.2 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.3.2 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.4.1.conf b/recipes/qt/6.x.x/qtmodules6.4.1.conf new file mode 100644 index 0000000000000..0ab0c4ef10277 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.4.1.conf @@ -0,0 +1,318 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.4.1 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.4.1 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.4.1 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.4.1 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.4.1 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.4.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.4.1 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia + path = qtdoc + url = ../qtdoc.git + branch = 6.4.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 = dev + status = ignore +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.4.1 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.4.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.4.1 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.4.1 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.4.1 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.4.1 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.4.1 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.4.1 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.4.1 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.4.1 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.4.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.4.1 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.4.1 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.4.1 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.4.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.4.1 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.4.1 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.4.1 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.4.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.4.1 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.4.1 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.4.1 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.4.1 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.4.1 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.4.1 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.4.1 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.4.1 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.4.1 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.4.1 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.4.1 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.4.2.conf b/recipes/qt/6.x.x/qtmodules6.4.2.conf new file mode 100644 index 0000000000000..10324ecab234b --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.4.2.conf @@ -0,0 +1,318 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.4.2 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.4.2 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.4.2 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.4.2 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.4.2 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.4.2 + 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.4.2 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia + path = qtdoc + url = ../qtdoc.git + branch = 6.4.2 + 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 = dev + status = ignore +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.4.2 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.4.2 + 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.4.2 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.4.2 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.4.2 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.4.2 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.4.2 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.4.2 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.4.2 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.4.2 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.4.2 + 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.4.2 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.4.2 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.4.2 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.4.2 + 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.4.2 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.4.2 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.4.2 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.4.2 + 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.4.2 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.4.2 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.4.2 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.4.2 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.4.2 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.4.2 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.4.2 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.4.2 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.4.2 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.4.2 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.4.2 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.5.0.conf b/recipes/qt/6.x.x/qtmodules6.5.0.conf new file mode 100644 index 0000000000000..809df6bd31582 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.5.0.conf @@ -0,0 +1,331 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.5.0 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.5.0 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.5.0 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.5.0 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.5.0 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.5.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.5.0 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia + path = qtdoc + url = ../qtdoc.git + branch = 6.5.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.5.0 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.5.0 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.5.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.5.0 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.5.0 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.5.0 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.5.0 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.5.0 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.5.0 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.5.0 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.5.0 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.5.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.5.0 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.5.0 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.5.0 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.5.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.5.0 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.5.0 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.5.0 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.5.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.5.0 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.5.0 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.5.0 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.5.0 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.5.0 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.5.0 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.5.0 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.5.0 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.5.0 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.5.0 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.5.0 + status = addon +[submodule "qtgrpc"] + depends = qtbase + path = qtgrpc + url = ../qtgrpc.git + branch = 6.5.0 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.5.0 + status = addon diff --git a/recipes/qt/6.x.x/test_package/CMakeLists.txt b/recipes/qt/6.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a020d154ec7c --- /dev/null +++ b/recipes/qt/6.x.x/test_package/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.3.0) + +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +add_executable(${PROJECT_NAME} test_package.cpp greeter.h example.qrc) + +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + +target_link_libraries(${PROJECT_NAME} Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) + +# check if extra qt cmake functions are usable +qt_add_executable(${PROJECT_NAME}2 test_package.cpp greeter.h example.qrc) + +set_property(TARGET ${PROJECT_NAME}2 PROPERTY CXX_STANDARD 17) + +target_link_libraries(${PROJECT_NAME}2 PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..05478516b0d29 --- /dev/null +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -0,0 +1,130 @@ +import os +import shutil + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.files import mkdir, chdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +from conans import tools, Meson, RunEnvironment, CMake +from conan.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "qt", "cmake", "cmake_find_package_multi", "cmake_find_package", "pkg_config", "qmake" + + def build_requirements(self): + self.tool_requires("cmake/3.25.3") + if self._meson_supported(): + self.tool_requires("meson/1.0.1") + + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def _meson_supported(self): + return False and self.options["qt"].shared and\ + not cross_building(self) and\ + not self.settings.os == "Macos" and\ + not self._is_mingw() + + def _qmake_supported(self): + return self.options["qt"].shared + + def _build_with_qmake(self): + if not self._qmake_supported(): + return + mkdir(self, "qmake_folder") + with chdir(self, "qmake_folder"): + self.output.info("Building with qmake") + + with tools.vcvars(self.settings) if is_msvc(self) else tools.no_op(): + args = [self.source_folder, "DESTDIR=bin"] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath('CC') + if value: + args.append(f"QMAKE_CC=\"{value}\"") + + value = _getenvpath('CXX') + if value: + args.append(f"QMAKE_CXX=\"{value}\"") + + value = _getenvpath('LD') + if value: + args.append(f"QMAKE_LINK_C=\"{value}\"") + args.append(f"QMAKE_LINK_C_SHLIB=\"{value}\"") + args.append(f"QMAKE_LINK=\"{value}\"") + args.append(f"QMAKE_LINK_SHLIB=\"{value}\"") + + self.run(f"qmake {' '.join(args)}", run_environment=True) + if tools.os_info.is_windows: + if is_msvc(self): + self.run("nmake", run_environment=True) + else: + self.run("mingw32-make", run_environment=True) + else: + self.run("make", run_environment=True) + + def _build_with_meson(self): + if self._meson_supported(): + self.output.info("Building with Meson") + mkdir(self, "meson_folder") + with tools.environment_append(RunEnvironment(self).vars): + meson = Meson(self) + try: + meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) + except ConanException: + self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) + raise + meson.build() + + def _build_with_cmake_find_package_multi(self): + self.output.info("Building with cmake_find_package_multi") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.15' if Version(self.deps_cpp_info["qt"].version) >= "6.5.0" else "10.14" + + cmake.configure() + cmake.build() + + def build(self): + self._build_with_qmake() + self._build_with_meson() + self._build_with_cmake_find_package_multi() + + def _test_with_qmake(self): + if not self._qmake_supported(): + return + self.output.info("Testing qmake") + bin_path = os.path.join("qmake_folder", "bin") + if self.settings.os == "Macos": + bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") + shutil.copy("qt.conf", bin_path) + self.run(os.path.join(bin_path, "test_package"), run_environment=True) + + def _test_with_meson(self): + if self._meson_supported(): + self.output.info("Testing Meson") + shutil.copy("qt.conf", "meson_folder") + self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake_find_package_multi(self): + self.output.info("Testing CMake_find_package_multi") + shutil.copy("qt.conf", "bin") + self.run(os.path.join("bin", "test_package"), run_environment=True) + + def test(self): + if not cross_building(self, skip_x64_x86=True): + self._test_with_qmake() + self._test_with_meson() + self._test_with_cmake_find_package_multi() diff --git a/recipes/qt/6.x.x/test_package/example.qrc b/recipes/qt/6.x.x/test_package/example.qrc new file mode 100644 index 0000000000000..7060adfb034fe --- /dev/null +++ b/recipes/qt/6.x.x/test_package/example.qrc @@ -0,0 +1,5 @@ + + + resource.txt + + diff --git a/recipes/qt/6.x.x/test_package/greeter.h b/recipes/qt/6.x.x/test_package/greeter.h new file mode 100644 index 0000000000000..85052e081d4fb --- /dev/null +++ b/recipes/qt/6.x.x/test_package/greeter.h @@ -0,0 +1,26 @@ +#include +#include +#include + +class Greeter : public QObject +{ + Q_OBJECT +public: + Greeter(const QString& name, QObject *parent = 0) + : QObject(parent) + , mName(name) {} + +public slots: + void run() + { + qDebug() << QString("Hello %1!").arg(mName); + + emit finished(); + } + +signals: + void finished(); + +private: + const QString& mName; +}; diff --git a/recipes/qt/6.x.x/test_package/meson.build b/recipes/qt/6.x.x/test_package/meson.build new file mode 100644 index 0000000000000..684dfec65a30e --- /dev/null +++ b/recipes/qt/6.x.x/test_package/meson.build @@ -0,0 +1,6 @@ +project('test_package', 'cpp') +qt6 = import('qt6') +qt6_dep = dependency('qt6', modules: ['Core', 'Network', 'Sql', 'Concurrent', 'Xml']) +moc_files = qt6.preprocess(moc_headers : 'greeter.h', qresources : 'example.qrc') +executable('test_package', 'test_package.cpp', moc_files, + dependencies : qt6_dep) diff --git a/recipes/qt/6.x.x/test_package/resource.txt b/recipes/qt/6.x.x/test_package/resource.txt new file mode 100644 index 0000000000000..ab281a2c44284 --- /dev/null +++ b/recipes/qt/6.x.x/test_package/resource.txt @@ -0,0 +1 @@ +Hello World From Resource diff --git a/recipes/qt/6.x.x/test_package/test_package.cpp b/recipes/qt/6.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..5374ecf402f3b --- /dev/null +++ b/recipes/qt/6.x.x/test_package/test_package.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "greeter.h" + +int main(int argc, char *argv[]){ + QCoreApplication app(argc, argv); + QCoreApplication::setApplicationName("Application Example"); + QCoreApplication::setApplicationVersion("1.0.0"); + + QString name = argc > 0 ? argv[1] : ""; + if (name.isEmpty()) { + name = "World"; + } + + Greeter* greeter = new Greeter(name, &app); + QObject::connect(greeter, SIGNAL(finished()), &app, SLOT(quit())); + QTimer::singleShot(0, greeter, SLOT(run())); + + QFile f(":/resource.txt"); + if(!f.open(QIODevice::ReadOnly)) + qFatal("Could not open resource file"); + qDebug() << "Resource content:" << f.readAll(); + f.close(); + + QNetworkAccessManager networkTester; + + QSqlDatabase sqlTester; + + QVector v; + v << 1 << 2 << 3 << 4; + QtConcurrent::blockingFilter(v, [](int i) + { + return i % 2; + }); + + QDomText xmlTester; + + return app.exec(); +} diff --git a/recipes/qt/6.x.x/test_package/test_package.pro b/recipes/qt/6.x.x/test_package/test_package.pro new file mode 100644 index 0000000000000..92b10f85fb96e --- /dev/null +++ b/recipes/qt/6.x.x/test_package/test_package.pro @@ -0,0 +1,15 @@ + include($$OUT_PWD/../conanbuildinfo.pri) + + LIBS += $$CONAN_LIBDIRS + + SOURCES += test_package.cpp + +HEADERS += greeter.h + +RESOURCES = example.qrc + +QT += network sql concurrent xml + +QT -= gui + +CONFIG += console diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml new file mode 100644 index 0000000000000..b1da461ce231b --- /dev/null +++ b/recipes/qt/config.yml @@ -0,0 +1,21 @@ +versions: + "6.5.0": + folder: 6.x.x + "6.4.2": + folder: 6.x.x + "6.4.1": + folder: 6.x.x + "6.3.2": + folder: 6.x.x + "6.2.4": + folder: 6.x.x + "5.15.9": + folder: 5.x.x + "5.15.8": + folder: 5.x.x + "5.15.7": + folder: 5.x.x + "5.15.6": + folder: 5.x.x + "5.15.5": + folder: 5.x.x diff --git a/recipes/qtxlsxwriter/all/CMakeLists.txt b/recipes/qtxlsxwriter/all/CMakeLists.txt new file mode 100644 index 0000000000000..ff829c64bd1d9 --- /dev/null +++ b/recipes/qtxlsxwriter/all/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.12) +project(qtxlsxwriter LANGUAGES CXX) + +find_package(Qt${QT_VERSION_MAJOR} REQUIRED Core Gui CONFIG) + +file(GLOB QTXLSXWRITER_SOURCES ${QTXLSXWRITER_SRC_DIR}/src/xlsx/*.cpp) +file(GLOB QTXLSXWRITER_PRIVATE_HEADERS ${QTXLSXWRITER_SRC_DIR}/src/xlsx/*_p.h) +file(GLOB QTXLSXWRITER_PUBLIC_HEADERS ${QTXLSXWRITER_SRC_DIR}/src/xlsx/*.h) +list(REMOVE_ITEM QTXLSXWRITER_PUBLIC_HEADERS ${QTXLSXWRITER_PRIVATE_HEADERS}) + +add_library(qtxlsxwriter ${QTXLSXWRITER_SOURCES}) +target_include_directories(qtxlsxwriter + PUBLIC + ${QTXLSXWRITER_SRC_DIR}/src/xlsx> + PRIVATE + # qtxlsxwriter uses qt private headers + ${QT_ROOT}/include/QtCore/${Qt${QT_VERSION_MAJOR}_VERSION} + ${QT_ROOT}/include/QtGui/${Qt${QT_VERSION_MAJOR}_VERSION} + ${QT_ROOT}/include/QtGui/${Qt${QT_VERSION_MAJOR}_VERSION}/QtGui +) +target_compile_features(qtxlsxwriter PRIVATE cxx_range_for) +target_link_libraries(qtxlsxwriter PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui) +set_target_properties(qtxlsxwriter PROPERTIES + PUBLIC_HEADER "${QTXLSXWRITER_PUBLIC_HEADERS}" + DEFINE_SYMBOL QT_BUILD_XLSX_LIB + AUTOMOC ON +) +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(qtxlsxwriter PUBLIC QTXLSX_STATIC) +endif() + +include(GNUInstallDirs) +install( + TARGETS qtxlsxwriter + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/qtxlsxwriter/all/conandata.yml b/recipes/qtxlsxwriter/all/conandata.yml new file mode 100644 index 0000000000000..324be919abbe3 --- /dev/null +++ b/recipes/qtxlsxwriter/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.3.0": + source: + url: "https://github.com/dbzhang800/QtXlsxWriter/archive/v0.3.0.zip" + sha256: "e665317de4f1551936d519781ab8f96b6738926595f3f26ecb6c50db4ff0419e" + license: + url: "https://raw.githubusercontent.com/dbzhang800/QtXlsxWriter/d013edc9cf39b450f035528114b349a70b1507ba/LICENSE" + sha256: "b89e97a417a8061f438c437d0485e3e4d135a6c25d976cc457a9a23281ee5f51" +patches: + "0.3.0": + - patch_file: "patches/0.3.0/fix-export-macro.patch" diff --git a/recipes/qtxlsxwriter/all/conanfile.py b/recipes/qtxlsxwriter/all/conanfile.py new file mode 100644 index 0000000000000..a67db1337017f --- /dev/null +++ b/recipes/qtxlsxwriter/all/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, download, export_conandata_patches, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class QtXlsxWriterConan(ConanFile): + name = "qtxlsxwriter" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dbzhang800/QtXlsxWriter" + description = ".xlsx file reader and writer for Qt5" + topics = ("excel", "xlsx") + + 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) + 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("qt/5.15.7") + + def validate(self): + if not self.dependencies["qt"].options.gui: + raise ConanInvalidConfiguration(f"{self.ref} requires qt gui") + # FIXME: to remove once https://github.com/conan-io/conan/issues/11385 fixed + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} recipe does not support cross-compilation yet") + + def build_requirements(self): + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("qt/5.15.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version]["source"], + destination=self.source_folder, strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def generate(self): + if hasattr(self, "settings_build") and cross_building(self): + env = VirtualBuildEnv(self) + env.generate() + else: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["QTXLSXWRITER_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["QT_VERSION_MAJOR"] = str(Version(self.dependencies["qt"].ref.version).major) + tc.variables["QT_ROOT"] = self.dependencies["qt"].package_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["qtxlsxwriter"] + if not self.options.shared: + self.cpp_info.defines = ["QTXLSX_STATIC"] + self.cpp_info.requires = ["qt::qtCore", "qt::qtGui"] diff --git a/recipes/qtxlsxwriter/all/patches/0.3.0/fix-export-macro.patch b/recipes/qtxlsxwriter/all/patches/0.3.0/fix-export-macro.patch new file mode 100644 index 0000000000000..ae6ddb0f0549a --- /dev/null +++ b/recipes/qtxlsxwriter/all/patches/0.3.0/fix-export-macro.patch @@ -0,0 +1,13 @@ +diff --git src/xlsx/xlsxglobal.h b/src/xlsx/xlsxglobal.h +index 1e5f4a6..8629064 100644 +--- a/src/xlsx/xlsxglobal.h ++++ b/src/xlsx/xlsxglobal.h +@@ -30,7 +30,7 @@ + #define QT_END_NAMESPACE_XLSX } + #define QTXLSX_USE_NAMESPACE using namespace QXlsx; + +-#if !defined(QT_STATIC) && !defined(XLSX_NO_LIB) ++#if !defined(QTXLSX_STATIC) + # if defined(QT_BUILD_XLSX_LIB) + # define Q_XLSX_EXPORT Q_DECL_EXPORT + # else diff --git a/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt b/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e2353a278197b --- /dev/null +++ b/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(qtxlsxwriter REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qtxlsxwriter::qtxlsxwriter) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +# `fPIC` option must be used because qt was built with `reduce-relocations` +target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) diff --git a/recipes/qtxlsxwriter/all/test_package/conanfile.py b/recipes/qtxlsxwriter/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/qtxlsxwriter/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qtxlsxwriter/all/test_package/test_package.cpp b/recipes/qtxlsxwriter/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec71d1106e960 --- /dev/null +++ b/recipes/qtxlsxwriter/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +int main() { + QBuffer device; + device.open(QIODevice::WriteOnly); + + QXlsx::Document xlsx1; + xlsx1.write("A1", true); + xlsx1.write("A2", false); + xlsx1.saveAs(&device); + + return 0; +} diff --git a/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt b/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/qtxlsxwriter/all/test_v1_package/conanfile.py b/recipes/qtxlsxwriter/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/qtxlsxwriter/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/qtxlsxwriter/config.yml b/recipes/qtxlsxwriter/config.yml new file mode 100644 index 0000000000000..4e597ca532eaa --- /dev/null +++ b/recipes/qtxlsxwriter/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.0": + folder: "all" diff --git a/recipes/quantlib/all/conandata.yml b/recipes/quantlib/all/conandata.yml new file mode 100644 index 0000000000000..92d444f47a0c7 --- /dev/null +++ b/recipes/quantlib/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.22": + url: "https://github.com/lballabio/QuantLib/releases/download/QuantLib-v1.22/QuantLib-1.22.tar.gz" + sha256: "85c81816f689f458596dd7073e4da8fd7f596c1e4c8ada81a6300389a39588af" +patches: + "1.22": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/quantlib/all/conanfile.py b/recipes/quantlib/all/conanfile.py new file mode 100644 index 0000000000000..33792726d5185 --- /dev/null +++ b/recipes/quantlib/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get +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 QuantlibConan(ConanFile): + name = "quantlib" + description = "QuantLib is a free/open-source library for modeling, trading, and risk management in real-life." + license = "BSD-3-Clause" + topics = ("quantitative-finance") + homepage = "https://www.quantlib.org" + 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, + } + + 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.80.0") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("gcc < 5 not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_BOOST_DYNAMIC_LIBRARIES"] = False # even if boost shared, the underlying upstream logic doesn't matter for conan + if is_msvc(self): + tc.variables["MSVC_RUNTIME"] = "static" if is_msvc_static_runtime(self) else "dynamic" + # Export symbols for msvc shared + tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + 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.set_property("cmake_file_name", "QuantLib") + self.cpp_info.set_property("cmake_target_name", "QuantLib::QuantLib") + self.cpp_info.set_property("pkg_config_name", "quantlib") + self.cpp_info.libs = collect_libs(self) + self.cpp_info.requires = ["boost::headers"] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "QuantLib" + self.cpp_info.names["cmake_find_package_multi"] = "QuantLib" diff --git a/recipes/quantlib/all/patches/0001-fix-cmake.patch b/recipes/quantlib/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..2d779b9f09535 --- /dev/null +++ b/recipes/quantlib/all/patches/0001-fix-cmake.patch @@ -0,0 +1,48 @@ +* Don't build examples and tests +* Allow shared on windows +* enable at least C++11 standard + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required() ++cmake_minimum_required(VERSION 3.8) + + project(QuantLib) + +@@ -45,8 +45,6 @@ if (Boost_FOUND) + endif (Boost_FOUND) + + add_subdirectory(ql) +-add_subdirectory(Examples) +-add_subdirectory(test-suite) + + # + # Copy across the ANSI config file into the build directory. Users +--- a/ql/CMakeLists.txt ++++ b/ql/CMakeLists.txt +@@ -2294,7 +2294,7 @@ set(QuantLib_HDR + get_quantlib_library_name(QL_OUTPUT_NAME) + + if(WIN32) +- if (${BUILD_SHARED_LIBS}) ++ if (0) + # Windows needs to link static library (nothing is declared to export in QuantLib) + message(FATAL_ERROR "You should build QuantLib in STATIC mode as nothing is exported from the library. Use BUILD_SHARED_LIBS=OFF") + endif() +@@ -2303,6 +2303,7 @@ if(WIN32) + else() + add_library(${QL_OUTPUT_NAME} ${QuantLib_SRC} ${QuantLib_HDR}) + endif() ++target_compile_features(${QL_OUTPUT_NAME} PUBLIC cxx_std_11) + set(QL_LINK_LIBRARY ${QL_OUTPUT_NAME} PARENT_SCOPE) + + foreach(file ${QuantLib_HDR}) +@@ -2311,6 +2312,7 @@ foreach(file ${QuantLib_HDR}) + endforeach() + + install(TARGETS ${QL_OUTPUT_NAME} ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE diff --git a/recipes/quantlib/all/test_package/CMakeLists.txt b/recipes/quantlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8fdec262bfc09 --- /dev/null +++ b/recipes/quantlib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(QuantLib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE QuantLib::QuantLib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/quantlib/all/test_package/conanfile.py b/recipes/quantlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/quantlib/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/quantlib/all/test_package/test_package.cpp b/recipes/quantlib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0df14de5ce8b6 --- /dev/null +++ b/recipes/quantlib/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ +#include +#ifdef BOOST_MSVC +#include +#endif +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#if defined(QL_ENABLE_SESSIONS) +namespace QuantLib { + ThreadKey sessionId() { return {}; } +} +#endif + +// Correct value is: (e^{-.25} \sqrt{\pi})^{dimension} +struct integrand { + QuantLib::Real operator()(const std::vector& arg) const { + QuantLib::Real sum = 1.; + for (double i : arg) + sum *= std::exp(-i * i) * std::cos(i); + return sum; + } +}; + +int main() { + try { + QuantLib::Size dimension = 3; + QuantLib::Real exactSol = std::pow(std::exp(-.25) * std::sqrt(M_PI), static_cast(dimension)); + + QuantLib::ext::function& arg)> f = integrand(); + + QuantLib::GaussianQuadMultidimIntegrator intg(dimension, 15); + QuantLib::Real valueQuad = intg(f); + + std::vector > integrals; + for (QuantLib::Size i = 0; i < dimension; ++i) { + integrals.push_back(QuantLib::ext::make_shared >(1.e-4, 20)); + } + std::vector a_limits(integrals.size(), -4.); + std::vector b_limits(integrals.size(), 4.); + QuantLib::MultidimIntegral testIntg(integrals); + + QuantLib::Real valueGrid = testIntg(f, a_limits, b_limits); + + std::cout << std::fixed << std::setprecision(4); + std::cout << std::endl << "-------------- " << std::endl + << "Exact: " << exactSol << std::endl + << "Quad: " << valueQuad << std::endl + << "Grid: " << valueGrid << std::endl + << std::endl; + + return 0; + + } catch (std::exception& e) { + std::cerr << e.what() << std::endl; + return 1; + } catch (...) { + std::cerr << "unknown error" << std::endl; + return 1; + } +} diff --git a/recipes/quantlib/all/test_v1_package/CMakeLists.txt b/recipes/quantlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/quantlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/quantlib/all/test_v1_package/conanfile.py b/recipes/quantlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/quantlib/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/quantlib/config.yml b/recipes/quantlib/config.yml new file mode 100644 index 0000000000000..a04ddfaf17d5f --- /dev/null +++ b/recipes/quantlib/config.yml @@ -0,0 +1,3 @@ +versions: + "1.22": + folder: "all" diff --git a/recipes/quaternions/all/conandata.yml b/recipes/quaternions/all/conandata.yml new file mode 100644 index 0000000000000..c04bd29059477 --- /dev/null +++ b/recipes/quaternions/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20160606": + url: "https://github.com/ferd36/quaternions/archive/68fc6c7fb392b1a920779d80bb75879263329ff5.zip" + sha256: "df714dfed5b4994a8b854d97635f2e46d2d4bf228dc659c24adcf2c2d6ad4891" diff --git a/recipes/quaternions/all/conanfile.py b/recipes/quaternions/all/conanfile.py new file mode 100644 index 0000000000000..53d02dd9ca8a2 --- /dev/null +++ b/recipes/quaternions/all/conanfile.py @@ -0,0 +1,36 @@ +import os + +from conans import ConanFile, tools + +class QuaternionsConan(ConanFile): + name = "quaternions" + description = "A blazingly fast C++ library to work with quaternions." + topics = ("conan", "quaternions", "mathematics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ferd36/quaternions" + license = "MIT" + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + url = self.conan_data["sources"][self.version]["url"] + extracted_dir = self.name + "-" + os.path.splitext(os.path.basename(url))[0] + os.rename(extracted_dir, self._source_subfolder) + tools.replace_in_file(os.path.join(self._source_subfolder, "include", "quaternion.h"), + "#include ", "") + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) diff --git a/recipes/quaternions/all/test_package/CMakeLists.txt b/recipes/quaternions/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/quaternions/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/quaternions/all/test_package/conanfile.py b/recipes/quaternions/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/quaternions/all/test_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" + + 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/quaternions/all/test_package/test_package.cpp b/recipes/quaternions/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7029de38a4743 --- /dev/null +++ b/recipes/quaternions/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +#include + +int main () { + quaternion::Quaternion q1(1.0f, 0.0f, 0.0f, 0.0f); + quaternion::Quaternion q2(0.0f, 1.0f, 0.0f, 0.0f); + quaternion::Quaternion q3(0.0f, 0.0f, 1.0f, 0.0f); + auto q4 = q1 * q2 * q3; + std::cout << q4 << std::endl; + return 0; +} diff --git a/recipes/quaternions/config.yml b/recipes/quaternions/config.yml new file mode 100644 index 0000000000000..b984d590a901d --- /dev/null +++ b/recipes/quaternions/config.yml @@ -0,0 +1,3 @@ +versions: + "20160606": + folder: all diff --git a/recipes/quazip/all/conandata.yml b/recipes/quazip/all/conandata.yml new file mode 100644 index 0000000000000..e1e86960ccb10 --- /dev/null +++ b/recipes/quazip/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.4": + url: "https://github.com/stachenov/quazip/archive/v1.4.tar.gz" + sha256: "79633fd3a18e2d11a7d5c40c4c79c1786ba0c74b59ad752e8429746fe1781dd6" + "1.3": + url: "https://github.com/stachenov/quazip/archive/v1.3.tar.gz" + sha256: "c1239559cd6860cab80a0fd81f4204e606f9324f702dab6166b0960676ee1754" + "1.2": + url: "https://github.com/stachenov/quazip/archive/v1.2.tar.gz" + sha256: "2dfb911d6b27545de0b98798d967c40430312377e6ade57096d6ec80c720cb61" + "1.1": + url: "https://github.com/stachenov/quazip/archive/v1.1.tar.gz" + sha256: "54edce9c11371762bd4f0003c2937b5d8806a2752dd9c0fd9085e90792612ad0" +patches: + "1.3": + - patch_file: "patches/1.3-0001-use-cpp17-for-qt6.patch" diff --git a/recipes/quazip/all/conanfile.py b/recipes/quazip/all/conanfile.py new file mode 100644 index 0000000000000..0203b4a63fa9c --- /dev/null +++ b/recipes/quazip/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +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 +import os + +required_conan_version = ">=1.53.0" + + +class QuaZIPConan(ConanFile): + name = "quazip" + description = ( + "A simple C++ wrapper over Gilles Vollant's ZIP/UNZIP package " + "that can be used to access ZIP archives." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/stachenov/quazip" + license = "LGPL-2.1-linking-exception" + topics = ("zip", "unzip", "compress") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _qt_major(self): + return Version(self.dependencies["qt"].ref.version).major + + 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("qt/5.15.9") + self.requires("zlib/1.2.13") + if Version(self.version) >= "1.4": + self.requires("bzip2/1.0.8") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QUAZIP_QT_MAJOR_VERSION"] = self._qt_major + 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() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + quazip_major = Version(self.version).major + self.cpp_info.set_property("cmake_file_name", f"QuaZip-Qt{self._qt_major}") + self.cpp_info.set_property("cmake_target_name", "QuaZip::QuaZip") + self.cpp_info.set_property("pkg_config_name", f"quazip{quazip_major}-qt{self._qt_major}") + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"quazip{quazip_major}-qt{self._qt_major}{suffix}"] + self.cpp_info.includedirs = [os.path.join("include", f"QuaZip-Qt{self._qt_major}-{self.version}")] + if not self.options.shared: + self.cpp_info.defines.append("QUAZIP_STATIC") + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = f"QuaZip-Qt{self._qt_major}" + self.cpp_info.filenames["cmake_find_package_multi"] = f"QuaZip-Qt{self._qt_major}" + self.cpp_info.names["cmake_find_package"] = "QuaZip" + self.cpp_info.names["cmake_find_package_multi"] = "QuaZip" + self.cpp_info.names["pkg_config"] = f"quazip{quazip_major}-qt{self._qt_major}" diff --git a/recipes/quazip/all/patches/1.3-0001-use-cpp17-for-qt6.patch b/recipes/quazip/all/patches/1.3-0001-use-cpp17-for-qt6.patch new file mode 100644 index 0000000000000..6efe02db1fd19 --- /dev/null +++ b/recipes/quazip/all/patches/1.3-0001-use-cpp17-for-qt6.patch @@ -0,0 +1,36 @@ +commit 403fbcb56626551fe911af0c3a5ee2b5122df664 +Author: Sergei Tachenov +Date: Thu Jun 23 21:24:23 2022 +0300 + + Use C++17 for Qt 6 + + Apparently Qt 6 requires C++17 (see #145). But we don't want to + restrict everyone to C++17 just because Qt 6 requires it. So we + set it based on the selected (or auto-selected) Qt version. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3eaf1a..6c7c6c7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 3.15...3.18) + + project(QuaZip VERSION 1.3) + +-set(CMAKE_CXX_STANDARD 14) +- + set(QUAZIP_LIB_VERSION ${QuaZip_VERSION}) + set(QUAZIP_LIB_SOVERSION 1.3.0) + +@@ -34,6 +32,12 @@ endif() + + set(QUAZIP_QT_MAJOR_VERSION ${QT_VERSION_MAJOR} CACHE STRING "Qt version to use (4, 5 or 6), defaults to ${QT_VERSION_MAJOR}") + ++if (QUAZIP_QT_MAJOR_VERSION EQUAL 6) ++ set(CMAKE_CXX_STANDARD 17) ++else() ++ set(CMAKE_CXX_STANDARD 14) ++endif() ++ + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RELEASE) + endif() diff --git a/recipes/quazip/all/test_package/CMakeLists.txt b/recipes/quazip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8479196b3ebe4 --- /dev/null +++ b/recipes/quazip/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(QuaZip-Qt5 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE QuaZip::QuaZip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +# Must compile with "-fPIC" since Qt was built with -reduce-relocations. +target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) diff --git a/recipes/quazip/all/test_package/conanfile.py b/recipes/quazip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..88a043dccbe68 --- /dev/null +++ b/recipes/quazip/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 + + +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): + zipFile_path = os.path.join(self.source_folder, "zipFile.zip") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path + " " + zipFile_path, env="conanrun") diff --git a/recipes/quazip/all/test_package/test_package.cpp b/recipes/quazip/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c50fc0c25450e --- /dev/null +++ b/recipes/quazip/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include +#include + +int main(int argc, char* argv[]) { + + + std::cout << "Quazip test_package" << std::endl; + + const QString path = QString::fromLatin1(argv[1]); + + QuaZip zip(path); + + if (zip.open(QuaZip::mdUnzip)) { + + std::cout << "zipFile opened. It contains the following files:" << std::endl; + + for (bool more = zip.goToFirstFile(); more; more = zip.goToNextFile()) { + std::cout << zip.getCurrentFileName().toUtf8().constData() << std::endl; + } + + if (zip.getZipError() == UNZ_OK) { + // ok, there was no error + } + + } else { + std::cout << "Error opening zipFile" << std::endl; + } + + return 0; +} diff --git a/recipes/quazip/all/test_package/zipFile.zip b/recipes/quazip/all/test_package/zipFile.zip new file mode 100644 index 0000000000000000000000000000000000000000..d0d792b2e33f0d99fe7c4a3b2ead4e967e97834f GIT binary patch literal 347 zcmWIWW@h1H0D;t&7XfAS9ysy<*&xixAj6QHpO=`YS5i?D8p6rI{7#-N9)wFPxEUB( zUNAE-fC-P(oSb}xl8n@%RIUKHap@)B0(x{0{Ne{11;RW)<4RJCOWZPZQsE|Es*s2W zVKfs%GBS%5fGAM`qyuOuBa<96E>}tb4QF6r1mZ1?AQqCFSs`vlGacDDOjjZs=MOXv a)y+T?vA8$Do0Sb@H4_jn1ky`D90mYR>P#~L literal 0 HcmV?d00001 diff --git a/recipes/quazip/all/test_v1_package/CMakeLists.txt b/recipes/quazip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/quazip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/quazip/all/test_v1_package/conanfile.py b/recipes/quazip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..97418087b1f8d --- /dev/null +++ b/recipes/quazip/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +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): + zipFile_path = os.path.join(self.source_folder, "zipFile.zip") + bin_path = os.path.join("bin", "test_package") + self.run(bin_path + " " + zipFile_path, run_environment=True) diff --git a/recipes/quazip/config.yml b/recipes/quazip/config.yml new file mode 100644 index 0000000000000..889c86eb7e377 --- /dev/null +++ b/recipes/quazip/config.yml @@ -0,0 +1,9 @@ +versions: + "1.4": + folder: all + "1.3": + folder: all + "1.2": + folder: all + "1.1": + folder: all diff --git a/recipes/quickfast/all/CMakeLists.txt b/recipes/quickfast/all/CMakeLists.txt new file mode 100644 index 0000000000000..99facf34f7dda --- /dev/null +++ b/recipes/quickfast/all/CMakeLists.txt @@ -0,0 +1,75 @@ +# 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) +project(quickfast CXX) + +include(${PROJECT_BINARY_DIR}/../conanbuildinfo.cmake) +conan_basic_setup() + +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 +) + +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 +) + +add_library(quickfast ${HEADERS} ${SOURCES}) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(quickfast PRIVATE -DQUICKFAST_BUILD_DLL) +else() + target_compile_definitions(quickfast PUBLIC -DQUICKFAST_HAS_DLL=0) +endif() + +target_compile_features(quickfast PUBLIC cxx_std_11) + +target_include_directories(quickfast PUBLIC + source_subfolder/src +) + +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) + +install(TARGETS quickfast + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +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}) +endforeach() diff --git a/recipes/quickfast/all/conandata.yml b/recipes/quickfast/all/conandata.yml new file mode 100644 index 0000000000000..f9690b9e48e93 --- /dev/null +++ b/recipes/quickfast/all/conandata.yml @@ -0,0 +1,14 @@ +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" + "cci.20170314": + - patch_file: "patches/00002-fix-boost-asio.patch" + base_path: "source_subfolder" diff --git a/recipes/quickfast/all/conanfile.py b/recipes/quickfast/all/conanfile.py new file mode 100644 index 0000000000000..c5aa454e68422 --- /dev/null +++ b/recipes/quickfast/all/conanfile.py @@ -0,0 +1,70 @@ +from conans import ConanFile, CMake, tools +import os +import shutil +import glob + + +class QuickfastConan(ConanFile): + name = "quickfast" + 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 + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob("quickfast-*")[0] + os.rename(extracted_dir, self._source_subfolder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "11") + + def build(self): + patches = self.conan_data["patches"][self.version] + for patch in patches: + tools.patch(**patch) + + cmake = self._configure_cmake() + cmake.build(target="quickfast") + + def package(self): + cmake = self._configure_cmake() + 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.includedirs.append(os.path.join("include", "quickfast")) + + if 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 new file mode 100644 index 0000000000000..02dcc3611cf5c --- /dev/null +++ b/recipes/quickfast/all/patches/00001-fix-boost-asio.patch @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000000000..62dc10d507afe --- /dev/null +++ b/recipes/quickfast/all/patches/00002-fix-boost-asio.patch @@ -0,0 +1,42 @@ +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/test_package/CMakeLists.txt b/recipes/quickfast/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05ee1b02f3e86 --- /dev/null +++ b/recipes/quickfast/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test ${PROJECT_SOURCE_DIR}/main.cpp) + +target_link_libraries(test ${CONAN_LIBS}) + +set_property(TARGET test PROPERTY CXX_STANDARD 11) diff --git a/recipes/quickfast/all/test_package/conanfile.py b/recipes/quickfast/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f2cb9b06805b --- /dev/null +++ b/recipes/quickfast/all/test_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" + + 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/all/test_package/main.cpp b/recipes/quickfast/all/test_package/main.cpp new file mode 100644 index 0000000000000..5adcb1b48cd8f --- /dev/null +++ b/recipes/quickfast/all/test_package/main.cpp @@ -0,0 +1,37 @@ +#include "Application/QuickFAST.h" +#include "Codecs/MessageConsumer.h" +#include "Codecs/GenericMessageBuilder.h" + +using namespace QuickFAST; + +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(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 &) + { + } +} diff --git a/recipes/quickfast/config.yml b/recipes/quickfast/config.yml new file mode 100644 index 0000000000000..4aad8295800a6 --- /dev/null +++ b/recipes/quickfast/config.yml @@ -0,0 +1,5 @@ +versions: + "1.5": + folder: all + "cci.20170314": + folder: all diff --git a/recipes/quickfix/all/conandata.yml b/recipes/quickfix/all/conandata.yml new file mode 100644 index 0000000000000..863c20f1e79d6 --- /dev/null +++ b/recipes/quickfix/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "1.15.1": + url: "https://github.com/quickfix/quickfix/archive/v1.15.1.tar.gz" + sha256: "1c4322a68704526ca3d1f213e7b0dcd30e067a8815be2a79b2ab1197ef70dcf7" +patches: + "1.15.1": + - patch_file: "patches/0001-Fix-build-for-C-17-replace-throw-.-with-EXCEPT.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-except-copy.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-fix-condition-for-using-tr1-namespace.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-remove-tests-from-compilatin-unit-performance-and-ac.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch" + base_path: "source_subfolder" + - patch_file: "patches/0006-manage-postgres-through-conan.patch" + base_path: "source_subfolder" + - patch_file: "patches/0007-add-support-to-static-libraries-for-non-windows-buil.patch" + base_path: "source_subfolder" + - patch_file: "patches/0008-manage-mysql-through-conan.patch" + base_path: "source_subfolder" + - patch_file: "patches/0009-downgrade-cmake-minimum-required.patch" + base_path: "source_subfolder" diff --git a/recipes/quickfix/all/conanfile.py b/recipes/quickfix/all/conanfile.py new file mode 100644 index 0000000000000..c5c614561ff61 --- /dev/null +++ b/recipes/quickfix/all/conanfile.py @@ -0,0 +1,103 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class QuickfixConan(ConanFile): + name = "quickfix" + license = "The QuickFIX Software License, Version 1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.quickfixengine.org" + description = "QuickFIX is a free and open source implementation of the FIX protocol" + topics = ("conan", "QuickFIX", "FIX", "Financial Information Exchange", "libraries", "cpp") + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False], + "shared": [True, False], + "with_ssl": [True, False], + "with_postgres": [True, False], + "with_mysql": [None, "libmysqlclient"]} + default_options = {"fPIC": True, + "shared": False, + "with_ssl": False, + "with_postgres": False, + "with_mysql": None} + generators = "cmake" + exports_sources = "patches/**" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + if self.options.with_ssl: + self.requires("openssl/1.1.1q") + + if self.options.with_postgres: + self.requires("libpq/14.2") + + if self.options.with_mysql == "libmysqlclient": + self.requires("libmysqlclient/8.0.29") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("QuickFIX cannot be built as shared lib on Windows") + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("QuickFIX doesn't support ARM compilation") # See issue: https://github.com/quickfix/quickfix/issues/206 + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["HAVE_SSL"] = self.options.with_ssl + self._cmake.definitions["HAVE_POSTGRESQL"] = self.options.with_postgres + self._cmake.definitions["HAVE_MYSQL"] = bool(self.options.with_mysql) + self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + cmake = self._configure_cmake() + cmake.build(target="quickfix") + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("config.h", dst=os.path.join("include", "quickfix"), src=self._build_subfolder) + self.copy("Except.h", dst="include", src=os.path.join(self._source_subfolder, "src", "C++")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + + if self.options.with_ssl: + self.cpp_info.defines.append("HAVE_SSL=1") + + if self.options.with_postgres: + self.cpp_info.defines.append("HAVE_POSTGRESQL=1") + + if self.options.with_mysql: + self.cpp_info.defines.append("HAVE_MYSQL=1") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) diff --git a/recipes/quickfix/all/patches/0001-Fix-build-for-C-17-replace-throw-.-with-EXCEPT.patch b/recipes/quickfix/all/patches/0001-Fix-build-for-C-17-replace-throw-.-with-EXCEPT.patch new file mode 100644 index 0000000000000..5035e0342a541 --- /dev/null +++ b/recipes/quickfix/all/patches/0001-Fix-build-for-C-17-replace-throw-.-with-EXCEPT.patch @@ -0,0 +1,3485 @@ +From 87dd08e223d1b32ee18166cfacbc35ec0f44ccf3 Mon Sep 17 00:00:00 2001 +From: Dmitry Shatilov +Date: Fri, 16 Nov 2018 18:58:01 +0200 +Subject: [PATCH 1/8] Fix build for C++17: replace throw(...) with EXCEPT(...) + +--- + examples/executor/C++/Application.cpp | 6 ++-- + examples/executor/C++/Application.h | 6 ++-- + examples/ordermatch/Application.cpp | 4 +-- + examples/ordermatch/Application.h | 6 ++-- + examples/tradeclient/Application.cpp | 4 +-- + examples/tradeclient/Application.h | 6 ++-- + src/C++/Acceptor.cpp | 12 +++---- + src/C++/Acceptor.h | 16 ++++----- + src/C++/Application.h | 18 +++++----- + src/C++/DataDictionary.cpp | 18 +++++----- + src/C++/DataDictionary.h | 36 +++++++++---------- + src/C++/DataDictionaryProvider.cpp | 4 +-- + src/C++/DataDictionaryProvider.h | 4 +-- + src/C++/Dictionary.cpp | 10 +++--- + src/C++/Dictionary.h | 10 +++--- + src/C++/Except.h | 33 ++++++++++++++++++ + src/C++/Exceptions.h | 4 +-- + src/C++/Field.h | 16 ++++----- + src/C++/FieldConvertors.h | 24 ++++++------- + src/C++/FieldMap.h | 18 +++++----- + src/C++/FileStore.cpp | 24 ++++++------- + src/C++/FileStore.h | 24 ++++++------- + src/C++/Group.cpp | 2 +- + src/C++/Group.h | 2 +- + src/C++/HttpConnection.cpp | 2 +- + src/C++/HttpConnection.h | 2 +- + src/C++/HttpMessage.cpp | 4 +-- + src/C++/HttpMessage.h | 6 ++-- + src/C++/HttpParser.cpp | 2 +- + src/C++/HttpParser.h | 2 +- + src/C++/HttpServer.cpp | 10 +++--- + src/C++/HttpServer.h | 10 +++--- + src/C++/Initiator.cpp | 12 +++---- + src/C++/Initiator.h | 16 ++++----- + src/C++/Message.cpp | 14 ++++---- + src/C++/Message.h | 28 +++++++-------- + src/C++/MessageStore.cpp | 4 +-- + src/C++/MessageStore.h | 46 ++++++++++++------------- + src/C++/MySQLConnection.h | 2 +- + src/C++/MySQLStore.cpp | 22 ++++++------ + src/C++/MySQLStore.h | 22 ++++++------ + src/C++/NullStore.cpp | 4 +-- + src/C++/NullStore.h | 24 ++++++------- + src/C++/OdbcConnection.h | 2 +- + src/C++/OdbcStore.cpp | 22 ++++++------ + src/C++/OdbcStore.h | 22 ++++++------ + src/C++/PUGIXML_DOMDocument.cpp | 2 +- + src/C++/PUGIXML_DOMDocument.h | 2 +- + src/C++/Parser.cpp | 4 +-- + src/C++/Parser.h | 4 +-- + src/C++/PostgreSQLConnection.h | 2 +- + src/C++/PostgreSQLStore.cpp | 22 ++++++------ + src/C++/PostgreSQLStore.h | 22 ++++++------ + src/C++/SSLSocketAcceptor.cpp | 8 ++--- + src/C++/SSLSocketAcceptor.h | 8 ++--- + src/C++/SSLSocketConnection.cpp | 2 +- + src/C++/SSLSocketConnection.h | 2 +- + src/C++/SSLSocketInitiator.cpp | 8 ++--- + src/C++/SSLSocketInitiator.h | 8 ++--- + src/C++/Session.cpp | 10 +++--- + src/C++/Session.h | 18 +++++----- + src/C++/SessionFactory.cpp | 8 ++--- + src/C++/SessionFactory.h | 8 ++--- + src/C++/SessionSettings.cpp | 14 ++++---- + src/C++/SessionSettings.h | 16 ++++----- + src/C++/SessionState.h | 22 ++++++------ + src/C++/SocketAcceptor.cpp | 8 ++--- + src/C++/SocketAcceptor.h | 8 ++--- + src/C++/SocketConnection.cpp | 2 +- + src/C++/SocketConnection.h | 2 +- + src/C++/SocketInitiator.cpp | 8 ++--- + src/C++/SocketInitiator.h | 8 ++--- + src/C++/SocketServer.cpp | 2 +- + src/C++/SocketServer.h | 2 +- + src/C++/ThreadedSSLSocketAcceptor.cpp | 10 +++--- + src/C++/ThreadedSSLSocketAcceptor.h | 8 ++--- + src/C++/ThreadedSSLSocketConnection.cpp | 3 +- + src/C++/ThreadedSSLSocketConnection.h | 2 +- + src/C++/ThreadedSSLSocketInitiator.cpp | 10 +++--- + src/C++/ThreadedSSLSocketInitiator.h | 8 ++--- + src/C++/ThreadedSocketAcceptor.cpp | 8 ++--- + src/C++/ThreadedSocketAcceptor.h | 8 ++--- + src/C++/ThreadedSocketConnection.cpp | 2 +- + src/C++/ThreadedSocketConnection.h | 2 +- + src/C++/ThreadedSocketInitiator.cpp | 8 ++--- + src/C++/ThreadedSocketInitiator.h | 8 ++--- + src/C++/Utility.h | 2 ++ + src/C++/pugixml.cpp | 10 +++--- + src/C++/pugixml.hpp | 1 + + src/C++/test/SessionTestCase.cpp | 6 ++-- + src/C++/test/TestHelper.h | 2 +- + src/at_application.h | 8 ++--- + src/pt.cpp | 2 +- + 93 files changed, 477 insertions(+), 446 deletions(-) + create mode 100644 src/C++/Except.h + +diff --git a/examples/executor/C++/Application.cpp b/examples/executor/C++/Application.cpp +index d67fcc46..b901d6ce 100644 +--- a/examples/executor/C++/Application.cpp ++++ b/examples/executor/C++/Application.cpp +@@ -40,15 +40,15 @@ void Application::toAdmin( FIX::Message& message, + const FIX::SessionID& sessionID ) {} + void Application::toApp( FIX::Message& message, + const FIX::SessionID& sessionID ) +-throw( FIX::DoNotSend ) {} ++EXCEPT( FIX::DoNotSend ) {} + + void Application::fromAdmin( const FIX::Message& message, + const FIX::SessionID& sessionID ) +-throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} ++EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} + + void Application::fromApp( const FIX::Message& message, + const FIX::SessionID& sessionID ) +-throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) ++EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) + { crack( message, sessionID ); } + + void Application::onMessage( const FIX40::NewOrderSingle& message, +diff --git a/examples/executor/C++/Application.h b/examples/executor/C++/Application.h +index 1ccbb42e..9bea5108 100644 +--- a/examples/executor/C++/Application.h ++++ b/examples/executor/C++/Application.h +@@ -47,11 +47,11 @@ public: + void onLogout( const FIX::SessionID& sessionID ); + void toAdmin( FIX::Message&, const FIX::SessionID& ); + void toApp( FIX::Message&, const FIX::SessionID& ) +- throw( FIX::DoNotSend ); ++ EXCEPT( FIX::DoNotSend ); + void fromAdmin( const FIX::Message&, const FIX::SessionID& ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ); ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ); + void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); + + // MessageCracker overloads + void onMessage( const FIX40::NewOrderSingle&, const FIX::SessionID& ); +diff --git a/examples/ordermatch/Application.cpp b/examples/ordermatch/Application.cpp +index 33114187..f7a620ca 100644 +--- a/examples/ordermatch/Application.cpp ++++ b/examples/ordermatch/Application.cpp +@@ -34,7 +34,7 @@ void Application::onLogout( const FIX::SessionID& sessionID ) {} + + void Application::fromApp( const FIX::Message& message, + const FIX::SessionID& sessionID ) +-throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) ++EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) + { + crack( message, sessionID ); + } +@@ -106,7 +106,7 @@ void Application::onMessage( const FIX42::MarketDataRequest& message, const FIX: + message.get( mdReqID ); + message.get( subscriptionRequestType ); + if ( subscriptionRequestType != FIX::SubscriptionRequestType_SNAPSHOT ) +- throw( FIX::IncorrectTagValue( subscriptionRequestType.getField() ) ); ++ EXCEPT( FIX::IncorrectTagValue( subscriptionRequestType.getField() ) ); + message.get( marketDepth ); + message.get( noRelatedSym ); + +diff --git a/examples/ordermatch/Application.h b/examples/ordermatch/Application.h +index b36a7e72..b31a5b76 100644 +--- a/examples/ordermatch/Application.h ++++ b/examples/ordermatch/Application.h +@@ -49,11 +49,11 @@ class Application + void onLogout( const FIX::SessionID& sessionID ); + void toAdmin( FIX::Message&, const FIX::SessionID& ) {} + void toApp( FIX::Message&, const FIX::SessionID& ) +- throw( FIX::DoNotSend ) {} ++ EXCEPT( FIX::DoNotSend ) {} + void fromAdmin( const FIX::Message&, const FIX::SessionID& ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} + void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); + + // MessageCracker overloads + void onMessage( const FIX42::NewOrderSingle&, const FIX::SessionID& ); +diff --git a/examples/tradeclient/Application.cpp b/examples/tradeclient/Application.cpp +index 457f5c7d..c3e93be2 100644 +--- a/examples/tradeclient/Application.cpp ++++ b/examples/tradeclient/Application.cpp +@@ -40,14 +40,14 @@ void Application::onLogout( const FIX::SessionID& sessionID ) + } + + void Application::fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) +-throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) ++EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) + { + crack( message, sessionID ); + std::cout << std::endl << "IN: " << message << std::endl; + } + + void Application::toApp( FIX::Message& message, const FIX::SessionID& sessionID ) +-throw( FIX::DoNotSend ) ++EXCEPT( FIX::DoNotSend ) + { + try + { +diff --git a/examples/tradeclient/Application.h b/examples/tradeclient/Application.h +index cb2172d4..2fae60a6 100644 +--- a/examples/tradeclient/Application.h ++++ b/examples/tradeclient/Application.h +@@ -81,11 +81,11 @@ private: + void onLogout( const FIX::SessionID& sessionID ); + void toAdmin( FIX::Message&, const FIX::SessionID& ) {} + void toApp( FIX::Message&, const FIX::SessionID& ) +- throw( FIX::DoNotSend ); ++ EXCEPT( FIX::DoNotSend ); + void fromAdmin( const FIX::Message&, const FIX::SessionID& ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} + void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); + + void onMessage( const FIX40::ExecutionReport&, const FIX::SessionID& ); + void onMessage( const FIX40::OrderCancelReject&, const FIX::SessionID& ); +diff --git a/src/C++/Acceptor.cpp b/src/C++/Acceptor.cpp +index b4235084..fab49fb4 100644 +--- a/src/C++/Acceptor.cpp ++++ b/src/C++/Acceptor.cpp +@@ -36,7 +36,7 @@ namespace FIX + Acceptor::Acceptor( Application& application, + MessageStoreFactory& messageStoreFactory, + const SessionSettings& settings ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : m_threadid( 0 ), + m_application( application ), + m_messageStoreFactory( messageStoreFactory ), +@@ -53,7 +53,7 @@ Acceptor::Acceptor( Application& application, + MessageStoreFactory& messageStoreFactory, + const SessionSettings& settings, + LogFactory& logFactory ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : m_threadid( 0 ), + m_application( application ), + m_messageStoreFactory( messageStoreFactory ), +@@ -66,7 +66,7 @@ throw( ConfigError ) + initialize(); + } + +-void Acceptor::initialize() throw ( ConfigError ) ++void Acceptor::initialize() EXCEPT ( ConfigError ) + { + std::set < SessionID > sessions = m_settings.getSessions(); + std::set < SessionID > ::iterator i; +@@ -155,7 +155,7 @@ const Dictionary* const Acceptor::getSessionSettings( const SessionID& sessionID + } + } + +-void Acceptor::start() throw ( ConfigError, RuntimeError ) ++void Acceptor::start() EXCEPT ( ConfigError, RuntimeError ) + { + m_stop = false; + onConfigure( m_settings ); +@@ -167,7 +167,7 @@ void Acceptor::start() throw ( ConfigError, RuntimeError ) + throw RuntimeError("Unable to spawn thread"); + } + +-void Acceptor::block() throw ( ConfigError, RuntimeError ) ++void Acceptor::block() EXCEPT ( ConfigError, RuntimeError ) + { + m_stop = false; + onConfigure( m_settings ); +@@ -176,7 +176,7 @@ void Acceptor::block() throw ( ConfigError, RuntimeError ) + startThread(this); + } + +-bool Acceptor::poll( double timeout ) throw ( ConfigError, RuntimeError ) ++bool Acceptor::poll( double timeout ) EXCEPT ( ConfigError, RuntimeError ) + { + if( m_firstPoll ) + { +diff --git a/src/C++/Acceptor.h b/src/C++/Acceptor.h +index 30b23dce..eac5245e 100644 +--- a/src/C++/Acceptor.h ++++ b/src/C++/Acceptor.h +@@ -50,9 +50,9 @@ class Acceptor + { + public: + Acceptor( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + Acceptor( Application&, MessageStoreFactory&, +- const SessionSettings&, LogFactory& ) throw( ConfigError ); ++ const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~Acceptor(); + +@@ -63,11 +63,11 @@ public: + } + + /// Start acceptor. +- void start() throw ( ConfigError, RuntimeError ); ++ void start() EXCEPT ( ConfigError, RuntimeError ); + /// Block on the acceptor +- void block() throw ( ConfigError, RuntimeError ); ++ void block() EXCEPT ( ConfigError, RuntimeError ); + /// Poll the acceptor +- bool poll( double timeout = 0.0 ) throw ( ConfigError, RuntimeError ); ++ bool poll( double timeout = 0.0 ) EXCEPT ( ConfigError, RuntimeError ); + + /// Stop acceptor. + void stop( bool force = false ); +@@ -91,12 +91,12 @@ public: + { return m_messageStoreFactory; } + + private: +- void initialize() throw ( ConfigError ); ++ void initialize() EXCEPT ( ConfigError ); + + /// Implemented to configure acceptor +- virtual void onConfigure( const SessionSettings& ) throw ( ConfigError ) {}; ++ virtual void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ) {}; + /// Implemented to initialize acceptor +- virtual void onInitialize( const SessionSettings& ) throw ( RuntimeError ) {}; ++ virtual void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ) {}; + /// Implemented to start listening for connections. + virtual void onStart() = 0; + /// Implemented to connect and poll for events. +diff --git a/src/C++/Application.h b/src/C++/Application.h +index d53ab0af..eb8a2d6d 100644 +--- a/src/C++/Application.h ++++ b/src/C++/Application.h +@@ -54,13 +54,13 @@ public: + virtual void toAdmin( Message&, const SessionID& ) = 0; + /// Notification of app message being sent to target + virtual void toApp( Message&, const SessionID& ) +- throw( DoNotSend ) = 0; ++ EXCEPT ( DoNotSend ) = 0; + /// Notification of admin message being received from target + virtual void fromAdmin( const Message&, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) = 0; ++ EXCEPT ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) = 0; + /// Notification of app message being received from target + virtual void fromApp( const Message&, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) = 0; ++ EXCEPT ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) = 0; + }; + + /** +@@ -87,13 +87,13 @@ public: + void toAdmin( Message& message, const SessionID& sessionID ) + { Locker l( m_mutex ); app().toAdmin( message, sessionID ); } + void toApp( Message& message, const SessionID& sessionID ) +- throw( DoNotSend ) ++ EXCEPT ( DoNotSend ) + { Locker l( m_mutex ); app().toApp( message, sessionID ); } + void fromAdmin( const Message& message, const SessionID& sessionID ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) ++ EXCEPT ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) + { Locker l( m_mutex ); app().fromAdmin( message, sessionID ); } + void fromApp( const Message& message, const SessionID& sessionID ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) ++ EXCEPT ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) + { Locker l( m_mutex ); app().fromApp( message, sessionID ); } + + Mutex m_mutex; +@@ -115,11 +115,11 @@ class NullApplication : public Application + void onLogout( const SessionID& ) {} + void toAdmin( Message&, const SessionID& ) {} + void toApp( Message&, const SessionID& ) +- throw( DoNotSend ) {} ++ EXCEPT ( DoNotSend ) {} + void fromAdmin( const Message&, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) {} ++ EXCEPT ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) {} + void fromApp( const Message&, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) {} ++ EXCEPT ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) {} + }; + /*! @} */ + } +diff --git a/src/C++/DataDictionary.cpp b/src/C++/DataDictionary.cpp +index 09aaa538..ce6d089c 100644 +--- a/src/C++/DataDictionary.cpp ++++ b/src/C++/DataDictionary.cpp +@@ -44,7 +44,7 @@ DataDictionary::DataDictionary() + {} + + DataDictionary::DataDictionary( std::istream& stream, bool preserveMsgFldsOrder ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : m_hasVersion( false ), m_checkFieldsOutOfOrder( true ), + m_checkFieldsHaveValues( true ), m_checkUserDefinedFields( true ), m_allowUnknownMessageFields( false ), m_storeMsgFieldsOrder(preserveMsgFldsOrder) + { +@@ -52,7 +52,7 @@ throw( ConfigError ) + } + + DataDictionary::DataDictionary( const std::string& url, bool preserveMsgFldsOrder ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : m_hasVersion( false ), m_checkFieldsOutOfOrder( true ), + m_checkFieldsHaveValues( true ), m_checkUserDefinedFields( true ), m_allowUnknownMessageFields( false ), m_storeMsgFieldsOrder(preserveMsgFldsOrder), m_orderedFieldsArray(0) + { +@@ -123,7 +123,7 @@ DataDictionary& DataDictionary::operator=( const DataDictionary& rhs ) + void DataDictionary::validate( const Message& message, + const DataDictionary* const pSessionDD, + const DataDictionary* const pAppDD ) +-throw( FIX::Exception ) ++EXCEPT ( FIX::Exception ) + { + const Header& header = message.getHeader(); + const BeginString& beginString = FIELD_GET_REF( header, BeginString ); +@@ -203,7 +203,7 @@ void DataDictionary::iterate( const FieldMap& map, const MsgType& msgType ) cons + } + + void DataDictionary::readFromURL( const std::string& url ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + DOMDocumentPtr pDoc(new PUGIXML_DOMDocument()); + +@@ -221,7 +221,7 @@ throw( ConfigError ) + } + + void DataDictionary::readFromStream( std::istream& stream ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + DOMDocumentPtr pDoc(new PUGIXML_DOMDocument()); + +@@ -232,7 +232,7 @@ throw( ConfigError ) + } + + void DataDictionary::readFromDocument( const DOMDocumentPtr &pDoc ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + // VERSION + DOMNodePtr pFixNode = pDoc->getNode("/fix"); +@@ -455,7 +455,7 @@ message_order const& DataDictionary::getOrderedFields() const + return m_orderedFieldsArray; + } + +-message_order const& DataDictionary::getHeaderOrderedFields() const throw( ConfigError ) ++message_order const& DataDictionary::getHeaderOrderedFields() const EXCEPT ( ConfigError ) + { + if( m_headerOrder ) return m_headerOrder; + +@@ -475,7 +475,7 @@ message_order const& DataDictionary::getHeaderOrderedFields() const throw( Confi + return m_headerOrder; + } + +-message_order const& DataDictionary::getTrailerOrderedFields() const throw( ConfigError ) ++message_order const& DataDictionary::getTrailerOrderedFields() const EXCEPT ( ConfigError ) + { + if( m_trailerOrder ) return m_trailerOrder; + +@@ -495,7 +495,7 @@ message_order const& DataDictionary::getTrailerOrderedFields() const throw( Conf + return m_trailerOrder; + } + +-const message_order &DataDictionary::getMessageOrderedFields(const std::string & msgType) const throw( ConfigError ) ++const message_order &DataDictionary::getMessageOrderedFields(const std::string & msgType) const EXCEPT ( ConfigError ) + { + MsgTypeToOrderedFields::const_iterator iter = m_messageOrderedFields.find(msgType); + if (iter == m_messageOrderedFields.end()) +diff --git a/src/C++/DataDictionary.h b/src/C++/DataDictionary.h +index 323ef53e..64c03d2e 100644 +--- a/src/C++/DataDictionary.h ++++ b/src/C++/DataDictionary.h +@@ -112,18 +112,18 @@ class DataDictionary + public: + DataDictionary(); + DataDictionary( const DataDictionary& copy ); +- DataDictionary(std::istream& stream , bool preserveMsgFldsOrder = false) throw( ConfigError ); +- DataDictionary(const std::string& url , bool preserveMsgFldsOrder = false) throw( ConfigError ); ++ DataDictionary(std::istream& stream , bool preserveMsgFldsOrder = false) EXCEPT ( ConfigError ); ++ DataDictionary(const std::string& url , bool preserveMsgFldsOrder = false) EXCEPT ( ConfigError ); + virtual ~DataDictionary(); + +- void readFromURL( const std::string& url ) throw( ConfigError ); +- void readFromDocument( const DOMDocumentPtr &pDoc ) throw( ConfigError ); +- void readFromStream( std::istream& stream ) throw( ConfigError ); ++ void readFromURL( const std::string& url ) EXCEPT ( ConfigError ); ++ void readFromDocument( const DOMDocumentPtr &pDoc ) EXCEPT ( ConfigError ); ++ void readFromStream( std::istream& stream ) EXCEPT ( ConfigError ); + + message_order const& getOrderedFields() const; +- message_order const& getHeaderOrderedFields() const throw( ConfigError ); +- message_order const& getTrailerOrderedFields() const throw( ConfigError ); +- message_order const& getMessageOrderedFields(const std::string & msgType) const throw( ConfigError ); ++ message_order const& getHeaderOrderedFields() const EXCEPT ( ConfigError ); ++ message_order const& getTrailerOrderedFields() const EXCEPT ( ConfigError ); ++ message_order const& getMessageOrderedFields(const std::string & msgType) const EXCEPT ( ConfigError ); + + // storage functions + void setVersion( const std::string& beginString ) +@@ -371,11 +371,11 @@ public: + /// Validate a message. + static void validate( const Message& message, + const DataDictionary* const pSessionDD, +- const DataDictionary* const pAppID ) throw( FIX::Exception ); ++ const DataDictionary* const pAppID ) EXCEPT ( FIX::Exception ); + +- void validate( const Message& message ) const throw ( FIX::Exception ) ++ void validate( const Message& message ) const EXCEPT ( FIX::Exception ) + { validate( message, false ); } +- void validate( const Message& message, bool bodyOnly ) const throw( FIX::Exception ) ++ void validate( const Message& message, bool bodyOnly ) const EXCEPT ( FIX::Exception ) + { validate( message, bodyOnly ? (DataDictionary*)0 : this, this ); } + + DataDictionary& operator=( const DataDictionary& rhs ); +@@ -404,14 +404,14 @@ private: + + /// Check if field tag number is defined in spec. + void checkValidTagNumber( const FieldBase& field ) const +- throw( InvalidTagNumber ) ++ EXCEPT ( InvalidTagNumber ) + { + if( m_fields.find( field.getTag() ) == m_fields.end() ) + throw InvalidTagNumber( field.getTag() ); + } + + void checkValidFormat( const FieldBase& field ) const +- throw( IncorrectDataFormat ) ++ EXCEPT ( IncorrectDataFormat ) + { + try + { +@@ -487,7 +487,7 @@ private: + } + + void checkValue( const FieldBase& field ) const +- throw( IncorrectTagValue ) ++ EXCEPT ( IncorrectTagValue ) + { + if ( !hasFieldValue( field.getTag() ) ) return ; + +@@ -498,7 +498,7 @@ private: + + /// Check if a field has a value. + void checkHasValue( const FieldBase& field ) const +- throw( NoTagValue ) ++ EXCEPT ( NoTagValue ) + { + if ( m_checkFieldsHaveValues && !field.getString().length() ) + throw NoTagValue( field.getTag() ); +@@ -507,7 +507,7 @@ private: + /// Check if a field is in this message type. + void checkIsInMessage + ( const FieldBase& field, const MsgType& msgType ) const +- throw( TagNotDefinedForMessage ) ++ EXCEPT ( TagNotDefinedForMessage ) + { + if ( !isMsgField( msgType, field.getTag() ) ) + throw TagNotDefinedForMessage( field.getTag() ); +@@ -516,7 +516,7 @@ private: + /// Check if group count matches number of groups in + void checkGroupCount + ( const FieldBase& field, const FieldMap& fieldMap, const MsgType& msgType ) const +- throw( RepeatingGroupCountMismatch ) ++ EXCEPT ( RepeatingGroupCountMismatch ) + { + int fieldNum = field.getTag(); + if( isGroup(msgType, fieldNum) ) +@@ -531,7 +531,7 @@ private: + void checkHasRequired + ( const FieldMap& header, const FieldMap& body, const FieldMap& trailer, + const MsgType& msgType ) const +- throw( RequiredTagMissing ) ++ EXCEPT ( RequiredTagMissing ) + { + NonBodyFields::const_iterator iNBF; + for( iNBF = m_headerFields.begin(); iNBF != m_headerFields.end(); ++iNBF ) +diff --git a/src/C++/DataDictionaryProvider.cpp b/src/C++/DataDictionaryProvider.cpp +index 20aa0f82..5d6bf629 100644 +--- a/src/C++/DataDictionaryProvider.cpp ++++ b/src/C++/DataDictionaryProvider.cpp +@@ -35,7 +35,7 @@ DataDictionaryProvider::DataDictionaryProvider( const DataDictionaryProvider& co + } + + const DataDictionary& DataDictionaryProvider::getSessionDataDictionary +-(const BeginString& beginString) const throw( DataDictionaryNotFound ) ++(const BeginString& beginString) const EXCEPT ( DataDictionaryNotFound ) + { + std::map >::const_iterator find = + m_transportDictionaries.find(beginString); +@@ -46,7 +46,7 @@ const DataDictionary& DataDictionaryProvider::getSessionDataDictionary + } + + const DataDictionary& DataDictionaryProvider::getApplicationDataDictionary +-(const ApplVerID& applVerID) const throw( DataDictionaryNotFound ) ++(const ApplVerID& applVerID) const EXCEPT ( DataDictionaryNotFound ) + { + std::map >::const_iterator find = + m_applicationDictionaries.find(applVerID); +diff --git a/src/C++/DataDictionaryProvider.h b/src/C++/DataDictionaryProvider.h +index bd88aa40..de90379e 100644 +--- a/src/C++/DataDictionaryProvider.h ++++ b/src/C++/DataDictionaryProvider.h +@@ -46,10 +46,10 @@ public: + DataDictionaryProvider( const DataDictionaryProvider& copy ); + + const DataDictionary& getSessionDataDictionary(const BeginString& beginString) const +- throw( DataDictionaryNotFound ); ++ EXCEPT ( DataDictionaryNotFound ); + + const DataDictionary& getApplicationDataDictionary(const ApplVerID& applVerID) const +- throw( DataDictionaryNotFound ); ++ EXCEPT ( DataDictionaryNotFound ); + + void addTransportDataDictionary(const BeginString& beginString, ptr::shared_ptr); + void addApplicationDataDictionary(const ApplVerID& applVerID, ptr::shared_ptr); +diff --git a/src/C++/Dictionary.cpp b/src/C++/Dictionary.cpp +index 6469a5ba..9ff91eca 100644 +--- a/src/C++/Dictionary.cpp ++++ b/src/C++/Dictionary.cpp +@@ -30,7 +30,7 @@ + namespace FIX + { + std::string Dictionary::getString( const std::string& key, bool capitalize ) const +-throw( ConfigError, FieldConvertError ) ++EXCEPT ( ConfigError, FieldConvertError ) + { + Data::const_iterator i = m_data.find( string_toUpper(key) ); + if ( i == m_data.end() ) throw ConfigError( key + " not defined" ); +@@ -43,7 +43,7 @@ throw( ConfigError, FieldConvertError ) + } + + int Dictionary::getInt( const std::string& key ) const +-throw( ConfigError, FieldConvertError ) ++EXCEPT ( ConfigError, FieldConvertError ) + { + try + { +@@ -56,7 +56,7 @@ throw( ConfigError, FieldConvertError ) + } + + double Dictionary::getDouble( const std::string& key ) const +-throw( ConfigError, FieldConvertError ) ++EXCEPT ( ConfigError, FieldConvertError ) + { + try + { +@@ -69,7 +69,7 @@ throw( ConfigError, FieldConvertError ) + } + + bool Dictionary::getBool( const std::string& key ) const +-throw( ConfigError, FieldConvertError ) ++EXCEPT ( ConfigError, FieldConvertError ) + { + try + { +@@ -82,7 +82,7 @@ throw( ConfigError, FieldConvertError ) + } + + int Dictionary::getDay( const std::string& key ) const +-throw( ConfigError, FieldConvertError ) ++EXCEPT ( ConfigError, FieldConvertError ) + { + try + { +diff --git a/src/C++/Dictionary.h b/src/C++/Dictionary.h +index e043b03d..60a0e429 100644 +--- a/src/C++/Dictionary.h ++++ b/src/C++/Dictionary.h +@@ -51,19 +51,19 @@ public: + + /// Get a value as a string. + std::string getString( const std::string&, bool capitalize = false ) const +- throw( ConfigError, FieldConvertError ); ++ EXCEPT ( ConfigError, FieldConvertError ); + /// Get a value as a int. + int getInt( const std::string& ) const +- throw( ConfigError, FieldConvertError ); ++ EXCEPT ( ConfigError, FieldConvertError ); + /// Get a value as a double. + double getDouble( const std::string& ) const +- throw( ConfigError, FieldConvertError ); ++ EXCEPT ( ConfigError, FieldConvertError ); + /// Get a value as a bool + bool getBool( const std::string& ) const +- throw( ConfigError, FieldConvertError ); ++ EXCEPT ( ConfigError, FieldConvertError ); + /// Get a value as a day of week + int getDay( const std::string& ) const +- throw( ConfigError, FieldConvertError ); ++ EXCEPT ( ConfigError, FieldConvertError ); + + /// Set a value from a string. + void setString( const std::string&, const std::string& ); +diff --git a/src/C++/Except.h b/src/C++/Except.h +new file mode 100644 +index 00000000..fded28eb +--- /dev/null ++++ b/src/C++/Except.h +@@ -0,0 +1,33 @@ ++/* -*- C++ -*- */ ++ ++/**************************************************************************** ++** Copyright (c) 2001-2014 ++** ++** This file is part of the QuickFIX FIX Engine ++** ++** This file may be distributed under the terms of the quickfixengine.org ++** license as defined by quickfixengine.org and appearing in the file ++** LICENSE included in the packaging of this file. ++** ++** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ++** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++** ++** See http://www.quickfixengine.org/LICENSE for licensing information. ++** ++** Contact ask@quickfixengine.org if any conditions of this licensing are ++** not clear to you. ++** ++****************************************************************************/ ++ ++#ifndef FIX_EXCEPT_H ++#define FIX_EXCEPT_H ++ ++#ifdef __cpp_noexcept_function_type ++#define NOEXCEPT noexcept ++#define EXCEPT(...) noexcept(false) ++#else ++#define NOEXCEPT throw() ++#define EXCEPT(...) throw(__VA_ARGS__) ++#endif ++ ++#endif +diff --git a/src/C++/Exceptions.h b/src/C++/Exceptions.h +index b8ebb4ba..2dc4b50a 100644 +--- a/src/C++/Exceptions.h ++++ b/src/C++/Exceptions.h +@@ -36,7 +36,7 @@ struct Exception : public std::logic_error + : std::logic_error( d.size() ? t + ": " + d : t ), + type( t ), detail( d ) + {} +- ~Exception() throw() {} ++ ~Exception() NOEXCEPT {} + + std::string type; + std::string detail; +@@ -48,7 +48,7 @@ struct DataDictionaryNotFound : public Exception + DataDictionaryNotFound( const std::string& v, const std::string& what = "" ) + : Exception( "Could not find data dictionary", what ), + version( v ) {} +- ~DataDictionaryNotFound() throw() {} ++ ~DataDictionaryNotFound() NOEXCEPT {} + + std::string version; + }; +diff --git a/src/C++/Field.h b/src/C++/Field.h +index 6df7129c..cc0505c3 100644 +--- a/src/C++/Field.h ++++ b/src/C++/Field.h +@@ -370,7 +370,7 @@ public: + + void setValue( char value ) + { setString( CharConvertor::convert( value ) ); } +- char getValue() const throw ( IncorrectDataFormat ) ++ char getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return CharConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -390,7 +390,7 @@ public: + + void setValue( double value, int padding = 0 ) + { setString( DoubleConvertor::convert( value, padding ) ); } +- double getValue() const throw ( IncorrectDataFormat ) ++ double getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return DoubleConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -410,7 +410,7 @@ public: + + void setValue( int value ) + { setString( IntConvertor::convert( value ) ); } +- int getValue() const throw ( IncorrectDataFormat ) ++ int getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return IntConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -430,7 +430,7 @@ public: + + void setValue( bool value ) + { setString( BoolConvertor::convert( value ) ); } +- bool getValue() const throw ( IncorrectDataFormat ) ++ bool getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return BoolConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -450,7 +450,7 @@ public: + + void setValue( const UtcTimeStamp& value ) + { setString( UtcTimeStampConvertor::convert( value ) ); } +- UtcTimeStamp getValue() const throw ( IncorrectDataFormat ) ++ UtcTimeStamp getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return UtcTimeStampConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -477,7 +477,7 @@ public: + + void setValue( const UtcDate& value ) + { setString( UtcDateConvertor::convert( value ) ); } +- UtcDate getValue() const throw ( IncorrectDataFormat ) ++ UtcDate getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return UtcDateConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -504,7 +504,7 @@ public: + + void setValue( const UtcTimeOnly& value ) + { setString( UtcTimeOnlyConvertor::convert( value ) ); } +- UtcTimeOnly getValue() const throw ( IncorrectDataFormat ) ++ UtcTimeOnly getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return UtcTimeOnlyConvertor::convert( getString() ); } + catch( FieldConvertError& ) +@@ -531,7 +531,7 @@ public: + + void setValue( int value ) + { setString( CheckSumConvertor::convert( value ) ); } +- int getValue() const throw ( IncorrectDataFormat ) ++ int getValue() const EXCEPT ( IncorrectDataFormat ) + { try + { return CheckSumConvertor::convert( getString() ); } + catch( FieldConvertError& ) +diff --git a/src/C++/FieldConvertors.h b/src/C++/FieldConvertors.h +index 14971e9a..9a8915db 100644 +--- a/src/C++/FieldConvertors.h ++++ b/src/C++/FieldConvertors.h +@@ -198,7 +198,7 @@ struct IntConvertor + } + + static signed_int convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + signed_int result = 0; + if( !convert( value.begin(), value.end(), result ) ) +@@ -212,7 +212,7 @@ struct IntConvertor + struct CheckSumConvertor + { + static std::string convert( int value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + if ( value > 255 || value < 0 ) throw FieldConvertError(); + char result[3]; +@@ -229,7 +229,7 @@ struct CheckSumConvertor + } + + static int convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + return IntConvertor::convert( value ); + } +@@ -358,7 +358,7 @@ static bool convert( const std::string& value, double& result ) + } + + static double convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + double result = 0.0; + if( !convert( value, result ) ) +@@ -385,7 +385,7 @@ struct CharConvertor + } + + static char convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + char result = '\0'; + if( !convert( value, result ) ) +@@ -418,7 +418,7 @@ struct BoolConvertor + } + + static bool convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + bool result = false; + if( !convert( value, result ) ) +@@ -433,7 +433,7 @@ struct UtcTimeStampConvertor + { + static std::string convert( const UtcTimeStamp& value, + int precision = 0 ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + char result[ 17+10 ]; // Maximum + int year, month, day, hour, minute, second, fraction; +@@ -465,7 +465,7 @@ struct UtcTimeStampConvertor + } + + static UtcTimeStamp convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + size_t len = value.size(); + if (len < 17 || len > 27) throw FieldConvertError(value); +@@ -547,7 +547,7 @@ struct UtcTimeOnlyConvertor + { + static std::string convert( const UtcTimeOnly& value, + int precision = 0 ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + char result[ 8+10 ]; // Maximum + int hour, minute, second, fraction; +@@ -572,7 +572,7 @@ struct UtcTimeOnlyConvertor + } + + static UtcTimeOnly convert( const std::string& value) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + size_t len = value.size(); + if (len < 8 || len > 18) throw FieldConvertError(value); +@@ -633,7 +633,7 @@ struct UtcTimeOnlyConvertor + struct UtcDateConvertor + { + static std::string convert( const UtcDate& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + int year, month, day; + value.getYMD( year, month, day ); +@@ -648,7 +648,7 @@ struct UtcDateConvertor + } + + static UtcDate convert( const std::string& value ) +- throw( FieldConvertError ) ++ EXCEPT ( FieldConvertError ) + { + if( value.size() != 8 ) throw FieldConvertError(value); + +diff --git a/src/C++/FieldMap.h b/src/C++/FieldMap.h +index 9fb09967..b01b7401 100644 +--- a/src/C++/FieldMap.h ++++ b/src/C++/FieldMap.h +@@ -114,7 +114,7 @@ public: + + /// Set a field without type checking + void setField( const FieldBase& field, bool overwrite = true ) +- throw( RepeatedTag ) ++ EXCEPT ( RepeatedTag ) + { + if( !overwrite ) + { +@@ -136,7 +136,7 @@ public: + + /// Set a field without a field class + void setField( int tag, const std::string& value ) +- throw( RepeatedTag, NoTagValue ) ++ EXCEPT ( RepeatedTag, NoTagValue ) + { + FieldBase fieldBase( tag, value ); + setField( fieldBase ); +@@ -154,7 +154,7 @@ public: + + /// Get a field without type checking + FieldBase& getField( FieldBase& field ) +- const throw( FieldNotFound ) ++ const EXCEPT ( FieldNotFound ) + { + field = getFieldRef( field.getTag() ); + return field; +@@ -162,14 +162,14 @@ public: + + /// Get a field without a field class + const std::string& getField( int tag ) +- const throw( FieldNotFound ) ++ const EXCEPT ( FieldNotFound ) + { + return getFieldRef( tag ).getString(); + } + + /// Get direct access to a field through a reference + const FieldBase& getFieldRef( int tag ) +- const throw( FieldNotFound ) ++ const EXCEPT ( FieldNotFound ) + { + Fields::const_iterator iter = findTag( tag ); + if ( iter == m_fields.end() ) +@@ -179,7 +179,7 @@ public: + + /// Get direct access to a field through a pointer + const FieldBase* const getFieldPtr( int tag ) +- const throw( FieldNotFound ) ++ const EXCEPT ( FieldNotFound ) + { + return &getFieldRef( tag ); + } +@@ -205,14 +205,14 @@ public: + + /// Get a specific instance of a group. + FieldMap& getGroup( int num, int tag, FieldMap& group ) const +- throw( FieldNotFound ) ++ EXCEPT ( FieldNotFound ) + { + return group = getGroupRef( num, tag ); + } + + /// Get direct access to a field through a reference + FieldMap& getGroupRef( int num, int tag ) const +- throw( FieldNotFound ) ++ EXCEPT ( FieldNotFound ) + { + Groups::const_iterator i = m_groups.find( tag ); + if( i == m_groups.end() ) throw FieldNotFound( tag ); +@@ -223,7 +223,7 @@ public: + + /// Get direct access to a field through a pointer + FieldMap* getGroupPtr( int num, int tag ) const +- throw( FieldNotFound ) ++ EXCEPT ( FieldNotFound ) + { + return &getGroupRef( num, tag ); + } +diff --git a/src/C++/FileStore.cpp b/src/C++/FileStore.cpp +index 3fc814c3..90cce65c 100644 +--- a/src/C++/FileStore.cpp ++++ b/src/C++/FileStore.cpp +@@ -190,7 +190,7 @@ void FileStoreFactory::destroy( MessageStore* pStore ) + } + + bool FileStore::set( int msgSeqNum, const std::string& msg ) +-throw ( IOException ) ++EXCEPT ( IOException ) + { + if ( fseek( m_msgFile, 0, SEEK_END ) ) + throw IOException( "Cannot seek to end of " + m_msgFileName ); +@@ -222,7 +222,7 @@ throw ( IOException ) + + void FileStore::get( int begin, int end, + std::vector < std::string > & result ) const +-throw ( IOException ) ++EXCEPT ( IOException ) + { + result.clear(); + std::string msg; +@@ -233,46 +233,46 @@ throw ( IOException ) + } + } + +-int FileStore::getNextSenderMsgSeqNum() const throw ( IOException ) ++int FileStore::getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextSenderMsgSeqNum(); + } + +-int FileStore::getNextTargetMsgSeqNum() const throw ( IOException ) ++int FileStore::getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextTargetMsgSeqNum(); + } + +-void FileStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) ++void FileStore::setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ) + { + m_cache.setNextSenderMsgSeqNum( value ); + setSeqNum(); + } + +-void FileStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) ++void FileStore::setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ) + { + m_cache.setNextTargetMsgSeqNum( value ); + setSeqNum(); + } + +-void FileStore::incrNextSenderMsgSeqNum() throw ( IOException ) ++void FileStore::incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextSenderMsgSeqNum(); + setSeqNum(); + } + +-void FileStore::incrNextTargetMsgSeqNum() throw ( IOException ) ++void FileStore::incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextTargetMsgSeqNum(); + setSeqNum(); + } + +-UtcTimeStamp FileStore::getCreationTime() const throw ( IOException ) ++UtcTimeStamp FileStore::getCreationTime() const EXCEPT ( IOException ) + { + return m_cache.getCreationTime(); + } + +-void FileStore::reset() throw ( IOException ) ++void FileStore::reset() EXCEPT ( IOException ) + { + try + { +@@ -286,7 +286,7 @@ void FileStore::reset() throw ( IOException ) + } + } + +-void FileStore::refresh() throw ( IOException ) ++void FileStore::refresh() EXCEPT ( IOException ) + { + try + { +@@ -322,7 +322,7 @@ void FileStore::setSession() + } + + bool FileStore::get( int msgSeqNum, std::string& msg ) const +-throw ( IOException ) ++EXCEPT ( IOException ) + { + NumToOffset::const_iterator find = m_offsets.find( msgSeqNum ); + if ( find == m_offsets.end() ) return false; +diff --git a/src/C++/FileStore.h b/src/C++/FileStore.h +index e5e60522..868a8195 100644 +--- a/src/C++/FileStore.h ++++ b/src/C++/FileStore.h +@@ -84,20 +84,20 @@ public: + FileStore( std::string, const SessionID& s ); + virtual ~FileStore(); + +- bool set( int, const std::string& ) throw ( IOException ); +- void get( int, int, std::vector < std::string > & ) const throw ( IOException ); ++ bool set( int, const std::string& ) EXCEPT ( IOException ); ++ void get( int, int, std::vector < std::string > & ) const EXCEPT ( IOException ); + +- int getNextSenderMsgSeqNum() const throw ( IOException ); +- int getNextTargetMsgSeqNum() const throw ( IOException ); +- void setNextSenderMsgSeqNum( int value ) throw ( IOException ); +- void setNextTargetMsgSeqNum( int value ) throw ( IOException ); +- void incrNextSenderMsgSeqNum() throw ( IOException ); +- void incrNextTargetMsgSeqNum() throw ( IOException ); ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ); ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ); ++ void setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ); ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ); + +- UtcTimeStamp getCreationTime() const throw ( IOException ); ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ); + +- void reset() throw ( IOException ); +- void refresh() throw ( IOException ); ++ void reset() EXCEPT ( IOException ); ++ void refresh() EXCEPT ( IOException ); + + private: + #ifdef _MSC_VER +@@ -113,7 +113,7 @@ private: + void setSeqNum(); + void setSession(); + +- bool get( int, std::string& ) const throw ( IOException ); ++ bool get( int, std::string& ) const EXCEPT ( IOException ); + + MemoryStore m_cache; + NumToOffset m_offsets; +diff --git a/src/C++/Group.cpp b/src/C++/Group.cpp +index 9703f832..46edeee0 100644 +--- a/src/C++/Group.cpp ++++ b/src/C++/Group.cpp +@@ -37,7 +37,7 @@ void Group::replaceGroup( unsigned num, const FIX::Group& group ) + FieldMap::replaceGroup( num, group.field(), group ); + } + +-Group& Group::getGroup( unsigned num, Group& group ) const throw( FieldNotFound ) ++Group& Group::getGroup( unsigned num, Group& group ) const EXCEPT ( FieldNotFound ) + { + return static_cast < Group& > ( FieldMap::getGroup( num, group.field(), group ) ); + } +diff --git a/src/C++/Group.h b/src/C++/Group.h +index 64111dc8..74c38795 100644 +--- a/src/C++/Group.h ++++ b/src/C++/Group.h +@@ -58,7 +58,7 @@ public: + + void addGroup( const Group& group ); + void replaceGroup( unsigned num, const Group& group ); +- Group& getGroup( unsigned num, Group& group ) const throw( FieldNotFound ); ++ Group& getGroup( unsigned num, Group& group ) const EXCEPT ( FieldNotFound ); + void removeGroup( unsigned num, const Group& group ); + void removeGroup( const Group& group ); + bool hasGroup( const Group& group ); +diff --git a/src/C++/HttpConnection.cpp b/src/C++/HttpConnection.cpp +index 4cefc438..492636cc 100644 +--- a/src/C++/HttpConnection.cpp ++++ b/src/C++/HttpConnection.cpp +@@ -91,7 +91,7 @@ bool HttpConnection::read() + } + + bool HttpConnection::readMessage( std::string& msg ) +-throw( SocketRecvFailed ) ++EXCEPT ( SocketRecvFailed ) + { + try + { +diff --git a/src/C++/HttpConnection.h b/src/C++/HttpConnection.h +index 203b445e..d08d3870 100644 +--- a/src/C++/HttpConnection.h ++++ b/src/C++/HttpConnection.h +@@ -43,7 +43,7 @@ public: + bool read(); + + private: +- bool readMessage( std::string& msg ) throw( SocketRecvFailed ); ++ bool readMessage( std::string& msg ) EXCEPT ( SocketRecvFailed ); + void processStream(); + void processRequest( const HttpMessage& ); + void processRoot( const HttpMessage&, std::stringstream& h, std::stringstream& b ); +diff --git a/src/C++/HttpMessage.cpp b/src/C++/HttpMessage.cpp +index 4d6996a7..259204dd 100644 +--- a/src/C++/HttpMessage.cpp ++++ b/src/C++/HttpMessage.cpp +@@ -34,7 +34,7 @@ namespace FIX + HttpMessage::HttpMessage() {} + + HttpMessage::HttpMessage( const std::string& string ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + { + setString( string ); + } +@@ -52,7 +52,7 @@ std::string& HttpMessage::toString( std::string& str ) const + } + + void HttpMessage::setString( const std::string& string ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + { + clear(); + +diff --git a/src/C++/HttpMessage.h b/src/C++/HttpMessage.h +index bccbde70..14f12f9f 100644 +--- a/src/C++/HttpMessage.h ++++ b/src/C++/HttpMessage.h +@@ -43,7 +43,7 @@ public: + + /// Construct a message from a string + HttpMessage( const std::string& string ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + HttpMessage( const HttpMessage& copy ) + { +@@ -58,7 +58,7 @@ public: + std::string& toString( std::string& ) const; + + void setString( const std::string& string ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + void clear() + { +@@ -95,7 +95,7 @@ public: + } + + const std::string& getParameter( const std::string& key ) const +- throw( std::logic_error ) ++ EXCEPT ( std::logic_error ) + { + Parameters::const_iterator find = m_parameters.find( key ); + if( find == m_parameters.end() ) +diff --git a/src/C++/HttpParser.cpp b/src/C++/HttpParser.cpp +index d2a61396..694b82ca 100644 +--- a/src/C++/HttpParser.cpp ++++ b/src/C++/HttpParser.cpp +@@ -30,7 +30,7 @@ + namespace FIX + { + bool HttpParser::readHttpMessage( std::string& str ) +-throw( MessageParseError ) ++EXCEPT ( MessageParseError ) + { + std::string::size_type pos = 0; + +diff --git a/src/C++/HttpParser.h b/src/C++/HttpParser.h +index a79640f7..ed2626ea 100644 +--- a/src/C++/HttpParser.h ++++ b/src/C++/HttpParser.h +@@ -40,7 +40,7 @@ public: + ~HttpParser() {} + + bool readHttpMessage( std::string& str ) +- throw ( MessageParseError ); ++ EXCEPT ( MessageParseError ); + + void addToStream( const char* str, size_t len ) + { m_buffer.append( str, len ); } +diff --git a/src/C++/HttpServer.cpp b/src/C++/HttpServer.cpp +index 5bafa0fd..51490685 100644 +--- a/src/C++/HttpServer.cpp ++++ b/src/C++/HttpServer.cpp +@@ -35,7 +35,7 @@ int HttpServer::s_count = 0; + HttpServer* HttpServer::s_pServer = 0; + + void HttpServer::startGlobal( const SessionSettings& s ) +-throw ( ConfigError, RuntimeError ) ++EXCEPT ( ConfigError, RuntimeError ) + { + Locker l( s_mutex ); + +@@ -63,17 +63,17 @@ void HttpServer::stopGlobal() + } + } + +-HttpServer::HttpServer( const SessionSettings& settings ) throw( ConfigError ) ++HttpServer::HttpServer( const SessionSettings& settings ) EXCEPT ( ConfigError ) + : m_pServer( 0 ), m_settings( settings ), m_threadid( 0 ), m_port( 0 ), m_stop( false ) {} + + void HttpServer::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + m_port = s.get().getInt( HTTP_ACCEPT_PORT ); + } + + void HttpServer::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + try + { +@@ -86,7 +86,7 @@ throw ( RuntimeError ) + } + } + +-void HttpServer::start() throw ( ConfigError, RuntimeError ) ++void HttpServer::start() EXCEPT ( ConfigError, RuntimeError ) + { + m_stop = false; + onConfigure( m_settings ); +diff --git a/src/C++/HttpServer.h b/src/C++/HttpServer.h +index 88287e50..c656ec46 100644 +--- a/src/C++/HttpServer.h ++++ b/src/C++/HttpServer.h +@@ -37,17 +37,17 @@ namespace FIX + class HttpServer : public SocketServer::Strategy + { + public: +- HttpServer( const SessionSettings& ) throw( ConfigError ); ++ HttpServer( const SessionSettings& ) EXCEPT ( ConfigError ); + +- static void startGlobal( const SessionSettings& ) throw ( ConfigError, RuntimeError ); ++ static void startGlobal( const SessionSettings& ) EXCEPT ( ConfigError, RuntimeError ); + static void stopGlobal(); + +- void start() throw ( ConfigError, RuntimeError ); ++ void start() EXCEPT ( ConfigError, RuntimeError ); + void stop(); + + private: +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll(); +diff --git a/src/C++/Initiator.cpp b/src/C++/Initiator.cpp +index 8c91effd..1bc35670 100644 +--- a/src/C++/Initiator.cpp ++++ b/src/C++/Initiator.cpp +@@ -35,7 +35,7 @@ namespace FIX + { + Initiator::Initiator( Application& application, + MessageStoreFactory& messageStoreFactory, +- const SessionSettings& settings ) throw( ConfigError ) ++ const SessionSettings& settings ) EXCEPT ( ConfigError ) + : m_threadid( 0 ), + m_application( application ), + m_messageStoreFactory( messageStoreFactory ), +@@ -49,7 +49,7 @@ Initiator::Initiator( Application& application, + Initiator::Initiator( Application& application, + MessageStoreFactory& messageStoreFactory, + const SessionSettings& settings, +- LogFactory& logFactory ) throw( ConfigError ) ++ LogFactory& logFactory ) EXCEPT ( ConfigError ) + : m_threadid( 0 ), + m_application( application ), + m_messageStoreFactory( messageStoreFactory ), +@@ -60,7 +60,7 @@ Initiator::Initiator( Application& application, + m_stop( true ) + { initialize(); } + +-void Initiator::initialize() throw ( ConfigError ) ++void Initiator::initialize() EXCEPT ( ConfigError ) + { + std::set < SessionID > sessions = m_settings.getSessions(); + std::set < SessionID > ::iterator i; +@@ -187,7 +187,7 @@ bool Initiator::isDisconnected( const SessionID& sessionID ) + return m_disconnected.find( sessionID ) != m_disconnected.end(); + } + +-void Initiator::start() throw ( ConfigError, RuntimeError ) ++void Initiator::start() EXCEPT ( ConfigError, RuntimeError ) + { + m_stop = false; + onConfigure( m_settings ); +@@ -200,7 +200,7 @@ void Initiator::start() throw ( ConfigError, RuntimeError ) + } + + +-void Initiator::block() throw ( ConfigError, RuntimeError ) ++void Initiator::block() EXCEPT ( ConfigError, RuntimeError ) + { + m_stop = false; + onConfigure( m_settings ); +@@ -209,7 +209,7 @@ void Initiator::block() throw ( ConfigError, RuntimeError ) + startThread(this); + } + +-bool Initiator::poll( double timeout ) throw ( ConfigError, RuntimeError ) ++bool Initiator::poll( double timeout ) EXCEPT ( ConfigError, RuntimeError ) + { + if( m_firstPoll ) + { +diff --git a/src/C++/Initiator.h b/src/C++/Initiator.h +index b077c0e7..37f42030 100644 +--- a/src/C++/Initiator.h ++++ b/src/C++/Initiator.h +@@ -52,18 +52,18 @@ class Initiator + { + public: + Initiator( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + Initiator( Application&, MessageStoreFactory&, +- const SessionSettings&, LogFactory& ) throw( ConfigError ); ++ const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~Initiator(); + + /// Start initiator. +- void start() throw ( ConfigError, RuntimeError ); ++ void start() EXCEPT ( ConfigError, RuntimeError ); + /// Block on the initiator +- void block() throw ( ConfigError, RuntimeError ); ++ void block() EXCEPT ( ConfigError, RuntimeError ); + /// Poll the initiator +- bool poll( double timeout = 0.0 ) throw ( ConfigError, RuntimeError ); ++ bool poll( double timeout = 0.0 ) EXCEPT ( ConfigError, RuntimeError ); + + /// Stop initiator. + void stop( bool force = false ); +@@ -104,12 +104,12 @@ protected: + void connect(); + + private: +- void initialize() throw ( ConfigError ); ++ void initialize() EXCEPT ( ConfigError ); + + /// Implemented to configure acceptor +- virtual void onConfigure( const SessionSettings& ) throw ( ConfigError ) {}; ++ virtual void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ) {}; + /// Implemented to initialize initiator +- virtual void onInitialize( const SessionSettings& ) throw ( RuntimeError ) {}; ++ virtual void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ) {}; + /// Implemented to start connecting to targets. + virtual void onStart() = 0; + /// Implemented to connect and poll for events. +diff --git a/src/C++/Message.cpp b/src/C++/Message.cpp +index c8303111..60defd7c 100644 +--- a/src/C++/Message.cpp ++++ b/src/C++/Message.cpp +@@ -52,7 +52,7 @@ Message::Message(const message_order &hdrOrder, const message_order &trlOrder, c + m_trailer(trlOrder), m_validStructure( true ) {} + + Message::Message( const std::string& string, bool validate ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + : m_validStructure( true ) + , m_tag( 0 ) + { +@@ -62,7 +62,7 @@ throw( InvalidMessage ) + Message::Message( const std::string& string, + const DataDictionary& dataDictionary, + bool validate ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + : m_validStructure( true ) + , m_tag( 0 ) + { +@@ -73,7 +73,7 @@ Message::Message( const std::string& string, + const DataDictionary& sessionDataDictionary, + const DataDictionary& applicationDataDictionary, + bool validate ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + : m_validStructure( true ) + , m_tag( 0 ) + { +@@ -86,7 +86,7 @@ Message::Message( const message_order &hdrOrder, + const std::string& string, + const DataDictionary& dataDictionary, + bool validate ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + : FieldMap(order), m_header(hdrOrder), + m_trailer(trlOrder), m_validStructure( true ) + { +@@ -100,7 +100,7 @@ Message::Message( const message_order &hdrOrder, + const DataDictionary& sessionDataDictionary, + const DataDictionary& applicationDataDictionary, + bool validate ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + : FieldMap(order), m_header(hdrOrder), + m_trailer(trlOrder), m_validStructure( true ) + { +@@ -337,7 +337,7 @@ void Message::setString( const std::string& string, + bool doValidation, + const DataDictionary* pSessionDataDictionary, + const DataDictionary* pApplicationDataDictionary ) +-throw( InvalidMessage ) ++EXCEPT ( InvalidMessage ) + { + clear(); + +@@ -574,7 +574,7 @@ bool Message::isTrailerField( int field, const DataDictionary * pD ) + } + + SessionID Message::getSessionID( const std::string& qualifier ) const +-throw( FieldNotFound ) ++EXCEPT ( FieldNotFound ) + { + BeginString beginString; + SenderCompID senderCompID; +diff --git a/src/C++/Message.h b/src/C++/Message.h +index 7abe9c43..4ac552ff 100644 +--- a/src/C++/Message.h ++++ b/src/C++/Message.h +@@ -55,7 +55,7 @@ public: + void replaceGroup( unsigned num, const FIX::Group& group ) + { FieldMap::replaceGroup( num, group.field(), group ); } + +- Group& getGroup( unsigned num, FIX::Group& group ) const throw( FieldNotFound ) ++ Group& getGroup( unsigned num, FIX::Group& group ) const EXCEPT ( FieldNotFound ) + { group.clear(); + return static_cast < Group& > + ( FieldMap::getGroup( num, group.field(), group ) ); +@@ -90,7 +90,7 @@ public: + void replaceGroup( unsigned num, const FIX::Group& group ) + { FieldMap::replaceGroup( num, group.field(), group ); } + +- Group& getGroup( unsigned num, FIX::Group& group ) const throw( FieldNotFound ) ++ Group& getGroup( unsigned num, FIX::Group& group ) const EXCEPT ( FieldNotFound ) + { group.clear(); + return static_cast < Group& > + ( FieldMap::getGroup( num, group.field(), group ) ); +@@ -129,27 +129,27 @@ public: + + /// Construct a message from a string + Message( const std::string& string, bool validate = true ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + /// Construct a message from a string using a data dictionary + Message( const std::string& string, const FIX::DataDictionary& dataDictionary, + bool validate = true ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + /// Construct a message from a string using a session and application data dictionary + Message( const std::string& string, const FIX::DataDictionary& sessionDataDictionary, + const FIX::DataDictionary& applicationDataDictionary, bool validate = true ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + /// Construct a message from a string using a data dictionary + Message( const message_order& hdrOrder, const message_order& trlOrder, const message_order& order, const std::string& string, const FIX::DataDictionary& dataDictionary, + bool validate = true ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + /// Construct a message from a string using a session and application data dictionary + Message( const message_order& hdrOrder, const message_order& trlOrder, const message_order& order, const std::string& string, const FIX::DataDictionary& sessionDataDictionary, + const FIX::DataDictionary& applicationDataDictionary, bool validate = true ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + Message( const Message& copy ); + +@@ -164,7 +164,7 @@ public: + void replaceGroup( unsigned num, const FIX::Group& group ) + { FieldMap::replaceGroup( num, group.field(), group ); } + +- Group& getGroup( unsigned num, FIX::Group& group ) const throw( FieldNotFound ) ++ Group& getGroup( unsigned num, FIX::Group& group ) const EXCEPT ( FieldNotFound ) + { group.clear(); + return static_cast < Group& > + ( FieldMap::getGroup( num, group.field(), group ) ); +@@ -213,22 +213,22 @@ public: + * on failure. + */ + void setString( const std::string& string ) +- throw( InvalidMessage ) ++ EXCEPT ( InvalidMessage ) + { setString(string, true); } + void setString( const std::string& string, bool validate ) +- throw( InvalidMessage ) ++ EXCEPT ( InvalidMessage ) + { setString(string, validate, 0); } + void setString( const std::string& string, + bool validate, + const FIX::DataDictionary* pDataDictionary ) +- throw( InvalidMessage ) ++ EXCEPT ( InvalidMessage ) + { setString(string, validate, pDataDictionary, pDataDictionary); } + + void setString( const std::string& string, + bool validate, + const FIX::DataDictionary* pSessionDataDictionary, + const FIX::DataDictionary* pApplicationDataDictionary ) +- throw( InvalidMessage ); ++ EXCEPT ( InvalidMessage ); + + void setGroup( const std::string& msg, const FieldBase& field, + const std::string& string, std::string::size_type& pos, +@@ -361,7 +361,7 @@ public: + + /// Returns the session ID of the intended recipient + SessionID getSessionID( const std::string& qualifier = "" ) const +- throw( FieldNotFound ); ++ EXCEPT ( FieldNotFound ); + /// Sets the session ID of the intended recipient + void setSessionID( const SessionID& sessionID ); + +@@ -415,7 +415,7 @@ inline std::ostream& operator << + + /// Parse the type of a message from a string. + inline MsgType identifyType( const std::string& message ) +-throw( MessageParseError ) ++EXCEPT ( MessageParseError ) + { + std::string::size_type pos = message.find( "\001" "35=" ); + if ( pos == std::string::npos ) throw MessageParseError(); +diff --git a/src/C++/MessageStore.cpp b/src/C++/MessageStore.cpp +index dd821aad..7bd82860 100644 +--- a/src/C++/MessageStore.cpp ++++ b/src/C++/MessageStore.cpp +@@ -38,7 +38,7 @@ void MemoryStoreFactory::destroy( MessageStore* pStore ) + } + + bool MemoryStore::set( int msgSeqNum, const std::string& msg ) +-throw( IOException ) ++EXCEPT ( IOException ) + { + m_messages[ msgSeqNum ] = msg; + return true; +@@ -46,7 +46,7 @@ throw( IOException ) + + void MemoryStore::get( int begin, int end, + std::vector < std::string > & messages ) const +-throw( IOException ) ++EXCEPT ( IOException ) + { + messages.clear(); + Messages::const_iterator find = m_messages.find( begin ); +diff --git a/src/C++/MessageStore.h b/src/C++/MessageStore.h +index bd00a3af..e50e6e21 100644 +--- a/src/C++/MessageStore.h ++++ b/src/C++/MessageStore.h +@@ -69,21 +69,21 @@ public: + virtual ~MessageStore() {} + + virtual bool set( int, const std::string& ) +- throw ( IOException ) = 0; ++ EXCEPT ( IOException ) = 0; + virtual void get( int, int, std::vector < std::string > & ) const +- throw ( IOException ) = 0; ++ EXCEPT ( IOException ) = 0; + +- virtual int getNextSenderMsgSeqNum() const throw ( IOException ) = 0; +- virtual int getNextTargetMsgSeqNum() const throw ( IOException ) = 0; +- virtual void setNextSenderMsgSeqNum( int ) throw ( IOException ) = 0; +- virtual void setNextTargetMsgSeqNum( int ) throw ( IOException ) = 0; +- virtual void incrNextSenderMsgSeqNum() throw ( IOException ) = 0; +- virtual void incrNextTargetMsgSeqNum() throw ( IOException ) = 0; ++ virtual int getNextSenderMsgSeqNum() const EXCEPT ( IOException ) = 0; ++ virtual int getNextTargetMsgSeqNum() const EXCEPT ( IOException ) = 0; ++ virtual void setNextSenderMsgSeqNum( int ) EXCEPT ( IOException ) = 0; ++ virtual void setNextTargetMsgSeqNum( int ) EXCEPT ( IOException ) = 0; ++ virtual void incrNextSenderMsgSeqNum() EXCEPT ( IOException ) = 0; ++ virtual void incrNextTargetMsgSeqNum() EXCEPT ( IOException ) = 0; + +- virtual UtcTimeStamp getCreationTime() const throw ( IOException ) = 0; ++ virtual UtcTimeStamp getCreationTime() const EXCEPT ( IOException ) = 0; + +- virtual void reset() throw ( IOException ) = 0; +- virtual void refresh() throw ( IOException ) = 0; ++ virtual void reset() EXCEPT ( IOException ) = 0; ++ virtual void refresh() EXCEPT ( IOException ) = 0; + }; + /*! @} */ + +@@ -98,33 +98,33 @@ class MemoryStore : public MessageStore + public: + MemoryStore() : m_nextSenderMsgSeqNum( 1 ), m_nextTargetMsgSeqNum( 1 ) {} + +- bool set( int, const std::string& ) throw ( IOException ); +- void get( int, int, std::vector < std::string > & ) const throw ( IOException ); ++ bool set( int, const std::string& ) EXCEPT ( IOException ); ++ void get( int, int, std::vector < std::string > & ) const EXCEPT ( IOException ); + +- int getNextSenderMsgSeqNum() const throw ( IOException ) ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { return m_nextSenderMsgSeqNum; } +- int getNextTargetMsgSeqNum() const throw ( IOException ) ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { return m_nextTargetMsgSeqNum; } +- void setNextSenderMsgSeqNum( int value ) throw ( IOException ) ++ void setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ) + { m_nextSenderMsgSeqNum = value; } +- void setNextTargetMsgSeqNum( int value ) throw ( IOException ) ++ void setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ) + { m_nextTargetMsgSeqNum = value; } +- void incrNextSenderMsgSeqNum() throw ( IOException ) ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { ++m_nextSenderMsgSeqNum; } +- void incrNextTargetMsgSeqNum() throw ( IOException ) ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { ++m_nextTargetMsgSeqNum; } + +- void setCreationTime( const UtcTimeStamp& creationTime ) throw ( IOException ) ++ void setCreationTime( const UtcTimeStamp& creationTime ) EXCEPT ( IOException ) + { m_creationTime = creationTime; } +- UtcTimeStamp getCreationTime() const throw ( IOException ) ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ) + { return m_creationTime; } + +- void reset() throw ( IOException ) ++ void reset() EXCEPT ( IOException ) + { + m_nextSenderMsgSeqNum = 1; m_nextTargetMsgSeqNum = 1; + m_messages.clear(); m_creationTime.setCurrent(); + } +- void refresh() throw ( IOException ) {} ++ void refresh() EXCEPT ( IOException ) {} + + private: + typedef std::map < int, std::string > Messages; +diff --git a/src/C++/MySQLConnection.h b/src/C++/MySQLConnection.h +index 024edeb2..21d16472 100644 +--- a/src/C++/MySQLConnection.h ++++ b/src/C++/MySQLConnection.h +@@ -100,7 +100,7 @@ public: + return m_rows[row][column]; + } + +- void throwException() throw( IOException ) ++ void throwException() EXCEPT ( IOException ) + { + if( !success() ) + throw IOException( "Query failed [" + m_query + "] " + reason() ); +diff --git a/src/C++/MySQLStore.cpp b/src/C++/MySQLStore.cpp +index 91b3c8ae..8849b23f 100644 +--- a/src/C++/MySQLStore.cpp ++++ b/src/C++/MySQLStore.cpp +@@ -167,7 +167,7 @@ void MySQLStoreFactory::destroy( MessageStore* pStore ) + } + + bool MySQLStore::set( int msgSeqNum, const std::string& msg ) +-throw ( IOException ) ++EXCEPT ( IOException ) + { + char* msgCopy = new char[ (msg.size() * 2) + 1 ]; + mysql_escape_string( msgCopy, msg.c_str(), msg.size() ); +@@ -204,7 +204,7 @@ throw ( IOException ) + + void MySQLStore::get( int begin, int end, + std::vector < std::string > & result ) const +-throw ( IOException ) ++EXCEPT ( IOException ) + { + result.clear(); + std::stringstream queryString; +@@ -225,17 +225,17 @@ throw ( IOException ) + result.push_back( query.getValue( row, 0 ) ); + } + +-int MySQLStore::getNextSenderMsgSeqNum() const throw ( IOException ) ++int MySQLStore::getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextSenderMsgSeqNum(); + } + +-int MySQLStore::getNextTargetMsgSeqNum() const throw ( IOException ) ++int MySQLStore::getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextTargetMsgSeqNum(); + } + +-void MySQLStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) ++void MySQLStore::setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "UPDATE sessions SET outgoing_seqnum=" << value << " WHERE " +@@ -249,7 +249,7 @@ void MySQLStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) + m_cache.setNextSenderMsgSeqNum( value ); + } + +-void MySQLStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) ++void MySQLStore::setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "UPDATE sessions SET incoming_seqnum=" << value << " WHERE " +@@ -265,24 +265,24 @@ void MySQLStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) + m_cache.setNextTargetMsgSeqNum( value ); + } + +-void MySQLStore::incrNextSenderMsgSeqNum() throw ( IOException ) ++void MySQLStore::incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextSenderMsgSeqNum(); + setNextSenderMsgSeqNum( m_cache.getNextSenderMsgSeqNum() ); + } + +-void MySQLStore::incrNextTargetMsgSeqNum() throw ( IOException ) ++void MySQLStore::incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextTargetMsgSeqNum(); + setNextTargetMsgSeqNum( m_cache.getNextTargetMsgSeqNum() ); + } + +-UtcTimeStamp MySQLStore::getCreationTime() const throw ( IOException ) ++UtcTimeStamp MySQLStore::getCreationTime() const EXCEPT ( IOException ) + { + return m_cache.getCreationTime(); + } + +-void MySQLStore::reset() throw ( IOException ) ++void MySQLStore::reset() EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "DELETE FROM messages WHERE " +@@ -320,7 +320,7 @@ void MySQLStore::reset() throw ( IOException ) + query2.throwException(); + } + +-void MySQLStore::refresh() throw ( IOException ) ++void MySQLStore::refresh() EXCEPT ( IOException ) + { + m_cache.reset(); + populateCache(); +diff --git a/src/C++/MySQLStore.h b/src/C++/MySQLStore.h +index 33102c71..dc37ada7 100644 +--- a/src/C++/MySQLStore.h ++++ b/src/C++/MySQLStore.h +@@ -113,20 +113,20 @@ public: + const std::string& password, const std::string& host, short port ); + ~MySQLStore(); + +- bool set( int, const std::string& ) throw ( IOException ); +- void get( int, int, std::vector < std::string > & ) const throw ( IOException ); ++ bool set( int, const std::string& ) EXCEPT ( IOException ); ++ void get( int, int, std::vector < std::string > & ) const EXCEPT ( IOException ); + +- int getNextSenderMsgSeqNum() const throw ( IOException ); +- int getNextTargetMsgSeqNum() const throw ( IOException ); +- void setNextSenderMsgSeqNum( int value ) throw ( IOException ); +- void setNextTargetMsgSeqNum( int value ) throw ( IOException ); +- void incrNextSenderMsgSeqNum() throw ( IOException ); +- void incrNextTargetMsgSeqNum() throw ( IOException ); ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ); ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ); ++ void setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ); ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ); + +- UtcTimeStamp getCreationTime() const throw ( IOException ); ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ); + +- void reset() throw ( IOException ); +- void refresh() throw ( IOException ); ++ void reset() EXCEPT ( IOException ); ++ void refresh() EXCEPT ( IOException ); + + private: + void populateCache(); +diff --git a/src/C++/NullStore.cpp b/src/C++/NullStore.cpp +index bafa25a2..34b70f23 100644 +--- a/src/C++/NullStore.cpp ++++ b/src/C++/NullStore.cpp +@@ -39,14 +39,14 @@ void NullStoreFactory::destroy( MessageStore* pStore ) + } + + bool NullStore::set( int msgSeqNum, const std::string& msg ) +-throw( IOException ) ++EXCEPT ( IOException ) + { + return true; + } + + void NullStore::get( int begin, int end, + std::vector < std::string > & messages ) const +-throw( IOException ) ++EXCEPT ( IOException ) + { + messages.clear(); + } +diff --git a/src/C++/NullStore.h b/src/C++/NullStore.h +index 43d00891..ea2ba5e6 100644 +--- a/src/C++/NullStore.h ++++ b/src/C++/NullStore.h +@@ -60,33 +60,33 @@ class NullStore : public MessageStore + public: + NullStore() : m_nextSenderMsgSeqNum( 1 ), m_nextTargetMsgSeqNum( 1 ) {} + +- bool set( int, const std::string& ) throw ( IOException ); +- void get( int, int, std::vector < std::string > & ) const throw ( IOException ); ++ bool set( int, const std::string& ) EXCEPT ( IOException ); ++ void get( int, int, std::vector < std::string > & ) const EXCEPT ( IOException ); + +- int getNextSenderMsgSeqNum() const throw ( IOException ) ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { return m_nextSenderMsgSeqNum; } +- int getNextTargetMsgSeqNum() const throw ( IOException ) ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { return m_nextTargetMsgSeqNum; } +- void setNextSenderMsgSeqNum( int value ) throw ( IOException ) ++ void setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ) + { m_nextSenderMsgSeqNum = value; } +- void setNextTargetMsgSeqNum( int value ) throw ( IOException ) ++ void setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ) + { m_nextTargetMsgSeqNum = value; } +- void incrNextSenderMsgSeqNum() throw ( IOException ) ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { ++m_nextSenderMsgSeqNum; } +- void incrNextTargetMsgSeqNum() throw ( IOException ) ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { ++m_nextTargetMsgSeqNum; } + +- void setCreationTime( const UtcTimeStamp& creationTime ) throw ( IOException ) ++ void setCreationTime( const UtcTimeStamp& creationTime ) EXCEPT ( IOException ) + { m_creationTime = creationTime; } +- UtcTimeStamp getCreationTime() const throw ( IOException ) ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ) + { return m_creationTime; } + +- void reset() throw ( IOException ) ++ void reset() EXCEPT ( IOException ) + { + m_nextSenderMsgSeqNum = 1; m_nextTargetMsgSeqNum = 1; + m_creationTime.setCurrent(); + } +- void refresh() throw ( IOException ) {} ++ void refresh() EXCEPT ( IOException ) {} + + private: + int m_nextSenderMsgSeqNum; +diff --git a/src/C++/OdbcConnection.h b/src/C++/OdbcConnection.h +index d8358d31..d66ba8c8 100644 +--- a/src/C++/OdbcConnection.h ++++ b/src/C++/OdbcConnection.h +@@ -134,7 +134,7 @@ public: + return m_statement; + } + +- void throwException() throw( IOException ) ++ void throwException() EXCEPT ( IOException ) + { + if( !success() ) + throw IOException( "Query failed [" + m_query + "] " + reason() ); +diff --git a/src/C++/OdbcStore.cpp b/src/C++/OdbcStore.cpp +index ea85a8b4..6b286e2d 100644 +--- a/src/C++/OdbcStore.cpp ++++ b/src/C++/OdbcStore.cpp +@@ -162,7 +162,7 @@ MessageStore* OdbcStoreFactory::create( const SessionID& s, const Dictionary& se + } + + bool OdbcStore::set( int msgSeqNum, const std::string& msg ) +-throw ( IOException ) ++EXCEPT ( IOException ) + { + std::string msgCopy = msg; + string_replace( "'", "''", msgCopy ); +@@ -198,7 +198,7 @@ throw ( IOException ) + + void OdbcStore::get( int begin, int end, + std::vector < std::string > & result ) const +-throw ( IOException ) ++EXCEPT ( IOException ) + { + result.clear(); + std::stringstream queryString; +@@ -231,17 +231,17 @@ throw ( IOException ) + } + } + +-int OdbcStore::getNextSenderMsgSeqNum() const throw ( IOException ) ++int OdbcStore::getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextSenderMsgSeqNum(); + } + +-int OdbcStore::getNextTargetMsgSeqNum() const throw ( IOException ) ++int OdbcStore::getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextTargetMsgSeqNum(); + } + +-void OdbcStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) ++void OdbcStore::setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "UPDATE sessions SET outgoing_seqnum=" << value << " WHERE " +@@ -255,7 +255,7 @@ void OdbcStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) + m_cache.setNextSenderMsgSeqNum( value ); + } + +-void OdbcStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) ++void OdbcStore::setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "UPDATE sessions SET incoming_seqnum=" << value << " WHERE " +@@ -271,24 +271,24 @@ void OdbcStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) + m_cache.setNextTargetMsgSeqNum( value ); + } + +-void OdbcStore::incrNextSenderMsgSeqNum() throw ( IOException ) ++void OdbcStore::incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextSenderMsgSeqNum(); + setNextSenderMsgSeqNum( m_cache.getNextSenderMsgSeqNum() ); + } + +-void OdbcStore::incrNextTargetMsgSeqNum() throw ( IOException ) ++void OdbcStore::incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextTargetMsgSeqNum(); + setNextTargetMsgSeqNum( m_cache.getNextTargetMsgSeqNum() ); + } + +-UtcTimeStamp OdbcStore::getCreationTime() const throw ( IOException ) ++UtcTimeStamp OdbcStore::getCreationTime() const EXCEPT ( IOException ) + { + return m_cache.getCreationTime(); + } + +-void OdbcStore::reset() throw ( IOException ) ++void OdbcStore::reset() EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "DELETE FROM messages WHERE " +@@ -327,7 +327,7 @@ void OdbcStore::reset() throw ( IOException ) + query2.throwException(); + } + +-void OdbcStore::refresh() throw ( IOException ) ++void OdbcStore::refresh() EXCEPT ( IOException ) + { + m_cache.reset(); + populateCache(); +diff --git a/src/C++/OdbcStore.h b/src/C++/OdbcStore.h +index a89ab29b..a3bd187d 100644 +--- a/src/C++/OdbcStore.h ++++ b/src/C++/OdbcStore.h +@@ -85,20 +85,20 @@ public: + const std::string& connectionString ); + ~OdbcStore(); + +- bool set( int, const std::string& ) throw ( IOException ); +- void get( int, int, std::vector < std::string > & ) const throw ( IOException ); ++ bool set( int, const std::string& ) EXCEPT ( IOException ); ++ void get( int, int, std::vector < std::string > & ) const EXCEPT ( IOException ); + +- int getNextSenderMsgSeqNum() const throw ( IOException ); +- int getNextTargetMsgSeqNum() const throw ( IOException ); +- void setNextSenderMsgSeqNum( int value ) throw ( IOException ); +- void setNextTargetMsgSeqNum( int value ) throw ( IOException ); +- void incrNextSenderMsgSeqNum() throw ( IOException ); +- void incrNextTargetMsgSeqNum() throw ( IOException ); ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ); ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ); ++ void setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ); ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ); + +- UtcTimeStamp getCreationTime() const throw ( IOException ); ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ); + +- void reset() throw ( IOException ); +- void refresh() throw ( IOException ); ++ void reset() EXCEPT ( IOException ); ++ void refresh() EXCEPT ( IOException ); + + private: + void populateCache(); +diff --git a/src/C++/PUGIXML_DOMDocument.cpp b/src/C++/PUGIXML_DOMDocument.cpp +index 32338fcd..7533ccfe 100644 +--- a/src/C++/PUGIXML_DOMDocument.cpp ++++ b/src/C++/PUGIXML_DOMDocument.cpp +@@ -70,7 +70,7 @@ namespace FIX + return m_pNode.value(); + } + +- PUGIXML_DOMDocument::PUGIXML_DOMDocument() throw( ConfigError ) ++ PUGIXML_DOMDocument::PUGIXML_DOMDocument() EXCEPT ( ConfigError ) + { + } + +diff --git a/src/C++/PUGIXML_DOMDocument.h b/src/C++/PUGIXML_DOMDocument.h +index 088b9d64..11dc8d48 100644 +--- a/src/C++/PUGIXML_DOMDocument.h ++++ b/src/C++/PUGIXML_DOMDocument.h +@@ -64,7 +64,7 @@ namespace FIX + class PUGIXML_DOMDocument : public DOMDocument + { + public: +- PUGIXML_DOMDocument() throw( ConfigError ); ++ PUGIXML_DOMDocument() EXCEPT ( ConfigError ); + ~PUGIXML_DOMDocument(); + + bool load( std::istream& ); +diff --git a/src/C++/Parser.cpp b/src/C++/Parser.cpp +index 415031ac..aabd9630 100644 +--- a/src/C++/Parser.cpp ++++ b/src/C++/Parser.cpp +@@ -32,7 +32,7 @@ namespace FIX + { + bool Parser::extractLength( int& length, std::string::size_type& pos, + const std::string& buffer ) +-throw( MessageParseError ) ++EXCEPT ( MessageParseError ) + { + if( !buffer.size() ) return false; + +@@ -57,7 +57,7 @@ throw( MessageParseError ) + } + + bool Parser::readFixMessage( std::string& str ) +-throw( MessageParseError ) ++EXCEPT ( MessageParseError ) + { + std::string::size_type pos = 0; + +diff --git a/src/C++/Parser.h b/src/C++/Parser.h +index 10f07d7e..9617ed9b 100644 +--- a/src/C++/Parser.h ++++ b/src/C++/Parser.h +@@ -41,9 +41,9 @@ public: + + bool extractLength( int& length, std::string::size_type& pos, + const std::string& buffer ) +- throw ( MessageParseError ); ++ EXCEPT ( MessageParseError ); + bool readFixMessage( std::string& str ) +- throw ( MessageParseError ); ++ EXCEPT ( MessageParseError ); + + void addToStream( const char* str, size_t len ) + { m_buffer.append( str, len ); } +diff --git a/src/C++/PostgreSQLConnection.h b/src/C++/PostgreSQLConnection.h +index 0782fe8f..f778fb73 100644 +--- a/src/C++/PostgreSQLConnection.h ++++ b/src/C++/PostgreSQLConnection.h +@@ -89,7 +89,7 @@ public: + return PQgetvalue( m_result, row, column ); + } + +- void throwException() throw( IOException ) ++ void throwException() EXCEPT ( IOException ) + { + if( !success() ) + throw IOException( "Query failed [" + m_query + "] " ); +diff --git a/src/C++/PostgreSQLStore.cpp b/src/C++/PostgreSQLStore.cpp +index d3fde6ff..b2cd5f50 100644 +--- a/src/C++/PostgreSQLStore.cpp ++++ b/src/C++/PostgreSQLStore.cpp +@@ -167,7 +167,7 @@ void PostgreSQLStoreFactory::destroy( MessageStore* pStore ) + } + + bool PostgreSQLStore::set( int msgSeqNum, const std::string& msg ) +-throw ( IOException ) ++EXCEPT ( IOException ) + { + char* msgCopy = new char[ (msg.size() * 2) + 1 ]; + PQescapeString( msgCopy, msg.c_str(), msg.size() ); +@@ -205,7 +205,7 @@ throw ( IOException ) + + void PostgreSQLStore::get( int begin, int end, + std::vector < std::string > & result ) const +-throw ( IOException ) ++EXCEPT ( IOException ) + { + result.clear(); + std::stringstream queryString; +@@ -226,17 +226,17 @@ throw ( IOException ) + result.push_back( query.getValue( row, 0 ) ); + } + +-int PostgreSQLStore::getNextSenderMsgSeqNum() const throw ( IOException ) ++int PostgreSQLStore::getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextSenderMsgSeqNum(); + } + +-int PostgreSQLStore::getNextTargetMsgSeqNum() const throw ( IOException ) ++int PostgreSQLStore::getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { + return m_cache.getNextTargetMsgSeqNum(); + } + +-void PostgreSQLStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) ++void PostgreSQLStore::setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "UPDATE sessions SET outgoing_seqnum=" << value << " WHERE " +@@ -252,7 +252,7 @@ void PostgreSQLStore::setNextSenderMsgSeqNum( int value ) throw ( IOException ) + m_cache.setNextSenderMsgSeqNum( value ); + } + +-void PostgreSQLStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) ++void PostgreSQLStore::setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "UPDATE sessions SET incoming_seqnum=" << value << " WHERE " +@@ -268,24 +268,24 @@ void PostgreSQLStore::setNextTargetMsgSeqNum( int value ) throw ( IOException ) + m_cache.setNextTargetMsgSeqNum( value ); + } + +-void PostgreSQLStore::incrNextSenderMsgSeqNum() throw ( IOException ) ++void PostgreSQLStore::incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextSenderMsgSeqNum(); + setNextSenderMsgSeqNum( m_cache.getNextSenderMsgSeqNum() ); + } + +-void PostgreSQLStore::incrNextTargetMsgSeqNum() throw ( IOException ) ++void PostgreSQLStore::incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { + m_cache.incrNextTargetMsgSeqNum(); + setNextTargetMsgSeqNum( m_cache.getNextTargetMsgSeqNum() ); + } + +-UtcTimeStamp PostgreSQLStore::getCreationTime() const throw ( IOException ) ++UtcTimeStamp PostgreSQLStore::getCreationTime() const EXCEPT ( IOException ) + { + return m_cache.getCreationTime(); + } + +-void PostgreSQLStore::reset() throw ( IOException ) ++void PostgreSQLStore::reset() EXCEPT ( IOException ) + { + std::stringstream queryString; + queryString << "DELETE FROM messages WHERE " +@@ -323,7 +323,7 @@ void PostgreSQLStore::reset() throw ( IOException ) + query2.throwException(); + } + +-void PostgreSQLStore::refresh() throw ( IOException ) ++void PostgreSQLStore::refresh() EXCEPT ( IOException ) + { + m_cache.reset(); + populateCache(); +diff --git a/src/C++/PostgreSQLStore.h b/src/C++/PostgreSQLStore.h +index de436048..b18d3105 100644 +--- a/src/C++/PostgreSQLStore.h ++++ b/src/C++/PostgreSQLStore.h +@@ -112,20 +112,20 @@ public: + const std::string& password, const std::string& host, short port ); + ~PostgreSQLStore(); + +- bool set( int, const std::string& ) throw ( IOException ); +- void get( int, int, std::vector < std::string > & ) const throw ( IOException ); ++ bool set( int, const std::string& ) EXCEPT ( IOException ); ++ void get( int, int, std::vector < std::string > & ) const EXCEPT ( IOException ); + +- int getNextSenderMsgSeqNum() const throw ( IOException ); +- int getNextTargetMsgSeqNum() const throw ( IOException ); +- void setNextSenderMsgSeqNum( int value ) throw ( IOException ); +- void setNextTargetMsgSeqNum( int value ) throw ( IOException ); +- void incrNextSenderMsgSeqNum() throw ( IOException ); +- void incrNextTargetMsgSeqNum() throw ( IOException ); ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ); ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ); ++ void setNextSenderMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void setNextTargetMsgSeqNum( int value ) EXCEPT ( IOException ); ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ); ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ); + +- UtcTimeStamp getCreationTime() const throw ( IOException ); ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ); + +- void reset() throw ( IOException ); +- void refresh() throw ( IOException ); ++ void reset() EXCEPT ( IOException ); ++ void refresh() EXCEPT ( IOException ); + + private: + void populateCache(); +diff --git a/src/C++/SSLSocketAcceptor.cpp b/src/C++/SSLSocketAcceptor.cpp +index 6b647519..a3d2207c 100644 +--- a/src/C++/SSLSocketAcceptor.cpp ++++ b/src/C++/SSLSocketAcceptor.cpp +@@ -138,7 +138,7 @@ int SSLSocketAcceptor::passPhraseHandleCB(char *buf, int bufsize, int verify, vo + + SSLSocketAcceptor::SSLSocketAcceptor( Application& application, + MessageStoreFactory& factory, +- const SessionSettings& settings ) throw( ConfigError ) ++ const SessionSettings& settings ) EXCEPT ( ConfigError ) + : Acceptor( application, factory, settings ), + m_pServer( 0 ), m_sslInit(false), + m_verify(SSL_CLIENT_VERIFY_NOTSET), m_ctx(0), m_revocationStore(0) +@@ -149,7 +149,7 @@ SSLSocketAcceptor::SSLSocketAcceptor( Application& application, + SSLSocketAcceptor::SSLSocketAcceptor( Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings, +- LogFactory& logFactory ) throw( ConfigError ) ++ LogFactory& logFactory ) EXCEPT ( ConfigError ) + : Acceptor( application, factory, settings, logFactory ), + m_pServer( 0 ), m_sslInit(false), + m_verify(SSL_CLIENT_VERIFY_NOTSET), m_ctx(0), m_revocationStore(0) +@@ -172,7 +172,7 @@ SSLSocketAcceptor::~SSLSocketAcceptor() + } + + void SSLSocketAcceptor::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + std::set sessions = s.getSessions(); + std::set::iterator i; +@@ -188,7 +188,7 @@ throw ( ConfigError ) + } + + void SSLSocketAcceptor::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + if (!m_sslInit) + { +diff --git a/src/C++/SSLSocketAcceptor.h b/src/C++/SSLSocketAcceptor.h +index ee86d712..892eff17 100644 +--- a/src/C++/SSLSocketAcceptor.h ++++ b/src/C++/SSLSocketAcceptor.h +@@ -135,9 +135,9 @@ class SSLSocketAcceptor : public Acceptor, SocketServer::Strategy + friend class SSLSocketConnection; + public: + SSLSocketAcceptor( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + SSLSocketAcceptor( Application&, MessageStoreFactory&, +- const SessionSettings&, LogFactory& ) throw( ConfigError ); ++ const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~SSLSocketAcceptor(); + +@@ -154,8 +154,8 @@ private: + typedef std::map < int, Sessions > PortToSessions; + typedef std::map < int, SSLSocketConnection* > SocketConnections; + +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll( double timeout ); +diff --git a/src/C++/SSLSocketConnection.cpp b/src/C++/SSLSocketConnection.cpp +index 76e47688..51664a8a 100644 +--- a/src/C++/SSLSocketConnection.cpp ++++ b/src/C++/SSLSocketConnection.cpp +@@ -328,7 +328,7 @@ bool SSLSocketConnection::isValidSession() + } + + void SSLSocketConnection::readFromSocket() +-throw( SocketRecvFailed ) ++EXCEPT ( SocketRecvFailed ) + { + bool pending = false; + +diff --git a/src/C++/SSLSocketConnection.h b/src/C++/SSLSocketConnection.h +index 1607fe8b..dcec0a6d 100644 +--- a/src/C++/SSLSocketConnection.h ++++ b/src/C++/SSLSocketConnection.h +@@ -180,7 +180,7 @@ private: + Queue; + + bool isValidSession(); +- void readFromSocket() throw( SocketRecvFailed ); ++ void readFromSocket() EXCEPT ( SocketRecvFailed ); + bool readMessage( std::string& msg ); + void readMessages( SocketMonitor& s ); + bool send( const std::string& ); +diff --git a/src/C++/SSLSocketInitiator.cpp b/src/C++/SSLSocketInitiator.cpp +index 52a52308..b0ad0c17 100644 +--- a/src/C++/SSLSocketInitiator.cpp ++++ b/src/C++/SSLSocketInitiator.cpp +@@ -137,7 +137,7 @@ int SSLSocketInitiator::passwordHandleCB(char *buf, int bufsize, int verify, voi + SSLSocketInitiator::SSLSocketInitiator( Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : Initiator( application, factory, settings ), + m_connector( 1 ), m_lastConnect( 0 ), + m_reconnectInterval( 30 ), m_noDelay( false ), m_sendBufSize( 0 ), +@@ -150,7 +150,7 @@ SSLSocketInitiator::SSLSocketInitiator( Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings, + LogFactory& logFactory ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : Initiator( application, factory, settings, logFactory ), + m_connector( 1 ), m_lastConnect( 0 ), + m_reconnectInterval( 30 ), m_noDelay( false ), m_sendBufSize( 0 ), +@@ -179,7 +179,7 @@ SSLSocketInitiator::~SSLSocketInitiator() + } + + void SSLSocketInitiator::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + const Dictionary& dict = s.get(); + +@@ -194,7 +194,7 @@ throw ( ConfigError ) + } + + void SSLSocketInitiator::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + if (m_sslInit) + return; +diff --git a/src/C++/SSLSocketInitiator.h b/src/C++/SSLSocketInitiator.h +index e6a44933..3f67319a 100644 +--- a/src/C++/SSLSocketInitiator.h ++++ b/src/C++/SSLSocketInitiator.h +@@ -134,9 +134,9 @@ class SSLSocketInitiator : public Initiator, SocketConnector::Strategy + { + public: + SSLSocketInitiator( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + SSLSocketInitiator( Application&, MessageStoreFactory&, +- const SessionSettings&, LogFactory& ) throw( ConfigError ); ++ const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~SSLSocketInitiator(); + +@@ -156,8 +156,8 @@ private: + typedef std::map < int, SSLSocketConnection* > SocketConnections; + typedef std::map < SessionID, int > SessionToHostNum; + +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll( double timeout ); +diff --git a/src/C++/Session.cpp b/src/C++/Session.cpp +index 7eaf703c..72cab714 100644 +--- a/src/C++/Session.cpp ++++ b/src/C++/Session.cpp +@@ -661,7 +661,7 @@ bool Session::resend( Message& message ) + } + + void Session::persist( const Message& message, const std::string& messageString ) +-throw ( IOException ) ++EXCEPT ( IOException ) + { + MsgSeqNum msgSeqNum; + message.getHeader().getField( msgSeqNum ); +@@ -1442,7 +1442,7 @@ void Session::next( const Message& message, const UtcTimeStamp& timeStamp, bool + } + + bool Session::sendToTarget( Message& message, const std::string& qualifier ) +-throw( SessionNotFound ) ++EXCEPT ( SessionNotFound ) + { + try + { +@@ -1453,7 +1453,7 @@ throw( SessionNotFound ) + } + + bool Session::sendToTarget( Message& message, const SessionID& sessionID ) +-throw( SessionNotFound ) ++EXCEPT ( SessionNotFound ) + { + message.setSessionID( sessionID ); + Session* pSession = lookupSession( sessionID ); +@@ -1466,7 +1466,7 @@ bool Session::sendToTarget + const SenderCompID& senderCompID, + const TargetCompID& targetCompID, + const std::string& qualifier ) +-throw( SessionNotFound ) ++EXCEPT ( SessionNotFound ) + { + message.getHeader().setField( senderCompID ); + message.getHeader().setField( targetCompID ); +@@ -1476,7 +1476,7 @@ throw( SessionNotFound ) + bool Session::sendToTarget + ( Message& message, const std::string& sender, const std::string& target, + const std::string& qualifier ) +-throw( SessionNotFound ) ++EXCEPT ( SessionNotFound ) + { + return sendToTarget( message, SenderCompID( sender ), + TargetCompID( target ), qualifier ); +diff --git a/src/C++/Session.h b/src/C++/Session.h +index 2b3005e2..fb97c563 100644 +--- a/src/C++/Session.h ++++ b/src/C++/Session.h +@@ -63,13 +63,13 @@ public: + bool sentLogout() { return m_state.sentLogout(); } + bool receivedLogon() { return m_state.receivedLogon(); } + bool isLoggedOn() { return receivedLogon() && sentLogon(); } +- void reset() throw( IOException ) ++ void reset() EXCEPT ( IOException ) + { generateLogout(); disconnect(); m_state.reset(); } +- void refresh() throw( IOException ) ++ void refresh() EXCEPT ( IOException ) + { m_state.refresh(); } +- void setNextSenderMsgSeqNum( int num ) throw( IOException ) ++ void setNextSenderMsgSeqNum( int num ) EXCEPT ( IOException ) + { m_state.setNextSenderMsgSeqNum( num ); } +- void setNextTargetMsgSeqNum( int num ) throw( IOException ) ++ void setNextTargetMsgSeqNum( int num ) EXCEPT ( IOException ) + { m_state.setNextTargetMsgSeqNum( num ); } + + const SessionID& getSessionID() const +@@ -81,19 +81,19 @@ public: + + static bool sendToTarget( Message& message, + const std::string& qualifier = "" ) +- throw( SessionNotFound ); ++ EXCEPT ( SessionNotFound ); + static bool sendToTarget( Message& message, const SessionID& sessionID ) +- throw( SessionNotFound ); ++ EXCEPT ( SessionNotFound ); + static bool sendToTarget( Message&, + const SenderCompID& senderCompID, + const TargetCompID& targetCompID, + const std::string& qualifier = "" ) +- throw( SessionNotFound ); ++ EXCEPT ( SessionNotFound ); + static bool sendToTarget( Message& message, + const std::string& senderCompID, + const std::string& targetCompID, + const std::string& qualifier = "" ) +- throw( SessionNotFound ); ++ EXCEPT ( SessionNotFound ); + + static std::set getSessions(); + static bool doesSessionExist( const SessionID& ); +@@ -237,7 +237,7 @@ private: + bool send( const std::string& ); + bool sendRaw( Message&, int msgSeqNum = 0 ); + bool resend( Message& message ); +- void persist( const Message&, const std::string& ) throw ( IOException ); ++ void persist( const Message&, const std::string& ) EXCEPT ( IOException ); + + void insertSendingTime( Header& ); + void insertOrigSendingTime( Header&, +diff --git a/src/C++/SessionFactory.cpp b/src/C++/SessionFactory.cpp +index 13ffa7a4..2327a867 100644 +--- a/src/C++/SessionFactory.cpp ++++ b/src/C++/SessionFactory.cpp +@@ -39,7 +39,7 @@ SessionFactory::~SessionFactory() + } + + Session* SessionFactory::create( const SessionID& sessionID, +- const Dictionary& settings ) throw( ConfigError ) ++ const Dictionary& settings ) EXCEPT ( ConfigError ) + { + std::string connectionType = settings.getString( CONNECTION_TYPE ); + if ( connectionType != "acceptor" && connectionType != "initiator" ) +@@ -207,7 +207,7 @@ void SessionFactory::destroy( Session* pSession ) + + ptr::shared_ptr SessionFactory::createDataDictionary(const SessionID& sessionID, + const Dictionary& settings, +- const std::string& settingsKey) throw(ConfigError) ++ const std::string& settingsKey) EXCEPT (ConfigError) + { + ptr::shared_ptr pDD; + std::string path = settings.getString( settingsKey ); +@@ -241,7 +241,7 @@ ptr::shared_ptr SessionFactory::createDataDictionary(const Sessi + + void SessionFactory::processFixtDataDictionaries(const SessionID& sessionID, + const Dictionary& settings, +- DataDictionaryProvider& provider) throw(ConfigError) ++ DataDictionaryProvider& provider) EXCEPT (ConfigError) + { + ptr::shared_ptr pDataDictionary = createDataDictionary(sessionID, settings, TRANSPORT_DATA_DICTIONARY); + provider.addTransportDataDictionary(sessionID.getBeginString(), pDataDictionary); +@@ -272,7 +272,7 @@ void SessionFactory::processFixtDataDictionaries(const SessionID& sessionID, + + void SessionFactory::processFixDataDictionary(const SessionID& sessionID, + const Dictionary& settings, +- DataDictionaryProvider& provider) throw(ConfigError) ++ DataDictionaryProvider& provider) EXCEPT (ConfigError) + { + ptr::shared_ptr pDataDictionary = createDataDictionary(sessionID, settings, DATA_DICTIONARY); + provider.addTransportDataDictionary(sessionID.getBeginString(), pDataDictionary); +diff --git a/src/C++/SessionFactory.h b/src/C++/SessionFactory.h +index 1cc0f42b..b91a2281 100644 +--- a/src/C++/SessionFactory.h ++++ b/src/C++/SessionFactory.h +@@ -56,7 +56,7 @@ public: + ~SessionFactory(); + + Session* create( const SessionID& sessionID, +- const Dictionary& settings ) throw( ConfigError ); ++ const Dictionary& settings ) EXCEPT ( ConfigError ); + void destroy( Session* pSession ); + + private: +@@ -64,15 +64,15 @@ private: + + ptr::shared_ptr createDataDictionary(const SessionID& sessionID, + const Dictionary& settings, +- const std::string& settingsKey) throw(ConfigError); ++ const std::string& settingsKey) EXCEPT (ConfigError); + + void processFixtDataDictionaries(const SessionID& sessionID, + const Dictionary& settings, +- DataDictionaryProvider& provider) throw(ConfigError); ++ DataDictionaryProvider& provider) EXCEPT (ConfigError); + + void processFixDataDictionary(const SessionID& sessionID, + const Dictionary& settings, +- DataDictionaryProvider& provider) throw(ConfigError); ++ DataDictionaryProvider& provider) EXCEPT (ConfigError); + + std::string toApplVerID(const std::string& value); + +diff --git a/src/C++/SessionSettings.cpp b/src/C++/SessionSettings.cpp +index 0240ed6f..256a40ee 100644 +--- a/src/C++/SessionSettings.cpp ++++ b/src/C++/SessionSettings.cpp +@@ -31,14 +31,14 @@ + namespace FIX + { + SessionSettings::SessionSettings( std::istream& stream, bool resolveEnvVars ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : m_resolveEnvVars( resolveEnvVars ) + { + stream >> *this; + } + + SessionSettings::SessionSettings( const std::string& file, bool resolveEnvVars ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : m_resolveEnvVars( resolveEnvVars ) + { + std::ifstream fstream( file.c_str() ); +@@ -48,7 +48,7 @@ throw( ConfigError ) + } + + std::istream& operator>>( std::istream& stream, SessionSettings& s ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + Settings settings(s.m_resolveEnvVars); + stream >> settings; +@@ -125,7 +125,7 @@ const bool SessionSettings::has( const SessionID& sessionID ) const + } + + const Dictionary& SessionSettings::get( const SessionID& sessionID ) const +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + Dictionaries::const_iterator i; + i = m_settings.find( sessionID ); +@@ -135,7 +135,7 @@ throw( ConfigError ) + + void SessionSettings::set( const SessionID& sessionID, + Dictionary settings ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + if( has(sessionID) ) + throw ConfigError( "Duplicate Session " + sessionID.toString() ); +@@ -149,7 +149,7 @@ throw( ConfigError ) + m_settings[ sessionID ] = settings; + } + +-void SessionSettings::set( const Dictionary& defaults ) throw( ConfigError ) ++void SessionSettings::set( const Dictionary& defaults ) EXCEPT ( ConfigError ) + { + m_defaults = defaults; + Dictionaries::iterator i = m_settings.begin(); +@@ -167,7 +167,7 @@ std::set < SessionID > SessionSettings::getSessions() const + } + + void SessionSettings::validate( const Dictionary& dictionary ) const +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + { + std::string beginString = dictionary.getString( BEGINSTRING ); + if( beginString != BeginString_FIX40 && +diff --git a/src/C++/SessionSettings.h b/src/C++/SessionSettings.h +index f9b52979..bcd9bbdb 100644 +--- a/src/C++/SessionSettings.h ++++ b/src/C++/SessionSettings.h +@@ -221,21 +221,21 @@ class SessionSettings + { + public: + SessionSettings() { m_resolveEnvVars = false; } +- SessionSettings( std::istream& stream, bool resolveEnvVars = false ) throw( ConfigError ); +- SessionSettings( const std::string& file, bool resolveEnvVars = false ) throw( ConfigError ); ++ SessionSettings( std::istream& stream, bool resolveEnvVars = false ) EXCEPT ( ConfigError ); ++ SessionSettings( const std::string& file, bool resolveEnvVars = false ) EXCEPT ( ConfigError ); + + /// Check if session setings are present + const bool has( const SessionID& ) const; + + /// Get a dictionary for a session. +- const Dictionary& get( const SessionID& ) const throw( ConfigError ); ++ const Dictionary& get( const SessionID& ) const EXCEPT ( ConfigError ); + /// Set a dictionary for a session +- void set( const SessionID&, Dictionary ) throw( ConfigError ); ++ void set( const SessionID&, Dictionary ) EXCEPT ( ConfigError ); + + /// Get global default settings + const Dictionary& get() const { return m_defaults; } + /// Set global default settings +- void set( const Dictionary& defaults ) throw( ConfigError ); ++ void set( const Dictionary& defaults ) EXCEPT ( ConfigError ); + + /// Number of session settings + size_t size() const { return m_settings.size(); } +@@ -244,19 +244,19 @@ public: + std::set < SessionID > getSessions() const; + + private: +- void validate( const Dictionary& ) const throw( ConfigError ); ++ void validate( const Dictionary& ) const EXCEPT ( ConfigError ); + + Dictionaries m_settings; + Dictionary m_defaults; + bool m_resolveEnvVars; // while reading, replace $var, $(var) and ${var} by environment variable var + +- friend std::istream& operator>>( std::istream&, SessionSettings& ) throw( ConfigError ); ++ friend std::istream& operator>>( std::istream&, SessionSettings& ) EXCEPT ( ConfigError ); + friend std::ostream& operator<<( std::ostream&, const SessionSettings& ); + }; + /*! @} */ + + std::istream& operator>>( std::istream&, SessionSettings& ) +-throw( ConfigError ); ++EXCEPT ( ConfigError ); + std::ostream& operator<<( std::ostream&, const SessionSettings& ); + } + +diff --git a/src/C++/SessionState.h b/src/C++/SessionState.h +index d3c049b1..2f9f2038 100644 +--- a/src/C++/SessionState.h ++++ b/src/C++/SessionState.h +@@ -169,28 +169,28 @@ public: + void clearQueue() + { Locker l( m_mutex ); m_queue.clear(); } + +- bool set( int s, const std::string& m ) throw ( IOException ) ++ bool set( int s, const std::string& m ) EXCEPT ( IOException ) + { Locker l( m_mutex ); return m_pStore->set( s, m ); } + void get( int b, int e, std::vector < std::string > &m ) const +- throw ( IOException ) ++ EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->get( b, e, m ); } +- int getNextSenderMsgSeqNum() const throw ( IOException ) ++ int getNextSenderMsgSeqNum() const EXCEPT ( IOException ) + { Locker l( m_mutex ); return m_pStore->getNextSenderMsgSeqNum(); } +- int getNextTargetMsgSeqNum() const throw ( IOException ) ++ int getNextTargetMsgSeqNum() const EXCEPT ( IOException ) + { Locker l( m_mutex ); return m_pStore->getNextTargetMsgSeqNum(); } +- void setNextSenderMsgSeqNum( int n ) throw ( IOException ) ++ void setNextSenderMsgSeqNum( int n ) EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->setNextSenderMsgSeqNum( n ); } +- void setNextTargetMsgSeqNum( int n ) throw ( IOException ) ++ void setNextTargetMsgSeqNum( int n ) EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->setNextTargetMsgSeqNum( n ); } +- void incrNextSenderMsgSeqNum() throw ( IOException ) ++ void incrNextSenderMsgSeqNum() EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->incrNextSenderMsgSeqNum(); } +- void incrNextTargetMsgSeqNum() throw ( IOException ) ++ void incrNextTargetMsgSeqNum() EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->incrNextTargetMsgSeqNum(); } +- UtcTimeStamp getCreationTime() const throw ( IOException ) ++ UtcTimeStamp getCreationTime() const EXCEPT ( IOException ) + { Locker l( m_mutex ); return m_pStore->getCreationTime(); } +- void reset() throw ( IOException ) ++ void reset() EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->reset(); } +- void refresh() throw ( IOException ) ++ void refresh() EXCEPT ( IOException ) + { Locker l( m_mutex ); m_pStore->refresh(); } + + void clear() +diff --git a/src/C++/SocketAcceptor.cpp b/src/C++/SocketAcceptor.cpp +index 434f1a0c..089de7e3 100644 +--- a/src/C++/SocketAcceptor.cpp ++++ b/src/C++/SocketAcceptor.cpp +@@ -33,14 +33,14 @@ namespace FIX + { + SocketAcceptor::SocketAcceptor( Application& application, + MessageStoreFactory& factory, +- const SessionSettings& settings ) throw( ConfigError ) ++ const SessionSettings& settings ) EXCEPT ( ConfigError ) + : Acceptor( application, factory, settings ), + m_pServer( 0 ) {} + + SocketAcceptor::SocketAcceptor( Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings, +- LogFactory& logFactory ) throw( ConfigError ) ++ LogFactory& logFactory ) EXCEPT ( ConfigError ) + : Acceptor( application, factory, settings, logFactory ), + m_pServer( 0 ) + { +@@ -54,7 +54,7 @@ SocketAcceptor::~SocketAcceptor() + } + + void SocketAcceptor::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + std::set sessions = s.getSessions(); + std::set::iterator i; +@@ -70,7 +70,7 @@ throw ( ConfigError ) + } + + void SocketAcceptor::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + short port = 0; + +diff --git a/src/C++/SocketAcceptor.h b/src/C++/SocketAcceptor.h +index de3efd3a..c14d1747 100644 +--- a/src/C++/SocketAcceptor.h ++++ b/src/C++/SocketAcceptor.h +@@ -38,9 +38,9 @@ class SocketAcceptor : public Acceptor, SocketServer::Strategy + friend class SocketConnection; + public: + SocketAcceptor( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + SocketAcceptor( Application&, MessageStoreFactory&, +- const SessionSettings&, LogFactory& ) throw( ConfigError ); ++ const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~SocketAcceptor(); + +@@ -51,8 +51,8 @@ private: + typedef std::map < int, Sessions > PortToSessions; + typedef std::map < int, SocketConnection* > SocketConnections; + +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll( double timeout ); +diff --git a/src/C++/SocketConnection.cpp b/src/C++/SocketConnection.cpp +index e5778a22..e6ca6dff 100644 +--- a/src/C++/SocketConnection.cpp ++++ b/src/C++/SocketConnection.cpp +@@ -195,7 +195,7 @@ bool SocketConnection::isValidSession() + } + + void SocketConnection::readFromSocket() +-throw( SocketRecvFailed ) ++EXCEPT ( SocketRecvFailed ) + { + ssize_t size = socket_recv( m_socket, m_buffer, sizeof(m_buffer) ); + if( size <= 0 ) throw SocketRecvFailed( size ); +diff --git a/src/C++/SocketConnection.h b/src/C++/SocketConnection.h +index ec7d9e2d..3871ffda 100644 +--- a/src/C++/SocketConnection.h ++++ b/src/C++/SocketConnection.h +@@ -80,7 +80,7 @@ private: + Queue; + + bool isValidSession(); +- void readFromSocket() throw( SocketRecvFailed ); ++ void readFromSocket() EXCEPT ( SocketRecvFailed ); + bool readMessage( std::string& msg ); + void readMessages( SocketMonitor& s ); + bool send( const std::string& ); +diff --git a/src/C++/SocketInitiator.cpp b/src/C++/SocketInitiator.cpp +index f4d7e145..48046edc 100644 +--- a/src/C++/SocketInitiator.cpp ++++ b/src/C++/SocketInitiator.cpp +@@ -32,7 +32,7 @@ namespace FIX + SocketInitiator::SocketInitiator( Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : Initiator( application, factory, settings ), + m_connector( 1 ), m_lastConnect( 0 ), + m_reconnectInterval( 30 ), m_noDelay( false ), m_sendBufSize( 0 ), +@@ -44,7 +44,7 @@ SocketInitiator::SocketInitiator( Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings, + LogFactory& logFactory ) +-throw( ConfigError ) ++EXCEPT ( ConfigError ) + : Initiator( application, factory, settings, logFactory ), + m_connector( 1 ), m_lastConnect( 0 ), + m_reconnectInterval( 30 ), m_noDelay( false ), m_sendBufSize( 0 ), +@@ -65,7 +65,7 @@ SocketInitiator::~SocketInitiator() + } + + void SocketInitiator::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + const Dictionary& dict = s.get(); + +@@ -80,7 +80,7 @@ throw ( ConfigError ) + } + + void SocketInitiator::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + } + +diff --git a/src/C++/SocketInitiator.h b/src/C++/SocketInitiator.h +index 338de386..9a811e68 100644 +--- a/src/C++/SocketInitiator.h ++++ b/src/C++/SocketInitiator.h +@@ -37,9 +37,9 @@ class SocketInitiator : public Initiator, SocketConnector::Strategy + { + public: + SocketInitiator( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + SocketInitiator( Application&, MessageStoreFactory&, +- const SessionSettings&, LogFactory& ) throw( ConfigError ); ++ const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~SocketInitiator(); + +@@ -47,8 +47,8 @@ private: + typedef std::map < int, SocketConnection* > SocketConnections; + typedef std::map < SessionID, int > SessionToHostNum; + +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll( double timeout ); +diff --git a/src/C++/SocketServer.cpp b/src/C++/SocketServer.cpp +index ba65d035..f138d8dc 100644 +--- a/src/C++/SocketServer.cpp ++++ b/src/C++/SocketServer.cpp +@@ -96,7 +96,7 @@ SocketServer::SocketServer( int timeout ) + + int SocketServer::add( int port, bool reuse, bool noDelay, + int sendBufSize, int rcvBufSize ) +- throw( SocketException& ) ++ EXCEPT ( SocketException& ) + { + if( m_portToInfo.find(port) != m_portToInfo.end() ) + return m_portToInfo[port].m_socket; +diff --git a/src/C++/SocketServer.h b/src/C++/SocketServer.h +index 6a596790..cc4282ee 100644 +--- a/src/C++/SocketServer.h ++++ b/src/C++/SocketServer.h +@@ -61,7 +61,7 @@ public: + SocketServer( int timeout = 0 ); + + int add( int port, bool reuse = false, bool noDelay = false, +- int sendBufSize = 0, int rcvBufSize = 0 ) throw( SocketException& ); ++ int sendBufSize = 0, int rcvBufSize = 0 ) EXCEPT ( SocketException& ); + int accept( int socket ); + void close(); + bool block( Strategy& strategy, bool poll = 0, double timeout = 0.0 ); +diff --git a/src/C++/ThreadedSSLSocketAcceptor.cpp b/src/C++/ThreadedSSLSocketAcceptor.cpp +index 7425657b..771526b4 100644 +--- a/src/C++/ThreadedSSLSocketAcceptor.cpp ++++ b/src/C++/ThreadedSSLSocketAcceptor.cpp +@@ -136,7 +136,7 @@ int ThreadedSSLSocketAcceptor::passPhraseHandleCB(char *buf, int bufsize, int ve + + ThreadedSSLSocketAcceptor::ThreadedSSLSocketAcceptor( + Application &application, MessageStoreFactory &factory, +- const SessionSettings &settings) throw(ConfigError) ++ const SessionSettings &settings) EXCEPT (ConfigError) + : Acceptor(application, factory, settings), m_sslInit(false), + m_verify(SSL_CLIENT_VERIFY_NOTSET), m_ctx(0), m_revocationStore(0) + { +@@ -146,7 +146,7 @@ ThreadedSSLSocketAcceptor::ThreadedSSLSocketAcceptor( + + ThreadedSSLSocketAcceptor::ThreadedSSLSocketAcceptor( + Application &application, MessageStoreFactory &factory, +- const SessionSettings &settings, LogFactory &logFactory) throw(ConfigError) ++ const SessionSettings &settings, LogFactory &logFactory) EXCEPT (ConfigError) + : Acceptor(application, factory, settings, logFactory), m_sslInit(false), + m_verify(SSL_CLIENT_VERIFY_NOTSET), m_ctx(0), m_revocationStore(0) + { +@@ -166,8 +166,7 @@ ThreadedSSLSocketAcceptor::~ThreadedSSLSocketAcceptor() + socket_term(); + } + +-void ThreadedSSLSocketAcceptor::onConfigure(const SessionSettings &s) throw( +- ConfigError) ++void ThreadedSSLSocketAcceptor::onConfigure(const SessionSettings &s) EXCEPT (ConfigError) + { + std::set< SessionID > sessions = s.getSessions(); + std::set< SessionID >::iterator i; +@@ -182,8 +181,7 @@ void ThreadedSSLSocketAcceptor::onConfigure(const SessionSettings &s) throw( + } + } + +-void ThreadedSSLSocketAcceptor::onInitialize(const SessionSettings &s) throw( +- RuntimeError) ++void ThreadedSSLSocketAcceptor::onInitialize(const SessionSettings &s) EXCEPT (RuntimeError) + { + if (!m_sslInit) + { +diff --git a/src/C++/ThreadedSSLSocketAcceptor.h b/src/C++/ThreadedSSLSocketAcceptor.h +index 7b74d826..0bbeb947 100644 +--- a/src/C++/ThreadedSSLSocketAcceptor.h ++++ b/src/C++/ThreadedSSLSocketAcceptor.h +@@ -135,10 +135,10 @@ class ThreadedSSLSocketAcceptor : public Acceptor + + public: + ThreadedSSLSocketAcceptor(Application &, MessageStoreFactory &, +- const SessionSettings &) throw(ConfigError); ++ const SessionSettings &) EXCEPT (ConfigError); + ThreadedSSLSocketAcceptor(Application &, MessageStoreFactory &, + const SessionSettings &, +- LogFactory &) throw(ConfigError); ++ LogFactory &) EXCEPT (ConfigError); + + virtual ~ThreadedSSLSocketAcceptor(); + +@@ -183,8 +183,8 @@ private: + typedef std::pair< int, SSL * > SocketKey; + typedef std::map< SocketKey, thread_id > SocketToThread; + +- void onConfigure(const SessionSettings &) throw(ConfigError); +- void onInitialize(const SessionSettings &) throw(RuntimeError); ++ void onConfigure(const SessionSettings &) EXCEPT (ConfigError); ++ void onInitialize(const SessionSettings &) EXCEPT (RuntimeError); + + void onStart(); + bool onPoll(double timeout); +diff --git a/src/C++/ThreadedSSLSocketConnection.cpp b/src/C++/ThreadedSSLSocketConnection.cpp +index fbcac8d4..bbd2a09b 100644 +--- a/src/C++/ThreadedSSLSocketConnection.cpp ++++ b/src/C++/ThreadedSSLSocketConnection.cpp +@@ -323,8 +323,7 @@ bool ThreadedSSLSocketConnection::read() + } + } + +-bool ThreadedSSLSocketConnection::readMessage(std::string &msg) throw( +- SocketRecvFailed) ++bool ThreadedSSLSocketConnection::readMessage(std::string &msg) EXCEPT (SocketRecvFailed) + { + try + { +diff --git a/src/C++/ThreadedSSLSocketConnection.h b/src/C++/ThreadedSSLSocketConnection.h +index f7848826..4c77b316 100644 +--- a/src/C++/ThreadedSSLSocketConnection.h ++++ b/src/C++/ThreadedSSLSocketConnection.h +@@ -161,7 +161,7 @@ public: + private: + typedef std::pair< int, SSL * > SocketKey; + +- bool readMessage(std::string &msg) throw(SocketRecvFailed); ++ bool readMessage(std::string &msg) EXCEPT (SocketRecvFailed); + void processStream(); + bool send(const std::string &); + bool setSession(const std::string &msg); +diff --git a/src/C++/ThreadedSSLSocketInitiator.cpp b/src/C++/ThreadedSSLSocketInitiator.cpp +index 3bf029fd..76dba488 100644 +--- a/src/C++/ThreadedSSLSocketInitiator.cpp ++++ b/src/C++/ThreadedSSLSocketInitiator.cpp +@@ -135,7 +135,7 @@ int ThreadedSSLSocketInitiator::passwordHandleCB(char *buf, int bufsize, int ver + + ThreadedSSLSocketInitiator::ThreadedSSLSocketInitiator( + Application &application, MessageStoreFactory &factory, +- const SessionSettings &settings) throw(ConfigError) ++ const SessionSettings &settings) EXCEPT (ConfigError) + : Initiator(application, factory, settings), m_lastConnect(0), + m_reconnectInterval(30), m_noDelay(false), m_sendBufSize(0), + m_rcvBufSize(0), m_sslInit(false), m_ctx(0), m_cert(0), m_key(0) +@@ -146,7 +146,7 @@ ThreadedSSLSocketInitiator::ThreadedSSLSocketInitiator( + + ThreadedSSLSocketInitiator::ThreadedSSLSocketInitiator( + Application &application, MessageStoreFactory &factory, +- const SessionSettings &settings, LogFactory &logFactory) throw(ConfigError) ++ const SessionSettings &settings, LogFactory &logFactory) EXCEPT (ConfigError) + : Initiator(application, factory, settings, logFactory), m_lastConnect(0), + m_reconnectInterval(30), m_noDelay(false), m_sendBufSize(0), + m_rcvBufSize(0), m_sslInit(false), m_ctx(0), m_cert(0), m_key(0) +@@ -167,8 +167,7 @@ ThreadedSSLSocketInitiator::~ThreadedSSLSocketInitiator() + socket_term(); + } + +-void ThreadedSSLSocketInitiator::onConfigure(const SessionSettings &s) throw( +- ConfigError) ++void ThreadedSSLSocketInitiator::onConfigure(const SessionSettings &s) EXCEPT (ConfigError) + { + const Dictionary &dict = s.get(); + +@@ -182,8 +181,7 @@ void ThreadedSSLSocketInitiator::onConfigure(const SessionSettings &s) throw( + m_rcvBufSize = dict.getInt(SOCKET_RECEIVE_BUFFER_SIZE); + } + +-void ThreadedSSLSocketInitiator::onInitialize(const SessionSettings &s) throw( +- RuntimeError) ++void ThreadedSSLSocketInitiator::onInitialize(const SessionSettings &s) EXCEPT (RuntimeError) + { + if (m_sslInit) + return; +diff --git a/src/C++/ThreadedSSLSocketInitiator.h b/src/C++/ThreadedSSLSocketInitiator.h +index 1041b582..d16b2544 100644 +--- a/src/C++/ThreadedSSLSocketInitiator.h ++++ b/src/C++/ThreadedSSLSocketInitiator.h +@@ -137,10 +137,10 @@ class ThreadedSSLSocketInitiator : public Initiator + { + public: + ThreadedSSLSocketInitiator(Application &, MessageStoreFactory &, +- const SessionSettings &) throw(ConfigError); ++ const SessionSettings &) EXCEPT (ConfigError); + ThreadedSSLSocketInitiator(Application &, MessageStoreFactory &, + const SessionSettings &, +- LogFactory &) throw(ConfigError); ++ LogFactory &) EXCEPT (ConfigError); + + virtual ~ThreadedSSLSocketInitiator(); + +@@ -163,8 +163,8 @@ private: + typedef std::pair< ThreadedSSLSocketInitiator *, + ThreadedSSLSocketConnection * > ThreadPair; + +- void onConfigure(const SessionSettings &) throw(ConfigError); +- void onInitialize(const SessionSettings &) throw(RuntimeError); ++ void onConfigure(const SessionSettings &) EXCEPT (ConfigError); ++ void onInitialize(const SessionSettings &) EXCEPT (RuntimeError); + + void onStart(); + bool onPoll(double timeout); +diff --git a/src/C++/ThreadedSocketAcceptor.cpp b/src/C++/ThreadedSocketAcceptor.cpp +index ec421848..e4fc1143 100644 +--- a/src/C++/ThreadedSocketAcceptor.cpp ++++ b/src/C++/ThreadedSocketAcceptor.cpp +@@ -32,7 +32,7 @@ namespace FIX + ThreadedSocketAcceptor::ThreadedSocketAcceptor( + Application& application, + MessageStoreFactory& factory, +- const SessionSettings& settings ) throw( ConfigError ) ++ const SessionSettings& settings ) EXCEPT ( ConfigError ) + : Acceptor( application, factory, settings ) + { socket_init(); } + +@@ -40,7 +40,7 @@ ThreadedSocketAcceptor::ThreadedSocketAcceptor( + Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings, +- LogFactory& logFactory ) throw( ConfigError ) ++ LogFactory& logFactory ) EXCEPT ( ConfigError ) + : Acceptor( application, factory, settings, logFactory ) + { + socket_init(); +@@ -52,7 +52,7 @@ ThreadedSocketAcceptor::~ThreadedSocketAcceptor() + } + + void ThreadedSocketAcceptor::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + std::set sessions = s.getSessions(); + std::set::iterator i; +@@ -68,7 +68,7 @@ throw ( ConfigError ) + } + + void ThreadedSocketAcceptor::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + short port = 0; + std::set ports; +diff --git a/src/C++/ThreadedSocketAcceptor.h b/src/C++/ThreadedSocketAcceptor.h +index 63d4f7ef..00e3cc65 100644 +--- a/src/C++/ThreadedSocketAcceptor.h ++++ b/src/C++/ThreadedSocketAcceptor.h +@@ -38,10 +38,10 @@ class ThreadedSocketAcceptor : public Acceptor + friend class SocketConnection; + public: + ThreadedSocketAcceptor( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + ThreadedSocketAcceptor( Application&, MessageStoreFactory&, + const SessionSettings&, +- LogFactory& ) throw( ConfigError ); ++ LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~ThreadedSocketAcceptor(); + +@@ -74,8 +74,8 @@ private: + typedef std::map < int, int > SocketToPort; + typedef std::map < int, thread_id > SocketToThread; + +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll( double timeout ); +diff --git a/src/C++/ThreadedSocketConnection.cpp b/src/C++/ThreadedSocketConnection.cpp +index 57116f5a..5742034e 100644 +--- a/src/C++/ThreadedSocketConnection.cpp ++++ b/src/C++/ThreadedSocketConnection.cpp +@@ -143,7 +143,7 @@ bool ThreadedSocketConnection::read() + } + + bool ThreadedSocketConnection::readMessage( std::string& msg ) +-throw( SocketRecvFailed ) ++EXCEPT ( SocketRecvFailed ) + { + try + { +diff --git a/src/C++/ThreadedSocketConnection.h b/src/C++/ThreadedSocketConnection.h +index 13172aaa..f45956a2 100644 +--- a/src/C++/ThreadedSocketConnection.h ++++ b/src/C++/ThreadedSocketConnection.h +@@ -60,7 +60,7 @@ public: + bool read(); + + private: +- bool readMessage( std::string& msg ) throw( SocketRecvFailed ); ++ bool readMessage( std::string& msg ) EXCEPT ( SocketRecvFailed ); + void processStream(); + bool send( const std::string& ); + bool setSession( const std::string& msg ); +diff --git a/src/C++/ThreadedSocketInitiator.cpp b/src/C++/ThreadedSocketInitiator.cpp +index 2ada1e29..eea001ed 100644 +--- a/src/C++/ThreadedSocketInitiator.cpp ++++ b/src/C++/ThreadedSocketInitiator.cpp +@@ -32,7 +32,7 @@ namespace FIX + ThreadedSocketInitiator::ThreadedSocketInitiator( + Application& application, + MessageStoreFactory& factory, +- const SessionSettings& settings ) throw( ConfigError ) ++ const SessionSettings& settings ) EXCEPT ( ConfigError ) + : Initiator( application, factory, settings ), + m_lastConnect( 0 ), m_reconnectInterval( 30 ), m_noDelay( false ), + m_sendBufSize( 0 ), m_rcvBufSize( 0 ) +@@ -44,7 +44,7 @@ ThreadedSocketInitiator::ThreadedSocketInitiator( + Application& application, + MessageStoreFactory& factory, + const SessionSettings& settings, +- LogFactory& logFactory ) throw( ConfigError ) ++ LogFactory& logFactory ) EXCEPT ( ConfigError ) + : Initiator( application, factory, settings, logFactory ), + m_lastConnect( 0 ), m_reconnectInterval( 30 ), m_noDelay( false ), + m_sendBufSize( 0 ), m_rcvBufSize( 0 ) +@@ -58,7 +58,7 @@ ThreadedSocketInitiator::~ThreadedSocketInitiator() + } + + void ThreadedSocketInitiator::onConfigure( const SessionSettings& s ) +-throw ( ConfigError ) ++EXCEPT ( ConfigError ) + { + const Dictionary& dict = s.get(); + +@@ -73,7 +73,7 @@ throw ( ConfigError ) + } + + void ThreadedSocketInitiator::onInitialize( const SessionSettings& s ) +-throw ( RuntimeError ) ++EXCEPT ( RuntimeError ) + { + } + +diff --git a/src/C++/ThreadedSocketInitiator.h b/src/C++/ThreadedSocketInitiator.h +index 1a634c1c..97b5e839 100644 +--- a/src/C++/ThreadedSocketInitiator.h ++++ b/src/C++/ThreadedSocketInitiator.h +@@ -40,10 +40,10 @@ class ThreadedSocketInitiator : public Initiator + { + public: + ThreadedSocketInitiator( Application&, MessageStoreFactory&, +- const SessionSettings& ) throw( ConfigError ); ++ const SessionSettings& ) EXCEPT ( ConfigError ); + ThreadedSocketInitiator( Application&, MessageStoreFactory&, + const SessionSettings&, +- LogFactory& ) throw( ConfigError ); ++ LogFactory& ) EXCEPT ( ConfigError ); + + virtual ~ThreadedSocketInitiator(); + +@@ -52,8 +52,8 @@ private: + typedef std::map < SessionID, int > SessionToHostNum; + typedef std::pair < ThreadedSocketInitiator*, ThreadedSocketConnection* > ThreadPair; + +- void onConfigure( const SessionSettings& ) throw ( ConfigError ); +- void onInitialize( const SessionSettings& ) throw ( RuntimeError ); ++ void onConfigure( const SessionSettings& ) EXCEPT ( ConfigError ); ++ void onInitialize( const SessionSettings& ) EXCEPT ( RuntimeError ); + + void onStart(); + bool onPoll( double timeout ); +diff --git a/src/C++/Utility.h b/src/C++/Utility.h +index 0aa2cd3e..61ffaa77 100644 +--- a/src/C++/Utility.h ++++ b/src/C++/Utility.h +@@ -30,6 +30,8 @@ + #include "Allocator.h" + #endif + ++#include "Except.h" ++ + #ifdef HAVE_STLPORT + #define ALLOCATOR std::allocator + #elif ENABLE_DEBUG_ALLOCATOR +diff --git a/src/C++/pugixml.cpp b/src/C++/pugixml.cpp +index ad2262fb..535c2e11 100644 +--- a/src/C++/pugixml.cpp ++++ b/src/C++/pugixml.cpp +@@ -6214,7 +6214,7 @@ PUGI__NS_BEGIN + #endif + } + +- void* allocate_nothrow(size_t size) ++ void* allocate_noEXCEPT (size_t size) + { + // align size so that we're able to store pointers in subsequent blocks + size = (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1); +@@ -6249,7 +6249,7 @@ PUGI__NS_BEGIN + + void* allocate(size_t size) + { +- void* result = allocate_nothrow(size); ++ void* result = allocate_noEXCEPT (size); + + if (!result) + { +@@ -9294,7 +9294,7 @@ PUGI__NS_BEGIN + + void* alloc_node() + { +- void* result = _alloc->allocate_nothrow(sizeof(xpath_ast_node)); ++ void* result = _alloc->allocate_noEXCEPT (sizeof(xpath_ast_node)); + + if (!result) throw_error_oom(); + +@@ -9307,7 +9307,7 @@ PUGI__NS_BEGIN + { + size_t length = static_cast(value.end - value.begin); + +- char_t* c = static_cast(_alloc->allocate_nothrow((length + 1) * sizeof(char_t))); ++ char_t* c = static_cast(_alloc->allocate_noEXCEPT ((length + 1) * sizeof(char_t))); + if (!c) throw_error_oom(); + assert(c); // workaround for clang static analysis + +@@ -10142,7 +10142,7 @@ namespace pugi + assert(_result.error); + } + +- PUGI__FN const char* xpath_exception::what() const throw() ++ PUGI__FN const char* xpath_exception::what() const NOEXCEPT + { + return _result.error; + } +diff --git a/src/C++/pugixml.hpp b/src/C++/pugixml.hpp +index 69b2cb25..1488548e 100644 +--- a/src/C++/pugixml.hpp ++++ b/src/C++/pugixml.hpp +@@ -17,6 +17,7 @@ + #endif + + // Include user configuration file (this can define various configuration macros) ++#include "Except.h" + #include "pugiconfig.hpp" + + #ifndef HEADER_PUGIXML_HPP +diff --git a/src/C++/test/SessionTestCase.cpp b/src/C++/test/SessionTestCase.cpp +index 174d55ca..9747d250 100644 +--- a/src/C++/test/SessionTestCase.cpp ++++ b/src/C++/test/SessionTestCase.cpp +@@ -104,7 +104,7 @@ public: + } + + void fromAdmin( const FIX::Message& message, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) ++ EXCEPT( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) + { + MsgType msgType; + message.getHeader().getField( msgType ); +@@ -124,7 +124,7 @@ public: + } + + void fromApp( const FIX::Message& message, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) ++ EXCEPT( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) + { + MsgType msgType; + message.getHeader().getField( msgType ); +@@ -133,7 +133,7 @@ public: + } + + void toApp( FIX::Message& message, const SessionID& ) +- throw( DoNotSend ) ++ EXCEPT( DoNotSend ) + { + PossDupFlag possDupFlag(false); + if( message.getHeader().isSetField(possDupFlag) ) +diff --git a/src/C++/test/TestHelper.h b/src/C++/test/TestHelper.h +index 020f4dea..b21ef777 100644 +--- a/src/C++/test/TestHelper.h ++++ b/src/C++/test/TestHelper.h +@@ -16,7 +16,7 @@ class TestApplication : public NullApplication + { + public: + void fromApp( const Message&, const SessionID& ) +- throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) {} ++ EXCEPT( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) {} + void onRun() {} + }; + +diff --git a/src/at_application.h b/src/at_application.h +index 6d07c5b5..c8724a09 100644 +--- a/src/at_application.h ++++ b/src/at_application.h +@@ -167,7 +167,7 @@ class Application : public FIX::Application + } + + void onLogon( const FIX::SessionID& sessionID ) +- throw( FIX::RejectLogon ) ++ EXCEPT( FIX::RejectLogon ) + {} + + void onLogout( const FIX::SessionID& sessionID ) +@@ -179,11 +179,11 @@ class Application : public FIX::Application + {} + + void toApp( FIX::Message& message, const FIX::SessionID& ) +- throw( FIX::DoNotSend ) ++ EXCEPT( FIX::DoNotSend ) + {} + + void fromAdmin( const FIX::Message& message, const FIX::SessionID& sessionID ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) + { + FIX::MsgType msgType; + message.getHeader().getField( msgType ); +@@ -199,7 +199,7 @@ class Application : public FIX::Application + } + + void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) + { + FIX::MsgType msgType; + message.getHeader().getField( msgType ); +diff --git a/src/pt.cpp b/src/pt.cpp +index 9be0667a..c24f1bf6 100644 +--- a/src/pt.cpp ++++ b/src/pt.cpp +@@ -741,7 +741,7 @@ public: + TestApplication() : m_count(0) {} + + void fromApp( const FIX::Message& m, const FIX::SessionID& ) +- throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) ++ EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) + { + m_count++; + } +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0002-except-copy.patch b/recipes/quickfix/all/patches/0002-except-copy.patch new file mode 100644 index 0000000000000..cf1b22aace84b --- /dev/null +++ b/recipes/quickfix/all/patches/0002-except-copy.patch @@ -0,0 +1,52 @@ +From b91089d531a945cdff2cd50389c03343c91c7b14 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Sun, 14 Jun 2020 16:57:19 -0300 +Subject: [PATCH 2/8] except copy + +--- + include/Except.h | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + create mode 100644 include/Except.h + +diff --git a/include/Except.h b/include/Except.h +new file mode 100644 +index 00000000..fded28eb +--- /dev/null ++++ b/include/Except.h +@@ -0,0 +1,33 @@ ++/* -*- C++ -*- */ ++ ++/**************************************************************************** ++** Copyright (c) 2001-2014 ++** ++** This file is part of the QuickFIX FIX Engine ++** ++** This file may be distributed under the terms of the quickfixengine.org ++** license as defined by quickfixengine.org and appearing in the file ++** LICENSE included in the packaging of this file. ++** ++** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ++** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++** ++** See http://www.quickfixengine.org/LICENSE for licensing information. ++** ++** Contact ask@quickfixengine.org if any conditions of this licensing are ++** not clear to you. ++** ++****************************************************************************/ ++ ++#ifndef FIX_EXCEPT_H ++#define FIX_EXCEPT_H ++ ++#ifdef __cpp_noexcept_function_type ++#define NOEXCEPT noexcept ++#define EXCEPT(...) noexcept(false) ++#else ++#define NOEXCEPT throw() ++#define EXCEPT(...) throw(__VA_ARGS__) ++#endif ++ ++#endif +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0003-fix-condition-for-using-tr1-namespace.patch b/recipes/quickfix/all/patches/0003-fix-condition-for-using-tr1-namespace.patch new file mode 100644 index 0000000000000..2207656495ba2 --- /dev/null +++ b/recipes/quickfix/all/patches/0003-fix-condition-for-using-tr1-namespace.patch @@ -0,0 +1,25 @@ +From 0dc1082e71b21a84124d56181c1ab7daa6b52352 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Tue, 9 Jun 2020 08:39:03 -0300 +Subject: [PATCH 3/8] fix condition for using tr1 namespace + +--- + src/C++/Utility.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/C++/Utility.h b/src/C++/Utility.h +index 61ffaa77..63917ce2 100644 +--- a/src/C++/Utility.h ++++ b/src/C++/Utility.h +@@ -112,7 +112,7 @@ typedef int ssize_t; + + #if defined(HAVE_STD_SHARED_PTR) + namespace ptr = std; +-#elif defined(HAVE_STD_TR1_SHARED_PTR) ++#elif defined(HAVE_STD_TR1_SHARED_PTR_FROM_TR1_MEMORY_HEADER) + #include + namespace ptr = std::tr1; + #elif defined(HAVE_BOOST_SHARED_PTR) +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0004-remove-tests-from-compilatin-unit-performance-and-ac.patch b/recipes/quickfix/all/patches/0004-remove-tests-from-compilatin-unit-performance-and-ac.patch new file mode 100644 index 0000000000000..759485c30b98d --- /dev/null +++ b/recipes/quickfix/all/patches/0004-remove-tests-from-compilatin-unit-performance-and-ac.patch @@ -0,0 +1,25 @@ +From 08dc23e525c4659be9271012c25f43fb193db025 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Tue, 9 Jun 2020 08:45:53 -0300 +Subject: [PATCH 4/8] remove tests from compilatin (unit, performance and + acceptance tests) + +--- + src/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cb4a60c6..df3c245a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,6 +1,6 @@ + add_subdirectory(C++) + +-if( WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) ++if( FALSE ) + + add_executable(at at.cpp getopt.c) + +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch b/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch new file mode 100644 index 0000000000000..3480935d8cd0e --- /dev/null +++ b/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch @@ -0,0 +1,114 @@ +From ea4342aa1cd7ddf68857d1923ac1dceab90586a5 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Tue, 9 Jun 2020 02:14:57 -0300 +Subject: [PATCH 5/8] inc. required CMake version, add conan basic setup and + check compiler features + +opt for unique_ptr vs auto_ptr through CMake option +--- + CMakeLists.txt | 27 +++++++++++---------------- + config.h.in | 15 +++++++++++++++ + 2 files changed, 26 insertions(+), 16 deletions(-) + create mode 100644 config.h.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 48908ead..8789432c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16 FATAL_ERROR) + + option(HAVE_EMX "Build with EMX") + +@@ -11,6 +11,8 @@ set (quickfix_PROJECT_NAME quickfix) + endif() + + project(${quickfix_PROJECT_NAME} VERSION 0.1 LANGUAGES CXX C) ++include(${PROJECT_BINARY_DIR}/../conanbuildinfo.cmake) ++conan_basic_setup() + message("-- Project name ${CMAKE_PROJECT_NAME}") + + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") +@@ -31,13 +33,6 @@ option(HAVE_PYTHON3 "Build with default Python3 version") + if(HAVE_SSL) + # Can set location explicitly, example, cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib + +-find_package(OpenSSL REQUIRED) +-include_directories(${OPENSSL_INCLUDE_DIR}) +- +-message("-- OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") +-message("-- OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") +-message("-- OPENSSL_ROOT_DIR: ${OPENSSL_ROOT_DIR}") +- + message("-- Building with SSL") + add_definitions("-DHAVE_SSL=1") + endif() +@@ -63,12 +58,15 @@ FIND_SHARED_PTR() + if (HAVE_SHARED_PTR_IN_STD_NAMESPACE) + message("-- set HAVE_STD_SHARED_PTR") + add_definitions("-DHAVE_STD_SHARED_PTR=1") ++set(HAVE_STD_SHARED_PTR 1) + elseif(HAVE_SHARED_PTR_IN_TR1_NAMESPACE) + message("-- set HAVE_STD_TR1_SHARED_PTR") + add_definitions("-DHAVE_STD_TR1_SHARED_PTR=1") ++set(HAVE_STD_TR1_SHARED_PTR 1) + elseif(HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER) + message("-- set HAVE_STD_TR1_SHARED_PTR_FROM_TR1_MEMORY_HEADER") + add_definitions("-DHAVE_STD_TR1_SHARED_PTR_FROM_TR1_MEMORY_HEADER=1") ++set(HAVE_STD_TR1_SHARED_PTR_FROM_TR1_MEMORY_HEADER 1) + else() + message("-- shared_ptr not found.") + endif() +@@ -78,6 +76,7 @@ FIND_UNIQUE_PTR() + if (HAVE_UNIQUE_PTR_IN_STD_NAMESPACE) + message("-- set HAVE_STD_UNIQUE_PTR") + add_definitions("-DHAVE_STD_UNIQUE_PTR=1") ++set(HAVE_STD_UNIQUE_PTR 1) + endif() + + if (HAVE_PYTHON) +@@ -91,15 +90,11 @@ find_package(PythonLibs 3 REQUIRED) + include_directories(${PYTHON_INCLUDE_DIRS}) + endif () + +-if( WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) +-add_subdirectory(UnitTest++) +-endif() +- + add_subdirectory(src) +-add_subdirectory(examples) +-if( WIN32) +-add_subdirectory(test) +-endif() ++target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) ++target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_BINARY_DIR}) ++ ++configure_file(config.h.in config.h) + + install(DIRECTORY ${CMAKE_SOURCE_DIR}/spec/ DESTINATION share/quickfix + FILES_MATCHING PATTERN "FIX*.xml") +diff --git a/config.h.in b/config.h.in +new file mode 100644 +index 00000000..ffaffb5f +--- /dev/null ++++ b/config.h.in +@@ -0,0 +1,15 @@ ++#ifndef HAVE_STD_SHARED_PTR ++#cmakedefine HAVE_STD_SHARED_PTR ++#endif ++ ++#ifndef HAVE_STD_TR1_SHARED_PTR ++#cmakedefine HAVE_STD_TR1_SHARED_PTR ++#endif ++ ++#ifndef HAVE_STD_TR1_SHARED_PTR_FROM_TR1_MEMORY_HEADER ++#cmakedefine HAVE_STD_TR1_SHARED_PTR_FROM_TR1_MEMORY_HEADER ++#endif ++ ++#ifndef HAVE_STD_UNIQUE_PTR ++#cmakedefine HAVE_STD_UNIQUE_PTR ++#endif +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0006-manage-postgres-through-conan.patch b/recipes/quickfix/all/patches/0006-manage-postgres-through-conan.patch new file mode 100644 index 0000000000000..2f7df582fae62 --- /dev/null +++ b/recipes/quickfix/all/patches/0006-manage-postgres-through-conan.patch @@ -0,0 +1,25 @@ +From 96e595483cc068530d306b851080499931770562 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Sun, 14 Jun 2020 22:44:09 -0300 +Subject: [PATCH 6/8] manage postgres through conan + +--- + CMakeLists.txt | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8789432c..4392bd55 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,8 +46,6 @@ add_definitions("-DHAVE_MYSQL=1") + endif() + + if(HAVE_POSTGRESQL) +-find_package(PostgreSQL REQUIRED) +-include_directories(${PostgreSQL_INCLUDE_DIRS}) + + message("-- Building with POSTGRESQL") + add_definitions("-DHAVE_POSTGRESQL=1") +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0007-add-support-to-static-libraries-for-non-windows-buil.patch b/recipes/quickfix/all/patches/0007-add-support-to-static-libraries-for-non-windows-buil.patch new file mode 100644 index 0000000000000..c720998f9e573 --- /dev/null +++ b/recipes/quickfix/all/patches/0007-add-support-to-static-libraries-for-non-windows-buil.patch @@ -0,0 +1,42 @@ +From ede1a5d292edb46253ffc6996fab8679e7f87a43 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Mon, 15 Jun 2020 00:01:26 -0300 +Subject: [PATCH 7/8] add support to static libraries for non windows builds + +--- + CMakeLists.txt | 1 + + src/C++/CMakeLists.txt | 6 +++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4392bd55..44b8349e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,6 +21,7 @@ include(QuickfixPlatformSettings) + include(QuickfixPrebuildSetup) + + # Call cmake with-DHAVE_SSL=ON to compile with SSL. Similarly for others. ++option(BUILD_SHARED_LIBS "Build shared libraries") + option(HAVE_SSL "Build with SSL") + option(HAVE_MYSQL "Build with MySQL") + option(HAVE_POSTGRESQL "Build with PostgreSQL") +diff --git a/src/C++/CMakeLists.txt b/src/C++/CMakeLists.txt +index 07774c97..9cde5428 100644 +--- a/src/C++/CMakeLists.txt ++++ b/src/C++/CMakeLists.txt +@@ -67,7 +67,11 @@ if (WIN32) + set_target_properties (${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX d) + target_link_libraries(${PROJECT_NAME} ${OPENSSL_LIBRARIES} ${MYSQL_CLIENT_LIBS} ${PostgreSQL_LIBRARIES} ws2_32) + else() +- add_library(${PROJECT_NAME} SHARED ${quickfix_SOURCES}) ++ if (BUILD_SHARED_LIBS) ++ add_library(${PROJECT_NAME} SHARED ${quickfix_SOURCES}) ++ else() ++ add_library(${PROJECT_NAME} STATIC ${quickfix_SOURCES}) ++ endif() + target_link_libraries(${PROJECT_NAME} ${OPENSSL_LIBRARIES} ${MYSQL_CLIENT_LIBS} ${PostgreSQL_LIBRARIES} pthread) + endif() + +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0008-manage-mysql-through-conan.patch b/recipes/quickfix/all/patches/0008-manage-mysql-through-conan.patch new file mode 100644 index 0000000000000..4c93bc150e2cf --- /dev/null +++ b/recipes/quickfix/all/patches/0008-manage-mysql-through-conan.patch @@ -0,0 +1,41 @@ +From 982de1f0b669bf67bba769f3fb9439082d4b0953 Mon Sep 17 00:00:00 2001 +From: Tarcisio Rodrigues +Date: Sun, 21 Jun 2020 16:49:43 -0300 +Subject: [PATCH 8/8] manage mysql through conan + +--- + CMakeLists.txt | 2 -- + src/C++/MySQLConnection.h | 4 ++-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44b8349e..1da4cfd7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,8 +39,6 @@ add_definitions("-DHAVE_SSL=1") + endif() + + if(HAVE_MYSQL) +-find_package(MySQL REQUIRED) +-include_directories(${MYSQL_INCLUDE_DIR}) + + message("-- Building with MySQL") + add_definitions("-DHAVE_MYSQL=1") +diff --git a/src/C++/MySQLConnection.h b/src/C++/MySQLConnection.h +index 21d16472..00aadf11 100644 +--- a/src/C++/MySQLConnection.h ++++ b/src/C++/MySQLConnection.h +@@ -174,8 +174,8 @@ private: + throw ConfigError( std::string("Unable to connect to database [") + mysql_error(m_pConnection) + "]" ); + } + #if( MYSQL_VERSION_ID > 50000 ) +- my_bool reconnect = 1; +- mysql_options( m_pConnection, MYSQL_OPT_RECONNECT, static_cast(&reconnect) ); ++ bool reconnect = 1; ++ mysql_options( m_pConnection, MYSQL_OPT_RECONNECT, static_cast(&reconnect) ); + #endif + } + +-- +2.25.0 + diff --git a/recipes/quickfix/all/patches/0009-downgrade-cmake-minimum-required.patch b/recipes/quickfix/all/patches/0009-downgrade-cmake-minimum-required.patch new file mode 100644 index 0000000000000..258ed6dfea3f2 --- /dev/null +++ b/recipes/quickfix/all/patches/0009-downgrade-cmake-minimum-required.patch @@ -0,0 +1,10 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1da4cfd..1ef3d96 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.16 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.15 FATAL_ERROR) + + option(HAVE_EMX "Build with EMX") + diff --git a/recipes/quickfix/all/test_package/CMakeLists.txt b/recipes/quickfix/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..57cf0bfd3debb --- /dev/null +++ b/recipes/quickfix/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(executor ${PROJECT_SOURCE_DIR}/executor.cpp) +target_link_libraries(executor ${CONAN_LIBS}) diff --git a/recipes/quickfix/all/test_package/conanfile.py b/recipes/quickfix/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a68d648c5c5b5 --- /dev/null +++ b/recipes/quickfix/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class QuickfixTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "executor") + self.run(bin_path, run_environment=True) diff --git a/recipes/quickfix/all/test_package/executor.cpp b/recipes/quickfix/all/test_package/executor.cpp new file mode 100644 index 0000000000000..78de4ee1ca531 --- /dev/null +++ b/recipes/quickfix/all/test_package/executor.cpp @@ -0,0 +1,69 @@ +#include "quickfix/config.h" + +#include "quickfix/FileStore.h" +#include "quickfix/Application.h" +#include "quickfix/SocketAcceptor.h" +#include "quickfix/Log.h" +#include "quickfix/SessionSettings.h" +#include "quickfix/DOMDocument.h" +#include "quickfix/DataDictionaryProvider.h" + + +class Attributes : public FIX::DOMAttributes +{ }; + +class Node : public FIX::DOMNode +{ +public: + virtual ~Node(){ }; +private: + virtual SmartPtr getFirstChildNode() + { Node * ptr; return SmartPtr(ptr); } + virtual SmartPtr getNextSiblingNode() + { Node * ptr; return SmartPtr(ptr); } + virtual SmartPtr getAttributes() + { Attributes * ptr; return SmartPtr(ptr); } + virtual std::string getName() + { return ""; } + virtual std::string getText() + { return ""; } +}; + +class Application + : public FIX::Application +{ +public: + // Application overloads + void onCreate( const FIX::SessionID& ) {} + void onLogon( const FIX::SessionID& sessionID ) {} + void onLogout( const FIX::SessionID& sessionID ) {} + void toAdmin( FIX::Message&, const FIX::SessionID& ) {} + void toApp( FIX::Message&, const FIX::SessionID& ) + EXCEPT( FIX::DoNotSend ) {}; + void fromAdmin( const FIX::Message&, const FIX::SessionID& ) + EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) + {} + void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) + EXCEPT( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) + {} +}; + +int main( int argc, char** argv ) +{ + try + { + Node node; + FIX::DataDictionaryProvider provider; + provider.addTransportDataDictionary( FIX::BeginString("FIX.4.2"), ptr::shared_ptr(new FIX::DataDictionary()) ); + Application application; + FIX::SessionSettings settings( "" ); + FIX::FileStoreFactory storeFactory( settings ); + FIX::ScreenLogFactory logFactory( settings ); + + FIX::SocketAcceptor acceptor( application, storeFactory, settings, logFactory ); + } + catch( std::exception & ) + { } + + return 0; +} diff --git a/recipes/quickfix/config.yml b/recipes/quickfix/config.yml new file mode 100644 index 0000000000000..97169c94442c5 --- /dev/null +++ b/recipes/quickfix/config.yml @@ -0,0 +1,3 @@ +versions: + "1.15.1": + folder: all diff --git a/recipes/quickjs/all/CMakeLists.txt b/recipes/quickjs/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd4c048f85e13 --- /dev/null +++ b/recipes/quickjs/all/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 3.4) +project(quickjs C) + +option(USE_BIGNUM "Use bignum" ON) +option(DUMP_LEAKS "dump leaks" OFF) + +file(STRINGS ${QUICKJS_SRC_DIR}/VERSION version) +set(cdef CONFIG_VERSION="${version}" _GNU_SOURCE) + +set(QUICKJS_SRC + ${QUICKJS_SRC_DIR}/quickjs.c + ${QUICKJS_SRC_DIR}/libbf.c + ${QUICKJS_SRC_DIR}/libregexp.c + ${QUICKJS_SRC_DIR}/libunicode.c + ${QUICKJS_SRC_DIR}/cutils.c + ${QUICKJS_SRC_DIR}/quickjs-libc.c +) + +set(QUICKJS_INC + ${QUICKJS_SRC_DIR}/cutils.h + ${QUICKJS_SRC_DIR}/libregexp-opcode.h + ${QUICKJS_SRC_DIR}/libregexp.h + ${QUICKJS_SRC_DIR}/libunicode-table.h + ${QUICKJS_SRC_DIR}/libunicode.h + ${QUICKJS_SRC_DIR}/list.h + ${QUICKJS_SRC_DIR}/quickjs-atom.h + ${QUICKJS_SRC_DIR}/quickjs-libc.h + ${QUICKJS_SRC_DIR}/quickjs-opcode.h + ${QUICKJS_SRC_DIR}/quickjs.h + ${QUICKJS_SRC_DIR}/unicode_gen_def.h +) + +if(USE_BIGNUM) + list(APPEND QUICKJS_SRC ${QUICKJS_SRC_DIR}/libbf.c) + list(APPEND QUICKJS_INC ${QUICKJS_SRC_DIR}/libbf.h) +endif() + +add_library(quickjs ${QUICKJS_SRC}) +target_include_directories(quickjs PRIVATE ${QUICKJS_SRC_DIR}) +set_target_properties(quickjs PROPERTIES + PUBLIC_HEADER "${QUICKJS_INC}" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +find_library(LIBM m) +target_link_libraries(quickjs PRIVATE $<$:${LIBM}>) + +if(DUMP_LEAKS) + target_compile_definitions(quickjs PRIVATE ${cdef} DUMP_LEAKS) +else() + target_compile_definitions(quickjs PRIVATE ${cdef}) +endif() + +include(GNUInstallDirs) + +install( + TARGETS quickjs + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/quickjs +) diff --git a/recipes/quickjs/all/conandata.yml b/recipes/quickjs/all/conandata.yml new file mode 100644 index 0000000000000..b6c326416c7bf --- /dev/null +++ b/recipes/quickjs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2021-03-27": + url: "https://bellard.org/quickjs/quickjs-2021-03-27.tar.xz" + sha256: "a45bface4c3379538dea8533878d694e289330488ea7028b105f72572fe7fe1a" diff --git a/recipes/quickjs/all/conanfile.py b/recipes/quickjs/all/conanfile.py new file mode 100644 index 0000000000000..8e68a544366f1 --- /dev/null +++ b/recipes/quickjs/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.47.0" + +class QuickJSConan(ConanFile): + name = "quickjs" + description = "QuickJS is a small and embeddable Javascript engine." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bellard.org/quickjs/" + topics = ("Javascript", "embeddable", "ES2020", "asynchronous") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_bignum": [True, False], + "dump_leaks": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_bignum" : True, + "dump_leaks": False, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + 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 + + def validate(self): + # TODO: there are forked repository to support MSVC. (https://github.com/c-smile/quickjspp) + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be built on Visual Studio and msvc.") + + 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["QUICKJS_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["USE_BIGNUM"] = self.options.use_bignum + tc.variables["DUMP_LEAKS"] = self.options.dump_leaks + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["quickjs"] + + if self.options.use_bignum == True: + self.cpp_info.defines.append("CONFIG_BIGNUM") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/quickjs/all/test_package/CMakeLists.txt b/recipes/quickjs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6ebd1f3afdc4 --- /dev/null +++ b/recipes/quickjs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package C) + +find_package(quickjs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE quickjs::quickjs) diff --git a/recipes/quickjs/all/test_package/conanfile.py b/recipes/quickjs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/quickjs/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/quickjs/all/test_package/test_package.c b/recipes/quickjs/all/test_package/test_package.c new file mode 100644 index 0000000000000..25a64b9418971 --- /dev/null +++ b/recipes/quickjs/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "quickjs/quickjs.h" + +int main() { + struct JSRuntime* rt = JS_NewRuntime(); + + JS_FreeRuntime(rt); + + return 0; +} diff --git a/recipes/quickjs/all/test_v1_package/CMakeLists.txt b/recipes/quickjs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c0436c623e76 --- /dev/null +++ b/recipes/quickjs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(quickjs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE quickjs::quickjs) diff --git a/recipes/quickjs/all/test_v1_package/conanfile.py b/recipes/quickjs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/quickjs/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/quickjs/config.yml b/recipes/quickjs/config.yml new file mode 100644 index 0000000000000..4110c6ceb7c0f --- /dev/null +++ b/recipes/quickjs/config.yml @@ -0,0 +1,3 @@ +versions: + "2021-03-27": + folder: "all" diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml new file mode 100644 index 0000000000000..6251899f54ebd --- /dev/null +++ b/recipes/quill/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "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" + "2.5.1": + url: "https://github.com/odygrd/quill/archive/v2.5.1.tar.gz" + sha256: "62227595cc2b4c0c42ed35f17ef5b7487d8231aca9e75234a4c0e346cea19928" + "2.4.2": + url: "https://github.com/odygrd/quill/archive/v2.4.2.tar.gz" + sha256: "4771dc08c0ff01cea9081d645ed7cae27cfa073185c986177ef3ce13743136af" + "2.3.4": + url: "https://github.com/odygrd/quill/archive/v2.3.4.tar.gz" + sha256: "b44d345c07b3023fcd1b88fd9d2554429bb8cccb6285d703d0b0907d9aa85fa1" + "2.2.0": + url: "https://github.com/odygrd/quill/archive/v2.2.0.tar.gz" + sha256: "6b123b60b16d41009228d907851f025c8be974d5fcf41af0b6afbe48edebbf73" + "2.1.0": + url: "https://github.com/odygrd/quill/archive/v2.1.0.tar.gz" + sha256: "66c59501ad827207e7d4682ccba0f1c33ca215269aa13a388df4d59ca195ee76" + "2.0.2": + url: "https://github.com/odygrd/quill/archive/v2.0.2.tar.gz" + sha256: "d2dc9004886b787f8357e97d2f2d0c74a460259f7f95d65ab49d060fe34a9b5c" + "1.7.3": + url: "https://github.com/odygrd/quill/archive/v1.7.3.tar.gz" + sha256: "3fff0c5ffb19bbde5429369079741f84a6acce3a781b504cec5e677b05461208" diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py new file mode 100644 index 0000000000000..b91c210a46df0 --- /dev/null +++ b/recipes/quill/all/conanfile.py @@ -0,0 +1,175 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +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" if Version(self.version) >= "2.0.0" else "14" + + @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", + }, + } + + 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") + + def requirements(self): + self.requires("fmt/10.0.0", 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[self._min_cppstd] + 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 \ + 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 + + 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 Version(self.version) >= "2.0.0": + 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() + + 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") + + 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": + 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 new file mode 100644 index 0000000000000..d53c2b924044a --- /dev/null +++ b/recipes/quill/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +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() diff --git a/recipes/quill/all/test_package/conanfile.py b/recipes/quill/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/quill/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/quill/all/test_package/test_package.cpp b/recipes/quill/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ab2f3ef6f2de8 --- /dev/null +++ b/recipes/quill/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "quill/Quill.h" + +int main() +{ + quill::start(); + auto file_handler = quill::file_handler("logfile.log", "w"); + 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/quill/all/test_v1_package/CMakeLists.txt b/recipes/quill/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/quill/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/quill/all/test_v1_package/conanfile.py b/recipes/quill/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/quill/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml new file mode 100644 index 0000000000000..5cd8b62893f38 --- /dev/null +++ b/recipes/quill/config.yml @@ -0,0 +1,23 @@ +versions: + "2.9.0": + folder: "all" + "2.8.0": + folder: "all" + "2.7.0": + folder: "all" + "2.6.0": + folder: "all" + "2.5.1": + folder: "all" + "2.4.2": + folder: "all" + "2.3.4": + folder: "all" + "2.2.0": + folder: "all" + "2.1.0": + folder: "all" + "2.0.2": + folder: "all" + "1.7.3": + folder: "all" diff --git a/recipes/quirc/all/CMakeLists.txt b/recipes/quirc/all/CMakeLists.txt new file mode 100644 index 0000000000000..5fed0b8bc7102 --- /dev/null +++ b/recipes/quirc/all/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.4.3) +project(quirc LANGUAGES C) + +include(GNUInstallDirs) + +set(QUIRC_MAX_REGIONS 254 CACHE STRING "Maximum number of regions") + +add_library(quirc + ${QUIRC_SRC_DIR}/decode.c + ${QUIRC_SRC_DIR}/identify.c + ${QUIRC_SRC_DIR}/quirc.c + ${QUIRC_SRC_DIR}/version_db.c +) + +target_compile_definitions(quirc PRIVATE QUIRC_MAX_REGIONS=${QUIRC_MAX_REGIONS}) +set_target_properties(quirc PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS TRUE + VERSION ${QUIRC_VERSION} +) + +install( + TARGETS quirc + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install(FILES ${QUIRC_SRC_DIR}/quirc.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/quirc/all/conandata.yml b/recipes/quirc/all/conandata.yml new file mode 100644 index 0000000000000..91fd4b44c4dfb --- /dev/null +++ b/recipes/quirc/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.1": + url: "https://github.com/dlbeer/quirc/archive/v1.1.tar.gz" + sha256: "5102ccb57639cb355642c1f8af0d815026c948d85d99bf9b86be5746e759f8e6" + "1.0": + url: "https://github.com/dlbeer/quirc/archive/v1.0.tar.gz" + sha256: "91bba64ffca5b84aa953b88d5f5ccc9507275345c200fd581dca24fbf66b3706" +patches: + "1.1": + - patch_file: "patches/remove-c99-features.patch" + "1.0": + - patch_file: "patches/replace-vla.patch" diff --git a/recipes/quirc/all/conanfile.py b/recipes/quirc/all/conanfile.py new file mode 100644 index 0000000000000..c8baf1e6dbb2c --- /dev/null +++ b/recipes/quirc/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class QuircConan(ConanFile): + name = "quirc" + description = "QR decoder library" + license = "ISC" + topics = ("qr", "decoder") + homepage = "https://github.com/dlbeer/quirc" + 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], + "max_regions": [254, 65534], + } + default_options = { + "shared": False, + "fPIC": True, + "max_regions": 254, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QUIRC_SRC_DIR"] = os.path.join(self.source_folder, "lib").replace("\\", "/") + tc.variables["QUIRC_VERSION"] = self.version + tc.variables["QUIRC_MAX_REGIONS"] = self.options.max_regions + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["quirc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/quirc/all/patches/remove-c99-features.patch b/recipes/quirc/all/patches/remove-c99-features.patch new file mode 100644 index 0000000000000..1c35a2705effd --- /dev/null +++ b/recipes/quirc/all/patches/remove-c99-features.patch @@ -0,0 +1,35 @@ +--- a/lib/identify.c ++++ b/lib/identify.c +@@ -180,9 +180,8 @@ static uint8_t otsu(const struct quirc *q) + int numPixels = q->w * q->h; + + // Calculate histogram +- const int HISTOGRAM_SIZE = 256; +- unsigned int histogram[HISTOGRAM_SIZE]; +- memset(histogram, 0, (HISTOGRAM_SIZE) * sizeof(unsigned int)); ++ unsigned int histogram[UINT8_MAX + 1]; ++ (void)memset(histogram, 0, sizeof(histogram)); + uint8_t* ptr = q->image; + int length = numPixels; + while (length--) { +@@ -191,8 +190,9 @@ static uint8_t otsu(const struct quirc *q) + } + + // Calculate weighted sum of histogram values +- int sum = 0; +- for (int i = 0; i < HISTOGRAM_SIZE; ++i) { ++ unsigned int sum = 0; ++ unsigned int i = 0; ++ for (i = 0; i <= UINT8_MAX; ++i) { + sum += i * histogram[i]; + } + +@@ -201,7 +201,7 @@ static uint8_t otsu(const struct quirc *q) + int q1 = 0; + double max = 0; + uint8_t threshold = 0; +- for (int i = 0; i < HISTOGRAM_SIZE; ++i) { ++ for (i = 0; i <= UINT8_MAX; ++i) { + // Weighted background + q1 += histogram[i]; + if (q1 == 0) diff --git a/recipes/quirc/all/patches/replace-vla.patch b/recipes/quirc/all/patches/replace-vla.patch new file mode 100644 index 0000000000000..fbe6d8a10e8a3 --- /dev/null +++ b/recipes/quirc/all/patches/replace-vla.patch @@ -0,0 +1,115 @@ +--- a/lib/identify.c ++++ b/lib/identify.c +@@ -196,9 +196,7 @@ static void threshold(struct quirc *q) + threshold_s = THRESHOLD_S_MIN; + + for (y = 0; y < q->h; y++) { +- int row_average[q->w]; +- +- memset(row_average, 0, sizeof(row_average)); ++ memset(q->row_average, 0, q->w * sizeof(int)); + + for (x = 0; x < q->w; x++) { + int w, u; +@@ -216,12 +214,12 @@ static void threshold(struct quirc *q) + avg_u = (avg_u * (threshold_s - 1)) / + threshold_s + row[u]; + +- row_average[w] += avg_w; +- row_average[u] += avg_u; ++ q->row_average[w] += avg_w; ++ q->row_average[u] += avg_u; + } + + for (x = 0; x < q->w; x++) { +- if (row[x] < row_average[x] * ++ if (row[x] < q->row_average[x] * + (100 - THRESHOLD_T) / (200 * threshold_s)) + row[x] = QUIRC_PIXEL_BLACK; + else +--- a/lib/quirc.c ++++ b/lib/quirc.c +@@ -36,34 +36,61 @@ struct quirc *quirc_new(void) + + void quirc_destroy(struct quirc *q) + { +- if (q->image) +- free(q->image); ++ free(q->image); + if (sizeof(*q->image) != sizeof(*q->pixels)) + free(q->pixels); +- ++ free(q->row_average); + free(q); + } + + int quirc_resize(struct quirc *q, int w, int h) + { +- uint8_t *new_image = realloc(q->image, w * h); ++ uint8_t *image = NULL; ++ quirc_pixel_t *pixels = NULL; ++ int *row_average = NULL; ++ ++ if (w < 0 || h < 0) ++ goto fail; ++ ++ image = calloc(w, h); ++ if (!image) ++ goto fail; + +- if (!new_image) +- return -1; ++ size_t olddim = q->w * q->h; ++ size_t newdim = w * h; ++ size_t min = (olddim < newdim ? olddim : newdim); ++ ++ (void)memcpy(image, q->image, min); + + if (sizeof(*q->image) != sizeof(*q->pixels)) { +- size_t new_size = w * h * sizeof(quirc_pixel_t); +- quirc_pixel_t *new_pixels = realloc(q->pixels, new_size); +- if (!new_pixels) +- return -1; +- q->pixels = new_pixels; ++ pixels = calloc(newdim, sizeof(quirc_pixel_t)); ++ if (!pixels) ++ goto fail; + } + +- q->image = new_image; ++ row_average = calloc(w, sizeof(int)); ++ if (!row_average) ++ goto fail; ++ + q->w = w; + q->h = h; ++ free(q->image); ++ q->image = image; ++ if (sizeof(*q->image) != sizeof(*q->pixels)) { ++ free(q->pixels); ++ q->pixels = pixels; ++ } ++ free(q->row_average); ++ q->row_average = row_average; + + return 0; ++ /* NOTREACHED */ ++fail: ++ free(image); ++ free(pixels); ++ free(row_average); ++ ++ return -1; + } + + int quirc_count(const struct quirc *q) +--- a/lib/quirc_internal.h ++++ b/lib/quirc_internal.h +@@ -77,6 +77,7 @@ struct quirc_grid { + struct quirc { + uint8_t *image; + quirc_pixel_t *pixels; ++ int *row_average; /* used by threshold() */ + int w; + int h; + diff --git a/recipes/quirc/all/test_package/CMakeLists.txt b/recipes/quirc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a9aef36b5807 --- /dev/null +++ b/recipes/quirc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(quirc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE quirc::quirc) diff --git a/recipes/quirc/all/test_package/conanfile.py b/recipes/quirc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/quirc/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/quirc/all/test_package/test_package.c b/recipes/quirc/all/test_package/test_package.c new file mode 100644 index 0000000000000..fd7a0bfda0934 --- /dev/null +++ b/recipes/quirc/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include +#include + +int main () { + struct quirc *qr; + qr = quirc_new(); + if (!qr) { + fprintf(stderr, "Failed to allocate memory"); + exit(1); + } + + return 0; +} diff --git a/recipes/quirc/all/test_v1_package/CMakeLists.txt b/recipes/quirc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/quirc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/quirc/all/test_v1_package/conanfile.py b/recipes/quirc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/quirc/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/quirc/config.yml b/recipes/quirc/config.yml new file mode 100644 index 0000000000000..d5affdb292771 --- /dev/null +++ b/recipes/quirc/config.yml @@ -0,0 +1,6 @@ +versions: + "1.1": + folder: all + "1.0": + folder: all + diff --git a/recipes/qwt/all/conandata.yml b/recipes/qwt/all/conandata.yml new file mode 100644 index 0000000000000..31f56157576c0 --- /dev/null +++ b/recipes/qwt/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "6.2.0": + url: "https://sourceforge.net/projects/qwt/files/qwt/6.2.0/qwt-6.2.0.zip" + sha256: "3e9632a9be6a883db5c496e42ce74cbbf8da02cc3328faa89e2c43e434a2eb76" +patches: + "6.2.0": + - patch_file: "patches/cmake-support.patch" + patch_source: "https://github.com/MehdiChinoune/qwt/blob/cmake/CMakeLists.txt" + - patch_file: "patches/cmake-support-patch.patch" diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py new file mode 100644 index 0000000000000..3c7b6925650a8 --- /dev/null +++ b/recipes/qwt/all/conanfile.py @@ -0,0 +1,155 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class QwtConan(ConanFile): + name = "qwt" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://qwt.sourceforge.io/" + topics = ("archive", "compression") + description = ( + "The Qwt library contains GUI Components and utility classes which are primarily useful for programs " + "with a technical background. Beside a framework for 2D plots it provides scales, sliders, dials, compasses, " + "thermometers, wheels and knobs to control or display values, arrays, or ranges of type double." + ) + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "plot": [True, False], + "widgets": [True, False], + "svg": [True, False], + "opengl": [True, False], + "designer": [True, False], + "polar": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "plot": True, + "widgets": True, + "svg": False, + "opengl": True, + "designer": False, + "polar": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("qt/5.15.9") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("Qwt recipe does not support cross-compilation yet") + qt_options = self.dependencies["qt"].options + if self.info.options.widgets and not qt_options.widgets: + raise ConanInvalidConfiguration("qwt:widgets=True requires qt:widgets=True") + if self.info.options.svg and not qt_options.qtsvg: + raise ConanInvalidConfiguration("qwt:svg=True requires qt:qtsvg=True") + if self.info.options.opengl and qt_options.opengl == "no": + raise ConanInvalidConfiguration("qwt:opengl=True is not compatible with qt:opengl=no") + if self.info.options.designer and not (qt_options.qttools and qt_options.gui and qt_options.widgets): + raise ConanInvalidConfiguration("qwt:designer=True requires qt:qttools=True, qt::gui=True and qt::widgets=True") + + def build_requirements(self): + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("qt/5.15.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + if hasattr(self, "settings_build") and cross_building(self): + env = VirtualBuildEnv(self) + env.generate() + else: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["QWT_DLL"] = self.options.shared + tc.variables["QWT_STATIC "] = not self.options.shared + tc.variables["QWT_PLOT"] = self.options.plot + tc.variables["QWT_WIDGETS"] = self.options.widgets + tc.variables["QWT_SVG"] = self.options.svg + tc.variables["QWT_OPENGL"] =self.options.opengl + tc.variables["QWT_DESIGNER"] = self.options.designer + tc.variables["QWT_POLAR"] = self.options.polar + tc.variables["QWT_BUILD_PLAYGROUND"] = False + tc.variables["QWT_BUILD_EXAMPLES"] = False + tc.variables["QWT_BUILD_TESTS"] = False + tc.variables["QWT_FRAMEWORK"] = False + tc.variables["CMAKE_INSTALL_DATADIR"] = "res" + 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, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["qwt"] + self.cpp_info.requires = ["qt::qtCore", "qt::qtConcurrent", "qt::qtPrintSupport"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("QWT_DLL") + if not self.options.plot: + self.cpp_info.defines.append("NO_QWT_PLOT") + if not self.options.polar: + self.cpp_info.defines.append("NO_QWT_POLAR") + if self.options.widgets: + self.cpp_info.requires.append("qt::qtWidgets") + else: + self.cpp_info.defines.append("NO_QWT_WIDGETS") + if self.options.opengl: + self.cpp_info.requires.append("qt::qtOpenGL") + if Version(self.dependencies["qt"].ref.version).major >= "6": + self.cpp_info.requires.append("qt::qtOpenGLWidgets") + else: + self.cpp_info.defines.append("QWT_NO_OPENGL") + if self.options.svg: + self.cpp_info.requires.append("qt::qtSvg") + else: + self.cpp_info.defines.append("QWT_NO_SVG") + + if self.options.designer: + qt_plugin_path = os.path.join( + self.package_folder, "res" if self.settings.os == "Windows" else "lib", + f"qt{Version(self.dependencies['qt'].ref.version).major}", "plugins", + ) + self.runenv_info.prepend_path("QT_PLUGIN_PATH", qt_plugin_path) + + # TODO: to remove in conan v2 + self.env_info.QT_PLUGIN_PATH.append(qt_plugin_path) diff --git a/recipes/qwt/all/patches/cmake-support-patch.patch b/recipes/qwt/all/patches/cmake-support-patch.patch new file mode 100644 index 0000000000000..af0f2ec3e1b37 --- /dev/null +++ b/recipes/qwt/all/patches/cmake-support-patch.patch @@ -0,0 +1,32 @@ +From fb0e2add3354cdf39dee7b58e6f6c88aba5d6793 Mon Sep 17 00:00:00 2001 +From: Esteban Dugueperoux + <43169544+EstebanDugueperoux2@users.noreply.github.com> +Date: Thu, 8 Sep 2022 11:10:47 +0000 +Subject: [PATCH] conan: Remove qwt include prefix + + - Remove qwt include prefix to be + compatible with current consumption + of 6.2.0 release through conan center. +--- + src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a6a4bf2..760f84c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -419,10 +419,10 @@ install(FILES + ) + + install(FILES ${HEADERS} +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${QWT_NAME_SUFFIX} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/classincludes/ +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${QWT_NAME_SUFFIX} + PATTERN "classincludes.pro" EXCLUDE + ) + +-- +2.37.2 diff --git a/recipes/qwt/all/patches/cmake-support.patch b/recipes/qwt/all/patches/cmake-support.patch new file mode 100644 index 0000000000000..c303f0f00d8e7 --- /dev/null +++ b/recipes/qwt/all/patches/cmake-support.patch @@ -0,0 +1,1439 @@ +From eeda942e335afb509f297a1778b654e34d5e4c2b Mon Sep 17 00:00:00 2001 +From: Mehdi Chinoune +Date: Sun, 22 Aug 2021 16:14:37 +0100 +Subject: [PATCH] Support CMake buildsystem + +--- + CMakeLists.txt | 127 +++++++ + designer/CMakeLists.txt | 35 ++ + examples/CMakeLists.txt | 41 +++ + examples/animation/CMakeLists.txt | 8 + + examples/barchart/CMakeLists.txt | 8 + + examples/bode/CMakeLists.txt | 11 + + examples/controls/CMakeLists.txt | 22 ++ + examples/cpuplot/CMakeLists.txt | 12 + + examples/curvedemo/CMakeLists.txt | 4 + + examples/dials/CMakeLists.txt | 14 + + examples/distrowatch/CMakeLists.txt | 8 + + examples/friedberg/CMakeLists.txt | 10 + + examples/itemeditor/CMakeLists.txt | 12 + + examples/legends/CMakeLists.txt | 13 + + examples/oscilloscope/CMakeLists.txt | 18 + + examples/polardemo/CMakeLists.txt | 13 + + examples/polarspectrogram/CMakeLists.txt | 10 + + examples/radio/CMakeLists.txt | 10 + + examples/rasterview/CMakeLists.txt | 8 + + examples/realtime/CMakeLists.txt | 16 + + examples/refreshtest/CMakeLists.txt | 15 + + examples/scatterplot/CMakeLists.txt | 8 + + examples/simpleplot/CMakeLists.txt | 4 + + examples/sinusplot/CMakeLists.txt | 4 + + examples/spectrogram/CMakeLists.txt | 8 + + examples/splineeditor/CMakeLists.txt | 12 + + examples/stockchart/CMakeLists.txt | 14 + + examples/sysinfo/CMakeLists.txt | 4 + + examples/tvplot/CMakeLists.txt | 8 + + playground/CMakeLists.txt | 19 + + playground/curvetracker/CMakeLists.txt | 10 + + playground/graphicscale/CMakeLists.txt | 10 + + playground/plotmatrix/CMakeLists.txt | 8 + + playground/rescaler/CMakeLists.txt | 10 + + playground/scaleengine/CMakeLists.txt | 12 + + playground/shapes/CMakeLists.txt | 4 + + playground/svgmap/CMakeLists.txt | 9 + + playground/symbols/CMakeLists.txt | 4 + + playground/timescale/CMakeLists.txt | 13 + + playground/vectorfield/CMakeLists.txt | 4 + + src/CMakeLists.txt | 439 +++++++++++++++++++++++ + src/qwt-config.cmake.in | 17 + + src/qwt.pc.in | 12 + + tests/CMakeLists.txt | 4 + + tests/splineprof/CMakeLists.txt | 4 + + tests/splinetest/CMakeLists.txt | 4 + + 46 files changed, 1060 insertions(+) + create mode 100644 CMakeLists.txt + create mode 100644 designer/CMakeLists.txt + create mode 100644 examples/CMakeLists.txt + create mode 100644 examples/animation/CMakeLists.txt + create mode 100644 examples/barchart/CMakeLists.txt + create mode 100644 examples/bode/CMakeLists.txt + create mode 100644 examples/controls/CMakeLists.txt + create mode 100644 examples/cpuplot/CMakeLists.txt + create mode 100644 examples/curvedemo/CMakeLists.txt + create mode 100644 examples/dials/CMakeLists.txt + create mode 100644 examples/distrowatch/CMakeLists.txt + create mode 100644 examples/friedberg/CMakeLists.txt + create mode 100644 examples/itemeditor/CMakeLists.txt + create mode 100644 examples/legends/CMakeLists.txt + create mode 100644 examples/oscilloscope/CMakeLists.txt + create mode 100644 examples/polardemo/CMakeLists.txt + create mode 100644 examples/polarspectrogram/CMakeLists.txt + create mode 100644 examples/radio/CMakeLists.txt + create mode 100644 examples/rasterview/CMakeLists.txt + create mode 100644 examples/realtime/CMakeLists.txt + create mode 100644 examples/refreshtest/CMakeLists.txt + create mode 100644 examples/scatterplot/CMakeLists.txt + create mode 100644 examples/simpleplot/CMakeLists.txt + create mode 100644 examples/sinusplot/CMakeLists.txt + create mode 100644 examples/spectrogram/CMakeLists.txt + create mode 100644 examples/splineeditor/CMakeLists.txt + create mode 100644 examples/stockchart/CMakeLists.txt + create mode 100644 examples/sysinfo/CMakeLists.txt + create mode 100644 examples/tvplot/CMakeLists.txt + create mode 100644 playground/CMakeLists.txt + create mode 100644 playground/curvetracker/CMakeLists.txt + create mode 100644 playground/graphicscale/CMakeLists.txt + create mode 100644 playground/plotmatrix/CMakeLists.txt + create mode 100644 playground/rescaler/CMakeLists.txt + create mode 100644 playground/scaleengine/CMakeLists.txt + create mode 100644 playground/shapes/CMakeLists.txt + create mode 100644 playground/svgmap/CMakeLists.txt + create mode 100644 playground/symbols/CMakeLists.txt + create mode 100644 playground/timescale/CMakeLists.txt + create mode 100644 playground/vectorfield/CMakeLists.txt + create mode 100644 src/CMakeLists.txt + create mode 100644 src/qwt-config.cmake.in + create mode 100644 src/qwt.pc.in + create mode 100644 tests/CMakeLists.txt + create mode 100644 tests/splineprof/CMakeLists.txt + create mode 100644 tests/splinetest/CMakeLists.txt + +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..004d4a3 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,127 @@ ++cmake_minimum_required(VERSION 3.15) ++ ++project(Qwt ++ VERSION 6.2.0 ++ DESCRIPTION "Qt Widgets for Technical Applications" ++ HOMEPAGE_URL "https://qwt.sourceforge.io" ++ LANGUAGES CXX ++) ++ ++set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD_REQUIRED TRUE) ++set(CMAKE_CXX_EXTENSIONS OFF) ++ ++if(MSVC) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /permissive-") ++else() ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual \ ++ -Wcast-align -Wredundant-decls -Wformat -Wshadow -Woverloaded-virtual \ ++ -fno-math-errno -funsafe-math-optimizations") ++ if(CMAKE_COMPILER_ID STREQUAL "GNU") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op") ++ endif() ++ add_compile_definitions(QT_STRICT_ITERATORS) ++endif() ++ ++include(CheckPIESupported) ++check_pie_supported(OUTPUT_VARIABLE PIE_MESSAGE LANGUAGES CXX) ++if(CMAKE_CXX_LINK_PIE_SUPPORTED) ++ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) ++endif() ++ ++include(GNUInstallDirs) ++ ++set(QWT_NAME_SUFFIX "" CACHE STRING "Qwt Name Suffix") ++ ++set(QWT_QT_VERSION_MAJOR "A" CACHE ++ STRING "Expected Qt major version. Valid values are A (auto-select), 5, 6.") ++set(SUPPORTED_QT_VERSIONS "A" 5 6) ++set_property(CACHE QWT_QT_VERSION_MAJOR PROPERTY STRINGS ${SUPPORTED_QT_VERSIONS}) ++if(NOT QWT_QT_VERSION_MAJOR STREQUAL "A") ++ if(NOT QWT_QT_VERSION_MAJOR IN_LIST SUPPORTED_QT_VERSIONS) ++ message(FATAL_ERROR "Supported Qt versions are \"${SUPPORTED_QT_VERSIONS}\"." ++ " But QWT_QT_VERSION_MAJOR is set to ${QWT_QT_VERSION_MAJOR}.") ++ endif() ++endif() ++ ++option(QWT_DLL "Build shared library" ON) ++ ++option(QWT_STATIC "Build static library" OFF) ++ ++if(NOT (QWT_DLL OR QWT_STATIC)) ++ message(FATAL_ERROR "QWT_DLL and QWT_STATIC are both set to OFF") ++endif() ++ ++option(QWT_PLOT "Enable QwtPlot widget" ON) ++ ++option(QWT_POLAR "Enable QwtPolar classes" ON) ++ ++option(QWT_WIDGETS "Enables other widgets (sliders, dials, ...), beside QwtPlot" ON) ++ ++option(QWT_SVG "Enable SVG Support (Displaying & Exporting)" ON) ++ ++option(QWT_OPENGL "Enable OpenGL Plot Canvas" ON) ++ ++option(QWT_DESIGNER "Build Qwt Designer plugin" ON) ++ ++if(WIN32) ++ option(QWT_DESIGNER_SELF_CONTAINED "Build a self-contained designer plugin" ON) ++endif() ++ ++if(APPLE) ++ option(QWT_FRAMEWORK "Build Qwt as a framework" ON) ++endif() ++ ++option(QWT_BUILD_PLAYGROUND "Build the applications in playground" OFF) ++ ++option(QWT_BUILD_TESTS "Build Tests" OFF) ++ ++option(QWT_BUILD_EXAMPLES "Build Examples" OFF) ++ ++if(QWT_QT_VERSION_MAJOR STREQUAL "A") ++ find_package(Qt6 COMPONENTS Core QUIET) ++ if(Qt6_FOUND) ++ set(QT_VERSION ${Qt6_VERSION}) ++ set(QT_VERSION_MAJOR 6) ++ else() ++ find_package(Qt5 COMPONENTS Core REQUIRED) ++ set(QT_VERSION ${Qt5_VERSION}) ++ set(QT_VERSION_MAJOR 5) ++ endif() ++else() ++ find_package(Qt${QWT_QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) ++ set(QT_VERSION ${Qt${QWT_QT_VERSION_MAJOR}_VERSION}) ++ set(QT_VERSION_MAJOR ${QWT_QT_VERSION_MAJOR}) ++endif() ++ ++find_package(Qt${QT_VERSION_MAJOR} COMPONENTS PrintSupport Concurrent Widgets REQUIRED) ++ ++if(QWT_OPENGL) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS OpenGL REQUIRED) ++ if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS OpenGLWidgets REQUIRED) ++ endif() ++endif() ++ ++if(QWT_SVG) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Svg REQUIRED) ++endif() ++ ++add_subdirectory(src) ++ ++if(QWT_DESIGNER) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Designer) ++ add_subdirectory(designer) ++endif() ++ ++if(QWT_BUILD_PLAYGROUND) ++ add_subdirectory(playground) ++endif() ++ ++if(QWT_BUILD_TESTS) ++ add_subdirectory(tests) ++endif() ++ ++if(QWT_BUILD_EXAMPLES) ++ add_subdirectory(examples) ++endif() +diff --git a/designer/CMakeLists.txt b/designer/CMakeLists.txt +new file mode 100644 +index 0000000..aa81efd +--- /dev/null ++++ b/designer/CMakeLists.txt +@@ -0,0 +1,35 @@ ++if(QWT_DESIGNER_SELF_CONTAINED) ++ add_library(qwt_designer_plugin SHARED ++ qwt_designer_plugin.cpp ++ qwt_designer_plugin.qrc ++ $ ++ ) ++ target_link_libraries(qwt_designer_plugin PRIVATE qwt_objects) ++ target_compile_definitions(qwt_designer_plugin PRIVATE ++ QWT_MAKEDLL ++ QT_NO_KEYWORDS ++ QWT_MOC_INCLUDE ++ ) ++else() ++ add_library(qwt_designer_plugin SHARED ++ qwt_designer_plugin.cpp ++ qwt_designer_plugin.qrc ++ ) ++ target_link_libraries(qwt_designer_plugin PRIVATE qwt) ++endif() ++ ++target_link_libraries(qwt_designer_plugin PUBLIC Qt${QT_VERSION_MAJOR}::Designer) ++ ++set_target_properties(qwt_designer_plugin PROPERTIES ++ AUTOMOC ON ++ AUTORCC ON ++) ++ ++if(MINGW) ++ set_target_properties(qwt_designer_plugin PROPERTIES PREFIX "") ++endif() ++ ++install(TARGETS qwt_designer_plugin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_DATADIR}/qt${QT_VERSION_MAJOR}/plugins/designer ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/plugins/designer ++) +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +new file mode 100644 +index 0000000..522436c +--- /dev/null ++++ b/examples/CMakeLists.txt +@@ -0,0 +1,41 @@ ++ ++set(CMAKE_AUTOMOC ON) ++ ++if(QWT_PLOT) ++ add_subdirectory(animation) ++ add_subdirectory(barchart) ++ add_subdirectory(cpuplot) ++ add_subdirectory(curvedemo) ++ add_subdirectory(distrowatch) ++ add_subdirectory(friedberg) ++ add_subdirectory(itemeditor) ++ add_subdirectory(legends) ++ add_subdirectory(stockchart) ++ add_subdirectory(simpleplot) ++ add_subdirectory(sinusplot) ++ add_subdirectory(realtime) ++ add_subdirectory(refreshtest) ++ add_subdirectory(scatterplot) ++ add_subdirectory(spectrogram) ++ add_subdirectory(rasterview) ++ add_subdirectory(tvplot) ++ ++ if(QWT_WIDGETS) ++ add_subdirectory(bode) ++ add_subdirectory(splineeditor) ++ add_subdirectory(oscilloscope) ++ endif() ++ ++ if(QWT_POLAR) ++ add_subdirectory(polardemo) ++ add_subdirectory(polarspectrogram) ++ endif() ++ ++endif() ++ ++if(QWT_WIDGETS) ++ add_subdirectory(sysinfo) ++ add_subdirectory(radio) ++ add_subdirectory(dials) ++ add_subdirectory(controls) ++endif() +diff --git a/examples/animation/CMakeLists.txt b/examples/animation/CMakeLists.txt +new file mode 100644 +index 0000000..b5559c6 +--- /dev/null ++++ b/examples/animation/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(animation ++ main.cpp ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(animation qwt) +diff --git a/examples/barchart/CMakeLists.txt b/examples/barchart/CMakeLists.txt +new file mode 100644 +index 0000000..e09a78a +--- /dev/null ++++ b/examples/barchart/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(barchart ++ main.cpp ++ BarChart.cpp ++ BarChart.h ++) ++ ++target_link_libraries(barchart qwt) +diff --git a/examples/bode/CMakeLists.txt b/examples/bode/CMakeLists.txt +new file mode 100644 +index 0000000..d0a7d77 +--- /dev/null ++++ b/examples/bode/CMakeLists.txt +@@ -0,0 +1,11 @@ ++ ++add_executable(bode ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Pixmaps.h ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(bode qwt) +diff --git a/examples/controls/CMakeLists.txt b/examples/controls/CMakeLists.txt +new file mode 100644 +index 0000000..c6467ed +--- /dev/null ++++ b/examples/controls/CMakeLists.txt +@@ -0,0 +1,22 @@ ++ ++add_executable(controls ++ main.cpp ++ SliderBox.h ++ SliderTab.h ++ WheelBox.h ++ WheelTab.h ++ KnobBox.h ++ KnobTab.h ++ DialBox.h ++ DialTab.h ++ SliderBox.cpp ++ SliderTab.cpp ++ WheelBox.cpp ++ WheelTab.cpp ++ KnobBox.cpp ++ KnobTab.cpp ++ DialBox.cpp ++ DialTab.cpp ++) ++ ++target_link_libraries(controls qwt) +diff --git a/examples/cpuplot/CMakeLists.txt b/examples/cpuplot/CMakeLists.txt +new file mode 100644 +index 0000000..9eecb0a +--- /dev/null ++++ b/examples/cpuplot/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(cpuplot ++ main.cpp ++ CpuPieMarker.cpp ++ CpuPieMarker.h ++ CpuPlot.cpp ++ CpuPlot.h ++ CpuStat.cpp ++ CpuStat.h ++) ++ ++target_link_libraries(cpuplot qwt) +diff --git a/examples/curvedemo/CMakeLists.txt b/examples/curvedemo/CMakeLists.txt +new file mode 100644 +index 0000000..75b6514 +--- /dev/null ++++ b/examples/curvedemo/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(curvedemo main.cpp) ++ ++target_link_libraries(curvedemo qwt) +diff --git a/examples/dials/CMakeLists.txt b/examples/dials/CMakeLists.txt +new file mode 100644 +index 0000000..5f2ca85 +--- /dev/null ++++ b/examples/dials/CMakeLists.txt +@@ -0,0 +1,14 @@ ++ ++add_executable(dials ++ main.cpp ++ AttitudeIndicator.h ++ SpeedoMeter.h ++ CockpitGrid.h ++ CompassGrid.h ++ AttitudeIndicator.cpp ++ SpeedoMeter.cpp ++ CockpitGrid.cpp ++ CompassGrid.cpp ++) ++ ++target_link_libraries(dials qwt) +diff --git a/examples/distrowatch/CMakeLists.txt b/examples/distrowatch/CMakeLists.txt +new file mode 100644 +index 0000000..c9b7e02 +--- /dev/null ++++ b/examples/distrowatch/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(distrowatch ++ main.cpp ++ BarChart.cpp ++ BarChart.h ++) ++ ++target_link_libraries(distrowatch qwt) +diff --git a/examples/friedberg/CMakeLists.txt b/examples/friedberg/CMakeLists.txt +new file mode 100644 +index 0000000..322b631 +--- /dev/null ++++ b/examples/friedberg/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(friedberg ++ main.cpp ++ Friedberg2007.h ++ Friedberg2007.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(friedberg qwt) +diff --git a/examples/itemeditor/CMakeLists.txt b/examples/itemeditor/CMakeLists.txt +new file mode 100644 +index 0000000..0d2df52 +--- /dev/null ++++ b/examples/itemeditor/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(itemeditor ++ main.cpp ++ Editor.h ++ ShapeFactory.h ++ Plot.h ++ Editor.cpp ++ ShapeFactory.cpp ++ Plot.cpp ++) ++ ++target_link_libraries(itemeditor qwt) +diff --git a/examples/legends/CMakeLists.txt b/examples/legends/CMakeLists.txt +new file mode 100644 +index 0000000..7ad01b3 +--- /dev/null ++++ b/examples/legends/CMakeLists.txt +@@ -0,0 +1,13 @@ ++ ++add_executable(legends ++ main.cpp ++ MainWindow.h ++ Panel.h ++ Settings.h ++ Plot.h ++ MainWindow.cpp ++ Panel.cpp ++ Plot.cpp ++) ++ ++target_link_libraries(legends qwt) +diff --git a/examples/oscilloscope/CMakeLists.txt b/examples/oscilloscope/CMakeLists.txt +new file mode 100644 +index 0000000..828b8fe +--- /dev/null ++++ b/examples/oscilloscope/CMakeLists.txt +@@ -0,0 +1,18 @@ ++ ++add_executable(oscilloscope ++ main.cpp ++ SignalData.h ++ Plot.h ++ Knob.h ++ WheelBox.h ++ SamplingThread.h ++ MainWindow.h ++ SignalData.cpp ++ Plot.cpp ++ Knob.cpp ++ WheelBox.cpp ++ SamplingThread.cpp ++ MainWindow.cpp ++) ++ ++target_link_libraries(oscilloscope qwt) +diff --git a/examples/polardemo/CMakeLists.txt b/examples/polardemo/CMakeLists.txt +new file mode 100644 +index 0000000..3683dfd +--- /dev/null ++++ b/examples/polardemo/CMakeLists.txt +@@ -0,0 +1,13 @@ ++ ++add_executable(polardemo ++ main.cpp ++ Pixmaps.h ++ PlotBox.h ++ Plot.h ++ SettingsEditor.h ++ PlotBox.cpp ++ Plot.cpp ++ SettingsEditor.cpp ++) ++ ++target_link_libraries(polardemo qwt) +diff --git a/examples/polarspectrogram/CMakeLists.txt b/examples/polarspectrogram/CMakeLists.txt +new file mode 100644 +index 0000000..e4a1c22 +--- /dev/null ++++ b/examples/polarspectrogram/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(polarspectrogram ++ main.cpp ++ Plot.h ++ PlotWindow.h ++ Plot.cpp ++ PlotWindow.cpp ++) ++ ++target_link_libraries(polarspectrogram qwt) +diff --git a/examples/radio/CMakeLists.txt b/examples/radio/CMakeLists.txt +new file mode 100644 +index 0000000..00ed82c +--- /dev/null ++++ b/examples/radio/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(radio ++ main.cpp ++ AmplifierBox.h ++ TunerBox.h ++ AmplifierBox.cpp ++ TunerBox.cpp ++) ++ ++target_link_libraries(radio qwt) +diff --git a/examples/rasterview/CMakeLists.txt b/examples/rasterview/CMakeLists.txt +new file mode 100644 +index 0000000..7c21eb8 +--- /dev/null ++++ b/examples/rasterview/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(rasterview ++ main.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(rasterview qwt) +diff --git a/examples/realtime/CMakeLists.txt b/examples/realtime/CMakeLists.txt +new file mode 100644 +index 0000000..8a01943 +--- /dev/null ++++ b/examples/realtime/CMakeLists.txt +@@ -0,0 +1,16 @@ ++ ++add_executable(realtime ++ main.cpp ++ ScrollZoomer.h ++ ScrollBar.h ++ IncrementalPlot.h ++ RandomPlot.h ++ MainWindow.h ++ ScrollZoomer.cpp ++ ScrollBar.cpp ++ IncrementalPlot.cpp ++ RandomPlot.cpp ++ MainWindow.cpp ++) ++ ++target_link_libraries(realtime qwt) +diff --git a/examples/refreshtest/CMakeLists.txt b/examples/refreshtest/CMakeLists.txt +new file mode 100644 +index 0000000..7100f79 +--- /dev/null ++++ b/examples/refreshtest/CMakeLists.txt +@@ -0,0 +1,15 @@ ++ ++add_executable(refreshtest ++ main.cpp ++ Settings.h ++ CircularBuffer.h ++ Panel.h ++ Plot.h ++ MainWindow.h ++ CircularBuffer.cpp ++ Panel.cpp ++ Plot.cpp ++ MainWindow.cpp ++) ++ ++target_link_libraries(refreshtest qwt) +diff --git a/examples/scatterplot/CMakeLists.txt b/examples/scatterplot/CMakeLists.txt +new file mode 100644 +index 0000000..02b5efb +--- /dev/null ++++ b/examples/scatterplot/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(scatterplot ++ main.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(scatterplot qwt) +diff --git a/examples/simpleplot/CMakeLists.txt b/examples/simpleplot/CMakeLists.txt +new file mode 100644 +index 0000000..27fdfb8 +--- /dev/null ++++ b/examples/simpleplot/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(simpleplot main.cpp) ++ ++target_link_libraries(simpleplot qwt) +diff --git a/examples/sinusplot/CMakeLists.txt b/examples/sinusplot/CMakeLists.txt +new file mode 100644 +index 0000000..a6ce2be +--- /dev/null ++++ b/examples/sinusplot/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(sinusplot main.cpp) ++ ++target_link_libraries(sinusplot qwt) +diff --git a/examples/spectrogram/CMakeLists.txt b/examples/spectrogram/CMakeLists.txt +new file mode 100644 +index 0000000..134be44 +--- /dev/null ++++ b/examples/spectrogram/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(spectrogram ++ main.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(spectrogram qwt) +diff --git a/examples/splineeditor/CMakeLists.txt b/examples/splineeditor/CMakeLists.txt +new file mode 100644 +index 0000000..2231f64 +--- /dev/null ++++ b/examples/splineeditor/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(splineeditor ++ main.cpp ++ ScalePicker.h ++ CanvasPicker.h ++ Plot.h ++ ScalePicker.cpp ++ CanvasPicker.cpp ++ Plot.cpp ++) ++ ++target_link_libraries(splineeditor qwt) +diff --git a/examples/stockchart/CMakeLists.txt b/examples/stockchart/CMakeLists.txt +new file mode 100644 +index 0000000..ca4f4c8 +--- /dev/null ++++ b/examples/stockchart/CMakeLists.txt +@@ -0,0 +1,14 @@ ++ ++add_executable(stockchart ++ main.cpp ++ Legend.h ++ GridItem.h ++ Plot.h ++ QuoteFactory.h ++ Legend.cpp ++ GridItem.cpp ++ Plot.cpp ++ QuoteFactory.cpp ++) ++ ++target_link_libraries(stockchart qwt) +diff --git a/examples/sysinfo/CMakeLists.txt b/examples/sysinfo/CMakeLists.txt +new file mode 100644 +index 0000000..954e9f0 +--- /dev/null ++++ b/examples/sysinfo/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(sysinfo main.cpp) ++ ++target_link_libraries(sysinfo qwt) +diff --git a/examples/tvplot/CMakeLists.txt b/examples/tvplot/CMakeLists.txt +new file mode 100644 +index 0000000..8224c3b +--- /dev/null ++++ b/examples/tvplot/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(tvplot ++ main.cpp ++ TVPlot.h ++ TVPlot.cpp ++) ++ ++target_link_libraries(tvplot qwt) +diff --git a/playground/CMakeLists.txt b/playground/CMakeLists.txt +new file mode 100644 +index 0000000..8384661 +--- /dev/null ++++ b/playground/CMakeLists.txt +@@ -0,0 +1,19 @@ ++ ++set(CMAKE_AUTOMOC ON) ++ ++if(QWT_PLOT) ++ add_subdirectory(plotmatrix) ++ add_subdirectory(timescale) ++ add_subdirectory(scaleengine) ++ add_subdirectory(rescaler) ++ add_subdirectory(shapes) ++ add_subdirectory(curvetracker) ++ add_subdirectory(vectorfield) ++ add_subdirectory(symbols) ++ ++ if(QWT_SVG) ++ add_subdirectory(svgmap) ++ add_subdirectory(graphicscale) ++ endif() ++ ++endif() +diff --git a/playground/curvetracker/CMakeLists.txt b/playground/curvetracker/CMakeLists.txt +new file mode 100644 +index 0000000..9440612 +--- /dev/null ++++ b/playground/curvetracker/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(curvetracker ++ main.cpp ++ CurveTracker.cpp ++ CurveTracker.h ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(curvetracker qwt) +diff --git a/playground/graphicscale/CMakeLists.txt b/playground/graphicscale/CMakeLists.txt +new file mode 100644 +index 0000000..32c580b +--- /dev/null ++++ b/playground/graphicscale/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(graphicscale ++ main.cpp ++ Canvas.cpp ++ Canvas.h ++ MainWindow.cpp ++ MainWindow.h ++) ++ ++target_link_libraries(graphicscale qwt) +diff --git a/playground/plotmatrix/CMakeLists.txt b/playground/plotmatrix/CMakeLists.txt +new file mode 100644 +index 0000000..d85a098 +--- /dev/null ++++ b/playground/plotmatrix/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(plotmatrix ++ main.cpp ++ PlotMatrix.cpp ++ PlotMatrix.h ++) ++ ++target_link_libraries(plotmatrix qwt) +diff --git a/playground/rescaler/CMakeLists.txt b/playground/rescaler/CMakeLists.txt +new file mode 100644 +index 0000000..34d1ca7 +--- /dev/null ++++ b/playground/rescaler/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(rescaler ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(rescaler qwt) +diff --git a/playground/scaleengine/CMakeLists.txt b/playground/scaleengine/CMakeLists.txt +new file mode 100644 +index 0000000..07ff410 +--- /dev/null ++++ b/playground/scaleengine/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(scaleengine ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Plot.cpp ++ Plot.h ++ TransformPlot.cpp ++ TransformPlot.h ++) ++ ++target_link_libraries(scaleengine qwt) +diff --git a/playground/shapes/CMakeLists.txt b/playground/shapes/CMakeLists.txt +new file mode 100644 +index 0000000..bd25989 +--- /dev/null ++++ b/playground/shapes/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(shapes main.cpp) ++ ++target_link_libraries(shapes qwt) +diff --git a/playground/svgmap/CMakeLists.txt b/playground/svgmap/CMakeLists.txt +new file mode 100644 +index 0000000..0306537 +--- /dev/null ++++ b/playground/svgmap/CMakeLists.txt +@@ -0,0 +1,9 @@ ++ ++add_executable(svgmap ++ main.cpp ++ Plot.cpp ++ Plot.h ++ svgmap.qrc ++) ++ ++target_link_libraries(svgmap qwt) +diff --git a/playground/symbols/CMakeLists.txt b/playground/symbols/CMakeLists.txt +new file mode 100644 +index 0000000..77084a0 +--- /dev/null ++++ b/playground/symbols/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(symbols main.cpp) ++ ++target_link_libraries(symbols qwt) +diff --git a/playground/timescale/CMakeLists.txt b/playground/timescale/CMakeLists.txt +new file mode 100644 +index 0000000..cfd8968 +--- /dev/null ++++ b/playground/timescale/CMakeLists.txt +@@ -0,0 +1,13 @@ ++ ++add_executable(timescale ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Panel.cpp ++ Panel.h ++ Plot.cpp ++ Plot.h ++ Settings.h ++) ++ ++target_link_libraries(timescale qwt) +diff --git a/playground/vectorfield/CMakeLists.txt b/playground/vectorfield/CMakeLists.txt +new file mode 100644 +index 0000000..ea78d87 +--- /dev/null ++++ b/playground/vectorfield/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(vectorfield main.cpp) ++ ++target_link_libraries(vectorfield qwt) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 0000000..a6a4bf2 +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,439 @@ ++set(HEADERS ++ qwt.h ++ qwt_abstract_scale_draw.h ++ qwt_bezier.h ++ qwt_clipper.h ++ qwt_color_map.h ++ qwt_column_symbol.h ++ qwt_date.h ++ qwt_date_scale_draw.h ++ qwt_date_scale_engine.h ++ qwt_dyngrid_layout.h ++ qwt_global.h ++ qwt_graphic.h ++ qwt_interval.h ++ qwt_interval_symbol.h ++ qwt_math.h ++ qwt_magnifier.h ++ qwt_null_paintdevice.h ++ qwt_painter.h ++ qwt_painter_command.h ++ qwt_panner.h ++ qwt_picker.h ++ qwt_picker_machine.h ++ qwt_pixel_matrix.h ++ qwt_point_3d.h ++ qwt_point_polar.h ++ qwt_round_scale_draw.h ++ qwt_scale_div.h ++ qwt_scale_draw.h ++ qwt_scale_engine.h ++ qwt_scale_map.h ++ qwt_spline.h ++ qwt_spline_basis.h ++ qwt_spline_parametrization.h ++ qwt_spline_local.h ++ qwt_spline_cubic.h ++ qwt_spline_pleasing.h ++ qwt_spline_polynomial.h ++ qwt_symbol.h ++ qwt_system_clock.h ++ qwt_text_engine.h ++ qwt_text_label.h ++ qwt_text.h ++ qwt_transform.h ++ qwt_widget_overlay.h ++) ++set(SOURCES ++ qwt.cpp ++ qwt_abstract_scale_draw.cpp ++ qwt_bezier.cpp ++ qwt_clipper.cpp ++ qwt_color_map.cpp ++ qwt_column_symbol.cpp ++ qwt_date.cpp ++ qwt_date_scale_draw.cpp ++ qwt_date_scale_engine.cpp ++ qwt_dyngrid_layout.cpp ++ qwt_event_pattern.cpp ++ qwt_graphic.cpp ++ qwt_interval.cpp ++ qwt_interval_symbol.cpp ++ qwt_math.cpp ++ qwt_magnifier.cpp ++ qwt_null_paintdevice.cpp ++ qwt_painter.cpp ++ qwt_painter_command.cpp ++ qwt_panner.cpp ++ qwt_picker.cpp ++ qwt_picker_machine.cpp ++ qwt_pixel_matrix.cpp ++ qwt_point_3d.cpp ++ qwt_point_polar.cpp ++ qwt_round_scale_draw.cpp ++ qwt_scale_div.cpp ++ qwt_scale_draw.cpp ++ qwt_scale_map.cpp ++ qwt_scale_engine.cpp ++ qwt_spline.cpp ++ qwt_spline_basis.cpp ++ qwt_spline_parametrization.cpp ++ qwt_spline_local.cpp ++ qwt_spline_cubic.cpp ++ qwt_spline_pleasing.cpp ++ qwt_spline_polynomial.cpp ++ qwt_symbol.cpp ++ qwt_system_clock.cpp ++ qwt_text_engine.cpp ++ qwt_text_label.cpp ++ qwt_text.cpp ++ qwt_transform.cpp ++ qwt_widget_overlay.cpp ++) ++ ++if(QWT_PLOT) ++ list(APPEND HEADERS ++ qwt_axis.h ++ qwt_axis_id.h ++ qwt_curve_fitter.h ++ qwt_spline_curve_fitter.h ++ qwt_weeding_curve_fitter.h ++ qwt_event_pattern.h ++ qwt_abstract_legend.h ++ qwt_legend.h ++ qwt_legend_data.h ++ qwt_legend_label.h ++ qwt_plot.h ++ qwt_plot_renderer.h ++ qwt_plot_curve.h ++ qwt_plot_dict.h ++ qwt_plot_directpainter.h ++ qwt_plot_graphicitem.h ++ qwt_plot_grid.h ++ qwt_plot_histogram.h ++ qwt_plot_item.h ++ qwt_plot_abstract_barchart.h ++ qwt_plot_barchart.h ++ qwt_plot_multi_barchart.h ++ qwt_plot_intervalcurve.h ++ qwt_plot_tradingcurve.h ++ qwt_plot_layout.h ++ qwt_plot_marker.h ++ qwt_plot_zoneitem.h ++ qwt_plot_textlabel.h ++ qwt_plot_rasteritem.h ++ qwt_plot_spectrogram.h ++ qwt_plot_spectrocurve.h ++ qwt_plot_scaleitem.h ++ qwt_plot_legenditem.h ++ qwt_plot_seriesitem.h ++ qwt_plot_shapeitem.h ++ qwt_plot_vectorfield.h ++ qwt_plot_abstract_canvas.h ++ qwt_plot_canvas.h ++ qwt_plot_panner.h ++ qwt_plot_picker.h ++ qwt_plot_zoomer.h ++ qwt_plot_magnifier.h ++ qwt_plot_rescaler.h ++ qwt_point_mapper.h ++ qwt_raster_data.h ++ qwt_matrix_raster_data.h ++ qwt_vectorfield_symbol.h ++ qwt_sampling_thread.h ++ qwt_samples.h ++ qwt_series_data.h ++ qwt_series_store.h ++ qwt_point_data.h ++ qwt_scale_widget.h ++ ) ++ list(APPEND SOURCES ++ qwt_curve_fitter.cpp ++ qwt_spline_curve_fitter.cpp ++ qwt_weeding_curve_fitter.cpp ++ qwt_abstract_legend.cpp ++ qwt_legend.cpp ++ qwt_legend_data.cpp ++ qwt_legend_label.cpp ++ qwt_plot.cpp ++ qwt_plot_renderer.cpp ++ qwt_plot_axis.cpp ++ qwt_plot_curve.cpp ++ qwt_plot_dict.cpp ++ qwt_plot_directpainter.cpp ++ qwt_plot_graphicitem.cpp ++ qwt_plot_grid.cpp ++ qwt_plot_histogram.cpp ++ qwt_plot_item.cpp ++ qwt_plot_abstract_barchart.cpp ++ qwt_plot_barchart.cpp ++ qwt_plot_multi_barchart.cpp ++ qwt_plot_intervalcurve.cpp ++ qwt_plot_zoneitem.cpp ++ qwt_plot_tradingcurve.cpp ++ qwt_plot_spectrogram.cpp ++ qwt_plot_spectrocurve.cpp ++ qwt_plot_scaleitem.cpp ++ qwt_plot_legenditem.cpp ++ qwt_plot_seriesitem.cpp ++ qwt_plot_shapeitem.cpp ++ qwt_plot_vectorfield.cpp ++ qwt_plot_marker.cpp ++ qwt_plot_textlabel.cpp ++ qwt_plot_layout.cpp ++ qwt_plot_abstract_canvas.cpp ++ qwt_plot_canvas.cpp ++ qwt_plot_panner.cpp ++ qwt_plot_rasteritem.cpp ++ qwt_plot_picker.cpp ++ qwt_plot_zoomer.cpp ++ qwt_plot_magnifier.cpp ++ qwt_plot_rescaler.cpp ++ qwt_point_mapper.cpp ++ qwt_raster_data.cpp ++ qwt_matrix_raster_data.cpp ++ qwt_vectorfield_symbol.cpp ++ qwt_sampling_thread.cpp ++ qwt_series_data.cpp ++ qwt_point_data.cpp ++ qwt_scale_widget.cpp ++ ) ++endif() ++ ++if(QWT_OPENGL) ++ list(APPEND HEADERS qwt_plot_opengl_canvas.h) ++ list(APPEND SOURCES qwt_plot_opengl_canvas.cpp) ++ if(QT_VERSION_MAJOR VERSION_LESS 6) ++ list(APPEND HEADERS qwt_plot_glcanvas.h) ++ list(APPEND SOURCES qwt_plot_glcanvas.cpp) ++ endif() ++endif() ++ ++if(QWT_SVG) ++ list(APPEND HEADERS qwt_plot_svgitem.h) ++ list(APPEND SOURCES qwt_plot_svgitem.cpp) ++endif() ++ ++if(QWT_POLAR) ++ list( APPEND HEADERS ++ qwt_polar.h ++ qwt_polar_canvas.h ++ qwt_polar_curve.h ++ qwt_polar_fitter.h ++ qwt_polar_grid.h ++ qwt_polar_itemdict.h ++ qwt_polar_item.h ++ qwt_polar_layout.h ++ qwt_polar_magnifier.h ++ qwt_polar_marker.h ++ qwt_polar_panner.h ++ qwt_polar_picker.h ++ qwt_polar_plot.h ++ qwt_polar_renderer.h ++ qwt_polar_spectrogram.h ++ ) ++ list(APPEND SOURCES ++ qwt_polar_canvas.cpp ++ qwt_polar_curve.cpp ++ qwt_polar_fitter.cpp ++ qwt_polar_grid.cpp ++ qwt_polar_item.cpp ++ qwt_polar_itemdict.cpp ++ qwt_polar_layout.cpp ++ qwt_polar_magnifier.cpp ++ qwt_polar_marker.cpp ++ qwt_polar_panner.cpp ++ qwt_polar_picker.cpp ++ qwt_polar_plot.cpp ++ qwt_polar_renderer.cpp ++ qwt_polar_spectrogram.cpp ++ ) ++endif() ++ ++if(QWT_WIDGETS) ++ list(APPEND HEADERS ++ qwt_abstract_slider.h ++ qwt_abstract_scale.h ++ qwt_arrow_button.h ++ qwt_analog_clock.h ++ qwt_compass.h ++ qwt_compass_rose.h ++ qwt_counter.h ++ qwt_dial.h ++ qwt_dial_needle.h ++ qwt_knob.h ++ qwt_slider.h ++ qwt_thermo.h ++ qwt_wheel.h ++ ) ++ list(APPEND SOURCES ++ qwt_abstract_slider.cpp ++ qwt_abstract_scale.cpp ++ qwt_arrow_button.cpp ++ qwt_analog_clock.cpp ++ qwt_compass.cpp ++ qwt_compass_rose.cpp ++ qwt_counter.cpp ++ qwt_dial.cpp ++ qwt_dial_needle.cpp ++ qwt_knob.cpp ++ qwt_slider.cpp ++ qwt_thermo.cpp ++ qwt_wheel.cpp ++ ) ++endif() ++ ++add_library(qwt_objects OBJECT ${SOURCES} ${HEADERS}) ++ ++target_include_directories(qwt_objects INTERFACE ++ $ ++ $ ++ $ ++) ++ ++target_link_libraries(qwt_objects PUBLIC ++ Qt${QT_VERSION_MAJOR}::Core ++ Qt${QT_VERSION_MAJOR}::Concurrent ++ Qt${QT_VERSION_MAJOR}::PrintSupport ++) ++ ++target_compile_definitions(qwt_objects PRIVATE ++ QT_NO_KEYWORDS ++ QWT_MOC_INCLUDE ++) ++ ++set_target_properties(qwt_objects PROPERTIES AUTOMOC ON) ++ ++if(NOT QWT_PLOT) ++ target_compile_definitions(qwt_objects PUBLIC NO_QWT_PLOT) ++endif() ++ ++if(NOT QWT_POLAR) ++ target_compile_definitions(qwt_objects PUBLIC NO_QWT_POLAR) ++endif() ++ ++if(QWT_WIDGETS) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::Widgets) ++else() ++ target_compile_definitions(qwt_objects PUBLIC NO_QWT_WIDGETS) ++endif() ++ ++if(QWT_OPENGL) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL) ++ if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) ++ endif() ++else() ++ target_compile_definitions(qwt_objects PUBLIC QWT_NO_OPENGL) ++endif() ++ ++if(QWT_SVG) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::Svg) ++else() ++ target_compile_definitions(qwt_objects PUBLIC QWT_NO_SVG) ++endif() ++ ++ ++if(WIN32 AND QWT_DLL) ++ target_compile_definitions(qwt_objects ++ PUBLIC QWT_DLL ++ PRIVATE QWT_MAKEDLL ++ ) ++endif() ++ ++set(QWT_LIBS "") ++ ++if(QWT_DLL) ++ add_library(qwt_shared SHARED) ++ target_link_libraries(qwt_shared PUBLIC qwt_objects) ++ list(APPEND QWT_LIBS qwt_shared) ++ set_target_properties(qwt_shared PROPERTIES EXPORT_NAME "Qwt_SHARED") ++ set_target_properties(qwt_shared PROPERTIES OUTPUT_NAME "qwt${QWT_NAME_SUFFIX}") ++endif() ++ ++if(QWT_STATIC) ++ add_library(qwt_static STATIC) ++ target_link_libraries(qwt_static PUBLIC qwt_objects) ++ list(APPEND QWT_LIBS qwt_static) ++ set_target_properties(qwt_static PROPERTIES EXPORT_NAME "Qwt_STATIC") ++ if((MSVC OR (APPLE AND QWT_FRAMEWORK)) AND QWT_DLL) ++ set_target_properties(qwt_static PROPERTIES OUTPUT_NAME "qwt${QWT_NAME_SUFFIX}-static") ++ else() ++ set_target_properties(qwt_static PROPERTIES OUTPUT_NAME "qwt${QWT_NAME_SUFFIX}") ++ endif() ++endif() ++ ++if(QWT_DLL) ++ add_library(qwt ALIAS qwt_shared) ++else() ++ add_library(qwt ALIAS qwt_static) ++endif() ++ ++if(QWT_DLL AND NOT APPLE AND NOT MSVC) ++ set_target_properties(qwt_shared PROPERTIES ++ VERSION ${PROJECT_VERSION} ++ SOVERSION ${PROJECT_VERSION_MAJOR} ++ ) ++endif() ++ ++if(APPLE AND QWT_FRAMEWORK) ++ set_target_properties(${QWT_LIBS} PROPERTIES FRAMEWORK TRUE) ++endif() ++ ++install(TARGETS ${QWT_LIBS} qwt_objects ++ EXPORT QwtTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++ ++set(QWT_CONFIG_NAME "Qt${QT_VERSION_MAJOR}Qwt6") ++ ++install(EXPORT QwtTargets ++ FILE ${QWT_CONFIG_NAME}Targets.cmake ++ NAMESPACE "Qwt::" ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${QWT_CONFIG_NAME} ++) ++include(CMakePackageConfigHelpers) ++ ++get_target_property(QT_LIBRARIES qwt_objects INTERFACE_LINK_LIBRARIES) ++string(JOIN " " QT_LIBRARIES ${QT_LIBRARIES}) ++string(REPLACE "::" "" QT_LIBRARIES ${QT_LIBRARIES}) ++ ++configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/qwt-config.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}Config.cmake" ++ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${QWT_CONFIG_NAME}" ++ NO_SET_AND_CHECK_MACRO ++ NO_CHECK_REQUIRED_COMPONENTS_MACRO ++) ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}ConfigVersion.cmake" ++ VERSION "${Qwt_VERSION}" ++ COMPATIBILITY AnyNewerVersion ++) ++install(FILES ++ ${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}Config.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}ConfigVersion.cmake ++ DESTINATION lib/cmake/${QWT_CONFIG_NAME} ++) ++ ++install(FILES ${HEADERS} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++) ++install(DIRECTORY ${CMAKE_SOURCE_DIR}/classincludes/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++ PATTERN "classincludes.pro" EXCLUDE ++) ++ ++get_target_property(QWT_COMPILE_DEFINITIONS qwt_objects INTERFACE_COMPILE_DEFINITIONS) ++string(JOIN " -D" QWT_COMPILE_DEFINITIONS ${QWT_COMPILE_DEFINITIONS}) ++string(PREPEND QWT_COMPILE_DEFINITIONS "-D") ++ ++set(QWT_PKGCONFIG_FILE ${QWT_CONFIG_NAME}.pc) ++ ++configure_file(qwt.pc.in ${QWT_PKGCONFIG_FILE} @ONLY) ++ ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${QWT_PKGCONFIG_FILE} ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ++) +diff --git a/src/qwt-config.cmake.in b/src/qwt-config.cmake.in +new file mode 100644 +index 0000000..cdd79d1 +--- /dev/null ++++ b/src/qwt-config.cmake.in +@@ -0,0 +1,17 @@ ++ ++@PACKAGE_INIT@ ++ ++include ( "${CMAKE_CURRENT_LIST_DIR}/@QWT_CONFIG_NAME@Targets.cmake" ) ++ ++set(QWT_INCLUDE_DIRS ${PACKAGE_PREFIX_DIR}/include/qwt@QWT_NAME_SUFFIX@) ++ ++if(TARGET Qwt::Qwt_SHARED) ++ add_library(Qwt::Qwt ALIAS Qwt::Qwt_SHARED) ++else() ++ add_library(Qwt::Qwt ALIAS Qwt::Qwt_STATIC) ++endif() ++ ++set(QT_LIBRARIES @QT_LIBRARIES@) ++foreach(qt_lib ${QT_LIBRARIES}) ++ find_package(${qt_lib} @QT_VERSION@ REQUIRED) ++endforeach() +diff --git a/src/qwt.pc.in b/src/qwt.pc.in +new file mode 100644 +index 0000000..05be4e4 +--- /dev/null ++++ b/src/qwt.pc.in +@@ -0,0 +1,12 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=${prefix} ++libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ ++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++ ++Name: @PROJECT_NAME@ ++Description: @PROJECT_DESCRIPTION@ ++Version: @PROJECT_VERSION@ ++ ++Libs: -L${libdir} -lqwt@QWT_NAME_SUFFIX@ ++Cflags: -I${includedir}/qwt@QWT_NAME_SUFFIX@ @QWT_COMPILE_DEFINITIONS@ ++Requires: @QT_LIBRARIES@ +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +new file mode 100644 +index 0000000..c530d58 +--- /dev/null ++++ b/tests/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_subdirectory(splinetest) ++ ++add_subdirectory(splineprof) +diff --git a/tests/splineprof/CMakeLists.txt b/tests/splineprof/CMakeLists.txt +new file mode 100644 +index 0000000..821b725 +--- /dev/null ++++ b/tests/splineprof/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(splineprof main.cpp) ++ ++target_link_libraries(splineprof qwt) +diff --git a/tests/splinetest/CMakeLists.txt b/tests/splinetest/CMakeLists.txt +new file mode 100644 +index 0000000..a08f9f6 +--- /dev/null ++++ b/tests/splinetest/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(splinetest main.cpp) ++ ++target_link_libraries(splinetest qwt) +-- +2.36.1 + diff --git a/recipes/qwt/all/test_package/CMakeLists.txt b/recipes/qwt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..162eed68d6d65 --- /dev/null +++ b/recipes/qwt/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(qwt REQUIRED CONFIG) +find_package(Qt5 REQUIRED Core CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qwt::qwt Qt5::Core) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(NOT WIN32) + # Must compile with "-fPIC" since Qt was built with -reduce-relocations. + target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) +endif() diff --git a/recipes/qwt/all/test_package/conanfile.py b/recipes/qwt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/qwt/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/qwt/all/test_package/test_package.cpp b/recipes/qwt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..194d042bbc781 --- /dev/null +++ b/recipes/qwt/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include + +int main() +{ + qDebug() << QwtDate::toString(QwtDate::toDateTime(10), "MMM dd hh:mm ", QwtDate::FirstThursday); + return 0; +} diff --git a/recipes/qwt/all/test_v1_package/CMakeLists.txt b/recipes/qwt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/qwt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/qwt/all/test_v1_package/conanfile.py b/recipes/qwt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/qwt/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/qwt/config.yml b/recipes/qwt/config.yml new file mode 100644 index 0000000000000..d0d954ac2ed4c --- /dev/null +++ b/recipes/qwt/config.yml @@ -0,0 +1,3 @@ +versions: + "6.2.0": + folder: "all" diff --git a/recipes/qxlsx/all/conandata.yml b/recipes/qxlsx/all/conandata.yml new file mode 100644 index 0000000000000..68d91ea6c0831 --- /dev/null +++ b/recipes/qxlsx/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "1.4.5": + url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.5.zip" + sha256: "eadcad2718335673f86fe20fd91e822e6c1e3624483be9d79cf79254e5426067" + "1.4.4": + url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.4.zip" + sha256: "3efbd6f63a1ffd521c535dce7b5a5a7e9ebd23db51e6ae8e3e2eb89796e57675" + "1.4.3": + url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.3.zip" + sha256: "d2f7c6aff71f2f30ade8d8020682e36a3d63f422a5d2f1c5831b55573241bd4a" +patches: + "1.4.3": + - patch_file: "patches/1.4.3/0001-allow-shared.patch" + patch_type: "conan" + patch_source: "https://github.com/QtExcel/QXlsx/pull/197" + - patch_file: "patches/1.4.3/0002-add-install-target.patch" + patch_type: "conan" + patch_source: "https://github.com/QtExcel/QXlsx/pull/197" diff --git a/recipes/qxlsx/all/conanfile.py b/recipes/qxlsx/all/conanfile.py new file mode 100644 index 0000000000000..28fac77f7f2b5 --- /dev/null +++ b/recipes/qxlsx/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, 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.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class QXlsxConan(ConanFile): + name = "qxlsx" + description = "Excel file(*.xlsx) reader/writer library using Qt 5 or 6." + license = "MIT" + topics = ("excel", "xlsx") + homepage = "https://github.com/QtExcel/QXlsx" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _qt_version(self): + return Version(self.dependencies["qt"].ref.version).major + + 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("qt/5.15.9") + + def build_requirements(self): + if Version(self.version) >= "1.4.4": + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + tc = CMakeToolchain(self) + tc.variables["QT_VERSION_MAJOR"] = self._qt_version + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder="QXlsx") + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure(build_script_folder="QXlsx") + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "QXlsx") + self.cpp_info.set_property("cmake_target_name", "QXlsx::Core") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if Version(self.version) <= "1.4.4": + self.cpp_info.components["qxlsx_core"].libs = ["QXlsx"] + else: + self.cpp_info.components["qxlsx_core"].libs = [f"QXlsxQt{self._qt_version}"] + self.cpp_info.components["qxlsx_core"].includedirs = [os.path.join("include", "QXlsx")] + self.cpp_info.components["qxlsx_core"].requires = ["qt::qtCore", "qt::qtGui"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "QXlsx" + self.cpp_info.names["cmake_find_package_multi"] = "QXlsx" + self.cpp_info.components["qxlsx_core"].names["cmake_find_package"] = "Core" + self.cpp_info.components["qxlsx_core"].names["cmake_find_package_multi"] = "Core" + self.cpp_info.components["qxlsx_core"].set_property("cmake_target_name", "QXlsx::Core") diff --git a/recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch b/recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch new file mode 100644 index 0000000000000..b640cac70894b --- /dev/null +++ b/recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch @@ -0,0 +1,218 @@ +--- a/QXlsx/CMakeLists.txt ++++ b/QXlsx/CMakeLists.txt +@@ -39,7 +39,7 @@ file(GLOB QXLSX_H "${QXLSX_HEADERPATH}/*.h") + set(SRC_FILES ${QXLSX_CPP}) + list(APPEND SRC_FILES ${QXLSX_H}) + +-add_library(QXlsx STATIC ++add_library(QXlsx + ${SRC_FILES} ) + + target_include_directories(QXlsx PRIVATE ${QXLSX_HEADERPATH}) +@@ -50,3 +50,6 @@ target_link_libraries(${PROJECT_NAME} + ) + + target_compile_definitions(QXlsx PRIVATE QXLSX_LIBRARY) ++if (BUILD_SHARED_LIBS) ++ target_compile_definitions(QXlsx PRIVATE QXLSX_SHARED) ++endif() +--- a/QXlsx/header/xlsxabstractooxmlfile.h ++++ b/QXlsx/header/xlsxabstractooxmlfile.h +@@ -10,7 +10,7 @@ QT_BEGIN_NAMESPACE_XLSX + class Relationships; + class AbstractOOXmlFilePrivate; + +-class AbstractOOXmlFile ++class QXLSX_EXPORT AbstractOOXmlFile + { + Q_DECLARE_PRIVATE(AbstractOOXmlFile) + +--- a/QXlsx/header/xlsxabstractsheet.h ++++ b/QXlsx/header/xlsxabstractsheet.h +@@ -12,7 +12,7 @@ class Workbook; + class Drawing; + class AbstractSheetPrivate; + +-class AbstractSheet : public AbstractOOXmlFile ++class QXLSX_EXPORT AbstractSheet : public AbstractOOXmlFile + { + Q_DECLARE_PRIVATE(AbstractSheet) + +--- a/QXlsx/header/xlsxcell.h ++++ b/QXlsx/header/xlsxcell.h +@@ -24,7 +24,7 @@ class CellFormula; + class CellPrivate; + class WorksheetPrivate; + +-class Cell ++class QXLSX_EXPORT Cell + { + Q_DECLARE_PRIVATE(Cell) + +--- a/QXlsx/header/xlsxcellformula.h ++++ b/QXlsx/header/xlsxcellformula.h +@@ -17,7 +17,7 @@ class CellRange; + class Worksheet; + class WorksheetPrivate; + +-class CellFormula ++class QXLSX_EXPORT CellFormula + { + public: + enum FormulaType { NormalType, ArrayType, DataTableType, SharedType }; +--- a/QXlsx/header/xlsxcelllocation.h ++++ b/QXlsx/header/xlsxcelllocation.h +@@ -17,7 +17,7 @@ QT_BEGIN_NAMESPACE_XLSX + + class Cell; + +-class CellLocation ++class QXLSX_EXPORT CellLocation + { + public: + CellLocation(); +--- a/QXlsx/header/xlsxcellrange.h ++++ b/QXlsx/header/xlsxcellrange.h +@@ -12,7 +12,7 @@ + QT_BEGIN_NAMESPACE_XLSX + + // dev57 +-class CellRange ++class QXLSX_EXPORT CellRange + { + public: + CellRange(); +--- a/QXlsx/header/xlsxcellreference.h ++++ b/QXlsx/header/xlsxcellreference.h +@@ -9,7 +9,7 @@ + + QT_BEGIN_NAMESPACE_XLSX + +-class CellReference ++class QXLSX_EXPORT CellReference + { + public: + CellReference(); +--- a/QXlsx/header/xlsxchart.h ++++ b/QXlsx/header/xlsxchart.h +@@ -18,7 +18,7 @@ class ChartPrivate; + class CellRange; + class DrawingAnchor; + +-class Chart : public AbstractOOXmlFile ++class QXLSX_EXPORT Chart : public AbstractOOXmlFile + { + Q_DECLARE_PRIVATE(Chart) + public: +--- a/QXlsx/header/xlsxchartsheet.h ++++ b/QXlsx/header/xlsxchartsheet.h +@@ -16,7 +16,7 @@ class DocumentPrivate; + class ChartsheetPrivate; + class Chart; + +-class Chartsheet : public AbstractSheet ++class QXLSX_EXPORT Chartsheet : public AbstractSheet + { + Q_DECLARE_PRIVATE(Chartsheet) + +--- a/QXlsx/header/xlsxconditionalformatting.h ++++ b/QXlsx/header/xlsxconditionalformatting.h +@@ -24,7 +24,7 @@ class Worksheet; + class Styles; + class ConditionalFormattingPrivate; + +-class ConditionalFormatting ++class QXLSX_EXPORT ConditionalFormatting + { + public: + enum HighlightRuleType { +--- a/QXlsx/header/xlsxdatavalidation.h ++++ b/QXlsx/header/xlsxdatavalidation.h +@@ -22,7 +22,7 @@ class CellRange; + class CellReference; + + class DataValidationPrivate; +-class DataValidation ++class QXLSX_EXPORT DataValidation + { + public: + enum ValidationType +--- a/QXlsx/header/xlsxdatetype.h ++++ b/QXlsx/header/xlsxdatetype.h +@@ -15,7 +15,7 @@ + + QT_BEGIN_NAMESPACE_XLSX + +-class DateType ++class QXLSX_EXPORT DateType + { + public: + DateType(); +--- a/QXlsx/header/xlsxdocument.h ++++ b/QXlsx/header/xlsxdocument.h +@@ -24,7 +24,7 @@ class Chart; + class CellReference; + class DocumentPrivate; + +-class Document : public QObject ++class QXLSX_EXPORT Document : public QObject + { + Q_OBJECT + Q_DECLARE_PRIVATE(Document) // D-Pointer. Qt classes have a Q_DECLARE_PRIVATE +--- a/QXlsx/header/xlsxformat.h ++++ b/QXlsx/header/xlsxformat.h +@@ -24,7 +24,7 @@ class SharedStrings; + + class FormatPrivate; + +-class Format ++class QXLSX_EXPORT Format + { + public: + enum FontScript +--- a/QXlsx/header/xlsxglobal.h ++++ b/QXlsx/header/xlsxglobal.h +@@ -30,4 +30,10 @@ + #define Q_DECL_NOTHROW + #endif + ++#ifdef QXLSX_SHARED ++#define QXLSX_EXPORT Q_DECL_EXPORT ++#else ++#define QXLSX_EXPORT ++#endif ++ + #endif // XLSXGLOBAL_H +--- a/QXlsx/header/xlsxrichstring.h ++++ b/QXlsx/header/xlsxrichstring.h +@@ -37,7 +37,7 @@ class RichString; + // qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) + uint qHash(const RichString &rs, uint seed = 0) Q_DECL_NOTHROW; + +-class RichString ++class QXLSX_EXPORT RichString + { + public: + RichString(); +--- a/QXlsx/header/xlsxworkbook.h ++++ b/QXlsx/header/xlsxworkbook.h +@@ -28,7 +28,7 @@ class Chartsheet; + class Worksheet; + class WorkbookPrivate; + +-class Workbook : public AbstractOOXmlFile ++class QXLSX_EXPORT Workbook : public AbstractOOXmlFile + { + Q_DECLARE_PRIVATE(Workbook) + public: +--- a/QXlsx/header/xlsxworksheet.h ++++ b/QXlsx/header/xlsxworksheet.h +@@ -37,7 +37,7 @@ class Relationships; + class Chart; + + class WorksheetPrivate; +-class Worksheet : public AbstractSheet ++class QXLSX_EXPORT Worksheet : public AbstractSheet + { + Q_DECLARE_PRIVATE(Worksheet) + diff --git a/recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch b/recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch new file mode 100644 index 0000000000000..48125aa4d3f43 --- /dev/null +++ b/recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch @@ -0,0 +1,37 @@ +--- a/QXlsx/CMakeLists.txt ++++ b/QXlsx/CMakeLists.txt +@@ -53,3 +53,34 @@ target_compile_definitions(QXlsx PRIVATE QXLSX_LIBRARY) + if (BUILD_SHARED_LIBS) + target_compile_definitions(QXlsx PRIVATE QXLSX_SHARED) + endif() ++ ++set(QXLSX_PUBLIC_HEADERS ++ header/xlsxdocument.h ++ header/xlsxabstractooxmlfile.h ++ header/xlsxabstractsheet.h ++ header/xlsxabstractsheet_p.h ++ header/xlsxcellformula.h ++ header/xlsxcell.h ++ header/xlsxcelllocation.h ++ header/xlsxcellrange.h ++ header/xlsxcellreference.h ++ header/xlsxchart.h ++ header/xlsxchartsheet.h ++ header/xlsxconditionalformatting.h ++ header/xlsxdatavalidation.h ++ header/xlsxdatetype.h ++ header/xlsxdocument.h ++ header/xlsxformat.h ++ header/xlsxglobal.h ++ header/xlsxrichstring.h ++ header/xlsxworkbook.h ++ header/xlsxworksheet.h ++) ++set_property(TARGET QXlsx PROPERTY PUBLIC_HEADER ${QXLSX_PUBLIC_HEADERS}) ++include(GNUInstallDirs) ++install(TARGETS QXlsx ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/QXlsx ++) diff --git a/recipes/qxlsx/all/test_package/CMakeLists.txt b/recipes/qxlsx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d57016937dd42 --- /dev/null +++ b/recipes/qxlsx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(QXlsx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE QXlsx::Core) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/qxlsx/all/test_package/conanfile.py b/recipes/qxlsx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6d529581ba2f5 --- /dev/null +++ b/recipes/qxlsx/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qxlsx/all/test_package/test_package.cpp b/recipes/qxlsx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec71d1106e960 --- /dev/null +++ b/recipes/qxlsx/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +int main() { + QBuffer device; + device.open(QIODevice::WriteOnly); + + QXlsx::Document xlsx1; + xlsx1.write("A1", true); + xlsx1.write("A2", false); + xlsx1.saveAs(&device); + + return 0; +} diff --git a/recipes/qxlsx/all/test_v1_package/CMakeLists.txt b/recipes/qxlsx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/qxlsx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/qxlsx/all/test_v1_package/conanfile.py b/recipes/qxlsx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/qxlsx/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/qxlsx/config.yml b/recipes/qxlsx/config.yml new file mode 100644 index 0000000000000..c1105e1540729 --- /dev/null +++ b/recipes/qxlsx/config.yml @@ -0,0 +1,7 @@ +versions: + "1.4.5": + folder: "all" + "1.4.4": + folder: "all" + "1.4.3": + folder: "all" diff --git a/recipes/qxmpp/all/CMakeLists.txt b/recipes/qxmpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..59052ada070a2 --- /dev/null +++ b/recipes/qxmpp/all/CMakeLists.txt @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000000..57b44e43f1da6 --- /dev/null +++ b/recipes/qxmpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.4.0": + url: "https://github.com/qxmpp-project/qxmpp/archive/refs/tags/v1.4.0.tar.gz" + 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" diff --git a/recipes/qxmpp/all/conanfile.py b/recipes/qxmpp/all/conanfile.py new file mode 100644 index 0000000000000..b89c7627065d2 --- /dev/null +++ b/recipes/qxmpp/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.tools import files +from conans import CMake +import functools +import os + +required_conan_version = ">=1.43.0" + + +class QxmppConan(ConanFile): + name = "qxmpp" + 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" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gstreamer": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_gstreamer": False, + } + + generators = "cmake", "cmake_find_package_multi" + + @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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("qt/6.2.4") + if self.options.with_gstreamer: + self.requires("gstreamer/1.19.2") + self.requires("glib/2.70.1") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + @functools.lru_cache(1) + def _configure_cmake(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() + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "QXmpp") + self.cpp_info.set_property("cmake_target_name", "QXmpp::QXmpp") + self.cpp_info.set_property("pkg_config_name", "qxmpp") + 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" 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 new file mode 100644 index 0000000000000..da7431faa740a --- /dev/null +++ b/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch @@ -0,0 +1,20 @@ +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/002-add_gstreamer_1.4.0.patch b/recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch new file mode 100644 index 0000000000000..ca950c0698650 --- /dev/null +++ b/recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch @@ -0,0 +1,26 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d376cf45..d46a4b4d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -187,9 +187,9 @@ set(SOURCE_FILES + ) + + if(WITH_GSTREAMER) +- find_package(GStreamer REQUIRED) +- find_package(GLIB2 REQUIRED) +- find_package(GObject REQUIRED) ++ find_package(gstreamer REQUIRED) ++ find_package(glib COMPONENTS gobject REQUIRED) ++ #find_package(gobject REQUIRED) + + set(INSTALL_HEADER_FILES + ${INSTALL_HEADER_FILES} +@@ -242,7 +242,7 @@ if(WITH_GSTREAMER) + PRIVATE + ${GLIB2_LIBRARIES} + ${GOBJECT_LIBRARIES} +- ${GSTREAMER_LIBRARY} ++ gstreamer::gstreamer + ) + endif() + diff --git a/recipes/qxmpp/all/test_package/CMakeLists.txt b/recipes/qxmpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4398033dd2797 --- /dev/null +++ b/recipes/qxmpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +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) diff --git a/recipes/qxmpp/all/test_package/conanfile.py b/recipes/qxmpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1bf1c7e26255d --- /dev/null +++ b/recipes/qxmpp/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qxmpp/all/test_package/test_package.cpp b/recipes/qxmpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dabb1c214e126 --- /dev/null +++ b/recipes/qxmpp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + QXmppClient client; + client.logger()->setLoggingType(QXmppLogger::StdoutLogging); +} diff --git a/recipes/qxmpp/config.yml b/recipes/qxmpp/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/qxmpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/r8brain-free-src/all/CMakeLists.txt b/recipes/r8brain-free-src/all/CMakeLists.txt new file mode 100644 index 0000000000000..1956775589e86 --- /dev/null +++ b/recipes/r8brain-free-src/all/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.4) +project(r8brain-free-src LANGUAGES C CXX) + +add_library(r8brain) + +target_sources(r8brain PRIVATE ${R8BRAIN_SRC_DIR}/r8bbase.cpp) +if(R8BRAIN_WITH_PFFFT) + target_compile_definitions(r8brain PUBLIC R8B_PFFFT) + find_package(pffft REQUIRED CONFIG) + target_link_libraries(r8brain pffft::pffft) +endif() +if(R8BRAIN_WITH_PFFFT_DOUBLE) + target_compile_definitions(r8brain PUBLIC R8B_PFFFT_DOUBLE) + target_sources(r8brain PRIVATE ${R8BRAIN_SRC_DIR}/pffft_double/pffft_double.c) +endif() + +set_target_properties(r8brain PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +include(GNUInstallDirs) + +install( + TARGETS r8brain + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +file(GLOB PUBLIC_HEADERS ${R8BRAIN_SRC_DIR}/*.h ${R8BRAIN_SRC_DIR}/*.inc) +install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +if(R8BRAIN_WITH_PFFFT_DOUBLE) + list(APPEND PFFFT_DOUBLE_HEADERS + ${R8BRAIN_SRC_DIR}/pffft_double/pffft_double.h + ) + install(FILES ${PFFFT_DOUBLE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pffft_double) + + list(APPEND PFFFT_DOUBLE_SIMD_HEADERS + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_avx_double.h + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_double.h + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_neon_double.h + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_neon_double_from_avx.h + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_scalar_double.h + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_sse2_double.h + ) + install(FILES ${PFFFT_DOUBLE_SIMD_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pffft_double/simd) +endif() diff --git a/recipes/r8brain-free-src/all/conandata.yml b/recipes/r8brain-free-src/all/conandata.yml new file mode 100644 index 0000000000000..27ad749e21214 --- /dev/null +++ b/recipes/r8brain-free-src/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "6.2": + url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.2.tar.gz" + sha256: "5e576ec8cb6ae3969c4bcacb630ddc957fc20f60a6b08593681d16e06942597d" + "4.6": + url: "https://github.com/avaneev/r8brain-free-src/archive/version-4.6.tar.gz" + sha256: "9a0d66c3a04954359ef9f69168b58fcdf11e8975821181ee7d1e3b42e8a2cf0e" diff --git a/recipes/r8brain-free-src/all/conanfile.py b/recipes/r8brain-free-src/all/conanfile.py new file mode 100644 index 0000000000000..c6a956008c5c7 --- /dev/null +++ b/recipes/r8brain-free-src/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, copy +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 R8brainFreeSrcConan(ConanFile): + name = "r8brain-free-src" + description = "High-quality pro audio sample rate converter / resampler C++ library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/avaneev/r8brain-free-src" + topics = ("audio", "sample-rate", "conversion", "audio-processing", "resampler") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "fft": ["ooura", "pffft", "pffft_double", ] + } + default_options = { + "shared": False, + "fPIC": True, + "fft": "ooura", + } + exports_sources = ["CMakeLists.txt"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.fft == "pffft": + self.requires("pffft/cci.20210511") + # TODO: use pffft_double package when possible + + def validate(self): + if self.options.fft == "ooura" and is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} cannot be built shared with Visual Studio") + + if self.options.fft == "pffft_double" and Version(self.version) < "4.10": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support pffft_double") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["R8BRAIN_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["R8BRAIN_WITH_PFFFT"] = self.options.fft == "pffft" + tc.variables["R8BRAIN_WITH_PFFFT_DOUBLE"] = self.options.fft == "pffft_double" + tc.generate() + + deps = CMakeDeps(self) + deps.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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["r8brain"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + if self.options.fft == "pffft": + self.cpp_info.defines.append("R8B_PFFFT") + if self.options.fft == "pffft_double": + self.cpp_info.defines.append("R8B_PFFFT_DOUBLE") diff --git a/recipes/r8brain-free-src/all/test_package/CMakeLists.txt b/recipes/r8brain-free-src/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ce5f00cec2e35 --- /dev/null +++ b/recipes/r8brain-free-src/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(r8brain-free-src REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE r8brain-free-src::r8brain-free-src) diff --git a/recipes/r8brain-free-src/all/test_package/conanfile.py b/recipes/r8brain-free-src/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/r8brain-free-src/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/r8brain-free-src/all/test_package/test_package.cpp b/recipes/r8brain-free-src/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9c979dbf7e591 --- /dev/null +++ b/recipes/r8brain-free-src/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "r8bbase.h" +#include "CDSPResampler.h" + +int main() { + r8b::CDSPResampler24 resampler(44100.0f, 48000.0f, 512); +} diff --git a/recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt b/recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/r8brain-free-src/all/test_v1_package/conanfile.py b/recipes/r8brain-free-src/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/r8brain-free-src/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/r8brain-free-src/config.yml b/recipes/r8brain-free-src/config.yml new file mode 100644 index 0000000000000..541a5f21084de --- /dev/null +++ b/recipes/r8brain-free-src/config.yml @@ -0,0 +1,5 @@ +versions: + "6.2": + folder: all + "4.6": + folder: all diff --git a/recipes/rabbitmq-c/all/conandata.yml b/recipes/rabbitmq-c/all/conandata.yml new file mode 100755 index 0000000000000..4a93aef8c8422 --- /dev/null +++ b/recipes/rabbitmq-c/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.13.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.13.0.tar.gz" + sha256: "8b224e41bba504fc52b02f918d8df7e4bf5359d493cbbff36c06078655c676e6" + "0.11.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.11.0.tar.gz" + sha256: "437d45e0e35c18cf3e59bcfe5dfe37566547eb121e69fca64b98f5d2c1c2d424" + "0.10.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.10.0.tar.gz" + sha256: "6455efbaebad8891c59f274a852b75b5cc51f4d669dfc78d2ae7e6cc97fcd8c0" + "0.9.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.tar.gz" + sha256: "316c0d156452b488124806911a62e0c2aa8a546d38fc8324719cd29aaa493024" diff --git a/recipes/rabbitmq-c/all/conanfile.py b/recipes/rabbitmq-c/all/conanfile.py new file mode 100755 index 0000000000000..a192092e12ead --- /dev/null +++ b/recipes/rabbitmq-c/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class RabbitmqcConan(ConanFile): + name = "rabbitmq-c" + 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" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "ssl": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def requirements(self): + if self.options.ssl: + self.requires("openssl/[>=1.1 <4]") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + if Version(self.version) < "0.12.0": + tc.variables["BUILD_TESTS"] = False + else: + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_TOOLS"] = False + tc.variables["BUILD_TOOLS_DOCS"] = False + tc.variables["ENABLE_SSL_SUPPORT"] = self.options.ssl + tc.variables["BUILD_API_DOCS"] = False + tc.variables["RUN_SYSTEM_TESTS"] = False + tc.generate() + + if self.options.ssl: + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE-MIT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + rabbitmq_target = "rabbitmq" if self.options.shared else "rabbitmq-static" + self.cpp_info.set_property("cmake_file_name", "rabbitmq-c") + self.cpp_info.set_property("cmake_target_name", f"rabbitmq::{rabbitmq_target}") + self.cpp_info.set_property("pkg_config_name", "librabbitmq") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + if self.settings.os == "Windows": + self.cpp_info.components["rabbitmq"].libs = [ + "rabbitmq.4" if self.options.shared else "librabbitmq.4" + ] + self.cpp_info.components["rabbitmq"].system_libs.extend(["crypt32", "ws2_32"]) + else: + self.cpp_info.components["rabbitmq"].libs = ["rabbitmq"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["rabbitmq"].system_libs.append("pthread") + if not self.options.shared: + self.cpp_info.components["rabbitmq"].defines.append("AMQP_STATIC") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("rt") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "rabbitmq-c" + self.cpp_info.filenames["cmake_find_package_multi"] = "rabbitmq-c" + self.cpp_info.names["cmake_find_package"] = "rabbitmq" + self.cpp_info.names["cmake_find_package_multi"] = "rabbitmq" + self.cpp_info.names["pkg_config"] = "librabbitmq" + self.cpp_info.components["rabbitmq"].names["cmake_find_package"] = rabbitmq_target + self.cpp_info.components["rabbitmq"].names["cmake_find_package_multi"] = rabbitmq_target + self.cpp_info.components["rabbitmq"].set_property("cmake_target_name", f"rabbitmq::{rabbitmq_target}") + self.cpp_info.components["rabbitmq"].set_property("pkg_config_name", "librabbitmq") + if self.options.ssl: + self.cpp_info.components["rabbitmq"].requires.append("openssl::openssl") diff --git a/recipes/rabbitmq-c/all/test_package/CMakeLists.txt b/recipes/rabbitmq-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2033457172e80 --- /dev/null +++ b/recipes/rabbitmq-c/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(rabbitmq-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(RABBITMQ_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE rabbitmq::rabbitmq) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE rabbitmq::rabbitmq-static) +endif() + +if(WITH_SSL) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_SSL) +endif() + +IF (rabbitmq-c_VERSION VERSION_GREATER_EQUAL "0.12.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE RABBITMQ_C_0_12_0_LATER) + target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +endif() diff --git a/recipes/rabbitmq-c/all/test_package/conanfile.py b/recipes/rabbitmq-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..82d331c47fc53 --- /dev/null +++ b/recipes/rabbitmq-c/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RABBITMQ_SHARED"] = self.dependencies["rabbitmq-c"].options.shared + tc.variables["WITH_SSL"] = self.dependencies["rabbitmq-c"].options.ssl + 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/rabbitmq-c/all/test_package/test_package.c b/recipes/rabbitmq-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..c159db025fa8f --- /dev/null +++ b/recipes/rabbitmq-c/all/test_package/test_package.c @@ -0,0 +1,42 @@ +#include + +/* Public headers have moved to rabbitmq-c/ directory since 0.12.0 */ +#if !defined(RABBITMQ_C_0_12_0_LATER) + #include + #include + + #ifdef WITH_SSL + #include + #else + #include + #endif +#else + #include + #include + + #ifdef WITH_SSL + #include + #else + #include + #endif +#endif + +int main(int argc, char const *argv[]) { + amqp_connection_state_t conn = amqp_new_connection(); + amqp_socket_t *socket = NULL; +#ifdef WITH_SSL + socket = amqp_ssl_socket_new(conn); +#else + socket = amqp_tcp_socket_new(conn); +#endif + + printf( + "\n" + "----------------->Tests are done.<---------------------\n" + "Using version %s\n" + "///////////////////////////////////////////////////////\n", + amqp_version() + ); + + return 0; +} diff --git a/recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt b/recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rabbitmq-c/all/test_v1_package/conanfile.py b/recipes/rabbitmq-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4d163cccc8134 --- /dev/null +++ b/recipes/rabbitmq-c/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["RABBITMQ_SHARED"] = self.options["rabbitmq-c"].shared + cmake.definitions["WITH_SSL"] = self.options["rabbitmq-c"].ssl + 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/rabbitmq-c/config.yml b/recipes/rabbitmq-c/config.yml new file mode 100644 index 0000000000000..5d590dc0b2c3b --- /dev/null +++ b/recipes/rabbitmq-c/config.yml @@ -0,0 +1,9 @@ +versions: + "0.13.0": + folder: all + "0.11.0": + folder: all + "0.10.0": + folder: all + "0.9.0": + folder: all diff --git a/recipes/ragel/all/CMakeLists.txt b/recipes/ragel/all/CMakeLists.txt new file mode 100644 index 0000000000000..b4afee381476c --- /dev/null +++ b/recipes/ragel/all/CMakeLists.txt @@ -0,0 +1,133 @@ +cmake_minimum_required(VERSION 3.0) +project(ragel) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +file(GLOB HEADERS + source_subfolder/ragel/buffer.h + source_subfolder/ragel/cdgoto.h + source_subfolder/ragel/cscodegen.h + source_subfolder/ragel/csipgoto.h + source_subfolder/ragel/inputdata.h + source_subfolder/ragel/rbxgoto.h + source_subfolder/ragel/rubyflat.h + source_subfolder/ragel/cdcodegen.h + source_subfolder/ragel/cdipgoto.h + source_subfolder/ragel/csfflat.h + source_subfolder/ragel/cssplit.h + source_subfolder/ragel/javacodegen.h + source_subfolder/ragel/redfsm.h + source_subfolder/ragel/rubyftable.h + source_subfolder/ragel/cdfflat.h + source_subfolder/ragel/cdsplit.h + source_subfolder/ragel/csfgoto.h + source_subfolder/ragel/cstable.h + source_subfolder/ragel/parsedata.h + source_subfolder/ragel/rlparse.h + source_subfolder/ragel/rubytable.h + source_subfolder/ragel/cdfgoto.h + source_subfolder/ragel/cdtable.h + source_subfolder/ragel/csflat.h + source_subfolder/ragel/dotcodegen.h + source_subfolder/ragel/parsetree.h + source_subfolder/ragel/rlscan.h + source_subfolder/ragel/version.h + source_subfolder/ragel/cdflat.h + source_subfolder/ragel/common.h + source_subfolder/ragel/csftable.h + source_subfolder/ragel/fsmgraph.h + source_subfolder/ragel/pcheck.h + source_subfolder/ragel/rubycodegen.h + source_subfolder/ragel/xmlcodegen.h + source_subfolder/ragel/cdftable.h + source_subfolder/ragel/csgoto.h + source_subfolder/ragel/gendata.h + source_subfolder/ragel/ragel.h + source_subfolder/ragel/rubyfflat.h + source_subfolder/ragel/gocodegen.h + source_subfolder/ragel/gotable.h + source_subfolder/ragel/goftable.h + source_subfolder/ragel/goflat.h + source_subfolder/ragel/gofflat.h + source_subfolder/ragel/gogoto.h + source_subfolder/ragel/gofgoto.h + source_subfolder/ragel/goipgoto.h + source_subfolder/ragel/gotablish.h + source_subfolder/ragel/mlcodegen.h + source_subfolder/ragel/mltable.h + source_subfolder/ragel/mlftable.h + source_subfolder/ragel/mlflat.h + source_subfolder/ragel/mlfflat.h + source_subfolder/ragel/mlgoto.h + source_subfolder/ragel/mlfgoto.h +) + +file(GLOB SRC + source_subfolder/ragel/main.cpp + source_subfolder/ragel/parsetree.cpp + source_subfolder/ragel/parsedata.cpp + source_subfolder/ragel/fsmstate.cpp + source_subfolder/ragel/fsmbase.cpp + source_subfolder/ragel/fsmattach.cpp + source_subfolder/ragel/fsmmin.cpp + source_subfolder/ragel/fsmgraph.cpp + source_subfolder/ragel/fsmap.cpp + source_subfolder/ragel/rlscan.cpp + source_subfolder/ragel/rlparse.cpp + source_subfolder/ragel/inputdata.cpp + source_subfolder/ragel/common.cpp + source_subfolder/ragel/redfsm.cpp + source_subfolder/ragel/gendata.cpp + source_subfolder/ragel/cdcodegen.cpp + source_subfolder/ragel/cdtable.cpp + source_subfolder/ragel/cdftable.cpp + source_subfolder/ragel/cdflat.cpp + source_subfolder/ragel/cdfflat.cpp + source_subfolder/ragel/cdgoto.cpp + source_subfolder/ragel/cdfgoto.cpp + source_subfolder/ragel/cdipgoto.cpp + source_subfolder/ragel/cdsplit.cpp + source_subfolder/ragel/javacodegen.cpp + source_subfolder/ragel/rubycodegen.cpp + source_subfolder/ragel/rubytable.cpp + source_subfolder/ragel/rubyftable.cpp + source_subfolder/ragel/rubyflat.cpp + source_subfolder/ragel/rubyfflat.cpp + source_subfolder/ragel/rbxgoto.cpp + source_subfolder/ragel/cscodegen.cpp + source_subfolder/ragel/cstable.cpp + source_subfolder/ragel/csftable.cpp + source_subfolder/ragel/csflat.cpp + source_subfolder/ragel/csfflat.cpp + source_subfolder/ragel/csgoto.cpp + source_subfolder/ragel/csfgoto.cpp + source_subfolder/ragel/csipgoto.cpp + source_subfolder/ragel/cssplit.cpp + source_subfolder/ragel/dotcodegen.cpp + source_subfolder/ragel/xmlcodegen.cpp + source_subfolder/ragel/gocodegen.cpp + source_subfolder/ragel/gotable.cpp + source_subfolder/ragel/goftable.cpp + source_subfolder/ragel/goflat.cpp + source_subfolder/ragel/gofflat.cpp + source_subfolder/ragel/gogoto.cpp + source_subfolder/ragel/gofgoto.cpp + source_subfolder/ragel/goipgoto.cpp + source_subfolder/ragel/gotablish.cpp + source_subfolder/ragel/mlcodegen.cpp + source_subfolder/ragel/mltable.cpp + source_subfolder/ragel/mlftable.cpp + source_subfolder/ragel/mlflat.cpp + source_subfolder/ragel/mlfflat.cpp + source_subfolder/ragel/mlgoto.cpp + source_subfolder/ragel/mlfgoto.cpp +) + +add_executable(${CMAKE_PROJECT_NAME} ${SRC} ${HEADERS}) +target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC ${CONAN_LIBS}) +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE source_subfolder/aapl + PRIVATE ${CMAKE_BINARY_DIR}) + +install(TARGETS ${CMAKE_PROJECT_NAME} + RUNTIME DESTINATION bin) diff --git a/recipes/ragel/all/conandata.yml b/recipes/ragel/all/conandata.yml new file mode 100644 index 0000000000000..a561cfe4c7dce --- /dev/null +++ b/recipes/ragel/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "6.10": + url: "http://www.colm.net/files/ragel/ragel-6.10.tar.gz" + sha256: "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f" + +patches: + "6.10": + - patch_file: "patches/0001-unistd.patch" + base_path: "source_subfolder" diff --git a/recipes/ragel/all/conanfile.py b/recipes/ragel/all/conanfile.py new file mode 100644 index 0000000000000..ab235df3cddb0 --- /dev/null +++ b/recipes/ragel/all/conanfile.py @@ -0,0 +1,69 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment, CMake +import os +import glob + + +class RagelConan(ConanFile): + name = "ragel" + description = "Ragel compiles executable finite state machines from regular languages" + homepage = "http://www.colm.net/open-source/ragel" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-2.0-or-later" + topics = ("ragel", "FSM", "regex", "fsm-compiler") + exports_sources = ["CMakeLists.txt", "config.h", "patches/*"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + _cmake = None + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, + strip_root=True) + + def _configure_autotools(self): + if not self._autotools: + self._autotools = AutoToolsBuildEnvironment(self) + self._autotools.configure(configure_dir=self._source_subfolder) + return self._autotools + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + if self.settings.os == "Windows": + cmake = self._configure_cmake() + cmake.build() + else: + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + self.copy(pattern="CREDITS", dst="licenses", src=self._source_subfolder) + if self.settings.os == "Windows": + cmake = self._configure_cmake() + cmake.install() + else: + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_id(self): + del self.info.settings.compiler + + def package_info(self): + self.env_info.RAGEL_ROOT = self.package_folder + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/ragel/all/config.h b/recipes/ragel/all/config.h new file mode 100644 index 0000000000000..8021e0b966a72 --- /dev/null +++ b/recipes/ragel/all/config.h @@ -0,0 +1,26 @@ +/* ragel/config.h. Generated from config.h.in by configure. */ +/* ragel/config.h.in. Generated from configure.in by autoheader. */ + +/* Name of package */ +#define PACKAGE "ragel" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "ragel" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "ragel 6.10" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "ragel" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "6.10" + +/* Version number of package */ +#define VERSION "6.10" diff --git a/recipes/ragel/all/patches/0001-unistd.patch b/recipes/ragel/all/patches/0001-unistd.patch new file mode 100644 index 0000000000000..eb99af705b53f --- /dev/null +++ b/recipes/ragel/all/patches/0001-unistd.patch @@ -0,0 +1,20 @@ +diff --git a/ragel/main.cpp b/ragel/main.cpp +index f5fbd7b..123331c 100644 +--- a/ragel/main.cpp ++++ b/ragel/main.cpp +@@ -24,9 +24,13 @@ + #include + #include + #include +-#include ++#ifndef _WIN32 ++# include ++#endif + #include +-#include ++#ifndef _WIN32 ++# include ++#endif + #include + #include + #include diff --git a/recipes/ragel/all/test_package/conanfile.py b/recipes/ragel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0299aedde34df --- /dev/null +++ b/recipes/ragel/all/test_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not tools.cross_building(self): + self.run("ragel --version", run_environment=True) diff --git a/recipes/ragel/config.yml b/recipes/ragel/config.yml new file mode 100644 index 0000000000000..dcf77e52d0d24 --- /dev/null +++ b/recipes/ragel/config.yml @@ -0,0 +1,3 @@ +versions: + "6.10": + folder: "all" diff --git a/recipes/rang/all/conandata.yml b/recipes/rang/all/conandata.yml new file mode 100644 index 0000000000000..f92a67455a066 --- /dev/null +++ b/recipes/rang/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.2": + url: "https://github.com/agauniyal/rang/archive/v3.2.tar.gz" + sha256: "8b42d9c33a6529a6c283a4f4c73c26326561ccc67fbb3e6a3225edd688b39973" + "3.1.0": + url: https://github.com/agauniyal/rang/archive/v3.1.0.tar.gz + sha256: 0eaf6ac687eb359d795bc9fdf0f79887778b7e933a8a3b317db4ba76be0a39d1 diff --git a/recipes/rang/all/conanfile.py b/recipes/rang/all/conanfile.py new file mode 100644 index 0000000000000..b3e6ab15e5261 --- /dev/null +++ b/recipes/rang/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.50.0" + + +class RangConan(ConanFile): + name = "rang" + description = "A Minimal, Header only Modern c++ library for colors in your terminal" + homepage = "https://github.com/agauniyal/rang" + url = "https://github.com/conan-io/conan-center-index" + license = "Unlicense" + topics = ("cli", "colors", "terminal", "console") + 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", 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "rang") + self.cpp_info.set_property("cmake_target_name", "rang::rang") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rang/all/test_package/CMakeLists.txt b/recipes/rang/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ad056deea8682 --- /dev/null +++ b/recipes/rang/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(rang REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rang::rang) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rang/all/test_package/conanfile.py b/recipes/rang/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/rang/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/rang/all/test_package/test_package.cpp b/recipes/rang/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e22ecb8da9fde --- /dev/null +++ b/recipes/rang/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include "rang.hpp" + +int main() { + std::cout << std::endl + << rang::style::reset << rang::bg::green << rang::fg::gray << rang::style::bold + << " Rang works! " << rang::bg::reset << rang::fg::reset << rang::style::reset << '\n' + << std::endl; + return 0; +} diff --git a/recipes/rang/all/test_v1_package/CMakeLists.txt b/recipes/rang/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/rang/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/rang/all/test_v1_package/conanfile.py b/recipes/rang/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/rang/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/rang/config.yml b/recipes/rang/config.yml new file mode 100644 index 0000000000000..032307f6a2b07 --- /dev/null +++ b/recipes/rang/config.yml @@ -0,0 +1,5 @@ +versions: + "3.2": + folder: all + "3.1.0": + folder: all diff --git a/recipes/range-v3/all/conandata.yml b/recipes/range-v3/all/conandata.yml new file mode 100644 index 0000000000000..1e7ea8c024212 --- /dev/null +++ b/recipes/range-v3/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.12.0": + url: https://github.com/ericniebler/range-v3/archive/refs/tags/0.12.0.tar.gz + sha256: 015adb2300a98edfceaf0725beec3337f542af4915cec4d0b89fa0886f4ba9cb + "0.11.0": + url: https://github.com/ericniebler/range-v3/archive/0.11.0.tar.gz + sha256: 376376615dbba43d3bef75aa590931431ecb49eb36d07bb726a19f680c75e20c + "0.10.0": + url: https://github.com/ericniebler/range-v3/archive/0.10.0.tar.gz + sha256: 5a1cd44e7315d0e8dcb1eee4df6802221456a9d1dbeac53da02ac7bd4ea150cd + "0.9.1": + url: https://github.com/ericniebler/range-v3/archive/0.9.1.tar.gz + sha256: 2b5b442d572b5978ea51c650adfaf0796f39f326404d09b83d846e04f571876b + "0.5.0": + url: https://github.com/ericniebler/range-v3/archive/refs/tags/0.5.0.tar.gz + sha256: 32e30b3be042246030f31d40394115b751431d9d2b4e0f6d58834b2fd5594280 + "0.4.0": + url: https://github.com/ericniebler/range-v3/archive/refs/tags/0.4.0.tar.gz + sha256: 5dbc878b7dfc500fb04b6b9f99d63993a2731ea34b0a4b8d5f670a5a71a18e39 + "0.3.7": + url: https://github.com/ericniebler/range-v3/archive/refs/tags/0.3.7.tar.gz + sha256: e6b0fb33bfd07ec32d54bcddd3e8d62e995a3cf0b64b34788ec264da62581207 diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py new file mode 100644 index 0000000000000..4f9a2a5174d9a --- /dev/null +++ b/recipes/range-v3/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +import os + + +required_conan_version = ">=1.50.0" + + +class Rangev3Conan(ConanFile): + name = "range-v3" + license = "BSL-1.0" + homepage = "https://github.com/ericniebler/range-v3" + url = "https://github.com/conan-io/conan-center-index" + description = "Experimental range library for C++11/14/17" + topics = ("range", "range-library", "proposal", "iterator", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5" if Version(self.version) < "0.10.0" else "6.5", + "msvc": "192", + "Visual Studio": "16", # TODO: remove when only Conan2 is supported + "clang": "3.6" if Version(self.version) < "0.10.0" else "3.9" + } + + @property + def _min_cppstd(self): + if is_msvc(self): + return "17" + else: + return "14" + + def layout(self): + basic_layout(self) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warning( + f"{self.settings.compiler} {self.settings.compiler.version} support for range-v3 is unknown, assuming it is supported.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"range-v3 {self.version} requires C++{self._min_cppstd} with {self.settings.compiler}, which is not supported by {self.settings.compiler} {self.settings.compiler.version}") + + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "*", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "LICENSE.txt", dst=os.path.join( + self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.components["range-v3-meta"].names["cmake_find_package"] = "meta" + self.cpp_info.components["range-v3-meta"].names["cmake_find_package_multi"] = "meta" + if is_msvc(self): + self.cpp_info.components["range-v3-meta"].cxxflags = ["/permissive-"] + + if "0.9.0" <= Version(self.version) < "0.11.0": + self.cpp_info.components["range-v3-meta"].cxxflags.append( + "/experimental:preprocessor") + self.cpp_info.components["range-v3-concepts"].names["cmake_find_package"] = "concepts" + self.cpp_info.components["range-v3-concepts"].names["cmake_find_package_multi"] = "concepts" + self.cpp_info.components["range-v3-concepts"].requires = ["range-v3-meta"] diff --git a/recipes/range-v3/all/test_package/CMakeLists.txt b/recipes/range-v3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bee80f9c757e8 --- /dev/null +++ b/recipes/range-v3/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(range-v3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} range-v3::range-v3) +if(MSVC AND range-v3_VERSION STREQUAL "0.10.0") + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +endif() diff --git a/recipes/range-v3/all/test_package/conanfile.py b/recipes/range-v3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2a9cace728280 --- /dev/null +++ b/recipes/range-v3/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 TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + 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/range-v3/all/test_package/test_package.cpp b/recipes/range-v3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bf050370682ec --- /dev/null +++ b/recipes/range-v3/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include +#include +#include + +using namespace ranges; + +#if RANGE_V3_MINOR > 5 +using test_sentinel_t = default_sentinel_t; +#else +using test_sentinel_t = v3::default_sentinel; +#endif + +// A range that iterates over all the characters in a +// null-terminated string. +class c_string_range + : public view_facade +{ + friend range_access; + char const * sz_; + char const & read() const { return *sz_; } + bool equal(::test_sentinel_t) const { return *sz_ == '\0'; } + void next() { ++sz_; } +public: + c_string_range() = default; + explicit c_string_range(char const *sz) : sz_(sz) + { + assert(sz != nullptr); + } +}; + +int main() +{ + c_string_range r("hello world"); + // Iterate over all the characters and print them out + ranges::for_each(r, [](char ch){ + std::cout << ch << ' '; + }); + // prints: h e l l o w o r l d +} diff --git a/recipes/range-v3/all/test_v1_package/CMakeLists.txt b/recipes/range-v3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/range-v3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/range-v3/all/test_v1_package/conanfile.py b/recipes/range-v3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..647a78dd80032 --- /dev/null +++ b/recipes/range-v3/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["VERSION"] = self.deps_cpp_info["range-v3"].version + 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/range-v3/config.yml b/recipes/range-v3/config.yml new file mode 100644 index 0000000000000..5ed235c09031b --- /dev/null +++ b/recipes/range-v3/config.yml @@ -0,0 +1,15 @@ +versions: + "0.12.0": + folder: all + "0.11.0": + folder: all + "0.10.0": + folder: all + "0.9.1": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all + "0.3.7": + folder: all diff --git a/recipes/rangeless/all/conandata.yml b/recipes/rangeless/all/conandata.yml new file mode 100644 index 0000000000000..d611d37a7dd27 --- /dev/null +++ b/recipes/rangeless/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20201117": + url: "https://github.com/ast-al/rangeless/archive/a6ea959a6034991e46dc3fc9ff0920f6abc928b8.tar.gz" + sha256: "8f2bad299cae15872b4233828c09a53299f1a111ef524c8ce4f00b959bf989d5" diff --git a/recipes/rangeless/all/conanfile.py b/recipes/rangeless/all/conanfile.py new file mode 100644 index 0000000000000..d37a7eb54aeb3 --- /dev/null +++ b/recipes/rangeless/all/conanfile.py @@ -0,0 +1,34 @@ +from conans import ConanFile, tools +import os +import glob + +class RangelessConan(ConanFile): + name = "rangeless" + description = "c++ LINQ -like library of higher-order functions for data manipulation" + license = "MIT" + homepage = "https://github.com/ast-al/rangeless" + url = "https://github.com/conan-io/conan-center-index" + topics = ("range", "linq", "lazy-evaluation", "header-only") + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + minimal_cpp_standard = "14" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob(self.name + "-*/")[0] + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) diff --git a/recipes/rangeless/all/test_package/CMakeLists.txt b/recipes/rangeless/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e1e9d9b89fe0 --- /dev/null +++ b/recipes/rangeless/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/rangeless/all/test_package/conanfile.py b/recipes/rangeless/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c9d5dba712c7 --- /dev/null +++ b/recipes/rangeless/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rangeless/all/test_package/test_package.cpp b/recipes/rangeless/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4f49c17e155f2 --- /dev/null +++ b/recipes/rangeless/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include +#include + +namespace fn = rangeless::fn; +using fn::operators::operator%; // arg % fn equivalent to fn(std::forward(arg)) +using fn::operators::operator%=; // arg %= fn; equivalent to arg = fn( std::move(arg)); + +int main() { + auto values = std::vector{0,1,2,3,4,5,6,7,8,9,10}; + values = std::move(values) + % fn::where([](auto&& _) { return _ % 2 == 0; }) + % fn::transform([] (auto&& _) { return _ * 3; }); + + auto expected = std::vector{0,6,12,18,24,30}; + bool success = values == expected; + + return success ? 0 : 1; +} diff --git a/recipes/rangeless/config.yml b/recipes/rangeless/config.yml new file mode 100644 index 0000000000000..0ae9824000fb0 --- /dev/null +++ b/recipes/rangeless/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201117": + folder: all diff --git a/recipes/rangesnext/all/conandata.yml b/recipes/rangesnext/all/conandata.yml new file mode 100644 index 0000000000000..72383f2492ee7 --- /dev/null +++ b/recipes/rangesnext/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20210426": + url: "https://github.com/cor3ntin/rangesnext/archive/10fd1cffe7a2a9688a31f91ec8754668c4cdd9a6.tar.gz" + sha256: 8b4ba9129346818d1ad2ab1fe00ccb85c5c1b35fef91868aece97aa079e0dec4 +patches: + "cci.20210426": + - patch_file: "patches/0001-cmake-disable-tests.patch" + base_path: "source_subfolder" diff --git a/recipes/rangesnext/all/conanfile.py b/recipes/rangesnext/all/conanfile.py new file mode 100644 index 0000000000000..b438391b226f9 --- /dev/null +++ b/recipes/rangesnext/all/conanfile.py @@ -0,0 +1,37 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class RangesnextConan(ConanFile): + name = "rangesnext" + description = "ranges features for C++23 ported to C++20" + topics = ("conan", "rangesnext", "ranges", "backport", "backport-cpp") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cor3ntin/rangesnext" + license = "BSL-1.0" + settings = "compiler" + no_copy_source = True + + _compilers_minimum_version = { + "gcc": "10", + "Visual Studio": "19", + "clang": "13" + } + _source_subfolder = "source_subfolder" + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "20") + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version or tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("rangesnext requires C++20, which your compiler does not fully support.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + include_folder = os.path.join(self._source_subfolder, "include") + self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=include_folder) diff --git a/recipes/rangesnext/all/test_package/CMakeLists.txt b/recipes/rangesnext/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2bd2a465ffb06 --- /dev/null +++ b/recipes/rangesnext/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(rangesnext REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} rangesnext::rangesnext) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) diff --git a/recipes/rangesnext/all/test_package/conanfile.py b/recipes/rangesnext/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c9d5dba712c7 --- /dev/null +++ b/recipes/rangesnext/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rangesnext/all/test_package/test_package.cpp b/recipes/rangesnext/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e25f23d096604 --- /dev/null +++ b/recipes/rangesnext/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include + +namespace rangesnext = cor3ntin::rangesnext; + +template +bool test_enumerate_with(RangeT &&range) { + auto enumerated_range = rangesnext::enumerate(range); + + std::size_t idx_ref = 0; + auto it_ref = std::ranges::begin(range); + + bool success = true; + for (auto &&[i, v] : enumerated_range) { + std::cout << i << " - " << v << "\n"; + + success = (i == idx_ref++) && (v == *it_ref++); + if (success == false) { + return false; + } + } + + return true; +} + +int main() { + int const test_array[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; + test_enumerate_with(test_array); +} diff --git a/recipes/rangesnext/config.yml b/recipes/rangesnext/config.yml new file mode 100644 index 0000000000000..b83c4168f469b --- /dev/null +++ b/recipes/rangesnext/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210426": + folder: all diff --git a/recipes/rapidcheck/all/conandata.yml b/recipes/rapidcheck/all/conandata.yml new file mode 100644 index 0000000000000..51a9ed8cc8578 --- /dev/null +++ b/recipes/rapidcheck/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "cci.20220514": + url: "https://github.com/emil-e/rapidcheck/archive/8fafda42e732164db58003e542196e94a28481f9.zip" + sha256: "63853f74026678b5cfed5f18f5d8cbd4eccb2f48bb89a8f8cb1cd1cc69f22db8" + "cci.20210702": + url: "https://github.com/emil-e/rapidcheck/archive/33d15a858e3125f5af61a655f390f1cbc2f272ba.zip" + sha256: "521c9b163f0018ea6379513e0c674d520b9da66fdb8df73a7a98b04ea2358e69" + "cci.20210107": + url: "https://github.com/emil-e/rapidcheck/archive/37bcab858dfc398634d409c973363088703ba96e.zip" + sha256: "35433d0417fb945abe2b56b720b03d6d92da1188e760c50662c243dac42a6717" + "cci.20200131": + url: "https://github.com/emil-e/rapidcheck/archive/258d907da00a0855f92c963d8f76eef115531716.zip" + sha256: "87bfbdceaa09e7aaaf70b2efd0078e93323dd8abdad48c57e9f23bfd84174a75" +patches: + "cci.20220514": + - patch_file: "patches/0001-gtest-catch-integration-20220514.patch" + patch_description: "Remove dependency on test frameworks for for rapidcheck tests" + patch_type: "conan" + "cci.20210702": + - patch_file: "patches/0001-gtest-catch-integration-20210702.patch" + patch_description: "Remove dependency on test frameworks for for rapidcheck tests" + patch_type: "conan" + "cci.20210107": + - patch_file: "patches/0001-gtest-catch-integration-20210107.patch" + patch_description: "Remove dependency on test frameworks for for rapidcheck tests" + patch_type: "conan" + "cci.20200131": + - patch_file: "patches/0001-gtest-catch-integration-20200131.patch" + patch_description: "Remove dependency on test frameworks for for rapidcheck tests" + patch_type: "conan" diff --git a/recipes/rapidcheck/all/conanfile.py b/recipes/rapidcheck/all/conanfile.py new file mode 100644 index 0000000000000..8f0ec69d27e6a --- /dev/null +++ b/recipes/rapidcheck/all/conanfile.py @@ -0,0 +1,164 @@ +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, get, copy, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from os.path import join +import textwrap + +required_conan_version = ">=1.53.0" + + +class RapidcheckConan(ConanFile): + name = "rapidcheck" + description = "QuickCheck clone for C++ with the goal of being simple to use with as little boilerplate as possible" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/emil-e/rapidcheck" + license = "BSD-2-Clause" + topics = ("quickcheck", "testing", "property-testing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_rtti": [True, False], + "enable_catch": [True, False], + "enable_gmock": [True, False], + "enable_gtest": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_rtti": True, + "enable_catch": False, + "enable_gmock": False, + "enable_gtest": False, + } + + @property + def _min_cppstd(self): + return 11 + + 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): + if self.options.enable_catch: + self.requires("catch2/2.13.10") + if self.options.enable_gmock or self.options.enable_gtest: + self.requires("gtest/1.12.1") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + if self.options.enable_gmock and not self.dependencies["gtest"].options.build_gmock: + raise ConanInvalidConfiguration("The option `rapidcheck:enable_gmock` requires `gtest/*:build_gmock=True`") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RC_ENABLE_RTTI"] = self.options.enable_rtti + tc.variables["RC_ENABLE_TESTS"] = False + tc.variables["RC_ENABLE_EXAMPLES"] = False + tc.variables["RC_ENABLE_CATCH"] = self.options.enable_catch + tc.variables["RC_ENABLE_GMOCK"] = self.options.enable_gmock + tc.variables["RC_ENABLE_GTEST"] = self.options.enable_gtest + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE*", dst=join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + join(self.package_folder, self._module_file_rel_path), + { + "rapidcheck": "rapidcheck::rapidcheck_rapidcheck", + "rapidcheck_catch":"rapidcheck::rapidcheck_catch", + "rapidcheck_gmock": "rapidcheck::rapidcheck_gmock", + "rapidcheck_gtest": "rapidcheck::rapidcheck_gtest", + } + ) + + 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_file_rel_path(self): + return join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "rapidcheck") + + self.cpp_info.components["rapidcheck_rapidcheck"].set_property("cmake_target_name", "rapidcheck") + self.cpp_info.components["rapidcheck_rapidcheck"].libs = ["rapidcheck"] + version = str(self.version)[4:] + if Version(version) < "20201218": + if self.options.enable_rtti: + self.cpp_info.components["rapidcheck_rapidcheck"].defines.append("RC_USE_RTTI") + else: + if not self.options.enable_rtti: + self.cpp_info.components["rapidcheck_rapidcheck"].defines.append("RC_DONT_USE_RTTI") + + if self.options.enable_catch: + self.cpp_info.components["rapidcheck_catch"].set_property("cmake_target_name", "rapidcheck_catch") + self.cpp_info.components["rapidcheck_catch"].requires = ["rapidcheck_rapidcheck", "catch2::catch2"] + if self.options.enable_gmock: + self.cpp_info.components["rapidcheck_gmock"].set_property("cmake_target_name", "rapidcheck_gmock") + self.cpp_info.components["rapidcheck_gmock"].requires = ["rapidcheck_rapidcheck", "gtest::gtest"] + if self.options.enable_gtest: + self.cpp_info.components["rapidcheck_gtest"].set_property("cmake_target_name", "rapidcheck_gtest") + self.cpp_info.components["rapidcheck_gtest"].requires = ["rapidcheck_rapidcheck", "gtest::gtest"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["rapidcheck_rapidcheck"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["rapidcheck_rapidcheck"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.enable_catch: + self.cpp_info.components["rapidcheck_catch"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["rapidcheck_catch"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.enable_gmock: + self.cpp_info.components["rapidcheck_gmock"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["rapidcheck_gmock"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.enable_gtest: + self.cpp_info.components["rapidcheck_gtest"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["rapidcheck_gtest"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20200131.patch b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20200131.patch new file mode 100644 index 0000000000000..000892c7e9c5d --- /dev/null +++ b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20200131.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 92bc63c7df2cb87b5e5672a7651dbb4eafa3aaa7..14000896cd4e6ebcde3f2154b85caf4f5cca056b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,8 +106,6 @@ if(RC_ENABLE_RTTI) + target_compile_definitions(rapidcheck PUBLIC RC_USE_RTTI) + endif() + +-add_subdirectory(ext) +- + if(RC_ENABLE_TESTS) + enable_testing() + add_subdirectory(test) diff --git a/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210107.patch b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210107.patch new file mode 100644 index 0000000000000..ea5f3774d8053 --- /dev/null +++ b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210107.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9f583afc171fab0a6894ffd64a0c787fd806bbaa..ea31145f55fe1010fe36739c17a655309db552f1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,8 +106,6 @@ if(NOT RC_ENABLE_RTTI) + target_compile_definitions(rapidcheck PUBLIC RC_DONT_USE_RTTI) + endif() + +-add_subdirectory(ext) +- + if(RC_ENABLE_TESTS) + enable_testing() + add_subdirectory(test) diff --git a/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210702.patch b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210702.patch new file mode 100644 index 0000000000000..5b6a9b2d92e33 --- /dev/null +++ b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20210702.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 15c46d01288dce235179b791770187f5a38230ab..1805354a744931086622c41fa5a640c283142adc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,8 +111,6 @@ if(NOT RC_ENABLE_RTTI) + target_compile_definitions(rapidcheck PUBLIC RC_DONT_USE_RTTI) + endif() + +-add_subdirectory(ext) +- + if(RC_ENABLE_TESTS) + enable_testing() + add_subdirectory(test) diff --git a/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20220514.patch b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20220514.patch new file mode 100644 index 0000000000000..eccc232f42f8b --- /dev/null +++ b/recipes/rapidcheck/all/patches/0001-gtest-catch-integration-20220514.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9f583af..ea31145 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,8 +106,6 @@ if(NOT RC_ENABLE_RTTI) + target_compile_definitions(rapidcheck PUBLIC RC_DONT_USE_RTTI) + endif() + +-add_subdirectory(ext) +- + if(RC_ENABLE_TESTS) + enable_testing() + add_subdirectory(test) diff --git a/recipes/rapidcheck/all/test_package/CMakeLists.txt b/recipes/rapidcheck/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dd2ba2ff70ddf --- /dev/null +++ b/recipes/rapidcheck/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(rapidcheck REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidcheck::rapidcheck) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidcheck/all/test_package/conanfile.py b/recipes/rapidcheck/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/rapidcheck/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/rapidcheck/all/test_package/test_package.cpp b/recipes/rapidcheck/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..64172531138e7 --- /dev/null +++ b/recipes/rapidcheck/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include + +int main() { + rc::check("double reversal yields the original value", + [](const std::vector &l0) { + auto l1 = l0; + std::reverse(begin(l1), end(l1)); + std::reverse(begin(l1), end(l1)); + RC_ASSERT(l0 == l1); + }); + + return 0; +} diff --git a/recipes/rapidcheck/all/test_v1_package/CMakeLists.txt b/recipes/rapidcheck/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/rapidcheck/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rapidcheck/all/test_v1_package/conanfile.py b/recipes/rapidcheck/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8037a9296cc42 --- /dev/null +++ b/recipes/rapidcheck/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidcheck/config.yml b/recipes/rapidcheck/config.yml new file mode 100644 index 0000000000000..c35d572c8cdf5 --- /dev/null +++ b/recipes/rapidcheck/config.yml @@ -0,0 +1,9 @@ +versions: + "cci.20220514": + folder: all + "cci.20210702": + folder: all + "cci.20210107": + folder: all + "cci.20200131": + folder: all diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml new file mode 100644 index 0000000000000..502ec08fa730f --- /dev/null +++ b/recipes/rapidcsv/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "8.75": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.75.tar.gz" + sha256: "004454890d371b4db370dfd44d64077f8f9b2b92e59d1d6471e1923f891485be" + "8.69": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.69.tar.gz" + sha256: "b63e58b1d18277f0331e211bbe6740587069fcd3e5b5a5fb63be7d2f17250d54" + "8.64": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.64.tar.gz" + sha256: "e2ab5231b6e65f1e168dc279bbba2e34afd43c7bc6e2522726b107bcc4e8ebac" + "8.62": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.62.tar.gz" + sha256: "a7efda6324420f2b69d3448672a9553dc91520632409661f9f83ac0425faa31d" + "8.53": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.53.tar.gz" + sha256: "27cc1d6b924e91b99640aae5c6c286bb60494d0bee1ec10e1bfd39698d30007b" diff --git a/recipes/rapidcsv/all/conanfile.py b/recipes/rapidcsv/all/conanfile.py new file mode 100644 index 0000000000000..a9d964b6536a3 --- /dev/null +++ b/recipes/rapidcsv/all/conanfile.py @@ -0,0 +1,47 @@ +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 RapidcsvConan(ConanFile): + name = "rapidcsv" + description = "C++ CSV parser library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/d99kris/rapidcsv" + topics = ("csv", "parser", "header-only") + 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="*.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/rapidcsv/all/test_package/CMakeLists.txt b/recipes/rapidcsv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30d340fa95be7 --- /dev/null +++ b/recipes/rapidcsv/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(rapidcsv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidcsv::rapidcsv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidcsv/all/test_package/conanfile.py b/recipes/rapidcsv/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/rapidcsv/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rapidcsv/all/test_package/test_package.cpp b/recipes/rapidcsv/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6fd1c006fa692 --- /dev/null +++ b/recipes/rapidcsv/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "rapidcsv.h" + +#include +#include + +int main() { + std::string csv = + "City,Temperature\n" + "Munich,5.4\n" + "Paris,9.3\n" + "Rio de Janeiro,20.4\n" + "New York City,19.9\n" + "Adelaide,14.5\n"; + std::stringstream stream(csv); + rapidcsv::Document doc(stream, rapidcsv::LabelParams()); + return 0; +} diff --git a/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt b/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rapidcsv/all/test_v1_package/conanfile.py b/recipes/rapidcsv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/rapidcsv/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml new file mode 100644 index 0000000000000..df34fa7350e3c --- /dev/null +++ b/recipes/rapidcsv/config.yml @@ -0,0 +1,11 @@ +versions: + "8.75": + folder: "all" + "8.69": + folder: "all" + "8.64": + folder: "all" + "8.62": + folder: "all" + "8.53": + folder: "all" diff --git a/recipes/rapidfuzz/all/conandata.yml b/recipes/rapidfuzz/all/conandata.yml new file mode 100644 index 0000000000000..040b401c838af --- /dev/null +++ b/recipes/rapidfuzz/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.10.4": + url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v1.10.4.tar.gz" + sha256: "84a1ea8759aaa5bc8587c26504421d6fd34ad2a8dc74bf469b0cc3cc6758e17a" + "cci.20210513": + url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/d1e82379395cafc6d439c1c1e2cbe7512eaf2518.tar.gz" + sha256: "e5c306aae2fb4b34a381fbffaa97399114f20de14d83914ac2c9013b0226ce57" diff --git a/recipes/rapidfuzz/all/conanfile.py b/recipes/rapidfuzz/all/conanfile.py new file mode 100644 index 0000000000000..c1795c07d7730 --- /dev/null +++ b/recipes/rapidfuzz/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 PackageConan(ConanFile): + name = "rapidfuzz" + description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/maxbachmann/rapidfuzz-cpp" + topics = ("levenshtein", "string-matching", "string-similarity", "string-comparison", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + if self.version == "cci.20210513": + return 98 + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "6", + "clang": "6", + "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, "rapidfuzz/*.hpp", self.source_folder, os.path.join(self.package_folder, "include")) + copy(self, "rapidfuzz/*.impl", self.source_folder, os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rapidfuzz/all/test_package/CMakeLists.txt b/recipes/rapidfuzz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f63d271b136c --- /dev/null +++ b/recipes/rapidfuzz/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(rapidfuzz REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidfuzz::rapidfuzz) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/rapidfuzz/all/test_package/conanfile.py b/recipes/rapidfuzz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/rapidfuzz/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rapidfuzz/all/test_package/test_package.cpp b/recipes/rapidfuzz/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c3f921a147376 --- /dev/null +++ b/recipes/rapidfuzz/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main() { + std::string s1("new york mets"); + std::string s2("new YORK mets"); + int r = rapidfuzz::fuzz::ratio(s1, s1); + if (r == 100) { + return 0; + } else { + return -1; + } +} diff --git a/recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt b/recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rapidfuzz/all/test_v1_package/conanfile.py b/recipes/rapidfuzz/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/rapidfuzz/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidfuzz/config.yml b/recipes/rapidfuzz/config.yml new file mode 100644 index 0000000000000..5f45a18000f9c --- /dev/null +++ b/recipes/rapidfuzz/config.yml @@ -0,0 +1,5 @@ +versions: + "1.10.4": + folder: "all" + "cci.20210513": + folder: "all" diff --git a/recipes/rapidjson/all/conandata.yml b/recipes/rapidjson/all/conandata.yml new file mode 100644 index 0000000000000..dd7649f2b814f --- /dev/null +++ b/recipes/rapidjson/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.1.0": + url: "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" + sha256: bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e + # More recent unofficial releases based on commits + "cci.20220822": + url: "https://github.com/Tencent/rapidjson/archive/06d58b9e848c650114556a23294d0b6440078c61.tar.gz" + sha256: 30d28bbe0bfff9d8dc5d3cf62799b6ee550499cc1520e44bdece81e002480d19 + "cci.20211112": + url: "https://github.com/Tencent/rapidjson/archive/0d4517f15a8d7167ba9ae67f3f22a559ca841e3b.tar.gz" + sha256: 3697fdcea30dc7c2b2bb68d2521a6b8793f4d3269de751eed2c5fd477ff329ce + "cci.20200410": + url: "https://github.com/Tencent/rapidjson/archive/8f4c021fa2f1e001d2376095928fc0532adf2ae6.zip" + sha256: e6fc99c7df7f29995838a764dd68df87b71db360f7727ace467b21b82c85efda diff --git a/recipes/rapidjson/all/conanfile.py b/recipes/rapidjson/all/conanfile.py new file mode 100644 index 0000000000000..01002651291b6 --- /dev/null +++ b/recipes/rapidjson/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class RapidjsonConan(ConanFile): + name = "rapidjson" + description = "A fast JSON parser/generator for C++ with both SAX/DOM style API" + topics = ("rapidjson", "json", "parser", "generator") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://rapidjson.org" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=self.source_folder) + + def package(self): + copy(self, pattern="license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "RapidJSON") + self.cpp_info.set_property("cmake_target_name", "rapidjson") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "RapidJSON" + self.cpp_info.names["cmake_find_package_multi"] = "RapidJSON" diff --git a/recipes/rapidjson/all/test_package/CMakeLists.txt b/recipes/rapidjson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30b669a758f42 --- /dev/null +++ b/recipes/rapidjson/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(RapidJSON CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidjson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidjson/all/test_package/conanfile.py b/recipes/rapidjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..081c97abefb38 --- /dev/null +++ b/recipes/rapidjson/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +required_conan_version = ">=1.50.0" + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/rapidjson/all/test_package/test_package.cpp b/recipes/rapidjson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..06be2978f0792 --- /dev/null +++ b/recipes/rapidjson/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include "rapidjson/document.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" + +#include + +using namespace rapidjson; + +int main() { + const char* json = "{\"working\":\"false\"}"; + Document d; + d.Parse(json); + + Value& w = d["working"]; + w.SetString("true", 4); + + StringBuffer buffer; + Writer writer(buffer); + d.Accept(writer); + + std::cout << buffer.GetString() << std::endl; + return 0; +} diff --git a/recipes/rapidjson/all/test_v1_package/CMakeLists.txt b/recipes/rapidjson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a694a0d382f57 --- /dev/null +++ b/recipes/rapidjson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(RapidJSON CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE RapidJSON::RapidJSON) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidjson/all/test_v1_package/conanfile.py b/recipes/rapidjson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/rapidjson/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/rapidjson/config.yml b/recipes/rapidjson/config.yml new file mode 100644 index 0000000000000..82e5350012d0b --- /dev/null +++ b/recipes/rapidjson/config.yml @@ -0,0 +1,9 @@ +versions: + "1.1.0": + folder: "all" + "cci.20220822": + folder: "all" + "cci.20211112": + folder: "all" + "cci.20200410": + folder: "all" diff --git a/recipes/rapidxml/all/conandata.yml b/recipes/rapidxml/all/conandata.yml new file mode 100644 index 0000000000000..76068c74da698 --- /dev/null +++ b/recipes/rapidxml/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.13": + url: "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" + sha256: "c3f0b886374981bb20fabcf323d755db4be6dba42064599481da64a85f5b3571" +patches: + "1.13": + - patch_file: "patches/1.13-fix-template-compile-issue.patch" + patch_description: "Fix compilation issue: call to function 'print_declaration_node' that is neither visible in the template definition nor found by argument-dependent lookup" + patch_type: "portability" + patch_source: "https://sourceforge.net/p/rapidxml/bugs/16/" diff --git a/recipes/rapidxml/all/conanfile.py b/recipes/rapidxml/all/conanfile.py new file mode 100644 index 0000000000000..5a9da57877b5d --- /dev/null +++ b/recipes/rapidxml/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class RapiXMLConan(ConanFile): + name = "rapidxml" + description = "RapidXml is an attempt to create the fastest XML parser possible." + license = ["BSL-1.0", "MIT"] + topics = ("rapidxml", "xml", "parser") + homepage = "http://rapidxml.sourceforge.net" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "rapidxml")) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "rapidxml")) + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/rapidxml/all/patches/1.13-fix-template-compile-issue.patch b/recipes/rapidxml/all/patches/1.13-fix-template-compile-issue.patch new file mode 100644 index 0000000000000..a9cede875ca45 --- /dev/null +++ b/recipes/rapidxml/all/patches/1.13-fix-template-compile-issue.patch @@ -0,0 +1,36 @@ +--- rapidxml_print.hpp ++++ rapidxml_print.hpp +@@ -102,6 +102,33 @@ namespace rapidxml + /////////////////////////////////////////////////////////////////////////// + // Internal printing operations + ++ template ++ inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_attributes(OutIt out, const xml_node *node, int flags); ++ ++ template ++ inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); ++ + // Print node + template + inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) diff --git a/recipes/rapidxml/all/test_package/CMakeLists.txt b/recipes/rapidxml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c90ae86e829dd --- /dev/null +++ b/recipes/rapidxml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(rapidxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidxml::rapidxml) diff --git a/recipes/rapidxml/all/test_package/beer_journal.xml b/recipes/rapidxml/all/test_package/beer_journal.xml new file mode 100644 index 0000000000000..381ed0bd6fadd --- /dev/null +++ b/recipes/rapidxml/all/test_package/beer_journal.xml @@ -0,0 +1,18 @@ + + + + + "What an excellent IPA. This is the most delicious beer I have ever tasted!" + + + + + This beer is not so good... but I am not that big of a fan of english style ales. + + + + + Another execllent brew. Two Hearted gives Founders Centennial a run for it's money. + + + diff --git a/recipes/rapidxml/all/test_package/conanfile.py b/recipes/rapidxml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bef433c11e54d --- /dev/null +++ b/recipes/rapidxml/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xml_name = os.path.join(self.source_folder, "beer_journal.xml") + self.run(f"{bin_path} {xml_name}", env="conanrun") diff --git a/recipes/rapidxml/all/test_package/test_package.cpp b/recipes/rapidxml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..efdb15bdbb996 --- /dev/null +++ b/recipes/rapidxml/all/test_package/test_package.cpp @@ -0,0 +1,49 @@ +#include +#include + +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + if (argc < 2) { + std::cerr << "Need at least one argument\n"; + return 1; + } + + std::cout << "Parsing my beer journal..." << std::endl; + rapidxml::xml_document<> doc; + rapidxml::xml_node<> * root_node; + // Read the xml file into a vector + std::ifstream theFile(argv[1]); + std::vector buffer((std::istreambuf_iterator(theFile)), std::istreambuf_iterator()); + buffer.push_back('\0'); + // Parse the buffer using the xml file parsing library into doc + doc.parse<0>(&buffer[0]); + // Find our root node + root_node = doc.first_node("MyBeerJournal"); + // Iterate over the brewerys + for (rapidxml::xml_node<> * brewery_node = root_node->first_node("Brewery"); brewery_node; brewery_node = brewery_node->next_sibling()) + { + printf("I have visited %s in %s. ", + brewery_node->first_attribute("name")->value(), + brewery_node->first_attribute("location")->value()); + // Interate over the beers + for(rapidxml::xml_node<> * beer_node = brewery_node->first_node("Beer"); beer_node; beer_node = beer_node->next_sibling()) + { + printf("On %s, I tried their %s which is a %s. ", + beer_node->first_attribute("dateSampled")->value(), + beer_node->first_attribute("name")->value(), + beer_node->first_attribute("description")->value()); + printf("I gave it the following review: %s", beer_node->value()); + } + std::cout << std::endl; + } + + std::cout << "Original xml document:" << std::endl; + std::cout << doc; + + return 0; +} diff --git a/recipes/rapidxml/all/test_v1_package/CMakeLists.txt b/recipes/rapidxml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3eff1dc88bc30 --- /dev/null +++ b/recipes/rapidxml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(rapidxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidxml::rapidxml) diff --git a/recipes/rapidxml/all/test_v1_package/conanfile.py b/recipes/rapidxml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..af166909110f7 --- /dev/null +++ b/recipes/rapidxml/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_name = os.path.join(self.source_folder, os.pardir, "test_package", "beer_journal.xml") + self.run(f"{bin_path} {xml_name}", run_environment=True) diff --git a/recipes/rapidxml/config.yml b/recipes/rapidxml/config.yml new file mode 100644 index 0000000000000..48dc233badeb6 --- /dev/null +++ b/recipes/rapidxml/config.yml @@ -0,0 +1,3 @@ +versions: + "1.13": + folder: all diff --git a/recipes/rapidyaml/all/conandata.yml b/recipes/rapidyaml/all/conandata.yml new file mode 100644 index 0000000000000..dd5074af2a9b9 --- /dev/null +++ b/recipes/rapidyaml/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "0.5.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0-src.tgz" + sha256: "6493557778791a3a2375510ce6c0ecd70163fc8ce4f8ed683acc36e3e55ee881" + "0.4.1": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.4.1/rapidyaml-0.4.1-src.tgz" + sha256: "3c0a671a7a5aab972f7d259736d14beb9f428c4441f0c220dc0717a4946b495c" + "0.4.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.4.0/rapidyaml-0.4.0-src.tgz" + sha256: "f8c8c79c28cae568e10fcde9897fbc4350aaa3fa21ea3a6ec4ace3445e61a7cf" + "0.3.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.3.0/rapidyaml-0.3.0-src.tgz" + sha256: "38854b8359eaf42cc27352f4b7321f509f6775445a3e2746cc8cd1e468a52aa9" +patches: + "0.5.0": + - patch_file: "patches/0.5.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" + "0.4.1": + - patch_file: "patches/0.4.1-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" + "0.4.0": + - patch_file: "patches/0.4.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" + "0.3.0": + - patch_file: "patches/0.3.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" diff --git a/recipes/rapidyaml/all/conanfile.py b/recipes/rapidyaml/all/conanfile.py new file mode 100644 index 0000000000000..5e12ce14eb4bb --- /dev/null +++ b/recipes/rapidyaml/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.tools.microsoft import check_min_vs +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class RapidYAMLConan(ConanFile): + name = "rapidyaml" + description = "a library to parse and emit YAML, and do it fast." + license = "MIT", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/biojppm/rapidyaml" + topics = ("yaml", "parser", "emitter") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_default_callbacks": [True, False], + "with_tab_tokens": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_default_callbacks": True, + "with_tab_tokens": False, + } + + @property + def _minimum_cpp_standard(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "0.4.0": + del self.options.with_tab_tokens + + 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("c4core/0.1.11", transitive_headers=True) + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 190) + + 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["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 + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.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, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.natvis", os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ryml") + self.cpp_info.set_property("cmake_target_name", "ryml::ryml") + self.cpp_info.libs = ["ryml"] + + self.cpp_info.names["cmake_find_package"] = "ryml" + self.cpp_info.names["cmake_find_package_multi"] = "ryml" diff --git a/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..124d310efbad6 --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a75251a..3a5d087 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,7 @@ project(ryml + DESCRIPTION "Rapid YAML parsing and emitting" + HOMEPAGE_URL "https://github.com/biojppm/rapidyaml" + LANGUAGES CXX) +-c4_project(VERSION 0.3.0 STANDALONE ++c4_project(VERSION 0.3.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -17,8 +17,7 @@ option(RYML_DBG "Enable (very verbose) ryml debug prints." OFF) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core) ++find_package(c4core REQUIRED CONFIG) + + c4_add_library(ryml + SOURCES +@@ -52,8 +51,7 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ LIBS c4core::c4core + ) + + if(NOT RYML_DEFAULT_CALLBACKS) +@@ -68,7 +66,6 @@ endif() + #------------------------------------------------------- + + c4_install_target(ryml) +-c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + + diff --git a/recipes/rapidyaml/all/patches/0.4.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.4.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..a13b6fd05fe57 --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.4.0-001-remove-internal-c4core.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3b2444f..38e5229 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.4.0 STANDALONE ++c4_project(VERSION 0.4.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -21,8 +21,7 @@ option(RYML_DBG "Enable (very verbose) ryml debug prints." OFF) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core) ++find_package(c4core REQUIRED CONFIG) + + c4_add_library(ryml + SOURCES +@@ -56,8 +55,7 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ LIBS c4core::c4core + ) + + if(RYML_WITH_TAB_TOKENS) +@@ -76,7 +74,6 @@ endif() + #------------------------------------------------------- + + c4_install_target(ryml) +-c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + + diff --git a/recipes/rapidyaml/all/patches/0.4.1-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.4.1-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..568f638050309 --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.4.1-001-remove-internal-c4core.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3b2444f..38e5229 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.4.1 STANDALONE ++c4_project(VERSION 0.4.1 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -21,8 +21,7 @@ option(RYML_DBG "Enable (very verbose) ryml debug prints." OFF) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core) ++find_package(c4core REQUIRED CONFIG) + + c4_add_library(ryml + SOURCES +@@ -56,8 +55,7 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ LIBS c4core::c4core + ) + + if(RYML_WITH_TAB_TOKENS) +@@ -76,7 +74,6 @@ endif() + #------------------------------------------------------- + + c4_install_target(ryml) +-c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + + diff --git a/recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..b9735434a58e1 --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 11c52e0..e79d144 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.5.0 STANDALONE ++c4_project(VERSION 0.5.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -21,8 +21,7 @@ option(RYML_DBG "Enable (very verbose) ryml debug prints." OFF) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core) ++find_package(c4core REQUIRED CONFIG) + + c4_add_library(ryml + SOURCES +@@ -56,9 +55,8 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core +- ) ++ LIBS c4core::c4core ++) + + if(RYML_WITH_TAB_TOKENS) + target_compile_definitions(ryml PUBLIC RYML_WITH_TAB_TOKENS) +@@ -76,7 +74,6 @@ endif() + #------------------------------------------------------- + + c4_install_target(ryml) +-c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + + diff --git a/recipes/rapidyaml/all/test_package/CMakeLists.txt b/recipes/rapidyaml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc844b7829375 --- /dev/null +++ b/recipes/rapidyaml/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ryml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ryml::ryml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(ryml_VERSION VERSION_GREATER_EQUAL "0.4.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE RYML_USE_PARSE_IN_ARENA) +endif() diff --git a/recipes/rapidyaml/all/test_package/conanfile.py b/recipes/rapidyaml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/rapidyaml/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/rapidyaml/all/test_package/test_package.cpp b/recipes/rapidyaml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c912a3186940 --- /dev/null +++ b/recipes/rapidyaml/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include +#include +#include + +#include + +int main() { + // `yml::parse() is deprecated since 0.4.0. Use `yml::parse_in_arena()` instead. +#ifdef RYML_USE_PARSE_IN_ARENA + auto tree = c4::yml::parse_in_arena("{foo: 1}"); +#else + auto tree = c4::yml::parse("{foo: 1}"); +#endif + + auto const value = tree["foo"].val(); + + std::cout << value << std::endl; + + auto bar = tree.rootref()["bar"]; + bar |= c4::yml::SEQ; + bar.append_child() = "bar0"; + bar.append_child() = "bar1"; + bar.append_child() = "bar2"; + + std::string buffer; + + c4::yml::emitrs(tree, &buffer); + + std::cout << buffer << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/rapidyaml/all/test_v1_package/conanfile.py b/recipes/rapidyaml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/rapidyaml/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidyaml/config.yml b/recipes/rapidyaml/config.yml new file mode 100644 index 0000000000000..a10a27debb1f0 --- /dev/null +++ b/recipes/rapidyaml/config.yml @@ -0,0 +1,9 @@ +versions: + "0.5.0": + folder: all + "0.4.1": + folder: all + "0.4.0": + folder: all + "0.3.0": + folder: all diff --git a/recipes/raylib/all/CMakeLists.txt b/recipes/raylib/all/CMakeLists.txt new file mode 100644 index 0000000000000..0496b29838549 --- /dev/null +++ b/recipes/raylib/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/raylib/all/conandata.yml b/recipes/raylib/all/conandata.yml new file mode 100644 index 0000000000000..17c0c7abb4dfd --- /dev/null +++ b/recipes/raylib/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "3.5.0": + url: "https://github.com/raysan5/raylib/archive/3.5.0.tar.gz" + sha256: "761985876092fa98a99cbf1fef7ca80c3ee0365fb6a107ab901a272178ba69f5" + "4.0.0": + url: "https://github.com/raysan5/raylib/archive/4.0.0.tar.gz" + sha256: "11f6087dc7bedf9efb3f69c0c872f637e421d914e5ecea99bbe7781f173dc38c" + +patches: + "3.5.0": + - patch_file: "patches/0001-3.5.0-enable-cmake-build.patch" + base_path: "source_subfolder" + "4.0.0": + - patch_file: "patches/0001-4.0.0-enable-cmake-build.patch" + base_path: "source_subfolder" diff --git a/recipes/raylib/all/conanfile.py b/recipes/raylib/all/conanfile.py new file mode 100644 index 0000000000000..6003a95f7be72 --- /dev/null +++ b/recipes/raylib/all/conanfile.py @@ -0,0 +1,150 @@ +from conans import ConanFile, CMake, tools +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class RaylibConan(ConanFile): + name = "raylib" + description = "raylib is a simple and easy-to-use library to enjoy videogames programming." + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.raylib.com/" + topics = ("raylib", "gamedev") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_external_glfw": [True, False], + "opengl_version":[None, "3.3","2.1","1.1","ES-2.0"] + } + default_options = { + "shared": False, + "fPIC": True, + "use_external_glfw": True, + "opengl_version" : None + } + + exports_sources = ["CMakeLists.txt","patches/**"] + generators = "cmake", "cmake_find_package_multi" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + + if self.options.use_external_glfw and self.settings.os != "Android": + self.requires("glfw/3.3.6") + + if self.settings.os != "Android": + self.requires("opengl/system") + + if self.settings.os == "Linux": + self.requires("xorg/system") + + 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["BUILD_EXAMPLES"] = False + + if self.settings.os == "Android": + self._cmake.definitions["PLATFORM"] = "Android" + self._cmake.definitions["USE_EXTERNAL_GLFW"] = "OFF" + self._cmake.definitions["OPENGL_VERSION"] = "ES 2.0" + else: + self._cmake.definitions["USE_EXTERNAL_GLFW"] = "OFF" if self.options.use_external_glfw else "ON" + self._cmake.definitions["OPENGL_VERSION"] = "OFF" if not self.options.opengl_version else self.options.opengl_version + + self._cmake.definitions["WITH_PIC"] = self.options.get_safe("fPIC", True) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"raylib": "raylib::raylib"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "raylib") + self.cpp_info.set_property("cmake_target_name", "raylib") + self.cpp_info.set_property("pkg_config_name", "raylib") + libname = "raylib" + if self._is_msvc and not self.options.shared and self.version == '3.5.0': + libname += "_static" + self.cpp_info.libs = [libname] + if self._is_msvc and self.options.shared: + self.cpp_info.defines.append("USE_LIBTYPE_SHARED") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("winmm") + + self.cpp_info.builddirs.append(self._module_subfolder) + + # 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/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch b/recipes/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch new file mode 100644 index 0000000000000..db2fcdc698196 --- /dev/null +++ b/recipes/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch @@ -0,0 +1,123 @@ +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 57ba74d4..4f019db1 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -28,7 +28,6 @@ if (APPLE AND NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0") + add_definitions(-DGL_SILENCE_DEPRECATION) + MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!") + endif() +-list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) + + include(CheckIncludeFile) + CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H) +@@ -51,6 +50,7 @@ endif() + if(${PLATFORM} MATCHES "Android") + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c) ++ list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/opengl_interop.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c) +@@ -119,19 +119,5 @@ foreach(example_source ${example_sources}) + endif() + endforeach() + +-if (${PLATFORM} MATCHES "Desktop") +- # rlgl_standalone can't be linked with raylib because of duplicate rlgl symbols +- foreach (example_source "others/rlgl_standalone.c") +- # Create the basename for the example +- get_filename_component(example_name ${example_source} NAME) +- string(REPLACE ".c" "" example_name ${example_name}) +- add_executable(${example_name} ${example_source}) +- add_dependencies(${example_name} raylib) +- target_link_libraries(${example_name} ${raylib_LDFLAGS}) +- target_include_directories(${example_name} PRIVATE ${raylib_INCLUDE_DIRS}) +- +- endforeach() +-endif() +- + # Copy all of the resource files to the destination + file(COPY ${example_resources} DESTINATION "resources/") +diff --git a/examples/shapes/shapes_draw_circle_sector.c b/examples/shapes/shapes_draw_circle_sector.c +index 8b1cf6ec..b58f3f35 100644 +--- a/examples/shapes/shapes_draw_circle_sector.c ++++ b/examples/shapes/shapes_draw_circle_sector.c +@@ -57,11 +57,11 @@ int main(void) + + // Draw GUI controls + //------------------------------------------------------------------------------ +- startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20}, "StartAngle", startAngle, 0, 720, true ); +- endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20}, "EndAngle", endAngle, 0, 720, true); ++ startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20}, "StartAngle",NULL, startAngle, 0, 720); ++ endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20}, "EndAngle", NULL, endAngle, 0, 720); + +- outerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20}, "Radius", outerRadius, 0, 200, true); +- segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", segments, 0, 100, true); ++ outerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20}, "Radius", NULL, outerRadius, 0, 200); ++ segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", NULL, segments, 0, 100); + //------------------------------------------------------------------------------ + + DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= 4)? MAROON : DARKGRAY); +diff --git a/examples/shapes/shapes_draw_ring.c b/examples/shapes/shapes_draw_ring.c +index b363dc07..a18fdaf2 100644 +--- a/examples/shapes/shapes_draw_ring.c ++++ b/examples/shapes/shapes_draw_ring.c +@@ -64,13 +64,13 @@ int main(void) + + // Draw GUI controls + //------------------------------------------------------------------------------ +- startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20 }, "StartAngle", startAngle, -450, 450, true); +- endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20 }, "EndAngle", endAngle, -450, 450, true); ++ startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20 }, "StartAngle", NULL, startAngle, -450, 450); ++ endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20 }, "EndAngle", NULL, endAngle, -450, 450); + +- innerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20 }, "InnerRadius", innerRadius, 0, 100, true); +- outerRadius = GuiSliderBar((Rectangle){ 600, 170, 120, 20 }, "OuterRadius", outerRadius, 0, 200, true); ++ innerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20 }, NULL, "InnerRadius", innerRadius, 0, 100); ++ outerRadius = GuiSliderBar((Rectangle){ 600, 170, 120, 20 }, NULL, "OuterRadius", outerRadius, 0, 200); + +- segments = GuiSliderBar((Rectangle){ 600, 240, 120, 20 }, "Segments", segments, 0, 100, true); ++ segments = GuiSliderBar((Rectangle){ 600, 240, 120, 20 }, "Segments", NULL, segments, 0, 100); + + drawRing = GuiCheckBox((Rectangle){ 600, 320, 20, 20 }, "Draw Ring", drawRing); + drawRingLines = GuiCheckBox((Rectangle){ 600, 350, 20, 20 }, "Draw RingLines", drawRingLines); +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2e9861f8..08b149f1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -108,7 +108,7 @@ elseif(${PLATFORM} MATCHES "Android") + add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS) + add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS) + add_definitions(-DANDROID -D__ANDROID_API__=21) +- include_directories(external/android/native_app_glue) ++ include_directories(${ANDROID_NDK}/sources/android/native_app_glue) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate") + + find_library(OPENGL_LIBRARY OpenGL) +diff --git a/src/core.c b/src/core.c +index e6d27e5f..fb7014b0 100644 +--- a/src/core.c ++++ b/src/core.c +@@ -186,7 +186,7 @@ + + // Support retrieving native window handlers + #if defined(_WIN32) +- #define GLFW_EXPOSE_NATIVE_WIN32 ++ + #include // WARNING: It requires customization to avoid windows.h inclusion! + + #if !defined(SUPPORT_BUSY_WAIT_LOOP) +@@ -3346,10 +3346,12 @@ static bool InitGraphicsDevice(int width, int height) + glfwSwapInterval(0); // No V-Sync by default + #endif + +-#if defined(PLATFORM_DESKTOP) ++#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + // Load OpenGL 3.3 extensions + // NOTE: GLFW loader function is passed as parameter + rlLoadExtensions(glfwGetProcAddress); ++#else ++ rlLoadExtensions(eglGetProcAddress); + #endif + + // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) diff --git a/recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch b/recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch new file mode 100644 index 0000000000000..9ef917874947c --- /dev/null +++ b/recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch @@ -0,0 +1,38 @@ +diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake +index c156d6b3..608fe531 100644 +--- a/cmake/LibraryConfigurations.cmake ++++ b/cmake/LibraryConfigurations.cmake +@@ -42,7 +42,7 @@ elseif (${PLATFORM} MATCHES "Android") + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + add_definitions(-DANDROID -D__ANDROID_API__=21) +- include_directories(external/android/native_app_glue) ++ include_directories(${ANDROID_NDK}/sources/android/native_app_glue) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate") + + find_library(OPENGL_LIBRARY OpenGL) +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 6ade9686..4e849ce4 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -66,6 +66,7 @@ endif () + if (${PLATFORM} MATCHES "Android") + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c) ++ list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c) +diff --git a/src/rcore.c b/src/rcore.c +index 3b451552..d7e58c1c 100644 +--- a/src/rcore.c ++++ b/src/rcore.c +@@ -196,7 +196,7 @@ + + // Support retrieving native window handlers + #if defined(_WIN32) +- #define GLFW_EXPOSE_NATIVE_WIN32 ++ + #include "GLFW/glfw3native.h" // WARNING: It requires customization to avoid windows.h inclusion! + + #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) diff --git a/recipes/raylib/all/test_package/CMakeLists.txt b/recipes/raylib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a1f55e19ef5a2 --- /dev/null +++ b/recipes/raylib/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(raylib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} raylib) diff --git a/recipes/raylib/all/test_package/conanfile.py b/recipes/raylib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/raylib/all/test_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/raylib/all/test_package/test_package.c b/recipes/raylib/all/test_package/test_package.c new file mode 100644 index 0000000000000..97c33c55b19d9 --- /dev/null +++ b/recipes/raylib/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include "raylib.h" + +#include + +int main(void) { + Vector3 center = {0, 0, 0}; + float r = 1.0; + if (CheckCollisionSpheres(center, r, center, r)) { + printf("unit sphere collides with itself!\n"); + } + return 0; +} diff --git a/recipes/raylib/config.yml b/recipes/raylib/config.yml new file mode 100644 index 0000000000000..9d0cb9313a0f3 --- /dev/null +++ b/recipes/raylib/config.yml @@ -0,0 +1,5 @@ +versions: + "3.5.0": + folder: "all" + "4.0.0": + folder: "all" diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml new file mode 100644 index 0000000000000..ae373a08facb0 --- /dev/null +++ b/recipes/re2/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "20230301": + url: "https://github.com/google/re2/archive/refs/tags/2023-03-01.tar.gz" + sha256: "7a9a4824958586980926a300b4717202485c4b4115ac031822e29aa4ef207e48" + "20230201": + url: "https://github.com/google/re2/archive/refs/tags/2023-02-01.tar.gz" + sha256: "cbce8b7803e856827201a132862e41af386e7afd9cc6d9a9bc7a4fa4d8ddbdde" + "20221201": + url: "https://github.com/google/re2/archive/refs/tags/2022-12-01.tar.gz" + sha256: "665b65b6668156db2b46dddd33405cd422bd611352c5052ab3dae6a5fbac5506" + "20220601": + url: "https://github.com/google/re2/archive/refs/tags/2022-06-01.tar.gz" + sha256: "f89c61410a072e5cbcf8c27e3a778da7d6fd2f2b5b1445cd4f4508bee946ab0f" + "20220201": + url: "https://github.com/google/re2/archive/refs/tags/2022-02-01.tar.gz" + sha256: "9c1e6acfd0fed71f40b025a7a1dabaf3ee2ebb74d64ced1f9ee1b0b01d22fd27" + "20211101": + url: "https://github.com/google/re2/archive/refs/tags/2021-11-01.tar.gz" + sha256: "8c45f7fba029ab41f2a7e6545058d9eec94eef97ce70df58e92d85cfc08b4669" + "20210901": + url: "https://github.com/google/re2/archive/refs/tags/2021-09-01.tar.gz" + sha256: "42a2e1d56b5de252f5d418dc1cc0848e9e52ca22b056453988b18c6195ec7f8d" + "20210601": + url: "https://github.com/google/re2/archive/refs/tags/2021-06-01.tar.gz" + sha256: "26155e050b10b5969e986dab35654247a3b1b295e0532880b5a9c13c0a700ceb" + "20210401": + url: "https://github.com/google/re2/archive/refs/tags/2021-04-01.tar.gz" + sha256: "358aedf71dbf26506848905f5d4417b7adba5cf44d3bbcf70bf4ef68ccb0871e" + "20210202": + url: "https://github.com/google/re2/archive/2021-02-02.tar.gz" + sha256: "1396ab50c06c1a8885fb68bf49a5ecfd989163015fd96699a180d6414937f33f" + "20201101": + url: "https://github.com/google/re2/archive/2020-11-01.tar.gz" + sha256: "8903cc66c9d34c72e2bc91722288ebc7e3ec37787ecfef44d204b2d6281954d7" diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py new file mode 100644 index 0000000000000..c8ad0901b061a --- /dev/null +++ b/recipes/re2/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class Re2Conan(ConanFile): + name = "re2" + description = "Fast, safe, thread-friendly regular expression library" + topics = ("regex",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/re2" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + 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["RE2_BUILD_TESTING"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "re2") + self.cpp_info.set_property("cmake_target_name", "re2::re2") + self.cpp_info.set_property("pkg_config_name", "re2") + self.cpp_info.libs = ["re2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/re2/all/test_package/CMakeLists.txt b/recipes/re2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dee70b6be9bd8 --- /dev/null +++ b/recipes/re2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(re2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE re2::re2) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/re2/all/test_package/conanfile.py b/recipes/re2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/re2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/re2/all/test_package/test_package.cpp b/recipes/re2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..199c6683fda1a --- /dev/null +++ b/recipes/re2/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include +#include + +int main() { + assert(RE2::FullMatch("hello", "h.*o")); + assert(!RE2::FullMatch("hello", "e")); + return 0; +} diff --git a/recipes/re2/all/test_v1_package/CMakeLists.txt b/recipes/re2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/re2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/re2/all/test_v1_package/conanfile.py b/recipes/re2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/re2/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/re2/config.yml b/recipes/re2/config.yml new file mode 100644 index 0000000000000..ff0398cb71456 --- /dev/null +++ b/recipes/re2/config.yml @@ -0,0 +1,23 @@ +versions: + "20230301": + folder: all + "20230201": + folder: all + "20221201": + folder: all + "20220601": + folder: all + "20220201": + folder: all + "20211101": + folder: all + "20210901": + folder: all + "20210601": + folder: all + "20210401": + folder: all + "20210202": + folder: all + "20201101": + folder: all diff --git a/recipes/re2c/all/conandata.yml b/recipes/re2c/all/conandata.yml new file mode 100644 index 0000000000000..6123ba01ce5a3 --- /dev/null +++ b/recipes/re2c/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "3.0": + url: "https://github.com/skvadrik/re2c/releases/download/3.0/re2c-3.0.tar.xz" + sha256: "b3babbbb1461e13fe22c630a40c43885efcfbbbb585830c6f4c0d791cf82ba0b" + "2.2": + url: "https://github.com/skvadrik/re2c/releases/download/2.2/re2c-2.2.tar.xz" + sha256: "0fc45e4130a8a555d68e230d1795de0216dfe99096b61b28e67c86dfd7d86bda" + "2.1.1": + url: "https://github.com/skvadrik/re2c/releases/download/2.1.1/re2c-2.1.1.tar.xz" + sha256: "036ee264fafd5423141ebd628890775aa9447a4c4068a6307385d7366fe711f8" + "2.0.3": + url: "https://github.com/skvadrik/re2c/releases/download/2.0.3/re2c-2.0.3.tar.xz" + sha256: "b2bc1eb8aaaa21ff2fcd26507b7e6e72c5e3d887e58aa515c2155fb17d744278" + "1.3": + url: "https://github.com/skvadrik/re2c/releases/download/1.3/re2c-1.3.tar.xz" + sha256: "f37f25ff760e90088e7d03d1232002c2c2672646d5844fdf8e0d51a5cd75a503" +patches: + "3.0": + - patch_file: "patches/0001-add-msvc_cl-sh.patch" + base_path: "" + "2.2": + - patch_file: "patches/0001-add-msvc_cl-sh.patch" + base_path: "" + "2.1.1": + - patch_file: "patches/0001-add-msvc_cl-sh.patch" + base_path: "" + "2.0.3": + - patch_file: "patches/0001-add-msvc_cl-sh.patch" + base_path: "" + - patch_file: "patches/2.0.3-0001-add-missing-include.patch" + base_path: "source_subfolder" + "1.3": + - patch_file: "patches/0001-add-msvc_cl-sh.patch" + base_path: "" diff --git a/recipes/re2c/all/conanfile.py b/recipes/re2c/all/conanfile.py new file mode 100644 index 0000000000000..fd56a51318aa2 --- /dev/null +++ b/recipes/re2c/all/conanfile.py @@ -0,0 +1,95 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from contextlib import contextmanager +import os + +required_conan_version = ">=1.33.0" + + +class Re2CConan(ConanFile): + name = "re2c" + description = "re2c is a free and open-source lexer generator for C, C++ and Go." + topics = ("re2c", "lexer", "language", "tokenizer", "flex") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://re2c.org/" + license = "Unlicense" + settings = "os", "arch", "build_type", "compiler" + + _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): + 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): + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def package_id(self): + del self.info.settings.compiler + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + env = { + "CC": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), + "CXX": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), + "LD": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), + "CXXLD": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), + "AR": "lib", + } + with tools.environment_append(env): + yield + else: + yield + + 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 == "Visual Studio": + self._autotools.flags.append("-FS") + self._autotools.cxx_flags.append("-EHsc") + self._autotools.configure(configure_dir=self._source_subfolder) + return self._autotools + + 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(args=["V=1"]) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses", keep_path=False) + self.copy("NO_WARRANTY", src=self._source_subfolder, dst="licenses", keep_path=False) + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + 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/re2c/all/patches/0001-add-msvc_cl-sh.patch b/recipes/re2c/all/patches/0001-add-msvc_cl-sh.patch new file mode 100644 index 0000000000000..c9bc0abc63639 --- /dev/null +++ b/recipes/re2c/all/patches/0001-add-msvc_cl-sh.patch @@ -0,0 +1,94 @@ +new file mode 100755 +--- /dev/null ++++ msvc_cl.sh +@@ -0,0 +1,90 @@ ++#!/bin/sh ++clopts=() ++ldopts=() ++sources=0 ++link=0 ++while test $# -gt 0; do ++ case "$1" in ++ -lm | -pthread | -lpthread | -std=c++98) ++ # ignore ++ ;; ++ -Xlinker) ++ shift ++ ;; ++ -W* | -w* | -pedantic) ++ # ignore warnings ++ ;; ++ -D*) ++ clopts+=("$1") ++ ;; ++ -I*) ++ clopts+=("$1") ++ ;; ++ -l*) ++ ldopts+=("`echo "$1.lib" | sed "s/^-l//"`") ++ ;; ++ -LIBPATH*) ++ ldopts+=("$1") ++ ;; ++ -L*) ++ ldopts+=("`echo "$1" | sed "s/^-L/-LIBPATH:/"`") ++ ;; ++ *.obj | *.o) ++ link=1 ++ ldopts+=("$1") ++ ;; ++ -Wl,*) ++ for linkarg in `echo '$1' | sed -e 's/-Wl,//' -e 's/,/ /'`; do ++ ldopts+=("${linkarg}") ++ done ++ ;; ++ *.lib) ++ ldopts+=("$1") ++ ;; ++ -o) ++ shift ++ case "$1" in ++ *.dll | *.exe) ++ link=1 ++ ldopts+=("-out:$1") ++ ;; ++ *.o | *.obj) ++ link=0 ++ clopts+=("-Fo$1") ++ ;; ++ esac ++ ;; ++ -implib* | -IMPLIB*) ++ ldopts+=("$1") ++ ;; ++ -c | *.c | *.C | *.cxx | *.cpp | *.cc | *.CC) ++ sources=1 ++ clopts+=("$1") ++ ;; ++ *) ++ clopts+=("$1") ++ ;; ++ esac ++ shift ++done ++ ++args="${clopts[@]}" ++if test $link = 1; then ++ if test $sources = 0; then ++ args="${ldopts[@]}" ++cat <<-EOF ++ Creating program/library ++ ** ld options: "$args" ++EOF ++ LINK= exec link -nologo $args ++ else ++ args="$args -link ${ldopts[@]}" ++ fi ++fi ++ ++cat <<-EOF ++ Compiling source ++ ** cl options: "$args" ++EOF ++ ++LINK= exec cl -nologo $args diff --git a/recipes/re2c/all/patches/2.0.3-0001-add-missing-include.patch b/recipes/re2c/all/patches/2.0.3-0001-add-missing-include.patch new file mode 100644 index 0000000000000..bd4ee0f523fb4 --- /dev/null +++ b/recipes/re2c/all/patches/2.0.3-0001-add-missing-include.patch @@ -0,0 +1,11 @@ +--- src/compile.cc ++++ src/compile.cc +@@ -4,7 +4,7 @@ + #include + #include + #include +- ++#include + #include "src/adfa/adfa.h" + #include "src/codegen/code.h" + #include "src/compile.h" diff --git a/recipes/re2c/all/test_package/CMakeLists.txt b/recipes/re2c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9f0917e64ea34 --- /dev/null +++ b/recipes/re2c/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_custom_command(OUTPUT test_package.c + COMMAND re2c -W "${PROJECT_SOURCE_DIR}/syntax.re" -o test_package.c +) + +add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/re2c/all/test_package/conanfile.py b/recipes/re2c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a886f5f0a7632 --- /dev/null +++ b/recipes/re2c/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/re2c/all/test_package/syntax.re b/recipes/re2c/all/test_package/syntax.re new file mode 100644 index 0000000000000..b1b909b54562f --- /dev/null +++ b/recipes/re2c/all/test_package/syntax.re @@ -0,0 +1,31 @@ +#include + +/*!max:re2c*/ +/*!re2c + digit = [0-9]; + number = digit+; +*/ + +static int lex(const char *YYCURSOR) +{ + const char *YYMARKER; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + * { return 1; } + + number { + printf("number\n"); + return 0; + } + + */ +} + +int main() +{ + lex("1024"); + lex(";]"); + return 0; +} diff --git a/recipes/re2c/config.yml b/recipes/re2c/config.yml new file mode 100644 index 0000000000000..ca4059985b6a4 --- /dev/null +++ b/recipes/re2c/config.yml @@ -0,0 +1,11 @@ +versions: + "3.0": + folder: "all" + "2.2": + folder: "all" + "2.1.1": + folder: "all" + "2.0.3": + folder: "all" + "1.3": + folder: "all" diff --git a/recipes/reactiveplusplus/all/conandata.yml b/recipes/reactiveplusplus/all/conandata.yml new file mode 100644 index 0000000000000..b01e397208475 --- /dev/null +++ b/recipes/reactiveplusplus/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.1": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v0.2.1.tar.gz" + sha256: "c41f9a0b727d5bdbc92390b3f075bfa280fd4f6f2aa7db51428fc30023b518d0" + "0.1.2": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v0.1.2.tar.gz" + sha256: "daa16d8258d811bfc6848829ea1afa6f4a72b68ad8978d55ea4e1cf809ae6d52" diff --git a/recipes/reactiveplusplus/all/conanfile.py b/recipes/reactiveplusplus/all/conanfile.py new file mode 100644 index 0000000000000..d8d1eb5567b3d --- /dev/null +++ b/recipes/reactiveplusplus/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 +import os + +required_conan_version = ">=1.50.0" + + +class ReactivePlusPlusConan(ConanFile): + name = "reactiveplusplus" + description = ( + "ReactivePlusPlus is library for building asynchronous event-driven " + "streams of data with help of sequences of primitive operators in the " + "declarative form." + ) + license = "BSL-1.0" + topics = ("reactivex", "asynchronous", "event", "observable", "values-distributed-in-time") + homepage = "https://github.com/victimsnino/ReactivePlusPlus" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16.10", + "msvc": "192", + "gcc": "10", + "clang": "12", + "apple-clang": "14", + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} 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 + + 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, "src", "rpp", "rpp"), + dst=os.path.join(self.package_folder, "include", "rpp")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "RPP") + self.cpp_info.set_property("cmake_target_name", "RPP::rpp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "RPP" + self.cpp_info.names["cmake_find_package_multi"] = "RPP" + self.cpp_info.components["_reactiveplusplus"].names["cmake_find_package"] = "rpp" + self.cpp_info.components["_reactiveplusplus"].names["cmake_find_package_multi"] = "rpp" + self.cpp_info.components["_reactiveplusplus"].set_property("cmake_target_name", "RPP::rpp") + self.cpp_info.components["_reactiveplusplus"].bindirs = [] + self.cpp_info.components["_reactiveplusplus"].libdirs = [] diff --git a/recipes/reactiveplusplus/all/test_package/CMakeLists.txt b/recipes/reactiveplusplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..96e89147f81a9 --- /dev/null +++ b/recipes/reactiveplusplus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(RPP REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE RPP::rpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/reactiveplusplus/all/test_package/conanfile.py b/recipes/reactiveplusplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/reactiveplusplus/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/reactiveplusplus/all/test_package/test_package.cpp b/recipes/reactiveplusplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cbca58fc39109 --- /dev/null +++ b/recipes/reactiveplusplus/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include + +int main() +{ + auto observable = rpp::source::from_callable(&::getchar) + .repeat() + .take_while([](char v) { return v != '0'; }) + .filter(std::not_fn(&::isdigit)) + .map(&::toupper); + return 0; +} diff --git a/recipes/reactiveplusplus/all/test_v1_package/CMakeLists.txt b/recipes/reactiveplusplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/reactiveplusplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/reactiveplusplus/all/test_v1_package/conanfile.py b/recipes/reactiveplusplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/reactiveplusplus/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/reactiveplusplus/config.yml b/recipes/reactiveplusplus/config.yml new file mode 100644 index 0000000000000..4fec465c4ccad --- /dev/null +++ b/recipes/reactiveplusplus/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.1": + folder: all + "0.1.2": + folder: all diff --git a/recipes/read-excel/all/conandata.yml b/recipes/read-excel/all/conandata.yml new file mode 100644 index 0000000000000..e92cf97bbd387 --- /dev/null +++ b/recipes/read-excel/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.2.8": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.8.tar.gz" + sha256: "26859a7262500bfb7703197bb2726ea9bca33455f3102eb3e15e4ddfc97c6a07" + "1.2.7": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.7.tar.gz" + sha256: "9ed9518e796167c1c121bb20c2d395c8c8ae52cf469613914254d55ca517ab34" + "1.2.6": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.6.tar.gz" + sha256: "b3209ecdf16d023c4225a9bcc2d0664c9675fa34b805b4871f161c66e462a794" + "1.2.5": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.5.tar.gz" + sha256: "36f29fe199e16b113b4ee91ec6807ef551d424862217573e5688ef332585358b" + "1.2.4": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.4.tar.gz" + sha256: "82cafcd1a07a62165366ebdc8e082a940725fd37c669ad8f8825576ecc1e9dd2" + "1.2.3": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.3.tar.gz" + sha256: "2b7c65923219d75b106164b17efd7d4e5f4e6d4f98f5e53cb32302e175ee498c" + "1.2.2": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.2.tar.gz" + sha256: "838809d511e041cc4243e8d8113db71a93743b486d455ab3a4487fb9e6a80b7a" + "1.2.1": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.1.tar.gz" + sha256: "b478b2720c212a99d9048abdbee10996a5545a4e9df23114da1acbe14c5c2daf" + "1.2.0": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.0.tar.gz" + sha256: "baa5ba1e5633067ef48b1dba255cf306004c607b4adeb9bb4dbb859918325fd6" + "1.1.6": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.1.6.tar.gz" + sha256: "99e884772f2e9b08bce36e04fd49ea498f7dcf377ffeb2caa1c833aa0f9f3cf0" + "1.1.5": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.1.5.tar.gz" + sha256: "85b826c0a8aea92e086ab95905802145f6b9312a7446ecdb2b8a96f4327d24de" diff --git a/recipes/read-excel/all/conanfile.py b/recipes/read-excel/all/conanfile.py new file mode 100644 index 0000000000000..11abb986cdd31 --- /dev/null +++ b/recipes/read-excel/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class ReadExcelConan(ConanFile): + name = "read-excel" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/igormironchik/read-excel" + license = "MIT" + description = "This is very simple implementation of the Excel 97-2003 format (BIFF8) written in C++. Supported reading only." + topics = ("read", "excel", "biff8") + settings = "compiler" + no_copy_source = True + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "3.5", + "apple-clang": "10" + } + + 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "read-excel"), dst=os.path.join(self.package_folder, "include", "read-excel")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "read-excel") + self.cpp_info.set_property("cmake_target_name", "read-excel::read-excel") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/read-excel/all/test_package/CMakeLists.txt b/recipes/read-excel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a5298e30eba45 --- /dev/null +++ b/recipes/read-excel/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(read-excel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE read-excel::read-excel) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/read-excel/all/test_package/conanfile.py b/recipes/read-excel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bddb5e263d5d6 --- /dev/null +++ b/recipes/read-excel/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def 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") + xls_path = os.path.join(self.source_folder, "sample.xls") + self.run("{} \"{}\"".format(bin_path, xls_path), env="conanrun") diff --git a/recipes/read-excel/all/test_package/sample.xls b/recipes/read-excel/all/test_package/sample.xls new file mode 100644 index 0000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aWY7*~G* z(3IZ*jIYxGW9;hyb?DaQe!OAE%+yI@{A@3C4{aKX#f?BX9*g!5hj;x`#x7r|%(=7x zen8sCI9;>M0?5zgtLMv4|M`)|vhGbC-7@@nwma5NnF`sTV{u&k_~NnVg`OivVSnGX zH+sQy=kRub$BT%AAUpuu(q@JDsGcFq0@L~auk4?52IMm|_lk0OWRKzNLtJ(t;^ub< zIPMgw3aica=Dy1wPsMbx#yZ(FSr5G<*vp$ShNp^YIzfi|IUnjKO{gsJuo(PJR-FdD z5eXHLoSe-&$<%D7leZAL4?>IpNN(9CdolkJy!r6k&nA2Y8dPgSP6BU1F>ne~gQcJ6 yU9t1OAF{Xw6}hDs8v4~3Lh1|D)W*~KFXrC}%?VTew4_tDzy15mbPV8j^#2WKOIcU| literal 0 HcmV?d00001 diff --git a/recipes/read-excel/all/test_package/test_package.cpp b/recipes/read-excel/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..847cfd34b125e --- /dev/null +++ b/recipes/read-excel/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#include +#include +#include + +#include + +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; + } + catch(const Excel::Exception &) + { + return 1; + } + catch(const CompoundFile::Exception &) + { + return 1; + } + catch(const std::exception &) + { + return 1; + } +} diff --git a/recipes/read-excel/all/test_v1_package/CMakeLists.txt b/recipes/read-excel/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8af52c8273805 --- /dev/null +++ b/recipes/read-excel/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,6 @@ +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/read-excel/all/test_v1_package/conanfile.py b/recipes/read-excel/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3524db189d6f0 --- /dev/null +++ b/recipes/read-excel/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xls_path = os.path.join(self.source_folder, os.pardir, "test_package", "sample.xls") + self.run("{} \"{}\"".format(bin_path, xls_path), run_environment=True) diff --git a/recipes/read-excel/config.yml b/recipes/read-excel/config.yml new file mode 100644 index 0000000000000..e85e4f8b47c32 --- /dev/null +++ b/recipes/read-excel/config.yml @@ -0,0 +1,23 @@ +versions: + "1.2.8": + folder: "all" + "1.2.7": + folder: "all" + "1.2.6": + folder: "all" + "1.2.5": + folder: "all" + "1.2.4": + folder: "all" + "1.2.3": + folder: "all" + "1.2.2": + folder: "all" + "1.2.1": + folder: "all" + "1.2.0": + folder: "all" + "1.1.6": + folder: "all" + "1.1.5": + folder: "all" diff --git a/recipes/readerwriterqueue/all/conandata.yml b/recipes/readerwriterqueue/all/conandata.yml new file mode 100644 index 0000000000000..964a3fca0de25 --- /dev/null +++ b/recipes/readerwriterqueue/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.6": + url: "https://github.com/cameron314/readerwriterqueue/archive/v1.0.6.tar.gz" + sha256: "fc68f55bbd49a8b646462695e1777fb8f2c0b4f342d5e6574135211312ba56c1" + "1.0.5": + url: "https://github.com/cameron314/readerwriterqueue/archive/v1.0.5.tar.gz" + sha256: "7c88aac9924885d733355c72e3b3d2de30665a64e10bf079af85c95f8419ecb9" + "1.0.3": + url: https://github.com/cameron314/readerwriterqueue/archive/v1.0.3.zip + sha256: a7dd85427ea50f76978f488d1de13b249f24385303deb2c480c225fec084a1b5 diff --git a/recipes/readerwriterqueue/all/conanfile.py b/recipes/readerwriterqueue/all/conanfile.py new file mode 100644 index 0000000000000..8dfe0c0be7d93 --- /dev/null +++ b/recipes/readerwriterqueue/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class ReaderWriterQueue(ConanFile): + name = "readerwriterqueue" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cameron314/readerwriterqueue" + description = "A fast single-producer, single-consumer lock-free queue for C++" + topics = ("cpp11", "cpp14", "cpp17", "queue", "lock-free") + license = "BSD-2-Clause" + no_copy_source = True + settings = "os" + + 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): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "readerwriterqueue"), + excludes=["benchmarks", "tests"]) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/readerwriterqueue/all/test_package/CMakeLists.txt b/recipes/readerwriterqueue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eceb6e660004e --- /dev/null +++ b/recipes/readerwriterqueue/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(readerwriterqueue REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE readerwriterqueue::readerwriterqueue) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/readerwriterqueue/all/test_package/conanfile.py b/recipes/readerwriterqueue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a348a04e88cb6 --- /dev/null +++ b/recipes/readerwriterqueue/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +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" + + 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/readerwriterqueue/all/test_package/test_package.cpp b/recipes/readerwriterqueue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..45e5b1d4a5c89 --- /dev/null +++ b/recipes/readerwriterqueue/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + moodycamel::ReaderWriterQueue q; + q.enqueue(42); + return 0; +} diff --git a/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt b/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/readerwriterqueue/all/test_v1_package/conanfile.py b/recipes/readerwriterqueue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b340bdd7fabce --- /dev/null +++ b/recipes/readerwriterqueue/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, CMake, tools +import os + +class ConcurrentqueueTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/readerwriterqueue/config.yml b/recipes/readerwriterqueue/config.yml new file mode 100644 index 0000000000000..9258992d26fea --- /dev/null +++ b/recipes/readerwriterqueue/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.6": + folder: all + "1.0.5": + folder: all + "1.0.3": + folder: all diff --git a/recipes/readline/all/conandata.yml b/recipes/readline/all/conandata.yml new file mode 100644 index 0000000000000..08a67ab543d70 --- /dev/null +++ b/recipes/readline/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "8.0": + url: "https://ftp.gnu.org/pub/gnu/readline/readline-8.0.tar.gz" + sha256: "e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" + "8.1.2": + url: "https://ftp.gnu.org/pub/gnu/readline/readline-8.1.2.tar.gz" + sha256: "7589a2381a8419e68654a47623ce7dfcb756815c8fee726b98f90bf668af7bc6" diff --git a/recipes/readline/all/conanfile.py b/recipes/readline/all/conanfile.py new file mode 100644 index 0000000000000..607d6921916f3 --- /dev/null +++ b/recipes/readline/all/conanfile.py @@ -0,0 +1,97 @@ +import os +from conan import ConanFile +from conan.tools.files import get, replace_in_file, rmdir, copy +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.env import VirtualRunEnv +from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, Autotools +from conan.errors import ConanInvalidConfiguration + +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" + topics = ("cli", "terminal", "command") + license = "GPL-3.0-only" + homepage = "https://tiswww.case.edu/php/chet/readline/rltop.html" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_library": ["termcap", "curses"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_library": "termcap", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def requirements(self): + if self.options.with_library == "termcap": + self.requires("termcap/1.3.1") + elif self.options.with_library == "curses": + self.requires("ncurses/6.2") + + 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 validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("readline does not support Visual Studio") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + # Expose LD_LIBRARY_PATH when there are shared dependencies, + # as configure tries to run a test executable (when not cross-building) + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--with-curses={}".format("yes" if self.options.with_library == "curses" else "no"), + ]) + if cross_building(self): + tc.configure_args.append("bash_cv_wcwidth_broken=yes") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "shlib", "Makefile.in"), "-o $@ $(SHARED_OBJ) $(SHLIB_LIBS)", + "-o $@ $(SHARED_OBJ) $(SHLIB_LIBS) -ltermcap") + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), "@TERMCAP_LIB@", "-ltermcap") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["history", "readline"] diff --git a/recipes/readline/all/test_package/CMakeLists.txt b/recipes/readline/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0ba8423464ca0 --- /dev/null +++ b/recipes/readline/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(readline CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} readline::readline) diff --git a/recipes/readline/all/test_package/conanfile.py b/recipes/readline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0170011d8e2d2 --- /dev/null +++ b/recipes/readline/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 TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/readline/all/test_package/test_package.c b/recipes/readline/all/test_package/test_package.c new file mode 100644 index 0000000000000..86f150ad62764 --- /dev/null +++ b/recipes/readline/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include + +#include "readline/readline.h" + +int main(int argc, char *argv[]) { + + if(!ISALPHA('a') || !ISDIGIT('1')) { + return EXIT_FAILURE; + } + rl_message("conan-center-index"); + + return EXIT_SUCCESS; +} diff --git a/recipes/readline/all/test_v1_package/CMakeLists.txt b/recipes/readline/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/readline/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/readline/all/test_v1_package/conanfile.py b/recipes/readline/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/readline/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/readline/config.yml b/recipes/readline/config.yml new file mode 100644 index 0000000000000..aafdae05d7dc8 --- /dev/null +++ b/recipes/readline/config.yml @@ -0,0 +1,5 @@ +versions: + "8.0": + folder: "all" + "8.1.2": + folder: "all" diff --git a/recipes/readosm/all/conandata.yml b/recipes/readosm/all/conandata.yml new file mode 100644 index 0000000000000..c2fb67bfed2fc --- /dev/null +++ b/recipes/readosm/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.1.0a": + url: "https://www.gaia-gis.it/gaia-sins/readosm-sources/readosm-1.1.0a.tar.gz" + sha256: "db7c051d256cec7ecd4c3775ab9bc820da5a4bf72ffd4e9f40b911d79770f145" +patches: + "1.1.0a": + - patch_file: "patches/0001-fix-nmake.patch" + patch_description: "Remove hardcoded paths in NMake" + patch_type: "conan" diff --git a/recipes/readosm/all/conanfile.py b/recipes/readosm/all/conanfile.py new file mode 100644 index 0000000000000..b9c04661624b4 --- /dev/null +++ b/recipes/readosm/all/conanfile.py @@ -0,0 +1,135 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeDeps, NMakeToolchain +import os + +required_conan_version = ">=1.58.0" + + +class ReadosmConan(ConanFile): + name = "readosm" + description = ( + "ReadOSM is an open source library to extract valid data from within " + "an Open Street Map input file." + ) + license = ("MPL-1.1", "GPL-2.0-or-later", "LGPL-2.1-or-later") + topics = ("osm", "open-street-map", "xml", "protobuf") + homepage = "https://www.gaia-gis.it/fossil/readosm" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("expat/2.5.0") + self.requires("zlib/1.2.13") + + def build_requirements(self): + 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) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + if self.options.shared: + tc.extra_defines.append("DLL_EXPORT") + tc.generate() + deps = NMakeDeps(self) + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-gcov") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # fix MinGW + zlib_lib = self.dependencies["zlib"].cpp_info.aggregated_components().libs[0] + replace_in_file( + self, os.path.join(self.source_folder, "configure.ac"), + "AC_CHECK_LIB(z,", f"AC_CHECK_LIB({zlib_lib},", + ) + # Disable tests & examples + replace_in_file( + self, os.path.join(self.source_folder, "Makefile.am"), + "SUBDIRS = headers src tests examples", "SUBDIRS = headers src", + ) + + def build(self): + self._patch_sources() + if is_msvc(self): + with chdir(self, self.source_folder): + target = "readosm_i.lib" if self.options.shared else "readosm.lib" + self.run(f"nmake -f makefile.vc {target}") + else: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "readosm.h", src=os.path.join(self.source_folder, "headers"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + else: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "readosm") + suffix = "_i" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"readosm{suffix}"] diff --git a/recipes/readosm/all/patches/0001-fix-nmake.patch b/recipes/readosm/all/patches/0001-fix-nmake.patch new file mode 100644 index 0000000000000..43d9d7d1957a1 --- /dev/null +++ b/recipes/readosm/all/patches/0001-fix-nmake.patch @@ -0,0 +1,27 @@ +--- a/makefile.vc ++++ b/makefile.vc +@@ -2,13 +2,12 @@ + # + # NMAKE Makefile to build libreadosm on Windows + # +-!INCLUDE nmake.opt + + LIBOBJ = src\readosm.obj src\osmxml.obj \ + src\protobuf.obj src\osm_objects.obj + READOSM_DLL = readosm$(VERSION).dll + +-CFLAGS = /nologo -I. -Iheaders -IC:\OSGeo4W\include $(OPTFLAGS) ++CFLAGS = /nologo -I. -Iheaders $(CFLAGS) $(OPTFLAGS) + + default: all + +@@ -22,8 +21,7 @@ $(READOSM_DLL): readosm_i.lib + + readosm_i.lib: $(LIBOBJ) + link /dll /out:$(READOSM_DLL) \ +- /implib:readosm_i.lib $(LIBOBJ) \ +- C:\OSGeo4w\lib\libexpat.lib C:\OSGeo4w\lib\zlib.lib ++ /implib:readosm_i.lib $(LIBOBJ) + if exist $(READOSM_DLL).manifest mt -manifest \ + $(READOSM_DLL).manifest -outputresource:$(READOSM_DLL);2 + diff --git a/recipes/readosm/all/test_package/CMakeLists.txt b/recipes/readosm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ea28640523dd --- /dev/null +++ b/recipes/readosm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(readosm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE readosm::readosm) diff --git a/recipes/readosm/all/test_package/conanfile.py b/recipes/readosm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/readosm/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/readosm/all/test_package/test_package.c b/recipes/readosm/all/test_package/test_package.c new file mode 100644 index 0000000000000..4671ccc588c2c --- /dev/null +++ b/recipes/readosm/all/test_package/test_package.c @@ -0,0 +1,10 @@ +# include + +#include + +int main(void) { + printf("readosm %s built with:\n", readosm_version()); + printf("-- expat %s\n", readosm_expat_version()); + printf("-- zlib %s\n", readosm_zlib_version()); + return 0; +} diff --git a/recipes/readosm/all/test_v1_package/CMakeLists.txt b/recipes/readosm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/readosm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/readosm/all/test_v1_package/conanfile.py b/recipes/readosm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/readosm/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/readosm/config.yml b/recipes/readosm/config.yml new file mode 100644 index 0000000000000..5be5c9fad774a --- /dev/null +++ b/recipes/readosm/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0a": + folder: all diff --git a/recipes/recastnavigation/all/conandata.yml b/recipes/recastnavigation/all/conandata.yml new file mode 100644 index 0000000000000..eeea285038775 --- /dev/null +++ b/recipes/recastnavigation/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20200511": + url: "https://github.com/recastnavigation/recastnavigation/archive/df27e4eb1a4ade9912f8b7d75c25769a3193dbd0.tar.gz" + sha256: "299fdcfe14749a26041f54b4a018b8c4918e0dd0283f77823b96247bc97c9400" +patches: + "cci.20200511": + - patch_file: "patches/001_fix_shared_option.patch" diff --git a/recipes/recastnavigation/all/conanfile.py b/recipes/recastnavigation/all/conanfile.py new file mode 100644 index 0000000000000..cc3eb12118665 --- /dev/null +++ b/recipes/recastnavigation/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.52.0" + + +class RecastNavigationConan(ConanFile): + name = "recastnavigation" + homepage = "https://github.com/recastnavigation/recastnavigation" + description = " Navigation-mesh Toolset for Games" + topics = ("navmesh", "recast", "navigation", "crowd") + url = "https://github.com/conan-io/conan-center-index" + license = "Zlib" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + 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["RECASTNAVIGATION_DEMO"] = False + tc.variables["RECASTNAVIGATION_TESTS"] = False + tc.variables["RECASTNAVIGATION_EXAMPLES"] = False + tc.generate() + + 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.set_property("cmake_file_name", "recastnavigation") + self.cpp_info.set_property("pkg_config_name", "recastnavigation") + + self.cpp_info.components["Recast"].set_property("cmake_target_name", "RecastNavigation::Recast") + self.cpp_info.components["Recast"].libs = ["Recast"] + + self.cpp_info.components["Detour"].set_property("cmake_target_name", "RecastNavigation::Detour") + self.cpp_info.components["Detour"].libs = ["Detour"] + + self.cpp_info.components["DetourCrowd"].set_property("cmake_target_name", "RecastNavigation::DetourCrowd") + self.cpp_info.components["DetourCrowd"].libs = ["DetourCrowd"] + self.cpp_info.components["DetourCrowd"].requires = ["Detour"] + + self.cpp_info.components["DetourTileCache"].set_property("cmake_target_name", "RecastNavigation::DetourTileCache") + self.cpp_info.components["DetourTileCache"].libs = ["DetourTileCache"] + self.cpp_info.components["DetourTileCache"].requires = ["Detour"] + + self.cpp_info.components["DebugUtils"].set_property("cmake_target_name", "RecastNavigation::DebugUtils") + self.cpp_info.components["DebugUtils"].libs = ["DebugUtils"] + self.cpp_info.components["DebugUtils"].requires = ["Recast", "Detour", "DetourTileCache"] + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "recastnavigation" + self.cpp_info.filenames["cmake_find_package_multi"] = "recastnavigation" + self.cpp_info.names["cmake_find_package"] = "RecastNavigation" + self.cpp_info.names["cmake_find_package_multi"] = "RecastNavigation" + self.cpp_info.components["Recast"].names["cmake_find_package"] = "Recast" + self.cpp_info.components["Recast"].names["cmake_find_package_multi"] = "Recast" + self.cpp_info.components["Detour"].names["cmake_find_package"] = "Detour" + self.cpp_info.components["Detour"].names["cmake_find_package_multi"] = "Detour" + self.cpp_info.components["DetourCrowd"].names["cmake_find_package"] = "DetourCrowd" + self.cpp_info.components["DetourCrowd"].names["cmake_find_package_multi"] = "DetourCrowd" + self.cpp_info.components["DetourTileCache"].names["cmake_find_package"] = "DetourTileCache" + self.cpp_info.components["DetourTileCache"].names["cmake_find_package_multi"] = "DetourTileCache" + self.cpp_info.components["DebugUtils"].names["cmake_find_package"] = "DebugUtils" + self.cpp_info.components["DebugUtils"].names["cmake_find_package_multi"] = "DebugUtils" diff --git a/recipes/recastnavigation/all/patches/001_fix_shared_option.patch b/recipes/recastnavigation/all/patches/001_fix_shared_option.patch new file mode 100644 index 0000000000000..bacfaff6244ab --- /dev/null +++ b/recipes/recastnavigation/all/patches/001_fix_shared_option.patch @@ -0,0 +1,129 @@ +--- CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 ++++ CMakeLists.txt 2020-08-07 12:39:31.306787200 -0400 +@@ -9,7 +9,10 @@ + option(RECASTNAVIGATION_DEMO "Build demo" ON) + option(RECASTNAVIGATION_TESTS "Build tests" ON) + option(RECASTNAVIGATION_EXAMPLES "Build examples" ON) +-option(RECASTNAVIGATION_STATIC "Build static libraries" ON) ++ ++if(MSVC AND BUILD_SHARED_LIBS) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ++endif() + + add_subdirectory(DebugUtils) + add_subdirectory(Detour) +@@ -25,3 +28,4 @@ + enable_testing() + add_subdirectory(Tests) + endif () ++ +--- DebugUtils/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 ++++ DebugUtils/CMakeLists.txt 2020-08-07 12:40:03.921473100 -0400 +@@ -1,10 +1,6 @@ + file(GLOB SOURCES Source/*.cpp) + +-if (RECASTNAVIGATION_STATIC) +- add_library(DebugUtils STATIC ${SOURCES}) +-else() +- add_library(DebugUtils SHARED ${SOURCES}) +-endif() ++add_library(DebugUtils ${SOURCES}) + + add_library(RecastNavigation::DebugUtils ALIAS DebugUtils) + +@@ -26,6 +22,7 @@ + ) + + install(TARGETS DebugUtils ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + COMPONENT library +--- Detour/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 ++++ Detour/CMakeLists.txt 2020-08-07 12:40:36.783319300 -0400 +@@ -1,10 +1,6 @@ + file(GLOB SOURCES Source/*.cpp) + +-if(RECASTNAVIGATION_STATIC) +- add_library(Detour STATIC ${SOURCES}) +-else() +- add_library(Detour SHARED ${SOURCES}) +-endif() ++add_library(Detour ${SOURCES}) + + add_library(RecastNavigation::Detour ALIAS Detour) + +@@ -20,6 +16,7 @@ + ) + + install(TARGETS Detour ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + COMPONENT library +--- DetourCrowd/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 ++++ DetourCrowd/CMakeLists.txt 2020-08-07 12:41:02.664066800 -0400 +@@ -1,10 +1,6 @@ + file(GLOB SOURCES Source/*.cpp) + +-if (RECASTNAVIGATION_STATIC) +- add_library(DetourCrowd STATIC ${SOURCES}) +-else () +- add_library(DetourCrowd SHARED ${SOURCES}) +-endif () ++add_library(DetourCrowd ${SOURCES}) + + add_library(RecastNavigation::DetourCrowd ALIAS DetourCrowd) + +@@ -24,6 +20,7 @@ + ) + + install(TARGETS DetourCrowd ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + COMPONENT library +--- DetourTileCache/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 ++++ DetourTileCache/CMakeLists.txt 2020-08-07 12:41:30.253060000 -0400 +@@ -1,10 +1,6 @@ + file(GLOB SOURCES Source/*.cpp) + +-if (RECASTNAVIGATION_STATIC) +- add_library(DetourTileCache STATIC ${SOURCES}) +-else () +- add_library(DetourTileCache SHARED ${SOURCES}) +-endif () ++add_library(DetourTileCache ${SOURCES}) + + add_library(RecastNavigation::DetourTileCache ALIAS DetourTileCache) + +@@ -25,6 +21,7 @@ + + + install(TARGETS DetourTileCache ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + COMPONENT library +--- Recast/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 ++++ Recast/CMakeLists.txt 2020-08-07 12:41:53.370875500 -0400 +@@ -1,10 +1,6 @@ + file(GLOB SOURCES Source/*.cpp) + +-if (RECASTNAVIGATION_STATIC) +- add_library(Recast STATIC ${SOURCES}) +-else () +- add_library(Recast SHARED ${SOURCES}) +-endif () ++add_library(Recast ${SOURCES}) + + add_library(RecastNavigation::Recast ALIAS Recast) + +@@ -20,6 +16,7 @@ + ) + + install(TARGETS Recast ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + COMPONENT library diff --git a/recipes/recastnavigation/all/test_package/CMakeLists.txt b/recipes/recastnavigation/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3ac85f3e748b --- /dev/null +++ b/recipes/recastnavigation/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(recastnavigation REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE RecastNavigation::Recast) diff --git a/recipes/recastnavigation/all/test_package/conanfile.py b/recipes/recastnavigation/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/recastnavigation/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/recastnavigation/all/test_package/test_package.cpp b/recipes/recastnavigation/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d2e829330dc17 --- /dev/null +++ b/recipes/recastnavigation/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "Recast.h" + +int main() { + rcSqrt(2); + return 0; +} diff --git a/recipes/recastnavigation/all/test_v1_package/CMakeLists.txt b/recipes/recastnavigation/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/recastnavigation/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/recastnavigation/all/test_v1_package/conanfile.py b/recipes/recastnavigation/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/recastnavigation/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/recastnavigation/config.yml b/recipes/recastnavigation/config.yml new file mode 100644 index 0000000000000..1a308ccfdedcc --- /dev/null +++ b/recipes/recastnavigation/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200511": + folder: "all" diff --git a/recipes/reckless/all/conandata.yml b/recipes/reckless/all/conandata.yml new file mode 100644 index 0000000000000..665e1d59c75b6 --- /dev/null +++ b/recipes/reckless/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.0.3": + url: "https://github.com/mattiasflodin/reckless/archive/refs/tags/v3.0.3.tar.gz" + sha256: "522656ded4aa72d2c465e48d43b9378c66108339fe3be4324ea0e601bf0537f9" +patches: + "3.0.3": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/reckless/all/conanfile.py b/recipes/reckless/all/conanfile.py new file mode 100644 index 0000000000000..a52137d87d9c7 --- /dev/null +++ b/recipes/reckless/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + + +class RecklessConan(ConanFile): + name = "reckless" + description = "Reckless is an extremely low-latency, high-throughput logging library." + license = "MIT" + topics = ("logging") + homepage = "https://github.com/mattiasflodin/reckless" + 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, + } + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.info.settings.os not in ["Windows", "Linux"]: + raise ConanInvalidConfiguration(f"{self.ref} only supports Windows and Linux") + if self.info.settings.os == "Windows" and not is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} only supports Visual Studio on Windows") + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + if self.info.settings.compiler == "clang" and self.info.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang with libc++") + + 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["RECKLESS_BUILD_EXAMPLES"] = False + tc.generate() + + 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 = ["reckless"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("synchronization") diff --git a/recipes/reckless/all/patches/0001-fix-cmake.patch b/recipes/reckless/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..62d31f5e0c2cd --- /dev/null +++ b/recipes/reckless/all/patches/0001-fix-cmake.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,8 +1,5 @@ +-if(NOT MSVC) +- set(CMAKE_CXX_COMPILER_NAMES g++ clang++ icpc c++ cxx) +-endif() ++cmake_minimum_required(VERSION 3.8) + project(reckless LANGUAGES CXX) +-CMAKE_MINIMUM_REQUIRED(VERSION 3.5) + + ################################################################################ + # Options +@@ -13,12 +10,6 @@ option(RECKLESS_BUILD_EXAMPLES "Build the examples" OFF) + ################################################################################ + # Add Flags + ################################################################################ +-set(CMAKE_CXX_STANDARD 11) +-if(MSVC) +- add_compile_options(/W4 /O3) +-else() +- add_compile_options(-Wall -Wextra -O3 -g) +-endif() + + ################################################################################ + # Build Libraries +@@ -52,7 +43,21 @@ else() + ) + endif() + +-add_library(reckless STATIC ${SRC_LIST}) ++find_package(Threads REQUIRED) ++add_library(reckless ${SRC_LIST}) ++target_link_libraries(reckless PUBLIC Threads::Threads) ++if(WIN32) ++ target_link_libraries(reckless PRIVATE synchronization) ++endif() ++target_compile_features(reckless PUBLIC cxx_std_11) ++ ++include(GNUInstallDirs) ++install(TARGETS reckless ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++install(DIRECTORY reckless/include/reckless DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + ################################################################################ + # Build Examples diff --git a/recipes/reckless/all/test_package/CMakeLists.txt b/recipes/reckless/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7923780072c36 --- /dev/null +++ b/recipes/reckless/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(reckless REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE reckless::reckless) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/reckless/all/test_package/conanfile.py b/recipes/reckless/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/reckless/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/reckless/all/test_package/test_package.cpp b/recipes/reckless/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d25a29549f9f3 --- /dev/null +++ b/recipes/reckless/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include +#include + +#include + +using log_t = reckless::severity_log< + reckless::indent<4>, + ' ', + reckless::severity_field, + reckless::timestamp_field + >; + +reckless::file_writer writer("log.txt"); +log_t g_log(&writer); + +int main() +{ + std::string s("Hello World!"); + + g_log.debug("Pointer: %p", s.c_str()); + g_log.info("Info line: %s", s); + + for (int i = 0; i != 4; ++i) { + reckless::scoped_indent indent; + g_log.warn("Warning: %d", i); + } + + g_log.error("Error: %f", 3.14); + + return 0; +} diff --git a/recipes/reckless/all/test_v1_package/CMakeLists.txt b/recipes/reckless/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/reckless/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/reckless/all/test_v1_package/conanfile.py b/recipes/reckless/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/reckless/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/reckless/config.yml b/recipes/reckless/config.yml new file mode 100644 index 0000000000000..9542a01cf889e --- /dev/null +++ b/recipes/reckless/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.3": + folder: all diff --git a/recipes/rectanglebinpack/all/CMakeLists.txt b/recipes/rectanglebinpack/all/CMakeLists.txt new file mode 100644 index 0000000000000..eab353d687736 --- /dev/null +++ b/recipes/rectanglebinpack/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory("source_subfolder") diff --git a/recipes/rectanglebinpack/all/conandata.yml b/recipes/rectanglebinpack/all/conandata.yml new file mode 100644 index 0000000000000..076654555cbc6 --- /dev/null +++ b/recipes/rectanglebinpack/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20210901": + - url: "https://github.com/juj/RectangleBinPack/archive/a40fcaf3871da57b0f6a080655b3387374840877.zip" + sha256: "88cec105ca8d90d09e9e81f9862caa0cc1cdb851560fb701555eb58b29515748" + - url: "https://unlicense.org/UNLICENSE" + sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" +patches: + "cci.20210901": + - patch_file: "patches/0001_fix_win32_build.patch" + base_path: "source_subfolder" diff --git a/recipes/rectanglebinpack/all/conanfile.py b/recipes/rectanglebinpack/all/conanfile.py new file mode 100644 index 0000000000000..c7332f9531164 --- /dev/null +++ b/recipes/rectanglebinpack/all/conanfile.py @@ -0,0 +1,78 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class RectangleBinPackConan(ConanFile): + name = "rectanglebinpack" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/juj/RectangleBinPack" + description = "The code can be used to solve the problem of packing a set of 2D rectangles into a larger bin." + topics = ("rectangle", "packing", "bin") + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version][0], + strip_root=True, destination=self._source_subfolder) + tools.download(filename="LICENSE", **self.conan_data["sources"][self.version][1]) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("LICENSE", dst="licenses") + self.copy("*.h", dst=os.path.join("include", self.name), src=self._source_subfolder, excludes="old/**") + self.copy("*.dll", dst="bin", keep_path=False) + self.copy("*.lib", dst="lib", keep_path=False) + self.copy("*.so", dst="lib", keep_path=False) + self.copy("*.dylib", dst="lib", keep_path=False) + self.copy("*.a", dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["RectangleBinPack"] + self.cpp_info.names["cmake_find_package"] = "RectangleBinPack" + self.cpp_info.names["cmake_find_package_multi"] = "RectangleBinPack" diff --git a/recipes/rectanglebinpack/all/patches/0001_fix_win32_build.patch b/recipes/rectanglebinpack/all/patches/0001_fix_win32_build.patch new file mode 100644 index 0000000000000..bb5cb0dbc7280 --- /dev/null +++ b/recipes/rectanglebinpack/all/patches/0001_fix_win32_build.patch @@ -0,0 +1,11 @@ +--- a/test/MaxRectsBinPackTest.cpp ++++ b/test/MaxRectsBinPackTest.cpp +@@ -24,8 +24,6 @@ + #if defined(WIN32) + LARGE_INTEGER ddwTimer; + BOOL success = QueryPerformanceCounter(&ddwTimer); +- assume(success != 0); +- MARK_UNUSED(success); + return ddwTimer.QuadPart; + #elif defined(__APPLE__) + return mach_absolute_time(); diff --git a/recipes/rectanglebinpack/all/test_package/CMakeLists.txt b/recipes/rectanglebinpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2d0f2eeb0d746 --- /dev/null +++ b/recipes/rectanglebinpack/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rectanglebinpack/all/test_package/conanfile.py b/recipes/rectanglebinpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..16ec9f68ef974 --- /dev/null +++ b/recipes/rectanglebinpack/all/test_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" + + 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/rectanglebinpack/all/test_package/test_package.cpp b/recipes/rectanglebinpack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5c67148547b0 --- /dev/null +++ b/recipes/rectanglebinpack/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +/* + * Original source code: + * https://github.com/juj/RectangleBinPack/blob/29eec60fe2c9aa0df855dddabd8d4d17023b95f3/test/MaxRectsBinPackTest.cpp + */ + +#include +#include +#include +#include + +using namespace rbp; + +bool AreDisjoint(const Rect &a, const Rect &b) +{ + return a.x >= b.x + b.width || a.x + a.width <= b.x || + a.y >= b.y + b.height || a.y + a.height <= b.y; +} + +bool AllRectsDisjoint(std::vector &packed) +{ + for(size_t i = 0; i < packed.size(); ++i) + for(size_t j = i+1; j < packed.size(); ++j) + { + if (!AreDisjoint(packed[i], packed[j])) + return false; + } + return true; +} + +int main() +{ + MaxRectsBinPack pack(256, 256, true); + + std::vector packed; + srand(12412); + for(int i = 1; i < 128; ++i) + { + int a = (rand() % 128) + 1; + int b = (rand() % 128) + 1; + Rect r = pack.Insert(a, b, MaxRectsBinPack::RectBestShortSideFit); + if (!r.width) + break; + packed.push_back(r); + } + printf("Packed %d rectangles. All rects disjoint: %s. Occupancy: %f\n", + (int)packed.size(), AllRectsDisjoint(packed) ? "yes" : "NO!", pack.Occupancy()); +} diff --git a/recipes/rectanglebinpack/config.yml b/recipes/rectanglebinpack/config.yml new file mode 100644 index 0000000000000..610b8f5b3b81f --- /dev/null +++ b/recipes/rectanglebinpack/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210901": + folder: "all" diff --git a/recipes/rectpack2d/all/conandata.yml b/recipes/rectpack2d/all/conandata.yml new file mode 100644 index 0000000000000..5c892d199c52e --- /dev/null +++ b/recipes/rectpack2d/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210710": + url: "https://github.com/TeamHypersomnia/rectpack2D/archive/bb2118ffaf06f4f39c3e7e0f8bd7c1a07a41a8f0.zip" + sha256: "76d2197233c8e59f1b3d61104f2c578c877aa9f6e3f4a23932a6d3e004382ca2" diff --git a/recipes/rectpack2d/all/conanfile.py b/recipes/rectpack2d/all/conanfile.py new file mode 100644 index 0000000000000..f4e81a4a0bdcb --- /dev/null +++ b/recipes/rectpack2d/all/conanfile.py @@ -0,0 +1,60 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class Rectpack2dConan(ConanFile): + name = "rectpack2d" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TeamHypersomnia/rectpack2D" + description = "C++17 rectangle packing library" + topics = ("header-only", "rectpack2d", "graphical", "cpp17") + license = "MIT" + no_copy_source = True + settings = "compiler" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15.7", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + def configure(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)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + self.copy(pattern="*.h", dst=os.path.join("include", "rectpack2d"), + src=os.path.join(self._source_subfolder, "src")) + + def package_id(self): + self.info.header_only() + diff --git a/recipes/rectpack2d/all/test_package/CMakeLists.txt b/recipes/rectpack2d/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb7ed1d19feb8 --- /dev/null +++ b/recipes/rectpack2d/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/rectpack2d/all/test_package/conanfile.py b/recipes/rectpack2d/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5493d58611803 --- /dev/null +++ b/recipes/rectpack2d/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rectpack2d/all/test_package/test_package.cpp b/recipes/rectpack2d/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9f6460a0c37f2 --- /dev/null +++ b/recipes/rectpack2d/all/test_package/test_package.cpp @@ -0,0 +1,193 @@ +#include +#include "rectpack2d/finders_interface.h" + +/* For description of the algorithm, please see the README.md */ + +using namespace rectpack2D; + +int main() { + constexpr bool allow_flip = true; + const auto runtime_flipping_mode = flipping_option::ENABLED; + + /* + Here, we choose the "empty_spaces" class that the algorithm will use from now on. + + The first template argument is a bool which determines + if the algorithm will try to flip rectangles to better fit them. + + The second argument is optional and specifies an allocator for the empty spaces. + The default one just uses a vector to store the spaces. + You can also pass a "static_empty_spaces<10000>" which will allocate 10000 spaces on the stack, + possibly improving performance. + */ + + using spaces_type = rectpack2D::empty_spaces; + + /* + rect_xywh or rect_xywhf (see src/rect_structs.h), + depending on the value of allow_flip. + */ + + using rect_type = output_rect_t; + + /* + Note: + + The multiple-bin functionality was removed. + This means that it is now up to you what is to be done with unsuccessful insertions. + You may initialize another search when this happens. + */ + + auto report_successful = [](rect_type&) { + return callback_result::CONTINUE_PACKING; + }; + + auto report_unsuccessful = [](rect_type&) { + return callback_result::ABORT_PACKING; + }; + + /* + Initial size for the bin, from which the search begins. + The result can only be smaller - if it cannot, the algorithm will gracefully fail. + */ + + const auto max_side = 1000; + + /* + The search stops when the bin was successfully inserted into, + AND the next candidate bin size differs from the last successful one by *less* then discard_step. + + The best possible granuarity is achieved with discard_step = 1. + If you pass a negative discard_step, the algoritm will search with even more granularity - + E.g. with discard_step = -4, the algoritm will behave as if you passed discard_step = 1, + but it will make as many as 4 attempts to optimize bins down to the single pixel. + + Since discard_step = 0 does not make sense, the algoritm will automatically treat this case + as if it were passed a discard_step = 1. + + For common applications, a discard_step = 1 or even discard_step = 128 + should yield really good packings while being very performant. + If you are dealing with very small rectangles specifically, + it might be a good idea to make this value negative. + + See the algorithm section of README for more information. + */ + + const auto discard_step = -4; + + /* + Create some arbitrary rectangles. + Every subsequent call to the packer library will only read the widths and heights that we now specify, + and always overwrite the x and y coordinates with calculated results. + */ + + std::vector rectangles; + + rectangles.emplace_back(rect_xywh(0, 0, 20, 40)); + rectangles.emplace_back(rect_xywh(0, 0, 120, 40)); + rectangles.emplace_back(rect_xywh(0, 0, 85, 59)); + rectangles.emplace_back(rect_xywh(0, 0, 199, 380)); + rectangles.emplace_back(rect_xywh(0, 0, 85, 875)); + + auto report_result = [&rectangles](const rect_wh& result_size) { + std::cout << "Resultant bin: " << result_size.w << " " << result_size.h << std::endl; + + for (const auto& r : rectangles) { + std::cout << r.x << " " << r.y << " " << r.w << " " << r.h << std::endl; + } + }; + + { + /* + Example 1: Find best packing with default orders. + + If you pass no comparators whatsoever, + the standard collection of 6 orders: + by area, by perimeter, by bigger side, by width, by height and by "pathological multiplier" + - will be passed by default. + */ + + const auto result_size = find_best_packing( + rectangles, + make_finder_input( + max_side, + discard_step, + report_successful, + report_unsuccessful, + runtime_flipping_mode + ) + ); + + report_result(result_size); + } + + { + /* Example 2: Find best packing using all provided custom rectangle orders. */ + + using rect_ptr = rect_type*; + + auto my_custom_order_1 = [](const rect_ptr a, const rect_ptr b) { + return a->get_wh().pathological_mult() > b->get_wh().pathological_mult(); + }; + + auto my_custom_order_2 = [](const rect_ptr a, const rect_ptr b) { + return a->get_wh().pathological_mult() < b->get_wh().pathological_mult(); + }; + + const auto result_size = find_best_packing( + rectangles, + make_finder_input( + max_side, + discard_step, + report_successful, + report_unsuccessful, + runtime_flipping_mode + ), + + my_custom_order_1, + my_custom_order_2 + ); + + report_result(result_size); + } + + { + /* Example 3: Find best packing exactly in the order of provided input. */ + + const auto result_size = find_best_packing_dont_sort( + rectangles, + make_finder_input( + max_side, + discard_step, + report_successful, + report_unsuccessful, + runtime_flipping_mode + ) + ); + + report_result(result_size); + } + + { + /* Example 4: Manually perform insertions. This way you can try your own best-bin finding logic. */ + + auto packing_root = spaces_type({ max_side, max_side }); + packing_root.flipping_mode = runtime_flipping_mode; + + for (auto& r : rectangles) { + if (const auto inserted_rectangle = packing_root.insert(std::as_const(r).get_wh())) { + r = *inserted_rectangle; + } + else { + std::cout << "Failed to insert a rectangle." << std::endl; + break; + } + } + + const auto result_size = packing_root.get_rects_aabb(); + + report_result(result_size); + } + + return 0; +} diff --git a/recipes/rectpack2d/config.yml b/recipes/rectpack2d/config.yml new file mode 100644 index 0000000000000..425d4d19b8cf0 --- /dev/null +++ b/recipes/rectpack2d/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210710": + folder: all diff --git a/recipes/redboltz-mqtt_cpp/all/conandata.yml b/recipes/redboltz-mqtt_cpp/all/conandata.yml new file mode 100644 index 0000000000000..ad87340ad9e35 --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "13.0.0": + url: "https://github.com/redboltz/mqtt_cpp/archive/refs/tags/v13.0.0.tar.gz" + sha256: "5d06caa1218feb23d0a63892ced7b0edfd1f686002676175f6e384275a27a1e7" diff --git a/recipes/redboltz-mqtt_cpp/all/conanfile.py b/recipes/redboltz-mqtt_cpp/all/conanfile.py new file mode 100644 index 0000000000000..8fdf7f70084cf --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/all/conanfile.py @@ -0,0 +1,64 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + +class MqttCPPConan(ConanFile): + name = "redboltz-mqtt_cpp" + description = "MQTT client/server for C++14 based on Boost.Asio" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/redboltz/mqtt_cpp" + topics = ("mqtt", "boost", "asio") + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("boost/1.79.0") + + def package_id(self): + self.info.header_only() + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "Visual Studio": "15.0", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++14, which your compiler does not support.".format(self.name)) + else: + self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy(pattern="LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mqtt_cpp") + self.cpp_info.set_property("cmake_target_name", "mqtt_cpp::mqtt_cpp") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "mqtt_cpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "mqtt_cpp" + self.cpp_info.names["cmake_find_package"] = "mqtt_cpp" + self.cpp_info.names["cmake_find_package_multi"] = "mqtt_cpp" diff --git a/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt b/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d57b3a725b42c --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mqtt_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} mqtt_cpp::mqtt_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/redboltz-mqtt_cpp/all/test_package/conanfile.py b/recipes/redboltz-mqtt_cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/all/test_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/redboltz-mqtt_cpp/all/test_package/test_package.cpp b/recipes/redboltz-mqtt_cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65e10348b409b --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +int main() { + MQTT_NS::setup_log(); + + boost::asio::io_context ioc; + + auto c = MQTT_NS::make_async_client(ioc, "localhost", "40000"); + + c->set_client_id("test_package"); + c->set_clean_session(true); + + return 0; +} diff --git a/recipes/redboltz-mqtt_cpp/config.yml b/recipes/redboltz-mqtt_cpp/config.yml new file mode 100644 index 0000000000000..ed9e26c6552eb --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "13.0.0": + folder: all diff --git a/recipes/redis-plus-plus/all/conandata.yml b/recipes/redis-plus-plus/all/conandata.yml new file mode 100644 index 0000000000000..2437f2fe67b15 --- /dev/null +++ b/recipes/redis-plus-plus/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "1.3.7": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.7.tar.gz" + sha256: "89cb83b0a23ac5825300c301814eab74aa3cdcfcd12e87d443c2692e367768ba" + "1.3.3": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.3.tar.gz" + sha256: "23689059b7ba50fcd8fa673c5dbb7bdb010b896b14abad5aa80a5ec48eb64f26" + "1.3.2": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.2.tar.gz" + sha256: "e172cd8dcfeaf649e20a2d24537f8676c7cabed5c24182d73be189e53a013289" + "1.2.3": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.3.tar.gz" + sha256: "1a3336752133019c963e06c28667b96690d6395b804e5e326671777ff88982ea" + "1.2.1": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.1.tar.gz" + sha256: "f09c9fcc362955edb887632cd008102887278c94934d7e8c9d0acb8707671902" +patches: + "1.3.7": + - patch_file: "patches/1.3.7-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.3.3": + - patch_file: "patches/1.3.3-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.3.2": + - patch_file: "patches/1.3.2-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.2.3": + - patch_file: "patches/1.2.3-0001-fix-conan-cmake-package.patch" + patch_description: "Robust discovery & injection of dependencies" + patch_type: "conan" + "1.2.1": + - patch_file: "patches/1.2.1-0001-fix-hiredis-consumption.patch" + patch_description: "Robust discovery & injection of dependencies" + patch_type: "conan" + - patch_file: "patches/1.2.1-0002-cmake-minimum-required.patch" + patch_description: "CMake: move cmake_minimum_required() before project()" + patch_type: "conan" diff --git a/recipes/redis-plus-plus/all/conanfile.py b/recipes/redis-plus-plus/all/conanfile.py new file mode 100644 index 0000000000000..b10c66e4f7f94 --- /dev/null +++ b/recipes/redis-plus-plus/all/conanfile.py @@ -0,0 +1,153 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class RedisPlusPlusConan(ConanFile): + name = "redis-plus-plus" + homepage = "https://github.com/sewenew/redis-plus-plus" + description = "Redis client written in C++" + topics = ("database", "redis", "client", "tls") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tls": [True, False], + "build_async": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tls": False, + "build_async": False, + } + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.3.0" else "17" + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "1.3.0": + return {} + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "1.3.0": + del self.options.build_async + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("hiredis/1.1.0") + if self.options.get_safe("build_async"): + self.requires("libuv/1.44.2") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if self.info.options.with_tls and not self.dependencies["hiredis"].options.with_ssl: + raise ConanInvalidConfiguration(f"{self.name}:with_tls=True requires hiredis:with_ssl=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.compiler.get_safe("cppstd"): + cppstd = str(self.settings.compiler.cppstd) + if cppstd.startswith("gnu"): + cppstd = cppstd[3:] + tc.cache_variables["REDIS_PLUS_PLUS_CXX_STANDARD"] = cppstd + tc.variables["REDIS_PLUS_PLUS_USE_TLS"] = self.options.with_tls + if self.options.get_safe("build_async"): + tc.cache_variables["REDIS_PLUS_PLUS_BUILD_ASYNC"] = "libuv" + tc.variables["REDIS_PLUS_PLUS_BUILD_TEST"] = False + tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC"] = not self.options.shared + tc.variables["REDIS_PLUS_PLUS_BUILD_SHARED"] = self.options.shared + if Version(self.version) >= "1.2.3": + tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC"] = self.options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) < "1.2.3": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_target_properties(${STATIC_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON)", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "redis++") + target_suffix = "" if self.options.shared else "_static" + self.cpp_info.set_property("cmake_target_name", f"redis++::redis++{target_suffix}") + self.cpp_info.set_property("pkg_config_name", "redis++") + # TODO: back to global scope in conan v2 + lib_suffix = "_static" if self.settings.os == "Windows" and not self.options.shared else "" + self.cpp_info.components["redis++lib"].libs = [f"redis++{lib_suffix}"] + self.cpp_info.components["redis++lib"].requires = ["hiredis::hiredis"] + if self.options.with_tls: + self.cpp_info.components["redis++lib"].requires.append("hiredis::hiredis_ssl") + if self.options.get_safe("build_async"): + self.cpp_info.components["redis++lib"].requires.append("libuv::libuv") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["redis++lib"].system_libs.append("pthread") + self.cpp_info.components["redis++lib"].system_libs.append("m") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "redis++" + self.cpp_info.names["cmake_find_package_multi"] = "redis++" + self.cpp_info.components["redis++lib"].names["cmake_find_package"] = f"redis++{target_suffix}" + self.cpp_info.components["redis++lib"].names["cmake_find_package_multi"] = f"redis++{target_suffix}" + self.cpp_info.components["redis++lib"].set_property("cmake_target_name", f"redis++::redis++{target_suffix}") + self.cpp_info.components["redis++lib"].set_property("pkg_config_name", "redis++") diff --git a/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch b/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch new file mode 100644 index 0000000000000..de2b4ddbe2f80 --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -29,6 +29,7 @@ if (REDIS_PLUS_PLUS_USE_TLS) + message(STATUS "Build with TLS support") + + set(TLS_SUB_DIR "${PROJECT_SOURCE_DIR}/tls") ++ find_package(hiredis REQUIRED hiredis_ssl CONFIG) + else() + set(TLS_SUB_DIR "${PROJECT_SOURCE_DIR}/no_tls") + endif() +@@ -36,8 +37,7 @@ endif() + file(GLOB TLS_SOURCE_FILES "${TLS_SUB_DIR}/*.cpp") + + # hiredis dependency +-find_path(HIREDIS_HEADER hiredis) +-find_library(HIREDIS_LIB hiredis) ++find_package(hiredis REQUIRED hiredis CONFIG) + + # Build static library + option(REDIS_PLUS_PLUS_BUILD_STATIC "Build static library" ON) +@@ -48,7 +48,7 @@ if (REDIS_PLUS_PLUS_BUILD_STATIC) + add_library(${STATIC_LIB} STATIC ${PROJECT_SOURCE_FILES} ${TLS_SOURCE_FILES}) + + target_include_directories(${STATIC_LIB} PUBLIC ${PROJECT_SOURCE_DIR} ${TLS_SUB_DIR}) +- target_include_directories(${STATIC_LIB} PUBLIC ${HIREDIS_HEADER}) ++ target_link_libraries(${STATIC_LIB} PUBLIC hiredis::hiredis) + + if (WIN32) + target_compile_definitions(${STATIC_LIB} PRIVATE NOMINMAX) +@@ -58,6 +58,10 @@ if (REDIS_PLUS_PLUS_BUILD_STATIC) + set_target_properties(${STATIC_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) + endif() + ++ if (REDIS_PLUS_PLUS_USE_TLS) ++ target_link_libraries(${STATIC_LIB} PUBLIC hiredis::hiredis_ssl) ++ endif() ++ + set_target_properties(${STATIC_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1) + set_target_properties(${STATIC_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() +@@ -71,7 +75,7 @@ if (REDIS_PLUS_PLUS_BUILD_SHARED) + add_library(${SHARED_LIB} SHARED ${PROJECT_SOURCE_FILES} ${TLS_SOURCE_FILES}) + + target_include_directories(${SHARED_LIB} PUBLIC ${PROJECT_SOURCE_DIR} ${TLS_SUB_DIR}) +- target_include_directories(${SHARED_LIB} PUBLIC ${HIREDIS_HEADER}) ++ target_link_libraries(${SHARED_LIB} PUBLIC hiredis::hiredis) + + if (WIN32) + target_compile_definitions(${SHARED_LIB} PRIVATE NOMINMAX) +@@ -79,11 +83,9 @@ if (REDIS_PLUS_PLUS_BUILD_SHARED) + set_target_properties(${SHARED_LIB} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + endif() + +- target_link_libraries(${SHARED_LIB} ${HIREDIS_LIB}) + + if (REDIS_PLUS_PLUS_USE_TLS) +- find_library(HIREDIS_TLS_LIB hiredis_ssl) +- target_link_libraries(${SHARED_LIB} ${HIREDIS_TLS_LIB}) ++ target_link_libraries(${SHARED_LIB} PUBLIC hiredis::hiredis_ssl) + endif() + + set_target_properties(${SHARED_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) diff --git a/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch b/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch new file mode 100644 index 0000000000000..d00f3b331f4ab --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,10 +1,10 @@ +-project(redis++) + + if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + cmake_minimum_required(VERSION 3.0.0) + else() +- cmake_minimum_required(VERSION 2.8.0) ++ cmake_minimum_required(VERSION 3.0.0) + endif() ++project(redis++) + + if (NOT DEFINED REDIS_PLUS_PLUS_CXX_STANDARD) + set(REDIS_PLUS_PLUS_CXX_STANDARD 11) diff --git a/recipes/redis-plus-plus/all/patches/1.2.3-0001-fix-conan-cmake-package.patch b/recipes/redis-plus-plus/all/patches/1.2.3-0001-fix-conan-cmake-package.patch new file mode 100644 index 0000000000000..001bf0ec676a9 --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.2.3-0001-fix-conan-cmake-package.patch @@ -0,0 +1,21 @@ +From 5f471a38d951b810ac322bbc575583dd191a2e12 Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Tue, 16 Mar 2021 22:12:27 -0400 +Subject: [PATCH] Compenstate for conan only generating one config package per recipe + +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 452cc0f..7c90015 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,7 +65,6 @@ if(hiredis_FOUND) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis) + + if(REDIS_PLUS_PLUS_USE_TLS) +- find_package(hiredis_ssl REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis_ssl) + endif() + else() diff --git a/recipes/redis-plus-plus/all/patches/1.3.2-0001-fix-dependencies-injection.patch b/recipes/redis-plus-plus/all/patches/1.3.2-0001-fix-dependencies-injection.patch new file mode 100644 index 0000000000000..27a7e92866036 --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.3.2-0001-fix-dependencies-injection.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,8 +30,7 @@ if(REDIS_PLUS_PLUS_BUILD_ASYNC) + message(STATUS "redis-plus-plus build async interface with libuv") + + # libuv dependency +- find_path(REDIS_PLUS_PLUS_ASYNC_LIB_HEADER NAMES uv.h) +- find_library(REDIS_PLUS_PLUS_ASYNC_LIB uv) ++ find_package(libuv REQUIRED CONFIG) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -111,7 +110,6 @@ if(hiredis_FOUND) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis) + + if(REDIS_PLUS_PLUS_USE_TLS) +- find_package(hiredis_ssl REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis_ssl) + endif() + else() +@@ -150,7 +148,7 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $) +- target_include_directories(${STATIC_LIB} PUBLIC $) ++ target_link_libraries(${STATIC_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $) + endif() +@@ -202,8 +200,7 @@ if(REDIS_PLUS_PLUS_BUILD_SHARED) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${SHARED_LIB} PUBLIC $) +- target_include_directories(${SHARED_LIB} PUBLIC $) +- target_link_libraries(${SHARED_LIB} PUBLIC ${REDIS_PLUS_PLUS_ASYNC_LIB}) ++ target_link_libraries(${SHARED_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${SHARED_LIB} SYSTEM PUBLIC $) + endif() diff --git a/recipes/redis-plus-plus/all/patches/1.3.3-0001-fix-dependencies-injection.patch b/recipes/redis-plus-plus/all/patches/1.3.3-0001-fix-dependencies-injection.patch new file mode 100644 index 0000000000000..90500520116b4 --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.3.3-0001-fix-dependencies-injection.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,8 +34,7 @@ if(REDIS_PLUS_PLUS_BUILD_ASYNC) + message(STATUS "redis-plus-plus build async interface with libuv") + + # libuv dependency +- find_path(REDIS_PLUS_PLUS_ASYNC_LIB_HEADER NAMES uv.h) +- find_library(REDIS_PLUS_PLUS_ASYNC_LIB uv) ++ find_package(libuv REQUIRED CONFIG) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -115,7 +114,6 @@ if(hiredis_FOUND) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis) + + if(REDIS_PLUS_PLUS_USE_TLS) +- find_package(hiredis_ssl REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis_ssl) + endif() + else() +@@ -155,7 +153,7 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $) +- target_include_directories(${STATIC_LIB} PUBLIC $) ++ target_link_libraries(${STATIC_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $) + endif() +@@ -208,8 +206,7 @@ if(REDIS_PLUS_PLUS_BUILD_SHARED) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${SHARED_LIB} PUBLIC $) +- target_include_directories(${SHARED_LIB} PUBLIC $) +- target_link_libraries(${SHARED_LIB} PUBLIC ${REDIS_PLUS_PLUS_ASYNC_LIB}) ++ target_link_libraries(${SHARED_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${SHARED_LIB} SYSTEM PUBLIC $) + endif() diff --git a/recipes/redis-plus-plus/all/patches/1.3.7-0001-fix-dependencies-injection.patch b/recipes/redis-plus-plus/all/patches/1.3.7-0001-fix-dependencies-injection.patch new file mode 100644 index 0000000000000..0dcd6b097c60a --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.3.7-0001-fix-dependencies-injection.patch @@ -0,0 +1,41 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 69794d9..fbb75b7 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -34,8 +34,7 @@ if(REDIS_PLUS_PLUS_BUILD_ASYNC) + message(STATUS "redis-plus-plus build async interface with libuv") + + # libuv dependency +- find_path(REDIS_PLUS_PLUS_ASYNC_LIB_HEADER NAMES uv.h) +- find_library(REDIS_PLUS_PLUS_ASYNC_LIB uv) ++ find_package(libuv REQUIRED CONFIG) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -131,7 +130,6 @@ if(hiredis_FOUND) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis) + + if(REDIS_PLUS_PLUS_USE_TLS) +- find_package(hiredis_ssl REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis_ssl) + find_package(OpenSSL REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS ${OPENSSL_LIBRARIES}) +@@ -191,7 +189,7 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $) +- target_include_directories(${STATIC_LIB} PUBLIC $) ++ target_link_libraries(${STATIC_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $) + endif() +@@ -245,8 +244,7 @@ if(REDIS_PLUS_PLUS_BUILD_SHARED) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${SHARED_LIB} PUBLIC $) +- target_include_directories(${SHARED_LIB} PUBLIC $) +- target_link_libraries(${SHARED_LIB} PUBLIC ${REDIS_PLUS_PLUS_ASYNC_LIB}) ++ target_link_libraries(${SHARED_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${SHARED_LIB} SYSTEM PUBLIC $) + endif() diff --git a/recipes/redis-plus-plus/all/test_package/CMakeLists.txt b/recipes/redis-plus-plus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..df9a8c785c48c --- /dev/null +++ b/recipes/redis-plus-plus/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(redis++ REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET redis++::redis++_static) + target_link_libraries(${PROJECT_NAME} PRIVATE redis++::redis++_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE redis++::redis++) +endif() +if(redis++_VERSION VERSION_GREATER_EQUAL "1.3.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + # no target_compile_features here because redis-plus-plus < 1.3.0 is built + # with C++11 by default and is not ABI compatible if consumed with C++17... + set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +endif() diff --git a/recipes/redis-plus-plus/all/test_package/conanfile.py b/recipes/redis-plus-plus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/redis-plus-plus/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/redis-plus-plus/all/test_package/test_package.cpp b/recipes/redis-plus-plus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ce905abe5fc4c --- /dev/null +++ b/recipes/redis-plus-plus/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +using namespace sw::redis; + +int main() { + try{ + auto redis = Redis("tcp://127.0.0.1:6379"); + redis.set("key", "val"); + redis.rpush("list", {"a", "b", "c"}); + } + catch(...) + { + } + + return 0; +} diff --git a/recipes/redis-plus-plus/all/test_v1_package/CMakeLists.txt b/recipes/redis-plus-plus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/redis-plus-plus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/redis-plus-plus/all/test_v1_package/conanfile.py b/recipes/redis-plus-plus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/redis-plus-plus/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/redis-plus-plus/config.yml b/recipes/redis-plus-plus/config.yml new file mode 100644 index 0000000000000..923fc0f3c1acb --- /dev/null +++ b/recipes/redis-plus-plus/config.yml @@ -0,0 +1,11 @@ +versions: + "1.3.7": + folder: all + "1.3.3": + folder: all + "1.3.2": + folder: all + "1.2.3": + folder: all + "1.2.1": + folder: all diff --git a/recipes/redradist-icc/all/CMakeLists.txt b/recipes/redradist-icc/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/redradist-icc/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/redradist-icc/all/conandata.yml b/recipes/redradist-icc/all/conandata.yml new file mode 100644 index 0000000000000..443fdbb821296 --- /dev/null +++ b/recipes/redradist-icc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + sha256: 28724fdff9bff9eee4d7196ffcd26d95c77f96f6cf4564f9af9cfdc59dd7c780 + url: https://github.com/redradist/Inter-Component-Communication/archive/refs/tags/v1.0.0.tar.gz diff --git a/recipes/redradist-icc/all/conanfile.py b/recipes/redradist-icc/all/conanfile.py new file mode 100644 index 0000000000000..926df39193116 --- /dev/null +++ b/recipes/redradist-icc/all/conanfile.py @@ -0,0 +1,115 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration, ConanException +import os + + +class ICCConan(ConanFile): + name = 'redradist-icc' + homepage = 'https://github.com/redradist/Inter-Component-Communication' + license = 'MIT' + url = 'https://github.com/conan-io/conan-center-index' + description = "I.C.C. - Inter Component Communication, This is a library created to simplify communication between " \ + "components inside of single application. It is thread safe and could be used for creating " \ + "components that works in different threads. " + topics = ("thread-safe", "active-object", "communication") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + 'fPIC': [True, False], + } + default_options = { + 'shared': False, + 'fPIC': True, + } + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_cpp_standard(self): + return 11 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "apple-clang": "9.4", + "clang": "3.3", + "gcc": "4.9.4" + } + + def _configure_cmake(self): + if self._cmake: + return self._cmake + cmake = CMake(self) + cmake.definitions['ICC_BUILD_SHARED'] = self.options.shared + cmake.configure() + self._cmake = cmake + return self._cmake + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, self._minimum_cpp_standard) + + os = self.settings.os + if os not in ("Windows", "Linux"): + msg = ( + "OS {} is not supported !!" + ).format(os) + raise ConanInvalidConfiguration(msg) + + compiler = self.settings.compiler + try: + min_version = self._minimum_compilers_version[str(compiler)] + if tools.Version(compiler.version) < min_version: + msg = ( + "{} requires C++{} features which are not supported by compiler {} {} !!" + ).format(self.name, self._minimum_cpp_standard, compiler, compiler.version) + raise ConanInvalidConfiguration(msg) + except KeyError: + msg = ( + "{} recipe lacks information about the {} compiler, " + "support for the required C++{} features is assumed" + ).format(self.name, compiler, self._minimum_cpp_standard) + self.output.warn(msg) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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 source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "icc" + self.cpp_info.names["cmake_find_package_multi"] = "icc" + if self.options.shared: + self.cpp_info.libs = ["ICC"] + else: + self.cpp_info.libs = ["ICC_static"] + + if self.settings.os == 'Windows': + self.cpp_info.system_libs = ['ws2_32', 'wsock32'] + if self.settings.os == 'Linux': + self.cpp_info.system_libs = ['pthread'] diff --git a/recipes/redradist-icc/all/test_package/CMakeLists.txt b/recipes/redradist-icc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de507b485e0da --- /dev/null +++ b/recipes/redradist-icc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest) + +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(icc REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example PRIVATE icc::icc) diff --git a/recipes/redradist-icc/all/test_package/conanfile.py b/recipes/redradist-icc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b80e4a18de9ec --- /dev/null +++ b/recipes/redradist-icc/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class ICCTestConan(ConanFile): + settings = 'os', 'compiler', 'build_type', 'arch' + generators = 'cmake', 'cmake_find_package' + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join('bin', 'example') + self.run(bin_path, run_environment=True) diff --git a/recipes/redradist-icc/all/test_package/example.cpp b/recipes/redradist-icc/all/test_package/example.cpp new file mode 100644 index 0000000000000..cbf15d36a28cd --- /dev/null +++ b/recipes/redradist-icc/all/test_package/example.cpp @@ -0,0 +1,14 @@ +#include +#include +#include +#include +#include + +int main() { + auto timer = icc::os::Timer::createTimer(); + timer->setInterval(std::chrono::seconds(10)); + timer->enableContinuous(); + timer->start(); + std::this_thread::sleep_for(std::chrono::seconds(25)); + return 0; +} diff --git a/recipes/redradist-icc/config.yml b/recipes/redradist-icc/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/redradist-icc/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/refl-cpp/all/conandata.yml b/recipes/refl-cpp/all/conandata.yml new file mode 100644 index 0000000000000..fbf28e3cdca2f --- /dev/null +++ b/recipes/refl-cpp/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "0.12.4": + url: "https://github.com/veselink1/refl-cpp/archive/refs/tags/v0.12.4.tar.gz" + sha256: "8f6e02535ac3d1e51c1d8288d755378b914bb72f817020d2dec261de33f78b5c" + "0.12.1": + url: "https://github.com/veselink1/refl-cpp/archive/refs/tags/v0.12.1.tar.gz" + sha256: "dcc740271645597fe882bf43a7006d232f5be622b4cb97a143925eb1fd3946ae" + +patches: + "0.12.1": + - patch_file: "patches/0.12.1-0001-remove-memory-fwd.patch" + patch_description: "remove xxx_ptr forward declaration" + patch_type: "portability" + patch_source: "https://github.com/veselink1/refl-cpp/pull/76" diff --git a/recipes/refl-cpp/all/conanfile.py b/recipes/refl-cpp/all/conanfile.py new file mode 100644 index 0000000000000..7ba2308354522 --- /dev/null +++ b/recipes/refl-cpp/all/conanfile.py @@ -0,0 +1,71 @@ +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 ReflCppConan(ConanFile): + name = "refl-cpp" + description = "A modern compile-time reflection library for C++ with support for overloads, templates, attributes and proxies" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/veselink1/refl-cpp" + topics = ("header", "header-only", "reflection", "modern", "metaprogramming") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if not min_version: + self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} compiler support.") + else: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd} support. " + f"The current compiler {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 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) + if Version(self.version) < "0.12.2": + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + else: + 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 = [] + self.cpp_info.libdirs = [] diff --git a/recipes/refl-cpp/all/patches/0.12.1-0001-remove-memory-fwd.patch b/recipes/refl-cpp/all/patches/0.12.1-0001-remove-memory-fwd.patch new file mode 100644 index 0000000000000..460de696f03e3 --- /dev/null +++ b/recipes/refl-cpp/all/patches/0.12.1-0001-remove-memory-fwd.patch @@ -0,0 +1,27 @@ +diff --git a/a/refl.hpp b/b/refl.hpp +index 7099200..c6580cf 100644 +--- a/a/refl.hpp ++++ b/b/refl.hpp +@@ -34,20 +34,8 @@ + #include + #include // std::quoted + +-namespace std +-{ +- template +- class unique_ptr; +- +- template +- class shared_ptr; +- +- template +- class weak_ptr; +- +- template +- class complex; +-} // namespace std ++#include ++#include + + #ifdef _MSC_VER + // Disable VS warning for "Not enough arguments for macro" diff --git a/recipes/refl-cpp/all/test_package/CMakeLists.txt b/recipes/refl-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f30f3345a4439 --- /dev/null +++ b/recipes/refl-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(refl-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE refl-cpp::refl-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/refl-cpp/all/test_package/conanfile.py b/recipes/refl-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d6e715375232f --- /dev/null +++ b/recipes/refl-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/refl-cpp/all/test_package/test_package.cpp b/recipes/refl-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bfa452693133f --- /dev/null +++ b/recipes/refl-cpp/all/test_package/test_package.cpp @@ -0,0 +1,63 @@ +#include "refl.hpp" + +#include + +// The example from the refl-cpp github readme: + +struct NonNegative : refl::attr::usage::member {}; + +struct Point { + double x, y; +}; + +REFL_AUTO(type(Point), field(x, NonNegative()), field(y, NonNegative())) + +struct Circle { + Point origin; + double radius; +}; + +REFL_AUTO(type(Circle), field(origin), field(radius, NonNegative())) + +template +constexpr bool checkNonNegative(const T& obj) { + // Get the type descriptor for T + constexpr auto type = refl::reflect(); + // Get the compile-time refl::type_list<...> of member descriptors + constexpr auto members = get_members(type); + // Filter out the non-readable members (not field or getters marked with the property() attribute) + constexpr auto readableMembers = + filter(members, [](auto member) { return is_readable(member); }); + + auto invalidMemberCount = count_if(readableMembers, [&](auto member) { + // Function-call syntax is a uniform way to get the value of a member (whether a field or a getter) + auto&& value = member(obj); + // Check if the NonNegative attribute is present + if constexpr(refl::descriptor::has_attribute(member)) { + // And if so, make the necessary checks + return value < 0; + } + // Recursively check the value of the member + else if(!checkNonNegative(value)) { + return true; + } + return false; + }); + + return invalidMemberCount == 0; +} + +// These checks are supposed to run at compile time in the original example, +// but older compilers can't do that. So I'm just gonna make them run time for now. +constexpr Circle c1{{0., 5.}, 100.}; + +constexpr Circle c2{{0., 5.}, -100.}; + +constexpr Circle c3{{0., -5.}, 100.}; + +int main() { + assert(checkNonNegative(c1)); + assert(!checkNonNegative(c2)); + assert(!checkNonNegative(c3)); + return 0; +} diff --git a/recipes/refl-cpp/all/test_v1_package/CMakeLists.txt b/recipes/refl-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/refl-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/refl-cpp/all/test_v1_package/conanfile.py b/recipes/refl-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/refl-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/refl-cpp/config.yml b/recipes/refl-cpp/config.yml new file mode 100644 index 0000000000000..7422455329b65 --- /dev/null +++ b/recipes/refl-cpp/config.yml @@ -0,0 +1,5 @@ +versions: + "0.12.4": + folder: all + "0.12.1": + folder: all diff --git a/recipes/replxx/all/CMakeLists.txt b/recipes/replxx/all/CMakeLists.txt new file mode 100644 index 0000000000000..d17aaff199b4a --- /dev/null +++ b/recipes/replxx/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/replxx/all/conandata.yml b/recipes/replxx/all/conandata.yml new file mode 100644 index 0000000000000..dc32e4cea0525 --- /dev/null +++ b/recipes/replxx/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.0.2": + sha256: 6f5c58b4cd23550d5a589d134727296438793cb818ce7158fbd5e1b0db1548ba + url: https://github.com/AmokHuginnsson/replxx/archive/release-0.0.2.tar.gz + "0.0.3": + sha256: 72ad0655eead16544645b1724b27a988543fcefd14d46df6e8dfef17d9ba50ac + url: https://github.com/AmokHuginnsson/replxx/archive/release-0.0.3.tar.gz + "0.0.4": + url: "https://github.com/AmokHuginnsson/replxx/archive/release-0.0.4.tar.gz" + sha256: "a22988b2184e1d256e2d111b5749e16ffb1accbf757c7b248226d73c426844c4" diff --git a/recipes/replxx/all/conanfile.py b/recipes/replxx/all/conanfile.py new file mode 100644 index 0000000000000..072b7fd6bb25f --- /dev/null +++ b/recipes/replxx/all/conanfile.py @@ -0,0 +1,77 @@ +import os +from conans import CMake, ConanFile, tools + +required_conan_version = ">=1.33.0" + +class ReplxxConan(ConanFile): + name = "replxx" + description = """ + A readline and libedit replacement that supports UTF-8, + syntax highlighting, hints and Windows and is BSD licensed. + """ + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AmokHuginnsson/replxx" + topics = ("readline", "libedit", "UTF-8") + license = "BSD-3-Clause" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["REPLXX_BuildExamples"] = False + self._cmake.definitions["BUILD_STATIC_LIBS"] = not self.options.shared + self._cmake.configure() + return self._cmake + + def build(self): + if tools.Version(self.version) < "0.0.3": + tools.replace_in_file( + os.path.join(self._source_subfolder, "src", "io.cxx"), + "#include \n", + "#include \n#include \n" + ) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.md", dst='licenses', src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread", "m"] + if not self.options.shared: + self.cpp_info.defines.append("REPLXX_STATIC") + self.cpp_info.filenames["cmake_find_package"] = "replxx" + self.cpp_info.filenames["cmake_find_package_multi"] = "replxx" diff --git a/recipes/replxx/all/test_package/CMakeLists.txt b/recipes/replxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..55da8e6493036 --- /dev/null +++ b/recipes/replxx/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(replxx CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} replxx::replxx) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/replxx/all/test_package/conanfile.py b/recipes/replxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/replxx/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/replxx/all/test_package/test_package.cpp b/recipes/replxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1735ef8c4032b --- /dev/null +++ b/recipes/replxx/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include +#include + +#include "replxx.hxx" + +int main(int argc, char **argv) { + using Replxx = replxx::Replxx; + using namespace std::placeholders; + + std::cout << "Starting Replxx\n"; + + Replxx rx; + rx.install_window_change_handler(); + + // set the max number of hint rows to show + rx.set_max_hint_rows(3); + rx.bind_key(Replxx::KEY::UP, std::bind(&Replxx::invoke, &rx, + Replxx::ACTION::HISTORY_PREVIOUS, _1)); + rx.bind_key(Replxx::KEY::DOWN, std::bind(&Replxx::invoke, &rx, + Replxx::ACTION::HISTORY_NEXT, _1)); + + std::cout << "Exiting Replxx\n"; + + return 0; +} diff --git a/recipes/replxx/config.yml b/recipes/replxx/config.yml new file mode 100644 index 0000000000000..234def7eb2dfa --- /dev/null +++ b/recipes/replxx/config.yml @@ -0,0 +1,8 @@ +--- +versions: + "0.0.2": + folder: "all" + "0.0.3": + folder: "all" + "0.0.4": + folder: "all" diff --git a/recipes/resiprocate/all/conandata.yml b/recipes/resiprocate/all/conandata.yml new file mode 100644 index 0000000000000..30a690c6f981a --- /dev/null +++ b/recipes/resiprocate/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.12.0": + url: https://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-1.12.0.tar.gz + sha256: 046826503d3c8682ae0e42101b28f903c5f988235f1ff4a98dbfb9066d0d3d49 diff --git a/recipes/resiprocate/all/conanfile.py b/recipes/resiprocate/all/conanfile.py new file mode 100644 index 0000000000000..54400194c9ba3 --- /dev/null +++ b/recipes/resiprocate/all/conanfile.py @@ -0,0 +1,94 @@ +import os +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration + + +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" + 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 + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + 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.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_ssl: + self.requires("openssl/1.1.1q") + if self.options.with_postgresql: + self.requires("libpq/14.2") + if self.options.with_mysql: + self.requires("libmysqlclient/8.0.29") + + 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))) + ] + + # These options do not support yes/no + if self.options.with_ssl: + configure_args.append("--with-ssl") + if self.options.with_mysql: + 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 + + def build(self): + autotools = self._configure_autotools() + 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") + + 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"] + 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")) diff --git a/recipes/resiprocate/all/test_package/CMakeLists.txt b/recipes/resiprocate/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/resiprocate/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +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 new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/resiprocate/all/test_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" + + 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/resiprocate/all/test_package/test_package.cpp b/recipes/resiprocate/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8d8ecbcfbc67c --- /dev/null +++ b/recipes/resiprocate/all/test_package/test_package.cpp @@ -0,0 +1,71 @@ +#include +#include +#include +#include + +#define RESIPROCATE_SUBSYSTEM Subsystem::TEST + +using namespace resip; + +std::string sipRawData = "INVITE sip:nikolia@example.ru SIP/2.0\r\n" + "Record-Route: \r\n" + "Via: SIP/2.0/UDP 10.0.0.10;branch=z9hG4bK3af7.0a6e92f4.0\r\n" + "Via: SIP/2.0/UDP 192.168.0.2:5060;branch=z9hG4bK12ee92cb;rport=5060\r\n" + "From: \"78128210000\" ;tag=as149b2d97\r\n" + "To: \r\n" + "Contact: \r\n" + "Call-ID: 3cbf958e6f43d91905c3fa964a373dcb@example.ru\r\n" + "CSeq: 103 INVITE\r\n" + "Max-Forwards: 16\r\n" + "Date: Wed, 10 Jan 2001 13:16:23 GMT\r\n" + "Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\n" + "Supported: replaces\r\n" + "Content-Type: application/sdp\r\n" + "Content-Length: 394\r\n" + "\r\n" + "v=0\r\n" + "o=root 3303 3304 IN IP4 10.0.0.10\r\n" + "s=session\r\n" + "c=IN IP4 10.0.0.10\r\n" + "t=0 0\r\n" + "m=audio 40358 RTP/AVP 0 8 101\r\r\n" + "a=rtpmap:0 PCMU/8000\r\n" + "a=rtpmap:8 PCMA/8000\r\n" + "a=rtpmap:101 telephone-event/8000\r\n" + "a=fmtp:101 0-16\r\n" + "a=silenceSupp:off - - - -\r\n" + "a=sendrecv\r\n"; + +int main(int argc, char* argv[]) +{ + Log::initialize(Log::Cout, Log::Warning, argv[0]); + + SipMessage* msg = SipMessage::make(Data(Data::Share, sipRawData.data()), true); + if (!msg) + { + return 1; + } + + std::cout << std::string(msg->methodStr().data()) << std::endl; + std::string headers = ""; + for (int i = 0; i < Headers::Type::MAX_HEADERS; i++) + { + auto rawHeader = msg->getRawHeader(static_cast(i)); + if (!rawHeader) + { + continue; + } + for (auto value : *rawHeader) + { + headers += std::string(value.getBuffer(), value.getLength()); + } + headers += "\r\n"; + } + + std::cout << headers << std::endl; + std::cout << std::string(msg->getRawBody().getBuffer(), msg->getRawBody().getLength()) << std::endl; + + delete msg; + return 0; +} + diff --git a/recipes/resiprocate/config.yml b/recipes/resiprocate/config.yml new file mode 100644 index 0000000000000..38422764207cf --- /dev/null +++ b/recipes/resiprocate/config.yml @@ -0,0 +1,3 @@ +versions: + "1.12.0": + folder: all diff --git a/recipes/resource_pool/all/conandata.yml b/recipes/resource_pool/all/conandata.yml new file mode 100644 index 0000000000000..cd536b2e52ac1 --- /dev/null +++ b/recipes/resource_pool/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210322": + url: "https://github.com/elsid/resource_pool/archive/3ea1f95fecc9ce28e66bbbc2a36c1e0142551ab6.zip" + sha256: 37fa3807648b66f3903d1edf03022185acc6f1626ae8bb9174894a1f29012a0c diff --git a/recipes/resource_pool/all/conanfile.py b/recipes/resource_pool/all/conanfile.py new file mode 100644 index 0000000000000..0e8accc6eec6a --- /dev/null +++ b/recipes/resource_pool/all/conanfile.py @@ -0,0 +1,80 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from conans.tools import check_min_cppstd +import os +import glob + + +class ResourcePool(ConanFile): + name = "resource_pool" + description = "C++ header only library purposed to create pool of some resources like keepalive connections" + topics = ("conan", "resource pool", "resource_pool", "asio", "elsid", "c++17", "cpp17") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://github.com/elsid/resource_pool" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + requires = ( + "boost/1.75.0" + ) + generators = "cmake_find_package" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "clang": "5", + "apple-clang": "10", + } + + def _validate_compiler_settings(self): + compiler = self.settings.compiler + if compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + + if not minimum_version: + self.output.warn("resource_pool requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("resource_pool requires a compiler that supports at least C++17") + + def validate(self): + self._validate_compiler_settings() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob(self.name + "-*/")[0] + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy(pattern="*", dst=os.path.join("include", "yamail"), src=os.path.join(self._source_subfolder, "include", "yamail")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + main_comp = self.cpp_info.components["_resource_pool"] + main_comp.requires = ["boost::boost", "boost::system", "boost::thread"] + main_comp.defines = ["BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT"] + main_comp.names["cmake_find_package"] = "resource_pool" + main_comp.names["cmake_find_package_multi"] = "resource_pool" + + if self.settings.os == "Windows": + main_comp.system_libs.append("ws2_32") + + # Set up for compatibility with existing cmake configuration + self.cpp_info.filenames["cmake_find_package"] = "resource_pool" + self.cpp_info.filenames["cmake_find_package_multi"] = "resource_pool" + self.cpp_info.names["cmake_find_package"] = "elsid" + self.cpp_info.names["cmake_find_package_multi"] = "elsid" diff --git a/recipes/resource_pool/all/test_package/CMakeLists.txt b/recipes/resource_pool/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e5e189f75c43 --- /dev/null +++ b/recipes/resource_pool/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(PackageTest CXX) + +find_package(resource_pool REQUIRED) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(example coro.cc) +target_compile_features(example PRIVATE cxx_std_17) +target_link_libraries(example PRIVATE elsid::resource_pool) diff --git a/recipes/resource_pool/all/test_package/conanfile.py b/recipes/resource_pool/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2f970874682b0 --- /dev/null +++ b/recipes/resource_pool/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ResourcePoolTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package", "cmake" + + 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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/resource_pool/all/test_package/coro.cc b/recipes/resource_pool/all/test_package/coro.cc new file mode 100644 index 0000000000000..0e0b304948775 --- /dev/null +++ b/recipes/resource_pool/all/test_package/coro.cc @@ -0,0 +1,36 @@ +#include + +#include +#include +#include + +using ofstream_pool = yamail::resource_pool::async::pool>; +using time_traits = yamail::resource_pool::time_traits; + +struct null_buffer : std::streambuf { int overflow(int c) override { return c; } } null_buf; + +int main() { + boost::asio::io_context service; + ofstream_pool pool(1, 10); + boost::asio::spawn(service, [&](boost::asio::yield_context yield){ + boost::system::error_code ec; + auto handle = pool.get_auto_waste(service, yield[ec], time_traits::duration::max()); + if (ec) { + std::cout << "handle error: " << ec.message() << std::endl; + return; + } + std::cout << "got resource handle" << std::endl; + if (handle.empty()) { + auto stream = std::make_unique(&null_buf); + if (!stream->good()) { + return; + } + handle.reset(std::move(stream)); + } + *(handle.get()) << (time_traits::time_point::min() - time_traits::now()).count() << std::endl; + if (handle.get()->good()) { + handle.recycle(); + } + }); + service.run(); +} diff --git a/recipes/resource_pool/config.yml b/recipes/resource_pool/config.yml new file mode 100644 index 0000000000000..b90744deceea1 --- /dev/null +++ b/recipes/resource_pool/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210322": + folder: "all" diff --git a/recipes/restbed/all/conandata.yml b/recipes/restbed/all/conandata.yml new file mode 100644 index 0000000000000..6e0b42fcccc44 --- /dev/null +++ b/recipes/restbed/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "4.8": + url: "https://github.com/Corvusoft/restbed/archive/refs/tags/4.8.tar.gz" + sha256: "4801833f86a67b8a123c2c01203e259eb81157e1e9ef144a3b6395cb2d838a42" +patches: + "4.8": + - patch_file: "patches/4.8-0001-cmake-conan.patch" + patch_description: "Use CMake targets + separate static/shared" + patch_type: "conan" + - patch_file: "patches/4.8-0002-mingw-deprecated-fix.patch" + patch_description: "MinGW apparently does not support deprecated and __declspec in the same line" + patch_type: "portability" diff --git a/recipes/restbed/all/conanfile.py b/recipes/restbed/all/conanfile.py new file mode 100644 index 0000000000000..f63b47dfcb4cd --- /dev/null +++ b/recipes/restbed/all/conanfile.py @@ -0,0 +1,123 @@ +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, load, rm, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import re + +required_conan_version = ">=1.53.0" + + +class RestbedConan(ConanFile): + name = "restbed" + homepage = "https://github.com/Corvusoft/restbed" + description = "Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications." + topics = ("restful", "server", "client", "json", "http", "ssl", "tls") + url = "https://github.com/conan-io/conan-center-index" + license = "AGPL-3.0-or-later", "LicenseRef-CPL" # Corvusoft Permissive License (CPL) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ipc": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "ipc": False, + "with_openssl": True, + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.ipc + + 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("asio/1.27.0") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if getattr(self.info.settings.compiler, "cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_SSL"] = self.options.with_openssl + tc.variables["BUILD_IPC"] = self.options.get_safe("ipc", False) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if not self.options.shared: + # Remove __declspec(dllexport) and __declspec(dllimport) + for root, _, files in os.walk(self.source_folder): + for file in files: + if os.path.splitext(file)[1] in (".hpp", ".h"): + full_path = os.path.join(root, file) + data = load(self, full_path) + data, _ = re.subn(r"__declspec\((dllexport|dllimport)\)", "", data) + save(self, full_path, data) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + libname = "restbed" + if self.settings.os in ("Windows", ) and self.options.shared: + libname += "-shared" + self.cpp_info.libs = [libname] + + if self.settings.os in ("FreeBSD", "Linux", ): + self.cpp_info.system_libs.extend(["dl", "m"]) + elif self.settings.os in ("Windows", ): + self.cpp_info.system_libs.append("mswsock") diff --git a/recipes/restbed/all/patches/4.8-0001-cmake-conan.patch b/recipes/restbed/all/patches/4.8-0001-cmake-conan.patch new file mode 100644 index 0000000000000..e239976a0dfce --- /dev/null +++ b/recipes/restbed/all/patches/4.8-0001-cmake-conan.patch @@ -0,0 +1,84 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -19,7 +19,7 @@ + option( BUILD_TESTS "Build unit tests." ON ) + option( BUILD_SSL "Build secure socket layer support." ON ) + option( BUILD_IPC "Build unix domain socket layer support." OFF ) +- ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + # + # Configuration + # +@@ -57,7 +57,7 @@ find_package( asio REQUIRED ) + + if ( BUILD_SSL ) + add_definitions( "-DBUILD_SSL" ) +- find_package( openssl REQUIRED ) ++ find_package( OpenSSL REQUIRED ) + endif ( ) + + include_directories( ${INCLUDE_DIR} SYSTEM ${asio_INCLUDE} ${ssl_INCLUDE} ) +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -68,7 +68,7 @@ + + if ( WIN32 ) + add_definitions( -DWIN_DLL_EXPORT ) +- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251" ) ++ #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251" ) + endif ( ) + + # +@@ -75,13 +75,14 @@ + # Build + # + file( GLOB_RECURSE MANIFEST "${SOURCE_DIR}/*.cpp" ) +- ++if(NOT BUILD_SHARED_LIBS) + set( STATIC_LIBRARY_NAME "${PROJECT_NAME}-static" ) + add_library( ${STATIC_LIBRARY_NAME} STATIC ${MANIFEST} ) + set_property( TARGET ${STATIC_LIBRARY_NAME} PROPERTY CXX_STANDARD 14 ) + set_property( TARGET ${STATIC_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON ) + set_target_properties( ${STATIC_LIBRARY_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} ) +- ++target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE asio::asio ) ++else() + set( SHARED_LIBRARY_NAME "${PROJECT_NAME}-shared" ) + add_library( ${SHARED_LIBRARY_NAME} SHARED ${MANIFEST} ) + set_property( TARGET ${SHARED_LIBRARY_NAME} PROPERTY CXX_STANDARD 14 ) +@@ -93,13 +94,20 @@ + set_target_properties( ${SHARED_LIBRARY_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} ) + endif ( ) + set_target_properties( ${SHARED_LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} ) +- ++target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE asio::asio ) ++endif() + if ( BUILD_SSL ) +- target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE ${ssl_LIBRARY_SHARED} ${crypto_LIBRARY_SHARED} ) +- target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE ${ssl_LIBRARY_STATIC} ${crypto_LIBRARY_STATIC} ${CMAKE_DL_LIBS} ) ++if(BUILD_SHARED_LIBS) ++ target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE OpenSSL::SSL $<$:mswsock>) ++else() ++ target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE OpenSSL::SSL ${CMAKE_DL_LIBS} $<$:mswsock>) ++endif() + else ( ) ++if(BUILD_SHARED_LIBS) +- target_link_libraries( ${SHARED_LIBRARY_NAME} ) ++ target_link_libraries( ${SHARED_LIBRARY_NAME} OpenSSL::SSL $<$:mswsock>) ++else() +- target_link_libraries( ${STATIC_LIBRARY_NAME} ${CMAKE_DL_LIBS} ) ++ target_link_libraries( ${STATIC_LIBRARY_NAME} ${CMAKE_DL_LIBS} OpenSSL::SSL $<$:mswsock>) ++endif() + endif ( ) + + if ( BUILD_TESTS ) +@@ -119,5 +127,8 @@ + + install( FILES "${INCLUDE_DIR}/${PROJECT_NAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}/include" ) + install( FILES ${ARTIFACTS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/corvusoft/${PROJECT_NAME}" ) ++if(NOT BUILD_SHARED_LIBS) + install( TARGETS ${STATIC_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) ++else() +-install( TARGETS ${SHARED_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) ++install( TARGETS ${SHARED_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT library ) ++endif() diff --git a/recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch b/recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch new file mode 100644 index 0000000000000..98f35027afdd1 --- /dev/null +++ b/recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch @@ -0,0 +1,12 @@ +--- source/corvusoft/restbed/http.hpp ++++ source/corvusoft/restbed/http.hpp +@@ -40,7 +40,7 @@ + class Response; + class Settings; +- +- class [[deprecated("HTTP client is deprecated; we will release a complimentary client framework at a future date.")]] HTTP_EXPORT Http ++ class HTTP_EXPORT Http; ++ class [[deprecated("HTTP client is deprecated; we will release a complimentary client framework at a future date.")]] Http + { + public: + //Friends diff --git a/recipes/restbed/all/test_package/CMakeLists.txt b/recipes/restbed/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3bad6b5f5053d --- /dev/null +++ b/recipes/restbed/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(restbed REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE restbed::restbed) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/restbed/all/test_package/conanfile.py b/recipes/restbed/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f72d1f660e19f --- /dev/null +++ b/recipes/restbed/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.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/restbed/all/test_package/test_package.cpp b/recipes/restbed/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d4731f4f97f74 --- /dev/null +++ b/recipes/restbed/all/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#include + +#include +#include +#include +#include + +static void post_method_handler( const std::shared_ptr< restbed::Session > session ) +{ + const auto request = session->get_request( ); + + int content_length = request->get_header( "Content-Length", 0 ); + + session->fetch( content_length, [ ]( const std::shared_ptr< restbed::Session > session, const restbed::Bytes & body ) + { + fprintf( stdout, "%.*s\n", ( int ) body.size( ), body.data( ) ); + session->close( restbed::OK, "Hello, World!", { { "Content-Length", "13" } } ); + } ); +} + +int main(int argc, char *argv[]) +{ + auto resource = std::make_shared< restbed::Resource >( ); + resource->set_path( "/resource" ); + resource->set_method_handler( "POST", post_method_handler ); + + auto settings = std::make_shared< restbed::Settings >( ); + settings->set_port( 1984 ); + settings->set_default_header( "Connection", "close" ); + + restbed::Service service; + service.publish( resource ); + + if (argc > 1 && strcmp(argv[1], "run") == 0) { + // Don't start the service to avoid blocking + service.start( settings ); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/restbed/all/test_v1_package/CMakeLists.txt b/recipes/restbed/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/restbed/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/restbed/all/test_v1_package/conanfile.py b/recipes/restbed/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/restbed/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/restbed/config.yml b/recipes/restbed/config.yml new file mode 100644 index 0000000000000..5a6e56bf2599d --- /dev/null +++ b/recipes/restbed/config.yml @@ -0,0 +1,3 @@ +versions: + "4.8": + folder: all diff --git a/recipes/restinio/all/conandata.yml b/recipes/restinio/all/conandata.yml new file mode 100644 index 0000000000000..8eaf747a395e3 --- /dev/null +++ b/recipes/restinio/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "0.6.18": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.18.tar.gz" + sha256: "16fa041f4603746c6cd0f29ab126d02d220034535e7019c6ca1b8b9f58bfeee0" + "0.6.17": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.17.tar.gz" + sha256: "0140b23f50bb964f6917d1f99205476eba92203dc586673bdf2ea48d7406f2c4" + "0.6.16": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.16.tar.gz" + sha256: "b3208d746087ba979f51b3a32e08463718c33d58720247d53ffb5bda99f4f92a" + "0.6.15": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.15.tar.gz" + sha256: "5977e7a21064a42dc690a644adc7ba03037eb4007bfbc36586faf715583967bd" + "0.6.14": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.14.tar.gz + sha256: 9742c051e7199d826697f86e6ba4a9fcb7f00c71a408b5c172134b2206404c4e + "0.6.13": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.13.tar.gz + sha256: 72d7ad40c8d34e69cd79f42145b4059e8a7356114fb13864c3c0ad5a5607b44f + "0.6.12": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.12.tar.gz + sha256: 7176d608afb8e5cd29eec2216e747be262215f5b3ab3df2b3c86e691f1cec79e + "0.6.11": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.11.tar.gz + sha256: 66c25c19efd9dc9683d60f540e9ac09b66245c5afde096fc05ec69cbb502fc5d + "0.6.10": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.10.tar.gz + sha256: dc9cad7e19f1bc255532cee53ab2027c93108c79e27f9fbe971f3ea0b10274a5 + "0.6.9": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.9.tar.gz + sha256: fcb05e15a346b4ff27757b89741289864f82f71affe61364325ce70dddefe31f + "0.6.8.1": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.1.tar.gz + sha256: 6a365ce645fc7188c287602886eba1a99c797e01b734f0c69bcb370b3494b54c + "0.6.8": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.tar.gz + sha256: 92ab0faa9f9de582df787e133acf5c10fb6ab7cecbd96c128997554d8ceda0cd diff --git a/recipes/restinio/all/conanfile.py b/recipes/restinio/all/conanfile.py new file mode 100644 index 0000000000000..16542fcac1126 --- /dev/null +++ b/recipes/restinio/all/conanfile.py @@ -0,0 +1,127 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.files import get, copy, rmdir +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class RestinioConan(ConanFile): + name = "restinio" + license = "BSD-3-Clause" + homepage = "https://github.com/Stiffstream/restinio" + url = "https://github.com/conan-io/conan-center-index" + description = "RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server." + topics = ("http-server", "websockets", "rest", "tls-support") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "asio": ["boost", "standalone"], + "with_openssl": [True, False], + "with_zlib": [True, False], + "with_pcre": [1, 2, None], + } + default_options = { + "asio": "standalone", + "with_openssl": False, + "with_zlib": False, + "with_pcre": None, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("http_parser/2.9.4") + + if Version(self.version) >= "0.6.17": + self.requires("fmt/9.1.0") + elif Version(self.version) >= "0.6.16": + self.requires("fmt/9.0.0") + else: + self.requires("fmt/8.1.1") + + self.requires("expected-lite/0.6.2") + self.requires("optional-lite/3.5.0") + self.requires("string-view-lite/1.6.0") + self.requires("variant-lite/2.0.0") + + if self.options.asio == "standalone": + if Version(self.version) >= "0.6.9": + self.requires("asio/1.22.1") + else: + self.requires("asio/1.16.1") + else: + if Version(self.version) >= "0.6.9": + self.requires("boost/1.81.0") + else: + self.requires("boost/1.73.0") + + if self.options.with_openssl: + self.requires("openssl/1.1.1t") + + if self.options.with_zlib: + self.requires("zlib/1.2.13") + + if self.options.with_pcre == 1: + self.requires("pcre/8.45") + elif self.options.with_pcre == 2: + self.requires("pcre2/10.40") + + def package_id(self): + self.info.clear() + + def validate(self): + minimal_cpp_standard = "14" + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + } + check_min_vs(self, 190) + if not is_msvc(self): + minimum_version = minimal_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{minimal_cpp_standard}, which your compiler does not support." + ) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RESTINIO_INSTALL"] = True + tc.variables["RESTINIO_FIND_DEPS"] = False + tc.variables["RESTINIO_USE_EXTERNAL_EXPECTED_LITE"] = True + tc.variables["RESTINIO_USE_EXTERNAL_OPTIONAL_LITE"] = True + tc.variables["RESTINIO_USE_EXTERNAL_STRING_VIEW_LITE"] = True + tc.variables["RESTINIO_USE_EXTERNAL_VARIANT_LITE"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "dev", "restinio")) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "restinio") + self.cpp_info.set_property("cmake_target_name", "restinio::restinio") + self.cpp_info.defines.extend(["RESTINIO_EXTERNAL_EXPECTED_LITE", "RESTINIO_EXTERNAL_OPTIONAL_LITE", + "RESTINIO_EXTERNAL_STRING_VIEW_LITE", "RESTINIO_EXTERNAL_VARIANT_LITE"]) + if self.options.asio == "boost": + self.cpp_info.defines.append("RESTINIO_USE_BOOST_ASIO") diff --git a/recipes/restinio/all/test_package/CMakeLists.txt b/recipes/restinio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..742ee15cf57c4 --- /dev/null +++ b/recipes/restinio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(restinio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} restinio::restinio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/restinio/all/test_package/conanfile.py b/recipes/restinio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/restinio/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/restinio/all/test_package/test_package.cpp b/recipes/restinio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..085a48fd820bb --- /dev/null +++ b/recipes/restinio/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include + +using namespace restinio; + +int main() { + // Create express router for our service. + auto router = std::make_unique>(); + router->http_get( + R"(/data/meter/:meter_id(\d+))", + [](auto req, auto params) { + const auto qp = parse_query(req->header().query()); + return req->create_response() + .set_body(fmt::format("meter_id={}", cast_to(params["meter_id"]))) + .done(); + }); + + std::cout << "success\n"; + + return 0; +} diff --git a/recipes/restinio/all/test_v1_package/CMakeLists.txt b/recipes/restinio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..259507f226840 --- /dev/null +++ b/recipes/restinio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(restinio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} restinio::restinio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/restinio/all/test_v1_package/conanfile.py b/recipes/restinio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9b63bd176646b --- /dev/null +++ b/recipes/restinio/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/restinio/config.yml b/recipes/restinio/config.yml new file mode 100644 index 0000000000000..c650402f2c503 --- /dev/null +++ b/recipes/restinio/config.yml @@ -0,0 +1,25 @@ +versions: + "0.6.18": + folder: all + "0.6.17": + folder: all + "0.6.16": + folder: all + "0.6.15": + folder: all + "0.6.14": + folder: all + "0.6.13": + folder: all + "0.6.12": + folder: all + "0.6.11": + folder: all + "0.6.10": + folder: all + "0.6.9": + folder: all + "0.6.8.1": + folder: all + "0.6.8": + folder: all diff --git a/recipes/rg-etc1/all/CMakeLists.txt b/recipes/rg-etc1/all/CMakeLists.txt new file mode 100644 index 0000000000000..5f0b2b410ca60 --- /dev/null +++ b/recipes/rg-etc1/all/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +file(GLOB SRCS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.cpp) +file(GLOB HDRS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.h) + +add_library(rg_etc1 ${SRCS_FILES}) +target_include_directories(rg_etc1 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) + +install(TARGETS rg_etc1 + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +install(FILES ${HDRS_FILES} DESTINATION include) diff --git a/recipes/rg-etc1/all/conandata.yml b/recipes/rg-etc1/all/conandata.yml new file mode 100644 index 0000000000000..dcc8a5547f675 --- /dev/null +++ b/recipes/rg-etc1/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20130516": + url: "https://github.com/richgel999/rg-etc1/archive/701f354e19f69f2b7f79cc5c6fdde870467f01bb.tar.gz" + sha256: "0f3be5eafc750bc383ced726b64ebf0342c0d85257e5f9b98881e3c364fb38b4" diff --git a/recipes/rg-etc1/all/conanfile.py b/recipes/rg-etc1/all/conanfile.py new file mode 100644 index 0000000000000..43c69a50b6b5c --- /dev/null +++ b/recipes/rg-etc1/all/conanfile.py @@ -0,0 +1,74 @@ +import os +import glob +from conans import ConanFile, CMake, tools + + +class RgEtc1Conan(ConanFile): + name = "rg-etc1" + description = "A performant, easy to use, and high quality 4x4 pixel block packer/unpacker for the ETC1." + homepage = "https://github.com/richgel999/rg-etc1" + url = "https://github.com/conan-io/conan-center-index" + topics = ("conan", "etc1", "packer", "unpacker") + license = "Zlib" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob('rg-etc1-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def _extract_license(self): + with open(os.path.join(self._source_subfolder, "rg_etc1.h")) as f: + content_lines = f.readlines() + license_content = [] + for i in range(52, 75): + license_content.append(content_lines[i][2:-1]) + tools.save("LICENSE", "\n".join(license_content)) + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self._extract_license() + self.copy(pattern="LICENSE", dst="licenses") + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/rg-etc1/all/test_package/CMakeLists.txt b/recipes/rg-etc1/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/rg-etc1/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/rg-etc1/all/test_package/conanfile.py b/recipes/rg-etc1/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/rg-etc1/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rg-etc1/all/test_package/test_package.cpp b/recipes/rg-etc1/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e74731e4562d6 --- /dev/null +++ b/recipes/rg-etc1/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +#include "rg_etc1.h" + +int main() { + rg_etc1::pack_etc1_block_init(); + return 0; +} diff --git a/recipes/rg-etc1/config.yml b/recipes/rg-etc1/config.yml new file mode 100644 index 0000000000000..54524f9509384 --- /dev/null +++ b/recipes/rg-etc1/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20130516": + folder: all diff --git a/recipes/rgbcx/all/conandata.yml b/recipes/rgbcx/all/conandata.yml new file mode 100644 index 0000000000000..160adf076fcd6 --- /dev/null +++ b/recipes/rgbcx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200415": + url: "https://github.com/richgel999/bc7enc/archive/9f390d12acb9810c5e041e7bb8ad068f2b540415.tar.gz" + sha256: "0c436743735f90b88bc64b94629522e06611f2085716bc3748fc043f940e300a" diff --git a/recipes/rgbcx/all/conanfile.py b/recipes/rgbcx/all/conanfile.py new file mode 100644 index 0000000000000..62f3ee9f485a5 --- /dev/null +++ b/recipes/rgbcx/all/conanfile.py @@ -0,0 +1,34 @@ +import os +import glob +from conans import ConanFile, tools + + +class RgbcxConan(ConanFile): + name = "rgbcx" + description = "High-performance scalar BC1-5 encoders." + homepage = "https://github.com/richgel999/bc7enc" + url = "https://github.com/conan-io/conan-center-index" + topics = ("conan", "BC1", "BC5", "BCx", "encoding") + license = "MIT", "Unlicense" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob('bc7enc-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + def build(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "rgbcx.h"), + "#include ", + "#include \n#include ") + + def package(self): + self.copy("rgbcx.h", dst="include", src=self._source_subfolder) + self.copy("rgbcx_table4.h", dst="include", src=self._source_subfolder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/rgbcx/all/test_package/CMakeLists.txt b/recipes/rgbcx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..454c47bb2cbab --- /dev/null +++ b/recipes/rgbcx/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rgbcx/all/test_package/conanfile.py b/recipes/rgbcx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..be0a94674e5bd --- /dev/null +++ b/recipes/rgbcx/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rgbcx/all/test_package/test_package.cpp b/recipes/rgbcx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..136968a37d7d1 --- /dev/null +++ b/recipes/rgbcx/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#define RGBCX_IMPLEMENTATION +#include "rgbcx.h" + +int main() +{ + rgbcx::init(rgbcx::bc1_approx_mode::cBC1Ideal); + return 0; +} diff --git a/recipes/rgbcx/config.yml b/recipes/rgbcx/config.yml new file mode 100644 index 0000000000000..236a1fbc6be71 --- /dev/null +++ b/recipes/rgbcx/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200415": + folder: all diff --git a/recipes/ring-span-lite/all/conandata.yml b/recipes/ring-span-lite/all/conandata.yml new file mode 100644 index 0000000000000..ecb24a4b876e4 --- /dev/null +++ b/recipes/ring-span-lite/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.6.0": + url: "https://github.com/martinmoene/ring-span-lite/archive/v0.6.0.tar.gz" + sha256: "3248ee40a3147e6ba3cee051a838f727770654ade0c9852b1640f0f40d2e0573" + "0.5.0": + url: "https://github.com/martinmoene/ring-span-lite/archive/v0.5.0.tar.gz" + sha256: "905291306cca14eb6c2493de3b0db1b29a0732b0a01038314767d33af4ef7e77" + "0.4.0": + url: "https://github.com/martinmoene/ring-span-lite/archive/v0.4.0.tar.gz" + sha256: "8aa0ee76b2e296ac26281a97fc988068be52181a0c9bc5e70e0b0e47bb2d1fde" diff --git a/recipes/ring-span-lite/all/conanfile.py b/recipes/ring-span-lite/all/conanfile.py new file mode 100644 index 0000000000000..b99c854a61b09 --- /dev/null +++ b/recipes/ring-span-lite/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +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" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ring-span-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::ring-span-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "ring-span-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "ring-span-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["ringspanlite"].names["cmake_find_package"] = "ring-span-lite" + self.cpp_info.components["ringspanlite"].names["cmake_find_package_multi"] = "ring-span-lite" + self.cpp_info.components["ringspanlite"].set_property("cmake_target_name", "nonstd::ring-span-lite") + self.cpp_info.components["ringspanlite"].bindirs = [] + self.cpp_info.components["ringspanlite"].frameworkdirs = [] + self.cpp_info.components["ringspanlite"].libdirs = [] + self.cpp_info.components["ringspanlite"].resdirs = [] diff --git a/recipes/ring-span-lite/all/test_package/CMakeLists.txt b/recipes/ring-span-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2205b3fc45fb6 --- /dev/null +++ b/recipes/ring-span-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(ring-span-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::ring-span-lite) diff --git a/recipes/ring-span-lite/all/test_package/conanfile.py b/recipes/ring-span-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/ring-span-lite/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/ring-span-lite/all/test_package/test_package.cpp b/recipes/ring-span-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dff908ce6b6b1 --- /dev/null +++ b/recipes/ring-span-lite/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "nonstd/ring_span.hpp" +#include +#include + +template< typename T, size_t N > +inline size_t dim( T (&arr)[N] ) { return N; } + +int main() +{ + double arr[] = { 2.0 , 3.0, 5.0, }; + double coeff[] = { 0.25, 0.5, 0.25 }; + + nonstd::ring_span buffer( arr, arr + dim(arr), arr, dim(arr) ); + + // new sample: + buffer.push_back( 7.0 ); + + if ( 5 != std::inner_product( buffer.begin(), buffer.end(), coeff, 0.0 ) ) + throw std::exception(); +} diff --git a/recipes/ring-span-lite/all/test_v1_package/CMakeLists.txt b/recipes/ring-span-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e14cd0d6387d --- /dev/null +++ b/recipes/ring-span-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ring-span-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::ring-span-lite) diff --git a/recipes/ring-span-lite/all/test_v1_package/conanfile.py b/recipes/ring-span-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ring-span-lite/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/ring-span-lite/config.yml b/recipes/ring-span-lite/config.yml new file mode 100644 index 0000000000000..babcbfb79d964 --- /dev/null +++ b/recipes/ring-span-lite/config.yml @@ -0,0 +1,7 @@ +versions: + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/rmlui/3.3/CMakeLists.txt b/recipes/rmlui/3.3/CMakeLists.txt new file mode 100644 index 0000000000000..525557293822c --- /dev/null +++ b/recipes/rmlui/3.3/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper LANGUAGES CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/rmlui/3.3/conandata.yml b/recipes/rmlui/3.3/conandata.yml new file mode 100644 index 0000000000000..9e1d6a4f0e760 --- /dev/null +++ b/recipes/rmlui/3.3/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.3": + sha256: "b58a8c4fc4128a880471d708ba5b0c7f4389645265c53803824b10d9a4255ec5" + url: "https://github.com/mikke89/RmlUi/archive/3.3.zip" diff --git a/recipes/rmlui/3.3/conanfile.py b/recipes/rmlui/3.3/conanfile.py new file mode 100644 index 0000000000000..1ab6418d87aa9 --- /dev/null +++ b/recipes/rmlui/3.3/conanfile.py @@ -0,0 +1,150 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class RmluiConan(ConanFile): + name = "rmlui" + description = "RmlUi - The HTML/CSS User Interface Library Evolved" + homepage = "https://github.com/mikke89/RmlUi" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + topics = ("conan", "css", "gui", "html", "lua", "rmlui") + settings = "os", "compiler", "build_type", "arch" + options = { + "enable_rtti_and_exceptions": [True, False], + "font_interface": ["freetype", None], + "fPIC": [True, False], + "shared": [True, False], + "with_lua_bindings": [True, False], + "with_thirdparty_containers": [True, False] + } + default_options = { + "enable_rtti_and_exceptions": True, + "font_interface": "freetype", + "fPIC": True, + "shared": False, + "with_lua_bindings": False, + "with_thirdparty_containers": True + } + build_requires = ["cmake/3.23.2"] + exports_sources = ["CMakeLists.txt"] + generators = ["cmake", "cmake_find_package"] + + @property + def _minimum_compilers_version(self): + # Reference: https://en.cppreference.com/w/cpp/compiler_support/14 + return { + "apple-clang": "5.1", + "clang": "3.4", + "gcc": "5", + "intel": "17", + "sun-cc": "5.15", + "Visual Studio": "15" + } + + @property + def _minimum_cpp_standard(self): + return 14 + + 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.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)) + + def requirements(self): + if self.options.font_interface == "freetype": + self.requires("freetype/2.10.1") + + if self.options.with_lua_bindings: + self.requires("lua/5.3.5") + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if not hasattr(self, "_cmake"): + self._cmake = CMake(self) + self._cmake.definitions["BUILD_LUA_BINDINGS"] = self.options.with_lua_bindings + self._cmake.definitions["BUILD_SAMPLES"] = False + self._cmake.definitions["DISABLE_RTTI_AND_EXCEPTIONS"] = not self.options.enable_rtti_and_exceptions + self._cmake.definitions["ENABLE_PRECOMPILED_HEADERS"] = True + self._cmake.definitions["ENABLE_TRACY_PROFILING"] = False + self._cmake.definitions["NO_FONT_INTERFACE_DEFAULT"] = self.options.font_interface is None + self._cmake.definitions["NO_THIRDPARTY_CONTAINERS"] = not self.options.with_thirdparty_containers + + self._cmake.configure() + + return self._cmake + + def _patch_sources(self): + # The *.cmake files that conan generates using cmake_find_package for CMake's find_package to consume use + # different variable naming than described in CMake's documentation, thus the need for most of the replacements. + # References: + # * https://cmake.org/cmake/help/latest/module/FindFreetype.html + # * https://cmake.org/cmake/help/latest/module/FindLua.html + replace_mapping = { + "FREETYPE_FOUND": "Freetype_FOUND", + "FREETYPE_INCLUDE_DIRS": "Freetype_INCLUDE_DIRS", + "FREETYPE_LINK_DIRS": "Freetype_LINK_DIRS", + "FREETYPE_LIBRARY": "Freetype_LIBRARIES", + "LUA_FOUND": "lua_FOUND", + "LUA_INCLUDE_DIR": "lua_INCLUDE_DIR", + "LUA_LIBRARIES": "lua_LIBRARIES", + # disables the built-in generation of package configuration files + "if(PkgHelpers_AVAILABLE)": "if(FALSE)" + } + + cmakelists_path = os.path.join( + self._source_subfolder, "CMakeLists.txt") + + for key, value in replace_mapping.items(): + tools.replace_in_file(cmakelists_path, key, value) + + def build(self): + self._patch_sources() + self._configure_cmake().build() + + def package(self): + self._configure_cmake().install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + if not self.options.enable_rtti_and_exceptions: + self.cpp_info.defines.append("RMLUI_USE_CUSTOM_RTTI") + + if not self.options.shared: + self.cpp_info.defines.append("RMLUI_STATIC_LIB") + + if not self.options.with_thirdparty_containers: + self.cpp_info.defines.append("RMLUI_NO_THIRDPARTY_CONTAINERS") + + self.cpp_info.libs.append("RmlDebugger") + + if self.options.with_lua_bindings: + self.cpp_info.libs.append("RmlControlsLua") + self.cpp_info.libs.append("RmlControls") + + if self.options.with_lua_bindings: + self.cpp_info.libs.append("RmlCoreLua") + self.cpp_info.libs.append("RmlCore") diff --git a/recipes/rmlui/3.3/test_package/CMakeLists.txt b/recipes/rmlui/3.3/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c85e03106ee56 --- /dev/null +++ b/recipes/rmlui/3.3/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_property(TARGET example PROPERTY CXX_STANDARD 14) diff --git a/recipes/rmlui/3.3/test_package/conanfile.py b/recipes/rmlui/3.3/test_package/conanfile.py new file mode 100644 index 0000000000000..28bdcc040b3f4 --- /dev/null +++ b/recipes/rmlui/3.3/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class ConanRmluiTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/rmlui/3.3/test_package/example.cpp b/recipes/rmlui/3.3/test_package/example.cpp new file mode 100644 index 0000000000000..95a656dc0b1bc --- /dev/null +++ b/recipes/rmlui/3.3/test_package/example.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + Rml::Core::Shutdown(); + return 0; +} diff --git a/recipes/rmlui/4.x/CMakeLists.txt b/recipes/rmlui/4.x/CMakeLists.txt new file mode 100644 index 0000000000000..525557293822c --- /dev/null +++ b/recipes/rmlui/4.x/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper LANGUAGES CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/rmlui/4.x/conandata.yml b/recipes/rmlui/4.x/conandata.yml new file mode 100644 index 0000000000000..e272e1d8e0557 --- /dev/null +++ b/recipes/rmlui/4.x/conandata.yml @@ -0,0 +1,37 @@ +sources: + "4.0": + sha256: "39b542e326d5ff2e3dd1782080cc5de2d21d15f70b9321714938824b2b37bc30" + url: "https://github.com/mikke89/RmlUi/archive/refs/tags/4.0.zip" + "4.1": + sha256: "85e934e8ec6fd06c337c1e0e42880bf92ac2a4c326fb69eb76e09699450ca708" + url: "https://github.com/mikke89/RmlUi/archive/refs/tags/4.1.zip" + "4.2": + sha256: "56917a27c5389b2a46018b19ffed117ea6f191461d22dc213d362bcd6abc77a1" + url: "https://github.com/mikke89/RmlUi/archive/refs/tags/4.2.zip" + "4.3": + sha256: "5b378647137e74b7c89dfebb0ea6f173bc83372f7268104b99c420cfc9652a01" + url: "https://github.com/mikke89/RmlUi/archive/refs/tags/4.3.zip" + "4.4": + url: "https://github.com/mikke89/RmlUi/archive/4.4.tar.gz" + sha256: "9e45176e47154616253c4e5c78368f4af4b4379278b73066c3fb5a338f9c655a" +patches: + "4.0": + - patch_file: "patches/4.0-fix-cmake-targets-and-config.patch" + patch_description: "Make external libraries work when provided by conan and remove the generation of a config file" + patch_type: "conan" + "4.1": + - patch_file: "patches/4.1-fix-cmake-targets-and-config.patch" + patch_description: "Make external libraries work when provided by conan and remove the generation of a config file" + patch_type: "conan" + "4.2": + - patch_file: "patches/4.2-fix-cmake-targets-and-config.patch" + patch_description: "Make external libraries work when provided by conan and remove the generation of a config file" + patch_type: "conan" + "4.3": + - patch_file: "patches/4.3-fix-cmake-targets-and-config.patch" + patch_description: "Make external libraries work when provided by conan and remove the generation of a config file" + patch_type: "conan" + "4.4": + - patch_file: "patches/4.4-fix-cmake-targets-and-config.patch" + patch_description: "Make external libraries work when provided by conan and remove the generation of a config file" + patch_type: "conan" diff --git a/recipes/rmlui/4.x/conanfile.py b/recipes/rmlui/4.x/conanfile.py new file mode 100644 index 0000000000000..1bd6398f97698 --- /dev/null +++ b/recipes/rmlui/4.x/conanfile.py @@ -0,0 +1,149 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, replace_in_file, copy, export_conandata_patches, apply_conandata_patches +import os + + +required_conan_version = ">=1.53.0" + +class RmluiConan(ConanFile): + name = "rmlui" + description = "RmlUi - The HTML/CSS User Interface Library Evolved" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mikke89/RmlUi" + topics = ("css", "gui", "html", "lua", "rmlui") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "font_interface": ["freetype", None], + "fPIC": [True, False], + "matrix_mode": ["column_major", "row_major"], + "shared": [True, False], + "with_lua_bindings": [True, False], + "with_thirdparty_containers": [True, False] + } + default_options = { + "font_interface": "freetype", + "fPIC": True, + "matrix_mode": "column_major", + "shared": False, + "with_lua_bindings": False, + "with_thirdparty_containers": True + } + + @property + def _minimum_compilers_version(self): + # Reference: https://en.cppreference.com/w/cpp/compiler_support/14 + return { + "apple-clang": "5.1", + "clang": "3.4", + "gcc": "5", + "intel": "17", + "sun-cc": "5.15", + "Visual Studio": "15" + } + + @property + def _minimum_cpp_standard(self): + return 14 + + 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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + 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] + + min_version = self._minimum_compilers_version.get( + str(self.settings.compiler)) + if not min_version: + self.output.warning(f"{self.ref} recipe lacks information about the {self.settings.compiler} compiler support.") + else: + if lazy_lt_semver(str(self.settings.compiler.version), min_version): + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard} support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + + def requirements(self): + if self.options.font_interface == "freetype": + self.requires("freetype/2.10.4") + + if self.options.with_lua_bindings: + self.requires("lua/5.3.5") + + if self.options.with_thirdparty_containers: + self.requires("robin-hood-hashing/3.11.3", transitive_headers=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_LUA_BINDINGS"] = self.options.with_lua_bindings + tc.cache_variables["BUILD_SAMPLES"] = False + tc.cache_variables["DISABLE_RTTI_AND_EXCEPTIONS"] = False + tc.cache_variables["ENABLE_PRECOMPILED_HEADERS"] = True + tc.cache_variables["ENABLE_TRACY_PROFILING"] = False + tc.cache_variables["MATRIX_ROW_MAJOR"] = self.options.matrix_mode == "row_major" + tc.cache_variables["NO_FONT_INTERFACE_DEFAULT"] = not self.options.font_interface + tc.cache_variables["NO_THIRDPARTY_CONTAINERS"] = not self.options.with_thirdparty_containers + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # If we are using robin_hood hashing provided by conan, we need to change its include path + if self.options.with_thirdparty_containers: + config_path = os.path.join(self.source_folder, + "Include", "RmlUi", "Config", "Config.h") + replace_in_file( + self, config_path, "\"../Core/Containers/robin_hood.h\"", "") + + def build(self): + self._patch_sources() + 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, excludes=("Samples/*", "Tests/*")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + if self.options.matrix_mode == "row_major": + self.cpp_info.defines.append("RMLUI_MATRIX_ROW_MAJOR") + + if not self.options.shared: + self.cpp_info.defines.append("RMLUI_STATIC_LIB") + + if not self.options.with_thirdparty_containers: + self.cpp_info.defines.append("RMLUI_NO_THIRDPARTY_CONTAINERS") + + if self.options.with_lua_bindings: + self.cpp_info.libs.append("RmlLua") + + self.cpp_info.libs.append("RmlDebugger") + self.cpp_info.libs.append("RmlCore") diff --git a/recipes/rmlui/4.x/patches/4.0-fix-cmake-targets-and-config.patch b/recipes/rmlui/4.x/patches/4.0-fix-cmake-targets-and-config.patch new file mode 100644 index 0000000000000..cb97ad8c3eb6e --- /dev/null +++ b/recipes/rmlui/4.x/patches/4.0-fix-cmake-targets-and-config.patch @@ -0,0 +1,88 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -322,21 +322,13 @@ + # FreeType + if(NOT NO_FONT_INTERFACE_DEFAULT) + find_package(Freetype REQUIRED) +- +- if(FREETYPE_FOUND) +- include_directories(${FREETYPE_INCLUDE_DIRS}) +- link_directories(${FREETYPE_LINK_DIRS}) +- list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARY}) +- endif() ++ list(APPEND CORE_LINK_LIBS freetype) + endif() + + # Lua + if(BUILD_LUA_BINDINGS) +- find_package(Lua REQUIRED) +- if(LUA_FOUND) +- include_directories(${LUA_INCLUDE_DIR}) +- list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES}) +- endif() ++ find_package(lua REQUIRED CONFIG) ++ list(APPEND LUA_BINDINGS_LINK_LIBS lua::lua) + endif() + + # rlottie +@@ -445,6 +437,10 @@ + if( MATRIX_ROW_MAJOR ) + target_compile_definitions(RmlCore PUBLIC -DRMLUI_MATRIX_ROW_MAJOR) + endif () ++if ( NOT NO_THIRDPARTY_CONTAINERS ) ++ find_package(robin_hood REQUIRED) ++ target_link_libraries(RmlCore robin_hood::robin_hood) ++endif() + if( CUSTOM_CONFIGURATION AND CUSTOM_LINK_LIBRARIES ) + target_link_libraries(RmlCore PUBLIC ${CUSTOM_LINK_LIBRARIES}) + endif () +@@ -891,49 +887,3 @@ + ) + endif() + endif() +- +-#=================================== +-# Generate Config.cmake files ====== +-#=================================== +- +-# Try to include helper module +-include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE) +- +-# guard against older versions of cmake which do not provide it +-if(PkgHelpers_AVAILABLE) +- set (INCLUDE_INSTALL_DIR "include") +- set (LIB_INSTALL_DIR "lib") +- set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include") +- +- # generate configuration for install tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.install.in +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake +- PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake ) +- install(EXPORT RmlUiTargets +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake) +- +- # generate configuration for build tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.build.in +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake +- INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} +- PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR) +- export(TARGETS ${RMLUI_EXPORTED_TARGETS} +- FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake") +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.") +-else() +- message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library" +- " please update cmake to version which provides CMakePackageConfighelpers module" +- " or write generators for RmlUiConfig.cmake by yourself.") +-endif() diff --git a/recipes/rmlui/4.x/patches/4.1-fix-cmake-targets-and-config.patch b/recipes/rmlui/4.x/patches/4.1-fix-cmake-targets-and-config.patch new file mode 100644 index 0000000000000..6f33ce9a7d1cc --- /dev/null +++ b/recipes/rmlui/4.x/patches/4.1-fix-cmake-targets-and-config.patch @@ -0,0 +1,82 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -323,15 +323,13 @@ + # FreeType + if(NOT NO_FONT_INTERFACE_DEFAULT) + find_package(Freetype REQUIRED) +- list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARIES}) +- list(APPEND CORE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS}) ++ list(APPEND CORE_LINK_LIBS freetype) + endif() + + # Lua + if(BUILD_LUA_BINDINGS) +- find_package(Lua REQUIRED) +- list(APPEND LUA_BINDINGS_INCLUDE_DIRS ${LUA_INCLUDE_DIR}) +- list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES}) ++ find_package(lua REQUIRED CONFIG) ++ list(APPEND LUA_BINDINGS_LINK_LIBS lua::lua) + endif() + + # rlottie +@@ -437,6 +435,10 @@ + if( MATRIX_ROW_MAJOR ) + list(APPEND CORE_PUBLIC_DEFS -DRMLUI_MATRIX_ROW_MAJOR) + endif () ++if ( NOT NO_THIRDPARTY_CONTAINERS ) ++ find_package(robin_hood REQUIRED) ++ target_link_libraries(RmlCore robin_hood::robin_hood) ++endif() + if( CUSTOM_CONFIGURATION AND CUSTOM_LINK_LIBRARIES ) + target_link_libraries(RmlCore PUBLIC ${CUSTOM_LINK_LIBRARIES}) + endif () +@@ -890,49 +892,3 @@ + ) + endif() + endif() +- +-#=================================== +-# Generate Config.cmake files ====== +-#=================================== +- +-# Try to include helper module +-include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE) +- +-# guard against older versions of cmake which do not provide it +-if(PkgHelpers_AVAILABLE) +- set (INCLUDE_INSTALL_DIR "include") +- set (LIB_INSTALL_DIR "lib") +- set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include") +- +- # generate configuration for install tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.install.in +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake +- PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake ) +- install(EXPORT RmlUiTargets +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake) +- +- # generate configuration for build tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.build.in +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake +- INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} +- PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR) +- export(TARGETS ${RMLUI_EXPORTED_TARGETS} +- FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake") +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.") +-else() +- message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library" +- " please update cmake to version which provides CMakePackageConfighelpers module" +- " or write generators for RmlUiConfig.cmake by yourself.") +-endif() diff --git a/recipes/rmlui/4.x/patches/4.2-fix-cmake-targets-and-config.patch b/recipes/rmlui/4.x/patches/4.2-fix-cmake-targets-and-config.patch new file mode 100644 index 0000000000000..6f33ce9a7d1cc --- /dev/null +++ b/recipes/rmlui/4.x/patches/4.2-fix-cmake-targets-and-config.patch @@ -0,0 +1,82 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -323,15 +323,13 @@ + # FreeType + if(NOT NO_FONT_INTERFACE_DEFAULT) + find_package(Freetype REQUIRED) +- list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARIES}) +- list(APPEND CORE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS}) ++ list(APPEND CORE_LINK_LIBS freetype) + endif() + + # Lua + if(BUILD_LUA_BINDINGS) +- find_package(Lua REQUIRED) +- list(APPEND LUA_BINDINGS_INCLUDE_DIRS ${LUA_INCLUDE_DIR}) +- list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES}) ++ find_package(lua REQUIRED CONFIG) ++ list(APPEND LUA_BINDINGS_LINK_LIBS lua::lua) + endif() + + # rlottie +@@ -437,6 +435,10 @@ + if( MATRIX_ROW_MAJOR ) + list(APPEND CORE_PUBLIC_DEFS -DRMLUI_MATRIX_ROW_MAJOR) + endif () ++if ( NOT NO_THIRDPARTY_CONTAINERS ) ++ find_package(robin_hood REQUIRED) ++ target_link_libraries(RmlCore robin_hood::robin_hood) ++endif() + if( CUSTOM_CONFIGURATION AND CUSTOM_LINK_LIBRARIES ) + target_link_libraries(RmlCore PUBLIC ${CUSTOM_LINK_LIBRARIES}) + endif () +@@ -890,49 +892,3 @@ + ) + endif() + endif() +- +-#=================================== +-# Generate Config.cmake files ====== +-#=================================== +- +-# Try to include helper module +-include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE) +- +-# guard against older versions of cmake which do not provide it +-if(PkgHelpers_AVAILABLE) +- set (INCLUDE_INSTALL_DIR "include") +- set (LIB_INSTALL_DIR "lib") +- set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include") +- +- # generate configuration for install tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.install.in +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake +- PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake ) +- install(EXPORT RmlUiTargets +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake) +- +- # generate configuration for build tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.build.in +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake +- INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} +- PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR) +- export(TARGETS ${RMLUI_EXPORTED_TARGETS} +- FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake") +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.") +-else() +- message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library" +- " please update cmake to version which provides CMakePackageConfighelpers module" +- " or write generators for RmlUiConfig.cmake by yourself.") +-endif() diff --git a/recipes/rmlui/4.x/patches/4.3-fix-cmake-targets-and-config.patch b/recipes/rmlui/4.x/patches/4.3-fix-cmake-targets-and-config.patch new file mode 100644 index 0000000000000..ed5a7e097948b --- /dev/null +++ b/recipes/rmlui/4.x/patches/4.3-fix-cmake-targets-and-config.patch @@ -0,0 +1,82 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -328,15 +328,13 @@ + message(WARNING "You are using FreeType version 2.11.0 which introduced an issue that causes a crash on startup on some of the samples. Please avoid this version specifically.") + endif() + +- list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARIES}) +- list(APPEND CORE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS}) ++ list(APPEND CORE_LINK_LIBS freetype) + endif() + + # Lua + if(BUILD_LUA_BINDINGS) +- find_package(Lua REQUIRED) +- list(APPEND LUA_BINDINGS_INCLUDE_DIRS ${LUA_INCLUDE_DIR}) +- list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES}) ++ find_package(lua REQUIRED CONFIG) ++ list(APPEND LUA_BINDINGS_LINK_LIBS lua::lua) + endif() + + # rlottie +@@ -442,6 +440,10 @@ + if( MATRIX_ROW_MAJOR ) + list(APPEND CORE_PUBLIC_DEFS -DRMLUI_MATRIX_ROW_MAJOR) + endif () ++if ( NOT NO_THIRDPARTY_CONTAINERS ) ++ find_package(robin_hood REQUIRED) ++ target_link_libraries(RmlCore robin_hood::robin_hood) ++endif() + if( CUSTOM_CONFIGURATION AND CUSTOM_LINK_LIBRARIES ) + target_link_libraries(RmlCore PUBLIC ${CUSTOM_LINK_LIBRARIES}) + endif () +@@ -895,49 +897,3 @@ + ) + endif() + endif() +- +-#=================================== +-# Generate Config.cmake files ====== +-#=================================== +- +-# Try to include helper module +-include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE) +- +-# guard against older versions of cmake which do not provide it +-if(PkgHelpers_AVAILABLE) +- set (INCLUDE_INSTALL_DIR "include") +- set (LIB_INSTALL_DIR "lib") +- set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include") +- +- # generate configuration for install tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.install.in +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake +- PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake ) +- install(EXPORT RmlUiTargets +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake) +- +- # generate configuration for build tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.build.in +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake +- INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} +- PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR) +- export(TARGETS ${RMLUI_EXPORTED_TARGETS} +- FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake") +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.") +-else() +- message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library" +- " please update cmake to version which provides CMakePackageConfighelpers module" +- " or write generators for RmlUiConfig.cmake by yourself.") +-endif() diff --git a/recipes/rmlui/4.x/patches/4.4-fix-cmake-targets-and-config.patch b/recipes/rmlui/4.x/patches/4.4-fix-cmake-targets-and-config.patch new file mode 100644 index 0000000000000..7aad2d5041e22 --- /dev/null +++ b/recipes/rmlui/4.x/patches/4.4-fix-cmake-targets-and-config.patch @@ -0,0 +1,82 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -328,15 +328,13 @@ + message(WARNING "You are using FreeType version 2.11.0 which introduced an issue that causes a crash on startup on some of the samples. Please avoid this version specifically.") + endif() + +- list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARIES}) +- list(APPEND CORE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS}) ++ list(APPEND CORE_LINK_LIBS freetype) + endif() + + # Lua + if(BUILD_LUA_BINDINGS) +- find_package(Lua REQUIRED) +- list(APPEND LUA_BINDINGS_INCLUDE_DIRS ${LUA_INCLUDE_DIR}) +- list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES}) ++ find_package(lua REQUIRED CONFIG) ++ list(APPEND LUA_BINDINGS_LINK_LIBS lua::lua) + endif() + + # rlottie +@@ -442,6 +440,10 @@ + if( MATRIX_ROW_MAJOR ) + list(APPEND CORE_PUBLIC_DEFS -DRMLUI_MATRIX_ROW_MAJOR) + endif () ++if ( NOT NO_THIRDPARTY_CONTAINERS ) ++ find_package(robin_hood REQUIRED) ++ target_link_libraries(RmlCore PUBLIC robin_hood::robin_hood) ++endif() + if( CUSTOM_CONFIGURATION AND CUSTOM_LINK_LIBRARIES ) + target_link_libraries(RmlCore PUBLIC ${CUSTOM_LINK_LIBRARIES}) + endif () +@@ -909,49 +911,3 @@ + ) + endif() + endif() +- +-#=================================== +-# Generate Config.cmake files ====== +-#=================================== +- +-# Try to include helper module +-include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE) +- +-# guard against older versions of cmake which do not provide it +-if(PkgHelpers_AVAILABLE) +- set (INCLUDE_INSTALL_DIR "include") +- set (LIB_INSTALL_DIR "lib") +- set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include") +- +- # generate configuration for install tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.install.in +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake +- PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake ) +- install(EXPORT RmlUiTargets +- DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake) +- +- # generate configuration for build tree +- configure_package_config_file(${PROJECT_SOURCE_DIR}/CMake/RmlUiConfig.cmake.build.in +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake +- INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} +- PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR) +- export(TARGETS ${RMLUI_EXPORTED_TARGETS} +- FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake") +- write_basic_package_version_file( +- ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion ) +- set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.") +-else() +- message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library" +- " please update cmake to version which provides CMakePackageConfighelpers module" +- " or write generators for RmlUiConfig.cmake by yourself.") +-endif() diff --git a/recipes/rmlui/4.x/test_package/CMakeLists.txt b/recipes/rmlui/4.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e73da164625e9 --- /dev/null +++ b/recipes/rmlui/4.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(rmlui REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_link_libraries(${PROJECT_NAME} PRIVATE rmlui::rmlui) diff --git a/recipes/rmlui/4.x/test_package/conanfile.py b/recipes/rmlui/4.x/test_package/conanfile.py new file mode 100644 index 0000000000000..e5cc6d82624f5 --- /dev/null +++ b/recipes/rmlui/4.x/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class ConanRmluiTestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def configure(self): + self.options[self.tested_reference_str].with_thirdparty_containers = True + + 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/rmlui/4.x/test_package/example.cpp b/recipes/rmlui/4.x/test_package/example.cpp new file mode 100644 index 0000000000000..3d1522e32bacd --- /dev/null +++ b/recipes/rmlui/4.x/test_package/example.cpp @@ -0,0 +1,28 @@ +#include + +class DummyRenderInterface : public Rml::RenderInterface { +public: + virtual void EnableScissorRegion(bool) override {} + virtual void RenderGeometry(Rml::Vertex *, int, int *, int, + Rml::TextureHandle, + const Rml::Vector2f &) override {} + virtual void SetScissorRegion(int, int, int, int) override {} +}; + +class DummySystemInterface : public Rml::SystemInterface { +public: + virtual double GetElapsedTime() override { return 0; } +}; + +int main() { + DummyRenderInterface dummyRenderInterface; + DummySystemInterface dummySystemInterface; + + Rml::SetRenderInterface(&dummyRenderInterface); + Rml::SetSystemInterface(&dummySystemInterface); + + Rml::Initialise(); + Rml::Shutdown(); + + return 0; +} diff --git a/recipes/rmlui/4.x/test_v1_package/CMakeLists.txt b/recipes/rmlui/4.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e8b0466c90698 --- /dev/null +++ b/recipes/rmlui/4.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/rmlui/4.x/test_v1_package/conanfile.py b/recipes/rmlui/4.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..bfe2d3a5c6032 --- /dev/null +++ b/recipes/rmlui/4.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, RunEnvironment, tools +from conan.tools.build import cross_building +import os + +# legacy validation with Conan 1.x +class ConanRmluiTestV1Conan(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/rmlui/config.yml b/recipes/rmlui/config.yml new file mode 100644 index 0000000000000..d749620d53174 --- /dev/null +++ b/recipes/rmlui/config.yml @@ -0,0 +1,13 @@ +versions: + "3.3": + folder: "3.3" + "4.0": + folder: "4.x" + "4.1": + folder: "4.x" + "4.2": + folder: "4.x" + "4.3": + folder: "4.x" + "4.4": + folder: "4.x" diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml new file mode 100644 index 0000000000000..14b0607a44ca3 --- /dev/null +++ b/recipes/roaring/all/conandata.yml @@ -0,0 +1,46 @@ +sources: + "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.9.8": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.8.tar.gz" + sha256: "d83ea18ded541a49f792951a6e71cd20136171ca0a4c15c77ec5cd5b83ca8e63" + "0.9.6": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.6.tar.gz" + sha256: "6d410750eb4ce70db2fa3dc25b7bc33fd4a91a85ef7dff595200d0acef99b1ee" + "0.9.3": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.3.tar.gz" + sha256: "b7534adebf50a554e86b81a2b39459c9921c504e9a876abe00bd741d0a4bc85d" + "0.9.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.0.tar.gz" + sha256: "52c1f56e1f84ffb9ff6cb90fd1d23cfe04926f696ae57e796d0b056fff572693" + "0.8.1": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.8.1.tar.gz" + sha256: "5359f2a051f10e42cea5edc3cb3650fd272e9125e6a0538901cf30619939d4f8" + "0.8.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.8.0.tar.gz" + sha256: "cd6c4770baccfea385c0c6891a8a80133ba26093209740ca0a3eea348aff1a20" + "0.7.3": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.7.3.tar.gz" + sha256: "e3f8115ba44ef0e1eb7b982dc3c3233f08f5f95ec1260169c2ad0ca50e56b656" + "0.6.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.6.0.tar.gz" + sha256: "b8e2499ca9ac6ba0d18dbbcde4bae3752acf81f08ea6309ea2a88d27972dffcf" + "0.5.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.5.0.tar.gz" + sha256: "edab1b1a464e5a361ff622dc833170b2f33729c161aee4c2e53a324ac62ef78f" + "0.4.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.4.0.tar.gz" + sha256: "0faf6ac893694d5c283a729373af74f813989ef0257781636ac4c397b48c1219" + "0.3.4": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.3.4.tar.gz" + sha256: "ddc5899823c46707d7dbf4e4c117a811b0428bdcb84978d9e65ceaefe6f59595" diff --git a/recipes/roaring/all/conanfile.py b/recipes/roaring/all/conanfile.py new file mode 100644 index 0000000000000..485a7146b02ba --- /dev/null +++ b/recipes/roaring/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class RoaringConan(ConanFile): + name = "roaring" + description = "Portable Roaring bitmaps in C and C++" + license = ("Apache-2.0", "MIT") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/RoaringBitmap/CRoaring" + topics = ("bitset", "compression", "index", "format") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_avx": [True, False], + "with_neon": [True, False], + "native_optimization": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_avx": True, + "with_neon": True, + "native_optimization": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ("x86", "x86_64"): + del self.options.with_avx + if not str(self.settings.arch).startswith("arm"): + del self.options.with_neon + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11": + raise ConanInvalidConfiguration( + f"{self.ref} requires at least apple-clang 11 to support runtime dispatching.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ROARING_DISABLE_AVX"] = not self.options.get_safe("with_avx", False) + tc.variables["ROARING_DISABLE_NEON"] = not self.options.get_safe("with_neon", False) + tc.variables["ROARING_DISABLE_NATIVE"] = not self.options.native_optimization + tc.variables["ROARING_BUILD_STATIC"] = not self.options.shared + tc.variables["ENABLE_ROARING_TESTS"] = False + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_MACOSX_RPATH OFF)", "") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "roaring") + self.cpp_info.set_property("cmake_target_name", "roaring::roaring") + self.cpp_info.set_property("pkg_config_name", "roaring") + self.cpp_info.libs = ["roaring"] diff --git a/recipes/roaring/all/test_package/CMakeLists.txt b/recipes/roaring/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..60d328135f926 --- /dev/null +++ b/recipes/roaring/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(roaring REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE roaring::roaring) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(roaring_VERSION VERSION_LESS "0.3.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE "ROARING_NO_NAMESPACE") +endif() diff --git a/recipes/roaring/all/test_package/conanfile.py b/recipes/roaring/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/roaring/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/roaring/all/test_package/test_package.cpp b/recipes/roaring/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..456ab7f7990a4 --- /dev/null +++ b/recipes/roaring/all/test_package/test_package.cpp @@ -0,0 +1,198 @@ +#include +#include +#include + +#include "roaring/roaring.hh" +#include "roaring/roaring.h" + +#ifndef ROARING_NO_NAMESPACE +using namespace roaring; +#endif + +void test_example_cpp(bool copy_on_write) { + // create a new empty bitmap + Roaring r1; + r1.setCopyOnWrite(copy_on_write); + // then we can add values + for (uint32_t i = 100; i < 1000; i++) { + r1.add(i); + } + + // check whether a value is contained + assert(r1.contains(500)); + + // compute how many bits there are: + uint64_t cardinality = r1.cardinality(); + std::cout << "Cardinality = " << cardinality << std::endl; + + // if your bitmaps have long runs, you can compress them by calling + // run_optimize + size_t size = r1.getSizeInBytes(); + r1.runOptimize(); + size_t compact_size = r1.getSizeInBytes(); + + std::cout << "size before run optimize " << size << " bytes, and after " + << compact_size << " bytes." << std::endl; + + // create a new bitmap with varargs + Roaring r2 = Roaring::bitmapOf(5, 1, 2, 3, 5, 6); + + r2.printf(); + printf("\n"); + + // test select + uint32_t element; + r2.select(3, &element); + assert(element == 5); + + assert(r2.minimum() == 1); + + assert(r2.maximum() == 6); + + assert(r2.rank(4) == 3); + + // we can also create a bitmap from a pointer to 32-bit integers + const uint32_t values[] = {2, 3, 4}; + Roaring r3(3, values); + r3.setCopyOnWrite(copy_on_write); + + // we can also go in reverse and go from arrays to bitmaps + uint64_t card1 = r1.cardinality(); + uint32_t *arr1 = new uint32_t[card1]; + assert(arr1 != NULL); + r1.toUint32Array(arr1); + Roaring r1f(card1, arr1); + delete[] arr1; + + // bitmaps shall be equal + assert(r1 == r1f); + + // we can copy and compare bitmaps + Roaring z(r3); + z.setCopyOnWrite(copy_on_write); + assert(r3 == z); + + // we can compute union two-by-two + Roaring r1_2_3 = r1 | r2; + r1_2_3.setCopyOnWrite(copy_on_write); + r1_2_3 |= r3; + + // we can compute a big union + const Roaring *allmybitmaps[] = {&r1, &r2, &r3}; + Roaring bigunion = Roaring::fastunion(3, allmybitmaps); + assert(r1_2_3 == bigunion); + + // we can compute intersection two-by-two + Roaring i1_2 = r1 & r2; + + // we can write a bitmap to a pointer and recover it later + size_t expectedsize = r1.getSizeInBytes(); + char *serializedbytes = new char[expectedsize]; + r1.write(serializedbytes); + Roaring t = Roaring::read(serializedbytes); + assert(expectedsize == t.getSizeInBytes()); + assert(r1 == t); + + Roaring t2 = Roaring::readSafe(serializedbytes, expectedsize); + assert(expectedsize == t2.getSizeInBytes()); + assert(r1 == t2); + + delete[] serializedbytes; + + size_t counter = 0; + for (Roaring::const_iterator i = t.begin(); i != t.end(); i++) { + ++counter; + } + assert(counter == t.cardinality()); + + // we can move iterators + const uint32_t manyvalues[] = {2, 3, 4, 7, 8}; + Roaring rogue(5, manyvalues); + Roaring::const_iterator j = rogue.begin(); + j.equalorlarger(4); + assert(*j == 4); + + // test move constructor + { + Roaring b; + b.add(10); + b.add(20); + + Roaring a(std::move(b)); + assert(a.cardinality() == 2); + assert(a.contains(10)); + assert(a.contains(20)); + + // b should be destroyed without any errors + assert(b.cardinality() == 0); + } + + // test move operator + { + Roaring b; + b.add(10); + b.add(20); + + Roaring a; + + a = std::move(b); + assert(2 == a.cardinality()); + assert(a.contains(10)); + assert(a.contains(20)); + + // b should be destroyed without any errors + assert(0 == b.cardinality()); + } + + // test toString + { + Roaring a; + a.add(1); + a.add(2); + a.add(3); + a.add(4); + + } +} + +int main() { + Roaring r1; + // then we can add values + for (uint32_t i = 100; i < 1000; i++) { + r1.add(i); + } + + // check whether a value is contained + assert(r1.contains(500)); + + // compute how many bits there are: + uint64_t cardinality = r1.cardinality(); + std::cout << "Cardinality = " << cardinality << std::endl; + + // if your bitmaps have long runs, you can compress them by calling + // run_optimize + size_t size = r1.getSizeInBytes(); + r1.runOptimize(); + size_t compact_size = r1.getSizeInBytes(); + + std::cout << "size before run optimize " << size << " bytes, and after " + << compact_size << " bytes." << std::endl; + + // create a new bitmap with varargs + Roaring r2 = Roaring::bitmapOf(5, 1, 2, 3, 5, 6); + + r2.printf(); + printf("\n"); + + // test select + uint32_t element; + r2.select(3, &element); + assert(element == 5); + + assert(r2.minimum() == 1); + + assert(r2.maximum() == 6); + + assert(r2.rank(4) == 3); + return EXIT_SUCCESS; +} diff --git a/recipes/roaring/all/test_v1_package/CMakeLists.txt b/recipes/roaring/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/roaring/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/roaring/all/test_v1_package/conanfile.py b/recipes/roaring/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1d4478bedc297 --- /dev/null +++ b/recipes/roaring/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type", + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml new file mode 100644 index 0000000000000..d61f68fe0a402 --- /dev/null +++ b/recipes/roaring/config.yml @@ -0,0 +1,31 @@ +versions: + "1.1.2": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.9.9": + folder: all + "0.9.8": + folder: all + "0.9.6": + folder: all + "0.9.3": + folder: all + "0.9.0": + folder: all + "0.8.1": + folder: all + "0.8.0": + folder: all + "0.7.3": + folder: all + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all + "0.3.4": + folder: all diff --git a/recipes/robin-hood-hashing/all/conandata.yml b/recipes/robin-hood-hashing/all/conandata.yml new file mode 100644 index 0000000000000..b2a3052ae54cb --- /dev/null +++ b/recipes/robin-hood-hashing/all/conandata.yml @@ -0,0 +1,39 @@ +sources: + "3.11.5": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.11.5.tar.gz" + sha256: "3693e44dda569e9a8b87ce8263f7477b23af448a3c3600c8ab9004fe79c20ad0" + "3.11.4": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.11.4.tar.gz" + sha256: "99d3624069a0b06df2675b4ba9d2ebac1a1236dbc52326cd6f31ca056c24eb89" + "3.11.3": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.11.3.tar.gz" + sha256: "dcf2b7fa9ef9dd0c67102d94c28e8df3effbe1845e0ed1f31f4772ca5e857fc4" + "3.11.1": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.11.1.tar.gz" + sha256: "31143d316b49e29b57773e720ec9ac3f7a8223dc7710329b566c874c69e1d087" + "3.9.1": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.9.1.tar.gz" + sha256: "d6d15546a58d170717b2be5311425f80dc06f087a0885bd95de61a727bf9adef" + "3.8.0": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.8.0.tar.gz" + sha256: "422a0727b07cd495bf90ecbb15d4aa64e209f0accc8eba51a121843fd32abaf9" + "3.7.0": + url: "https://github.com/martinus/robin-hood-hashing/archive/refs/tags/3.7.0.tar.gz" + sha256: "1c4a107865becbabc0da337f9cf06f3aa6112f733efcbed0703238362a25b330" +patches: + "3.11.1": + - patch_file: "patches/3.11.1-0001-fix-missing-limits-include.patch" + patch_description: "Add missing limits include" + patch_type: "portability" + "3.9.1": + - patch_file: "patches/3.9.1-0001-fix-missing-limits-include.patch" + patch_description: "Add missing limits include" + patch_type: "portability" + "3.8.0": + - patch_file: "patches/3.8.0-0001-fix-missing-limits-include.patch" + patch_description: "Add missing limits include" + patch_type: "portability" + "3.7.0": + - patch_file: "patches/3.7.0-0001-fix-missing-limits-include.patch" + patch_description: "Add missing limits include" + patch_type: "portability" diff --git a/recipes/robin-hood-hashing/all/conanfile.py b/recipes/robin-hood-hashing/all/conanfile.py new file mode 100644 index 0000000000000..50472c6e29a8f --- /dev/null +++ b/recipes/robin-hood-hashing/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class RobinHoodHashingConan(ConanFile): + name = "robin-hood-hashing" + description = "Faster and more efficient replacement for std::unordered_map / std::unordered_set" + topics = ("robin-hood-hashing", "header-only", "containers") + homepage = "https://github.com/martinus/robin-hood-hashing" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + 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, "robin_hood.h", src=os.path.join(self.source_folder, "src", "include"), + dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "robin_hood") + self.cpp_info.set_property("cmake_target_name", "robin_hood::robin_hood") + 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"] = "robin_hood" + self.cpp_info.names["cmake_find_package_multi"] = "robin_hood" diff --git a/recipes/robin-hood-hashing/all/patches/3.11.1-0001-fix-missing-limits-include.patch b/recipes/robin-hood-hashing/all/patches/3.11.1-0001-fix-missing-limits-include.patch new file mode 100644 index 0000000000000..eafff0438a4cc --- /dev/null +++ b/recipes/robin-hood-hashing/all/patches/3.11.1-0001-fix-missing-limits-include.patch @@ -0,0 +1,10 @@ +--- a/src/include/robin_hood.h ++++ b/src/include/robin_hood.h +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + #include // only to support hash of smart pointers + #include + #include diff --git a/recipes/robin-hood-hashing/all/patches/3.7.0-0001-fix-missing-limits-include.patch b/recipes/robin-hood-hashing/all/patches/3.7.0-0001-fix-missing-limits-include.patch new file mode 100644 index 0000000000000..f9bbca512bff4 --- /dev/null +++ b/recipes/robin-hood-hashing/all/patches/3.7.0-0001-fix-missing-limits-include.patch @@ -0,0 +1,10 @@ +--- a/src/include/robin_hood.h ++++ b/src/include/robin_hood.h +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/recipes/robin-hood-hashing/all/patches/3.8.0-0001-fix-missing-limits-include.patch b/recipes/robin-hood-hashing/all/patches/3.8.0-0001-fix-missing-limits-include.patch new file mode 100644 index 0000000000000..3c731c48ad9d6 --- /dev/null +++ b/recipes/robin-hood-hashing/all/patches/3.8.0-0001-fix-missing-limits-include.patch @@ -0,0 +1,10 @@ +--- a/src/include/robin_hood.h ++++ b/src/include/robin_hood.h +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + #include // only to support hash of smart pointers + #include + #include diff --git a/recipes/robin-hood-hashing/all/patches/3.9.1-0001-fix-missing-limits-include.patch b/recipes/robin-hood-hashing/all/patches/3.9.1-0001-fix-missing-limits-include.patch new file mode 100644 index 0000000000000..eafff0438a4cc --- /dev/null +++ b/recipes/robin-hood-hashing/all/patches/3.9.1-0001-fix-missing-limits-include.patch @@ -0,0 +1,10 @@ +--- a/src/include/robin_hood.h ++++ b/src/include/robin_hood.h +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + #include // only to support hash of smart pointers + #include + #include diff --git a/recipes/robin-hood-hashing/all/test_package/CMakeLists.txt b/recipes/robin-hood-hashing/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c5737c42bfb29 --- /dev/null +++ b/recipes/robin-hood-hashing/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(robin_hood REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE robin_hood::robin_hood) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/robin-hood-hashing/all/test_package/conanfile.py b/recipes/robin-hood-hashing/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/robin-hood-hashing/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/robin-hood-hashing/all/test_package/test_package.cpp b/recipes/robin-hood-hashing/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1370626a33e37 --- /dev/null +++ b/recipes/robin-hood-hashing/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() { + + const robin_hood::unordered_map map = {{1,1}}; + const robin_hood::unordered_flat_map flat_map = {{1,1}}; + const robin_hood::unordered_node_map node_map = {{1,1}}; + const robin_hood::unordered_set set = {1,1}; + + std::cout << "robin-hood-hashing test success.\n"; +} diff --git a/recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt b/recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/robin-hood-hashing/all/test_v1_package/conanfile.py b/recipes/robin-hood-hashing/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b5c4f7e93cf63 --- /dev/null +++ b/recipes/robin-hood-hashing/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_find_package_multi", "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/robin-hood-hashing/config.yml b/recipes/robin-hood-hashing/config.yml new file mode 100644 index 0000000000000..82de5fd6e0c45 --- /dev/null +++ b/recipes/robin-hood-hashing/config.yml @@ -0,0 +1,15 @@ +versions: + "3.11.5": + folder: all + "3.11.4": + folder: all + "3.11.3": + folder: all + "3.11.1": + folder: all + "3.9.1": + folder: all + "3.8.0": + folder: all + "3.7.0": + folder: all diff --git a/recipes/rocksdb/all/CMakeLists.txt b/recipes/rocksdb/all/CMakeLists.txt new file mode 100644 index 0000000000000..f287ed21516c7 --- /dev/null +++ b/recipes/rocksdb/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.9) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/rocksdb/all/conandata.yml b/recipes/rocksdb/all/conandata.yml new file mode 100644 index 0000000000000..2e0d65d48f078 --- /dev/null +++ b/recipes/rocksdb/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "6.29.5": + url: "https://github.com/facebook/rocksdb/archive/v6.29.5.tar.gz" + sha256: "ddbf84791f0980c0bbce3902feb93a2c7006f6f53bfd798926143e31d4d756f0" + "6.27.3": + url: "https://github.com/facebook/rocksdb/archive/v6.27.3.tar.gz" + sha256: "ee29901749b9132692b26f0a6c1d693f47d1a9ed8e3771e60556afe80282bf58" + "6.20.3": + url: "https://github.com/facebook/rocksdb/archive/v6.20.3.tar.gz" + sha256: "c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca" + "6.10.2": + url: "https://github.com/facebook/rocksdb/archive/v6.10.2.tar.gz" + sha256: "514b315c64159dd767bbbf6430d33313903c0c9240d4249bddead5c4297d128f" + "6.8.1": + url: "https://github.com/facebook/rocksdb/archive/v6.8.1.tar.gz" + sha256: "ca192a06ed3bcb9f09060add7e9d0daee1ae7a8705a3d5ecbe41867c5e2796a2" + "6.0.2": + url: "https://github.com/facebook/rocksdb/archive/v6.0.2.tar.gz" + sha256: "89e0832f1fb00ac240a9438d4bbdae37dd3e52f7c15c3f646dc26887da16f342" +patches: + "6.29.5": + - patch_file: "patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch" + base_path: "source_subfolder" + "6.27.3": + - patch_file: "patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch" + base_path: "source_subfolder" + "6.20.3": + - patch_file: "patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch" + base_path: "source_subfolder" + "6.10.2": + - patch_file: "patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch" + base_path: "source_subfolder" + "6.8.1": + - patch_file: "patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch" + base_path: "source_subfolder" + "6.0.2": + - patch_file: "patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch" + base_path: "source_subfolder" diff --git a/recipes/rocksdb/all/conanfile.py b/recipes/rocksdb/all/conanfile.py new file mode 100644 index 0000000000000..b10e35fb91648 --- /dev/null +++ b/recipes/rocksdb/all/conanfile.py @@ -0,0 +1,241 @@ +from conan.tools.microsoft import msvc_runtime_flag +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import glob +import shutil + +required_conan_version = ">=1.43.0" + + +class RocksDB(ConanFile): + name = "rocksdb" + homepage = "https://github.com/facebook/rocksdb" + license = ("GPL-2.0-only", "Apache-2.0") + url = "https://github.com/conan-io/conan-center-index" + description = "A library that provides an embeddable, persistent key-value store for fast storage" + topics = ("rocksdb", "database", "leveldb", "facebook", "key-value") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "lite": [True, False], + "with_gflags": [True, False], + "with_snappy": [True, False], + "with_lz4": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_tbb": [True, False], + "with_jemalloc": [True, False], + "enable_sse": [False, "sse42", "avx2"], + "use_rtti": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "lite": False, + "with_snappy": False, + "with_lz4": False, + "with_zlib": False, + "with_zstd": False, + "with_gflags": False, + "with_tbb": False, + "with_jemalloc": False, + "enable_sse": False, + "use_rtti": False, + } + + generators = "cmake", "cmake_find_package" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + if self.settings.arch != "x86_64": + del self.options.with_tbb + if self.settings.build_type == "Debug": + self.options.use_rtti = True # Rtti are used in asserts for debug mode... + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_gflags: + self.requires("gflags/2.2.2") + if self.options.with_snappy: + self.requires("snappy/1.1.9") + if self.options.with_lz4: + self.requires("lz4/1.9.3") + if self.options.with_zlib: + self.requires("zlib/1.2.12") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + if self.options.get_safe("with_tbb"): + self.requires("onetbb/2020.3") + if self.options.with_jemalloc: + self.requires("jemalloc/5.2.1") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + if self.settings.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: + raise ConanInvalidConfiguration("Rocksdb requires 64 bits") + + if self.settings.os == "Windows" and \ + self.settings.compiler == "Visual Studio" and \ + tools.Version(self.settings.compiler.version) < "15": + raise ConanInvalidConfiguration("Rocksdb requires Visual Studio 15 or later.") + + if self.version == "6.0.2" and \ + self.settings.os == "Windows" and \ + self.settings.compiler == "Visual Studio" and \ + tools.Version(self.settings.compiler.version) > "15": + raise ConanInvalidConfiguration("Rocksdb 6.0.2 is not compilable with Visual Studio >15.") # See https://github.com/facebook/rocksdb/issues/6048 + + if self.version == "6.0.2" and \ + self.settings.os == "Linux" and \ + self.settings.compiler == "clang" and \ + tools.Version(self.settings.compiler.version) > "9": + raise ConanInvalidConfiguration("Rocksdb 6.0.2 is not compilable with clang >9.") # See https://github.com/facebook/rocksdb/pull/7265 + + if self.version == "6.20.3" and \ + self.settings.os == "Linux" and \ + self.settings.compiler == "gcc" and \ + tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Rocksdb 6.20.3 is not compilable with gcc <5.") # See https://github.com/facebook/rocksdb/issues/3522 + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + + self._cmake.definitions["FAIL_ON_WARNINGS"] = False + self._cmake.definitions["WITH_TESTS"] = False + self._cmake.definitions["WITH_TOOLS"] = False + self._cmake.definitions["WITH_CORE_TOOLS"] = False + self._cmake.definitions["WITH_BENCHMARK_TOOLS"] = False + self._cmake.definitions["WITH_FOLLY_DISTRIBUTED_MUTEX"] = False + if self._is_msvc: + self._cmake.definitions["WITH_MD_LIBRARY"] = "MD" in msvc_runtime_flag(self) + self._cmake.definitions["ROCKSDB_INSTALL_ON_WINDOWS"] = self.settings.os == "Windows" + self._cmake.definitions["ROCKSDB_LITE"] = self.options.lite + self._cmake.definitions["WITH_GFLAGS"] = self.options.with_gflags + self._cmake.definitions["WITH_SNAPPY"] = self.options.with_snappy + self._cmake.definitions["WITH_LZ4"] = self.options.with_lz4 + self._cmake.definitions["WITH_ZLIB"] = self.options.with_zlib + self._cmake.definitions["WITH_ZSTD"] = self.options.with_zstd + self._cmake.definitions["WITH_TBB"] = self.options.get_safe("with_tbb", False) + self._cmake.definitions["WITH_JEMALLOC"] = self.options.with_jemalloc + self._cmake.definitions["ROCKSDB_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["ROCKSDB_LIBRARY_EXPORTS"] = self.settings.os == "Windows" and self.options.shared + self._cmake.definitions["ROCKSDB_DLL" ] = self.settings.os == "Windows" and self.options.shared + + self._cmake.definitions["USE_RTTI"] = self.options.use_rtti + if self.options.enable_sse == "False": + self._cmake.definitions["PORTABLE"] = True + self._cmake.definitions["FORCE_SSE42"] = False + elif self.options.enable_sse == "sse42": + self._cmake.definitions["PORTABLE"] = True + self._cmake.definitions["FORCE_SSE42"] = True + elif self.options.enable_sse == "avx2": + self._cmake.definitions["PORTABLE"] = False + self._cmake.definitions["FORCE_SSE42"] = False + + # not available yet in CCI + + self._cmake.definitions["WITH_NUMA"] = False + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-march=armv8-a" + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def _remove_static_libraries(self): + for static_lib_name in ["lib*.a", "rocksdb.lib"]: + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), static_lib_name) + + def _remove_cpp_headers(self): + for path in glob.glob(os.path.join(self.package_folder, "include", "rocksdb", "*")): + if path != os.path.join(self.package_folder, "include", "rocksdb", "c.h"): + if os.path.isfile(path): + os.remove(path) + else: + shutil.rmtree(path) + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + if self.options.shared: + self._remove_static_libraries() + self._remove_cpp_headers() # Force stable ABI for shared libraries + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + cmake_target = "rocksdb-shared" if self.options.shared else "rocksdb" + self.cpp_info.set_property("cmake_file_name", "RocksDB") + self.cpp_info.set_property("cmake_target_name", "RocksDB::{}".format(cmake_target)) + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["librocksdb"].libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.components["librocksdb"].system_libs = ["shlwapi", "rpcrt4"] + if self.options.shared: + self.cpp_info.components["librocksdb"].defines = ["ROCKSDB_DLL"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["librocksdb"].system_libs = ["pthread", "m"] + if self.options.lite: + self.cpp_info.components["librocksdb"].defines.append("ROCKSDB_LITE") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "RocksDB" + self.cpp_info.names["cmake_find_package_multi"] = "RocksDB" + self.cpp_info.components["librocksdb"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["librocksdb"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["librocksdb"].set_property("cmake_target_name", "RocksDB::{}".format(cmake_target)) + if self.options.with_gflags: + self.cpp_info.components["librocksdb"].requires.append("gflags::gflags") + if self.options.with_snappy: + self.cpp_info.components["librocksdb"].requires.append("snappy::snappy") + if self.options.with_lz4: + self.cpp_info.components["librocksdb"].requires.append("lz4::lz4") + if self.options.with_zlib: + self.cpp_info.components["librocksdb"].requires.append("zlib::zlib") + if self.options.with_zstd: + self.cpp_info.components["librocksdb"].requires.append("zstd::zstd") + if self.options.get_safe("with_tbb"): + self.cpp_info.components["librocksdb"].requires.append("onetbb::onetbb") + if self.options.with_jemalloc: + self.cpp_info.components["librocksdb"].requires.append("jemalloc::jemalloc") diff --git a/recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch new file mode 100644 index 0000000000000..fa3904b84954a --- /dev/null +++ b/recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch @@ -0,0 +1,9 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -66,5 +66,5 @@ else() + set(WITH_JEMALLOC ON) + else() + if(WITH_JEMALLOC) +- find_package(JeMalloc REQUIRED) ++ find_package(jemalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) diff --git a/recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch new file mode 100644 index 0000000000000..2e8cfd1a8a8aa --- /dev/null +++ b/recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -101,9 +101,9 @@ else() + set(WITH_JEMALLOC ON) + else() + if(WITH_JEMALLOC) +- find_package(JeMalloc REQUIRED) ++ find_package(jemalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) +- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) ++ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) + endif() + endif() + diff --git a/recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch new file mode 100644 index 0000000000000..99195907c0c6a --- /dev/null +++ b/recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -100,9 +100,9 @@ else() + set(WITH_JEMALLOC ON) + else() + if(WITH_JEMALLOC) +- find_package(JeMalloc REQUIRED) ++ find_package(jemalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) +- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) ++ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) + endif() + endif() + diff --git a/recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch new file mode 100644 index 0000000000000..862805a12fdf1 --- /dev/null +++ b/recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -108,9 +108,9 @@ else() + set(WITH_JEMALLOC ON) + else() + if(WITH_JEMALLOC) +- find_package(JeMalloc REQUIRED) ++ find_package(jemalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) +- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) ++ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) + endif() + endif() + diff --git a/recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch new file mode 100644 index 0000000000000..862805a12fdf1 --- /dev/null +++ b/recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -108,9 +108,9 @@ else() + set(WITH_JEMALLOC ON) + else() + if(WITH_JEMALLOC) +- find_package(JeMalloc REQUIRED) ++ find_package(jemalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) +- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) ++ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) + endif() + endif() + diff --git a/recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch new file mode 100644 index 0000000000000..acaacf5868a66 --- /dev/null +++ b/recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -97,9 +97,9 @@ else() + set(WITH_JEMALLOC ON) + else() + if(WITH_JEMALLOC) +- find_package(JeMalloc REQUIRED) ++ find_package(jemalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) +- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) ++ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) + endif() + endif() + diff --git a/recipes/rocksdb/all/test_package/CMakeLists.txt b/recipes/rocksdb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cab2ad0ef9d57 --- /dev/null +++ b/recipes/rocksdb/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(RocksDB REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_stable_abi test_package_stable_abi.cpp) +if(ROCKSDB_SHARED) + target_link_libraries(${PROJECT_NAME}_stable_abi RocksDB::rocksdb-shared) +else() + target_link_libraries(${PROJECT_NAME}_stable_abi RocksDB::rocksdb) + + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp RocksDB::rocksdb) + set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) +endif() diff --git a/recipes/rocksdb/all/test_package/conanfile.py b/recipes/rocksdb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..326ef695da52e --- /dev/null +++ b/recipes/rocksdb/all/test_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.definitions["ROCKSDB_SHARED"] = self.options["rocksdb"].shared + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + if not self.options["rocksdb"].shared: + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) + + bin_path = os.path.join("bin", "test_package_stable_abi") + self.run(bin_path, run_environment=True) diff --git a/recipes/rocksdb/all/test_package/test_package.cpp b/recipes/rocksdb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8b0956584b32a --- /dev/null +++ b/recipes/rocksdb/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include "rocksdb/db.h" + +int main() { + rocksdb::DB* db; + rocksdb::Options options; + options.create_if_missing = true; + rocksdb::Status status = rocksdb::DB::Open(options, "testdb", &db); + + if (!status.ok()) { + std::cerr << "DB error: " << status.ToString() << std::endl; + } + delete db; + return EXIT_SUCCESS; +} diff --git a/recipes/rocksdb/all/test_package/test_package_stable_abi.cpp b/recipes/rocksdb/all/test_package/test_package_stable_abi.cpp new file mode 100644 index 0000000000000..92a984477f09e --- /dev/null +++ b/recipes/rocksdb/all/test_package/test_package_stable_abi.cpp @@ -0,0 +1,26 @@ +#include +#include +#include "rocksdb/c.h" + +int main() { + rocksdb_options_t *options = rocksdb_options_create(); + rocksdb_options_set_create_if_missing(options, 1); + char* err = NULL; + rocksdb_t* db = rocksdb_open(options, "testdb_stable", &err); + + if (!db) { + printf("DB error: %s\n", err); + } else { + rocksdb_close(db); + } + + if(err) { + rocksdb_free(err); + } + + if(options) { + rocksdb_free(options); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/rocksdb/config.yml b/recipes/rocksdb/config.yml new file mode 100644 index 0000000000000..51a8046980930 --- /dev/null +++ b/recipes/rocksdb/config.yml @@ -0,0 +1,13 @@ +versions: + "6.29.5": + folder: all + "6.27.3": + folder: all + "6.20.3": + folder: all + "6.10.2": + folder: all + "6.8.1": + folder: all + "6.0.2": + folder: all diff --git a/recipes/rotor/all/CMakeLists.txt b/recipes/rotor/all/CMakeLists.txt new file mode 100644 index 0000000000000..21a448891f3b0 --- /dev/null +++ b/recipes/rotor/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder/) diff --git a/recipes/rotor/all/conandata.yml b/recipes/rotor/all/conandata.yml new file mode 100644 index 0000000000000..b1d2937ec9c70 --- /dev/null +++ b/recipes/rotor/all/conandata.yml @@ -0,0 +1,13 @@ +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" diff --git a/recipes/rotor/all/conanfile.py b/recipes/rotor/all/conanfile.py new file mode 100644 index 0000000000000..373e87fb89eb0 --- /dev/null +++ b/recipes/rotor/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.scm import Version +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, copy +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout + +required_conan_version = ">=1.52.0" + +class RotorConan(ConanFile): + name = "rotor" + license = "MIT" + homepage = "https://github.com/basiliscos/cpp-rotor" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "Event loop friendly C++ actor micro-framework, supervisable" + ) + topics = ("concurrency", "actor-framework", "actors", "actor-model", "erlang", "supervising", "supervisor") + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + "enable_asio": [True, False], + "enable_thread": [True, False], + "multithreading": [True, False], # enables multithreading support + } + default_options = { + "fPIC": True, + "shared": False, + "enable_asio": False, + "enable_thread": False, + "multithreading": 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: + try: + del self.options.fPIC + except Exception: + pass + + def requirements(self): + self.requires("boost/1.81.0") + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BOOST_ASIO"] = self.options.enable_asio + tc.variables["BUILD_THREAD"] = self.options.enable_thread + tc.variables["BUILD_THREAD_UNSAFE"] = not self.options.multithreading + tc.variables["BUILD_TESTING"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def validate(self): + minimal_cpp_standard = "17" + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + f"{self.ref} recipe lacks information about the {compiler} compiler standard version support") + self.output.warn( + f"{self.ref} requires a compiler that supports at least C++{minimal_cpp_standard}") + return + + compiler_version = Version(self.settings.compiler.version) + if compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration(f"{self.ref} requires a compiler that supports at least C++{minimal_cpp_standard}") + + if self.options.shared and Version(self.version) < "0.23": + raise ConanInvalidConfiguration("shared option is available from v0.23") + + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.components["core"].libs = ["rotor"] + self.cpp_info.components["core"].requires = ["boost::date_time", "boost::system", "boost::regex"] + + if not self.options.multithreading: + self.cpp_info.components["core"].defines.append("BUILD_THREAD_UNSAFE") + + if self.options.enable_asio: + self.cpp_info.components["asio"].libs = ["rotor_asio"] + self.cpp_info.components["asio"].requires = ["core"] + + if self.options.enable_thread: + self.cpp_info.components["thread"].libs = ["rotor_thread"] + self.cpp_info.components["thread"].requires = ["core"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "rotor" diff --git a/recipes/rotor/all/test_package/CMakeLists.txt b/recipes/rotor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b48e565513a1d --- /dev/null +++ b/recipes/rotor/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) +find_package("rotor" REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_link_libraries(${PROJECT_NAME} rotor::core) + + diff --git a/recipes/rotor/all/test_package/conanfile.py b/recipes/rotor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6dfcc57d996c4 --- /dev/null +++ b/recipes/rotor/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + 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/rotor/all/test_package/test_package.cpp b/recipes/rotor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bfb89c9986e86 --- /dev/null +++ b/recipes/rotor/all/test_package/test_package.cpp @@ -0,0 +1,58 @@ +#include +#include + + +namespace { +namespace to { +struct on_timer_trigger {}; +} // namespace to +} // namespace + +namespace rotor { +template <> +inline auto rotor::actor_base_t::access(request_id_t request_id, + bool cancelled) noexcept { + on_timer_trigger(request_id, cancelled); +} +} // namespace rotor + +struct dummy_supervisor_t : public rotor::supervisor_t { + using rotor::supervisor_t::supervisor_t; + using timers_map_t = std::unordered_map; + + timers_map_t timers_map; + + void do_start_timer(const rotor::pt::time_duration &, rotor::timer_handler_base_t &handler) noexcept override { + timers_map.emplace(handler.request_id, &handler); + } + + void do_cancel_timer(rotor::request_id_t timer_id) noexcept override { + auto it = timers_map.find(timer_id); + auto &actor_ptr = it->second->owner; + actor_ptr->access(timer_id, true); + timers_map.erase(it); + } + + void start() noexcept override {} + void shutdown() noexcept override {} + void enqueue(rotor::message_ptr_t) noexcept override {} +}; + +struct hello_actor : public rotor::actor_base_t { + using rotor::actor_base_t::actor_base_t; + void on_start() noexcept override { + rotor::actor_base_t::on_start(); + std::cout << "hello world\n"; + supervisor->do_shutdown(); + } +}; + +int main() { + rotor::system_context_t ctx{}; + auto timeout = boost::posix_time::milliseconds{500}; /* does not matter */ + auto sup = ctx.create_supervisor().timeout(timeout).finish(); + sup->create_actor().timeout(timeout).finish(); + sup->do_process(); + return 0; +} + diff --git a/recipes/rotor/config.yml b/recipes/rotor/config.yml new file mode 100644 index 0000000000000..1dfb74272e8cc --- /dev/null +++ b/recipes/rotor/config.yml @@ -0,0 +1,9 @@ +versions: + "0.21": + folder: all + "0.23": + folder: all + "0.24": + folder: all + "0.25": + folder: all diff --git a/recipes/rpclib/all/CMakeLists.txt b/recipes/rpclib/all/CMakeLists.txt new file mode 100644 index 0000000000000..de7e444eb2469 --- /dev/null +++ b/recipes/rpclib/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) + +conan_basic_setup() +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory("source_subfolder") diff --git a/recipes/rpclib/all/conandata.yml b/recipes/rpclib/all/conandata.yml new file mode 100644 index 0000000000000..696b41e86b171 --- /dev/null +++ b/recipes/rpclib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.0": + url: "https://github.com/rpclib/rpclib/archive/refs/tags/v2.3.0.tar.gz" + sha256: "eb9e6fa65e1a79b37097397f60599b93cb443d304fbc0447c50851bc3452fdef" diff --git a/recipes/rpclib/all/conanfile.py b/recipes/rpclib/all/conanfile.py new file mode 100644 index 0000000000000..30a8488efd8a1 --- /dev/null +++ b/recipes/rpclib/all/conanfile.py @@ -0,0 +1,87 @@ +from conans import ConanFile, tools, CMake +from conan.tools.microsoft import msvc_runtime_flag +import os + +required_conan_version = ">=1.43.0" + + +class rpclibConan(ConanFile): + name = "rpclib" + description = "A modern C++ msgpack-RPC server and client library." + license = "MIT" + topics = ("rpc", "ipc", "rpc-server") + homepage = "https://github.com/rpclib/rpclib/" + 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 + + @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): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + if "MT" in str(msvc_runtime_flag(self)): + self._cmake.definitions["RPCLIB_MSVC_STATIC_RUNTIME"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "rpclib") + self.cpp_info.set_property("cmake_target_name", "rpclib::rpc") + self.cpp_info.set_property("pkg_config_name", "rpclib") + + # Fix for installing dll to lib folder + # - Default CMAKE installs the dll to the lib folder + # causing the test_package to fail + if self.settings.os in ["Windows"]: + if self.options.shared: + self.cpp_info.components["_rpc"].bindirs.append( + os.path.join(self.package_folder, "lib")) + + # TODO: Remove after Conan 2.0 + self.cpp_info.components["_rpc"].names["cmake_find_package"] = "rpc" + self.cpp_info.components["_rpc"].names["cmake_find_package_multi"] = "rpc" + self.cpp_info.components["_rpc"].libs = ["rpc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_rpc"].system_libs = ["pthread"] + self.cpp_info.names["pkg_config"] = "librpc" diff --git a/recipes/rpclib/all/test_package/CMakeLists.txt b/recipes/rpclib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e585430312fe0 --- /dev/null +++ b/recipes/rpclib/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1.3) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(rpclib CONFIG REQUIRED) + +add_executable(example example.cpp) +set_target_properties(example PROPERTIES CXX_STANDARD 14) +target_link_libraries(example rpclib::rpc) diff --git a/recipes/rpclib/all/test_package/conanfile.py b/recipes/rpclib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..67c12602a84f3 --- /dev/null +++ b/recipes/rpclib/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +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): + self.run( os.path.join("bin", "example"), run_environment=True ) diff --git a/recipes/rpclib/all/test_package/example.cpp b/recipes/rpclib/all/test_package/example.cpp new file mode 100644 index 0000000000000..037e7735f6f73 --- /dev/null +++ b/recipes/rpclib/all/test_package/example.cpp @@ -0,0 +1,32 @@ +#include + +double divide(double a, double b) { return a / b; } + +struct subtractor { + double operator()(double a, double b) { return a - b; } +}; + +struct multiplier { + double multiply(double a, double b) { return a * b; } +}; + +int main() { + rpc::server srv(8080); + + subtractor s; + multiplier m; + + srv.bind("add", [](double a, double b) { return a + b; }); + srv.bind("sub", s); + srv.bind("div", ÷); + srv.bind("mul", [&m](double a, double b) { return m.multiply(a, b); }); + srv.bind("get", []() + { + return std::vector({1,2,3,4,5,6,7}); + }); + + // dont acutally run this, this is just for testing + //srv.run(); + + return 0; +} diff --git a/recipes/rpclib/config.yml b/recipes/rpclib/config.yml new file mode 100644 index 0000000000000..d724287fc23cb --- /dev/null +++ b/recipes/rpclib/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.0": + folder: all diff --git a/recipes/rply/all/CMakeLists.txt b/recipes/rply/all/CMakeLists.txt new file mode 100644 index 0000000000000..b354602f83650 --- /dev/null +++ b/recipes/rply/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) +project(rply LANGUAGES C) + +add_library(rply ${RPLY_SRC_DIR}/rply.c) +target_include_directories(rply PUBLIC ${RPLY_SRC_DIR}) +set_target_properties(rply PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(GNUInstallDirs) +install( + TARGETS rply + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install( + FILES ${RPLY_SRC_DIR}/rply.h ${RPLY_SRC_DIR}/rplyfile.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/rply/all/conandata.yml b/recipes/rply/all/conandata.yml new file mode 100644 index 0000000000000..2c48d7c782b77 --- /dev/null +++ b/recipes/rply/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.4": + url: "https://w3.impa.br/~diego/software/rply/rply-1.1.4.tar.gz" + sha256: "daf0b060fe701adf72aab0d525323d2e2e1bde9aa6aa9713ff1a5ef1e768d703" diff --git a/recipes/rply/all/conanfile.py b/recipes/rply/all/conanfile.py new file mode 100644 index 0000000000000..7ec833263602a --- /dev/null +++ b/recipes/rply/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class RplyConan(ConanFile): + name = "rply" + description = "ANSI C Library for PLY file format input and output" + license = "MIT" + topics = ("ply", "3d", "reader", "writer") + homepage = "https://w3.impa.br/~diego/software/rply" + 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, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.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["RPLY_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 = ["rply"] diff --git a/recipes/rply/all/test_package/CMakeLists.txt b/recipes/rply/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5de7de58218bf --- /dev/null +++ b/recipes/rply/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(rply REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE rply::rply) diff --git a/recipes/rply/all/test_package/conanfile.py b/recipes/rply/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b1cd2f951eab3 --- /dev/null +++ b/recipes/rply/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + ply_file = os.path.join(self.source_folder, "triangle.ply") + self.run(f"{bin_path} {ply_file}", env="conanrun") diff --git a/recipes/rply/all/test_package/test_package.c b/recipes/rply/all/test_package/test_package.c new file mode 100644 index 0000000000000..6b98b23e1b4f3 --- /dev/null +++ b/recipes/rply/all/test_package/test_package.c @@ -0,0 +1,47 @@ +#include +#include + +static int vertex_cb(p_ply_argument argument) { + long eol; + ply_get_argument_user_data(argument, NULL, &eol); + printf("%g", ply_get_argument_value(argument)); + if (eol) printf("\n"); + else printf(" "); + return 1; +} + +static int face_cb(p_ply_argument argument) { + long length, value_index; + ply_get_argument_property(argument, NULL, &length, &value_index); + switch (value_index) { + case 0: + case 1: + printf("%g ", ply_get_argument_value(argument)); + break; + case 2: + printf("%g\n", ply_get_argument_value(argument)); + break; + default: + break; + } + return 1; +} + +int main(int argc, char **argv) { + if (argc < 2) { + printf("Need at least one argument\n"); + return 1; + } + long nvertices, ntriangles; + p_ply ply = ply_open(argv[1], NULL, 0, NULL); + if (!ply) return 1; + if (!ply_read_header(ply)) return 1; + nvertices = ply_set_read_cb(ply, "vertex", "x", vertex_cb, NULL, 0); + ply_set_read_cb(ply, "vertex", "y", vertex_cb, NULL, 0); + ply_set_read_cb(ply, "vertex", "z", vertex_cb, NULL, 1); + ntriangles = ply_set_read_cb(ply, "face", "vertex_indices", face_cb, NULL, 0); + printf("%ld\n%ld\n", nvertices, ntriangles); + if (!ply_read(ply)) return 1; + ply_close(ply); + return 0; +} diff --git a/recipes/rply/all/test_package/triangle.ply b/recipes/rply/all/test_package/triangle.ply new file mode 100644 index 0000000000000..a9a950416c055 --- /dev/null +++ b/recipes/rply/all/test_package/triangle.ply @@ -0,0 +1,15 @@ +ply +format ascii 1.0 +comment this is a simple file +obj_info any data, in one line of free form text +element vertex 3 +property float x +property float y +property float z +element face 1 +property list uchar int vertex_indices +end_header +-1 0 0 + 0 1 0 + 1 0 0 +3 0 1 2 diff --git a/recipes/rply/all/test_v1_package/CMakeLists.txt b/recipes/rply/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/rply/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/rply/all/test_v1_package/conanfile.py b/recipes/rply/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8c7d6ccfd145d --- /dev/null +++ b/recipes/rply/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + ply_file = os.path.join(self.source_folder, os.pardir, "test_package", "triangle.ply") + self.run(f"{bin_path} {ply_file}", run_environment=True) diff --git a/recipes/rply/config.yml b/recipes/rply/config.yml new file mode 100644 index 0000000000000..f7bc2bb892fbd --- /dev/null +++ b/recipes/rply/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.4": + folder: all diff --git a/recipes/rtm/all/conandata.yml b/recipes/rtm/all/conandata.yml new file mode 100644 index 0000000000000..09d3d16ab4076 --- /dev/null +++ b/recipes/rtm/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.1.5": + url: "https://github.com/nfrechette/rtm/archive/v2.1.5.tar.gz" + sha256: "afb05cb00b59498756ca197028de291a1960e58d5f6fcad161d8240682481eae" + "2.1.4": + url: "https://github.com/nfrechette/rtm/archive/v2.1.4.tar.gz" + sha256: "7b2746d6e5ea007358ad8963ca1a83636caae893e67106ee1446efefa8e848d2" + "2.1.3": + url: "https://github.com/nfrechette/rtm/archive/v2.1.3.tar.gz" + sha256: "489f39566f64138e9fa54c7a74a8a2a65690eb58bc719177d27e5b2e04017e06" + "2.1.2": + url: "https://github.com/nfrechette/rtm/archive/v2.1.2.tar.gz" + sha256: "4fa45bae0e9c74beae49a5a855ab16308f11e84efbad07b523a661febeafcbb0" + "2.0.0": + url: "https://github.com/nfrechette/rtm/archive/v2.0.0.tar.gz" + sha256: "29155da085dde32d14528927d05aa231d966a0e37ff0b402e7333f7159c08bd0" diff --git a/recipes/rtm/all/conanfile.py b/recipes/rtm/all/conanfile.py new file mode 100644 index 0000000000000..ab6e02732c88c --- /dev/null +++ b/recipes/rtm/all/conanfile.py @@ -0,0 +1,28 @@ +import os +from conans import ConanFile, tools + + +class Rtmonan(ConanFile): + name = "rtm" + description = "Realtime Math" + topics = ("realtime", "math") + license = "MIT" + homepage = "https://github.com/nfrechette/rtm" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/rtm/all/test_package/CMakeLists.txt b/recipes/rtm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/rtm/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rtm/all/test_package/conanfile.py b/recipes/rtm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a59a26a52c8dc --- /dev/null +++ b/recipes/rtm/all/test_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" + + 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/rtm/all/test_package/test_package.cpp b/recipes/rtm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5e13600bd88fc --- /dev/null +++ b/recipes/rtm/all/test_package/test_package.cpp @@ -0,0 +1,35 @@ +#include +#include +#include + +using namespace rtm; + +int main() +{ + scalar_near_equal(float(constants::pi()), 3.141592653589793238462643383279502884F, 1.0e-6F); + scalar_near_equal(float(-constants::pi()), -3.141592653589793238462643383279502884F, 1.0e-6F); + scalar_near_equal(float(+constants::pi()), +3.141592653589793238462643383279502884F, 1.0e-6F); + scalar_near_equal(float(constants::pi()) * 2.0F, 3.141592653589793238462643383279502884F * 2.0F, 1.0e-6F); + scalar_near_equal(float(2.0F * constants::pi()), 2.0F * 3.141592653589793238462643383279502884F, 1.0e-6F); + scalar_near_equal(float(constants::pi()) / 2.0F, 3.141592653589793238462643383279502884F / 2.0F, 1.0e-6F); + scalar_near_equal(float(2.0F / constants::pi()), 2.0F / 3.141592653589793238462643383279502884F, 1.0e-6F); + scalar_near_equal(float(constants::pi()) + 1.0F, 3.141592653589793238462643383279502884F + 1.0F, 1.0e-6F); + scalar_near_equal(float(1.0F + constants::pi()), 1.0F + 3.141592653589793238462643383279502884F, 1.0e-6F); + scalar_near_equal(float(constants::pi()) - 1.0F, 3.141592653589793238462643383279502884F - 1.0F, 1.0e-6F); + scalar_near_equal(float(1.0F - constants::pi()), 1.0F - 3.141592653589793238462643383279502884F, 1.0e-6F); + + // Double + scalar_near_equal(double(constants::pi()), 3.141592653589793238462643383279502884, 1.0e-6); + scalar_near_equal(double(-constants::pi()), -3.141592653589793238462643383279502884, 1.0e-6); + scalar_near_equal(double(+constants::pi()), +3.141592653589793238462643383279502884, 1.0e-6); + scalar_near_equal(double(constants::pi() * 2.0), 3.141592653589793238462643383279502884 * 2.0, 1.0e-6); + scalar_near_equal(double(2.0 * constants::pi()), 2.0 * 3.141592653589793238462643383279502884, 1.0e-6); + scalar_near_equal(double(constants::pi() / 2.0), 3.141592653589793238462643383279502884 / 2.0, 1.0e-6); + scalar_near_equal(double(2.0 / constants::pi()), 2.0 / 3.141592653589793238462643383279502884, 1.0e-6); + scalar_near_equal(double(constants::pi() + 1.0), 3.141592653589793238462643383279502884 + 1.0, 1.0e-6); + scalar_near_equal(double(1.0 + constants::pi()), 1.0 + 3.141592653589793238462643383279502884, 1.0e-6); + scalar_near_equal(double(constants::pi() - 1.0), 3.141592653589793238462643383279502884 - 1.0, 1.0e-6); + scalar_near_equal(double(1.0 - constants::pi()), 1.0 - 3.141592653589793238462643383279502884, 1.0e-6); + + return 0; +} diff --git a/recipes/rtm/config.yml b/recipes/rtm/config.yml new file mode 100644 index 0000000000000..891ce064b3b74 --- /dev/null +++ b/recipes/rtm/config.yml @@ -0,0 +1,11 @@ +versions: + "2.1.5": + folder: "all" + "2.1.4": + folder: "all" + "2.1.3": + folder: "all" + "2.1.2": + folder: "all" + "2.0.0": + folder: "all" diff --git a/recipes/rtmidi/all/conandata.yml b/recipes/rtmidi/all/conandata.yml new file mode 100644 index 0000000000000..53cfe6b111167 --- /dev/null +++ b/recipes/rtmidi/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "5.0.0": + url: "https://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" + sha256: "370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd" +patches: + "4.0.0": + - patch_file: "patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch" + - patch_file: "patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch" + - patch_file: "patches/4.0.0-0003-relocatable-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" diff --git a/recipes/rtmidi/all/conanfile.py b/recipes/rtmidi/all/conanfile.py new file mode 100644 index 0000000000000..a347f4bbefb6f --- /dev/null +++ b/recipes/rtmidi/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class RtMidiConan(ConanFile): + name = "rtmidi" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.music.mcgill.ca/~gary/rtmidi/" + description = "Realtime MIDI input/output" + topics = ("midi",) + license = "MIT+send-patches-upstream" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _with_alsa(self): + return self.settings.os == "Linux" + + 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): + if self._with_alsa: + self.requires("libalsa/1.2.7.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RTMIDI_BUILD_TESTING"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${ALSA_LIBRARY}", "ALSA::ALSA") + + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + if Version(self.version) < "5.0.0": + os.makedirs(os.path.join(self.package_folder, "include", "rtmidi")) + os.rename( + os.path.join(self.package_folder, "include", "RtMidi.h"), + os.path.join(self.package_folder, "include", "rtmidi", "RtMidi.h"), + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "RtMidi") + self.cpp_info.set_property("cmake_target_name", "RtMidi::rtmidi") + self.cpp_info.set_property("pkg_config_name", "rtmidi") + # TODO: back to global scope in conan v2 + self.cpp_info.components["librtmidi"].includedirs = [os.path.join("include", "rtmidi")] + self.cpp_info.components["librtmidi"].libs = ["rtmidi"] + if is_apple_os(self): + self.cpp_info.components["librtmidi"].frameworks.extend( + ["CoreFoundation", "CoreAudio", "CoreMIDI", "CoreServices"] + ) + elif self.settings.os == "Windows": + self.cpp_info.components["librtmidi"].system_libs.append("winmm") + elif self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["librtmidi"].system_libs.append("pthread") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "RtMidi" + self.cpp_info.names["cmake_find_package_multi"] = "RtMidi" + self.cpp_info.components["librtmidi"].names["cmake_find_package"] = "rtmidi" + self.cpp_info.components["librtmidi"].names["cmake_find_package_multi"] = "rtmidi" + self.cpp_info.components["librtmidi"].set_property("cmake_target_name", "RtMidi::rtmidi") + self.cpp_info.components["librtmidi"].set_property("pkg_config_name", "rtmidi") + if self._with_alsa: + self.cpp_info.components["librtmidi"].requires.append("libalsa::libalsa") diff --git a/recipes/rtmidi/all/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch b/recipes/rtmidi/all/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch new file mode 100644 index 0000000000000..89ecd40f8688e --- /dev/null +++ b/recipes/rtmidi/all/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch @@ -0,0 +1,76 @@ +commit 0b5d67c0f738aa2b0f3e658d26c638434ee518f8 +Author: Stephen Sinclair +Date: Mon Jan 13 18:47:16 2020 +0100 + + Add a separate LICENSE file. + +diff --git a/LICENSE b/LICENSE +new file mode 100644 +index 0000000..97d50ab +--- /dev/null ++++ b/LICENSE +@@ -0,0 +1,27 @@ ++ ++RtMidi: realtime MIDI i/o C++ classes ++Copyright (c) 2003-2019 Gary P. Scavone ++ ++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. ++ ++Any person wishing to distribute modifications to the Software is ++asked to send the modifications to the original developer so that ++they can be incorporated into the canonical version. This is, ++however, not a binding provision of this license. ++ ++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. +diff --git a/README.md b/README.md +index c43158d..9f9304c 100644 +--- a/README.md ++++ b/README.md +@@ -36,31 +36,4 @@ For complete documentation on RtMidi, see the `doc` directory of the distributio + + ## Legal and ethical + +-The RtMidi license is similar to the MIT License, with the added *feature* that modifications be sent to the developer. +- +- RtMidi: realtime MIDI i/o C++ classes +- Copyright (c) 2003-2019 Gary P. Scavone +- +- 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. +- +- Any person wishing to distribute modifications to the Software is +- asked to send the modifications to the original developer so that +- they can be incorporated into the canonical version. This is, +- however, not a binding provision of this license. +- +- 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. ++The RtMidi license is similar to the MIT License, with the added *feature* that modifications be sent to the developer. Please see [LICENSE](LICENSE). diff --git a/recipes/rtmidi/all/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch b/recipes/rtmidi/all/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch new file mode 100644 index 0000000000000..203283c4fb0e0 --- /dev/null +++ b/recipes/rtmidi/all/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 28ee1f8..eb428ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -247,7 +247,7 @@ endif() + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/RtMidiConfig.cmake "include(\${CMAKE_CURRENT_LIST_DIR}/RtMidiTargets.cmake)") + + # Install CMake configuration export file. +-install(FILES ${CMAKE_BINARY_DIR}/RtMidiConfig.cmake ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/RtMidiConfig.cmake + DESTINATION ${RTMIDI_CMAKE_DESTINATION}) + + # Export library target (build-tree). diff --git a/recipes/rtmidi/all/patches/4.0.0-0003-relocatable-macos.patch b/recipes/rtmidi/all/patches/4.0.0-0003-relocatable-macos.patch new file mode 100644 index 0000000000000..3eaf88b202b08 --- /dev/null +++ b/recipes/rtmidi/all/patches/4.0.0-0003-relocatable-macos.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -151,7 +151,6 @@ if (NEED_PTHREAD) + endif() + + # Create library targets. +-cmake_policy(SET CMP0042 OLD) + set(LIB_TARGETS) + + # Use RTMIDI_BUILD_SHARED_LIBS / RTMIDI_BUILD_STATIC_LIBS if they diff --git a/recipes/rtmidi/all/test_package/CMakeLists.txt b/recipes/rtmidi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e185f98e410d --- /dev/null +++ b/recipes/rtmidi/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(RtMidi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE RtMidi::rtmidi) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rtmidi/all/test_package/conanfile.py b/recipes/rtmidi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/rtmidi/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/rtmidi/all/test_package/test_package.cpp b/recipes/rtmidi/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2f70ea6b37d15 --- /dev/null +++ b/recipes/rtmidi/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main (void) { + std::cout << "Version: " << RtMidi::getVersion() << std::endl; + + return 0; +} diff --git a/recipes/rtmidi/all/test_v1_package/CMakeLists.txt b/recipes/rtmidi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/rtmidi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rtmidi/all/test_v1_package/conanfile.py b/recipes/rtmidi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/rtmidi/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rtmidi/config.yml b/recipes/rtmidi/config.yml new file mode 100644 index 0000000000000..30e9497f54064 --- /dev/null +++ b/recipes/rtmidi/config.yml @@ -0,0 +1,5 @@ +versions: + "5.0.0": + folder: "all" + "4.0.0": + folder: "all" diff --git a/recipes/rttr/all/conandata.yml b/recipes/rttr/all/conandata.yml new file mode 100644 index 0000000000000..346af3371edfa --- /dev/null +++ b/recipes/rttr/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.9.6": + url: "https://github.com/rttrorg/rttr/archive/v0.9.6.tar.gz" + sha256: "058554f8644450185fd881a6598f9dee7ef85785cbc2bb5a5526a43225aa313f" +patches: + "0.9.6": + - patch_file: "patches/001_fix_build_without_RTTI.patch" + - patch_file: "patches/002_fix_license_installer.patch" diff --git a/recipes/rttr/all/conanfile.py b/recipes/rttr/all/conanfile.py new file mode 100644 index 0000000000000..bf4bdedfe2e83 --- /dev/null +++ b/recipes/rttr/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class RTTRConan(ConanFile): + name = "rttr" + description = "Run Time Type Reflection library" + topics = ("reflection",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rttrorg/rttr" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_rtti": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_rtti": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_UNIT_TESTS"] = False + tc.variables["BUILD_WITH_RTTI"] = self.options.with_rtti + tc.variables["BUILD_PACKAGE"] = False + tc.variables["BUILD_RTTR_DYNAMIC"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # No warnings as errors + for target in ["rttr_core", "rttr_core_lib", "rttr_core_s", "rttr_core_lib_s"]: + replace_in_file( + self, + os.path.join(self.source_folder, "src", "rttr", "CMakeLists.txt"), + f"set_compiler_warnings({target})", + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + cmake_target = "Core" if self.options.shared else "Core_Lib" + self.cpp_info.set_property("cmake_file_name", "rttr") + self.cpp_info.set_property("cmake_target_name", f"RTTR::{cmake_target}") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_rttr"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_rttr"].system_libs = ["dl", "pthread"] + if self.options.shared: + self.cpp_info.components["_rttr"].defines = ["RTTR_DLL"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "rttr" + self.cpp_info.filenames["cmake_find_package_multi"] = "rttr" + self.cpp_info.names["cmake_find_package"] = "RTTR" + self.cpp_info.names["cmake_find_package_multi"] = "RTTR" + self.cpp_info.components["_rttr"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["_rttr"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["_rttr"].set_property("cmake_target_name", f"RTTR::{cmake_target}") diff --git a/recipes/rttr/all/patches/001_fix_build_without_RTTI.patch b/recipes/rttr/all/patches/001_fix_build_without_RTTI.patch new file mode 100644 index 0000000000000..3ebd432f68f58 --- /dev/null +++ b/recipes/rttr/all/patches/001_fix_build_without_RTTI.patch @@ -0,0 +1,23 @@ +--- CMake/utility.cmake ++++ CMake/utility.cmake +@@ -416,9 +416,9 @@ function( replace_compiler_option _OLD_OPTION _NEW_OPTION) + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES ${_OLD_OPTION}) + # the whitespace after_OLD_OPTION is necessary to really match only the flag and not some sub flag (/MD should match by /MDd) +- string(REGEX REPLACE "${_OLD_OPTION} " "${_NEW_OPTION}" ${flag_var} "${${flag_var}}") ++ string(REGEX REPLACE "${_OLD_OPTION} " "${_NEW_OPTION} " ${flag_var} "${${flag_var}}") + else() +- set(${flag_var} "${${flag_var}} ${_NEW_OPTION}") ++ set(${flag_var} "${${flag_var}} ${_NEW_OPTION} ") + endif() + set(${flag_var} ${${flag_var}} PARENT_SCOPE) + endforeach() +@@ -449,7 +449,7 @@ macro(enable_rtti _ENABLE) + replace_compiler_option("${disable_rtti_opt}" "${enable_rtti_opt}") + else() + message(STATUS "Disabled: use of RTTI") +- replace_compiler_option(${enable_rtti_opt} ${disable_rtti_opt}) ++ replace_compiler_option("${enable_rtti_opt}" "${disable_rtti_opt}") + endif() + endmacro() + diff --git a/recipes/rttr/all/patches/002_fix_license_installer.patch b/recipes/rttr/all/patches/002_fix_license_installer.patch new file mode 100644 index 0000000000000..11530b91fcaae --- /dev/null +++ b/recipes/rttr/all/patches/002_fix_license_installer.patch @@ -0,0 +1,16 @@ +--- CMake/config.cmake 2020-01-01 17:17:32.316731500 -0500 ++++ CMake/config.cmake 2020-01-01 17:17:48.430661600 -0500 +@@ -164,13 +164,3 @@ + VERSION ${RTTR_VERSION_STR} + COMPATIBILITY AnyNewerVersion + ) +- +-if (BUILD_INSTALLER) +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/CMake/rttr-config-version.cmake" +- DESTINATION ${RTTR_CMAKE_CONFIG_INSTALL_DIR} +- COMPONENT Devel) +- +- install(FILES "${LICENSE_FILE}" "${README_FILE}" +- DESTINATION ${RTTR_ADDITIONAL_FILES_INSTALL_DIR} +- PERMISSIONS OWNER_READ) +-endif() diff --git a/recipes/rttr/all/test_package/CMakeLists.txt b/recipes/rttr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba71afe013a96 --- /dev/null +++ b/recipes/rttr/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(rttr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET RTTR::Core) + target_link_libraries(${PROJECT_NAME} PRIVATE RTTR::Core) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE RTTR::Core_Lib) +endif() diff --git a/recipes/rttr/all/test_package/conanfile.py b/recipes/rttr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/rttr/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/rttr/all/test_package/test_package.cpp b/recipes/rttr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..99d52f686af40 --- /dev/null +++ b/recipes/rttr/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +#include + +using dblvec = std::vector; + +int main() +{ + auto type = rttr::type::get(); + std::cout << "type name: " << type.get_name() << std::endl;; + return EXIT_SUCCESS; +} diff --git a/recipes/rttr/all/test_v1_package/CMakeLists.txt b/recipes/rttr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/rttr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/rttr/all/test_v1_package/conanfile.py b/recipes/rttr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/rttr/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/rttr/config.yml b/recipes/rttr/config.yml new file mode 100644 index 0000000000000..59281f80880cc --- /dev/null +++ b/recipes/rttr/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.6": + folder: all diff --git a/recipes/ruby/all/conandata.yml b/recipes/ruby/all/conandata.yml new file mode 100644 index 0000000000000..157bd7e6db982 --- /dev/null +++ b/recipes/ruby/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "3.1.0": + url: "https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz" + sha256: "50a0504c6edcb4d61ce6b8cfdbddaa95707195fab0ecd7b5e92654b2a9412854" +patches: + "3.1.0": + - patch_file: "patches/0001-darwin-includedir.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-remove-fpic.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-openssl-ext.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-windows-cflags.patch" + base_path: "source_subfolder" diff --git a/recipes/ruby/all/conanfile.py b/recipes/ruby/all/conanfile.py new file mode 100644 index 0000000000000..ae5f69f7b3f1a --- /dev/null +++ b/recipes/ruby/all/conanfile.py @@ -0,0 +1,196 @@ +import glob +import os +import re + +from conan import ConanFile +from conan.tools.apple.apple import is_apple_os, to_apple_arch + +try: + from conan.tools.cross_building import cross_building +except ImportError: + from conan.tools.build.cross_building import cross_building + +from conan.tools.files import apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.microsoft import msvc_runtime_flag, is_msvc +from conans import tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + + +class RubyConan(ConanFile): + name = "ruby" + description = "The Ruby Programming Language" + license = "Ruby" + topics = ("ruby", "c", "language", "object-oriented", "ruby-language") + homepage = "https://www.ruby-lang.org" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + exports_sources = "patches/**" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": True + } + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _windows_system_libs(self): + return ["user32", "advapi32", "shell32", "ws2_32", "iphlpapi", "imagehlp", "shlwapi", "bcrypt"] + + @property + def _msvc_optflag(self): + if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < "14": + return "-O2b2xg-" + else: + return "-O2sy-" + + def requirements(self): + self.requires("zlib/1.2.12") + self.requires("gmp/6.1.2") + if self.options.with_openssl: + self.requires("openssl/1.1.1o") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + if is_msvc(self) and msvc_runtime_flag(self).startswith('MT'): + # see https://github.com/conan-io/conan-center-index/pull/8644#issuecomment-1068974098 + raise ConanInvalidConfiguration("VS static runtime is not supported") + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def generate(self): + td = AutotoolsDeps(self) + # remove non-existing frameworks dirs, otherwise clang complains + for m in re.finditer("-F (\S+)", td.vars().get("LDFLAGS")): + if not os.path.exists(m[1]): + td.environment.remove("LDFLAGS", f"-F {m[1]}") + if self.settings.os == "Windows": + if is_msvc(self): + td.environment.append("LIBS", [f"{lib}.lib" for lib in self._windows_system_libs]) + else: + td.environment.append("LDFLAGS", [f"-l{lib}" for lib in self._windows_system_libs]) + td.generate() + + tc = AutotoolsToolchain(self) + # TODO: removed in conan 1.49 + tc.default_configure_install_args = True + + tc.configure_args.append("--disable-install-doc") + if self.options.shared and not is_msvc(self): + # Force fPIC + tc.fpic = True + if "--enable-shared" not in tc.configure_args: + tc.configure_args.append("--enable-shared") + + if cross_building(self) and is_apple_os(self.settings.os): + apple_arch = to_apple_arch(self.settings.arch) + if apple_arch: + tc.configure_args.append(f"--with-arch={apple_arch}") + if is_msvc(self): + # this is marked as TODO in https://github.com/conan-io/conan/blob/01f4aecbfe1a49f71f00af8f1b96b9f0174c3aad/conan/tools/gnu/autotoolstoolchain.py#L23 + tc.build_type_flags.append(f"-{msvc_runtime_flag(self)}") + # https://github.com/conan-io/conan/issues/10338 + # remove after conan 1.45 + if self.settings.build_type in ["Debug", "RelWithDebInfo"]: + tc.ldflags.append("-debug") + tc.build_type_flags = [f if f != "-O2" else self._msvc_optflag for f in tc.build_type_flags] + + tc.generate() + + def build(self): + apply_conandata_patches(self) + + at = Autotools(self) + + build_script_folder = self._source_subfolder + if is_msvc(self): + self.conf["tools.gnu:make_program"] = "nmake" + build_script_folder = os.path.join(build_script_folder, "win32") + + if "TMP" in os.environ: # workaround for TMP in CCI containing both forward and back slashes + os.environ["TMP"] = os.environ["TMP"].replace("/", "\\") + + with tools.vcvars(self): + at.configure(build_script_folder=build_script_folder) + at.make() + + def package(self): + for file in ["COPYING", "BSDL"]: + self.copy(file, dst="licenses", src=self._source_subfolder) + + at = Autotools(self) + with tools.vcvars(self): + if cross_building(self): + at.make(target="install-local") + at.make(target="install-arch") + else: + at.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + + def package_info(self): + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Adding to PATH: {binpath}") + self.env_info.PATH.append(binpath) + + version = tools.Version(self.version) + rubylib = self.cpp_info.components["rubylib"] + config_file = glob.glob(os.path.join(self.package_folder, "include", "**", "ruby", "config.h"), recursive=True)[0] + rubylib.includedirs = [ + os.path.join(self.package_folder, "include", f"ruby-{version}"), + os.path.dirname(os.path.dirname(config_file)) + ] + rubylib.libs = tools.collect_libs(self) + if is_msvc(self): + if self.options.shared: + rubylib.libs = list(filter(lambda l: not l.endswith("-static"), rubylib.libs)) + else: + rubylib.libs = list(filter(lambda l: l.endswith("-static"), rubylib.libs)) + rubylib.requires.extend(["zlib::zlib", "gmp::gmp"]) + if self.options.with_openssl: + rubylib.requires.append("openssl::openssl") + if self.settings.os in ("FreeBSD", "Linux"): + rubylib.system_libs = ["dl", "pthread", "rt", "m", "crypt"] + elif self.settings.os == "Windows": + rubylib.system_libs = self._windows_system_libs + if str(self.settings.compiler) in ("clang", "apple-clang"): + rubylib.cflags = ["-fdeclspec"] + rubylib.cxxflags = ["-fdeclspec"] + if tools.is_apple_os(self.settings.os): + rubylib.frameworks = ["CoreFoundation"] + + self.cpp_info.filenames["cmake_find_package"] = "Ruby" + self.cpp_info.filenames["cmake_find_package_multi"] = "Ruby" + self.cpp_info.set_property("cmake_file_name", "Ruby") + + self.cpp_info.names["cmake_find_package"] = "Ruby" + self.cpp_info.names["cmake_find_package_multi"] = "Ruby" + self.cpp_info.set_property("cmake_target_name", "Ruby::Ruby") + self.cpp_info.set_property("pkg_config_aliases", [f"ruby-{version.major}.{version.minor}"]) diff --git a/recipes/ruby/all/patches/0001-darwin-includedir.patch b/recipes/ruby/all/patches/0001-darwin-includedir.patch new file mode 100644 index 0000000000000..7552c5682f54f --- /dev/null +++ b/recipes/ruby/all/patches/0001-darwin-includedir.patch @@ -0,0 +1,14 @@ +diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb +--- tool/mkconfig.rb ++++ tool/mkconfig.rb +@@ -123,10 +123,8 @@ + when /^arch$/ + if universal + platform = val.sub(/universal/, %q[#{arch && universal[/(?:\A|\s)#{Regexp.quote(arch)}=(\S+)/, 1] || RUBY_PLATFORM[/\A[^-]*/]}]) + end +- when /^includedir$/ +- val = '"$(SDKROOT)"'+val if /darwin/ =~ arch + end + v = " CONFIG[\"#{name}\"] #{eq} #{val}\n" + if fast[name] + v_fast << v diff --git a/recipes/ruby/all/patches/0002-remove-fpic.patch b/recipes/ruby/all/patches/0002-remove-fpic.patch new file mode 100644 index 0000000000000..de94a5c39be80 --- /dev/null +++ b/recipes/ruby/all/patches/0002-remove-fpic.patch @@ -0,0 +1,16 @@ +diff --git a/configure.ac b/configure.ac +--- configure.ac ++++ configure.ac +@@ -2911,11 +2911,9 @@ + # fails to consult /usr/local/include by default. This causes + # mkmf.rb's have_header() to fail if the desired resource happens to be + # installed in the /usr/local tree. + RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)], +- [bsdi*|cygwin*|msys*|mingw*|aix*|interix*], [ ], +- [ +- RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)]) ++ [ ]) + ], [ + AS_CASE(["$target_os"], + [hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"], + [solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"], diff --git a/recipes/ruby/all/patches/0003-openssl-ext.patch b/recipes/ruby/all/patches/0003-openssl-ext.patch new file mode 100644 index 0000000000000..4ce36eb65a9c1 --- /dev/null +++ b/recipes/ruby/all/patches/0003-openssl-ext.patch @@ -0,0 +1,13 @@ +diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb +--- ext/openssl/extconf.rb ++++ ext/openssl/extconf.rb +@@ -45,8 +45,9 @@ + if $mswin || $mingw + # required for static OpenSSL libraries + have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen()) + have_library("crypt32") ++ have_library("advapi32") + end + + return false unless have_header("openssl/ssl.h") + diff --git a/recipes/ruby/all/patches/0004-windows-cflags.patch b/recipes/ruby/all/patches/0004-windows-cflags.patch new file mode 100644 index 0000000000000..6f8d8ae8b7115 --- /dev/null +++ b/recipes/ruby/all/patches/0004-windows-cflags.patch @@ -0,0 +1,14 @@ +diff --git a/win32/Makefile.sub b/win32/Makefile.sub +--- win32/Makefile.sub ++++ win32/Makefile.sub +@@ -252,8 +252,10 @@ + ARCH_FLAG = $(PROCESSOR_FLAG) + !endif + !if !defined(CFLAGS) + CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG) ++!else ++CFLAGS = $(CFLAGS) $(WARNFLAGS) + !endif + !if !defined(CXXFLAGS) + CXXFLAGS = $(CFLAGS) + !endif diff --git a/recipes/ruby/all/test_package/CMakeLists.txt b/recipes/ruby/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..361d2a449e95c --- /dev/null +++ b/recipes/ruby/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(Ruby REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} Ruby::Ruby) +set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/bin) +set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/bin) +set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/bin) +set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/bin) diff --git a/recipes/ruby/all/test_package/conanfile.py b/recipes/ruby/all/test_package/conanfile.py new file mode 100644 index 0000000000000..20f8f26c4f735 --- /dev/null +++ b/recipes/ruby/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +from conan import ConanFile +from conan.tools.cmake import CMake +from conans import tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + # test executable + self.run("ruby --version", run_environment=True) + + # test library + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/ruby/all/test_package/test_package.c b/recipes/ruby/all/test_package/test_package.c new file mode 100644 index 0000000000000..12210d7a1f569 --- /dev/null +++ b/recipes/ruby/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +int main(int argc, char* argv[]) { + ruby_sysinit(&argc, &argv); + RUBY_INIT_STACK; + ruby_init(); + + rb_eval_string("puts 'Hello, ruby!'"); + + return EXIT_SUCCESS; +} diff --git a/recipes/ruby/config.yml b/recipes/ruby/config.yml new file mode 100644 index 0000000000000..baa80af0c4b7d --- /dev/null +++ b/recipes/ruby/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.0": + folder: all diff --git a/recipes/runtimeqml/all/CMakeLists.txt b/recipes/runtimeqml/all/CMakeLists.txt new file mode 100644 index 0000000000000..3180817c845da --- /dev/null +++ b/recipes/runtimeqml/all/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.13) + +project(runtimeqml LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + +find_package(Qt5 CONFIG) +find_package(Qt6 CONFIG) +if (Qt6_FOUND) + set(HEADERS runtimeqml.hpp) + add_library(${PROJECT_NAME} runtimeqml.hpp runtimeqml.cpp) +elseif(Qt5_FOUND) + set(HEADERS runtimeqml.h) + add_library(${PROJECT_NAME} runtimeqml.h runtimeqml.cpp) +else() + message(FATAL_ERROR "Qt was not found") +endif() + +target_link_libraries(${PROJECT_NAME} PUBLIC qt::qt) +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}" C_VISIBILITY_PRESET hidden) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/recipes/runtimeqml/all/conandata.yml b/recipes/runtimeqml/all/conandata.yml new file mode 100644 index 0000000000000..a3ea3f95e8682 --- /dev/null +++ b/recipes/runtimeqml/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20220923": + url: https://github.com/GIPdA/runtimeqml/archive/3ae5dadcf6548a2e59e83c21d84fd50575df79bf.zip + sha256: "18bf63ab2692e6cb8ed6e0dbfcd2390dc65769eaed43b66c4da9dd7a55598603" + "cci.20211220": + url: https://github.com/GIPdA/runtimeqml/archive/ac0cbfc49ae215dd0df5ac8ecb79ca7008de5486.zip + sha256: "57c6d50f0fd281c0984daae65f3559942f58d11de8ff406c150d54fd7ff0d076" diff --git a/recipes/runtimeqml/all/conanfile.py b/recipes/runtimeqml/all/conanfile.py new file mode 100644 index 0000000000000..8ed18efdf54c9 --- /dev/null +++ b/recipes/runtimeqml/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import get, copy +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class RuntimeQml(ConanFile): + name = "runtimeqml" + homepage = "https://github.com/GIPdA/runtimeqml" + description = "Enables hot-reloading qml files" + topics = ("qt", "hot-reload", "qml", "gui") + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + 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 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, + self.export_sources_folder) + + 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 + + def layout(self): + cmake_layout(self) + + def requirements(self): + if Version(self.version) <= "cci.20211220": + self.requires("qt/5.15.5") + else: + self.requires("qt/6.3.1") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get( + str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + qt = self.dependencies["qt"] + if not qt.options.qtdeclarative: + raise ConanInvalidConfiguration( + 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["runtimeqml"] diff --git a/recipes/runtimeqml/all/test_package/CMakeLists.txt b/recipes/runtimeqml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0abdc1edf18c8 --- /dev/null +++ b/recipes/runtimeqml/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(runtimeqml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE runtimeqml::runtimeqml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/runtimeqml/all/test_package/conanfile.py b/recipes/runtimeqml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/runtimeqml/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/runtimeqml/all/test_package/test_package.cpp b/recipes/runtimeqml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..091aa9a194536 --- /dev/null +++ b/recipes/runtimeqml/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include + +int main(int argc, char* argv[]) { + QApplication app(argc, argv); + QQmlApplicationEngine engine; + + RuntimeQml rt{ &engine }; + return app.exec(); +} diff --git a/recipes/runtimeqml/all/test_v1_package/CMakeLists.txt b/recipes/runtimeqml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/runtimeqml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/runtimeqml/all/test_v1_package/conanfile.py b/recipes/runtimeqml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f44ea85fbe3eb --- /dev/null +++ b/recipes/runtimeqml/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/runtimeqml/config.yml b/recipes/runtimeqml/config.yml new file mode 100644 index 0000000000000..4efb187195976 --- /dev/null +++ b/recipes/runtimeqml/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220923": + folder: "all" + "cci.20211220": + folder: "all" diff --git a/recipes/ruy/all/conandata.yml b/recipes/ruy/all/conandata.yml new file mode 100644 index 0000000000000..c9acc9f74ac8c --- /dev/null +++ b/recipes/ruy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220628": + url: "https://github.com/google/ruy/archive/841ea4172ba904fe3536789497f9565f2ef64129.tar.gz" + sha256: "fbd20e6c8cd5cf8ef159f69600ea0c7ef0f1401a4c16a9cd04e5a12ffa9c6e14" diff --git a/recipes/ruy/all/conanfile.py b/recipes/ruy/all/conanfile.py new file mode 100644 index 0000000000000..c508de954594d --- /dev/null +++ b/recipes/ruy/all/conanfile.py @@ -0,0 +1,146 @@ +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, replace_in_file, rmdir +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.57.0" + + +class RuyConan(ConanFile): + name = "ruy" + description = "ruy is a matrix multiplication library.\n" \ + "Its focus is to cover the matrix multiplication needs of neural network inference engines\n" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/ruy" + license = "Apache-2.0" + topics = ("matrix", "multiplication", "neural", "network", "AI", "tensorflow") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "3.4", + "apple-clang": "5.1", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warning("Compiler is unknown. Assuming it supports C++14.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("Build requires support for C++14. Minimum version for {} is {}" + .format(str(self.settings.compiler), minimum_version)) + + if str(self.settings.compiler) == "clang" and Version(self.settings.compiler.version) <= 5 and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration("Debug builds are not supported on older versions of Clang (<=5)") + + 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 requirements(self): + self.requires("cpuinfo/cci.20220228") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["RUY_MINIMAL_BUILD"] = True + tc.cache_variables["RUY_FIND_CPUINFO"] = True + # Ruy public headers don't have API decorators, + # export everything to support shared libraries on Windows + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + patches = { + #Remove the invocation after project(), see https://github.com/google/ruy/issues/328 + "cmake_minimum_required(VERSION 3.13)": "", + # Ensure `cmake_minimum_required` is called first + "# Copyright 2021 Google LLC": "# Copyright 2021 Google LLC\ncmake_minimum_required(VERSION 3.13)", + } + + for pattern, patch in patches.items(): + replace_in_file(self, cmakelists, pattern, patch) + + # 1. Allow Shared builds + replace_in_file(self, os.path.join(self.source_folder, "cmake", "ruy_cc_library.cmake"), + "add_library(${_NAME} STATIC", + "add_library(${_NAME}" + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["ruy_frontend", + "ruy_context", + "ruy_trmul", + "ruy_thread_pool", + "ruy_blocking_counter", + "ruy_prepare_packed_matrices", + "ruy_ctx", + "ruy_allocator", + "ruy_prepacked_cache", + "ruy_tune", + "ruy_wait", + "ruy_apply_multiplier", + "ruy_block_map", + "ruy_context_get_ctx", + "ruy_cpuinfo", + "ruy_denormal", + "ruy_have_built_path_for_avx", + "ruy_have_built_path_for_avx2_fma", + "ruy_have_built_path_for_avx512", + "ruy_kernel_arm", + "ruy_kernel_avx", + "ruy_kernel_avx2_fma", + "ruy_kernel_avx512", + "ruy_pack_arm", + "ruy_pack_avx", + "ruy_pack_avx2_fma", + "ruy_pack_avx512", + "ruy_system_aligned_alloc", + "ruy_profiler_instrumentation", + "ruy_profiler_profiler" + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/ruy/all/test_package/CMakeLists.txt b/recipes/ruy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cfcdc6768e411 --- /dev/null +++ b/recipes/ruy/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(ruy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE ruy::ruy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ruy/all/test_package/conanfile.py b/recipes/ruy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..aa876670f64fd --- /dev/null +++ b/recipes/ruy/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, CMakeToolchain +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/ruy/all/test_package/test_package.cpp b/recipes/ruy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9e1b8a13b5564 --- /dev/null +++ b/recipes/ruy/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include "ruy/ruy.h" + +int main() { + + ruy::Context context; + const float lhs_data[] = {1, 2, 3, 4}; + const float rhs_data[] = {1, 2, 3, 4}; + float dst_data[4]; + + ruy::Matrix lhs; + ruy::MakeSimpleLayout(2, 2, ruy::Order::kRowMajor, lhs.mutable_layout()); + lhs.set_data(lhs_data); + ruy::Matrix rhs; + ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, rhs.mutable_layout()); + rhs.set_data(rhs_data); + ruy::Matrix dst; + ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, dst.mutable_layout()); + dst.set_data(dst_data); + + ruy::MulParams mul_params; + ruy::Mul(lhs, rhs, mul_params, &context, &dst); + + std::cout << "ruy's test_package ran successfully \n"; +} diff --git a/recipes/ruy/all/test_v1_package/CMakeLists.txt b/recipes/ruy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ad23fc4ce0674 --- /dev/null +++ b/recipes/ruy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ruy REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ruy::ruy) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/ruy/all/test_v1_package/conanfile.py b/recipes/ruy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cb4e2b3389e8f --- /dev/null +++ b/recipes/ruy/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" + + 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/ruy/all/test_v1_package/test_package.cpp b/recipes/ruy/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..9e1b8a13b5564 --- /dev/null +++ b/recipes/ruy/all/test_v1_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include "ruy/ruy.h" + +int main() { + + ruy::Context context; + const float lhs_data[] = {1, 2, 3, 4}; + const float rhs_data[] = {1, 2, 3, 4}; + float dst_data[4]; + + ruy::Matrix lhs; + ruy::MakeSimpleLayout(2, 2, ruy::Order::kRowMajor, lhs.mutable_layout()); + lhs.set_data(lhs_data); + ruy::Matrix rhs; + ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, rhs.mutable_layout()); + rhs.set_data(rhs_data); + ruy::Matrix dst; + ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, dst.mutable_layout()); + dst.set_data(dst_data); + + ruy::MulParams mul_params; + ruy::Mul(lhs, rhs, mul_params, &context, &dst); + + std::cout << "ruy's test_package ran successfully \n"; +} diff --git a/recipes/ruy/config.yml b/recipes/ruy/config.yml new file mode 100644 index 0000000000000..f2da5345e749b --- /dev/null +++ b/recipes/ruy/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220628": + folder: all diff --git a/recipes/rvo2/all/CMakeLists.txt b/recipes/rvo2/all/CMakeLists.txt new file mode 100644 index 0000000000000..4e4f66d9ee7ef --- /dev/null +++ b/recipes/rvo2/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/rvo2/all/conandata.yml b/recipes/rvo2/all/conandata.yml new file mode 100644 index 0000000000000..a1b5bcf234f59 --- /dev/null +++ b/recipes/rvo2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.2": + url: "https://github.com/snape/RVO2/archive/v2.0.2.tar.gz" + sha256: "20b59fcc4cf61783cb0d1baa40a0dff3c557a97246651f95d9d9fed91bf17724" diff --git a/recipes/rvo2/all/conanfile.py b/recipes/rvo2/all/conanfile.py new file mode 100644 index 0000000000000..c7ee9cc9e4688 --- /dev/null +++ b/recipes/rvo2/all/conanfile.py @@ -0,0 +1,74 @@ +import os +from conans import ConanFile, tools, CMake + + +class Rvo2Conan(ConanFile): + name = "rvo2" + description = "Optimal Reciprocal Collision Avoidance" + topics = ("conan", "collision", "avoidance", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/snape/RVO2" + license = "Apache-2.0" + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "RVO2-{}".format(self.version) + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "add_subdirectory(examples)", + "") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), + "DESTINATION include", + "DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), + "RVO DESTINATION lib", + "RVO RUNTIME LIBRARY ARCHIVE") + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=os.path.join(self.source_folder, self._source_subfolder), dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/rvo2/all/test_package/CMakeLists.txt b/recipes/rvo2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/rvo2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/rvo2/all/test_package/conanfile.py b/recipes/rvo2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/rvo2/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rvo2/all/test_package/test_package.cpp b/recipes/rvo2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0e7a6da5dc7cc --- /dev/null +++ b/recipes/rvo2/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include +#include + +#include + +int main() +{ + RVO::RVOSimulator *sim = new RVO::RVOSimulator(); + + sim->setTimeStep(0.25f); + sim->setAgentDefaults(15.0f, 10, 5.0f, 5.0f, 2.0f, 2.0f); + + for (size_t i = 0; i < 5; ++i) { + for (size_t j = 0; j < 5; ++j) { + sim->addAgent(RVO::Vector2(55.0f + i * 10.0f, 55.0f + j * 10.0f)); + sim->addAgent(RVO::Vector2(-55.0f - i * 10.0f, 55.0f + j * 10.0f)); + sim->addAgent(RVO::Vector2(55.0f + i * 10.0f, -55.0f - j * 10.0f)); + sim->addAgent(RVO::Vector2(-55.0f - i * 10.0f, -55.0f - j * 10.0f)); + } + } + + delete sim; + return 0; +} diff --git a/recipes/rvo2/config.yml b/recipes/rvo2/config.yml new file mode 100644 index 0000000000000..5df97e2cc232e --- /dev/null +++ b/recipes/rvo2/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.2": + folder: all diff --git a/recipes/rxcpp/all/conandata.yml b/recipes/rxcpp/all/conandata.yml new file mode 100644 index 0000000000000..4cac618280248 --- /dev/null +++ b/recipes/rxcpp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "4.1.1": + url: "https://github.com/ReactiveX/RxCpp/archive/v4.1.1.tar.gz" + sha256: "054a9be63e66904ecaa552ce56d6458b4545d6da5ea32f5103c7fc379cebb374" + "4.1.0": + url: "https://github.com/ReactiveX/RxCpp/archive/4.1.0.tar.gz" + sha256: "d3bb49c7ac6b5c43235df710510fce87d827bb88a1b78242017f190d2acbbdea" diff --git a/recipes/rxcpp/all/conanfile.py b/recipes/rxcpp/all/conanfile.py new file mode 100644 index 0000000000000..d05961ecfc442 --- /dev/null +++ b/recipes/rxcpp/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.50.0" + + +class RxcppConan(ConanFile): + name = "rxcpp" + description = "C++11 library for composing operations on streams of asynchronous events." + license = "Apache-2.0" + topics = ("rxcpp", "reactivex", "asynchronous", "event", "observable", "values-distributed-in-time") + homepage = "https://github.com/ReactiveX/RxCpp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "license.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "Rx", "v2", "src"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/rxcpp/all/test_package/CMakeLists.txt b/recipes/rxcpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..32a71bb8a4f6d --- /dev/null +++ b/recipes/rxcpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(rxcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rxcpp::rxcpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rxcpp/all/test_package/conanfile.py b/recipes/rxcpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/rxcpp/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/rxcpp/all/test_package/test_package.cpp b/recipes/rxcpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..17fbd7032a1d0 --- /dev/null +++ b/recipes/rxcpp/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto values = rxcpp::observable<>::range(1, 3).as_blocking(); + return 0; +} diff --git a/recipes/rxcpp/all/test_v1_package/CMakeLists.txt b/recipes/rxcpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f776bf6153687 --- /dev/null +++ b/recipes/rxcpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(rxcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rxcpp::rxcpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rxcpp/all/test_v1_package/conanfile.py b/recipes/rxcpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/rxcpp/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/rxcpp/config.yml b/recipes/rxcpp/config.yml new file mode 100644 index 0000000000000..8305d448f9832 --- /dev/null +++ b/recipes/rxcpp/config.yml @@ -0,0 +1,5 @@ +versions: + "4.1.1": + folder: all + "4.1.0": + folder: all diff --git a/recipes/s2let/all/CMakeLists.txt b/recipes/s2let/all/CMakeLists.txt new file mode 100644 index 0000000000000..0496b29838549 --- /dev/null +++ b/recipes/s2let/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..93e1e80ecc199 --- /dev/null +++ b/recipes/s2let/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "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 new file mode 100644 index 0000000000000..1fc2aa8dc0cd5 --- /dev/null +++ b/recipes/s2let/all/conanfile.py @@ -0,0 +1,81 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class S2let(ConanFile): + name = "s2let" + 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") + options = { + "fPIC": [True, False], + "with_cfitsio": [True, False], + } + default_options = { + "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 + + def requirements(self): + self.requires("astro-informatics-so3/1.3.4") + if self.options.with_cfitsio: + self.requires("cfitsio/3.490") + + def validate(self): + if self.settings.compiler == "Visual Studio": + 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 + ) + + @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 build(self): + self._cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self._cmake.install() + + 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": + self.cpp_info.system_libs = ["m"] diff --git a/recipes/s2let/all/test_package/CMakeLists.txt b/recipes/s2let/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..87839a22ea4e7 --- /dev/null +++ b/recipes/s2let/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(s2let REQUIRED NO_MODULE) + +add_executable(${PROJECT_NAME} example.c) +target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) +target_link_libraries(${PROJECT_NAME} s2let::s2let) diff --git a/recipes/s2let/all/test_package/conanfile.py b/recipes/s2let/all/test_package/conanfile.py new file mode 100644 index 0000000000000..abcaeed3f89b6 --- /dev/null +++ b/recipes/s2let/all/test_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/all/test_package/example.c b/recipes/s2let/all/test_package/example.c new file mode 100644 index 0000000000000..727c8b1d866f7 --- /dev/null +++ b/recipes/s2let/all/test_package/example.c @@ -0,0 +1,9 @@ +#include + +int main(int argc, char *argv[]) +{ + complex double *buffer; + s2let_allocate_lm(&buffer, 5); + free(buffer); + return 0; +} diff --git a/recipes/s2let/config.yml b/recipes/s2let/config.yml new file mode 100644 index 0000000000000..a0d8538280848 --- /dev/null +++ b/recipes/s2let/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.3": + folder: all diff --git a/recipes/s2n/all/CMakeLists.txt b/recipes/s2n/all/CMakeLists.txt new file mode 100644 index 0000000000000..c7d1ca7e609e6 --- /dev/null +++ b/recipes/s2n/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper LANGUAGES C) + +# We want to discover OpenSSL through CMakeDeps and use OpenSSL::Crypto target for linking +# https://github.com/aws/s2n-tls/blob/v1.3.31/CMakeLists.txt#L27-L28 +# https://github.com/aws/s2n-tls/blob/v1.3.31/CMakeLists.txt#L379-L381 +find_package(OpenSSL REQUIRED) +add_library(crypto INTERFACE IMPORTED) +set_target_properties(crypto PROPERTIES INTERFACE_LINK_LIBRARIES "OpenSSL::Crypto") + +add_subdirectory(src) diff --git a/recipes/s2n/all/conandata.yml b/recipes/s2n/all/conandata.yml new file mode 100644 index 0000000000000..1f39628799a66 --- /dev/null +++ b/recipes/s2n/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.3.31": + url: "https://github.com/aws/s2n-tls/archive/v1.3.31.tar.gz" + sha256: "23cfb42f82cbe1ce94b59f3b1c1c8eb9d24af2a1ae4c8f854209ff88fddd3900" + "1.3.15": + url: "https://github.com/aws/s2n-tls/archive/v1.3.15.tar.gz" + sha256: "e3fc3405bb56334cbec90c35cbdf0e8a0f53199749a3f4b8fddb8d8a41e6db8b" + "1.3.9": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.9.tar.gz" + sha256: "09f03600d45cac99b8495f9c7aa5f70a83b5c02867a3018a1ba9975d53184658" + "1.2.0": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.2.0.tar.gz" + sha256: "90c1b5f4ac2c46774c8f100cac4f2a951715ae0bf2661799b9aaa891e6fb1f30" + "1.1.1": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.1.1.tar.gz" + sha256: "a17ef1e55b0a6c3d422b8b857bcfd26af7d2f8b33628a540854a6c17b8bed4d8" + "1.1.0": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.1.0.tar.gz" + sha256: "e094fd1f2044cfaeedb534ef1d7e4fd8745d8c07a247ce383cd8a6a5288e195c" + "1.0.11": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.0.11.tar.gz" + sha256: "dbe886cf8cd6658cce571cdaba81e9a93d8c914fd1eba0d3233fec64ed53224b" +patches: + "1.1.0": + - patch_file: "patches/1.1.0/001-try-compile.patch" + "1.0.11": + - patch_file: "patches/1.0.11/001-try-compile.patch" diff --git a/recipes/s2n/all/conanfile.py b/recipes/s2n/all/conanfile.py new file mode 100644 index 0000000000000..34d4cbcae2b9f --- /dev/null +++ b/recipes/s2n/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class S2nConan(ConanFile): + name = "s2n" + description = "An implementation of the TLS/SSL protocols" + topics = ("aws", "amazon", "cloud", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aws/s2n-tls" + license = "Apache-2.0" + 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) + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Not supported (yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["UNSAFE_TREAT_WARNINGS_AS_ERRORS"] = False + tc.variables["SEARCH_LIBCRYPTO"] = False # see CMakeLists wrapper + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = 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() + rmdir(self, os.path.join(self.package_folder, "lib", "s2n")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::s2n": "s2n::s2n"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "s2n") + self.cpp_info.set_property("cmake_target_name", "AWS::s2n") + self.cpp_info.libs = ["s2n"] + self.cpp_info.requires = ["openssl::crypto"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m", "pthread"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/s2n/all/patches/1.0.11/001-try-compile.patch b/recipes/s2n/all/patches/1.0.11/001-try-compile.patch new file mode 100644 index 0000000000000..a33d2dd612a75 --- /dev/null +++ b/recipes/s2n/all/patches/1.0.11/001-try-compile.patch @@ -0,0 +1,115 @@ +commit f6da121bc248974e70ced3bfc690b4652a4cb056 +Author: dvirtz +Date: Fri Mar 4 16:23:00 2022 +0200 + + Fix BIKE Round 3 try_compile statements + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b72effbe..cc298a13 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -147,28 +147,49 @@ else() + # First, check if the compiler supports the specific instruction set + # extensions. For example, gcc-4 doesn't fully support AVX-512, while + # gcc-7 doesn't support VPCLMUL extension. +- try_compile(BIKE_R3_AVX2_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS "-mavx2") ++ set(BIKE_R3_AVX2_FLAGS "-mavx2") ++ try_compile( ++ BIKE_R3_AVX2_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_avx2.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_AVX2_FLAGS} -DS2N_BIKE_R3_AVX2" ++ ) + + set(BIKE_R3_AVX512_FLAGS "-mavx512f -mavx512bw -mavx512dq") +- try_compile(BIKE_R3_AVX512_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS ${BIKE_R3_AVX512_FLAGS}) ++ try_compile( ++ BIKE_R3_AVX512_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_avx512.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_AVX512_FLAGS} -DS2N_BIKE_R3_AVX512" ++ ) + + set(BIKE_R3_PCLMUL_FLAGS "-mpclmul -msse2") +- try_compile(BIKE_R3_PCLMUL_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS ${BIKE_R3_PCLMUL_FLAGS}) ++ try_compile( ++ BIKE_R3_PCLMUL_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_base_pclmul.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_PCLMUL_FLAGS} -DS2N_BIKE_R3_PCLMUL" ++ ) + + set(BIKE_R3_VPCLMUL_FLAGS "-mvpclmulqdq -mavx512f -mavx512bw -mavx512dq") +- try_compile(BIKE_R3_VPCLMUL_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS ${BIKE_R3_VPCLMUL_FLAGS}) ++ try_compile( ++ BIKE_R3_VPCLMUL_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_base_vpclmul.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_VPCLMUL_FLAGS} -DS2N_BIKE_R3_VPCLMUL" ++ ) + + if(BIKE_R3_AVX2_SUPPORTED OR BIKE_R3_AVX512_SUPPORTED OR BIKE_R3_PCLMUL_SUPPORTED OR BIKE_R3_VPCLMUL_SUPPORTED) + set(BIKE_R3_X86_64_OPT_SUPPORTED ON) +@@ -277,31 +298,36 @@ if(BIKE_R3_X86_64_OPT_SUPPORTED) + # If any of the BIKE_R3 x86_64 optimizations is supported (this was checked + # earlier in the file), we add the required compile flags to files that + # contain the optimized code. ++ ++ message(STATUS "Enabling BIKE_R3 x86_64 optimizations") ++ + if(BIKE_R3_AVX2_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_AVX2") + FILE(GLOB BIKE_R3_AVX2_SRCS "pq-crypto/bike_r3/*_avx2.c") + set_source_files_properties(${BIKE_R3_AVX2_SRCS} PROPERTIES COMPILE_FLAGS -mavx2) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_AVX2) + endif() + + if(BIKE_R3_AVX512_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_AVX512") + FILE(GLOB BIKE_R3_AVX512_SRCS "pq-crypto/bike_r3/*_avx512.c") + set_source_files_properties(${BIKE_R3_AVX512_SRCS} PROPERTIES COMPILE_FLAGS ${BIKE_R3_AVX512_FLAGS}) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_AVX512) + endif() + + if(BIKE_R3_PCLMUL_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_PCLMUL") + FILE(GLOB BIKE_R3_PCLMUL_SRCS "pq-crypto/bike_r3/*_pclmul.c") + set_source_files_properties(${BIKE_R3_PCLMUL_SRCS} PROPERTIES COMPILE_FLAGS ${BIKE_R3_PCLMUL_FLAGS}) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_PCLMUL) + endif() + + if(BIKE_R3_VPCLMUL_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_VPCLMUL") + FILE(GLOB BIKE_R3_VPCLMUL_SRCS "pq-crypto/bike_r3/*_vpclmul.c") + set_source_files_properties(${BIKE_R3_VPCLMUL_SRCS} PROPERTIES COMPILE_FLAGS ${BIKE_R3_VPCLMUL_FLAGS}) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_VPCLMUL) + endif() +- +- message(STATUS "Enabling BIKE_R3 x86_64 optimizations") + endif() + + if(ADX_SUPPORTED) diff --git a/recipes/s2n/all/patches/1.1.0/001-try-compile.patch b/recipes/s2n/all/patches/1.1.0/001-try-compile.patch new file mode 100644 index 0000000000000..8b20829d21768 --- /dev/null +++ b/recipes/s2n/all/patches/1.1.0/001-try-compile.patch @@ -0,0 +1,115 @@ +commit b1fae56bd3537a3d89dd42a479dbdc1dc2e2f862 +Author: dvirtz +Date: Fri Mar 4 16:23:00 2022 +0200 + + Fix BIKE Round 3 try_compile statements + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f58303a6..98800345 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -159,28 +159,49 @@ else() + # First, check if the compiler supports the specific instruction set + # extensions. For example, gcc-4 doesn't fully support AVX-512, while + # gcc-7 doesn't support VPCLMUL extension. +- try_compile(BIKE_R3_AVX2_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS "-mavx2") ++ set(BIKE_R3_AVX2_FLAGS "-mavx2") ++ try_compile( ++ BIKE_R3_AVX2_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_avx2.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_AVX2_FLAGS} -DS2N_BIKE_R3_AVX2" ++ ) + + set(BIKE_R3_AVX512_FLAGS "-mavx512f -mavx512bw -mavx512dq") +- try_compile(BIKE_R3_AVX512_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS ${BIKE_R3_AVX512_FLAGS}) ++ try_compile( ++ BIKE_R3_AVX512_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_avx512.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_AVX512_FLAGS} -DS2N_BIKE_R3_AVX512" ++ ) + + set(BIKE_R3_PCLMUL_FLAGS "-mpclmul -msse2") +- try_compile(BIKE_R3_PCLMUL_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS ${BIKE_R3_PCLMUL_FLAGS}) ++ try_compile( ++ BIKE_R3_PCLMUL_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_base_pclmul.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_PCLMUL_FLAGS} -DS2N_BIKE_R3_PCLMUL" ++ ) + + set(BIKE_R3_VPCLMUL_FLAGS "-mvpclmulqdq -mavx512f -mavx512bw -mavx512dq") +- try_compile(BIKE_R3_VPCLMUL_SUPPORTED +- ${CMAKE_BINARY_DIR} +- "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" +- COMPILE_DEFINITIONS ${BIKE_R3_VPCLMUL_FLAGS}) ++ try_compile( ++ BIKE_R3_VPCLMUL_SUPPORTED ++ ${CMAKE_BINARY_DIR} ++ SOURCES ++ "${CMAKE_CURRENT_LIST_DIR}/tests/features/noop_main.c" ++ "${CMAKE_CURRENT_LIST_DIR}/pq-crypto/bike_r3/gf2x_mul_base_vpclmul.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "${BIKE_R3_VPCLMUL_FLAGS} -DS2N_BIKE_R3_VPCLMUL" ++ ) + + if(BIKE_R3_AVX2_SUPPORTED OR BIKE_R3_AVX512_SUPPORTED OR BIKE_R3_PCLMUL_SUPPORTED OR BIKE_R3_VPCLMUL_SUPPORTED) + set(BIKE_R3_X86_64_OPT_SUPPORTED ON) +@@ -312,31 +333,36 @@ if(BIKE_R3_X86_64_OPT_SUPPORTED) + # If any of the BIKE_R3 x86_64 optimizations is supported (this was checked + # earlier in the file), we add the required compile flags to files that + # contain the optimized code. ++ ++ message(STATUS "Enabling BIKE_R3 x86_64 optimizations") ++ + if(BIKE_R3_AVX2_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_AVX2") + FILE(GLOB BIKE_R3_AVX2_SRCS "pq-crypto/bike_r3/*_avx2.c") + set_source_files_properties(${BIKE_R3_AVX2_SRCS} PROPERTIES COMPILE_FLAGS -mavx2) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_AVX2) + endif() + + if(BIKE_R3_AVX512_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_AVX512") + FILE(GLOB BIKE_R3_AVX512_SRCS "pq-crypto/bike_r3/*_avx512.c") + set_source_files_properties(${BIKE_R3_AVX512_SRCS} PROPERTIES COMPILE_FLAGS ${BIKE_R3_AVX512_FLAGS}) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_AVX512) + endif() + + if(BIKE_R3_PCLMUL_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_PCLMUL") + FILE(GLOB BIKE_R3_PCLMUL_SRCS "pq-crypto/bike_r3/*_pclmul.c") + set_source_files_properties(${BIKE_R3_PCLMUL_SRCS} PROPERTIES COMPILE_FLAGS ${BIKE_R3_PCLMUL_FLAGS}) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_PCLMUL) + endif() + + if(BIKE_R3_VPCLMUL_SUPPORTED) ++ message(STATUS "\t Enabling BIKE_R3_VPCLMUL") + FILE(GLOB BIKE_R3_VPCLMUL_SRCS "pq-crypto/bike_r3/*_vpclmul.c") + set_source_files_properties(${BIKE_R3_VPCLMUL_SRCS} PROPERTIES COMPILE_FLAGS ${BIKE_R3_VPCLMUL_FLAGS}) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_BIKE_R3_VPCLMUL) + endif() +- +- message(STATUS "Enabling BIKE_R3 x86_64 optimizations") + endif() + + if(KYBER512R3_AVX2_BMI2_OPT_SUPPORTED) diff --git a/recipes/s2n/all/test_package/CMakeLists.txt b/recipes/s2n/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f57c92d6fe12 --- /dev/null +++ b/recipes/s2n/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(s2n REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::s2n) diff --git a/recipes/s2n/all/test_package/conanfile.py b/recipes/s2n/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/s2n/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/s2n/all/test_package/test_package.c b/recipes/s2n/all/test_package/test_package.c new file mode 100644 index 0000000000000..0974d29299d28 --- /dev/null +++ b/recipes/s2n/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main() { + s2n_init(); + s2n_cleanup(); + + return 0; +} diff --git a/recipes/s2n/all/test_v1_package/CMakeLists.txt b/recipes/s2n/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/s2n/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/s2n/all/test_v1_package/conanfile.py b/recipes/s2n/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/s2n/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/s2n/config.yml b/recipes/s2n/config.yml new file mode 100644 index 0000000000000..611e0f7be0d88 --- /dev/null +++ b/recipes/s2n/config.yml @@ -0,0 +1,15 @@ +versions: + "1.3.31": + folder: all + "1.3.15": + folder: all + "1.3.9": + folder: all + "1.2.0": + folder: all + "1.1.1": + folder: all + "1.1.0": + folder: all + "1.0.11": + folder: all diff --git a/recipes/safeint/all/conandata.yml b/recipes/safeint/all/conandata.yml new file mode 100644 index 0000000000000..d7d9da2a8ca9b --- /dev/null +++ b/recipes/safeint/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.0.28": + url: "https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.28.tar.gz" + sha256: "d6b164bcea92a746e4d44132e505c7ab1816d1089ba99ebc674ccd4b70262ed5" + "3.0.27": + url: "https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.27.tar.gz" + sha256: "489abb253514f819adb7e3aab3273b184c484dfe082fbe2166de2fd3a88dfb2b" + "3.0.26": + url: "https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.26.tar.gz" + sha256: "62fef99873ad975ddd8356923b3d51ed316209c1a05ac85814219373a13ae4d5" + "3.24": + url: "https://github.com/dcleblanc/SafeInt/archive/3.24.tar.gz" + sha256: "af6c7222a8420f6f87e198dc94791c28da75fe7241b605342c333fd03fd9dea6" diff --git a/recipes/safeint/all/conanfile.py b/recipes/safeint/all/conanfile.py new file mode 100644 index 0000000000000..4684b477dabb7 --- /dev/null +++ b/recipes/safeint/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class SafeintConan(ConanFile): + name = "safeint" + description = "SafeInt is a class library for C++ that manages integer overflows." + license = "MIT" + topics = ("integer", "overflow", "header-only") + package_type = "header-library" + homepage = "https://github.com/dcleblanc/SafeInt" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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, "SafeInt.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/safeint/all/test_package/CMakeLists.txt b/recipes/safeint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..947fe8e635a5d --- /dev/null +++ b/recipes/safeint/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(safeint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE safeint::safeint) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/safeint/all/test_package/conanfile.py b/recipes/safeint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/safeint/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/safeint/all/test_package/test_package.cpp b/recipes/safeint/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dea4e769f3440 --- /dev/null +++ b/recipes/safeint/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + SafeInt i1(1); + SafeInt i2(2); + auto i3 = i1 + i2; + return 0; +} diff --git a/recipes/safeint/all/test_v1_package/CMakeLists.txt b/recipes/safeint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/safeint/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/safeint/all/test_v1_package/conanfile.py b/recipes/safeint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/safeint/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/safeint/config.yml b/recipes/safeint/config.yml new file mode 100644 index 0000000000000..42f746c8b3d65 --- /dev/null +++ b/recipes/safeint/config.yml @@ -0,0 +1,9 @@ +versions: + "3.0.28": + folder: all + "3.0.27": + folder: all + "3.0.26": + folder: all + "3.24": + folder: all diff --git a/recipes/sail/all/conandata.yml b/recipes/sail/all/conandata.yml new file mode 100644 index 0000000000000..3233a1960c7bf --- /dev/null +++ b/recipes/sail/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.9.0-rc2": + url: "https://github.com/smoked-herring/sail/archive/v0.9.0-rc2.tar.gz" + sha256: "988d318fd4cfbc77ccbda49f4ac751d1998b990db157aef32b0dbd32d11f8fd6" +patches: + "0.9.0-rc2": + - patch_file: "patches/0.9.0-rc2-avif-find-package.patch" + patch_type: "conan" + patch_description: "Make the AVIF codec use find_package()" diff --git a/recipes/sail/all/conanfile.py b/recipes/sail/all/conanfile.py new file mode 100644 index 0000000000000..6832bd1f1a055 --- /dev/null +++ b/recipes/sail/all/conanfile.py @@ -0,0 +1,197 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rename, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class SAILConan(ConanFile): + name = "sail" + description = "The missing small and fast image decoding library for humans (not for machines)" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sail.software" + topics = ( "image", "encoding", "decoding", "graphics" ) + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "thread_safe": [True, False], + "with_avif": [True, False], + "with_gif": [True, False], + "with_jpeg2000": [True, False], + "with_jpeg": ["libjpeg", "libjpeg-turbo", False], + "with_png": [True, False], + "with_tiff": [True, False], + "with_webp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "thread_safe": True, + "with_avif": True, + "with_gif": True, + "with_jpeg2000": True, + "with_jpeg": "libjpeg", + "with_png": True, + "with_tiff": True, + "with_webp": True, + } + + def export_sources(self): + export_conandata_patches(self) + + 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 requirements(self): + if self.options.with_avif: + self.requires("libavif/0.11.1") + if self.options.with_gif: + self.requires("giflib/5.2.1") + if self.options.with_jpeg2000: + self.requires("jasper/2.0.33") + if self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + elif self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + if self.options.with_png: + self.requires("libpng/1.6.39") + if self.options.with_tiff: + self.requires("libtiff/4.4.0") + if self.options.with_webp: + self.requires("libwebp/1.2.4") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self.source_folder) + + def generate(self): + enable_codecs = [] + + if self.options.with_avif: + enable_codecs.append("avif") + if self.options.with_gif: + enable_codecs.append("gif") + if self.options.with_jpeg2000: + enable_codecs.append("jpeg2000") + if self.options.with_jpeg: + enable_codecs.append("jpeg") + if self.options.with_png: + enable_codecs.append("png") + if self.options.with_tiff: + enable_codecs.append("tiff") + if self.options.with_webp: + enable_codecs.append("webp") + + tc = CMakeToolchain(self) + tc.variables["SAIL_BUILD_APPS"] = False + tc.variables["SAIL_BUILD_EXAMPLES"] = False + tc.variables["SAIL_BUILD_TESTS"] = False + tc.variables["SAIL_COMBINE_CODECS"] = True + tc.variables["SAIL_ENABLE_CODECS"] = ";".join(enable_codecs) + tc.variables["SAIL_INSTALL_PDB"] = False + tc.variables["SAIL_THREAD_SAFE"] = self.options.thread_safe + # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 + # C3I workaround to force CMake to choose the highest version of + # the windows SDK available in the system + if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + tc.generate() + + 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.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE.INIH.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE.MUNIT.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + + cmake = CMake(self) + cmake.install() + + # Remove CMake and pkg-config rules + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + # Move icons + rename(self, os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Sail") + + self.cpp_info.filenames["cmake_find_package"] = "Sail" + self.cpp_info.filenames["cmake_find_package_multi"] = "Sail" + self.cpp_info.names["cmake_find_package"] = "SAIL" + self.cpp_info.names["cmake_find_package_multi"] = "SAIL" + + self.cpp_info.components["sail-common"].set_property("cmake_target_name", "SAIL::SailCommon") + self.cpp_info.components["sail-common"].set_property("pkg_config_name", "libsail-common") + self.cpp_info.components["sail-common"].names["cmake_find_package"] = "SailCommon" + self.cpp_info.components["sail-common"].names["cmake_find_package_multi"] = "SailCommon" + self.cpp_info.components["sail-common"].includedirs = ["include/sail"] + self.cpp_info.components["sail-common"].libs = ["sail-common"] + + self.cpp_info.components["sail-codecs"].set_property("cmake_target_name", "SAIL::SailCodecs") + self.cpp_info.components["sail-codecs"].names["cmake_find_package"] = "SailCodecs" + self.cpp_info.components["sail-codecs"].names["cmake_find_package_multi"] = "SailCodecs" + self.cpp_info.components["sail-codecs"].libs = ["sail-codecs"] + self.cpp_info.components["sail-codecs"].requires = ["sail-common"] + if self.options.with_avif: + self.cpp_info.components["sail-codecs"].requires.append("libavif::libavif") + if self.options.with_gif: + self.cpp_info.components["sail-codecs"].requires.append("giflib::giflib") + if self.options.with_jpeg2000: + self.cpp_info.components["sail-codecs"].requires.append("jasper::jasper") + if self.options.with_jpeg: + self.cpp_info.components["sail-codecs"].requires.append("{0}::{0}".format(self.options.with_jpeg)) + if self.options.with_png: + self.cpp_info.components["sail-codecs"].requires.append("libpng::libpng") + if self.options.with_tiff: + self.cpp_info.components["sail-codecs"].requires.append("libtiff::libtiff") + if self.options.with_webp: + self.cpp_info.components["sail-codecs"].requires.append("libwebp::libwebp") + + self.cpp_info.components["libsail"].set_property("cmake_target_name", "SAIL::Sail") + self.cpp_info.components["libsail"].set_property("pkg_config_name", "libsail") + self.cpp_info.components["libsail"].names["cmake_find_package"] = "Sail" + self.cpp_info.components["libsail"].names["cmake_find_package_multi"] = "Sail" + self.cpp_info.components["libsail"].libs = ["sail"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libsail"].system_libs.append("dl") + if self.options.thread_safe: + self.cpp_info.components["libsail"].system_libs.append("pthread") + self.cpp_info.components["libsail"].requires = ["sail-common", "sail-codecs"] + + self.cpp_info.components["sail-manip"].set_property("cmake_target_name", "SAIL::SailManip") + self.cpp_info.components["sail-manip"].set_property("pkg_config_name", "libsail-manip") + self.cpp_info.components["sail-manip"].names["cmake_find_package"] = "SailManip" + self.cpp_info.components["sail-manip"].names["cmake_find_package_multi"] = "SailManip" + self.cpp_info.components["sail-manip"].libs = ["sail-manip"] + self.cpp_info.components["sail-manip"].requires = ["sail-common"] + + self.cpp_info.components["sail-c++"].set_property("cmake_target_name", "SAIL::SailC++") + self.cpp_info.components["sail-c++"].set_property("pkg_config_name", "libsail-c++") + self.cpp_info.components["sail-c++"].names["cmake_find_package"] = "SailC++" + self.cpp_info.components["sail-c++"].names["cmake_find_package_multi"] = "SailC++" + self.cpp_info.components["sail-c++"].libs = ["sail-c++"] + self.cpp_info.components["sail-c++"].requires = ["libsail", "sail-manip"] diff --git a/recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch b/recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch new file mode 100644 index 0000000000000..98ec3b23d5ae9 --- /dev/null +++ b/recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch @@ -0,0 +1,22 @@ +diff --git a/src/sail-codecs/avif/CMakeLists.txt b/src/sail-codecs/avif/CMakeLists.txt +index 3f36e0c8..1e31be83 100644 +--- a/src/sail-codecs/avif/CMakeLists.txt ++++ b/src/sail-codecs/avif/CMakeLists.txt +@@ -1,7 +1,6 @@ +-find_library(AVIF_LIBRARY avif ${SAIL_CODEC_AVIF_REQUIRED_OPTION}) +-find_path(AVIF_INCLUDE_DIRS avif/avif.h ${SAIL_CODEC_AVIF_REQUIRED_OPTION}) ++find_package(libavif ${SAIL_CODEC_AVIF_REQUIRED_OPTION}) + +-if (NOT AVIF_LIBRARY OR NOT AVIF_INCLUDE_DIRS) ++if (NOT libavif_FOUND) + return() + endif() + +@@ -18,5 +17,5 @@ set(SAIL_CODECS_FIND_DEPENDENCIES ${SAIL_CODECS_FIND_DEPENDENCIES} "find_depende + sail_codec(NAME avif + SOURCES helpers.h helpers.c io.h io.c avif.c + ICON avif.png +- DEPENDENCY_INCLUDE_DIRS ${AVIF_INCLUDE_DIRS} +- DEPENDENCY_LIBS ${AVIF_LIBRARY}) ++ DEPENDENCY_INCLUDE_DIRS ${avif_INCLUDE_DIRS} ++ DEPENDENCY_LIBS avif) diff --git a/recipes/sail/all/test_package/CMakeLists.txt b/recipes/sail/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79614592c76dc --- /dev/null +++ b/recipes/sail/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C CXX) + +# Enable strict C++11 +# +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +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 new file mode 100644 index 0000000000000000000000000000000000000000..74d4973a3b13c5f6b33aec025a0f739ee699a65e GIT binary patch literal 246 zcmZ?r{l)+RWk5;;hy|dSk%0vw0VIXEAs8+IWc&wWS65dCA0Hovb?eqKY}l}Y;lzm( z40rF|W%&I0GsFM?AQjjFvoQ!5Fqox*fB}P%5(F3uf`O3X%!v~vB?W~HCqij3elkP$UG383^E@?w+DdjNiJbv09zZtzyJV;3N)So literal 0 HcmV?d00001 diff --git a/recipes/sail/all/test_package/conanfile.py b/recipes/sail/all/test_package/conanfile.py new file mode 100644 index 0000000000000..00e3064a021c0 --- /dev/null +++ b/recipes/sail/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + +class TestPackageConan(ConanFile): + settings = "os", "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_c") + self.run(bin_path, env="conanrun") + + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cxx") + self.run(bin_path, env="conanrun") diff --git a/recipes/sail/all/test_package/test_package.c b/recipes/sail/all/test_package/test_package.c new file mode 100644 index 0000000000000..eba9d786722c4 --- /dev/null +++ b/recipes/sail/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include + +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + 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; +} diff --git a/recipes/sail/all/test_package/test_package.cpp b/recipes/sail/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..efad1f9a8c2e3 --- /dev/null +++ b/recipes/sail/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + const sail::image image(SAIL_DEMO_FILE_PATH); + + if (!image.is_valid()) { + return 1; + } + + 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/CMakeLists.txt b/recipes/sail/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..dbf35d5521717 --- /dev/null +++ b/recipes/sail/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C 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/sail/all/test_v1_package/bmp.bmp b/recipes/sail/all/test_v1_package/bmp.bmp new file mode 100644 index 0000000000000000000000000000000000000000..74d4973a3b13c5f6b33aec025a0f739ee699a65e GIT binary patch literal 246 zcmZ?r{l)+RWk5;;hy|dSk%0vw0VIXEAs8+IWc&wWS65dCA0Hovb?eqKY}l}Y;lzm( z40rF|W%&I0GsFM?AQjjFvoQ!5Fqox*fB}P%5(F3uf`O3X%!v~vB?W~HCqij3elkP$UG383^E@?w+DdjNiJbv09zZtzyJV;3N)So literal 0 HcmV?d00001 diff --git a/recipes/sail/all/test_v1_package/conanfile.py b/recipes/sail/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e1256a3fd44fe --- /dev/null +++ b/recipes/sail/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package", "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_c") + self.run(bin_path, run_environment=True) + + bin_path = os.path.join("bin", "test_package_cxx") + self.run(bin_path, run_environment=True) diff --git a/recipes/sail/config.yml b/recipes/sail/config.yml new file mode 100644 index 0000000000000..4b9680ce33efb --- /dev/null +++ b/recipes/sail/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.0-rc2": + folder: all diff --git a/recipes/samarium/all/conandata.yml b/recipes/samarium/all/conandata.yml new file mode 100644 index 0000000000000..06463f7d62302 --- /dev/null +++ b/recipes/samarium/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "1.0.0": + sha256: 943de75803f492f78c5d55fe43be298fbb66156cc22946a3c6cc6b0634efc2e2 + url: https://github.com/strangeQuark1041/samarium/archive/refs/tags/v1.0.0.tar.gz + "1.0.1": + sha256: 3748ad1095805338d0d54ca7b60a155520188970946b247d56cc9b5eeb397358 + url: https://github.com/strangeQuark1041/samarium/archive/refs/tags/v1.0.1.tar.gz +patches: + "1.0.0": + - patch_file: "patches/1.0.0-updated-cmake.patch" + patch_description: "Use find_package for CMakeDeps" + patch_type: "conan" + sha256: "2be2eadc468fe676f547793fc7ec48bc38ce6f1daa47a497cd2535aaa493fa9a" + + - patch_file: "patches/1.0.0-Grid.hpp-include-vector.patch" + patch_description: "add missing #include " + patch_type: "portability" + sha256: "0326eb790fc55630efe138bc9b359754d2de23c4aa37179faa04821f83efa9c3" + + - patch_file: "patches/1.0.0-RandomGenerator.hpp-link.patch" + patch_description: "Fix static function linking" + patch_type: "portability" + sha256: "218318c017500ab4c6360dafaf0523736295ddac323c04aaad5fc8a31867b4f0" + + - patch_file: "patches/1.0.0-RandomGenerator.cpp-link.patch" + patch_description: "Fix static function linking" + patch_type: "portability" + sha256: "f5d0cc6a108bb3f5f22a88c29f5eda1ddf73c25720e894e7ac3c67396e687087" diff --git a/recipes/samarium/all/conanfile.py b/recipes/samarium/all/conanfile.py new file mode 100644 index 0000000000000..6f1215fe6e6c6 --- /dev/null +++ b/recipes/samarium/all/conanfile.py @@ -0,0 +1,86 @@ +from os import path + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import patch, copy, get +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.47.0" + + +class SamariumConan(ConanFile): + name = "samarium" + description = "2-D physics simulation library" + homepage = "https://strangequark1041.github.io/samarium/" + url = "https://github.com/conan-io/conan-center-index/" + license = "MIT" + topics = ("cpp20", "physics", "2d", "simulation") + generators = "CMakeDeps", "CMakeToolchain" + requires = "fmt/9.0.0", "sfml/2.5.1", "range-v3/0.12.0", "stb/cci.20210910", "tl-expected/20190710" + + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [ + True, False]} + default_options = {"shared": False, "fPIC": True} + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11.0", + "Visual Studio": "16", + "clang": "13", + "apple-clang": "13", + } + + def source(self): + get(self, **self.conan_data["sources"] + [str(self.version)], strip_root=True) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + if self.version == "1.0.0" and self.settings.os == "Macos": + raise ConanInvalidConfiguration("Macos not supported for v1.0.0") + + compiler = str(self.settings.compiler) + if compiler not in self._compilers_minimum_version: + self.output.warn( + "Unknown compiler, assuming it supports at least C++20") + return + + version = Version(self.settings.compiler.version) + if version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++20") + + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def build(self): + for patch_ in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, **patch_) + + cmake = CMake(self) + cmake.configure(build_script_folder="src") + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.folders.source_folder, + dst=path.join(self.package_folder, "licenses")) + + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["samarium"] diff --git a/recipes/samarium/all/patches/1.0.0-Grid.hpp-include-vector.patch b/recipes/samarium/all/patches/1.0.0-Grid.hpp-include-vector.patch new file mode 100644 index 0000000000000..9ce690f42e82c --- /dev/null +++ b/recipes/samarium/all/patches/1.0.0-Grid.hpp-include-vector.patch @@ -0,0 +1,12 @@ +diff --git a/src/samarium/graphics/Grid.hpp b/src/samarium/graphics/Grid.hpp +index 25ba647..0f0ccac 100644 +--- a/src/samarium/graphics/Grid.hpp ++++ b/src/samarium/graphics/Grid.hpp +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "fmt/format.h" + #include "range/v3/algorithm/copy.hpp" diff --git a/recipes/samarium/all/patches/1.0.0-RandomGenerator.cpp-link.patch b/recipes/samarium/all/patches/1.0.0-RandomGenerator.cpp-link.patch new file mode 100644 index 0000000000000..8b951e545c4d1 --- /dev/null +++ b/recipes/samarium/all/patches/1.0.0-RandomGenerator.cpp-link.patch @@ -0,0 +1,22 @@ +diff --git a/src/samarium/util/RandomGenerator.cpp b/src/samarium/util/RandomGenerator.cpp +index d1a17d6..84c964b 100644 +--- a/src/samarium/util/RandomGenerator.cpp ++++ b/src/samarium/util/RandomGenerator.cpp +@@ -75,17 +75,6 @@ void RandomGenerator::reseed(u64 new_seed) + ranges::generate(cache, [this] { return this->next_scaled(); }); + } + +-[[nodiscard]] auto RandomGenerator::next() noexcept -> u64 +-{ +- const auto oldstate = this->state; +- // Advance internal state +- this->state = oldstate * magic_number + (this->inc | 1); +- // Calculate output function (XSH RR), uses old state for max ILP +- const auto xorshifted = static_cast(((oldstate >> 18UL) ^ oldstate) >> 27UL); +- const auto rot = static_cast(oldstate >> 59UL); +- return (xorshifted >> rot) | (xorshifted << ((-rot) & 31)); +-} +- + [[nodiscard]] auto RandomGenerator::next_scaled() noexcept -> f64 + { + return static_cast(this->next()) / static_cast(std::numeric_limits::max()); diff --git a/recipes/samarium/all/patches/1.0.0-RandomGenerator.hpp-link.patch b/recipes/samarium/all/patches/1.0.0-RandomGenerator.hpp-link.patch new file mode 100644 index 0000000000000..15444d4236758 --- /dev/null +++ b/recipes/samarium/all/patches/1.0.0-RandomGenerator.hpp-link.patch @@ -0,0 +1,34 @@ +diff --git a/src/samarium/util/RandomGenerator.hpp b/src/samarium/util/RandomGenerator.hpp +index b86224f..4f48424 100644 +--- a/src/samarium/util/RandomGenerator.hpp ++++ b/src/samarium/util/RandomGenerator.hpp +@@ -49,14 +49,27 @@ struct RandomGenerator + } + state = new_state * magic_number + (new_inc | 1); + +- ranges::generate(cache, [this] { return this->next_scaled(); }); ++ ranges::generate(cache, ++ [this] { ++ return static_cast(this->next()) / ++ static_cast(std::numeric_limits::max()); ++ }); + } + + void resize(u64 new_size); + + void reseed(u64 new_seed); + +- [[nodiscard]] auto next() noexcept -> u64; ++ [[nodiscard]] auto next() noexcept -> u64 ++ { ++ const auto oldstate = this->state; ++ // Advance internal state ++ this->state = oldstate * magic_number + (this->inc | 1); ++ // Calculate output function (XSH RR), uses old state for max ILP ++ const auto xorshifted = static_cast(((oldstate >> 18UL) ^ oldstate) >> 27UL); ++ const auto rot = static_cast(oldstate >> 59UL); ++ return (xorshifted >> rot) | (xorshifted << ((-rot) & 31)); ++ } + + [[nodiscard]] auto next_scaled() noexcept -> f64; + diff --git a/recipes/samarium/all/patches/1.0.0-updated-cmake.patch b/recipes/samarium/all/patches/1.0.0-updated-cmake.patch new file mode 100644 index 0000000000000..db7d5eb7a83be --- /dev/null +++ b/recipes/samarium/all/patches/1.0.0-updated-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0cc8517..aff82dd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -42,28 +42,13 @@ if(WARNINGS) + target_compile_options(samarium PUBLIC ${WARNINGS}) + endif() + +-option(SAMARIUM_USE_CONAN "Use Conan to find dependencies" TRUE) +-if(SAMARIUM_USE_CONAN) +- message(STATUS "src/CMakeLists.txt: Using Conan for deps") ++find_package(SFML 2.5 CONFIG REQUIRED) ++find_package(fmt CONFIG REQUIRED) ++find_package(range-v3 CONFIG REQUIRED) + +- include(conanbuildinfo) +- conan_basic_setup(TARGETS) +- +- target_link_libraries(samarium PRIVATE CONAN_PKG::fmt) +- target_link_libraries(samarium PRIVATE CONAN_PKG::sfml) +- target_link_libraries(samarium PRIVATE CONAN_PKG::range-v3) +- +-else() +- find_package( +- SFML 2.5 +- COMPONENTS system window graphics +- REQUIRED +- ) +- +- find_package(fmt REQUIRED) +- target_link_libraries(samarium PRIVATE fmt::fmt) +- target_link_libraries(samarium PRIVATE sfml-system sfml-window sfml-graphics) +-endif() ++target_link_libraries(samarium PRIVATE fmt::fmt) ++target_link_libraries(samarium PRIVATE sfml-system sfml-window sfml-graphics) ++target_link_libraries(samarium PRIVATE range-v3::range-v3) + + install( + TARGETS samarium diff --git a/recipes/samarium/all/test_package/CMakeLists.txt b/recipes/samarium/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5223fd5cb739b --- /dev/null +++ b/recipes/samarium/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(samarium REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} samarium::samarium) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) diff --git a/recipes/samarium/all/test_package/conanfile.py b/recipes/samarium/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fd0c8a7b2b6cb --- /dev/null +++ b/recipes/samarium/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import cross_building + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/samarium/all/test_package/test_package.cpp b/recipes/samarium/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f16dd948c92df --- /dev/null +++ b/recipes/samarium/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "samarium/samarium.hpp" + +int main() +{ + const auto im = sm::Image{sm::dimsFHD}; + fmt::print(fmt::emphasis::bold, "\nSuccessful installation!\n"); + fmt::print(fmt::emphasis::bold, "Welcome to {}\n", sm::version); +} diff --git a/recipes/samarium/config.yml b/recipes/samarium/config.yml new file mode 100644 index 0000000000000..5e61e3082c4f0 --- /dev/null +++ b/recipes/samarium/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.0": + folder: all + "1.0.1": + folder: all diff --git a/recipes/sassc/all/conandata.yml b/recipes/sassc/all/conandata.yml new file mode 100644 index 0000000000000..5119b677bea74 --- /dev/null +++ b/recipes/sassc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.6.2": + url: "https://github.com/sass/sassc/archive/3.6.2.tar.gz" + sha256: "608dc9002b45a91d11ed59e352469ecc05e4f58fc1259fc9a9f5b8f0f8348a03" + "3.6.1": + sha256: 8cee391c49a102b4464f86fc40c4ceac3a2ada52a89c4c933d8348e3e4542a60 + url: https://github.com/sass/sassc/archive/3.6.1.tar.gz diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py new file mode 100644 index 0000000000000..b9452a96ffc40 --- /dev/null +++ b/recipes/sassc/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, replace_in_file, chdir, save +from conan.tools.microsoft import is_msvc +from conans import AutoToolsBuildEnvironment, tools, MSBuild +import os + +required_conan_version = ">=1.47.0" + + +class SasscConan(ConanFile): + name = "sassc" + license = "MIT" + homepage = "https://sass-lang.com/libsass" + url = "https://github.com/conan-io/conan-center-index" + description = "libsass command line driver" + topics = ("Sass", "sassc", "compiler") + settings = "os", "compiler", "build_type", "arch" + generators = "visual_studio" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if not is_msvc(self) and self.info.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration("sassc supports only Linux, FreeBSD, Macos and Windows Visual Studio at this time, contributions are welcomed") + + def requirements(self): + self.requires("libsass/3.6.5") + + def build_requirements(self): + if not is_msvc(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 _patch_sources(self): + replace_in_file(self, + os.path.join(self.build_folder, self._source_subfolder, "win", "sassc.vcxproj"), + "$(LIBSASS_DIR)\\win\\libsass.targets", + os.path.join(self.build_folder, "conanbuildinfo.props")) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + self._autotools.configure(args=["--disable-tests"]) + return self._autotools + + def _build_msbuild(self): + msbuild = MSBuild(self) + platforms = { + "x86": "Win32", + "x86_64": "Win64" + } + msbuild.build("win/sassc.sln", platforms=platforms) + + def build(self): + self._patch_sources() + with chdir(self, self._source_subfolder): + if is_msvc(self): + self._build_msbuild() + else: + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True) + save(self, path="VERSION", content=f"{self.version}") + autotools = self._configure_autotools() + autotools.make() + + def package(self): + with chdir(self, self._source_subfolder): + if is_msvc(self): + self.copy("*.exe", dst="bin", src=os.path.join(self._source_subfolder, "bin"), keep_path=False) + else: + autotools = self._configure_autotools() + autotools.install() + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + bin_folder = os.path.join(self.package_folder, "bin") + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(bin_folder) diff --git a/recipes/sassc/all/test_package/conanfile.py b/recipes/sassc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..70d62ab9bfc61 --- /dev/null +++ b/recipes/sassc/all/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class LibsassTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + if not tools.cross_building(self): + self.run("sassc --version", run_environment=True) diff --git a/recipes/sassc/config.yml b/recipes/sassc/config.yml new file mode 100644 index 0000000000000..bfe5b909d834d --- /dev/null +++ b/recipes/sassc/config.yml @@ -0,0 +1,5 @@ +versions: + "3.6.2": + folder: all + "3.6.1": + folder: all diff --git a/recipes/sbp/all/CMakeLists.txt b/recipes/sbp/all/CMakeLists.txt new file mode 100644 index 0000000000000..454b398b885e5 --- /dev/null +++ b/recipes/sbp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder/c") diff --git a/recipes/sbp/all/conandata.yml b/recipes/sbp/all/conandata.yml new file mode 100644 index 0000000000000..f640026c27acb --- /dev/null +++ b/recipes/sbp/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "3.4.10": + cmake: + url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" + sha256: 6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894 + source: + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" + sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 + "4.2.0": + cmake: + url: "https://github.com/swift-nav/cmake/archive/31604e72e72c09fa32effdbc37acc79dda7c99d7.zip" + sha256: 22e0ef6915ad5accfa6c0b30cb75a7d409ee1e08746f5ee92311015aa3826246 + source: + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.2.0.tar.gz" + sha256: 9ee9808394867405938505fb0aa52ffeb8d98b7ce222e47629ffabdc9e23d3e4 diff --git a/recipes/sbp/all/conanfile.py b/recipes/sbp/all/conanfile.py new file mode 100644 index 0000000000000..77edf2fd79a3e --- /dev/null +++ b/recipes/sbp/all/conanfile.py @@ -0,0 +1,70 @@ +import os + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class SbpConan(ConanFile): + name = "sbp" + license = "MIT" + homepage = "https://github.com/swift-nav/libsbp" + url = "https://github.com/conan-io/conan-center-index" + description = "Swift Binary Protocol client library" + topics = ("gnss",) + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "cmake" + exports_sources = "CMakeLists.txt", "c" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Windows shared builds are not supported right now, see issue https://github.com/swift-nav/libsbp/issues/1062") + + def source(self): + data = self.conan_data["sources"][self.version] + + tools.get(**data["source"], strip_root=True, destination=self._source_subfolder) + tools.get(**data["cmake"], strip_root=True, destination=os.path.join(self._source_subfolder, "c", "cmake", "common")) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["libsbp_ENABLE_TESTS"] = False + self._cmake.definitions["libsbp_ENABLE_DOCS"] = False + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy( + "LICENSE", + src=self._source_subfolder, + dst="licenses", + ignore_case=True, + keep_path=False, + ) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["sbp"] diff --git a/recipes/sbp/all/test_package/CMakeLists.txt b/recipes/sbp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d9693fa5cada2 --- /dev/null +++ b/recipes/sbp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sbp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE sbp::sbp) diff --git a/recipes/sbp/all/test_package/conanfile.py b/recipes/sbp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sbp/all/test_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/sbp/all/test_package/test_package.c b/recipes/sbp/all/test_package/test_package.c new file mode 100644 index 0000000000000..1242082b631bb --- /dev/null +++ b/recipes/sbp/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include + +#include +#include + +int main(void) { + fprintf(stderr, "Compiled with sbp %s.\n", SBP_VERSION); + + sbp_state_t s; + sbp_state_init(&s); + + return 0; +} diff --git a/recipes/sbp/config.yml b/recipes/sbp/config.yml new file mode 100644 index 0000000000000..84cd65924d4fb --- /dev/null +++ b/recipes/sbp/config.yml @@ -0,0 +1,5 @@ +versions: + "3.4.10": + folder: "all" + "4.2.0": + folder: "all" diff --git a/recipes/scc/all/CMakeLists.txt b/recipes/scc/all/CMakeLists.txt new file mode 100644 index 0000000000000..19bdb7e7f5fb7 --- /dev/null +++ b/recipes/scc/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..bd7433056072d --- /dev/null +++ b/recipes/scc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2022.08": + url: "https://github.com/Minres/SystemC-Components/releases/download/2022.08/systemc-components.tar.gz" + sha256: "825dfc38e7b00df34330f01ba38f5913e1a88c5002344e433b972faf0e6c4501" diff --git a/recipes/scc/all/conanfile.py b/recipes/scc/all/conanfile.py new file mode 100644 index 0000000000000..c95474718f1dd --- /dev/null +++ b/recipes/scc/all/conanfile.py @@ -0,0 +1,89 @@ +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 + +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" + license = "Apache-2.0" + topics = ("systemc", "modeling", "tlm", "scc") + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "enable_phase_callbacks": [True, False], + "enable_phase_callbacks_tracing": [True, False] + } + default_options = { + "fPIC": True, + "enable_phase_callbacks": 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") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + 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}.") + 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") + + @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 + if self.settings.os == "Windows": + cmake.definitions["SCC_LIMIT_TRACE_TYPE_LIST"] = True + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + 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-util"].libs = ["scc-util"] + self.cpp_info.components["scv-tr"].libs = ["scv-tr"] + self.cpp_info.components["tlm-interfaces"].libs = ["tlm-interfaces"] diff --git a/recipes/scc/all/test_package/CMakeLists.txt b/recipes/scc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b74b2d8e566a6 --- /dev/null +++ b/recipes/scc/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(scc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} scc::scc) diff --git a/recipes/scc/all/test_package/conanfile.py b/recipes/scc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48f7a8523a636 --- /dev/null +++ b/recipes/scc/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +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" + + 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/scc/all/test_package/example.cpp b/recipes/scc/all/test_package/example.cpp new file mode 100644 index 0000000000000..2de9f26d9f75d --- /dev/null +++ b/recipes/scc/all/test_package/example.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main(int argc, char* argv[]) { + 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 new file mode 100644 index 0000000000000..f8b19962361c1 --- /dev/null +++ b/recipes/scc/config.yml @@ -0,0 +1,3 @@ +versions: + "2022.08": + folder: "all" diff --git a/recipes/scdoc/all/conandata.yml b/recipes/scdoc/all/conandata.yml new file mode 100644 index 0000000000000..9859fdd9fbe4b --- /dev/null +++ b/recipes/scdoc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.11.12": + url: "https://git.sr.ht/~sircmpwn/scdoc/archive/1.11.2.tar.gz" + sha256: "e9ff9981b5854301789a6778ee64ef1f6d1e5f4829a9dd3e58a9a63eacc2e6f0" diff --git a/recipes/scdoc/all/conanfile.py b/recipes/scdoc/all/conanfile.py new file mode 100644 index 0000000000000..511b322627676 --- /dev/null +++ b/recipes/scdoc/all/conanfile.py @@ -0,0 +1,79 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class ScdocInstallerConan(ConanFile): + name = "scdoc" + description = "scdoc is a simple man page generator for POSIX systems written in C99." + topics = ("manpage", "documentation", "posix") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.sr.ht/~sircmpwn/scdoc" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def build_requirements(self): + self.build_requires("make/4.3") + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def package_id(self): + del self.info.settings.compiler + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, + destination=self._source_subfolder) + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + with tools.chdir(self._source_subfolder): + autotools.make() + + def package(self): + autotools = self._configure_autotools() + with tools.chdir(self._source_subfolder): + autotools.install(args=[f"PREFIX={self.package_folder}"]) + self.copy(pattern="COPYING", dst="licenses", + src=self._source_subfolder) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + + scdoc_root = os.path.join(self.package_folder, "bin") + self.output.info( + "Appending PATH environment variable: {}".format(scdoc_root)) + self.env_info.PATH.append(scdoc_root) + self._chmod_plus_x(os.path.join(scdoc_root, "scdoc")) + pkgconfig_variables = { + 'exec_prefix': '${prefix}/bin', + 'scdoc': '${exec_prefix}/scdoc', + } + self.cpp_info.set_property( + "pkg_config_custom_content", + "\n".join("%s=%s" % (key, value) for key,value in pkgconfig_variables.items())) + + def validate(self): + if self.settings.os in ["Macos", "Windows"]: + raise ConanInvalidConfiguration( + f"Builds aren't supported on {self.settings.os}") diff --git a/recipes/scdoc/all/test_package/conanfile.py b/recipes/scdoc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4864f9fac5f47 --- /dev/null +++ b/recipes/scdoc/all/test_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + + def test(self): + if not tools.cross_building(self): + self.run( + f"scdoc < {os.path.join(self.source_folder,'test_package.1.scd')}", run_environment=True) diff --git a/recipes/scdoc/all/test_package/test_package.1.scd b/recipes/scdoc/all/test_package/test_package.1.scd new file mode 100644 index 0000000000000..cddcbd78d5631 --- /dev/null +++ b/recipes/scdoc/all/test_package/test_package.1.scd @@ -0,0 +1,9 @@ +test_package(1) + +# NAME + +test_package - This is a test package for scdoc + +# DESCRIPTION + +This is a simple scd file for test_package. diff --git a/recipes/scdoc/config.yml b/recipes/scdoc/config.yml new file mode 100644 index 0000000000000..4e3c90e52dc99 --- /dev/null +++ b/recipes/scdoc/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.12": + folder: all diff --git a/recipes/scnlib/all/conandata.yml b/recipes/scnlib/all/conandata.yml new file mode 100644 index 0000000000000..3a41a75a21f73 --- /dev/null +++ b/recipes/scnlib/all/conandata.yml @@ -0,0 +1,35 @@ +sources: + "1.1.2": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v1.1.2.tar.gz" + sha256: "5ed3ec742302c7304bf188bde9c4012a65dc8124ff4e1a69b598480d664250e6" + "1.0": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v1.0.tar.gz" + sha256: "5b8333e522206c2a74e57a9c9544c4fe4e7858cfe93e216905b463eaf91af5fe" + "0.4": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v0.4.tar.gz" + sha256: "f23e66b00c9d38671b39b83c082a5b2db1cf05b3e3eff7b4a769487d9ed9d366" +patches: + "1.1.2": + - patch_file: "patches/1.1.2-0001-install-dll-windows.patch" + patch_description: "add runtime destination path on install" + patch_type: "portability" + - patch_file: "patches/1.1.2-0002-remove-header-only-target.patch" + patch_description: "prevent to generate header only target for conan package" + patch_type: "conan" + - patch_file: "patches/1.1.2-0003-fix-link-keyword.patch" + patch_description: "use PRIVATE instead of INTERFACE" + patch_type: "conan" + "1.0": + - patch_file: "patches/1.0-0001-install-dll-windows.patch" + patch_description: "add runtime destination path on install" + patch_type: "portability" + - patch_file: "patches/1.0-0002-remove-header-only-target.patch" + patch_description: "prevent to generate header only target for conan package" + patch_type: "conan" + - patch_file: "patches/1.0-0003-use-conan-package.patch" + patch_description: "use conan package of fast-float" + patch_type: "conan" + "0.4": + - patch_file: "patches/0.4-0001-install-dll-windows.patch" + patch_description: "add runtime destination path on install" + patch_type: "portability" diff --git a/recipes/scnlib/all/conanfile.py b/recipes/scnlib/all/conanfile.py new file mode 100644 index 0000000000000..67178e9a18b6c --- /dev/null +++ b/recipes/scnlib/all/conanfile.py @@ -0,0 +1,140 @@ +from conan import ConanFile +from conan.tools.microsoft import check_min_vs +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + +class ScnlibConan(ConanFile): + name = "scnlib" + description = "scanf for modern C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eliaskosunen/scnlib" + topics = ("parsing", "io", "scanf") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "header_only": [True, False], + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "header_only": False, + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 11 + + 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.header_only or self.options.shared: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "1.0": + self.requires("fast_float/4.0.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192 if Version(self.version) >= "1.0" else 191) + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.options.header_only: + return + + tc = CMakeToolchain(self) + tc.variables["SCN_TESTS"] = False + tc.variables["SCN_EXAMPLES"] = False + tc.variables["SCN_BENCHMARKS"] = False + tc.variables["SCN_DOCS"] = False + tc.variables["SCN_INSTALL"] = True + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) >= "1.0": + tc.variables["SCN_USE_BUNDLED_FAST_FLOAT"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if not self.options.header_only: + 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) + if self.options.header_only: + copy(self, "*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + src_folder = os.path.join(self.source_folder, "src") + if Version(self.version) >= "1.0": + copy(self, "reader_*.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "reader")) + copy(self, "vscan.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "scan")) + copy(self, "locale.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) + copy(self, "file.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) + else: + copy(self, "*.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + if Version(self.version) >= "1.0": + rm(self, "*.cmake", os.path.join(self.package_folder, "include", "scn", "detail")) + rmdir(self, os.path.join(self.package_folder, "include", "scn", "detail", "CMakeFiles")) + rmdir(self, os.path.join(self.package_folder, "include", "scn", "detail", "deps", "CMakeFiles")) + + def package_info(self): + target = "scn-header-only" if self.options.header_only else "scn" + self.cpp_info.set_property("cmake_file_name", "scn") + self.cpp_info.set_property("cmake_target_name", f"scn::{target}") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if self.options.header_only: + self.cpp_info.components["_scnlib"].defines = ["SCN_HEADER_ONLY=1"] + else: + self.cpp_info.components["_scnlib"].defines = ["SCN_HEADER_ONLY=0"] + self.cpp_info.components["_scnlib"].libs = ["scn"] + if Version(self.version) >= "1.0": + self.cpp_info.components["_scnlib"].requires = ["fast_float::fast_float"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_scnlib"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "scn" + self.cpp_info.names["cmake_find_package_multi"] = "scn" + self.cpp_info.components["_scnlib"].names["cmake_find_package"] = target + self.cpp_info.components["_scnlib"].names["cmake_find_package_multi"] = target + self.cpp_info.components["_scnlib"].set_property("cmake_target_name", f"scn::{target}") diff --git a/recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch new file mode 100644 index 0000000000000..8928ce2f8c250 --- /dev/null +++ b/recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -145,6 +145,7 @@ if (SCN_INSTALL) + + install(TARGETS ${SCN_EXPORT_TARGETS_LIST} + EXPORT scnTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/scnlib/all/patches/1.0-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/1.0-0001-install-dll-windows.patch new file mode 100644 index 0000000000000..c2d5fe9c223ea --- /dev/null +++ b/recipes/scnlib/all/patches/1.0-0001-install-dll-windows.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d960eb9..c914832 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -167,6 +167,7 @@ if (SCN_INSTALL) + + install(TARGETS ${SCN_EXPORT_TARGETS_LIST} + EXPORT scnTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/scnlib/all/patches/1.0-0002-remove-header-only-target.patch b/recipes/scnlib/all/patches/1.0-0002-remove-header-only-target.patch new file mode 100644 index 0000000000000..6c35d57c4ca41 --- /dev/null +++ b/recipes/scnlib/all/patches/1.0-0002-remove-header-only-target.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c914832..1aba404 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,12 +106,10 @@ function(generate_header_only_target target_name) + endfunction() + + generate_library_target(scn) +-generate_header_only_target(scn-header-only) + + set(SCN_EXPORT_TARGETS_LIST +- scn scn-header-only) ++ scn) + add_library(scn::scn ALIAS scn) +-add_library(scn::scn-header-only ALIAS scn-header-only) + + set_property(TARGET scn PROPERTY SOVERSION 0) + diff --git a/recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch b/recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch new file mode 100644 index 0000000000000..5b5354a04f783 --- /dev/null +++ b/recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1aba404..f0c4b94 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,6 +48,8 @@ if (NOT (${CMAKE_VERSION} VERSION_LESS "3.9.0")) + cmake_policy(SET CMP0069 NEW) + endif () + ++find_package(FastFloat REQUIRED) ++ + include(sanitizers) + include(flags) + +@@ -83,8 +85,8 @@ function(generate_library_target target_name) + target_include_directories(${target_name} PRIVATE + $) + else () +- target_link_libraries(${target_name} INTERFACE +- fast_float) ++ target_link_libraries(${target_name} PRIVATE ++ FastFloat::fast_float) + endif () + endfunction() + function(generate_header_only_target target_name) +@@ -100,8 +102,8 @@ function(generate_header_only_target target_name) + target_include_directories(${target_name} INTERFACE + $) + else () +- target_link_libraries(${target_name} INTERFACE +- fast_float) ++ target_link_libraries(${target_name} PRIVATE ++ FastFloat::fast_float) + endif () + endfunction() + diff --git a/recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch new file mode 100644 index 0000000000000..ee64fa9407251 --- /dev/null +++ b/recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1864c6..b42736e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,6 +171,7 @@ if (SCN_INSTALL) + + install(TARGETS ${SCN_EXPORT_TARGETS_LIST} + EXPORT scnTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/scnlib/all/patches/1.1.2-0002-remove-header-only-target.patch b/recipes/scnlib/all/patches/1.1.2-0002-remove-header-only-target.patch new file mode 100644 index 0000000000000..08f98586c6b5b --- /dev/null +++ b/recipes/scnlib/all/patches/1.1.2-0002-remove-header-only-target.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b42736e..87cb1f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,12 +110,10 @@ function(generate_header_only_target target_name) + endfunction() + + generate_library_target(scn) +-generate_header_only_target(scn-header-only) + + set(SCN_EXPORT_TARGETS_LIST +- scn scn-header-only) ++ scn) + add_library(scn::scn ALIAS scn) +-add_library(scn::scn-header-only ALIAS scn-header-only) + + set_property(TARGET scn PROPERTY SOVERSION 0) + diff --git a/recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch b/recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch new file mode 100644 index 0000000000000..9fedf6c33071c --- /dev/null +++ b/recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 87cb1f7..4524490 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -87,7 +87,7 @@ function(generate_library_target target_name) + target_include_directories(${target_name} PRIVATE + $) + else () +- target_link_libraries(${target_name} INTERFACE ++ target_link_libraries(${target_name} PRIVATE + FastFloat::fast_float) + endif () + endfunction() +@@ -104,7 +104,7 @@ function(generate_header_only_target target_name) + target_include_directories(${target_name} INTERFACE + $) + else () +- target_link_libraries(${target_name} INTERFACE ++ target_link_libraries(${target_name} PRIVATE + FastFloat::fast_float) + endif () + endfunction() diff --git a/recipes/scnlib/all/test_package/CMakeLists.txt b/recipes/scnlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c68330d44cd3 --- /dev/null +++ b/recipes/scnlib/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(scn REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET scn::scn-header-only) + target_link_libraries(${PROJECT_NAME} PRIVATE scn::scn-header-only) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE scn::scn) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/scnlib/all/test_package/conanfile.py b/recipes/scnlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/scnlib/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/scnlib/all/test_package/test_package.cpp b/recipes/scnlib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..148a9caff4852 --- /dev/null +++ b/recipes/scnlib/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + std::string s{"conan-center-index"}; + auto span = scn::make_span(s); + return 0; +} diff --git a/recipes/scnlib/all/test_v1_package/CMakeLists.txt b/recipes/scnlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/scnlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/scnlib/all/test_v1_package/conanfile.py b/recipes/scnlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/scnlib/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/scnlib/config.yml b/recipes/scnlib/config.yml new file mode 100644 index 0000000000000..7205ca311ab8d --- /dev/null +++ b/recipes/scnlib/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.2": + folder: all + "1.0": + folder: all + "0.4": + folder: all diff --git a/recipes/scons/all/conandata.yml b/recipes/scons/all/conandata.yml new file mode 100644 index 0000000000000..5c49097cbf659 --- /dev/null +++ b/recipes/scons/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.3.0": + url: "http://prdownloads.sourceforge.net/scons/SCons-4.3.0.tar.gz" + sha256: "2efc81754a4491299c0c64a6230715dfe33f7a3a42a0834a4ce1756af117bdec" + "4.2.0": + url: "http://prdownloads.sourceforge.net/scons/scons-4.2.0.tar.gz" + sha256: "691893b63f38ad14295f5104661d55cb738ec6514421c6261323351c25432b0a" + "3.1.2": + url: "http://prdownloads.sourceforge.net/scons/scons-3.1.2.tar.gz" + sha256: "7801f3f62f654528e272df780be10c0e9337e897650b62ddcee9f39fde13f8fb" diff --git a/recipes/scons/all/conanfile.py b/recipes/scons/all/conanfile.py new file mode 100644 index 0000000000000..f52d4fa5ffabe --- /dev/null +++ b/recipes/scons/all/conanfile.py @@ -0,0 +1,104 @@ +from conans import ConanFile, tools +import os +import shutil +import textwrap + + +class SConsConan(ConanFile): + name = "scons" + description = "SCons is an Open Source software construction tool-that is, a next-generation build tool" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://scons.org" + topics = ("scons", "build", "configuration", "development") + settings = "os" # Added to let the CI test this package on all os'es + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _chmod_x(self, path): + if os.name == "posix": + os.chmod(path, 0o755) + + @property + def _scons_sh(self): + return os.path.join(self.package_folder, "bin", "scons") + + @property + def _scons_cmd(self): + return os.path.join(self.package_folder, "bin", "scons.cmd") + + def package_id(self): + self.info.header_only() + + def package(self): + self.copy("LICENSE*", src=self._source_subfolder, dst="licenses") + + if tools.Version(self.version) < 4: + shutil.copytree(os.path.join(self._source_subfolder, "engine", "SCons"), + os.path.join(self.package_folder, "res", "SCons")) + else: + shutil.copytree(os.path.join(self._source_subfolder, "SCons"), + os.path.join(self.package_folder, "res", "SCons")) + + tools.save(self._scons_sh, textwrap.dedent("""\ + #!/bin/sh + + realpath() ( + local startpwd=$PWD + cd "$(dirname "$1")" + local ourlink=$(readlink "$(basename "$1")") + while [ "$ourlink" ]; do + cd "$(dirname "$ourlink")" + local ourlink=$(readlink "$(basename "$1")") + done + local ourrealpath="$PWD/$(basename "$1")" + cd "$startpwd" + echo "$ourrealpath" + ) + + currentdir="$(dirname "$(realpath "$0")")" + + export PYTHONPATH="$currentdir/../res:$PYTHONPATH" + exec ${PYTHON:-python3} "$currentdir/../res/SCons/__main__.py" "$@" + """)) + self._chmod_x(self._scons_sh) + tools.save(self._scons_cmd, textwrap.dedent(r""" + @echo off + set currentdir=%~dp0 + if not defined PYTHON ( + set PYTHON=python + ) + set PYTHONPATH=%currentdir%\\..\\res;%PYTHONPATH% + CALL %PYTHON% %currentdir%\\..\\res\\SCons\\__main__.py %* + """)) + + # Mislead CI and create an empty header in the include directory + include_dir = os.path.join(self.package_folder, "include") + os.mkdir(include_dir) + tools.save(os.path.join(include_dir, "__nop.h"), "") + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + self._chmod_x(self._scons_sh) + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment var: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + if self.settings.os == "Windows": + scons_bin = os.path.join(bindir, "scons.cmd") + else: + scons_bin = os.path.join(bindir, "scons") + self.user_info.scons = scons_bin + self.output.info("Setting SCONS environment variable: {}".format(scons_bin)) + self.env_info.SCONS = scons_bin diff --git a/recipes/scons/all/test_package/SConscript b/recipes/scons/all/test_package/SConscript new file mode 100644 index 0000000000000..4292c616da88f --- /dev/null +++ b/recipes/scons/all/test_package/SConscript @@ -0,0 +1,17 @@ +# SConstruct +import os + +env = Environment() + +conan = SConscript("SConscript_conan") +if not conan: + print("File `SConscript_conan` is missing.") + print("It should be generated by running `conan install`.") + sys.exit(1) + +flags = conan["conan"] +env.MergeFlags(flags) + +print("CC is: {}".format(env.subst('$CC'))) + +test_package = env.Program(["test_package.c"]) diff --git a/recipes/scons/all/test_package/SConstruct b/recipes/scons/all/test_package/SConstruct new file mode 100644 index 0000000000000..a01f66f16099c --- /dev/null +++ b/recipes/scons/all/test_package/SConstruct @@ -0,0 +1,6 @@ +import os +SConsignFile(os.path.join(GetLaunchDir(), "db")) + +SConscript('SConscript', + variant_dir=GetLaunchDir(), + duplicate=False) diff --git a/recipes/scons/all/test_package/conanfile.py b/recipes/scons/all/test_package/conanfile.py new file mode 100644 index 0000000000000..315bdaa33b945 --- /dev/null +++ b/recipes/scons/all/test_package/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +from io import StringIO +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "scons" + + def build(self): + scons_path = self.deps_user_info["scons"].scons + if not scons_path: + raise ConanException("scons could not be found") + if not scons_path.replace("\\", "/").startswith(self.deps_cpp_info["scons"].rootpath.replace("\\", "/")): + raise ConanException("an external scons was found") + + output = StringIO() + self.run("{} --version".format(scons_path), run_environment=True, output=output, ignore_errors=True) + self.output.info("output: %s" % output.getvalue()) + output = StringIO() + self.run("{} --version".format(scons_path), run_environment=True, output=output) + text = output.getvalue() + if self.deps_cpp_info["scons"].version not in text: + raise ConanException("scons --version does not return correct version") + + scons_args = [ + "-j", str(tools.cpu_count()), + "-C", self.source_folder, + "-f", os.path.join(self.source_folder, "SConstruct"), + ] + + self.run("scons {}".format(" ".join(scons_args)), run_environment=True) + + def test(self): + from io import StringIO + + if not tools.cross_building(self): + bin_path = os.path.join(".", "test_package") + output = StringIO() + self.run(bin_path, run_environment=True, ignore_errors=True, output=output) + self.output.info("output: %s" % output.getvalue()) + self.run(bin_path, run_environment=True) diff --git a/recipes/scons/all/test_package/test_package.c b/recipes/scons/all/test_package/test_package.c new file mode 100644 index 0000000000000..bd1b1e2929530 --- /dev/null +++ b/recipes/scons/all/test_package/test_package.c @@ -0,0 +1,7 @@ +/* hello.c */ +#include +int main(int argc, char* argv[]) +{ + printf("Hello world\n"); + return 0; +} diff --git a/recipes/scons/config.yml b/recipes/scons/config.yml new file mode 100644 index 0000000000000..26cb9a182f8d1 --- /dev/null +++ b/recipes/scons/config.yml @@ -0,0 +1,7 @@ +versions: + "4.3.0": + folder: all + "4.2.0": + folder: all + "3.1.2": + folder: all diff --git a/recipes/scope-lite/all/conandata.yml b/recipes/scope-lite/all/conandata.yml new file mode 100644 index 0000000000000..d8d7c962ca8ee --- /dev/null +++ b/recipes/scope-lite/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.0": + url: "https://github.com/martinmoene/scope-lite/archive/v0.2.0.tar.gz" + sha256: "a18f0ca9f02d884b29926a9d2f3bb81e6fdb201b4e13a5e7454232bdc6ab5e0f" + "0.1.0": + url: "https://github.com/martinmoene/scope-lite/archive/v0.1.0.tar.gz" + sha256: "3d0949a88cfacbd6ed5f6ceb4a733bba128ecd548f2070c9ac71e2a2b361510c" diff --git a/recipes/scope-lite/all/conanfile.py b/recipes/scope-lite/all/conanfile.py new file mode 100644 index 0000000000000..0885ca796c7eb --- /dev/null +++ b/recipes/scope-lite/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class ScopeLiteConan(ConanFile): + name = "scope-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/scope-lite" + description = "scope lite - A migration path to C++ library extensions scope_exit, scope_fail, \ + scope_success, unique_resource in a single-file header-only library" + topics = ("cpp98", "cpp11", "scope", "library extensions") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "scope-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::scope-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "scope-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "scope-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["scopelite"].names["cmake_find_package"] = "scope-lite" + self.cpp_info.components["scopelite"].names["cmake_find_package_multi"] = "scope-lite" + self.cpp_info.components["scopelite"].set_property("cmake_target_name", "nonstd::scope-lite") + self.cpp_info.components["scopelite"].bindirs = [] + self.cpp_info.components["scopelite"].frameworkdirs = [] + self.cpp_info.components["scopelite"].libdirs = [] + self.cpp_info.components["scopelite"].resdirs = [] diff --git a/recipes/scope-lite/all/test_package/CMakeLists.txt b/recipes/scope-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9df37a1d3e63 --- /dev/null +++ b/recipes/scope-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(scope-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::scope-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/scope-lite/all/test_package/conanfile.py b/recipes/scope-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/scope-lite/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/scope-lite/all/test_package/test_package.cpp b/recipes/scope-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..22aef72c4c870 --- /dev/null +++ b/recipes/scope-lite/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "nonstd/scope.hpp" + +using namespace nonstd; + +int count = 0; + +namespace on { void exit() { ++count; } } + +int main() +{ +#if scope_USE_CPP98_VERSION + { scope_exit<> guard = make_scope_exit( on::exit ); } // note: on_exit w/o & + { scope_exit<> guard = make_scope_exit( &on::exit ); } // note: &on_exit +#else + { auto guard = make_scope_exit( on::exit ); } // note: on_exit w/o & + { auto guard = make_scope_exit( &on::exit ); } // note: &on_exit +#endif + + return !( count == 2 ); // 0: ok +} diff --git a/recipes/scope-lite/all/test_v1_package/CMakeLists.txt b/recipes/scope-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8cf0930ee8587 --- /dev/null +++ b/recipes/scope-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(scope-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::scope-lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/scope-lite/all/test_v1_package/conanfile.py b/recipes/scope-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/scope-lite/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/scope-lite/config.yml b/recipes/scope-lite/config.yml new file mode 100644 index 0000000000000..fc6f796e2eea9 --- /dev/null +++ b/recipes/scope-lite/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.0": + folder: all + "0.1.0": + folder: all diff --git a/recipes/screen_capture_lite/all/conandata.yml b/recipes/screen_capture_lite/all/conandata.yml new file mode 100644 index 0000000000000..87497fb96911b --- /dev/null +++ b/recipes/screen_capture_lite/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "17.1.1173": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.1173.tar.gz" + sha256: "17875fb58f0e5920b13b6ef2516c8e973055347339d3dbaabfa97ef448fdfff2" + "17.1.613": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.613.tar.gz" + sha256: "ab111e52379fc4bca852b9a79535329e12dca9b25a0b87a2ef84ab7348a64064" + "17.1.462": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.462.tar.gz" + sha256: "4c7d9b23a458645534c4e2a7315eb12fc7d6dc0fb914f1d6787ee9d5d16e6dfd" + "17.1.439": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.439.tar.gz" + sha256: "c6e6eead72114dc7ba9f3fb17eeff01b4b53bb3ad3b71a55ebe08b61bbff9dea" +patches: + "17.1.462": + - patch_file: "patches/17.1.462-0001-fix-cmake.patch" + patch_description: "specify build library static or shared" + patch_type: "conan" + "17.1.439": + - patch_file: "patches/17.1.439-0001-fix-cmake.patch" + patch_description: "specify build library static or shared" + patch_type: "conan" diff --git a/recipes/screen_capture_lite/all/conanfile.py b/recipes/screen_capture_lite/all/conanfile.py new file mode 100644 index 0000000000000..9f864ff248956 --- /dev/null +++ b/recipes/screen_capture_lite/all/conanfile.py @@ -0,0 +1,144 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.54.0" + + +class ScreenCaptureLiteConan(ConanFile): + name = "screen_capture_lite" + license = "MIT" + description = "cross platform screen/window capturing library " + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/smasherprog/screen_capture_lite" + topics = ("screen-capture", "screen-ercorder") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "20" if Version(self.version) < "17.1.596" else "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "10", + "apple-clang": "10", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libstdc++") + + # Since 17.1.451, screen_capture_lite uses CGPreflightScreenCaptureAccess which is provided by macOS SDK 11 later. + if Version(self.version) >= "17.1.451" and \ + self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) <= "11": + raise ConanInvalidConfiguration(f"{self.ref} requires CGPreflightScreenCaptureAccess which support macOS SDK 11 later.") + + def build_requirements(self): + if Version(self.version) >= "17.1.596": + 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["BUILD_EXAMPLE"] = False + if is_msvc(self): + # fix "error C2039: 'CheckForDuplicateEntries': is not a member of 'Microsoft::WRL::Details'" + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0.18362.0" + if Version(self.version) >= "17.1.613": + tc.variables["BUILD_CSHARP"] = 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["screen_capture_lite_shared" if self.options.shared else "screen_capture_lite_static"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") + self.cpp_info.requires.extend([ + "xorg::x11", + "xorg::xinerama", + "xorg::xext", + "xorg::xfixes", + ]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend([ + "dwmapi", + "d3d11", + "dxgi", + ]) + elif self.settings.os == "Macos": + self.cpp_info.frameworks.extend([ + "AppKit", + "AVFoundation", + "Carbon", + "Cocoa", + "CoreFoundation", + "CoreGraphics", + "CoreMedia", + "CoreVideo", + "Foundation", + "ImageIO", + ]) diff --git a/recipes/screen_capture_lite/all/patches/17.1.439-0001-fix-cmake.patch b/recipes/screen_capture_lite/all/patches/17.1.439-0001-fix-cmake.patch new file mode 100644 index 0000000000000..af4ad9b62d58b --- /dev/null +++ b/recipes/screen_capture_lite/all/patches/17.1.439-0001-fix-cmake.patch @@ -0,0 +1,69 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d646b23..23742b8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,10 @@ +-cmake_minimum_required(VERSION 3.20) ++cmake_minimum_required(VERSION 3.12) + project(screen_capture_lite_build) + + set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + option(BUILD_EXAMPLE "Build example" ON) +-set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build shared libraries") + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +@@ -22,13 +21,20 @@ else() + endif() + + add_subdirectory(src_cpp) +-add_subdirectory(src_csharp) + +-install (TARGETS screen_capture_lite_static screen_capture_lite_shared +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib +-) ++if(BUILD_SHARED_LIBS) ++ install (TARGETS screen_capture_lite_shared ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++else() ++ install (TARGETS screen_capture_lite_static ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() + + install (FILES + include/ScreenCapture.h +diff --git a/src_cpp/CMakeLists.txt b/src_cpp/CMakeLists.txt +index bc59c0b..1c4a1b4 100644 +--- a/src_cpp/CMakeLists.txt ++++ b/src_cpp/CMakeLists.txt +@@ -75,10 +75,12 @@ set(libsrc + ThreadManager.cpp + ${SCREEN_CAPTURE_PLATFORM_SRC} + ) +- ++ ++if(NOT BUILD_SHARED_LIBS) + message("Building STATIC Library") + add_library(${PROJECT_NAME}_static STATIC ${libsrc}) + ++else() + message("Building SHARED Library") + + add_library(${PROJECT_NAME}_shared SHARED ${libsrc}) +@@ -124,4 +126,4 @@ add_library(${PROJECT_NAME}_static STATIC ${libsrc}) + ${CMAKE_THREAD_LIBS_INIT} + ) + endif() +- +\ No newline at end of file ++endif() diff --git a/recipes/screen_capture_lite/all/patches/17.1.462-0001-fix-cmake.patch b/recipes/screen_capture_lite/all/patches/17.1.462-0001-fix-cmake.patch new file mode 100644 index 0000000000000..7591b9453fc49 --- /dev/null +++ b/recipes/screen_capture_lite/all/patches/17.1.462-0001-fix-cmake.patch @@ -0,0 +1,66 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d646b23..23742b8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,10 @@ +-cmake_minimum_required(VERSION 3.20) ++cmake_minimum_required(VERSION 3.12) + project(screen_capture_lite_build) + + set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + option(BUILD_EXAMPLE "Build example" ON) +-set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build shared libraries") + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +@@ -22,13 +21,20 @@ else() + endif() + + add_subdirectory(src_cpp) +-add_subdirectory(src_csharp) + +-install (TARGETS screen_capture_lite_static screen_capture_lite_shared +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib +-) ++if(BUILD_SHARED_LIBS) ++ install (TARGETS screen_capture_lite_shared ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++else() ++ install (TARGETS screen_capture_lite_static ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() + + install (FILES + include/ScreenCapture.h +diff --git a/src_cpp/CMakeLists.txt b/src_cpp/CMakeLists.txt +index 9d1ecc8..2933b97 100644 +--- a/src_cpp/CMakeLists.txt ++++ b/src_cpp/CMakeLists.txt +@@ -77,9 +77,11 @@ set(libsrc + ${SCREEN_CAPTURE_PLATFORM_SRC} + ) + ++if(NOT BUILD_SHARED_LIBS) + message("Building STATIC Library") + add_library(${PROJECT_NAME}_static STATIC ${libsrc}) + ++else() + message("Building SHARED Library") + + add_library(${PROJECT_NAME}_shared SHARED ${libsrc} ../include/ScreenCapture_C_API.h) +@@ -127,4 +129,4 @@ add_library(${PROJECT_NAME}_static STATIC ${libsrc}) + ${CMAKE_THREAD_LIBS_INIT} + ) + endif() +- ++endif() diff --git a/recipes/screen_capture_lite/all/test_package/CMakeLists.txt b/recipes/screen_capture_lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..920e6c9d22764 --- /dev/null +++ b/recipes/screen_capture_lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(screen_capture_lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE screen_capture_lite::screen_capture_lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/screen_capture_lite/all/test_package/conanfile.py b/recipes/screen_capture_lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d60b533632ddd --- /dev/null +++ b/recipes/screen_capture_lite/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/screen_capture_lite/all/test_package/test_package.cpp b/recipes/screen_capture_lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0b39c636788c9 --- /dev/null +++ b/recipes/screen_capture_lite/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include "ScreenCapture.h" + +int main() { + SL::Screen_Capture::CreateCaptureConfiguration([](){ + return SL::Screen_Capture::GetMonitors(); + }); +} diff --git a/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt b/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/screen_capture_lite/all/test_v1_package/conanfile.py b/recipes/screen_capture_lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/screen_capture_lite/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/screen_capture_lite/config.yml b/recipes/screen_capture_lite/config.yml new file mode 100644 index 0000000000000..863f787460bb7 --- /dev/null +++ b/recipes/screen_capture_lite/config.yml @@ -0,0 +1,9 @@ +versions: + "17.1.1173": + folder: "all" + "17.1.613": + folder: "all" + "17.1.462": + folder: "all" + "17.1.439": + folder: "all" diff --git a/recipes/sdbus-cpp/all/conandata.yml b/recipes/sdbus-cpp/all/conandata.yml new file mode 100644 index 0000000000000..4c4e5beb4bad0 --- /dev/null +++ b/recipes/sdbus-cpp/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.2.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.2.0.tar.gz" + sha256: "7f7231904abb6a996b8c18ddc5fb50078ef5dff5191649abf9f127aff41d24e9" + "1.1.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.1.0.tar.gz" + sha256: "35e939fdd9c796522702c9c8762dd59b5c47f3440c01ba9feb9921c042780b55" + "1.0.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.0.0.tar.gz" + sha256: "3db82112c0d8a171a4115d761e3a592b62091fa7600988736652595178ae4e94" + "0.8.3": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v0.8.3.tar.gz" + sha256: "0fd575ae0f463773dd9141242d1133731e2b780fd6526650ce992ba711d88628" + +patches: + "1.0.0": + - patch_file: "patches/0002-correct-readme-cpack-resource-path.patch" + patch_description: "fix out of tree build by using proper paths in cmake file" + patch_type: "backport" + patch_source: "https://github.com/Kistler-Group/sdbus-cpp/commit/0b8f2d97524f354bcaf816b27b6139a5b0c480ba" + "0.8.3": + - patch_file: "patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch" + patch_description: "fix build error by adding missing headers" + patch_type: "backport" + patch_source: "https://github.com/Kistler-Group/sdbus-cpp/commit/fb008445b15b452f461c34667f4991f5ce06e481" diff --git a/recipes/sdbus-cpp/all/conanfile.py b/recipes/sdbus-cpp/all/conanfile.py new file mode 100644 index 0000000000000..dbf11bfac5c83 --- /dev/null +++ b/recipes/sdbus-cpp/all/conanfile.py @@ -0,0 +1,137 @@ +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 apply_conandata_patches, copy, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.51.0" + + +class SdbusCppConan(ConanFile): + name = "sdbus-cpp" + license = "LicenseRef-LGPL-2.1-or-later-WITH-sdbus-cpp-LGPL-exception-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Kistler-Group/sdbus-cpp" + description = "High-level C++ D-Bus library for Linux designed" \ + " to provide easy-to-use yet powerful API in modern C++" + topics = ("dbus", "sd-bus", "sdbus-c++") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_code_gen": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_code_gen": False, + } + generators = "PkgConfigDeps", "VirtualBuildEnv" + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "7", + "clang": "6", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, + self.export_sources_folder) + + def configure(self): + if Version(self.version) < "0.9.0": + self.license = "LGPL-2.1-or-later" + + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("libsystemd/253.3") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.info.settings.compiler)) + if not min_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.info.settings.compiler)) + else: + if Version(self.info.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.info.settings.compiler, self.info.settings.compiler.version)) + if self.info.settings.os != "Linux": + raise ConanInvalidConfiguration("Only Linux supported") + + def build_requirements(self): + self.tool_requires("pkgconf/1.9.3") + if self.options.with_code_gen: + self.tool_requires("expat/2.5.0") + + 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_CODE_GEN"] = self.options.with_code_gen + tc.variables["BUILD_DOC"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_LIBSYSTEMD"] = False + tc.generate() + + # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18150 + copy(self, "*.pc", self.generators_folder, + os.path.join(self.generators_folder, "lib", "pkgconfig")) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.configure() + cmake.install() + copy(self, "COPYING*", self.source_folder, + os.path.join(self.package_folder, "licenses")) + 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.set_property("cmake_file_name", "sdbus-c++") + self.cpp_info.set_property("cmake_target_name", "SDBusCpp::sdbus-c++") + self.cpp_info.set_property("pkg_config_name", "sdbus-c++") + # TODO: back to root cpp_info in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["sdbus-c++"].libs = ["sdbus-c++"] + self.cpp_info.components["sdbus-c++"].system_libs = ["pthread", "m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "SDBusCpp" + self.cpp_info.names["cmake_find_package_multi"] = "SDBusCpp" + self.cpp_info.filenames["cmake_find_package"] = "sdbus-c++" + self.cpp_info.filenames["cmake_find_package_multi"] = "sdbus-c++" + self.cpp_info.components["sdbus-c++"].names["cmake_find_package"] = "sdbus-c++" + self.cpp_info.components["sdbus-c++"].names["cmake_find_package_multi"] = "sdbus-c++" + self.cpp_info.components["sdbus-c++"].names["pkg_config"] = "sdbus-c++" + self.cpp_info.components["sdbus-c++"].set_property( + "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.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/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch b/recipes/sdbus-cpp/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch new file mode 100644 index 0000000000000..3d0422bc85f54 --- /dev/null +++ b/recipes/sdbus-cpp/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch @@ -0,0 +1,35 @@ +From fb008445b15b452f461c34667f4991f5ce06e481 Mon Sep 17 00:00:00 2001 +From: bobrofon +Date: Fri, 12 Mar 2021 19:17:55 +0700 +Subject: [PATCH] xml2cpp: Add missing EXPAT include dirs (#136) + +This patch is required if EXPAT library is installed in non-standard location. +Without 'target_include_directories' cmake will find EXPAT library: + ... + -- Found EXPAT: .../lib/libexpat.a (found version "2.2.10") + ... + +But 'xml.cpp' compilation will fail with error: + ... + tools/xml2cpp-codegen/xml.cpp:7:10: fatal error: expat.h: No such file or directory + 7 | #include + ... +--- + tools/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 375c379..8d7a3d0 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -43,6 +43,7 @@ set(CMAKE_CXX_STANDARD 14) + + add_executable(sdbus-c++-xml2cpp ${SDBUSCPP_XML2CPP_SRCS}) + target_link_libraries (sdbus-c++-xml2cpp ${EXPAT_LIBRARIES}) ++target_include_directories(sdbus-c++-xml2cpp PRIVATE ${EXPAT_INCLUDE_DIRS}) + + #---------------------------------- + # INSTALLATION +-- +2.31.1 + diff --git a/recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch b/recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch new file mode 100644 index 0000000000000..5b37424cc3112 --- /dev/null +++ b/recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch @@ -0,0 +1,20 @@ +diff --color -Naur --label a/CMakeLists.txt --label b/CMakeLists.txt a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -180,7 +180,6 @@ + #---------------------------------- + + option(BUILD_DOC "Build documentation for sdbus-c++" ON) +- + if(BUILD_DOC) + message(STATUS "Building with documentation") + option(BUILD_DOXYGEN_DOC "Build doxygen documentation for sdbus-c++ API" OFF) +@@ -217,7 +216,7 @@ + set(CPACK_PACKAGE_VENDOR "Kistler") + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "high-level C++ D-Bus library") + set(CPACK_PACKAGE_CONTACT "info@kistler.com") +-set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") ++set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") + set(CPACK_COMPONENTS_ALL runtime dev doc) + set(CPACK_COMPONENT_DEV_DEPENDS "runtime") + diff --git a/recipes/sdbus-cpp/all/test_package/CMakeLists.txt b/recipes/sdbus-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db5504be46a52 --- /dev/null +++ b/recipes/sdbus-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES CXX) + +find_package(sdbus-c++ REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example SDBusCpp::sdbus-c++) diff --git a/recipes/sdbus-cpp/all/test_package/conanfile.py b/recipes/sdbus-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1841d8faae767 --- /dev/null +++ b/recipes/sdbus-cpp/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 SdbusCppTestConan(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], "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdbus-cpp/all/test_package/example.cpp b/recipes/sdbus-cpp/all/test_package/example.cpp new file mode 100644 index 0000000000000..b452a81961d74 --- /dev/null +++ b/recipes/sdbus-cpp/all/test_package/example.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +#include + +int main() { + std::puts("Create error object"); + auto error = sdbus::createError(ENOMEM, "test message"); + if (error.getName() != "org.freedesktop.DBus.Error.NoMemory") { + std::puts("Failed"); + return EXIT_FAILURE; + } + std::puts("Success"); +} diff --git a/recipes/sdbus-cpp/all/test_pkgconf/CMakeLists.txt b/recipes/sdbus-cpp/all/test_pkgconf/CMakeLists.txt new file mode 100644 index 0000000000000..143f93fecde25 --- /dev/null +++ b/recipes/sdbus-cpp/all/test_pkgconf/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(SDBusCpp REQUIRED IMPORTED_TARGET sdbus-c++) + +add_executable(example ../test_package/example.cpp) +target_link_libraries(example PRIVATE PkgConfig::SDBusCpp) diff --git a/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py b/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py new file mode 100644 index 0000000000000..5ce2acc54a189 --- /dev/null +++ b/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py @@ -0,0 +1,36 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import copy + + +class SdbusCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("pkgconf/1.9.3") + + def layout(self): + cmake_layout(self) + + def generate(self): + # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18150 + copy(self, "*.pc", self.generators_folder, + os.path.join(self.generators_folder, "lib", "pkgconfig")) + + 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/sdbus-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sdbus-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..32c1244c3650a --- /dev/null +++ b/recipes/sdbus-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.13) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sdbus-c++ REQUIRED) + +add_executable(example ../test_package/example.cpp) +target_link_libraries(example SDBusCpp::sdbus-c++) diff --git a/recipes/sdbus-cpp/all/test_v1_package/conanfile.py b/recipes/sdbus-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..99d76423bd838 --- /dev/null +++ b/recipes/sdbus-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run + +from conans import CMake + + +class SdbusCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = ("cmake", "cmake_find_package") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/sdbus-cpp/all/test_v1_pkgconf/CMakeLists.txt b/recipes/sdbus-cpp/all/test_v1_pkgconf/CMakeLists.txt new file mode 100644 index 0000000000000..e9b6fb408f74a --- /dev/null +++ b/recipes/sdbus-cpp/all/test_v1_pkgconf/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.13) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(SDBusCpp REQUIRED IMPORTED_TARGET sdbus-c++) + +add_executable(example ../test_package/example.cpp) +target_link_libraries(example PRIVATE PkgConfig::SDBusCpp) diff --git a/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py b/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py new file mode 100644 index 0000000000000..5daabc3db91f3 --- /dev/null +++ b/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py @@ -0,0 +1,24 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run + +from conans import CMake + + +class SdbusCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = ("cmake", "pkg_config") + + def build_requirements(self): + self.tool_requires("pkgconf/1.9.3") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/sdbus-cpp/config.yml b/recipes/sdbus-cpp/config.yml new file mode 100644 index 0000000000000..027c0dc56075d --- /dev/null +++ b/recipes/sdbus-cpp/config.yml @@ -0,0 +1,9 @@ +versions: + "1.2.0": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.8.3": + folder: all diff --git a/recipes/sdf/all/conandata.yml b/recipes/sdf/all/conandata.yml new file mode 100644 index 0000000000000..d2520bd57f52c --- /dev/null +++ b/recipes/sdf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20141013": + url: "https://github.com/memononen/SDF/archive/1ef5b4e4feb60ea84e47c01425de3edcf39bd83c.tar.gz" + sha256: "46275d3f50aa9eec23a724cb5902967a216597e7e8ef2b3739c0b4fe7a187117" diff --git a/recipes/sdf/all/conanfile.py b/recipes/sdf/all/conanfile.py new file mode 100644 index 0000000000000..2e95da6861e3d --- /dev/null +++ b/recipes/sdf/all/conanfile.py @@ -0,0 +1,41 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class SdfConan(ConanFile): + name = "sdf" + description = "Signed Distance Field Builder for Contour Texturing" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/memononen/SDF" + topics = ("sdf", "signed", "distance", "field", "contour") + 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) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/sdf/all/test_package/CMakeLists.txt b/recipes/sdf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afcf11bbd8776 --- /dev/null +++ b/recipes/sdf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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) diff --git a/recipes/sdf/all/test_package/conanfile.py b/recipes/sdf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ad5b8f9465ed6 --- /dev/null +++ b/recipes/sdf/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("stb/cci.20210910") + + 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") + img_path = os.path.join(self.source_folder, "test.png") + self.run(f"{bin_path} {img_path}", env="conanrun") diff --git a/recipes/sdf/all/test_package/test.png b/recipes/sdf/all/test_package/test.png new file mode 100644 index 0000000000000000000000000000000000000000..568aa3449320a47d6daad61b3adc56941df221a1 GIT binary patch literal 8484 zcmV+u2WQQyyHDLyU8rb*z8s1VW^Qq1PlEf=$v0VHe{Z2O*LxDo}{G@E!^Q zc5kY^hzJwZ)i5k}&eezy`UF%g+qfQzF`qyT6c3fpj}80R?aSpU)` zCcW|;XeShl4USRUg zZR{+3i^U$P6!y?g=oQZtQ=4R-?^5dy#yQX^ILsS|nchZ5)wdr>hIWE@n;Q-GkZPf) zxl$lLHugnAr0{#r$npw-6B`w1tf(05k%_||G7M(y1V_!- z+EHxnY6UW}7-JoJqs5*#_DPQz)$;3j;^h_gBHV6c`7>C9Ai6GjrU$?5g zNW$qj9S=uPf)Gg%LL|F&D}l_B1cI0%;d>5)7VC02QbLV_@QB!NKS2GQCH1OSd< zE-pi3G{$9^>(QC9^hg2+IJs1*t(c23rjR)pUAN{)g6I>;-laveF~f0PKhqKc`XD z9Sn;gwpJ+{s^4X?my!jEf=tYD=#Mg^Nu+>HsC~FojB}hUtO}|dqw%0+_=CQz?L_@8 zsPmX?(JRgIWoajKB!Q?Y0F1^kyp30|0>JtB1%~+;)CrLUHbkn6YKlyZ_PKFFhIRr$ z)KN=Z76W2wAP^!6;&hOgZxI@8>+jkzClewGY++~ro#$zO1&?`a$DB-vRO@$@;57Cn+cQ2TqMA%^=8efLUYv?>tbahH4P zkpuz{NJoj`J`KgvBMAh4F~H?sh$Ikrz9%QBm+D_T;m4Q|2QL3A@Z>REzm&bN-=}q)8G^B^!P)#3ms4ondlP3 zTAsvRXoS1)WO&~ownMuhjn2nJTx1a|13dR8@5R%fw^ZS$uUV8}0M_Vt@hW#rd!)l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_G5`y;>!0F$?dsnERw${i@E}LSD18P0&l9v1nT<0HA?M?z+F;obX~k&< z8$G`$3#-n?%JuQEO85W;5kB`3<=Wd%QI^5((QF54mF{u_kt(oQqwpY|NGnW48sz3go_UIfu{Y0CQoWqmTD!=xNqIHkFn+-j?&He_qf6t%_4lyi?)D+o zQ}fdJ01H{nLtMufG^MOv-hIjvAlSrkAeVbHTEs&v<8HoaFi`5LtkF0((estqHZ0(7 zmhpSeGFZwDGUO;T{Oo{W1MLXQ|Af4=Rv|}w#g<6^pXWb{fm0SYaF_BP>zfY5u5&~( zuE2XC#>6NP>1)H=9{e0@BKdiq!|biZOxDAnR6={1Hdxd#B9ZG& z13BnD?JJXrLF1(pvg#Fon;GcL6d$1|%F^#P`i2ujsu5%XS z;PU4ln^9ZN=jCk6bS5#IXKlStm4XPiO7WZW!qm|bn{HT|O&`fLzy2ZF>iFc1g?LL`Aeh$IjQkpu!El0YC3 zA_)Z1MoR5_BvE+_q(>46gh&E`5J?~q2$2K=A(B8KL=p%DLL`Aeh$Ili2mT)@IL*T( S`x5a00000=2.0.18 requires xcode 12 or higher because it uses CoreHaptics. + if Version(self.version) >= "2.0.18" and is_apple_os(self) and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("{}/{} requires xcode 12 or higher".format(self.name, self.version)) + + if self.settings.os == "Linux": + if self.options.sndio: + raise ConanInvalidConfiguration("Package for 'sndio' is not available (yet)") + if self.options.jack: + raise ConanInvalidConfiguration("Package for 'jack' is not available (yet)") + if self.options.esd: + raise ConanInvalidConfiguration("Package for 'esd' is not available (yet)") + if self.options.directfb: + raise ConanInvalidConfiguration("Package for 'directfb' is not available (yet)") + + def package_id(self): + if Version(self.version) < "2.0.22": + del self.info.options.sdl2main + + def build_requirements(self): + if self.settings.os == "Macos" and cross_building(self): + # 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.tool_requires("cmake/3.25.3") + if self.settings.os == "Linux" and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if hasattr(self, "settings_build") and self.options.get_safe("wayland"): + self.build_requires("wayland/1.21.0") # Provides wayland-scanner + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=self.source_folder) + + 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)') + + # Ensure to find wayland-scanner from wayland recipe in build requirements (or requirements if 1 profile) + if self.options.get_safe("wayland") and Version(self.version) >= "2.0.18": + replace_in_file(self, + os.path.join(self.source_folder, "cmake", "sdlchecks.cmake"), + "find_program(WAYLAND_SCANNER NAMES wayland-scanner REQUIRED)", + 'find_program(WAYLAND_SCANNER NAMES wayland-scanner REQUIRED PATHS "${WAYLAND_BIN_DIR}" NO_DEFAULT_PATH)', + ) + + def define_toolchain(self): + tc = CMakeToolchain(self) + if self.settings.os == "Linux" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 5.0: + tc.preprocessor_definitions["GBM_BO_USE_CURSOR"] = 2 + + tc.variables["SDL2_DISABLE_INSTALL"] = False # SDL2_* options will get renamed to SDL_ options in the next SDL release + if is_apple_os(self): + tc.variables["CMAKE_OSX_ARCHITECTURES"] = { + "armv8": "arm64", + }.get(str(self.settings.arch), str(self.settings.arch)) + cmake_required_includes = [] # List of directories used by CheckIncludeFile (https://cmake.org/cmake/help/latest/module/CheckIncludeFile.html) + cmake_extra_ldflags = [] + cmake_extra_libs = [] + + if self.settings.os != "Windows" and not self.options.shared: + tc.variables["SDL_STATIC_PIC"] = self.options.fPIC + if is_msvc(self) and not self.options.shared: + tc.variables["HAVE_LIBC"] = True + tc.variables["SDL_SHARED"] = self.options.shared + tc.variables["SDL_STATIC"] = not self.options.shared + tc.variables["SDL_OPENGL"] = self.options.opengl + tc.variables["SDL_OPENGLES"] = self.options.opengles + tc.variables["SDL_VULKAN"] = self.options.vulkan + if self.settings.os == "Linux": + # See https://github.com/bincrafters/community/issues/696 + tc.variables["SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS"] = 1 + + tc.variables["SDL_ALSA"] = self.options.alsa + if self.options.alsa: + tc.variables["SDL_ALSA_SHARED"] = self.dependencies["libalsa"].options.shared + tc.variables["HAVE_ASOUNDLIB_H"] = True + tc.variables["HAVE_LIBASOUND"] = True + tc.variables["SDL_JACK"] = self.options.jack + if self.options.jack: + tc.variables["SDL_JACK_SHARED"] = self.options["jack"].shared + tc.variables["SDL_ESD"] = self.options.esd + if self.options.esd: + tc.variables["SDL_ESD_SHARED"] = self.options["esd"].shared + tc.variables["SDL_PULSEAUDIO"] = self.options.pulse + if self.options.pulse: + tc.variables["SDL_PULSEAUDIO_SHARED"] = self.dependencies["pulseaudio"].options.shared + for component in self.dependencies["pulseaudio"].cpp_info.components: + if self.dependencies["pulseaudio"].cpp_info.components[component].libs: + cmake_extra_libs += self.dependencies["pulseaudio"].cpp_info.components[component].libs + cmake_extra_ldflags += ["-L{}".format(it) for it in self.dependencies["pulseaudio"].cpp_info.components[component].libdirs] + cmake_extra_ldflags += ["-lxcb", "-lrt"] # FIXME: SDL sources doesn't take into account transitive dependencies + tc.variables["SDL_SNDIO"] = self.options.sndio + if self.options.sndio: + tc.variables["SDL_SNDIO_SHARED"] = self.options["sndio"].shared + tc.variables["SDL_NAS"] = self.options.nas + if self.options.nas: + cmake_extra_ldflags += ["-lXau"] # FIXME: SDL sources doesn't take into account transitive dependencies + cmake_required_includes += self.dependencies["nas"].cpp_info.includedirs + tc.variables["SDL_NAS_SHARED"] = self.dependencies["nas"].options.shared + tc.variables["SDL_X11"] = self.options.x11 + if self.options.x11: + tc.variables["HAVE_XEXT_H"] = True + tc.variables["SDL_X11_XCURSOR"] = self.options.xcursor + if self.options.xcursor: + tc.variables["HAVE_XCURSOR_H"] = True + tc.variables["SDL_X11_XINERAMA"] = self.options.xinerama + if self.options.xinerama: + tc.variables["HAVE_XINERAMA_H"] = True + tc.variables["SDL_X11_XINPUT"] = self.options.xinput + if self.options.xinput: + tc.variables["HAVE_XINPUT_H"] = True + tc.variables["SDL_X11_XRANDR"] = self.options.xrandr + if self.options.xrandr: + tc.variables["HAVE_XRANDR_H"] = True + tc.variables["SDL_X11_XSCRNSAVER"] = self.options.xscrnsaver + if self.options.xscrnsaver: + tc.variables["HAVE_XSS_H"] = True + tc.variables["SDL_X11_XSHAPE"] = self.options.xshape + if self.options.xshape: + tc.variables["HAVE_XSHAPE_H"] = True + tc.variables["SDL_X11_XVM"] = self.options.xvm + if self.options.xvm: + tc.variables["HAVE_XF86VM_H"] = True + tc.variables["SDL_WAYLAND"] = self.options.wayland + if self.options.wayland: + # FIXME: Otherwise 2.0.16 links with system wayland (from egl/system requirement) + cmake_extra_ldflags += ["-L{}".format(it) for it in self.dependencies["wayland"].cpp_info.libdirs] + tc.variables["SDL_WAYLAND_SHARED"] = self.dependencies["wayland"].options.shared + + wayland = self.dependencies["wayland"] if not hasattr(self, "settings_build") else self.dependencies.build["wayland"] + wayland_bin_dir = wayland.cpp_info.bindirs[0] # for wayland scanner + tc.variables["WAYLAND_BIN_DIR"] = wayland_bin_dir + + tc.variables["SDL_DIRECTFB"] = self.options.directfb + tc.variables["SDL_RPI"] = self.options.video_rpi + tc.variables["HAVE_LIBUNWIND_H"] = self.options.libunwind + elif self.settings.os == "Windows": + tc.variables["SDL_DIRECTX"] = self.options.directx + + if Version(self.version) >= "2.0.22": + tc.variables["SDL2_DISABLE_SDL2MAIN"] = not self.options.sdl2main + + # Add extra information collected from the deps + tc.variables["EXTRA_LDFLAGS"] = ";".join(cmake_extra_ldflags) + tc.variables["CMAKE_REQUIRED_INCLUDES"] = ";".join(cmake_required_includes) + 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) + tc.variables["EXTRA_LIBS"] = ";".join(cmake_extra_libs) + tc.generate() + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + 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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "libdata")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SDL2") + + self.cpp_info.names["cmake_find_package"] = "SDL2" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2" + + postfix = "d" if self.settings.os != "Android" and self.settings.build_type == "Debug" else "" + + # SDL2 + lib_postfix = postfix + if self.version >= "2.0.24" and is_msvc(self) and not self.options.shared: + lib_postfix = "-static" + postfix + + self.cpp_info.components["libsdl2"].set_property("cmake_target_name", "SDL2::SDL2") + if not self.options.shared: + self.cpp_info.components["libsdl2"].set_property("cmake_target_aliases", ["SDL2::SDL2-static"]) + self.cpp_info.components["libsdl2"].set_property("pkg_config_name", "sdl2") + + sdl2_cmake_target = "SDL2" if self.options.shared else "SDL2-static" + self.cpp_info.components["libsdl2"].names["cmake_find_package"] = sdl2_cmake_target + self.cpp_info.components["libsdl2"].names["cmake_find_package_multi"] = sdl2_cmake_target + + self.cpp_info.components["libsdl2"].includedirs.append(os.path.join("include", "SDL2")) + self.cpp_info.components["libsdl2"].libs = ["SDL2" + lib_postfix] + if self.options.get_safe("iconv", False): + self.cpp_info.components["libsdl2"].requires.append("libiconv::libiconv") + if self.settings.os == "Linux": + self.cpp_info.components["libsdl2"].system_libs = ["dl", "rt", "pthread"] + if self.options.alsa: + self.cpp_info.components["libsdl2"].requires.append("libalsa::libalsa") + if self.options.pulse: + self.cpp_info.components["libsdl2"].requires.append("pulseaudio::pulseaudio") + if self.options.opengl: + self.cpp_info.components["libsdl2"].requires.append("opengl::opengl") + if self.options.jack: + self.cpp_info.components["libsdl2"].requires.append("jack::jack") + if self.options.sndio: + self.cpp_info.components["libsdl2"].requires.append("sndio::sndio") + if self.options.nas: + self.cpp_info.components["libsdl2"].requires.append("nas::nas") + if self.options.esd: + self.cpp_info.components["libsdl2"].requires.append("esd::esd") + if self.options.directfb: + self.cpp_info.components["libsdl2"].requires.append("directfb::directfb") + if self.options.video_rpi: + self.cpp_info.components["libsdl2"].libs.append("bcm_host") + self.cpp_info.components["libsdl2"].includedirs.extend([ + "/opt/vc/include", + "/opt/vc/include/interface/vcos/pthreads", + "/opt/vc/include/interface/vmcs_host/linux" + ]) + self.cpp_info.components["libsdl2"].libdirs.append("/opt/vc/lib") + self.cpp_info.components["libsdl2"].sharedlinkflags.append("-Wl,-rpath,/opt/vc/lib") + self.cpp_info.components["libsdl2"].exelinkflags.append("-Wl,-rpath,/opt/vc/lib") + if self.options.wayland: + self.cpp_info.components["libsdl2"].requires.append("wayland::wayland") + self.cpp_info.components["libsdl2"].requires.append("xkbcommon::xkbcommon") + self.cpp_info.components["libsdl2"].requires.append("egl::egl") + if self.options.libunwind: + self.cpp_info.components["libsdl2"].requires.append("libunwind::libunwind") + elif is_apple_os(self) and not self.options.shared: + self.cpp_info.components["libsdl2"].frameworks = [ + "CoreVideo", "CoreAudio", "AudioToolbox", + "AVFoundation", "Foundation", "QuartzCore", + ] + if self.settings.os == "Macos": + self.cpp_info.components["libsdl2"].frameworks.extend(["Cocoa", "Carbon", "IOKit", "ForceFeedback"]) + self.cpp_info.components["libsdl2"].frameworks.append("GameController") + elif self.settings.os in ["iOS", "tvOS", "watchOS"]: + self.cpp_info.components["libsdl2"].frameworks.extend([ + "UIKit", "OpenGLES", "GameController", "CoreMotion", + "CoreGraphics", "CoreBluetooth", + ]) + + self.cpp_info.components["libsdl2"].frameworks.append("Metal") + self.cpp_info.components["libsdl2"].sharedlinkflags.append("-Wl,-weak_framework,CoreHaptics") + self.cpp_info.components["libsdl2"].exelinkflags.append("-Wl,-weak_framework,CoreHaptics") + elif self.settings.os == "Windows": + self.cpp_info.components["libsdl2"].system_libs = ["user32", "gdi32", "winmm", "imm32", "ole32", "oleaut32", "version", "uuid", "advapi32", "setupapi", "shell32"] + if self.settings.compiler == "gcc": + self.cpp_info.components["libsdl2"].system_libs.append("mingw32") + elif self.settings.os == "Android" and not self.options.shared: + self.cpp_info.components["libsdl2"].system_libs.extend(["android", "dl", "log"]) + if self.options.opengles: + self.cpp_info.components["libsdl2"].system_libs.extend(["GLESv1_CM", "GLESv2"]) + self.cpp_info.components["libsdl2"].system_libs.append("OpenSLES") + + # SDL2main + if self.options.sdl2main: + self.cpp_info.components["sdl2main"].set_property("cmake_target_name", "SDL2::SDL2main") + + self.cpp_info.components["sdl2main"].names["cmake_find_package"] = "SDL2main" + self.cpp_info.components["sdl2main"].names["cmake_find_package_multi"] = "SDL2main" + + self.cpp_info.components["sdl2main"].libs = ["SDL2main" + postfix] + self.cpp_info.components["sdl2main"].requires = ["libsdl2"] + + # Workaround to avoid unwanted sdl::sdl target in CMakeDeps generator + self.cpp_info.set_property( + "cmake_target_name", + "SDL2::{}".format("SDL2main" if self.options.sdl2main else "SDL2"), + ) diff --git a/recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch b/recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch new file mode 100644 index 0000000000000..7a56e3d843ff6 --- /dev/null +++ b/recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch @@ -0,0 +1,26 @@ +see https://github.com/libsdl-org/SDL/commit/471d3c363e654c7ad10782f50cb47e639c0646c3 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -131,6 +131,8 @@ elseif(APPLE) + set(MACOSX TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*") + set(TVOS TRUE) ++ elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*") ++ set(IOS TRUE) + endif() + # TODO: iOS? + elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") +@@ -1668,7 +1670,11 @@ elseif(APPLE) + message_error("SDL_FILE must be enabled to build on MacOS X") + endif() + +- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) ++ if(IOS OR TVOS) ++ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m) ++ else() ++ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) ++ endif() + set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES}) + set(HAVE_SDL_MISC TRUE) + diff --git a/recipes/sdl/all/patches/0002-mingw-improvements.patch b/recipes/sdl/all/patches/0002-mingw-improvements.patch new file mode 100644 index 0000000000000..250f0b8951359 --- /dev/null +++ b/recipes/sdl/all/patches/0002-mingw-improvements.patch @@ -0,0 +1,27 @@ +Upstream-pull-request: https://github.com/libsdl-org/SDL/pull/4492 +Upstream-pull-request-status: Merged +--- + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b9b9eb62..454a0bbd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2092,7 +2092,8 @@ if(NOT CMAKE_HOST_WIN32) + execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh + WORKING_DIRECTORY ${SDL2_BINARY_DIR}) + endif() +-if(NOT WINDOWS OR CYGWIN) ++if(NOT WINDOWS OR CYGWIN OR MINGW) ++ + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") + set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") +@@ -2361,7 +2361,7 @@ else() + set(SOPOSTFIX "") + endif() + +-if(NOT (WINDOWS OR CYGWIN)) ++if(NOT (WINDOWS OR CYGWIN OR MINGW)) + if(SDL_SHARED) + set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. + get_target_property(SONAME SDL2 OUTPUT_NAME) diff --git a/recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch b/recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch new file mode 100644 index 0000000000000..d6352aaac4789 --- /dev/null +++ b/recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch @@ -0,0 +1,23 @@ +--- a/cmake/sdlchecks.cmake ++++ b/cmake/sdlchecks.cmake +@@ -593,9 +593,10 @@ endmacro() + # - HAVE_DLOPEN opt + macro(CheckWayland) + if(VIDEO_WAYLAND) +- pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon) ++ pkg_check_modules(WAYLAND wayland-client wayland-egl wayland-cursor egl xkbcommon) + + if(WAYLAND_FOUND) ++ if(0) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" +@@ -607,6 +608,8 @@ macro(CheckWayland) + if(NOT WAYLAND_SCANNER_RC EQUAL 0) + set(WAYLAND_FOUND FALSE) + endif() ++ endif() ++ set(WAYLAND_SCANNER "wayland-scanner") + endif() + + if(WAYLAND_FOUND) diff --git a/recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch b/recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch new file mode 100644 index 0000000000000..664a37968e03a --- /dev/null +++ b/recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch @@ -0,0 +1,24 @@ +--- a/cmake/sdlchecks.cmake ++++ b/cmake/sdlchecks.cmake +@@ -628,10 +628,10 @@ endmacro() + # - HAVE_DLOPEN opt + macro(CheckWayland) + if(VIDEO_WAYLAND) +- pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon) +- pkg_check_modules(WAYLAND_SCANNER_1_15 "wayland-scanner>=1.15") ++ pkg_check_modules(WAYLAND wayland-client wayland-egl wayland-cursor egl xkbcommon) + + if(WAYLAND_FOUND AND HAVE_VIDEO_OPENGL_EGL) ++ if(0) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" +@@ -643,6 +643,8 @@ macro(CheckWayland) + if(NOT WAYLAND_SCANNER_RC EQUAL 0) + set(WAYLAND_FOUND FALSE) + endif() ++ endif() ++ set(WAYLAND_SCANNER "wayland-scanner") + endif() + + if(WAYLAND_FOUND) diff --git a/recipes/sdl/all/patches/0004-2.0.20-ndk.patch b/recipes/sdl/all/patches/0004-2.0.20-ndk.patch new file mode 100644 index 0000000000000..9e2781ef13eae --- /dev/null +++ b/recipes/sdl/all/patches/0004-2.0.20-ndk.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -526,13 +526,17 @@ if(USE_GCC OR USE_CLANG) + list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing") + endif() + +- check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT) +- if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT) +- check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT) +- if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT) +- list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement") ++ # Android needs to bring in external files that don't adhere to the declaration-after-statement ++ # warning, so skip this warning on Android. ++ if(NOT ANDROID) ++ check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT) ++ if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT) ++ check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT) ++ if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT) ++ list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement") ++ endif() ++ list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement") + endif() +- list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement") + endif() + + if(DEPENDENCY_TRACKING) diff --git a/recipes/sdl/all/test_package/CMakeLists.txt b/recipes/sdl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4195ae0c9ad32 --- /dev/null +++ b/recipes/sdl/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(SDL2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} SDL2::SDL2main) +if(TARGET SDL2::SDL2-static) + target_link_libraries(${PROJECT_NAME} SDL2::SDL2-static) +else() + target_link_libraries(${PROJECT_NAME} SDL2::SDL2) +endif() + diff --git a/recipes/sdl/all/test_package/conanfile.py b/recipes/sdl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..956346bb80854 --- /dev/null +++ b/recipes/sdl/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +# It will become the standard on Conan 2.x +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/sdl/all/test_package/test_package.cpp b/recipes/sdl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..69868e55398de --- /dev/null +++ b/recipes/sdl/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char* args[]) { + SDL_version v; + SDL_GetVersion(&v); + std::cout << "SDL version " << int(v.major) << "." << int(v.minor) << "." << int(v.patch) << std::endl; + return 0; +} diff --git a/recipes/sdl/all/test_v1_package/CMakeLists.txt b/recipes/sdl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b272a5b739303 --- /dev/null +++ b/recipes/sdl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SDL2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} SDL2::SDL2main) +if(TARGET SDL2::SDL2-static) + target_link_libraries(${PROJECT_NAME} SDL2::SDL2-static) +else() + target_link_libraries(${PROJECT_NAME} SDL2::SDL2) +endif() diff --git a/recipes/sdl/all/test_v1_package/conanfile.py b/recipes/sdl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8037a9296cc42 --- /dev/null +++ b/recipes/sdl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sdl/all/test_v1_package/test_package.cpp b/recipes/sdl/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..69868e55398de --- /dev/null +++ b/recipes/sdl/all/test_v1_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char* args[]) { + SDL_version v; + SDL_GetVersion(&v); + std::cout << "SDL version " << int(v.major) << "." << int(v.minor) << "." << int(v.patch) << std::endl; + return 0; +} diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml new file mode 100644 index 0000000000000..211e5780e8908 --- /dev/null +++ b/recipes/sdl/config.yml @@ -0,0 +1,11 @@ +versions: + "2.26.1": + folder: all + "2.26.0": + folder: all + "2.24.1": + folder: all + "2.24.0": + folder: all + "2.0.20": + folder: all diff --git a/recipes/sdl_image/all/CMakeLists.txt b/recipes/sdl_image/all/CMakeLists.txt new file mode 100644 index 0000000000000..6554bf914af3f --- /dev/null +++ b/recipes/sdl_image/all/CMakeLists.txt @@ -0,0 +1,118 @@ +cmake_minimum_required(VERSION 3.1) +project(SDL2_image LANGUAGES C) + +find_package(SDL2 REQUIRED CONFIG) + +macro(add_image_option type) + option(${type} "${type} images support" ON) + if(${type}) + add_definitions("-DLOAD_${type}") + endif() +endmacro() + +if(APPLE) + option(IMAGEIO "use native Apple frameworks for loading images" ON) + if(IMAGEIO) + set(IMAGEIO_SOURCE "${SDL_IMAGE_SRC_DIR}/IMG_ImageIO.m") + else() + add_definitions("-DSDL_IMAGE_USE_COMMON_BACKEND") + endif() +endif() + +add_image_option(BMP) +add_image_option(GIF) +add_image_option(JPG) +add_image_option(LBM) +add_image_option(PCX) +add_image_option(PNG) +add_image_option(PNM) +add_image_option(SVG) +add_image_option(TGA) +add_image_option(TIF) +add_image_option(WEBP) +add_image_option(XCF) +add_image_option(XPM) +add_image_option(XV) + +set(SOURCES + ${SDL_IMAGE_SRC_DIR}/IMG.c + ${SDL_IMAGE_SRC_DIR}/IMG_bmp.c + ${SDL_IMAGE_SRC_DIR}/IMG_gif.c + ${SDL_IMAGE_SRC_DIR}/IMG_jpg.c + ${SDL_IMAGE_SRC_DIR}/IMG_lbm.c + ${SDL_IMAGE_SRC_DIR}/IMG_pcx.c + ${SDL_IMAGE_SRC_DIR}/IMG_png.c + ${SDL_IMAGE_SRC_DIR}/IMG_pnm.c + ${SDL_IMAGE_SRC_DIR}/IMG_svg.c + ${SDL_IMAGE_SRC_DIR}/IMG_tga.c + ${SDL_IMAGE_SRC_DIR}/IMG_tif.c + ${SDL_IMAGE_SRC_DIR}/IMG_webp.c + ${SDL_IMAGE_SRC_DIR}/IMG_xcf.c + ${SDL_IMAGE_SRC_DIR}/IMG_xpm.c + ${SDL_IMAGE_SRC_DIR}/IMG_xv.c + ${IMAGEIO_SOURCE} +) + +if(BUILD_SHARED_LIBS) + list(APPEND SOURCES ${SDL_IMAGE_SRC_DIR}/version.rc) +endif() + +add_library(${PROJECT_NAME} ${SOURCES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${SDL_IMAGE_SRC_DIR}) +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER ${SDL_IMAGE_SRC_DIR}/SDL_image.h + DEFINE_SYMBOL DLL_EXPORT +) + +if(SDL_IS_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2-static) +endif() + +if(TIF) + find_package(TIFF REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE TIFF::TIFF) +endif() + +if(JPG) + find_package(JPEG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE JPEG::JPEG) +endif() + +if(PNG) + find_package(PNG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE PNG::PNG) +endif() + +if(WEBP) + find_package(WebP REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE WebP::webp) +endif() + +if(APPLE AND IMAGEIO AND BUILD_SHARED_LIBS) + if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) + set(extraFrameworks + "-framework ApplicationServices" + ) + else() + set(extraFrameworks + "-framework MobileCoreServices" + "-framework UIKit" + ) + endif() + target_link_libraries(${PROJECT_NAME} PRIVATE + "-framework CoreFoundation" + "-framework CoreGraphics" + "-framework Foundation" + "-framework ImageIO" + ${extraFrameworks} + ) +endif() + +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" + RUNTIME DESTINATION "bin" + PUBLIC_HEADER DESTINATION "include/SDL2" +) diff --git a/recipes/sdl_image/all/conandata.yml b/recipes/sdl_image/all/conandata.yml new file mode 100644 index 0000000000000..bc34556c048dd --- /dev/null +++ b/recipes/sdl_image/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.5": + url: "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.tar.gz" + sha256: "bdd5f6e026682f7d7e1be0b6051b209da2f402a2dd8bd1c4bd9c25ad263108d0" diff --git a/recipes/sdl_image/all/conanfile.py b/recipes/sdl_image/all/conanfile.py new file mode 100644 index 0000000000000..2bb32465a9dea --- /dev/null +++ b/recipes/sdl_image/all/conanfile.py @@ -0,0 +1,174 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class SDLImageConan(ConanFile): + name = "sdl_image" + description = "SDL_image is an image file loading library" + topics = ("sdl2", "sdl", "images", "opengl") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libsdl.org/projects/SDL_image/" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "bmp": [True, False], + "gif": [True, False], + "lbm": [True, False], + "pcx": [True, False], + "pnm": [True, False], + "svg": [True, False], + "tga": [True, False], + "xcf": [True, False], + "xpm": [True, False], + "xv": [True, False], + "with_libjpeg": [True, False], + "with_libtiff": [True, False], + "with_libpng": [True, False], + "with_libwebp": [True, False], + "imageio": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "bmp": True, + "gif": True, + "lbm": True, + "pcx": True, + "pnm": True, + "svg": True, + "tga": True, + "xcf": True, + "xpm": True, + "xv": True, + "with_libjpeg": True, + "with_libtiff": True, + "with_libpng": True, + "with_libwebp": True, + "imageio": False, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not is_apple_os(self): + del self.options.imageio + + 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.shared: + # sdl static into sdl_image shared is not allowed + self.options["sdl"].shared = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16167#issuecomment-1508347351 + self.requires("sdl/2.26.1", transitive_headers=True) + if self.options.with_libtiff: + self.requires("libtiff/4.4.0") + if self.options.with_libjpeg: + self.requires("libjpeg/9e") + if self.options.with_libpng: + self.requires("libpng/1.6.39") + if self.options.with_libwebp: + self.requires("libwebp/1.3.0") + + def validate(self): + if self.options.shared and not self.dependencies["sdl"].options.shared: + raise ConanInvalidConfiguration("sdl_image shared requires sdl shared") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SDL_IMAGE_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BMP"] = self.options.bmp + tc.variables["GIF"] = self.options.gif + tc.variables["IMAGEIO"] = self.options.get_safe("imageio") + tc.variables["JPG"] = self.options.with_libjpeg + tc.variables["LBM"] = self.options.lbm + tc.variables["PCX"] = self.options.pcx + tc.variables["PNG"] = self.options.with_libpng + tc.variables["PNM"] = self.options.pnm + tc.variables["SVG"] = self.options.svg + tc.variables["TGA"] = self.options.tga + tc.variables["TIF"] = self.options.with_libtiff + tc.variables["WEBP"] = self.options.with_libwebp + tc.variables["XCF"] = self.options.xcf + tc.variables["XPM"] = self.options.xpm + tc.variables["XV"] = self.options.xv + tc.variables["SDL_IS_SHARED"] = self.dependencies["sdl"].options.shared + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def build(self): + rmdir(self, os.path.join(self.source_folder, "external")) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SDL2_image") + self.cpp_info.set_property("cmake_target_name", "SDL2_image::SDL2_image") + if not self.options.shared: + self.cpp_info.set_property("cmake_target_aliases", ["SDL2_image::SDL2_image-static"]) + self.cpp_info.set_property("pkg_config_name", "SDL2_image") + # TODO: back to global scope in conan v2 once legacy generators removed + self.cpp_info.components["_sdl_image"].libs = ["SDL2_image"] + self.cpp_info.components["_sdl_image"].includedirs.append(os.path.join("include", "SDL2")) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "SDL2_image" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2_image" + self.cpp_info.names["pkg_config"] = "SDL2_image" + target_name = "SDL2_image" if self.options.shared else "SDL2_image-static" + self.cpp_info.components["_sdl_image"].names["cmake_find_package"] = target_name + self.cpp_info.components["_sdl_image"].names["cmake_find_package_multi"] = target_name + self.cpp_info.components["_sdl_image"].set_property("cmake_target_name", "SDL2_image::SDL2_image") + self.cpp_info.components["_sdl_image"].set_property("pkg_config_name", "SDL2_image") + self.cpp_info.components["_sdl_image"].requires = ["sdl::sdl"] + if self.options.with_libtiff: + self.cpp_info.components["_sdl_image"].requires.append("libtiff::libtiff") + if self.options.with_libjpeg: + self.cpp_info.components["_sdl_image"].requires.append("libjpeg::libjpeg") + if self.options.with_libpng: + self.cpp_info.components["_sdl_image"].requires.append("libpng::libpng") + if self.options.with_libwebp: + self.cpp_info.components["_sdl_image"].requires.append("libwebp::libwebp") + if self.options.get_safe("imageio") and not self.options.shared: + self.cpp_info.components["_sdl_image"].frameworks = [ + "CoreFoundation", + "CoreGraphics", + "Foundation", + "ImageIO", + ] + if self.settings.os == "Macos": + self.cpp_info.components["_sdl_image"].frameworks.append("ApplicationServices") + else: + self.cpp_info.components["_sdl_image"].frameworks.extend([ + "MobileCoreServices", + "UIKit", + ]) diff --git a/recipes/sdl_image/all/test_package/CMakeLists.txt b/recipes/sdl_image/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a9ac602e7d066 --- /dev/null +++ b/recipes/sdl_image/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(SDL2_image REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET SDL2_image::SDL2_image-static) + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_image::SDL2_image-static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_image::SDL2_image) +endif() diff --git a/recipes/sdl_image/all/test_package/conanfile.py b/recipes/sdl_image/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sdl_image/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/sdl_image/all/test_package/test_package.c b/recipes/sdl_image/all/test_package/test_package.c new file mode 100644 index 0000000000000..4a58990e461fb --- /dev/null +++ b/recipes/sdl_image/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#define SDL_MAIN_HANDLED +#include "SDL_image.h" +#include +#include + +int main(int argc, char *argv[]) +{ + SDL_version compile_version; + const SDL_version *link_version = IMG_Linked_Version(); + SDL_IMAGE_VERSION(&compile_version); + printf("SDL2_image compile version: %d.%d.%d\n", + (int)compile_version.major, (int)compile_version.minor, (int)compile_version.patch); + printf("SDL2_image link version: %d.%d.%d\n", + (int)link_version->major, (int)link_version->minor, (int)link_version->patch); + return EXIT_SUCCESS; +} diff --git a/recipes/sdl_image/all/test_v1_package/CMakeLists.txt b/recipes/sdl_image/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sdl_image/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sdl_image/all/test_v1_package/conanfile.py b/recipes/sdl_image/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sdl_image/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/sdl_image/config.yml b/recipes/sdl_image/config.yml new file mode 100644 index 0000000000000..1630e08ca5f32 --- /dev/null +++ b/recipes/sdl_image/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.5": + folder: "all" diff --git a/recipes/sdl_mixer/all/CMakeLists.txt b/recipes/sdl_mixer/all/CMakeLists.txt new file mode 100644 index 0000000000000..fa206e6c5d5c7 --- /dev/null +++ b/recipes/sdl_mixer/all/CMakeLists.txt @@ -0,0 +1,167 @@ +cmake_minimum_required(VERSION 2.8.12) +project(sdl2_mixer) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +include(CheckTypeSize) + +macro(add_music_option type) + option(${type} "${type} music support" OFF) + message(STATUS "${type} ${${type}}") + if(${${type}}) + add_definitions("-DMUSIC_${type}") + if(${${type}_DYNAMIC}) + add_definitions("-D${type}_DYNAMIC") + endif() + endif() +endmacro() + +add_music_option(CMD) +add_music_option(WAV) +add_music_option(FLAC) +add_music_option(OGG) +add_music_option(OPUS) +add_music_option(MP3_MPG123) +add_music_option(MP3_MAD) +add_music_option(MOD_MIKMOD) +add_music_option(MOD_MODPLUG) +add_music_option(MID_NATIVE) +add_music_option(MID_FLUIDSYNTH) +add_music_option(MID_TINYMIDI) + +if(${MID_NATIVE}) + +set(NATIVE_MIDI_SOURCES +source_subfolder/native_midi/native_midi_common.c +source_subfolder/native_midi/native_midi_common.h +source_subfolder/native_midi/native_midi_haiku.cpp +source_subfolder/native_midi/native_midi_mac.c +source_subfolder/native_midi/native_midi_macosx.c +source_subfolder/native_midi/native_midi_win32.c +) + +set(NATIVE_MIDI_HEADERS +source_subfolder/native_midi/native_midi.h +) + +endif() + +set(SOURCES +source_subfolder/effect_position.c +source_subfolder/effect_stereoreverse.c +source_subfolder/effects_internal.c +source_subfolder/load_aiff.c +source_subfolder/load_voc.c +source_subfolder/mixer.c +source_subfolder/music.c +source_subfolder/music_cmd.c +source_subfolder/music_flac.c +source_subfolder/music_fluidsynth.c +source_subfolder/music_mad.c +source_subfolder/music_mikmod.c +source_subfolder/music_modplug.c +source_subfolder/music_mpg123.c +source_subfolder/music_nativemidi.c +source_subfolder/music_ogg.c +source_subfolder/music_opus.c +source_subfolder/music_timidity.c +source_subfolder/music_wav.c +${NATIVE_MIDI_SOURCES} +) + +set(HEADERS +source_subfolder/effects_internal.h +source_subfolder/load_aiff.h +source_subfolder/load_voc.h +source_subfolder/mixer.h +source_subfolder/music.h +source_subfolder/music_cmd.h +source_subfolder/music_flac.h +source_subfolder/music_fluidsynth.h +source_subfolder/music_mad.h +source_subfolder/music_mikmod.h +source_subfolder/music_modplug.h +source_subfolder/music_mpg123.h +source_subfolder/music_nativemidi.h +source_subfolder/music_ogg.h +source_subfolder/music_opus.h +source_subfolder/music_timidity.h +source_subfolder/music_wav.h +${NATIVE_MIDI_HEADERS} +) + +add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS}) + +target_include_directories(${PROJECT_NAME} PRIVATE "source_subfolder") + +if(${MID_NATIVE}) + target_include_directories(${PROJECT_NAME} PRIVATE "source_subfolder/native_midi") +endif() + +find_package(SDL2 CONFIG REQUIRED) + +if(TARGET SDL2::SDL2-static) + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2-static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2) +endif() +if(FLAC) + find_package(flac CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE FLAC::FLAC++) +endif() +if(OGG) + find_package(Ogg CONFIG REQUIRED) + find_package(Vorbis CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE Ogg::ogg Vorbis::vorbisfile) +endif() +if(OPUS) + find_package(Opus CONFIG REQUIRED) + find_package(opusfile CONFIG REQUIRED) + find_package(OpenSSL CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE Opus::opus opusfile::opusfile OpenSSL::SSL) +endif() +if(MP3_MPG123) + find_package(mpg123 CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE MPG123::libmpg123) +endif() +if(MP3_MAD) + find_package(libmad CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE libmad::libmad) +endif() +if(MOD_MIKMOD) + find_package(libmikmod CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE libmikmod::libmikmod) +endif() +if(MOD_MODPLUG) + find_package(libmodplug CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE libmodplug::libmodplug) +endif() +if(MID_FLUIDSYNTH) + find_package(fluidsynth CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE fluidsynth::fluidsynth) +endif() +if(MID_TINYMIDI) + find_package(tinymidi CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE tinymidi::tinymidi) +endif() + +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER source_subfolder/SDL_mixer.h) + +if(${BUILD_SHARED_LIBS}) + target_compile_definitions(${PROJECT_NAME} PRIVATE DLL_EXPORT) +endif() + +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "SDL2_mixer") + +check_type_size("ssize_t" SSIZE_T) +if(SSIZE_T STREQUAL "") + target_compile_definitions(${PROJECT_NAME} PRIVATE ssize_t=signed) # non-standard type +endif() + +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" + RUNTIME DESTINATION "bin" + PUBLIC_HEADER DESTINATION "include/SDL2" +) diff --git a/recipes/sdl_mixer/all/conandata.yml b/recipes/sdl_mixer/all/conandata.yml new file mode 100644 index 0000000000000..1b2e911620184 --- /dev/null +++ b/recipes/sdl_mixer/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.4": + url: "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz" + sha256: "b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419" diff --git a/recipes/sdl_mixer/all/conanfile.py b/recipes/sdl_mixer/all/conanfile.py new file mode 100644 index 0000000000000..7139d07a2b4ea --- /dev/null +++ b/recipes/sdl_mixer/all/conanfile.py @@ -0,0 +1,144 @@ +from conans import CMake, tools +from conan import ConanFile +from conan.tools.files import get, rmdir +import os +import functools + + +class SDLMixerConan(ConanFile): + name = "sdl_mixer" + description = "SDL_mixer is a sample multi-channel audio mixer library" + topics = ("sdl_mixer", "sdl2", "sdl", "mixer", "audio", "multimedia", "sound", "music") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libsdl.org/projects/SDL_mixer/" + license = "Zlib" + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False], + "cmd": [True, False], + "wav": [True, False], + "flac": [True, False], + "mpg123": [True, False], + "mad": [True, False], + "ogg": [True, False], + "opus": [True, False], + "mikmod": [True, False], + "modplug": [True, False], + "fluidsynth": [True, False], + "nativemidi": [True, False], + "tinymidi": [True, False]} + default_options = {"shared": False, + "fPIC": True, + "cmd": False, # needs sys/wait.h + "wav": True, + "flac": True, + "mpg123": True, + "mad": True, + "ogg": True, + "opus": True, + "mikmod": True, + "modplug": True, + "fluidsynth": False, # TODO: add fluidsynth to Conan Center + "nativemidi": True, + "tinymidi": True} + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.tinymidi + else: + del self.options.nativemidi + + def configure(self): + if self.options.shared: + del self.options.fPIC + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("sdl/2.0.20") + if self.options.flac: + self.requires("flac/1.3.3") + if self.options.mpg123: + self.requires("mpg123/1.29.3") + if self.options.mad: + self.requires("libmad/0.15.1b") + if self.options.ogg: + self.requires("ogg/1.3.5") + self.requires("vorbis/1.3.7") + if self.options.opus: + self.requires("openssl/1.1.1q") + self.requires("opus/1.3.1") + self.requires("opusfile/0.12") + if self.options.mikmod: + self.requires("libmikmod/3.3.11.1") + if self.options.modplug: + self.requires("libmodplug/0.8.9.0") + if self.options.fluidsynth: + self.requires("fluidsynth/2.2") # TODO: this package is missing on the conan-center-index + if self.settings.os == "Linux": + if self.options.tinymidi: + self.requires("tinymidi/cci.20130325") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + rmdir(self, os.path.join(self._source_subfolder, "external")) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["CMD"] = self.options.cmd + cmake.definitions["WAV"] = self.options.wav + cmake.definitions["FLAC"] = self.options.flac + cmake.definitions["MP3_MPG123"] = self.options.mpg123 + cmake.definitions["MP3_MAD"] = self.options.mad + cmake.definitions["OGG"] = self.options.ogg + cmake.definitions["OPUS"] = self.options.opus + cmake.definitions["MOD_MIKMOD"] = self.options.mikmod + cmake.definitions["MOD_MODPLUG"] = self.options.modplug + cmake.definitions["MID_FLUIDSYNTH"] = self.options.fluidsynth + if self.settings.os == "Linux": + cmake.definitions["MID_TINYMIDI"] = self.options.tinymidi + cmake.definitions["MID_NATIVE"] = False + else: + cmake.definitions["MID_TINYMIDI"] = False + cmake.definitions["MID_NATIVE"] = self.options.nativemidi + + cmake.definitions["FLAC_DYNAMIC"] = self.options["flac"].shared if self.options.flac else False + cmake.definitions["MP3_MPG123_DYNAMIC"] = self.options["mpg123"].shared if self.options.mpg123 else False + cmake.definitions["OGG_DYNAMIC"] = self.options["ogg"].shared if self.options.ogg else False + cmake.definitions["OPUS_DYNAMIC"] = self.options["opus"].shared if self.options.opus else False + cmake.definitions["MOD_MIKMOD_DYNAMIC"] = self.options["libmikmod"].shared if self.options.mikmod else False + cmake.definitions["MOD_MODPLUG_DYNAMIC"] = self.options["libmodplug"].shared if self.options.modplug else False + + cmake.configure(build_folder=self._build_subfolder) + + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYING.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "SDL2_mixer") + self.cpp_info.set_property("cmake_file_name", "SDL2_mixer") + self.cpp_info.set_property("cmake_target_name", "SDL2_mixer::SDL2_mixer") + self.cpp_info.set_property("pkg_config_name", "SDL2_mixer") + self.cpp_info.libs = ["SDL2_mixer"] + self.cpp_info.includedirs.append(os.path.join("include", "SDL2")) + + 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/all/test_package/CMakeLists.txt b/recipes/sdl_mixer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cbb6dbc11043a --- /dev/null +++ b/recipes/sdl_mixer/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SDL2_mixer CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_mixer::SDL2_mixer) diff --git a/recipes/sdl_mixer/all/test_package/conanfile.py b/recipes/sdl_mixer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/sdl_mixer/all/test_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/all/test_package/test_package.c b/recipes/sdl_mixer/all/test_package/test_package.c new file mode 100644 index 0000000000000..a8f3af1273f85 --- /dev/null +++ b/recipes/sdl_mixer/all/test_package/test_package.c @@ -0,0 +1,42 @@ +#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/config.yml b/recipes/sdl_mixer/config.yml new file mode 100644 index 0000000000000..303d89a72ec25 --- /dev/null +++ b/recipes/sdl_mixer/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.4": + folder: "all" diff --git a/recipes/sdl_net/all/CMakeLists.txt b/recipes/sdl_net/all/CMakeLists.txt new file mode 100644 index 0000000000000..2b17dca170dfa --- /dev/null +++ b/recipes/sdl_net/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.1) +project(SDL2_net LANGUAGES C) + +find_package(SDL2 REQUIRED CONFIG) + +add_library(SDL2_net + ${SDL_NET_SRC_DIR}/SDLnet.c + ${SDL_NET_SRC_DIR}/SDLnetselect.c + ${SDL_NET_SRC_DIR}/SDLnetTCP.c + ${SDL_NET_SRC_DIR}/SDLnetUDP.c +) +target_include_directories(SDL2_net PUBLIC ${SDL_NET_SRC_DIR}) +target_link_libraries(SDL2_net PUBLIC SDL2::SDL2) + +if(WIN32) + target_link_libraries(SDL2_net PRIVATE ws2_32 iphlpapi) + target_compile_definitions(SDL2_net PRIVATE "DECLSPEC=__declspec(dllexport)") +else() + target_compile_definitions(SDL2_net PRIVATE "DECLSPEC=__attribute__((visibility(\"default\")))") +endif() + +set_target_properties(SDL2_net PROPERTIES + PUBLIC_HEADER ${SDL_NET_SRC_DIR}/SDL_net.h + C_VISIBILITY_PRESET hidden +) + +include(GNUInstallDirs) +install(TARGETS SDL2_net + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2 +) diff --git a/recipes/sdl_net/all/conandata.yml b/recipes/sdl_net/all/conandata.yml new file mode 100644 index 0000000000000..d051057513001 --- /dev/null +++ b/recipes/sdl_net/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "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 new file mode 100644 index 0000000000000..c899c658f21bc --- /dev/null +++ b/recipes/sdl_net/all/conanfile.py @@ -0,0 +1,85 @@ +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 +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class SdlnetConan(ConanFile): + name = "sdl_net" + description = "A networking library for SDL" + license = "Zlib" + topics = ("sdl2", "sdl2_net", "sdl", "sdl_net", "net", "networking") + homepage = "https://www.libsdl.org/projects/SDL_net" + 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, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("sdl/2.26.0") + + def validate(self): + if Version(self.version).major != Version(self.dependencies["sdl"].ref.version).major: + raise ConanInvalidConfiguration(f"The major versions of {self.name} and sdl must be the same") + + 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["SDL_NET_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.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, "COPYING.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.set_property("cmake_file_name", "SDL2_net") + self.cpp_info.set_property("cmake_target_name", "SDL2_net::SDL2_net") + self.cpp_info.set_property("pkg_config_name", "SDL2_net") + self.cpp_info.libs = ["SDL2_net"] + self.cpp_info.includedirs.append(os.path.join("include", "SDL2")) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "SDL2_net" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2_net" + self.cpp_info.names["pkg_config"] = "SDL2_net" diff --git a/recipes/sdl_net/all/test_package/CMakeLists.txt b/recipes/sdl_net/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2337a1a3efdef --- /dev/null +++ b/recipes/sdl_net/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(SDL2_net REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net) diff --git a/recipes/sdl_net/all/test_package/conanfile.py b/recipes/sdl_net/all/test_package/conanfile.py new file mode 100644 index 0000000000000..744f9cf00c80f --- /dev/null +++ b/recipes/sdl_net/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + test_ip = "127.0.0.1" + self.run(f"{bin_path} {test_ip}", env="conanrun") diff --git a/recipes/sdl_net/all/test_package/test_package.c b/recipes/sdl_net/all/test_package/test_package.c new file mode 100644 index 0000000000000..82a7bb06be1b6 --- /dev/null +++ b/recipes/sdl_net/all/test_package/test_package.c @@ -0,0 +1,65 @@ +#define SDL_MAIN_HANDLED +#include +#include + +#include + +int main(int argc, char **argv) +{ + IPaddress ip; + const char *host; + Uint8 *ipaddr; + + /* check our commandline */ + if (argc < 2) + { + fprintf(stderr, "Need at least one argument\n"); + exit(1); + } + + /* initialize SDL */ + if(SDL_Init(0)==-1) + { + fprintf(stderr, "SDL_Init: %s\n",SDL_GetError()); + exit(2); + } + + /* initialize SDL_net */ + if(SDLNet_Init()==-1) + { + fprintf(stderr, "SDLNet_Init: %s\n",SDLNet_GetError()); + exit(3); + } + + /* Resolve the argument into an IPaddress type */ + printf("Resolving %s\n",argv[1]); + if(SDLNet_ResolveHost(&ip,argv[1],0)==-1) + { + fprintf(stderr, "Could not resolve host \"%s\"\n%s\n",argv[1],SDLNet_GetError()); + exit(4); + } + + /* use the IP as a Uint8[4] */ + ipaddr=(Uint8*)&ip.host; + + /* output the IP address nicely */ + printf("IP Address : %d.%d.%d.%d\n", + ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); + + /* resolve the hostname for the IPaddress */ + host=SDLNet_ResolveIP(&ip); + + /* print out the hostname we got */ + if(host) + printf("Hostname : %s\n",host); + else + printf("No Hostname found\n"); + + /* shutdown SDL_net */ + SDLNet_Quit(); + + /* shutdown SDL */ + SDL_Quit(); + + return(0); +} diff --git a/recipes/sdl_net/all/test_v1_package/CMakeLists.txt b/recipes/sdl_net/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sdl_net/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sdl_net/all/test_v1_package/conanfile.py b/recipes/sdl_net/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cb4e97ea795b6 --- /dev/null +++ b/recipes/sdl_net/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + test_ip = "127.0.0.1" + self.run(f"{bin_path} {test_ip}", run_environment=True) diff --git a/recipes/sdl_net/config.yml b/recipes/sdl_net/config.yml new file mode 100644 index 0000000000000..bb7eb85dfac49 --- /dev/null +++ b/recipes/sdl_net/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.1": + folder: all diff --git a/recipes/sdl_ttf/all/conandata.yml b/recipes/sdl_ttf/all/conandata.yml new file mode 100644 index 0000000000000..ac34ee3b6fceb --- /dev/null +++ b/recipes/sdl_ttf/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "2.20.1": + url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-2.20.1.tar.gz" + sha256: "78cdad51f3cc3ada6932b1bb6e914b33798ab970a1e817763f22ddbfd97d0c57" + "2.0.18": + url: "https://github.com/libsdl-org/SDL_ttf/archive/refs/tags/release-2.0.18.tar.gz" + sha256: "6b61544441b72bdfa1ced89034c6396fe80228eff201eb72c5f78e500bb80bd0" + "2.0.15": + url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.0.15/SDL2_ttf-2.0.15.tar.gz" + sha256: "a9eceb1ad88c1f1545cd7bd28e7cbc0b2c14191d40238f531a15b01b1b22cd33" +patches: + "2.20.1": + - patch_file: "patches/2.20.1-0001-fix-cmake-min-version.patch" + patch_description: "Disable useless .pc file install to avoid relying on CMake 3.21 features" + patch_type: "conan" + "2.0.18": + - patch_file: "patches/2.0.18-0001-cmake-fix-link-target.patch" + patch_description: "correct target name, disable PIC fixed" + patch_type: "portability" + - patch_file: "patches/2.0.18-0002-fix-android.patch" + patch_description: "Fix Android build" + patch_type: "portability" + "2.0.15": + - patch_file: "patches/2.0.15-0001-cmake-fix-link-target.patch" + patch_description: "correct target name" + patch_type: "portability" diff --git a/recipes/sdl_ttf/all/conanfile.py b/recipes/sdl_ttf/all/conanfile.py new file mode 100644 index 0000000000000..984ebd5896713 --- /dev/null +++ b/recipes/sdl_ttf/all/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class SdlttfConan(ConanFile): + name = "sdl_ttf" + description = "A TrueType font library for SDL" + license = "Zlib" + topics = ("sdl2", "sdl2_ttf", "sdl", "sdl_ttf", "ttf", "font") + homepage = "https://www.libsdl.org/projects/SDL_ttf" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_harfbuzz": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_harfbuzz": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "2.20.0": + del self.options.with_harfbuzz + + 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 Version(self.version) >= "2.20.0": + self.options["sdl"].shared = self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("freetype/2.12.1") + self.requires("sdl/2.26.1") + if self.options.get_safe("with_harfbuzz"): + self.requires("harfbuzz/6.0.0") + + def validate(self): + if Version(self.version).major != Version(self.dependencies["sdl"].ref.version).major: + raise ConanInvalidConfiguration("sdl & sdl_ttf must have the same major version") + + if Version(self.version) >= "2.20.0": + if self.options.shared != self.dependencies["sdl"].options.shared: + raise ConanInvalidConfiguration("sdl & sdl_ttf must be built with the same 'shared' option value") + else: + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared is not supported with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "2.20.0": + tc.variables["SDL2TTF_SAMPLES"] = False + tc.variables["SDL2TTF_VENDORED"] = False + tc.variables["SDL2TTF_HARFBUZZ"] = self.options.with_harfbuzz + tc.variables["SDL2TTF_DEBUG_POSTFIX"] = "" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # missing from distribution (only in 2.0.15?) + save(self, os.path.join(self.source_folder, "SDL2_ttfConfig.cmake"), "") + + # workaround for a side effect of CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in conan toolchain + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(Freetype REQUIRED)", + "find_package(Freetype REQUIRED MODULE)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "SDL2_ttf.framework")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + suffix = "-static" if Version(self.version) >= "2.20.0" and not self.options.shared else "" + + self.cpp_info.set_property("cmake_file_name", "SDL2_ttf") + self.cpp_info.set_property("pkg_config_name", "SDL2_ttf") + + self.cpp_info.components["_sdl2_ttf"].set_property("cmake_target_name",f"SDL2_ttf::SDL2_ttf{suffix}") + self.cpp_info.components["_sdl2_ttf"].includedirs.append(os.path.join("include", "SDL2")) + self.cpp_info.components["_sdl2_ttf"].libs = [f"SDL2_ttf"] + self.cpp_info.components["_sdl2_ttf"].requires = ["freetype::freetype", "sdl::libsdl2"] + if self.options.get_safe("with_harfbuzz"): + self.cpp_info.components["_sdl2_ttf"].requires.append("harfbuzz::harfbuzz") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "SDL2_ttf" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2_ttf" + self.cpp_info.components["_sdl2_ttf"].names["cmake_find_package"] = f"SDL2_ttf{suffix}" + self.cpp_info.components["_sdl2_ttf"].names["cmake_find_package_multi"] = f"SDL2_ttf{suffix}" diff --git a/recipes/sdl_ttf/all/patches/2.0.15-0001-cmake-fix-link-target.patch b/recipes/sdl_ttf/all/patches/2.0.15-0001-cmake-fix-link-target.patch new file mode 100644 index 0000000000000..3643824059a28 --- /dev/null +++ b/recipes/sdl_ttf/all/patches/2.0.15-0001-cmake-fix-link-target.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed6e249..19ff2fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,7 +22,13 @@ set(SDL_TTF_VERSION "${SDL_TTF_MAJOR_VERSION}.${SDL_TTF_MINOR_VERSION}.${SDL_TTF + + ##### library generation ##### + add_library(SDL2_ttf SDL_ttf.c SDL_ttf.h) +-target_link_libraries(SDL2_ttf SDL2::SDL2 Freetype::Freetype) ++ ++if(TARGET SDL2::SDL2) ++ target_link_libraries(SDL2_ttf SDL2::SDL2 Freetype::Freetype) ++else () ++ target_link_libraries(SDL2_ttf SDL2::SDL2-static Freetype::Freetype) ++endif () ++ + target_include_directories(SDL2_ttf PUBLIC $) + + install( diff --git a/recipes/sdl_ttf/all/patches/2.0.18-0001-cmake-fix-link-target.patch b/recipes/sdl_ttf/all/patches/2.0.18-0001-cmake-fix-link-target.patch new file mode 100644 index 0000000000000..84732955a02d5 --- /dev/null +++ b/recipes/sdl_ttf/all/patches/2.0.18-0001-cmake-fix-link-target.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed087ac..4bd029b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,11 +65,10 @@ set(SDL_TTF_VERSION "${SDL_TTF_MAJOR_VERSION}.${SDL_TTF_MINOR_VERSION}.${SDL_TTF + + ##### library generation ##### + add_library(SDL2_ttf SDL_ttf.c SDL_ttf.h) +-if (BUILD_SHARED_LIBS) ++if(TARGET SDL2::SDL2) + target_link_libraries(SDL2_ttf SDL2::SDL2) + else () + target_link_libraries(SDL2_ttf SDL2::SDL2-static) +- set_target_properties(SDL2_ttf PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif () + target_link_libraries(SDL2_ttf Freetype::Freetype) + target_include_directories(SDL2_ttf PUBLIC $) diff --git a/recipes/sdl_ttf/all/patches/2.0.18-0002-fix-android.patch b/recipes/sdl_ttf/all/patches/2.0.18-0002-fix-android.patch new file mode 100644 index 0000000000000..5007f133c4a18 --- /dev/null +++ b/recipes/sdl_ttf/all/patches/2.0.18-0002-fix-android.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ endif() + cmake_minimum_required(VERSION 3.0) + project(SDL_ttf C) + +-if (ANDROID) ++if (0) + option(TTF_WITH_HARFBUZZ "use harfbuzz to improve text shaping" OFF) + + add_library(SDL2_ttf SHARED) diff --git a/recipes/sdl_ttf/all/patches/2.20.1-0001-fix-cmake-min-version.patch b/recipes/sdl_ttf/all/patches/2.20.1-0001-fix-cmake-min-version.patch new file mode 100644 index 0000000000000..68cbd1fdeda66 --- /dev/null +++ b/recipes/sdl_ttf/all/patches/2.20.1-0001-fix-cmake-min-version.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -325,7 +325,7 @@ if(SDL2TTF_INSTALL) + COMPONENT devel + ) + +- if(SDL2TTF_BUILD_SHARED_LIBS) ++ if(0) + # Only create a .pc file for a shared SDL2_ttf + set(prefix "${CMAKE_INSTALL_PREFIX}") + set(exec_prefix "\${prefix}") diff --git a/recipes/sdl_ttf/all/test_package/CMakeLists.txt b/recipes/sdl_ttf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a17e98d94db30 --- /dev/null +++ b/recipes/sdl_ttf/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(SDL2_ttf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET SDL2_ttf::SDL2_ttf) + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_ttf::SDL2_ttf) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_ttf::SDL2_ttf-static) +endif() diff --git a/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf b/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd79d43bea0293ac1b20e8aca1142627983d2c07 GIT binary patch literal 224592 zcmbTe349bq+CN^^*W8&qlRGn+9E1>Zk;HIi2qAQM&s|SFJ%kcM ztoRa0YJNqpo==B7){*c7z97W@SkL?(1tgw-mGBjZ&?~BEY2ON6wlN#$xK1AGSq zD5=XEgs-#_!XNKjk&?b;$_pWc&;z($J8bNb35hSKj3UIe4+De^oBEj3njH2FA(1*xUL`h==2ehvp%>%NZf8hd%rho_>j8a zE}aO%^E=~u)+jUtC2GrY{us_ zl92eM36q9Tcwf`}2q6&+zFUOhj)t!5_)^Ym4;wrGN;GOT5OOllv016VF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Pm{(ks~UIt$)A6J z`o%YVon7?W{H*J$&S|Zlec?|Rnhl5CT-en&YV$vu%9@+riVR#^bZn^p$Mbq`8*@(W zMJM--y7$nV+qU2O%B|16{NBao+m8R~xI1^A^+EKrsi!`?rr3LGQ>H(~^X!~iH!j(G z`ubJ3t*N>v>-sNNPM`bMlcySo)r*VPJ-%zv4VioXI4w2v{&NPt8ujU2+it(`f|r`- z=Y0A;ckMURJO323;M8X~zxF>X3i=QI;Oy|5Rpufs^7Qj3y}WGK1-lM^qG3w+w$EDc z+WVesW!aRR{J(n!L>I|oJ7>(;_{9IWvd2gLO3;Vqsdn@kqlUGJERURL7@wRqN*A82 zVTX0nxuNEh=@~&26hqr%j01-<>K?lPeOpp?^T9d(^#zZNT(z()>l`EXsfOV#jmCfa z#tp|6ei}Whd~mJN%-iydj(TQwdd9B$rxvEYQnY^6*&qDRjOjPE6^yxL`<`0^$IZLs zk7tTS8z0@e`X8tCO#a)IcW%A-(ks3RZ@D~e^ZO-F-@GjAv{}c$zvZjVRc|ltfBJ%X zUAuihy0gCgaLNszUh~(9xB3o#>F%!%3(URuVD^t0kt*NqgXgcAQ3X8&ZeZdg=S(&I&9l96JNncPTa6oTZD6wgSyrO}E$qsUWSL@$b) zeiedGcV2q--ffxBzFdAxvvoq-q3`jk!R^h($ literal 0 HcmV?d00001 diff --git a/recipes/sdl_ttf/all/test_package/conanfile.py b/recipes/sdl_ttf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c4fdfb4dbdc98 --- /dev/null +++ b/recipes/sdl_ttf/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") + self.run(f"{bin_path} {ttf_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 new file mode 100644 index 0000000000000..2050bc43e4215 --- /dev/null +++ b/recipes/sdl_ttf/all/test_package/test_package.c @@ -0,0 +1,27 @@ +#define SDL_MAIN_HANDLED +#include + +#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/CMakeLists.txt b/recipes/sdl_ttf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sdl_ttf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sdl_ttf/all/test_v1_package/conanfile.py b/recipes/sdl_ttf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7b775db727c08 --- /dev/null +++ b/recipes/sdl_ttf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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) diff --git a/recipes/sdl_ttf/config.yml b/recipes/sdl_ttf/config.yml new file mode 100644 index 0000000000000..0db264b704044 --- /dev/null +++ b/recipes/sdl_ttf/config.yml @@ -0,0 +1,7 @@ +versions: + "2.20.1": + folder: all + "2.0.18": + folder: all + "2.0.15": + folder: all diff --git a/recipes/seadex-essentials/all/conandata.yml b/recipes/seadex-essentials/all/conandata.yml new file mode 100644 index 0000000000000..113d034e0a06a --- /dev/null +++ b/recipes/seadex-essentials/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "2.1.3": + url: + - "https://github.com/SeadexGmbH/essentials/archive/refs/tags/2.1.3.tar.gz" + sha256: "c0f758279b90fcf6a3e0a511978d0fa3bf4934fe600bb6e69cc8feb65221bd58" diff --git a/recipes/seadex-essentials/all/conanfile.py b/recipes/seadex-essentials/all/conanfile.py new file mode 100644 index 0000000000000..e938a5f24cf68 --- /dev/null +++ b/recipes/seadex-essentials/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class SeadexEssentialsConan(ConanFile): + name = "seadex-essentials" + description = "essentials is a small c++ library that offers very basic capabilities for applications and libraries." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://essentials.seadex.de/" + topics = ("utility", "c++") + 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.3", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "10" + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.options["fmt/*"].header_only = True + self.options["spdlog/*"].header_only = True + + def requirements(self): + # Headers are exposed https://github.com/SeadexGmbH/essentials/blob/622a07dc1530f5668f5dde0ce18007d420c371cd/essentials/include/essentials/log/log_level.hpp#L15 + self.requires("spdlog/1.11.0", transitive_headers=True) + # Exposes headers and symbols https://github.com/SeadexGmbH/essentials/blob/622a07dc1530f5668f5dde0ce18007d420c371cd/essentials/include/essentials/type_wrapper.hpp#L282 + self.requires("fmt/9.1.0", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires at least {self.settings.compiler} {minimum_version}." + ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + if not self.dependencies["spdlog"].options.header_only: + raise ConanInvalidConfiguration("Spdlog must be header only!") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["ESS_BUILD_UNIT_TESTS"] = False + tc.cache_variables["ESS_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses") ) + cmake = CMake(self) + cmake.configure() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["essentials"] diff --git a/recipes/seadex-essentials/all/test_package/CMakeLists.txt b/recipes/seadex-essentials/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cfd0f452a3ad8 --- /dev/null +++ b/recipes/seadex-essentials/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(seadex-essentials REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE seadex-essentials::seadex-essentials) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/seadex-essentials/all/test_package/conanfile.py b/recipes/seadex-essentials/all/test_package/conanfile.py new file mode 100644 index 0000000000000..63dab6b31486d --- /dev/null +++ b/recipes/seadex-essentials/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/seadex-essentials/all/test_package/test_package.cpp b/recipes/seadex-essentials/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..442d07091ff95 --- /dev/null +++ b/recipes/seadex-essentials/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include "essentials/log/log.hpp" + +int main() { + + auto& logger = sxe::logger::get_instance(); + sxe::logger_manager::get_instance().set_logger( logger ); + logger.set_log_level( LL_TRACE ); + logger.add_std_out_sink(); + + SXE_LOG_LOCATED( LL_TRACE, "main.cpp", __LINE__, "{}) Hello {}!", __LINE__, "John Doe" ); + SXE_LOG_LOCATED( LL_DEBUG, "main.cpp", __LINE__, "{}) Hello {}!", __LINE__, "John Doe" ); + SXE_LOG_LOCATED( LL_INFO, "main.cpp", __LINE__, "{}) Hello {}!", __LINE__, "John Doe" ); + SXE_LOG_LOCATED( LL_WARN, "main.cpp", __LINE__, "{}) Hello {}!", __LINE__, "John Doe" ); + SXE_LOG_LOCATED( LL_ERROR, "main.cpp", __LINE__, "{}) Hello {}!", __LINE__, "John Doe" ); + SXE_LOG_LOCATED( LL_FATAL, "main.cpp", __LINE__, "{}) Hello {}!", __LINE__, "John Doe" ); + + return EXIT_SUCCESS; +} diff --git a/recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt b/recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/seadex-essentials/all/test_v1_package/conanfile.py b/recipes/seadex-essentials/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/seadex-essentials/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/seadex-essentials/config.yml b/recipes/seadex-essentials/config.yml new file mode 100644 index 0000000000000..e6ceade928280 --- /dev/null +++ b/recipes/seadex-essentials/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.3": + folder: all diff --git a/recipes/seasocks/all/CMakeLists.txt b/recipes/seasocks/all/CMakeLists.txt new file mode 100644 index 0000000000000..56b7606e716f9 --- /dev/null +++ b/recipes/seasocks/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/seasocks/all/conandata.yml b/recipes/seasocks/all/conandata.yml new file mode 100644 index 0000000000000..8ea105850a8ba --- /dev/null +++ b/recipes/seasocks/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.4.5": + url: "https://github.com/mattgodbolt/seasocks/archive/v1.4.5.tar.gz" + sha256: "82211959cf8aabc85b300358c5f68cf9c56dfdf4eaa09e548580fce908acfc1b" + "1.4.4": + url: "https://github.com/mattgodbolt/seasocks/archive/v1.4.4.tar.gz" + sha256: "5ec016ee87d4985a031212fa23a00de3de5f0fa1ceb82d7b9a3d1c189356bf8d" diff --git a/recipes/seasocks/all/conanfile.py b/recipes/seasocks/all/conanfile.py new file mode 100644 index 0000000000000..5a35a2a904c83 --- /dev/null +++ b/recipes/seasocks/all/conanfile.py @@ -0,0 +1,124 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class SeasocksConan(ConanFile): + name = "seasocks" + description = "A tiny embeddable C++ HTTP and WebSocket server for Linux" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mattgodbolt/seasocks" + topics = ("embeddable", "webserver", "websockets") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + } + + @property + def _min_cppstd(self): + return 11 if Version(self.version) < "1.4.5" else 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "1.4.5": + return {} + else: + return { + "Visual Studio": "16", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support this os") + + 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 _patch_sources(self): + # No warnings as errors + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "-Werror", "") + replace_in_file(self, cmakelists, "-pedantic-errors", "") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DEFLATE_SUPPORT"] = self.options.with_zlib + tc.variables["SEASOCKS_SHARED"] = self.options.shared + tc.variables["SEASOCKS_EXAMPLE_APP"] = False + tc.variables["UNITTESTS"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Seasocks") + self.cpp_info.set_property("cmake_target_name", "Seasocks::seasocks") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["libseasocks"].libs = ["seasocks"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libseasocks"].system_libs.extend(["pthread", "m"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Seasocks" + self.cpp_info.names["cmake_find_package_multi"] = "Seasocks" + self.cpp_info.components["libseasocks"].names["cmake_find_package"] = "seasocks" + self.cpp_info.components["libseasocks"].names["cmake_find_package_multi"] = "seasocks" + self.cpp_info.components["libseasocks"].set_property("cmake_target_name", "Seasocks::seasocks") + if self.options.with_zlib: + self.cpp_info.components["libseasocks"].requires = ["zlib::zlib"] diff --git a/recipes/seasocks/all/test_package/CMakeLists.txt b/recipes/seasocks/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f005fadc41716 --- /dev/null +++ b/recipes/seasocks/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Seasocks REQUIRED CONFIG) +find_package(Threads REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Seasocks::seasocks Threads::Threads) +if(Seasocks_VERSION VERSION_LESS "1.4.5") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/seasocks/all/test_package/conanfile.py b/recipes/seasocks/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/seasocks/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/seasocks/all/test_package/test_package.cpp b/recipes/seasocks/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..eb27bfa301f9c --- /dev/null +++ b/recipes/seasocks/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include "seasocks/Server.h" +#include "seasocks/Connection.h" +#include "seasocks/PrintfLogger.h" + +#include +#include + +using namespace seasocks; + +// This is a conan test program to ensure the packaging works. +// It's not meant as an example of how best to use Seasocks. +int main(int argc, const char* argv[]) { + auto logger = std::make_shared(); + Server server(logger); + server.startListening(0); + std::thread seasocksThread([&] { + server.loop(); + }); + + sleep(1); + + server.terminate(); + seasocksThread.join(); +} diff --git a/recipes/seasocks/all/test_v1_package/CMakeLists.txt b/recipes/seasocks/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/seasocks/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/seasocks/all/test_v1_package/conanfile.py b/recipes/seasocks/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/seasocks/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/seasocks/config.yml b/recipes/seasocks/config.yml new file mode 100644 index 0000000000000..bcda68af0d12d --- /dev/null +++ b/recipes/seasocks/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.5": + folder: "all" + "1.4.4": + folder: "all" diff --git a/recipes/semimap/all/conandata.yml b/recipes/semimap/all/conandata.yml new file mode 100644 index 0000000000000..6af7c8e19bc89 --- /dev/null +++ b/recipes/semimap/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20181023": + url: "https://github.com/hogliux/semimap/archive/de556c74721a5017f5a03faf2fbd1c6e5a768a32.tar.gz" + sha256: "af4689afb3809664507e2ae77332650b658175d5382cbe63957707547d7ee76e" diff --git a/recipes/semimap/all/conanfile.py b/recipes/semimap/all/conanfile.py new file mode 100644 index 0000000000000..bd330607698a4 --- /dev/null +++ b/recipes/semimap/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class SemimapConan(ConanFile): + name = "semimap" + description = "A semi compile-/run-time associative map container with compile-time lookup and run-time storage" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hogliux/semimap" + topics = ("containers", "constexpr", "hashmap", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/semimap/all/test_package/CMakeLists.txt b/recipes/semimap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07f01c03a2b1b --- /dev/null +++ b/recipes/semimap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(semimap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE semimap::semimap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/semimap/all/test_package/conanfile.py b/recipes/semimap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/semimap/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/semimap/all/test_package/test_package.cpp b/recipes/semimap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..00f62373a05d4 --- /dev/null +++ b/recipes/semimap/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include "semimap.h" + +#define ID(x) \ + []() constexpr { return x; } + +int main() { + + // Test compile-time only load/store + { + struct Tag { + }; + using map = semi::static_map; + + auto& food = map::get(ID("food")); + assert(food.empty()); + + food = "pizza"; + assert(map::get(ID("food")) == "pizza"); + + auto& drink = map::get(ID("drink")); + assert(drink.empty()); + + drink = "beer"; + assert(map::get(ID("food")) == "pizza"); + assert(map::get(ID("drink")) == "beer"); + + map::get(ID("food")) = "spaghetti"; + assert(map::get(ID("food")) == "spaghetti"); + assert(map::get(ID("drink")) == "beer"); + + map::get(ID("drink")) = "soda"; + assert(map::get(ID("food")) == "spaghetti"); + assert(map::get(ID("drink")) == "soda"); + + assert(map::get(ID("starter"), "soup") == "soup"); + assert(map::get(ID("starter"), "salad") == "soup"); + } + + return 0; +} diff --git a/recipes/semimap/all/test_v1_package/CMakeLists.txt b/recipes/semimap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/semimap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/semimap/all/test_v1_package/conanfile.py b/recipes/semimap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/semimap/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/semimap/config.yml b/recipes/semimap/config.yml new file mode 100644 index 0000000000000..b3eb9a995d928 --- /dev/null +++ b/recipes/semimap/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20181023": + folder: all diff --git a/recipes/semver.c/all/CMakeLists.txt b/recipes/semver.c/all/CMakeLists.txt new file mode 100644 index 0000000000000..38d90f4390989 --- /dev/null +++ b/recipes/semver.c/all/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.4) +project(semver.c LANGUAGES C) + +include(GNUInstallDirs) + +add_library(semver.c ${SEMVER_C_SRC_DIR}/semver.c) +set_target_properties(semver.c PROPERTIES + PUBLIC_HEADER ${SEMVER_C_SRC_DIR}/semver.h + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +install(TARGETS semver.c + 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/semver.c/all/conandata.yml b/recipes/semver.c/all/conandata.yml new file mode 100644 index 0000000000000..5af28b4c94962 --- /dev/null +++ b/recipes/semver.c/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + sha256: 17a7e24b367dd93ab50684d44378ed11397bcae9547e45cc4aa9bb5833c9d052 + url: https://github.com/h2non/semver.c/archive/v1.0.0.tar.gz diff --git a/recipes/semver.c/all/conanfile.py b/recipes/semver.c/all/conanfile.py new file mode 100644 index 0000000000000..53dd5bf5bddd1 --- /dev/null +++ b/recipes/semver.c/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class SemverCConan(ConanFile): + name = "semver.c" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/h2non/semver.c" + description = "Semantic versioning for c" + topics = ("versioning", "semver", "semantic", "versioning") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SEMVER_C_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 = ["semver.c"] diff --git a/recipes/semver.c/all/test_package/CMakeLists.txt b/recipes/semver.c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..96e57e4c4f92b --- /dev/null +++ b/recipes/semver.c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(semver.c CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE semver.c::semver.c) diff --git a/recipes/semver.c/all/test_package/conanfile.py b/recipes/semver.c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/semver.c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/semver.c/all/test_package/test_package.c b/recipes/semver.c/all/test_package/test_package.c new file mode 100644 index 0000000000000..1feec3f8c759b --- /dev/null +++ b/recipes/semver.c/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include "semver.h" + +int main(void) { + semver_t v; + semver_bump (&v); + + const char ver[] = "1.0.0"; + const int valid = semver_is_valid(ver); + printf("%s is valid: %d\n", ver, valid); + + return 0; +} diff --git a/recipes/semver.c/all/test_v1_package/CMakeLists.txt b/recipes/semver.c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/semver.c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/semver.c/all/test_v1_package/conanfile.py b/recipes/semver.c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/semver.c/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/semver.c/config.yml b/recipes/semver.c/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/semver.c/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/sentry-breakpad/all/CMakeLists.txt b/recipes/sentry-breakpad/all/CMakeLists.txt new file mode 100644 index 0000000000000..1032c96e32553 --- /dev/null +++ b/recipes/sentry-breakpad/all/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.8) +project(cmake_wrapper) + +add_subdirectory(src/external) diff --git a/recipes/sentry-breakpad/all/conandata.yml b/recipes/sentry-breakpad/all/conandata.yml new file mode 100644 index 0000000000000..21ccf617970ea --- /dev/null +++ b/recipes/sentry-breakpad/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.6.2": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" + sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" + "0.6.1": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" + sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" + "0.6.0": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" + sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "0.5.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" + sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" + "0.4.18": + url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" + sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" diff --git a/recipes/sentry-breakpad/all/conanfile.py b/recipes/sentry-breakpad/all/conanfile.py new file mode 100644 index 0000000000000..a7d5646c8989e --- /dev/null +++ b/recipes/sentry-breakpad/all/conanfile.py @@ -0,0 +1,173 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.3" + + +class SentryBreakpadConan(ConanFile): + name = "sentry-breakpad" + description = "Client component that implements a crash-reporting system." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/getsentry/breakpad" + license = "Apache-2.0" + topics = ("breakpad", "error-reporting", "crash-reporting") + provides = "breakpad" + 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 if Version(self.version) < "0.5.4" else 17 + + @property + def _compilers_minimum_version(self): + return {} if Version(self.version) < "0.5.4" else { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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 layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os in ("FreeBSD", "Linux"): + # linux-syscal-support is a public dependency + # see https://github.com/conan-io/conan-center-index/pull/16752#issuecomment-1487241864 + self.requires("linux-syscall-support/cci.20200813", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os in ["Linux", "FreeBSD"]: + tc.variables["LINUX"] = True + tc.generate() + + def _patch_sources(self): + # FIXME: convert to patches + import textwrap + + files_to_patch = [ + # "src/tools/linux/md2core/minidump-2-core.cc", + # "src/processor/testdata/linux_test_app.cc", + "src/common/memory_allocator.h", + "src/common/linux/memory_mapped_file.cc", + "src/common/linux/file_id.cc", + "src/common/linux/safe_readlink.cc", + "src/client/minidump_file_writer.cc", + "src/client/linux/handler/exception_handler.cc", + "src/client/linux/handler/exception_handler_unittest.cc", + "src/client/linux/log/log.cc", + "src/client/linux/crash_generation/crash_generation_client.cc", + "src/client/linux/minidump_writer/linux_dumper.cc", + "src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc", + "src/client/linux/minidump_writer/proc_cpuinfo_reader.h", + "src/client/linux/minidump_writer/minidump_writer.cc", + "src/client/linux/minidump_writer/linux_ptrace_dumper.cc", + "src/client/linux/minidump_writer/cpu_set.h", + "src/client/linux/minidump_writer/directory_reader.h", + "src/client/linux/minidump_writer/line_reader.h" + ] + + for file in files_to_patch: + replace_in_file(self, + os.path.join(self.source_folder, "external", "breakpad", file), + "#include \"third_party/lss/linux_syscall_support.h\"", + "#include " + ) + + save(self, os.path.join(self.source_folder, "external", "CMakeLists.txt"), + textwrap.dedent("""\ + target_compile_features(breakpad_client PUBLIC cxx_std_11) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + find_path(LINUX_SYSCALL_INCLUDE_DIR NAMES linux_syscall_support.h) + target_include_directories(breakpad_client PRIVATE ${LINUX_SYSCALL_INCLUDE_DIR}) + endif() + install(TARGETS breakpad_client + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) + file(GLOB COMMON_FILES breakpad/src/common/*.h) + install(FILES ${COMMON_FILES} + DESTINATION include/breakpad/common + ) + set(PLATFORM_FOLDER) + if(IOS) + set(PLATFORM_FOLDER ios) + elseif(APPLE) + set(PLATFORM_FOLDER mac) + elseif(UNIX) + set(PLATFORM_FOLDER linux) + endif() + if(WIN32) + set(PLATFORM_FOLDER windows) + endif() + if(NOT PLATFORM_FOLDER) + message(FATAL_ERROR "Unknown os -> don't know how to install headers") + endif() + file(GLOB COMMON_PLATFORM_HEADERS breakpad/src/common/${PLATFORM_FOLDER}/*.h) + install(FILES ${COMMON_PLATFORM_HEADERS} + DESTINATION include/breakpad/common/${PLATFORM_FOLDER}) + install(DIRECTORY breakpad/src/client/${PLATFORM_FOLDER} + DESTINATION include/breakpad/client + FILES_MATCHING PATTERN *.h + ) + install(DIRECTORY breakpad/src/google_breakpad/common + DESTINATION include/breakpad/google_breakpad + FILES_MATCHING PATTERN *.h + ) + """), append=True) + + def build(self): + self._patch_sources() + 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=os.path.join(self.source_folder, "external", "breakpad"), + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "breakpad-client") + self.cpp_info.libs = ["breakpad_client"] + self.cpp_info.includedirs.append(os.path.join("include", "breakpad")) + if is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/sentry-breakpad/all/test_package/CMakeLists.txt b/recipes/sentry-breakpad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c1914e41dc58f --- /dev/null +++ b/recipes/sentry-breakpad/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(BREAKPAD REQUIRED IMPORTED_TARGET breakpad-client) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::BREAKPAD) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sentry-breakpad/all/test_package/conanfile.py b/recipes/sentry-breakpad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ad98cc168c24b --- /dev/null +++ b/recipes/sentry-breakpad/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 +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "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", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + 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/sentry-breakpad/all/test_package/test_package.cpp b/recipes/sentry-breakpad/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ab3c56188d992 --- /dev/null +++ b/recipes/sentry-breakpad/all/test_package/test_package.cpp @@ -0,0 +1,85 @@ +#ifdef _WIN32 +# include "client/windows/handler/exception_handler.h" +#elif defined(__APPLE__) +# include "client/mac/handler/exception_handler.h" +#else +# include "client/linux/handler/exception_handler.h" +#endif + +#include + +namespace { + +#ifdef _WIN32 + +bool filter_callback(void *context, EXCEPTION_POINTERS *exinfo, + MDRawAssertionInfo* assertion) { + // If a FilterCallback returns true, Breakpad will continue processing + return true; +} + +bool callback(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded) { + // succeeded indicates whether a minidump file was successfully written. + return succeeded; +} + +#elif defined(__APPLE__) + +bool callback(void* context, + int exception_type, + int exception_code, + int exception_subcode, + mach_port_t thread_name) { + return true; +} + +#else +bool callback(const google_breakpad::MinidumpDescriptor &descriptor, + void *context, + bool succeeded) { + // if succeeded is true, descriptor.path() contains a path + // to the minidump file. Context is the context passed to + // the exception handler's constructor. + return succeeded; +} +#endif + +} + +int main(int argc, char *argv[]) { + std::cout << "Breakpad test_package\n"; + +#ifdef _WIN32 + google_breakpad::ExceptionHandler eh( + /* dump_path */ L".", + filter_callback, + callback, + /* context */ nullptr, + google_breakpad::ExceptionHandler::HANDLER_ALL + ); +#elif defined(__APPLE__) + google_breakpad::ExceptionHandler eh( + callback, + /* context */ nullptr, + /* install_handler*/ true + ); +#else + google_breakpad::MinidumpDescriptor descriptor("path/to/cache"); + google_breakpad::ExceptionHandler eh( + descriptor, + /* filter */ nullptr, + callback, + /* context */ nullptr, + /* install handler */ true, + /* server FD */ -1 + ); +#endif + + // run your program here + return 0; +} diff --git a/recipes/sentry-breakpad/all/test_v1_package/CMakeLists.txt b/recipes/sentry-breakpad/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sentry-breakpad/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sentry-breakpad/all/test_v1_package/conanfile.py b/recipes/sentry-breakpad/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/sentry-breakpad/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/sentry-breakpad/config.yml b/recipes/sentry-breakpad/config.yml new file mode 100644 index 0000000000000..2e0e20ffce3ff --- /dev/null +++ b/recipes/sentry-breakpad/config.yml @@ -0,0 +1,11 @@ +versions: + "0.6.2": + folder: all + "0.6.1": + folder: all + "0.6.0": + folder: all + "0.5.4": + folder: all + "0.4.18": + folder: all diff --git a/recipes/sentry-crashpad/all/conandata.yml b/recipes/sentry-crashpad/all/conandata.yml new file mode 100644 index 0000000000000..2bf59ee52fc8f --- /dev/null +++ b/recipes/sentry-crashpad/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.6.1": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" + sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" + "0.6.0": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" + sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "0.5.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" + sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" + "0.4.18": + url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" + sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" diff --git a/recipes/sentry-crashpad/all/conanfile.py b/recipes/sentry-crashpad/all/conanfile.py new file mode 100644 index 0000000000000..cd2118a3e0d3c --- /dev/null +++ b/recipes/sentry-crashpad/all/conanfile.py @@ -0,0 +1,223 @@ +from conan import ConanFile +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 get, apply_conandata_patches, copy, export_conandata_patches, rmdir, rm, replace_in_file +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.51.3" + + +class SentryCrashpadConan(ConanFile): + name = "sentry-crashpad" + description = "Crashpad is a crash-reporting system." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/getsentry/sentry-native" + license = "Apache-2.0" + topics = ("crashpad", "error-reporting", "crash-reporting") + + provides = "crashpad", "mini_chromium" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_tls": ["openssl", False], + } + default_options = { + "fPIC": True, + "with_tls": "openssl", + } + + short_paths = True + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "gcc": "6", + "clang": "3.4", + "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 + if self.settings.os not in ("Linux", "Android"): + del self.options.with_tls + + def build_requirements(self): + if self._is_mingw: + self.tool_requires("jwasm/2.13") + + def requirements(self): + self.requires("zlib/1.2.13") + if self.settings.os in ("Linux", "FreeBSD"): + self.requires("libcurl/7.87.0") + if self.options.get_safe("with_tls"): + self.requires("openssl/1.1.1t") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + # Set as required in crashpad CMake file. + # See https://github.com/getsentry/crashpad/blob/71bcaad4cf30294b8de1bfa02064ab629437163b/CMakeLists.txt#L67 + check_min_cppstd(self, 14) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warning("Compiler is unknown. Assuming it supports C++14.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"Build requires support for C++14. Minimum version for {self.settings.compiler} is {minimum_version}") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][str(self.version)]) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CRASHPAD_ENABLE_INSTALL"] = True + tc.variables["CRASHPAD_ENABLE_INSTALL_DEV"] = True + tc.variables["CRASHPAD_ZLIB_SYSTEM"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + openssl_repl = "find_package(OpenSSL REQUIRED)" if self.options.get_safe("with_tls") else "" + if Version(self.version) < "0.6.1": + replace_in_file(self, os.path.join(self.source_folder, "external", "crashpad", "CMakeLists.txt"), + "find_package(OpenSSL)", openssl_repl) + cmake = CMake(self) + cmake.configure(build_script_folder="external/crashpad") + cmake.build() + + def package(self): + copy(self, "LICENSE", src=os.path.join(self.source_folder, "external", "crashpad"), + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure(build_script_folder="external/crashpad") + 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", "crashpad") + + # mini_chromium + self.cpp_info.components["crashpad_mini_chromium"].set_property("cmake_target_name", "crashpad::mini_chromium") + self.cpp_info.components["crashpad_mini_chromium"].includedirs.append(os.path.join("include", "crashpad", "mini_chromium")) + self.cpp_info.components["crashpad_mini_chromium"].libs = ["mini_chromium"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["crashpad_mini_chromium"].system_libs.append("pthread") + elif is_apple_os(self): + self.cpp_info.components["crashpad_mini_chromium"].frameworks = ["CoreFoundation", "Foundation", "Security"] + if self.settings.os == "Macos": + self.cpp_info.components["crashpad_mini_chromium"].frameworks.extend(["ApplicationServices", "IOKit"]) + else: # iOS + self.cpp_info.components["crashpad_mini_chromium"].frameworks.extend(["CoreGraphics", "CoreText"]) + + # compat + self.cpp_info.components["crashpad_compat"].set_property("cmake_target_name", "crashpad::compat") + self.cpp_info.components["crashpad_compat"].includedirs.append(os.path.join("include", "crashpad")) + # On Apple crashpad_compat is an interface library + if not is_apple_os(self): + self.cpp_info.components["crashpad_compat"].libs = ["crashpad_compat"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["crashpad_compat"].system_libs.append("dl") + + # util + self.cpp_info.components["crashpad_util"].set_property("cmake_target_name", "crashpad::util") + self.cpp_info.components["crashpad_util"].libs = ["crashpad_util"] + self.cpp_info.components["crashpad_util"].requires = ["crashpad_compat", "crashpad_mini_chromium", "zlib::zlib"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["crashpad_util"].system_libs.extend(["pthread", "rt"]) + self.cpp_info.components["crashpad_util"].requires.extend(["libcurl::libcurl"]) + elif self.settings.os == "Windows": + self.cpp_info.components["crashpad_util"].system_libs.append("winhttp") + elif self.settings.os == "Macos": + self.cpp_info.components["crashpad_util"].frameworks.extend(["CoreFoundation", "Foundation", "IOKit"]) + self.cpp_info.components["crashpad_util"].system_libs.append("bsm") + if self.options.get_safe("with_tls") == "openssl": + self.cpp_info.components["crashpad_util"].requires.append("openssl::openssl") + + # client + self.cpp_info.components["crashpad_client"].set_property("cmake_target_name", "crashpad::client") + self.cpp_info.components["crashpad_client"].libs = ["crashpad_client"] + self.cpp_info.components["crashpad_client"].requires = ["crashpad_util", "crashpad_mini_chromium"] + + # snapshot + self.cpp_info.components["crashpad_snapshot"].set_property("cmake_target_name", "crashpad::snapshot") + self.cpp_info.components["crashpad_snapshot"].libs = ["crashpad_snapshot"] + self.cpp_info.components["crashpad_snapshot"].requires = [ + "crashpad_client", "crashpad_compat", + "crashpad_util", "crashpad_mini_chromium", + ] + if self.settings.os == "Windows": + self.cpp_info.components["snapshot"].system_libs.append("powrprof") + + # minidump + self.cpp_info.components["crashpad_minidump"].set_property("cmake_target_name", "crashpad::minidump") + self.cpp_info.components["crashpad_minidump"].libs = ["crashpad_minidump"] + self.cpp_info.components["crashpad_minidump"].requires = [ + "crashpad_compat", "crashpad_snapshot", + "crashpad_util", "crashpad_mini_chromium", + ] + + if self.settings.os == "Windows": + # getopt + self.cpp_info.components["crashpad_getopt"].set_property("cmake_target_name", "crashpad::getopt") + self.cpp_info.components["crashpad_getopt"].libs = ["crashpad_getopt"] + + # handler + self.cpp_info.components["crashpad_handler"].set_property("cmake_target_name", "crashpad::handler") + self.cpp_info.components["crashpad_handler"].libs = ["crashpad_handler_lib"] + self.cpp_info.components["crashpad_handler"].requires = [ + "crashpad_compat", "crashpad_minidump", "crashpad_snapshot", + "crashpad_util", "crashpad_mini_chromium", + ] + if self.settings.os == "Windows": + self.cpp_info.components["crashpad_handler"].requires.append("crashpad_getopt") + + # tools + self.cpp_info.components["crashpad_tools"].set_property("cmake_target_name", "crashpad::tools") + self.cpp_info.components["crashpad_tools"].libs = ["crashpad_tools"] + + 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 + self.cpp_info.names["cmake_find_package"] = "crashpad" + self.cpp_info.names["cmake_find_package_multi"] = "crashpad" + self.cpp_info.components["crashpad_mini_chromium"].names["cmake_find_package"] = "mini_chromium" + self.cpp_info.components["crashpad_mini_chromium"].names["cmake_find_package_multi"] = "mini_chromium" + self.cpp_info.components["crashpad_compat"].names["cmake_find_package"] = "compat" + self.cpp_info.components["crashpad_compat"].names["cmake_find_package_multi"] = "compat" + self.cpp_info.components["crashpad_util"].names["cmake_find_package"] = "util" + self.cpp_info.components["crashpad_util"].names["cmake_find_package_multi"] = "util" + self.cpp_info.components["crashpad_client"].names["cmake_find_package"] = "client" + self.cpp_info.components["crashpad_client"].names["cmake_find_package_multi"] = "client" + self.cpp_info.components["crashpad_snapshot"].names["cmake_find_package"] = "snapshot" + self.cpp_info.components["crashpad_snapshot"].names["cmake_find_package_multi"] = "snapshot" + self.cpp_info.components["crashpad_minidump"].names["cmake_find_package"] = "minidump" + self.cpp_info.components["crashpad_minidump"].names["cmake_find_package_multi"] = "minidump" + if self.settings.os == "Windows": + self.cpp_info.components["crashpad_getopt"].names["cmake_find_package"] = "getopt" + self.cpp_info.components["crashpad_getopt"].names["cmake_find_package_multi"] = "getopt" + self.cpp_info.components["crashpad_handler"].names["cmake_find_package"] = "handler" + self.cpp_info.components["crashpad_handler"].names["cmake_find_package_multi"] = "handler" + self.cpp_info.components["crashpad_tools"].names["cmake_find_package"] = "tools" + self.cpp_info.components["crashpad_tools"].names["cmake_find_package_multi"] = "tools" diff --git a/recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch b/recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch new file mode 100644 index 0000000000000..4f57a94cccd7d --- /dev/null +++ b/recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch @@ -0,0 +1,66 @@ +--- external/crashpad/compat/CMakeLists.txt ++++ external/crashpad/compat/CMakeLists.txt +@@ -108,12 +108,13 @@ + endif() + + if(LINUX OR ANDROID) +- target_include_directories(crashpad_compat ${TI_YPE} "$") ++ target_include_directories(crashpad_compat ${TI_TYPE} "$") ++ target_link_libraries(crashpad_compat ${TI_TYPE} ${CMAKE_DL_LIBS}) + endif() + + if(ANDROID) +- target_include_directories(crashpad_compat ${TI_YPE} "$") ++ target_include_directories(crashpad_compat ${TI_TYPE} "$") + endif() + + set_property(TARGET crashpad_compat PROPERTY EXPORT_NAME compat) + add_library(crashpad::compat ALIAS crashpad_compat) +--- external/crashpad/third_party/mini_chromium/CMakeLists.txt ++++ external/crashpad/third_party/mini_chromium/CMakeLists.txt +@@ -172,3 +172,7 @@ + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad" + FILES_MATCHING PATTERN "*.h" + ) ++crashpad_install_dev(DIRECTORY build ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad/mini_chromium" ++ FILES_MATCHING PATTERN "*.h" ++) +--- external/crashpad/util/CMakeLists.txt ++++ external/crashpad/util/CMakeLists.txt +@@ -237,7 +237,7 @@ + linux/thread_info.cc + linux/thread_info.h + linux/traits.h +- misc/capture_context_linux.S ++ misc/capture_context_linux.S misc/time_linux.cc + misc/paths_linux.cc + posix/process_info_linux.cc + process/process_memory_linux.cc +@@ -353,7 +353,7 @@ + target_include_directories(crashpad_util PRIVATE + $ + ) + target_link_libraries(crashpad_util + PRIVATE + $ + PUBLIC +@@ -371,6 +371,10 @@ + ) + endif() + ++if(LINUX) ++ target_link_libraries(crashpad_util PRIVATE rt pthread) ++endif() ++ + if(WIN32) + target_link_libraries(crashpad_util PRIVATE user32 version winhttp) + if(MSVC) +@@ -395,3 +399,7 @@ + add_library(crashpad::util ALIAS crashpad_util) + + crashpad_install_target(crashpad_util) ++crashpad_install_dev(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad/util" ++ FILES_MATCHING PATTERN "*.h" ++) diff --git a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a9feb3cd284f7 --- /dev/null +++ b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package CXX) + +find_package(crashpad REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE crashpad::client) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/sentry-crashpad/all/test_package/conanfile.py b/recipes/sentry-crashpad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a9d92c6be51d --- /dev/null +++ b/recipes/sentry-crashpad/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.files import mkdir +from conan.tools.cmake import cmake_layout, CMake +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): + test_env_dir = "test_env" + mkdir(self, test_env_dir) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" + handler_bin_path = os.path.join(self.deps_cpp_info["sentry-crashpad"].bin_paths[0], handler_exe) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", run_environment=True) diff --git a/recipes/sentry-crashpad/all/test_package/test_package.cpp b/recipes/sentry-crashpad/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8f5ca824f1a03 --- /dev/null +++ b/recipes/sentry-crashpad/all/test_package/test_package.cpp @@ -0,0 +1,48 @@ +#include +#include +#include + +#ifdef _WIN32 +#include +#endif + +#include "client/crashpad_client.h" +#include "client/settings.h" + +bool startCrashpad(const base::FilePath &db, + const base::FilePath &handler) { + std::string url("http://localhost"); + std::map annotations; + std::vector arguments; + + crashpad::CrashpadClient client; + return client.StartHandler( + handler, + db, + db, + url, + annotations, + arguments, + true, + false + ); +} + +int main(int argc, char* argv[]) { + if (argc != 3) { + return 2; + } + +#ifdef _WIN32 + wchar_t ws[1024]; + swprintf(ws, 1024, L"%hs", argv[1]); + base::FilePath db(ws); + swprintf(ws, 1024, L"%hs", argv[2]); + base::FilePath handler(ws); +#else + base::FilePath db(argv[1]); + base::FilePath handler(argv[2]); +#endif + + return startCrashpad(db, handler) ? 0 : 1; +} diff --git a/recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sentry-crashpad/all/test_v1_package/conanfile.py b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..07143b37b946f --- /dev/null +++ b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +from conan.tools.files import mkdir +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): + test_env_dir = "test_env" + mkdir(self, 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["sentry-crashpad"].rootpath, "bin", handler_exe) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", run_environment=True) diff --git a/recipes/sentry-crashpad/config.yml b/recipes/sentry-crashpad/config.yml new file mode 100644 index 0000000000000..ea4872076354c --- /dev/null +++ b/recipes/sentry-crashpad/config.yml @@ -0,0 +1,9 @@ +versions: + "0.6.1": + folder: all + "0.6.0": + folder: all + "0.5.4": + folder: all + "0.4.18": + folder: all diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml new file mode 100644 index 0000000000000..29cda14cad1e6 --- /dev/null +++ b/recipes/sentry-native/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.6.1": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" + sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" + "0.6.0": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" + sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "0.5.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" + sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" + "0.4.18": + url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" + sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" +patches: + "0.6.0": + - patch_file: "patches/sentry-native-903c17a.patch" + patch_description: "Make it possible to build with support for the crashpad WER module while using the sentry-crashpad package" + patch_type: "official" + patch_source: "https://github.com/getsentry/sentry-native/pull/816" diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py new file mode 100644 index 0000000000000..888d98c0fe1ef --- /dev/null +++ b/recipes/sentry-native/all/conanfile.py @@ -0,0 +1,209 @@ +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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class SentryNativeConan(ConanFile): + name = "sentry-native" + description = ( + "The Sentry Native SDK is an error and crash reporting client for native " + "applications, optimized for C and C++. Sentry allows to add tags, " + "breadcrumbs and arbitrary custom context to enrich error reports." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/getsentry/sentry-native" + license = "MIT" + topics = ("breakpad", "crashpad", "error-reporting", "crash-reporting") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "backend": ["none", "inproc", "crashpad", "breakpad"], + "transport": ["none", "curl", "winhttp"], + "qt": [True, False], + "with_crashpad": ["google", "sentry"], + "with_breakpad": ["google", "sentry"], + "wer" : [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "backend": "inproc", # overwritten in config_options + "transport": "curl", # overwritten in config_options + "qt": False, + "with_crashpad": "sentry", + "with_breakpad": "sentry", + "wer": False + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "3.4", + "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 + + if self.settings.os != "Windows" or Version(self.version) < "0.6.0": + del self.options.wer + + # Configure default transport + if self.settings.os == "Windows": + self.options.transport = "winhttp" + elif self.settings.os in ("FreeBSD", "Linux") or self.settings.os == "Macos": # Don't use tools.is_apple_os(os) here + self.options.transport = "curl" + else: + self.options.transport = "none" + + # Configure default backend + if self.settings.os == "Windows" or self.settings.os == "Macos": # Don't use tools.is_apple_os(os) here + # FIXME: for self.version < 0.4: default backend is "breakpad" when building with MSVC for Windows xp; else: backend=none + self.options.backend = "crashpad" + elif self.settings.os in ("FreeBSD", "Linux"): + self.options.backend = "breakpad" + elif self.settings.os == "Android": + self.options.backend = "inproc" + else: + self.options.backend = "inproc" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.backend != "crashpad": + self.options.rm_safe("with_crashpad") + if self.options.backend != "breakpad": + self.options.rm_safe("with_breakpad") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.transport == "curl": + self.requires("libcurl/7.87.0") + if self.options.backend == "crashpad": + if self.options.with_crashpad == "sentry": + self.requires(f"sentry-crashpad/{self.version}") + if self.options.with_crashpad == "google": + self.requires("crashpad/cci.20220219") + elif self.options.backend == "breakpad": + if self.options.with_breakpad == "sentry": + self.requires(f"sentry-breakpad/{self.version}") + if self.options.with_breakpad == "google": + self.requires("breakpad/cci.20210521") + if self.options.get_safe("qt"): + self.requires("qt/5.15.8") + self.requires("openssl/1.1.1t") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support." + ) + if self.options.transport == "winhttp" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("The winhttp transport is only supported on Windows") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration("apple-clang < 10.0 not supported") + + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output) + m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if self.settings.os == "Windows" and not self._cmake_new_enough("3.16.4"): + self.tool_requires("cmake/3.25.2") + if self.options.backend == "breakpad": + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + VirtualBuildEnv(self).generate() + tc = CMakeToolchain(self) + tc.variables["SENTRY_BACKEND"] = self.options.backend + tc.variables["SENTRY_CRASHPAD_SYSTEM"] = True + tc.variables["SENTRY_BREAKPAD_SYSTEM"] = True + tc.variables["SENTRY_ENABLE_INSTALL"] = True + tc.variables["SENTRY_TRANSPORT"] = self.options.transport + tc.variables["SENTRY_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["SENTRY_INTEGRATION_QT"] = self.options.qt + if self.options.get_safe("wer", False): + tc.variables["CRASHPAD_WER_ENABLED"] = True + tc.generate() + CMakeDeps(self).generate() + if self.options.backend == "breakpad": + PkgConfigDeps(self).generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sentry") + self.cpp_info.set_property("cmake_target_name", "sentry::sentry") + self.cpp_info.libs = ["sentry"] + if self.settings.os in ("Android", "FreeBSD", "Linux"): + self.cpp_info.exelinkflags = ["-Wl,-E,--build-id=sha1"] + self.cpp_info.sharedlinkflags = ["-Wl,-E,--build-id=sha1"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "dl"] + elif is_apple_os(self): + self.cpp_info.frameworks = ["CoreGraphics", "CoreText"] + elif self.settings.os == "Android": + self.cpp_info.system_libs = ["dl", "log"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["shlwapi", "dbghelp", "version"] + if self.options.transport == "winhttp": + self.cpp_info.system_libs.append("winhttp") + + if not self.options.shared: + self.cpp_info.defines = ["SENTRY_BUILD_STATIC"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "sentry" + self.cpp_info.names["cmake_find_package_multi"] = "sentry" diff --git a/recipes/sentry-native/all/patches/sentry-native-903c17a.patch b/recipes/sentry-native/all/patches/sentry-native-903c17a.patch new file mode 100644 index 0000000000000..ea2ffd463a7ad --- /dev/null +++ b/recipes/sentry-native/all/patches/sentry-native-903c17a.patch @@ -0,0 +1,34 @@ +From 903c17ae20888679caab1871cc74de577509452e Mon Sep 17 00:00:00 2001 +From: Cyriuz +Date: Mon, 13 Mar 2023 14:55:26 +0100 +Subject: [PATCH] Allow setting CRASHPAD_WER_ENABLED when using system crashpad + (#816) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 831e8e1..aeea09f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -426,8 +426,9 @@ if(SENTRY_BACKEND_CRASHPAD) + set(CRASHPAD_ENABLE_INSTALL ON CACHE BOOL "Enable crashpad installation" FORCE) + endif() + add_subdirectory(external/crashpad crashpad_build) ++ + if(CRASHPAD_WER_ENABLED) +- add_compile_definitions(CRASHPAD_WER_ENABLED) ++ add_dependencies(sentry crashpad::wer) + endif() + + # set static runtime if enabled +@@ -482,8 +483,9 @@ if(SENTRY_BACKEND_CRASHPAD) + endif() + endif() + add_dependencies(sentry crashpad::handler) ++ + if(CRASHPAD_WER_ENABLED) +- add_dependencies(sentry crashpad::wer) ++ add_compile_definitions(CRASHPAD_WER_ENABLED) + endif() + elseif(SENTRY_BACKEND_BREAKPAD) + option(SENTRY_BREAKPAD_SYSTEM "Use system breakpad" OFF) +-- +2.39.1.windows.1 diff --git a/recipes/sentry-native/all/test_package/CMakeLists.txt b/recipes/sentry-native/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8b84ac464d998 --- /dev/null +++ b/recipes/sentry-native/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sentry REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sentry-native/all/test_package/conanfile.py b/recipes/sentry-native/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sentry-native/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/sentry-native/all/test_package/test_package.cpp b/recipes/sentry-native/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8bbab399c4344 --- /dev/null +++ b/recipes/sentry-native/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include "sentry.h" + +int main(int argc, char **argv) +{ + sentry_options_t *options = sentry_options_new(); + + sentry_options_set_environment(options, "Production"); + sentry_options_set_release(options, "test-example-release"); + + sentry_init(options); + + sentry_shutdown(); +} diff --git a/recipes/sentry-native/all/test_v1_package/CMakeLists.txt b/recipes/sentry-native/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sentry-native/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sentry-native/all/test_v1_package/conanfile.py b/recipes/sentry-native/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sentry-native/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/sentry-native/config.yml b/recipes/sentry-native/config.yml new file mode 100644 index 0000000000000..ea4872076354c --- /dev/null +++ b/recipes/sentry-native/config.yml @@ -0,0 +1,9 @@ +versions: + "0.6.1": + folder: all + "0.6.0": + folder: all + "0.5.4": + folder: all + "0.4.18": + folder: all diff --git a/recipes/seqan/2.x.x/conandata.yml b/recipes/seqan/2.x.x/conandata.yml new file mode 100644 index 0000000000000..f6fe28ee2eead --- /dev/null +++ b/recipes/seqan/2.x.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.4.0": + url: https://github.com/seqan/seqan/archive/seqan-v2.4.0.tar.gz + sha256: d7084d17729214003e84818e0280a16f223c8f1c6a30eeef040c27e0c0047bd7 diff --git a/recipes/seqan/2.x.x/conanfile.py b/recipes/seqan/2.x.x/conanfile.py new file mode 100644 index 0000000000000..5f567373a4d1a --- /dev/null +++ b/recipes/seqan/2.x.x/conanfile.py @@ -0,0 +1,56 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +class SeqanConan(ConanFile): + name = "seqan" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seqan/seqan" + description = """ +SeqAn is an open source C++ library of efficient algorithms and data structures for the analysis of sequences +with the focus on biological data. Our library applies a unique generic design that guarantees high performance, +generality, extensibility, and integration with other libraries. +SeqAn is easy to use and simplifies the development of new software tools with a minimal loss of performance. +""" + topics = ("conan", "cpp98", "cpp11", "cpp14", "cpp17", + "algorithms", "data structures", "biological sequences") + license = "BSD-3-Clause" + settings = "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "14", + "clang": "3.4", + "apple-clang": "3.4" + } + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 14) + 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("seqan requires C++14, which your compiler does not fully support.") + else: + self.output.warn("seqan requires C++14. Your compiler is unknown. Assuming it supports C++14.") + + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "seqan-seqan-v" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy("*", dst="include", + src=os.path.join(self._source_subfolder, "include"), keep_path=True) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/seqan/2.x.x/test_package/CMakeLists.txt b/recipes/seqan/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..64fd988616e27 --- /dev/null +++ b/recipes/seqan/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CONAN_PKG::seqan) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/seqan/2.x.x/test_package/conanfile.py b/recipes/seqan/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..a59a26a52c8dc --- /dev/null +++ b/recipes/seqan/2.x.x/test_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" + + 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/seqan/2.x.x/test_package/test_package.cpp b/recipes/seqan/2.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..dd08405d3402d --- /dev/null +++ b/recipes/seqan/2.x.x/test_package/test_package.cpp @@ -0,0 +1,25 @@ +// Demo program for clipping with Gaps objects. + +#include +#include +#include + +using namespace seqan; + +int main() +{ + // Create sequence variable and gaps basd on sequence. + CharString seq("ABCDEFGHIJ"); + Gaps gaps(seq); + + // Insert gaps, the positions are in (clipped) view space. + insertGaps(gaps, 2, 2); + insertGap(gaps, 6); + insertGap(gaps, 10); + + // Print to stdout. + std::cout << "gaps\t" << gaps << "\n" + << "seq \t" << seq << "\n\n"; + + return 0; +} diff --git a/recipes/seqan/config.yml b/recipes/seqan/config.yml new file mode 100644 index 0000000000000..3c7e0045c69ba --- /dev/null +++ b/recipes/seqan/config.yml @@ -0,0 +1,3 @@ +versions: + "2.4.0": + folder: "2.x.x" diff --git a/recipes/seqan3/all/conandata.yml b/recipes/seqan3/all/conandata.yml new file mode 100644 index 0000000000000..7b4ddfdc76fc6 --- /dev/null +++ b/recipes/seqan3/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.1.0": + url: https://github.com/seqan/seqan3/releases/download/3.1.0/seqan3-3.1.0-Source.tar.xz + sha256: 0b37b1c3450e19c0ebe42c052c3f87babb8074bd772f10a553949c312c285726 diff --git a/recipes/seqan3/all/conanfile.py b/recipes/seqan3/all/conanfile.py new file mode 100644 index 0000000000000..ef55f38b024ff --- /dev/null +++ b/recipes/seqan3/all/conanfile.py @@ -0,0 +1,65 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class Seqan3Conan(ConanFile): + name = "seqan3" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seqan/seqan3" + description = "SeqAn3 is the new version of the popular SeqAn template library for the analysis of biological sequences." + topics = ("cpp20", "algorithms", "data structures", "biological sequences") + license = "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + } + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration("SeqAn3 only supports GCC.") + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 20) + 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("SeqAn3 requires C++20, which your compiler does not fully support.") + else: + self.output.warn("SeqAn3 requires C++20. Your compiler is unknown. Assuming it supports C++20.") + + if self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": + self.output.warn("SeqAn3 does not actively support libstdc++, consider using libstdc++11 instead.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*", dst="include", + src=os.path.join(self._source_subfolder, "include"), keep_path=True) + for submodule in ["range-v3", "cereal", "sdsl-lite"]: + self.copy("*.hpp", dst="include", + src=os.path.join(self._source_subfolder, "submodules", submodule, "include"), keep_path=True) + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "seqan3") + self.cpp_info.set_property("cmake_target_name", "seqan3::seqan3") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/seqan3/all/test_package/CMakeLists.txt b/recipes/seqan3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8c21ec19c6384 --- /dev/null +++ b/recipes/seqan3/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(seqan3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} seqan3::seqan3) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/seqan3/all/test_package/conanfile.py b/recipes/seqan3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/seqan3/all/test_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/seqan3/all/test_package/test_package.cpp b/recipes/seqan3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ba76b6dd5a6b0 --- /dev/null +++ b/recipes/seqan3/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +int main() +{ + using namespace seqan3::literals; + + std::vector seq = "AGTGTACGTAC"_dna4; + + seqan3::debug_stream << "Sequence: " << seq << '\n'; + seqan3::debug_stream << "Reverse complement: " << (seq | std::views::reverse | seqan3::views::complement) << '\n'; + + return 0; +} diff --git a/recipes/seqan3/config.yml b/recipes/seqan3/config.yml new file mode 100644 index 0000000000000..9370babb6565a --- /dev/null +++ b/recipes/seqan3/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.0": + folder: "all" diff --git a/recipes/serd/all/conandata.yml b/recipes/serd/all/conandata.yml new file mode 100644 index 0000000000000..b401b2ad15e33 --- /dev/null +++ b/recipes/serd/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.30.16": + url: "https://gitlab.com/drobilla/serd/-/archive/v0.30.16/serd-v0.30.16.tar.gz" + sha256: "c139e02af039e277fb1b7deb2a687477bf6ec46cd6348bbb1232c2727a1dd744" + "0.30.14": + url: "https://gitlab.com/drobilla/serd/-/archive/v0.30.14/serd-v0.30.14.tar.gz" + sha256: "5b8d620afda474861f159b18af5e49d0ea1a9d48ff7879b23b92a058ce7aad68" diff --git a/recipes/serd/all/conanfile.py b/recipes/serd/all/conanfile.py new file mode 100644 index 0000000000000..038ad977840b2 --- /dev/null +++ b/recipes/serd/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class SerdConan(ConanFile): + name = "serd" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://drobilla.net/software/serd.html" + description = "A lightweight C library for RDF syntax" + topics = "linked-data", "semantic-web", "rdf", "turtle", "trig", "ntriples", "nquads" + license = "ISC" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["docs"] = "disabled" + tc.project_options["tests"] = "disabled" + tc.project_options["tools"] = "disabled" + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + 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) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "serd-0") + libname = "serd" + if not (is_msvc(self) and self.options.shared): + libname += "-0" + self.cpp_info.libs = [libname] + self.cpp_info.includedirs = [os.path.join("include", "serd-0")] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("SERD_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/serd/all/test_package/CMakeLists.txt b/recipes/serd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..37cde52c36d91 --- /dev/null +++ b/recipes/serd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(serd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE serd::serd) diff --git a/recipes/serd/all/test_package/conanfile.py b/recipes/serd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/serd/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/serd/all/test_package/test_package.c b/recipes/serd/all/test_package/test_package.c new file mode 100644 index 0000000000000..1aaf24456a072 --- /dev/null +++ b/recipes/serd/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + serd_reader_free(NULL); + return 0; +} diff --git a/recipes/serd/all/test_v1_package/CMakeLists.txt b/recipes/serd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/serd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/serd/all/test_v1_package/conanfile.py b/recipes/serd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/serd/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/serd/config.yml b/recipes/serd/config.yml new file mode 100644 index 0000000000000..9877695aeb2f5 --- /dev/null +++ b/recipes/serd/config.yml @@ -0,0 +1,5 @@ +versions: + "0.30.16": + folder: all + "0.30.14": + folder: all diff --git a/recipes/serdepp/all/conandata.yml b/recipes/serdepp/all/conandata.yml new file mode 100644 index 0000000000000..a5bc02fad6305 --- /dev/null +++ b/recipes/serdepp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.4.1": + url: "https://github.com/injae/serdepp/archive/refs/tags/v0.1.4.1.tar.gz" + sha256: "0a1112e5fb929e22eba14c8699cfcd4b58cfcbb70068149a6a7ed2a532800972" diff --git a/recipes/serdepp/all/conanfile.py b/recipes/serdepp/all/conanfile.py new file mode 100644 index 0000000000000..539c3a27d063b --- /dev/null +++ b/recipes/serdepp/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +from conans.errors import ConanInvalidConfiguration +from conans import ConanFile, tools + +required_conan_version = ">=1.43.0" + + +class SerdeppConan(ConanFile): + name = "serdepp" + description = "c++ serialize and deserialize adaptor library like rust serde.rs" + license = "MIT" + topics = ("yaml", "toml", "serialization", "json", "reflection") + homepage = "https://github.com/injae/serdepp" + url = "https://github.com/conan-io/conan-center-index" + settings = "arch", "build_type", "compiler", "os" + options = { + # keeping the option in case upstream support dynamic linking + "with_nlohmann_json": [True, False], + "with_rapidjson": [True, False], + "with_fmt": [True, False], + "with_toml11": [True, False], + "with_yamlcpp": [True, False], + } + default_options = { + "with_nlohmann_json": True, + "with_rapidjson": True, + "with_fmt": True, + "with_toml11": True, + "with_yamlcpp": True, + } + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, + strip_root=True) + + def package_id(self): + self.info.header_only() + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "17", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + compiler = self.settings.compiler + if compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + + if not minimum_version: + self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++17") + + def package(self): + s = lambda x: os.path.join(self._source_subfolder, x) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + include = os.path.join('include', 'serdepp') + self.copy('*.hpp', dst=include, src=s(include)) + attribute = os.path.join(include, 'attribute') + self.copy('*.hpp', dst=attribute, src=s(attribute)) + adaptor = os.path.join(include, 'adaptor') + self.copy('reflection.hpp', dst=adaptor, src=s(adaptor)) + self.copy('sstream.hpp', dst=adaptor, src=s(adaptor)) + if self.options.with_toml11: + self.copy('toml11.hpp', dst=adaptor, src=s(adaptor)) + if self.options.with_yamlcpp: + self.copy('yaml-cpp.hpp', dst=adaptor, src=s(adaptor)) + if self.options.with_rapidjson: + self.copy('rapidjson.hpp', dst=adaptor, src=s(adaptor)) + if self.options.with_fmt: + self.copy('fmt.hpp', dst=adaptor, src=s(adaptor)) + if self.options.with_nlohmann_json: + self.copy('nlohmann_json.hpp', dst=adaptor, src=s(adaptor)) + + def requirements(self): + self.requires("nameof/0.10.1") + self.requires("magic_enum/0.7.3") + if self.options.with_toml11: + self.requires("toml11/3.7.0") + if self.options.with_yamlcpp: + self.requires("yaml-cpp/0.7.0") + if self.options.with_rapidjson: + self.requires("rapidjson/1.1.0") + if self.options.with_fmt: + self.requires("fmt/8.1.1") + if self.options.with_nlohmann_json: + self.requires("nlohmann_json/3.10.5") diff --git a/recipes/serdepp/all/test_package/CMakeLists.txt b/recipes/serdepp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4620c9ed66c9 --- /dev/null +++ b/recipes/serdepp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(serdepp REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} serdepp::serdepp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/serdepp/all/test_package/conanfile.py b/recipes/serdepp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e788460ad0765 --- /dev/null +++ b/recipes/serdepp/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/serdepp/all/test_package/test_package.cpp b/recipes/serdepp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..427fde86f750f --- /dev/null +++ b/recipes/serdepp/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include +class test { +public: + template + constexpr static void serde(Context& context, test& value) { + using Self = test; + serde::serde_struct(context, value) + (&Self::str, "str") // or .field(&Self::str, "str") + (&Self::i, "i") // or .field(&Self::i , "i") + (&Self::vec, "vec"); // or .field(&Self::vec, "vec") + } +private: + std::string str; + int i; + std::vector vec; +}; + +int main() +{ + test t; +} diff --git a/recipes/serdepp/config.yml b/recipes/serdepp/config.yml new file mode 100644 index 0000000000000..b12aabd870fe0 --- /dev/null +++ b/recipes/serdepp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.4.1": + folder: all diff --git a/recipes/serf/all/CMakeLists.txt b/recipes/serf/all/CMakeLists.txt new file mode 100644 index 0000000000000..a69305eb3971f --- /dev/null +++ b/recipes/serf/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/serf/all/conandata.yml b/recipes/serf/all/conandata.yml new file mode 100644 index 0000000000000..10d6d086a2a84 --- /dev/null +++ b/recipes/serf/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.3.9": + url: [ + "https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2", + "https://github.com/apache/serf/archive/1.3.9.tar.gz", + ] + sha256: "549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc" +patches: + "1.3.9": + - patch_file: "patches/0001-1.3.9-scons-python3.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-1.3.9-scons-respect-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-1.3.9-scons-msvc.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-1.3.9-scons-python-spaces.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-1.3.9-serf-openssl-3.x.patch" + base_path: "source_subfolder" diff --git a/recipes/serf/all/conanfile.py b/recipes/serf/all/conanfile.py new file mode 100644 index 0000000000000..389e7ad59c4e3 --- /dev/null +++ b/recipes/serf/all/conanfile.py @@ -0,0 +1,165 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanException +from contextlib import contextmanager +import glob +import os +import re + + +class SerfConan(ConanFile): + name = "serf" + description = "The serf library is a high performance C-based HTTP client library built upon the Apache Portable Runtime (APR) library." + license = "Apache-2.0" + topics = ("conan", "serf", "apache", "http", "library") + homepage = "https://serf.apache.org/" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = "patches/**" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("apr-util/1.6.1") + self.requires("zlib/1.2.12") + self.requires("openssl/3.0.3") + + def build_requirements(self): + self.build_requires("scons/4.3.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(glob.glob("serf-*")[0], self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + pc_in = os.path.join(self._source_subfolder, "build", "serf.pc.in") + tools.save(pc_in, tools.load(pc_in)) + + @property + def _cc(self): + if tools.get_env("CC"): + return tools.get_env("CC") + if tools.is_apple_os(self.settings.os): + return "clang" + return { + "Visual Studio": "cl", + }.get(str(self.settings.compiler), str(self.settings.compiler)) + + def _lib_path_arg(self, path): + argname = "LIBPATH:" if self.settings.compiler == "Visual Studio" else "L" + return "-{}'{}'".format(argname, path.replace("\\", "/")) + + @contextmanager + def _build_context(self): + extra_env = {} + if self.settings.compiler == "Visual Studio": + extra_env["OPENSSL_LIBS"] = ";".join("{}.lib".format(lib) for lib in self.deps_cpp_info["openssl"].libs) + with tools.environment_append(extra_env): + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + yield + + def build(self): + self._patch_sources() + autotools = AutoToolsBuildEnvironment(self) + args = ["-Y", os.path.join(self.source_folder, self._source_subfolder)] + kwargs = { + "APR": self.deps_cpp_info["apr"].rootpath.replace("\\", "/"), + "APU": self.deps_cpp_info["apr-util"].rootpath.replace("\\", "/"), + "OPENSSL": self.deps_cpp_info["openssl"].rootpath.replace("\\", "/"), + "PREFIX": self.package_folder.replace("\\", "/"), + "LIBDIR": os.path.join(self.package_folder, "lib").replace("\\", "/"), + "ZLIB": self.deps_cpp_info["zlib"].rootpath.replace("\\", "/"), + "DEBUG": self.settings.build_type == "Debug", + "APR_STATIC": not self.options["apr"].shared, + "CFLAGS": " ".join(self.deps_cpp_info.cflags + (["-fPIC"] if self.options.get_safe("fPIC") else []) + autotools.flags), + "LINKFLAGS": " ".join(self.deps_cpp_info.sharedlinkflags) + " " + " ".join(self._lib_path_arg(l) for l in self.deps_cpp_info.lib_paths), + "CPPFLAGS": " ".join("-D{}".format(d) for d in autotools.defines) + " " + " ".join("-I'{}'".format(inc.replace("\\", "/")) for inc in self.deps_cpp_info.include_paths), + "CC": self._cc, + "SOURCE_LAYOUT": "False", + } + + if self.settings.compiler == "Visual Studio": + kwargs.update({ + "TARGET_ARCH": str(self.settings.arch), + "MSVC_VERSION": "{:.1f}".format(float(tools.msvs_toolset(self.settings).lstrip("v")) / 10), + }) + + escape_str = lambda x : "\"{}\"".format(x) + with tools.chdir(self._source_subfolder): + with self._build_context(): + self.run("scons {} {}".format(" ".join(escape_str(s) for s in args), " ".join("{}={}".format(k, escape_str(v)) for k, v in kwargs.items())), run_environment=True) + + @property + def _static_ext(self): + return "a" + + @property + def _shared_ext(self): + if tools.is_apple_os(self.settings.os): + return "dylib" + return { + "Windows": "dll", + }.get(str(self.settings.os), "so") + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + with tools.chdir(self._source_subfolder): + with self._build_context(): + self.run("scons install -Y \"{}\"".format(os.path.join(self.source_folder, self._source_subfolder)), run_environment=True) + + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.settings.os == "Windows": + for file in glob.glob(os.path.join(self.package_folder, "lib", "*.exp")): + os.unlink(file) + for file in glob.glob(os.path.join(self.package_folder, "lib", "*.pdb")): + os.unlink(file) + if self.options.shared: + for file in glob.glob(os.path.join(self.package_folder, "lib", "serf-{}.*".format(self._version_major))): + os.unlink(file) + tools.mkdir(os.path.join(self.package_folder, "bin")) + os.rename(os.path.join(self.package_folder, "lib", "libserf-{}.dll".format(self._version_major)), + os.path.join(self.package_folder, "bin", "libserf-{}.dll".format(self._version_major))) + else: + for file in glob.glob(os.path.join(self.package_folder, "lib", "libserf-{}.*".format(self._version_major))): + os.unlink(file) + else: + ext_to_remove = self._static_ext if self.options.shared else self._shared_ext + for fn in os.listdir(os.path.join(self.package_folder, "lib")): + if any(re.finditer("\\.{}(\.?|$)".format(ext_to_remove), fn)): + os.unlink(os.path.join(self.package_folder, "lib", fn)) + + @property + def _version_major(self): + return self.version.split(".", 1)[0] + + def package_info(self): + libprefix = "" + if self.settings.os == "Windows" and self.options.shared: + libprefix = "lib" + libname = "{}serf-{}".format(libprefix, self._version_major) + self.cpp_info.libs = [libname] + self.cpp_info.includedirs.append(os.path.join("include", "serf-{}".format(self._version_major))) + self.cpp_info.names["pkg_config"] = libname + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["user32", "advapi32", "gdi32", "ws2_32", "crypt32", "mswsock", "rpcrt4", "secur32"] diff --git a/recipes/serf/all/patches/0001-1.3.9-scons-python3.patch b/recipes/serf/all/patches/0001-1.3.9-scons-python3.patch new file mode 100644 index 0000000000000..44386a280e201 --- /dev/null +++ b/recipes/serf/all/patches/0001-1.3.9-scons-python3.patch @@ -0,0 +1,22 @@ +--- SConstruct ++++ SConstruct +@@ -166,8 +166,8 @@ + match = re.search('SERF_MAJOR_VERSION ([0-9]+).*' + 'SERF_MINOR_VERSION ([0-9]+).*' + 'SERF_PATCH_VERSION ([0-9]+)', +- env.File('serf.h').get_contents(), +- re.DOTALL) ++ env.File('serf.h').get_contents().decode(), ++ flags=re.DOTALL) + MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] + env.Append(MAJOR=str(MAJOR)) + env.Append(MINOR=str(MINOR)) +@@ -183,7 +183,7 @@ + + unknown = opts.UnknownVariables() + if unknown: +- print 'Warning: Used unknown variables:', ', '.join(unknown.keys()) ++ print('Warning: Used unknown variables:', ', '.join(unknown.keys())) + + apr = str(env['APR']) + apu = str(env['APU']) diff --git a/recipes/serf/all/patches/0002-1.3.9-scons-respect-flags.patch b/recipes/serf/all/patches/0002-1.3.9-scons-respect-flags.patch new file mode 100644 index 0000000000000..857080cae463b --- /dev/null +++ b/recipes/serf/all/patches/0002-1.3.9-scons-respect-flags.patch @@ -0,0 +1,18 @@ +--- SConstruct ++++ SConstruct +@@ -151,10 +151,10 @@ + "Assume a source layout instead of install layout", + True), + ) +- +-env = Environment(variables=opts, +- tools=('default', 'textfile',), +- CPPPATH=['.', ], +- ) ++extra_environment = { 'ENV': {'PATH': os.environ['PATH'], },} ++if os.environ.get('LD'): extra_environment['LINK'] = os.environ['LD'] ++if os.environ.get('LDFLAGS'): extra_environment['LINKFLAGS'] = os.environ['LDFLAGS'] ++if os.environ.get('CFLAGS'): extra_environment['CFLAGS'] = os.environ['CFLAGS'] ++env = Environment(variables=opts, tools=('default', 'textfile',), CPPPATH=['.', ], **extra_environment) + + env.Append(BUILDERS = { diff --git a/recipes/serf/all/patches/0003-1.3.9-scons-msvc.patch b/recipes/serf/all/patches/0003-1.3.9-scons-msvc.patch new file mode 100644 index 0000000000000..30fc0c95af186 --- /dev/null +++ b/recipes/serf/all/patches/0003-1.3.9-scons-msvc.patch @@ -0,0 +1,67 @@ +--- SConstruct ++++ SConstruct +@@ -140,8 +140,8 @@ + EnumVariable('MSVC_VERSION', + "Visual C++ to use for building (E.g. 11.0, 9.0)", + None, +- allowed_values=('14.0', '12.0', ++ allowed_values=('14.3', '14.2', '14.1', '14.0', '12.0', + '11.0', '10.0', '9.0', '8.0', '6.0') + ), + + # We always documented that we handle an install layout, but in fact we +@@ -208,7 +208,7 @@ + thisdir = os.getcwd() + libdir = '$LIBDIR' + incdir = '$PREFIX/include/serf-$MAJOR' +- ++if os.environ.get("TMP"): env["ENV"]["TMP"] = os.environ["TMP"] + # This version string is used in the dynamic library name, and for Mac OS X also + # for the current_version and compatibility_version options in the .dylib + # +@@ -273,11 +273,11 @@ + # Choose runtime and optimization + if debug: + # Disable optimizations for debugging, use debug DLL runtime +- env.Append(CCFLAGS=['/Od', '/MDd']) ++ env.Append(CCFLAGS=['/Od']) + env.Append(CPPDEFINES=['DEBUG', '_DEBUG']) + else: + # Optimize for speed, use DLL runtime +- env.Append(CCFLAGS=['/O2', '/MD']) ++ env.Append(CCFLAGS=['/O2']) + env.Append(CPPDEFINES=['NDEBUG']) + env.Append(LINKFLAGS=['/RELEASE']) + +@@ -309,7 +309,7 @@ + if aprstatic: + apr_libs='apr-1.lib' + apu_libs='aprutil-1.lib' +- env.Append(LIBS=['shell32.lib', 'xml.lib']) ++ env.Append(LIBS=['shell32.lib']) + else: + apr_libs='libapr-1.lib' + apu_libs='libaprutil-1.lib' +@@ -316,8 +316,8 @@ + + env.Append(LIBS=[apr_libs, apu_libs]) + if not env.get('SOURCE_LAYOUT', None): +- env.Append(LIBPATH=['$APR/lib', '$APU/lib'], +- CPPPATH=['$APR/include/apr-1', '$APU/include/apr-1']) ++ env.Append(LIBPATH=['$APR/lib', '$APU/lib'], ++ CPPPATH=['$APR/include', '$APU/include']) + elif aprstatic: + env.Append(LIBPATH=['$APR/LibR','$APU/LibR'], + CPPPATH=['$APR/include', '$APU/include']) +@@ -335,9 +335,9 @@ + LIBPATH=['$ZLIB']) + + # openssl +- env.Append(LIBS=['libeay32.lib', 'ssleay32.lib']) ++ env.Append(LIBS=os.environ["OPENSSL_LIBS"].split(";")) + if not env.get('SOURCE_LAYOUT', None): +- env.Append(CPPPATH=['$OPENSSL/include/openssl'], ++ env.Append(CPPPATH=['$OPENSSL/include', '$OPENSSL/include/openssl'], + LIBPATH=['$OPENSSL/lib']) + elif 0: # opensslstatic: + env.Append(CPPPATH=['$OPENSSL/inc32'], diff --git a/recipes/serf/all/patches/0004-1.3.9-scons-python-spaces.patch b/recipes/serf/all/patches/0004-1.3.9-scons-python-spaces.patch new file mode 100644 index 0000000000000..ea3344e6a98ac --- /dev/null +++ b/recipes/serf/all/patches/0004-1.3.9-scons-python-spaces.patch @@ -0,0 +1,17 @@ +conan-center-index/recipes/apr/all/patches/0004-1.3.9-scons-python-spaces.patch + +This corrects build failure if python is in a path with spaces, +e.g. the default system-wide C:\Program Files\Python39 + +The patch is a cherry-pick from upstream r1809132 +--- SConstruct.orig 2021-04-21 11:31:44.866021500 -0500 ++++ SConstruct 2021-04-21 11:50:22.148062300 -0500 +@@ -159,7 +159,7 @@ + + env.Append(BUILDERS = { + 'GenDef' : +- Builder(action = sys.executable + ' build/gen_def.py $SOURCES > $TARGET', ++ Builder(action = '"%s" build/gen_def.py $SOURCES > $TARGET' % (sys.executable,), + suffix='.def', src_suffix='.h') + }) + diff --git a/recipes/serf/all/patches/0005-1.3.9-serf-openssl-3.x.patch b/recipes/serf/all/patches/0005-1.3.9-serf-openssl-3.x.patch new file mode 100644 index 0000000000000..d270347c9b03e --- /dev/null +++ b/recipes/serf/all/patches/0005-1.3.9-serf-openssl-3.x.patch @@ -0,0 +1,30 @@ +Subject: Fix build with OpenSSL 3 +Author: James McCoy +Origin: https://salsa.debian.org/jamessan/serf/-/blob/500faae58ca4a8f84c2c4a485c81ed4867be57a6/debian/patches/openssl-3.x +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006572 + +Remove use of ERR_GET_FUNC when it's not defined, as is the case with OpenSSL >= 3. + +See https://www.openssl.org/news/cl30.txt + + * The ERR_GET_FUNC() function was removed. With the loss of meaningful + function codes, this function can only cause problems for calling + applications. + +--- buckets/ssl_buckets.c ++++ buckets/ssl_buckets.c +@@ -1325,9 +1325,14 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey) + return 0; + } + else { ++#ifdef ERR_GET_FUNC + printf("OpenSSL cert error: %d %d %d\n", ERR_GET_LIB(err), + ERR_GET_FUNC(err), + ERR_GET_REASON(err)); ++#else ++ printf("OpenSSL cert error: %d %d\n", ERR_GET_LIB(err), ++ ERR_GET_REASON(err)); ++#endif + PKCS12_free(p12); + bio_meth_free(biom); + } diff --git a/recipes/serf/all/test_package/CMakeLists.txt b/recipes/serf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f8b971e2db377 --- /dev/null +++ b/recipes/serf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/serf/all/test_package/conanfile.py b/recipes/serf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4aebe114eeb59 --- /dev/null +++ b/recipes/serf/all/test_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" + + 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/serf/all/test_package/test_package.c b/recipes/serf/all/test_package/test_package.c new file mode 100644 index 0000000000000..f718b6aab5a58 --- /dev/null +++ b/recipes/serf/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "serf.h" + +#include + +int main() { + int major, minor, patch; + serf_lib_version(&major, &minor, &patch); + printf("serf version %d.%d.%d\n", major, minor, patch); + return 0; +} diff --git a/recipes/serf/config.yml b/recipes/serf/config.yml new file mode 100644 index 0000000000000..6876fdaa827c2 --- /dev/null +++ b/recipes/serf/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.9": + folder: all diff --git a/recipes/serial/all/CMakeLists.txt b/recipes/serial/all/CMakeLists.txt new file mode 100644 index 0000000000000..25209c318b985 --- /dev/null +++ b/recipes/serial/all/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +# Work-around for https://github.com/wjwwood/serial/issues/135 +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) + +install(TARGETS serial) diff --git a/recipes/serial/all/Findcatkin.cmake b/recipes/serial/all/Findcatkin.cmake new file mode 100644 index 0000000000000..78ac59b63f4ef --- /dev/null +++ b/recipes/serial/all/Findcatkin.cmake @@ -0,0 +1,9 @@ +# Work-around for https://github.com/wjwwood/serial/issues/135 + +function(catkin_package) +endfunction() + +set(CATKIN_PACKAGE_LIB_DESTINATION lib) +set(CATKIN_GLOBAL_BIN_DESTINATION bin) +set(CATKIN_GLOBAL_INCLUDE_DESTINATION include) +set(CATKIN_ENABLE_TESTING OFF) diff --git a/recipes/serial/all/conandata.yml b/recipes/serial/all/conandata.yml new file mode 100644 index 0000000000000..97978a685f8d9 --- /dev/null +++ b/recipes/serial/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 1.2.1: + sha256: 0c2a789ce485a83ed640c777a7d1cd1256976890ece4c126f93751a08643917a + url: https://github.com/wjwwood/serial/archive/1.2.1.tar.gz diff --git a/recipes/serial/all/conanfile.py b/recipes/serial/all/conanfile.py new file mode 100644 index 0000000000000..d5553000bbddb --- /dev/null +++ b/recipes/serial/all/conanfile.py @@ -0,0 +1,68 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration, ConanException + + +class ConanRecipe(ConanFile): + name = "serial" + description = "Cross-platform library for interfacing with rs-232 serial like ports" + topics = ("serial", "rs-232", "com") + homepage = "http://wjwwood.io/serial/" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + exports_sources = ["CMakeLists.txt", "Findcatkin.cmake"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format(self.name, self.version), + self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("README.md", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["serial"] + + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["rt", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["setupapi"] + elif tools.is_apple_os(self.settings.os): + self.cpp_info.frameworks = ["IOKit", "Foundation"] diff --git a/recipes/serial/all/test_package/CMakeLists.txt b/recipes/serial/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..328eaf93b7304 --- /dev/null +++ b/recipes/serial/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(serial REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} serial::serial) diff --git a/recipes/serial/all/test_package/conanfile.py b/recipes/serial/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5493d58611803 --- /dev/null +++ b/recipes/serial/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/serial/all/test_package/test_package.cpp b/recipes/serial/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8cb01ed6a8b53 --- /dev/null +++ b/recipes/serial/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +#include "serial/serial.h" + +using namespace std; + +int main() { + vector devices_found = serial::list_ports(); + + vector::iterator iter = devices_found.begin(); + + while (iter != devices_found.end()) { + serial::PortInfo device = *iter++; + + printf("(%s, %s, %s)\n", device.port.c_str(), + device.description.c_str(), device.hardware_id.c_str()); + } + + return 0; +} diff --git a/recipes/serial/config.yml b/recipes/serial/config.yml new file mode 100644 index 0000000000000..cf2793f85804d --- /dev/null +++ b/recipes/serial/config.yml @@ -0,0 +1,3 @@ +versions: + 1.2.1: + folder: all diff --git a/recipes/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml new file mode 100644 index 0000000000000..58f8c7d9b6cc4 --- /dev/null +++ b/recipes/sfml/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.5.1": + url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip" + sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f" +patches: + "2.5.1": + - patch_file: "patches/0001-cmake-robust-find-deps.patch" + patch_description: "Robust discovery of dependencies" + patch_type: "conan" + - patch_file: "patches/0002-allow-non-x86-64-macos.patch" + patch_description: "Allow compilation for macOS arm" + patch_type: "portability" + - patch_file: "patches/0003-allow-shared-MT.patch" + patch_description: "Allow to build shared SFML with MT runtime" + patch_type: "portability" + - patch_file: "patches/0004-fix-ios.patch" + patch_description: "Fix iOS detection logic in CMakeLists" + patch_type: "portability" + - patch_file: "patches/0005-remove-auto-ptr.patch" + patch_description: "Remove usage of auto_ptr to allow compilation with C++17 standard" + patch_type: "portability" + patch_source: "https://github.com/SFML/SFML/commit/bf92efe9a4035fee0258386173d53556aa196e49" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py new file mode 100644 index 0000000000000..18f3ab2ca1e58 --- /dev/null +++ b/recipes/sfml/all/conanfile.py @@ -0,0 +1,290 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class SfmlConan(ConanFile): + name = "sfml" + description = "Simple and Fast Multimedia Library." + license = "Zlib" + topics = ("multimedia", "games", "graphics", "audio") + homepage = "https://www.sfml-dev.org" + 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], + "window": [True, False], + "graphics": [True, False], + "network": [True, False], + "audio": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "window": True, + "graphics": True, + "network": True, + "audio": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.window: + if self.settings.os in ["Windows", "Linux", "FreeBSD", "Macos"]: + self.requires("opengl/system") + if self.settings.os == "Linux": + self.requires("libudev/system") + self.requires("xorg/system") + if self.options.graphics: + self.requires("freetype/2.13.0") + self.requires("stb/cci.20220909") + if self.options.audio: + self.requires("flac/1.4.2") + self.requires("openal-soft/1.22.2") + self.requires("vorbis/1.3.7") + + def validate(self): + if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Android", "Macos", "iOS"]: + raise ConanInvalidConfiguration(f"{self.ref} not supported on {self.settings.os}") + if self.options.graphics and not self.options.window: + raise ConanInvalidConfiguration("sfml:graphics=True requires sfml:window=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + rmdir(self, os.path.join(self.source_folder, "extlibs")) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["SFML_DEPENDENCIES_INSTALL_PREFIX"] = self.package_folder.replace("\\", "/") + tc.cache_variables["SFML_MISC_INSTALL_PREFIX"] = os.path.join(self.package_folder, "licenses").replace("\\", "/") + tc.variables["SFML_BUILD_WINDOW"] = self.options.window + tc.variables["SFML_BUILD_GRAPHICS"] = self.options.graphics + tc.variables["SFML_BUILD_NETWORK"] = self.options.network + tc.variables["SFML_BUILD_AUDIO"] = self.options.audio + tc.variables["SFML_INSTALL_PKGCONFIG_FILES"] = False + tc.variables["SFML_GENERATE_PDB"] = False + tc.variables["SFML_USE_SYSTEM_DEPS"] = True + if is_msvc(self): + tc.variables["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {values["target"]: f"SFML::{component}" for component, values in self._sfml_components.items()} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _sfml_components(self): + def gdi32(): + return ["gdi32"] if self.settings.os == "Windows" else [] + + def winmm(): + return ["winmm"] if self.settings.os == "Windows" else [] + + def ws2_32(): + return ["ws2_32"] if self.settings.os == "Windows" else [] + + def libudev(): + return ["libudev::libudev"] if self.settings.os == "Linux" else [] + + def xorg(): + return ["xorg::xorg"] if self.settings.os == "Linux" else [] + + def pthread(): + return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def rt(): + return ["rt"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def usbhid(): + return ["usbhid"] if self.settings.os == "FreeBSD" else [] + + def android(): + return ["android"] if self.settings.os == "Android" else [] + + def log(): + return ["log"] if self.settings.os == "Android" else [] + + def foundation(): + return ["Foundation"] if is_apple_os(self) else [] + + def appkit(): + return ["AppKit"] if self.settings.os == "Macos" else [] + + def carbon(): + return ["Carbon"] if self.settings.os == "Macos" else [] + + def iokit(): + return ["IOKit"] if self.settings.os == "Macos" else [] + + def coregraphics(): + return ["CoreGraphics"] if self.settings.os == "iOS" else [] + + def coremotion(): + return ["CoreMotion"] if self.settings.os == "iOS" else [] + + def quartzcore(): + return ["QuartzCore"] if self.settings.os == "iOS" else [] + + def uikit(): + return ["UIKit"] if self.settings.os == "iOS" else [] + + def opengl(): + return ["opengl::opengl"] if self.settings.os in ["Windows", "Linux", "FreeBSD", "Macos"] else [] + + def opengles_android(): + return ["EGL", "GLESv1_CM"] if self.settings.os == "Android" else [] + + def opengles_ios(): + return ["OpenGLES"] if self.settings.os == "iOS" else [] + + suffix = "" if self.options.shared else "-s" + suffix += "-d" if self.settings.build_type == "Debug" else "" + + sfml_components = { + "system": { + "target": "sfml-system", + "libs": [f"sfml-system{suffix}"], + "system_libs": winmm() + pthread() + rt() + android() + log(), + }, + } + if self.settings.os in ["Windows", "Android", "iOS"]: + sfml_main_suffix = "-d" if self.settings.build_type == "Debug" else "" + sfmlmain_libs = [f"sfml-main{sfml_main_suffix}"] + if self.settings.os == "Android": + sfmlmain_libs.append(f"sfml-activity{suffix}") + sfml_components.update({ + "main": { + "target": "sfml-main", + "libs": sfmlmain_libs, + "system_libs": android() + log(), + }, + }) + if self.options.window: + sfml_components.update({ + "window": { + "target": "sfml-window", + "libs": [f"sfml-window{suffix}"], + "requires": ["system"] + opengl() + xorg() + libudev(), + "system_libs": gdi32() + winmm() + usbhid() + android() + opengles_android(), + "frameworks": foundation() + appkit() + iokit() + carbon() + + uikit() + coregraphics() + quartzcore() + + coremotion() + opengles_ios(), + }, + }) + if self.options.graphics: + sfml_components.update({ + "graphics": { + "target": "sfml-graphics", + "libs": [f"sfml-graphics{suffix}"], + "requires": ["window", "freetype::freetype", "stb::stb"], + }, + }) + if self.options.network: + sfml_components.update({ + "network": { + "target": "sfml-network", + "libs": [f"sfml-network{suffix}"], + "requires": ["system"], + "system_libs": ws2_32(), + }, + }) + if self.options.audio: + sfml_components.update({ + "audio": { + "target": "sfml-audio", + "libs": [f"sfml-audio{suffix}"], + "requires": ["system", "flac::flac", "openal-soft::openal-soft", "vorbis::vorbis"], + "system_libs": android(), + }, + }) + + return sfml_components + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SFML") + self.cpp_info.set_property("pkg_config_name", "sfml-all") + + def _register_components(components): + defines = [] if self.options.shared else ["SFML_STATIC"] + for component, values in components.items(): + target = values.get("target", []) + libs = values.get("libs", []) + requires = values.get("requires", []) + system_libs = values.get("system_libs", []) + frameworks = values.get("frameworks", []) + # TODO: Properly model COMPONENTS names in CMakeDeps for find_package() call + # (see https://github.com/conan-io/conan/issues/10258) + # It should be: + # find_package(SFML REQUIRED COMPONENTS system window graphics network audio) + # target_link_libraries(myApp sfml-system sfml-window sfml-graphics sfml-network sfml-audio) + # Do not use cmake_target_aliases to model this, names are too generic! + self.cpp_info.components[component].set_property("cmake_target_name", target) + self.cpp_info.components[component].set_property("pkg_config_name", target) + self.cpp_info.components[component].libs = libs + self.cpp_info.components[component].defines = defines + self.cpp_info.components[component].requires = requires + self.cpp_info.components[component].system_libs = system_libs + self.cpp_info.components[component].frameworks = frameworks + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[component].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + + _register_components(self._sfml_components) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "SFML" + self.cpp_info.names["cmake_find_package_multi"] = "SFML" + self.cpp_info.names["pkgconfig"] = "sfml-all" diff --git a/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch new file mode 100644 index 0000000000000..b2a851662076d --- /dev/null +++ b/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch @@ -0,0 +1,89 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -161,7 +161,7 @@ endif() + # (except for stb_image) + # yes this is horrible, but GLOB_RECURSE sucks + sfml_set_option(SFML_USE_SYSTEM_DEPS FALSE BOOL "TRUE to use system dependencies, FALSE to use the bundled ones.") +-if(SFML_USE_SYSTEM_DEPS) ++if(0) + if(SFML_INSTALL_XCODE_TEMPLATES) + message(FATAL_ERROR "XCode templates installation cannot be used with the SFML_USE_SYSTEM_DEPS option (the bundled frameworks are required.)") + endif() +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -260,7 +260,7 @@ endmacro() + # [INCLUDE "OPENGL_INCLUDE_DIR"] + # [LINK "OPENGL_gl_LIBRARY"]) + function(sfml_find_package) +- set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") ++ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") + list(GET ARGN 0 target) + list(REMOVE_AT ARGN 0) + +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -66,20 +66,18 @@ elseif(SFML_OS_ANDROID) + endif() + + # find external libraries +-sfml_find_package(OpenAL INCLUDE "OPENAL_INCLUDE_DIR" LINK "OPENAL_LIBRARY") +-sfml_find_package(Vorbis INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") +-sfml_find_package(FLAC INCLUDE "FLAC_INCLUDE_DIR" LINK "FLAC_LIBRARY") ++find_package(OpenAL REQUIRED) ++find_package(Vorbis REQUIRED Enc File CONFIG) ++find_package(FLAC REQUIRED CONFIG) + + # avoids warnings in vorbisfile.h +-target_compile_definitions(Vorbis INTERFACE "OV_EXCLUDE_STATIC_CALLBACKS") +-target_compile_definitions(FLAC INTERFACE "FLAC__NO_DLL") + + # define the sfml-audio target + sfml_add_library(sfml-audio + SOURCES ${SRC} ${CODECS_SRC}) + + # setup dependencies +-target_link_libraries(sfml-audio PRIVATE OpenAL) ++target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL) + + if(SFML_OS_ANDROID) + target_link_libraries(sfml-audio PRIVATE android OpenSLES) +@@ -87,4 +85,4 @@ endif() + + target_link_libraries(sfml-audio + PUBLIC sfml-system +- PRIVATE Vorbis FLAC) ++ PRIVATE Vorbis::vorbisenc Vorbis::vorbisfile FLAC::FLAC) +--- a/src/SFML/CMakeLists.txt ++++ b/src/SFML/CMakeLists.txt +@@ -40,7 +40,7 @@ elseif(SFML_OS_ANDROID) + endif() + + # define the path of our additional CMake modules +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") ++list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") + + # set the output directory for SFML libraries + set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib") +--- a/src/SFML/Graphics/CMakeLists.txt ++++ b/src/SFML/Graphics/CMakeLists.txt +@@ -97,7 +97,8 @@ sfml_add_library(sfml-graphics + target_link_libraries(sfml-graphics PUBLIC sfml-window) + + # stb_image sources +-target_include_directories(sfml-graphics PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image") ++find_package(stb REQUIRED CONFIG) ++target_link_libraries(sfml-graphics PRIVATE stb::stb) + + # let CMake know about our additional graphics libraries paths + if(SFML_OS_WINDOWS) +@@ -134,8 +135,8 @@ if(SFML_OS_ANDROID) + target_link_libraries(sfml-graphics PRIVATE z EGL GLESv1_CM) + endif() + +-sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") +-target_link_libraries(sfml-graphics PRIVATE Freetype) ++find_package(Freetype REQUIRED MODULE) ++target_link_libraries(sfml-graphics PRIVATE Freetype::Freetype) + + # add preprocessor symbols + target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG") diff --git a/recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch b/recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch new file mode 100644 index 0000000000000..ef4c08d60f475 --- /dev/null +++ b/recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -253,7 +253,7 @@ if(SFML_OS_MACOSX) + endif() + + # only the default architecture (i.e. 64-bit) is supported +- if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64") ++ if(0) + message(FATAL_ERROR "Only 64-bit architecture is supported") + endif() + diff --git a/recipes/sfml/all/patches/0003-allow-shared-MT.patch b/recipes/sfml/all/patches/0003-allow-shared-MT.patch new file mode 100644 index 0000000000000..830dd528773e8 --- /dev/null +++ b/recipes/sfml/all/patches/0003-allow-shared-MT.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -216,7 +216,7 @@ if(SFML_OS_WINDOWS) + sfml_set_option(SFML_USE_STATIC_STD_LIBS FALSE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs") + + # the following combination of flags is not valid +- if (BUILD_SHARED_LIBS AND SFML_USE_STATIC_STD_LIBS) ++ if (0) + message(FATAL_ERROR "BUILD_SHARED_LIBS and SFML_USE_STATIC_STD_LIBS cannot be used together") + endif() + diff --git a/recipes/sfml/all/patches/0004-fix-ios.patch b/recipes/sfml/all/patches/0004-fix-ios.patch new file mode 100644 index 0000000000000..8300be1e562ab --- /dev/null +++ b/recipes/sfml/all/patches/0004-fix-ios.patch @@ -0,0 +1,26 @@ +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -35,13 +35,12 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "^OpenBSD$") + set(SFML_OS_OPENBSD 1) + # don't use the OpenGL ES implementation on OpenBSD + set(OPENGL_ES 0) +-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- if(IOS) ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS") + set(SFML_OS_IOS 1) + + # use the OpenGL ES implementation on iOS + set(OPENGL_ES 1) +- else() ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(SFML_OS_MACOSX 1) + + # don't use the OpenGL ES implementation on Mac OS X +@@ -54,7 +53,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}") + return() + endif() +- endif() + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + set(SFML_OS_ANDROID 1) + diff --git a/recipes/sfml/all/patches/0005-remove-auto-ptr.patch b/recipes/sfml/all/patches/0005-remove-auto-ptr.patch new file mode 100644 index 0000000000000..63069f1d9cab4 --- /dev/null +++ b/recipes/sfml/all/patches/0005-remove-auto-ptr.patch @@ -0,0 +1,43 @@ +--- a/src/SFML/Audio/AudioDevice.cpp ++++ b/src/SFML/Audio/AudioDevice.cpp +@@ -29,7 +29,7 @@ + #include + #include + #include +-#include ++#include + + + namespace +@@ -107,9 +107,13 @@ bool AudioDevice::isExtensionSupported(const std::string& extension) + // This device will not be used in this function and merely + // makes sure there is a valid OpenAL device for extension + // queries if none has been created yet. +- std::auto_ptr device; ++ // ++ // Using an std::vector for this since auto_ptr is deprecated ++ // and we have no better STL facility for dynamically allocating ++ // a temporary instance with strong exception guarantee. ++ std::vector device; + if (!audioDevice) +- device.reset(new AudioDevice); ++ device.resize(1); + + if ((extension.length() > 2) && (extension.substr(0, 3) == "ALC")) + return alcIsExtensionPresent(audioDevice, extension.c_str()) != AL_FALSE; +@@ -125,9 +129,13 @@ int AudioDevice::getFormatFromChannelCount(unsigned int channelCount) + // This device will not be used in this function and merely + // makes sure there is a valid OpenAL device for format + // queries if none has been created yet. +- std::auto_ptr device; ++ // ++ // Using an std::vector for this since auto_ptr is deprecated ++ // and we have no better STL facility for dynamically allocating ++ // a temporary instance with strong exception guarantee. ++ std::vector device; + if (!audioDevice) +- device.reset(new AudioDevice); ++ device.resize(1); + + // Find the good format according to the number of channels + int format = 0; diff --git a/recipes/sfml/all/test_package/CMakeLists.txt b/recipes/sfml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5272094f7cb4 --- /dev/null +++ b/recipes/sfml/all/test_package/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) + +set(SFML_COMPONENTS system) +set(SFML_TARGETS sfml-system) +if(SFML_WITH_WINDOW) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_WINDOW) + list(APPEND SFML_COMPONENTS window) + list(APPEND SFML_TARGETS sfml-window) +endif() +if(SFML_WITH_GRAPHICS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_GRAPHICS) + list(APPEND SFML_COMPONENTS graphics) + list(APPEND SFML_TARGETS sfml-graphics) +endif() +if(SFML_WITH_NETWORK) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_NETWORK) + list(APPEND SFML_COMPONENTS network) + list(APPEND SFML_TARGETS sfml-network) +endif() +if(SFML_WITH_AUDIO) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_AUDIO) + list(APPEND SFML_COMPONENTS audio) + list(APPEND SFML_TARGETS sfml-audio) +endif() + +find_package(SFML REQUIRED ${SFML_COMPONENTS} CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE ${SFML_TARGETS}) diff --git a/recipes/sfml/all/test_package/conanfile.py b/recipes/sfml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..166801a7f9deb --- /dev/null +++ b/recipes/sfml/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SFML_WITH_WINDOW"] = self.dependencies["sfml"].options.window + tc.variables["SFML_WITH_GRAPHICS"] = self.dependencies["sfml"].options.graphics + tc.variables["SFML_WITH_NETWORK"] = self.dependencies["sfml"].options.network + tc.variables["SFML_WITH_AUDIO"] = self.dependencies["sfml"].options.audio + 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/sfml/all/test_package/test_package.cpp b/recipes/sfml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a85de8db66e36 --- /dev/null +++ b/recipes/sfml/all/test_package/test_package.cpp @@ -0,0 +1,42 @@ +#include + +#ifdef SFML_WITH_WINDOW +#include +#endif +#ifdef SFML_WITH_GRAPHICS +#include +#endif +#ifdef SFML_WITH_NETWORK +#include +#endif +#ifdef SFML_WITH_AUDIO +#include +#endif + +int main() +{ + sf::Clock clock; + clock.getElapsedTime().asSeconds(); + +#ifdef SFML_WITH_WINDOW + sf::VideoMode videoMode(720, 480); +#endif + +#ifdef SFML_WITH_GRAPHICS + sf::RectangleShape shape; + shape.setFillColor(sf::Color::Cyan); +#endif + +#ifdef SFML_WITH_NETWORK + sf::TcpListener listener; + listener.isBlocking(); +#endif + +#ifdef SFML_WITH_AUDIO + sf::SoundBuffer buffer; + sf::Sound sound; + sound.setBuffer(buffer); +#endif + + return 0; +} diff --git a/recipes/sfml/all/test_v1_package/CMakeLists.txt b/recipes/sfml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sfml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sfml/all/test_v1_package/conanfile.py b/recipes/sfml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d431379ec6c21 --- /dev/null +++ b/recipes/sfml/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["SFML_WITH_WINDOW"] = self.options["sfml"].window + cmake.definitions["SFML_WITH_GRAPHICS"] = self.options["sfml"].graphics + cmake.definitions["SFML_WITH_NETWORK"] = self.options["sfml"].network + cmake.definitions["SFML_WITH_AUDIO"] = self.options["sfml"].audio + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sfml/config.yml b/recipes/sfml/config.yml new file mode 100644 index 0000000000000..eab83a303df52 --- /dev/null +++ b/recipes/sfml/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.1": + folder: all diff --git a/recipes/shaderc/all/CMakeLists.txt b/recipes/shaderc/all/CMakeLists.txt new file mode 100644 index 0000000000000..4d393c7a86c09 --- /dev/null +++ b/recipes/shaderc/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..36e3a9f3b6b76 --- /dev/null +++ b/recipes/shaderc/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "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: + "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" diff --git a/recipes/shaderc/all/conanfile.py b/recipes/shaderc/all/conanfile.py new file mode 100644 index 0000000000000..431f1292c6d2f --- /dev/null +++ b/recipes/shaderc/all/conanfile.py @@ -0,0 +1,131 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.36.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" + + 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"]) + + 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 + + @property + def _get_compatible_spirv_tools_version(self): + return { + "2021.1": "2021.2", + "2019.0": "2020.5" + }.get(str(self.version), False) + + @property + def _get_compatible_glslang_version(self): + return { + "2021.1": "11.5.0", + "2019.0": "8.13.3559" + }.get(str(self.version), False) + + 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") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + 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() + cmake.install() + tools.rmdir(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.defines.append("SHADERC_SHAREDLIB") + + 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 new file mode 100644 index 0000000000000..1fee3bf35ecf3 --- /dev/null +++ b/recipes/shaderc/all/patches/2019.0/fix-cmake.patch @@ -0,0 +1,402 @@ +--- 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 new file mode 100644 index 0000000000000..682a95ac5deb9 --- /dev/null +++ b/recipes/shaderc/all/patches/2019.0/fix-spvc.patch @@ -0,0 +1,24 @@ +--- 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/fix-cmake.patch b/recipes/shaderc/all/patches/2021.1/fix-cmake.patch new file mode 100644 index 0000000000000..ac2fd7ef1015f --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/fix-cmake.patch @@ -0,0 +1,324 @@ +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/test_package/CMakeLists.txt b/recipes/shaderc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..492695489b31c --- /dev/null +++ b/recipes/shaderc/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME}_shaderc_c test_package_shaderc.c) +target_link_libraries(${PROJECT_NAME}_shaderc_c ${CONAN_LIBS}) + +add_executable(${PROJECT_NAME}_shaderc_cpp test_package_shaderc.cpp) +target_link_libraries(${PROJECT_NAME}_shaderc_cpp ${CONAN_LIBS}) +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 new file mode 100644 index 0000000000000..e6ac9a4c93682 --- /dev/null +++ b/recipes/shaderc/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +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.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): + # 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) + # 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) diff --git a/recipes/shaderc/all/test_package/test_package.vert b/recipes/shaderc/all/test_package/test_package.vert new file mode 100644 index 0000000000000..8f349eebab57e --- /dev/null +++ b/recipes/shaderc/all/test_package/test_package.vert @@ -0,0 +1,8 @@ +#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_shaderc.c b/recipes/shaderc/all/test_package/test_package_shaderc.c new file mode 100644 index 0000000000000..6a83dd0f7a22f --- /dev/null +++ b/recipes/shaderc/all/test_package/test_package_shaderc.c @@ -0,0 +1,8 @@ +#include + +int main() { + shaderc_compiler_t shaderc_compiler = shaderc_compiler_initialize(); + shaderc_compiler_release(shaderc_compiler); + + return 0; +} diff --git a/recipes/shaderc/all/test_package/test_package_shaderc.cpp b/recipes/shaderc/all/test_package/test_package_shaderc.cpp new file mode 100644 index 0000000000000..d6defefea4435 --- /dev/null +++ b/recipes/shaderc/all/test_package/test_package_shaderc.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + shaderc::Compiler compiler; + shaderc::CompileOptions compile_options; + + return 0; +} diff --git a/recipes/shaderc/all/test_package/test_package_spvc.c b/recipes/shaderc/all/test_package/test_package_spvc.c new file mode 100644 index 0000000000000..c9fc709f30096 --- /dev/null +++ b/recipes/shaderc/all/test_package/test_package_spvc.c @@ -0,0 +1,8 @@ +#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 new file mode 100644 index 0000000000000..40978d50d1c6c --- /dev/null +++ b/recipes/shaderc/all/test_package/test_package_spvc.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + shaderc_spvc::Compiler compiler; + shaderc_spvc::CompileOptions compile_options; + + return 0; +} diff --git a/recipes/shaderc/config.yml b/recipes/shaderc/config.yml new file mode 100644 index 0000000000000..15d431909e594 --- /dev/null +++ b/recipes/shaderc/config.yml @@ -0,0 +1,5 @@ +versions: + "2021.1": + folder: all + "2019.0": + folder: all diff --git a/recipes/shapelib/all/conandata.yml b/recipes/shapelib/all/conandata.yml new file mode 100644 index 0000000000000..5dde0cb6bfee1 --- /dev/null +++ b/recipes/shapelib/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.5.0": + url: "https://github.com/OSGeo/shapelib/archive/v1.5.0.zip" + sha256: "673b00ef6caef254fe16d831b982e6bbed7397615c57b9ed92cf8b59017dd06b" +patches: + "1.5.0": + - patch_file: "patches/0001-cmake-minimum-required.patch" + patch_description: "Place the cmake_minimum_required call before the project command" + patch_source: "https://github.com/OSGeo/shapelib/pull/45" + patch_type: "portability" + - patch_file: "patches/0002-build-testing.patch" + patch_description: "Use the standard BUILD_TESTING variable to control building tests" + patch_source: "https://github.com/OSGeo/shapelib/pull/46" + patch_type: "portability" diff --git a/recipes/shapelib/all/conanfile.py b/recipes/shapelib/all/conanfile.py new file mode 100644 index 0000000000000..19059022ab189 --- /dev/null +++ b/recipes/shapelib/all/conanfile.py @@ -0,0 +1,80 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir + +required_conan_version = ">=1.53.0" + + +class ShapelibConan(ConanFile): + name = "shapelib" + description = "C library for reading and writing ESRI Shapefiles" + license = "LGPL-2.0-or-later" + topics = ("osgeo", "shapefile", "esri", "geospatial") + homepage = "https://github.com/OSGeo/shapelib" + 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, + } + + 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.compiler.rm_safe("cppstd") + self.settings.compiler.rm_safe("libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.variables["BUILD_TESTING"] = False + tc.variables["USE_RPATH"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.exe", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "shapelib") + self.cpp_info.set_property("cmake_target_name", "shapelib::shp") + self.cpp_info.set_property("pkg_config_name", "shapelib") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["shp"].libs = ["shp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["shp"].system_libs.append("m") + + # TODO: remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "shapelib" + self.cpp_info.names["cmake_find_package_multi"] = "shapelib" + self.cpp_info.components["shp"].names["cmake_find_package"] = "shp" + self.cpp_info.components["shp"].names["cmake_find_package_multi"] = "shp" diff --git a/recipes/shapelib/all/patches/0001-cmake-minimum-required.patch b/recipes/shapelib/all/patches/0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..6e8c152618159 --- /dev/null +++ b/recipes/shapelib/all/patches/0001-cmake-minimum-required.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7ae7f5d..0a5662f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,14 +20,15 @@ + + # It is a fatal error if no working C compiler is available to build + # the shapelib library and utilities ++ ++# Version 3.7 or above of cmake is currently required for all platforms. ++cmake_minimum_required(VERSION 3.7) ++ + project(shapelib C) + + message(STATUS "CMake version = ${CMAKE_VERSION}") + message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") + +-# Version 2.8.5 or above of cmake is currently required for all platforms. +-cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) +- + # libraries are all shared by default. + option(BUILD_SHARED_LIBS "Build shared libraries" ON) + diff --git a/recipes/shapelib/all/patches/0002-build-testing.patch b/recipes/shapelib/all/patches/0002-build-testing.patch new file mode 100644 index 0000000000000..b86e9d5682d90 --- /dev/null +++ b/recipes/shapelib/all/patches/0002-build-testing.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0a5662f..6214dec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,7 +149,7 @@ set(executables + find_program(BASH_EXECUTABLE bash) + find_program(SED_EXECUTABLE sed) + if(BASH_EXECUTABLE AND SED_EXECUTABLE) +- set(BUILD_TEST ON) ++ set(BUILD_TESTING ON CACHE BOOL "") + else(BASH_EXECUTABLE AND SED_EXECUTABLE) + message(STATUS "WARNING: sed or bash not available so disabling testing") + endif(BASH_EXECUTABLE AND SED_EXECUTABLE) +@@ -158,14 +158,14 @@ endif(BASH_EXECUTABLE AND SED_EXECUTABLE) + # from http://dl.maptools.org/dl/shapelib/shape_eg_data.zip, unpacked + # that file, and specified the location of that directory with + # the cmake option, -DEG_DATA:PATH=whatever +-if(BUILD_TEST) ++if(BUILD_TESTING) + if(EG_DATA) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/script.sed "s?/u/www/projects/shapelib/eg_data?${EG_DATA}?\n") + else(EG_DATA) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/script.sed "") + message(STATUS "WARNING: EG_DATA:PATH not set to point to downloaded eg_data directory so the eg_data part of testing will be ignored.") + endif(EG_DATA) +-endif(BUILD_TEST) ++endif() + + foreach(executable ${executables}) + add_executable(${executable} ${executable}.c) +@@ -176,17 +176,17 @@ foreach(executable ${executables}) + INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}" + ) + endif(USE_RPATH) +- if(BUILD_TEST) ++ if(BUILD_TESTING) + get_target_property(${executable}_LOC ${executable} LOCATION) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/script.sed "s?\\./${executable}?${${executable}_LOC}?\n") +- endif(BUILD_TEST) ++ endif() + install(TARGETS ${executable} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach(executable ${executables}) + + # Install header + install(FILES shapefil.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +-if(BUILD_TEST) ++if(BUILD_TESTING) + # Set up tests: + + enable_testing() +@@ -235,4 +235,4 @@ if(BUILD_TEST) + NAME test3 + COMMAND ${BASH_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/sed_scripted_test3.sh + ) +-endif(BUILD_TEST) ++endif() diff --git a/recipes/shapelib/all/test_package/CMakeLists.txt b/recipes/shapelib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30289c1a8112b --- /dev/null +++ b/recipes/shapelib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(shapelib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE shapelib::shp) diff --git a/recipes/shapelib/all/test_package/conanfile.py b/recipes/shapelib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/shapelib/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/shapelib/all/test_package/test_package.c b/recipes/shapelib/all/test_package/test_package.c new file mode 100644 index 0000000000000..57fa672c5bc45 --- /dev/null +++ b/recipes/shapelib/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "shapefil.h" + +#include + +int main() { + char out_file_name[] = "test"; + SHPHandle hSHP = SHPCreate(out_file_name, SHPT_POLYGONZ); + + if (hSHP == NULL) { + printf("Unable to create:%s\n", out_file_name); + exit(EXIT_FAILURE); + } + + SHPClose(hSHP); + + exit(EXIT_SUCCESS); +} diff --git a/recipes/shapelib/all/test_v1_package/CMakeLists.txt b/recipes/shapelib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/shapelib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/shapelib/all/test_v1_package/conanfile.py b/recipes/shapelib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/shapelib/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/shapelib/config.yml b/recipes/shapelib/config.yml new file mode 100644 index 0000000000000..7f3d5d7f62dd8 --- /dev/null +++ b/recipes/shapelib/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.0": + folder: all diff --git a/recipes/shield/all/conandata.yml b/recipes/shield/all/conandata.yml new file mode 100644 index 0000000000000..38803c2a64ad9 --- /dev/null +++ b/recipes/shield/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.4": + url: "https://github.com/holoplot/shield/archive/0.4.tar.gz" + sha256: "b93661c463b6a3af1900b9ea94bf0f75bc1bc6bd4d98b700cb29a62249fb6089" + "0.3": + url: "https://github.com/holoplot/shield/archive/0.3.tar.gz" + sha256: "125767e64c84e701f87eb52d7882b5214db375aa19798a5fda23eacce50bd564" + "0.2": + url: "https://github.com/holoplot/shield/archive/0.2.tar.gz" + sha256: "bbc22d122a73467715074a92cbcd31c51adacf03256e5d24e304613f8f72197e" + "0.1": + url: "https://github.com/holoplot/shield/archive/refs/tags/0.1.tar.gz" + sha256: "83d10f4e2946a32762bd5718b98f1fbfbb5c7f6d3841d44030b17aeacfbd92f4" diff --git a/recipes/shield/all/conanfile.py b/recipes/shield/all/conanfile.py new file mode 100644 index 0000000000000..b390de96bd44f --- /dev/null +++ b/recipes/shield/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class ShieldConan(ConanFile): + name = "shield" + description = "C++ warning suppression headers." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/holoplot/shield" + topics = ("utility", "warnings", "suppression", "header-only") + package_type = "header-library" + settings = "os", "compiler", "build_type", "arch" + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "shield" + self.cpp_info.names["cmake_find_package_multi"] = "shield" diff --git a/recipes/shield/all/test_package/CMakeLists.txt b/recipes/shield/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..93639374653d7 --- /dev/null +++ b/recipes/shield/all/test_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) +find_package(shield CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE shield::shield) diff --git a/recipes/shield/all/test_package/conanfile.py b/recipes/shield/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/shield/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/shield/all/test_package/test_package.cpp b/recipes/shield/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..23afb75c9af46 --- /dev/null +++ b/recipes/shield/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +#include + +int main() +{ + std::cout << "Shield is successfully included." << std::endl; +} diff --git a/recipes/shield/all/test_v1_package/CMakeLists.txt b/recipes/shield/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/shield/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/shield/all/test_v1_package/conanfile.py b/recipes/shield/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/shield/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/shield/config.yml b/recipes/shield/config.yml new file mode 100644 index 0000000000000..b3c1faaf54b2b --- /dev/null +++ b/recipes/shield/config.yml @@ -0,0 +1,9 @@ +versions: + "0.4": + folder: all + "0.3": + folder: all + "0.2": + folder: all + "0.1": + folder: all diff --git a/recipes/si/all/CMakeLists.txt b/recipes/si/all/CMakeLists.txt new file mode 100644 index 0000000000000..6c3ae2de9686d --- /dev/null +++ b/recipes/si/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/si/all/conandata.yml b/recipes/si/all/conandata.yml new file mode 100644 index 0000000000000..5576f1491e1a5 --- /dev/null +++ b/recipes/si/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + 1.7.6: + url: https://github.com/bernedom/SI/archive/1.7.6.tar.gz + sha256: 88041156890c34f7ca92f3ae385b19189583aa5c59ac470bfe2db6df5d5c954b + 2.0.4: + url: https://github.com/bernedom/SI/archive/2.0.4.tar.gz + sha256: 459936b913e887325e6ad69e9d64389b80f49e700aa8e5308df2bd77b8c74a0e + 2.1.3: + url: https://github.com/bernedom/SI/archive/2.1.3.tar.gz + sha256: c4728155bd8878fecc5c71c006e01cb193e6084d1604f79edc71ee723027534b + 2.2.0: + url: https://github.com/bernedom/SI/archive/2.2.0.tar.gz + sha256: 4b42dbe878995e19991487b60e235699b02858a5036a1729890d7adc865794bf + 2.3.0: + url: https://github.com/bernedom/SI/archive/2.3.0.tar.gz + sha256: b714162a933ddf1be66c8f2f2d31b52626189d6e4b292770bbb899106e8f6ac1 + 2.4.0: + url: https://github.com/bernedom/SI/archive/2.4.0.tar.gz + sha256: 84e13b52520808d9a55a073b1bb98376be03dc3b09ddee862a1418ef543e9f2d + 2.4.1: + url: https://github.com/bernedom/SI/archive/2.4.1.tar.gz + sha256: 6bfdbebb549da1b2db93b55c1c7f8228a0cdc6144a815319918237ca8601ad3a + 2.5.0: + url: https://github.com/bernedom/SI/archive/2.5.0.tar.gz + sha256: dc00eb8cfaa32e19c83595b238726188d2b857f8999dae08fe3001d0107ba276 + 2.5.1: + url: https://github.com/bernedom/SI/archive/2.5.1.tar.gz + sha256: b7b977c04c220a47a2bd3b8e2b6acfd640d286dfe1ae609f20e184cfec998798 diff --git a/recipes/si/all/conanfile.py b/recipes/si/all/conanfile.py new file mode 100644 index 0000000000000..38915243d0bef --- /dev/null +++ b/recipes/si/all/conanfile.py @@ -0,0 +1,74 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.43.0" + +class SiConan(ConanFile): + name = "si" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bernedom/SI" + description = "A header only c++ library that provides type safety and user defined literals \ + for handling pyhsical values defined in the International System of Units." + topics = ("physical units", "SI-unit-conversion", + "cplusplus-library", "cplusplus-17") + exports_sources = "CMakeLists.txt" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("'si' requires C++17, which your compiler ({} {}) does not support.".format( + self.settings.compiler, self.settings.compiler.version)) + else: + self.output.warn( + "'si' requires C++17. Your compiler is unknown. Assuming it supports C++17.") + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = CMake(self) + cmake.definitions["SI_BUILD_TESTING"] = False + cmake.definitions["SI_BUILD_DOC"] = False + cmake.definitions["SI_INSTALL_LIBRARY"] = True + cmake.configure(build_folder=self._build_subfolder) + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "SI::SI") + + self.cpp_info.names["cmake_find_package"] = "SI" + self.cpp_info.names["cmake_find_package_multi"] = "SI" diff --git a/recipes/si/all/test_package/CMakeLists.txt b/recipes/si/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..14c1322818a6b --- /dev/null +++ b/recipes/si/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SI REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} si_package_test.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_link_libraries(${PROJECT_NAME} SI::SI) diff --git a/recipes/si/all/test_package/conanfile.py b/recipes/si/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8ae9b638e62fe --- /dev/null +++ b/recipes/si/all/test_package/conanfile.py @@ -0,0 +1,18 @@ + +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/si/all/test_package/si_package_test.cpp b/recipes/si/all/test_package/si_package_test.cpp new file mode 100644 index 0000000000000..31ecad9ab45ab --- /dev/null +++ b/recipes/si/all/test_package/si_package_test.cpp @@ -0,0 +1,17 @@ +#include +#include + +using namespace SI::literals; + +constexpr auto one_kilogram = 1.0_kg; +constexpr auto ten_coulomb = 5.0_A * 2.0_s; +constexpr auto half_an_ampere = ten_coulomb / 20.0_s; + +void calculate_mass(const SI::kilo_gram_t &kg) { + // do something meaningful here +} + +int main(int, char **) { + calculate_mass(one_kilogram); + return 0; +} diff --git a/recipes/si/config.yml b/recipes/si/config.yml new file mode 100644 index 0000000000000..8530898d2c4b5 --- /dev/null +++ b/recipes/si/config.yml @@ -0,0 +1,19 @@ +versions: + 1.7.6: + folder: all + 2.0.4: + folder: all + 2.1.3: + folder: all + 2.2.0: + folder: all + 2.3.0: + folder: all + 2.4.0: + folder: all + 2.4.1: + folder: all + 2.5.0: + folder: all + 2.5.1: + folder: all diff --git a/recipes/sigslot/all/conandata.yml b/recipes/sigslot/all/conandata.yml new file mode 100644 index 0000000000000..eddec82a6c447 --- /dev/null +++ b/recipes/sigslot/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.2": + url: "https://github.com/palacaze/sigslot/archive/v1.2.2.tar.gz" + sha256: "d2dd0f91c13dbec1026aa5f393e511db863a8c32146c68c10888a9c193458437" + "1.2.1": + url: "https://github.com/palacaze/sigslot/archive/v1.2.1.tar.gz" + sha256: "180b45e41676a730220e3a9af6ee71b761f23b8f6ade73c8f2aa20b677504934" + "1.2.0": + url: "https://github.com/palacaze/sigslot/archive/v1.2.0.tar.gz" + sha256: "751852bcb1871aa2ca9f30b34614d028bc44379bbd6f91327744724c652e7ce8" diff --git a/recipes/sigslot/all/conanfile.py b/recipes/sigslot/all/conanfile.py new file mode 100644 index 0000000000000..7d60d57972bfa --- /dev/null +++ b/recipes/sigslot/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class SigslotConan(ConanFile): + name = "sigslot" + description = "Sigslot is a header-only, thread safe implementation of signal-slots for C++." + topics = ("signal", "slot", "c++14", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/palacaze/sigslot" + license = "MIT" + 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": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "15", # 14 is not supported by the library + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "signal.hpp", src=os.path.join(self.source_folder, "include", "sigslot"), + dst=os.path.join(self.package_folder, "include", "sigslot")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PalSigslot") + self.cpp_info.set_property("cmake_target_name", "Pal::Sigslot") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_sigslot"].bindirs = [] + self.cpp_info.components["_sigslot"].libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_sigslot"].system_libs.append("pthread") + elif self.settings.os == "Windows": + if is_msvc(self) or self.settings.compiler == "clang": + self.cpp_info.components["_sigslot"].exelinkflags.append('-OPT:NOICF') + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PalSigslot" + self.cpp_info.filenames["cmake_find_package_multi"] = "PalSigslot" + self.cpp_info.names["cmake_find_package"] = "Pal" + self.cpp_info.names["cmake_find_package_multi"] = "Pal" + self.cpp_info.components["_sigslot"].names["cmake_find_package"] = "Sigslot" + self.cpp_info.components["_sigslot"].names["cmake_find_package_multi"] = "Sigslot" + self.cpp_info.components["_sigslot"].set_property("cmake_target_name", "Pal::Sigslot") diff --git a/recipes/sigslot/all/test_package/CMakeLists.txt b/recipes/sigslot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b2d6dadc6457d --- /dev/null +++ b/recipes/sigslot/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PalSigslot REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Pal::Sigslot) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sigslot/all/test_package/conanfile.py b/recipes/sigslot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sigslot/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/sigslot/all/test_package/test_package.cpp b/recipes/sigslot/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..20576792474ee --- /dev/null +++ b/recipes/sigslot/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +// https://github.com/palacaze/sigslot/blob/master/example/basic.cpp +#include +#include + +void f() { std::cout << "free function\n"; } + +struct s { + void m() { std::cout << "member function\n"; } + static void sm() { std::cout << "static member function\n"; } +}; + +struct o { + void operator()() { std::cout << "function object\n"; } +}; + +int main() { + s d; + auto lambda = []() { std::cout << "lambda\n"; }; + + // declare a signal instance with no arguments + sigslot::signal<> sig; + + // sigslot::signal will connect to any callable provided it has compatible + // arguments. Here are diverse examples + sig.connect(f); + sig.connect(&s::m, &d); + sig.connect(&s::sm); + sig.connect(o()); + sig.connect(lambda); + + // Avoid hitting bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68071 + // on old GCC compilers +#ifndef __clang__ +#if GCC_VERSION > 70300 + auto gen_lambda = [](auto && ... /*a*/) { std::cout << "generic lambda\n"; }; + sig.connect(gen_lambda); +#endif +#endif + + // emit a signal + sig(); + + return 0; +} diff --git a/recipes/sigslot/all/test_v1_package/CMakeLists.txt b/recipes/sigslot/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sigslot/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sigslot/all/test_v1_package/conanfile.py b/recipes/sigslot/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sigslot/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/sigslot/config.yml b/recipes/sigslot/config.yml new file mode 100644 index 0000000000000..e7ad2033c3161 --- /dev/null +++ b/recipes/sigslot/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.2": + folder: all + "1.2.1": + folder: all + "1.2.0": + folder: all diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml new file mode 100644 index 0000000000000..4be0fb0333ac6 --- /dev/null +++ b/recipes/simdjson/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "3.1.8": + url: "https://github.com/simdjson/simdjson/archive/v3.1.8.tar.gz" + sha256: "99e7eeb0a0038e0213da68f099e6a8b67bcaeea1586385ec5f752bea85d902d8" + "3.1.7": + url: "https://github.com/simdjson/simdjson/archive/v3.1.7.tar.gz" + sha256: "c65f5184fba321c7b9e97f6c881af9b607457bdd60fac0467010e099121540e2" + "3.1.5": + url: "https://github.com/simdjson/simdjson/archive/v3.1.5.tar.gz" + sha256: "5b916be17343324426fc467a4041a30151e481700d60790acfd89716ecc37076" + "3.1.1": + url: "https://github.com/simdjson/simdjson/archive/v3.1.1.tar.gz" + sha256: "4fcb1c9b1944e2eb8a4a4a22c979e2827165216f859e94d93c846c1261e0e432" + "3.1.0": + url: "https://github.com/simdjson/simdjson/archive/refs/tags/3.1.0.tar.gz" + sha256: "14d17ba7139d27c1e1bf01e765f5c26e84cc9e9be6a316c977638e01c7de85fa" + "3.0.1": + url: "https://github.com/simdjson/simdjson/archive/v3.0.1.tar.gz" + sha256: "156b1bc5eb0561b2bd166b46d191fd3d95a3e709cc63761477d3b7aec2b6e9ed" + "3.0.0": + url: "https://github.com/simdjson/simdjson/archive/v3.0.0.tar.gz" + sha256: "e6dd4bfaad2fd9599e6a026476db39a3bb9529436d3508ac3ae643bc663526c5" + "2.2.3": + url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" + sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" + "2.1.0": + url: "https://github.com/simdjson/simdjson/archive/v2.1.0.tar.gz" + sha256: "051b90427ddd1eac319f4eb34b973592728a6d8608fbac61e8aaa5a2dee4b693" + "2.0.4": + url: "https://github.com/simdjson/simdjson/archive/v2.0.4.tar.gz" + sha256: "c8a12cf60f6ce8c0e556f68bd80e7bd9f11f5876e198ed3637da8ccf182eaa24" + "1.1.0": + url: "https://github.com/simdjson/simdjson/archive/v1.1.0.tar.gz" + sha256: "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e" + "1.0.2": + url: "https://github.com/simdjson/simdjson/archive/v1.0.2.tar.gz" + sha256: "46d5995488de76ae61f1c3bcff445a9085c8d34f6cbc9bf0422a99c6d98a002c" + "0.9.7": + url: "https://github.com/simdjson/simdjson/archive/v0.9.7.tar.gz" + sha256: "a21279ae4cf0049234a822c5c3550f99ec1707d3cda12156d331dcc8cd411ba0" diff --git a/recipes/simdjson/all/conanfile.py b/recipes/simdjson/all/conanfile.py new file mode 100644 index 0000000000000..b0c6d0fa54bf1 --- /dev/null +++ b/recipes/simdjson/all/conanfile.py @@ -0,0 +1,139 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class SimdjsonConan(ConanFile): + name = "simdjson" + description = "Parsing gigabytes of JSON per second" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lemire/simdjson" + topics = ("json", "parser", "simd", "format") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threads": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threads": True, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "Visual Studio": "16", + "msvc": "192", + "clang": "6", + "apple-clang": "9.4", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not fully support." + ) + + if Version(self.version) >= "2.0.0" and \ + 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SIMDJSON_ENABLE_THREADS"] = self.options.threads + if Version(self.version) < "1.0.0": + tc.variables["SIMDJSON_BUILD_STATIC"] = not self.options.shared + tc.variables["SIMDJSON_SANITIZE"] = False + tc.variables["SIMDJSON_JUST_LIBRARY"] = True + else: + tc.variables["SIMDJSON_DEVELOPER_MODE"] = False + tc.generate() + + def _patch_sources(self): + if Version(self.version) < "1.0.0": + simd_flags_file = os.path.join(self.source_folder, "cmake", "simdjson-flags.cmake") + # Those flags are not set in >=1.0.0 since we disable SIMDJSON_DEVELOPER_MODE + replace_in_file(self, simd_flags_file, "target_compile_options(simdjson-internal-flags INTERFACE -fPIC)", "") + replace_in_file(self, simd_flags_file, "-Werror", "") + replace_in_file(self, simd_flags_file, "/WX", "") + # Relocatable shared lib on macOS + replace_in_file(self, simd_flags_file, "set(CMAKE_MACOSX_RPATH OFF)", "") + else: + developer_options = os.path.join(self.source_folder, "cmake", "developer-options.cmake") + # Relocatable shared lib on macOS + replace_in_file(self, developer_options, "set(CMAKE_MACOSX_RPATH OFF)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "simdjson") + self.cpp_info.set_property("cmake_target_name", "simdjson::simdjson") + self.cpp_info.set_property("pkg_config_name", "simdjson") + + self.cpp_info.libs = ["simdjson"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if self.options.threads: + self.cpp_info.defines = ["SIMDJSON_THREADS_ENABLED=1"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.options.shared: + self.cpp_info.defines.append("SIMDJSON_USING_LIBRARY=1") + if is_msvc(self): + self.cpp_info.defines.append("SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY=1") diff --git a/recipes/simdjson/all/test_package/CMakeLists.txt b/recipes/simdjson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..84e6f651dff5a --- /dev/null +++ b/recipes/simdjson/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(simdjson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE simdjson::simdjson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/simdjson/all/test_package/conanfile.py b/recipes/simdjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/simdjson/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/simdjson/all/test_package/test_package.cpp b/recipes/simdjson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..60ed17bca2233 --- /dev/null +++ b/recipes/simdjson/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include "simdjson.h" +#include +#include + +int main() { + std::string mystring = "{ \"hello\": \"simdjson\" }"; + simdjson::dom::parser parser; + std::string_view string_value; + auto error = parser.parse(mystring)["hello"].get(string_value); + if (error) { + std::cerr << error << std::endl; + return EXIT_FAILURE; + } + if (string_value != "simdjson") { + std::cerr << string_value << std::endl; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/simdjson/all/test_v1_package/CMakeLists.txt b/recipes/simdjson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/simdjson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/simdjson/all/test_v1_package/conanfile.py b/recipes/simdjson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/simdjson/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/simdjson/config.yml b/recipes/simdjson/config.yml new file mode 100644 index 0000000000000..6327300ad07ec --- /dev/null +++ b/recipes/simdjson/config.yml @@ -0,0 +1,27 @@ +versions: + "3.1.8": + folder: all + "3.1.7": + folder: all + "3.1.5": + folder: all + "3.1.1": + folder: all + "3.1.0": + folder: all + "3.0.1": + folder: all + "3.0.0": + folder: all + "2.2.3": + folder: all + "2.1.0": + folder: all + "2.0.4": + folder: all + "1.1.0": + folder: all + "1.0.2": + folder: all + "0.9.7": + folder: all diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml new file mode 100644 index 0000000000000..ccc7fafd76088 --- /dev/null +++ b/recipes/simdutf/all/conandata.yml @@ -0,0 +1,78 @@ +sources: + "3.2.2": + url: "https://github.com/simdutf/simdutf/archive/v3.2.2.tar.gz" + sha256: "5a5c84c05bf30d681126d1dcbde903615f2c927e201e0c6d489f74a91b7f506f" + "3.2.0": + url: "https://github.com/simdutf/simdutf/archive/v3.2.0.tar.gz" + sha256: "0d9f63e2f308b6b54f399ebbe3a02776b902a2670c88c28de2d75ea2197dc4e9" + "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" + "2.1.0": + url: "https://github.com/simdutf/simdutf/archive/v2.1.0.tar.gz" + sha256: "a8a8bbd71c8d8be1f7da16722776988d0640758fe0a46066eb3129868dad08da" + "2.0.9": + url: "https://github.com/simdutf/simdutf/archive/v2.0.9.tar.gz" + sha256: "ff6a19de4c23671e7f1077cf6c0f60bc01197f29c6e4f56fa485c9cd732576ac" + "2.0.8": + url: "https://github.com/simdutf/simdutf/archive/v2.0.8.tar.gz" + sha256: "bd7aa550a8d9a1aba2c0b4eb2088f90c964375b13394f9076f7ba49f51dc40b5" + "2.0.6": + url: "https://github.com/simdutf/simdutf/archive/v2.0.6.tar.gz" + sha256: "40f1f9a4403f81c2c3d736ef9c73662835b2241871caa262fcd654e0898f9e4e" + "1.0.1": + url: "https://github.com/simdutf/simdutf/archive/v1.0.1.tar.gz" + sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" +patches: + "3.2.2": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + "3.2.0": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + 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" + "2.1.0": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + "2.0.9": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + "2.0.8": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + "2.0.6": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + - patch_file: "patches/2.0.6-0002-add-workaround-gcc9.patch" + patch_description: "apply gcc8 workaround to gcc9" + patch_type: "portability" + "1.0.1": + - patch_file: "patches/1.0.1-0001-fix-cmake.patch" + patch_description: "disable test and benchmark build and enable rpath on macOS" + patch_type: "conan" + - patch_file: "patches/1.0.1-0002-remove-static.patch" + patch_description: "remove static build only" + patch_type: "conan" diff --git a/recipes/simdutf/all/conanfile.py b/recipes/simdutf/all/conanfile.py new file mode 100644 index 0000000000000..6bdedd0dd5b54 --- /dev/null +++ b/recipes/simdutf/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + +class SimdutfConan(ConanFile): + name = "simdutf" + description = "Unicode routines (UTF8, UTF16): billions of characters per second." + license = ("Apache-2.0", "MIT") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/simdutf/simdutf" + topics = ("unicode", "transcoding", "neon", "simd", "avx2", "sse2", "utf8", "utf16", ) + 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 export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + 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["SIMDUTF_BENCHMARKS"] = False + tc.variables["BUILD_TESTING"] = False + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "8": + tc.variables["CMAKE_CXX_FLAGS"] = " -mavx512f" + if Version(self.version) >= "2.0.3": + tc.variables["SIMDUTF_TOOLS"] = 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, 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 = ["simdutf"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..7110c904b0efe --- /dev/null +++ b/recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cb8fb1f..66f76ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,17 +14,17 @@ include(cmake/simdutf-flags.cmake) + + set(SIMDUTF_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + +-enable_testing() ++#enable_testing() + add_subdirectory(src) +-add_subdirectory(tests) ++# add_subdirectory(tests) + + + +-if(CMAKE_CXX_COMPILER_ID MATCHES GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) +- message(STATUS "The benchmark tool requires GCC 8.0 or better.") +-else() +- add_subdirectory(benchmarks) +-endif() ++#if(CMAKE_CXX_COMPILER_ID MATCHES GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) ++# message(STATUS "The benchmark tool requires GCC 8.0 or better.") ++#else() ++# add_subdirectory(benchmarks) ++#endif() + + + # ---- Install rules ---- +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/recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch b/recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch new file mode 100644 index 0000000000000..cdc06b6c7fd09 --- /dev/null +++ b/recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 4322f3f..476fd35 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 "$") + 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 new file mode 100644 index 0000000000000..6bedd6c48eb5d --- /dev/null +++ b/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +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/2.0.6-0002-add-workaround-gcc9.patch b/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch new file mode 100644 index 0000000000000..957a9759ee2fa --- /dev/null +++ b/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch @@ -0,0 +1,42 @@ +diff --git a/src/icelake/icelake_utf8_common.inl.cpp b/src/icelake/icelake_utf8_common.inl.cpp +index 962700b..a192a18 100644 +--- a/src/icelake/icelake_utf8_common.inl.cpp ++++ b/src/icelake/icelake_utf8_common.inl.cpp +@@ -448,12 +448,12 @@ __m512i prev(__m512i input, __m512i previous) { + static_assert(N<=32, "N must be no larger than 32"); + const __m512i movemask = _mm512_setr_epi32(28,29,30,31,0,1,2,3,4,5,6,7,8,9,10,11); + const __m512i rotated = _mm512_permutex2var_epi32(input, movemask, previous); +-#if SIMDUTF_GCC8 +- constexpr int shift = 16-N; // workaround for GCC8 ++#if SIMDUTF_GCC8 || SIMDUTF_GCC9 ++ constexpr int shift = 16-N; // workaround for GCC8,9 + return _mm512_alignr_epi8(input, rotated, shift); + #else + return _mm512_alignr_epi8(input, rotated, 16-N); +-#endif // SIMDUTF_GCC8 ++#endif // SIMDUTF_GCC8 || SIMDUTF_GCC9 + } + + template +diff --git a/src/simdutf/icelake/intrinsics.h b/src/simdutf/icelake/intrinsics.h +index c71a085..edcd289 100644 +--- a/src/simdutf/icelake/intrinsics.h ++++ b/src/simdutf/icelake/intrinsics.h +@@ -64,7 +64,9 @@ + #if defined(__GNUC__) && !defined(__clang__) + #if __GNUC__ == 8 + #define SIMDUTF_GCC8 1 +-#endif // __GNUC__ == 8 ++#elif __GNUC__ == 9 ++#define SIMDUTF_GCC9 1 ++#endif // __GNUC__ == 8 || __GNUC__ == 9 + #endif // defined(__GNUC__) && !defined(__clang__) + + #if SIMDUTF_GCC8 +@@ -83,4 +85,4 @@ inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, u + } + #endif // SIMDUTF_GCC8 + +-#endif // SIMDUTF_HASWELL_INTRINSICS_H +\ No newline at end of file ++#endif // SIMDUTF_HASWELL_INTRINSICS_H diff --git a/recipes/simdutf/all/test_package/CMakeLists.txt b/recipes/simdutf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ac41d27abf2c8 --- /dev/null +++ b/recipes/simdutf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(simdutf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE simdutf::simdutf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/simdutf/all/test_package/conanfile.py b/recipes/simdutf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/simdutf/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/simdutf/all/test_package/test_package.cpp b/recipes/simdutf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0ff8e03ca3610 --- /dev/null +++ b/recipes/simdutf/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "simdutf.h" + +#include + +int main() { + const char *source = "1234"; + // 4 == strlen(source) + bool validutf8 = simdutf::validate_utf8(source, 4); + if (validutf8) { + std::cout << "valid UTF-8" << std::endl; + } else { + std::cerr << "invalid UTF-8" << std::endl; + return 1; + } + + return 0; +} diff --git a/recipes/simdutf/all/test_v1_package/CMakeLists.txt b/recipes/simdutf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b4c2f89fe6420 --- /dev/null +++ b/recipes/simdutf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(simdutf REQUIRED CONFIG) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/simdutf/all/test_v1_package/conanfile.py b/recipes/simdutf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/simdutf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml new file mode 100644 index 0000000000000..c0a677b2e1801 --- /dev/null +++ b/recipes/simdutf/config.yml @@ -0,0 +1,21 @@ +versions: + "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 + "2.1.0": + folder: all + "2.0.9": + folder: all + "2.0.8": + folder: all + "2.0.6": + folder: all + "1.0.1": + folder: all diff --git a/recipes/simple-websocket-server/all/conandata.yml b/recipes/simple-websocket-server/all/conandata.yml new file mode 100644 index 0000000000000..9ba26f276a6a1 --- /dev/null +++ b/recipes/simple-websocket-server/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.0.0": + sha256: EE0C626B7BC54FC4133B134325B00911084A5919D373C4A4FB3B3ACB2BF1D2E4 + url: https://gitlab.com/eidheim/Simple-WebSocket-Server/-/archive/v2.0.0/Simple-WebSocket-Server-v2.0.0.tar.gz + "2.0.1": + sha256: 1BF1F83F8A9B3AA723C1E23D5BB6B8DCB91AACD7A80C9322A801200B3E3D68E5 + url: https://gitlab.com/eidheim/Simple-WebSocket-Server/-/archive/v2.0.1/Simple-WebSocket-Server-v2.0.1.tar.gz + "2.0.2": + sha256: 10FD2AC26325297386D306A8AB6CFFF07D14E4C7CB0C866BCC160778CAD83650 + url: https://gitlab.com/eidheim/Simple-WebSocket-Server/-/archive/v2.0.2/Simple-WebSocket-Server-v2.0.2.tar.gz diff --git a/recipes/simple-websocket-server/all/conanfile.py b/recipes/simple-websocket-server/all/conanfile.py new file mode 100644 index 0000000000000..7af11bfe301d4 --- /dev/null +++ b/recipes/simple-websocket-server/all/conanfile.py @@ -0,0 +1,65 @@ +import os + +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class SimpleWebSocketServerConan(ConanFile): + name = "simple-websocket-server" + homepage = "https://gitlab.com/eidheim/Simple-WebSocket-Server" + description = "A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library." + topics = ("websocket", "socket", "server", "client", "header-only") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "arch", "build_type" + no_copy_source = True + license = "MIT" + options = { + "use_asio_standalone": [True, False], + } + default_options = { + "use_asio_standalone": True, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("openssl/1.1.1q") + # only version 2.0.2 upwards is able to build against asio 1.18.0 or higher + if tools.Version(self.version) <= "2.0.1": + if self.options.use_asio_standalone: + self.requires("asio/1.16.1") + else: + self.requires("boost/1.73.0") + else: + if self.options.use_asio_standalone: + self.requires("asio/1.23.0") + else: + self.requires("boost/1.79.0") + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "11") + + def build(self): + if tools.Version(self.version) <= "2.0.1" and "asio" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["asio"].version) >= "1.18.0": + raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require asio < 1.18.0") + elif tools.Version(self.version) <= "2.0.1" and "boost" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["boost"].version) >= "1.74.0": + raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require boost < 1.74.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "Simple-WebSocket-Server-v" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.hpp", dst=os.path.join("include", "simple-websocket-server"), src=self._source_subfolder) + + def package_info(self): + if self.options.use_asio_standalone: + self.cpp_info.defines.append('USE_STANDALONE_ASIO') + + def package_id(self): + self.info.header_only() diff --git a/recipes/simple-websocket-server/all/test_package/CMakeLists.txt b/recipes/simple-websocket-server/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d50531ac251fb --- /dev/null +++ b/recipes/simple-websocket-server/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties( + ${PROJECT_NAME} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON +) diff --git a/recipes/simple-websocket-server/all/test_package/conanfile.py b/recipes/simple-websocket-server/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/simple-websocket-server/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/simple-websocket-server/all/test_package/test_package.cpp b/recipes/simple-websocket-server/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b3777c1e7390e --- /dev/null +++ b/recipes/simple-websocket-server/all/test_package/test_package.cpp @@ -0,0 +1,151 @@ +// (adapted) code taken from https://gitlab.com/eidheim/Simple-WebSocket-Server/blob/master/ws_examples.cpp +#include +#include + +using namespace std; + +using WsServer = SimpleWeb::SocketServer; +using WsClient = SimpleWeb::SocketClient; + +int main() { + // WebSocket (WS)-server at port 8080 using 1 thread + WsServer server; + server.config.port = 8080; + + // Example 1: echo WebSocket endpoint + // Added debug messages for example use of the callbacks + // Test with the following JavaScript: + // var ws=new WebSocket("ws://localhost:8080/echo"); + // ws.onmessage=function(evt){console.log(evt.data);}; + // ws.send("test"); + auto &echo = server.endpoint["^/echo/?$"]; + + echo.on_message = [](shared_ptr connection, shared_ptr in_message) { + auto out_message = in_message->string(); + + cout << "Server: Message received: \"" << out_message << "\" from " << connection.get() << endl; + + cout << "Server: Sending message \"" << out_message << "\" to " << connection.get() << endl; + + // connection->send is an asynchronous function + connection->send(out_message, [](const SimpleWeb::error_code &ec) { + if(ec) { + cout << "Server: Error sending message. " << + // See http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference.html, Error Codes for error code meanings + "Error: " << ec << ", error message: " << ec.message() << endl; + } + }); + + // Alternatively use streams: + // auto out_message = make_shared(); + // *out_message << in_message->string(); + // connection->send(out_message); + }; + + echo.on_open = [](shared_ptr connection) { + cout << "Server: Opened connection " << connection.get() << endl; + }; + + // See RFC 6455 7.4.1. for status codes + echo.on_close = [&server](shared_ptr connection, int status, const string & /*reason*/) { + cout << "Server: Closed connection " << connection.get() << " with status code " << status << endl; + server.stop(); + }; + + // Can modify handshake response headers here if needed + echo.on_handshake = [](shared_ptr /*connection*/, SimpleWeb::CaseInsensitiveMultimap & /*response_header*/) { + return SimpleWeb::StatusCode::information_switching_protocols; // Upgrade to websocket + }; + + // See http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference.html, Error Codes for error code meanings + echo.on_error = [&server](shared_ptr connection, const SimpleWeb::error_code &ec) { + cout << "Server: Error in connection " << connection.get() << ". " + << "Error: " << ec << ", error message: " << ec.message() << endl; + server.stop(); + }; + + // Example 2: Echo thrice + // Demonstrating queuing of messages by sending a received message three times back to the client. + // Concurrent send operations are automatically queued by the library. + // Test with the following JavaScript: + // var ws=new WebSocket("ws://localhost:8080/echo_thrice"); + // ws.onmessage=function(evt){console.log(evt.data);}; + // ws.send("test"); + auto &echo_thrice = server.endpoint["^/echo_thrice/?$"]; + echo_thrice.on_message = [](shared_ptr connection, shared_ptr in_message) { + auto out_message = make_shared(in_message->string()); + + connection->send(*out_message, [connection, out_message](const SimpleWeb::error_code &ec) { + if(!ec) + connection->send(*out_message); // Sent after the first send operation is finished + }); + connection->send(*out_message); // Most likely queued. Sent after the first send operation is finished. + }; + + // Example 3: Echo to all WebSocket endpoints + // Sending received messages to all connected clients + // Test with the following JavaScript on more than one browser windows: + // var ws=new WebSocket("ws://localhost:8080/echo_all"); + // ws.onmessage=function(evt){console.log(evt.data);}; + // ws.send("test"); + auto &echo_all = server.endpoint["^/echo_all/?$"]; + echo_all.on_message = [&server](shared_ptr /*connection*/, shared_ptr in_message) { + auto out_message = in_message->string(); + + // echo_all.get_connections() can also be used to solely receive connections on this endpoint + for(auto &a_connection : server.get_connections()) + a_connection->send(out_message); + }; + + thread server_thread([&server]() { + // Start WS-server + server.start(); + }); + + // Wait for server to start so that the client can connect + this_thread::sleep_for(chrono::seconds(1)); + + // Example 4: Client communication with server + // Possible output: + // Server: Opened connection 0x7fcf21600380 + // Client: Opened connection + // Client: Sending message: "Hello" + // Server: Message received: "Hello" from 0x7fcf21600380 + // Server: Sending message "Hello" to 0x7fcf21600380 + // Client: Message received: "Hello" + // Client: Sending close connection + // Server: Closed connection 0x7fcf21600380 with status code 1000 + // Client: Closed connection with status code 1000 + WsClient client("localhost:8080/echo"); + client.on_message = [](shared_ptr connection, shared_ptr in_message) { + cout << "Client: Message received: \"" << in_message->string() << "\"" << endl; + + cout << "Client: Sending close connection" << endl; + connection->send_close(1000); + }; + + client.on_open = [](shared_ptr connection) { + cout << "Client: Opened connection" << endl; + + string out_message("Hello"); + cout << "Client: Sending message: \"" << out_message << "\"" << endl; + + connection->send(out_message); + }; + + client.on_close = [&client](shared_ptr /*connection*/, int status, const string & /*reason*/) { + cout << "Client: Closed connection with status code " << status << endl; + client.stop(); + }; + + // See http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference.html, Error Codes for error code meanings + client.on_error = [&client](shared_ptr /*connection*/, const SimpleWeb::error_code &ec) { + cout << "Client: Error: " << ec << ", error message: " << ec.message() << endl; + client.stop(); + }; + + client.start(); + + server_thread.join(); + return 0; +} diff --git a/recipes/simple-websocket-server/config.yml b/recipes/simple-websocket-server/config.yml new file mode 100644 index 0000000000000..b3765aec2e4a2 --- /dev/null +++ b/recipes/simple-websocket-server/config.yml @@ -0,0 +1,8 @@ +--- +versions: + "2.0.0": + folder: all + "2.0.1": + folder: all + "2.0.2": + folder: all diff --git a/recipes/simple-yaml/all/conandata.yml b/recipes/simple-yaml/all/conandata.yml new file mode 100644 index 0000000000000..945907a204f51 --- /dev/null +++ b/recipes/simple-yaml/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.2": + url: "https://github.com/Rechip/simple-yaml/archive/refs/tags/v0.2.2.zip" + sha256: "7df6a5f15d83dfcff1eac87d14b39cf457e93a6586f888677f408b8884cebada" diff --git a/recipes/simple-yaml/all/conanfile.py b/recipes/simple-yaml/all/conanfile.py new file mode 100644 index 0000000000000..fea9f3e7e071f --- /dev/null +++ b/recipes/simple-yaml/all/conanfile.py @@ -0,0 +1,74 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class SimpleYamlConan(ConanFile): + name = "simple-yaml" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Rechip/simple-yaml" + description = "Read configuration files in YAML format by code structure" + topics = ("cpp", "yaml", "configuration") + settings = ["compiler"] + no_copy_source = True + + options = { + "enable_enum": [True, False], + } + default_options = { + "enable_enum": True + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def requirements(self): + self.requires("pretty-name/1.0.0") + self.requires("yaml-cpp/0.7.0") + self.requires("source_location/0.2.0") + if self.options.enable_enum: + self.requires("magic_enum/0.7.3") + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + self.copy(pattern="*", dst="include", + src=os.path.join(self._source_subfolder, "include")) + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16.3", + "gcc": "10", + "clang": "11", + "apple-clang": "13.3", + } + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "20") + 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") + minimum_version = self._minimum_compilers_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warn( + "simple-yaml requires C++20. Your compiler is unknown. Assuming it fully supports C++20.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + "simple-yaml requires C++20, which your compiler does not support.") + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "simple-yaml" + self.cpp_info.names["cmake_find_package_multi"] = "simple-yaml" diff --git a/recipes/simple-yaml/all/test_package/CMakeLists.txt b/recipes/simple-yaml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..506dba003a47f --- /dev/null +++ b/recipes/simple-yaml/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(simple-yaml CONFIG REQUIRED) +add_executable(${PROJECT_NAME} src/test.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE simple-yaml::simple-yaml) + +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) diff --git a/recipes/simple-yaml/all/test_package/conanfile.py b/recipes/simple-yaml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/simple-yaml/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + self.cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/simple-yaml/all/test_package/src/test.cpp b/recipes/simple-yaml/all/test_package/src/test.cpp new file mode 100644 index 0000000000000..c3a5d5525e783 --- /dev/null +++ b/recipes/simple-yaml/all/test_package/src/test.cpp @@ -0,0 +1,21 @@ +#include +#include +#include + +struct Test : public simple_yaml::Simple { + using Simple::Simple; + + int a = bound("a"); + std::string b = bound("b"); +}; + +const std::string source{R"( +a: 1 +b: hello +)"}; + +int main() { + Test test{simple_yaml::fromString(source)}; + + return test.a == 1 && test.b == "hello" ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/simple-yaml/config.yml b/recipes/simple-yaml/config.yml new file mode 100644 index 0000000000000..cd4b8da537c38 --- /dev/null +++ b/recipes/simple-yaml/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.2": + folder: all diff --git a/recipes/sjson-cpp/all/conandata.yml b/recipes/sjson-cpp/all/conandata.yml new file mode 100644 index 0000000000000..be9ad1f93084e --- /dev/null +++ b/recipes/sjson-cpp/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.8.3": + url: "https://github.com/nfrechette/sjson-cpp/archive/v0.8.3.tar.gz" + sha256: "3a6188bea5f00161a9e4508078f95637e303b3fce108c8dc9dc2a5b871d9e43d" + "0.8.2": + url: "https://github.com/nfrechette/sjson-cpp/archive/refs/tags/v0.8.2.tar.gz" + sha256: "1534da468abd4f5beeb35d64b68b7151542f198ab100f4063751c0a2379024e5" + "0.8.1": + url: "https://github.com/nfrechette/sjson-cpp/archive/v0.8.1.tar.gz" + sha256: "c171acff59b6e820c9df186f2c57d8e028f73a63ea31fd6d6f6d06bd90a477dd" + "0.7.0": + url: "https://github.com/nfrechette/sjson-cpp/archive/v0.7.0.tar.gz" + sha256: "7ab3297ba4d439454c47eb475be9e6242a10b9d18a13a6ba85bf904b16cfc7ce" diff --git a/recipes/sjson-cpp/all/conanfile.py b/recipes/sjson-cpp/all/conanfile.py new file mode 100644 index 0000000000000..98115a520a666 --- /dev/null +++ b/recipes/sjson-cpp/all/conanfile.py @@ -0,0 +1,34 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class SjsonCppConan(ConanFile): + name = "sjson-cpp" + description = "An Simplified JSON (SJSON) C++ reader and writer" + topics = ("json", "sjson", "simplified") + license = "MIT" + homepage = "https://github.com/nfrechette/sjson-cpp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) diff --git a/recipes/sjson-cpp/all/test_package/CMakeLists.txt b/recipes/sjson-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5f3393af5f9a --- /dev/null +++ b/recipes/sjson-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sjson-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} sjson-cpp::sjson-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sjson-cpp/all/test_package/conanfile.py b/recipes/sjson-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sjson-cpp/all/test_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/sjson-cpp/all/test_package/test_package.cpp b/recipes/sjson-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e8878b8006599 --- /dev/null +++ b/recipes/sjson-cpp/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +using namespace sjson; + +static Parser createParser(const char* c_str) +{ + return Parser(c_str, std::strlen(c_str)); +} + +int main() +{ + Parser parser = createParser("key = true"); + bool value = false; + parser.read("key", value); + + return 0; +} diff --git a/recipes/sjson-cpp/config.yml b/recipes/sjson-cpp/config.yml new file mode 100644 index 0000000000000..a3d24ea0c5588 --- /dev/null +++ b/recipes/sjson-cpp/config.yml @@ -0,0 +1,9 @@ +versions: + "0.8.3": + folder: "all" + "0.8.2": + folder: "all" + "0.8.1": + folder: "all" + "0.7.0": + folder: "all" diff --git a/recipes/skyr-url/all/CMakeLists.txt b/recipes/skyr-url/all/CMakeLists.txt new file mode 100644 index 0000000000000..16d33ed296f4b --- /dev/null +++ b/recipes/skyr-url/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory("source_subfolder") diff --git a/recipes/skyr-url/all/conandata.yml b/recipes/skyr-url/all/conandata.yml new file mode 100644 index 0000000000000..25a1fe3b1c9e0 --- /dev/null +++ b/recipes/skyr-url/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.13.0": + url: "https://github.com/cpp-netlib/url/archive/v1.13.0.tar.gz" + sha256: "0c9e594f09a9abda5815b07b548ac520b2fc1044fc74b589fc4c5bd18ea4330c" + "1.12.0": + url: "https://github.com/cpp-netlib/url/archive/v1.12.0.tar.gz" + sha256: "42ede3666a4c40828aa74e4b35bf43dfc79de9329e6463ff90f9bb727b3a06f0" + +patches: + "1.13.0": + - patch_file: "patches/1.13.0-0001-fix-cmake.patch" + base_path: "source_subfolder" + "1.12.0": + - patch_file: "patches/1.12.0-0001-fix-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/skyr-url/all/conanfile.py b/recipes/skyr-url/all/conanfile.py new file mode 100644 index 0000000000000..d73a94e93ebb3 --- /dev/null +++ b/recipes/skyr-url/all/conanfile.py @@ -0,0 +1,134 @@ +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import functools + +required_conan_version = ">=1.45.0" + +class SkyrUrlConan(ConanFile): + name = "skyr-url" + description = "A C++ library that implements the WhatWG URL specification" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cpp-netlib.github.io/url" + topics = ("whatwg", "url", "parser") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_json": [True, False], + "with_fs": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_json": True, + "with_fs": True, + } + generators = "cmake", "cmake_find_package_multi" + _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 17 + + @property + def _minimum_compilers_version(self): + # https://github.com/cpp-netlib/url/tree/v1.12.0#requirements + return { + "Visual Studio": "16", + "gcc": "7", + "clang": "6" if tools.Version(self.version) <= "1.12.0" else "8", + "apple-clang": "10", + } + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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++17 support. The current compiler {} {} does not support it.".format( + self.name, self.settings.compiler, self.settings.compiler.version)) + + if self.options.with_fs and self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("apple-clang currently does not support with filesystem") + if self.settings.compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration("{} supports only libstdc++'s new ABI".format(self.name)) + + def requirements(self): + self.requires("tl-expected/1.0.0") + self.requires("range-v3/0.12.0") + if self.options.with_json: + self.requires("nlohmann_json/3.10.5") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["skyr_BUILD_TESTS"] = False + cmake.definitions["skyr_FULL_WARNINGS"] = False + cmake.definitions["skyr_WARNINGS_AS_ERRORS"] = False + cmake.definitions["skyr_ENABLE_JSON_FUNCTIONS"] = self.options.with_json + cmake.definitions["skyr_ENABLE_FILESYSTEM_FUNCTIONS"] = self.options.with_fs + if is_msvc(self): + cmake.definitions["skyr_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE_1_0.txt", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "skyr-url") + self.cpp_info.set_property("cmake_target_name", "skyr::skyr-url") + + self.cpp_info.components["url"].name = "skyr-url" + self.cpp_info.components["url"].libs = tools.collect_libs(self) + self.cpp_info.components["url"].requires = ["tl-expected::tl-expected", "range-v3::range-v3"] + if self.options.with_json: + self.cpp_info.components["url"].requires.append("nlohmann_json::nlohmann_json") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["url"].system_libs.append("m") + + self.cpp_info.filenames["cmake_find_package"] = "skyr-url" + self.cpp_info.filenames["cmake_find_package_multi"] = "skyr-url" + self.cpp_info.names["cmake_find_package"] = "skyr" + self.cpp_info.names["cmake_find_package_multi"] = "skyr" diff --git a/recipes/skyr-url/all/patches/1.12.0-0001-fix-cmake.patch b/recipes/skyr-url/all/patches/1.12.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..15a628c563e50 --- /dev/null +++ b/recipes/skyr-url/all/patches/1.12.0-0001-fix-cmake.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 835d112..712a288 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -101,8 +101,9 @@ endif() + install(TARGETS ${skyr_TARGETS} + EXPORT ${PROJECT_NAME}-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_DATADIR}" +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + install(EXPORT ${PROJECT_NAME}-targets + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 887d312..9db70d7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -14,7 +14,7 @@ configure_file( + # skyr-url + ################################################# + +-add_library(skyr-url STATIC) ++add_library(skyr-url) + + target_sources(skyr-url + PRIVATE +@@ -138,7 +138,7 @@ target_link_libraries( + skyr-url + PUBLIC + tl::expected +- range-v3 ++ range-v3::range-v3 + PRIVATE + $<${libcxx}:c++> + ) diff --git a/recipes/skyr-url/all/patches/1.13.0-0001-fix-cmake.patch b/recipes/skyr-url/all/patches/1.13.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e56eae0ce1240 --- /dev/null +++ b/recipes/skyr-url/all/patches/1.13.0-0001-fix-cmake.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b63ddc2..c87ced9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -101,8 +101,9 @@ endif() + install(TARGETS ${skyr_TARGETS} + EXPORT ${PROJECT_NAME}-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_DATADIR}" +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + install(EXPORT ${PROJECT_NAME}-targets + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 1bb02fa..f21f2c3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -14,7 +14,7 @@ configure_file( + # skyr-url + ################################################# + +-add_library(skyr-url STATIC) ++add_library(skyr-url) + + target_sources(skyr-url + PRIVATE +@@ -136,7 +136,7 @@ target_link_libraries( + skyr-url + PUBLIC + tl::expected +- range-v3 ++ range-v3::range-v3 + PRIVATE + $<${libcxx}:c++> + ) diff --git a/recipes/skyr-url/all/test_package/CMakeLists.txt b/recipes/skyr-url/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..96bec18bacbdc --- /dev/null +++ b/recipes/skyr-url/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(skyr-url CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} skyr::skyr-url) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/skyr-url/all/test_package/conanfile.py b/recipes/skyr-url/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5120e440ae5fb --- /dev/null +++ b/recipes/skyr-url/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/skyr-url/all/test_package/test_package.cpp b/recipes/skyr-url/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..57cd8871b3df1 --- /dev/null +++ b/recipes/skyr-url/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char *argv[]) { + using namespace skyr::literals; + + auto url = "http://sub.example:8090/paths/to/a/file"_url; + std::cout << url << std::endl; + std::cout << url.pathname() << std::endl; +} diff --git a/recipes/skyr-url/config.yml b/recipes/skyr-url/config.yml new file mode 100644 index 0000000000000..a857495745e47 --- /dev/null +++ b/recipes/skyr-url/config.yml @@ -0,0 +1,5 @@ +versions: + "1.13.0": + folder: all + "1.12.0": + folder: all diff --git a/recipes/sleef/all/CMakeLists.txt b/recipes/sleef/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/sleef/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/sleef/all/conandata.yml b/recipes/sleef/all/conandata.yml new file mode 100644 index 0000000000000..d1737a7a842cf --- /dev/null +++ b/recipes/sleef/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.5.1": + url: "https://github.com/shibatch/sleef/archive/3.5.1.tar.gz" + sha256: "415ee9b1bcc5816989d3d4d92afd0cd3f9ee89cbd5a33eb008e69751e40438ab" diff --git a/recipes/sleef/all/conanfile.py b/recipes/sleef/all/conanfile.py new file mode 100644 index 0000000000000..0496b1b63c7cd --- /dev/null +++ b/recipes/sleef/all/conanfile.py @@ -0,0 +1,98 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.32.0" + + +class SleefConan(ConanFile): + name = "sleef" + description = "SLEEF is a library that implements vectorized versions " \ + "of C standard math functions." + license = "BSL-1.0" + topics = ("conan", "sleef", "vectorization", "simd") + homepage = "https://sleef.org" + 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, + } + + short_paths = True + + exports_sources = "CMakeLists.txt" + generators = "cmake" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("shared sleef not supported on Windows, it produces runtime errors") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["BUILD_STATIC_TEST_BINS"] = False + self._cmake.definitions["ENABLE_LTO"] = False + self._cmake.definitions["BUILD_LIBM"] = True + self._cmake.definitions["BUILD_DFT"] = False + self._cmake.definitions["BUILD_QUAD"] = False + self._cmake.definitions["BUILD_GNUABI_LIBS"] = False + self._cmake.definitions["BUILD_TESTS"] = False + self._cmake.definitions["BUILD_INLINE_HEADERS"] = False + self._cmake.definitions["SLEEF_TEST_ALL_IUT"] = False + self._cmake.definitions["SLEEF_SHOW_CONFIG"] = True + self._cmake.definitions["SLEEF_SHOW_ERROR_LOG"] = False + self._cmake.definitions["ENFORCE_TESTER"] = False + self._cmake.definitions["ENFORCE_TESTER3"] = False + self._cmake.definitions["ENABLE_ALTDIV"] = False + self._cmake.definitions["ENABLE_ALTSQRT"] = False + self._cmake.definitions["DISABLE_FFTW"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "sleef" + self.cpp_info.libs = ["sleef"] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines = ["SLEEF_STATIC_LIBS"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] diff --git a/recipes/sleef/all/test_package/CMakeLists.txt b/recipes/sleef/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/sleef/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/sleef/all/test_package/conanfile.py b/recipes/sleef/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5216332f39f5c --- /dev/null +++ b/recipes/sleef/all/test_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" + + 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/sleef/all/test_package/test_package.c b/recipes/sleef/all/test_package/test_package.c new file mode 100644 index 0000000000000..6138ea03dab52 --- /dev/null +++ b/recipes/sleef/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + printf("%f\n", Sleef_sqrt(130.0)); + return 0; +} diff --git a/recipes/sleef/config.yml b/recipes/sleef/config.yml new file mode 100644 index 0000000000000..2276d8a2cd6a8 --- /dev/null +++ b/recipes/sleef/config.yml @@ -0,0 +1,3 @@ +versions: + "3.5.1": + folder: all diff --git a/recipes/sml/all/conandata.yml b/recipes/sml/all/conandata.yml new file mode 100644 index 0000000000000..cfb630a1d7b27 --- /dev/null +++ b/recipes/sml/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.1.6": + url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.6.tar.gz" + sha256: "08a6d80eb9aa6ee4e462c1b802b9d7db8a39758746565f13cc4d2459ed49a29e" + "1.1.5": + url: "https://github.com/boost-ext/sml/archive/v1.1.5.tar.gz" + sha256: "b8106a28a275a9be7aa6ae49eb58396cc1b4e3c20afb472be8801af556e59cba" + "1.1.4": + url: "https://github.com/boost-ext/sml/archive/v1.1.4.tar.gz" + sha256: "897c78077f5a4d22b0de253b8689a8ea6d8adfba8d7b4877d6f5c76277e00976" +patches: + "1.1.4": + - patch_file: "patches/0001-fix-clang12-error.patch" diff --git a/recipes/sml/all/conanfile.py b/recipes/sml/all/conanfile.py new file mode 100644 index 0000000000000..ba7c5897722f0 --- /dev/null +++ b/recipes/sml/all/conanfile.py @@ -0,0 +1,70 @@ +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, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class SMLConan(ConanFile): + name = "sml" + homepage = "https://github.com/boost-ext/sml" + description = "SML: C++14 State Machine Library" + topics = ("state-machine", "metaprogramming", "design-patterns", "sml") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "14") + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sml") + self.cpp_info.set_property("cmake_target_name", "sml::sml") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/sml/all/patches/0001-fix-clang12-error.patch b/recipes/sml/all/patches/0001-fix-clang12-error.patch new file mode 100644 index 0000000000000..df7761176a44b --- /dev/null +++ b/recipes/sml/all/patches/0001-fix-clang12-error.patch @@ -0,0 +1,14 @@ +diff --git a/sml-1.1.4/include/boost/ b/sml-1.1.4/include/boost/ +index b75b41f..a4e6430 100644 + +--- a/include/boost/sml.hpp ++++ b/include/boost/sml.hpp +@@ -549,6 +549,8 @@ template + const char *get_type_name() { + #if defined(_MSC_VER) && !defined(__clang__) + return detail::get_type_name(__FUNCSIG__, make_index_sequence{}); ++#elif defined(__clang__) && __clang_major__ >= 12 ++ return detail::get_type_name(__PRETTY_FUNCTION__, make_index_sequence{}); + #elif defined(__clang__) + return detail::get_type_name(__PRETTY_FUNCTION__, make_index_sequence{}); + #elif defined(__GNUC__) diff --git a/recipes/sml/all/test_package/CMakeLists.txt b/recipes/sml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ab67ff60b5680 --- /dev/null +++ b/recipes/sml/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sml::sml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sml/all/test_package/conanfile.py b/recipes/sml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sml/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/sml/all/test_package/test_package.cpp b/recipes/sml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7994cf84cb160 --- /dev/null +++ b/recipes/sml/all/test_package/test_package.cpp @@ -0,0 +1,95 @@ +#include +#include + +namespace sml = boost::sml; + +namespace { +// events +struct release {}; +struct ack {}; +struct fin {}; +struct timeout {}; + +// guards +const auto is_ack_valid = [](const ack&) { return true; }; +const auto is_fin_valid = [](const fin&) { return true; }; + +// actions +const auto send_fin = [] {}; +const auto send_ack = [] {}; + +#if !defined(_MSC_VER) +struct hello_world { + auto operator()() const { + using namespace sml; + // clang-format off + return make_transition_table( + *"established"_s + event / send_fin = "fin wait 1"_s, + "fin wait 1"_s + event [ is_ack_valid ] = "fin wait 2"_s, + "fin wait 2"_s + event [ is_fin_valid ] / send_ack = "timed wait"_s, + "timed wait"_s + event / send_ack = X + ); + // clang-format on + } +}; +} + +int main() { + using namespace sml; + + sm sm; + // static_assert(1 == sizeof(sm), "sizeof(sm) != 1b"); + assert(sm.is("established"_s)); + + sm.process_event(release{}); + assert(sm.is("fin wait 1"_s)); + + sm.process_event(ack{}); + assert(sm.is("fin wait 2"_s)); + + sm.process_event(fin{}); + assert(sm.is("timed wait"_s)); + + sm.process_event(timeout{}); + assert(sm.is(X)); // released +} +#else +class established; +class fin_wait_1; +class fin_wait_2; +class timed_wait; + +struct hello_world { + auto operator()() const { + using namespace sml; + // clang-format off + return make_transition_table( + *state + event / send_fin = state, + state + event [ is_ack_valid ] = state, + state + event [ is_fin_valid ] / send_ack = state, + state + event / send_ack = X + ); + // clang-format on + } +}; +} + +int main() { + using namespace sml; + + sm sm; + assert(sm.is(state)); + + sm.process_event(release{}); + assert(sm.is(state)); + + sm.process_event(ack{}); + assert(sm.is(state)); + + sm.process_event(fin{}); + assert(sm.is(state)); + + sm.process_event(timeout{}); + assert(sm.is(X)); // released +} +#endif diff --git a/recipes/sml/all/test_v1_package/CMakeLists.txt b/recipes/sml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2ecfffc8e29bc --- /dev/null +++ b/recipes/sml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sml::sml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sml/all/test_v1_package/conanfile.py b/recipes/sml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sml/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/sml/config.yml b/recipes/sml/config.yml new file mode 100644 index 0000000000000..fa8612a6d0ffa --- /dev/null +++ b/recipes/sml/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.6": + folder: all + "1.1.5": + folder: all + "1.1.4": + folder: all diff --git a/recipes/snappy/all/conandata.yml b/recipes/snappy/all/conandata.yml new file mode 100644 index 0000000000000..1488c7a2baf50 --- /dev/null +++ b/recipes/snappy/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "1.1.10": + url: "https://github.com/google/snappy/archive/1.1.10.tar.gz" + sha256: "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90" + "1.1.9": + url: "https://github.com/google/snappy/archive/1.1.9.tar.gz" + sha256: "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7" + "1.1.8": + url: "https://github.com/google/snappy/archive/1.1.8.tar.gz" + sha256: "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f" + "1.1.7": + url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" + sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" +patches: + "1.1.10": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.1.10-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" + "1.1.9": + - patch_file: "patches/1.1.9-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.1.9-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" diff --git a/recipes/snappy/all/conanfile.py b/recipes/snappy/all/conanfile.py new file mode 100644 index 0000000000000..0ce00288cff64 --- /dev/null +++ b/recipes/snappy/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class SnappyConan(ConanFile): + name = "snappy" + description = "A fast compressor/decompressor" + topics = ("google", "compressor", "decompressor") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/snappy" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SNAPPY_BUILD_TESTS"] = False + if Version(self.version) >= "1.1.8": + tc.variables["SNAPPY_FUZZING_BUILD"] = False + # Don't use these avx options. These are useless. + # https://github.com/conan-io/conan-center-index/pull/16495 + tc.variables["SNAPPY_REQUIRE_AVX"] = False + tc.variables["SNAPPY_REQUIRE_AVX2"] = False + tc.variables["SNAPPY_INSTALL"] = True + if Version(self.version) >= "1.1.9": + tc.variables["SNAPPY_BUILD_BENCHMARKS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Snappy") + self.cpp_info.set_property("cmake_target_name", "Snappy::snappy") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["snappylib"].libs = ["snappy"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["snappylib"].system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["snappylib"].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Snappy" + self.cpp_info.names["cmake_find_package_multi"] = "Snappy" + self.cpp_info.components["snappylib"].names["cmake_find_package"] = "snappy" + self.cpp_info.components["snappylib"].names["cmake_find_package_multi"] = "snappy" + self.cpp_info.components["snappylib"].set_property("cmake_target_name", "Snappy::snappy") diff --git a/recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch b/recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch new file mode 100644 index 0000000000000..66b0f05521962 --- /dev/null +++ b/recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch @@ -0,0 +1,13 @@ +diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h +index 1548ed7..3b4a9f3 100644 +--- a/snappy-stubs-internal.h ++++ b/snappy-stubs-internal.h +@@ -100,7 +100,7 @@ + + // Inlining hints. + #if HAVE_ATTRIBUTE_ALWAYS_INLINE +-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) ++#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #else + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #endif // HAVE_ATTRIBUTE_ALWAYS_INLINE diff --git a/recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch b/recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000000000..969ce3805dadf --- /dev/null +++ b/recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,13 @@ +diff --git a/snappy.cc b/snappy.cc +index d414718..e4efb59 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1132,7 +1132,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) ++#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/recipes/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch b/recipes/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch new file mode 100644 index 0000000000000..cdc119c0d5846 --- /dev/null +++ b/recipes/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch @@ -0,0 +1,14 @@ +Fixes the following error: +error: inlining failed in call to ‘always_inline’ ‘size_t snappy::AdvanceToNextTag(const uint8_t**, size_t*)’: function body can be overwritten at link time + +--- snappy-stubs-internal.h ++++ snappy-stubs-internal.h +@@ -100,7 +100,7 @@ + + // Inlining hints. + #ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE +-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) ++#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #else + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #endif diff --git a/recipes/snappy/all/patches/1.1.9-0002-no-Werror.patch b/recipes/snappy/all/patches/1.1.9-0002-no-Werror.patch new file mode 100644 index 0000000000000..d86e4e0a9df76 --- /dev/null +++ b/recipes/snappy/all/patches/1.1.9-0002-no-Werror.patch @@ -0,0 +1,12 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -69,7 +69,7 @@ +- # Use -Werror for clang only. ++if(0) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- ++endif() diff --git a/recipes/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch b/recipes/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000000000..84bc674fdd5d1 --- /dev/null +++ b/recipes/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,12 @@ +asm clobbers do not work for clang < 9 and apple-clang < 11 (found by SpaceIm) +--- snappy.cc ++++ snappy.cc +@@ -1026,7 +1026,7 @@ + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GNUC__) && defined(__x86_64__) ++#if defined(__GNUC__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/recipes/snappy/all/patches/1.1.9-0004-rtti-by-default.patch b/recipes/snappy/all/patches/1.1.9-0004-rtti-by-default.patch new file mode 100644 index 0000000000000..c353a489d0ecf --- /dev/null +++ b/recipes/snappy/all/patches/1.1.9-0004-rtti-by-default.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -78,8 +76,6 @@ endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/recipes/snappy/all/test_package/CMakeLists.txt b/recipes/snappy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a0fd3f83d2c67 --- /dev/null +++ b/recipes/snappy/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(Snappy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Snappy::snappy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE Snappy::snappy) diff --git a/recipes/snappy/all/test_package/conanfile.py b/recipes/snappy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..543039a6ab53c --- /dev/null +++ b/recipes/snappy/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") diff --git a/recipes/snappy/all/test_package/test_package.c b/recipes/snappy/all/test_package/test_package.c new file mode 100644 index 0000000000000..79754cd43a894 --- /dev/null +++ b/recipes/snappy/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include +#include +#include +#include + +int main() { + const char *input = "conan-center-index"; + size_t input_length = strlen(input); + size_t output_length = snappy_max_compressed_length(input_length); + char *output = (char*)malloc(output_length); + if (output == NULL) return 0; + if (snappy_compress(input, input_length, output, &output_length) == SNAPPY_OK) { + printf("%s compressed: %s\n", input, output); + } + free(output); + return 0; +} diff --git a/recipes/snappy/all/test_package/test_package.cpp b/recipes/snappy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4aa37e87f4954 --- /dev/null +++ b/recipes/snappy/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include +#include + +int main() { + std::string input("conan-enter-index"); + std::string output; + + const size_t result = snappy::Compress(input.c_str(), input.size(), &output); + + std::cout << input << " compressed (" << result << "): " << output << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/snappy/all/test_v1_package/CMakeLists.txt b/recipes/snappy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/snappy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/snappy/all/test_v1_package/conanfile.py b/recipes/snappy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..00d8ab9e282f8 --- /dev/null +++ b/recipes/snappy/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) diff --git a/recipes/snappy/config.yml b/recipes/snappy/config.yml new file mode 100644 index 0000000000000..521a59e91e109 --- /dev/null +++ b/recipes/snappy/config.yml @@ -0,0 +1,9 @@ +versions: + "1.1.10": + folder: all + "1.1.9": + folder: all + "1.1.8": + folder: all + "1.1.7": + folder: all diff --git a/recipes/snowhouse/all/conandata.yml b/recipes/snowhouse/all/conandata.yml new file mode 100644 index 0000000000000..daaf18781caf5 --- /dev/null +++ b/recipes/snowhouse/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "5.0.0": + url: "https://github.com/banditcpp/snowhouse/archive/v5.0.0.tar.gz" + sha256: "a1997eb1c170292bad5545ca5e65cb7c900bc49c0f9143672116777d24189b69" diff --git a/recipes/snowhouse/all/conanfile.py b/recipes/snowhouse/all/conanfile.py new file mode 100644 index 0000000000000..8bca8ddf11dc6 --- /dev/null +++ b/recipes/snowhouse/all/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class SnowHouseConan(ConanFile): + name = "snowhouse" + description = "An assertion library for C++" + topics = ("assertion", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/banditcpp/snowhouse" + license = "BSL-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/snowhouse/all/test_package/CMakeLists.txt b/recipes/snowhouse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/snowhouse/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/snowhouse/all/test_package/conanfile.py b/recipes/snowhouse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/snowhouse/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/snowhouse/all/test_package/test_package.cpp b/recipes/snowhouse/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..68f50d201cb25 --- /dev/null +++ b/recipes/snowhouse/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include + +using namespace snowhouse; + +int main() +{ + std::cout << "Testing that 23 is 23" << std::endl; + AssertThat(23, Is().EqualTo(23)); + + try + { + AssertThat(12, Is().LessThan(11).And().GreaterThan(99)); + return -1; + } + catch (const AssertionException& ex) + { + std::cout << "Apparently this failed:" << std::endl; + std::cout << ex.what() << std::endl; + } + + return 0; +} + diff --git a/recipes/snowhouse/config.yml b/recipes/snowhouse/config.yml new file mode 100644 index 0000000000000..016355a0ff605 --- /dev/null +++ b/recipes/snowhouse/config.yml @@ -0,0 +1,3 @@ +versions: + "5.0.0": + folder: "all" diff --git a/recipes/so5extra/all/conandata.yml b/recipes/so5extra/all/conandata.yml new file mode 100644 index 0000000000000..18c9023e61809 --- /dev/null +++ b/recipes/so5extra/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.5.2": + url: "https://github.com/Stiffstream/so5extra/archive/v.1.5.2.tar.gz" + sha256: "5409dc255c970d2085381ceded122b80b9ac896a34bafc5ffc431bae304d485d" + "1.5.1": + url: "https://github.com/Stiffstream/so5extra/archive/v.1.5.1.tar.gz" + sha256: "5cdacb07bafb4e8b76c1b642946705b3a65e3f71d66ae3cd915e4da41fdabf30" + "1.5.0": + url: "https://github.com/Stiffstream/so5extra/archive/v.1.5.0.tar.gz" + sha256: "4dc9f4b98becdae91e2873ca95606755622f0e0b0cb6c526fe3785a2855f5207" + "1.4.1.1": + url: "https://github.com/Stiffstream/so5extra/archive/v.1.4.1.1.tar.gz" + sha256: "f5f65e20ee2f1c438f5c5a211b3f182ac3ca8709e1c7aa6a2d87d0180dd3cd30" + "1.4.1": + url: "https://github.com/Stiffstream/so5extra/archive/v.1.4.1.tar.gz" + sha256: "d500967b4c444e4f548349b6fd28ea877471e45bcf43606b6ff7d2a9f4cfd733" diff --git a/recipes/so5extra/all/conanfile.py b/recipes/so5extra/all/conanfile.py new file mode 100644 index 0000000000000..080aef9395558 --- /dev/null +++ b/recipes/so5extra/all/conanfile.py @@ -0,0 +1,70 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class So5extraConan(ConanFile): + name = "so5extra" + license = "BSD-3-Clause" + homepage = "https://github.com/Stiffstream/so5extra" + url = "https://github.com/conan-io/conan-center-index" + description = "A collection of various SObjectizer's extensions." + topics = ("concurrency", "actor-framework", "actors", "agents", "sobjectizer") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("sobjectizer/5.7.4") + + def validate(self): + minimal_cpp_standard = "17" + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warn( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*.hpp", dst="include/so_5_extra", src=os.path.join(self._source_subfolder, "dev", "so_5_extra")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "so5extra") + self.cpp_info.set_property("cmake_target_name", "sobjectizer::so5extra") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "so5extra" + self.cpp_info.filenames["cmake_find_package_multi"] = "so5extra" + self.cpp_info.names["cmake_find_package"] = "sobjectizer" + self.cpp_info.names["cmake_find_package_multi"] = "sobjectizer" + self.cpp_info.components["so_5_extra"].names["cmake_find_package"] = "so5extra" + self.cpp_info.components["so_5_extra"].names["cmake_find_package_multi"] = "so5extra" + self.cpp_info.components["so_5_extra"].set_property("cmake_target_name", "sobjectizer::so5extra") + self.cpp_info.components["so_5_extra"].requires = ["sobjectizer::sobjectizer"] diff --git a/recipes/so5extra/all/test_package/CMakeLists.txt b/recipes/so5extra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..933e0f59b04bd --- /dev/null +++ b/recipes/so5extra/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(so5extra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} sobjectizer::so5extra) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/so5extra/all/test_package/conanfile.py b/recipes/so5extra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/so5extra/all/test_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/so5extra/all/test_package/test_package.cpp b/recipes/so5extra/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ad0c2d6475b9c --- /dev/null +++ b/recipes/so5extra/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ +/* + * Usage of select() with send_case() for calculation of Fibonacci numbers. + */ + +#include + +#include + +#include + +using namespace std; +using namespace std::chrono_literals; +using namespace so_5; + +struct quit {}; + +void fibonacci( mchain_t values_ch, mchain_t quit_ch ) +{ + int x = 0, y = 1; + mchain_select_result_t r; + do + { + r = select( + from_all().handle_n(1), + // Sends a new message of type 'int' with value 'x' inside + // when values_ch is ready for a new outgoing message. + send_case( values_ch, message_holder_t::make(x), + [&x, &y] { // This block of code will be called after the send(). + auto old_x = x; + x = y; y = old_x + y; + } ), + // Receive a 'quit' message from quit_ch if it is here. + receive_case( quit_ch, [](quit){} ) ); + } + // Continue the loop while we send something and receive nothing. + while( r.was_sent() && !r.was_handled() ); +} + +int main() +{ + wrapped_env_t sobj; + + thread fibonacci_thr; + auto thr_joiner = auto_join( fibonacci_thr ); + + // The chain for Fibonacci number will have limited capacity. + auto values_ch = extra::mchains::fixed_size::create_mchain<2>( + sobj.environment(), + 1s, // Wait no more than 1s on overflow. + mchain_props::overflow_reaction_t::abort_app ); + + // The chain for `quit` signal should contant no more than one message. + auto quit_ch = extra::mchains::fixed_size::create_mchain<1>( + sobj.environment(), + mchain_props::overflow_reaction_t::drop_newest ); + + auto ch_closer = auto_close_drop_content( values_ch, quit_ch ); + + fibonacci_thr = thread{ fibonacci, values_ch, quit_ch }; + + // Read the first 10 numbers from values_ch. + receive( from( values_ch ).handle_n( 10 ), + // And show every number to the standard output. + []( int v ) { cout << v << ' '; } ); + + send< quit >( quit_ch ); + + cout << std::endl; +} diff --git a/recipes/so5extra/config.yml b/recipes/so5extra/config.yml new file mode 100644 index 0000000000000..f77c4a7405ffe --- /dev/null +++ b/recipes/so5extra/config.yml @@ -0,0 +1,11 @@ +versions: + "1.5.2": + folder: all + "1.5.1": + folder: all + "1.5.0": + folder: all + "1.4.1.1": + folder: all + "1.4.1": + folder: all diff --git a/recipes/sobjectizer/all/CMakeLists.txt b/recipes/sobjectizer/all/CMakeLists.txt new file mode 100644 index 0000000000000..20ac539cce862 --- /dev/null +++ b/recipes/sobjectizer/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder/dev/so_5) diff --git a/recipes/sobjectizer/all/conandata.yml b/recipes/sobjectizer/all/conandata.yml new file mode 100644 index 0000000000000..edb04804cef50 --- /dev/null +++ b/recipes/sobjectizer/all/conandata.yml @@ -0,0 +1,29 @@ +sources: + "5.7.2.2": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.2.tar.gz" + sha256: "85f6cdd10bc4b05b8e7eeff7cd6eb76cc0338810114ba6d517163f143676054f" + "5.7.2.3": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.3.tar.gz" + sha256: "3dd3936fdd5443056fb0698477ad2b299c11b90ff6f551fa2dfb031a17930ee2" + "5.7.2.4": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.4.tar.gz" + sha256: "1ab370e430a1621c7f3ec8a530c3933efed1c5718953fbea214c1694fecc7128" + "5.7.2.5": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.5.tar.gz" + sha256: "0bf87f9a4ec631b2dd53033cbb9a8b84a09a8e499f4edf6504121c6a7d1ef459" + "5.7.2.6": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.6.tar.gz" + sha256: "62f1cfca8181bd60af2fb31b295471d0494b7ba72ab23e5a749bd70c9aa9e7b2" + "5.7.3": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.3.tar.gz" + sha256: "15ddaa69861e2853fb8888faf70766e7c56c3cf66a6293f72848e0909875a4c3" + "5.7.4": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.tar.gz" + sha256: "f032d071579d80fb423171d411ae0e33af0da46776ca0db7eb1d933c69fb0726" + + "5.7.4.1": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.1.tar.gz" + sha256: "9f5fb9d0be46d427be17f1c47cfa3d332dfe40877d1f9fafd38bcc05c46ff013" + "5.7.4.2": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.2.tar.gz" + sha256: "defaec29e135a21b1b279b1db8eb56993099a7368baae93e7ea1f3f79909f3d8" diff --git a/recipes/sobjectizer/all/conanfile.py b/recipes/sobjectizer/all/conanfile.py new file mode 100644 index 0000000000000..6ebed35c1f830 --- /dev/null +++ b/recipes/sobjectizer/all/conanfile.py @@ -0,0 +1,114 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class SobjectizerConan(ConanFile): + name = "sobjectizer" + license = "BSD-3-Clause" + homepage = "https://github.com/Stiffstream/sobjectizer" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "A framework for simplification of development of sophisticated " + "concurrent and event-driven applications in C++ " + "by using Actor, Publish-Subscribe and CSP models." + ) + topics = ("concurrency", "actor-framework", "actors", "agents", "actor-model", "publish-subscribe", "CSP") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + + def validate(self): + minimal_cpp_standard = "17" + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warn( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["SOBJECTIZER_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["SOBJECTIZER_BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["SOBJECTIZER_INSTALL"] = True + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("license*", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + cmake_target = "SharedLib" if self.options.shared else "StaticLib" + self.cpp_info.set_property("cmake_file_name", "sobjectizer") + self.cpp_info.set_property("cmake_target_name", "sobjectizer::{}".format(cmake_target)) + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_sobjectizer"].libs = tools.collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_sobjectizer"].system_libs = ["pthread", "m"] + if not self.options.shared: + self.cpp_info.components["_sobjectizer"].defines.append("SO_5_STATIC_LIB") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "sobjectizer" + self.cpp_info.names["cmake_find_package_multi"] = "sobjectizer" + self.cpp_info.components["_sobjectizer"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["_sobjectizer"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["_sobjectizer"].set_property("cmake_target_name", "sobjectizer::{}".format(cmake_target)) diff --git a/recipes/sobjectizer/all/test_package/CMakeLists.txt b/recipes/sobjectizer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a72279fda74f --- /dev/null +++ b/recipes/sobjectizer/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sobjectizer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(TARGET sobjectizer::SharedLib) + target_link_libraries(${PROJECT_NAME} sobjectizer::SharedLib) +else() + target_link_libraries(${PROJECT_NAME} sobjectizer::StaticLib) +endif() diff --git a/recipes/sobjectizer/all/test_package/conanfile.py b/recipes/sobjectizer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sobjectizer/all/test_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/sobjectizer/all/test_package/test_package.cpp b/recipes/sobjectizer/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2a1ca9c57a2f1 --- /dev/null +++ b/recipes/sobjectizer/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include + +#include + +class a_hello_t final : public so_5::agent_t +{ + public: + using so_5::agent_t::agent_t; + + // A reaction to start of work in SObjectizer. + void so_evt_start() override + { + std::cout << "Hello, world! This is SObjectizer v.5 (" + << SO_5_VERSION << ")" << std::endl; + + // Shutting down SObjectizer. + so_environment().stop(); + } + + // A reaction to finish of work in SObjectizer. + void so_evt_finish() override + { + std::cout << "Bye! This was SObjectizer v.5." << std::endl; + } +}; + +int main() +{ + try + { + so_5::launch( + []( so_5::environment_t & env ) { + env.register_agent_as_coop( env.make_agent< a_hello_t >() ); + } ); + } + catch( const std::exception & ex ) + { + std::cerr << "Error: " << ex.what() << std::endl; + return 1; + } + + return 0; +} diff --git a/recipes/sobjectizer/config.yml b/recipes/sobjectizer/config.yml new file mode 100644 index 0000000000000..9bfbd2833f9cd --- /dev/null +++ b/recipes/sobjectizer/config.yml @@ -0,0 +1,19 @@ +versions: + "5.7.2.2": + folder: all + "5.7.2.3": + folder: all + "5.7.2.4": + folder: all + "5.7.2.5": + folder: all + "5.7.2.6": + folder: all + "5.7.3": + folder: all + "5.7.4": + folder: all + "5.7.4.1": + folder: all + "5.7.4.2": + folder: all diff --git a/recipes/soci/all/conandata.yml b/recipes/soci/all/conandata.yml new file mode 100644 index 0000000000000..fec95012281aa --- /dev/null +++ b/recipes/soci/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "4.0.3": + url: "https://github.com/SOCI/soci/archive/v4.0.3.tar.gz" + sha256: "4b1ff9c8545c5d802fbe06ee6cd2886630e5c03bf740e269bb625b45cf934928" +patches: + "4.0.3": + - patch_file: "patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch" + patch_description: "Generate relocatable libraries on MacOS" + patch_type: "portability" diff --git a/recipes/soci/all/conanfile.py b/recipes/soci/all/conanfile.py new file mode 100644 index 0000000000000..6b15a39df0e5f --- /dev/null +++ b/recipes/soci/all/conanfile.py @@ -0,0 +1,217 @@ +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, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.55.0" + + +class SociConan(ConanFile): + name = "soci" + homepage = "https://github.com/SOCI/soci" + url = "https://github.com/conan-io/conan-center-index" + description = "The C++ Database Access Library " + topics = ("mysql", "odbc", "postgresql", "sqlite3") + license = "BSL-1.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "empty": [True, False], + "with_sqlite3": [True, False], + "with_db2": [True, False], + "with_odbc": [True, False], + "with_oracle": [True, False], + "with_firebird": [True, False], + "with_mysql": [True, False], + "with_postgresql": [True, False], + "with_boost": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "empty": False, + "with_sqlite3": False, + "with_db2": False, + "with_odbc": False, + "with_oracle": False, + "with_firebird": False, + "with_mysql": False, + "with_postgresql": False, + "with_boost": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + 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 requirements(self): + if self.options.with_sqlite3: + self.requires("sqlite3/3.41.1") + if self.options.with_odbc and self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.with_mysql: + self.requires("libmysqlclient/8.0.31") + if self.options.with_postgresql: + self.requires("libpq/14.7") + if self.options.with_boost: + self.requires("boost/1.81.0") + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "14", + "gcc": "4.8", + "clang": "3.8", + "apple-clang": "8.0" + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + compiler = str(self.settings.compiler) + compiler_version = Version(self.settings.compiler.version.value) + if compiler not in self._minimum_compilers_version: + self.output.warning("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) + elif compiler_version < self._minimum_compilers_version[compiler]: + raise ConanInvalidConfiguration("{} requires a {} version >= {}".format(self.name, compiler, compiler_version)) + + prefix = "Dependencies for" + message = "not configured in this conan package." + if self.options.with_db2: + # self.requires("db2/0.0.0") # TODO add support for db2 + raise ConanInvalidConfiguration("{} DB2 {} ".format(prefix, message)) + if self.options.with_oracle: + # self.requires("oracle_db/0.0.0") # TODO add support for oracle + raise ConanInvalidConfiguration("{} ORACLE {} ".format(prefix, message)) + if self.options.with_firebird: + # self.requires("firebird/0.0.0") # TODO add support for firebird + raise ConanInvalidConfiguration("{} firebird {} ".format(prefix, message)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + + # MacOS @rpath + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.variables["SOCI_SHARED"] = self.options.shared + tc.variables["SOCI_STATIC"] = not self.options.shared + tc.variables["SOCI_TESTS"] = False + tc.variables["SOCI_CXX11"] = True + tc.variables["SOCI_EMPTY"] = self.options.empty + tc.variables["WITH_SQLITE3"] = self.options.with_sqlite3 + tc.variables["WITH_DB2"] = self.options.with_db2 + tc.variables["WITH_ODBC"] = self.options.with_odbc + tc.variables["WITH_ORACLE"] = self.options.with_oracle + tc.variables["WITH_FIREBIRD"] = self.options.with_firebird + tc.variables["WITH_MYSQL"] = self.options.with_mysql + tc.variables["WITH_POSTGRESQL"] = self.options.with_postgresql + tc.variables["WITH_BOOST"] = self.options.with_boost + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("mysql", "cmake_file_name", "MYSQL") + deps.set_property("libpq", "cmake_file_name", "POSTGRESQL") + deps.set_property("sqlite3", "cmake_file_name", "SQLITE3") + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE_1_0.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.set_property("cmake_file_name", "SOCI") + + target_suffix = "" if self.options.shared else "_static" + lib_prefix = "lib" if is_msvc(self) and not self.options.shared else "" + version = Version(self.version) + lib_suffix = "_{}_{}".format(version.major, version.minor) if self.settings.os == "Windows" else "" + + # soci_core + self.cpp_info.components["soci_core"].set_property("cmake_target_name", "SOCI::soci_core{}".format(target_suffix)) + self.cpp_info.components["soci_core"].libs = ["{}soci_core{}".format(lib_prefix, lib_suffix)] + if self.options.with_boost: + self.cpp_info.components["soci_core"].requires.append("boost::boost") + + # soci_empty + if self.options.empty: + self.cpp_info.components["soci_empty"].set_property("cmake_target_name", "SOCI::soci_empty{}".format(target_suffix)) + self.cpp_info.components["soci_empty"].libs = ["{}soci_empty{}".format(lib_prefix, lib_suffix)] + self.cpp_info.components["soci_empty"].requires = ["soci_core"] + + # soci_sqlite3 + if self.options.with_sqlite3: + self.cpp_info.components["soci_sqlite3"].set_property("cmake_target_name", "SOCI::soci_sqlite3{}".format(target_suffix)) + self.cpp_info.components["soci_sqlite3"].libs = ["{}soci_sqlite3{}".format(lib_prefix, lib_suffix)] + self.cpp_info.components["soci_sqlite3"].requires = ["soci_core", "sqlite3::sqlite3"] + + # soci_odbc + if self.options.with_odbc: + self.cpp_info.components["soci_odbc"].set_property("cmake_target_name", "SOCI::soci_odbc{}".format(target_suffix)) + self.cpp_info.components["soci_odbc"].libs = ["{}soci_odbc{}".format(lib_prefix, lib_suffix)] + self.cpp_info.components["soci_odbc"].requires = ["soci_core"] + if self.settings.os == "Windows": + self.cpp_info.components["soci_odbc"].system_libs.append("odbc32") + else: + self.cpp_info.components["soci_odbc"].requires.append("odbc::odbc") + + # soci_mysql + if self.options.with_mysql: + self.cpp_info.components["soci_mysql"].set_property("cmake_target_name", "SOCI::soci_mysql{}".format(target_suffix)) + self.cpp_info.components["soci_mysql"].libs = ["{}soci_mysql{}".format(lib_prefix, lib_suffix)] + self.cpp_info.components["soci_mysql"].requires = ["soci_core", "libmysqlclient::libmysqlclient"] + + # soci_postgresql + if self.options.with_postgresql: + self.cpp_info.components["soci_postgresql"].set_property("cmake_target_name", "SOCI::soci_postgresql{}".format(target_suffix)) + self.cpp_info.components["soci_postgresql"].libs = ["{}soci_postgresql{}".format(lib_prefix, lib_suffix)] + self.cpp_info.components["soci_postgresql"].requires = ["soci_core", "libpq::libpq"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "SOCI" + self.cpp_info.names["cmake_find_package_multi"] = "SOCI" + self.cpp_info.components["soci_core"].names["cmake_find_package"] = "soci_core{}".format(target_suffix) + self.cpp_info.components["soci_core"].names["cmake_find_package_multi"] = "soci_core{}".format(target_suffix) + if self.options.empty: + self.cpp_info.components["soci_empty"].names["cmake_find_package"] = "soci_empty{}".format(target_suffix) + self.cpp_info.components["soci_empty"].names["cmake_find_package_multi"] = "soci_empty{}".format(target_suffix) + if self.options.with_sqlite3: + self.cpp_info.components["soci_sqlite3"].names["cmake_find_package"] = "soci_sqlite3{}".format(target_suffix) + self.cpp_info.components["soci_sqlite3"].names["cmake_find_package_multi"] = "soci_sqlite3{}".format(target_suffix) + if self.options.with_odbc: + self.cpp_info.components["soci_odbc"].names["cmake_find_package"] = "soci_odbc{}".format(target_suffix) + self.cpp_info.components["soci_odbc"].names["cmake_find_package_multi"] = "soci_odbc{}".format(target_suffix) + if self.options.with_mysql: + self.cpp_info.components["soci_mysql"].names["cmake_find_package"] = "soci_mysql{}".format(target_suffix) + self.cpp_info.components["soci_mysql"].names["cmake_find_package_multi"] = "soci_mysql{}".format(target_suffix) + if self.options.with_postgresql: + self.cpp_info.components["soci_postgresql"].names["cmake_find_package"] = "soci_postgresql{}".format(target_suffix) + self.cpp_info.components["soci_postgresql"].names["cmake_find_package_multi"] = "soci_postgresql{}".format(target_suffix) diff --git a/recipes/soci/all/patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch b/recipes/soci/all/patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch new file mode 100644 index 0000000000000..5de0027f7500e --- /dev/null +++ b/recipes/soci/all/patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch @@ -0,0 +1,39 @@ +From d491bf7b5040d314ffd0c6310ba01f78ff44c85e Mon Sep 17 00:00:00 2001 +From: Rasmus Thomsen +Date: Fri, 14 Apr 2023 09:16:29 +0200 +Subject: [PATCH] Remove hardcoded INSTALL_NAME_DIR for relocatable libraries + on MacOS + +--- + cmake/SociBackend.cmake | 2 +- + src/core/CMakeLists.txt | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake +index 5d4ef0df..39fe1f77 100644 +--- a/cmake/SociBackend.cmake ++++ b/cmake/SociBackend.cmake +@@ -171,7 +171,7 @@ macro(soci_backend NAME) + set_target_properties(${THIS_BACKEND_TARGET} + PROPERTIES + SOVERSION ${${PROJECT_NAME}_SOVERSION} +- INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib) ++ ) + + if(APPLE) + set_target_properties(${THIS_BACKEND_TARGET} +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 3e7deeae..f9eae564 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -59,7 +59,6 @@ if (SOCI_SHARED) + PROPERTIES + VERSION ${SOCI_VERSION} + SOVERSION ${SOCI_SOVERSION} +- INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib + CLEAN_DIRECT_OUTPUT 1) + endif() + +-- +2.25.1 + diff --git a/recipes/soci/all/test_package/CMakeLists.txt b/recipes/soci/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..070af95d1baf0 --- /dev/null +++ b/recipes/soci/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(SOCI REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET SOCI::soci_core_static) + target_link_libraries(${PROJECT_NAME} SOCI::soci_core_static) +else() + target_link_libraries(${PROJECT_NAME} SOCI::soci_core) +endif() +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/soci/all/test_package/conanfile.py b/recipes/soci/all/test_package/conanfile.py new file mode 100644 index 0000000000000..84eaa369e4a72 --- /dev/null +++ b/recipes/soci/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/soci/all/test_package/test_package.cpp b/recipes/soci/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8bae2bf204432 --- /dev/null +++ b/recipes/soci/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "soci/soci.h" +#include + +int main() +{ + const auto& connectString{"../database0.empty.db"}; + const auto& table{"table1"}; + std::cout << "soci database connected successfully\n"; + + return 0; +} diff --git a/recipes/soci/all/test_v1_package/CMakeLists.txt b/recipes/soci/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/soci/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/soci/all/test_v1_package/conanfile.py b/recipes/soci/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/soci/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/soci/config.yml b/recipes/soci/config.yml new file mode 100644 index 0000000000000..404a7ddf18bdf --- /dev/null +++ b/recipes/soci/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.3": + folder: all diff --git a/recipes/sofa/all/CMakeLists.txt b/recipes/sofa/all/CMakeLists.txt new file mode 100644 index 0000000000000..197cc26a04e81 --- /dev/null +++ b/recipes/sofa/all/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.4.3) +project(sofa C) + +include(GNUInstallDirs) + +if(NOT DEFINED SOFA_SRC_DIR) + message(FATAL_ERROR "SOFA_SRC_DIR must be set externally") +endif() + +file(GLOB SRC_FILES "${SOFA_SRC_DIR}/*.c") +list(REMOVE_ITEM SRC_FILES "${SOFA_SRC_DIR}/t_sofa_c.c") +add_library(sofa_c ${SRC_FILES}) + +set_target_properties(sofa_c PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +install( + TARGETS sofa_c + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +set(HEADER_FILES ${SOFA_SRC_DIR}/sofa.h ${SOFA_SRC_DIR}/sofam.h) +install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/sofa/all/conandata.yml b/recipes/sofa/all/conandata.yml new file mode 100644 index 0000000000000..7a99aaa5b5893 --- /dev/null +++ b/recipes/sofa/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "20210512": + url: "http://www.iausofa.org/2021_0512_C/sofa_c-20210512.tar.gz" + sha256: "3362baba47ce965af1fc6a3141052a0e1f643d186e8deca83df1ea97455bb2fd" + "20210125_a": + url: "http://www.iausofa.org/2021_0125_C/sofa_c-20210125_a.tar.gz" + sha256: "5eef8e167cfa71ebe0367abf8b3d73a0b6d264cff5bf35e0e7c733cc5b09d51d" + "20200721": + url: "http://www.iausofa.org/2020_0721_C/sofa_c-20200721.tar.gz" + sha256: "b10453f20567341171a455e8e1c70a2a7d4a61864aebf19f6fc746734a22efae" + "20190722": + url: "http://www.iausofa.org/2019_0722_C/sofa_c-20190722.tar.gz" + sha256: "a7063a140fdc78909f4d5ddf6b30143f9f60bfed7d5141047072515f51fa8647" diff --git a/recipes/sofa/all/conanfile.py b/recipes/sofa/all/conanfile.py new file mode 100644 index 0000000000000..353c0e47abe0e --- /dev/null +++ b/recipes/sofa/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, load, save +import os + +required_conan_version = ">=1.53.0" + + +class SofaConan(ConanFile): + name = "sofa" + description = "IAU Standards of Fundamental Astronomy (SOFA) C Library." + license = "SOFA Software License" + topics = ("iau", "astronomy") + homepage = "http://www.iausofa.org" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + @property + def _sofa_src_dir(self): + return os.path.join(self.source_folder, self.version, "c", "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") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SOFA_SRC_DIR"] = self._sofa_src_dir.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): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._get_license()) + cmake = CMake(self) + cmake.install() + + def _get_license(self): + sofa_header = load(self, os.path.join(self._sofa_src_dir, "sofa.h")) + begin = sofa_header.find("/*----------------------------------------------------------------------") + return sofa_header[begin:] + + def package_info(self): + self.cpp_info.libs = ["sofa_c"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/sofa/all/test_package/CMakeLists.txt b/recipes/sofa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e18d0ea3f0d4b --- /dev/null +++ b/recipes/sofa/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(sofa REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE sofa::sofa) diff --git a/recipes/sofa/all/test_package/conanfile.py b/recipes/sofa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sofa/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/sofa/all/test_package/test_package.c b/recipes/sofa/all/test_package/test_package.c new file mode 100644 index 0000000000000..079a993537c98 --- /dev/null +++ b/recipes/sofa/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + double epb = iauEpb(2415019.8135, 30103.18648); + printf("%f\n", epb); + + return 0; +} diff --git a/recipes/sofa/all/test_v1_package/CMakeLists.txt b/recipes/sofa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sofa/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sofa/all/test_v1_package/conanfile.py b/recipes/sofa/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sofa/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/sofa/config.yml b/recipes/sofa/config.yml new file mode 100644 index 0000000000000..de0c26b7bcf2a --- /dev/null +++ b/recipes/sofa/config.yml @@ -0,0 +1,9 @@ +versions: + "20210512": + folder: all + "20210125_a": + folder: all + "20200721": + folder: all + "20190722": + folder: all diff --git a/recipes/sokol/all/conandata.yml b/recipes/sokol/all/conandata.yml new file mode 100644 index 0000000000000..28862f2194627 --- /dev/null +++ b/recipes/sokol/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210304": + url: "https://github.com/floooh/sokol/archive/c5d55faa1036af9919bd28400e97d37548bb3789.zip" + sha256: e61c782e287543ffb8077ac24a7bfee05e867ee27f6c3e9487a2dbfa1ca2b466 diff --git a/recipes/sokol/all/conanfile.py b/recipes/sokol/all/conanfile.py new file mode 100644 index 0000000000000..e51b5f383cb38 --- /dev/null +++ b/recipes/sokol/all/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class SokolConan(ConanFile): + name = "sokol" + description = "Simple STB-style cross-platform libraries for C and C++, written in C." + topics = ("sokol", "graphics", "3d") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/floooh/sokol" + license = "Zlib" + 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) + + 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/sokol/all/test_package/CMakeLists.txt b/recipes/sokol/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ecaa904d9733e --- /dev/null +++ b/recipes/sokol/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(sokol REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE sokol::sokol) diff --git a/recipes/sokol/all/test_package/conanfile.py b/recipes/sokol/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sokol/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/sokol/all/test_package/test_package.c b/recipes/sokol/all/test_package/test_package.c new file mode 100644 index 0000000000000..40e4b3c31c04a --- /dev/null +++ b/recipes/sokol/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#define SOKOL_IMPL +#include "sokol_time.h" + +int main() +{ + stm_setup(); + uint64_t time_now = stm_now(); + double seconds = stm_sec(time_now); + return 0; +} diff --git a/recipes/sokol/all/test_v1_package/CMakeLists.txt b/recipes/sokol/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4999ac8ba67d0 --- /dev/null +++ b/recipes/sokol/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sokol REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE sokol::sokol) diff --git a/recipes/sokol/all/test_v1_package/conanfile.py b/recipes/sokol/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sokol/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/sokol/config.yml b/recipes/sokol/config.yml new file mode 100644 index 0000000000000..25320f6c19961 --- /dev/null +++ b/recipes/sokol/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210304": + folder: "all" diff --git a/recipes/sol2/all/conandata.yml b/recipes/sol2/all/conandata.yml new file mode 100644 index 0000000000000..aa516653323cf --- /dev/null +++ b/recipes/sol2/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.3.0": + url: "https://github.com/ThePhD/sol2/archive/v3.3.0.tar.gz" + sha256: "b82c5de030e18cb2bcbcefcd5f45afd526920c517a96413f0b59b4332d752a1e" + "3.2.3": + url: "https://github.com/ThePhD/sol2/archive/v3.2.3.tar.gz" + sha256: "f74158f92996f476786be9c9e83f8275129bb1da2a8d517d050421ac160a4b9e" + "3.0.3": + url: "https://github.com/ThePhD/sol2/archive/v3.0.3.tar.gz" + sha256: "bf089e50387edfc70063e24fd7fbb693cceba4a50147d864fabedd1b33483582" + "2.20.6": + url: "https://github.com/ThePhD/sol2/archive/v2.20.6.tar.gz" + sha256: "90c72e120cdd67d516434b51fdcff2d63cc25afe06fb7866fcf7f5bc85366808" diff --git a/recipes/sol2/all/conanfile.py b/recipes/sol2/all/conanfile.py new file mode 100644 index 0000000000000..93f899011d335 --- /dev/null +++ b/recipes/sol2/all/conanfile.py @@ -0,0 +1,117 @@ +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.50.0" + + +class Sol2Conan(ConanFile): + name = "sol2" + package_type = "header-library" + description = "a C++ <-> Lua API wrapper with advanced features and top notch performance" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ThePhD/sol2" + topics = ("lua", "c++", "bindings", "scripting") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + options = { + "with_lua": ["lua", "luajit"], + } + + default_options = { + "with_lua": "lua", + } + + @property + def _min_cppstd(self): + if Version(self.version) < "3.0.0": + # v2.x.x only requires C++14 + return "14" + else: + # v3.x.x and soon v4.x.x requires C++17 + return "17" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "Visual Studio": "14", + "msvc": "190", + "gcc": "5", + "clang": "3.2", + "apple-clang": "4.3", + }, + "17": { + "Visual Studio": "15" if Version(self.version) < "3.3.0" else "16", + "msvc": "191" if Version(self.version) < "3.3.0" else "192", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + }, + }.get(self._min_cppstd, {}) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_lua == "lua": + if Version(self.version) < "3.1.0": + # v2.x.x & v3.0.x supports up to Lua 5.3 + self.requires("lua/5.3.6") + else: + self.requires("lua/5.4.4") + elif self.options.with_lua == "luajit": + self.requires("luajit/2.1.0-beta3") + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "3.0.0": + copy(self, "*", src=os.path.join(self.source_folder, "sol"), dst=os.path.join(self.package_folder, "include", "sol")) + copy(self, "sol.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + else: + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "sol2") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.with_lua == "lua": + if self.dependencies["lua"].options.compile_as_cpp: + self.cpp_info.defines.append("SOL_USING_CXX_LUA=1") + self.cpp_info.requires.append("lua::lua") + elif self.options.with_lua == "luajit": + self.cpp_info.defines.append("SOL_LUAJIT") + self.cpp_info.requires.append("luajit::luajit") diff --git a/recipes/sol2/all/test_package/CMakeLists.txt b/recipes/sol2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..448e42cbd7124 --- /dev/null +++ b/recipes/sol2/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sol2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_link_libraries(${PROJECT_NAME} PRIVATE sol2::sol2) + +if(${sol2_CONSIDERED_VERSIONS} VERSION_GREATER_EQUAL "3.0.0") + # include path of sol.hpp is different in v2.x.x + target_compile_definitions(${PROJECT_NAME} PRIVATE SOL2_V3) +endif() diff --git a/recipes/sol2/all/test_package/conanfile.py b/recipes/sol2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c674a0b897ea4 --- /dev/null +++ b/recipes/sol2/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 = "VirtualRunEnv", "CMakeToolchain", "CMakeDeps" + 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/sol2/all/test_package/test_package.cpp b/recipes/sol2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7776234280248 --- /dev/null +++ b/recipes/sol2/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include + +#ifdef SOL2_V3 +#include +#else +#include +#endif + +int main() { + sol::state lua; + + auto bob_table = lua.create_table("bob"); + bob_table.set("is_set", 42); + + int is_set = bob_table.get_or("is_set", 3); + int is_not_set = bob_table.get_or("is_not_set", 22); + + if (is_set != 42 || is_not_set != 22) { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/sol2/all/test_v1_package/CMakeLists.txt b/recipes/sol2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..db5ac2a1312e0 --- /dev/null +++ b/recipes/sol2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +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/sol2/all/test_v1_package/conanfile.py b/recipes/sol2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sol2/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/sol2/config.yml b/recipes/sol2/config.yml new file mode 100644 index 0000000000000..28097c1cf11a2 --- /dev/null +++ b/recipes/sol2/config.yml @@ -0,0 +1,9 @@ +versions: + "3.3.0": + folder: "all" + "3.2.3": + folder: "all" + "3.0.3": + folder: "all" + "2.20.6": + folder: "all" diff --git a/recipes/sole/all/conandata.yml b/recipes/sole/all/conandata.yml new file mode 100644 index 0000000000000..865e82c642edb --- /dev/null +++ b/recipes/sole/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "1.0.4": + url: "https://github.com/r-lyeh-archived/sole/archive/1.0.4.tar.gz" + sha256: "2801bd0d275903bfa1086901eb887cfde844bafe5beea6c2a57f28de4e0540cc" + "1.0.2": + url: "https://github.com/r-lyeh-archived/sole/archive/1.0.2.tar.gz" + sha256: "ff82a1d6071cbc9c709864266210ddedecdb2b1e507ac5e7c4290ca6453e89b3" + "1.0.1": + sha256: 6b65a36df01b10079716288af530642cbe49abb2805ded1984c6564f471296bf + url: https://github.com/r-lyeh-archived/sole/archive/refs/tags/1.0.1.tar.gz + +patches: + "1.0.4": + - patch_file: "patches/1.0.4-0001-fix-clang-error.patch" + patch_description: "fix compilation error on clang/apple-clang" + patch_type: "backport" + patch_source: "https://github.com/r-lyeh-archived/sole/issues/42" diff --git a/recipes/sole/all/conanfile.py b/recipes/sole/all/conanfile.py new file mode 100644 index 0000000000000..e15d1c06c6dc1 --- /dev/null +++ b/recipes/sole/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.52.0" + +class SoleConan(ConanFile): + name = "sole" + description = "Sole is a lightweight C++11 library to generate universally unique identificators (UUID), both v1 and v4." + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/r-lyeh-archived/sole" + topics = ("uuid", "header-only") + settings = "os", "arch", "compiler", "build_type" + + 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, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, 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.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("rt") diff --git a/recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch b/recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch new file mode 100644 index 0000000000000..8e11dd3c1348b --- /dev/null +++ b/recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch @@ -0,0 +1,30 @@ +diff --git a/sole.hpp b/sole.hpp +index 8673774..35f2524 100644 +--- a/sole.hpp ++++ b/sole.hpp +@@ -201,6 +201,14 @@ namespace std { + # define $msvc $yes + #endif + ++#ifdef _MSC_VER ++# define $thread __declspec(thread) ++#elif defined __clang__ ++# define $thread thread_local ++#else ++# define $thread __thread ++#endif ++ + #if defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 < 50100) + namespace std + { +@@ -665,8 +673,8 @@ namespace sole { + // UUID implementations + + inline uuid uuid4() { +- static $msvc(__declspec(thread)) $melse(__thread) std::random_device rd; +- static $msvc(__declspec(thread)) $melse(__thread) std::uniform_int_distribution dist(0, (uint64_t)(~0)); ++ static $thread std::random_device rd; ++ static $thread std::uniform_int_distribution dist(0, (uint64_t)(~0)); + + uuid my; + diff --git a/recipes/sole/all/test_package/CMakeLists.txt b/recipes/sole/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..829b5ca81b9ce --- /dev/null +++ b/recipes/sole/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/sole/all/test_package/conanfile.py b/recipes/sole/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/sole/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sole/all/test_package/test_package.cpp b/recipes/sole/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..245ee60b242d9 --- /dev/null +++ b/recipes/sole/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include "sole.hpp" + +int main() { + sole::uuid u0 = sole::uuid0(), u1 = sole::uuid1(), u4 = sole::uuid4(); + + std::cout << "uuid v0 string : " << u0 << std::endl; + std::cout << "uuid v0 base62 : " << u0.base62() << std::endl; + std::cout << "uuid v0 pretty : " << u0.pretty() << std::endl << std::endl; + + std::cout << "uuid v1 string : " << u1 << std::endl; + std::cout << "uuid v1 base62 : " << u1.base62() << std::endl; + std::cout << "uuid v1 pretty : " << u1.pretty() << std::endl << std::endl; + + std::cout << "uuid v4 string : " << u4 << std::endl; + std::cout << "uuid v4 base62 : " << u4.base62() << std::endl; + std::cout << "uuid v4 pretty : " << u4.pretty() << std::endl << std::endl; + + u1 = sole::rebuild("F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6"); + std::cout << "uuid v1 rebuilt: " << u1 << " -> " << u1.pretty() + << std::endl; + + u4 = sole::rebuild("GITheR4tLlg-BagIW20DGja"); + std::cout << "uuid v4 rebuilt: " << u4 << " -> " << u4.pretty() + << std::endl; +} diff --git a/recipes/sole/config.yml b/recipes/sole/config.yml new file mode 100644 index 0000000000000..c97d810195d0f --- /dev/null +++ b/recipes/sole/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.4": + folder: all + "1.0.2": + folder: all + "1.0.1": + folder: all diff --git a/recipes/sophus/all/conandata.yml b/recipes/sophus/all/conandata.yml new file mode 100644 index 0000000000000..5ba97a496abc6 --- /dev/null +++ b/recipes/sophus/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.22.10": + url: "https://github.com/strasdat/Sophus/archive/refs/tags/1.22.10.tar.gz" + sha256: "eb1da440e6250c5efc7637a0611a5b8888875ce6ac22bf7ff6b6769bbc958082" + "1.22.4": + url: "https://github.com/strasdat/Sophus/archive/refs/tags/1.22.4.tar.gz" + sha256: "13597381636c5a0757bb89451bf3c98a0978e49b89739b66571a4bdd950caa81" + "1.0.0": + url: "https://github.com/strasdat/Sophus/archive/v1.0.0.tar.gz" + sha256: "b4c8808344fe429ec026eca7eb921cef27fe9ff8326a48b72c53c4bf0804ad53" diff --git a/recipes/sophus/all/conanfile.py b/recipes/sophus/all/conanfile.py new file mode 100644 index 0000000000000..7fa9bd18760cf --- /dev/null +++ b/recipes/sophus/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +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.53.0" + + +class SophusConan(ConanFile): + name = "sophus" + description = "C++ implementation of Lie Groups using Eigen." + topics = ("eigen", "numerical", "math") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://strasdat.github.io/Sophus/" + license = "MIT" + no_copy_source = True + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_fmt": [True, False], + } + default_options = { + "with_fmt": True, + } + + def requirements(self): + self.requires("eigen/3.4.0", transitive_headers=True) + if self.options.with_fmt and Version(self.version) >= Version("1.22.10"): + self.requires("fmt/9.1.0", transitive_headers=True) + elif self.options.with_fmt and Version(self.version) >= Version("1.22.4"): + self.requires("fmt/8.1.1", transitive_headers=True) + + def package_id(self): + self.info.clear() + + 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 package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "sophus"), + dst=os.path.join(self.package_folder, "include", "sophus")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Sophus") + self.cpp_info.set_property("cmake_target_name", "Sophus::Sophus") + self.cpp_info.set_property("pkg_config_name", "sophus") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if not self.options.with_fmt: + self.cpp_info.defines.append("SOPHUS_USE_BASIC_LOGGING=1") + + # TODO: to remove in conan v2 once cmake_find_package* generator removed + self.cpp_info.names["cmake_find_package"] = "Sophus" + self.cpp_info.names["cmake_find_package_multi"] = "Sophus" diff --git a/recipes/sophus/all/test_package/CMakeLists.txt b/recipes/sophus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6fd2e8f57ae50 --- /dev/null +++ b/recipes/sophus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Sophus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_link_libraries(${PROJECT_NAME} PRIVATE Sophus::Sophus) diff --git a/recipes/sophus/all/test_package/conanfile.py b/recipes/sophus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/sophus/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/sophus/all/test_package/test_package.cpp b/recipes/sophus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..02ad5bc7e962a --- /dev/null +++ b/recipes/sophus/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#define _USE_MATH_DEFINES +#include +#include + +int main() { + Sophus::Matrix4d random_se3 = Sophus::SE3d::exp(Sophus::Vector6d::Random()).matrix(); + std::cout << "Random SE(3) matrix:\n" << random_se3 << std::endl; + +#ifdef SOPHUS_FMT_PRINT + SOPHUS_FMT_PRINT("Sophus fmt check: {}, {}. (If works should be: 20.0, true)", 20.0, true); +#endif + + std::cout << "Sophus uses EIGEN_VERSION: " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << std::endl; + + return 0; +} diff --git a/recipes/sophus/all/test_v1_package/CMakeLists.txt b/recipes/sophus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a25f45a5a90a --- /dev/null +++ b/recipes/sophus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Sophus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_link_libraries(${PROJECT_NAME} PRIVATE Sophus::Sophus) diff --git a/recipes/sophus/all/test_v1_package/conanfile.py b/recipes/sophus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sophus/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/sophus/config.yml b/recipes/sophus/config.yml new file mode 100644 index 0000000000000..44d3b5bd2a8c9 --- /dev/null +++ b/recipes/sophus/config.yml @@ -0,0 +1,7 @@ +versions: + "1.22.10": + folder: all + "1.22.4": + folder: all + "1.0.0": + folder: all diff --git a/recipes/soplex/all/conandata.yml b/recipes/soplex/all/conandata.yml new file mode 100644 index 0000000000000..eaf5ac83b4427 --- /dev/null +++ b/recipes/soplex/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "6.0.3": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-603.tar.gz" + sha256: "2bdf9adc9ac6ad48f98056679b7b852e626ac4aaaf277e7d4ce17794ed1097be" diff --git a/recipes/soplex/all/conanfile.py b/recipes/soplex/all/conanfile.py new file mode 100644 index 0000000000000..d1ea6917fd3ef --- /dev/null +++ b/recipes/soplex/all/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import collect_libs, copy, get +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from os.path import join + +required_conan_version = ">=1.53.0" + + +class SoPlexConan(ConanFile): + name = "soplex" + description = "SoPlex linear programming solver" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://soplex.zib.de" + topics = ("simplex", "solver", "linear", "programming") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_boost": [True, False], + "with_gmp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_boost": True, + "with_gmp": True + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "4", + "apple-clang": "7", + } + + def _determine_lib_name(self): + if self.options.shared: + return "soplexshared" + elif self.options.get_safe("fPIC"): + return "soplex-pic" + else: + return "soplex" + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("zlib/1.2.13", transitive_headers=True) + if self.options.with_gmp: + # transitive libs as anything using soplex requires __gmpz_init_set_si + # see https://github.com/conan-io/conan-center-index/pull/16017#issuecomment-1495688452 + self.requires("gmp/6.2.1", transitive_headers=True, transitive_libs=True) + if self.options.with_boost: + self.requires("boost/1.81.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GMP"] = self.options.with_gmp + tc.variables["BOOST"] = self.options.with_boost + tc.variables["Boost_VERSION_MACRO"] = "108100" + if self.options.with_gmp: + tc.cache_variables["GMP_INCLUDE_DIRS"] = ";".join(self.dependencies["gmp"].cpp_info.includedirs) + tc.cache_variables["GMP_LIBRARIES"] = "gmp::gmp" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build(target=f"lib{self._determine_lib_name()}") + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) + copy(self, pattern="soplex.h", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) + copy(self, pattern="soplex.hpp", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) + copy(self, pattern="soplex_interface.h", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) + copy(self, pattern="*.h", src=join(self.source_folder, "src", "soplex"), dst=join(self.package_folder, "include", "soplex")) + copy(self, pattern="*.hpp", src=join(self.source_folder, "src", "soplex"), dst=join(self.package_folder, "include", "soplex")) + copy(self, pattern="*.h", src=join(self.build_folder, "soplex"), dst=join(self.package_folder, "include", "soplex")) + if self.options.shared: + copy(self, pattern="*.so*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + else: + copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + # https://github.com/conan-io/conan-center-index/pull/16017#discussion_r1156484737 + self.cpp_info.set_property("cmake_target_name", "soplex") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/soplex/all/test_package/CMakeLists.txt b/recipes/soplex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e74edd1950d7a --- /dev/null +++ b/recipes/soplex/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 14) + +find_package(soplex REQUIRED CONFIG) +# work around v1 legacy generators always having namespaces +if(TARGET soplex::soplex) + add_library(soplex INTERFACE IMPORTED) + set_target_properties(soplex PROPERTIES INTERFACE_LINK_LIBRARIES soplex::soplex) +endif() + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE soplex) diff --git a/recipes/soplex/all/test_package/conanfile.py b/recipes/soplex/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/soplex/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/soplex/all/test_package/main.cpp b/recipes/soplex/all/test_package/main.cpp new file mode 100644 index 0000000000000..65c9a2cdd5cbb --- /dev/null +++ b/recipes/soplex/all/test_package/main.cpp @@ -0,0 +1,26 @@ +#include +#include + +using namespace soplex; +using namespace std; + +int main() { + SoPlex mysoplex; + mysoplex.setIntParam(SoPlex::OBJSENSE, SoPlex::OBJSENSE_MAXIMIZE); + + DSVector dummycol(0); // obj: max x + 3y + mysoplex.addColReal(LPCol(1.0, dummycol, 1.0, 0.0)); + mysoplex.addColReal(LPCol(3.0, dummycol, 1.0, 0.0)); + + DSVector row1(2); + row1.add(0, 1.0); + row1.add(1, 1.0); + mysoplex.addRowReal(LPRow(0.0, row1, 2.0)); // x + y <= 2 + mysoplex.addRowReal(LPRow(1.0, row1, infinity)); // 1 <= x + y + + mysoplex.optimize(); + + auto objective = mysoplex.objValueReal(); + bool objectiveValueIsFour = objective > 3.9 && objective < 4.1; + return objectiveValueIsFour ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/soplex/all/test_v1_package/CMakeLists.txt b/recipes/soplex/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8bf82de500d9f --- /dev/null +++ b/recipes/soplex/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 14) + +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/soplex/all/test_v1_package/conanfile.py b/recipes/soplex/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/soplex/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/soplex/config.yml b/recipes/soplex/config.yml new file mode 100644 index 0000000000000..bce376a5fec90 --- /dev/null +++ b/recipes/soplex/config.yml @@ -0,0 +1,3 @@ +versions: + "6.0.3": + folder: all diff --git a/recipes/soundtouch/all/conandata.yml b/recipes/soundtouch/all/conandata.yml new file mode 100644 index 0000000000000..ed99d82ff219b --- /dev/null +++ b/recipes/soundtouch/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.2": + url: "https://www.surina.net/soundtouch/soundtouch-2.3.2.tar.gz" + sha256: "3bde8ddbbc3661f04e151f72cf21ca9d8f8c88e265833b65935b8962d12d6b08" diff --git a/recipes/soundtouch/all/conanfile.py b/recipes/soundtouch/all/conanfile.py new file mode 100644 index 0000000000000..dd8ee78498090 --- /dev/null +++ b/recipes/soundtouch/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class SoundTouchConan(ConanFile): + name = "soundtouch" + description = "an open-source audio processing library that allows changing the sound tempo, pitch and playback rate parameters independently" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codeberg.org/soundtouch/soundtouch" + topics = ("audio", "processing", "tempo", "pitch", "playback") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "integer_samples": [True, False], + "with_openmp": [True, False], + "with_dll": [True, False], + "with_util": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "integer_samples": False, + "with_openmp": False, + "with_dll": False, + "with_util": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["INTEGER_SAMPLES"] = self.options.integer_samples + tc.variables["SOUNDTOUCH_DLL"] = self.options.with_dll + tc.variables["SOUNDSTRETCH"] = self.options.with_util + tc.variables["OPENMP"] = self.options.with_openmp + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING.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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SoundTouch") + + self.cpp_info.components["_soundtouch"].set_property("cmake_target_name", "SoundTouch::SoundTouch") + self.cpp_info.components["_soundtouch"].set_property("pkg_config_name", "soundtouch") + self.cpp_info.components["_soundtouch"].libs = ["SoundTouch"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_soundtouch"].system_libs.append("m") + if not self.options.shared and self.options.with_openmp: + openmp_flags = [] + if is_msvc(self): + openmp_flags = ["-openmp"] + elif self.settings.compiler in ("gcc", "clang"): + openmp_flags = ["-fopenmp"] + elif self.settings.compiler == "apple-clang": + openmp_flags = ["-Xpreprocessor", "-fopenmp"] + self.cpp_info.components["_soundtouch"].sharedlinkflags = openmp_flags + self.cpp_info.components["_soundtouch"].exelinkflags = openmp_flags + + if self.options.with_dll: + self.cpp_info.components["SoundTouchDLL"].set_property("cmake_target_name", "SoundTouch::SoundTouchDLL") + self.cpp_info.components["SoundTouchDLL"].libs = ["SoundTouchDLL"] + self.cpp_info.components["SoundTouchDLL"].requires = ["_soundtouch"] + + if self.options.with_util: + 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 + self.cpp_info.names["cmake_find_package"] = "SoundTouch" + self.cpp_info.names["cmake_find_package_multi"] = "SoundTouch" + self.cpp_info.components["_soundtouch"].names["cmake_find_package"] = "SoundTouch" + self.cpp_info.components["_soundtouch"].names["cmake_find_package_multi"] = "SoundTouch" + self.cpp_info.names["pkg_config"] = "SoundTouch" + if self.options.with_dll: + self.cpp_info.components["SoundTouchDLL"].names["cmake_find_package"] = "SoundTouchDLL" + self.cpp_info.components["SoundTouchDLL"].names["cmake_find_package_multi"] = "SoundTouchDLL" + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("mvec") diff --git a/recipes/soundtouch/all/test_package/CMakeLists.txt b/recipes/soundtouch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a768ac666be33 --- /dev/null +++ b/recipes/soundtouch/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package LANGUAGES CXX) + +find_package(SoundTouch REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SoundTouch::SoundTouch) diff --git a/recipes/soundtouch/all/test_package/conanfile.py b/recipes/soundtouch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/soundtouch/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/soundtouch/all/test_package/test_package.cpp b/recipes/soundtouch/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..adcc0038ccd4c --- /dev/null +++ b/recipes/soundtouch/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +#include "soundtouch/SoundTouch.h" + +int main(int argc, char* argv[]) { + std::cout << "SoundTouch: " << soundtouch::SoundTouch::getVersionString() << "\n"; + + soundtouch::SoundTouch soundTouch; + soundTouch.setRate(0.5); + soundTouch.setTempo(1.5); + soundTouch.setPitch(0.8); + soundTouch.setChannels(2); + + soundTouch.flush(); + + return 0; +} diff --git a/recipes/soundtouch/all/test_v1_package/CMakeLists.txt b/recipes/soundtouch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/soundtouch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/soundtouch/all/test_v1_package/conanfile.py b/recipes/soundtouch/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/soundtouch/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/soundtouch/config.yml b/recipes/soundtouch/config.yml new file mode 100644 index 0000000000000..aee8de619ec30 --- /dev/null +++ b/recipes/soundtouch/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.2": + folder: all diff --git a/recipes/source_location/all/conandata.yml b/recipes/source_location/all/conandata.yml new file mode 100644 index 0000000000000..8a337c2d134e5 --- /dev/null +++ b/recipes/source_location/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.2.1": + url: "https://github.com/Rechip/source_location/archive/v0.2.1.tar.gz" + sha256: "4e6ed4fcc5f06cfff5178bfa37267aec8298bbc06ca72ff357efb0181b1ce983" + "0.2.0": + url: "https://github.com/Rechip/source_location/archive/refs/tags/v0.2.0.zip" + sha256: "60ea8261389e4d835eabb1d247a999a59a47733657d20654bac560cef8a63b9c" + "0.1.1": + url: "https://github.com/Rechip/source_location/archive/refs/tags/v0.1.1.zip" + sha256: "2e177025c77d96cf9ccd994008dc5281e2385e1ee1bc89ca261807ce3f32c692" diff --git a/recipes/source_location/all/conanfile.py b/recipes/source_location/all/conanfile.py new file mode 100644 index 0000000000000..cbc67bb2eac20 --- /dev/null +++ b/recipes/source_location/all/conanfile.py @@ -0,0 +1,54 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + + +class SourceLocationConan(ConanFile): + name = "source_location" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Rechip/source_location" + description = "source_location header for some older compilers" + topics = ("cpp", "source_location", "header-only") + settings = ["compiler"] + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + self.copy(pattern="*", dst="include", + src=os.path.join(self._source_subfolder, "include")) + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16.6", + "gcc": "7.1", + "clang": "9", + "apple-clang": "12", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + minimum_version = self._minimum_compilers_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warn( + "source_location requires C++11. Your compiler is unknown. Assuming it supports C++11 and required functionality.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + "source_location requires C++11 and some embedded functionality, which your compiler does not support.") + + def package_id(self): + self.info.header_only() diff --git a/recipes/source_location/all/test_package/CMakeLists.txt b/recipes/source_location/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..955a59f6e9c84 --- /dev/null +++ b/recipes/source_location/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(source_location CONFIG REQUIRED) +add_executable(${PROJECT_NAME} src/test.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE source_location::source_location) + +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) diff --git a/recipes/source_location/all/test_package/conanfile.py b/recipes/source_location/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/source_location/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + self.cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/source_location/all/test_package/src/test.cpp b/recipes/source_location/all/test_package/src/test.cpp new file mode 100644 index 0000000000000..1e3734bb24378 --- /dev/null +++ b/recipes/source_location/all/test_package/src/test.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + constexpr auto loc = std::source_location::current(); + + return loc.line() == 5 ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/source_location/config.yml b/recipes/source_location/config.yml new file mode 100644 index 0000000000000..72b2720d18bb9 --- /dev/null +++ b/recipes/source_location/config.yml @@ -0,0 +1,7 @@ +versions: + "0.2.1": + folder: all + "0.2.0": + folder: all + "0.1.1": + folder: all diff --git a/recipes/soxr/all/conandata.yml b/recipes/soxr/all/conandata.yml new file mode 100644 index 0000000000000..1e3e515a65407 --- /dev/null +++ b/recipes/soxr/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "0.1.3": + url: "https://sourceforge.net/projects/soxr/files/soxr-0.1.3-Source.tar.xz" + sha256: "b111c15fdc8c029989330ff559184198c161100a59312f5dc19ddeb9b5a15889" +patches: + "0.1.3": + - patch_file: "patches/0.1.3-0001-findpackage-openmp.patch" + patch_description: "make OpenMP required to fail when not found" + patch_type: "conan" + - patch_file: "patches/0.1.3-0002-cmake-source-dir.patch" + patch_description: "point to the right source dir" + patch_type: "conan" + - patch_file: "patches/0.1.3-0003-relocatable-macos.patch" + patch_description: "Relocatable shared libs on macOS" + patch_type: "conan" diff --git a/recipes/soxr/all/conanfile.py b/recipes/soxr/all/conanfile.py new file mode 100644 index 0000000000000..d9c0a77657c80 --- /dev/null +++ b/recipes/soxr/all/conanfile.py @@ -0,0 +1,114 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, save, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + + +required_conan_version = ">=1.54.0" + + +class SoxrConan(ConanFile): + name = "soxr" + description = "The SoX Resampler library libsoxr performs fast, high-quality one-dimensional sample rate conversion." + homepage = "https://sourceforge.net/projects/soxr/" + topics = ("resampling", "audio", "sample-rate", "conversion") + license = "LGPL-2.1-or-later" + 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_openmp": [True, False], + "with_lsr_bindings": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": False, + "with_lsr_bindings": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "3.21": + # silence warning + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0115"] = "OLD" + if is_msvc(self): + tc.variables["BUILD_SHARED_RUNTIME"] = not is_msvc_static_runtime(self) + # Disable SIMD based resample engines for Apple Silicon and iOS ARMv8 architecture + if (self.settings.os == "Macos" or self.settings.os == "iOS") and self.settings.arch == "armv8": + tc.variables["WITH_CR32S"] = False + tc.variables["WITH_CR64S"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["WITH_OPENMP"] = self.options.with_openmp + tc.variables["WITH_LSR_BINDINGS"] = self.options.with_lsr_bindings + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _extract_pffft_license(self): + pffft_c = load(self, os.path.join(self.source_folder, "src", "pffft.c")) + return pffft_c[pffft_c.find("/* Copyright")+3:pffft_c.find("modern CPUs.")+13] + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENCE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_pffft"), self._extract_pffft_license()) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + # core component + self.cpp_info.components["core"].set_property("pkg_config_name", "soxr") + self.cpp_info.components["core"].libs = ["soxr"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["core"].system_libs = ["m"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["core"].defines.append("SOXR_DLL") + if not self.options.shared and self.options.with_openmp: + if is_msvc(self): + openmp_flags = ["-openmp"] + elif self.settings.compiler in ("gcc", "clang"): + openmp_flags = ["-fopenmp"] + elif self.settings.compiler == "apple-clang": + openmp_flags = ["-Xpreprocessor", "-fopenmp"] + else: + openmp_flags = [] + self.cpp_info.components["core"].exelinkflags = openmp_flags + self.cpp_info.components["core"].sharedlinkflags = openmp_flags + # lsr component + if self.options.with_lsr_bindings: + self.cpp_info.components["lsr"].set_property("pkg_config_name", "soxr-lsr") + self.cpp_info.components["lsr"].libs = ["soxr-lsr"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["lsr"].defines.append("SOXR_DLL") + self.cpp_info.components["lsr"].requires = ["core"] diff --git a/recipes/soxr/all/patches/0.1.3-0001-findpackage-openmp.patch b/recipes/soxr/all/patches/0.1.3-0001-findpackage-openmp.patch new file mode 100644 index 0000000000000..701bfdadc60d0 --- /dev/null +++ b/recipes/soxr/all/patches/0.1.3-0001-findpackage-openmp.patch @@ -0,0 +1,15 @@ +Adds the REQUIRED flag to find_package for OpenMP so that +we can be sure in the conanfile that if with_openmp is set +that OpenMP is indeed used. This is important since we need to add +compiler flags in package_info() in this case. +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -105,7 +105,7 @@ if (${BUILD_EXAMPLES}) + endif () + + if (WITH_OPENMP) +- find_package (OpenMP) ++ find_package (OpenMP REQUIRED) + if (OPENMP_FOUND) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") diff --git a/recipes/soxr/all/patches/0.1.3-0002-cmake-source-dir.patch b/recipes/soxr/all/patches/0.1.3-0002-cmake-source-dir.patch new file mode 100644 index 0000000000000..8e67d3f2a14de --- /dev/null +++ b/recipes/soxr/all/patches/0.1.3-0002-cmake-source-dir.patch @@ -0,0 +1,12 @@ +Patch required for proper resolving of CMake modules when using the CMake conan helper wrapper. +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -84,7 +84,7 @@ mark_as_advanced (WITH_HI_PREC_CLOCK WITH_FLOAT_STD_PREC_CLOCK + + # Introspection: + +-list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) ++list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) + + include (CheckFunctionExists) + include (CheckIncludeFiles) diff --git a/recipes/soxr/all/patches/0.1.3-0003-relocatable-macos.patch b/recipes/soxr/all/patches/0.1.3-0003-relocatable-macos.patch new file mode 100644 index 0000000000000..4ee1529626038 --- /dev/null +++ b/recipes/soxr/all/patches/0.1.3-0003-relocatable-macos.patch @@ -0,0 +1,18 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -81,7 +81,6 @@ target_link_libraries (${PROJECT_NAME} PRIVATE ${LIBS} ${LIBM_LIBRARIES}) + set_target_properties (${PROJECT_NAME} PROPERTIES + VERSION "${SO_VERSION}" + SOVERSION ${SO_VERSION_MAJOR} +- INSTALL_NAME_DIR ${LIB_INSTALL_DIR} + LINK_INTERFACE_LIBRARIES "" + PUBLIC_HEADER "${PROJECT_NAME}.h") + if (BUILD_FRAMEWORK) +@@ -105,7 +104,6 @@ if (WITH_LSR_BINDINGS) + set_target_properties (${LSR} PROPERTIES + VERSION "${LSR_SO_VERSION}" + SOVERSION ${LSR_SO_VERSION_MAJOR} +- INSTALL_NAME_DIR ${LIB_INSTALL_DIR} + LINK_INTERFACE_LIBRARIES "" + PUBLIC_HEADER "${LSR}.h") + if (BUILD_FRAMEWORK) diff --git a/recipes/soxr/all/test_package/CMakeLists.txt b/recipes/soxr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bd7a2c60dd458 --- /dev/null +++ b/recipes/soxr/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +enable_testing() + +find_package(soxr CONFIG REQUIRED) + +add_executable(test_package_core test_package_core.c) +target_link_libraries(test_package_core soxr::core) +add_test(NAME test_package_core COMMAND test_package_core) + +if(TARGET soxr::lsr) + add_executable(test_package_lsr test_package_lsr.c) + target_link_libraries(test_package_lsr soxr::lsr) + add_test(NAME test_package_lsr COMMAND test_package_lsr) +endif() diff --git a/recipes/soxr/all/test_package/conanfile.py b/recipes/soxr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c22030a639898 --- /dev/null +++ b/recipes/soxr/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import build_jobs, can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import chdir + + +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): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/soxr/all/test_package/test_package_core.c b/recipes/soxr/all/test_package/test_package_core.c new file mode 100644 index 0000000000000..3a249a2ce9e47 --- /dev/null +++ b/recipes/soxr/all/test_package/test_package_core.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("soxr version: %s\n", soxr_version()); + return 0; +} diff --git a/recipes/soxr/all/test_package/test_package_lsr.c b/recipes/soxr/all/test_package/test_package_lsr.c new file mode 100644 index 0000000000000..bfada78fa0a8c --- /dev/null +++ b/recipes/soxr/all/test_package/test_package_lsr.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("soxr-lsr version: %s\n", src_get_version()); + return 0; +} diff --git a/recipes/soxr/all/test_v1_package/CMakeLists.txt b/recipes/soxr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/soxr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/soxr/all/test_v1_package/conanfile.py b/recipes/soxr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4240acdf711cd --- /dev/null +++ b/recipes/soxr/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/soxr/config.yml b/recipes/soxr/config.yml new file mode 100644 index 0000000000000..b7f57204004e4 --- /dev/null +++ b/recipes/soxr/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/span-lite/all/conandata.yml b/recipes/span-lite/all/conandata.yml new file mode 100644 index 0000000000000..fe2adde8330d8 --- /dev/null +++ b/recipes/span-lite/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "0.6.0": + url: https://github.com/martinmoene/span-lite/archive/v0.6.0.tar.gz + sha256: da97ea5922a3c6129fe2ce89b95b471ae40e2ad921b354e472236a5ad57c5053 + "0.7.0": + url: https://github.com/martinmoene/span-lite/archive/v0.7.0.tar.gz + sha256: e95a9b281b46eb2b44257c6c4ec218c1741144c1167644896e29fd6aed9bbcf4 + "0.8.0": + url: https://github.com/martinmoene/span-lite/archive/v0.8.0.tar.gz + sha256: cca1c9de1dd1b7244ee8e5a093cc38b869d972154db61932b7dd22bd7a9d609c + "0.8.1": + url: https://github.com/martinmoene/span-lite/archive/v0.8.1.tar.gz + sha256: 2136dba54988c16b03f7c652ea977205bf624bfde90c24331177027d6529386d + "0.9.0": + url: https://github.com/martinmoene/span-lite/archive/v0.9.0.tar.gz + sha256: cdb5f86e5f5e679d63700a56de734c44fe22a574a17347d09dbaaef80619af91 + "0.9.2": + url: https://github.com/martinmoene/span-lite/archive/v0.9.2.tar.gz + sha256: 7562802aac9b78e0140c3d59933cf4dc5825c0712c63daad2f7fff8c67e62eb4 + "0.10.0": + url: https://github.com/martinmoene/span-lite/archive/v0.10.0.tar.gz + sha256: fd2ca42c18b4d5fae869752d18cf414bb4a3e4f01e617835a79ddb54a207889c + "0.10.1": + url: "https://github.com/martinmoene/span-lite/archive/v0.10.1.tar.gz" + sha256: "f915bca2d1e8357efdd043a5dc88047b390a76d77fb8cc1b6de831f7f43e397b" + "0.10.3": + url: "https://github.com/martinmoene/span-lite/archive/v0.10.3.tar.gz" + sha256: "04ac8148760369f11d4cdbc7969d66cb3d372357b6b5c7744841a60551ccb50b" diff --git a/recipes/span-lite/all/conanfile.py b/recipes/span-lite/all/conanfile.py new file mode 100644 index 0000000000000..a3cdfec98fc6a --- /dev/null +++ b/recipes/span-lite/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class SpanLiteConan(ConanFile): + name = "span-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/span-lite" + description = "span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "span", "span-implementations") + license = "BSL-1.0" + 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) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "span-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::span-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "span-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "span-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["spanlite"].names["cmake_find_package"] = "span-lite" + self.cpp_info.components["spanlite"].names["cmake_find_package_multi"] = "span-lite" + self.cpp_info.components["spanlite"].set_property("cmake_target_name", "nonstd::span-lite") + self.cpp_info.components["spanlite"].bindirs = [] + self.cpp_info.components["spanlite"].libdirs = [] + self.cpp_info.components["spanlite"].resdirs = [] diff --git a/recipes/span-lite/all/test_package/CMakeLists.txt b/recipes/span-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d8392ded7dfb5 --- /dev/null +++ b/recipes/span-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(span-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::span-lite) diff --git a/recipes/span-lite/all/test_package/conanfile.py b/recipes/span-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/span-lite/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/span-lite/all/test_package/test_package.cpp b/recipes/span-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..56e950b7c8a62 --- /dev/null +++ b/recipes/span-lite/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include "nonstd/span.hpp" +#if span_CPP11_OR_GREATER +#include +#endif +#include +#include + +std::ptrdiff_t size( nonstd::span spn ) +{ + return spn.size(); +} + +int main() +{ + int arr[] = { 1, }; + + std::cout << + "C-array:" << size( arr ) +#if span_CPP11_OR_GREATER + << " array:" << size( std::array { 1, 2, } ) +#endif + ; + + return 0; +} diff --git a/recipes/span-lite/all/test_v1_package/CMakeLists.txt b/recipes/span-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b91df846606c0 --- /dev/null +++ b/recipes/span-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(span-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::span-lite) diff --git a/recipes/span-lite/all/test_v1_package/conanfile.py b/recipes/span-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/span-lite/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/span-lite/config.yml b/recipes/span-lite/config.yml new file mode 100644 index 0000000000000..ebfb72f91ca97 --- /dev/null +++ b/recipes/span-lite/config.yml @@ -0,0 +1,19 @@ +versions: + "0.6.0": + folder: all + "0.7.0": + folder: all + "0.8.0": + folder: all + "0.8.1": + folder: all + "0.9.0": + folder: all + "0.9.2": + folder: all + "0.10.0": + folder: all + "0.10.1": + folder: all + "0.10.3": + folder: all diff --git a/recipes/spdlog/all/conandata.yml b/recipes/spdlog/all/conandata.yml new file mode 100644 index 0000000000000..60c6a1f3b520c --- /dev/null +++ b/recipes/spdlog/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.11.0": + url: "https://github.com/gabime/spdlog/archive/v1.11.0.tar.gz" + sha256: "ca5cae8d6cac15dae0ec63b21d6ad3530070650f68076f3a4a862ca293a858bb" + "1.10.0": + url: "https://github.com/gabime/spdlog/archive/v1.10.0.tar.gz" + sha256: "697f91700237dbae2326b90469be32b876b2b44888302afbc7aceb68bcfe8224" + "1.9.2": + url: "https://github.com/gabime/spdlog/archive/v1.9.2.tar.gz" + sha256: "6fff9215f5cb81760be4cc16d033526d1080427d236e86d70bb02994f85e3d38" + "1.8.5": + url: "https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz" + sha256: "944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8" diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py new file mode 100644 index 0000000000000..7c21d2c9559c3 --- /dev/null +++ b/recipes/spdlog/all/conanfile.py @@ -0,0 +1,159 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class SpdlogConan(ConanFile): + name = "spdlog" + package_type = "library" + description = "Fast C++ logging library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gabime/spdlog" + topics = ("logger", "logging", "log-filtering", "file sink", "header-only") + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "wchar_support": [True, False], + "wchar_filenames": [True, False], + "no_exceptions": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "wchar_support": False, + "wchar_filenames": False, + "no_exceptions": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.get_safe("shared") or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + self.options.rm_safe("shared") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self_version = Version(self.version) + fmt_version = "7.1.3" + + if self_version >= "1.11.0": + fmt_version = "9.1.0" + elif self_version >= "1.10.0": + fmt_version = "8.1.1" + elif self_version >= "1.9.0": + fmt_version = "8.0.1" + elif self_version >= "1.7.0": + fmt_version = "7.1.3" + + self.requires(f"fmt/{fmt_version}", transitive_headers=True, transitive_libs=True) + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + if self.settings.os != "Windows" and (self.options.wchar_support or self.options.wchar_filenames): + raise ConanInvalidConfiguration("wchar is only supported under windows") + if self.options.get_safe("shared") and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not self.options.header_only: + fmt = self.dependencies["fmt"] + tc = CMakeToolchain(self) + tc.variables["SPDLOG_BUILD_EXAMPLE"] = False + tc.variables["SPDLOG_BUILD_EXAMPLE_HO"] = False + tc.variables["SPDLOG_BUILD_TESTS"] = False + tc.variables["SPDLOG_BUILD_TESTS_HO"] = False + tc.variables["SPDLOG_BUILD_BENCH"] = False + tc.variables["SPDLOG_FMT_EXTERNAL"] = not fmt.options.header_only + tc.variables["SPDLOG_FMT_EXTERNAL_HO"] = fmt.options.header_only + tc.variables["SPDLOG_BUILD_SHARED"] = not self.options.header_only and self.options.shared + tc.variables["SPDLOG_WCHAR_SUPPORT"] = self.options.wchar_support + tc.variables["SPDLOG_WCHAR_FILENAMES"] = self.options.wchar_filenames + tc.variables["SPDLOG_INSTALL"] = True + tc.variables["SPDLOG_NO_EXCEPTIONS"] = self.options.no_exceptions + if self.settings.os in ("iOS", "tvOS", "watchOS"): + tc.variables["SPDLOG_NO_TLS"] = True + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + + def _disable_werror(self): + replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), "/WX", "") + + def build(self): + self._disable_werror() + if not self.options.header_only: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.options.header_only: + copy(self, + src=os.path.join(self.source_folder, "include"), + pattern="*.h", dst=os.path.join(self.package_folder, "include"), + # Unvendor bundled dependencies https://github.com/gabime/spdlog/commit/18495bf25dad3a4e8c2fe3777a5f79acecde27e3 + excludes=("spdlog/fmt/bundled/*")) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "spdlog", "cmake")) + + def package_info(self): + target = "spdlog_header_only" if self.options.header_only else "spdlog" + self.cpp_info.set_property("cmake_file_name", "spdlog") + self.cpp_info.set_property("cmake_target_name", f"spdlog::{target}") + self.cpp_info.set_property("pkg_config_name", "spdlog") + + # TODO: back to global scope in conan v2 once legacy generators removed + self.cpp_info.components["libspdlog"].set_property("cmake_target_name", f"spdlog::{target}") + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_FMT_EXTERNAL") + self.cpp_info.components["libspdlog"].requires = ["fmt::fmt"] + + if not self.options.header_only: + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.components["libspdlog"].libs = [f"spdlog{suffix}"] + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_COMPILED_LIB") + if self.options.wchar_support: + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_WCHAR_TO_UTF8_SUPPORT") + if self.options.wchar_filenames: + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_WCHAR_FILENAMES") + if self.options.no_exceptions: + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_NO_EXCEPTIONS") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libspdlog"].system_libs = ["pthread"] + if self.options.header_only and self.settings.os in ("iOS", "tvOS", "watchOS"): + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_NO_TLS") + + self.cpp_info.names["cmake_find_package"] = "spdlog" + self.cpp_info.names["cmake_find_package_multi"] = "spdlog" + self.cpp_info.components["libspdlog"].names["cmake_find_package"] = target + self.cpp_info.components["libspdlog"].names["cmake_find_package_multi"] = target diff --git a/recipes/spdlog/all/test_package/CMakeLists.txt b/recipes/spdlog/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d31b151d6390c --- /dev/null +++ b/recipes/spdlog/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(spdlog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(SPDLOG_HEADER_ONLY) + target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog_header_only) +else() + target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/spdlog/all/test_package/conanfile.py b/recipes/spdlog/all/test_package/conanfile.py new file mode 100644 index 0000000000000..81d7c956cf9d2 --- /dev/null +++ b/recipes/spdlog/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPDLOG_HEADER_ONLY"] = self.dependencies["spdlog"].options.header_only + 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/spdlog/all/test_package/test_package.cpp b/recipes/spdlog/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..74aba1fd54ff9 --- /dev/null +++ b/recipes/spdlog/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include "spdlog/spdlog.h" + +#if defined __has_include +# if __has_include ("spdlog/fmt/bundled/core.h") +# error "bundled fmt within spdlog should not be present" +# endif +#endif + +int main(void) { + spdlog::info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH); + return EXIT_SUCCESS; +} diff --git a/recipes/spdlog/all/test_v1_package/CMakeLists.txt b/recipes/spdlog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/spdlog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/spdlog/all/test_v1_package/conanfile.py b/recipes/spdlog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..30ca1d12b0933 --- /dev/null +++ b/recipes/spdlog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + tools.mkdir("logs/") + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/spdlog/config.yml b/recipes/spdlog/config.yml new file mode 100644 index 0000000000000..2efd56b833781 --- /dev/null +++ b/recipes/spdlog/config.yml @@ -0,0 +1,9 @@ +versions: + "1.11.0": + folder: "all" + "1.10.0": + folder: "all" + "1.9.2": + folder: "all" + "1.8.5": + folder: "all" diff --git a/recipes/spectra/all/conandata.yml b/recipes/spectra/all/conandata.yml new file mode 100644 index 0000000000000..a46b77ddcc1f0 --- /dev/null +++ b/recipes/spectra/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.1": + url: "https://github.com/yixuan/spectra/archive/refs/tags/v1.0.1.tar.gz" + sha256: "919e3fbc8c539a321fd5a0766966922b7637cc52eb50a969241a997c733789f3" + "1.0.0": + url: "https://github.com/yixuan/spectra/archive/refs/tags/v1.0.0.tar.gz" + sha256: "45228b7d77b916b5384245eb13aa24bc994f3b0375013a8ba6b85adfd2dafd67" + "0.9.0": + url: "https://github.com/yixuan/spectra/archive/v0.9.0.tar.gz" + sha256: "2966757d432e8fba5958c2a05ad5674ce34eaae3718dd546c1ba8760b80b7a3d" + "0.8.1": + url: "https://github.com/yixuan/spectra/archive/v0.8.1.tar.gz" + sha256: "339ae9221309a128b8d937ca59b77d9b30aeceacb4ef2d2df13f6f7cde7fa3f3" diff --git a/recipes/spectra/all/conanfile.py b/recipes/spectra/all/conanfile.py new file mode 100644 index 0000000000000..084f85d8c4950 --- /dev/null +++ b/recipes/spectra/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.1" + + +class SpectraConan(ConanFile): + name = "spectra" + description = "A header-only C++ library for large scale eigenvalue problems." + license = "MPL-2.0" + topics = ("eigenvalue", "header-only") + homepage = "https://spectralib.org" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if Version(self.version) >= "1.0.0": + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + 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=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_file_name", "spectra") + self.cpp_info.set_property("cmake_target_name", "Spectra::Spectra") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "spectra" + self.cpp_info.filenames["cmake_find_package_multi"] = "spectra" + self.cpp_info.names["cmake_find_package"] = "Spectra" + self.cpp_info.names["cmake_find_package_multi"] = "Spectra" diff --git a/recipes/spectra/all/test_package/CMakeLists.txt b/recipes/spectra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c68917e8a8c64 --- /dev/null +++ b/recipes/spectra/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(spectra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Spectra::Spectra) +if(spectra_VERSION VERSION_LESS "1.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE "SPECTRA_LESS_1_0_0") +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/spectra/all/test_package/conanfile.py b/recipes/spectra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/spectra/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/spectra/all/test_package/test_package.cpp b/recipes/spectra/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3da7ef12504b7 --- /dev/null +++ b/recipes/spectra/all/test_package/test_package.cpp @@ -0,0 +1,42 @@ +#include +#include + +#include + +int main() { + // We are going to calculate the eigenvalues of M + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10, 10); + Eigen::MatrixXd M = A + A.transpose(); + + // Construct matrix operation object using the wrapper class DenseSymMatProd + Spectra::DenseSymMatProd op(M); + + // Construct eigen solver object, requesting the largest three eigenvalues +#ifdef SPECTRA_LESS_1_0_0 + Spectra::SymEigsSolver< double, Spectra::LARGEST_ALGE, Spectra::DenseSymMatProd > eigs(&op, 3, 6); +#else + Spectra::SymEigsSolver> eigs(op, 3, 6); +#endif + + // Initialize and compute + eigs.init(); +#ifdef SPECTRA_LESS_1_0_0 + int nconv = eigs.compute(); +#else + int nconv = eigs.compute(Spectra::SortRule::LargestAlge); +#endif + + // Retrieve results + Eigen::VectorXd evalues; +#ifdef SPECTRA_LESS_1_0_0 + if (eigs.info() == Spectra::SUCCESSFUL) { +#else + if (eigs.info() == Spectra::CompInfo::Successful) { +#endif + evalues = eigs.eigenvalues(); + } + + std::cout << "Eigenvalues found:\n" << evalues << std::endl; + + return 0; +} diff --git a/recipes/spectra/all/test_v1_package/CMakeLists.txt b/recipes/spectra/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/spectra/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/spectra/all/test_v1_package/conanfile.py b/recipes/spectra/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/spectra/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/spectra/config.yml b/recipes/spectra/config.yml new file mode 100644 index 0000000000000..9d99d898e18bb --- /dev/null +++ b/recipes/spectra/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.1": + folder: "all" + "1.0.0": + folder: "all" + "0.9.0": + folder: "all" + "0.8.1": + folder: "all" diff --git a/recipes/spirv-cross/all/conandata.yml b/recipes/spirv-cross/all/conandata.yml new file mode 100644 index 0000000000000..62c01a02172b5 --- /dev/null +++ b/recipes/spirv-cross/all/conandata.yml @@ -0,0 +1,69 @@ +sources: + "1.3.243.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "549fff809de2b3484bcc5d710ccd76ca29cbd764dd304c3687252e2f3d034e06" + "1.3.239.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "a1695022880e7ef3c2d407647f79876045dc2a3ed012753adc71ead5cc5178ba" + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "8140a2b53d1e218e9be1f8d5e2749b1ebe854d456e5cb356218fd288747d5438" + "1.3.231.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "3b42f5b6e46b45600e09fd55234f59edb7cfca803e49d7830dc6fb5a086143b1" + "1.3.224.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "00256c33e235c5b9f0fc4b531fb9058d3cf1ff53e21e2db62cd8db848525536c" + "1.3.216.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "dd66ce2f9e6d3b9b8055662ac25172fa5559603f2f23c1a178c74f1602de8732" + "1.3.211.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "0f56755caa78765ab6c2467909c06dea63e6826ee824b496e73469c0d6a9d318" + "1.3.204.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.204.0.tar.gz" + sha256: "1b5a9b5b3b333411164fe29de1969d5b590d83891aad14eb49be3c41eccd9edf" + "cci.20211113": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/7c3cb0b12c9965497b08403c82ac1b82846fa7be.tar.gz" + sha256: "5bb6837e2b75db1a9e36e7d6eac40d905e3460ff3b5234f391adc6bdf6aadcdf" + "cci.20210930": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/97a438d214b24e4958ca137a18639670648cedd0.tar.gz" + sha256: "dd07ce3c261fe8c08dbfbb3dd274f35de50ea8610f57fe5de4fe2b782c4accbd" + "cci.20210823": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/0e2880ab990e79ce6cc8c79c219feda42d98b1e8.tar.gz" + sha256: "611cf4d30d88c48a4a04848a66ae4c5d3a63ccf965fd6017d9ea86ec5c7a088d" + "cci.20210621": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/9cdeefb5e322fc26b5fed70795fe79725648df1f.tar.gz" + sha256: "3742c24e7ccc09fce10e9d88c2f9a2e85f5142cc742be6df5cc3ba3f96defa92" + "20210115": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2021-01-15.tar.gz" + sha256: "d700863b548cbc7f27a678cee305f561669a126eb2cc11d36a7023dfc462b9c4" + "20200917": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-09-17.tar.gz" + sha256: "a3351742fe1fae9a15e91abbfb5314d96f5f77927ed07f55124d6df830ac97a7" + "20200629": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-06-29.tar.gz" + sha256: "29523168867fcfa55b03a65970a8572be67e37accb08ce1051b2d3ae19011452" + "20200519": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-05-19.tar.gz" + sha256: "6cf18ee3fe1a8d64a20da3c5fac334da4c4762d29d7e55a2f0b555cbf5cff708" + "20200403": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-04-03.tar.gz" + sha256: "93f3a6dfad17c9ca0bf4d2d80809e90118e13b47502eb395baba8784025d7e97" +patches: + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-fix-gcc5.patch" + patch_description: "Fix compilation with gcc-5" + patch_type: "portability" + "cci.20210621": + - patch_file: "patches/0001-fix-bundle-install-cci.20210621.patch" + "20210115": + - patch_file: "patches/0001-fix-bundle-install-20210115.patch" + "20200917": + - patch_file: "patches/0001-fix-bundle-install-20200403.patch" + "20200629": + - patch_file: "patches/0001-fix-bundle-install-20200403.patch" + "20200519": + - patch_file: "patches/0001-fix-bundle-install-20200403.patch" + "20200403": + - patch_file: "patches/0001-fix-bundle-install-20200403.patch" diff --git a/recipes/spirv-cross/all/conanfile.py b/recipes/spirv-cross/all/conanfile.py new file mode 100644 index 0000000000000..d98d3ab1b2503 --- /dev/null +++ b/recipes/spirv-cross/all/conanfile.py @@ -0,0 +1,206 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class SpirvCrossConan(ConanFile): + name = "spirv-cross" + description = "SPIRV-Cross is a practical tool and library for performing " \ + "reflection on SPIR-V and disassembling SPIR-V back to high level languages." + license = "Apache-2.0" + topics = ("reflection", "disassembler", "spirv", "spir-v", "glsl", "hlsl") + homepage = "https://github.com/KhronosGroup/SPIRV-Cross" + 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], + "build_executable": [True, False], + "exceptions": [True, False], + "glsl": [True, False], + "hlsl": [True, False], + "msl": [True, False], + "cpp": [True, False], + "reflect": [True, False], + "c_api": [True, False], + "util": [True, False], + "namespace": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executable": True, + "exceptions": True, + "glsl": True, + "hlsl": True, + "msl": True, + "cpp": True, + "reflect": True, + "c_api": True, + "util": True, + "namespace": "spirv_cross", + } + + 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") + # these options don't contribute to shared binary + del self.options.c_api + del self.options.util + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not self.options.glsl and \ + (self.options.hlsl or self.options.msl or self.options.cpp or self.options.reflect): + raise ConanInvalidConfiguration("hlsl, msl, cpp and reflect require glsl enabled") + + if self.options.build_executable and \ + not (self.options.glsl and self.options.hlsl and self.options.msl and + self.options.cpp and self.options.reflect and self.options.get_safe("util", True)): + raise ConanInvalidConfiguration("executable can't be built without glsl, hlsl, msl, cpp, reflect and util") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS"] = not self.options.exceptions + tc.variables["SPIRV_CROSS_SHARED"] = self.options.shared + tc.variables["SPIRV_CROSS_STATIC"] = not self.options.shared or self.options.build_executable + tc.variables["SPIRV_CROSS_CLI"] = self.options.build_executable + tc.variables["SPIRV_CROSS_ENABLE_TESTS"] = False + tc.variables["SPIRV_CROSS_ENABLE_GLSL"] = self.options.glsl + tc.variables["SPIRV_CROSS_ENABLE_HLSL"] = self.options.hlsl + tc.variables["SPIRV_CROSS_ENABLE_MSL"] = self.options.msl + tc.variables["SPIRV_CROSS_ENABLE_CPP"] = self.options.cpp + tc.variables["SPIRV_CROSS_ENABLE_REFLECT"] = self.options.reflect + tc.variables["SPIRV_CROSS_ENABLE_C_API"] = self.options.get_safe("c_api", True) + tc.variables["SPIRV_CROSS_ENABLE_UTIL"] = self.options.get_safe("util", False) or self.options.build_executable + tc.variables["SPIRV_CROSS_SKIP_INSTALL"] = False + tc.variables["SPIRV_CROSS_FORCE_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.options.namespace + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.ilk", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.shared and self.options.build_executable: + for static_lib in [ + "spirv-cross-core", "spirv-cross-glsl", "spirv-cross-hlsl", "spirv-cross-msl", + "spirv-cross-cpp", "spirv-cross-reflect", "spirv-cross-c", "spirv-cross-util", + ]: + rm(self, f"*{static_lib}.*", os.path.join(self.package_folder, "lib")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {target: f"spirv-cross::{target}" for target in self._spirv_cross_components.keys()}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _spirv_cross_components(self): + components = {} + if self.options.shared: + components.update({"spirv-cross-c-shared": []}) + else: + components.update({"spirv-cross-core": []}) + if self.options.glsl: + components.update({"spirv-cross-glsl": ["spirv-cross-core"]}) + if self.options.hlsl: + components.update({"spirv-cross-hlsl": ["spirv-cross-glsl"]}) + if self.options.msl: + components.update({"spirv-cross-msl": ["spirv-cross-glsl"]}) + if self.options.cpp: + components.update({"spirv-cross-cpp": ["spirv-cross-glsl"]}) + if self.options.reflect: + components.update({"spirv-cross-reflect": []}) + if self.options.c_api: + c_api_requires = [] + if self.options.glsl: + c_api_requires.append("spirv-cross-glsl") + if self.options.hlsl: + c_api_requires.append("spirv-cross-hlsl") + if self.options.msl: + c_api_requires.append("spirv-cross-msl") + if self.options.cpp: + c_api_requires.append("spirv-cross-cpp") + if self.options.reflect: + c_api_requires.append("spirv-cross-reflect") + components.update({"spirv-cross-c": c_api_requires}) + if self.options.util: + components.update({"spirv-cross-util": ["spirv-cross-core"]}) + return components + + def package_info(self): + # FIXME: we should provide one CMake config file per target (waiting for an implementation of https://github.com/conan-io/conan/issues/9000) + def _register_component(target_lib, requires): + self.cpp_info.components[target_lib].set_property("cmake_target_name", target_lib) + if self.options.shared: + self.cpp_info.components[target_lib].set_property("pkg_config_name", target_lib) + prefix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + self.cpp_info.components[target_lib].libs = [f"{target_lib}{prefix}"] + self.cpp_info.components[target_lib].includedirs.append(os.path.join("include", "spirv_cross")) + self.cpp_info.components[target_lib].defines.append(f"SPIRV_CROSS_NAMESPACE_OVERRIDE={self.options.namespace}") + self.cpp_info.components[target_lib].requires = requires + if self.settings.os in ["Linux", "FreeBSD"] and self.options.glsl: + self.cpp_info.components[target_lib].system_libs.append("m") + if not self.options.shared and self.options.c_api: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components[target_lib].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.components[target_lib].names["cmake_find_package"] = target_lib + self.cpp_info.components[target_lib].names["cmake_find_package_multi"] = target_lib + self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + + for target_lib, requires in self._spirv_cross_components.items(): + _register_component(target_lib, requires) + + # TODO: to remove in conan v2 once legacy generators removed + if self.options.build_executable: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch new file mode 100644 index 0000000000000..9334dea225892 --- /dev/null +++ b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -433,7 +433,7 @@ if (SPIRV_CROSS_CLI) + target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION) + set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}") + if (NOT SPIRV_CROSS_SKIP_INSTALL) +- install(TARGETS spirv-cross RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ install(TARGETS spirv-cross DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + target_link_libraries(spirv-cross PRIVATE + spirv-cross-glsl diff --git a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch new file mode 100644 index 0000000000000..5a9c531331845 --- /dev/null +++ b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -441,7 +441,7 @@ if (SPIRV_CROSS_CLI) + target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION) + set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}") + if (NOT SPIRV_CROSS_SKIP_INSTALL) +- install(TARGETS spirv-cross RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ install(TARGETS spirv-cross DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + target_link_libraries(spirv-cross PRIVATE + spirv-cross-glsl diff --git a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch new file mode 100644 index 0000000000000..1e4e265cd5154 --- /dev/null +++ b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch @@ -0,0 +1,13 @@ +fixed in https://github.com/KhronosGroup/SPIRV-Cross/pull/1706 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -442,7 +442,7 @@ if (SPIRV_CROSS_CLI) + target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION) + set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}") + if (NOT SPIRV_CROSS_SKIP_INSTALL) +- install(TARGETS spirv-cross RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ install(TARGETS spirv-cross DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + target_link_libraries(spirv-cross PRIVATE + spirv-cross-glsl diff --git a/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch b/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch new file mode 100644 index 0000000000000..70c5857924141 --- /dev/null +++ b/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch @@ -0,0 +1,14 @@ +--- a/spirv_glsl.cpp ++++ b/spirv_glsl.cpp +@@ -4955,9 +4955,9 @@ SmallVector CompilerGLSL::get_composite_constant_ids(ConstantID cons + if (is_array(type) || type.basetype == SPIRType::Struct) + return constant->subconstants; + if (is_matrix(type)) +- return constant->m.id; ++ return SmallVector(constant->m.id); + if (is_vector(type)) +- return constant->m.c[0].id; ++ return SmallVector(constant->m.c[0].id); + SPIRV_CROSS_THROW("Unexpected scalar constant!"); + } + if (!const_composite_insert_ids.count(const_id)) diff --git a/recipes/spirv-cross/all/test_package/CMakeLists.txt b/recipes/spirv-cross/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a40c4a736880a --- /dev/null +++ b/recipes/spirv-cross/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +# FIXME: this is not the official way to find spirv-cross components +find_package(spirv-cross REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET spirv-cross-c) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c) +elseif(TARGET spirv-cross-c-shared) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c-shared) +endif() diff --git a/recipes/spirv-cross/all/test_package/conanfile.py b/recipes/spirv-cross/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/spirv-cross/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/spirv-cross/all/test_package/test_package.c b/recipes/spirv-cross/all/test_package/test_package.c new file mode 100644 index 0000000000000..dd59cdcab47b3 --- /dev/null +++ b/recipes/spirv-cross/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include + +int main() { + spvc_context context; + spvc_context_create(&context); + spvc_context_destroy(context); + + unsigned major, minor, patch; + spvc_get_version(&major, &minor, &patch); + printf("SPIRV-Cross: C API version %u.%u.%u\n", major, minor, patch); + + return 0; +} diff --git a/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt b/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/spirv-cross/all/test_v1_package/conanfile.py b/recipes/spirv-cross/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/spirv-cross/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/spirv-cross/config.yml b/recipes/spirv-cross/config.yml new file mode 100644 index 0000000000000..a557c0bb6d254 --- /dev/null +++ b/recipes/spirv-cross/config.yml @@ -0,0 +1,35 @@ +versions: + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.224.0": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all + "1.3.204.0": + folder: all + "cci.20211113": + folder: all + "cci.20210930": + folder: all + "cci.20210823": + folder: all + "cci.20210621": + folder: all + "20210115": + folder: all + "20200917": + folder: all + "20200629": + folder: all + "20200519": + folder: all + "20200403": + folder: all diff --git a/recipes/spirv-headers/all/conandata.yml b/recipes/spirv-headers/all/conandata.yml new file mode 100644 index 0000000000000..c9233e5ff87a6 --- /dev/null +++ b/recipes/spirv-headers/all/conandata.yml @@ -0,0 +1,49 @@ +sources: + "1.3.243.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "16927b1868e7891377d059cd549484e4158912439cf77451ae7e01e2a3bcd28b" + "1.3.239.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "fdaf6670e311cd1c08ae90bf813e89dd31630205bc60030ffd25fb0af39b51fe" + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "4d74c685fdd74469eba7c224dd671a0cb27df45fc9aa43cdd90e53bd4f2b2b78" + "1.3.231.1": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3" + "1.3.224.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "2fb1039ec6cec8943400e9b4d01d8bfe8c62a0bd1fafb7c39c56469aa247b838" + "1.3.216.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "46c49a0e49ea120138102b1dcb3778e5a4f2267c45b9e937810a4cf4fb889e3d" + "1.3.211.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "30a78e61bd812c75e09fdc7a319af206b1044536326bc3e85fea818376a12568" + "1.3.204.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.204.0.tar.gz" + sha256: "519d09906dcdd4bf27089ff136d4e8c70abe2915bbde17a1d5ac18c5de6aee67" + "1.2.198.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "3301a23aca0434336a643e433dcacacdd60000ab3dd35dc0078a297c06124a12" + "cci.20211010": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/814e728b30ddd0f4509233099a3ad96fd4318c07.tar.gz" + sha256: "c262d3c0c36ad5c87fbe3572aa292d2aed4dcd9b1ca4868eff9ec180e3f994f2" + "cci.20210811": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/e71feddb3f17c5586ff7f4cfb5ed1258b800574b.tar.gz" + sha256: "9eb56548460fd8850250ebf78071528fb66c2a5db2ef535edc1d493b2581ec66" + "cci.20210616": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/07f259e68af3a540038fa32df522554e74f53ed5.tar.gz" + sha256: "ce7d299c9e688fe536e106605235dbb7f81613daa7995d4d99d002c808f126f8" + "cci.20210414": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/dafead1765f6c1a5f9f8a76387dcb2abe4e54acd.tar.gz" + sha256: "e1c8530c95fc8c70fa6a7cbc269ebd1b10da3872efa0e3c6eb82452c3e180cda" + "1.5.4": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/1.5.4.tar.gz" + sha256: "fc026b6566167f6db03dc48779f0f986f9ff8c93ed651a557f28cfbe2dff4ede" + "1.5.3": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/1.5.3.tar.gz" + sha256: "eece8a9e147d37997d425d5d2eeb2e757ad25adc30d6651467094f3b18609b5a" + "1.5.1": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/1.5.1.corrected.tar.gz" + sha256: "2b6a0ce1c02b9fe7b9ef727369168fe579e5256f1ea013993acdb8d8f06b7e89" diff --git a/recipes/spirv-headers/all/conanfile.py b/recipes/spirv-headers/all/conanfile.py new file mode 100644 index 0000000000000..852af3d493684 --- /dev/null +++ b/recipes/spirv-headers/all/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.50.0" + + +class SpirvheadersConan(ConanFile): + name = "spirv-headers" + homepage = "https://github.com/KhronosGroup/SPIRV-Headers" + description = "Header files for the SPIRV instruction set." + license = "MIT-KhronosGroup" + topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "khronos") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_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) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPIRV_HEADERS_SKIP_EXAMPLES"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SPIRV-Headers") + self.cpp_info.set_property("cmake_target_name", "SPIRV-Headers::SPIRV-Headers") + self.cpp_info.set_property("pkg_config_name", "SPIRV-Headers") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "SPIRV-Headers" + self.cpp_info.names["cmake_find_package_multi"] = "SPIRV-Headers" + self.cpp_info.names["pkg_config"] = "SPIRV-Headers" diff --git a/recipes/spirv-headers/all/test_package/CMakeLists.txt b/recipes/spirv-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a94f6e4aba03d --- /dev/null +++ b/recipes/spirv-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(SPIRV-Headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SPIRV-Headers::SPIRV-Headers) diff --git a/recipes/spirv-headers/all/test_package/conanfile.py b/recipes/spirv-headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/spirv-headers/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/spirv-headers/all/test_package/test_package.cpp b/recipes/spirv-headers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..db6d549853bea --- /dev/null +++ b/recipes/spirv-headers/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2016 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are 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 Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE 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 +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +#include +#include +#include + +namespace { + +const GLSLstd450 kSin = GLSLstd450Sin; +const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; +const spv::Op kNop = spv::OpNop; + +} + +int main(int argc, char ** argv) +{ + + return 0; +} diff --git a/recipes/spirv-headers/all/test_v1_package/CMakeLists.txt b/recipes/spirv-headers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/spirv-headers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/spirv-headers/all/test_v1_package/conanfile.py b/recipes/spirv-headers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/spirv-headers/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/spirv-headers/config.yml b/recipes/spirv-headers/config.yml new file mode 100644 index 0000000000000..cb5c705d100c0 --- /dev/null +++ b/recipes/spirv-headers/config.yml @@ -0,0 +1,33 @@ +versions: + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.224.0": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all + "1.3.204.0": + folder: all + "1.2.198.0": + folder: all + "cci.20211010": + folder: all + "cci.20210811": + folder: all + "cci.20210616": + folder: all + "cci.20210414": + folder: all + "1.5.4": + folder: all + "1.5.3": + folder: all + "1.5.1": + folder: all diff --git a/recipes/spirv-tools/all/conandata.yml b/recipes/spirv-tools/all/conandata.yml new file mode 100644 index 0000000000000..f29ee8c3fbf96 --- /dev/null +++ b/recipes/spirv-tools/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.3.243.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "684a29e37bfdc6e151fe1d3ec4b87c5396c17a439de545d81ea05d4ee6fbc86e" + "1.3.239.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "327b2dba4515646eee28c1a5fe1332891e81c8b6ff289363f52877f3e67c2d81" + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "6789c782a8ba8fa127c3d579f9362f0cdde7a9ccc2e8513cdf217bba579dfda9" + "1.3.231.1": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "b97df7fdac617878668762ab452ae2ae425a0f36e29711b4cc6c4ae216e32309" + "1.3.224.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "428b83f2710c07123cf2ec21934389f893aa0b570d1fe4aba6e38718c9a6ea69" + "1.3.216.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "b4b9abeb59deda20c41808ac4cd5f9faf6f0a9daa51a8c82e13ca47c045e982f" + "1.3.211.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "5466e628c92c30aeb45547b9d836dcf7b6249afb94de9dea4ac4449a82202b50" diff --git a/recipes/spirv-tools/all/conanfile.py b/recipes/spirv-tools/all/conanfile.py new file mode 100644 index 0000000000000..e904e089fbe0e --- /dev/null +++ b/recipes/spirv-tools/all/conanfile.py @@ -0,0 +1,289 @@ +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, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class SpirvtoolsConan(ConanFile): + name = "spirv-tools" + homepage = "https://github.com/KhronosGroup/SPIRV-Tools/" + description = "Create and optimize SPIRV shaders" + topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "hlsl", "khronos") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_executables": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executables": True, + } + + short_paths = True + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.3.243" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "apple-clang": "10", + "clang": "5", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + }.get(self._min_cppstd, {}) + + 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(f"spirv-headers/{self.version}") + + 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 _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output) + m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if Version(self.version) >= "1.3.239": + if not self._cmake_new_enough("3.17.2"): + self.tool_requires("cmake/3.25.3") + + 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) + + #==================== + # Shared libs mess in Spirv-Tools (see https://github.com/KhronosGroup/SPIRV-Tools/issues/3909) + #==================== + # We have 2 solutions if shared True: + # - Only package SPIRV-Tools-shared lib (private symbols properly hidden), and wait resolution + # of above issue before allowing to build shared for all Spirv-Tools libs. + # - Build and package shared libs with all symbols exported + # (it would require CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS for msvc) + # Currently this recipe implements the first solution + + # Static and shared libs are controlled by a weird combination + # of SPIRV_TOOLS_BUILD_STATIC and BUILD_SHARED_LIBS. + tc.variables["SPIRV_TOOLS_BUILD_STATIC"] = True + #============ + + # Required by the project's CMakeLists.txt + tc.variables["SPIRV-Headers_SOURCE_DIR"] = self.dependencies["spirv-headers"].package_folder.replace("\\", "/") + + # There are some switch( ) statements that are causing errors + # need to turn this off + tc.variables["SPIRV_WERROR"] = False + + tc.variables["SKIP_SPIRV_TOOLS_INSTALL"] = False + tc.variables["SPIRV_LOG_DEBUG"] = False + tc.variables["SPIRV_SKIP_TESTS"] = True + tc.variables["SPIRV_CHECK_CONTEXT"] = False + tc.variables["SPIRV_BUILD_FUZZER"] = False + tc.variables["SPIRV_SKIP_EXECUTABLES"] = not self.options.build_executables + # To install relocatable shared libs on Macos + if Version(self.version) < "1.3.239": + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # For iOS/tvOS/watchOS + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + + tc.generate() + + def _patch_sources(self): + # CMAKE_POSITION_INDEPENDENT_CODE was set ON for the entire + # project in the lists file. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-link")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-opt")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-reduce")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-lint")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-diff")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-tools")) + if self.options.shared: + for file_name in [ + "*SPIRV-Tools", "*SPIRV-Tools-opt", "*SPIRV-Tools-link", + "*SPIRV-Tools-reduce", "*SPIRV-Tools-lint", + ]: + for ext in [".a", ".lib"]: + rm(self, f"{file_name}{ext}", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*SPIRV-Tools-shared.dll", os.path.join(self.package_folder, "bin")) + rm(self, "*SPIRV-Tools-shared*", os.path.join(self.package_folder, "lib")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + if self.options.shared: + targets = {"SPIRV-Tools-shared": "spirv-tools::SPIRV-Tools"} + else: + targets = { + "SPIRV-Tools": "spirv-tools::SPIRV-Tools", # before 2020.5, kept for conveniency + "SPIRV-Tools-static": "spirv-tools::SPIRV-Tools", + "SPIRV-Tools-opt": "spirv-tools::SPIRV-Tools-opt", + "SPIRV-Tools-link": "spirv-tools::SPIRV-Tools-link", + "SPIRV-Tools-reduce": "spirv-tools::SPIRV-Tools-reduce", + "SPIRV-Tools-lint": "spirv-tools::SPIRV-Tools-lint", + "SPIRV-Tools-diff": "spirv-tools::SPIRV-Tools-diff", + } + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + targets, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SPIRV-Tools") + self.cpp_info.set_property("pkg_config_name", "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools") + + # SPIRV-Tools + self.cpp_info.components["spirv-tools-core"].set_property( + "cmake_target_name", + "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools-static", + ) + self.cpp_info.components["spirv-tools-core"].set_property("cmake_target_aliases", ["SPIRV-Tools"]) # before 2020.5, kept for conveniency + self.cpp_info.components["spirv-tools-core"].libs = ["SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools"] + self.cpp_info.components["spirv-tools-core"].requires = ["spirv-headers::spirv-headers"] + if self.options.shared: + self.cpp_info.components["spirv-tools-core"].defines = ["SPIRV_TOOLS_SHAREDLIB"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spirv-tools-core"].system_libs.extend(["m", "rt"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["spirv-tools-core"].system_libs.append(libcxx) + + # FIXME: others components should have their own CMake config file + if not self.options.shared: + # SPIRV-Tools-opt + self.cpp_info.components["spirv-tools-opt"].set_property("cmake_target_name", "SPIRV-Tools-opt") + self.cpp_info.components["spirv-tools-opt"].libs = ["SPIRV-Tools-opt"] + self.cpp_info.components["spirv-tools-opt"].requires = ["spirv-tools-core", "spirv-headers::spirv-headers"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spirv-tools-opt"].system_libs.append("m") + + # SPIRV-Tools-link + self.cpp_info.components["spirv-tools-link"].set_property("cmake_target_name", "SPIRV-Tools-link") + self.cpp_info.components["spirv-tools-link"].libs = ["SPIRV-Tools-link"] + self.cpp_info.components["spirv-tools-link"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + # SPIRV-Tools-reduce + self.cpp_info.components["spirv-tools-reduce"].set_property("cmake_target_name", "SPIRV-Tools-reduce") + self.cpp_info.components["spirv-tools-reduce"].libs = ["SPIRV-Tools-reduce"] + self.cpp_info.components["spirv-tools-reduce"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + # SPIRV-Tools-lint + self.cpp_info.components["spirv-tools-lint"].set_property("cmake_target_name", "SPIRV-Tools-lint") + self.cpp_info.components["spirv-tools-lint"].libs = ["SPIRV-Tools-lint"] + self.cpp_info.components["spirv-tools-lint"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + # SPIRV-Tools-diff + self.cpp_info.components["spirv-tools-diff"].set_property("cmake_target_name", "SPIRV-Tools-diff") + self.cpp_info.components["spirv-tools-diff"].libs = ["SPIRV-Tools-diff"] + self.cpp_info.components["spirv-tools-diff"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + if self.options.build_executables: + self.env_info.path.append(os.path.join(self.package_folder, "bin")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "SPIRV-Tools" + self.cpp_info.filenames["cmake_find_package_multi"] = "SPIRV-Tools" + self.cpp_info.names["pkg_config"] = "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools" + self.cpp_info.components["spirv-tools-core"].names["cmake_find_package"] = "SPIRV-Tools" + self.cpp_info.components["spirv-tools-core"].names["cmake_find_package_multi"] = "SPIRV-Tools" + self.cpp_info.components["spirv-tools-core"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-core"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if not self.options.shared: + self.cpp_info.components["spirv-tools-opt"].names["cmake_find_package"] = "SPIRV-Tools-opt" + self.cpp_info.components["spirv-tools-opt"].names["cmake_find_package_multi"] = "SPIRV-Tools-opt" + self.cpp_info.components["spirv-tools-opt"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-opt"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-link"].names["cmake_find_package"] = "SPIRV-Tools-link" + self.cpp_info.components["spirv-tools-link"].names["cmake_find_package_multi"] = "SPIRV-Tools-link" + self.cpp_info.components["spirv-tools-link"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-link"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-reduce"].names["cmake_find_package"] = "SPIRV-Tools-reduce" + self.cpp_info.components["spirv-tools-reduce"].names["cmake_find_package_multi"] = "SPIRV-Tools-reduce" + self.cpp_info.components["spirv-tools-reduce"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-reduce"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-lint"].names["cmake_find_package"] = "SPIRV-Tools-lint" + self.cpp_info.components["spirv-tools-lint"].names["cmake_find_package_multi"] = "SPIRV-Tools-lint" + self.cpp_info.components["spirv-tools-lint"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-lint"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-diff"].names["cmake_find_package"] = "SPIRV-Tools-diff" + self.cpp_info.components["spirv-tools-diff"].names["cmake_find_package_multi"] = "SPIRV-Tools-diff" + self.cpp_info.components["spirv-tools-diff"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["spirv-tools-diff"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/spirv-tools/all/test_package/CMakeLists.txt b/recipes/spirv-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..71afec6288abe --- /dev/null +++ b/recipes/spirv-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(SPIRV-Tools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_c test_package.c) +if(TARGET SPIRV-Tools-shared) + target_link_libraries(${PROJECT_NAME}_c PRIVATE SPIRV-Tools-shared) +elseif(TARGET SPIRV-Tools-static) + target_link_libraries(${PROJECT_NAME}_c PRIVATE SPIRV-Tools-static) +else() + target_link_libraries(${PROJECT_NAME}_c PRIVATE SPIRV-Tools) +endif() + +# TODO: we should call find_package(SPIRV-Tools-opt REQUIRED CONFIG), but not modeled right now +if(TARGET SPIRV-Tools-opt) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE SPIRV-Tools-opt) + if(SPIRV-Tools_VERSION VERSION_LESS "1.3.243.0") + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + else() + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_17) + endif() +endif() diff --git a/recipes/spirv-tools/all/test_package/conanfile.py b/recipes/spirv-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d8eaf2ab17123 --- /dev/null +++ b/recipes/spirv-tools/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") + bin_path_cpp = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + if os.path.exists(bin_path_cpp): + self.run(bin_path_cpp, env="conanrun") diff --git a/recipes/spirv-tools/all/test_package/test_package.c b/recipes/spirv-tools/all/test_package/test_package.c new file mode 100644 index 0000000000000..932428db546e7 --- /dev/null +++ b/recipes/spirv-tools/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "spirv-tools/libspirv.h" + +int main(int argc, char ** argv) +{ +const char input_text[] = + "OpCapability Shader\n" + "OpCapability Linkage\n" + "OpMemoryModel Logical GLSL450"; + spv_text text; + spv_binary binary; + spv_context context; + + context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + + binary = 0; + if( SPV_SUCCESS != spvTextToBinary(context, input_text, sizeof(input_text), &binary, 0) ) + { + return 1; + } + + text = 0; + if( SPV_SUCCESS != spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, 0) ) + { + return 1; + } + + spvTextDestroy(text); + spvBinaryDestroy(binary); + spvContextDestroy(context); + return 0; +} diff --git a/recipes/spirv-tools/all/test_package/test_package.cpp b/recipes/spirv-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a1e22c7365ae8 --- /dev/null +++ b/recipes/spirv-tools/all/test_package/test_package.cpp @@ -0,0 +1,65 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This program demonstrates basic SPIR-V module processing using +// SPIRV-Tools C++ API: +// * Assembling +// * Validating +// * Optimizing +// * Disassembling + +#include +#include +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +int main() { + const std::string source = + " OpCapability Linkage " + " OpCapability Shader " + " OpMemoryModel Logical GLSL450 " + " OpSource GLSL 450 " + " OpDecorate %spec SpecId 1 " + " %int = OpTypeInt 32 1 " + " %spec = OpSpecConstant %int 0 " + "%const = OpConstant %int 42"; + + spvtools::SpirvTools core(SPV_ENV_UNIVERSAL_1_3); + spvtools::Optimizer opt(SPV_ENV_UNIVERSAL_1_3); + + auto print_msg_to_stderr = [](spv_message_level_t, const char*, + const spv_position_t&, const char* m) { + std::cerr << "error: " << m << std::endl; + }; + core.SetMessageConsumer(print_msg_to_stderr); + opt.SetMessageConsumer(print_msg_to_stderr); + + std::vector spirv; + if (!core.Assemble(source, &spirv)) return 1; + if (!core.Validate(spirv)) return 1; + + opt.RegisterPass(spvtools::CreateSetSpecConstantDefaultValuePass({{1, "42"}})) + .RegisterPass(spvtools::CreateFreezeSpecConstantValuePass()) + .RegisterPass(spvtools::CreateUnifyConstantPass()) + .RegisterPass(spvtools::CreateStripDebugInfoPass()); + if (!opt.Run(spirv.data(), spirv.size(), &spirv)) return 1; + + std::string disassembly; + if (!core.Disassemble(spirv, &disassembly)) return 1; + std::cout << disassembly << "\n"; + + return 0; +} diff --git a/recipes/spirv-tools/all/test_v1_package/CMakeLists.txt b/recipes/spirv-tools/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/spirv-tools/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/spirv-tools/all/test_v1_package/conanfile.py b/recipes/spirv-tools/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0244d69a545f1 --- /dev/null +++ b/recipes/spirv-tools/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) + if not self.options["spirv-tools"].shared: + bin_path_cpp = os.path.join("bin", "test_package_cpp") + self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/spirv-tools/config.yml b/recipes/spirv-tools/config.yml new file mode 100644 index 0000000000000..292ee24f61cbb --- /dev/null +++ b/recipes/spirv-tools/config.yml @@ -0,0 +1,15 @@ +versions: + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.224.0": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all diff --git a/recipes/spix/all/conandata.yml b/recipes/spix/all/conandata.yml new file mode 100644 index 0000000000000..85ea4e8fd6a62 --- /dev/null +++ b/recipes/spix/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.4": + url: "https://github.com/faaxm/spix/archive/refs/tags/v0.4.tar.gz" + sha256: "e787c08840c37e5b153c0139f3bb613a2729ae8f6ccd0fb450fef92971cd8b53" + "0.5": + url: "https://github.com/faaxm/spix/archive/refs/tags/v0.5.tar.gz" + sha256: "d3fd9bb069aef6ff6c93c69524ed3603afd24e6b52e4bb8d093c80cec255d4dc" +patches: + "0.4": + - patch_file: "patches/0001-use-conan-libs-0.4.patch" + patch_description: "Link to conan libs" + patch_type: "conan" + "0.5": + - patch_file: "patches/0001-use-conan-libs-0.5.patch" + patch_description: "Link to conan libs" + patch_type: "conan" diff --git a/recipes/spix/all/conanfile.py b/recipes/spix/all/conanfile.py new file mode 100644 index 0000000000000..375acd44db4e0 --- /dev/null +++ b/recipes/spix/all/conanfile.py @@ -0,0 +1,130 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class SpixConan(ConanFile): + name = "spix" + description = "UI test automation library for QtQuick/QML Apps" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/faaxm/spix" + topics = ("automation", "qt", "qml", "qt-quick", "qt5", "qtquick", "automated-testing", "qt-qml", "qml-applications") + 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 14 if self.version == "0.4" else 17 + + @property + def _compilers_minimum_version(self): + if self.version == "0.4": + return { + "Visual Studio": "14", + "msvc": "190", + "gcc": "5", + "clang": "3.4", + "apple-clang": "10" + } + else: + return { + "Visual Studio": "15.7", + "msvc": "192", # FIXME: 15.7 is actually 1914 but needs to be tested + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("anyrpc/1.0.2") + self.requires("qt/6.4.2") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + 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._minimum_cpp_standard}, which your compiler does not support." + ) + + if Version(self.dependencies["qt"].ref.version).major == 6 and not self.options["qt"].qtshadertools: + raise ConanInvalidConfiguration(f"{self.ref} requires qt:qtshadertools to get the Quick module") + if not (self.options["qt"].gui and self.options["qt"].qtdeclarative): + raise ConanInvalidConfiguration(f"{self.ref} requires qt:gui and qt:qtdeclarative to get the Quick module") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPIX_BUILD_EXAMPLES"] = False + tc.variables["SPIX_BUILD_TESTS"] = False + tc.variables["SPIX_QT_MAJOR"] = Version(self.dependencies["qt"].ref.version).major + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("anyrpc", "cmake_file_name", "AnyRPC") + deps.set_property("anyrpc", "cmake_target_name", "AnyRPC::anyrpc") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.version == "0.4" and Version(self.dependencies["qt"].ref.version).major == 6: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_CXX_STANDARD 14)", "set(CMAKE_CXX_STANDARD 17)") + + def build(self): + self._patch_sources() + 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() + + 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 = ["Spix"] + self.cpp_info.set_property("cmake_file_name", "Spix") + self.cpp_info.set_property("cmake_target_name", "Spix::Spix") + + # TODO remove once conan v2 removed cmake_find_package_* + self.cpp_info.names["cmake_find_package"] = "Spix" + self.cpp_info.names["cmake_find_package_multi"] = "Spix" diff --git a/recipes/spix/all/patches/0001-use-conan-libs-0.4.patch b/recipes/spix/all/patches/0001-use-conan-libs-0.4.patch new file mode 100644 index 0000000000000..7d0727e24bbf9 --- /dev/null +++ b/recipes/spix/all/patches/0001-use-conan-libs-0.4.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,6 @@ option(SPIX_BUILD_EXAMPLES "Build Spix examples." ON) + option(SPIX_BUILD_TESTS "Build Spix unit tests." OFF) + set(SPIX_QT_MAJOR "6" CACHE STRING "Major Qt version to build Spix against") + +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") + set(CMAKE_CXX_STANDARD 14) + + # Hide symbols unless explicitly flagged with SPIX_EXPORT diff --git a/recipes/spix/all/patches/0001-use-conan-libs-0.5.patch b/recipes/spix/all/patches/0001-use-conan-libs-0.5.patch new file mode 100644 index 0000000000000..0746373586081 --- /dev/null +++ b/recipes/spix/all/patches/0001-use-conan-libs-0.5.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,6 @@ option(SPIX_BUILD_EXAMPLES "Build Spix examples." ON) + option(SPIX_BUILD_TESTS "Build Spix unit tests." OFF) + set(SPIX_QT_MAJOR "6" CACHE STRING "Major Qt version to build Spix against") + +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") + set(CMAKE_CXX_STANDARD 17) + + # Hide symbols unless explicitly flagged with SPIX_EXPORT diff --git a/recipes/spix/all/test_package/CMakeLists.txt b/recipes/spix/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8b674ce10f424 --- /dev/null +++ b/recipes/spix/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_spix CXX) + +find_package(Spix REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_spix.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Spix::Spix) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/spix/all/test_package/conanfile.py b/recipes/spix/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ec84e70261ab1 --- /dev/null +++ b/recipes/spix/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 TestSpixConan(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_spix") + self.run(bin_path, env="conanrun") diff --git a/recipes/spix/all/test_package/test_spix.cpp b/recipes/spix/all/test_package/test_spix.cpp new file mode 100644 index 0000000000000..ad5547a31aa17 --- /dev/null +++ b/recipes/spix/all/test_package/test_spix.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include + +#include "Spix/QtQmlBot.h" + +std::mutex m; +std::condition_variable cv; + +class MyTests : public spix::TestServer +{ +protected: + void executeTest() override { cv.notify_one(); } +}; + +int main(void) +{ + spix::QtQmlBot bot; + MyTests tests; + bot.runTestServer(tests); + + // wait for the test to begin before exiting main, + // destroying the server before the test is launched + std::unique_lock lk(m); + cv.wait(lk); + + return EXIT_SUCCESS; +} diff --git a/recipes/spix/all/test_v1_package/CMakeLists.txt b/recipes/spix/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8272097b5b3da --- /dev/null +++ b/recipes/spix/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,6 @@ +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/spix/all/test_v1_package/conanfile.py b/recipes/spix/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c71bbcebecf4a --- /dev/null +++ b/recipes/spix/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestSpixV1Conan(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_spix") + self.run(bin_path, run_environment=True) diff --git a/recipes/spix/config.yml b/recipes/spix/config.yml new file mode 100644 index 0000000000000..57a887729c2ab --- /dev/null +++ b/recipes/spix/config.yml @@ -0,0 +1,5 @@ +versions: + "0.4": + folder: all + "0.5": + folder: all diff --git a/recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt b/recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..c0238c83236f9 --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.5.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/splunk-opentelemetry-cpp/all/conandata.yml b/recipes/splunk-opentelemetry-cpp/all/conandata.yml new file mode 100644 index 0000000000000..d5ceac8af92c2 --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.4.0: + url: "https://github.com/signalfx/splunk-otel-cpp/archive/refs/tags/v0.4.0.tar.gz" + sha256: "e44f3167cecfea6d1fb0fa3060cc479a0873ab6d481b9b9f57629cbc7d17bfd4" diff --git a/recipes/splunk-opentelemetry-cpp/all/conanfile.py b/recipes/splunk-opentelemetry-cpp/all/conanfile.py new file mode 100644 index 0000000000000..96d1153587973 --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/conanfile.py @@ -0,0 +1,83 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import glob + + +class SplunkOpentelemetryConan(ConanFile): + name = "splunk-opentelemetry-cpp" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/signalfx/splunk-otel-cpp" + description = "Splunk's distribution of OpenTelemetry C++" + topics = ("opentelemetry", "observability", "tracing") + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + generators = "cmake", "cmake_find_package_multi" + requires = "opentelemetry-cpp/1.0.1" + exports_sources = "CMakeLists.txt" + short_paths = True + _cmake = None + + def validate(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Architecture not supported") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _remove_unnecessary_package_files(self): + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + 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) + defs = { + "SPLUNK_CPP_EXAMPLES": False + } + self._cmake.configure(defs=defs, build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + self._remove_unnecessary_package_files() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "SplunkOpenTelemetry" + self.cpp_info.names["cmake_find_package_multi"] = "SplunkOpenTelemetry" + self.cpp_info.libs = ["SplunkOpenTelemetry"] diff --git a/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt b/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..66cd3ac3bbc17 --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SplunkOpenTelemetry CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) + +target_link_libraries(test_package SplunkOpenTelemetry::SplunkOpenTelemetry) diff --git a/recipes/splunk-opentelemetry-cpp/all/test_package/conanfile.py b/recipes/splunk-opentelemetry-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/test_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/splunk-opentelemetry-cpp/all/test_package/test_package.cpp b/recipes/splunk-opentelemetry-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c32b8e88e812f --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include + +#include + +int main(int argc, char** argv) { + splunk::OpenTelemetryOptions otelOptions = splunk::OpenTelemetryOptions() + .WithServiceName("my-service") + .WithServiceVersion("1.0") + .WithExporter(splunk::ExporterType_JaegerThriftHttp) + .WithDeploymentEnvironment("test"); + auto provider = splunk::InitOpentelemetry(otelOptions); + auto span = opentelemetry::trace::Tracer::GetCurrentSpan(); + + char traceId[32] = {0}; + char spanId[16] = {0}; + span->GetContext().trace_id().ToLowerBase16(traceId); + span->GetContext().span_id().ToLowerBase16(spanId); + printf("current span: %.*s:%.*s\n", 32, traceId, 16, spanId); + + return 0; +} diff --git a/recipes/splunk-opentelemetry-cpp/config.yml b/recipes/splunk-opentelemetry-cpp/config.yml new file mode 100644 index 0000000000000..af29e78bd9b25 --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.0": + folder: all diff --git a/recipes/spscqueue/all/conandata.yml b/recipes/spscqueue/all/conandata.yml new file mode 100644 index 0000000000000..9f09b4fdb80c1 --- /dev/null +++ b/recipes/spscqueue/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1": + url: "https://github.com/rigtorp/SPSCQueue/archive/refs/tags/v1.1.tar.gz" + sha256: "10f290c72e60ba0d7999c65926f96fab0b1c2f360ce5bbcfe0cf69448d067af5" + "1.0": + url: "https://github.com/rigtorp/SPSCQueue/archive/refs/tags/v1.0.tar.gz" + sha256: "ac7f88cc7716bb95810e1d5dfac627363cba24c685acfb35261dae13288a48ff" diff --git a/recipes/spscqueue/all/conanfile.py b/recipes/spscqueue/all/conanfile.py new file mode 100644 index 0000000000000..15e27bafeab5d --- /dev/null +++ b/recipes/spscqueue/all/conanfile.py @@ -0,0 +1,55 @@ +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.50.0" + + +class SpscqueueConan(ConanFile): + name = "spscqueue" + description = "A bounded single-producer single-consumer wait-free and lock-free queue written in C++11." + license = "MIT" + topics = ("spscqueue", "thread", "queue") + homepage = "https://github.com/rigtorp/SPSCQueue" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("gcc < 5 not supported") + + 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 + + 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_file_name", "SPSCQueue") + self.cpp_info.set_property("cmake_target_name", "SPSCQueue::SPSCQueue") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "SPSCQueue" + self.cpp_info.names["cmake_find_package_multi"] = "SPSCQueue" diff --git a/recipes/spscqueue/all/test_package/CMakeLists.txt b/recipes/spscqueue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8b3a38c02a2e2 --- /dev/null +++ b/recipes/spscqueue/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(SPSCQueue REQUIRED CONFIG) +find_package(Threads REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SPSCQueue::SPSCQueue Threads::Threads) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/spscqueue/all/test_package/conanfile.py b/recipes/spscqueue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/spscqueue/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/spscqueue/all/test_package/test_package.cpp b/recipes/spscqueue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..461eb0e7eff27 --- /dev/null +++ b/recipes/spscqueue/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +#include +#include + +int main() { + rigtorp::SPSCQueue q(2); + + auto t = std::thread([&] { + while (!q.front()); + std::cout << *q.front() << std::endl; + q.pop(); + }); + + q.push(1); + t.join(); + + return 0; +} diff --git a/recipes/spscqueue/all/test_v1_package/CMakeLists.txt b/recipes/spscqueue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d44850ff451c0 --- /dev/null +++ b/recipes/spscqueue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SPSCQueue REQUIRED CONFIG) +find_package(Threads REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SPSCQueue::SPSCQueue Threads::Threads) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/spscqueue/all/test_v1_package/conanfile.py b/recipes/spscqueue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/spscqueue/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/spscqueue/config.yml b/recipes/spscqueue/config.yml new file mode 100644 index 0000000000000..cb6ed8aaedec6 --- /dev/null +++ b/recipes/spscqueue/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1": + folder: all + "1.0": + folder: all diff --git a/recipes/spy/all/conandata.yml b/recipes/spy/all/conandata.yml new file mode 100644 index 0000000000000..a03c066af9192 --- /dev/null +++ b/recipes/spy/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.0": + url: "https://github.com/jfalcou/spy/archive/1.0.0.tar.gz" + sha256: "ae2f508460b3b21436a652e281e1cf44370da5871a9d13086daa04a9e2bd7d1b" + "0.0.4": + url: "https://github.com/jfalcou/spy/archive/0.0.4.tar.gz" + sha256: "714285028c841114fb305780f4c2fe41ab5300cd8955ddee26bc817937d7aa4c" diff --git a/recipes/spy/all/conanfile.py b/recipes/spy/all/conanfile.py new file mode 100644 index 0000000000000..4e3adabd43a05 --- /dev/null +++ b/recipes/spy/all/conanfile.py @@ -0,0 +1,71 @@ +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 +import os + +required_conan_version = ">=1.50.0" + + +class SpyConan(ConanFile): + name = "spy" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://jfalcou.github.io/spy/" + description = "C++ 17 for constexpr-proof detection and classification of informations about OS, compiler, etc..." + topics = ("c++17", "config", "metaprogramming") + 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.4", + "Visual Studio": "15.7", + "clang": "6", + "apple-clang": "10", + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + 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, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/spy/all/test_package/CMakeLists.txt b/recipes/spy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..caa8001d48046 --- /dev/null +++ b/recipes/spy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(spy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE spy::spy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/spy/all/test_package/conanfile.py b/recipes/spy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/spy/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/spy/all/test_package/test_package.cpp b/recipes/spy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..663315091f2dc --- /dev/null +++ b/recipes/spy/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() +{ + std::cout << spy::operating_system << std::endl; + std::cout << spy::architecture << std::endl; + std::cout << spy::simd_instruction_set << std::endl; + std::cout << spy::compiler << std::endl; + std::cout << spy::libc << std::endl; + std::cout << spy::stdlib << std::endl; +} diff --git a/recipes/spy/all/test_v1_package/CMakeLists.txt b/recipes/spy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4d114077005dc --- /dev/null +++ b/recipes/spy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(spy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE spy::spy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/spy/all/test_v1_package/conanfile.py b/recipes/spy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/spy/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/spy/config.yml b/recipes/spy/config.yml new file mode 100644 index 0000000000000..1d92b70b7b274 --- /dev/null +++ b/recipes/spy/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.0": + folder: all + "0.0.4": + folder: all diff --git a/recipes/sqlcipher/all/conandata.yml b/recipes/sqlcipher/all/conandata.yml new file mode 100644 index 0000000000000..1c771e01ba689 --- /dev/null +++ b/recipes/sqlcipher/all/conandata.yml @@ -0,0 +1,62 @@ +sources: + "4.5.1": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.1.zip" + sha256: "08a1024b299b5527d5b5ed79f67957938b516567f68662e973c4bec1b843b28e" + "4.5.0": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.0.zip" + sha256: "ce754d1fc1f55c7b39bdab28ee0e4a5c1e286254e2fbbab43e2c8135e5e6ab49" + "4.4.3": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.4.3.zip" + sha256: "e52d0595dc1ed30eed68523fe286d38657bd905957447a3725706ff54e21edf8" + "4.4.2": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.4.2.zip" + sha256: "6bb5c154ef979ddd28f4668846f394ae2ccbf6cece09a9148b73fadf8adc7b55" + "4.4.0": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.4.0.zip" + sha256: "99b6324c2af52d6483d3ff8de84c81bb3a9676429fc700cb55cdb07787d3c0fa" + "4.3.0": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.3.0.zip" + sha256: "41e1408465488e9c478ca5b7c5f8410405a10caa73b82db60ac115a76c563c05" +patches: + "4.5.1": + - patch_file: patches/Makefile.in-v4.5.1.patch + base_path: source_subfolder + - patch_file: patches/Makefile.msc-v4.5.1.patch + base_path: source_subfolder + - patch_file: patches/fix_configure-v4.5.1.patch + base_path: source_subfolder + "4.5.0": + - patch_file: patches/Makefile.in-v4.5.0.patch + base_path: source_subfolder + - patch_file: patches/Makefile.msc-v4.5.0.patch + base_path: source_subfolder + - patch_file: patches/fix_configure-v4.5.0.patch + base_path: source_subfolder + "4.4.3": + - patch_file: patches/Makefile.in-v4.4.3.patch + base_path: source_subfolder + - patch_file: patches/Makefile.msc-v4.4.3.patch + base_path: source_subfolder + - patch_file: patches/fix_configure-v4.4.3.patch + base_path: source_subfolder + "4.4.2": + - patch_file: patches/Makefile.in-v4.4.2.patch + base_path: source_subfolder + - patch_file: patches/Makefile.msc-v4.4.2.patch + base_path: source_subfolder + - patch_file: patches/fix_configure-v4.4.2.patch + base_path: source_subfolder + "4.4.0": + - patch_file: patches/Makefile.in-v4.4.0.patch + base_path: source_subfolder + - patch_file: patches/Makefile.msc-v4.4.0.patch + base_path: source_subfolder + - patch_file: patches/fix_configure-v4.4.0.patch + base_path: source_subfolder + "4.3.0": + - patch_file: patches/Makefile.in-v4.3.0.patch + base_path: source_subfolder + - patch_file: patches/Makefile.msc-v4.3.0.patch + base_path: source_subfolder + - patch_file: patches/fix_configure-v4.3.0.patch + base_path: source_subfolder diff --git a/recipes/sqlcipher/all/conanfile.py b/recipes/sqlcipher/all/conanfile.py new file mode 100644 index 0000000000000..8b2584d0bea74 --- /dev/null +++ b/recipes/sqlcipher/all/conanfile.py @@ -0,0 +1,233 @@ +from conan.tools.microsoft import msvc_runtime_flag +from conans import tools, ConanFile, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import functools +import os +import shutil + +required_conan_version = ">=1.36.0" + + +class SqlcipherConan(ConanFile): + name = "sqlcipher" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.zetetic.net/sqlcipher/" + description = "SQLite extension that provides 256 bit AES encryption of database files." + topics = ("database", "encryption", "SQLite") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "crypto_library": ["openssl", "libressl", "commoncrypto"], + "with_largefile": [True, False], + "temporary_store": ["always_file", "default_file", "default_memory", "always_memory"], + } + default_options = { + "shared": False, + "fPIC": True, + "crypto_library": "openssl", + "with_largefile": True, + "temporary_store": "default_memory", + } + + @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): + 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 + if self.settings.os != "Linux": + del self.options.with_largefile + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.crypto_library == "openssl": + self.requires("openssl/1.1.1n") + elif self.options.crypto_library == "libressl": + self.requires("libressl/3.4.3") + + def validate(self): + if self.options.crypto_library == "commoncrypto" and not tools.is_apple_os(self.settings.os): + raise ConanInvalidConfiguration("commoncrypto is only supported on Macos") + + def build_requirements(self): + self.build_requires("tcl/8.6.11") + 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") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @property + def _temp_store_nmake_value(self): + return {"always_file": "0", + "default_file": "1", + "default_memory": "2", + "always_memory": "3"}.get(str(self.options.temporary_store)) + + @property + def _temp_store_autotools_value(self): + return {"always_file": "never", + "default_file": "no", + "default_memory": "yes", + "always_memory": "always"}.get(str(self.options.temporary_store)) + + def _build_visual(self): + crypto_dep = self.deps_cpp_info[str(self.options.crypto_library)] + crypto_incdir = crypto_dep.include_paths[0] + crypto_libdir = crypto_dep.lib_paths[0] + libs = map(lambda lib : lib + ".lib", crypto_dep.libs) + system_libs = map(lambda lib : lib + ".lib", crypto_dep.system_libs) + + nmake_flags = [ + "TLIBS=\"%s %s\"" % (" ".join(libs), " ".join(system_libs)), + "LTLIBPATHS=/LIBPATH:%s" % crypto_libdir, + "OPTS=\"-I%s -DSQLITE_HAS_CODEC\"" % (crypto_incdir), + "NO_TCL=1", + "USE_AMALGAMATION=1", + "OPT_FEATURE_FLAGS=-DSQLCIPHER_CRYPTO_OPENSSL", + "SQLITE_TEMP_STORE=%s" % self._temp_store_nmake_value, + "TCLSH_CMD=%s" % self.deps_env_info.TCLSH, + ] + + main_target = "dll" if self.options.shared else "sqlcipher.lib" + + if msvc_runtime_flag(self) in ["MD", "MDd"]: + nmake_flags.append("USE_CRT_DLL=1") + if self.settings.build_type == "Debug": + nmake_flags.append("DEBUG=2") + nmake_flags.append("FOR_WIN10=1") + platforms = {"x86": "x86", "x86_64": "x64"} + nmake_flags.append("PLATFORM=%s" % platforms[str(self.settings.arch)]) + vcvars = tools.vcvars_command(self.settings) + self.run("%s && nmake /f Makefile.msc %s %s" % (vcvars, main_target, " ".join(nmake_flags)), cwd=self._source_subfolder) + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def _build_autotools(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")) + configure = os.path.join(self._source_subfolder, "configure") + self._chmod_plus_x(configure) + # relocatable shared libs on macOS + tools.replace_in_file(configure, "-install_name \\$rpath/", "-install_name @rpath/") + # avoid SIP issues on macOS when dependencies are shared + if tools.is_apple_os(self.settings.os): + libpaths = ":".join(self.deps_cpp_info.lib_paths) + tools.replace_in_file( + configure, + "#! /bin/sh\n", + "#! /bin/sh\nexport DYLD_LIBRARY_PATH={}:$DYLD_LIBRARY_PATH\n".format(libpaths), + ) + autotools = self._configure_autotools() + autotools.make() + + @functools.lru_cache(1) + def _configure_autotools(self): + 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)), + "--enable-tempstore={}".format(self._temp_store_autotools_value), + "--disable-tcl", + ] + if self.settings.os == "Windows": + args.extend(["config_BUILD_EXEEXT='.exe'", "config_TARGET_EXEEXT='.exe'"]) + + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + if self.settings.os == "Linux": + autotools.libs.append("dl") + if not self.options.with_largefile: + autotools.defines.append("SQLITE_DISABLE_LFS=1") + autotools.defines.append("SQLITE_HAS_CODEC") + + env_vars = autotools.vars + tclsh_cmd = self.deps_env_info.TCLSH + env_vars["TCLSH_CMD"] = tclsh_cmd.replace("\\", "/") + if self._use_commoncrypto(): + env_vars["LDFLAGS"] += " -framework Security -framework CoreFoundation " + args.append("--with-crypto-lib=commoncrypto") + else: + autotools.defines.append("SQLCIPHER_CRYPTO_OPENSSL") + + autotools.configure(configure_dir=self._source_subfolder, args=args, vars=env_vars) + if self.settings.os == "Windows": + # sqlcipher will create .exe for the build machine, which we defined to Linux... + tools.replace_in_file("Makefile", "BEXE = .exe", "BEXE = ") + return autotools + + def _use_commoncrypto(self): + return self.options.crypto_library == "commoncrypto" and tools.is_apple_os(self.settings.os) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if self._is_msvc: + self._build_visual() + else: + self._build_autotools() + + def _package_unix(self): + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def _package_visual(self): + self.copy("*.dll", dst="bin", keep_path=False) + self.copy("*.lib", dst="lib", keep_path=False) + self.copy("sqlite3.h", src=self._source_subfolder, dst=os.path.join("include", "sqlcipher")) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + if self._is_msvc: + self._package_visual() + else: + self._package_unix() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "sqlcipher") + self.cpp_info.libs = ["sqlcipher"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl"]) + if tools.Version(self.version) >= "4.5.0": + self.cpp_info.system_libs.append("m") + self.cpp_info.defines = ["SQLITE_HAS_CODEC", "SQLITE_TEMP_STORE={}".format(self._temp_store_nmake_value)] + if self._use_commoncrypto(): + self.cpp_info.frameworks = ["Security", "CoreFoundation"] + else: + self.cpp_info.defines.append("SQLCIPHER_CRYPTO_OPENSSL") + # Allow using #include even with sqlcipher (for libs like sqlpp11-connector-sqlite3) + self.cpp_info.includedirs.append(os.path.join("include", "sqlcipher")) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch new file mode 100644 index 0000000000000..bcbdb0576a7ab --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.in b/Makefile.in +index a8eeae2..3af2a2c 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -647,7 +647,7 @@ DBFUZZ_OPT = + # 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 sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1449,9 +1449,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) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch new file mode 100644 index 0000000000000..53552fe2b59b4 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.in b/Makefile.in +index d8f5a62..57b54d5 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -647,7 +647,7 @@ DBFUZZ_OPT = + # 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 sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1445,9 +1445,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) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch new file mode 100644 index 0000000000000..122925179901b --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.in b/Makefile.in +index 3f810ab..e4c70c1 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -654,7 +654,7 @@ DBFUZZ_OPT = + # 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 sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1469,9 +1469,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) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.3.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.3.patch new file mode 100644 index 0000000000000..17f775f722267 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.3.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.in b/Makefile.in +index d365631..cb1c867 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -655,7 +655,7 @@ DBFUZZ_OPT = + # 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 sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1472,9 +1472,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) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch new file mode 100644 index 0000000000000..798675993e00c --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.in b/Makefile.in +index 77c190a..2744de2 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -655,7 +655,7 @@ DBFUZZ_OPT = + # 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 sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1477,9 +1477,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) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch new file mode 100644 index 0000000000000..9c39625141986 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.in b/Makefile.in +index ad4be7b..3304cc8 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -657,7 +657,7 @@ DBFUZZ_OPT = + # 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 sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1482,9 +1482,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) diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch new file mode 100644 index 0000000000000..9979f61586fe4 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch @@ -0,0 +1,161 @@ +diff --git a/Makefile.msc b/Makefile.msc +index 9baa035..88d21e4 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -270,9 +270,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 + +@@ -280,9 +280,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 + +@@ -649,7 +649,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 = +@@ -672,7 +672,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 = +@@ -707,8 +707,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 +@@ -985,8 +986,10 @@ 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*). +@@ -1152,14 +1155,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)" +@@ -1214,7 +1218,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 \ +@@ -1702,7 +1706,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. + # +@@ -1721,11 +1725,12 @@ 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 libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1747,9 +1752,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)?_[^@]*)(?:@\d+)?$$" \1 \ + | sort >> sqlite3.def + # <> +@@ -1927,6 +1932,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 + +@@ -2336,7 +2350,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/Makefile.msc-v4.4.0.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.0.patch new file mode 100644 index 0000000000000..1c68b8dd21ed3 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.0.patch @@ -0,0 +1,161 @@ +diff --git a/Makefile.msc b/Makefile.msc +index d59ca46..925061e 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -276,9 +276,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 + +@@ -286,9 +286,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 + +@@ -662,7 +662,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 = +@@ -685,7 +685,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 = +@@ -720,8 +720,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 +@@ -998,8 +999,10 @@ 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*). +@@ -1165,14 +1168,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)" +@@ -1227,7 +1231,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 \ +@@ -1715,7 +1719,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. + # +@@ -1734,11 +1738,12 @@ 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 libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1760,9 +1765,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 + # <> +@@ -1940,6 +1945,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 + +@@ -2349,7 +2363,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/Makefile.msc-v4.4.2.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.2.patch new file mode 100644 index 0000000000000..d765cd3530816 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.2.patch @@ -0,0 +1,161 @@ +diff --git a/Makefile.msc b/Makefile.msc +index 2261ee9..0e3e710 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -285,9 +285,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 + +@@ -295,9 +295,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 + +@@ -672,7 +672,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 = +@@ -695,7 +695,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 = +@@ -730,8 +730,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 +@@ -1008,8 +1009,10 @@ 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*). +@@ -1175,14 +1178,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)" +@@ -1237,7 +1241,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 \ +@@ -1729,7 +1733,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. + # +@@ -1748,11 +1752,12 @@ 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 libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1774,9 +1779,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 + # <> +@@ -1956,6 +1961,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 + +@@ -2380,7 +2394,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/Makefile.msc-v4.4.3.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.3.patch new file mode 100644 index 0000000000000..b5bda699c634b --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.3.patch @@ -0,0 +1,161 @@ +diff --git a/Makefile.msc b/Makefile.msc +index 312b40c..fb4c3cc 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -285,9 +285,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 + +@@ -295,9 +295,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 + +@@ -672,7 +672,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 = +@@ -695,7 +695,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 = +@@ -730,8 +730,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 +@@ -1008,8 +1009,10 @@ 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*). +@@ -1175,14 +1178,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)" +@@ -1237,7 +1241,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 \ +@@ -1730,7 +1734,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. + # +@@ -1749,11 +1753,12 @@ 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 libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1775,9 +1780,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 + # <> +@@ -1957,6 +1962,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 + +@@ -2382,7 +2396,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/Makefile.msc-v4.5.0.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.0.patch new file mode 100644 index 0000000000000..4e15846c5b1bd --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.0.patch @@ -0,0 +1,161 @@ +diff --git a/Makefile.msc b/Makefile.msc +index 5e95d84..42d9c69 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -285,9 +285,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 + +@@ -295,9 +295,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 + +@@ -674,7 +674,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 = +@@ -697,7 +697,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 = +@@ -732,8 +732,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 +@@ -1010,8 +1011,10 @@ 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*). +@@ -1177,14 +1180,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)" +@@ -1239,7 +1243,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 \ +@@ -1732,7 +1736,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. + # +@@ -1751,11 +1755,12 @@ 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 libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1777,9 +1782,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 + # <> +@@ -1959,6 +1964,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 + +@@ -2385,7 +2399,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/Makefile.msc-v4.5.1.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.1.patch new file mode 100644 index 0000000000000..7fb970d1364d5 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.1.patch @@ -0,0 +1,161 @@ +diff --git a/Makefile.msc b/Makefile.msc +index 49e7daa..cd6ba91 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -286,9 +286,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 + +@@ -296,9 +296,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 + +@@ -675,7 +675,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 = +@@ -698,7 +698,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 = +@@ -733,8 +733,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 +@@ -1011,8 +1012,10 @@ 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*). +@@ -1178,14 +1181,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)" +@@ -1240,7 +1244,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 \ +@@ -1735,7 +1739,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. + # +@@ -1754,11 +1758,12 @@ 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 libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1780,9 +1785,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 + # <> +@@ -1962,6 +1967,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 + +@@ -2388,7 +2402,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.3.0.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.3.0.patch new file mode 100644 index 0000000000000..5d20efbba5494 --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.3.0.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index ce44d5c..bc79910 100644 +--- a/configure ++++ b/configure +@@ -12092,7 +12092,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12127,7 +12126,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : + #define HAVE_LIBCRYPTO 1 + _ACEOF + +- LIBS="-lcrypto $LIBS" + + else + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch new file mode 100644 index 0000000000000..be33ac4e78f9b --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index c90edcc..f1d48e6 100644 +--- a/configure ++++ b/configure +@@ -12094,7 +12094,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12129,7 +12128,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : + #define HAVE_LIBCRYPTO 1 + _ACEOF + +- LIBS="-lcrypto $LIBS" + + else + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch new file mode 100644 index 0000000000000..c4d26f253f633 --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index 5852752..43af5af 100755 +--- a/configure ++++ b/configure +@@ -12125,7 +12125,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12160,7 +12159,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : + #define HAVE_LIBCRYPTO 1 + _ACEOF + +- LIBS="-lcrypto $LIBS" + + else + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.4.3.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.4.3.patch new file mode 100644 index 0000000000000..24193add0e40e --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.4.3.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index 55102b0..32f5bdd 100755 +--- a/configure ++++ b/configure +@@ -12118,7 +12118,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12153,7 +12152,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : + #define HAVE_LIBCRYPTO 1 + _ACEOF + +- LIBS="-lcrypto $LIBS" + + else + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch new file mode 100644 index 0000000000000..0a44e1e4e6e47 --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index 1142624..7f1680f 100755 +--- a/configure ++++ b/configure +@@ -12127,7 +12127,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12162,7 +12161,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : + #define HAVE_LIBCRYPTO 1 + _ACEOF + +- LIBS="-lcrypto $LIBS" + + else + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch new file mode 100644 index 0000000000000..97f93ba573a2e --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index a2909ce..9c25987 100755 +--- a/configure ++++ b/configure +@@ -12127,7 +12127,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12162,7 +12161,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : + #define HAVE_LIBCRYPTO 1 + _ACEOF + +- LIBS="-lcrypto $LIBS" + + else + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/test_package/CMakeLists.txt b/recipes/sqlcipher/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fcf18155285d5 --- /dev/null +++ b/recipes/sqlcipher/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sqlcipher REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} sqlcipher::sqlcipher) diff --git a/recipes/sqlcipher/all/test_package/conanfile.py b/recipes/sqlcipher/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5741e4e0cec54 --- /dev/null +++ b/recipes/sqlcipher/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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 self.settings.os == "Macos" 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): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/sqlcipher/all/test_package/test_package.c b/recipes/sqlcipher/all/test_package/test_package.c new file mode 100644 index 0000000000000..ec2d8f4292f55 --- /dev/null +++ b/recipes/sqlcipher/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +int main() { + sqlite3* db; + sqlite3_open(":memory:", &db); + int ret = sqlite3_key(db, "toto", 5); + sqlite3_close(db); + return ret; +} diff --git a/recipes/sqlcipher/config.yml b/recipes/sqlcipher/config.yml new file mode 100644 index 0000000000000..939fca7342f84 --- /dev/null +++ b/recipes/sqlcipher/config.yml @@ -0,0 +1,13 @@ +versions: + "4.5.1": + folder: all + "4.5.0": + folder: all + "4.4.3": + folder: all + "4.4.2": + folder: all + "4.4.0": + folder: all + "4.3.0": + folder: all diff --git a/recipes/sqlite3/all/CMakeLists.txt b/recipes/sqlite3/all/CMakeLists.txt new file mode 100644 index 0000000000000..1f1e60b9b2dcf --- /dev/null +++ b/recipes/sqlite3/all/CMakeLists.txt @@ -0,0 +1,186 @@ +cmake_minimum_required(VERSION 3.7) +project(sqlite3 LANGUAGES C) + +# Add some options from https://sqlite.org/compile.html +option(SQLITE3_BUILD_EXECUTABLE "Build sqlite command line utility for accessing SQLite databases") +option(ENABLE_JSON1 "Enable JSON SQL functions") +option(ENABLE_COLUMN_METADATA "Enable additional APIs that provide convenient access to meta-data about tables and queries") +option(ENABLE_DBSTAT_VTAB "Enable the DBSTAT virtual table") +option(ENABLE_EXPLAIN_COMMENTS "Enable SQLite to insert comment text into the output of EXPLAIN") +option(ENABLE_FTS3 "Enable version 3 of the full-text search engine") +option(ENABLE_FTS3_PARENTHESIS "Kodifies the query pattern parser in FTS3 such that it supports operators AND and NOT (in addition to the usual OR and NEAR) and also allows query expressions to contain nested parenthesis") +option(ENABLE_FTS4 "Enable version 3 and 4 of the full-text search engine") +option(ENABLE_FTS5 "Enable version 5 of the full-text search engine") +option(ENABLE_SOUNDEX "Enable the soundex() SQL function") +option(ENABLE_PREUPDATE_HOOK "Enables APIs to handle any change to a rowid table") +option(ENABLE_RTREE "Enable support for the R*Tree index extension") +option(ENABLE_UNLOCK_NOTIFY "Enable support for the unlock notify API") +option(ENABLE_DEFAULT_SECURE_DELETE "Turns on secure deletion by default") +option(USE_ALLOCA "The alloca() memory allocator will be used in a few situations where it is appropriate.") +option(OMIT_LOAD_EXTENSION "Omits the entire extension loading mechanism from SQLite") +option(OMIT_DEPRECATED "Omits deprecated interfaces and features") +if(SQLITE3_VERSION VERSION_GREATER_EQUAL "3.35.0") + option(ENABLE_MATH_FUNCTIONS "Enables the built-in SQL math functions" ON) +else() + set(ENABLE_MATH_FUNCTIONS OFF) +endif() +option(HAVE_FDATASYNC "Use fdatasync() instead of fsync() on unix systems") +option(HAVE_GMTIME_R "Use the threadsafe gmtime_r()") +option(HAVE_LOCALTIME_R "Use the threadsafe localtime_r()") +option(HAVE_POSIX_FALLOCATE "Use posix_fallocate()") +option(HAVE_STRERROR_R "Use strerror_r()") +option(HAVE_USLEEP "Use usleep() system call to implement the xSleep method") +option(DISABLE_GETHOSTUUID "Disable function gethostuuid") +set(MAX_COLUMN CACHE STRING "The maximum number of columns in a table / index / view") +set(MAX_VARIABLE_NUMBER CACHE STRING "The maximum value of a ?nnn wildcard that the parser will accept") +set(MAX_BLOB_SIZE CACHE STRING "Set the maximum number of bytes in a string or BLOB") +option(DISABLE_DEFAULT_VFS "Disable default VFS implementation") +option(ENABLE_DBPAGE_VTAB "The SQLITE_DBPAGE extension implements an eponymous-only virtual table that provides direct access to the underlying database file by interacting with the pager. SQLITE_DBPAGE is capable of both reading and writing any page of the database. Because interaction is through the pager layer, all changes are transactional.") + +add_library(${PROJECT_NAME} ${SQLITE3_SRC_DIR}/sqlite3.c) +set_target_properties(${PROJECT_NAME} PROPERTIES C_VISIBILITY_PRESET hidden) +if(BUILD_SHARED_LIBS) + if(WIN32) + target_compile_definitions(${PROJECT_NAME} + PRIVATE "SQLITE_API=__declspec(dllexport)" + INTERFACE "SQLITE_API=__declspec(dllimport)" + ) + else() + target_compile_definitions(${PROJECT_NAME} + PUBLIC "SQLITE_API=__attribute__((visibility(\"default\")))" + ) + endif() +endif() +if(ENABLE_JSON1) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_JSON1) +endif() +if(ENABLE_COLUMN_METADATA) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_COLUMN_METADATA) +endif() +if(ENABLE_DBSTAT_VTAB) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_DBSTAT_VTAB) +endif() +if(ENABLE_EXPLAIN_COMMENTS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_EXPLAIN_COMMENTS) +endif() +if(ENABLE_FTS3) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS3) +endif() +if(ENABLE_FTS3_PARENTHESIS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS3_PARENTHESIS) +endif() +if(ENABLE_FTS4) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS4) +endif() +if(ENABLE_FTS5) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS5) +endif() +if(ENABLE_PREUPDATE_HOOK) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_PREUPDATE_HOOK) +endif() +if(ENABLE_RTREE) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_RTREE) +endif() +if(ENABLE_UNLOCK_NOTIFY) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_UNLOCK_NOTIFY) +endif() +if(ENABLE_DEFAULT_SECURE_DELETE) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_SECURE_DELETE) +endif() +if(ENABLE_SOUNDEX) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_SOUNDEX) +endif() +if(USE_ALLOCA) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_USE_ALLOCA) +endif() +if(OMIT_LOAD_EXTENSION) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OMIT_LOAD_EXTENSION) +endif() +if (OMIT_DEPRECATED) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OMIT_DEPRECATED) +endif() +if(ENABLE_MATH_FUNCTIONS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_MATH_FUNCTIONS) +endif() +if(HAVE_FDATASYNC) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FDATASYNC) +endif() +if(HAVE_GMTIME_R) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_GMTIME_R) +endif() +if(HAVE_LOCALTIME_R) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_LOCALTIME_R) +endif() +if(HAVE_POSIX_FALLOCATE) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_POSIX_FALLOCATE) +endif() +if(HAVE_STRERROR_R) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_STRERROR_R) +endif() +if(HAVE_USLEEP) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_USLEEP) +endif() +if(DISABLE_GETHOSTUUID) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_GETHOSTUUID=0) +endif() +target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_THREADSAFE=${THREADSAFE}) +if(MAX_COLUMN) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_MAX_COLUMN=${MAX_COLUMN}) +endif() +if(MAX_VARIABLE_NUMBER) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_MAX_VARIABLE_NUMBER=${MAX_VARIABLE_NUMBER}) +endif() +if(MAX_BLOB_SIZE) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_MAX_LENGTH=${MAX_BLOB_SIZE}) +endif() +if(DISABLE_DEFAULT_VFS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OS_OTHER=1) +endif() +if(ENABLE_DBPAGE_VTAB) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_DBPAGE_VTAB) +endif() + +if(THREADSAFE) + find_package(Threads REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) +endif() + +if(NOT OMIT_LOAD_EXTENSION) + target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS}) +endif() + +if(ENABLE_FTS5 OR ENABLE_MATH_FUNCTIONS) + include(CheckLibraryExists) + # Check if math functionality is on the separate 'libm' library, + # otherwise assume that it is already part of the C runtime. + # The `m` library is part of the compiler toolchain, this checks + # if the compiler can successfully link against the library. + check_library_exists(m log "" HAVE_MATH_LIBRARY) + if(HAVE_MATH_LIBRARY) + target_link_libraries(${PROJECT_NAME} PRIVATE m) + endif() +endif() + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(DIRECTORY ${SQLITE3_SRC_DIR}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") + +if(SQLITE3_BUILD_EXECUTABLE) + add_executable(sqlite3-bin ${SQLITE3_SRC_DIR}/shell.c) + target_link_libraries(sqlite3-bin PRIVATE ${PROJECT_NAME}) + if(ENABLE_DBPAGE_VTAB) + target_compile_definitions(sqlite3-bin PRIVATE SQLITE_ENABLE_DBPAGE_VTAB) + endif() + set_target_properties(sqlite3-bin PROPERTIES OUTPUT_NAME "sqlite3" PDB_NAME "sqlite3-bin") + include(CheckSymbolExists) + check_symbol_exists(system "stdlib.h" HAVE_SYSTEM) + if(NOT HAVE_SYSTEM) + target_compile_definitions(sqlite3-bin PRIVATE SQLITE_NOHAVE_SYSTEM) + endif() + install(TARGETS sqlite3-bin DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml new file mode 100644 index 0000000000000..6d45e7f1f7b2a --- /dev/null +++ b/recipes/sqlite3/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "3.41.2": + url: "https://sqlite.org/2023/sqlite-amalgamation-3410200.zip" + sha256: "01df06a84803c1ab4d62c64e995b151b2dbcf5dbc93bbc5eee213cb18225d987" + "3.41.1": + url: "https://sqlite.org/2023/sqlite-amalgamation-3410100.zip" + sha256: "df0d54bf246521360c8148f64e7e5ad07a4665b4f902339e844f4c493d535ff5" + "3.40.1": + url: "https://sqlite.org/2022/sqlite-amalgamation-3400100.zip" + sha256: "49112cc7328392aa4e3e5dae0b2f6736d0153430143d21f69327788ff4efe734" + "3.40.0": + url: "https://sqlite.org/2022/sqlite-amalgamation-3400000.zip" + sha256: "7c23eb51409315738c930a222cf7cd41518ae5823c41e60a81b93a07070ef22a" + "3.39.4": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390400.zip" + sha256: "9c99955b21d2374f3a385d67a1f64cbacb1d4130947473d25c77ad609c03b4cd" + "3.39.3": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390300.zip" + sha256: "a89db3030d229d860ae56a8bac50ac9761434047ae886e47e7c8f9f428fa98ad" + "3.39.2": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390200.zip" + sha256: "87775784f8b22d0d0f1d7811870d39feaa7896319c7c20b849a4181c5a50609b" + "3.39.1": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390100.zip" + sha256: "f2ce17bca51b376de4fcb9d0dc174c52f472a34c29aa1ccc774f27467cc63ed7" + "3.39.0": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390000.zip" + sha256: "35109dd6e4f062f4d76b48bd7614eec35abae9d2da70351c7ef936876b064b5f" + "3.38.5": + url: "https://sqlite.org/2022/sqlite-amalgamation-3380500.zip" + sha256: "bebb039b748441e3d25d71d11f7a4a33f5df11f318ec18fa7f343d2083755e2c" + "3.37.2": + url: "https://sqlite.org/2022/sqlite-amalgamation-3370200.zip" + sha256: "cb25df0fb90b77be6660f6ace641bbea88f3d0441110d394ce418f35f7561bb0" + "3.36.0": + url: "https://sqlite.org/2021/sqlite-amalgamation-3360000.zip" + sha256: "999826fe4c871f18919fdb8ed7ec9dd8217180854dd1fe21eea96aed36186729" diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py new file mode 100644 index 0000000000000..eddf425a36988 --- /dev/null +++ b/recipes/sqlite3/all/conanfile.py @@ -0,0 +1,223 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, load, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Sqlite3Conan(ConanFile): + name = "sqlite3" + description = "Self-contained, serverless, in-process SQL database engine." + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.sqlite.org" + topics = ("sqlite", "database", "sql", "serverless") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threadsafe": [0, 1, 2], + "enable_column_metadata": [True, False], + "enable_dbstat_vtab": [True, False], + "enable_explain_comments": [True, False], + "enable_fts3": [True, False], + "enable_fts3_parenthesis": [True, False], + "enable_fts4": [True, False], + "enable_fts5": [True, False], + "enable_json1": [True, False], + "enable_soundex": [True, False], + "enable_preupdate_hook": [True, False], + "enable_rtree": [True, False], + "use_alloca": [True, False], + "omit_load_extension": [True, False], + "omit_deprecated": [True, False], + "enable_math_functions": [True, False], + "enable_unlock_notify": [True, False], + "enable_default_secure_delete": [True, False], + "disable_gethostuuid": [True, False], + "max_column": [None, "ANY"], + "max_variable_number": [None, "ANY"], + "max_blob_size": [None, "ANY"], + "build_executable": [True, False], + "enable_default_vfs": [True, False], + "enable_dbpage_vtab": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": 1, + "enable_column_metadata": True, + "enable_dbstat_vtab": False, + "enable_explain_comments": False, + "enable_fts3": False, + "enable_fts3_parenthesis": False, + "enable_fts4": False, + "enable_fts5": False, + "enable_json1": False, + "enable_soundex": False, + "enable_preupdate_hook": False, + "enable_rtree": True, + "use_alloca": False, + "omit_load_extension": False, + "omit_deprecated": False, + "enable_math_functions": True, + "enable_unlock_notify": True, + "enable_default_secure_delete": False, + "disable_gethostuuid": False, + "max_column": None, # Uses default value from source + "max_variable_number": None, # Uses default value from source + "max_blob_size": None, # Uses default value from source + "build_executable": True, + "enable_default_vfs": True, + "enable_dbpage_vtab": False, + } + + exports_sources = "CMakeLists.txt" + + @property + def _has_enable_math_function_option(self): + return Version(self.version) >= "3.35.0" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_enable_math_function_option: + del self.options.enable_math_functions + + 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 self.options.build_executable: + if not self.options.enable_default_vfs: + # Need to provide custom VFS code: https://www.sqlite.org/custombuild.html + raise ConanInvalidConfiguration("build_executable=True cannot be combined with enable_default_vfs=False") + if self.options.omit_load_extension: + raise ConanInvalidConfiguration("build_executable=True requires omit_load_extension=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SQLITE3_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["SQLITE3_VERSION"] = self.version + tc.variables["SQLITE3_BUILD_EXECUTABLE"] = self.options.build_executable + tc.variables["THREADSAFE"] = self.options.threadsafe + tc.variables["ENABLE_COLUMN_METADATA"] = self.options.enable_column_metadata + tc.variables["ENABLE_DBSTAT_VTAB"] = self.options.enable_dbstat_vtab + tc.variables["ENABLE_EXPLAIN_COMMENTS"] = self.options.enable_explain_comments + tc.variables["ENABLE_FTS3"] = self.options.enable_fts3 + tc.variables["ENABLE_FTS3_PARENTHESIS"] = self.options.enable_fts3_parenthesis + tc.variables["ENABLE_FTS4"] = self.options.enable_fts4 + tc.variables["ENABLE_FTS5"] = self.options.enable_fts5 + tc.variables["ENABLE_JSON1"] = self.options.enable_json1 + tc.variables["ENABLE_PREUPDATE_HOOK"] = self.options.enable_preupdate_hook + tc.variables["ENABLE_SOUNDEX"] = self.options.enable_soundex + tc.variables["ENABLE_RTREE"] = self.options.enable_rtree + tc.variables["ENABLE_UNLOCK_NOTIFY"] = self.options.enable_unlock_notify + tc.variables["ENABLE_DEFAULT_SECURE_DELETE"] = self.options.enable_default_secure_delete + tc.variables["USE_ALLOCA"] = self.options.use_alloca + tc.variables["OMIT_LOAD_EXTENSION"] = self.options.omit_load_extension + tc.variables["OMIT_DEPRECATED"] = self.options.omit_deprecated + if self._has_enable_math_function_option: + tc.variables["ENABLE_MATH_FUNCTIONS"] = self.options.enable_math_functions + tc.variables["HAVE_FDATASYNC"] = True + tc.variables["HAVE_GMTIME_R"] = True + tc.variables["HAVE_LOCALTIME_R"] = self.settings.os != "Windows" + tc.variables["HAVE_POSIX_FALLOCATE"] = not (self.settings.os in ["Windows", "Android"] or is_apple_os(self)) + tc.variables["HAVE_STRERROR_R"] = True + tc.variables["HAVE_USLEEP"] = True + tc.variables["DISABLE_GETHOSTUUID"] = self.options.disable_gethostuuid + if self.options.max_column: + tc.variables["MAX_COLUMN"] = self.options.max_column + if self.options.max_variable_number: + tc.variables["MAX_VARIABLE_NUMBER"] = self.options.max_variable_number + if self.options.max_blob_size: + tc.variables["MAX_BLOB_SIZE"] = self.options.max_blob_size + tc.variables["DISABLE_DEFAULT_VFS"] = not self.options.enable_default_vfs + tc.variables["ENABLE_DBPAGE_VTAB"] = self.options.enable_dbpage_vtab + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + header = load(self, os.path.join(self.source_folder, "sqlite3.h")) + license_content = header[3:header.find("***", 1)] + return license_content + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # Indeed CMakeDeps uses 'cmake_file_name' property to qualify CMake variables + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent("""\ + if(DEFINED SQLite_INCLUDE_DIRS) + set(SQLite3_INCLUDE_DIRS ${SQLite_INCLUDE_DIRS}) + endif() + if(DEFINED SQLite_LIBRARIES) + set(SQLite3_LIBRARIES ${SQLite_LIBRARIES}) + endif() + """) + 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", "SQLite3") + self.cpp_info.set_property("cmake_target_name", "SQLite::SQLite3") + self.cpp_info.set_property("pkg_config_name", "sqlite3") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["sqlite"].libs = ["sqlite3"] + if self.options.omit_load_extension: + self.cpp_info.components["sqlite"].defines.append("SQLITE_OMIT_LOAD_EXTENSION") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.threadsafe: + self.cpp_info.components["sqlite"].system_libs.append("pthread") + if not self.options.omit_load_extension: + self.cpp_info.components["sqlite"].system_libs.append("dl") + if self.options.enable_fts5 or self.options.get_safe("enable_math_functions"): + self.cpp_info.components["sqlite"].system_libs.append("m") + elif self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["sqlite"].defines.append("SQLITE_API=__declspec(dllimport)") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "SQLite3" + self.cpp_info.filenames["cmake_find_package_multi"] = "SQLite3" + self.cpp_info.names["cmake_find_package"] = "SQLite" + self.cpp_info.names["cmake_find_package_multi"] = "SQLite" + self.cpp_info.components["sqlite"].names["cmake_find_package"] = "SQLite3" + self.cpp_info.components["sqlite"].names["cmake_find_package_multi"] = "SQLite3" + self.cpp_info.components["sqlite"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["sqlite"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["sqlite"].set_property("cmake_target_name", "SQLite::SQLite3") + self.cpp_info.components["sqlite"].set_property("pkg_config_name", "sqlite3") + if self.options.build_executable: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/sqlite3/all/test_package/CMakeLists.txt b/recipes/sqlite3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3af61b1ff43d4 --- /dev/null +++ b/recipes/sqlite3/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +option(USE_EMPTY_VFS "Using empty SQLite OS interface") + +find_package(SQLite3 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + +if(USE_EMPTY_VFS) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_EMPTY_VFS) + target_sources(${PROJECT_NAME} PRIVATE empty_vfs.c) +endif() diff --git a/recipes/sqlite3/all/test_package/conanfile.py b/recipes/sqlite3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sqlite3/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/sqlite3/all/test_package/empty_vfs.c b/recipes/sqlite3/all/test_package/empty_vfs.c new file mode 100644 index 0000000000000..e33137be93593 --- /dev/null +++ b/recipes/sqlite3/all/test_package/empty_vfs.c @@ -0,0 +1,90 @@ +#include +#include + +int empty_xOpen(sqlite3_vfs *vfs, const char *zName, sqlite3_file *f, int flags, int *pOutFlags) +{ + // TODO: implement + return SQLITE_OK; +} + +int empty_xDelete(sqlite3_vfs *vfs, const char *zName, int syncDir) +{ + // TODO: implement + return SQLITE_OK; +} + +int empty_xAccess(sqlite3_vfs *vfs, const char *zName, int flags, int *pResOut) +{ + // TODO: implement + return SQLITE_OK; +} + +int empty_xFullPathname(sqlite3_vfs *vfs, const char *zName, int nOut, char *zOut) +{ + // TODO: implement + return SQLITE_OK; +} +int empty_xRandomness(sqlite3_vfs *vfs, int nByte, char *zOut) +{ + // TODO: implement + return SQLITE_OK; +} +int empty_xSleep(sqlite3_vfs *vfs, int microseconds) +{ + // TODO: implement + return SQLITE_OK; +} +int empty_xCurrentTime(sqlite3_vfs *vfs, double *t) +{ + // TODO: implement + return SQLITE_OK; +} +int empty_xGetLastError(sqlite3_vfs *vfs, int code, char *name) +{ + // TODO: implement + return SQLITE_OK; +} +int empty_xCurrentTimeInt64(sqlite3_vfs *vfs, sqlite3_int64 *t) +{ + // TODO: implement + return SQLITE_OK; +} + +// empty VFS will be provided +int sqlite3_os_init(void) +{ + static sqlite3_vfs emptyVFS = + { + 2, /* iVersion */ + 0, /* szOsFile */ + 100, /* mxPathname */ + NULL, /* pNext */ + "empty", /* zName */ + NULL, /* pAppData */ + empty_xOpen, /* xOpen */ + empty_xDelete, /* xDelete */ + empty_xAccess, /* xAccess */ + empty_xFullPathname, /* xFullPathname */ + NULL, /* xDlOpen */ + NULL, /* xDlError */ + NULL, /* xDlSym */ + NULL, /* xDlClose */ + empty_xRandomness, /* xRandomness */ + empty_xSleep, /* xSleep */ + empty_xCurrentTime, /* xCurrentTime */ + empty_xGetLastError, /* xGetLastError */ + empty_xCurrentTimeInt64, /* xCurrentTimeInt64 */ + NULL, /* xSetSystemCall */ + NULL, /* xGetSystemCall */ + NULL, /* xNextSystemCall */ + }; + + sqlite3_vfs_register(&emptyVFS, 1); + + return SQLITE_OK; +} + +int sqlite3_os_end(void) +{ + return SQLITE_OK; +} diff --git a/recipes/sqlite3/all/test_package/test_package.c b/recipes/sqlite3/all/test_package/test_package.c new file mode 100644 index 0000000000000..a32b04528d029 --- /dev/null +++ b/recipes/sqlite3/all/test_package/test_package.c @@ -0,0 +1,46 @@ +#include +#include +#include + +#ifdef USE_EMPTY_VFS +#define DB_NAME ":memory:" +#else +#define DB_NAME "bincrafters.db" +#endif + +int main() { + sqlite3* db_instance = NULL; + char* errmsg = NULL; + int result = 0; + + printf("SQLite Version: %s\n", sqlite3_libversion()); + + printf("Creating new data base ...\n"); + result = sqlite3_open(DB_NAME, &db_instance); + if (result != SQLITE_OK) { + fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db_instance)); + sqlite3_close(db_instance); + return EXIT_FAILURE; + } + printf("Done!\n"); + + printf("Creating new table...\n"); + result = sqlite3_exec(db_instance, "CREATE TABLE IF NOT EXISTS package(ID INT PRIMARY KEY NOT NULL);", NULL, 0, &errmsg); + if(result != SQLITE_OK) { + fprintf(stderr, "SQL error: %s\n", errmsg); + sqlite3_free(errmsg); + return EXIT_FAILURE; + } + printf("Done!\n"); + + printf("Closing connection ...\n"); + sqlite3_close(db_instance); + if(result != SQLITE_OK) { + fprintf(stderr, "Connection error: %s\n", errmsg); + sqlite3_free(errmsg); + return EXIT_FAILURE; + } + printf("Done!\n"); + + return EXIT_SUCCESS; +} diff --git a/recipes/sqlite3/all/test_v1_package/CMakeLists.txt b/recipes/sqlite3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sqlite3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sqlite3/all/test_v1_package/conanfile.py b/recipes/sqlite3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..48965a0bd0577 --- /dev/null +++ b/recipes/sqlite3/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions["USE_EMPTY_VFS"] = not self.options["sqlite3"].enable_default_vfs + 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/sqlite3/config.yml b/recipes/sqlite3/config.yml new file mode 100644 index 0000000000000..eec1a2b667f2b --- /dev/null +++ b/recipes/sqlite3/config.yml @@ -0,0 +1,25 @@ +versions: + "3.41.2": + folder: all + "3.41.1": + folder: all + "3.40.1": + folder: all + "3.40.0": + folder: all + "3.39.4": + folder: all + "3.39.3": + folder: all + "3.39.2": + folder: all + "3.39.1": + folder: all + "3.39.0": + folder: all + "3.38.5": + folder: all + "3.37.2": + folder: all + "3.36.0": + folder: all diff --git a/recipes/sqlite_orm/all/conandata.yml b/recipes/sqlite_orm/all/conandata.yml new file mode 100644 index 0000000000000..b99589eb8062e --- /dev/null +++ b/recipes/sqlite_orm/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.8.2": + url: "https://github.com/fnc12/sqlite_orm/archive/refs/tags/v1.8.2.tar.gz" + sha256: "56e0c7729800637a8061658d0fdad4424d2cdde77b063d23cc1b76aa20339072" + "1.8.1": + url: "https://github.com/fnc12/sqlite_orm/archive/v1.8.1.tar.gz" + sha256: "3fbe40d4bb7884a29a9a5764baa27e150ef53940895eb097014202bee3f06644" + "1.8": + url: "https://github.com/fnc12/sqlite_orm/archive/v1.8.tar.gz" + sha256: "90893bb0035daf9803ad9e6d45b3e67f48b5515e69ed3a7577feffed7a9f3309" + "1.7.1": + url: "https://github.com/fnc12/sqlite_orm/archive/refs/tags/v1.7.1.tar.gz" + sha256: "dbf58c2d3c5b1efe295d592799edaa1a5dbe9d591a0bfb1abd22a2843a5123e0" + "1.7": + url: "https://github.com/fnc12/sqlite_orm/archive/refs/tags/v1.7.tar.gz" + sha256: "5123ce12b27e4418b030d59223de0dff2c4ba588844e3dc7e98f6407e3e71dc2" + "1.6": + url: "https://github.com/fnc12/sqlite_orm/archive/1.6.tar.gz" + sha256: "2f1ac922aa564d2a8385515a7d39c7a354df192b370a4713862e41b92bd4e388" +patches: + "1.7": + - patch_file: "patches/0001-declare-is-upsert-clause.patch" + patch_description: "declare is_upsert_clause declaration" + patch_type: "portability" + patch_source: "https://github.com/fnc12/sqlite_orm/pull/821" diff --git a/recipes/sqlite_orm/all/conanfile.py b/recipes/sqlite_orm/all/conanfile.py new file mode 100644 index 0000000000000..90bb95e386b2e --- /dev/null +++ b/recipes/sqlite_orm/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class SqliteOrmConan(ConanFile): + name = "sqlite_orm" + description = "SQLite ORM light header only library for modern C++." + license = "BSD-3-Clause" + topics = ("sqlite", "sql", "database", "orm") + homepage = "https://github.com/fnc12/sqlite_orm" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.4", + "apple-clang": "5.1", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("sqlite3/3.41.1", transitive_headers=True, transitive_libs=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) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + 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): + 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_file_name", "SqliteOrm") + self.cpp_info.set_property("cmake_target_name", "sqlite_orm::sqlite_orm") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.filenames["cmake_find_package"] = "SqliteOrm" + self.cpp_info.filenames["cmake_find_package_multi"] = "SqliteOrm" + self.cpp_info.names["cmake_find_package"] = "sqlite_orm" + self.cpp_info.names["cmake_find_package_multi"] = "sqlite_orm" diff --git a/recipes/sqlite_orm/all/patches/0001-declare-is-upsert-clause.patch b/recipes/sqlite_orm/all/patches/0001-declare-is-upsert-clause.patch new file mode 100644 index 0000000000000..480ac62787326 --- /dev/null +++ b/recipes/sqlite_orm/all/patches/0001-declare-is-upsert-clause.patch @@ -0,0 +1,14 @@ +from https://github.com/fnc12/sqlite_orm/pull/821 + +--- a/include/sqlite_orm/sqlite_orm.h ++++ b/include/sqlite_orm/sqlite_orm.h +@@ -10037,6 +10037,9 @@ namespace sqlite_orm { + + template + using is_insert_constraint = std::is_same; ++ ++ template ++ struct is_upsert_clause; + } + + inline internal::insert_constraint or_rollback() { diff --git a/recipes/sqlite_orm/all/test_package/CMakeLists.txt b/recipes/sqlite_orm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..344f40b9c7cdc --- /dev/null +++ b/recipes/sqlite_orm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(SqliteOrm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sqlite_orm::sqlite_orm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sqlite_orm/all/test_package/conanfile.py b/recipes/sqlite_orm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/sqlite_orm/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/sqlite_orm/all/test_package/test_package.cpp b/recipes/sqlite_orm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..968d9b7aa3e26 --- /dev/null +++ b/recipes/sqlite_orm/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "sqlite_orm/sqlite_orm.h" + +int main() +{ + auto storage = sqlite_orm::make_storage(":memory:"); + return 0; +} diff --git a/recipes/sqlite_orm/all/test_v1_package/CMakeLists.txt b/recipes/sqlite_orm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/sqlite_orm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sqlite_orm/all/test_v1_package/conanfile.py b/recipes/sqlite_orm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sqlite_orm/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/sqlite_orm/config.yml b/recipes/sqlite_orm/config.yml new file mode 100644 index 0000000000000..ab20df18e03f0 --- /dev/null +++ b/recipes/sqlite_orm/config.yml @@ -0,0 +1,13 @@ +versions: + "1.8.2": + folder: all + "1.8.1": + folder: all + "1.8": + folder: all + "1.7.1": + folder: all + "1.7": + folder: all + "1.6": + folder: all diff --git a/recipes/sqlitecpp/all/conandata.yml b/recipes/sqlitecpp/all/conandata.yml new file mode 100644 index 0000000000000..ee0a68eaa6f16 --- /dev/null +++ b/recipes/sqlitecpp/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "3.2.1": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.1.tar.gz" + sha256: "70c67d5680c47460f82a7abf8e6b0329bf2fb10795a982a6d8abc06adb42d693" + "3.2.0": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.0.tar.gz" + sha256: "57f91ed44ef205fe97b8c6586002fe6031cd02771d1c5d8415d9c515ad1532d1" + "3.1.1": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.1.1.tar.gz" + sha256: "b00b1efad985dd415c3b62b01252cae20d9f2c32dcac435ddd8a105e9d4ddcde" + "2.5.0": + url: "https://github.com/SRombauts/SQLiteCpp/archive/2.5.0.tar.gz" + sha256: "a598a07626ba0cb8bbad7e2f932f204b645eec5cb83e8cd7f0740fcbcce1ba50" + "2.4.0": + url: "https://github.com/SRombauts/SQLiteCpp/archive/2.4.0.tar.gz" + sha256: "16bf963619786652a60533bcdc71a0412cad1ce132cd09ce43344af6ed7463d9" +patches: + "2.5.0": + - patch_file: "patches/2.5.0-0001-cmake-sqlite3.patch" + patch_description: "Fix Sqlite3 CMake target" + patch_type: "conan" + "2.4.0": + - patch_file: "patches/2.4.0-0001-cmake-sqlite3.patch" + patch_description: "Fix Sqlite3 CMake target" + patch_type: "conan" + - patch_file: "patches/2.4.0-0002-mingw-flags.patch" + patch_description: "Fix Mingw compiler flags" + patch_type: "conan" diff --git a/recipes/sqlitecpp/all/conanfile.py b/recipes/sqlitecpp/all/conanfile.py new file mode 100644 index 0000000000000..70dd5900f9a1a --- /dev/null +++ b/recipes/sqlitecpp/all/conanfile.py @@ -0,0 +1,138 @@ +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, replace_in_file, rmdir, save +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.errors import ConanInvalidConfiguration +import os +import textwrap + + +required_conan_version = ">=1.53" + + +class SQLiteCppConan(ConanFile): + name = "sqlitecpp" + description = "SQLiteCpp is a smart and easy to use C++ sqlite3 wrapper" + topics = ("sqlite", "sqlite3", "data-base") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SRombauts/SQLiteCpp" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "stack_protection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "stack_protection": True, + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def 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("sqlite3/3.40.0") + + def validate(self): + if Version(self.version) >= "3.0.0" and self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.info.settings.os == "Windows" and self.info.options.shared: + raise ConanInvalidConfiguration("SQLiteCpp can not be built as shared lib on Windows") + + 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 _patch_sources(self): + apply_conandata_patches(self) + if self.settings.compiler == "clang" and \ + Version(self.settings.compiler.version) < "6.0" and \ + self.settings.compiler.libcxx == "libc++" and \ + Version(self.version) < "3": + replace_in_file(self, + os.path.join(self.source_folder, "include", "SQLiteCpp", "Utils.h"), + "const nullptr_t nullptr = {};", + "") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SQLITECPP_INTERNAL_SQLITE"] = False + tc.variables["SQLITECPP_RUN_CPPLINT"] = False + tc.variables["SQLITECPP_RUN_CPPCHECK"] = False + tc.variables["SQLITECPP_RUN_DOXYGEN"] = False + tc.variables["SQLITECPP_BUILD_EXAMPLES"] = False + tc.variables["SQLITECPP_BUILD_TESTS"] = False + tc.variables["SQLITECPP_USE_STACK_PROTECTION"] = self.options.stack_protection + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"SQLiteCpp": "SQLiteCpp::SQLiteCpp"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SQLiteCpp") + self.cpp_info.set_property("cmake_target_name", "SQLiteCpp") + self.cpp_info.libs = ["SQLiteCpp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "dl", "m"] + + if self._is_mingw: + self.cpp_info.system_libs = ["ssp"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "SQLiteCpp" + self.cpp_info.names["cmake_find_package_multi"] = "SQLiteCpp" + 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/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch b/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch new file mode 100644 index 0000000000000..dd766533b851d --- /dev/null +++ b/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c32724b..096818a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,7 +206,7 @@ install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME}) + + ## Build provided copy of SQLite3 C library ## + +-# TODO ++# TODO + #find_package(sqlite3) + #if(sqlite3_VERSION VERSION_LESS "3.19") + # set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") +@@ -230,6 +230,9 @@ if (SQLITECPP_INTERNAL_SQLITE) + add_subdirectory(sqlite3) + target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3") + target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") ++else (SQLITECPP_INTERNAL_SQLITE) ++ find_package(SQLite3 REQUIRED) ++ target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3) + endif (SQLITECPP_INTERNAL_SQLITE) + + # Optional additional targets: diff --git a/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch b/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch new file mode 100644 index 0000000000000..99fa2af08442e --- /dev/null +++ b/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 096818a..9e40f9f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,12 @@ else (MSVC) + set(CPPLINT_ARG_OUTPUT "--output=eclipse") + set(CPPCHECK_ARG_TEMPLATE "--template=gcc") + # Useful compile flags and extra warnings +- add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) ++ if (MINGW) ++ MESSAGE ( STATUS "Running on MinGW - no -fstack-protector" ) ++ add_compile_options(-Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) ++ else () ++ add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) ++ endif () + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++0x-compat") # C++ only + if (CMAKE_COMPILER_IS_GNUCXX) + # GCC flags diff --git a/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch b/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch new file mode 100644 index 0000000000000..d114e32196b48 --- /dev/null +++ b/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f7e0fbd..146ab01 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -184,7 +184,7 @@ endif (SQLITE_ENABLE_ASSERT_HANDLER) + option(SQLITE_HAS_CODEC "Enable database encryption API. Not available in the public release of SQLite." OFF) + if (SQLITE_HAS_CODEC) + # Enable database encryption API. Requires implementations of sqlite3_key & sqlite3_key_v2. +- # Eg. SQLCipher (libsqlcipher-dev) is an SQLite extension that provides 256 bit AES encryption of database files. ++ # Eg. SQLCipher (libsqlcipher-dev) is an SQLite extension that provides 256 bit AES encryption of database files. + target_compile_definitions(SQLiteCpp PUBLIC SQLITE_HAS_CODEC) + endif (SQLITE_HAS_CODEC) + +@@ -247,10 +247,7 @@ if (SQLITECPP_INTERNAL_SQLITE) + target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") + else (SQLITECPP_INTERNAL_SQLITE) + find_package (SQLite3 REQUIRED) +- if (SQLITE3_FOUND) +- include_directories(${SQLITE3_INCLUDE_DIRS}) +- target_link_libraries (SQLiteCpp ${SQLITE3_LIBRARIES}) +- endif (SQLITE3_FOUND) ++ target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3) + endif (SQLITECPP_INTERNAL_SQLITE) + + # Optional additional targets: diff --git a/recipes/sqlitecpp/all/test_package/CMakeLists.txt b/recipes/sqlitecpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..691c4d6d74886 --- /dev/null +++ b/recipes/sqlitecpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(SQLiteCpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SQLiteCpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sqlitecpp/all/test_package/conanfile.py b/recipes/sqlitecpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..31d542d1b6ce3 --- /dev/null +++ b/recipes/sqlitecpp/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 TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sqlitecpp/all/test_package/test_package.cpp b/recipes/sqlitecpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e64915282d11 --- /dev/null +++ b/recipes/sqlitecpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() +{ + std::cout << "SQLite3 version " << SQLite::VERSION << " (" << SQLite::getLibVersion() << ")" << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt b/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sqlitecpp/all/test_v1_package/conanfile.py b/recipes/sqlitecpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sqlitecpp/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/sqlitecpp/config.yml b/recipes/sqlitecpp/config.yml new file mode 100644 index 0000000000000..e29442357e51d --- /dev/null +++ b/recipes/sqlitecpp/config.yml @@ -0,0 +1,11 @@ +versions: + "3.2.1": + folder: all + "3.2.0": + folder: all + "3.1.1": + folder: all + "2.5.0": + folder: all + "2.4.0": + folder: all diff --git a/recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt b/recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/sqlpp11-connector-sqlite3/all/conandata.yml b/recipes/sqlpp11-connector-sqlite3/all/conandata.yml new file mode 100644 index 0000000000000..6f7198fb9a268 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "0.29": + url: "https://github.com/rbock/sqlpp11-connector-sqlite3/archive/0.29.tar.gz" + sha256: "2904ddd578adb0e122a70f73a80bae4843434d685b7a23ae3ab43471c35efc4f" + "0.30": + url: "https://github.com/rbock/sqlpp11-connector-sqlite3/archive/0.30.tar.gz" + sha256: "e39f420312d311f3eaa162e201883b4594c34e04739b39a4563f84be920e654f" +patches: + "0.29": + - patch_file: "patches/cmake-dependencies.patch" + base_path: "source_subfolder" + "0.30": + - patch_file: "patches/cmake-dependencies.patch" + base_path: "source_subfolder" diff --git a/recipes/sqlpp11-connector-sqlite3/all/conanfile.py b/recipes/sqlpp11-connector-sqlite3/all/conanfile.py new file mode 100644 index 0000000000000..964d73c54cc6d --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/conanfile.py @@ -0,0 +1,77 @@ +from conans import ConanFile, CMake, tools +import os + + +class sqlpp11Conan(ConanFile): + name = "sqlpp11-connector-sqlite3" + description = "A C++ wrapper for sqlite3 meant to be used in combination with sqlpp11." + topics = ("conan", "sqlpp11-connector-sqlite3", "sqlite3", "sqlpp11", "sql", "database") + settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rbock/sqlpp11-connector-sqlite3" + license = "BSD-2-Clause" + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake" + options = {"shared": [True, False], "fPIC": [True, False], "with_sqlcipher": [True, False]} + default_options = {"shared": False, "fPIC": True, "with_sqlcipher": False} + short_paths = True + + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def requirements(self): + self.requires("sqlpp11/0.59") + if self.options.with_sqlcipher: + self.requires("sqlcipher/4.4.0") + else: + self.requires("sqlite3/3.32.3") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["ENABLE_TESTS"] = False + self._cmake.definitions["SQLCIPHER"] = self.options.with_sqlcipher + self._cmake.definitions["SQLPP11_INCLUDE_DIR"] = self.deps_cpp_info["sqlpp11"].include_paths[0] + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["sqlpp11-connector-sqlite3"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] + if self.options.with_sqlcipher: + self.cpp_info.defines = ["SQLPP_USE_SQLCIPHER"] diff --git a/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch b/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch new file mode 100644 index 0000000000000..e9244768a488a --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch @@ -0,0 +1,28 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -43,9 +43,6 @@ endif() + # TODO export Targets for HinnantDate and Sqlite3 as well + target_include_directories(sqlpp11-connector-sqlite3 + PUBLIC +- ${SQLPP11_INCLUDE_DIR} +- ${HinnantDate_INCLUDE_DIR} +- ${SQLITE3_INCLUDE_DIRS} + $ + $) + +@@ -58,14 +55,13 @@ endif() + + if (SQLCIPHER) + target_compile_definitions(sqlpp11-connector-sqlite3 PUBLIC SQLPP_USE_SQLCIPHER) +- target_link_libraries(sqlpp11-connector-sqlite3 SQLCipher::SQLCipher) + if (SQLPP_DYNAMIC_LOADING) + target_compile_definitions(sqlpp11-connector-sqlite3-dynamic PUBLIC SQLPP_USE_SQLCIPHER) + target_include_directories(sqlpp11-connector-sqlite3-dynamic PUBLIC ${SQLCIPHER_INCLUDE_DIRS}) + endif() + else() +- target_link_libraries(sqlpp11-connector-sqlite3 ${SQLITE3_LIBRARIES}) + endif() ++target_link_libraries(sqlpp11-connector-sqlite3 ${CONAN_LIBS}) + + install(TARGETS sqlpp11-connector-sqlite3 + ARCHIVE DESTINATION lib diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt b/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_package/TabSample.h b/recipes/sqlpp11-connector-sqlite3/all/test_package/TabSample.h new file mode 100644 index 0000000000000..27b0db5241ce3 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/test_package/TabSample.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2013 - 2015, Roland Bock + * All rights reserved. + * + * 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 HOLDER 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. + */ + +#ifndef SQLPP_TAB_SAMPLE_H +#define SQLPP_TAB_SAMPLE_H + +#include +#include +#include + +namespace TabFoo_ +{ + struct Omega + { + struct _alias_t + { + static constexpr const char _literal[] = "omega"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T omega; + T& operator()() + { + return omega; + } + const T& operator()() const + { + return omega; + } + }; + }; + using _traits = ::sqlpp::make_traits<::sqlpp::bigint>; + }; +} + +struct TabFoo : sqlpp::table_t +{ + using _value_type = sqlpp::no_value_t; + struct _alias_t + { + static constexpr const char _literal[] = "tab_foo"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T tabFoo; + T& operator()() + { + return tabFoo; + } + const T& operator()() const + { + return tabFoo; + } + }; + }; +}; + +namespace TabSample_ +{ + struct Alpha + { + struct _alias_t + { + static constexpr const char _literal[] = "alpha"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T alpha; + T& operator()() + { + return alpha; + } + const T& operator()() const + { + return alpha; + } + }; + }; + using _traits = ::sqlpp::make_traits<::sqlpp::bigint, + ::sqlpp::tag::must_not_insert, + ::sqlpp::tag::must_not_update, + ::sqlpp::tag::can_be_null>; + }; + + struct Beta + { + struct _alias_t + { + static constexpr const char _literal[] = "beta"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T beta; + T& operator()() + { + return beta; + } + const T& operator()() const + { + return beta; + } + }; + }; + using _traits = ::sqlpp::make_traits<::sqlpp::varchar, ::sqlpp::tag::must_not_update, ::sqlpp::tag::can_be_null>; + }; + + struct Gamma + { + struct _alias_t + { + static constexpr const char _literal[] = "gamma"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T gamma; + T& operator()() + { + return gamma; + } + const T& operator()() const + { + return gamma; + } + }; + }; + using _traits = ::sqlpp::make_traits<::sqlpp::boolean>; + }; +} + +struct TabSample : sqlpp::table_t +{ + using _value_type = sqlpp::no_value_t; + struct _alias_t + { + static constexpr const char _literal[] = "tab_sample"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T tabSample; + T& operator()() + { + return tabSample; + } + const T& operator()() const + { + return tabSample; + } + }; + }; +}; + +namespace TabDateTime_ +{ + struct ColDayPoint + { + struct _alias_t + { + static constexpr const char _literal[] = "col_day_point"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T colDayPoint; + T& operator()() + { + return colDayPoint; + } + const T& operator()() const + { + return colDayPoint; + } + }; + }; + using _traits = sqlpp::make_traits; + }; + struct ColTimePoint + { + struct _alias_t + { + static constexpr const char _literal[] = "col_time_point"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T colTimePoint; + T& operator()() + { + return colTimePoint; + } + const T& operator()() const + { + return colTimePoint; + } + }; + }; + using _traits = sqlpp::make_traits; + }; +} + +struct TabDateTime : sqlpp::table_t +{ + struct _alias_t + { + static constexpr const char _literal[] = "tab_date_time"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T tabDateTime; + T& operator()() + { + return tabDateTime; + } + const T& operator()() const + { + return tabDateTime; + } + }; + }; +}; + +#endif diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py b/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..008c4dc3fb8e3 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake, tools +import os +import sqlite3 + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + # test that the database is encrypted when sqlcipher is used + con = sqlite3.connect("test.db") + cursor = con.cursor() + try: + cursor.execute("select * from tab_sample") + except sqlite3.DatabaseError: + assert self.options["sqlpp11-connector-sqlite3"].with_sqlcipher + self.output.info("database is encrypted with sqlcipher") + return + assert not self.options["sqlpp11-connector-sqlite3"].with_sqlcipher + self.output.info("database is not encrypted") diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_package/test_package.cpp b/recipes/sqlpp11-connector-sqlite3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..81f20180d5839 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/test_package/test_package.cpp @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2013 - 2016, Roland Bock + * All rights reserved. + * + * 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 HOLDER 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. + */ + +#include +#include +#include +#include "TabSample.h" + +#ifdef SQLPP_USE_SQLCIPHER +#include +#else +#include +#endif +#include +#include +#include + +SQLPP_ALIAS_PROVIDER(left) +SQLPP_ALIAS_PROVIDER(pragma) +SQLPP_ALIAS_PROVIDER(sub) + +namespace sql = sqlpp::sqlite3; +int main() { + sql::connection_config config; + config.path_to_database = "test.db"; + config.flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; + config.debug = true; + config.password = "password"; + + sql::connection db(config); + db.execute(R"(CREATE TABLE tab_sample ( + alpha INTEGER PRIMARY KEY, + beta varchar(255) DEFAULT NULL, + gamma bool DEFAULT NULL + ))"); + db.execute(R"(CREATE TABLE tab_foo ( + omega bigint(20) DEFAULT NULL + ))"); + + const auto tab = TabSample{}; + + // clear the table + db(remove_from(tab).unconditionally()); + + // explicit all_of(tab) + for (const auto& row : db(select(all_of(tab)).from(tab).unconditionally())) { + std::cerr << "row.alpha: " << row.alpha << ", row.beta: " << row.beta + << ", row.gamma: " << row.gamma << std::endl; + }; + std::cerr << __FILE__ << ": " << __LINE__ << std::endl; + // selecting a table implicitly expands to all_of(tab) + for (const auto& row : db(select(all_of(tab)).from(tab).unconditionally())) { + std::cerr << "row.alpha: " << row.alpha << ", row.beta: " << row.beta + << ", row.gamma: " << row.gamma << std::endl; + }; + // selecting two multicolumns + for (const auto& row : + db(select(multi_column(tab.alpha, tab.beta, tab.gamma).as(left), + multi_column(all_of(tab)).as(tab)) + .from(tab) + .unconditionally())) { + std::cerr << "row.left.alpha: " << row.left.alpha + << ", row.left.beta: " << row.left.beta + << ", row.left.gamma: " << row.left.gamma << std::endl; + std::cerr << "row.tabSample.alpha: " << row.tabSample.alpha + << ", row.tabSample.beta: " << row.tabSample.beta + << ", row.tabSample.gamma: " << row.tabSample.gamma << std::endl; + }; + + // insert + std::cerr << "no of required columns: " + << TabSample::_required_insert_columns::size::value << std::endl; + db(insert_into(tab).default_values()); + std::cout << "Last Insert ID: " << db.last_insert_id() << "\n"; + db(insert_into(tab).set(tab.gamma = true)); + std::cout << "Last Insert ID: " << db.last_insert_id() << "\n"; + auto di = dynamic_insert_into(db, tab).dynamic_set(tab.gamma = true); + di.insert_list.add(tab.beta = ""); + db(di); + + // update + db(update(tab).set(tab.gamma = false).where(tab.alpha.in(1))); + db(update(tab) + .set(tab.gamma = false) + .where(tab.alpha.in(sqlpp::value_list(std::vector{1, 2, 3, 4})))); + + // remove + db(remove_from(tab).where(tab.alpha == tab.alpha + 3)); + + auto result = db(select(all_of(tab)).from(tab).unconditionally()); + std::cerr + << "Accessing a field directly from the result (using the current row): " + << result.begin()->alpha << std::endl; + std::cerr << "Can do that again, no problem: " << result.begin()->alpha + << std::endl; + + auto tx = start_transaction(db); + TabFoo foo; + for (const auto& row : + db(select(all_of(tab), + select(max(foo.omega)).from(foo).where(foo.omega > tab.alpha)) + .from(tab) + .unconditionally())) { + int x = row.alpha; + int a = row.max; + std::cout << x << ", " << a << std::endl; + } + tx.commit(); + + for (const auto& row : db(select(tab.alpha) + .from(tab.join(foo).on(tab.alpha == foo.omega)) + .unconditionally())) { + std::cerr << row.alpha << std::endl; + } + + for (const auto& row : + db(select(tab.alpha) + .from(tab.left_outer_join(foo).on(tab.alpha == foo.omega)) + .unconditionally())) { + std::cerr << row.alpha << std::endl; + } + + auto ps = db.prepare(select(all_of(tab)) + .from(tab) + .where(tab.alpha != parameter(tab.alpha) and + tab.beta != parameter(tab.beta) and + tab.gamma != parameter(tab.gamma))); + ps.params.alpha = 7; + ps.params.beta = "wurzelbrunft"; + ps.params.gamma = true; + for (const auto& row : db(ps)) { + std::cerr << "bound result: alpha: " << row.alpha << std::endl; + std::cerr << "bound result: beta: " << row.beta << std::endl; + std::cerr << "bound result: gamma: " << row.gamma << std::endl; + } + + std::cerr << "--------" << std::endl; + ps.params.alpha = sqlpp::eval(db, "last_insert_rowid()"); + ps.params.gamma = "false"; + for (const auto& row : db(ps)) { + std::cerr << "bound result: alpha: " << row.alpha << std::endl; + std::cerr << "bound result: beta: " << row.beta << std::endl; + std::cerr << "bound result: gamma: " << row.gamma << std::endl; + } + + std::cerr << "--------" << std::endl; + ps.params.beta = "kaesekuchen"; + for (const auto& row : db(ps)) { + std::cerr << "bound result: alpha: " << row.alpha << std::endl; + std::cerr << "bound result: beta: " << row.beta << std::endl; + std::cerr << "bound result: gamma: " << row.gamma << std::endl; + } + + auto pi = db.prepare( + insert_into(tab).set(tab.beta = parameter(tab.beta), tab.gamma = true)); + pi.params.beta = "prepared cake"; + std::cerr << "Inserted: " << db(pi) << std::endl; + + auto pu = db.prepare(update(tab) + .set(tab.gamma = parameter(tab.gamma)) + .where(tab.beta == "prepared cake")); + pu.params.gamma = false; + std::cerr << "Updated: " << db(pu) << std::endl; + + auto pr = db.prepare(remove_from(tab).where(tab.beta != parameter(tab.beta))); + pr.params.beta = "prepared cake"; + std::cerr << "Deleted lines: " << db(pr) << std::endl; + + // Check that a prepared select is default-constructible + { + auto s = select(all_of(tab)) + .from(tab) + .where((tab.beta.like(parameter(tab.beta)) and + tab.alpha == parameter(tab.alpha)) or + tab.gamma != parameter(tab.gamma)); + using P = decltype(db.prepare(s)); + P p; // You must not use this one yet! + p = db.prepare(s); + } + + auto i = db(sqlpp::sqlite3::insert_or_replace_into(tab).set( + tab.beta = "test", tab.gamma = true)); + std::cerr << i << std::endl; + + i = db(sqlpp::sqlite3::insert_or_ignore_into(tab).set(tab.beta = "test", + tab.gamma = true)); + std::cerr << i << std::endl; + + assert( + db(select(count(tab.alpha)).from(tab).unconditionally()).begin()->count); + assert(db(select(all_of(tab)) + .from(tab) + .where(tab.alpha.not_in( + select(tab.alpha).from(tab).unconditionally()))) + .empty()); + + auto x = custom_query(sqlpp::verbatim("PRAGMA user_version = "), 1); + db(x); + int pragmaValue = + db(custom_query(sqlpp::verbatim("PRAGMA user_version")) + .with_result_type_of(select(sqlpp::value(1).as(pragma)))) + .front() + .pragma; + std::cerr << pragmaValue << std::endl; + + // Testing sub select tables and unconditional joins + const auto subQuery = select(tab.alpha).from(tab).unconditionally().as(sub); + for (const auto& row : + db(select(subQuery.alpha).from(subQuery).unconditionally())) { + std::cerr << row.alpha; + } + + for (const auto& row : + db(select(subQuery.alpha) + .from(tab.inner_join(subQuery).unconditionally()) + .unconditionally())) { + std::cerr << row.alpha; + } + + return 0; +} diff --git a/recipes/sqlpp11-connector-sqlite3/config.yml b/recipes/sqlpp11-connector-sqlite3/config.yml new file mode 100644 index 0000000000000..f307186375038 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/config.yml @@ -0,0 +1,5 @@ +versions: + "0.29": + folder: all + "0.30": + folder: all diff --git a/recipes/sqlpp11/all/conandata.yml b/recipes/sqlpp11/all/conandata.yml new file mode 100644 index 0000000000000..08915d57967e4 --- /dev/null +++ b/recipes/sqlpp11/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.58": + url: "https://github.com/rbock/sqlpp11/archive/0.58.zip" + sha256: 8e2ba487b7a0ddc988bcfa5366443a0f5ca9f38ef86ac8e3f257801ab3cbf8eb + "0.59": + url: "https://github.com/rbock/sqlpp11/archive/0.59.zip" + sha256: 62ba9ba078e05901aa47cb056240bb474f9b8ef5cabf114f8219b4a6fa4f019b + "0.60": + url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" + sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c + "0.61": + url: "https://github.com/rbock/sqlpp11/archive/0.61.tar.gz" + sha256: "d5a95e28ae93930f7701f517b1342ac14bcf33a9b1c5b5f0dff6aea5e315bb50" diff --git a/recipes/sqlpp11/all/conanfile.py b/recipes/sqlpp11/all/conanfile.py new file mode 100644 index 0000000000000..384cf91a4b695 --- /dev/null +++ b/recipes/sqlpp11/all/conanfile.py @@ -0,0 +1,71 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class Sqlpp11Conan(ConanFile): + name = "sqlpp11" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rbock/sqlpp11" + description = "A type safe SQL template library for C++" + topics = ("sql", "dsl", "embedded", "data-base") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _min_stdcpp_version(self): + return 11 if tools.Version(self.version) < "0.61" else 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "14", + "clang": "3.4", + "apple-clang": "10", + } + + def requirements(self): + self.requires("date/3.0.1") + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, self._min_stdcpp_version) + + if self._min_stdcpp_version > 11: + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++14, which your compiler does not support.") + else: + self.output.warn(f"{self.name} requires C++14. Your compiler is unknown. Assuming it supports C++14.") + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + destination=self._source_subfolder, + strip_root=True + ) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("*", dst="bin", src=os.path.join(self._source_subfolder, "scripts")) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "Sqlpp11" + self.cpp_info.filenames["cmake_find_package_multi"] = "Sqlpp11" + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/sqlpp11/all/test_package/CMakeLists.txt b/recipes/sqlpp11/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..209e56f42630d --- /dev/null +++ b/recipes/sqlpp11/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Sqlpp11 CONFIG REQUIRED) + +add_executable(example example.cpp) +set_property(TARGET example PROPERTY CXX_STANDARD 14) +target_link_libraries(example sqlpp11::sqlpp11) diff --git a/recipes/sqlpp11/all/test_package/conanfile.py b/recipes/sqlpp11/all/test_package/conanfile.py new file mode 100644 index 0000000000000..11eb01c13ada3 --- /dev/null +++ b/recipes/sqlpp11/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class Sqlpp11TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "example"), run_environment=True) diff --git a/recipes/sqlpp11/all/test_package/example.cpp b/recipes/sqlpp11/all/test_package/example.cpp new file mode 100644 index 0000000000000..9b0644427156d --- /dev/null +++ b/recipes/sqlpp11/all/test_package/example.cpp @@ -0,0 +1,6 @@ +#include + +int main() +{ + sqlpp::connection c; +} diff --git a/recipes/sqlpp11/config.yml b/recipes/sqlpp11/config.yml new file mode 100644 index 0000000000000..a51d2c88cb4ae --- /dev/null +++ b/recipes/sqlpp11/config.yml @@ -0,0 +1,9 @@ +versions: + "0.58": + folder: "all" + "0.59": + folder: "all" + "0.60": + folder: "all" + "0.61": + folder: "all" diff --git a/recipes/squirrel/all/conandata.yml b/recipes/squirrel/all/conandata.yml new file mode 100644 index 0000000000000..05364b18d9da3 --- /dev/null +++ b/recipes/squirrel/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.2": + url: "https://github.com/albertodemichelis/squirrel/archive/v3.2.tar.gz" + sha256: "02805414cfadd5bbb921891d3599b83375a40650abd6404a8ab407dc5e86a996" + "3.1": + url: "https://github.com/albertodemichelis/squirrel/archive/v3.1.tar.gz" + sha256: "51942b8638a97b673e34ecf3ca50304996fa99bbdbfa7fe93d9744e6769b2f95" +patches: + "3.2": + - patch_file: "patches/3.2-fix-cmake-static-build.patch" + patch_description: "fix static build issue" + patch_type: "portability" + "3.1": + - patch_file: "patches/3.1-fix-cmake-static-shared.patch" + patch_description: "add flag to switch static/shared builds" + patch_type: "conan" diff --git a/recipes/squirrel/all/conanfile.py b/recipes/squirrel/all/conanfile.py new file mode 100644 index 0000000000000..ea393f79ca89f --- /dev/null +++ b/recipes/squirrel/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +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 +import os + +required_conan_version = ">=1.53.0" + +class SquirrelConan(ConanFile): + name = "squirrel" + description = "Squirrel is a high level imperative, object-oriented programming " \ + "language, designed to be a light-weight scripting language that " \ + "fits in the size, memory bandwidth, and real-time requirements " \ + "of applications like video games." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.squirrel-lang.org/" + topics = ("programming-language", "object-oriented", "scripting") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if Version(self.version) <= "3.1": + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} and earlier does not support Macos") + if self.settings.compiler == "clang": + compiler_version = Version(self.settings.compiler.version) + if compiler_version < "9" or compiler_version >= "11": + raise ConanInvalidConfiguration( + f"{self.ref} and earlier does not support Clang {compiler_version}" + ) + if self.settings.compiler == "gcc": + compiler_version = Version(self.settings.compiler.version) + if compiler_version >= "12": + raise ConanInvalidConfiguration( + f"{self.ref} and earlier does not support gcc {compiler_version}" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISABLE_DYNAMIC"] = not self.options.shared + tc.variables["DISABLE_STATIC"] = self.options.shared + 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) + copy(self, pattern="COPYRIGHT", 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.set_property("cmake_file_name", "squirrel") + # CMakeDeps generator uses the global target if a downstream recipe depends on squirrel globally, + # and squirrel::squirrel is stolen by libsquirrel component (if shared) which doesn't depend on all other components. + # So this unofficial target is created as a workaround. + self.cpp_info.set_property("cmake_target_name", "squirrel::squirel-all-do-not-use") + + suffix = "" if self.options.shared else "_static" + + # squirrel + self.cpp_info.components["libsquirrel"].set_property("cmake_target_name", f"squirrel::squirrel{suffix}") + self.cpp_info.components["libsquirrel"].libs = [f"squirrel{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libsquirrel"].system_libs.append("m") + + # sqstdlib + self.cpp_info.components["sqstdlib"].set_property("cmake_target_name", f"squirrel::sqstdlib{suffix}") + self.cpp_info.components["sqstdlib"].libs = [f"sqstdlib{suffix}"] + self.cpp_info.components["sqstdlib"].requires = ["libsquirrel"] + + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var : {binpath}") + self.env_info.PATH.append(binpath) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libsquirrel"].names["cmake_find_package"] = f"squirrel{suffix}" + self.cpp_info.components["libsquirrel"].names["cmake_find_package_multi"] = f"squirrel{suffix}" + self.cpp_info.components["sqstdlib"].names["cmake_find_package"] = f"sqstdlib{suffix}" + self.cpp_info.components["sqstdlib"].names["cmake_find_package_multi"] = f"sqstdlib{suffix}" diff --git a/recipes/squirrel/all/patches/3.1-fix-cmake-static-shared.patch b/recipes/squirrel/all/patches/3.1-fix-cmake-static-shared.patch new file mode 100644 index 0000000000000..97075891a85f3 --- /dev/null +++ b/recipes/squirrel/all/patches/3.1-fix-cmake-static-shared.patch @@ -0,0 +1,94 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + + project(squirrel C CXX) + +-include_directories(${CMAKE_SOURCE_DIR}/include) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + + if(CMAKE_COMPILER_IS_GNUCXX) + set(SQ_FLAGS -fno-exceptions -fno-strict-aliasing -Wall -Wextra -pedantic -Wcast-qual) +@@ -52,10 +52,12 @@ add_subdirectory(sqstdlib) + add_subdirectory(sq) + + if(NOT WIN32) ++if(NOT DISABLE_DYNAMIC) + set_target_properties(squirrel sqstdlib PROPERTIES SOVERSION 0 VERSION 0.0.0) + endif() ++endif() + +-if(DEFINED INSTALL_INC_DIR) ++if(TRUE) + set(SQ_PUB_HEADERS include/sqconfig.h + include/sqstdaux.h + include/sqstdblob.h +@@ -64,5 +66,5 @@ if(DEFINED INSTALL_INC_DIR) + include/sqstdstring.h + include/sqstdsystem.h + include/squirrel.h) +- install(FILES ${SQ_PUB_HEADERS} DESTINATION ${INSTALL_INC_DIR}) ++ install(FILES ${SQ_PUB_HEADERS} DESTINATION include) + endif() +--- a/sq/CMakeLists.txt ++++ b/sq/CMakeLists.txt +@@ -1,9 +1,11 @@ ++if(NOT DISABLE_DYNAMIC) + add_executable(sq sq.c) + set_target_properties(sq PROPERTIES LINKER_LANGUAGE C) + target_link_libraries(sq squirrel sqstdlib) + install(TARGETS sq RUNTIME DESTINATION ${INSTALL_BIN_DIR}) ++endif() + +-if(NOT DEFINED DISABLE_STATIC) ++if(NOT DISABLE_STATIC) + add_executable(sq_static sq.c) + set_target_properties(sq_static PROPERTIES LINKER_LANGUAGE C) + target_link_libraries(sq_static squirrel_static sqstdlib_static) +@@ -18,6 +20,6 @@ if(DEFINED LONG_OUTPUT_NAMES) + endif() + endif() + +-if(CMAKE_COMPILER_IS_GNUCXX AND (NOT DEFINED DISABLE_STATIC)) ++if(CMAKE_COMPILER_IS_GNUCXX AND (NOT DISABLE_STATIC)) + set_target_properties(sq_static PROPERTIES COMPILE_FLAGS "-static -Wl,-static") + endif() +--- a/sqstdlib/CMakeLists.txt ++++ b/sqstdlib/CMakeLists.txt +@@ -6,14 +6,14 @@ set(SQSTDLIB_SRC sqstdaux.cpp + sqstdstream.cpp + sqstdstring.cpp + sqstdsystem.cpp) +- ++if(NOT DISABLE_DYNAMIC) + add_library(sqstdlib SHARED ${SQSTDLIB_SRC}) + target_link_libraries(sqstdlib squirrel) + install(TARGETS sqstdlib RUNTIME DESTINATION ${INSTALL_BIN_DIR} + LIBRARY DESTINATION ${INSTALL_LIB_DIR} + ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) +- +-if(NOT DEFINED DISABLE_STATIC) ++endif() ++if(NOT DISABLE_STATIC) + add_library(sqstdlib_static STATIC ${SQSTDLIB_SRC}) + install(TARGETS sqstdlib_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) + endif() +--- a/squirrel/CMakeLists.txt ++++ b/squirrel/CMakeLists.txt +@@ -10,13 +10,13 @@ set(SQUIRREL_SRC sqapi.cpp + sqstate.cpp + sqtable.cpp + sqvm.cpp) +- ++if(NOT DISABLE_DYNAMIC) + add_library(squirrel SHARED ${SQUIRREL_SRC}) + install(TARGETS squirrel RUNTIME DESTINATION ${INSTALL_BIN_DIR} + LIBRARY DESTINATION ${INSTALL_LIB_DIR} + ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) +- +-if(NOT DEFINED DISABLE_STATIC) ++endif() ++if(NOT DISABLE_STATIC) + add_library(squirrel_static STATIC ${SQUIRREL_SRC}) + install(TARGETS squirrel_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) + endif() diff --git a/recipes/squirrel/all/patches/3.2-fix-cmake-static-build.patch b/recipes/squirrel/all/patches/3.2-fix-cmake-static-build.patch new file mode 100644 index 0000000000000..95706b3133073 --- /dev/null +++ b/recipes/squirrel/all/patches/3.2-fix-cmake-static-build.patch @@ -0,0 +1,13 @@ +diff --git a/sq/CMakeLists.txt b/sq/CMakeLists.txt +index bdea07d..f7629a3 100644 +--- a/sq/CMakeLists.txt ++++ b/sq/CMakeLists.txt +@@ -15,7 +15,7 @@ endif() + + if(NOT DISABLE_STATIC) + add_executable(sq_static sq.c) +- add_executable(squirrel::interpreter_static ALIAS sq) ++ add_executable(squirrel::interpreter_static ALIAS sq_static) + set_target_properties(sq_static PROPERTIES LINKER_LANGUAGE C EXPORT_NAME interpreter_static) + target_link_libraries(sq_static squirrel_static sqstdlib_static) + if(NOT SQ_DISABLE_INSTALLER) diff --git a/recipes/squirrel/all/test_package/CMakeLists.txt b/recipes/squirrel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..13a7e10ca59c7 --- /dev/null +++ b/recipes/squirrel/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(squirrel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET squirrel::squirrel_static) + target_link_libraries(${PROJECT_NAME} PRIVATE squirrel::squirrel_static squirrel::sqstdlib_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE squirrel::squirrel squirrel::sqstdlib) +endif() diff --git a/recipes/squirrel/all/test_package/conanfile.py b/recipes/squirrel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/squirrel/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/squirrel/all/test_package/test_package.cpp b/recipes/squirrel/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4f0607cdc57f9 --- /dev/null +++ b/recipes/squirrel/all/test_package/test_package.cpp @@ -0,0 +1,48 @@ +#include +#include + +#include +#include +#include + +#ifdef SQUNICODE +#define scvprintf vfwprintf +#else +#define scvprintf vfprintf +#endif + + +void printfunc(HSQUIRRELVM v,const SQChar *s,...) +{ + va_list vl; + va_start(vl, s); + scvprintf(stdout, s, vl); + va_end(vl); +} + +void errorfunc(HSQUIRRELVM v,const SQChar *s,...) +{ + va_list vl; + va_start(vl, s); + scvprintf(stderr, s, vl); + va_end(vl); +} + +int main() +{ + HSQUIRRELVM v; + v = sq_open(1024); + + sqstd_seterrorhandlers(v); + + sq_setprintfunc(v, printfunc, errorfunc); + + sq_pushroottable(v); + + sqstd_register_iolib(v); + + sq_pop(v, 1); + sq_close(v); + + return 0; +} diff --git a/recipes/squirrel/all/test_v1_package/CMakeLists.txt b/recipes/squirrel/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/squirrel/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/squirrel/all/test_v1_package/conanfile.py b/recipes/squirrel/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/squirrel/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/squirrel/config.yml b/recipes/squirrel/config.yml new file mode 100644 index 0000000000000..02e8efce1632d --- /dev/null +++ b/recipes/squirrel/config.yml @@ -0,0 +1,5 @@ +versions: + "3.2": + folder: all + "3.1": + folder: all diff --git a/recipes/srt/all/CMakeLists.txt b/recipes/srt/all/CMakeLists.txt new file mode 100644 index 0000000000000..591533b782973 --- /dev/null +++ b/recipes/srt/all/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(CONAN_LIBS_PTHREADS4W) + set(PTHREAD_LIBRARY "${CONAN_LIBS_PTHREADS4W}") + set(PTHREAD_INCLUDE_DIR "${CONAN_INCLUDE_DIRS_PTHREADS4W}") +endif() + +add_subdirectory("source_subfolder") diff --git a/recipes/srt/all/conandata.yml b/recipes/srt/all/conandata.yml new file mode 100644 index 0000000000000..e10fcb414463b --- /dev/null +++ b/recipes/srt/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "1.4.1": + sha256: e80ca1cd0711b9c70882c12ec365cda1ba852e1ce8acd43161a21a04de0cbf14 + url: https://github.com/Haivision/srt/archive/v1.4.1.tar.gz + "1.4.2": + sha256: 28a308e72dcbb50eb2f61b50cc4c393c413300333788f3a8159643536684a0c4 + url: https://github.com/Haivision/srt/archive/v1.4.2.tar.gz + "1.4.3": + sha256: c06e05664c71d635c37207a2b5a444f2c4a95950a3548402b3e0c524f735b33d + url: https://github.com/Haivision/srt/archive/refs/tags/v1.4.3.tar.gz + "1.4.4": + url: "https://github.com/Haivision/srt/archive/v1.4.4.tar.gz" + sha256: "93f5f3715bd5bd522b8d65fc0d086ef2ad49db6a41ad2d7b35df2e8bd7094114" +patches: + "1.4.1": + - patch_file: "patches/no-delayload-libeay32.patch" + base_path: "source_subfolder" diff --git a/recipes/srt/all/conanfile.py b/recipes/srt/all/conanfile.py new file mode 100644 index 0000000000000..dfed1538859cc --- /dev/null +++ b/recipes/srt/all/conanfile.py @@ -0,0 +1,103 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class SrtConan(ConanFile): + name = "srt" + homepage = "https://github.com/Haivision/srt" + description = "Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet." + topics = ("conan", "srt", "ip", "transport") + url = "https://github.com/conan-io/conan-center-index" + license = "MPL-2.0" + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + short_paths = True + + exports_sources = ["CMakeLists.txt", "patches/*"] + 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 _has_stdcxx_sync(self): + return tools.Version(self.version) >= "1.4.2" + + @property + def _has_posix_threads(self): + return not (self.settings.os == "Windows" and (self.settings.compiler == "Visual Studio" or \ + (self.settings.compiler == "gcc" and self.settings.compiler.get_safe("threads") == "win32"))) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("openssl/1.1.1q") + if not self._has_posix_threads and not self._has_stdcxx_sync: + self.requires("pthreads4w/3.0.0") + + 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) + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "set (CMAKE_MODULE_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/scripts\")", + "list(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/scripts\")") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["ENABLE_APPS"] = False + self._cmake.definitions["ENABLE_LOGGING"] = False + self._cmake.definitions["ENABLE_SHARED"] = self.options.shared + self._cmake.definitions["ENABLE_STATIC"] = not self.options.shared + if self._has_stdcxx_sync: + self._cmake.definitions["ENABLE_STDCXX_SYNC"] = True + self._cmake.definitions["ENABLE_ENCRYPTION"] = True + self._cmake.definitions["USE_OPENSSL_PC"] = False + if self.settings.compiler == "Visual Studio": + # required to avoid warnings when srt shared, even if openssl shared, + # otherwise upstream CMakeLists would add /DELAYLOAD:libeay32.dll to link flags + self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "srt" + suffix = "_static" if self.settings.compiler == "Visual Studio" and not self.options.shared else "" + self.cpp_info.libs = ["srt" + suffix] + if self.options.shared: + self.cpp_info.defines = ["SRT_DYNAMIC"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/srt/all/patches/no-delayload-libeay32.patch b/recipes/srt/all/patches/no-delayload-libeay32.patch new file mode 100644 index 0000000000000..9916c2deb6bec --- /dev/null +++ b/recipes/srt/all/patches/no-delayload-libeay32.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -627,7 +627,11 @@ if (srt_libspec_shared) + endif() + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib) +- set_target_properties(${TARGET_srt}_shared PROPERTIES LINK_FLAGS "/DELAYLOAD:libeay32.dll") ++ if (OPENSSL_USE_STATIC_LIBS) ++ target_link_libraries(${TARGET_srt}_shared PRIVATE crypt32.lib) ++ else() ++ set_target_properties(${TARGET_srt}_shared PROPERTIES LINK_FLAGS "/DELAYLOAD:libeay32.dll") ++ endif() + elseif (MINGW) + target_link_libraries(${TARGET_srt}_shared PRIVATE wsock32.lib ws2_32.lib) + elseif (APPLE) diff --git a/recipes/srt/all/test_package/CMakeLists.txt b/recipes/srt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dd27cce4bb0ad --- /dev/null +++ b/recipes/srt/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1.2) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(srt REQUIRED) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} srt::srt) diff --git a/recipes/srt/all/test_package/conanfile.py b/recipes/srt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9294e13566895 --- /dev/null +++ b/recipes/srt/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/srt/all/test_package/test_package.cpp b/recipes/srt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7feda55e41428 --- /dev/null +++ b/recipes/srt/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +#include + +#ifndef _WIN32 + #include + #include +#else + #include + #include +#endif + +#include + +int main() +{ + // use this function to initialize the UDT library + srt_startup(); + + srt_setloglevel(srt_logging::LogLevel::debug); + addrinfo hints; + addrinfo* res; + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_flags = AI_PASSIVE; + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_DGRAM; + + std::string service("9000"); + if (0 != getaddrinfo(NULL, service.c_str(), &hints, &res)) + { + srt_cleanup(); + return 1; + } + + SRTSOCKET serv = srt_socket(res->ai_family, res->ai_socktype, res->ai_protocol); + srt_close(serv); + + // use this function to release the UDT library + freeaddrinfo(res); + srt_cleanup(); + return 0; +} diff --git a/recipes/srt/config.yml b/recipes/srt/config.yml new file mode 100644 index 0000000000000..09ca969e279a3 --- /dev/null +++ b/recipes/srt/config.yml @@ -0,0 +1,9 @@ +versions: + "1.4.1": + folder: all + "1.4.2": + folder: all + "1.4.3": + folder: all + "1.4.4": + folder: all diff --git a/recipes/ssht/all/CMakeLists.txt b/recipes/ssht/all/CMakeLists.txt new file mode 100644 index 0000000000000..32d0b43daf801 --- /dev/null +++ b/recipes/ssht/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/ssht/all/conandata.yml b/recipes/ssht/all/conandata.yml new file mode 100644 index 0000000000000..077fff5429d55 --- /dev/null +++ b/recipes/ssht/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.4.0": + url: "https://github.com/astro-informatics/ssht/archive/v1.4.0.tar.gz" + sha256: "b33f1b763a240df773a1900139aad6f6b5c676bb2b64a8c1062077fd95c08769" + "1.3.7": + url: "https://github.com/astro-informatics/ssht/archive/v1.3.7.zip" + sha256: "14172ddc4152ce5057fdb2798ed1eacbac8042d288e954e37724580cb5e88f8b" diff --git a/recipes/ssht/all/conanfile.py b/recipes/ssht/all/conanfile.py new file mode 100644 index 0000000000000..bbf74c31ff0c0 --- /dev/null +++ b/recipes/ssht/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools import files +from conan.errors import ConanInvalidConfiguration +from conans import CMake + +required_conan_version = ">=1.50.0" + +class SshtConan(ConanFile): + name = "ssht" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/astro-informatics/ssht" + description = "Fast spin spherical harmonic transforms" + settings = "os", "arch", "compiler", "build_type" + topics = ("physics", "astrophysics", "radio interferometry") + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + requires = "fftw/3.3.9" + generators = "cmake", "cmake_find_package", "cmake_paths" + exports_sources = ["CMakeLists.txt"] + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def validate(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("SSHT requires C99 support for complex numbers.") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @property + def cmake(self): + if not hasattr(self, "_cmake"): + self._cmake = CMake(self) + self._cmake.definitions["tests"] = False + self._cmake.definitions["python"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self.cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ssht"] diff --git a/recipes/ssht/all/test_package/CMakeLists.txt b/recipes/ssht/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dfe499c06a976 --- /dev/null +++ b/recipes/ssht/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(Ssht REQUIRED NO_MODULE) + +add_executable(${PROJECT_NAME} example.c) +target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) +target_link_libraries(${PROJECT_NAME} ssht::ssht) diff --git a/recipes/ssht/all/test_package/conanfile.py b/recipes/ssht/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4930d744506dc --- /dev/null +++ b/recipes/ssht/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +import os +from conans import ConanFile, CMake, tools + + +class SshtTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def configure(self): + del self.settings.compiler.libcxx + + 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/ssht/all/test_package/example.c b/recipes/ssht/all/test_package/example.c new file mode 100644 index 0000000000000..8ddef88553e5c --- /dev/null +++ b/recipes/ssht/all/test_package/example.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char *argv[]) +{ + ssht_sampling_weight_mw(5); + return 0; +} diff --git a/recipes/ssht/config.yml b/recipes/ssht/config.yml new file mode 100644 index 0000000000000..fc50f8a9c5846 --- /dev/null +++ b/recipes/ssht/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.0": + folder: all + "1.3.7": + folder: all diff --git a/recipes/st_tree/all/conandata.yml b/recipes/st_tree/all/conandata.yml new file mode 100644 index 0000000000000..bf87a7abb63f7 --- /dev/null +++ b/recipes/st_tree/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.2.2": + url: "https://github.com/erikerlandson/st_tree/archive/version_1.2.2.tar.gz" + sha256: "7accf5e257407512c2025e074c9d990ebb1bf4beff22b4204b432e9b6c2b5e49" + "1.2.1": + url: "https://github.com/erikerlandson/st_tree/archive/refs/tags/version_1.2.1.tar.gz" + sha256: "02161784c9092a3f78b3964fdf98bc58a3699b5e966f00554562428d804bb205" diff --git a/recipes/st_tree/all/conanfile.py b/recipes/st_tree/all/conanfile.py new file mode 100644 index 0000000000000..2654379b52b95 --- /dev/null +++ b/recipes/st_tree/all/conanfile.py @@ -0,0 +1,42 @@ +import os + +from conans.errors import ConanInvalidConfiguration +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + +class STTreeConan(ConanFile): + name = "st_tree" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + description = "A fast and flexible c++ template class for tree data structures" + topics = ("stl", "container", "data-structures") + homepage = "https://github.com/erikerlandson/st_tree" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(source_folder=self._source_subfolder) + return cmake + + def package(self): + self.copy("LICENSE", "licenses", self._source_subfolder) + + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "st_tree" + self.cpp_info.filenames["cmake_find_package_multi"] = "st_tree" diff --git a/recipes/st_tree/all/test_package/CMakeLists.txt b/recipes/st_tree/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bce4a94d44821 --- /dev/null +++ b/recipes/st_tree/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(st_tree CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} st_tree::st_tree) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/st_tree/all/test_package/conanfile.py b/recipes/st_tree/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5d1d0c318d32c --- /dev/null +++ b/recipes/st_tree/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class STTreeTestConan(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/st_tree/all/test_package/test_package.cpp b/recipes/st_tree/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5e70c5eb78db3 --- /dev/null +++ b/recipes/st_tree/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include "st_tree.h" +#include + +int main() { + st_tree::tree t; + t.insert("Hello"); + + t.root().insert(" "); + t.root().insert("world"); + + t.root()[0].insert("!"); + t.root()[1].insert("\n"); + + for (st_tree::tree::iterator j = t.begin(); j != t.end(); ++j) { + std::cout << j->data() << std::endl; + } + + return 0; +} diff --git a/recipes/st_tree/config.yml b/recipes/st_tree/config.yml new file mode 100644 index 0000000000000..af216ac4b02b7 --- /dev/null +++ b/recipes/st_tree/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.2": + folder: all + "1.2.1": + folder: all diff --git a/recipes/statslib/all/conandata.yml b/recipes/statslib/all/conandata.yml new file mode 100644 index 0000000000000..c09ac70fd003b --- /dev/null +++ b/recipes/statslib/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.4.0": + url: "https://github.com/kthohr/stats/archive/v3.4.0.tar.gz" + sha256: "aee9cadf0ab8c6fc26963d502eb62cd551f0e0e83388b72d61819308cc8bb17f" + "3.2.0": + url: "https://github.com/kthohr/stats/archive/v3.2.0.tar.gz" + sha256: "1360ba4fbeed96db04e28541b8044daffecdbabc5565944d5cb67136477003ed" + "3.1.2": + url: "https://github.com/kthohr/stats/archive/v3.1.2.tar.gz" + sha256: "fe82c679dbed0cbea284ce077e2c2503afaec745658a3791f9fe5010e438305e" + "3.1.1": + url: "https://github.com/kthohr/stats/archive/v3.1.1.tar.gz" + sha256: "7a6d9fcb8dcf7c9e04a3a895d01970458a1965577582844f4e6b2b17b85fc6ca" diff --git a/recipes/statslib/all/conanfile.py b/recipes/statslib/all/conanfile.py new file mode 100644 index 0000000000000..15f4da77d6f72 --- /dev/null +++ b/recipes/statslib/all/conanfile.py @@ -0,0 +1,51 @@ +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 StatsLibConan(ConanFile): + name = "statslib" + description = "A C++ header-only library of statistical distribution functions." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.kthohr.com/statslib.html" + topics = ("statistics", "constexpr", "probability", "stats", "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("gcem/1.16.0", transitive_headers=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) + + 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="*", + 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/statslib/all/test_package/CMakeLists.txt b/recipes/statslib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..94c3b5a1feecb --- /dev/null +++ b/recipes/statslib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(statslib CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE statslib::statslib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/statslib/all/test_package/conanfile.py b/recipes/statslib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e730ad6dc0dfc --- /dev/null +++ b/recipes/statslib/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/statslib/all/test_package/test_package.cpp b/recipes/statslib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a32a897ab0d28 --- /dev/null +++ b/recipes/statslib/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "stats.hpp" + +int main() +{ + constexpr double dens_1 = stats::dlaplace(1.0, 1.0, 2.0); // answer = 0.25 + constexpr double prob_1 = stats::plaplace(1.0, 1.0, 2.0); // answer = 0.5 + constexpr double quant_1 = stats::qlaplace(0.1, 1.0, 2.0); // answer = -2.218875... + + return 0; +} diff --git a/recipes/statslib/all/test_v1_package/CMakeLists.txt b/recipes/statslib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/statslib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/statslib/all/test_v1_package/conanfile.py b/recipes/statslib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/statslib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/statslib/config.yml b/recipes/statslib/config.yml new file mode 100644 index 0000000000000..fc55f9dac4247 --- /dev/null +++ b/recipes/statslib/config.yml @@ -0,0 +1,9 @@ +versions: + "3.4.0": + folder: "all" + "3.2.0": + folder: "all" + "3.1.2": + folder: "all" + "3.1.1": + folder: "all" diff --git a/recipes/status-code/all/conandata.yml b/recipes/status-code/all/conandata.yml new file mode 100644 index 0000000000000..49b0985bc39b6 --- /dev/null +++ b/recipes/status-code/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220616": + url: "https://github.com/ned14/status-code/archive/38e1e862386cb38d577664fd681ef829b0e03fba.tar.gz" + sha256: "faf112df1633a1ee1f58c8b056130154b7c0dbf12e7f006a04dc376500d271c3" diff --git a/recipes/status-code/all/conanfile.py b/recipes/status-code/all/conanfile.py new file mode 100644 index 0000000000000..ba9f0306e38c0 --- /dev/null +++ b/recipes/status-code/all/conanfile.py @@ -0,0 +1,55 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.scm import Version + +required_conan_version = ">=1.45.0" + +class StatusCodeConan(ConanFile): + name = "status-code" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ned14/status-code" + description = "Proposed SG14 status_code for the C++ standard" + topics = ("header-only", "proposal", "status", "return code") + package_type = "header-library" + settings = "os", "arch", "build_type", "compiler" + + @property + def _compiler_required_version(self): + return { + # Their README says gcc 5, but in testing only >=7 worked + "gcc": "7", + "clang": "3.3", + "Visual Studio": "14", + "apple-clang": "5", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + + min_version = self._compiler_required_version.get(str(self.settings.compiler)) + if min_version: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("This package requires c++11 support. The current compiler does not support it.") + else: + self.output.warning("This recipe has no support for the current compiler. Please consider adding it.") + + 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, "Licence.txt", 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")) + copy(self, "*.ipp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + # See https://github.com/ned14/status-code/blob/38e1e862386cb38d577664fd681ef829b0e03fba/CMakeLists.txt#L126 + self.cpp_info.set_property("cmake_file_name", "status-code") + self.cpp_info.set_property("cmake_target_name", "status-code::hl") diff --git a/recipes/status-code/all/test_package/CMakeLists.txt b/recipes/status-code/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd415d6aae8d1 --- /dev/null +++ b/recipes/status-code/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(status-code REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package status-code::hl) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/status-code/all/test_package/conanfile.py b/recipes/status-code/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/status-code/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/status-code/all/test_package/test_package.cpp b/recipes/status-code/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a2a617bc7f941 --- /dev/null +++ b/recipes/status-code/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + system_error2::system_code sc; + bool isFailure = sc.failure(); +} diff --git a/recipes/status-code/all/test_v1_package/CMakeLists.txt b/recipes/status-code/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..378dd67690afd --- /dev/null +++ b/recipes/status-code/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +# Just a workaround to not supprt the deprecated generators while passing the 1.x hooks +find_package(status-code CONFIG REQUIRED) +add_library(status-code::hl ALIAS status-code::status-code) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/status-code/all/test_v1_package/conanfile.py b/recipes/status-code/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/status-code/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/status-code/config.yml b/recipes/status-code/config.yml new file mode 100644 index 0000000000000..484ac289f9edf --- /dev/null +++ b/recipes/status-code/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220616": + folder: all diff --git a/recipes/status-value-lite/all/conandata.yml b/recipes/status-value-lite/all/conandata.yml new file mode 100644 index 0000000000000..b76b77ab14ac4 --- /dev/null +++ b/recipes/status-value-lite/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/martinmoene/status-value-lite/archive/v1.1.0.tar.gz" + sha256: "adcc9f3938b7805c1c465b5cde4e96143e126e7ddbccc00a53b452a8cc4d8ba8" diff --git a/recipes/status-value-lite/all/conanfile.py b/recipes/status-value-lite/all/conanfile.py new file mode 100644 index 0000000000000..11adb1704e944 --- /dev/null +++ b/recipes/status-value-lite/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class StatusValueLiteConan(ConanFile): + name = "status-value-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/status-value-lite" + description = ( + "status-value - A class for status and optional value for C++11 and " + "later, C++98 variant provided in a single-file header-only library" + ) + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "status_value", "status_value-implementations") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "status-value-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::status-value-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "status-value-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "status-value-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["status_valuelite"].names["cmake_find_package"] = "status-value-lite" + self.cpp_info.components["status_valuelite"].names["cmake_find_package_multi"] = "status-value-lite" + self.cpp_info.components["status_valuelite"].set_property("cmake_target_name", "nonstd::status-value-lite") + self.cpp_info.components["status_valuelite"].bindirs = [] + self.cpp_info.components["status_valuelite"].frameworkdirs = [] + self.cpp_info.components["status_valuelite"].libdirs = [] + self.cpp_info.components["status_valuelite"].resdirs = [] diff --git a/recipes/status-value-lite/all/test_package/CMakeLists.txt b/recipes/status-value-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..624779ea603b1 --- /dev/null +++ b/recipes/status-value-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(status-value-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::status-value-lite) diff --git a/recipes/status-value-lite/all/test_package/conanfile.py b/recipes/status-value-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/status-value-lite/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/status-value-lite/all/test_package/test_package.cpp b/recipes/status-value-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..db7d7e795ea1d --- /dev/null +++ b/recipes/status-value-lite/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include "nonstd/status_value_cpp98.hpp" + +#include +#include +#include + +using namespace nonstd; + +status_value to_int( char const * const text ) +{ + char * pos = NULL; + const int value = static_cast( strtol( text, &pos, 0 ) ); + + if ( pos != text ) return status_value( "Excellent", value ); + else return status_value( std::string("'") + text + "' isn't a number" ); +} + +int main( int argc, char * argv[] ) +{ + const char * text = argc > 1 ? argv[1] : "42"; + + status_value svi = to_int( text ); + + if ( svi ) std::cout << svi.status() << ": '" << text << "' is " << *svi << ", "; + else std::cout << "Error: " << svi.status(); +} diff --git a/recipes/status-value-lite/all/test_v1_package/CMakeLists.txt b/recipes/status-value-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed3eb47f85dd6 --- /dev/null +++ b/recipes/status-value-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(status-value-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::status-value-lite) diff --git a/recipes/status-value-lite/all/test_v1_package/conanfile.py b/recipes/status-value-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/status-value-lite/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/status-value-lite/config.yml b/recipes/status-value-lite/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/status-value-lite/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/stb/all/conandata.yml b/recipes/stb/all/conandata.yml new file mode 100644 index 0000000000000..661745efcb3f0 --- /dev/null +++ b/recipes/stb/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "cci.20220909": + url: "https://github.com/nothings/stb/archive/8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55.zip" + sha256: "93a16ee3e866e719feec459f6f132cce932c5ec751eb38e3ec1975f911353d2e" + "cci.20210910": + url: "https://github.com/nothings/stb/archive/af1a5bc352164740c1cc1354942b1c6b72eacb8a.zip" + sha256: "e3d0edbecd356506d3d69b87419de2f9d180a98099134c6343177885f6c2cbef" + "cci.20210713": + url: "https://github.com/nothings/stb/archive/3a1174060a7dd4eb652d4e6854bc4cd98c159200.zip" + sha256: "9313f6871195b97771ce7da1feae0b3d92c7936456f13099edb54a78096ca93c" + "cci.20200203": + url: "https://github.com/nothings/stb/archive/0224a44a10564a214595797b4c88323f79a5f934.zip" + sha256: "5dd9cf8a9a8c0f253fad3e9904923b2dfc740eddbc86415c3f76152bd534f23a" diff --git a/recipes/stb/all/conanfile.py b/recipes/stb/all/conanfile.py new file mode 100644 index 0000000000000..540bdbac942b9 --- /dev/null +++ b/recipes/stb/all/conanfile.py @@ -0,0 +1,67 @@ +from conan import ConanFile +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class StbConan(ConanFile): + name = "stb" + description = "single-file public domain libraries for C/C++" + topics = ("stb", "single-file") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nothings/stb" + license = ("Unlicense", "MIT") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + options = { + "with_deprecated": [True, False], + } + + default_options = { + "with_deprecated": True, + } + + @property + def _version(self): + # HACK: Used to circumvent the incompatibility + # of the format cci.YYYYMMDD in tools.Version + return str(self.version)[4:] + + def config_options(self): + if Version(self._version) < "20210713": + del self.options.with_deprecated + + 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) + + 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")) + copy(self, "stb_vorbis.c", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + rmdir(self, os.path.join(self.package_folder, "include", "tests")) + if Version(self._version) >= "20210713": + rmdir(self, os.path.join(self.package_folder, "include", "deprecated")) + if self.options.get_safe("with_deprecated"): + copy(self, "*.h", src=os.path.join(self.source_folder, "deprecated"), dst=os.path.join(self.package_folder, "include")) + copy(self, "stb_image.c", src=os.path.join(self.source_folder, "deprecated"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.defines.append("STB_TEXTEDIT_KEYTYPE=unsigned") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/stb/all/test_package/CMakeLists.txt b/recipes/stb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0f7be22180d6c --- /dev/null +++ b/recipes/stb/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(stb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE stb::stb) diff --git a/recipes/stb/all/test_package/conanfile.py b/recipes/stb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/stb/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/stb/all/test_package/test_package.c b/recipes/stb/all/test_package/test_package.c new file mode 100644 index 0000000000000..d7acab4ae1eac --- /dev/null +++ b/recipes/stb/all/test_package/test_package.c @@ -0,0 +1,153 @@ +#define STBI_WINDOWS_UTF8 + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include "stb_image_write.h" + +#define STB_IMAGE_IMPLEMENTATION +#include "stb_image.h" + +#define STB_DEFINE +#include "stb.h" + +float hdr_data[200][200][3]; + +void dummy_write(void* context, void* data, int len) +{ + static char dummy[1024]; + if (len > 1024) + len = 1024; + memcpy(dummy, data, len); +} + +int main(int argc, char** argv) +{ + int w, h; + + if (argc > 1) { + int i, n; + + for (i = 1; i < argc; ++i) { + int res; + int w2, h2, n2; + unsigned char* data; + printf("%s\n", argv[i]); + res = stbi_info(argv[i], &w2, &h2, &n2); + data = stbi_load(argv[i], &w, &h, &n, 0); + if (data) + free(data); + else + printf("Failed &n\n"); + data = stbi_load(argv[i], &w, &h, &n, 4); + if (data) + free(data); + else + printf("Failed &n\n"); + data = stbi_load(argv[i], &w, &h, 0, 1); + if (data) + free(data); + else + printf("Failed 1\n"); + data = stbi_load(argv[i], &w, &h, 0, 2); + if (data) + free(data); + else + printf("Failed 2\n"); + data = stbi_load(argv[i], &w, &h, 0, 3); + if (data) + free(data); + else + printf("Failed 3\n"); + data = stbi_load(argv[i], &w, &h, &n, 4); + assert(data); + assert(w == w2 && h == h2 && n == n2); + assert(res); + if (data) { + char fname[512]; + stb_splitpath(fname, argv[i], STB_FILE); + stbi_write_png(stb_sprintf("output/%s.png", fname), w, h, 4, data, w * 4); + stbi_write_bmp(stb_sprintf("output/%s.bmp", fname), w, h, 4, data); + stbi_write_tga(stb_sprintf("output/%s.tga", fname), w, h, 4, data); + stbi_write_png_to_func(dummy_write, 0, w, h, 4, data, w * 4); + stbi_write_bmp_to_func(dummy_write, 0, w, h, 4, data); + stbi_write_tga_to_func(dummy_write, 0, w, h, 4, data); + free(data); + } else + printf("FAILED 4\n"); + } + } else { + int i; +#ifdef PNGSUITE_PRIMARY + char** files = stb_readdir_files("pngsuite/primary"); +#else + char** files = stb_readdir_files("images"); +#endif + for (i = 0; i < stb_arr_len(files); ++i) { + int n; + char** failed = NULL; + unsigned char* data; + printf("."); + data = stbi_load(files[i], &w, &h, &n, 0); + if (data) + free(data); + else + stb_arr_push(failed, "&n"); + data = stbi_load(files[i], &w, &h, 0, 1); + if (data) + free(data); + else + stb_arr_push(failed, "1"); + data = stbi_load(files[i], &w, &h, 0, 2); + if (data) + free(data); + else + stb_arr_push(failed, "2"); + data = stbi_load(files[i], &w, &h, 0, 3); + if (data) + free(data); + else + stb_arr_push(failed, "3"); + data = stbi_load(files[i], &w, &h, 0, 4); + if (data) + ; + else + stb_arr_push(failed, "4"); + if (data) { + char fname[512]; + +#ifdef PNGSUITE_PRIMARY + int w2, h2; + unsigned char* data2; + stb_splitpath(fname, files[i], STB_FILE_EXT); + data2 = stbi_load(stb_sprintf("pngsuite/primary_check/%s", fname), &w2, &h2, 0, 4); + if (!data2) + printf("FAILED: couldn't load 'pngsuite/primary_check/%s\n", fname); + else { + if (w != w2 || h != w2 || 0 != memcmp(data, data2, w * h * 4)) { + int x, y, c; + if (w == w2 && h == h2) + for (y = 0; y < h; ++y) + for (x = 0; x < w; ++x) + for (c = 0; c < 4; ++c) + assert(data[y * w * 4 + x * 4 + c] == data2[y * w * 4 + x * 4 + c]); + printf("FAILED: %s loaded but didn't match PRIMARY_check 32-bit version\n", files[i]); + } + free(data2); + } +#else + stb_splitpath(fname, files[i], STB_FILE); + stbi_write_png(stb_sprintf("output/%s.png", fname), w, h, 4, data, w * 4); +#endif + free(data); + } + if (failed) { + int j; + printf("FAILED: "); + for (j = 0; j < stb_arr_len(failed); ++j) + printf("%s ", failed[j]); + printf(" -- %s\n", files[i]); + } + } + printf("Tested %d files.\n", i); + } + return 0; +} diff --git a/recipes/stb/all/test_v1_package/CMakeLists.txt b/recipes/stb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/stb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/stb/all/test_v1_package/conanfile.py b/recipes/stb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/stb/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/stb/config.yml b/recipes/stb/config.yml new file mode 100644 index 0000000000000..8542dee027505 --- /dev/null +++ b/recipes/stb/config.yml @@ -0,0 +1,9 @@ +versions: + "cci.20220909": + folder: all + "cci.20210910": + folder: all + "cci.20210713": + folder: all + "cci.20200203": + folder: all diff --git a/recipes/stc/all/conandata.yml b/recipes/stc/all/conandata.yml new file mode 100644 index 0000000000000..a87f93d04cdef --- /dev/null +++ b/recipes/stc/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "4.1.1": + url: "https://github.com/tylov/STC/archive/refs/tags/v4.1.1.tar.gz" + sha256: "4386f7bc6480ba101f3e71b1adccfff8ccf586a31271d6ddc0f634d727d9f031" + "3.9": + url: "https://github.com/tylov/STC/archive/v3.9.tar.gz" + sha256: "4dde312a8305620d0d5b295f895ed5c66900c9185aec8f79240ea391796da19d" + "3.5.1": + url: "https://github.com/tylov/STC/archive/refs/tags/v3.5.1.tar.gz" + sha256: "c3799303ad9ed42de31da2b642f281731a157d82d503b1e4f3d4cabcb431e978" + "1.0.0-rc1": + url: "https://github.com/tylov/STC/archive/refs/tags/v1.0.0-rc1.tar.gz" + sha256: "503ae9c43c0584bd177c0c4bd69c0b31d26b213d84c6c2aabe4fd48eb3cf6b81" diff --git a/recipes/stc/all/conanfile.py b/recipes/stc/all/conanfile.py new file mode 100644 index 0000000000000..7b5788fb609c1 --- /dev/null +++ b/recipes/stc/all/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class StcConan(ConanFile): + name = "stc" + description = ( + "A modern, user friendly, generic, type-safe and fast C99 container " + "library: String, Vector, Sorted and Unordered Map and Set, Deque, " + "Forward List, Smart Pointers, Bitset and Random numbers." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tylov/STC" + topics = ("containers", "string", "vector", "map", "set", "deque", "bitset", "random", "list") + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.version == "1.0.0-rc1": + src_include = self.source_folder + else: + src_include = os.path.join(self.source_folder, "include") + copy(self, "*.h", src=src_include, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/stc/all/test_package/CMakeLists.txt b/recipes/stc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..83d4a89b6f090 --- /dev/null +++ b/recipes/stc/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(stc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE stc::stc) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +if(${stc_VERSION} STREQUAL "1.0.0-rc1") + target_compile_definitions(${PROJECT_NAME} PRIVATE STC_VERSION=1) +elseif(${stc_VERSION} VERSION_GREATER_EQUAL "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE STC_VERSION=3) +endif() diff --git a/recipes/stc/all/test_package/conanfile.py b/recipes/stc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/stc/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/stc/all/test_package/test_package.c b/recipes/stc/all/test_package/test_package.c new file mode 100644 index 0000000000000..7cb53b9237a09 --- /dev/null +++ b/recipes/stc/all/test_package/test_package.c @@ -0,0 +1,45 @@ +#include +#include + +#if STC_VERSION == 1 + +#include +using_cvec(i, int); + +int main(void) { + cvec_i vec = cvec_i_init(); + cvec_i_push_back(&vec, 10); + cvec_i_push_back(&vec, 20); + cvec_i_push_back(&vec, 30); + + c_foreach (i, cvec_i, vec) + printf(" %d", *i.ref); + + cvec_i_del(&vec); + + return EXIT_SUCCESS; +} + +#elif STC_VERSION == 3 + +#define i_val int +#define i_tag i +#include + +int main(void) { + cvec_i vec = cvec_i_init(); + cvec_i_push_back(&vec, 10); + cvec_i_push_back(&vec, 20); + cvec_i_push_back(&vec, 30); + + c_foreach (i, cvec_i, vec) + printf(" %d", *i.ref); + + cvec_i_drop(&vec); + + return EXIT_SUCCESS; +} + +#else +#error "invalid STC_VERSION" +#endif diff --git a/recipes/stc/all/test_v1_package/CMakeLists.txt b/recipes/stc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/stc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/stc/all/test_v1_package/conanfile.py b/recipes/stc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/stc/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/stc/config.yml b/recipes/stc/config.yml new file mode 100644 index 0000000000000..bfb07935d0412 --- /dev/null +++ b/recipes/stc/config.yml @@ -0,0 +1,9 @@ +versions: + "4.1.1": + folder: "all" + "3.9": + folder: "all" + "3.5.1": + folder: "all" + "1.0.0-rc1": + folder: "all" diff --git a/recipes/stduuid/all/conandata.yml b/recipes/stduuid/all/conandata.yml new file mode 100644 index 0000000000000..cb02ec2f29148 --- /dev/null +++ b/recipes/stduuid/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.3": + url: "https://github.com/mariusbancila/stduuid/archive/v1.2.3.tar.gz" + sha256: "b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3" + "1.2.2": + url: "https://github.com/mariusbancila/stduuid/archive/v1.2.2.tar.gz" + sha256: "f554f6a9fe4d852fa217de6ab977afbf3f49e4a1dcb263afd61a94253c4c7a48" + "1.0": + url: "https://github.com/mariusbancila/stduuid/archive/v1.0.tar.gz" + sha256: "e96f2ac7c950c3c24d7e2e44a84236277b7774ee346dcc620edf400d9eda0a3c" diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py new file mode 100644 index 0000000000000..f5148b86a236f --- /dev/null +++ b/recipes/stduuid/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class StduuidConan(ConanFile): + name = "stduuid" + description = "A C++17 cross-platform implementation for UUIDs" + topics = ("uuid", "guid", "header-only") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mariusbancila/stduuid" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_cxx20_span": [True, False], + } + default_options = { + "with_cxx20_span": False, + } + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" if self.options.with_cxx20_span else "17" + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "5", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if not self.options.with_cxx20_span: + self.requires("ms-gsl/3.1.0", transitive_headers=True) + if self.settings.os == "Linux" and Version(self.version) <= "1.0": + self.requires("libuuid/1.0.3", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppsd"): + 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 + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "uuid.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if not self.options.with_cxx20_span: + self.cpp_info.includedirs.append(os.path.join(self.dependencies["ms-gsl"].cpp_info.includedirs[0], "gsl")) diff --git a/recipes/stduuid/all/test_package/CMakeLists.txt b/recipes/stduuid/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f8d4ca0bfacfc --- /dev/null +++ b/recipes/stduuid/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(stduuid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE stduuid::stduuid) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(stduuid_VERSION VERSION_LESS "1.1") + target_compile_definitions(${PROJECT_NAME} PRIVATE STDUUID_LT_1_1) +endif() diff --git a/recipes/stduuid/all/test_package/conanfile.py b/recipes/stduuid/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/stduuid/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/stduuid/all/test_package/test_package.cpp b/recipes/stduuid/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..160cf9b5db82a --- /dev/null +++ b/recipes/stduuid/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include + +#include +#include +#include +#include +#include + +int main() { + { + auto str = "47183823-2574-4bfd-b411-99ed177d3e43"; + auto guid = uuids::uuid::from_string(str); +#ifdef STDUUID_LT_1_1 + assert(uuids::to_string(guid) == str); +#else + assert(uuids::to_string(guid.value()) == str); +#endif + } + + { + std::random_device rd; + auto seed_data = std::array {}; + std::generate(std::begin(seed_data), std::end(seed_data), std::ref(rd)); + std::seed_seq seq(std::begin(seed_data), std::end(seed_data)); + std::mt19937 generator(seq); + + uuids::uuid const guid = uuids::uuid_random_generator{generator}(); + assert(!guid.is_nil()); +#ifdef STDUUID_LT_1_1 + assert(guid.size() == 16); +#else + assert(guid.as_bytes().size() == 16); +#endif + assert(guid.version() == uuids::uuid_version::random_number_based); + assert(guid.variant() == uuids::uuid_variant::rfc); + } + + return 0; +} diff --git a/recipes/stduuid/all/test_v1_package/CMakeLists.txt b/recipes/stduuid/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/stduuid/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/stduuid/all/test_v1_package/conanfile.py b/recipes/stduuid/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/stduuid/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/stduuid/config.yml b/recipes/stduuid/config.yml new file mode 100644 index 0000000000000..a7bd15477bb57 --- /dev/null +++ b/recipes/stduuid/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.0": + folder: all diff --git a/recipes/stlab/all/conandata.yml b/recipes/stlab/all/conandata.yml new file mode 100644 index 0000000000000..cde4739b5d32c --- /dev/null +++ b/recipes/stlab/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.6.2": + url: "https://github.com/stlab/libraries/archive/v1.6.2.tar.gz" + sha256: "d0369d889c7bf78068d0c4f4b5125d7e9fe9abb0ad7a3be35bf13b6e2c271676" + "1.5.6": + url: "https://github.com/stlab/libraries/archive/refs/tags/v1.5.6.tar.gz" + sha256: "a6b788848be637b6d6c471de76c38486789e708997648e9b9731fdb5a631030c" + "1.5.5": + url: "https://github.com/stlab/libraries/archive/v1.5.5.tar.gz" + sha256: "30ec5a36b4c074feac72a1b9a744f0b279010e18c7bb04bbdc5d44fe9eaf5ad8" + "1.5.4": + url: "https://github.com/stlab/libraries/archive/v1.5.4.tar.gz" + sha256: "87306f58f6614f4a1ca54dda52fedff7e610d3b3dae035829657bac77bc33640" + "1.5.2": + url: https://github.com/stlab/libraries/archive/v1.5.2.tar.gz + sha256: a82eb013e51d0bb3ee2050f0eda31e11997cb4ca74d2abfdc2c8249c5c67c9fb diff --git a/recipes/stlab/all/conanfile.py b/recipes/stlab/all/conanfile.py new file mode 100644 index 0000000000000..b315741f04d56 --- /dev/null +++ b/recipes/stlab/all/conanfile.py @@ -0,0 +1,180 @@ +from conans import ConanFile, tools +from conans.tools import Version +from conans.errors import ConanInvalidConfiguration +import os + +class Stlab(ConanFile): + name = 'stlab' + description = 'The Software Technology Lab libraries.' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'https://github.com/stlab/libraries' + license = 'BSL-1.0' + topics = 'conan', 'c++', 'concurrency', 'futures', 'channels' + + settings = "arch", "os", "compiler", "build_type", + + options = { + "boost_optional": [True, False], + "boost_variant": [True, False], + "coroutines": [True, False], + "task_system": ["portable", "libdispatch", "emscripten", "pnacl", "windows", "auto"], + } + + default_options = { + "boost_optional": False, + "boost_variant": False, + "coroutines": False, + "task_system": "auto", + } + + no_copy_source = True + _source_subfolder = 'source_subfolder' + + def _use_boost(self): + return self.options.boost_optional or self.options.boost_variant + + def _requires_libdispatch(self): + # On macOS it is not necessary to use the libdispatch conan package, because the library is + # included in the OS. + return self.options.task_system == "libdispatch" and self.settings.os != "Macos" + + def requirements(self): + if self._use_boost(): + self.requires("boost/1.75.0") + + if self._requires_libdispatch(): + self.requires("libdispatch/5.3.2") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "libraries-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _fix_boost_components(self): + if self.settings.os != "Macos": return + if self.settings.compiler != "apple-clang": return + if Version(self.settings.compiler.version) >= "12": return + + # + # On Apple we have to force the usage of boost.variant, because Apple's implementation of C++17 is not complete. + # + self.output.info("Apple-Clang versions less than 12 do not correctly support std::optional or std::variant, so we will use boost::optional and boost::variant instead.") + self.options.boost_optional = True + self.options.boost_variant = True + + def _default_task_system(self): + if self.settings.os == "Macos": + return "libdispatch" + + if self.settings.os == "Windows": + return "windows" + + if self.settings.os == "Emscripten": + return "emscripten" + + return "portable" + + def _validate_task_system_libdispatch(self): + if self.settings.os == "Linux": + if self.settings.compiler != "clang": + raise ConanInvalidConfiguration("{}/{} task_system=libdispatch needs Clang compiler when using OS: {}. Use Clang compiler or switch to task_system=portable or task_system=auto".format(self.name, self.version, self.settings.os)) + elif self.settings.os != "Macos": + raise ConanInvalidConfiguration("{}/{} task_system=libdispatch is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) + + def _validate_task_system_windows(self): + if self.settings.os != "Windows": + self.output.info("Libdispatch is not supported on {}. The task system is changed to {}.".format(self.settings.os, self.options.task_system)) + raise ConanInvalidConfiguration("{}/{} task_system=windows is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) + + def _validate_task_system_emscripten(self): + if self.settings.os != "Emscripten": + raise ConanInvalidConfiguration("{}/{} task_system=emscripten is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) + + def _validate_task_system(self): + if self.options.task_system == "libdispatch": + self._validate_task_system_libdispatch() + elif self.options.task_system == "windows": + self._validate_task_system_windows() + elif self.options.task_system == "emscripten": + self._validate_task_system_emscripten() + + def _validate_boost_components(self): + if self.settings.os != "Macos": return + if self.settings.compiler != "apple-clang": return + if Version(self.settings.compiler.version) >= "12": return + if self.options.boost_optional and self.options.boost_variant: return + # + # On Apple we have to force the usage of boost.variant, because Apple's implementation of C++17 + # is not complete. + # + msg = "Apple-Clang versions less than 12 do not correctly support std::optional or std::variant, so we will use boost::optional and boost::variant instead. " + if not self.options.boost_optional and not self.options.boost_variant: + msg += "Try -o boost_optional=True -o boost_variant=True" + elif not self.options.boost_optional: + msg += "Try -o boost_optional=True." + else: + msg += "Try -o boost_variant=True." + + raise ConanInvalidConfiguration(msg) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, '17') + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": + raise ConanInvalidConfiguration("Need GCC >= 9") + + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "8": + raise ConanInvalidConfiguration("Need Clang >= 8") + + if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < "15.8": + raise ConanInvalidConfiguration("Need Visual Studio >= 2017 15.8 (MSVC 19.15)") + + # Actually, we want *at least* 15.8 (MSVC 19.15), but we cannot check this for now with Conan. + if self.settings.compiler == "msvc" and Version(self.settings.compiler.version) < "19.15": + raise ConanInvalidConfiguration("Need msvc >= 19.15") + + self._validate_task_system() + self._validate_boost_components() + + def configure(self): + if self.options.task_system == "auto": + self.options.task_system = self._default_task_system() + self.output.info("Stlab Task System: {}.".format(self.options.task_system)) + + def package(self): + self.copy("*LICENSE", dst="licenses", keep_path=False) + self.copy("stlab/*", src=self._source_subfolder, dst='include/') + + def package_id(self): + self.info.header_only() + self.info.options.boost_optional = "ANY" + self.info.options.boost_variant = "ANY" + + def package_info(self): + coroutines_value = 1 if self.options.coroutines else 0 + + self.cpp_info.defines = [ + 'STLAB_FUTURE_COROUTINES={}'.format(coroutines_value) + ] + + if self.options.boost_optional: + self.cpp_info.defines.append("STLAB_FORCE_BOOST_OPTIONAL") + + if self.options.boost_variant: + self.cpp_info.defines.append("STLAB_FORCE_BOOST_VARIANT") + + if self.options.task_system == "portable": + self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_PORTABLE") + elif self.options.task_system == "libdispatch": + self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_LIBDISPATCH") + elif self.options.task_system == "emscripten": + self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_EMSRIPTEN") #Note: there is a typo in Stlab Cmake. + self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_EMSCRIPTEN") #Note: for typo fix in later versions + elif self.options.task_system == "pnacl": + self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_PNACL") + elif self.options.task_system == "windows": + self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_WINDOWS") + + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/stlab/all/test_package/CMakeLists.txt b/recipes/stlab/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..98fa8e5af1b41 --- /dev/null +++ b/recipes/stlab/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 17) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/stlab/all/test_package/conanfile.py b/recipes/stlab/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/stlab/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/stlab/all/test_package/test_package.cpp b/recipes/stlab/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cbf630bd2f9a3 --- /dev/null +++ b/recipes/stlab/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +// Async example from https://stlab.cc/libraries/concurrency/ + +#include +#include + +#include +#include + +using namespace std; +using namespace stlab; + +int main() { + auto f = async(default_executor, [] { return 42; }); + + // Waiting just for illustration purpose + while (!f.get_try()) { this_thread::sleep_for(chrono::milliseconds(1)); } + + cout << "The answer is " << *f.get_try() << "\n"; +} + +/* + Result: + + The answer is 42 +*/ diff --git a/recipes/stlab/config.yml b/recipes/stlab/config.yml new file mode 100644 index 0000000000000..28a287ac4f61d --- /dev/null +++ b/recipes/stlab/config.yml @@ -0,0 +1,11 @@ +versions: + "1.6.2": + folder: all + "1.5.6": + folder: all + "1.5.5": + folder: all + "1.5.4": + folder: all + "1.5.2": + folder: all diff --git a/recipes/strawberryperl/all/conandata.yml b/recipes/strawberryperl/all/conandata.yml new file mode 100644 index 0000000000000..5d11e843fb992 --- /dev/null +++ b/recipes/strawberryperl/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "5.32.1.1": + x86: + url: "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip" + sha256: "d9c5711d12573a0f6d977792caa58364b1d46217521ae5c25cf5cc378a7c23c0" + x86_64: + url: "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-portable.zip" + sha256: "692646105b0f5e058198a852dc52a48f1cebcaf676d63bbdeae12f4eaee9bf5c" + "5.30.0.1": + x86: + url: "https://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit-portable.zip" + sha256: "a1d77821c77b7a3298cf3fe381e57cba43f89b9859204398f36d85f33b287837" + x86_64: + url: "https://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-64bit-portable.zip" + sha256: "9367a64ac1451b21804a224bb6235fe6848dd42f5fa1871583821ac3dfabf013" + "5.28.1.1": + x86: + url: "https://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-32bit-portable.zip" + sha256: "8b15c7c9574989568254a7859e473b7d5f68a1145d2e4418036600a81b13805c" + x86_64: + url: "https://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-64bit-portable.zip" + sha256: "935c95ba096fa11c4e1b5188732e3832d330a2a79e9882ab7ba8460ddbca810d" diff --git a/recipes/strawberryperl/all/conanfile.py b/recipes/strawberryperl/all/conanfile.py new file mode 100644 index 0000000000000..e5d600869e82f --- /dev/null +++ b/recipes/strawberryperl/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class StrawberryPerlConan(ConanFile): + name = "strawberryperl" + description = "Strawberry Perl for Windows." + license = ("Artistic-1.0", "GPL-1.0") + homepage = "http://strawberryperl.com" + url = "https://github.com/conan-io/conan-center-index" + topics = ("perl", "interpreter", "windows") + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + self.folders.build = "build" + + def package_id(self): + del self.info.settings.compiler + 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.") + + def source(self): + pass + + def build(self): + get(self, **self.conan_data["sources"][self.version][str(self.settings.arch)], destination=self.build_folder) + + def package(self): + copy(self, pattern="License.rtf*", src=os.path.join(self.build_folder, "licenses"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.build_folder, "perl", "bin"), dst=os.path.join(self.package_folder, "bin")) + copy(self, pattern="*", src=os.path.join(self.build_folder, "perl", "lib"), dst=os.path.join(self.package_folder, "lib")) + copy(self, pattern="*", src=os.path.join(self.build_folder, "perl", "vendor", "lib"), dst=os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + perl_path = os.path.join(self.package_folder, "bin", "perl.exe").replace("\\", "/") + self.conf_info.define("user.strawberryperl:perl", perl_path) + + # TODO remove once conan v2 is the only support and recipes have been migrated + if Version(conan_version).major < 2: + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) + self.user_info.perl = perl_path diff --git a/recipes/strawberryperl/all/test_package/conanfile.py b/recipes/strawberryperl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8cd67438d10ce --- /dev/null +++ b/recipes/strawberryperl/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conan import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("perl --version") + perl_script = os.path.join(self.source_folder, "list_files.pl") + self.run(f"perl {perl_script}") diff --git a/recipes/strawberryperl/all/test_package/list_files.pl b/recipes/strawberryperl/all/test_package/list_files.pl new file mode 100644 index 0000000000000..ed8aa3d6576f0 --- /dev/null +++ b/recipes/strawberryperl/all/test_package/list_files.pl @@ -0,0 +1,12 @@ +use strict; +use warnings; + +use Path::Tiny; + +my $dir = path('.'); +my $iter = $dir->iterator; +print "Hello Conan!\n"; +while (my $file = $iter->()) { + next if $file->is_dir(); + print "$file\n"; +} \ No newline at end of file diff --git a/recipes/strawberryperl/all/test_v1_package/conanfile.py b/recipes/strawberryperl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..641d8fdb8a176 --- /dev/null +++ b/recipes/strawberryperl/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +import os +from conans import ConanFile, tools + + +class DefaultNameConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("perl --version", run_environment=True) + perl_script = os.path.join(self.source_folder, os.pardir, "test_package", "list_files.pl") + self.run(f"perl {perl_script}", run_environment=True) diff --git a/recipes/strawberryperl/config.yml b/recipes/strawberryperl/config.yml new file mode 100644 index 0000000000000..11c21ecefe1e6 --- /dev/null +++ b/recipes/strawberryperl/config.yml @@ -0,0 +1,7 @@ +versions: + "5.32.1.1": + folder: all + "5.30.0.1": + folder: all + "5.28.1.1": + folder: all diff --git a/recipes/string-view-lite/all/conandata.yml b/recipes/string-view-lite/all/conandata.yml new file mode 100644 index 0000000000000..84f246b4d8a4d --- /dev/null +++ b/recipes/string-view-lite/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.7.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.7.0.tar.gz" + sha256: "265eaec08c4555259b46f5b03004dbc0f7206384edfac1cd5a837efaa642e01c" + "1.6.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.6.0.tar.gz" + sha256: "852d6dfec810067258a8cfc478d81fe7c08d473701e1989ec59769f549e50bae" + "1.5.1": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.5.1.tar.gz" + sha256: "1212d30b404a2c0a6f7192465102501955dcf3740ee100474e8fc2ac8e783c2f" + "1.4.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.4.0.tar.gz" + sha256: "650c135be0bdc5bcae6876864b8279f15b1b97069da944ec2c773cacdea27e27" + "1.3.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.3.0.tar.gz" + sha256: "d83adb0495ccfba50ae5a1af70bde04f33a26dc40599b0ce9e55f09c075daf23" diff --git a/recipes/string-view-lite/all/conanfile.py b/recipes/string-view-lite/all/conanfile.py new file mode 100644 index 0000000000000..3306dff001e24 --- /dev/null +++ b/recipes/string-view-lite/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +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" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "string-view-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::string-view-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "string-view-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "string-view-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["stringviewlite"].names["cmake_find_package"] = "string-view-lite" + self.cpp_info.components["stringviewlite"].names["cmake_find_package_multi"] = "string-view-lite" + self.cpp_info.components["stringviewlite"].set_property("cmake_target_name", "nonstd::string-view-lite") + self.cpp_info.components["stringviewlite"].bindirs = [] + self.cpp_info.components["stringviewlite"].libdirs = [] diff --git a/recipes/string-view-lite/all/test_package/CMakeLists.txt b/recipes/string-view-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4c0c42072ea0 --- /dev/null +++ b/recipes/string-view-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(string-view-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::string-view-lite) diff --git a/recipes/string-view-lite/all/test_package/conanfile.py b/recipes/string-view-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/string-view-lite/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/string-view-lite/all/test_package/test_package.cpp b/recipes/string-view-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..592c759295678 --- /dev/null +++ b/recipes/string-view-lite/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include "nonstd/string_view.hpp" +#include + +#if nssv_CPP11_OR_GREATER +using namespace nonstd::literals; +#if nssv_CPP14_OR_GREATER +using namespace std::literals; +#endif +#endif +using namespace nonstd; + +void write( string_view sv ) +{ + std::cout << sv; +} + +int main() +{ + write( "hello" ); // C-string +#if nssv_CPP11_OR_GREATER + write( ", "_sv ); // nonstd::string_view +#if nssv_CPP14_OR_GREATER + write( "world!"s ); // std::string +#endif +#endif +} diff --git a/recipes/string-view-lite/all/test_v1_package/CMakeLists.txt b/recipes/string-view-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..16690fb612bcb --- /dev/null +++ b/recipes/string-view-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(string-view-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::string-view-lite) diff --git a/recipes/string-view-lite/all/test_v1_package/conanfile.py b/recipes/string-view-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/string-view-lite/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/string-view-lite/config.yml b/recipes/string-view-lite/config.yml new file mode 100644 index 0000000000000..f05245374fbdd --- /dev/null +++ b/recipes/string-view-lite/config.yml @@ -0,0 +1,11 @@ +versions: + "1.7.0": + folder: all + "1.6.0": + folder: all + "1.5.1": + folder: all + "1.4.0": + folder: all + "1.3.0": + folder: all diff --git a/recipes/stringtoolbox/all/conandata.yml b/recipes/stringtoolbox/all/conandata.yml new file mode 100644 index 0000000000000..58defce8bbe18 --- /dev/null +++ b/recipes/stringtoolbox/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.4": + url: "https://github.com/chrberger/stringtoolbox/archive/refs/tags/v0.0.4.tar.gz" + sha256: "5778bc508f880e9f9d139446059766047108f941cd08f8fba102464289ebb967" diff --git a/recipes/stringtoolbox/all/conanfile.py b/recipes/stringtoolbox/all/conanfile.py new file mode 100644 index 0000000000000..c1426333ba094 --- /dev/null +++ b/recipes/stringtoolbox/all/conanfile.py @@ -0,0 +1,31 @@ +from conans import ConanFile, tools + +required_conan_version = ">=1.33.0" + +class DawHeaderLibrariesConan(ConanFile): + name = "stringtoolbox" + license = "MIT" + description = "A simple header-only, single-file string toolbox library for C++." + topics = ("string", "header-only",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chrberger/stringtoolbox" + settings = "os", "arch", "compiler", "build_type", + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, "11") + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE*", "licenses", self._source_subfolder) + self.copy("stringtoolbox.hpp", "include", self._source_subfolder) diff --git a/recipes/stringtoolbox/all/test_package/CMakeLists.txt b/recipes/stringtoolbox/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..76fbeefd9810e --- /dev/null +++ b/recipes/stringtoolbox/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(stringtoolbox CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} stringtoolbox::stringtoolbox) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/stringtoolbox/all/test_package/conanfile.py b/recipes/stringtoolbox/all/test_package/conanfile.py new file mode 100644 index 0000000000000..de03d357e14e0 --- /dev/null +++ b/recipes/stringtoolbox/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class DawHeaderLibrariesTestConan(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/stringtoolbox/all/test_package/test_package.cpp b/recipes/stringtoolbox/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e7504200b2f8c --- /dev/null +++ b/recipes/stringtoolbox/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include "stringtoolbox.hpp" + +#include + +int main() { + std::string target = " ABC "; + + std::cout << target << std::endl; + + stringtoolbox::trim(target); + + std::cout << target << std::endl; + + return 0; +} diff --git a/recipes/stringtoolbox/config.yml b/recipes/stringtoolbox/config.yml new file mode 100644 index 0000000000000..b50207771febb --- /dev/null +++ b/recipes/stringtoolbox/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.4": + folder: all diff --git a/recipes/strong_type/all/conandata.yml b/recipes/strong_type/all/conandata.yml new file mode 100644 index 0000000000000..3e0188fb65a1e --- /dev/null +++ b/recipes/strong_type/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "v7": + url: https://github.com/rollbear/strong_type/archive/refs/tags/v7.tar.gz + sha256: 854365b28dfaaee5c2047dd4d2e746c809b76035191b22a4ce24f4cac49d0891 + "v8": + url: https://github.com/rollbear/strong_type/archive/refs/tags/v8.tar.gz + sha256: 31ee68e097fec2ce65dbf2ed683911c5ee6a7a37808b28d84479ef7e17990fad + "v9": + url: https://github.com/rollbear/strong_type/archive/refs/tags/v9.tar.gz + sha256: 9d71ee02256b99c7f0189295514dd683cc1be8886444d5c04623fd491cf5aa40 + "v10": + url: https://github.com/rollbear/strong_type/archive/refs/tags/v10.tar.gz + sha256: 154e4ceda6cf8fe734deb7eafdf58df5052822d04425dc7c22711ef54cdaeefa diff --git a/recipes/strong_type/all/conanfile.py b/recipes/strong_type/all/conanfile.py new file mode 100644 index 0000000000000..04af76b6e1170 --- /dev/null +++ b/recipes/strong_type/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class StrongTypeConan(ConanFile): + name = "strong_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rollbear/strong_type" + description = "An additive strong typedef library for C++14/17/20" + topics = ("cpp14", "cpp17", "strong_type") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration("GCC < version 7 is not supported") + + 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 + + def package(self): + copy(self, "*", src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "strong_type") + self.cpp_info.set_property( + "cmake_target_name", "rollbear::strong_type") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "strong_type" + self.cpp_info.filenames["cmake_find_package_multi"] = "strong_type" + self.cpp_info.names["cmake_find_package"] = "rollbear" + self.cpp_info.names["cmake_find_package_multi"] = "rollbear" + self.cpp_info.components["strong_type"].names["cmake_find_package"] = "strong_type" + self.cpp_info.components["strong_type"].names["cmake_find_package_multi"] = "strong_type" + self.cpp_info.components["strong_type"].set_property( + "cmake_target_name", "rollbear::strong_type") + self.cpp_info.components["strong_type"].bindirs = [] + self.cpp_info.components["strong_type"].frameworkdirs = [] + self.cpp_info.components["strong_type"].libdirs = [] + self.cpp_info.components["strong_type"].resdirs = [] diff --git a/recipes/strong_type/all/test_package/CMakeLists.txt b/recipes/strong_type/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d668b94ccc776 --- /dev/null +++ b/recipes/strong_type/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(strong_type REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rollbear::strong_type) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/strong_type/all/test_package/conanfile.py b/recipes/strong_type/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/strong_type/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/strong_type/all/test_package/test_package.cpp b/recipes/strong_type/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b48e03ab7f9a5 --- /dev/null +++ b/recipes/strong_type/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + + +int main() { + using myint = strong::type; + + if (value_of(myint{3}) == 3) + return 0; + + return 1; +} diff --git a/recipes/strong_type/all/test_v1_package/CMakeLists.txt b/recipes/strong_type/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1690306012889 --- /dev/null +++ b/recipes/strong_type/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(strong_type REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rollbear::strong_type) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/strong_type/all/test_v1_package/conanfile.py b/recipes/strong_type/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/strong_type/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/strong_type/config.yml b/recipes/strong_type/config.yml new file mode 100644 index 0000000000000..a45ecce57a17a --- /dev/null +++ b/recipes/strong_type/config.yml @@ -0,0 +1,9 @@ +versions: + "v7": + folder: all + "v8": + folder: all + "v9": + folder: all + "v10": + folder: all diff --git a/recipes/structopt/all/conandata.yml b/recipes/structopt/all/conandata.yml new file mode 100644 index 0000000000000..6f0c202add0e6 --- /dev/null +++ b/recipes/structopt/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "0.1.3": + url: "https://github.com/p-ranav/structopt/archive/v0.1.3.tar.gz" + sha256: "6f911f31fad821af987e7134e91fa0ea8aa3282e2c4a9eb86fcde6faeb388531" + "0.1.2": + url: "https://github.com/p-ranav/structopt/archive/v0.1.2.tar.gz" + sha256: "904fb2e38cb1f547149b4bcd2a67f8bc4387dad1cd9a57d15c0a898faddd21b3" + "0.1.1": + url: "https://github.com/p-ranav/structopt/archive/v0.1.1.tar.gz" + sha256: "a813250b3325e462df613fe6b0730a5f93012b1a5a09810f88943ebac5b178bb" + "0.1.0": + url: "https://github.com/p-ranav/structopt/archive/v0.1.0.tar.gz" + sha256: "a0552e81312cfafcc5319a25c0571ca2470f43461e9f3f72e5f9d89ea4139505" +patches: + "0.1.3": + - base_path: "source_subfolder" + patch_file: "patches/0.1.0-0001-use-recipes.patch" + "0.1.2": + - base_path: "source_subfolder" + patch_file: "patches/0.1.0-0001-use-recipes.patch" + "0.1.1": + - base_path: "source_subfolder" + patch_file: "patches/0.1.0-0001-use-recipes.patch" + "0.1.0": + - base_path: "source_subfolder" + patch_file: "patches/0.1.0-0001-use-recipes.patch" diff --git a/recipes/structopt/all/conanfile.py b/recipes/structopt/all/conanfile.py new file mode 100644 index 0000000000000..08d36a1d38388 --- /dev/null +++ b/recipes/structopt/all/conanfile.py @@ -0,0 +1,77 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class StructoptConan(ConanFile): + name = "structopt" + description = "Parse command line arguments by defining a struct+" + topics = ("structopt", "argument-parser", "cpp17", "header-only", + "single-header-lib", "header-library", "command-line", "arguments", + "mit-license", "modern-cpp", "structopt", "lightweight", "reflection", + "cross-platform", "library", "type-safety", "type-safe", "argparse", + "clap",) + license = "MIT" + homepage = "https://github.com/p-ranav/structopt" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def requirements(self): + self.requires("magic_enum/0.8.0") + self.requires("visit_struct/1.0") + + def package_id(self): + self.info.header_only() + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.0", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("structopt: Unsupported compiler: {}-{} " + "(https://github.com/p-ranav/structopt#compiler-compatibility)." + .format(self.settings.compiler, self.settings.compiler.version)) + else: + self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(source_folder=self._source_subfolder) + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + tools.rmdir(os.path.join(self._source_subfolder, "include", "structopt", "third_party")) + + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) diff --git a/recipes/structopt/all/patches/0.1.0-0001-use-recipes.patch b/recipes/structopt/all/patches/0.1.0-0001-use-recipes.patch new file mode 100644 index 0000000000000..fcdaff4d2c7a3 --- /dev/null +++ b/recipes/structopt/all/patches/0.1.0-0001-use-recipes.patch @@ -0,0 +1,41 @@ +diff --git a/include/structopt/app.hpp b/include/structopt/app.hpp +index b60cc29..c89aa5d 100644 +--- a/include/structopt/app.hpp ++++ b/include/structopt/app.hpp +@@ -6,7 +6,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +diff --git a/include/structopt/parser.hpp b/include/structopt/parser.hpp +index 5ef391c..a8f51e6 100644 +--- a/include/structopt/parser.hpp ++++ b/include/structopt/parser.hpp +@@ -13,8 +13,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + #include + #include + #include +diff --git a/include/structopt/visitor.hpp b/include/structopt/visitor.hpp +index f36c155..dbaa619 100644 +--- a/include/structopt/visitor.hpp ++++ b/include/structopt/visitor.hpp +@@ -7,7 +7,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + diff --git a/recipes/structopt/all/test_package/CMakeLists.txt b/recipes/structopt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..edf44ae8164be --- /dev/null +++ b/recipes/structopt/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(structopt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} structopt::structopt) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/structopt/all/test_package/conanfile.py b/recipes/structopt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/structopt/all/test_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/structopt/all/test_package/test_package.cpp b/recipes/structopt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..03ca3cbbb7a79 --- /dev/null +++ b/recipes/structopt/all/test_package/test_package.cpp @@ -0,0 +1,73 @@ +#include + +// Copied from structopt/samples/demo + +struct Options { + // positional argument + // e.g., ./main + std::string config_file; + + // optional argument + // e.g., -b "192.168.5.3" + // e.g., --bind_address "192.168.5.3" + // The long option can be passed in kebab case + // e.g., --bind-address "192.168.5.3" + std::optional bind_address; + + // Use `std::optional` and provide a default value. + // Now you have a flag! + // e.g., -v + // e.g., --verbose + // Passing this flag will set this + // value to (!default_value), i.e., true + std::optional verbose = false; + + // structopt also support defining enum classes + // The argument (string) will be converted (if possible) + // into the equivalent enum value + // e.g., --log-level debug + // e.g., -l error + enum class LogLevel { debug, info, warn, error, critical }; + std::optional log_level = LogLevel::info; + + // Here, structopt will check for `-u` or `--user` + // and parse the next 2 arguments into an `std::pair` + std::optional> user; + + // You can use containers like std::vector + // to save variadic arguments of some type + std::vector files; +}; +STRUCTOPT(Options, config_file, bind_address, verbose, log_level, user, files); + +int main(int argc, char *argv[]) { + + try { + const auto args = std::vector{"./main", "config_2.csv", "--bind-address", "192.168.7.3", + "-log-level", "debug", "file1.txt", "file2.txt", "file3.txt", + "file4.txt", "--user", "John Doe", "john.doe@foo.com"}; + auto options = structopt::app("my_app").parse(args); + + // Print out parsed arguments: + + std::cout << "config_file = " << options.config_file << "\n"; + std::cout << "bind_address = " << options.bind_address.value_or("not provided") + << "\n"; + std::cout << "verbose = " << std::boolalpha << options.verbose.value() << "\n"; + std::cout << "log_level = " << static_cast(options.log_level.value()) << "\n"; + if (options.user.has_value()) + std::cout << "user = " << options.user.value().first << "<" + << options.user.value().second << ">\n"; + else + std::cout << "user = " + << "not provided\n"; + std::cout << "files = { "; + std::copy(options.files.begin(), options.files.end(), + std::ostream_iterator(std::cout, " ")); + std::cout << "}" << std::endl; + + } catch (structopt::exception &e) { + std::cout << e.what() << "\n"; + std::cout << e.help(); + } +} diff --git a/recipes/structopt/config.yml b/recipes/structopt/config.yml new file mode 100644 index 0000000000000..6bed80928103c --- /dev/null +++ b/recipes/structopt/config.yml @@ -0,0 +1,9 @@ +versions: + "0.1.3": + folder: "all" + "0.1.2": + folder: "all" + "0.1.1": + folder: "all" + "0.1.0": + folder: "all" diff --git a/recipes/stx/all/CMakeLists.txt b/recipes/stx/all/CMakeLists.txt new file mode 100644 index 0000000000000..8bdaa1e47bfa0 --- /dev/null +++ b/recipes/stx/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/stx/all/conandata.yml b/recipes/stx/all/conandata.yml new file mode 100644 index 0000000000000..8029486130779 --- /dev/null +++ b/recipes/stx/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.1": + url: https://github.com/lamarrr/STX/archive/v1.0.1.tar.gz + sha256: c491c888c56b9f800eb7c17a30c81afcf2d9fec4cdae9a73cd1145698a645dd9 +patches: + "1.0.1": + - patch_file: patches/0001-abseil_find_package.patch + base_path: source_subfolder + - patch_file: patches/0002-cmake_module_path.patch + base_path: source_subfolder diff --git a/recipes/stx/all/conanfile.py b/recipes/stx/all/conanfile.py new file mode 100644 index 0000000000000..b81962b835189 --- /dev/null +++ b/recipes/stx/all/conanfile.py @@ -0,0 +1,164 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class STXConan(ConanFile): + name = 'stx' + homepage = 'https://github.com/lamarrr/STX' + license = 'MIT' + url = 'https://github.com/conan-io/conan-center-index' + description = 'C++17 & C++ 20 error-handling and utility extensions.' + topics = 'error-handling', 'result', 'option', 'backtrace', 'panic' + + settings = 'os', 'compiler', 'build_type', 'arch' + options = { + 'shared': [True, False], + 'fPIC': [True, False], + 'backtrace': [True, False], + 'panic_handler': [None, 'default', 'backtrace'], + 'visible_panic_hook': [True, False], + } + default_options = { + 'shared': False, + 'fPIC': True, + 'backtrace': False, + 'panic_handler': 'default', + 'visible_panic_hook': False, + } + + exports_sources = ['CMakeLists.txt', 'patches/*'] + generators = 'cmake', 'cmake_find_package' + + @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): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.backtrace: + self.requires('abseil/20200923.1') + + def validate(self): + if (self.options.panic_handler == 'backtrace' and + not self.options.backtrace): + raise ConanInvalidConfiguration( + 'panic_handler=backtrace requires backtrace=True' + ) + + compiler = self.settings.compiler + compiler_version = tools.Version(self.settings.compiler.version) + + if compiler.get_safe('cppstd'): + tools.check_min_cppstd(self, 17) + + if compiler == 'Visual Studio' and compiler_version < 16: + raise ConanInvalidConfiguration( + 'STX requires C++17 language and standard library features ' + 'which VS < 2019 lacks' + ) + + if compiler == 'gcc' and compiler_version < 8: + raise ConanInvalidConfiguration( + 'STX requires C++17 language and standard library features ' + 'which GCC < 8 lacks' + ) + + if (compiler == 'clang' and compiler.libcxx and + compiler.libcxx in ['libstdc++', 'libstdc++11'] and + compiler_version < 9): + raise ConanInvalidConfiguration( + 'STX requires C++17 language and standard library features ' + 'which clang < 9 with libc++ lacks' + ) + + if (compiler == 'clang' and compiler.libcxx and + compiler.libcxx == 'libc++' and + compiler_version < 10): + raise ConanInvalidConfiguration( + 'STX requires C++17 language and standard library features ' + 'which clang < 10 with libc++ lacks' + ) + + if compiler == 'apple-clang' and compiler_version < 12: + raise ConanInvalidConfiguration( + 'STX requires C++17 language and standard library features ' + 'which apple-clang < 12 with libc++ lacks' + ) + + if (compiler == 'Visual Studio' and self.options.shared and + tools.Version(self.version) <= '1.0.1'): + raise ConanInvalidConfiguration( + 'shared library build does not work on windows with ' + 'STX version <= 1.0.1' + ) + + def source(self): + tools.get(**self.conan_data['sources'][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get('patches', {}).get(self.version, []): + tools.patch(**patch) + + cmake = CMake(self) + cmake.definitions['STX_BUILD_SHARED'] = self.options.shared + cmake.definitions['STX_ENABLE_BACKTRACE'] = self.options.backtrace + cmake.definitions['STX_ENABLE_PANIC_BACKTRACE'] = \ + self.options.panic_handler == 'backtrace' + cmake.definitions['STX_OVERRIDE_PANIC_HANDLER'] = \ + self.options.panic_handler == None + cmake.definitions['STX_VISIBLE_PANIC_HOOK'] = \ + self.options.visible_panic_hook + + cmake.configure(build_folder=self._build_subfolder) + cmake.build() + + def package(self): + self.copy( + '*.h', + dst='include', + src=os.path.join(self._source_subfolder, 'include') + ) + + self.copy('*.lib', dst='lib', keep_path=False) + self.copy('*.dll', dst='bin', keep_path=False) + self.copy('*.so', dst='lib', keep_path=False) + self.copy('*.dylib', dst='lib', keep_path=False) + self.copy('*.a', dst='lib', keep_path=False) + + self.copy('LICENSE', dst='licenses', src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + + if self.options.backtrace: + self.cpp_info.requires = [ + 'abseil::absl_stacktrace', + 'abseil::absl_symbolize' + ] + + if self.options.visible_panic_hook: + self.cpp_info.defines.append('STX_VISIBLE_PANIC_HOOK') + + if self.options.panic_handler == None: + self.cpp_info.defines.append('STX_OVERRIDE_PANIC_HANDLER') + + if self.options.panic_handler == 'backtrace': + self.cpp_info.defines.append('STX_ENABLE_PANIC_BACKTRACE') + + if self.settings.os == 'Android': + self.cpp_info.system_libs = ['atomic'] diff --git a/recipes/stx/all/patches/0001-abseil_find_package.patch b/recipes/stx/all/patches/0001-abseil_find_package.patch new file mode 100644 index 0000000000000..11c8ae870c7f2 --- /dev/null +++ b/recipes/stx/all/patches/0001-abseil_find_package.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4ed99e..5e155ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -204,12 +204,7 @@ endif() + # =============================================== + + if(STX_ENABLE_BACKTRACE) +- if(NOT EXISTS third_party/abseil) +- execute_process( +- COMMAND git submodule update --init --recursive third_party/abseil +- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) +- endif() +- add_subdirectory(third_party/abseil) ++ find_package(absl REQUIRED) + endif() + + # the atomics library doesn't automatically link on my Android phone diff --git a/recipes/stx/all/patches/0002-cmake_module_path.patch b/recipes/stx/all/patches/0002-cmake_module_path.patch new file mode 100644 index 0000000000000..909cc4eabba22 --- /dev/null +++ b/recipes/stx/all/patches/0002-cmake_module_path.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5e155ec..d73691d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,7 +30,7 @@ project( + HOMEPAGE_URL "https://github.com/lamarrr/STX" + LANGUAGES CXX) + +-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) ++list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) + + include(CMakeDependentOption) + include(HandleFlags) diff --git a/recipes/stx/all/test_package/CMakeLists.txt b/recipes/stx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..985bbfd508f2e --- /dev/null +++ b/recipes/stx/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.8) +project(PackageTest LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(stx CONFIG REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example PRIVATE stx::stx) diff --git a/recipes/stx/all/test_package/conanfile.py b/recipes/stx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..46663ae7805d2 --- /dev/null +++ b/recipes/stx/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class STXTestConan(ConanFile): + settings = 'os', 'compiler', 'build_type', 'arch' + generators = 'cmake', 'cmake_find_package_multi' + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join('bin', 'example'), run_environment=True) diff --git a/recipes/stx/all/test_package/example.cpp b/recipes/stx/all/test_package/example.cpp new file mode 100644 index 0000000000000..41a4697c93135 --- /dev/null +++ b/recipes/stx/all/test_package/example.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include + +namespace fs { + using stx::Ok, stx::Err; + + enum class Error { + InvalidPath + }; + + template + using Result = stx::Result; + + // this is just a mock + struct File { + explicit File(std::string_view) noexcept {} + }; + + auto open(std::string_view path) noexcept -> Result { + if (path.empty()) + return Err(Error::InvalidPath); + + File file{path}; + + return Ok(std::move(file)); + } +} // namespace fs + +#ifdef STX_OVERRIDE_PANIC_HANDLER +void stx::panic_handler(std::string_view const& info, + stx::ReportPayload const& payload, + stx::SourceLocation const& source_location) noexcept {} +#endif +int main() { + auto err = fs::open("").expect_err("should not be able to open file with empty filename"); + auto file = fs::open("example").expect("should be able to open file with name"); +} diff --git a/recipes/stx/config.yml b/recipes/stx/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/stx/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/subunit/all/conandata.yml b/recipes/subunit/all/conandata.yml new file mode 100644 index 0000000000000..afbc1844ad677 --- /dev/null +++ b/recipes/subunit/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.4.0": + url: "https://launchpad.net/subunit/trunk/1.4.0/+download/subunit-1.4.0.tar.gz" + sha256: "00792096e96cbf1d5f9394dadd0ea73309a4f8b2214822949f1888ce5c2cf1c0" +patches: + "1.4.0": + - patch_file: "patches/0001-fix-ExtUtils-MakeMaker-error.patch" + base_path: "source_subfolder" diff --git a/recipes/subunit/all/conanfile.py b/recipes/subunit/all/conanfile.py new file mode 100644 index 0000000000000..e662ea1d9f3b1 --- /dev/null +++ b/recipes/subunit/all/conanfile.py @@ -0,0 +1,148 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import contextlib +import glob +import os + +required_conan_version = ">=1.33.0" + + +class SubunitConan(ConanFile): + name = "subunit" + description = "A streaming protocol for test results" + topics = "subunit", "streaming", "protocol", "test", "results" + license = "Apache-2.0", "BSD-3-Clause" + homepage = "https://launchpad.net/subunit" + 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, + } + + 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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("cppunit/1.15.1") + + 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.3") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Cannot build shared subunit libraries on Windows") + if self.settings.compiler == "apple-clang" and tools.Version(self.settings.compiler.version) < "10": + # Complete error is: + # make[2]: *** No rule to make target `/Applications/Xcode-9.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/config.h', needed by `Makefile'. Stop. + raise ConanInvalidConfiguration("Due to weird make error involving missing config.h file in sysroot") + + def source(self): + tools.get(**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 = { + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "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)), + "NM": "dumpbin -symbols", + "OBJDUMP": ":", + "RANLIB": ":", + "STRIP": ":", + } + with tools.environment_append(env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + if self.settings.compiler == "Visual Studio": + self._autotools.flags.append("-FS") + self._autotools.cxx_flags.append("-EHsc") + 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)), + "CHECK_CFLAGS=' '", + "CHECK_LIBS=' '", + "CPPUNIT_CFLAGS='{}'".format(" ".join("-I{}".format(inc) for inc in self.deps_cpp_info["cppunit"].include_paths).replace("\\", "/")), + "CPPUNIT_LIBS='{}'".format(" ".join(self.deps_cpp_info["cppunit"].libs)), + ] + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + return self._autotools + + 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() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + # Avoid installing i18n + perl things in arch-dependent folders or in a `local` subfolder + install_args = [ + "INSTALLARCHLIB={}".format(os.path.join(self.package_folder, "lib").replace("\\", "/")), + "INSTALLSITEARCH={}".format(os.path.join(self.build_folder, "archlib").replace("\\", "/")), + "INSTALLVENDORARCH={}".format(os.path.join(self.build_folder, "archlib").replace("\\", "/")), + "INSTALLSITEBIN={}".format(os.path.join(self.package_folder, "bin").replace("\\", "/")), + "INSTALLSITESCRIPT={}".format(os.path.join(self.package_folder, "bin").replace("\\", "/")), + "INSTALLSITEMAN1DIR={}".format(os.path.join(self.build_folder, "share", "man", "man1").replace("\\", "/")), + "INSTALLSITEMAN3DIR={}".format(os.path.join(self.build_folder, "share", "man", "man3").replace("\\", "/")), + ] + autotools.install(args=install_args) + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pod") + for d in glob.glob(os.path.join(self.package_folder, "lib", "python*")): + tools.rmdir(d) + for d in glob.glob(os.path.join(self.package_folder, "lib", "*")): + if os.path.isdir(d): + tools.rmdir(d) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "Library")) + + def package_info(self): + self.cpp_info.components["libsubunit"].libs = ["subunit"] + self.cpp_info.components["libsubunit"].names["pkgconfig"] = "libsubunit" + self.cpp_info.components["libcppunit_subunit"].libs = ["cppunit_subunit"] + self.cpp_info.components["libcppunit_subunit"].requires = ["cppunit::cppunit"] + self.cpp_info.components["libcppunit_subunit"].names["pkgconfig"] = "libcppunit_subunit" + + 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/subunit/all/patches/0001-fix-ExtUtils-MakeMaker-error.patch b/recipes/subunit/all/patches/0001-fix-ExtUtils-MakeMaker-error.patch new file mode 100644 index 0000000000000..52111e7d223fb --- /dev/null +++ b/recipes/subunit/all/patches/0001-fix-ExtUtils-MakeMaker-error.patch @@ -0,0 +1,13 @@ +Fixes this erro: +Only one of PREFIX or INSTALL_BASE can be given. Not both. +--- Makefile.in ++++ Makefile.in +@@ -1623,7 +1623,7 @@ + + perl/Makefile: perl/Makefile.PL + mkdir -p perl +- cd perl && perl Makefile.PL INSTALLDIRS=${INSTALLDIRS} ++ cd perl && perl Makefile.PL INSTALLDIRS=${INSTALLDIRS} PREFIX=$(prefix) INSTALL_BASE= + -rm perl/Makefile.old > /dev/null + + # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/recipes/subunit/all/test_package/CMakeLists.txt b/recipes/subunit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ec668b89c232d --- /dev/null +++ b/recipes/subunit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C CXX) + +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/subunit/all/test_package/conanfile.py b/recipes/subunit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/subunit/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/subunit/all/test_package/test_package.c b/recipes/subunit/all/test_package/test_package.c new file mode 100644 index 0000000000000..64d891f28fb8c --- /dev/null +++ b/recipes/subunit/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include "subunit/child.h" + +int main() { + subunit_test_start("subunit_test_package"); + subunit_progress(SUBUNIT_PROGRESS_SET, 0); + subunit_progress(SUBUNIT_PROGRESS_SET, 25); + subunit_progress(SUBUNIT_PROGRESS_SET, 50); + subunit_progress(SUBUNIT_PROGRESS_SET, 75); + subunit_progress(SUBUNIT_PROGRESS_SET, 99); + subunit_test_pass("subunit_test_package"); + return 0; +} diff --git a/recipes/subunit/config.yml b/recipes/subunit/config.yml new file mode 100644 index 0000000000000..eed35319fcea1 --- /dev/null +++ b/recipes/subunit/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: "all" diff --git a/recipes/sundials/all/conandata.yml b/recipes/sundials/all/conandata.yml new file mode 100644 index 0000000000000..d7e3f7fdd5714 --- /dev/null +++ b/recipes/sundials/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "5.4.0": + url: "https://github.com/LLNL/sundials/releases/download/v5.4.0/sundials-5.4.0.tar.gz" + sha256: "a60ba8155ca12261cf7623efcf9fd4232e95bcfefe480993ef71324176cb395b" + "5.3.0": + url: "https://github.com/LLNL/sundials/releases/download/v5.3.0/sundials-5.3.0.tar.gz" + sha256: "88dff7e11a366853d8afd5de05bf197a8129a804d9d4461fb64297f1ef89bca7" + "5.2.0": + url: "https://github.com/LLNL/sundials/releases/download/v5.2.0/sundials-5.2.0.tar.gz" + sha256: "95f058acce5bd66e654de65acdbb1c9f44c90cf1b4e28f8d933cdb4415ebba3e" diff --git a/recipes/sundials/all/conanfile.py b/recipes/sundials/all/conanfile.py new file mode 100644 index 0000000000000..c431e2317a534 --- /dev/null +++ b/recipes/sundials/all/conanfile.py @@ -0,0 +1,142 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, mkdir +import glob +import os +import shutil + +required_conan_version = ">=1.53.0" + + +class SundialsConan(ConanFile): + name = "sundials" + license = "BSD-3-Clause" + description = ("SUNDIALS is a family of software packages implemented" + " with the goal of providing robust time integrators " + "and nonlinear solvers that can easily be incorporated" + "into existing simulation codes.") + topics = ("integrators", "ode", "non-linear solvers") + homepage = "https://github.com/LLNL/sundials" + 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], + "build_arkode": [True, False], + "build_cvode": [True, False], + "build_cvodes": [True, False], + "build_ida": [True, False], + "build_idas": [True, False], + "build_kinsol": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_arkode": True, + "build_cvode": True, + "build_cvodes": True, + "build_ida": True, + "build_idas": True, + "build_kinsol": True, + } + + short_paths = True + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_ARKODE"] = self.options.build_arkode + tc.variables["BUILD_CVODE"] = self.options.build_cvode + tc.variables["BUILD_CVODES"] = self.options.build_cvodes + tc.variables["BUILD_IDA"] = self.options.build_ida + tc.variables["BUILD_IDAS"] = self.options.build_idas + tc.variables["BUILD_KINSOL"] = self.options.build_kinsol + tc.variables["EXAMPLES_ENABLE_C"] = False + tc.variables["EXAMPLES_INSTALL"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if self.settings.os == "Windows" and self.options.shared: + mkdir(self, os.path.join(self.package_folder, "bin")) + for dll_path in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): + shutil.move(dll_path, os.path.join(self.package_folder, "bin", os.path.basename(dll_path))) + + def package_info(self): + self.cpp_info.components["sundials_nvecmanyvector"].libs = ["sundials_nvecmanyvector"] + self.cpp_info.components["sundials_nvecserial"].libs = ["sundials_nvecserial"] + self.cpp_info.components["sundials_sunlinsolband"].libs = ["sundials_sunlinsolband"] + self.cpp_info.components["sundials_sunlinsolband"].requires = ["sundials_sunmatrixband"] + self.cpp_info.components["sundials_sunlinsoldense"].libs = ["sundials_sunlinsoldense"] + self.cpp_info.components["sundials_sunlinsoldense"].requires = ["sundials_sunmatrixdense"] + self.cpp_info.components["sundials_sunlinsolpcg"].libs = ["sundials_sunlinsolpcg"] + self.cpp_info.components["sundials_sunlinsolspbcgs"].libs = ["sundials_sunlinsolspbcgs"] + self.cpp_info.components["sundials_sunlinsolspfgmr"].libs = ["sundials_sunlinsolspfgmr"] + self.cpp_info.components["sundials_sunlinsolspgmr"].libs = ["sundials_sunlinsolspgmr"] + self.cpp_info.components["sundials_sunlinsolsptfqmr"].libs = ["sundials_sunlinsolsptfqmr"] + self.cpp_info.components["sundials_sunmatrixband"].libs = ["sundials_sunmatrixband"] + self.cpp_info.components["sundials_sunmatrixdense"].libs = ["sundials_sunmatrixdense"] + self.cpp_info.components["sundials_sunmatrixsparse"].libs = ["sundials_sunmatrixsparse"] + self.cpp_info.components["sundials_sunnonlinsolfixedpoint"].libs = ["sundials_sunnonlinsolfixedpoint"] + self.cpp_info.components["sundials_sunnonlinsolnewton"].libs = ["sundials_sunnonlinsolnewton"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_nvecmanyvector"].system_libs = ["m"] + self.cpp_info.components["sundials_nvecserial"].system_libs = ["m"] + self.cpp_info.components["sundials_sunlinsolpcg"].system_libs = ["m"] + self.cpp_info.components["sundials_sunlinsolspbcgs"].system_libs = ["m"] + self.cpp_info.components["sundials_sunlinsolspfgmr"].system_libs = ["m"] + self.cpp_info.components["sundials_sunlinsolspgmr"].system_libs = ["m"] + self.cpp_info.components["sundials_sunlinsolsptfqmr"].system_libs = ["m"] + self.cpp_info.components["sundials_sunmatrixband"].system_libs = ["m"] + self.cpp_info.components["sundials_sunmatrixdense"].system_libs = ["m"] + self.cpp_info.components["sundials_sunmatrixsparse"].system_libs = ["m"] + self.cpp_info.components["sundials_sunnonlinsolfixedpoint"].system_libs = ["m"] + self.cpp_info.components["sundials_sunnonlinsolnewton"].system_libs = ["m"] + if self.options.build_arkode: + self.cpp_info.components["sundials_arkode"].libs = ["sundials_arkode"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_arkode"].system_libs = ["m"] + if self.options.build_cvode: + self.cpp_info.components["sundials_cvode"].libs = ["sundials_cvode"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_cvode"].system_libs = ["m"] + if self.options.build_cvodes: + self.cpp_info.components["sundials_cvodes"].libs = ["sundials_cvodes"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_cvodes"].system_libs = ["m"] + if self.options.build_ida: + self.cpp_info.components["sundials_ida"].libs = ["sundials_ida"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_ida"].system_libs = ["m"] + if self.options.build_idas: + self.cpp_info.components["sundials_idas"].libs = ["sundials_idas"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_idas"].system_libs = ["m"] + if self.options.build_kinsol: + self.cpp_info.components["sundials_kinsol"].libs = ["sundials_kinsol"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sundials_kinsol"].system_libs = ["m"] diff --git a/recipes/sundials/all/test_package/CMakeLists.txt b/recipes/sundials/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf2fd2bc5a19e --- /dev/null +++ b/recipes/sundials/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(sundials REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE sundials::sundials) diff --git a/recipes/sundials/all/test_package/conanfile.py b/recipes/sundials/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/sundials/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sundials/all/test_package/test_package.c b/recipes/sundials/all/test_package/test_package.c new file mode 100644 index 0000000000000..c0379d1c10628 --- /dev/null +++ b/recipes/sundials/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include + +int main() +{ + N_Vector y = N_VNew_Serial(1); + NV_DATA_S(y)[0] = 2.0; + SUNMatrix A = SUNDenseMatrix(1, 1); + SUNLinearSolver LS = SUNLinSol_Dense(y, A); + + N_Vector v = N_VNew_Serial(1);; + N_VScale(2.0, y, v); + return 0; +} diff --git a/recipes/sundials/all/test_v1_package/CMakeLists.txt b/recipes/sundials/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/sundials/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sundials/all/test_v1_package/conanfile.py b/recipes/sundials/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sundials/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/sundials/config.yml b/recipes/sundials/config.yml new file mode 100644 index 0000000000000..a42ad917d8584 --- /dev/null +++ b/recipes/sundials/config.yml @@ -0,0 +1,7 @@ +versions: + "5.4.0": + folder: all + "5.3.0": + folder: all + "5.2.0": + folder: all diff --git a/recipes/svector/all/conandata.yml b/recipes/svector/all/conandata.yml new file mode 100644 index 0000000000000..876425a447ec4 --- /dev/null +++ b/recipes/svector/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/martinus/svector/archive/refs/tags/v1.0.2.tar.gz" + sha256: "317743113aff89c7c11682ad7ed504a043885be7497f791cb393ba5a7a8d3c41" diff --git a/recipes/svector/all/conanfile.py b/recipes/svector/all/conanfile.py new file mode 100644 index 0000000000000..68edc50346896 --- /dev/null +++ b/recipes/svector/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.52.0" + +class PackageConan(ConanFile): + name = "svector" + description = "Compact SVO optimized vector for C++17 or higher" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinus/svector" + topics = ("vector", "container", "small-vector", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + # FIXME: self.info.settings.compiler does not work with header-only packages + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, 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 + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/svector/all/test_package/CMakeLists.txt b/recipes/svector/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..38ea734d2c8a7 --- /dev/null +++ b/recipes/svector/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(svector REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svector::svector) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svector/all/test_package/conanfile.py b/recipes/svector/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/svector/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/svector/all/test_package/test_package.cpp b/recipes/svector/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e0125d432c37 --- /dev/null +++ b/recipes/svector/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "ankerl/svector.h" + +int main(void) { + auto vec = ankerl::svector(); + for (int i = 0; i < 100; ++i) { + vec.push_back(i); + } + auto data = vec.data(); + + return 0; +} diff --git a/recipes/svector/all/test_v1_package/CMakeLists.txt b/recipes/svector/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ce3d62f2939 --- /dev/null +++ b/recipes/svector/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(svector REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svector::svector) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svector/all/test_v1_package/conanfile.py b/recipes/svector/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/svector/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/svector/config.yml b/recipes/svector/config.yml new file mode 100644 index 0000000000000..8457ca9a4a8cd --- /dev/null +++ b/recipes/svector/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all diff --git a/recipes/svgwrite/all/CMakeLists.txt b/recipes/svgwrite/all/CMakeLists.txt new file mode 100644 index 0000000000000..a7a84f24be646 --- /dev/null +++ b/recipes/svgwrite/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if (WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif(WIN32 AND BUILD_SHARED_LIBS) + +add_subdirectory("source_subfolder") diff --git a/recipes/svgwrite/all/conandata.yml b/recipes/svgwrite/all/conandata.yml new file mode 100644 index 0000000000000..2732ab9e3e8f7 --- /dev/null +++ b/recipes/svgwrite/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.1.0": + url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.1.0/svgwrite-v0.1.0.tar.gz" + sha256: "beca35ebd5f95fd8a09f6c5b612990c633fd1101e4dd4f72769d819e91ef27bb" + "0.2.0": + url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.2.0/svgwrite-v0.2.0.tar.gz" + sha256: "aec13438ac991b13c840488a8f7e878255bdbdf24e757aa3f75de4482eae8812" +patches: + "0.1.0": + - patch_file: "patches/0001-remove-gcc-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-span-lite-ns.patch" + base_path: "source_subfolder" diff --git a/recipes/svgwrite/all/conanfile.py b/recipes/svgwrite/all/conanfile.py new file mode 100644 index 0000000000000..bef96e5e83402 --- /dev/null +++ b/recipes/svgwrite/all/conanfile.py @@ -0,0 +1,79 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class SvgwriteConan(ConanFile): + name = "svgwrite" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/dvd0101/svgwrite" + description = "SVGWrite - a streaming svg library" + topics = ("svg", "stream", "vector", "image") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + exports_sources = ("CMakeLists.txt", "patches/*") + requires = "span-lite/0.7.0", "fmt/6.1.2" + generators = "cmake", "cmake_find_package" + _cmake = None + + @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): + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "17") + + minimal_version = { + "Visual Studio": "16", + "gcc": "7.3", + "clang": "6", + "apple-clang": "10.0" + } + + if compiler not in minimal_version: + self.output.warn("{} recipe lacks information about the {} compiler" + " standard version support".format(self.name, compiler)) + elif compiler_version < minimal_version.get(compiler): + raise ConanInvalidConfiguration("%s requires a compiler that supports" + " at least C++17. %s %s is not" + " supported." % (self.name, compiler, compiler_version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_folder = self.name + "-v" + self.version + os.rename(extracted_folder, self._source_subfolder) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["svgwrite"] diff --git a/recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch b/recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch new file mode 100644 index 0000000000000..9a2bf141a5220 --- /dev/null +++ b/recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch @@ -0,0 +1,12 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d173312..20f62bd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -14,7 +14,6 @@ set_target_properties(svgwrite + ) + + target_compile_features(svgwrite PUBLIC cxx_std_17) +-target_compile_options(svgwrite PRIVATE -Wall -Wextra -Wpedantic) + target_include_directories(svgwrite + PUBLIC + $ diff --git a/recipes/svgwrite/all/patches/0002-span-lite-ns.patch b/recipes/svgwrite/all/patches/0002-span-lite-ns.patch new file mode 100644 index 0000000000000..6324faae7ceaa --- /dev/null +++ b/recipes/svgwrite/all/patches/0002-span-lite-ns.patch @@ -0,0 +1,12 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3fd49db86f8b1f973c58d313144343e9b7c62205..ee71a87f75028dfb86630512de72f652c40cbb3d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,6 +21,6 @@ target_include_directories(svgwrite + PRIVATE . + ) + target_link_libraries(svgwrite +- PUBLIC span-lite::span-lite ++ PUBLIC nonstd::span-lite + PRIVATE fmt::fmt + ) diff --git a/recipes/svgwrite/all/test_package/CMakeLists.txt b/recipes/svgwrite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5f358b17c3b77 --- /dev/null +++ b/recipes/svgwrite/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_property(TARGET example PROPERTY CXX_STANDARD 17) diff --git a/recipes/svgwrite/all/test_package/conanfile.py b/recipes/svgwrite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4ead2ad43af38 --- /dev/null +++ b/recipes/svgwrite/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class SvgwriteTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/svgwrite/all/test_package/example.cpp b/recipes/svgwrite/all/test_package/example.cpp new file mode 100644 index 0000000000000..dae4009b20d78 --- /dev/null +++ b/recipes/svgwrite/all/test_package/example.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main() { + std::ostringstream os; + svgw::writer w(os); + w.start_svg("12cm", "4cm", {{"viewBox", "0 0 1200 400"}}); + w.rect(1, 1, 1198, 398, {{"fill", "none"}, {"stroke", "blue"}, {"stroke-width", "2"}}); + w.start_g({{"stroke", "green"}}); + w.line(100, 300, 300, 100, {{"stroke-width", 5}}); + w.line(300, 300, 500, 100, {{"stroke-width", 10}}); + w.line(500, 300, 700, 100, {{"stroke-width", 15}}); + w.line(700, 300, 900, 100, {{"stroke-width", 20}}); + w.line(900, 300, 1100, 100, {{"stroke-width", 25.2}}); + w.end_g(); + w.end_svg(); +} diff --git a/recipes/svgwrite/config.yml b/recipes/svgwrite/config.yml new file mode 100644 index 0000000000000..f97c9e447ad07 --- /dev/null +++ b/recipes/svgwrite/config.yml @@ -0,0 +1,5 @@ +versions: + "0.1.0": + folder: all + "0.2.0": + folder: all diff --git a/recipes/swig/all/cmake/conan-official-swig-targets.cmake b/recipes/swig/all/cmake/conan-official-swig-targets.cmake new file mode 100644 index 0000000000000..8740b23580975 --- /dev/null +++ b/recipes/swig/all/cmake/conan-official-swig-targets.cmake @@ -0,0 +1,7 @@ +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/conandata.yml b/recipes/swig/all/conandata.yml new file mode 100644 index 0000000000000..7c4f531b134a3 --- /dev/null +++ b/recipes/swig/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "4.1.0": + url: "https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz" + sha256: "5b9313b1af5edfcea158a389520be266f013bc9be4ce933d79a30c5659ba99fe" + "4.0.2": + url: "https://github.com/swig/swig/archive/rel-4.0.2.tar.gz" + sha256: "81d7ce78371f378a3299ddc5aea1da9a6178f325dcabb695d1b742f9e24a0fa6" + "4.0.1": + url: "https://github.com/swig/swig/archive/rel-4.0.1.tar.gz" + sha256: "2eaf6fb89d071d1be280bf995c63360b3729860c0da64948123b5d7e4cfb6cb7" +patches: + "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" + "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" + "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" diff --git a/recipes/swig/all/conanfile.py b/recipes/swig/all/conanfile.py new file mode 100644 index 0000000000000..432bfb37aeca5 --- /dev/null +++ b/recipes/swig/all/conanfile.py @@ -0,0 +1,170 @@ +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" + + +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." + 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" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _use_pcre2(self): + return self.version not in ['4.0.1', '4.0.2'] + + + def requirements(self): + if self._use_pcre2: + self.requires("pcre2/10.40") + 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") + + 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 + 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 + + 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") + + autotools.libs = [] + autotools.library_paths = [] + + if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio": + autotools.libs.extend(["mingwex", "ssp"]) + + autotools.configure(args=args, configure_dir=self._source_subfolder, + host=host, build=build) + return autotools + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + 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() + 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() + autotools.install() + + @property + def _swiglibdir(self): + return os.path.join(self.package_folder, "bin", "swiglib").replace("\\", "/") + + @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 package_info(self): + self.cpp_info.includedirs=[] + 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)] + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/swig/all/patches/0001-4.1.0-swig-linux-library-path.patch b/recipes/swig/all/patches/0001-4.1.0-swig-linux-library-path.patch new file mode 100644 index 0000000000000..bc66e9d537d4a --- /dev/null +++ b/recipes/swig/all/patches/0001-4.1.0-swig-linux-library-path.patch @@ -0,0 +1,51 @@ +--- Source/Modules/main.cxx ++++ Source/Modules/main.cxx +@@ -886,6 +886,32 @@ static void getoptions(int argc, char *argv[]) { + + static void SWIG_exit_handler(int status); + ++#if defined(HAVE_UNISTD_H) && !defined(_WIN32) ++#include ++#include ++#include ++ ++static String *get_exe_path(void) { ++ Dl_info info; ++ if (dladdr("main", &info)) { ++ char realp_buffer[PATH_MAX]; ++ char* res = NULL; ++ ++ res = realpath(info.dli_fname, realp_buffer); ++ if (!res) { ++ return NewString(SWIG_LIB); ++ } ++ ++ const char* dir = dirname(realp_buffer); ++ char dest_buf[PATH_MAX]; ++ strcpy(dest_buf, dir); ++ strcat(dest_buf, "/swiglib"); ++ return NewStringWithSize(dest_buf, strlen(dest_buf)); ++ } ++ return NewString(SWIG_LIB); ++} ++#endif ++ + int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { + char *c; + +@@ -935,12 +961,14 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { + char *p; + if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { + *(p + 1) = '\0'; +- SwigLib = NewStringf("%sLib", buf); // Native windows installation path ++ SwigLib = NewStringf("%sswiglib", buf); // Native windows installation path + } else { + SwigLib = NewStringf(""); // Unexpected error + } + if (Len(SWIG_LIB_WIN_UNIX) > 0) + SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) ++#elif defined(HAVE_UNISTD_H) && !defined(_WIN32) ++ SwigLib = get_exe_path(); + #else + SwigLib = NewString(SWIG_LIB); + #endif diff --git a/recipes/swig/all/patches/0001-swig-linux-library-path.patch b/recipes/swig/all/patches/0001-swig-linux-library-path.patch new file mode 100644 index 0000000000000..697f3332bb11b --- /dev/null +++ b/recipes/swig/all/patches/0001-swig-linux-library-path.patch @@ -0,0 +1,51 @@ +--- Source/Modules/main.cxx ++++ Source/Modules/main.cxx +@@ -879,6 +879,32 @@ static void getoptions(int argc, char *a + } + } + ++#if defined(HAVE_UNISTD_H) && !defined(_WIN32) ++#include ++#include ++#include ++ ++static String *get_exe_path(void) { ++ Dl_info info; ++ if (dladdr("main", &info)) { ++ char realp_buffer[PATH_MAX]; ++ char* res = NULL; ++ ++ res = realpath(info.dli_fname, realp_buffer); ++ if (!res) { ++ return NewString(SWIG_LIB); ++ } ++ ++ const char* dir = dirname(realp_buffer); ++ char dest_buf[PATH_MAX]; ++ strcpy(dest_buf, dir); ++ strcat(dest_buf, "/swiglib"); ++ return NewStringWithSize(dest_buf, strlen(dest_buf)); ++ } ++ return NewString(SWIG_LIB); ++} ++#endif ++ + int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { + char *c; + +@@ -939,12 +965,14 @@ int SWIG_main(int argc, char *argv[], co + char *p; + if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { + *(p + 1) = '\0'; +- SwigLib = NewStringf("%sLib", buf); // Native windows installation path ++ SwigLib = NewStringf("%sswiglib", buf); // Native windows installation path + } else { + SwigLib = NewStringf(""); // Unexpected error + } + if (Len(SWIG_LIB_WIN_UNIX) > 0) + SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) ++#elif defined(HAVE_UNISTD_H) && !defined(_WIN32) ++ SwigLib = get_exe_path(); + #else + SwigLib = NewString(SWIG_LIB); + #endif diff --git a/recipes/swig/all/patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch b/recipes/swig/all/patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch new file mode 100644 index 0000000000000..53d129b5c5349 --- /dev/null +++ b/recipes/swig/all/patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch @@ -0,0 +1,11 @@ +--- configure.ac ++++ configure.ac +@@ -2728,7 +2728,7 @@ + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; + esac +-AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) ++AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, [""], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) + + SWIG_LIB_PREINST=$ABS_SRCDIR/Lib + AC_SUBST(SWIG_LIB_PREINST) diff --git a/recipes/swig/all/patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch b/recipes/swig/all/patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch new file mode 100644 index 0000000000000..29aee19fe33d0 --- /dev/null +++ b/recipes/swig/all/patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch @@ -0,0 +1,11 @@ +--- configure.ac ++++ configure.ac +@@ -2770,7 +2770,7 @@ + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; + esac +-AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) ++AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, [""], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) + + SWIG_LIB_PREINST=$ABS_SRCDIR/Lib + AC_SUBST(SWIG_LIB_PREINST) diff --git a/recipes/swig/all/patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch b/recipes/swig/all/patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch new file mode 100644 index 0000000000000..5c3961363c8dc --- /dev/null +++ b/recipes/swig/all/patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch @@ -0,0 +1,11 @@ +--- configure.ac ++++ configure.ac +@@ -2825,7 +2825,7 @@ case $build in + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; + esac +-AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) ++AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, [""], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) + + SWIG_LIB_PREINST=$ABS_SRCDIR/Lib + AC_SUBST(SWIG_LIB_PREINST) diff --git a/recipes/swig/all/test_package/CMakeLists.txt b/recipes/swig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3f3a1aa9d1821 --- /dev/null +++ b/recipes/swig/all/test_package/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.1) +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) +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}") + + #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}) + + 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() diff --git a/recipes/swig/all/test_package/conanfile.py b/recipes/swig/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5059612e70e16 --- /dev/null +++ b/recipes/swig/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + @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") + + 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.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + if self._can_build: + cmake = CMake(self) + cmake.test(output_on_failure=True) + self.run("swig -version", run_environment=True) diff --git a/recipes/swig/all/test_package/test.i b/recipes/swig/all/test_package/test.i new file mode 100644 index 0000000000000..98d0531a88cae --- /dev/null +++ b/recipes/swig/all/test_package/test.i @@ -0,0 +1,6 @@ +%module PackageTest + +%inline %{ +extern int gcd(int u, int v); +extern double foo; +%} diff --git a/recipes/swig/all/test_package/test_package.c b/recipes/swig/all/test_package/test_package.c new file mode 100644 index 0000000000000..b02a4a855a18c --- /dev/null +++ b/recipes/swig/all/test_package/test_package.c @@ -0,0 +1,31 @@ +// Source: https://en.wikipedia.org/wiki/Binary_GCD_algorithm#Recursive_version_in_C +int gcd(int u, int v) { + // simple cases (termination) + if (u == v) + return u; + + if (u == 0) + return v; + + if (v == 0) + return u; + + // look for factors of 2 + if (~u & 1) { // u is even + if (v & 1) // v is odd + return gcd(u >> 1, v); + else // both u and v are even + return gcd(u >> 1, v >> 1) << 1; + } + + if (~v & 1) // u is odd, v is even + return gcd(u, v >> 1); + + // reduce larger argument + if (u > v) + return gcd((u - v) >> 1, v); + + return gcd((v - u) >> 1, u); +} + +double foo = 3.14159265359; diff --git a/recipes/swig/config.yml b/recipes/swig/config.yml new file mode 100644 index 0000000000000..543f01b80f536 --- /dev/null +++ b/recipes/swig/config.yml @@ -0,0 +1,7 @@ +versions: + "4.1.0": + folder: "all" + "4.0.2": + folder: "all" + "4.0.1": + folder: "all" diff --git a/recipes/symengine/all/conandata.yml b/recipes/symengine/all/conandata.yml new file mode 100644 index 0000000000000..d0b808ba0adde --- /dev/null +++ b/recipes/symengine/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.8.1": + url: "https://github.com/symengine/symengine/releases/download/v0.8.1/symengine-0.8.1.tar.gz" + sha256: "41eb6ae6901c09e53d7f61f0758f9201e81fc534bfeecd4b2bd4b4e6f6768693" + "0.9.0": + url: "https://github.com/symengine/symengine/releases/download/v0.9.0/symengine-0.9.0.tar.gz" + sha256: "dcf174ac708ed2acea46691f6e78b9eb946d8a2ba62f75e87cf3bf4f0d651724" + "0.10.1": + url: "https://github.com/symengine/symengine/releases/download/v0.10.1/symengine-0.10.1.tar.gz" + sha256: "9c007c99e9633f5549a55fa7a66ebcbcf9e04092eb55f7bb781c22b9cf0570c4" diff --git a/recipes/symengine/all/conanfile.py b/recipes/symengine/all/conanfile.py new file mode 100644 index 0000000000000..cfb736044d218 --- /dev/null +++ b/recipes/symengine/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.files import ( + apply_conandata_patches, + collect_libs, + copy, + get, + rm, + rmdir, +) +import os + +required_conan_version = ">=1.54.0" + + +class SymengineConan(ConanFile): + name = "symengine" + description = "A fast symbolic manipulation library, written in C++" + license = "MIT" + topics = ("symbolic", "algebra") + homepage = "https://symengine.org/" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = ["CMakeLists.txt", "patches/**"] + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "integer_class": ["boostmp", "gmp"], + } + default_options = { + "shared": False, + "fPIC": True, + "integer_class": "gmp", + } + short_paths = True + + def requirements(self): + if self.options.integer_class == "boostmp": + self.requires("boost/1.81.0") + else: + self.requires("gmp/6.2.1", transitive_headers=True, transitive_libs=True) + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + strip_root=True, + destination=self.source_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") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_BENCHMARKS"] = False + tc.variables["INTEGER_CLASS"] = self.options.integer_class + tc.variables["MSVC_USE_MT"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + cmake = CMake(self) + cmake.install() + # [CMAKE-MODULES-CONFIG-FILES (KB-H016)] + rm(self, "*.cmake", self.package_folder, recursive=True) + # [DEFAULT PACKAGE LAYOUT (KB-H013)] + rmdir(self, os.path.join(self.package_folder, "CMake")) + + def package_info(self): + self.cpp_info.libs = ["symengine"] + if any("teuchos" in v for v in collect_libs(self)): + self.cpp_info.libs.append("teuchos") + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") + self.cpp_info.names["cmake_find_package"] = "symengine" + # FIXME: symengine exports a non-namespaced `symengine` target. + self.cpp_info.names["cmake_find_package_multi"] = "symengine" diff --git a/recipes/symengine/all/test_package/CMakeLists.txt b/recipes/symengine/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b0ebad6adca2 --- /dev/null +++ b/recipes/symengine/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(symengine REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE symengine::symengine) # FIXME: Replace `symengine::symengine` with `symengine` diff --git a/recipes/symengine/all/test_package/conanfile.py b/recipes/symengine/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a86f655664c1 --- /dev/null +++ b/recipes/symengine/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_CXX_STANDARD"] = "11" + 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/symengine/all/test_package/test_package.cpp b/recipes/symengine/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62249dac49da7 --- /dev/null +++ b/recipes/symengine/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include + +#include + +int main() { + SymEngine::Expression pi_by_12 = + SymEngine::div(SymEngine::pi, SymEngine::integer(12)); + std::cout << pi_by_12 << std::endl; + return 0; +} diff --git a/recipes/symengine/all/test_v1_package/CMakeLists.txt b/recipes/symengine/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..62739795b7eca --- /dev/null +++ b/recipes/symengine/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(symengine REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE symengine::symengine) # FIXME: Replace `symengine::symengine` with `symengine` diff --git a/recipes/symengine/all/test_v1_package/conanfile.py b/recipes/symengine/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e1802f4cdc24 --- /dev/null +++ b/recipes/symengine/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["CMAKE_CXX_STANDARD"] = "11" + 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/symengine/all/test_v1_package/test_package.cpp b/recipes/symengine/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..62249dac49da7 --- /dev/null +++ b/recipes/symengine/all/test_v1_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include + +#include + +int main() { + SymEngine::Expression pi_by_12 = + SymEngine::div(SymEngine::pi, SymEngine::integer(12)); + std::cout << pi_by_12 << std::endl; + return 0; +} diff --git a/recipes/symengine/config.yml b/recipes/symengine/config.yml new file mode 100644 index 0000000000000..b95eb1527125e --- /dev/null +++ b/recipes/symengine/config.yml @@ -0,0 +1,7 @@ +versions: + "0.8.1": + folder: all + "0.9.0": + folder: all + "0.10.1": + folder: all diff --git a/recipes/systemc-cci/all/CMakeLists.txt b/recipes/systemc-cci/all/CMakeLists.txt new file mode 100644 index 0000000000000..747ee2684985a --- /dev/null +++ b/recipes/systemc-cci/all/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.8) +project(cci LANGUAGES CXX) + +set(LIBRARY_NAME cciapi) + +include(${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +find_package(RapidJSON REQUIRED CONFIG) +find_package(SystemCLanguage REQUIRED CONFIG) + +set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src") +set(CCI_CFG_DIR "${SOURCE_DIR}/cci_cfg") +set(CCI_CORE_DIR "${SOURCE_DIR}/cci_core") +set(CCI_UTILS_DIR "${SOURCE_DIR}/cci_utils") + +set(SOURCES + ${SOURCE_DIR}/cci_cfg/cci_broker_handle.cpp + ${SOURCE_DIR}/cci_cfg/cci_broker_manager.cpp + ${SOURCE_DIR}/cci_cfg/cci_originator.cpp + ${SOURCE_DIR}/cci_cfg/cci_param_if.cpp + ${SOURCE_DIR}/cci_cfg/cci_param_untyped.cpp + ${SOURCE_DIR}/cci_cfg/cci_param_untyped_handle.cpp + ${SOURCE_DIR}/cci_cfg/cci_report_handler.cpp + ${SOURCE_DIR}/cci_core/cci_name_gen.cpp + ${SOURCE_DIR}/cci_core/cci_value_converter.cpp + ${SOURCE_DIR}/cci_core/cci_value.cpp + ${SOURCE_DIR}/cci_utils/broker.cpp + ${SOURCE_DIR}/cci_utils/consuming_broker.cpp +) + +add_library(${LIBRARY_NAME} ${SOURCES}) +target_include_directories(${LIBRARY_NAME} PRIVATE ${SOURCE_DIR}) +target_link_libraries(${LIBRARY_NAME} PRIVATE RapidJSON::RapidJSON SystemC::SystemC) +set_target_properties(${LIBRARY_NAME} PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS TRUE + VERSION ${CONAN_PACKAGE_VERSION}) +target_compile_definitions(${LIBRARY_NAME} PRIVATE SC_INCLUDE_FX) + +install(TARGETS ${LIBRARY_NAME} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +install(DIRECTORY ${CCI_CFG_DIR} ${CCI_CORE_DIR} ${CCI_UTILS_DIR} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") +install(FILES "${SOURCE_DIR}/cci_configuration" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/systemc-cci/all/conandata.yml b/recipes/systemc-cci/all/conandata.yml new file mode 100644 index 0000000000000..6c1e792ccafa2 --- /dev/null +++ b/recipes/systemc-cci/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.0.0": + url: https://www.accellera.org/images/downloads/standards/systemc/cci-1.0.0.zip + sha256: 1c05583551d5a7da6f4ad56f9f792375c5eb2fba29263d9974778b0d1e5c7be0 +patches: + "1.0.0": + - patch_file: "patches/broker.patch" + base_path: "source_subfolder" + - patch_file: "patches/cci_param_untyped_handle.patch" + base_path: "source_subfolder" + - patch_file: "patches/cci_value_converter.patch" + base_path: "source_subfolder" diff --git a/recipes/systemc-cci/all/conanfile.py b/recipes/systemc-cci/all/conanfile.py new file mode 100644 index 0000000000000..57a3f498adec2 --- /dev/null +++ b/recipes/systemc-cci/all/conanfile.py @@ -0,0 +1,82 @@ +from conans import tools, CMake +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +import functools + + +required_conan_version = ">=1.43.0" + + +class SystemccciConan(ConanFile): + name = "systemc-cci" + description = """SystemC Configuration, Control and Inspection library""" + homepage = "https://www.accellera.org/" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("simulation", "modeling", "esl", "cci") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + generators = "cmake", "cmake_find_package_multi" + + @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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("systemc/2.3.3") + self.requires("rapidjson/1.1.0") + + def validate(self): + if self.settings.os == "Macos": + raise ConanInvalidConfiguration(f"{self.name} is not suppported on {self.settings.os}.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("NOTICE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["cciapi"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/systemc-cci/all/patches/broker.patch b/recipes/systemc-cci/all/patches/broker.patch new file mode 100644 index 0000000000000..b3a123b534f99 --- /dev/null +++ b/recipes/systemc-cci/all/patches/broker.patch @@ -0,0 +1,28 @@ +diff --git a/src/cci_utils/broker.cpp b/src/cci_utils/broker.cpp +index f46957f..8c3fc4c 100644 +--- a/src/cci_utils/broker.cpp ++++ b/src/cci_utils/broker.cpp +@@ -79,7 +79,8 @@ namespace cci_utils { + } + } + +- cci_value broker::get_cci_value(const std::string &parname) const ++ cci_value broker::get_cci_value(const std::string &parname, ++ const cci::cci_originator& originator) const + { + if (sendToParent(parname)) { + return m_parent.get_cci_value(parname); +diff --git a/src/cci_utils/broker.h b/src/cci_utils/broker.h +index 4bec972..b7faa35 100644 +--- a/src/cci_utils/broker.h ++++ b/src/cci_utils/broker.h +@@ -65,7 +65,8 @@ namespace cci_utils + void lock_preset_value(const std::string &parname); + + /// Get current cci_value +- cci::cci_value get_cci_value(const std::string &parname) const; ++ cci::cci_value get_cci_value(const std::string &parname, ++ const cci::cci_originator& originator = cci::cci_originator()) const; + + /// return a handle with which to access a parameter + cci::cci_param_untyped_handle get_param_handle(const std::string &parname, diff --git a/recipes/systemc-cci/all/patches/cci_param_untyped_handle.patch b/recipes/systemc-cci/all/patches/cci_param_untyped_handle.patch new file mode 100644 index 0000000000000..bfc30776b17d8 --- /dev/null +++ b/recipes/systemc-cci/all/patches/cci_param_untyped_handle.patch @@ -0,0 +1,13 @@ +diff --git a/src/cci_cfg/cci_param_untyped_handle.h b/src/cci_cfg/cci_param_untyped_handle.h +index 2d3f1da..2e4de88 100644 +--- a/src/cci_cfg/cci_param_untyped_handle.h ++++ b/src/cci_cfg/cci_param_untyped_handle.h +@@ -69,7 +69,7 @@ public: + #endif // CCI_HAS_CXX_RVALUE_REFS + + /// Destructor. +- ~cci_param_untyped_handle(); ++ virtual ~cci_param_untyped_handle(); + + //@} + diff --git a/recipes/systemc-cci/all/patches/cci_value_converter.patch b/recipes/systemc-cci/all/patches/cci_value_converter.patch new file mode 100644 index 0000000000000..9c6364aa34a37 --- /dev/null +++ b/recipes/systemc-cci/all/patches/cci_value_converter.patch @@ -0,0 +1,63 @@ +diff --git a/src/cci_core/cci_value_converter.cpp b/src/cci_core/cci_value_converter.cpp +index 36b0577..823a7ed 100644 +--- a/src/cci_core/cci_value_converter.cpp ++++ b/src/cci_core/cci_value_converter.cpp +@@ -22,6 +22,7 @@ + # define CCI_TPLEXTERN_ + #endif // excluded from MSVC'2010 + ++#define DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS + #include "cci_core/cci_value_converter.h" + + /** +diff --git a/src/cci_core/cci_value_converter.h b/src/cci_core/cci_value_converter.h +index 985751b..f40c3b5 100644 +--- a/src/cci_core/cci_value_converter.h ++++ b/src/cci_core/cci_value_converter.h +@@ -169,6 +169,7 @@ struct cci_value_delegate_converter + // -------------------------------------------------------------------------- + // C++ builtin types + ++#ifndef DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS + // default instantiations (in cci_value_converter.cpp) + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; +@@ -177,6 +178,7 @@ CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; ++#endif /* DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS */ + + // related numerical types + // (without range checks for now) +@@ -302,6 +304,7 @@ struct cci_value_converter< std::vector > + // ---------------------------------------------------------------------------- + // SystemC builtin types + ++#ifndef DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS + // default instantiations (in cci_value_converter.cpp) + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; +@@ -311,6 +314,7 @@ CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; ++#endif /* DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS */ + + /// @see cci_value_converter primary template + template +@@ -369,12 +373,14 @@ CCI_CLOSE_NAMESPACE_ + #define CCI_CNF_CCI_VALUE_CONVERTER_H_INCLUDED_FX_ + CCI_OPEN_NAMESPACE_ + ++#ifndef DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; + CCI_TPLEXTERN_ template struct cci_value_converter; ++#endif /* DO_NOT_DEFINE_EXTERN_CCI_VALUE_CONVERTERS */ + + template + struct cci_value_converter< sc_dt::sc_fixed > diff --git a/recipes/systemc-cci/all/test_package/CMakeLists.txt b/recipes/systemc-cci/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..062e855b87030 --- /dev/null +++ b/recipes/systemc-cci/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(systemc-cci REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} systemc-cci::systemc-cci) diff --git a/recipes/systemc-cci/all/test_package/conanfile.py b/recipes/systemc-cci/all/test_package/conanfile.py new file mode 100644 index 0000000000000..189bd25a7c208 --- /dev/null +++ b/recipes/systemc-cci/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class SystemccciTestConan(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/systemc-cci/all/test_package/example.cpp b/recipes/systemc-cci/all/test_package/example.cpp new file mode 100644 index 0000000000000..ce47ae49dd74a --- /dev/null +++ b/recipes/systemc-cci/all/test_package/example.cpp @@ -0,0 +1,8 @@ +#include +#include + +int sc_main(int argc, char *argv[]) +{ + cci::cci_register_broker(new cci_utils::broker("Global Broker")); + return 0; +} diff --git a/recipes/systemc-cci/config.yml b/recipes/systemc-cci/config.yml new file mode 100644 index 0000000000000..c7f13630776fb --- /dev/null +++ b/recipes/systemc-cci/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: "all" diff --git a/recipes/systemc/all/CMakeLists.txt b/recipes/systemc/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/systemc/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/systemc/all/conandata.yml b/recipes/systemc/all/conandata.yml new file mode 100644 index 0000000000000..db213ca0aa834 --- /dev/null +++ b/recipes/systemc/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.3.3": + url: https://github.com/accellera-official/systemc/archive/2.3.3.tar.gz + sha256: 5781b9a351e5afedabc37d145e5f7edec08f3fd5de00ffeb8fa1f3086b1f7b3f + "2.3.4": + url: https://github.com/accellera-official/systemc/archive/2.3.4.tar.gz + sha256: bfb309485a8ad35a08ee78827d1647a451ec5455767b25136e74522a6f41e0ea +patches: + "2.3.3": + - patch_file: "patches/0001-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-sc_string_view.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-mingw.patch" + base_path: "source_subfolder" + "2.3.4": + - patch_file: "patches/0002-sc_string_view.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-mingw.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/systemc/all/conanfile.py b/recipes/systemc/all/conanfile.py new file mode 100644 index 0000000000000..e65862f8bd94b --- /dev/null +++ b/recipes/systemc/all/conanfile.py @@ -0,0 +1,132 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.43.0" + + +class SystemcConan(ConanFile): + name = "systemc" + description = """SystemC is a set of C++ classes and macros which provide + an event-driven simulation interface.""" + homepage = "https://www.accellera.org/" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("simulation", "modeling", "esl", "tlm") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_async_updates": [True, False], + "disable_copyright_msg": [True, False], + "disable_virtual_bind": [True, False], + "enable_assertions": [True, False], + "enable_immediate_self_notifications": [True, False], + "enable_pthreads": [True, False], + "enable_phase_callbacks": [True, False], + "enable_phase_callbacks_tracing": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "disable_async_updates": False, + "disable_copyright_msg": False, + "disable_virtual_bind": False, + "enable_assertions": True, + "enable_immediate_self_notifications": False, + "enable_pthreads": False, + "enable_phase_callbacks": False, + "enable_phase_callbacks_tracing": False, + } + + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + 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 + del self.options.enable_pthreads + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Macos": + raise ConanInvalidConfiguration("Macos build not supported") + + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Building SystemC as a shared library on Windows is currently not supported") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["DISABLE_ASYNC_UPDATES"] = \ + self.options.disable_async_updates + cmake.definitions["DISABLE_COPYRIGHT_MESSAGE"] = \ + self.options.disable_copyright_msg + cmake.definitions["DISABLE_VIRTUAL_BIND"] = \ + self.options.disable_virtual_bind + cmake.definitions["ENABLE_ASSERTIONS"] = \ + self.options.enable_assertions + cmake.definitions["ENABLE_IMMEDIATE_SELF_NOTIFICATIONS"] = \ + self.options.enable_immediate_self_notifications + cmake.definitions["ENABLE_PTHREADS"] = \ + self.options.get_safe("enable_pthreads", False) + cmake.definitions["ENABLE_PHASE_CALLBACKS"] = \ + self.options.get_safe("enable_phase_callbacks", False) + cmake.definitions["ENABLE_PHASE_CALLBACKS_TRACING"] = \ + self.options.get_safe("enable_phase_callbacks_tracing", False) + cmake.configure() + return cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("NOTICE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SystemCLanguage") + self.cpp_info.set_property("cmake_target_name", "SystemC::systemc") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_systemc"].libs = ["systemc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_systemc"].system_libs = ["pthread"] + if self._is_msvc: + self.cpp_info.components["_systemc"].cxxflags.append("/vmg") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "SystemCLanguage" + self.cpp_info.filenames["cmake_find_package_multi"] = "SystemCLanguage" + self.cpp_info.names["cmake_find_package"] = "SystemC" + self.cpp_info.names["cmake_find_package_multi"] = "SystemC" + self.cpp_info.components["_systemc"].names["cmake_find_package"] = "systemc" + self.cpp_info.components["_systemc"].names["cmake_find_package_multi"] = "systemc" + self.cpp_info.components["_systemc"].set_property("cmake_target_name", "SystemC::systemc") diff --git a/recipes/systemc/all/patches/0001-cmake.patch b/recipes/systemc/all/patches/0001-cmake.patch new file mode 100644 index 0000000000000..46f27b30da924 --- /dev/null +++ b/recipes/systemc/all/patches/0001-cmake.patch @@ -0,0 +1,21 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -273,12 +273,12 @@ + FORCE) + endif (NOT CMAKE_BUILD_TYPE) + +-set (CMAKE_CXX_STANDARD 98 CACHE STRING +- "C++ standard to build all targets. Supported values are 98, 11, and 14.") +-set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL +- "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") +-mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) +- ++#set (CMAKE_CXX_STANDARD 98 CACHE STRING ++# "C++ standard to build all targets. Supported values are 98, 11, and 14.") ++#set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL ++# "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") ++#mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) ++# + if (NOT (WIN32 OR CYGWIN)) + option (BUILD_SHARED_LIBS "Build shared libraries." ON) + else (NOT (WIN32 OR CYGWIN)) diff --git a/recipes/systemc/all/patches/0002-sc_string_view.patch b/recipes/systemc/all/patches/0002-sc_string_view.patch new file mode 100644 index 0000000000000..c9858855b1740 --- /dev/null +++ b/recipes/systemc/all/patches/0002-sc_string_view.patch @@ -0,0 +1,58 @@ +--- src/sysc/utils/sc_string_view.h ++++ src/sysc/utils/sc_string_view.h +@@ -37,17 +37,47 @@ + + #include + +-#if SC_CPLUSPLUS >= 201402L && defined(__has_include) +-# if SC_CPLUSPLUS > 201402L && __has_include() /* since C++17 */ +-# define SC_STRING_VIEW_NS_ std +-# include +- /* available in Library Fundamentals, ISO/IEC TS 19568:2015 */ +-# elif __has_include() ++#if defined(__clang__) ++# if (__cplusplus >= 201103) ++# if __has_include(<__config>) ++# include <__config> ++# if defined(_LIBCPP_VERSION) ++# define HAS_CLANG_LIBCXX 1 ++# endif ++# endif ++# endif ++#endif ++ ++#if defined(__clang__) ++# if defined(HAS_CLANG_LIBCXX) ++# if (__cplusplus >= 201402) ++# if __has_include() ++# define HAS_STD_STRING_VIEW 1 ++# endif ++# endif ++# else ++# if (__cplusplus >= 201703) ++# if __has_include() ++# define HAS_STD_STRING_VIEW 1 ++# endif ++# endif ++# endif ++#elif defined(__GNUC__) ++# if (__GNUC__ >= 7) ++# if (__cplusplus >= 201703) ++# define HAS_STD_STRING_VIEW 1 ++# endif ++# endif ++#endif ++ ++#if HAS_STD_STRING_VIEW ++# define SC_STRING_VIEW_NS_ std ++# include ++#elif SC_CPLUSPLUS >= 201402L && defined(__has_include) ++# if __has_include() + # define SC_STRING_VIEW_NS_ std::experimental + # include + # endif +-#else +-// TODO: other ways to detect availability of std::(experimental::)string_view? + #endif + + #ifndef SC_STRING_VIEW_NS_ diff --git a/recipes/systemc/all/patches/0003-mingw.patch b/recipes/systemc/all/patches/0003-mingw.patch new file mode 100644 index 0000000000000..6aaf74e14ac2e --- /dev/null +++ b/recipes/systemc/all/patches/0003-mingw.patch @@ -0,0 +1,11 @@ +--- src/sysc/kernel/sc_cmnhdr.h ++++ src/sysc/kernel/sc_cmnhdr.h +@@ -199,7 +199,7 @@ + // (deliberately outside of include guards to enable later effect) + #if defined(SC_HAS_WINDOWS_H_) && defined(SC_INCLUDE_WINDOWS_H) + # undef SC_HAS_WINDOWS_H_ +-# include ++# include + #endif + + // $Log: sc_cmnhdr.h,v $ diff --git a/recipes/systemc/all/patches/0004-cmake.patch b/recipes/systemc/all/patches/0004-cmake.patch new file mode 100644 index 0000000000000..83eead38732bc --- /dev/null +++ b/recipes/systemc/all/patches/0004-cmake.patch @@ -0,0 +1,21 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -277,12 +277,12 @@ + FORCE) + endif (NOT CMAKE_BUILD_TYPE) + +-set (CMAKE_CXX_STANDARD 98 CACHE STRING +- "C++ standard to build all targets. Supported values are 98, 11, 14, and 17.") +-set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL +- "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") +-mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) +- ++#set (CMAKE_CXX_STANDARD 98 CACHE STRING ++# "C++ standard to build all targets. Supported values are 98, 11, 14, and 17.") ++#set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL ++# "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") ++#mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) ++# + if (NOT (WIN32 OR CYGWIN)) + option (BUILD_SHARED_LIBS "Build shared libraries." ON) + else (NOT (WIN32 OR CYGWIN)) diff --git a/recipes/systemc/all/test_package/CMakeLists.txt b/recipes/systemc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d31301bc9ee2 --- /dev/null +++ b/recipes/systemc/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SystemCLanguage REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} SystemC::systemc) diff --git a/recipes/systemc/all/test_package/conanfile.py b/recipes/systemc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/systemc/all/test_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/systemc/all/test_package/test_package.cpp b/recipes/systemc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e497a9690abc6 --- /dev/null +++ b/recipes/systemc/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int sc_main(int argc, char *argv[]) +{ + return 0; +} + +int main() +{ + ::sc_core::sc_version(); +} diff --git a/recipes/systemc/config.yml b/recipes/systemc/config.yml new file mode 100644 index 0000000000000..695969ee424ef --- /dev/null +++ b/recipes/systemc/config.yml @@ -0,0 +1,5 @@ +versions: + "2.3.3": + folder: "all" + "2.3.4": + folder: "all" diff --git a/recipes/szip/all/conandata.yml b/recipes/szip/all/conandata.yml new file mode 100644 index 0000000000000..920d26895e800 --- /dev/null +++ b/recipes/szip/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "2.1.1": + url: "https://support.hdfgroup.org/ftp/lib-external/szip/2.1.1/src/szip-2.1.1.tar.gz" + sha256: "21ee958b4f2d4be2c9cabfa5e1a94877043609ce86fde5f286f105f7ff84d412" +patches: + "2.1.1": + - patch_file: "patches/fix_unknown_size_t.patch" + - patch_file: "patches/build_either_static_or_shared.patch" diff --git a/recipes/szip/all/conanfile.py b/recipes/szip/all/conanfile.py new file mode 100644 index 0000000000000..b431b4a8bec9e --- /dev/null +++ b/recipes/szip/all/conanfile.py @@ -0,0 +1,124 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, collect_libs, get, copy, replace_in_file, save +from conan.tools.build import cross_building +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class SzipConan(ConanFile): + name = "szip" + description = "C Implementation of the extended-Rice lossless compression " \ + "algorithm, suitable for use with scientific data." + license = "Szip License" + topics = "compression", "decompression" + homepage = "https://support.hdfgroup.org/doc_resource/SZIP/" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_encoding": [True, False], + "enable_large_file": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_encoding": False, + "enable_large_file": 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: + 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 + + 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 build(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set (CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SZIP_ENABLE_ENCODING"] = self.options.enable_encoding + tc.variables["SZIP_EXTERNALLY_CONFIGURED"] = True + tc.variables["BUILD_TESTING"] = False + tc.variables["SZIP_BUILD_FRAMEWORKS"] = False + tc.variables["SZIP_PACK_MACOSX_FRAMEWORK"] = False + tc.variables["SZIP_ENABLE_LARGE_FILE"] = self.options.enable_large_file + if cross_building(self, skip_x64_x86=True) and self.options.enable_large_file: + # Assume it works, otherwise raise in 'validate' function + tc.variables["TEST_LFS_WORKS_RUN"] = True + tc.variables["TEST_LFS_WORKS_RUN__TRYRUN_OUTPUT"] = True + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"szip-shared" if self.options.shared else "szip-static": "szip::szip"} + ) + + 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_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", "szip") + self.cpp_info.set_property("cmake_target_name", "szip-shared" if self.options.shared else "szip-static") + self.cpp_info.libs = collect_libs(self) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m"]) + + if self.options.shared: + self.cpp_info.defines.append("SZ_BUILT_AS_DYNAMIC_LIB=1") + + # 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/szip/all/patches/build_either_static_or_shared.patch b/recipes/szip/all/patches/build_either_static_or_shared.patch new file mode 100644 index 0000000000000..4400c5e91c578 --- /dev/null +++ b/recipes/szip/all/patches/build_either_static_or_shared.patch @@ -0,0 +1,31 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -22,6 +22,7 @@ set (SZIP_PUBLIC_HEADERS + ${SZIP_SRC_SOURCE_DIR}/szlib.h + ) + ++if (NOT BUILD_SHARED_LIBS) + add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) + #set_target_properties (${SZIP_LIB_TARGET} + # PROPERTIES +@@ -37,7 +38,7 @@ set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) + SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) + set (install_targets ${SZIP_LIB_TARGET}) + +-if (BUILD_SHARED_LIBS) ++else() + add_library (${SZIP_LIBSH_TARGET} SHARED ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) + # set_target_properties (${SZIP_LIB_TARGET} + # PROPERTIES +@@ -62,8 +63,9 @@ endif () + if (SZIP_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${SZIP_LIBSH_TARGET} ${SZIP_INSTALL_BIN_DIR} libraries) +- endif (BUILD_SHARED_LIBS) +- INSTALL_TARGET_PDB (${SZIP_LIB_TARGET} ${SZIP_INSTALL_BIN_DIR} libraries) ++ else() ++ INSTALL_TARGET_PDB (${SZIP_LIB_TARGET} ${SZIP_INSTALL_BIN_DIR} libraries) ++ endif() + + install ( + TARGETS diff --git a/recipes/szip/all/patches/fix_unknown_size_t.patch b/recipes/szip/all/patches/fix_unknown_size_t.patch new file mode 100644 index 0000000000000..a6b0458c524c2 --- /dev/null +++ b/recipes/szip/all/patches/fix_unknown_size_t.patch @@ -0,0 +1,11 @@ +--- a/src/szlib.h ++++ b/src/szlib.h +@@ -42,6 +42,8 @@ Post Falls, ID 83854. (208) 262-2008. + #include "ricehdf.h" + #include "szip_adpt.h" + ++#include ++ + #define SZLIB_VERSION "2.1.1" + + /* diff --git a/recipes/szip/all/test_package/CMakeLists.txt b/recipes/szip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2cc3f3a2650b9 --- /dev/null +++ b/recipes/szip/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +find_package(szip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET szip-shared) + target_link_libraries(${PROJECT_NAME} szip-shared) +else () + target_link_libraries(${PROJECT_NAME} szip-static) +endif () diff --git a/recipes/szip/all/test_package/conanfile.py b/recipes/szip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/szip/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/szip/all/test_package/test_package.c b/recipes/szip/all/test_package/test_package.c new file mode 100644 index 0000000000000..11578ead7a9fb --- /dev/null +++ b/recipes/szip/all/test_package/test_package.c @@ -0,0 +1,80 @@ +#include +#include + +#include +#include +#include + +unsigned long szip_decoding(int bits_per_pixel, char *in, long size, char *out, long out_size, long buffer_size) { + int bytes_per_pixel; + int err; + sz_stream d_stream; + + strcpy((char*)out, "garbage"); + + d_stream.hidden = 0; + + d_stream.next_in = in; + d_stream.next_out = out; + + d_stream.avail_in = 0; + d_stream.avail_out = 0; + + d_stream.total_in = 0; + d_stream.total_out = 0; + + d_stream.options_mask = SZ_RAW_OPTION_MASK | SZ_NN_OPTION_MASK | SZ_MSB_OPTION_MASK; + d_stream.bits_per_pixel = bits_per_pixel; + d_stream.pixels_per_block = 8; + d_stream.pixels_per_scanline = 16; + + bytes_per_pixel = (bits_per_pixel + 7)/8; + if (bytes_per_pixel == 3) bytes_per_pixel = 4; + + d_stream.image_pixels = out_size/bytes_per_pixel; + + err = SZ_DecompressInit(&d_stream); + if (err != SZ_OK) { + fprintf(stderr, "SZ_DecompressEnd error: %d\n", err); + exit(0); + } + + while (d_stream.total_in < size) { + d_stream.avail_in = d_stream.avail_out = buffer_size; + if (d_stream.avail_in + d_stream.total_in > size) + d_stream.avail_in = size - d_stream.total_in; + + err = SZ_Decompress(&d_stream, SZ_NO_FLUSH); + if (err == SZ_STREAM_END) break; + + if (err != SZ_OK) { + fprintf(stderr, "SZ_Decompress error: %d\n", err); + exit(0); + } + } + + while (d_stream.total_out < out_size) { + d_stream.avail_out = buffer_size; + err = SZ_Decompress(&d_stream, SZ_FINISH); + if (err == SZ_STREAM_END) break; + + if (err != SZ_OK) { + fprintf(stderr, "SZ_Decompress error: %d\n", err); + exit(0); + } + } + + err = SZ_DecompressEnd(&d_stream); + if (err != SZ_OK) { + fprintf(stderr, "SZ_DecompressEnd error: %d\n", err); + exit(0); + } + + return d_stream.total_out; +} + +int main() { + char *out = (char *) malloc(1024*1024L); + unsigned long size = szip_decoding(8, NULL, 0, out, 0, 1); + return 0; +} diff --git a/recipes/szip/all/test_v1_package/CMakeLists.txt b/recipes/szip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..54dab32a19430 --- /dev/null +++ b/recipes/szip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + + +find_package(szip REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) + +if(TARGET szip-shared) + target_link_libraries(${PROJECT_NAME} szip-shared) +else () + target_link_libraries(${PROJECT_NAME} szip-static) +endif () diff --git a/recipes/szip/all/test_v1_package/conanfile.py b/recipes/szip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/szip/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/szip/config.yml b/recipes/szip/config.yml new file mode 100644 index 0000000000000..9e751beac176c --- /dev/null +++ b/recipes/szip/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.1": + folder: all diff --git a/recipes/tabulate/all/conandata.yml b/recipes/tabulate/all/conandata.yml new file mode 100644 index 0000000000000..3b7ae6a3cb167 --- /dev/null +++ b/recipes/tabulate/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.5": + url: "https://github.com/p-ranav/tabulate/archive/v1.5.tar.gz" + sha256: "16b289f46306283544bb593f4601e80d6ea51248fde52e910cc569ef08eba3fb" + "1.4": + url: "https://github.com/p-ranav/tabulate/archive/v1.4.tar.gz" + sha256: "c20cdc3175526a069e932136a7cbdf6f27b137bdb4fc5f574eb5a497228c8e11" + "1.3": + url: "https://github.com/p-ranav/tabulate/archive/v1.3.tar.gz" + sha256: "d1739e82f9f5acab084a5166a78714fde5198ce6b9448ec8ae8e403085048f7e" + "1.0": + url: "https://github.com/p-ranav/tabulate/archive/v1.0.tar.gz" + sha256: "34eda3605e2ce0c7ca339fa2af6a0c77a5e49321b2f549ff5313f955273c8ac8" diff --git a/recipes/tabulate/all/conanfile.py b/recipes/tabulate/all/conanfile.py new file mode 100644 index 0000000000000..9e38d9d4f8e7f --- /dev/null +++ b/recipes/tabulate/all/conanfile.py @@ -0,0 +1,66 @@ +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 Tabulate(ConanFile): + name = "tabulate" + description = "Table Maker for Modern C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/tabulate" + topics = ("header-only", "cpp17", "tabulate", "table", "cli") + 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": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 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=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tabulate/all/test_package/CMakeLists.txt b/recipes/tabulate/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30b68b896d39e --- /dev/null +++ b/recipes/tabulate/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tabulate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tabulate::tabulate) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/tabulate/all/test_package/conanfile.py b/recipes/tabulate/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/tabulate/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/tabulate/all/test_package/test_package.cpp b/recipes/tabulate/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4bbf01671c2d1 --- /dev/null +++ b/recipes/tabulate/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +using namespace tabulate; + +int main() { + Table colors; + colors.add_row({"Font Color is Red", "Font Color is Blue", "Font Color is Green"}); + colors[0][0].format().font_color(Color::red).font_style({FontStyle::bold}); + colors[0][1].format().font_color(Color::blue).font_style({FontStyle::bold}); + colors[0][2].format().font_color(Color::green).font_style({FontStyle::bold}); + std::cout << colors << std::endl; +} + diff --git a/recipes/tabulate/all/test_v1_package/CMakeLists.txt b/recipes/tabulate/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/tabulate/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tabulate/all/test_v1_package/conanfile.py b/recipes/tabulate/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/tabulate/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tabulate/config.yml b/recipes/tabulate/config.yml new file mode 100644 index 0000000000000..38ba8a657ca2f --- /dev/null +++ b/recipes/tabulate/config.yml @@ -0,0 +1,9 @@ +versions: + "1.5": + folder: all + "1.4": + folder: all + "1.3": + folder: all + "1.0": + folder: all diff --git a/recipes/taglib/all/conandata.yml b/recipes/taglib/all/conandata.yml new file mode 100644 index 0000000000000..af90af9573848 --- /dev/null +++ b/recipes/taglib/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.13": + url: "https://taglib.org/releases/taglib-1.13.tar.gz" + sha256: "58f08b4db3dc31ed152c04896ee9172d22052bc7ef12888028c01d8b1d60ade0" + "1.12": + url: "https://taglib.org/releases/taglib-1.12.tar.gz" + sha256: "7fccd07669a523b07a15bd24c8da1bbb92206cb19e9366c3692af3d79253b703" +patches: + "1.12": + - patch_file: "patches/1.12-0001-fix-error-duplicate-volatile.patch" diff --git a/recipes/taglib/all/conanfile.py b/recipes/taglib/all/conanfile.py new file mode 100644 index 0000000000000..23a0beef8e885 --- /dev/null +++ b/recipes/taglib/all/conanfile.py @@ -0,0 +1,107 @@ +from conan import ConanFile +from conan.tools.build import 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, replace_in_file, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class TaglibConan(ConanFile): + name = "taglib" + description = "TagLib is a library for reading and editing the metadata of several popular audio formats." + license = ("LGPL-2.1-or-later", "MPL-1.1") + topics = ("audio", "metadata") + homepage = "https://taglib.org" + 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], + "bindings": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "bindings": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_CCACHE"] = False + tc.variables["VISIBILITY_HIDDEN"] = True + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_BINDINGS"] = self.options.bindings + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # relocatable shared libs on macOS + for cmakelists in [ + os.path.join(self.source_folder, "taglib", "CMakeLists.txt"), + os.path.join(self.source_folder, "bindings", "c", "CMakeLists.txt"), + ]: + if Version(self.version) >= "1.13": + replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR}", "") + else: + replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${LIB_INSTALL_DIR}", "") + + def build(self): + self._patch_sources() + 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() + rm(self, "taglib-config", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "taglib_full_package") # unofficial, to avoid conflicts in pkg_config generator + + self.cpp_info.components["tag"].set_property("pkg_config_name", "taglib") + self.cpp_info.components["tag"].includedirs.append(os.path.join("include", "taglib")) + self.cpp_info.components["tag"].libs = ["tag"] + self.cpp_info.components["tag"].requires = ["zlib::zlib"] + if not self.options.shared: + self.cpp_info.components["tag"].defines.append("TAGLIB_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tag"].system_libs.append("m") + + if self.options.bindings: + self.cpp_info.components["tag_c"].set_property("pkg_config_name", "taglib_c") + self.cpp_info.components["tag_c"].libs = ["tag_c"] + self.cpp_info.components["tag_c"].requires = ["tag"] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["tag"].system_libs.append(libcxx) diff --git a/recipes/taglib/all/patches/1.12-0001-fix-error-duplicate-volatile.patch b/recipes/taglib/all/patches/1.12-0001-fix-error-duplicate-volatile.patch new file mode 100644 index 0000000000000..43240507f59d0 --- /dev/null +++ b/recipes/taglib/all/patches/1.12-0001-fix-error-duplicate-volatile.patch @@ -0,0 +1,30 @@ +From 1d24bd3399f2284104cbe87d017f87325b1797ab Mon Sep 17 00:00:00 2001 +From: Oleg Antonyan +Date: Thu, 13 May 2021 16:41:35 +0200 +Subject: [PATCH] =?UTF-8?q?Fix=20"error:=20duplicate=20=E2=80=98volatile?= + =?UTF-8?q?=E2=80=99"=20on=20systems=20without=20HAVE=5FGCC=5FATOMIC=20in?= + =?UTF-8?q?=201.12=20(#1012)?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* fix error: duplicate volatile + +* fix volatile ATOMIC_INT in constructor +--- + taglib/toolkit/trefcounter.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/taglib/toolkit/trefcounter.cpp b/taglib/toolkit/trefcounter.cpp +index 18cb596c0..5b089abf9 100644 +--- a/taglib/toolkit/trefcounter.cpp ++++ b/taglib/toolkit/trefcounter.cpp +@@ -52,7 +52,7 @@ + # define ATOMIC_INC(x) __sync_add_and_fetch(&x, 1) + # define ATOMIC_DEC(x) __sync_sub_and_fetch(&x, 1) + #else +-# define ATOMIC_INT volatile int ++# define ATOMIC_INT int + # define ATOMIC_INC(x) (++x) + # define ATOMIC_DEC(x) (--x) + #endif diff --git a/recipes/taglib/all/test_package/CMakeLists.txt b/recipes/taglib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ada6c88956048 --- /dev/null +++ b/recipes/taglib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(taglib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taglib::taglib) diff --git a/recipes/taglib/all/test_package/conanfile.py b/recipes/taglib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/taglib/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/taglib/all/test_package/test_package.cpp b/recipes/taglib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..40bbebc3718e8 --- /dev/null +++ b/recipes/taglib/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + TagLib::List fileList; + return 0; +} diff --git a/recipes/taglib/all/test_v1_package/CMakeLists.txt b/recipes/taglib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/taglib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/taglib/all/test_v1_package/conanfile.py b/recipes/taglib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/taglib/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/taglib/config.yml b/recipes/taglib/config.yml new file mode 100644 index 0000000000000..c171123076114 --- /dev/null +++ b/recipes/taglib/config.yml @@ -0,0 +1,5 @@ +versions: + "1.13": + folder: all + "1.12": + folder: all diff --git a/recipes/taocpp-json/all/conandata.yml b/recipes/taocpp-json/all/conandata.yml new file mode 100644 index 0000000000000..732888cb32c08 --- /dev/null +++ b/recipes/taocpp-json/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.0-beta.13": + sha256: 2513b32d1883277f78071ff1cc55d4f35a979fffdaddf6412d3cb67852ce68b5 + url: https://github.com/taocpp/json/archive/1.0.0-beta.13.tar.gz + "1.0.0-beta.12": + sha256: 92692225b0b6b217948ee7f3bf176f5a2a168b9a616d09c080ea571b9dfbd4a7 + url: https://github.com/taocpp/json/archive/1.0.0-beta.12.tar.gz + "1.0.0-beta.11": + sha256: d27f5d02cf62e7fea997abd6f540bdf05fdf36a952807db289dbdda0598de106 + url: https://github.com/taocpp/json/archive/1.0.0-beta.11.tar.gz + "1.0.0-beta.10": + sha256: c6e8eb2b3a1f8dd284e02303527d26c5856cac24e67f1f5a8fc622b892e2cd26 + url: https://github.com/taocpp/json/archive/1.0.0-beta.10.tar.gz diff --git a/recipes/taocpp-json/all/conanfile.py b/recipes/taocpp-json/all/conanfile.py new file mode 100644 index 0000000000000..c4c33792ccb9b --- /dev/null +++ b/recipes/taocpp-json/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.51.1" + + +class TaoCPPJSONConan(ConanFile): + name = "taocpp-json" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/json" + description = "C++ header-only JSON library" + topics = ("json", "jaxn", "cbor", "msgpack", + "ubjson", "json-pointer", "json-patch") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.0.0-beta.11" else "17" + + @property + def _min_compilers_version(self): + return { + "17": { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + @property + def _requires_pegtl(self): + return Version(self.version) >= "1.0.0-beta.13" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self._requires_pegtl: + self.requires("taocpp-pegtl/3.2.7") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + min_compiler_version = self._min_compilers_version.get(str(self.settings.compiler), False) + if min_compiler_version and Version(self.settings.compiler.version) < min_compiler_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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_file_name", "taocpp-json") + self.cpp_info.set_property("cmake_target_name", "taocpp::json") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["json"].bindirs = [] + self.cpp_info.components["json"].libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "taocpp-json" + self.cpp_info.filenames["cmake_find_package_multi"] = "taocpp-json" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["json"].names["cmake_find_package"] = "json" + self.cpp_info.components["json"].names["cmake_find_package_multi"] = "json" + self.cpp_info.components["json"].set_property("cmake_target_name", "taocpp::json") + if self._requires_pegtl: + self.cpp_info.components["json"].requires = ["taocpp-pegtl::taocpp-pegtl"] diff --git a/recipes/taocpp-json/all/test_package/CMakeLists.txt b/recipes/taocpp-json/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bf7290d1f3c3a --- /dev/null +++ b/recipes/taocpp-json/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(taocpp-json REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taocpp::json) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/taocpp-json/all/test_package/conanfile.py b/recipes/taocpp-json/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/taocpp-json/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/taocpp-json/all/test_package/test_package.cpp b/recipes/taocpp-json/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..245912916fa73 --- /dev/null +++ b/recipes/taocpp-json/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + + +int main() { + tao::json::internal::sha256 value; + value.feed("Conan.io"); + std::cout << "SHA256: " << value.get() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/taocpp-json/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-json/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a4b77ef89cd7 --- /dev/null +++ b/recipes/taocpp-json/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/taocpp-json/all/test_v1_package/conanfile.py b/recipes/taocpp-json/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/taocpp-json/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/taocpp-json/config.yml b/recipes/taocpp-json/config.yml new file mode 100644 index 0000000000000..1c4b5480a0dce --- /dev/null +++ b/recipes/taocpp-json/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.0-beta.13": + folder: all + "1.0.0-beta.12": + folder: all + "1.0.0-beta.11": + folder: all + "1.0.0-beta.10": + folder: all diff --git a/recipes/taocpp-operators/all/conandata.yml b/recipes/taocpp-operators/all/conandata.yml new file mode 100644 index 0000000000000..05e75520058a5 --- /dev/null +++ b/recipes/taocpp-operators/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.2": + sha256: 9e7811621c86444d6c4f47f822eaee713039b04ab38fb9ad652046e4ab4f647c + url: https://github.com/taocpp/operators/archive/1.2.2.tar.gz diff --git a/recipes/taocpp-operators/all/conanfile.py b/recipes/taocpp-operators/all/conanfile.py new file mode 100644 index 0000000000000..fa4f4d82a6924 --- /dev/null +++ b/recipes/taocpp-operators/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TaoCPPOperatorsConan(ConanFile): + name = "taocpp-operators" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/operators" + description = "A highly efficient, move-aware operators library" + topics = ("cpp", "cpp11", "header-only", "operators") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + 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], + destination=self.source_folder, 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, "*", 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_file_name", "taocpp-operators") + self.cpp_info.set_property("cmake_target_name", "taocpp::operators") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "taocpp-operators" + self.cpp_info.filenames["cmake_find_package_multi"] = "taocpp-operators" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["_taocpp-operators"].names["cmake_find_package"] = "operators" + self.cpp_info.components["_taocpp-operators"].names["cmake_find_package_multi"] = "operators" + self.cpp_info.components["_taocpp-operators"].set_property("cmake_target_name", "taocpp::operators") + self.cpp_info.components["_taocpp-operators"].bindirs = [] + self.cpp_info.components["_taocpp-operators"].libdirs = [] diff --git a/recipes/taocpp-operators/all/test_package/CMakeLists.txt b/recipes/taocpp-operators/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f0441a83fe6de --- /dev/null +++ b/recipes/taocpp-operators/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(taocpp-operators REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taocpp::operators) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/taocpp-operators/all/test_package/conanfile.py b/recipes/taocpp-operators/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/taocpp-operators/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/taocpp-operators/all/test_package/test_package.cpp b/recipes/taocpp-operators/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5f991efa8008c --- /dev/null +++ b/recipes/taocpp-operators/all/test_package/test_package.cpp @@ -0,0 +1,102 @@ +#include +#include + +class X + : tao::operators::ordered_field< X >, + tao::operators::modable< X >, + tao::operators::ordered_field< X, int >, + tao::operators::modable< X, int > +{ +public: + explicit X( const int v ) noexcept + : v_( v ) + { + } + + X( const X& ) = default; + X( X&& ) = default; + + ~X() = default; + + X& operator=( const X& ) = delete; + X& operator=( X&& ) = delete; + + X& operator+=( const X& x ) noexcept + { + v_ += x.v_; + return *this; + } + + X& operator-=( const X& x ) + { + v_ -= x.v_; + return *this; + } + + X& operator*=( const X& x ) + { + v_ *= x.v_; + return *this; + } + + X& operator/=( const X& x ) + { + v_ /= x.v_; + return *this; + } + + X& operator%=( const X& x ) + { + v_ %= x.v_; + return *this; + } + + X& operator+=( const int v ) + { + v_ += v; + return *this; + } + + X& operator-=( const int v ) + { + v_ -= v; + return *this; + } + + X& operator*=( const int v ) + { + v_ *= v; + return *this; + } + + X& operator/=( const int v ) + { + v_ /= v; + return *this; + } + + X& operator%=( const int v ) + { + v_ %= v; + return *this; + } + + int v_; // NOLINT +}; + +bool operator==( const X& lhs, const X& rhs ) +{ + return lhs.v_ == rhs.v_; +} + +int main() +{ + X x1( 1 ); + X x2( 2 ); + + if (x1 == x2) { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/taocpp-operators/all/test_v1_package/conanfile.py b/recipes/taocpp-operators/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/taocpp-operators/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/taocpp-operators/config.yml b/recipes/taocpp-operators/config.yml new file mode 100644 index 0000000000000..af40d9653a378 --- /dev/null +++ b/recipes/taocpp-operators/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.2": + folder: all diff --git a/recipes/taocpp-pegtl/2.x.x/conandata.yml b/recipes/taocpp-pegtl/2.x.x/conandata.yml new file mode 100644 index 0000000000000..6b0471709477d --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.8.3": + url: "https://github.com/taocpp/PEGTL/archive/2.8.3.tar.gz" + sha256: "88b8e4ded6ea1f3f2223cc3e37072e2db1e123b90d36c309816341ae9d966723" + "2.8.2": + url: "https://github.com/taocpp/PEGTL/archive/2.8.2.tar.gz" + sha256: "1d7db20502125a75fbb583c7020038d4faeb6812de504147b23b3db4ef329ca3" + "2.8.1": + url: "https://github.com/taocpp/PEGTL/archive/2.8.1.tar.gz" + sha256: "d23f81a60896cdd8c2ce0d1b31737fe0e1137915ba3fdb4f366ae1a997a1bce6" diff --git a/recipes/taocpp-pegtl/2.x.x/conanfile.py b/recipes/taocpp-pegtl/2.x.x/conanfile.py new file mode 100644 index 0000000000000..76c67cc8e7e84 --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/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.50.0" + + +class TaoCPPPEGTLConan(ConanFile): + name = "taocpp-pegtl" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/pegtl" + description = "Parsing Expression Grammar Template Library" + topics = ("peg", "header-only", "cpp", + "parsing", "cpp17", "cpp11", "grammar") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "pegtl") + self.cpp_info.set_property("cmake_target_name", "taocpp::pegtl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "pegtl" + self.cpp_info.filenames["cmake_find_package_multi"] = "pegtl" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["_taocpp-pegtl"].names["cmake_find_package"] = "pegtl" + self.cpp_info.components["_taocpp-pegtl"].names["cmake_find_package_multi"] = "pegtl" + self.cpp_info.components["_taocpp-pegtl"].set_property("cmake_target_name", "taocpp::pegtl") diff --git a/recipes/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt b/recipes/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..70714c11e2405 --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(pegtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} taocpp::pegtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/taocpp-pegtl/2.x.x/test_package/conanfile.py b/recipes/taocpp-pegtl/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/taocpp-pegtl/2.x.x/test_package/test_package.cpp b/recipes/taocpp-pegtl/2.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..b57c55b1b0335 --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include +#include + +namespace gr { + using namespace tao::pegtl; + + struct C; + struct B : seq< one< '(' >, C, one< '|' >, C, one< ')' > > {}; + struct H : seq< one< '|' >, C > {}; + struct C : seq< sor< B, plus< range< '1','2' > > >, star< H > > {}; +} + +int main() { + std::string content = "(1|2)"; + tao::pegtl::string_input<> in( content, "from_content" ); + tao::pegtl::parse< gr::C, tao::pegtl::nothing, tao::pegtl::tracer >( in ); + return 0; +} diff --git a/recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt b/recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..799649d28d583 --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py b/recipes/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/taocpp-pegtl/3.x.x/conandata.yml b/recipes/taocpp-pegtl/3.x.x/conandata.yml new file mode 100644 index 0000000000000..95cbe48c372b0 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.2.7": + url: "https://github.com/taocpp/PEGTL/archive/3.2.7.tar.gz" + sha256: "d6cd113d8bd14e98bcbe7b7f8fc1e1e33448dc359e8cd4cca30e034ec2f0642d" + "3.2.6": + url: "https://github.com/taocpp/PEGTL/archive/refs/tags/3.2.6.tar.gz" + sha256: "0ad229e47e5e865c90788bb9865447804c72dcb171b7402f6f0fe8c78f3b2035" + "3.2.5": + url: "https://github.com/taocpp/PEGTL/archive/refs/tags/3.2.5.tar.gz" + sha256: "4ecefe4151b14684a944dde57e68c98e00224e5fea055c263e1bfbed24a99827" + "3.2.1": + url: "https://github.com/taocpp/PEGTL/archive/3.2.1.tar.gz" + sha256: "af33818352bc0b73c66aa9bc037735ce43d471533f1078ee828ba7e09962847d" + "3.2.0": + url: "https://github.com/taocpp/PEGTL/archive/3.2.0.tar.gz" + sha256: "3816d1a26afc04513df172678444377e0e35b9473f1f7ff85189589b831298f1" + "3.1.0": + url: "https://github.com/taocpp/PEGTL/archive/3.1.0.tar.gz" + sha256: "591685fa4a0dc99869688a7bd01c84d750bee180dd3625a91f84e2c7b0486059" + "3.0.0": + url: "https://github.com/taocpp/PEGTL/archive/3.0.0.tar.gz" + sha256: "b47af025450f5c12251cd831f90deab666e18a8029f3dbffb32672b0450af902" diff --git a/recipes/taocpp-pegtl/3.x.x/conanfile.py b/recipes/taocpp-pegtl/3.x.x/conanfile.py new file mode 100644 index 0000000000000..367752744a1f1 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class TaoCPPPEGTLConan(ConanFile): + name = "taocpp-pegtl" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/pegtl" + description = "Parsing Expression Grammar Template Library" + topics = ("peg", "header-only", "cpp", + "parsing", "cpp17", "cpp11", "grammar") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + options = { + "boost_filesystem": [True, False], + } + default_options = { + "boost_filesystem": False, + } + + def requirements(self): + if self.options.boost_filesystem: + self.requires("boost/1.78.0") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7" if self.options.boost_filesystem else "8", + "Visual Studio": "15.7", + "clang": "6.0", + "apple-clang": "10", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration(f"{self.ref} requires C++17, which your compiler does not support.") + + compiler_version = Version(self.settings.compiler.version) + if self.version == "3.0.0" and self.settings.compiler == "clang" and \ + compiler_version >= "10" and compiler_version < "12": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support filesystem experimental") + + if self.options.boost_filesystem and (self.dependencies["boost"].options.header_only or self.dependencies["boost"].options.without_filesystem): + raise ConanInvalidConfiguration("{self.ref} requires non header-only boost with filesystem component") + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "pegtl") + self.cpp_info.set_property("cmake_target_name", "taocpp::pegtl") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + if self.options.boost_filesystem: + self.cpp_info.components["_taocpp-pegtl"].requires.append("boost::filesystem") + self.cpp_info.components["_taocpp-pegtl"].defines.append("TAO_PEGTL_BOOST_FILESYSTEM") + else: + compiler_version = Version(self.settings.compiler.version) + if self.settings.compiler == "clang" and compiler_version >= "10" and compiler_version < "12": + self.cpp_info.components["_taocpp-pegtl"].defines.append("TAO_PEGTL_STD_EXPERIMENTAL_FILESYSTEM") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "pegtl" + self.cpp_info.filenames["cmake_find_package_multi"] = "pegtl" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["_taocpp-pegtl"].names["cmake_find_package"] = "pegtl" + self.cpp_info.components["_taocpp-pegtl"].names["cmake_find_package_multi"] = "pegtl" + self.cpp_info.components["_taocpp-pegtl"].set_property("cmake_target_name", "taocpp::pegtl") diff --git a/recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt b/recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d60ca38b63f6 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(pegtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} taocpp::pegtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/taocpp-pegtl/3.x.x/test_package/conanfile.py b/recipes/taocpp-pegtl/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/taocpp-pegtl/3.x.x/test_package/test_package.cpp b/recipes/taocpp-pegtl/3.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..4ff0cd258e035 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/test_package/test_package.cpp @@ -0,0 +1,45 @@ +// Copyright (c) 2014-2020 Dr. Colin Hirsch and Daniel Frey +// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ + +#include +#include + +#include + +namespace pegtl = TAO_PEGTL_NAMESPACE; + +namespace hello +{ + // clang-format off + struct prefix : pegtl::string< 'H', 'e', 'l', 'l', 'o', ',', ' ' > {}; + struct name : pegtl::plus< pegtl::alpha > {}; + struct grammar : pegtl::must< prefix, name, pegtl::one< '!' >, pegtl::eof > {}; + // clang-format on + + template< typename Rule > + struct action + {}; + + template<> + struct action< name > + { + template< typename ActionInput > + static void apply( const ActionInput& in, std::string& v ) + { + v = in.string(); + } + }; + +} // namespace hello + +int main( int argc, char** argv ) // NOLINT(bugprone-exception-escape) +{ + if( argc > 1 ) { + std::string name; + + pegtl::argv_input in( argv, 1 ); + pegtl::parse< hello::grammar, hello::action >( in, name ); + + std::cout << "Good bye, " << name << "!" << std::endl; + } +} diff --git a/recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt b/recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..799649d28d583 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py b/recipes/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/taocpp-pegtl/config.yml b/recipes/taocpp-pegtl/config.yml new file mode 100644 index 0000000000000..768412ab23d94 --- /dev/null +++ b/recipes/taocpp-pegtl/config.yml @@ -0,0 +1,21 @@ +versions: + "3.2.7": + folder: "3.x.x" + "3.2.6": + folder: "3.x.x" + "3.2.5": + folder: "3.x.x" + "3.2.1": + folder: "3.x.x" + "3.2.0": + folder: "3.x.x" + "3.1.0": + folder: "3.x.x" + "3.0.0": + folder: "3.x.x" + "2.8.3": + folder: "2.x.x" + "2.8.2": + folder: "2.x.x" + "2.8.1": + folder: "2.x.x" diff --git a/recipes/taocpp-sequences/all/conandata.yml b/recipes/taocpp-sequences/all/conandata.yml new file mode 100644 index 0000000000000..b41fd5a9d90c5 --- /dev/null +++ b/recipes/taocpp-sequences/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.1": + sha256: 6e37fdf7cda28678a61dfe55ec263aa2460b2f7383766b57f79a5636fb1495ad + url: https://github.com/taocpp/sequences/archive/2.0.1.tar.gz diff --git a/recipes/taocpp-sequences/all/conanfile.py b/recipes/taocpp-sequences/all/conanfile.py new file mode 100644 index 0000000000000..8ca3b5e55b754 --- /dev/null +++ b/recipes/taocpp-sequences/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TaoCPPSequencesonan(ConanFile): + name = "taocpp-sequences" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/sequences" + description = "Variadic templates and std::integer_sequence support library" + topics = ("variadic-template", "template", "interger-sequence") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + 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], + destination=self.source_folder, 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, "*", 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_file_name", "taocpp-sequences") + self.cpp_info.set_property("cmake_target_name", "taocpp::sequences") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "taocpp-sequences" + self.cpp_info.filenames["cmake_find_package_multi"] = "taocpp-sequences" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["_taocpp-sequences"].names["cmake_find_package"] = "sequences" + self.cpp_info.components["_taocpp-sequences"].names["cmake_find_package_multi"] = "sequences" + self.cpp_info.components["_taocpp-sequences"].set_property("cmake_target_name", "taocpp::sequences") + self.cpp_info.components["_taocpp-sequences"].bindirs = [] + self.cpp_info.components["_taocpp-sequences"].libdirs = [] diff --git a/recipes/taocpp-sequences/all/test_package/CMakeLists.txt b/recipes/taocpp-sequences/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4333a397a88de --- /dev/null +++ b/recipes/taocpp-sequences/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(taocpp-sequences REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taocpp::sequences) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/taocpp-sequences/all/test_package/conanfile.py b/recipes/taocpp-sequences/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/taocpp-sequences/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/taocpp-sequences/all/test_package/test_package.cpp b/recipes/taocpp-sequences/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bc3e0a89ba416 --- /dev/null +++ b/recipes/taocpp-sequences/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2015-2020 Daniel Frey +// Please see LICENSE for license or visit https://github.com/taocpp/sequences/ + +#include +#include +#include + +int main() { + static_assert( tao::seq::min< int, 1 >::value == 1, "oops" ); + static_assert( tao::seq::min< int, 1, 0 >::value == 0, "oops" ); + static_assert( tao::seq::min< int, 0, 1 >::value == 0, "oops" ); + static_assert( tao::seq::min< int, 1, -1 >::value == -1, "oops" ); + static_assert( tao::seq::min< int, -1, 1 >::value == -1, "oops" ); + static_assert( tao::seq::min< int, -1, 1, 2 >::value == -1, "oops" ); + static_assert( tao::seq::min< int, -1, 2, 1 >::value == -1, "oops" ); + static_assert( tao::seq::min< int, 2, -1, 1 >::value == -1, "oops" ); + static_assert( tao::seq::min< int, 0, 1, 2, -1, 1, 0, -1, 1 >::value == -1, "oops" ); + static_assert( tao::seq::min< tao::seq::make_index_sequence< 10 > >::value == 0, "oops" ); + + return EXIT_SUCCESS; +} diff --git a/recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/taocpp-sequences/all/test_v1_package/conanfile.py b/recipes/taocpp-sequences/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/taocpp-sequences/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/taocpp-sequences/config.yml b/recipes/taocpp-sequences/config.yml new file mode 100644 index 0000000000000..bb7eb85dfac49 --- /dev/null +++ b/recipes/taocpp-sequences/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.1": + folder: all diff --git a/recipes/taocpp-taopq/all/conandata.yml b/recipes/taocpp-taopq/all/conandata.yml new file mode 100644 index 0000000000000..b825cbd0e993f --- /dev/null +++ b/recipes/taocpp-taopq/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210727": + url: "https://github.com/taocpp/taopq/archive/3212b6eb74637277b40095d2ab2db872a76c6d9f.tar.gz" + sha256: "7d5b801984f71140a8579989e29b746d56167eccb710d821b2336eac723b51a3" + "cci.20200222": + url: "https://github.com/taocpp/taopq/archive/b7f66c8dbe993cba250c8e9f0878128b1ad74ff9.tar.gz" + sha256: "d10d29dace4d752484c3174bf07903b471c8746d06e9ca0e3e85c4bed676edaa" diff --git a/recipes/taocpp-taopq/all/conanfile.py b/recipes/taocpp-taopq/all/conanfile.py new file mode 100644 index 0000000000000..4cf5de4b29231 --- /dev/null +++ b/recipes/taocpp-taopq/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 get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class TaoCPPTaopqConan(ConanFile): + name = "taocpp-taopq" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/taopq" + description = "C++ client library for PostgreSQL" + topics = ("cpp17", "postgresql", "libpq", "data-base", "sql") + + settings = "os", "arch", "build_type", "compiler" + 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", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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("libpq/14.5") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TAOPQ_BUILD_TESTS"] = False + tc.variables["TAOPQ_INSTALL_DOC_DIR"] = "licenses" + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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", "taopq") + self.cpp_info.set_property("cmake_target_name", "taocpp::taopq") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_taocpp-taopq"].libs = ["taopq"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_taocpp-taopq"].system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.components["_taocpp-taopq"].system_libs.append("ws2_32") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "taopq" + self.cpp_info.filenames["cmake_find_package_multi"] = "taopq" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["_taocpp-taopq"].names["cmake_find_package"] = "taopq" + self.cpp_info.components["_taocpp-taopq"].names["cmake_find_package_multi"] = "taopq" + self.cpp_info.components["_taocpp-taopq"].set_property("cmake_target_name", "taocpp::taopq") + self.cpp_info.components["_taocpp-taopq"].requires = ["libpq::libpq"] diff --git a/recipes/taocpp-taopq/all/test_package/CMakeLists.txt b/recipes/taocpp-taopq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e73a15321e7c --- /dev/null +++ b/recipes/taocpp-taopq/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(taopq REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taocpp::taopq) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/taocpp-taopq/all/test_package/conanfile.py b/recipes/taocpp-taopq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/taocpp-taopq/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/taocpp-taopq/all/test_package/test_package.cpp b/recipes/taocpp-taopq/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6bc769fa18bb3 --- /dev/null +++ b/recipes/taocpp-taopq/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +// The Art of C++ / taopq +// Copyright (c) 2016-2020 Daniel Frey + +#include +#include +#include + +#include + +int main() +{ + try { + const std::string dbname = ::getenv( "TAOPQ_TEST_DATABASE" ) ? ::getenv( "TAOPQ_TEST_DATABASE" ) : "dbname=template1"; + const auto connection = tao::pq::connection::create( dbname ); + connection->execute( "DROP TABLE IF EXISTS taopq_conan_test" ); + connection->execute( "CREATE TABLE taopq_conan_test ( a INTEGER PRIMARY KEY )" ); + } + catch( const std::runtime_error& error ) { + // ignore connection fault + std::cerr << error.what() << std::endl; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/taocpp-taopq/all/test_v1_package/conanfile.py b/recipes/taocpp-taopq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/taocpp-taopq/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/taocpp-taopq/config.yml b/recipes/taocpp-taopq/config.yml new file mode 100644 index 0000000000000..73c3d88a4e083 --- /dev/null +++ b/recipes/taocpp-taopq/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210727": + folder: all + "cci.20200222": + folder: all diff --git a/recipes/taocpp-tuple/all/conandata.yml b/recipes/taocpp-tuple/all/conandata.yml new file mode 100644 index 0000000000000..67cc81cca6f83 --- /dev/null +++ b/recipes/taocpp-tuple/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + sha256: a35de253039fa1095244c2cc399458975a87b7f835e4d841fc10e8c8c14cc9dc + url: https://github.com/taocpp/tuple/archive/1.0.0.tar.gz diff --git a/recipes/taocpp-tuple/all/conanfile.py b/recipes/taocpp-tuple/all/conanfile.py new file mode 100644 index 0000000000000..2fbdbdde10935 --- /dev/null +++ b/recipes/taocpp-tuple/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TaoCPPTupleConan(ConanFile): + name = "taocpp-tuple" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taocpp/tuple" + description = "Compile-time-efficient proof-of-concept implementation for std::tuple" + topics = ("template", "cpp11", "tuple") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + 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], + destination=self.source_folder, 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, "*", 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_file_name", "taocpp-tuple") + self.cpp_info.set_property("cmake_target_name", "taocpp::tuple") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "taocpp-tuple" + self.cpp_info.filenames["cmake_find_package_multi"] = "taocpp-tuple" + self.cpp_info.names["cmake_find_package"] = "taocpp" + self.cpp_info.names["cmake_find_package_multi"] = "taocpp" + self.cpp_info.components["_taocpp-tuple"].names["cmake_find_package"] = "tuple" + self.cpp_info.components["_taocpp-tuple"].names["cmake_find_package_multi"] = "tuple" + self.cpp_info.components["_taocpp-tuple"].set_property("cmake_target_name", "taocpp::tuple") + self.cpp_info.components["_taocpp-tuple"].bindirs = [] + self.cpp_info.components["_taocpp-tuple"].libdirs = [] diff --git a/recipes/taocpp-tuple/all/test_package/CMakeLists.txt b/recipes/taocpp-tuple/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7758d52fe5e89 --- /dev/null +++ b/recipes/taocpp-tuple/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(taocpp-tuple REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taocpp::tuple) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/taocpp-tuple/all/test_package/conanfile.py b/recipes/taocpp-tuple/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/taocpp-tuple/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/taocpp-tuple/all/test_package/test_package.cpp b/recipes/taocpp-tuple/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4b7d9bbe4e74d --- /dev/null +++ b/recipes/taocpp-tuple/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2015-2020 Daniel Frey +// Please see LICENSE for license or visit https://github.com/taocpp/tuple/ + +#include + +#include +#include + +int main() { + auto t = tao::tuple< int, double, int >(); + auto t2 = tao::tuple< int, double, int >( 1, 2, 3 ); + auto t3( t2 ); + + auto t4 = tao::tuple< int, double, int >( 1, 2, 2 ); + auto t5 = tao::tuple< int, double, int >( 1, 2, 4 ); + + static_assert( tao::tuple_size< decltype( t ) >::value == 3, "oops" ); + static_assert( tao::tuple_size< decltype( t2 ) >::value == 3, "oops" ); + static_assert( tao::tuple_size< decltype( t3 ) >::value == 3, "oops" ); + + return EXIT_SUCCESS; +} diff --git a/recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/taocpp-tuple/all/test_v1_package/conanfile.py b/recipes/taocpp-tuple/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/taocpp-tuple/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/taocpp-tuple/config.yml b/recipes/taocpp-tuple/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/taocpp-tuple/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/tar/all/conandata.yml b/recipes/tar/all/conandata.yml new file mode 100644 index 0000000000000..7df28f6d96e37 --- /dev/null +++ b/recipes/tar/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.32.90": + url: "https://alpha.gnu.org/gnu/tar/tar-1.32.90.tar.gz" + sha256: "641fe07b7403c8eb801e7bfb91d1b7e5800ab15df524e22e0b2e89501280b6d7" diff --git a/recipes/tar/all/conanfile.py b/recipes/tar/all/conanfile.py new file mode 100644 index 0000000000000..afe93c20c680f --- /dev/null +++ b/recipes/tar/all/conanfile.py @@ -0,0 +1,98 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class TarConan(ConanFile): + name = "tar" + description = "GNU Tar provides the ability to create tar archives, as well as various other kinds of manipulation." + topics = ("tar", "archive") + license = "GPL-3-or-later" + homepage = "https://www.gnu.org/software/tar/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("bzip2/1.0.8") + self.requires("lzip/1.21") + self.requires("xz_utils/5.2.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 + if not self.options["bzip2"].build_executable: + raise ConanInvalidConfiguration("bzip2:build_executable must be enabled") + + def package_id(self): + del self.info.settings.compiler + + 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) + self._autotools.libs = [] + bzip2_exe = "bzip2" # FIXME: get from bzip2 recipe + lzip_exe = "lzip" # FIXME: get from lzip recipe + lzma_exe = "lzma" # FIXME: get from xz_utils recipe + xz_exe = "xz" # FIXME: get from xz_utils recipe + args = [ + "--disable-acl", + "--disable-nls", + "--disable-rpath", + # "--without-gzip", # FIXME: this will use system gzip + "--without-posix-acls", + "--without-selinux", + "--with-bzip2={}".format(bzip2_exe), + "--with-lzip={}".format(lzip_exe), + "--with-lzma={}".format(lzma_exe), + # "--without-lzop", # FIXME: this will use sytem lzop + "--with-xz={}".format(xz_exe), + # "--without-zstd", # FIXME: this will use system zstd (current zstd recipe does not build programs) + ] + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if self.settings.compiler == "Visual Studio": + tools.replace_in_file(os.path.join(self._source_subfolder, "gnu", "faccessat.c"), + "_GL_INCLUDING_UNISTD_H", "_GL_INCLUDING_UNISTD_H_NOP") + autotools = self._configure_autotools() + 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(self.package_folder, "share")) + + def package_info(self): + 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) + + tar_bin = os.path.join(self.package_folder, "bin", "tar") + self.user_info.tar = tar_bin + self.env_info.TAR = tar_bin diff --git a/recipes/tar/all/test_package/conanfile.py b/recipes/tar/all/test_package/conanfile.py new file mode 100644 index 0000000000000..68b1151321a11 --- /dev/null +++ b/recipes/tar/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + tar_bin = self.deps_user_info["tar"].tar + if not tools.cross_building(self): + with tools.chdir(self.source_folder): + test_tar = os.path.join(self.build_folder, "test.tar.gz") + self.run("{} -czf {} conanfile.py".format(tar_bin, test_tar), run_environment=True) + assert os.path.isfile("test.tar.gz") + self.run("{} -tf test.tar.gz".format(tar_bin), run_environment=True) + self.run("{} -xf test.tar.gz".format(tar_bin), run_environment=True) + assert tools.load(os.path.join(self.source_folder, "conanfile.py")) == tools.load(os.path.join(self.build_folder, "conanfile.py")) diff --git a/recipes/tar/config.yml b/recipes/tar/config.yml new file mode 100644 index 0000000000000..b21f806d0621e --- /dev/null +++ b/recipes/tar/config.yml @@ -0,0 +1,3 @@ +versions: + "1.32.90": + folder: "all" diff --git a/recipes/taskflow/all/conandata.yml b/recipes/taskflow/all/conandata.yml new file mode 100644 index 0000000000000..d4e7661550418 --- /dev/null +++ b/recipes/taskflow/all/conandata.yml @@ -0,0 +1,36 @@ +sources: + "3.6.0": + url: "https://github.com/taskflow/taskflow/archive/v3.6.0.tar.gz" + sha256: "5a1cd9cf89f93a97fcace58fd73ed2fc8ee2053bcb43e047acb6bc121c3edf4c" + "3.5.0": + url: "https://github.com/taskflow/taskflow/archive/v3.5.0.tar.gz" + sha256: "33c44e0da7dfda694d2b431724d6c8fd25a889ad0afbb4a32e8da82e2e9c2a92" + "3.4.0": + url: "https://github.com/taskflow/taskflow/archive/v3.4.0.tar.gz" + sha256: "8f449137d3f642b43e905aeacdf1d7c5365037d5e1586103ed4f459f87cecf89" + "3.3.0": + url: "https://github.com/taskflow/taskflow/archive/v3.3.0.tar.gz" + sha256: "66b891f706ba99a5ca5ed239d520ad6943ebe94728d1c89e07a939615a6488ef" + "3.2.0": + url: "https://github.com/taskflow/taskflow/archive/v3.2.0.tar.gz" + sha256: "26c37a494789fedc5de8d1f8452dc8a7774a220d02c14d5b19efe0dfe0359c0c" + "3.1.0": + url: "https://github.com/taskflow/taskflow/archive/v3.1.0.tar.gz" + sha256: "B83E9A78C254D831B8401D0F8A766E3C5B60D8D20BE5AF6E2D2FAD4AA4A8B980" + "3.0.0": + url: "https://github.com/taskflow/taskflow/archive/v3.0.0.tar.gz" + sha256: "553C88A6E56E115D29AC1520B8A0FEA4557A5FCDA1AF1427BD3BA454926D03A2" + "2.7.0": + url: "https://github.com/taskflow/taskflow/archive/v2.7.0.tar.gz" + sha256: "BC2227DCABEC86ABEBA1FEE56BB357D9D3C0EF0184F7C2275D7008E8758DFC3E" + "2.6.0": + url: "https://github.com/taskflow/taskflow/archive/v2.6.0.tar.gz" + sha256: "2F511F4291653D759AF12A7854BABCEBF57CFBB8B49BF6CD3EB0DD98A1A4039C" + "2.5.0": + url: "https://github.com/taskflow/taskflow/archive/v2.5.0.tar.gz" + sha256: "B7016EE3486458AE401D521EA6BC0403DDE975828038B9734621A6A325ACAC1A" +patches: + "3.3.0": + - patch_file: "patches/3.3.0-immintrin-guard.patch" + patch_description: "add condition to check IA architecture" + patch_type: "portability" diff --git a/recipes/taskflow/all/conanfile.py b/recipes/taskflow/all/conanfile.py new file mode 100644 index 0000000000000..7d914d16abb83 --- /dev/null +++ b/recipes/taskflow/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class TaskflowConan(ConanFile): + name = "taskflow" + description = ( + "A fast C++ header-only library to help you quickly write parallel " + "programs with complex task dependencies." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/taskflow/taskflow" + topics = ("tasking", "parallelism", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + short_paths = True + + @property + def _min_cppstd(self): + if Version(self.version) >= "3.0.0": + return "17" + return "14" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "Visual Studio": "16", + "gcc": "7.3", + "clang": "6.0", + "apple-clang": "10.0", + }, + "14": { + "Visual Studio": "15", + "gcc": "5", + "clang": "4.0", + "apple-clang": "8.0", + }, + }[self._min_cppstd] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", + src=os.path.join(self.source_folder, "taskflow"), + dst=os.path.join(self.package_folder, "include", "taskflow")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Taskflow") + self.cpp_info.set_property("cmake_target_name", "Taskflow::Taskflow") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if is_msvc(self): + self.cpp_info.defines.append("_ENABLE_EXTENDED_ALIGNED_STORAGE") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Taskflow" + self.cpp_info.names["cmake_find_package_multi"] = "Taskflow" diff --git a/recipes/taskflow/all/patches/3.3.0-immintrin-guard.patch b/recipes/taskflow/all/patches/3.3.0-immintrin-guard.patch new file mode 100644 index 0000000000000..1ae17c551efb5 --- /dev/null +++ b/recipes/taskflow/all/patches/3.3.0-immintrin-guard.patch @@ -0,0 +1,18 @@ +diff --git a/taskflow/utility/os.hpp b/taskflow/utility/os.hpp +index b3e88d1..6a7facc 100644 +--- a/taskflow/utility/os.hpp ++++ b/taskflow/utility/os.hpp +@@ -118,10 +118,10 @@ + #define TF_CACHELINE_SIZE 64 + #endif + +-//----------------------------------------------------------------------------- ++//----------------------------------------------------------------------------- + // pause +-//----------------------------------------------------------------------------- +-#if __has_include () ++//----------------------------------------------------------------------------- ++#if (defined(__i386__) || defined(__x86_64__)) && __has_include () + #define TF_HAS_MM_PAUSE 1 + #include + #endif diff --git a/recipes/taskflow/all/test_package/CMakeLists.txt b/recipes/taskflow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1f7019bf5d65a --- /dev/null +++ b/recipes/taskflow/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Taskflow REQUIRED CONFIG) + +set(_CXX_STANDARD cxx_std_14) +if (Taskflow_VERSION GREATER_EQUAL "3.0.0") + set(_CXX_STANDARD cxx_std_17) +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE ${_CXX_STANDARD}) +target_link_libraries(${PROJECT_NAME} PRIVATE Taskflow::Taskflow) diff --git a/recipes/taskflow/all/test_package/conanfile.py b/recipes/taskflow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/taskflow/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/taskflow/all/test_package/test_package.cpp b/recipes/taskflow/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3b078cb358c93 --- /dev/null +++ b/recipes/taskflow/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +int main() +{ + tf::Executor executor; + tf::Taskflow taskflow; + + auto A = taskflow.emplace([](){ std::cout << "Task A\n"; }); + auto B = taskflow.emplace([](){ std::cout << "Task B\n"; }); + auto C = taskflow.emplace([](){ std::cout << "Task C\n"; }); + auto D = taskflow.emplace([](){ std::cout << "Task D\n"; }); + + // + // +---+ + // +---->| B |-----+ + // | +---+ | + // +---+ +-v-+ + // | A | | D | + A.precede(B); // B runs after A // +---+ +-^-+ + A.precede(C); // C runs after A // | +---+ | + B.precede(D); // D runs after B // +---->| C |-----+ + C.precede(D); // D runs after C // +---+ + + executor.run(taskflow).get(); + + return 0; +} diff --git a/recipes/taskflow/all/test_v1_package/CMakeLists.txt b/recipes/taskflow/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/taskflow/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/taskflow/all/test_v1_package/conanfile.py b/recipes/taskflow/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..94b8dc83beff4 --- /dev/null +++ b/recipes/taskflow/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools, CMake +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/taskflow/config.yml b/recipes/taskflow/config.yml new file mode 100644 index 0000000000000..36b5f1772375b --- /dev/null +++ b/recipes/taskflow/config.yml @@ -0,0 +1,21 @@ +versions: + "3.6.0": + folder: all + "3.5.0": + folder: all + "3.4.0": + folder: all + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all + "2.7.0": + folder: all + "2.6.0": + folder: all + "2.5.0": + folder: all diff --git a/recipes/taywee-args/all/conandata.yml b/recipes/taywee-args/all/conandata.yml new file mode 100644 index 0000000000000..c1b7579a8628c --- /dev/null +++ b/recipes/taywee-args/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "6.4.6": + url: "https://github.com/Taywee/args/archive/6.4.6.tar.gz" + sha256: "41ed136bf9b216bf5f18b1de2a8d22a870381657e8427d6621918520b6e2239c" + "6.4.4": + url: "https://github.com/Taywee/args/archive/6.4.4.tar.gz" + sha256: "7dca5e33148984cf701580324846c6557990a826bd1ab7a97ccdd6d0e486302f" + "6.4.2": + url: "https://github.com/Taywee/args/archive/6.4.2.tar.gz" + sha256: "882adaf179471edf0ac468bab67a0ee53979e4efe91fe4992d5b38422067dd85" + "6.4.1": + url: "https://github.com/Taywee/args/archive/6.4.1.tar.gz" + sha256: "9b3f78208c9cfb06ccbeb7c44903018c8b036b6592a2d9a7d8695d1944060b35" + "6.3.0": + url: "https://github.com/Taywee/args/archive/6.3.0.tar.gz" + sha256: "e072c4a9d6990872b0ecb45480a5487db82e0dc3d27c3c3eb9fc0930c0d796ae" + "6.2.7": + url: "https://github.com/Taywee/args/archive/6.2.7.tar.gz" + sha256: "3600e0a82a547d230d193683316c5cedfc9a59adf59ce89b3b5c95ce478a12b3" + "6.2.6": + url: "https://github.com/Taywee/args/archive/6.2.6.tar.gz" + sha256: "f0b2b41a0d06c4739abb6b62ccad0e655fe494d1de606688454ea397a3313d46" + "6.2.5": + url: "https://github.com/Taywee/args/archive/6.2.5.tar.gz" + sha256: "59ed8944c2ff0346e95a2fae55212137512559203b54fc4facbc99206a250500" + "6.2.4": + url: "https://github.com/Taywee/args/archive/6.2.4.tar.gz" + sha256: "308eb09a9656315b38c2d1f7526b22b42695b352da316fa4ac17a8b86cdd4663" + "6.2.3": + url: "https://github.com/Taywee/args/archive/6.2.3.tar.gz" + sha256: "c202d15fc4b30519a08bae7df9e6f4fdc40ac2434ba65d83a108ebbf6e4822c2" diff --git a/recipes/taywee-args/all/conanfile.py b/recipes/taywee-args/all/conanfile.py new file mode 100644 index 0000000000000..3576424832869 --- /dev/null +++ b/recipes/taywee-args/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TayweeArgsConan(ConanFile): + name = "taywee-args" + description = "A simple, small, flexible, single-header C++11 argument parsing library" + topics = ("args", "argument-parser", "header-only") + license = "MIT" + homepage = "https://github.com/Taywee/args" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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, "args.hxx", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "args") + self.cpp_info.set_property("cmake_target_name", "taywee::args") + self.cpp_info.set_property("pkg_config_name", "args") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "args" + self.cpp_info.filenames["cmake_find_package_multi"] = "args" + self.cpp_info.names["cmake_find_package"] = "taywee" + self.cpp_info.names["cmake_find_package_multi"] = "taywee" + self.cpp_info.components["libargs"].names["cmake_find_package"] = "args" + self.cpp_info.components["libargs"].names["cmake_find_package_multi"] = "args" + self.cpp_info.components["libargs"].set_property("cmake_target_name", "taywee::args") + self.cpp_info.components["libargs"].set_property("pkg_config_name", "args") + self.cpp_info.components["libargs"].bindirs = [] + self.cpp_info.components["libargs"].libdirs = [] diff --git a/recipes/taywee-args/all/test_package/CMakeLists.txt b/recipes/taywee-args/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0a8e53f1264f3 --- /dev/null +++ b/recipes/taywee-args/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(args REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE taywee::args) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/taywee-args/all/test_package/conanfile.py b/recipes/taywee-args/all/test_package/conanfile.py new file mode 100644 index 0000000000000..44f49e453b57c --- /dev/null +++ b/recipes/taywee-args/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(f"{bin_path} -h", env="conanrun") diff --git a/recipes/taywee-args/all/test_package/test_package.cpp b/recipes/taywee-args/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4f1e0c3b1f02d --- /dev/null +++ b/recipes/taywee-args/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include + +#include + +int main(int argc, char **argv) +{ + args::ArgumentParser parser("This is a test program.", "This goes after the options."); + args::HelpFlag help(parser, "help", "Display this help menu", {'h', "help"}); + args::CompletionFlag completion(parser, {"complete"}); + try + { + parser.ParseCLI(argc, argv); + } + catch (const args::Completion& e) + { + std::cout << e.what(); + return 0; + } + catch (const args::Help&) + { + std::cout << parser; + return 0; + } + catch (const args::ParseError& e) + { + std::cerr << e.what() << std::endl; + std::cerr << parser; + return 1; + } + return 0; +} diff --git a/recipes/taywee-args/all/test_v1_package/CMakeLists.txt b/recipes/taywee-args/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/taywee-args/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/taywee-args/all/test_v1_package/conanfile.py b/recipes/taywee-args/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3e9c09d77df0c --- /dev/null +++ b/recipes/taywee-args/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(f"{bin_path} -h", run_environment=True) diff --git a/recipes/taywee-args/config.yml b/recipes/taywee-args/config.yml new file mode 100644 index 0000000000000..49287304bfe93 --- /dev/null +++ b/recipes/taywee-args/config.yml @@ -0,0 +1,21 @@ +versions: + "6.4.6": + folder: all + "6.4.4": + folder: all + "6.4.2": + folder: all + "6.4.1": + folder: all + "6.3.0": + folder: all + "6.2.7": + folder: all + "6.2.6": + folder: all + "6.2.5": + folder: all + "6.2.4": + folder: all + "6.2.3": + folder: all diff --git a/recipes/tbb/all/conandata.yml b/recipes/tbb/all/conandata.yml new file mode 100644 index 0000000000000..de98a3aa2d71d --- /dev/null +++ b/recipes/tbb/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2020.3": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.3.tar.gz" + sha256: "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3" + "2020.2": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.2.tar.gz" + sha256: "4804320e1e6cbe3a5421997b52199e3c1a3829b2ecb6489641da4b8e32faf500" + "2020.1": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.1.tar.gz" + sha256: "7c96a150ed22bc3c6628bc3fef9ed475c00887b26d37bca61518d76a56510971" + "2020.0": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.0.tar.gz" + sha256: "57714f2d2cf33935db33cee93af57eb3ecd5a7bef40c1fb7ca4a41d79684b118" + "2019_u9": + url: "https://github.com/oneapi-src/oneTBB/archive/2019_U9.tar.gz" + sha256: "3f5ea81b9caa195f1967a599036b473b2e7c347117330cda99b79cfcf5b77c84" diff --git a/recipes/tbb/all/conanfile.py b/recipes/tbb/all/conanfile.py new file mode 100644 index 0000000000000..12a63359ae427 --- /dev/null +++ b/recipes/tbb/all/conanfile.py @@ -0,0 +1,275 @@ +from conan.tools.microsoft import msvc_runtime_flag +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration, ConanException +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class TBBConan(ConanFile): + deprecated = "onetbb" + + name = "tbb" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/oneapi-src/oneTBB" + description = ( + "Intel Threading Building Blocks (Intel TBB) lets you easily write " + "parallel C++ programs that take full advantage of multicore " + "performance, that are portable and composable, and that have " + "future-proof scalability" + ) + topics = ("tbb", "threading", "parallelism", "tbbmalloc") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tbbmalloc": [True, False], + "tbbproxy": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "tbbmalloc": False, + "tbbproxy": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + @property + def _is_clanglc(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + @property + def _base_compiler(self): + base = self.settings.get_safe("compiler.base") + if base: + return self.settings.compiler.base + return self.settings.compiler + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Macos": + if hasattr(self, "settings_build") and tools.cross_building(self): + # See logs from https://github.com/conan-io/conan-center-index/pull/8454 + raise ConanInvalidConfiguration("Cross building on Macos is not yet supported. Contributions are welcome") + if self.settings.compiler == "apple-clang" and tools.Version(self.settings.compiler.version) < "8.0": + raise ConanInvalidConfiguration("%s %s couldn't be built by apple-clang < 8.0" % (self.name, self.version)) + if not self.options.shared: + self.output.warn("Intel-TBB strongly discourages usage of static linkage") + if self.options.tbbproxy and \ + (not self.options.shared or \ + not self.options.tbbmalloc): + raise ConanInvalidConfiguration("tbbproxy needs tbbmaloc and shared options") + + def package_id(self): + del self.info.options.tbbmalloc + del self.info.options.tbbproxy + + def build_requirements(self): + if self._settings_build.os == "Windows": + if "CONAN_MAKE_PROGRAM" not in os.environ and not tools.which("make"): + self.build_requires("make/4.2.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def build(self): + def add_flag(name, value): + if name in os.environ: + os.environ[name] += " " + value + else: + os.environ[name] = value + + # Get the version of the current compiler instead of gcc + linux_include = os.path.join(self._source_subfolder, "build", "linux.inc") + tools.replace_in_file(linux_include, "shell gcc", "shell $(CC)") + tools.replace_in_file(linux_include, "= gcc", "= $(CC)") + + if self.version != "2019_u9" and self.settings.build_type == "Debug": + tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile"), "release", "debug") + + if str(self._base_compiler) in ["Visual Studio", "msvc"]: + tools.save( + os.path.join(self._source_subfolder, "build", "big_iron_msvc.inc"), + # copy of big_iron.inc adapted for MSVC + textwrap.dedent("""\ + LIB_LINK_CMD = {}.exe + LIB_OUTPUT_KEY = /OUT: + LIB_LINK_FLAGS = + LIB_LINK_LIBS = + DYLIB_KEY = + override CXXFLAGS += -D__TBB_DYNAMIC_LOAD_ENABLED=0 -D__TBB_SOURCE_DIRECTLY_INCLUDED=1 + ITT_NOTIFY = + DLL = lib + LIBEXT = lib + LIBPREF = + LIBDL = + TBB.DLL = $(LIBPREF)tbb$(DEBUG_SUFFIX).$(LIBEXT) + LINK_TBB.LIB = $(TBB.DLL) + TBB.DEF = + TBB_NO_VERSION.DLL = + MALLOC.DLL = $(LIBPREF)tbbmalloc$(DEBUG_SUFFIX).$(LIBEXT) + LINK_MALLOC.LIB = $(MALLOC.DLL) + MALLOC.DEF = + MALLOC_NO_VERSION.DLL = + MALLOCPROXY.DLL = + MALLOCPROXY.DEF = + """.format("xilib" if self.settings.compiler == "intel" else "lib")) + ) + extra = "" if self.options.shared else "extra_inc=big_iron_msvc.inc" + else: + extra = "" if self.options.shared else "extra_inc=big_iron.inc" + + arch = { + "x86": "ia32", + "x86_64": "intel64", + "armv7": "armv7", + "armv8": "aarch64", + }[str(self.settings.arch)] + extra += " arch=%s" % arch + + if str(self._base_compiler) in ("gcc", "clang", "apple-clang"): + if str(self._base_compiler.libcxx) in ("libstdc++", "libstdc++11"): + extra += " stdlib=libstdc++" + elif str(self._base_compiler.libcxx) == "libc++": + extra += " stdlib=libc++" + + if str(self.settings.compiler) == "intel": + extra += " compiler=icc" + elif str(self.settings.compiler) in ("clang", "apple-clang"): + extra += " compiler=clang" + else: + extra += " compiler=gcc" + + if self.settings.os == "Linux": + # runtime is supposed to track the version of the c++ stdlib, + # the version of glibc, and the version of the linux kernel. + # However, it isn't actually used anywhere other than for + # logging and build directory names. + # TBB computes the value of this variable using gcc, which we + # don't necessarily want to require when building this recipe. + # Setting it to a dummy value prevents TBB from calling gcc. + extra += " runtime=gnu" + elif str(self._base_compiler) in ["Visual Studio", "msvc"]: + if "MT" in msvc_runtime_flag(self): + runtime = "vc_mt" + else: + if self.settings.compiler == "Visual Studio": + runtime = { + "8": "vc8", + "9": "vc9", + "10": "vc10", + "11": "vc11", + "12": "vc12", + "14": "vc14", + "15": "vc14.1", + "16": "vc14.2" + }.get(str(self._base_compiler.version), "vc14.2") + else: + runtime = { + "190": "vc14", + "191": "vc14.1", + "192": "vc14.2" + }.get(str(self._base_compiler.version), "vc14.2") + extra += " runtime=%s" % runtime + + if self.settings.compiler == "intel": + extra += " compiler=icl" + else: + extra += " compiler=cl" + + make = tools.get_env("CONAN_MAKE_PROGRAM", tools.which("make") or tools.which("mingw32-make")) + if not make: + raise ConanException("This package needs 'make' in the path to build") + + with tools.chdir(self._source_subfolder): + # intentionally not using AutoToolsBuildEnvironment for now - it's broken for clang-cl + if self._is_clanglc: + add_flag("CFLAGS", "-mrtm") + add_flag("CXXFLAGS", "-mrtm") + + targets = ["tbb", "tbbmalloc", "tbbproxy"] + context = tools.no_op() + if self.settings.compiler == "intel": + context = tools.intel_compilervars(self) + elif self._is_msvc: + # intentionally not using vcvars for clang-cl yet + context = tools.vcvars(self) + with context: + self.run("%s %s %s" % (make, extra, " ".join(targets))) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.h", dst="include", src="%s/include" % self._source_subfolder) + self.copy(pattern="*", dst="include/tbb/compat", src="%s/include/tbb/compat" % self._source_subfolder) + build_folder = "%s/build/" % self._source_subfolder + build_type = "debug" if self.settings.build_type == "Debug" else "release" + self.copy(pattern="*%s*.lib" % build_type, dst="lib", src=build_folder, keep_path=False) + self.copy(pattern="*%s*.a" % build_type, dst="lib", src=build_folder, keep_path=False) + self.copy(pattern="*%s*.dll" % build_type, dst="bin", src=build_folder, keep_path=False) + self.copy(pattern="*%s*.dylib" % build_type, dst="lib", src=build_folder, keep_path=False) + # Copy also .dlls to lib folder so consumers can link against them directly when using MinGW + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + self.copy("*%s*.dll" % build_type, dst="lib", src=build_folder, keep_path=False) + + if self.settings.os == "Linux": + extension = "so" + if self.options.shared: + self.copy("*%s*.%s.*" % (build_type, extension), "lib", build_folder, + keep_path=False) + outputlibdir = os.path.join(self.package_folder, "lib") + os.chdir(outputlibdir) + for fpath in os.listdir(outputlibdir): + self.run("ln -s \"%s\" \"%s\"" % + (fpath, fpath[0:fpath.rfind("." + extension) + len(extension) + 1])) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "TBB") + + suffix = "_debug" if self.settings.build_type == "Debug" else "" + + # tbb + self.cpp_info.components["libtbb"].set_property("cmake_target_name", "TBB::tbb") + self.cpp_info.components["libtbb"].libs = ["tbb{}".format(suffix)] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libtbb"].system_libs = ["dl", "rt", "pthread"] + + # tbbmalloc + if self.options.tbbmalloc: + self.cpp_info.components["tbbmalloc"].set_property("cmake_target_name", "TBB::tbbmalloc") + self.cpp_info.components["tbbmalloc"].libs = ["tbbmalloc{}".format(suffix)] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tbbmalloc"].system_libs = ["dl", "pthread"] + + # tbbmalloc_proxy + if self.options.tbbproxy: + self.cpp_info.components["tbbmalloc_proxy"].set_property("cmake_target_name", "TBB::tbbmalloc_proxy") + self.cpp_info.components["tbbmalloc_proxy"].libs = ["tbbmalloc_proxy{}".format(suffix)] + self.cpp_info.components["tbbmalloc_proxy"].requires = ["tbbmalloc"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "TBB" + self.cpp_info.names["cmake_find_package_multi"] = "TBB" + self.cpp_info.components["libtbb"].names["cmake_find_package"] = "tbb" + self.cpp_info.components["libtbb"].names["cmake_find_package_multi"] = "tbb" diff --git a/recipes/tbb/all/test_package/CMakeLists.txt b/recipes/tbb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5a40167452f4 --- /dev/null +++ b/recipes/tbb/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(TBB REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} TBB::tbb) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/tbb/all/test_package/conanfile.py b/recipes/tbb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tbb/all/test_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/tbb/all/test_package/test_package.cpp b/recipes/tbb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bdbc6a7923b4c --- /dev/null +++ b/recipes/tbb/all/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#include "tbb/task_group.h" +#include "tbb/flow_graph.h" +#include "tbb/compat/tuple" +#include + +using namespace tbb; +using namespace tbb::flow; + +int Fib(int n) { + if( n<2 ) { + return n; + } else { + int x, y; + task_group g; + g.run([&]{x=Fib(n-1);}); // spawn a task + g.run([&]{y=Fib(n-2);}); // spawn another task + g.wait(); // wait for both tasks to complete + return x+y; + } +} + +int main(){ + std::cout<<"Fib 6="< hello( g, + []( const continue_msg &) { + std::cout << "Hello"; + } + ); + continue_node< continue_msg> world( g, + []( const continue_msg &) { + std::cout << " World\n"; + } + ); + make_edge(hello, world); + hello.try_put(continue_msg()); + g.wait_for_all(); + return 0; +} diff --git a/recipes/tbb/config.yml b/recipes/tbb/config.yml new file mode 100644 index 0000000000000..3252e0ec85d9e --- /dev/null +++ b/recipes/tbb/config.yml @@ -0,0 +1,11 @@ +versions: + "2020.3": + folder: all + "2020.2": + folder: all + "2020.1": + folder: all + "2020.0": + folder: all + "2019_u9": + folder: all diff --git a/recipes/tcb-span/all/conandata.yml b/recipes/tcb-span/all/conandata.yml new file mode 100644 index 0000000000000..d9462a68d3339 --- /dev/null +++ b/recipes/tcb-span/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20220616": + url: "https://github.com/tcbrindle/span/archive/836dc6a0efd9849cb194e88e4aa2387436bb079b.tar.gz" + sha256: "66650479f85b92c6a6230706e4ac4a1bca18a7c7102fc7e02ad332f86548c9b6" + "cci.20200603": + url: "https://github.com/tcbrindle/span/archive/5d8d366eca918d0ed3d2d196cbeae6abfd874736.tar.gz" + sha256: "c294ec2314eeccbcfe12b549ca6c165fbe9f97d2d52a0ad4c9a28f73fa87861a" diff --git a/recipes/tcb-span/all/conanfile.py b/recipes/tcb-span/all/conanfile.py new file mode 100644 index 0000000000000..5edd705ca74ca --- /dev/null +++ b/recipes/tcb-span/all/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + +class TcbSpanConan(ConanFile): + name = "tcb-span" + description = "Implementation of C++20's std::span for older C++ standards" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tcbrindle/span" + topics = ("span", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, pattern="LICENSE*.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/tcb-span/all/test_package/CMakeLists.txt b/recipes/tcb-span/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..858448385983d --- /dev/null +++ b/recipes/tcb-span/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tcb-span REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE tcb-span::tcb-span) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tcb-span/all/test_package/conanfile.py b/recipes/tcb-span/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/tcb-span/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/tcb-span/all/test_package/test_package.cxx b/recipes/tcb-span/all/test_package/test_package.cxx new file mode 100644 index 0000000000000..2b8250b3cc650 --- /dev/null +++ b/recipes/tcb-span/all/test_package/test_package.cxx @@ -0,0 +1,22 @@ +#include + +#include +#include +#include +#include + +std::ptrdiff_t size(tcb::span s) +{ + return s.size(); +} + +int main(void) +{ + int carr[3] = {1, 3, 4}; + std::array cxxarr = {1, 2}; + + printf("C-array: %ti\n", size(carr)); + printf("array: %ti\n", size(cxxarr)); + + return 0; +} diff --git a/recipes/tcb-span/all/test_v1_package/CMakeLists.txt b/recipes/tcb-span/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6930ecd6ea58a --- /dev/null +++ b/recipes/tcb-span/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tcb-span REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE tcb-span::tcb-span) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tcb-span/all/test_v1_package/conanfile.py b/recipes/tcb-span/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/tcb-span/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tcb-span/config.yml b/recipes/tcb-span/config.yml new file mode 100644 index 0000000000000..eb7ad34aa4cc4 --- /dev/null +++ b/recipes/tcb-span/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20220616": + folder: all + "cci.20200603": + folder: all diff --git a/recipes/tcl/all/conandata.yml b/recipes/tcl/all/conandata.yml new file mode 100644 index 0000000000000..ddecf77805a4c --- /dev/null +++ b/recipes/tcl/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "8.6.11": + url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.11/tcl8.6.11-src.tar.gz" + sha256: "8c0486668586672c5693d7d95817cb05a18c5ecca2f40e2836b9578064088258" + "8.6.10": + url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.10/tcl8.6.10-src.tar.gz" + sha256: "5196dbf6638e3df8d5c87b5815c8c2b758496eb6f0e41446596c9a4e638d87ed" +patches: + "8.6.11": + - patch_file: "patches/0001-8.6.11-no-read-only-data.patch" + "8.6.10": + - patch_file: "patches/0001-8.6.10-no-read-only-data.patch" diff --git a/recipes/tcl/all/conanfile.py b/recipes/tcl/all/conanfile.py new file mode 100644 index 0000000000000..c81bc94de1c84 --- /dev/null +++ b/recipes/tcl/all/conanfile.py @@ -0,0 +1,251 @@ +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.files import apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, NMakeToolchain +import os + +required_conan_version = ">=1.54.0" + + +class TclConan(ConanFile): + name = "tcl" + description = "Tcl is a very powerful but easy to learn dynamic programming language." + license = "TCL" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tcl.tk" + topics = ("tcl", "scripting", "programming") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + # Not using basic_layout because package() needs the source folder to be a sub-directory of the build folder + self.folders.source = "src" + self.folders.generators = "conan" + + def requirements(self): + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self, prefix=self.package_folder) + def yes_no(v): return "yes" if v else "no" + tc.configure_args.extend([ + "--enable-threads", + "--enable-symbols={}".format(yes_no(self.settings.build_type == "Debug")), + "--enable-64bit={}".format(yes_no(self.settings.arch == "x86_64")), + ]) + tc.generate() + + def _get_default_build_system_subdir(self): + return { + "Macos": "macosx", + "Linux": "unix", + "Windows": "win", + }[str(self.settings.os)] + + def _get_configure_dir(self, build_system_subdir=None): + if build_system_subdir is None: + build_system_subdir = self._get_default_build_system_subdir() + return os.path.join(self.source_folder, build_system_subdir) + + def _patch_sources(self): + apply_conandata_patches(self) + + if is_apple_os(self) and self.settings.arch not in ("x86", "x86_64"): + replace_in_file(self, os.path.join(self._get_configure_dir(), "configure"), "#define HAVE_CPUID 1", "#undef HAVE_CPUID") + + unix_config_dir = self._get_configure_dir("unix") + # When disabling 64-bit support (in 32-bit), this test must be 0 in order to use "long long" for 64-bit ints + # (${tcl_type_64bit} can be either "__int64" or "long long") + replace_in_file(self, os.path.join(unix_config_dir, "configure"), + "(sizeof(${tcl_type_64bit})==sizeof(long))", + "(sizeof(${tcl_type_64bit})!=sizeof(long))") + + unix_makefile_in = os.path.join(unix_config_dir, "Makefile.in") + # Avoid building internal libraries as shared libraries + replace_in_file(self, unix_makefile_in, "--enable-shared --enable-threads", "--enable-threads") + # Avoid clearing CFLAGS and LDFLAGS in the makefile + replace_in_file(self, unix_makefile_in, "\nCFLAGS\t", "\n#CFLAGS\t") + replace_in_file(self, unix_makefile_in, "\nLDFLAGS\t", "\n#LDFLAGS\t") + # Use CFLAGS and CPPFLAGS as argument to CC + replace_in_file(self, unix_makefile_in, "${CFLAGS}", "${CFLAGS} ${CPPFLAGS}") + # nmake creates a temporary file with mixed forward/backward slashes + # force the filename to avoid cryptic error messages + win_config_dir = self._get_configure_dir("win") + win_makefile_vc = os.path.join(win_config_dir, "makefile.vc") + replace_in_file(self, win_makefile_vc, "@type << >$@", "type <$@") + + win_rules_vc = os.path.join(self.source_folder, "win", "rules.vc") + # do not treat nmake build warnings as errors + replace_in_file(self, win_rules_vc, "cwarn = $(cwarn) -WX", "") + # disable whole program optimization to be portable across different MSVC versions. + # See conan-io/conan-center-index#4811 conan-io/conan-center-index#4094 + replace_in_file(self, + win_rules_vc, + "OPTIMIZATIONS = $(OPTIMIZATIONS) -GL", + "") + + def _build_nmake(self, targets): + opts = [] + # https://core.tcl.tk/tips/doc/trunk/tip/477.md + if not self.options.shared: + opts.append("static") + if self.settings.build_type == "Debug": + opts.append("symbols") + if is_msvc_static_runtime(self): + opts.append("nomsvcrt") + else: + opts.append("msvcrt") + if "d" not in msvc_runtime_flag(self): + opts.append("unchecked") + + with chdir(self, self._get_configure_dir("win")): + self.run('nmake -nologo -f "{cfgdir}/makefile.vc" INSTALLDIR="{pkgdir}" OPTS={opts} {targets}'.format( + cfgdir=self._get_configure_dir("win"), + pkgdir=self.package_folder, + opts=",".join(opts), + targets=" ".join(targets), + )) + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_nmake(["release"]) + else: + autotools = Autotools(self) + autotools.configure(self._get_configure_dir()) + + # https://core.tcl.tk/tcl/tktview/840660e5a1 + for root, _, list_of_files in os.walk(self.build_folder): + if "Makefile" in list_of_files: + replace_in_file(self, os.path.join(root, "Makefile"), "-Dstrtod=fixstrtod", "", strict=False) + + def package(self): + copy(self, "license.terms", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + self._build_nmake(["install-binaries", "install-libraries"]) + else: + autotools = Autotools(self) + autotools.make(target="install") + autotools.make(target="install-private-headers") + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "man")) + rmdir(self, os.path.join(self.package_folder, "share")) + + tclConfigShPath = os.path.join(self.package_folder, "lib", "tclConfig.sh") + package_path = self.package_folder + build_folder = self.build_folder + if self.settings.os == "Windows" and not is_msvc(self): + package_path = package_path.replace("\\", "/") + drive, path = os.path.splitdrive(self.build_folder) + build_folder = "".join([drive, path.lower().replace("\\", "/")]) + + replace_in_file(self, tclConfigShPath, + package_path, + "${TCL_ROOT}") + replace_in_file(self, tclConfigShPath, + build_folder, + "${TCL_BUILD_ROOT}") + + replace_in_file(self, tclConfigShPath, + "\nTCL_BUILD_", + "\n#TCL_BUILD_") + replace_in_file(self, tclConfigShPath, + "\nTCL_SRC_DIR", + "\n#TCL_SRC_DIR") + + #fix_apple_shared_install_name(self) + + def package_info(self): + libs = [] + systemlibs = [] + libdirs = [] + for root, _, _ in os.walk(os.path.join(self.package_folder, "lib"), topdown=False): + newlibs = collect_libs(self, root) + if newlibs: + libs.extend(newlibs) + libdirs.append(root) + if self.settings.os == "Windows": + systemlibs.extend(["ws2_32", "netapi32", "userenv"]) + elif self.settings.os in ("FreeBSD", "Linux"): + systemlibs.extend(["dl", "m", "pthread"]) + + defines = [] + if not self.options.shared: + defines.append("STATIC_BUILD") + self.cpp_info.defines = defines + + self.cpp_info.libdirs = libdirs + self.cpp_info.libs = libs + self.cpp_info.system_libs = systemlibs + self.cpp_info.set_property("cmake_file_name", "TCL") + self.cpp_info.names["cmake_find_package"] = "TCL" + self.cpp_info.names["cmake_find_package_multi"] = "TCL" + + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreFoundation"] + self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags + + tcl_library = os.path.join(self.package_folder, "lib", "{}{}".format(self.name, ".".join(self.version.split(".")[:2]))) + self.output.info("Setting TCL_LIBRARY environment variable to {}".format(tcl_library)) + self.runenv_info.define_path('TCL_LIBRARY', tcl_library) + self.env_info.TCL_LIBRARY = tcl_library + + tcl_root = self.package_folder + self.output.info("Setting TCL_ROOT environment variable to {}".format(tcl_root)) + self.runenv_info.define_path('TCL_ROOT', tcl_root) + self.env_info.TCL_ROOT = tcl_root + + tclsh_list = list(filter(lambda fn: fn.startswith("tclsh"), os.listdir(os.path.join(self.package_folder, "bin")))) + tclsh = os.path.join(self.package_folder, "bin", tclsh_list[0]) + self.output.info("Setting TCLSH environment variable to {}".format(tclsh)) + self.runenv_info.define_path('TCLSH', tclsh) + self.env_info.TCLSH = tclsh + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Adding PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/tcl/all/patches/0001-8.6.10-no-read-only-data.patch b/recipes/tcl/all/patches/0001-8.6.10-no-read-only-data.patch new file mode 100644 index 0000000000000..f1330d84f11f0 --- /dev/null +++ b/recipes/tcl/all/patches/0001-8.6.10-no-read-only-data.patch @@ -0,0 +1,21 @@ +--- tools/installData.tcl ++++ tools/installData.tcl +@@ -33,18 +33,13 @@ + file copy -force $f [file join $d2 $ftail] + if {$::tcl_platform(platform) eq {unix}} { + file attributes [file join $d2 $ftail] -permissions 0644 +- } else { +- file attributes [file join $d2 $ftail] -readonly 1 + } + } + } + + if {$::tcl_platform(platform) eq {unix}} { + file attributes $d2 -permissions 0755 +- } else { +- file attributes $d2 -readonly 1 + } +- + } + + copyDir [file normalize [lindex $argv 0]] [file normalize [lindex $argv 1]] diff --git a/recipes/tcl/all/patches/0001-8.6.11-no-read-only-data.patch b/recipes/tcl/all/patches/0001-8.6.11-no-read-only-data.patch new file mode 100644 index 0000000000000..07987c2eb9269 --- /dev/null +++ b/recipes/tcl/all/patches/0001-8.6.11-no-read-only-data.patch @@ -0,0 +1,21 @@ +--- tools/installData.tcl ++++ tools/installData.tcl +@@ -33,18 +33,13 @@ + file copy -force $f [file join $d2 $ftail] + if {$::tcl_platform(platform) eq {unix}} { + file attributes [file join $d2 $ftail] -permissions 0o644 +- } else { +- file attributes [file join $d2 $ftail] -readonly 1 + } + } + } + + if {$::tcl_platform(platform) eq {unix}} { + file attributes $d2 -permissions 0o755 +- } else { +- file attributes $d2 -readonly 1 + } +- + } + + copyDir [file normalize [lindex $argv 0]] [file normalize [lindex $argv 1]] diff --git a/recipes/tcl/all/test_package/CMakeLists.txt b/recipes/tcl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d66a20fd8057c --- /dev/null +++ b/recipes/tcl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(TCL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tcl::tcl) diff --git a/recipes/tcl/all/test_package/conanfile.py b/recipes/tcl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..851bcca29ec58 --- /dev/null +++ b/recipes/tcl/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + if self.settings.os == "Windows": + self.run(os.path.join(self.source_folder, "hello.bat"), env="conanrun") + else: + self.run(f"$TCLSH {os.path.join(self.source_folder, 'hello.tcl')}", env="conanrun") diff --git a/recipes/tcl/all/test_package/hello.bat b/recipes/tcl/all/test_package/hello.bat new file mode 100644 index 0000000000000..91b1898381da6 --- /dev/null +++ b/recipes/tcl/all/test_package/hello.bat @@ -0,0 +1 @@ +%TCLSH% %~dp0hello.tcl diff --git a/recipes/tcl/all/test_package/hello.tcl b/recipes/tcl/all/test_package/hello.tcl new file mode 100644 index 0000000000000..7548a90827bc2 --- /dev/null +++ b/recipes/tcl/all/test_package/hello.tcl @@ -0,0 +1,2 @@ +puts "Hello, world!" +exit 0 diff --git a/recipes/tcl/all/test_package/test_package.c b/recipes/tcl/all/test_package/test_package.c new file mode 100644 index 0000000000000..bf82a8975edc0 --- /dev/null +++ b/recipes/tcl/all/test_package/test_package.c @@ -0,0 +1,75 @@ +#include + +#include +#include + +// from https://wiki.tcl-lang.org/page/How+to+embed+Tcl+in+C+applications + +static int +StringCatCmd( + ClientData dummy, /* Not used. */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ +{ + int i; + Tcl_Obj *objResultPtr; + + if (objc < 2) { + /* + * If there are no args, the result is an empty object. + * Just leave the preset empty interp result. + */ + return TCL_OK; + } + if (objc == 2) { + /* + * Other trivial case, single arg, just return it. + */ + Tcl_SetObjResult(interp, objv[1]); + return TCL_OK; + } + objResultPtr = objv[1]; + if (Tcl_IsShared(objResultPtr)) { + objResultPtr = Tcl_DuplicateObj(objResultPtr); + } + for(i = 2;i < objc;i++) { + Tcl_AppendObjToObj(objResultPtr, objv[i]); + } + Tcl_SetObjResult(interp, objResultPtr); + + return TCL_OK; +} + +Tcl_Command ExtendTcl (Tcl_Interp *interp) { + return Tcl_CreateObjCommand( + interp, "stringcat", StringCatCmd, NULL, NULL); +} + +int main (int argc ,char *argv[]) { + Tcl_FindExecutable(argv[0]); + Tcl_Interp *interp = Tcl_CreateInterp(); + if (Tcl_Init(interp) != TCL_OK) { + fprintf(stderr ,"Tcl_Init error: %s\n" ,Tcl_GetStringResult(interp)); + return EXIT_FAILURE; + } + Tcl_Command cmdToken = ExtendTcl(interp); + + if (Tcl_Eval(interp, "stringcat \"hello\" \" \" \"world\" \"\n\"") != TCL_OK) { + fprintf(stderr, "Tc_Eval failed: %s", Tcl_GetStringResult(interp)); + return EXIT_FAILURE; + } + + const char *res = Tcl_GetStringResult(interp); + if (strcmp("hello world\n", res)) { + fprintf(stderr, "concatenated string does not match\n"); + return EXIT_FAILURE; + } + + if (Tcl_DeleteCommandFromToken(interp, cmdToken) == -1) { + fprintf(stderr, "Tcl_DeleteCommand failed: %s", Tcl_GetStringResult(interp)); + return EXIT_FAILURE; + } + Tcl_Finalize(); + return EXIT_SUCCESS; +} diff --git a/recipes/tcl/all/test_v1_package/CMakeLists.txt b/recipes/tcl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..33e5f24630032 --- /dev/null +++ b/recipes/tcl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/tcl/all/test_v1_package/conanfile.py b/recipes/tcl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a3f559c43d6bb --- /dev/null +++ b/recipes/tcl/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" + + 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) + assert(os.path.exists(os.environ["TCLSH"])) + self.run("{} {}".format(os.environ["TCLSH"], os.path.join(self.source_folder, "..", "test_package", "hello.tcl")), run_environment=True) diff --git a/recipes/tcl/config.yml b/recipes/tcl/config.yml new file mode 100644 index 0000000000000..9e60b9c906676 --- /dev/null +++ b/recipes/tcl/config.yml @@ -0,0 +1,5 @@ +versions: + "8.6.11": + folder: "all" + "8.6.10": + folder: "all" diff --git a/recipes/tclap/all/conandata.yml b/recipes/tclap/all/conandata.yml new file mode 100644 index 0000000000000..f7a05c00a83b7 --- /dev/null +++ b/recipes/tclap/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.5": + url: "https://github.com/xguerin/tclap/archive/v1.2.5.tar.gz" + sha256: "a475fc46d82092c5d244f6ca8b0d2c0010fcb2c41936afde10a9c950f42eb95f" + "1.2.4": + url: "https://github.com/xguerin/tclap/archive/v1.2.4.tar.gz" + sha256: "7363f8f571e6e733b269c4b4e9c18f392d3cd7240d39a379d95de5a4c4bdc47f" + "1.2.3": + sha256: ccccd3471776f3198bb360aa6c09a1cd527d18b44360ff4d2b8356cdf984e980 + url: https://github.com/xguerin/tclap/archive/v1.2.3.tar.gz diff --git a/recipes/tclap/all/conanfile.py b/recipes/tclap/all/conanfile.py new file mode 100644 index 0000000000000..7eaf320075187 --- /dev/null +++ b/recipes/tclap/all/conanfile.py @@ -0,0 +1,30 @@ +from conans import ConanFile, tools + +import os + +class TclapConan(ConanFile): + name = "tclap" + license = "MIT" + homepage = "http://github.com/xguerin/tclap" + url = "https://github.com/conan-io/conan-center-index" + description = "Templatized Command Line Argument Parser" + topics = ("c++", "commandline parser") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + self.copy(pattern="*", src=os.path.join(self._source_subfolder, "include"), dst="include", keep_path=True) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "tclap" + + def package_id(self): + self.info.header_only() diff --git a/recipes/tclap/all/test_package/CMakeLists.txt b/recipes/tclap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..943ae4571dee7 --- /dev/null +++ b/recipes/tclap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(test_package test.cpp) +target_link_libraries(test_package CONAN_PKG::tclap) diff --git a/recipes/tclap/all/test_package/conanfile.py b/recipes/tclap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..78a3d05a29256 --- /dev/null +++ b/recipes/tclap/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestTclapConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake" + + 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/tclap/all/test_package/test.cpp b/recipes/tclap/all/test_package/test.cpp new file mode 100644 index 0000000000000..3ed9221ae5dc3 --- /dev/null +++ b/recipes/tclap/all/test_package/test.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +using namespace TCLAP; +using namespace std; + +int main(int, char**) +{ + int argc = 4; + const char * argv[] = { "test", "-r", "-n", "mike" }; + + CmdLine cmd("Command description message", ' ', "0.9"); + + ValueArg nameArg("n","name","Name to print",true,"homer","string"); + cmd.add( nameArg ); + + SwitchArg reverseSwitch("r","reverse","Print name backwards", false); + cmd.add(reverseSwitch); + + cmd.parse(argc, argv); + + string name = nameArg.getValue(); + bool reverseName = reverseSwitch.getValue(); + + assert(reverseName); + reverse(name.begin(), name.end()); + assert(name == "ekim"); + + return 0; +} diff --git a/recipes/tclap/config.yml b/recipes/tclap/config.yml new file mode 100644 index 0000000000000..1efcb49bf1c0a --- /dev/null +++ b/recipes/tclap/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.5": + folder: "all" + "1.2.4": + folder: "all" + "1.2.3": + folder: "all" diff --git a/recipes/tcp-wrappers/all/conandata.yml b/recipes/tcp-wrappers/all/conandata.yml new file mode 100644 index 0000000000000..59e770ecf55f2 --- /dev/null +++ b/recipes/tcp-wrappers/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "7.6": + url: "http://ftp.vim.org/ftp/ftp/security/tcpwrappers/tcp_wrappers_7.6-ipv6.4.tar.gz" + sha256: "038a580b6497bab516a3e0dca59dfa2fe8cf3c0151bef45d57572fb756c2a64c" +patches: + "7.6": + - patch_file: "patches/0001-shared-clang.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-warnings-by-include-headers.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-add-severity-level-to-library.patch" + base_path: "source_subfolder" diff --git a/recipes/tcp-wrappers/all/conanfile.py b/recipes/tcp-wrappers/all/conanfile.py new file mode 100644 index 0000000000000..505aeec0d08d6 --- /dev/null +++ b/recipes/tcp-wrappers/all/conanfile.py @@ -0,0 +1,95 @@ +import os +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class TcpWrappersConan(ConanFile): + name = "tcp-wrappers" + homepage = "ftp://ftp.porcupine.org/pub/security/index.html" + description = "A security tool which acts as a wrapper for TCP daemons" + topics = ("conan", "tcp", "ip", "daemon", "wrapper") + url = "https://github.com/conan-io/conan-center-index" + license = "BSD" + exports_sources = "patches/**" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + + @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): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("Visual Studio is not supported") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("tcp_wrappers_{}-ipv6.4".format(self.version), self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + autotools = AutoToolsBuildEnvironment(self) + make_args = [ + "REAL_DAEMON_DIR={}".format(tools.unix_path(os.path.join(self.package_folder, "bin"))), + "-j1", + "SHEXT={}".format(self._shext), + ] + if self.options.shared: + make_args.append("shared=1") + env_vars = autotools.vars + if self.options.get_safe("fPIC", True): + env_vars["CFLAGS"] += " -fPIC" + env_vars["ENV_CFLAGS"] = env_vars["CFLAGS"] + # env_vars["SHEXT"] = self._shext + print(env_vars) + with tools.environment_append(env_vars): + autotools.make(target="linux", args=make_args) + + @property + def _shext(self): + if tools.is_apple_os(self.settings.os): + return ".dylib" + return ".so" + + def package(self): + self.copy(pattern="DISCLAIMER", src=self._source_subfolder, dst="licenses") + + for exe in ("safe_finger", "tcpd", "tcpdchk", "tcpdmatch", "try-from"): + self.copy(exe, src=self._source_subfolder, dst="bin", keep_path=False) + self.copy("tcpd.h", src=self._source_subfolder, dst="include", keep_path=False) + if self.options.shared: + self.copy("libwrap{}".format(self._shext), src=self._source_subfolder, dst="lib", keep_path=False) + else: + self.copy("libwrap.a", src=self._source_subfolder, dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["wrap"] + + 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/tcp-wrappers/all/patches/0001-shared-clang.patch b/recipes/tcp-wrappers/all/patches/0001-shared-clang.patch new file mode 100644 index 0000000000000..175dddd380f02 --- /dev/null +++ b/recipes/tcp-wrappers/all/patches/0001-shared-clang.patch @@ -0,0 +1,55 @@ +- Add support for building a shared library +- Fix error for clang8 +--- Makefile ++++ Makefile +@@ -677,7 +677,7 @@ CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ + $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ +- $(VSYSLOG) $(HOSTNAME) $(IPV6) ++ $(VSYSLOG) $(HOSTNAME) $(IPV6) $(ENV_CFLAGS) + + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ + hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ +@@ -697,7 +697,14 @@ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ + refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \ + scaffold.h tcpdmatch.8 README.NIS + +-LIB = libwrap.a ++ALIB = libwrap.a ++SHLIB = libwrap${SHEXT} ++ ++ifdef shared ++LIB = $(SHLIB) ++else ++LIB = $(ALIB) ++endif + + all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk + +@@ -715,8 +722,12 @@ cflags: config-check + + $(LIB): $(LIB_OBJ) + rm -f $(LIB) ++ifdef shared ++ $(CC) -shared $(LDFLAGS) -o $(LIB) $(LIB_OBJ) ++else + $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) + -$(RANLIB) $(LIB) ++endif + + tcpd: tcpd.o $(LIB) + $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) +--- tcpd.h ++++ tcpd.h +@@ -157,8 +157,8 @@ extern char *skip_ipv6_addrs(); /* skip over colons in IPv6 addrs */ + + /* Global variables. */ + +-extern int allow_severity; /* for connection logging */ +-extern int deny_severity; /* for connection logging */ ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */ ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */ + extern char *hosts_allow_table; /* for verification mode redirection */ + extern char *hosts_deny_table; /* for verification mode redirection */ + extern int hosts_access_verbose; /* for verbose matching mode */ diff --git a/recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch b/recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch new file mode 100644 index 0000000000000..fe581b0ef0a0a --- /dev/null +++ b/recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch @@ -0,0 +1,314 @@ +--- clean_exit.c ++++ clean_exit.c +@@ -13,8 +13,8 @@ + #endif + + #include +- +-extern void exit(); ++#include ++#include + + #include "tcpd.h" + +--- fakelog.c ++++ fakelog.c +@@ -17,7 +17,7 @@ + + /* ARGSUSED */ + +-openlog(name, logopt, facility) ++void openlog(name, logopt, facility) + char *name; + int logopt; + int facility; +@@ -27,7 +27,7 @@ + + /* vsyslog - format one record */ + +-vsyslog(severity, fmt, ap) ++void vsyslog(severity, fmt, ap) + int severity; + char *fmt; + va_list ap; +@@ -43,7 +43,7 @@ + + /* VARARGS */ + +-VARARGS(syslog, int, severity) ++void VARARGS(syslog, int, severity) + { + va_list ap; + char *fmt; +@@ -56,7 +56,7 @@ + + /* closelog - dummy */ + +-closelog() ++void closelog() + { + /* void */ + } +--- fix_options.c ++++ fix_options.c +@@ -29,7 +29,7 @@ + + /* fix_options - get rid of IP-level socket options */ + +-fix_options(request) ++void fix_options(request) + struct request_info *request; + { + #ifdef IP_OPTIONS +--- inetcf.c ++++ inetcf.c +@@ -13,10 +13,9 @@ + #include + #include + #include ++#include + #include +- +-extern int errno; +-extern void exit(); ++#include + + #include "tcpd.h" + #include "inetcf.h" +@@ -36,6 +35,7 @@ + 0, + }; + ++int check_path(char *path, struct stat *); + static void inet_chk(); + static char *base_name(); + +--- myvsyslog.c ++++ myvsyslog.c +@@ -14,13 +14,14 @@ + #ifdef vsyslog + + #include ++#include + + #include "tcpd.h" + #include "mystdarg.h" + +-myvsyslog(severity, format, ap) ++void myvsyslog(severity, format, ap) + int severity; +-char *format; ++const char *format; + va_list ap; + { + char fbuf[BUFSIZ]; +--- options.c ++++ options.c +@@ -46,7 +46,9 @@ + #include + #include + #include ++#include + #include ++#include + + #ifndef MAXPATHNAMELEN + #define MAXPATHNAMELEN BUFSIZ +--- percent_x.c ++++ percent_x.c +@@ -18,9 +18,9 @@ + + #include + #include ++#include + #include +- +-extern void exit(); ++#include + + /* Local stuff. */ + +--- rfc931.c ++++ rfc931.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + /* Local stuff. */ + +--- safe_finger.c ++++ safe_finger.c +@@ -22,12 +22,16 @@ + + #include + #include ++#include + #include + #include + #include ++#include + #include ++#include ++#include + +-extern void exit(); ++int pipe_stdin(char **); + + /* Local stuff */ + +@@ -49,7 +53,7 @@ + exit(0); + } + +-main(argc, argv) ++int main(argc, argv) + int argc; + char **argv; + { +--- scaffold.c ++++ scaffold.c +@@ -20,13 +20,12 @@ + #include + #include + #include ++#include + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif + +-extern char *malloc(); +- + /* Application-specific. */ + + #include "tcpd.h" +--- setenv.c ++++ setenv.c +@@ -9,6 +9,9 @@ + * + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ ++#include ++#include ++#include + + #ifndef lint + static char sccsid[] = "@(#) setenv.c 1.1 93/03/07 22:47:58"; +@@ -17,12 +20,10 @@ + /* setenv - update or insert environment (name,value) pair */ + + int setenv(name, value, clobber) +-char *name; +-char *value; ++const char *name; ++const char *value; + int clobber; + { +- char *malloc(); +- char *getenv(); + char *cp; + + if (clobber == 0 && getenv(name) != 0) +--- shell_cmd.c ++++ shell_cmd.c +@@ -16,12 +16,14 @@ + + #include + #include ++#include ++#include + #include + #include + #include ++#include + #include +- +-extern void exit(); ++#include + + /* Local stuff. */ + +--- tcpd.c ++++ tcpd.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #ifndef MAXPATHNAMELEN + #define MAXPATHNAMELEN BUFSIZ +@@ -41,7 +42,7 @@ + int allow_severity = SEVERITY; /* run-time adjustable */ + int deny_severity = LOG_WARNING; /* ditto */ + +-main(argc, argv) ++int main(argc, argv) + int argc; + char **argv; + { +--- tcpdchk.c ++++ tcpdchk.c +@@ -24,17 +24,15 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include + #include +- +-extern int errno; +-extern void exit(); +-extern int optind; +-extern char *optarg; ++#include ++#include + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ +--- tcpdmatch.c ++++ tcpdmatch.c +@@ -24,16 +24,14 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include + #include + +-extern void exit(); +-extern int optind; +-extern char *optarg; +- + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif +--- try-from.c ++++ try-from.c +@@ -39,5 +39,5 @@ + +-main(argc, argv) ++int main(argc, argv) + int argc; + char **argv; + { +--- update.c ++++ update.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + /* Local stuff. */ + diff --git a/recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch b/recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch new file mode 100644 index 0000000000000..1c4c1f02566d6 --- /dev/null +++ b/recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch @@ -0,0 +1,60 @@ +--- Makefile ++++ Makefile +@@ -682,7 +682,7 @@ + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ + hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ + $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \ +- update.o misc.o diag.o percent_m.o myvsyslog.o ++ update.o misc.o diag.o percent_m.o myvsyslog.o severity.o + + FROM_OBJ= fromhost.o + +--- miscd.c ++++ miscd.c +@@ -40,8 +40,8 @@ + #include "patchlevel.h" + #include "tcpd.h" + +-int allow_severity = SEVERITY; /* run-time adjustable */ +-int deny_severity = LOG_WARNING; /* ditto */ ++//int allow_severity = SEVERITY; /* run-time adjustable */ ++//int deny_severity = LOG_WARNING; /* ditto */ + + main(argc, argv) + int argc; +diff --git a/source/source_subfolder/scaffold.c b/source/source_subfolder/scaffold.c +index 2fb3efb..24657c0 100644 +--- scaffold.c ++++ scaffold.c +@@ -34,8 +34,8 @@ + /* + * These are referenced by the options module and by rfc931.c. + */ +-int allow_severity = SEVERITY; +-int deny_severity = LOG_WARNING; ++//int allow_severity = SEVERITY; ++//int deny_severity = LOG_WARNING; + int rfc931_timeout = RFC931_TIMEOUT; + + /* dup_hostent - create hostent in one memory block */ +new file mode 100644 +--- /dev/null ++++ severity.c +@@ -0,0 +1,4 @@ ++#include ++ ++int allow_severity = SEVERITY; ++int deny_severity = LOG_WARNING; +--- try-from.c ++++ try-from.c +@@ -34,8 +34,8 @@ + + #include "tcpd.h" + +-int allow_severity = SEVERITY; /* run-time adjustable */ +-int deny_severity = LOG_WARNING; /* ditto */ ++//int allow_severity = SEVERITY; /* run-time adjustable */ ++//int deny_severity = LOG_WARNING; /* ditto */ + + int main(argc, argv) + int argc; diff --git a/recipes/tcp-wrappers/all/test_package/CMakeLists.txt b/recipes/tcp-wrappers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6226de918d1da --- /dev/null +++ b/recipes/tcp-wrappers/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +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/tcp-wrappers/all/test_package/conanfile.py b/recipes/tcp-wrappers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/tcp-wrappers/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tcp-wrappers/all/test_package/test_package.c b/recipes/tcp-wrappers/all/test_package/test_package.c new file mode 100644 index 0000000000000..99571f4211816 --- /dev/null +++ b/recipes/tcp-wrappers/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include "tcpd.h" + +#include + +int main (int argc, char *argv[]) +{ + struct request_info req; + request_init(&req, RQ_DAEMON, argv[0], RQ_FILE, 0, 0); + printf("host_acces: %d\n", hosts_access(&req)); + return 0; +} diff --git a/recipes/tcp-wrappers/config.yml b/recipes/tcp-wrappers/config.yml new file mode 100644 index 0000000000000..f73dd5708f806 --- /dev/null +++ b/recipes/tcp-wrappers/config.yml @@ -0,0 +1,3 @@ +versions: + "7.6": + folder: "all" diff --git a/recipes/tcsbank-uconfig/all/conandata.yml b/recipes/tcsbank-uconfig/all/conandata.yml new file mode 100644 index 0000000000000..c292824b18361 --- /dev/null +++ b/recipes/tcsbank-uconfig/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.3": + url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.0.3.tar.gz" + sha256: "a1f6278ebd6c0c7ba391651ab6f0aceeb9cb77dc6936d45dc0e6fee3f27dfcbf" + "2.1.0": + url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.1.0.tar.gz" + sha256: "1a7a8ab97b6de7fa039031caa83d8ab889d874822b06c920af3e8ddd794ab9c6" diff --git a/recipes/tcsbank-uconfig/all/conanfile.py b/recipes/tcsbank-uconfig/all/conanfile.py new file mode 100644 index 0000000000000..cf5ea147a4f0e --- /dev/null +++ b/recipes/tcsbank-uconfig/all/conanfile.py @@ -0,0 +1,80 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.33.0" + + +class TCSBankUconfigConan(ConanFile): + name = "tcsbank-uconfig" + description = "Lightweight, header-only, C++17 configuration library" + topics = ("conan", "configuration", "env", "json") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TinkoffCreditSystems/uconfig" + license = "Apache-2.0" + + generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_rapidjson": [True, False], + } + default_options = { + "with_rapidjson": True, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + if self.options.with_rapidjson: + self.requires("rapidjson/1.1.0") + + def validate(self): + compiler = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + min_req_cppstd = "17" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, min_req_cppstd) + else: + self.output.warn("%s recipe lacks information about the %s compiler" + " standard version support." % (self.name, compiler)) + + minimal_version = { + "Visual Studio": "16", + "gcc": "7.3", + "clang": "6.0", + "apple-clang": "10.0", + } + # Exclude not supported compilers + if compiler not in minimal_version: + self.output.info("%s requires a compiler that supports at least C++%s" % (self.name, min_req_cppstd)) + return + if compiler_version < minimal_version[compiler]: + raise ConanInvalidConfiguration( + "%s requires a compiler that supports at least C++%s. %s %s is not supported." % + (self.name, min_req_cppstd, compiler, compiler_version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("*.ipp", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "uconfig" + self.cpp_info.names["cmake_find_package"] = "uconfig" + self.cpp_info.names["cmake_find_package_multi"] = "uconfig" + if self.options.with_rapidjson: + self.cpp_info.defines = ["RAPIDJSON_HAS_STDSTRING=1"] + + def package_id(self): + self.info.header_only() diff --git a/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt b/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b713d97dfd9d --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(uconfig CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} uconfig::uconfig) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) diff --git a/recipes/tcsbank-uconfig/all/test_package/conanfile.py b/recipes/tcsbank-uconfig/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_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/tcsbank-uconfig/all/test_package/test_package.cpp b/recipes/tcsbank-uconfig/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fb3f52a80922c --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include +#include +#include + +struct AppConfig: public uconfig::Config +{ + uconfig::Variable variable; + + using uconfig::Config::Config; + + virtual void Init(const std::string& env_prefix) override + { + Register(env_prefix + "_VARIABLE", &variable); + } +}; + +int main() { + setenv("APP_VARIABLE", "123456", 1); + + AppConfig app_config; + uconfig::EnvFormat formatter; + + app_config.Parse(formatter, "APP", nullptr); + std::map config_map; + app_config.Emit(formatter, "APP", &config_map); + + for (const auto& [name, vlaue] : config_map) { + std::cout << name << "=" << vlaue << std::endl; + } + return 0; +} diff --git a/recipes/tcsbank-uconfig/config.yml b/recipes/tcsbank-uconfig/config.yml new file mode 100644 index 0000000000000..14f04caec446d --- /dev/null +++ b/recipes/tcsbank-uconfig/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.3": + folder: all + "2.1.0": + folder: all diff --git a/recipes/tcsbank-uri-template/all/CMakeLists.txt b/recipes/tcsbank-uri-template/all/CMakeLists.txt new file mode 100644 index 0000000000000..8bdaa1e47bfa0 --- /dev/null +++ b/recipes/tcsbank-uri-template/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/tcsbank-uri-template/all/conandata.yml b/recipes/tcsbank-uri-template/all/conandata.yml new file mode 100644 index 0000000000000..f958e285c4af2 --- /dev/null +++ b/recipes/tcsbank-uri-template/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.3": + url: "https://github.com/TinkoffCreditSystems/uri-template/archive/refs/tags/v1.1.3.tar.gz" + sha256: "4eaf984eb7857a56b09e9ad911a77042573d1540a19b9e945369ec6384f54131" + "1.1.4": + url: "https://github.com/TinkoffCreditSystems/uri-template/archive/refs/tags/v1.1.4.tar.gz" + sha256: "5f6e562813f1cf9ce40137db88ea4db54dc4bd77a6e5f813b106d494bbfb72b3" + "1.2.1": + url: "https://github.com/TinkoffCreditSystems/uri-template/archive/refs/tags/v1.2.1.tar.gz" + sha256: "afdfc29cb914642702c26968b11ca50c5a435653b0af5773e3d27d4444c425e2" diff --git a/recipes/tcsbank-uri-template/all/conanfile.py b/recipes/tcsbank-uri-template/all/conanfile.py new file mode 100644 index 0000000000000..03a96370cbb02 --- /dev/null +++ b/recipes/tcsbank-uri-template/all/conanfile.py @@ -0,0 +1,107 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.33.0" + + +class TCSBankUriTemplateConan(ConanFile): + name = "tcsbank-uri-template" + description = "URI Templates expansion and reverse-matching for C++" + topics = ("conan", "uri-template", "url-template", "rfc-6570") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TinkoffCreditSystems/uri-template" + license = "Apache-2.0" + + generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + 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 self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["URITEMPLATE_BUILD_TESTING"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + compiler_name = str(self.settings.compiler) + compiler_version = tools.Version(self.settings.compiler.version) + + # Exclude compiler.cppstd < 17 + min_req_cppstd = "17" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, min_req_cppstd) + else: + self.output.warn("%s recipe lacks information about the %s compiler" + " standard version support." % (self.name, compiler_name)) + + # Exclude not supported compilers + compilers_required = { + "Visual Studio": "16", + "gcc": "7.3", + "clang": "6.0", + "apple-clang": "10.0", + } + if compiler_name not in compilers_required or compiler_version < compilers_required[compiler_name]: + raise ConanInvalidConfiguration( + "%s requires a compiler that supports at least C++%s. %s %s is not supported." % + (self.name, min_req_cppstd, compiler_name, compiler_version)) + + # Check stdlib ABI compatibility + if compiler_name == "gcc" and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration('Using %s with GCC requires "compiler.libcxx=libstdc++11"' % self.name) + elif compiler_name == "clang" and self.settings.compiler.libcxx not in ["libstdc++11", "libc++"]: + raise ConanInvalidConfiguration('Using %s with Clang requires either "compiler.libcxx=libstdc++11"' + ' or "compiler.libcxx=libc++"' % self.name) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "uri-template" + self.cpp_info.names["cmake_find_package"] = "uri-template" + self.cpp_info.names["cmake_find_package_multi"] = "uri-template" + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt b/recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb4d85b99bbcf --- /dev/null +++ b/recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(uri-template REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} uri-template::uri-template) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/tcsbank-uri-template/all/test_package/conanfile.py b/recipes/tcsbank-uri-template/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tcsbank-uri-template/all/test_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/tcsbank-uri-template/all/test_package/test_package.cpp b/recipes/tcsbank-uri-template/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b8f028352cf82 --- /dev/null +++ b/recipes/tcsbank-uri-template/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include + +int main() { + const std::string uri = "http://example.com/search?q=cat&lang=en"; + // Parse the template + const URI::Template::Template uri_template = URI::Template::ParseTemplate("http://example.com/search{?q,lang}"); + + // Match it to the URI + // &matched_values can be nullptr if you don't care about values. + std::unordered_map matched_values; + bool matched = URI::Template::MatchURI(uri_template, uri, &matched_values); + + // Print results + std::cout << std::boolalpha; + std::cout << "Template matched: " << matched << std::endl; + for (const auto& [name, value] : matched_values) { + std::cout << name << "=" << value << std::endl; + } + + // Expand + const std::string expanded_uri = URI::Template::ExpandTemplate(uri_template, matched_values); + std::cout << "Template expanded: " << expanded_uri << std::endl; + return 0; +} diff --git a/recipes/tcsbank-uri-template/config.yml b/recipes/tcsbank-uri-template/config.yml new file mode 100644 index 0000000000000..c744acd213406 --- /dev/null +++ b/recipes/tcsbank-uri-template/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.3": + folder: all + "1.1.4": + folder: all + "1.2.1": + folder: all diff --git a/recipes/teemo/all/conandata.yml b/recipes/teemo/all/conandata.yml new file mode 100644 index 0000000000000..490c174ebfda5 --- /dev/null +++ b/recipes/teemo/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.7": + url: "https://github.com/winsoft666/teemo/archive/refs/tags/v2.7.tar.gz" + sha256: "97be8ae62cd3e2e92ed0ff405dfaf5e6cb6e323b21c53e798adfa5872a2f7084" + +patches: + "2.7": + - patch_file: "patches/0001-follow-cxx-standards.patch" + patch_description: "include threads header" + patch_type: "portability" + - patch_file: "patches/0002-support-macosx.patch" + patch_description: "support macosx" + patch_type: "portability" diff --git a/recipes/teemo/all/conanfile.py b/recipes/teemo/all/conanfile.py new file mode 100644 index 0000000000000..c34c6cc5a1060 --- /dev/null +++ b/recipes/teemo/all/conanfile.py @@ -0,0 +1,101 @@ +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, rm, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class TeemoConan(ConanFile): + name = "teemo" + description = "C++ File Download Library." + license = "GPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/winsoft666/teemo" + topics = ("downloader", "libcurl", "speed-limit", "ftp", "http") + 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 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("libcurl/7.86.0") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if self.info.settings.compiler == "apple-clang" and Version(self.info.settings.compiler.version) < "12.0": + raise ConanInvalidConfiguration(f"{self.ref} can not build on apple-clang < 12.0.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + 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): + libname = "teemo" if self.options.shared else "teemo-static" + libpostfix = "-d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"{libname}{libpostfix}"] + + if self.options.shared: + self.cpp_info.defines.append("TEEMO_EXPORTS") + else: + self.cpp_info.defines.append("TEEMO_STATIC") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/teemo/all/patches/0001-follow-cxx-standards.patch b/recipes/teemo/all/patches/0001-follow-cxx-standards.patch new file mode 100644 index 0000000000000..ef756c224f890 --- /dev/null +++ b/recipes/teemo/all/patches/0001-follow-cxx-standards.patch @@ -0,0 +1,25 @@ +diff --git a/a/src/entry_handler.cpp b/b/src/entry_handler.cpp +index 9e94b47..f45d954 100644 +--- a/a/src/entry_handler.cpp ++++ b/b/src/entry_handler.cpp +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include "file_util.h" + #include "string_helper.hpp" + #include "string_encode.h" +diff --git a/a/src/md5.cpp b/b/src/md5.cpp +index 9068dea..424c1f2 100644 +--- a/a/src/md5.cpp ++++ b/b/src/md5.cpp +@@ -90,7 +90,7 @@ void byteSwap(UWORD32* buf, unsigned words) { + * the data and converts bytes into longwords for this routine. + */ + void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) { +- register UWORD32 a, b, c, d; ++ UWORD32 a, b, c, d; + + a = buf[0]; + b = buf[1]; diff --git a/recipes/teemo/all/patches/0002-support-macosx.patch b/recipes/teemo/all/patches/0002-support-macosx.patch new file mode 100644 index 0000000000000..64f500a421a85 --- /dev/null +++ b/recipes/teemo/all/patches/0002-support-macosx.patch @@ -0,0 +1,40 @@ +diff --git a/a/src/file_util.cpp b/b/src/file_util.cpp +index 9cea293..20fb5c6 100644 +--- a/a/src/file_util.cpp ++++ b/b/src/file_util.cpp +@@ -46,6 +46,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); +@@ -181,6 +184,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 +@@ -263,6 +268,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/teemo/all/test_package/CMakeLists.txt b/recipes/teemo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..caf3475df9376 --- /dev/null +++ b/recipes/teemo/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(teemo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE teemo::teemo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/teemo/all/test_package/conanfile.py b/recipes/teemo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/teemo/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/teemo/all/test_package/test_package.cpp b/recipes/teemo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..24b78b9a64c3b --- /dev/null +++ b/recipes/teemo/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include + +#include "teemo/teemo.h" + +int main(int argc, char **argv) { + using namespace teemo; + + Teemo::GlobalInit(); + + Teemo efd; + + efd.setThreadNum(10); // Optional + efd.setTmpFileExpiredTime(3600); // Optional + efd.setDiskCacheSize(20 * (2 << 19)); // Optional + efd.setMaxDownloadSpeed(50 * (2 << 19)); // Optional + efd.setHashVerifyPolicy( + ALWAYS, MD5, "6fe294c3ef4765468af4950d44c65525"); // Optional, support + // MD5, CRC32, SHA256 + efd.setVerboseOutput([](const utf8string &verbose) { // Optional + std::cout << verbose << "\n"; + }); + + efd.setHttpHeaders({ + {"Origin", "http://xxx.xxx.com"}, + {"User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"}, + }); + + Teemo::GlobalUnInit(); + + return 0; +} diff --git a/recipes/teemo/all/test_v1_package/CMakeLists.txt b/recipes/teemo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/teemo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/teemo/all/test_v1_package/conanfile.py b/recipes/teemo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/teemo/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/teemo/config.yml b/recipes/teemo/config.yml new file mode 100644 index 0000000000000..600f563c61c19 --- /dev/null +++ b/recipes/teemo/config.yml @@ -0,0 +1,3 @@ +versions: + "2.7": + folder: all diff --git a/recipes/tensorflow-lite/all/conandata.yml b/recipes/tensorflow-lite/all/conandata.yml new file mode 100644 index 0000000000000..42304f36f76b1 --- /dev/null +++ b/recipes/tensorflow-lite/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "2.10.0": + url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz" + sha256: "b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8" +patches: + "2.10.0": + - patch_file: "patches/remove_simple_memory_arena_debug_dump.patch" + patch_description: "Shared build fails on Windows with error LNK2005. Resolve the conflict by removing the conflicting implementation for now." + - patch_file: "patches/disable_fetch_content.patch" + patch_description: "Fail if the CMake build script tries to fetch external dependencies" + patch_type: "conan" + - patch_file: "patches/dependencies_2_10.patch" + patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" + patch_type: "conan" diff --git a/recipes/tensorflow-lite/all/conanfile.py b/recipes/tensorflow-lite/all/conanfile.py new file mode 100644 index 0000000000000..083c62e71120c --- /dev/null +++ b/recipes/tensorflow-lite/all/conanfile.py @@ -0,0 +1,179 @@ +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 +from conan.tools.scm import Version +from os.path import join +import textwrap + +required_conan_version = ">=1.53.0" + + +class TensorflowLiteConan(ConanFile): + name = "tensorflow-lite" + license = "Apache-2.0" + homepage = "https://www.tensorflow.org/lite/guide" + url = "https://github.com/conan-io/conan-center-index" + description = ("TensorFlow Lite is a set of tools that enables on-device machine learning " + "by helping developers run their models on mobile, embedded, and IoT devices.") + topics = ("machine-learning", "neural-networks", "deep-learning") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ruy": [True, False], + "with_nnapi": [True, False], + "with_mmap": [True, False], + "with_xnnpack": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ruy": False, + "with_nnapi": False, + "with_mmap": True, + "with_xnnpack": True + } + + short_paths = True + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "Visual Studio": "15.8", + "msvc": "191", + "clang": "5", + "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 + del self.options.with_nnapi + del self.options.with_mmap + if self.settings.os == "Macos": + del self.options.with_nnapi + + 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("abseil/20230125.1") + self.requires("eigen/3.4.0") + self.requires("farmhash/cci.20190513") + self.requires("fft/cci.20061228") + self.requires("flatbuffers/23.1.21", transitive_headers=True) + self.requires("gemmlowp/cci.20210928") + self.requires("ruy/cci.20220628") + if self.settings.arch in ("x86", "x86_64"): + self.requires("intel-neon2sse/cci.20210225") + if self.options.with_xnnpack: + self.requires("xnnpack/cci.20220801") + # https://github.com/tensorflow/tensorflow/blob/359c3cdfc5fabac82b3c70b3b6de2b0a8c16874f/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc#L165 + self.requires("pthreadpool/cci.20210218") + if self.options.with_xnnpack or self.options.get_safe("with_nnapi", False): + self.requires("fp16/cci.20210320") + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def 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): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + tc.variables.update({ + "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS": True, + "TFLITE_ENABLE_RUY": self.options.with_ruy, + "TFLITE_ENABLE_NNAPI": self.options.get_safe("with_nnapi", False), + "TFLITE_ENABLE_GPU": False, + "TFLITE_ENABLE_XNNPACK": self.options.with_xnnpack, + "TFLITE_ENABLE_MMAP": self.options.get_safe("with_mmap", False), + "FETCHCONTENT_FULLY_DISCONNECTED": True, + "clog_POPULATED": True, + }) + if self.settings.arch == "armv8": + # Not defined by Conan for Apple Silicon. See https://github.com/conan-io/conan/pull/8026 + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = "arm64" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=join("tensorflow", "lite")) + cmake.build() + + @staticmethod + def _create_cmake_module_alias_target(conanfile, module_file): + aliased = "tensorflowlite::tensorflowlite" + alias = "tensorflow::tensorflowlite" + 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(self): + return join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package(self): + copy(self, "LICENSE", self.source_folder, join(self.package_folder, "licenses")) + copy(self, "*.h", join(self.source_folder, "tensorflow", "lite"), join(self.package_folder, "include", "tensorflow", "lite")) + copy(self, "*.a", self.build_folder, join(self.package_folder, "lib")) + copy(self, "*.so", self.build_folder, join(self.package_folder, "lib")) + copy(self, "*.dylib", self.build_folder, join(self.package_folder, "lib")) + copy(self, "*.lib", self.build_folder, join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", self.build_folder, join(self.package_folder, "bin"), keep_path=False) + self._create_cmake_module_alias_target(self, join(self.package_folder, self._module_file)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tensorflowlite") + self.cpp_info.set_property("cmake_target_name", "tensorflow::tensorflowlite") + + self.cpp_info.names["cmake_find_package"] = "tensorflowlite" + self.cpp_info.names["cmake_find_package_multi"] = "tensorflowlite" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file] + + defines = [] + if not self.options.shared: + defines.append("TFL_STATIC_LIBRARY_BUILD") + if self.options.with_ruy: + defines.append("TFLITE_WITH_RUY") + + self.cpp_info.defines = defines + self.cpp_info.libs = ["tensorflow-lite"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("dl") diff --git a/recipes/tensorflow-lite/all/patches/dependencies_2_10.patch b/recipes/tensorflow-lite/all/patches/dependencies_2_10.patch new file mode 100644 index 0000000000000..89fb68b136f0d --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/dependencies_2_10.patch @@ -0,0 +1,78 @@ +--- a/tensorflow/lite/CMakeLists.txt 2023-04-12 18:04:31 ++++ b/tensorflow/lite/CMakeLists.txt 2023-04-13 08:40:25 +@@ -138,12 +138,11 @@ + endmacro() + # Find TensorFlow Lite dependencies. + find_package(absl REQUIRED) +-find_package(eigen REQUIRED) ++find_package(Eigen3 REQUIRED) + find_package(farmhash REQUIRED) +-find_package(fft2d REQUIRED) ++find_package(fft REQUIRED) + find_package(flatbuffers REQUIRED) + find_package(gemmlowp REQUIRED) +-find_package(neon2sse REQUIRED) + find_package(clog REQUIRED) + find_package(cpuinfo REQUIRED) #CPUINFO is used by XNNPACK and RUY library + find_package(ruy REQUIRED) +@@ -151,6 +150,11 @@ + # We used to have an actual compilation logic with flatc but decided to use + # schema_generated.h since flatc doesn't work with cross compilation. + set(TFLITE_FLATBUFFERS_SCHEMA_DIR "${TFLITE_SOURCE_DIR}/schema") ++if(TARGET flatbuffers::flatbuffers_shared) ++ set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) ++else() ++ set(FLATBUFFERS_TARGET flatbuffers::flatbuffers) ++endif() + set(TF_TARGET_PRIVATE_OPTIONS "") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") + # TensorFlow uses a heap of deprecated proto fields so surpress these +@@ -162,6 +166,10 @@ + set(TFLITE_TARGET_PRIVATE_OPTIONS "") + # Additional library dependencies based upon enabled features. + set(TFLITE_TARGET_DEPENDENCIES "") ++if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86") ++ find_package(NEON_2_SSE REQUIRED) ++ list(APPEND TFLITE_TARGET_DEPENDENCIES NEON_2_SSE::NEON_2_SSE) ++endif() + 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. +@@ -406,12 +414,14 @@ + if(TFLITE_ENABLE_XNNPACK) + find_package(fp16_headers REQUIRED) + find_package(xnnpack REQUIRED) ++ find_package(pthreadpool REQUIRED) + populate_tflite_source_vars("delegates/xnnpack" + TFLITE_DELEGATES_XNNPACK_SRCS + FILTER ".*(_test|_tester)\\.(cc|h)" + ) + list(APPEND TFLITE_TARGET_DEPENDENCIES +- XNNPACK ++ xnnpack::xnnpack ++ pthreadpool::pthreadpool + ) + list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_BUILD_WITH_XNNPACK_DELEGATE") + endif() +@@ -519,17 +529,16 @@ + target_link_libraries(tensorflow-lite + PUBLIC + Eigen3::Eigen +- NEON_2_SSE + absl::flags + absl::hash + absl::status + absl::strings + absl::synchronization + absl::variant +- farmhash +- fft2d_fftsg2d +- flatbuffers +- gemmlowp ++ farmhash::farmhash ++ fft::fft ++ ${FLATBUFFERS_TARGET} ++ gemmlowp::eight_bit_int_gemm + ruy::ruy + ${CMAKE_DL_LIBS} + ${TFLITE_TARGET_DEPENDENCIES} diff --git a/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch b/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch new file mode 100644 index 0000000000000..adc6f0561afef --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch @@ -0,0 +1,12 @@ +diff --git a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +index 9ed95109ba9..4ddf322b95f 100644 +--- a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake ++++ b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +@@ -244,6 +244,7 @@ endfunction() + # All content names passed to this method are added to the global property + # OVERRIDABLE_FETCH_CONTENT_LIST. + function(OverridableFetchContent_Declare CONTENT_NAME) ++ message(FATAL_ERROR "OverridableFetchContent_Declare called by ${CONTENT_NAME}! Failing build.") + set(OVERRIDABLE_ARGS + GIT_REPOSITORY + GIT_TAG diff --git a/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch b/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch new file mode 100644 index 0000000000000..2f7e6367c52d8 --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch @@ -0,0 +1,14 @@ +diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt +index 40f9485b5d6..f250ebccc05 100644 +--- a/tensorflow/lite/CMakeLists.txt ++++ b/tensorflow/lite/CMakeLists.txt +@@ -202,6 +202,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Android") + endif() + # Build a list of source files to compile into the TF Lite library. + populate_tflite_source_vars("." TFLITE_SRCS) ++if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND BUILD_SHARED_LIBS) ++ list(FILTER TFLITE_SRCS EXCLUDE REGEX ".*simple_memory_arena_debug_dump\\.cc$") ++endif() + + # This particular file is excluded because the more explicit approach to enable + # XNNPACK delegate is preferred to the weak-symbol one. diff --git a/recipes/tensorflow-lite/all/test_package/CMakeLists.txt b/recipes/tensorflow-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b1b0f24e0aa99 --- /dev/null +++ b/recipes/tensorflow-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(tensorflowlite REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE tensorflow::tensorflowlite) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/tensorflow-lite/all/test_package/conanfile.py b/recipes/tensorflow-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..841a097747d32 --- /dev/null +++ b/recipes/tensorflow-lite/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +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 = "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): + 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") diff --git a/recipes/tensorflow-lite/all/test_package/model.tflite b/recipes/tensorflow-lite/all/test_package/model.tflite new file mode 100644 index 0000000000000000000000000000000000000000..281cb988ba465a03585ae1a25deb4264356ec6fe GIT binary patch literal 516 zcmYL_v1$TA5QfLN7$I^Bv9PeXB8Alv%^SoJ5Y8r~6eQpkSKJBa4Dl^e`Uoj3Eb<5` z^GJcq_pdG)`1hZko%wfWhGzEsnBMg*HfL??SkL;z1~&BE^uBR3`vBrwFaixRhjE9ruPnzy8dW;-%Q%qpvcSRW?NQykuBe{&1=3ciMGgdoG0BLJWj@wM4z9n z3(wQpQ#@Ul)K%FkArjI1|0EF+&7;0!a0Ar)1^5B)K>f+Y0m|1r#Y;{zk=IcFm+VKH z*!_S*b15&a>pIj1J?-+!=Qy9Yz{eJP|0Z93sSmMw(w{*?JDROBmQw9-eVmf|%hzeb b(>}EqDM&+5y*NH|&=ZGQrSl6MD$@A_FkUv$ literal 0 HcmV?d00001 diff --git a/recipes/tensorflow-lite/all/test_package/test_package.cpp b/recipes/tensorflow-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4a4921bbf217f --- /dev/null +++ b/recipes/tensorflow-lite/all/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#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; + } + 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); + + if (interpreter->AllocateTensors() != kTfLiteOk) { + throw std::runtime_error("Failed to allocate tensors"); + } + + 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/CMakeLists.txt b/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tensorflow-lite/all/test_v1_package/conanfile.py b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..17a163fae24bd --- /dev/null +++ b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + 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) diff --git a/recipes/tensorflow-lite/config.yml b/recipes/tensorflow-lite/config.yml new file mode 100644 index 0000000000000..22d65dcfdfac6 --- /dev/null +++ b/recipes/tensorflow-lite/config.yml @@ -0,0 +1,3 @@ +versions: + "2.10.0": + folder: all diff --git a/recipes/tensorpipe/all/conandata.yml b/recipes/tensorpipe/all/conandata.yml new file mode 100644 index 0000000000000..7236b5e733c1d --- /dev/null +++ b/recipes/tensorpipe/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210316": + url: "https://github.com/pytorch/tensorpipe/archive/c54fdda499bbf78f277ea78c1e4d1f6d635b9a98.zip" + sha256: "65829f7ca0c50c4e84de88b2c4b0bb25bca4ec119a0a451ca5fd2f7cb348d5bd" diff --git a/recipes/tensorpipe/all/conanfile.py b/recipes/tensorpipe/all/conanfile.py new file mode 100644 index 0000000000000..0979c77b009b6 --- /dev/null +++ b/recipes/tensorpipe/all/conanfile.py @@ -0,0 +1,150 @@ +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, get, replace_in_file, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.51.3" + + +class TensorpipeConan(ConanFile): + name = "tensorpipe" + description = "The TensorPipe project provides a tensor-aware channel to " \ + "transfer rich objects from one process to another while " \ + "using the fastest transport for the tensors contained " \ + "therein (e.g., CUDA device-to-device copy)." + license = "BSD-3-Clause" + topics = ("tensor", "cuda") + homepage = "https://github.com/pytorch/tensorpipe" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cuda": [True, False], + "cuda_ipc": [True, False], + "ibv": [True, False], + "shm": [True, False], + "cma": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cuda": False, + "cuda_ipc": True, + "ibv": True, + "shm": True, + "cma": True, + } + + def config_options(self): + if self.settings.os != "Linux": + del self.options.ibv + del self.options.shm + del self.options.cma + + def configure(self): + if self.options.shared: + del self.options.fPIC + if not self.options.cuda: + del self.options.cuda_ipc + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libnop/cci.20200728") + self.requires("libuv/1.44.2") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Windows") + if self.options.cuda: + raise ConanInvalidConfiguration("cuda recipe not yet available in CCI") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TP_USE_CUDA"] = self.options.cuda + tc.variables["TP_ENABLE_IBV"] = self.options.get_safe("ibv", False) + tc.variables["TP_ENABLE_SHM"] = self.options.get_safe("shm", False) + tc.variables["TP_ENABLE_CMA"] = self.options.get_safe("cma", False) + tc.variables["TP_ENABLE_CUDA_IPC"] = self.options.get_safe("cuda_ipc", False) + tc.variables["TP_BUILD_BENCHMARK"] = False + tc.variables["TP_BUILD_PYTHON"] = False + tc.variables["TP_BUILD_TESTING"] = False + tc.variables["TP_BUILD_LIBUV"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "tensorpipe", "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(uv REQUIRED)", "find_package(libuv REQUIRED CONFIG)") + replace_in_file( + self, + cmakelists, + "target_link_libraries(tensorpipe PRIVATE uv::uv)", + "target_link_libraries(tensorpipe PRIVATE $,uv,uv_a>)", + ) + replace_in_file( + self, + cmakelists, + "target_include_directories(tensorpipe PUBLIC $)", + "find_package(libnop REQUIRED CONFIG)\ntarget_link_libraries(tensorpipe PUBLIC libnop::libnop)", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"tensorpipe": "Tensorpipe::Tensorpipe"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Tensorpipe") + self.cpp_info.set_property("cmake_target_name", "tensorpipe") + self.cpp_info.libs = ["tensorpipe"] + if is_apple_os(self): + self.cpp_info.frameworks = ["CoreFoundation", "IOKit"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Tensorpipe" + self.cpp_info.names["cmake_find_package_multi"] = "Tensorpipe" + 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/tensorpipe/all/test_package/CMakeLists.txt b/recipes/tensorpipe/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5d4b3c8d26da --- /dev/null +++ b/recipes/tensorpipe/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Tensorpipe REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tensorpipe) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tensorpipe/all/test_package/conanfile.py b/recipes/tensorpipe/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tensorpipe/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/tensorpipe/all/test_package/test_package.cpp b/recipes/tensorpipe/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d9eb62eb91b2a --- /dev/null +++ b/recipes/tensorpipe/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + auto context = std::make_shared(); + context->registerTransport(0, "uv", tensorpipe::transport::uv::create()); + return 0; +} diff --git a/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt b/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tensorpipe/all/test_v1_package/conanfile.py b/recipes/tensorpipe/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tensorpipe/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/tensorpipe/config.yml b/recipes/tensorpipe/config.yml new file mode 100644 index 0000000000000..8391ee9242ef2 --- /dev/null +++ b/recipes/tensorpipe/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210316": + folder: "all" diff --git a/recipes/termcap/all/CMakeLists.txt b/recipes/termcap/all/CMakeLists.txt new file mode 100644 index 0000000000000..8f1754f603024 --- /dev/null +++ b/recipes/termcap/all/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.1) +project(conan_termcap LANGUAGES C) + +include(CheckIncludeFile) +include(GNUInstallDirs) + +set(TERMCAP_SOURCES "" CACHE STRING "Sources of termcap") +set(TERMCAP_HEADERS "" CACHE STRING "Headers of termcap") +set(TERMCAP_INC_OPTS "" CACHE STRING "Optional includes of termcap") +set(TERMCAP_CAP_FILE "" CACHE STRING "Path of capability file") + +foreach(TERMCAP_INC_OPT ${TERMCAP_INC_OPTS}) + string(TOUPPER "${TERMCAP_INC_OPT}" _var) + string(REPLACE "." "_" _var "${_var}") + set(_var "HAVE_${_var}") + check_include_file("${TERMCAP_INC_OPT}" "${_var}") + if(${_var}) + add_definitions("-D${_var}") + endif() +endforeach() + +add_definitions(-DSTDC_HEADERS) +add_definitions(-DTERMCAP_BUILDING) +add_definitions("-DTERMCAP_FILE=\"${CMAKE_INSTALL_SYSCONFDIR}/termcap\"") +if(BUILD_SHARED_LIBS) + add_definitions(-DTERMCAP_SHARED) +endif() +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +add_library(termcap ${TERMCAP_SOURCES} ${TERMCAP_HEADERS}) +install(TARGETS termcap + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) +install(FILES ${TERMCAP_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(FILES ${TERMCAP_CAP_FILE} DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}" RENAME termcap) diff --git a/recipes/termcap/all/conandata.yml b/recipes/termcap/all/conandata.yml new file mode 100644 index 0000000000000..e1dc4852be620 --- /dev/null +++ b/recipes/termcap/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.3.1": + url: "https://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz" + sha256: "91a0e22e5387ca4467b5bcb18edf1c51b930262fd466d5fda396dd9d26719100" +patches: + "1.3.1": + - patch_file: "patches/0001-msvc.patch" + - patch_file: "patches/0002-macOS.patch" diff --git a/recipes/termcap/all/conanfile.py b/recipes/termcap/all/conanfile.py new file mode 100644 index 0000000000000..0acd77cf30764 --- /dev/null +++ b/recipes/termcap/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os +import re + +required_conan_version = ">=1.53.0" + + +class TermcapConan(ConanFile): + name = "termcap" + homepage = "https://www.gnu.org/software/termcap" + url = "https://github.com/conan-io/conan-center-index" + description = "Enables programs to use display terminals in a terminal-independent manner" + license = "GPL-2.0-or-later" + topics = ("terminal", "display", "text", "writing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "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) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _extract_sources(self): + makefile_text = open(os.path.join(self.source_folder, "Makefile.in")).read() + sources = list(f"{self.source_folder}/{src}" for src in re.search("\nSRCS = (.*)\n", makefile_text).group(1).strip().split(" ")) + headers = list(f"{self.source_folder}/{src}" for src in re.search("\nHDRS = (.*)\n", makefile_text).group(1).strip().split(" ")) + autoconf_text = open(os.path.join(self.source_folder, "configure.in")).read() + optional_headers = re.search(r"AC_HAVE_HEADERS\((.*)\)", autoconf_text).group(1).strip().split(" ") + return sources, headers, optional_headers + + def generate(self): + tc = CMakeToolchain(self) + to_cmake_paths = lambda paths: ";".join([p.replace("\\", "/") for p in paths]) + sources, headers, optional_headers = self._extract_sources() + tc.cache_variables["TERMCAP_SOURCES"] = to_cmake_paths(sources) + tc.cache_variables["TERMCAP_HEADERS"] = to_cmake_paths(headers) + tc.cache_variables["TERMCAP_INC_OPTS"] = to_cmake_paths(optional_headers) + tc.cache_variables["TERMCAP_CAP_FILE"] = os.path.join(self.source_folder, "termcap.src").replace("\\", "/") + tc.cache_variables["CMAKE_INSTALL_SYSCONFDIR"] = os.path.join(self.package_folder, "bin", "etc").replace("\\", "/") + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + if self.settings.os == "Windows": + for src in self._extract_sources()[0]: + txt = open(src).read() + with open(src, "w") as f: + f.write("#include \"termcap_intern.h\"\n\n") + f.write(txt) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + 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() + + @property + def _termcap_path(self): + return os.path.join(self.package_folder, "bin", "etc", "termcap") + + def package_info(self): + self.cpp_info.libs = ["termcap"] + if self.options.shared: + self.cpp_info.defines = ["TERMCAP_SHARED"] + + self.runenv_info.define_path("TERMCAP", self._termcap_path) + self.env_info.TERMCAP = self._termcap_path diff --git a/recipes/termcap/all/patches/0001-msvc.patch b/recipes/termcap/all/patches/0001-msvc.patch new file mode 100644 index 0000000000000..c590d507f004d --- /dev/null +++ b/recipes/termcap/all/patches/0001-msvc.patch @@ -0,0 +1,193 @@ +diff --git a/termcap.h b/termcap.h +index b19fb0a..1116b3f 100644 +--- a/termcap.h ++++ b/termcap.h +@@ -16,46 +16,71 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #ifndef _TERMCAP_H +-#define _TERMCAP_H 1 ++#define _TERMCAP_H ++#if defined _MSC_VER ++# define TERMCAP_SHARED_EXPORT_API __declspec(dllexport) ++# define TERMCAP_SHARED_IMPORT_API __declspec(dllimport) ++# define TERMCAP_STATIC_IMPORT_API ++# define TERMCAP_STATIC_EXPORT_API ++#else ++# define TERMCAP_SHARED_EXPORT_API __attribute__((visibility("default"))) ++# define TERMCAP_SHARED_IMPORT_API __attribute__((visibility("default"))) ++# define TERMCAP_STATIC_IMPORT_API ++# define TERMCAP_STATIC_EXPORT_API ++#endif ++ ++#if defined TERMCAP_BUILDING ++# define TERMCAP_SHARED_API TERMCAP_SHARED_EXPORT_API ++# define TERMCAP_STATIC_API TERMCAP_STATIC_EXPORT_API ++#else ++# define TERMCAP_SHARED_API TERMCAP_SHARED_IMPORT_API ++# define TERMCAP_STATIC_API TERMCAP_STATIC_IMPORT_API ++#endif ++ ++#if defined TERMCAP_SHARED ++# define TERMCAP_API TERMCAP_SHARED_API ++#else ++# define TERMCAP_API TERMCAP_STATIC_API ++#endif + + #if __STDC__ + +-extern int tgetent (char *buffer, const char *termtype); ++TERMCAP_API int tgetent (char *buffer, const char *termtype); + +-extern int tgetnum (const char *name); +-extern int tgetflag (const char *name); +-extern char *tgetstr (const char *name, char **area); ++TERMCAP_API int tgetnum (const char *name); ++TERMCAP_API int tgetflag (const char *name); ++TERMCAP_API char *tgetstr (const char *name, char **area); + +-extern char PC; +-extern short ospeed; +-extern void tputs (const char *string, int nlines, int (*outfun) (int)); ++TERMCAP_API extern char PC; ++TERMCAP_API extern short ospeed; ++TERMCAP_API void tputs (const char *string, int nlines, int (*outfun) (int)); + +-extern char *tparam (const char *ctlstring, char *buffer, int size, ...); ++TERMCAP_API char *tparam (const char *ctlstring, char *buffer, int size, ...); + +-extern char *UP; +-extern char *BC; ++TERMCAP_API extern char *UP; ++TERMCAP_API extern char *BC; + +-extern char *tgoto (const char *cstring, int hpos, int vpos); ++TERMCAP_API char *tgoto (const char *cstring, int hpos, int vpos); + + #else /* not __STDC__ */ + +-extern int tgetent (); ++TERMCAP_API int tgetent (); + +-extern int tgetnum (); +-extern int tgetflag (); +-extern char *tgetstr (); ++TERMCAP_API int tgetnum (); ++TERMCAP_API int tgetflag (); ++TERMCAP_API char *tgetstr (); + +-extern char PC; +-extern short ospeed; ++TERMCAP_API extern char PC; ++TERMCAP_API extern short ospeed; + +-extern void tputs (); ++TERMCAP_API void tputs (); + +-extern char *tparam (); ++TERMCAP_API char *tparam (); + +-extern char *UP; +-extern char *BC; ++TERMCAP_API extern char *UP; ++TERMCAP_API extern char *BC; + +-extern char *tgoto (); ++TERMCAP_API char *tgoto (); + + #endif /* not __STDC__ */ + +diff --git a/termcap_intern.h b/termcap_intern.h +new file mode 100644 +index 0000000..4179163 +--- /dev/null ++++ b/termcap_intern.h +@@ -0,0 +1,88 @@ ++/* Declarations for termcap library. ++ Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ ++ ++#ifndef _TERMCAP_H ++#define _TERMCAP_H 1 ++ ++#if defined _MSC_VER ++# define TERMCAP_SHARED_EXPORT_API __declspec(dllexport) ++# define TERMCAP_SHARED_IMPORT_API __declspec(dllimport) ++# define TERMCAP_STATIC_IMPORT_API ++# define TERMCAP_STATIC_EXPORT_API ++#else ++# define TERMCAP_SHARED_EXPORT_API __attribute__((visibility("default"))) ++# define TERMCAP_SHARED_IMPORT_API __attribute__((visibility("default"))) ++# define TERMCAP_STATIC_IMPORT_API ++# define TERMCAP_STATIC_EXPORT_API ++#endif ++ ++#if defined TERMCAP_BUILDING ++# define TERMCAP_SHARED_API TERMCAP_SHARED_EXPORT_API ++# define TERMCAP_STATIC_API TERMCAP_STATIC_EXPORT_API ++#else ++# define TERMCAP_SHARED_API TERMCAP_SHARED_IMPORT_API ++# define TERMCAP_STATIC_API TERMCAP_STATIC_IMPORT_API ++#endif ++ ++#if defined TERMCAP_SHARED ++# define TERMCAP_API TERMCAP_SHARED_API ++#else ++# define TERMCAP_API TERMCAP_STATIC_API ++#endif ++ ++#if __STDC__ ++ ++TERMCAP_API int tgetent (char *buffer, char *termtype); ++ ++TERMCAP_API int tgetnum ( char *name); ++TERMCAP_API int tgetflag ( char *name); ++TERMCAP_API char *tgetstr ( char *name, char **area); ++ ++TERMCAP_API extern char PC; ++TERMCAP_API extern short ospeed; ++TERMCAP_API void tputs ( char *string, int nlines, int (*outfun) (int)); ++ ++TERMCAP_API char *tparam (); ++ ++TERMCAP_API extern char *UP; ++TERMCAP_API extern char *BC; ++ ++TERMCAP_API char *tgoto ( char *cstring, int hpos, int vpos); ++ ++#else /* not __STDC__ */ ++ ++TERMCAP_API int tgetent (); ++ ++TERMCAP_API int tgetnum (); ++TERMCAP_API int tgetflag (); ++TERMCAP_API char *tgetstr (); ++ ++TERMCAP_API extern char PC; ++TERMCAP_API extern short ospeed; ++ ++TERMCAP_API void tputs (); ++ ++TERMCAP_API char *tparam (); ++ ++TERMCAP_API extern char *UP; ++TERMCAP_API extern char *BC; ++ ++TERMCAP_API char *tgoto (); ++ ++#endif /* not __STDC__ */ ++ ++#endif /* not _TERMCAP_H */ diff --git a/recipes/termcap/all/patches/0002-macOS.patch b/recipes/termcap/all/patches/0002-macOS.patch new file mode 100644 index 0000000000000..2d3112557b71b --- /dev/null +++ b/recipes/termcap/all/patches/0002-macOS.patch @@ -0,0 +1,15 @@ +diff --git a/tparam.c b/tparam.c +index 5a9809a..09ef456 100644 +--- a/tparam.c ++++ b/tparam.c +@@ -40,6 +40,10 @@ char *realloc (); + + #endif /* not emacs */ + ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++ + #ifndef NULL + #define NULL (char *) 0 + #endif diff --git a/recipes/termcap/all/test_package/CMakeLists.txt b/recipes/termcap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..57743fe7229db --- /dev/null +++ b/recipes/termcap/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(termcap CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE termcap::termcap) diff --git a/recipes/termcap/all/test_package/conanfile.py b/recipes/termcap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..299c3facd9ebf --- /dev/null +++ b/recipes/termcap/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import Environment +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 generate(self): + env = Environment() + env.define("TERM", "xtermc") + env.vars(self, scope="run").save_script("conanrun_term") + + 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/termcap/all/test_package/test_package.c b/recipes/termcap/all/test_package/test_package.c new file mode 100644 index 0000000000000..389a305a566e9 --- /dev/null +++ b/recipes/termcap/all/test_package/test_package.c @@ -0,0 +1,39 @@ +#include + +#include +#include + +int main() +{ + char buf[2048] = {0}; + char *cl_string, *cm_string; + int auto_wrap, height, width; + + const char* term = getenv("TERM"); + if (term == NULL) { + fprintf(stderr, "TERM environment variable not defined\n"); + return 0; + } else { + int res = tgetent(buf, term); + switch(res) { + case -1: fprintf(stderr, "tgetent: database not found\n"); break; + case 0: fprintf(stderr, "tgetent: no such entry\n"); break; + case 1: fprintf(stderr, "tgetent: success\n"); break; + default: fprintf(stderr, "Unknown tgetent return variable\n"); break; + } + } + + cl_string = tgetstr ("cl", NULL); + cm_string = tgetstr ("cm", NULL); + auto_wrap = tgetflag ("am"); + height = tgetnum ("li"); + width = tgetnum ("co"); + + printf("cl: %s\n", cl_string); + printf("cm: %s\n", cm_string); + printf("am: %d\n", auto_wrap); + printf("li: %d\n", height); + printf("co: %d\n", width); + + return EXIT_SUCCESS; +} diff --git a/recipes/termcap/all/test_v1_package/CMakeLists.txt b/recipes/termcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/termcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/termcap/all/test_v1_package/conanfile.py b/recipes/termcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a7ccb827b1a74 --- /dev/null +++ b/recipes/termcap/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + with tools.environment_append({"TERM": "xtermc"}): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/termcap/config.yml b/recipes/termcap/config.yml new file mode 100644 index 0000000000000..59334d5077368 --- /dev/null +++ b/recipes/termcap/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.1": + folder: all diff --git a/recipes/termcolor/all/conandata.yml b/recipes/termcolor/all/conandata.yml new file mode 100644 index 0000000000000..7d738491fce56 --- /dev/null +++ b/recipes/termcolor/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "2.1.0": + url: "https://github.com/ikalnytskyi/termcolor/archive/v2.1.0.tar.gz" + sha256: "435994c32557674469404cb1527c283fdcf45746f7df75fd2996bb200d6a759f" + "2.0.0": + url: "https://github.com/ikalnytskyi/termcolor/archive/v2.0.0.tar.gz" + sha256: "4a73a77053822ca1ed6d4a2af416d31028ec992fb0ffa794af95bd6216bb6a20" + "1.0.1": + url: "https://github.com/ikalnytskyi/termcolor/archive/v1.0.1.tar.gz" + sha256: "612f9ff785c74dcbe081bb82e8c915858572cf97dcf396ea7bd6a7d21cf6026a" + diff --git a/recipes/termcolor/all/conanfile.py b/recipes/termcolor/all/conanfile.py new file mode 100644 index 0000000000000..6c4c0eeda2585 --- /dev/null +++ b/recipes/termcolor/all/conanfile.py @@ -0,0 +1,36 @@ +import os +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + +class TermcolorConan(ConanFile): + name = "termcolor" + description = "Termcolor is a header-only C++ library for printing colored messages to the terminal." + topics = ("termcolor", "terminal", "color") + license = "BSD-3-Clause" + homepage = "https://github.com/ikalnytskyi/termcolor" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package_id(self): + self.info.header_only() + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(source_folder=self._source_subfolder) + return cmake + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/termcolor/all/test_package/CMakeLists.txt b/recipes/termcolor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07ff01a5a223c --- /dev/null +++ b/recipes/termcolor/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(termcolor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} termcolor::termcolor) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/termcolor/all/test_package/conanfile.py b/recipes/termcolor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/termcolor/all/test_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/termcolor/all/test_package/test_package.cpp b/recipes/termcolor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b3f73b1576beb --- /dev/null +++ b/recipes/termcolor/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +int main(int /*argc*/, char** /*argv*/) +{ + std::cout << termcolor::red << termcolor::on_white << "Hello, "; + std::cout << termcolor::reset << termcolor::blink << termcolor::green << "Colorful "; + std::cout << termcolor::reset << termcolor::underline << termcolor::blue << "World!"; + std::cout << std::endl << termcolor::reset; + return 0; +} diff --git a/recipes/termcolor/config.yml b/recipes/termcolor/config.yml new file mode 100644 index 0000000000000..966c0e2adcb93 --- /dev/null +++ b/recipes/termcolor/config.yml @@ -0,0 +1,7 @@ +versions: + "2.1.0": + folder: "all" + "2.0.0": + folder: "all" + "1.0.1": + folder: "all" diff --git a/recipes/tesseract/all/conandata.yml b/recipes/tesseract/all/conandata.yml new file mode 100644 index 0000000000000..7daa1a412e05d --- /dev/null +++ b/recipes/tesseract/all/conandata.yml @@ -0,0 +1,55 @@ +sources: + "5.3.0": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.0.tar.gz" + sha256: "7e70870f8341e5ea228af2836ce79a36eefa11b01b56177b4a8997f330c014b8" + "5.2.0": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.2.0.tar.gz" + sha256: "eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c" + "5.1.0": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.1.0.tar.gz" + sha256: "fdec8528d5a0ecc28ab5fff985e0b8ced60726f6ef33f54126f2868e323d4bd2" + "5.0.0": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.0.0.tar.gz" + sha256: "72467b7876dc0c39ef7fbcb0f793f73aee1c78d9fabab3ab19cbac1eb42e9fed" + "4.1.1": + url: "https://github.com/tesseract-ocr/tesseract/archive/4.1.1.tar.gz" + sha256: "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb" +patches: + "5.3.0": + - patch_file: "patches/0004-control-optimizations-5.3.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + "5.2.0": + - patch_file: "patches/0002-Link-with-targets-5.2.0.patch" + patch_description: "link cci package" + patch_type: "conan" + - patch_file: "patches/0004-control-optimizations-5.2.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + "5.1.0": + - patch_file: "patches/0002-Link-with-targets-5.1.0.patch" + patch_description: "link cci package" + patch_type: "conan" + - patch_file: "patches/0004-control-optimizations-5.1.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + "5.0.0": + - patch_file: "patches/0002-Link-with-targets-5.0.0.patch" + patch_description: "link cci package" + patch_type: "conan" + - patch_file: "patches/0004-control-optimizations-5.0.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + "4.1.1": + - patch_file: "patches/0001-install-bundle.patch" + patch_description: "fix runtime install path" + patch_type: "conan" + - patch_file: "patches/0002-Link-with-targets.patch" + patch_description: "link cci package" + patch_type: "conan" + - patch_file: "patches/0003-Dont-change-locale.patch" + patch_description: "disable settings locale" + patch_type: "portability" + - patch_file: "patches/0004-control-optimizations-4.1.1.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py new file mode 100644 index 0000000000000..bbdcc2c253a14 --- /dev/null +++ b/recipes/tesseract/all/conanfile.py @@ -0,0 +1,217 @@ +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, get, copy, rmdir, save +from conan.tools.scm import Version + +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class TesseractConan(ConanFile): + name = "tesseract" + description = "Tesseract Open Source OCR Engine" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tesseract-ocr/tesseract" + topics = ("ocr", "image", "multimedia", "graphics") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_auto_optimize": [True, False], + "with_march_native": [True, False], + "with_training": [True, False], + "with_libcurl": [True, False], + "with_libarchive": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_auto_optimize": False, + "with_march_native": False, + "with_training": False, + "with_libcurl": True, + "with_libarchive": True, + } + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "5.0.0" else "17" + + @property + def _compilers_minimum_version(self): + return { + "11": { + "Visual Studio": "14", + "msvc": "190", + "gcc": "5", + "clang": "5", + "apple-clang": "6", + }, + "17": { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "7", + "apple-clang": "11", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "5.0.0": + del self.options.with_libcurl + del self.options.with_libarchive + + 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("leptonica/1.82.0") + # libarchive is required for 4.x so default value is true + if self.options.get_safe("with_libarchive", default=True): + self.requires("libarchive/3.6.2") + # libcurl is not required for 4.x + if self.options.get_safe("with_libcurl", default=False): + self.requires("libcurl/8.0.1") + + 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_training: + # do not enforce failure and allow user to build with system cairo, pango, fontconfig + self.output.warning("*** Build with training is not yet supported, continue on your own") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TRAINING_TOOLS"] = self.options.with_training + tc.variables["INSTALL_CONFIGS"] = self.options.with_training + + # pre-5.0.0 uses custom STATIC variable instead of BUILD_SHARED_LIBS + if Version(self.version) < "5.0.0": + tc.variables["STATIC"] = not self.options.shared + + # Use CMake-based package build and dependency detection, not the pkg-config, cppan or SW + tc.variables["CPPAN_BUILD"] = False + tc.variables["SW_BUILD"] = False + + # disable autodetect of vector extensions and march=native + tc.variables["ENABLE_OPTIMIZATIONS"] = self.options.with_auto_optimize + + if Version(self.version) < "5.0.0": + tc.variables["AUTO_OPTIMIZE"] = self.options.with_auto_optimize + + # Set Leptonica_DIR to ensure that find_package will be called in original CMake file + tc.variables["Leptonica_DIR"] = self.dependencies["leptonica"].package_folder.replace("\\", "/") + + if Version(self.version) >= "5.0.0": + tc.variables["DISABLE_CURL"] = not self.options.with_libcurl + tc.variables["DISABLE_ARCHIVE"] = not self.options.with_libarchive + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + 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")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"libtesseract": "Tesseract::libtesseract"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + # Official CMake imported target is: + # - libtesseract if < 5.0.0 + # - Tesseract::libtesseract if >= 5.0.0 (not yet released) + # We provide both targets + self.cpp_info.set_property("cmake_file_name", "Tesseract") + self.cpp_info.set_property("cmake_target_name", "Tesseract::libtesseract") + self.cpp_info.set_property("cmake_target_aliases", ["libtesseract"]) + self.cpp_info.set_property("pkg_config_name", "tesseract") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["libtesseract"].libs = [self._libname] + self.cpp_info.components["libtesseract"].requires = ["leptonica::leptonica"] + if self.options.get_safe("with_libcurl", default=False): + self.cpp_info.components["libtesseract"].requires.append("libcurl::libcurl") + if self.options.get_safe("with_libarchive", default=True): + self.cpp_info.components["libtesseract"].requires.append("libarchive::libarchive") + if self.options.shared: + self.cpp_info.components["libtesseract"].defines = ["TESS_IMPORTS"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libtesseract"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["libtesseract"].system_libs = ["ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "Tesseract" + self.cpp_info.names["cmake_find_package_multi"] = "Tesseract" + self.cpp_info.components["libtesseract"].names["cmake_find_package"] = "libtesseract" + self.cpp_info.components["libtesseract"].names["cmake_find_package_multi"] = "libtesseract" + self.cpp_info.components["libtesseract"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libtesseract"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["libtesseract"].set_property("pkg_config_name", "tesseract") + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + + @property + def _libname(self): + suffix = "" + if self.settings.os == "Windows": + v = Version(self.version) + suffix += f"{v.major}{v.minor}" + if self.settings.build_type == "Debug": + suffix += "d" + return f"tesseract{suffix}" diff --git a/recipes/tesseract/all/patches/0001-install-bundle.patch b/recipes/tesseract/all/patches/0001-install-bundle.patch new file mode 100644 index 0000000000000..6cb91f3e0dc70 --- /dev/null +++ b/recipes/tesseract/all/patches/0001-install-bundle.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -537,7 +537,7 @@ get_target_property(tesseract_VERSION libtesseract VERSION) + get_target_property(tesseract_OUTPUT_NAME libtesseract OUTPUT_NAME) + configure_file(tesseract.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc DESTINATION lib/pkgconfig) +-install(TARGETS tesseract RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++install(TARGETS tesseract DESTINATION bin) + install(TARGETS libtesseract EXPORT TesseractTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT TesseractTargets DESTINATION cmake) + install(FILES diff --git a/recipes/tesseract/all/patches/0002-Link-with-targets-5.0.0.patch b/recipes/tesseract/all/patches/0002-Link-with-targets-5.0.0.patch new file mode 100644 index 0000000000000..0a903756d07b4 --- /dev/null +++ b/recipes/tesseract/all/patches/0002-Link-with-targets-5.0.0.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cf554090..98e0f843 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -696,7 +696,7 @@ if(OpenMP_CXX_FOUND) + target_link_libraries(libtesseract PUBLIC OpenMP::OpenMP_CXX) + endif() + if(LibArchive_FOUND) +- target_link_libraries(libtesseract PUBLIC ${LibArchive_LIBRARIES}) ++ target_link_libraries(libtesseract PUBLIC LibArchive::LibArchive) + endif(LibArchive_FOUND) + if(CURL_FOUND) + if(NOT "${CURL_LIBRARIES}") +@@ -722,7 +722,7 @@ if (SW_BUILD) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake "include(${CMAKE_CURRENT_BINARY_DIR}/cppan.cmake)\n") + export(TARGETS libtesseract APPEND FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake NAMESPACE Tesseract::) + else() +- target_link_libraries (libtesseract PUBLIC ${Leptonica_LIBRARIES}) ++ target_link_libraries (libtesseract PUBLIC leptonica) + export(TARGETS libtesseract FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake NAMESPACE Tesseract::) + endif() + diff --git a/recipes/tesseract/all/patches/0002-Link-with-targets-5.1.0.patch b/recipes/tesseract/all/patches/0002-Link-with-targets-5.1.0.patch new file mode 100644 index 0000000000000..f06650c733a01 --- /dev/null +++ b/recipes/tesseract/all/patches/0002-Link-with-targets-5.1.0.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 64f3b131..2be1f8d1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -755,7 +755,7 @@ if(OpenMP_CXX_FOUND) + target_link_libraries(libtesseract PUBLIC OpenMP::OpenMP_CXX) + endif() + if(LibArchive_FOUND) +- target_link_libraries(libtesseract PUBLIC ${LibArchive_LIBRARIES}) ++ target_link_libraries(libtesseract PUBLIC LibArchive::LibArchive) + endif(LibArchive_FOUND) + if(CURL_FOUND) + if(NOT CURL_LIBRARIES) +@@ -790,7 +790,7 @@ if(SW_BUILD) + FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake + NAMESPACE Tesseract::) + else() +- target_link_libraries(libtesseract PUBLIC ${Leptonica_LIBRARIES}) ++ target_link_libraries(libtesseract PUBLIC leptonica) + export( + TARGETS libtesseract + FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake diff --git a/recipes/tesseract/all/patches/0002-Link-with-targets-5.2.0.patch b/recipes/tesseract/all/patches/0002-Link-with-targets-5.2.0.patch new file mode 100644 index 0000000000000..6c792c7f29bee --- /dev/null +++ b/recipes/tesseract/all/patches/0002-Link-with-targets-5.2.0.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bd2649d..5abcc97 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -792,7 +792,7 @@ if(OpenCL_FOUND) + target_link_libraries(libtesseract PUBLIC OpenCL::OpenCL) + endif() + if(LibArchive_FOUND) +- target_link_libraries(libtesseract PUBLIC ${LibArchive_LIBRARIES}) ++ target_link_libraries(libtesseract PUBLIC LibArchive::LibArchive) + endif(LibArchive_FOUND) + if(CURL_FOUND) + if(NOT CURL_LIBRARIES) +@@ -827,7 +827,7 @@ if(SW_BUILD) + FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake + NAMESPACE Tesseract::) + else() +- target_link_libraries(libtesseract PUBLIC ${Leptonica_LIBRARIES}) ++ target_link_libraries(libtesseract PUBLIC leptonica) + export( + TARGETS libtesseract + FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake diff --git a/recipes/tesseract/all/patches/0002-Link-with-targets.patch b/recipes/tesseract/all/patches/0002-Link-with-targets.patch new file mode 100644 index 0000000000000..bffd512b1d705 --- /dev/null +++ b/recipes/tesseract/all/patches/0002-Link-with-targets.patch @@ -0,0 +1,18 @@ +Variable Leptonica_LIBRARIES does not know about its dependencies which are handled only +by exported cmake/pc files which are not used by Conan. +Therefore link with exported target from the autogenerated CMake file by the cmake_find_package +that contains information about all dependencies +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -491,8 +491,8 @@ elseif (SW_BUILD) + export(TARGETS libtesseract APPEND FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake) + else() + target_link_libraries (libtesseract PUBLIC +- ${Leptonica_LIBRARIES} +- ${LibArchive_LIBRARIES} ++ leptonica ++ LibArchive::LibArchive + ) + export(TARGETS libtesseract FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake) + endif() diff --git a/recipes/tesseract/all/patches/0003-Dont-change-locale.patch b/recipes/tesseract/all/patches/0003-Dont-change-locale.patch new file mode 100644 index 0000000000000..abe5b612381f6 --- /dev/null +++ b/recipes/tesseract/all/patches/0003-Dont-change-locale.patch @@ -0,0 +1,11 @@ +--- a/src/api/baseapi.cpp ++++ b/src/api/baseapi.cpp +@@ -219,7 +219,7 @@ TessBaseAPI::TessBaseAPI() + // problems caused by the locale settings. + + // Use the current locale if building debug code. +- std::locale::global(std::locale("")); ++ // std::locale::global(std::locale("")); + #endif + } + diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch b/recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch new file mode 100644 index 0000000000000..8df4fc161cb0c --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -265,7 +265,7 @@ + set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -O3 -ffast-math") + endif() + CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) +-if(COMPILER_SUPPORTS_MARCH_NATIVE) ++if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) + set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native -mtune=native") + set(MARCH_NATIVE_OPT ON) + endif() diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-5.0.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.0.0.patch new file mode 100644 index 0000000000000..031ed3d2e019b --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.0.0.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cf554090..0417fda0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -138,7 +138,7 @@ else() + endif() + + CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) +-if(COMPILER_SUPPORTS_MARCH_NATIVE) ++if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) + set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native") + if(NOT CLANG AND MSVC) + # clang-cl does not know this argument +@@ -149,7 +149,7 @@ endif() + + message("CMAKE_SYSTEM_PROCESSOR=<${CMAKE_SYSTEM_PROCESSOR}>") + +-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|AMD64") ++if(ENABLE_OPTIMIZATIONS AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|AMD64") + + set(HAVE_NEON FALSE) + +@@ -220,7 +220,7 @@ set(HAVE_SSE4_1 FALSE) + add_definitions("-DHAVE_NEON") + set(HAVE_NEON TRUE) + +-else() ++elseif(ENABLE_OPTIMIZATIONS) + + set(HAVE_AVX FALSE) + set(HAVE_AVX2 FALSE) +@@ -236,6 +236,7 @@ endif() + endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|AMD64") + + # auto optimize - used only for information about available vectors ++if (ENABLE_OPTIMIZATIONS) + include(OptimizeForArchitecture) + OptimizeForArchitecture() + # remove global definition to eliminate effect on build +@@ -247,6 +248,7 @@ endforeach(_flag) + foreach(flag ${Vc_ARCHITECTURE_FLAGS}) + set(Vc_CXX_FLAGS "${Vc_CXX_FLAGS} ${flag}") + endforeach() ++endif() + + # Compiler specific environments + if(CMAKE_COMPILER_IS_GNUCXX OR MINGW) + diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-5.1.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.1.0.patch new file mode 100644 index 0000000000000..f80b648ad0679 --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.1.0.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 64f3b131..32b21a8c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -143,7 +143,7 @@ else() + endif() + + check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) +-if(COMPILER_SUPPORTS_MARCH_NATIVE) ++if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) + set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native") + if(NOT CLANG AND MSVC) + # clang-cl does not know this argument +@@ -154,7 +154,7 @@ endif() + + message("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) + +@@ -239,7 +239,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*") + add_definitions("-DHAVE_NEON") + endif() + +-else() ++else(ENABLE_OPTIMIZATIONS) + + set(HAVE_AVX FALSE) + set(HAVE_AVX2 FALSE) diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-5.2.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.2.0.patch new file mode 100644 index 0000000000000..74a65e1cc216d --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.2.0.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5abcc97..fca45ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,7 +144,7 @@ else() + endif() + + check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) +-if(COMPILER_SUPPORTS_MARCH_NATIVE) ++if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) + set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native") + if(NOT CLANG AND MSVC) + # clang-cl does not know this argument +@@ -155,7 +155,7 @@ endif() + + 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) +@@ -255,7 +255,7 @@ else() + set(HAVE_NEON FALSE) + set(HAVE_SSE4_1 FALSE) + +-endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") ++endif(ENABLE_OPTIMIZATIONS AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") + + # Compiler specific environments + if(CMAKE_COMPILER_IS_GNUCXX OR MINGW) diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch new file mode 100644 index 0000000000000..493ab5b70ee14 --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8c6845c..6e56862 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,7 +144,7 @@ else() + endif() + + check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) +-if(COMPILER_SUPPORTS_MARCH_NATIVE) ++if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) + set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native") + if(NOT CLANG AND MSVC) + # clang-cl does not know this argument +@@ -155,7 +155,7 @@ endif() + + 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) +@@ -255,7 +255,7 @@ else() + set(HAVE_NEON FALSE) + set(HAVE_SSE4_1 FALSE) + +-endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") ++endif(ENABLE_OPTIMIZATIONS AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") + + # Compiler specific environments + if(CMAKE_COMPILER_IS_GNUCXX OR MINGW) diff --git a/recipes/tesseract/all/test_package/CMakeLists.txt b/recipes/tesseract/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b9b9eb1f26670 --- /dev/null +++ b/recipes/tesseract/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Tesseract REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET Tesseract::libtesseract) + target_link_libraries(${PROJECT_NAME} PRIVATE Tesseract::libtesseract) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE libtesseract) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tesseract/all/test_package/conanfile.py b/recipes/tesseract/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/tesseract/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/tesseract/all/test_package/test_package.cpp b/recipes/tesseract/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..347eb5141c4c3 --- /dev/null +++ b/recipes/tesseract/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main(int argc, char **argv) { + printf("Tesseract version: %s\n", tesseract::TessBaseAPI::Version()); + return 0; +} + diff --git a/recipes/tesseract/all/test_v1_package/CMakeLists.txt b/recipes/tesseract/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/tesseract/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tesseract/all/test_v1_package/conanfile.py b/recipes/tesseract/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/tesseract/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tesseract/config.yml b/recipes/tesseract/config.yml new file mode 100644 index 0000000000000..18a9581e91b42 --- /dev/null +++ b/recipes/tesseract/config.yml @@ -0,0 +1,11 @@ +versions: + "5.3.0": + folder: all + "5.2.0": + folder: all + "5.1.0": + folder: all + "5.0.0": + folder: all + "4.1.1": + folder: all diff --git a/recipes/tgbot/all/CMakeLists.txt b/recipes/tgbot/all/CMakeLists.txt new file mode 100644 index 0000000000000..959835f6b0885 --- /dev/null +++ b/recipes/tgbot/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/tgbot/all/conandata.yml b/recipes/tgbot/all/conandata.yml new file mode 100644 index 0000000000000..054b04f19ea35 --- /dev/null +++ b/recipes/tgbot/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.5": + url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.5.tar.gz" + sha256: "ecd5a21ea45b890828aba1639ac49401cfdd5b30f791322cb1ba84c9ac77647c" + "1.3": + url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.3.tar.gz" + sha256: "85b9aef49c595d39fc9dc330b1b83625bea9509966dc623f7b4c1ee7309679c9" + "1.2.1": + url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.2.1.tar.gz" + sha256: "bcc82cc8c421e96098ba6ef350acc0c1ce9fbbc21a11b91eb8643324757d09f2" + "1.2": + url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.2.tar.gz" + sha256: "6d5158db38fb092e12060080a611ccdccde35cfb85f030996daee9619bebc513" diff --git a/recipes/tgbot/all/conanfile.py b/recipes/tgbot/all/conanfile.py new file mode 100644 index 0000000000000..b7db60eafd261 --- /dev/null +++ b/recipes/tgbot/all/conanfile.py @@ -0,0 +1,92 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class TgbotConan(ConanFile): + name = "tgbot" + + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://reo7sp.github.io/tgbot-cpp" + description = "C++ library for Telegram bot API" + topics = ("tgbot", "telegram", "telegram-api", "telegram-bot", "bot") + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake", "cmake_find_package" + exports_sources = ["CMakeLists.txt"] + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("boost/1.79.0") + self.requires("libcurl/7.84.0") + self.requires("openssl/1.1.1q") + + @property + def _required_boost_components(self): + return ["system"] + + def validate(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + 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 source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + # Don't force PIC + tools.replace_in_file( + os.path.join(self._source_subfolder, "CMakeLists.txt"), + "set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)", + "" + ) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["ENABLE_TESTS"] = False + self._cmake.configure() + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = ["TgBot"] + self.cpp_info.requires = ["boost::headers", "boost::system", "libcurl::libcurl", "openssl::openssl"] diff --git a/recipes/tgbot/all/test_package/CMakeLists.txt b/recipes/tgbot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b41fdddf1c066 --- /dev/null +++ b/recipes/tgbot/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tgbot REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} tgbot::tgbot) diff --git a/recipes/tgbot/all/test_package/conanfile.py b/recipes/tgbot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7122b776c7119 --- /dev/null +++ b/recipes/tgbot/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/tgbot/all/test_package/test_package.cpp b/recipes/tgbot/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e5cf1ddb1a0a5 --- /dev/null +++ b/recipes/tgbot/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +int main() { + TgBot::Bot bot("PLACE YOUR TOKEN HERE"); + bot.getEvents().onCommand("start", [&bot](TgBot::Message::Ptr message) { + bot.getApi().sendMessage(message->chat->id, "Hi!"); + }); + bot.getEvents().onAnyMessage([&bot](TgBot::Message::Ptr message) { + printf("User wrote %s\n", message->text.c_str()); + if (StringTools::startsWith(message->text, "/start")) { + return; + } + bot.getApi().sendMessage(message->chat->id, "Your message is: " + message->text); + }); + try { + printf("Bot username: %s\n", bot.getApi().getMe()->username.c_str()); + TgBot::TgLongPoll longPoll(bot); + while (true) { + printf("Long poll started\n"); + longPoll.start(); + } + } catch (TgBot::TgException& e) { + printf("error: %s\n", e.what()); + } + return 0; +} diff --git a/recipes/tgbot/config.yml b/recipes/tgbot/config.yml new file mode 100644 index 0000000000000..220c83c443ceb --- /dev/null +++ b/recipes/tgbot/config.yml @@ -0,0 +1,9 @@ +versions: + "1.5": + folder: all + "1.3": + folder: all + "1.2.1": + folder: all + "1.2": + folder: all diff --git a/recipes/tgc/all/CMakeLists.txt b/recipes/tgc/all/CMakeLists.txt new file mode 100644 index 0000000000000..8f1121172b940 --- /dev/null +++ b/recipes/tgc/all/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.4) +project(tgc LANGUAGES C) + +add_library(tgc ${TGC_SRC_DIR}/tgc.c) +set_property(TARGET tgc PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +include(GNUInstallDirs) +install(TARGETS tgc + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${TGC_SRC_DIR}/tgc.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/tgc/all/conandata.yml b/recipes/tgc/all/conandata.yml new file mode 100644 index 0000000000000..ca84aad8599c1 --- /dev/null +++ b/recipes/tgc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20170813": + url: "https://github.com/orangeduck/tgc/archive/e193133e43af0862f51edfb9b518e212ea084412.zip" + sha256: "d0fa9259e268df583264b7fffbe2784467f9552e864a49d985fb9451b8ff24d4" diff --git a/recipes/tgc/all/conanfile.py b/recipes/tgc/all/conanfile.py new file mode 100644 index 0000000000000..9864929c0cf10 --- /dev/null +++ b/recipes/tgc/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class TgcConan(ConanFile): + name = "tgc" + description = "A Tiny Garbage Collector for C." + license = "BSD-2-Clause" + topics = ("garbage-collector",) + homepage = "https://github.com/orangeduck/tgc" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TGC_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.md", 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 = ["tgc"] diff --git a/recipes/tgc/all/test_package/CMakeLists.txt b/recipes/tgc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c3e8ecbc7e427 --- /dev/null +++ b/recipes/tgc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tgc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tgc::tgc) diff --git a/recipes/tgc/all/test_package/conanfile.py b/recipes/tgc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tgc/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/tgc/all/test_package/test_package.c b/recipes/tgc/all/test_package/test_package.c new file mode 100644 index 0000000000000..887575be1866b --- /dev/null +++ b/recipes/tgc/all/test_package/test_package.c @@ -0,0 +1,18 @@ +#include + +static tgc_t gc; + +static void example_function() { + char *message = tgc_alloc(&gc, 64); + strcpy(message, "No More Memory Leaks!"); +} + +int main(int argc, char **argv) { + tgc_start(&gc, &argc); + + example_function(); + + tgc_stop(&gc); + + return 0; +} diff --git a/recipes/tgc/all/test_v1_package/CMakeLists.txt b/recipes/tgc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tgc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tgc/all/test_v1_package/conanfile.py b/recipes/tgc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tgc/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/tgc/config.yml b/recipes/tgc/config.yml new file mode 100644 index 0000000000000..98edd5577b112 --- /dev/null +++ b/recipes/tgc/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20170813": + folder: all diff --git a/recipes/thelink2012-any/all/conandata.yml b/recipes/thelink2012-any/all/conandata.yml new file mode 100644 index 0000000000000..05fc280a1c100 --- /dev/null +++ b/recipes/thelink2012-any/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200719": + url: "https://github.com/thelink2012/any/archive/f67bd5f8bbf7eb628bf38206d4ac5cb22438e6bb.tar.gz" + sha256: "1cd121a2fb27936213397ff4ff94fe4d6d4e28cabc13894cc4512eb046d71be8" diff --git a/recipes/thelink2012-any/all/conanfile.py b/recipes/thelink2012-any/all/conanfile.py new file mode 100644 index 0000000000000..2ecc1a7f7608f --- /dev/null +++ b/recipes/thelink2012-any/all/conanfile.py @@ -0,0 +1,37 @@ +from conans import ConanFile, tools + +required_conan_version = ">=1.33.0" + +class Thelink2012AnyConan(ConanFile): + name = "thelink2012-any" + license = "BSL-1.0" + description = "Implementation of std::experimental::any, including small object optimization, for C++11 compilers" + topics = ("any", "c++11", "data-structures") + homepage = "https://github.com/thelink2012/any" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE*", "licenses", self._source_subfolder) + self.copy("any.hpp", "include", self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "any" + self.cpp_info.names["cmake_find_package_multi"] = "any" + self.cpp_info.set_property("cmake_target_name", "any::any") diff --git a/recipes/thelink2012-any/all/test_package/CMakeLists.txt b/recipes/thelink2012-any/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e31011d1713d --- /dev/null +++ b/recipes/thelink2012-any/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(any CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} any::any) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/thelink2012-any/all/test_package/conanfile.py b/recipes/thelink2012-any/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6b551939fbde3 --- /dev/null +++ b/recipes/thelink2012-any/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/thelink2012-any/all/test_package/test_package.cpp b/recipes/thelink2012-any/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65191e73623ed --- /dev/null +++ b/recipes/thelink2012-any/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +#include "any.hpp" + +struct big_type { + char i_wanna_be_big[256]; + std::string value; + + big_type() : + value(std::string(300, 'b')) + { + i_wanna_be_big[0] = i_wanna_be_big[50] = 'k'; + } +}; + +int main() { + linb::any x = 4; + linb::any y = big_type{}; + linb::any z = 6.5; + + y.clear(); + + x = y; + + z = linb::any(); + + return 0; +} diff --git a/recipes/thelink2012-any/config.yml b/recipes/thelink2012-any/config.yml new file mode 100644 index 0000000000000..1eac063d13841 --- /dev/null +++ b/recipes/thelink2012-any/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200719": + folder: all diff --git a/recipes/theora/all/CMakeLists.txt b/recipes/theora/all/CMakeLists.txt new file mode 100644 index 0000000000000..d51dd8c636707 --- /dev/null +++ b/recipes/theora/all/CMakeLists.txt @@ -0,0 +1,122 @@ +cmake_minimum_required(VERSION 3.15) +project(theora C) + +# Note that I wrote this cmake file because: +# - the old msvc sln was very old and required upgrades each time it was built +# - the old msvc did not support RelWithDebInfo +# - the recipe needed to be upgraded for conan-v2, so a simpler recipe was desired + +find_package(Ogg CONFIG REQUIRED) + +set (HEADERS + "include/theora/codec.h" + "include/theora/theora.h" + "include/theora/theoradec.h" + "include/theora/theoraenc.h" +) + +set(LIBTHEORA_COMMON + "lib/apiwrapper.c" + "lib/bitpack.c" # was not in enc in SConstruct + "lib/dequant.c" + "lib/fragment.c" + "lib/idct.c" + "lib/info.c" # was not in enc in SConstruct + "lib/internal.c" + "lib/state.c" + "lib/quant.c" + ) + +set(LIBTHEORA_ENC + "lib/analyze.c" + "lib/encapiwrapper.c" + "lib/encfrag.c" + "lib/encinfo.c" + "lib/encode.c" + "lib/enquant.c" + "lib/fdct.c" + "lib/huffenc.c" + "lib/mathops.c" + "lib/mcenc.c" + "lib/rate.c" + "lib/tokenize.c" + ) + + +set(LIBTHEORA_DEC + "lib/decapiwrapper.c" + "lib/decinfo.c" + "lib/decode.c" + "lib/huffdec.c" + ) + + +option(USE_X86_32 "Use x86-32 optimization" OFF) +option(USE_X86_64 "Use x86-64 optimization" OFF) +if (USE_X86_32) + message("Enabling x86-32 assembly optimizations") + add_definitions(-DOC_X86_ASM) + + list (APPEND LIBTHEORA_COMMON + "lib/x86/mmxidct.c" + "lib/x86/mmxfrag.c" + "lib/x86/mmxstate.c" + "lib/x86/x86state.c" + ) + + list (APPEND LIBTHEORA_ENC + "lib/x86/mmxencfrag.c" + "lib/x86/mmxfdct.c" + "lib/x86/x86enc.c" + "lib/x86/mmxfrag.c" + "lib/x86/mmxidct.c" + "lib/x86/mmxstate.c" + "lib/x86/x86state.c" + ) +elseif (USE_X86_64) + message("Enabling x86-64 assembly optimizations") + add_definitions(-DOC_X86_ASM) + add_definitions(-DOC_X86_64_ASM) + + list (APPEND LIBTHEORA_COMMON + "lib/x86/mmxidct.c" + "lib/x86/mmxfrag.c" + "lib/x86/mmxstate.c" + "lib/x86/x86state.c" + ) + + list (APPEND LIBTHEORA_ENC + "lib/x86/mmxencfrag.c" + "lib/x86/mmxfdct.c" + "lib/x86/x86enc.c" + "lib/x86/sse2fdct.c" + ) +else() + message("Not enabling any assembly optimizations (x86 and x86_64 asm optimizations are available)") +endif() + + +if (MSVC AND BUILD_SHARED_LIBS) + set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif () + +add_library(theora ${LIBTHEORA_COMMON} ${LIBTHEORA_ENC} ${LIBTHEORA_DEC}) +add_library(theoraenc ${LIBTHEORA_COMMON} ${LIBTHEORA_ENC}) +add_library(theoradec ${LIBTHEORA_COMMON} ${LIBTHEORA_DEC}) + +if (BUILD_SHARED_LIBS) + target_compile_definitions(theora PRIVATE LIBTHEORA_EXPORTS) + target_compile_definitions(theoraenc PRIVATE LIBTHEORA_EXPORTS) + target_compile_definitions(theoradec PRIVATE LIBTHEORA_EXPORTS) +endif() + +target_link_libraries(theora PUBLIC Ogg::ogg) +target_link_libraries(theoraenc PUBLIC Ogg::ogg) +target_link_libraries(theoradec PUBLIC Ogg::ogg) + +target_include_directories(theora PUBLIC include) +target_include_directories(theoraenc PUBLIC include) +target_include_directories(theoradec PUBLIC include) + +install(FILES ${HEADERS} DESTINATION include/theora) +install(TARGETS theora theoraenc theoradec) diff --git a/recipes/theora/all/conandata.yml b/recipes/theora/all/conandata.yml new file mode 100644 index 0000000000000..b2963c4be74a9 --- /dev/null +++ b/recipes/theora/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.1": + url: "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.zip" + sha256: "f644fef154f7a80e7258c8baec5c510f594d720835855cddce322b924934ba36" diff --git a/recipes/theora/all/conanfile.py b/recipes/theora/all/conanfile.py new file mode 100644 index 0000000000000..ca4711add6a90 --- /dev/null +++ b/recipes/theora/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import copy, download, get, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.errors import ConanException +import os + +required_conan_version = ">=1.52.0" + +class TheoraConan(ConanFile): + name = "theora" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xiph/theora" + description = "Theora is a free and open video compression format from the Xiph.org Foundation" + topics = "video", "video-compressor", "video-format" + + settings = "os", "compiler", "build_type", "arch" + 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")) + + 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 ConanException: + pass + try: + del self.settings.compiler.libcxx + except ConanException: + pass + try: + del self.settings.compiler.cppstd + except ConanException: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("ogg/1.3.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_X86_32"] = (self.settings.arch == "x86") + # note: MSVC does not support inline assembly for 64 bit builds + tc.variables["USE_X86_64"] = (self.settings.arch == "x86_64" and not is_msvc(self)) + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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.set_property("pkg_config_name", "theora_full_package_do_not_use") # to avoid conflicts with theora component + + self.cpp_info.components["theora"].set_property("pkg_config_name", "theora") + self.cpp_info.components["theora"].libs = ["theora"] + self.cpp_info.components["theora"].requires = ["ogg::ogg"] + + self.cpp_info.components["theoradec"].set_property("pkg_config_name", "theoradec") + self.cpp_info.components["theoradec"].libs = ["theoradec"] + self.cpp_info.components["theoradec"].requires = ["ogg::ogg"] + + self.cpp_info.components["theoraenc"].set_property("pkg_config_name", "theoraenc") + self.cpp_info.components["theoraenc"].libs = ["theoraenc"] + self.cpp_info.components["theoraenc"].requires = ["ogg::ogg"] + + + # TODO: to remove in conan v2 once pkg_config generator removed + self.cpp_info.names["pkg_config"] = "theora_full_package" diff --git a/recipes/theora/all/test_package/CMakeLists.txt b/recipes/theora/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..73fb77db6077c --- /dev/null +++ b/recipes/theora/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest C) + +find_package(theora CONFIG REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE theora::theora) diff --git a/recipes/theora/all/test_package/conanfile.py b/recipes/theora/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5759f27e0ef5 --- /dev/null +++ b/recipes/theora/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 TheoraTestConan(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/theora/all/test_package/test_package.c b/recipes/theora/all/test_package/test_package.c new file mode 100644 index 0000000000000..ed9823fec3f80 --- /dev/null +++ b/recipes/theora/all/test_package/test_package.c @@ -0,0 +1,138 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora 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 Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + function: example of querying various library parameters. + last mod: $Id$ + ********************************************************************/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "theora/theoraenc.h" + + +/* Print the library's bitstream version number + This is the highest supported bitstream version number, + not the version number of the implementation itself. */ +int print_version(void) +{ + unsigned version = th_version_number(); + + fprintf(stdout, "Bitstream: %d.%d.%d (0x%06X)\n", + (version >> 16) & 0xff, (version >> 8) & 0xff, (version) & 0xff, + version); + + return 0; +} + +/* Print the library's own version string + This is generally the same at the vendor string embedded + in encoded files. */ +int print_version_string(void) +{ + const char *version = th_version_string(); + + if (version == NULL) { + fprintf(stderr, "Error querying libtheora version string.\n"); + return -1; + } + + fprintf(stdout, "Version: %s\n", version); + + return 0; +} + +/* Generate a dummy encoder context for use in th_encode_ctl queries */ +th_enc_ctx *dummy_encode_ctx(void) +{ + th_enc_ctx *ctx; + th_info info; + + /* set the minimal video parameters */ + th_info_init(&info); + info.frame_width=320; + info.frame_height=240; + info.fps_numerator=1; + info.fps_denominator=1; + + /* allocate and initialize a context object */ + ctx = th_encode_alloc(&info); + if (ctx == NULL) { + fprintf(stderr, "Error allocating encoder context.\n"); + } + + /* clear the info struct */ + th_info_clear(&info); + + return ctx; +} + +/* Query the current and maximum values for the 'speed level' setting. + This can be used to ask the encoder to trade off encoding quality + vs. performance cost, for example to adapt to realtime constraints. */ +int check_speed_level(th_enc_ctx *ctx, int *current, int *max) +{ + int ret; + + /* query the current speed level */ + ret = th_encode_ctl(ctx, TH_ENCCTL_GET_SPLEVEL, current, sizeof(int)); + if (ret) { + fprintf(stderr, "Error %d getting current speed level.\n", ret); + return ret; + } + /* query the maximum speed level, which varies by encoder version */ + ret = th_encode_ctl(ctx, TH_ENCCTL_GET_SPLEVEL_MAX, max, sizeof(int)); + if (ret) { + fprintf(stderr, "Error %d getting max speed level.\n", ret); + return ret; + } + + return 0; +} + +/* Print the current and maximum speed level settings */ +int print_speed_level(th_enc_ctx *ctx) +{ + int current = -1; + int max = -1; + int ret; + + ret = check_speed_level(ctx, ¤t, &max); + if (ret == 0) { + fprintf(stdout, "Default speed level: %d\n", current); + fprintf(stdout, "Maximum speed level: %d\n", max); + } + + return ret; +} + +int main(int argc, char **argv) { + th_enc_ctx *ctx; + + /* print versioning */ + print_version_string(); + print_version(); + + /* allocate a generic context for queries that require it */ + ctx = dummy_encode_ctx(); + if (ctx != NULL) { + /* dump the speed level setting */ + print_speed_level(ctx); + /* clean up */ + th_encode_free(ctx); + } + + return 0; +} diff --git a/recipes/theora/all/test_v1_package/CMakeLists.txt b/recipes/theora/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2e5ac93f43d5b --- /dev/null +++ b/recipes/theora/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(theora CONFIG REQUIRED) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE theora::theora) diff --git a/recipes/theora/all/test_v1_package/conanfile.py b/recipes/theora/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/theora/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/theora/config.yml b/recipes/theora/config.yml new file mode 100644 index 0000000000000..e80b5baf3ff6d --- /dev/null +++ b/recipes/theora/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1": + folder: "all" diff --git a/recipes/threadpool/all/conandata.yml b/recipes/threadpool/all/conandata.yml new file mode 100644 index 0000000000000..7e760f1f74283 --- /dev/null +++ b/recipes/threadpool/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20140926": + url: "https://github.com/progschj/ThreadPool/archive/9a42ec1329f259a5f4881a291db1dcb8f2ad9040.tar.gz" + sha256: "954e0ecdac1aa0da1e0fa78577ff0d352e53094df43762fbc1884f76a7e1dcd2" diff --git a/recipes/threadpool/all/conanfile.py b/recipes/threadpool/all/conanfile.py new file mode 100644 index 0000000000000..ad1dad9d75688 --- /dev/null +++ b/recipes/threadpool/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class ThreadpoolConan(ConanFile): + name = "threadpool" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/progschj/ThreadPool" + description = "A simple C++11 Thread Pool implementation." + license = "Zlib" + topics = ("c++11", "thread", "pool") + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "ThreadPool")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "ThreadPool")) + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + + # TODO: to remove in conan v2 (and do not port to CMakeDeps, it was a mistake) + self.cpp_info.names["cmake_find_package"] = "ThreadPool" + self.cpp_info.names["cmake_find_package_multi"] = "ThreadPool" diff --git a/recipes/threadpool/all/test_package/CMakeLists.txt b/recipes/threadpool/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..700241bb74acb --- /dev/null +++ b/recipes/threadpool/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +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_11) diff --git a/recipes/threadpool/all/test_package/conanfile.py b/recipes/threadpool/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/threadpool/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/threadpool/all/test_package/test_package.cpp b/recipes/threadpool/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..02e175532d6ce --- /dev/null +++ b/recipes/threadpool/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main(void) +{ + // create thread pool with 4 worker threads + ThreadPool pool(4); + + // enqueue and store future + auto result = pool.enqueue([](int answer) { return answer; }, 42); + + // get result from future + std::cout << result.get() << std::endl; + return 0; +} diff --git a/recipes/threadpool/all/test_v1_package/CMakeLists.txt b/recipes/threadpool/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..338ffbb0c05f3 --- /dev/null +++ b/recipes/threadpool/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ThreadPool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ThreadPool::ThreadPool) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/threadpool/all/test_v1_package/conanfile.py b/recipes/threadpool/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/threadpool/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/threadpool/config.yml b/recipes/threadpool/config.yml new file mode 100644 index 0000000000000..3722466e546d5 --- /dev/null +++ b/recipes/threadpool/config.yml @@ -0,0 +1,3 @@ +versions: + "20140926": + folder: all diff --git a/recipes/thrift/all/conandata.yml b/recipes/thrift/all/conandata.yml new file mode 100644 index 0000000000000..ab039201f49e0 --- /dev/null +++ b/recipes/thrift/all/conandata.yml @@ -0,0 +1,44 @@ +sources: + "0.17.0": + url: "https://github.com/apache/thrift/archive/v0.17.0.tar.gz" + sha256: "f5888bcd3b8de40c2c2ab86896867ad9b18510deb412cba3e5da76fb4c604c29" + "0.16.0": + url: "https://github.com/apache/thrift/archive/refs/tags/v0.16.0.tar.gz" + sha256: "df2931de646a366c2e5962af679018bca2395d586e00ba82d09c0379f14f8e7b" + "0.15.0": + url: "https://github.com/apache/thrift/archive/refs/tags/v0.15.0.tar.gz" + sha256: "32d2f18aa9be114619ee54e1abc3bb497febb2a8aa917894c20bae21185fac15" + "0.14.2": + url: "https://github.com/apache/thrift/archive/v0.14.2.tar.gz" + sha256: "f966cdac6bb8d149a9950a761e6ee6f3b22d5a6073da43a333d3468f159ebeaa" + "0.14.1": + url: "https://github.com/apache/thrift/archive/refs/tags/v0.14.1.tar.gz" + sha256: "5ae1c4d16452a22eaf9d802ba7489907147c2b316ff38c9758918552fae5132c" + "0.13.0": + url: "https://github.com/apache/thrift/archive/0.13.0.tar.gz" + sha256: "8469c8d72c684c6de72ddf55fc65d1c10868a576e7dc4d1f4a21a59814b97110" +patches: + "0.17.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.16.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.15.0": + - patch_file: "patches/cmake-0.15.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.14.2": + - patch_file: "patches/cmake-0.14.1.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.14.1": + - patch_file: "patches/cmake-0.14.1.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.13.0": + - patch_file: "patches/cmake-0.13.0.patch" + patch_description: "use cci packages" + patch_type: "conan" diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py new file mode 100644 index 0000000000000..0aaa55ea7ce2b --- /dev/null +++ b/recipes/thrift/all/conanfile.py @@ -0,0 +1,232 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class ThriftConan(ConanFile): + name = "thrift" + description = "Thrift is an associated code generation mechanism for RPC" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/apache/thrift" + topics = ("thrift", "serialization", "rpc") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "with_libevent": [True, False], + "with_openssl": [True, False], + "with_c_glib": [True, False], + "with_cpp": [True, False], + "with_java": [True, False], + "with_python": [True, False], + "with_qt5": [True, False], + "with_haskell": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_libevent": True, + "with_openssl": True, + "with_c_glib": False, + "with_cpp": True, + "with_java": False, + "with_python": False, + "with_qt5": False, + "with_haskell": False, + } + + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0", transitive_headers=True) + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_libevent: + self.requires("libevent/2.1.12") + if self.options.with_qt5: + self.requires("qt/5.15.9") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + for option, value in self.options.items(): + if option.startswith("with_"): + tc.variables[option.upper()] = value + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_COMPILER"] = True + tc.variables["BUILD_LIBRARIES"] = True + tc.variables["BUILD_TUTORIALS"] = False + if is_msvc(self): + tc.variables["WITH_MT"] = is_msvc_static_runtime(self) + # This policy doesn't matter for us, but avoids a warning + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + env = VirtualBuildEnv(self) + env.generate(scope="build") + + def _patch_sources(self): + apply_conandata_patches(self) + # No static code analysis (seems to trigger CMake warnings due to weird custom Find module file) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "include(StaticCodeAnalysis)", "") + # TODO: To remove in conan v2, but it's still needed if building with 1 profile. + # May also be removed if flex & bison recipes define cmake_find_mode property to "none" in their package_info() + for f in ["Findflex.cmake", "flex-config.cmake", "Findbison.cmake", "bison-config.cmake"]: + rm(self, f, self.generators_folder) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + # Copy generated headers from build tree + copy(self, "*.h", src=self.build_folder, dst=os.path.join(self.package_folder, "include"), keep_path=True) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + targets = {} + if self.options.with_zlib: + targets.update({"thriftz::thriftz": "thrift::thriftz"}) + if self.options.with_libevent: + targets.update({"thriftnb::thriftnb": "thrift::thriftnb"}) + if self.options.with_qt5: + targets.update({"thriftqt5::thriftqt5": "thrift::thriftqt5"}) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + targets + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Thrift") + # unofficial, for conan internal purpose, it avoids conflict with libthrift component + self.cpp_info.set_property("cmake_target_name", "thrift::thrift-conan-do-not-use") + self.cpp_info.set_property("pkg_config_name", "thrift_conan_do_not_use") + + libsuffix = "{}{}".format( + ("mt" if is_msvc_static_runtime(self) else "md") if is_msvc(self) else "", + "d" if self.settings.build_type == "Debug" else "", + ) + + self.cpp_info.components["libthrift"].set_property("cmake_target_name", "thrift::thrift") + self.cpp_info.components["libthrift"].set_property("pkg_config_name", "thrift") + self.cpp_info.components["libthrift"].libs = [f"thrift{libsuffix}"] + if self.settings.os == "Windows": + self.cpp_info.components["libthrift"].defines.append("NOMINMAX") + if Version(self.version) >= "0.15.0": + self.cpp_info.components["libthrift"].system_libs.append("shlwapi") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libthrift"].system_libs.extend(["m", "pthread"]) + self.cpp_info.components["libthrift"].requires.append("boost::headers") + if self.options.with_openssl: + self.cpp_info.components["libthrift"].requires.append("openssl::openssl") + + if self.options.with_zlib: + self.cpp_info.components["libthrift_z"].set_property("cmake_target_name", "thriftz::thriftz") + self.cpp_info.components["libthrift_z"].set_property("pkg_config_name", "thrift-z") + self.cpp_info.components["libthrift_z"].libs = [f"thriftz{libsuffix}"] + self.cpp_info.components["libthrift_z"].requires = ["libthrift", "zlib::zlib"] + + + if self.options.with_libevent: + self.cpp_info.components["libthrift_nb"].set_property("cmake_target_name", "thriftnb::thriftnb") + self.cpp_info.components["libthrift_nb"].set_property("pkg_config_name", "thrift-nb") + self.cpp_info.components["libthrift_nb"].libs = [f"thriftnb{libsuffix}"] + self.cpp_info.components["libthrift_nb"].requires = ["libthrift", "libevent::libevent"] + + if self.options.with_qt5: + self.cpp_info.components["libthrift_qt5"].set_property("cmake_target_name", "thriftqt5::thriftqt5") + self.cpp_info.components["libthrift_qt5"].set_property("pkg_config_name", "thrift-qt5") + self.cpp_info.components["libthrift_qt5"].libs = [f"thriftqt5{libsuffix}"] + self.cpp_info.components["libthrift_qt5"].requires = ["libthrift", "qt::qtCore"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var with : {bin_path}") + self.env_info.PATH.append(bin_path) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "Thrift" + self.cpp_info.filenames["cmake_find_package_multi"] = "Thrift" + self.cpp_info.names["cmake_find_package"] = "thrift" + self.cpp_info.names["cmake_find_package_multi"] = "thrift" + self.cpp_info.names["pkg_config"] = "thrift_conan_do_not_use" + self.cpp_info.components["libthrift"].names["cmake_find_package"] = "thrift" + self.cpp_info.components["libthrift"].names["cmake_find_package_multi"] = "thrift" + if self.options.with_zlib: + self.cpp_info.components["libthrift_z"].names["cmake_find_package"] = "thriftz" + self.cpp_info.components["libthrift_z"].names["cmake_find_package_multi"] = "thriftz" + self.cpp_info.components["libthrift_z"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libthrift_z"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_libevent: + self.cpp_info.components["libthrift_nb"].names["cmake_find_package"] = "thriftnb" + self.cpp_info.components["libthrift_nb"].names["cmake_find_package_multi"] = "thriftnb" + self.cpp_info.components["libthrift_nb"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libthrift_nb"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_qt5: + self.cpp_info.components["libthrift_qt5"].names["cmake_find_package"] = "thriftqt5" + self.cpp_info.components["libthrift_qt5"].names["cmake_find_package_multi"] = "thriftqt5" + self.cpp_info.components["libthrift_qt5"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libthrift_qt5"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/thrift/all/patches/cmake-0.13.0.patch b/recipes/thrift/all/patches/cmake-0.13.0.patch new file mode 100644 index 0000000000000..1acf18b419ac5 --- /dev/null +++ b/recipes/thrift/all/patches/cmake-0.13.0.patch @@ -0,0 +1,80 @@ +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,10 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() + + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) +@@ -118,7 +114,12 @@ CMAKE_DEPENDENT_OPTION(BUILD_HASKELL "Build GHC library" ON + # Common library options + # https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html + # Default on Windows is static, shared mode library support needs work... +-CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF "WIN32" ON) ++if(WIN32) ++ set(DEFAULT_BUILD_SHARED_LIBS ON) ++else() ++ set(DEFAULT_BUILD_SHARED_LIBS OFF) ++endif() ++option(BUILD_SHARED_LIBS "Build shared libraries" ${DEFAULT_BUILD_SHARED_LIBS}) + + if (WITH_SHARED_LIB) + message(WARNING "WITH_SHARED_LIB is deprecated; use -DBUILD_SHARED_LIBS=ON instead") +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -59,13 +59,13 @@ set(thrift_c_glib_SOURCES + ) + + # If OpenSSL is not found just ignore the OpenSSL stuff +-find_package(OpenSSL) +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list( APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -98,13 +98,13 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) + list( APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + if(UNIX) +@@ -152,11 +152,11 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support form upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) ++ #include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + LINK_AGAINST_THRIFT_LIBRARY(thriftnb thrift) +- TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES}) ++ TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} libevent::core libevent::extra) + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/recipes/thrift/all/patches/cmake-0.14.1.patch b/recipes/thrift/all/patches/cmake-0.14.1.patch new file mode 100644 index 0000000000000..56966bad817d8 --- /dev/null +++ b/recipes/thrift/all/patches/cmake-0.14.1.patch @@ -0,0 +1,108 @@ +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() + set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() +- + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) + if (WITH_AS3) +@@ -87,9 +82,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON + + # OpenSSL + if(WITH_CPP OR WITH_C_GLIB) +- find_package(OpenSSL QUIET) +- CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON +- "OPENSSL_FOUND" OFF) ++ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON) + endif() + + # Java +@@ -106,14 +99,11 @@ else() + endif() + + # Javascript +-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON +- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF) ++option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF) + + # NodeJS +-option(WITH_NODEJS "Build NodeJS Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON +- "BUILD_LIBRARIES;WITH_NODEJS" OFF) ++option(WITH_NODEJS "Build NodeJS Thrift library" OFF) ++ + + # Python + option(WITH_PYTHON "Build Python Thrift library" ON) +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -61,11 +61,12 @@ set(thrift_c_glib_SOURCES + + # If OpenSSL is not found just ignore the OpenSSL stuff + if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -101,13 +101,14 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list( APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + if(UNIX) +@@ -161,11 +162,11 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) ++ #include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + LINK_AGAINST_THRIFT_LIBRARY(thriftnb thrift) +- TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES}) ++ TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} libevent::core libevent::extra) + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/recipes/thrift/all/patches/cmake-0.15.0.patch b/recipes/thrift/all/patches/cmake-0.15.0.patch new file mode 100644 index 0000000000000..06e41859ff40c --- /dev/null +++ b/recipes/thrift/all/patches/cmake-0.15.0.patch @@ -0,0 +1,116 @@ +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() + set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() +- + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) + if (WITH_AS3) +@@ -87,9 +82,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON + + # OpenSSL + if(WITH_CPP OR WITH_C_GLIB) +- find_package(OpenSSL QUIET) +- CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON +- "OPENSSL_FOUND" OFF) ++ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON) + endif() + + # Java +@@ -106,14 +99,11 @@ else() + endif() + + # Javascript +-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON +- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF) ++option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF) + + # NodeJS +-option(WITH_NODEJS "Build NodeJS Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON +- "BUILD_LIBRARIES;WITH_NODEJS" OFF) ++option(WITH_NODEJS "Build NodeJS Thrift library" OFF) ++ + + # Python + option(WITH_PYTHON "Build Python Thrift library" ON) +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -72,11 +72,12 @@ set(thrift_c_glib_zlib_SOURCES + + # If OpenSSL is not found just ignore the OpenSSL stuff + if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -101,13 +101,14 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list( APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + if(UNIX) +@@ -161,16 +162,16 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) ++ #include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + LINK_AGAINST_THRIFT_LIBRARY(thriftnb PUBLIC thrift) +- if(TARGET libevent::core AND TARGET libevent::extra) ++ #if(TARGET libevent::core AND TARGET libevent::extra) + # libevent was found via its cmake config, use modern style targets + TARGET_LINK_LIBRARIES_THRIFT(thriftnb PUBLIC libevent::core libevent::extra) +- else() +- TARGET_LINK_LIBRARIES_THRIFT(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) +- endif() ++ #else() ++ #TARGET_LINK_LIBRARIES_THRIFT(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) ++ #endif() + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/recipes/thrift/all/patches/cmake-0.16.0.patch b/recipes/thrift/all/patches/cmake-0.16.0.patch new file mode 100644 index 0000000000000..19982159792ba --- /dev/null +++ b/recipes/thrift/all/patches/cmake-0.16.0.patch @@ -0,0 +1,125 @@ +diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake +index 23962b4..0c824cc 100644 +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() +- set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() ++set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake +index 3cca31e..ffc2811 100644 +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() +- + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) + if (WITH_AS3) +@@ -90,6 +85,7 @@ if(WITH_CPP OR WITH_C_GLIB) + find_package(OpenSSL QUIET) + CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON + "OPENSSL_FOUND" OFF) ++ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON) + endif() + + # Java +@@ -106,14 +102,10 @@ else() + endif() + + # Javascript +-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON +- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF) ++option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF) + + # NodeJS +-option(WITH_NODEJS "Build NodeJS Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON +- "BUILD_LIBRARIES;WITH_NODEJS" OFF) ++option(WITH_NODEJS "Build NodeJS Thrift library" OFF) + + # Python + option(WITH_PYTHON "Build Python Thrift library" ON) +diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt +index 218f7dd..b879830 100644 +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -71,7 +71,8 @@ set(thrift_c_glib_zlib_SOURCES + ) + + # If OpenSSL is not found just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +@@ -83,8 +84,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) + list(APPEND SYSLIBS OpenSSL::Crypto) + endif() + else() +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + endif() + +diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt +index 13b41c5..4b2b116 100755 +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -96,7 +96,8 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp +@@ -111,8 +112,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) + list(APPEND SYSLIBS OpenSSL::Crypto) + endif() + else() +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + endif() + +@@ -167,16 +167,11 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + target_link_libraries(thriftnb PUBLIC thrift) +- if(TARGET libevent::core AND TARGET libevent::extra) +- # libevent was found via its cmake config, use modern style targets +- target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra) +- else() +- target_link_libraries(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) +- endif() ++ # libevent was found via its cmake config, use modern style targets ++ target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra) + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/recipes/thrift/all/test_package/CMakeLists.txt b/recipes/thrift/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5da5a4dcda31 --- /dev/null +++ b/recipes/thrift/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Thrift CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} + calculator_constants.cpp + calculator_types.cpp + Calculator.cpp + test_package.cpp +) +target_link_libraries(${PROJECT_NAME} PRIVATE thrift::thrift) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/thrift/all/test_package/Calculator.cpp b/recipes/thrift/all/test_package/Calculator.cpp new file mode 100644 index 0000000000000..8d287de899f55 --- /dev/null +++ b/recipes/thrift/all/test_package/Calculator.cpp @@ -0,0 +1,436 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "Calculator.h" + + + + +Calculator_add_args::~Calculator_add_args() throw() { +} + + +uint32_t Calculator_add_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->num1); + this->__isset.num1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->num2); + this->__isset.num2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Calculator_add_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Calculator_add_args"); + + xfer += oprot->writeFieldBegin("num1", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->num1); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("num2", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->num2); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +Calculator_add_pargs::~Calculator_add_pargs() throw() { +} + + +uint32_t Calculator_add_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Calculator_add_pargs"); + + xfer += oprot->writeFieldBegin("num1", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->num1))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("num2", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((*(this->num2))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +Calculator_add_result::~Calculator_add_result() throw() { +} + + +uint32_t Calculator_add_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Calculator_add_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Calculator_add_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +Calculator_add_presult::~Calculator_add_presult() throw() { +} + + +uint32_t Calculator_add_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +int64_t CalculatorClient::add(const int32_t num1, const int32_t num2) +{ + send_add(num1, num2); + return recv_add(); +} + +void CalculatorClient::send_add(const int32_t num1, const int32_t num2) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid); + + Calculator_add_pargs args; + args.num1 = &num1; + args.num2 = &num2; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int64_t CalculatorClient::recv_add() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int64_t _return; + Calculator_add_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add failed: unknown result"); +} + +bool CalculatorProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { + ProcessMap::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + iprot->skip(::apache::thrift::protocol::T_STRUCT); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); + oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return true; + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void CalculatorProcessor::process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Calculator.add", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Calculator.add"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Calculator.add"); + } + + Calculator_add_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Calculator.add", bytes); + } + + Calculator_add_result result; + try { + result.success = iface_->add(args.num1, args.num2); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Calculator.add"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Calculator.add"); + } + + oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Calculator.add", bytes); + } +} + +::std::shared_ptr< ::apache::thrift::TProcessor > CalculatorProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< CalculatorIfFactory > cleanup(handlerFactory_); + ::std::shared_ptr handler(handlerFactory_->getHandler(connInfo), cleanup); + ::std::shared_ptr<::apache::thrift::TProcessor> processor(new CalculatorProcessor(handler)); + return processor; +} + +int64_t CalculatorConcurrentClient::add(const int32_t num1, const int32_t num2) +{ + int32_t seqid = send_add(num1, num2); + return recv_add(seqid); +} + +int32_t CalculatorConcurrentClient::send_add(const int32_t num1, const int32_t num2) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid); + + Calculator_add_pargs args; + args.num1 = &num1; + args.num2 = &num2; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int64_t CalculatorConcurrentClient::recv_add(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int64_t _return; + Calculator_add_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} diff --git a/recipes/thrift/all/test_package/Calculator.h b/recipes/thrift/all/test_package/Calculator.h new file mode 100644 index 0000000000000..7aca53a5ce4e2 --- /dev/null +++ b/recipes/thrift/all/test_package/Calculator.h @@ -0,0 +1,303 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef Calculator_H +#define Calculator_H + +#include +#include +#include "calculator_types.h" + + + +#ifdef _MSC_VER + #pragma warning( push ) + #pragma warning (disable : 4250 ) //inheriting methods via dominance +#endif + +class CalculatorIf { + public: + virtual ~CalculatorIf() {} + virtual int64_t add(const int32_t num1, const int32_t num2) = 0; +}; + +class CalculatorIfFactory { + public: + typedef CalculatorIf Handler; + + virtual ~CalculatorIfFactory() {} + + virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; + virtual void releaseHandler(CalculatorIf* /* handler */) = 0; +}; + +class CalculatorIfSingletonFactory : virtual public CalculatorIfFactory { + public: + CalculatorIfSingletonFactory(const std::shared_ptr& iface) : iface_(iface) {} + virtual ~CalculatorIfSingletonFactory() {} + + virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo&) { + return iface_.get(); + } + virtual void releaseHandler(CalculatorIf* /* handler */) {} + + protected: + ::std::shared_ptr iface_; +}; + +class CalculatorNull : virtual public CalculatorIf { + public: + virtual ~CalculatorNull() {} + int64_t add(const int32_t /* num1 */, const int32_t /* num2 */) { + int64_t _return = 0; + return _return; + } +}; + +typedef struct _Calculator_add_args__isset { + _Calculator_add_args__isset() : num1(false), num2(false) {} + bool num1 :1; + bool num2 :1; +} _Calculator_add_args__isset; + +class Calculator_add_args { + public: + + Calculator_add_args(const Calculator_add_args&); + Calculator_add_args& operator=(const Calculator_add_args&); + Calculator_add_args() : num1(0), num2(0) { + } + + virtual ~Calculator_add_args() throw(); + int32_t num1; + int32_t num2; + + _Calculator_add_args__isset __isset; + + void __set_num1(const int32_t val); + + void __set_num2(const int32_t val); + + bool operator == (const Calculator_add_args & rhs) const + { + if (!(num1 == rhs.num1)) + return false; + if (!(num2 == rhs.num2)) + return false; + return true; + } + bool operator != (const Calculator_add_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Calculator_add_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Calculator_add_pargs { + public: + + + virtual ~Calculator_add_pargs() throw(); + const int32_t* num1; + const int32_t* num2; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Calculator_add_result__isset { + _Calculator_add_result__isset() : success(false) {} + bool success :1; +} _Calculator_add_result__isset; + +class Calculator_add_result { + public: + + Calculator_add_result(const Calculator_add_result&); + Calculator_add_result& operator=(const Calculator_add_result&); + Calculator_add_result() : success(0) { + } + + virtual ~Calculator_add_result() throw(); + int64_t success; + + _Calculator_add_result__isset __isset; + + void __set_success(const int64_t val); + + bool operator == (const Calculator_add_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Calculator_add_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Calculator_add_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Calculator_add_presult__isset { + _Calculator_add_presult__isset() : success(false) {} + bool success :1; +} _Calculator_add_presult__isset; + +class Calculator_add_presult { + public: + + + virtual ~Calculator_add_presult() throw(); + int64_t* success; + + _Calculator_add_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +class CalculatorClient : virtual public CalculatorIf { + public: + CalculatorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + CalculatorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + int64_t add(const int32_t num1, const int32_t num2); + void send_add(const int32_t num1, const int32_t num2); + int64_t recv_add(); + protected: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; +}; + +class CalculatorProcessor : public ::apache::thrift::TDispatchProcessor { + protected: + ::std::shared_ptr iface_; + virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); + private: + typedef void (CalculatorProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); + typedef std::map ProcessMap; + ProcessMap processMap_; + void process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + CalculatorProcessor(::std::shared_ptr iface) : + iface_(iface) { + processMap_["add"] = &CalculatorProcessor::process_add; + } + + virtual ~CalculatorProcessor() {} +}; + +class CalculatorProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + CalculatorProcessorFactory(const ::std::shared_ptr< CalculatorIfFactory >& handlerFactory) : + handlerFactory_(handlerFactory) {} + + ::std::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); + + protected: + ::std::shared_ptr< CalculatorIfFactory > handlerFactory_; +}; + +class CalculatorMultiface : virtual public CalculatorIf { + public: + CalculatorMultiface(std::vector >& ifaces) : ifaces_(ifaces) { + } + virtual ~CalculatorMultiface() {} + protected: + std::vector > ifaces_; + CalculatorMultiface() {} + void add(::std::shared_ptr iface) { + ifaces_.push_back(iface); + } + public: + int64_t add(const int32_t num1, const int32_t num2) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add(num1, num2); + } + return ifaces_[i]->add(num1, num2); + } + +}; + +// The 'concurrent' client is a thread safe client that correctly handles +// out of order responses. It is slower than the regular client, so should +// only be used when you need to share a connection among multiple threads +class CalculatorConcurrentClient : virtual public CalculatorIf { + public: + CalculatorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + CalculatorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + int64_t add(const int32_t num1, const int32_t num2); + int32_t send_add(const int32_t num1, const int32_t num2); + int64_t recv_add(const int32_t seqid); + protected: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; + ::apache::thrift::async::TConcurrentClientSyncInfo sync_; +}; + +#ifdef _MSC_VER + #pragma warning( pop ) +#endif + + + +#endif diff --git a/recipes/thrift/all/test_package/calc.thrift b/recipes/thrift/all/test_package/calc.thrift new file mode 100644 index 0000000000000..8fb142d49fa45 --- /dev/null +++ b/recipes/thrift/all/test_package/calc.thrift @@ -0,0 +1,77 @@ +include "shared.thrift" + +namespace cpp tutorial +namespace d tutorial +namespace java tutorial +namespace php tutorial +namespace perl tutorial + +/** + * Thrift also lets you define constants for use across languages. Complex + * types and structs are specified using JSON notation. + */ +const i32 INT32CONSTANT = 9853 +const map MAPCONSTANT = {'hello':'world', 'goodnight':'moon'} + +/** + * You can define enums, which are just 32 bit integers. Values are optional + * and start at 1 if not supplied, C style again. + */ +enum Operation { + ADD = 1, + SUBTRACT = 2, + MULTIPLY = 3, + DIVIDE = 4 +} + +/** + * Structs are the basic complex data structures. They are comprised of fields + * which each have an integer identifier, a type, a symbolic name, and an + * optional default value. + * + * Fields can be declared "optional", which ensures they will not be included + * in the serialized output if they aren't set. Note that this requires some + * manual management in some languages. + */ +struct Work { + 1: i32 num1 = 0, + 2: i32 num2, + 3: Operation op, + 4: optional string comment, +} + +/** + * Structs can also be exceptions, if they are nasty. + */ +exception InvalidOperation { + 1: i32 what, + 2: string why +} + +/** + * Ahh, now onto the cool part, defining a service. Services just need a name + * and can optionally inherit from another service using the extends keyword. + */ +service Calculator extends shared.SharedService { + + /** + * A method definition looks like C code. It has a return type, arguments, + * and optionally a list of exceptions that it may throw. Note that argument + * lists and exception lists are specified using the exact same syntax as + * field lists in struct or exception definitions. + */ + + void ping(), + + i32 add(1:i32 num1, 2:i32 num2), + + i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch), + + /** + * This method has a oneway modifier. That means the client only makes + * a request and does not listen for any response at all. Oneway methods + * must be void. + */ + oneway void zip() + +} diff --git a/recipes/thrift/all/test_package/calculator_constants.cpp b/recipes/thrift/all/test_package/calculator_constants.cpp new file mode 100644 index 0000000000000..e6df4d9449677 --- /dev/null +++ b/recipes/thrift/all/test_package/calculator_constants.cpp @@ -0,0 +1,17 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "calculator_constants.h" + + + +const calculatorConstants g_calculator_constants; + +calculatorConstants::calculatorConstants() { +} + + + diff --git a/recipes/thrift/all/test_package/calculator_constants.h b/recipes/thrift/all/test_package/calculator_constants.h new file mode 100644 index 0000000000000..3bdeb7a4bf8ed --- /dev/null +++ b/recipes/thrift/all/test_package/calculator_constants.h @@ -0,0 +1,24 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef calculator_CONSTANTS_H +#define calculator_CONSTANTS_H + +#include "calculator_types.h" + + + +class calculatorConstants { + public: + calculatorConstants(); + +}; + +extern const calculatorConstants g_calculator_constants; + + + +#endif diff --git a/recipes/thrift/all/test_package/calculator_types.cpp b/recipes/thrift/all/test_package/calculator_types.cpp new file mode 100644 index 0000000000000..2924978d435c4 --- /dev/null +++ b/recipes/thrift/all/test_package/calculator_types.cpp @@ -0,0 +1,16 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "calculator_types.h" + +#include +#include + +#include + + + + diff --git a/recipes/thrift/all/test_package/calculator_types.h b/recipes/thrift/all/test_package/calculator_types.h new file mode 100644 index 0000000000000..bcdb62c3b952c --- /dev/null +++ b/recipes/thrift/all/test_package/calculator_types.h @@ -0,0 +1,23 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef calculator_TYPES_H +#define calculator_TYPES_H + +#include + +#include +#include +#include +#include +#include + + + + + + +#endif diff --git a/recipes/thrift/all/test_package/conanfile.py b/recipes/thrift/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bf9e658fe8687 --- /dev/null +++ b/recipes/thrift/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run("thrift --version", env="conanrun") diff --git a/recipes/thrift/all/test_package/test_package.cpp b/recipes/thrift/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a6274b97c570e --- /dev/null +++ b/recipes/thrift/all/test_package/test_package.cpp @@ -0,0 +1,60 @@ +// This autogenerated skeleton file illustrates how to build a server. +// You should copy it to another filename to avoid overwriting it. + +#include "Calculator.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace apache::thrift; +using namespace apache::thrift::concurrency; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; + +class CalculatorHandler : virtual public CalculatorIf { + public: + CalculatorHandler() + { + } + + int64_t add(const int32_t num1, const int32_t num2) + { + return 0; + } + +}; + +int main(int argc, char **argv) { + int port = 9090; + std::shared_ptr handler(new CalculatorHandler()); + std::shared_ptr processor(new CalculatorProcessor(handler)); + std::shared_ptr serverTransport(new TServerSocket(port)); + std::shared_ptr transportFactory(new TBufferedTransportFactory()); + std::shared_ptr protocolFactory(new TBinaryProtocolFactory()); + + + TSimpleServer server1(processor, serverTransport, transportFactory, protocolFactory); + TThreadedServer server2(processor, serverTransport, transportFactory, protocolFactory); + TThreadPoolServer server3(processor, serverTransport, transportFactory, protocolFactory); + + const int workerCount = 4; + std::shared_ptr threadManager = ThreadManager::newSimpleThreadManager(workerCount); + threadManager->threadFactory(std::make_shared()); + + std::cout << "Thrift " << PACKAGE_VERSION << '\n'; + return EXIT_SUCCESS; +} diff --git a/recipes/thrift/all/test_v1_package/CMakeLists.txt b/recipes/thrift/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/thrift/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/thrift/all/test_v1_package/conanfile.py b/recipes/thrift/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..26e744ddda5b0 --- /dev/null +++ b/recipes/thrift/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + self.run("thrift --version", run_environment=True) diff --git a/recipes/thrift/config.yml b/recipes/thrift/config.yml new file mode 100644 index 0000000000000..66a1ad96af024 --- /dev/null +++ b/recipes/thrift/config.yml @@ -0,0 +1,13 @@ +versions: + "0.17.0": + folder: all + "0.16.0": + folder: all + "0.15.0": + folder: all + "0.14.2": + folder: all + "0.14.1": + folder: all + "0.13.0": + folder: all diff --git a/recipes/thrust/all/conandata.yml b/recipes/thrust/all/conandata.yml new file mode 100644 index 0000000000000..702d317873355 --- /dev/null +++ b/recipes/thrust/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.9.5": + url: "https://github.com/thrust/thrust/archive/1.9.5.tar.gz" + sha256: "d155dc2a260fe0c75c63c185fa4c4b4c6c5b7c444fcdac7109bb71941c9603f1" + "1.16.0": + url: "https://github.com/thrust/thrust/archive/1.16.0.tar.gz" + sha256: "93b9553e3ee544e05395022bea67e6d600f8f3eb680950ec7cf73c0f55162487" + "1.17.0": + url: "https://github.com/thrust/thrust/archive/1.17.0.tar.gz" + sha256: "b02aca5d2325e9128ed9d46785b8e72366f758b873b95001f905f22afcf31bbf" diff --git a/recipes/thrust/all/conanfile.py b/recipes/thrust/all/conanfile.py new file mode 100644 index 0000000000000..55d9c443a7b03 --- /dev/null +++ b/recipes/thrust/all/conanfile.py @@ -0,0 +1,44 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class ThrustConan(ConanFile): + name = "thrust" + license = "Apache-2.0" + description = ("Thrust is a parallel algorithms library which resembles" + "the C++ Standard Template Library (STL).") + topics = ("parallel", "stl", "header-only") + homepage = "https://thrust.github.io/" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + options = {"device_system": ["cuda", "cpp", "omp", "tbb"]} + default_options = {"device_system": "tbb"} + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + if self.options.device_system == "tbb": + self.requires("onetbb/2020.3") + elif self.options.device_system != "cpp": + self.output.warn('Conan package for {0} is not available,' + ' this package will use {0} from system.' + .format(str(self.options.device_system).upper())) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("*[.h|.inl]", src=os.path.join(self._source_subfolder, "thrust"), + dst=os.path.join("include", "thrust")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.defines = ["THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_{}".format( + str(self.options.device_system).upper())] diff --git a/recipes/thrust/all/test_package/CMakeLists.txt b/recipes/thrust/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00c2a09754018 --- /dev/null +++ b/recipes/thrust/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(thrust CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package thrust::thrust) +set_target_properties(test_package PROPERTIES CXX_STANDARD 11) diff --git a/recipes/thrust/all/test_package/conanfile.py b/recipes/thrust/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9058f6e9a3054 --- /dev/null +++ b/recipes/thrust/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ThrustTestConan(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/thrust/all/test_package/test_package.cpp b/recipes/thrust/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..48b3f8b33f1f7 --- /dev/null +++ b/recipes/thrust/all/test_package/test_package.cpp @@ -0,0 +1,81 @@ +// Adapted from https://github.com/thrust/thrust/blob/master/examples/monte_carlo.cu + +#include +#include +#include +#include + +#include +#include +#include + +// we could vary M & N to find the perf sweet spot + +__host__ __device__ +unsigned int hash(unsigned int a) +{ + a = (a+0x7ed55d16) + (a<<12); + a = (a^0xc761c23c) ^ (a>>19); + a = (a+0x165667b1) + (a<<5); + a = (a+0xd3a2646c) ^ (a<<9); + a = (a+0xfd7046c5) + (a<<3); + a = (a^0xb55a4f09) ^ (a>>16); + return a; +} + +struct estimate_pi : public thrust::unary_function +{ + __host__ __device__ + float operator()(unsigned int thread_id) + { + float sum = 0; + unsigned int N = 100; // samples per thread + + unsigned int seed = hash(thread_id); + + // seed a random number generator + thrust::default_random_engine rng(seed); + + // create a mapping from random numbers to [0,1) + thrust::uniform_real_distribution u01(0,1); + + // take N samples in a quarter circle + for(unsigned int i = 0; i < N; ++i) + { + // draw a sample from the unit square + float x = u01(rng); + float y = u01(rng); + + // measure distance from the origin + float dist = sqrtf(x*x + y*y); + + // add 1.0f if (u0,u1) is inside the quarter circle + if(dist <= 1.0f) + sum += 1.0f; + } + + // multiply by 4 to get the area of the whole circle + sum *= 4.0f; + + // divide by N + return sum / N; + } +}; + +int main(void) +{ + // use 30 independent seeds + int M = 300; + + float estimate = thrust::transform_reduce(thrust::counting_iterator(0), + thrust::counting_iterator(M), + estimate_pi(), + 0.0f, + thrust::plus()); + estimate /= M; + + std::cout << std::setprecision(3); + std::cout << "pi is approximately " << estimate << std::endl; + + return 0; +} diff --git a/recipes/thrust/config.yml b/recipes/thrust/config.yml new file mode 100644 index 0000000000000..995f77f066bf1 --- /dev/null +++ b/recipes/thrust/config.yml @@ -0,0 +1,7 @@ +versions: + "1.9.5": + folder: all + "1.16.0": + folder: all + "1.17.0": + folder: all diff --git a/recipes/tidy-html5/all/CMakeLists.txt b/recipes/tidy-html5/all/CMakeLists.txt new file mode 100644 index 0000000000000..e5cb637716b89 --- /dev/null +++ b/recipes/tidy-html5/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/tidy-html5/all/conandata.yml b/recipes/tidy-html5/all/conandata.yml new file mode 100644 index 0000000000000..dbfb937f0f3c2 --- /dev/null +++ b/recipes/tidy-html5/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "5.8.0": + url: "https://github.com/htacg/tidy-html5/archive/refs/tags/5.8.0.tar.gz" + sha256: "59c86d5b2e452f63c5cdb29c866a12a4c55b1741d7025cf2f3ce0cde99b0660e" +patches: + "5.8.0": + - patch_file: "patches/0001-robust-install-pdb.patch" + base_path: "source_subfolder" diff --git a/recipes/tidy-html5/all/conanfile.py b/recipes/tidy-html5/all/conanfile.py new file mode 100644 index 0000000000000..c7d99c3c56b67 --- /dev/null +++ b/recipes/tidy-html5/all/conanfile.py @@ -0,0 +1,92 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class TidyHtml5Conan(ConanFile): + name = "tidy-html5" + license = "W3C" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.html-tidy.org" + description = "The granddaddy of HTML tools, with support for modern standards" + topics = ("html", "parser", "xml", "tools") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "support_localizations": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "support_localizations": True, + } + + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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 + cmake = CMake(self) + cmake.definitions['BUILD_TAB2SPACE'] = False + cmake.definitions['BUILD_SAMPLE_CODE'] = False + cmake.definitions['TIDY_COMPAT_HEADERS'] = False + cmake.definitions['SUPPORT_CONSOLE_APP'] = False + cmake.definitions['SUPPORT_LOCALIZATIONS'] = self.options.support_localizations + cmake.definitions['ENABLE_DEBUG_LOG'] = False + cmake.definitions['ENABLE_ALLOC_DEBUG'] = False + cmake.definitions['ENABLE_MEMORY_DEBUG'] = False + cmake.definitions['BUILD_SHARED_LIB'] = self.options.shared + cmake.configure(build_folder=self._build_subfolder) + self._cmake = cmake + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + self.copy("LICENSE.md", dst="licenses", src=os.path.join(self._source_subfolder, 'README')) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + if self.options.shared: + to_remove = "*tidy_static*" if self.settings.os == "Windows" else "*.a" + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), to_remove) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "tidy" + suffix = "_static" if self.settings.os == "Windows" and not self.options.shared else "" + suffix += "d" if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["tidy" + suffix] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("TIDY_STATIC") diff --git a/recipes/tidy-html5/all/patches/0001-robust-install-pdb.patch b/recipes/tidy-html5/all/patches/0001-robust-install-pdb.patch new file mode 100644 index 0000000000000..a6704298c35fa --- /dev/null +++ b/recipes/tidy-html5/all/patches/0001-robust-install-pdb.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -416,11 +416,6 @@ install(TARGETS ${name} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ) + install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} ) +-if(MSVC) +- # install(FILES $ DESTINATION lib OPTIONAL) +- INSTALL(FILES ${PROJECT_BINARY_DIR}/${name}.dir/Debug/${name}.pdb +- DESTINATION lib CONFIGURATIONS Debug ) +-endif() + + #------------------------------------------------------------------------ + # Dynamic Library +@@ -445,6 +440,9 @@ if (BUILD_SHARED_LIB) + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ) ++ if(MSVC) ++ install(FILES $ DESTINATION ${LIB_INSTALL_DIR} OPTIONAL) ++ endif() + if (TIDY_CONSOLE_SHARED) # user wants shared/dll linkage + list ( APPEND add_LIBS ${name} ) + endif () diff --git a/recipes/tidy-html5/all/test_package/CMakeLists.txt b/recipes/tidy-html5/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/tidy-html5/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/tidy-html5/all/test_package/conanfile.py b/recipes/tidy-html5/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/tidy-html5/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tidy-html5/all/test_package/test_package.c b/recipes/tidy-html5/all/test_package/test_package.c new file mode 100644 index 0000000000000..a0c6f770d3579 --- /dev/null +++ b/recipes/tidy-html5/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() +{ + printf("tidy-html5 version: %s\n", tidyLibraryVersion()); + return EXIT_SUCCESS; +} diff --git a/recipes/tidy-html5/config.yml b/recipes/tidy-html5/config.yml new file mode 100644 index 0000000000000..cb7491a845a14 --- /dev/null +++ b/recipes/tidy-html5/config.yml @@ -0,0 +1,3 @@ +versions: + "5.8.0": + folder: "all" diff --git a/recipes/timsort/all/conandata.yml b/recipes/timsort/all/conandata.yml new file mode 100644 index 0000000000000..47ca98338210c --- /dev/null +++ b/recipes/timsort/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.2.0": + sha256: 3a189cb8717efbf0442da1d62109b7e881c158ab8167f8997e79cdb3a2cd7c9a + url: https://github.com/timsort/cpp-TimSort/archive/v1.2.0.tar.gz + "1.2.1": + sha256: 4f32285926330c97290b102c92c4ae8c308f46f70488d383595ae5f191e1de55 + url: https://github.com/timsort/cpp-TimSort/archive/v1.2.1.tar.gz + "1.2.2": + sha256: 594a5e59248accd1caa6a9e0f145d91ed9cf5bf1044d46684df1e866a534ee76 + url: https://github.com/timsort/cpp-TimSort/archive/v1.2.2.tar.gz + "1.3.0": + sha256: 25fe8338ac053c09662d62bbcaab981e478054a75b9422c1a652e580026713f0 + url: https://github.com/timsort/cpp-TimSort/archive/v1.3.0.tar.gz + "2.0.0": + sha256: 6cb23b0efb83e1d4f6eab58cddd35b36ca49cd927a46294575b9c0d304a2e833 + url: https://github.com/timsort/cpp-TimSort/archive/v2.0.0.tar.gz + "2.0.1": + sha256: 5c7fe16ca8ead3a86691cb64c373b9ca634add6b6539254baa58f4e254e865c6 + url: https://github.com/timsort/cpp-TimSort/archive/v2.0.1.tar.gz + "2.0.2": + sha256: df15ac2cea751e573979ff97966f2b3d5d9c35a819c43d9944756974e069b2d7 + url: https://github.com/timsort/cpp-TimSort/archive/v2.0.2.tar.gz + "2.1.0": + sha256: b16606f85316d9a3cfde638c02dd9ce23324b0a904bb020e4ad2497cb8cf9ebd + url: https://github.com/timsort/cpp-TimSort/archive/v2.1.0.tar.gz diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py new file mode 100644 index 0000000000000..b1ba83d8496dd --- /dev/null +++ b/recipes/timsort/all/conanfile.py @@ -0,0 +1,48 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.43.0" + + +class TimsortConan(ConanFile): + name = "timsort" + description = "A C++ implementation of timsort" + topics = ("timsort", "sorting", "algorithms") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/timsort/cpp-TimSort" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + if tools.Version(self.version) >= "2.0.0": + tools.check_min_cppstd(self, 11) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gfx-timsort") + self.cpp_info.set_property("cmake_target_name", "gfx::timsort") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "gfx-timsort" + self.cpp_info.filenames["cmake_find_package_multi"] = "gfx-timsort" + self.cpp_info.names["cmake_find_package"] = "gfx" + self.cpp_info.names["cmake_find_package_multi"] = "gfx" + self.cpp_info.components["gfx-timsort"].names["cmake_find_package"] = "timsort" + self.cpp_info.components["gfx-timsort"].names["cmake_find_package_multi"] = "timsort" + self.cpp_info.components["gfx-timsort"].set_property("cmake_target_name", "gfx::timsort") diff --git a/recipes/timsort/all/test_package/CMakeLists.txt b/recipes/timsort/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d7e20e564e8bd --- /dev/null +++ b/recipes/timsort/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gfx-timsort REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} gfx::timsort) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/timsort/all/test_package/conanfile.py b/recipes/timsort/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/timsort/all/test_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/timsort/all/test_package/test_package.cpp b/recipes/timsort/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d71cacbe61fd --- /dev/null +++ b/recipes/timsort/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2011 Fuji, Goro (gfx) . + * Copyright (c) 2019 Morwenn. + * + * SPDX-License-Identifier: MIT + */ +#include +#include +#include + +int main() +{ + const std::size_t size = 5; + + int arr[size] = { 5, 8, 3, 2, 9 }; + gfx::timsort(arr, arr + size); + + // should print 2 3 5 8 9 + for (std::size_t idx = 0 ; idx < size ; ++idx) { + std::cout << arr[idx] << ' '; + } +} diff --git a/recipes/timsort/config.yml b/recipes/timsort/config.yml new file mode 100644 index 0000000000000..95d7ff39635a1 --- /dev/null +++ b/recipes/timsort/config.yml @@ -0,0 +1,17 @@ +versions: + "1.2.0": + folder: all + "1.2.1": + folder: all + "1.2.2": + folder: all + "1.3.0": + folder: all + "2.0.0": + folder: all + "2.0.1": + folder: all + "2.0.2": + folder: all + "2.1.0": + folder: all diff --git a/recipes/tinkerforge-bindings/all/CMakeLists.txt b/recipes/tinkerforge-bindings/all/CMakeLists.txt new file mode 100644 index 0000000000000..2ea059e4508ba --- /dev/null +++ b/recipes/tinkerforge-bindings/all/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.4) +project(tinkerforge_bindings) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +file(GLOB SOURCES ${CMAKE_SOURCE_DIR}/source_subfolder/source/*.c) +file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/source_subfolder/source/*.h) + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_library(${PROJECT_NAME} ${SOURCES}) + +if(MSVC) + target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32 advapi32) +endif() + +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}") +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include +) diff --git a/recipes/tinkerforge-bindings/all/conandata.yml b/recipes/tinkerforge-bindings/all/conandata.yml new file mode 100644 index 0000000000000..4a2d6c836c7df --- /dev/null +++ b/recipes/tinkerforge-bindings/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "2.1.32": + url: https://download.tinkerforge.com/bindings/c/tinkerforge_c_bindings_2_1_32.zip + sha256: "228f8eb3e64170312ceaca7354ba5f3178e89389782b304657ccdd2a2fd2b6b5" + diff --git a/recipes/tinkerforge-bindings/all/conanfile.py b/recipes/tinkerforge-bindings/all/conanfile.py new file mode 100644 index 0000000000000..fb57c7fccf3f7 --- /dev/null +++ b/recipes/tinkerforge-bindings/all/conanfile.py @@ -0,0 +1,86 @@ +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + +class TinkerforgeBindingsConan(ConanFile): + name = "tinkerforge-bindings" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.tinkerforge.com/" + license = "CC0 1.0 Universal" + description = "API bindings to control Tinkerforge's Bricks and Bricklets" + topics = "iot", "maker", "bindings" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.compiler == "Visual Studio" and self.options.shared and "MT" in self.settings.compiler.runtime: + raise ConanInvalidConfiguration("Static runtime + shared is failing to link") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=False) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("license.txt", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "tinkerforge::bindings") + + self.cpp_info.names["cmake_find_package"] = "tinkerforge" + self.cpp_info.names["cmake_find_package_multi"] = "tinkerforge" + self.cpp_info.filenames["cmake_find_package"] = "tinkerforge-bindings" + self.cpp_info.filenames["cmake_find_package_multi"] = "tinkerforge-bindings" + self.cpp_info.components["_bindings"].names["cmake_find_package"] = "bindings" + self.cpp_info.components["_bindings"].names["cmake_find_package_multi"] = "bindings" + self.cpp_info.components["_bindings"].libs = ["tinkerforge_bindings"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_bindings"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["_bindings"].system_libs = ["advapi32", "ws2_32"] diff --git a/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt b/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b831e148cc9c0 --- /dev/null +++ b/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tinkerforge-bindings REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} tinkerforge::bindings) diff --git a/recipes/tinkerforge-bindings/all/test_package/conanfile.py b/recipes/tinkerforge-bindings/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0245c9a8028a3 --- /dev/null +++ b/recipes/tinkerforge-bindings/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/tinkerforge-bindings/all/test_package/test_package.c b/recipes/tinkerforge-bindings/all/test_package/test_package.c new file mode 100644 index 0000000000000..049411d10a632 --- /dev/null +++ b/recipes/tinkerforge-bindings/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include + +#include "ip_connection.h" +#include "brick_master.h" + +#define HOST "localhost" +#define PORT 4223 +#define UID "XXYYZZ" // Change XXYYZZ to the UID of your Master Brick + +int main(void) { + // Create IP connection + IPConnection ipcon; + ipcon_create(&ipcon); + + // Create device object + Master master; + master_create(&master, UID, &ipcon); + + // Connect to brickd + if(ipcon_connect(&ipcon, HOST, PORT) < 0) { + fprintf(stderr, "Could not connect\n"); + return 0; + } + fprintf(stdout, "Connected!\n"); + return 0; +} diff --git a/recipes/tinkerforge-bindings/config.yml b/recipes/tinkerforge-bindings/config.yml new file mode 100644 index 0000000000000..d03f744650d0a --- /dev/null +++ b/recipes/tinkerforge-bindings/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.32": + folder: all diff --git a/recipes/tiny-aes-c/all/conandata.yml b/recipes/tiny-aes-c/all/conandata.yml new file mode 100644 index 0000000000000..f5bd969c7683c --- /dev/null +++ b/recipes/tiny-aes-c/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.0": + url: "https://github.com/kokke/tiny-AES-c/archive/v1.0.0.tar.gz" + sha256: "61fd99ac95df30e9ab39d6cdd41e88909b2eaf9b9806f23aa235485ac0bed2fd" +patches: + "1.0.0": + - patch_file: "patches/0001-cmake-install.patch" + patch_description: "CMake: add install target" + patch_type: "conan" diff --git a/recipes/tiny-aes-c/all/conanfile.py b/recipes/tiny-aes-c/all/conanfile.py new file mode 100644 index 0000000000000..e393e50a77697 --- /dev/null +++ b/recipes/tiny-aes-c/all/conanfile.py @@ -0,0 +1,105 @@ +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 +import os + +required_conan_version = ">=1.52.0" + + +class TinyAesCConan(ConanFile): + name = "tiny-aes-c" + license = "Unlicense" + homepage = "https://github.com/kokke/tiny-AES-c" + url = "https://github.com/conan-io/conan-center-index" + description = "Small portable AES128/192/256 in C" + topics = ("encryption", "crypto", "AES") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + # AES128, AES192 or AES256 + "aes_block_size": ["aes128", "aes192", "aes256"], + # enable AES encryption in CBC-mode of operation + "cbc": [True, False], + # enable the basic ECB 16-byte block algorithm + "ecb": [True, False], + # enable encryption in counter-mode + "ctr": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "aes_block_size": "aes128", + "cbc": True, + "ecb": True, + "ctr": True, + } + + @property + def _aes_defs(self): + return { + str(self.options.aes_block_size).upper(): "1", + "CBC": "1" if self.options.cbc else "0", + "ECB": "1" if self.options.ecb else "0", + "CTR": "1" if self.options.ctr else "0", + } + + 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.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not self.info.options.cbc and not self.info.options.ecb and not self.info.options.ctr: + raise ConanInvalidConfiguration("Need to at least specify one of CBC, ECB or CTR modes") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + for definition, value in self._aes_defs.items(): + tc.preprocessor_definitions[definition] = value + # Export symbols for shared msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared lib on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "unlicense.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 = ["tiny-aes"] + self.cpp_info.defines.extend([f"{definition}={value}" for definition, value in self._aes_defs.items()]) diff --git a/recipes/tiny-aes-c/all/patches/0001-cmake-install.patch b/recipes/tiny-aes-c/all/patches/0001-cmake-install.patch new file mode 100644 index 0000000000000..bc75d2b9edd8c --- /dev/null +++ b/recipes/tiny-aes-c/all/patches/0001-cmake-install.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,3 +7,11 @@ add_library(tiny-aes + ) + + target_include_directories(tiny-aes PRIVATE tiny-AES-c/) ++include(GNUInstallDirs) ++install(FILES aes.h aes.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install( ++ TARGETS tiny-aes ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) diff --git a/recipes/tiny-aes-c/all/test_package/CMakeLists.txt b/recipes/tiny-aes-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..40e72103cc9fc --- /dev/null +++ b/recipes/tiny-aes-c/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C CXX) + +find_package(tiny-aes-c REQUIRED CONFIG) + +add_executable(test_package_c test_package.c) +add_executable(test_package_cpp test_package.cpp) + +target_link_libraries(test_package_c PRIVATE tiny-aes-c::tiny-aes-c) +target_link_libraries(test_package_cpp PRIVATE tiny-aes-c::tiny-aes-c) diff --git a/recipes/tiny-aes-c/all/test_package/conanfile.py b/recipes/tiny-aes-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..66426ef544d60 --- /dev/null +++ b/recipes/tiny-aes-c/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/tiny-aes-c/all/test_package/test_package.c b/recipes/tiny-aes-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..95d91a8e04689 --- /dev/null +++ b/recipes/tiny-aes-c/all/test_package/test_package.c @@ -0,0 +1,100 @@ +#include +#include +#include + +#include "aes.h" + +static void phex(uint8_t* str); +static int test_encrypt_cbc(void); + +int main(void) +{ + int exit; + +#if defined(CBC) + printf("\nUsing CBC\n"); +#endif +#if defined(CTR) + printf("\nUsing CTR\n"); +#endif +#if defined(ECB) + printf("\nUsing ECB\n"); +#endif + +#if defined(AES256) + printf("\nTesting AES256\n"); +#elif defined(AES192) + printf("\nTesting AES192\n"); +#elif defined(AES128) + printf("\nTesting AES128\n"); +#else + printf("You need to specify a symbol between AES128, AES192 or AES256. Exiting"); + return 0; +#endif + + exit = test_encrypt_cbc(); + + return exit; +} + + +// prints string as hex +static void phex(uint8_t* str) +{ + +#if defined(AES256) + uint8_t len = 32; +#elif defined(AES192) + uint8_t len = 24; +#elif defined(AES128) + uint8_t len = 16; +#endif + + unsigned char i; + for (i = 0; i < len; ++i) + printf("%.2x", str[i]); + printf("\n"); +} + +static int test_encrypt_cbc(void) +{ +#if defined(AES256) + uint8_t key[] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 }; + uint8_t out[] = { 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, 0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6, + 0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, 0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d, + 0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf, 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61, + 0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc, 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b }; +#elif defined(AES192) + uint8_t key[] = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b }; + uint8_t out[] = { 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d, 0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8, + 0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4, 0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a, + 0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0, 0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0, + 0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81, 0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd }; +#elif defined(AES128) + uint8_t key[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; + uint8_t out[] = { 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, + 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, + 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, + 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 }; +#endif + uint8_t iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; + uint8_t in[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, + 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, + 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, + 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; + struct AES_ctx ctx; + + AES_init_ctx_iv(&ctx, key, iv); + AES_CBC_encrypt_buffer(&ctx, in, 64); + + printf("CBC encrypt: "); + + if (0 == memcmp((char*) out, (char*) in, 64)) { + printf("SUCCESS!\n"); + return(0); + } else { + printf("FAILURE!\n"); + return(1); + } +} diff --git a/recipes/tiny-aes-c/all/test_package/test_package.cpp b/recipes/tiny-aes-c/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ebe8ca42f7086 --- /dev/null +++ b/recipes/tiny-aes-c/all/test_package/test_package.cpp @@ -0,0 +1,100 @@ +#include +#include +#include + +#include "aes.hpp" + +static void phex(uint8_t* str); +static int test_encrypt_cbc(void); + +int main(void) +{ + int exit; + +#if defined(CBC) + printf("\nUsing CBC\n"); +#endif +#if defined(CTR) + printf("\nUsing CTR\n"); +#endif +#if defined(ECB) + printf("\nUsing ECB\n"); +#endif + +#if defined(AES256) + printf("\nTesting AES256\n"); +#elif defined(AES192) + printf("\nTesting AES192\n"); +#elif defined(AES128) + printf("\nTesting AES128\n"); +#else + printf("You need to specify a symbol between AES128, AES192 or AES256. Exiting"); + return 0; +#endif + + exit = test_encrypt_cbc(); + + return exit; +} + + +// prints string as hex +static void phex(uint8_t* str) +{ + +#if defined(AES256) + uint8_t len = 32; +#elif defined(AES192) + uint8_t len = 24; +#elif defined(AES128) + uint8_t len = 16; +#endif + + unsigned char i; + for (i = 0; i < len; ++i) + printf("%.2x", str[i]); + printf("\n"); +} + +static int test_encrypt_cbc(void) +{ +#if defined(AES256) + uint8_t key[] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 }; + uint8_t out[] = { 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, 0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6, + 0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, 0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d, + 0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf, 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61, + 0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc, 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b }; +#elif defined(AES192) + uint8_t key[] = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b }; + uint8_t out[] = { 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d, 0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8, + 0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4, 0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a, + 0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0, 0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0, + 0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81, 0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd }; +#elif defined(AES128) + uint8_t key[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; + uint8_t out[] = { 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, + 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, + 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, + 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 }; +#endif + uint8_t iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; + uint8_t in[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, + 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, + 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, + 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; + struct AES_ctx ctx; + + AES_init_ctx_iv(&ctx, key, iv); + AES_CBC_encrypt_buffer(&ctx, in, 64); + + printf("CBC encrypt: "); + + if (0 == memcmp((char*) out, (char*) in, 64)) { + printf("SUCCESS!\n"); + return(0); + } else { + printf("FAILURE!\n"); + return(1); + } +} diff --git a/recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt b/recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tiny-aes-c/all/test_v1_package/conanfile.py b/recipes/tiny-aes-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..43f372e78e8c3 --- /dev/null +++ b/recipes/tiny-aes-c/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package_c") + self.run(bin_path, run_environment=True) + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) diff --git a/recipes/tiny-aes-c/config.yml b/recipes/tiny-aes-c/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/tiny-aes-c/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/tiny-bignum-c/all/CMakeLists.txt b/recipes/tiny-bignum-c/all/CMakeLists.txt new file mode 100644 index 0000000000000..44dd25e827b3a --- /dev/null +++ b/recipes/tiny-bignum-c/all/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.4) +project(tiny-bignum-c LANGUAGES C) + +add_library(tiny-bignum-c ${TINY_BIGNUM_C_SRC_DIR}/bn.c) +set_target_properties(tiny-bignum-c PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +include(GNUInstallDirs) +install(TARGETS tiny-bignum-c + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${TINY_BIGNUM_C_SRC_DIR}/bn.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/tiny-bignum-c/all/conandata.yml b/recipes/tiny-bignum-c/all/conandata.yml new file mode 100644 index 0000000000000..18f9bae3b2ab8 --- /dev/null +++ b/recipes/tiny-bignum-c/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200203": + url: "https://github.com/kokke/tiny-bignum-c/archive/cb8b53925ae79e5fb8f6a2f21b371fb2c3c8e7ec.tar.gz" + sha256: "932ff413b78cb25d49c86220dce7017198cfbb4fc85f658709d39e3706f3c478" diff --git a/recipes/tiny-bignum-c/all/conanfile.py b/recipes/tiny-bignum-c/all/conanfile.py new file mode 100644 index 0000000000000..af56e48b755d8 --- /dev/null +++ b/recipes/tiny-bignum-c/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class TinybignumcConan(ConanFile): + name = "tiny-bignum-c" + description = "Small portable multiple-precision unsigned integer arithmetic in C." + license = "Unlicense" + topics = ("bignum", "arbitrary-precision", "multi-precision") + homepage = "https://github.com/kokke/tiny-bignum-c" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TINY_BIGNUM_C_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 = ["tiny-bignum-c"] diff --git a/recipes/tiny-bignum-c/all/test_package/CMakeLists.txt b/recipes/tiny-bignum-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a60cde76895a2 --- /dev/null +++ b/recipes/tiny-bignum-c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tiny-bignum-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tiny-bignum-c::tiny-bignum-c) diff --git a/recipes/tiny-bignum-c/all/test_package/conanfile.py b/recipes/tiny-bignum-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tiny-bignum-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/tiny-bignum-c/all/test_package/test_package.c b/recipes/tiny-bignum-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..be32d2b25a2f5 --- /dev/null +++ b/recipes/tiny-bignum-c/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include + +#include + +void factorial(struct bn* n, struct bn* res) { + struct bn tmp; + + bignum_assign(&tmp, n); + bignum_dec(n); + + while (!bignum_is_zero(n)) { + bignum_mul(&tmp, n, res); + bignum_dec(n); + bignum_assign(&tmp, res); + } + + bignum_assign(res, &tmp); +} + +int main(void) { + struct bn num; + struct bn result; + char buf[8192]; + + bignum_from_int(&num, 100); + factorial(&num, &result); + bignum_to_string(&result, buf, sizeof(buf)); + printf("factorial(100) using bignum = %s\n", buf); + + return 0; +} diff --git a/recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt b/recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tiny-bignum-c/all/test_v1_package/conanfile.py b/recipes/tiny-bignum-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tiny-bignum-c/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/tiny-bignum-c/config.yml b/recipes/tiny-bignum-c/config.yml new file mode 100644 index 0000000000000..10b93e6c20db8 --- /dev/null +++ b/recipes/tiny-bignum-c/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200203": + folder: all diff --git a/recipes/tiny-dnn/all/CMakeLists.txt b/recipes/tiny-dnn/all/CMakeLists.txt new file mode 100644 index 0000000000000..b71c882d9d33f --- /dev/null +++ b/recipes/tiny-dnn/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/tiny-dnn/all/conandata.yml b/recipes/tiny-dnn/all/conandata.yml new file mode 100644 index 0000000000000..70d5405c3754a --- /dev/null +++ b/recipes/tiny-dnn/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20201023": + url: "https://github.com/tiny-dnn/tiny-dnn/archive/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5.tar.gz" + sha256: "123dabe15b019938e04c7ccdd22c8423ceae091f4bd2fb878f972a2ea031d4b9" diff --git a/recipes/tiny-dnn/all/conanfile.py b/recipes/tiny-dnn/all/conanfile.py new file mode 100644 index 0000000000000..b3a57165d52a3 --- /dev/null +++ b/recipes/tiny-dnn/all/conanfile.py @@ -0,0 +1,107 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class TinyDnnConan(ConanFile): + name = "tiny-dnn" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tiny-dnn/tiny-dnn" + description = "tiny-dnn is a C++14 implementation of deep learning." + topics = ("header-only", "deep-learning", "embedded", "iot", "computational") + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_tbb": [True, False], + } + default_options = { + "with_tbb": False, + } + + exports_sources = "CMakeLists.txt" + # TODO: if you move this recipe to CMakeDeps, be aware that tiny-dnn + # relies on CMake variables which are not defined in CMakeDeps, only + # in cmake_find_package. So patch it before. + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _min_cppstd(self): + return "14" + + @property + def _min_compilers_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14" + } + + def requirements(self): + self.requires("cereal/1.3.1") + self.requires("stb/cci.20210713") + if self.options.with_tbb: + self.requires("onetbb/2020.3") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, self._min_cppstd) + + compiler = str(self.settings.compiler) + version = tools.Version(self.settings.compiler.version) + if compiler in self._min_compilers_version and version < self._min_compilers_version[compiler]: + raise ConanInvalidConfiguration( + "{} requires a compiler that supports at least C++{}".format( + self.name, self._min_cppstd, + ) + ) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + tools.replace_in_file( + os.path.join(self._source_subfolder, "tiny_dnn", "util", "image.h"), + "third_party/", "", + ) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = CMake(self) + cmake.definitions["USE_TBB"] = self.options.with_tbb + cmake.definitions["USE_GEMMLOWP"] = False + cmake.configure() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tinydnn") + self.cpp_info.set_property("cmake_target_name", "TinyDNN::tiny_dnn") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tinydnn"].system_libs = ["pthread"] + if self.options.with_tbb: + self.cpp_info.components["tinydnn"].defines = ["CNN_USE_TBB=1"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tinydnn" + self.cpp_info.filenames["cmake_find_package_multi"] = "tinydnn" + self.cpp_info.names["cmake_find_package"] = "TinyDNN" + self.cpp_info.names["cmake_find_package_multi"] = "TinyDNN" + self.cpp_info.components["tinydnn"].names["cmake_find_package"] = "tiny_dnn" + self.cpp_info.components["tinydnn"].names["cmake_find_package_multi"] = "tiny_dnn" + self.cpp_info.components["tinydnn"].set_property("cmake_target_name", "TinyDNN::tiny_dnn") + self.cpp_info.components["tinydnn"].requires = ["cereal::cereal", "stb::stb"] + if self.options.with_tbb: + self.cpp_info.components["tinydnn"].requires.append("onetbb::onetbb") diff --git a/recipes/tiny-dnn/all/test_package/CMakeLists.txt b/recipes/tiny-dnn/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e2d99200a80ab --- /dev/null +++ b/recipes/tiny-dnn/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tinydnn REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} TinyDNN::tiny_dnn) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/tiny-dnn/all/test_package/conanfile.py b/recipes/tiny-dnn/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tiny-dnn/all/test_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/tiny-dnn/all/test_package/test_package.cpp b/recipes/tiny-dnn/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1bba1bf07b706 --- /dev/null +++ b/recipes/tiny-dnn/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +/* + Copyright (c) 2013, Taiga Nomi and the respective contributors + All rights reserved. + Use of this source code is governed by a BSD-style license that can be found + in the LICENSE file. +*/ + +#include + +#include "tiny_dnn/tiny_dnn.h" + +int main() { + tiny_dnn::models::alexnet nn; + + // change all layers at once + nn.weight_init(tiny_dnn::weight_init::constant(2.0)); + nn.bias_init(tiny_dnn::weight_init::constant(2.0)); + nn.init_weight(); + + tiny_dnn::vec_t in(224 * 224 * 3); + + // generate random variables + tiny_dnn::uniform_rand(in.begin(), in.end(), 0, 1); + + tiny_dnn::timer t; // start the timer + + // predict + auto res = nn.predict(in); + + double elapsed_s = t.elapsed(); + t.stop(); + + std::cout << "Elapsed time(s): " << elapsed_s << std::endl; +} diff --git a/recipes/tiny-dnn/config.yml b/recipes/tiny-dnn/config.yml new file mode 100644 index 0000000000000..a1ff806317b84 --- /dev/null +++ b/recipes/tiny-dnn/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201023": + folder: "all" diff --git a/recipes/tiny-regex-c/all/CMakeLists.txt b/recipes/tiny-regex-c/all/CMakeLists.txt new file mode 100644 index 0000000000000..26cfc3ad0a04d --- /dev/null +++ b/recipes/tiny-regex-c/all/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.4) +project(tiny-regex-c LANGUAGES C) + +add_library(${PROJECT_NAME} ${TINY_REGEX_C_SRC_DIR}/re.c) +set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +if(RE_DOT_MATCHES_NEWLINE) + target_compile_definitions(${PROJECT_NAME} PUBLIC RE_DOT_MATCHES_NEWLINE=1) +else() + target_compile_definitions(${PROJECT_NAME} PUBLIC RE_DOT_MATCHES_NEWLINE=0) +endif() + +include(GNUInstallDirs) +install( + TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES ${TINY_REGEX_C_SRC_DIR}/re.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/tiny-regex-c/all/conandata.yml b/recipes/tiny-regex-c/all/conandata.yml new file mode 100644 index 0000000000000..0883ed0c5f650 --- /dev/null +++ b/recipes/tiny-regex-c/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210215": + url: "https://github.com/kokke/tiny-regex-c/archive/98d0bf28278b2230f95b7ba39744cb29b806f03a.zip" + sha256: "27191a4cbf6008a60a3177cf782b0ec31891a884844813ae959329d1d0ec5828" diff --git a/recipes/tiny-regex-c/all/conanfile.py b/recipes/tiny-regex-c/all/conanfile.py new file mode 100644 index 0000000000000..1d5c381da2516 --- /dev/null +++ b/recipes/tiny-regex-c/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class TinyregexcConan(ConanFile): + name = "tiny-regex-c" + description = "Small and portable Regular Expression (regex) library written in C." + license = "Unlicense" + topics = ("regex",) + homepage = "https://github.com/kokke/tiny-regex-c" + 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], + "dot_matches_newline": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "dot_matches_newline": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TINY_REGEX_C_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["RE_DOT_MATCHES_NEWLINE"] = self.options.dot_matches_newline + 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 = ["tiny-regex-c"] + self.cpp_info.defines = ["RE_DOT_MATCHES_NEWLINE={}".format("1" if self.options.dot_matches_newline else "0")] diff --git a/recipes/tiny-regex-c/all/test_package/CMakeLists.txt b/recipes/tiny-regex-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7fe8bdd3edaeb --- /dev/null +++ b/recipes/tiny-regex-c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tiny-regex-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tiny-regex-c::tiny-regex-c) diff --git a/recipes/tiny-regex-c/all/test_package/conanfile.py b/recipes/tiny-regex-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tiny-regex-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/tiny-regex-c/all/test_package/test_package.c b/recipes/tiny-regex-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..8316314560431 --- /dev/null +++ b/recipes/tiny-regex-c/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include + +#include + +int main() { + int match_length; + const char *string_to_search = "ahem.. 'hello world !' .."; + re_t pattern = re_compile("[Hh]ello [Ww]orld\\s*[!]?"); + + int match_idx = re_matchp(pattern, string_to_search, &match_length); + if (match_idx != -1) { + printf("match at idx %i, %i chars long.\n", match_idx, match_length); + } + + return 0; +} diff --git a/recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt b/recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tiny-regex-c/all/test_v1_package/conanfile.py b/recipes/tiny-regex-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tiny-regex-c/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/tiny-regex-c/config.yml b/recipes/tiny-regex-c/config.yml new file mode 100644 index 0000000000000..87bfa3a98208d --- /dev/null +++ b/recipes/tiny-regex-c/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210215": + folder: all diff --git a/recipes/tiny-utf8/all/conandata.yml b/recipes/tiny-utf8/all/conandata.yml new file mode 100644 index 0000000000000..9582b81c5af64 --- /dev/null +++ b/recipes/tiny-utf8/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "4.4.3": + url: "https://github.com/DuffsDevice/tiny-utf8/archive/refs/tags/v4.4.3.tar.gz" + sha256: "8e3f61651909c9f3105d3501932a96aa65733127fb6e7cf94cb1b0a2dff42c8f" + "4.4.2": + url: "https://github.com/DuffsDevice/tiny-utf8/archive/v4.4.2.tar.gz" + sha256: "dd442b3cca93603ce940bf7adf7e8e44849e6b07a7fa2bb28c0b77bab7699082" + "4.4.1": + url: "https://github.com/DuffsDevice/tiny-utf8/archive/refs/tags/v4.4.1.tar.gz" + sha256: "c083ce288b5a4f7f153e55332b097fa952d985f0bb0b8302bdaec739d3045768" + "4.3.2": + url: "https://github.com/DuffsDevice/tiny-utf8/archive/refs/tags/v4.3.2.tar.gz" + sha256: "3c4545e2f06052ee05c614e4ad365adaa28ae2edf5902ffc9c1eb2ecce0d3338" diff --git a/recipes/tiny-utf8/all/conanfile.py b/recipes/tiny-utf8/all/conanfile.py new file mode 100644 index 0000000000000..f33d8b0994f66 --- /dev/null +++ b/recipes/tiny-utf8/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class Tinyutf8Conan(ConanFile): + name = "tiny-utf8" + description = "Tiny-utf8 is a library for extremely easy integration of Unicode into an arbitrary C++11 project." + license = "BSD-3-Clause" + topics = ("tiny-utf8", "utf8") + homepage = "https://github.com/DuffsDevice/tiny-utf8" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + def build(self): + pass + + def package(self): + copy(self, "LICENCE", 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_file_name", "tinyutf8") + self.cpp_info.set_property("cmake_target_name", "tinyutf8::tinyutf8") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "tinyutf8" + self.cpp_info.names["cmake_find_package_multi"] = "tinyutf8" diff --git a/recipes/tiny-utf8/all/test_package/CMakeLists.txt b/recipes/tiny-utf8/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e43ae145c7705 --- /dev/null +++ b/recipes/tiny-utf8/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tinyutf8 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinyutf8::tinyutf8) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tiny-utf8/all/test_package/conanfile.py b/recipes/tiny-utf8/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/tiny-utf8/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/tiny-utf8/all/test_package/test_package.cpp b/recipes/tiny-utf8/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a208623001dc6 --- /dev/null +++ b/recipes/tiny-utf8/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +#include +#include + +int main() { + tiny_utf8::string str = u8"!🌍 olleH"; + std::for_each(str.rbegin(), str.rend(), [](char32_t codepoint) { + std::cout << codepoint; + }); + + return 0; +} diff --git a/recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt b/recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5cf8cfb85bc6b --- /dev/null +++ b/recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tinyutf8 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinyutf8::tinyutf8) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tiny-utf8/all/test_v1_package/conanfile.py b/recipes/tiny-utf8/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tiny-utf8/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/tiny-utf8/config.yml b/recipes/tiny-utf8/config.yml new file mode 100644 index 0000000000000..124fb5d905045 --- /dev/null +++ b/recipes/tiny-utf8/config.yml @@ -0,0 +1,9 @@ +versions: + "4.4.3": + folder: all + "4.4.2": + folder: all + "4.4.1": + folder: all + "4.3.2": + folder: all diff --git a/recipes/tinyalsa/all/conandata.yml b/recipes/tinyalsa/all/conandata.yml new file mode 100644 index 0000000000000..e736cb9ab9606 --- /dev/null +++ b/recipes/tinyalsa/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "2.0.0": + url: "https://github.com/tinyalsa/tinyalsa/archive/refs/tags/v2.0.0.tar.gz" + sha256: "573ae0b2d3480851c1d2a12503ead2beea27f92d44ed47b74b553ba947994ef1" + "1.1.1": + url: "https://github.com/tinyalsa/tinyalsa/archive/1.1.1.tar.gz" + sha256: "d92b438cea348ae316c4b2cbf367b4f01ed821a947e6a34d813624e9e3c936c1" +patches: + "2.0.0": + - patch_file: "patches/tinyalsa-2.0.0-strncpy-warning.patch" + base_path: "source_subfolder" diff --git a/recipes/tinyalsa/all/conanfile.py b/recipes/tinyalsa/all/conanfile.py new file mode 100644 index 0000000000000..3475e6c4f17af --- /dev/null +++ b/recipes/tinyalsa/all/conanfile.py @@ -0,0 +1,68 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class TinyAlsaConan(ConanFile): + name = "tinyalsa" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tinyalsa/tinyalsa" + topics = ("tiny", "alsa", "sound", "audio", "tinyalsa") + description = "A small library to interface with ALSA in the Linux kernel" + exports_sources = ["patches/*",] + options = {"shared": [True, False], "with_utils": [True, False]} + default_options = {'shared': False, 'with_utils': False} + settings = "os", "compiler", "build_type", "arch" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("{} only works for Linux.".format(self.name)) + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + with tools.chdir(self._source_subfolder): + env_build = AutoToolsBuildEnvironment(self) + env_build.make() + + def package(self): + self.copy("NOTICE", dst="licenses", src=self._source_subfolder) + + with tools.chdir(self._source_subfolder): + env_build = AutoToolsBuildEnvironment(self) + env_build_vars = env_build.vars + env_build_vars['PREFIX'] = self.package_folder + env_build.install(vars=env_build_vars) + + tools.rmdir(os.path.join(self.package_folder, "share")) + + if not self.options.with_utils: + tools.rmdir(os.path.join(self.package_folder, "bin")) + + with tools.chdir(os.path.join(self.package_folder, "lib")): + files = os.listdir() + for f in files: + if (self.options.shared and f.endswith(".a")) or (not self.options.shared and not f.endswith(".a")): + os.unlink(f) + + def package_info(self): + self.cpp_info.libs = ["tinyalsa"] + if tools.Version(self.version) >= "2.0.0": + self.cpp_info.system_libs.append("dl") + if self.options.with_utils: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info('Appending PATH environment variable: %s' % bin_path) + self.env_info.path.append(bin_path) diff --git a/recipes/tinyalsa/all/patches/tinyalsa-2.0.0-strncpy-warning.patch b/recipes/tinyalsa/all/patches/tinyalsa-2.0.0-strncpy-warning.patch new file mode 100644 index 0000000000000..ff8296e6d3dba --- /dev/null +++ b/recipes/tinyalsa/all/patches/tinyalsa-2.0.0-strncpy-warning.patch @@ -0,0 +1,46 @@ +diff --git a/src/mixer_plugin.c b/src/mixer_plugin.c +index 34117a9..4172dd3 100644 +--- a/src/mixer_plugin.c ++++ b/src/mixer_plugin.c +@@ -82,7 +82,8 @@ static int mixer_plug_get_elem_id(struct mixer_plug_data *plug_data, + id->iface = ctl->iface; + + strncpy((char *)id->name, (char *)ctl->name, +- sizeof(id->name)); ++ sizeof(id->name) - 1); ++ ((char*)id->name)[sizeof(id->name) - 1] = '\0'; + + return 0; + } +@@ -100,7 +101,8 @@ static int mixer_plug_info_enum(struct snd_control *ctl, + + strncpy(einfo->value.enumerated.name, + val->texts[einfo->value.enumerated.item], +- sizeof(einfo->value.enumerated.name)); ++ sizeof(einfo->value.enumerated.name) - 1); ++ einfo->value.enumerated.name[sizeof(einfo->value.enumerated.name) - 1] = '\0'; + + return 0; + } +diff --git a/src/pcm_plugin.c b/src/pcm_plugin.c +index 15bfc80..30bd4c5 100644 +--- a/src/pcm_plugin.c ++++ b/src/pcm_plugin.c +@@ -153,9 +153,14 @@ static int pcm_plug_info(struct pcm_plug_data *plug_data, + return ret; + } + +- strncpy((char *)info->id, name, sizeof(info->id)); +- strncpy((char *)info->name, name, sizeof(info->name)); +- strncpy((char *)info->subname, name, sizeof(info->subname)); ++ strncpy((char *)info->id, name, sizeof(info->id) - 1); ++ ((char *)info->id)[sizeof(info->id) - 1] = '\0'; ++ ++ strncpy((char *)info->name, name, sizeof(info->name) - 1); ++ ((char *)info->name)[sizeof(info->name) - 1] = '\0'; ++ ++ strncpy((char *)info->subname, name, sizeof(info->subname) - 1); ++ ((char *)info->subname)[sizeof(info->subname) - 1] = '\0'; + + info->subdevices_count = 1; + diff --git a/recipes/tinyalsa/all/test_package/CMakeLists.txt b/recipes/tinyalsa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05e771029ef2c --- /dev/null +++ b/recipes/tinyalsa/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tinyalsa CONFIG REQUIRED) + +add_executable(example example.c) +target_link_libraries(example tinyalsa::tinyalsa) diff --git a/recipes/tinyalsa/all/test_package/conanfile.py b/recipes/tinyalsa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..481a3b9adeaa2 --- /dev/null +++ b/recipes/tinyalsa/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class LibalsaTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinyalsa/all/test_package/example.c b/recipes/tinyalsa/all/test_package/example.c new file mode 100644 index 0000000000000..deddf17b21a90 --- /dev/null +++ b/recipes/tinyalsa/all/test_package/example.c @@ -0,0 +1,28 @@ +#include + +#include + +int main(void) +{ + printf("TinyALSA test_package\n"); + + unsigned int card = 0; + unsigned int device = 0; + int flags = PCM_IN; + + const struct pcm_config config = { + .channels = 2, + .rate = 48000, + .format = PCM_FORMAT_S32_LE, + .period_size = 1024, + .period_count = 2, + .start_threshold = 1024, + .silence_threshold = 1024 * 2, + .stop_threshold = 1024 * 2 + }; + + struct pcm *pcm = pcm_open(card, device, flags, &config); + pcm_close(pcm); + + return 0; +} diff --git a/recipes/tinyalsa/config.yml b/recipes/tinyalsa/config.yml new file mode 100644 index 0000000000000..eb4c9584b610a --- /dev/null +++ b/recipes/tinyalsa/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.0": + folder: all + "1.1.1": + folder: all diff --git a/recipes/tinycbor/all/conandata.yml b/recipes/tinycbor/all/conandata.yml new file mode 100644 index 0000000000000..7b0b677552552 --- /dev/null +++ b/recipes/tinycbor/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.6.0": + url: "https://github.com/intel/tinycbor/archive/v0.6.0.tar.gz" + sha256: "512e2c9fce74f60ef9ed3af59161e905f9e19f30a52e433fc55f39f4c70d27e4" + "0.5.3": + url: "https://github.com/intel/tinycbor/archive/v0.5.3.tar.gz" + sha256: "956eb4b670ea4969eaee67395b5bb6437b153960385b77357d6692e979d1b12d" +patches: + "0.6.0": + - patch_file: "patches/0.6.0/001-build-system.patch" + "0.5.3": + - patch_file: "patches/0.5.3/001-build-system.patch" diff --git a/recipes/tinycbor/all/conanfile.py b/recipes/tinycbor/all/conanfile.py new file mode 100644 index 0000000000000..61985ed700c30 --- /dev/null +++ b/recipes/tinycbor/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain +import os + +required_conan_version = ">=1.55.0" + + +class TinycborConan(ConanFile): + name = "tinycbor" + description = ( + "A small CBOR encoder and decoder library, optimized for very fast " + "operation with very small footprint." + ) + license = "MIT" + topics = ("cbor", "encoder", "decoder") + homepage = "https://github.com/intel/tinycbor" + 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 _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and (self.settings.os == "Windows" or is_apple_os(self)): + raise ConanInvalidConfiguration(f"{self.ref} shared not supported on {self.settings.os}") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + env = tc.environment() + env.define("BUILD_SHARED", "1" if self.options.shared else "0") + env.define("BUILD_STATIC", "0" if self.options.shared else "1") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + with chdir(self, self.source_folder): + self.run("nmake -f Makefile.nmake") + else: + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "tinycbor.lib", + src=os.path.join(self.source_folder, "lib"), + dst=os.path.join(self.package_folder, "lib")) + for header in ["cbor.h", "cborjson.h", "tinycbor-version.h"]: + copy(self, header, + src=os.path.join(self.source_folder, "src"), + dst=os.path.join(self.package_folder, "include", "tinycbor")) + else: + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "tinycbor") + self.cpp_info.libs = ["tinycbor"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + self.cpp_info.includedirs.append(os.path.join("include", "tinycbor")) diff --git a/recipes/tinycbor/all/patches/0.5.3/001-build-system.patch b/recipes/tinycbor/all/patches/0.5.3/001-build-system.patch new file mode 100644 index 0000000000000..65ec374f53908 --- /dev/null +++ b/recipes/tinycbor/all/patches/0.5.3/001-build-system.patch @@ -0,0 +1,49 @@ +diff --git a/Makefile b/Makefile +index 239dde8..c43ea68 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,15 +1,15 @@ + # Variables: +-prefix = /usr/local ++#prefix = /usr/local + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + libdir = $(exec_prefix)/lib + includedir = $(prefix)/include + pkgconfigdir = $(libdir)/pkgconfig + +-CFLAGS = -Wall -Wextra +-LDFLAGS_GCSECTIONS = -Wl,--gc-sections ++CFLAGS += -Wall -Wextra ++LDFLAGS_GCSECTIONS += -Wl,--gc-sections + LDFLAGS += $(if $(gc_sections-pass),$(LDFLAGS_GCSECTIONS)) +-LDLIBS = -lm ++LDLIBS += -lm + + GIT_ARCHIVE = git archive --prefix="$(PACKAGE)/" -9 + INSTALL = install +@@ -31,8 +31,8 @@ TINYCBOR_FREESTANDING_SOURCES = \ + # + CBORDUMP_SOURCES = tools/cbordump/cbordump.c + +-BUILD_SHARED = $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) +-BUILD_STATIC = 1 ++BUILD_SHARED ?= $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) ++BUILD_STATIC ?= 1 + + ifneq ($(BUILD_STATIC),1) + ifneq ($(BUILD_SHARED),1) +@@ -151,11 +151,11 @@ lib/libtinycbor.so: $(TINYCBOR_SOURCES:.c=.pic.o) + + bin/cbordump: $(CBORDUMP_SOURCES:.c=.o) $(BINLIBRARY) + @$(MKDIR) -p bin +- $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) ++ $(CC) $(cflags) -o $@ $(LDFLAGS) $^ $(LDLIBS) + + bin/json2cbor: $(JSON2CBOR_SOURCES:.c=.o) $(BINLIBRARY) + @$(MKDIR) -p bin +- $(CC) -o $@ $(LDFLAGS) $^ $(LDFLAGS_CJSON) $(LDLIBS) ++ $(CC) $(cflags) -o $@ $(LDFLAGS) $^ $(LDFLAGS_CJSON) $(LDLIBS) + + tinycbor.pc: tinycbor.pc.in + $(SED) > $@ < $< \ diff --git a/recipes/tinycbor/all/patches/0.6.0/001-build-system.patch b/recipes/tinycbor/all/patches/0.6.0/001-build-system.patch new file mode 100644 index 0000000000000..ebadd13af39b9 --- /dev/null +++ b/recipes/tinycbor/all/patches/0.6.0/001-build-system.patch @@ -0,0 +1,49 @@ +diff --git a/Makefile b/Makefile +index 948e3fa..5b34574 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,15 +1,15 @@ + # Variables: +-prefix = /usr/local ++#prefix = /usr/local + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + libdir = $(exec_prefix)/lib + includedir = $(prefix)/include + pkgconfigdir = $(libdir)/pkgconfig + +-CFLAGS = -Wall -Wextra +-LDFLAGS_GCSECTIONS = -Wl,--gc-sections ++CFLAGS += -Wall -Wextra ++LDFLAGS_GCSECTIONS += -Wl,--gc-sections + LDFLAGS += $(if $(gc_sections-pass),$(LDFLAGS_GCSECTIONS)) +-LDLIBS = -lm ++LDLIBS += -lm + + GIT_ARCHIVE = git archive --prefix="$(PACKAGE)/" -9 + INSTALL = install +@@ -33,8 +33,8 @@ TINYCBOR_FREESTANDING_SOURCES = \ + # + CBORDUMP_SOURCES = tools/cbordump/cbordump.c + +-BUILD_SHARED = $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) +-BUILD_STATIC = 1 ++BUILD_SHARED ?= $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) ++BUILD_STATIC ?= 1 + + ifneq ($(BUILD_STATIC),1) + ifneq ($(BUILD_SHARED),1) +@@ -151,11 +151,11 @@ lib/libtinycbor.so: $(TINYCBOR_SOURCES:.c=.pic.o) + + bin/cbordump: $(CBORDUMP_SOURCES:.c=.o) $(BINLIBRARY) + @$(MKDIR) -p bin +- $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) ++ $(CC) $(cflags) -o $@ $(LDFLAGS) $^ $(LDLIBS) + + bin/json2cbor: $(JSON2CBOR_SOURCES:.c=.o) $(BINLIBRARY) + @$(MKDIR) -p bin +- $(CC) -o $@ $(LDFLAGS) $^ $(LDFLAGS_CJSON) $(LDLIBS) ++ $(CC) $(cflags) -o $@ $(LDFLAGS) $^ $(LDFLAGS_CJSON) $(LDLIBS) + + tinycbor.pc: tinycbor.pc.in + $(SED) > $@ < $< \ diff --git a/recipes/tinycbor/all/test_package/CMakeLists.txt b/recipes/tinycbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d44243714d196 --- /dev/null +++ b/recipes/tinycbor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(tinycbor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tinycbor::tinycbor) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/tinycbor/all/test_package/conanfile.py b/recipes/tinycbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tinycbor/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/tinycbor/all/test_package/test_package.c b/recipes/tinycbor/all/test_package/test_package.c new file mode 100644 index 0000000000000..53ac33db7c729 --- /dev/null +++ b/recipes/tinycbor/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include +#include "cbor.h" + +int main(int argc, char *argv[]) +{ + CborParser parser; + CborValue it; + size_t length; + uint8_t *buf = (uint8_t*)malloc(sizeof(int[10])); + CborError err = cbor_parser_init(buf, length, 0, &parser, &it); + + printf("Tinycbor test_package ran successfully \n"); + return 0; +} diff --git a/recipes/tinycbor/all/test_v1_package/CMakeLists.txt b/recipes/tinycbor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tinycbor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tinycbor/all/test_v1_package/conanfile.py b/recipes/tinycbor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinycbor/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/tinycbor/config.yml b/recipes/tinycbor/config.yml new file mode 100644 index 0000000000000..f8f51d3b9bbcd --- /dev/null +++ b/recipes/tinycbor/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.0": + folder: all + "0.5.3": + folder: all diff --git a/recipes/tinycthread/all/conandata.yml b/recipes/tinycthread/all/conandata.yml new file mode 100644 index 0000000000000..b3bd655334cb9 --- /dev/null +++ b/recipes/tinycthread/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20161001": + url: "https://github.com/tinycthread/tinycthread/archive/6957fc8383d6c7db25b60b8c849b29caab1caaee.tar.gz" + sha256: "7068d21ddffaab68eea6d41a39ea8b6597984ef2436eee3d4bcf664ec67528f9" diff --git a/recipes/tinycthread/all/conanfile.py b/recipes/tinycthread/all/conanfile.py new file mode 100644 index 0000000000000..a3426b3f41922 --- /dev/null +++ b/recipes/tinycthread/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, load, save +from conan.tools.microsoft import msvc_runtime_flag, is_msvc +import os + +required_conan_version = ">=1.54.0" + +class TinycthreadConan(ConanFile): + name = "tinycthread" + description = "Small, portable implementation of the C11 threads API" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tinycthread/tinycthread" + topics = ("thread", "c11", "portable") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + + def configure(self): + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TINYCTHREAD_DISABLE_TESTS"] = True + tc.variables["TINYCTHREAD_INSTALL"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _extract_license(self): + file = os.path.join(self.source_folder, "source", "tinycthread.h") + file_content = load(self, file) + + license_start = file_content.find("Copyright") + license_end = file_content.find("*/") + license_contents = file_content[license_start:license_end] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + def package(self): + self._extract_license() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["tinycthread"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/tinycthread/all/test_package/CMakeLists.txt b/recipes/tinycthread/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..70582c5470eea --- /dev/null +++ b/recipes/tinycthread/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +find_package(tinycthread REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} tinycthread::tinycthread) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/tinycthread/all/test_package/conanfile.py b/recipes/tinycthread/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/tinycthread/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/tinycthread/all/test_package/test_package.c b/recipes/tinycthread/all/test_package/test_package.c new file mode 100644 index 0000000000000..973be2743fcbc --- /dev/null +++ b/recipes/tinycthread/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include +#include + +/* This is the child thread function */ +int HelloThread(void * aArg) +{ + (void)aArg; + + printf("Hello world!\n"); + return 0; +} + +/* This is the main program (i.e. the main thread) */ +int main() +{ + /* Start the child thread */ + thrd_t t; + if (thrd_create(&t, HelloThread, (void*)0) == thrd_success) + { + /* Wait for the thread to finish */ + thrd_join(t, NULL); + } + + return 0; +} diff --git a/recipes/tinycthread/all/test_v1_package/CMakeLists.txt b/recipes/tinycthread/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/tinycthread/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/tinycthread/all/test_v1_package/conanfile.py b/recipes/tinycthread/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/tinycthread/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinycthread/config.yml b/recipes/tinycthread/config.yml new file mode 100644 index 0000000000000..909f147a12331 --- /dev/null +++ b/recipes/tinycthread/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20161001": + folder: all diff --git a/recipes/tinycthreadpool/all/conandata.yml b/recipes/tinycthreadpool/all/conandata.yml new file mode 100644 index 0000000000000..a6b63fae3cefb --- /dev/null +++ b/recipes/tinycthreadpool/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/bennyhuo/tinycthreadpool/archive/refs/tags/v1.0.tar.gz" + sha256: "a3e9876d3e3008cffed96216d026504b57ab6be6ee3df62d5916fecd4106ede5" diff --git a/recipes/tinycthreadpool/all/conanfile.py b/recipes/tinycthreadpool/all/conanfile.py new file mode 100644 index 0000000000000..1cc771a3807a5 --- /dev/null +++ b/recipes/tinycthreadpool/all/conanfile.py @@ -0,0 +1,66 @@ +import os + +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +required_conan_version = ">=1.54.0" + + +class TinyCThreadPoolConan(ConanFile): + name = "tinycthreadpool" + description = "Portable C thread pool" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bennyhuo/tinycthreadpool" + topics = ("thread-pool", "threading", "pure-c") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + 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): + self.requires("tinycthread/cci.20161001", transitive_headers=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["tinycthreadpool"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/tinycthreadpool/all/test_package/CMakeLists.txt b/recipes/tinycthreadpool/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..873506d1a8b31 --- /dev/null +++ b/recipes/tinycthreadpool/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest C) + +find_package(tinycthreadpool REQUIRED CONFIG) + +add_executable(example example.c) +target_link_libraries(example tinycthreadpool::tinycthreadpool) +target_compile_features(example PRIVATE c_std_11) diff --git a/recipes/tinycthreadpool/all/test_package/conanfile.py b/recipes/tinycthreadpool/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5ebee977f3e4e --- /dev/null +++ b/recipes/tinycthreadpool/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class ThreadpoolTestConan(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): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/recipes/tinycthreadpool/all/test_package/example.c b/recipes/tinycthreadpool/all/test_package/example.c new file mode 100644 index 0000000000000..af998ecc461c4 --- /dev/null +++ b/recipes/tinycthreadpool/all/test_package/example.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int main(void) { + puts("Start Testing!"); + threadpool_t *threadpool = threadpool_create(3, 5, 0); + printf("Create thread pool: %#x.\n", threadpool); + if (threadpool){ + int result = threadpool_destroy(threadpool, 0); + printf("End Testing! result: %d\n", result); + } + return 0; +} diff --git a/recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt b/recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tinycthreadpool/all/test_v1_package/conanfile.py b/recipes/tinycthreadpool/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2a41ea908ed28 --- /dev/null +++ b/recipes/tinycthreadpool/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinycthreadpool/config.yml b/recipes/tinycthreadpool/config.yml new file mode 100644 index 0000000000000..739bad18cc6dc --- /dev/null +++ b/recipes/tinycthreadpool/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0": + folder: all diff --git a/recipes/tinydir/all/conandata.yml b/recipes/tinydir/all/conandata.yml new file mode 100644 index 0000000000000..16d1524b1696f --- /dev/null +++ b/recipes/tinydir/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.2.5": + url: "https://github.com/cxong/tinydir/archive/refs/tags/1.2.5.tar.gz" + sha256: "7ab150a16fa78ea76e9fd58ef88922c03eca2334c023b8d9bc94755fdde522c7" + "1.2.4": + url: "https://github.com/cxong/tinydir/archive/refs/tags/1.2.4.tar.gz" + sha256: "9c50eda69ba4854bb76ffa18961f49fd75f323b4cbebdf6b4b2d2db28f9f5ce2" diff --git a/recipes/tinydir/all/conanfile.py b/recipes/tinydir/all/conanfile.py new file mode 100644 index 0000000000000..02a2a8bc1ce2e --- /dev/null +++ b/recipes/tinydir/all/conanfile.py @@ -0,0 +1,28 @@ +import os +from conans import ConanFile, tools + +required_conan_version = ">=1.33.0" + +class TinydirConan(ConanFile): + name = "tinydir" + description = "Lightweight, portable and easy to integrate C directory and file reader" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cxong/tinydir" + topics = ("portable", "filesystem", "directory", "posix", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy("tinydir.h", dst="include", src=self._source_subfolder) + self.copy("COPYING", dst="licenses", src=self._source_subfolder) diff --git a/recipes/tinydir/all/test_package/CMakeLists.txt b/recipes/tinydir/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bd0eb537bad62 --- /dev/null +++ b/recipes/tinydir/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tinydir REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} tinydir::tinydir) diff --git a/recipes/tinydir/all/test_package/conanfile.py b/recipes/tinydir/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinydir/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinydir/all/test_package/test_package.c b/recipes/tinydir/all/test_package/test_package.c new file mode 100644 index 0000000000000..cc0003c9c9d0c --- /dev/null +++ b/recipes/tinydir/all/test_package/test_package.c @@ -0,0 +1,27 @@ +#include +#include + +#include "tinydir.h" + +int main() +{ + tinydir_dir dir; + tinydir_open(&dir, "."); + + while (dir.has_next) + { + tinydir_file file; + tinydir_readfile(&dir, &file); + + printf("%s", file.name); + if (file.is_dir) + { + printf("/"); + } + printf("\n"); + + tinydir_next(&dir); + } + + tinydir_close(&dir); +} diff --git a/recipes/tinydir/config.yml b/recipes/tinydir/config.yml new file mode 100644 index 0000000000000..712ebbf8b5754 --- /dev/null +++ b/recipes/tinydir/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.5": + folder: "all" + "1.2.4": + folder: "all" diff --git a/recipes/tinyexif/all/conandata.yml b/recipes/tinyexif/all/conandata.yml new file mode 100644 index 0000000000000..71979e9e91636 --- /dev/null +++ b/recipes/tinyexif/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210411": + url: "https://github.com/cdcseacave/TinyEXIF/archive/6e56015f56ee0f387f1b8c76e50eb35ac60372da.tar.gz" + sha256: "54031072382dbe9cc08ca18b40e39a6c2b248e83bd6263b29c70a4a8aa8affe7" + "1.0.2": + url: "https://github.com/cdcseacave/TinyEXIF/archive/refs/tags/1.0.2.tar.gz" + sha256: "427e02c38ee29d87bc82d08545d9f9a68c603af16e0b35f6807a4a8e63c14b86" diff --git a/recipes/tinyexif/all/conanfile.py b/recipes/tinyexif/all/conanfile.py new file mode 100644 index 0000000000000..08cc3c6b5f4f9 --- /dev/null +++ b/recipes/tinyexif/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.tools.files import get, rmdir, save, load +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + +class TinyEXIFConan(ConanFile): + name = "tinyexif" + description = "Tiny ISO-compliant C++ EXIF and XMP parsing library for JPEG" + license = "BSD 2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cdcseacave/TinyEXIF/" + topics = ("exif", "exif-metadata", "exif-ata-extraction", "exif-reader", "xmp", "xmp-parsing-library") + 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 requirements(self): + self.requires("tinyxml2/9.0.0") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["LINK_CRT_STATIC_LIBS"] = is_msvc_static_runtime(self) + tc.variables["BUILD_DEMO"] = False + 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): + filename = os.path.join(self.source_folder, self.source_folder, "TinyEXIF.h") + file_content = load(save, filename) + license_start = "/*" + license_end = "*/" + license_contents = file_content[file_content.find(license_start)+len(license_start):file_content.find(license_end)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + libpostfix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"TinyEXIF{libpostfix}"] + + self.cpp_info.set_property("cmake_file_name", "TinyEXIF") + self.cpp_info.set_property("cmake_target_name", "TinyEXIF::TinyEXIF") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "TinyEXIF" + self.cpp_info.filenames["cmake_find_package_multi"] = "TinyEXIF" + self.cpp_info.names["cmake_find_package"] = "TinyEXIF" + self.cpp_info.names["cmake_find_package_multi"] = "TinyEXIF" diff --git a/recipes/tinyexif/all/test_package/CMakeLists.txt b/recipes/tinyexif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..569754ada9dd8 --- /dev/null +++ b/recipes/tinyexif/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(TinyEXIF REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE TinyEXIF::TinyEXIF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tinyexif/all/test_package/conanfile.py b/recipes/tinyexif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/tinyexif/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinyexif/all/test_package/test_package.cpp b/recipes/tinyexif/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..30f098eca31a7 --- /dev/null +++ b/recipes/tinyexif/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include "TinyEXIF.h" + +int main() { + TinyEXIF::EXIFInfo exif; + + std::cout << exif.Fields << std::endl; + + return 0; +} diff --git a/recipes/tinyexif/all/test_v1_package/CMakeLists.txt b/recipes/tinyexif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/tinyexif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tinyexif/all/test_v1_package/conanfile.py b/recipes/tinyexif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/tinyexif/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinyexif/config.yml b/recipes/tinyexif/config.yml new file mode 100644 index 0000000000000..86908239eff55 --- /dev/null +++ b/recipes/tinyexif/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210411": + folder: all + "1.0.2": + folder: all diff --git a/recipes/tinyexr/all/conandata.yml b/recipes/tinyexr/all/conandata.yml new file mode 100644 index 0000000000000..6fdffb908d2c6 --- /dev/null +++ b/recipes/tinyexr/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "1.0.1": + url: "https://github.com/syoyo/tinyexr/archive/v1.0.1.tar.gz" + sha256: "4dbbd8c7d17597ad557518de5eb923bd02683d26d0de765f9224e8d57d121677" + "1.0.0": + url: "https://github.com/syoyo/tinyexr/archive/v1.0.0.tar.gz" + sha256: "d9d135a835916655057ad58fdabe17f4ae7047a0b15e20e891dab4e563275b68" +patches: + "1.0.1": + - patch_file: "patches/1.0.1-0001-fix-SaveEXRNPartImageToMemory.patch" + patch_description: "fix compilation error with use_zfp" + patch_type: "backport" + patch_source: "https://github.com/syoyo/tinyexr/issues/188" + "1.0.0": + - patch_file: "patches/1.0.0-0001-use-conan-deps.patch" + patch_description: "use conan recipes, fix namespace issue" + patch_type: "conan" diff --git a/recipes/tinyexr/all/conanfile.py b/recipes/tinyexr/all/conanfile.py new file mode 100644 index 0000000000000..889c4c311e95f --- /dev/null +++ b/recipes/tinyexr/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, save +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class TinyExrConan(ConanFile): + name = "tinyexr" + description = "Tiny OpenEXR image loader/saver library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/syoyo/tinyexr" + topics = ("exr", "header-only") + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_z": ["zlib", "miniz"], + "with_piz": [True, False], + "with_zfp": [True, False], + "with_thread": [True, False], + "with_openmp": [True, False], + } + default_options = { + "with_z": "miniz", + "with_piz": True, + "with_zfp": False, + "with_thread": False, + "with_openmp": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_z == "miniz": + self.requires("miniz/3.0.1") + else: + self.requires("zlib/1.2.13") + if self.options.with_zfp: + self.requires("zfp/1.0.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.options.with_thread and 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) + + @property + def _extracted_license(self): + content_lines = open(os.path.join(self.source_folder, "tinyexr.h")).readlines() + license_content = [] + for i in range(3, 27): + license_content.append(content_lines[i][:-1]) + return "\n".join(license_content) + + def build(self): + apply_conandata_patches(self) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extracted_license) + copy( + self, + pattern="tinyexr.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.defines.append("TINYEXR_USE_MINIZ={}".format("1" if self.options.with_z == "miniz" else "0")) + self.cpp_info.defines.append("TINYEXR_USE_PIZ={}".format("1" if self.options.with_piz else "0")) + self.cpp_info.defines.append("TINYEXR_USE_ZFP={}".format("1" if self.options.with_zfp else "0")) + self.cpp_info.defines.append("TINYEXR_USE_THREAD={}".format("1" if self.options.with_thread else "0")) + self.cpp_info.defines.append("TINYEXR_USE_OPENMP={}".format("1" if self.options.with_openmp else "0")) + + if self.settings.os in ["Linux", "FreeBSD"] and self.options.with_thread: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/tinyexr/all/patches/1.0.0-0001-use-conan-deps.patch b/recipes/tinyexr/all/patches/1.0.0-0001-use-conan-deps.patch new file mode 100644 index 0000000000000..2473af4eba73a --- /dev/null +++ b/recipes/tinyexr/all/patches/1.0.0-0001-use-conan-deps.patch @@ -0,0 +1,66 @@ +--- tinyexr.h ++++ tinyexr.h +@@ -547,10 +547,11 @@ + #endif + + #if TINYEXR_USE_MINIZ ++#include + #else + // Issue #46. Please include your own zlib-compatible API header before + // including `tinyexr.h` +-//#include "zlib.h" ++#include "zlib.h" + #endif + + #if TINYEXR_USE_ZFP +@@ -588,6 +589,7 @@ + #endif + #endif + ++#if 0 + #if TINYEXR_USE_MINIZ + + namespace miniz { +@@ -7048,6 +7050,7 @@ + #endif + + #endif // TINYEXR_USE_MINIZ ++#endif // 0 + + // static bool IsBigEndian(void) { + // union { +@@ -7650,11 +7653,11 @@ + // Compress the data using miniz + // + +- miniz::mz_ulong outSize = miniz::mz_compressBound(src_size); +- int ret = miniz::mz_compress( ++ mz_ulong outSize = mz_compressBound(src_size); ++ int ret = mz_compress( + dst, &outSize, static_cast(&tmpBuf.at(0)), + src_size); +- assert(ret == miniz::MZ_OK); ++ assert(ret == MZ_OK); + (void)ret; + + compressedSize = outSize; +@@ -7687,8 +7690,8 @@ + + #if TINYEXR_USE_MINIZ + int ret = +- miniz::mz_uncompress(&tmpBuf.at(0), uncompressed_size, src, src_size); +- if (miniz::MZ_OK != ret) { ++ mz_uncompress(&tmpBuf.at(0), uncompressed_size, src, src_size); ++ if (MZ_OK != ret) { + return false; + } + #else +@@ -12518,7 +12521,7 @@ + } else if ((exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) || + (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP)) { + #if TINYEXR_USE_MINIZ +- std::vector block(tinyexr::miniz::mz_compressBound( ++ std::vector block(mz_compressBound( + static_cast(buf.size()))); + #else + std::vector block( diff --git a/recipes/tinyexr/all/patches/1.0.1-0001-fix-SaveEXRNPartImageToMemory.patch b/recipes/tinyexr/all/patches/1.0.1-0001-fix-SaveEXRNPartImageToMemory.patch new file mode 100644 index 0000000000000..5794b5002ee2d --- /dev/null +++ b/recipes/tinyexr/all/patches/1.0.1-0001-fix-SaveEXRNPartImageToMemory.patch @@ -0,0 +1,13 @@ +diff --git a/tinyexr.h b/tinyexr.h +index 2580ae0..4b44d82 100644 +--- a/tinyexr.h ++++ b/tinyexr.h +@@ -6947,7 +6947,7 @@ static size_t SaveEXRNPartImageToMemory(const EXRImage* exr_images, + return 0; + } + #else +- for (int c = 0; c < exr_header->num_channels; ++c) { ++ for (int c = 0; c < exr_headers[i]->num_channels; ++c) { + if (exr_headers[i]->requested_pixel_types[c] != TINYEXR_PIXELTYPE_FLOAT) { + SetErrorMessage("Pixel type must be FLOAT for ZFP compression", + err); diff --git a/recipes/tinyexr/all/test_package/CMakeLists.txt b/recipes/tinyexr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..08dd3dd347374 --- /dev/null +++ b/recipes/tinyexr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tinyexr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinyexr::tinyexr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tinyexr/all/test_package/conanfile.py b/recipes/tinyexr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5a5dc0862d479 --- /dev/null +++ b/recipes/tinyexr/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 + + +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") + img_path = os.path.join(self.source_folder, "test.exr") + self.run(f"{bin_path} {img_path}", env="conanrun") diff --git a/recipes/tinyexr/all/test_package/test.exr b/recipes/tinyexr/all/test_package/test.exr new file mode 100644 index 0000000000000000000000000000000000000000..5cc69a90c12ceacb8a5a000c02654268117ba535 GIT binary patch literal 395 zcmah^JqyAx5WPwVNB@PRSOk}XR0nYqx^!@g&6OU+q$Hu%&7W?Pw)oM(3zv6!cX=;q zSLegs9hLrrOgFI)J6(qU3!&P+& z!NNNZF&c9+jbM+zbAlwEHAfBaD!4S%p~y^wrOlZo1(i_DLL7XaJ5y>z*~=eLS|`vZ q70kzXIQ$$bh}-%{0xrSG4G!q + +#if defined(_WIN32) +#ifndef NOMINMAX +#define NOMINMAX +#endif +#endif + +#define TINYEXR_IMPLEMENTATION +#include "tinyexr.h" + +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); + + if (ret == TINYEXR_SUCCESS) { + free(out); + } else { + if(err) { + std::cerr << err << std::endl; + } else { + std::cerr << "Unknown error." << std::endl; + } + } + + return 0; +} diff --git a/recipes/tinyexr/all/test_v1_package/CMakeLists.txt b/recipes/tinyexr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/tinyexr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tinyexr/all/test_v1_package/conanfile.py b/recipes/tinyexr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..bd607d6c6515a --- /dev/null +++ b/recipes/tinyexr/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.exr") + self.run(f"{bin_path} {img_path}", run_environment=True) diff --git a/recipes/tinyexr/config.yml b/recipes/tinyexr/config.yml new file mode 100644 index 0000000000000..af3bb0714e65c --- /dev/null +++ b/recipes/tinyexr/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.1": + folder: all + "1.0.0": + folder: all diff --git a/recipes/tinygltf/all/conandata.yml b/recipes/tinygltf/all/conandata.yml new file mode 100644 index 0000000000000..0e07d04c2de59 --- /dev/null +++ b/recipes/tinygltf/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.5.0": + url: "https://github.com/syoyo/tinygltf/archive/v2.5.0.tar.gz" + sha256: "5d85bd556b60b1b69527189293cfa4902957d67fabb8582b6532f23a5ef27ec1" + "2.4.0": + url: "https://github.com/syoyo/tinygltf/archive/v2.4.0.tar.gz" + sha256: "8c4d9efac544c5471d672dfd52842cb93df45b1a4c8f91e38487db4a0e500d70" + "2.2.0": + url: "https://github.com/syoyo/tinygltf/archive/v2.2.0.tar.gz" + sha256: "2d6950c76eba11214bf068b2a569d69c84ae35860a42fcde1aa1c8ad143f351d" diff --git a/recipes/tinygltf/all/conanfile.py b/recipes/tinygltf/all/conanfile.py new file mode 100644 index 0000000000000..1d6e2279c2680 --- /dev/null +++ b/recipes/tinygltf/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + + +class TinygltfConan(ConanFile): + name = "tinygltf" + description = "Header only C++11 tiny glTF 2.0 library." + license = "MIT" + topics = ("gltf") + homepage = "https://github.com/syoyo/tinygltf" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "draco": [True, False], + "stb_image": [True, False], + "stb_image_write": [True, False], + } + default_options = { + "draco": False, + "stb_image": True, + "stb_image_write": True, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def requirements(self): + self.requires("nlohmann_json/3.11.2") + if self.options.draco: + self.requires("draco/1.5.5") + if self.options.stb_image or self.options.stb_image_write: + self.requires("stb/cci.20210910") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + replace_in_file(self, os.path.join(self.source_folder, "tiny_gltf.h"), + "#include \"json.hpp\"", + "#include ") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "tiny_gltf.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "TinyGLTF") + self.cpp_info.set_property("cmake_target_name", "TinyGLTF::TinyGLTF") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.draco: + self.cpp_info.defines.append("TINYGLTF_ENABLE_DRACO") + if not self.options.stb_image: + self.cpp_info.defines.append("TINYGLTF_NO_STB_IMAGE") + if not self.options.stb_image_write: + self.cpp_info.defines.append("TINYGLTF_NO_STB_IMAGE_WRITE") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "TinyGLTF" + self.cpp_info.names["cmake_find_package_multi"] = "TinyGLTF" diff --git a/recipes/tinygltf/all/test_package/CMakeLists.txt b/recipes/tinygltf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..687cf3cb6de80 --- /dev/null +++ b/recipes/tinygltf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(TinyGLTF REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE TinyGLTF::TinyGLTF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tinygltf/all/test_package/box01.glb b/recipes/tinygltf/all/test_package/box01.glb new file mode 100644 index 0000000000000000000000000000000000000000..7477e897f06a5ae6d09311da18ca66a3f4bcead0 GIT binary patch literal 3816 zcmb_e>rxvx6jsvombU5rehH($HDv8Il(>_IV*`m(z}(6-!(>|7$jeUcUC*wJ!!VxV zN8c-boIXa+kyc)@m_Sn2BaXgv`_7S;m4e>x>P^Pjzjqk>`!-`wc3K-JTy#1zP2(ix zwfz&`9(KDj*$d@}*Sr#MA1m4Fc2lV|?8N;+9LY%S9uFk1&6g{FiFe{*gl2!C#QWko zX7S6C)NFW+gv8f^1%=`2b43M81>l2j~-H#c9(#)NH_6q7$W_1;RuKSzw2 zF756tan{JxY`6}uovp&hSgT0&DxdH`Mlum9PIwI$^jORWxNj@Z2XUf!i66-%4P#te zUYYZ-DQCyr9h~gmnv4Q<$ZJ2H?^lT=ppEsb_ZR$pU(SX4i`BE;Q7$*Q@+!gAd0f@2 zMpww$UD(AczLjUAaqY}ooAr;ctZlmN-N*Q065?_l2qkJ_FzAIHp>PH7#T_NpY^o9| z`aictDi^9H0H^~r0Roci&;WP>utnfkfZw1oLM1$fdH@>$9as)vlZ-1{umkmVSOwUF z`cqgPk<(xBD1bK9NAP$HB-9r%J;2cj|E%fxJ;Iv>tnJGMyMuFkBahd1gY*23UGq71 zC!gkj3BHUkk9YDre0hIGJLvlJdJQi6=eTGuVyEAi^poc+`WNdfVyE8XdKa;?zxn!^ zc-nLQG+!SFrazkrirC~g^-r9dIWGENhA+!kvsyW+%)@*{x%-{Z9L|i8n5kj9k1<>=Z6Wu z$*=8A&8PVTswd;$!Wv9Ge(11tsz=*(e)>9Q_38Jyp4n}GhF{mO`*ZA%s2*bn;?wcA zKmGl~{vErHckH@8vOjpBPtd+lG6_Y`oCC5SrfGO2S4BskrTgBThc^a2@W>dnlXa;? z508WGco-Z;cnRV)yqn-b(1?3+;>1mE8YO+R$-=Ay<>ZOYk!yY5qo?eb%f44BFV2tY znD5KiB`|ieXRfXqUVk4+Fig_6~cO-NN5(_9lCez0cml-v{h%c87h)K4KrUPuQpIGxj + +#include +#include +#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; + } + + return 0; +} diff --git a/recipes/tinygltf/all/test_v1_package/CMakeLists.txt b/recipes/tinygltf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tinygltf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tinygltf/all/test_v1_package/conanfile.py b/recipes/tinygltf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6d85d0b397c56 --- /dev/null +++ b/recipes/tinygltf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + glb_path = os.path.join(self.source_folder, os.pardir, "test_package", "box01.glb") + self.run(f"{bin_path} {glb_path}", run_environment=True) diff --git a/recipes/tinygltf/config.yml b/recipes/tinygltf/config.yml new file mode 100644 index 0000000000000..a23d2b23eb439 --- /dev/null +++ b/recipes/tinygltf/config.yml @@ -0,0 +1,7 @@ +versions: + "2.5.0": + folder: all + "2.4.0": + folder: all + "2.2.0": + folder: all diff --git a/recipes/tinymidi/all/CMakeLists.txt b/recipes/tinymidi/all/CMakeLists.txt new file mode 100644 index 0000000000000..094fa86cdf303 --- /dev/null +++ b/recipes/tinymidi/all/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) +project(tinymidi LANGUAGES C) + +add_library(tinymidi ${TINYMIDI_SRC_DIR}/rawmidi.c) + +include(GNUInstallDirs) +install(FILES ${TINYMIDI_SRC_DIR}/include/rawmidi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install( + TARGETS tinymidi + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/recipes/tinymidi/all/conandata.yml b/recipes/tinymidi/all/conandata.yml new file mode 100644 index 0000000000000..e4d4413fecbf1 --- /dev/null +++ b/recipes/tinymidi/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20130325": + url: "https://github.com/krgn/tinymidi/archive/3162cf8faff04e26a8daa846618b90326f71b9d5.zip" + sha256: "a3ffcbc463559c6db3cfe40510a9859502d51f4cf8033966073a1a58224d3476" diff --git a/recipes/tinymidi/all/conanfile.py b/recipes/tinymidi/all/conanfile.py new file mode 100644 index 0000000000000..02f50473bbbf6 --- /dev/null +++ b/recipes/tinymidi/all/conanfile.py @@ -0,0 +1,62 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class TinyMidiConan(ConanFile): + name = "tinymidi" + description = "A small C library for doing MIDI on GNU/Linux" + topics = ("audio", "MIDI") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/krgn/tinymidi" + license = "LGPL-3.0-only" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + 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 self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("Only Linux and FreeBSD are supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TINYMIDI_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, "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 = ["tinymidi"] diff --git a/recipes/tinymidi/all/test_package/CMakeLists.txt b/recipes/tinymidi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e64d0510b8470 --- /dev/null +++ b/recipes/tinymidi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tinymidi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tinymidi::tinymidi) diff --git a/recipes/tinymidi/all/test_package/conanfile.py b/recipes/tinymidi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/tinymidi/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinymidi/all/test_package/test_package.c b/recipes/tinymidi/all/test_package/test_package.c new file mode 100644 index 0000000000000..71059877ac724 --- /dev/null +++ b/recipes/tinymidi/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + rawmidi_hw_print_info("/dev/midi"); + return 0; +} diff --git a/recipes/tinymidi/all/test_v1_package/CMakeLists.txt b/recipes/tinymidi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tinymidi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tinymidi/all/test_v1_package/conanfile.py b/recipes/tinymidi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinymidi/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/tinymidi/config.yml b/recipes/tinymidi/config.yml new file mode 100644 index 0000000000000..54b84ffaed7fe --- /dev/null +++ b/recipes/tinymidi/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20130325": + folder: all diff --git a/recipes/tinyobjloader/all/conandata.yml b/recipes/tinyobjloader/all/conandata.yml new file mode 100644 index 0000000000000..a7c8b081490fb --- /dev/null +++ b/recipes/tinyobjloader/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "2.0.0-rc10": + url: "https://github.com/tinyobjloader/tinyobjloader/archive/refs/tags/v2.0.0rc10.tar.gz" + sha256: "e1bc2e5547b562d33ca4a90b581717984a70d58113d83208dbc97c82e137b9fe" + "1.0.7": + url: "https://github.com/tinyobjloader/tinyobjloader/archive/refs/tags/v1.0.7.tar.gz" + sha256: "b9d08b675ba54b9cb00ffc99eaba7616d0f7e6f6b8947a7e118474e97d942129" + "1.0.6": + url: "https://github.com/tinyobjloader/tinyobjloader/archive/refs/tags/v1.0.6.tar.gz" + sha256: "19ee82cd201761954dd833de551edb570e33b320d6027e0d91455faf7cd4c341" +patches: + "2.0.0-rc10": + - patch_file: "patches/2.0.0-rc10-0001-cmake-minimum-required.patch" + patch_description: "CMake: move cmake_minimum_required() before project()" + patch_type: "backport" + patch_source: "https://github.com/tinyobjloader/tinyobjloader/pull/347" + "1.0.7": + - patch_file: "patches/1.0.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: move cmake_minimum_required() before project()" + patch_type: "backport" + patch_source: "https://github.com/tinyobjloader/tinyobjloader/pull/347" + "1.0.6": + - patch_file: "patches/1.0.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: move cmake_minimum_required() before project()" + patch_type: "backport" + patch_source: "https://github.com/tinyobjloader/tinyobjloader/pull/347" diff --git a/recipes/tinyobjloader/all/conanfile.py b/recipes/tinyobjloader/all/conanfile.py new file mode 100644 index 0000000000000..3370350884707 --- /dev/null +++ b/recipes/tinyobjloader/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, get, export_conandata_patches, load, replace_in_file, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class TinyObjLoaderConan(ConanFile): + name = "tinyobjloader" + description = "Tiny but powerful single file wavefront obj loader" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/syoyo/tinyobjloader" + topics = ("loader", "obj", "3d", "wavefront", "geometry") + + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + "double": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "double": 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 + + 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["TINYOBJLOADER_USE_DOUBLE"] = self.options.double + tc.variables["TINYOBJLOADER_BUILD_TEST_LOADER"] = False + if Version(self.version) < "1.0.7": + tc.variables["TINYOBJLOADER_COMPILATION_SHARED"] = self.options.shared + tc.variables["TINYOBJLOADER_BUILD_OBJ_STICHER"] = False + tc.variables["CMAKE_INSTALL_DOCDIR"] = "licenses" + if Version(self.version).major < 2: + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + 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", "tinyobjloader")) + self._remove_implementation(os.path.join(self.package_folder, "include", "tiny_obj_loader.h")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + cmake_target = "tinyobjloader_double" if self.options.double else "tinyobjloader" + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {cmake_target: "tinyobjloader::tinyobjloader"} + ) + + def _remove_implementation(self, header_fullpath): + header_content = load(self, header_fullpath) + begin = header_content.find("#ifdef TINYOBJLOADER_IMPLEMENTATION") + implementation = header_content[begin:-1] + replace_in_file(self, header_fullpath, implementation, "") + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + suffix = "_double" if self.options.double else "" + self.cpp_info.set_property("cmake_file_name", "tinyobjloader") + self.cpp_info.set_property("cmake_target_name", f"tinyobjloader::tinyobjloader{suffix}") + self.cpp_info.set_property("cmake_target_aliases", [f"tinyobjloader{suffix}"]) # old target (before 1.0.7) + self.cpp_info.set_property("pkg_config_name", f"tinyobjloader{suffix}") + self.cpp_info.libs = [f"tinyobjloader{suffix}"] + if self.options.double: + self.cpp_info.defines.append("TINYOBJLOADER_USE_DOUBLE") + + # 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/tinyobjloader/all/patches/1.0.x-0001-cmake-minimum-required.patch b/recipes/tinyobjloader/all/patches/1.0.x-0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..aafa055df46bb --- /dev/null +++ b/recipes/tinyobjloader/all/patches/1.0.x-0001-cmake-minimum-required.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,8 +1,8 @@ + #Tiny Object Loader Cmake configuration file. + #This configures the Cmake system with multiple properties, depending + #on the platform and configuration it is set to build in. ++cmake_minimum_required(VERSION 3.1) + project(tinyobjloader) +-cmake_minimum_required(VERSION 2.8.11) + set(TINYOBJLOADER_SOVERSION 1) + set(TINYOBJLOADER_VERSION 1.0.4) + diff --git a/recipes/tinyobjloader/all/patches/2.0.0-rc10-0001-cmake-minimum-required.patch b/recipes/tinyobjloader/all/patches/2.0.0-rc10-0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..a2d751763b940 --- /dev/null +++ b/recipes/tinyobjloader/all/patches/2.0.0-rc10-0001-cmake-minimum-required.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,8 +1,8 @@ + #Tiny Object Loader Cmake configuration file. + #This configures the Cmake system with multiple properties, depending + #on the platform and configuration it is set to build in. +-project(tinyobjloader) + cmake_minimum_required(VERSION 3.2) ++project(tinyobjloader) + set(TINYOBJLOADER_SOVERSION 2) + set(TINYOBJLOADER_VERSION 2.0.0-rc.10) + diff --git a/recipes/tinyobjloader/all/test_package/CMakeLists.txt b/recipes/tinyobjloader/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..05eed698062d7 --- /dev/null +++ b/recipes/tinyobjloader/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.7) +project(test_package LANGUAGES CXX) + +find_package(tinyobjloader REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET tinyobjloader::tinyobjloader_double) + target_link_libraries(${PROJECT_NAME} PRIVATE tinyobjloader::tinyobjloader_double) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE tinyobjloader::tinyobjloader) +endif() +if(tinyobjloader_VERSION VERSION_GREATER_EQUAL "1.0.7") + target_compile_definitions(${PROJECT_NAME} PRIVATE TINYOBJLOADER_GE_1_0_7) +endif() +if(tinyobjloader_VERSION VERSION_GREATER_EQUAL "2") + target_compile_definitions(${PROJECT_NAME} PRIVATE TINYOBJLOADER_GE_2) +endif() diff --git a/recipes/tinyobjloader/all/test_package/conanfile.py b/recipes/tinyobjloader/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ba7f5d3e170c1 --- /dev/null +++ b/recipes/tinyobjloader/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + obj_path = os.path.join(self.source_folder, "cube.obj") + mtl_dir = os.path.join(self.source_folder, "") + self.run(f"{bin_path} {obj_path} {mtl_dir}", env="conanrun") diff --git a/recipes/tinyobjloader/all/test_package/cube.mtl b/recipes/tinyobjloader/all/test_package/cube.mtl new file mode 100644 index 0000000000000..d3a1c7a6e74af --- /dev/null +++ b/recipes/tinyobjloader/all/test_package/cube.mtl @@ -0,0 +1,24 @@ +newmtl white +Ka 0 0 0 +Kd 1 1 1 +Ks 0 0 0 + +newmtl red +Ka 0 0 0 +Kd 1 0 0 +Ks 0 0 0 + +newmtl green +Ka 0 0 0 +Kd 0 1 0 +Ks 0 0 0 + +newmtl blue +Ka 0 0 0 +Kd 0 0 1 +Ks 0 0 0 + +newmtl light +Ka 20 20 20 +Kd 1 1 1 +Ks 0 0 0 diff --git a/recipes/tinyobjloader/all/test_package/cube.obj b/recipes/tinyobjloader/all/test_package/cube.obj new file mode 100644 index 0000000000000..f12451f06b3ce --- /dev/null +++ b/recipes/tinyobjloader/all/test_package/cube.obj @@ -0,0 +1,32 @@ +mtllib cube.mtl + +v 0.000000 2.000000 2.000000 +v 0.000000 0.000000 2.000000 +v 2.000000 0.000000 2.000000 +v 2.000000 2.000000 2.000000 +v 0.000000 2.000000 0.000000 +v 0.000000 0.000000 0.000000 +v 2.000000 0.000000 0.000000 +v 2.000000 2.000000 0.000000 +# 8 vertices + +g front cube +usemtl white +f 1 2 3 4 +# two white spaces between 'back' and 'cube' +g back cube +# expects white material +f 8 7 6 5 +g right cube +usemtl red +f 4 3 7 8 +g top cube +usemtl white +f 5 1 4 8 +g left cube +usemtl green +f 5 6 2 1 +g bottom cube +usemtl white +f 2 6 7 3 +# 6 elements diff --git a/recipes/tinyobjloader/all/test_package/test_package.cpp b/recipes/tinyobjloader/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..886f96cfb3429 --- /dev/null +++ b/recipes/tinyobjloader/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +#include + +#include +#include +#include + +int main(int argc, char **argv) +{ + if (argc < 3) { + std::cerr << "Need at least two arguments" << std::endl; + return 1; + } + +#ifdef TINYOBJLOADER_GE_2 + tinyobj::ObjReaderConfig config; + config.mtl_search_path = argv[2]; + + tinyobj::ObjReader reader; + reader.ParseFromFile(argv[1], config); +#else + tinyobj::attrib_t attrib; + std::vector shapes; + std::vector materials; +#ifdef TINYOBJLOADER_GE_1_0_7 + std::string warn; +#endif + std::string err; + bool ret = tinyobj::LoadObj( + &attrib, &shapes, &materials, +#ifdef TINYOBJLOADER_GE_1_0_7 + &warn, +#endif + &err, argv[1], argv[2]); + +#ifdef TINYOBJLOADER_GE_1_0_7 + if (!warn.empty()) { + std::cout << "WARN: " << warn << std::endl; + } +#endif + + if (!err.empty()) { + std::cerr << "ERR: " << err << std::endl; + } + + if (!ret) { + std::cerr << "Failed to load/parse .obj" << std::endl; + return 1; + } +#endif + + return 0; +} diff --git a/recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt b/recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tinyobjloader/all/test_v1_package/conanfile.py b/recipes/tinyobjloader/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..159afa2f8c340 --- /dev/null +++ b/recipes/tinyobjloader/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + res_dir = os.path.join(self.source_folder, os.pardir, "test_package") + obj_path = os.path.join(res_dir, "cube.obj") + mtl_dir = os.path.join(res_dir, "") + self.run(f"{bin_path} {obj_path} {mtl_dir}", run_environment=True) diff --git a/recipes/tinyobjloader/config.yml b/recipes/tinyobjloader/config.yml new file mode 100644 index 0000000000000..a6a9ff8a03a2a --- /dev/null +++ b/recipes/tinyobjloader/config.yml @@ -0,0 +1,7 @@ +versions: + "2.0.0-rc10": + folder: all + "1.0.7": + folder: all + "1.0.6": + folder: all diff --git a/recipes/tinyply/all/conandata.yml b/recipes/tinyply/all/conandata.yml new file mode 100644 index 0000000000000..15f3dca4257f5 --- /dev/null +++ b/recipes/tinyply/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.3.4": + url: "https://github.com/ddiakopoulos/tinyply/archive/2.3.4.tar.gz" + sha256: "1bb1462727a363f7b77a10e51cd023095db7b281d2f201167620a83e495513c6" + "2.3.2": + url: "https://github.com/ddiakopoulos/tinyply/archive/2.3.2.tar.gz" + sha256: "4da8744a9cf6810c6cfe015106cb87352e8bb7c125162170eb4e30fa51e8894e" diff --git a/recipes/tinyply/all/conanfile.py b/recipes/tinyply/all/conanfile.py new file mode 100644 index 0000000000000..cd8d6bcce424f --- /dev/null +++ b/recipes/tinyply/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, get, load, rmdir, save +import os + +required_conan_version = ">=1.53.0" + + +class TinyplyConan(ConanFile): + name = "tinyply" + description = "C++11 ply 3d mesh format importer & exporter." + license = ["Unlicense", "BSD-2-Clause"] + topics = ("tinyply", "ply", "geometry", "mesh", "file-format") + homepage = "https://github.com/ddiakopoulos/tinyply" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + 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["SHARED_LIB"] = self.options.shared + tc.variables["BUILD_TESTS"] = False + # Relocatable shared lib on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + 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 _extract_license(self): + readme = load(self, os.path.join(self.source_folder, "readme.md")) + begin = readme.find("## License") + return readme[begin:] + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tinyply") + self.cpp_info.set_property("cmake_target_name", "tinyply::tinyply") + self.cpp_info.set_property("pkg_config_name", "tinyply") + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/tinyply/all/test_package/CMakeLists.txt b/recipes/tinyply/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3ef9fec340b4 --- /dev/null +++ b/recipes/tinyply/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tinyply REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinyply::tinyply) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tinyply/all/test_package/conanfile.py b/recipes/tinyply/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tinyply/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/tinyply/all/test_package/test_package.cpp b/recipes/tinyply/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..61527e08c6226 --- /dev/null +++ b/recipes/tinyply/all/test_package/test_package.cpp @@ -0,0 +1,91 @@ +#include + +#include +#include + +struct float2 { float x, y; }; +struct float3 { float x, y, z; }; +struct uint3 { uint32_t x, y, z; }; +struct uint4 { uint32_t x, y, z, w; }; + +struct geometry { + std::vector vertices; + std::vector normals; + std::vector texcoords; + std::vector triangles; +}; + +geometry make_cube_geometry() { + geometry cube; + + const struct CubeVertex { float3 position, normal; float2 texCoord; } verts[] = { + { { -1, -1, -1 },{ -1, 0, 0 },{ 0, 0 } }, { { -1, -1, +1 },{ -1, 0, 0 },{ 1, 0 } }, + { { -1, +1, +1 },{ -1, 0, 0 },{ 1, 1 } }, { { -1, +1, -1 },{ -1, 0, 0 },{ 0, 1 } }, + { { +1, -1, +1 },{ +1, 0, 0 },{ 0, 0 } }, { { +1, -1, -1 },{ +1, 0, 0 },{ 1, 0 } }, + { { +1, +1, -1 },{ +1, 0, 0 },{ 1, 1 } }, { { +1, +1, +1 },{ +1, 0, 0 },{ 0, 1 } }, + { { -1, -1, -1 },{ 0, -1, 0 },{ 0, 0 } }, { { +1, -1, -1 },{ 0, -1, 0 },{ 1, 0 } }, + { { +1, -1, +1 },{ 0, -1, 0 },{ 1, 1 } }, { { -1, -1, +1 },{ 0, -1, 0 },{ 0, 1 } }, + { { +1, +1, -1 },{ 0, +1, 0 },{ 0, 0 } }, { { -1, +1, -1 },{ 0, +1, 0 },{ 1, 0 } }, + { { -1, +1, +1 },{ 0, +1, 0 },{ 1, 1 } }, { { +1, +1, +1 },{ 0, +1, 0 },{ 0, 1 } }, + { { -1, -1, -1 },{ 0, 0, -1 },{ 0, 0 } }, { { -1, +1, -1 },{ 0, 0, -1 },{ 1, 0 } }, + { { +1, +1, -1 },{ 0, 0, -1 },{ 1, 1 } }, { { +1, -1, -1 },{ 0, 0, -1 },{ 0, 1 } }, + { { -1, +1, +1 },{ 0, 0, +1 },{ 0, 0 } }, { { -1, -1, +1 },{ 0, 0, +1 },{ 1, 0 } }, + { { +1, -1, +1 },{ 0, 0, +1 },{ 1, 1 } }, { { +1, +1, +1 },{ 0, 0, +1 },{ 0, 1 } } + }; + + std::vector quads = { + { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, + { 12, 13, 14, 15 }, { 16, 17, 18, 19 }, { 20, 21, 22, 23 } + }; + + for (auto & q : quads) { + cube.triangles.push_back({ q.x,q.y,q.z }); + cube.triangles.push_back({ q.x,q.z,q.w }); + } + + for (int i = 0; i < 24; ++i) { + cube.vertices.push_back(verts[i].position); + cube.normals.push_back(verts[i].normal); + cube.texcoords.push_back(verts[i].texCoord); + } + + return cube; +} + +int main() { + geometry cube = make_cube_geometry(); + + tinyply::PlyFile cube_file; + + cube_file.add_properties_to_element( + "vertex", { "x", "y", "z" }, + tinyply::Type::FLOAT32, cube.vertices.size(), + reinterpret_cast(cube.vertices.data()), + tinyply::Type::INVALID, 0 + ); + + cube_file.add_properties_to_element( + "vertex", { "nx", "ny", "nz" }, + tinyply::Type::FLOAT32, cube.normals.size(), + reinterpret_cast(cube.normals.data()), + tinyply::Type::INVALID, 0 + ); + + cube_file.add_properties_to_element( + "vertex", { "u", "v" }, + tinyply::Type::FLOAT32, cube.texcoords.size() , + reinterpret_cast(cube.texcoords.data()), + tinyply::Type::INVALID, 0 + ); + + cube_file.add_properties_to_element( + "face", { "vertex_indices" }, + tinyply::Type::UINT32, cube.triangles.size(), + reinterpret_cast(cube.triangles.data()), + tinyply::Type::UINT8, 3 + ); + + cube_file.get_comments().push_back("generated by tinyply"); + + return 0; +} diff --git a/recipes/tinyply/all/test_v1_package/CMakeLists.txt b/recipes/tinyply/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tinyply/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tinyply/all/test_v1_package/conanfile.py b/recipes/tinyply/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinyply/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/tinyply/config.yml b/recipes/tinyply/config.yml new file mode 100644 index 0000000000000..d7f66fca815a8 --- /dev/null +++ b/recipes/tinyply/config.yml @@ -0,0 +1,5 @@ +versions: + "2.3.4": + folder: all + "2.3.2": + folder: all diff --git a/recipes/tinyspline/all/conandata.yml b/recipes/tinyspline/all/conandata.yml new file mode 100644 index 0000000000000..0c5a0ad66351c --- /dev/null +++ b/recipes/tinyspline/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "0.6.0": + url: "https://github.com/msteinbeck/tinyspline/archive/refs/tags/v0.6.0.tar.gz" + sha256: "3ea31b610dd279266f26fd7ad5b5fca7a20c0bbe05c7c32430ed6aa54d57097a" + "0.5.0": + url: "https://github.com/msteinbeck/tinyspline/archive/v0.5.0.tar.gz" + sha256: "cf7a6de40a5456b6791bc043d978b134c54e0404129a05846b803ccd45db366b" + "0.4.0": + url: "https://github.com/msteinbeck/tinyspline/archive/refs/tags/v0.4.0.tar.gz" + sha256: "819db7f8b09c68b701b54232f08d35210599353703934c61e03555c3c059a0db" + "0.3.0": + url: "https://github.com/msteinbeck/tinyspline/archive/v0.3.0.tar.gz" + sha256: "3e89ec449799b00c66a5f3d26b9960d74a1e238132093424ba35c793a3bd3cd7" + "0.2.0": + url: "https://github.com/msteinbeck/tinyspline/archive/0.2.0.tar.gz" + sha256: "7e0776abfc2ab7e485ec5cdac0ad37774aa9362f81303ceb5584e983582a38d2" +patches: + "0.3.0": + - patch_file: "patches/0.3.0-0001-fix-cmake.patch" + "0.2.0": + - patch_file: "patches/0.2.0-0001-fix-cmake.patch" diff --git a/recipes/tinyspline/all/conanfile.py b/recipes/tinyspline/all/conanfile.py new file mode 100644 index 0000000000000..2800204293c83 --- /dev/null +++ b/recipes/tinyspline/all/conanfile.py @@ -0,0 +1,170 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + +class TinysplineConan(ConanFile): + name = "tinyspline" + description = "Library for interpolating, transforming, and querying " \ + "arbitrary NURBS, B-Splines, and Bezier curves." + license = "MIT" + topics = ("tinyspline ", "nurbs", "b-splines", "bezier") + homepage = "https://github.com/msteinbeck/tinyspline" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cxx": [True, False], + "floating_point_precision": ["double", "single"], + } + default_options = { + "shared": False, + "fPIC": True, + "cxx": True, + "floating_point_precision": "double", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.cxx: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def validate(self): + if Version(self.version) >= "0.4.0" and self.options.cxx: + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + 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["TINYSPLINE_BUILD_DOCS"] = False + tc.variables["TINYSPLINE_BUILD_EXAMPLES"] = False + tc.variables["TINYSPLINE_BUILD_TESTS"] = False + tc.variables["TINYSPLINE_FLOAT_PRECISION"] = self.options.floating_point_precision == "single" + tc.variables["TINYSPLINE_INSTALL_BINARY_DIR"] = "bin" + tc.variables["TINYSPLINE_INSTALL_LIBRARY_DIR"] = "lib" + if Version(self.version) < "0.3.0": + tc.variables["TINYSPLINE_DISABLE_CXX"] = not self.options.cxx + tc.variables["TINYSPLINE_DISABLE_CSHARP"] = True + tc.variables["TINYSPLINE_DISABLE_D"] = True + tc.variables["TINYSPLINE_DISABLE_GOLANG"] = True + tc.variables["TINYSPLINE_DISABLE_JAVA"] = True + tc.variables["TINYSPLINE_DISABLE_LUA"] = True + tc.variables["TINYSPLINE_DISABLE_OCTAVE"] = True + tc.variables["TINYSPLINE_DISABLE_PHP"] = True + tc.variables["TINYSPLINE_DISABLE_PYTHON"] = True + tc.variables["TINYSPLINE_DISABLE_R"] = True + tc.variables["TINYSPLINE_DISABLE_RUBY"] = True + else: + tc.variables["TINYSPLINE_WARNINGS_AS_ERRORS"] = False + tc.variables["TINYSPLINE_ENABLE_CXX"] = self.options.cxx + tc.variables["TINYSPLINE_ENABLE_CSHARP"] = False + tc.variables["TINYSPLINE_ENABLE_DLANG"] = False + tc.variables["TINYSPLINE_ENABLE_GO"] = False + tc.variables["TINYSPLINE_ENABLE_JAVA"] = False + tc.variables["TINYSPLINE_ENABLE_LUA"] = False + tc.variables["TINYSPLINE_ENABLE_OCTAVE"] = False + tc.variables["TINYSPLINE_ENABLE_PHP"] = False + tc.variables["TINYSPLINE_ENABLE_PYTHON"] = False + tc.variables["TINYSPLINE_ENABLE_R"] = False + tc.variables["TINYSPLINE_ENABLE_RUBY"] = False + tc.variables["TINYSPLINE_ENABLE_ALL_INTERFACES"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + if self.options.cxx: + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"tinysplinecxx::tinysplinecxx": "tinyspline::libtinysplinecxx"} + ) + + 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_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + if Version(self.version) < "0.3.0": + lib_prefix = "lib" if is_msvc(self) and not self.options.shared else "" + lib_suffix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" + cpp_prefix = "cpp" + else: + lib_prefix = "" + lib_suffix = "" + cpp_prefix = "cxx" + + self.cpp_info.set_property("cmake_file_name", "tinyspline") + + self.cpp_info.components["libtinyspline"].set_property("cmake_target_name", "tinyspline::tinyspline") + self.cpp_info.components["libtinyspline"].set_property("pkg_config_name", "tinyspline") + self.cpp_info.components["libtinyspline"].libs = ["{}tinyspline{}".format(lib_prefix, lib_suffix)] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libtinyspline"].system_libs = ["m"] + if Version(self.version) >= "0.3.0" and self.options.shared and self.settings.os == "Windows": + self.cpp_info.components["libtinyspline"].defines.append("TINYSPLINE_SHARED") + + if self.options.cxx: + # FIXME: should live in tinysplinecxx-config.cmake (see https://github.com/conan-io/conan/issues/9000) + self.cpp_info.components["libtinysplinecxx"].set_property("cmake_target_name", "tinysplinecxx::tinysplinecxx") + self.cpp_info.components["libtinysplinecxx"].set_property("pkg_config_name", "tinysplinecxx") + self.cpp_info.components["libtinysplinecxx"].libs = ["{}tinyspline{}{}".format(lib_prefix, cpp_prefix, lib_suffix)] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libtinysplinecxx"].system_libs = ["m"] + if Version(self.version) >= "0.3.0" and self.options.shared and self.settings.os == "Windows": + self.cpp_info.components["libtinysplinecxx"].defines.append("TINYSPLINE_SHARED") + + # Workaround to always provide a global target or pkg-config file with all components + self.cpp_info.set_property("cmake_target_name", "tinyspline-do-not-use") + self.cpp_info.set_property("pkg_config_name", "tinyspline-do-not-use") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libtinyspline"].names["cmake_find_package"] = "tinyspline" + if self.options.cxx: + self.cpp_info.components["libtinysplinecxx"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libtinysplinecxx"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/tinyspline/all/patches/0.2.0-0001-fix-cmake.patch b/recipes/tinyspline/all/patches/0.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..3ae371fc55003 --- /dev/null +++ b/recipes/tinyspline/all/patches/0.2.0-0001-fix-cmake.patch @@ -0,0 +1,134 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,10 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + add_subdirectory(src) + add_definitions("${TINYSPLINE_DEFINITIONS}") + +-add_subdirectory(examples) +-add_subdirectory(test) +-add_subdirectory(docs) +-add_subdirectory(tools) ++if(TINYSPLINE_BUILD_EXAMPLES) ++ add_subdirectory(examples) ++endif() ++if(TINYSPLINE_BUILD_TESTS) ++ enable_testing() ++ add_subdirectory(test) ++endif() ++if(TINYSPLINE_BUILD_DOCS) ++ add_subdirectory(docs) ++endif() +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -324,14 +324,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set(TINYSPLINE_LIBRARIES "${TINYSPLINE_LIBRARIES} -lm") + + # TINYSPLINE_LIBRARY_C_FLAGS +- set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Werror") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wall") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wextra") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wfloat-equal") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -pedantic") + + # TINYSPLINE_LIBRARY_CXX_FLAGS +- set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Werror") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wall") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wextra") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wfloat-equal") +@@ -358,14 +356,12 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(TINYSPLINE_LIBRARIES "${TINYSPLINE_LIBRARIES} -lm") + + # TINYSPLINE_LIBRARY_C_FLAGS +- set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Werror") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wall") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wextra") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wfloat-equal") + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -pedantic") + + # TINYSPLINE_LIBRARY_CXX_FLAGS +- set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Werror") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wall") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wextra") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wfloat-equal") +@@ -386,11 +382,9 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + + # TINYSPLINE_LIBRARY_C_FLAGS + set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} /Wall") +- set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} /WX") + + # TINYSPLINE_LIBRARY_CXX_FLAGS + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /Wall") +- set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /WX") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /wd4514") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /wd4710") + set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /wd4350") +@@ -467,8 +461,11 @@ list(APPEND TINYSPLINE_CXX_SOURCE_FILES + set(TINYSPLINE_CXX_SOURCE_FILES ${TINYSPLINE_CXX_SOURCE_FILES} PARENT_SCOPE) + + # C library +-if(TARGET_SUPPORTS_SHARED_LIBS) ++if(BUILD_SHARED_LIBS) + add_library(tinyspline_shared SHARED ${TINYSPLINE_C_SOURCE_FILES}) ++ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") ++ target_link_libraries(tinyspline_shared PRIVATE m) ++ endif() + set_target_properties(tinyspline_shared PROPERTIES + OUTPUT_NAME "tinyspline" + DEBUG_POSTFIX "${TINYSPLINE_DEBUG_POSTFIX}" +@@ -479,7 +476,7 @@ if(TARGET_SUPPORTS_SHARED_LIBS) + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +-endif() ++else() + add_library(tinyspline_static STATIC ${TINYSPLINE_C_SOURCE_FILES}) + set_target_properties(tinyspline_static PROPERTIES + OUTPUT_NAME "tinyspline" +@@ -491,16 +488,17 @@ install(TARGETS tinyspline_static + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +-install(FILES tinyspline.h +- DESTINATION include +-) + target_include_directories(tinyspline_static + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + ) ++endif() ++install(FILES tinyspline.h ++ DESTINATION include ++) + + # C++ library + if(NOT TINYSPLINE_DISABLE_CXX AND TINYSPLINE_CXX_AVAILABLE) +- if(TARGET_SUPPORTS_SHARED_LIBS) ++ if(BUILD_SHARED_LIBS) + add_library(tinysplinecpp_shared SHARED ${TINYSPLINE_CXX_SOURCE_FILES}) + set_target_properties(tinysplinecpp_shared PROPERTIES + OUTPUT_NAME "tinysplinecpp" +@@ -512,7 +510,7 @@ if(NOT TINYSPLINE_DISABLE_CXX AND TINYSPLINE_CXX_AVAILABLE) + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +- endif() ++ else() + add_library(tinysplinecpp_static STATIC ${TINYSPLINE_CXX_SOURCE_FILES}) + set_target_properties(tinysplinecpp_static PROPERTIES + OUTPUT_NAME "tinysplinecpp" +@@ -524,12 +522,13 @@ if(NOT TINYSPLINE_DISABLE_CXX AND TINYSPLINE_CXX_AVAILABLE) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +- install(FILES tinysplinecpp.h +- DESTINATION include +- ) + target_include_directories(tinysplinecpp_static + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + ) ++ endif() ++ install(FILES tinysplinecpp.h ++ DESTINATION include ++ ) + endif() + + diff --git a/recipes/tinyspline/all/patches/0.3.0-0001-fix-cmake.patch b/recipes/tinyspline/all/patches/0.3.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..d57b5a72476fe --- /dev/null +++ b/recipes/tinyspline/all/patches/0.3.0-0001-fix-cmake.patch @@ -0,0 +1,121 @@ +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -120,7 +120,7 @@ + # TINYSPLINE_DLANG_INTERMEDIATE_FILE + # Full path of D intermediate file. + ############################################################################### +-set(TINYSPLINE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "") ++set(TINYSPLINE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib CACHE INTERNAL "") + + # Generic no-config case (e.g. MinGW) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_BACKUP ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +@@ -857,7 +857,7 @@ + "-l${TINYSPLINE_PKGCONFIG_C_LINK_LIBRARIES}") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkg/tinyspline.pc.in" + "${TINYSPLINE_C_LIBRARY_OUTPUT_NAME}.pc" @ONLY) +-install(FILES "${CMAKE_BINARY_DIR}/src/${TINYSPLINE_C_LIBRARY_OUTPUT_NAME}.pc" ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${TINYSPLINE_C_LIBRARY_OUTPUT_NAME}.pc" + DESTINATION "${TINYSPLINE_INSTALL_PKGCONFIG_PATH}") + + # C++ library +@@ -920,7 +920,7 @@ + "-l${TINYSPLINE_PKGCONFIG_CXX_LINK_LIBRARIES}") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkg/tinysplinecxx.pc.in" + "${TINYSPLINE_CXX_LIBRARY_OUTPUT_NAME}.pc" @ONLY) +- install(FILES "${CMAKE_BINARY_DIR}/src/${TINYSPLINE_CXX_LIBRARY_OUTPUT_NAME}.pc" ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${TINYSPLINE_CXX_LIBRARY_OUTPUT_NAME}.pc" + DESTINATION "${TINYSPLINE_INSTALL_PKGCONFIG_PATH}") + endif() + +@@ -1073,7 +1073,7 @@ + endif() + endif() + set(TINYSPLINE_MACOSX_RELINK_SCRIPT +- "${CMAKE_BINARY_DIR}/macosx-relink.sh") ++ "${CMAKE_CURRENT_BINARY_DIR}/macosx-relink.sh") + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/macosx-relink.sh.in" + ${TINYSPLINE_MACOSX_RELINK_SCRIPT} +@@ -1438,7 +1438,7 @@ + get_filename_component(TINYSPLINE_LIB_DIR ${TINYSPLINE_OUTPUT_DIRECTORY} NAME) + + # Dub +-file(REMOVE "${CMAKE_BINARY_DIR}/dub.json") ++file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/dub.json") + if(${TINYSPLINE_WITH_DLANG}) + set(TINYSPLINE_DUB_COPY_FILES "\"${TINYSPLINE_LIB_DIR}/*.d\"") + set(TINYSPLINE_DUB_COPY_FILES "${TINYSPLINE_DUB_COPY_FILES}\ +@@ -1449,7 +1449,7 @@ + endforeach() + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/dub.json.in" +- "${CMAKE_BINARY_DIR}/dub.json" ++ "${CMAKE_CURRENT_BINARY_DIR}/dub.json" + @ONLY) + endif() + +@@ -1479,12 +1479,12 @@ + "tinyspline${TINYSPLINE_LUAROCKS_SPEC}.rockspec") + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/tinyspline.rockspec.in" +- "${CMAKE_BINARY_DIR}/${TINYSPLINE_LUAROCKS_SPEC}" ++ "${CMAKE_CURRENT_BINARY_DIR}/${TINYSPLINE_LUAROCKS_SPEC}" + @ONLY) + endif() + + # NuGet +-file(REMOVE "${CMAKE_BINARY_DIR}/.nuspec") ++file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/.nuspec") + if(${TINYSPLINE_WITH_CSHARP}) + get_filename_component(TINYSPLINE_NUGET_INTERFACE_FILE + ${TINYSPLINE_CSHARP_INTERFACE_FILE} +@@ -1531,21 +1531,21 @@ + endforeach() + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/.nuspec.in" +- "${CMAKE_BINARY_DIR}/.nuspec" ++ "${CMAKE_CURRENT_BINARY_DIR}/.nuspec" + @ONLY) + endif() + + # Maven +-file(REMOVE "${CMAKE_BINARY_DIR}/pom.xml") ++file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/pom.xml") + if(${TINYSPLINE_WITH_JAVA}) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/pom.xml.in" +- "${CMAKE_BINARY_DIR}/pom.xml" ++ "${CMAKE_CURRENT_BINARY_DIR}/pom.xml" + @ONLY) + endif() + + # Distutils +-file(REMOVE "${CMAKE_BINARY_DIR}/setup.py") ++file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/setup.py") + if(${TINYSPLINE_WITH_PYTHON}) + get_filename_component(TINYSPLINE_SETUP_INTERFACE_FILE + ${TINYSPLINE_PYTHON_INTERFACE_FILE} +@@ -1561,12 +1561,12 @@ + set(TINYSPLINE_SETUP_FILE_ARRAY "[${TINYSPLINE_SETUP_FILE_ARRAY}]") + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/setup.py.in" +- "${CMAKE_BINARY_DIR}/setup.py" ++ "${CMAKE_CURRENT_BINARY_DIR}/setup.py" + @ONLY) + endif() + + # Gem +-file(REMOVE "${CMAKE_BINARY_DIR}/tinyspline.gemspec") ++file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/tinyspline.gemspec") + if(${TINYSPLINE_WITH_RUBY}) + set(TINYSPLINE_RUBY_REQ_VERSION + "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}") +@@ -1578,7 +1578,7 @@ + endforeach() + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/pkg/tinyspline.gemspec.in" +- "${CMAKE_BINARY_DIR}/tinyspline.gemspec" ++ "${CMAKE_CURRENT_BINARY_DIR}/tinyspline.gemspec" + @ONLY) + endif() + diff --git a/recipes/tinyspline/all/test_package/CMakeLists.txt b/recipes/tinyspline/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4ff151e0924ad --- /dev/null +++ b/recipes/tinyspline/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) + +find_package(tinyspline REQUIRED CONFIG) + +if(tinyspline_VERSION VERSION_GREATER_EQUAL "0.3.0") + add_definitions(-DTINYSPLINE_API_0_3) +endif() + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE tinyspline::tinyspline) + +if(TINYSPLINE_CXX) + # FIXME: we should have to call find_package(tinysplinecxx REQUIRED CONFIG) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE tinysplinecxx::tinysplinecxx) + if(tinyspline_VERSION VERSION_GREATER_EQUAL "0.4.0") + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + endif() +endif() diff --git a/recipes/tinyspline/all/test_package/conanfile.py b/recipes/tinyspline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6d32d0065c481 --- /dev/null +++ b/recipes/tinyspline/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TINYSPLINE_CXX"] = self.dependencies["tinyspline"].options.cxx + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_c_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_c_path, run_environment=True) + + # TODO: rely on self.dependencies["tinyspline"].options.cxx in CONAN_V2 mode + # see https://github.com/conan-io/conan/issues/11940#issuecomment-1223940786 + bin_cpp_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + if os.path.exists(bin_cpp_path): + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/tinyspline/all/test_package/test_package.c b/recipes/tinyspline/all/test_package/test_package.c new file mode 100644 index 0000000000000..7b9c76312a7cb --- /dev/null +++ b/recipes/tinyspline/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include + +int main() { + tsBSpline spline; +#ifdef TINYSPLINE_API_0_3 + tsStatus status; + ts_bspline_new(6, 3, 3, TS_OPENED, &spline, &status); +#else + ts_bspline_new(6, 3, 3, TS_OPENED, &spline); +#endif + ts_bspline_free(&spline); + + return 0; +} diff --git a/recipes/tinyspline/all/test_package/test_package.cpp b/recipes/tinyspline/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c6c73928d276c --- /dev/null +++ b/recipes/tinyspline/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#ifdef TINYSPLINE_API_0_3 +# include +#else +# include +#endif + +int main() { + tinyspline::BSpline spline(6, 3, 3); + + return 0; +} diff --git a/recipes/tinyspline/all/test_v1_package/CMakeLists.txt b/recipes/tinyspline/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/tinyspline/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tinyspline/all/test_v1_package/conanfile.py b/recipes/tinyspline/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f0e24ab54dc38 --- /dev/null +++ b/recipes/tinyspline/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["TINYSPLINE_CXX"] = self.options["tinyspline"].cxx + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_c_path = os.path.join("bin", "test_package_c") + self.run(bin_c_path, run_environment=True) + if self.options["tinyspline"].cxx: + bin_cpp_path = os.path.join("bin", "test_package_cpp") + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/tinyspline/config.yml b/recipes/tinyspline/config.yml new file mode 100644 index 0000000000000..88f70b2c8fcdf --- /dev/null +++ b/recipes/tinyspline/config.yml @@ -0,0 +1,11 @@ +versions: + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all + "0.3.0": + folder: all + "0.2.0": + folder: all diff --git a/recipes/tinyxml/all/CMakeLists.txt b/recipes/tinyxml/all/CMakeLists.txt new file mode 100644 index 0000000000000..c8bf6c2939aa7 --- /dev/null +++ b/recipes/tinyxml/all/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.4) +project(tinyxml LANGUAGES CXX) + +option(TINYXML_WITH_STL "Compile TinyXML with STL" OFF) + +set(TINYXML_HDRS + ${TINYXML_SRC_DIR}/tinystr.h + ${TINYXML_SRC_DIR}/tinyxml.h) +set(TINYXML_SRCS + ${TINYXML_SRC_DIR}/tinystr.cpp + ${TINYXML_SRC_DIR}/tinyxml.cpp + ${TINYXML_SRC_DIR}/tinyxmlerror.cpp + ${TINYXML_SRC_DIR}/tinyxmlparser.cpp) + +add_library(tinyxml ${TINYXML_SRCS}) +target_include_directories(tinyxml PUBLIC ${TINYXML_SRC_DIR}) + +if(TINYXML_WITH_STL) + target_compile_definitions(tinyxml PUBLIC TIXML_USE_STL) +endif() + +include(GNUInstallDirs) +install(TARGETS tinyxml + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES ${TINYXML_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/tinyxml/all/conandata.yml b/recipes/tinyxml/all/conandata.yml new file mode 100644 index 0000000000000..ec21244c89458 --- /dev/null +++ b/recipes/tinyxml/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.6.2": + url: "http://downloads.sourceforge.net/project/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz" + sha256: "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593" diff --git a/recipes/tinyxml/all/conanfile.py b/recipes/tinyxml/all/conanfile.py new file mode 100644 index 0000000000000..b6d3aba1021b4 --- /dev/null +++ b/recipes/tinyxml/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, save +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.47.0" + + +class TinyXmlConan(ConanFile): + name = "tinyxml" + description = "TinyXML is a simple, small, C++ XML parser that can be easily integrated into other programs." + license = "Zlib" + topics = ("xml", "parser") + homepage = "http://www.grinninglizard.com/tinyxml/" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_stl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_stl": False, + } + + exports_sources = "CMakeLists.txt" + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + + 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["TINYXML_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["TINYXML_WITH_STL"] = self.options.with_stl + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + with open(os.path.join(self.source_folder, "tinyxml.h")) as f: + content_lines = f.readlines() + license_content = [] + for i in range(2, 22): + license_content.append(content_lines[i][:-1]) + return "\n".join(license_content) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["tinyxml"] + if self.options.with_stl: + self.cpp_info.defines = ["TIXML_USE_STL"] + + # TODO: to remove in conan v2, and do not port these names to CMakeDeps, it was a mistake + self.cpp_info.names["cmake_find_package"] = "TinyXML" + self.cpp_info.names["cmake_find_package_multi"] = "TinyXML" diff --git a/recipes/tinyxml/all/test_package/CMakeLists.txt b/recipes/tinyxml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f35c28e75d81c --- /dev/null +++ b/recipes/tinyxml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(tinyxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinyxml::tinyxml) diff --git a/recipes/tinyxml/all/test_package/conanfile.py b/recipes/tinyxml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tinyxml/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/tinyxml/all/test_package/test_package.cpp b/recipes/tinyxml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..afe80c7659ef7 --- /dev/null +++ b/recipes/tinyxml/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include "tinyxml.h" + +int main() +{ + static const char* xml = + "" + "" + "" + "A Midsummer Night's Dream" + ""; + + TiXmlDocument doc( "demotest.xml" ); + doc.Parse(xml); + + return 0; +} diff --git a/recipes/tinyxml/all/test_v1_package/CMakeLists.txt b/recipes/tinyxml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f0821ea56fd5b --- /dev/null +++ b/recipes/tinyxml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(TinyXML REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE TinyXML::TinyXML) diff --git a/recipes/tinyxml/all/test_v1_package/conanfile.py b/recipes/tinyxml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinyxml/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/tinyxml/config.yml b/recipes/tinyxml/config.yml new file mode 100644 index 0000000000000..8296a371553be --- /dev/null +++ b/recipes/tinyxml/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.2": + folder: all diff --git a/recipes/tinyxml2/all/conandata.yml b/recipes/tinyxml2/all/conandata.yml new file mode 100644 index 0000000000000..e2cd904cc1876 --- /dev/null +++ b/recipes/tinyxml2/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "9.0.0": + url: "https://github.com/leethomason/tinyxml2/archive/refs/tags/9.0.0.tar.gz" + sha256: "cc2f1417c308b1f6acc54f88eb70771a0bf65f76282ce5c40e54cfe52952702c" + "8.0.0": + url: "https://github.com/leethomason/tinyxml2/archive/8.0.0.tar.gz" + sha256: "6ce574fbb46751842d23089485ae73d3db12c1b6639cda7721bf3a7ee862012c" + "7.1.0": + url: "https://github.com/leethomason/tinyxml2/archive/7.1.0.tar.gz" + sha256: "68ebd396a4220d5a9b5a621c6e9c66349c5cfdf5efaea3f16e3bb92e45f4e2a3" +patches: + "8.0.0": + - patch_file: "patches/0001-cmake-pic.patch" + "7.1.0": + - patch_file: "patches/0001-cmake-pic.patch" diff --git a/recipes/tinyxml2/all/conanfile.py b/recipes/tinyxml2/all/conanfile.py new file mode 100644 index 0000000000000..2136d8c5a732a --- /dev/null +++ b/recipes/tinyxml2/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class Tinyxml2Conan(ConanFile): + name = "tinyxml2" + description = "Simple, small, efficient, C++ XML parser that can be " \ + "easily integrated into other programs." + license = "Zlib" + topics = ("tinyxml2", "xml", "parser") + homepage = "https://github.com/leethomason/tinyxml2" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "8.1.0": + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + 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() + 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", "tinyxml2") + self.cpp_info.set_property("cmake_target_name", "tinyxml2::tinyxml2") + self.cpp_info.set_property("pkg_config_name", "tinyxml2") + postfix = "d" if self.settings.build_type == "Debug" and Version(self.version) < "8.1.0" else "" + self.cpp_info.libs = [f"tinyxml2{postfix}"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("TINYXML2_IMPORT") diff --git a/recipes/tinyxml2/all/patches/0001-cmake-pic.patch b/recipes/tinyxml2/all/patches/0001-cmake-pic.patch new file mode 100644 index 0000000000000..7ef499dd0ef83 --- /dev/null +++ b/recipes/tinyxml2/all/patches/0001-cmake-pic.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,6 @@ option(BUILD_SHARED_LIBS "build as shared library" ON) + option(BUILD_TESTS "build xmltest (deprecated: Use BUILD_TESTING)" ON) + + # To allow using tinyxml in another shared library +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) diff --git a/recipes/tinyxml2/all/test_package/CMakeLists.txt b/recipes/tinyxml2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..237f6a3399d8b --- /dev/null +++ b/recipes/tinyxml2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(tinyxml2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinyxml2::tinyxml2) diff --git a/recipes/tinyxml2/all/test_package/conanfile.py b/recipes/tinyxml2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tinyxml2/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/tinyxml2/all/test_package/test_package.cpp b/recipes/tinyxml2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ab243f53716ad --- /dev/null +++ b/recipes/tinyxml2/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +int main() { + static const char* xml = + "" + "" + "" + "A Midsummer Night's Dream" + ""; + + tinyxml2::XMLDocument doc; + doc.Parse(xml); + + return doc.ErrorID(); +} diff --git a/recipes/tinyxml2/all/test_v1_package/CMakeLists.txt b/recipes/tinyxml2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tinyxml2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tinyxml2/all/test_v1_package/conanfile.py b/recipes/tinyxml2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinyxml2/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/tinyxml2/config.yml b/recipes/tinyxml2/config.yml new file mode 100644 index 0000000000000..0458a9c7b0da4 --- /dev/null +++ b/recipes/tinyxml2/config.yml @@ -0,0 +1,7 @@ +versions: + "9.0.0": + folder: all + "8.0.0": + folder: all + "7.1.0": + folder: all diff --git a/recipes/tixi3/all/conandata.yml b/recipes/tixi3/all/conandata.yml new file mode 100644 index 0000000000000..2336f6ccbdc16 --- /dev/null +++ b/recipes/tixi3/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "3.3.0": + sha256: "988d79ccd53c815d382cff0c244c0bb8e393986377dfb45385792766adf6f6a9" + url: "https://github.com/DLR-SC/tixi/archive/refs/tags/v3.3.0.tar.gz" +patches: + "3.3.0": + - patch_file: "patches/link_curl.patch" + patch_description: "Fix CMake target name for libcurl" + patch_type: "conan" + - patch_file: "patches/disable_tixi_examples.patch" + patch_description: "Keep build examples as optional" + patch_type: "conan" diff --git a/recipes/tixi3/all/conanfile.py b/recipes/tixi3/all/conanfile.py new file mode 100644 index 0000000000000..b8124c51186f6 --- /dev/null +++ b/recipes/tixi3/all/conanfile.py @@ -0,0 +1,127 @@ +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools import files +from conan import ConanFile +import os +import textwrap + +required_conan_version = ">=1.45.0" + + +class Tixi3Conan(ConanFile): + name = "tixi3" + url = "https://github.com/conan-io/conan-center-index" + description = "A simple xml interface based on libxml2 and libxslt" + topics = ("xml", "xml2", "xslt") + homepage = "https://github.com/DLR-SC/tixi" + license = "Apache-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TIXI_BUILD_EXAMPLES"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def requirements(self): + self.requires("libxml2/2.9.14") + self.requires("libxslt/1.1.34") + self.requires("libcurl/7.84.0") + + def layout(self): + cmake_layout(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 + + # tixi is a c library + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + files.copy(self, patch["patch_file"], src=self.recipe_folder, dst=self.export_sources_folder) + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self.source_folder) + + def build(self): + files.apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + files.save(self, module_file, content) + + def package(self): + cmake = CMake(self) + cmake.install() + + files.rmdir(self, os.path.join(self.package_folder, "lib", "tixi3")) + files.copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + files.rmdir(self, os.path.join(self.package_folder, "share")) + + # provide alias target tixi3 for v1 packages + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"tixi3": "tixi3::tixi3"} + ) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "tixi3")) + + if self.settings.build_type != "Debug": + self.cpp_info.libs = ['tixi3'] + else: + self.cpp_info.libs = ['tixi3-d'] + + if self.settings.os == "Windows": + self.cpp_info.system_libs = ['shlwapi'] + + self.cpp_info.frameworks.extend(["Foundation"]) + + self.cpp_info.set_property("cmake_file_name", "tixi3") + self.cpp_info.set_property("cmake_target_name", "tixi3") + + # provide alias target tixi3 for v1 packages + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + 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/tixi3/all/patches/disable_tixi_examples.patch b/recipes/tixi3/all/patches/disable_tixi_examples.patch new file mode 100644 index 0000000000000..1e4ce11dc3929 --- /dev/null +++ b/recipes/tixi3/all/patches/disable_tixi_examples.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3ab74e9..39878ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,10 +109,15 @@ if(TIXI_BUILD_TESTS) + endif(TIXI_BUILD_TESTS) + + #demos +-add_subdirectory(examples/Demo) +-if (TIXI_ENABLE_FORTRAN) +- add_subdirectory(examples/fortran77) +-endif(TIXI_ENABLE_FORTRAN) ++option (TIXI_BUILD_EXAMPLES "Build tixi examples" ON) ++ ++if (TIXI_BUILD_EXAMPLES) ++ add_subdirectory(examples/Demo) ++ ++ if (TIXI_ENABLE_FORTRAN) ++ add_subdirectory(examples/fortran77) ++ endif(TIXI_ENABLE_FORTRAN) ++endif(TIXI_BUILD_EXAMPLES) + + # create the doc + include(createDoc) diff --git a/recipes/tixi3/all/patches/link_curl.patch b/recipes/tixi3/all/patches/link_curl.patch new file mode 100644 index 0000000000000..e205b3c5b48aa --- /dev/null +++ b/recipes/tixi3/all/patches/link_curl.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6a9c821..f1b62a7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -20,7 +20,7 @@ if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fmessage-length=0") + endif() + +-set(TIXI_LIBS curllib LibXslt::LibXslt LibXml2::LibXml2) ++set(TIXI_LIBS CURL::libcurl LibXslt::LibXslt LibXml2::LibXml2) + if(WIN32) + set(TIXI_LIBS ${TIXI_LIBS} Shlwapi) + endif(WIN32) diff --git a/recipes/tixi3/all/test_package/CMakeLists.txt b/recipes/tixi3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c9358ca94ac50 --- /dev/null +++ b/recipes/tixi3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.12) +project(Tixi-Conan-TestPackage CXX) + +find_package(tixi3 REQUIRED) + +add_executable(tixi3_conan_test main.cpp) +target_link_libraries(tixi3_conan_test PRIVATE tixi3) diff --git a/recipes/tixi3/all/test_package/conanfile.py b/recipes/tixi3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0e104e3f9a662 --- /dev/null +++ b/recipes/tixi3/all/test_package/conanfile.py @@ -0,0 +1,23 @@ + +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" + + 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], "tixi3_conan_test") + self.run(bin_path, env="conanrun") diff --git a/recipes/tixi3/all/test_package/main.cpp b/recipes/tixi3/all/test_package/main.cpp new file mode 100644 index 0000000000000..0042a0e4225a1 --- /dev/null +++ b/recipes/tixi3/all/test_package/main.cpp @@ -0,0 +1,20 @@ +#include + +#include + +int main() +{ + TixiDocumentHandle handle = -1; + char* str = NULL; + + tixiCreateDocument("root", &handle); + + tixiAddTextElement(handle, "/root", "message", "This is a tixi test."); + + tixiExportDocumentAsString(handle, &str); + + std::cout << str << std::endl; + + tixiCloseDocument(handle); + return 0; +} diff --git a/recipes/tixi3/all/test_v1_package/CMakeLists.txt b/recipes/tixi3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..80f9071294122 --- /dev/null +++ b/recipes/tixi3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1.2) +project(tixi3_conan_test CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tixi3 REQUIRED CONFIG) + +add_executable(tixi3_conan_test ../test_package/main.cpp) +target_link_libraries(tixi3_conan_test tixi3) diff --git a/recipes/tixi3/all/test_v1_package/conanfile.py b/recipes/tixi3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d620b7c8ee1ca --- /dev/null +++ b/recipes/tixi3/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "tixi3_conan_test") + self.run(bin_path, run_environment=True) diff --git a/recipes/tixi3/config.yml b/recipes/tixi3/config.yml new file mode 100644 index 0000000000000..37e25f6a89ed1 --- /dev/null +++ b/recipes/tixi3/config.yml @@ -0,0 +1,3 @@ +versions: + "3.3.0": + folder: all diff --git a/recipes/tk/all/conandata.yml b/recipes/tk/all/conandata.yml new file mode 100644 index 0000000000000..8cbbcf9134e3c --- /dev/null +++ b/recipes/tk/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "8.6.10": + url: "https://prdownloads.sourceforge.net/tcl/tk8.6.10-src.tar.gz" + sha256: "63df418a859d0a463347f95ded5cd88a3dd3aaa1ceecaeee362194bc30f3e386" diff --git a/recipes/tk/all/conanfile.py b/recipes/tk/all/conanfile.py new file mode 100644 index 0000000000000..97130833734db --- /dev/null +++ b/recipes/tk/all/conanfile.py @@ -0,0 +1,258 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanException, ConanInvalidConfiguration, ConanExceptionInUserConanfileMethod +import os + +required_conan_version = ">=1.33.0" + +class TkConan(ConanFile): + name = "tk" + description = "Tk is a graphical user interface toolkit that takes developing desktop applications to a higher level than conventional approaches." + topics = ("conan", "tk", "gui", "tcl", "scripting", "programming") + homepage = "https://tcl.tk" + license = "TCL" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("tcl/{}".format(self.version)) + if self.settings.os == "Linux": + self.requires("fontconfig/2.13.93") + self.requires("xorg/system") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self.settings.compiler != "Visual Studio": + 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.options["tcl"].shared != self.options.shared: + raise ConanInvalidConfiguration("The shared option of tcl and tk must have the same value") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _patch_sources(self): + for build_system in ("unix", "win", ): + config_dir = self._get_configure_folder(build_system) + + if build_system != "win": + # When disabling 64-bit support (in 32-bit), this test must be 0 in order to use "long long" for 64-bit ints + # (${tcl_type_64bit} can be either "__int64" or "long long") + tools.replace_in_file(os.path.join(config_dir, "configure"), + "(sizeof(${tcl_type_64bit})==sizeof(long))", + "(sizeof(${tcl_type_64bit})!=sizeof(long))") + + makefile_in = os.path.join(config_dir, "Makefile.in") + # Avoid clearing CFLAGS and LDFLAGS in the makefile + # tools.replace_in_file(makefile_in, "\nCFLAGS{}".format(" " if (build_system == "win" and name == "tcl") else "\t"), "\n#CFLAGS\t") + tools.replace_in_file(makefile_in, "\nLDFLAGS\t", "\n#LDFLAGS\t") + tools.replace_in_file(makefile_in, "${CFLAGS}", "${CFLAGS} ${CPPFLAGS}") + + rules_ext_vc = os.path.join(self.source_folder, self._source_subfolder, "win", "rules-ext.vc") + tools.replace_in_file(rules_ext_vc, + "\n_RULESDIR = ", + "\n_RULESDIR = .\n#_RULESDIR = ") + rules_vc = os.path.join(self.source_folder, self._source_subfolder, "win", "rules.vc") + tools.replace_in_file(rules_vc, + r"$(_TCLDIR)\generic", + r"$(_TCLDIR)\include") + tools.replace_in_file(rules_vc, + "\nTCLSTUBLIB", + "\n#TCLSTUBLIB") + tools.replace_in_file(rules_vc, + "\nTCLIMPLIB", + "\n#TCLIMPLIB") + + win_makefile_in = os.path.join(self._get_configure_folder("win"), "Makefile.in") + tools.replace_in_file(win_makefile_in, "\nTCL_GENERIC_DIR", "\n#TCL_GENERIC_DIR") + + win_rules_vc = os.path.join(self._source_subfolder, "win", "rules.vc") + tools.replace_in_file(win_rules_vc, + "\ncwarn = $(cwarn) -WX", + "\n# cwarn = $(cwarn) -WX") + # disable whole program optimization to be portable across different MSVC versions. + # See conan-io/conan-center-index#4811 conan-io/conan-center-index#4094 + tools.replace_in_file( + win_rules_vc, + "OPTIMIZATIONS = $(OPTIMIZATIONS) -GL", + "# OPTIMIZATIONS = $(OPTIMIZATIONS) -GL") + + def _get_default_build_system(self): + if tools.is_apple_os(self.settings.os): + return "macosx" + elif self.settings.os in ("Linux", "FreeBSD"): + return "unix" + elif self.settings.os == "Windows": + return "win" + else: + raise ValueError("tk recipe does not recognize os") + + def _get_configure_folder(self, build_system=None): + if build_system is None: + build_system = self._get_default_build_system() + if build_system not in ["win", "unix", "macosx"]: + raise ConanExceptionInUserConanfileMethod("Invalid build system: {}".format(build_system)) + return os.path.join(self.source_folder, self._source_subfolder, build_system) + + def _build_nmake(self, target="release"): + # https://core.tcl.tk/tips/doc/trunk/tip/477.md + opts = [] + if not self.options.shared: + opts.append("static") + if self.settings.build_type == "Debug": + opts.append("symbols") + if "MD" in str(self.settings.compiler.runtime): + opts.append("msvcrt") + else: + opts.append("nomsvcrt") + if "d" not in str(self.settings.compiler.runtime): + opts.append("unchecked") + # https://core.tcl.tk/tk/tktview?name=3d34589aa0 + # https://wiki.tcl-lang.org/page/Building+with+Visual+Studio+2017 + tcl_lib_path = os.path.join(self.deps_cpp_info["tcl"].rootpath, "lib") + tclimplib, tclstublib = None, None + for lib in os.listdir(tcl_lib_path): + if not lib.endswith(".lib"): + continue + if lib.startswith("tcl{}".format("".join(self.version.split(".")[:2]))): + tclimplib = os.path.join(tcl_lib_path, lib) + elif lib.startswith("tclstub{}".format("".join(self.version.split(".")[:2]))): + tclstublib = os.path.join(tcl_lib_path, lib) + + if tclimplib is None or tclstublib is None: + raise ConanException("tcl dependency misses tcl and/or tclstub library") + with tools.vcvars(self.settings): + tcldir = self.deps_cpp_info["tcl"].rootpath.replace("/", "\\\\") + self.run( + """nmake -nologo -f "{cfgdir}/makefile.vc" INSTALLDIR="{pkgdir}" OPTS={opts} TCLDIR="{tcldir}" TCL_LIBRARY="{tcl_library}" TCLIMPLIB="{tclimplib}" TCLSTUBLIB="{tclstublib}" {target}""".format( + cfgdir=self._get_configure_folder("win"), + pkgdir=self.package_folder, + opts=",".join(opts), + tcldir=tcldir, + tclstublib=tclstublib, + tclimplib=tclimplib, + tcl_library=self.deps_env_info['tcl'].TCL_LIBRARY.replace("\\", "/"), + target=target, + ), cwd=self._get_configure_folder("win"), + ) + + def _configure_autotools(self): + tcl_root = self.deps_cpp_info["tcl"].rootpath + make_args = ["TCL_GENERIC_DIR={}".format(os.path.join(tcl_root, "include")).replace("\\", "/")] + if self._autotools: + return self._autotools, make_args + + tclConfigShFolder = os.path.join(tcl_root, "lib").replace("\\", "/") + + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + yes_no = lambda v: "yes" if v else "no" + conf_args = [ + "--with-tcl={}".format(tools.unix_path(tclConfigShFolder)), + "--enable-threads", + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-symbols={}".format(yes_no(self.settings.build_type == "Debug")), + "--enable-64bit={}".format(yes_no(self.settings.arch == "x86_64")), + "--with-x={}".format(yes_no(self.settings.os == "Linux")), + "--enable-aqua={}".format(yes_no(tools.is_apple_os(self.settings.os))), + ] + + if self.settings.os == "Windows": + self._autotools.defines.extend(["UNICODE", "_UNICODE", "_ATL_XP_TARGETING", ]) + self._autotools.libs = [] + self._autotools.configure(configure_dir=self._get_configure_folder(), args=conf_args) + return self._autotools, make_args + + def build(self): + self._patch_sources() + + if self.settings.compiler == "Visual Studio": + self._build_nmake() + else: + autotools, make_args = self._configure_autotools() + autotools.make(args=make_args) + + def package(self): + self.copy(pattern="license.terms", src=self._source_subfolder, dst="licenses") + if self.settings.compiler == "Visual Studio": + self._build_nmake("install") + else: + with tools.chdir(self.build_folder): + autotools, make_args = self._configure_autotools() + autotools.install(args=make_args) + autotools.make(target="install-private-headers", args=make_args) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "man")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + # FIXME: move to patch + tkConfigShPath = os.path.join(self.package_folder, "lib", "tkConfig.sh") + if os.path.exists(tkConfigShPath): + pkg_path = os.path.join(self.package_folder).replace('\\', '/') + tools.replace_in_file(tkConfigShPath, + pkg_path, + "${TK_ROOT}") + tools.replace_in_file(tkConfigShPath, + "\nTK_BUILD_", + "\n#TK_BUILD_") + tools.replace_in_file(tkConfigShPath, + "\nTK_SRC_DIR", + "\n#TK_SRC_DIR") + + def package_info(self): + if self.settings.compiler == "Visual Studio": + tk_version = tools.Version(self.version) + lib_infix = "{}{}".format(tk_version.major, tk_version.minor) + tk_suffix = "t{}{}{}".format( + "" if self.options.shared else "s", + "g" if self.settings.build_type == "Debug" else "", + "x" if "MD" in str(self.settings.compiler.runtime) and not self.options.shared else "", + ) + else: + tk_version = tools.Version(self.version) + lib_infix = "{}.{}".format(tk_version.major, tk_version.minor) + tk_suffix = "" + self.cpp_info.libs = ["tk{}{}".format(lib_infix, tk_suffix), "tkstub{}".format(lib_infix)] + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreFoundation", "Cocoa", "Carbon", "IOKit"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = [ + "netapi32", "kernel32", "user32", "advapi32", "userenv","ws2_32", "gdi32", + "comdlg32", "imm32", "comctl32", "shell32", "uuid", "ole32", "oleaut32" + ] + + tk_library = os.path.join(self.package_folder, "lib", "{}{}".format(self.name, ".".join(self.version.split(".")[:2]))).replace("\\", "/") + self.output.info("Setting TK_LIBRARY environment variable: {}".format(tk_library)) + self.env_info.TK_LIBRARY = tk_library + + tcl_root = self.package_folder.replace("\\", "/") + self.output.info("Setting TCL_ROOT environment variable: {}".format(tcl_root)) + self.env_info.TCL_ROOT = tcl_root diff --git a/recipes/tk/all/test_package/CMakeLists.txt b/recipes/tk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7672a2d37cdd9 --- /dev/null +++ b/recipes/tk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/tk/all/test_package/conanfile.py b/recipes/tk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a7a94271504b6 --- /dev/null +++ b/recipes/tk/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TclTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tk/all/test_package/test_package.c b/recipes/tk/all/test_package/test_package.c new file mode 100644 index 0000000000000..601b2c8c2b4fc --- /dev/null +++ b/recipes/tk/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include +#include + +#include +#include + +int main (int argc ,char *argv[]) { + Tcl_FindExecutable(argv[0]); + Tcl_Interp *interp = Tcl_CreateInterp(); + if (Tcl_Init(interp) != TCL_OK) { + fprintf(stderr ,"Tcl_Init error: %s\n" ,Tcl_GetStringResult(interp)); + return EXIT_FAILURE; + } + + if (Tk_Init(interp) != TCL_OK) { + fprintf(stderr, "Tk_Init failed: %s\n", Tcl_GetStringResult(interp)); + fprintf(stderr, "But ignore it: there may not be a X server running.\n"); + return EXIT_SUCCESS; + } + + Tcl_Finalize(); + return EXIT_SUCCESS; +} diff --git a/recipes/tk/config.yml b/recipes/tk/config.yml new file mode 100644 index 0000000000000..49fb3460e3335 --- /dev/null +++ b/recipes/tk/config.yml @@ -0,0 +1,3 @@ +versions: + "8.6.10": + folder: "all" diff --git a/recipes/tl-expected/all/conandata.yml b/recipes/tl-expected/all/conandata.yml new file mode 100644 index 0000000000000..1dbeea5c36d21 --- /dev/null +++ b/recipes/tl-expected/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.0": + url: "https://github.com/TartanLlama/expected/archive/refs/tags/v1.1.0.tar.gz" + sha256: "1db357f46dd2b24447156aaf970c4c40a793ef12a8a9c2ad9e096d9801368df6" + "20190710": + url: "https://github.com/TartanLlama/expected/archive/6fe2af5191214cce620899f7f06585c047b9f1fc.zip" + sha256: "25b009593fcb27aafd3e836e0e726da351b4be7a20703b9bb709a5efd61c26d0" + "1.0.0": + url: "https://github.com/TartanLlama/expected/archive/refs/tags/v1.0.0.tar.gz" + sha256: "8f5124085a124113e75e3890b4e923e3a4de5b26a973b891b3deb40e19c03cee" diff --git a/recipes/tl-expected/all/conanfile.py b/recipes/tl-expected/all/conanfile.py new file mode 100644 index 0000000000000..9e0aa613d3d14 --- /dev/null +++ b/recipes/tl-expected/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TlExpectedConan(ConanFile): + name = "tl-expected" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tl.tartanllama.xyz" + description = "C++11/14/17 std::expected with functional-style extensions" + topics = ("cpp11", "cpp14", "cpp17", "expected") + license = "CC0-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=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_file_name", "tl-expected") + self.cpp_info.set_property("cmake_target_name", "tl::expected") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tl-expected" + self.cpp_info.filenames["cmake_find_package_multi"] = "tl-expected" + self.cpp_info.names["cmake_find_package"] = "tl" + self.cpp_info.names["cmake_find_package_multi"] = "tl" + self.cpp_info.components["expected"].names["cmake_find_package"] = "expected" + self.cpp_info.components["expected"].names["cmake_find_package_multi"] = "expected" + self.cpp_info.components["expected"].set_property("cmake_target_name", "tl::expected") + self.cpp_info.components["expected"].bindirs = [] + self.cpp_info.components["expected"].frameworkdirs = [] + self.cpp_info.components["expected"].libdirs = [] + self.cpp_info.components["expected"].resdirs = [] diff --git a/recipes/tl-expected/all/test_package/CMakeLists.txt b/recipes/tl-expected/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db7a62e02101e --- /dev/null +++ b/recipes/tl-expected/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tl-expected REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::expected) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tl-expected/all/test_package/conanfile.py b/recipes/tl-expected/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/tl-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/tl-expected/all/test_package/test_package.cpp b/recipes/tl-expected/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3fda4f43ccd5b --- /dev/null +++ b/recipes/tl-expected/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +tl::expected maybe_do_something(int i) { + if (i < 5) { + return 0; + } else { + return tl::make_unexpected("Uh oh"); + } +} + +int main() { + return maybe_do_something(0).value_or(-1); +} diff --git a/recipes/tl-expected/all/test_v1_package/CMakeLists.txt b/recipes/tl-expected/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9e3965ccc9cc1 --- /dev/null +++ b/recipes/tl-expected/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tl-expected REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::expected) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tl-expected/all/test_v1_package/conanfile.py b/recipes/tl-expected/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tl-expected/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/tl-expected/config.yml b/recipes/tl-expected/config.yml new file mode 100644 index 0000000000000..513187394acf8 --- /dev/null +++ b/recipes/tl-expected/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.0": + folder: all + "20190710": + folder: all + "1.0.0": + folder: all diff --git a/recipes/tl-function-ref/all/conandata.yml b/recipes/tl-function-ref/all/conandata.yml new file mode 100644 index 0000000000000..ceb2b7df89a38 --- /dev/null +++ b/recipes/tl-function-ref/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/TartanLlama/function_ref/archive/refs/tags/v1.0.0.tar.gz" + sha256: "6e374c40c40d3978cfcdd4ef9ed1417627898f37ffb306970f86e339644ed3ca" diff --git a/recipes/tl-function-ref/all/conanfile.py b/recipes/tl-function-ref/all/conanfile.py new file mode 100644 index 0000000000000..06ae98ab9af68 --- /dev/null +++ b/recipes/tl-function-ref/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TlfunctionrefConan(ConanFile): + name = "tl-function-ref" + description = "A lightweight, non-owning reference to a callable." + license = "CC0-1.0" + topics = ("function_ref", "callable") + homepage = "https://github.com/TartanLlama/function_ref" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=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_file_name", "tl-function-ref") + self.cpp_info.set_property("cmake_target_name", "tl::function-ref") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tl-function-ref" + self.cpp_info.filenames["cmake_find_package_multi"] = "tl-function-ref" + self.cpp_info.names["cmake_find_package"] = "tl" + self.cpp_info.names["cmake_find_package_multi"] = "tl" + self.cpp_info.components["function-ref"].names["cmake_find_package"] = "function-ref" + self.cpp_info.components["function-ref"].names["cmake_find_package_multi"] = "function-ref" + self.cpp_info.components["function-ref"].set_property("cmake_target_name", "tl::function-ref") + self.cpp_info.components["function-ref"].bindirs = [] + self.cpp_info.components["function-ref"].frameworkdirs = [] + self.cpp_info.components["function-ref"].libdirs = [] + self.cpp_info.components["function-ref"].resdirs = [] diff --git a/recipes/tl-function-ref/all/test_package/CMakeLists.txt b/recipes/tl-function-ref/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..795da524a5e5c --- /dev/null +++ b/recipes/tl-function-ref/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tl-function-ref REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::function-ref) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tl-function-ref/all/test_package/conanfile.py b/recipes/tl-function-ref/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/tl-function-ref/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/tl-function-ref/all/test_package/test_package.cpp b/recipes/tl-function-ref/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b9838debdaceb --- /dev/null +++ b/recipes/tl-function-ref/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +#include + +bool f_called = false; +void f() { + f_called = true; +} + +int main() { + std::cout << f_called << std::endl; + tl::function_ref fr = f; + fr(); + std::cout << f_called << std::endl; + + return 0; +} diff --git a/recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt b/recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b288bff158e7 --- /dev/null +++ b/recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tl-function-ref REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::function-ref) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tl-function-ref/all/test_v1_package/conanfile.py b/recipes/tl-function-ref/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tl-function-ref/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/tl-function-ref/config.yml b/recipes/tl-function-ref/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/tl-function-ref/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/tl-optional/all/conandata.yml b/recipes/tl-optional/all/conandata.yml new file mode 100644 index 0000000000000..eb9035a81e907 --- /dev/null +++ b/recipes/tl-optional/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: https://github.com/TartanLlama/optional/archive/v1.0.0.zip + sha256: 8bb68defc61da3de2b4cd73ef9792eba44570ec5cb52c4da731286f24aecbb95 diff --git a/recipes/tl-optional/all/conanfile.py b/recipes/tl-optional/all/conanfile.py new file mode 100644 index 0000000000000..2aaefcc1ccfd3 --- /dev/null +++ b/recipes/tl-optional/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TlOptionalConan(ConanFile): + name = "tl-optional" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tl.tartanllama.xyz" + description = "C++11/14/17 std::optional with functional-style extensions and reference support" + topics = ("cpp11", "cpp14", "cpp17", "optional") + license = "CC0-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tl-optional") + self.cpp_info.set_property("cmake_target_name", "tl::optional") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tl-optional" + self.cpp_info.filenames["cmake_find_package_multi"] = "tl-optional" + self.cpp_info.names["cmake_find_package"] = "tl" + self.cpp_info.names["cmake_find_package_multi"] = "tl" + self.cpp_info.components["optional"].names["cmake_find_package"] = "optional" + self.cpp_info.components["optional"].names["cmake_find_package_multi"] = "optional" + self.cpp_info.components["optional"].set_property("cmake_target_name", "tl::optional") + self.cpp_info.components["optional"].bindirs = [] + self.cpp_info.components["optional"].frameworkdirs = [] + self.cpp_info.components["optional"].libdirs = [] + self.cpp_info.components["optional"].resdirs = [] diff --git a/recipes/tl-optional/all/test_package/CMakeLists.txt b/recipes/tl-optional/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e4ef3b1e5cc66 --- /dev/null +++ b/recipes/tl-optional/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tl-optional REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::optional) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tl-optional/all/test_package/conanfile.py b/recipes/tl-optional/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/tl-optional/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/tl-optional/all/test_package/test_package.cpp b/recipes/tl-optional/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..150b085263103 --- /dev/null +++ b/recipes/tl-optional/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +tl::optional maybe_do_something(int i) { + if (i < 5) { + return i; + } else { + return tl::nullopt; + } +} + +int multiply_two(int n) { + return n * 2; +} + +int main() { + int r = maybe_do_something(0) + .map(multiply_two) + .map([](int n) { return n - 1; }) + .value_or(0); + return 0; +} diff --git a/recipes/tl-optional/all/test_v1_package/CMakeLists.txt b/recipes/tl-optional/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ea7e390161229 --- /dev/null +++ b/recipes/tl-optional/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tl-optional REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::optional) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tl-optional/all/test_v1_package/conanfile.py b/recipes/tl-optional/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tl-optional/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/tl-optional/config.yml b/recipes/tl-optional/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/tl-optional/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/tl/all/conandata.yml b/recipes/tl/all/conandata.yml new file mode 100644 index 0000000000000..67546ec60931a --- /dev/null +++ b/recipes/tl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/TartanLlama/tl/archive/v1.0.0.tar.gz" + sha256: "c60e26e9be41fa7b06060609b47e98f4a8f60807dee31fa0aca01f54709a5df0" diff --git a/recipes/tl/all/conanfile.py b/recipes/tl/all/conanfile.py new file mode 100644 index 0000000000000..4f0c575dc9e1b --- /dev/null +++ b/recipes/tl/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 copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TlConan(ConanFile): + name = "tl" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tl.tartanllama.xyz" + description = "tl is a collection of generic C++ libraries" + topics = ("c++", "utilities") + license = "CC0-1.0" + 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.4", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/tl/all/test_package/CMakeLists.txt b/recipes/tl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1a2bc9434517 --- /dev/null +++ b/recipes/tl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::tl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tl/all/test_package/conanfile.py b/recipes/tl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/tl/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/tl/all/test_package/test_package.cpp b/recipes/tl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..79dbd418bb392 --- /dev/null +++ b/recipes/tl/all/test_package/test_package.cpp @@ -0,0 +1,68 @@ +#include +#include +#include + + +#include "tl/apply.hpp" +#include "tl/casts.hpp" +#include "tl/decay_copy.hpp" +#include "tl/dependent_false.hpp" +#include "tl/integer_sequence.hpp" +#include "tl/make_array.hpp" + +std::string append_int(std::string s, int i) { + return s + std::to_string(i); +} + + +struct foo { + int i; +}; + +enum class e { + a +}; + +bool run = false; + +struct bar { + bar() = default; + bar(const bar&) = default; + bar(const bar&&) { + run = true; + } +}; + + +int main() +{ + auto s = tl::apply(append_int, std::make_tuple("hi ", 42)); + assert (s == "hi 42"); + + int i = 42; + auto f = tl::bit_cast(i); + assert (i == f.i); + + auto en = e::a; + auto c = tl::underlying_cast(en); + static_assert(std::is_same::value, "wat"); + assert (c == static_cast(en)); + + bar a; + tl::decay_copy(std::move(a)); + assert(run == true); + + static_assert(std::is_same, + tl::index_sequence<0,1,2,3,4,5,6,7,8,9>>::value, + "make_index_sequence test failed"); + + static_assert(std::is_same, tl::index_sequence<3,4,5,6,7>>::value, + "make_index_range test failed"); + + + auto arr = tl::make_array(1, 12, 42l); + static_assert(std::is_same>::value, "Failed"); + assert(arr[0] == 1); + assert(arr[1] == 12); + assert(arr[2] == 42l); +} diff --git a/recipes/tl/all/test_v1_package/CMakeLists.txt b/recipes/tl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..59fddf2767731 --- /dev/null +++ b/recipes/tl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl::tl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tl/all/test_v1_package/conanfile.py b/recipes/tl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tl/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/tl/config.yml b/recipes/tl/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/tl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/tllist/all/conandata.yml b/recipes/tllist/all/conandata.yml new file mode 100644 index 0000000000000..57b91d7bbc8b2 --- /dev/null +++ b/recipes/tllist/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.5": + url: "https://codeberg.org/dnkl/tllist/archive/1.0.5.tar.gz" + sha256: b0f32c9b2c2015c8d8dd068fd4e8b586aa91ca1670badc274ec962559ee0aadd diff --git a/recipes/tllist/all/conanfile.py b/recipes/tllist/all/conanfile.py new file mode 100644 index 0000000000000..3aefd5f1a8e81 --- /dev/null +++ b/recipes/tllist/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conans import tools +from conans.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.43.0" + + +class TllistConan(ConanFile): + name = "tllist" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codeberg.org/dnkl/tllist" + description = "A C header file only implementation of a typed linked list." + topics = ("list", "utils", "typed-linked-list") + settings = "os", "arch", "build_type", "compiler" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + # tllist relies on __typeof__, not implemented in Visual Studio + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("Visual Studio compiler is not supported") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("*.h", src=self._source_subfolder, dst="include") + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "tllist") diff --git a/recipes/tllist/all/test_package/CMakeLists.txt b/recipes/tllist/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..929cb14b5f70b --- /dev/null +++ b/recipes/tllist/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tllist CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} tllist::tllist) diff --git a/recipes/tllist/all/test_package/conanfile.py b/recipes/tllist/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tllist/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tllist/all/test_package/test_package.c b/recipes/tllist/all/test_package/test_package.c new file mode 100644 index 0000000000000..77b3400127915 --- /dev/null +++ b/recipes/tllist/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, const char *const *argv) { + tll(int) l = tll_init(); + + tll_push_back(l, 43); + + return EXIT_SUCCESS; +} diff --git a/recipes/tllist/config.yml b/recipes/tllist/config.yml new file mode 100644 index 0000000000000..9d896aecb9356 --- /dev/null +++ b/recipes/tllist/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.5": + folder: "all" diff --git a/recipes/tlx/all/conandata.yml b/recipes/tlx/all/conandata.yml new file mode 100644 index 0000000000000..5d98c93707e87 --- /dev/null +++ b/recipes/tlx/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.5.20200222": + url: "https://github.com/tlx/tlx/archive/refs/tags/v0.5.20200222.tar.gz" + sha256: "99e63691af3ada066682243f3a65cd6eb32700071cdd6cfedb18777b5ff5ff4d" +patches: + "0.5.20200222": + - patch_file: "patches/0001-fix-dll-install.patch" + - patch_file: "patches/0002-fix-shared-apple.patch" diff --git a/recipes/tlx/all/conanfile.py b/recipes/tlx/all/conanfile.py new file mode 100644 index 0000000000000..419a2fc27c4ef --- /dev/null +++ b/recipes/tlx/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class TlxConan(ConanFile): + name = "tlx" + description = "tlx is a collection of C++ helpers and extensions " \ + "universally needed, but not found in the STL." + license = "BSL-1.0" + topics = ("data-structure", "algorithm") + homepage = "https://github.com/tlx/tlx" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TLX_BUILD_TESTS"] = False + tc.variables["TLX_USE_GCOV"] = False + tc.variables["TLX_TRY_COMPILE_HEADERS"] = False + tc.variables["TLX_MORE_TESTS"] = False + tc.variables["TLX_BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["TLX_BUILD_SHARED_LIBS"] = self.options.shared + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Do not force PIC + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-fPIC", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"tlx": "tlx::tlx"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tlx") + self.cpp_info.set_property("cmake_target_name", "tlx") + self.cpp_info.set_property("pkg_config_name", "tlx") + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/tlx/all/patches/0001-fix-dll-install.patch b/recipes/tlx/all/patches/0001-fix-dll-install.patch new file mode 100644 index 0000000000000..ca386c44d7c70 --- /dev/null +++ b/recipes/tlx/all/patches/0001-fix-dll-install.patch @@ -0,0 +1,10 @@ +--- a/tlx/CMakeLists.txt ++++ b/tlx/CMakeLists.txt +@@ -86,6 +86,7 @@ if(TLX_BUILD_SHARED_LIBS) + install(TARGETS tlx + EXPORT tlx-targets + COMPONENT Libraries ++ RUNTIME DESTINATION ${TLX_INSTALL_BIN_DIR} + ARCHIVE DESTINATION ${TLX_INSTALL_LIB_DIR} + LIBRARY DESTINATION ${TLX_INSTALL_LIB_DIR}) + diff --git a/recipes/tlx/all/patches/0002-fix-shared-apple.patch b/recipes/tlx/all/patches/0002-fix-shared-apple.patch new file mode 100644 index 0000000000000..269b9e4754223 --- /dev/null +++ b/recipes/tlx/all/patches/0002-fix-shared-apple.patch @@ -0,0 +1,16 @@ +patch version greater than 1023 in dylib is not allowed on Apple OS + +--- a/tlx/CMakeLists.txt ++++ b/tlx/CMakeLists.txt +@@ -73,8 +73,10 @@ if(TLX_BUILD_SHARED_LIBS) + add_library(tlx SHARED ${LIBTLX_SOURCES}) + set_target_properties(tlx PROPERTIES + OUTPUT_NAME "${TLX_LIBNAME}" +- VERSION "${TLX_VERSION}" + SOVERSION "${TLX_SOVERSION}") ++ if(NOT APPLE) ++ set_target_properties(tlx PROPERTIES VERSION "${TLX_VERSION}") ++ endif() + + target_compile_definitions(tlx PUBLIC ${TLX_DEFINITIONS}) + target_include_directories(tlx PUBLIC diff --git a/recipes/tlx/all/test_package/CMakeLists.txt b/recipes/tlx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e9517d8c4a071 --- /dev/null +++ b/recipes/tlx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tlx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tlx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tlx/all/test_package/conanfile.py b/recipes/tlx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tlx/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/tlx/all/test_package/test_package.cpp b/recipes/tlx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a043de0f1f924 --- /dev/null +++ b/recipes/tlx/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + tlx::ThreadPool threadpool; + return 0; +} diff --git a/recipes/tlx/all/test_v1_package/CMakeLists.txt b/recipes/tlx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tlx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tlx/all/test_v1_package/conanfile.py b/recipes/tlx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tlx/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/tlx/config.yml b/recipes/tlx/config.yml new file mode 100644 index 0000000000000..08dbe5e6d3977 --- /dev/null +++ b/recipes/tlx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.20200222": + folder: all diff --git a/recipes/tmx/all/conandata.yml b/recipes/tmx/all/conandata.yml new file mode 100644 index 0000000000000..015638445fd3e --- /dev/null +++ b/recipes/tmx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/baylej/tmx/archive/refs/tags/tmx_1.4.0.tar.gz" + sha256: "5ab52e72976141260edd1b15ea34e1626c0f4ba9b8d2afe7f4d68b51fc9fedf7" diff --git a/recipes/tmx/all/conanfile.py b/recipes/tmx/all/conanfile.py new file mode 100644 index 0000000000000..5a3b3214bc42f --- /dev/null +++ b/recipes/tmx/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.51.1" + + +class TmxConan(ConanFile): + name = "tmx" + description = "A portable C library to load tiled maps in your games." + license = "BSD-2-Clause" + topics = ("tmx", "tiled-map", "loader") + homepage = "https://github.com/baylej/tmx" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_zstd": False, + } + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libxml2/2.9.14") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + + 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["WANT_ZLIB"] = self.options.with_zlib + tc.variables["WANT_ZSTD"] = self.options.with_zstd + if self.options.with_zstd: + tc.variables["ZSTD_PREFER_STATIC"] = not self.dependencies["zstd"].options.shared + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"tmx": "tmx::tmx"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tmx") + self.cpp_info.set_property("cmake_target_name", "tmx") + self.cpp_info.libs = ["tmx"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("TMXEXPORT=__declspec(dllimport)") + + # 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/tmx/all/test_package/CMakeLists.txt b/recipes/tmx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..27410290350a8 --- /dev/null +++ b/recipes/tmx/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tmx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tmx) diff --git a/recipes/tmx/all/test_package/conanfile.py b/recipes/tmx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..da601c15e4dfc --- /dev/null +++ b/recipes/tmx/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + tmx_path = os.path.join(self.source_folder, "externtileset.tmx") + self.run(f"{bin_path} {tmx_path}", env="conanrun") diff --git a/recipes/tmx/all/test_package/externtileset.tmx b/recipes/tmx/all/test_package/externtileset.tmx new file mode 100644 index 0000000000000..a3c2b466d8f18 --- /dev/null +++ b/recipes/tmx/all/test_package/externtileset.tmx @@ -0,0 +1,60 @@ + + + + + + + + foo +bar +baz + + + + + + + + + + + + + +5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5, +5,5,3,6,6,3,3,3,1,1,1,1,1,3,1,1,1,1,1,1,3,3,3,4,4,3,1,3, +8,3,3,6,6,6,3,3,3,3,3,3,1,1,1,3,3,3,3,1,1,1,1,4,1,1,1,3, +8,3,3,6,6,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3, +8,3,6,6,6,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +8,3,6,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,9,9,9,3,3,3,3,3,3,3, +8,3,6,3,3,3,9,9,9,9,9,9,3,3,3,3,9,9,9,3,9,9,3,3,3,3,2,3, +8,3,3,3,9,9,9,3,3,3,3,9,3,3,3,9,9,3,3,3,3,9,9,3,3,3,2,3, +8,3,3,9,9,3,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,9,9,3,3,2,3, +8,3,3,9,9,3,3,7,7,3,3,9,9,3,3,3,3,3,7,7,3,3,3,9,3,3,2,3, +8,3,3,3,9,3,3,7,7,3,3,3,9,9,3,3,3,3,7,7,3,3,3,9,3,3,2,3, +8,3,3,3,9,9,3,3,3,4,4,4,4,4,4,4,3,3,3,3,3,9,3,9,3,3,2,3, +3,3,3,3,3,9,9,3,3,5,5,5,5,5,5,5,3,3,3,3,3,3,3,9,3,3,2,3, +3,3,3,3,3,3,9,9,3,6,6,6,6,6,6,6,9,9,9,9,3,3,3,9,3,3,2,3, +3,3,3,3,3,3,3,9,9,7,7,7,7,7,7,7,3,3,3,3,3,3,9,9,3,3,2,3, +3,3,3,3,3,3,3,3,3,8,8,8,8,8,8,8,3,3,3,3,9,9,9,3,3,3,2,2, +3,5,3,3,3,3,3,3,3,3,3,9,9,9,9,9,9,9,9,9,9,3,3,3,3,3,5,5, +5,5,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,5 + + + + + + + + + + + + + + + + Hello World + + + diff --git a/recipes/tmx/all/test_package/test_package.c b/recipes/tmx/all/test_package/test_package.c new file mode 100644 index 0000000000000..d790b96587936 --- /dev/null +++ b/recipes/tmx/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include + +int main(int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "Need at least one argument\n"); + return 1; + } + + tmx_map *map = tmx_load(argv[1]); + if (map == NULL) { + tmx_perror("Cannot load map"); + return 1; + } + tmx_map_free(map); + + return 0; +} diff --git a/recipes/tmx/all/test_package/tileset.tsx b/recipes/tmx/all/test_package/tileset.tsx new file mode 100644 index 0000000000000..bac88d71da58c --- /dev/null +++ b/recipes/tmx/all/test_package/tileset.tsx @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes/tmx/all/test_v1_package/CMakeLists.txt b/recipes/tmx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b3630d9b9ae2 --- /dev/null +++ b/recipes/tmx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tmx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tmx) diff --git a/recipes/tmx/all/test_v1_package/conanfile.py b/recipes/tmx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5654af76091cf --- /dev/null +++ b/recipes/tmx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + tmx_path = os.path.join(self.source_folder, os.pardir, "test_package", "externtileset.tmx") + self.run(f"{bin_path} {tmx_path}", run_environment=True) diff --git a/recipes/tmx/config.yml b/recipes/tmx/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/tmx/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/tmxlite/all/conandata.yml b/recipes/tmxlite/all/conandata.yml new file mode 100644 index 0000000000000..acb2db05df822 --- /dev/null +++ b/recipes/tmxlite/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.3.0": + url: "https://github.com/fallahn/tmxlite/archive/refs/tags/v1.3.0.tar.gz" + sha256: "f5d2abd23d4516168eb82bbe879998ce41cb17768f8cd72f643f394939123efe" +patches: + "1.3.0": + - patch_file: "patches/0001-include-external-pugixml.patch" + - patch_file: "patches/0002-cmake-link-external-miniz-pugixml.patch" diff --git a/recipes/tmxlite/all/conanfile.py b/recipes/tmxlite/all/conanfile.py new file mode 100644 index 0000000000000..44380126b8654 --- /dev/null +++ b/recipes/tmxlite/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class TmxliteConan(ConanFile): + name = "tmxlite" + description = "A lightweight C++14 parsing library for tmx map files created with the Tiled map editor." + license = "Zlib" + topics = ("tmxlite", "tmx", "tiled-map", "parser") + homepage = "https://github.com/fallahn/tmxlite" + 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, + } + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("miniz/2.2.0") + self.requires("pugixml/1.12.1") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("gcc < 5 not supported") + + 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["TMXLITE_STATIC_LIB"] = not self.options.shared + tc.variables["PROJECT_STATIC_RUNTIME"] = False + tc.variables["USE_RTTI"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # unvendor miniz + rm(self, "miniz*", os.path.join(self.source_folder, "tmxlite", "src")) + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), + "${PROJECT_DIR}/miniz.c", "") + # unvendor pugixml + rmdir(self, os.path.join(self.source_folder, "tmxlite", "src", "detail")) + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), + "${PROJECT_DIR}/detail/pugixml.cpp", "") + # Don't inject -O3 in compile flags + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "CMakeLists.txt"), + "-O3", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "tmxlite")) + 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 = collect_libs(self) + if not self.options.shared: + self.cpp_info.defines.append("TMXLITE_STATIC") + if self.settings.os == "Android": + self.cpp_info.system_libs.append("log", "android") diff --git a/recipes/tmxlite/all/patches/0001-include-external-pugixml.patch b/recipes/tmxlite/all/patches/0001-include-external-pugixml.patch new file mode 100644 index 0000000000000..bf49ae2efe517 --- /dev/null +++ b/recipes/tmxlite/all/patches/0001-include-external-pugixml.patch @@ -0,0 +1,99 @@ +--- a/tmxlite/src/ImageLayer.cpp ++++ b/tmxlite/src/ImageLayer.cpp +@@ -25,7 +25,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/LayerGroup.cpp ++++ b/tmxlite/src/LayerGroup.cpp +@@ -24,7 +24,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/Map.cpp ++++ b/tmxlite/src/Map.cpp +@@ -26,7 +26,7 @@ source distribution. + *********************************************************************/ + + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/Object.cpp ++++ b/tmxlite/src/Object.cpp +@@ -25,7 +25,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/ObjectGroup.cpp ++++ b/tmxlite/src/ObjectGroup.cpp +@@ -25,7 +25,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/ObjectTypes.cpp ++++ b/tmxlite/src/ObjectTypes.cpp +@@ -24,7 +24,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/Property.cpp ++++ b/tmxlite/src/Property.cpp +@@ -25,7 +25,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/TileLayer.cpp ++++ b/tmxlite/src/TileLayer.cpp +@@ -25,7 +25,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include +--- a/tmxlite/src/Tileset.cpp ++++ b/tmxlite/src/Tileset.cpp +@@ -25,7 +25,7 @@ and must not be misrepresented as being the original software. + source distribution. + *********************************************************************/ + +-#include "detail/pugixml.hpp" ++#include + #include + #include + #include diff --git a/recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch b/recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch new file mode 100644 index 0000000000000..f2ca8d92a2ca9 --- /dev/null +++ b/recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch @@ -0,0 +1,12 @@ +--- a/tmxlite/CMakeLists.txt ++++ b/tmxlite/CMakeLists.txt +@@ -70,6 +70,9 @@ else() + add_library(${PROJECT_NAME} SHARED ${PROJECT_SRC}) + endif() + endif() ++find_package(miniz REQUIRED CONFIG) ++find_package(pugixml REQUIRED CONFIG) ++target_link_libraries(${PROJECT_NAME} PRIVATE miniz::miniz pugixml::pugixml) + + target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + diff --git a/recipes/tmxlite/all/test_package/CMakeLists.txt b/recipes/tmxlite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..564eece99799e --- /dev/null +++ b/recipes/tmxlite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tmxlite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tmxlite::tmxlite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tmxlite/all/test_package/conanfile.py b/recipes/tmxlite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tmxlite/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/tmxlite/all/test_package/test_package.cpp b/recipes/tmxlite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..04e3345277f76 --- /dev/null +++ b/recipes/tmxlite/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + tmx::Object object; + return 0; +} diff --git a/recipes/tmxlite/all/test_v1_package/CMakeLists.txt b/recipes/tmxlite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ca4979c8e62d9 --- /dev/null +++ b/recipes/tmxlite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tmxlite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tmxlite::tmxlite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tmxlite/all/test_v1_package/conanfile.py b/recipes/tmxlite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tmxlite/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/tmxlite/config.yml b/recipes/tmxlite/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/tmxlite/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/tng/all/conandata.yml b/recipes/tng/all/conandata.yml new file mode 100644 index 0000000000000..80d49b1a4f2fd --- /dev/null +++ b/recipes/tng/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.8.2": + url: "https://gitlab.com/gromacs/tng/-/archive/v1.8.2/tng-v1.8.2.tar.gz" + sha256: "7010eb68e586efe23dd553b306ac1a4eea6a4b9028b32a3408744d9e4ae4205e" +patches: + "1.8.2": + - patch_file: "patches/0001-cmake-install.patch" + patch_description: "Install dll in bin folder" + patch_type: "portability" diff --git a/recipes/tng/all/conanfile.py b/recipes/tng/all/conanfile.py new file mode 100644 index 0000000000000..4a409ba3da2e2 --- /dev/null +++ b/recipes/tng/all/conanfile.py @@ -0,0 +1,82 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class tngConan(ConanFile): + name = "tng" + description = "External GROMACS library for loading tng files." + license = "BSD-3-Clause" + topics = ("tng", "gromacs") + homepage = "https://gitlab.com/gromacs/tng/" + 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, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + + 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["TNG_BUILD_OWN_ZLIB"] = False + tc.variables["TNG_BUILD_EXAMPLES"] = False + tc.variables["TNG_BUILD_TEST"] = False + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tng_io") + self.cpp_info.set_property("cmake_target_name", "tng_io::tng_io") + self.cpp_info.libs = ["tng_io"] + 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.names["cmake_find_package"] = "tng_io" + self.cpp_info.names["cmake_find_package_multi"] = "tng_io" diff --git a/recipes/tng/all/patches/0001-cmake-install.patch b/recipes/tng/all/patches/0001-cmake-install.patch new file mode 100644 index 0000000000000..b2fd6394cad25 --- /dev/null +++ b/recipes/tng/all/patches/0001-cmake-install.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bc6f8fd..602630e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,8 @@ configure_file( src/lib/tng_io-configVersion.cmake.in + install(TARGETS tng_io + EXPORT tng_io + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + + install(EXPORT tng_io FILE tng_io.cmake + NAMESPACE tng_io:: diff --git a/recipes/tng/all/test_package/CMakeLists.txt b/recipes/tng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30ebfd5167712 --- /dev/null +++ b/recipes/tng/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tng_io REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tng_io::tng_io) diff --git a/recipes/tng/all/test_package/conanfile.py b/recipes/tng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tng/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/tng/all/test_package/test_package.c b/recipes/tng/all/test_package/test_package.c new file mode 100644 index 0000000000000..4011fcb512236 --- /dev/null +++ b/recipes/tng/all/test_package/test_package.c @@ -0,0 +1,31 @@ +/* This code is part of the tng binary trajectory format. + * + * Written by Magnus Lundborg + * Copyright (c) 2012-2013, The GROMACS development team. + * check out http://www.gromacs.org for more information. + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Revised BSD License. + */ + +#include "tng/tng_io.h" + +#ifdef USE_STD_INTTYPES_H +#include +#endif + +#include +#include + +int main(int argc, char **argv) +{ + tng_trajectory_t traj; + if(tng_trajectory_init(&traj) != TNG_SUCCESS) + { + tng_trajectory_destroy(&traj); + exit(1); + } + tng_trajectory_destroy(&traj); + return 0; +} diff --git a/recipes/tng/all/test_v1_package/CMakeLists.txt b/recipes/tng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tng/all/test_v1_package/conanfile.py b/recipes/tng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2fc9de9b0d3fc --- /dev/null +++ b/recipes/tng/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/tng/config.yml b/recipes/tng/config.yml new file mode 100644 index 0000000000000..cf85ed78b488c --- /dev/null +++ b/recipes/tng/config.yml @@ -0,0 +1,3 @@ +versions: + "1.8.2": + folder: all diff --git a/recipes/toml11/all/conandata.yml b/recipes/toml11/all/conandata.yml new file mode 100644 index 0000000000000..473d7afa5e2db --- /dev/null +++ b/recipes/toml11/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.7.1": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.7.1.tar.gz" + sha256: "afeaa9aa0416d4b6b2cd3897ca55d9317084103077b32a852247d8efd4cf6068" + "3.7.0": + url: "https://github.com/ToruNiina/toml11/archive/v3.7.0.tar.gz" + sha256: "a0b6bec77c0e418eea7d270a4437510884f2fe8f61e7ab121729624f04c4b58e" + "3.6.1": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.6.1.tar.gz" + sha256: "ca4c390ed8da0d77ae6eca30e70ab0bf5cc92adfc1bc2f71a2066bc5656d8d96" + "3.6.0": + url: "https://github.com/ToruNiina/toml11/archive/v3.6.0.tar.gz" + sha256: "39e8d651db346ae8c7e3b39d6338a37232b9af3bba36ade45b241bf105c2226c" + "3.5.0": + url: "https://github.com/ToruNiina/toml11/archive/v3.5.0.tar.gz" + sha256: "fc613874c6e80dc740134a7353cf23c7f834b59cd601af84ab535ee16a53b1c3" + "3.4.0": + url: "https://github.com/ToruNiina/toml11/archive/v3.4.0.tar.gz" + sha256: "bc6d733efd9216af8c119d8ac64a805578c79cc82b813e4d1d880ca128bd154d" + "3.1.0": + url: "https://github.com/ToruNiina/toml11/archive/v3.1.0.tar.gz" + sha256: "3a118f32e5343998f37be9807c72fd11c3168fe12a5b1abfdc0f1e60de6380a4" diff --git a/recipes/toml11/all/conanfile.py b/recipes/toml11/all/conanfile.py new file mode 100644 index 0000000000000..72284ac7310c2 --- /dev/null +++ b/recipes/toml11/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class Toml11Conan(ConanFile): + name = "toml11" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ToruNiina/toml11" + description = "TOML for Modern C++" + topics = ("toml", "c-plus-plus-11", "c-plus-plus", "parser", "serializer") + license = "MIT" + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + 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")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "toml11") + self.cpp_info.set_property("cmake_target_name", "toml11::toml11") + self.cpp_info.bindirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "toml11")) + self.cpp_info.libdirs = [] diff --git a/recipes/toml11/all/test_package/CMakeLists.txt b/recipes/toml11/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6fbc21219d46f --- /dev/null +++ b/recipes/toml11/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(toml11 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE toml11::toml11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/toml11/all/test_package/conanfile.py b/recipes/toml11/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/toml11/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/toml11/all/test_package/test_package.cpp b/recipes/toml11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5e1bde5d58ef --- /dev/null +++ b/recipes/toml11/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +int main() +{ + std::stringstream sstr; + sstr << "title = 'an example toml file'"; + const auto data = toml::parse(sstr); + + std::string title = toml::find(data, "title"); + std::cout << "the title is " << title << std::endl; + + return 0; +} diff --git a/recipes/toml11/all/test_v1_package/CMakeLists.txt b/recipes/toml11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/toml11/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/toml11/all/test_v1_package/conanfile.py b/recipes/toml11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/toml11/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/toml11/config.yml b/recipes/toml11/config.yml new file mode 100644 index 0000000000000..2a3893e072fff --- /dev/null +++ b/recipes/toml11/config.yml @@ -0,0 +1,15 @@ +versions: + "3.7.1": + folder: all + "3.7.0": + folder: all + "3.6.1": + folder: all + "3.6.0": + folder: all + "3.5.0": + folder: all + "3.4.0": + folder: all + "3.1.0": + folder: all diff --git a/recipes/tomlplusplus/all/conandata.yml b/recipes/tomlplusplus/all/conandata.yml new file mode 100644 index 0000000000000..a459f949569ec --- /dev/null +++ b/recipes/tomlplusplus/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "3.3.0": + url: "https://github.com/marzer/tomlplusplus/archive/v3.3.0.tar.gz" + sha256: "fc1a5eb410f3c67e90e5ad1264a1386d020067cfb01b633cc8c0441789aa6cf2" + "3.2.0": + url: "https://github.com/marzer/tomlplusplus/archive/v3.2.0.tar.gz" + sha256: "aeba776441df4ac32e4d4db9d835532db3f90fd530a28b74e4751a2915a55565" + "3.1.0": + url: "https://github.com/marzer/tomlplusplus/archive/v3.1.0.tar.gz" + sha256: "dae72714fc356ca1b019298d9e6275cc41ba95546ae722ccdb6795e92f47762e" + "3.0.1": + url: "https://github.com/marzer/tomlplusplus/archive/v3.0.1.tar.gz" + sha256: "e05b2814b891e223d7546aa2408d6cba0628164a84ac453205c7743cb667b9cf" + "2.5.0": + url: "https://github.com/marzer/tomlplusplus/archive/v2.5.0.tar.gz" + sha256: "2e246ee126cfb7bd68edd7285d5bb5c8c5296121ce809306ee71cfd6127c76a6" + "1.3.3": + url: "https://github.com/marzer/tomlplusplus/archive/v1.3.3.tar.gz" + sha256: "1553cdecbfceb890da77895356ed471792e29362af701fe1f08b55c8a42ec746" diff --git a/recipes/tomlplusplus/all/conanfile.py b/recipes/tomlplusplus/all/conanfile.py new file mode 100644 index 0000000000000..44f523638d713 --- /dev/null +++ b/recipes/tomlplusplus/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import get, copy +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.51.3" + + +class TomlPlusPlusConan(ConanFile): + name = "tomlplusplus" + description = "Header-only TOML config file parser and serializer for modern C++." + topics = ("tomlformoderncpp", "tomlcpp", "toml", "json", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/marzer/tomlplusplus" + license = "MIT" + settings = ("compiler", "arch", "os", "build_type") + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16" if Version(self.version) < "2.2.0" or Version(self.version) >= "3.0.0" else "15", + "msvc": "192" if Version(self.version) < "2.2.0" or Version(self.version) >= "3.0.0" else "191", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + compiler = f"{self.settings.compiler} {self.settings.compiler.version}" + if not min_version: + self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} compiler support.") + else: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.ref} requires c++{self._minimum_cpp_standard} support." + " The current compiler {compiler} does not support it.") + + if self.settings.compiler == "apple-clang" and Version(self.version) < "2.3.0": + raise ConanInvalidConfiguration(f"The compiler {compiler} is supported in version >= 2.3.0") + + if is_msvc(self) and Version(self.version) == "2.1.0": + raise ConanInvalidConfiguration(f"The current compiler {compiler} is unable to build version 2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "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="*.inl", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="toml.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.set_property("cmake_file_name", "tomlplusplus") + self.cpp_info.set_property("cmake_target_name", "tomlplusplus::tomlplusplus") diff --git a/recipes/tomlplusplus/all/test_package/CMakeLists.txt b/recipes/tomlplusplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dfea477614e59 --- /dev/null +++ b/recipes/tomlplusplus/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tomlplusplus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tomlplusplus::tomlplusplus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if(NOT DEFINED TOMLPP_BUILD_SINGLE_ONLY) + add_executable(${PROJECT_NAME}_multi test_package_multi.cpp) + target_link_libraries(${PROJECT_NAME}_multi PRIVATE tomlplusplus::tomlplusplus) + target_compile_features(${PROJECT_NAME}_multi PRIVATE cxx_std_17) +endif() diff --git a/recipes/tomlplusplus/all/test_package/conanfile.py b/recipes/tomlplusplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..db279683bd8cc --- /dev/null +++ b/recipes/tomlplusplus/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, cmake_layout +from conan.tools.scm import Version +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) + if Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": + self.single_header_only = True + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + self.single_header_only = True + variables = {"TOMLPP_BUILD_SINGLE_ONLY": True} if hasattr(self, "single_header_only") else None + cmake.configure(variables=variables) + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + conf_path = os.path.join(self.recipe_folder, "configuration.toml") + self.run(f"{bin_path} {conf_path}", env="conanrun") + if not hasattr(self, "single_header_only"): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_multi") + self.run(f"{bin_path} {conf_path}", env="conanrun") diff --git a/recipes/tomlplusplus/all/test_package/configuration.toml b/recipes/tomlplusplus/all/test_package/configuration.toml new file mode 100644 index 0000000000000..75e4499e75630 --- /dev/null +++ b/recipes/tomlplusplus/all/test_package/configuration.toml @@ -0,0 +1,6 @@ +[library] +name = "toml++" +authors = ["Mark Gillard "] + +[dependencies] +cpp = 17 diff --git a/recipes/tomlplusplus/all/test_package/test_package.cpp b/recipes/tomlplusplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d50b3c6469741 --- /dev/null +++ b/recipes/tomlplusplus/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include // Single header + +#include //required for toml::parse_file() +#include + +using namespace std::string_view_literals; + +int main(int argc, char* argv[]) { + auto config = toml::parse_file(argv[1]); + + // 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); + + // modify the data + config.insert_or_assign("alternatives", toml::array{ + "cpptoml", + "toml11", + "Boost.TOML" + }); + + // iterate & visit over the data + for (auto&& [k, v] : config) + { + v.visit([](auto& node) noexcept + { + std::cout << node << std::endl; + }); + } + + // re-serialize as TOML + std::cout << config << std::endl; + + // re-serialize as JSON + std::cout << toml::json_formatter{ config } << 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 new file mode 100644 index 0000000000000..df195938cfdee --- /dev/null +++ b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp @@ -0,0 +1,38 @@ +#include // Multiple Headers + +#include //required for toml::parse_file() +#include + +using namespace std::string_view_literals; + +int main(int argc, char* argv[]) { + auto config = toml::parse_file(argv[1]); + + // 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); + + // modify the data + config.insert_or_assign("alternatives", toml::array{ + "cpptoml", + "toml11", + "Boost.TOML" + }); + + // iterate & visit over the data + for (auto&& [k, v] : config) + { + v.visit([](auto& node) noexcept + { + std::cout << node << std::endl; + }); + } + + // re-serialize as TOML + std::cout << config << std::endl; + + // re-serialize as JSON + std::cout << toml::json_formatter{ config } << std::endl; + return 0; +} diff --git a/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt b/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a6b6b2e67ed13 --- /dev/null +++ b/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/tomlplusplus/all/test_v1_package/conanfile.py b/recipes/tomlplusplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..aba957cc3efa9 --- /dev/null +++ b/recipes/tomlplusplus/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake +from conan.tools.scm import Version +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + if Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": + self.single_header_only = True + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + self.single_header_only = True + if hasattr(self, "single_header_only"): + cmake.definitions["TOMLPP_BUILD_SINGLE_ONLY"] = True + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + conf_path = os.path.join(self.recipe_folder, "..", "test_package", "configuration.toml") + self.run(f"{bin_path} {conf_path}", run_environment=True) + if not hasattr(self, "single_header_only"): + bin_path = os.path.join("bin", "test_package_multi") + self.run(f"{bin_path} {conf_path}", run_environment=True) diff --git a/recipes/tomlplusplus/config.yml b/recipes/tomlplusplus/config.yml new file mode 100644 index 0000000000000..4cd7ca8687e68 --- /dev/null +++ b/recipes/tomlplusplus/config.yml @@ -0,0 +1,13 @@ +versions: + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.1": + folder: all + "2.5.0": + folder: all + "1.3.3": + folder: all diff --git a/recipes/tracy/all/conandata.yml b/recipes/tracy/all/conandata.yml new file mode 100644 index 0000000000000..266a1ecb7f6b1 --- /dev/null +++ b/recipes/tracy/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.9": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.tar.gz" + sha256: "93a91544e3d88f3bc4c405bad3dbc916ba951cdaadd5fcec1139af6fa56e6bfc" + "0.8.2.1": + url: "https://github.com/wolfpld/tracy/archive/v0.8.2.1.tar.gz" + sha256: "97f478579efa1f5ce4c8619014a20327010fea122c21248701fe2bbb46ec1c1f" + "0.8.1": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.8.1.tar.gz" + sha256: "004992012b2dc879a9f6d143cbf94d7ea30e88135db3ef08951605d214892891" + "cci.20220130": + url: "https://github.com/wolfpld/tracy/archive/361782f3fdbeaefb9697f8fabe9d14e6b5d18f75.tar.gz" + sha256: "9267964f39be6bf419318ab5ac01c8a2b8dd921696c18164f133ee7b18bcb00b" diff --git a/recipes/tracy/all/conanfile.py b/recipes/tracy/all/conanfile.py new file mode 100644 index 0000000000000..bdb852b534295 --- /dev/null +++ b/recipes/tracy/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class TracyConan(ConanFile): + name = "tracy" + description = "C++ frame profiler" + topics = ("profiler", "performance", "gamedev") + homepage = "https://github.com/wolfpld/tracy" + url = "https://github.com/conan-io/conan-center-index" + license = ["BSD-3-Clause"] + settings = "os", "arch", "compiler", "build_type" + + # Existing CMake tracy options with default value + _tracy_options = { + "enable": ([True, False], True), + "on_demand": ([True, False], False), + "callstack": ([True, False], False), + "no_callstack": ([True, False], False), + "no_callstack_inlines": ([True, False], False), + "only_localhost": ([True, False], False), + "no_broadcast": ([True, False], False), + "only_ipv": ([True, False], False), + "no_code_transfer": ([True, False], False), + "no_context_switch": ([True, False], False), + "no_exit": ([True, False], False), + "no_sampling": ([True, False], False), + "no_verify": ([True, False], False), + "no_vsync_capture": ([True, False], False), + "no_frame_image": ([True, False], False), + "no_system_tracing": ([True, False], False), + "delayed_init": ([True, False], False), + } + options = { + "shared": [True, False], + "fPIC": [True, False], + **{k: v[0] for k, v in _tracy_options.items()}, + } + default_options = { + "shared": False, + "fPIC": True, + **{k: v[1] for k, v in _tracy_options.items()}, + } + + 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.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Set all tracy options in the correct form + # For example, TRACY_NO_EXIT + for opt in self._tracy_options.keys(): + switch = getattr(self.options, opt) + opt = f"TRACY_{opt.upper()}" + tc.variables[opt] = switch + 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, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Tracy") + self.cpp_info.set_property("cmake_target_name", "Tracy::TracyClient") + # TODO: back to global scope in conan v2 + self.cpp_info.components["tracyclient"].libs = ["TracyClient"] + if self.options.shared: + self.cpp_info.components["tracyclient"].defines.append( + "TRACY_IMPORTS") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tracyclient"].system_libs.append( + "pthread") + if self.settings.os == "Linux": + self.cpp_info.components["tracyclient"].system_libs.append("dl") + + # Tracy CMake adds options set to ON as public + for opt in self._tracy_options.keys(): + switch = getattr(self.options, opt) + opt = f"TRACY_{opt.upper()}" + if switch: + self.cpp_info.components["tracyclient"].defines.append(opt) + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "Tracy" + self.cpp_info.names["cmake_find_package_multi"] = "Tracy" + self.cpp_info.components["tracyclient"].names["cmake_find_package"] = "TracyClient" + self.cpp_info.components["tracyclient"].names["cmake_find_package_multi"] = "TracyClient" + self.cpp_info.components["tracyclient"].set_property( + "cmake_target_name", "Tracy::TracyClient") diff --git a/recipes/tracy/all/test_package/CMakeLists.txt b/recipes/tracy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a21a716d47b2b --- /dev/null +++ b/recipes/tracy/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Tracy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Tracy::TracyClient) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(Tracy_VERSION VERSION_GREATER_EQUAL "0.9") + target_compile_definitions(${PROJECT_NAME} PRIVATE TRACY_GE_0_9) +endif() diff --git a/recipes/tracy/all/test_package/conanfile.py b/recipes/tracy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/tracy/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tracy/all/test_package/test_package.cpp b/recipes/tracy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3063aab0b6e28 --- /dev/null +++ b/recipes/tracy/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#ifdef TRACY_GE_0_9 +#include +#else +#include +#endif + +int main(int argc, char **argv) { + ZoneScopedN("main"); + + return 0; +} diff --git a/recipes/tracy/all/test_v1_package/CMakeLists.txt b/recipes/tracy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/tracy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tracy/all/test_v1_package/conanfile.py b/recipes/tracy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tracy/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/tracy/config.yml b/recipes/tracy/config.yml new file mode 100644 index 0000000000000..77aaa018b1794 --- /dev/null +++ b/recipes/tracy/config.yml @@ -0,0 +1,9 @@ +versions: + "0.9": + folder: all + "0.8.2.1": + folder: all + "0.8.1": + folder: all + "cci.20220130": + folder: all diff --git a/recipes/transwarp/all/conandata.yml b/recipes/transwarp/all/conandata.yml new file mode 100644 index 0000000000000..ecfa9f3160606 --- /dev/null +++ b/recipes/transwarp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.2.3": + url: "https://github.com/bloomen/transwarp/archive/2.2.3.tar.gz" + sha256: "258ef6d511390bf813e4c33faed37556812acd273126cc02c3aea51fee359400" + "2.2.2": + url: "https://github.com/bloomen/transwarp/archive/refs/tags/2.2.2.tar.gz" + sha256: "0458aebbcef0d1cf1949cfc1fce6e5aa902226622783f6eb97f7716a711c8b4d" diff --git a/recipes/transwarp/all/conanfile.py b/recipes/transwarp/all/conanfile.py new file mode 100644 index 0000000000000..7f3db7cd491f8 --- /dev/null +++ b/recipes/transwarp/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TranswarpConan(ConanFile): + name = "transwarp" + description = "A header-only C++ library for task concurrency." + license = "MIT" + topics = ("transwarp", "concurrency", "asynchronous") + homepage = "https://github.com/bloomen/transwarp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + 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, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/transwarp/all/test_package/CMakeLists.txt b/recipes/transwarp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb80581dc80e9 --- /dev/null +++ b/recipes/transwarp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(transwarp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE transwarp::transwarp) +target_compile_definitions(${PROJECT_NAME} PRIVATE TRANSWARP_CPP11) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/transwarp/all/test_package/conanfile.py b/recipes/transwarp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/transwarp/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/transwarp/all/test_package/test_package.cpp b/recipes/transwarp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..13632d2df8d3f --- /dev/null +++ b/recipes/transwarp/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include + +#include +#include + +int main() { + double x = 0; + int y = 0; + + auto parent1 = transwarp::make_task( + transwarp::root, + [&x]() { return 13.3 + x; } + )->named("something"); + auto parent2 = transwarp::make_task( + transwarp::root, + [&y]() { return 42 + y; } + )->named("something else"); + auto child = transwarp::make_task( + transwarp::consume, + [](double a, int b) { return a + b; }, + parent1, + parent2 + )->named("adder"); + + transwarp::parallel executor{4}; + + child->schedule_all(executor); + std::cout << "result = " << child->get() << std::endl; + + x += 2.5; + y += 1; + + child->schedule_all(executor); + std::cout << "result = " << child->get() << std::endl; + + std::ofstream{"basic_with_three_tasks.dot"} << transwarp::to_string(child->edges()); + + return 0; +} diff --git a/recipes/transwarp/all/test_v1_package/CMakeLists.txt b/recipes/transwarp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5ef1888af073 --- /dev/null +++ b/recipes/transwarp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(transwarp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE transwarp::transwarp) +target_compile_definitions(${PROJECT_NAME} PRIVATE TRANSWARP_CPP11) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/transwarp/all/test_v1_package/conanfile.py b/recipes/transwarp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/transwarp/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/transwarp/config.yml b/recipes/transwarp/config.yml new file mode 100644 index 0000000000000..50f7c7bf3ca4e --- /dev/null +++ b/recipes/transwarp/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.3": + folder: all + "2.2.2": + folder: all diff --git a/recipes/trantor/all/conandata.yml b/recipes/trantor/all/conandata.yml new file mode 100644 index 0000000000000..6649410b0f203 --- /dev/null +++ b/recipes/trantor/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.5.11": + url: "https://github.com/an-tao/trantor/archive/v1.5.11.tar.gz" + sha256: "3cff9653380f65acaa6ffa191620a2783e866a4552c3408a6919759ce4cfc1dc" + "1.5.10": + url: "https://github.com/an-tao/trantor/archive/v1.5.10.tar.gz" + sha256: "2d47775b3091a1a103bea46f5da017dc03c39883f8d717cf6ba24bdcdf01a15d" + "1.5.8": + url: "https://github.com/an-tao/trantor/archive/v1.5.8.tar.gz" + sha256: "705ec0176681be5c99fcc7af37416ece9d65ff4d907bca764cb11471b104fbf8" + "1.5.7": + url: "https://github.com/an-tao/trantor/archive/v1.5.7.tar.gz" + sha256: "42576563afbf1e58c7d68f758cf3fca4d193496d4e3f82c80069d8389a7839d5" + "1.5.6": + url: "https://github.com/an-tao/trantor/archive/v1.5.6.tar.gz" + sha256: "827aca30e120244a8ede9d07446481328d9a3869228f01fc4978b19301d66e65" + "1.5.5": + url: "https://github.com/an-tao/trantor/archive/refs/tags/v1.5.5.tar.gz" + sha256: "5a549c6efebe7ecba73a944cfba4a9713130704d4ccc82af534a2e108b9a0e71" diff --git a/recipes/trantor/all/conanfile.py b/recipes/trantor/all/conanfile.py new file mode 100644 index 0000000000000..2e4e5da0c655a --- /dev/null +++ b/recipes/trantor/all/conanfile.py @@ -0,0 +1,126 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + +class TrantorConan(ConanFile): + name = "trantor" + description = "a non-blocking I/O tcp network lib based on c++14/17" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/an-tao/trantor" + topics = ("tcp-server", "asynchronous-programming", "non-blocking-io") + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + "with_c_ares": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "with_c_ares": True, + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "15.0", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("openssl/[>=1.1 <4]") + if self.options.with_c_ares: + self.requires("c-ares/1.19.0") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version: + if Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + else: + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}.") + + # TODO: Compilation succeeds, but execution of test_package fails on Visual Studio with MDd + if is_msvc(self) and self.options.shared and "MDd" in msvc_runtime_flag(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support the MDd runtime on Visual Studio.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "1.5.6": + tc.variables["BUILD_TRANTOR_SHARED"] = self.options.shared + else: + # Trantor's CMakeLists.txt has BUILD_SHARED_LIBS option. + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_C-ARES"] = self.options.with_c_ares + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # fix c-ares imported target + replace_in_file(self, cmakelists, "c-ares_lib", "c-ares::cares") + # Cleanup rpath in shared lib + replace_in_file(self, cmakelists, "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}\")", "") + + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Trantor") + self.cpp_info.set_property("cmake_target_name", "Trantor::Trantor") + self.cpp_info.libs = ["trantor"] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Trantor" + self.cpp_info.names["cmake_find_package_multi"] = "Trantor" diff --git a/recipes/trantor/all/test_package/CMakeLists.txt b/recipes/trantor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..96e466512e5b2 --- /dev/null +++ b/recipes/trantor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Trantor CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Trantor::Trantor) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/trantor/all/test_package/conanfile.py b/recipes/trantor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/trantor/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/trantor/all/test_package/test_package.cpp b/recipes/trantor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7edcc1a7a91f8 --- /dev/null +++ b/recipes/trantor/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +#include +#include +#include + +#ifndef _WIN32 +#include +#endif + +int main() { + std::atomic flag(false); + { + trantor::EventLoopThread thr; + thr.getLoop()->runOnQuit([&]() { flag = true; }); + thr.run(); + thr.getLoop()->quit(); + } + + if (flag == false) { + std::cerr << "Test failed\n"; + } + else { + std::cout << "Success\n"; + } + + return 0; +} diff --git a/recipes/trantor/all/test_v1_package/CMakeLists.txt b/recipes/trantor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/trantor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/trantor/all/test_v1_package/conanfile.py b/recipes/trantor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/trantor/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/trantor/config.yml b/recipes/trantor/config.yml new file mode 100644 index 0000000000000..57e22ce3a2fae --- /dev/null +++ b/recipes/trantor/config.yml @@ -0,0 +1,13 @@ +versions: + "1.5.11": + folder: "all" + "1.5.10": + folder: "all" + "1.5.8": + folder: "all" + "1.5.7": + folder: "all" + "1.5.6": + folder: "all" + "1.5.5": + folder: "all" diff --git a/recipes/tree-sitter-c/all/CMakeLists.txt b/recipes/tree-sitter-c/all/CMakeLists.txt new file mode 100644 index 0000000000000..2d76c83c9cbd4 --- /dev/null +++ b/recipes/tree-sitter-c/all/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.0) +project(tree-sitter-c C) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tree-sitter REQUIRED CONFIG) +include(GenerateExportHeader) + +file(WRITE api.h [[ +#pragma once +#include +#include "tree_sitter_c_export.h" + +TREE_SITTER_C_EXPORT const TSLanguage *tree_sitter_c(void); +]]) + +add_library(${PROJECT_NAME} + source_subfolder/src/parser.c +) +target_link_libraries(${PROJECT_NAME} + PUBLIC + tree-sitter::tree-sitter +) +target_include_directories(${PROJECT_NAME} + PRIVATE + $ + $ +) +set_target_properties(${PROJECT_NAME} + PROPERTIES + C_STANDARD 99 + PUBLIC_HEADER "api.h;${CMAKE_CURRENT_BINARY_DIR}/tree_sitter_c_export.h" +) +generate_export_header(${PROJECT_NAME} + BASE_NAME TREE_SITTER_C + EXPORT_FILE_NAME "tree_sitter_c_export.h" +) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tree_sitter_c" +) diff --git a/recipes/tree-sitter-c/all/conandata.yml b/recipes/tree-sitter-c/all/conandata.yml new file mode 100644 index 0000000000000..fe7f567397167 --- /dev/null +++ b/recipes/tree-sitter-c/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.20.2": + url: "https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz" + sha256: "af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2" + "0.20.1": + url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.20.1.tar.gz" + sha256: "ffcc2ef0eded59ad1acec9aec4f9b0c7dd209fc1a85d85f8b0e81298e3dddcc2" diff --git a/recipes/tree-sitter-c/all/conanfile.py b/recipes/tree-sitter-c/all/conanfile.py new file mode 100644 index 0000000000000..84ab13ea08213 --- /dev/null +++ b/recipes/tree-sitter-c/all/conanfile.py @@ -0,0 +1,73 @@ +from conans import CMake, ConanFile, tools +import functools +import os + +required_conan_version = ">=1.33.0" + + +class TreeSitterCConan(ConanFile): + name = "tree-sitter-c" + description = "C grammar for tree-sitter." + topics = ("parser", "grammar", "tree", "c", "ide") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tree-sitter/tree-sitter-c" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + generators = "cmake", "cmake_find_package_multi" + exports_sources = "CMakeLists.txt" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("tree-sitter/0.20.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def _patch_sources(self): + if not self.options.shared: + tools.replace_in_file( + os.path.join(self._source_subfolder, "src", "parser.c"), + "__declspec(dllexport)", "" + ) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["tree-sitter-c"] diff --git a/recipes/tree-sitter-c/all/test_package/CMakeLists.txt b/recipes/tree-sitter-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..48140fe26ab46 --- /dev/null +++ b/recipes/tree-sitter-c/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tree-sitter-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} tree-sitter-c::tree-sitter-c) diff --git a/recipes/tree-sitter-c/all/test_package/conanfile.py b/recipes/tree-sitter-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tree-sitter-c/all/test_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/tree-sitter-c/all/test_package/test_package.c b/recipes/tree-sitter-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..d5f86eae18cce --- /dev/null +++ b/recipes/tree-sitter-c/all/test_package/test_package.c @@ -0,0 +1,27 @@ +#include +#include + +#include +#include + +int main() { + TSParser *parser = ts_parser_new(); + ts_parser_set_language(parser, tree_sitter_c()); + const char *source_code = "int a[] = {42, 1337};\n"; + TSTree *tree = ts_parser_parse_string( + parser, + NULL, + source_code, + strlen(source_code) + ); + TSNode root_node = ts_tree_root_node(tree); + + char *string = ts_node_string(root_node); + printf("Syntax tree: %s\n", string); + free(string); + + ts_tree_delete(tree); + ts_parser_delete(parser); + return 0; +} + diff --git a/recipes/tree-sitter-c/config.yml b/recipes/tree-sitter-c/config.yml new file mode 100644 index 0000000000000..8304408636b4b --- /dev/null +++ b/recipes/tree-sitter-c/config.yml @@ -0,0 +1,5 @@ +versions: + "0.20.2": + folder: all + "0.20.1": + folder: all diff --git a/recipes/tree-sitter/all/CMakeLists.txt b/recipes/tree-sitter/all/CMakeLists.txt new file mode 100644 index 0000000000000..2d67e95f598b6 --- /dev/null +++ b/recipes/tree-sitter/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.4) +project(tree-sitter C) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +# Use cmake script instead of Makefile to support MSVC + follow fPIC option + +file(GLOB SOURCES RELATIVE "${PROJECT_SOURCE_DIR}" source_subfolder/lib/src/*.c) +list(REMOVE_ITEM SOURCES source_subfolder/lib/src/lib.c) + +file(GLOB HEADERS source_subfolder/lib/include/tree_sitter/*.h) + +add_library(${PROJECT_NAME} ${SOURCES}) +target_include_directories(${PROJECT_NAME} + PRIVATE + $ + $ +) +set_target_properties(${PROJECT_NAME} + PROPERTIES + C_STANDARD 99 + PUBLIC_HEADER "${HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tree_sitter" +) diff --git a/recipes/tree-sitter/all/conandata.yml b/recipes/tree-sitter/all/conandata.yml new file mode 100644 index 0000000000000..d0e08afc47bc9 --- /dev/null +++ b/recipes/tree-sitter/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.20.6": + url: "https://github.com/tree-sitter/tree-sitter/archive/v0.20.6.tar.gz" + sha256: "4d37eaef8a402a385998ff9aca3e1043b4a3bba899bceeff27a7178e1165b9de" + "0.20.0": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.20.0.tar.gz" + sha256: "4a8070b9de17c3b8096181fe8530320ab3e8cca685d8bee6a3e8d164b5fb47da" + "0.17.3": + url: "https://github.com/tree-sitter/tree-sitter/archive/0.17.3.tar.gz" + sha256: "a897e5c9a7ccb74271d9b20d59121d2d2e9de8b896c4d1cfaac0f8104c1ef9f8" diff --git a/recipes/tree-sitter/all/conanfile.py b/recipes/tree-sitter/all/conanfile.py new file mode 100644 index 0000000000000..0ab58caffc58f --- /dev/null +++ b/recipes/tree-sitter/all/conanfile.py @@ -0,0 +1,62 @@ +from conans import CMake, ConanFile, tools +import functools + +required_conan_version = ">=1.33.0" + + +class TreeSitterConan(ConanFile): + name = "tree-sitter" + description = "Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited." + topics = ("parser", "incremental", "rust") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tree-sitter.github.io/tree-sitter" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + generators = "cmake" + exports_sources = "CMakeLists.txt" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.names["pkg_config"] = "tree-sitter" + self.cpp_info.libs = ["tree-sitter"] diff --git a/recipes/tree-sitter/all/test_package/CMakeLists.txt b/recipes/tree-sitter/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1f6c3d19b27a6 --- /dev/null +++ b/recipes/tree-sitter/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tree-sitter REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} tree-sitter::tree-sitter) diff --git a/recipes/tree-sitter/all/test_package/conanfile.py b/recipes/tree-sitter/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tree-sitter/all/test_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/tree-sitter/all/test_package/test_package.c b/recipes/tree-sitter/all/test_package/test_package.c new file mode 100644 index 0000000000000..6ed5f62951a82 --- /dev/null +++ b/recipes/tree-sitter/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +//More detailed example search at https://tree-sitter.github.io/tree-sitter/using-parsers#getting-started +int main() { + TSParser *parser = ts_parser_new(); + ts_parser_delete(parser); + return 0; +} diff --git a/recipes/tree-sitter/config.yml b/recipes/tree-sitter/config.yml new file mode 100644 index 0000000000000..be011f8935f2a --- /dev/null +++ b/recipes/tree-sitter/config.yml @@ -0,0 +1,7 @@ +versions: + "0.20.6": + folder: all + "0.20.0": + folder: all + "0.17.3": + folder: all diff --git a/recipes/troldal-zippy/all/conandata.yml b/recipes/troldal-zippy/all/conandata.yml new file mode 100644 index 0000000000000..0c73d6b1de095 --- /dev/null +++ b/recipes/troldal-zippy/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20200622": + url: "https://github.com/troldal/Zippy/archive/a838de8522f9051df0d1b202473bb6befe648702.tar.gz" + sha256: "8be803861b69c51179ade1f2ce62f07fb1f2d301a084d705c8ec2374db22071a" +patches: + "cci.20200622": + - patch_file: "patches/zippy-archive-mkdir.patch" + base_path: "source_subfolder" diff --git a/recipes/troldal-zippy/all/conanfile.py b/recipes/troldal-zippy/all/conanfile.py new file mode 100644 index 0000000000000..9264f7d6a36ec --- /dev/null +++ b/recipes/troldal-zippy/all/conanfile.py @@ -0,0 +1,68 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class TroldalZippyConan(ConanFile): + name = "troldal-zippy" + description = "A simple C++ wrapper around the \"miniz\" zip library " + topics = ("wrapper", "compression", "zip") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/troldal/Zippy" + license = "MIT" + settings = "compiler" + exports_sources = "patches/*" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("miniz/2.2.0") + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "17", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + 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)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "library")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + # To match the target created here + # https://github.com/troldal/Zippy/blob/a838de8522f9051df0d1b202473bb6befe648702/library/CMakeLists.txt#L10 + self.cpp_info.filenames["cmake_find_package"] = "Zippy" + self.cpp_info.filenames["cmake_find_package_multi"] = "Zippy" + self.cpp_info.names["cmake_find_package"] = "Zippy" + self.cpp_info.names["cmake_find_package_multi"] = "Zippy" diff --git a/recipes/troldal-zippy/all/patches/zippy-archive-mkdir.patch b/recipes/troldal-zippy/all/patches/zippy-archive-mkdir.patch new file mode 100644 index 0000000000000..e2ca3447dc4c6 --- /dev/null +++ b/recipes/troldal-zippy/all/patches/zippy-archive-mkdir.patch @@ -0,0 +1,17 @@ +--- library/Zippy/ZipArchive.hpp ++++ library/Zippy/ZipArchive.hpp +@@ -37,6 +37,14 @@ + #include + #include + ++#ifdef _WIN32 ++#include ++#else ++#include ++#include ++#include ++#endif ++ + // ===== Other Includes + #include "miniz/miniz.h" + #include "ZipException.hpp" diff --git a/recipes/troldal-zippy/all/test_package/CMakeLists.txt b/recipes/troldal-zippy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c1d84c7e3d82 --- /dev/null +++ b/recipes/troldal-zippy/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/troldal-zippy/all/test_package/conanfile.py b/recipes/troldal-zippy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/troldal-zippy/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/troldal-zippy/all/test_package/test_package.cpp b/recipes/troldal-zippy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7602dea7f0282 --- /dev/null +++ b/recipes/troldal-zippy/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + Zippy::ZipArchive archive; + return 0; +} diff --git a/recipes/troldal-zippy/config.yml b/recipes/troldal-zippy/config.yml new file mode 100644 index 0000000000000..533f65966b8a1 --- /dev/null +++ b/recipes/troldal-zippy/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200622": + folder: "all" diff --git a/recipes/trompeloeil/all/conandata.yml b/recipes/trompeloeil/all/conandata.yml new file mode 100644 index 0000000000000..bb27ac3c59d8a --- /dev/null +++ b/recipes/trompeloeil/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "43": + url: "https://github.com/rollbear/trompeloeil/archive/v43.tar.gz" + sha256: "86a0afa2e97347202a0a883ab43da78c1d4bfff0d6cb93205cfc433d0d9eb9eb" + "42": + url: "https://github.com/rollbear/trompeloeil/archive/v42.tar.gz" + sha256: "96f3b518eeb609216f8f5ba5cf9314181d1d340ebbf25a73ee63a482a669cc4c" + "41": + url: "https://github.com/rollbear/trompeloeil/archive/v41.tar.gz" + sha256: "48986b507497f027e4fa1144a08c2d0b6d81fb476fad024956f8104448ca9ad8" + "40": + url: "https://github.com/rollbear/trompeloeil/archive/v40.tar.gz" + sha256: "e13e3649223a358a5a72fa5a8a1c36325b48e4f3d9d2f2277b17d746797e1734" + "39": + url: https://github.com/rollbear/trompeloeil/archive/v39.tar.gz + sha256: 10506E48ABD605740BC9ED43E34059F5068BC80AF14476BD129A3ED3B54D522F diff --git a/recipes/trompeloeil/all/conanfile.py b/recipes/trompeloeil/all/conanfile.py new file mode 100644 index 0000000000000..c2548bfe997b8 --- /dev/null +++ b/recipes/trompeloeil/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TrompeloeilConan(ConanFile): + name = "trompeloeil" + description = "Header only C++14 mocking framework" + topics = ("trompeloeil", "header-only", "mocking") + homepage = "https://github.com/rollbear/trompeloeil" + url = "https://github.com/conan-io/conan-center-index" + license = "BSL-1.0" + 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, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE*.txt", 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "trompeloeil") + self.cpp_info.set_property("cmake_target_name", "trompeloeil::trompeloeil") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/trompeloeil/all/test_package/CMakeLists.txt b/recipes/trompeloeil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ecb1ebf14da1c --- /dev/null +++ b/recipes/trompeloeil/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(trompeloeil REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE trompeloeil::trompeloeil) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/trompeloeil/all/test_package/conanfile.py b/recipes/trompeloeil/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/trompeloeil/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/trompeloeil/all/test_package/test_package.cpp b/recipes/trompeloeil/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..356b535560158 --- /dev/null +++ b/recipes/trompeloeil/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +struct S +{ + MAKE_MOCK1(func, void(int)); +}; + +int main() { + S s; + REQUIRE_CALL(s, func(3)); + s.func(3); +} diff --git a/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt b/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..328f7742d99d6 --- /dev/null +++ b/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(trompeloeil REQUIRED) + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE trompeloeil::trompeloeil) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/trompeloeil/all/test_v1_package/conanfile.py b/recipes/trompeloeil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/trompeloeil/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/trompeloeil/config.yml b/recipes/trompeloeil/config.yml new file mode 100644 index 0000000000000..26645b05ba8da --- /dev/null +++ b/recipes/trompeloeil/config.yml @@ -0,0 +1,11 @@ +versions: + "43": + folder: all + "42": + folder: all + "41": + folder: all + "40": + folder: all + "39": + folder: all diff --git a/recipes/tscns/all/conandata.yml b/recipes/tscns/all/conandata.yml new file mode 100644 index 0000000000000..953de47361755 --- /dev/null +++ b/recipes/tscns/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + # upstream don't create tag for releases + "2.0": + url: "https://github.com/MengRao/tscns/archive/40240b92fc9431710005faccb422d3dbdcb324dd.tar.gz" + sha256: "5564f9984e7984a68b767ed44acc70ba605300511bcd7673aa46c207e907263d" + +patches: + "2.0": + - patch_file: "patches/0001-include-thread.patch" + patch_description: "include thread header (this patch is already applied upstream)" + patch_type: "backport" + patch_source: "https://github.com/MengRao/tscns/commit/3d9179de9af88358eef66d9f03c8e2126d35296a" + - patch_file: "patches/0002-support-older-compiler.patch" + patch_description: "support older compiler by fix initializer" + patch_type: "backport" diff --git a/recipes/tscns/all/conanfile.py b/recipes/tscns/all/conanfile.py new file mode 100644 index 0000000000000..f9a1b573dbe33 --- /dev/null +++ b/recipes/tscns/all/conanfile.py @@ -0,0 +1,56 @@ +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.build import check_min_cppstd +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.52.0" + +class TscnsConan(ConanFile): + name = "tscns" + description = "A low overhead nanosecond clock based on x86 TSC" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MengRao/tscns/" + topics = ("timestamp", "x86_64", "header-only") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration(f"{self.ref} supports x86_64 only.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="tscns.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tscns/all/patches/0001-include-thread.patch b/recipes/tscns/all/patches/0001-include-thread.patch new file mode 100644 index 0000000000000..5a125217b7fa0 --- /dev/null +++ b/recipes/tscns/all/patches/0001-include-thread.patch @@ -0,0 +1,12 @@ +diff --git a/tscns.h b/tscns.h +index e66153d..a7c9a73 100644 +--- a/tscns.h ++++ b/tscns.h +@@ -25,6 +25,7 @@ SOFTWARE. + #pragma once + #include + #include ++#include + + #ifdef _MSC_VER + #include diff --git a/recipes/tscns/all/patches/0002-support-older-compiler.patch b/recipes/tscns/all/patches/0002-support-older-compiler.patch new file mode 100644 index 0000000000000..078437e591d8f --- /dev/null +++ b/recipes/tscns/all/patches/0002-support-older-compiler.patch @@ -0,0 +1,13 @@ +diff --git a/tscns.h b/tscns.h +index e66153d..a7c9a73 100644 +--- a/tscns.h ++++ b/tscns.h +@@ -139,7 +139,7 @@ public: + param_seq.store(++seq, std::memory_order_release); + } + +- alignas(64) std::atomic param_seq = 0; ++ alignas(64) std::atomic param_seq{0}; + double ns_per_tsc = 1.0; + int64_t ns_offset = 0; + int64_t calibate_interval_ns; diff --git a/recipes/tscns/all/test_package/CMakeLists.txt b/recipes/tscns/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..46909114bb657 --- /dev/null +++ b/recipes/tscns/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tscns REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tscns::tscns) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tscns/all/test_package/conanfile.py b/recipes/tscns/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/tscns/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tscns/all/test_package/test_package.cpp b/recipes/tscns/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2383256ac42ac --- /dev/null +++ b/recipes/tscns/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include + +#include "tscns.h" + +int main() { + TSCNS tn; + tn.init(); + + std::cout << tn.getTscGhz() << std::endl; + + uint64_t count = (tn.rdns() % 100u) + 1; + + uint64_t tsc1 = tn.rdtsc(); + int total = 0; + while (count-- > 0) { + total += count; + } + uint64_t tsc2 = tn.rdtsc(); + + std::cout << (tn.tsc2ns(tsc2) - tn.tsc2ns(tsc1)) << " ns" << std::endl; + + return 0; +} diff --git a/recipes/tscns/all/test_v1_package/CMakeLists.txt b/recipes/tscns/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..eebfbab4ba7b5 --- /dev/null +++ b/recipes/tscns/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tscns REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tscns::tscns) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tscns/all/test_v1_package/conanfile.py b/recipes/tscns/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tscns/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/tscns/config.yml b/recipes/tscns/config.yml new file mode 100644 index 0000000000000..eab700ad534a3 --- /dev/null +++ b/recipes/tscns/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0": + folder: all diff --git a/recipes/tsil/all/CMakeLists.txt b/recipes/tsil/all/CMakeLists.txt new file mode 100644 index 0000000000000..2c6adc0080dcc --- /dev/null +++ b/recipes/tsil/all/CMakeLists.txt @@ -0,0 +1,73 @@ +cmake_minimum_required(VERSION 3.4) +project(TSIL LANGUAGES C) + +add_library(tsil + ${TSIL_SRC_DIR}/initialize.c + ${TSIL_SRC_DIR}/evaluate.c + ${TSIL_SRC_DIR}/fevaluate.c + ${TSIL_SRC_DIR}/generic.c + ${TSIL_SRC_DIR}/rk6.c + ${TSIL_SRC_DIR}/rk5.c + ${TSIL_SRC_DIR}/functions.c + ${TSIL_SRC_DIR}/dilog.c + ${TSIL_SRC_DIR}/trilog.c + ${TSIL_SRC_DIR}/dBds.c + ${TSIL_SRC_DIR}/dSds.c + ${TSIL_SRC_DIR}/dTds.c + ${TSIL_SRC_DIR}/dUds.c + ${TSIL_SRC_DIR}/dsMds.c + ${TSIL_SRC_DIR}/initB.c + ${TSIL_SRC_DIR}/initS.c + ${TSIL_SRC_DIR}/initT.c + ${TSIL_SRC_DIR}/initU.c + ${TSIL_SRC_DIR}/initV.c + ${TSIL_SRC_DIR}/initM.c + ${TSIL_SRC_DIR}/special.c + ${TSIL_SRC_DIR}/analyticAB.c + ${TSIL_SRC_DIR}/analyticI.c + ${TSIL_SRC_DIR}/analyticS.c + ${TSIL_SRC_DIR}/analyticT.c + ${TSIL_SRC_DIR}/analyticTbar.c + ${TSIL_SRC_DIR}/analyticU.c + ${TSIL_SRC_DIR}/analyticV.c + ${TSIL_SRC_DIR}/analyticM.c + ${TSIL_SRC_DIR}/setTbar.c + ${TSIL_SRC_DIR}/setV.c + ${TSIL_SRC_DIR}/setbold.c +) + +find_library(LIBM NAMES m) +target_link_libraries(tsil PRIVATE $<$:${LIBM}>) + +set(TSIL_SIZE long CACHE STRING "set floating point data size") +set_property(CACHE TSIL_SIZE PROPERTY STRINGS long double) + +if(TSIL_SIZE STREQUAL "double") + target_compile_definitions(tsil PUBLIC TSIL_SIZE_DOUBLE) +elseif(TSIL_SIZE STREQUAL "long") + target_compile_definitions(tsil PUBLIC TSIL_SIZE_LONG) +else() + message(FATAL_ERROR "You must set size to either double or long") +endif() + +message(STATUS "Using size: ${TSIL_SIZE}") + +install( + FILES + "${TSIL_SRC_DIR}/tsil.h" + "${TSIL_SRC_DIR}/tsil_cpp.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) + +install( + TARGETS tsil + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_executable(tsil.x ${TSIL_SRC_DIR}/basecalc.c) +target_link_libraries(tsil.x PRIVATE tsil) +set_target_properties(tsil.x PROPERTIES OUTPUT_NAME "tsil" RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + +install(TARGETS tsil.x DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/recipes/tsil/all/conandata.yml b/recipes/tsil/all/conandata.yml new file mode 100644 index 0000000000000..f95fe9a099612 --- /dev/null +++ b/recipes/tsil/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.45": + url: [ + "http://www.niu.edu/spmartin/TSIL/tsil-1.45.tar.gz", + "http://faculty.otterbein.edu/DRobertson/tsil/tsil-1.45.tar.gz" + ] + sha256: "420e389af9a77edcc373b88893bf13c9dddfea1d760219dc9a932f28ea0d5d24" diff --git a/recipes/tsil/all/conanfile.py b/recipes/tsil/all/conanfile.py new file mode 100644 index 0000000000000..81d982b72282a --- /dev/null +++ b/recipes/tsil/all/conanfile.py @@ -0,0 +1,92 @@ +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 +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.47.0" + + +class TsilConan(ConanFile): + name = "tsil" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.niu.edu/spmartin/TSIL/" + description = "Two-loop Self-energy Integral Library" + topics = ("high-energy", "physics", "hep", "two-loop", "integrals") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "size": ["long", "double"], + } + default_options = { + "shared": False, + "fPIC": True, + "size": "long", + } + + exports_sources = "CMakeLists.txt" + + @property + def _tsil_size(self): + return "TSIL_SIZE_DOUBLE" if self.options.size == "double" else "TSIL_SIZE_LONG" + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"TSIL does not support {self.settings.compiler}") + + 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["TSIL_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["TSIL_SIZE"] = self.options.size + 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.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 = ["tsil"] + self.cpp_info.defines.append(self._tsil_size) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) diff --git a/recipes/tsil/all/test_package/CMakeLists.txt b/recipes/tsil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..48214718fc55d --- /dev/null +++ b/recipes/tsil/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(tsil REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE tsil::tsil) diff --git a/recipes/tsil/all/test_package/conanfile.py b/recipes/tsil/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsil/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/tsil/all/test_package/test_package.c b/recipes/tsil/all/test_package/test_package.c new file mode 100644 index 0000000000000..2dea329bacec5 --- /dev/null +++ b/recipes/tsil/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include +#include "tsil.h" + +int main() +{ + TSIL_DATA data; + TSIL_REAL x = 1.0, y = 2.0, z = 3.0, u = 4.0, v = 5.0, s = 6.0, qq = 7.0; + + TSIL_SetParameters(&data, x, y, z, u, v, qq); + TSIL_Evaluate(&data, s); + + printf("TSIL %s\n", TSIL_VERSION); + printf("TSIL_REAL = %i bytes\n", sizeof(TSIL_REAL)); + printf("TSIL_COMPLEXCPP = %i bytes\n", sizeof(TSIL_COMPLEX)); + + return 0; +} diff --git a/recipes/tsil/all/test_v1_package/CMakeLists.txt b/recipes/tsil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..141659813702c --- /dev/null +++ b/recipes/tsil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsil REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE tsil::tsil) diff --git a/recipes/tsil/all/test_v1_package/conanfile.py b/recipes/tsil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tsil/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/tsil/config.yml b/recipes/tsil/config.yml new file mode 100644 index 0000000000000..59acf39e74f24 --- /dev/null +++ b/recipes/tsil/config.yml @@ -0,0 +1,3 @@ +versions: + "1.45": + folder: all diff --git a/recipes/tsl-array-hash/all/conandata.yml b/recipes/tsl-array-hash/all/conandata.yml new file mode 100644 index 0000000000000..6fc08a69bfd1d --- /dev/null +++ b/recipes/tsl-array-hash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.1": + url: "https://github.com/Tessil/array-hash/archive/v0.7.1.tar.gz" + sha256: "086b4e8adf8c132f2667e5eb6ce21b8707681f5cf95eda8c71d0085126ce5a4b" diff --git a/recipes/tsl-array-hash/all/conanfile.py b/recipes/tsl-array-hash/all/conanfile.py new file mode 100644 index 0000000000000..8c6297fe62672 --- /dev/null +++ b/recipes/tsl-array-hash/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TslArrayHashConan(ConanFile): + name = "tsl-array-hash" + license = "MIT" + description = "C++ implementation of a fast and memory efficient hash map and hash set specialized for strings." + topics = ("string", "structure", "hash map", "hash set") + homepage = "https://github.com/Tessil/array-hash" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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=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_file_name", "tsl-array-hash") + self.cpp_info.set_property("cmake_target_name", "tsl::array_hash") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tsl-array-hash" + self.cpp_info.filenames["cmake_find_package_multi"] = "tsl-array-hash" + self.cpp_info.names["cmake_find_package"] = "tsl" + self.cpp_info.names["cmake_find_package_multi"] = "tsl" + self.cpp_info.components["array_hash"].names["cmake_find_package"] = "array_hash" + self.cpp_info.components["array_hash"].names["cmake_find_package_multi"] = "array_hash" + self.cpp_info.components["array_hash"].set_property("cmake_target_name", "tsl::array_hash") + self.cpp_info.components["array_hash"].bindirs = [] + self.cpp_info.components["array_hash"].libdirs = [] + self.cpp_info.components["array_hash"].resdirs = [] diff --git a/recipes/tsl-array-hash/all/test_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..813f6130cae26 --- /dev/null +++ b/recipes/tsl-array-hash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tsl-array-hash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::array_hash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-array-hash/all/test_package/conanfile.py b/recipes/tsl-array-hash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsl-array-hash/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/tsl-array-hash/all/test_package/test_package.cpp b/recipes/tsl-array-hash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ca8238e30e581 --- /dev/null +++ b/recipes/tsl-array-hash/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +#include +#include +#include + +int main() { + // Map of const char* to int + tsl::array_map map = {{"one", 1}, {"two", 2}}; + map["three"] = 3; + map["four"] = 4; + + map.insert("five", 5); + map.insert_ks("six_with_extra_chars_we_ignore", 3, 6); + + map.erase("two"); + + // When template parameter StoreNullTerminator is true (default) and there is no + // null character in the strings. + for(auto it = map.begin(); it != map.end(); ++it) { + std::cout << "{" << it.key() << ", " << it.value() << "}" << std::endl; + } + + // If StoreNullTerminator is false for space efficiency or you are storing null characters, + // you can access to the size of the key. + for(auto it = map.begin(); it != map.end(); ++it) { + (std::cout << "{").write(it.key(), it.key_size()) << ", " << it.value() << "}" << std::endl; + } + + // Or if you just want the values. + for(int value: map) { + std::cout << "{" << value << "}" << std::endl; + } + + // Map of const char32_t* to int + tsl::array_map map_char32 = {{U"one", 1}, {U"two", 2}}; + map_char32[U"three"] = 3; + + // Set of const char* + tsl::array_set set = {"one", "two", "three"}; + set.insert({"four", "five"}); + + for(auto it = set.begin(); it != set.end(); ++it) { + std::cout << "{" << it.key() << "}" << std::endl; + } +} diff --git a/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..15d716d7a9505 --- /dev/null +++ b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-array-hash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::array_hash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-array-hash/all/test_v1_package/conanfile.py b/recipes/tsl-array-hash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-array-hash/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): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) diff --git a/recipes/tsl-array-hash/config.yml b/recipes/tsl-array-hash/config.yml new file mode 100644 index 0000000000000..5232c857fcc80 --- /dev/null +++ b/recipes/tsl-array-hash/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.1": + folder: all diff --git a/recipes/tsl-hat-trie/all/conandata.yml b/recipes/tsl-hat-trie/all/conandata.yml new file mode 100644 index 0000000000000..3d18cad197da7 --- /dev/null +++ b/recipes/tsl-hat-trie/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.6.0": + url: "https://github.com/Tessil/hat-trie/archive/v0.6.0.tar.gz" + sha256: "f3793fd46f07bdf3de67d719b602c84f66121d81aa02d9e6d53de03ae3444c80" diff --git a/recipes/tsl-hat-trie/all/conanfile.py b/recipes/tsl-hat-trie/all/conanfile.py new file mode 100644 index 0000000000000..fbce5d32f1f2b --- /dev/null +++ b/recipes/tsl-hat-trie/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TslHatTrieConan(ConanFile): + name = "tsl-hat-trie" + license = "MIT" + description = "C++ implementation of a fast and memory efficient HAT-trie." + topics = ("string", "trie", "structure", "hash map", "hash set") + homepage = "https://github.com/Tessil/hat-trie" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("tsl-array-hash/0.7.1") + + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + rmdir(self, os.path.join(self.source_folder, "include", "tsl", "array-hash")) + replace_in_file(self, os.path.join(self.source_folder, "include", "tsl", "htrie_hash.h"), + '#include "array-hash/', '#include "tsl/') + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tsl-hat-trie") + self.cpp_info.set_property("cmake_target_name", "tsl::hat_trie") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tsl-hat-trie" + self.cpp_info.filenames["cmake_find_package_multi"] = "tsl-hat-trie" + self.cpp_info.names["cmake_find_package"] = "tsl" + self.cpp_info.names["cmake_find_package_multi"] = "tsl" + self.cpp_info.components["hat_trie"].names["cmake_find_package"] = "hat_trie" + self.cpp_info.components["hat_trie"].names["cmake_find_package_multi"] = "hat_trie" + self.cpp_info.components["hat_trie"].requires = ["tsl-array-hash::array_hash"] + self.cpp_info.components["hat_trie"].set_property("cmake_target_name", "tsl::hat_trie") + self.cpp_info.components["hat_trie"].bindirs = [] + self.cpp_info.components["hat_trie"].libdirs = [] + self.cpp_info.components["hat_trie"].resdirs = [] diff --git a/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c212bc7cbc125 --- /dev/null +++ b/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tsl-hat-trie REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hat_trie) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hat-trie/all/test_package/conanfile.py b/recipes/tsl-hat-trie/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsl-hat-trie/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/tsl-hat-trie/all/test_package/test_package.cpp b/recipes/tsl-hat-trie/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4bb6909ff32a9 --- /dev/null +++ b/recipes/tsl-hat-trie/all/test_package/test_package.cpp @@ -0,0 +1,77 @@ +#include +#include +#include +#include + +int main() { + /* + * Map of strings to int having char as character type. + * There is no support for wchar_t, char16_t or char32_t yet, + * but UTF-8 strings will work fine. + */ + tsl::htrie_map map = {{"one", 1}, {"two", 2}}; + map["three"] = 3; + map["four"] = 4; + + map.insert("five", 5); + map.insert_ks("six_with_extra_chars_we_ignore", 3, 6); + + map.erase("two"); + + /* + * Due to the compression on the common prefixes, the letters of the string + * are not always stored contiguously. When we retrieve the key, we have to + * construct it. + * + * To avoid a heap-allocation at each iteration (when SSO doesn't occur), + * we reuse the key_buffer to construct the key. + */ + std::string key_buffer; + for(auto it = map.begin(); it != map.end(); ++it) { + it.key(key_buffer); + std::cout << "{" << key_buffer << ", " << it.value() << "}" << std::endl; + } + + /* + * If you don't care about the allocation. + */ + for(auto it = map.begin(); it != map.end(); ++it) { + std::cout << "{" << it.key() << ", " << *it << "}" << std::endl; + } + + tsl::htrie_map map2 = {{"apple", 1}, {"mango", 2}, {"apricot", 3}, + {"mandarin", 4}, {"melon", 5}, {"macadamia", 6}}; + + // Prefix search + auto prefix_range = map2.equal_prefix_range("ma"); + + // {mandarin, 4} {mango, 2} {macadamia, 6} + for(auto it = prefix_range.first; it != prefix_range.second; ++it) { + std::cout << "{" << it.key() << ", " << *it << "}" << std::endl; + } + + // Find longest match prefix. + auto longest_prefix = map2.longest_prefix("apple juice"); + if(longest_prefix != map2.end()) { + // {apple, 1} + std::cout << "{" << longest_prefix.key() << ", " + << *longest_prefix << "}" << std::endl; + } + + // Prefix erase + map2.erase_prefix("ma"); + + // {apricot, 3} {melon, 5} {apple, 1} + for(auto it = map2.begin(); it != map2.end(); ++it) { + std::cout << "{" << it.key() << ", " << *it << "}" << std::endl; + } + + tsl::htrie_set set = {"one", "two", "three"}; + set.insert({"four", "five"}); + + // {one} {two} {five} {four} {three} + for(auto it = set.begin(); it != set.end(); ++it) { + it.key(key_buffer); + std::cout << "{" << key_buffer << "}" << std::endl; + } +} diff --git a/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a1b5a8c7df69 --- /dev/null +++ b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-hat-trie REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hat_trie) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hat-trie/all/test_v1_package/conanfile.py b/recipes/tsl-hat-trie/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-hat-trie/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): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) diff --git a/recipes/tsl-hat-trie/config.yml b/recipes/tsl-hat-trie/config.yml new file mode 100644 index 0000000000000..7d9ba9dbc8ac9 --- /dev/null +++ b/recipes/tsl-hat-trie/config.yml @@ -0,0 +1,3 @@ +versions: + "0.6.0": + folder: all diff --git a/recipes/tsl-hopscotch-map/all/conandata.yml b/recipes/tsl-hopscotch-map/all/conandata.yml new file mode 100644 index 0000000000000..6166a7c7730e6 --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.0": + url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.0.tar.gz" + sha256: "a59d65b552dc7682521989842418c92257147f5068152b5af50e917892ad9317" diff --git a/recipes/tsl-hopscotch-map/all/conanfile.py b/recipes/tsl-hopscotch-map/all/conanfile.py new file mode 100644 index 0000000000000..6772f3c321bc9 --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TslHopscotchMapConan(ConanFile): + name = "tsl-hopscotch-map" + license = "MIT" + description = "C++ implementation of a fast hash map and hash set using hopscotch hashing" + topics = ("structure", "hash map", "hash set") + homepage = "https://github.com/Tessil/hopscotch-map" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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=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_file_name", "tsl-hopscotch-map") + self.cpp_info.set_property("cmake_target_name", "tsl::hopscotch_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tsl-hopscotch-map" + self.cpp_info.filenames["cmake_find_package_multi"] = "tsl-hopscotch-map" + self.cpp_info.names["cmake_find_package"] = "tsl" + self.cpp_info.names["cmake_find_package_multi"] = "tsl" + self.cpp_info.components["hopscotch_map"].names["cmake_find_package"] = "hopscotch_map" + self.cpp_info.components["hopscotch_map"].names["cmake_find_package_multi"] = "hopscotch_map" + self.cpp_info.components["hopscotch_map"].set_property("cmake_target_name", "tsl::hopscotch_map") + self.cpp_info.components["hopscotch_map"].bindirs = [] + self.cpp_info.components["hopscotch_map"].libdirs = [] + self.cpp_info.components["hopscotch_map"].resdirs = [] diff --git a/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt b/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de096ee6a84f9 --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tsl-hopscotch-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hopscotch_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hopscotch-map/all/test_package/conanfile.py b/recipes/tsl-hopscotch-map/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsl-hopscotch-map/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/tsl-hopscotch-map/all/test_package/test_package.cpp b/recipes/tsl-hopscotch-map/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..364b5d9c2da4d --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/test_package/test_package.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include + +int main() { + tsl::hopscotch_map map = {{"a", 1}, {"b", 2}}; + map["c"] = 3; + map["d"] = 4; + + map.insert({"e", 5}); + map.erase("b"); + + for(auto it = map.begin(); it != map.end(); ++it) { + //it->second += 2; // Not valid. + it.value() += 2; + } + + // {d, 6} {a, 3} {e, 7} {c, 5} + for(const auto& key_value : map) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + if(map.find("a") != map.end()) { + std::cout << "Found \"a\"." << std::endl; + } + + const std::size_t precalculated_hash = std::hash()("a"); + // If we already know the hash beforehand, we can pass it in parameter to speed-up lookups. + if(map.find("a", precalculated_hash) != map.end()) { + std::cout << "Found \"a\" with hash " << precalculated_hash << "." << std::endl; + } + + /* + * Calculating the hash and comparing two std::string may be slow. + * We can store the hash of each std::string in the hash map to make + * the inserts and lookups faster by setting StoreHash to true. + */ + tsl::hopscotch_map, + std::equal_to, + std::allocator>, + 30, true> map2; + + map2["a"] = 1; + map2["b"] = 2; + + // {a, 1} {b, 2} + for(const auto& key_value : map2) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + tsl::hopscotch_set set; + set.insert({1, 9, 0}); + set.insert({2, -1, 9}); + + // {0} {1} {2} {9} {-1} + for(const auto& key : set) { + std::cout << "{" << key << "}" << std::endl; + } +} diff --git a/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d71994382aff0 --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-hopscotch-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hopscotch_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py b/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-hopscotch-map/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): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) diff --git a/recipes/tsl-hopscotch-map/config.yml b/recipes/tsl-hopscotch-map/config.yml new file mode 100644 index 0000000000000..d724287fc23cb --- /dev/null +++ b/recipes/tsl-hopscotch-map/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.0": + folder: all diff --git a/recipes/tsl-ordered-map/all/conandata.yml b/recipes/tsl-ordered-map/all/conandata.yml new file mode 100644 index 0000000000000..50a0714a45e06 --- /dev/null +++ b/recipes/tsl-ordered-map/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.0": + url: "https://github.com/Tessil/ordered-map/archive/v1.1.0.tar.gz" + sha256: "d6070502351646d68f2bbe6078c0da361bc1db733ee8a392e33cfb8b31183e28" + "1.0.0": + url: "https://github.com/Tessil/ordered-map/archive/v1.0.0.tar.gz" + sha256: "49cd436b8bdacb01d5f4afd7aab0c0d6fa57433dfc29d65f08a5f1ed1e2af26b" diff --git a/recipes/tsl-ordered-map/all/conanfile.py b/recipes/tsl-ordered-map/all/conanfile.py new file mode 100644 index 0000000000000..d13b78edda147 --- /dev/null +++ b/recipes/tsl-ordered-map/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TslOrderedMapConan(ConanFile): + name = "tsl-ordered-map" + license = "MIT" + description = "C++ hash map and hash set which preserve the order of insertion." + topics = ("ordered-map", "structure", "hash map", "hash set") + homepage = "https://github.com/Tessil/ordered-map" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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=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_file_name", "tsl-ordered-map") + self.cpp_info.set_property("cmake_target_name", "tsl::ordered_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tsl-ordered-map" + self.cpp_info.filenames["cmake_find_package_multi"] = "tsl-ordered-map" + self.cpp_info.names["cmake_find_package"] = "tsl" + self.cpp_info.names["cmake_find_package_multi"] = "tsl" + self.cpp_info.components["ordered_map"].names["cmake_find_package"] = "ordered_map" + self.cpp_info.components["ordered_map"].names["cmake_find_package_multi"] = "ordered_map" + self.cpp_info.components["ordered_map"].set_property("cmake_target_name", "tsl::ordered_map") + self.cpp_info.components["ordered_map"].bindirs = [] + self.cpp_info.components["ordered_map"].libdirs = [] + self.cpp_info.components["ordered_map"].resdirs = [] diff --git a/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt b/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf4b3a228306b --- /dev/null +++ b/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tsl-ordered-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::ordered_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-ordered-map/all/test_package/conanfile.py b/recipes/tsl-ordered-map/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsl-ordered-map/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/tsl-ordered-map/all/test_package/test_package.cpp b/recipes/tsl-ordered-map/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..74d74ee08c359 --- /dev/null +++ b/recipes/tsl-ordered-map/all/test_package/test_package.cpp @@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include + +int main() { + tsl::ordered_map map = {{'d', 1}, {'a', 2}, {'g', 3}}; + map.insert({'b', 4}); + map['h'] = 5; + map['e'] = 6; + + map.erase('a'); + + // {d, 1} {g, 3} {b, 4} {h, 5} {e, 6} + for(const auto& key_value : map) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + map.unordered_erase('b'); + + // Break order: {d, 1} {g, 3} {e, 6} {h, 5} + for(const auto& key_value : map) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + for(auto it = map.begin(); it != map.end(); ++it) { + //it->second += 2; // Not valid. + it.value() += 2; + } + + if(map.find('d') != map.end()) { + std::cout << "Found 'd'." << std::endl; + } + + const std::size_t precalculated_hash = std::hash()('d'); + // If we already know the hash beforehand, we can pass it as argument to speed-up the lookup. + if(map.find('d', precalculated_hash) != map.end()) { + std::cout << "Found 'd' with hash " << precalculated_hash << "." << std::endl; + } + + tsl::ordered_set, std::equal_to, std::allocator, std::vector> set; + set.reserve(6); + + set = {'3', '4', '9', '2'}; + set.erase('2'); + set.insert('1'); + set.insert('\0'); + + set.pop_back(); + set.insert({'0', '\0'}); + + // Get raw buffer for C API: 34910 + std::cout << atoi(set.data()) << std::endl; +} diff --git a/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tsl-ordered-map/all/test_v1_package/conanfile.py b/recipes/tsl-ordered-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-ordered-map/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): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) diff --git a/recipes/tsl-ordered-map/config.yml b/recipes/tsl-ordered-map/config.yml new file mode 100644 index 0000000000000..73c245662b08d --- /dev/null +++ b/recipes/tsl-ordered-map/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.0.0": + folder: all diff --git a/recipes/tsl-robin-map/all/conandata.yml b/recipes/tsl-robin-map/all/conandata.yml new file mode 100644 index 0000000000000..89211be8fec7b --- /dev/null +++ b/recipes/tsl-robin-map/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.2.1": + url: "https://github.com/Tessil/robin-map/archive/v1.2.1.tar.gz" + sha256: "2b54d2c1de2f73bea5c51d5dcbd64813a08caf1bfddcfdeee40ab74e9599e8e3" + "1.0.1": + url: "https://github.com/Tessil/robin-map/archive/v1.0.1.tar.gz" + sha256: "b2ffdb623727cea852a66bddcb7fa6d938538a82b40e48294bb581fe086ef005" + "0.6.3": + url: "https://github.com/Tessil/robin-map/archive/v0.6.3.tar.gz" + sha256: "e6654c8c2598f63eb0b1d52ff8bdf39cfcc91d81dd5d05274a6dca91241cd72f" + "0.6.2": + url: "https://github.com/Tessil/robin-map/archive/v0.6.2.tar.gz" + sha256: "c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8ef1" diff --git a/recipes/tsl-robin-map/all/conanfile.py b/recipes/tsl-robin-map/all/conanfile.py new file mode 100644 index 0000000000000..60cfac70c1a0d --- /dev/null +++ b/recipes/tsl-robin-map/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class 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" + 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], + destination=self.source_folder, 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=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_file_name", "tsl-robin-map") + self.cpp_info.set_property("cmake_target_name", "tsl::robin_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tsl-robin-map" + self.cpp_info.filenames["cmake_find_package_multi"] = "tsl-robin-map" + self.cpp_info.names["cmake_find_package"] = "tsl" + self.cpp_info.names["cmake_find_package_multi"] = "tsl" + self.cpp_info.components["robin_map"].names["cmake_find_package"] = "robin_map" + self.cpp_info.components["robin_map"].names["cmake_find_package_multi"] = "robin_map" + self.cpp_info.components["robin_map"].set_property("cmake_target_name", "tsl::robin_map") + self.cpp_info.components["robin_map"].bindirs = [] + self.cpp_info.components["robin_map"].libdirs = [] + self.cpp_info.components["robin_map"].resdirs = [] diff --git a/recipes/tsl-robin-map/all/test_package/CMakeLists.txt b/recipes/tsl-robin-map/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e1f4cd6d85611 --- /dev/null +++ b/recipes/tsl-robin-map/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tsl-robin-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::robin_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-robin-map/all/test_package/conanfile.py b/recipes/tsl-robin-map/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsl-robin-map/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/tsl-robin-map/all/test_package/test_package.cpp b/recipes/tsl-robin-map/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..632d63dfe5b59 --- /dev/null +++ b/recipes/tsl-robin-map/all/test_package/test_package.cpp @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include + + +int main() { + tsl::robin_map map = {{"a", 1}, {"b", 2}}; + map["c"] = 3; + map["d"] = 4; + + map.insert({"e", 5}); + map.erase("b"); + + for(auto it = map.begin(); it != map.end(); ++it) { + //it->second += 2; // Not valid. + it.value() += 2; + } + + // {d, 6} {a, 3} {e, 7} {c, 5} + for(const auto& key_value : map) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + + if(map.find("a") != map.end()) { + std::cout << "Found \"a\"." << std::endl; + } + + const std::size_t precalculated_hash = std::hash()("a"); + // If we already know the hash beforehand, we can pass it in parameter to speed-up lookups. + if(map.find("a", precalculated_hash) != map.end()) { + std::cout << "Found \"a\" with hash " << precalculated_hash << "." << std::endl; + } + + + /* + * Calculating the hash and comparing two std::string may be slow. + * We can store the hash of each std::string in the hash map to make + * the inserts and lookups faster by setting StoreHash to true. + */ + tsl::robin_map, + std::equal_to, + std::allocator>, + true> map2; + + map2["a"] = 1; + map2["b"] = 2; + + // {a, 1} {b, 2} + for(const auto& key_value : map2) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + + + + tsl::robin_set set; + set.insert({1, 9, 0}); + set.insert({2, -1, 9}); + + // {0} {1} {2} {9} {-1} + for(const auto& key : set) { + std::cout << "{" << key << "}" << std::endl; + } +} diff --git a/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tsl-robin-map/all/test_v1_package/conanfile.py b/recipes/tsl-robin-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-robin-map/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): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) diff --git a/recipes/tsl-robin-map/config.yml b/recipes/tsl-robin-map/config.yml new file mode 100644 index 0000000000000..7a3b316dace84 --- /dev/null +++ b/recipes/tsl-robin-map/config.yml @@ -0,0 +1,9 @@ +versions: + "1.2.1": + folder: all + "1.0.1": + folder: all + "0.6.3": + folder: all + "0.6.2": + folder: all diff --git a/recipes/tsl-sparse-map/all/conandata.yml b/recipes/tsl-sparse-map/all/conandata.yml new file mode 100644 index 0000000000000..43c3b5a6a34ae --- /dev/null +++ b/recipes/tsl-sparse-map/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.6.2": + url: "https://github.com/Tessil/sparse-map/archive/v0.6.2.tar.gz" + sha256: "7020c21e8752e59d72e37456cd80000e18671c803890a3e55ae36b295eba99f6" diff --git a/recipes/tsl-sparse-map/all/conanfile.py b/recipes/tsl-sparse-map/all/conanfile.py new file mode 100644 index 0000000000000..4168882cba1a3 --- /dev/null +++ b/recipes/tsl-sparse-map/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class TslSparseMapConan(ConanFile): + name = "tsl-sparse-map" + license = "MIT" + description = "C++ implementation of a memory efficient hash map and hash set" + topics = ("sparse-map", "structure", "hash map", "hash set") + homepage = "https://github.com/Tessil/sparse-map" + url = "https://github.com/conan-io/conan-center-index" + 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], + destination=self.source_folder, 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=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_file_name", "tsl-sparse-map") + self.cpp_info.set_property("cmake_target_name", "tsl::sparse_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "tsl-sparse-map" + self.cpp_info.filenames["cmake_find_package_multi"] = "tsl-sparse-map" + self.cpp_info.names["cmake_find_package"] = "tsl" + self.cpp_info.names["cmake_find_package_multi"] = "tsl" + self.cpp_info.components["sparse_map"].names["cmake_find_package"] = "sparse_map" + self.cpp_info.components["sparse_map"].names["cmake_find_package_multi"] = "sparse_map" + self.cpp_info.components["sparse_map"].set_property("cmake_target_name", "tsl::sparse_map") + self.cpp_info.components["sparse_map"].bindirs = [] + self.cpp_info.components["sparse_map"].libdirs = [] + self.cpp_info.components["sparse_map"].resdirs = [] diff --git a/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..47e7071ad283b --- /dev/null +++ b/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(tsl-sparse-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::sparse_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-sparse-map/all/test_package/conanfile.py b/recipes/tsl-sparse-map/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/tsl-sparse-map/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/tsl-sparse-map/all/test_package/test_package.cpp b/recipes/tsl-sparse-map/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..95a061737ab68 --- /dev/null +++ b/recipes/tsl-sparse-map/all/test_package/test_package.cpp @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include + +int main() { + tsl::sparse_map map = {{"a", 1}, {"b", 2}}; + map["c"] = 3; + map["d"] = 4; + + map.insert({"e", 5}); + map.erase("b"); + + for(auto it = map.begin(); it != map.end(); ++it) { + //it->second += 2; // Not valid. + it.value() += 2; + } + + // {d, 6} {a, 3} {e, 7} {c, 5} + for(const auto& key_value : map) { + std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; + } + + + if(map.find("a") != map.end()) { + std::cout << "Found \"a\"." << std::endl; + } + + const std::size_t precalculated_hash = std::hash()("a"); + // If we already know the hash beforehand, we can pass it as argument to speed-up the lookup. + if(map.find("a", precalculated_hash) != map.end()) { + std::cout << "Found \"a\" with hash " << precalculated_hash << "." << std::endl; + } + + tsl::sparse_set set; + set.insert({1, 9, 0}); + set.insert({2, -1, 9}); + + // {0} {1} {2} {9} {-1} + for(const auto& key : set) { + std::cout << "{" << key << "}" << std::endl; + } +} diff --git a/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3e681dedd0cd4 --- /dev/null +++ b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-sparse-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::sparse_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-sparse-map/all/test_v1_package/conanfile.py b/recipes/tsl-sparse-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-sparse-map/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): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) diff --git a/recipes/tsl-sparse-map/config.yml b/recipes/tsl-sparse-map/config.yml new file mode 100644 index 0000000000000..a09c617182ab2 --- /dev/null +++ b/recipes/tsl-sparse-map/config.yml @@ -0,0 +1,3 @@ +versions: + "0.6.2": + folder: all diff --git a/recipes/tuplet/all/conandata.yml b/recipes/tuplet/all/conandata.yml new file mode 100644 index 0000000000000..98eee37c105c5 --- /dev/null +++ b/recipes/tuplet/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.1.0": + url: "https://github.com/codeinred/tuplet/archive/v2.1.0.tar.gz" + sha256: "e77503b81259c4d67d1b16b887b9ab778422e2ffc031d2171b5117d2fddb237c" + "2.0.0": + url: "https://github.com/codeinred/tuplet/archive/refs/tags/v2.0.0.tar.gz" + sha256: "cb754d119ca9d0a17ef165624d2c856b86eed9451bc8bc5c17b41410177a8d9f" + "1.2.2": + url: "https://github.com/codeinred/tuplet/archive/refs/tags/v1.2.2.tar.gz" + sha256: "8605abf16f3ffcf87b0a5d81bc30f75b1fb478a5d747749fca31397e8705f8bc" diff --git a/recipes/tuplet/all/conanfile.py b/recipes/tuplet/all/conanfile.py new file mode 100644 index 0000000000000..e4ef08ece551c --- /dev/null +++ b/recipes/tuplet/all/conanfile.py @@ -0,0 +1,84 @@ +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.50.0" + + +class TupletConan(ConanFile): + name = "tuplet" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/codeinred/tuplet" + description = "A fast, simple tuple implementation that implements tuple as an aggregate" + topics = ("tuple", "trivially-copyable", "modern-cpp") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" if Version(self.version) < "2.0.0" else "17" + + @property + def _compilers_minimum_version(self): + if self._min_cppstd == "20": + return { + "gcc": "11", + "Visual Studio": "17", + "msvc": "193", + "clang": "13", + "apple-clang": "13" + } + return { + "gcc": "8", + "Visual Studio": "16", + "msvc": "192", + "clang": "7", + "apple-clang": "12" + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(compiler, False) + if minimum_version and loose_lt_semver(version, minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd} which your compiler ({compiler}-{version}) does not support") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + include_folder = os.path.join(self.source_folder, "include") + copy(self, "*.hpp", src=include_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tuplet") + self.cpp_info.set_property("cmake_target_name", "tuplet::tuplet") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tuplet/all/test_package/CMakeLists.txt b/recipes/tuplet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6da61fdca65d1 --- /dev/null +++ b/recipes/tuplet/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(tuplet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tuplet::tuplet) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/tuplet/all/test_package/conanfile.py b/recipes/tuplet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/tuplet/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/tuplet/all/test_package/test_package.cpp b/recipes/tuplet/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4bc22ddb90c0f --- /dev/null +++ b/recipes/tuplet/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + auto print = [](auto&&... args) { ((std::cout << args << '\n'), ...); }; + tuplet::apply(print, tuplet::tuple{1, 2, "Hello, world!"}); + return 0; +} diff --git a/recipes/tuplet/all/test_v1_package/CMakeLists.txt b/recipes/tuplet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/tuplet/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tuplet/all/test_v1_package/conanfile.py b/recipes/tuplet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tuplet/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/tuplet/config.yml b/recipes/tuplet/config.yml new file mode 100644 index 0000000000000..dab8b51866d73 --- /dev/null +++ b/recipes/tuplet/config.yml @@ -0,0 +1,7 @@ +versions: + "2.1.0": + folder: all + "2.0.0": + folder: all + "1.2.2": + folder: all diff --git a/recipes/turtle/all/conandata.yml b/recipes/turtle/all/conandata.yml new file mode 100644 index 0000000000000..1b973e23b0f99 --- /dev/null +++ b/recipes/turtle/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.3.1": + url: "https://github.com/mat007/turtle/archive/v1.3.1.tar.gz" + sha256: "1ea10600a4046286a781c898ed3110d48fdab473f5320dc48cc2775353039b8b" + "1.3.2": + url: "https://github.com/mat007/turtle/archive/v1.3.2.tar.gz" + sha256: "4dc0bd79ddecd337691d5805ecb25f427bd85d9549f44d06cd3a6b7f0f0235d4" diff --git a/recipes/turtle/all/conanfile.py b/recipes/turtle/all/conanfile.py new file mode 100644 index 0000000000000..9e4b9153b69bc --- /dev/null +++ b/recipes/turtle/all/conanfile.py @@ -0,0 +1,30 @@ +from conans import ConanFile, tools +import os + + +class TurtleConan(ConanFile): + name = "turtle" + description = "Turtle is a C++ mock object library based on Boost with a focus on usability, simplicity and flexibility." + topics = ("conan", "turtule", "mock", "test", "boost") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mat007/turtle" + license = "BSL-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("boost/1.73.0") + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def package(self): + self.copy("LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) diff --git a/recipes/turtle/all/test_package/CMakeLists.txt b/recipes/turtle/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..232bbd2abd280 --- /dev/null +++ b/recipes/turtle/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(turtle REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} turtle::turtle) diff --git a/recipes/turtle/all/test_package/conanfile.py b/recipes/turtle/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/turtle/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/turtle/all/test_package/test_package.cpp b/recipes/turtle/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5918e88a18621 --- /dev/null +++ b/recipes/turtle/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#define BOOST_TEST_MODULE test_package +#include +#include + +MOCK_CLASS( mock_class ) +{ + MOCK_METHOD( method, 2, void( int, const std::string& ) ) +}; + +BOOST_AUTO_TEST_CASE( demonstrates_adding_builtin_constraints ) +{ + mock_class c; + MOCK_EXPECT( c.method ).with( mock::equal( 3 ), mock::equal( "some string" ) ); + MOCK_EXPECT( c.method ).with( 3, "some string" ); // equivalent to the previous one using short-cuts +} diff --git a/recipes/turtle/config.yml b/recipes/turtle/config.yml new file mode 100644 index 0000000000000..266cd9ad48136 --- /dev/null +++ b/recipes/turtle/config.yml @@ -0,0 +1,5 @@ +versions: + "1.3.1": + folder: all + "1.3.2": + folder: all diff --git a/recipes/tweetnacl/all/CMakeLists.txt b/recipes/tweetnacl/all/CMakeLists.txt new file mode 100644 index 0000000000000..971f0647720b1 --- /dev/null +++ b/recipes/tweetnacl/all/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.8.12) +project(tweetnacl C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +include(GNUInstallDirs) + +add_library(tweetnacl tweetnacl.c) +set_target_properties(tweetnacl PROPERTIES PUBLIC_HEADER "tweetnacl.h") + +install(TARGETS tweetnacl + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) diff --git a/recipes/tweetnacl/all/conandata.yml b/recipes/tweetnacl/all/conandata.yml new file mode 100644 index 0000000000000..3dcc47bfef437 --- /dev/null +++ b/recipes/tweetnacl/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "20140427": + - url: https://tweetnacl.cr.yp.to/20140427/tweetnacl.c + sha256: 02e65bc3013ff2168983365e55906bc783c4c7e0a60d8100f17bb303a17175c4 + - url: https://tweetnacl.cr.yp.to/20140427/tweetnacl.h + sha256: 43f29ad721d9927b747b0100ab4160c119e7bb180c7c98a66e4bf79d31244287 + - url: https://unlicense.org/UNLICENSE + sha256: 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c diff --git a/recipes/tweetnacl/all/conanfile.py b/recipes/tweetnacl/all/conanfile.py new file mode 100644 index 0000000000000..b5b3d196ced3e --- /dev/null +++ b/recipes/tweetnacl/all/conanfile.py @@ -0,0 +1,66 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.32.0" + + +class TweetnaclConan(ConanFile): + name = "tweetnacl" + license = "Unlicense" + homepage = "https://tweetnacl.cr.yp.to" + url = "https://github.com/conan-io/conan-center-index" + description = "TweetNaCl is the world's first auditable high-security cryptographic library" + topics = ("nacl", "tweetnacl", "encryption", "signature", "hashing") + exports_sources = "CMakeLists.txt" + generators = "cmake" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + settings = "os", "compiler", "build_type", "arch" + + _cmake = None + + 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 + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os in ("Windows", "Macos"): + if self.options.shared: + raise ConanInvalidConfiguration("tweetnacl does not support shared on Windows and Madcos: it needs a randombytes implementation") + + def source(self): + for url_sha in self.conan_data["sources"][self.version]: + tools.download(url_sha["url"], os.path.basename(url_sha["url"])) + tools.check_sha256(os.path.basename(url_sha["url"]), url_sha["sha256"]) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("UNLICENSE", dst=os.path.join(self.package_folder, "licenses")) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["tweetnacl"] diff --git a/recipes/tweetnacl/all/test_package/CMakeLists.txt b/recipes/tweetnacl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b9b613cbb24a --- /dev/null +++ b/recipes/tweetnacl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/tweetnacl/all/test_package/conanfile.py b/recipes/tweetnacl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/tweetnacl/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tweetnacl/all/test_package/test_package.c b/recipes/tweetnacl/all/test_package/test_package.c new file mode 100644 index 0000000000000..84435af55e856 --- /dev/null +++ b/recipes/tweetnacl/all/test_package/test_package.c @@ -0,0 +1,97 @@ +#include + +/* Library needs external randombytes implemented */ +#include +#include +#include +#include + +void randombytes(unsigned char * ptr,unsigned int length) +{ + int i; + srand(time(NULL)); + + for (i = 0; i < length; i++) { + ptr[i] = (unsigned char)rand(); + } +} + +typedef unsigned char u8; + +#define PUB_KEY_LEN 32 +#define PRIV_KEY_LEN 32 +#define NONCE_LEN 24 +#define PADDING_LEN 32 + +void hexdump(char * data, int len) +{ + int i; + for (i = 0; i < len; i++) { + printf("%02X", (u8)data[i]); + } + printf("\n"); +} + +int main() { + char * padded_message; + int padded_mlen; + u8 sk[PRIV_KEY_LEN] = {0}; + u8 pk[PUB_KEY_LEN] = {0}; + u8 sk2[PRIV_KEY_LEN] = {0}; + u8 pk2[PUB_KEY_LEN] = {0}; + u8 nonce[NONCE_LEN] = {0}; + char message[] = "This is a cross-platform test of crypto_box/crypto_box_open in TweetNaCl."; + u8 * ciphertext; + char *decryptedmessage; + + // randomize nonce + randombytes(nonce, NONCE_LEN); + printf("Nonce: \n"); + hexdump((char*)nonce, NONCE_LEN); + + crypto_box_keypair(pk, sk); + crypto_box_keypair(pk2, sk2); + + printf("Public key: \n"); + hexdump((char*)pk, PUB_KEY_LEN); + printf("\nSecret key: \n"); + hexdump((char*)sk, PRIV_KEY_LEN); + printf("Public key2: \n"); + hexdump((char*)pk2, PUB_KEY_LEN); + printf("\nSecret key2: \n"); + hexdump((char*)sk2, PRIV_KEY_LEN); + + padded_mlen = strlen(message) + PADDING_LEN; + padded_message = (char*) malloc(padded_mlen); + memset(padded_message, 0, PADDING_LEN); + memcpy(padded_message + PADDING_LEN, message, strlen(message)); + + ciphertext = (u8*) malloc(padded_mlen); + + // we have a string so add 1 byte and NUL it so we can print it + decryptedmessage = (char*) malloc(padded_mlen+1); + decryptedmessage[padded_mlen] = '\0'; + + printf("crypto_box returned: %d\n",crypto_box(ciphertext, (u8*)padded_message, padded_mlen, nonce, pk2, sk)); + + free(padded_message); + + printf("\nCipher text: \n"); + hexdump((char*)ciphertext, padded_mlen); + printf("crypto_box_open returned: %d\n", crypto_box_open((u8*)decryptedmessage, ciphertext, padded_mlen, nonce, pk, sk2)); + free(ciphertext); + printf("\nDecrypted text: \n"); + hexdump((char*)decryptedmessage, padded_mlen); + + printf("%s\n", decryptedmessage+32); + + // Check decrypted and original message + if (strcmp(decryptedmessage+32, message) != 0) { + free(decryptedmessage); + fprintf(stderr, "Decrypted message doesn't match with original message"); + return 1; + } + + free(decryptedmessage); + return 0; +} diff --git a/recipes/tweetnacl/config.yml b/recipes/tweetnacl/config.yml new file mode 100644 index 0000000000000..f77d4f25cdaa9 --- /dev/null +++ b/recipes/tweetnacl/config.yml @@ -0,0 +1,3 @@ +versions: + "20140427": + folder: "all" diff --git a/recipes/twitch-native-ipc/all/CMakeLists.txt b/recipes/twitch-native-ipc/all/CMakeLists.txt new file mode 100644 index 0000000000000..3f96a3374441c --- /dev/null +++ b/recipes/twitch-native-ipc/all/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) +include(conanbuildinfo.cmake) + +conan_basic_setup(TARGETS) +add_subdirectory("source_subfolder") diff --git a/recipes/twitch-native-ipc/all/conandata.yml b/recipes/twitch-native-ipc/all/conandata.yml new file mode 100644 index 0000000000000..4ddda5e545311 --- /dev/null +++ b/recipes/twitch-native-ipc/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "3.1.1": + url: https://github.com/twitchtv/twitch-native-ipc/archive/v3.1.1.tar.gz + sha256: "f8c322bb30e68607e5fd632ae70e84983830e2bdade7a9b0ce5d8a09c5fa775b" +patches: + "3.1.1": + - patch_file: "patches/cmake-fixes.patch" + base_path: "source_subfolder" + - patch_file: "patches/linux-build-fixes.patch" + base_path: "source_subfolder" + - patch_file: "patches/export-fixes.patch" + base_path: "source_subfolder" diff --git a/recipes/twitch-native-ipc/all/conanfile.py b/recipes/twitch-native-ipc/all/conanfile.py new file mode 100644 index 0000000000000..9e025ba63f993 --- /dev/null +++ b/recipes/twitch-native-ipc/all/conanfile.py @@ -0,0 +1,95 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +from conans.tools import Version +import os + +class TwitchNativeIpcConan(ConanFile): + name = "twitch-native-ipc" + license = "MIT" + homepage = "https://github.com/twitchtv/twitch-native-ipc" + url = "https://github.com/conan-io/conan-center-index" + description = "Twitch natve ipc library" + topics = ("twitch", "ipc") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "cmake" + exports = ["CMakeLists.txt", "patches/**"] + requires = "libuv/1.40.0" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _compilers_min_version(self): + return { + "gcc": "8", + "clang": "8", + "apple-clang": "10", + "Visual Studio": "15", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + + min_version = self._compilers_min_version.get(str(self.settings.compiler), False) + if min_version: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("twitch-native-ipc requires C++17") + else: + self.output.warn("unknown compiler, assuming C++17 support") + + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".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["ENABLE_CODE_FORMATTING"] = False + self._cmake.definitions["BUILD_TESTING"] = False + + if self.settings.os == "Windows": + self._cmake.definitions["MSVC_DYNAMIC_RUNTIME"] = self.settings.compiler.runtime in ("MD", "MDd") + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + + def package_info(self): + self.cpp_info.libs = ["nativeipc"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines = ["NATIVEIPC_IMPORT"] + + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] + + if tools.stdcpp_library(self): + self.cpp_info.system_libs.append(tools.stdcpp_library(self)) diff --git a/recipes/twitch-native-ipc/all/patches/cmake-fixes.patch b/recipes/twitch-native-ipc/all/patches/cmake-fixes.patch new file mode 100644 index 0000000000000..e9ef8141281a0 --- /dev/null +++ b/recipes/twitch-native-ipc/all/patches/cmake-fixes.patch @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 491ae46..c0a4f3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + cmake_minimum_required(VERSION 3.12) +-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmakeUtils;") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmakeUtils;") + include(setup) + + project(nativeipc) +diff --git a/cmakeUtils/conanutils.cmake b/cmakeUtils/conanutils.cmake +index cc6c07c..cbf0cd6 100644 +--- a/cmakeUtils/conanutils.cmake ++++ b/cmakeUtils/conanutils.cmake +@@ -59,7 +59,8 @@ macro(run_conan) + set(_keeprpath "KEEP_RPATHS") + endif() + +- conan_cmake_run(CONANFILE conan/conanfile.py ++ if(NOT CONAN_EXPORTED) ++ conan_cmake_run(CONANFILE conan/conanfile.py + BASIC_SETUP + CMAKE_TARGETS + NO_OUTPUT_DIRS +@@ -71,4 +72,5 @@ macro(run_conan) + RELWITHDEBINFO_PROFILE ${_profile} + ENV "CONAN_CMAKE_BINARY_DIR_PATH=${CMAKE_BINARY_DIR}" + ) ++ endif() + endmacro() +diff --git a/cmakeUtils/unix.cmake b/cmakeUtils/unix.cmake +index 5f4bb4c..9b2856a 100644 +--- a/cmakeUtils/unix.cmake ++++ b/cmakeUtils/unix.cmake +@@ -1,7 +1,7 @@ + + macro(setup_default_cxx_compile_options) + message("Setting up Unix-Like default settings") +- set(unix_flags "-Wall -Wextra -Werror -Wformat=2 -Wold-style-cast -Wnull-dereference -Wno-missing-field-initializers") ++ set(unix_flags " -Wall -Wextra -Werror -Wformat=2 -Wold-style-cast -Wnull-dereference -Wno-missing-field-initializers") + string(APPEND CMAKE_CXX_FLAGS ${unix_flags}) + string(APPEND CMAKE_C_FLAGS ${unix_flags}) + endmacro() +diff --git a/libnativeipc/CMakeLists.txt b/libnativeipc/CMakeLists.txt +index fe5cc30..173a156 100644 +--- a/libnativeipc/CMakeLists.txt ++++ b/libnativeipc/CMakeLists.txt +@@ -81,7 +81,9 @@ if(MSVC) + endif() + + install(TARGETS nativeipc ++ LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin + ) + + install(DIRECTORY include diff --git a/recipes/twitch-native-ipc/all/patches/export-fixes.patch b/recipes/twitch-native-ipc/all/patches/export-fixes.patch new file mode 100644 index 0000000000000..bf2b82cc8478b --- /dev/null +++ b/recipes/twitch-native-ipc/all/patches/export-fixes.patch @@ -0,0 +1,13 @@ +diff --git a/libnativeipc/include/nativeipc/ConnectionExports.h b/libnativeipc/include/nativeipc/ConnectionExports.h +index 6995217..a100a7c 100644 +--- a/libnativeipc/include/nativeipc/ConnectionExports.h ++++ b/libnativeipc/include/nativeipc/ConnectionExports.h +@@ -13,7 +13,7 @@ + #define NATIVEIPC_LIBSPEC + #endif + +-#include ++#include + + #ifdef __cplusplus + extern "C" { diff --git a/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch b/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch new file mode 100644 index 0000000000000..d62079e114cc8 --- /dev/null +++ b/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch @@ -0,0 +1,85 @@ +diff --git a/libnativeipc/CMakeLists.txt b/libnativeipc/CMakeLists.txt +index fe5cc30..e8f20cd 100644 +--- a/libnativeipc/CMakeLists.txt ++++ b/libnativeipc/CMakeLists.txt +@@ -22,7 +22,7 @@ target_sources(nativeipc PRIVATE + src/LogMacrosWithHandle.h + src/Message.h + src/OperationQueue.cpp +- src/OperationQUeue.h ++ src/OperationQueue.h + src/Pipe-ClientTransport.cpp + src/Pipe-ClientTransport.h + src/Pipe-ServerTransport.cpp +diff --git a/libnativeipc/include/nativeipc/ConnectionFactory.h b/libnativeipc/include/nativeipc/ConnectionFactory.h +index 0dd3aaa..e72682b 100644 +--- a/libnativeipc/include/nativeipc/ConnectionFactory.h ++++ b/libnativeipc/include/nativeipc/ConnectionFactory.h +@@ -3,6 +3,7 @@ + #include "ConnectionExports.h" + #include "IServerConnection.h" + #include ++#include + + namespace Twitch::IPC::ConnectionFactory { + NATIVEIPC_LIBSPEC std::unique_ptr newServerConnection(const std::string &endpoint, bool allowMultiuserAccess = false); +diff --git a/libnativeipc/include/nativeipc/IConnection.h b/libnativeipc/include/nativeipc/IConnection.h +index 30e4db3..f9a9945 100644 +--- a/libnativeipc/include/nativeipc/IConnection.h ++++ b/libnativeipc/include/nativeipc/IConnection.h +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + #include "ConnectionExports.h" + +diff --git a/libnativeipc/src/ConnectionFactoryPrivate.h b/libnativeipc/src/ConnectionFactoryPrivate.h +index 9e4aa64..3e194d9 100644 +--- a/libnativeipc/src/ConnectionFactoryPrivate.h ++++ b/libnativeipc/src/ConnectionFactoryPrivate.h +@@ -2,6 +2,7 @@ + + #include "IClientTransport.h" + #include "IServerTransport.h" ++#include + + namespace Twitch::IPC::ConnectionFactory { + +diff --git a/libnativeipc/src/OperationQueue.h b/libnativeipc/src/OperationQueue.h +index 5778382..8fe202f 100644 +--- a/libnativeipc/src/OperationQueue.h ++++ b/libnativeipc/src/OperationQueue.h +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + namespace Twitch::IPC { + class OperationQueue { +diff --git a/tests/ConnectionTests.cpp b/tests/ConnectionTests.cpp +index 40154b7..9772073 100644 +--- a/tests/ConnectionTests.cpp ++++ b/tests/ConnectionTests.cpp +@@ -183,7 +183,7 @@ struct TestSettings { + return *this; + } + +- TestSettings &LogLevel(LogLevel level) ++ TestSettings &GetLogLevel(LogLevel level) + { + InitLogging(); + _level = level; +@@ -3319,8 +3319,8 @@ TEST_P(MultiConnectIPCTest, MultiInvokeServerDestroyedTest) + auto values = ::testing::Values( + TestSettings{}.SleepOnConnect(0ms).SleepOnDisconnect(0ms).SleepOnData(0ms).SleepOnLog(0ms), + TestSettings{}.SleepOnConnect(1ms).SleepOnDisconnect(1ms).SleepOnData(1ms).SleepOnLog(1ms), +- TestSettings{}.LogLevel(LogLevel::Debug).WriteLogs(true), +- TestSettings{}.SleepOnConnect().SleepOnDisconnect().SleepOnData().SleepOnLog().LogLevel(LogLevel::Debug) ++ TestSettings{}.GetLogLevel(LogLevel::Debug).WriteLogs(true), ++ TestSettings{}.SleepOnConnect().SleepOnDisconnect().SleepOnData().SleepOnLog().GetLogLevel(LogLevel::Debug) + ); + + #if DO_EXPLICIT_CHECKS diff --git a/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt b/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..667b93ec41536 --- /dev/null +++ b/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_executable(example example.c) +target_link_libraries(example ${CONAN_LIBS}) + +add_executable(example2 example2.cpp) +target_link_libraries(example2 ${CONAN_LIBS}) +target_compile_features(example2 PRIVATE cxx_std_17) diff --git a/recipes/twitch-native-ipc/all/test_package/conanfile.py b/recipes/twitch-native-ipc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d9dd1034a8272 --- /dev/null +++ b/recipes/twitch-native-ipc/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TwitchNativeIpcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "example"), run_environment=True) + self.run(os.path.join("bin", "example2"), run_environment=True) diff --git a/recipes/twitch-native-ipc/all/test_package/example.c b/recipes/twitch-native-ipc/all/test_package/example.c new file mode 100644 index 0000000000000..5ba8bef81f80e --- /dev/null +++ b/recipes/twitch-native-ipc/all/test_package/example.c @@ -0,0 +1,19 @@ +#include +#include +#include + +int main() { + void *server = Twitch_IPC_ConnectionCreateServer("test"); + void *client = Twitch_IPC_ConnectionCreateClient("test"); + + if(server && client) + { + printf("success\n"); + Twitch_IPC_ConnectionDestroy(server); + Twitch_IPC_ConnectionDestroy(client); + } + else + { + abort(); + } +} diff --git a/recipes/twitch-native-ipc/all/test_package/example2.cpp b/recipes/twitch-native-ipc/all/test_package/example2.cpp new file mode 100644 index 0000000000000..42a57ddd91913 --- /dev/null +++ b/recipes/twitch-native-ipc/all/test_package/example2.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main() { + using namespace Twitch::IPC; + auto server = ConnectionFactory::newServerConnection("test"); + auto client = ConnectionFactory::newClientConnection("test"); + + if(server && client) { + std::cout << "success\n"; + server.reset(); + client.reset(); + } else { + abort(); + } +} diff --git a/recipes/twitch-native-ipc/config.yml b/recipes/twitch-native-ipc/config.yml new file mode 100644 index 0000000000000..fd9669719a7ad --- /dev/null +++ b/recipes/twitch-native-ipc/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.1": + folder: all diff --git a/recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt b/recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt new file mode 100644 index 0000000000000..3f96a3374441c --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) +include(conanbuildinfo.cmake) + +conan_basic_setup(TARGETS) +add_subdirectory("source_subfolder") diff --git a/recipes/twitchtv-libsoundtrackutil/all/conandata.yml b/recipes/twitchtv-libsoundtrackutil/all/conandata.yml new file mode 100644 index 0000000000000..4c0490bd52328 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.0.8": + url: https://github.com/twitchtv/libsoundtrackutil/archive/v0.0.8.tar.gz + sha256: "95546c40850ee02c03424ca189d66cb4359117b47c87ccc18c5ebe348fd4e040" +patches: + "0.0.8": + - patch_file: "patches/clang-8-fix.patch" + base_path: "source_subfolder" diff --git a/recipes/twitchtv-libsoundtrackutil/all/conanfile.py b/recipes/twitchtv-libsoundtrackutil/all/conanfile.py new file mode 100644 index 0000000000000..8e59051225235 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/conanfile.py @@ -0,0 +1,90 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +from conans.tools import Version +import os + +class TwitchTvLibSoundtrackUtilConan(ConanFile): + name = "twitchtv-libsoundtrackutil" + license = "MIT" + homepage = "https://github.com/twitchtv/libsoundtrackutil" + url = "https://github.com/conan-io/conan-center-index" + description = "Twitch Soundtrack utility library" + topics = ("twitch", "soundtrack") + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + generators = "cmake" + exports = ["CMakeLists.txt", "patches/**"] + requires = ("twitch-native-ipc/3.1.1", + "ms-gsl/2.0.0", + ) + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _compilers_min_version(self): + return { + "gcc": "8", + "clang": "8", + "apple-clang": "10", + "Visual Studio": "15", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + + min_version = self._compilers_min_version.get(str(self.settings.compiler), False) + if min_version: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("{} requires C++17".format(self.name)) + else: + self.output.warn("unknown compiler, assuming C++17 support") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format("libsoundtrackutil", self.version), self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["ENABLE_CODE_FORMATTING"] = False + self._cmake.definitions["BUILD_TESTING"] = False + + if self.settings.compiler == "Visual Studio": + self._cmake.definitions["MSVC_DYNAMIC_RUNTIME"] = self.settings.compiler.runtime in ("MD", "MDd") + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + + def package_info(self): + self.cpp_info.libs = ["libsoundtrackutil"] + + if tools.stdcpp_library(self): + self.cpp_info.system_libs.append(tools.stdcpp_library(self)) diff --git a/recipes/twitchtv-libsoundtrackutil/all/patches/clang-8-fix.patch b/recipes/twitchtv-libsoundtrackutil/all/patches/clang-8-fix.patch new file mode 100644 index 0000000000000..4424e96d20f4a --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/patches/clang-8-fix.patch @@ -0,0 +1,12 @@ +diff --git a/libsoundtrackutil/include/libsoundtrackutil/ByteStream.h b/libsoundtrackutil/include/libsoundtrackutil/ByteStream.h +index 6c0151d..5176bf0 100644 +--- a/libsoundtrackutil/include/libsoundtrackutil/ByteStream.h ++++ b/libsoundtrackutil/include/libsoundtrackutil/ByteStream.h +@@ -5,6 +5,7 @@ + #pragma once + + #include ++#include + #include + + namespace Twitch::Utility { diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt b/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..50f4073082df2 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(PackageTest) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +target_compile_features(example PRIVATE cxx_std_17) diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py b/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6f930d53958b3 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TwitchNativeIpcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "example"), run_environment=True) diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_package/example.cpp b/recipes/twitchtv-libsoundtrackutil/all/test_package/example.cpp new file mode 100644 index 0000000000000..70aedb16a8035 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/test_package/example.cpp @@ -0,0 +1,8 @@ +#include + +using namespace Twitch::Audio; + +int main() +{ + SoundtrackIPC soundtrackIPC({[]() {}, []() {}, [](TwitchAudioPacket audioPacket) {}}); +} diff --git a/recipes/twitchtv-libsoundtrackutil/config.yml b/recipes/twitchtv-libsoundtrackutil/config.yml new file mode 100644 index 0000000000000..dd8c0eaf3cbf3 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.8": + folder: all diff --git a/recipes/type_safe/all/conandata.yml b/recipes/type_safe/all/conandata.yml new file mode 100644 index 0000000000000..8703a48442789 --- /dev/null +++ b/recipes/type_safe/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.2": + url: "https://github.com/foonathan/type_safe/archive/v0.2.2.tar.gz" + sha256: "34d97123fb9bca04a333565c4a2498425d602ec0c759de4be1b8cfae77d05823" + '0.2.1': + url: https://github.com/foonathan/type_safe/archive/v0.2.1.zip + sha256: 1c941f7ecd5e17e80773a2d8c9c905f552cc80417f8006ade7e9fa3525ff1b55 diff --git a/recipes/type_safe/all/conanfile.py b/recipes/type_safe/all/conanfile.py new file mode 100644 index 0000000000000..0864c1a6720cf --- /dev/null +++ b/recipes/type_safe/all/conanfile.py @@ -0,0 +1,37 @@ +from conans import ConanFile, tools +import os + +class TypeSafe(ConanFile): + name = 'type_safe' + description = 'Zero overhead utilities for preventing bugs at compile time' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'https://foonathan.net/type_safe' + license = 'MIT' + topics = 'conan', 'c++', 'strong typing', 'vocabulary-types' + + settings = 'compiler' + + no_copy_source = True + _source_subfolder = 'source_subfolder' + + requires = 'debug_assert/1.3.3' + + @property + def _repo_folder(self): + return os.path.join(self.source_folder, self._source_subfolder) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, '11') + + def package(self): + self.copy("*LICENSE", dst="licenses", keep_path=False) + self.copy("*", src=os.path.join(self._repo_folder, 'include'), dst='include/') + + def package_id(self): + self.info.header_only() diff --git a/recipes/type_safe/all/test_package/CMakeLists.txt b/recipes/type_safe/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ae887aa6aea --- /dev/null +++ b/recipes/type_safe/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/type_safe/all/test_package/conanfile.py b/recipes/type_safe/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/type_safe/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/type_safe/all/test_package/test_package.cpp b/recipes/type_safe/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d2359707d187e --- /dev/null +++ b/recipes/type_safe/all/test_package/test_package.cpp @@ -0,0 +1,79 @@ +// Copyright (C) 2016-2019 Jonathan Müller +// This file is subject to the license terms in the LICENSE file +// found in the top-level directory of this distribution. + +#include +#include +#include + +#include + +namespace ts = type_safe; + +// we want some kind of handle to an int +struct handle : ts::strong_typedef, // required + ts::strong_typedef_op::equality_comparison, // for operator==/operator!= + ts::strong_typedef_op::dereference // for operator*/operator-> +{ + using strong_typedef::strong_typedef; + + // we also want the operator bool() + explicit operator bool() const noexcept + { + return static_cast(*this) != nullptr; + } +}; + +void use_handle(handle h) +{ + // we can dereference it + std::cout << *h << '\n'; + + // and compare it + (void)(h == handle(nullptr)); + + // and reassign + int a; + h = handle(&a); + // or get back + int* ptr = static_cast(h); + std::cout << &a << ' ' << ptr << '\n'; +} + +// integer representing a distance +struct distance +: ts::strong_typedef, // required + ts::strong_typedef_op::equality_comparison, // for operator==/operator!= + ts::strong_typedef_op::relational_comparison, // for operator< etc. + ts::strong_typedef_op::integer_arithmetic // all arithmetic operators that make sense + // for integers +{ + using strong_typedef::strong_typedef; +}; + +// we want to output it +std::ostream& operator<<(std::ostream& out, const distance& d) +{ + return out << static_cast(d) << " distance"; +} + +namespace std +{ +// we want to use it with the std::unordered_* containers +template <> +struct hash<::distance> : type_safe::hashable<::distance> +{}; + +} // namespace std + +int main() +{ + distance d(4); + // int val = d; // error + // d += 3; // error + d += distance(3); // works + + std::unordered_set set{d}; + + std::cout << *set.find(d) << '\n'; +} diff --git a/recipes/type_safe/config.yml b/recipes/type_safe/config.yml new file mode 100644 index 0000000000000..3d99cc668cde3 --- /dev/null +++ b/recipes/type_safe/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.2": + folder: all + '0.2.1': + folder: all diff --git a/recipes/ua-nodeset/all/conandata.yml b/recipes/ua-nodeset/all/conandata.yml new file mode 100644 index 0000000000000..53a56121e6682 --- /dev/null +++ b/recipes/ua-nodeset/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "padim-1.02-2021-07-21": + # This is just the latest tag on the 1.04 release branch as of 23Sep2021 + url: https://github.com/OPCFoundation/UA-Nodeset/archive/refs/tags/PADIM-1.02-2021-07-21.tar.gz + sha256: 05c83369ea82cd275d47ccc46a6d919c81392e2d0b7444a3e538ee3ba482dbee diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py new file mode 100644 index 0000000000000..0414764f76035 --- /dev/null +++ b/recipes/ua-nodeset/all/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class UaNodeSetConan(ConanFile): + name = "ua-nodeset" + license = "MIT" + description = "UANodeSets and other normative files which are released with a specification" + homepage = "https://github.com/OPCFoundation/UA-Nodeset" + url = "https://github.com/conan-io/conan-center-index" + topics = ("opc-ua-specifications", "uanodeset", "normative-files", "companion-specification") + + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def _extract_license(self): + content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "AnsiC", "opcua_clientapi.c")) + license_contents = content[2:content.find("*/", 1)] + tools.save("LICENSE", license_contents) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def build(self): + pass + + + def package(self): + self._extract_license() + self.copy("*", dst="res", src=self._source_subfolder) + self.copy("LICENSE", dst="licenses") + + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] + self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") + diff --git a/recipes/ua-nodeset/all/test_package/conanfile.py b/recipes/ua-nodeset/all/test_package/conanfile.py new file mode 100644 index 0000000000000..872e7a1f2874d --- /dev/null +++ b/recipes/ua-nodeset/all/test_package/conanfile.py @@ -0,0 +1,12 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestUaNodeSetConan(ConanFile): + + def build(self): + pass + + def test(self): + assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) + diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml new file mode 100644 index 0000000000000..aa2c76941582c --- /dev/null +++ b/recipes/ua-nodeset/config.yml @@ -0,0 +1,3 @@ +versions: + "padim-1.02-2021-07-21": + folder: all diff --git a/recipes/uchardet/all/CMakeLists.txt b/recipes/uchardet/all/CMakeLists.txt new file mode 100644 index 0000000000000..a17cdee90b035 --- /dev/null +++ b/recipes/uchardet/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup(KEEP_RPATH) + +add_subdirectory("source_subfolder") diff --git a/recipes/uchardet/all/conandata.yml b/recipes/uchardet/all/conandata.yml new file mode 100644 index 0000000000000..30099f9e54a80 --- /dev/null +++ b/recipes/uchardet/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.7": + url: https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.7.tar.xz + sha256: "3fc79408ae1d84b406922fa9319ce005631c95ca0f34b205fad867e8b30e45b1" diff --git a/recipes/uchardet/all/conanfile.py b/recipes/uchardet/all/conanfile.py new file mode 100644 index 0000000000000..bb92e982496c4 --- /dev/null +++ b/recipes/uchardet/all/conanfile.py @@ -0,0 +1,103 @@ +from conans import ConanFile, CMake, tools +import os +import functools + +required_conan_version = ">=1.33.0" + + +class UchardetConan(ConanFile): + name = "uchardet" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/freedesktop/uchardet" + description = "uchardet is an encoding detector library, which takes a sequence of bytes in an unknown character encoding and attempts to determine the encoding of the text. Returned encoding names are iconv-compatible." + topics = "encoding", "detector" + license = "MPL-1.1" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "check_sse2": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "check_sse2": True, + } + + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self._settings_build not in ("x86", "x86_64"): + del self.options.check_sse2 + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + # the following fixes that apply to uchardet version 0.0.7 + # fix broken cmake + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "${CMAKE_BINARY_DIR}", + "${CMAKE_CURRENT_BINARY_DIR}") + # fix problem with mac os + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + 'string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE)', + 'string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" TARGET_ARCHITECTURE)') + # disable building tests + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "add_subdirectory(test)", + "#add_subdirectory(test)") + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["CHECK_SSE2"] = self.options.get_safe("check_sse2", False) + cmake.definitions["BUILD_BINARY"] = False + cmake.definitions["BUILD_STATIC"] = False # disable building static libraries when self.options.shared is True + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "uchardet") + self.cpp_info.set_property("cmake_target_name", "uchardet") + self.cpp_info.set_property("pkg_config_name", "libuchardet") + + self.cpp_info.names["cmake_find_package"] = "uchardet" + self.cpp_info.names["cmake_find_package_multi"] = "uchardet" + self.cpp_info.names["pkgconfig"] = "libuchardet" + self.cpp_info.libs = ["uchardet"] + if self.options.shared: + self.cpp_info.defines.append("UCHARDET_SHARED") diff --git a/recipes/uchardet/all/test_package/CMakeLists.txt b/recipes/uchardet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a726e6f66a3bd --- /dev/null +++ b/recipes/uchardet/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(uchardet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE uchardet::uchardet) diff --git a/recipes/uchardet/all/test_package/conanfile.py b/recipes/uchardet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/uchardet/all/test_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/uchardet/all/test_package/test_package.cpp b/recipes/uchardet/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5abd9dda519ed --- /dev/null +++ b/recipes/uchardet/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char** argv) { + auto ud = uchardet_new(); + uchardet_delete(ud); + return 0; +} diff --git a/recipes/uchardet/config.yml b/recipes/uchardet/config.yml new file mode 100644 index 0000000000000..3b1adbf0ba92f --- /dev/null +++ b/recipes/uchardet/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.7": + folder: all diff --git a/recipes/ulfius/all/conandata.yml b/recipes/ulfius/all/conandata.yml new file mode 100644 index 0000000000000..fc73e1163d024 --- /dev/null +++ b/recipes/ulfius/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.7.11": + url: "https://github.com/babelouest/ulfius/archive/refs/tags/v2.7.11.tar.gz" + sha256: "6f6fadf2fed0516f6f2203b9e5afcd9c6dfeee0cb48a27f659d6c4e21d1b456f" +patches: + "2.7.11": + - patch_file: "patches/2.7.11-0001-shared-static-conan.patch" + patch_description: "Build shared and static libraries" + patch_type: "portability" + - patch_file: "patches/2.7.11-0002-pthread-for-websockets-only.patch" + patch_description: "pthread is only required when using websockets" + patch_type: "portability" diff --git a/recipes/ulfius/all/conanfile.py b/recipes/ulfius/all/conanfile.py new file mode 100644 index 0000000000000..675ce5de0ba1e --- /dev/null +++ b/recipes/ulfius/all/conanfile.py @@ -0,0 +1,217 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class UlfiusConan(ConanFile): + name = "ulfius" + description = "Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language" + homepage = "https://github.com/babelouest/ulfius" + topics = ("web", "http", "rest", "endpoint", "json", "websocket") + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_websockets": [True, False], + "with_gnutls": [True, False], + "with_jansson": [True, False], + "with_libcurl": [True, False], + "with_yder": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_websockets": False, # FIXME: should be True (cannot be True because of missing gnutls recipe) + "with_gnutls": False, # FIXME: should be True + "with_jansson": True, + "with_libcurl": True, + "with_yder": True, + } + + def config_options(self): + if self.settings.os == "Windows": + self.options.enable_websockets = False + del self.options.fPIC + + def validate(self): + if self.options.with_gnutls: + raise ConanInvalidConfiguration("with_gnutls=True is not yet implemented due to missing gnutls CCI recipe") + if self.settings.os == "Windows" and self.options.enable_websockets: + raise ConanInvalidConfiguration("ulfius does not support with_websockets=True on Windows") + + 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 + + def requirements(self): + self.requires("orcania/2.3.1") + self.requires("libmicrohttpd/0.9.75") + if self.options.with_yder: + self.requires("yder/1.4.18") + if self.options.with_jansson: + self.requires("jansson/2.14") + if self.options.with_libcurl: + self.requires("libcurl/7.85.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["DOWNLOAD_DEPENDENCIES"] = False + tc.variables["WITH_GNUTLS"] = self.options.with_gnutls + tc.variables["WITH_WEBSOCKETS"] = self.options.enable_websockets + tc.variables["WITH_CURL"] = self.options.with_libcurl + tc.variables["WITH_JANSSON"] = self.options.with_jansson + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + # https://github.com/conan-io/conan/issues/12367 + move this before running CMakeDeps.generate() + save(self, os.path.join(self.generators_folder, "MHDConfig.cmake"), textwrap.dedent(f"""\ + include(CMakeFindDependencyMacro) + find_dependency(libmicrohttpd) + + set(MHD_FOUND TRUE) + add_library(MHD::MHD INTERFACE IMPORTED) + set_target_properties(MHD::MHD PROPERTIES INTERFACE_LINK_LIBRARIES "libmicrohttpd::libmicrohttpd") + set(MHD_VERSION_STRING {self.dependencies['libmicrohttpd'].ref.version}) + """)) + save(self, os.path.join(self.generators_folder, "MHDConfigVersion.cmake"), textwrap.dedent(f"""\ + set(PACKAGE_VERSION "{ self.dependencies['libmicrohttpd'].ref.version }") + + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() + """)) + + # Shared ulfius looks for Orcania::Orcania and Yder::Yder + # Static ulfius looks for Orcania::Orcania-static and Yder::Yder-static + if self.options.shared: + if not self.dependencies["orcania"].options.shared: + save(self, os.path.join(self.generators_folder, "OrcaniaConfig.cmake"), textwrap.dedent("""\ + add_library(Orcania::Orcania INTERFACE IMPORTED) + set_target_properties(Orcania::Orcania PROPERTIES INTERFACE_LINK_LIBRARIES "Orcania::Orcania-static") + """), append=True) + if self.options.with_yder and not self.dependencies["yder"].options.shared: + save(self, os.path.join(self.generators_folder, "YderConfig.cmake"), textwrap.dedent("""\ + add_library(Yder::Yder INTERFACE IMPORTED) + set_target_properties(Yder::Yder PROPERTIES INTERFACE_LINK_LIBRARIES "Yder::Yder-static") + """), append=True) + + # Create Jansson::Jansson + if self.options.with_jansson: + save(self, os.path.join(self.generators_folder, "jansson-config.cmake"), textwrap.dedent(f"""\ + add_library(Jansson::Jansson INTERFACE IMPORTED) + set_target_properties(Jansson::Jansson PROPERTIES INTERFACE_LINK_LIBRARIES "jansson::jansson") + set(JANSSON_VERSION_STRING {self.dependencies['jansson'].ref.version}) + """), append=True) + + if self.options.with_gnutls: + # FIXME: make sure gnutls creates GnuTLSCOnfig.cmake + GnuTLS::GnuTLS target + GNUTLS_VERSION_STRING + pass + + 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, "LICENSE", os.path.join(self.source_folder), 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + save(self, os.path.join(self.package_folder, self._variable_file_rel_path), + textwrap.dedent(f"""\ + set(ULFIUS_VERSION_STRING "{self.version}") + """)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {} if self.options.shared else {"Ulfius::Ulfius-static": "Ulfius::Ulfius"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _variable_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + libname = "ulfius" + if is_msvc(self) and not self.options.shared: + libname += "-static" + self.cpp_info.libs = [libname] + + target_name = "Ulfius::Ulfius" if self.options.shared else "Ulfius::Ulfius-static" + self.cpp_info.set_property("cmake_file_name", "Ulfius") + self.cpp_info.set_property("cmake_target_name", target_name) + self.cpp_info.set_property("pkg_config_name", "libulfius") + self.cpp_info.set_property("cmake_build_modules", [self._variable_file_rel_path]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Ulfius" + self.cpp_info.filenames["cmake_find_package_multi"] = "Ulfius" + self.cpp_info.names["cmake_find_package"] = "Ulfius" + self.cpp_info.names["cmake_find_package_multi"] = "Ulfius" + self.cpp_info.names["pkg_config"] = "libulfius" + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path, self._variable_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, self._variable_file_rel_path] diff --git a/recipes/ulfius/all/patches/2.7.11-0001-shared-static-conan.patch b/recipes/ulfius/all/patches/2.7.11-0001-shared-static-conan.patch new file mode 100644 index 0000000000000..0ea893bf22c64 --- /dev/null +++ b/recipes/ulfius/all/patches/2.7.11-0001-shared-static-conan.patch @@ -0,0 +1,323 @@ +--- src/CMakeLists.txt 2022-10-15 16:33:21.000000000 +0200 ++++ CMakeLists.txt 2022-11-04 17:47:35.458046726 +0100 +@@ -20,11 +20,11 @@ + + set(CMAKE_C_STANDARD 99) + if (NOT MSVC) +- set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") ++ set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") + endif() + + # library info +- ++set(ULFIUS_LIBS ) + set(PROJECT_DESCRIPTION "Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services") + set(PROJECT_HOMEPAGE_URL "https://github.com/babelouest/ulfius/") + set(PROJECT_BUGREPORT_PATH "https://github.com/babelouest/ulfius/issues") +@@ -64,10 +64,10 @@ + + set(U_CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) + list(APPEND CMAKE_MODULE_PATH "${U_CMAKE_MODULE_PATH}") +- + include(GNUInstallDirs) + include(CheckSymbolExists) +- ++include(CMakeDependentOption) ++include(CMakePackageConfigHelpers) + # check if _GNU_SOURCE is available + + if (NOT _GNU_SOURCE) +@@ -105,32 +105,32 @@ + + # pthread libraries + find_package (Threads) +-set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT}) ++list(APPEND ULFIUS_LIBS ${CMAKE_THREAD_LIBS_INIT}) + + # GNU TLS support + option(WITH_GNUTLS "GNU TLS support" ON) + + if (WITH_GNUTLS) +- include(FindGnuTLS) ++ #include(FindGnuTLS) + find_package(GnuTLS REQUIRED) ++ list(APPEND ULFIUS_LIBS GnuTLS::GnuTLS) + if (GNUTLS_FOUND) +- set(LIBS ${LIBS} ${GNUTLS_LIBRARIES}) +- include_directories(${GNUTLS_INCLUDE_DIRS}) +- endif () ++ #include_directories(${GNUTLS_INCLUDE_DIRS}) ++ endif() + endif () + +-# websocket support ++# current websocket implementation depends on GNU TLS, and is not supported on Windows + +-option(WITH_WEBSOCKET "Websocket support" ON) +- +-if (WIN32) +- set(WITH_WEBSOCKET OFF) +-endif () ++cmake_dependent_option(WITH_WEBSOCKET "Websocket support" ON "NOT WIN32;WITH_GNUTLS" OFF) + ++#if (WIN32) ++# set(WITH_WEBSOCKET OFF) ++#endif () ++# + # current websocket implementation depends on GNU TLS +-if (NOT WITH_GNUTLS) +- set(WITH_WEBSOCKET OFF) +-endif () ++#if (NOT WITH_GNUTLS) ++# set(WITH_WEBSOCKET OFF) ++#endif () + + if (WITH_WEBSOCKET AND NOT ${RELEASE_CODENAME} STREQUAL "stretch") + set(MHD_MIN_VERSION 0.9.53) +@@ -144,24 +144,23 @@ + set(U_DISABLE_GNUTLS ON) + endif () + +-include(FindMHD) ++#include(FindMHD) + find_package(MHD ${MHD_MIN_VERSION} REQUIRED) +-if (MHD_FOUND) +- set(LIBS ${LIBS} ${MHD_LIBRARIES}) +- include_directories(${MHD_INCLUDE_DIRS}) +- if (MHD_VERSION_STRING VERSION_LESS "0.9.53") +- set(WITH_WEBSOCKET OFF) +- endif () ++#if (MHD_FOUND) ++#endif() ++list(APPEND ULFIUS_LIBS MHD::MHD) ++#include_directories(${MHD_INCLUDE_DIRS}) ++if (MHD_VERSION_STRING VERSION_LESS "0.9.53") ++ set(WITH_WEBSOCKET OFF) + endif () + + if (WITH_WEBSOCKET) + set(U_DISABLE_WEBSOCKET OFF) +- include(FindZLIB) + find_package(ZLIB REQUIRED) +- if (ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) +- include_directories(${ZLIB_INCLUDE_DIRS}) +- endif () ++ list(APPEND ULFIUS_LIBS ZLIB::ZLIB) ++ #if (ZLIB_FOUND) ++ #set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) ++ #endif () + else () + set(U_DISABLE_WEBSOCKET ON) + endif () +@@ -169,13 +168,13 @@ + option(WITH_CURL "Use Curl library" ON) + + if (WITH_CURL) +- include(FindCURL) + find_package(CURL REQUIRED) +- if (CURL_FOUND) +- set(LIBS ${LIBS} ${CURL_LIBRARIES}) +- include_directories(${CURL_INCLUDE_DIRS}) +- set(U_DISABLE_CURL OFF) ++ if (NOT TARGET CURL::libcurl) ++ add_library(CURL::libcurl INTERFACE IMPORTED) ++ set_target_properties(CURL::libcurl PROPERTIES INTERFACE_LINK_LIBRARIES "${CURL_LIBRARIES}"INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + endif () ++ list(APPEND ULFIUS_LIBS CURL::libcurl) ++ set(U_DISABLE_CURL OFF) + else () + set(U_DISABLE_CURL ON) + endif () +@@ -183,14 +182,14 @@ + option(WITH_JANSSON "Use jansson library" ON) + + if (WITH_JANSSON) +- include(FindJansson) + set(JANSSON_MIN_VERSION 2.4) + find_package(Jansson ${JANSSON_MIN_VERSION} REQUIRED) +- if (JANSSON_FOUND) +- include_directories(${JANSSON_INCLUDE_DIRS}) +- set(LIBS ${LIBS} ${JANSSON_LIBRARIES}) +- set(U_DISABLE_JANSSON OFF) +- endif () ++ list(APPEND ULFIUS_LIBS Jansson::Jansson) ++ set(U_DISABLE_JANSSON OFF) ++ #if (JANSSON_FOUND) ++ #include_directories(${JANSSON_INCLUDE_DIRS}) ++ #set(LIBS ${LIBS} ${JANSSON_LIBRARIES}) ++ #endif () + else () + set(U_DISABLE_JANSSON ON) + endif () +@@ -199,32 +198,31 @@ + # The following 2 blocks are put BEFORE searching for Orcania and Yder by design + # Otherwise it will lead to cmake errors + # DON'T MOVE IT BELOW PLEASE! +- + # static library +- ++option(BUILD_SHARED "Build shared library." ON) + option(BUILD_STATIC "Build static library." OFF) +- + if (BUILD_STATIC) + add_library(ulfius_static STATIC ${LIB_SRC}) +- target_compile_definitions(ulfius_static PUBLIC -DO_STATIC_LIBRARY) +- set_target_properties(ulfius_static PROPERTIES +- OUTPUT_NAME ulfius) ++ target_include_directories(ulfius_static PUBLIC "$" PUBLIC "$" PUBLIC "$") ++ target_link_libraries(ulfius_static PUBLIC ${ULFIUS_LIBS}) ++ target_compile_definitions(ulfius_static PUBLIC O_STATIC_LIBRARY) ++ set_target_properties(ulfius_static PROPERTIES PUBLIC_HEADER "${INC_DIR}/ulfius.h;${PROJECT_BINARY_DIR}/ulfius-cfg.h" OUTPUT_NAME ulfius EXPORT_NAME Ulfius-static) ++ if (MSVC) ++ set_target_properties(ulfius_static PROPERTIES OUTPUT_NAME ulfius-static) ++ endif () ++ set(ulfius_lib ulfius_static) + endif () +- + # shared library +- +-add_library(ulfius SHARED ${LIB_SRC}) +-if (NOT MSVC) +- set_target_properties(ulfius PROPERTIES +- COMPILE_OPTIONS -Wextra +- PUBLIC_HEADER "${INC_DIR}/ulfius.h;${PROJECT_BINARY_DIR}/ulfius-cfg.h" +- VERSION "${LIBRARY_VERSION}" +- SOVERSION "${LIBRARY_SOVERSION}") +-endif() +-if (WIN32) +- set_target_properties(ulfius PROPERTIES SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll") ++if (BUILD_SHARED) ++ add_library(ulfius SHARED ${LIB_SRC}) ++ target_include_directories(ulfius PUBLIC "$" PUBLIC "$" PUBLIC "$") ++ target_link_libraries(ulfius PUBLIC ${ULFIUS_LIBS}) ++ set_target_properties(ulfius PROPERTIES PUBLIC_HEADER "${INC_DIR}/ulfius.h;${PROJECT_BINARY_DIR}/ulfius-cfg.h" VERSION "${LIBRARY_VERSION}" SOVERSION "${LIBRARY_SOVERSION}" WINDOWS_EXPORT_ALL_SYMBOLS TRUE EXPORT_NAME Ulfius) ++ if (WIN32) ++ set_target_properties(ulfius PROPERTIES SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll") ++ endif () ++ set(ulfius_lib ulfius) + endif () +-target_link_libraries(ulfius ${LIBS}) + + # documentation + +@@ -255,9 +253,9 @@ + option(SEARCH_ORCANIA_U "Search for ORCANIA library" ON) + if (SEARCH_ORCANIA_U) + set(Orcania_FIND_QUIETLY ON) # force to find Orcania quietly +- include(FindOrcania) +- find_package(Orcania ${ORCANIA_VERSION_REQUIRED} QUIET) # try to find orcania +- if (NOT ORCANIA_FOUND) ++ #include(FindOrcania) ++ find_package(Orcania ${ORCANIA_VERSION_REQUIRED} REQUIRED) # try to find orcania ++ if (NOT Orcania_FOUND) + if (DOWNLOAD_DEPENDENCIES) + include(DownloadProject) + download_project(PROJ orcania # ... otherwise, download archive +@@ -273,26 +271,33 @@ + message( FATAL_ERROR "Orcania not found") + endif () + else() +- set(LIBS ${LIBS} ${ORCANIA_LIBRARIES}) +- include_directories(${ORCANIA_INCLUDE_DIRS}) ++ if (NOT ("${ORCANIA_VERSION_STRING}" VERSION_GREATER_EQUAL "${ORCANIA_VERSION_REQUIRED}")) ++ message( FATAL_ERROR "Orcania version required: ${ORCANIA_VERSION_REQUIRED} - version installed: ${ORCANIA_VERSION_STRING}") ++ endif () + endif () +- target_link_libraries(ulfius ${LIBS} ${ORCANIA_LIBRARIES}) ++endif () ++if (BUILD_SHARED) ++ target_link_libraries(ulfius PUBLIC $) ++endif () ++if (BUILD_STATIC) ++ if(TARGET Orcania::Orcania-static) ++ target_link_libraries(ulfius_static PUBLIC $) ++ else() ++ target_link_libraries(ulfius_static PUBLIC $) ++ endif() + endif () + + option(WITH_YDER "Use Yder library to log messages" ON) + option(SEARCH_YDER "Search for Yder library" ON) + +-set(LIB_YDER "") + if (WITH_YDER) +- set(LIB_YDER "-lyder") + set(U_DISABLE_YDER OFF) + set(SEARCH_ORCANIA OFF CACHE BOOL "Force to false") # Avoid to search and download orcania during yder search and download + + if (SEARCH_YDER) + set(Yder_FIND_QUIETLY ON) # force to find Yder quietly +- include(FindYder) + find_package(Yder ${YDER_VERSION_REQUIRED} QUIET) # try to find Yder +- if (NOT YDER_FOUND) ++ if (NOT Yder_FOUND) + if (DOWNLOAD_DEPENDENCIES) + include(DownloadProject) + download_project(PROJ yder # ... otherwise, download archive +@@ -307,10 +312,21 @@ + message( FATAL_ERROR "Yder not found") + endif () + else() +- set(LIBS ${LIBS} ${YDER_LIBRARIES}) +- include_directories(${YDER_INCLUDE_DIRS}) ++ if ("${YDER_VERSION_STRING}" VERSION_GREATER_EQUAL "${YDER_VERSION_REQUIRED}") ++ else () ++ message( FATAL_ERROR "Yder version required: ${YDER_VERSION_REQUIRED} - version installed: ${YDER_VERSION_STRING}") ++ endif () ++ endif () ++ if (BUILD_SHARED) ++ target_link_libraries(ulfius PUBLIC $) ++ endif () ++ if (BUILD_STATIC) ++ if(TARGET Yder::Yder-static) ++ target_link_libraries(ulfius_static PUBLIC $) ++ else() ++ target_link_libraries(ulfius_static PUBLIC $) ++ endif() + endif () +- target_link_libraries(ulfius ${LIBS} ${YDER_LIBRARIES}) + endif () + else () + set(U_DISABLE_YDER ON) +@@ -318,17 +334,13 @@ + + # build uwsc + +-option(BUILD_UWSC "Build uwsc application." ON) +- +-if (NOT WITH_WEBSOCKET) +- set(BUILD_UWSC OFF) +-endif () ++cmake_dependent_option(BUILD_UWSC "Build uwsc application." ON "WITH_WEBSOCKET" OFF) + + if (BUILD_UWSC) + add_executable(uwsc ${UWSC_DIR}/uwsc.c ${INC_DIR}/ulfius.h ${INC_DIR}/u_private.h ${PROJECT_BINARY_DIR}/ulfius-cfg.h) + set_target_properties(uwsc PROPERTIES SKIP_BUILD_RPATH TRUE) + add_dependencies(uwsc ulfius) +- target_link_libraries(uwsc ulfius ${LIBS}) ++ target_link_libraries(uwsc PRIVATE "${ulfius_lib}") + install(TARGETS uwsc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + INSTALL(FILES ${UWSC_DIR}/uwsc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT runtime) + endif () +@@ -353,7 +365,7 @@ + # build ulfius-cfg.h file + configure_file(${INC_DIR}/ulfius-cfg.h.in ${PROJECT_BINARY_DIR}/ulfius-cfg.h) + set (CMAKE_EXTRA_INCLUDE_FILES ${PROJECT_BINARY_DIR}) +-include_directories(${PROJECT_BINARY_DIR}) ++#include_directories(${PROJECT_BINARY_DIR}) + + # tests + +@@ -435,9 +447,9 @@ + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libulfius.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +-SET (TARGETS ulfius) ++SET (TARGETS ${ulfius_lib}) + if (BUILD_STATIC) +- SET (TARGETS ${TARGETS} ulfius_static) ++ #SET (TARGETS ${TARGETS} ulfius_static) + endif () + + if (INSTALL_HEADER) diff --git a/recipes/ulfius/all/patches/2.7.11-0002-pthread-for-websockets-only.patch b/recipes/ulfius/all/patches/2.7.11-0002-pthread-for-websockets-only.patch new file mode 100644 index 0000000000000..cf3559e240556 --- /dev/null +++ b/recipes/ulfius/all/patches/2.7.11-0002-pthread-for-websockets-only.patch @@ -0,0 +1,41 @@ +From fab66efc6b64cfe6d21e4ab0b60d00a06ceee860 Mon Sep 17 00:00:00 2001 +From: Nicolas Mora +Date: Sun, 23 Oct 2022 13:53:08 -0400 +Subject: [PATCH] Include pthread.h with websockets only + +Close #243 +--- + include/ulfius.h | 2 +- + src/ulfius.c | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/include/ulfius.h b/include/ulfius.h +index 7b327dd..772554b 100644 +--- a/include/ulfius.h ++++ b/include/ulfius.h +@@ -51,12 +51,12 @@ extern "C" + #ifndef U_DISABLE_WEBSOCKET + #include + #include ++ #include + #ifndef POLLRDHUP + #define POLLRDHUP 0x2000 + #endif + #endif + +-#include + #include + + #if defined(_WIN32) && !defined(U_DISABLE_WEBSOCKET) +diff --git a/src/ulfius.c b/src/ulfius.c +index c004048..4a147cf 100644 +--- a/src/ulfius.c ++++ b/src/ulfius.c +@@ -30,7 +30,6 @@ + #endif + + #include +-#include + #include + #include + diff --git a/recipes/ulfius/all/test_package/CMakeLists.txt b/recipes/ulfius/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5abb20511e4c7 --- /dev/null +++ b/recipes/ulfius/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Ulfius REQUIRED CONFIG) + +option(ULFIUS_SHARED "Ulfius is built as a shared library") + +add_executable(${PROJECT_NAME} test_package.c) +if(ULFIUS_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Ulfius::Ulfius) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Ulfius::Ulfius-static) +endif() diff --git a/recipes/ulfius/all/test_package/conanfile.py b/recipes/ulfius/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9885e9d6fa11b --- /dev/null +++ b/recipes/ulfius/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ULFIUS_SHARED"] = self.dependencies["ulfius"].options.shared + 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/ulfius/all/test_package/test_package.c b/recipes/ulfius/all/test_package/test_package.c new file mode 100644 index 0000000000000..6677e3c86a579 --- /dev/null +++ b/recipes/ulfius/all/test_package/test_package.c @@ -0,0 +1,64 @@ +/** + * test.c + * Small Hello World! example + * to compile with gcc, run the following command + * gcc -o test test.c -lulfius + */ +#include + +#include +#include + +#define PORT 8080 + +/** + * Callback function for the web application on /helloworld url call + */ +int callback_hello_world (const struct _u_request * request, struct _u_response * response, void * user_data) { + ulfius_set_string_body_response(response, 200, "Hello World!"); + return U_CALLBACK_CONTINUE; +} + +/** + * main function + */ +int main(int argc, char *argv[]) { + struct _u_instance instance; + + if (ulfius_global_init() != U_OK) { + fprintf(stderr, "Error ulfius_global_init, abort\n"); + return(1); + } + + // Avoid running a server on CI + if (argc > 1 && strcmp(argv[1], "run") == 0) { + + // Initialize instance with the port number + if (ulfius_init_instance(&instance, PORT, NULL, NULL) != U_OK) { + fprintf(stderr, "Error ulfius_init_instance, abort\n"); + return(1); + } + + // Endpoint list declaration + ulfius_add_endpoint_by_val(&instance, "GET", "/helloworld", NULL, 0, &callback_hello_world, NULL); + + // Start the framework + if (ulfius_start_framework(&instance) == U_OK) { + printf("Start framework on port %d\n", instance.port); + + // Wait for the user to press on the console to quit the application + getchar(); + } else { + fprintf(stderr, "Error starting framework\n"); + } + printf("End framework\n"); + + ulfius_stop_framework(&instance); + + ulfius_clean_instance(&instance); + } + + ulfius_global_close(); + + return 0; +} diff --git a/recipes/ulfius/all/test_v1_package/CMakeLists.txt b/recipes/ulfius/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c0c854f00b188 --- /dev/null +++ b/recipes/ulfius/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Ulfius REQUIRED CONFIG) + +option(ULFIUS_SHARED "Ulfius is built as a shared library") + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(ULFIUS_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Ulfius::Ulfius) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Ulfius::Ulfius-static) +endif() diff --git a/recipes/ulfius/all/test_v1_package/conanfile.py b/recipes/ulfius/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..32ed9b5ed5ce3 --- /dev/null +++ b/recipes/ulfius/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ULFIUS_SHARED"] = self.options["ulfius"].shared + 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/ulfius/config.yml b/recipes/ulfius/config.yml new file mode 100644 index 0000000000000..f0814bc8af2c7 --- /dev/null +++ b/recipes/ulfius/config.yml @@ -0,0 +1,3 @@ +versions: + "2.7.11": + folder: all diff --git a/recipes/uncrustify/all/conandata.yml b/recipes/uncrustify/all/conandata.yml new file mode 100644 index 0000000000000..22c525b3881bd --- /dev/null +++ b/recipes/uncrustify/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "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/all/conanfile.py b/recipes/uncrustify/all/conanfile.py new file mode 100644 index 0000000000000..da8a4d29e3f0e --- /dev/null +++ b/recipes/uncrustify/all/conanfile.py @@ -0,0 +1,73 @@ +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, mkdir, rename, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.47.0" + + +class UncrustifyConan(ConanFile): + name = "uncrustify" + description = "Code beautifier" + license = "GPL-2.0-or-later" + topics = "beautifier", "command-line" + homepage = "https://github.com/uncrustify/uncrustify" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=7") + + 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["NoGitVersionString"] = True + tc.variables["BUILD_TESTING"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + if is_msvc(self): + mkdir(self, os.path.join(self.package_folder, "bin")) + rename(self, os.path.join(self.package_folder, "uncrustify.exe"), + os.path.join(self.package_folder, "bin", "uncrustify.exe")) + os.remove(os.path.join(self.package_folder, "AUTHORS")) + os.remove(os.path.join(self.package_folder, "BUGS")) + os.remove(os.path.join(self.package_folder, "COPYING")) + os.remove(os.path.join(self.package_folder, "ChangeLog")) + os.remove(os.path.join(self.package_folder, "HELP")) + os.remove(os.path.join(self.package_folder, "README.md")) + rmdir(self, os.path.join(self.package_folder, "cfg")) + rmdir(self, os.path.join(self.package_folder, "doc")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Adding to PATH: {binpath}") + self.env_info.PATH.append(binpath) diff --git a/recipes/uncrustify/all/test_package/conanfile.py b/recipes/uncrustify/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ca7e7aabaf2bf --- /dev/null +++ b/recipes/uncrustify/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("uncrustify --version", env="conanrun") diff --git a/recipes/uncrustify/all/test_v1_package/conanfile.py b/recipes/uncrustify/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a60815102333e --- /dev/null +++ b/recipes/uncrustify/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("uncrustify --version", run_environment=True) diff --git a/recipes/uncrustify/config.yml b/recipes/uncrustify/config.yml new file mode 100644 index 0000000000000..27d29acb91740 --- /dev/null +++ b/recipes/uncrustify/config.yml @@ -0,0 +1,5 @@ +versions: + "0.75.1": + folder: all + "0.74.0": + folder: all diff --git a/recipes/uni-algo/all/conandata.yml b/recipes/uni-algo/all/conandata.yml new file mode 100644 index 0000000000000..5bec751a95929 --- /dev/null +++ b/recipes/uni-algo/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.8.0": + url: "https://github.com/uni-algo/uni-algo/archive/refs/tags/v0.8.0.tar.gz" + sha256: "657f124f4fb4705f948e9c0835ec88484ee4745d7b19cb2ddb772119a7ea024e" + "0.7.1": + url: "https://github.com/uni-algo/uni-algo/archive/refs/tags/v0.7.1.tar.gz" + sha256: "9ff1f03d6ffd81df7a2a21df353502db55d198a940da0aef0546b37ca934fdfb" + "0.7.0": + url: "https://github.com/uni-algo/uni-algo/archive/refs/tags/v0.7.0.tar.gz" + sha256: "c8d078461c77fa4e50013ea4e1263466163eac9102fca2e125bd5c992de6cc2f" + "0.6.0": + url: "https://github.com/uni-algo/uni-algo/archive/refs/tags/v0.6.0.tar.gz" + sha256: "b2b0cf62c8476895ce2dae51459f8df82cd27b6f199b014cb5b2dbb45a605187" diff --git a/recipes/uni-algo/all/conanfile.py b/recipes/uni-algo/all/conanfile.py new file mode 100644 index 0000000000000..6db6b84997bdc --- /dev/null +++ b/recipes/uni-algo/all/conanfile.py @@ -0,0 +1,130 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +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" + + +class UniAlgoConan(ConanFile): + name = "uni-algo" + package_type = "library" + description = "Unicode Algorithms Implementation for C/C++" + license = ("MIT", "Unlicense") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/uni-algo/uni-algo" + topics = ("unicode", "utf-8", "utf-16", "header-only") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "8", + "apple-clang": "11", + } + + 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 layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + 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.options.get_safe("shared"): + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared with msvc") + + 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.variables["UNI_ALGO_HEADER_ONLY"] = self.options.header_only + tc.generate() + + def build(self): + if not self.options.header_only: + 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) + if self.options.header_only: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + if self.options.header_only: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + else: + if self.settings.build_type == "Debug": + if Version(self.version) < "0.7": + self.cpp_info.libs = [f"{self.name}d"] + else: + self.cpp_info.libs = [f"{self.name}-debug"] + else: + self.cpp_info.libs = [f"{self.name}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # see https://github.com/uni-algo/uni-algo/blob/v0.7.1/CMakeLists.txt#L75-L109 + self.cpp_info.set_property("cmake_file_name", "uni-algo") + self.cpp_info.set_property("cmake_target_name", "uni-algo::uni-algo") diff --git a/recipes/uni-algo/all/test_package/CMakeLists.txt b/recipes/uni-algo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2c2668410d8a6 --- /dev/null +++ b/recipes/uni-algo/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(uni-algo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE uni-algo::uni-algo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if(uni-algo_VERSION VERSION_LESS "0.7.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE -DUNI_ALGO_NAMESPACE_UNI) +endif() diff --git a/recipes/uni-algo/all/test_package/conanfile.py b/recipes/uni-algo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/uni-algo/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/uni-algo/all/test_package/test_package.cpp b/recipes/uni-algo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9a151c2fa3703 --- /dev/null +++ b/recipes/uni-algo/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +// This code was cited from https://github.com/uni-algo/uni-algo/tree/v0.1.0#convert-module +#include "uni_algo/all.h" + +int main() { + // Lenient conversion (cannot fail) "\xD800" is unpaired high surrogate in + // UTF-16 + { +#ifdef UNI_ALGO_NAMESPACE_UNI + std::string str8 = uni::utf16to8(u"Te\xD800st"); +#else + std::string str8 = una::utf16to8(u"Te\xD800st"); +#endif + assert(str8 == "Te\xEF\xBF\xBDst"); // "\xEF\xBF\xBD" is replacement + // character U+FFFD in UTF-8 + } + + // Strict conversion + { +#ifdef UNI_ALGO_NAMESPACE_UNI + uni::error error; + std::string str8 = uni::strict::utf16to8(u"Te\xD800st", error); +#else + una::error error; + std::string str8 = una::strict::utf16to8(u"Te\xD800st", error); +#endif + assert(str8.empty() && error && error.pos() == 2); + } + + return 0; +} diff --git a/recipes/uni-algo/all/test_v1_package/CMakeLists.txt b/recipes/uni-algo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/uni-algo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/uni-algo/all/test_v1_package/conanfile.py b/recipes/uni-algo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/uni-algo/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/uni-algo/config.yml b/recipes/uni-algo/config.yml new file mode 100644 index 0000000000000..e65f3bb5dd3af --- /dev/null +++ b/recipes/uni-algo/config.yml @@ -0,0 +1,9 @@ +versions: + "0.8.0": + folder: all + "0.7.1": + folder: all + "0.7.0": + folder: all + "0.6.0": + folder: all diff --git a/recipes/unicorn/all/conandata.yml b/recipes/unicorn/all/conandata.yml new file mode 100644 index 0000000000000..8687bbd470670 --- /dev/null +++ b/recipes/unicorn/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.0.1": + url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/2.0.1.tar.gz" + sha256: "0c1586f6b079e705d760403141db0ea65d0e22791cf0f43f38172d49497923fd" + "2.0.0": + url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/2.0.0.tar.gz" + sha256: "67b445c760e2bbac663e8c8bc410e43311c7fc92df4dfa8d90e06a021d07f634" + "1.0.3": + url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/1.0.3.tar.gz" + sha256: "64fba177dec64baf3f11c046fbb70e91483e029793ec6a3e43b028ef14dc0d65" +patches: + "2.0.1": + - patch_file: "patches/2.0.1-0001-cmake-msvc-support.patch" + - patch_file: "patches/2.0.1-0002-cmake-msvc-runtime.patch" + "2.0.0": + - patch_file: "patches/2.0.0-0001-cmake-msvc-support.patch" + - patch_file: "patches/2.0.0-0002-cmake-msvc-runtime.patch" + "1.0.3": + - patch_file: "patches/1.0.3-0001-cmake-crossbuild-support.patch" diff --git a/recipes/unicorn/all/conanfile.py b/recipes/unicorn/all/conanfile.py new file mode 100644 index 0000000000000..10435417a72cf --- /dev/null +++ b/recipes/unicorn/all/conanfile.py @@ -0,0 +1,163 @@ +from conan import ConanFile +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 apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import stat +import textwrap + +required_conan_version = ">=1.54.0" + + +class UnicornConan(ConanFile): + name = "unicorn" + description = "Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework." + topics = ("emulator", "security", "arm", "framework", "cpu", "mips", "x86-64", "reverse-engineering", "x86", "arm64", "sparc", "m68k") + homepage = "https://www.unicorn-engine.org/" + url = "https://github.com/conan-io/conan-center-index" + license = ("GPL-2-or-later", "LGPL-2-or-later") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "supported_archs": ["ANY"], # comma-separated list of archs + } + default_options = { + "shared": False, + "fPIC": True, + "supported_archs": ["ANY"], # defaults to all archs supported by the current version. See `config_options`. + } + + @property + def _all_supported_archs(self): + """ + Get all supported architectures of the current version + :return: sorted list of strings + """ + return sorted(["aarch64", "arm", "m68k", "mips", "sparc", "x86"]) + + def _supported_archs(self, info=False): + """ + Get supported architectures of the current build/package (depends on self.options.supported_archs) + :return: sorted list of strings + """ + options = self.info.options if info else self.options + return sorted(set(str(options.supported_archs).split(","))) + + @property + def _needs_jwasm(self): + return self.settings.os == "Windows" and not is_msvc(self) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.supported_archs = ",".join(self._all_supported_archs) + + 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 package_id(self): + # normalize the supported_archs option (sorted+comma separated) + self.info.options.supported_archs = ",".join(self._supported_archs(info=True)) + + def validate(self): + unsupported_archs = [arch for arch in self._supported_archs() if arch not in self._all_supported_archs] + if unsupported_archs: + raise ConanInvalidConfiguration( + f"Invalid arch(s) in supported_archs option: {unsupported_archs}\n" + f"Valid supported architectures are: {self._all_supported_archs}" + ) + if "arm" in self.settings.arch: + # FIXME: will/should be fixed with unicorn 2 (https://github.com/unicorn-engine/unicorn/issues/1379) + raise ConanInvalidConfiguration("arm builds of unicorn are currently unsupported") + + def build_requirements(self): + if self._needs_jwasm: + self.tool_requires("jwasm/2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _jwasm_wrapper(self): + return os.path.join(self.build_folder, "jwasm_wrapper.py") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["UNICORN_INSTALL"] = True + tc.variables["UNICORN_BUILD_SAMPLES"] = False + tc.cache_variables["UNICORN_ARCH"] = ";".join(self._supported_archs()) + if self._needs_jwasm: + tc.variables["CMAKE_ASM_MASM_COMPILER"] = self._jwasm_wrapper + if self.settings.arch == "x86_64": + tc.variables["CMAKE_ASM_MASM_FLAGS"] = { + "x86_64": "-win64", + "x86": "-coff", + }[str(self.settings.arch)] + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self._needs_jwasm: + save(self, self._jwasm_wrapper, textwrap.dedent("""\ + #!/usr/bin/env python + import os + import sys + import subprocess + args = ["jwasm"] + # Convert '/' options to '-' + for arg in sys.argv[1:]: + if arg in ("-fpic", "-fPIC", "-Wall", "-fvisibility=hidden"): + continue + if os.path.exists(arg): + args.append(arg) + elif arg[:1] == "/": + args.append("-"+arg[1:]) + else: + args.append(arg) + print("args:", args) + subprocess.run(args, check=True) + """)) + os.chmod(self._jwasm_wrapper, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + for lic in ("COPYING", "COPYING.LGPL2", "COPYING_GLIB"): + copy(self, lic, 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")) + if Version(self.version) >= "2.0.0" and self.options.shared: + rm(self, "*unicorn.a", os.path.join(self.package_folder, "lib")) + rm(self, "*unicorn.lib", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "unicorn") + suffix = "-import" if Version(self.version) >= "2.0.0" and is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"unicorn{suffix}"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/unicorn/all/patches/1.0.3-0001-cmake-crossbuild-support.patch b/recipes/unicorn/all/patches/1.0.3-0001-cmake-crossbuild-support.patch new file mode 100644 index 0000000000000..3a5a5b964cb73 --- /dev/null +++ b/recipes/unicorn/all/patches/1.0.3-0001-cmake-crossbuild-support.patch @@ -0,0 +1,40 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -162,7 +192,7 @@ + if (UNICORN_HAS_SPARC) + set (EXTRA_CFLAGS "${EXTRA_CFLAGS}-DUNICORN_HAS_SPARC ") + endif() +- set (EXTRA_CFLAGS "${EXTRA_CFLAGS}-fPIC -fvisibility=hidden") ++ set (EXTRA_CFLAGS "${EXTRA_CFLAGS}-fPIC -fvisibility=hidden ${CMAKE_C_FLAGS}") + + set(TARGET_LIST "--target-list=") + if (UNICORN_HAS_X86) +@@ -185,10 +185,28 @@ + endif() + set (TARGET_LIST "${TARGET_LIST} ") + ++ set (HOST_CPU) ++ if (CMAKE_CROSSCOMPILING) ++ if (CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86_64") ++ set (HOST_CPU x86_64) ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "[iI][3456]86|[xX]86") ++ set (HOST_CPU i386) ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|armv[89]") ++ set (HOST_CPU aarch64) ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "armv?[3-7]") ++ set (HOST_CPU arm) ++ endif () ++ endif () ++ set (CPU_ARG) ++ if (HOST_CPU) ++ set (CPU_ARG "--cpu=${HOST_CPU}") ++ endif() ++ + # GEN config-host.mak & target directories + execute_process(COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/qemu/configure + ${EXTRA_CFLAGS} + ${TARGET_LIST} ++ ${CPU_ARG} --cc=${CMAKE_C_COMPILER} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + execute_process(COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/qemu/scripts/create_config diff --git a/recipes/unicorn/all/patches/2.0.0-0001-cmake-msvc-support.patch b/recipes/unicorn/all/patches/2.0.0-0001-cmake-msvc-support.patch new file mode 100644 index 0000000000000..773322ce2d920 --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.0-0001-cmake-msvc-support.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1416,7 +1416,7 @@ if(UNICORN_BUILD_TESTS) + endif() + + +-if(UNICORN_INSTALL AND NOT MSVC) ++if(UNICORN_INSTALL) + include("GNUInstallDirs") + file(GLOB UNICORN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/unicorn/*.h) + if (BUILD_SHARED_LIBS) diff --git a/recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch b/recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch new file mode 100644 index 0000000000000..b28165288cd1f --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -100,7 +100,7 @@ + add_compile_options($<$:/wd4267>) + + # handle msvcrt setting being passed in CMAKE_C_FLAGS +- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) ++ if(FALSE) + # do not support other methods of setting this (it would be more conformant, tho) + message(FATAL_ERROR "please set msvcrt via CMAKE_C_FLAGS") + endif() diff --git a/recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch b/recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch new file mode 100644 index 0000000000000..93cdf2304d9ee --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85597f46..3161d714 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1431,7 +1431,7 @@ if(UNICORN_BUILD_TESTS) + endif() + + +-if(UNICORN_INSTALL AND NOT MSVC) ++if(UNICORN_INSTALL) + include("GNUInstallDirs") + file(GLOB UNICORN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/unicorn/*.h) + if (BUILD_SHARED_LIBS) diff --git a/recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch b/recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch new file mode 100644 index 0000000000000..0d1c0d94f4fa4 --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85597f46..1467bc55 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,8 +108,10 @@ if(MSVC) + add_compile_options($<$:/wd4244>) + add_compile_options($<$:/wd4267>) + ++ message(OUTPUT "CMAKE_MSVC_RUNTIME_LIBRARY ${CMAKE_MSVC_RUNTIME_LIBRARY} CMAKE_C_FLAGS ${CMAKE_C_FLAGS}") ++ + # handle msvcrt setting being passed in CMAKE_C_FLAGS +- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) ++ if(FALSE) + # do not support other methods of setting this (it would be more conformant, tho) + message(FATAL_ERROR "please set msvcrt via CMAKE_C_FLAGS") + endif() diff --git a/recipes/unicorn/all/test_package/CMakeLists.txt b/recipes/unicorn/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..20222cfa58800 --- /dev/null +++ b/recipes/unicorn/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(unicorn REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE unicorn::unicorn) diff --git a/recipes/unicorn/all/test_package/conanfile.py b/recipes/unicorn/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/unicorn/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/unicorn/all/test_package/test_package.c b/recipes/unicorn/all/test_package/test_package.c new file mode 100644 index 0000000000000..addecfb10401b --- /dev/null +++ b/recipes/unicorn/all/test_package/test_package.c @@ -0,0 +1,73 @@ +#include "unicorn/unicorn.h" + +#include + +// x86 code to be emulated +#define X86_CODE32 "\x90\x41\x4a" // NOP; INC ecx; DEC edx; + +// memory address where emulation starts +#define ADDRESS 0x1000000 + +static int emul_x86() { + uc_engine *uc; + uc_err err; + + printf("Emulate i386 code\n"); + + int r_ecx = 0x1234; // ECX register + int r_edx = 0x7890; // EDX register + + printf("CPU context before:\n", r_ecx); + printf(">>> ECX = 0x%x\n", r_ecx); + printf(">>> EDX = 0x%x\n", r_edx); + + // Initialize emulator in X86-32bit mode + err = uc_open(UC_ARCH_X86, UC_MODE_32, &uc); + if (err != UC_ERR_OK) { + printf("Failed on uc_open() with error returned: %u\n", err); + return -1; + } + + // map 2MB memory for this emulation + uc_mem_map(uc, ADDRESS, 2 * 1024 * 1024, UC_PROT_ALL); + + // write machine code to be emulated to memory + if (uc_mem_write(uc, ADDRESS, X86_CODE32, sizeof(X86_CODE32) - 1)) { + printf("Failed to write emulation code to memory, quit!\n"); + return -1; + } + + // initialize machine registers + uc_reg_write(uc, UC_X86_REG_ECX, &r_ecx); + uc_reg_write(uc, UC_X86_REG_EDX, &r_edx); + + // emulate code in infinite time & unlimited instructions + err = uc_emu_start(uc, ADDRESS, ADDRESS + sizeof(X86_CODE32) - 1, 0, 0); + if (err) { + printf("Failed on uc_emu_start() with error returned %u: %s\n", + err, uc_strerror(err)); + } + + // now print out some registers + printf("Emulation done. CPU context\n"); + + uc_reg_read(uc, UC_X86_REG_ECX, &r_ecx); + uc_reg_read(uc, UC_X86_REG_EDX, &r_edx); + printf(">>> ECX = 0x%x\n", r_ecx); + printf(">>> EDX = 0x%x\n", r_edx); + + uc_close(uc); + return 0; +} + + +int main() { + unsigned int major, minor; + uc_version(&major, &minor); + printf("unicorn version %d.%d\n", major, minor); + + if (uc_arch_supported(UC_ARCH_X86)) { + return emul_x86(); + } + return 0; +} diff --git a/recipes/unicorn/all/test_v1_package/CMakeLists.txt b/recipes/unicorn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/unicorn/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/unicorn/all/test_v1_package/conanfile.py b/recipes/unicorn/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/unicorn/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/unicorn/config.yml b/recipes/unicorn/config.yml new file mode 100644 index 0000000000000..7daf28aace362 --- /dev/null +++ b/recipes/unicorn/config.yml @@ -0,0 +1,7 @@ +versions: + "2.0.1": + folder: "all" + "2.0.0": + folder: "all" + "1.0.3": + folder: "all" diff --git a/recipes/units/all/conandata.yml b/recipes/units/all/conandata.yml new file mode 100644 index 0000000000000..5286960fcf8dc --- /dev/null +++ b/recipes/units/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.3.3": + url: "https://github.com/nholthaus/units/archive/v2.3.3.tar.gz" + sha256: "b1f3c1dd11afa2710a179563845ce79f13ebf0c8c090d6aa68465b18bd8bd5fc" + "2.3.1": + url: "https://github.com/nholthaus/units/archive/v2.3.1.tar.gz" + sha256: "4a242a6e1b117f0234dffc2796c9133ca57d114f0fdf2c200754e6770db6bfd8" diff --git a/recipes/units/all/conanfile.py b/recipes/units/all/conanfile.py new file mode 100644 index 0000000000000..abb3f73f19041 --- /dev/null +++ b/recipes/units/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 copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class UnitsConan(ConanFile): + name = "units" + description = ( + "A compile-time, header-only, dimensional analysis and unit conversion " + "library built on c++14 with no dependencies" + ) + license = "MIT" + topics = ("unit-conversion", "dimensional-analysis", "cpp14", + "template-metaprogramming", "compile-time", "header-only", + "no-dependencies") + homepage = "https://github.com/nholthaus/units" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "clang": "3.4", + "gcc": "4.9.3", + "Visual Studio": "14", + "msvc": "190", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "units.h", 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_file_name", "units") + self.cpp_info.set_property("cmake_target_name", "units::units") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/units/all/test_package/CMakeLists.txt b/recipes/units/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34eb08429bc23 --- /dev/null +++ b/recipes/units/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(units REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE units::units) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/units/all/test_package/conanfile.py b/recipes/units/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/units/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/units/all/test_package/test_package.cpp b/recipes/units/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..87d8c1da64352 --- /dev/null +++ b/recipes/units/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include + +using namespace units::literals; +using namespace units::length; +using namespace units::math; + +int main() +{ + meter_t a = 3_m; + meter_t b = 4_m; + meter_t c = sqrt(pow<2>(a) + pow<2>(b)); // Pythagorean threorem. + std::cout << c << std::endl; // prints: "5 m" +} diff --git a/recipes/units/all/test_v1_package/CMakeLists.txt b/recipes/units/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b01d1d5fd06ef --- /dev/null +++ b/recipes/units/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(units REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE units::units) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/units/all/test_v1_package/conanfile.py b/recipes/units/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e0a85886fc12c --- /dev/null +++ b/recipes/units/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/units/config.yml b/recipes/units/config.yml new file mode 100644 index 0000000000000..12ddc838534be --- /dev/null +++ b/recipes/units/config.yml @@ -0,0 +1,5 @@ +versions: + "2.3.3": + folder: all + "2.3.1": + folder: all diff --git a/recipes/univalue/all/conandata.yml b/recipes/univalue/all/conandata.yml new file mode 100644 index 0000000000000..1cbda6bed44a6 --- /dev/null +++ b/recipes/univalue/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.1.1": + url: "https://github.com/jgarzik/univalue/archive/v1.1.1.tar.gz" + sha256: "72760ce6cdaa7b3cc1d47c54ca3e3f494d213084796b4c7694c4aba85a447db2" + "1.0.5": + url: "https://github.com/jgarzik/univalue/archive/v1.0.5.tar.gz" + sha256: "59eee225b078066c60277cab6dd93e74a0e7bed2be455db507eb39bd4f8e4319" +patches: + "1.1.1": + - patch_file: "patches/1.1.1-0001-fix-windows.patch" + "1.0.5": + - patch_file: "patches/1.0.5-0001-fix-windows.patch" diff --git a/recipes/univalue/all/conanfile.py b/recipes/univalue/all/conanfile.py new file mode 100644 index 0000000000000..3111f6d607d1b --- /dev/null +++ b/recipes/univalue/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class UnivalueConan(ConanFile): + name = "univalue" + description = "High performance RAII C++ JSON library and universal value object class" + topics = ("universal", "json", "encoding", "decoding") + license = "MIT" + homepage = "https://github.com/jgarzik/univalue" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @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 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + automake_conf = self.dependencies.build["automake"].conf_info + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("CPP", "cl -nologo -EP") + env.define("LD", "link -nologo") + env.define("CXXLD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + if is_msvc(self): + replace_in_file( + self, + os.path.join(self.build_folder, "libtool"), + "-Wl,-DLL,-IMPLIB", + "-link -DLL -link -DLL -link -IMPLIB", + ) + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "univalue.dll.lib"), + os.path.join(self.package_folder, "lib", "univalue.lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libunivalue") + self.cpp_info.libs = ["univalue"] + if self.options.shared: + self.cpp_info.defines = ["UNIVALUE_SHARED"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/univalue/all/patches/1.0.5-0001-fix-windows.patch b/recipes/univalue/all/patches/1.0.5-0001-fix-windows.patch new file mode 100644 index 0000000000000..43978f5cc60d7 --- /dev/null +++ b/recipes/univalue/all/patches/1.0.5-0001-fix-windows.patch @@ -0,0 +1,89 @@ +--- configure.ac ++++ configure.ac +@@ -42,14 +42,14 @@ + AC_SUBST(LIBUNIVALUE_REVISION) + AC_SUBST(LIBUNIVALUE_AGE) + +-LT_INIT ++LT_INIT([win32-dll]) + LT_LANG([C++]) + +-case $host in +- *mingw*) +- LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" +- ;; +-esac ++#case $host in ++# *mingw*) ++# LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" ++# ;; ++#esac + + BUILD_EXEEXT= + case $build in +diff -ur source/source_subfolder/Makefile.am source_modified/source_subfolder/Makefile.am +--- Makefile.am ++++ Makefile.am +@@ -34,6 +34,8 @@ + @echo Updating $< + $(AM_V_at)$(GENBIN) > lib/univalue_escapes.h + ++if FALSE ++ + noinst_PROGRAMS = $(TESTS) test/test_json + + TEST_DATA_DIR=test +@@ -58,6 +60,8 @@ + test_object_CXXFLAGS = -I$(top_srcdir)/include + test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) + ++endif ++ + TEST_FILES = \ + $(TEST_DATA_DIR)/fail10.json \ + $(TEST_DATA_DIR)/fail11.json \ +--- include/univalue.h ++++ include/univalue.h +@@ -16,7 +16,19 @@ + + #include // std::pair + +-class UniValue { ++#ifdef _WIN32 ++# ifdef EXPORT_DLL ++# define UNIVALUE_API __declspec(dllexport) ++# elif defined(UNIVALUE_SHARED) ++# define UNIVALUE_API __declspec(dllimport) ++# endif ++#endif ++ ++#ifndef UNIVALUE_API ++# define UNIVALUE_API ++#endif ++ ++UNIVALUE_API class UniValue { + public: + enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, }; + +@@ -262,9 +274,9 @@ + JTOK_STRING, + }; + +-extern enum jtokentype getJsonToken(std::string& tokenVal, ++UNIVALUE_API extern enum jtokentype getJsonToken(std::string& tokenVal, + unsigned int& consumed, const char *raw, const char *end); +-extern const char *uvTypeName(UniValue::VType t); ++UNIVALUE_API extern const char *uvTypeName(UniValue::VType t); + + static inline bool jsonTokenIsValue(enum jtokentype jtt) + { +@@ -299,8 +311,8 @@ + // not reached + } + +-extern const UniValue NullUniValue; ++UNIVALUE_API extern const UniValue NullUniValue; + + const UniValue& find_value( const UniValue& obj, const std::string& name); + + #endif // __UNIVALUE_H__ diff --git a/recipes/univalue/all/patches/1.1.1-0001-fix-windows.patch b/recipes/univalue/all/patches/1.1.1-0001-fix-windows.patch new file mode 100644 index 0000000000000..40da82b6aa010 --- /dev/null +++ b/recipes/univalue/all/patches/1.1.1-0001-fix-windows.patch @@ -0,0 +1,89 @@ +--- configure.ac ++++ configure.ac +@@ -42,14 +42,14 @@ + AC_SUBST(LIBUNIVALUE_REVISION) + AC_SUBST(LIBUNIVALUE_AGE) + +-LT_INIT ++LT_INIT([win32-dll]) + LT_LANG([C++]) + +-case $host in +- *mingw*) +- LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" +- ;; +-esac ++#case $host in ++# *mingw*) ++# LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" ++# ;; ++#esac + + BUILD_EXEEXT= + case $build in +diff -ur source/source_subfolder/Makefile.am source_modified/source_subfolder/Makefile.am +--- Makefile.am ++++ Makefile.am +@@ -34,6 +34,8 @@ + @echo Updating $< + $(AM_V_at)$(GENBIN) > lib/univalue_escapes.h + ++if FALSE ++ + noinst_PROGRAMS = $(TESTS) test/test_json + + TEST_DATA_DIR=test +@@ -58,6 +60,8 @@ + test_object_CXXFLAGS = -I$(top_srcdir)/include + test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) + ++endif ++ + TEST_FILES = \ + $(TEST_DATA_DIR)/fail10.json \ + $(TEST_DATA_DIR)/fail11.json \ +--- include/univalue.h ++++ include/univalue.h +@@ -16,7 +16,19 @@ + + #include // std::pair + +-class UniValue { ++#ifdef _WIN32 ++# ifdef EXPORT_DLL ++# define UNIVALUE_API __declspec(dllexport) ++# elif defined(UNIVALUE_SHARED) ++# define UNIVALUE_API __declspec(dllimport) ++# endif ++#endif ++ ++#ifndef UNIVALUE_API ++# define UNIVALUE_API ++#endif ++ ++UNIVALUE_API class UniValue { + public: + enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, }; + +@@ -215,9 +215,9 @@ + JTOK_STRING, + }; + +-extern enum jtokentype getJsonToken(std::string& tokenVal, ++UNIVALUE_API extern enum jtokentype getJsonToken(std::string& tokenVal, + unsigned int& consumed, const char *raw, const char *end); +-extern const char *uvTypeName(UniValue::VType t); ++UNIVALUE_API extern const char *uvTypeName(UniValue::VType t); + + static inline bool jsonTokenIsValue(enum jtokentype jtt) + { +@@ -252,8 +252,8 @@ + // not reached + } + +-extern const UniValue NullUniValue; ++UNIVALUE_API extern const UniValue NullUniValue; + + const UniValue& find_value( const UniValue& obj, const std::string& name); + + #endif // __UNIVALUE_H__ diff --git a/recipes/univalue/all/test_package/CMakeLists.txt b/recipes/univalue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2d1b2f3c62e86 --- /dev/null +++ b/recipes/univalue/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(univalue REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE univalue::univalue) diff --git a/recipes/univalue/all/test_package/conanfile.py b/recipes/univalue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/univalue/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/univalue/all/test_package/test_package.cpp b/recipes/univalue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..06e3067282011 --- /dev/null +++ b/recipes/univalue/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +#include +#include + +int main(int argc, char *argv[]) +{ + UniValue package1(UniValue::VOBJ); + package1.pushKV("name", "univalue"); + package1.pushKV("number", 1337); + package1.pushKV("double", 3.14); + UniValue package2(UniValue::VOBJ); + package2.pushKV("name", "boost"); + package2.pushKV("bool", true); + UniValue parents(UniValue::VOBJ); + parents.pushKV("p1", package1); + parents.pushKV("p2", package2); + + std::cout << parents.write(2) << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/univalue/all/test_v1_package/CMakeLists.txt b/recipes/univalue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/univalue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/univalue/all/test_v1_package/conanfile.py b/recipes/univalue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/univalue/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/univalue/config.yml b/recipes/univalue/config.yml new file mode 100644 index 0000000000000..597adf0d30080 --- /dev/null +++ b/recipes/univalue/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.1": + folder: all + "1.0.5": + folder: all diff --git a/recipes/unleash-client-cpp/all/CMakeLists.txt b/recipes/unleash-client-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..b71c882d9d33f --- /dev/null +++ b/recipes/unleash-client-cpp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/unleash-client-cpp/all/conandata.yml b/recipes/unleash-client-cpp/all/conandata.yml new file mode 100644 index 0000000000000..76a5bca8da701 --- /dev/null +++ b/recipes/unleash-client-cpp/all/conandata.yml @@ -0,0 +1,8 @@ +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" diff --git a/recipes/unleash-client-cpp/all/conanfile.py b/recipes/unleash-client-cpp/all/conanfile.py new file mode 100644 index 0000000000000..08a60bfc378de --- /dev/null +++ b/recipes/unleash-client-cpp/all/conanfile.py @@ -0,0 +1,116 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class UnleashConan(ConanFile): + name = "unleash-client-cpp" + homepage = "https://github.com/aruizs/unleash-client-cpp/" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + description = "Unleash Client SDK for C++ projects." + topics = ("unleash", "feature", "flag", "toggle") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "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" + + @property + def _compilers_min_version(self): + return { + "Visual Studio": "15", # Should we check toolset? + "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 + + def requirements(self): + self.requires("cpr/1.7.2") + self.requires("nlohmann_json/3.10.5") + + 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] + + 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): + raise ConanInvalidConfiguration( + "{} requires C++{}, which your compiler does not support.".format(self.name, self._min_cppstd) + ) + + 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 + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + 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 new file mode 100644 index 0000000000000..f88f88c81dde7 --- /dev/null +++ b/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000000000..5dfa06d3b7057 --- /dev/null +++ b/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(unleash CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} 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 new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/unleash-client-cpp/all/test_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/unleash-client-cpp/all/test_package/test_package.cpp b/recipes/unleash-client-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9af855c3e03d7 --- /dev/null +++ b/recipes/unleash-client-cpp/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + unleash::UnleashClient unleashClient = unleash::UnleashClient::create("production", "https://www.apple.com/%"); + unleashClient.initializeClient(); + return unleashClient.isEnabled("feature.toogle"); + +} diff --git a/recipes/unleash-client-cpp/config.yml b/recipes/unleash-client-cpp/config.yml new file mode 100644 index 0000000000000..60d31991f5141 --- /dev/null +++ b/recipes/unleash-client-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1": + folder: all diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml new file mode 100644 index 0000000000000..b9bf5f8340caa --- /dev/null +++ b/recipes/unordered_dense/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "4.0.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.0.0.tar.gz" + sha256: "c9d43bfc60ed03e9aa667bc6d3c586f7a04dfb0082333b0e50624aac71c53172" + "3.1.1": + url: "https://github.com/martinus/unordered_dense/archive/v3.1.1.tar.gz" + sha256: "634194cec08f6a41aa72ed4804719cdf8ba94f9ba8575bf7a80496a33dfbbb12" + "3.1.0": + url: "https://github.com/martinus/unordered_dense/archive/v3.1.0.tar.gz" + sha256: "adf8670bf494a84f1148687375ac568e2990167b8ced3cc1e5bacc9f6c49f272" + "3.0.2": + url: "https://github.com/martinus/unordered_dense/archive/v3.0.2.tar.gz" + sha256: "0c0b874e9682cce3c75a1152308bfbb108538aaf1e90824d7789e2b64122520b" + "3.0.0": + url: "https://github.com/martinus/unordered_dense/archive/v3.0.0.tar.gz" + sha256: "e73452d7c1e274b4a15b553c0904f1de4bcfa61b00514acd1eaad7deac805ef0" + "2.0.1": + url: "https://github.com/martinus/unordered_dense/archive/v2.0.1.tar.gz" + sha256: "450d53bd8709f9476702a3c4975bf6e40d66059b25b125e480534228d7f5616d" + "2.0.0": + url: "https://github.com/martinus/unordered_dense/archive/v2.0.0.tar.gz" + sha256: "e838bdcf380a1aeb6f1fee17fbdf59d7a14b6b9fb6dfca32981e4cbd60739d20" + "1.4.0": + url: "https://github.com/martinus/unordered_dense/archive/v1.4.0.tar.gz" + sha256: "36b6bfe2fe2633f9d9c537b9b808b4be6b77ff51c66d370d855f477517bc3bc9" + "1.3.3": + url: "https://github.com/martinus/unordered_dense/archive/v1.3.3.tar.gz" + sha256: "621a984d7f1de156d3078ecb5e1252bcc2ebc875de6eb6b8635f6c2a0898e496" + "1.3.2": + url: "https://github.com/martinus/unordered_dense/archive/v1.3.2.tar.gz" + sha256: "f12db3b93f31f7f20f4d8cac6adc551f6ae17a5b9a16040abeee427f54427953" + "1.3.1": + url: "https://github.com/martinus/unordered_dense/archive/refs/tags/v1.3.1.tar.gz" + sha256: "d393168833d6609c9eaf54a05b19fc3120f68b85feffb282ab225119a86df1d4" diff --git a/recipes/unordered_dense/all/conanfile.py b/recipes/unordered_dense/all/conanfile.py new file mode 100644 index 0000000000000..a0da7f7d17e30 --- /dev/null +++ b/recipes/unordered_dense/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class PackageConan(ConanFile): + name = "unordered_dense" + description = "A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinus/unordered_dense" + topics = ("unordered_map", "unordered_set", "hashmap", "hashset", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "11", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "ankerl"), src=os.path.join(self.source_folder, "include", "ankerl")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "unordered_dense") + self.cpp_info.set_property("cmake_target_name", "unordered_dense::unordered_dense") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "unordered_dense" + self.cpp_info.filenames["cmake_find_package_multi"] = "unordered_dense" + self.cpp_info.names["cmake_find_package"] = "unordered_dense" + self.cpp_info.names["cmake_find_package_multi"] = "unordered_dense" diff --git a/recipes/unordered_dense/all/test_package/CMakeLists.txt b/recipes/unordered_dense/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b9de8205fed9d --- /dev/null +++ b/recipes/unordered_dense/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(unordered_dense REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE unordered_dense::unordered_dense) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/unordered_dense/all/test_package/conanfile.py b/recipes/unordered_dense/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/unordered_dense/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/unordered_dense/all/test_package/test_package.cpp b/recipes/unordered_dense/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..428f955bc9dea --- /dev/null +++ b/recipes/unordered_dense/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +// sited from https://github.com/martinus/unordered_dense/blob/main/example/main.cpp +#include + +#include + +auto main() -> int { + auto map = ankerl::unordered_dense::map(); + map[123] = "hello"; + map[987] = "world!"; + + for (auto const& [key, val] : map) { + std::cout << key << " => " << val << std::endl; + } +} diff --git a/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a9b48732268c --- /dev/null +++ b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/unordered_dense/all/test_v1_package/conanfile.py b/recipes/unordered_dense/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/unordered_dense/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml new file mode 100644 index 0000000000000..d28b5937a6b4e --- /dev/null +++ b/recipes/unordered_dense/config.yml @@ -0,0 +1,23 @@ +versions: + "4.0.0": + folder: all + "3.1.1": + folder: all + "3.1.0": + folder: all + "3.0.2": + folder: all + "3.0.0": + folder: all + "2.0.1": + folder: all + "2.0.0": + folder: all + "1.4.0": + folder: all + "1.3.3": + folder: all + "1.3.2": + folder: all + "1.3.1": + folder: all diff --git a/recipes/unqlite/all/conandata.yml b/recipes/unqlite/all/conandata.yml new file mode 100644 index 0000000000000..2800a156996fd --- /dev/null +++ b/recipes/unqlite/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.9": + url: "https://github.com/symisc/unqlite/archive/refs/tags/v1.1.9.tar.gz" + sha256: "33d5b5e7b2ca223942e77d31112d2e20512bc507808414451c8a98a7be5e15c0" diff --git a/recipes/unqlite/all/conanfile.py b/recipes/unqlite/all/conanfile.py new file mode 100644 index 0000000000000..b9783b0fc81d0 --- /dev/null +++ b/recipes/unqlite/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class UnqliteConan(ConanFile): + name = "unqlite" + description = "An Embedded NoSQL, Transactional Database Engine." + license = "BSD-2-Clause" + topics = ("nosql", "database", "transactional", "storage") + homepage = "https://unqlite.org" + url = "https://github.com/conan-io/conan-center-index" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + 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.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["unqlite"] diff --git a/recipes/unqlite/all/test_package/CMakeLists.txt b/recipes/unqlite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a726d8ff8063f --- /dev/null +++ b/recipes/unqlite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(unqlite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE unqlite::unqlite) diff --git a/recipes/unqlite/all/test_package/conanfile.py b/recipes/unqlite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/unqlite/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/unqlite/all/test_package/test_package.c b/recipes/unqlite/all/test_package/test_package.c new file mode 100644 index 0000000000000..487c78dbd5f89 --- /dev/null +++ b/recipes/unqlite/all/test_package/test_package.c @@ -0,0 +1,53 @@ +#include + +#include + +int main(void) { + int i, rc; + unqlite *pDb; + + rc = unqlite_open(&pDb, "test.db", UNQLITE_OPEN_CREATE); + if (rc != UNQLITE_OK) return -1; + + rc = unqlite_kv_store(pDb, "test", -1, "Hello World", 11); + if (rc != UNQLITE_OK) return -1; + + rc = unqlite_kv_store_fmt(pDb, "date", -1, "Current date: %d:%d:%d", 2013,06,07); + if (rc != UNQLITE_OK) return -1; + + rc = unqlite_kv_append(pDb, "msg", -1, "Hello, ", 7); + if (rc == UNQLITE_OK) { + rc = unqlite_kv_append(pDb, "msg", -1, "Current time is: ", 17); + if (rc == UNQLITE_OK) { + rc = unqlite_kv_append_fmt(pDb, "msg", -1, "%d:%d:%d", 10, 16, 53); + } + } + + unqlite_kv_delete(pDb, "test", -1); + + for (i = 0 ; i < 20 ; ++i) { + char zKey[12]; + char zData[34]; + + unqlite_util_random_string(pDb, zKey, sizeof(zKey)); + + rc = unqlite_kv_store(pDb, zKey, sizeof(zKey), zData, sizeof(zData)); + if (rc != UNQLITE_OK) break; + } + + if (rc != UNQLITE_OK) { + const char *zBuf; + int iLen; + unqlite_config(pDb, UNQLITE_CONFIG_ERR_LOG, &zBuf, &iLen); + if (iLen > 0) { + fprintf(stderr, "%s", zBuf); + } + if (rc != UNQLITE_BUSY && rc != UNQLITE_NOTIMPLEMENTED) { + unqlite_rollback(pDb); + } + } + + unqlite_close(pDb); + + return 0; +} diff --git a/recipes/unqlite/all/test_v1_package/CMakeLists.txt b/recipes/unqlite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/unqlite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/unqlite/all/test_v1_package/conanfile.py b/recipes/unqlite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/unqlite/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/unqlite/config.yml b/recipes/unqlite/config.yml new file mode 100644 index 0000000000000..691d3c3ad3c9f --- /dev/null +++ b/recipes/unqlite/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.9": + folder: all diff --git a/recipes/upx/all/CMakeLists.txt b/recipes/upx/all/CMakeLists.txt new file mode 100644 index 0000000000000..97030501e5bd7 --- /dev/null +++ b/recipes/upx/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/upx/all/conandata.yml b/recipes/upx/all/conandata.yml new file mode 100644 index 0000000000000..e774dc1feea4d --- /dev/null +++ b/recipes/upx/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "3.96": + "Linux": + "x86_64": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz" + sha256: "ac75f5172c1c530d1b5ce7215ca9e94586c07b675a26af3b97f8421b8b8d413d" + "armv8": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-arm64_linux.tar.xz" + sha256: "a075eccc7fd84ed46dff50692e1869e42b1bd6fc25a81f651b9a13c1146476fc" + "armv7": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-arm_linux.tar.xz" + sha256: "7c568b9ef05a0a129f3f4da3c825ffa8968b1ec5a31f3ce21485a87c61748c96" + "ppc32": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-powerpc_linux.tar.xz" + sha256: "5096b2b2ecfedd7aef8b3b108de4f6526a4d051336f1eedecccc90f90f1f5af7" + "ppc64le": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-powerpc64le_linux.tar.xz" + sha256: "df854565df1b37299d1b0f0eee2bdd6588bf98638f8be9fe3776d4e5dd89746f" + "Windows": + "x86": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win32.zip" + sha256: "014912ea363e2d491587534c1e7efd5bc516520d8f2cdb76bb0aaf915c5db961" + "x86_64": + url: "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip" + sha256: "a2655c66a547e2274474e54d7a373f1c28e96ded162c51b34651873691022184" diff --git a/recipes/upx/all/conanfile.py b/recipes/upx/all/conanfile.py new file mode 100644 index 0000000000000..ebbe1deba6846 --- /dev/null +++ b/recipes/upx/all/conanfile.py @@ -0,0 +1,55 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class UPXConan(ConanFile): + name = "upx" + description = "UPX - the Ultimate Packer for eXecutables " + license = "GPL-2.0-or-later", "special-exception-for-compressed-executables" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://upx.github.io/" + topics = ("packer", "executable", "compression", "size", "reduction", "small", "footprintt") + no_copy_source = True + settings = "os", "arch" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def _conan_data_sources(self): + # Don't surround this with try/catch to catch unknown versions + conandata_version = self.conan_data["sources"][self.version] + try: + return conandata_version[str(self.settings.os)][str(self.settings.arch)] + except KeyError: + return None + + def validate(self): + if not self._conan_data_sources(): + raise ConanInvalidConfiguration(f"This recipe has no upx binary for os/arch={self.settings.os}/{self.settings.arch}") + + def build(self): + tools.get(**self._conan_data_sources(), + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + if self.settings.os == "Windows": + self.copy("upx.exe", src=self._source_subfolder, dst="bin") + else: + self.copy("upx", src=self._source_subfolder, dst="bin") + + def package_info(self): + self.cpp_info.libdirs = [] + + 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) + + bin_ext = ".exe" if self.settings.os == "Windows" else "" + upx = os.path.join(bin_path, f"upx{bin_ext}") + self.user_info.upx = upx diff --git a/recipes/upx/all/test_package/CMakeLists.txt b/recipes/upx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f31cfe1e1aa8e --- /dev/null +++ b/recipes/upx/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU") + add_link_options(-static) +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/upx/all/test_package/conanfile.py b/recipes/upx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8274c17267c14 --- /dev/null +++ b/recipes/upx/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +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, skip_x64_x86=True): + bin_ext = ".exe" if self.settings.os == "Windows" else "" + bin_path = os.path.join("bin", f"test_package{bin_ext}") + + upx_bin = self.deps_user_info["upx"].upx + self.run(f"{upx_bin} --help", run_environment=True) + + original_size = os.stat(bin_path).st_size + + self.run(f"{upx_bin} {bin_path}", run_environment=True) + + packed_size = os.stat(bin_path).st_size + + # Run the packed executable to see whether it still works + self.run(bin_path, run_environment=True) + + self.output.info(f"File: {bin_path}") + self.output.info(f"Original size: {original_size:>9}") + self.output.info(f"Packed size: {packed_size:>9}") + self.output.info(f" ---------") + self.output.info(f"Size diff: {original_size-packed_size:>9}") diff --git a/recipes/upx/all/test_package/test_package.c b/recipes/upx/all/test_package/test_package.c new file mode 100644 index 0000000000000..725533f119f42 --- /dev/null +++ b/recipes/upx/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char *argv[]) { + puts("Hello world!"); + return 0; +} diff --git a/recipes/upx/config.yml b/recipes/upx/config.yml new file mode 100644 index 0000000000000..ec9befdb55388 --- /dev/null +++ b/recipes/upx/config.yml @@ -0,0 +1,3 @@ +versions: + "3.96": + folder: all diff --git a/recipes/uriparser/all/conandata.yml b/recipes/uriparser/all/conandata.yml new file mode 100644 index 0000000000000..2e0f68c6098de --- /dev/null +++ b/recipes/uriparser/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "0.9.7": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.7/uriparser-0.9.7.tar.xz" + sha256: "1ddae35cb3cc2c36e8199829d46f1c7f8b222e74a723fdae67ec8561e1ac5a39" + "0.9.6": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.6/uriparser-0.9.6.tar.xz" + sha256: "a288a06668528c19e85e38c508335938e1de6fdd4b8f2072401b4533fcebf644" + "0.9.5": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.5/uriparser-0.9.5.tar.xz" + sha256: "9af8f87ed762ebac333fd42b6c38b62d217be8ba290d050f40aef43b9267651e" + "0.9.4": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.4/uriparser-0.9.4.tar.xz" + sha256: "c2554f555bb1640aa5d77e574966d203ab073d738366d90ec5ada0055cd05bf7" + "0.9.3": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.3/uriparser-0.9.3.tar.xz" + sha256: "2abede346563c3915101fe0e8bd375344458fd4710dbcb97ffb1999aa27c59aa" +patches: + "0.9.4": + - patch_file: "patches/fix-lib-name-mingw-0.9.4.patch" + "0.9.3": + - patch_file: "patches/fix-lib-name-mingw-0.9.3.patch" diff --git a/recipes/uriparser/all/conanfile.py b/recipes/uriparser/all/conanfile.py new file mode 100644 index 0000000000000..9e901d6027dc5 --- /dev/null +++ b/recipes/uriparser/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +import os + +required_conan_version = ">=1.54.0" + + +class UriparserConan(ConanFile): + name = "uriparser" + description = "Strictly RFC 3986 compliant URI parsing and handling library written in C89" + topics = ("uri", "parser") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://uriparser.github.io/" + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_char": [True, False], + "with_wchar": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_char": True, + "with_wchar": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["URIPARSER_BUILD_DOCS"] = False + tc.variables["URIPARSER_BUILD_TESTS"] = False + tc.variables["URIPARSER_BUILD_TOOLS"] = False + tc.variables["URIPARSER_BUILD_CHAR"] = self.options.with_char + tc.variables["URIPARSER_BUILD_WCHAR"] = self.options.with_wchar + if is_msvc(self): + tc.variables["URIPARSER_MSVC_RUNTIME"] = f"/{msvc_runtime_flag(self)}" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "uriparser") + self.cpp_info.set_property("cmake_target_name", "uriparser::uriparser") + self.cpp_info.set_property("pkg_config_name", "liburiparser") + self.cpp_info.libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.defines.append("URI_STATIC_BUILD") + if not self.options.with_char: + self.cpp_info.defines.append("URI_NO_ANSI") + if not self.options.with_wchar: + self.cpp_info.defines.append("URI_NO_UNICODE") diff --git a/recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.3.patch b/recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.3.patch new file mode 100644 index 0000000000000..e1136a7c8a441 --- /dev/null +++ b/recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.3.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -152,7 +152,10 @@ if(NOT MSVC) + set_property(TARGET uriparser PROPERTY VERSION ${URIPARSER_SO_CURRENT_MINUS_AGE}.${URIPARSER_SO_AGE}.${URIPARSER_SO_REVISION}) + set_property(TARGET uriparser PROPERTY SOVERSION ${URIPARSER_SO_CURRENT_MINUS_AGE}) + if(WIN32) +- set_property(TARGET uriparser PROPERTY SUFFIX "-${URIPARSER_SO_CURRENT_MINUS_AGE}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ set_target_properties(uriparser PROPERTIES ++ OUTPUT_NAME uriparser ++ RUNTIME_OUTPUT_NAME uriparser-${URIPARSER_SO_CURRENT_MINUS_AGE} ++ ARCHIVE_OUTPUT_NAME uriparser) + endif() + endif() + diff --git a/recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.4.patch b/recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.4.patch new file mode 100644 index 0000000000000..0733b710a5664 --- /dev/null +++ b/recipes/uriparser/all/patches/fix-lib-name-mingw-0.9.4.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -157,7 +157,10 @@ if(NOT MSVC) + set_property(TARGET uriparser PROPERTY VERSION ${URIPARSER_SO_CURRENT_MINUS_AGE}.${URIPARSER_SO_AGE}.${URIPARSER_SO_REVISION}) + set_property(TARGET uriparser PROPERTY SOVERSION ${URIPARSER_SO_CURRENT_MINUS_AGE}) + if(WIN32) +- set_property(TARGET uriparser PROPERTY SUFFIX "-${URIPARSER_SO_CURRENT_MINUS_AGE}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ set_target_properties(uriparser PROPERTIES ++ OUTPUT_NAME uriparser ++ RUNTIME_OUTPUT_NAME uriparser-${URIPARSER_SO_CURRENT_MINUS_AGE} ++ ARCHIVE_OUTPUT_NAME uriparser) + endif() + endif() + diff --git a/recipes/uriparser/all/test_package/CMakeLists.txt b/recipes/uriparser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e0af00ef4ec72 --- /dev/null +++ b/recipes/uriparser/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(uriparser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE uriparser::uriparser) diff --git a/recipes/uriparser/all/test_package/conanfile.py b/recipes/uriparser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/uriparser/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/uriparser/all/test_package/test_package.c b/recipes/uriparser/all/test_package/test_package.c new file mode 100644 index 0000000000000..66214dc85ef29 --- /dev/null +++ b/recipes/uriparser/all/test_package/test_package.c @@ -0,0 +1,39 @@ +#include + +#include + +static void printUriTextRange(const UriTextRangeA *textRange) { + const char *ptr; + for (ptr = textRange->first; ptr != NULL && ptr != textRange->afterLast; ++ptr) { + putchar(*ptr); + } +} + +static void printSegments(const UriPathSegmentA *head) { + int i = 0; + while (head != NULL) { + printf("segment [%d]: ", i); printUriTextRange(&head->text); putchar('\n'); + head = head->next; + ++i; + } +} + +int main() { + UriUriA uri; + const char *errorPos; + const char *const uriString = "file://username:password@home:22/user/directory/subdirectory/index.html?q=1337&b=5318008#some_fragment_index"; + printf("URI to parse is \"%s\"\n", uriString); + if (uriParseSingleUriA(&uri, uriString, &errorPos) != URI_SUCCESS) { + fprintf(stderr, "uriParseSingleUriA failed\n"); + return EXIT_FAILURE; + } + printf("scheme: "); printUriTextRange(&uri.scheme); putchar('\n'); + printf("userInfo: "); printUriTextRange(&uri.userInfo); putchar('\n'); + printf("hostText: "); printUriTextRange(&uri.hostText); putchar('\n'); + printf("portText: "); printUriTextRange(&uri.portText); putchar('\n'); + printf("query: "); printUriTextRange(&uri.query); putchar('\n'); + printf("fragment: "); printUriTextRange(&uri.fragment); putchar('\n'); + printSegments(uri.pathHead); + uriFreeUriMembersA(&uri); + return EXIT_SUCCESS; +} diff --git a/recipes/uriparser/all/test_v1_package/CMakeLists.txt b/recipes/uriparser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/uriparser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/uriparser/all/test_v1_package/conanfile.py b/recipes/uriparser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/uriparser/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/uriparser/config.yml b/recipes/uriparser/config.yml new file mode 100644 index 0000000000000..983b5479ac5be --- /dev/null +++ b/recipes/uriparser/config.yml @@ -0,0 +1,11 @@ +versions: + "0.9.7": + folder: "all" + "0.9.6": + folder: "all" + "0.9.5": + folder: "all" + "0.9.4": + folder: "all" + "0.9.3": + folder: "all" diff --git a/recipes/userspace-rcu/all/conandata.yml b/recipes/userspace-rcu/all/conandata.yml new file mode 100644 index 0000000000000..570705edb2dd6 --- /dev/null +++ b/recipes/userspace-rcu/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.11.4": + sha256: d995598482221587ff6753d2a8da6ac74ff0fa79fbea29ccee196f295834531d + url: https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.11.4.tar.gz diff --git a/recipes/userspace-rcu/all/conanfile.py b/recipes/userspace-rcu/all/conanfile.py new file mode 100644 index 0000000000000..ad697812f9c26 --- /dev/null +++ b/recipes/userspace-rcu/all/conanfile.py @@ -0,0 +1,97 @@ +import os + +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conan.tools.files import get, rmdir +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.47.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" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + settings = "os", "compiler", "build_type", "arch" + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + build_requires = ( + "libtool/2.4.6", + ) + + generators = "PkgConfigDeps" + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration("Building for {} unsupported".format(self.settings.os)) + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + 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 + + + def build(self): + with tools.chdir(self._source_subfolder): + self.run("./bootstrap") + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="LICENSE*", src=self._source_subfolder, dst="licenses") + autotools = self._configure_autotools() + autotools.install() + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + 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) + 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": + self.cpp_info.components[component_name].system_libs = ["pthread"] + + # Some definitions needed for MB and Signal variants + self.cpp_info.components["urcu-mb"].defines = ["RCU_MB"] + self.cpp_info.components["urcu-signal"].defines = ["RCU_SIGNAL"] diff --git a/recipes/userspace-rcu/all/test_package/CMakeLists.txt b/recipes/userspace-rcu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2afe258693778 --- /dev/null +++ b/recipes/userspace-rcu/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(userspace-rcu COMPONENTS urcu REQUIRED) + +set(TEST_SRC test_urcu_fork.c tap.c) + +add_executable(${PROJECT_NAME} ${TEST_SRC}) +target_link_libraries(${PROJECT_NAME} userspace-rcu::urcu) + +add_executable(${PROJECT_NAME}-mb ${TEST_SRC}) +target_link_libraries(${PROJECT_NAME}-mb userspace-rcu::urcu-mb) + +add_executable(${PROJECT_NAME}-signal ${TEST_SRC}) +target_link_libraries(${PROJECT_NAME}-signal userspace-rcu::urcu-signal) diff --git a/recipes/userspace-rcu/all/test_package/conanfile.py b/recipes/userspace-rcu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..78d6ce7aad715 --- /dev/null +++ b/recipes/userspace-rcu/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +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"]: + self.run("test_package{}".format(test), run_environment=True) diff --git a/recipes/userspace-rcu/all/test_package/tap.c b/recipes/userspace-rcu/all/test_package/tap.c new file mode 100644 index 0000000000000..2da5176dbbfee --- /dev/null +++ b/recipes/userspace-rcu/all/test_package/tap.c @@ -0,0 +1,492 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2004 Nik Clayton + * Copyright (C) 2017 Jérémie Galarneau + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +#include "tap.h" + +static int no_plan = 0; +static int skip_all = 0; +static int have_plan = 0; +static unsigned int test_count = 0; /* Number of tests that have been run */ +static unsigned int e_tests = 0; /* Expected number of tests to run */ +static unsigned int failures = 0; /* Number of tests that failed */ +static char *todo_msg = NULL; +static const char *todo_msg_fixed = "libtap malloc issue"; +static int todo = 0; +static int test_died = 0; +static int tap_is_disabled = 0; + +/* Encapsulate the pthread code in a conditional. In the absence of + libpthread the code does nothing */ +#ifdef HAVE_LIBPTHREAD +#include +static pthread_mutex_t M = PTHREAD_MUTEX_INITIALIZER; +# define LOCK pthread_mutex_lock(&M); +# define UNLOCK pthread_mutex_unlock(&M); +#else +# define LOCK +# define UNLOCK +#endif + +static void _expected_tests(unsigned int); +static void _tap_init(void); +static void _cleanup(void); + +#ifdef __MINGW32__ +static inline +void flockfile (FILE * filehandle) { + return; +} + +static inline +void funlockfile(FILE * filehandle) { + return; +} +#endif + +/* + * Generate a test result. + * + * ok -- boolean, indicates whether or not the test passed. + * test_name -- the name of the test, may be NULL + * test_comment -- a comment to print afterwards, may be NULL + */ +unsigned int +_gen_result(int ok, const char *func, const char *file, unsigned int line, + const char *test_name, ...) +{ + va_list ap; + char *local_test_name = NULL; + char *c; + int name_is_digits; + + LOCK; + + test_count++; + + /* Start by taking the test name and performing any printf() + expansions on it */ + if(test_name != NULL) { + va_start(ap, test_name); + if (vasprintf(&local_test_name, test_name, ap) == -1) { + local_test_name = NULL; + } + va_end(ap); + + /* Make sure the test name contains more than digits + and spaces. Emit an error message and exit if it + does */ + if(local_test_name) { + name_is_digits = 1; + for(c = local_test_name; *c != '\0'; c++) { + if(!isdigit((unsigned char) *c) && !isspace((unsigned char) *c)) { + name_is_digits = 0; + break; + } + } + + if(name_is_digits) { + diag(" You named your test '%s'. You shouldn't use numbers for your test names.", local_test_name); + diag(" Very confusing."); + } + } + } + + if(!ok) { + printf("not "); + failures++; + } + + printf("ok %d", test_count); + + if(test_name != NULL) { + printf(" - "); + + /* Print the test name, escaping any '#' characters it + might contain */ + if(local_test_name != NULL) { + flockfile(stdout); + for(c = local_test_name; *c != '\0'; c++) { + if(*c == '#') + fputc('\\', stdout); + fputc((int)*c, stdout); + } + funlockfile(stdout); + } else { /* vasprintf() failed, use a fixed message */ + printf("%s", todo_msg_fixed); + } + } + + /* If we're in a todo_start() block then flag the test as being + TODO. todo_msg should contain the message to print at this + point. If it's NULL then asprintf() failed, and we should + use the fixed message. + + This is not counted as a failure, so decrement the counter if + the test failed. */ + if(todo) { + printf(" # TODO %s", todo_msg ? todo_msg : todo_msg_fixed); + if(!ok) + failures--; + } + + printf("\n"); + + if(!ok) { + if(getenv("HARNESS_ACTIVE") != NULL) + fputs("\n", stderr); + + diag(" Failed %stest (%s:%s() at line %d)", + todo ? "(TODO) " : "", file, func, line); + } + free(local_test_name); + + UNLOCK; + + /* We only care (when testing) that ok is positive, but here we + specifically only want to return 1 or 0 */ + return ok ? 1 : 0; +} + +/* + * Initialise the TAP library. Will only do so once, however many times it's + * called. + */ +void +_tap_init(void) +{ + static int run_once = 0; + + if(!run_once) { + atexit(_cleanup); + + /* stdout needs to be unbuffered so that the output appears + in the same place relative to stderr output as it does + with Test::Harness */ + setbuf(stdout, 0); + run_once = 1; + } +} + +/* + * Note that there's no plan. + */ +int +plan_no_plan(void) +{ + + LOCK; + + _tap_init(); + + if(have_plan != 0) { + fprintf(stderr, "You tried to plan twice!\n"); + test_died = 1; + UNLOCK; + exit(255); + } + + have_plan = 1; + no_plan = 1; + + UNLOCK; + + return 1; +} + +/* + * Note that the plan is to skip all tests + */ +int +plan_skip_all(const char *reason) +{ + + LOCK; + + _tap_init(); + + skip_all = 1; + + printf("1..0"); + + if(reason != NULL) + printf(" # Skip %s", reason); + + printf("\n"); + + UNLOCK; + + exit(0); +} + +/* + * Note the number of tests that will be run. + */ +int +plan_tests(unsigned int tests) +{ + + LOCK; + + _tap_init(); + + if(have_plan != 0) { + fprintf(stderr, "You tried to plan twice!\n"); + test_died = 1; + UNLOCK; + exit(255); + } + + if(tests == 0) { + fprintf(stderr, "You said to run 0 tests! You've got to run something.\n"); + test_died = 1; + UNLOCK; + exit(255); + } + + have_plan = 1; + + _expected_tests(tests); + + UNLOCK; + + return e_tests; +} + +unsigned int +diag(const char *fmt, ...) +{ + va_list ap; + + fputs("# ", stderr); + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + fputs("\n", stderr); + + return 0; +} + +unsigned int +rdiag_start(void) +{ + fputs("# ", stderr); + return 0; +} + +unsigned int +rdiag(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + return 0; +} + +unsigned int +rdiag_end(void) +{ + fputs("\n", stderr); + return 0; +} + +void +diag_multiline(const char *val) +{ + size_t len, i, line_start_idx = 0; + + assert(val); + len = strlen(val); + + for (i = 0; i < len; i++) { + int line_length; + + if (val[i] != '\n') { + continue; + } + + assert((i - line_start_idx + 1) <= INT_MAX); + line_length = i - line_start_idx + 1; + fprintf(stderr, "# %.*s", line_length, &val[line_start_idx]); + line_start_idx = i + 1; + } +} + +void +_expected_tests(unsigned int tests) +{ + + printf("1..%d\n", tests); + e_tests = tests; +} + +int +skip(unsigned int n, const char *fmt, ...) +{ + va_list ap; + char *skip_msg = NULL; + + LOCK; + + va_start(ap, fmt); + if (vasprintf(&skip_msg, fmt, ap) == -1) { + skip_msg = NULL; + } + va_end(ap); + + while(n-- > 0) { + test_count++; + printf("ok %d # skip %s\n", test_count, + skip_msg != NULL ? + skip_msg : "libtap():malloc() failed"); + } + + free(skip_msg); + + UNLOCK; + + return 1; +} + +void +todo_start(const char *fmt, ...) +{ + va_list ap; + + LOCK; + + va_start(ap, fmt); + if (vasprintf(&todo_msg, fmt, ap) == -1) { + todo_msg = NULL; + } + va_end(ap); + + todo = 1; + + UNLOCK; +} + +void +todo_end(void) +{ + + LOCK; + + todo = 0; + free(todo_msg); + + UNLOCK; +} + +int +exit_status(void) +{ + int r; + + LOCK; + + /* If there's no plan, just return the number of failures */ + if(no_plan || !have_plan) { + UNLOCK; + return failures; + } + + /* Ran too many tests? Return the number of tests that were run + that shouldn't have been */ + if(e_tests < test_count) { + r = test_count - e_tests; + UNLOCK; + return r; + } + + /* Return the number of tests that failed + the number of tests + that weren't run */ + r = failures + e_tests - test_count; + UNLOCK; + + return r; +} + +/* + * Cleanup at the end of the run, produce any final output that might be + * required. + */ +void +_cleanup(void) +{ + + LOCK; + + if (tap_is_disabled) { + UNLOCK; + return; + } + + /* If plan_no_plan() wasn't called, and we don't have a plan, + and we're not skipping everything, then something happened + before we could produce any output */ + if(!no_plan && !have_plan && !skip_all) { + diag("Looks like your test died before it could output anything."); + UNLOCK; + return; + } + + if(test_died) { + diag("Looks like your test died just after %d.", test_count); + UNLOCK; + return; + } + + + /* No plan provided, but now we know how many tests were run, and can + print the header at the end */ + if(!skip_all && (no_plan || !have_plan)) { + printf("1..%d\n", test_count); + } + + if((have_plan && !no_plan) && e_tests < test_count) { + diag("Looks like you planned %d %s but ran %d extra.", + e_tests, e_tests == 1 ? "test" : "tests", test_count - e_tests); + UNLOCK; + return; + } + + if((have_plan || !no_plan) && e_tests > test_count) { + diag("Looks like you planned %d %s but only ran %d.", + e_tests, e_tests == 1 ? "test" : "tests", test_count); + UNLOCK; + return; + } + + if(failures) + diag("Looks like you failed %d %s of %d.", + failures, failures == 1 ? "test" : "tests", test_count); + + UNLOCK; +} + +/* Disable tap for this process. */ +void +tap_disable(void) +{ + LOCK; + tap_is_disabled = 1; + UNLOCK; +} diff --git a/recipes/userspace-rcu/all/test_package/tap.h b/recipes/userspace-rcu/all/test_package/tap.h new file mode 100644 index 0000000000000..39312fcb2e5a4 --- /dev/null +++ b/recipes/userspace-rcu/all/test_package/tap.h @@ -0,0 +1,89 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2004 Nik Clayton + * Copyright (C) 2017 Jérémie Galarneau + */ + +/* '## __VA_ARGS__' is a gcc'ism. C99 doesn't allow the token pasting + and requires the caller to add the final comma if they've ommitted + the optional arguments */ +#ifdef __GNUC__ +# define ok(e, test, ...) ((e) ? \ + _gen_result(1, __func__, __FILE__, __LINE__, \ + test, ## __VA_ARGS__) : \ + _gen_result(0, __func__, __FILE__, __LINE__, \ + test, ## __VA_ARGS__)) + +# define ok1(e) ((e) ? \ + _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ + _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) + +# define pass(test, ...) ok(1, test, ## __VA_ARGS__); +# define fail(test, ...) ok(0, test, ## __VA_ARGS__); + +# define skip_start(test, n, fmt, ...) \ + do { \ + if((test)) { \ + skip(n, fmt, ## __VA_ARGS__); \ + continue; \ + } +#elif __STDC_VERSION__ >= 199901L /* __GNUC__ */ +# define ok(e, ...) ((e) ? \ + _gen_result(1, __func__, __FILE__, __LINE__, \ + __VA_ARGS__) : \ + _gen_result(0, __func__, __FILE__, __LINE__, \ + __VA_ARGS__)) + +# define ok1(e) ((e) ? \ + _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ + _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) + +# define pass(...) ok(1, __VA_ARGS__); +# define fail(...) ok(0, __VA_ARGS__); + +# define skip_start(test, n, ...) \ + do { \ + if((test)) { \ + skip(n, __VA_ARGS__); \ + continue; \ + } +#else /* __STDC_VERSION__ */ +# error "Needs gcc or C99 compiler for variadic macros." +#endif /* __STDC_VERSION__ */ + +#define skip_end() } while(0); + +#ifdef __MINGW_PRINTF_FORMAT +# define TAP_PRINTF_FORMAT __MINGW_PRINTF_FORMAT +#else +# define TAP_PRINTF_FORMAT printf +#endif + +__attribute__((format(TAP_PRINTF_FORMAT, 5, 6))) +unsigned int _gen_result(int, const char *, const char *, unsigned int, const char *, ...); + +int plan_no_plan(void); +__attribute__((noreturn)) +int plan_skip_all(const char *); +int plan_tests(unsigned int); + +__attribute__((format(TAP_PRINTF_FORMAT, 1, 2))) +unsigned int diag(const char *, ...); +void diag_multiline(const char *); + +__attribute__((format(TAP_PRINTF_FORMAT, 2, 3))) +int skip(unsigned int, const char *, ...); + +__attribute__((format(TAP_PRINTF_FORMAT, 1, 2))) +void todo_start(const char *, ...); +void todo_end(void); + +int exit_status(void); + +void tap_disable(void); + +unsigned int rdiag_start(void); +__attribute__((format(TAP_PRINTF_FORMAT, 1, 2))) +unsigned int rdiag(const char *fmt, ...); +unsigned int rdiag_end(void); diff --git a/recipes/userspace-rcu/all/test_package/test_urcu_fork.c b/recipes/userspace-rcu/all/test_package/test_urcu_fork.c new file mode 100644 index 0000000000000..334f4c3b70973 --- /dev/null +++ b/recipes/userspace-rcu/all/test_package/test_urcu_fork.c @@ -0,0 +1,214 @@ +/* + * test_urcu_fork.c + * + * Userspace RCU library - test program (fork) + * + * Copyright February 2012 - Mathieu Desnoyers + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifndef DYNAMIC_LINK_TEST +#define _LGPL_SOURCE +#else +#define rcu_debug_yield_read() +#endif +#include + +#include "tap.h" + +/* We generate children 3 levels deep */ +#define FORK_DEPTH 3 +/* Each generation spawns 10 children */ +#define NR_FORK 4 + +#define NR_TESTS NR_FORK + +static int fork_generation; + +/* + * Only print diagnostic for top level parent process, else the console + * has trouble formatting the tap output. + */ +#define diag_gen0(...) \ + do { \ + if (!fork_generation) \ + diag(__VA_ARGS__); \ + } while (0) + +struct test_node { + int somedata; + struct rcu_head head; +}; + +static void cb(struct rcu_head *head) +{ + struct test_node *node; + + diag_gen0("rcu callback invoked in pid: %d", (int) getpid()); + node = caa_container_of(head, struct test_node, head); + free(node); +} + +static void test_rcu(void) +{ + struct test_node *node; + + rcu_register_thread(); + + synchronize_rcu(); + + rcu_read_lock(); + rcu_read_unlock(); + + node = malloc(sizeof(*node)); + assert(node); + + call_rcu(&node->head, cb); + + synchronize_rcu(); + + rcu_unregister_thread(); +} + +/* + * Return 0 if child, > 0 if parent, < 0 on error. + */ +static int do_fork(const char *execname) +{ + pid_t pid; + + diag_gen0("%s parent pid: %d, before fork", + execname, (int) getpid()); + + call_rcu_before_fork(); + pid = fork(); + if (pid == 0) { + /* child */ + fork_generation++; + tap_disable(); + + call_rcu_after_fork_child(); + diag_gen0("%s child pid: %d, after fork", + execname, (int) getpid()); + test_rcu(); + diag_gen0("%s child pid: %d, after rcu test", + execname, (int) getpid()); + if (fork_generation >= FORK_DEPTH) + exit(EXIT_SUCCESS); + return 0; + } else if (pid > 0) { + int status; + + /* parent */ + call_rcu_after_fork_parent(); + diag_gen0("%s parent pid: %d, after fork", + execname, (int) getpid()); + test_rcu(); + diag_gen0("%s parent pid: %d, after rcu test", + execname, (int) getpid()); + for (;;) { + pid = wait(&status); + if (pid < 0) { + if (!fork_generation) + perror("wait"); + return -1; + } + if (WIFEXITED(status)) { + diag_gen0("child %u exited normally with status %u", + pid, WEXITSTATUS(status)); + if (WEXITSTATUS(status)) + return -1; + break; + } else if (WIFSIGNALED(status)) { + diag_gen0("child %u was terminated by signal %u", + pid, WTERMSIG(status)); + return -1; + } else { + continue; + } + } + return 1; + } else { + if (!fork_generation) + perror("fork"); + return -1; + } +} + +int main(int argc __attribute__((unused)), char **argv) +{ + unsigned int i; + + plan_tests(NR_TESTS); + +#if 0 + /* pthread_atfork does not work with malloc/free in callbacks */ + ret = pthread_atfork(call_rcu_before_fork, + call_rcu_after_fork_parent, + call_rcu_after_fork_child); + if (ret) { + errno = ret; + perror("pthread_atfork"); + exit(EXIT_FAILURE); + } +#endif + +restart: + for (i = 0; i < NR_FORK; i++) { + int ret; + + test_rcu(); + synchronize_rcu(); + ret = do_fork(argv[0]); + if (!fork_generation) { + ok(ret >= 0, "child status %d", ret); + } + if (ret == 0) { /* child */ + goto restart; + } else if (ret < 0) { + goto error; + } else { + /* else parent, continue. */ + } + } + if (!fork_generation) { + return exit_status(); + } else { + exit(EXIT_SUCCESS); + } + +error: + if (!fork_generation) { + return exit_status(); + } else { + exit(EXIT_FAILURE); + } +} diff --git a/recipes/userspace-rcu/config.yml b/recipes/userspace-rcu/config.yml new file mode 100644 index 0000000000000..813707cc5417d --- /dev/null +++ b/recipes/userspace-rcu/config.yml @@ -0,0 +1,3 @@ +versions: + "0.11.4": + folder: all diff --git a/recipes/usockets/all/conandata.yml b/recipes/usockets/all/conandata.yml new file mode 100644 index 0000000000000..5b4a41335be2a --- /dev/null +++ b/recipes/usockets/all/conandata.yml @@ -0,0 +1,78 @@ +sources: + "0.8.5": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.5.tar.gz" + sha256: "c52c98b7ff2c24534c17ad97d5fea8ca0cb7ff38cc933b8d08bac6e498a2ea6b" + "0.8.3": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.3.tar.gz" + sha256: "2f96a26365b87badbea2360a82521a382c0c3ee2dcf4f32c79b11d0cb1989a53" + "0.8.2": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.2.tar.gz" + sha256: "c17fc99773a30552cdd7741ff98af177eeecb26b89fc38011b430956b3b2eca5" + "0.8.1": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.1.tar.gz" + sha256: "3b33b5924a92577854e2326b3e2d393849ec00beb865a1271bf24c0f210cc1d6" + "0.7.1": + url: "https://github.com/uNetworking/uSockets/archive/v0.7.1.tar.gz" + sha256: "1fdc5376e5ef9acf4fb673fcd5fd191da9b8d59a319e9ec7922872070a3dd21c" + "0.6.0": + url: "https://github.com/uNetworking/uSockets/archive/v0.6.0.tar.gz" + sha256: "999387d3653b2bc663c34aa7e973358ac4c4897dccd644553a5caab843a978a1" + "0.4.0": + url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" + sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" +patches: + "0.8.5": + - patch_file: "patches/0001-makefile_0.8.3.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + "0.8.3": + - patch_file: "patches/0001-makefile_0.8.3.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + "0.8.2": + - patch_file: "patches/0001-makefile_0.8.2.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj_0.8.1.patch" + base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" + "0.8.1": + - patch_file: "patches/0001-makefile_0.8.1.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj_0.8.1.patch" + base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" + "0.7.1": + - patch_file: "patches/0001-makefile_0.6.0.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj.patch" + base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" + "0.6.0": + - patch_file: "patches/0001-makefile_0.6.0.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj.patch" + base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" + "0.4.0": + - patch_file: "patches/0001-makefile.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj.patch" + base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py new file mode 100644 index 0000000000000..09208942cd97e --- /dev/null +++ b/recipes/usockets/all/conanfile.py @@ -0,0 +1,224 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, chdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +from conans import MSBuild, AutoToolsBuildEnvironment +from conans.tools import vcvars, environment_append, unix_path, get_env + +import os +import contextlib + +required_conan_version = ">=1.52.0" + +class UsocketsConan(ConanFile): + name = "usockets" + description = "Miniscule cross-platform eventing, networking & crypto for async applications" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/uNetworking/uSockets" + topics = ("socket", "network", "web") + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_ssl": [False, "openssl", "wolfssl"], + "eventloop": ["syscall", "libuv", "gcd", "boost"], + } + default_options = { + "fPIC": True, + "with_ssl": False, + "eventloop": "syscall", + } + + @property + def _minimum_cpp_standard(self): + version = False + if self.options.eventloop == "boost": + version = "14" + + # OpenSSL wrapper of uSockets uses C++17 features. + if self.options.with_ssl == "openssl": + version = "17" + + return version + + def _minimum_compilers_version(self, cppstd): + standards = { + "14": { + "Visual Studio": "15", + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + }, + "17": { + "Visual Studio": "16", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + }, + } + return standards.get(cppstd) or {} + + @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 + self.options.eventloop = "libuv" + + def validate(self): + if self.options.eventloop == "syscall" and self.info.settings.os == "Windows": + raise ConanInvalidConfiguration("syscall is not supported on Windows") + + if self.options.eventloop == "gcd" and (self.info.settings.os != "Linux" or self.info.settings.compiler != "clang"): + raise ConanInvalidConfiguration("eventloop=gcd is only supported on Linux with clang") + + if Version(self.version) < "0.8.0" and self.options.eventloop not in ("syscall", "libuv", "gcd"): + raise ConanInvalidConfiguration(f"eventloop={self.options.eventloop} is not supported with {self.name}/{self.version}") + + if Version(self.version) >= "0.5.0" and self.options.with_ssl == "wolfssl": + raise ConanInvalidConfiguration(f"with_ssl={self.options.with_ssl} is not supported with {self.name}/{self.version}. https://github.com/uNetworking/uSockets/issues/147") + + if self.options.with_ssl == "wolfssl" and not self.options["wolfssl"].opensslextra: + raise ConanInvalidConfiguration("wolfssl needs opensslextra option enabled for usockets") + + cppstd = self._minimum_cpp_standard + if not cppstd: + return + + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, cppstd) + + minimum_version = self._minimum_compilers_version(cppstd).get(str(self.info.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("{} requires C++{}, which your compiler does not support.".format(self.name, cppstd)) + else: + self.output.warn("{0} requires C++{1}. Your compiler is unknown. Assuming it supports C++{1}.".format(self.name, cppstd)) + + def configure(self): + if bool(self._minimum_cpp_standard) == False: + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def requirements(self): + if self.options.with_ssl == "openssl": + self.requires("openssl/1.1.1s") + elif self.options.with_ssl == "wolfssl": + self.requires("wolfssl/5.5.1") + + if self.options.eventloop == "libuv": + self.requires("libuv/1.44.2") + elif self.options.eventloop == "gcd": + self.requires("libdispatch/5.3.2") + elif self.options.eventloop == "boost": + self.requires("boost/1.81.0") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + if self.settings.compiler == "Visual Studio": + self.build_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + def _build_msvc(self): + with chdir(self, os.path.join(self._source_subfolder)): + msbuild = MSBuild(self) + msbuild.build(project_file="uSockets.vcxproj", platforms={"x86": "Win32"}) + + @contextlib.contextmanager + def _build_context(self): + if is_msvc(self): + with vcvars(self): + env = { + "CC": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), + "CXX": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), + "CFLAGS": "-{}".format(self.settings.compiler.runtime), + "LD": "link", + "NM": "dumpbin -symbols", + "STRIP": ":", + "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), + "RANLIB": ":", + } + + if self.options.eventloop == "libuv": + env["CPPFLAGS"] = "-I" + unix_path(self.deps_cpp_info["libuv"].include_paths[0]) + " " + + with environment_append(env): + yield + else: + yield + + def _build_configure(self): + autotools = AutoToolsBuildEnvironment(self) + autotools.fpic = self.options.get_safe("fPIC", False) + with chdir(self, self._source_subfolder): + args = ["WITH_LTO=0"] + if self.options.with_ssl == "openssl": + args.append("WITH_OPENSSL=1") + elif self.options.with_ssl == "wolfssl": + args.append("WITH_WOLFSSL=1") + + if self.options.eventloop == "libuv": + args.append("WITH_LIBUV=1") + elif self.options.eventloop == "gcd": + args.append("WITH_GCD=1") + elif self.options.eventloop == "boost": + args.append("WITH_ASIO=1") + + args.extend(f"{key}={value}" for key, value in autotools.vars.items()) + autotools.make(target="default", args=args) + + def build(self): + self._patch_sources() + if Version(self.version) < "0.8.3" and is_msvc(self): + self._build_msvc() + else: + with self._build_context(): + self._build_configure() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._source_subfolder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._source_subfolder, "src"), keep_path=True) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + # drop internal headers + rmdir(self, os.path.join(self.package_folder, "include", "internal")) + + def package_info(self): + self.cpp_info.libs = ["uSockets"] + + if self.options.with_ssl == "openssl": + self.cpp_info.defines.append("LIBUS_USE_OPENSSL") + elif self.options.with_ssl == "wolfssl": + self.cpp_info.defines.append("LIBUS_USE_WOLFSSL") + else: + self.cpp_info.defines.append("LIBUS_NO_SSL") + + if self.options.eventloop == "libuv": + self.cpp_info.defines.append("LIBUS_USE_LIBUV") + elif self.options.eventloop == "gcd": + self.cpp_info.defines.append("LIBUS_USE_GCD") + elif self.options.eventloop == "boost": + self.cpp_info.defines.append("LIBUS_USE_ASIO") diff --git a/recipes/usockets/all/patches/0001-makefile.patch b/recipes/usockets/all/patches/0001-makefile.patch new file mode 100644 index 0000000000000..c369659b08f4a --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile.patch @@ -0,0 +1,13 @@ +--- Makefile 2020-06-22 23:15:29.000000000 +0300 ++++ Makefile.new 2020-06-24 23:57:29.000000000 +0300 +@@ -38,8 +38,8 @@ + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c +- $(AR) rvs uSockets.a *.o ++ $(CC) $(CFLAGS) $(CPPFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(AR) rvs libuSockets.a *.o + + # Builds all examples + .PHONY: examples diff --git a/recipes/usockets/all/patches/0001-makefile_0.6.0.patch b/recipes/usockets/all/patches/0001-makefile_0.6.0.patch new file mode 100644 index 0000000000000..94485fb40020c --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.6.0.patch @@ -0,0 +1,19 @@ +diff --git a/Makefile b/Makefile +index 27f97ce..ea3cd5f 100644 +--- a/Makefile ++++ b/Makefile +@@ -39,12 +39,12 @@ override LDFLAGS += uSockets.a + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(CC) $(CFLAGS) $(CPPFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c + # For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 + ifeq ($(WITH_OPENSSL),1) + $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp + endif +- $(AR) rvs uSockets.a *.o ++ $(AR) rvs libuSockets.a *.o + + # Builds all examples + .PHONY: examples diff --git a/recipes/usockets/all/patches/0001-makefile_0.8.1.patch b/recipes/usockets/all/patches/0001-makefile_0.8.1.patch new file mode 100644 index 0000000000000..b9634599ff097 --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.8.1.patch @@ -0,0 +1,26 @@ +diff --git a/Makefile b/Makefile +index b809ac0..454301b 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,17 +46,17 @@ override LDFLAGS += uSockets.a + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c + # Also link in Boost Asio support + ifeq ($(WITH_ASIO),1) +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp ++ $(CXX) $(CXXFLAGS) -Isrc -std=c++14 $(CPPFLAGS) -O3 -c src/eventing/asio.cpp + endif + + # For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 + ifeq ($(WITH_OPENSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif +- $(AR) rvs uSockets.a *.o ++ $(AR) rvs libuSockets.a *.o + + # Builds all examples + .PHONY: examples diff --git a/recipes/usockets/all/patches/0001-makefile_0.8.2.patch b/recipes/usockets/all/patches/0001-makefile_0.8.2.patch new file mode 100644 index 0000000000000..aafe333e3b357 --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.8.2.patch @@ -0,0 +1,39 @@ +diff --git a/Makefile b/Makefile +index 8bf11b3..9577ee7 100644 +--- a/Makefile ++++ b/Makefile +@@ -58,20 +58,20 @@ endif + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c + # Also link in Boost Asio support + ifeq ($(WITH_ASIO),1) +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp ++ $(CXX) $(CXXFLAGS) -Isrc -std=c++14 $(CPPFLAGS) -O3 -c src/eventing/asio.cpp + endif + + # For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 + ifeq ($(WITH_OPENSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif + ifeq ($(WITH_BORINGSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif +- $(AR) rvs uSockets.a *.o ++ $(AR) rvs libuSockets.a *.o + + # BoringSSL needs cmake and golang + .PHONY: boringssl +@@ -81,7 +81,7 @@ boringssl: + # Builds all examples + .PHONY: examples + examples: default +- for f in examples/*.c; do $(CC) -flto -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done ++ for f in examples/*.c; do $(CC) $(CPPFLAGS) -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done + + swift_examples: + swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server diff --git a/recipes/usockets/all/patches/0001-makefile_0.8.3.patch b/recipes/usockets/all/patches/0001-makefile_0.8.3.patch new file mode 100644 index 0000000000000..5ea7628ad348d --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.8.3.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index f6e2c6b..087d021 100644 +--- a/Makefile ++++ b/Makefile +@@ -63,21 +63,21 @@ endif + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c + # Also link in Boost Asio support + ifeq ($(WITH_ASIO),1) +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp ++ $(CXX) $(CXXFLAGS) -Isrc -std=c++14 $(CPPFLAGS) -O3 -c src/eventing/asio.cpp + endif + + # For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 + ifeq ($(WITH_OPENSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif + ifeq ($(WITH_BORINGSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif + # Create a static library (try windows, then unix) +- lib.exe /out:uSockets.a *.o || $(AR) rvs uSockets.a *.o ++ lib.exe /out:uSockets.lib *.obj || $(AR) rvs libuSockets.a *.o + + # BoringSSL needs cmake and golang + .PHONY: boringssl +@@ -87,7 +87,7 @@ boringssl: + # Builds all examples + .PHONY: examples + examples: default +- for f in examples/*.c; do $(CC) -O3 $(CFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$f" $(LDFLAGS); done ++ for f in examples/*.c; do $(CC) $(CPPFLAGS) -O3 $(CFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$f" $(LDFLAGS); done + + swift_examples: + swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server diff --git a/recipes/usockets/all/patches/0002-vcxproj.patch b/recipes/usockets/all/patches/0002-vcxproj.patch new file mode 100644 index 0000000000000..c113ed447a8b5 --- /dev/null +++ b/recipes/usockets/all/patches/0002-vcxproj.patch @@ -0,0 +1,15 @@ +--- uSockets.vcxproj 2020-06-22 23:15:29.000000000 +0300 ++++ uSockets.vcxproj.new 2020-06-25 00:01:54.000000000 +0300 +@@ -19,11 +19,10 @@ + + + {39D08679-782E-41AC-BDE0-06A462568EFF} +- 10.0.17134.0 + + + +- DynamicLibrary ++ StaticLibrary + v141 + uSockets + diff --git a/recipes/usockets/all/patches/0002-vcxproj_0.8.1.patch b/recipes/usockets/all/patches/0002-vcxproj_0.8.1.patch new file mode 100644 index 0000000000000..d945258467e6e --- /dev/null +++ b/recipes/usockets/all/patches/0002-vcxproj_0.8.1.patch @@ -0,0 +1,17 @@ +diff --git a/uSockets.vcxproj b/uSockets.vcxproj +index 87cbb85..e3871f3 100644 +--- a/uSockets.vcxproj ++++ b/uSockets.vcxproj +@@ -19,11 +19,10 @@ + + + {39D08679-782E-41AC-BDE0-06A462568EFF} +- 10.0.17134.0 + + + +- DynamicLibrary ++ StaticLibrary + v141 + uSockets + diff --git a/recipes/usockets/all/test_package/CMakeLists.txt b/recipes/usockets/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8502a8260d7ce --- /dev/null +++ b/recipes/usockets/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(usockets REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE usockets::usockets) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/usockets/all/test_package/conanfile.py b/recipes/usockets/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7895db93c24a6 --- /dev/null +++ b/recipes/usockets/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/usockets/all/test_package/test_package.cpp b/recipes/usockets/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ba4a4d11ebb35 --- /dev/null +++ b/recipes/usockets/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include +#include + +int main() { + struct us_loop_t *loop = us_create_loop(0, NULL, NULL, NULL, 0); +} diff --git a/recipes/usockets/config.yml b/recipes/usockets/config.yml new file mode 100644 index 0000000000000..c4f53d0a2aff0 --- /dev/null +++ b/recipes/usockets/config.yml @@ -0,0 +1,15 @@ +versions: + "0.8.5": + folder: all + "0.8.3": + folder: all + "0.8.2": + folder: all + "0.8.1": + folder: all + "0.7.1": + folder: all + "0.6.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/usrsctp/all/CMakeLists.txt b/recipes/usrsctp/all/CMakeLists.txt new file mode 100644 index 0000000000000..3bead6a0d9320 --- /dev/null +++ b/recipes/usrsctp/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +if (WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/usrsctp/all/conandata.yml b/recipes/usrsctp/all/conandata.yml new file mode 100644 index 0000000000000..61e799fd3d464 --- /dev/null +++ b/recipes/usrsctp/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.9.5.0": + url: https://github.com/sctplab/usrsctp/archive/refs/tags/0.9.5.0.tar.gz + sha256: 260107caf318650a57a8caa593550e39bca6943e93f970c80d6c17e59d62cd92 +patches: + "0.9.5.0": + - patch_file: "patches/0001-install.patch" + base_path: "source_subfolder" diff --git a/recipes/usrsctp/all/conanfile.py b/recipes/usrsctp/all/conanfile.py new file mode 100644 index 0000000000000..73752d1325d3b --- /dev/null +++ b/recipes/usrsctp/all/conanfile.py @@ -0,0 +1,74 @@ +from conans import ConanFile, CMake, tools +import os + + +class UsrsctpConan(ConanFile): + name = "usrsctp" + license = "BSD-3-Clause" + homepage = "https://github.com/sctplab/usrsctp" + url = "https://github.com/conan-io/conan-center-index" + topics = ("conan", "network", "sctp") + description = " A portable SCTP userland stack" + settings = "os", "compiler", "arch", "build_type" + 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" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "usrsctp-{}".format(self.version) + os.rename(extracted_dir, self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["sctp_debug"] = False + self._cmake.definitions["sctp_werror"] = False + self._cmake.definitions["sctp_build_shared_lib"] = self.options.shared + self._cmake.definitions["sctp_build_programs"] = False + self._cmake.configure() + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.md", 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.names["pkg_config"] = "usrsctp" + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(['ws2_32', 'iphlpapi']) + elif self.settings.os == "Linux": + self.cpp_info.system_libs.extend(['pthread']) + suffix = "_import" if self.settings.os == "Windows" and self.options.shared else "" + self.cpp_info.libs = ["usrsctp" + suffix] diff --git a/recipes/usrsctp/all/patches/0001-install.patch b/recipes/usrsctp/all/patches/0001-install.patch new file mode 100644 index 0000000000000..a3fdba9d2897a --- /dev/null +++ b/recipes/usrsctp/all/patches/0001-install.patch @@ -0,0 +1,16 @@ +--- usrsctplib/CMakeLists.txt 2021-03-21 12:44:01.000000000 +0300 ++++ usrsctplib/CMakeLists.txt 2021-03-21 12:44:43.000000000 +0300 +@@ -188,9 +188,11 @@ + # INSTALL LIBRARY AND HEADER + ################################################# + +-install(TARGETS usrsctp DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS usrsctp ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES usrsctp.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- + ################################################# + # GENERATE AND INSTALL PKG-CONFIG FILE + ################################################# diff --git a/recipes/usrsctp/all/test_package/CMakeLists.txt b/recipes/usrsctp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a60174007a234 --- /dev/null +++ b/recipes/usrsctp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(usrsctp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} usrsctp::usrsctp) diff --git a/recipes/usrsctp/all/test_package/conanfile.py b/recipes/usrsctp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/usrsctp/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/usrsctp/all/test_package/test_package.c b/recipes/usrsctp/all/test_package/test_package.c new file mode 100644 index 0000000000000..9b16c7e4b47f9 --- /dev/null +++ b/recipes/usrsctp/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) +{ + usrsctp_finish(); + return 0; +} diff --git a/recipes/usrsctp/config.yml b/recipes/usrsctp/config.yml new file mode 100644 index 0000000000000..3a7cdc00a7bc4 --- /dev/null +++ b/recipes/usrsctp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.5.0": + folder: all diff --git a/recipes/utf8.h/all/conandata.yml b/recipes/utf8.h/all/conandata.yml new file mode 100644 index 0000000000000..8841db197744f --- /dev/null +++ b/recipes/utf8.h/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210310": + url: "https://github.com/sheredom/utf8.h/archive/ee5a7d4beb7755da13e4d4ec3eccfb65a0530456.tar.gz" + sha256: "d7c9ad480b640c76292a1c4b9735497fd635cb8828e95beabb7db91ea4cecf55" diff --git a/recipes/utf8.h/all/conanfile.py b/recipes/utf8.h/all/conanfile.py new file mode 100644 index 0000000000000..3c63ca89d6157 --- /dev/null +++ b/recipes/utf8.h/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class Utf8HConan(ConanFile): + name = "utf8.h" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sheredom/utf8.h" + description = "Single header utf8 string functions for C and C++" + topics = ("utf8", "unicode", "text") + license = "Unlicense" + 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) + + def build(self): + pass + + def package(self): + copy(self, "utf8.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/utf8.h/all/test_package/CMakeLists.txt b/recipes/utf8.h/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..59a397c341a04 --- /dev/null +++ b/recipes/utf8.h/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(utf8.h REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8.h::utf8.h) diff --git a/recipes/utf8.h/all/test_package/conanfile.py b/recipes/utf8.h/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/utf8.h/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/utf8.h/all/test_package/test_package.cpp b/recipes/utf8.h/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fd1eef99eafd8 --- /dev/null +++ b/recipes/utf8.h/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "utf8.h" + +int main() +{ + const char ref[] = {'\xcf', '\xb4', '\xce', '\x98', '\xce', + '\x98', '\xce', '\x98', '\0'}; + char str[] = {'\xcf', '\xb4', '\xce', '\xb8', '\xce', + '\x98', '\xcf', '\x91', '\0'}; + + int r = utf8ncasecmp(ref, str, 8); + + return 0; +} diff --git a/recipes/utf8.h/all/test_v1_package/CMakeLists.txt b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e35aca1f7a135 --- /dev/null +++ b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(utf8.h REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8.h::utf8.h) diff --git a/recipes/utf8.h/all/test_v1_package/conanfile.py b/recipes/utf8.h/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/utf8.h/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/utf8.h/config.yml b/recipes/utf8.h/config.yml new file mode 100644 index 0000000000000..dc79ecf2dafac --- /dev/null +++ b/recipes/utf8.h/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210310": + folder: all diff --git a/recipes/utf8proc/all/conandata.yml b/recipes/utf8proc/all/conandata.yml new file mode 100644 index 0000000000000..2e408e9011b37 --- /dev/null +++ b/recipes/utf8proc/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.8.0": + url: "https://github.com/JuliaStrings/utf8proc/archive/v2.8.0.tar.gz" + sha256: "a0a60a79fe6f6d54e7d411facbfcc867a6e198608f2cd992490e46f04b1bcecc" + "2.7.0": + url: "https://github.com/JuliaStrings/utf8proc/archive/v2.7.0.tar.gz" + sha256: "4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1" + "2.6.1": + url: "https://github.com/JuliaStrings/utf8proc/archive/v2.6.1.tar.gz" + sha256: "4c06a9dc4017e8a2438ef80ee371d45868bda2237a98b26554de7a95406b283b" + "2.6.0": + url: "https://github.com/JuliaStrings/utf8proc/archive/v2.6.0.tar.gz" + sha256: "b36ce1534b8035e7febd95c031215ed279ee9d31cf9b464e28b4c688133b22c5" + "2.5.0": + url: "https://github.com/JuliaStrings/utf8proc/archive/v2.5.0.tar.gz" + sha256: "d4e8dfc898cfd062493cb7f42d95d70ccdd3a4cd4d90bec0c71b47cca688f1be" diff --git a/recipes/utf8proc/all/conanfile.py b/recipes/utf8proc/all/conanfile.py new file mode 100644 index 0000000000000..698e23be72ec9 --- /dev/null +++ b/recipes/utf8proc/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.47.0" + + +class Utf8ProcConan(ConanFile): + name = "utf8proc" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/JuliaStrings/utf8proc" + description = "A clean C library for processing UTF-8 Unicode data" + topics = ("utf", "utf8", "unicode", "text") + license = "MIT expat" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + 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.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libutf8proc") + suffix = "_static" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"utf8proc{suffix}"] + if not self.options.shared: + self.cpp_info.defines = ["UTF8PROC_STATIC"] diff --git a/recipes/utf8proc/all/test_package/CMakeLists.txt b/recipes/utf8proc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..55f8f30732e29 --- /dev/null +++ b/recipes/utf8proc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(utf8proc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8proc::utf8proc) diff --git a/recipes/utf8proc/all/test_package/conanfile.py b/recipes/utf8proc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/utf8proc/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/utf8proc/all/test_package/test_package.c b/recipes/utf8proc/all/test_package/test_package.c new file mode 100644 index 0000000000000..9f9d0edb86c36 --- /dev/null +++ b/recipes/utf8proc/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "utf8proc.h" + +#include + +int main() +{ + printf("utf8proc version %s\n", utf8proc_version()); + printf("unicode version %s\n", utf8proc_unicode_version()); + return 0; +} diff --git a/recipes/utf8proc/all/test_v1_package/CMakeLists.txt b/recipes/utf8proc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..93470a5a40dd5 --- /dev/null +++ b/recipes/utf8proc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(utf8proc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8proc::utf8proc) diff --git a/recipes/utf8proc/all/test_v1_package/conanfile.py b/recipes/utf8proc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/utf8proc/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/utf8proc/config.yml b/recipes/utf8proc/config.yml new file mode 100644 index 0000000000000..44b916f7f7e88 --- /dev/null +++ b/recipes/utf8proc/config.yml @@ -0,0 +1,11 @@ +versions: + "2.8.0": + folder: all + "2.7.0": + folder: all + "2.6.1": + folder: all + "2.6.0": + folder: all + "2.5.0": + folder: all diff --git a/recipes/utfcpp/all/conandata.yml b/recipes/utfcpp/all/conandata.yml new file mode 100644 index 0000000000000..f435f56f7acf1 --- /dev/null +++ b/recipes/utfcpp/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.2.3": + url: "https://github.com/nemtrif/utfcpp/archive/v3.2.3.tar.gz" + sha256: "3ba9b0dbbff08767bdffe8f03b10e596ca351228862722e4c9d4d126d2865250" + "3.2.2": + url: "https://github.com/nemtrif/utfcpp/archive/v3.2.2.tar.gz" + sha256: "6f81e7cb2be2a6a9109a8a0cb7dc39ec947f1bcdb5dfa4a660e11a23face19f5" + "3.2.1": + url: "https://github.com/nemtrif/utfcpp/archive/refs/tags/v3.2.1.tar.gz" + sha256: "8d6aa7d77ad0abb35bb6139cb9a33597ac4c5b33da6a004ae42429b8598c9605" + "3.2": + url: "https://github.com/nemtrif/utfcpp/archive/v3.2.tar.gz" + sha256: "cd4f9a66d23dc385bd7ea11bc0abfda8ea1ad1dcf5cd6d3a27bc551e86436364" + "3.1.2": + url: "https://github.com/nemtrif/utfcpp/archive/v3.1.2.tar.gz" + sha256: "fea3bfa39fb8bd7368077ea5e1e0db9a8951f7e6fb6d9400b00ab3d92b807c6d" + "3.1.1": + url: "https://github.com/nemtrif/utfcpp/archive/v3.1.1.tar.gz" + sha256: "33496a4c3cc2de80e9809c4997052331af5fb32079f43ab4d667cd48c3a36e88" + "3.1": + url: "https://github.com/nemtrif/utfcpp/archive/v3.1.tar.gz" + sha256: "ab531c3fd5d275150430bfaca01d7d15e017a188183be932322f2f651506b096" diff --git a/recipes/utfcpp/all/conanfile.py b/recipes/utfcpp/all/conanfile.py new file mode 100644 index 0000000000000..34e0685b4ddb2 --- /dev/null +++ b/recipes/utfcpp/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class UtfCppConan(ConanFile): + name = "utfcpp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nemtrif/utfcpp" + description = "UTF-8 with C++ in a Portable Way" + topics = ("utf", "utf8", "unicode", "text") + license = "BSL-1.0" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def 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=os.path.join(self.source_folder, "source"), + dst=os.path.join(self.package_folder, "include", "utf8cpp")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"utf8cpp": "utf8cpp::utf8cpp"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "utf8cpp") + self.cpp_info.set_property("cmake_target_name", "utf8cpp") + self.cpp_info.includedirs.append(os.path.join("include", "utf8cpp")) + 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"] = "utf8cpp" + self.cpp_info.names["cmake_find_package_multi"] = "utf8cpp" + 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/utfcpp/all/test_package/CMakeLists.txt b/recipes/utfcpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fe794ae36be57 --- /dev/null +++ b/recipes/utfcpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(utf8cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/utfcpp/all/test_package/conanfile.py b/recipes/utfcpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/utfcpp/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/utfcpp/all/test_package/test_package.cpp b/recipes/utfcpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..61700eae54fbe --- /dev/null +++ b/recipes/utfcpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include "utf8.h" +#include +#include +#include + + +using namespace std; + +int main(int argc, char** argv) +{ + // U+1f600, grinning smiley face + std::string text = "\xf0\x9f\x98\x80"; + bool valid = utf8::is_valid(text.begin(), text.end()); + std::ptrdiff_t length = utf8::distance(text.begin(), text.end()); + + std::cout << "Valid = " << valid << " length = " << length << "\n"; + return 0; +} diff --git a/recipes/utfcpp/all/test_v1_package/CMakeLists.txt b/recipes/utfcpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/utfcpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/utfcpp/all/test_v1_package/conanfile.py b/recipes/utfcpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/utfcpp/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/utfcpp/config.yml b/recipes/utfcpp/config.yml new file mode 100644 index 0000000000000..00df0fb881cb8 --- /dev/null +++ b/recipes/utfcpp/config.yml @@ -0,0 +1,15 @@ +versions: + "3.2.3": + folder: all + "3.2.2": + folder: all + "3.2.1": + folder: all + "3.2": + folder: all + "3.1.2": + folder: all + "3.1.1": + folder: all + "3.1": + folder: all diff --git a/recipes/uvw/all/conandata.yml b/recipes/uvw/all/conandata.yml new file mode 100644 index 0000000000000..f47d086dd6f95 --- /dev/null +++ b/recipes/uvw/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.12.1": + url: "https://github.com/skypjack/uvw/archive/v2.12.1_libuv_v1.44.tar.gz" + sha256: "3460842778e91e7d2fae4201e49e4521e9d94fbbf3891ae6c52d3c9fc0673598" + "2.11.0": + url: "https://github.com/skypjack/uvw/archive/v2.11.0_libuv_v1.43.tar.gz" + sha256: "3af4efa2842299490ec764f2148f85f4426dfb4f8d8aa436cc2d049db2b7b514" + "2.10.0": + url: "https://github.com/skypjack/uvw/archive/v2.10.0_libuv_v1.42.tar.gz" + sha256: "30b0ba97a94d5e652490c6b1b32c95e608263f21cf3bc606308d09b3e3a114bf" + "2.9.0": + url: "https://github.com/skypjack/uvw/archive/v2.9.0_libuv_v1.41.tar.gz" + sha256: "dd610cb1626b8a7779ed251584bcc0362fb98fcee13e699680f61828a1ba55de" + "2.8.0": + url: "https://github.com/skypjack/uvw/archive/v2.8.0_libuv_v1.40.tar.gz" + sha256: "aa5769f5b9ba50de72ab02a8f8acf298b4aa9ceaef07992418a13a0fa119ce7d" + "2.6.0": + url: "https://github.com/skypjack/uvw/archive/v2.6.0_libuv-v1.38.tar.gz" + sha256: "2695276bb4b154174ac0a6401bde5c0768bca99a43c9a469af67526f7e2e9410" diff --git a/recipes/uvw/all/conanfile.py b/recipes/uvw/all/conanfile.py new file mode 100644 index 0000000000000..c710f06618ebd --- /dev/null +++ b/recipes/uvw/all/conanfile.py @@ -0,0 +1,85 @@ +import os +import glob +import re +from conans import ConanFile, tools +from conans.errors import ConanException, ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class UvwConan(ConanFile): + name = "uvw" + description = "Header-only, event based, tiny and easy to use libuv wrapper in modern C++." + topics = ("uvw", "libuv", "io", "networking", "header-only",) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/skypjack/uvw" + no_copy_source = True + settings = "compiler" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _supported_compiler(self): + compiler = str(self.settings.compiler) + version = tools.Version(self.settings.compiler.version) + if compiler == "Visual Studio" and version >= "15": + return True + if compiler == "gcc" and version >= "7": + return True + if compiler == "clang" and version >= "5": + return True + if compiler == "apple-clang" and version >= "10": + return True + return False + + def configure(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + if not self._supported_compiler: + raise ConanInvalidConfiguration("uvw requires C++17. {} {} does not support it.".format( + str(self.settings.compiler), + self.settings.compiler.version) + ) + + @property + def _required_EXACT_libuv_version(self): + """ Return *EXACT* libuv version to use with this uvw library """ + match = re.match(r".*libuv[_-]v([0-9]+\.[0-9]+).*", self.conan_data["sources"][self.version]["url"]) + if not match: + raise ConanException("uvw recipe does not know what version of libuv to use as dependency") + return tools.Version(match.group(1)) + + def requirements(self): + libuv_version = self._required_EXACT_libuv_version + revision = 0 + if libuv_version.major == "1" and libuv_version.minor == "44": + revision = 1 + self.requires("libuv/{}.{}.{}".format(libuv_version.major, libuv_version.minor, revision)) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "src")) + self.copy("*", dst=os.path.join("include", "uvw"), src=os.path.join(self._source_subfolder, "src", "uvw")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + # Check whether the version of libuv used as a requirement is ok + required_version = self._required_EXACT_libuv_version + tuple_exact = (required_version.major, required_version.minor) + + current_version = tools.Version(self.deps_cpp_info["libuv"].version) + tuple_current = (current_version.major, current_version.minor) + + if tuple_exact != tuple_current: + raise ConanException("This version of uvw requires an exact libuv version as dependency: {}.{}".format( + required_version.major, + required_version.minor) + ) diff --git a/recipes/uvw/all/test_package/CMakeLists.txt b/recipes/uvw/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a744e56bf2d7 --- /dev/null +++ b/recipes/uvw/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(uvw REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} uvw::uvw) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/uvw/all/test_package/conanfile.py b/recipes/uvw/all/test_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/uvw/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/uvw/all/test_package/test_package.cpp b/recipes/uvw/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dda75d5b7decc --- /dev/null +++ b/recipes/uvw/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + auto loop = uvw::Loop::getDefault(); + assert(loop != nullptr); +} diff --git a/recipes/uvw/config.yml b/recipes/uvw/config.yml new file mode 100644 index 0000000000000..96dd6767e90c4 --- /dev/null +++ b/recipes/uvw/config.yml @@ -0,0 +1,13 @@ +versions: + "2.12.1": + folder: "all" + "2.11.0": + folder: "all" + "2.10.0": + folder: "all" + "2.9.0": + folder: "all" + "2.8.0": + folder: "all" + "2.6.0": + folder: "all" diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml new file mode 100644 index 0000000000000..d0d6f814547b2 --- /dev/null +++ b/recipes/uwebsockets/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "20.36.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.36.0.tar.gz" + sha256: "cda266f7ed6abe67ef3cae6e223a580fe5091db9156c1f4123ee328ae21511c9" + "20.17.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.17.0.tar.gz" + sha256: "62027b0b847563bcc65a760045dc4233328229fc551f97fe5814e518e272141c" + "20.14.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.14.0.tar.gz" + sha256: "15cf995844a930c9a36747e8d714b94ff886b6814b5d4e3b3ee176f05681cccc" + "20.9.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.9.0.tar.gz" + sha256: "91897568291a2081ffc1ae27c354446cc130c168a25892b2289f25e185af8676" + "20.8.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.8.0.tar.gz" + sha256: "6ab4bc0207f44eacbb9c82fd0dc59a49ef84e13698ccdbfb44b92c6a0eaa951a" + "19.3.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v19.3.0.tar.gz" + sha256: "6f709b4e5fe053a94a952da93c07c919b36bcb8c838c69067560ae85f97c5621" + "19.2.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v19.2.0.tar.gz" + sha256: "2956075293090754bc2431c53634f93a1e74739c61392be6040cb3ed29430ec2" + "19.1.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v19.1.0.tar.gz" + sha256: "65afa329b0c768a7443ea2621f3f371bc5ce0e1c3518d59bb11b9a2c7adb65dd" + "18.3.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v18.3.0.tar.gz" + sha256: "f51317e2a8cd743e6ff9dfd215569824eaca489c24f7d8fd94eaca44443a9728" diff --git a/recipes/uwebsockets/all/conanfile.py b/recipes/uwebsockets/all/conanfile.py new file mode 100644 index 0000000000000..a7539cf95209b --- /dev/null +++ b/recipes/uwebsockets/all/conanfile.py @@ -0,0 +1,109 @@ +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 UwebsocketsConan(ConanFile): + name = "uwebsockets" + description = "Simple, secure & standards compliant web server for the most demanding of applications" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/uNetworking/uWebSockets" + topics = ("websocket", "network", "server", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_zlib": [True, False], + "with_libdeflate": [True, False], + } + default_options = { + "with_zlib": True, + "with_libdeflate": False, + } + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7" if Version(self.version) < "20.11.0" else "8", + "clang": "5" if Version(self.version) < "20.11.0" else "7", + "apple-clang": "10", + } + + def config_options(self): + # libdeflate is not supported before 19.0.0 + if Version(self.version) < "19.0.0": + del self.options.with_libdeflate + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.get_safe("with_libdeflate"): + self.requires("libdeflate/1.14") + + if Version(self.version) > "20.17.0": + self.requires("usockets/0.8.5") + elif Version(self.version) >= "20.15.0": + self.requires("usockets/0.8.2") + elif Version(self.version) >= "19.0.0": + self.requires("usockets/0.8.1") + else: + self.requires("usockets/0.4.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if Version(self.version) >= "20.14.0" and self.settings.compiler == "clang" and str(self.settings.compiler.libcxx) == "libstdc++": + raise ConanInvalidConfiguration(f"{self.ref} needs recent libstdc++ with charconv.") + + 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", + src=os.path.join(self.source_folder, "src"), + dst=os.path.join(self.package_folder, "include", "uWebSockets"), + keep_path=False, + ) + copy(self, + pattern="*.hpp", + src=os.path.join(self.source_folder, "src", "f2"), + dst=os.path.join(self.package_folder, "include", "uWebSockets", "f2"), + keep_path=False, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if not self.options.with_zlib: + self.cpp_info.defines.append("UWS_NO_ZLIB") + if self.options.get_safe("with_libdeflate"): + self.cpp_info.defines.append("UWS_USE_LIBDEFLATE") + + self.cpp_info.includedirs.append(os.path.join("include", "uWebSockets")) diff --git a/recipes/uwebsockets/all/test_package/CMakeLists.txt b/recipes/uwebsockets/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..38145240aeafa --- /dev/null +++ b/recipes/uwebsockets/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(uwebsockets REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE uwebsockets::uwebsockets) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/uwebsockets/all/test_package/conanfile.py b/recipes/uwebsockets/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/uwebsockets/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/uwebsockets/all/test_package/test_package.cpp b/recipes/uwebsockets/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c90ec37c8b63b --- /dev/null +++ b/recipes/uwebsockets/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#include "App.h" + +int main() +{ + uWS::App app; + + app + .get("/", [](uWS::HttpResponse *res, uWS::HttpRequest* req) { + res->end("Hello world!"); + }) + .listen(3000, [](auto* token) { + if (token) { + std::cout << "Serving over HTTP a 3000." << std::endl; + } + }); +} diff --git a/recipes/uwebsockets/all/test_v1_package/CMakeLists.txt b/recipes/uwebsockets/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/uwebsockets/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/uwebsockets/all/test_v1_package/conanfile.py b/recipes/uwebsockets/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/uwebsockets/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/uwebsockets/config.yml b/recipes/uwebsockets/config.yml new file mode 100644 index 0000000000000..be1e8815a9c32 --- /dev/null +++ b/recipes/uwebsockets/config.yml @@ -0,0 +1,19 @@ +versions: + "20.36.0": + folder: all + "20.17.0": + folder: all + "20.14.0": + folder: all + "20.9.0": + folder: all + "20.8.0": + folder: all + "19.3.0": + folder: all + "19.2.0": + folder: all + "19.1.0": + folder: all + "18.3.0": + folder: all diff --git a/recipes/v-hacd/all/conandata.yml b/recipes/v-hacd/all/conandata.yml new file mode 100644 index 0000000000000..730e7d62d1b90 --- /dev/null +++ b/recipes/v-hacd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.1.0": + url: "https://github.com/kmammou/v-hacd/archive/refs/tags/v4.1.0.tar.gz" + sha256: "9fe895cd10ec995d2171b11bde97aaaa221b418a3aaed0f5d9a068ae057d626b" diff --git a/recipes/v-hacd/all/conanfile.py b/recipes/v-hacd/all/conanfile.py new file mode 100644 index 0000000000000..0121a2fed52b8 --- /dev/null +++ b/recipes/v-hacd/all/conanfile.py @@ -0,0 +1,60 @@ +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.50.0" + + +class VhacdConan(ConanFile): + name = "v-hacd" + description = "The V-HACD library decomposes a 3D surface into a set of \"near\" convex parts." + license = "BSD-3-Clause" + topics = ("3d", "mesh", "shape", "decomposition", "convex") + homepage = "https://github.com/kmammou/v-hacd" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "11" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + } + + 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) + 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 + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/v-hacd/all/test_package/CMakeLists.txt b/recipes/v-hacd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..188e6c3aff9e2 --- /dev/null +++ b/recipes/v-hacd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(v-hacd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE v-hacd::v-hacd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/v-hacd/all/test_package/conanfile.py b/recipes/v-hacd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/v-hacd/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/v-hacd/all/test_package/test_package.cpp b/recipes/v-hacd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..08b411c10dff9 --- /dev/null +++ b/recipes/v-hacd/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#define ENABLE_VHACD_IMPLEMENTATION 1 +#define VHACD_DISABLE_THREADING 1 +#include + +int main() { + VHACD::IVHACD *iface = VHACD::CreateVHACD(); + iface->Release(); + return 0; +} diff --git a/recipes/v-hacd/all/test_v1_package/CMakeLists.txt b/recipes/v-hacd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/v-hacd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/v-hacd/all/test_v1_package/conanfile.py b/recipes/v-hacd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/v-hacd/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/v-hacd/config.yml b/recipes/v-hacd/config.yml new file mode 100644 index 0000000000000..702888c159594 --- /dev/null +++ b/recipes/v-hacd/config.yml @@ -0,0 +1,3 @@ +versions: + "4.1.0": + folder: all diff --git a/recipes/vaapi/all/conanfile.py b/recipes/vaapi/all/conanfile.py new file mode 100644 index 0000000000000..4708e007dd88c --- /dev/null +++ b/recipes/vaapi/all/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager + +required_conan_version = ">=1.50.0" + + +class SysConfigVAAPIConan(ConanFile): + name = "vaapi" + version = "system" + description = "VA-API is an open-source library and API specification, which provides access to graphics hardware acceleration capabilities for video processing." + topics = ("hwaccel", "video") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://01.org/linuxmedia/vaapi" + license = "MIT" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def system_requirements(self): + dnf = package_manager.Dnf(self) + dnf.install(["libva-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["libva-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libva-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libva"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["libva-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libva"], update=True, check=True) + + def package_info(self): + if self.settings.os in ["Linux", "FreeBSD"]: + for name in ['libva', 'libva-x11', 'libva-drm']: + pkg_config = PkgConfig(self, name) + self.cpp_info.components[name].includedirs = [] + self.cpp_info.components[name].libdirs = [] + pkg_config.fill_cpp_info(self.cpp_info.components[name]) diff --git a/recipes/vaapi/all/test_package/CMakeLists.txt b/recipes/vaapi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1cc7d1fad52a6 --- /dev/null +++ b/recipes/vaapi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(xorg REQUIRED CONFIG) +find_package(vaapi REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE vaapi::vaapi xorg::xorg) diff --git a/recipes/vaapi/all/test_package/conanfile.py b/recipes/vaapi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e81d71833c5a3 --- /dev/null +++ b/recipes/vaapi/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + requires = ("xorg/system",) + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/vaapi/all/test_package/test_package.c b/recipes/vaapi/all/test_package/test_package.c new file mode 100644 index 0000000000000..57db8fa4521bc --- /dev/null +++ b/recipes/vaapi/all/test_package/test_package.c @@ -0,0 +1,38 @@ +#include +#include + +#include + +#include + +int main() +{ + VADisplay va_display; + VAStatus status; + int major, minor; + Display * display = XOpenDisplay(NULL); + if (!display) + { + printf("XOpenDisplay failed!\n"); + return 0; + } + va_display = vaGetDisplay(display); + if (!va_display) + { + XCloseDisplay(display); + printf("vaGetDisplay failed\n"); + return 0; + } + status = vaInitialize(va_display, &major, &minor); + if (status == VA_STATUS_SUCCESS) + printf("va version %d.%d\n", major, minor); + else + { + XCloseDisplay(display); + printf("vaInitialize failed\n"); + return 0; + } + vaTerminate(va_display); + XCloseDisplay(display); + return 0; +} diff --git a/recipes/vaapi/all/test_v1_package/CMakeLists.txt b/recipes/vaapi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f5bce0e6460d --- /dev/null +++ b/recipes/vaapi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(SOURCES ../test_package/test_package.c) + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/vaapi/all/test_v1_package/conanfile.py b/recipes/vaapi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1b482d65b9b4e --- /dev/null +++ b/recipes/vaapi/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + requires = ("xorg/system",) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vaapi/config.yml b/recipes/vaapi/config.yml new file mode 100644 index 0000000000000..0594dfd676099 --- /dev/null +++ b/recipes/vaapi/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: all diff --git a/recipes/valijson/all/conandata.yml b/recipes/valijson/all/conandata.yml new file mode 100644 index 0000000000000..7d91b8058deb9 --- /dev/null +++ b/recipes/valijson/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0": + url: "https://github.com/tristanpenman/valijson/archive/v1.0.tar.gz" + sha256: "6b9f0bc89880feb3fe09aa469cd81f6168897d2fbb4e715853da3b94afd3779a" + "0.7": + url: "https://github.com/tristanpenman/valijson/archive/v0.7.tar.gz" + sha256: "bc24736709acfb252a5fdcb5145f1f2670c7aecaba3356f6f8ba54903800fa5c" + "0.6": + url: "https://github.com/tristanpenman/valijson/archive/v0.6.tar.gz" + sha256: "e06bf78fc1d26d4956fabc182408ebbbc47e3a6699778cda4aa439c2a6110b09" diff --git a/recipes/valijson/all/conanfile.py b/recipes/valijson/all/conanfile.py new file mode 100644 index 0000000000000..4c1f0676480ad --- /dev/null +++ b/recipes/valijson/all/conanfile.py @@ -0,0 +1,61 @@ +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 ValijsonConan(ConanFile): + name = "valijson" + description = "Valijson is a header-only JSON Schema Validation library for C++11." + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tristanpenman/valijson" + topics = ("json", "validator", "header-only") + 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], destination=self.source_folder, 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="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_target_name", "ValiJSON::valijson") + self.cpp_info.components["libvalijson"].set_property("cmake_target_name", "ValiJSON::valijson") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # self.cpp_info.filenames["cmake_find_package"] = "valijson" # TBA: There's no installed config file + # self.cpp_info.filenames["cmake_find_package_multi"] = "valijson" # TBA: There's no installed config file + self.cpp_info.names["cmake_find_package"] = "ValiJSON" + self.cpp_info.names["cmake_find_package_multi"] = "ValiJSON" + self.cpp_info.components["libvalijson"].names["cmake_find_package"] = "valijson" + self.cpp_info.components["libvalijson"].names["cmake_find_package_multi"] = "valijson" diff --git a/recipes/valijson/all/test_package/CMakeLists.txt b/recipes/valijson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f283c4c7cf92c --- /dev/null +++ b/recipes/valijson/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ValiJSON REQUIRED CONFIG) +find_package(nlohmann_json REQUIRED CONFIG) +find_package(picojson REQUIRED CONFIG) +find_package(RapidJSON REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries( + ${PROJECT_NAME} + PRIVATE + ValiJSON::valijson + nlohmann_json::nlohmann_json + picojson::picojson + rapidjson +) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/valijson/all/test_package/conanfile.py b/recipes/valijson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..44512632f983b --- /dev/null +++ b/recipes/valijson/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +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("nlohmann_json/3.9.1") + self.requires("rapidjson/cci.20200410") + self.requires("picojson/1.3.0") + 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") + schema_file = os.path.abspath(os.path.join(self.source_folder, "schema.json")) + valid_file = os.path.abspath(os.path.join(self.source_folder, "valid.json")) + invalid_file = os.path.abspath(os.path.join(self.source_folder, "invalid.json")) + self.run( + "{} {} {} {}".format(bin_path, schema_file, valid_file, invalid_file), + run_environment=True + ) diff --git a/recipes/valijson/all/test_package/invalid.json b/recipes/valijson/all/test_package/invalid.json new file mode 100644 index 0000000000000..b999e9feaeed4 --- /dev/null +++ b/recipes/valijson/all/test_package/invalid.json @@ -0,0 +1 @@ +["a", "b", "c"] diff --git a/recipes/valijson/all/test_package/schema.json b/recipes/valijson/all/test_package/schema.json new file mode 100644 index 0000000000000..662ac0edadf5a --- /dev/null +++ b/recipes/valijson/all/test_package/schema.json @@ -0,0 +1,20 @@ +{ + "comment": "Document must contain an array of integers, all unique.", + "allOf": [ + { + "items": { + "type": "integer" + }, + "additionalItems": false, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "additionalItems": false, + "type": "array", + "uniqueItems": true + } + ] +} diff --git a/recipes/valijson/all/test_package/test_package.cpp b/recipes/valijson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0a2edaf1a2fbf --- /dev/null +++ b/recipes/valijson/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +#include + +#include +#include +#include +#include +#include + +#include +#include + +using valijson::Schema; +using valijson::SchemaParser; +using valijson::Validator; +using valijson::adapters::RapidJsonAdapter; + +// To check successful compilation +#include +#include + +#define PICOJSON_USE_INT64 +#include +#include + +#include + +void check_document(const Schema& mySchema, const char* filename, bool is_valid_expectation) { + rapidjson::Document myTargetDoc; + if (!valijson::utils::loadDocument(filename, myTargetDoc)) { + throw std::runtime_error("Failed to load target document"); + } + + Validator validator; + RapidJsonAdapter myTargetAdapter(myTargetDoc); + if (validator.validate(mySchema, myTargetAdapter, NULL) != is_valid_expectation) { + throw std::runtime_error("Validation failed."); + } +} + +int main(int argc, const char* argv[]) { + if (argc != 4) { + throw std::runtime_error("Expected: binary schema.json valid.json invalid.json"); + } + // Load JSON document using RapidJSON with Valijson helper function + rapidjson::Document mySchemaDoc; + if (!valijson::utils::loadDocument(argv[1], mySchemaDoc)) { + throw std::runtime_error("Failed to load schema document"); + } + + // Parse JSON schema content using valijson + Schema mySchema; + SchemaParser parser; + RapidJsonAdapter mySchemaAdapter(mySchemaDoc); + parser.populateSchema(mySchemaAdapter, mySchema); + + check_document(mySchema, argv[2], true); + check_document(mySchema, argv[3], false); + + std::cout << "valijson successful run\n"; + + return 0; +} diff --git a/recipes/valijson/all/test_package/valid.json b/recipes/valijson/all/test_package/valid.json new file mode 100644 index 0000000000000..12bae17cf72db --- /dev/null +++ b/recipes/valijson/all/test_package/valid.json @@ -0,0 +1 @@ +[1, 2, 3, 4] diff --git a/recipes/valijson/all/test_v1_package/CMakeLists.txt b/recipes/valijson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..679bcbb3ab1fd --- /dev/null +++ b/recipes/valijson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ValiJSON REQUIRED CONFIG) +find_package(nlohmann_json REQUIRED CONFIG) +find_package(picojson REQUIRED CONFIG) +find_package(RapidJSON REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries( + ${PROJECT_NAME} + ValiJSON::valijson + nlohmann_json::nlohmann_json + picojson::picojson + RapidJSON::RapidJSON +) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/valijson/all/test_v1_package/conanfile.py b/recipes/valijson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1ffe3deaeb51c --- /dev/null +++ b/recipes/valijson/all/test_v1_package/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def requirements(self): + self.requires("nlohmann_json/3.9.1") + self.requires("rapidjson/cci.20200410") + self.requires("picojson/1.3.0") + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + schema_file = os.path.abspath(os.path.join(self.source_folder, os.pardir, "test_package", "schema.json")) + valid_file = os.path.abspath(os.path.join(self.source_folder, os.pardir, "test_package", "valid.json")) + invalid_file = os.path.abspath(os.path.join(self.source_folder, os.pardir, "test_package", "invalid.json")) + self.run( + "{} {} {} {}".format(bin_path, schema_file, valid_file, invalid_file), + run_environment=True + ) diff --git a/recipes/valijson/config.yml b/recipes/valijson/config.yml new file mode 100644 index 0000000000000..3fcfb3c4539e9 --- /dev/null +++ b/recipes/valijson/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0": + folder: "all" + "0.7": + folder: "all" + "0.6": + folder: "all" diff --git a/recipes/variant-lite/all/conandata.yml b/recipes/variant-lite/all/conandata.yml new file mode 100644 index 0000000000000..a253afe2aabae --- /dev/null +++ b/recipes/variant-lite/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.0": + url: "https://github.com/martinmoene/variant-lite/archive/v2.0.0.tar.gz" + sha256: "70c1509e24d03abfd22d2e702ab398238e69658b7b2890ce1d7e9731d6b5a7cb" + "1.2.2": + url: "https://github.com/martinmoene/variant-lite/archive/v1.2.2.tar.gz" + sha256: "97334108c3a92f7becc74e2798ab8e0ea57fd67d4ad893ec0b0b8e1c35bb411c" diff --git a/recipes/variant-lite/all/conanfile.py b/recipes/variant-lite/all/conanfile.py new file mode 100644 index 0000000000000..d51892fbac103 --- /dev/null +++ b/recipes/variant-lite/all/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class VariantLiteConan(ConanFile): + name = "variant-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/variant-lite" + description = "variant lite - A C++17-like variant, a type-safe union for C++98, C++11 and later in a single-file header-only library" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "variant", "variant-implementations") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "variant-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::variant-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "variant-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "variant-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["variantlite"].names["cmake_find_package"] = "variant-lite" + self.cpp_info.components["variantlite"].names["cmake_find_package_multi"] = "variant-lite" + self.cpp_info.components["variantlite"].set_property("cmake_target_name", "nonstd::variant-lite") + self.cpp_info.components["variantlite"].bindirs = [] + self.cpp_info.components["variantlite"].frameworkdirs = [] + self.cpp_info.components["variantlite"].libdirs = [] + self.cpp_info.components["variantlite"].resdirs = [] diff --git a/recipes/variant-lite/all/test_package/CMakeLists.txt b/recipes/variant-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a1eed7de87b18 --- /dev/null +++ b/recipes/variant-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(variant-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::variant-lite) diff --git a/recipes/variant-lite/all/test_package/conanfile.py b/recipes/variant-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/variant-lite/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/variant-lite/all/test_package/test_package.cpp b/recipes/variant-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b6dff616109c9 --- /dev/null +++ b/recipes/variant-lite/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include "nonstd/variant.hpp" + +#include +#include +#include + +using nonstd::variant; + +typedef variant ErrorInfo; + +ErrorInfo to_int( char const * const text ) +{ + char * pos = NULL; + const int value = static_cast( strtol( text, &pos, 0 ) ); + + return pos == text ? ErrorInfo(std::string("Failed to convert '") + text + std::string("' to int")) : ErrorInfo(value); +} + +int main( int argc, char * argv[] ) +{ + const char * text = argc > 1 ? argv[1] : "42"; + + ErrorInfo val = to_int( text ); + + if ( nonstd::get_if(&val) ) std::cout << "'" << text << "' is " << nonstd::get(val) << std::endl; + else std::cout << "'" << text << "' isn't a number. Error: " << nonstd::get(val) << std::endl; +} + +// cl -nologo -W3 -EHsc -I../include to_int.cpp && to_int x1 +// g++ -Wall -Wextra -std=c++03 -I../include -o to_int.exe to_int.cpp && to_int x1 diff --git a/recipes/variant-lite/all/test_v1_package/CMakeLists.txt b/recipes/variant-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c27a523717ef --- /dev/null +++ b/recipes/variant-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(variant-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::variant-lite) diff --git a/recipes/variant-lite/all/test_v1_package/conanfile.py b/recipes/variant-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/variant-lite/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/variant-lite/config.yml b/recipes/variant-lite/config.yml new file mode 100644 index 0000000000000..9e6e28e463759 --- /dev/null +++ b/recipes/variant-lite/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.0": + folder: all + "1.2.2": + folder: all diff --git a/recipes/vc/all/conandata.yml b/recipes/vc/all/conandata.yml new file mode 100644 index 0000000000000..b1e2f20f1981d --- /dev/null +++ b/recipes/vc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.4.2": + url: "https://github.com/VcDevel/Vc/releases/download/1.4.2/Vc-1.4.2.tar.gz" + sha256: "50d3f151e40b0718666935aa71d299d6370fafa67411f0a9e249fbce3e6e3952" + "1.4.1": + url: "https://github.com/VcDevel/Vc/releases/download/1.4.1/Vc-1.4.1.tar.gz" + sha256: "68e609a735326dc3625e98bd85258e1329fb2a26ce17f32c432723b750a4119f" diff --git a/recipes/vc/all/conanfile.py b/recipes/vc/all/conanfile.py new file mode 100644 index 0000000000000..7cfaddf7b0838 --- /dev/null +++ b/recipes/vc/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.51.1" + + +class VcConan(ConanFile): + name = "vc" + description = "SIMD Vector Classes for C++." + license = "BSD-3-Clause" + topics = ("vc", "simd", "vectorization", "parallel", "sse", "avx", "neon") + homepage = "https://github.com/VcDevel/Vc" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "AddCompilerFlag(\"-fPIC\" CXX_FLAGS libvc_compile_flags)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Vc") + self.cpp_info.set_property("cmake_target_name", "Vc::Vc") + self.cpp_info.libs = ["Vc"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Vc" + self.cpp_info.names["cmake_find_package_multi"] = "Vc" diff --git a/recipes/vc/all/test_package/CMakeLists.txt b/recipes/vc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f92c2d97f3154 --- /dev/null +++ b/recipes/vc/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Vc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Vc::Vc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vc/all/test_package/conanfile.py b/recipes/vc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vc/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/vc/all/test_package/test_package.cpp b/recipes/vc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..eb4100706228d --- /dev/null +++ b/recipes/vc/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include + +using Vec3D = std::array; + +Vc::float_v scalar_product(Vec3D a, Vec3D b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} + +int main() { + Vec3D a{1, 2, 3}; + Vec3D b{3, 4, 5}; + std::cout << scalar_product(a, b) << std::endl; + return 0; +} diff --git a/recipes/vc/all/test_v1_package/CMakeLists.txt b/recipes/vc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..492877a81dfa8 --- /dev/null +++ b/recipes/vc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Vc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Vc::Vc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vc/all/test_v1_package/conanfile.py b/recipes/vc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vc/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/vc/config.yml b/recipes/vc/config.yml new file mode 100644 index 0000000000000..0ba616ecf92b2 --- /dev/null +++ b/recipes/vc/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.2": + folder: all + "1.4.1": + folder: all diff --git a/recipes/vcglib/all/CMakeLists.txt b/recipes/vcglib/all/CMakeLists.txt new file mode 100644 index 0000000000000..503836eca235b --- /dev/null +++ b/recipes/vcglib/all/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.8) +project(vcglib LANGUAGES CXX) + +find_package(Eigen3 REQUIRED CONFIG) + +add_library(${PROJECT_NAME} ${VCGLIB_SRC_DIR}/wrap/ply/plylib.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +target_include_directories(${PROJECT_NAME} PUBLIC ${VCGLIB_SRC_DIR}) +target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(DIRECTORY "${VCGLIB_SRC_DIR}/vcg" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") +install(DIRECTORY "${VCGLIB_SRC_DIR}/wrap" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") +install(DIRECTORY "${VCGLIB_SRC_DIR}/img" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") diff --git a/recipes/vcglib/all/conandata.yml b/recipes/vcglib/all/conandata.yml new file mode 100644 index 0000000000000..d8dc31a26ed34 --- /dev/null +++ b/recipes/vcglib/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2022.02": + url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2022.02.tar.gz" + sha256: "724f5ef6ab9b9d21ff2e9e965c2ce909cc024b29f2aa7d39e2974b28ff25bc3f" + "2020.12": + url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2020.12.tar.gz" + sha256: "731c57435e39c4b958a1d766cadd9865d9db35e36410708f2da7818e9fa5f786" +patches: + "2022.02": + - patch_file: "patches/0001-use-external-eigen.patch" + "2020.12": + - patch_file: "patches/0001-use-external-eigen.patch" diff --git a/recipes/vcglib/all/conanfile.py b/recipes/vcglib/all/conanfile.py new file mode 100644 index 0000000000000..f452d7336181c --- /dev/null +++ b/recipes/vcglib/all/conanfile.py @@ -0,0 +1,76 @@ +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 VcglibConan(ConanFile): + name = "vcglib" + description = "Library for manipulation, processing, cleaning, simplifying triangle meshes." + license = "GPL-3.0-only" + topics = ("vcglib", "mesh-processing") + homepage = "https://github.com/cnr-isti-vclab/vcglib" + 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, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VCGLIB_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE.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 = ["vcglib"] diff --git a/recipes/vcglib/all/patches/0001-use-external-eigen.patch b/recipes/vcglib/all/patches/0001-use-external-eigen.patch new file mode 100644 index 0000000000000..78d56161a7a07 --- /dev/null +++ b/recipes/vcglib/all/patches/0001-use-external-eigen.patch @@ -0,0 +1,17 @@ +--- a/vcg/math/eigen.h ++++ b/vcg/math/eigen.h +@@ -53,10 +53,10 @@ struct ei_to_vcgtype; + } + + #include "base.h" +-#include "../../eigenlib/Eigen/LU" +-#include "../../eigenlib/Eigen/Geometry" +-#include "../../eigenlib/Eigen/Array" +-#include "../../eigenlib/Eigen/Core" ++#include ++#include ++#include ++#include + + // add support for unsigned char and short int + namespace Eigen { diff --git a/recipes/vcglib/all/test_package/CMakeLists.txt b/recipes/vcglib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e31ccdde007c2 --- /dev/null +++ b/recipes/vcglib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vcglib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vcglib::vcglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vcglib/all/test_package/conanfile.py b/recipes/vcglib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6ecd0412fd260 --- /dev/null +++ b/recipes/vcglib/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + obj_path = os.path.join(self.source_folder, "cube.obj") + self.run(f"{bin_path} {obj_path}", env="conanrun") diff --git a/recipes/vcglib/all/test_package/cube.obj b/recipes/vcglib/all/test_package/cube.obj new file mode 100644 index 0000000000000..4ebd02481d3eb --- /dev/null +++ b/recipes/vcglib/all/test_package/cube.obj @@ -0,0 +1,14 @@ +v 0.000000 2.000000 2.000000 +v 0.000000 0.000000 2.000000 +v 2.000000 0.000000 2.000000 +v 2.000000 2.000000 2.000000 +v 0.000000 2.000000 0.000000 +v 0.000000 0.000000 0.000000 +v 2.000000 0.000000 0.000000 +v 2.000000 2.000000 0.000000 +f 1 2 3 4 +f 8 7 6 5 +f 4 3 7 8 +f 5 1 4 8 +f 5 6 2 1 +f 2 6 7 3 diff --git a/recipes/vcglib/all/test_package/test_package.cpp b/recipes/vcglib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..873e203a1f774 --- /dev/null +++ b/recipes/vcglib/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include +#include + +#include + +class MyVertex; +class MyEdge; +class MyFace; + +struct MyUsedTypes: public vcg::UsedTypes::AsVertexType, vcg::Use::AsEdgeType, vcg::Use::AsFaceType>{}; +class MyVertex: public vcg::Vertex{}; +class MyFace: public vcg::Face{}; +class MyEdge: public vcg::Edge{}; +class MyMesh: public vcg::tri::TriMesh, std::vector , std::vector >{}; + +int main(int argc, char **argv) { + if (argc < 2) { + std::cerr << "Need at least 1 argument" << std::endl; + return -1; + } + + MyMesh m; + int dummymask = 0; + if (vcg::tri::io::Importer::Open(m, argv[1]) != 0) { + std::cerr << "Error reading file " << argv[1] << std::endl; + return -1; + } + + vcg::tri::RequirePerVertexNormal(m); + vcg::tri::UpdateNormal::PerVertexNormalized(m); + std::cout << "Mesh has " << m.VN() << " vert and " << m.FN() << " faces" << std::endl; + + return 0; +} diff --git a/recipes/vcglib/all/test_v1_package/CMakeLists.txt b/recipes/vcglib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b93c9e9b9c66 --- /dev/null +++ b/recipes/vcglib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(vcglib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vcglib::vcglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vcglib/all/test_v1_package/conanfile.py b/recipes/vcglib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4d2909d5e4d45 --- /dev/null +++ b/recipes/vcglib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + obj_path = os.path.join(self.source_folder, os.pardir, "test_package", "cube.obj") + self.run(f"{bin_path} {obj_path}", run_environment=True) diff --git a/recipes/vcglib/config.yml b/recipes/vcglib/config.yml new file mode 100644 index 0000000000000..8fa4c473789d6 --- /dev/null +++ b/recipes/vcglib/config.yml @@ -0,0 +1,5 @@ +versions: + "2022.02": + folder: all + "2020.12": + folder: all diff --git a/recipes/vdpau/all/conanfile.py b/recipes/vdpau/all/conanfile.py new file mode 100644 index 0000000000000..6c41a1e1b47da --- /dev/null +++ b/recipes/vdpau/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager + +required_conan_version = ">=1.50.0" + + +class SysConfigVDPAUConan(ConanFile): + name = "vdpau" + version = "system" + description = "VDPAU is the Video Decode and Presentation API for UNIX. It provides an interface to video decode acceleration and presentation hardware present in modern GPUs." + topics = ("hwaccel", "video") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/VDPAU/" + license = "MIT" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def system_requirements(self): + dnf = package_manager.Dnf(self) + dnf.install(["libvdpau-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["libvdpau-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libvdpau-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libvdpau"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["libvdpau-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libvdpau"], update=True, check=True) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + pkg_config = PkgConfig(self, "vdpau") + pkg_config.fill_cpp_info(self.cpp_info) diff --git a/recipes/vdpau/all/test_package/CMakeLists.txt b/recipes/vdpau/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0fe5a1d45c245 --- /dev/null +++ b/recipes/vdpau/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(PkgConfig) + +pkg_check_modules(VDPAU REQUIRED IMPORTED_TARGET vdpau) +find_package(xorg REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE PkgConfig::VDPAU xorg::xorg) diff --git a/recipes/vdpau/all/test_package/conanfile.py b/recipes/vdpau/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e81d71833c5a3 --- /dev/null +++ b/recipes/vdpau/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + requires = ("xorg/system",) + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/vdpau/all/test_package/test_package.c b/recipes/vdpau/all/test_package/test_package.c new file mode 100644 index 0000000000000..f3468bb4d0800 --- /dev/null +++ b/recipes/vdpau/all/test_package/test_package.c @@ -0,0 +1,46 @@ +#include +#include + +#include + +#include + +int main() +{ + VdpDevice device; + VdpGetProcAddress * get_proc_address; + VdpGetInformationString * get_information_string; + VdpGetApiVersion * get_api_version; + VdpStatus status; + Display * display = XOpenDisplay(NULL); + if (!display) + { + printf("XOpenDisplay failed!\n"); + return 0; + } + status = vdp_device_create_x11(display, 0, &device, &get_proc_address); + if (status != VDP_STATUS_OK) + { + XCloseDisplay(display); + printf("vdp_device_create_x11 failed\n"); + return 0; + } + status = get_proc_address(device, VDP_FUNC_ID_GET_INFORMATION_STRING, (void**) &get_information_string); + if (status == VDP_STATUS_OK) + { + char const * information_string; + status = get_information_string(&information_string); + if (status == VDP_STATUS_OK) + printf("VDPAU information string: %s\n", information_string); + } + status = get_proc_address(device, VDP_FUNC_ID_GET_API_VERSION, (void**) &get_api_version); + if (status == VDP_STATUS_OK) + { + uint32_t api_version; + status = get_api_version(&api_version); + if (status == VDP_STATUS_OK) + printf("VDPAU API version: %d\n", api_version); + } + XCloseDisplay(display); + return 0; +} diff --git a/recipes/vdpau/all/test_v1_package/CMakeLists.txt b/recipes/vdpau/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9dfdf0083dcd8 --- /dev/null +++ b/recipes/vdpau/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/vdpau/all/test_v1_package/conanfile.py b/recipes/vdpau/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1b482d65b9b4e --- /dev/null +++ b/recipes/vdpau/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + requires = ("xorg/system",) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vdpau/config.yml b/recipes/vdpau/config.yml new file mode 100644 index 0000000000000..0594dfd676099 --- /dev/null +++ b/recipes/vdpau/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: all diff --git a/recipes/vectorclass/all/CMakeLists.txt b/recipes/vectorclass/all/CMakeLists.txt new file mode 100644 index 0000000000000..80dcca3ff846c --- /dev/null +++ b/recipes/vectorclass/all/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(vectorclass LANGUAGES CXX) + +file(GLOB HEADERS "${VECTORCLASS_SRC_DIR}/*.h") + +add_library(vectorclass STATIC ${VECTORCLASS_SRC_DIR}/instrset_detect.cpp) +target_compile_features(vectorclass PUBLIC cxx_std_17) +set_target_properties(vectorclass PROPERTIES PUBLIC_HEADER "${HEADERS}") + +include(GNUInstallDirs) +install(TARGETS vectorclass + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/vectorclass/all/conandata.yml b/recipes/vectorclass/all/conandata.yml new file mode 100644 index 0000000000000..da6b0a54a46d6 --- /dev/null +++ b/recipes/vectorclass/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.02.00": + url: "https://github.com/vectorclass/version2/archive/refs/tags/v2.02.00.tar.gz" + sha256: "6c5ed181b78c1fc6f8fe022c8317f58a94cadfe892a12d6ace94cae9b0092a04" + "2.01.04": + url: "https://github.com/vectorclass/version2/archive/refs/tags/v2.01.04.tar.gz" + sha256: "7885c343b1af9eb940f4debdd7cd19544130a06ed70e0000e1a8471fb9c15118" + "2.01.03": + url: "https://github.com/vectorclass/version2/archive/refs/tags/v2.01.03.tar.gz" + sha256: "f538d6432ede3e9cd07d969eaadab8b3bf4909840c5260566070e9270cb70551" diff --git a/recipes/vectorclass/all/conanfile.py b/recipes/vectorclass/all/conanfile.py new file mode 100644 index 0000000000000..5696b99489d45 --- /dev/null +++ b/recipes/vectorclass/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.51.1" + + +class VectorclassConan(ConanFile): + name = "vectorclass" + description = "C++ class library for using the Single Instruction Multiple " \ + "Data (SIMD) instructions to improve performance on modern " \ + "microprocessors with the x86 or x86/64 instruction set on " \ + "Windows, Linux, and Mac platforms." + license = "Apache-2.0" + topics = ("vectorclass", "vector", "simd") + homepage = "https://github.com/vectorclass/version2" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "gcc": "7", + "clang": "4.0", + "apple-clang": "9.1", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.os not in ["Linux", "Windows", "Macos"] or self.info.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("vectorclass supports Linux/Windows/macOS and x86/x86_64 only.") + + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.info.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VECTORCLASS_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 = ["vectorclass"] diff --git a/recipes/vectorclass/all/test_package/CMakeLists.txt b/recipes/vectorclass/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b10c5c90bde2f --- /dev/null +++ b/recipes/vectorclass/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vectorclass REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vectorclass::vectorclass) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vectorclass/all/test_package/conanfile.py b/recipes/vectorclass/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vectorclass/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/vectorclass/all/test_package/test_package.cpp b/recipes/vectorclass/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c3941ae20360 --- /dev/null +++ b/recipes/vectorclass/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +#include + +#include +#include +#include + +void print_instruction_set() { + // 0 = 80386 instruction set + // 1 or above = SSE (XMM) supported by CPU (not testing for OS support) + // 2 or above = SSE2 + // 3 or above = SSE3 + // 4 or above = Supplementary SSE3 (SSSE3) + // 5 or above = SSE4.1 + // 6 or above = SSE4.2 + // 7 or above = AVX supported by CPU and operating system + // 8 or above = AVX2 + // 9 or above = AVX512F + //10 or above = AVX512VL, AVX512BW, AVX512DQ + const auto instruction_set = instrset_detect(); + switch (instruction_set) { + case 10: + std::cout << "AVX512VL, AVX512BW, AVX512DQ\n"; + case 9: + std::cout << "AVX512F\n"; + case 8: + std::cout << "AVX2\n"; + case 7: + std::cout << "AVX supported by CPU and operating system\n"; + case 6: + std::cout << "SSE4.2\n"; + case 5: + std::cout << "SSE4.1\n"; + case 4: + std::cout << "Supplementary SSE3 (SSSE3)\n"; + case 3: + std::cout << "SSE3\n"; + case 2: + std::cout << "SSE2\n"; + case 1: + std::cout << "SSE (XMM) supported by CPU (not testing for OS support)\n"; + case 0: + std::cout << "80386 instruction set\n"; + break; + default: + throw std::runtime_error("Unexpected instruction set " + std::to_string(instruction_set)); + } +} + +int main() { + print_instruction_set(); + + Vec4i a(10, 11, 12, 13); + Vec4i b(20, 21, 22, 23); + + Vec4i c = a + b; + for (int i = 0; i < c.size(); ++i) { + std::cout << " " << c[i]; + } + std::cout << std::endl; + + return 0; +} diff --git a/recipes/vectorclass/all/test_v1_package/CMakeLists.txt b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1d531c5d5a930 --- /dev/null +++ b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(vectorclass REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vectorclass::vectorclass) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vectorclass/all/test_v1_package/conanfile.py b/recipes/vectorclass/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vectorclass/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/vectorclass/config.yml b/recipes/vectorclass/config.yml new file mode 100644 index 0000000000000..f51bd6d25ae02 --- /dev/null +++ b/recipes/vectorclass/config.yml @@ -0,0 +1,7 @@ +versions: + "2.02.00": + folder: all + "2.01.04": + folder: all + "2.01.03": + folder: all diff --git a/recipes/vectorial/all/conandata.yml b/recipes/vectorial/all/conandata.yml new file mode 100644 index 0000000000000..b4965cef53409 --- /dev/null +++ b/recipes/vectorial/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20190628": + url: "https://github.com/scoopr/vectorial/archive/3a00e8c00d017cb49b12eeffd7464246d172ea97.zip" + sha256: "c24d65d8dcbb66353a76acfa44a2868273f472b568dc99842675c564d98b232d" diff --git a/recipes/vectorial/all/conanfile.py b/recipes/vectorial/all/conanfile.py new file mode 100644 index 0000000000000..fd7818ff4d997 --- /dev/null +++ b/recipes/vectorial/all/conanfile.py @@ -0,0 +1,42 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class VectorialConan(ConanFile): + name = "vectorial" + description = "Vector math library with NEON/SSE support" + topics = ("vectorial", "math", "vector") + license = "BSD-2-Clause" + homepage = "https://github.com/scoopr/vectorial" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/vectorial/all/test_package/CMakeLists.txt b/recipes/vectorial/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed8a803f47fad --- /dev/null +++ b/recipes/vectorial/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(vectorial REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vectorial::vectorial) diff --git a/recipes/vectorial/all/test_package/conanfile.py b/recipes/vectorial/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/vectorial/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/vectorial/all/test_package/test_package.cpp b/recipes/vectorial/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3c348f1614511 --- /dev/null +++ b/recipes/vectorial/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + vectorial::vec4f v = vectorial::normalize(vectorial::vec4f(1, 2, 3, 4)); + std::cout << v.z() << std::endl; + return 0; +} diff --git a/recipes/vectorial/all/test_v1_package/CMakeLists.txt b/recipes/vectorial/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..394022f35f7ca --- /dev/null +++ b/recipes/vectorial/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(vectorial REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vectorial::vectorial) diff --git a/recipes/vectorial/all/test_v1_package/conanfile.py b/recipes/vectorial/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vectorial/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/vectorial/config.yml b/recipes/vectorial/config.yml new file mode 100644 index 0000000000000..bbfd2876ec934 --- /dev/null +++ b/recipes/vectorial/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190628": + folder: all diff --git a/recipes/veque/all/conandata.yml b/recipes/veque/all/conandata.yml new file mode 100644 index 0000000000000..4a5e1d0f1ad9a --- /dev/null +++ b/recipes/veque/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.3.6": + url: "https://github.com/Shmoopty/veque/archive/v1.3.6.tar.gz" + sha256: "9d149b415d948529ac166c962501c59605ef24b3a8ab8561956a6d05f14870ea" + "1.3.5": + url: https://github.com/Shmoopty/veque/archive/refs/tags/v1.3.5.tar.gz + sha256: cdab543718aacee1a55f4b6203b5b6074c34db1f6b9775d8bece84fb0d4a8f5c diff --git a/recipes/veque/all/conanfile.py b/recipes/veque/all/conanfile.py new file mode 100644 index 0000000000000..54b31e162b380 --- /dev/null +++ b/recipes/veque/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 +import os + +required_conan_version = ">=1.50.0" + + +class VequeConan(ConanFile): + name = "veque" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Shmoopty/veque" + description = "Fast C++ container combining the best features of std::vector and std::deque" + topics = ("cpp17", "vector", "deque") + license = "BSL-1.0" + + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15.7", + "msvc": "191", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++17, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/veque/all/test_package/CMakeLists.txt b/recipes/veque/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..caac15bb37efa --- /dev/null +++ b/recipes/veque/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(veque REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE veque::veque) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/veque/all/test_package/conanfile.py b/recipes/veque/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/veque/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/veque/all/test_package/test_package.cpp b/recipes/veque/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..582d7c9eef2aa --- /dev/null +++ b/recipes/veque/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include "veque.hpp" + + +int main() +{ + veque::veque v; + v.push_front(1.f); + + auto r = v.back(); + v.pop_back(); + + std::cout << "veque::veque works!"; + return 0; +} diff --git a/recipes/veque/all/test_v1_package/CMakeLists.txt b/recipes/veque/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..79a72d05c7d54 --- /dev/null +++ b/recipes/veque/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(veque REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE veque::veque) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/veque/all/test_v1_package/conanfile.py b/recipes/veque/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/veque/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/veque/config.yml b/recipes/veque/config.yml new file mode 100644 index 0000000000000..10d3a845bf8c7 --- /dev/null +++ b/recipes/veque/config.yml @@ -0,0 +1,5 @@ +versions: + "1.3.6": + folder: all + "1.3.5": + folder: all diff --git a/recipes/verilator/all/conandata.yml b/recipes/verilator/all/conandata.yml new file mode 100644 index 0000000000000..d1f4e9b1e9a56 --- /dev/null +++ b/recipes/verilator/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "4.224": + url: "https://github.com/verilator/verilator/archive/refs/tags/v4.224.tar.gz" + sha256: "010ff2b5c76d4dbc2ed4a3278a5599ba35c8ed4c05690e57296d6b281591367b" + "4.200": + url: "https://www.veripool.org/ftp/verilator-4.200.tgz" + sha256: "773913f4410512a7a51de3d04964766438dc11fc22b213eab5c6c29730df3e36" + "4.038": + url: "https://www.veripool.org/ftp/verilator-4.038.tgz" + sha256: "fa004493216034ac3e26b21b814441bd5801592f4f269c5a4672e3351d73b515" + "4.034": + url: "https://www.veripool.org/ftp/verilator-4.034.tgz" + sha256: "54ed7b06ee28b5d21f9d0ee98406d29a508e6124b0d10e54bb32081613ddb80b" +patches: + "4.038": + - patch_file: "patches/0001-split-opt-and-debug-build-install.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-msvc-patches.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-add-msvc_link-sh.patch" + base_path: "source_subfolder" + "4.034": + - patch_file: "patches/0001-split-opt-and-debug-build-install.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-msvc-patches.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-add-msvc_link-sh.patch" + base_path: "source_subfolder" diff --git a/recipes/verilator/all/conanfile.py b/recipes/verilator/all/conanfile.py new file mode 100644 index 0000000000000..dae6d10f3a17c --- /dev/null +++ b/recipes/verilator/all/conanfile.py @@ -0,0 +1,204 @@ +from conan import ConanFile +from conan.tools.files import get, rmdir, patch, replace_in_file, rename +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools +from conan.errors import ConanInvalidConfiguration +from contextlib import contextmanager +import os +import shutil + +required_conan_version = ">=1.47.0" + +class VerilatorConan(ConanFile): + name = "verilator" + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.veripool.org/wiki/verilator" + description = "Verilator compiles synthesizable Verilog and Synthesis assertions into single- or multithreaded C++ or SystemC code" + topics = ("verilog", "hdl", "eda", "simulator", "hardware", "fpga") + + settings = "os", "arch", "compiler", "build_type" + + _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): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + @property + def _needs_old_bison(self): + return Version(self.version) < "4.100" + + def build_requirements(self): + if self._settings_build.os == "Windows" and "CONAN_BASH_PATH" not in os.environ: + if self.settings.compiler == "Visual Studio": + self.build_requires("msys2/cci.latest") + self.build_requires("automake/1.16.4") + if self._needs_old_bison: + # don't upgrade to bison 3.7.0 or above, or it fails to build + # because of https://github.com/verilator/verilator/pull/2505 + self.build_requires("winflexbison/2.5.22") + else: + self.build_requires("winflexbison/2.5.24") + self.build_requires("strawberryperl/5.30.0.1") + else: + self.build_requires("flex/2.6.4") + if self._needs_old_bison: + # don't upgrade to bison 3.7.0 or above, or it fails to build + # because of https://github.com/verilator/verilator/pull/2505 + self.build_requires("bison/3.5.3") + else: + self.build_requires("bison/3.7.6") + if Version(self.version) >= "4.224": + self.build_requires("autoconf/2.71") + + + def requirements(self): + if self.settings.os == "Windows": + self.requires("strawberryperl/5.30.0.1") + if self.settings.compiler == "Visual Studio": + self.requires("dirent/1.23.2", private=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome") + + if Version(self.version) >= "4.200" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration("GCC < version 7 is not supported") + + if self.settings.os == "Windows" and Version(self.version) >= "4.200": + raise ConanInvalidConfiguration("Windows build is not yet supported. Contributions are welcome") + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + build_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)), + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + } + with tools.vcvars(self.settings): + with tools.environment_append(build_env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + self._autotools.library_paths = [] + if self.settings.get_safe("compiler.libcxx") == "libc++": + self._autotools.libs.append("c++") + if self.settings.compiler == "Visual Studio": + self._autotools.cxx_flags.append("-EHsc") + self._autotools.defines.append("YY_NO_UNISTD_H") + self._autotools.flags.append("-FS") + conf_args = [ + "--datarootdir={}/bin/share".format(tools.unix_path(self.package_folder)), + ] + yacc = tools.get_env("YACC") + if yacc: + if yacc.endswith(" -y"): + yacc = yacc[:-3] + with tools.environment_append({"YACC": yacc}): + if Version(self.version) >= "4.224": + with tools.chdir(self._source_subfolder): + self.run("autoconf", win_bash=tools.os_info.is_windows, run_environment=True) + self._autotools.configure(args=conf_args, configure_dir=os.path.join(self.build_folder, self._source_subfolder)) + + return self._autotools + + @property + def _make_args(self): + args = [ + "CFG_WITH_DEFENV=false", + "SRC_TARGET={}".format("dbg" if self.settings.build_type == "Debug" else "opt"), + ] + if self.settings.build_type == "Debug": + args.append("DEBUG=1") + if self.settings.compiler == "Visual Studio": + args.append("PROGLINK={}".format(tools.unix_path(os.path.join(self.build_folder, self._source_subfolder, "msvc_link.sh")))) + return args + + def _patch_sources(self): + if Version(self.version) < "4.200": + for patch_file in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, **patch_file) + try: + os.unlink(os.path.join(self._source_subfolder, "src", "config_build.h")) + except FileNotFoundError: + pass + + if self.settings.compiler == "Visual Studio": + replace_in_file(self, os.path.join(self._source_subfolder, "src", "Makefile_obj.in"), + "${LINK}", "${PROGLINK}") + + def build(self): + self._patch_sources() + with self._build_context(): + autotools = self._configure_autotools() + autotools.make(args=self._make_args) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install(args=self._make_args) + + rmdir(self, os.path.join(self.package_folder, "bin", "share", "man")) + rmdir(self, os.path.join(self.package_folder, "bin", "share", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "bin", "share", "verilator", "examples")) + os.unlink(os.path.join(self.package_folder, "bin", "share", "verilator", "verilator-config-version.cmake")) + rename(self, os.path.join(self.package_folder, "bin", "share", "verilator", "verilator-config.cmake"), + os.path.join(self.package_folder, "bin", "share", "verilator", "verilator-tools.cmake")) + replace_in_file(self, os.path.join(self.package_folder, "bin", "share", "verilator", "verilator-tools.cmake"), + "${CMAKE_CURRENT_LIST_DIR}", "${CMAKE_CURRENT_LIST_DIR}/../../..") + if self.settings.build_type == "Debug": + replace_in_file(self, os.path.join(self.package_folder, "bin", "share", "verilator", "verilator-tools.cmake"), + "verilator_bin", "verilator_bin_dbg") + + shutil.move(os.path.join(self.package_folder, "bin", "share", "verilator", "include"), + os.path.join(self.package_folder)) + + if Version(self.version) >= "4.224": + shutil.move(os.path.join(self.package_folder, "bin", "share", "verilator", "bin", "verilator_ccache_report"), + os.path.join(self.package_folder, "bin", "verilator_ccache_report")) + + shutil.move(os.path.join(self.package_folder, "bin", "share", "verilator", "bin", "verilator_includer"), + os.path.join(self.package_folder, "bin", "verilator_includer")) + + rmdir(self, os.path.join(self.package_folder, "bin", "share", "verilator", "bin")) + + def package_id(self): + # Verilator is a executable-only package, so the compiler version does not matter + del self.info.settings.compiler.version + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + verilator_bin = "verilator_bin_dbg" if self.settings.build_type == "Debug" else "verilator_bin" + self.output.info("Setting VERILATOR_BIN environment variable to {}".format(verilator_bin)) + self.env_info.VERILATOR_BIN = verilator_bin + + verilator_root = os.path.join(self.package_folder) + self.output.info("Setting VERILATOR_ROOT environment variable to {}".format(verilator_root)) + self.env_info.VERILATOR_ROOT = verilator_root + + self.cpp_info.builddirs.append(os.path.join("bin", "share", "verilator")) + self.cpp_info.build_modules.append(os.path.join("bin", "share", "verilator", "verilator-tools.cmake")) diff --git a/recipes/verilator/all/patches/0001-split-opt-and-debug-build-install.patch b/recipes/verilator/all/patches/0001-split-opt-and-debug-build-install.patch new file mode 100644 index 0000000000000..020bd1fac7bd0 --- /dev/null +++ b/recipes/verilator/all/patches/0001-split-opt-and-debug-build-install.patch @@ -0,0 +1,33 @@ +--- Makefile.in ++++ Makefile.in +@@ -218,7 +218,7 @@ + verilator_exe verilator_bin verilator_bin_dbg verilator_coverage_bin_dbg: + @echo ------------------------------------------------------------ + @echo "making verilator in src" +- $(MAKE) -C src $(OBJCACHE_JOBS) ++ $(MAKE) -C src $(SRC_TARGET) $(OBJCACHE_JOBS) + + .PHONY:msg_test + msg_test: all_nomsg +@@ -295,16 +295,19 @@ + VL_INST_DATA_SRCDIR_FILES = \ + examples/*/*.[chv]* examples/*/Makefile* \ + examples/*/CMakeLists.txt +- ++DEBUG=0 + installbin: + $(MKINSTALLDIRS) $(DESTDIR)$(bindir) + ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator ) +- ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage ) + ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_gantt $(DESTDIR)$(bindir)/verilator_gantt ) + ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc ) ++ifeq ($(DEBUG),0) ++ ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage ) + ( cd bin ; $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin ) ++else + ( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg ) + ( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg ) ++endif + $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin + ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer ) + diff --git a/recipes/verilator/all/patches/0002-msvc-patches.patch b/recipes/verilator/all/patches/0002-msvc-patches.patch new file mode 100644 index 0000000000000..70929e296cd1d --- /dev/null +++ b/recipes/verilator/all/patches/0002-msvc-patches.patch @@ -0,0 +1,141 @@ +--- src/Makefile_obj.in ++++ src/Makefile_obj.in +@@ -276,7 +276,7 @@ + $(TGT): $(PREDEP_H) $(OBJS) + @echo " Linking $@..." + -rm -rf $@ $@.exe +- ${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS} ++ ${LINK} ${LDFLAGS} -o $@$(EXEEXT) $(OBJS) $(CCMALLOC) ${LIBS} + + V3Number_test: V3Number_test.o + ${LINK} ${LDFLAGS} -o $@ $^ ${LIBS} +@@ -287,21 +287,21 @@ + $(PERL) $(ASTGEN) -I$(srcdir) $*.cpp + + %.o: %.cpp +- $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSWALL} -c $< ++ $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSWALL} -c $< -o $@ + %.o: %.c +- $(OBJCACHE) ${CC} ${CFLAGS} ${CPPFLAGSWALL} -c $< ++ $(OBJCACHE) ${CC} ${CFLAGS} ${CPPFLAGSWALL} -c $< -o $@ + + V3ParseLex.o: V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c +- $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< ++ $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@ + + V3ParseGrammar.o: V3ParseGrammar.cpp V3ParseBison.c +- $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< ++ $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@ + + V3ParseImp.o: V3ParseImp.cpp V3ParseBison.c +- $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< ++ $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@ + + V3PreProc.o: V3PreProc.cpp V3PreLex.yy.cpp +- $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< ++ $(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@ + + #### Generated files + +--- src/V3AstNodes.h ++++ src/V3AstNodes.h +@@ -7543,7 +7543,7 @@ + V3ERROR_NA; + } + virtual string emitVerilog() { return "%k%l[%r]"; } +- virtual string emitC() { V3ERROR_NA; } ++ virtual string emitC() { V3ERROR_NA_RETURN(""); } + virtual string emitSimpleOperator() { return ""; } + virtual bool cleanOut() const { return true; } + virtual bool cleanLhs() const { return true; } +--- src/V3EmitC.cpp ++++ src/V3EmitC.cpp +@@ -2112,7 +2112,7 @@ + } else { // Format character + inPct = false; + switch (tolower(pos[0])) { +- case '0' ... '9': ++ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + case '.': // FALLTHRU + case '-': + // Digits, like %5d, etc. +--- src/V3LinkResolve.cpp ++++ src/V3LinkResolve.cpp +@@ -358,7 +358,7 @@ + } else if (inpercent) { + inpercent = 0; + switch (c) { +- case '0' ... '9': ++ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + case '.': inpercent = true; break; + case '%': break; + default: +--- src/V3Number.cpp ++++ src/V3Number.cpp +@@ -188,7 +188,7 @@ + int got_01 = 0; + for (const char* cp = value_startp; *cp; cp++) { + switch (tolower(*cp)) { +- case '0' ... '9': { ++ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { + if (olen <= 7) { // 10000000 fits in 32 bits, so ok + // Constants are common, so for speed avoid wide math until we need it + val = val * 10 + (*cp - '0'); +--- src/V3Number.h ++++ src/V3Number.h +@@ -22,6 +22,7 @@ + + #include "V3Error.h" + ++#include + #include + #include + #include +--- src/V3Os.cpp ++++ src/V3Os.cpp +@@ -65,7 +65,8 @@ + #if defined(_MSC_VER) + // Note: MinGW does not offer _dupenv_s + char* envvalue; +- if (_dupenv_s(&envvalue, nullptr, envvar.c_str()) == 0) { ++ int dupres = _dupenv_s(&envvalue, nullptr, envvar.c_str()); ++ if ((dupres == 0) && (envvalue != nullptr)) { + const std::string result{envvalue}; + free(envvalue); + return result; +@@ -342,6 +343,9 @@ + int V3Os::system(const string& command) { + UINFO(1, "Running system: " << command << endl); + const int ret = ::system(command.c_str()); ++#ifdef _MSC_VER ++ return ret; ++#else + if (ret == -1) { + v3fatal("Failed to execute command:" << command << " " << strerror(errno)); + return -1; +@@ -352,4 +356,5 @@ + UASSERT(exit_code >= 0, "exit code must not be negative"); + return exit_code; + } ++#endif + } +--- include/verilated.cpp ++++ include/verilated.cpp +@@ -29,6 +28,7 @@ + #include + #include + #include +-#include ++#include ++#include + #include // mkdir + +@@ -678,7 +679,7 @@ + inPct = false; + char fmt = pos[0]; + switch (fmt) { +- case '0' ... '9': ++ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + inPct = true; // Get more digits + widthSet = true; + width = width * 10 + (fmt - '0'); diff --git a/recipes/verilator/all/patches/0003-add-msvc_link-sh.patch b/recipes/verilator/all/patches/0003-add-msvc_link-sh.patch new file mode 100644 index 0000000000000..53cdf6803c43d --- /dev/null +++ b/recipes/verilator/all/patches/0003-add-msvc_link-sh.patch @@ -0,0 +1,65 @@ +new file mode 100755 +--- /dev/null ++++ msvc_link.sh +@@ -0,0 +1,61 @@ ++#!/bin/sh ++clopts=() ++ldopts=() ++libs=() ++while test $# -gt 0; do ++ case "$1" in ++ -lm | -pthread | -lpthread) ++ # ignore ++ ;; ++ -Xlinker) ++ shift ++ ;; ++ -W* | -w*) ++ # ignore warnings ++ ;; ++ -D*) ++ clopts+=("$1") ++ ;; ++ -I*) ++ clopts+=("$1") ++ ;; ++ -l*) ++ ldopts+=("`echo "$1.lib" | sed "s/^-l//"`") ++ ;; ++ -LIBPATH*) ++ ldopts+=("$1") ++ ;; ++ -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 ++ ++args="${ldopts[@]}" ++ ++cat <<-EOF ++ Creating program ++ ** ld options: "$args" ++EOF ++ ++LINK= exec link -nologo -debug:full $args diff --git a/recipes/verilator/all/patches/0004-msvc-patches.patch b/recipes/verilator/all/patches/0004-msvc-patches.patch new file mode 100644 index 0000000000000..a6c6779c415bb --- /dev/null +++ b/recipes/verilator/all/patches/0004-msvc-patches.patch @@ -0,0 +1,88 @@ +--- src/Makefile_obj.in ++++ src/Makefile_obj.in +@@ -95,6 +95,7 @@ LIBS = $(CFG_LIBS) -lm + CPPFLAGS += -MMD + CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir) -I../../include + CPPFLAGS += -DYYDEBUG # Required to get nice error messages ++CPPFLAGS += -DNOMINMAX # suppress the min and max definitions in Windef.h + #CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool + CPPFLAGS += $(COPT) + CPPFLAGS += -MP # Only works on recent GCC versions +@@ -278,7 +279,7 @@ V3__CONCAT.cpp: $(addsuffix .cpp, $(basename $(RAW_OBJS))) + + $(TGT): $(PREDEP_H) $(OBJS) + @echo " Linking $@..." +- ${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS} ++ ${LINK} ${LDFLAGS} -o $@$(EXEEXT) $(OBJS) $(CCMALLOC) ${LIBS} + + V3Number_test: V3Number_test.o + ${LINK} ${LDFLAGS} -o $@ $^ ${LIBS} + +--- src/V3Number.h ++++ melsrc/V3Number.h +@@ -22,6 +22,7 @@ + + #include "V3Error.h" + ++#include + #include + #include + #include + +--- src/V3Os.cpp ++++ src/V3Os.cpp +@@ -63,8 +63,8 @@ string V3Os::getenvStr(const string& envvar, const string& defaultValue) { + #if defined(_MSC_VER) + // Note: MinGW does not offer _dupenv_s + char* envvalue = nullptr; +- _dupenv_s(&envvalue, nullptr, envvar.c_str()); +- if (envvalue != nullptr) { ++ int dupres = _dupenv_s(&envvalue, nullptr, envvar.c_str()); ++ if ((dupres == 0) && (envvalue != nullptr)) { + const std::string result{envvalue}; + free(envvalue); + return result; +@@ -336,6 +336,9 @@ void V3Os::u_sleep(int64_t usec) { + int V3Os::system(const string& command) { + UINFO(1, "Running system: " << command << endl); + const int ret = ::system(command.c_str()); ++#ifdef _MSC_VER ++ return ret; ++#else + if (VL_UNCOVERABLE(ret == -1)) { + v3fatal("Failed to execute command:" // LCOV_EXCL_LINE + << command << " " << strerror(errno)); +@@ -347,4 +350,5 @@ int V3Os::system(const string& command) { + UASSERT(exit_code >= 0, "exit code must not be negative"); + return exit_code; + } ++#endif + } + +--- src/VlcTop.cpp ++++ src/VlcTop.cpp +@@ -14,6 +14,11 @@ + // + //************************************************************************* + ++#if defined(_WIN32) || defined(__MINGW32__) ++#define NOMINMAX ++#include ++#endif ++ + #include "V3Error.h" + #include "V3Os.h" + #include "VlcOptions.h" + +--- include/verilated_imp.h ++++ include/verilated_imp.h +@@ -29,6 +29,7 @@ + #include "verilated_heavy.h" + #include "verilated_syms.h" + ++#include + #include + #include + #include + + diff --git a/recipes/verilator/all/test_package/CMakeLists.txt b/recipes/verilator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..857861b148ba8 --- /dev/null +++ b/recipes/verilator/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(verilator REQUIRED) + +add_executable(blinky + blinky.cpp +) +verilate(blinky SOURCES blinky.v TRACE) + +option(BUILD_SYSTEMC "Build SystemC example" ON) + +if(BUILD_SYSTEMC) + add_executable(blinky_sc + blinky_sc.cpp + ) + verilate(blinky_sc SOURCES blinky.v SYSTEMC) + target_link_libraries(blinky_sc PRIVATE CONAN_PKG::systemc) +endif() diff --git a/recipes/verilator/all/test_package/blinky.cpp b/recipes/verilator/all/test_package/blinky.cpp new file mode 100644 index 0000000000000..b8b6eb0c26ae4 --- /dev/null +++ b/recipes/verilator/all/test_package/blinky.cpp @@ -0,0 +1,50 @@ +#include "Vblinky.h" +#include "verilated.h" +#include "verilated_vcd_c.h" + +#include +#include + +void tick(int tickcount, Vblinky *tb, VerilatedVcdC* tfp) { + tb->eval(); + if (tfp) + tfp->dump(tickcount * 10 - 2); + tb->i_clk = 1; + tb->eval(); + if (tfp) + tfp->dump(tickcount * 10); + tb->i_clk = 0; + tb->eval(); + if (tfp) { + tfp->dump(tickcount * 10 + 5); + tfp->flush(); + } +} + +int main(int argc, char **argv) { + int last_led; + unsigned tickcount = 0; + + // Call commandArgs first! + Verilated::commandArgs(argc, argv); + + // Instantiate our design + Vblinky *tb = new Vblinky; + + // Generate a trace + Verilated::traceEverOn(true); + VerilatedVcdC* tfp = new VerilatedVcdC; + tb->trace(tfp, 00); + tfp->open("blinkytrace.vcd"); + + last_led = tb->o_led; + for(int k=0; k<(1<<20); k++) { + tick(++tickcount, tb, tfp); + + // Now let's print our results + if (last_led != tb->o_led) { + printf("k = %7d, ", k); + printf("led = %d\n", tb->o_led); + } last_led = tb->o_led; + } +} diff --git a/recipes/verilator/all/test_package/blinky.v b/recipes/verilator/all/test_package/blinky.v new file mode 100644 index 0000000000000..5037ff2ffc6ab --- /dev/null +++ b/recipes/verilator/all/test_package/blinky.v @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Filename: blinky.v +// +// Project: Verilog Tutorial Example file +// +// Purpose: Blinks an LED +// +// Creator: Dan Gisselquist, Ph.D. +// Gisselquist Technology, LLC +// +//////////////////////////////////////////////////////////////////////////////// +// +// Written and distributed by Gisselquist Technology, LLC +// +// This program is hereby granted to the public domain. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +//////////////////////////////////////////////////////////////////////////////// +// +// +`default_nettype none +// +module blinky(i_clk, o_led); +`ifdef VERILATOR + parameter WIDTH = 12; +`else + parameter WIDTH = 27; +`endif + input wire i_clk; + output wire o_led; + + reg [WIDTH-1:0] counter; + + always @(posedge i_clk) + counter <= counter + 1'b1; + + assign o_led = counter[WIDTH-1]; +endmodule + diff --git a/recipes/verilator/all/test_package/blinky_sc.cpp b/recipes/verilator/all/test_package/blinky_sc.cpp new file mode 100644 index 0000000000000..e9c778f1de9b8 --- /dev/null +++ b/recipes/verilator/all/test_package/blinky_sc.cpp @@ -0,0 +1,39 @@ +#include "Vblinky.h" +#include "verilated.h" +#include "verilated_vcd_c.h" + +#include + +#include + +SC_MODULE(BlinkyTop) +{ + sc_in clk; + sc_signal led; + + Vblinky blinky; + + void led_monitor() { + std::cout << sc_time_stamp() << ": led = " << led << "\n"; + } + + SC_CTOR(BlinkyTop) + : clk("clk") + , led("led") + , blinky("blinky") { + blinky.i_clk(clk); + blinky.o_led(led); + + SC_METHOD(led_monitor); + sensitive << led; + } +}; + +int main(int argc, char **argv) { + sc_clock clk("clk", sc_time(1, SC_NS), 0.5); + + BlinkyTop top("top"); + top.clk(clk); + + sc_start(sc_time(1<<20, SC_NS)); +} diff --git a/recipes/verilator/all/test_package/conanfile.py b/recipes/verilator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cacc5d44a3b76 --- /dev/null +++ b/recipes/verilator/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestVerilatorConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + @property + def _with_systemc_example(self): + # systemc is not available on Macos + return self.settings.os != "Macos" + + def requirements(self): + if self._with_systemc_example: + self.requires("systemc/2.3.3") + + def build(self): + if not tools.cross_building(self.settings, skip_x64_x86=True): + cmake = CMake(self) + cmake.definitions["BUILD_SYSTEMC"] = self._with_systemc_example + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings, skip_x64_x86=True): + with tools.run_environment(self): + self.run("perl {} --version".format(os.path.join(self.deps_cpp_info["verilator"].rootpath, "bin", "verilator")), run_environment=True) + self.run(os.path.join("bin", "blinky"), run_environment=True) + if self._with_systemc_example: + self.run(os.path.join("bin", "blinky_sc"), run_environment=True) diff --git a/recipes/verilator/config.yml b/recipes/verilator/config.yml new file mode 100644 index 0000000000000..63930f262a916 --- /dev/null +++ b/recipes/verilator/config.yml @@ -0,0 +1,9 @@ +versions: + "4.034": + folder: all + "4.038": + folder: all + "4.200": + folder: all + "4.224": + folder: all diff --git a/recipes/vincentlaucsb-csv-parser/all/conandata.yml b/recipes/vincentlaucsb-csv-parser/all/conandata.yml new file mode 100644 index 0000000000000..b2ca51139b4f8 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.3": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.1.3.tar.gz" + sha256: 3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf diff --git a/recipes/vincentlaucsb-csv-parser/all/conanfile.py b/recipes/vincentlaucsb-csv-parser/all/conanfile.py new file mode 100644 index 0000000000000..eb5f85b4e4c16 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/conanfile.py @@ -0,0 +1,48 @@ +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.scm import Version + +required_conan_version = ">=1.52.0" + + +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") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vincentlaucsb/csv-parser" + license = "MIT" + settings = "os", "compiler" + package_type = "header-library" + 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") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "single_include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt b/recipes/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3c123cd449689 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vincentlaucsb-csv-parser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vincentlaucsb-csv-parser::vincentlaucsb-csv-parser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/vincentlaucsb-csv-parser/all/test_package/conanfile.py b/recipes/vincentlaucsb-csv-parser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/vincentlaucsb-csv-parser/all/test_package/test_package.cpp b/recipes/vincentlaucsb-csv-parser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..75b3aaa727d63 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include +#include + +int main() { + using namespace csv; + std::stringstream rows("A,B,C\n" + "1,2,3\n" + "4,5,6"); + + CSVReader reader(rows); + + std::vector col_names = reader.get_col_names(); + for (auto name : col_names) + std::cout << name << ", "; + + CSVRow row; + if (reader.read_row(row)){ + for (auto& field : row) + std::cout << std::string(field) << ", "; + } + + return 0; +} diff --git a/recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt b/recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..acffc65296726 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.9) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/vincentlaucsb-csv-parser/all/test_v1_package/conanfile.py b/recipes/vincentlaucsb-csv-parser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vincentlaucsb-csv-parser/config.yml b/recipes/vincentlaucsb-csv-parser/config.yml new file mode 100644 index 0000000000000..e6ceade928280 --- /dev/null +++ b/recipes/vincentlaucsb-csv-parser/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.3": + folder: all diff --git a/recipes/visit_struct/all/conandata.yml b/recipes/visit_struct/all/conandata.yml new file mode 100644 index 0000000000000..959681c08c025 --- /dev/null +++ b/recipes/visit_struct/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/garbageslam/visit_struct/archive/refs/tags/v1.0.tar.gz" + sha256: "7e5d727bd9fbe444d182840625f5eb21f2cf67f06f3aeab27a2d7c4724b3c09c" diff --git a/recipes/visit_struct/all/conanfile.py b/recipes/visit_struct/all/conanfile.py new file mode 100644 index 0000000000000..f72295c8e8cc9 --- /dev/null +++ b/recipes/visit_struct/all/conanfile.py @@ -0,0 +1,49 @@ +import os +from conans import ConanFile, tools + +required_conan_version = ">=1.33.0" + +class VisitStructConan(ConanFile): + name = "visit_struct" + description = "A miniature library for struct-field reflection in C++" + topics = ("reflection", "introspection", "visitor", "struct-field-visitor",) + homepage = "https://github.com/garbageslam/visit_struct" + url = "https://github.com/conan-io/conan-center-index" + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type", + options = { + "with_boost_fusion": [True, False], + "with_boost_hana": [True, False], + } + default_options = { + "with_boost_fusion": False, + "with_boost_hana": False, + } + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + if self.options.with_boost_fusion or self.options.with_boost_hana: + self.requires("boost/1.78.0") + + def package_id(self): + self.info.header_only() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy(pattern="*visit_struct.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + self.copy(pattern="*visit_struct_intrusive.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + if self.options.with_boost_fusion: + self.copy(pattern="*visit_struct_boost_fusion.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + if self.options.with_boost_hana: + self.copy(pattern="*visit_struct_boost_hana.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") diff --git a/recipes/visit_struct/all/test_package/CMakeLists.txt b/recipes/visit_struct/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b3daffae916f --- /dev/null +++ b/recipes/visit_struct/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(visit_struct REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} visit_struct::visit_struct) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/visit_struct/all/test_package/conanfile.py b/recipes/visit_struct/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1d4478bedc297 --- /dev/null +++ b/recipes/visit_struct/all/test_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/visit_struct/all/test_package/test_package.cpp b/recipes/visit_struct/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..330094e9c7351 --- /dev/null +++ b/recipes/visit_struct/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include +#include + +struct my_type { + int a; + float b; + std::string c; +}; + +VISITABLE_STRUCT(my_type, a, b, c); + +struct debug_printer { + template + void operator()(const char* name, const T& value) { + std::cerr << name << ": " << value << std::endl; + } +}; + +int main(int argc, char* argv[]) { + auto val = my_type{1, 2.0f, "three"}; + + visit_struct::for_each(val, debug_printer{}); + + return 0; +} diff --git a/recipes/visit_struct/config.yml b/recipes/visit_struct/config.yml new file mode 100644 index 0000000000000..cbd84c934d0b3 --- /dev/null +++ b/recipes/visit_struct/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: "all" diff --git a/recipes/vk-bootstrap/all/conandata.yml b/recipes/vk-bootstrap/all/conandata.yml new file mode 100644 index 0000000000000..d3c923855081d --- /dev/null +++ b/recipes/vk-bootstrap/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "0.7": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.7.tar.gz" + sha256: "7b2c30a4c46514cc5b20d2bebab25c495df39574b9e117c760d1cfe19f71d9aa" + "0.6": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.6.tar.gz" + sha256: "95dedaa5cedf7a271f051d91b24b3b6c78aa3c5b2bc3cf058554c92748a421b2" + "0.5": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.5.tar.gz" + sha256: "7ec1017d71d48595c078a4488140b230fd9cad1059986a18a507f356bf00e89b" + "0.4": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.4.tar.gz" + sha256: "ba03449bb964d6cabbae3b6d6c8fce6e4276e4190885f9b5efc56153ef4b3c39" + "0.3.1": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.3.1.tar.gz" + sha256: "bed3333c17acef9249a0095c070b80644d7f275d2479e7c07032fb9532704d70" + "0.2": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/v0.2.tar.gz" + sha256: "45afc9c2c90309f768786c8014913627e6f1cb4db20449a65b98283b58918483" +patches: + "0.6": + - patch_file: "patches/0001-fix-cmake-0.6.patch" + "0.5": + - patch_file: "patches/0001-fix-cmake-0.5.patch" + "0.4": + - patch_file: "patches/0001-fix-cmake-0.4.patch" + "0.3.1": + - patch_file: "patches/0001-fix-cmake-0.3.1.patch" + "0.2": + - patch_file: "patches/0001-fix-cmake-0.2.patch" diff --git a/recipes/vk-bootstrap/all/conanfile.py b/recipes/vk-bootstrap/all/conanfile.py new file mode 100644 index 0000000000000..2d7b6c5514a0c --- /dev/null +++ b/recipes/vk-bootstrap/all/conanfile.py @@ -0,0 +1,118 @@ +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, 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.54.0" + + +class VkBootstrapConan(ConanFile): + name = "vk-bootstrap" + description = "Vulkan bootstraping library." + license = "MIT" + topics = ("vulkan", "bootstrap", "setup") + homepage = "https://github.com/charles-lunarg/vk-bootstrap" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "15", + "msvc": "191", + "clang": "3.7" if stdcpp_library(self) == "stdc++" else "6", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "0.7": + self.requires("vulkan-headers/1.3.236.0", transitive_headers=True) + else: + self.requires("vulkan-headers/1.3.239.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VK_BOOTSTRAP_TEST"] = False + vulkan_headers = self.dependencies["vulkan-headers"] + includedirs = ";".join( + [os.path.join(vulkan_headers.package_folder, includedir).replace("\\", "/") + for includedir in vulkan_headers.cpp_info.includedirs], + ) + if Version(self.version) < "0.3.0": + tc.variables["Vulkan_INCLUDE_DIR"] = includedirs + else: + tc.variables["VK_BOOTSTRAP_VULKAN_HEADER_DIR"] = includedirs + if Version(self.version) >= "0.4.0": + tc.variables["VK_BOOTSTRAP_WERROR"] = False + tc.generate() + + 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 = ["vk-bootstrap"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl"] diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch new file mode 100644 index 0000000000000..2f8cf8a9dc4fe --- /dev/null +++ b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch @@ -0,0 +1,43 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,6 @@ + cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + project(VulkanBootstrap) + +-find_package(Vulkan REQUIRED) + + add_library(vk-bootstrap src/VkBootstrap.h src/VkBootstrap.cpp) + add_library(vk-bootstrap::vk-bootstrap ALIAS vk-bootstrap) +@@ -21,11 +20,9 @@ target_compile_options(vk-bootstrap-compiler-warnings + $<$,$,${VK_BOOTSTRAP_COMPILER_CLANGPP}>: + -Wall + -Wextra +- -pedantic-errors + -Wconversion + -Wsign-conversion> + $<$: +- /WX + /W4> + ) + +@@ -33,11 +30,19 @@ target_include_directories(vk-bootstrap PUBLIC src) + target_include_directories(vk-bootstrap PUBLIC ${Vulkan_INCLUDE_DIR}) + target_link_libraries(vk-bootstrap + PRIVATE ++ ${CMAKE_DL_LIBS} + vk-bootstrap-compiler-warnings) ++target_compile_features(vk-bootstrap PUBLIC cxx_std_14) ++include(GNUInstallDirs) ++install(FILES src/VkBootstrap.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install(TARGETS vk-bootstrap ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) + +-if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) ++if (VK_BOOTSTRAP_TEST) + + add_subdirectory(ext) + add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch new file mode 100644 index 0000000000000..fec9e86ac4740 --- /dev/null +++ b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch @@ -0,0 +1,23 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,11 +43,9 @@ target_compile_options(vk-bootstrap-compiler-warnings + $<$,$,${VK_BOOTSTRAP_COMPILER_CLANGPP}>: + -Wall + -Wextra +- -pedantic-errors + -Wconversion + -Wsign-conversion> + $<$: +- /WX + /W4> + ) + +@@ -71,7 +69,7 @@ install(TARGETS vk-bootstrap + + option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) + +-if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) ++if (VK_BOOTSTRAP_TEST) + + add_subdirectory(ext) + add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch new file mode 100644 index 0000000000000..0305fb75872ef --- /dev/null +++ b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,7 +81,7 @@ install(TARGETS vk-bootstrap + + option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) + +-if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) ++if (VK_BOOTSTRAP_TEST) + + add_subdirectory(ext) + add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch new file mode 100644 index 0000000000000..1a523c52ff350 --- /dev/null +++ b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -72,7 +72,7 @@ target_link_libraries(vk-bootstrap + target_compile_features(vk-bootstrap PUBLIC cxx_std_14) + + include(GNUInstallDirs) +-install(FILES src/VkBootstrap.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install(FILES src/VkBootstrap.h src/VkBootstrapDispatch.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(TARGETS vk-bootstrap + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +@@ -80,7 +80,7 @@ install(TARGETS vk-bootstrap + + option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) + +-if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) ++if (VK_BOOTSTRAP_TEST) + + add_subdirectory(ext) + add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch new file mode 100644 index 0000000000000..a24ee1446f9e5 --- /dev/null +++ b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1e0181..4d154e0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -83,7 +83,7 @@ install(TARGETS vk-bootstrap vk-bootstrap-compiler-warnings vk-bootstrap-vulkan- + + option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) + +-if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) ++if (VK_BOOTSTRAP_TEST) + + add_subdirectory(ext) + add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/test_package/CMakeLists.txt b/recipes/vk-bootstrap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1c50daad2758 --- /dev/null +++ b/recipes/vk-bootstrap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vk-bootstrap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vk-bootstrap::vk-bootstrap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/vk-bootstrap/all/test_package/conanfile.py b/recipes/vk-bootstrap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vk-bootstrap/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/vk-bootstrap/all/test_package/test_package.cpp b/recipes/vk-bootstrap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9e770785ad302 --- /dev/null +++ b/recipes/vk-bootstrap/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + vkb::InstanceBuilder instance; + instance.set_app_name("conan app"); + return 0; +} diff --git a/recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt b/recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vk-bootstrap/all/test_v1_package/conanfile.py b/recipes/vk-bootstrap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vk-bootstrap/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/vk-bootstrap/config.yml b/recipes/vk-bootstrap/config.yml new file mode 100644 index 0000000000000..eaed33f60995e --- /dev/null +++ b/recipes/vk-bootstrap/config.yml @@ -0,0 +1,13 @@ +versions: + "0.7": + folder: all + "0.6": + folder: all + "0.5": + folder: all + "0.4": + folder: all + "0.3.1": + folder: all + "0.2": + folder: all diff --git a/recipes/volk/all/conandata.yml b/recipes/volk/all/conandata.yml new file mode 100644 index 0000000000000..431eb95e238d7 --- /dev/null +++ b/recipes/volk/all/conandata.yml @@ -0,0 +1,46 @@ +sources: + "1.3.243.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "5cd92d592227d2d4d9af1b66662d4f92f84bbf431572c43889689e15b6da1dca" + "1.3.239.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "b628ae7d4e554c20763ac34e1fd18b87725c0c346e2a7106fa23701877bbac65" + "1.3.236.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "fba21aeccd8df4ce49fd0cce54cc9b1808e24e4283cad733f65fdd52f1729f16" + "1.3.231.1": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "fac8d3d295e88bcc6bfb2b729d2c4babb2ea04ccb39fd918a3471b2d756789b9" + "1.3.224.1": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "86505052a83d3085e34d22f8b9969e9961efc24c0c902fefb0b6b43d496f69b4" + "1.3.224.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "c9f9dd80dc8f3cd28b1d3d5716bb5e56be966b88aa9c54b18d793df8f60abc36" + "1.3.216.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "cbbbcad79d84081f21a3cfa3261819a4fa2012cd8e6965136bdebb444bae063c" + "1.3.204": + url: "https://github.com/zeux/volk/archive/refs/tags/1.3.204.tar.gz" + sha256: "7776e7f3c70f199579da33d2ccd7152ca8b96182fa98c31fbe80880cef0fdf70" + "1.2.198": + url: "https://github.com/zeux/volk/archive/1.2.198.tar.gz" + sha256: "8f3869d94ccce265eaef064b1be0af2d8de925e512d3413c1cf02591b99597e2" + "1.2.195": + url: "https://github.com/zeux/volk/archive/713ab8bfcd9d8e5fe78ccf85806c0b4e5c566f71.tar.gz" + sha256: "affba674733e8bbf58e36534a1aba1c41cb4a457f0db13b415347fb541a69c04" + "1.2.190": + url: "https://github.com/zeux/volk/archive/1.2.190.tar.gz" + sha256: "07f03720b8c70a626c98cc9545350538122bca9f853e6ed20ccad5a25d55fa4b" + "1.2.182": + url: "https://github.com/zeux/volk/archive/1.2.182.tar.gz" + sha256: "5b03943ed26ce9ddf465ec3022c0ffcb264572cf8d467e6e2aad1a8917629057" + "1.2.170": + url: "https://github.com/zeux/volk/archive/1.2.170.tar.gz" + sha256: "01f37fc0c904afd2eb8060cada73f903ab1cdae87c7c24e77585ca7fb9bafae4" + "1.2.162": + url: "https://github.com/zeux/volk/archive/1.2.162.tar.gz" + sha256: "ac4d9d6e88dee5a83ad176e2da57f1989ca2c6df155a0aeb5e18e9471aa4d777" + "1.2.140": + url: "https://github.com/zeux/volk/archive/1.2.140.tar.gz" + sha256: "f4041baf7a19a996a0dc96763703751b1b15918b3a893bb77669755702c645cb" diff --git a/recipes/volk/all/conanfile.py b/recipes/volk/all/conanfile.py new file mode 100644 index 0000000000000..43237f89b69e7 --- /dev/null +++ b/recipes/volk/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class VolkConan(ConanFile): + name = "volk" + license = "MIT" + homepage = "https://github.com/zeux/volk" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "volk is a meta-loader for Vulkan. It allows you to dynamically load " + "entrypoints required to use Vulkan without linking to vulkan-1.dll or " + "statically linking Vulkan loader. Additionally, volk simplifies the " + "use of Vulkan extensions by automatically loading all associated " + "entrypoints. Finally, volk enables loading Vulkan entrypoints " + "directly from the driver which can increase performance by skipping " + "loader dispatch overhead." + ) + topics = ("vulkan", "loader", "extension", "entrypoint", "graphics") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires(f"vulkan-headers/{self.version}", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VOLK_PULL_IN_VULKAN"] = True + tc.variables["VOLK_INSTALL"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(Vulkan QUIET)", "find_package(VulkanHeaders REQUIRED)") + replace_in_file(self, cmakelists, "Vulkan::Vulkan", "Vulkan::Headers") + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "volk") + + self.cpp_info.components["libvolk"].set_property("cmake_target_name", "volk::volk") + self.cpp_info.components["libvolk"].libs = ["volk"] + self.cpp_info.components["libvolk"].requires = ["vulkan-headers::vulkan-headers"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libvolk"].system_libs = ["dl"] + + self.cpp_info.components["volk_headers"].set_property("cmake_target_name", "volk::volk_headers") + self.cpp_info.components["volk_headers"].libs = [] + self.cpp_info.components["volk_headers"].requires = ["vulkan-headers::vulkan-headers"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["volk_headers"].system_libs = ["dl"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["libvolk"].names["cmake_find_package"] = "volk" + self.cpp_info.components["libvolk"].names["cmake_find_package_multi"] = "volk" diff --git a/recipes/volk/all/test_package/CMakeLists.txt b/recipes/volk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f79c7351a572f --- /dev/null +++ b/recipes/volk/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(volk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE volk::volk) + +add_executable(${PROJECT_NAME}_nolibs test_package.c) +target_compile_definitions(${PROJECT_NAME}_nolibs PRIVATE VOLK_IMPLEMENTATION) +target_link_libraries(${PROJECT_NAME}_nolibs PRIVATE volk::volk_headers) diff --git a/recipes/volk/all/test_package/conanfile.py b/recipes/volk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ca066f730c2f4 --- /dev/null +++ b/recipes/volk/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path_nolibs = os.path.join(self.cpp.build.bindirs[0], "test_package_nolibs") + self.run(bin_path_nolibs, env="conanrun") diff --git a/recipes/volk/all/test_package/test_package.c b/recipes/volk/all/test_package/test_package.c new file mode 100644 index 0000000000000..9429d2876fb1d --- /dev/null +++ b/recipes/volk/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include "volk.h" + +#include + +int main() { + VkResult r = volkInitialize(); + if (r == VK_SUCCESS){ + uint32_t version = volkGetInstanceVersion(); + printf("Vulkan version %d.%d.%d initialized.\n", + VK_VERSION_MAJOR(version), + VK_VERSION_MINOR(version), + VK_VERSION_PATCH(version) + ); + } + return 0; +} diff --git a/recipes/volk/all/test_v1_package/CMakeLists.txt b/recipes/volk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..528a71ca307f4 --- /dev/null +++ b/recipes/volk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(volk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE volk::volk) + +add_executable(${PROJECT_NAME}_nolibs ../test_package/test_package.c) +target_compile_definitions(${PROJECT_NAME}_nolibs PRIVATE VOLK_IMPLEMENTATION) +target_link_libraries(${PROJECT_NAME}_nolibs PRIVATE volk::volk_headers) diff --git a/recipes/volk/all/test_v1_package/conanfile.py b/recipes/volk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..da79ceaaf9ebd --- /dev/null +++ b/recipes/volk/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): + self.run(os.path.join("bin", "test_package"), run_environment=True) + self.run(os.path.join("bin", "test_package_nolibs"), run_environment=True) diff --git a/recipes/volk/config.yml b/recipes/volk/config.yml new file mode 100644 index 0000000000000..d4cfc91f2ca48 --- /dev/null +++ b/recipes/volk/config.yml @@ -0,0 +1,31 @@ +versions: + "1.3.243.0": + folder: "all" + "1.3.239.0": + folder: "all" + "1.3.236.0": + folder: "all" + "1.3.231.1": + folder: "all" + "1.3.224.1": + folder: "all" + "1.3.224.0": + folder: "all" + "1.3.216.0": + folder: "all" + "1.3.204": + folder: "all" + "1.2.198": + folder: "all" + "1.2.195": + folder: "all" + "1.2.190": + folder: "all" + "1.2.182": + folder: "all" + "1.2.170": + folder: "all" + "1.2.162": + folder: "all" + "1.2.140": + folder: "all" diff --git a/recipes/vorbis/all/conandata.yml b/recipes/vorbis/all/conandata.yml new file mode 100644 index 0000000000000..07b65e3a51126 --- /dev/null +++ b/recipes/vorbis/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.3.7": + url: "https://github.com/xiph/vorbis/archive/v1.3.7.tar.gz" + sha256: "270c76933d0934e42c5ee0a54a36280e2d87af1de3cc3e584806357e237afd13" + "1.3.6": + url: "https://github.com/xiph/vorbis/archive/v1.3.6.tar.gz" + sha256: "43fc4bc34f13da15b8acfa72fd594678e214d1cab35fc51d3a54969a725464eb" +patches: + "1.3.6": + - patch_file: "patches/link-libm-find-package-ogg.patch" diff --git a/recipes/vorbis/all/conanfile.py b/recipes/vorbis/all/conanfile.py new file mode 100644 index 0000000000000..93e2aa3a2a5d5 --- /dev/null +++ b/recipes/vorbis/all/conanfile.py @@ -0,0 +1,124 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir +import os + +required_conan_version = ">=1.52.0" + + +class VorbisConan(ConanFile): + name = "vorbis" + description = "The VORBIS audio codec library" + topics = ("vorbis", "audio", "codec") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://xiph.org/vorbis/" + license = "BSD-3-Clause" + + settings = "os", "arch", "build_type", "compiler" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def requirements(self): + self.requires("ogg/1.3.5", transitive_headers=True, transitive_libs=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + 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", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Vorbis") + # see https://github.com/conan-io/conan-center-index/pull/4173 + self.cpp_info.set_property("pkg_config_name", "vorbis-all-do-not-use") + + # vorbis + self.cpp_info.components["vorbismain"].set_property("cmake_target_name", "Vorbis::vorbis") + self.cpp_info.components["vorbismain"].set_property("pkg_config_name", "vorbis") + self.cpp_info.components["vorbismain"].libs = ["vorbis"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["vorbismain"].system_libs.append("m") + self.cpp_info.components["vorbismain"].requires = ["ogg::ogg"] + + # TODO: Upstream VorbisConfig.cmake defines components 'Enc' and 'File', + # which are related to imported targets Vorbis::vorbisenc and Vorbis::vorbisfile + # Find a way to emulate this in CMakeDeps. See https://github.com/conan-io/conan/issues/10258 + + # vorbisenc + self.cpp_info.components["vorbisenc"].set_property("cmake_target_name", "Vorbis::vorbisenc") + self.cpp_info.components["vorbisenc"].set_property("pkg_config_name", "vorbisenc") + self.cpp_info.components["vorbisenc"].libs = ["vorbisenc"] + self.cpp_info.components["vorbisenc"].requires = ["vorbismain"] + + # vorbisfile + self.cpp_info.components["vorbisfile"].set_property("cmake_target_name", "Vorbis::vorbisfile") + self.cpp_info.components["vorbisfile"].set_property("pkg_config_name", "vorbisfile") + self.cpp_info.components["vorbisfile"].libs = ["vorbisfile"] + self.cpp_info.components["vorbisfile"].requires = ["vorbismain"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Vorbis" + self.cpp_info.names["cmake_find_package_multi"] = "Vorbis" + self.cpp_info.names["pkg_config"] = "vorbis-all-do-not-use" + self.cpp_info.components["vorbismain"].names["cmake_find_package"] = "vorbis" + self.cpp_info.components["vorbismain"].names["cmake_find_package_multi"] = "vorbis" + self.cpp_info.components["vorbisenc"].names["cmake_find_package"] = "vorbisenc" + self.cpp_info.components["vorbisenc"].names["cmake_find_package_multi"] = "vorbisenc" + self.cpp_info.components["vorbisfile"].names["cmake_find_package"] = "vorbisfile" + self.cpp_info.components["vorbisfile"].names["cmake_find_package_multi"] = "vorbisfile" + self.cpp_info.components["vorbisenc-alias"].names["cmake_find_package"] = "Enc" + self.cpp_info.components["vorbisenc-alias"].names["cmake_find_package_multi"] = "Enc" + self.cpp_info.components["vorbisenc-alias"].requires.append("vorbisenc") + self.cpp_info.components["vorbisfile-alias"].names["cmake_find_package"] = "File" + self.cpp_info.components["vorbisfile-alias"].names["cmake_find_package_multi"] = "File" + self.cpp_info.components["vorbisfile-alias"].requires.append("vorbisfile") diff --git a/recipes/vorbis/all/patches/link-libm-find-package-ogg.patch b/recipes/vorbis/all/patches/link-libm-find-package-ogg.patch new file mode 100644 index 0000000000000..5ae7f2296305d --- /dev/null +++ b/recipes/vorbis/all/patches/link-libm-find-package-ogg.patch @@ -0,0 +1,56 @@ +Backport in 1.3.6 some build improvements of 1.3.7: +* link to libm +* usage of find_package to discover Ogg and link with Ogg:ogg target + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,6 +4,7 @@ project(vorbis) + # Required modules + include(GNUInstallDirs) + include(CheckIncludeFiles) ++include(CheckLibraryExists) + + # Build options + option(BUILD_SHARED_LIBS "Build shared library" OFF) +@@ -52,18 +53,12 @@ endfunction() + + message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}") + ++# Find math library ++ ++check_library_exists(m floor "" HAVE_LIBM) ++ + # Find ogg dependency +-if(NOT OGG_ROOT) +- find_package(PkgConfig QUIET) +- pkg_check_modules(PC_OGG QUIET ogg) +- find_path(OGG_INCLUDE_DIRS NAMES ogg/ogg.h HINTS ${PC_OGG_INCLUDE_DIRS} PATH_SUFFIXES ogg) +- find_library(OGG_LIBRARIES NAMES ogg HINTS ${PC_OGG_LIBRARY_DIRS}) +-else() +- find_path(OGG_INCLUDE_DIRS NAMES ogg/ogg.h HINTS ${OGG_ROOT}/include PATH_SUFFIXES ogg) +- find_library(OGG_LIBRARIES NAMES ogg HINTS ${OGG_ROOT}/lib ${OGG_ROOT}/lib64) +-endif() +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(OGG DEFAULT_MSG OGG_INCLUDE_DIRS OGG_LIBRARIES) ++find_package(Ogg REQUIRED) + + add_subdirectory(lib) + +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -83,9 +83,12 @@ if (NOT BUILD_FRAMEWORK) + get_version_info(VORBISFILE_VERSION_INFO "VF_LIB_CURRENT" "VF_LIB_AGE" "VF_LIB_REVISION") + set_target_properties(vorbisfile PROPERTIES SOVERSION ${VORBISFILE_VERSION_INFO}) + +- target_link_libraries(vorbis ${OGG_LIBRARIES}) +- target_link_libraries(vorbisenc ${OGG_LIBRARIES} vorbis) +- target_link_libraries(vorbisfile ${OGG_LIBRARIES} vorbis) ++ target_link_libraries(vorbis ++ PUBLIC Ogg::ogg ++ PRIVATE $<$:m> ++ ) ++ target_link_libraries(vorbisenc PUBLIC vorbis) ++ target_link_libraries(vorbisfile PUBLIC vorbis) + + install(FILES ${VORBIS_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/vorbis) + diff --git a/recipes/vorbis/all/test_package/8kadpcm.wav b/recipes/vorbis/all/test_package/8kadpcm.wav new file mode 100644 index 0000000000000000000000000000000000000000..40a362222bc7a70ca0c5bd9484bb6c3dd911a122 GIT binary patch literal 56072 zcmX84d3+OBnl5~*WJ8r?ph~i#N-~K`l7kjI(PD@e6TCp$3+b?=XV`jf2$}n3nf`7P za=&5enXW3CP$faAk_@Sm3}`Wl784}fB$8}`7m|2^4i1@amdqqT-#ba@xnb$5`*v|8D9*}+XG8rQ1K zO{u+wR%P*%9-^?%H!xMXC2e0ya9r#h(+%PiqnF>s`7qls%AyQm0YTkw{HY$tMNWL6 z0QqRedv5MJmbwSIW9S|-z@X~8yawD69AnTz32vEUnxgZyf=kzDrB5Tlee#6}eM`1F zmf_HvpT#7M3FZIuY{1ZAs74FXgAnDeFgPDX^!`7dCDfi)HbD0u#JOfo1{FGM92!S6 znD@O50fSLOuJvO$RTJY<*|ufSZ;tYiyBgy2$50rn79$B6EV2J_A%}Is7H#frJuoXG zR=RdK-gOrE2$PnLWV;DARL{IlJpa;XkP@m0gbV0?0!k~TO#rAb-w))~>WSuc>x9KOtfA$q}nEDRHvwe6*_-c_$5Kls{vE^YOE^XHSm(q z%Bgu+8`8(7j!##WEb>mQ4bu=1wax7VV6ybl!;)5xmi0bXL36 z)omKZpJ(1LMpA_H$uke2FV+{R7p%4*d9?lE@6R$ zxu9qe-O4W%(kF@r$x|=oH9Fk(ifY{>cd2g<6P($`OE;6ROjcMqL>khoL~$TwuL4bX z{MLV#A;MZb+?figur81=7C+?Rz@6~6)Zm`Es8TkQ7k9>7(|&YLe& zpcyB+)9O>qFe`7Oo4fUXPdxHhaMY~$v;%ZOSS94((c;nENhs>#RxmqgM+m!o_GYht zp_;FR>{vwn4)kjah@yE1;~Z#a+~WO34{Fb$8k-^HH}mgSn1lpQGKeq zvK@l~Qi_gF#yYYJxruAq1yyTU=l#gh(gQ$3&X@J#t~f*l?xW;EYbY1m4{crwgur|r z!RiuqYZqxf0xMd>iK6PxO&F?6GotsZ+i)x zjlKy<5v3-jTVupV?2G4uI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&^0X+wV`_nmjC7(=MhptjL+}qQ3e7Z%5boI(aCgFXZp)MAe~IBU6iEVkGJPBO~k5 zR_#uuO<~IAibr!oyj~f3nX{$IeBBZpATxY+cHY~FHZm|w#^LLssZsw^$NilUa#gX+ zM_nLurPOefQ!|OG2M)Y@5H*^=xrxcixyH3 zpF|g>oKQFNT979zvHJrpIl{2WC_V3SIH;v%aFq~Wo&S}I- GCG`KNn<~Qq literal 0 HcmV?d00001 diff --git a/recipes/vorbis/all/test_package/CMakeLists.txt b/recipes/vorbis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2cb69c95d440d --- /dev/null +++ b/recipes/vorbis/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Vorbis REQUIRED Enc CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Vorbis::vorbisenc) diff --git a/recipes/vorbis/all/test_package/conanfile.py b/recipes/vorbis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..327c8dd400306 --- /dev/null +++ b/recipes/vorbis/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 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") diff --git a/recipes/vorbis/all/test_package/test_package.c b/recipes/vorbis/all/test_package/test_package.c new file mode 100644 index 0000000000000..d8d92bc3cbff7 --- /dev/null +++ b/recipes/vorbis/all/test_package/test_package.c @@ -0,0 +1,252 @@ +/******************************************************************** + * * + * 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_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) diff --git a/recipes/vorbis/config.yml b/recipes/vorbis/config.yml new file mode 100644 index 0000000000000..bb69b16d35d18 --- /dev/null +++ b/recipes/vorbis/config.yml @@ -0,0 +1,5 @@ +versions: + "1.3.7": + folder: all + "1.3.6": + folder: all diff --git a/recipes/voropp/all/CMakeLists.txt b/recipes/voropp/all/CMakeLists.txt new file mode 100644 index 0000000000000..6f2c6b9d5757a --- /dev/null +++ b/recipes/voropp/all/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.4) +project(voro++ LANGUAGES CXX) + +add_library(${PROJECT_NAME} ${VOROPP_SRC_DIR}/src/voro++.cc) +set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +file(GLOB VOROPP_HEADERS ${VOROPP_SRC_DIR}/src/*.hh) +install(FILES ${VOROPP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/voro++) diff --git a/recipes/voropp/all/conandata.yml b/recipes/voropp/all/conandata.yml new file mode 100644 index 0000000000000..6c38c956a6604 --- /dev/null +++ b/recipes/voropp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.6": + url: "http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz" + sha256: "ef7970071ee2ce3800daa8723649ca069dc4c71cc25f0f7d22552387f3ea437e" diff --git a/recipes/voropp/all/conanfile.py b/recipes/voropp/all/conanfile.py new file mode 100644 index 0000000000000..c327986e7052b --- /dev/null +++ b/recipes/voropp/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class VoroppConan(ConanFile): + name = "voropp" + description = ( + "Voro++ is a open source software library for the computation of the " + "Voronoi diagram, a widely-used tessellation that has applications in " + "many scientific fields." + ) + license = "BSD-3-Clause" + topics = ("voro++", "voronoi-diagram", "tesselation") + homepage = "http://math.lbl.gov/voro++" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, verify=False) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VOROPP_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 = ["voro++"] diff --git a/recipes/voropp/all/test_package/CMakeLists.txt b/recipes/voropp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..80445ad826690 --- /dev/null +++ b/recipes/voropp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(voropp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE voropp::voropp) diff --git a/recipes/voropp/all/test_package/conanfile.py b/recipes/voropp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/voropp/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/voropp/all/test_package/test_package.cpp b/recipes/voropp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..942fef4e584bd --- /dev/null +++ b/recipes/voropp/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include + +#include +#include + +double rnd() { + return double(rand()) / RAND_MAX; +} + +int main() { + voro::voronoicell v; + v.init(-1, 1, -1, 1, -1, 1); + + for (int i = 0; i < 250; ++i) { + double x = 2 * rnd() - 1; + double y = 2 * rnd() - 1; + double z = 2 * rnd() - 1; + double rsq = x * x + y * y + z * z; + if (rsq > 0.01 && rsq < 1) { + double r = 1 / std::sqrt(rsq); + x *= r; + y *= r; + z *= r; + v.plane(x, y, z, 1); + } + } + + return 0; +} diff --git a/recipes/voropp/all/test_v1_package/CMakeLists.txt b/recipes/voropp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/voropp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/voropp/all/test_v1_package/conanfile.py b/recipes/voropp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/voropp/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/voropp/config.yml b/recipes/voropp/config.yml new file mode 100644 index 0000000000000..3cc0b8051fa5a --- /dev/null +++ b/recipes/voropp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.6": + folder: all diff --git a/recipes/vtu11/all/conandata.yml b/recipes/vtu11/all/conandata.yml new file mode 100644 index 0000000000000..d079b9a80f826 --- /dev/null +++ b/recipes/vtu11/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2": + url: + - "https://github.com/phmkopp/vtu11/archive/refs/tags/v1.2.tar.gz" + sha256: "c2b560d397c1a86c10e13f029b4ef08621f70ca4c897c44c19e7d025f11baec3" +patches: + "1.2": + - patch_file: "patches/0001-use-CPP17-filesystem-by-default.patch" + patch_description: "Use C++17 filesystem by default when compiling with C++17" + patch_type: "portability" diff --git a/recipes/vtu11/all/conanfile.py b/recipes/vtu11/all/conanfile.py new file mode 100644 index 0000000000000..389169052faba --- /dev/null +++ b/recipes/vtu11/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "vtu11" + description = "Vtu11 is a small C++ header-only library to write unstructured grids using the vtu file format" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/phmkopp/vtu11" + topics = ("vtu", "c++11") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + options = { + "with_zlib": [True, False], + } + default_options = { + "with_zlib": 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 requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13", transitive_headers=True) + + 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): + if valid_min_cppstd(self, 17): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include", "vtu11"), + src=os.path.join(self.source_folder, "vtu11"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.options.with_zlib: + self.cpp_info.defines = ["VTU11_ENABLE_ZLIB"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "vtu11" + self.cpp_info.filenames["cmake_find_package_multi"] = "vtu11" + self.cpp_info.names["cmake_find_package"] = "vtu11" + self.cpp_info.names["cmake_find_package_multi"] = "vtu11" diff --git a/recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch b/recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch new file mode 100644 index 0000000000000..eb80c0e4f2b2f --- /dev/null +++ b/recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch @@ -0,0 +1,33 @@ +--- a/vtu11/inc/alias.hpp ++++ b/vtu11/inc/alias.hpp +@@ -40,20 +40,14 @@ using Byte = unsigned char; + #define VTU11_ASCII_FLOATING_POINT_FORMAT "%.6g" + #endif + +-// To dynamically select std::filesystem where available, you could use: +-#if defined(__cplusplus) && __cplusplus >= 201703L +- #if __has_include() // has_include is C++17 +- #include +- namespace vtu11fs = std::filesystem; +- #elif __has_include() +- #include +- namespace vtu11fs = std::experimental::filesystem; +- #else +- #include "inc/filesystem.hpp" +- namespace vtu11fs = ghc::filesystem; +- #endif ++#if __has_include() // has_include is C++17 ++ #include ++ namespace vtu11fs = std::filesystem; ++#elif __has_include() ++ #include ++ namespace vtu11fs = std::experimental::filesystem; + #else +- #include "vtu11/inc/filesystem.hpp" ++ #include "inc/filesystem.hpp" + namespace vtu11fs = ghc::filesystem; + #endif + +-- +2.34.1 + diff --git a/recipes/vtu11/all/test_package/CMakeLists.txt b/recipes/vtu11/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..beca0132b2a57 --- /dev/null +++ b/recipes/vtu11/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(vtu11 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vtu11::vtu11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vtu11/all/test_package/conanfile.py b/recipes/vtu11/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b04e2e18461e5 --- /dev/null +++ b/recipes/vtu11/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + +import os + +from pathlib import Path + + +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") + test_vtu = Path(self.build_folder, "test.vtu") + if not test_vtu.exists() or "VTKFile" not in test_vtu.read_text(encoding="utf-8"): + raise ConanException("Failed to generate a viable vtu file") diff --git a/recipes/vtu11/all/test_package/test_package.cpp b/recipes/vtu11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3fbb182b3ca59 --- /dev/null +++ b/recipes/vtu11/all/test_package/test_package.cpp @@ -0,0 +1,50 @@ +#include +#include +#include "vtu11/vtu11.hpp" + + +int main(void) { + // Create data for 3x2 quad mesh: (x, y, z) coordinates of mesh vertices + std::vector points + { + 0.0, 0.0, 0.5, 0.0, 0.3, 0.5, 0.0, 0.7, 0.5, 0.0, 1.0, 0.5, // 0, 1, 2, 3 + 0.5, 0.0, 0.5, 0.5, 0.3, 0.5, 0.5, 0.7, 0.5, 0.5, 1.0, 0.5, // 4, 5, 6, 7 + 1.0, 0.0, 0.5, 1.0, 0.3, 0.5, 1.0, 0.7, 0.5, 1.0, 1.0, 0.5 // 8, 9, 10, 11 + }; + + // Vertex indices of all cells + std::vector connectivity + { + 0, 4, 5, 1, // 0 + 1, 5, 6, 2, // 1 + 2, 6, 7, 3, // 2 + 4, 8, 9, 5, // 3 + 5, 9, 10, 6, // 4 + 6, 10, 11, 7 // 5 + }; + + // Separate cells in connectivity array + std::vector offsets { 4, 8, 12, 16, 20, 24 }; + + // Cell types of each cell, see [1] + std::vector types { 9, 9, 9, 9, 9, 9 }; + + // Create small proxy mesh type + vtu11::Vtu11UnstructuredMesh mesh { points, connectivity, offsets, types }; + + // Create some data associated to points and cells + std::vector pointData { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0 }; + std::vector cellData { 3.2, 4.3, 5.4, 6.5, 7.6, 8.7 }; + + // Create tuples with (name, association, number of components) for each data set + std::vector dataSetInfo + { + vtu11::DataSetInfo{ "Temperature", vtu11::DataSetType::PointData, 1 }, + vtu11::DataSetInfo{ "Conductivity", vtu11::DataSetType::CellData, 1 }, + }; + + // Write data to .vtu file using Ascii format + vtu11::writeVtu( "test.vtu", mesh, dataSetInfo, { pointData, cellData }, "Ascii" ); + + return EXIT_SUCCESS; +} diff --git a/recipes/vtu11/all/test_v1_package/CMakeLists.txt b/recipes/vtu11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/vtu11/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/vtu11/all/test_v1_package/conanfile.py b/recipes/vtu11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..15d4a3b51a02d --- /dev/null +++ b/recipes/vtu11/all/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake +from conan.errors import ConanException +from conan.tools.build import cross_building + +import os + +from pathlib import Path + + +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) + test_vtu = Path(self.build_folder, "test.vtu") + if not test_vtu.exists() or "VTKFile" not in test_vtu.read_text(): + raise ConanException("Failed to generate a viable vtu file") diff --git a/recipes/vtu11/config.yml b/recipes/vtu11/config.yml new file mode 100644 index 0000000000000..a0777b5aa931c --- /dev/null +++ b/recipes/vtu11/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2": + folder: all diff --git a/recipes/vulkan-headers/all/conandata.yml b/recipes/vulkan-headers/all/conandata.yml new file mode 100644 index 0000000000000..a021c2306d89c --- /dev/null +++ b/recipes/vulkan-headers/all/conandata.yml @@ -0,0 +1,85 @@ +sources: + "1.3.243.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "29ddb2ef931f5fb0cabd1a78398f9c4da44d37f8c8a1e110f834f4c260c9d548" + "1.3.239.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "865fa8e8e8314fcca60777a92f50bd0cf612205a36e719d6975482d3366f619e" + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "2df85b3daa78ced7f910db870ea2aed10f718c703e18076b4549ca4005c9c451" + "1.3.231.1": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "6e16051ccb28821b907a08025eedb82cc73e1056924b32f75880ecae2499f7f6" + "1.3.231.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.231.0.tar.gz" + sha256: "f7c185dedf7753d58e7b59913dd4b77006a6ed91fae598c5961f77d85b183da0" + "1.3.231": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.231.tar.gz" + sha256: "4cb1c0aeb858e1a4955a736b86b0da8511ca8701222e9a252adcf093d40a8d28" + "1.3.224.1": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "628bd5943c0d007c192769480e789801a088f892445c80cb336fc9b6d236c5ef" + "1.3.224.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "ccdfa47cea58a080957481fb6c35908d005d04cc5dd1778150dc0c651ccea077" + "1.3.221": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.221.tar.gz" + sha256: "75057d8231bb7a3f6ac091f1b08f50604f07a7e9b4424fd12c035f01787ebf0c" + "1.3.216.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "2c98d1d819fde588fb0f71acebea177f805b3efa26e8260a707a94b1e633be6b" + "1.3.211.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "c464bcdc24b7541ac4378a270617a23d4d92699679a73f95dc4b9e1da924810a" + "1.3.204.1": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.204.1.tar.gz" + sha256: "9c4d33f71467c915749fbf48c0c3a8ee7833f15babf398e3463cd88791fb592e" + "1.3.204.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.204.0.tar.gz" + sha256: "5c3fcfc5dc1daa5fa1f3a0983fdcb344848f846ae34d933412d13456ebee10c1" + "1.3.204": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.204.tar.gz" + sha256: "2cde2c90975a8f36d00cf8eb6308cb00323aafbc0b7374f4b346f1140f760b3d" + "1.2.198.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "34782c61cad9b3ccf2fa0a31ec397d4fce99490500b4f3771cb1a48713fece80" + "1.2.198": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.198.tar.gz" + sha256: "0b2c69bc392a0022652f65efe5c51ec39ae90ec427065a914ba74ac6c728db30" + "1.2.195": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.195.tar.gz" + sha256: "8d6e561871bb4dbb7f83e80eac41b3a582dbd874382990c7e4972cb0258fa529" + "1.2.190": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.190.tar.gz" + sha256: "ce997a3d6f43f9697c5ec232efb0f6e7826d0648412ed141f9495e88429075e0" + "1.2.189": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.189.tar.gz" + sha256: "0939d6cb950746f6f9cab59399c0a99628ed186426a972996599f90d34d8a99a" + "1.2.182": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.182.tar.gz" + sha256: "38d1c953de7bb2d839556226851feeb690f0d23bc22ac46c823dcb66c97bfdc8" + "1.2.176.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.2.176.0.tar.gz" + sha256: "211d8552c5cf8b0607323d69c251d9c4639f89550f8de3d51d3995b5cdd737fb" + "1.2.172": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.172.tar.gz" + sha256: "c69619ac2001ac62378a99c56ced14a53801fdc204efb2b1f787c83b47829319" + "1.2.170.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.170.0.tar.gz" + sha256: "d8e6050230ca678bcb0e7dc68d5984290da6eb655e8da9d08b5eaab1e84a7da9" + "1.2.170": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.170.tar.gz" + sha256: "6fa84897197bd72cf4b1a686c903df67fc0fe108e4ed02e6adb3d72c468f1c1f" + "1.2.162.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.162.0.tar.gz" + sha256: "eb0f6a79ac38e137f55a0e13641140e63b765c8ec717a65bf3904614ef754365" + "1.2.162": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.162.tar.gz" + sha256: "deab1a7a28ad3e0a7a0a1c4cd9c54758dce115a5f231b7205432d2bbbfb4d456" + "1.2.154.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.154.0.tar.gz" + sha256: "a0528ade4dd3bd826b960ba4ccabc62e92ecedc3c70331b291e0a7671b3520f9" + "1.2.140": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.140.tar.gz" + sha256: "c708a05b0ef673ae783f8968c5396dc207b9f8c7cde2ddb4a9a281e04661185a" diff --git a/recipes/vulkan-headers/all/conanfile.py b/recipes/vulkan-headers/all/conanfile.py new file mode 100644 index 0000000000000..a17cf251c00d3 --- /dev/null +++ b/recipes/vulkan-headers/all/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class VulkanHeadersConan(ConanFile): + name = "vulkan-headers" + description = "Vulkan Header files." + license = "Apache-2.0" + topics = ("vulkan-headers", "vulkan") + homepage = "https://github.com/KhronosGroup/Vulkan-Headers" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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.txt", 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")) + copy(self, "*", src=os.path.join(self.source_folder, "registry"), dst=os.path.join(self.package_folder, "res", "vulkan", "registry")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "VulkanHeaders") + self.cpp_info.components["vulkanheaders"].set_property("cmake_target_name", "Vulkan::Headers") + self.cpp_info.components["vulkanheaders"].bindirs = [] + self.cpp_info.components["vulkanheaders"].libdirs = [] + self.cpp_info.components["vulkanregistry"].set_property("cmake_target_name", "Vulkan::Registry") + self.cpp_info.components["vulkanregistry"].includedirs = [os.path.join("res", "vulkan", "registry")] + self.cpp_info.components["vulkanregistry"].bindirs = [] + self.cpp_info.components["vulkanregistry"].libdirs = [] + self.cpp_info.components["vulkanregistry"].resdirs = ["res"] + + self.cpp_info.filenames["cmake_find_package"] = "VulkanHeaders" + self.cpp_info.filenames["cmake_find_package_multi"] = "VulkanHeaders" + self.cpp_info.names["cmake_find_package"] = "Vulkan" + self.cpp_info.names["cmake_find_package_multi"] = "Vulkan" + self.cpp_info.components["vulkanheaders"].names["cmake_find_package"] = "Headers" + self.cpp_info.components["vulkanheaders"].names["cmake_find_package_multi"] = "Headers" + self.cpp_info.components["vulkanregistry"].names["cmake_find_package"] = "Registry" + self.cpp_info.components["vulkanregistry"].names["cmake_find_package_multi"] = "Registry" diff --git a/recipes/vulkan-headers/all/test_package/CMakeLists.txt b/recipes/vulkan-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..92c13c3e4860c --- /dev/null +++ b/recipes/vulkan-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(VulkanHeaders REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} Vulkan::Headers) diff --git a/recipes/vulkan-headers/all/test_package/conanfile.py b/recipes/vulkan-headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vulkan-headers/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/vulkan-headers/all/test_package/test_package.c b/recipes/vulkan-headers/all/test_package/test_package.c new file mode 100644 index 0000000000000..defd9fd301685 --- /dev/null +++ b/recipes/vulkan-headers/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include + +int main() { + VkApplicationInfo appInfo; + appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; + appInfo.pApplicationName = "Hello Conan"; + appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.pEngineName = "Dummy Engine"; + appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.apiVersion = VK_API_VERSION_1_0; + + VkInstanceCreateInfo createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + createInfo.pApplicationInfo = &appInfo; + createInfo.enabledLayerCount = 0; + createInfo.ppEnabledLayerNames = NULL; + createInfo.enabledExtensionCount = 0; + createInfo.ppEnabledExtensionNames = NULL; + + return 0; +} diff --git a/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vulkan-headers/all/test_v1_package/conanfile.py b/recipes/vulkan-headers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vulkan-headers/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/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml new file mode 100644 index 0000000000000..63336383d3028 --- /dev/null +++ b/recipes/vulkan-headers/config.yml @@ -0,0 +1,57 @@ +versions: + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.231.0": + folder: all + "1.3.231": + folder: all + "1.3.224.1": + folder: all + "1.3.224.0": + folder: all + "1.3.221": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all + "1.3.204.1": + folder: all + "1.3.204.0": + folder: all + "1.3.204": + folder: all + "1.2.198.0": + folder: all + "1.2.198": + folder: all + "1.2.195": + folder: all + "1.2.190": + folder: all + "1.2.189": + folder: all + "1.2.182": + folder: all + "1.2.176.0": + folder: all + "1.2.172": + folder: all + "1.2.170.0": + folder: all + "1.2.170": + folder: all + "1.2.162.0": + folder: all + "1.2.162": + folder: all + "1.2.154.0": + folder: all + "1.2.140": + folder: all diff --git a/recipes/vulkan-loader/all/conandata.yml b/recipes/vulkan-loader/all/conandata.yml new file mode 100644 index 0000000000000..fceeca688d80b --- /dev/null +++ b/recipes/vulkan-loader/all/conandata.yml @@ -0,0 +1,78 @@ +sources: + "1.3.239.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "fa2078408793b2173f174173a8784de56b6bbfbcb5fb958a07e46ef126c7eada" + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "157d2230b50bb5be3ef9b9467aa90d1c109d5f188a49b11f741246d7ca583bf3" + "1.3.231.1": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "5226fbc6a90e4405200c8cfdd5733d5e0c6a64e64dcc614c485ea06e03d66578" + "1.3.231": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v1.3.231.tar.gz" + sha256: "02e185b939635167ea8f8815f8daab76af36923a3b995951fe6a5d3e25c55bf7" + "1.3.224.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "9f102a89b7d350ce5a6c82887459821aa9725c521128495ed7cbda637ed52022" + "1.3.221": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.3.221.tar.gz" + sha256: "ba7042b2b14a11646ba8bd33c041ccb4f1abe5bdfa2758e301a76bf6d31d2748" + "1.3.216.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "46188d3db019409b82f850628d5c175cc59dcdb3ce146f5c023b97709f67e8f1" + "1.3.211.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "bb42a8e0dda103f98bddb9ae2311ae8e8e988588b600a1114b74a1ba3a0843f4" + "1.3.204.1": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.204.1.tar.gz" + sha256: "5dcd42b564804f4c01891ddd429a4a5028113c4cf39b44256689e8f543773134" + "1.3.204.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.204.0.tar.gz" + sha256: "7e9700f454007ea6f1e6eb097a905e7c30ad2be740ddd9e76235658c98db2ddd" + "1.2.198.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "7d5d56296dcd88af84ed0fde969038370cac8600c4ef7e328788b7422d9025bb" + "1.2.190": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.2.190.tar.gz" + sha256: "f940bb72d123173187c5c341edb7af55fddc68efa79460f9b703a80e9f4bca44" + "1.2.189": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v1.2.189.tar.gz" + sha256: "6e05f54a0c6a35625e8974f88c197b1817b2bddb253c38540ced9d2bc8132d6c" + "1.2.182": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.2.182.tar.gz" + sha256: "0d1f9fde9d21642526e9baa55d30364c95035c4fe3c6db96836631991b44dd90" + "1.2.172": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.2.172.tar.gz" + sha256: "713dcb73c73194d17251fcd9cff62e5831d4ec30dac2efcf6440595016368ddb" + "1.2.170.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.2.170.0.tar.gz" + sha256: "08c125987d4f6b086fcf952be7dce630b677fc943b336030178737bb1eb2ed49" + "1.2.162.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.2.162.0.tar.gz" + sha256: "f8f5ec2485e7fdba3f58c1cde5a25145ece1c6a686c91ba4016b28c0af3f21dd" + "1.2.154.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.2.154.0.tar.gz" + sha256: "418017d7bab907e72291476df231dd0e7dc7fe20b97e55389c975bcfc48d6433" +patches: + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch" + patch_description: "Do not use features of CMake 3.16, back to 3.10 as min version" + patch_type: "portability" + patch_source: "https://github.com/KhronosGroup/Vulkan-Loader/pull/1102" + "1.3.231.1": + - patch_file: "patches/1.3.231.1-0001-no-find-package-wayland.patch" + patch_description: "CMake: remove attempt to find Wayland" + patch_type: "portability" + patch_source: "https://github.com/KhronosGroup/Vulkan-Loader/pull/1020" + "1.2.182": + - patch_file: "patches/1.2.182-0001-fix-mingw.patch" + patch_description: "Fix MinGW" + patch_type: "portability" + "1.2.154.0": + - patch_file: "patches/1.2.154.0-0001-fix-mingw.patch" + patch_description: "Fix MinGW" + patch_type: "portability" + patch_source: + - "https://github.com/KhronosGroup/Vulkan-Loader/pull/475" + - "https://github.com/KhronosGroup/Vulkan-Loader/pull/495" + - "https://github.com/KhronosGroup/Vulkan-Loader/pull/523" diff --git a/recipes/vulkan-loader/all/conanfile.py b/recipes/vulkan-loader/all/conanfile.py new file mode 100644 index 0000000000000..7d7adac29c32f --- /dev/null +++ b/recipes/vulkan-loader/all/conanfile.py @@ -0,0 +1,193 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class VulkanLoaderConan(ConanFile): + name = "vulkan-loader" + description = "Khronos official Vulkan ICD desktop loader for Windows, Linux, and MacOS." + topics = ("vulkan", "loader", "desktop", "gpu") + homepage = "https://github.com/KhronosGroup/Vulkan-Loader" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_wsi_xcb": [True, False], + "with_wsi_xlib": [True, False], + "with_wsi_wayland": [True, False], + "with_wsi_directfb": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "with_wsi_xcb": True, + "with_wsi_xlib": True, + "with_wsi_wayland": True, + "with_wsi_directfb": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _is_pkgconf_needed(self): + return self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib") or \ + self.options.get_safe("with_wsi_wayland") or self.options.get_safe("with_wsi_directfb") + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.with_wsi_xcb + del self.options.with_wsi_xlib + del self.options.with_wsi_wayland + del self.options.with_wsi_directfb + + def configure(self): + if not is_apple_os(self): + # static builds are not supported + self.options.rm_safe("shared") + self.package_type = "shared-library" + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires(f"vulkan-headers/{self.version}", transitive_headers=True) + if self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib"): + self.requires("xorg/system") + if Version(self.version) < "1.3.231" and self.options.get_safe("with_wsi_wayland"): + self.requires("wayland/1.21.0") + + def validate(self): + if self.options.get_safe("with_wsi_directfb"): + # TODO: directfb package + raise ConanInvalidConfiguration("Conan recipe for DirectFB is not available yet.") + # FIXME: It should build but Visual Studio 2015 container in CI of CCI seems to lack some Win SDK headers + check_min_vs(self, "191") + # TODO: to replace by some version range check + if self.dependencies["vulkan-headers"].ref.version != self.version: + self.output.warning("vulkan-loader should be built & consumed with the same version than vulkan-headers.") + + def build_requirements(self): + if self._is_pkgconf_needed: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._is_mingw: + self.tool_requires("jwasm/2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self._is_pkgconf_needed or self._is_mingw: + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["VULKAN_HEADERS_INSTALL_DIR"] = self.dependencies["vulkan-headers"].package_folder.replace("\\", "/") + tc.variables["BUILD_TESTS"] = False + tc.variables["USE_CCACHE"] = False + if self.settings.os == "Linux": + tc.variables["BUILD_WSI_XCB_SUPPORT"] = self.options.with_wsi_xcb + tc.variables["BUILD_WSI_XLIB_SUPPORT"] = self.options.with_wsi_xlib + tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = self.options.with_wsi_wayland + tc.variables["BUILD_WSI_DIRECTFB_SUPPORT"] = self.options.with_wsi_directfb + if self.settings.os == "Windows": + tc.variables["ENABLE_WIN10_ONECORE"] = False + if is_apple_os(self): + tc.variables["BUILD_STATIC_LOADER"] = not self.options.shared + tc.variables["BUILD_LOADER"] = True + if self.settings.os == "Windows": + tc.variables["USE_MASM"] = True + if Version(self.version) >= "1.3.212": + tc.variables["ENABLE_WERROR"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + if self._is_pkgconf_needed: + pkg = PkgConfigDeps(self) + pkg.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + if Version(self.version) < "1.3.234": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "FindVulkanHeaders.cmake"), + "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", + "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") + # Honor settings.compiler.runtime + replace_in_file(self, os.path.join(self.source_folder, "loader", "CMakeLists.txt"), + "if(${configuration} MATCHES \"/MD\")", + "if(FALSE)") + + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # No warnings as errors + if Version(self.version) < "1.3.212": + replace_in_file(self, cmakelists, "/WX", "") + # This fix is needed due to CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in CMakeToolchain (see https://github.com/conan-io/conan/issues/10387). + # Indeed we want to use upstream Find modules of xcb, x11, wayland and directfb. There are properly using pkgconfig under the hood. + replace_in_file(self, cmakelists, "find_package(XCB REQUIRED)", "find_package(XCB REQUIRED MODULE)") + replace_in_file(self, cmakelists, "find_package(X11 REQUIRED)", "find_package(X11 REQUIRED MODULE)") + # find_package(Wayland REQUIRED) was removed, as it was unused + if Version(self.version) < "1.3.231": + replace_in_file(self, cmakelists, "find_package(Wayland REQUIRED)", "find_package(Wayland REQUIRED MODULE)") + replace_in_file(self, cmakelists, "find_package(DirectFB REQUIRED)", "find_package(DirectFB REQUIRED MODULE)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "loader")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Vulkan") + self.cpp_info.set_property("cmake_target_name", "Vulkan::Vulkan") + self.cpp_info.set_property("pkg_config_name", "vulkan") + suffix = "-1" if self.settings.os == "Windows" else "" + self.cpp_info.libs = [f"vulkan{suffix}"] + + # allow to properly set Vulkan_INCLUDE_DIRS in CMake like generators + self.cpp_info.includedirs = self.dependencies["vulkan-headers"].cpp_info.aggregated_components().includedirs + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "pthread", "m"] + elif self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreFoundation"] + + vulkan_sdk_path = self.package_folder + self.output.info(f"Create VULKAN_SDK environment variable: {vulkan_sdk_path}") + self.env_info.VULKAN_SDK = vulkan_sdk_path + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Vulkan" + self.cpp_info.names["cmake_find_package_multi"] = "Vulkan" + self.cpp_info.names["pkg_config"] = "vulkan" diff --git a/recipes/vulkan-loader/all/patches/1.2.154.0-0001-fix-mingw.patch b/recipes/vulkan-loader/all/patches/1.2.154.0-0001-fix-mingw.patch new file mode 100644 index 0000000000000..a585b5a17fff5 --- /dev/null +++ b/recipes/vulkan-loader/all/patches/1.2.154.0-0001-fix-mingw.patch @@ -0,0 +1,77 @@ +--- a/loader/CMakeLists.txt ++++ b/loader/CMakeLists.txt +@@ -133,9 +133,28 @@ set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG}Note that this may be unsafe, as the C co + set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG} the stack frame for certain calls. If the compiler does not do this, then unknown device") + set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG} extensions will suffer from a corrupted stack.") + if(WIN32) +- enable_language(ASM_MASM) +- if(CMAKE_ASM_MASM_COMPILER_WORKS) +- if(NOT CMAKE_CL_64) ++ if(MINGW) ++ find_program(JWASM_FOUND jwasm) ++ if (JWASM_FOUND) ++ set(CMAKE_ASM_MASM_COMPILER ${JWASM_FOUND}) ++ execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VERSION_OUTPUT) ++ if (COMPILER_VERSION_OUTPUT) ++ if (COMPILER_VERSION_OUTPUT MATCHES "x86_64") ++ set(JWASM_FLAGS -win64) ++ else() ++ set(JWASM_FLAGS -coff) ++ endif() ++ endif() ++ endif() ++ endif() ++ option(USE_MASM "Use MASM" ON) ++ if (USE_MASM) ++ enable_language(ASM_MASM) ++ endif () ++ if(CMAKE_ASM_MASM_COMPILER_WORKS OR JWASM_FOUND) ++ if(MINGW) ++ set(CMAKE_ASM_MASM_FLAGS ${CMAKE_ASM_MASM_FLAGS} ${JWASM_FLAGS}) ++ elseif(NOT CMAKE_CL_64 AND NOT JWASM_FOUND) + set(CMAKE_ASM_MASM_FLAGS ${CMAKE_ASM_MASM_FLAGS} /safeseh) + endif() + +@@ -205,14 +224,16 @@ if(WIN32) + PROPERTIES LINK_FLAGS_DEBUG + "/ignore:4098" + OUTPUT_NAME +- vulkan-1) ++ vulkan-1 ++ PREFIX ++ "") + target_link_libraries(vulkan Vulkan::Headers) + + if(ENABLE_WIN10_ONECORE) + target_link_libraries(vulkan OneCoreUAP.lib LIBCMT.LIB LIBCMTD.LIB LIBVCRUNTIME.LIB LIBUCRT.LIB) + set_target_properties(vulkan PROPERTIES LINK_FLAGS "/NODEFAULTLIB") + else() +- target_link_libraries(vulkan Cfgmgr32) ++ target_link_libraries(vulkan cfgmgr32) + endif() + + add_dependencies(vulkan loader_asm_gen_files) +--- a/loader/loader.c ++++ b/loader/loader.c +@@ -71,6 +71,9 @@ + #include + #include + #include ++#ifdef __MINGW32__ ++#undef strcpy // fix error with redfined strcpy when building with MinGW-w64 ++#endif + #include + #include "adapters.h" + +@@ -695,7 +698,11 @@ VkResult loaderGetDeviceRegistryFiles(const struct loader_instance *inst, char * + LPCSTR value_name) { + static const wchar_t *softwareComponentGUID = L"{5c4c3332-344d-483c-8739-259e934c9cc8}"; + static const wchar_t *displayGUID = L"{4d36e968-e325-11ce-bfc1-08002be10318}"; ++#ifdef CM_GETIDLIST_FILTER_PRESENT + const ULONG flags = CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT; ++#else ++ const ULONG flags = 0x300; ++#endif + + wchar_t childGuid[MAX_GUID_STRING_LEN + 2]; // +2 for brackets {} + ULONG childGuidSize = sizeof(childGuid); diff --git a/recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch b/recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch new file mode 100644 index 0000000000000..b0cda85f0d738 --- /dev/null +++ b/recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch @@ -0,0 +1,24 @@ +--- a/loader/CMakeLists.txt ++++ b/loader/CMakeLists.txt +@@ -229,7 +229,6 @@ if(WIN32) + $ + ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-1.def + ${CMAKE_CURRENT_SOURCE_DIR}/loader.rc) +- if(MSVC) + set_target_properties(vulkan + PROPERTIES + #LINK_FLAGS_DEBUG "/ignore:4098" +@@ -237,13 +236,6 @@ if(WIN32) + vulkan-1 + PREFIX + "") +- else() +- set_target_properties(vulkan +- PROPERTIES +- LIBRARY_OUTPUT_NAME vulkan +- RUNTIME_OUTPUT_NAME vulkan-1 +- ARCHIVE_OUTPUT_NAME vulkan) +- endif() + target_link_libraries(vulkan Vulkan::Headers) + + if(MSVC AND ENABLE_WIN10_ONECORE) diff --git a/recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch b/recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch new file mode 100644 index 0000000000000..0f841d44ccf38 --- /dev/null +++ b/recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -215,10 +215,6 @@ if(UNIX AND NOT APPLE) # i.e.: Linux + find_package(X11 REQUIRED) + endif() + +- if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) +- include_directories(SYSTEM ${WAYLAND_CLIENT_INCLUDE_DIR}) +- endif() + + if(BUILD_WSI_DIRECTFB_SUPPORT) + find_package(DirectFB REQUIRED) diff --git a/recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch b/recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch new file mode 100644 index 0000000000000..fe88588420cd9 --- /dev/null +++ b/recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch @@ -0,0 +1,24 @@ +--- a/loader/CMakeLists.txt ++++ b/loader/CMakeLists.txt +@@ -160,9 +160,7 @@ if(WIN32) + target_link_libraries(asm_offset PRIVATE loader_specific_options) + # If not cross compiling, run asm_offset to generage gen_defines.asm + if (NOT CMAKE_CROSSCOMPILING) +- add_custom_command(TARGET asm_offset POST_BUILD +- COMMAND asm_offset MASM +- BYPRODUCTS gen_defines.asm) ++ add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset MASM) + else() + # Forces compiler to write the intermediate asm file, needed so that we can get sizeof/offset of info out of it. + target_compile_options(asm_offset PRIVATE "/Fa$/asm_offset.asm" /FA) +@@ -236,9 +234,7 @@ else() # i.e.: Linux + target_link_libraries(asm_offset loader_specific_options) + # If not cross compiling, run asm_offset to generage gen_defines.asm + if (NOT CMAKE_CROSSCOMPILING) +- add_custom_command(TARGET asm_offset POST_BUILD +- COMMAND asm_offset GAS +- BYPRODUCTS gen_defines.asm) ++ add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset GAS) + else() + # Forces compiler to write the intermediate asm file, needed so that we can get sizeof/offset of info out of it. + target_compile_options(asm_offset PRIVATE -save-temps=obj) diff --git a/recipes/vulkan-loader/all/test_package/CMakeLists.txt b/recipes/vulkan-loader/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5a43176c74c66 --- /dev/null +++ b/recipes/vulkan-loader/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Vulkan REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Vulkan) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vulkan-loader/all/test_package/conanfile.py b/recipes/vulkan-loader/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vulkan-loader/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/vulkan-loader/all/test_package/test_package.cpp b/recipes/vulkan-loader/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62c6f9b310736 --- /dev/null +++ b/recipes/vulkan-loader/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#include + +#include + +int main() +{ + vk::ApplicationInfo appInfo; + appInfo.pApplicationName = "ConanTestApp"; + appInfo.pEngineName = "ConanTestEngine"; + appInfo.apiVersion = VK_API_VERSION_1_0; + + vk::InstanceCreateInfo instanceCreateInfo; + instanceCreateInfo.pApplicationInfo = &appInfo; + + try + { + vk::Instance instance = vk::createInstance(instanceCreateInfo); + + auto physicalDevices = instance.enumeratePhysicalDevices(); + auto physicalDevice = physicalDevices[0]; + auto deviceProperties = physicalDevice.getProperties(); + auto deviceMemoryProperties = physicalDevice.getMemoryProperties(); + + std::cout << "Vulkan device created" << std::endl; + std::cout << "API Version: " << deviceProperties.apiVersion << std::endl; + std::cout << "Driver Version: " << deviceProperties.driverVersion << std::endl; + std::cout << "Device Name: " << deviceProperties.deviceName << std::endl; + std::cout << "Device Type: " << vk::to_string(deviceProperties.deviceType) << std::endl; + std::cout << "Memory Heaps: " << deviceMemoryProperties.memoryHeapCount << std::endl; + } + catch(const vk::SystemError& e) + { + std::cerr << e.what() << '\n'; + } + + return 0; +} diff --git a/recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vulkan-loader/all/test_v1_package/conanfile.py b/recipes/vulkan-loader/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/vulkan-loader/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vulkan-loader/config.yml b/recipes/vulkan-loader/config.yml new file mode 100644 index 0000000000000..493a9fc0ba035 --- /dev/null +++ b/recipes/vulkan-loader/config.yml @@ -0,0 +1,37 @@ +versions: + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.231": + folder: all + "1.3.224.0": + folder: all + "1.3.221": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all + "1.3.204.1": + folder: all + "1.3.204.0": + folder: all + "1.2.198.0": + folder: all + "1.2.190": + folder: all + "1.2.189": + folder: all + "1.2.182": + folder: all + "1.2.172": + folder: all + "1.2.170.0": + folder: all + "1.2.162.0": + folder: all + "1.2.154.0": + folder: all diff --git a/recipes/vulkan-memory-allocator/all/conandata.yml b/recipes/vulkan-memory-allocator/all/conandata.yml new file mode 100644 index 0000000000000..d35351a8d12e7 --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.0.1": + url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/refs/tags/v3.0.1.tar.gz" + sha256: "2a84762b2d10bf540b9dc1802a198aca8ad1f3d795a4ae144212c595696a360c" + "3.0.0": + url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/refs/tags/v3.0.0.tar.gz" + sha256: "dbb621a7a13fb70b8c34fef62fbe5128cc5193c7179c9edacead9f110df79a2f" + "2.3.0": + url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/v2.3.0.zip" + sha256: "1c222c372e90f1a0d5e765420974842cf2503683ca14c30f8a0df340ba541f02" +patches: + "3.0.0": + - patch_file: "patches/0001-fix-appleclang.patch" diff --git a/recipes/vulkan-memory-allocator/all/conanfile.py b/recipes/vulkan-memory-allocator/all/conanfile.py new file mode 100644 index 0000000000000..88b01c7c9bcc1 --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class VulkanMemoryAllocatorConan(ConanFile): + name = "vulkan-memory-allocator" + license = "MIT" + homepage = "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator" + url = "https://github.com/conan-io/conan-center-index" + description = "Easy to integrate Vulkan memory allocation library." + topics = ("vulkan", "memory-allocator", "graphics") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "3.0.0" else "14" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("vulkan-headers/1.3.243.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], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "3.0.0": + include_dir = os.path.join(self.source_folder, "src") + else: + include_dir = os.path.join(self.source_folder, "include") + copy(self, "vk_mem_alloc.h", src=include_dir, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch b/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch new file mode 100644 index 0000000000000..85be3b03af743 --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch @@ -0,0 +1,97 @@ +from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/3f9f66740aa6cd8a329cc738c21aaff9020fed46 + +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -2569,6 +2569,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include + #include + #include ++#include + + #ifdef _MSC_VER + #include // For functions like __popcnt, _BitScanForward etc. +@@ -5491,6 +5492,7 @@ public: + // Posts next part of an open string. The number is converted to decimal characters. + void ContinueString(uint32_t n); + void ContinueString(uint64_t n); ++ void ContinueString_Size(size_t n); + // Posts next part of an open string. Pointer value is converted to characters + // using "%p" formatting - shown as hexadecimal number, e.g.: 000000081276Ad00 + void ContinueString_Pointer(const void* ptr); +@@ -5500,6 +5502,7 @@ public: + // Writes a number value. + void WriteNumber(uint32_t n); + void WriteNumber(uint64_t n); ++ void WriteSize(size_t n); + // Writes a boolean value - false or true. + void WriteBool(bool b); + // Writes a null value. +@@ -5524,6 +5527,11 @@ private: + VmaVector< StackItem, VmaStlAllocator > m_Stack; + bool m_InsideString; + ++ // Write size_t for less than 64bits ++ void WriteSize(size_t n, std::integral_constant) { m_SB.AddNumber(static_cast(n)); } ++ // Write size_t for 64bits ++ void WriteSize(size_t n, std::integral_constant) { m_SB.AddNumber(static_cast(n)); } ++ + void BeginValue(bool isString); + void WriteIndent(bool oneLess = false); + }; +@@ -5666,6 +5674,14 @@ void VmaJsonWriter::ContinueString(uint64_t n) + m_SB.AddNumber(n); + } + ++void VmaJsonWriter::ContinueString_Size(size_t n) ++{ ++ VMA_ASSERT(m_InsideString); ++ // Fix for AppleClang incorrect type casting ++ // TODO: Change to if constexpr when C++17 used as minimal standard ++ WriteSize(n, std::is_same{}); ++} ++ + void VmaJsonWriter::ContinueString_Pointer(const void* ptr) + { + VMA_ASSERT(m_InsideString); +@@ -5697,6 +5713,15 @@ void VmaJsonWriter::WriteNumber(uint64_t n) + m_SB.AddNumber(n); + } + ++void VmaJsonWriter::WriteSize(size_t n) ++{ ++ VMA_ASSERT(!m_InsideString); ++ BeginValue(false); ++ // Fix for AppleClang incorrect type casting ++ // TODO: Change to if constexpr when C++17 used as minimal standard ++ WriteSize(n, std::is_same{}); ++} ++ + void VmaJsonWriter::WriteBool(bool b) + { + VMA_ASSERT(!m_InsideString); +@@ -6440,13 +6465,13 @@ void VmaBlockMetadata::PrintDetailedMap_Begin(class VmaJsonWriter& json, + json.WriteNumber(GetSize()); + + json.WriteString("UnusedBytes"); +- json.WriteNumber(unusedBytes); ++ json.WriteSize(unusedBytes); + + json.WriteString("Allocations"); +- json.WriteNumber(allocationCount); ++ json.WriteSize(allocationCount); + + json.WriteString("UnusedRanges"); +- json.WriteNumber(unusedRangeCount); ++ json.WriteSize(unusedRangeCount); + + json.WriteString("Suballocations"); + json.BeginArray(); +@@ -15964,7 +15989,7 @@ void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json) + { + json.WriteString("Name"); + json.BeginString(); +- json.ContinueString(index++); ++ json.ContinueString_Size(index++); + if (pool->GetName()) + { + json.WriteString(" - "); diff --git a/recipes/vulkan-memory-allocator/all/test_package/CMakeLists.txt b/recipes/vulkan-memory-allocator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d26eb190396f0 --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vulkan-memory-allocator REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-memory-allocator::vulkan-memory-allocator) +if(vulkan-memory-allocator_VERSION VERSION_LESS "3.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/vulkan-memory-allocator/all/test_package/conanfile.py b/recipes/vulkan-memory-allocator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vulkan-memory-allocator/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/vulkan-memory-allocator/all/test_package/test_package.cpp b/recipes/vulkan-memory-allocator/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6bb4b6f1c276c --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#define VMA_STATIC_VULKAN_FUNCTIONS 0 +#define VMA_IMPLEMENTATION +#include + +int main() +{ + // Load function pointers... + // vmaVmaVulkanFunctions vulkanFunctions{}; + // vulkavulkanFunctions.vkAllocateMemory = ... ; + // ... + + VmaAllocatorCreateInfo allocatorInfo{}; (void)allocatorInfo; + // allocatorInfo.instance = instance; + // allocatorInfo.physicalDevice = physicalDevice; + // allocatorInfo.device = device; + // allocatorInfo.pVulkanFunctions = &vulkanFunctions; + + VmaAllocator allocator; (void)allocator; + // vmaCreateAllocator(&allocatorInfo, &allocator); +} diff --git a/recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/vulkan-memory-allocator/all/test_v1_package/conanfile.py b/recipes/vulkan-memory-allocator/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vulkan-memory-allocator/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/vulkan-memory-allocator/config.yml b/recipes/vulkan-memory-allocator/config.yml new file mode 100644 index 0000000000000..6220702ac9b05 --- /dev/null +++ b/recipes/vulkan-memory-allocator/config.yml @@ -0,0 +1,7 @@ +versions: + "3.0.1": + folder: all + "3.0.0": + folder: all + "2.3.0": + folder: all diff --git a/recipes/vulkan-validationlayers/all/conandata.yml b/recipes/vulkan-validationlayers/all/conandata.yml new file mode 100644 index 0000000000000..cce0aea3d2aac --- /dev/null +++ b/recipes/vulkan-validationlayers/all/conandata.yml @@ -0,0 +1,75 @@ +sources: + "1.3.239.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "7aa7fb46e25e5ef0144d29c92122b631dc7c7c6804a6339f195b368ad53328e4" + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "68f2cf70b1960f85e931ef56935e6ceda1beeb214f8fa319e6b95128b02b485a" + "1.3.231.1": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "ea40af0f499e7e97a86ee54410c5c78e7f7bac40f65ae09a1549773b6501bf4d" + "1.3.224.1": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "49c00e0119e3bc11e13c0c740e57c76b582b14f754f3779b85508c4d90d9df85" + "1.3.216.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "593d9b818d536490b70322a01b306ec165df5e7a70d770d05014fbd0b325fa15" + "1.3.211.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "927c1cb98c81fe8a1a529cf2d977d701dcda49c495a19583dc00e178b6757203" + "1.3.204.1": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.204.1.tar.gz" + sha256: "a5e658a4c1f504ae38488acdbe2ab2799e2ae4b626104d76776f1c24b079f341" + "1.2.198.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "4a70cc5da26baf873fcf69b081eeeda545515dd66e5904f18fee32b4d275593a" + "1.2.189.2": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.2.189.2.tar.gz" + sha256: "f59eb2c7d601c155a528b62637277b9ef4beb5132cbf868eb3779c7d4415bb1c" + "1.2.182": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/v1.2.182.tar.gz" + sha256: "5a1f7027c06a8e5ae777d9053b5ce46f10ca623806a43332eb2da06fe46476d4" +patches: + "1.3.239.0": + - patch_file: "patches/1.3.239.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.231.1": + - patch_file: "patches/1.3.231.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + - patch_file: "patches/1.3.231.1-0002-cmake-no-werror.patch" + patch_description: "Allow to disable Werror for old gcc/clang versions" + patch_type: "portability" + "1.3.224.1": + - patch_file: "patches/1.3.224.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.216.0": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.211.0": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.204.1": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.2.198.0": + - patch_file: "patches/1.2.198.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.2.189.2": + - patch_file: "patches/1.2.189.2-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.2.182": + - patch_file: "patches/1.2.182-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" diff --git a/recipes/vulkan-validationlayers/all/conanfile.py b/recipes/vulkan-validationlayers/all/conanfile.py new file mode 100644 index 0000000000000..9b4e7e7f28c9e --- /dev/null +++ b/recipes/vulkan-validationlayers/all/conanfile.py @@ -0,0 +1,229 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import functools +import glob +import os +import shutil +import yaml + +required_conan_version = ">=1.55.0" + + +class VulkanValidationLayersConan(ConanFile): + name = "vulkan-validationlayers" + description = "Khronos official Vulkan validation layers for Windows, Linux, Android, and MacOS." + license = "Apache-2.0" + topics = ("vulkan", "validation-layers") + homepage = "https://github.com/KhronosGroup/Vulkan-ValidationLayers" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_wsi_xcb": [True, False], + "with_wsi_xlib": [True, False], + "with_wsi_wayland": [True, False], + } + default_options = { + "with_wsi_xcb": True, + "with_wsi_xlib": True, + "with_wsi_wayland": True, + } + + short_paths = True + + @property + def _dependencies_filename(self): + return f"dependencies-{self.version}.yml" + + @property + @functools.lru_cache(1) + def _dependencies_versions(self): + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependencies_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException(f"Cannot find {dependencies_filepath}") + cached_dependencies = yaml.safe_load(open(dependencies_filepath)) + return cached_dependencies + + @property + def _needs_wayland_for_build(self): + return self.options.get_safe("with_wsi_wayland") and Version(self.version) < "1.3.231" + + @property + def _needs_pkg_config(self): + return self.options.get_safe("with_wsi_xcb") or \ + self.options.get_safe("with_wsi_xlib") or \ + self._needs_wayland_for_build + + @property + def _min_cppstd(self): + if Version(self.version) >= "1.3.235": + return "17" + return "11" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "apple-clang": "9", + "clang": "6", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15.7", + }, + }.get(self._min_cppstd, {}) + + def export(self): + copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_wsi_xcb + del self.options.with_wsi_xlib + del self.options.with_wsi_wayland + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("robin-hood-hashing/3.11.5") + self.requires(self._require("spirv-headers")) + if Version(conan_version).major < "2": + # TODO: set private=True, once the issue is resolved https://github.com/conan-io/conan/issues/9390 + self.requires(self._require("spirv-tools"), private=not hasattr(self, "settings_build")) + else: + self.requires(self._require("spirv-tools")) + self.requires(self._require("vulkan-headers"), transitive_headers=True) + if self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib"): + self.requires("xorg/system") + if self._needs_wayland_for_build: + self.requires("wayland/1.21.0") + + def _require(self, recipe_name): + if recipe_name not in self._dependencies_versions: + raise ConanException(f"{recipe_name} is missing in {self._dependencies_filename}") + return f"{recipe_name}/{self._dependencies_versions[recipe_name]}" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if self.dependencies["spirv-tools"].options.shared: + raise ConanInvalidConfiguration("vulkan-validationlayers can't depend on shared spirv-tools") + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("gcc < 5 is not supported") + + def build_requirements(self): + if self._needs_pkg_config and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if Version(self.version) >= "1.3.239": + 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): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + if Version(self.version) < "1.3.234": + tc.variables["VULKAN_HEADERS_INSTALL_DIR"] = self.dependencies["vulkan-headers"].package_folder.replace("\\", "/") + tc.variables["USE_CCACHE"] = False + if self.settings.os in ["Linux", "FreeBSD"]: + tc.variables["BUILD_WSI_XCB_SUPPORT"] = self.options.with_wsi_xcb + tc.variables["BUILD_WSI_XLIB_SUPPORT"] = self.options.with_wsi_xlib + tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = self.options.with_wsi_wayland + tc.variables["BUILD_WERROR"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["INSTALL_TESTS"] = False + tc.variables["BUILD_LAYERS"] = True + tc.variables["BUILD_LAYER_SUPPORT_FILES"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if self._needs_pkg_config: + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Vulkan-ValidationLayers relies on Vulkan-Headers version from CMake config file + # to set api_version in its manifest file, but this value MUST have format x.y.z (no extra number). + # FIXME: find a way to force correct version in CMakeDeps of vulkan-headers recipe? + if Version(self.version) >= "1.3.235": + vk_version = Version(self.dependencies["vulkan-headers"].ref.version) + sanitized_vk_version = f"{vk_version.major}.{vk_version.minor}.{vk_version.patch}" + replace_in_file( + self, os.path.join(self.source_folder, "layers", "CMakeLists.txt"), + "set(JSON_API_VERSION ${VulkanHeaders_VERSION})", + f"set(JSON_API_VERSION \"{sanitized_vk_version}\")", + ) + # FIXME: two CMake module/config files should be generated (SPIRV-ToolsConfig.cmake and SPIRV-Tools-optConfig.cmake), + # but it can't be modeled right now in spirv-tools recipe + if not os.path.exists(os.path.join(self.generators_folder, "SPIRV-Tools-optConfig.cmake")): + shutil.copy( + os.path.join(self.generators_folder, "SPIRV-ToolsConfig.cmake"), + os.path.join(self.generators_folder, "SPIRV-Tools-optConfig.cmake"), + ) + + def build(self): + self._patch_sources() + 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() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.settings.os == "Windows": + # import lib is useless, validation layers are loaded at runtime + lib_dir = os.path.join(self.package_folder, "lib") + rm(self, "VkLayer_khronos_validation.lib", lib_dir) + rm(self, "libVkLayer_khronos_validation.dll.a", lib_dir) + # move dll and json manifest files in bin folder + bin_dir = os.path.join(self.package_folder, "bin") + mkdir(self, bin_dir) + for ext in ("*.dll", "*.json"): + for bin_file in glob.glob(os.path.join(lib_dir, ext)): + shutil.move(bin_file, os.path.join(bin_dir, os.path.basename(bin_file))) + else: + # Move json files to res, but keep in mind to preserve relative + # path between module library and manifest json file + rename(self, os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["VkLayer_utils"] + + manifest_subfolder = "bin" if self.settings.os == "Windows" else os.path.join("res", "vulkan", "explicit_layer.d") + vk_layer_path = os.path.join(self.package_folder, manifest_subfolder) + self.runenv_info.prepend_path("VK_LAYER_PATH", vk_layer_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.VK_LAYER_PATH.append(vk_layer_path) diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml new file mode 100644 index 0000000000000..c3e6505e83271 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml @@ -0,0 +1,3 @@ +spirv-headers: "cci.20210616" +spirv-tools: "2021.2" +vulkan-headers: "1.2.182" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml new file mode 100644 index 0000000000000..dd52c0e08b282 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml @@ -0,0 +1,3 @@ +spirv-headers: "cci.20210811" +spirv-tools: "2021.3" +vulkan-headers: "1.2.189" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml new file mode 100644 index 0000000000000..ac36ea35232c5 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.2.198.0" +spirv-tools: "2021.4" +vulkan-headers: "1.2.198.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml new file mode 100644 index 0000000000000..e19c38225be30 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.204.0" +spirv-tools: "1.3.204.0" +vulkan-headers: "1.3.204.1" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml new file mode 100644 index 0000000000000..d6b212b266991 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.211.0" +spirv-tools: "1.3.211.0" +vulkan-headers: "1.3.211.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml new file mode 100644 index 0000000000000..3ca4ddaf45684 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.216.0" +spirv-tools: "1.3.216.0" +vulkan-headers: "1.3.216.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml new file mode 100644 index 0000000000000..5db991b2921eb --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.224.0" +spirv-tools: "1.3.224.0" +vulkan-headers: "1.3.224.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml new file mode 100644 index 0000000000000..55064d8349ad8 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.231.1" +spirv-tools: "1.3.231.1" +vulkan-headers: "1.3.231.1" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml new file mode 100644 index 0000000000000..6e9ed400844e9 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.236.0" +spirv-tools: "1.3.236.0" +vulkan-headers: "1.3.236.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml new file mode 100644 index 0000000000000..a580c69936290 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.239.0" +spirv-tools: "1.3.239.0" +vulkan-headers: "1.3.239.0" diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1df1151c34367 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch @@ -0,0 +1,83 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -102,7 +102,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -154,7 +154,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +@@ -237,13 +237,10 @@ option(BUILD_LAYERS "Build layers" ON) + option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers + option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) + if (USE_ROBIN_HOOD_HASHING) +- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) +- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") +- endif() +- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") ++ find_package(robin_hood REQUIRED CONFIG) + endif() + +-if(BUILD_TESTS OR BUILD_LAYERS) ++if(BUILD_TESTS) + + set(GLSLANG_INSTALL_DIR "GLSLANG-NOTFOUND" CACHE PATH "Absolute path to a glslang install directory") + if(NOT GLSLANG_INSTALL_DIR AND NOT DEFINED ENV{GLSLANG_INSTALL_DIR} AND NOT TARGET glslang) +@@ -302,8 +299,14 @@ if(BUILD_TESTS OR BUILD_LAYERS) + set(GLSLANG_SPIRV_INCLUDE_DIR "${glslang_SOURCE_DIR}" CACHE PATH "Path to glslang spirv headers") + set(GLSLANG_LIBRARIES glslang SPIRV SPVRemapper) + endif() ++endif() + ++if(BUILD_TESTS OR BUILD_LAYERS) + # spirv-tools ++ find_package(SPIRV-Tools REQUIRED CONFIG) ++ if(NOT TARGET SPIRV-Tools-opt) ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG) ++ endif() + if (NOT TARGET SPIRV-Tools) + if(NOT SPIRV_TOOLS_INSTALL_DIR) + set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") +@@ -389,7 +392,7 @@ target_include_directories(VkLayer_utils + ${VulkanHeaders_INCLUDE_DIR}) + + if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) ++ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) + target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) + endif() + +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -291,9 +291,6 @@ if(BUILD_LAYERS) + if(INSTRUMENT_OPTICK) + target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) + endif() +- if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) +- endif() + target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) + + # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a5cb883c9cc3a --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch @@ -0,0 +1,75 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,7 +111,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -163,7 +163,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +@@ -240,10 +240,7 @@ option(BUILD_LAYERS "Build layers" ON) + option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers + option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) + if (USE_ROBIN_HOOD_HASHING) +- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) +- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") +- endif() +- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") ++ find_package(robin_hood REQUIRED CONFIG) + endif() + + if(BUILD_TESTS) +@@ -307,6 +304,10 @@ endif() + + if(BUILD_TESTS OR BUILD_LAYERS) + # spirv-tools ++ find_package(SPIRV-Tools REQUIRED CONFIG) ++ if(NOT TARGET SPIRV-Tools-opt) ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG) ++ endif() + if (NOT TARGET SPIRV-Tools) + if(NOT SPIRV_TOOLS_INSTALL_DIR) + set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") +@@ -375,7 +376,7 @@ target_include_directories(VkLayer_utils + ${VulkanHeaders_INCLUDE_DIR}) + + if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) ++ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) + target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) + endif() + +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -297,9 +297,6 @@ if(BUILD_LAYERS) + if(INSTRUMENT_OPTICK) + target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) + endif() +- if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) +- endif() + target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) + + # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e482c6be482cf --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch @@ -0,0 +1,75 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,7 +108,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +@@ -237,10 +237,7 @@ option(BUILD_LAYERS "Build layers" ON) + option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers + option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) + if (USE_ROBIN_HOOD_HASHING) +- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) +- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") +- endif() +- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") ++ find_package(robin_hood REQUIRED CONFIG) + endif() + + if(BUILD_TESTS) +@@ -304,6 +301,10 @@ endif() + + if(BUILD_TESTS OR BUILD_LAYERS) + # spirv-tools ++ find_package(SPIRV-Tools REQUIRED CONFIG) ++ if(NOT TARGET SPIRV-Tools-opt) ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG) ++ endif() + if (NOT TARGET SPIRV-Tools) + if(NOT SPIRV_TOOLS_INSTALL_DIR) + set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") +@@ -372,7 +373,7 @@ target_include_directories(VkLayer_utils + ${VulkanHeaders_INCLUDE_DIR}) + + if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) ++ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) + target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) + endif() + +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -301,9 +301,6 @@ if(BUILD_LAYERS) + if(INSTRUMENT_OPTICK) + target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) + endif() +- if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) +- endif() + target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) + + # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..319efad89dcde --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -174,7 +174,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..76ce4f2ef3df3 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -174,7 +174,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -63,7 +63,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_DEFAULT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + else() diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..dc7286044497f --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -103,7 +103,7 @@ if (GOOGLETEST_INSTALL_DIR) + list(APPEND CMAKE_PREFIX_PATH ${GOOGLETEST_INSTALL_DIR}) + endif() + +-find_package(VulkanHeaders REQUIRED) ++find_package(VulkanHeaders REQUIRED MODULE) + add_library(Vulkan-Headers INTERFACE) + target_include_directories(Vulkan-Headers INTERFACE ${VulkanHeaders_INCLUDE_DIRS}) + add_library(Vulkan::Headers ALIAS Vulkan-Headers) +@@ -229,7 +229,6 @@ if(BUILD_LAYERS OR BUILD_TESTS) + endif() + + # VVLGenerateSourceCode depends on spirv/unified1 +- include(VVLGenerateSourceCode) + + if (NOT TARGET SPIRV-Tools-opt) + find_package(SPIRV-Tools-opt REQUIRED CONFIG) +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -63,7 +63,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_DEFAULT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + else() diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch new file mode 100644 index 0000000000000..5d410a8c7a09e --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,9 +171,7 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)") + -fno-builtin-memcmp) + + # Treat warnings as errors for versions of GCC and c++11-compliant Clang versions that are shipped on Ubuntu 18.04 or older. +- if(BUILD_WERROR OR +- (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 7.3.0) OR +- (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0.0)) ++ if(BUILD_WERROR) + add_compile_options(-Werror) + endif() + diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f63003f30dac5 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -230,7 +230,6 @@ endif() + if(BUILD_LAYERS OR BUILD_TESTS) + find_package(SPIRV-Headers REQUIRED CONFIG QUIET) + +- include(VVLGenerateSourceCode) + + find_package(SPIRV-Tools-opt REQUIRED CONFIG QUIET) + diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e30c2cbd5ce46 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch @@ -0,0 +1,11 @@ +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -134,7 +134,7 @@ endif() + + find_package(PythonInterp 3 QUIET) + +-if (PYTHONINTERP_FOUND) ++if (0) + # Get the include directory of the SPIRV-Headers + get_target_property(SPIRV_HEADERS_INCLUDE_DIR SPIRV-Headers::SPIRV-Headers INTERFACE_INCLUDE_DIRECTORIES) + diff --git a/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt b/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f968d5c77f977 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vulkan-validationlayers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-validationlayers::vulkan-validationlayers) +if(vulkan-validationlayers_VERSION VERSION_GREATER_EQUAL "1.3.235") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/vulkan-validationlayers/all/test_package/conanfile.py b/recipes/vulkan-validationlayers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/vulkan-validationlayers/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/vulkan-validationlayers/all/test_package/test_package.cpp b/recipes/vulkan-validationlayers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dde2e0f66178b --- /dev/null +++ b/recipes/vulkan-validationlayers/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << "VK_FORMAT_D16_UNORM " << (FormatIsDepthOnly(VK_FORMAT_D16_UNORM) ? "is" : "is not") << " depth only" << std::endl; + return 0; +} diff --git a/recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py b/recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vulkan-validationlayers/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/vulkan-validationlayers/config.yml b/recipes/vulkan-validationlayers/config.yml new file mode 100644 index 0000000000000..d99b3e54ca59d --- /dev/null +++ b/recipes/vulkan-validationlayers/config.yml @@ -0,0 +1,21 @@ +versions: + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.224.1": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all + "1.3.204.1": + folder: all + "1.2.198.0": + folder: all + "1.2.189.2": + folder: all + "1.2.182": + folder: all diff --git a/recipes/waf/all/conandata.yml b/recipes/waf/all/conandata.yml new file mode 100644 index 0000000000000..4d28ed8ee8074 --- /dev/null +++ b/recipes/waf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.19": + url: "https://waf.io/waf-2.0.19.tar.bz2" + sha256: "d8402689b72fe75f759a83b5f6bdf9b4f34ca7fd6007d80680ecfcbef5c2bba5" diff --git a/recipes/waf/all/conanfile.py b/recipes/waf/all/conanfile.py new file mode 100644 index 0000000000000..cc8d7cdece540 --- /dev/null +++ b/recipes/waf/all/conanfile.py @@ -0,0 +1,60 @@ +from conans import ConanFile, tools +import os + + +class WafConan(ConanFile): + name = "waf" + description = "The Waf build system" + topics = ("conan", "waf", "builsystem") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://waf.io" + license = "BSD-3-Clause" + settings = "os", "arch" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("waf-{}".format(self.version), self._source_subfolder) + + @property + def _license_text(self): + [_, license, _] = open(os.path.join(self.source_folder, self._source_subfolder, "waf"), "rb").read().split(b"\"\"\"", 3) + return license.decode().lstrip() + + def build(self): + pass + + def package(self): + binpath = os.path.join(self.package_folder, "bin") + libpath = os.path.join(self.package_folder, "lib") + + os.mkdir(binpath) + os.mkdir(libpath) + + tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + + self.copy("waf", src=self._source_subfolder, dst=binpath) + self.copy("waf-light", src=self._source_subfolder, dst=binpath) + self.copy("waflib/*", src=self._source_subfolder, dst=libpath) + + if self.settings.os == "Windows": + self.copy("waf.bat", src=os.path.join(self._source_subfolder, "utils"), dst=binpath) + + os.chmod(os.path.join(binpath, "waf"), 0o755) + os.chmod(os.path.join(binpath, "waf-light"), 0o755) + + def package_info(self): + self.cpp_info.libdirs = [] + + binpath = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH env var: {}".format(binpath)) + self.env_info.PATH.append(binpath) + + wafdir = os.path.join(self.package_folder, "lib") + self.output.info("Setting WAFDIR env var: {}".format(wafdir)) + self.env_info.WAFDIR = wafdir + + diff --git a/recipes/waf/all/test_package/a.cpp b/recipes/waf/all/test_package/a.cpp new file mode 100644 index 0000000000000..18e12e517db39 --- /dev/null +++ b/recipes/waf/all/test_package/a.cpp @@ -0,0 +1,11 @@ +#ifdef _MSC_VER +# define testshlib_EXPORT __declspec(dllexport) +#else +# define testshlib_EXPORT +#endif + +extern testshlib_EXPORT void foo(); + +static const int truc=5; + +void foo() { } diff --git a/recipes/waf/all/test_package/b.cpp b/recipes/waf/all/test_package/b.cpp new file mode 100644 index 0000000000000..1e09a10f764d4 --- /dev/null +++ b/recipes/waf/all/test_package/b.cpp @@ -0,0 +1 @@ +int u = 64; diff --git a/recipes/waf/all/test_package/conanfile.py b/recipes/waf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9d956eec26829 --- /dev/null +++ b/recipes/waf/all/test_package/conanfile.py @@ -0,0 +1,42 @@ +from conans import ConanFile, tools +from contextlib import contextmanager +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "a.cpp", "b.cpp", "main.c", "main.cpp", "wscript" + + def build(self): + if tools.cross_building(self.settings): + return + + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + waf_path = tools.which("waf") + if waf_path: + waf_path = waf_path.replace("\\", "/") + assert waf_path.startswith(str(self.deps_cpp_info["waf"].rootpath)) + + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + self.run("waf -h") + self.run("waf configure") + self.run("waf") + + @contextmanager + def _add_ld_search_path(self): + env = {} + if self.settings.os == "Linux": + env["LD_LIBRARY_PATH"] = [os.path.join(os.getcwd(), "build")] + elif self.settings.os == "Macos": + env["DYLD_LIBRARY_PATH"] = [os.path.join(os.getcwd(), "build")] + with tools.environment_append(env): + yield + + def test(self): + if not tools.cross_building(self.settings): + with self._add_ld_search_path(): + self.run(os.path.join("build", "app"), run_environment=True) + self.run(os.path.join("build", "app2"), run_environment=True) diff --git a/recipes/waf/all/test_package/main.c b/recipes/waf/all/test_package/main.c new file mode 100644 index 0000000000000..cb3f7482fa46d --- /dev/null +++ b/recipes/waf/all/test_package/main.c @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/recipes/waf/all/test_package/main.cpp b/recipes/waf/all/test_package/main.cpp new file mode 100644 index 0000000000000..dacbb25b8b045 --- /dev/null +++ b/recipes/waf/all/test_package/main.cpp @@ -0,0 +1,8 @@ +#include + +extern void foo(); + +int main() { + foo(); + return 0; +} diff --git a/recipes/waf/all/test_package/wscript b/recipes/waf/all/test_package/wscript new file mode 100644 index 0000000000000..27c624f3b46cb --- /dev/null +++ b/recipes/waf/all/test_package/wscript @@ -0,0 +1,36 @@ +#! /usr/bin/env python +# encoding: utf-8 +# Thomas Nagy, 2006-2010 (ita) + +# https://gitlab.com/ita1024/waf/-/tree/master/demos/c++ + +# the following two variables are used by the target "waf dist" +VERSION='0.0.1' +APPNAME='cxx_test' + +# these variables are mandatory ('/' are converted automatically) +top = '.' +out = 'build' + +def options(opt): + opt.load('compiler_cxx') + +def configure(conf): + conf.load('compiler_cxx') + conf.check(header_name='stdio.h', features='cxx cxxprogram', mandatory=False) + +def build(bld): + bld.shlib(source='a.cpp', target='mylib', vnum='9.8.7') + bld.shlib(source='a.cpp', target='mylib2', vnum='9.8.7', cnum='9.8') + bld.shlib(source='a.cpp', target='mylib3') + bld.program(source='main.cpp', target='app', use='mylib') + bld.stlib(target='foo', source='b.cpp') + + # just a test to check if the .c is compiled as c++ when no c compiler is found + bld.program(features='cxx cxxprogram', source='main.c', target='app2') + + if bld.cmd != 'clean': + from waflib import Logs + bld.logger = Logs.make_logger('test.log', 'build') # just to get a clean output + bld.check(header_name='sadlib.h', features='cxx cxxprogram', mandatory=False) + bld.logger = None diff --git a/recipes/waf/config.yml b/recipes/waf/config.yml new file mode 100644 index 0000000000000..e3883114dd1bb --- /dev/null +++ b/recipes/waf/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.19": + folder: all diff --git a/recipes/wasmedge/all/conandata.yml b/recipes/wasmedge/all/conandata.yml new file mode 100644 index 0000000000000..363797364db78 --- /dev/null +++ b/recipes/wasmedge/all/conandata.yml @@ -0,0 +1,153 @@ +sources: + "0.11.2": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-windows.zip" + sha256: "ca49b98c0cf5f187e08c3ba71afc8d71365fde696f10b4219379a4a4d1a91e6d" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-manylinux2014_x86_64.tar.gz" + sha256: "784bf1eb25928e2cf02aa88e9372388fad682b4a188485da3cd9162caeedf143" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-manylinux2014_aarch64.tar.gz" + sha256: "a2766a4c1edbaea298a30e5431a4e795003a10d8398a933d923f23d4eb4fa5d1" + - 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.11.2/WasmEdge-0.11.2-darwin_x86_64.tar.gz" + sha256: "aedec53f29b1e0b657e46e67dba3e2f32a2924f4d9136e60073ea1aba3073e70" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-darwin_arm64.tar.gz" + sha256: "fe391df90e1eee69cf1e976f5ddf60c20f29b651710aaa4fc03e2ab4fe52c0d3" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-android_aarch64.tar.gz" + sha256: "69e308f5927c753b2bb5639569d10219b60598174d8b304bdf310093fd7b2464" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "0.11.1": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-windows.zip" + sha256: "c86f6384555a0484a5dd81faba5636bba78f5e3d6eaf627d880e34843f9e24bf" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-manylinux2014_x86_64.tar.gz" + sha256: "76ce4ea0eb86adfa52c73f6c6b44383626d94990e0923cae8b1e6f060ef2bf5b" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-manylinux2014_aarch64.tar.gz" + sha256: "cb9ea32932360463991cfda80e09879b2cf6c69737f12f3f2b371cd0af4e9ce8" + - 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.11.1/WasmEdge-0.11.1-darwin_x86_64.tar.gz" + sha256: "56df2b00669c25b8143ea2c17370256cd6a33f3b316d3b47857dd38d603cb69a" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-darwin_arm64.tar.gz" + sha256: "82f7da1a7a36ec1923fb045193784dd090a03109e84da042af97297205a71f08" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-android_aarch64.tar.gz" + sha256: "af8694e93bf72ac5506450d4caebccc340fbba254dca3d58ec0712e96ec9dedd" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "0.10.0": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.10.0/WasmEdge-0.10.0-windows.zip" + sha256: "63b8a02cced52a723aa283dba02bbe887656256ecca69bb0fff17872c0fb5ebc" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.10.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.10.0/WasmEdge-0.10.0-manylinux2014_x86_64.tar.gz" + sha256: "4c1ffca9fd8cbdeb8f0951ddaffbbefe81ae123d5b80f61e80ea8d9b56853cde" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.10.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.10.0/WasmEdge-0.10.0-manylinux2014_aarch64.tar.gz" + sha256: "c000bf96d0a73a1d360659246c0806c2ce78620b6f78c1147fbf9e2be0280bd9" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.10.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "0.9.1": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.1/WasmEdge-0.9.1-windows.zip" + sha256: "68240d8aee23d44db5cc252d8c1cf5d0c77ab709a122af2747a4b836ba461671" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.1/WasmEdge-0.9.1-manylinux2014_x86_64.tar.gz" + sha256: "bcb6fe3d6e30db0d0aa267ec3bd9b7248f8c8c387620cef4049d682d293c8371" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.1/WasmEdge-0.9.1-manylinux2014_aarch64.tar.gz" + sha256: "515bcac3520cd546d9d14372b7930ab48b43f1c5dc258a9f61a82b22c0107eef" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "0.9.0": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.0/WasmEdge-0.9.0-windows.zip" + sha256: "f81bfea4cf09053510e3e74c16c1ee010fc93def8a7e78744443b950f0011c3b" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.0/WasmEdge-0.9.0-manylinux2014_x86_64.tar.gz" + sha256: "27847f15e4294e707486458e857d7cb11806481bb67a26f076a717a1446827ed" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.0/WasmEdge-0.9.0-manylinux2014_aarch64.tar.gz" + sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Macos: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.9.0/WasmEdge-0.9.0-darwin_arm64.tar.gz" + sha256: "236a407a646f746ab78a1d0a39fa4e85fe28eae219b1635ba49f908d7944686d" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.9.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" diff --git a/recipes/wasmedge/all/conanfile.py b/recipes/wasmedge/all/conanfile.py new file mode 100644 index 0000000000000..22d9509121432 --- /dev/null +++ b/recipes/wasmedge/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.tools.files import get, copy, download +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.47.0" + +class WasmedgeConan(ConanFile): + name = "wasmedge" + description = ("WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime" + "for cloud native, edge, and decentralized applications." + "It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.") + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/WasmEdge/WasmEdge/" + topics = ("webassembly", "wasm", "wasi", "emscripten") + settings = "os", "arch", "compiler", "build_type" + + @property + def _compiler_alias(self): + return { + "Visual Studio": "Visual Studio", + "msvc": "Visual Studio", + }.get(str(self.settings.compiler), "gcc") + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + try: + self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias] + except KeyError: + raise ConanInvalidConfiguration("Binaries for this combination of version/os/arch/compiler are not available") + + def package_id(self): + del self.info.settings.compiler.version + self.info.settings.compiler = self._compiler_alias + + def source(self): + # This is packaging binaries so the download needs to be in build + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][0], + destination=self.source_folder, strip_root=True) + download(self, filename="LICENSE", + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][1]) + + def package(self): + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), keep_path=True) + copy(self, pattern="*.inc", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), keep_path=True) + + srclibdir = os.path.join(self.source_folder, "lib64" if self.settings.os == "Linux" else "lib") + srcbindir = os.path.join(self.source_folder, "bin") + dstlibdir = os.path.join(self.package_folder, "lib") + dstbindir = os.path.join(self.package_folder, "bin") + if Version(self.version) >= "0.11.1": + copy(self, pattern="wasmedge.lib", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="wasmedge.dll", src=srcbindir, dst=dstbindir, keep_path=False) + copy(self, pattern="libwasmedge.so*", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="libwasmedge*.dylib", src=srclibdir, dst=dstlibdir, keep_path=False) + else: + copy(self, pattern="wasmedge_c.lib", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="wasmedge_c.dll", src=srcbindir, dst=dstbindir, keep_path=False) + copy(self, pattern="libwasmedge_c.so*", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="libwasmedge_c*.dylib", src=srclibdir, dst=dstlibdir, keep_path=False) + + copy(self, pattern="wasmedge*", src=srcbindir, dst=dstbindir, keep_path=False) + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + + def package_info(self): + if Version(self.version) >= "0.11.1": + self.cpp_info.libs = ["wasmedge"] + else: + self.cpp_info.libs = ["wasmedge_c"] + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + self.cpp_info.system_libs.append("wsock32") + self.cpp_info.system_libs.append("shlwapi") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("rt") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/wasmedge/all/test_package/CMakeLists.txt b/recipes/wasmedge/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a433b073bf6ea --- /dev/null +++ b/recipes/wasmedge/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +find_package(wasmedge REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wasmedge::wasmedge) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/wasmedge/all/test_package/conanfile.py b/recipes/wasmedge/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/wasmedge/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/wasmedge/all/test_package/test_package.c b/recipes/wasmedge/all/test_package/test_package.c new file mode 100644 index 0000000000000..4fd31cc4ce7bd --- /dev/null +++ b/recipes/wasmedge/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include + +int main() { + WasmEdge_ConfigureContext *ConfCxt = WasmEdge_ConfigureCreate(); + WasmEdge_ConfigureAddHostRegistration(ConfCxt, WasmEdge_HostRegistration_Wasi); + WasmEdge_VMContext *VMCxt = WasmEdge_VMCreate(ConfCxt, NULL); + + WasmEdge_String FuncName = WasmEdge_StringCreateByCString("fib"); + + WasmEdge_VMDelete(VMCxt); + WasmEdge_ConfigureDelete(ConfCxt); + WasmEdge_StringDelete(FuncName); + + return EXIT_SUCCESS; +} diff --git a/recipes/wasmedge/all/test_v1_package/CMakeLists.txt b/recipes/wasmedge/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wasmedge/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wasmedge/all/test_v1_package/conanfile.py b/recipes/wasmedge/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wasmedge/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wasmedge/config.yml b/recipes/wasmedge/config.yml new file mode 100644 index 0000000000000..26c6ed136a298 --- /dev/null +++ b/recipes/wasmedge/config.yml @@ -0,0 +1,11 @@ +versions: + "0.11.2": + folder: "all" + "0.11.1": + folder: "all" + "0.10.0": + folder: "all" + "0.9.1": + folder: "all" + "0.9.0": + folder: "all" diff --git a/recipes/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml new file mode 100644 index 0000000000000..7b9c9649cb8d8 --- /dev/null +++ b/recipes/wasmer/all/conandata.yml @@ -0,0 +1,115 @@ +sources: + "3.1.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-windows-amd64.tar.gz" + sha256: "6f49be0023571f9d4edab36c4acdd449c3a03da483c1f4412fbfcc98fe455dce" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-windows-gnu64.tar.gz" + sha256: "6dec33b2dbadde24b2ec1219f8e65588020dfc79de48a0e3f1ab130be6883760" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-linux-amd64.tar.gz" + sha256: "c22116e42a51bf0646c55c43337a137b3edd0da2f23a8b7eeba8f4acbae9a1c4" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-linux-aarch64.tar.gz" + sha256: "37af1383f19c0470a2454f8e3901eab91ea8439a81d8af4eb2ba81966130b4dd" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-darwin-amd64.tar.gz" + sha256: "a8415fadf7de329a6444879e02f746c1ce793cbfbbc77907b447a00aacc35d34" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-darwin-arm64.tar.gz" + sha256: "737877b59d702b853a3f70632ea90d884dc8e616c2076492337c6ef81e1d3026" + "3.0.2": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.0.2/wasmer-windows-amd64.tar.gz" + sha256: "f8ecb5aa78e2f9c3b734dbbcfe05be51ad33fd99e0b9684d1531ad2d663306af" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.0.2/wasmer-windows-gnu64.tar.gz" + sha256: "a59377cf710d330d47b81bbdeaa0bc18bae16196fb9e2d2251d9f4535d6d9ee5" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.0.2/wasmer-linux-amd64.tar.gz" + sha256: "3567d46a1832b0d3672e2ead4ca088e8fa27f8730407af7bc72350d54da38950" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.0.2/wasmer-linux-aarch64.tar.gz" + sha256: "90bd5b6610fa225ee0c7ec25ef3fdcde39bbab00cf42a6dddb544ee361ee4108" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.0.2/wasmer-darwin-amd64.tar.gz" + sha256: "44a858dab2ac74c464f3a2fc80bb6958125a9b4611199f83a5d4bf20e021b6d9" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.0.2/wasmer-darwin-arm64.tar.gz" + sha256: "70e63ab808e502527e7e36f03f98bc4debb7d532b6093292f4cb50f9b3a3dfae" + "2.3.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/2.3.0/wasmer-windows-amd64.tar.gz" + sha256: "9b0b9eac25dfd3cd59358bc82a9f793a9ac991a11844d4ffc3ff898831d118bd" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.3.0/wasmer-linux-amd64.tar.gz" + sha256: "79a90eb91d9852f7e2fc3d7c684c593af53edc7cb11512002c25cedc076971c7" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.3.0/wasmer-darwin-amd64.tar.gz" + sha256: "9962ec9466d5604f7f4d6538c363343d0ee676174ec6ab993a5c9cf10a4bbab3" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.3.0/wasmer-darwin-arm64.tar.gz" + sha256: "e394c3f27ea08ac94401d6c3c49ec9eaafc53a42624fc3b6966a53c865aca46a" + "2.2.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/2.2.0/wasmer-windows-amd64.tar.gz" + sha256: "e931e729d6bbe99fe5d9b0ce003bebe134ae94d7c6855a8287134b49e1a6f69f" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.2.0/wasmer-linux-amd64.tar.gz" + sha256: "d65d5fbcd804ff5eef3ace4eb35e51138e0193d84b46b20f526e905d4a2b3ce0" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.2.0/wasmer-darwin-amd64.tar.gz" + sha256: "cc56264c3b545fc7144dcc85edbfa9d8c292aeac0252398e8179f4acddff1cf5" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.2.0/wasmer-darwin-arm64.tar.gz" + sha256: "1d96e101df13c23c36af563f2fa8ef3f8c880977b328131af9fcdf6a1ff06c17" + "2.1.1": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/2.1.1/wasmer-windows-amd64.tar.gz" + sha256: "8d2264621fb172e9085b13c94e79f97b175aec2046ad64e1575259535bd691b3" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.1.1/wasmer-linux-amd64.tar.gz" + sha256: "b9aaa5546d2d86b63f19a4194a1bebc04c785978390e4b28703fcf8a20d73ead" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.1.1/wasmer-darwin-amd64.tar.gz" + sha256: "9affa419f9b4416acf128c549e54ec3c1868f3c3504055e9796396edf4421893" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/2.1.1/wasmer-darwin-arm64.tar.gz" + sha256: "e1a1f669bc75a2661221f52450cfb127570843313392e6f2a8ab34b946d3b870" diff --git a/recipes/wasmer/all/conanfile.py b/recipes/wasmer/all/conanfile.py new file mode 100644 index 0000000000000..9db5f12cf18fe --- /dev/null +++ b/recipes/wasmer/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, copy, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class WasmerConan(ConanFile): + name = "wasmer" + description = "The leading WebAssembly Runtime supporting WASI and Emscripten" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wasmerio/wasmer/" + topics = ("webassembly", "wasm", "wasi", "emscripten") + settings = "os", "arch", "compiler" + options = { + "shared": [True, False], + } + default_options = { + "shared": False, + } + + @property + def _compiler_alias(self): + return { + "Visual Studio": "Visual Studio", + "msvc": "Visual Studio", + }.get(str(self.settings.compiler), "gcc") + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if is_msvc(self) and self.options.shared: + del self.settings.compiler.runtime + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + try: + self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias] + except KeyError: + raise ConanInvalidConfiguration("Binaries for this combination of version/os/arch/compiler are not available") + + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Shared Windows build of wasmer are non-working atm (no import libraries are available)") + + if self.settings.os == "Linux" and self.options.shared and "2.3.0" <= Version(self.version): + raise ConanInvalidConfiguration("Shared Linux build of wasmer are not working. It requires glibc >= 2.25") + + if is_msvc(self) and not self.options.shared and self.settings.compiler.runtime != "MT": + raise ConanInvalidConfiguration("wasmer is only available with compiler.runtime=MT") + + def package_id(self): + del self.info.settings.compiler.version + self.info.settings.compiler = self._compiler_alias + + def source(self): + get( + self, + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias], destination=self.source_folder + ) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + self.copy("*.h", src=os.path.join(self.source_folder, "include"), dst="include", keep_path=False) + + srclibdir = os.path.join(self.source_folder, "lib") + dstlibdir = os.path.join(self.package_folder, "lib") + dstbindir = os.path.join(self.package_folder, "bin") + if self.options.shared: + self.copy("wasmer.dll.lib", src=srclibdir, dst=dstlibdir, keep_path=False) # FIXME: not available (yet) + self.copy("wasmer.dll", src=srclibdir, dst=dstbindir, keep_path=False) + self.copy("libwasmer.so*", src=srclibdir, dst=dstlibdir, keep_path=False) + self.copy("libwasmer.dylib", src=srclibdir, dst=dstlibdir, keep_path=False) + else: + self.copy("wasmer.lib", src=srclibdir, dst=dstlibdir, keep_path=False) + self.copy("libwasmer.a", src=srclibdir, dst=dstlibdir, keep_path=False) + replace_in_file(self, os.path.join(self.package_folder, "include", "wasm.h"), + "__declspec(dllimport)", "") + + def package_info(self): + self.cpp_info.libs = ["wasmer"] + if not self.options.shared: + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread", "dl", "m"] + if Version(self.version) >= "2.3.0": + self.cpp_info.system_libs.append("rt") + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["bcrypt", "userenv", "ws2_32"] diff --git a/recipes/wasmer/all/test_package/CMakeLists.txt b/recipes/wasmer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bf0cebf3a9ba7 --- /dev/null +++ b/recipes/wasmer/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(wasmer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wasmer::wasmer) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/wasmer/all/test_package/conanfile.py b/recipes/wasmer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/wasmer/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wasmer/all/test_package/test_package.c b/recipes/wasmer/all/test_package/test_package.c new file mode 100644 index 0000000000000..87208782ba982 --- /dev/null +++ b/recipes/wasmer/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include "wasmer.h" + +#include +#include + +int main() { + wasm_engine_t* engine = wasm_engine_new(); + + if (engine == NULL) { + fprintf(stderr, "wasm_engine_new failed\n"); + return EXIT_FAILURE; + } + wasm_engine_delete(engine); + return EXIT_SUCCESS; +} diff --git a/recipes/wasmer/all/test_v1_package/CMakeLists.txt b/recipes/wasmer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wasmer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wasmer/all/test_v1_package/conanfile.py b/recipes/wasmer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wasmer/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml new file mode 100644 index 0000000000000..e0d445f36bd33 --- /dev/null +++ b/recipes/wasmer/config.yml @@ -0,0 +1,11 @@ +versions: + "3.1.0": + folder: "all" + "3.0.2": + folder: "all" + "2.3.0": + folder: "all" + "2.2.0": + folder: "all" + "2.1.1": + folder: "all" diff --git a/recipes/wasmtime-cpp/all/conandata.yml b/recipes/wasmtime-cpp/all/conandata.yml new file mode 100644 index 0000000000000..cc2a691b8c6c2 --- /dev/null +++ b/recipes/wasmtime-cpp/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "7.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v7.0.0.tar.gz" + sha256: "967df644901d9ade1568a9dcfd5f30a63ba44f8125a399842d192e258dbb7684" + "6.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v6.0.0.tar.gz" + sha256: "60907d4fcdb3dfbd3e36f75bb17b050662a1fc574c85b7341371426c372e75b4" + "5.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v5.0.0.tar.gz" + sha256: "071ab8f01eb52760e584b711c76630b491e7516672188bb51f696ae45c08e0cc" + "3.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v3.0.0.tar.gz" + sha256: "9840637cc3040f924db1caf957b883efcfa4ad9d92a86245cc0fd3967ea3db09" + "2.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v2.0.0.tar.gz" + sha256: "27dcf8fbbc8dbe0387bde2d38e9d78a829b649a0bf86750c5d2a1327a5971b18" + "1.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "246e1d7f8f7f61170296d68c6f44ba53232d1549807633da366ca70b19089a7a" + "0.39.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v0.39.0.tar.gz" + sha256: "b0b2d4c629d341078f8157a39c3101f9dcd84c643ddb7b25f843ed84eae281ea" + "0.38.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v0.38.0.tar.gz" + sha256: "67bf9cc72e8abaa4ec0011efa7aab7187c5588491f474c95e90c708b1a620931" + "0.37.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v0.37.0.tar.gz" + sha256: "c731429649fc0d77d69f9a19386d1e47f22a92e316b2d927bc3c76f50c478a3a" + "0.36.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v0.36.0.tar.gz" + sha256: "d06a47d338de920508f648d8c2d49c55c5d6291c481c21fa0620ff3b9decefbb" + "0.35.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v0.35.0.tar.gz" + sha256: "af14d8f8f2922788d3d5e533c82b5ac86637e318c9a2fd2dc4fc42a147f89831" diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py new file mode 100644 index 0000000000000..70992503d1ca8 --- /dev/null +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class WasmtimeCppConan(ConanFile): + name = 'wasmtime-cpp' + description = "Standalone JIT-style runtime for WebAssembly, using Cranelift" + license = 'Apache-2.0' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'https://github.com/bytecodealliance/wasmtime-cpp' + topics = ("webassembly", "wasm", "wasi", "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": "16", + "msvc": "192", + "apple-clang": "12", + "clang": "12", + "gcc": "10" + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + version = str(self.version) + version_map = { + "0.35.0": "0.35.1", + "0.39.0": "0.39.1", + "1.0.0": "1.0.1", + "6.0.0": "6.0.1", + } + self.requires(f"wasmtime/{version_map.get(version, version)}") + + 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="*.hh", + 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/wasmtime-cpp/all/test_package/CMakeLists.txt b/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a815c3edc0b1a --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(wasmtime-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wasmtime-cpp::wasmtime-cpp) +target_compile_definitions(${PROJECT_NAME} PRIVATE WASMTIME_EXAMPLES_PATH="${CMAKE_CURRENT_SOURCE_DIR}") +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_EXTENSIONS OFF +) diff --git a/recipes/wasmtime-cpp/all/test_package/conanfile.py b/recipes/wasmtime-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wasmtime-cpp/all/test_package/hello.wat b/recipes/wasmtime-cpp/all/test_package/hello.wat new file mode 100644 index 0000000000000..1c56c55822277 --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_package/hello.wat @@ -0,0 +1,4 @@ +(module + (func $hello (import "" "hello")) + (func (export "run") (call $hello)) +) diff --git a/recipes/wasmtime-cpp/all/test_package/test_package.cpp b/recipes/wasmtime-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8390aafdd72a8 --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_package/test_package.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include + +using namespace wasmtime; + +std::string readFile(const char* name) { + std::ifstream watFile; + watFile.open(name); + std::stringstream strStream; + strStream << watFile.rdbuf(); + return strStream.str(); +} + +int main() { + // First the wasm module needs to be compiled. This is done with a global + // "compilation environment" within an `Engine`. Note that engines can be + // further configured through `Config` if desired instead of using the + // default like this is here. + std::cout << "Compiling module\n"; + Engine engine; + auto module = Module::compile(engine, readFile(WASMTIME_EXAMPLES_PATH"/hello.wat")).unwrap(); + + // After a module is compiled we create a `Store` which will contain + // instantiated modules and other items like host functions. A Store + // contains an arbitrary piece of host information, and we use `MyState` + // here. + std::cout << "Initializing...\n"; + Store store(engine); + + // Our wasm module we'll be instantiating requires one imported function. + // the function takes no parameters and returns no results. We create a host + // implementation of that function here, and the `caller` parameter here is + // used to get access to our original `MyState` value. + std::cout << "Creating callback...\n"; + FuncType ty({}, {}); + Func host_func(store, ty, [](auto caller, auto args, auto results) -> auto { + std::cout << "Calling back...\n"; + static_cast(caller); + static_cast(args); + static_cast(results); + return std::monostate(); + }); + + // Once we've got that all set up we can then move to the instantiation + // phase, pairing together a compiled module as well as a set of imports. + // Note that this is where the wasm `start` function, if any, would run. + std::cout << "Instantiating module...\n"; + auto instance = Instance::create(store, module, {host_func}).unwrap(); + + // Next we poke around a bit to extract the `run` function from the module. + std::cout << "Extracting export...\n"; + auto run = std::get(*instance.get(store, "run")); + + // And last but not least we can call it! + std::cout << "Calling export...\n"; + run.call(store, {}).unwrap(); + + std::cout << "Done\n"; +} diff --git a/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt b/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/wasmtime-cpp/all/test_v1_package/conanfile.py b/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wasmtime-cpp/config.yml b/recipes/wasmtime-cpp/config.yml new file mode 100644 index 0000000000000..12bb2cdba162c --- /dev/null +++ b/recipes/wasmtime-cpp/config.yml @@ -0,0 +1,23 @@ +versions: + "7.0.0": + folder: all + "6.0.0": + folder: all + "5.0.0": + folder: all + "3.0.0": + folder: all + "2.0.0": + folder: all + "1.0.0": + folder: all + "0.39.0": + folder: all + "0.38.0": + folder: all + "0.37.0": + folder: all + "0.36.0": + folder: all + "0.35.0": + folder: all diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml new file mode 100644 index 0000000000000..bad0047d04374 --- /dev/null +++ b/recipes/wasmtime/all/conandata.yml @@ -0,0 +1,355 @@ +sources: + "7.0.0": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-windows-c-api.zip" + sha256: "d09f31a8dcc6d38ac442a3b1d653137d5814cddad006b5e38151bbc4a9b9d692" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-mingw-c-api.zip" + sha256: "1198d705bae1d09df15b8ae194d54dfd11bd90e2cc6fbb9aa13a7b000bd24ba9" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-linux-c-api.tar.xz" + sha256: "cc9b137c0fddeb57a2d439fb8ad57e224a51e0e949cd8ea3fb4a6ee8bb1085d2" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-linux-c-api.tar.xz" + sha256: "47a5fcad64a0e223cf1796eafd0fc9ca62c8b3e457942695397feb56382d3db1" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-s390x-linux-c-api.tar.xz" + sha256: "18d32031a731e9f7d9dfdc9e75ac8210f88321b4c99b21e24bed6a25ba6cf0ca" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-macos-c-api.tar.xz" + sha256: "b2b9dd2a200e93889ce2bff637aacbc8c40dae9903fb30eda20ed52fd4ca83a4" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-macos-c-api.tar.xz" + sha256: "88bc1c36665d230206130a9d194b11b907438c86224ed184f2bee8ef348cf193" + Android: + "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" + "0.38.0": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-windows-c-api.zip" + sha256: "69b28fe9a89451e4561c628341c960c08d369caecfc319650660586dcf8c0c61" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-mingw-c-api.zip" + sha256: "926177b45afe208e64011a2cb68dc73e064c25391269982ca74678eeade30faf" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-linux-c-api.tar.xz" + sha256: "a4dfe18391feb807ae9c219734bc084ff11c1f2f26762dfb5252f5299cee434e" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" + sha256: "01dd81ac4eeff128ff762b6f2e61336b723a78b940006cd405f135e509046c4e" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-s390x-linux-c-api.tar.xz" + sha256: "552c991ab894fa250a5be296befb1c9f44c115de760ffe80b9ddf430f3e30ec0" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-macos-c-api.tar.xz" + sha256: "651c41d4de8958caf80086bab46d0f326bbfa0f328f544a632df52b050f2776c" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-macos-c-api.tar.xz" + sha256: "1e424122c73418c972287043a50555569afb09dc721fb6630503bf455cbd2856" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" + sha256: "01dd81ac4eeff128ff762b6f2e61336b723a78b940006cd405f135e509046c4e" + "0.37.0": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-windows-c-api.zip" + sha256: "1e2db8ccb86d2da0607aca783bb3c929562e4fa688a94452dffa745867494a2d" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-mingw-c-api.zip" + sha256: "62966da16277aaf3312525c1e5ce08202d56c8450855bfaf7b319ffa4355fd52" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-linux-c-api.tar.xz" + sha256: "7b8de351808eb4dd3186bcc18b8f54d6c486ec1f21961521be49d02d38833696" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" + sha256: "926c4736cc79835f880f5b6f193891960a4fc32464ca00871ffd7228605387d9" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-s390x-linux-c-api.tar.xz" + sha256: "cdcefd0394cfaefdac9eba9417016c7a916a063f567b483d6df09b883d9b5976" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-macos-c-api.tar.xz" + sha256: "0f785932fc69105dcecbb2d7c1ceb0cd63dffa5e4b0b3f198c4c56118bdb4ecd" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-macos-c-api.tar.xz" + sha256: "0a0f5fd2283f52b3ab725650a5dfc77a8bf53de962344fabc37418af9e5e407a" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" + sha256: "926c4736cc79835f880f5b6f193891960a4fc32464ca00871ffd7228605387d9" + "0.36.0": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-windows-c-api.zip" + sha256: "7c0cc05d73b376bce31964c99720cecd9f595fc4a338e4a45bbc04cca5780508" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-mingw-c-api.zip" + sha256: "c4a6d3f0e428f3c912bef930c2d332fe09939b01b59f37a16ec6f4f7a89119e4" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-linux-c-api.tar.xz" + sha256: "c82c9fd1449a4a78710b8ada47db7386edb1caafcb8baa7cdedb79539fedb372" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-aarch64-linux-c-api.tar.xz" + sha256: "865e73764fca8552734eea72d990d32a670e8e7079f8fc5f15d70cb03ef3c8d9" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-s390x-linux-c-api.tar.xz" + sha256: "ec36bacf5b24b9da5ef1cdc979caf224412146d683ed6021f3bbd75adcb3754e" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-macos-c-api.tar.xz" + sha256: "8a97dfce791d9ad0acb346cdd6aa8f0f9ca85a94aa4c456ac9534c1994867dbf" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-aarch64-linux-c-api.tar.xz" + sha256: "865e73764fca8552734eea72d990d32a670e8e7079f8fc5f15d70cb03ef3c8d9" + "0.35.1": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-windows-c-api.zip" + sha256: "055d0fead69eaf906bb68dd758fe4d59ee3638888503832142857f35feaba782" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-mingw-c-api.zip" + sha256: "aee0f5f58915921191c4f9defda1a7172c6ca76c95e8d562e4cbefc5f0e1fff0" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-linux-c-api.tar.xz" + sha256: "dd6ec4a87eed1a34ad386ca950ef01a7e9300b713beb38da8e51dd3f92ece002" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-aarch64-linux-c-api.tar.xz" + sha256: "8e263a62919a8dc8a7789abe3cfc69bdc0d6ea14b0cabee7a988bac250436785" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-s390x-linux-c-api.tar.xz" + sha256: "ed84e8b4c10c22ee5de3908aa006884bc1c38122e4a020cb9d91d86ed597d8a4" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-macos-c-api.tar.xz" + sha256: "e32b46a537cf4311435477336cbcd30d68099097963b55c62ec5c12834326560" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-aarch64-linux-c-api.tar.xz" + sha256: "8e263a62919a8dc8a7789abe3cfc69bdc0d6ea14b0cabee7a988bac250436785" diff --git a/recipes/wasmtime/all/conanfile.py b/recipes/wasmtime/all/conanfile.py new file mode 100644 index 0000000000000..1ceb2e856e777 --- /dev/null +++ b/recipes/wasmtime/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc + +import os + +required_conan_version = ">=1.47.0" + + +class WasmtimeConan(ConanFile): + name = "wasmtime" + description = "Standalone JIT-style runtime for WebAssembly, using Cranelift" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bytecodealliance/wasmtime" + topics = ("webassembly", "wasm", "wasi") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + } + default_options = { + "shared": False, + } + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 11 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "190", + "apple-clang": "9.4", + "clang": "3.3", + "gcc": "5.1", + } + + @property + def _sources_os_key(self): + if is_msvc(self): + return "Windows" + elif self.settings.os == "Windows" and self.settings.compiler == "gcc": + return "MinGW" + return str(self.settings.os) + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def package_id(self): + del self.info.settings.compiler.version + if self.info.settings.compiler == "clang": + self.info.settings.compiler = "gcc" + + def validate(self): + compiler = self.settings.compiler + min_version = self._minimum_compilers_version[str(compiler)] + try: + if Version(compiler.version) < min_version: + msg = ( + f"{self.name} requires C{self._minimum_cpp_standard} features " + f"which are not supported by compiler {compiler} {compiler.version} !!" + ) + raise ConanInvalidConfiguration(msg) + except KeyError: + msg = ( + f"{self.name} recipe lacks information about the {compiler} compiler, " + f"support for the required C{self._minimum_cpp_standard} features is assumed" + ) + self.output.warn(msg) + + try: + self.conan_data["sources"][self.version][self._sources_os_key][str(self.settings.arch)] + except KeyError: + raise ConanInvalidConfiguration("Binaries for this combination of architecture/version/os are not available") + + def build(self): + # This is packaging binaries so the download needs to be in build + get(self, **self.conan_data["sources"][self.version][self._sources_os_key][str(self.settings.arch)], + destination=self.build_folder, strip_root=True) + + def package(self): + 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.build_folder, "lib") + dstlibdir = os.path.join(self.package_folder, "lib") + dstbindir = os.path.join(self.package_folder, "bin") + if self.options.shared: + copy(self, "wasmtime.dll.lib", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "wasmtime.dll", dst=dstbindir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.dll.a", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.so*", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.dylib", dst=dstlibdir, src=srclibdir, keep_path=False) + else: + copy(self, "wasmtime.lib", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.a", dst=dstlibdir, src=srclibdir, keep_path=False) + + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.build_folder) + + def package_info(self): + if self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.libs = ["wasmtime.dll"] + else: + self.cpp_info.libs = ["wasmtime"] + else: + if self.settings.os == "Windows": + self.cpp_info.defines = ["WASM_API_EXTERN=", "WASI_API_EXTERN="] + self.cpp_info.libs = ["wasmtime"] + + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "bcrypt", "advapi32", "userenv", "ntdll", "shell32", "ole32"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "dl", "m", "rt"] diff --git a/recipes/wasmtime/all/test_package/CMakeLists.txt b/recipes/wasmtime/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ed94adafb8e8 --- /dev/null +++ b/recipes/wasmtime/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES C) + +find_package(wasmtime REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wasmtime::wasmtime) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/wasmtime/all/test_package/conanfile.py b/recipes/wasmtime/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/wasmtime/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wasmtime/all/test_package/test_package.c b/recipes/wasmtime/all/test_package/test_package.c new file mode 100644 index 0000000000000..6bdd4261d1246 --- /dev/null +++ b/recipes/wasmtime/all/test_package/test_package.c @@ -0,0 +1,35 @@ +#include + +#include +#include +#include + +int main() { + char *wat = "(module\n" + "\t(func (param $lhs i32) (param $rhs i32) (result i32)\n" + "\t\tlocal.get $lhs\n" + "\t\tlocal.get $rhs\n" + "\t\ti32.add))"; + wasm_byte_vec_t ret; + wasmtime_error_t *error = wasmtime_wat2wasm(wat, strlen(wat), &ret); + if (error != NULL) { + fprintf(stderr, "wasmtime_wat2wasm failed:\n"); + wasm_name_t message; + wasmtime_error_message(error, &message); + wasmtime_error_delete(error); + fprintf(stderr, "%s\n", message.data); + wasm_byte_vec_delete(&message); + return EXIT_FAILURE; + } + printf("wasm text:\n%s\n", wat); + puts("assembly:"); + for(size_t i = 0; i < ret.size; ++i) { + printf(" 0x%02x", ret.data[i]); + if (i%8 == 7) { + puts(""); + } + } + puts(""); + wasm_byte_vec_delete(&ret); + return EXIT_SUCCESS; +} diff --git a/recipes/wasmtime/all/test_v1_package/CMakeLists.txt b/recipes/wasmtime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/wasmtime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/wasmtime/all/test_v1_package/conanfile.py b/recipes/wasmtime/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wasmtime/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wasmtime/config.yml b/recipes/wasmtime/config.yml new file mode 100644 index 0000000000000..604aa079994aa --- /dev/null +++ b/recipes/wasmtime/config.yml @@ -0,0 +1,25 @@ +versions: + "7.0.0": + 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 + "0.38.0": + folder: all + "0.37.0": + folder: all + "0.36.0": + folder: all + "0.35.1": + folder: all diff --git a/recipes/watcher/all/conandata.yml b/recipes/watcher/all/conandata.yml new file mode 100644 index 0000000000000..f7df7228f93fd --- /dev/null +++ b/recipes/watcher/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "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" + "0.3.3": + url: "https://github.com/e-dant/watcher/archive/release/0.3.3.tar.gz" + sha256: "1cb4a898741306bb9089bd24175bcbb2cb434531eac6bbcfe1a3679b8bf1f44c" + "0.3.2": + url: "https://github.com/e-dant/watcher/archive/release/0.3.2.tar.gz" + sha256: "f00247ad8ee492cb70143917bd19f80056227f4ebd4263015727f02750e4fbd5" + "0.3.1": + url: "https://github.com/e-dant/watcher/archive/release/0.3.1.tar.gz" + sha256: "0fa79d21ac16c96b7ca50f2563aed9d8841e5b8f139af27d0b2cf199d0d281dc" +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" + "0.3.1": + - patch_file: "patches/0.3.1-fix-include.patch" + patch_description: "add missing include headers for some compilers" + patch_type: "portability" + patch_source: "https://github.com/e-dant/watcher/pull/18" diff --git a/recipes/watcher/all/conanfile.py b/recipes/watcher/all/conanfile.py new file mode 100644 index 0000000000000..31b1acc6f5885 --- /dev/null +++ b/recipes/watcher/all/conanfile.py @@ -0,0 +1,83 @@ +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.build import check_min_cppstd +from conan.tools.apple import is_apple_os +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.49.0" + +class WatcherConan(ConanFile): + name = "watcher" + description = "Filesystem watcher. Works anywhere. Simple, efficient and friendly." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/e-dant/watcher/" + topics = ("watch", "filesystem", "event", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "13", + "apple-clang": "13.1", + "Visual Studio": "16", + "msvc": "192", + } + + 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.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if is_apple_os(self): + self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] diff --git a/recipes/watcher/all/patches/0.3.1-fix-include.patch b/recipes/watcher/all/patches/0.3.1-fix-include.patch new file mode 100644 index 0000000000000..1c3d12d2130de --- /dev/null +++ b/recipes/watcher/all/patches/0.3.1-fix-include.patch @@ -0,0 +1,12 @@ +diff --git a/include/watcher/adapter/linux/watch.hpp b/include/watcher/adapter/linux/watch.hpp +index 1b6b61a..a3e6aa9 100644 +--- a/include/watcher/adapter/linux/watch.hpp ++++ b/include/watcher/adapter/linux/watch.hpp +@@ -11,6 +11,7 @@ + + #include + #include ++#include + #include + #include + #include 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 new file mode 100644 index 0000000000000..aeed151aa95e0 --- /dev/null +++ b/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch @@ -0,0 +1,13 @@ +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/all/test_package/CMakeLists.txt b/recipes/watcher/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18f5fe387b11a --- /dev/null +++ b/recipes/watcher/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package LANGUAGES CXX) + +find_package(watcher REQUIRED CONFIG) +find_package(Threads REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE watcher::watcher Threads::Threads) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +if(watcher_VERSION VERSION_LESS "0.4.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_NAMESPACE=water) +else() + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_NAMESPACE=wtr) +endif() + +if(watcher_VERSION VERSION_GREATER_EQUAL "0.6.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_WATCH_OBJECT) +elseif(watcher_VERSION VERSION_GREATER_EQUAL "0.5.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_DIE_WITH_PATH) +endif() diff --git a/recipes/watcher/all/test_package/conanfile.py b/recipes/watcher/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2704a5edd07d6 --- /dev/null +++ b/recipes/watcher/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +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" + + 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/watcher/all/test_package/test_package.cpp b/recipes/watcher/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5324e0d9a2b54 --- /dev/null +++ b/recipes/watcher/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#include +#include +#include + +#ifdef WATCHER_WATCH_OBJECT +# include "wtr/watcher.hpp" +#else +# include "watcher/watcher.hpp" +#endif + +int main(int argc, char** argv) { + std::cout << R"({ + "water.watcher.stream":{ +)"; + + auto const show_event_json = [](const WATCHER_NAMESPACE::watcher::event::event& this_event) { + std::cout << " " << this_event; + if (this_event.kind != WATCHER_NAMESPACE::watcher::event::kind::watcher) { + std::cout << ","; + } + std::cout << "\n"; + }; + + auto const time_until_death = std::chrono::seconds(3); + +#ifdef WATCHER_WATCH_OBJECT + auto lifetime = wtr::watch(".", show_event_json); + std::this_thread::sleep_for(time_until_death); + auto const is_watch_dead = lifetime.close(); +#else + std::thread([&]() { WATCHER_NAMESPACE::watcher::watch(".", show_event_json); }).detach(); + std::this_thread::sleep_for(time_until_death); +# ifdef WATCHER_DIE_WITH_PATH + auto const is_watch_dead = WATCHER_NAMESPACE::watcher::die(".", show_event_json); +# else + auto const is_watch_dead = WATCHER_NAMESPACE::watcher::die(show_event_json); +# endif +#endif + + std::cout << " },\n" + << R"( "milliseconds":)" << time_until_death.count() << "," << std::endl + << R"( "expired":)" << std::boolalpha << is_watch_dead << "\n" + << "}" + << std::endl; + + return 0; +} diff --git a/recipes/watcher/all/test_v1_package/CMakeLists.txt b/recipes/watcher/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3154400093a96 --- /dev/null +++ b/recipes/watcher/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/watcher/all/test_v1_package/conanfile.py b/recipes/watcher/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/watcher/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/watcher/config.yml b/recipes/watcher/config.yml new file mode 100644 index 0000000000000..3d179a6711efc --- /dev/null +++ b/recipes/watcher/config.yml @@ -0,0 +1,19 @@ +versions: + "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 + "0.3.3": + folder: all + "0.3.2": + folder: all + "0.3.1": + folder: all diff --git a/recipes/wavelet_buffer/all/conandata.yml b/recipes/wavelet_buffer/all/conandata.yml new file mode 100644 index 0000000000000..fbf3768205fcc --- /dev/null +++ b/recipes/wavelet_buffer/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "0.5.0": + url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.5.0.tar.gz" + sha256: "2b1fa552f9a6e032dfd9f59bd05c049bf0cac46aced7cd42f49ff0d020cfdb50" + "0.4.0": + url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.4.0.tar.gz" + sha256: "0a30080a6d1e9e7f8947ae0c3395d3c86888900c7ae09730f8dd0ed5138daab2" +patches: + "0.5.0": + - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" + patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" + patch_type: "conan" + patch_source: "https://github.com/panda-official/WaveletBuffer/pull/49" + - patch_file: "patches/0002-0.4.0-cmake-find-jpeblib.patch" + patch_description: "Fix CMakeLists: link to jpeg lib only" + patch_type: "conan" + "0.4.0": + - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" + patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" + patch_type: "conan" + patch_source: "https://github.com/panda-official/WaveletBuffer/pull/49" + - patch_file: "patches/0002-0.4.0-cmake-find-jpeblib.patch" + patch_description: "Fix CMakeLists: link to jpeg lib only" + patch_type: "conan" diff --git a/recipes/wavelet_buffer/all/conanfile.py b/recipes/wavelet_buffer/all/conanfile.py new file mode 100644 index 0000000000000..69a04b499e31b --- /dev/null +++ b/recipes/wavelet_buffer/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class WaveletBufferConan(ConanFile): + name = "wavelet_buffer" + license = "MPL-2.0" + description = "An universal C++ compression library based on wavelet transformation" + topics = ("compression", "signal-processing", "wavelet") + homepage = "https://github.com/panda-official/WaveletBuffer" + 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], + "jpeg": ["libjpeg-turbo", "libjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "jpeg": "libjpeg-turbo", + } + + @property + def _min_cppstd(self): + return 20 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "8", + "clang": "12", + "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("blaze/3.8", transitive_headers=True) + self.requires("cimg/3.0.2") + if self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + else: + self.requires("libjpeg/9e") + # FIXME: unvendor SfCompressor which is currently downloaded at build time :s + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared with Visual Studio.") + + 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["CONAN_EXPORTED"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "wavelet_buffer") + self.cpp_info.set_property("cmake_target_name", "wavelet_buffer::wavelet_buffer") + self.cpp_info.libs = ["wavelet_buffer", "sf_compressor"] + self.cpp_info.requires = ["blaze::blaze", "cimg::cimg"] + if self.options.jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + else: + self.cpp_info.requires.append("libjpeg::libjpeg") diff --git a/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch b/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch new file mode 100644 index 0000000000000..3245b71894066 --- /dev/null +++ b/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,6 @@ else() + endif() + + find_package(blaze REQUIRED) +-find_package(OpenBLAS REQUIRED) + find_package(libjpeg-turbo REQUIRED) + find_package(cimg REQUIRED) + +@@ -122,7 +121,6 @@ target_include_directories( + # Link dependencies + target_link_libraries(${WB_TARGET_NAME} sf_compressor) + target_link_libraries(${WB_TARGET_NAME} blaze::blaze) +-target_link_libraries(${WB_TARGET_NAME} OpenBLAS::OpenBLAS) + target_link_libraries(${WB_TARGET_NAME} libjpeg-turbo::libjpeg-turbo) + target_link_libraries(${WB_TARGET_NAME} cimg::cimg) + diff --git a/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch b/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch new file mode 100644 index 0000000000000..4a17b7079fb2e --- /dev/null +++ b/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,7 @@ else() + endif() + + find_package(blaze REQUIRED) +-find_package(libjpeg-turbo REQUIRED) ++find_package(JPEG REQUIRED MODULE) + find_package(cimg REQUIRED) + + # Dependencies +@@ -121,7 +121,7 @@ target_include_directories( + # Link dependencies + target_link_libraries(${WB_TARGET_NAME} sf_compressor) + target_link_libraries(${WB_TARGET_NAME} blaze::blaze) +-target_link_libraries(${WB_TARGET_NAME} libjpeg-turbo::libjpeg-turbo) ++target_link_libraries(${WB_TARGET_NAME} JPEG::JPEG) + target_link_libraries(${WB_TARGET_NAME} cimg::cimg) + + # Catch2 installation diff --git a/recipes/wavelet_buffer/all/test_package/CMakeLists.txt b/recipes/wavelet_buffer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07b3926a7394a --- /dev/null +++ b/recipes/wavelet_buffer/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(WaveletBufferTest LANGUAGES CXX) + +find_package(wavelet_buffer CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_compile_features(test_package PRIVATE cxx_std_20) +target_link_libraries(test_package PRIVATE wavelet_buffer::wavelet_buffer) diff --git a/recipes/wavelet_buffer/all/test_package/conanfile.py b/recipes/wavelet_buffer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0f34761d1525c --- /dev/null +++ b/recipes/wavelet_buffer/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/wavelet_buffer/all/test_package/test_package.cpp b/recipes/wavelet_buffer/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c37d44129cc08 --- /dev/null +++ b/recipes/wavelet_buffer/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#include + +#include + +using drift::Signal1D; +using drift::WaveletBuffer; +using drift::WaveletParameters; +using drift::WaveletTypes; +using DenoiseAlgo = drift::ThresholdAbsDenoiseAlgorithm; + +int main() { + Signal1D original = blaze::generate( + 1000, [](auto index) { return static_cast(index % 100); }); + + std::cout << "Original size: " << original.size() * 4 << std::endl; + WaveletBuffer buffer(WaveletParameters{ + .signal_shape = {original.size()}, + .signal_number = 1, + .decomposition_steps = 3, + .wavelet_type = WaveletTypes::kDB1, + }); + + // Wavelet decomposition of the signal and denoising + buffer.Decompose(original, DenoiseAlgo(0, 0.3)); + + // Compress the buffer + std::string arch; + if (buffer.Serialize(&arch, 16)) { + std::cout << "Compressed size: " << arch.size() << std::endl; + } else { + std::cerr << "Serialization error" << std::endl; + return EXIT_FAILURE; + } + + // Decompress the buffer + auto restored_buffer = WaveletBuffer::Parse(arch); + Signal1D output_signal; + + // Restore the signal from wavelet decomposition + restored_buffer->Compose(&output_signal); + + std::cout << "Distance between original and restored signal: " + << blaze::norm(original - output_signal) / original.size() + << std::endl; + std::cout << "Compression rate: " << original.size() * 4. / arch.size() * 100 + << "%" << std::endl; +} diff --git a/recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt b/recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wavelet_buffer/all/test_v1_package/conanfile.py b/recipes/wavelet_buffer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wavelet_buffer/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wavelet_buffer/config.yml b/recipes/wavelet_buffer/config.yml new file mode 100644 index 0000000000000..d13fcfd021b7b --- /dev/null +++ b/recipes/wavelet_buffer/config.yml @@ -0,0 +1,5 @@ +versions: + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/wayland-protocols/all/conandata.yml b/recipes/wayland-protocols/all/conandata.yml new file mode 100644 index 0000000000000..f5d4a91464dd2 --- /dev/null +++ b/recipes/wayland-protocols/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.31": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.31/downloads/wayland-protocols-1.31.tar.xz" + sha256: "a07fa722ed87676ec020d867714bc9a2f24c464da73912f39706eeef5219e238" + "1.27": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.27/downloads/wayland-protocols-1.27.tar.xz" + sha256: "9046f10a425d4e2a00965a03acfb6b3fb575a56503ac72c2b86821c69653375c" + "1.26": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.26/wayland-protocols-1.26.tar.bz2" + sha256: "0426ae92841cad054dac8565a90c282deabb60c46a3752c37788b8a322ad12a2" + "1.25": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.25/wayland-protocols-1.25.tar.bz2" + sha256: "633c9bed0efb8e773c5780d4442051264d179c154b7d1896ca3b56b5d4da4718" + "1.24": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.24/wayland-protocols-1.24.tar.bz2" + sha256: "a165e2da28197b1dcf97fd9ec06b16b030bdc5de6c92162c4b09026e62cfe8f9" + "1.23": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.23/wayland-protocols-1.23.tar.bz2" + sha256: "b860c692ff83b4bd6251dc74c579ced3a68ec0743b7af801ef3f501da3fde330" + "1.21": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.21/wayland-protocols-1.21.tar.bz2" + sha256: "cf1a62195eb49622fc3c3eda440d0225ee49bd5aa9f1ee993c28fe0796dae783" diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py new file mode 100644 index 0000000000000..8641e38f36bfb --- /dev/null +++ b/recipes/wayland-protocols/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class WaylandProtocolsConan(ConanFile): + name = "wayland-protocols" + description = "Wayland is a project to define a protocol for a compositor to talk to its clients as well as a library implementation of the protocol" + topics = ("wayland",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + + def package_id(self): + self.info.clear() + + 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.0.0") + + 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 generate(self): + tc = MesonToolchain(self) + tc.project_options["datadir"] = os.path.join(self.package_folder, "res") + tc.project_options["tests"] = "false" + tc.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + def _patch_sources(self): + if Version(self.version) <= "1.23": + # fixed upstream in https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/113 + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "dep_scanner = dependency('wayland-scanner', native: true)", + "#dep_scanner = dependency('wayland-scanner', native: true)") + + def build(self): + self._patch_sources() + 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() + rmdir(self, os.path.join(self.package_folder, "res", "pkgconfig")) + + def package_info(self): + pkgconfig_variables = { + '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())) + + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py new file mode 100644 index 0000000000000..19d2d81011711 --- /dev/null +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import can_run +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 +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("wayland/1.21.0") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + self.tool_requires("wayland/1.21.0") + + def layout(self): + basic_layout(self) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.project_options["has_build_profile"] = self._has_build_profile + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + 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/wayland-protocols/all/test_package/meson.build b/recipes/wayland-protocols/all/test_package/meson.build new file mode 100644 index 0000000000000..a79bb8c0c5c35 --- /dev/null +++ b/recipes/wayland-protocols/all/test_package/meson.build @@ -0,0 +1,36 @@ +project('test_wayland_protocols', 'c') + +wayland_client_dep = dependency('wayland-client', version: '>=1.2.0', required: true) +wayland_protocols_dep = dependency('wayland-protocols', required: true) +wayland_protocols_datadir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir') + +if get_option('has_build_profile') + wayland_scanner_dep = dependency('wayland-scanner_BUILD', native: true) + wayland_scanner_for_build = find_program(wayland_scanner_dep.get_variable(pkgconfig: 'wayland_scanner')) +else + wayland_scanner_for_build = find_program('wayland-scanner') +endif + +wayland_scanner_code_gen = generator( + wayland_scanner_for_build, + output: '@BASENAME@-protocol.c', + arguments: ['code', '@INPUT@', '@OUTPUT@'], +) +wayland_scanner_client_header_gen = generator( + wayland_scanner_for_build, + output: '@BASENAME@-client-protocol.h', + arguments: ['client-header', '@INPUT@', '@OUTPUT@'], +) + +xdg_shell_xml = wayland_protocols_datadir/'stable/xdg-shell/xdg-shell.xml' + +xdg_shell_sources = [ + wayland_scanner_code_gen.process(xdg_shell_xml), + wayland_scanner_client_header_gen.process(xdg_shell_xml), +] + +executable('test_package', + 'test_package.c', + xdg_shell_sources, + dependencies: [wayland_client_dep], + link_args : '-lrt') diff --git a/recipes/wayland-protocols/all/test_package/meson_options.txt b/recipes/wayland-protocols/all/test_package/meson_options.txt new file mode 100644 index 0000000000000..15a4dceff2c0d --- /dev/null +++ b/recipes/wayland-protocols/all/test_package/meson_options.txt @@ -0,0 +1 @@ +option('has_build_profile', type : 'boolean', value : false) diff --git a/recipes/wayland-protocols/all/test_package/test_package.c b/recipes/wayland-protocols/all/test_package/test_package.c new file mode 100644 index 0000000000000..4323c1238c045 --- /dev/null +++ b/recipes/wayland-protocols/all/test_package/test_package.c @@ -0,0 +1,18 @@ + +#include +#include +#include "xdg-shell-client-protocol.h" + +// TODO: Need help to write actual test here + +int main(void) +{ + struct wl_display *display = wl_display_connect(NULL); + if (display) { + printf("Connected!\n"); + wl_display_disconnect(display); + } else { + printf("Error connecting ;(\n"); + } + return 0; +} diff --git a/recipes/wayland-protocols/all/test_v1_package/conanfile.py b/recipes/wayland-protocols/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..37376c2138077 --- /dev/null +++ b/recipes/wayland-protocols/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import Meson, tools +from conan import ConanFile +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "pkg_config" + + def build_requirements(self): + self.build_requires("wayland/1.21.0") + self.build_requires("meson/1.0.0") + + def requirements(self): + self.requires("wayland/1.21.0") + + def build(self): + meson = Meson(self) + env_build = tools.RunEnvironment(self) + with tools.environment_append(env_build.vars): + meson.configure() + meson.build() + + def test(self): + if not cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/wayland-protocols/all/test_v1_package/meson.build b/recipes/wayland-protocols/all/test_v1_package/meson.build new file mode 100644 index 0000000000000..d1776cc1915fd --- /dev/null +++ b/recipes/wayland-protocols/all/test_v1_package/meson.build @@ -0,0 +1,30 @@ +project('test_wayland_protocols', 'c') + +wayland_client_dep = dependency('wayland-client', version: '>=1.2.0', required: true) +wayland_protocols_dep = dependency('wayland-protocols', required: true) +wayland_protocols_datadir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir') + +wayland_scanner = find_program('wayland-scanner') +wayland_scanner_code_gen = generator( + wayland_scanner, + output: '@BASENAME@-protocol.c', + arguments: ['code', '@INPUT@', '@OUTPUT@'], +) +wayland_scanner_client_header_gen = generator( + wayland_scanner, + output: '@BASENAME@-client-protocol.h', + arguments: ['client-header', '@INPUT@', '@OUTPUT@'], +) + +xdg_shell_xml = wayland_protocols_datadir/'stable/xdg-shell/xdg-shell.xml' + +xdg_shell_sources = [ + wayland_scanner_code_gen.process(xdg_shell_xml), + wayland_scanner_client_header_gen.process(xdg_shell_xml), +] + +executable('test_package', + '../test_package/test_package.c', + xdg_shell_sources, + dependencies: [wayland_client_dep], + link_args : '-lrt') diff --git a/recipes/wayland-protocols/config.yml b/recipes/wayland-protocols/config.yml new file mode 100644 index 0000000000000..81aded41c9822 --- /dev/null +++ b/recipes/wayland-protocols/config.yml @@ -0,0 +1,15 @@ +versions: + "1.31": + folder: all + "1.27": + folder: all + "1.26": + folder: all + "1.25": + folder: all + "1.24": + folder: all + "1.23": + folder: all + "1.21": + folder: all diff --git a/recipes/wayland/all/conandata.yml b/recipes/wayland/all/conandata.yml new file mode 100644 index 0000000000000..b49acf6707671 --- /dev/null +++ b/recipes/wayland/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.21.0": + url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-1.21.0.tar.xz" + sha256: "6dc64d7fc16837a693a51cfdb2e568db538bfdc9f457d4656285bb9594ef11ac" + "1.20.0": + url: "https://wayland.freedesktop.org/releases/wayland-1.20.0.tar.xz" + sha256: "b8a034154c7059772e0fdbd27dbfcda6c732df29cae56a82274f6ec5d7cd8725" + "1.19.0": + url: "https://wayland.freedesktop.org/releases/wayland-1.19.0.tar.xz" + sha256: "baccd902300d354581cd5ad3cc49daa4921d55fb416a5883e218750fef166d15" + "1.18.0": + url: "https://wayland.freedesktop.org/releases/wayland-1.18.0.tar.xz" + sha256: "4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c2e294d" diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py new file mode 100644 index 0000000000000..2f0995116baad --- /dev/null +++ b/recipes/wayland/all/conanfile.py @@ -0,0 +1,179 @@ +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 +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" + + +class WaylandConan(ConanFile): + name = "wayland" + description = ( + "Wayland is a project to define a protocol for a compositor to talk to " + "its clients as well as a library implementation of the protocol" + ) + topics = "protocol", "compositor", "display" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://wayland.freedesktop.org" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_libraries": [True, False], + "enable_dtd_validation": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_libraries": True, + "enable_dtd_validation": 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): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.enable_libraries: + self.requires("libffi/3.4.4") + if self.options.enable_dtd_validation: + self.requires("libxml2/2.10.4") + self.requires("expat/2.5.0") + + 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.1.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + if cross_building(self): + self.tool_requires(str(self.ref)) + + 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") + + pkg_config_deps = PkgConfigDeps(self) + if cross_building(self): + pkg_config_deps.build_context_activated = ["wayland"] + elif self.dependencies["expat"].is_build_context: # wayland is being built as build_require + # If wayland is the build_require, all its dependencies are treated as build_requires + pkg_config_deps.build_context_activated = [dep.ref.name for _, dep in self.dependencies.host.items()] + pkg_config_deps.generate() + tc = MesonToolchain(self) + tc.project_options["libdir"] = "lib" + tc.project_options["datadir"] = "res" + tc.project_options["libraries"] = self.options.enable_libraries + tc.project_options["dtd_validation"] = self.options.enable_dtd_validation + tc.project_options["documentation"] = False + if cross_building(self): + tc.project_options["build.pkg_config_path"] = self.generators_folder + if Version(self.version) >= "1.18.91": + tc.project_options["scanner"] = True + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "subdir('tests')", "#subdir('tests')") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + pkg_config_dir = os.path.join(self.package_folder, "lib", "pkgconfig") + rmdir(self, pkg_config_dir) + + def package_info(self): + self.cpp_info.components["wayland-scanner"].set_property("pkg_config_name", "wayland-scanner") + self.cpp_info.components["wayland-scanner"].resdirs = ["res"] + self.cpp_info.components["wayland-scanner"].includedirs = [] + self.cpp_info.components["wayland-scanner"].libdirs = [] + self.cpp_info.components["wayland-scanner"].set_property("component_version", self.version) + self.cpp_info.components["wayland-scanner"].requires = ["expat::expat"] + if self.options.enable_dtd_validation: + self.cpp_info.components["wayland-scanner"].requires.append("libxml2::libxml2") + pkgconfig_variables = { + 'datarootdir': '${prefix}/res', + 'pkgdatadir': '${datarootdir}/wayland', + 'bindir': '${prefix}/bin', + 'wayland_scanner': '${bindir}/wayland-scanner', + } + self.cpp_info.components["wayland-scanner"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) + + if self.options.enable_libraries: + self.cpp_info.components["wayland-server"].libs = ["wayland-server"] + self.cpp_info.components["wayland-server"].set_property("pkg_config_name", "wayland-server") + self.cpp_info.components["wayland-server"].requires = ["libffi::libffi"] + self.cpp_info.components["wayland-server"].system_libs = ["pthread", "m"] + self.cpp_info.components["wayland-server"].resdirs = ["res"] + if self.version >= Version("1.21.0") and self.settings.os == "Linux": + self.cpp_info.components["wayland-server"].system_libs += ["rt"] + self.cpp_info.components["wayland-server"].set_property("component_version", self.version) + pkgconfig_variables = { + 'datarootdir': '${prefix}/res', + 'pkgdatadir': '${datarootdir}/wayland', + } + self.cpp_info.components["wayland-server"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) + + self.cpp_info.components["wayland-client"].libs = ["wayland-client"] + self.cpp_info.components["wayland-client"].set_property("pkg_config_name", "wayland-client") + self.cpp_info.components["wayland-client"].requires = ["libffi::libffi"] + self.cpp_info.components["wayland-client"].system_libs = ["pthread", "m"] + self.cpp_info.components["wayland-client"].resdirs = ["res"] + if self.version >= Version("1.21.0") and self.settings.os == "Linux": + self.cpp_info.components["wayland-client"].system_libs += ["rt"] + self.cpp_info.components["wayland-client"].set_property("component_version", self.version) + pkgconfig_variables = { + 'datarootdir': '${prefix}/res', + 'pkgdatadir': '${datarootdir}/wayland', + } + self.cpp_info.components["wayland-client"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) + + self.cpp_info.components["wayland-cursor"].libs = ["wayland-cursor"] + self.cpp_info.components["wayland-cursor"].set_property("pkg_config_name", "wayland-cursor") + self.cpp_info.components["wayland-cursor"].requires = ["wayland-client"] + self.cpp_info.components["wayland-cursor"].set_property("component_version", self.version) + + self.cpp_info.components["wayland-egl"].libs = ["wayland-egl"] + self.cpp_info.components["wayland-egl"].set_property("pkg_config_name", "wayland-egl") + self.cpp_info.components["wayland-egl"].requires = ["wayland-client"] + self.cpp_info.components["wayland-egl"].set_property("component_version", "18.1.0") + + self.cpp_info.components["wayland-egl-backend"].set_property("pkg_config_name", "wayland-egl-backend") + self.cpp_info.components["wayland-egl-backend"].set_property("component_version", "3") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/wayland/all/test_package/CMakeLists.txt b/recipes/wayland/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fa5ae025fbfc7 --- /dev/null +++ b/recipes/wayland/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(wayland COMPONENTS wayland-client REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE wayland::wayland-client) diff --git a/recipes/wayland/all/test_package/conanfile.py b/recipes/wayland/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c201ad68aff34 --- /dev/null +++ b/recipes/wayland/all/test_package/conanfile.py @@ -0,0 +1,55 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import PkgConfig, PkgConfigDeps + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + if self._has_build_profile: + pkg_config = PkgConfig(self, "wayland-scanner_BUILD", self.generators_folder) + wayland_scanner = pkg_config.variables["wayland_scanner"] + self.run(f"{wayland_scanner} --version", env="conanrun") + + 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/wayland/all/test_package/test_package.c b/recipes/wayland/all/test_package/test_package.c new file mode 100644 index 0000000000000..226d3b4a4a73a --- /dev/null +++ b/recipes/wayland/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include +#include +#include + +int main(int argc, char **argv) { + + struct wl_display *display = wl_display_connect(NULL); + if (display == NULL) { + fprintf(stderr, "Can't connect to display\n"); + } + else + { + printf("connected to display\n"); + + wl_display_disconnect(display); + printf("disconnected from display\n"); + } + + exit(0); +} diff --git a/recipes/wayland/all/test_v1_package/CMakeLists.txt b/recipes/wayland/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wayland/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wayland/all/test_v1_package/conanfile.py b/recipes/wayland/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e7b714f005817 --- /dev/null +++ b/recipes/wayland/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + self.run("wayland-scanner --version", run_environment=True) + cmd = os.path.join(self.build_folder, "bin", "test_package") + self.run(cmd, run_environment=True) diff --git a/recipes/wayland/config.yml b/recipes/wayland/config.yml new file mode 100644 index 0000000000000..21b3598bd3d20 --- /dev/null +++ b/recipes/wayland/config.yml @@ -0,0 +1,9 @@ +versions: + "1.21.0": + folder: all + "1.20.0": + folder: all + "1.19.0": + folder: all + "1.18.0": + folder: all diff --git a/recipes/websocketpp/all/conandata.yml b/recipes/websocketpp/all/conandata.yml new file mode 100644 index 0000000000000..f48a24b75f74d --- /dev/null +++ b/recipes/websocketpp/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "0.8.2": + url: "https://github.com/zaphoyd/websocketpp/archive/0.8.2.tar.gz" + sha256: "6ce889d85ecdc2d8fa07408d6787e7352510750daa66b5ad44aacb47bea76755" + "0.8.1": + url: "https://github.com/zaphoyd/websocketpp/archive/0.8.1.tar.gz" + sha256: "178899de48c02853b55b1ea8681599641cedcdfce59e56beaff3dd0874bf0286" +patches: + "0.8.2": + - patch_file: "patches/support-gcc-12.patch" + patch_type: "portability" + patch_description: "support gcc 12" + patch_source: "https://github.com/zaphoyd/websocketpp/issues/991" + "0.8.1": + - patch_file: "patches/websocket_boost_support_1_7_x.patch" + patch_type: "conan" + patch_description: "Boost 1.70+ support: Mostly captures zaphoyd/websocketpp#814" + - patch_file: "patches/support-gcc-12.patch" + patch_type: "portability" + patch_description: "support gcc 12" + patch_source: "https://github.com/zaphoyd/websocketpp/issues/991" diff --git a/recipes/websocketpp/all/conanfile.py b/recipes/websocketpp/all/conanfile.py new file mode 100644 index 0000000000000..2e4962181cae1 --- /dev/null +++ b/recipes/websocketpp/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class WebsocketPPConan(ConanFile): + name = "websocketpp" + description = "Header only C++ library that implements RFC6455 The WebSocket Protocol" + topics = ("websocketpp", "websocket", "network", "web", "rfc6455", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zaphoyd/websocketpp" + license = "BSD-3-Clause" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "asio": ["boost", "standalone", False], + "with_openssl": [True, False], + "with_zlib": [True, False], + } + default_options = { + "asio": "boost", + "with_openssl": True, + "with_zlib": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + + if self.options.with_zlib: + self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) + + if self.options.asio == "standalone": + self.requires("asio/1.27.0", transitive_headers=True) + elif self.options.asio == "boost": + self.requires("boost/1.81.0", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, os.path.join("websocketpp","*.hpp"), src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "websocketpp") + self.cpp_info.set_property("cmake_target_name", "websocketpp::websocketpp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.requires = [] + if self.options.with_openssl: + self.cpp_info.requires.append("openssl::openssl") + if self.options.with_zlib: + self.cpp_info.requires.append("zlib::zlib") + if self.options.asio == "standalone": + self.cpp_info.defines.extend(["ASIO_STANDALONE", "_WEBSOCKETPP_CPP11_STL_"]) + self.cpp_info.requires.append("asio::asio") + elif self.options.asio == "boost": + self.cpp_info.requires.append("boost::headers") diff --git a/recipes/websocketpp/all/patches/support-gcc-12.patch b/recipes/websocketpp/all/patches/support-gcc-12.patch new file mode 100644 index 0000000000000..b69f7b18a5145 --- /dev/null +++ b/recipes/websocketpp/all/patches/support-gcc-12.patch @@ -0,0 +1,93 @@ +diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp +index c124b1d..9ce8a62 100644 +--- a/websocketpp/endpoint.hpp ++++ b/websocketpp/endpoint.hpp +@@ -109,7 +109,7 @@ public: + + + /// Destructor +- ~endpoint() {} ++ ~endpoint() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp +index 8451413..51efa94 100644 +--- a/websocketpp/logger/basic.hpp ++++ b/websocketpp/logger/basic.hpp +@@ -58,33 +58,33 @@ namespace log { + template + class basic { + public: +- basic(channel_type_hint::value h = ++ basic(channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic(std::ostream * out) ++ basic(std::ostream * out) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(out) {} + +- basic(level c, channel_type_hint::value h = ++ basic(level c, channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic(level c, std::ostream * out) ++ basic(level c, std::ostream * out) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(out) {} + + /// Destructor +- ~basic() {} ++ ~basic() {} + + /// Copy constructor +- basic(basic const & other) ++ basic(basic const & other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +@@ -97,7 +97,7 @@ public: + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- basic(basic && other) ++ basic(basic && other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +diff --git a/websocketpp/roles/server_endpoint.hpp b/websocketpp/roles/server_endpoint.hpp +index 9cc652f..ad8f403 100644 +--- a/websocketpp/roles/server_endpoint.hpp ++++ b/websocketpp/roles/server_endpoint.hpp +@@ -72,11 +72,11 @@ public: + } + + /// Destructor +- ~server() {} ++ ~server() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +- server(server &) = delete; ++ server(server&) = delete; + + // no copy assignment operator because endpoints are not copyable + server & operator=(server const &) = delete; +@@ -84,7 +84,7 @@ public: + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- server(server && o) : endpoint,config>(std::move(o)) {} ++ server(server&& o) : endpoint,config>(std::move(o)) {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no move assignment operator because of const member variables diff --git a/recipes/websocketpp/all/patches/websocket_boost_support_1_7_x.patch b/recipes/websocketpp/all/patches/websocket_boost_support_1_7_x.patch new file mode 100644 index 0000000000000..c90027111c16f --- /dev/null +++ b/recipes/websocketpp/all/patches/websocket_boost_support_1_7_x.patch @@ -0,0 +1,157 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d13117..b803c21 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -123,7 +123,11 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) + + # g++ + if (CMAKE_COMPILER_IS_GNUCXX) +- set (WEBSOCKETPP_PLATFORM_LIBS pthread rt) ++ if (NOT APPLE) ++ set (WEBSOCKETPP_PLATFORM_LIBS pthread rt) ++ else() ++ set (WEBSOCKETPP_PLATFORM_LIBS pthread) ++ endif() + set (WEBSOCKETPP_PLATFORM_TLS_LIBS ssl crypto) + set (WEBSOCKETPP_BOOST_LIBS system thread) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -202,7 +206,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) + endif () + + if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (/DBOOST_TEST_DYN_LINK) ++ add_definitions (-DBOOST_TEST_DYN_LINK) + endif () + + set (Boost_FIND_REQUIRED TRUE) +diff --git a/changelog.md b/changelog.md +index 6771d6e..743d014 100644 +--- a/changelog.md ++++ b/changelog.md +@@ -1,4 +1,9 @@ + HEAD ++- CMake: Update cmake installer to better handle dependencies when using ++ g++ on MacOS. Thank you Luca Palano for reporting and a patch. #831 ++- CMake: Update cmake installer to use a variable for the include directory ++ improving the ability of the install to be customized. THank you Schrijvers ++ Luc and Gianfranco Costamanga for reporting and a patch. #842 + + 0.8.1 - 2018-07-16 + Note: This release does not change library behavior. It only corrects issues +diff --git a/cmake/CMakeHelpers.cmake b/cmake/CMakeHelpers.cmake +index 1478f4b..f603632 100644 +--- a/cmake/CMakeHelpers.cmake ++++ b/cmake/CMakeHelpers.cmake +@@ -80,7 +80,7 @@ macro (final_target) + endif () + + install (DIRECTORY ${CMAKE_SOURCE_DIR}/${TARGET_NAME} +- DESTINATION include/ ++ DESTINATION ${INSTALL_INCLUDE_DIR}/ + FILES_MATCHING PATTERN "*.hpp*") + endmacro () + +diff --git a/docs/faq.dox b/docs/faq.dox +index 24059f7..9f417ec 100644 +--- a/docs/faq.dox ++++ b/docs/faq.dox +@@ -55,7 +55,7 @@ If you handle errors from methods like send, ping, close, etc correctly then you + + Normally, for security purposes, operating systems prevent programs from listening on sockets created by other programs. When your program crashes and restarts, the new instance is a different program from the perspective of the operating system. As such it can’t listen on the socket address/port that the previous program was using until after a timeout occurs to make sure the old program was done with it. + +-The the first step for handling this is to make sure that you provide a method (signal handler, admin websocket message, etc) to perform a clean server shutdown. There is a question elsewhere in this FAQ that describes the steps necessary for this. ++The first step for handling this is to make sure that you provide a method (signal handler, admin websocket message, etc) to perform a clean server shutdown. There is a question elsewhere in this FAQ that describes the steps necessary for this. + + The clean close strategy won't help in the case of crashes or other abnormal closures. An option to consider for these cases is the use of the SO_REUSEADDR socket option. This instructs the OS to not request an exclusive lock on the socket. This means that after your program crashes the replacement you start can immediately listen on that address/port combo again. + +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index 60f88a7..57dda74 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -311,9 +311,10 @@ public: + * needed. + */ + timer_ptr set_timer(long duration, timer_handler callback) { +- timer_ptr new_timer = lib::make_shared( +- lib::ref(*m_io_service), +- lib::asio::milliseconds(duration) ++ timer_ptr new_timer( ++ new lib::asio::steady_timer( ++ *m_io_service, ++ lib::asio::milliseconds(duration)) + ); + + if (config::enable_multithreading) { +@@ -461,8 +462,7 @@ protected: + m_io_service = io_service; + + if (config::enable_multithreading) { +- m_strand = lib::make_shared( +- lib::ref(*io_service)); ++ m_strand.reset(new lib::asio::io_service::strand(*io_service)); + } + + lib::error_code ec = socket_con_type::init_asio(io_service, m_strand, +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index ddab2c7..94509ad 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -195,8 +195,7 @@ public: + + m_io_service = ptr; + m_external_io_service = true; +- m_acceptor = lib::make_shared( +- lib::ref(*m_io_service)); ++ m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service)); + + m_state = READY; + ec = lib::error_code(); +@@ -688,9 +687,7 @@ public: + * @since 0.3.0 + */ + void start_perpetual() { +- m_work = lib::make_shared( +- lib::ref(*m_io_service) +- ); ++ m_work.reset(new lib::asio::io_service::work(*m_io_service)); + } + + /// Clears the endpoint's perpetual flag, allowing it to exit when empty +@@ -854,8 +851,7 @@ protected: + + // Create a resolver + if (!m_resolver) { +- m_resolver = lib::make_shared( +- lib::ref(*m_io_service)); ++ m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service)); + } + + tcon->set_uri(u); +diff --git a/websocketpp/transport/asio/security/none.hpp b/websocketpp/transport/asio/security/none.hpp +index 5c8293d..6c7d352 100644 +--- a/websocketpp/transport/asio/security/none.hpp ++++ b/websocketpp/transport/asio/security/none.hpp +@@ -168,8 +168,7 @@ protected: + return socket::make_error_code(socket::error::invalid_state); + } + +- m_socket = lib::make_shared( +- lib::ref(*service)); ++ m_socket.reset(new lib::asio::ip::tcp::socket(*service)); + + if (m_socket_init_handler) { + m_socket_init_handler(m_hdl, *m_socket); +diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp +index c76fd9a..04ac379 100644 +--- a/websocketpp/transport/asio/security/tls.hpp ++++ b/websocketpp/transport/asio/security/tls.hpp +@@ -193,8 +193,7 @@ protected: + if (!m_context) { + return socket::make_error_code(socket::error::invalid_tls_context); + } +- m_socket = lib::make_shared( +- _WEBSOCKETPP_REF(*service),lib::ref(*m_context)); ++ m_socket.reset(new socket_type(*service, *m_context)); + + if (m_socket_init_handler) { + m_socket_init_handler(m_hdl, get_socket()); diff --git a/recipes/websocketpp/all/test_package/CMakeLists.txt b/recipes/websocketpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d6d230796653e --- /dev/null +++ b/recipes/websocketpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(websocketpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE websocketpp::websocketpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/websocketpp/all/test_package/conanfile.py b/recipes/websocketpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/websocketpp/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/websocketpp/all/test_package/test_package.cpp b/recipes/websocketpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0ac4a3bb71f1e --- /dev/null +++ b/recipes/websocketpp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() +{ + websocketpp::server server; +} diff --git a/recipes/websocketpp/all/test_v1_package/CMakeLists.txt b/recipes/websocketpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/websocketpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/websocketpp/all/test_v1_package/conanfile.py b/recipes/websocketpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/websocketpp/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/websocketpp/config.yml b/recipes/websocketpp/config.yml new file mode 100644 index 0000000000000..7a9cbb2ce8ecb --- /dev/null +++ b/recipes/websocketpp/config.yml @@ -0,0 +1,5 @@ +versions: + "0.8.2": + folder: all + "0.8.1": + folder: all diff --git a/recipes/wg21-linear_algebra/all/conandata.yml b/recipes/wg21-linear_algebra/all/conandata.yml new file mode 100644 index 0000000000000..8b447807d61bb --- /dev/null +++ b/recipes/wg21-linear_algebra/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.3": + url: https://github.com/BobSteagall/wg21/archive/refs/tags/v0.7.3.tar.gz + sha256: ff4bc5788793e3c5f65d98f50029b4f762ffa38572867701053dacb572b85098 diff --git a/recipes/wg21-linear_algebra/all/conanfile.py b/recipes/wg21-linear_algebra/all/conanfile.py new file mode 100644 index 0000000000000..77b29cb972259 --- /dev/null +++ b/recipes/wg21-linear_algebra/all/conanfile.py @@ -0,0 +1,65 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version + +required_conan_version = ">=1.59.0" + +class LAConan(ConanFile): + name = "wg21-linear_algebra" + homepage = "https://github.com/BobSteagall/wg21" + description = "Production-quality reference implementation of P1385: A proposal to add linear algebra support to the C++ standard library" + topics = ("linear-algebra", "multi-dimensional", "maths") + license = "NCSA" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + no_copy_source = True + + def requirements(self): + self.requires("mdspan/0.5.0") + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "10", + "clang": "12", # Should be 11 but https://github.com/conan-io/conan-docker-tools/issues/251 + "apple-clang": "11" + } + + def validate(self): + compiler = self.settings.compiler + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.ref} requires at least {compiler} {min_version}") + + def layout(self): + cmake_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) + + 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, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "wg21_linear_algebra") + self.cpp_info.set_property("cmake_target_name", "wg21_linear_algebra::wg21_linear_algebra") + + self.cpp_info.names["cmake_find_package"] = "wg21_linear_algebra" + self.cpp_info.names["cmake_find_package_multi"] = "wg21_linear_algebra" diff --git a/recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt b/recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..61165ba3ffe02 --- /dev/null +++ b/recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package CXX) + +find_package(wg21_linear_algebra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wg21_linear_algebra::wg21_linear_algebra) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/recipes/wg21-linear_algebra/all/test_package/conanfile.py b/recipes/wg21-linear_algebra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f7c2cd1e5e6ed --- /dev/null +++ b/recipes/wg21-linear_algebra/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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/wg21-linear_algebra/all/test_package/test_package.cpp b/recipes/wg21-linear_algebra/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9c94b3c914c33 --- /dev/null +++ b/recipes/wg21-linear_algebra/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +using namespace STD_LA; + +int main() +{ + STD_LA::fixed_size_matrix v; + STD_LA::fixed_size_matrix m; + v*m; + + return EXIT_SUCCESS; +} diff --git a/recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt b/recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..daf2832b167b8 --- /dev/null +++ b/recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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/wg21-linear_algebra/all/test_v1_package/conanfile.py b/recipes/wg21-linear_algebra/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e264aad8e8ec --- /dev/null +++ b/recipes/wg21-linear_algebra/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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/wg21-linear_algebra/config.yml b/recipes/wg21-linear_algebra/config.yml new file mode 100644 index 0000000000000..937a37094e188 --- /dev/null +++ b/recipes/wg21-linear_algebra/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.3": + folder: all diff --git a/recipes/wglext/all/conandata.yml b/recipes/wglext/all/conandata.yml new file mode 100644 index 0000000000000..3dd538781dc77 --- /dev/null +++ b/recipes/wglext/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200813": + url: "https://github.com/KhronosGroup/OpenGL-Registry/raw/43aad35cba1b76ea1f33f8d6234fa57ae8e2fbbe/api/GL/wglext.h" + sha256: "f02ff1cfd6444501d2454cf91e44289d687ef8917bd0ef80bf6a6a69a3dd5123" diff --git a/recipes/wglext/all/conanfile.py b/recipes/wglext/all/conanfile.py new file mode 100644 index 0000000000000..916b363760c68 --- /dev/null +++ b/recipes/wglext/all/conanfile.py @@ -0,0 +1,37 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.37.0" + +class WglextConan(ConanFile): + name = "wglext" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" + description = "WGL extension interfaces" + topics = ("opengl", "gl", "wgl", "wglext") + no_copy_source = True + requires = "opengl/system" + settings = "os", + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("wglext is only supported on Windows") + + def source(self): + tools.download(filename="wglext.h", **self.conan_data["sources"][self.version]) + + def package(self): + self.copy(pattern="wglext.h", dst=os.path.join("include", "GL")) + license_data = tools.load(os.path.join(self.source_folder, "wglext.h")) + begin = license_data.find("/*") + len("/*") + end = license_data.find("*/") + license_data = license_data[begin:end] + license_data = license_data.replace("**", "") + tools.save("LICENSE", license_data) + self.copy("LICENSE", dst="licenses") + + def package_id(self): + self.info.header_only() diff --git a/recipes/wglext/all/test_package/CMakeLists.txt b/recipes/wglext/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..121f8f8e30a8e --- /dev/null +++ b/recipes/wglext/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(wglext REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wglext::wglext) diff --git a/recipes/wglext/all/test_package/conanfile.py b/recipes/wglext/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/wglext/all/test_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/wglext/all/test_package/test_package.c b/recipes/wglext/all/test_package/test_package.c new file mode 100644 index 0000000000000..c50fd3a03f469 --- /dev/null +++ b/recipes/wglext/all/test_package/test_package.c @@ -0,0 +1,74 @@ +#include +#include +#include +#include + +static LRESULT CALLBACK WndProc(HWND hwnd, + UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LRESULT res = 1; + switch (uMsg) + { + case WM_DESTROY: + PostQuitMessage(0); + break; + default: + res = DefWindowProc(hwnd, uMsg, wParam, lParam); + } + return res; +} + +HDC init_context() +{ + static const wchar_t * class_name = L"ConanOpenGL"; + static const wchar_t * window_name = L"Conan OpenGL"; + WNDCLASSEXW wc = {0}; + wc.cbSize = sizeof(WNDCLASSEXW); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.hInstance = GetModuleHandle(NULL); + wc.hIcon = LoadIcon(0, IDI_APPLICATION); + wc.hCursor = LoadCursor(0, IDC_ARROW); + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszClassName = class_name; + if (!RegisterClassExW(&wc)) + return 0; + HWND hWnd = CreateWindowExW(0, class_name, window_name, + WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, wc.hInstance, NULL); + if (!hWnd) + return 0; + HDC hDC = GetDC(hWnd); + if (!hDC) + return 0; + PIXELFORMATDESCRIPTOR pfd = {0}; + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.dwLayerMask = PFD_MAIN_PLANE; + pfd.cColorBits = 32; + pfd.cDepthBits = 16; + int pixel_format = ChoosePixelFormat(hDC, &pfd); + if(0 == pixel_format) + return 0; + if (!SetPixelFormat(hDC, pixel_format, &pfd)) + return 0; + HGLRC hGLRC = wglCreateContext(hDC); + if (!hGLRC) + return 0; + wglMakeCurrent(hDC, hGLRC); + return hDC; +} + +int main() +{ + init_context(); + HDC hDC = GetDC(0); + PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = + (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB"); + if (!wglGetExtensionsStringARB) + return EXIT_SUCCESS; // ignore headless CI failures + const char* ext = wglGetExtensionsStringARB(hDC); + printf("wglGetExtensionsStringARB: %s\n", ext ? ext : "(null)"); + return EXIT_SUCCESS; +} diff --git a/recipes/wglext/config.yml b/recipes/wglext/config.yml new file mode 100644 index 0000000000000..a80ea0bb949b9 --- /dev/null +++ b/recipes/wglext/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200813": + folder: "all" diff --git a/recipes/whereami/all/CMakeLists.txt b/recipes/whereami/all/CMakeLists.txt new file mode 100644 index 0000000000000..9ad1b58bfdd92 --- /dev/null +++ b/recipes/whereami/all/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.4.3) +project(whereami C) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if (WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +set(WHEREAMI_SRC "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder") + +set(SOURCE_FILES ${WHEREAMI_SRC}/src/whereami.c) +set(HEADER_FILES ${WHEREAMI_SRC}/src/whereami.h) + +add_library(${CMAKE_PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES}) +target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${WHEREAMI_SRC}/src) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY C_STANDARD 99) + +install(TARGETS ${CMAKE_PROJECT_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(FILES ${HEADER_FILES} DESTINATION include) diff --git a/recipes/whereami/all/conandata.yml b/recipes/whereami/all/conandata.yml new file mode 100644 index 0000000000000..24df3e48b58aa --- /dev/null +++ b/recipes/whereami/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220112": + url: "https://github.com/gpakosz/whereami/archive/f15606a65908bb097e1887a08a40ae083e9a5c53.tar.gz" + sha256: "005d51ed0a99845b27ed9df4834b609abfc1811b187aeee1a85929004704dd6d" diff --git a/recipes/whereami/all/conanfile.py b/recipes/whereami/all/conanfile.py new file mode 100644 index 0000000000000..323a8747c8641 --- /dev/null +++ b/recipes/whereami/all/conanfile.py @@ -0,0 +1,59 @@ +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + + +class WhereamiConan(ConanFile): + name = "whereami" + description = "Locate the current executable and the current module/library on the file system" + topics = ("whereami", "introspection", "getmodulefilename", + "dladdr", "executable-path", "getexecutablepath") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gpakosz/whereami" + license = ("MIT", "WTFPL") + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE.*", dst="licenses", + src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["whereami"] diff --git a/recipes/whereami/all/test_package/CMakeLists.txt b/recipes/whereami/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c0f4c847fb31 --- /dev/null +++ b/recipes/whereami/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(whereami REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} whereami::whereami) diff --git a/recipes/whereami/all/test_package/conanfile.py b/recipes/whereami/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/whereami/all/test_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/whereami/all/test_package/test_package.c b/recipes/whereami/all/test_package/test_package.c new file mode 100644 index 0000000000000..7bcdb8a7452da --- /dev/null +++ b/recipes/whereami/all/test_package/test_package.c @@ -0,0 +1,46 @@ +#include +#include +#include + +int main() { + + int length = wai_getExecutablePath(NULL, 0, NULL); + + if (length > 0) { + char* path = (char*)malloc(length + 1); + if (!path) { + abort(); + } + int dirname_length = 0; + wai_getExecutablePath(path, length, &dirname_length); + path[length] = '\0'; + + printf("Executable path: %s\n", path); + path[dirname_length] = '\0'; + printf(" dirname: %s\n", path); + printf(" basename: %s\n", path + dirname_length + 1); + + free(path); + } + + printf("\n"); + + length = wai_getModulePath(NULL, 0, NULL); + if (length > 0) { + char* path = (char*)malloc(length + 1); + if (!path) { + abort(); + } + int dirname_length = 0; + wai_getModulePath(path, length, &dirname_length); + path[length] = '\0'; + + printf("module path: %s\n", path); + path[dirname_length] = '\0'; + printf(" dirname: %s\n", path); + printf(" basename: %s\n", path + dirname_length + 1); + free(path); + } + + return 0; +} diff --git a/recipes/whereami/config.yml b/recipes/whereami/config.yml new file mode 100644 index 0000000000000..3d5c050ab0624 --- /dev/null +++ b/recipes/whereami/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220112": + folder: "all" diff --git a/recipes/wil/all/conandata.yml b/recipes/wil/all/conandata.yml new file mode 100644 index 0000000000000..c9a6344cdb846 --- /dev/null +++ b/recipes/wil/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.0.230202.1": + url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.230202.1.tar.gz" + sha256: "7bf01e9d93fb93f0fe2614492fac4a423b3a97b435015db74f5ac4a0270ebc8a" +patches: + "1.0.230202.1": + - patch_file: "patches/1.0.230202.1-0001-fix-type-conversion.patch" + patch_description: "Explicitly writing the type instead of using decltype" + patch_source: | + https://github.com/microsoft/wil/issues/302#issuecomment-1482117200 + https://github.com/microsoft/wil/pull/316 + patch_type: portability diff --git a/recipes/wil/all/conanfile.py b/recipes/wil/all/conanfile.py new file mode 100644 index 0000000000000..f54643102b43b --- /dev/null +++ b/recipes/wil/all/conanfile.py @@ -0,0 +1,92 @@ +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 WilConan(ConanFile): + name = "wil" + description = ( + "The Windows Implementation Libraries (WIL) is a header-only C++ library" + "created to make life easier for developers on Windows through readable" + "type-safe C++ interfaces for common Windows coding patterns." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/wil" + topics = ("win", "wil", "header-only") + package_type = "header-library" + # only arch is aplicable, windows library + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + # About compiler version: https://github.com/microsoft/wil/issues/207#issuecomment-991722592 + return { + "Visual Studio": "15", + "msvc": "191" + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() # same package ID for any package + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + # Validate the minimum cpp standard supported when installing the package. For C++ projects only + 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": + raise ConanInvalidConfiguration(f"{self.ref} can be used only on Windows.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + # Folders not used for header-only + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # https://github.com/microsoft/wil/blob/56e3e5aa79234f8de3ceeeaf05b715b823bc2cca/CMakeLists.txt#L53 + self.cpp_info.set_property("cmake_file_name", "wil") + self.cpp_info.set_property("cmake_target_name", "WIL::WIL") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "wil" + self.cpp_info.filenames["cmake_find_package_multi"] = "wil" + self.cpp_info.names["cmake_find_package"] = "WIL" + self.cpp_info.names["cmake_find_package_multi"] = "WIL" diff --git a/recipes/wil/all/patches/1.0.230202.1-0001-fix-type-conversion.patch b/recipes/wil/all/patches/1.0.230202.1-0001-fix-type-conversion.patch new file mode 100644 index 0000000000000..3144a0ddbd304 --- /dev/null +++ b/recipes/wil/all/patches/1.0.230202.1-0001-fix-type-conversion.patch @@ -0,0 +1,11 @@ +--- a/include/wil/resource.h ++++ b/include/wil/resource.h +@@ -2547,7 +2547,7 @@ namespace wil + } + + template +- using unique_private_namespace = unique_any_handle_null_only), &details::ClosePrivateNamespaceHelper>; ++ using unique_private_namespace = unique_any_handle_null_only>; + + using unique_private_namespace_close = unique_private_namespace<>; + using unique_private_namespace_destroy = unique_private_namespace; diff --git a/recipes/wil/all/test_package/CMakeLists.txt b/recipes/wil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..69bc898ac6c03 --- /dev/null +++ b/recipes/wil/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(wil REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE WIL::WIL) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wil/all/test_package/conanfile.py b/recipes/wil/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/wil/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wil/all/test_package/test_package.cpp b/recipes/wil/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..73b8b076ec5af --- /dev/null +++ b/recipes/wil/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include "wil/resource.h" + + +int main(void) { + SetLastError(42); + // check for simple function call: + auto error42 = wil::last_error_context(); + + return EXIT_SUCCESS; +} diff --git a/recipes/wil/all/test_v1_package/CMakeLists.txt b/recipes/wil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/wil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wil/all/test_v1_package/conanfile.py b/recipes/wil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/wil/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wil/config.yml b/recipes/wil/config.yml new file mode 100644 index 0000000000000..5d004c574dfa1 --- /dev/null +++ b/recipes/wil/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.230202.1": + folder: "all" diff --git a/recipes/wildmidi/all/conandata.yml b/recipes/wildmidi/all/conandata.yml new file mode 100644 index 0000000000000..aeed5ef43a0f2 --- /dev/null +++ b/recipes/wildmidi/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.5": + url: "https://github.com/Mindwerks/wildmidi/releases/download/wildmidi-0.4.5/wildmidi-0.4.5.tar.gz" + sha256: "d5e7bef00a7aa47534a53d43b1265f8d3d27f6a28e7f563c1cdf02ff4fa35b99" diff --git a/recipes/wildmidi/all/conanfile.py b/recipes/wildmidi/all/conanfile.py new file mode 100644 index 0000000000000..0e6c15d33a72b --- /dev/null +++ b/recipes/wildmidi/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import export_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class WildmidiConan(ConanFile): + name = "wildmidi" + description = "WildMIDI is a simple software midi player which has a core softsynth library that can be used in other applications." + license = "LGPL-3.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.mindwerks.net/projects/wildmidi" + topics = ("audio", "midi", "multimedia", "music", "softsynth", "sound", "synth") + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os == "Windows": + tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type + tc.variables["WANT_PLAYER"] = False + if not self.options.shared: + tc.variables["WANT_STATIC"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="docs/license/LGPLv3.txt", dst=os.path.join( + self.package_folder, "licenses"), src=self.source_folder, keep_path=False) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + if is_msvc(self): + libname = "libWildMidi" + if not self.options.shared: + libname += "-static" + else: + libname = "WildMidi" + + self.cpp_info.set_property("cmake_file_name", "WildMidi") + self.cpp_info.set_property("cmake_target_name", "WildMidi::libwildmidi") + self.cpp_info.set_property("pkg_config_name", "wildmidi") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["libwildmidi"].libs = [libname] + if not self.options.shared: + self.cpp_info.components["libwildmidi"].defines = ["WILDMIDI_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libwildmidi"].system_libs.append("m") + + # TODO: remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "WildMidi" + self.cpp_info.names["cmake_find_package_multi"] = "WildMidi" + self.cpp_info.components["libwildmidi"].names["cmake_find_package"] = "libwildmidi" + self.cpp_info.components["libwildmidi"].names["cmake_find_package_multi"] = "libwildmidi" diff --git a/recipes/wildmidi/all/test_package/CMakeLists.txt b/recipes/wildmidi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..583b61deec33c --- /dev/null +++ b/recipes/wildmidi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +find_package(WildMidi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE WildMidi::libwildmidi) diff --git a/recipes/wildmidi/all/test_package/conanfile.py b/recipes/wildmidi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/wildmidi/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/wildmidi/all/test_package/test_package.c b/recipes/wildmidi/all/test_package/test_package.c new file mode 100644 index 0000000000000..d4722893a8b9c --- /dev/null +++ b/recipes/wildmidi/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include + +#include + + +int main(void) { + printf("WildMidi version %d\n", WildMidi_GetVersion()); + + return EXIT_SUCCESS; +} diff --git a/recipes/wildmidi/all/test_v1_package/CMakeLists.txt b/recipes/wildmidi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wildmidi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wildmidi/all/test_v1_package/conanfile.py b/recipes/wildmidi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wildmidi/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wildmidi/config.yml b/recipes/wildmidi/config.yml new file mode 100644 index 0000000000000..2f58813e5d25d --- /dev/null +++ b/recipes/wildmidi/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.5": + folder: all diff --git a/recipes/wilzegers-autotest/all/conandata.yml b/recipes/wilzegers-autotest/all/conandata.yml new file mode 100644 index 0000000000000..febe9d960959c --- /dev/null +++ b/recipes/wilzegers-autotest/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200921": + url: "https://gitlab.com/wilzegers/autotest/-/archive/501c6e96e41c3fb60ac667c17a405b56b2527963/autotest-501c6e96e41c3fb60ac667c17a405b56b2527963.tar.gz" + sha256: "aa4f8fca7cb113e5452c0c09a2dfc1e73989742fccb490dab1aa8c127ca10979" diff --git a/recipes/wilzegers-autotest/all/conanfile.py b/recipes/wilzegers-autotest/all/conanfile.py new file mode 100644 index 0000000000000..8ef12a62b9ce4 --- /dev/null +++ b/recipes/wilzegers-autotest/all/conanfile.py @@ -0,0 +1,36 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +requires_conan_version = ">=1.33.0" + + +class WilzegersAutotestConan(ConanFile): + name = "wilzegers-autotest" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/wilzegers/autotest" + description = "Autotest facilitates the testing of class interfaces" + topics = ("autotest", "testing") + settings = "compiler" + + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def validate(self): + if self.settings.compiler != "clang": + raise ConanInvalidConfiguration("Only clang allowed") + + def package_id(self): + self.info.header_only() + + def package(self): + self.copy("*.hpp", src=os.path.join(self._source_subfolder, "autotest/include"), dst="include") + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) diff --git a/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt b/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..041b6ec23c708 --- /dev/null +++ b/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(wilzegers-autotest REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} wilzegers-autotest::wilzegers-autotest) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) diff --git a/recipes/wilzegers-autotest/all/test_package/conanfile.py b/recipes/wilzegers-autotest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/wilzegers-autotest/all/test_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/wilzegers-autotest/all/test_package/test_package.cpp b/recipes/wilzegers-autotest/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..152f5d33d3410 --- /dev/null +++ b/recipes/wilzegers-autotest/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + AutoTest::Args::integralRange(1, 3); + return 0; +} diff --git a/recipes/wilzegers-autotest/config.yml b/recipes/wilzegers-autotest/config.yml new file mode 100644 index 0000000000000..ad76049192fc2 --- /dev/null +++ b/recipes/wilzegers-autotest/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200921": + folder: "all" diff --git a/recipes/wineditline/all/CMakeLists.txt b/recipes/wineditline/all/CMakeLists.txt new file mode 100644 index 0000000000000..1fedb144d2f6c --- /dev/null +++ b/recipes/wineditline/all/CMakeLists.txt @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000000000..789f36bc66156 --- /dev/null +++ b/recipes/wineditline/all/conandata.yml @@ -0,0 +1,8 @@ +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 diff --git a/recipes/wineditline/all/conanfile.py b/recipes/wineditline/all/conanfile.py new file mode 100644 index 0000000000000..3888bf2a8557f --- /dev/null +++ b/recipes/wineditline/all/conanfile.py @@ -0,0 +1,64 @@ +import functools +import os + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + + +class WineditlineConan(ConanFile): + name = "wineditline" + description = ( + "A BSD-licensed EditLine API implementation for the native " + "Windows Console" + ) + 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") + options = { + "shared": [True, False], + } + default_options = { + "shared": False, + } + exports_sources = ("patches/*", "CMakeLists.txt") + + 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" + + def source(self): + root = self._source_subfolder + get_args = self.conan_data["sources"][self.version] + tools.get(**get_args, destination=root, strip_root=True) + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + @functools.lru_cache(1) + def _configure_cmake(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() + + def package(self): + self.copy("COPYING", "licenses", self._source_subfolder) + self._configure_cmake().install() + + def package_info(self): + self.cpp_info.libs = ["edit"] diff --git a/recipes/wineditline/all/patches/0001-fix-cmakelists.patch b/recipes/wineditline/all/patches/0001-fix-cmakelists.patch new file mode 100644 index 0000000000000..ef01b0ca0616b --- /dev/null +++ b/recipes/wineditline/all/patches/0001-fix-cmakelists.patch @@ -0,0 +1,43 @@ +--- 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 new file mode 100644 index 0000000000000..84a38c545c793 --- /dev/null +++ b/recipes/wineditline/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +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) +target_link_libraries(test_package PRIVATE wineditline::wineditline) diff --git a/recipes/wineditline/all/test_package/conanfile.py b/recipes/wineditline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ec80e0c5cc134 --- /dev/null +++ b/recipes/wineditline/all/test_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/wineditline/all/test_package/test_package.c b/recipes/wineditline/all/test_package/test_package.c new file mode 100644 index 0000000000000..b51e6feba3274 --- /dev/null +++ b/recipes/wineditline/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const* argv[]) +{ + (void)argc; + (void)argv; + + free_history_entry(NULL); + + return 0; +} diff --git a/recipes/wineditline/config.yml b/recipes/wineditline/config.yml new file mode 100644 index 0000000000000..ae40e4fdf9630 --- /dev/null +++ b/recipes/wineditline/config.yml @@ -0,0 +1,3 @@ +versions: + "2.206": + folder: all diff --git a/recipes/winflexbison/all/conandata.yml b/recipes/winflexbison/all/conandata.yml new file mode 100644 index 0000000000000..c1a75693f1653 --- /dev/null +++ b/recipes/winflexbison/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.5.24": + url: "https://github.com/lexxmark/winflexbison/archive/v2.5.24.tar.gz" + sha256: "a49d6e310636e3487e1e066e411d908cfeae2d5b5fde1f3cf74fe1d6d4301062" + "2.5.22": + url: "https://github.com/lexxmark/winflexbison/archive/v2.5.22.tar.gz" + sha256: "697c2c4af3308625605b75498bd63a9a294660f8e43a4c35452cf4334fa4a530" +patches: + "2.5.24": + - patch_file: "patches/0001-2.5.24-mingw-support.patch" + "2.5.22": + - patch_file: "patches/0001-2.5.22-mingw-support.patch" diff --git a/recipes/winflexbison/all/conanfile.py b/recipes/winflexbison/all/conanfile.py new file mode 100644 index 0000000000000..96dfb9c1906e9 --- /dev/null +++ b/recipes/winflexbison/all/conanfile.py @@ -0,0 +1,90 @@ +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, rename, save +import os + +required_conan_version = ">=1.52.0" + + +class WinflexbisonConan(ConanFile): + name = "winflexbison" + description = "Flex and Bison for Windows" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lexxmark/winflexbison" + topics = ("flex", "bison") + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("winflexbison is only supported on Windows.") + + 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): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _extract_license(self): + with open(os.path.join(self.source_folder, "bison", "data", "skeletons", "glr.cc")) as f: + content_lines = f.readlines() + license_content = [] + for i in range(2, 16): + license_content.append(content_lines[i][2:-1]) + return "\n".join(license_content) + + def package(self): + if self.settings.build_type in ("Release", "Debug"): + exec_build_path = os.path.join(self.source_folder, "bin") + else: + exec_build_path = self.build_folder + package_bin_folder = os.path.join(self.package_folder, "bin") + copy(self, "*.exe", src=exec_build_path, dst=package_bin_folder, keep_path=False) + copy(self, "data/*", src=os.path.join(self.source_folder, "bison"), dst=package_bin_folder, keep_path=True) + copy(self, "FlexLexer.h", src=os.path.join(self.source_folder, "flex", "src"), dst=os.path.join(self.package_folder, "include"), keep_path=False) + + # Copy licenses + package_license_folder = os.path.join(self.package_folder, "licenses") + save(self, os.path.join(package_license_folder, "COPYING.GPL3"), self._extract_license()) + copy(self, "COPYING", src=os.path.join(self.source_folder, "flex", "src"), dst=package_license_folder, keep_path=False) + rename(self, os.path.join(package_license_folder, "COPYING"), os.path.join(package_license_folder, "bison-license")) + copy(self, "COPYING", src=os.path.join(self.source_folder, "bison", "src"), dst=package_license_folder, keep_path=False) + rename(self, os.path.join(package_license_folder, "COPYING"), os.path.join(package_license_folder, "flex-license")) + + def package_info(self): + # A conan recipe can't emulate 2 Find module files, + # and FindFLEX.cmake & FindBISON.cmake are too complex to emulate anyway + self.cpp_info.set_property("cmake_find_mode", "none") + + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + lex_path = os.path.join(self.package_folder, "bin", "win_flex").replace("\\", "/") + self.output.info("Setting LEX environment variable: {}".format(lex_path)) + self.buildenv_info.define_path("LEX", lex_path) + + yacc_path = os.path.join(self.package_folder, "bin", "win_bison -y").replace("\\", "/") + self.output.info("Setting YACC environment variable: {}".format(yacc_path)) + self.buildenv_info.define_path("YACC", yacc_path) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.LEX = lex_path + self.env_info.YACC = yacc_path diff --git a/recipes/winflexbison/all/patches/0001-2.5.22-mingw-support.patch b/recipes/winflexbison/all/patches/0001-2.5.22-mingw-support.patch new file mode 100644 index 0000000000000..61d0f0acb55e4 --- /dev/null +++ b/recipes/winflexbison/all/patches/0001-2.5.22-mingw-support.patch @@ -0,0 +1,207 @@ +--- bison/src/config.h ++++ bison/src/config.h +@@ -1,3 +1,4 @@ ++#pragma once + #define PACKAGE_BUGREPORT "http://sourceforge.net/p/winflexbison/tickets" + #define VERSION "3.5.0" + #define PACKAGE_COPYRIGHT_YEAR 2019 +--- bison/src/conflicts.c ++++ bison/src/conflicts.c +@@ -29,7 +29,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "print-xml.h" + #include "reader.h" + #include "state.h" +--- bison/src/lalr.c ++++ bison/src/lalr.c +@@ -33,7 +33,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "nullable.h" + #include "reader.h" +--- bison/src/LR0.c ++++ bison/src/LR0.c +@@ -32,7 +32,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "reader.h" + #include "reduce.h" + #include "state.h" +--- bison/src/main.c ++++ bison/src/main.c +@@ -40,7 +40,7 @@ + #include "gram.h" + #include "ielr.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "nullable.h" + #include "output.h" +--- bison/src/print.c ++++ bison/src/print.c +@@ -29,7 +29,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "print.h" + #include "reader.h" +--- bison/src/print-graph.c ++++ bison/src/print-graph.c +@@ -31,7 +31,7 @@ + #include "gram.h" + #include "graphviz.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "reader.h" + #include "state.h" + #include "symtab.h" +--- bison/src/print-xml.c ++++ bison/src/print-xml.c +@@ -32,7 +32,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "print.h" + #include "reader.h" + #include "reduce.h" +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -3,24 +3,24 @@ + project (winflexbison) + + if(NOT MSVC) +- message( FATAL_ERROR "Visual Studio Build supported only" ) ++# message( FATAL_ERROR "Visual Studio Build supported only" ) + endif() + + # Output Variables + set(OUTPUT_DEBUG "${CMAKE_CURRENT_LIST_DIR}/bin/Debug") + set(OUTPUT_RELEASE "${CMAKE_CURRENT_LIST_DIR}/bin/Release") +- ++if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +- ++endif() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DEBUG}") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_RELEASE}") + + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-D_DEBUG) + endif() + +-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") ++#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") ++#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") + + # Define Release by default. + if(NOT CMAKE_BUILD_TYPE) +--- common/CMakeLists.txt ++++ common/CMakeLists.txt +@@ -4,6 +4,12 @@ + + project(${PROJECT_NAME} C) + ++include(CheckSymbolExists) ++check_symbol_exists(nanouptime "sys/time.h" HAVE_NANOUPTIME) ++check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) ++check_symbol_exists(microuptime "sys/time.h" HAVE_MICROUPTIME) ++check_symbol_exists(timespec_get "time.h" HAVE_TIMESPEC_GET) ++ + # Definition of Macros + add_definitions(-D_LIB) + +@@ -27,6 +33,12 @@ + add_library(${PROJECT_NAME} STATIC + ${SOURCE_FILES} + ) ++target_compile_definitions(${PROJECT_NAME} PRIVATE ++ $<$:HAVE_NANOUPTIME=1> ++ $<$:HAVE_CLOCK_GETTIME=1> ++ $<$:HAVE_MICROUPTIME=1> ++ $<$:HAVE_TIMESPEC_GET=1> ++) + + target_include_directories(${PROJECT_NAME} PUBLIC "misc") + target_include_directories(${PROJECT_NAME} PUBLIC "m4") +--- common/m4/lib/clean-temp.h ++++ common/m4/lib/clean-temp.h +@@ -107,7 +107,7 @@ + Return 0 upon success, or -1 if there was some problem. */ + extern int cleanup_temp_dir (struct temp_dir *dir); +- +-typedef int mode_t; +- ++#if defined _MSC_VER ++typedef int mode_t; ++#endif + /* Open a temporary file in a temporary directory. + Registers the resulting file descriptor to be closed. */ +--- common/misc/gethrxtime.c ++++ common/misc/gethrxtime.c +@@ -27,6 +27,6 @@ +-//#include + #include "timespec.h" +- ++#if HAVE_CLOCK_GETTIME ++#include ++#endif + /* Get the current time, as a count of the number of nanoseconds since + an arbitrary epoch (e.g., the system boot time). Prefer a +- high-resolution clock that is not subject to resetting or +@@ -49,8 +49,8 @@ + if (clock_gettime (CLOCK_MONOTONIC, &ts) == 0) + return xtime_make (ts.tv_sec, ts.tv_nsec); + } +-# endif +- ++# ++# else + # if HAVE_MICROUPTIME + { + struct timeval tv; +@@ -69,6 +69,6 @@ + } + # endif + # endif ++# endif + } +- + #endif +--- flex/CMakeLists.txt ++++ flex/CMakeLists.txt +@@ -22,4 +22,4 @@ + + target_include_directories(${PROJECT_NAME} PRIVATE "src") + +-target_link_libraries(${PROJECT_NAME} common_lib kernel32.lib user32.lib Ws2_32.lib) ++target_link_libraries(${PROJECT_NAME} common_lib kernel32 user32 ws2_32) +--- flex/src/tables.c ++++ flex/src/tables.c +@@ -36,7 +36,7 @@ + #include "flexdef.h" + #include "tables.h" + +-#include ++#include + + /** Convert size_t to t_flag. + * @param n in {1,2,4} diff --git a/recipes/winflexbison/all/patches/0001-2.5.24-mingw-support.patch b/recipes/winflexbison/all/patches/0001-2.5.24-mingw-support.patch new file mode 100644 index 0000000000000..185a33eac384c --- /dev/null +++ b/recipes/winflexbison/all/patches/0001-2.5.24-mingw-support.patch @@ -0,0 +1,201 @@ +--- bison/src/config.h ++++ bison/src/config.h +@@ -1,3 +1,4 @@ ++#pragma once + #define PACKAGE_BUGREPORT "https://github.com/lexxmark/winflexbison/issues" + #define VERSION "3.7.4" + #define PACKAGE_COPYRIGHT_YEAR 2020 +--- bison/src/conflicts.c ++++ bison/src/conflicts.c +@@ -30,7 +30,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "print-xml.h" + #include "reader.h" + #include "state.h" +--- bison/src/lalr.c ++++ bison/src/lalr.c +@@ -33,7 +33,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "nullable.h" + #include "reader.h" +--- bison/src/LR0.c ++++ bison/src/LR0.c +@@ -32,7 +32,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "reader.h" + #include "reduce.h" + #include "state.h" +--- bison/src/main.c ++++ bison/src/main.c +@@ -45,7 +45,7 @@ + #include "gram.h" + #include "ielr.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "nullable.h" + #include "output.h" +--- bison/src/print.c ++++ bison/src/print.c +@@ -35,7 +35,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "reader.h" + #include "reduce.h" +--- bison/src/print-graph.c ++++ bison/src/print-graph.c +@@ -31,7 +31,7 @@ + #include "gram.h" + #include "graphviz.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "reader.h" + #include "state.h" + #include "symtab.h" +--- bison/src/print-xml.c ++++ bison/src/print-xml.c +@@ -32,7 +32,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "print.h" + #include "reader.h" + #include "reduce.h" +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -2,18 +2,18 @@ + + project (winflexbison) + +-if(NOT MSVC) +- message( FATAL_ERROR "Visual Studio Build supported only" ) ++if(MSVC) ++ add_definitions(-D_CRT_SECURE_NO_WARNINGS) + endif() + +-add_definitions(-D_CRT_SECURE_NO_WARNINGS) ++ + + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-D_DEBUG) + endif() + +-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") ++#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") ++#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") + + # Define Release by default. + if(NOT CMAKE_BUILD_TYPE) +--- common/CMakeLists.txt ++++ common/CMakeLists.txt +@@ -4,6 +4,12 @@ + + project(${PROJECT_NAME} C) + ++include(CheckSymbolExists) ++check_symbol_exists(nanouptime "sys/time.h" HAVE_NANOUPTIME) ++check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) ++check_symbol_exists(microuptime "sys/time.h" HAVE_MICROUPTIME) ++check_symbol_exists(timespec_get "time.h" HAVE_TIMESPEC_GET) ++ + # Definition of Macros + add_definitions(-D_LIB) + +@@ -27,6 +33,12 @@ + add_library(${PROJECT_NAME} STATIC + ${SOURCE_FILES} + ) ++target_compile_definitions(${PROJECT_NAME} PRIVATE ++ $<$:HAVE_NANOUPTIME=1> ++ $<$:HAVE_CLOCK_GETTIME=1> ++ $<$:HAVE_MICROUPTIME=1> ++ $<$:HAVE_TIMESPEC_GET=1> ++) + + target_include_directories(${PROJECT_NAME} PUBLIC "misc") + target_include_directories(${PROJECT_NAME} PUBLIC "m4") +--- common/m4/lib/clean-temp.h ++++ common/m4/lib/clean-temp.h +@@ -107,7 +107,7 @@ + Return 0 upon success, or -1 if there was some problem. */ + extern int cleanup_temp_dir (struct temp_dir *dir); +- +-typedef int mode_t; +- ++#if defined _MSC_VER ++typedef int mode_t; ++#endif + /* Open a temporary file in a temporary directory. + Registers the resulting file descriptor to be closed. */ +--- common/misc/gethrxtime.c ++++ common/misc/gethrxtime.c +@@ -27,6 +27,6 @@ +-//#include + #include "timespec.h" +- ++#if HAVE_CLOCK_GETTIME ++#include ++#endif + /* Get the current time, as a count of the number of nanoseconds since + an arbitrary epoch (e.g., the system boot time). Prefer a +- high-resolution clock that is not subject to resetting or +@@ -49,8 +49,8 @@ + if (clock_gettime (CLOCK_MONOTONIC, &ts) == 0) + return xtime_make (ts.tv_sec, ts.tv_nsec); + } +-# endif +- ++# ++# else + # if HAVE_MICROUPTIME + { + struct timeval tv; +@@ -69,6 +69,6 @@ + } + # endif + # endif ++# endif + } +- + #endif +--- flex/CMakeLists.txt ++++ flex/CMakeLists.txt +@@ -22,4 +22,4 @@ + + target_include_directories(${PROJECT_NAME} PRIVATE "src") + +-target_link_libraries(${PROJECT_NAME} winflexbison_common kernel32.lib user32.lib Ws2_32.lib) ++target_link_libraries(${PROJECT_NAME} winflexbison_common kernel32 user32 ws2_32) +--- flex/src/tables.c ++++ flex/src/tables.c +@@ -36,7 +36,7 @@ + #include "flexdef.h" + #include "tables.h" + +-#include ++#include + + /** Convert size_t to t_flag. + * @param n in {1,2,4} diff --git a/recipes/winflexbison/all/test_package/CMakeLists.txt b/recipes/winflexbison/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..04ea866fea355 --- /dev/null +++ b/recipes/winflexbison/all/test_package/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) + +# Flex + +set(FLEX_TARGET_COMPILE_FLAGS "") +if(MSVC) + set(FLEX_TARGET_COMPILE_FLAGS "--wincompat") +endif() + +find_package(FLEX REQUIRED) +set(FLEX_VARS + FLEX_FOUND + FLEX_EXECUTABLE + FLEX_LIBRARIES + FLEX_INCLUDE_DIRS +) + +foreach(FLEX_VAR ${FLEX_VARS}) + message("${FLEX_VAR}: ${${FLEX_VAR}}") + if(NOT ${FLEX_VAR}) + message(WARNING "${FLEX_VAR} NOT FOUND") + endif() +endforeach() + +FLEX_TARGET(TestParser basic_nr.l "${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp" COMPILE_FLAGS "${FLEX_TARGET_COMPILE_FLAGS}") +add_executable(flex_test_package ${FLEX_TestParser_OUTPUTS}) +target_compile_features(flex_test_package PRIVATE cxx_std_11) + +# Bison + +find_package(BISON) + +set(BISON_VARS + BISON_FOUND + BISON_EXECUTABLE + BISON_VERSION +) + +foreach(BISON_VAR ${BISON_VARS}) + message("${BISON_VAR}: ${${BISON_VAR}}") + if(NOT ${BISON_VAR}) + message(WARNING "${BISON_VAR} NOT FOUND") + endif() +endforeach() + +bison_target(bison_parser_target mc_parser.yy "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp") + +add_executable(bison_test_package "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp" dummy_lex.c) +target_compile_features(bison_test_package PRIVATE cxx_std_11) +target_include_directories(bison_test_package PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/recipes/winflexbison/all/test_package/basic_nr.l b/recipes/winflexbison/all/test_package/basic_nr.l new file mode 100644 index 0000000000000..391f4db6abe25 --- /dev/null +++ b/recipes/winflexbison/all/test_package/basic_nr.l @@ -0,0 +1,77 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/* TEST scanner. + Basic non-reentrant scanner. + + Sample Input: + # this is a comment + foo = true + bar = "string value" + integer = 43 +*/ +%{ +/* #include "config.h" */ +%} + +%option prefix="test" +%option nounput noyywrap noyylineno warn nodefault noinput + +IDENT [[:alnum:]_-] +WS [[:blank:]] +%% + +^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;} +^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;} +^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;} +^{WS}*#.*\r?\n { } +^{WS}*\r?\n { } +.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);} + +%% + +#include + +int main(int argc, char **argv); + +int main (int argc, char **argv) +{ + FILE *input = NULL; + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + input = fopen(argv[1], "r"); + if (input == NULL) { + fprintf(stderr, "Failed to open '%s'\n", argv[1]); + return 1; + } + yyin = input; + yyout = stdout; + while( yylex() ) + { + } + printf("TEST RETURNING OK.\n"); + fclose(input); + return 0; +} diff --git a/recipes/winflexbison/all/test_package/basic_nr.txt b/recipes/winflexbison/all/test_package/basic_nr.txt new file mode 100644 index 0000000000000..642e0fb7a7dbc --- /dev/null +++ b/recipes/winflexbison/all/test_package/basic_nr.txt @@ -0,0 +1,5 @@ +# this is a comment +foo = "bar" +num = 43 +setting = false + diff --git a/recipes/winflexbison/all/test_package/conanfile.py b/recipes/winflexbison/all/test_package/conanfile.py new file mode 100644 index 0000000000000..30f93d42368f9 --- /dev/null +++ b/recipes/winflexbison/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + self.run("win_flex --version") + self.run("win_bison --version") + if not cross_building(self): + bison_test = os.path.join(self.cpp.build.bindirs[0], "bison_test_package") + self.run(bison_test, env="conanrun") + flex_test = os.path.join(self.cpp.build.bindirs[0], "flex_test_package") + basic_nr_txt = os.path.join(self.source_folder, "basic_nr.txt") + self.run(f"{flex_test} {basic_nr_txt}", env="conanrun") diff --git a/recipes/winflexbison/all/test_package/dummy_lex.c b/recipes/winflexbison/all/test_package/dummy_lex.c new file mode 100644 index 0000000000000..9672cc22d5e8f --- /dev/null +++ b/recipes/winflexbison/all/test_package/dummy_lex.c @@ -0,0 +1,19 @@ +#include "mc_parser.hpp" + +static const int VARS[] = { + NUM, + OPA, + NUM, + STOP, + 0, +}; + +int yylex() { + static unsigned pos = 0; + if (pos > (sizeof(VARS) / sizeof(*VARS))) { + return 0; + } + int r = VARS[pos]; + ++pos; + return r; +} diff --git a/recipes/winflexbison/all/test_package/mc_parser.yy b/recipes/winflexbison/all/test_package/mc_parser.yy new file mode 100644 index 0000000000000..d110acb583cae --- /dev/null +++ b/recipes/winflexbison/all/test_package/mc_parser.yy @@ -0,0 +1,44 @@ +%{ +#include +#include +#include +#include //-- I need this for atoi +using namespace std; + +extern "C" { +int yylex(); +} +int yyerror(const char *p) { cerr << "Error: " << p << endl; return 0; } +%} + +%union { + int val; + char sym; +}; +%token NUM +%token OPA OPM LP RP STOP +%type exp term sfactor factor res + +%% +run: res run | res /* forces bison to process many stmts */ + +res: exp STOP { cout << $1 << endl; } + +exp: exp OPA term { $$ = ($2 == '+' ? $1 + $3 : $1 - $3); } +| term { $$ = $1; } + +term: term OPM factor { $$ = ($2 == '*' ? $1 * $3 : $1 / $3); } +| sfactor { $$ = $1; } + +sfactor: OPA factor { $$ = ($1 == '+' ? $2 : -$2); } +| factor { $$ = $1; } + +factor: NUM { $$ = $1; } +| LP exp RP { $$ = $2; } + +%% +int main() +{ + yyparse(); + return 0; +} diff --git a/recipes/winflexbison/all/test_v1_package/CMakeLists.txt b/recipes/winflexbison/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/winflexbison/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/winflexbison/all/test_v1_package/conanfile.py b/recipes/winflexbison/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..744b30cd87048 --- /dev/null +++ b/recipes/winflexbison/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + test_type = "explicit" + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + self.run("win_flex --version") + self.run("win_bison --version") + if not tools.cross_building(self, skip_x64_x86=True): + bison_test = os.path.join("bin", "bison_test_package") + self.run(bison_test, run_environment=True) + flex_test = os.path.join("bin", "flex_test_package") + basic_nr_txt = os.path.join(self.source_folder, os.pardir, "test_package", "basic_nr.txt") + self.run(f"{flex_test} {basic_nr_txt}", run_environment=True) diff --git a/recipes/winflexbison/config.yml b/recipes/winflexbison/config.yml new file mode 100644 index 0000000000000..480280b1fb8e8 --- /dev/null +++ b/recipes/winflexbison/config.yml @@ -0,0 +1,5 @@ +versions: + "2.5.24": + folder: all + "2.5.22": + folder: all diff --git a/recipes/winmd/all/conandata.yml b/recipes/winmd/all/conandata.yml new file mode 100644 index 0000000000000..df65e2d6e2f3f --- /dev/null +++ b/recipes/winmd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.210629.2": + url: "https://github.com/microsoft/winmd/archive/refs/tags/1.0.210629.2.tar.gz" + sha256: "93ef28b801abc390a2a09a69d56e1200533a5c8d9fc1743cb23afaaa890ac5a8" diff --git a/recipes/winmd/all/conanfile.py b/recipes/winmd/all/conanfile.py new file mode 100644 index 0000000000000..1882e7a4ae703 --- /dev/null +++ b/recipes/winmd/all/conanfile.py @@ -0,0 +1,70 @@ +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 +from conan.tools.microsoft import is_msvc, check_min_vs + +required_conan_version = ">=1.52.0" + + +class WinMDConan(ConanFile): + name = "winmd" + description = "C++ winmd parser" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/winmd" + topics = ("native", "C++", "WinRT", "WinMD") + 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": "12", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + # FIXME: `self.settings` is not available in 2.0 but there are plenty of open issues about + # the migration point. For now we are only going to write valid 1.x recipes until we have a proper answer + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not (fully) support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, 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): + if not is_msvc(self): + # ignore shadowing errors + self.cpp_info.cppflags = ['-fpermissive'] diff --git a/recipes/winmd/all/test_package/CMakeLists.txt b/recipes/winmd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..64e3b97db4f96 --- /dev/null +++ b/recipes/winmd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(winmd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE winmd::winmd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/winmd/all/test_package/conanfile.py b/recipes/winmd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/winmd/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/winmd/all/test_package/test_package.cpp b/recipes/winmd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..94c14b063f2b1 --- /dev/null +++ b/recipes/winmd/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + + +int main(void) { + std::vector include = { "N1", "N3", "N3.N4.N5" }; + std::vector exclude = { "N2", "N3.N4" }; + + winmd::reader::filter f{ include, exclude }; + + return f.empty() ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/recipes/winmd/all/test_v1_package/CMakeLists.txt b/recipes/winmd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/winmd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/winmd/all/test_v1_package/conanfile.py b/recipes/winmd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/winmd/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/winmd/config.yml b/recipes/winmd/config.yml new file mode 100644 index 0000000000000..f7c649835750b --- /dev/null +++ b/recipes/winmd/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0.210629.2": + folder: all diff --git a/recipes/wiringpi/all/CMakeLists.txt b/recipes/wiringpi/all/CMakeLists.txt new file mode 100644 index 0000000000000..fdd0b1aff610c --- /dev/null +++ b/recipes/wiringpi/all/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.8.11) +project(wiringPi C) + +file(GLOB SRC_FILES ${WIRINGPI_SRC_DIR}/wiringPi/*.c) + +message(STATUS "SRC_FILES: ${SRC_FILES}") +if(NOT WIRINGPI_WITH_WPI_EXTENSIONS) + list(FILTER SRC_FILES EXCLUDE REGEX ".*wpiExtensions.c") + list(FILTER SRC_FILES EXCLUDE REGEX ".*drcNet.c") +endif() + +add_library(${PROJECT_NAME} ${SRC_FILES}) +target_include_directories(${PROJECT_NAME} PUBLIC ${WIRINGPI_SRC_DIR}/wiringPi) + +if(WIRINGPI_WITH_DEV_LIB) + file(GLOB SRC_FILES ${WIRINGPI_SRC_DIR}/devLib/*.c) + list(FILTER SRC_FILES EXCLUDE REGEX ".*piFaceOld.c") + add_library(wiringPiDevLib ${SRC_FILES}) + target_include_directories(wiringPiDevLib PUBLIC ${WIRINGPI_SRC_DIR}/devLib + ${WIRINGPI_SRC_DIR}/wiringPi) +endif() + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(DIRECTORY ${WIRINGPI_SRC_DIR}/wiringPi/ DESTINATION include + FILES_MATCHING PATTERN "*.h") + +if(WIRINGPI_WITH_DEV_LIB) + + install(TARGETS wiringPiDevLib + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + + install(DIRECTORY ${WIRINGPI_SRC_DIR}/devLib/ DESTINATION include + FILES_MATCHING PATTERN "*.h") +endif() diff --git a/recipes/wiringpi/all/conandata.yml b/recipes/wiringpi/all/conandata.yml new file mode 100644 index 0000000000000..676b9c65bf9fe --- /dev/null +++ b/recipes/wiringpi/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.61-1": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/2.61-1.tar.gz" + sha256: "b5dc6c6c2ba1349acf602fafd7b58aa81e3fc3216a33b983386264cca0033e12" + "cci.20210727": + url: "https://github.com/WiringPi/WiringPi/archive/7f8fe26e4f775abfced43c07657a353f03ddb2d0.tar.gz" + sha256: "d85f063b1bfe73fd23ed20a3dfb7968be97172a78113d510e2a5f7ddeacc4799" + "2.50": + url: "https://github.com/WiringPi/WiringPi/archive/final_official_2.50.tar.gz" + sha256: "f1ddf17e876f88e074d4597767e365a1b5ef20414a38754884935b38d8c8e932" diff --git a/recipes/wiringpi/all/conanfile.py b/recipes/wiringpi/all/conanfile.py new file mode 100644 index 0000000000000..b1ff871a8a06d --- /dev/null +++ b/recipes/wiringpi/all/conanfile.py @@ -0,0 +1,69 @@ +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 get, copy + +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") + 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} + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + 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 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") + + 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 + 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, pattern="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 = ["wiringPi"] + if self.options.with_devlib: + self.cpp_info.libs.append("wiringPiDevLib") + if self.options.wpi_extensions: + self.cpp_info.libs.append("crypt") + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread", "m", "rt"] diff --git a/recipes/wiringpi/all/test_package/CMakeLists.txt b/recipes/wiringpi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..619241be63343 --- /dev/null +++ b/recipes/wiringpi/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(wiringpi REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package wiringpi::wiringpi) diff --git a/recipes/wiringpi/all/test_package/conanfile.py b/recipes/wiringpi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a623031975d40 --- /dev/null +++ b/recipes/wiringpi/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class wiringPiTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wiringpi/all/test_package/test_package.c b/recipes/wiringpi/all/test_package/test_package.c new file mode 100644 index 0000000000000..3709574be0c80 --- /dev/null +++ b/recipes/wiringpi/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +#include "wiringPi.h" + +int main(void) { + int major = 0; + int minor = 0; + wiringPiVersion(&major, &minor); + printf("WiringPi version: %d.%d\n", major, minor); + + return EXIT_SUCCESS; +} diff --git a/recipes/wiringpi/all/test_v1_package/CMakeLists.txt b/recipes/wiringpi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..caae3a2fdfe40 --- /dev/null +++ b/recipes/wiringpi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(wiringpi REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package wiringpi::wiringpi) diff --git a/recipes/wiringpi/all/test_v1_package/conanfile.py b/recipes/wiringpi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0a93a273ba575 --- /dev/null +++ b/recipes/wiringpi/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(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/config.yml b/recipes/wiringpi/config.yml new file mode 100644 index 0000000000000..b0d56a22c2e0d --- /dev/null +++ b/recipes/wiringpi/config.yml @@ -0,0 +1,7 @@ +versions: + "2.61-1": + folder: "all" + "cci.20210727": + folder: "all" + "2.50": + folder: "all" diff --git a/recipes/wise_enum/all/conandata.yml b/recipes/wise_enum/all/conandata.yml new file mode 100644 index 0000000000000..a7eb4605abb61 --- /dev/null +++ b/recipes/wise_enum/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + url: "https://github.com/quicknir/wise_enum/archive/refs/tags/3.0.0.tar.gz" + sha256: "6e0d62855854ea755dd4277e74a599d1f4e7eec95562baf751151cc2e4df5eb8" diff --git a/recipes/wise_enum/all/conanfile.py b/recipes/wise_enum/all/conanfile.py new file mode 100644 index 0000000000000..88c84965977d4 --- /dev/null +++ b/recipes/wise_enum/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class WiseEnumConan(ConanFile): + name = "wise_enum" + description = ( + "Header-only C++11/14/17 library provides static reflection for enums, " + "work with any enum type without any boilerplate code." + ) + topics = ( + "cplusplus", + "enum-to-string", + "string-to-enum" + "serialization", + "reflection", + "header-only", + "compile-time" + ) + homepage = "https://github.com/quicknir/wise_enum" + url = "https://github.com/conan-io/conan-center-index" + license = "BSL-1.0" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "11" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("Visual Studio is not supported") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "WiseEnum") + self.cpp_info.set_property("cmake_target_name", "WiseEnum::wise_enum") + self.cpp_info.set_property("pkg_config_name", "WiseEnum") + 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"] = "WiseEnum" + self.cpp_info.names["cmake_find_package_multi"] = "WiseEnum" + self.cpp_info.names["pkg_config"] = "WiseEnum" + self.cpp_info.components["_wise_enum"].names["cmake_find_package"] = "wise_enum" + self.cpp_info.components["_wise_enum"].names["cmake_find_package_multi"] = "wise_enum" + self.cpp_info.components["_wise_enum"].set_property("cmake_target_name", "WiseEnum::wise_enum") + self.cpp_info.components["_wise_enum"].set_property("pkg_config_name", "WiseEnum") + self.cpp_info.components["_wise_enum"].bindirs = [] + self.cpp_info.components["_wise_enum"].libdirs = [] diff --git a/recipes/wise_enum/all/test_package/CMakeLists.txt b/recipes/wise_enum/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6131dd641fdb9 --- /dev/null +++ b/recipes/wise_enum/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(WiseEnum REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} WiseEnum::wise_enum) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wise_enum/all/test_package/conanfile.py b/recipes/wise_enum/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/wise_enum/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/wise_enum/all/test_package/test_package.cpp b/recipes/wise_enum/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..adb3daf74624b --- /dev/null +++ b/recipes/wise_enum/all/test_package/test_package.cpp @@ -0,0 +1,79 @@ +#include + +#include +#include + +// Equivalent to enum Color {GREEN = 2, RED}; +namespace my_lib { +WISE_ENUM(Color, (GREEN, 2), RED) +} + +// Equivalent to enum class MoreColor : int64_t {BLUE, BLACK = 1}; +WISE_ENUM_CLASS((MoreColor, int64_t), BLUE, (BLACK, 1)) + +// Inside a class, must use a different macro, but still works +struct Bar { + WISE_ENUM_MEMBER(Foo, BUZ) +}; + +// Adapt an existing enum you don't control so it works with generic code +namespace another_lib { +enum class SomebodyElse { FIRST, SECOND }; +} +WISE_ENUM_ADAPT(another_lib::SomebodyElse, FIRST, SECOND) + +struct Blub { + struct Flub { + + int x = 0; + + }; +}; + +int main() { + + // Number of enumerations: + static_assert(wise_enum::enumerators::size == 2, ""); + std::cerr << "Number of enumerators: " + << wise_enum::enumerators::size << "\n"; + + // Iterate over enums + std::cerr << "Enum values and names:\n"; + for (auto e : wise_enum::enumerators::range) { + std::cerr << static_cast(e.value) << " " << e.name << "\n"; + } + std::cerr << "\n"; + + // Convert any enum to a string + std::cerr << wise_enum::to_string(my_lib::Color::RED) << "\n"; + + // Convert any string to an optional enum + auto x1 = wise_enum::from_string("GREEN"); + auto x2 = wise_enum::from_string("Greeeeeeen"); + + assert(x1.value() == my_lib::Color::GREEN); + assert(!x2); + + // Everything is constexpr, and a type trait is made available for easy use in + // enable_if/tag dispatch + static_assert(wise_enum::is_wise_enum::value, ""); + static_assert(!wise_enum::is_wise_enum::value, ""); + enum flub { blub, glub }; + static_assert(!wise_enum::is_wise_enum::value, ""); + // We made a regular enum wise! + static_assert(wise_enum::is_wise_enum::value, ""); + + // Assert underlying type + static_assert( + std::is_same::type>::value, + ""); + + // Full API available for adapted wise enums + for (auto e : wise_enum::enumerators::range) { + std::cerr << static_cast(e.value) << " " + << wise_enum::to_string(e.value) << "\n"; + } + + return 0; +} diff --git a/recipes/wise_enum/all/test_v1_package/CMakeLists.txt b/recipes/wise_enum/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/wise_enum/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/wise_enum/all/test_v1_package/conanfile.py b/recipes/wise_enum/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/wise_enum/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/wise_enum/config.yml b/recipes/wise_enum/config.yml new file mode 100644 index 0000000000000..c6ac749e0b234 --- /dev/null +++ b/recipes/wise_enum/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.0": + folder: all diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml new file mode 100644 index 0000000000000..9f6956c1ef7de --- /dev/null +++ b/recipes/wolfssl/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "5.5.1": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.5.1-stable.tar.gz" + sha256: "97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3" + "5.4.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.4.0-stable.tar.gz" + sha256: "dc36cc19dad197253e5c2ecaa490c7eef579ad448706e55d73d79396e814098b" + "5.3.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.3.0-stable.tar.gz" + sha256: "1a3bb310dc01d3e73d9ad91b6ea8249d081016f8eef4ae8f21d3421f91ef1de9" + "5.2.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.2.0-stable.tar.gz" + sha256: "409b4646c5f54f642de0e9f3544c3b83de7238134f5b1ff93fb44527bf119d05" + "5.1.1": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.1.1-stable.tar.gz" + sha256: "d3e0544dbe7e9587c0f6538cdc671b6492663bb7a4281819538abe6c99cdbd92" + "4.8.1": + url: "https://github.com/wolfSSL/wolfssl/archive/v4.8.1-stable.tar.gz" + sha256: "50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444" + "4.7.1": + url: "https://github.com/wolfSSL/wolfssl/archive/v4.7.1r.tar.gz" + sha256: "bd13875b0b21e51b558ed797065937dc8530a5b09c219d966c3fc47a182d46a1" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py new file mode 100644 index 0000000000000..d1489495db5d2 --- /dev/null +++ b/recipes/wolfssl/all/conanfile.py @@ -0,0 +1,159 @@ +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 copy, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class WolfSSLConan(ConanFile): + name = "wolfssl" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.wolfssl.com/" + description = ( + "wolfSSL (formerly CyaSSL) is a small, fast, portable implementation " + "of TLS/SSL for embedded devices to the cloud." + ) + topics = ("wolfssl", "tls", "ssl", "iot", "fips", "secure", "cryptology", "secret") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "opensslextra": [True, False], + "opensslall": [True, False], + "sslv3": [True, False], + "alpn": [True, False], + "des3": [True, False], + "tls13": [True, False], + "certgen": [True, False], + "dsa": [True, False], + "ripemd": [True, False], + "sessioncerts": [True, False], + "sni": [True, False], + "testcert": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "opensslextra": False, + "opensslall": False, + "sslv3": False, + "alpn": False, + "des3": False, + "tls13": False, + "certgen": False, + "dsa": False, + "ripemd": False, + "sessioncerts": False, + "sni": False, + "testcert": False, + } + + @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 validate(self): + if self.options.opensslall and not self.options.opensslextra: + raise ConanInvalidConfiguration("The option 'opensslall' requires 'opensslextra=True'") + + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--disable-examples", + "--disable-crypttests", + "--enable-harden", + "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), + "--enable-opensslall={}".format(yes_no(self.options.opensslall)), + "--enable-opensslextra={}".format(yes_no(self.options.opensslextra)), + "--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-certgen={}".format(yes_no(self.options.certgen)), + "--enable-dsa={}".format(yes_no(self.options.dsa)), + "--enable-ripemd={}".format(yes_no(self.options.ripemd)), + "--enable-sessioncerts={}".format(yes_no(self.options.sessioncerts)), + "--enable-sni={}".format(yes_no(self.options.sni)), + "--enable-testcert={}".format(yes_no(self.options.testcert)), + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-static={}".format(yes_no(not self.options.shared)), + ]) + if is_msvc(self): + tc.extra_ldflags.append("-ladvapi32") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + tc.generate(env) + + def build(self): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSING", 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, "bin", "wolfssl-config")) + 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) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "wolfssl.dll.lib"), + os.path.join(self.package_folder, "lib", "wolfssl.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "wolfssl") + self.cpp_info.libs = ["wolfssl"] + if self.options.shared: + self.cpp_info.defines.append("WOLFSSL_DLL") + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["advapi32", "ws2_32"]) diff --git a/recipes/wolfssl/all/test_package/CMakeLists.txt b/recipes/wolfssl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..56df34e610017 --- /dev/null +++ b/recipes/wolfssl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(wolfssl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wolfssl::wolfssl) diff --git a/recipes/wolfssl/all/test_package/conanfile.py b/recipes/wolfssl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/wolfssl/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, run=True) + + 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/wolfssl/all/test_package/test_package.c b/recipes/wolfssl/all/test_package/test_package.c new file mode 100644 index 0000000000000..69857bc35d88f --- /dev/null +++ b/recipes/wolfssl/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "wolfssl/ssl.h" + +int main() +{ + wolfSSL_Init(); + wolfSSL_Cleanup(); + return 0; +} diff --git a/recipes/wolfssl/all/test_v1_package/CMakeLists.txt b/recipes/wolfssl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/wolfssl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/wolfssl/all/test_v1_package/conanfile.py b/recipes/wolfssl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/wolfssl/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/wolfssl/config.yml b/recipes/wolfssl/config.yml new file mode 100644 index 0000000000000..e4db787180ac0 --- /dev/null +++ b/recipes/wolfssl/config.yml @@ -0,0 +1,15 @@ +versions: + "5.5.1": + folder: all + "5.4.0": + folder: all + "5.3.0": + folder: all + "5.2.0": + folder: all + "5.1.1": + folder: all + "4.8.1": + folder: all + "4.7.1": + folder: all diff --git a/recipes/wslay/all/conandata.yml b/recipes/wslay/all/conandata.yml new file mode 100644 index 0000000000000..5a894437f1a9e --- /dev/null +++ b/recipes/wslay/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.1.1": + url: "https://github.com/tatsuhiro-t/wslay/archive/release-1.1.1.tar.gz" + sha256: "7b9f4b9df09adaa6e07ec309b68ab376c0db2cfd916613023b52a47adfda224a" +patches: + "1.1.1": + - patch_file: "patches/0001-msvc-support.patch" + - patch_file: "patches/0002-cmake-install-shared-artifacts.patch" diff --git a/recipes/wslay/all/conanfile.py b/recipes/wslay/all/conanfile.py new file mode 100644 index 0000000000000..0adf9718dbe26 --- /dev/null +++ b/recipes/wslay/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class WslayConan(ConanFile): + name = "wslay" + description = "The WebSocket library in C" + topics = ("websockets", "rfc6455", "communication", "tcp") + homepage = "https://tatsuhiro-t.github.io/wslay" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WSLAY_STATIC"] = not self.options.shared + tc.variables["WSLAY_SHARED"] = self.options.shared + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._wslay_lib_target: "wslay::wslay"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _wslay_lib_target(self): + return "wslay_shared" if self.options.shared else "wslay" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "wslay") + self.cpp_info.set_property("cmake_target_name", self._wslay_lib_target) + self.cpp_info.set_property("pkg_config_name", "libwslay") + self.cpp_info.libs = [self._wslay_lib_target] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + + # 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] + self.cpp_info.names["pkg_config"] = "libwslay" diff --git a/recipes/wslay/all/patches/0001-msvc-support.patch b/recipes/wslay/all/patches/0001-msvc-support.patch new file mode 100644 index 0000000000000..a689fc2452be1 --- /dev/null +++ b/recipes/wslay/all/patches/0001-msvc-support.patch @@ -0,0 +1,74 @@ +diff --git a/.gitignore b/.gitignore +index 189ef71..227efd3 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -11,7 +11,6 @@ missing + autom4te.cache/ + config.guess + config.h +-config.h.in + config.log + config.status + config.sub +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 026be11..c59404e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,10 @@ option(WSLAY_SHARED "Build shared version of the library" OFF) + option(WSLAY_EXAMPLES "Build examples" OFF) + option(WSLAY_TESTS "Build tests" OFF) + ++if(WSLAY_SHARED) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ++endif() ++ + add_subdirectory(lib) + if(WSLAY_EXAMPLES) + add_subdirectory(examples) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 4af972e..96b5392 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -8,7 +8,9 @@ set(PACKAGE_VERSION "1.0.1-DEV") + set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) + set(GEN_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/includes) + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -pedantic-errors -Wno-long-long") ++if(NOT MSVC) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-long-long") ++endif() + + include(CheckIncludeFile) + include(TestBigEndian) +@@ -40,10 +42,16 @@ set(WSLAY_TARGETS) + if(WSLAY_STATIC) + add_library(wslay STATIC ${SOURCES} ${HEADERS}) + list(APPEND WSLAY_TARGETS wslay) ++ if(MSVC) ++ target_link_libraries(wslay PUBLIC ws2_32) ++ endif() + endif() + if(WSLAY_SHARED) + add_library(wslay_shared SHARED ${SOURCES} ${HEADERS}) + list(APPEND WSLAY_TARGETS wslay_shared) ++ if(MSVC) ++ target_link_libraries(wslay_shared PUBLIC ws2_32) ++ endif() + endif() + + foreach(target ${WSLAY_TARGETS}) +diff --git a/lib/includes/wslay/wslay.h b/lib/includes/wslay/wslay.h +index 2fde81a..81d3e03 100644 +--- a/lib/includes/wslay/wslay.h ++++ b/lib/includes/wslay/wslay.h +@@ -33,6 +33,10 @@ extern "C" { + #include + #include + ++#ifdef _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#endif + + /* + * wslay/wslayver.h is generated from wslay/wslayver.h.in by diff --git a/recipes/wslay/all/patches/0002-cmake-install-shared-artifacts.patch b/recipes/wslay/all/patches/0002-cmake-install-shared-artifacts.patch new file mode 100644 index 0000000000000..abaab4f5b298c --- /dev/null +++ b/recipes/wslay/all/patches/0002-cmake-install-shared-artifacts.patch @@ -0,0 +1,10 @@ +--- lib/CMakeLists.txt ++++ lib/CMakeLists.txt +@@ -68,6 +68,7 @@ + include(GNUInstallDirs) + install(TARGETS ${WSLAY_TARGETS} EXPORT wslay + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(DIRECTORY ${INCLUDE_DIR}/ ${GEN_INCLUDE_DIR}/ diff --git a/recipes/wslay/all/test_package/CMakeLists.txt b/recipes/wslay/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f2c295f8ed13 --- /dev/null +++ b/recipes/wslay/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(wslay REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET wslay_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE wslay_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE wslay) +endif() diff --git a/recipes/wslay/all/test_package/conanfile.py b/recipes/wslay/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/wslay/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/wslay/all/test_package/test_package.c b/recipes/wslay/all/test_package/test_package.c new file mode 100644 index 0000000000000..c7854019b503b --- /dev/null +++ b/recipes/wslay/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include "stdlib.h" + +#include "wslay/wslay.h" + +int main() +{ + wslay_event_context_ptr ctx; + const struct wslay_event_callbacks callbacks = { NULL }; + + if(wslay_event_context_client_init(&ctx, &callbacks, NULL)) + { + wslay_event_context_free(ctx); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/wslay/all/test_v1_package/CMakeLists.txt b/recipes/wslay/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/wslay/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/wslay/all/test_v1_package/conanfile.py b/recipes/wslay/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/wslay/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/wslay/config.yml b/recipes/wslay/config.yml new file mode 100644 index 0000000000000..60d31991f5141 --- /dev/null +++ b/recipes/wslay/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1": + folder: all diff --git a/recipes/wt/all/conandata.yml b/recipes/wt/all/conandata.yml new file mode 100644 index 0000000000000..8b83e78419f05 --- /dev/null +++ b/recipes/wt/all/conandata.yml @@ -0,0 +1,74 @@ +sources: + "4.9.1": + url: "https://github.com/emweb/wt/archive/4.9.1.tar.gz" + sha256: "253c61779623ed125bdd604a7b7fe48e64bd991548d17180f040bfa88ccafd98" + "4.8.0": + url: "https://github.com/emweb/wt/archive/4.8.0.tar.gz" + sha256: "e4030d8f530ec7bdd6b341a2bf31a608fb9ebcedb905155f83ec7f300a7d420d" + "4.7.1": + url: "https://github.com/emweb/wt/archive/4.7.1.tar.gz" + sha256: "04548ff017b026f7c2e46fd2f12cc70fbeeadebaf473fb1d6eb472868d11dce1" + "4.6.2": + url: "https://github.com/emweb/wt/archive/refs/tags/4.6.2.tar.gz" + sha256: "a4e113874c107185a18b052f6d8fe57114d47b26410dee148ed22652eeff4d2f" + "4.6.0": + url: "https://github.com/emweb/wt/archive/4.6.0.tar.gz" + sha256: "7f709e132d32c4925e6db0a590c7ccc5613344e8b9052676ef891a25ccb550e6" + "4.5.1": + url: "https://github.com/emweb/wt/archive/4.5.1.tar.gz" + sha256: "c2820646095af5618fc235705c0108797e3898225fb1826f2c6185c405c21a17" + "4.5.0": + url: "https://github.com/emweb/wt/archive/4.5.0.tar.gz" + sha256: "119b1eae83285a153b9c901d3f4f25775c7a460d30b1e48242d7d2d649d61deb" + "4.4.0": + url: "https://github.com/emweb/wt/archive/4.4.0.tar.gz" + sha256: "2eabefea915ecc4deb36f9f67ab30dd3b1f6c73893d76c9d9fa39ac25f4f3690" + "4.3.1": + url: "https://github.com/emweb/wt/archive/4.3.1.tar.gz" + sha256: "6c0130f36c829ed67119679770c2f62d7768a62eaa281bb10070c4cf1b145139" +patches: + "4.9.1": + - patch_file: "patches/4.8.0-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.8.0": + - patch_file: "patches/4.8.0-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.7.1": + - patch_file: "patches/4.7.1-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.6.2": + - patch_file: "patches/4.6.2-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.6.0": + - patch_file: "patches/4.6.2-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.5.1": + - patch_file: "patches/4.3.1-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.5.0": + - patch_file: "patches/4.3.1-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/4.3.1-0002-gcc_11.patch" + patch_description: "include limits header" + patch_type: "portability" + "4.4.0": + - patch_file: "patches/4.3.1-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/4.3.1-0002-gcc_11.patch" + patch_description: "include limits header" + patch_type: "portability" + "4.3.1": + - patch_file: "patches/4.3.1-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/4.3.1-0002-gcc_11.patch" + patch_description: "include limits header" + patch_type: "portability" diff --git a/recipes/wt/all/conanfile.py b/recipes/wt/all/conanfile.py new file mode 100644 index 0000000000000..6378a056d8e5c --- /dev/null +++ b/recipes/wt/all/conanfile.py @@ -0,0 +1,393 @@ +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +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 +import shutil + +required_conan_version = ">=1.53.0" + +class WtConan(ConanFile): + name = "wt" + description = "Wt is a C++ library for developing web applications" + license = "GPL-2.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/emweb/wt" + topics = ("server", "web", "webapp", "websocket", "cgi", "fastcgi", "orm") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + "with_sqlite": [True, False], + "with_postgres": [True, False], + "with_mysql": [True, False], + "with_mssql": [True, False], + "with_test": [True, False], + "with_dbo": [True, False], + "with_opengl": [True, False], + "with_unwind": [True, False], + "no_std_locale": [True, False], + "no_std_wstring": [True, False], + "multi_threaded": [True, False], + "connector_http": [True, False], + "connector_isapi": [True, False], + "connector_fcgi": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": True, + "with_sqlite": True, + "with_postgres": True, + "with_mysql": True, + "with_mssql": False, + "with_test": False, + "with_dbo": True, + "with_opengl": False, + "with_unwind": True, + "no_std_locale": False, + "no_std_wstring": False, + "multi_threaded": True, + "connector_http": True, + "connector_isapi": True, + "connector_fcgi": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.connector_fcgi + else: + del self.options.connector_isapi + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_unwind + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.with_dbo: + del self.options.with_sqlite + del self.options.with_postgres + del self.options.with_mysql + del self.options.with_mssql + self._strict_options_requirements() + + def layout(self): + cmake_layout(self, src_folder="src") + + def _strict_options_requirements(self): + self.options["boost"].header_only = False + for boost_comp in self._required_boost_components: + setattr(self.options["boost"], f"without_{boost_comp}", False) + + @property + def _required_boost_components(self): + return ["program_options", "filesystem", "thread"] + + def requirements(self): + if Version(self.version) < "4.6.0": + self.requires("boost/1.76.0") + elif Version(self.version) < "4.9.0": + self.requires("boost/1.80.0") + else: + self.requires("boost/1.81.0") + if self.options.connector_http: + self.requires("zlib/1.2.13") + if self.options.with_ssl: + self.requires("openssl/1.1.1t") + if self.options.get_safe("with_sqlite"): + self.requires("sqlite3/3.41.1") + if self.options.get_safe("with_mysql"): + self.requires("libmysqlclient/8.0.31", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("with_postgres"): + self.requires("libpq/14.7", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("with_mssql") and self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("with_unwind"): + self.requires("libunwind/1.6.2") + + def validate(self): + 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)}" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _get_library_extension(self, dep): + if self.dependencies[dep].options.shared: + if self.settings.os == "Windows" : + if is_msvc(self): + return ".lib" + else: + return ".dll.a" + elif self.settings.os == "Macos": + return ".dylib" + else: + return ".so" + else: + if self.settings.os == "Windows" and is_msvc(self): + return ".lib" + else: + return ".a" + + @property + def _get_library_prefix(self): + return "" if self.settings.os == "Windows" else "lib" + + def _cmakify_path_list(self, paths): + return ";".join(paths).replace("\\", "/") + + def _find_library(self, libname, dep): + for path in self.dependencies[dep].cpp_info.aggregated_components().libdirs: + lib_fullpath = os.path.join(path, self._get_library_prefix + libname + self._get_library_extension(dep)) + self.output.info("_find_library : " + str(lib_fullpath)) + if os.path.isfile(lib_fullpath): + return lib_fullpath + raise ConanException(f"Library {lib_fullpath} not found") + + def _find_libraries(self, dep): + + return [self._find_library(lib, dep) for lib in self.dependencies[dep].cpp_info.aggregated_components().libs] + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CONFIGDIR"] = os.path.join(self.package_folder, "bin").replace("\\", "/") + tc.variables["SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["ENABLE_SSL"] = self.options.with_ssl + tc.variables["ENABLE_HARU"] = False + tc.variables["ENABLE_PANGO"] = False + tc.variables["ENABLE_SQLITE"] = self.options.get_safe("with_sqlite", False) + tc.variables["ENABLE_POSTGRES"] = self.options.get_safe("with_postgres", False) + tc.variables["ENABLE_FIREBIRD"] = False + tc.variables["ENABLE_MYSQL"] = self.options.get_safe("with_mysql", False) + tc.variables["ENABLE_MSSQLSERVER"] = self.options.get_safe("with_mssql", False) + tc.variables["ENABLE_QT4"] = False + tc.variables["ENABLE_QT5"] = False + tc.variables["ENABLE_LIBWTTEST"] = self.options.with_test + tc.variables["ENABLE_LIBWTDBO"] = self.options.with_dbo + tc.variables["ENABLE_OPENGL"] = self.options.with_opengl + tc.variables["ENABLE_UNWIND"] = self.options.get_safe("with_unwind", False) + tc.variables["WT_NO_STD_LOCALE"] = self.options.no_std_locale + tc.variables["WT_NO_STD_WSTRING"] = self.options.no_std_wstring + tc.variables["MULTI_THREADED"] = self.options.multi_threaded + tc.variables["USE_SYSTEM_SQLITE3"] = True + tc.variables["DEBUG"] = self.settings.build_type == "Debug" + tc.variables["CONNECTOR_HTTP"] = self.options.connector_http + tc.variables["BOOST_DYNAMIC"] = self.dependencies["boost"].options.get_safe("shared", False) + + # FIXME: all this logic coming from upstream custom find module files seems fragile, to improve later ! + # we can't even inject cmake_find_package generator, it breaks the all upstream logic + tc.variables["BOOST_PREFIX"] = self._cmakify_path_list(self.dependencies["boost"].package_folder) + if self.options.connector_http: + tc.variables["ZLIB_PREFIX"] = self._cmakify_path_list(self.dependencies["zlib"].package_folder) + if self.options.with_ssl: + tc.variables["SSL_PREFIX"] = self._cmakify_path_list(self.dependencies["openssl"].package_folder) + tc.variables["OPENSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("openssl")) + tc.variables["OPENSSL_INCLUDE_DIR"] = self._cmakify_path_list(self.dependencies["openssl"].cpp_info.aggregated_components().includedirs) + tc.variables["OPENSSL_FOUND"] = True + if self.options.get_safe("with_sqlite"): + tc.variables["SQLITE3_PREFIX"] = self._cmakify_path_list(self.dependencies["sqlite3"].package_folder) + if self.options.get_safe("with_mysql"): + tc.variables["MYSQL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libmysqlclient")) + libmysqlclient_cppinfo = self.dependencies["libmysqlclient"].cpp_info.aggregated_components() + tc.variables["MYSQL_INCLUDE"] = self._cmakify_path_list(libmysqlclient_cppinfo.includedirs) + tc.variables["MYSQL_DEFINITIONS"] = ";".join(f"-D{d}" for d in libmysqlclient_cppinfo.defines) + tc.variables["MYSQL_FOUND"] = True + if self.options.get_safe("with_postgres"): + tc.variables["POSTGRES_PREFIX"] = self._cmakify_path_list(self.dependencies["libpq"].package_folder) + tc.variables["POSTGRES_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libpq")) + tc.variables["POSTGRES_INCLUDE"] = self._cmakify_path_list(self.dependencies["libpq"].cpp_info.aggregated_components().includedirs) + tc.variables["POSTGRES_FOUND"] = True + if self.options.get_safe("with_mssql") and self.settings.os != "Windows": + tc.variables["ODBC_PREFIX"] = self._cmakify_path_list(self.dependencies["odbc"].package_folder) + tc.variables["ODBC_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("odbc")) + tc.variables["ODBC_INCLUDE"] = self._cmakify_path_list(self.dependencies["odbc"].cpp_info.aggregated_components().includedirs) + tc.variables["ODBC_FOUND"] = True + if self.options.get_safe("with_unwind"): + tc.variables["UNWIND_PREFIX"] = self._cmakify_path_list(self.dependencies["libunwind"].package_folder) + if self.settings.os == "Windows": + tc.variables["CONNECTOR_FCGI"] = False + tc.variables["CONNECTOR_ISAPI"] = self.options.connector_isapi + else: + tc.variables["CONNECTOR_FCGI"] = self.options.connector_fcgi + tc.variables["CONNECTOR_ISAPI"] = False + + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(OpenSSL)", "#find_package(OpenSSL)") + replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindMysql.txt)", "#INCLUDE(cmake/WtFindMysql.txt)") + replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindPostgresql.txt)", "#INCLUDE(cmake/WtFindPostgresql.txt)") + if self.settings.os != "Windows": + replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindOdbc.txt)", "#INCLUDE(cmake/WtFindOdbc.txt)") + + # Do not pollute rpath of shared libs of the install tree on macOS please + replace_in_file(self, + cmakelists, + "IF(APPLE)\n SET(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/lib\")", + "if(0)", + ) + + replace_in_file(self, + os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "TARGET_LINK_LIBRARIES(wt PRIVATE Crypt32.lib)", + "TARGET_LINK_LIBRARIES(wt PUBLIC crypt32)" + ) + + dbo_cmakelsts = os.path.join(self.source_folder, "src", "Wt", "Dbo", "backend", "CMakeLists.txt") + replace_in_file(self, dbo_cmakelsts, "FIND_PACKAGE( Sqlite3 REQUIRED)", "FIND_PACKAGE( SQLite3 REQUIRED)") + replace_in_file(self, dbo_cmakelsts, '${SQLITE3_LIBRARIES}', '${SQLite3_LIBRARIES}') + + 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() + shutil.move(os.path.join(self.package_folder, "share", "Wt"), os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "var")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "wt") + + suffix = "d" if self.settings.build_type == "Debug" else "" + + # wt + self.cpp_info.components["wtmain"].set_property("cmake_target_name", "Wt::Wt") + self.cpp_info.components["wtmain"].libs = ["wt{}".format(suffix)] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["wtmain"].system_libs = ["m", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.components["wtmain"].system_libs = ["ws2_32", "mswsock", "winmm"] + if Version(self.version) >= "4.9.0": + self.cpp_info.components["wtmain"].system_libs.extend(["dwrite", "d2d1", "shlwapi"]) + self.cpp_info.components["wtmain"].requires = ["boost::boost"] + if self.options.with_ssl: + self.cpp_info.components["wtmain"].requires.append("openssl::openssl") + if self.options.get_safe("with_unwind"): + self.cpp_info.components["wtmain"].requires.append("libunwind::libunwind") + + # wttest + if self.options.with_test: + self.cpp_info.components["wttest"].set_property("cmake_target_name", "Wt::Test") + self.cpp_info.components["wttest"].libs = ["wttest{}".format(suffix)] + self.cpp_info.components["wttest"].requires = ["wtmain"] + + # wthttp + if self.options.connector_http: + self.cpp_info.components["wthttp"].set_property("cmake_target_name", "Wt::HTTP") + self.cpp_info.components["wthttp"].libs = ["wthttp{}".format(suffix)] + self.cpp_info.components["wthttp"].requires = ["wtmain", "boost::boost", "zlib::zlib"] + if self.options.with_ssl: + self.cpp_info.components["wthttp"].requires.append("openssl::openssl") + + # wtisapi + if self.options.get_safe("connector_isapi"): + self.cpp_info.components["wtisapi"].set_property("cmake_target_name", "Wt::Isapi") + self.cpp_info.components["wtisapi"].libs = ["wtisapi{}".format(suffix)] + self.cpp_info.components["wtisapi"].requires = ["wtmain"] + + # wtfcgi + if self.options.get_safe("connector_fcgi"): + self.cpp_info.components["wtfcgi"].set_property("cmake_target_name", "Wt::FCGI") + self.cpp_info.components["wtfcgi"].libs = ["wtfcgi{}".format(suffix)] + self.cpp_info.components["wtfcgi"].requires = ["wtmain"] + if self.options.with_ssl: + self.cpp_info.components["wtfcgi"].requires.append("openssl::openssl") + + # wtdbo + if self.options.with_dbo: + self.cpp_info.components["wtdbo"].set_property("cmake_target_name", "Wt::Dbo") + self.cpp_info.components["wtdbo"].libs = ["wtdbo{}".format(suffix)] + if self.options.get_safe("with_unwind"): + self.cpp_info.components["wtdbo"].requires.append("libunwind::libunwind") + + # wtdbosqlite3 + if self.options.get_safe("with_sqlite"): + self.cpp_info.components["wtdbosqlite3"].set_property("cmake_target_name", "Wt::DboSqlite3") + self.cpp_info.components["wtdbosqlite3"].libs = ["wtdbosqlite3{}".format(suffix)] + self.cpp_info.components["wtdbosqlite3"].requires = ["wtdbo", "sqlite3::sqlite3"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["wtdbosqlite3"].system_libs = ["m"] + + # wtdbopostgres + if self.options.get_safe("with_postgres"): + self.cpp_info.components["wtdbopostgres"].set_property("cmake_target_name", "Wt::DboPostgres") + self.cpp_info.components["wtdbopostgres"].libs = ["wtdbopostgres{}".format(suffix)] + self.cpp_info.components["wtdbopostgres"].requires = ["wtdbo", "libpq::libpq"] + + # wtdbomysql + if self.options.get_safe("with_mysql"): + self.cpp_info.components["wtdbomysql"].set_property("cmake_target_name", "Wt::DboMySQL") + self.cpp_info.components["wtdbomysql"].libs = ["wtdbomysql{}".format(suffix)] + self.cpp_info.components["wtdbomysql"].requires = ["wtdbo", "libmysqlclient::libmysqlclient"] + + # wtdbomssqlserver + if self.options.get_safe("with_mssql"): + self.cpp_info.components["wtdbomssqlserver"].set_property("cmake_target_name", "Wt::DboMSSQLServer") + self.cpp_info.components["wtdbomssqlserver"].libs = ["wtdbomssqlserver{}".format(suffix)] + self.cpp_info.components["wtdbomssqlserver"].requires = ["wtdbo"] + if self.settings.os == "Windows": + self.cpp_info.components["wtdbomssqlserver"].system_libs.append("odbc32") + else: + self.cpp_info.components["wtdbomssqlserver"].requires.append("odbc::odbc") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "wt" + self.cpp_info.filenames["cmake_find_package_multi"] = "wt" + self.cpp_info.names["cmake_find_package"] = "Wt" + self.cpp_info.names["cmake_find_package_multi"] = "Wt" + self.cpp_info.components["wtmain"].names["cmake_find_package"] = "Wt" + self.cpp_info.components["wtmain"].names["cmake_find_package_multi"] = "Wt" + if self.options.with_test: + self.cpp_info.components["wttest"].names["cmake_find_package"] = "Test" + self.cpp_info.components["wttest"].names["cmake_find_package_multi"] = "Test" + if self.options.connector_http: + self.cpp_info.components["wthttp"].names["cmake_find_package"] = "HTTP" + self.cpp_info.components["wthttp"].names["cmake_find_package_multi"] = "HTTP" + if self.options.get_safe("connector_isapi"): + self.cpp_info.components["wtisapi"].names["cmake_find_package"] = "Isapi" + self.cpp_info.components["wtisapi"].names["cmake_find_package_multi"] = "Isapi" + if self.options.get_safe("connector_fcgi"): + self.cpp_info.components["wtfcgi"].names["cmake_find_package"] = "FCGI" + self.cpp_info.components["wtfcgi"].names["cmake_find_package_multi"] = "FCGI" + if self.options.with_dbo: + self.cpp_info.components["wtdbo"].names["cmake_find_package"] = "Dbo" + self.cpp_info.components["wtdbo"].names["cmake_find_package_multi"] = "Dbo" + if self.options.get_safe("with_sqlite"): + self.cpp_info.components["wtdbosqlite3"].names["cmake_find_package"] = "DboSqlite3" + self.cpp_info.components["wtdbosqlite3"].names["cmake_find_package_multi"] = "DboSqlite3" + if self.options.get_safe("with_postgres"): + self.cpp_info.components["wtdbopostgres"].names["cmake_find_package"] = "DboPostgres" + self.cpp_info.components["wtdbopostgres"].names["cmake_find_package_multi"] = "DboPostgres" + if self.options.get_safe("with_mysql"): + self.cpp_info.components["wtdbomysql"].names["cmake_find_package"] = "DboMySQL" + self.cpp_info.components["wtdbomysql"].names["cmake_find_package_multi"] = "DboMySQL" + if self.options.get_safe("with_mssql"): + self.cpp_info.components["wtdbomssqlserver"].names["cmake_find_package"] = "DboMSSQLServer" + self.cpp_info.components["wtdbomssqlserver"].names["cmake_find_package_multi"] = "DboMSSQLServer" diff --git a/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch b/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch new file mode 100644 index 0000000000000..af7c47db572a3 --- /dev/null +++ b/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch @@ -0,0 +1,32 @@ +diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt +index 827abf3..5324034 100644 +--- a/src/Wt/Dbo/backend/CMakeLists.txt ++++ b/src/Wt/Dbo/backend/CMakeLists.txt +@@ -127,11 +127,12 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY CXX_VISIBILITY_PRESET hidden) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY VISIBILITY_INLINES_HIDDEN YES) + ++ find_package(PostgreSQL REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbopostgres + PUBLIC + wtdbo + PRIVATE +- ${POSTGRES_LIBRARIES} ++ PostgreSQL::PostgreSQL + ) + + IF(TARGET Boost::headers) +@@ -291,11 +292,12 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) + SET_PROPERTY(TARGET wtdbomysql PROPERTY CXX_VISIBILITY_PRESET hidden) + SET_PROPERTY(TARGET wtdbomysql PROPERTY VISIBILITY_INLINES_HIDDEN YES) + ++ find_package(libmysqlclient REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbomysql + PUBLIC + wtdbo + PRIVATE +- ${MYSQL_LIBRARIES} ++ libmysqlclient::libmysqlclient + ) + + INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch b/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch new file mode 100644 index 0000000000000..03d2aaff9236b --- /dev/null +++ b/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch @@ -0,0 +1,10 @@ +--- a/src/Wt/Render/WTextRenderer.C ++++ b/src/Wt/Render/WTextRenderer.C +@@ -14,6 +14,7 @@ + #include "Block.h" + + #include ++#include + #include + + namespace { diff --git a/recipes/wt/all/patches/4.6.2-0001-use-cci-package.patch b/recipes/wt/all/patches/4.6.2-0001-use-cci-package.patch new file mode 100644 index 0000000000000..26c77ec5e6079 --- /dev/null +++ b/recipes/wt/all/patches/4.6.2-0001-use-cci-package.patch @@ -0,0 +1,32 @@ +diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt +index e53075b..c470b8e 100644 +--- a/src/Wt/Dbo/backend/CMakeLists.txt ++++ b/src/Wt/Dbo/backend/CMakeLists.txt +@@ -118,11 +118,12 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY CXX_VISIBILITY_PRESET hidden) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY VISIBILITY_INLINES_HIDDEN YES) + ++ find_package(PostgreSQL REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbopostgres + PUBLIC + wtdbo + PRIVATE +- ${POSTGRES_LIBRARIES} ++ PostgreSQL::PostgreSQL + ) + + IF(TARGET Boost::headers) +@@ -282,11 +283,12 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) + SET_PROPERTY(TARGET wtdbomysql PROPERTY CXX_VISIBILITY_PRESET hidden) + SET_PROPERTY(TARGET wtdbomysql PROPERTY VISIBILITY_INLINES_HIDDEN YES) + ++ find_package(libmysqlclient REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbomysql + PUBLIC + wtdbo + PRIVATE +- ${MYSQL_LIBRARIES} ++ libmysqlclient::libmysqlclient + ) + + INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/recipes/wt/all/patches/4.7.1-0001-use-cci-package.patch b/recipes/wt/all/patches/4.7.1-0001-use-cci-package.patch new file mode 100644 index 0000000000000..26c77ec5e6079 --- /dev/null +++ b/recipes/wt/all/patches/4.7.1-0001-use-cci-package.patch @@ -0,0 +1,32 @@ +diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt +index e53075b..c470b8e 100644 +--- a/src/Wt/Dbo/backend/CMakeLists.txt ++++ b/src/Wt/Dbo/backend/CMakeLists.txt +@@ -118,11 +118,12 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY CXX_VISIBILITY_PRESET hidden) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY VISIBILITY_INLINES_HIDDEN YES) + ++ find_package(PostgreSQL REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbopostgres + PUBLIC + wtdbo + PRIVATE +- ${POSTGRES_LIBRARIES} ++ PostgreSQL::PostgreSQL + ) + + IF(TARGET Boost::headers) +@@ -282,11 +283,12 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) + SET_PROPERTY(TARGET wtdbomysql PROPERTY CXX_VISIBILITY_PRESET hidden) + SET_PROPERTY(TARGET wtdbomysql PROPERTY VISIBILITY_INLINES_HIDDEN YES) + ++ find_package(libmysqlclient REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbomysql + PUBLIC + wtdbo + PRIVATE +- ${MYSQL_LIBRARIES} ++ libmysqlclient::libmysqlclient + ) + + INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/recipes/wt/all/patches/4.8.0-0001-use-cci-package.patch b/recipes/wt/all/patches/4.8.0-0001-use-cci-package.patch new file mode 100644 index 0000000000000..f44e45f2bd34c --- /dev/null +++ b/recipes/wt/all/patches/4.8.0-0001-use-cci-package.patch @@ -0,0 +1,32 @@ +diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt +index 4121f68..457e95e 100644 +--- a/src/Wt/Dbo/backend/CMakeLists.txt ++++ b/src/Wt/Dbo/backend/CMakeLists.txt +@@ -122,11 +122,12 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) + SET_PROPERTY(TARGET wtdbopostgres PROPERTY VISIBILITY_INLINES_HIDDEN YES) + endif() + ++ find_package(PostgreSQL REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbopostgres + PUBLIC + wtdbo + PRIVATE +- ${POSTGRES_LIBRARIES} ++ PostgreSQL::PostgreSQL + ) + + IF(TARGET Boost::headers) +@@ -290,11 +291,12 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) + SET_PROPERTY(TARGET wtdbomysql PROPERTY VISIBILITY_INLINES_HIDDEN YES) + endif() + ++ find_package(libmysqlclient REQUIRED CONFIG) + TARGET_LINK_LIBRARIES(wtdbomysql + PUBLIC + wtdbo + PRIVATE +- ${MYSQL_LIBRARIES} ++ libmysqlclient::libmysqlclient + ) + + INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/recipes/wt/all/test_package/CMakeLists.txt b/recipes/wt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..634347f5dfc1c --- /dev/null +++ b/recipes/wt/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) + +set(WT_COMPONENTS Wt HTTP) +set(WT_TARGETS Wt::Wt Wt::HTTP) +if(TARGET Wt::Dbo) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_DBO) + list(APPEND WT_COMPONENTS Dbo) + list(APPEND WT_TARGETS Wt::Dbo) +endif() + +find_package(wt REQUIRED ${WT_COMPONENTS} CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE ${WT_TARGETS}) + +if(wt_VERSION VERSION_LESS "4.5.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/wt/all/test_package/conanfile.py b/recipes/wt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/wt/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/wt/all/test_package/test_package.cpp b/recipes/wt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..16f166b0fac28 --- /dev/null +++ b/recipes/wt/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main(void) { + std::cout << "WT Library version: " << Wt::WEnvironment::libraryVersion() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/wt/all/test_v1_package/CMakeLists.txt b/recipes/wt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wt/all/test_v1_package/conanfile.py b/recipes/wt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wt/config.yml b/recipes/wt/config.yml new file mode 100644 index 0000000000000..f24f55b014506 --- /dev/null +++ b/recipes/wt/config.yml @@ -0,0 +1,19 @@ +versions: + "4.9.1": + folder: all + "4.8.0": + folder: all + "4.7.1": + folder: all + "4.6.2": + folder: all + "4.6.0": + folder: all + "4.5.1": + folder: all + "4.5.0": + folder: all + "4.4.0": + folder: all + "4.3.1": + folder: all diff --git a/recipes/wtl/all/conandata.yml b/recipes/wtl/all/conandata.yml new file mode 100644 index 0000000000000..1062fb5eccd19 --- /dev/null +++ b/recipes/wtl/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "10.0.9163": + url: + - "https://master.dl.sourceforge.net/project/wtl/WTL%2010/WTL%2010.0.9163/WTL10_9163.zip" + - "https://iweb.dl.sourceforge.net/project/wtl/WTL%2010/WTL%2010.0.9163/WTL10_9163.zip" + sha256: "b9fff11c36532c5fa0114b3c7ee4f752cbef71c7ddfd2e5f88f6f51f15431104" + "9.1.5321": + url: + - "https://master.dl.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip" + - "https://iweb.dl.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip" + sha256: "c03f80c66f28e86b3cc7c98d14afab6bec8eb9366476f6bdda8469c35f52b18a" diff --git a/recipes/wtl/all/conanfile.py b/recipes/wtl/all/conanfile.py new file mode 100644 index 0000000000000..31f78cb05551e --- /dev/null +++ b/recipes/wtl/all/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.54.0" + + +class WTLConan(ConanFile): + name = "wtl" + description = "Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components." + license = "MS-PL" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/wtl" + topics = ("atl", "template library", "windows", "template", "ui", "gdi", "header-only") + + settings = "os" + no_copy_source = True + + package_type = "header-library" + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} can only be used on Windows.") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def build(self): + pass + + def package(self): + copy(self, "MS-PL.TXT", 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wtl/all/test_package/CMakeLists.txt b/recipes/wtl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c87cbcfbe53b --- /dev/null +++ b/recipes/wtl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(wtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wtl::wtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wtl/all/test_package/conanfile.py b/recipes/wtl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/wtl/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wtl/all/test_package/example.cpp b/recipes/wtl/all/test_package/example.cpp new file mode 100644 index 0000000000000..45532fd78f037 --- /dev/null +++ b/recipes/wtl/all/test_package/example.cpp @@ -0,0 +1,17 @@ +#include +#include +#include + +class TestHandler : public CIdleHandler { + public: + virtual BOOL OnIdle() override + { + std::cout << "Package test completed successfully"; + return FALSE; + } +}; + +int main() { + TestHandler handler; + return handler.OnIdle(); +} diff --git a/recipes/wtl/all/test_v1_package/CMakeLists.txt b/recipes/wtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/wtl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wtl/all/test_v1_package/conanfile.py b/recipes/wtl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/wtl/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wtl/config.yml b/recipes/wtl/config.yml new file mode 100644 index 0000000000000..f9cf5b5fb5669 --- /dev/null +++ b/recipes/wtl/config.yml @@ -0,0 +1,5 @@ +versions: + "9.1.5321": + folder: all + "10.0.9163": + folder: all diff --git a/recipes/wyhash/all/conandata.yml b/recipes/wyhash/all/conandata.yml new file mode 100644 index 0000000000000..97f88594e3ec8 --- /dev/null +++ b/recipes/wyhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221102": + url: "https://github.com/wangyi-fudan/wyhash/archive/ea3b25e1aef55d90f707c3a292eeb9162e2615d8.tar.gz" + sha256: "94c6ca365a1ca39f4327c4e031690441a45a7d9feefbc14f86323d8b42c82cbe" diff --git a/recipes/wyhash/all/conanfile.py b/recipes/wyhash/all/conanfile.py new file mode 100644 index 0000000000000..34e8d0350c888 --- /dev/null +++ b/recipes/wyhash/all/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.52.0" + +class WyhashConan(ConanFile): + name = "wyhash" + description = "The FASTEST QUALITY hash function, random number generators (PRNG) and hash map." + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wangyi-fudan/wyhash" + topics = ("bloom-filter", "hash", "random-number-generators", "header-only") + 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) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wyhash/all/test_package/CMakeLists.txt b/recipes/wyhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3e7c350f8102f --- /dev/null +++ b/recipes/wyhash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(wyhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wyhash::wyhash) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/wyhash/all/test_package/conanfile.py b/recipes/wyhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/wyhash/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wyhash/all/test_package/test_package.c b/recipes/wyhash/all/test_package/test_package.c new file mode 100644 index 0000000000000..121a6c973751a --- /dev/null +++ b/recipes/wyhash/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +#include "wyhash.h" + +int main(void) { + uint64_t _wyp[4]; + make_secret(time(NULL), _wyp); + char s[] = "fcdskhfjs"; + uint64_t h=wyhash(s, sizeof(s) / sizeof(s[0]), 0 ,_wyp); + + return 0; +} diff --git a/recipes/wyhash/all/test_v1_package/CMakeLists.txt b/recipes/wyhash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..961b416af6b07 --- /dev/null +++ b/recipes/wyhash/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wyhash/all/test_v1_package/conanfile.py b/recipes/wyhash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wyhash/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wyhash/config.yml b/recipes/wyhash/config.yml new file mode 100644 index 0000000000000..eec24bd72e90d --- /dev/null +++ b/recipes/wyhash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221102": + folder: all diff --git a/recipes/xapian-core/all/conandata.yml b/recipes/xapian-core/all/conandata.yml new file mode 100644 index 0000000000000..4514bc0f40509 --- /dev/null +++ b/recipes/xapian-core/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.4.19": + url: "https://oligarchy.co.uk/xapian/1.4.19/xapian-core-1.4.19.tar.xz" + sha256: "1fca48fca6cc3526cc4ba93dd194fe9c1326857b78edcfb37e68d086d714a9c3" + "1.4.18": + url: "https://oligarchy.co.uk/xapian/1.4.18/xapian-core-1.4.18.tar.xz" + sha256: "196ddbb4ad10450100f0991a599e4ed944cbad92e4a6fe813be6dce160244b77" +patches: + "1.4.19": + - patch_file: "patches/0001-add-msvc-cl-sh.patch" + "1.4.18": + - patch_file: "patches/0001-add-msvc-cl-sh.patch" + - patch_file: "patches/0002-add-cerrno.patch" diff --git a/recipes/xapian-core/all/conanfile.py b/recipes/xapian-core/all/conanfile.py new file mode 100644 index 0000000000000..f2cc68f3f1bd4 --- /dev/null +++ b/recipes/xapian-core/all/conanfile.py @@ -0,0 +1,211 @@ +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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path, unix_path_package_info_legacy +import os +import textwrap + +required_conan_version = ">=1.57.0" + + +class XapianCoreConan(ConanFile): + name = "xapian-core" + description = ( + "Xapian is a highly adaptable toolkit which allows developers to easily " + "add advanced indexing and search facilities to their own applications." + ) + topics = ("xapian", "search", "engine", "indexing", "query") + license = "GPL-2.0-or-later" + homepage = "https://xapian.org/" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + if self.settings.os != "Windows": + self.requires("libuuid/1.0.3") + + def validate(self): + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "shared builds are unavailable due to libtool's inability to create shared libraries" + ) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + 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.configure_args.extend([ + "--datarootdir=${prefix}/res", + "--disable-documentation", + ]) + env = tc.environment() + if is_msvc(self): + msvc_cl_sh = unix_path(self, os.path.join(self.source_folder, "msvc_cl.sh")) + env.define("AR", "lib") + env.define("CC", msvc_cl_sh) + env.define("CXX", msvc_cl_sh) + env.define("LD", msvc_cl_sh) + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + if is_msvc(self): + # Custom AutotoolsDeps for cl like compilers + # workaround for https://github.com/conan-io/conan/issues/12784 + includedirs = [] + defines = [] + libs = [] + libdirs = [] + linkflags = [] + cxxflags = [] + cflags = [] + for dependency in self.dependencies.values(): + deps_cpp_info = dependency.cpp_info.aggregated_components() + includedirs.extend(deps_cpp_info.includedirs) + defines.extend(deps_cpp_info.defines) + libs.extend(deps_cpp_info.libs + deps_cpp_info.system_libs) + libdirs.extend(deps_cpp_info.libdirs) + linkflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + cxxflags.extend(deps_cpp_info.cxxflags) + cflags.extend(deps_cpp_info.cflags) + + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in includedirs] + [f"-D{d}" for d in defines]) + env.append("LIBS", [f"-l{lib}" for lib in libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in libdirs] + linkflags) + env.append("CXXFLAGS", cxxflags) + env.append("CFLAGS", cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + if is_msvc(self) and not self.options.shared: + rename(self, f"{self.package_folder}/lib/libxapian.lib", + f"{self.package_folder}/lib/xapian.lib") + + rm(self, "xapian-config", f"{self.package_folder}/bin") + rm(self, "*.la", f"{self.package_folder}/lib") + rmdir(self, f"{self.package_folder}/lib/cmake") + rmdir(self, f"{self.package_folder}/lib/pkgconfig") + rmdir(self, f"{self._datarootdir}/doc") + rmdir(self, f"{self._datarootdir}/man") + fix_apple_shared_install_name(self) + + self._create_cmake_module_variables( + f"{self.package_folder}/{self._module_file_rel_path}" + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent("""\ + set(XAPIAN_FOUND TRUE) + set(XAPIAN_INCLUDE_DIR ${xapian_INCLUDE_DIR} + ${xapian_INCLUDE_DIR_RELEASE} + ${xapian_INCLUDE_DIR_RELWITHDEBINFO} + ${xapian_INCLUDE_DIR_MINSIZEREL} + ${xapian_INCLUDE_DIR_DEBUG}) + set(XAPIAN_LIBRARIES ${xapian_LIBRARIES} + ${xapian_LIBRARIES_RELEASE} + ${xapian_LIBRARIES_RELWITHDEBINFO} + ${xapian_LIBRARIES_MINSIZEREL} + ${xapian_LIBRARIES_DEBUG}) + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return f"lib/cmake/conan-official-{self.name}-variables.cmake" + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xapian") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "xapian-core") + self.cpp_info.libs = ["xapian"] + self.cpp_info.resdirs = ["res"] + if not self.options.shared: + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["rt", "m"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["rpcrt4", "ws2_32"] + elif self.settings.os == "SunOS": + self.cpp_info.system_libs = ["socket", "nsl"] + + xapian_aclocal_dir = os.path.join(self._datarootdir, "aclocal") + self.buildenv_info.prepend_path("AUTOMAKE_CONAN_INCLUDES", xapian_aclocal_dir) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "xapian" + self.cpp_info.names["cmake_find_package_multi"] = "xapian" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, xapian_aclocal_dir)) diff --git a/recipes/xapian-core/all/patches/0001-add-msvc-cl-sh.patch b/recipes/xapian-core/all/patches/0001-add-msvc-cl-sh.patch new file mode 100644 index 0000000000000..917ffd6ab186a --- /dev/null +++ b/recipes/xapian-core/all/patches/0001-add-msvc-cl-sh.patch @@ -0,0 +1,99 @@ +new file mode 100755 +--- /dev/null ++++ msvc_cl.sh +@@ -0,0 +1,95 @@ ++#!/bin/sh ++clopts=() ++ldopts=() ++sources=0 ++link=0 ++while test $# -gt 0; do ++ case "$1" in ++ -lm | -pthread | -lpthread | -std=c++98) ++ # ignore ++ ;; ++ -Xlinker) ++ shift ++ ;; ++ -W* | -w* | -pedantic) ++ # ignore warnings ++ ;; ++ -D*) ++ clopts+=("$1") ++ ;; ++ -I*) ++ clopts+=("$1") ++ ;; ++ -l*) ++ ldopts+=("`echo "$1.lib" | sed "s/^-l//"`") ++ ;; ++ -LIBPATH*) ++ ldopts+=("$1") ++ ;; ++ -L*) ++ ldopts+=("`echo "$1" | sed "s/^-L/-LIBPATH:/"`") ++ ;; ++ *.obj | *.o) ++ link=1 ++ ldopts+=("$1") ++ ;; ++ -Wl,*) ++ for linkarg in `echo '$1' | sed -e 's/-Wl,//' -e 's/,/ /'`; do ++ ldopts+=("${linkarg}") ++ done ++ ;; ++ *.lib) ++ ldopts+=("$1") ++ ;; ++ -o) ++ shift ++ case "$1" in ++ *.dll) ++ link=1 ++ oname=$(echo "$1" | sed s/^lib//g) ++ ldopts+=("-out:$oname") ++ ;; ++ *.dll | *.exe) ++ link=1 ++ ldopts+=("-out:$1") ++ ;; ++ *.o | *.obj) ++ link=0 ++ clopts+=("-Fo$1") ++ ;; ++ esac ++ ;; ++ -implib* | -IMPLIB*) ++ ldopts+=("$1") ++ ;; ++ -c | *.c | *.C | *.cxx | *.cpp | *.cc | *.CC) ++ sources=1 ++ clopts+=("$1") ++ ;; ++ *) ++ clopts+=("$1") ++ ;; ++ esac ++ shift ++done ++ ++args="${clopts[@]}" ++if test $link = 1; then ++ if test $sources = 0; then ++ args="${ldopts[@]}" ++cat <<-EOF ++ Creating program/library ++ ** ld options: "$args" ++EOF ++ LINK= exec link -nologo $args ++ else ++ args="$args -link ${ldopts[@]}" ++ fi ++fi ++ ++cat <<-EOF ++ Compiling source ++ ** cl options: "$args" ++EOF ++ ++LINK= exec cl -nologo $args diff --git a/recipes/xapian-core/all/patches/0002-add-cerrno.patch b/recipes/xapian-core/all/patches/0002-add-cerrno.patch new file mode 100644 index 0000000000000..db9a2e5e2d29e --- /dev/null +++ b/recipes/xapian-core/all/patches/0002-add-cerrno.patch @@ -0,0 +1,12 @@ +diff --git a/xapian-core/common/errno_to_string.cc b/xapian-core/common/errno_to_string.cc +index 00c214b..0064304 100644 +--- common/errno_to_string.cc ++++ common/errno_to_string.cc +@@ -28,6 +28,7 @@ + + // doesn't give us strerror_r() with Sun C++ 5.9. + #include ++#include + #if defined HAVE__SYS_ERRLIST_AND__SYS_NERR || \ + defined HAVE_SYS_ERRLIST_AND_SYS_NERR + # include diff --git a/recipes/xapian-core/all/test_package/CMakeLists.txt b/recipes/xapian-core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6d27b4aff7006 --- /dev/null +++ b/recipes/xapian-core/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(xapian REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${XAPIAN_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${XAPIAN_LIBRARIES}) diff --git a/recipes/xapian-core/all/test_package/conanfile.py b/recipes/xapian-core/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/xapian-core/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xapian-core/all/test_package/test_package.cpp b/recipes/xapian-core/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..168577722daae --- /dev/null +++ b/recipes/xapian-core/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "xapian.h" + +#include + +int main() { + std::cout << "xapian version " << Xapian::version_string() << "\n"; + return 0; +} diff --git a/recipes/xapian-core/all/test_v1_package/CMakeLists.txt b/recipes/xapian-core/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xapian-core/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xapian-core/all/test_v1_package/conanfile.py b/recipes/xapian-core/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xapian-core/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xapian-core/config.yml b/recipes/xapian-core/config.yml new file mode 100644 index 0000000000000..bc4d571521f81 --- /dev/null +++ b/recipes/xapian-core/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.19": + folder: "all" + "1.4.18": + folder: "all" diff --git a/recipes/xbyak/all/conandata.yml b/recipes/xbyak/all/conandata.yml new file mode 100644 index 0000000000000..2e045a1c8a082 --- /dev/null +++ b/recipes/xbyak/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "6.62": + url: "https://github.com/herumi/xbyak/archive/v6.62.tar.gz" + sha256: "fd5f074d64cdfcacad3bbe8664727a8eab569f131cadd725a778c028fa6b0ccd" + "6.61.2": + url: "https://github.com/herumi/xbyak/archive/v6.61.2.tar.gz" + sha256: "97b88064c9e7cd12bd235e7e600cb017481851d929ccdc95924e9d9e56a0bc3c" + "6.60.2": + url: "https://github.com/herumi/xbyak/archive/v6.60.2.tar.gz" + sha256: "c7fd461cf8e0e1acec13970681f5e7b073a2e63f59841252fb298c3c3a09a395" + "6.60": + url: "https://github.com/herumi/xbyak/archive/v6.60.tar.gz" + sha256: "fb478da9d66fabe155d54436645ffbbdc44b513027391c4662983d44ea483d59" + "6.01": + url: "https://github.com/herumi/xbyak/archive/v6.01.tar.gz" + sha256: "d28a03c0db1fe16e49572e5f6e1d825decc373022acd0f331646152aef60b550" + "6.00": + url: "https://github.com/herumi/xbyak/archive/refs/tags/v6.00.tar.gz" + sha256: "31f2e156b4be993fdbaa0fbb33c295d907f3752af753f76646a1ee07362590bf" + "5.993": + url: "https://github.com/herumi/xbyak/archive/refs/tags/v5.993.tar.gz" + sha256: "97d596e7ca05208a0f64b225bff482ee5bcd44ebae07f1e3a50009d5e54b940b" diff --git a/recipes/xbyak/all/conanfile.py b/recipes/xbyak/all/conanfile.py new file mode 100644 index 0000000000000..9523784e16e7c --- /dev/null +++ b/recipes/xbyak/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class XbyakConan(ConanFile): + name = "xbyak" + description = "Xbyak is a C++ header library that enables dynamically to " \ + "assemble x86(IA32), x64(AMD64, x86-64) mnemonic." + license = "BSD-3-Clause" + topics = ("xbyak", "jit", "assembler") + homepage = "https://github.com/herumi/xbyak" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "xbyak"), dst=os.path.join(self.package_folder, "include", "xbyak")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xbyak") + self.cpp_info.set_property("cmake_target_name", "xbyak::xbyak") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/xbyak/all/test_package/CMakeLists.txt b/recipes/xbyak/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..94333066ea648 --- /dev/null +++ b/recipes/xbyak/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(xbyak REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xbyak::xbyak) diff --git a/recipes/xbyak/all/test_package/conanfile.py b/recipes/xbyak/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/xbyak/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/xbyak/all/test_package/test_package.cpp b/recipes/xbyak/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f44f21153df9b --- /dev/null +++ b/recipes/xbyak/all/test_package/test_package.cpp @@ -0,0 +1,126 @@ +#define XBYAK_NO_OP_NAMES +#include + +#include + +const int expectTbl[] = { + 5, 9, 12 +}; + +struct Code : Xbyak::CodeGenerator { + explicit Code(int mode, size_t size, void *p) + : Xbyak::CodeGenerator(size, p) + { + inLocalLabel(); +#ifdef XBYAK64 + const Xbyak::Reg64& a = rax; + const Xbyak::Reg64& c = rcx; +#ifdef XBYAK64_WIN + mov(rax, rcx); +#else + mov(rax, rdi); +#endif +#else + const Xbyak::Reg32& a = eax; + const Xbyak::Reg32& c = ecx; + mov(a, ptr [esp + 4]); +#endif + + switch (mode) { + case 0: + mov(c, ".jmp_table"); + lea(c, ptr [c + a * 8]); + jmp(c); + align(8); + L(".jmp_table"); + mov(a, expectTbl[0]); + ret(); + align(8); + mov(a, expectTbl[1]); + ret(); + align(8); + mov(a, expectTbl[2]); + ret(); + break; + + case 1: + /* + the label for putL is defined when called + */ + mov(c, ".jmp_table"); + jmp(ptr [c + a * (int)sizeof(size_t)]); + L(".label1"); + mov(a, expectTbl[0]); + jmp(".end"); + L(".label2"); + mov(a, expectTbl[1]); + jmp(".end"); + L(".label3"); + mov(a, expectTbl[2]); + jmp(".end"); + L(".end"); + ret(); + ud2(); + + align(8); + L(".jmp_table"); + putL(".label1"); + putL(".label2"); + putL(".label3"); + break; + + case 2: + /* + the label for putL is not defined when called + */ + jmp(".in"); + ud2(); + align(8); + L(".jmp_table"); + putL(".label1"); + putL(".label2"); + putL(".label3"); + L(".in"); + mov(c, ".jmp_table"); + jmp(ptr [c + a * (int)sizeof(size_t)]); + L(".label1"); + mov(a, expectTbl[0]); + jmp(".end"); + L(".label2"); + mov(a, expectTbl[1]); + jmp(".end"); + L(".label3"); + mov(a, expectTbl[2]); + jmp(".end"); + L(".end"); + ret(); + break; + } + outLocalLabel(); + } +}; + +int main() + try +{ + for (int mode = 0; mode < 3; mode++) { + printf("mode=%d\n", mode); + for (int grow = 0; grow < 2; grow++) { + printf("auto grow=%s\n", grow ? "on" : "off"); + Code c(mode, grow ? 30 : 4096, grow ? Xbyak::AutoGrow : 0); + int (*f)(int) = c.getCode(); + c.ready(); + for (int i = 0; i < 3; i++) { + const int a = expectTbl[i]; + const int b = f(i); + if (a != b) { + printf("ERR i=%d, a=%d, b=%d\n", i, a, b); + exit(1); + } + } + } + } + puts("ok"); +} catch (std::exception& e) { + printf("ERR %s\n", e.what()); +} diff --git a/recipes/xbyak/all/test_v1_package/CMakeLists.txt b/recipes/xbyak/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9eb3258c25176 --- /dev/null +++ b/recipes/xbyak/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xbyak REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xbyak::xbyak) diff --git a/recipes/xbyak/all/test_v1_package/conanfile.py b/recipes/xbyak/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xbyak/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/xbyak/config.yml b/recipes/xbyak/config.yml new file mode 100644 index 0000000000000..9006396a7028a --- /dev/null +++ b/recipes/xbyak/config.yml @@ -0,0 +1,15 @@ +versions: + "6.62": + folder: all + "6.61.2": + folder: all + "6.60.2": + folder: all + "6.60": + folder: all + "6.01": + folder: all + "6.00": + folder: all + "5.993": + folder: all diff --git a/recipes/xege/all/CMakeLists.txt b/recipes/xege/all/CMakeLists.txt new file mode 100644 index 0000000000000..0496b29838549 --- /dev/null +++ b/recipes/xege/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/xege/all/conandata.yml b/recipes/xege/all/conandata.yml new file mode 100644 index 0000000000000..2f7535221dfb9 --- /dev/null +++ b/recipes/xege/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20.08": + url: "https://github.com/wysaid/xege/archive/refs/tags/20.08.tar.gz" + sha256: "33bc63366d093902b5bc68d3d613ebd90e449bc22800b40f2dd98e2b5c44b88a" diff --git a/recipes/xege/all/conanfile.py b/recipes/xege/all/conanfile.py new file mode 100644 index 0000000000000..e3d748b348f87 --- /dev/null +++ b/recipes/xege/all/conanfile.py @@ -0,0 +1,58 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class XegeConan(ConanFile): + name = "xege" + license = "LGPLv2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://xege.org/" + description = "Easy Graphics Engine, a lite graphics library in Windows" + topics = ("ege", "graphics", "gui") + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + exports_sources = ["CMakeLists.txt"] + + def configure(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration( + "This library is only compatible for Windows") + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + self.copy("*.h", dst="include", src=self._source_subfolder+"/src") + self.copy("*.lib", dst="lib", keep_path=False) + self.copy("*.dll", dst="bin", keep_path=False) + self.copy("*.so", dst="lib", keep_path=False) + self.copy("*.a", dst="lib", keep_path=False) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + if self.settings.arch == "x86_64": + self.cpp_info.libs = ["graphics64"] + else: + self.cpp_info.libs = ["graphics"] + self.cpp_info.system_libs = [ + "gdiplus", + "uuid", + "msimg32", + "gdi32", + "imm32", + "ole32", + "oleaut32" + ] diff --git a/recipes/xege/all/test_package/CMakeLists.txt b/recipes/xege/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dd28555a7ac65 --- /dev/null +++ b/recipes/xege/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) + +if(MSYS OR MINGW) + target_link_libraries(example -static-libgcc -static-libstdc++) +endif() diff --git a/recipes/xege/all/test_package/conanfile.py b/recipes/xege/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2011b67ca68a5 --- /dev/null +++ b/recipes/xege/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class XegeTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/xege/all/test_package/example.cpp b/recipes/xege/all/test_package/example.cpp new file mode 100644 index 0000000000000..e167cd38f70ed --- /dev/null +++ b/recipes/xege/all/test_package/example.cpp @@ -0,0 +1,11 @@ +#include +#include + +using namespace ege; + +int main() { + initgraph(640, 480); + circle(120, 120, 100); + Sleep(2000); + closegraph(); +} diff --git a/recipes/xege/config.yml b/recipes/xege/config.yml new file mode 100644 index 0000000000000..f6df21024cbf0 --- /dev/null +++ b/recipes/xege/config.yml @@ -0,0 +1,3 @@ +versions: + "20.08": + folder: all diff --git a/recipes/xerces-c/all/conandata.yml b/recipes/xerces-c/all/conandata.yml new file mode 100644 index 0000000000000..b384861145f6b --- /dev/null +++ b/recipes/xerces-c/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "3.2.4": + url: "https://github.com/apache/xerces-c/archive/v3.2.4.tar.gz" + sha256: "8dfaa30d6a641bda113625ef65e43c433e8ffd94fadd3b8d39dfe6faf450f26d" + "3.2.3": + url: "https://github.com/apache/xerces-c/archive/v3.2.3.tar.gz" + sha256: "a7cf582d618c048ef6a4684457a641940179c446e5f02c81f582f5952755a76a" + "3.2.2": + url: "https://github.com/apache/xerces-c/archive/v3.2.2.tar.gz" + sha256: "7fe5af7d7ad9d4a06503c15fb5bb0aa5f2ba7959700d16c21b8bd183ca542e7f" +patches: + "3.2.4": + - patch_file: "patches/0001-remove-test-samples-324.patch" + - patch_file: "patches/0002-find-icu-programs.patch" + "3.2.3": + - patch_file: "patches/0001-remove-test-samples.patch" + - patch_file: "patches/0002-find-icu-programs.patch" + "3.2.2": + - patch_file: "patches/0001-remove-test-samples.patch" + - patch_file: "patches/0002-find-icu-programs.patch" diff --git a/recipes/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py new file mode 100644 index 0000000000000..7f0ec271188e7 --- /dev/null +++ b/recipes/xerces-c/all/conanfile.py @@ -0,0 +1,158 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class XercesCConan(ConanFile): + name = "xerces-c" + description = ( + "Xerces-C++ is a validating XML parser written in a portable subset of C++" + ) + topics = ("xerces", "XML", "validation", "DOM", "SAX", "SAX2") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://xerces.apache.org/xerces-c/index.html" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + # https://xerces.apache.org/xerces-c/build-3.html + "char_type": ["uint16_t", "char16_t", "wchar_t"], + "network_accessor": ["curl", "socket", "cfurl", "winsock"], + "transcoder": ["gnuiconv", "iconv", "icu", "macosunicodeconverter", "windows"], + "message_loader": ["inmemory", "icu", "iconv"], + "mutex_manager": ["standard", "posix", "windows"], + } + default_options = { + "shared": False, + "fPIC": True, + "char_type": "uint16_t", + "network_accessor": "socket", + "transcoder": "gnuiconv", + "message_loader": "inmemory", + "mutex_manager": "standard", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.network_accessor = "winsock" + self.options.transcoder = "windows" + self.options.mutex_manager = "windows" + elif self.settings.os == "Macos": + self.options.network_accessor = "cfurl" + self.options.transcoder = "macosunicodeconverter" + self.options.mutex_manager = "posix" + elif self.settings.os == "Linux": + self.options.mutex_manager = "posix" + + 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 "icu" in (self.options.transcoder, self.options.message_loader): + self.requires("icu/72.1", run=can_run(self)) + if self.options.network_accessor == "curl": + self.requires("libcurl/7.88.1") + + def _validate(self, option, value, host_os): + """ + Validate that the given `option` has the required `value` for the given `os` + If not raises a ConanInvalidConfiguration error + + :param option: the name of the option to validate + :param value: the value that the `option` should have + :param os: either a single string or a tuple of strings containing the + OS(es) that `value` is valid on + """ + if self.settings.os not in host_os and getattr(self.options, option) == value: + raise ConanInvalidConfiguration(f"Option '{option}={value}' is only supported on {host_os}") + + def validate(self): + if self.settings.os not in ("Windows", "Macos", "Linux"): + raise ConanInvalidConfiguration("OS is not supported") + self._validate("char_type", "wchar_t", ("Windows", )) + self._validate("network_accessor", "winsock", ("Windows", )) + self._validate("network_accessor", "cfurl", ("Macos", )) + self._validate("network_accessor", "socket", ("Linux", "Macos")) + self._validate("network_accessor", "curl", ("Linux", "Macos")) + self._validate("transcoder", "macosunicodeconverter", ("Macos", )) + self._validate("transcoder", "windows", ("Windows", )) + self._validate("mutex_manager", "posix", ("Linux", "Macos")) + self._validate("mutex_manager", "windows", ("Windows", )) + + def build_requirements(self): + if self.options.message_loader == "icu" and not can_run(self): + self.tool_requires("icu/72.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) + # Because upstream overrides BUILD_SHARED_LIBS as a CACHE variable + tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF" + # https://xerces.apache.org/xerces-c/build-3.html + tc.variables["network-accessor"] = self.options.network_accessor + tc.variables["transcoder"] = self.options.transcoder + tc.variables["message-loader"] = self.options.message_loader + tc.variables["xmlch-type"] = self.options.char_type + tc.variables["mutex-manager"] = self.options.mutex_manager + # avoid picking up system dependency + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_CURL"] = self.options.network_accessor != "curl" + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ICU"] = "icu" not in (self.options.transcoder, self.options.message_loader) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + for license in ("LICENSE", "NOTICE"): + 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, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "XercesC") + self.cpp_info.set_property("cmake_target_name", "XercesC::XercesC") + self.cpp_info.set_property("pkg_config_name", "xerces-c") + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + if Version(conan_version).major < 2: + self.cpp_info.names["cmake_find_package"] = "XercesC" + self.cpp_info.names["cmake_find_package_multi"] = "XercesC" diff --git a/recipes/xerces-c/all/patches/0001-remove-test-samples-324.patch b/recipes/xerces-c/all/patches/0001-remove-test-samples-324.patch new file mode 100644 index 0000000000000..248d7401136e7 --- /dev/null +++ b/recipes/xerces-c/all/patches/0001-remove-test-samples-324.patch @@ -0,0 +1,27 @@ +From 02f819bfda7f01d53d986db1c14ec704dd290b7b Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Fri, 3 Sep 2021 20:30:03 -0400 +Subject: [PATCH] disable extra junk + +--- + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 33bc40f..ebd70c1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -164,10 +164,10 @@ install( + COMPONENT "development") + + # Process subdirectories +-add_subdirectory(doc) ++#add_subdirectory(doc) + add_subdirectory(src) +-add_subdirectory(tests) +-add_subdirectory(samples) ++#add_subdirectory(tests) ++#add_subdirectory(samples) + + # Display configuration summary + message(STATUS "") diff --git a/recipes/xerces-c/all/patches/0001-remove-test-samples.patch b/recipes/xerces-c/all/patches/0001-remove-test-samples.patch new file mode 100644 index 0000000000000..9b610bf94fb8e --- /dev/null +++ b/recipes/xerces-c/all/patches/0001-remove-test-samples.patch @@ -0,0 +1,27 @@ +From 02f819bfda7f01d53d986db1c14ec704dd290b7b Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Fri, 3 Sep 2021 20:30:03 -0400 +Subject: [PATCH] disable extra junk + +--- + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4254f89bb..dfd4bb01b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -175,10 +175,10 @@ install( + COMPONENT "development") + + # Process subdirectories +-add_subdirectory(doc) ++#add_subdirectory(doc) + add_subdirectory(src) +-add_subdirectory(tests) +-add_subdirectory(samples) ++#add_subdirectory(tests) ++#add_subdirectory(samples) + + # Display configuration summary + message(STATUS "") diff --git a/recipes/xerces-c/all/patches/0002-find-icu-programs.patch b/recipes/xerces-c/all/patches/0002-find-icu-programs.patch new file mode 100644 index 0000000000000..c5d69fee12932 --- /dev/null +++ b/recipes/xerces-c/all/patches/0002-find-icu-programs.patch @@ -0,0 +1,12 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1146,6 +1146,9 @@ if(XERCES_USE_MSGLOADER_ICU) + list(APPEND libxerces_c_SOURCES ${msgicu_sources} ${msgicu_nodist_sources}) + list(APPEND libxerces_c_HEADERS ${msgicu_headers}) + list(APPEND libxerces_c_DEPS ICU::uc ICU::data) ++ find_program(ICU_GENCMN_EXECUTABLE gencmn PATHS ENV PATH NO_DEFAULT_PATH) ++ find_program(ICU_GENRB_EXECUTABLE genrb PATHS ENV PATH NO_DEFAULT_PATH) ++ find_program(ICU_GENCCODE_EXECUTABLE genccode PATHS ENV PATH NO_DEFAULT_PATH) + + # Resource shortname + set(PKGNAME xercesc_messages_${INTERFACE_VERSION_U}) diff --git a/recipes/xerces-c/all/test_package/CMakeLists.txt b/recipes/xerces-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3f03b5b9ef2cd --- /dev/null +++ b/recipes/xerces-c/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(XercesC REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE XercesC::XercesC) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/xerces-c/all/test_package/conanfile.py b/recipes/xerces-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xerces-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/xerces-c/all/test_package/test_package.cpp b/recipes/xerces-c/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4f850351a0d0a --- /dev/null +++ b/recipes/xerces-c/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +int main(int argc, char* argv[]) +{ + try { + xercesc::XMLPlatformUtils::Initialize(); + } + catch (const xercesc::XMLException& toCatch) { + return 1; + } + + xercesc::XMLPlatformUtils::Terminate(); + + return 0; +} diff --git a/recipes/xerces-c/all/test_v1_package/CMakeLists.txt b/recipes/xerces-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xerces-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xerces-c/all/test_v1_package/conanfile.py b/recipes/xerces-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/xerces-c/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xerces-c/config.yml b/recipes/xerces-c/config.yml new file mode 100644 index 0000000000000..795ad892ef369 --- /dev/null +++ b/recipes/xerces-c/config.yml @@ -0,0 +1,7 @@ +versions: + "3.2.4": + folder: all + "3.2.3": + folder: all + "3.2.2": + folder: all diff --git a/recipes/xkbcommon/all/conandata.yml b/recipes/xkbcommon/all/conandata.yml new file mode 100644 index 0000000000000..1c21a5c826ba0 --- /dev/null +++ b/recipes/xkbcommon/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.5.0": + url: "https://xkbcommon.org/download/libxkbcommon-1.5.0.tar.xz" + sha256: "560f11c4bbbca10f495f3ef7d3a6aa4ca62b4f8fb0b52e7d459d18a26e46e017" + "1.4.1": + url: "https://xkbcommon.org/download/libxkbcommon-1.4.1.tar.xz" + sha256: "943c07a1e2198026d8102b17270a1f406e4d3d6bbc4ae105b9e1b82d7d136b39" + "1.3.1": + url: "https://xkbcommon.org/download/libxkbcommon-1.3.1.tar.xz" + sha256: "b3c710d27a2630054e1e1399c85b7f330ef03359b460f0c1b3b587fd01fe9234" + "1.2.1": + url: "https://xkbcommon.org/download/libxkbcommon-1.2.1.tar.xz" + sha256: "e833a7d3024c9bb9d5eb2b20f6d5de08865541f21bb7ba227c83cbd236691fb3" + "1.1.0": + url: "https://xkbcommon.org/download/libxkbcommon-1.1.0.tar.xz" + sha256: "412cfcca596f92914ea1a66ad244804d73a5ff20b6d86459951e7ad20576c246" + "1.0.3": + url: "https://xkbcommon.org/download/libxkbcommon-1.0.3.tar.xz" + sha256: "a2202f851e072b84e64a395212cbd976ee18a8ee602008b0bad02a13247dbc52" + "0.10.0": + url: "https://xkbcommon.org/download/libxkbcommon-0.10.0.tar.xz" + sha256: "57c3630cdc38fb4734cd57fa349e92244f5ae3862813e533cedbd86721a0b6f2" diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py new file mode 100644 index 0000000000000..a315f50588edc --- /dev/null +++ b/recipes/xkbcommon/all/conanfile.py @@ -0,0 +1,181 @@ +import os + +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, 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 +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + + +class XkbcommonConan(ConanFile): + name = "xkbcommon" + package_type = "library" + description = "keymap handling library for toolkits and window systems" + topics = ("keyboard", "wayland", "x11", "xkb") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xkbcommon/libxkbcommon" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_x11": [True, False], + "with_wayland": [True, False], + "xkbregistry": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_x11": True, + "with_wayland": True, + "xkbregistry": True, + } + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + @property + def _has_xkbregistry_option(self): + return Version(self.version) >= "1.0.0" + + def config_options(self): + if not self._has_xkbregistry_option: + del self.options.xkbregistry + if self.settings.os != "Linux": + del self.options.with_wayland + + 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("xkeyboard-config/system") + if self.options.with_x11: + self.requires("xorg/system") + if self.options.get_safe("xkbregistry"): + self.requires("libxml2/2.10.4") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.21.0") + if not self._has_build_profile: + self.requires("wayland-protocols/1.31") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.ref} is only compatible with Linux and FreeBSD") + + def build_requirements(self): + self.tool_requires("meson/1.1.0") + self.tool_requires("bison/3.8.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._has_build_profile and self.options.get_safe("with_wayland"): + self.tool_requires("wayland/1.21.0") + self.tool_requires("wayland-protocols/1.31") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = MesonToolchain(self) + tc.project_options["enable-docs"] = False + tc.project_options["enable-wayland"] = self.options.get_safe("with_wayland", False) + tc.project_options["enable-x11"] = self.options.with_x11 + if self._has_xkbregistry_option: + tc.project_options["enable-xkbregistry"] = self.options.xkbregistry + if self._has_build_profile: + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.generate() + + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile and self.options.get_safe("with_wayland"): + pkg_config_deps.build_context_activated = ["wayland", "wayland-protocols"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD", "wayland-protocols": "_BUILD"} + pkg_config_deps.generate() + + def build(self): + if self.options.get_safe("with_wayland"): + meson_build_file = os.path.join(self.source_folder, "meson.build") + # Patch the build system to use the pkg-config files generated for the build context. + + if Version(self.version) >= "1.5.0": + get_pkg_config_var = "get_variable(pkgconfig: " + else: + get_pkg_config_var = "get_pkgconfig_variable(" + + if self._has_build_profile: + replace_in_file(self, meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", + "wayland_scanner_dep = dependency('wayland-scanner_BUILD', required: false, native: true)") + replace_in_file(self, meson_build_file, + "wayland_protocols_dep = dependency('wayland-protocols', version: '>=1.12', required: false)", + "wayland_protocols_dep = dependency('wayland-protocols_BUILD', version: '>=1.12', required: false, native: true)") + else: + replace_in_file(self, meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", + "# wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)") + + replace_in_file(self, meson_build_file, + "if not wayland_client_dep.found() or not wayland_protocols_dep.found() or not wayland_scanner_dep.found()", + "if not wayland_client_dep.found() or not wayland_protocols_dep.found()") + + replace_in_file(self, meson_build_file, + f"wayland_scanner = find_program(wayland_scanner_dep.{get_pkg_config_var}'wayland_scanner'))", + "wayland_scanner = find_program('wayland-scanner')") + + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.components["libxkbcommon"].set_property("pkg_config_name", "xkbcommon") + self.cpp_info.components["libxkbcommon"].libs = ["xkbcommon"] + self.cpp_info.components["libxkbcommon"].requires = ["xkeyboard-config::xkeyboard-config"] + self.cpp_info.components["libxkbcommon"].resdirs = ["res"] + + if self.options.with_x11: + self.cpp_info.components["libxkbcommon-x11"].set_property("pkg_config_name", "xkbcommon-x11") + self.cpp_info.components["libxkbcommon-x11"].libs = ["xkbcommon-x11"] + self.cpp_info.components["libxkbcommon-x11"].requires = ["libxkbcommon", "xorg::xcb", "xorg::xcb-xkb"] + if self.options.get_safe("xkbregistry"): + self.cpp_info.components["libxkbregistry"].set_property("pkg_config_name", "xkbregistry") + self.cpp_info.components["libxkbregistry"].libs = ["xkbregistry"] + self.cpp_info.components["libxkbregistry"].requires = ["libxml2::libxml2"] + if self.options.get_safe("with_wayland", False): + self.cpp_info.components["xkbcli-interactive-wayland"].libs = [] + self.cpp_info.components["xkbcli-interactive-wayland"].includedirs = [] + self.cpp_info.components["xkbcli-interactive-wayland"].requires = ["wayland::wayland-client"] + if not self._has_build_profile: + self.cpp_info.components["xkbcli-interactive-wayland"].requires.append("wayland-protocols::wayland-protocols") + + if Version(self.version) >= "1.0.0": + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) + + # unofficial, but required to avoid side effects (libxkbcommon component + # "steals" the default global pkg_config name) + self.cpp_info.set_property("pkg_config_name", "xkbcommon_all_do_not_use") + self.cpp_info.names["pkg_config"] = "xkbcommon_all_do_not_use" diff --git a/recipes/xkbcommon/all/test_package/CMakeLists.txt b/recipes/xkbcommon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..713779fc01923 --- /dev/null +++ b/recipes/xkbcommon/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(xkbcommon REQUIRED COMPONENTS libxkbcommon) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE xkbcommon::libxkbcommon) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0bd86fa64260a --- /dev/null +++ b/recipes/xkbcommon/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 = "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): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/xkbcommon/all/test_package/test_package.cpp b/recipes/xkbcommon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..92ee66edda66e --- /dev/null +++ b/recipes/xkbcommon/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "xkbcommon/xkbcommon.h" + +int main() +{ + struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + if (!ctx) return 1; + return 0; +} diff --git a/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt b/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xkbcommon/all/test_v1_package/conanfile.py b/recipes/xkbcommon/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e9bf8aa5f82dd --- /dev/null +++ b/recipes/xkbcommon/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +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 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/xkbcommon/config.yml b/recipes/xkbcommon/config.yml new file mode 100644 index 0000000000000..aa62b1dc6f781 --- /dev/null +++ b/recipes/xkbcommon/config.yml @@ -0,0 +1,15 @@ +versions: + "1.5.0": + folder: all + "1.4.1": + folder: all + "1.3.1": + folder: all + "1.2.1": + folder: all + "1.1.0": + folder: all + "1.0.3": + folder: all + "0.10.0": + folder: all diff --git a/recipes/xkeyboard-config/all/conanfile.py b/recipes/xkeyboard-config/all/conanfile.py new file mode 100644 index 0000000000000..ec1b8c4a6f2ed --- /dev/null +++ b/recipes/xkeyboard-config/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" + + +class XkeyboardConfigConan(ConanFile): + name = "xkeyboard-config" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/" + description = "The non-arch keyboard configuration database for X Window." + settings = "os", "compiler", "build_type" # no arch here, because the xkeyboard-config system package is arch independant + topics = ("x11", "xorg", "keyboard") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def package_id(self): + self.info.clear() + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["xkb-data"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["xkeyboard-config-devel"], update=True, check=True) + + dnf = package_manager.Dnf(self) + dnf.install(["xkeyboard-config-devel"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["xkeyboard-config"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["xkeyboard-config"], update=True, check=True) + + package_manager.Pkg(self).install(["xkeyboard-config"], update=True, check=True) + + def package_info(self): + pkg_config = PkgConfig(self, "xkeyboard-config") + pkg_config.fill_cpp_info( + self.cpp_info, is_system=self.settings.os != "FreeBSD") + self.cpp_info.set_property("pkg_config_name", "xkeyboard-config") + self.cpp_info.set_property("component_version", pkg_config.version) + self.cpp_info.set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) diff --git a/recipes/xkeyboard-config/all/test_package/conanfile.py b/recipes/xkeyboard-config/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5ce13b9d34b6d --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def generate(self): + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + + def test(self): + pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config") + self.run(f"{pkg_config} --validate xkeyboard-config") diff --git a/recipes/xkeyboard-config/all/test_v1_package/conanfile.py b/recipes/xkeyboard-config/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..510f8a1855391 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "pkg_config" + + def build(self): + pass + + def test(self): + self.run("pkg-config --validate ./xkeyboard-config.pc") diff --git a/recipes/xkeyboard-config/config.yml b/recipes/xkeyboard-config/config.yml new file mode 100644 index 0000000000000..76a338dd54cee --- /dev/null +++ b/recipes/xkeyboard-config/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "all" diff --git a/recipes/xlnt/all/conandata.yml b/recipes/xlnt/all/conandata.yml new file mode 100644 index 0000000000000..e00cfba4123d9 --- /dev/null +++ b/recipes/xlnt/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.5.0": + url: "https://github.com/tfussell/xlnt/archive/refs/tags/v1.5.0.tar.gz" + sha256: "8dec266d59ab6e4829da5dacea764a02887eeff5a5501c9a51ce796e735b90de" +patches: + "1.5.0": + - patch_file: "patches/0001-fix-cmake-and-unvendor-deps.patch" + patch_description: "Fix CMakeLists and unvendor dependencies" + patch_type: "conan" + - patch_file: "patches/0002-include-limits.patch" + patch_description: "Add missing includes" + patch_type: "portability" diff --git a/recipes/xlnt/all/conanfile.py b/recipes/xlnt/all/conanfile.py new file mode 100644 index 0000000000000..b40b12448a161 --- /dev/null +++ b/recipes/xlnt/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class XlntConan(ConanFile): + name = "xlnt" + description = "Cross-platform user-friendly xlsx library for C++11+" + license = "MIT" + topics = ("excel", "xlsx", "spreadsheet", "reader", "writer") + homepage = "https://github.com/tfussell/xlnt" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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("libstudxml/1.1.0-b.10+1") + self.requires("miniz/3.0.2") + self.requires("utfcpp/3.2.3") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + libstudxml_version = Version(self.dependencies["libstudxml"].ref.version) + libstudxml_major_minor = f"{libstudxml_version.major}.{libstudxml_version.minor}" + if Version(libstudxml_major_minor) < "1.1": + raise ConanInvalidConfiguration(f"{self.ref} not compatible with libstudxml < 1.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["STATIC"] = not self.options.shared + tc.variables["TESTS"] = False + tc.variables["SAMPLES"] = False + tc.variables["BENCHMARKS"] = False + tc.variables["PYTHON"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Remove unvendored third party libs + for third_party in ("libstudxml", "miniz", "utfcpp"): + rmdir(self, os.path.join(self.source_folder, "third-party", third_party)) + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Xlnt") + self.cpp_info.set_property("cmake_target_name", "xlnt::xlnt") + self.cpp_info.set_property("pkg_config_name", "xlnt") + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"xlnt{suffix}"] + if not self.options.shared: + self.cpp_info.defines.append("XLNT_STATIC") + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "Xlnt" + self.cpp_info.filenames["cmake_find_package_multi"] = "Xlnt" + self.cpp_info.names["cmake_find_package"] = "xlnt" + self.cpp_info.names["cmake_find_package_multi"] = "xlnt" diff --git a/recipes/xlnt/all/patches/0001-fix-cmake-and-unvendor-deps.patch b/recipes/xlnt/all/patches/0001-fix-cmake-and-unvendor-deps.patch new file mode 100644 index 0000000000000..f894c2e80026b --- /dev/null +++ b/recipes/xlnt/all/patches/0001-fix-cmake-and-unvendor-deps.patch @@ -0,0 +1,113 @@ +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -1,9 +1,6 @@ + cmake_minimum_required(VERSION 3.1) + project(xlnt VERSION 1.5.0) + +-set(CMAKE_CXX_STANDARD ${XLNT_CXX_LANG}) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CXX_EXTENSIONS OFF) + + # Project metadata + set(PROJECT_VENDOR "Thomas Fussell") +@@ -18,8 +15,6 @@ set(XLNT_SOURCE_DIR ${XLNT_ROOT_DIR}/source) + set(THIRD_PARTY_DIR ${XLNT_ROOT_DIR}/third-party) + + # Include libstudxml library +-add_subdirectory(${THIRD_PARTY_DIR}/libstudxml +- ${CMAKE_CURRENT_BINARY_DIR}/third-party/libstudxml) + + if(COVERAGE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") +@@ -30,12 +25,9 @@ if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") # level 4 warnings + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # multi-processor compilation + elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # all warnings +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") # extra warnings + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") # ignore MSVC and Clang pragmas + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized") # GCC diagnostic with lots of false positives + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything") # all warnings + # blacklist warnings that are not relevant + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat") # ignore warnings about C++98 compatibility + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic") # ignore pedantic warnings about C++98 compatibility +@@ -54,7 +46,7 @@ if(STATIC_CRT) + ucm_set_runtime(STATIC) + endif() + +-if(APPLE) ++if(0) + # Prevent a warning about deployment target not being set by setting it to current OSX version + execute_process(COMMAND "sw_vers -productVersion | awk -F'.' '{print $1\".\"$2}'" + OUTPUT_VARIABLE OSX_VERSION) +@@ -84,8 +76,6 @@ file(GLOB WORKBOOK_HEADERS ${XLNT_INCLUDE_DIR}/xlnt/workbook/*.hpp) + file(GLOB WORKBOOK_SOURCES ${XLNT_SOURCE_DIR}/workbook/*.cpp) + file(GLOB WORKSHEET_HEADERS ${XLNT_INCLUDE_DIR}/xlnt/worksheet/*.hpp) + file(GLOB WORKSHEET_SOURCES ${XLNT_SOURCE_DIR}/worksheet/*.cpp) +-file(GLOB MINIZ_HEADERS ${THIRD_PARTY_DIR}/miniz/*.h) +-file(GLOB MINIZ_SOURCES ${THIRD_PARTY_DIR}/miniz/*.c) + + file(GLOB DETAIL_ROOT_HEADERS ${XLNT_SOURCE_DIR}/detail/*.hpp) + file(GLOB DETAIL_ROOT_SOURCES ${XLNT_SOURCE_DIR}/detail/*.cpp) +@@ -115,12 +105,12 @@ set(XLNT_HEADERS ${ROOT_HEADERS} ${CELL_HEADERS} ${CHARTS_HEADERS} + ${CHARTSHEET_HEADERS} ${DRAWING_HEADERS} ${FORMULA_HEADERS} + ${PACKAGING_HEADERS} ${STYLES_HEADERS} ${UTILS_HEADERS} + ${WORKBOOK_HEADERS} ${WORKSHEET_HEADERS} ${DETAIL_HEADERS} ${DETAIL_CRYPTO_HEADERS} +- ${DRAWING_HEADERS} ${MINIZ_HEADERS}) ++ ${DRAWING_HEADERS}) + set(XLNT_SOURCES ${CELL_SOURCES} ${CHARTS_SOURCES} ${CHARTSHEET_SOURCES} + ${DRAWING_SOURCES} ${FORMULA_SOURCES} ${PACKAGING_SOURCES} + ${STYLES_SOURCES} ${UTILS_SOURCES} ${WORKBOOK_SOURCES} + ${WORKSHEET_SOURCES} ${DETAIL_SOURCES} ${DETAIL_CRYPTO_SOURCES} +- ${DRAWING_SOURCES} ${MINIZ_SOURCES}) ++ ${DRAWING_SOURCES}) + + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + # Set a default CMAKE_INSTALL_PREFIX if one wasn't specified +@@ -159,7 +149,7 @@ if(NOT STATIC) + add_library(xlnt SHARED + ${XLNT_HEADERS} + ${XLNT_SOURCES} +- $) ++ ) + + target_compile_definitions(xlnt PRIVATE XLNT_SHARED=1) + +@@ -168,10 +158,10 @@ if(NOT STATIC) + PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} +- INSTALL_NAME_DIR "${XLNT_LIB_DEST_DIR}") ++ ) + else() + # Compile static library +- add_library(xlnt STATIC ${XLNT_HEADERS} ${XLNT_SOURCES} $) ++ add_library(xlnt STATIC ${XLNT_HEADERS} ${XLNT_SOURCES}) + target_compile_definitions(xlnt PUBLIC XLNT_STATIC=1) + endif() + +@@ -185,9 +175,12 @@ target_include_directories(xlnt + $ + PRIVATE + ${XLNT_SOURCE_DIR} +- ${XLNT_SOURCE_DIR}/../third-party/libstudxml +- ${XLNT_SOURCE_DIR}/../third-party/miniz +- ${XLNT_SOURCE_DIR}/../third-party/utfcpp) ++) ++find_package(libstudxml REQUIRED CONFIG) ++find_package(miniz REQUIRED CONFIG) ++find_package(utf8cpp REQUIRED CONFIG) ++target_link_libraries(xlnt PRIVATE miniz::miniz utf8cpp libstudxml::libstudxml) ++target_compile_features(xlnt PUBLIC cxx_std_11) + + # Platform- and file-specific settings, MSVC + if(MSVC) +@@ -240,7 +233,6 @@ source_group(styles FILES ${STYLES_HEADERS} ${STYLES_SOURCES}) + source_group(utils FILES ${UTILS_HEADERS} ${UTILS_SOURCES}) + source_group(workbook FILES ${WORKBOOK_HEADERS} ${WORKBOOK_SOURCES}) + source_group(worksheet FILES ${WORKSHEET_HEADERS} ${WORKSHEET_SOURCES}) +-source_group(third-party\\miniz FILES ${MINIZ_HEADERS} ${MINIZ_SOURCES}) + + # Install library + install(TARGETS xlnt EXPORT XlntTargets diff --git a/recipes/xlnt/all/patches/0002-include-limits.patch b/recipes/xlnt/all/patches/0002-include-limits.patch new file mode 100644 index 0000000000000..10da95ecdd562 --- /dev/null +++ b/recipes/xlnt/all/patches/0002-include-limits.patch @@ -0,0 +1,20 @@ +--- a/source/cell/cell.cpp ++++ b/source/cell/cell.cpp +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include + + #include +--- a/source/detail/number_format/number_formatter.cpp ++++ b/source/detail/number_format/number_formatter.cpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/recipes/xlnt/all/test_package/CMakeLists.txt b/recipes/xlnt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5996d0ee3e85b --- /dev/null +++ b/recipes/xlnt/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Xlnt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xlnt::xlnt) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/xlnt/all/test_package/conanfile.py b/recipes/xlnt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xlnt/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/xlnt/all/test_package/test_package.cpp b/recipes/xlnt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2ca71e20dee41 --- /dev/null +++ b/recipes/xlnt/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +int main() +{ + xlnt::workbook wb; + xlnt::worksheet ws = wb.active_sheet(); + ws.cell("A1").value(5); + ws.cell("B2").value("string data"); + ws.cell("C3").formula("=RAND()"); + ws.merge_cells("C3:C4"); + ws.freeze_panes("B2"); + wb.save("example.xlsx"); + return 0; +} diff --git a/recipes/xlnt/all/test_v1_package/CMakeLists.txt b/recipes/xlnt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xlnt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xlnt/all/test_v1_package/conanfile.py b/recipes/xlnt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xlnt/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/xlnt/config.yml b/recipes/xlnt/config.yml new file mode 100644 index 0000000000000..7f3d5d7f62dd8 --- /dev/null +++ b/recipes/xlnt/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.0": + folder: all diff --git a/recipes/xmlsec/all/conandata.yml b/recipes/xmlsec/all/conandata.yml new file mode 100644 index 0000000000000..46664dc0decc9 --- /dev/null +++ b/recipes/xmlsec/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.32": + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.32.tar.gz" + sha256: "e383702853236004e5b08e424b8afe9b53fe9f31aaa7a5382f39d9533eb7c043" + "1.2.31": + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.31.tar.gz" + sha256: "9b10bc52cc31e4f76162e3975e50db26b71ab49c571d810b311ca626be5a0b26" + "1.2.30": + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.30.tar.gz" + sha256: "2d84360b03042178def1d9ff538acacaed2b3a27411db7b2874f1612ed71abc8" diff --git a/recipes/xmlsec/all/conanfile.py b/recipes/xmlsec/all/conanfile.py new file mode 100644 index 0000000000000..6cbfca0ca36ca --- /dev/null +++ b/recipes/xmlsec/all/conanfile.py @@ -0,0 +1,241 @@ +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 chdir, 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, msvc_runtime_flag, NMakeDeps, NMakeToolchain +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.58.0" + + +class XmlSecConan(ConanFile): + name = "xmlsec" + description = "XML Security Library is a C library based on LibXML2. The library supports major XML security standards." + license = ("MIT", "MPL-1.1") + homepage = "https://www.aleksey.com/xmlsec" + url = "https://github.com/conan-io/conan-center-index" + topics = ("xml", "signature", "encryption") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "with_nss": [True, False], + "with_gcrypt": [True, False], + "with_gnutls": [True, False], + "with_xslt": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_nss": False, + "with_gcrypt": False, + "with_gnutls": False, + "with_openssl": True, + "with_xslt": False, + } + + @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("libxml2/2.10.4", transitive_headers=True) + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + if self.options.with_xslt: + self.requires("libxslt/1.1.34") + + def validate(self): + if self.options.with_nss: + raise ConanInvalidConfiguration("xmlsec with nss not supported yet in this recice") + if self.options.with_gcrypt: + raise ConanInvalidConfiguration("xmlsec with gcrypt not supported yet in this recice") + if self.options.with_gnutls: + raise ConanInvalidConfiguration("xmlsec with gnutls not supported yet in this recice") + if not (self.options.with_openssl or self.options.with_nss or self.options.with_gcrypt or self.options.with_gnutls): + raise ConanInvalidConfiguration("At least one crypto engine needs to be enabled") + + 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") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + if not self.options.shared: + tc.extra_defines.append("XMLSEC_STATIC") + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--enable-crypto-dl=no", + "--enable-apps-crypto-dl=no", + f"--with-libxslt={yes_no(self.options.with_xslt)}", + f"--with-openssl={yes_no(self.options.with_openssl)}", + f"--with-nss={yes_no(self.options.with_nss)}", + f"--with-nspr={yes_no(self.options.with_nss)}", + f"--with-gcrypt={yes_no(self.options.with_gcrypt)}", + f"--with-gnutls={yes_no(self.options.with_gnutls)}", + "--enable-mscrypto=no", # Built on mingw + "--enable-mscng=no", # Build on mingw + "--enable-docs=no", + "--enable-mans=no", + ]) + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + if is_msvc(self): + # Configure step to generate Makefile.msvc + deps_includedirs = [] + deps_libdirs = [] + for deps in self.dependencies.values(): + deps_cpp_info = deps.cpp_info.aggregated_components() + deps_includedirs.extend(deps_cpp_info.includedirs) + deps_libdirs.extend(deps_cpp_info.libdirs) + + crypto_engines = [] + if self.options.with_openssl: + ov = Version(self.dependencies["openssl"].ref.version) + if ov.major >= "3": + if Version(self.version) < "1.2.35": + # configure.js doesn't understand openssl=300 before xmlsec 1.2.35, + # For these xmlsec versions, setting 110 even for OpenSSL 3.x should be compatible + crypto_engines.append("openssl=110") + else: + crypto_engines.append("openssl=300") + else: + crypto_engines.append(f"openssl={ov.major}{ov.minor}0") + + yes_no = lambda v: "yes" if v else "no" + args = [ + f"prefix={self.package_folder}", + f"cruntime=/{msvc_runtime_flag(self)}", + f"debug={yes_no(self.settings.build_type == 'Debug')}", + f"static={yes_no(not self.options.shared)}", + "include=\"{}\"".format(";".join(deps_includedirs)), + "lib=\"{}\"".format(";".join(deps_libdirs)), + "with-dl=no", + f"xslt={yes_no(self.options.with_xslt)}", + "iconv=no", + "crypto={}".format(",".join(crypto_engines)), + ] + + with chdir(self, os.path.join(self.source_folder, "win32")): + self.run(f"cscript configure.js {' '.join(args)}") + + # Fix library names in generated Makefile.msvc + def format_libs(package): + cpp_info = self.dependencies[package].cpp_info.aggregated_components() + libs = [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in cpp_info.libs + cpp_info.system_libs] + return " ".join(libs) + + makefile_msvc = os.path.join(self.source_folder, "win32", "Makefile.msvc") + replace_in_file(self, makefile_msvc, "libxml2.lib", format_libs("libxml2")) + replace_in_file(self, makefile_msvc, "libxml2_a.lib", format_libs("libxml2")) + if self.options.with_xslt: + replace_in_file(self, makefile_msvc, "libxslt.lib", format_libs("libxslt")) + replace_in_file(self, makefile_msvc, "libxslt_a.lib", format_libs("libxslt")) + if self.options.with_openssl: + replace_in_file(self, makefile_msvc, "libcrypto.lib", format_libs("openssl")) + + # Build with NMake + with chdir(self, os.path.join(self.source_folder, "win32")): + self.run("nmake -f Makefile.msvc") + else: + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "Copyright", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + with chdir(self, os.path.join(self.source_folder, "win32")): + self.run("nmake -f Makefile.msvc install") + if not self.options.shared: + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec-openssl_a.lib" if self.options.shared else "libxmlsec-openssl.lib")) + os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec_a.lib" if self.options.shared else "libxmlsec.lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + os.remove(os.path.join(self.package_folder, "lib", "xmlsec1Conf.sh")) + fix_apple_shared_install_name(self) + + def package_info(self): + major = str(Version(self.version).major) + prefix = "lib" if is_msvc(self) else "" + infix = "" if is_msvc(self) else major + base_libname = f"{prefix}xmlsec{infix}" + suffix = "_a" if is_msvc(self) and not self.options.shared else "" + + self.cpp_info.components["libxmlsec"].set_property("pkg_config_name", f"xmlsec{major}") + self.cpp_info.components["libxmlsec"].libs = [f"{base_libname}{suffix}"] + if not is_msvc(self): + self.cpp_info.components["libxmlsec"].includedirs.append(os.path.join("include", f"xmlsec{major}")) + self.cpp_info.components["libxmlsec"].requires = ["libxml2::libxml2"] + if not self.options.shared: + self.cpp_info.components["libxmlsec"].defines.append("XMLSEC_STATIC") + if self.options.with_xslt: + self.cpp_info.components["libxmlsec"].requires.append("libxslt::libxslt") + else: + self.cpp_info.components["libxmlsec"].defines.append("XMLSEC_NO_XSLT=1") + self.cpp_info.components["libxmlsec"].defines.extend(["XMLSEC_NO_SIZE_T", "XMLSEC_NO_GOST=1", "XMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libxmlsec"].system_libs = ["m", "dl", "pthread"] + if self.settings.os == "Windows": + self.cpp_info.components["libxmlsec"].system_libs = ["crypt32", "ws2_32", "advapi32", "user32", "bcrypt"] + + if self.options.with_openssl: + self.cpp_info.components["openssl"].set_property("pkg_config_name", f"xmlsec{major}-openssl") + self.cpp_info.components["openssl"].libs = [f"{base_libname}-openssl{suffix}"] + self.cpp_info.components["openssl"].requires = ["libxmlsec", "openssl::openssl"] + self.cpp_info.components["openssl"].defines = ["XMLSEC_CRYPTO_OPENSSL=1"] diff --git a/recipes/xmlsec/all/test_package/CMakeLists.txt b/recipes/xmlsec/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..926e0b1fdcb15 --- /dev/null +++ b/recipes/xmlsec/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(xmlsec REQUIRED CONFIG) +find_package(LibXml2 REQUIRED MODULE) +if(XMLSEC_WITH_XSLT) + find_package(LibXslt REQUIRED MODULE) +endif() + +add_executable(${PROJECT_NAME} sign1.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2 xmlsec::xmlsec) +if(XMLSEC_WITH_XSLT) + target_link_libraries(${PROJECT_NAME} PRIVATE LibXslt::LibXslt) +endif() diff --git a/recipes/xmlsec/all/test_package/conanfile.py b/recipes/xmlsec/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e977f9247d9e3 --- /dev/null +++ b/recipes/xmlsec/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("libxml2/2.10.4") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["XMLSEC_WITH_XSLT"] = self.dependencies["xmlsec"].options.with_xslt + 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") + xml_file = os.path.join(self.source_folder, "sign1-tmpl.xml") + pem_file = os.path.join(self.source_folder, "rsakey.pem") + self.run(f"{bin_path} {xml_file} {pem_file}", env="conanrun") diff --git a/recipes/xmlsec/all/test_package/rsakey.pem b/recipes/xmlsec/all/test_package/rsakey.pem new file mode 100644 index 0000000000000..de07b7803966b --- /dev/null +++ b/recipes/xmlsec/all/test_package/rsakey.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBPAIBAAJBANPQbQ92nlbeg1Q5JNHSO1Yey46nZ7GJltLWw1ccSvp7pnvmfUm+ +M521CpFpfr4EAE3UVBMoU9j/hqq3dFAc2H0CAwEAAQJBALFVCjmsAZyQ5jqZLO5N +qEfNuHZSSUol+xPBogFIOq3BWa269eNNcAK5or5g0XWWon7EPdyGT4qyDVH9KzXK +RLECIQDzm/Nj0epUGN51/rKJgRXWkXW/nfSCMO9fvQR6Ujoq3wIhAN6WeHK9vgWg +wBWqMdq5sR211+LlDH7rOUQ6rBpbsoQjAiEA7jzpfglgPPZFOOfo+oh/LuP6X3a+ +FER/FQXpRyb7M8kCIETUrwZ8WkiPPxbz/Fqw1W5kjw/g2I5e2uSYaCP2eyuVAiEA +mOI6RhRyMqgxQyy0plJVjG1s4fdu92AWYy9AwYeyd/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/recipes/xmlsec/all/test_package/sign1-tmpl.xml b/recipes/xmlsec/all/test_package/sign1-tmpl.xml new file mode 100644 index 0000000000000..1c50319fad562 --- /dev/null +++ b/recipes/xmlsec/all/test_package/sign1-tmpl.xml @@ -0,0 +1,26 @@ + + + + + Hello, World! + + + + + + + + + + + + + + + + + + + diff --git a/recipes/xmlsec/all/test_package/sign1.c b/recipes/xmlsec/all/test_package/sign1.c new file mode 100644 index 0000000000000..c081e62e344fd --- /dev/null +++ b/recipes/xmlsec/all/test_package/sign1.c @@ -0,0 +1,211 @@ +/** + * XML Security Library example: Signing a template file. + * + * Signs a template file using a key from PEM file + * + * Usage: + * ./sign1 + * + * Example: + * ./sign1 sign1-tmpl.xml rsakey.pem > sign1-res.xml + * + * The result signature could be validated using verify1 example: + * ./verify1 sign1-res.xml rsapub.pem + * + * This is free software; see Copyright file in the source + * distribution for preciese wording. + * + * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. + */ +#include +#include +#include + +#include +#include +#include + +#ifndef XMLSEC_NO_XSLT +#include +#include +#endif /* XMLSEC_NO_XSLT */ + +#include +#include +#include +#include + +int sign_file(const char* tmpl_file, const char* key_file); + +int +main(int argc, char **argv) { +#ifndef XMLSEC_NO_XSLT + xsltSecurityPrefsPtr xsltSecPrefs = NULL; +#endif /* XMLSEC_NO_XSLT */ + + assert(argv); + + if(argc != 3) { + fprintf(stderr, "Error: wrong number of arguments.\n"); + fprintf(stderr, "Usage: %s \n", argv[0]); + return(1); + } + + /* Init libxml and libxslt libraries */ + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); +#ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; +#endif /* XMLSEC_NO_XSLT */ + + /* Init libxslt */ +#ifndef XMLSEC_NO_XSLT + /* disable everything */ + xsltSecPrefs = xsltNewSecurityPrefs(); + xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityForbid); + xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_FILE, xsltSecurityForbid); + xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_CREATE_DIRECTORY, xsltSecurityForbid); + xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_NETWORK, xsltSecurityForbid); + xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_NETWORK, xsltSecurityForbid); + xsltSetDefaultSecurityPrefs(xsltSecPrefs); +#endif /* XMLSEC_NO_XSLT */ + + /* Init xmlsec library */ + if(xmlSecInit() < 0) { + fprintf(stderr, "Error: xmlsec initialization failed.\n"); + return(-1); + } + + /* Check loaded library version */ + if(xmlSecCheckVersion() != 1) { + fprintf(stderr, "Error: loaded xmlsec library version is not compatible.\n"); + return(-1); + } + + /* Load default crypto engine if we are supporting dynamic + * loading for xmlsec-crypto libraries. Use the crypto library + * name ("openssl", "nss", etc.) to load corresponding + * xmlsec-crypto library. + */ +#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING + if(xmlSecCryptoDLLoadLibrary(NULL) < 0) { + fprintf(stderr, "Error: unable to load default xmlsec-crypto library. Make sure\n" + "that you have it installed and check shared libraries path\n" + "(LD_LIBRARY_PATH and/or LTDL_LIBRARY_PATH) environment variables.\n"); + return(-1); + } +#endif /* XMLSEC_CRYPTO_DYNAMIC_LOADING */ + + /* Init crypto library */ + if(xmlSecCryptoAppInit(NULL) < 0) { + fprintf(stderr, "Error: crypto initialization failed.\n"); + return(-1); + } + + /* Init xmlsec-crypto library */ + if(xmlSecCryptoInit() < 0) { + fprintf(stderr, "Error: xmlsec-crypto initialization failed.\n"); + return(-1); + } + + if(sign_file(argv[1], argv[2]) < 0) { + return(-1); + } + + /* Shutdown xmlsec-crypto library */ + xmlSecCryptoShutdown(); + + /* Shutdown crypto library */ + xmlSecCryptoAppShutdown(); + + /* Shutdown xmlsec library */ + xmlSecShutdown(); + + /* Shutdown libxslt/libxml */ +#ifndef XMLSEC_NO_XSLT + xsltFreeSecurityPrefs(xsltSecPrefs); + xsltCleanupGlobals(); +#endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + return(0); +} + +/** + * sign_file: + * @tmpl_file: the signature template file name. + * @key_file: the PEM private key file name. + * + * Signs the #tmpl_file using private key from #key_file. + * + * Returns 0 on success or a negative value if an error occurs. + */ +int +sign_file(const char* tmpl_file, const char* key_file) { + xmlDocPtr doc = NULL; + xmlNodePtr node = NULL; + xmlSecDSigCtxPtr dsigCtx = NULL; + int res = -1; + + assert(tmpl_file); + assert(key_file); + + /* load template */ + doc = xmlParseFile(tmpl_file); + if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)){ + fprintf(stderr, "Error: unable to parse file \"%s\"\n", tmpl_file); + goto done; + } + + /* find start node */ + node = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, xmlSecDSigNs); + if(node == NULL) { + fprintf(stderr, "Error: start node not found in \"%s\"\n", tmpl_file); + goto done; + } + + /* create signature context, we don't need keys manager in this example */ + dsigCtx = xmlSecDSigCtxCreate(NULL); + if(dsigCtx == NULL) { + fprintf(stderr,"Error: failed to create signature context\n"); + goto done; + } + + /* load private key, assuming that there is not password */ + dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file, xmlSecKeyDataFormatPem, NULL, NULL, NULL); + if(dsigCtx->signKey == NULL) { + fprintf(stderr,"Error: failed to load private pem key from \"%s\"\n", key_file); + goto done; + } + + /* set key name to the file name, this is just an example! */ + if(xmlSecKeySetName(dsigCtx->signKey, key_file) < 0) { + fprintf(stderr,"Error: failed to set key name for key from \"%s\"\n", key_file); + goto done; + } + + /* sign the template */ + if(xmlSecDSigCtxSign(dsigCtx, node) < 0) { + fprintf(stderr,"Error: signature failed\n"); + goto done; + } + + /* print signed document to stdout */ + xmlDocDump(stdout, doc); + + /* success */ + res = 0; + +done: + /* cleanup */ + if(dsigCtx != NULL) { + xmlSecDSigCtxDestroy(dsigCtx); + } + + if(doc != NULL) { + xmlFreeDoc(doc); + } + return(res); +} diff --git a/recipes/xmlsec/all/test_v1_package/CMakeLists.txt b/recipes/xmlsec/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xmlsec/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xmlsec/all/test_v1_package/conanfile.py b/recipes/xmlsec/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8a68c0f50f6f9 --- /dev/null +++ b/recipes/xmlsec/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["XMLSEC_WITH_XSLT"] = self.options["xmlsec"].with_xslt + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_file = os.path.join(self.source_folder, os.pardir, "test_package", "sign1-tmpl.xml") + pem_file = os.path.join(self.source_folder, os.pardir, "test_package", "rsakey.pem") + self.run(f"{bin_path} {xml_file} {pem_file}", run_environment=True) diff --git a/recipes/xmlsec/config.yml b/recipes/xmlsec/config.yml new file mode 100644 index 0000000000000..be77378a24392 --- /dev/null +++ b/recipes/xmlsec/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.32": + folder: all + "1.2.31": + folder: all + "1.2.30": + folder: all diff --git a/recipes/xnnpack/all/conandata.yml b/recipes/xnnpack/all/conandata.yml new file mode 100644 index 0000000000000..271fcb3d93eeb --- /dev/null +++ b/recipes/xnnpack/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20220801": + url: "https://github.com/google/XNNPACK/archive/8e3d3359f9bec608e09fac1f7054a2a14b1bd73c.tar.gz" + sha256: "c82327543249bd333034bbaa0300ed1fc9c7060fa73673a285042e3f042540e0" + "cci.20220621": + url: "https://github.com/google/XNNPACK/archive/b725ca1a40b53d8087d1be0c53cb49fa05e2f1bc.tar.gz" + sha256: "a745c629dea5fc76e5a545e412a408fde1a523b71027f07d1b0670ec9ae54819" + "cci.20211210": + url: "https://github.com/google/XNNPACK/archive/113092317754c7dea47bfb3cb49c4f59c3c1fa10.tar.gz" + sha256: "065bb9c85438c453f9300251f263118c4d123d79b21acf8f66582a3124d95fb2" diff --git a/recipes/xnnpack/all/conanfile.py b/recipes/xnnpack/all/conanfile.py new file mode 100644 index 0000000000000..7263f61d28bb8 --- /dev/null +++ b/recipes/xnnpack/all/conanfile.py @@ -0,0 +1,131 @@ +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, replace_in_file +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.1" + + +class XnnpackConan(ConanFile): + name = "xnnpack" + description = "XNNPACK is a highly optimized library of floating-point " \ + "neural network inference operators for ARM, WebAssembly, " \ + "and x86 platforms." + license = "BSD-3-Clause" + topics = ("neural-network", "inference", "multithreading", "inference-optimization", + "matrix-multiplication", "simd") + homepage = "https://github.com/google/XNNPACK" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "assembly": [True, False], + "memopt": [True, False], + "sparse": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "assembly": True, + "memopt": True, + "sparse": True, + } + + def export_sources(self): + copy(self, "xnnpack_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + # for plain C projects only + 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("cpuinfo/cci.20220228") + self.requires("fp16/cci.20210320") + # https://github.com/google/XNNPACK/blob/ed5f9c0562e016a08b274a4579de5ef500fec134/include/xnnpack.h#L15 + self.requires("pthreadpool/cci.20210218", transitive_headers=True) + self.requires("fxdiv/cci.20200417") + + def validate(self): + check_min_vs(self, 192) + compiler = self.info.settings.compiler + compiler_version = Version(compiler.version) + if (compiler == "gcc" and compiler_version < "6") or \ + (compiler == "clang" and compiler_version < "5"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {compiler} {compiler.version}") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.arch == "armv8": + if self.settings.os == "Linux": + tc.variables["CONAN_XNNPACK_SYSTEM_PROCESSOR"] = "aarch64" + else: + # Not defined by Conan for Apple Silicon. See https://github.com/conan-io/conan/pull/8026 + tc.variables["CONAN_XNNPACK_SYSTEM_PROCESSOR"] = "arm64" + tc.cache_variables["XNNPACK_LIBRARY_TYPE"] = "shared" if self.options.shared else "static" + tc.cache_variables["CMAKE_PROJECT_XNNPACK_INCLUDE"] = os.path.join(self.source_folder, "xnnpack_project_include.cmake") + tc.variables["XNNPACK_ENABLE_ASSEMBLY"] = self.options.assembly + tc.variables["XNNPACK_ENABLE_MEMOPT"] = self.options.memopt + tc.variables["XNNPACK_ENABLE_SPARSE"] = self.options.sparse + tc.variables["XNNPACK_BUILD_TESTS"] = False + tc.variables["XNNPACK_BUILD_BENCHMARKS"] = False + tc.variables["XNNPACK_USE_SYSTEM_LIBS"] = True + # Default fPIC on if it doesn't exist (i.e. for shared library builds) + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + # Install only built targets, in this case just the XNNPACK target + tc.variables["CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"] = True + # To export symbols for shared msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + # The CMake scripts don't use targets prefixed with `namespace::` + # so we can coerce CMakeDeps to define the exact target names that + # are expected. This works in tandem with the file + # `CMAKE_PROJECT_XNNPACK_INCLUDE` which ensure an early call to + # the relevant `find_package` + deps.set_property("cpuinfo", "cmake_target_name", "cpuinfo") + deps.set_property("cpuinfo", "cmake_target_aliases", ["clog"] ) + deps.set_property("pthreadpool", "cmake_target_name", "pthreadpool") + deps.set_property("fp16", "cmake_target_name", "fp16") + deps.set_property("fxdiv", "cmake_target_name", "fxdiv") + deps.generate() + + 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}") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build(target="XNNPACK") + + 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 = ["XNNPACK"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/xnnpack/all/test_package/CMakeLists.txt b/recipes/xnnpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b71bd6e6242c8 --- /dev/null +++ b/recipes/xnnpack/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(xnnpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xnnpack::xnnpack) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/xnnpack/all/test_package/conanfile.py b/recipes/xnnpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xnnpack/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/xnnpack/all/test_package/test_package.c b/recipes/xnnpack/all/test_package/test_package.c new file mode 100644 index 0000000000000..0d6d96b3e4aea --- /dev/null +++ b/recipes/xnnpack/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +int main() { + int init_status = xnn_initialize(NULL); + if(init_status != xnn_status_success) { + return 1; + } + int deinit_status = xnn_deinitialize(); + if(deinit_status != xnn_status_success) { + return 1; + } + return 0; +} diff --git a/recipes/xnnpack/all/test_v1_package/CMakeLists.txt b/recipes/xnnpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a503e7fa1a41 --- /dev/null +++ b/recipes/xnnpack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xnnpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xnnpack::xnnpack) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/xnnpack/all/test_v1_package/conanfile.py b/recipes/xnnpack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xnnpack/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/xnnpack/all/xnnpack_project_include.cmake b/recipes/xnnpack/all/xnnpack_project_include.cmake new file mode 100644 index 0000000000000..bbde492fd46a8 --- /dev/null +++ b/recipes/xnnpack/all/xnnpack_project_include.cmake @@ -0,0 +1,19 @@ +if(UNIX AND NOT APPLE) + # This project forces gcc to use C99 with GNU extensions disabled + # This may cause the `timespec` time (from POSIX) to not be defined + # at all - the macro below also causes POSIX types to be defined + # while remaining in C99 mode. + add_compile_definitions(_DEFAULT_SOURCE) +endif() + +if(NOT CMAKE_SYSTEM_PROCESSOR AND CONAN_XNNPACK_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${CONAN_XNNPACK_SYSTEM_PROCESSOR}) +endif() + +# The XNNPACK CMake scripts don't call find_package, +# but can work with targets - here we ensure we bring in those +# targets. +find_package(cpuinfo REQUIRED CONFIG) +find_package(pthreadpool REQUIRED CONFIG) +find_package(fp16 REQUIRED CONFIG) +find_package(fxdiv REQUIRED CONFIG) diff --git a/recipes/xnnpack/config.yml b/recipes/xnnpack/config.yml new file mode 100644 index 0000000000000..d1b55a81c6c28 --- /dev/null +++ b/recipes/xnnpack/config.yml @@ -0,0 +1,7 @@ +versions: + "cci.20220801": + folder: all + "cci.20220621": + folder: all + "cci.20211210": + folder: all diff --git a/recipes/xorg-cf-files/all/conandata.yml b/recipes/xorg-cf-files/all/conandata.yml new file mode 100644 index 0000000000000..6580982dad473 --- /dev/null +++ b/recipes/xorg-cf-files/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.7": + url: "https://www.x.org/pub/individual/util/xorg-cf-files-1.0.7.tar.gz" + sha256: "a49478ba0c2138bc53de38979cd2dee073b6fd6728597c552d266a707747f472" +patches: + "1.0.7": + - patch_file: "patches/1.0.7-0001-win-fixes.patch" diff --git a/recipes/xorg-cf-files/all/conanfile.py b/recipes/xorg-cf-files/all/conanfile.py new file mode 100644 index 0000000000000..aa2cb1d905e4c --- /dev/null +++ b/recipes/xorg-cf-files/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import AutotoolsToolchain, Autotools, PkgConfigDeps +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.files import get, rmdir, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.env import VirtualBuildEnv +from conan.tools.apple import is_apple_os +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.57.0" + + +class XorgCfFilesConan(ConanFile): + name = "xorg-cf-files" + # package_type = "build-scripts" # see https://github.com/conan-io/conan/issues/13431 + description = "Imake configuration files & templates" + topics = ("imake", "xorg", "template", "configuration", "obsolete") + license = "MIT" + homepage = "https://gitlab.freedesktop.org/xorg/util/cf" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("xorg-macros/1.19.3") + self.requires("xorg-proto/2022.2") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.arch + del self.info.settings.build_type + # self.info.settings.os # FIXME: can be removed once c3i is able to test multiple os'es from one common package + + def validate(self): + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support Apple operating systems.") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.build_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get('user.automake:compile-wrapper')) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("CPP", f"{compile_wrapper} cl -E") + tc.generate(env) + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + x11_config_files = os.path.join(self.package_folder, "lib", "X11", "config") + self.conf_info.define("user.xorg-cf-files:config-path", x11_config_files) + + self.user_info.CONFIG_PATH = x11_config_files.replace("\\", "/") diff --git a/recipes/xorg-cf-files/all/patches/1.0.7-0001-win-fixes.patch b/recipes/xorg-cf-files/all/patches/1.0.7-0001-win-fixes.patch new file mode 100644 index 0000000000000..ce7967641db17 --- /dev/null +++ b/recipes/xorg-cf-files/all/patches/1.0.7-0001-win-fixes.patch @@ -0,0 +1,233 @@ +--- Win32.cf ++++ Win32.cf +@@ -24,7 +24,7 @@ + #define CpuDefines -D_X86_ + #endif + /* brain-damaged windows headers will not compile with -Za */ +-#define StandardDefines -DWIN32 -DWIN32_LEAN_AND_MEAN -D_DLL -D_MT -D__STDC__ CpuDefines ++#define StandardDefines -DWIN32 -DWIN32_LEAN_AND_MEAN -D_DLL -D_MT -D__STDC__ + #if CompilerMajorVersion < 4 + #define DefaultCCOptions -nologo -batch -G4 -W2 + #else +--- Win32.rules ++++ Win32.rules +@@ -16,17 +16,17 @@ + #define ShLibIncludeFile + #define SharedLibraryLoadFlags -dll + #define PositionIndependentCFlags /**/ +- +-.c.obj: +- $(CC) -c $*.c @<< +- $(CFLAGS) +-<< ++.SUFFIXES: ++.SUFFIXES: .obj ++.SUFFIXES: .c ++.c.obj : ++ $(CC) -c $< $(CFLAGS) -o $@ + + #if HasCplusplus +-.CCsuf.obj: +- $(CXX) -c $*.CCsuf @<< +- $(CFLAGS) +-<< ++.SUFFIXES: .CCsuf ++.CCsuf.obj : ++ $(CXX) -c @< $(CFLAGS) -o $@ ++ + #endif + + #define ProgramTargetName(target) target.exe +@@ -36,40 +42,40 @@ + #define RemoveFile(file) if exist file $(RM) file + + #define RemoveFiles(files) @$(MAKE) $(MFLAGS) -f << @@\ +-.SUFFIXES: @@\ + @@\ +-all: files @@\ ++ @@\ ++all:: files @@\ + !for %%i in ( Avoid.Error $$** ) do if exist %%i $(RM) %%i @@\ + @@\ +-Avoid.Error files: @@\ +-<< ++Avoid.Error files:: @@\ ++ + + #define MakeDir(dir) -$(MKDIRHIER) dir + + #define ObjectCompile(options) RemoveFile($@) @@\ + $(CC) -c $*.c @<< @@\ + $(CFLAGS) options @@\ +-<< ++ + + #define LibObjCompile(dir,options) RemoveFiles($@ dir\$@) @@\ + $(CC) -c $*.c @<< @@\ + $(CCOPTIONS) $(ALLDEFINES) options @@\ +-<< @@\ ++ @@\ + $(MV) $@ dir\$@ + + #define BuildIncludesTop(srclist,dstsubdir,dstupdir) @@\ + includes:: srclist @@\ + MakeDir($(BUILDINCDIR:/=\)) @@\ + @$(MAKE) $(MFLAGS) -f << @@\ +-.SUFFIXES: @@\ + @@\ +-all: srclist @@\ ++ @@\ ++all:: srclist @@\ + cd $(BUILDINCDIR:/=\) @@\ + !RemoveFile($$**) @@\ + !$(LN) $(BUILDINCTOP:/=\)\$(CURRENT_DIR:/=\)\$$** . @@\ + @@\ +-Avoid.Error srclist: @@\ +-<< ++Avoid.Error srclist:: @@\ ++ + + #define BuildIncludes(srclist,dstsubdir,dstupdir) @@\ + XVARdef0 = $(BUILDINCDIR)/dstsubdir @@\ +@@ -78,15 +78,15 @@ + includes:: srclist @@\ + MakeDir($(XVARuse0:/=\)) @@\ + @$(MAKE) -A $(MFLAGS) -f << @@\ +-.SUFFIXES: @@\ + @@\ +-all: srclist @@\ ++ @@\ ++all:: srclist @@\ + cd $(XVARuse0:/=\) @@\ + !RemoveFile($$**) @@\ + !$(LN) $(XVARuse1:/=\)\$$** . @@\ + @@\ +-Avoid.Error srclist: @@\ +-<< ++Avoid.Error srclist:: @@\ ++ + + #define LinkFileList(step,list,dir,sub) @@\ + XVARdef0 = dir @@\ +@@ -179,7 +179,7 @@ + + #define MakeLibrary(libname,objlist) $(AR) @<< @@\ + -out:libname objlist @@\ +-<< ++ + + #define LinkSourceFile(src,dir) @@\ + XVARdef0 = dir/src @@\ +@@ -268,7 +274,7 @@ ProgramTargetName($(IMAKE)): @@\ + cd $(IMAKESRC:/=\) @@\ + if exist Makefile $(MAKE) all @@\ + if not exist Makefile $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)" @@\ +-<< ++ + #endif + + #ifndef UseInstalled +@@ -279,7 +279,7 @@ + <$@ @@\ + XCOMM define $(XFAKEVAR)COMM XCOMM @@\ + XCOMM include @@\ +-<< @@\ ++ @@\ + defs @@\ +-<< @@\ ++ @@\ + @@\ + clean:: @@\ + RemoveFiles(dst) +@@ -421,7 +421,7 @@ + + #define MakeDLL(libname,solist) $(LD) @<< @@\ + $(SHLIBLDFLAGS) -out:libname.dll libname.exp solist @@\ +-<< ++ + + #define SharedLibraryTarget(libname,rev,solist,down,up) @@\ + AllTarget(libname.dll) @@\ +@@ -449,7 +449,7 @@ + #define ObjectCplusplusCompile(options) RemoveFile($@) @@\ + $(CXX) -c $*.CCsuf @<< @@\ + $(CFLAGS) options @@\ +-<< ++ + + #define CplusplusLinkRule LinkRule + diff --git a/recipes/xorg-cf-files/all/test_package/Imakefile b/recipes/xorg-cf-files/all/test_package/Imakefile new file mode 100644 index 0000000000000..a4a7f50021773 --- /dev/null +++ b/recipes/xorg-cf-files/all/test_package/Imakefile @@ -0,0 +1,4 @@ +PROGRAMS = ProgramTargetName(test_package) +AllTarget($(PROGRAMS)) + +NormalProgramTarget(test_package,test_package.o,,,) diff --git a/recipes/xorg-cf-files/all/test_package/conanfile.py b/recipes/xorg-cf-files/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a1d91cfb0034d --- /dev/null +++ b/recipes/xorg-cf-files/all/test_package/conanfile.py @@ -0,0 +1,51 @@ +import os + +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.files import copy +from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import is_msvc +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "Imakefile", "test_package.c" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + self.tool_requires("imake/1.0.8") + if not self.conf_info.get("tools.gnu:make_program", check_type=str): + self.tool_requires("make/4.3") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self) + + def generate(self): + tc = AutotoolsToolchain(self) + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + tc.generate() + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + def build(self): + for src in self.exports_sources: + copy(self, src, self.source_folder, self.build_folder) + + config_path = self.conf.get("user.xorg-cf-files:config-path") + self.run(f"imake -DUseInstalled -I{config_path}", env="conanbuild") + autotools = Autotools(self) + autotools.make(target="test_package") + + def test(self): + if can_run(self): + self.run(os.path.join(".", "test_package"), env="conanrun") diff --git a/recipes/xorg-cf-files/all/test_package/test_package.c b/recipes/xorg-cf-files/all/test_package/test_package.c new file mode 100644 index 0000000000000..c5e7cd00f008f --- /dev/null +++ b/recipes/xorg-cf-files/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("hello world!\n"); + return 0; +} diff --git a/recipes/xorg-cf-files/all/test_v1_package/Imakefile b/recipes/xorg-cf-files/all/test_v1_package/Imakefile new file mode 100644 index 0000000000000..a4a7f50021773 --- /dev/null +++ b/recipes/xorg-cf-files/all/test_v1_package/Imakefile @@ -0,0 +1,4 @@ +PROGRAMS = ProgramTargetName(test_package) +AllTarget($(PROGRAMS)) + +NormalProgramTarget(test_package,test_package.o,,,) diff --git a/recipes/xorg-cf-files/all/test_v1_package/conanfile.py b/recipes/xorg-cf-files/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..843ab72802179 --- /dev/null +++ b/recipes/xorg-cf-files/all/test_v1_package/conanfile.py @@ -0,0 +1,45 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import contextlib +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "Imakefile", "test_package.c" + + def build_requirements(self): + self.build_requires("imake/1.0.8") + if not tools.get_env("CONAN_MAKE_PROGRAM"): + self.build_requires("make/4.3") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @contextlib.contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self): + env = { + "CC": "cl -nologo", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), os.path.join(self.build_folder, src)) + if not tools.cross_building(self): + with self._build_context(): + self.run("imake -DUseInstalled -I{}".format(self.deps_user_info["xorg-cf-files"].CONFIG_PATH), run_environment=True) + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self) + with tools.environment_append(autotools.vars): + autotools.make(target="test_package") + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/xorg-cf-files/all/test_v1_package/test_package.c b/recipes/xorg-cf-files/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..c5e7cd00f008f --- /dev/null +++ b/recipes/xorg-cf-files/all/test_v1_package/test_package.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("hello world!\n"); + return 0; +} diff --git a/recipes/xorg-cf-files/config.yml b/recipes/xorg-cf-files/config.yml new file mode 100644 index 0000000000000..377623d3a93f7 --- /dev/null +++ b/recipes/xorg-cf-files/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.7": + folder: all diff --git a/recipes/xorg-gccmakedep/all/conandata.yml b/recipes/xorg-gccmakedep/all/conandata.yml new file mode 100644 index 0000000000000..4a262e970c51a --- /dev/null +++ b/recipes/xorg-gccmakedep/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.3": + url: "https://www.x.org/pub/individual/util/gccmakedep-1.0.3.tar.bz2" + sha256: "b275dcf1f7323ed89e8b36f8fbd5da665d8700005f1779fa5b90a1688bbf2ee4" diff --git a/recipes/xorg-gccmakedep/all/conanfile.py b/recipes/xorg-gccmakedep/all/conanfile.py new file mode 100644 index 0000000000000..813811cb7758d --- /dev/null +++ b/recipes/xorg-gccmakedep/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, save, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +import os +import re + +required_conan_version = ">=1.53.0" + + +class XorgGccmakedep(ConanFile): + name = "xorg-gccmakedep" + description = "script to create dependencies in makefiles using 'gcc -M'" + topics = ("xorg", "gcc", "dependency", "obsolete") + license = "MIT" + homepage = "https://gitlab.freedesktop.org/xorg/util/gccmakedep" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + self.requires("xorg-macros/1.19.3") + + def build_requirements(self): + self.tool_requires("pkgconf/1.7.4") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported by xorg-gccmakedep") + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def package_id(self): + del self.info.settings.compiler + + 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 generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + conf_ac_text = load(self, os.path.join(self.source_folder, "configure.ac")) + topblock = re.match("((?:dnl[^\n]*\n)+)", conf_ac_text, flags=re.MULTILINE).group(1) + license_text = re.subn(r"^dnl(|\s+([^\n]*))", r"\1", topblock, flags=re.MULTILINE)[0] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_text) + + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + 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/xorg-gccmakedep/all/test_package/Makefile b/recipes/xorg-gccmakedep/all/test_package/Makefile new file mode 100644 index 0000000000000..b129780b6cb50 --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_package/Makefile @@ -0,0 +1,2 @@ +test_package: + $(CC) test_package.c -o test_package diff --git a/recipes/xorg-gccmakedep/all/test_package/conanfile.py b/recipes/xorg-gccmakedep/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d86fb3898f201 --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.files import copy, load +from conan.tools.layout import basic_layout +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "Makefile", "test_package.c", "test_package.h" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def build(self): + for src in self.exports_sources: + copy(self, src, self.source_folder, self.build_folder) + + src = os.path.join(self.build_folder, "test_package.c") + self.run(f"gccmakedep {src}", env="conanbuild") + + if load(self, os.path.join(self.source_folder, "Makefile")) == os.path.join(self.build_folder, "Makefile"): + raise ConanException("xorg-gccmakedep did not modify `Makefile'") + + def test(self): + pass diff --git a/recipes/xorg-gccmakedep/all/test_package/test_package.c b/recipes/xorg-gccmakedep/all/test_package/test_package.c new file mode 100644 index 0000000000000..d58f0ed2d240b --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "test_package.h" + +#include + +int main() { + printf(TEXT); + return EXIT_SUCCESS; +} diff --git a/recipes/xorg-gccmakedep/all/test_package/test_package.h b/recipes/xorg-gccmakedep/all/test_package/test_package.h new file mode 100644 index 0000000000000..32e2088cba479 --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_package/test_package.h @@ -0,0 +1,8 @@ +#ifndef TEST_PACKAGE_H +#define TEST_PACKAGE_H + +#include + +#define TEXT "hello world\n" + +#endif // TEST_PACKAGE_H diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/Makefile b/recipes/xorg-gccmakedep/all/test_v1_package/Makefile new file mode 100644 index 0000000000000..b129780b6cb50 --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_v1_package/Makefile @@ -0,0 +1,2 @@ +test_package: + $(CC) test_package.c -o test_package diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py b/recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7ac03637058e2 --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "Makefile", "test_package.c", "test_package.h" + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), os.path.join(self.build_folder, src)) + + def test(self): + src = os.path.join(self.source_folder, "test_package.c") + self.run("gccmakedep {}".format(src), run_environment=True) + + if tools.load(os.path.join(self.source_folder, "Makefile")) == os.path.join(self.build_folder, "Makefile"): + raise ConanException("xorg-gccmakedep did not modify `Makefile'") diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/test_package.c b/recipes/xorg-gccmakedep/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..d58f0ed2d240b --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_v1_package/test_package.c @@ -0,0 +1,8 @@ +#include "test_package.h" + +#include + +int main() { + printf(TEXT); + return EXIT_SUCCESS; +} diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/test_package.h b/recipes/xorg-gccmakedep/all/test_v1_package/test_package.h new file mode 100644 index 0000000000000..32e2088cba479 --- /dev/null +++ b/recipes/xorg-gccmakedep/all/test_v1_package/test_package.h @@ -0,0 +1,8 @@ +#ifndef TEST_PACKAGE_H +#define TEST_PACKAGE_H + +#include + +#define TEXT "hello world\n" + +#endif // TEST_PACKAGE_H diff --git a/recipes/xorg-gccmakedep/config.yml b/recipes/xorg-gccmakedep/config.yml new file mode 100644 index 0000000000000..372dd1cb646bd --- /dev/null +++ b/recipes/xorg-gccmakedep/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.3": + folder: all diff --git a/recipes/xorg-macros/all/conandata.yml b/recipes/xorg-macros/all/conandata.yml new file mode 100644 index 0000000000000..69af08fff0a8f --- /dev/null +++ b/recipes/xorg-macros/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.19.3": + url: "https://www.x.org/releases/individual/util/util-macros-1.19.3.tar.gz" + sha256: "624bb6c3a4613d18114a7e3849a3d70f2d7af9dc6eabeaba98060d87e3aef35b" +patches: + "1.19.3": + - patch_file: "patches/0001-export-XORG_MACROS_VERSION-macro.patch" diff --git a/recipes/xorg-macros/all/conanfile.py b/recipes/xorg-macros/all/conanfile.py new file mode 100644 index 0000000000000..6fe36bf8322c5 --- /dev/null +++ b/recipes/xorg-macros/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path_package_info_legacy +import os +import textwrap + +required_conan_version = ">=1.57" + + +class XorgMacrosConan(ConanFile): + name = "xorg-macros" + description = "GNU autoconf macros shared across X.Org projects" + topics = ("autoconf", "macros", "build", "system", "m4") + license = "MIT" + homepage = "https://gitlab.freedesktop.org/xorg/util/macros" + url = "https://github.com/conan-io/conan-center-index" + settings = "os" + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _settings_build(self): + return self.settings_build if hasattr(self, "settings_build") else self.settings + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build_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") + self.tool_requires("automake/1.16.5") + + def package_id(self): + self.info.clear() + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "bin", "share") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend( + ["--datarootdir=${prefix}/bin/share"] + ) + tc.generate() + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + def build(self): + apply_conandata_patches(self) + + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + rmdir(self, os.path.join(self._datarootdir, "pkgconfig")) + rmdir(self, os.path.join(self._datarootdir, "util-macros")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "xorg-macros" + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.set_property("pkg_config_custom_content", textwrap.dedent("""\ + datarootdir={datarootdir} + datadir=${{datarootdir}} + PACKAGE={name} + pkgdatadir=${{datadir}}/${{PACKAGE}} + docdir=${{pkgdatadir}} + """).format( + datarootdir=self._datarootdir, + name="util-macros", + )) + + aclocal = os.path.join(self._datarootdir, "aclocal") + self.buildenv_info.append_path("ACLOCAL_PATH", aclocal) + + # TODO: remove once recipe only supports Conan >= 2.0 only + self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(aclocal)) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, aclocal )) diff --git a/recipes/xorg-macros/all/patches/0001-export-XORG_MACROS_VERSION-macro.patch b/recipes/xorg-macros/all/patches/0001-export-XORG_MACROS_VERSION-macro.patch new file mode 100644 index 0000000000000..1e900089693f2 --- /dev/null +++ b/recipes/xorg-macros/all/patches/0001-export-XORG_MACROS_VERSION-macro.patch @@ -0,0 +1,12 @@ +--- xorg-macros.m4.in ++++ xorg-macros.m4.in +@@ -36,7 +36,7 @@ + # + # See the "minimum version" comment for each macro you use to see what + # version you require. +-m4_defun([XORG_MACROS_VERSION],[ ++AC_DEFUN([XORG_MACROS_VERSION],[ + m4_define([vers_have], [@VERSION@]) + m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) + m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) + diff --git a/recipes/xorg-macros/all/test_package/Makefile.am b/recipes/xorg-macros/all/test_package/Makefile.am new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/recipes/xorg-macros/all/test_package/conanfile.py b/recipes/xorg-macros/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0c8e15396bb6e --- /dev/null +++ b/recipes/xorg-macros/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +from conan import ConanFile +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return self.settings_build if hasattr(self, "settings_build") else self.settings + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + self.build_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") + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + # Only make sure the project configures correctly, as these are build scripts + autotools = Autotools(self) + autotools.autoreconf(args=["--debug"]) + autotools.configure() + + def test(self): + # FIXME: how to test extra pkg_config content? + pass diff --git a/recipes/xorg-macros/all/test_package/configure.ac b/recipes/xorg-macros/all/test_package/configure.ac new file mode 100644 index 0000000000000..3bb86acef57c9 --- /dev/null +++ b/recipes/xorg-macros/all/test_package/configure.ac @@ -0,0 +1,14 @@ +AC_PREREQ([2.69]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([configure.ac]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +m4_ifndef([XORG_MACROS_VERSION],[ + m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])],[ + AC_MSG_NOTICE([xorg-macros version ok])]) + +XORG_MACROS_VERSION([1.1]) + +AC_CONFIG_FILES(Makefile) +AC_OUTPUT diff --git a/recipes/xorg-macros/all/test_package/src/Makefile.am b/recipes/xorg-macros/all/test_package/src/Makefile.am new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/recipes/xorg-macros/all/test_package/src/configure.ac b/recipes/xorg-macros/all/test_package/src/configure.ac new file mode 100644 index 0000000000000..3bb86acef57c9 --- /dev/null +++ b/recipes/xorg-macros/all/test_package/src/configure.ac @@ -0,0 +1,14 @@ +AC_PREREQ([2.69]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([configure.ac]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +m4_ifndef([XORG_MACROS_VERSION],[ + m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])],[ + AC_MSG_NOTICE([xorg-macros version ok])]) + +XORG_MACROS_VERSION([1.1]) + +AC_CONFIG_FILES(Makefile) +AC_OUTPUT diff --git a/recipes/xorg-macros/all/test_v1_package/Makefile.am b/recipes/xorg-macros/all/test_v1_package/Makefile.am new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/recipes/xorg-macros/all/test_v1_package/conanfile.py b/recipes/xorg-macros/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..81b7391be15ba --- /dev/null +++ b/recipes/xorg-macros/all/test_v1_package/conanfile.py @@ -0,0 +1,32 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + exports_sources = "configure.ac", "Makefile.am", + generators = "pkg_config" + test_type = "explicit" + + @property + def _settings_build(self): + return self.settings_build if hasattr(self, "settings_build") else self.settings + + 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): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + print(tools.get_env("AUTOMAKE_CONAN_INCLUDES")) + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=self._settings_build.os == "Windows", run_environment=True) + autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") + autotools.configure() + + def test(self): + # FIXME: how to test extra pkg_config content? + pass diff --git a/recipes/xorg-macros/all/test_v1_package/configure.ac b/recipes/xorg-macros/all/test_v1_package/configure.ac new file mode 100644 index 0000000000000..3bb86acef57c9 --- /dev/null +++ b/recipes/xorg-macros/all/test_v1_package/configure.ac @@ -0,0 +1,14 @@ +AC_PREREQ([2.69]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([configure.ac]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +m4_ifndef([XORG_MACROS_VERSION],[ + m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])],[ + AC_MSG_NOTICE([xorg-macros version ok])]) + +XORG_MACROS_VERSION([1.1]) + +AC_CONFIG_FILES(Makefile) +AC_OUTPUT diff --git a/recipes/xorg-macros/config.yml b/recipes/xorg-macros/config.yml new file mode 100644 index 0000000000000..4d76ebbbccd62 --- /dev/null +++ b/recipes/xorg-macros/config.yml @@ -0,0 +1,3 @@ +versions: + "1.19.3": + folder: "all" diff --git a/recipes/xorg-makedepend/all/conandata.yml b/recipes/xorg-makedepend/all/conandata.yml new file mode 100644 index 0000000000000..17712580498cb --- /dev/null +++ b/recipes/xorg-makedepend/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.6": + url: "https://www.x.org/archive/individual/util/makedepend-1.0.6.tar.gz" + sha256: "845f6708fc850bf53f5b1d0fb4352c4feab3949f140b26f71b22faba354c3365" diff --git a/recipes/xorg-makedepend/all/conanfile.py b/recipes/xorg-makedepend/all/conanfile.py new file mode 100644 index 0000000000000..6656dcd889cff --- /dev/null +++ b/recipes/xorg-makedepend/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +import os +import re + +required_conan_version = ">=1.53.0" + + +class XorgMakedepend(ConanFile): + name = "xorg-makedepend" + description = "Utility to parse C source files to make dependency lists for Makefiles" + topics = ("xorg", "dependency", "obsolete") + license = "MIT" + homepage = "https://gitlab.freedesktop.org/xorg/util/makedepend" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + self.requires("xorg-macros/1.19.3") + self.requires("xorg-proto/2022.2") + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported by xorg-makedepend") + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def package_id(self): + del self.info.settings.compiler + + 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) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + def_h_text = load(self, os.path.join(self.source_folder, "def.h")) + license_text = next(re.finditer(r"/\*([^*]+)\*/", def_h_text)).group(1) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_text) + + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + 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/xorg-makedepend/all/test_package/conanfile.py b/recipes/xorg-makedepend/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4fb3d595e8d53 --- /dev/null +++ b/recipes/xorg-makedepend/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +import os + +from conan import ConanFile +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def build(self): + src = os.path.join(self.source_folder, "test_package.c") + self.run(f"makedepend -f- -- -- {src}") + + def test(self): + pass diff --git a/recipes/xorg-makedepend/all/test_package/test_package.c b/recipes/xorg-makedepend/all/test_package/test_package.c new file mode 100644 index 0000000000000..d58f0ed2d240b --- /dev/null +++ b/recipes/xorg-makedepend/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "test_package.h" + +#include + +int main() { + printf(TEXT); + return EXIT_SUCCESS; +} diff --git a/recipes/xorg-makedepend/all/test_package/test_package.h b/recipes/xorg-makedepend/all/test_package/test_package.h new file mode 100644 index 0000000000000..32e2088cba479 --- /dev/null +++ b/recipes/xorg-makedepend/all/test_package/test_package.h @@ -0,0 +1,8 @@ +#ifndef TEST_PACKAGE_H +#define TEST_PACKAGE_H + +#include + +#define TEXT "hello world\n" + +#endif // TEST_PACKAGE_H diff --git a/recipes/xorg-makedepend/all/test_v1_package/conanfile.py b/recipes/xorg-makedepend/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b34e1e6e6345d --- /dev/null +++ b/recipes/xorg-makedepend/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.36.0" + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + src = os.path.join(self.source_folder, "test_package.c") + self.run("makedepend -f- -- -- {}".format(src), run_environment=True) diff --git a/recipes/xorg-makedepend/all/test_v1_package/test_package.c b/recipes/xorg-makedepend/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..d58f0ed2d240b --- /dev/null +++ b/recipes/xorg-makedepend/all/test_v1_package/test_package.c @@ -0,0 +1,8 @@ +#include "test_package.h" + +#include + +int main() { + printf(TEXT); + return EXIT_SUCCESS; +} diff --git a/recipes/xorg-makedepend/all/test_v1_package/test_package.h b/recipes/xorg-makedepend/all/test_v1_package/test_package.h new file mode 100644 index 0000000000000..32e2088cba479 --- /dev/null +++ b/recipes/xorg-makedepend/all/test_v1_package/test_package.h @@ -0,0 +1,8 @@ +#ifndef TEST_PACKAGE_H +#define TEST_PACKAGE_H + +#include + +#define TEXT "hello world\n" + +#endif // TEST_PACKAGE_H diff --git a/recipes/xorg-makedepend/config.yml b/recipes/xorg-makedepend/config.yml new file mode 100644 index 0000000000000..c8c4465c97415 --- /dev/null +++ b/recipes/xorg-makedepend/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.6": + folder: all diff --git a/recipes/xorg-proto/all/conandata.yml b/recipes/xorg-proto/all/conandata.yml new file mode 100644 index 0000000000000..a78c2d2c2da43 --- /dev/null +++ b/recipes/xorg-proto/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2022.2": + url: "https://www.x.org/releases/individual/proto/xorgproto-2022.2.tar.gz" + sha256: "da351a403d07a7006d7bdc8dcfc14ddc1b588b38fb81adab9989a8eef605757b" + "2021.4": + url: "https://www.x.org/releases/individual/proto/xorgproto-2021.4.tar.gz" + sha256: "9de0babd3d8cb16b0c1c47b8389a52f3e1326bb0bc9a9ab34a9500778448a2bd" diff --git a/recipes/xorg-proto/all/conanfile.py b/recipes/xorg-proto/all/conanfile.py new file mode 100644 index 0000000000000..b53e7215a2338 --- /dev/null +++ b/recipes/xorg-proto/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.tools.files import rmdir, mkdir, save, load, get, apply_conandata_patches, export_conandata_patches, copy +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +import glob +import os +import re +import yaml + +required_conan_version = ">=1.54.0" + + +class XorgProtoConan(ConanFile): + name = "xorg-proto" + package_type = "header-library" + description = "This package provides the headers and specification documents defining " \ + "the core protocol and (many) extensions for the X Window System." + topics = ("specification", "x-window") + license = "X11" + homepage = "https://gitlab.freedesktop.org/xorg/proto/xorgproto" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps" + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.tool_requires("automake/1.16.5") + self.tool_requires("xorg-macros/1.19.3") + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def requirements(self): + if hasattr(self, "settings_build"): + self.requires("xorg-macros/1.19.3") + + def package_id(self): + # self.info.clear() would be fine too, but keep the os to add c3i test coverage for Windows. + del self.info.settings.arch + del self.info.settings.build_type + del self.info.settings.compiler + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper")) + env.define("CC", f"{compile_wrapper} cl -nologo") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _pc_data_path(self): + return os.path.join(self.package_folder, "res", "pc_data.yml") + + def package(self): + copy(self, "COPYING-*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + pc_data = {} + for fn in glob.glob(os.path.join(self.package_folder, "share", "pkgconfig", "*.pc")): + pc_text = load(self, fn) + filename = os.path.basename(fn)[:-3] + name = next(re.finditer("^Name: ([^\n$]+)[$\n]", pc_text, flags=re.MULTILINE)).group(1) + version = next(re.finditer("^Version: ([^\n$]+)[$\n]", pc_text, flags=re.MULTILINE)).group(1) + pc_data[filename] = { + "version": version, + "name": name, + } + mkdir(self, os.path.dirname(self._pc_data_path)) + save(self, self._pc_data_path, yaml.dump(pc_data)) + + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + for filename, name_version in yaml.safe_load(open(self._pc_data_path)).items(): + self.cpp_info.components[filename].filenames["pkg_config"] = filename + self.cpp_info.components[filename].libdirs = [] + if hasattr(self, "settings_build"): + self.cpp_info.components[filename].requires = ["xorg-macros::xorg-macros"] + self.cpp_info.components[filename].version = name_version["version"] + self.cpp_info.components[filename].set_property("pkg_config_name", filename) + + self.cpp_info.components["xproto"].includedirs.append(os.path.join("include", "X11")) diff --git a/recipes/xorg-proto/all/test_package/conanfile.py b/recipes/xorg-proto/all/test_package/conanfile.py new file mode 100644 index 0000000000000..60a4e553bae92 --- /dev/null +++ b/recipes/xorg-proto/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self, src_folder="src") + + 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/xorg-proto/all/test_package/src/CMakeLists.txt b/recipes/xorg-proto/all/test_package/src/CMakeLists.txt new file mode 100644 index 0000000000000..9f690fb1f0fe5 --- /dev/null +++ b/recipes/xorg-proto/all/test_package/src/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(xorg-proto REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xorg-proto::xorg-proto) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/xorg-proto/all/test_package/src/test_package.c b/recipes/xorg-proto/all/test_package/src/test_package.c new file mode 100644 index 0000000000000..5ef02683be08b --- /dev/null +++ b/recipes/xorg-proto/all/test_package/src/test_package.c @@ -0,0 +1,7 @@ +#include "X11/keysym.h" +#include + +int main() { + printf("XK_VoidSymbol: 0x%x\n", XK_VoidSymbol); + return 0; +} diff --git a/recipes/xorg-proto/all/test_v1_package/CMakeLists.txt b/recipes/xorg-proto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..39b78234180b2 --- /dev/null +++ b/recipes/xorg-proto/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/src/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/xorg-proto/all/test_v1_package/conanfile.py b/recipes/xorg-proto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..74a00ca1ef212 --- /dev/null +++ b/recipes/xorg-proto/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xorg-proto/config.yml b/recipes/xorg-proto/config.yml new file mode 100644 index 0000000000000..2928e57dc1b28 --- /dev/null +++ b/recipes/xorg-proto/config.yml @@ -0,0 +1,5 @@ +versions: + "2022.2": + folder: "all" + "2021.4": + folder: "all" diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py new file mode 100644 index 0000000000000..b8a810681f531 --- /dev/null +++ b/recipes/xorg/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" + + +class XorgConan(ConanFile): + name = "xorg" + package_type = "shared-library" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://www.x.org/wiki/" + description = "The X.Org project provides an open source implementation of the X Window System." + settings = "os", "arch", "compiler", "build_type" + topics = ("x11", "xorg") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def package_id(self): + self.info.clear() + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["libx11-dev", "libx11-xcb-dev", "libfontenc-dev", "libice-dev", "libsm-dev", "libxau-dev", "libxaw7-dev", + "libxcomposite-dev", "libxcursor-dev", "libxdamage-dev", "libxdmcp-dev", "libxext-dev", "libxfixes-dev", + "libxi-dev", "libxinerama-dev", "libxkbfile-dev", "libxmu-dev", "libxmuu-dev", + "libxpm-dev", "libxrandr-dev", "libxrender-dev", "libxres-dev", "libxss-dev", "libxt-dev", "libxtst-dev", + "libxv-dev", "libxvmc-dev", "libxxf86vm-dev", "libxcb-render0-dev", + "libxcb-render-util0-dev", "libxcb-xkb-dev", "libxcb-icccm4-dev", "libxcb-image0-dev", + "libxcb-keysyms1-dev", "libxcb-randr0-dev", "libxcb-shape0-dev", "libxcb-sync-dev", "libxcb-xfixes0-dev", + "libxcb-xinerama0-dev", "libxcb-dri3-dev", "uuid-dev", "libxcb-cursor-dev"], update=True, check=True) + apt.install_substitutes( + ["libxcb-util-dev"], ["libxcb-util0-dev"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", + "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", + "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", + "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", + "xcb-util-devel", "libuuid-devel", "xcb-util-cursor-devel"], update=True, check=True) + + dnf = package_manager.Dnf(self) + dnf.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", + "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", + "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", + "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", + "xcb-util-devel", "libuuid-devel", "xcb-util-cursor-devel"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", + "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXss-devel", "libXvMC-devel", + "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", + "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", + "xcb-util-devel", "libuuid-devel", "xcb-util-cursor-devel"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libxcb", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", + "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", + "libxss", "libxvmc", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", + "libxxf86vm", "libxv", "xcb-util", "util-linux-libs", "xcb-util-cursor"], update=True, check=True) + + package_manager.Pkg(self).install(["libX11", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", + "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", + "libXScrnSaver", "libxvmc", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", + "libxxf86vm", "libxv", "xkeyboard-config", "xcb-util", "xcb-util-cursor"], update=True, check=True) + + def package_info(self): + for name in ["x11", "x11-xcb", "fontenc", "ice", "sm", "xau", "xaw7", + "xcomposite", "xcursor", "xdamage", "xdmcp", "xext", "xfixes", "xi", + "xinerama", "xkbfile", "xmu", "xmuu", "xpm", "xrandr", "xrender", "xres", + "xscrnsaver", "xt", "xtst", "xv", "xvmc", "xxf86vm", + "xcb-xkb", "xcb-icccm", "xcb-image", "xcb-keysyms", "xcb-randr", "xcb-render", + "xcb-renderutil", "xcb-shape", "xcb-shm", "xcb-sync", "xcb-xfixes", + "xcb-xinerama", "xcb", "xcb-atom", "xcb-aux", "xcb-event", "xcb-util", + "xcb-dri3", "xcb-cursor"] + ([] if self.settings.os == "FreeBSD" else ["uuid"]): + pkg_config = PkgConfig(self, name) + pkg_config.fill_cpp_info( + self.cpp_info.components[name], is_system=self.settings.os != "FreeBSD") + self.cpp_info.components[name].version = pkg_config.version + self.cpp_info.components[name].set_property( + "pkg_config_name", name) + self.cpp_info.components[name].set_property( + "component_version", pkg_config.version) + self.cpp_info.components[name].set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) + + if self.settings.os == "Linux": + self.cpp_info.components["sm"].requires.append("uuid") diff --git a/recipes/xorg/all/test_package/CMakeLists.txt b/recipes/xorg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..36e3820bcc3ab --- /dev/null +++ b/recipes/xorg/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(xorg REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE xorg::xorg) diff --git a/recipes/xorg/all/test_package/conanfile.py b/recipes/xorg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f414ecd075ee7 --- /dev/null +++ b/recipes/xorg/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +import os + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.gnu import PkgConfigDeps + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config") + uuid_pkg_config_file = os.path.join(self.generators_folder, "uuid.pc") + self.run(f"{pkg_config} --validate {uuid_pkg_config_file}") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/xorg/all/test_package/test_package.c b/recipes/xorg/all/test_package/test_package.c new file mode 100644 index 0000000000000..ad93e6cafcce3 --- /dev/null +++ b/recipes/xorg/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +#include + +#include + +#include + +int main() { + Display *display = XOpenDisplay(NULL); + + if (!display) { + printf("XOpenDisplay failed\n"); + return 0; + } + + { + char *xau_file_name = XauFileName(); + if (xau_file_name) + printf("XauFileName: %s\n", xau_file_name); + } + + XCloseDisplay(display); + SmcSetErrorHandler(NULL); +} diff --git a/recipes/xorg/all/test_v1_package/CMakeLists.txt b/recipes/xorg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6abf262eddbd --- /dev/null +++ b/recipes/xorg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xorg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xorg::xorg) diff --git a/recipes/xorg/all/test_v1_package/conanfile.py b/recipes/xorg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ce69ba8b754ca --- /dev/null +++ b/recipes/xorg/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi", "pkg_config" + + def build(self): + self.run("pkg-config --validate ./uuid.pc") + 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/xorg/config.yml b/recipes/xorg/config.yml new file mode 100644 index 0000000000000..76a338dd54cee --- /dev/null +++ b/recipes/xorg/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "all" diff --git a/recipes/xorstr/all/conandata.yml b/recipes/xorstr/all/conandata.yml new file mode 100644 index 0000000000000..d25c84f64a09c --- /dev/null +++ b/recipes/xorstr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210417": + url: "https://github.com/JustasMasiulis/xorstr/archive/8ab293225374e16cbae9a54b6a1bed3ee0bf9681.tar.gz" + sha256: "b52220a50c33f8b13e6aaa2fcd14f31a44d96ba721b014ab921c30b5e3cb61eb" diff --git a/recipes/xorstr/all/conanfile.py b/recipes/xorstr/all/conanfile.py new file mode 100644 index 0000000000000..2712a05ac7044 --- /dev/null +++ b/recipes/xorstr/all/conanfile.py @@ -0,0 +1,70 @@ +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 +import os + +required_conan_version = ">=1.50.0" + + +class XorstrConan(ConanFile): + name = "xorstr" + description = "A heavily vectorized c++17 compile time string encryption." + license = "Apache-2.0" + topics = ("encryption", "string", "vectorized") + homepage = "https://github.com/JustasMasiulis/xorstr" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + 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 + + 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/xorstr/all/test_package/CMakeLists.txt b/recipes/xorstr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b2faa1d5c02ce --- /dev/null +++ b/recipes/xorstr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(xorstr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xorstr::xorstr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/xorstr/all/test_package/conanfile.py b/recipes/xorstr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xorstr/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/xorstr/all/test_package/test_package.cpp b/recipes/xorstr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f37690b855356 --- /dev/null +++ b/recipes/xorstr/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#define JM_XORSTR_DISABLE_AVX_INTRINSICS +#include + +#include + +int main() { + std::puts(xorstr_("an extra long hello_world")); + return 0; +} diff --git a/recipes/xorstr/all/test_v1_package/CMakeLists.txt b/recipes/xorstr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xorstr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xorstr/all/test_v1_package/conanfile.py b/recipes/xorstr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xorstr/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/xorstr/config.yml b/recipes/xorstr/config.yml new file mode 100644 index 0000000000000..c91428932c33a --- /dev/null +++ b/recipes/xorstr/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210417": + folder: all diff --git a/recipes/xoshiro-cpp/all/conandata.yml b/recipes/xoshiro-cpp/all/conandata.yml new file mode 100644 index 0000000000000..ee50cfa5cce51 --- /dev/null +++ b/recipes/xoshiro-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + sha256: 9e1fff51faa8754b5c61ab00f41339df0b9b1c09a13611e3357aab76c65f2ba0 + url: https://github.com/Reputeless/Xoshiro-cpp/archive/refs/tags/v1.1.tar.gz diff --git a/recipes/xoshiro-cpp/all/conanfile.py b/recipes/xoshiro-cpp/all/conanfile.py new file mode 100644 index 0000000000000..c922c9e422fe2 --- /dev/null +++ b/recipes/xoshiro-cpp/all/conanfile.py @@ -0,0 +1,74 @@ +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.scm import Version + +required_conan_version = ">=1.53.0" + + +class XoshiroCppConan(ConanFile): + name = "xoshiro-cpp" + description = "Header-only Xoshiro/Xoroshiro PRNG wrapper library for modern C++ (C++17/C++20)" + license = "MIT" + homepage = "https://github.com/Reputeless/Xoshiro-cpp" + url = "https://github.com/conan-io/conan-center-index" + topics = ("prng", "xoshiro", "header-only") + package_type = "header-library" + settings = "arch", "build_type", "compiler", "os" + + @property + def _minimum_compilers_version(self): + return { + "apple-clang": "10", + "clang": "6", + "gcc": "7", + "Visual Studio": "16" + } + + @property + def _minimum_cpp_standard(self): + return 17 + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + compiler = str(self.settings.compiler) + version = Version(self.settings.compiler.version) + try: + min_version = self._minimum_compilers_version[compiler] + if version < min_version: + msg = ( + f"{self.name} requires C++{self._minimum_cpp_standard} features " + f"which are not supported by compiler {compiler} {version}." + ) + raise ConanInvalidConfiguration(msg) + except KeyError: + msg = ( + f"{self.ref} recipe lacks information about the {compiler} compiler, " + f"support for the required C++{self._minimum_cpp_standard} features is assumed" + ) + self.output.warn(msg) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "*.hpp", src=self.source_folder, + dst=os.path.join(self.package_folder, "include/xoshiro-cpp/")) + copy(self, "LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xoshiro-cpp") + self.cpp_info.set_property( + "cmake_target_name", "xoshiro-cpp::xoshiro-cpp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt b/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b5f12d50e4ab --- /dev/null +++ b/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) + +find_package(xoshiro-cpp REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xoshiro-cpp::xoshiro-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) diff --git a/recipes/xoshiro-cpp/all/test_package/conanfile.py b/recipes/xoshiro-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7e910b5e71329 --- /dev/null +++ b/recipes/xoshiro-cpp/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 XoshiroCppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + 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/xoshiro-cpp/all/test_package/test_package.cpp b/recipes/xoshiro-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8f79573486489 --- /dev/null +++ b/recipes/xoshiro-cpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include "xoshiro-cpp/XoshiroCpp.hpp" + +template static void assert_and_print(N expected, N got) { + std::cout << expected << " == " << got << '\n'; + assert(expected == got); +} + +int main() { + std::cout << "# Initialize with a default 64-bit seed\n"; + XoshiroCpp::Xoshiro256PlusPlus rng; + for (uint64_t expected : {10656210946825422025ULL, 3029598875750717312ULL, + 8253387787243700537ULL}) { + assert_and_print(expected, rng()); + } +} diff --git a/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt b/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6044711e33fae --- /dev/null +++ b/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +set(CMAKE_CXX_STANDARD 17) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xoshiro-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xoshiro-cpp::xoshiro-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) diff --git a/recipes/xoshiro-cpp/all/test_v1_package/conanfile.py b/recipes/xoshiro-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2fc6ad2a6a2ba --- /dev/null +++ b/recipes/xoshiro-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import CMake, ConanFile, 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("{0}".format(bin_path), run_environment=True) diff --git a/recipes/xoshiro-cpp/config.yml b/recipes/xoshiro-cpp/config.yml new file mode 100644 index 0000000000000..3f8a45fae5832 --- /dev/null +++ b/recipes/xoshiro-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1": + folder: all diff --git a/recipes/xpack/all/conandata.yml b/recipes/xpack/all/conandata.yml new file mode 100644 index 0000000000000..86baf40457468 --- /dev/null +++ b/recipes/xpack/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "1.0.4": + url: "https://github.com/xyz347/xpack/archive/v1.0.4.tar.gz" + sha256: "ccea6d986052a9ad8ad859ad42283fc01fed29009133017b231a06ec0b1976b9" + "1.0.3": + url: "https://github.com/xyz347/xpack/archive/v1.0.3.tar.gz" + sha256: "dcda8da82a82b30bb2100233e45750de3f29b6be00681c38cb102406f6fe399a" + "1.0.2": + url: "https://github.com/xyz347/xpack/archive/v1.0.2.tar.gz" + sha256: "50cf82e123ef0a0aeb8d39e21f5f067c259f17bd917493ed8d7b39cd33c80f07" +patches: + "1.0.4": + - patch_file: "patches/1.0.2-0001-use-cci.patch" + patch_description: "use cci packages" + patch_type: "conan" + "1.0.3": + - patch_file: "patches/1.0.2-0001-use-cci.patch" + patch_description: "use cci packages" + patch_type: "conan" + "1.0.2": + - patch_file: "patches/1.0.2-0001-use-cci.patch" + patch_description: "use cci packages" + patch_type: "conan" diff --git a/recipes/xpack/all/conanfile.py b/recipes/xpack/all/conanfile.py new file mode 100644 index 0000000000000..87dad9562235b --- /dev/null +++ b/recipes/xpack/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +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 +import os + +required_conan_version = ">=1.52.0" + +class XpackConan(ConanFile): + name = "xpack" + description = "C++ reflection, ability to convert between C++ structures and json/xml." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xyz347/xpack" + topics = ("json", "bson", "reflection", "xml", "header-only") + 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 requirements(self): + self.requires("rapidjson/cci.20220822", transitive_headers=True) + self.requires("rapidxml/1.13", transitive_headers=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) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "xpack"), + src=self.source_folder, + excludes=["example", "gtest", "thirdparty"], + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/xpack/all/patches/1.0.2-0001-use-cci.patch b/recipes/xpack/all/patches/1.0.2-0001-use-cci.patch new file mode 100644 index 0000000000000..74dacc942ce60 --- /dev/null +++ b/recipes/xpack/all/patches/1.0.2-0001-use-cci.patch @@ -0,0 +1,43 @@ +diff --git a/a/json_decoder.h b/b/json_decoder.h +index 6d5e50c..e66fe8c 100755 +--- a/a/json_decoder.h ++++ b/b/json_decoder.h +@@ -20,8 +20,8 @@ + #include + + #include "rapidjson_custom.h" +-#include "thirdparty/rapidjson/document.h" +-#include "thirdparty/rapidjson/error/en.h" ++#include "rapidjson/document.h" ++#include "rapidjson/error/en.h" + + #include "xdecoder.h" + +diff --git a/a/json_encoder.h b/b/json_encoder.h +index 442d9e0..2be9323 100755 +--- a/a/json_encoder.h ++++ b/b/json_encoder.h +@@ -20,8 +20,8 @@ + #include + + #include "rapidjson_custom.h" +-#include "thirdparty/rapidjson/prettywriter.h" +-#include "thirdparty/rapidjson/stringbuffer.h" ++#include "rapidjson/prettywriter.h" ++#include "rapidjson/stringbuffer.h" + + #include "xencoder.h" + +diff --git a/a/xml_decoder.h b/b/xml_decoder.h +index d9cb4bb..91530ba 100755 +--- a/a/xml_decoder.h ++++ b/b/xml_decoder.h +@@ -24,7 +24,7 @@ + #include + #include + +-#include "thirdparty/rapidxml/rapidxml.hpp" ++#include "rapidxml/rapidxml.hpp" + + #include "xdecoder.h" + diff --git a/recipes/xpack/all/test_package/CMakeLists.txt b/recipes/xpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..64e85764dcebb --- /dev/null +++ b/recipes/xpack/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(xpack CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xpack::xpack) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/xpack/all/test_package/conanfile.py b/recipes/xpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/xpack/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/xpack/all/test_package/test_package.cpp b/recipes/xpack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e901b4e6909ca --- /dev/null +++ b/recipes/xpack/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "xpack/json.h" + +using namespace rapidjson; + +int main() { + int number = 1; + std::string xpack_json = xpack::json::encode(number); + std::cout << xpack_json << std::endl; + int number2 = 0; + xpack::json::decode(xpack_json, number2); + std::cout << number2 << std::endl; + return 0; +} diff --git a/recipes/xpack/all/test_v1_package/CMakeLists.txt b/recipes/xpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/xpack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xpack/all/test_v1_package/conanfile.py b/recipes/xpack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/xpack/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xpack/config.yml b/recipes/xpack/config.yml new file mode 100644 index 0000000000000..7ae7c5d038959 --- /dev/null +++ b/recipes/xpack/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.4": + folder: "all" + "1.0.3": + folder: "all" + "1.0.2": + folder: "all" diff --git a/recipes/xproperty/all/conandata.yml b/recipes/xproperty/all/conandata.yml new file mode 100644 index 0000000000000..e22cd28ead6ab --- /dev/null +++ b/recipes/xproperty/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.11.0": + url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.11.0.tar.gz" + sha256: "bf86a11c6758308aa0aa0f64d8dd24cd3e9d78378467b74002f552bfb75fc0eb" diff --git a/recipes/xproperty/all/conanfile.py b/recipes/xproperty/all/conanfile.py new file mode 100644 index 0000000000000..f3db566cfff6d --- /dev/null +++ b/recipes/xproperty/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class XpropertyConan(ConanFile): + name = "xproperty" + description = "Traitlets-like C++ properties and implementation of the observer pattern." + license = "BSD-3-Clause" + topics = ("observer", "traitlets") + homepage = "https://github.com/jupyter-xeus/xproperty" + url = "https://github.com/conan-io/conan-center-index" + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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")) + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"xproperty": "xproperty::xproperty"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xproperty") + self.cpp_info.set_property("cmake_target_name", "xproperty") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # 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/xproperty/all/test_package/CMakeLists.txt b/recipes/xproperty/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5115f7961f51a --- /dev/null +++ b/recipes/xproperty/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(xproperty REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xproperty) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/xproperty/all/test_package/conanfile.py b/recipes/xproperty/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xproperty/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/xproperty/all/test_package/test_package.cpp b/recipes/xproperty/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f5c67cdb83490 --- /dev/null +++ b/recipes/xproperty/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#include + +#include +#include + +struct Foo: public xp::xobserved { + XPROPERTY(double, Foo, bar); + XPROPERTY(double, Foo, baz); +}; + +int main() { + Foo foo; + + XOBSERVE(foo, bar, [](Foo& f) { + std::cout << "Observer: New value of bar: " << f.bar << std::endl; + }); + + XVALIDATE(foo, bar, [](Foo&, double& proposal) { + std::cout << "Validator: Proposal: " << proposal << std::endl; + if (proposal < 0) + { + throw std::runtime_error("Only non-negative values are valid."); + } + return proposal; + }); + + foo.bar = 1.0; + std::cout << foo.bar << std::endl; + try { + foo.bar = -1.0; + } catch (...) { + std::cout << foo.bar << std::endl; + } + + return 0; +} diff --git a/recipes/xproperty/all/test_v1_package/CMakeLists.txt b/recipes/xproperty/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/xproperty/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xproperty/all/test_v1_package/conanfile.py b/recipes/xproperty/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xproperty/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/xproperty/config.yml b/recipes/xproperty/config.yml new file mode 100644 index 0000000000000..98fa57f62a6c8 --- /dev/null +++ b/recipes/xproperty/config.yml @@ -0,0 +1,3 @@ +versions: + "0.11.0": + folder: all diff --git a/recipes/xqilla/all/conandata.yml b/recipes/xqilla/all/conandata.yml new file mode 100644 index 0000000000000..b20a5f6960ca0 --- /dev/null +++ b/recipes/xqilla/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.3.4": + url: "https://sourceforge.net/projects/xqilla/files/XQilla-2.3.4.tar.gz" + sha256: "292631791631fe2e7eb9727377335063a48f12611d641d0296697e0c075902eb" +patches: + "2.3.4": + - patch_file: "patches/0001-honor-deps-ldflags.patch" + patch_description: "Honor LDFLAGS from dependencies" + patch_type: "conan" diff --git a/recipes/xqilla/all/conanfile.py b/recipes/xqilla/all/conanfile.py new file mode 100644 index 0000000000000..94f360d94a83b --- /dev/null +++ b/recipes/xqilla/all/conanfile.py @@ -0,0 +1,137 @@ +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, cross_building, valid_min_cppstd +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rename, rm, save +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.53.0" + + +class XqillaConan(ConanFile): + name = "xqilla" + description = ( + "XQilla is an XQuery and XPath 2 library and command line utility " + "written in C++, implemented on top of the Xerces-C library" + ) + topics = ("xml", "xquery") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://xqilla.sourceforge.net/HomePage" + license = "Apache-2.0" + + 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" + + @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("xerces-c/3.2.3") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if is_msvc(self): + raise ConanInvalidConfiguration("xqilla recipe doesn't support msvc build yet") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + 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], + 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) + tc.configure_args.append(f"--with-xerces={unix_path(self, self.dependencies['xerces-c'].package_folder)}") + if not valid_min_cppstd(self, self._min_cppstd): + tc.extra_cxxflags.append(f"-std=c++{self._min_cppstd}") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=os.path.join(self.source_folder, "autotools")) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def _extract_yajl_license(self): + tmp = load(self, os.path.join(self.source_folder, "src", "yajl", "yajl_buf.h")) + return tmp[2:tmp.find("*/", 1)] + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "README", src=os.path.join(self.source_folder, "src", "mapm"), + dst=os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "README"), + os.path.join(self.package_folder, "licenses", "LICENSE.mapm")) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE.yajl"), self._extract_yajl_license()) + + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["xqilla"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/xqilla/all/patches/0001-honor-deps-ldflags.patch b/recipes/xqilla/all/patches/0001-honor-deps-ldflags.patch new file mode 100644 index 0000000000000..77822de6fa0c7 --- /dev/null +++ b/recipes/xqilla/all/patches/0001-honor-deps-ldflags.patch @@ -0,0 +1,11 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign dist-zip + SUBDIRS = include + + INCLUDES = -I$(top_srcdir)/include/ $(xerces_include) -I$(top_srcdir)/src/lexer/ $(faxpp_include) $(tidy_include) +-LDFLAGS = -L$(xerces_lib) -R$(xerces_lib) $(faxpp_lib) $(tidy_lib) -lxerces-c $(faxpp_library) $(tidy_library) ++LDFLAGS += -L$(xerces_lib) -R$(xerces_lib) $(faxpp_lib) $(tidy_lib) $(faxpp_library) $(tidy_library) + LDADD = libxqilla.la + ACLOCAL_AMFLAGS = -I autotools/m4 + diff --git a/recipes/xqilla/all/test_package/CMakeLists.txt b/recipes/xqilla/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..689d0b9e4eff3 --- /dev/null +++ b/recipes/xqilla/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(xqilla REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xqilla::xqilla) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/xqilla/all/test_package/conanfile.py b/recipes/xqilla/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0276f2c2a7ffa --- /dev/null +++ b/recipes/xqilla/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run("xqilla -h", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xqilla/all/test_package/test_package.cpp b/recipes/xqilla/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b005ca05dcb31 --- /dev/null +++ b/recipes/xqilla/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +int main() { + + XQilla xqilla; + auto context = xqilla.createContext(); + + if(!context) { + return 1; + } + + return 0; + +} diff --git a/recipes/xqilla/all/test_v1_package/CMakeLists.txt b/recipes/xqilla/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xqilla/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xqilla/all/test_v1_package/conanfile.py b/recipes/xqilla/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6e29cdae9a48f --- /dev/null +++ b/recipes/xqilla/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run("xqilla -h", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xqilla/config.yml b/recipes/xqilla/config.yml new file mode 100644 index 0000000000000..45925611b3bf0 --- /dev/null +++ b/recipes/xqilla/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.4": + folder: all diff --git a/recipes/xsd/all/conandata.yml b/recipes/xsd/all/conandata.yml new file mode 100644 index 0000000000000..d0b47cfe2aef6 --- /dev/null +++ b/recipes/xsd/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "4.0.0": + url: "https://codesynthesis.com/download/xsd/4.0/xsd-4.0.0+dep.tar.bz2" + sha256: "eca52a9c8f52cdbe2ae4e364e4a909503493a0d51ea388fc6c9734565a859817" +patches: + "4.0.0": + - patch_file: "patches/0002-missing-include.patch" + base_path: "source_subfolder" + - patch_file: "patches/0100-C++Parser_Expat_support.patch" + base_path: "source_subfolder" + - patch_file: "patches/0105-Fix_path_handling_bug.patch" + base_path: "source_subfolder" + - patch_file: "patches/0110-xerces-c3.2.patch" + base_path: "source_subfolder" + - patch_file: "patches/0700_hurd_PATH_MAX.patch" + base_path: "source_subfolder" diff --git a/recipes/xsd/all/conanfile.py b/recipes/xsd/all/conanfile.py new file mode 100644 index 0000000000000..19183a5008e25 --- /dev/null +++ b/recipes/xsd/all/conanfile.py @@ -0,0 +1,91 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.40.0" + + +class ConanXqilla(ConanFile): + name = "xsd" + + description = ( + "XSD is a W3C XML Schema to C++ translator. It generates vocabulary-specific, statically-typed C++ mappings (also called bindings) from XML Schema definitions. XSD supports two C++ mappings: in-memory C++/Tree and event-driven C++/Parser." + ) + topics = ("xsd", "xml", "c++") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codesynthesis.com/projects/xsd/" + license = ("GPL-2.0","FLOSSE") + settings = "os", "arch", "compiler", "build_type" + + exports_sources = "patches/**" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("xerces-c/3.2.3") + + @property + def _doc_folder(self): + return os.path.join(self._source_subfolder,"xsd","doc") + + @property + def _make_cmd(self): + return self._gnumake_cmd + + @property + def _make_program(self): + return tools.get_env('CONAN_MAKE_PROGRAM', tools.which('make')) + + @property + def _gnumake_cmd(self): + make_ldflags = "LDFLAGS='{libs} -pthread'".format( + libs=" ".join(["-L{}".format(os.path.join(self.deps_cpp_info["xerces-c"].rootpath, it)) for it in self.deps_cpp_info["xerces-c"].libdirs])) + flags = [] + flags.append(' '.join(["-I{}".format(os.path.join(self.deps_cpp_info["xerces-c"].rootpath, it)) for it in self.deps_cpp_info["xerces-c"].includedirs])) + if self.settings.compiler == "gcc": + flags.append('-std=c++11') + make_ccpflags = "CPPFLAGS='{}'".format(" ".join(flags)) + make_cmd = f'{make_ldflags} {make_ccpflags} {self._make_program} -j{tools.cpu_count()}' + return make_cmd + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("The xsd recipe currently only supports Linux.") + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def package_id(self): + del self.info.settings.compiler + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, + destination=self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + with tools.chdir(self._source_subfolder): + self.run(self._make_cmd) + + def package(self): + self.copy("LICENSE", dst="licenses", src=os.path.join(self._source_subfolder, "xsd")) + self.copy("GPLv2", dst="licenses", src=os.path.join(self._source_subfolder, "xsd")) + self.copy("FLOSSE", dst="licenses", src=os.path.join(self._source_subfolder, "xsd")) + + with tools.chdir(self._source_subfolder): + self.run(self._make_install_cmd) + + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + 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) + + @property + def _make_install_cmd(self): + make_install_cmd = f'{self._make_cmd} install_prefix={self.package_folder} install' + return make_install_cmd diff --git a/recipes/xsd/all/patches/0002-missing-include.patch b/recipes/xsd/all/patches/0002-missing-include.patch new file mode 100644 index 0000000000000..4ed299a43bed0 --- /dev/null +++ b/recipes/xsd/all/patches/0002-missing-include.patch @@ -0,0 +1,19 @@ +From 5029f8665190879285787a9dcdaf5f997cadd2e2 Mon Sep 17 00:00:00 2001 +From: Boris Kolpackov +Date: Fri, 23 Oct 2015 15:40:35 +0200 +Subject: Add missing #include + +--- + xsd-frontend/semantic-graph/elements.cxx | 1 + + 1 file changed, 1 insertion(+) + +--- a/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx ++++ b/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx +@@ -3,6 +3,7 @@ + // license : GNU GPL v2 + exceptions; see accompanying LICENSE file + + #include ++#include + + #include + diff --git a/recipes/xsd/all/patches/0100-C++Parser_Expat_support.patch b/recipes/xsd/all/patches/0100-C++Parser_Expat_support.patch new file mode 100644 index 0000000000000..b34998a7bdf53 --- /dev/null +++ b/recipes/xsd/all/patches/0100-C++Parser_Expat_support.patch @@ -0,0 +1,58 @@ +Description: Fix bug in C++/Parser Expat support. +Author: Jörg Frings-Fürst +Origin: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=94cba986108a0e0f42295572ca42c356d59328d7 + http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=0e5fab0664fb36c6253dfd7bb86d8985d1b349ef +Last-Update: 2016-04-10 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/xsd/libxsd/xsd/cxx/parser/expat/elements.hxx +=================================================================== +--- a/xsd/libxsd/xsd/cxx/parser/expat/elements.hxx ++++ b/xsd/libxsd/xsd/cxx/parser/expat/elements.hxx +@@ -51,7 +51,9 @@ namespace xsd + } + }; + +- typedef std::unique_ptr parser_auto_ptr; ++ typedef ++ std::unique_ptr ++ parser_auto_ptr; + #else + // Simple auto pointer for Expat's XML_Parser object. + // +Index: trunk/xsd/libxsd/xsd/cxx/parser/expat/elements.txx +=================================================================== +--- a/xsd/libxsd/xsd/cxx/parser/expat/elements.txx ++++ b/xsd/libxsd/xsd/cxx/parser/expat/elements.txx +@@ -279,13 +279,14 @@ namespace xsd + { + parser_auto_ptr parser (XML_ParserCreateNS (0, XML_Char (' '))); + +- if (parser == 0) ++ if (parser.get () == 0) + throw std::bad_alloc (); + + if (system_id || public_id) +- parse_begin (parser, system_id ? *system_id : *public_id, eh); ++ parse_begin ( ++ parser.get (), system_id ? *system_id : *public_id, eh); + else +- parse_begin (parser, eh); ++ parse_begin (parser.get (), eh); + + // Temporarily unset the exception failbit. Also clear the + // fail bit when we reset the old state if it was caused +@@ -309,9 +310,10 @@ namespace xsd + // + break; + } +- +- if (XML_Parse ( +- parser, buf, is.gcount (), is.eof ()) == XML_STATUS_ERROR) ++ if (XML_Parse (parser.get (), ++ buf, ++ is.gcount (), ++ is.eof ()) == XML_STATUS_ERROR) + { + r = false; + break; diff --git a/recipes/xsd/all/patches/0105-Fix_path_handling_bug.patch b/recipes/xsd/all/patches/0105-Fix_path_handling_bug.patch new file mode 100644 index 0000000000000..7b23bf514ca5e --- /dev/null +++ b/recipes/xsd/all/patches/0105-Fix_path_handling_bug.patch @@ -0,0 +1,19 @@ +Description: Fix path handling bug +Author: Boris Kolpackov +Origin: git commit b4c3242a763e0461f454cc29be28c2ab26e4a495 +Last-Update: 2016-09-10 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/xsd/examples/cxx/tree/embedded/xsdbin.cxx +=================================================================== +--- a/xsd/examples/cxx/tree/embedded/xsdbin.cxx ++++ b/xsd/examples/cxx/tree/embedded/xsdbin.cxx +@@ -334,7 +334,7 @@ main (int argc, char* argv[]) + // + string::size_type p (base.rfind ('/')), p1 (base.rfind ('\\')); + +- if (p1 != string::npos && p1 > p) ++ if (p1 != string::npos && (p == string::npos || p1 > p)) + p = p1; + + if (p != string::npos) diff --git a/recipes/xsd/all/patches/0110-xerces-c3.2.patch b/recipes/xsd/all/patches/0110-xerces-c3.2.patch new file mode 100644 index 0000000000000..e9a6951bd4c99 --- /dev/null +++ b/recipes/xsd/all/patches/0110-xerces-c3.2.patch @@ -0,0 +1,182 @@ +Description: Remove tests for character ref. values unsupported by Xerces-C++ 3.2 +Author: Boris Kolpackov +Origin: https://git.codesynthesis.com/cgit/xsd/xsd/patch/?id=400651ba7fd2f80155348ed39fc02e2aa9892fb9 +Bug: +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881108 +Last-Update: 2017-11-08 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx ++++ b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx +@@ -43,7 +43,7 @@ main (int argc, char* argv[]) + if (s[0] != "abc" || + s[1] != "\xE6" || + s[2] != "\xA2\xA3\xA4\xA5" || +- s[3] != "???") ++ s[3] != "??") + { + cerr << "invalid encoding" << endl; + return 1; +Index: trunk/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std ++++ b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std +@@ -3,7 +3,7 @@ + abc + + +- ??? ++ ?? + abc + ac + bc +Index: trunk/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.xml +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.xml ++++ b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.xml +@@ -5,7 +5,7 @@ + abc + æ + ¢£¤¥ +- Āꪪ򪪪 ++ Āꪪ + + abc + aâc +Index: trunk/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx ++++ b/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx +@@ -32,8 +32,7 @@ main (int argc, char* argv[]) + + if (s[0] != "abc" || + s[1] != "\xD5\x95" || +- s[2] != "\xEA\xAA\xAA" || +- s[3] != "\xF2\xAA\xAA\xAA") ++ s[2] != "\xEA\xAA\xAA") + { + cerr << "invalid encoding" << endl; + return 1; +@@ -45,8 +44,7 @@ main (int argc, char* argv[]) + + if (s[0] != strenum::abc || + s[1] != strenum::a_c || +- s[2] != strenum::cxx_bc || +- s[3] != strenum::ab_) ++ s[2] != strenum::cxx_bc) + { + cerr << "invalid encoding" << endl; + return 1; +Index: trunk/xsd/tests/cxx/tree/encoding/char/utf-8/test.std +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/utf-8/test.std ++++ b/xsd/tests/cxx/tree/encoding/char/utf-8/test.std +@@ -3,9 +3,7 @@ + abc + Օ + +- 򪪪 + abc + aՕc + ꪪbc +- ab򪪪 + +Index: trunk/xsd/tests/cxx/tree/encoding/char/utf-8/test.xml +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/utf-8/test.xml ++++ b/xsd/tests/cxx/tree/encoding/char/utf-8/test.xml +@@ -5,11 +5,9 @@ + abc + Օ + +- 򪪪 + + abc + aՕc + ꪪbc +- ab򪪪 + + +Index: trunk/xsd/tests/cxx/tree/encoding/char/utf-8/test.xsd +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/char/utf-8/test.xsd ++++ b/xsd/tests/cxx/tree/encoding/char/utf-8/test.xsd +@@ -9,7 +9,6 @@ + abc + aՕc + ꪪbc +- ab򪪪 + + + +@@ -17,7 +16,6 @@ + + + +- + + + +Index: trunk/xsd/tests/cxx/tree/encoding/wchar/test.std +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/wchar/test.std ++++ b/xsd/tests/cxx/tree/encoding/wchar/test.std +@@ -2,9 +2,9 @@ + + abc + ῿퟿ +- 𐀀􏿽 ++ ကჿ + abc + a῿퟿c +- 𐀀􏿽bc +- ab𐀀􏿽 ++ ကჿbc ++ abကჿ + +Index: trunk/xsd/tests/cxx/tree/encoding/wchar/test.xml +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/wchar/test.xml ++++ b/xsd/tests/cxx/tree/encoding/wchar/test.xml +@@ -4,11 +4,11 @@ + + abc + ῿퟿ +- 𐀀􏿽 ++ ကჿ + + abc + a῿퟿c +- 𐀀􏿽bc +- ab𐀀􏿽 ++ ကჿbc ++ abကჿ + + +Index: trunk/xsd/tests/cxx/tree/encoding/wchar/test.xsd +=================================================================== +--- a/xsd/tests/cxx/tree/encoding/wchar/test.xsd ++++ b/xsd/tests/cxx/tree/encoding/wchar/test.xsd +@@ -8,16 +8,16 @@ + Test enum. Valid values are: + abc + a῿퟿c +- 𐀀􏿽bc +- ab𐀀􏿽 ++ ကჿbc ++ abကჿ + + + + + + +- +- ++ ++ + + + diff --git a/recipes/xsd/all/patches/0700_hurd_PATH_MAX.patch b/recipes/xsd/all/patches/0700_hurd_PATH_MAX.patch new file mode 100644 index 0000000000000..af3e0850cf5bb --- /dev/null +++ b/recipes/xsd/all/patches/0700_hurd_PATH_MAX.patch @@ -0,0 +1,21 @@ +Description: Add PATH_MAX for hurd +Author: Jörg Frings-Fürst +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=784425 +Last-Update: 2016-01-17 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/libcutl/cutl/fs/path.cxx +=================================================================== +--- a/libcutl/cutl/fs/path.cxx ++++ b/libcutl/cutl/fs/path.cxx +@@ -13,6 +13,10 @@ + + #include + ++#ifndef PATH_MAX ++ #define PATH_MAX 4096 ++#endif ++ + namespace cutl + { + namespace fs diff --git a/recipes/xsd/all/test_package/conanfile.py b/recipes/xsd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7ea50ba1ad430 --- /dev/null +++ b/recipes/xsd/all/test_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("xsd --help", run_environment=True) diff --git a/recipes/xsd/config.yml b/recipes/xsd/config.yml new file mode 100644 index 0000000000000..d2be8f453d7c0 --- /dev/null +++ b/recipes/xsd/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.0": + folder: all diff --git a/recipes/xsimd/all/conandata.yml b/recipes/xsimd/all/conandata.yml new file mode 100644 index 0000000000000..1a4062ea92a4a --- /dev/null +++ b/recipes/xsimd/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "11.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/11.0.0.tar.gz" + sha256: "50c31c319c8b36c8946eb954c7cca2e2ece86bf8a66a7ebf321b24cd273e7c47" + "10.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/10.0.0.tar.gz" + sha256: "73f818368b3a4dad92fab1b2933d93694241bd2365a6181747b2df1768f6afdd" + "9.0.1": + url: "https://github.com/xtensor-stack/xsimd/archive/9.0.1.tar.gz" + sha256: "b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0" + "8.1.0": + url: "https://github.com/xtensor-stack/xsimd/archive/8.1.0.tar.gz" + sha256: "d52551360d37709675237d2a0418e28f70995b5b7cdad7c674626bcfbbf48328" + "8.0.5": + url: "https://github.com/xtensor-stack/xsimd/archive/8.0.5.tar.gz" + sha256: "0e1b5d973b63009f06a3885931a37452580dbc8d7ca8ad40d4b8c80d2a0f84d7" + "8.0.3": + url: "https://github.com/xtensor-stack/xsimd/archive/refs/tags/8.0.3.tar.gz" + sha256: "d1d41253c4f82eaf2f369d7fcb4142e35076cf8675b9d94caa06ecf883024344" + "7.5.0": + url: "https://github.com/xtensor-stack/xsimd/archive/refs/tags/7.5.0.tar.gz" + sha256: "45337317c7f238fe0d64bb5d5418d264a427efc53400ddf8e6a964b6bcb31ce9" + "7.4.10": + url: "https://github.com/xtensor-stack/xsimd/archive/7.4.10.tar.gz" + sha256: "df00f476dea0c52ffebad60924e3f0db2a016b80d508f8d5a2399a74c0d134cd" diff --git a/recipes/xsimd/all/conanfile.py b/recipes/xsimd/all/conanfile.py new file mode 100644 index 0000000000000..f94116c204e90 --- /dev/null +++ b/recipes/xsimd/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.apple import is_apple_os +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class XsimdConan(ConanFile): + name = "xsimd" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xtensor-stack/xsimd" + description = "C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, NEON, AVX512)" + topics = ("simd-intrinsics", "vectorization", "simd") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "xtl_complex": [True, False], + } + default_options = { + "xtl_complex": False, + } + + no_copy_source = True + + def requirements(self): + if self.options.xtl_complex: + self.requires("xtl/0.7.4") + + def package_id(self): + self.info.clear() + + def validate(self): + # TODO: check supported version (probably >= 8.0.0) + if Version(self.version) < "8.0.0" and self.settings.os == "Macos" and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + raise ConanInvalidConfiguration(f"{self.name} doesn't support macOS M1") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + includedir = os.path.join(self.source_folder, "include") + copy(self, "*.hpp", src=includedir, dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"xsimd": "xsimd::xsimd"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xsimd") + self.cpp_info.set_property("cmake_target_name", "xsimd") + self.cpp_info.set_property("pkg_config_name", "xsimd") + if self.options.xtl_complex: + self.cpp_info.defines = ["XSIMD_ENABLE_XTL_COMPLEX=1"] + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + ## TODO: workaround for arm compilation issue : https://github.com/xtensor-stack/xsimd/issues/735 + if Version(self.version) >= "9.0.0" and \ + is_apple_os(self) and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + self.cpp_info.cxxflags.extend(["-flax-vector-conversions", "-fsigned-char",]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/xsimd/all/test_package/CMakeLists.txt b/recipes/xsimd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d39cde644c56 --- /dev/null +++ b/recipes/xsimd/all/test_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(CheckCXXCompilerFlag) + +find_package(xsimd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xsimd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + foreach(flag "/arch:AVX") + CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() + endforeach() +elseif ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + foreach(flag "-march=native" "-mtune=native") + CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() + endforeach() +endif() diff --git a/recipes/xsimd/all/test_package/conanfile.py b/recipes/xsimd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/xsimd/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/xsimd/all/test_package/test_package.cpp b/recipes/xsimd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..be0d55dea1818 --- /dev/null +++ b/recipes/xsimd/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#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[]) { +#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}); +#else + xs::batch a{1.5, 2.5, 3.5, 4.5}; + xs::batch b{2.5, 3.5, 4.5, 5.5}; +#endif + + auto mean = (a + b) / 2; + std::cout << mean << std::endl; + return 0; +} diff --git a/recipes/xsimd/all/test_v1_package/CMakeLists.txt b/recipes/xsimd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b2359dc86fc74 --- /dev/null +++ b/recipes/xsimd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(CheckCXXCompilerFlag) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xsimd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xsimd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + foreach(flag "/arch:AVX") + CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() + endforeach() +elseif ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + foreach(flag "-march=native" "-mtune=native") + CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() + endforeach() +endif() diff --git a/recipes/xsimd/all/test_v1_package/conanfile.py b/recipes/xsimd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xsimd/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/xsimd/config.yml b/recipes/xsimd/config.yml new file mode 100644 index 0000000000000..37e417d6caa91 --- /dev/null +++ b/recipes/xsimd/config.yml @@ -0,0 +1,17 @@ +versions: + "11.0.0": + folder: all + "10.0.0": + folder: all + "9.0.1": + folder: all + "8.1.0": + folder: all + "8.0.5": + folder: all + "8.0.3": + folder: all + "7.5.0": + folder: all + "7.4.10": + folder: all diff --git a/recipes/xtensor/all/conandata.yml b/recipes/xtensor/all/conandata.yml new file mode 100644 index 0000000000000..40af805ba9e93 --- /dev/null +++ b/recipes/xtensor/all/conandata.yml @@ -0,0 +1,59 @@ +sources: + "0.24.3": + url: "https://github.com/xtensor-stack/xtensor/archive/0.24.3.tar.gz" + sha256: "3acde856b9fb8cf4e2a7b66726da541275d40ab9b002e618ad985ab97f08ca4f" + "0.24.2": + url: "https://github.com/xtensor-stack/xtensor/archive/0.24.2.tar.gz" + sha256: "790d9e449add817154177157a850b9afd0260dc0f9df857d8b3a38886a10ef8b" + "0.24.0": + url: "https://github.com/xtensor-stack/xtensor/archive/0.24.0.tar.gz" + sha256: "37738aa0865350b39f048e638735c05d78b5331073b6329693e8b8f0902df713" + "0.23.10": + url: "https://github.com/xtensor-stack/xtensor/archive/0.23.10.tar.gz" + sha256: "2e770a6d636962eedc868fef4930b919e26efe783cd5d8732c11e14cf72d871c" + "0.23.9": + url: "https://github.com/xtensor-stack/xtensor/archive/0.23.9.tar.gz" + sha256: "5bdb9d85ee82c60be0bce32d891b5cc20eb633284a0aabb907f55bbe722cc8e3" + "0.21.5": + url: "https://github.com/xtensor-stack/xtensor/archive/0.21.5.tar.gz" + sha256: "30cb896b6686683ddaefb12c98bf1109fdfe666136dd027aba1a1e9aa825c241" + "0.21.4": + url: "https://github.com/xtensor-stack/xtensor/archive/0.21.4.tar.gz" + sha256: "143ef2536f1671e1c7c7834de4a040f1694112e23222fcd2ae59b0f5e5124b57" + "0.21.3": + url: "https://github.com/xtensor-stack/xtensor/archive/0.21.3.tar.gz" + sha256: "f63c25cafea4bfc268edb26e6f5004a28a2f689e6a852bb3559c553106c8d6bf" + "0.21.2": + url: "https://github.com/xtensor-stack/xtensor/archive/0.21.2.tar.gz" + sha256: "a32490bc8499f59f8e30c288e178ff41c9511cf4959dc59c9628b29b77049a4a" +patches: + "0.24.2": + - patch_file: "patches/0.24.0-cxx11-abi.patch" + patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" + patch_type: "bugfix" + patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" + "0.24.0": + - patch_file: "patches/0.24.0-cxx11-abi.patch" + patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" + patch_type: "bugfix" + patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" + "0.23.10": + - patch_file: "patches/0.23.9-cxx11-abi.patch" + patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" + patch_type: "bugfix" + patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" + "0.23.9": + - patch_file: "patches/0.23.9-cxx11-abi.patch" + patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" + patch_type: "bugfix" + patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" + "0.21.5": + - patch_file: "patches/0.21.5-cxx11-abi.patch" + patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" + patch_type: "bugfix" + patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" + "0.21.4": + - patch_file: "patches/0.21.4-cxx11-abi.patch" + patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" + patch_type: "bugfix" + patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" diff --git a/recipes/xtensor/all/conanfile.py b/recipes/xtensor/all/conanfile.py new file mode 100644 index 0000000000000..9a77cdf6361a6 --- /dev/null +++ b/recipes/xtensor/all/conanfile.py @@ -0,0 +1,134 @@ +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, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class XtensorConan(ConanFile): + name = "xtensor" + description = "C++ tensors with broadcasting and lazy computing" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xtensor-stack/xtensor" + topics = ("numpy", "multidimensional-arrays", "tensors") + settings = "os", "arch", "compiler", "build_type" + options = { + "xsimd": [True, False], + "tbb": [True, False], + "openmp": [True, False], + } + default_options = { + "xsimd": True, + "tbb": False, + "openmp": False, + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + # https://github.com/xtensor-stack/xtensor/blob/master/README.md + return { + "Visual Studio": "14", + "msvc": "190", + "gcc": "4.9", + "clang": "4", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("xtl/0.7.5") + self.requires("nlohmann_json/3.11.2") + if self.options.xsimd: + if Version(self.version) < "0.24.0": + self.requires("xsimd/7.5.0") + else: + self.requires("xsimd/10.0.0") + if self.options.tbb: + self.requires("onetbb/2021.7.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.options.tbb and self.options.openmp: + raise ConanInvalidConfiguration( + "The options 'tbb' and 'openmp' can not be used together." + ) + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", 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")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"xtensor": "xtensor::xtensor"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xtensor") + self.cpp_info.set_property("cmake_target_name", "xtensor") + self.cpp_info.set_property("pkg_config_name", "xtensor") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.xsimd: + self.cpp_info.defines.append("XTENSOR_USE_XSIMD") + if self.options.tbb: + self.cpp_info.defines.append("XTENSOR_USE_TBB") + if self.options.openmp: + self.cpp_info.defines.append("XTENSOR_USE_OPENMP") + + # 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/xtensor/all/patches/0.21.4-cxx11-abi.patch b/recipes/xtensor/all/patches/0.21.4-cxx11-abi.patch new file mode 100644 index 0000000000000..785004e7c86cd --- /dev/null +++ b/recipes/xtensor/all/patches/0.21.4-cxx11-abi.patch @@ -0,0 +1,22 @@ +diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp +index ce3ce72..936d387 100644 +--- a/include/xtensor/xutils.hpp ++++ b/include/xtensor/xutils.hpp +@@ -611,12 +611,16 @@ namespace xt + /******************************************** + * xtrivial_default_construct implemenation * + ********************************************/ +- ++#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7 ++// has_trivial_default_constructor has not been available since libstdc++-7. ++#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 ++#else + #if defined(_GLIBCXX_USE_CXX11_ABI) + #if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI) + #define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 + #endif + #endif ++#endif + + #if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI) + diff --git a/recipes/xtensor/all/patches/0.21.5-cxx11-abi.patch b/recipes/xtensor/all/patches/0.21.5-cxx11-abi.patch new file mode 100644 index 0000000000000..8273009f8c1a5 --- /dev/null +++ b/recipes/xtensor/all/patches/0.21.5-cxx11-abi.patch @@ -0,0 +1,22 @@ +diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp +index 5a3f31b..1e99c9b 100644 +--- a/include/xtensor/xutils.hpp ++++ b/include/xtensor/xutils.hpp +@@ -612,12 +612,16 @@ namespace xt + /******************************************** + * xtrivial_default_construct implemenation * + ********************************************/ +- ++#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7 ++// has_trivial_default_constructor has not been available since libstdc++-7. ++#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 ++#else + #if defined(_GLIBCXX_USE_CXX11_ABI) + #if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI) + #define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 + #endif + #endif ++#endif + + #if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI) + diff --git a/recipes/xtensor/all/patches/0.23.9-cxx11-abi.patch b/recipes/xtensor/all/patches/0.23.9-cxx11-abi.patch new file mode 100644 index 0000000000000..a7dc6f4f4f904 --- /dev/null +++ b/recipes/xtensor/all/patches/0.23.9-cxx11-abi.patch @@ -0,0 +1,21 @@ +diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp +index 85d8d18..fe3d0f6 100644 +--- a/include/xtensor/xutils.hpp ++++ b/include/xtensor/xutils.hpp +@@ -638,11 +638,16 @@ namespace xt + * xtrivial_default_construct implemenation * + ********************************************/ + ++#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7 ++// has_trivial_default_constructor has not been available since libstdc++-7. ++#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 ++#else + #if defined(_GLIBCXX_USE_CXX11_ABI) + #if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI) + #define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 + #endif + #endif ++#endif + + #if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI) + diff --git a/recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch b/recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch new file mode 100644 index 0000000000000..b7c9e2acdedf0 --- /dev/null +++ b/recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch @@ -0,0 +1,21 @@ +diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp +index ed8f2ea..ba7ccea 100644 +--- a/include/xtensor/xutils.hpp ++++ b/include/xtensor/xutils.hpp +@@ -637,11 +637,16 @@ namespace xt + * xtrivial_default_construct implemenation * + ********************************************/ + ++#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7 ++// has_trivial_default_constructor has not been available since libstdc++-7. ++#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 ++#else + #if defined(_GLIBCXX_USE_CXX11_ABI) + #if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI) + #define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 + #endif + #endif ++#endif + + #if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI) + diff --git a/recipes/xtensor/all/test_package/CMakeLists.txt b/recipes/xtensor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed456ebb1ccdb --- /dev/null +++ b/recipes/xtensor/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(CheckCXXCompilerFlag) + +find_package(xtensor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xtensor) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) + +foreach(flag "-march=native" "-mtune=native") + check_cxx_compiler_flag(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() +endforeach() diff --git a/recipes/xtensor/all/test_package/conanfile.py b/recipes/xtensor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xtensor/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/xtensor/all/test_package/test_package.cpp b/recipes/xtensor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5d5dcde103999 --- /dev/null +++ b/recipes/xtensor/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include "xtensor/xarray.hpp" +#include "xtensor/xio.hpp" +#include "xtensor/xview.hpp" +#include + +int main(int argc, char *argv[]) { + xt::xarray arr1{{1.0, 2.0, 3.0}, {2.0, 5.0, 7.0}, {2.0, 5.0, 7.0}}; + + xt::xarray arr2{5.0, 6.0, 7.0}; + + xt::xarray res = xt::view(arr1, 1) + arr2; + + std::cout << res << std::endl; + + return 0; +} diff --git a/recipes/xtensor/all/test_v1_package/CMakeLists.txt b/recipes/xtensor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xtensor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xtensor/all/test_v1_package/conanfile.py b/recipes/xtensor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xtensor/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/xtensor/config.yml b/recipes/xtensor/config.yml new file mode 100644 index 0000000000000..0077748f19ef0 --- /dev/null +++ b/recipes/xtensor/config.yml @@ -0,0 +1,19 @@ +versions: + "0.24.3": + folder: all + "0.24.2": + folder: all + "0.24.0": + folder: all + "0.23.10": + folder: all + "0.23.9": + folder: all + "0.21.5": + folder: all + "0.21.4": + folder: all + "0.21.3": + folder: all + "0.21.2": + folder: all diff --git a/recipes/xtl/all/conandata.yml b/recipes/xtl/all/conandata.yml new file mode 100644 index 0000000000000..826f7d639e616 --- /dev/null +++ b/recipes/xtl/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "0.7.5": + url: "https://github.com/xtensor-stack/xtl/archive/0.7.5.tar.gz" + sha256: "3286fef5fee5d58f82f7b91375cd449c819848584bae9367893501114d923cbe" + "0.7.4": + url: "https://github.com/xtensor-stack/xtl/archive/0.7.4.tar.gz" + sha256: "3c88be0e696b64150c4de7a70f9f09c00a335186b0b0b409771ef9f56bca7d9a" + "0.7.3": + url: "https://github.com/xtensor-stack/xtl/archive/0.7.3.tar.gz" + sha256: "f4a81e3c9ca9ddb42bd4373967d4859ecfdca1aba60b9fa6ced6c84d8b9824ff" + "0.7.2": + url: "https://github.com/xtensor-stack/xtl/archive/0.7.2.tar.gz" + sha256: "95c221bdc6eaba592878090916383e5b9390a076828552256693d5d97f78357c" + "0.6.21": + url: "https://github.com/xtensor-stack/xtl/archive/0.6.21.tar.gz" + sha256: "97137014fa5da2a3598a267d06c8e28490b2e1c75b8f52358738bedb526fc771" + "0.6.12": + url: "https://github.com/xtensor-stack/xtl/archive/0.6.12.tar.gz" + sha256: "25a16958195f939e6fb7c8feccad89b3e450a18124be6aee119c69a1ee2b308c" + "0.6.11": + url: "https://github.com/xtensor-stack/xtl/archive/0.6.11.tar.gz" + sha256: "e3cb622def174b76547c29ce0d63ae1407ed19fcbbd233913613e9859568eadd" + "0.6.10": + url: "https://github.com/xtensor-stack/xtl/archive/0.6.10.tar.gz" + sha256: "9de012e06a6c24561b2c50cf7650cb32ffcf2c22f73b0314deeba9c775e5036f" + "0.6.9": + url: "https://github.com/xtensor-stack/xtl/archive/0.6.9.tar.gz" + sha256: "c348fcf53dd2b355d143ad28e77f1ede7e1d5e6a196d2d5b9c478b1c005dedd0" diff --git a/recipes/xtl/all/conanfile.py b/recipes/xtl/all/conanfile.py new file mode 100644 index 0000000000000..60668a4a58f13 --- /dev/null +++ b/recipes/xtl/all/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class XtlConan(ConanFile): + name = "xtl" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xtensor-stack/xtl" + description = "The x template library" + topics = ("templates", "containers", "algorithms") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "clang": "3.9", + "gcc": "6", + "Visual Studio": "15", + "msvc": "191", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "14") + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++14, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", 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")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"xtl": "xtl::xtl"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xtl") + self.cpp_info.set_property("cmake_target_name", "xtl") + self.cpp_info.set_property("pkg_config_name", "xtl") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # 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/xtl/all/test_package/CMakeLists.txt b/recipes/xtl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db51a113d84aa --- /dev/null +++ b/recipes/xtl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(xtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/xtl/all/test_package/conanfile.py b/recipes/xtl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/xtl/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/xtl/all/test_package/test_package.cpp b/recipes/xtl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f323ad56d9437 --- /dev/null +++ b/recipes/xtl/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main(int argc, char *argv[]) { + xtl::variant v, w; + + v = 12; + int i = xtl::get(v); + w = xtl::get(v); + + std::cout << xtl::get(v) << "\n"; + std::cout << xtl::get(w) << "\n"; + + return 0; +} diff --git a/recipes/xtl/all/test_v1_package/CMakeLists.txt b/recipes/xtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/xtl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xtl/all/test_v1_package/conanfile.py b/recipes/xtl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xtl/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/xtl/config.yml b/recipes/xtl/config.yml new file mode 100644 index 0000000000000..eb054d979da83 --- /dev/null +++ b/recipes/xtl/config.yml @@ -0,0 +1,19 @@ +versions: + "0.7.5": + folder: all + "0.7.4": + folder: all + "0.7.3": + folder: all + "0.7.2": + folder: all + "0.6.21": + folder: all + "0.6.12": + folder: all + "0.6.11": + folder: all + "0.6.10": + folder: all + "0.6.9": + folder: all diff --git a/recipes/xtr/all/conandata.yml b/recipes/xtr/all/conandata.yml new file mode 100644 index 0000000000000..73147ae073149 --- /dev/null +++ b/recipes/xtr/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.0.1": + url: "https://github.com/choll/xtr/archive/refs/tags/2.0.1.tar.gz" + sha256: "92327264541900a2c9d43aaa3070d143d5e91879737fcea8cbf56065330af059" + "2.0.0": + url: "https://github.com/choll/xtr/archive/refs/tags/2.0.0.tar.gz" + sha256: "1d0113d3551e0d5f5b97228ba245d711c6b66a62a69d62bdf1b206fdf45edd41" + "1.0.1": + url: "https://github.com/choll/xtr/archive/refs/tags/1.0.1.tar.gz" + sha256: "7cc5ec7a2d7d2979e33b928191def79dc05c8074f4c8bb76cd0a20d9b514be0c" + "1.0.0": + url: "https://github.com/choll/xtr/archive/refs/tags/1.0.0.tar.gz" + sha256: "c828883f3045762442fb8a69ed2633e523493a307a0cb2717ac0df93606db7fd" diff --git a/recipes/xtr/all/conanfile.py b/recipes/xtr/all/conanfile.py new file mode 100644 index 0000000000000..494c8ad3c65f3 --- /dev/null +++ b/recipes/xtr/all/conanfile.py @@ -0,0 +1,125 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration + +import os + + +class XtrConan(ConanFile): + name = "xtr" + description = \ + "C++ Logging Library for Low-latency or Real-time Environments" + topics = ("xtr", "logging", "logger") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/choll/xtr" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "enable_exceptions": [True, False], + "enable_lto": [True, False], + "enable_io_uring": ["auto", True, False], + "enable_io_uring_sqpoll": [True, False], + "sink_capacity_kb": "ANY" + } + default_options = { + "fPIC": True, + "enable_exceptions": True, + "enable_lto": False, + "enable_io_uring": "auto", + "enable_io_uring_sqpoll": False, + "sink_capacity_kb": None + } + + generators = "make" + + def config_options(self): + if tools.Version(self.version) < "1.0.1": + del self.options.sink_capacity_kb + if tools.Version(self.version) < "2.0.0": + del self.options.enable_io_uring + del self.options.enable_io_uring_sqpoll + + def requirements(self): + self.requires("fmt/7.1.3") + # Require liburing on any Linux system as a run-time check will be + # done to detect if the host kernel supports io_uring. + if tools.Version(self.version) >= "2.0.0" and self.settings.os == "Linux" and self.options.get_safe("enable_io_uring"): + self.requires("liburing/2.1") + + def validate(self): + if self.settings.os not in ("FreeBSD", "Linux"): + raise ConanInvalidConfiguration(f"Unsupported os={self.settings.os}") + if self.settings.compiler not in ("gcc", "clang"): + raise ConanInvalidConfiguration(f"Unsupported compiler={self.settings.compiler}") + if self.settings.arch not in ("x86_64", ): + raise ConanInvalidConfiguration(f"Unsupported arch={self.settings.arch}") + if tools.Version(self.version) < "2.0.0" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration(f"Use at least version 2.0.0 for libc++ compatibility") + if self.options.get_safe("enable_io_uring_sqpoll") and not self.options.get_safe("enable_io_uring"): + raise ConanInvalidConfiguration(f"io_uring must be enabled if io_uring_sqpoll is enabled") + if self.options.get_safe("sink_capacity_kb") and not str(self.options.get_safe("sink_capacity_kb")).isdigit(): + raise ConanInvalidConfiguration(f"The option 'sink_capacity_kb' must be an integer") + + minimal_cpp_standard = 20 + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + + minimum_version = {"gcc": 10, "clang": 12} + compiler = str(self.settings.compiler) + version = tools.Version(self.settings.compiler.version) + + if version < minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires {self.settings.compiler} version {minimum_version[compiler]} or later") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True) + + def get_defines(self): + defines = [] + enable_io_uring = self.options.get_safe("enable_io_uring") + if enable_io_uring in (True, False): + defines += ["XTR_USE_IO_URING={}".format(int(bool(enable_io_uring)))] + if self.options.get_safe("enable_io_uring_sqpoll"): + defines += ["XTR_IO_URING_POLL=1"] + capacity = self.options.get_safe("sink_capacity_kb") + if capacity: + defines += ["XTR_SINK_CAPACITY={}".format(int(capacity) * 1024)] + return defines + + def build(self): + # FIXME: should be done in validate (but version is not yet available there) + if tools.Version(self.deps_cpp_info["fmt"].version) < 6: + raise ConanInvalidConfiguration("The version of fmt must >= 6.0.0") + if tools.Version(self.deps_cpp_info["fmt"].version) == "8.0.0" and self.settings.compiler == "clang": + raise ConanInvalidConfiguration("fmt/8.0.0 is known to not work with clang (https://github.com/fmtlib/fmt/issues/2377)") + + autotools = AutoToolsBuildEnvironment(self) + env_build_vars = autotools.vars + # Conan uses LIBS, presumably following autotools conventions, while + # the XTR makefile follows GNU make conventions and uses LDLIBS + env_build_vars["LDLIBS"] = env_build_vars["LIBS"] + # fPIC and Release/Debug/RelWithDebInfo etc are set via CXXFLAGS, + # CPPFLAGS etc. + env_build_vars["EXCEPTIONS"] = \ + str(int(bool(self.options.enable_exceptions))) + env_build_vars["LTO"] = str(int(bool(self.options.enable_lto))) + env_build_vars["CXXFLAGS"] += "".join([" -D{}".format(d) for d in self.get_defines()]) + autotools.make(vars=env_build_vars) + autotools.make(vars=env_build_vars, target="xtrctl") + + def package(self): + self.copy("LICENSE", dst="licenses") + self.copy("*.hpp", src="include", dst="include") + self.copy("*/libxtr.a", src="build", dst="lib", keep_path=False) + self.copy("*/xtrctl", src="build", dst="bin", keep_path=False) + + tools.rmdir(os.path.join(self.package_folder, "man")) + + def package_info(self): + self.cpp_info.libs = ["xtr"] + self.cpp_info.system_libs = ["pthread"] + self.cpp_info.defines = self.get_defines() + 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) diff --git a/recipes/xtr/all/test_package/CMakeLists.txt b/recipes/xtr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..921819122a4a1 --- /dev/null +++ b/recipes/xtr/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +set(CMAKE_CXX_STANDARD 20) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xtr REQUIRED) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xtr::xtr) diff --git a/recipes/xtr/all/test_package/conanfile.py b/recipes/xtr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xtr/all/test_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/xtr/all/test_package/example.cpp b/recipes/xtr/all/test_package/example.cpp new file mode 100644 index 0000000000000..c4a9007d32158 --- /dev/null +++ b/recipes/xtr/all/test_package/example.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + xtr::logger log; + auto s = log.get_sink("Test"); + XTR_LOG(s, "Hello world"); + return 0; +} diff --git a/recipes/xtr/config.yml b/recipes/xtr/config.yml new file mode 100644 index 0000000000000..066b0d5ac74d1 --- /dev/null +++ b/recipes/xtr/config.yml @@ -0,0 +1,9 @@ +versions: + "2.0.1": + folder: all + "2.0.0": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all diff --git a/recipes/xtrans/all/conanfile.py b/recipes/xtrans/all/conanfile.py new file mode 100644 index 0000000000000..e9697205799d1 --- /dev/null +++ b/recipes/xtrans/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.47" + + +class XtransConan(ConanFile): + name = "xtrans" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://www.x.org/wiki/" + description = "X Network Transport layer shared code" + settings = "os", "arch", "compiler", "build_type" + topics = ("x11", "xorg") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.arch + del self.info.settings.build_type + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["xtrans-dev"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["xorg-x11-xtrans-devel"], update=True, check=True) + + dnf = package_manager.Dnf(self) + dnf.install(["xorg-x11-xtrans-devel"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["xtrans"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["xtrans"], update=True, check=True) + + package_manager.Pkg(self).install(["xtrans"], update=True, check=True) + + def package_info(self): + pkg_config = PkgConfig(self, "xtrans") + pkg_config.fill_cpp_info( + self.cpp_info, is_system=self.settings.os != "FreeBSD") + self.cpp_info.version = pkg_config.version + self.cpp_info.set_property("pkg_config_name", "xtrans") + self.cpp_info.set_property("component_version", pkg_config.version) + self.cpp_info.set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) diff --git a/recipes/xtrans/all/test_package/conanfile.py b/recipes/xtrans/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1b04b27a310a7 --- /dev/null +++ b/recipes/xtrans/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def generate(self): + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + + def build(self): + pass + + def test(self): + pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config") + self.run(f"{pkg_config} --validate xtrans") diff --git a/recipes/xtrans/all/test_v1_package/conanfile.py b/recipes/xtrans/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c20eb932e465e --- /dev/null +++ b/recipes/xtrans/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "pkg_config" + + def build(self): + pass + + def test(self): + self.run("pkg-config --validate ./xtrans.pc") diff --git a/recipes/xtrans/config.yml b/recipes/xtrans/config.yml new file mode 100644 index 0000000000000..76a338dd54cee --- /dev/null +++ b/recipes/xtrans/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "all" diff --git a/recipes/xxhash/all/conandata.yml b/recipes/xxhash/all/conandata.yml new file mode 100644 index 0000000000000..a0b4d68deb6b4 --- /dev/null +++ b/recipes/xxhash/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "0.8.1": + url: "https://github.com/Cyan4973/xxHash/archive/v0.8.1.tar.gz" + sha256: "3bb6b7d6f30c591dd65aaaff1c8b7a5b94d81687998ca9400082c739a690436c" + "0.8.0": + url: "https://github.com/Cyan4973/xxHash/archive/v0.8.0.tar.gz" + sha256: "7054c3ebd169c97b64a92d7b994ab63c70dd53a06974f1f630ab782c28db0f4f" +patches: + "0.8.1": + - patch_file: "patches/0.8.1-fix-cmakelists.patch" + patch_description: "Update CMakeLists.txt to properly install manuals" + patch_type: conan + + - patch_file: "patches/0.8.1-fix-static-assert-link-error.patch" + patch_source: "https://github.com/Cyan4973/xxHash/commit/6189ecd3d44a693460f86280ccf49d33cb4b18e1" + patch_description: "Backport fix for link error" + patch_type: bugfix diff --git a/recipes/xxhash/all/conanfile.py b/recipes/xxhash/all/conanfile.py new file mode 100644 index 0000000000000..7ce90e1beb92a --- /dev/null +++ b/recipes/xxhash/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class XxHashConan(ConanFile): + name = "xxhash" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Cyan4973/xxHash" + description = "Extremely fast non-cryptographic hash algorithm" + topics = ("hash", "algorithm", "fast", "checksum", "hash-functions") + license = "BSD-2-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "utility": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "utility": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["XXHASH_BUNDLED_MODE"] = False + tc.variables["XXHASH_BUILD_XXHSUM"] = self.options.utility + # Fix CMake configuration if target is iOS/tvOS/watchOS + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cmake_unofficial")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xxHash") + self.cpp_info.set_property("cmake_target_name", "xxHash::xxhash") + self.cpp_info.set_property("pkg_config_name", "libxxhash") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libxxhash"].libs = ["xxhash"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "xxHash" + self.cpp_info.names["cmake_find_package_multi"] = "xxHash" + self.cpp_info.names["pkg_config"] = "libxxhash" + self.cpp_info.components["libxxhash"].names["cmake_find_package"] = "xxhash" + self.cpp_info.components["libxxhash"].names["cmake_find_package_multi"] = "xxhash" + self.cpp_info.components["libxxhash"].set_property("cmake_target_name", "xxHash::xxhash") + if self.options.utility: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/xxhash/all/patches/0.8.1-fix-cmakelists.patch b/recipes/xxhash/all/patches/0.8.1-fix-cmakelists.patch new file mode 100644 index 0000000000000..4fe3527b0fdd2 --- /dev/null +++ b/recipes/xxhash/all/patches/0.8.1-fix-cmakelists.patch @@ -0,0 +1,13 @@ +diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt +index d5456b0..aca3d1f 100644 +--- a/cmake_unofficial/CMakeLists.txt ++++ b/cmake_unofficial/CMakeLists.txt +@@ -122,7 +122,7 @@ if(NOT XXHASH_BUNDLED_MODE) + install(TARGETS xxhsum + EXPORT xxHashTargets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +- install(FILES "${XXHASH_DIR}/xxhsum.1" ++ install(FILES "${XXHSUM_DIR}/xxhsum.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + endif(XXHASH_BUILD_XXHSUM) + diff --git a/recipes/xxhash/all/patches/0.8.1-fix-static-assert-link-error.patch b/recipes/xxhash/all/patches/0.8.1-fix-static-assert-link-error.patch new file mode 100644 index 0000000000000..82773a37fe366 --- /dev/null +++ b/recipes/xxhash/all/patches/0.8.1-fix-static-assert-link-error.patch @@ -0,0 +1,14 @@ +diff --git a/xxhash.h b/xxhash.h +index 08ab794..511c4d1 100644 +--- a/xxhash.h ++++ b/xxhash.h +@@ -1546,8 +1546,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) + /* note: use after variable declarations */ + #ifndef XXH_STATIC_ASSERT + # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */ +-# include +-# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0) ++# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0) + # elif defined(__cplusplus) && (__cplusplus >= 201103L) /* C++11 */ + # define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0) + # else diff --git a/recipes/xxhash/all/test_package/CMakeLists.txt b/recipes/xxhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..635658efca1c2 --- /dev/null +++ b/recipes/xxhash/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(xxHash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xxHash::xxhash) diff --git a/recipes/xxhash/all/test_package/conanfile.py b/recipes/xxhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xxhash/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/xxhash/all/test_package/test_package.c b/recipes/xxhash/all/test_package/test_package.c new file mode 100644 index 0000000000000..4d046529c5ea4 --- /dev/null +++ b/recipes/xxhash/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include "xxhash.h" + +#include +#include + + +int main() +{ + size_t const bufferSize = 10; + void* const buffer = malloc(bufferSize); + XXH64_hash_t hash = XXH64(buffer, bufferSize, 0); + printf("%llu", hash); + free(buffer); + return 0; +} diff --git a/recipes/xxhash/all/test_v1_package/CMakeLists.txt b/recipes/xxhash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xxhash/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xxhash/all/test_v1_package/conanfile.py b/recipes/xxhash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xxhash/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/xxhash/config.yml b/recipes/xxhash/config.yml new file mode 100644 index 0000000000000..20824a4afbb4d --- /dev/null +++ b/recipes/xxhash/config.yml @@ -0,0 +1,5 @@ +versions: + "0.8.1": + folder: all + "0.8.0": + folder: all diff --git a/recipes/xxsds-sdsl-lite/all/conandata.yml b/recipes/xxsds-sdsl-lite/all/conandata.yml new file mode 100644 index 0000000000000..b6d6545a3fc79 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + cci.20210329: + url: https://github.com/xxsds/sdsl-lite/archive/163d59bb1f3b1b21b028099547f556953d1c626f.zip + sha256: 3ec5e85ee6caf5afe73c4077992aaaaffd5dfed711033e944937c6245adbfeca + 3.0.0: + url: https://github.com/xxsds/sdsl-lite/archive/refs/tags/v3.0.0.zip + sha256: e43ae8947b34304f15aee14293c8e520745860cabb039d146b587c0498d2be93 +patches: + cci.20210329: + - patch_file: patches/bits.hpp.patch + base_path: source_subfolder + - patch_file: patches/util.hpp.patch + base_path: source_subfolder + 3.0.0: + - patch_file: patches/bits.hpp.patch + base_path: source_subfolder + - patch_file: patches/util.hpp.patch + base_path: source_subfolder diff --git a/recipes/xxsds-sdsl-lite/all/conanfile.py b/recipes/xxsds-sdsl-lite/all/conanfile.py new file mode 100644 index 0000000000000..de8842c0e754e --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/conanfile.py @@ -0,0 +1,46 @@ +import os +from conans import ConanFile, tools + +required_conan_version = ">=1.33.0" + +class XXSDSSDSLLite(ConanFile): + name = "xxsds-sdsl-lite" + description = "SDSL - Succinct Data Structure Library" + homepage = "https://github.com/xxsds/sdsl-lite" + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + topics = ("conan", "sdsl", "succint", "data-structures") + settings = "compiler" + exports_sources = "patches/*" + provides = "sdsl-lite" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def package(self): + self.copy("*.hpp", dst="include", + src=os.path.join(self._source_subfolder, "include")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + if self.settings.compiler == "Visual Studio": + self.cpp_info.defines.append("MSVC_COMPILER") + self.cpp_info.names["pkgconfig"] = "sdsl-lite" + self.cpp_info.names["cmake_find_package"] = "sdsl-lite" + self.cpp_info.names["cmake_find_package_multi"] = "sdsl-lite" diff --git a/recipes/xxsds-sdsl-lite/all/patches/bits.hpp.patch b/recipes/xxsds-sdsl-lite/all/patches/bits.hpp.patch new file mode 100644 index 0000000000000..ac0b9ee8ea8c7 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/patches/bits.hpp.patch @@ -0,0 +1,22 @@ +diff --git a/include/sdsl/bits.hpp b/include/sdsl/bits.hpp +index 3aa0b4f..5128d04 100644 +--- a/include/sdsl/bits.hpp ++++ b/include/sdsl/bits.hpp +@@ -19,7 +19,7 @@ + #endif + + #ifdef WIN32 +-#include ++#include + #endif + + #ifdef __cpp_constexpr +@@ -593,7 +593,7 @@ SDSL_CONSTEXPR inline uint64_t bits_impl::map01(uint64_t x, uint64_t c) + template + SDSL_CONSTEXPR inline uint32_t bits_impl::sel(uint64_t x, uint32_t i) + { +-#ifdef __BMI2__ ++#if defined(__BMI__) && defined(__BMI2__) + // taken from folly + return _tzcnt_u64(_pdep_u64(1ULL << (i - 1), x)); + #endif diff --git a/recipes/xxsds-sdsl-lite/all/patches/util.hpp.patch b/recipes/xxsds-sdsl-lite/all/patches/util.hpp.patch new file mode 100644 index 0000000000000..fd105defcb50f --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/patches/util.hpp.patch @@ -0,0 +1,13 @@ +diff --git a/include/sdsl/util.hpp b/include/sdsl/util.hpp +index 9ce5726..f2b65a5 100644 +--- a/include/sdsl/util.hpp ++++ b/include/sdsl/util.hpp +@@ -266,7 +266,7 @@ inline std::string dirname(std::string file) + */ + inline std::string demangle(const std::string & name) + { +-#if 1 ++#ifndef _WIN32 + char buf[4096]; + size_t size = 4096; + int status = 0; diff --git a/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt b/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18fda057023dc --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sdsl-lite CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package sdsl-lite::sdsl-lite) +set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py b/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..75634e62bcb66 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/test_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/xxsds-sdsl-lite/all/test_package/test_package.cpp b/recipes/xxsds-sdsl-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..25950b6f5c5b3 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/test_package/test_package.cpp @@ -0,0 +1,42 @@ +#include +#include + +int main() +{ + sdsl::bit_vector b(10000000, 0); + b[8] = 1; + sdsl::rank_support_v<> rb(&b); + + std::cout << rb(8) << std::endl; + std::cout << rb(9) << std::endl; + + std::cout << "size of b in MB: " << sdsl::size_in_mega_bytes(b) << std::endl; + std::cout << "size of rb in MB: " << sdsl::size_in_mega_bytes(rb) << std::endl; + + sdsl::rrr_vector<127> rrrb(b); + sdsl::rrr_vector<127>::rank_1_type rank_rrrb(&rrrb); + std::cout << rank_rrrb(8) << std::endl; + std::cout << rank_rrrb(9) << std::endl; + + std::cout << "size of rrrb in MB: " << sdsl::size_in_mega_bytes(rrrb) << std::endl; + std::cout << "size of rank_rrrb in MB: " << sdsl::size_in_mega_bytes(rank_rrrb) << std::endl; + + sdsl::rrr_vector<127>::select_1_type select_rrrb(&rrrb); + std::cout << "position of first one in b: " << select_rrrb(1) << std::endl; + + sdsl::bit_vector x; + x = sdsl::bit_vector(10000000, 1); + + sdsl::int_vector<> v(100, 5, 7); + + std::cout << "v[5]=" << v[5] << std::endl; + v[5] = 120; + std::cout << "v[5]=" << v[5] << std::endl; + + sdsl::int_vector<32> w(100, 4); + + sdsl::write_structure(rrrb, std::cout); + std::cout << std::endl; + + return 0; +} diff --git a/recipes/xxsds-sdsl-lite/config.yml b/recipes/xxsds-sdsl-lite/config.yml new file mode 100644 index 0000000000000..2c4bf6c479912 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/config.yml @@ -0,0 +1,5 @@ +versions: + cci.20210329: + folder: "all" + 3.0.0: + folder: "all" diff --git a/recipes/xz_utils/all/conandata.yml b/recipes/xz_utils/all/conandata.yml new file mode 100644 index 0000000000000..da0e232cb7e1a --- /dev/null +++ b/recipes/xz_utils/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "5.4.2": + url: "https://tukaani.org/xz/xz-5.4.2.tar.gz" + sha256: "87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" + "5.4.0": + url: "https://tukaani.org/xz/xz-5.4.0.tar.gz" + sha256: "7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" + "5.2.10": + url: "https://tukaani.org/xz/xz-5.2.10.tar.gz" + sha256: "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" + "5.2.5": + url: "https://tukaani.org/xz/xz-5.2.5.tar.gz" + sha256: "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" + "5.2.4": + url: "https://tukaani.org/xz/xz-5.2.4.tar.gz" + sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" +patches: + "5.2.4": + - patch_file: "patches/0001-relax_windows-sdk-restriction.patch" + patch_description: "Relax Windows SDK restriction" + patch_type: "conan" diff --git a/recipes/xz_utils/all/conanfile.py b/recipes/xz_utils/all/conanfile.py new file mode 100644 index 0000000000000..388fe0cf2e851 --- /dev/null +++ b/recipes/xz_utils/all/conanfile.py @@ -0,0 +1,201 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuild, MSBuildToolchain +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class XZUtilsConan(ConanFile): + name = "xz_utils" + description = ( + "XZ Utils is free general-purpose data compression software with a high " + "compression ratio. XZ Utils were written for POSIX-like systems, but also " + "work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tukaani.org/xz" + topics = ("lzma", "xz", "compression") + license = "Unlicense", "LGPL-2.1-or-later", "GPL-2.0-or-later", "GPL-3.0-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _effective_msbuild_type(self): + # treat "RelWithDebInfo" and "MinSizeRel" as "Release" + # there is no DebugMT configuration in upstream vcxproj, we patch Debug configuration afterwards + return "{}{}".format( + "Debug" if self.settings.build_type == "Debug" else "Release", + "MT" if is_msvc_static_runtime(self) and self.settings.build_type != "Debug" else "", + ) + + @property + def _msbuild_target(self): + return "liblzma_dll" if self.options.shared else "liblzma" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._effective_msbuild_type + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-doc") + if self.settings.build_type == "Debug": + tc.configure_args.append("--enable-debug") + tc.generate() + + @property + def _msvc_sln_folder(self): + if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler) >= "15") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler) >= "191"): + return "vs2017" + return "vs2013" + + def _build_msvc(self): + build_script_folder = os.path.join(self.source_folder, "windows", self._msvc_sln_folder) + + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client. + vcxproj_files = [ + os.path.join(build_script_folder, "liblzma.vcxproj"), + os.path.join(build_script_folder, "liblzma_dll.vcxproj"), + ] + if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler) >= "15") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler) >= "191"): + old_toolset = "v141" + else: + old_toolset = "v120" + new_toolset = MSBuildToolchain(self).toolset + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + for vcxproj_file in vcxproj_files: + replace_in_file( + self, vcxproj_file, + f"{old_toolset}", + f"{new_toolset}", + ) + replace_in_file( + self, vcxproj_file, + "", + f"", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = self._effective_msbuild_type + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(build_script_folder, "xz_win.sln"), targets=[self._msbuild_target]) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + inc_dir = os.path.join(self.source_folder, "src", "liblzma", "api") + copy(self, "*.h", src=inc_dir, dst=os.path.join(self.package_folder, "include")) + output_dir = os.path.join(self.source_folder, "windows") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + rename(self, os.path.join(self.package_folder, "lib", "liblzma.lib"), + os.path.join(self.package_folder, "lib", "lzma.lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path), + ) + + def _create_cmake_module_variables(self, module_file): + # TODO: also add LIBLZMA_HAS_AUTO_DECODER, LIBLZMA_HAS_EASY_ENCODER & LIBLZMA_HAS_LZMA_PRESET + content = textwrap.dedent(f"""\ + set(LIBLZMA_FOUND TRUE) + if(DEFINED LibLZMA_INCLUDE_DIRS) + set(LIBLZMA_INCLUDE_DIRS ${{LibLZMA_INCLUDE_DIRS}}) + endif() + if(DEFINED LibLZMA_LIBRARIES) + set(LIBLZMA_LIBRARIES ${{LibLZMA_LIBRARIES}}) + endif() + set(LIBLZMA_VERSION_MAJOR {Version(self.version).major}) + set(LIBLZMA_VERSION_MINOR {Version(self.version).minor}) + set(LIBLZMA_VERSION_PATCH {Version(self.version).patch}) + set(LIBLZMA_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "LibLZMA") + self.cpp_info.set_property("cmake_target_name", "LibLZMA::LibLZMA") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "liblzma") + self.cpp_info.libs = ["lzma"] + if not self.options.shared: + self.cpp_info.defines.append("LZMA_API_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "LibLZMA" + self.cpp_info.names["cmake_find_package_multi"] = "LibLZMA" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch b/recipes/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch new file mode 100644 index 0000000000000..d9680984def65 --- /dev/null +++ b/recipes/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch @@ -0,0 +1,20 @@ +--- a/windows/vs2017/liblzma.vcxproj ++++ b/windows/vs2017/liblzma.vcxproj +@@ -29,7 +29,6 @@ + + {12728250-16EC-4DC6-94D7-E21DD88947F8} + Win32Proj +- 10.0.15063.0 + + + +--- a/windows/vs2017/liblzma_dll.vcxproj ++++ b/windows/vs2017/liblzma_dll.vcxproj +@@ -29,7 +29,6 @@ + + {E0F247DB-EF12-4755-8DF9-F74BCD1348F7} + Win32Proj +- 10.0.15063.0 + + + diff --git a/recipes/xz_utils/all/test_package/CMakeLists.txt b/recipes/xz_utils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd4e960a3ff01 --- /dev/null +++ b/recipes/xz_utils/all/test_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(LibLZMA REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibLZMA::LibLZMA) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibLZMA.html +# are properly defined in conan generators +set(_custom_vars + LIBLZMA_FOUND + LIBLZMA_INCLUDE_DIRS + LIBLZMA_LIBRARIES + LIBLZMA_VERSION_MAJOR + LIBLZMA_VERSION_MINOR + LIBLZMA_VERSION_PATCH + LIBLZMA_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/xz_utils/all/test_package/conanfile.py b/recipes/xz_utils/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/xz_utils/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xz_utils/all/test_package/test_package.c b/recipes/xz_utils/all/test_package/test_package.c new file mode 100644 index 0000000000000..a1f55ac414846 --- /dev/null +++ b/recipes/xz_utils/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + printf("LZMA version %s\n", lzma_version_string()); + return EXIT_SUCCESS; +} diff --git a/recipes/xz_utils/all/test_v1_package/CMakeLists.txt b/recipes/xz_utils/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xz_utils/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xz_utils/all/test_v1_package/conanfile.py b/recipes/xz_utils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/xz_utils/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xz_utils/config.yml b/recipes/xz_utils/config.yml new file mode 100644 index 0000000000000..326a90e52c837 --- /dev/null +++ b/recipes/xz_utils/config.yml @@ -0,0 +1,11 @@ +versions: + "5.4.2": + folder: all + "5.4.0": + folder: all + "5.2.10": + folder: all + "5.2.5": + folder: all + "5.2.4": + folder: all diff --git a/recipes/yaclib/all/conandata.yml b/recipes/yaclib/all/conandata.yml new file mode 100644 index 0000000000000..728f8d40d44bc --- /dev/null +++ b/recipes/yaclib/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + '2022.12.20': + url: 'https://github.com/YACLib/YACLib/archive/refs/tags/v2022.12.10.tar.gz' + sha256: '30b3e3743daa3ea36244fa9c7e619fdbfed2975e4f8e017a4d973f25fe78bde3' + '2022.10.31': + url: 'https://github.com/YACLib/YACLib/archive/refs/tags/v2022.10.31.tar.gz' + sha256: '81761b1c8e53e6eaeb36fa00183cae66068b85d24c910c0584d0b29b371e143c' +patches: + '2022.10.31': + - patch_file: 'patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch' + patch_description: 'Set 17 standard if not stated otherwise' + patch_type: 'conan' + - patch_file: 'patches/0002-Add-install-commands.patch' + patch_description: 'Add install commands' + patch_type: 'conan' diff --git a/recipes/yaclib/all/conanfile.py b/recipes/yaclib/all/conanfile.py new file mode 100644 index 0000000000000..4c35bd089113e --- /dev/null +++ b/recipes/yaclib/all/conanfile.py @@ -0,0 +1,157 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.scm import Version +from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches, save +from conan.tools.layout import cmake_layout +from conan.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class YACLibConan(ConanFile): + name = "yaclib" + description = "lightweight C++ library for concurrent and parallel task execution" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/YACLib/YACLib" + license = "MIT" + topics = ("async", "parallel", "concurrency") + settings = "os", "arch", "compiler", "build_type" + + _yaclib_flags = { + "warn": [True, False], + "coro": [True, False], + "disable_futex": [True, False], + "disable_unsafe_futex": [True, False], + "disable_symmetric_transfer": [True, False], + "disable_final_suspend_transfer": [True, False], + } + + options = { + "fPIC": [True, False], + **_yaclib_flags, + } + + default_options = { + "fPIC": True, + **{k: False for k in _yaclib_flags}, + } + + @property + def _min_cppstd(self): + return 20 if self.options.coro else 17 + + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 17: + return { + "gcc": "7", + "Visual Studio": "14.20", + "msvc": "192", + "clang": "8", + "apple-clang": "12", + } + return { + "gcc": "12", + "Visual Studio": "16", + "msvc": "192", + "clang": "13", + "apple-clang": "13", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['YACLIB_INSTALL'] = True + if self.settings.compiler.get_safe("cppstd"): + tc.variables["YACLIB_CXX_STANDARD"] = self.settings.compiler.cppstd + + flags = [] + for flag in self._yaclib_flags: + if self.options.get_safe(flag): + flags.append(flag.upper()) + if flags: + tc.variables["YACLIB_FLAGS"] = ";".join(flags) + + tc.generate() + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + 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_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"yaclib": "yaclib::yaclib"} + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "yaclib") + self.cpp_info.set_property("cmake_target_name", "yaclib") + self.cpp_info.set_property("pkg_config_name", "yaclib") + self.cpp_info.libs = ["yaclib"] + if self.options.get_safe("coro"): + if self.settings.compiler.libcxx == "libstdc++11": + self.cpp_info.cxxflags.append("-fcoroutines") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "yaclib" + self.cpp_info.names["cmake_find_package_multi"] = "yaclib" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "yaclib" diff --git a/recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch b/recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch new file mode 100644 index 0000000000000..4bdeb1041a928 --- /dev/null +++ b/recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 13c28b2..53cbb9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,6 +14,12 @@ endif () + + if (YACLIB_CXX_STANDARD) + set(CMAKE_CXX_STANDARD ${YACLIB_CXX_STANDARD}) ++elseif (NOT CORO IN_LIST YACLIB_FLAGS) ++ message("Set default standard to c++17") ++ set(CMAKE_CXX_STANDARD 17) ++else () ++message("Set default standard to c++20") ++ set(CMAKE_CXX_STANDARD 20) + endif () + + set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/recipes/yaclib/all/patches/0002-Add-install-commands.patch b/recipes/yaclib/all/patches/0002-Add-install-commands.patch new file mode 100644 index 0000000000000..8e97ed67b0c96 --- /dev/null +++ b/recipes/yaclib/all/patches/0002-Add-install-commands.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 53cbb9b..ca46fe1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,6 +32,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + list(APPEND CMAKE_MODULE_PATH "${YACLIB_SOURCE_DIR}/cmake") + include(yaclib_flags) + ++if (YACLIB_INSTALL) ++ include(GNUInstallDirs) ++ install(DIRECTORY ${YACLIB_SOURCE_DIR}/include/yaclib TYPE INCLUDE) ++ install(DIRECTORY ${YACLIB_SOURCE_DIR}/include/yaclib_std TYPE INCLUDE) ++ install(DIRECTORY ${YACLIB_BINARY_DIR}/include/yaclib TYPE INCLUDE) ++endif() ++ + add_subdirectory(src) # Create static library + + if (YACLIB_TEST) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c3d624f..80715cb 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -56,3 +56,7 @@ target_include_directories(yaclib + PUBLIC ${YACLIB_BINARY_DIR}/include # for config.hpp + PRIVATE ${YACLIB_SOURCE_DIR}/src + ) ++ ++if (YACLIB_INSTALL) ++ install(TARGETS yaclib) ++endif () diff --git a/recipes/yaclib/all/test_package/CMakeLists.txt b/recipes/yaclib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..244a17672765e --- /dev/null +++ b/recipes/yaclib/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(yaclib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yaclib) + +if(YACLIB_CORO) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/yaclib/all/test_package/conanfile.py b/recipes/yaclib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9ae67f8661d01 --- /dev/null +++ b/recipes/yaclib/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + +class TestPackageConan(ConanFile): + test_type = 'explicit' + generators = 'CMakeDeps', 'VirtualRunEnv' + settings = 'os', 'arch', 'compiler', 'build_type' + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['YACLIB_CORO'] = self.dependencies["yaclib"].options.coro + 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/yaclib/all/test_package/test_package.cpp b/recipes/yaclib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d834e92b5b3cf --- /dev/null +++ b/recipes/yaclib/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include "yaclib/async/contract.hpp" +#include "yaclib/util/result.hpp" + +int main() +{ + auto [f, p] = yaclib::MakeContract(); + + std::move(p).Set(42); + + if (!f.Ready()) + { + return EXIT_FAILURE; + } + + yaclib::Result result = std::move(f).Get(); + + if (std::move(result).Ok() != 42) + { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/yaclib/all/test_v1_package/CMakeLists.txt b/recipes/yaclib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/yaclib/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/yaclib/all/test_v1_package/conanfile.py b/recipes/yaclib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/yaclib/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/yaclib/config.yml b/recipes/yaclib/config.yml new file mode 100644 index 0000000000000..84e61bde4366a --- /dev/null +++ b/recipes/yaclib/config.yml @@ -0,0 +1,5 @@ +versions: + "2022.12.20": + folder: all + "2022.10.31": + folder: all diff --git a/recipes/yajl/all/conandata.yml b/recipes/yajl/all/conandata.yml new file mode 100644 index 0000000000000..21b18ea006ef3 --- /dev/null +++ b/recipes/yajl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.0": + url: "https://github.com/lloyd/yajl/archive/refs/tags/2.1.0.tar.gz" + sha256: "3fb73364a5a30efe615046d07e6db9d09fd2b41c763c5f7d3bfb121cd5c5ac5a" diff --git a/recipes/yajl/all/conanfile.py b/recipes/yajl/all/conanfile.py new file mode 100644 index 0000000000000..ba0bf3ca1a52e --- /dev/null +++ b/recipes/yajl/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir, rename +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.apple import fix_apple_shared_install_name +import os + +required_conan_version = ">=1.53.0" + + +class YAJLConan(ConanFile): + name = "yajl" + description = "A fast streaming JSON parsing library in C" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lloyd/yajl" + topics = ("json", "encoding", "decoding", "manipulation") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + 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, "share")) + + # We need to move the dll from lib to bin in order for it to be found later + if self.settings.os == "Windows": + rename(self, os.path.join(self.package_folder, "lib", "yajl.dll"), os.path.join(self.package_folder, "bin", "yajl.dll")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["yajl"] if self.options.shared else ["yajl_s"] + + # https://github.com/lloyd/yajl/blob/5e3a7856e643b4d6410ddc3f84bc2f38174f2872/src/CMakeLists.txt#L64 + self.cpp_info.set_property("pkg_config_name", "yajl") diff --git a/recipes/yajl/all/test_package/CMakeLists.txt b/recipes/yajl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c1ab399f3fa7c --- /dev/null +++ b/recipes/yajl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package C) + +find_package(yajl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE yajl::yajl) diff --git a/recipes/yajl/all/test_package/conanfile.py b/recipes/yajl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/yajl/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/yajl/all/test_package/test_package.c b/recipes/yajl/all/test_package/test_package.c new file mode 100644 index 0000000000000..9a2af8a9d4996 --- /dev/null +++ b/recipes/yajl/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include +#include +#include + +#define CHK(x) if (x != yajl_gen_status_ok) return 1; + +int main(void) { + printf("Welcome to YAJL v%d.%d.%d!", YAJL_MAJOR, YAJL_MINOR, YAJL_MICRO); + yajl_gen yg; + yajl_gen_status s; + + yg = yajl_gen_alloc(NULL); + CHK(yajl_gen_map_open(yg)); + CHK(yajl_gen_map_close(yg)); + s = yajl_gen_map_close(yg); + + return yajl_gen_generation_complete == s ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/yajl/all/test_v1_package/CMakeLists.txt b/recipes/yajl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/yajl/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/yajl/all/test_v1_package/conanfile.py b/recipes/yajl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/yajl/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/yajl/config.yml b/recipes/yajl/config.yml new file mode 100644 index 0000000000000..dfff490f9a9b6 --- /dev/null +++ b/recipes/yajl/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.0": + folder: all diff --git a/recipes/yaml-cpp/all/conandata.yml b/recipes/yaml-cpp/all/conandata.yml new file mode 100644 index 0000000000000..59546f980c76e --- /dev/null +++ b/recipes/yaml-cpp/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.7.0": + url: "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.7.0.tar.gz" + sha256: "43e6a9fcb146ad871515f0d0873947e5d497a1c9c60c58cb102a97b47208b7c3" + "0.6.3": + url: "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.tar.gz" + sha256: "77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed" +patches: + "0.7.0": + - patch_file: "patches/0001-install-0.7.0.patch" + - patch_file: "patches/0002-libcxx-and-gcc.patch" diff --git a/recipes/yaml-cpp/all/conanfile.py b/recipes/yaml-cpp/all/conanfile.py new file mode 100644 index 0000000000000..1b66ae0cdf060 --- /dev/null +++ b/recipes/yaml-cpp/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, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class YamlCppConan(ConanFile): + name = "yaml-cpp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jbeder/yaml-cpp" + topics = ("yaml", "yaml-parser", "serialization", "data-serialization") + description = "A YAML parser and emitter in C++" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + f"Visual Studio build for {self.name} shared library with MT runtime is not supported" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["YAML_CPP_BUILD_TESTS"] = False + tc.variables["YAML_CPP_BUILD_CONTRIB"] = True + tc.variables["YAML_CPP_BUILD_TOOLS"] = False + tc.variables["YAML_CPP_INSTALL"] = True + tc.variables["YAML_BUILD_SHARED_LIBS"] = self.options.shared + if is_msvc(self): + tc.variables["YAML_MSVC_SHARED_RT"] = not is_msvc_static_runtime(self) + tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"yaml-cpp": "yaml-cpp::yaml-cpp"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "yaml-cpp") + self.cpp_info.set_property("cmake_target_name", "yaml-cpp") + self.cpp_info.set_property("pkg_config_name", "yaml-cpp") + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") + if is_msvc(self): + self.cpp_info.defines.append("_NOEXCEPT=noexcept") + if self.options.shared: + self.cpp_info.defines.append("YAML_CPP_DLL") + + # 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/yaml-cpp/all/patches/0001-install-0.7.0.patch b/recipes/yaml-cpp/all/patches/0001-install-0.7.0.patch new file mode 100644 index 0000000000000..d826281c17c0b --- /dev/null +++ b/recipes/yaml-cpp/all/patches/0001-install-0.7.0.patch @@ -0,0 +1,17 @@ +# see issue https://github.com/jbeder/yaml-cpp/pull/847 +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b230b9e..35dfdca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,9 +24,8 @@ option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIB + cmake_dependent_option(YAML_CPP_BUILD_TESTS + "Enable yaml-cpp tests" ON + "BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) +-cmake_dependent_option(YAML_CPP_INSTALL +- "Enable generation of yaml-cpp install targets" ON +- "CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) ++option(YAML_CPP_INSTALL ++ "Enable generation of yaml-cpp install targets" ON) + cmake_dependent_option(YAML_MSVC_SHARED_RT + "MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON + "MSVC" OFF) diff --git a/recipes/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch b/recipes/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch new file mode 100644 index 0000000000000..2602a4ad72536 --- /dev/null +++ b/recipes/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch @@ -0,0 +1,23 @@ +From 79aa6d53e5718ca44bc01ef05fdda7a849d353e0 Mon Sep 17 00:00:00 2001 +From: mjvankampen +Date: Thu, 15 Jul 2021 22:09:05 +0100 +Subject: [PATCH] Add assert to enable compilation with libcxx + gcc (#947) + +--- + include/yaml-cpp/node/iterator.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/yaml-cpp/node/iterator.h b/include/yaml-cpp/node/iterator.h +index b44723817..1fcf6e400 100644 +--- a/include/yaml-cpp/node/iterator.h ++++ b/include/yaml-cpp/node/iterator.h +@@ -15,6 +15,9 @@ + #include + #include + ++// Assert in place so gcc + libc++ combination properly builds ++static_assert(std::is_constructible::value, "Node must be copy constructable"); ++ + namespace YAML { + namespace detail { + struct iterator_value : public Node, std::pair { diff --git a/recipes/yaml-cpp/all/test_package/CMakeLists.txt b/recipes/yaml-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1872344e829cb --- /dev/null +++ b/recipes/yaml-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(yaml-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/yaml-cpp/all/test_package/conanfile.py b/recipes/yaml-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/yaml-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/yaml-cpp/all/test_package/test_package.cpp b/recipes/yaml-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5d97f127aa1f6 --- /dev/null +++ b/recipes/yaml-cpp/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include "yaml-cpp/yaml.h" + +void parsing_nodes() { + YAML::Node primes = YAML::Load("[2, 3, 5, 7, 11]"); + std::cout << "Size: " << primes.size() << '\n'; +} + +void building_nodes() { + YAML::Emitter emitter; + emitter << YAML::BeginMap; + emitter << YAML::Key << "name"; + emitter << YAML::Value << "Ryan Braun"; + emitter << YAML::Key << "position"; + emitter << YAML::Value << "LF"; + emitter << YAML::EndMap; + std::cout << emitter.c_str() << '\n'; +} + +int main() { + parsing_nodes(); + building_nodes(); + return 0; +} diff --git a/recipes/yaml-cpp/all/test_v1_package/CMakeLists.txt b/recipes/yaml-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/yaml-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/yaml-cpp/all/test_v1_package/conanfile.py b/recipes/yaml-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/yaml-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/yaml-cpp/config.yml b/recipes/yaml-cpp/config.yml new file mode 100644 index 0000000000000..ecd70890a4473 --- /dev/null +++ b/recipes/yaml-cpp/config.yml @@ -0,0 +1,5 @@ +versions: + "0.7.0": + folder: all + "0.6.3": + folder: all diff --git a/recipes/yandex-ozo/all/conandata.yml b/recipes/yandex-ozo/all/conandata.yml new file mode 100644 index 0000000000000..721b757b4db38 --- /dev/null +++ b/recipes/yandex-ozo/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210509": + url: "https://github.com/yandex/ozo/archive/1b06a00ec3cea09108557bbec71cc7a6455dfb6b.tar.gz" + sha256: 97eaa2145be4366c390762e8a4d63e507e8be02a37f2c50e5ba0104a1ca192ee diff --git a/recipes/yandex-ozo/all/conanfile.py b/recipes/yandex-ozo/all/conanfile.py new file mode 100644 index 0000000000000..109eee16dc1f2 --- /dev/null +++ b/recipes/yandex-ozo/all/conanfile.py @@ -0,0 +1,86 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from conans.tools import check_min_cppstd, Version +import os + +required_conan_version = ">=1.33.0" + + +class YandexOzoConan(ConanFile): + name = "yandex-ozo" + description = "C++ header-only library for asynchronous access to PostgreSQL databases using ASIO" + topics = ("ozo", "yandex", "postgres", "postgresql", "cpp17", "database", "db", "asio") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yandex/ozo" + license = "PostgreSQL" + + settings = "os", "compiler" + requires = ("boost/1.76.0", "resource_pool/cci.20210322", "libpq/13.2") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "clang": "5", + "apple-clang": "10", + } + + def _validate_compiler_settings(self): + compiler = self.settings.compiler + if compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + + if not minimum_version: + self.output.warn("ozo requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("ozo requires a compiler that supports at least C++17") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("ozo does currently not support windows") + + self._validate_compiler_settings() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy(pattern="*", dst=os.path.join("include", "ozo"), src=os.path.join(self._source_subfolder, "include", "ozo")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + main_comp = self.cpp_info.components["_ozo"] + main_comp.requires = [ + "boost::boost", "boost::system", "boost::thread", "boost::coroutine", + "resource_pool::resource_pool", + "libpq::pq", + ] + main_comp.defines = [ + "BOOST_HANA_CONFIG_ENABLE_STRING_UDL", + "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT", + ] + main_comp.names["cmake_find_package"] = "ozo" + main_comp.names["cmake_find_package_multi"] = "ozo" + + compiler = self.settings.compiler + version = Version(compiler.version) + if compiler == "clang" or compiler == "apple-clang" or (compiler == "gcc" and version >= 9): + main_comp.cxxflags = [ + "-Wno-gnu-string-literal-operator-template", + "-Wno-gnu-zero-variadic-macro-arguments", + ] + + self.cpp_info.filenames["cmake_find_package"] = "ozo" + self.cpp_info.filenames["cmake_find_package_multi"] = "ozo" + self.cpp_info.names["cmake_find_package"] = "yandex" + self.cpp_info.names["cmake_find_package_multi"] = "yandex" diff --git a/recipes/yandex-ozo/all/test_package/CMakeLists.txt b/recipes/yandex-ozo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3b7c3844b7820 --- /dev/null +++ b/recipes/yandex-ozo/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(PackageTest CXX) + +find_package(ozo REQUIRED CONFIG) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(example request.cpp) +target_compile_features(example PRIVATE cxx_std_17) +target_link_libraries(example PRIVATE yandex::ozo) diff --git a/recipes/yandex-ozo/all/test_package/conanfile.py b/recipes/yandex-ozo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a614ddb69f634 --- /dev/null +++ b/recipes/yandex-ozo/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class YandexOzoTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + 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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/yandex-ozo/all/test_package/request.cpp b/recipes/yandex-ozo/all/test_package/request.cpp new file mode 100644 index 0000000000000..1ed158c16d944 --- /dev/null +++ b/recipes/yandex-ozo/all/test_package/request.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +#include +#include + +#include + +namespace asio = boost::asio; + +// adapted from examples/request.cpp +int main(int argc, char **argv) { + asio::io_context io; + auto conn_info = ozo::connection_info("!!invalid_connection_string"); + + const auto coroutine = [&] (asio::yield_context yield) { + ozo::rows_of result; + ozo::error_code ec; + using namespace ozo::literals; + using namespace std::chrono_literals; + const auto connection = ozo::request(conn_info[io], "SELECT 1"_SQL, 1ns, ozo::into(result), yield[ec]); + }; + + asio::spawn(io, coroutine); + io.run(); + + return 0; +} diff --git a/recipes/yandex-ozo/config.yml b/recipes/yandex-ozo/config.yml new file mode 100644 index 0000000000000..c03d35124053d --- /dev/null +++ b/recipes/yandex-ozo/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210509": + folder: "all" diff --git a/recipes/yas/all/conandata.yml b/recipes/yas/all/conandata.yml new file mode 100644 index 0000000000000..f6e04a419a600 --- /dev/null +++ b/recipes/yas/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "7.0.4": + url: "https://github.com/niXman/yas/archive/7.0.4.zip" + sha256: "0959d5ac0b8354aa9ba1ea88834d4c118634baa2f85c83babba7f7f0abac7863" + "7.0.5": + url: "https://github.com/niXman/yas/archive/7.0.5.zip" + sha256: "9ffcc71d99adced5dcf93d72dc1a7e3fed2b2a3e410fc97c6f923e61577d263f" + "7.1.0": + url: "https://github.com/niXman/yas/archive/7.1.0.zip" + sha256: "93791ddcd74138412a1b9520aad26b8db61d9432a3c8b48bf751fa9db9637003" diff --git a/recipes/yas/all/conanfile.py b/recipes/yas/all/conanfile.py new file mode 100644 index 0000000000000..8cfe2a15884cf --- /dev/null +++ b/recipes/yas/all/conanfile.py @@ -0,0 +1,39 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class YasConan(ConanFile): + name = "yas" + description = "Yet Another Serialization" + topics = ("yas", "serialization", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/niXman/yas" + license = "BSL-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _extract_license(self): + header = tools.load(os.path.join( + self.source_folder, self._source_subfolder, + "include", "yas", "binary_oarchive.hpp")) + license_contents = header[:header.find("#")] \ + .replace("//", "").replace("\n ", "\n").lstrip() + tools.save("LICENSE", license_contents) + + def package(self): + self._extract_license() + self.copy("LICENSE", dst="licenses") + self.copy("*", src=os.path.join(self._source_subfolder, "include"), + dst="include") + + def package_id(self): + self.info.header_only() diff --git a/recipes/yas/all/test_package/CMakeLists.txt b/recipes/yas/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..641059df6fa46 --- /dev/null +++ b/recipes/yas/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/yas/all/test_package/conanfile.py b/recipes/yas/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/yas/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/yas/all/test_package/test_package.cpp b/recipes/yas/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..89596156e4d5b --- /dev/null +++ b/recipes/yas/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +/** + * Example taken from https://github.com/niXman/yas. + */ +#include + +#include +#include + +int main() { + int a = 3; + int aa{}; + short b = 4; + short bb{}; + float c = 3.14; + float cc{}; + + constexpr std::size_t flags = + yas::mem // IO type + |yas::json; // IO format + + auto buf = yas::save( + YAS_OBJECT("myobject", a, b, c) + ); + + yas::load(buf, + YAS_OBJECT_NVP("myobject" + ,("a", aa) + ,("b", bb) + ,("c", cc) + ) + ); + + if(a == aa && b == bb && c == cc) { + return EXIT_SUCCESS; + } + return EXIT_FAILURE; +} diff --git a/recipes/yas/config.yml b/recipes/yas/config.yml new file mode 100644 index 0000000000000..6e9bbf7cfc9b7 --- /dev/null +++ b/recipes/yas/config.yml @@ -0,0 +1,7 @@ +versions: + "7.0.4": + folder: all + "7.0.5": + folder: all + "7.1.0": + folder: all diff --git a/recipes/yasm/all/conandata.yml b/recipes/yasm/all/conandata.yml new file mode 100644 index 0000000000000..54b8e4dfddf30 --- /dev/null +++ b/recipes/yasm/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.3.0": + - url: "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" + sha256: "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f" +patches: + "1.3.0": + - patch_file: "patches/0001-cmake-updates.patch" + patch_description: "CMake 3.0+ compatibility" + patch_type: "conan" diff --git a/recipes/yasm/all/conanfile.py b/recipes/yasm/all/conanfile.py new file mode 100644 index 0000000000000..7e50843bcd47e --- /dev/null +++ b/recipes/yasm/all/conanfile.py @@ -0,0 +1,112 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class YASMConan(ConanFile): + name = "yasm" + package_type = "application" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yasm/yasm" + description = "Yasm is a complete rewrite of the NASM assembler under the 'new' BSD License" + topics = ("yasm", "installer", "assembler") + license = "BSD-2-Clause" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if is_msvc(self): + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version][0], + destination=self.source_folder, strip_root=True) + + def _generate_autotools(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + enable_debug = "yes" if self.settings.build_type == "Debug" else "no" + tc.configure_args.extend([ + f"--enable-debug={enable_debug}", + "--disable-rpath", + "--disable-nls", + ]) + tc.generate() + + def _generate_cmake(self): + tc = CMakeToolchain(self) + tc.cache_variables["YASM_BUILD_TESTS"] = False + # Don't build shared libraries because: + # 1. autotools doesn't build shared libs either + # 2. the shared libs don't support static libc runtime (MT and such) + tc.cache_variables["BUILD_SHARED_LIBS"] = False + tc.generate() + + def generate(self): + if is_msvc(self): + self._generate_cmake() + else: + self._generate_autotools() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="BSD.txt", 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")) + if is_msvc(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "include")) + rmdir(self, os.path.join(self.package_folder, "lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + 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) diff --git a/recipes/yasm/all/patches/0001-cmake-updates.patch b/recipes/yasm/all/patches/0001-cmake-updates.patch new file mode 100644 index 0000000000000..8f43dacf4f240 --- /dev/null +++ b/recipes/yasm/all/patches/0001-cmake-updates.patch @@ -0,0 +1,67 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.0) + PROJECT(yasm) +-CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + if (COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) + endif (COMMAND cmake_policy) +--- a/cmake/modules/YasmMacros.cmake ++++ b/cmake/modules/YasmMacros.cmake +@@ -58,31 +58,31 @@ macro (YASM_ADD_MODULE _module_NAME) + endmacro (YASM_ADD_MODULE) + + macro (YASM_GENPERF _in_NAME _out_NAME) +- get_target_property(_tmp_GENPERF_EXE genperf LOCATION) ++ #get_target_property(_tmp_GENPERF_EXE genperf LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} +- COMMAND ${_tmp_GENPERF_EXE} ${_in_NAME} ${_out_NAME} +- DEPENDS ${_tmp_GENPERF_EXE} ++ COMMAND genperf ${_in_NAME} ${_out_NAME} ++ #DEPENDS ${_tmp_GENPERF_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) + endmacro (YASM_GENPERF) + + macro (YASM_RE2C _in_NAME _out_NAME) +- get_target_property(_tmp_RE2C_EXE re2c LOCATION) ++ #get_target_property(_tmp_RE2C_EXE re2c LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} +- COMMAND ${_tmp_RE2C_EXE} ${ARGN} -o ${_out_NAME} ${_in_NAME} +- DEPENDS ${_tmp_RE2C_EXE} ++ COMMAND re2c ${ARGN} -o ${_out_NAME} ${_in_NAME} ++ #DEPENDS ${_tmp_RE2C_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) + endmacro (YASM_RE2C) + + macro (YASM_GENMACRO _in_NAME _out_NAME _var_NAME) +- get_target_property(_tmp_GENMACRO_EXE genmacro LOCATION) ++ #get_target_property(_tmp_GENMACRO_EXE genmacro LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} +- COMMAND ${_tmp_GENMACRO_EXE} ${_out_NAME} ${_var_NAME} ${_in_NAME} +- DEPENDS ${_tmp_GENMACRO_EXE} ++ COMMAND genmacro ${_out_NAME} ${_var_NAME} ${_in_NAME} ++ #DEPENDS ${_tmp_GENMACRO_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) + endmacro (YASM_GENMACRO) +--- a/modules/preprocs/nasm/CMakeLists.txt ++++ b/modules/preprocs/nasm/CMakeLists.txt +@@ -1,9 +1,9 @@ + add_executable(genversion preprocs/nasm/genversion.c) +-get_target_property(_tmp_GENVERSION_EXE genversion LOCATION) ++#get_target_property(_tmp_GENVERSION_EXE genversion LOCATION) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.mac +- COMMAND ${_tmp_GENVERSION_EXE} ${CMAKE_CURRENT_BINARY_DIR}/version.mac +- DEPENDS ${_tmp_GENVERSION_EXE} ++ COMMAND genversion ${CMAKE_CURRENT_BINARY_DIR}/version.mac ++ #DEPENDS ${_tmp_GENVERSION_EXE} + ) + + YASM_GENMACRO( diff --git a/recipes/yasm/all/test_package/conanfile.py b/recipes/yasm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9f19c7186d640 --- /dev/null +++ b/recipes/yasm/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("yasm --help") diff --git a/recipes/yasm/all/test_v1_package/conanfile.py b/recipes/yasm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5992797490cc6 --- /dev/null +++ b/recipes/yasm/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile +from conan.tools.build import cross_building + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not cross_building(self): + self.run("yasm --help", run_environment=True) diff --git a/recipes/yasm/config.yml b/recipes/yasm/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/yasm/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/yder/all/conandata.yml b/recipes/yder/all/conandata.yml new file mode 100644 index 0000000000000..f6c79182d9b12 --- /dev/null +++ b/recipes/yder/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.4.18": + url: "https://github.com/babelouest/yder/archive/refs/tags/v1.4.18.tar.gz" + sha256: "b69cc81f6630f66468595d151446c00c90abed058f03f82e151591b8598a7598" +patches: + "1.4.18": + - patch_file: "patches/1.4.18-0001-shared-static-conan.patch" + patch_description: "Build shared and static libraries" + patch_type: "portability" diff --git a/recipes/yder/all/conanfile.py b/recipes/yder/all/conanfile.py new file mode 100644 index 0000000000000..d027f053ed062 --- /dev/null +++ b/recipes/yder/all/conanfile.py @@ -0,0 +1,149 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class YderConan(ConanFile): + name = "yder" + description = "Logging library for C applications" + homepage = "https://github.com/babelouest/yder" + topics = ("logging", "stdout", "file", "journald", "systemd") + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libsystemd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libsystemd": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.with_libsystemd + + 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 + + def requirements(self): + self.requires("orcania/2.3.1") + if self.options.get_safe("with_libsystemd"): + self.requires("libsystemd/251.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["DOWNLOAD_DEPENDENCIES"] = False + tc.variables["WITH_JOURNALD"] = self.options.get_safe("with_libsystemd", False) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.options.shared: + if not self.dependencies["orcania"].options.shared: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "Orcania::Orcania", "Orcania::Orcania-static") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", os.path.join(self.source_folder), 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + save(self, os.path.join(self.package_folder, self._variable_file_rel_path), + textwrap.dedent(f"""\ + set(YDER_VERSION_STRING "{self.version}") + """)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {} if self.options.shared else {"Yder::Yder-static": "Yder::Yder"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _variable_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + libname = "yder" + if is_msvc(self) and not self.options.shared: + libname += "-static" + self.cpp_info.libs = [libname] + + target_name = "Yder::Yder" if self.options.shared else "Yder::Yder-static" + self.cpp_info.set_property("cmake_file_name", "Yder") + self.cpp_info.set_property("cmake_target_name", target_name) + self.cpp_info.set_property("cmake_module_file_name", "Yder") + self.cpp_info.set_property("cmake_module_target_name", target_name) + self.cpp_info.set_property("pkg_config_name", "libyder") + self.cpp_info.set_property("cmake_build_modules", [self._variable_file_rel_path]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Yder" + self.cpp_info.filenames["cmake_find_package_multi"] = "Yder" + self.cpp_info.names["cmake_find_package"] = "Yder" + self.cpp_info.names["cmake_find_package_multi"] = "Yder" + self.cpp_info.names["pkg_config"] = "libyder" + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path, self._variable_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, self._variable_file_rel_path] diff --git a/recipes/yder/all/patches/1.4.18-0001-shared-static-conan.patch b/recipes/yder/all/patches/1.4.18-0001-shared-static-conan.patch new file mode 100644 index 0000000000000..0cfb8663d7496 --- /dev/null +++ b/recipes/yder/all/patches/1.4.18-0001-shared-static-conan.patch @@ -0,0 +1,406 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dd30696..2bbd279 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,6 +65,7 @@ list(APPEND CMAKE_MODULE_PATH "${Y_CMAKE_MODULE_PATH}") + + include(GNUInstallDirs) + include(CheckSymbolExists) ++include(CMakePackageConfigHelpers) + + # check if _GNU_SOURCE is available + +@@ -94,83 +95,126 @@ set(LIB_SRC + + # dependencies + +-option(WITH_JOURNALD "Check journald." ON) ++set(WITH_JOURNALD_DEFAULT ON) ++if(WIN32) ++ set(WITH_JOURNALD_DEFAULT OFF) ++endif() ++option(WITH_JOURNALD "Check journald." ${WITH_JOURNALD_DEFAULT}) + + if (WITH_JOURNALD) +- include(FindSystemd) + find_package(Systemd REQUIRED) +- if (SYSTEMD_FOUND) +- set(SYSTEMD_LIBRARIES systemd) +- include_directories(${SYSTEMD_INCLUDE_DIRS}) +- set(Y_DISABLE_JOURNALD OFF) +- endif () ++ set(SYSTEMD_LIBRARIES Systemd::Systemd) ++ set(Y_DISABLE_JOURNALD OFF) + else() + set(Y_DISABLE_JOURNALD ON) ++ set(SYSTEMD_LIBRARIES ) + endif () + +-# shared library ++option(BUILD_SHARED "Build shared library." ON) ++option(BUILD_STATIC "Build static library." OFF) + +-add_library(yder SHARED ${LIB_SRC}) +-if (NOT MSVC) +- set_target_properties(yder PROPERTIES +- COMPILE_OPTIONS -Wextra +- PUBLIC_HEADER "${INC_DIR}/yder.h;${PROJECT_BINARY_DIR}/yder-cfg.h" +- VERSION "${LIBRARY_VERSION}" +- SOVERSION "${LIBRARY_SOVERSION}") +-endif() +-if (WIN32) +- set_target_properties(yder PROPERTIES SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll") ++if (NOT BUILD_SHARED AND NOT BUILD_STATIC) ++ message(FATAL_ERROR "BUILD_SHARED and BUILD_STATIC cannot be both disabled") + endif () + + # static library + +-option(BUILD_STATIC "Build static library." OFF) +- + if (BUILD_STATIC) + add_library(yder_static STATIC ${LIB_SRC}) +- target_compile_definitions(yder_static PUBLIC -DO_STATIC_LIBRARY) ++ add_library(Yder::Yder-static ALIAS yder_static) ++ target_include_directories(yder_static ++ PUBLIC "$" ++ PUBLIC "$" ++ PUBLIC "$") ++ target_compile_definitions(yder_static PUBLIC O_STATIC_LIBRARY) + set_target_properties(yder_static PROPERTIES +- OUTPUT_NAME yder) ++ PUBLIC_HEADER "${INC_DIR}/yder.h;${PROJECT_BINARY_DIR}/yder-cfg.h" ++ OUTPUT_NAME yder ++ EXPORT_NAME Yder-static) ++ if (MSVC) ++ set_target_properties(yder_static PROPERTIES ++ OUTPUT_NAME yder-static) ++ else () ++ target_compile_options(yder_static PRIVATE -Wextra) ++ endif () ++ set(yder_lib yder_static) + endif () + ++# shared library ++ ++if (BUILD_SHARED) ++ add_library(yder SHARED ${LIB_SRC}) ++ add_library(Yder::Yder ALIAS yder) ++ target_include_directories(yder ++ PUBLIC "$" ++ PUBLIC "$" ++ PUBLIC "$") ++ set_target_properties(yder PROPERTIES ++ PUBLIC_HEADER "${INC_DIR}/yder.h;${PROJECT_BINARY_DIR}/yder-cfg.h" ++ VERSION "${LIBRARY_VERSION}" ++ SOVERSION "${LIBRARY_SOVERSION}" ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE ++ EXPORT_NAME Yder) ++ if (WIN32) ++ set_target_properties(yder PROPERTIES ++ SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll") ++ endif () ++ if (NOT MSVC) ++ target_compile_options(yder PRIVATE -Wextra) ++ endif () ++ set(yder_lib yder) ++endif() ++ + option(DOWNLOAD_DEPENDENCIES "Download required dependencies" ON) + + option(SEARCH_ORCANIA "Search for Orcania library" ON) + if (SEARCH_ORCANIA) +- set(Orcania_FIND_QUIETLY ON) # force to find Orcania quietly +- include(FindOrcania) + find_package(Orcania ${ORCANIA_VERSION_REQUIRED} QUIET) # try to find orcania +- if (NOT ORCANIA_FOUND) ++ if (NOT Orcania_FOUND) + if (DOWNLOAD_DEPENDENCIES) + include(DownloadProject) + download_project(PROJ orcania # ... otherwise, download archive +- URL "https://github.com/babelouest/orcania/archive/v${ORCANIA_VERSION_REQUIRED}.tar.gz" +- QUIET) ++ URL "https://github.com/babelouest/orcania/archive/v${ORCANIA_VERSION_REQUIRED}.tar.gz" ++ QUIET) + add_subdirectory(${orcania_SOURCE_DIR} ${orcania_BINARY_DIR}) +- include_directories(${orcania_SOURCE_DIR}/include) +- include_directories(${orcania_BINARY_DIR}) +- add_dependencies(yder orcania) +- set(ORCANIA_LIBRARIES orcania) +- set(LIBS ${LIBS} ${ORCANIA_LIBRARIES}) ++ if (NOT TARGET Orcania::Orcania) ++ add_library(Orcania::Orcania ALIAS orcania) ++ endif () ++ if (NOT TARGET Orcania::Orcania-static AND TARGET orcania_static) ++ add_library(Orcania::Orcania-static ALIAS orcania_static) ++ endif () + else () + message( FATAL_ERROR "Orcania not found") + endif () + else() +- message(STATUS "Orcania found") +- set(LIBS ${LIBS} ${ORCANIA_LIBRARIES}) +- include_directories(${ORCANIA_INCLUDE_DIRS}) +- include_directories(${orcania_BINARY_DIR}) ++ if ("${ORCANIA_VERSION_STRING}" VERSION_GREATER_EQUAL "${ORCANIA_VERSION_REQUIRED}") ++ message(STATUS "Orcania found: ${ORCANIA_VERSION_STRING}") ++ else () ++ message( FATAL_ERROR "Orcania version required: ${ORCANIA_VERSION_REQUIRED} - version installed: ${ORCANIA_VERSION_STRING}") ++ endif () ++ endif () ++else () ++ if (NOT TARGET Orcania:: Orcania) ++ add_library(Orcania::Orcania IMPORTED UNKNOWN) ++ set_target_properties(Orcania::Orcania PROPERTIES IMPORTED_LOCATION "orcania") + endif () + endif () + +-target_link_libraries(yder ${LIBS} ${ORCANIA_LIBRARIES} ${SYSTEMD_LIBRARIES}) ++if (BUILD_SHARED) ++ target_link_libraries(yder PRIVATE $ ${SYSTEMD_LIBRARIES}) ++endif () ++if (BUILD_STATIC) ++ if(TARGET Orcania::Orcania-static) ++ target_link_libraries(yder_static PRIVATE $ ${SYSTEMD_LIBRARIES}) ++ else() ++ target_link_libraries(yder_static PRIVATE $ ${SYSTEMD_LIBRARIES}) ++ endif() ++endif () + ++set(PKGCONF_REQ_PRIVATE "liborcania") ++set(PKGCONF_REQ "") + if (WITH_JOURNALD) +- set(PKGCONF_REQ "") +- set(PKGCONF_REQ_PRIVATE "libsystemd, liborcania") +-else () +- set(PKGCONF_REQ "") +- set(PKGCONF_REQ_PRIVATE "liborcania") ++ string(APPEND PKGCONF_REQ_PRIVATE ", libsystemd") + endif () + + # documentation +@@ -205,11 +249,9 @@ include_directories(${PROJECT_BINARY_DIR}) + option(BUILD_YDER_TESTING "Build the testing tree." OFF) # because we don not use include(CTest) + + if (BUILD_YDER_TESTING) +- include(FindCheck) + find_package(Check) + if (CHECK_FOUND) + if (NOT WIN32 AND NOT APPLE) +- include(FindSubunit) + find_package(Subunit REQUIRED) + endif () + +@@ -218,16 +260,16 @@ if (BUILD_YDER_TESTING) + set(CMAKE_CTEST_COMMAND ctest -V) + + set(TST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test) +- set(LIBS yder ${LIBS} ${CHECK_LIBRARIES} ${ORCANIA_LIBRARIES}) ++ set(TEST_LIBS ${yder_lib} Check::Check) + if (NOT WIN32) + find_package(Threads REQUIRED) +- set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT} m) ++ list(APPEND TEST_LIBS ${CMAKE_THREAD_LIBS_INIT} m) + endif () + if (NOT APPLE) +- set(LIBS ${LIBS} rt) ++ list(APPEND TEST_LIBS rt) + endif () + if (NOT WIN32 AND NOT APPLE) +- set(LIBS ${LIBS} ${SUBUNIT_LIBRARIES}) ++ list(APPEND TEST_LIBS Subunit::Subunit) + endif () + + set(TESTS yder_test) +@@ -239,8 +281,8 @@ if (BUILD_YDER_TESTING) + + foreach (t ${TESTS}) + add_executable(${t} EXCLUDE_FROM_ALL ${TST_DIR}/${t}.c) +- target_include_directories(${t} PUBLIC ${TST_DIR}) +- target_link_libraries(${t} PUBLIC ${LIBS}) ++ target_include_directories(${t} PRIVATE ${TST_DIR}) ++ target_link_libraries(${t} PUBLIC ${TEST_LIBS}) + add_test(NAME ${t} + WORKING_DIRECTORY ${TST_DIR} + COMMAND ${t}) +@@ -269,13 +311,16 @@ configure_file(libyder.pc.in libyder.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libyder.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +-set(TARGETS yder) ++set(TARGETS ) ++if (BUILD_SHARED) ++ list(APPEND TARGETS yder) ++endif () + if (BUILD_STATIC) +- set(TARGETS ${TARGETS} yder_static) ++ list(APPEND TARGETS yder_static) + endif () + + if (INSTALL_HEADER) +- install(TARGETS ${TARGETS} ++ install(TARGETS ${TARGETS} EXPORT YderExports + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +@@ -285,12 +330,33 @@ if (INSTALL_HEADER) + install(FILES README.md + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT runtime) + else () +- install(TARGETS ${TARGETS} ++ install(TARGETS ${TARGETS} EXPORT YderExports + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif () + ++set(YDER_INSTALL_CMAKEDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/cmake/Yder") ++if (WIN32 AND NOT MINGW) ++ set(YDER_INSTALL_CMAKEDIR_DEFAULT "cmake") ++endif () ++set(YDER_INSTALL_CMAKEDIR ${YDER_INSTALL_CMAKEDIR_DEFAULT} CACHE STRING "Location where to install the cmake config files") ++ ++install(EXPORT YderExports DESTINATION "${YDER_INSTALL_CMAKEDIR}" ++ NAMESPACE "Yder::" ++ FILE "YderTargets.cmake") ++ ++configure_package_config_file(cmake-modules/YderConfig.cmake.in YderConfig.cmake ++ INSTALL_DESTINATION "${YDER_INSTALL_CMAKEDIR}") ++write_basic_package_version_file(YderConfigVersion.cmake ++ COMPATIBILITY AnyNewerVersion) ++ ++install(FILES ++ cmake-modules/FindSystemd.cmake ++ "${PROJECT_BINARY_DIR}/YderConfig.cmake" ++ "${PROJECT_BINARY_DIR}/YderConfigVersion.cmake" ++ DESTINATION "${YDER_INSTALL_CMAKEDIR}") ++ + # uninstall target + + if (NOT TARGET uninstall) +@@ -357,6 +423,7 @@ add_custom_target(dist_y + COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + + message(STATUS "Journald support: ${WITH_JOURNALD}") ++message(STATUS "Build shared library: ${BUILD_SHARED}") + message(STATUS "Build static library: ${BUILD_STATIC}") + message(STATUS "Build testing tree: ${BUILD_YDER_TESTING}") + message(STATUS "Install the header files: ${INSTALL_HEADER}") +diff --git a/cmake-modules/FindCheck.cmake b/cmake-modules/FindCheck.cmake +index 4aad6bc..16d73ef 100644 +--- a/cmake-modules/FindCheck.cmake ++++ b/cmake-modules/FindCheck.cmake +@@ -68,6 +68,12 @@ find_package_handle_standard_args(Check + if (CHECK_FOUND) + set(CHECK_LIBRARIES ${CHECK_LIBRARY}) + set(CHECK_INCLUDE_DIRS ${CHECK_INCLUDE_DIR}) ++ if (NOT TARGET Check::Check) ++ add_library(Check::Check UNKNOWN IMPORTED) ++ set_target_properties(Check::Check PROPERTIES ++ IMPORTED_LOCATION "${CHECK_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${CHECK_INCLUDE_DIR}") ++ endif () + endif () + + mark_as_advanced(CHECK_INCLUDE_DIR CHECK_LIBRARY) +\ No newline at end of file +diff --git a/cmake-modules/FindOrcania.cmake b/cmake-modules/FindOrcania.cmake +index 0d40a07..1a42c07 100644 +--- a/cmake-modules/FindOrcania.cmake ++++ b/cmake-modules/FindOrcania.cmake +@@ -39,7 +39,7 @@ find_path(ORCANIA_INCLUDE_DIR + HINTS ${PC_ORCANIA_INCLUDEDIR} ${PC_ORCANIA_INCLUDE_DIRS}) + + find_library(ORCANIA_LIBRARY +- NAMES orcania liborcania ++ NAMES orcania liborcania orcania-static + HINTS ${PC_ORCANIA_LIBDIR} ${PC_ORCANIA_LIBRARY_DIRS}) + + set(ORCANIA_VERSION_STRING 0.0.0) +@@ -72,6 +72,12 @@ endif () + if (ORCANIA_FOUND) + set(ORCANIA_LIBRARIES ${ORCANIA_LIBRARY}) + set(ORCANIA_INCLUDE_DIRS ${ORCANIA_INCLUDE_DIR}) ++ if (NOT TARGET Orcania::Orcania) ++ add_library(Orcania::Orcania UNKNOWN IMPORTED) ++ set_target_properties(Orcania::Orcania PROPERTIES ++ IMPORTED_LOCATION "${ORCANIA_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${ORCANIA_INCLUDE_DIR}") ++ endif () + endif () + + mark_as_advanced(ORCANIA_INCLUDE_DIR ORCANIA_LIBRARY) +diff --git a/cmake-modules/FindSubunit.cmake b/cmake-modules/FindSubunit.cmake +index 4ce3a24..700b5bc 100644 +--- a/cmake-modules/FindSubunit.cmake ++++ b/cmake-modules/FindSubunit.cmake +@@ -54,6 +54,12 @@ find_package_handle_standard_args(Subunit + if (SUBUNIT_FOUND) + set(SUBUNIT_LIBRARIES ${SUBUNIT_LIBRARY}) + set(SUBUNIT_INCLUDE_DIRS ${SUBUNIT_INCLUDE_DIR}) ++ if (NOT TARGET Subunit::Subunit) ++ add_library(Subunit::Subunit UNKNOWN IMPORTED) ++ set_target_properties(Subunit::Subunit PROPERTIES ++ IMPORTED_LOCATION "${SUBUNIT_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${SUBUNIT_INCLUDE_DIR}") ++ endif () + endif () + + mark_as_advanced(SUBUNIT_INCLUDE_DIR SUBUNIT_LIBRARY) +\ No newline at end of file +diff --git a/cmake-modules/FindSystemd.cmake b/cmake-modules/FindSystemd.cmake +index e212b95..3a28697 100644 +--- a/cmake-modules/FindSystemd.cmake ++++ b/cmake-modules/FindSystemd.cmake +@@ -50,5 +50,11 @@ find_package_handle_standard_args(Systemd + if (SYSTEMD_FOUND) + set(SYSTEMD_LIBRARIES ${SYSTEMD_LIBRARY}) + set(SYSTEMD_INCLUDE_DIRS ${SYSTEMD_INCLUDE_DIR}) ++ if (NOT TARGET Systemd:Systemd) ++ add_library(Systemd::Systemd IMPORTED UNKNOWN) ++ set_target_properties(Systemd::Systemd PROPERTIES ++ IMPORTED_LOCATION "${SYSTEMD_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${SYSTEMD_INCLUDE_DIR}") ++ endif () + endif () + mark_as_advanced(SYSTEMD_INCLUDE_DIR SYSTEMD_LIBRARY) +diff --git a/cmake-modules/YderConfig.cmake.in b/cmake-modules/YderConfig.cmake.in +new file mode 100644 +index 0000000..eaa89da +--- /dev/null ++++ b/cmake-modules/YderConfig.cmake.in +@@ -0,0 +1,32 @@ ++@PACKAGE_INIT@ ++ ++include("${CMAKE_CURRENT_LIST_DIR}/YderTargets.cmake") ++ ++set(YDER_JOURNALD @WITH_JOURNALD@) ++ ++set(CMAKE_CURRENT_LIST_DIR ${_original_cmake_module_path}) ++ ++if(TARGET Yder::Yder-static) ++ set(ORCANIA_INCLUDE_DIRS $) ++ set(ORCANIA_LIBRARIES Yder::Yder-static) ++endif() ++ ++if(TARGET Yder::Yder) ++ set(ORCANIA_INCLUDE_DIRS $) ++ set(ORCANIA_LIBRARIES Yder::Yder) ++endif() ++ ++include(CMakeFindDependencyMacro) ++ ++set(_original_cmake_module_path ${CMAKE_MODULE_PATH}) ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") ++ ++find_dependency(Orcania) ++set(YDER_VERSION_STRING "@PACKAGE_VERSION@") ++if(TARGET Yder::Yder-static) ++ if(YDER_JOURNALD) ++ find_dependency(Systemd) ++ endif() ++endif() ++set(CMAKE_MODULE_PATH ${_original_cmake_module_path}) ++set(Yder_FOUND TRUE) +diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg +index e8f2b8b..8ac5f16 100644 diff --git a/recipes/yder/all/test_package/CMakeLists.txt b/recipes/yder/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..604a54d72e91e --- /dev/null +++ b/recipes/yder/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Yder REQUIRED CONFIG) + +option(YDER_SHARED "Yder is built as a shared library") + +add_executable(${PROJECT_NAME} test_package.c) +if(YDER_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Yder::Yder) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Yder::Yder-static) +endif() diff --git a/recipes/yder/all/test_package/conanfile.py b/recipes/yder/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0585cd25bd7ad --- /dev/null +++ b/recipes/yder/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["YDER_SHARED"] = self.dependencies["yder"].options.shared + 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/yder/all/test_package/test_package.c b/recipes/yder/all/test_package/test_package.c new file mode 100644 index 0000000000000..0892f7d0a7c3a --- /dev/null +++ b/recipes/yder/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +int main() { + y_init_logs("test_package", Y_LOG_MODE_CONSOLE, Y_LOG_LEVEL_DEBUG, NULL, "Logging started"); + y_log_message(Y_LOG_LEVEL_INFO, "We started"); + y_log_message(Y_LOG_LEVEL_DEBUG, "Are we really?"); + y_log_message(Y_LOG_LEVEL_WARNING, "We have nothing to do!"); + y_log_message(Y_LOG_LEVEL_ERROR, "Oops!"); + y_log_message(Y_LOG_LEVEL_INFO, "Bye then!"); + y_close_logs(); + return 0; +} diff --git a/recipes/yder/all/test_v1_package/CMakeLists.txt b/recipes/yder/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..376a5ed06c20a --- /dev/null +++ b/recipes/yder/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Yder REQUIRED CONFIG) + +option(YDER_SHARED "Yder is built as a shared library") + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(YDER_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Yder::Yder) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Yder::Yder-static) +endif() diff --git a/recipes/yder/all/test_v1_package/conanfile.py b/recipes/yder/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..af01824ff624e --- /dev/null +++ b/recipes/yder/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["YDER_SHARED"] = self.options["yder"].shared + 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/yder/config.yml b/recipes/yder/config.yml new file mode 100644 index 0000000000000..76bddfaab892d --- /dev/null +++ b/recipes/yder/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.18": + folder: all diff --git a/recipes/yojimbo/all/conandata.yml b/recipes/yojimbo/all/conandata.yml new file mode 100644 index 0000000000000..4b5ed2575f3f5 --- /dev/null +++ b/recipes/yojimbo/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.1": + url: "https://github.com/networkprotocol/yojimbo/archive/refs/tags/v1.2.1.tar.gz" + sha256: "293033a8a85ce5d210db6e99da337bc9307a02e8afe5e38afefc694c13359e71" diff --git a/recipes/yojimbo/all/conanfile.py b/recipes/yojimbo/all/conanfile.py new file mode 100644 index 0000000000000..96de2407727bd --- /dev/null +++ b/recipes/yojimbo/all/conanfile.py @@ -0,0 +1,117 @@ +import os +from conans import ConanFile, MSBuild, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import yaml + + +class YojimboConan(ConanFile): + name = "yojimbo" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/networkprotocol/yojimbo" + topics = ("conan", "yojimbo", "game", "udp", "protocol", "client-server", "multiplayer-game-server") + description = "A network library for client/server games written in C++" + license = "BSD-3-Clause" + exports = "submoduledata.yml" + build_requires = "premake/5.0.0-alpha15" + settings = "os", "arch", "compiler", "build_type" + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + + def configure(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Only 64-bit architecture supported") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def requirements(self): + self.requires("libsodium/1.0.18") + self.requires("mbedtls/2.25.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + submodule_filename = os.path.join(self.recipe_folder, 'submoduledata.yml') + with open(submodule_filename, 'r') as submodule_stream: + submodules_data = yaml.load(submodule_stream) + for path, submodule in submodules_data["submodules"][self.version].items(): + submodule_data = { + "url": submodule["url"], + "sha256": submodule["sha256"], + "destination": os.path.join(self._source_subfolder, submodule["destination"]), + "strip_root": True + } + + tools.get(**submodule_data) + submodule_source = os.path.join(self._source_subfolder, path) + tools.rmdir(submodule_source) + + def build(self): + + # Before building we need to make some edits to the premake file to build using conan dependencies rather than local/bundled + + # Generate the list of dependency include and library paths as strings + include_path_str = ', '.join('"{0}"'.format(p) for p in self.deps_cpp_info["libsodium"].include_paths + self.deps_cpp_info["mbedtls"].include_paths) + lib_path_str = ', '.join('"{0}"'.format(p) for p in self.deps_cpp_info["libsodium"].lib_paths + self.deps_cpp_info["mbedtls"].lib_paths) + + premake_path = os.path.join(self._source_subfolder, "premake5.lua") + + if self.settings.os == "Windows": + + # Replace Windows directory seperator + include_path_str = include_path_str.replace("\\", "/") + lib_path_str = lib_path_str.replace("\\", "/") + + # Edit the premake script to use conan rather than bundled dependencies + tools.replace_in_file(premake_path, "includedirs { \".\", \"./windows\"", "includedirs { \".\", %s" % include_path_str, strict=True) + tools.replace_in_file(premake_path, "libdirs { \"./windows\" }", "libdirs { %s }" % lib_path_str, strict=True) + + # Edit the premake script to change the name of libsodium + tools.replace_in_file(premake_path, "\"sodium\"", "\"libsodium\"", strict=True) + + else: + + # Edit the premake script to use conan rather than local dependencies + tools.replace_in_file(premake_path, "\"/usr/local/include\"", include_path_str, strict=True) + + + # Build using premake + + if self.settings.compiler == "Visual Studio": + generator = "vs" + {"16": "2019", + "15": "2017", + "14": "2015", + "12": "2013", + "11": "2012", + "10": "2010", + "9": "2008", + "8": "2005"}.get(str(self.settings.compiler.version)) + else: + generator = "gmake2" + + with tools.chdir(self._source_subfolder): + self.run("premake5 %s" % generator) + + if self.settings.compiler == "Visual Studio": + msbuild = MSBuild(self) + msbuild.build("Yojimbo.sln") + else: + config = "debug" if self.settings.build_type == "Debug" else "release" + config += "_x64" + env_build = AutoToolsBuildEnvironment(self) + env_build.make(args=["config=%s" % config]) + + + def package(self): + self.copy(pattern="LICENCE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="yojimbo.h", dst="include", src=self._source_subfolder) + + self.copy(pattern="*/yojimbo.lib", dst="lib", keep_path=False) + self.copy(pattern="*/libyojimbo.a", dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/yojimbo/all/submoduledata.yml b/recipes/yojimbo/all/submoduledata.yml new file mode 100644 index 0000000000000..ebf3c3eda783a --- /dev/null +++ b/recipes/yojimbo/all/submoduledata.yml @@ -0,0 +1,10 @@ +submodules: + "1.2.1": + "deps/netcode": + sha256: 1e566e533f9bf89000bde5c29ab3c7fbe73a6b4f3a099257ad2ae626bbe591df + url: https://github.com/networkprotocol/netcode/archive/b5173ce38ad33147d5f136f8b361ec0388efec67.zip + destination: "netcode.io" + "deps/reliable": + sha256: fdfda89fa84075efe19ef364ca63bb12caf2d823e7cb23df821924ed9efdd50a + url: https://github.com/networkprotocol/reliable/archive/7daaef586446bb7162c358b5c0666802e1e8c8db.zip + destination: "reliable.io" diff --git a/recipes/yojimbo/all/test_package/CMakeLists.txt b/recipes/yojimbo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..04e93484921eb --- /dev/null +++ b/recipes/yojimbo/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1.0) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/yojimbo/all/test_package/conanfile.py b/recipes/yojimbo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/yojimbo/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/yojimbo/all/test_package/test_package.cpp b/recipes/yojimbo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c2571a92dbdc9 --- /dev/null +++ b/recipes/yojimbo/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include + +using namespace yojimbo; + +int main() +{ + if (!InitializeYojimbo()) + { + std::cout << "Failed to initialize Yojimbo!\n"; + return 1; + } + + std::cout << "Succesfully initialized Yojimbo\n"; + + ShutdownYojimbo(); + + return 0; +} diff --git a/recipes/yojimbo/config.yml b/recipes/yojimbo/config.yml new file mode 100644 index 0000000000000..b230418434b61 --- /dev/null +++ b/recipes/yojimbo/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.1": + folder: all diff --git a/recipes/yyjson/all/conandata.yml b/recipes/yyjson/all/conandata.yml new file mode 100644 index 0000000000000..683231e89f238 --- /dev/null +++ b/recipes/yyjson/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.6.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.6.0.tar.gz" + sha256: "75aa65d2944b3f64ce5918aa3da00f738dc695a0e8e0662de0063aafe1a8662f" + "0.5.1": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.5.1.tar.gz" + sha256: "b484d40b4e20cc3174a6fdc160d0f20f961417f9cb3f6dc1cf6555fffa8359f3" + "0.5.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.5.0.tar.gz" + sha256: "1a65c41d25394c979ad26554a0befb8006ecbf9f7f3a5b0130fdae4f2dd03d42" + "0.4.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.4.0.tar.gz" + sha256: "061fe713391d7f3f85f13e8bb2752a4cdeb8e70ce20d68e1e9e4332bd0bf64fa" + "0.3.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.3.0.tar.gz" + sha256: "f5ad3e3be40f0307a732c2b8aff9a1ba6014a6b346f3ec0b128459607748e990" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py new file mode 100644 index 0000000000000..5fd04cf964be2 --- /dev/null +++ b/recipes/yyjson/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class YyjsonConan(ConanFile): + name = "yyjson" + description = "A high performance JSON library written in ANSI C." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ibireme/yyjson" + topics = ("yyjson", "json", "serialization", "deserialization") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "yyjson") + self.cpp_info.set_property("cmake_target_name", "yyjson::yyjson") + self.cpp_info.libs = ["yyjson"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("YYJSON_IMPORTS") diff --git a/recipes/yyjson/all/test_package/CMakeLists.txt b/recipes/yyjson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..147497b6b55a6 --- /dev/null +++ b/recipes/yyjson/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(yyjson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE yyjson::yyjson) diff --git a/recipes/yyjson/all/test_package/conanfile.py b/recipes/yyjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/yyjson/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/yyjson/all/test_package/test_package.c b/recipes/yyjson/all/test_package/test_package.c new file mode 100644 index 0000000000000..58f4a2835cc30 --- /dev/null +++ b/recipes/yyjson/all/test_package/test_package.c @@ -0,0 +1,29 @@ +#include + +#include +#include + +int main(void) { + const char *json = "{\"name\":\"Mash\",\"star\":4,\"hits\":[2,2,1,3]}"; + + yyjson_doc *doc = yyjson_read(json, strlen(json), 0); + yyjson_val *root = yyjson_doc_get_root(doc); + + yyjson_val *name = yyjson_obj_get(root, "name"); + printf("name: %s\n", yyjson_get_str(name)); + printf("name length:%d\n", (int)yyjson_get_len(name)); + + yyjson_val *star = yyjson_obj_get(root, "star"); + printf("star: %d\n", (int)yyjson_get_int(star)); + + yyjson_val *hits = yyjson_obj_get(root, "hits"); + size_t idx, max; + yyjson_val *hit; + yyjson_arr_foreach(hits, idx, max, hit) { + printf("hit%d: %d\n", (int)idx, (int)yyjson_get_int(hit)); + } + + yyjson_doc_free(doc); + + return 0; +} diff --git a/recipes/yyjson/all/test_v1_package/CMakeLists.txt b/recipes/yyjson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/yyjson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/yyjson/all/test_v1_package/conanfile.py b/recipes/yyjson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/yyjson/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/yyjson/config.yml b/recipes/yyjson/config.yml new file mode 100644 index 0000000000000..c1abc92e2b1b8 --- /dev/null +++ b/recipes/yyjson/config.yml @@ -0,0 +1,11 @@ +versions: + "0.6.0": + folder: all + "0.5.1": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all + "0.3.0": + folder: all diff --git a/recipes/z3/all/CMakeLists.txt b/recipes/z3/all/CMakeLists.txt new file mode 100644 index 0000000000000..9304b61295329 --- /dev/null +++ b/recipes/z3/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/z3/all/conandata.yml b/recipes/z3/all/conandata.yml new file mode 100644 index 0000000000000..5f25ce5da1c6e --- /dev/null +++ b/recipes/z3/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "4.8.8": + url: "https://github.com/Z3Prover/z3/archive/z3-4.8.8.tar.gz" + sha256: "6962facdcdea287c5eeb1583debe33ee23043144d0e5308344e6a8ee4503bcff" + "4.10.2": + url: "https://github.com/Z3Prover/z3/archive/z3-4.10.2.tar.gz" + sha256: "889fd035b833775c8cd2eb4723eb011bf916a3e9bf08ce66b31c548acee7a321" + +patches: + "4.8.8": + - patch_file: "patches/0001-cmake-use-conan-mpir-4.8.8.patch" + patch_description: "Support building with MPIR" + patch_type: "conan" + base_path: "source_subfolder" + + - patch_file: "patches/0002-python-interp-3-4.8.8.patch" + patch_description: "Fix finding the Python interpreter" + patch_type: "backport" + base_path: "source_subfolder" + + "4.10.2": + - patch_file: "patches/0001-cmake-use-conan-mpir-4.10.2.patch" + patch_description: "Support building with MPIR" + patch_type: "conan" + base_path: "source_subfolder" + + - patch_file: "patches/0003-cmake-try-compile-flags-4.10.2.patch" + patch_description: "Fix flag transmission to CMake try_compile" + patch_type: "portability" + base_path: "source_subfolder" diff --git a/recipes/z3/all/conanfile.py b/recipes/z3/all/conanfile.py new file mode 100644 index 0000000000000..1fa41bab49793 --- /dev/null +++ b/recipes/z3/all/conanfile.py @@ -0,0 +1,159 @@ +from conans import CMake, ConanFile, tools +from conan.tools.files import apply_conandata_patches, get, rmdir +from conan.tools.scm import Version +from conan.errors import ConanException, ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class Z3Conan(ConanFile): + name = "z3" + description = "The Z3 Theorem Prover" + topics = ("z3", "theorem", "smt", "satisfiability", "prover", "solver") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Z3Prover/z3" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "multithreaded": [True, False], + "multiprecision": ["internal", "gmp", "mpir"] + } + default_options = { + "shared": False, + "fPIC": True, + "multithreaded": True, + "multiprecision": "gmp" + } + + 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"]) + + 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.multiprecision == "internal": + self.provides.append("gmp") + + def requirements(self): + self.output.info( + f"{self.name} will build using {self.options.multiprecision} multiprecision implementation.") + if self.options.multiprecision == "mpir": + self.requires("mpir/3.0.0") + elif self.options.multiprecision == "gmp": + self.requires("gmp/6.2.1") + elif self.options.multiprecision == "internal": + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["Z3_USE_LIB_GMP"] = self.options.multiprecision != "internal" + self._cmake.definitions["Z3_USE_LIB_MPIR"] = self.options.multiprecision == "mpir" + self._cmake.definitions["SINGLE_THREADED"] = not self.options.multithreaded + self._cmake.definitions["Z3_BUILD_LIBZ3_SHARED"] = self.options.shared + self._cmake.definitions["Z3_INCLUDE_GIT_HASH"] = False + self._cmake.definitions["Z3_INCLUDE_GIT_DESCRIBE"] = False + self._cmake.definitions["Z3_ENABLE_EXAMPLE_TARGETS"] = False + self._cmake.definitions["Z3_BUILD_DOCUMENTATION"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + if Version(self.version) >= "4.8.11": + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + compiler = self.settings.compiler + min_version = self._compilers_minimum_version\ + .get(str(compiler), False) + if min_version: + if Version(compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++17, which {compiler} {compiler.version} does not support.") + else: + self.output.info( + f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + + def build(self): + apply_conandata_patches(self) + + if self.options.multiprecision == "mpir": + tools.save(os.path.join(self._build_subfolder, "gmp.h"), textwrap.dedent("""\ + #pragma once + #include + """)) + + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Z3") + self.cpp_info.set_property("cmake_target_name", "z3::libz3") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libz3"].libs = [ + "libz3" if self.settings.os == "Windows" else "z3"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libz3"]\ + .system_libs.extend(["pthread", "m"]) + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Z3" + self.cpp_info.filenames["cmake_find_package_multi"] = "Z3" + self.cpp_info.names["cmake_find_package"] = "z3" + self.cpp_info.names["cmake_find_package_multi"] = "z3" + self.cpp_info.components["libz3"].names["cmake_find_package"] = "libz3" + self.cpp_info.components["libz3"].names["cmake_find_package_multi"] = "libz3" + self.cpp_info.components["libz3"].set_property( + "cmake_target_name", "z3::libz3") + + libz3_requirements = [] + if self.options.multiprecision == "mpir": + libz3_requirements.append("mpir::mpir") + elif self.options.multiprecision == "gmp": + libz3_requirements.append("gmp::gmp") + elif self.options.multiprecision == "internal": + pass + self.cpp_info.components["libz3"].requires = libz3_requirements diff --git a/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch b/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch new file mode 100644 index 0000000000000..c510cb76b177f --- /dev/null +++ b/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch @@ -0,0 +1,22 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -242,10 +242,16 @@ + if (Z3_USE_LIB_GMP) + # Because this is off by default we will make the configure fail if libgmp + # can't be found +- find_package(GMP REQUIRED) +- message(STATUS "Using libgmp") +- list(APPEND Z3_DEPENDENT_LIBS GMP::GMP) ++ if (Z3_USE_LIB_MPIR) ++ message(STATUS "Using libmpir") ++ list(APPEND Z3_DEPENDENT_LIBS CONAN_PKG::mpir) ++ else() ++ message(STATUS "Using libgmp") ++ find_package(GMP REQUIRED) ++ list(APPEND Z3_DEPENDENT_LIBS GMP::GMP) ++ endif() ++ list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS "${CMAKE_BINARY_DIR}" ${CONAN_INCLUDE_DIRS}) + list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_GMP") + else() + list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_INTERNAL") + message(STATUS "Not using libgmp") diff --git a/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch b/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch new file mode 100644 index 0000000000000..d7ee939df7e2f --- /dev/null +++ b/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch @@ -0,0 +1,23 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -246,10 +246,16 @@ + if (Z3_USE_LIB_GMP) + # Because this is off by default we will make the configure fail if libgmp + # can't be found +- find_package(GMP REQUIRED) +- message(STATUS "Using libgmp") +- list(APPEND Z3_DEPENDENT_LIBS ${GMP_C_LIBRARIES}) +- list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS ${GMP_INCLUDE_DIRS}) ++ if (Z3_USE_LIB_MPIR) ++ message(STATUS "Using libmpir") ++ list(APPEND Z3_DEPENDENT_LIBS CONAN_PKG::mpir) ++ else() ++ message(STATUS "Using libgmp") ++ find_package(GMP REQUIRED) ++ list(APPEND Z3_DEPENDENT_LIBS ${GMP_C_LIBRARIES}) ++ list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS ${GMP_INCLUDE_DIRS}) ++ endif() ++ list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS "${CMAKE_BINARY_DIR}" ${CONAN_INCLUDE_DIRS}) + list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_GMP") + else() + list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_INTERNAL") diff --git a/recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch b/recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch new file mode 100644 index 0000000000000..5f497703b3de0 --- /dev/null +++ b/recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -169,7 +169,7 @@ + ################################################################################ + # Find Python + ################################################################################ +-find_package(PythonInterp REQUIRED) ++find_package(PythonInterp 3 REQUIRED) + message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") + + ################################################################################ diff --git a/recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch b/recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch new file mode 100644 index 0000000000000..0a19de4afbb27 --- /dev/null +++ b/recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch @@ -0,0 +1,17 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1,2 +1,2 @@ + # Enforce some CMake policies +-cmake_minimum_required(VERSION 3.4) ++cmake_minimum_required(VERSION 3.8) +@@ -179,9 +179,10 @@ + ################################################################################ + # C++ language version + ################################################################################ + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) ++cmake_policy(SET CMP0067 NEW) # ensures try_compile uses the same standard + + ################################################################################ + # Platform detection + ################################################################################ diff --git a/recipes/z3/all/test_package/CMakeLists.txt b/recipes/z3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..04cd4a68ceb59 --- /dev/null +++ b/recipes/z3/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Z3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE z3::libz3) diff --git a/recipes/z3/all/test_package/conanfile.py b/recipes/z3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/z3/all/test_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/z3/all/test_package/test_package.cpp b/recipes/z3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..952704555d235 --- /dev/null +++ b/recipes/z3/all/test_package/test_package.cpp @@ -0,0 +1,145 @@ +#include "z3.h" + +#include +#include + +/* Adapted from z3/examples/c/test_capi.c */ + +/** + \brief Simpler error handler. + */ +static void error_handler(Z3_context c, Z3_error_code e) +{ + fprintf(stderr, "Error code: %d\n", e); + fprintf(stderr, "incorrect use of Z3\n"); + exit(1); +} + +/** + \brief Create a logical context. + + Enable model construction. Other configuration parameters can be passed in the cfg variable. + + Also enable tracing to stderr and register custom error handler. +*/ +static Z3_context mk_context_custom(Z3_config cfg, Z3_error_handler err) +{ + Z3_context ctx; + + Z3_set_param_value(cfg, "model", "true"); + ctx = Z3_mk_context(cfg); + Z3_set_error_handler(ctx, err); + + return ctx; +} + +/** + \brief Create a logical context. + + Enable model construction only. + + Also enable tracing to stderr and register standard error handler. +*/ +static Z3_context mk_context() +{ + Z3_config cfg; + Z3_context ctx; + cfg = Z3_mk_config(); + ctx = mk_context_custom(cfg, error_handler); + Z3_del_config(cfg); + return ctx; +} + +Z3_solver mk_solver(Z3_context ctx) +{ + Z3_solver s = Z3_mk_solver(ctx); + Z3_solver_inc_ref(ctx, s); + return s; +} + +static void del_solver(Z3_context ctx, Z3_solver s) +{ + Z3_solver_dec_ref(ctx, s); +} + +/** + @name Examples +*/ +/*@{*/ +/** + \brief "Hello world" example: create a Z3 logical context, and delete it. +*/ +void simple_example() +{ + Z3_context ctx; + printf("\nsimple_example\n"); + + ctx = mk_context(); + + /* delete logical context */ + Z3_del_context(ctx); +} + +/** + Demonstration of how Z3 can be used to prove validity of + De Morgan's Duality Law: {e not(x and y) <-> (not x) or ( not y) } +*/ +void demorgan() +{ + Z3_config cfg; + Z3_context ctx; + Z3_solver s; + Z3_sort bool_sort; + Z3_symbol symbol_x, symbol_y; + Z3_ast x, y, not_x, not_y, x_and_y, ls, rs, conjecture, negated_conjecture; + Z3_ast args[2]; + + printf("\nDeMorgan\n"); + + cfg = Z3_mk_config(); + ctx = Z3_mk_context(cfg); + Z3_del_config(cfg); + bool_sort = Z3_mk_bool_sort(ctx); + symbol_x = Z3_mk_int_symbol(ctx, 0); + symbol_y = Z3_mk_int_symbol(ctx, 1); + x = Z3_mk_const(ctx, symbol_x, bool_sort); + y = Z3_mk_const(ctx, symbol_y, bool_sort); + + /* De Morgan - with a negation around */ + /* !(!(x && y) <-> (!x || !y)) */ + not_x = Z3_mk_not(ctx, x); + not_y = Z3_mk_not(ctx, y); + args[0] = x; + args[1] = y; + x_and_y = Z3_mk_and(ctx, 2, args); + ls = Z3_mk_not(ctx, x_and_y); + args[0] = not_x; + args[1] = not_y; + rs = Z3_mk_or(ctx, 2, args); + conjecture = Z3_mk_iff(ctx, ls, rs); + negated_conjecture = Z3_mk_not(ctx, conjecture); + + s = mk_solver(ctx); + Z3_solver_assert(ctx, s, negated_conjecture); + switch (Z3_solver_check(ctx, s)) { + case Z3_L_FALSE: + /* The negated conjecture was unsatisfiable, hence the conjecture is valid */ + printf("DeMorgan is valid\n"); + break; + case Z3_L_UNDEF: + /* Check returned undef */ + printf("Undef\n"); + break; + case Z3_L_TRUE: + /* The negated conjecture was satisfiable, hence the conjecture is not valid */ + printf("DeMorgan is not valid\n"); + break; + } + del_solver(ctx, s); + Z3_del_context(ctx); +} + +int main() { + simple_example(); + demorgan(); +} diff --git a/recipes/z3/config.yml b/recipes/z3/config.yml new file mode 100644 index 0000000000000..186c923c3a5de --- /dev/null +++ b/recipes/z3/config.yml @@ -0,0 +1,5 @@ +versions: + "4.8.8": + folder: "all" + "4.10.2": + folder: "all" diff --git a/recipes/zbar/all/conandata.yml b/recipes/zbar/all/conandata.yml new file mode 100644 index 0000000000000..6b2d63eaa0b13 --- /dev/null +++ b/recipes/zbar/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.23.92": + url: "https://github.com/mchehab/zbar/archive/refs/tags/0.23.92.tar.gz" + sha256: "dffc16695cb6e42fa318a4946fd42866c0f5ab735f7eaf450b108d1c3a19b4ba" + "0.10": + url: "https://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10.tar.gz" + sha256: "575fa82de699faa7bda2d2ebbe3e1af0a4152ec4d3ad72c0ab6712d7cc9b5dd2" +patches: + "0.10": + - patch_file: "patches/0001-support-aarch.patch" + patch_description: "Add support for Mac M1" + patch_type: "portability" diff --git a/recipes/zbar/all/conanfile.py b/recipes/zbar/all/conanfile.py new file mode 100644 index 0000000000000..3611c54ea21e1 --- /dev/null +++ b/recipes/zbar/all/conanfile.py @@ -0,0 +1,160 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import get, copy, rmdir, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ZbarConan(ConanFile): + name = "zbar" + license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://zbar.sourceforge.net/" + topics = ("barcode", "scanner", "decoder", "reader", "bar") + description = "ZBar is an open source software suite for reading bar codes\ + from various sources, such as video streams, image files and raw intensity sensors" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_video": [True, False], + "with_imagemagick": [True, False], + "with_gtk": [True, False], + "with_qt": [True, False], + "with_python_bindings": [True, False], + "with_x": [True, False], + "with_xshm": [True, False], + "with_xv": [True, False], + "with_jpeg": [True, False], + "enable_pthread": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_video": False, + "with_imagemagick": False, + "with_gtk": False, + "with_qt": False, + "with_python_bindings": False, + "with_x": False, + "with_xshm": False, + "with_xv": False, + "with_jpeg": False, + "enable_pthread": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + if self.options.with_jpeg: + self.requires("libjpeg/9e") + if self.options.with_imagemagick: + self.requires("imagemagick/7.0.11-14") + if self.options.with_gtk: + self.requires("gtk/4.7.0") + if self.options.with_qt: + self.requires("qt/5.15.9") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Zbar can't be built on Windows") + if is_apple_os(self) and not self.options.shared: + raise ConanInvalidConfiguration("Zbar can't be built static on macOS") + if self.options.with_xv: #TODO add when available + self.output.warning("There is no Xvideo package available on Conan (yet). This recipe will use the one present on the system (if available).") + if Version(self.version) >= "0.22" and cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} can't be built on cross building environment currently because autopoint(part of gettext) doesn't execute correctly.") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if Version(self.version) >= "0.22": + self.tool_requires("gettext/0.21") + self.tool_requires("libtool/2.4.7") + + 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") + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--enable-video={yes_no(self.options.with_video)}", + f"--with-imagemagick={yes_no(self.options.with_imagemagick)}", + f"--with-gtk={yes_no(self.options.with_gtk)}", + f"--with-qt={yes_no(self.options.with_qt)}", + f"--with-python={yes_no(self.options.with_python_bindings)}", + f"--with-x={yes_no(self.options.with_x)}", + f"--with-xshm={yes_no(self.options.with_xshm)}", + f"--with-xv={yes_no(self.options.with_xv)}", + f"--with-jpeg={yes_no(self.options.with_jpeg)}", + f"--enable-pthread={yes_no(self.options.enable_pthread)}", + ]) + env = tc.environment() + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # ./libtool: eval: line 961: syntax error near unexpected token `|' + env.define("NM", "nm") + tc.generate(env) + + AutotoolsDeps(self).generate() + PkgConfigDeps(self).generate() + + def build(self): + apply_conandata_patches(self) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=os.path.join(self.source_folder, "config")) + + autotools = Autotools(self) + if Version(self.version) >= "0.22": + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["zbar"] + self.cpp_info.set_property("pkg_config_name", "zbar") + if self.settings.os in ("FreeBSD", "Linux") and self.options.enable_pthread: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/zbar/all/patches/0001-support-aarch.patch b/recipes/zbar/all/patches/0001-support-aarch.patch new file mode 100644 index 0000000000000..af159847c4b2d --- /dev/null +++ b/recipes/zbar/all/patches/0001-support-aarch.patch @@ -0,0 +1,12 @@ +diff --git a/config/config.sub b/config/config.sub +index 848a7a5..8fecc04 100755 +--- a/config/config.sub ++++ b/config/config.sub +@@ -322,6 +322,7 @@ case $basic_machine in + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ ++ | aarch64-* | aarch64_be-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ diff --git a/recipes/zbar/all/test_package/CMakeLists.txt b/recipes/zbar/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5f986e30b6686 --- /dev/null +++ b/recipes/zbar/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package C) + +find_package(zbar CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} zbar::zbar) + +if ("${zbar_VERSION}" VERSION_GREATER_EQUAL "0.22") + target_compile_definitions(${PROJECT_NAME} PRIVATE ZBAR_VERSION_PARAM3) +endif() diff --git a/recipes/zbar/all/test_package/conanfile.py b/recipes/zbar/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/zbar/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/zbar/all/test_package/test_package.c b/recipes/zbar/all/test_package/test_package.c new file mode 100644 index 0000000000000..e433de5081b4e --- /dev/null +++ b/recipes/zbar/all/test_package/test_package.c @@ -0,0 +1,38 @@ +#include +#include +#include + +zbar_image_scanner_t *scanner = NULL; + +int main (int argc, char **argv) +{ + + /* create a reader */ + scanner = zbar_image_scanner_create(); + + /* configure the reader */ + zbar_image_scanner_set_config(scanner, 0, ZBAR_CFG_ENABLE, 1); + + + /* clean up */ + zbar_image_scanner_destroy(scanner); + +#ifdef ZBAR_VERSION_PARAM3 + unsigned VersionMajor; + unsigned VersionMinor; + unsigned VersionPatch; + zbar_version(&VersionMajor, &VersionMinor, &VersionPatch); + + printf("Compiled ZBar version %d.%d.%d \n", VersionMajor, VersionMinor, VersionPatch); +#else + unsigned VersionMajor; + unsigned VersionMinor; + zbar_version(&VersionMajor, &VersionMinor); + + printf("Compiled ZBar version %d.%d \n", VersionMajor, VersionMinor); +#endif + + printf("Zbar Test Completed \n"); + + return(0); +} diff --git a/recipes/zbar/all/test_v1_package/CMakeLists.txt b/recipes/zbar/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/zbar/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zbar/all/test_v1_package/conanfile.py b/recipes/zbar/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/zbar/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/zbar/config.yml b/recipes/zbar/config.yml new file mode 100644 index 0000000000000..addaa24b0475a --- /dev/null +++ b/recipes/zbar/config.yml @@ -0,0 +1,5 @@ +versions: + "0.23.92": + folder: all + "0.10": + folder: all diff --git a/recipes/zeromq/all/conandata.yml b/recipes/zeromq/all/conandata.yml new file mode 100644 index 0000000000000..099a8577c05d9 --- /dev/null +++ b/recipes/zeromq/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "4.3.4": + url: "https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz" + sha256: "c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5" + "4.3.3": + url: "https://github.com/zeromq/libzmq/releases/download/v4.3.3/zeromq-4.3.3.tar.gz" + sha256: "9d9285db37ae942ed0780c016da87060497877af45094ff9e1a1ca736e3875a2" + "4.3.2": + url: "https://github.com/zeromq/libzmq/releases/download/v4.3.2/zeromq-4.3.2.tar.gz" + sha256: "ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763" +patches: + "4.3.4": + - patch_file: "patches/0003-rpath-macos-4.3.3.patch" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" + "4.3.3": + - patch_file: "patches/0003-rpath-macos-4.3.3.patch" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" + "4.3.2": + - patch_file: "patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch" + - patch_file: "patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch" + - patch_file: "patches/0003-rpath-macos-4.3.2.patch" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" diff --git a/recipes/zeromq/all/conanfile.py b/recipes/zeromq/all/conanfile.py new file mode 100644 index 0000000000000..d7a259f237734 --- /dev/null +++ b/recipes/zeromq/all/conanfile.py @@ -0,0 +1,180 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class ZeroMQConan(ConanFile): + name = "zeromq" + homepage = "https://github.com/zeromq/libzmq" + description = "ZeroMQ is a community of projects focused on decentralized messaging and computing" + topics = ("zmq", "libzmq", "message-queue", "asynchronous") + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-3.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "encryption": [None, "libsodium", "tweetnacl"], + "with_norm": [True, False], + "poller": [None, "kqueue", "epoll", "devpoll", "pollset", "poll", "select"], + "with_draft_api": [True, False], + "with_websocket": [True, False], + "with_radix_tree": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "encryption": "libsodium", + "with_norm": False, + "poller": None, + "with_draft_api": False, + "with_websocket": False, + "with_radix_tree": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.encryption == "libsodium": + self.requires("libsodium/1.0.18") + if self.options.with_norm: + self.requires("norm/1.5.9") + + def validate(self): + if self.settings.os == "Windows" and self.options.with_norm: + raise ConanInvalidConfiguration( + "Norm and ZeroMQ are not compatible on Windows yet" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_CURVE"] = bool(self.options.encryption) + tc.variables["WITH_LIBSODIUM"] = self.options.encryption == "libsodium" + tc.variables["ZMQ_BUILD_TESTS"] = False + tc.variables["WITH_PERF_TOOL"] = False + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_TESTS"] = False + tc.variables["ENABLE_CPACK"] = False + tc.variables["WITH_DOCS"] = False + tc.variables["WITH_DOC"] = False + tc.variables["WITH_NORM"] = self.options.with_norm + tc.variables["ENABLE_DRAFTS"] = self.options.with_draft_api + tc.variables["ENABLE_WS"] = self.options.with_websocket + tc.variables["ENABLE_RADIX_TREE"] = self.options.with_radix_tree + if self.options.poller: + tc.variables["POLLER"] = self.options.poller + if is_msvc(self): + tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.options.encryption == "libsodium": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + cpp_info_sodium = self.dependencies["libsodium"].cpp_info + sodium_config = cpp_info_sodium.get_property("cmake_file_name") or "libsodium" + sodium_target = cpp_info_sodium.get_property("cmake_target_name") or "libsodium::libsodium" + find_sodium = "find_package(Sodium)" if Version(self.version) < "4.3.3" else "find_package(\"Sodium\")" + replace_in_file(self, cmakelists, find_sodium, f"find_package({sodium_config} REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "SODIUM_FOUND", f"{sodium_config}_FOUND") + replace_in_file(self, cmakelists, "SODIUM_INCLUDE_DIRS", f"{sodium_config}_INCLUDE_DIRS") + replace_in_file(self, cmakelists, "${SODIUM_LIBRARIES}", sodium_target) + + def build(self): + self._patch_sources() + 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() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + 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, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._libzmq_target: f"ZeroMQ::{self._libzmq_target}"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _libzmq_target(self): + return "libzmq" if self.options.shared else "libzmq-static" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ZeroMQ") + self.cpp_info.set_property("cmake_target_name", self._libzmq_target) + self.cpp_info.set_property("pkg_config_name", "libzmq") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libzmq"].libs = collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.components["libzmq"].system_libs = ["iphlpapi", "ws2_32"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libzmq"].system_libs = ["pthread", "rt", "m"] + if not self.options.shared: + self.cpp_info.components["libzmq"].defines.append("ZMQ_STATIC") + if self.options.with_draft_api: + self.cpp_info.components["libzmq"].defines.append("ZMQ_BUILD_DRAFT_API") + if self.options.with_websocket and self.settings.os != "Windows": + self.cpp_info.components["libzmq"].system_libs.append("bsd") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "ZeroMQ" + self.cpp_info.names["cmake_find_package_multi"] = "ZeroMQ" + self.cpp_info.names["pkg_config"] = "libzmq" + self.cpp_info.components["libzmq"].names["cmake_find_package"] = self._libzmq_target + self.cpp_info.components["libzmq"].names["cmake_find_package_multi"] = self._libzmq_target + self.cpp_info.components["libzmq"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libzmq"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["libzmq"].set_property("cmake_target_name", self._libzmq_target) + if self.options.encryption == "libsodium": + self.cpp_info.components["libzmq"].requires.append("libsodium::libsodium") + if self.options.with_norm: + self.cpp_info.components["libzmq"].requires.append("norm::norm") diff --git a/recipes/zeromq/all/patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch b/recipes/zeromq/all/patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch new file mode 100644 index 0000000000000..86f84e27ab95f --- /dev/null +++ b/recipes/zeromq/all/patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch @@ -0,0 +1,81 @@ +From b3123a2fd1e77cbdceb5ee7a70e796063b5ee5b9 Mon Sep 17 00:00:00 2001 +From: Jacques Germishuys +Date: Tue, 30 Jul 2019 09:55:11 +0100 +Subject: [PATCH] Problem: __try and __except isn't universally supported on + windows + +Solution: Manually push/pop an exception registration record. +Only set the thread name with a debugger present +--- + src/thread.cpp | 40 +++++++++++++++++++++++++++++----------- + 1 file changed, 29 insertions(+), 11 deletions(-) + +diff --git a/src/thread.cpp b/src/thread.cpp +index b14d70757..3675899be 100644 +--- a/src/thread.cpp ++++ b/src/thread.cpp +@@ -32,6 +32,10 @@ + #include "thread.hpp" + #include "err.hpp" + ++#ifdef ZMQ_HAVE_WINDOWS ++#include ++#endif ++ + bool zmq::thread_t::get_started () const + { + return _started; +@@ -113,10 +117,22 @@ struct thread_info_t + #pragma pack(pop) + } + ++typedef struct _MY_EXCEPTION_REGISTRATION_RECORD ++{ ++ struct _MY_EXCEPTION_REGISTRATION_RECORD *Next; ++ void *Handler; ++} MY_EXCEPTION_REGISTRATION_RECORD; ++ ++static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec, ++ void *frame, CONTEXT *ctx, void *disp) ++{ ++ return ExceptionContinueExecution; ++} ++ + void zmq::thread_t:: + applyThreadName () // to be called in secondary thread context + { +- if (!_name[0]) ++ if (!_name[0] || !IsDebuggerPresent()) + return; + + thread_info_t thread_info; +@@ -125,17 +141,19 @@ void zmq::thread_t:: + thread_info._thread_id = -1; + thread_info._flags = 0; + +-#pragma warning(push) +-#pragma warning(disable : 6320 6322) +- __try { +- DWORD MS_VC_EXCEPTION = 0x406D1388; ++ NT_TIB *tib = ((NT_TIB*)NtCurrentTeb()); ++ ++ MY_EXCEPTION_REGISTRATION_RECORD rec; ++ rec.Next = (MY_EXCEPTION_REGISTRATION_RECORD *)tib->ExceptionList; ++ rec.Handler = continue_execution; ++ ++ // push our handler, raise, and finally pop our handler ++ tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *)&rec; ++ DWORD MS_VC_EXCEPTION = 0x406D1388; + RaiseException (MS_VC_EXCEPTION, 0, +- sizeof (thread_info) / sizeof (ULONG_PTR), +- (ULONG_PTR *) &thread_info); +- } +- __except (EXCEPTION_CONTINUE_EXECUTION) { +- } +-#pragma warning(pop) ++ sizeof (thread_info) / sizeof (ULONG_PTR), ++ (ULONG_PTR *) &thread_info); ++ tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *)(((MY_EXCEPTION_REGISTRATION_RECORD *)tib->ExceptionList)->Next); + } + + #elif defined ZMQ_HAVE_VXWORKS diff --git a/recipes/zeromq/all/patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch b/recipes/zeromq/all/patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch new file mode 100644 index 0000000000000..a36f249d0c435 --- /dev/null +++ b/recipes/zeromq/all/patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch @@ -0,0 +1,34 @@ +From e9b67001dd0bac5bae7dd95a7c9a597ae59988c7 Mon Sep 17 00:00:00 2001 +From: Simon Giesecke +Date: Mon, 19 Aug 2019 10:13:11 +0200 +Subject: [PATCH] Problem: invalid syntax for calling convention on function + pointer + +Solution: fix syntax and formatting, remove C-ism for defining struct +--- + src/thread.cpp | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/thread.cpp b/src/thread.cpp +index b81d458a8..6f07e9cee 100644 +--- a/src/thread.cpp ++++ b/src/thread.cpp +@@ -117,11 +117,14 @@ struct thread_info_t + #pragma pack(pop) + } + +-typedef struct _MY_EXCEPTION_REGISTRATION_RECORD ++struct MY_EXCEPTION_REGISTRATION_RECORD + { +- struct _MY_EXCEPTION_REGISTRATION_RECORD *Next; +- void *Handler; +-} MY_EXCEPTION_REGISTRATION_RECORD; ++ typedef EXCEPTION_DISPOSITION (NTAPI *HandlerFunctionType) ( ++ EXCEPTION_RECORD *, void *, CONTEXT *, void *); ++ ++ MY_EXCEPTION_REGISTRATION_RECORD *Next; ++ HandlerFunctionType Handler; ++}; + + static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec, + void *frame, CONTEXT *ctx, void *disp) diff --git a/recipes/zeromq/all/patches/0003-rpath-macos-4.3.2.patch b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.2.patch new file mode 100644 index 0000000000000..d0b667263e060 --- /dev/null +++ b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.2.patch @@ -0,0 +1,24 @@ +Fix for Apple platforms: +* Ensure install_name with @rpath token +* Keep rpath clean in installed binaries + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + # CMake build script for ZeroMQ + project(ZeroMQ) + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(1) + cmake_minimum_required(VERSION 3.0.2) + else() + cmake_minimum_required(VERSION 2.8.12) +@@ -44,7 +44,7 @@ if (ENABLE_INTRINSICS) + add_definitions(-DZMQ_HAVE_ATOMIC_INTRINSICS) + endif() + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(0) + # Find more information: https://cmake.org/Wiki/CMake_RPATH_handling + + # Apply CMP0042: MACOSX_RPATH is enabled by default diff --git a/recipes/zeromq/all/patches/0003-rpath-macos-4.3.3.patch b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.3.patch new file mode 100644 index 0000000000000..12768677dac04 --- /dev/null +++ b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.3.patch @@ -0,0 +1,24 @@ +Fix for Apple platforms: +* Ensure install_name with @rpath token +* Keep rpath clean in installed binaries + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + # CMake build script for ZeroMQ + project(ZeroMQ) + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(1) + cmake_minimum_required(VERSION 3.0.2) + else() + cmake_minimum_required(VERSION 2.8.12) +@@ -94,7 +94,7 @@ set(ZMQ_OUTPUT_BASENAME + "zmq" + CACHE STRING "Output zmq library base name") + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(0) + # Find more information: https://cmake.org/Wiki/CMake_RPATH_handling + + # Apply CMP0042: MACOSX_RPATH is enabled by default diff --git a/recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch b/recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch new file mode 100644 index 0000000000000..75064b1ea9822 --- /dev/null +++ b/recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,11 @@ + # CMake build script for ZeroMQ +-project(ZeroMQ) + + if(1) + cmake_minimum_required(VERSION 3.0.2) + else() + cmake_minimum_required(VERSION 2.8.12) + endif() ++project(ZeroMQ) + + include(CheckIncludeFiles) + include(CheckCCompilerFlag) diff --git a/recipes/zeromq/all/test_package/CMakeLists.txt b/recipes/zeromq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e02c2ff4211bd --- /dev/null +++ b/recipes/zeromq/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +option(WITH_LIBSODIUM "zeromq is built with libsodium") +option(WITH_NORM "zeromq is built with norm") + +find_package(ZeroMQ REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(ZEROMQ_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE libzmq) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE libzmq-static) +endif() + +if(WITH_LIBSODIUM) + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_LIBSODIUM") +endif() + +if(WITH_NORM) + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_NORM") +endif() diff --git a/recipes/zeromq/all/test_package/conanfile.py b/recipes/zeromq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0378d2924042d --- /dev/null +++ b/recipes/zeromq/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_LIBSODIUM"] = self.dependencies["zeromq"].options.encryption == "libsodium" + tc.variables["ZEROMQ_SHARED"] = self.dependencies["zeromq"].options.shared + tc.variables["WITH_NORM"] = self.dependencies["zeromq"].options.with_norm + 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/zeromq/all/test_package/test_package.cpp b/recipes/zeromq/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..231230c6f2b0d --- /dev/null +++ b/recipes/zeromq/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include + +int main() try +{ + void *context = zmq_ctx_new(); + void *requester = zmq_socket(context, ZMQ_REQ); +#if defined(WITH_LIBSODIUM) + int is_server = 0; + if (0 != zmq_setsockopt(requester, ZMQ_CURVE_SERVER, &is_server, sizeof(is_server))) + throw std::runtime_error("zmq_setsockopt with ZMQ_CURVE_SERVER failed"); +#endif +#if defined(WITH_NORM) + void *publisher = zmq_socket(context, ZMQ_PUB); + if (0 != zmq_bind (publisher, "norm://127.0.0.1:*")) + throw std::runtime_error(std::string("zmq_bind with norm://127.0.0.1:* failed: ").append(strerror(errno))); + zmq_close(publisher); +#endif + zmq_close(requester); + zmq_ctx_destroy (context); + + return EXIT_SUCCESS; +} +catch (std::runtime_error & e) { + std::cerr << e.what() << std::endl; + return EXIT_FAILURE; +} diff --git a/recipes/zeromq/all/test_v1_package/CMakeLists.txt b/recipes/zeromq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zeromq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zeromq/all/test_v1_package/conanfile.py b/recipes/zeromq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..507e0ac53bc64 --- /dev/null +++ b/recipes/zeromq/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_LIBSODIUM"] = self.options["zeromq"].encryption == "libsodium" + cmake.definitions["ZEROMQ_SHARED"] = self.options["zeromq"].shared + cmake.definitions["WITH_NORM"] = self.options["zeromq"].with_norm + 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/zeromq/config.yml b/recipes/zeromq/config.yml new file mode 100644 index 0000000000000..218db624c1eea --- /dev/null +++ b/recipes/zeromq/config.yml @@ -0,0 +1,7 @@ +versions: + "4.3.4": + folder: all + "4.3.3": + folder: all + "4.3.2": + folder: all diff --git a/recipes/zfp/all/conandata.yml b/recipes/zfp/all/conandata.yml new file mode 100644 index 0000000000000..308872a236805 --- /dev/null +++ b/recipes/zfp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.0": + url: "https://github.com/LLNL/zfp/releases/download/1.0.0/zfp-1.0.0.tar.gz" + sha256: "0ea08ae3e50e3c92f8b8cf41ba5b6e2de8892bc4a4ca0c59b8945b6c2ab617c4" + "0.5.5": + url: "https://github.com/LLNL/zfp/releases/download/0.5.5/zfp-0.5.5.tar.gz" + sha256: "fdf7b948bab1f4e5dccfe2c2048fd98c24e417ad8fb8a51ed3463d04147393c5" diff --git a/recipes/zfp/all/conanfile.py b/recipes/zfp/all/conanfile.py new file mode 100644 index 0000000000000..451da2a028864 --- /dev/null +++ b/recipes/zfp/all/conanfile.py @@ -0,0 +1,124 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class ZfpConan(ConanFile): + name = "zfp" + description = "Compressed numerical arrays that support high-speed random access" + homepage = "https://github.com/LLNL/zfp" + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + topics = ("compression", "arrays") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "bit_stream_word_size": [8,16,32,64], + "with_cuda": [True, False], + "with_bit_stream_strided": [True, False], + "with_aligned_alloc": [True, False], + "with_cache_twoway": [True, False], + "with_cache_fast_hash": [True, False], + "with_cache_profile": [True, False], + "with_openmp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "bit_stream_word_size": 64, + "with_cuda": False, + "with_bit_stream_strided": False, + "with_aligned_alloc": False, + "with_cache_twoway": False, + "with_cache_fast_hash": False, + "with_cache_profile": False, + "with_openmp": False, + } + + 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.options.with_cuda: + self.output.warning("Conan package for CUDA is not available, this package will be used from system.") + if self.options.with_openmp: + self.output.warning("Conan package for OpenMP is not available, this package will be used from system.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_CFP"] = True + tc.variables["BUILD_UTILITIES"] = False + tc.variables["ZFP_WITH_CUDA"] = self.options.with_cuda + tc.variables["ZFP_BIT_STREAM_WORD_SIZE"] = self.options.bit_stream_word_size + tc.variables["ZFP_WITH_BIT_STREAM_STRIDED"] = self.options.with_bit_stream_strided + tc.variables["ZFP_WITH_ALIGNED_ALLOC"] = self.options.with_aligned_alloc + tc.variables["ZFP_WITH_CACHE_TWOWAY"] = self.options.with_cache_twoway + tc.variables["ZFP_WITH_CACHE_FAST_HASH"] = self.options.with_cache_fast_hash + tc.variables["ZFP_WITH_CACHE_PROFILE"] = self.options.with_cache_profile + tc.variables["ZFP_WITH_CUDA"] = self.options.with_cuda + tc.variables["ZFP_WITH_OPENMP"] = self.options.with_openmp + if self.settings.os != "Windows" and not self.options.shared: + tc.variables["ZFP_ENABLE_PIC"] = self.options.fPIC + tc.variables["BUILD_TESTING"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "zfp") + # to avoid to create an unwanted target, since we can't allow zfp::zfp to be the global target here + self.cpp_info.set_property("cmake_target_name", "zfp::cfp") + + # zfp + self.cpp_info.components["_zfp"].set_property("cmake_target_name", "zfp::zfp") + self.cpp_info.components["_zfp"].libs = ["zfp"] + + # cfp + self.cpp_info.components["cfp"].set_property("cmake_target_name", "zfp::cfp") + self.cpp_info.components["cfp"].libs = ["cfp"] + self.cpp_info.components["cfp"].requires = ["_zfp"] + + if not self.options.shared and self.options.with_openmp: + openmp_flags = [] + if is_msvc(self): + openmp_flags = ["-openmp"] + elif self.settings.compiler in ("gcc", "clang"): + openmp_flags = ["-fopenmp"] + elif self.settings.compiler == "apple-clang": + openmp_flags = ["-Xpreprocessor", "-fopenmp"] + + self.cpp_info.components["_zfp"].sharedlinkflags = openmp_flags + self.cpp_info.components["_zfp"].exelinkflags = openmp_flags + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_zfp"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_zfp"].names["cmake_find_package"] = "zfp" + self.cpp_info.components["_zfp"].names["cmake_find_package_multi"] = "zfp" diff --git a/recipes/zfp/all/test_package/CMakeLists.txt b/recipes/zfp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d49c569f327a3 --- /dev/null +++ b/recipes/zfp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(zfp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zfp::zfp) diff --git a/recipes/zfp/all/test_package/conanfile.py b/recipes/zfp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/zfp/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/zfp/all/test_package/test_package.cpp b/recipes/zfp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..29a08fccd4085 --- /dev/null +++ b/recipes/zfp/all/test_package/test_package.cpp @@ -0,0 +1,33 @@ +#include + +#include "zfp.h" + +#if ZFP_VERSION_MAJOR < 1 +# include "zfparray2.h" +#else +# include "zfp/array2.hpp" +#endif + +template +inline double total(const array2d& u) +{ + double s = 0; + const int nx = u.size_x(); + const int ny = u.size_y(); + for (int y = 1; y < ny - 1; y++) + for (int x = 1; x < nx - 1; x++) + s += u(x, y); + return s; +} + +int main(int argc, const char *argv[]) +{ + const int nx = 100; + const int ny = 100; + const int cache = 4; + const double rate = 64; + zfp::array2d u(nx, ny, rate, 0, cache * 4 * 4 * sizeof(double)); + double sum = total(u); + + return 0; +} diff --git a/recipes/zfp/all/test_v1_package/CMakeLists.txt b/recipes/zfp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zfp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zfp/all/test_v1_package/conanfile.py b/recipes/zfp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zfp/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/zfp/config.yml b/recipes/zfp/config.yml new file mode 100644 index 0000000000000..3e7309cad846c --- /dev/null +++ b/recipes/zfp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.0": + folder: all + "0.5.5": + folder: all diff --git a/recipes/zimg/all/conandata.yml b/recipes/zimg/all/conandata.yml new file mode 100644 index 0000000000000..6f58da26deae3 --- /dev/null +++ b/recipes/zimg/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "3.0.4": + url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.4.tar.gz" + sha256: "219d1bc6b7fde1355d72c9b406ebd730a4aed9c21da779660f0a4c851243e32f" + "3.0.3": + url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.3.tar.gz" + sha256: "5e002992bfe8b9d2867fdc9266dc84faca46f0bfd931acc2ae0124972b6170a7" + "3.0.2": + url: "https://github.com/sekrit-twc/zimg/archive/release-3.0.2.tar.gz" + sha256: "b9eadf1df12ae8395ba781f2468965d411b21abbebbebeae3651d492227d4633" + "3.0.1": + url: "https://github.com/sekrit-twc/zimg/archive/release-3.0.1.tar.gz" + sha256: "c50a0922f4adac4efad77427d13520ed89b8366eef0ef2fa379572951afcc73f" + "2.9.3": + url: "https://github.com/sekrit-twc/zimg/archive/release-2.9.3.tar.gz" + sha256: "a15c0483fbe945ffe695a1a989bc43b3381c8bf33e2d1760464ec21d32cdf30b" +patches: + "3.0.4": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" + "3.0.3": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" + "3.0.2": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" + "3.0.1": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" + "2.9.3": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" + - patch_file: "patches/0003-include-stddef.patch" diff --git a/recipes/zimg/all/conanfile.py b/recipes/zimg/all/conanfile.py new file mode 100644 index 0000000000000..6332a7e16ebe2 --- /dev/null +++ b/recipes/zimg/all/conanfile.py @@ -0,0 +1,148 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import stdcpp_library +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, MSBuild, MSBuildToolchain +import os + +required_conan_version = ">=1.54.0" + + +class ZimgConan(ConanFile): + name = "zimg" + description = "Scaling, colorspace conversion, and dithering library" + topics = ("image", "manipulation") + homepage = "https://github.com/sekrit-twc/zimg" + url = "https://github.com/conan-io/conan-center-index" + license = "WTFPL" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + 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 validate(self): + check_min_vs(self, 191) + + def build_requirements(self): + 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) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.properties["WholeProgramOptimization"] = "false" + tc.generate() + else: + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + #========================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + vcxproj_files = [ + os.path.join(self.source_folder, "_msvc", "zimg", "zimg.vcxproj"), + os.path.join(self.source_folder, "_msvc", "dll", "dll.vcxproj"), + ] + for vcxproj_file in vcxproj_files: + replace_in_file( + self, vcxproj_file, + "true", + "" + ) + platform_toolset = MSBuildToolchain(self).toolset + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + for vcxproj_file in vcxproj_files: + replace_in_file( + self, vcxproj_file, + "v142", + f"{platform_toolset}", + ) + replace_in_file( + self, vcxproj_file, + "", + f"", + ) + #========================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(self.source_folder, "_msvc", "zimg.sln"), + targets=["dll" if self.options.shared else "zimg"]) + else: + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + src_include_dir = os.path.join(self.source_folder, "src", "zimg", "api") + copy(self, "zimg.h", src=src_include_dir, dst=os.path.join(self.package_folder, "include")) + copy(self, "zimg++.hpp", src=src_include_dir, dst=os.path.join(self.package_folder, "include")) + output_dir = os.path.join(self.source_folder, "_msvc") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + old_lib = "z_imp.lib" if self.options.shared else "z.lib" + rename(self, os.path.join(self.package_folder, "lib", old_lib), + os.path.join(self.package_folder, "lib", "zimg.lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "zimg") + self.cpp_info.libs = ["zimg"] + if not self.options.shared: + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/zimg/all/patches/0001-msvc-remove-windows-target-platform.patch b/recipes/zimg/all/patches/0001-msvc-remove-windows-target-platform.patch new file mode 100644 index 0000000000000..f445b3e2da987 --- /dev/null +++ b/recipes/zimg/all/patches/0001-msvc-remove-windows-target-platform.patch @@ -0,0 +1,22 @@ +--- a/_msvc/dll/dll.vcxproj ++++ b/_msvc/dll/dll.vcxproj +@@ -43,7 +43,7 @@ + + {96822C64-B0B6-49F3-A24C-F9C5FDB02DD3} + dll +- 10.0 ++ + + + +--- a/_msvc/zimg/zimg.vcxproj ++++ b/_msvc/zimg/zimg.vcxproj +@@ -37,7 +37,7 @@ + + {C8629E57-4D6F-40FA-82FC-B39824195932} + zimg +- 10.0 ++ + + + diff --git a/recipes/zimg/all/patches/0002-msvc-solution.patch b/recipes/zimg/all/patches/0002-msvc-solution.patch new file mode 100644 index 0000000000000..d6d1a3ce08fc8 --- /dev/null +++ b/recipes/zimg/all/patches/0002-msvc-solution.patch @@ -0,0 +1,14 @@ +--- _msvc/zimg.sln ++++ _msvc/zimg.sln +@@ -1,8 +1,8 @@ +- ++ + Microsoft Visual Studio Solution File, Format Version 12.00 + # Visual Studio Version 16 +-VisualStudioVersion = 16.0.28922.388 +-MinimumVisualStudioVersion = 10.0.40219.1 ++# VisualStudioVersion = 16.0.28922.388 ++# MinimumVisualStudioVersion = 10.0.40219.1 + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testapp", "testapp\testapp.vcxproj", "{B85E6CC0-ED80-487D-805A-DA3597A15CE6}" + ProjectSection(ProjectDependencies) = postProject + {C8629E57-4D6F-40FA-82FC-B39824195932} = {C8629E57-4D6F-40FA-82FC-B39824195932} diff --git a/recipes/zimg/all/patches/0003-include-stddef.patch b/recipes/zimg/all/patches/0003-include-stddef.patch new file mode 100644 index 0000000000000..7cc3fe6ae0700 --- /dev/null +++ b/recipes/zimg/all/patches/0003-include-stddef.patch @@ -0,0 +1,8 @@ +--- a/src/zimg/colorspace/matrix3.cpp ++++ b/src/zimg/colorspace/matrix3.cpp +@@ -1,4 +1,5 @@ + #include "matrix3.h" ++#include + + namespace zimg { + namespace colorspace { diff --git a/recipes/zimg/all/test_package/CMakeLists.txt b/recipes/zimg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b744ea607a1f --- /dev/null +++ b/recipes/zimg/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(zimg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zimg::zimg) diff --git a/recipes/zimg/all/test_package/conanfile.py b/recipes/zimg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/zimg/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zimg/all/test_package/test_package.c b/recipes/zimg/all/test_package/test_package.c new file mode 100644 index 0000000000000..e406e31b43ed4 --- /dev/null +++ b/recipes/zimg/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + unsigned major, minor; + zimg_get_api_version(&major, &minor); + printf("zimg version: %u.%u\n", major, minor); + return 0; +} diff --git a/recipes/zimg/all/test_v1_package/CMakeLists.txt b/recipes/zimg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zimg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zimg/all/test_v1_package/conanfile.py b/recipes/zimg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zimg/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/zimg/config.yml b/recipes/zimg/config.yml new file mode 100644 index 0000000000000..b142332a0fe4c --- /dev/null +++ b/recipes/zimg/config.yml @@ -0,0 +1,11 @@ +versions: + "3.0.4": + folder: "all" + "3.0.3": + folder: "all" + "3.0.2": + folder: "all" + "3.0.1": + folder: "all" + "2.9.3": + folder: "all" diff --git a/recipes/zint/all/conandata.yml b/recipes/zint/all/conandata.yml new file mode 100644 index 0000000000000..7f452ab653337 --- /dev/null +++ b/recipes/zint/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.10.0": + url: "https://sourceforge.net/projects/zint/files/zint/2.10.0/zint-2.10.0-src.tar.gz" + sha256: "BB97E98A32E140C344E92C8DA84A9DF413DCA16083F2FCDC29791BEC77350339" +patches: + "2.10.0": + - patch_file: "patches/0001-2.10.0-conan-integration.patch" diff --git a/recipes/zint/all/conanfile.py b/recipes/zint/all/conanfile.py new file mode 100644 index 0000000000000..61596c6c982a7 --- /dev/null +++ b/recipes/zint/all/conanfile.py @@ -0,0 +1,137 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class ZintConan(ConanFile): + name = "zint" + description = "Zint Barcode Generator" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/p/zint/code" + license = "GPL-3.0" + topics = ("barcode", "qt") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libpng": [True, False], + "with_qt": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libpng": True, + "with_qt": 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 + if not self.options.with_qt: + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_libpng: + self.requires("libpng/1.6.38") + self.requires("zlib/1.2.13") + if self.options.with_qt: + self.requires("qt/5.15.6") + + def validate(self): + if self.info.options.with_qt and not self.dependencies["qt"].options.gui: + raise ConanInvalidConfiguration(f"{self.ref} needs qt:gui=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.variables["DATA_INSTALL_DIR"] = os.path.join(self.package_folder, "lib").replace("\\", "/") + tc.variables["ZINT_USE_QT"] = self.options.with_qt + if self.options.with_qt: + tc.variables["QT_VERSION_MAJOR"] = Version(self.dependencies["qt"].ref.version).major + tc.variables["ZINT_USE_PNG"] = self.options.with_libpng + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_source(self): + apply_conandata_patches(self) + # Don't override CMAKE_OSX_SYSROOT, it can easily break consumers. + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_OSX_SYSROOT \"/\")", + "", + ) + + def build(self): + self._patch_source() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Zint") + + self.cpp_info.components["libzint"].set_property("cmake_target_name", "Zint::Zint") + self.cpp_info.components["libzint"].libs = ["zint" if self.options.shared else "zint-static"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["libzint"].defines = ["ZINT_DLL"] + if self.options.with_libpng: + self.cpp_info.components["libzint"].requires.extend(["libpng::libpng", "zlib::zlib"]) + + if self.options.with_qt: + self.cpp_info.components["libqzint"].set_property("cmake_target_name", "Zint::QZint") + self.cpp_info.components["libqzint"].libs = ["QZint"] + self.cpp_info.components["libqzint"].requires.extend([ + "libzint", + "qt::qtGui", + ]) + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["libqzint"].defines = ["QZINT_DLL"] + + # Trick to only define Zint::QZint and Zint::Zint in CMakeDeps generator + self.cpp_info.set_property("cmake_target_name", "Zint::QZint" if self.options.with_qt else "Zint::Zint") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Zint" + self.cpp_info.names["cmake_find_package_multi"] = "Zint" + self.cpp_info.components["libzint"].names["cmake_find_package"] = "Zint" + self.cpp_info.components["libzint"].names["cmake_find_package_multi"] = "Zint" + if self.options.with_qt: + self.cpp_info.components["libqzint"].names["cmake_find_package"] = "QZint" + self.cpp_info.components["libqzint"].names["cmake_find_package_multi"] = "QZint" diff --git a/recipes/zint/all/patches/0001-2.10.0-conan-integration.patch b/recipes/zint/all/patches/0001-2.10.0-conan-integration.patch new file mode 100644 index 0000000000000..1f9ae14162770 --- /dev/null +++ b/recipes/zint/all/patches/0001-2.10.0-conan-integration.patch @@ -0,0 +1,152 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -15,7 +15,7 @@ set(ZINT_VERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}.${ZINT_VERSION_REL + + add_definitions(-DZINT_VERSION=\"${ZINT_VERSION}\") + +-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") ++#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") + + option(ZINT_DEBUG "Set debug compile flags" OFF) + option(ZINT_SANITIZE "Set sanitize compile/link flags" OFF) +@@ -25,7 +25,7 @@ option(ZINT_STATIC "Build static library" OFF) + option(ZINT_USE_PNG "Build with PNG support" ON) + option(ZINT_USE_QT "Build with QT support" ON) + +-include(SetPaths.cmake) ++#include(SetPaths.cmake) + + include(CheckCXXCompilerFlag) + include(CheckFunctionExists) +@@ -126,15 +126,15 @@ + + check_function_exists(getopt HAVE_GETOPT) + if(NOT HAVE_GETOPT) +- add_subdirectory(getopt) ++ #add_subdirectory(getopt) + endif() + + add_subdirectory(backend) +-add_subdirectory(frontend) ++#add_subdirectory(frontend) + + if(NOT ZINT_USE_QT) + message(STATUS "Qt support was disabled for this build") +-elseif($ENV{CMAKE_PREFIX_PATH} MATCHES "6[.][0-9][.][0-9]") ++elseif(0) + set(USE_QT6 TRUE) + message(STATUS "Using Qt6") + cmake_policy(SET CMP0012 NEW) # Recognize constants in if() +@@ -151,21 +151,21 @@ + else() + message(STATUS "Could NOT find Qt6") + endif() + else() +- message(STATUS "Using Qt5") +- find_package(Qt5Widgets) +- find_package(Qt5Gui) +- find_package(Qt5UiTools) +- find_package(Qt5Xml) ++ message(STATUS "Using Qt${QT_VERSION_MAJOR}") ++ find_package( ++ Qt${QT_VERSION_MAJOR} ++ COMPONENTS Gui ++ REQUIRED) + +- if(Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Xml_FOUND) ++ if(1) + message(STATUS "Qt version: " ${Qt5Core_VERSION_STRING}) + # Old Qt does not provide QT_VERSION_MAJOR + if (NOT QT_VERSION_MAJOR) + string(SUBSTRING ${Qt5Core_VERSION_STRING} 0 1 QT_VERSION_MAJOR) + endif() + add_subdirectory(backend_qt) +- add_subdirectory(frontend_qt) ++ # add_subdirectory(frontend_qt) + else() + message(STATUS "Could NOT find Qt5") + endif() +--- backend/CMakeLists.txt ++++ backend/CMakeLists.txt +@@ -13,10 +13,10 @@ + set(zint_OUTPUT_SRCS vector.c ps.c svg.c emf.c bmp.c pcx.c gif.c png.c tif.c raster.c output.c) + set(zint_SRCS ${zint_OUTPUT_SRCS} ${zint_COMMON_SRCS} ${zint_ONEDIM_SRCS} ${zint_POSTAL_SRCS} ${zint_TWODIM_SRCS}) + +-add_library(zint SHARED ${zint_SRCS}) +- +-if(ZINT_STATIC) +- add_library(zint-static STATIC ${zint_SRCS}) ++add_library(zint ${zint_SRCS}) ++set_target_properties(zint PROPERTIES DEFINE_SYMBOL ZINT_BUILD_DLL) ++if(NOT BUILD_SHARED_LIBS) ++ set_target_properties(zint PROPERTIES OUTPUT_NAME "zint-static")# ARCHIVE_OUTPUT_NAME "zint-static") + endif() +- ++target_include_directories(zint PUBLIC $) + function(zint_target_link_libraries library) +@@ -59,1 +59,1 @@ +- target_compile_definitions(zint PRIVATE DLL_EXPORT) ++ #target_compile_definitions(zint PRIVATE DLL_EXPORT) +@@ -63,7 +63,7 @@ + if(ZINT_STATIC) + install(TARGETS zint-static ${INSTALL_TARGETS_DEFAULT_ARGS}) + endif() +-install(FILES zint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) ++install(FILES zint.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Devel) + + if(ZINT_TEST) + add_subdirectory(tests) +--- backend_qt/CMakeLists.txt ++++ backend_qt/CMakeLists.txt +@@ -12,7 +12,7 @@ + qt5_wrap_cpp(QZint_SRCS qzint.h) + endif() + +-add_library(${PROJECT_NAME} STATIC ${QZint_SRCS}) ++add_library(${PROJECT_NAME} ${QZint_SRCS}) +- ++set_target_properties(${PROJECT_NAME} PROPERTIES DEFINE_SYMBOL QZINT_BUILD_DLL) + set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}" + VERSION ${ZINT_VERSION}) +@@ -22,5 +22,5 @@ +-target_link_libraries(${PROJECT_NAME} zint Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui) ++target_link_libraries(${PROJECT_NAME} PUBLIC zint Qt${QT_VERSION_MAJOR}::Gui) + + + install(TARGETS ${PROJECT_NAME} ${INSTALL_TARGETS_DEFAULT_ARGS}) +-install(FILES qzint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) ++install(FILES qzint.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Devel) +--- backend/zint.h ++++ backend/zint.h +@@ -315,7 +315,7 @@ + #define ZINT_DEBUG_TEST 2 /* For internal test use only */ + + #ifdef _WIN32 +-# if defined(DLL_EXPORT) || defined(PIC) || defined(_USRDLL) ++# if defined(ZINT_BUILD_DLL) + # define ZINT_EXTERN __declspec(dllexport) + # elif defined(ZINT_DLL) + # define ZINT_EXTERN __declspec(dllimport) +--- backend_qt/qzint.h ++++ backend_qt/qzint.h +@@ -24,8 +25,18 @@ + + namespace Zint + { +- +-class QZint : public QObject ++#ifdef _WIN32 ++# ifdef QZINT_BUILD_DLL ++# define QZINT_EXTERN __declspec(dllexport) ++# elif defined(QZINT_DLL) ++# define QZINT_EXTERN __declspec(dllimport) ++# else ++# define QZINT_EXTERN ++# endif ++#else ++# define QZINT_EXTERN ++#endif ++class QZINT_EXTERN QZint : public QObject + { + Q_OBJECT + diff --git a/recipes/zint/all/test_package/CMakeLists.txt b/recipes/zint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..14bd143a5e4a6 --- /dev/null +++ b/recipes/zint/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +option(ZINT_WITH_QT "Zint has been built with Qt support") +if(ZINT_WITH_QT) + enable_language(CXX) +endif() + +find_package(Zint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Zint::Zint) + +if(ZINT_WITH_QT) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE Zint::QZint) +endif() diff --git a/recipes/zint/all/test_package/conanfile.py b/recipes/zint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1617e37109bc2 --- /dev/null +++ b/recipes/zint/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ZINT_WITH_QT"] = self.dependencies["zint"].options.with_qt + 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") + if self.options["zint"].with_qt: + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/zint/all/test_package/test_package.c b/recipes/zint/all/test_package/test_package.c new file mode 100644 index 0000000000000..3466267e80a97 --- /dev/null +++ b/recipes/zint/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include "zint.h" + +#include + +#define ZINT_MAJOR(V) (((V)/10000) % 100) +#define ZINT_MINOR(V) (((V)/ 100) % 100) +#define ZINT_PATCH(V) (((V) ) % 100) + + +int main() { + struct zint_symbol *zbar = ZBarcode_Create(); + ZBarcode_Delete(zbar); + + int version = ZBarcode_Version(); + printf("Zint version: %d.%d.%d\n", ZINT_MAJOR(version), ZINT_MINOR(version), ZINT_PATCH(version)); +} diff --git a/recipes/zint/all/test_package/test_package.cpp b/recipes/zint/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4783f147aafde --- /dev/null +++ b/recipes/zint/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "qzint.h" + +#include + +#define ZINT_MAJOR(V) (((V)/10000) % 100) +#define ZINT_MINOR(V) (((V)/ 100) % 100) +#define ZINT_PATCH(V) (((V) ) % 100) + +int main() { + Zint::QZint qzint; + int version = qzint.getVersion(); + std::cout << "zint version: " << ZINT_MAJOR(version) << "." << ZINT_MINOR(version) << "." << ZINT_PATCH(version) << "\n"; +} diff --git a/recipes/zint/all/test_v1_package/CMakeLists.txt b/recipes/zint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d155f1e77d4aa --- /dev/null +++ b/recipes/zint/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +option(ZINT_WITH_QT "Zint has been built with Qt support") +if(ZINT_WITH_QT) + enable_language(CXX) +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Zint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Zint::Zint) + +if(ZINT_WITH_QT) + add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE Zint::QZint) +endif() diff --git a/recipes/zint/all/test_v1_package/conanfile.py b/recipes/zint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1ce37b6a52e77 --- /dev/null +++ b/recipes/zint/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ZINT_WITH_QT"] = self.options["zint"].with_qt + 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.options["zint"].with_qt: + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) diff --git a/recipes/zint/config.yml b/recipes/zint/config.yml new file mode 100644 index 0000000000000..22d65dcfdfac6 --- /dev/null +++ b/recipes/zint/config.yml @@ -0,0 +1,3 @@ +versions: + "2.10.0": + folder: all diff --git a/recipes/zlib-ng/all/conandata.yml b/recipes/zlib-ng/all/conandata.yml new file mode 100644 index 0000000000000..81a85da093ebb --- /dev/null +++ b/recipes/zlib-ng/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.0.7": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.tar.gz" + sha256: "6c0853bb27738b811f2b4d4af095323c3d5ce36ceed6b50e5f773204fb8f7200" + "2.0.6": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.6.tar.gz" + sha256: "8258b75a72303b661a238047cb348203d88d9dddf85d480ed885f375916fcab6" + "2.0.5": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.5.tar.gz" + sha256: "eca3fe72aea7036c31d00ca120493923c4d5b99fe02e6d3322f7c88dbdcd0085" + "2.0.2": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.2.tar.gz" + sha256: "dd37886f22ca6890e403ea6c1d60f36eab1d08d2f232a35f5b02126621149d28" diff --git a/recipes/zlib-ng/all/conanfile.py b/recipes/zlib-ng/all/conanfile.py new file mode 100644 index 0000000000000..810ef7d7bdec6 --- /dev/null +++ b/recipes/zlib-ng/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ZlibNgConan(ConanFile): + name = "zlib-ng" + description = "zlib data compression library for the next generation systems" + topics = ("zlib", "compression") + license ="Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zlib-ng/zlib-ng/" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "zlib_compat": [True, False], + "with_gzfileop": [True, False], + "with_optim": [True, False], + "with_new_strategies": [True, False], + "with_native_instructions": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "zlib_compat": False, + "with_gzfileop": True, + "with_optim": False, + "with_new_strategies": True, + "with_native_instructions": False, + } + + 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 self.info.options.zlib_compat and not self.info.options.with_gzfileop: + raise ConanInvalidConfiguration("The option 'with_gzfileop' must be True when 'zlib_compat' is True.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ZLIB_ENABLE_TESTS"] = False + tc.variables["ZLIB_COMPAT"] = self.options.zlib_compat + tc.variables["WITH_GZFILEOP"] = self.options.with_gzfileop + tc.variables["WITH_OPTIM"] = self.options.with_optim + tc.variables["WITH_NEW_STRATEGIES"] = self.options.with_new_strategies + tc.variables["WITH_NATIVE_INSTRUCTIONS"] = self.options.with_native_instructions + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + license_folder = os.path.join(self.package_folder, "licenses") + copy(self, "LICENSE.md", src=self.source_folder, dst=license_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + # upstream CMakeLists intentionally hardcodes install_name with full + # install path (to match autootools behavior), instead of @rpath + fix_apple_shared_install_name(self) + + def package_info(self): + #FIXME: CMake targets are https://github.com/zlib-ng/zlib-ng/blob/29fd4672a2279a0368be936d7cd44d013d009fae/CMakeLists.txt#L914 + suffix = "" if self.options.zlib_compat else "-ng" + self.cpp_info.set_property("pkg_config_name", f"zlib{suffix}") + if self.settings.os == "Windows": + # The library name of zlib-ng is complicated in zlib-ng>=2.0.4: + # https://github.com/zlib-ng/zlib-ng/blob/2.0.4/CMakeLists.txt#L994-L1016 + base = "zlib" if is_msvc(self) or Version(self.version) < "2.0.4" or self.options.shared else "z" + static_flag = "static" if is_msvc(self) and not self.options.shared and Version(self.version) >= "2.0.4" else "" + build_type = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"{base}{static_flag}{suffix}{build_type}"] + else: + self.cpp_info.libs = [f"z{suffix}"] + if self.options.zlib_compat: + self.cpp_info.defines.append("ZLIB_COMPAT") + if self.options.with_gzfileop: + self.cpp_info.defines.append("WITH_GZFILEOP") + if not self.options.with_new_strategies: + self.cpp_info.defines.extend(["NO_QUICK_STRATEGY", "NO_MEDIUM_STRATEGY"]) diff --git a/recipes/zlib-ng/all/test_package/CMakeLists.txt b/recipes/zlib-ng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1afe7de5d08fc --- /dev/null +++ b/recipes/zlib-ng/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(zlib-ng REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zlib-ng::zlib-ng) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/zlib-ng/all/test_package/conanfile.py b/recipes/zlib-ng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0f34761d1525c --- /dev/null +++ b/recipes/zlib-ng/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/zlib-ng/all/test_package/test_package.c b/recipes/zlib-ng/all/test_package/test_package.c new file mode 100644 index 0000000000000..b8a7330c8edef --- /dev/null +++ b/recipes/zlib-ng/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include + +#ifdef ZLIB_COMPAT +# include "zlib.h" +# define ZLIB_VERSION zlibVersion +#else +# include "zlib-ng.h" +# define ZLIB_VERSION zlibng_version +#endif + +int main(void) { + printf("ZLIB NG VERSION: %s\n", ZLIB_VERSION()); + return EXIT_SUCCESS; +} diff --git a/recipes/zlib-ng/all/test_v1_package/CMakeLists.txt b/recipes/zlib-ng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zlib-ng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zlib-ng/all/test_v1_package/conanfile.py b/recipes/zlib-ng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zlib-ng/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/zlib-ng/config.yml b/recipes/zlib-ng/config.yml new file mode 100644 index 0000000000000..5e344c7c2810f --- /dev/null +++ b/recipes/zlib-ng/config.yml @@ -0,0 +1,9 @@ +versions: + "2.0.7": + folder: all + "2.0.6": + folder: all + "2.0.5": + folder: all + "2.0.2": + folder: all diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml new file mode 100644 index 0000000000000..4da75436b4d71 --- /dev/null +++ b/recipes/zlib/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.2.13": + url: + - "https://zlib.net/fossils/zlib-1.2.13.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz" + sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" + "1.2.12": + url: "https://zlib.net/fossils/zlib-1.2.12.tar.gz" + sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" + "1.2.11": + url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" + sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" +patches: + "1.2.13": + - patch_file: "patches/1.2.13/0001-Fix-cmake.patch" + - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" + "1.2.12": + - patch_file: "patches/1.2.x/0001-fix-cmake.patch" + - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" + - patch_file: "patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch" + patch_description: "CVE-2022-37434: Fix a bug when getting a gzip header extra field with inflate()" + patch_type: "vulnerability" + patch_source: "https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1" + sha256: "15e3c177dc2a034a22e02490a97ba5b1719aae3f8129a06c16d727b661d1650f" + - patch_file: "patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch" + patch_description: "CVE-2022-37434: Fix extra field processing bug that dereferences NULL state->head" + patch_type: "vulnerability" + patch_source: "https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d" + sha256: "cdd69eb3251728b1875c8ecae6427b50aa750b4045ef984ab79b6c07b7e6dd3a" + "1.2.11": + - patch_file: "patches/1.2.x/0001-fix-cmake.patch" + - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" + # https://github.com/madler/zlib/issues/268 + - patch_file: "patches/1.2.x/0003-gzguts-fix-widechar-condition.patch" diff --git a/recipes/zlib/all/conanfile.py b/recipes/zlib/all/conanfile.py new file mode 100644 index 0000000000000..716ee2007ab06 --- /dev/null +++ b/recipes/zlib/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, load, replace_in_file, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ZlibConan(ConanFile): + name = "zlib" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://zlib.net" + license = "Zlib" + description = ("A Massively Spiffy Yet Delicately Unobtrusive Compression Library " + "(Also Free, Not to Mention Unencumbered by Patents)") + topics = ("zlib", "compression") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SKIP_INSTALL_ALL"] = False + tc.variables["SKIP_INSTALL_LIBRARIES"] = False + tc.variables["SKIP_INSTALL_HEADERS"] = False + tc.variables["SKIP_INSTALL_FILES"] = True + # Correct for misuse of "${CMAKE_INSTALL_PREFIX}/" in CMakeLists.txt + tc.variables["INSTALL_LIB_DIR"] = "lib" + tc.variables["INSTALL_INC_DIR"] = "include" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + is_apple_clang12 = self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "12.0" + if not is_apple_clang12: + for filename in ['zconf.h', 'zconf.h.cmakein', 'zconf.h.in']: + filepath = os.path.join(self.source_folder, filename) + replace_in_file(self, filepath, + '#ifdef HAVE_UNISTD_H ' + '/* may be set to #if 1 by ./configure */', + '#if defined(HAVE_UNISTD_H) && (1-HAVE_UNISTD_H-1 != 0)') + replace_in_file(self, filepath, + '#ifdef HAVE_STDARG_H ' + '/* may be set to #if 1 by ./configure */', + '#if defined(HAVE_STDARG_H) && (1-HAVE_STDARG_H-1 != 0)') + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _extract_license(self): + tmp = load(self, os.path.join(self.source_folder, "zlib.h")) + license_contents = tmp[2:tmp.find("*/", 1)] + return license_contents + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ZLIB") + self.cpp_info.set_property("cmake_target_name", "ZLIB::ZLIB") + self.cpp_info.set_property("pkg_config_name", "zlib") + if self.settings.os == "Windows" and not self._is_mingw: + libname = "zdll" if self.options.shared else "zlib" + else: + libname = "z" + self.cpp_info.libs = [libname] + + self.cpp_info.names["cmake_find_package"] = "ZLIB" + self.cpp_info.names["cmake_find_package_multi"] = "ZLIB" diff --git a/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch new file mode 100644 index 0000000000000..a0748ec590d90 --- /dev/null +++ b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch @@ -0,0 +1,118 @@ +From 9a709a43549fbe23ca41eeb450d4c71e3b78c8c4 Mon Sep 17 00:00:00 2001 +From: Mikhail Lappo +Date: Fri, 14 Oct 2022 13:29:56 +0200 +Subject: [PATCH] Fix cmake + +--- + CMakeLists.txt | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b412dc7..a5284ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.4.4) ++cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 + set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) + + project(zlib C) +@@ -57,7 +57,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -80,7 +79,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein + ${ZLIB_PC} @ONLY) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) ++include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + + + #============================================================================ +@@ -120,7 +119,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -131,7 +130,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -145,12 +144,15 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -163,19 +165,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -194,6 +201,7 @@ endif() + # Example binaries + #============================================================================ + ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -211,3 +219,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() +-- +2.24.3 (Apple Git-128) + diff --git a/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch new file mode 100644 index 0000000000000..f99f0b5219682 --- /dev/null +++ b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch @@ -0,0 +1,104 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.4.4) ++cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 + set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) + + project(zlib C) +@@ -60,7 +60,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -83,7 +82,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein + ${ZLIB_PC} @ONLY) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) ++include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + + + #============================================================================ +@@ -123,7 +122,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -167,7 +166,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -181,12 +180,15 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -199,19 +201,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -230,6 +237,7 @@ endif() + # Example binaries + #============================================================================ + ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -247,3 +255,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() diff --git a/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch b/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch new file mode 100644 index 0000000000000..3f81a6f53a248 --- /dev/null +++ b/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch @@ -0,0 +1,27 @@ +From 4ff188d490445fe7bad629a94d5bf4b641d4ab8d Mon Sep 17 00:00:00 2001 +From: Tim Blechmann +Date: Thu, 2 Jul 2020 12:04:38 +0800 +Subject: [PATCH] xcode12 compile fix + +--- + gzguts.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/gzguts.h b/gzguts.h +index 990a4d2..c78cb40 100644 +--- a/gzguts.h ++++ b/gzguts.h +@@ -26,6 +26,10 @@ + # include + #endif + ++#ifdef __APPLE__ ++#include ++#endif ++ + #ifndef _POSIX_SOURCE + # define _POSIX_SOURCE + #endif +-- +2.27.0 + diff --git a/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch b/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch new file mode 100644 index 0000000000000..56b3fbe76ce8e --- /dev/null +++ b/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch @@ -0,0 +1,13 @@ +diff --git a/gzguts.h b/gzguts.h +index c78cb40..4e9ec4f 100644 +--- a/gzguts.h ++++ b/gzguts.h +@@ -43,7 +43,7 @@ + # include + #endif + +-#if defined(_WIN32) || defined(__CYGWIN__) ++#if defined(_WIN32) + # define WIDECHAR + #endif + diff --git a/recipes/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch b/recipes/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch new file mode 100644 index 0000000000000..80eed3e0c3e95 --- /dev/null +++ b/recipes/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch @@ -0,0 +1,35 @@ +From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Sat, 30 Jul 2022 15:51:11 -0700 +Subject: [PATCH] Fix a bug when getting a gzip header extra field with + inflate(). + +If the extra field was larger than the space the user provided with +inflateGetHeader(), and if multiple calls of inflate() delivered +the extra header data, then there could be a buffer overflow of the +provided space. This commit assures that provided space is not +exceeded. +--- + inflate.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7be8c63..7a72897 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,9 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { ++ len = state->head->extra_len - state->length; + if (state->head != Z_NULL && +- state->head->extra != Z_NULL) { +- len = state->head->extra_len - state->length; ++ state->head->extra != Z_NULL && ++ len < state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); +-- +2.25.1 + diff --git a/recipes/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch b/recipes/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch new file mode 100644 index 0000000000000..f34c4019fbf35 --- /dev/null +++ b/recipes/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch @@ -0,0 +1,32 @@ +From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Mon, 8 Aug 2022 10:50:09 -0700 +Subject: [PATCH] Fix extra field processing bug that dereferences NULL + state->head. + +The recent commit to fix a gzip header extra field processing bug +introduced the new bug fixed here. +--- + inflate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7a72897..2a3c4fe 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,10 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { +- len = state->head->extra_len - state->length; + if (state->head != Z_NULL && + state->head->extra != Z_NULL && +- len < state->head->extra_max) { ++ (len = state->head->extra_len - state->length) < ++ state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); +-- +2.25.1 + diff --git a/recipes/zlib/all/test_package/CMakeLists.txt b/recipes/zlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6369d1f250672 --- /dev/null +++ b/recipes/zlib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ZLIB REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) diff --git a/recipes/zlib/all/test_package/conanfile.py b/recipes/zlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/zlib/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zlib/all/test_package/test_package.c b/recipes/zlib/all/test_package/test_package.c new file mode 100644 index 0000000000000..4c3da30d46136 --- /dev/null +++ b/recipes/zlib/all/test_package/test_package.c @@ -0,0 +1,32 @@ +#include +#include +#include + +#include + +int main(void) { + char buffer_in [32] = {"Conan Package Manager"}; + char buffer_out [32] = {0}; + + z_stream defstream; + defstream.zalloc = Z_NULL; + defstream.zfree = Z_NULL; + defstream.opaque = Z_NULL; + defstream.avail_in = (uInt) strlen(buffer_in); + defstream.next_in = (Bytef *) buffer_in; + defstream.avail_out = (uInt) sizeof(buffer_out); + defstream.next_out = (Bytef *) buffer_out; + + deflateInit(&defstream, Z_BEST_COMPRESSION); + deflate(&defstream, Z_FINISH); + deflateEnd(&defstream); + + printf("Compressed size is: %lu\n", strlen(buffer_in)); + printf("Compressed string is: %s\n", buffer_in); + printf("Compressed size is: %lu\n", strlen(buffer_out)); + printf("Compressed string is: %s\n", buffer_out); + + printf("ZLIB VERSION: %s\n", zlibVersion()); + + return EXIT_SUCCESS; +} diff --git a/recipes/zlib/all/test_v1_package/CMakeLists.txt b/recipes/zlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..eecfa28256816 --- /dev/null +++ b/recipes/zlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ZLIB REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) diff --git a/recipes/zlib/all/test_v1_package/conanfile.py b/recipes/zlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0245c9a8028a3 --- /dev/null +++ b/recipes/zlib/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/zlib/config.yml b/recipes/zlib/config.yml new file mode 100644 index 0000000000000..351c06f68201f --- /dev/null +++ b/recipes/zlib/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.13": + folder: all + "1.2.12": + folder: all + "1.2.11": + folder: all diff --git a/recipes/zmarok-semver/all/conandata.yml b/recipes/zmarok-semver/all/conandata.yml new file mode 100644 index 0000000000000..7dae57dd5da23 --- /dev/null +++ b/recipes/zmarok-semver/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.1.0": + url: "https://github.com/zmarko/semver/archive/refs/tags/1.1.0.tar.gz" + sha256: bbea7e679684331b1059b773786559d790dd7aaa1e5ca24c0de12c9d5a4f2aed +patches: + "1.1.0": + - patch_file: "patches/0001-unused-var-fix.patch" + patch_description: "Avoids: error: unused parameter 's' [-Werror,-Wunused-parameter]" + patch_source: "https://github.com/zmarko/semver/pull/4" + patch_type: "portability" + sha256: "ea7b241e8f37295e7943977fc66eaa6fa85d647b73c8cc1f4b566fd8078b0897" + - patch_file: "patches/0002-macro-invocation-fix.patch" + patch_description: "Fix minor() and major() macros invocation" + patch_type: "portability" + sha256: "ae12e00b4e1710b105491283ea10fa9c8e8015c623ce6784645f709b3a00efd7" diff --git a/recipes/zmarok-semver/all/conanfile.py b/recipes/zmarok-semver/all/conanfile.py new file mode 100644 index 0000000000000..f6c7fed3955f2 --- /dev/null +++ b/recipes/zmarok-semver/all/conanfile.py @@ -0,0 +1,83 @@ +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 CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + + +required_conan_version = ">=1.53.0" + + +class ZmarokSemverConan(ConanFile): + name = "zmarok-semver" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zmarko/semver" + description = "Semantic versioning for cpp14" + topics = ("versioning", "semver", "semantic") + package_type = "library" + settings = "os", "compiler", "arch", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Shared library on Windows is not supported.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + gt = CMakeToolchain(self) + gt.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # Parent Build system does not support installation; so we must manually package + hdr_src = os.path.join(self.source_folder, "include") + hdr_dst = os.path.join(self.package_folder, "include") + copy(self, "*.h", hdr_src, hdr_dst) + copy(self, "*.inl", hdr_src, hdr_dst) + + lib_dir = os.path.join(self.package_folder, "lib") + copy(self, "*.a", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.lib", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.so", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.dylib", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.dll*", self.build_folder, os.path.join(self.package_folder, "bin"), keep_path=False) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["semver"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/zmarok-semver/all/patches/0001-unused-var-fix.patch b/recipes/zmarok-semver/all/patches/0001-unused-var-fix.patch new file mode 100644 index 0000000000000..ced2c1874a5ea --- /dev/null +++ b/recipes/zmarok-semver/all/patches/0001-unused-var-fix.patch @@ -0,0 +1,19 @@ +diff -Naur a/src/Semver200_modifier.cpp b/src/Semver200_modifier.cpp +--- a/src/Semver200_modifier.cpp 2021-04-06 19:10:15.986509743 +0000 ++++ b/src/Semver200_modifier.cpp 2021-04-06 19:10:49.807335550 +0000 +@@ -50,7 +50,7 @@ + return Version_data{ s.major, s.minor, s.patch, s.prerelease_ids, b }; + } + +- Version_data Semver200_modifier::reset_major(const Version_data& s, const int m) const { ++ Version_data Semver200_modifier::reset_major(const Version_data&, const int m) const { + if (m < 0) throw Modification_error("major version cannot be less than 0"); + return Version_data{ m, 0, 0, Prerelease_identifiers{}, Build_identifiers{} }; + } +@@ -72,4 +72,4 @@ + Version_data Semver200_modifier::reset_build(const Version_data& s, const Build_identifiers& b) const { + return Version_data{ s.major, s.minor, s.patch, s.prerelease_ids, b }; + } +-} +\ No newline at end of file ++} diff --git a/recipes/zmarok-semver/all/patches/0002-macro-invocation-fix.patch b/recipes/zmarok-semver/all/patches/0002-macro-invocation-fix.patch new file mode 100644 index 0000000000000..db731711c9a13 --- /dev/null +++ b/recipes/zmarok-semver/all/patches/0002-macro-invocation-fix.patch @@ -0,0 +1,32 @@ +diff -Naur a/include/version.h b/include/version.h +--- a/include/version.h 2019-03-27 02:47:58.000000000 -0700 ++++ b/include/version.h 2022-08-18 09:01:59.633528129 -0700 +@@ -148,8 +148,8 @@ + /// Copy version data from another Basic_version to this one. + Basic_version& operator=(const Basic_version&); + +- int major() const; ///< Get major version. +- int minor() const; ///< Get minor version. ++ int (major)() const; ///< Get major version. ++ int (minor)() const; ///< Get minor version. + int patch() const; ///< Get patch version. + const std::string prerelease() const; ///< Get prerelease version string. + const std::string build() const; ///< Get build version string. +diff -Naur a/include/version.inl b/include/version.inl +--- a/include/version.inl 2019-03-27 02:47:58.000000000 -0700 ++++ b/include/version.inl 2022-08-18 09:01:30.821575915 -0700 +@@ -65,12 +65,12 @@ + const Basic_version&) = default; + + template +- int Basic_version::major() const { ++ int (Basic_version::major)() const { + return ver_.major; + } + + template +- int Basic_version::minor() const { ++ int (Basic_version::minor)() const { + return ver_.minor; + } + diff --git a/recipes/zmarok-semver/all/test_package/CMakeLists.txt b/recipes/zmarok-semver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..42864628c0b43 --- /dev/null +++ b/recipes/zmarok-semver/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(zmarok-semver CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zmarok-semver::zmarok-semver) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14) diff --git a/recipes/zmarok-semver/all/test_package/conanfile.py b/recipes/zmarok-semver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..855a59d17eb40 --- /dev/null +++ b/recipes/zmarok-semver/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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" + + 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/zmarok-semver/all/test_package/test_package.cpp b/recipes/zmarok-semver/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9623d442bf5a8 --- /dev/null +++ b/recipes/zmarok-semver/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main(void) { + auto ver{version::Semver200_version("1.0.1+22910")}; + std::cout << "Parsed Major: " << (ver.major)() << std::endl; + return 0; +} diff --git a/recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt b/recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zmarok-semver/all/test_v1_package/conanfile.py b/recipes/zmarok-semver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2263c38965a38 --- /dev/null +++ b/recipes/zmarok-semver/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile +from conans import CMake +from conan.tools.build import cross_building +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/zmarok-semver/config.yml b/recipes/zmarok-semver/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/zmarok-semver/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/zmqpp/all/conandata.yml b/recipes/zmqpp/all/conandata.yml new file mode 100644 index 0000000000000..b8b843edf38c8 --- /dev/null +++ b/recipes/zmqpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "4.2.0": + url: "https://github.com/zeromq/zmqpp/archive/4.2.0.tar.gz" + sha256: "c1d4587df3562f73849d9e5f8c932ca7dcfc7d8bec31f62d7f35073ef81f4d29" +patches: + "4.2.0": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-missing-includes.patch" + - patch_file: "patches/0003-Allow-building-with-Werror-undef.patch" diff --git a/recipes/zmqpp/all/conanfile.py b/recipes/zmqpp/all/conanfile.py new file mode 100644 index 0000000000000..8d4bf7d455227 --- /dev/null +++ b/recipes/zmqpp/all/conanfile.py @@ -0,0 +1,87 @@ +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 ZmqppConan(ConanFile): + name = "zmqpp" + homepage = "https://github.com/zeromq/zmqpp" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "This C++ binding for 0mq/zmq is a 'high-level' library that hides " + "most of the c-style interface core 0mq provides." + ) + topics = ("zmq", "0mq", "zeromq", "message-queue", "asynchronous") + + 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: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zeromq/4.3.4") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # No bool cast until https://github.com/conan-io/conan/pull/12086 (conan 1.53.0) + tc.cache_variables["ZMQPP_LIBZMQ_CMAKE"] = "ON" + tc.cache_variables["ZMQPP_BUILD_STATIC"] = "OFF" if self.options.shared else "ON" + tc.cache_variables["ZMQPP_BUILD_SHARED"] = "ON" if self.options.shared else "OFF" + tc.cache_variables["ZMQPP_BUILD_EXAMPLES"] = "OFF" + tc.cache_variables["ZMQPP_BUILD_CLIENT"] = "OFF" + tc.cache_variables["ZMQPP_BUILD_TESTS"] = "OFF" + 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", 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("pkg_config_name", "libzmqpp") + self.cpp_info.libs = ["zmqpp" if self.options.shared else "zmqpp-static"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/zmqpp/all/patches/0001-fix-cmake.patch b/recipes/zmqpp/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..bc1a37ef765be --- /dev/null +++ b/recipes/zmqpp/all/patches/0001-fix-cmake.patch @@ -0,0 +1,103 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,14 +11,17 @@ + # + + +-cmake_minimum_required(VERSION 2.8.12) ++cmake_minimum_required(VERSION 3.8) ++project(zmqpp) + enable_testing() + + # prepare C++11 ++if(0) + set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") + + # show all warnings + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic") ++endif() + + # Set compiler flags that don't work on Windows + if(NOT MSVC) +@@ -31,7 +34,7 @@ endif() + # remove this block (see CMP0042). + # + # TODO: verify correctness of this flag +-if(NOT DEFINED CMAKE_MACOSX_RPATH) ++if(0) + set(CMAKE_MACOSX_RPATH 0) + endif() + +@@ -60,11 +63,11 @@ set( ZEROMQ_LIB_DIR "" CACHE PATH "The library directory for libzmq" + set( ZEROMQ_INCLUDE_DIR "" CACHE PATH "The include directory for ZMQ" ) + + # Build flags +-set( IS_TRAVIS_CI_BUILD true CACHE bool "Defines TRAVIS_CI_BUILD - Should the tests avoid running cases where memory is scarce." ) ++set( IS_TRAVIS_CI_BUILD true CACHE BOOL "Defines TRAVIS_CI_BUILD - Should the tests avoid running cases where memory is scarce." ) + + # Find zmq.h and add its dir to the includes +-find_path(ZEROMQ_INCLUDE zmq.h PATHS ${ZEROMQ_INCLUDE_DIR}) +-include_directories(${ZEROMQ_INCLUDE_DIR} ${ZEROMQ_INCLUDE} ${CMAKE_CURRENT_SOURCE_DIR}/src ) ++find_package(ZeroMQ REQUIRED CONFIG) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src ) + + # Do not run some tests when building on travis-ci (this cause oom error and kill the test + # process) +@@ -107,7 +110,8 @@ set( LIBZMQPP_SOURCES + # Staticlib + if (ZMQPP_BUILD_STATIC) + add_library( zmqpp-static STATIC ${LIBZMQPP_SOURCES}) +- target_compile_definitions(zmqpp-static PUBLIC ZMQ_STATIC ZMQPP_STATIC_DEFINE) ++ target_compile_definitions(zmqpp-static PUBLIC ZMQPP_STATIC_DEFINE) ++ target_compile_features(zmqpp-static PRIVATE cxx_std_11) + if (NOT ZMQPP_LIBZMQ_CMAKE) + find_library(ZEROMQ_LIBRARY_STATIC ${ZMQPP_LIBZMQ_NAME_STATIC} PATHS ${ZEROMQ_LIB_DIR}) + if (NOT ZEROMQ_LIBRARY_STATIC) +@@ -118,7 +122,7 @@ if (ZMQPP_BUILD_STATIC) + else() + # libzmq-static is the name of the target from + # libzmq's CMake +- target_link_libraries(zmqpp-static libzmq-static) ++ target_link_libraries(zmqpp-static $,libzmq,libzmq-static>) + endif() + list( APPEND INSTALL_TARGET_LIST zmqpp-static) + set( LIB_TO_LINK_TO_EXAMPLES zmqpp-static ) +@@ -127,13 +131,14 @@ endif() # ZMQPP_BUILD_STATIC + # Shared lib + if (ZMQPP_BUILD_SHARED) + add_library( zmqpp SHARED ${LIBZMQPP_SOURCES}) ++ target_compile_features(zmqpp PRIVATE cxx_std_11) + if (NOT ZMQPP_LIBZMQ_CMAKE) + find_library(ZEROMQ_LIBRARY_SHARED ${ZMQPP_LIBZMQ_NAME_SHARED} PATHS ${ZEROMQ_LIB_DIR}) + target_link_libraries( zmqpp ${ZEROMQ_LIBRARY_SHARED} ) + else() + # libzmq is the name of the target from + # libzmq's CMake +- target_link_libraries(zmqpp libzmq) ++ target_link_libraries(zmqpp $,libzmq,libzmq-static>) + endif() + list( APPEND INSTALL_TARGET_LIST zmqpp) + set( LIB_TO_LINK_TO_EXAMPLES zmqpp ) +@@ -141,11 +146,22 @@ endif() # ZMQPP_BUILD_SHARED + + # We need to link zmqpp to ws2_32 on windows for the implementation of winsock2.h + if(WIN32) ++ if(ZMQPP_BUILD_STATIC) ++ target_link_libraries(zmqpp-static ws2_32) ++ target_compile_definitions(zmqpp-static PRIVATE NOMINMAX) ++ endif() ++ if(ZMQPP_BUILD_SHARED) + target_link_libraries(zmqpp ws2_32) ++ target_compile_definitions(zmqpp PRIVATE NOMINMAX) ++ endif() + endif() # WIN32 + + include(GenerateExportHeader) ++if(ZMQPP_BUILD_SHARED) + generate_export_header(zmqpp) ++elseif(ZMQPP_BUILD_STATIC) ++ generate_export_header(zmqpp-static BASE_NAME zmqpp) ++endif() + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + + # Examples diff --git a/recipes/zmqpp/all/patches/0002-missing-includes.patch b/recipes/zmqpp/all/patches/0002-missing-includes.patch new file mode 100644 index 0000000000000..63b6bc05b5995 --- /dev/null +++ b/recipes/zmqpp/all/patches/0002-missing-includes.patch @@ -0,0 +1,30 @@ +--- a/src/zmqpp/compatibility.hpp ++++ b/src/zmqpp/compatibility.hpp +@@ -35,6 +35,7 @@ + // Include export file if on windows, generated by cmake only + #if _WIN32 + #include "zmqpp_export.h" ++ #include + #else + #define ZMQPP_EXPORT + #endif +--- a/src/zmqpp/zap_request.cpp ++++ b/src/zmqpp/zap_request.cpp +@@ -20,12 +20,16 @@ + #include "z85.hpp" + #include "byte_ordering.hpp" + #include +- ++ + #ifndef _WIN32 + #include + #endif + + #if (ZMQ_VERSION_MAJOR > 3) ++#include ++#include ++#include ++#include + + namespace zmqpp + { diff --git a/recipes/zmqpp/all/patches/0003-Allow-building-with-Werror-undef.patch b/recipes/zmqpp/all/patches/0003-Allow-building-with-Werror-undef.patch new file mode 100644 index 0000000000000..8983dc330e606 --- /dev/null +++ b/recipes/zmqpp/all/patches/0003-Allow-building-with-Werror-undef.patch @@ -0,0 +1,13 @@ +--- a/src/zmqpp/compatibility.hpp ++++ b/src/zmqpp/compatibility.hpp +@@ -33,7 +33,7 @@ + #include + + // Include export file if on windows, generated by cmake only +-#if _WIN32 ++#ifdef _WIN32 + #include "zmqpp_export.h" + #include + #else + #define ZMQPP_EXPORT + diff --git a/recipes/zmqpp/all/test_package/CMakeLists.txt b/recipes/zmqpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18add93ce2d95 --- /dev/null +++ b/recipes/zmqpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(zmqpp REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zmqpp::zmqpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/zmqpp/all/test_package/conanfile.py b/recipes/zmqpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/zmqpp/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/zmqpp/all/test_package/test_package.cpp b/recipes/zmqpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ad960d71a169f --- /dev/null +++ b/recipes/zmqpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char* argv[]) +{ + std::cout << zmqpp::version() << std::endl; + zmqpp::context ctx; // throws on error + return 0; +} diff --git a/recipes/zmqpp/all/test_v1_package/CMakeLists.txt b/recipes/zmqpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/zmqpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zmqpp/all/test_v1_package/conanfile.py b/recipes/zmqpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zmqpp/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/zmqpp/config.yml b/recipes/zmqpp/config.yml new file mode 100644 index 0000000000000..1b309b8e878d8 --- /dev/null +++ b/recipes/zmqpp/config.yml @@ -0,0 +1,3 @@ +versions: + "4.2.0": + folder: "all" diff --git a/recipes/zopfli/all/conandata.yml b/recipes/zopfli/all/conandata.yml new file mode 100644 index 0000000000000..7ac710306833a --- /dev/null +++ b/recipes/zopfli/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.3": + url: "https://github.com/google/zopfli//archive/refs/tags/zopfli-1.0.3.tar.gz" + sha256: "e955a7739f71af37ef3349c4fa141c648e8775bceb2195be07e86f8e638814bd" diff --git a/recipes/zopfli/all/conanfile.py b/recipes/zopfli/all/conanfile.py new file mode 100644 index 0000000000000..1f0b88e512435 --- /dev/null +++ b/recipes/zopfli/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile, conan_version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class ZopfliConan(ConanFile): + name = "zopfli" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/zopfli/" + description = ( + "Zopfli Compression Algorithm is a compression library programmed in C " + "to perform very good, but slow, deflate or zlib compression." + ) + topics = ("zopfli", "compression", "deflate", "gzip", "zlib") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + 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["ZOPFLI_BUILD_INSTALL"] = True + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Zopfli") + + self.cpp_info.components["libzopfli"].set_property("cmake_target_name", "Zopfli::libzopfli") + self.cpp_info.components["libzopfli"].libs = ["zopfli"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libzopfli"].system_libs = ["m"] + + self.cpp_info.components["libzopflipng"].set_property("cmake_target_name", "Zopfli::libzopflipng") + self.cpp_info.components["libzopflipng"].libs = ["zopflipng"] + self.cpp_info.components["libzopflipng"].requires = ["libzopfli"] + + if Version(conan_version).major < 2: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.cpp_info.names["cmake_find_package"] = "Zopfli" + self.cpp_info.names["cmake_find_package_multi"] = "Zopfli" diff --git a/recipes/zopfli/all/test_package/CMakeLists.txt b/recipes/zopfli/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..23f9efdde68f0 --- /dev/null +++ b/recipes/zopfli/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Zopfli CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Zopfli::libzopfli) diff --git a/recipes/zopfli/all/test_package/conanfile.py b/recipes/zopfli/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/zopfli/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/zopfli/all/test_package/test_package.c b/recipes/zopfli/all/test_package/test_package.c new file mode 100644 index 0000000000000..983e0f4a56f99 --- /dev/null +++ b/recipes/zopfli/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() +{ + ZopfliOptions options; + ZopfliInitOptions(&options); + return EXIT_SUCCESS; +} diff --git a/recipes/zopfli/all/test_v1_package/CMakeLists.txt b/recipes/zopfli/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d2662cb23a48 --- /dev/null +++ b/recipes/zopfli/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Zopfli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Zopfli::libzopfli) diff --git a/recipes/zopfli/all/test_v1_package/conanfile.py b/recipes/zopfli/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zopfli/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/zopfli/config.yml b/recipes/zopfli/config.yml new file mode 100644 index 0000000000000..0971fbedee1f4 --- /dev/null +++ b/recipes/zopfli/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.3": + folder: "all" diff --git a/recipes/zpp_bits/all/conandata.yml b/recipes/zpp_bits/all/conandata.yml new file mode 100644 index 0000000000000..10471fdb07486 --- /dev/null +++ b/recipes/zpp_bits/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "4.4.13": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.13.tar.gz" + sha256: "817be8218f1ef6ad66f2c18154d16a9577d0f939a29c76cb95c71f7f24c53fe1" + "4.4.12": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.12.tar.gz" + sha256: "0060c36d394ab1fb340120a7d14e45657a72419fd1745426e75d820980fa095a" diff --git a/recipes/zpp_bits/all/conanfile.py b/recipes/zpp_bits/all/conanfile.py new file mode 100644 index 0000000000000..4127bf8c567e7 --- /dev/null +++ b/recipes/zpp_bits/all/conanfile.py @@ -0,0 +1,71 @@ +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 +import os + + +required_conan_version = ">=1.52.0" + + +class ZppBitsConan(ConanFile): + name = "zpp_bits" + description = "A lightweight C++20 serialization and RPC library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eyalz800/zpp_bits" + topics = ("serialization", "rpc", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + "Visual Studio": "17", + "msvc": "193", + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} 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 package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="zpp_bits.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/zpp_bits/all/test_package/CMakeLists.txt b/recipes/zpp_bits/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..73137c5e1e473 --- /dev/null +++ b/recipes/zpp_bits/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(zpp_bits REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zpp_bits::zpp_bits) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/zpp_bits/all/test_package/conanfile.py b/recipes/zpp_bits/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/zpp_bits/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zpp_bits/all/test_package/test_package.cpp b/recipes/zpp_bits/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d533c36161edc --- /dev/null +++ b/recipes/zpp_bits/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +#include "zpp_bits.h" + +struct person { + std::string name; + int age{}; +}; + +int main(void) { + auto [data, in, out] = zpp::bits::data_in_out(); + + out(person{"Person1", 25}, person{"Person2", 35}); + + person p1, p2; + + in(p1, p2); + + std::cout << p1.name << " : " << p1.age << "\n"; + std::cout << p2.name << " : " << p2.age << "\n"; + + return 0; +} diff --git a/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt b/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zpp_bits/all/test_v1_package/conanfile.py b/recipes/zpp_bits/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/zpp_bits/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/zpp_bits/config.yml b/recipes/zpp_bits/config.yml new file mode 100644 index 0000000000000..d7d24328031e4 --- /dev/null +++ b/recipes/zpp_bits/config.yml @@ -0,0 +1,5 @@ +versions: + "4.4.13": + folder: all + "4.4.12": + folder: all diff --git a/recipes/zpp_throwing/all/conandata.yml b/recipes/zpp_throwing/all/conandata.yml new file mode 100644 index 0000000000000..063b5be845f31 --- /dev/null +++ b/recipes/zpp_throwing/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/eyalz800/zpp_throwing/archive/refs/tags/v1.0.tar.gz" + sha256: "e02ef0e028e436ed4382b14796550f48c1d2b5ae02910f10b5b9fe097981ea2f" diff --git a/recipes/zpp_throwing/all/conanfile.py b/recipes/zpp_throwing/all/conanfile.py new file mode 100644 index 0000000000000..6cfaa18e3dd02 --- /dev/null +++ b/recipes/zpp_throwing/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 get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class ZppThrowingConan(ConanFile): + name = "zpp_throwing" + description = "Using coroutines to implement C++ exceptions for freestanding environments" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eyalz800/zpp_throwing" + topics = ("coroutines", "exceptions", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "17", + "msvc": "193", + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + # TODO: currently msvc isn't suppported + # see https://github.com/eyalz800/zpp_throwing/issues/7 + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC (yet). See https://github.com/eyalz800/zpp_throwing/issues/7") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support.", + ) + + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "14" and self.settings.compiler.get_safe("libcxx") != "libc++": + raise ConanInvalidConfiguration(f"{self.ref} requires libc++ with 'coroutines' supported on your compiler.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": + self.cpp_info.cxxflags.append("-fcoroutines-ts") + diff --git a/recipes/zpp_throwing/all/test_package/CMakeLists.txt b/recipes/zpp_throwing/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d33f96e054b5 --- /dev/null +++ b/recipes/zpp_throwing/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(zpp_throwing REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zpp_throwing::zpp_throwing) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/zpp_throwing/all/test_package/conanfile.py b/recipes/zpp_throwing/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/zpp_throwing/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zpp_throwing/all/test_package/test_package.cpp b/recipes/zpp_throwing/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c723a245f1637 --- /dev/null +++ b/recipes/zpp_throwing/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include +#include + +#include "zpp_throwing.h" + +zpp::throwing foo(bool success) { + if (!success) { + // Throws an exception. + co_yield std::runtime_error("My runtime error"); + } + + // Returns a value. + co_return 1337; +} + +int main() { + return zpp::try_catch([]() -> zpp::throwing { + std::cout << "Hello World\n"; + std::cout << co_await foo(false) << '\n';; + co_return 0; + }, [&](const std::exception & error) { + std::cout << "std exception caught: " << error.what() << '\n'; + return 0; + }, [&]() { + std::cout << "Unknown exception\n"; + return 0; + }); +} diff --git a/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt b/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zpp_throwing/all/test_v1_package/conanfile.py b/recipes/zpp_throwing/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/zpp_throwing/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/zpp_throwing/config.yml b/recipes/zpp_throwing/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/zpp_throwing/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml new file mode 100644 index 0000000000000..01522ab9511c5 --- /dev/null +++ b/recipes/zstd/all/conandata.yml @@ -0,0 +1,82 @@ +sources: + "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.5": + - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" + patch_description: "use assembler codes only on x86_64" + patch_type: "portability" + "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" + 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.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 new file mode 100644 index 0000000000000..0b3e82a7fef9c --- /dev/null +++ b/recipes/zstd/all/conanfile.py @@ -0,0 +1,92 @@ +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 +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ZstdConan(ConanFile): + name = "zstd" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/facebook/zstd" + description = "Zstandard - Fast real-time compression algorithm" + topics = ("zstandard", "compression", "algorithm", "decoder") + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threading": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threading": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ZSTD_BUILD_PROGRAMS"] = False + tc.variables["ZSTD_BUILD_STATIC"] = not self.options.shared + tc.variables["ZSTD_BUILD_SHARED"] = self.options.shared + tc.variables["ZSTD_MULTITHREAD_SUPPORT"] = self.options.threading + 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", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "build", "cmake")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + zstd_cmake = "libzstd_shared" if self.options.shared else "libzstd_static" + self.cpp_info.set_property("cmake_file_name", "zstd") + self.cpp_info.set_property("cmake_target_name", f"zstd::{zstd_cmake}") + self.cpp_info.set_property("pkg_config_name", "libzstd") + self.cpp_info.components["zstdlib"].set_property("pkg_config_name", "libzstd") + self.cpp_info.components["zstdlib"].names["cmake_find_package"] = zstd_cmake + self.cpp_info.components["zstdlib"].names["cmake_find_package_multi"] = zstd_cmake + self.cpp_info.components["zstdlib"].set_property("cmake_target_name", f"zstd::{zstd_cmake}") + self.cpp_info.components["zstdlib"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["zstdlib"].system_libs.append("pthread") diff --git a/recipes/zstd/all/patches/1.3.5-cmake-project.patch b/recipes/zstd/all/patches/1.3.5-cmake-project.patch new file mode 100644 index 0000000000000..c8c9479c8ede1 --- /dev/null +++ b/recipes/zstd/all/patches/1.3.5-cmake-project.patch @@ -0,0 +1,12 @@ +--- 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 new file mode 100644 index 0000000000000..9433dfdbea9cb --- /dev/null +++ b/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch @@ -0,0 +1,10 @@ +--- 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.0-remove-explicit-standard-setting.patch b/recipes/zstd/all/patches/1.5.0-remove-explicit-standard-setting.patch new file mode 100644 index 0000000000000..cb025cd1b5b23 --- /dev/null +++ b/recipes/zstd/all/patches/1.5.0-remove-explicit-standard-setting.patch @@ -0,0 +1,21 @@ +diff --git a/a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake b/b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +index e23b9d6..8d04458 100644 +--- a/a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake ++++ b/b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +@@ -22,10 +22,12 @@ endfunction() + + macro(ADD_ZSTD_COMPILATION_FLAGS) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) #Not only UNIX but also WIN32 for MinGW +- #Set c++11 by default +- EnableCompilerFlag("-std=c++11" false true) +- #Set c99 by default +- EnableCompilerFlag("-std=c99" true false) ++ # It's possible to select the exact standard used for compilation. ++ # It's not necessary, but can be employed for specific purposes. ++ # Note that zstd source code is compatible with both C++98 and above ++ # and C-gnu90 (c90 + long long + variadic macros ) and above ++ # EnableCompilerFlag("-std=c++11" false true) # Set C++ compilation to c++11 standard ++ # EnableCompilerFlag("-std=c99" true false) # Set C compiation to c99 standard + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC) + # clang-cl normally maps -Wall to -Weverything. + EnableCompilerFlag("/clang:-Wall" true true) diff --git a/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 new file mode 100644 index 0000000000000..34bb693b4e039 --- /dev/null +++ b/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch @@ -0,0 +1,17 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 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.2-cmake-remove-asm-except-x86_64.patch b/recipes/zstd/all/patches/1.5.2-cmake-remove-asm-except-x86_64.patch new file mode 100644 index 0000000000000..ed1ab3fb8ad6c --- /dev/null +++ b/recipes/zstd/all/patches/1.5.2-cmake-remove-asm-except-x86_64.patch @@ -0,0 +1,17 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 4905bd9..5974725 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -26,7 +26,11 @@ if (MSVC) + file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) + add_compile_options(-DZSTD_DISABLE_ASM) + else () +- file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) ++ if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) ++ else() ++ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) ++ endif() + endif () + file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c) + diff --git a/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 new file mode 100644 index 0000000000000..d846e0df710df --- /dev/null +++ b/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch @@ -0,0 +1,36 @@ +--- 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/test_package/CMakeLists.txt b/recipes/zstd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..57a72caf9ad65 --- /dev/null +++ b/recipes/zstd/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(zstd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if (TARGET zstd::libzstd_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE zstd::libzstd_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE zstd::libzstd_static) +endif() diff --git a/recipes/zstd/all/test_package/conanfile.py b/recipes/zstd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6f307ff1c207f --- /dev/null +++ b/recipes/zstd/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + png_file = os.path.join(self.source_folder, "logo.png") + self.run(f"{bin_path} {png_file}", env="conanrun") diff --git a/recipes/zstd/all/test_package/logo.png b/recipes/zstd/all/test_package/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ef3d175cdec07ed3e5a77992bbe8bafc5d23ae4f GIT binary patch literal 18903 zcmWh!18`nz6pYi@w%a(3ZM(76*tTukwr$%+?1n4I zi6g+`!h(Q+AV^Ax`~p75{{Q|41^ld5ugL)ck<5`45ma`|I?skyR$g5h{bCj-&_DhT zMjFr*Zy_uaL0P~QE(yUp+=ackbR7A2Qrext&_f9oO}24}Tny5xo|sxzp-(6`zs&Dm zH)Q+B=M0~iX+$X9LD9!@dZBo5>S+6}*YnEpaXmB=C28hpIx{{!{Uj+h)pd6y8gB=m z!>(^&a1cBuCT4=oItV3c6!OzqGG5+~z}?+l zMn^|S2xw@U2R=Qn;x(If(R6Gx0T{q0nULungfM z1*XEn!nMI6Awsm6G)tGz>A)X;BaNBPWanmKVR@Gq6*V@{)XdN{GCJ7l8oAKNh8h_e zv9q@?x3#g^CX1J7q19|Et7~ghH)!D>i~1%q6U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`fldnyG`*4_N68`Jc6VShycYm!KSzB9U#*7)|Nl8gtj~_q&gGeN*-MMq;h%jzpL?E}&m!FuM zn-@tWlC_SG;?I73(s5Nege%_o9fnzD%C>Ou5RYMQZjQNg=N8u1)_xfl7WPX*LPCS0 zo3RZiMg(#P`h?=>=vW>Y82BC#`rVaHLC3y61-Gvvho3J|S69cQk3K4Oc6N>k3JQ8A zCMKr7s;X+(mZ2+(VRxgIMPOhcdHV7FLv_kA{YZN)^%9_I`jBeX)iEm_MjTd;Fg64VHn!T4$nQ;EHX0sPAn2_3k?gqG1RmA z9#lp=$RHq3;Mmw$BqSzQ`1<)Bz9f~N6>i_|kLG3phB63c;Xz)19r(|G5<)LtoC^-; zz@9yO>O(_AN0RVCGU7pGz}mHIArJ`E{O8PhWqNb-`*{C-eIz9GJk1BfU_A(VzlR6# z{PP8&X=(3>#NvGti3G}Q`h34IA`lrugko-PuIKOXzgk#Zy9ytDWQ?*+o7;fEjY5{t#%Cr_S~%kT1_GvYzyOs_XV zU|`@9A+QV2Jfn#_wI#Zn2a!sFY10_|-~ZKzMn^9&Ha3nMuFcqn6C(mq5P^Y#*t~i3 z1W8@pyTbJJKz#f$A2~UHf79&*Lc*zu6M<)*sTBzXKS?B#Zx$_DR3Z=vMpnTUz(|Ot zAjn{jh=`~KmwP0pw)TYYfdjL^d!J*jV!w((N)MS9Pw7&$RstPPzD8>8l zUrK0dTD^Y#`nM$#NyDd~emWwI5gr^!*cBZe&CSfn_>{@W=w>`U8D`BIDN|kD8FJvj zs~b0N77@00000NkvXXu0mjfXwfx@ literal 0 HcmV?d00001 diff --git a/recipes/zstd/all/test_package/test_package.c b/recipes/zstd/all/test_package/test_package.c new file mode 100644 index 0000000000000..6ef7323d43a0d --- /dev/null +++ b/recipes/zstd/all/test_package/test_package.c @@ -0,0 +1,126 @@ +/* + * 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); + + return 0; +} diff --git a/recipes/zstd/all/test_v1_package/CMakeLists.txt b/recipes/zstd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zstd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zstd/all/test_v1_package/conanfile.py b/recipes/zstd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c6bf65d610aa1 --- /dev/null +++ b/recipes/zstd/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + png_file = os.path.join(self.source_folder, os.pardir, "test_package", "logo.png") + self.run(f"{bin_path} {png_file}", run_environment=True) diff --git a/recipes/zstd/config.yml b/recipes/zstd/config.yml new file mode 100644 index 0000000000000..ddb81b147ddb6 --- /dev/null +++ b/recipes/zstd/config.yml @@ -0,0 +1,27 @@ +versions: + "1.5.5": + folder: all + "1.5.4": + 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 diff --git a/recipes/zstr/all/conandata.yml b/recipes/zstr/all/conandata.yml new file mode 100644 index 0000000000000..d912b849c0a5f --- /dev/null +++ b/recipes/zstr/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.7": + url: "https://github.com/mateidavid/zstr/archive/refs/tags/v1.0.7.tar.gz" + sha256: "8d2ddae68ff7bd0a6fce6150a8f52ad9ce1bed2c4056c8846f4dec4f2dc60819" + "1.0.6": + url: "https://github.com/mateidavid/zstr/archive/refs/tags/v1.0.6.tar.gz" + sha256: "548f3fed81029defc3567d1902f7306eb0aa19f205ce9e06075b7349a3875f32" + "1.0.5": + url: "https://github.com/mateidavid/zstr/archive/refs/tags/v1.0.5.tar.gz" + sha256: "c6ae65f1ed97f8fe2e9b0fa7d71a0980151e3936ec50d17403b8d233efa8276d" + "1.0.4": + url: "https://github.com/mateidavid/zstr/archive/refs/tags/v1.0.4.tar.gz" + sha256: "a594a3a9c192a6d9e93f9585910d41f7ee6791eb7c454d40c922656324b3058e" diff --git a/recipes/zstr/all/conanfile.py b/recipes/zstr/all/conanfile.py new file mode 100644 index 0000000000000..512be7c200256 --- /dev/null +++ b/recipes/zstr/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + + +class ZstrConan(ConanFile): + name = "zstr" + description = "A C++ header-only ZLib wrapper." + license = "MIT" + topics = ("zlib", "wrapper", "compression") + homepage = "https://github.com/mateidavid/zstr" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + + 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], + destination=self.source_folder, 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, "*", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/zstr/all/test_package/CMakeLists.txt b/recipes/zstr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4fae7f3b9f5a3 --- /dev/null +++ b/recipes/zstr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(zstr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zstr::zstr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/zstr/all/test_package/conanfile.py b/recipes/zstr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/zstr/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/zstr/all/test_package/test_package.cpp b/recipes/zstr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..641d8460e49ef --- /dev/null +++ b/recipes/zstr/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() +{ + zstr::ostream os(std::cout); + return 0; +} diff --git a/recipes/zstr/all/test_v1_package/CMakeLists.txt b/recipes/zstr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/zstr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zstr/all/test_v1_package/conanfile.py b/recipes/zstr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zstr/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/zstr/config.yml b/recipes/zstr/config.yml new file mode 100644 index 0000000000000..86728f7f3bec4 --- /dev/null +++ b/recipes/zstr/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.7": + folder: all + "1.0.6": + folder: all + "1.0.5": + folder: all + "1.0.4": + folder: all diff --git a/recipes/zug/all/conandata.yml b/recipes/zug/all/conandata.yml new file mode 100644 index 0000000000000..ebe78dab88a5e --- /dev/null +++ b/recipes/zug/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220125": + url: "https://github.com/arximboldi/zug/archive/deb266f4c7c35d325de7eb3d033f06e0809495f2.tar.gz" + sha256: "4b36442059899b8570336ff9e2901f62fd58b839c9e3ff5d35497454e2324625" diff --git a/recipes/zug/all/conanfile.py b/recipes/zug/all/conanfile.py new file mode 100644 index 0000000000000..6b0b0f5b3f121 --- /dev/null +++ b/recipes/zug/all/conanfile.py @@ -0,0 +1,57 @@ +import os +from conans import ConanFile, tools +from conan.tools.microsoft import is_msvc +from conans.errors import ConanInvalidConfiguration + + +class ZugConan(ConanFile): + name = "zug" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sinusoid.es/zug/" + description = "Transducers for C++ — Clojure style higher order push/pull \ + sequence transformations" + topics = ("transducer", "algorithm", "signals") + settings = ("compiler", "arch", "os", "build_type") + no_copy_source = True + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + strip_root=True, + destination=self.source_folder + ) + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "3.5", + "apple-clang": "10" + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "14") + + compiler = str(self.settings.compiler) + if compiler not in self._compilers_minimum_version: + self.output.warn("Unknown compiler, assuming it supports at least C++14") + return + + version = tools.Version(self.settings.compiler.version) + if version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++14") + + def package_id(self): + self.info.header_only() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self.source_folder) + self.copy(pattern="*.hpp", dst=os.path.join("include", "zug"), src=os.path.join(self.source_folder, "zug")) + + def package_info(self): + if is_msvc(self): + self.cpp_info.cxxflags = ["/Zc:externConstexpr"] + diff --git a/recipes/zug/all/test_package/CMakeLists.txt b/recipes/zug/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..415cd1f23e3ba --- /dev/null +++ b/recipes/zug/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(zug CONFIG REQUIRED) + +add_executable(test_package example.cpp) +target_link_libraries(test_package zug::zug) +set_target_properties(test_package PROPERTIES CXX_STANDARD 14) diff --git a/recipes/zug/all/test_package/conanfile.py b/recipes/zug/all/test_package/conanfile.py new file mode 100644 index 0000000000000..34e439b02360c --- /dev/null +++ b/recipes/zug/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ZugTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/zug/all/test_package/example.cpp b/recipes/zug/all/test_package/example.cpp new file mode 100644 index 0000000000000..a9657ec7c452c --- /dev/null +++ b/recipes/zug/all/test_package/example.cpp @@ -0,0 +1,37 @@ +#include + +#include +#include + +using namespace zug; + +int main() +{ + using meta::pack; + using identity_t = decltype(identity); + + static_assert(output_of_t{} == pack<>{}, ""); + static_assert(output_of_t{} == pack{}, ""); + static_assert( + output_of_t{} == pack{}, ""); + + static_assert(output_of_t >{} == + pack{}, + ""); + + static_assert(output_of_t{} == pack{}, ""); + static_assert(output_of_t{} == + pack{}, + ""); + + static_assert(output_of_t{} == pack{}, ""); + static_assert(output_of_t{} == + pack{}, + ""); + + // since we verifed the package usage, we declatre SUCCESS + // it is a compile time test, so it looks a bit wierd we can only succeed :-O + // if we fail to use zug, this program won't compile + std::cout << "zug package test: SUCCSESS\n"; + return 0; +} diff --git a/recipes/zug/config.yml b/recipes/zug/config.yml new file mode 100644 index 0000000000000..9fd2ace3e66a6 --- /dev/null +++ b/recipes/zug/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220125": + folder: all diff --git a/recipes/zulu-openjdk/all/conandata.yml b/recipes/zulu-openjdk/all/conandata.yml new file mode 100644 index 0000000000000..516a7ae7f4098 --- /dev/null +++ b/recipes/zulu-openjdk/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "11.0.12": + "Windows": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-win_x64.zip" + sha256: "42ae65e75d615a3f06a674978e1fa85fdf078cad94e553fee3e779b2b42bb015" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz" + sha256: "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3" + "armv8": + url: "https://cdn.azul.com/zulu-embedded/bin/zulu11.50.19-ca-jdk11.0.12-linux_aarch64.tar.gz" + sha256: "61254688067454d3ccf0ef25993b5dcab7b56c8129e53b73566c28a8dd4d48fb" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_x64.tar.gz" + sha256: "0b8c8b7cf89c7c55b7e2239b47201d704e8d2170884875b00f3103cf0662d6d7" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_aarch64.tar.gz" + sha256: "e908a0b4c0da08d41c3e19230f819b364ff2e5f1dafd62d2cf991a85a34d3a17" + + "11.0.15": + "Windows": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-win_x64.zip" + sha256: "a106c77389a63b6bd963a087d5f01171bd32aa3ee7377ecef87531390dcb9050" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz" + sha256: "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247" + "armv8": + url: "https://cdn.azul.com/zulu-embedded/bin/zulu11.56.19-ca-jdk11.0.15-linux_aarch64.tar.gz" + sha256: "fc7c41a0005180d4ca471c90d01e049469e0614cf774566d4cf383caa29d1a97" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_x64.tar.gz" + sha256: "2614e5c5de8e989d4d81759de4c333aa5b867b17ab9ee78754309ba65c7f6f55" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz" + sha256: "6bb0d2c6e8a29dcd9c577bbb2986352ba12481a9549ac2c0bcfd00ed60e538d2" diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py new file mode 100644 index 0000000000000..05d28945d8c9a --- /dev/null +++ b/recipes/zulu-openjdk/all/conanfile.py @@ -0,0 +1,74 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy + + +class ZuluOpenJDK(ConanFile): + name = "zulu-openjdk" + url = "https://github.com/conan-io/conan-center-index/" + description = "A OpenJDK distribution" + homepage = "https://www.azul.com" + license = "https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/" + topics = ("java", "jdk", "openjdk") + settings = "os", "arch" + package_type = "application" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _jni_folder(self): + folder = {"Linux": "linux", "Macos": "darwin", "Windows": "win32"}.get(str(self._settings_build.os)) + return os.path.join("include", folder) + + + def validate(self): + supported_archs = ["x86_64", "armv8"] + if self._settings_build.arch not in supported_archs: + raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_build.arch}). " + "This version {self.version} currently only supports {supported_archs}.") + supported_os = ["Windows", "Macos", "Linux"] + if self._settings_build.os not in supported_os: + raise ConanInvalidConfiguration(f"Unsupported os ({self._settings_build.os}). " + "This package currently only support {supported_os}.") + + def build(self): + get(self, **self.conan_data["sources"][self.version][str(self._settings_build.os)][str(self._settings_build.arch)], strip_root=True) + + def package(self): + copy(self, pattern="*", dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "bin"), + excludes=("msvcp140.dll", "vcruntime140.dll")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "lib")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "res"), + src=os.path.join(self.source_folder, "conf")) + # 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="*", dst=os.path.join(self.package_folder, "conf"), + src=os.path.join(self.source_folder, "conf")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "legal")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib", "jmods"), + src=os.path.join(self.source_folder, "jmods")) + + def package_info(self): + self.cpp_info.includedirs.append(self._jni_folder) + self.cpp_info.libdirs = [] + + java_home = self.package_folder + bin_path = os.path.join(java_home, "bin") + + self.output.info("Creating JAVA_HOME environment variable with : {0}".format(java_home)) + self.env_info.JAVA_HOME = java_home + self.buildenv_info.define_path("JAVA_HOME", java_home) + self.runenv_info.define_path("JAVA_HOME", java_home) + + self.output.info("Appending PATH environment variable with : {0}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/recipes/zulu-openjdk/all/test_package/conanfile.py b/recipes/zulu-openjdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e80eb25a7acac --- /dev/null +++ b/recipes/zulu-openjdk/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from io import StringIO + + +class TestPackage(ConanFile): + settings = "os", "arch" + test_type = "explicit" + generators = "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + pass # nothing to build, but tests should not warn + + def test(self): + if cross_building(self): + return + # OK, this needs some explanation + # You basically do not crosscompile that package, never + # But C3I does, Macos x86_64 to M1, + # and this is why there is some cross compilation going on + # The test will not work in that environment, so .... don't test + output = StringIO() + self.run("java --version", output, env="conanrun") + version_info = output.getvalue() + if "Zulu" not in version_info: + raise Exception("java call seems not use the Zulu bin") diff --git a/recipes/zulu-openjdk/all/test_v1_package/conanfile.py b/recipes/zulu-openjdk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e80eb25a7acac --- /dev/null +++ b/recipes/zulu-openjdk/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from io import StringIO + + +class TestPackage(ConanFile): + settings = "os", "arch" + test_type = "explicit" + generators = "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + pass # nothing to build, but tests should not warn + + def test(self): + if cross_building(self): + return + # OK, this needs some explanation + # You basically do not crosscompile that package, never + # But C3I does, Macos x86_64 to M1, + # and this is why there is some cross compilation going on + # The test will not work in that environment, so .... don't test + output = StringIO() + self.run("java --version", output, env="conanrun") + version_info = output.getvalue() + if "Zulu" not in version_info: + raise Exception("java call seems not use the Zulu bin") diff --git a/recipes/zulu-openjdk/config.yml b/recipes/zulu-openjdk/config.yml new file mode 100644 index 0000000000000..41d345875e1e8 --- /dev/null +++ b/recipes/zulu-openjdk/config.yml @@ -0,0 +1,5 @@ +versions: + "11.0.12": + folder: all + "11.0.15": + folder: all diff --git a/recipes/zxing-cpp/all/conandata.yml b/recipes/zxing-cpp/all/conandata.yml new file mode 100644 index 0000000000000..baac1087c0b36 --- /dev/null +++ b/recipes/zxing-cpp/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "2.0.0": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.0.0.tar.gz" + sha256: "12b76b7005c30d34265fc20356d340da179b0b4d43d2c1b35bcca86776069f76" + "1.4.0": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v1.4.0.tar.gz" + sha256: "126767bb56f8a1f25ae84d233db2e9b9be50d71f5776092d0e170ca0f0ed1862" + "1.3.0": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v1.3.0.tar.gz" + sha256: "bfd8fc706def30e34f96088b5a7afdbe0917831e57a774d34e3ee864b01c6891" + "1.0.8": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v1.0.8.tar.gz" + sha256: "9154b5456904e47bd4c38462d57e4b7897bfb20cb2bc2e8c958453e40e73c8b2" +patches: + "1.4.0": + # core/ByteArray checks `__cpp_lib_string_view` for using string_view. + # But some compilers(ex. gcc 7.2) don't support `__cpp_lib_string_view` but support string_view. + - patch_file: "patches/1.4.0-0001-fix-string-view.patch" + patch_description: "fix compilation error for string_view on several compilers" + patch_type: "portability" + "1.0.8": + - patch_file: "patches/1.0.8-0001-Fix-C2327-for-MSVC-2015.patch" + patch_description: "fix compilation error C2327 on MSVC 2015" + patch_type: "portability" + - patch_file: "patches/1.0.8-0002-include-limits.patch" + patch_description: "include limits" + patch_type: "portability" + - patch_file: "patches/1.0.8-0003-include-stdexcept.patch" + patch_description: "include stdexcept" + patch_type: "portability" + - patch_file: "patches/1.0.8-0004-include-cstddef.patch" + patch_description: "include cstddef" + patch_type: "portability" diff --git a/recipes/zxing-cpp/all/conanfile.py b/recipes/zxing-cpp/all/conanfile.py new file mode 100644 index 0000000000000..2dd711e9b0caf --- /dev/null +++ b/recipes/zxing-cpp/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class ZXingCppConan(ConanFile): + name = "zxing-cpp" + description = "C++ port of ZXing, a barcode scanning library" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zxing-cpp/zxing-cpp" + topics = ("zxing", "barcode", "scanner", "generator") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_encoders": [True, False], + "enable_decoders": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_encoders": True, + "enable_decoders": True, + } + + @property + def _compiler_cpp_support(self): + return { + "14" : { + "gcc": "5", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.4", + "apple-clang": "3.4", + }, + "17" : { + "gcc": "7" if Version(self.version) < "2.0.0" else "8", + "Visual Studio": "16", + "msvc": "192", + "clang": "5" if Version(self.version) < "2.0.0" else "7", + "apple-clang": "5" if Version(self.version) < "2.0.0" else "12", + } + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + cpp_version = 17 if Version(self.version) >= "1.2.0" else 14 + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, cpp_version) + min_version = self._compiler_cpp_support.get(str(cpp_version)).get(str(self.settings.compiler)) + if min_version and Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"This compiler is too old. {self.ref} needs a compiler with c++{cpp_version} support") + + # FIXME: This is a workaround for "The system cannot execute the specified program." + if Version(self.version) >= "1.3.0" and is_msvc_static_runtime(self) and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MT + Debug.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) < "1.1": + tc.variables["ENABLE_ENCODERS"] = self.options.enable_encoders + tc.variables["ENABLE_DECODERS"] = self.options.enable_decoders + tc.variables["BUILD_SHARED_LIBRARY"] = self.options.shared + else: + tc.variables["BUILD_WRITERS"] = self.options.enable_encoders + tc.variables["BUILD_READERS"] = self.options.enable_decoders + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_BLACKBOX_TESTS"] = False + if is_msvc(self): + tc.variables["LINK_CPP_STATICALLY"] = is_msvc_static_runtime(self) + 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() + 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", "ZXing") + self.cpp_info.set_property("cmake_target_name", "ZXing::ZXing") + self.cpp_info.set_property("pkg_config_name", "zxing") + self.cpp_info.libs = ["ZXingCore" if Version(self.version) < "1.1" else "ZXing"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "ZXing" + self.cpp_info.names["cmake_find_package_multi"] = "ZXing" + self.cpp_info.names["pkg_config"] = "zxing" diff --git a/recipes/zxing-cpp/all/patches/1.0.8-0001-Fix-C2327-for-MSVC-2015.patch b/recipes/zxing-cpp/all/patches/1.0.8-0001-Fix-C2327-for-MSVC-2015.patch new file mode 100644 index 0000000000000..e8504c75e2511 --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.0.8-0001-Fix-C2327-for-MSVC-2015.patch @@ -0,0 +1,11 @@ +--- core/src/DecodeHints.h ++++ core/src/DecodeHints.h +@@ -167,7 +167,7 @@ + FLAG_COUNT + }; + +- static_assert(FLAG_COUNT < 8 * sizeof(_flags), "HintFlag overflow"); ++ static_assert(FLAG_COUNT < 8 * sizeof(decltype(_flags)), "HintFlag overflow"); + + bool getFlag(int f) const { + return (_flags & (1 << f)) != 0; diff --git a/recipes/zxing-cpp/all/patches/1.0.8-0002-include-limits.patch b/recipes/zxing-cpp/all/patches/1.0.8-0002-include-limits.patch new file mode 100644 index 0000000000000..33ec25bc40faa --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.0.8-0002-include-limits.patch @@ -0,0 +1,70 @@ +--- a/core/src/oned/ODCodabarReader.cpp ++++ b/core/src/oned/ODCodabarReader.cpp +@@ -22,6 +22,7 @@ + #include "ZXContainerAlgorithms.h" + + #include ++#include + + namespace ZXing { + +--- a/core/src/oned/ODCode39Reader.cpp ++++ b/core/src/oned/ODCode39Reader.cpp +@@ -23,6 +23,7 @@ + + #include + #include ++#include + + namespace ZXing { + +--- a/core/src/oned/ODRowReader.cpp ++++ b/core/src/oned/ODRowReader.cpp +@@ -21,6 +21,7 @@ + + #include + #include ++#include + #include + + namespace ZXing { +--- a/core/src/oned/rss/ODRSSGenericAppIdDecoder.cpp ++++ b/core/src/oned/rss/ODRSSGenericAppIdDecoder.cpp +@@ -22,6 +22,7 @@ + #include "ZXStrConvWorkaround.h" + + #include ++#include + #include + + namespace ZXing { +--- a/core/src/pdf417/PDFReader.cpp ++++ b/core/src/pdf417/PDFReader.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + namespace ZXing { + namespace Pdf417 { +--- a/core/src/qrcode/QRDetector.cpp ++++ b/core/src/qrcode/QRDetector.cpp +@@ -30,6 +30,7 @@ + #include "DecodeStatus.h" + + #include ++#include + + namespace ZXing { + namespace QRCode { +--- a/core/src/qrcode/QREncoder.cpp ++++ b/core/src/qrcode/QREncoder.cpp +@@ -30,6 +30,7 @@ + #include "ZXTestSupport.h" + + #include ++#include + + namespace ZXing { + namespace QRCode { diff --git a/recipes/zxing-cpp/all/patches/1.0.8-0003-include-stdexcept.patch b/recipes/zxing-cpp/all/patches/1.0.8-0003-include-stdexcept.patch new file mode 100644 index 0000000000000..47921a664eac0 --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.0.8-0003-include-stdexcept.patch @@ -0,0 +1,30 @@ +--- a/core/src/oned/ODUPCEANCommon.h ++++ b/core/src/oned/ODUPCEANCommon.h +@@ -18,6 +18,7 @@ + #include "ODUPCEANReader.h" + + #include ++#include + + namespace ZXing { + namespace OneD { +--- a/core/src/oned/ODUPCEWriter.cpp ++++ b/core/src/oned/ODUPCEWriter.cpp +@@ -19,6 +19,7 @@ + #include "ODUPCEANCommon.h" + #include "ODWriterHelper.h" + ++#include + #include + + namespace ZXing { +--- a/core/src/qrcode/QRMatrixUtil.cpp ++++ b/core/src/qrcode/QRMatrixUtil.cpp +@@ -24,6 +24,7 @@ + #include "ZXStrConvWorkaround.h" + + #include ++#include + #include + + namespace ZXing { diff --git a/recipes/zxing-cpp/all/patches/1.0.8-0004-include-cstddef.patch b/recipes/zxing-cpp/all/patches/1.0.8-0004-include-cstddef.patch new file mode 100644 index 0000000000000..dd768e0c7414e --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.0.8-0004-include-cstddef.patch @@ -0,0 +1,12 @@ +diff --git a/core/src/qrcode/QRVersion.cpp b/core/src/qrcode/QRVersion.cpp +index 9cebcb6..fb3680e 100644 +--- a/core/src/qrcode/QRVersion.cpp ++++ b/core/src/qrcode/QRVersion.cpp +@@ -21,6 +21,7 @@ + #include "BitMatrix.h" + + #include ++#include + + namespace ZXing { + namespace QRCode { diff --git a/recipes/zxing-cpp/all/patches/1.4.0-0001-fix-string-view.patch b/recipes/zxing-cpp/all/patches/1.4.0-0001-fix-string-view.patch new file mode 100644 index 0000000000000..7535d69361e47 --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.4.0-0001-fix-string-view.patch @@ -0,0 +1,22 @@ +diff --git a/core/src/ByteArray.h b/core/src/ByteArray.h +index a31f42c..d5b102e 100644 +--- a/core/src/ByteArray.h ++++ b/core/src/ByteArray.h +@@ -11,7 +11,7 @@ + #include + #include + +-#ifdef __cpp_lib_string_view ++#if 1 + #include + #endif + +@@ -30,7 +30,7 @@ public: + + void append(const ByteArray& other) { insert(end(), other.begin(), other.end()); } + +-#ifdef __cpp_lib_string_view ++#if 1 + std::string_view asString(size_t pos = 0, size_t len = std::string_view::npos) const + { + return std::string_view(reinterpret_cast(data()), size()).substr(pos, len); diff --git a/recipes/zxing-cpp/all/test_package/CMakeLists.txt b/recipes/zxing-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c81d383dece63 --- /dev/null +++ b/recipes/zxing-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ZXing REQUIRED CONFIG) +find_package(stb REQUIRED CONFIG) + +if (ZXing_VERSION VERSION_LESS "1.1.0") + add_executable(${PROJECT_NAME} test_package.cpp) +elseif (ZXing_VERSION VERSION_LESS "2.0.0") + add_executable(${PROJECT_NAME} test_package_1.1.cpp) +else() + add_executable(${PROJECT_NAME} test_package_2.0.cpp) +endif() +target_link_libraries(${PROJECT_NAME} PRIVATE ZXing::ZXing stb::stb) + +if (ZXing_VERSION VERSION_LESS "2.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/zxing-cpp/all/test_package/conanfile.py b/recipes/zxing-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9ba1684044ebf --- /dev/null +++ b/recipes/zxing-cpp/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_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("stb/cci.20220909") + 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): + try: + os.unlink("output.png") + except FileNotFoundError: + pass + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + + assert os.path.isfile("output.png") diff --git a/recipes/zxing-cpp/all/test_package/test_package.cpp b/recipes/zxing-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..52aea5ecac07b --- /dev/null +++ b/recipes/zxing-cpp/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include "ZXing/BarcodeFormat.h" +#include "ZXing/MultiFormatWriter.h" +#include "ZXing/BitMatrix.h" +#include "ZXing/ByteMatrix.h" +#include "ZXing/TextUtfEncoding.h" + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include "stb_image_write.h" + +#include +#include + +using namespace ZXing; + +int main() +{ + auto format = BarcodeFormat::QR_CODE; + int width = 100, height = 100; + int margin = 10; + int eccLevel = 8; + std::string text = "Hello conan world!"; + std::string outPath = "output.png"; + + try { + MultiFormatWriter writer(format); + writer.setMargin(margin); + writer.setEccLevel(eccLevel); + auto bitmap = writer.encode(TextUtfEncoding::FromUtf8(text), width, height).toByteMatrix(); + int success = stbi_write_png(outPath.c_str(), bitmap.width(), bitmap.height(), 1, bitmap.data(), 0); + if (!success) { + std::cerr << "Failed to write image: " << outPath << '\n'; + return EXIT_FAILURE; + } + } catch (const std::exception &e) { + std::cerr << "An error occured:\n" << e.what() << '\n'; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp b/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp new file mode 100644 index 0000000000000..43ef58f9108d2 --- /dev/null +++ b/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp @@ -0,0 +1,46 @@ +#include "ZXing/BarcodeFormat.h" +#include "ZXing/BitMatrix.h" +#include "ZXing/BitMatrixIO.h" +#include "ZXing/CharacterSet.h" +#include "ZXing/MultiFormatWriter.h" +#include "ZXing/TextUtfEncoding.h" + +#include +#include +#include +#include +#include +#include + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include + +using namespace ZXing; + +int main(int argc, char* argv[]) +{ + int width = 100, height = 100; + int margin = 10; + int eccLevel = 8; + auto encoding = CharacterSet::Unknown; + auto format = BarcodeFormat::QRCode; + std::string text = "Hello conan world!"; + std::string outPath = "output.png"; + + try { + auto writer = MultiFormatWriter(format).setMargin(margin).setEncoding(encoding).setEccLevel(eccLevel); + auto matrix = writer.encode(TextUtfEncoding::FromUtf8(text), width, height); + auto bitmap = ToMatrix(matrix); + + int success = stbi_write_png(outPath.c_str(), bitmap.width(), bitmap.height(), 1, bitmap.data(), 0); + if (!success) { + std::cerr << "Failed to write image: " << outPath << std::endl; + return -1; + } + } catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + return -1; + } + + return 0; +} diff --git a/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp b/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp new file mode 100644 index 0000000000000..7f93ccdbfcc59 --- /dev/null +++ b/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp @@ -0,0 +1,45 @@ +#include "ZXing/BarcodeFormat.h" +#include "ZXing/BitMatrix.h" +#include "ZXing/BitMatrixIO.h" +#include "ZXing/CharacterSet.h" +#include "ZXing/MultiFormatWriter.h" + +#include +#include +#include +#include +#include +#include + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include + +using namespace ZXing; + +int main(int argc, char* argv[]) +{ + int width = 100, height = 100; + int margin = 10; + int eccLevel = 8; + auto encoding = CharacterSet::Unknown; + auto format = BarcodeFormat::QRCode; + std::string text = "Hello conan world!"; + std::string outPath = "output.png"; + + try { + auto writer = MultiFormatWriter(format).setMargin(margin).setEncoding(encoding).setEccLevel(eccLevel); + auto matrix = writer.encode(text, width, height); + auto bitmap = ToMatrix(matrix); + + int success = stbi_write_png(outPath.c_str(), bitmap.width(), bitmap.height(), 1, bitmap.data(), 0); + if (!success) { + std::cerr << "Failed to write image: " << outPath << std::endl; + return -1; + } + } catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + return -1; + } + + return 0; +} diff --git a/recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt b/recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zxing-cpp/all/test_v1_package/conanfile.py b/recipes/zxing-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..030ecca50ee45 --- /dev/null +++ b/recipes/zxing-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +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 requirements(self): + self.requires("stb/cci.20220909") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + try: + os.unlink("output.png") + except FileNotFoundError: + pass + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + + assert os.path.isfile("output.png") diff --git a/recipes/zxing-cpp/config.yml b/recipes/zxing-cpp/config.yml new file mode 100644 index 0000000000000..a4e6ca74f0f31 --- /dev/null +++ b/recipes/zxing-cpp/config.yml @@ -0,0 +1,9 @@ +versions: + "2.0.0": + folder: all + "1.4.0": + folder: all + "1.3.0": + folder: all + "1.0.8": + folder: all diff --git a/recipes/zyre/all/CMakeLists.txt b/recipes/zyre/all/CMakeLists.txt new file mode 100644 index 0000000000000..d04be130b6aa2 --- /dev/null +++ b/recipes/zyre/all/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +if(NOT BUILD_SHARED_LIBS) + add_definitions(-DZYRE_STATIC) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/zyre/all/conandata.yml b/recipes/zyre/all/conandata.yml new file mode 100644 index 0000000000000..cce2036293068 --- /dev/null +++ b/recipes/zyre/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "2.0.1": + url: "https://github.com/zeromq/zyre/archive/v2.0.1.tar.gz" + sha256: "624d379dc880025144f58d3a7dc35ea1be4a57ba4e2a58c98ec15a60891be12d" + "2.0.0": + url: "https://github.com/zeromq/zyre/archive/v2.0.0.tar.gz" + sha256: "b978a999947ddb6722d956db2427869b313225e50518c4fbbf960a68109e3e91" +patches: + "2.0.1": + - patch_file: "patches/2.0.1-0001-cmake-use-conan-disable-executables.patch" + base_path: "source_subfolder" + - patch_file: "patches/2.0.1-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch" + base_path: "source_subfolder" + "2.0.0": + - patch_file: "patches/2.0.0-0001-cmake-use-conan-disable-executables.patch" + base_path: "source_subfolder" + - patch_file: "patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch" + base_path: "source_subfolder" + - patch_file: "patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch" + base_path: "source_subfolder" diff --git a/recipes/zyre/all/conanfile.py b/recipes/zyre/all/conanfile.py new file mode 100644 index 0000000000000..2720136bcd4ee --- /dev/null +++ b/recipes/zyre/all/conanfile.py @@ -0,0 +1,93 @@ +from conans import ConanFile, CMake, tools +from conan.tools.microsoft import is_msvc +import os +import functools + +required_conan_version = ">=1.33.0" + +class ZyreConan(ConanFile): + name = "zyre" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zeromq/zyre" + description = "Local Area Clustering for Peer-to-Peer Applications." + topics = ("zyre", "czmq", "zmq", "zeromq", + "message-queue", "asynchronous") + settings = "os", "arch", "compiler", "build_type" + generators = ["cmake", "cmake_find_package"] + options = { + "shared": [True, False], + "fPIC": [True, False], + "drafts": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "drafts": False, + } + + @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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("czmq/4.2.0") + self.requires("zeromq/4.3.4") + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("libsystemd/249.7") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["ENABLE_DRAFTS"] = self.options.drafts + if tools.Version(self.version) >= "2.0.1": + cmake.definitions["ZYRE_BUILD_SHARED"] = self.options.shared + cmake.definitions["ZYRE_BUILD_STATIC"] = not self.options.shared + cmake.configure(build_dir=self._build_subfolder) + return cmake + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, + dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig",)) + tools.rmdir(os.path.join(self.package_folder, "share",)) + tools.rmdir(os.path.join(self.package_folder, "cmake",)) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libzyre" + + libname = "libzyre" if tools.Version(self.version) >= "2.0.1" and is_msvc(self) and not self.options.shared else "zyre" + self.cpp_info.libs = [libname] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "dl", "rt", "m"] + if not self.options.shared: + self.cpp_info.defines = ["ZYRE_STATIC"] diff --git a/recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch b/recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch new file mode 100644 index 0000000000000..1c404d27e174c --- /dev/null +++ b/recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch @@ -0,0 +1,66 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -107,10 +107,10 @@ set(OPTIONAL_LIBRARIES) + ######################################################################## + # LIBZMQ dependency + ######################################################################## +-find_package(libzmq REQUIRED) ++find_package(ZeroMQ REQUIRED) +-IF (LIBZMQ_FOUND) ++IF (ZEROMQ_FOUND) +- include_directories(${LIBZMQ_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES}) ++ include_directories(${CONAN_INCLUDE_DIRS_LIBZMQ}) ++ list(APPEND MORE_LIBRARIES ZeroMQ::ZeroMQ) + set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") + ELSE (LIBZMQ_FOUND) + message( FATAL_ERROR "libzmq not found." ) +@@ -121,8 +121,8 @@ ENDIF (LIBZMQ_FOUND) + ######################################################################## + find_package(czmq REQUIRED) + IF (CZMQ_FOUND) +- include_directories(${CZMQ_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES}) ++ include_directories(${CONAN_INCLUDE_DIRS_CZMQ}) ++ list(APPEND MORE_LIBRARIES czmq::czmq) + set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq") + ELSE (CZMQ_FOUND) + message( FATAL_ERROR "czmq not found." ) +@@ -168,7 +168,7 @@ + endif() + add_library(zyre ${zyre_sources}) + set_target_properties(zyre +- PROPERTIES DEFINE_SYMBOL "ZYRE_EXPORTS" ++ PROPERTIES DEFINE_SYMBOL "ZYRE_EXPORTS" LINKER_LANGUAGE CXX + ) + set_target_properties (zyre + PROPERTIES SOVERSION "2.0.0" +@@ -182,9 +182,9 @@ install(TARGETS zyre + ARCHIVE DESTINATION "lib${LIB_SUFFIX}" # .lib file + RUNTIME DESTINATION bin # .dll file + ) +- ++if(BUILD_EXECUTABLES) + include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists-local.txt) # Optional project-local hook +- ++endif() + ######################################################################## + # pkgconfig + ######################################################################## +@@ -211,6 +211,7 @@ install( + ######################################################################## + # executables + ######################################################################## ++if(BUILD_EXECUTABLES) + add_executable( + perf_local + "${SOURCE_DIR}/src/perf_local.c" +@@ -304,7 +305,7 @@ set_target_properties( + zyre_selftest + PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SOURCE_DIR}/src" + ) +- ++endif() + ######################################################################## + # tests + ######################################################################## diff --git a/recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch b/recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch new file mode 100644 index 0000000000000..055ebeaf29096 --- /dev/null +++ b/recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch @@ -0,0 +1,20 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -22,7 +22,7 @@ + ######################################################################## + # options + ######################################################################## +-if (NOT CMAKE_BUILD_TYPE) ++if (0) + if (EXISTS "${SOURCE_DIR}/.git") + set (CMAKE_BUILD_TYPE Debug) + else () +@@ -43,7 +43,7 @@ + endif () + endif () + endif () +-if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") ++if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON) + else () + OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF) diff --git a/recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch b/recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch new file mode 100644 index 0000000000000..961bb8d6f2a19 --- /dev/null +++ b/recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch @@ -0,0 +1,55 @@ +https://github.com/zeromq/czmq/commit/8f8aa86ec1ecf903a614a26aa9e4dd63ace4ffd1 + +--- src/zre_msg.c ++++ src/zre_msg.c +@@ -1766,4 +1766,7 @@ + // @end + ++#ifdef __WINDOWS__ ++ zsys_shutdown(); ++#endif + printf ("OK\n"); + } +--- src/zyre.c ++++ src/zyre.c +@@ -738,6 +738,9 @@ + zyre_destroy (&node2); + // @end ++#ifdef __WINDOWS__ ++ zsys_shutdown(); ++#endif + printf ("OK\n"); + + // zre_msg, zyre_group, zyre_node and zyre_peer are private classes and + // symbols are not exported so the tests can't be run from zyre_selftest, +--- src/zyre_group.c ++++ src/zyre_group.c +@@ -171,5 +171,8 @@ + zhash_destroy (&groups); + zsock_destroy (&mailbox); ++#ifdef __WINDOWS__ ++ zsys_shutdown(); ++#endif + printf ("OK\n"); + } + +--- src/zyre_node.c ++++ src/zyre_node.c +@@ -1022,4 +1022,7 @@ + zsock_destroy (&pipe); + // Node takes ownership of outbox and destroys it ++#ifdef __WINDOWS__ ++ zsys_shutdown(); ++#endif + printf ("OK\n"); + } +--- src/zyre_peer.c ++++ src/zyre_peer.c +@@ -475,4 +475,7 @@ + zsock_destroy (&mailbox); + ++#ifdef __WINDOWS__ ++ zsys_shutdown(); ++#endif + printf ("OK\n"); + } diff --git a/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch b/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch new file mode 100644 index 0000000000000..b13f4721e04bf --- /dev/null +++ b/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch @@ -0,0 +1,91 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e285ba0..69f3c19 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -126,33 +126,23 @@ set(OPTIONAL_LIBRARIES_STATIC) + ######################################################################## + # LIBZMQ dependency + ######################################################################## +-find_package(libzmq REQUIRED) +-IF (LIBZMQ_FOUND) +- include_directories(${LIBZMQ_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES}) +- IF (PC_LIBZMQ_FOUND) +- set(pkg_config_names_private "${pkg_config_names_private} libzmq") +- list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBZMQ_STATIC_LDFLAGS}) +- ELSE (PC_LIBZMQ_FOUND) +- set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") +- ENDIF (PC_LIBZMQ_FOUND) +-ELSE (LIBZMQ_FOUND) ++find_package(ZeroMQ REQUIRED) ++IF (ZEROMQ_FOUND) ++ include_directories(${CONAN_INCLUDE_DIRS_LIBZMQ}) ++ list(APPEND MORE_LIBRARIES ZeroMQ::ZeroMQ) ++ set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") ++ELSE (ZEROMQ_FOUND) + message( FATAL_ERROR "libzmq not found." ) +-ENDIF (LIBZMQ_FOUND) ++ENDIF (ZEROMQ_FOUND) + + ######################################################################## + # CZMQ dependency + ######################################################################## + find_package(czmq REQUIRED) + IF (CZMQ_FOUND) +- include_directories(${CZMQ_INCLUDE_DIRS}) +- list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES}) +- IF (PC_CZMQ_FOUND) +- set(pkg_config_names_private "${pkg_config_names_private} libczmq") +- list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_CZMQ_STATIC_LDFLAGS}) +- ELSE (PC_CZMQ_FOUND) +- set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq") +- ENDIF (PC_CZMQ_FOUND) ++ include_directories(${CONAN_INCLUDE_DIRS_CZMQ}) ++ list(APPEND MORE_LIBRARIES czmq::czmq) ++ set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq") + ELSE (CZMQ_FOUND) + message( FATAL_ERROR "czmq not found." ) + ENDIF (CZMQ_FOUND) +@@ -237,6 +227,7 @@ if (ZYRE_BUILD_SHARED) + set_target_properties (zyre PROPERTIES + PUBLIC_HEADER "${public_headers}" + DEFINE_SYMBOL "ZYRE_EXPORTS" ++ LINKER_LANGUAGE CXX + SOVERSION "2" + VERSION "${ZYRE_VERSION}" + COMPILE_DEFINITIONS "DLL_EXPORT" +@@ -303,8 +294,9 @@ if (ZYRE_BUILD_STATIC) + + endif() + +- ++if(BUILD_EXECUTABLES) + include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists-local.txt) # Optional project-local hook ++endif() + + ######################################################################## + # pkgconfig +@@ -360,6 +352,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zyreConfig.cmake + ######################################################################## + # executables + ######################################################################## ++if(BUILD_EXECUTABLES) + add_executable( + perf_local + "${SOURCE_DIR}/src/perf_local.c" +@@ -491,6 +484,7 @@ target_link_libraries( + ${OPTIONAL_LIBRARIES} + ) + endif() ++ + if (NOT TARGET zyre AND TARGET zyre-static) + target_link_libraries( + zyre_selftest +@@ -501,6 +495,7 @@ target_link_libraries( + ${OPTIONAL_LIBRARIES_STATIC} + ) + endif() ++endif() + + ######################################################################## + # tests diff --git a/recipes/zyre/all/patches/2.0.1-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch b/recipes/zyre/all/patches/2.0.1-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch new file mode 100644 index 0000000000000..a6de3265743d3 --- /dev/null +++ b/recipes/zyre/all/patches/2.0.1-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 69f3c19..ca9c530 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -29,7 +29,7 @@ set(pkg_config_names_private "") + ######################################################################## + # options + ######################################################################## +-if (NOT CMAKE_BUILD_TYPE) ++if (0) + if (EXISTS "${SOURCE_DIR}/.git") + set (CMAKE_BUILD_TYPE Debug) + else () +@@ -50,7 +50,7 @@ if (NOT CMAKE_BUILD_TYPE) + endif () + endif () + endif () +-if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") ++if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON) + else () + OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF) diff --git a/recipes/zyre/all/test_package/CMakeLists.txt b/recipes/zyre/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb1a41293b4f6 --- /dev/null +++ b/recipes/zyre/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(zyre CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} zyre::zyre) diff --git a/recipes/zyre/all/test_package/conanfile.py b/recipes/zyre/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zyre/all/test_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/zyre/all/test_package/test_package.cpp b/recipes/zyre/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7e0b34256ef83 --- /dev/null +++ b/recipes/zyre/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main(void) +{ + uint64_t version = zyre_version(); + + std::cout << "zyre version : " << version << std::endl; + + return 0; +} diff --git a/recipes/zyre/config.yml b/recipes/zyre/config.yml new file mode 100644 index 0000000000000..184166496d26e --- /dev/null +++ b/recipes/zyre/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.1": + folder: all + "2.0.0": + folder: all diff --git a/recipes/zziplib/all/conandata.yml b/recipes/zziplib/all/conandata.yml new file mode 100644 index 0000000000000..2b47b2bf41c26 --- /dev/null +++ b/recipes/zziplib/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.13.72": + url: "https://github.com/gdraheim/zziplib/archive/v0.13.72.tar.gz" + sha256: "93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc" + "0.13.71": + url: "https://github.com/gdraheim/zziplib/archive/v0.13.71.tar.gz" + sha256: "2ee1e0fbbb78ec7cc46bde5b62857bc51f8d665dd265577cf93584344b8b9de2" +patches: + "0.13.72": + - patch_file: "patches/0.13.72-001_fix.patch" + patch_description: "fix install path" + patch_type: "conan" + "0.13.71": + - patch_file: "patches/0.13.71-001_fix.patch" + patch_description: "fix install path" + patch_type: "conan" diff --git a/recipes/zziplib/all/conanfile.py b/recipes/zziplib/all/conanfile.py new file mode 100644 index 0000000000000..140fd9378eebd --- /dev/null +++ b/recipes/zziplib/all/conanfile.py @@ -0,0 +1,121 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ZziplibConan(ConanFile): + name = "zziplib" + description = "The ZZIPlib provides read access on ZIP-archives and unpacked data" + topics = ("zip", "archive", "decompression") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gdraheim/zziplib" + license = "GPL-2.0-or-later" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "zzipmapped": [True, False], + "zzipfseeko": [True, False], + "zzipwrap": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "zzipmapped": True, + "zzipfseeko": True, + "zzipwrap": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/1.2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["ZZIPCOMPAT"] = self.settings.os != "Windows" + tc.variables["ZZIPMMAPPED"] = self.options.zzipmapped + tc.variables["ZZIPFSEEKO"] = self.options.zzipfseeko + tc.variables["ZZIPWRAP"] = self.options.zzipwrap + tc.variables["ZZIPSDL"] = False + tc.variables["ZZIPBINS"] = False + tc.variables["ZZIPTEST"] = False + tc.variables["ZZIPDOCS"] = False + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # 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() + 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.LIB", 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "zziplib-all-do-not-use") + + suffix = "" + if self.settings.build_type == "Release" and \ + (not self.options.shared or self.settings.os == "Windows" or is_apple_os(self)): + suffix += f"-{Version(self.version).major}" + + # libzzip + self.cpp_info.components["zzip"].set_property("pkg_config_name", "zziplib") + self.cpp_info.components["zzip"].libs = [f"zzip{suffix}"] + self.cpp_info.components["zzip"].requires = ["zlib::zlib"] + # libzzipmmapped + if self.options.zzipmapped: + self.cpp_info.components["zzipmmapped"].set_property("pkg_config_name", "zzipmmapped") + if Version(self.version) >= "0.13.72" and self.options.shared and is_apple_os(self): + self.cpp_info.components["zzipmmapped"].libs = [f"zzipmmapped"] + else: + self.cpp_info.components["zzipmmapped"].libs = [f"zzipmmapped{suffix}"] + self.cpp_info.components["zzipmmapped"].requires = ["zlib::zlib"] + # libzzipfseeko + if self.options.zzipfseeko: + self.cpp_info.components["zzipfseeko"].set_property("pkg_config_name", "zzipfseeko") + if Version(self.version) >= "0.13.72" and self.options.shared and is_apple_os(self): + self.cpp_info.components["zzipfseeko"].libs = [f"zzipfseeko"] + else: + self.cpp_info.components["zzipfseeko"].libs = [f"zzipfseeko{suffix}"] + self.cpp_info.components["zzipfseeko"].requires = ["zlib::zlib"] + # libzzipwrap + if self.options.zzipwrap: + self.cpp_info.components["zzipwrap"].set_property("pkg_config_name", "zzipwrap") + self.cpp_info.components["zzipwrap"].libs = [f"zzipwrap{suffix}"] + self.cpp_info.components["zzipwrap"].requires = ["zzip", "zlib::zlib"] diff --git a/recipes/zziplib/all/patches/0.13.71-001_fix.patch b/recipes/zziplib/all/patches/0.13.71-001_fix.patch new file mode 100644 index 0000000000000..6c7e4051d19fe --- /dev/null +++ b/recipes/zziplib/all/patches/0.13.71-001_fix.patch @@ -0,0 +1,35 @@ +--- zzip/CMakeLists.txt 2020-04-15 19:36:46.000000000 -0400 ++++ zzip/CMakeLists.txt 2020-08-07 17:46:38.409824600 -0400 +@@ -247,12 +247,14 @@ + + install(FILES ${libzzip_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) + install(TARGETS libzzip ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if(ZZIPFSEEKO) + install(FILES ${libzzipfseeko_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) + install(TARGETS libzzipfseeko ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +@@ -260,6 +262,7 @@ + if(ZZIPMMAPPED) + install(FILES ${libzzipmmapped_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) + install(TARGETS libzzipmmapped ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +--- zzipwrap/CMakeLists.txt 2020-04-15 19:36:46.000000000 -0400 ++++ zzipwrap/CMakeLists.txt 2020-08-07 17:52:32.169278300 -0400 +@@ -76,6 +76,7 @@ + + install(FILES ${libzzipwrap_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) + install(TARGETS libzzipwrap ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + diff --git a/recipes/zziplib/all/patches/0.13.72-001_fix.patch b/recipes/zziplib/all/patches/0.13.72-001_fix.patch new file mode 100644 index 0000000000000..594dc765e9691 --- /dev/null +++ b/recipes/zziplib/all/patches/0.13.72-001_fix.patch @@ -0,0 +1,12 @@ +diff --git a/a/zzipwrap/CMakeLists.txt b/b/zzipwrap/CMakeLists.txt +index ea7ea93..39de22f 100644 +--- a/a/zzipwrap/CMakeLists.txt ++++ b/b/zzipwrap/CMakeLists.txt +@@ -84,6 +84,7 @@ endif() + + install(FILES ${libzzipwrap_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) + install(TARGETS libzzipwrap ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + diff --git a/recipes/zziplib/all/test_package/CMakeLists.txt b/recipes/zziplib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dfd82ecc4be7e --- /dev/null +++ b/recipes/zziplib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(zziplib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zziplib::zziplib) diff --git a/recipes/zziplib/all/test_package/conanfile.py b/recipes/zziplib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/zziplib/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/zziplib/all/test_package/test_package.c b/recipes/zziplib/all/test_package/test_package.c new file mode 100644 index 0000000000000..7d3735f5c86c1 --- /dev/null +++ b/recipes/zziplib/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +#include + +int main() +{ + zzip_plugin_io_t plugin = zzip_get_default_io(); + + printf("zzip code 0 means %s\n", zzip_strerror(0)); + return plugin == 0; +} diff --git a/recipes/zziplib/all/test_v1_package/CMakeLists.txt b/recipes/zziplib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/zziplib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zziplib/all/test_v1_package/conanfile.py b/recipes/zziplib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zziplib/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/zziplib/config.yml b/recipes/zziplib/config.yml new file mode 100644 index 0000000000000..68a29e739876a --- /dev/null +++ b/recipes/zziplib/config.yml @@ -0,0 +1,5 @@ +versions: + "0.13.72": + folder: all + "0.13.71": + folder: all From cc55bca2581dc2c02e58653c4eb9409a1a031699 Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 17 May 2023 04:33:08 -0300 Subject: [PATCH 02/38] fix topic --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 3a2ef60a38788..9c31e84e78b49 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -12,7 +12,7 @@ class mysql_connector_cxxRecipe(ConanFile): url = "https://github.com/samuaz/libmysqlcppconn-conan" homepage = "https://dev.mysql.com/doc/connector-cpp/8.0" description = "A Conan package for MySQL Connector/C++ with OpenSSL, Boost, and libmysqlclient" - topics = ("conan", "mysql", "connector", "cpp", "openssl", "boost", "libmysqlclient", "jdbc", "static") + topics = ("mysql", "connector", "cpp", "openssl", "boost", "libmysqlclient", "jdbc", "static") settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} From 359e741efc3be97275c982cdbece6eeb76090d00 Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 17 May 2023 04:35:32 -0300 Subject: [PATCH 03/38] fix topic --- recipes/mysql-connector-cpp/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 9c31e84e78b49..221a405559a36 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -8,8 +8,7 @@ class mysql_connector_cxxRecipe(ConanFile): name = "mysql-connector-cpp" license = "GPL-2.0" - author = "Samuel Aazcona " - url = "https://github.com/samuaz/libmysqlcppconn-conan" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://dev.mysql.com/doc/connector-cpp/8.0" description = "A Conan package for MySQL Connector/C++ with OpenSSL, Boost, and libmysqlclient" topics = ("mysql", "connector", "cpp", "openssl", "boost", "libmysqlclient", "jdbc", "static") From c10f75c429c1709cf3426f80185d147e0cac1300 Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 17 May 2023 04:39:31 -0300 Subject: [PATCH 04/38] clean --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 221a405559a36..234aed765cf50 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.cmake import CMakeToolchain, CMake from conan.tools.files import get from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration From cc9ac82a74f988959ed9d0e2ddeb0004efe88c47 Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Wed, 17 May 2023 13:02:34 -0300 Subject: [PATCH 05/38] Update recipes/mysql-connector-cpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén Rincón Blanco --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 234aed765cf50..1ff484cf6ebdc 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -15,7 +15,7 @@ class mysql_connector_cxxRecipe(ConanFile): settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} - requires = ("boost/1.81.0", "openssl/1.1.1t", "libmysqlclient/8.0.31") + requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "libmysqlclient/8.0.31") @property def _min_cppstd(self): From c1b519edf9dfdd1f688521bda3b27a9ff3625b44 Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 17 May 2023 13:07:45 -0300 Subject: [PATCH 06/38] apply suggestions --- recipes/mysql-connector-cpp/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 1ff484cf6ebdc..898a1c36913f5 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -5,7 +5,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library -class mysql_connector_cxxRecipe(ConanFile): +class MysqlConnectorCPPRecipe(ConanFile): name = "mysql-connector-cpp" license = "GPL-2.0" url = "https://github.com/conan-io/conan-center-index" @@ -19,7 +19,7 @@ class mysql_connector_cxxRecipe(ConanFile): @property def _min_cppstd(self): - return "17" if Version(self.version) >= "8.0.27" else "11" + return "17" @property def _compilers_minimum_version(self): From 5824edfcd25a8759aea6d2a8446501c6fce15a98 Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 17 May 2023 13:15:49 -0300 Subject: [PATCH 07/38] apply suggestions --- recipes/mysql-connector-cpp/all/test_package/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/conanfile.py b/recipes/mysql-connector-cpp/all/test_package/conanfile.py index b573a1f64ec30..6b43011fbe76c 100644 --- a/recipes/mysql-connector-cpp/all/test_package/conanfile.py +++ b/recipes/mysql-connector-cpp/all/test_package/conanfile.py @@ -4,8 +4,7 @@ from conan.tools.cmake import CMake, cmake_layout from conan.tools.build import can_run - -class mysql_connector_cxxTestConan(ConanFile): +class MysqlConnectorCPPRecipeTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain" From d9bd970241c28dafd1d015b3a539337c6f8869ae Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 24 May 2023 21:00:56 -0300 Subject: [PATCH 08/38] update minimal gcc version --- recipes/mysql-connector-cpp/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 898a1c36913f5..059ba69bb8c6e 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -15,7 +15,8 @@ class MysqlConnectorCPPRecipe(ConanFile): settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} - requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "libmysqlclient/8.0.31") + requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "protobuf/3.21.9", "libmysqlclient/8.0.31") + build_policy = "missing" @property def _min_cppstd(self): @@ -26,7 +27,7 @@ def _compilers_minimum_version(self): return { "Visual Studio": "16", "msvc": "192", - "gcc": "7" if Version(self.version) >= "8.0.27" else "5.3", + "gcc": "9" if Version(self.version) >= "8.0.27" else "5.3", "clang": "6", } @@ -83,6 +84,7 @@ def generate(self): tc.cache_variables["MYSQL_LIB_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().libdirs[0].replace("\\", "/") tc.cache_variables["MYSQL_INCLUDE_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().includedirs[0].replace("\\", "/") tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.cache_variables["WITH_PROTOBUF"] = self.dependencies["protobuf"].package_folder.replace("\\", "/") tc.generate() def build(self): From a3118df1ba16b7ba8568816d647e714697275cfa Mon Sep 17 00:00:00 2001 From: samuaz Date: Wed, 24 May 2023 21:30:00 -0300 Subject: [PATCH 09/38] update minimal gcc version --- recipes/mysql-connector-cpp/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 059ba69bb8c6e..179c96c8b891b 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -16,7 +16,6 @@ class MysqlConnectorCPPRecipe(ConanFile): options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "protobuf/3.21.9", "libmysqlclient/8.0.31") - build_policy = "missing" @property def _min_cppstd(self): From 3b9996077ced9f4e8d4c345e88012d7285f71286 Mon Sep 17 00:00:00 2001 From: samuaz Date: Thu, 25 May 2023 02:44:19 -0300 Subject: [PATCH 10/38] remove protobuf dep --- recipes/mysql-connector-cpp/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 179c96c8b891b..95d8b3df8aac8 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -15,7 +15,7 @@ class MysqlConnectorCPPRecipe(ConanFile): settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} - requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "protobuf/3.21.9", "libmysqlclient/8.0.31") + requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "libmysqlclient/8.0.31") @property def _min_cppstd(self): @@ -83,7 +83,6 @@ def generate(self): tc.cache_variables["MYSQL_LIB_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().libdirs[0].replace("\\", "/") tc.cache_variables["MYSQL_INCLUDE_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().includedirs[0].replace("\\", "/") tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") - tc.cache_variables["WITH_PROTOBUF"] = self.dependencies["protobuf"].package_folder.replace("\\", "/") tc.generate() def build(self): From 9302cda1ff1882a7e66e28cfb23315166153b3e3 Mon Sep 17 00:00:00 2001 From: samuaz Date: Thu, 25 May 2023 16:27:53 -0300 Subject: [PATCH 11/38] fix mac build --- recipes/mysql-connector-cpp/all/conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 95d8b3df8aac8..a4bc0b347d8c9 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -15,7 +15,6 @@ class MysqlConnectorCPPRecipe(ConanFile): settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} - requires = ("boost/1.81.0", "openssl/[>=1.1 <4]", "libmysqlclient/8.0.31") @property def _min_cppstd(self): @@ -30,6 +29,14 @@ def _compilers_minimum_version(self): "clang": "6", } + def requirements(self): + self.requires("boost/1.81.0") + if self.settings.os == "Macos": + self.requires("openssl/[>=1.1 <3]") + else: + self.requires("openssl/[>=1.1 <4]") + self.requires("libmysqlclient/8.0.31") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) From e3c36a3cb9288d220435baee24278818ec70d2ef Mon Sep 17 00:00:00 2001 From: samuaz Date: Thu, 25 May 2023 19:12:57 -0300 Subject: [PATCH 12/38] fix mac build --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index a4bc0b347d8c9..2ae716a4a75a1 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -32,7 +32,7 @@ def _compilers_minimum_version(self): def requirements(self): self.requires("boost/1.81.0") if self.settings.os == "Macos": - self.requires("openssl/[>=1.1 <3]") + self.requires("openssl/1.1.1t]") else: self.requires("openssl/[>=1.1 <4]") self.requires("libmysqlclient/8.0.31") From 67baac8ebc8f147578196faa241975dd878ff2c0 Mon Sep 17 00:00:00 2001 From: samuaz Date: Thu, 25 May 2023 19:26:31 -0300 Subject: [PATCH 13/38] fix mac build --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 2ae716a4a75a1..90a428882cb99 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -32,7 +32,7 @@ def _compilers_minimum_version(self): def requirements(self): self.requires("boost/1.81.0") if self.settings.os == "Macos": - self.requires("openssl/1.1.1t]") + self.requires("openssl/1.1.1t") else: self.requires("openssl/[>=1.1 <4]") self.requires("libmysqlclient/8.0.31") From 2dbfc429b81d97d4b8da96f66737c636848650a7 Mon Sep 17 00:00:00 2001 From: samuaz Date: Thu, 25 May 2023 20:02:49 -0300 Subject: [PATCH 14/38] fix mac build --- recipes/mysql-connector-cpp/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 90a428882cb99..995d182b6aa81 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -31,6 +31,7 @@ def _compilers_minimum_version(self): def requirements(self): self.requires("boost/1.81.0") + # build faiils on mac with openssl 3x if self.settings.os == "Macos": self.requires("openssl/1.1.1t") else: From f75015e8bbf17d76b2de27645449fd6dbb8604e0 Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Tue, 15 Aug 2023 02:55:11 -0300 Subject: [PATCH 15/38] Update recipes/mysql-connector-cpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 995d182b6aa81..4dfc0ccead554 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -30,7 +30,7 @@ def _compilers_minimum_version(self): } def requirements(self): - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") # build faiils on mac with openssl 3x if self.settings.os == "Macos": self.requires("openssl/1.1.1t") From b0b24ca2094d0cdfc7db4cd3c3a98830ff215ddf Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Tue, 15 Aug 2023 02:55:37 -0300 Subject: [PATCH 16/38] Update recipes/mysql-connector-cpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 4dfc0ccead554..972adc4e3d166 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -33,7 +33,7 @@ def requirements(self): self.requires("boost/1.82.0") # build faiils on mac with openssl 3x if self.settings.os == "Macos": - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <3]") else: self.requires("openssl/[>=1.1 <4]") self.requires("libmysqlclient/8.0.31") From ad19c6fd48871a261764521274b110262ffb9263 Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Tue, 15 Aug 2023 02:56:04 -0300 Subject: [PATCH 17/38] Update recipes/mysql-connector-cpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 972adc4e3d166..9d41fc6118bf6 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -42,13 +42,13 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) def validate_build(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) - if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.") def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] lv2 = [int(v) for v in v2.split(".")] From 391ebc37bdb27084e0538bd51b9b5b3925302a43 Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Tue, 15 Aug 2023 02:56:16 -0300 Subject: [PATCH 18/38] Update recipes/mysql-connector-cpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 9d41fc6118bf6..723779466ae3a 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -83,7 +83,6 @@ def configure(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_BUILD_TYPE"] = "Release" tc.cache_variables["WITH_JDBC"] = "ON" tc.cache_variables["WITHOUT_SERVER"] = "ON" if not self.options.shared: From fc5ee7e36f92fb8e683716e327009efbcd12db2d Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Wed, 16 Aug 2023 13:05:20 -0300 Subject: [PATCH 19/38] Update conanfile.py check if conan CI dont fails with openssl 1.1.1 --- recipes/mysql-connector-cpp/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 723779466ae3a..74db194b6ab7b 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -33,9 +33,9 @@ def requirements(self): self.requires("boost/1.82.0") # build faiils on mac with openssl 3x if self.settings.os == "Macos": - self.requires("openssl/[>=1.1 <3]") + self.requires("openssl/[>=1.1.1 <3]") else: - self.requires("openssl/[>=1.1 <4]") + self.requires("openssl/[>=1.1.1 <4]") self.requires("libmysqlclient/8.0.31") def source(self): From 6fb64fd75804ba795512ef3057d8aedc32dedcef Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Wed, 16 Aug 2023 13:40:48 -0300 Subject: [PATCH 20/38] force to use openssl 1.1.1u for mac due to conan ci fails conan CI fails with >=1.1 < 3 force to use 1.1.1u for mac build --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 74db194b6ab7b..0f8adda8e6686 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -33,7 +33,7 @@ def requirements(self): self.requires("boost/1.82.0") # build faiils on mac with openssl 3x if self.settings.os == "Macos": - self.requires("openssl/[>=1.1.1 <3]") + self.requires("openssl/1.1.1u") else: self.requires("openssl/[>=1.1.1 <4]") self.requires("libmysqlclient/8.0.31") From d47f42d82f688c9c209a2685fae92ed8ab7f1150 Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Sun, 27 Aug 2023 01:52:54 -0300 Subject: [PATCH 21/38] Update recipes/mysql-connector-cpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 0f8adda8e6686..728961a1dbc74 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -33,7 +33,7 @@ def requirements(self): self.requires("boost/1.82.0") # build faiils on mac with openssl 3x if self.settings.os == "Macos": - self.requires("openssl/1.1.1u") + self.requires("openssl/[>=1.1.1. <3]") else: self.requires("openssl/[>=1.1.1 <4]") self.requires("libmysqlclient/8.0.31") From 1843fbed5d54dbb9240c7468e0b61214827aaa92 Mon Sep 17 00:00:00 2001 From: Samuel Azcona Date: Sun, 27 Aug 2023 01:53:11 -0300 Subject: [PATCH 22/38] Update recipes/mysql-connector-cpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 728961a1dbc74..0a2cc9e134f8e 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -103,7 +103,6 @@ def package(self): def package_info(self): self.cpp_info.libdirs = ["lib","lib64"] - self.cpp_info.includedirs = ["include"] if not self.options.shared: self.cpp_info.libs = ["mysqlcppconn-static", "mysqlcppconn8-static"] stdcpplib = stdcpp_library(self) From bada84158a1adaafaa3be15ffb62ca015a6e4a74 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 4 Sep 2023 12:00:35 +0200 Subject: [PATCH 23/38] Improve recipe support Signed-off-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 115 ++++++++++++------ .../all/test_package/CMakeLists.txt | 3 +- .../all/test_package/conanfile.py | 23 ++-- .../test_package/{src => }/test_package.cpp | 0 .../all/test_v1_package/CMakeLists.txt | 7 -- .../all/test_v1_package/conanfile.py | 18 --- 6 files changed, 90 insertions(+), 76 deletions(-) rename recipes/mysql-connector-cpp/all/test_package/{src => }/test_package.cpp (100%) delete mode 100644 recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt delete mode 100644 recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 0a2cc9e134f8e..701b7c99c8671 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -1,17 +1,24 @@ from conan import ConanFile -from conan.tools.cmake import CMakeToolchain, CMake -from conan.tools.files import get +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import get, replace_in_file, rm from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.env import VirtualBuildEnv +import os + + +requird_conan_version = ">=1.54.0" + class MysqlConnectorCPPRecipe(ConanFile): name = "mysql-connector-cpp" license = "GPL-2.0" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://dev.mysql.com/doc/connector-cpp/8.0" - description = "A Conan package for MySQL Connector/C++ with OpenSSL, Boost, and libmysqlclient" - topics = ("mysql", "connector", "cpp", "openssl", "boost", "libmysqlclient", "jdbc", "static") + homepage = "https://dev.mysql.com/doc/connector-cpp/8.1/en/" + description = "A MySQL database connector for C++ applications that connect to MySQL servers" + topics = ("mysql", "connector", "libmysqlclient", "jdbc") settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} @@ -29,35 +36,32 @@ def _compilers_minimum_version(self): "clang": "6", } + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("protobuf/3.21.12") + def requirements(self): - self.requires("boost/1.82.0") - # build faiils on mac with openssl 3x - if self.settings.os == "Macos": - self.requires("openssl/[>=1.1.1. <3]") - else: - self.requires("openssl/[>=1.1.1 <4]") + self.requires("zlib/1.2.13") + self.requires("lz4/1.9.4") + self.requires("zstd/1.5.5") + self.requires("protobuf/3.21.12") + self.requires("boost/1.83.0") + self.requires("openssl/[>=1.1.1 <4]") self.requires("libmysqlclient/8.0.31") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) - def validate_build(self): - if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.") - def validate(self): - if self.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - - def loose_lt_semver(v1, v2): - lv1 = [int(v) for v in v1.split(".")] - lv2 = [int(v) for v in v2.split(".")] - min_length = min(len(lv1), len(lv2)) - return lv1[:min_length] < lv2[:min_length] - - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} {minimum_version} or newer") + 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.") # I dont have a windows computer to test it if self.settings.os == "Windows": @@ -81,18 +85,47 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def _package_folder_dep(self, dep): + return self.dependencies[dep].package_folder.replace("\\", "/") + + def _include_folder_dep(self, dep): + return self.dependencies[dep].cpp_info.includedirs[0].replace("\\", "/") + + def _lib_folder_dep(self, dep): + return self.dependencies[dep].cpp_info.libdirs[0].replace("\\", "/") + def generate(self): + env = VirtualBuildEnv(self) + env.generate(scope="build") + tc = CMakeDeps(self) + tc.generate() tc = CMakeToolchain(self) - tc.cache_variables["WITH_JDBC"] = "ON" - tc.cache_variables["WITHOUT_SERVER"] = "ON" - if not self.options.shared: - tc.cache_variables["BUILD_STATIC"] = "ON" - tc.cache_variables["MYSQL_LIB_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().libdirs[0].replace("\\", "/") - tc.cache_variables["MYSQL_INCLUDE_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().includedirs[0].replace("\\", "/") - tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.variables["WITH_JDBC"] = True + tc.variables["WITHOUT_SERVER"] = True + # INFO: mysql-connector-cpp caches all option values. Need to use cache_variables + tc.cache_variables["BUILD_STATIC"] = not self.options.shared + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + # INFO: mysql-connector-cpp doesn't use find package for cmake. Need to pass manually folder paths + tc.variables["MYSQL_LIB_DIR"] = self._lib_folder_dep("libmysqlclient") + tc.variables["MYSQL_INCLUDE_DIR"] = self._include_folder_dep("libmysqlclient") + tc.variables["Boost_INCLUDE_DIRS"] = self._include_folder_dep("boost") + tc.variables["Boost_LIB_DIRS"] = self._lib_folder_dep("boost") + # INFO: Some dependencies can be found in mysql-connector-cpp source folder. Need to set to use Conan package + tc.cache_variables["WITH_SSL"] = self._package_folder_dep("openssl") + tc.cache_variables["WITH_BOOST"] = self._package_folder_dep("boost") + tc.cache_variables["WITH_ZLIB"] = self._package_folder_dep("zlib") + tc.cache_variables["WITH_LZ4"] = self._package_folder_dep("lz4") + tc.cache_variables["WITH_ZSTD"] = self._package_folder_dep("zstd") + tc.cache_variables["WITH_PROTOBUF"] = self._package_folder_dep("protobuf") tc.generate() + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindProtobuf.cmake"), "LIBRARY protobuf-lite pb_libprotobuf-lite", "") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "core", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -100,17 +133,21 @@ def build(self): def package(self): cmake = CMake(self) cmake.install() + rm(self, "INFO_SRC", self.package_folder) + rm(self, "INFO_BIN", self.package_folder) def package_info(self): - self.cpp_info.libdirs = ["lib","lib64"] + self.cpp_info.libdirs = ["lib64", "lib"] + if not self.options.shared: - self.cpp_info.libs = ["mysqlcppconn-static", "mysqlcppconn8-static"] + self.cpp_info.libs = ["mysqlcppconn8-static"] stdcpplib = stdcpp_library(self) if stdcpplib: self.cpp_info.system_libs.append(stdcpplib) - if self.settings.os in ["Linux", "FreeBSD", "Macos"]: - self.cpp_info.system_libs.extend(["m", "resolv"]) else: self.cpp_info.libs = ["mysqlcppconn", "mysqlcppconn8"] - self.cpp_info.names["cmake_find_package"] = "mysql-connector-cpp" - self.cpp_info.names["cmake_find_package_multi"] = "mysql-connector-cpp" + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "resolv"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt index 4d4210210765b..791e98af7a3b7 100644 --- a/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt +++ b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt @@ -2,5 +2,6 @@ cmake_minimum_required(VERSION 3.15) project(MySQLConnectorCPPTest CXX) find_package(mysql-connector-cpp REQUIRED CONFIG) -add_executable(test_package src/test_package.cpp) + +add_executable(test_package test_package.cpp) target_link_libraries(test_package mysql-connector-cpp::mysql-connector-cpp) diff --git a/recipes/mysql-connector-cpp/all/test_package/conanfile.py b/recipes/mysql-connector-cpp/all/test_package/conanfile.py index 6b43011fbe76c..ef5d7042163ec 100644 --- a/recipes/mysql-connector-cpp/all/test_package/conanfile.py +++ b/recipes/mysql-connector-cpp/all/test_package/conanfile.py @@ -1,25 +1,26 @@ -import os - from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os -class MysqlConnectorCPPRecipeTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain" + +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 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") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mysql-connector-cpp/all/test_package/src/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp similarity index 100% rename from recipes/mysql-connector-cpp/all/test_package/src/test_package.cpp rename to recipes/mysql-connector-cpp/all/test_package/test_package.cpp diff --git a/recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt b/recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3fb35b1634750..0000000000000 --- a/recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,7 +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(mysql-connector-cpp REQUIRED CONFIG) -add_executable(test_package src/test_package.cpp) -target_link_libraries(test_package mysql-connector-cpp::mysql-connector-cpp) diff --git a/recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py b/recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/mysql-connector-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 TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) From ad42e42b09206d289d5d9e29002a3043fa6931ab Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Oct 2023 09:42:49 +0200 Subject: [PATCH 24/38] Build version 8.1.0 Signed-off-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conandata.yml | 6 +- recipes/mysql-connector-cpp/all/conanfile.py | 64 ++++++++----------- .../all/test_package/CMakeLists.txt | 1 + .../all/test_package/test_package.cpp | 9 ++- recipes/mysql-connector-cpp/config.yml | 2 +- 5 files changed, 36 insertions(+), 46 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conandata.yml b/recipes/mysql-connector-cpp/all/conandata.yml index ca41898365fef..6f5b8b188cc4e 100644 --- a/recipes/mysql-connector-cpp/all/conandata.yml +++ b/recipes/mysql-connector-cpp/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "8.0.33": - url: "https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-8.0.33-src.tar.gz" - sha256: "160cf6881fbde9bd46cd11aaf12930b676bc6e27589ac5c7ba49c196b97e053b" + "8.1.0": + url: "https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-8.1.0-src.tar.gz" + sha256: "2ee3c7d0d031ce581deeed747d9561d140172373592bed5d0630a790e6053dc1" diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 701b7c99c8671..1f563d6898ed2 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -3,8 +3,8 @@ from conan.tools.files import get, replace_in_file, rm from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.microsoft import is_msvc +from conan.tools.build import check_min_cppstd from conan.tools.env import VirtualBuildEnv import os @@ -40,16 +40,16 @@ def layout(self): cmake_layout(self, src_folder="src") def build_requirements(self): - self.tool_requires("protobuf/3.21.12") + self.tool_requires("protobuf/") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("protobuf/3.21.12") + self.requires("rapidjson/cci.20220822") + self.requires("zlib/[>=1.2.11 <2]") self.requires("lz4/1.9.4") self.requires("zstd/1.5.5") - self.requires("protobuf/3.21.12") - self.requires("boost/1.83.0") self.requires("openssl/[>=1.1.1 <4]") - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) @@ -57,26 +57,11 @@ def source(self): 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.") - # I dont have a windows computer to test it - if self.settings.os == "Windows": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support windows for now") - - # Sice 8.0.17 this doesn't support shared library on MacOS. - # https://github.com/mysql/mysql-server/blob/mysql-8.0.17/cmake/libutils.cmake#L333-L335 - if self.settings.compiler == "apple-clang" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared library on apple-clang") - - # mysql < 8.0.29 uses `requires` in source code. It is the reserved keyword in C++20. - # https://github.com/mysql/mysql-server/blob/mysql-8.0.0/include/mysql/components/services/dynamic_loader.h#L270 - if self.settings.compiler.get_safe("cppstd") == "20" and Version(self.version) < "8.0.29": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support C++20") - def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") @@ -100,19 +85,20 @@ def generate(self): tc = CMakeDeps(self) tc.generate() tc = CMakeToolchain(self) - tc.variables["WITH_JDBC"] = True - tc.variables["WITHOUT_SERVER"] = True + tc.cache_variables["WITH_JDBC"] = True + tc.cache_variables["WITH_TESTS"] = False + tc.cache_variables["WITH_DOC"] = False + tc.cache_variables["WITH_HEADER_CHECKS"] = False # INFO: mysql-connector-cpp caches all option values. Need to use cache_variables tc.cache_variables["BUILD_STATIC"] = not self.options.shared tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["CMAKE_BUILD_TYPE"] = self.settings.build_type # INFO: mysql-connector-cpp doesn't use find package for cmake. Need to pass manually folder paths - tc.variables["MYSQL_LIB_DIR"] = self._lib_folder_dep("libmysqlclient") - tc.variables["MYSQL_INCLUDE_DIR"] = self._include_folder_dep("libmysqlclient") - tc.variables["Boost_INCLUDE_DIRS"] = self._include_folder_dep("boost") - tc.variables["Boost_LIB_DIRS"] = self._lib_folder_dep("boost") + tc.cache_variables["MYSQL_LIB_DIR"] = self._lib_folder_dep("libmysqlclient") + tc.cache_variables["MYSQL_INCLUDE_DIR"] = self._include_folder_dep("libmysqlclient") # INFO: Some dependencies can be found in mysql-connector-cpp source folder. Need to set to use Conan package tc.cache_variables["WITH_SSL"] = self._package_folder_dep("openssl") - tc.cache_variables["WITH_BOOST"] = self._package_folder_dep("boost") + tc.cache_variables["WITH_MYSQL"] = self._package_folder_dep("libmysqlclient") tc.cache_variables["WITH_ZLIB"] = self._package_folder_dep("zlib") tc.cache_variables["WITH_LZ4"] = self._package_folder_dep("lz4") tc.cache_variables["WITH_ZSTD"] = self._package_folder_dep("zstd") @@ -120,8 +106,16 @@ def generate(self): tc.generate() def _patch_sources(self): + # INFO: Disable internal bootstrap to use Conan CMakeToolchain instead + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "bootstrap()", "") + # INFO: Manage fPIC from recipe options + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "enable_pic()", "") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "CMakeLists.txt"), "enable_pic()", "") + # INFO: Disable protobuf-lite to use Conan protobuf targets instead replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindProtobuf.cmake"), "LIBRARY protobuf-lite pb_libprotobuf-lite", "") + # INFO: Disable protobuf-lite to use Conan protobuf targets instead replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") + # INFO: Disable protobuf-lite to use Conan protobuf targets instead replace_in_file(self, os.path.join(self.source_folder, "cdk", "core", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") def build(self): @@ -137,16 +131,8 @@ def package(self): rm(self, "INFO_BIN", self.package_folder) def package_info(self): - self.cpp_info.libdirs = ["lib64", "lib"] - - if not self.options.shared: - self.cpp_info.libs = ["mysqlcppconn8-static"] - stdcpplib = stdcpp_library(self) - if stdcpplib: - self.cpp_info.system_libs.append(stdcpplib) - else: - self.cpp_info.libs = ["mysqlcppconn", "mysqlcppconn8"] - + suffix = "" if self.options.shared else "-static" + self.cpp_info.libs = [f"mysqlcppconn8{suffix}", f"mysqlcppconn{suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "resolv"] elif self.settings.os == "Windows": diff --git a/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt index 791e98af7a3b7..91a29a1869547 100644 --- a/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt +++ b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt @@ -5,3 +5,4 @@ find_package(mysql-connector-cpp REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(test_package mysql-connector-cpp::mysql-connector-cpp) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index b1cadf4d9bba7..495979b70ce70 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -1,11 +1,14 @@ +#include #include + #include #include #include #include int main() { - auto driver = sql::mysql::get_mysql_driver_instance(); - std::cout << "MySQL connector cpp works" << std::endl; - return 0; + auto driver = sql::mysql::get_mysql_driver_instance(); + std::cout << "MySQL connector cpp works" << std::endl; + + return EXIT_SUCCESS; } diff --git a/recipes/mysql-connector-cpp/config.yml b/recipes/mysql-connector-cpp/config.yml index 2fc10511efcf8..40123f3969c23 100644 --- a/recipes/mysql-connector-cpp/config.yml +++ b/recipes/mysql-connector-cpp/config.yml @@ -1,3 +1,3 @@ versions: - "8.0.33": + "8.1.0": folder: all From 1fce3fccaf8b4d4616ddba4b8648aa49fa3f8f21 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Oct 2023 11:21:44 +0200 Subject: [PATCH 25/38] Fix zlib name on Windows Signed-off-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 1f563d6898ed2..a493e9c8de0e6 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -92,7 +92,6 @@ def generate(self): # INFO: mysql-connector-cpp caches all option values. Need to use cache_variables tc.cache_variables["BUILD_STATIC"] = not self.options.shared tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - tc.cache_variables["CMAKE_BUILD_TYPE"] = self.settings.build_type # INFO: mysql-connector-cpp doesn't use find package for cmake. Need to pass manually folder paths tc.cache_variables["MYSQL_LIB_DIR"] = self._lib_folder_dep("libmysqlclient") tc.cache_variables["MYSQL_INCLUDE_DIR"] = self._include_folder_dep("libmysqlclient") @@ -117,6 +116,9 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") # INFO: Disable protobuf-lite to use Conan protobuf targets instead replace_in_file(self, os.path.join(self.source_folder, "cdk", "core", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") + if self.settings.os == "Windows": + # INFO: On Windows, zlib library name is zlib + replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindCompression.cmake"), "add_ext(zlib zlib.h z ext_zlib)", "add_ext(zlib zlib.h zlib ext_zlib)") def build(self): self._patch_sources() From 27b143fc81e23d44e2aaa654497994b887a76611 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Oct 2023 12:19:04 +0200 Subject: [PATCH 26/38] Skip Windows for now Signed-off-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index a493e9c8de0e6..bdfa402f74ea0 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -45,6 +45,7 @@ def build_requirements(self): def requirements(self): self.requires("protobuf/3.21.12") self.requires("rapidjson/cci.20220822") + self.requires("boost/1.83.0") self.requires("zlib/[>=1.2.11 <2]") self.requires("lz4/1.9.4") self.requires("zstd/1.5.5") @@ -62,6 +63,11 @@ def validate(self): 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": + # FIXME: CMake.build(): No dependency data available when merging static library + # C:\Users\conan\.conan2\p\b\mysql2bd71efa92a64\b\build\jdbc\Release\mysqlcppconn-static.lib + raise ConanInvalidConfiguration(f"Conan recipe for '{self.ref}' is still not working on Windows. Contributions are welcome!") + def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") @@ -102,6 +108,7 @@ def generate(self): tc.cache_variables["WITH_LZ4"] = self._package_folder_dep("lz4") tc.cache_variables["WITH_ZSTD"] = self._package_folder_dep("zstd") tc.cache_variables["WITH_PROTOBUF"] = self._package_folder_dep("protobuf") + tc.cache_variables["WITH_BOOST"] = self._package_folder_dep("boost") tc.generate() def _patch_sources(self): @@ -116,9 +123,15 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") # INFO: Disable protobuf-lite to use Conan protobuf targets instead replace_in_file(self, os.path.join(self.source_folder, "cdk", "core", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") + # INFO: Not able to link in case not finding OpenSSL first, passing folders paths is not enough + replace_in_file(self, os.path.join(self.source_folder, "jdbc", "cmake", "DepFindMySQL.cmake"), "target_link_libraries(MySQL::client-static", "find_package(OpenSSL CONFIG REQUIRED)\ntarget_link_libraries(MySQL::client-static") if self.settings.os == "Windows": - # INFO: On Windows, zlib library name is zlib - replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindCompression.cmake"), "add_ext(zlib zlib.h z ext_zlib)", "add_ext(zlib zlib.h zlib ext_zlib)") + # INFO: On Windows, libraries names change + zlib = "zdll" if self.dependencies["zlib"].options.shared else "zlib" + zstd = "zstd" if self.dependencies["zstd"].options.shared else "zstd_static" + replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindCompression.cmake"), "add_ext(zlib zlib.h z ext_zlib)", f"add_ext(zlib zlib.h {zlib} ext_zlib)") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::z ext::lz4 ext::zstd", f"ext::{zlib} ext::lz4 ext::{zstd}") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindCompression.cmake"), "add_ext(zstd zstd.h zstd ext_zstd)", f"add_ext(zstd zstd.h {zstd} ext_zstd)") def build(self): self._patch_sources() From ab2c6145dd95455ee6f140f02d7f1afdba6426b5 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Oct 2023 13:26:57 +0200 Subject: [PATCH 27/38] Fix debug build Signed-off-by: Uilian Ries --- recipes/mysql-connector-cpp/all/conanfile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index bdfa402f74ea0..848cb491b03e8 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -117,14 +117,15 @@ def _patch_sources(self): # INFO: Manage fPIC from recipe options replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "enable_pic()", "") replace_in_file(self, os.path.join(self.source_folder, "cdk", "CMakeLists.txt"), "enable_pic()", "") + protobuf = "protobufd" if self.dependencies["protobuf"].settings.build_type == "Debug" else "protobuf" # INFO: Disable protobuf-lite to use Conan protobuf targets instead replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindProtobuf.cmake"), "LIBRARY protobuf-lite pb_libprotobuf-lite", "") + # INFO: Fix protobuf library name according to the build type + replace_in_file(self, os.path.join(self.source_folder, "cdk", "cmake", "DepFindProtobuf.cmake"), "LIBRARY protobuf", f"LIBRARY {protobuf}") # INFO: Disable protobuf-lite to use Conan protobuf targets instead - replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "protocol", "mysqlx", "CMakeLists.txt"), "ext::protobuf-lite", f"ext::{protobuf}") # INFO: Disable protobuf-lite to use Conan protobuf targets instead - replace_in_file(self, os.path.join(self.source_folder, "cdk", "core", "CMakeLists.txt"), "ext::protobuf-lite", "ext::protobuf") - # INFO: Not able to link in case not finding OpenSSL first, passing folders paths is not enough - replace_in_file(self, os.path.join(self.source_folder, "jdbc", "cmake", "DepFindMySQL.cmake"), "target_link_libraries(MySQL::client-static", "find_package(OpenSSL CONFIG REQUIRED)\ntarget_link_libraries(MySQL::client-static") + replace_in_file(self, os.path.join(self.source_folder, "cdk", "core", "CMakeLists.txt"), "ext::protobuf-lite", f"ext::{protobuf}") if self.settings.os == "Windows": # INFO: On Windows, libraries names change zlib = "zdll" if self.dependencies["zlib"].options.shared else "zlib" @@ -146,6 +147,7 @@ def package(self): rm(self, "INFO_BIN", self.package_folder) def package_info(self): + self.cpp_info.libdirs = ["lib/debug"] if self.settings.build_type == "Debug" else ["lib"] suffix = "" if self.options.shared else "-static" self.cpp_info.libs = [f"mysqlcppconn8{suffix}", f"mysqlcppconn{suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: From 7aecee6d9cb041ac0778b8c1cbfc2f9a605be115 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 12:42:01 +0200 Subject: [PATCH 28/38] package license --- recipes/mysql-connector-cpp/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 848cb491b03e8..8059cacc2fa0b 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -141,6 +141,7 @@ def build(self): cmake.build() def package(self): + self.copy("LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rm(self, "INFO_SRC", self.package_folder) From 35afbaf114e56040b7f37166aa4ae331f9d9b866 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 13:00:45 +0200 Subject: [PATCH 29/38] fix --- recipes/mysql-connector-cpp/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 8059cacc2fa0b..6da98b6f60729 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout -from conan.tools.files import get, replace_in_file, rm +from conan.tools.files import copy, get, replace_in_file, rm from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc @@ -141,7 +141,7 @@ def build(self): cmake.build() def package(self): - self.copy("LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rm(self, "INFO_SRC", self.package_folder) From 9666742713219587f5527c34ff08a6ab30517d82 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 13:37:15 +0200 Subject: [PATCH 30/38] link with resolv on macos armv8 --- recipes/mysql-connector-cpp/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 6da98b6f60729..72f45d9261cce 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -155,3 +155,5 @@ def package_info(self): self.cpp_info.system_libs = ["m", "resolv"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] + elif self.settings.os == "Macos" and self.settings.arch == "armv8": + self.cpp_info.system_libs = ["resolv"] From 5add35d80f678e88020b3d7ad24f061fb68c9752 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 14:13:13 +0200 Subject: [PATCH 31/38] add option for jdbc api link flag --- recipes/mysql-connector-cpp/all/conanfile.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 72f45d9261cce..5c164540c8390 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -20,8 +20,10 @@ class MysqlConnectorCPPRecipe(ConanFile): description = "A MySQL database connector for C++ applications that connect to MySQL servers" topics = ("mysql", "connector", "libmysqlclient", "jdbc") 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], + # https://dev.mysql.com/doc/connector-cpp/9.0/en/connector-cpp-apps-general-considerations.html + "use_legacy_jdbc_api": [True, False]} + default_options = {"shared": False, "fPIC": True, "use_legacy_jdbc_api": False} @property def _min_cppstd(self): @@ -147,10 +149,14 @@ def package(self): rm(self, "INFO_SRC", self.package_folder) rm(self, "INFO_BIN", self.package_folder) + def package_id(self): + # The option is only used to propagate different linking flags + del self.info.options.use_legacy_jdbc_api + def package_info(self): self.cpp_info.libdirs = ["lib/debug"] if self.settings.build_type == "Debug" else ["lib"] suffix = "" if self.options.shared else "-static" - self.cpp_info.libs = [f"mysqlcppconn8{suffix}", f"mysqlcppconn{suffix}"] + self.cpp_info.libs = [f"mysqlcppconn{suffix}" if self.options.use_legacy_jdbc_api else f"mysqlcppconn8{suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "resolv"] elif self.settings.os == "Windows": From bf32d282796f8334d4fde0d6b41f11dfc33d99d8 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 14:47:12 +0200 Subject: [PATCH 32/38] use newer library api in test_package --- .../mysql-connector-cpp/all/test_package/test_package.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index 495979b70ce70..8d547544665cb 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -1,10 +1,8 @@ #include #include -#include -#include -#include -#include +#include + int main() { auto driver = sql::mysql::get_mysql_driver_instance(); From f14f9bb78b9003181a805c7c16985c9be28e4941 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 16:04:29 +0200 Subject: [PATCH 33/38] change test_package code --- .../mysql-connector-cpp/all/test_package/test_package.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index 8d547544665cb..666ae58e105a2 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -1,12 +1,12 @@ -#include #include #include int main() { - auto driver = sql::mysql::get_mysql_driver_instance(); - std::cout << "MySQL connector cpp works" << std::endl; - + Session sess("mysqlx://root@127.0.0.1"); + RowResult res = sess.sql("show variables like 'version'").execute(); + version << res.fetchOne().get(1).get(); + std::cout << "mysqlx version: " << version << std::endl; return EXIT_SUCCESS; } From 10895a95c800a3013dac2b1d1f529904c9b9e1fa Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 17:03:02 +0200 Subject: [PATCH 34/38] fix --- recipes/mysql-connector-cpp/all/test_package/test_package.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index 666ae58e105a2..7b418ffba0976 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -6,7 +6,7 @@ int main() { Session sess("mysqlx://root@127.0.0.1"); RowResult res = sess.sql("show variables like 'version'").execute(); - version << res.fetchOne().get(1).get(); + version << res.fetchOne().get(1).get(); std::cout << "mysqlx version: " << version << std::endl; return EXIT_SUCCESS; } From 093ba128e32dc954a3fd193e12896111bfefef34 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 17:29:41 +0200 Subject: [PATCH 35/38] fix --- .../mysql-connector-cpp/all/test_package/test_package.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index 7b418ffba0976..50a524ca0426b 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -4,8 +4,9 @@ int main() { - Session sess("mysqlx://root@127.0.0.1"); - RowResult res = sess.sql("show variables like 'version'").execute(); + mysqlx::Session sess("mysqlx://root@127.0.0.1"); + mysqlx::RowResult res = sess.sql("show variables like 'version'").execute(); + std::stringstream version; version << res.fetchOne().get(1).get(); std::cout << "mysqlx version: " << version << std::endl; return EXIT_SUCCESS; From 8e471a00543fbfc4828f5df811f3adb871ccf5f5 Mon Sep 17 00:00:00 2001 From: danimtb Date: Mon, 19 Aug 2024 17:40:45 +0200 Subject: [PATCH 36/38] other --- recipes/mysql-connector-cpp/all/test_package/test_package.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index 50a524ca0426b..be1840d01d54d 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -8,6 +8,8 @@ int main() { mysqlx::RowResult res = sess.sql("show variables like 'version'").execute(); std::stringstream version; version << res.fetchOne().get(1).get(); - std::cout << "mysqlx version: " << version << std::endl; + int major_version; + version >> major_version; + std::cout << "mysqlx version: " << major_version << std::endl; return EXIT_SUCCESS; } From 2df69d1eb760530f8ad3169edd2890e7a8a5108a Mon Sep 17 00:00:00 2001 From: danimtb Date: Tue, 20 Aug 2024 09:24:12 +0200 Subject: [PATCH 37/38] improve test --- .../all/test_package/test_package.cpp | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp index be1840d01d54d..8b0cc5c0998b0 100644 --- a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -4,12 +4,22 @@ int main() { - mysqlx::Session sess("mysqlx://root@127.0.0.1"); - mysqlx::RowResult res = sess.sql("show variables like 'version'").execute(); - std::stringstream version; - version << res.fetchOne().get(1).get(); + mysqlx::Value col1("version"); + mysqlx::Value col2("8.0.25"); + + mysqlx::Row simulatedRow; + simulatedRow.set(0, col1); + simulatedRow.set(1, col2); + + std::string variable_name = simulatedRow[0].get(); + std::string version_value = simulatedRow[1].get(); + int major_version; - version >> major_version; - std::cout << "mysqlx version: " << major_version << std::endl; + std::stringstream version_stream(version_value); + version_stream >> major_version; + + std::cout << "Variable name: " << variable_name << std::endl; + std::cout << "Major version: " << major_version << std::endl; + return EXIT_SUCCESS; } From 1b4c9f6e13fa048807e8373c3d374c14476cd76b Mon Sep 17 00:00:00 2001 From: danimtb Date: Tue, 20 Aug 2024 13:49:38 +0200 Subject: [PATCH 38/38] try openssl transitive_libs false --- recipes/mysql-connector-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py index 5c164540c8390..c780f5b4a4eba 100644 --- a/recipes/mysql-connector-cpp/all/conanfile.py +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -51,7 +51,7 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") self.requires("lz4/1.9.4") self.requires("zstd/1.5.5") - self.requires("openssl/[>=1.1.1 <4]") + self.requires("openssl/[>=1.1.1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%^jOU%8%I1Y~*pz=y-L`nMLSWa#{3n zIb8ww1<=U*$j_A3Gt*xfH_V%lxyL&*y3o{2G@yw3R5_zeba5NmbW0J4u2K^=`RZI5 zRfb9t(Wd?F84zf;k9c^#zr?({Z=SGYJEd>wJ~<;8%*+Q)aH@`ssd1;TEAIt^P-=Zm_^VDiJYD@XM~0%X2^_d z6E!(6T0u@yC;@r`4xi=y+!2{jr$AiyW1+f3Q7I@*8bqjNcZ=Yzqa`xvxs!-AnX;F@ z4lheCdUrL|NhheKH(S0Y#svx(Un8GD z6p*xzIRcHRrVrg7PyKRihh|;vNUFT<9fJu{_Dc8H3do%nhY%zolJF2n+Z!q*C?fmG z0RVf96sq+Q2u0MZtd?T|ADJFo0G@HZU9Y!~#LJxbO!1h{_vhpJ%foo{j{IRh-^cZG zynMXfk}$L_UM{_fAZ0!t&mW#&e$k$u&X3o1^_3(VT||5YDPT(v(o^Z-W#sVJQ%uC@ z>D=x~cWZWhdU*Ho!w=v7?l-^t-GBVkay%a|Uwrk;Z@&KKufBQri#HEu2gnQ#!X|<%!m`y-{8wLwK`x>+L*rj1V}-DC69WEB&t9 zahQNakd82s6_p%_N0FL6&eq(4m>|@CbOsj2JW4&Byfcx`fuX zLjv5ngQPfiInLn;Ba^NQxVUf>#(&FVREVTF3^6&a>uKqivz(4o`)g;5N|&Z4+N8bG z)gaz9RrKL;N$RI-w{&Y)#XV +#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"; + + stream.close(); + + return 0; +} diff --git a/recipes/lodepng/all/test_v1_package/CMakeLists.txt b/recipes/lodepng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/lodepng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/lodepng/all/test_v1_package/conanfile.py b/recipes/lodepng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4441530a937ba --- /dev/null +++ b/recipes/lodepng/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + bees = os.path.join(self.source_folder, os.pardir, "test_package", "bees.png") + self.run(f"{bin_path} {bees}", run_environment=True) diff --git a/recipes/lodepng/config.yml b/recipes/lodepng/config.yml new file mode 100644 index 0000000000000..4b29d9b93e715 --- /dev/null +++ b/recipes/lodepng/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200615": + folder: all diff --git a/recipes/log.c/all/CMakeLists.txt b/recipes/log.c/all/CMakeLists.txt new file mode 100644 index 0000000000000..50b38ff756d4d --- /dev/null +++ b/recipes/log.c/all/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +project(log.c LANGUAGES C) + +option(LOGC_USE_COLOR "Use Color" ON) + +add_library(log.c ${LOGC_SRC_FOLDER}/src/log.c) +set_target_properties(log.c PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_compile_features(log.c PRIVATE c_std_99) + +if(LOGC_USE_COLOR) + target_compile_definitions(log.c PRIVATE LOG_USE_COLOR) +endif() + +include(GNUInstallDirs) +install(FILES ${LOGC_SRC_FOLDER}/src/log.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install( + TARGETS log.c + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/log.c/all/conandata.yml b/recipes/log.c/all/conandata.yml new file mode 100644 index 0000000000000..e090a26f937d9 --- /dev/null +++ b/recipes/log.c/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200620": + url: "https://github.com/rxi/log.c/archive/f9ea34994bd58ed342d2245cd4110bb5c6790153.zip" + sha256: "402e2c64a9d659b76e7ae3b211061eea0d6683ececd7d8bb8b399e6795574a87" diff --git a/recipes/log.c/all/conanfile.py b/recipes/log.c/all/conanfile.py new file mode 100644 index 0000000000000..eb9d4135d51ce --- /dev/null +++ b/recipes/log.c/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class LogcConan(ConanFile): + name = "log.c" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rxi/log.c" + description = "A simple logging library implemented in C99" + topics = ("logging", "log", "logging-library", "logc", "purec", "c99") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "color": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "color": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LOGC_SRC_FOLDER"] = self.source_folder.replace("\\", "/") + tc.variables["LOGC_USE_COLOR"] = self.options.color + 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 = ["log.c"] diff --git a/recipes/log.c/all/test_package/CMakeLists.txt b/recipes/log.c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..90cb2b629055b --- /dev/null +++ b/recipes/log.c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(log.c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE log.c::log.c) diff --git a/recipes/log.c/all/test_package/conanfile.py b/recipes/log.c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/log.c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/log.c/all/test_package/test_package.c b/recipes/log.c/all/test_package/test_package.c new file mode 100644 index 0000000000000..689ad5dd75b23 --- /dev/null +++ b/recipes/log.c/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() { + log_trace("Hello %s", "world"); + log_trace(log_level_string(0)); + return 0; +} diff --git a/recipes/log.c/all/test_v1_package/CMakeLists.txt b/recipes/log.c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/log.c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/log.c/all/test_v1_package/conanfile.py b/recipes/log.c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/log.c/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/log.c/config.yml b/recipes/log.c/config.yml new file mode 100644 index 0000000000000..005276af80e77 --- /dev/null +++ b/recipes/log.c/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200620": + folder: all diff --git a/recipes/log4cplus/all/conandata.yml b/recipes/log4cplus/all/conandata.yml new file mode 100644 index 0000000000000..a0ac90c32b364 --- /dev/null +++ b/recipes/log4cplus/all/conandata.yml @@ -0,0 +1,45 @@ +sources: + "2.1.0": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_0/log4cplus-2.1.0.tar.bz2" + sha256: "a04945aca5fbc0487503c852befb9cdefbc3ae3fe614b08a905333f6df754387" + "2.0.8": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_8/log4cplus-2.0.8.tar.bz2" + sha256: "ca36aa366036d1c61fc0366a9ffbcf32bad55d74878b2c36a9c34dcc00b8a0ca" + "2.0.7": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_7/log4cplus-2.0.7.tar.bz2" + sha256: "8fadbafee2ba4e558a0f78842613c9fb239c775d83f23340d091084c0e1b12ab" + "2.0.6": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_6/log4cplus-2.0.6.tar.bz2" + sha256: "1a963afd0f883d62de946b18927d238051fd47936e415eabeffe2b1397f16eca" + "2.0.5": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_5/log4cplus-2.0.5.tar.bz2" + sha256: "b38dbfc68ef6d771e4de7de0be3544bc51bd3f7d5b75c5f6500d10e23203eb15" + "2.0.4": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_4/log4cplus-2.0.4.tar.bz2" + sha256: "0c8a7b4cabff07032385f0c6d1a078d2a79c69b1c43b06991ca774fb85880252" + +patches: + "2.1.0": + - patch_file: "patches/2.0.6-0001-fix-cmake.patch" + patch_description: "disable fPIC, move cmake_minimum_version to front" + patch_type: "conan" + "2.0.8": + - patch_file: "patches/2.0.6-0001-fix-cmake.patch" + patch_description: "disable fPIC, move cmake_minimum_version to front" + patch_type: "conan" + "2.0.7": + - patch_file: "patches/2.0.6-0001-fix-cmake.patch" + patch_description: "disable fPIC, move cmake_minimum_version to front" + patch_type: "conan" + "2.0.6": + - patch_file: "patches/2.0.6-0001-fix-cmake.patch" + patch_description: "disable fPIC, move cmake_minimum_version to front" + patch_type: "conan" + "2.0.5": + - patch_file: "patches/2.0.4-0001-fix-cmake.patch" + patch_description: "disable fPIC, move cmake_minimum_version to front" + patch_type: "conan" + "2.0.4": + - patch_file: "patches/2.0.4-0001-fix-cmake.patch" + patch_description: "disable fPIC, move cmake_minimum_version to front" + patch_type: "conan" diff --git a/recipes/log4cplus/all/conanfile.py b/recipes/log4cplus/all/conanfile.py new file mode 100644 index 0000000000000..6d7e6eed30a07 --- /dev/null +++ b/recipes/log4cplus/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class Log4cplusConan(ConanFile): + name = "log4cplus" + description = "simple to use C++ logging API, modelled after the Java log4j API" + license = ("BSD-2-Clause, Apache-2.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/log4cplus/log4cplus" + topics = ("logging", "log", "logging-library") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "single_threaded": [True, False], + "build_logging_server": [True, False], + "with_iconv": [True, False], + "working_locale": [True, False], + "working_c_locale": [True, False], + "decorated_name": [True, False], + "unicode": [True, False], + "thread_pool": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "single_threaded": False, + "build_logging_server": False, + "with_iconv": False, + "working_locale": False, + "working_c_locale": False, + "decorated_name": False, + "unicode": True, + "thread_pool": True, + } + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_iconv: + self.requires("libiconv/1.17") + + 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["LOG4CPLUS_ENABLE_THREAD_POOL"] = self.options.thread_pool + tc.variables["UNICODE"] = self.options.unicode + tc.variables["LOG4CPLUS_BUILD_TESTING"] = False + tc.variables["WITH_UNIT_TESTS"] = False + tc.variables["LOG4CPLUS_ENABLE_DECORATED_LIBRARY_NAME"] = self.options.decorated_name + tc.variables["LOG4CPLUS_QT4"] = False + tc.variables["LOG4CPLUS_QT5"] = False + tc.variables["LOG4CPLUS_SINGLE_THREADED"] = self.options.single_threaded + tc.variables["LOG4CPLUS_BUILD_LOGGINGSERVER"] = self.options.build_logging_server + tc.variables["WITH_ICONV"] = self.options.with_iconv + tc.variables["LOG4CPLUS_WORKING_LOCALE"] = self.options.working_locale + tc.variables["LOG4CPLUS_WORKING_C_LOCALE"] = self.options.working_c_locale + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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")) + if Version(self.version) >= "2.1.0": + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "log4cplus") + self.cpp_info.set_property("cmake_target_name", "log4cplus::log4cplus") + if Version(self.version) >= "2.1.0": + self.cpp_info.set_property("pkg_config_name", "log4cplus") + + self.cpp_info.libs = collect_libs(self) + if self.options.unicode: + self.cpp_info.defines = ["UNICODE", "_UNICODE"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m", "rt", "nsl"] + if not self.options.single_threaded: + self.cpp_info.system_libs.append("pthread") + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["advapi32", "ws2_32"] diff --git a/recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch b/recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch new file mode 100644 index 0000000000000..d76b76d7eee51 --- /dev/null +++ b/recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index abe12e0..73d443f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,5 @@ ++cmake_minimum_required (VERSION 3.1) ++ + # This block needs to stay before the project (log4cplus) line so that + # the output files placed into Android's libs directory. + if (CMAKE_TOOLCHAIN_FILE) +@@ -12,10 +14,6 @@ endif () + set (CMAKE_LEGACY_CYGWIN_WIN32 0) + + project (log4cplus) +-cmake_minimum_required (VERSION 3.1) +- +-# Use "-fPIC" / "-fPIE" for all targets by default, including static libs. +-set (CMAKE_POSITION_INDEPENDENT_CODE ON) + + enable_language (CXX) + if (MSVC) diff --git a/recipes/log4cplus/all/patches/2.0.6-0001-fix-cmake.patch b/recipes/log4cplus/all/patches/2.0.6-0001-fix-cmake.patch new file mode 100644 index 0000000000000..4abbd5b9d672b --- /dev/null +++ b/recipes/log4cplus/all/patches/2.0.6-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5fa96f7..4209098 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,5 @@ ++cmake_minimum_required (VERSION 3.12) ++ + # This block needs to stay before the project (log4cplus) line so that + # the output files placed into Android's libs directory. + if (CMAKE_TOOLCHAIN_FILE) +@@ -12,10 +14,6 @@ endif () + set (CMAKE_LEGACY_CYGWIN_WIN32 0) + + project (log4cplus) +-cmake_minimum_required (VERSION 3.12) +- +-# Use "-fPIC" / "-fPIE" for all targets by default, including static libs. +-set (CMAKE_POSITION_INDEPENDENT_CODE ON) + + enable_language (CXX) + if (MSVC) diff --git a/recipes/log4cplus/all/test_package/CMakeLists.txt b/recipes/log4cplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d9b0e93737a79 --- /dev/null +++ b/recipes/log4cplus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(log4cplus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cplus::log4cplus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/log4cplus/all/test_package/conanfile.py b/recipes/log4cplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/log4cplus/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/log4cplus/all/test_package/test_package.cpp b/recipes/log4cplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..af5a4e0b3ddde --- /dev/null +++ b/recipes/log4cplus/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +int main() +{ + log4cplus::Initializer initializer; + + log4cplus::BasicConfigurator config; + config.configure(); + + log4cplus::Logger logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("main")); + LOG4CPLUS_WARN(logger, LOG4CPLUS_TEXT("Hello, World!")); + + return 0; +} diff --git a/recipes/log4cplus/all/test_v1_package/CMakeLists.txt b/recipes/log4cplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/log4cplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/log4cplus/all/test_v1_package/conanfile.py b/recipes/log4cplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/log4cplus/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/log4cplus/config.yml b/recipes/log4cplus/config.yml new file mode 100644 index 0000000000000..c48cbc75b8c2f --- /dev/null +++ b/recipes/log4cplus/config.yml @@ -0,0 +1,13 @@ +versions: + "2.1.0": + folder: all + "2.0.8": + folder: all + "2.0.7": + folder: all + "2.0.6": + folder: all + "2.0.5": + folder: all + "2.0.4": + folder: all diff --git a/recipes/log4cxx/all/CMakeLists.txt b/recipes/log4cxx/all/CMakeLists.txt new file mode 100644 index 0000000000000..b83949de59dc5 --- /dev/null +++ b/recipes/log4cxx/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.13) +project(cmake_wrapper CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml new file mode 100644 index 0000000000000..4d9c222f7d839 --- /dev/null +++ b/recipes/log4cxx/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "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: + "0.12.1": + - base_path: "source_subfolder" + patch_file: "patches/0001-find-apr.patch" + "0.12.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-find-apr.patch" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py new file mode 100644 index 0000000000000..ac48eb45fc460 --- /dev/null +++ b/recipes/log4cxx/all/conanfile.py @@ -0,0 +1,149 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class Log4cxxConan(ConanFile): + name = "log4cxx" + description = "Logging framework for C++ patterned after Apache log4j" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + homepage = "https://logging.apache.org/log4cxx" + topics = ("logging", "log") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "cmake", "cmake_find_package", "pkg_config" + _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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("apr/1.7.0") + self.requires("apr-util/1.6.1") + self.requires("expat/2.4.2") + if self.settings.os != "Windows": + self.requires("odbc/2.3.9") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "clang": "5", + "apple-clang": "10", + } + + def validate(self): + # TODO: if compiler doesn't support C++17, boost can be used instead + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("log4cxx requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("log4cxx requires a compiler that supports at least C++17") + + def build_requirements(self): + if self.settings.os != "Windows": + self.build_requires("pkgconf/1.7.4") + + def source(self): + #OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: + #'source_subfolder\\src\\test\\resources\\output\\xyz\\:' + pattern = "*[!:]" + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True, + pattern=pattern) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["BUILD_TESTING"] = False + if self.settings.os == "Windows": + self._cmake.definitions["LOG4CXX_INSTALL_PDB"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + self.copy("NOTICE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"log4cxx": "log4cxx::log4cxx"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "log4cxx") + self.cpp_info.set_property("cmake_target_name", "log4cxx") + self.cpp_info.set_property("pkg_config_name", "liblog4cxx") + if not self.options.shared: + self.cpp_info.defines = ["LOG4CXX_STATIC"] + self.cpp_info.libs = ["log4cxx"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["odbc32"] + + # 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] + self.cpp_info.names["pkg_config"] = "liblog4cxx" diff --git a/recipes/log4cxx/all/patches/0001-find-apr.patch b/recipes/log4cxx/all/patches/0001-find-apr.patch new file mode 100644 index 0000000000000..11635d23e734f --- /dev/null +++ b/recipes/log4cxx/all/patches/0001-find-apr.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,10 +25,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/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4b7ef0dd16dbb --- /dev/null +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +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) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0aa45c8d4db18 --- /dev/null +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") + bin_path = os.path.join("bin", "test_package") + self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) diff --git a/recipes/log4cxx/all/test_package/log4cxx_config.xml b/recipes/log4cxx/all/test_package/log4cxx_config.xml new file mode 100644 index 0000000000000..4269f78dd989e --- /dev/null +++ b/recipes/log4cxx/all/test_package/log4cxx_config.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes/log4cxx/all/test_package/test_package.cpp b/recipes/log4cxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4e52b04611957 --- /dev/null +++ b/recipes/log4cxx/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "log4cxx/logger.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"; + return -1; + } + DOMConfigurator::configure(argv[1]); + LOG4CXX_INFO(logger, "App started!"); + LOG4CXX_ERROR(logger, "Some error!"); + return 0; +} diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml new file mode 100644 index 0000000000000..f5578f6ffba14 --- /dev/null +++ b/recipes/log4cxx/config.yml @@ -0,0 +1,5 @@ +versions: + "0.12.1": + folder: all + "0.12.0": + folder: all diff --git a/recipes/logr/0.1.0/CMakeLists.txt b/recipes/logr/0.1.0/CMakeLists.txt new file mode 100644 index 0000000000000..c21cb501798d1 --- /dev/null +++ b/recipes/logr/0.1.0/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.14) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder/logr) diff --git a/recipes/logr/0.1.0/conandata.yml b/recipes/logr/0.1.0/conandata.yml new file mode 100644 index 0000000000000..368303bc2a36c --- /dev/null +++ b/recipes/logr/0.1.0/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.1.0.tar.gz" + sha256: "6b2e68b6425362f678b7485cd2c8cef7db377ac8ccd45646c84941b189b0b82d" diff --git a/recipes/logr/0.1.0/conanfile.py b/recipes/logr/0.1.0/conanfile.py new file mode 100644 index 0000000000000..a3500eef56a0a --- /dev/null +++ b/recipes/logr/0.1.0/conanfile.py @@ -0,0 +1,97 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +class LogrConan(ConanFile): + name = "logr" + license = "BSD 3-Clause License" + homepage = "https://github.com/ngrodzitski/logr" + url = "https://github.com/conan-io/conan-center-index" + description = "Logger frontend substitution for spdlog, glog, etc for server/desktop applications" + topics = ("logger", "development", "util", "utils") + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + exports_sources = ["CMakeLists.txt"] + + options = { "backend": ["spdlog", "glog", "log4cplus", "log4cplus-unicode", None] } + default_options = { "backend": "spdlog"} + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + self.requires("fmt/7.1.2") + + if self.options.backend == "spdlog": + self.requires("spdlog/1.8.0") + elif self.options.backend == "glog": + self.requires("glog/0.4.0") + elif self.options.backend == "log4cplus": + self.requires("log4cplus/2.0.5") + elif self.options.backend == "log4cplus-unicode": + self.requires("log4cplus/2.0.5") + + def configure(self): + minimal_cpp_standard = "17" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "16" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warn( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["LOGR_WITH_SPDLOG_BACKEND"] = self.options.backend == "spdlog" + self._cmake.definitions["LOGR_WITH_GLOG_BACKEND"] = self.options.backend == "glog" + self._cmake.definitions["LOGR_WITH_LOG4CPLUS_BACKEND"] = self.options.backend in ["log4cplus", "log4cplus-unicode"] + + self._cmake.definitions["LOGR_INSTALL"] = True + + self._cmake.configure( build_folder=self._build_subfolder ) + return self._cmake + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def build(self): + if self.options.backend == "log4cplus" and self.options["log4cplus"].unicode: + raise ConanInvalidConfiguration("backend='log4cplus' requires log4cplus:unicode=False") + elif self.options.backend == "log4cplus-unicode" and not self.options["log4cplus"].unicode: + raise ConanInvalidConfiguration("backend='log4cplus-unicode' requires log4cplus:unicode=True") + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib")) + + def package_id(self): + self.info.header_only() diff --git a/recipes/logr/0.1.0/test_package/CMakeLists.txt b/recipes/logr/0.1.0/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd3eca474d6d3 --- /dev/null +++ b/recipes/logr/0.1.0/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.14) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/logr/0.1.0/test_package/conanfile.py b/recipes/logr/0.1.0/test_package/conanfile.py new file mode 100644 index 0000000000000..b862d3bd0137e --- /dev/null +++ b/recipes/logr/0.1.0/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class LogrTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/logr/0.1.0/test_package/example.cpp b/recipes/logr/0.1.0/test_package/example.cpp new file mode 100644 index 0000000000000..e80e0e10f0233 --- /dev/null +++ b/recipes/logr/0.1.0/test_package/example.cpp @@ -0,0 +1,31 @@ +#include + +#include + +#include +#include + +auto make_logger() +{ + auto sink = std::make_shared< spdlog::sinks::stdout_sink_st >(); + sink->set_pattern("[%Y-%m-%d %T][%n][%l] %v [%g]"); + + return logr::spdlog_logger_t<>{ + "console", + std::move( sink ), + logr::log_message_level::trace + }; +} + +int main() +{ + auto logger = make_logger(); + + logger.info( []( auto & out ){ + fmt::format_to( out, + "Welcome to logr (v{}.{}.{}), package is provided by Conan!", + LOGR_VERSION_MAJOR, + LOGR_VERSION_MINOR, + LOGR_VERSION_PATCH ); + } ); +} diff --git a/recipes/logr/all/conandata.yml b/recipes/logr/all/conandata.yml new file mode 100644 index 0000000000000..46dc2294ce601 --- /dev/null +++ b/recipes/logr/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.2.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.2.0.tar.gz" + sha256: "4e1707f9450f12b0752d8ef4d72a3f38a2e6be0014ca7edde049f22e9b9119a4" + "0.2.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.2.1.tar.gz" + sha256: "411282bb03d678d7266951b979102392dbf7e5e14b629bccfb2c4e74cfa758c6" + "0.3.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.3.0.tar.gz" + sha256: "21eea6cce32e3ccf3769f66211143b17f8b36891e79ec3ef5209f849d9e79ad7" + "0.4.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.4.0.tar.gz" + sha256: "c355aa455d0a9c6d1d3bc168a2db0cd7f3c9706b382088e96948ec3a4cf1286f" + "0.5.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" + sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" + "0.6.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.6.0.tar.gz" + sha256: "2ecb40396add33f2120a79957633533381f3df13cb3b53278eb9dec3a1230eb2" diff --git a/recipes/logr/all/conanfile.py b/recipes/logr/all/conanfile.py new file mode 100644 index 0000000000000..a5e869c032b2e --- /dev/null +++ b/recipes/logr/all/conanfile.py @@ -0,0 +1,142 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.files import get, copy, rmdir +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + +class LogrConan(ConanFile): + name = "logr" + license = "BSD-3-Clause" + homepage = "https://github.com/ngrodzitski/logr" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "Logger frontend substitution for spdlog, glog, etc " + "for server/desktop applications" + ) + topics = ("logger", "development", "util", "utils") + + settings = "os", "compiler", "build_type", "arch" + + options = {"backend": ["spdlog", "glog", "log4cplus", "boostlog", None]} + default_options = {"backend": "spdlog"} + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "0.6.0": + fmt_ref = "fmt/9.1.0" + spdlog_ref = "spdlog/1.11.0" + else: + fmt_ref = "fmt/8.1.1" + spdlog_ref = "spdlog/1.9.2" + + self.requires(fmt_ref) + + if self.options.backend == "spdlog": + self.requires(spdlog_ref) + elif self.options.backend == "glog": + self.requires("glog/0.6.0") + elif self.options.backend == "log4cplus": + self.requires("log4cplus/2.0.5") + elif self.options.backend == "boostlog": + self.requires("boost/1.77.0") + + def package_id(self): + self.info.settings.clear() + self.info.requires.clear() + + def validate(self): + minimal_cpp_standard = "17" + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "10", + "clang": "11", + "apple-clang": "12", + } + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = minimal_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}-{minimum_version}." + ) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LOGR_WITH_SPDLOG_BACKEND"] = ( + self.options.backend == "spdlog" + ) + tc.variables["LOGR_WITH_GLOG_BACKEND"] = ( + self.options.backend == "glog" + ) + tc.variables["LOGR_WITH_LOG4CPLUS_BACKEND"] = ( + self.options.backend == "log4cplus" + ) + tc.variables["LOGR_WITH_BOOSTLOG_BACKEND"] = ( + self.options.backend == "boostlog" + ) + tc.variables["LOGR_INSTALL"] = True + tc.variables["LOGR_CONAN_PACKAGING"] = True + tc.variables["LOGR_BUILD_TESTS"] = False + tc.variables["LOGR_BUILD_EXAMPLES"] = False + tc.variables["LOGR_BUILD_BENCHMARKS"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + 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")) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "logr")) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "logr") + + self.cpp_info.names["cmake_find_package"] = "logr" + self.cpp_info.names["cmake_find_package_multi"] = "logr" + + self.cpp_info.components["logr_base"].includedirs = ["include"] + self.cpp_info.components["logr_base"].requires = ["fmt::fmt"] + + if self.options.backend == "spdlog": + self.cpp_info.components["logr_spdlog"].includedirs = [] + self.cpp_info.components["logr_spdlog"].requires = [ + "logr_base", + "spdlog::spdlog", + ] + elif self.options.backend == "glog": + self.cpp_info.components["logr_glog"].includedirs = [] + self.cpp_info.components["logr_glog"].requires = [ + "logr_base", + "glog::glog", + ] + elif self.options.backend == "log4cplus": + self.cpp_info.components["logr_log4cplus"].includedirs = [] + self.cpp_info.components["logr_log4cplus"].requires = [ + "logr_base", + "log4cplus::log4cplus", + ] + elif self.options.backend == "boostlog": + self.cpp_info.components["logr_boostlog"].includedirs = [] + self.cpp_info.components["logr_boostlog"].requires = [ + "logr_base", + "boost::log", + ] diff --git a/recipes/logr/all/test_package/CMakeLists.txt b/recipes/logr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..866a0cc839d26 --- /dev/null +++ b/recipes/logr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(logr REQUIRED) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} logr::logr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_package/conanfile.py b/recipes/logr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/logr/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/logr/all/test_package/example.cpp b/recipes/logr/all/test_package/example.cpp new file mode 100644 index 0000000000000..836335e1e146d --- /dev/null +++ b/recipes/logr/all/test_package/example.cpp @@ -0,0 +1,31 @@ +#include + +#include + +#include +#include + +auto make_logger() +{ + auto sink = std::make_shared< spdlog::sinks::stdout_sink_st >(); + sink->set_pattern("[%Y-%m-%d %T][%n][%l] %v [%g]"); + + return logr::spdlog_logger_t<>{ + "console", + std::move( sink ), + logr::log_message_level::trace + }; +} + +int main() +{ + auto logger = make_logger(); + + logger.info( []( auto & out ){ + format_to( out, + "Welcome to logr (v{}.{}.{}), package is provided by Conan!", + LOGR_VERSION_MAJOR, + LOGR_VERSION_MINOR, + LOGR_VERSION_PATCH ); + } ); +} diff --git a/recipes/logr/all/test_v1_package/CMakeLists.txt b/recipes/logr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a2102f144a4f --- /dev/null +++ b/recipes/logr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(logr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/example.cpp) +target_link_libraries(${PROJECT_NAME} logr::logr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_v1_package/conanfile.py b/recipes/logr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..923245bfa853d --- /dev/null +++ b/recipes/logr/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class LogrTestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/logr/config.yml b/recipes/logr/config.yml new file mode 100644 index 0000000000000..2642be9922766 --- /dev/null +++ b/recipes/logr/config.yml @@ -0,0 +1,15 @@ +versions: + "0.1.0": + folder: 0.1.0 + "0.2.0": + folder: all + "0.2.1": + folder: all + "0.3.0": + folder: all + "0.4.0": + folder: all + "0.5.1": + folder: all + "0.6.0": + folder: all diff --git a/recipes/ls-qpack/all/conandata.yml b/recipes/ls-qpack/all/conandata.yml new file mode 100644 index 0000000000000..2760252082cf6 --- /dev/null +++ b/recipes/ls-qpack/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.5.1": + url: "https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.1.tar.gz" + sha256: "dae1c159afc8541d51c12f5ad78209fe092815d37cb621b5ee46a9db049a283f" + +patches: + "2.5.1": + - patch_file: "patches/0001-use-cci-package.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0002-add-installer.patch" + patch_description: "add installer" + patch_type: "conan" diff --git a/recipes/ls-qpack/all/conanfile.py b/recipes/ls-qpack/all/conanfile.py new file mode 100644 index 0000000000000..dd139a2740293 --- /dev/null +++ b/recipes/ls-qpack/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class LsQpackConan(ConanFile): + name = "ls-qpack" + description = "QPACK compression library for use with HTTP/3" + license = "MIT", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/litespeedtech/ls-qpack/" + topics = ("compression", "quic", "http3", "qpack") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_xxh": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_xxh": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_xxh: + self.requires("xxhash/0.8.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["LSQPACK_TESTS"] = False + tc.variables["LSQPACK_BIN"] = False + tc.variables["LSQPACK_XXH"] = self.options.with_xxh + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ls-qpack"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] + if self.settings.os == "Windows": + self.cpp_info.includedirs.append(os.path.join("include", "wincompat")) diff --git a/recipes/ls-qpack/all/patches/0001-use-cci-package.patch b/recipes/ls-qpack/all/patches/0001-use-cci-package.patch new file mode 100644 index 0000000000000..21e1e856275c9 --- /dev/null +++ b/recipes/ls-qpack/all/patches/0001-use-cci-package.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d9d9aa3..826e99b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,9 +20,10 @@ add_library(ls-qpack "") + target_include_directories(ls-qpack PUBLIC .) + target_sources(ls-qpack PRIVATE lsqpack.c) + +-target_include_directories(ls-qpack PRIVATE deps/xxhash/) + if(LSQPACK_XXH) ++ find_package(xxHash REQUIRED CONFIG) + target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c) ++ target_link_libraries(ls-qpack PUBLIC xxHash::xxhash) + endif() + + if(MSVC) diff --git a/recipes/ls-qpack/all/patches/0002-add-installer.patch b/recipes/ls-qpack/all/patches/0002-add-installer.patch new file mode 100644 index 0000000000000..1acf784e4597a --- /dev/null +++ b/recipes/ls-qpack/all/patches/0002-add-installer.patch @@ -0,0 +1,23 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 670ea97..f2dd257 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -100,3 +100,18 @@ endif() + if(LSQPACK_BIN) + add_subdirectory(bin) + endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS ls-qpack ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++ ++install(FILES lsqpack.h DESTINATION include) ++ ++if(WIN32) ++ install(DIRECTORY wincompat DESTINATION include) ++endif() diff --git a/recipes/ls-qpack/all/test_package/CMakeLists.txt b/recipes/ls-qpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..20bf4d87148f5 --- /dev/null +++ b/recipes/ls-qpack/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ls-qpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ls-qpack::ls-qpack) diff --git a/recipes/ls-qpack/all/test_package/conanfile.py b/recipes/ls-qpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/ls-qpack/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/ls-qpack/all/test_package/test_package.c b/recipes/ls-qpack/all/test_package/test_package.c new file mode 100644 index 0000000000000..315d2c1f5f1d6 --- /dev/null +++ b/recipes/ls-qpack/all/test_package/test_package.c @@ -0,0 +1,80 @@ +#include +#include +#include +#include + +#include "lsqpack.h" + +int +lsqpack_dec_int (const unsigned char **src_p, const unsigned char *src_end, + unsigned prefix_bits, uint64_t *value_p, + struct lsqpack_dec_int_state *state); + + +struct int_test +{ + int it_lineno; + unsigned it_prefix_bits; + unsigned char it_encoded[20]; + size_t it_enc_sz; + uint64_t it_decoded; + int it_dec_retval; +}; + +static const struct int_test tests[] = +{ + + { .it_lineno = __LINE__, + .it_prefix_bits = 7, + .it_encoded = { 0x7F, 0x02, }, + .it_enc_sz = 2, + .it_decoded = 0x81, + .it_dec_retval = 0, + }, +}; + +int +main (void) +{ + struct lsqpack_enc enc; + size_t dec_sz; + int s; + unsigned i; + const unsigned char *p; + uint64_t val; + struct lsqpack_dec_int_state state; + unsigned char dec_buf[LSQPACK_LONGEST_SDTC]; + + const struct { + unsigned peer_max_size; /* Value provided by peer */ + unsigned our_max_size; /* Value to use */ + int expected_tsu; /* Expecting TSU instruction? */ + } tests[] = { + { 0x1000, 0x1000, 1, }, + { 0x1000, 1, 1, }, + { 0x100, 0x100, 1, }, + { 0x1000, 0, 0, }, + }; + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + dec_sz = sizeof(dec_buf); + s = lsqpack_enc_init(&enc, stderr, tests[i].peer_max_size, + tests[i].our_max_size, 0, 0, dec_buf, &dec_sz); + assert(s == 0); + if (tests[i].expected_tsu) + { + assert(dec_sz > 0); + assert((dec_buf[0] & 0xE0) == 0x20); + p = dec_buf; + state.resume = 0; + s = lsqpack_dec_int(&p, p + dec_sz, 5, &val, &state); + assert(s == 0); + assert(val == tests[i].our_max_size); + } + else + assert(dec_sz == 0); + lsqpack_enc_cleanup(&enc); + } + return 0; +} diff --git a/recipes/ls-qpack/all/test_v1_package/CMakeLists.txt b/recipes/ls-qpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/ls-qpack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ls-qpack/all/test_v1_package/conanfile.py b/recipes/ls-qpack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/ls-qpack/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ls-qpack/config.yml b/recipes/ls-qpack/config.yml new file mode 100644 index 0000000000000..eab83a303df52 --- /dev/null +++ b/recipes/ls-qpack/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.1": + folder: all diff --git a/recipes/lua/all/CMakeLists.txt b/recipes/lua/all/CMakeLists.txt new file mode 100644 index 0000000000000..ed493a41f2982 --- /dev/null +++ b/recipes/lua/all/CMakeLists.txt @@ -0,0 +1,108 @@ +cmake_minimum_required(VERSION 2.8.12) +project(lua) + +# The following was originally taken from: https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/lua/CMakeLists.txt + +# Lua can be compiled as either C or C++. +# Default configuration is C, set COMPILE_AS_CPP to ON to use C++. +# See http://stackoverflow.com/questions/13560945/c-and-c-library-using-longjmp for why would you want to do that. +# Primary differences: +# - Exceptions will be used instead of setjmp/longjmp +# - The name mangling for functions will be C++ instead of C. +# - This is a source-incompatible change because extern "C" is chosen by the including application. +# - The lua.hpp header will not be available. + +SET(SOURCE_DIR ${LUA_SRC_DIR}) + +# Build Libraries +FILE(GLOB SRC_LIBLUA "${SOURCE_DIR}/src/*.c") +SET(SRC_LUAI "${SOURCE_DIR}/src/lua.c") +SET(SRC_LUAC "${SOURCE_DIR}/src/luac.c") +LIST(REMOVE_ITEM SRC_LIBLUA ${SRC_LUAC} ${SRC_LUAI}) + +IF (COMPILE_AS_CPP) + SET_SOURCE_FILES_PROPERTIES(${SRC_LIBLUA} ${SRC_LUAI} ${SRC_LUAC} PROPERTIES LANGUAGE CXX) +ELSE () + SET (CMAKE_C_STANDARD 99) +ENDIF () + +IF (WIN32) + # remove warnings + ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS ) +ENDIF () + +IF (UNIX) + IF (NOT ANDROID) + ADD_DEFINITIONS (-DLUA_USE_POSIX) + ENDIF () + FIND_LIBRARY (LIB_MATH NAMES m) + IF (LIB_MATH) + LINK_LIBRARIES (${LIB_MATH}) + ENDIF () +ENDIF () + +#DLL +ADD_LIBRARY ( lua ${SRC_LIBLUA} ) +IF (COMPILE_AS_CPP) + SET_TARGET_PROPERTIES(lua PROPERTIES OUTPUT_NAME "lua-c++") +ENDIF() + +IF (BUILD_SHARED_LIBS AND WIN32) + TARGET_COMPILE_DEFINITIONS (lua PUBLIC -DLUA_BUILD_AS_DLL ) +ENDIF () + +IF (UNIX) + IF (APPLE) + TARGET_COMPILE_DEFINITIONS (lua PUBLIC -DLUA_USE_DLOPEN) + ELSE () + FIND_LIBRARY (LIB_DLOPEN NAMES dl) + IF (LIB_DLOPEN) + TARGET_COMPILE_DEFINITIONS (lua PUBLIC -DLUA_USE_DLOPEN) + TARGET_LINK_LIBRARIES (lua ${LIB_DLOPEN}) + ENDIF () + ENDIF () +ENDIF () + +INSTALL ( TARGETS lua + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib +) + +IF (NOT DEFINED SKIP_INSTALL_TOOLS) + ADD_EXECUTABLE ( luac ${SRC_LUAC} ${SRC_LIBLUA} ) # compiler uses non-exported APIs, so must include sources directly. + ADD_EXECUTABLE ( luai ${SRC_LUAI} ) # interpreter + TARGET_LINK_LIBRARIES ( luai lua ) + SET_TARGET_PROPERTIES ( luai PROPERTIES OUTPUT_NAME lua PDB_NAME luai ) + IF (UNIX) + IF (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) + SET (_LIB_READLINE_NAME edit) + ELSE () + SET (_LIB_READLINE_NAME readline) + ENDIF () + FIND_LIBRARY (LIB_READLINE NAMES ${_LIB_READLINE_NAME}) + IF (LIB_READLINE) + TARGET_COMPILE_DEFINITIONS (luai PUBLIC -DLUA_USE_READLINE) + TARGET_LINK_LIBRARIES(luai ${LIB_READLINE}) + IF (_LIB_READLINE_NAME STREQUAL edit) + TARGET_INCLUDE_DIRECTORIES (luai PUBLIC /usr/include/edit) + ENDIF () + ENDIF () + ENDIF () + INSTALL ( TARGETS luai luac RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools/lua ) +ENDIF () + +IF (NOT DEFINED SKIP_INSTALL_HEADERS) + INSTALL( + FILES + ${SOURCE_DIR}/src/lualib.h + ${SOURCE_DIR}/src/lua.h + ${SOURCE_DIR}/src/luaconf.h + ${SOURCE_DIR}/src/lauxlib.h + DESTINATION include + ) + # If using C++, don't install extern "C" wrapper. + IF (NOT COMPILE_AS_CPP) + INSTALL(FILES ${SOURCE_DIR}/src/lua.hpp DESTINATION include) + ENDIF () +ENDIF () diff --git a/recipes/lua/all/conandata.yml b/recipes/lua/all/conandata.yml new file mode 100644 index 0000000000000..f5255a70f03a4 --- /dev/null +++ b/recipes/lua/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "5.4.4": + url: "https://www.lua.org/ftp/lua-5.4.4.tar.gz" + sha256: "164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61" + "5.4.3": + url: "https://www.lua.org/ftp/lua-5.4.3.tar.gz" + sha256: "f8612276169e3bfcbcfb8f226195bfc6e466fe13042f1076cbde92b7ec96bbfb" + "5.4.1": + url: "https://www.lua.org/ftp/lua-5.4.1.tar.gz" + sha256: "4ba786c3705eb9db6567af29c91a01b81f1c0ac3124fdbf6cd94bdd9e53cca7d" + "5.3.6": + url: "https://www.lua.org/ftp/lua-5.3.6.tar.gz" + sha256: "fc5fd69bb8736323f026672b1b7235da613d7177e72558893a0bdcd320466d60" + "5.3.5": + url: "https://www.lua.org/ftp/lua-5.3.5.tar.gz" + sha256: "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac" +patches: + "5.3.5": + - patch_file: "patches/5.3.5/lua_mobile.patch" + patch_type: "portability" diff --git a/recipes/lua/all/conanfile.py b/recipes/lua/all/conanfile.py new file mode 100644 index 0000000000000..1c9406858f97e --- /dev/null +++ b/recipes/lua/all/conanfile.py @@ -0,0 +1,83 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, load, save, export_conandata_patches, apply_conandata_patches, collect_libs +from conan.tools.apple import fix_apple_shared_install_name + + +required_conan_version = ">=1.53.0" + + +class LuaConan(ConanFile): + name = "lua" + package_type = "library" + description = "Lua is a powerful, efficient, lightweight, embeddable scripting language." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.lua.org/" + topics = ("lua", "scripting") + license = "MIT" + + settings = "os", "compiler", "arch", "build_type" + options = { + "shared": [False, True], + "fPIC": [True, False], + "compile_as_cpp": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "compile_as_cpp": False + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.compile_as_cpp: + self.options.rm_safe("compiler.libcxx") + self.options.rm_safe("compiler.cppstd") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LUA_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["SKIP_INSTALL_TOOLS"] = True + tc.variables["COMPILE_AS_CPP"] = self.options.compile_as_cpp + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + # Extract the License/s from the header to a file + tmp = load(self, os.path.join(self.source_folder, "src", "lua.h")) + license_contents = tmp[tmp.find("/***", 1):tmp.find("****/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "COPYING.txt"), license_contents) + cmake = CMake(self) + cmake.install() + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m"] + if self.settings.os in ["Linux", "FreeBSD", "Macos"]: + self.cpp_info.defines.extend(["LUA_USE_DLOPEN", "LUA_USE_POSIX"]) + elif self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("LUA_BUILD_AS_DLL") diff --git a/recipes/lua/all/patches/5.3.5/lua_mobile.patch b/recipes/lua/all/patches/5.3.5/lua_mobile.patch new file mode 100644 index 0000000000000..8cf7ac6439692 --- /dev/null +++ b/recipes/lua/all/patches/5.3.5/lua_mobile.patch @@ -0,0 +1,21 @@ +--- src/loslib.c 2020-02-14 12:04:26.000000000 +0100 ++++ loslib_mobile.c 2020-02-14 12:03:59.000000000 +0100 +@@ -140,6 +140,7 @@ + + static int os_execute (lua_State *L) { + const char *cmd = luaL_optstring(L, 1, NULL); ++#if !defined(__IPHONE_8_1) && !defined (__ANDROID__) + int stat = system(cmd); + if (cmd != NULL) + return luaL_execresult(L, stat); +@@ -147,6 +148,10 @@ + lua_pushboolean(L, stat); /* true if there is a shell */ + return 1; + } ++#else ++ lua_pushboolean(L, -1); /* a problem */ ++ return 1; ++#endif + } + + diff --git a/recipes/lua/all/test_package/CMakeLists.txt b/recipes/lua/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4ca1d96700d41 --- /dev/null +++ b/recipes/lua/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(lua REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} lua::lua) +if(COMPILE_AS_CPP) + target_compile_definitions(${PROJECT_NAME} PRIVATE COMPILE_AS_CPP) +endif() diff --git a/recipes/lua/all/test_package/conanfile.py b/recipes/lua/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7841d879aa96a --- /dev/null +++ b/recipes/lua/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["COMPILE_AS_CPP"] = self.dependencies.host["lua"].options.compile_as_cpp + 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/lua/all/test_package/test_package.cpp b/recipes/lua/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c77d4959a700e --- /dev/null +++ b/recipes/lua/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ + +#if defined COMPILE_AS_CPP +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" +#else +#include "lua.hpp" +#endif +#include + +int main(int argc, char* argv[]) +{ + lua_State* L = luaL_newstate(); + luaL_dostring(L, "x = 47"); + lua_getglobal(L, "x"); + lua_Number x = lua_tonumber(L, 1); + printf("lua says x = %d\n", (int)x); + lua_close(L); + return 0; +} diff --git a/recipes/lua/all/test_v1_package/CMakeLists.txt b/recipes/lua/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1241d9397ce36 --- /dev/null +++ b/recipes/lua/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +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/lua/all/test_v1_package/conanfile.py b/recipes/lua/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df7c8083a43c2 --- /dev/null +++ b/recipes/lua/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) + # Only for the test package, so we can choose which #include header to use + cmake.definitions["COMPILE_AS_CPP"] = self.options["lua"].compile_as_cpp + + 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/lua/config.yml b/recipes/lua/config.yml new file mode 100644 index 0000000000000..00ba0957e8f66 --- /dev/null +++ b/recipes/lua/config.yml @@ -0,0 +1,11 @@ +versions: + "5.4.4": + folder: all + "5.4.3": + folder: all + "5.4.1": + folder: all + "5.3.6": + folder: all + "5.3.5": + folder: all diff --git a/recipes/luajit/all/conandata.yml b/recipes/luajit/all/conandata.yml new file mode 100644 index 0000000000000..1e7abff8db36b --- /dev/null +++ b/recipes/luajit/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.1.0-beta3": + url: "https://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz" + sha256: "1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3" + "2.0.5": + url: "http://luajit.org/download/LuaJIT-2.0.5.tar.gz" + sha256: "874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979" +patches: + "2.1.0-beta3": + - patch_file: "patches/2.1.0-beta3-0001-remove-mac-deploy.patch" + patch_type: "conan" + patch_description: "Do not enforce default value for MACOSX_DEPLOYMENT_TARGET" diff --git a/recipes/luajit/all/conanfile.py b/recipes/luajit/all/conanfile.py new file mode 100644 index 0000000000000..5271897d749e2 --- /dev/null +++ b/recipes/luajit/all/conanfile.py @@ -0,0 +1,142 @@ +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools.files import get, chdir, replace_in_file, copy, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc, MSBuildToolchain, VCVars, unix_path +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.53.0" + + +class LuajitConan(ConanFile): + name = "luajit" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://luajit.org" + description = "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language." + topics = ("lua", "jit") + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8" and cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be cross-built to Mac M1. Please, try any version >=2.1") + elif Version(self.version) <= "2.1.0-beta1" and self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration(f"{self.ref} is not supported by Mac M1. Please, try any version >=2.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + tc = VCVars(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def _patch_sources(self): + if not is_msvc(self): + buildmode = 'shared' if self.options.shared else 'static' + makefile = os.path.join(self.source_folder, 'src', 'Makefile') + replace_in_file(self, makefile, + 'BUILDMODE= mixed', + 'BUILDMODE= %s' % buildmode) + replace_in_file(self, makefile, + 'TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME)', + 'TARGET_DYLIBPATH= $(TARGET_DYLIBNAME)') + # adjust mixed mode defaults to build either .so or .a, but not both + if not self.options.shared: + replace_in_file(self, makefile, + 'TARGET_T= $(LUAJIT_T) $(LUAJIT_SO)', + 'TARGET_T= $(LUAJIT_T) $(LUAJIT_A)') + replace_in_file(self, makefile, + 'TARGET_DEP= $(LIB_VMDEF) $(LUAJIT_SO)', + 'TARGET_DEP= $(LIB_VMDEF) $(LUAJIT_A)') + else: + replace_in_file(self, makefile, + 'TARGET_O= $(LUAJIT_A)', + 'TARGET_O= $(LUAJIT_SO)') + if "clang" in str(self.settings.compiler): + replace_in_file(self, makefile, 'CC= $(DEFAULT_CC)', 'CC= clang') + + @property + def _macosx_deployment_target(self): + return self.settings.get_safe("os.version") + + @property + def _make_arguments(self): + args = [f"PREFIX={unix_path(self, self.package_folder)}"] + if is_apple_os(self) and self._macosx_deployment_target: + args.append(f"MACOSX_DEPLOYMENT_TARGET={self._macosx_deployment_target}") + return args + + @property + def _luajit_include_folder(self): + luaversion = Version(self.version) + if luaversion.major == "2": + return f"luajit-{luaversion.major}.{luaversion.minor}" + return "luajit-2.1" + + def build(self): + apply_conandata_patches(self) + self._patch_sources() + if is_msvc(self): + with chdir(self, os.path.join(self.source_folder, "src")): + variant = '' if self.options.shared else 'static' + self.run(f"msvcbuild.bat {variant}", env="conanbuild") + else: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(args=self._make_arguments) + + def package(self): + copy(self, "COPYRIGHT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + src_folder = os.path.join(self.source_folder, "src") + include_folder = os.path.join(self.package_folder, "include", self._luajit_include_folder) + if is_msvc(self): + copy(self, "lua.h", src=src_folder, dst=include_folder) + copy(self, "lualib.h", src=src_folder, dst=include_folder) + copy(self, "lauxlib.h", src=src_folder, dst=include_folder) + copy(self, "luaconf.h", src=src_folder, dst=include_folder) + copy(self, "lua.hpp", src=src_folder, dst=include_folder) + copy(self, "luajit.h", src=src_folder, dst=include_folder) + copy(self, "lua51.lib", src=src_folder, dst=os.path.join(self.package_folder, "lib")) + copy(self, "lua51.dll", src=src_folder, dst=os.path.join(self.package_folder, "bin")) + else: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install(args=self._make_arguments + ["DESTDIR="]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["lua51" if is_msvc(self) else "luajit-5.1"] + self.cpp_info.set_property("pkg_config_name", "luajit") + self.cpp_info.includedirs = [os.path.join("include", self._luajit_include_folder)] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "dl"]) diff --git a/recipes/luajit/all/patches/2.1.0-beta3-0001-remove-mac-deploy.patch b/recipes/luajit/all/patches/2.1.0-beta3-0001-remove-mac-deploy.patch new file mode 100644 index 0000000000000..26345dc4f02f0 --- /dev/null +++ b/recipes/luajit/all/patches/2.1.0-beta3-0001-remove-mac-deploy.patch @@ -0,0 +1,14 @@ +diff --git a/src/Makefile b/src/Makefile +index f56465d..a6838bc 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -312,9 +312,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)) +- export MACOSX_DEPLOYMENT_TARGET=10.4 +- endif + TARGET_STRIP+= -x + TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC + TARGET_DYNXLDOPTS= diff --git a/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch b/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch new file mode 100644 index 0000000000000..42e0eca4a7fb6 --- /dev/null +++ b/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch @@ -0,0 +1,14 @@ +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/luajit/all/test_package/CMakeLists.txt b/recipes/luajit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c0ae2aa0ba9ba --- /dev/null +++ b/recipes/luajit/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(luajit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} luajit::luajit) diff --git a/recipes/luajit/all/test_package/conanfile.py b/recipes/luajit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1d87f369a24da --- /dev/null +++ b/recipes/luajit/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan.tools.build import can_run +from conan import ConanFile +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/luajit/all/test_package/test_package.c b/recipes/luajit/all/test_package/test_package.c new file mode 100644 index 0000000000000..37d3f9dc92eb1 --- /dev/null +++ b/recipes/luajit/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() +{ + LUAJIT_VERSION_SYM(); + return EXIT_SUCCESS; +} diff --git a/recipes/luajit/all/test_v1_package/CMakeLists.txt b/recipes/luajit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f6b1a2f7ec79 --- /dev/null +++ b/recipes/luajit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/luajit/all/test_v1_package/conanfile.py b/recipes/luajit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9d6b68dd18b5e --- /dev/null +++ b/recipes/luajit/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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/luajit/config.yml b/recipes/luajit/config.yml new file mode 100644 index 0000000000000..f13e8f0f1a9ec --- /dev/null +++ b/recipes/luajit/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.0-beta3": + folder: "all" + "2.0.5": + folder: "all" diff --git a/recipes/luau/all/CMakeLists.txt b/recipes/luau/all/CMakeLists.txt new file mode 100644 index 0000000000000..b7e55166bfcf9 --- /dev/null +++ b/recipes/luau/all/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.8) +project(conan_wrapper LANGUAGES CXX) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_subdirectory(${LUAU_SRC_DIR}) + +## installer +include(GNUInstallDirs) + +install( + TARGETS Luau.Ast + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY "${LUAU_SRC_DIR}/Ast/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +install( + TARGETS Luau.Compiler + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +install(DIRECTORY "${LUAU_SRC_DIR}/Compiler/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(FILES + "${LUAU_SRC_DIR}/Compiler/include/luacode.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +install( + TARGETS Luau.CodeGen + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY "${LUAU_SRC_DIR}/CodeGen/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + + +install( + TARGETS Luau.Analysis + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +install(DIRECTORY "${LUAU_SRC_DIR}/Analysis/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +install( + TARGETS Luau.VM + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +install(FILES + "${LUAU_SRC_DIR}/VM/include/lua.h" + "${LUAU_SRC_DIR}/VM/include/luaconf.h" + "${LUAU_SRC_DIR}/VM/include/lualib.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +if(LUAU_BUILD_CLI) + install( + TARGETS Luau.Repl.CLI + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + install( + TARGETS Luau.Analyze.CLI + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + install( + TARGETS Luau.Ast.CLI + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) +endif() + +if(LUAU_BUILD_WEB) + install( + TARGETS Luau.Web + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) +endif() diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml new file mode 100644 index 0000000000000..d9396fa422030 --- /dev/null +++ b/recipes/luau/all/conandata.yml @@ -0,0 +1,96 @@ +sources: + "0.572": + url: "https://github.com/Roblox/luau/archive/0.572.tar.gz" + sha256: "5cdd13233eefc4b3f27970118272254a24be81fafcccf60e7a29391fbc529151" + "0.568": + url: "https://github.com/Roblox/luau/archive/0.568.tar.gz" + sha256: "8218f1943b53439b9cc076bcb6d6223c089093659cc75dda6e2695ee9b370a8c" + "0.563": + url: "https://github.com/Roblox/luau/archive/0.563.tar.gz" + sha256: "717c1b3e03d20829d75eb484e0699fc824b651b8f394164bc4ab8194482890b2" + "0.558": + url: "https://github.com/Roblox/luau/archive/0.558.tar.gz" + sha256: "3484adddb18872700e033f5917af44d90c266f9e0fff2fac21aec1061f472a06" + "0.556": + url: "https://github.com/Roblox/luau/archive/0.556.tar.gz" + sha256: "dc72f91f4e866a2b25f7608e062c91c84e92a2e5611026e9789f127c3caf39f6" + "0.552": + url: "https://github.com/Roblox/luau/archive/0.552.tar.gz" + sha256: "c638aee88010197d7e6f22e592fa12360e38a69f54ed91980b11ac0f89676db5" + "0.548": + url: "https://github.com/Roblox/luau/archive/0.548.tar.gz" + sha256: "1ec0aa919955aaa2d88dbef115801681d3b4dbfa7a276435a03d20230918659c" + "0.544": + url: "https://github.com/Roblox/luau/archive/0.544.tar.gz" + sha256: "c1e2d4e04fe6f191192d1570bd83f96531804fc484a0bc0e00b53248a01d7dee" + "0.541": + url: "https://github.com/Roblox/luau/archive/0.541.tar.gz" + sha256: "02d50b8c0396a353ed641a61959851d6858607d535ed7373478b8fbc2a508eba" + "0.540": + url: "https://github.com/Roblox/luau/archive/0.540.tar.gz" + sha256: "84b3e52b3b0ccf4d5bc0e0c04055f3a9b2f045c1281e203a858335a6fe76b0ff" +patches: + "0.572": + - patch_file: "patches/0.572-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + "0.568": + - patch_file: "patches/0.568-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + "0.563": + - patch_file: "patches/0.552-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.558": + - patch_file: "patches/0.552-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.556": + - patch_file: "patches/0.552-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.552": + - patch_file: "patches/0.552-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.548": + - patch_file: "patches/0.536-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.544": + - patch_file: "patches/0.536-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.541": + - patch_file: "patches/0.536-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" + "0.540": + - patch_file: "patches/0.536-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + patch_description: "rename lerp function to avoid name conflict" + patch_type: "portability" diff --git a/recipes/luau/all/conanfile.py b/recipes/luau/all/conanfile.py new file mode 100644 index 0000000000000..fe153e150679e --- /dev/null +++ b/recipes/luau/all/conanfile.py @@ -0,0 +1,153 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file +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 LuauConan(ConanFile): + name = "luau" + description = "A fast, small, safe, gradually typed embeddable scripting language derived from Lua" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://luau-lang.org/" + topics = ("lua", "scripting", "typed", "embed") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [False, True], + "fPIC": [True, False], + "with_cli": [True, False], + "with_web": [True, False], + "native_code_gen": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cli": False, + "with_web": False, + "native_code_gen": False, + } + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8" if Version(self.version) < "0.549" else "9", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if Version(self.version) < "0.549": + del self.options.native_code_gen + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + 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._minimum_cpp_standard}, which your compiler does not support." + ) + + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared build in MSVC") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LUAU_BUILD_CLI"] = self.options.with_cli + tc.variables["LUAU_BUILD_TESTS"] = False + tc.variables["LUAU_BUILD_WEB"] = self.options.with_web + tc.variables["LUAU_WERROR"] = False + tc.variables["LUAU_STATIC_CRT"] = False + if Version(self.version) >= "0.549": + tc.variables["LUAU_NATIVE"] = self.options.native_code_gen + tc.variables["LUAU_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) >= "0.548" and self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "VM", "include", "luaconf.h"), + "#define LUAI_FUNC __attribute__((visibility(\"hidden\"))) extern", + "#define LUAI_FUNC extern") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "lua_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.set_property("cmake_file_name", "Luau") + self.cpp_info.set_property("cmake_target_name", "Luau::Luau") + + self.cpp_info.filenames["cmake_find_package"] = "Luau" + self.cpp_info.filenames["cmake_find_package_multi"] = "Luau" + self.cpp_info.names["cmake_find_package_multi"] = "Luau" + self.cpp_info.names["cmake_find_package"] = "Luau" + + self.cpp_info.components["Ast"].libs = ["Luau.Ast"] + self.cpp_info.components["Ast"].set_property("cmake_target_name", "Luau::Ast") + + self.cpp_info.components["VM"].libs = ["Luau.VM"] + self.cpp_info.components["VM"].set_property("cmake_target_name", "Luau::VM") + self.cpp_info.components["VM"].requires = ["Ast"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["VM"].system_libs = ["m"] + + self.cpp_info.components["Analysis"].libs = ["Luau.Analysis"] + self.cpp_info.components["Analysis"].set_property("cmake_target_name", "Luau::Analysis") + self.cpp_info.components["Analysis"].requires = ["Ast"] + + self.cpp_info.components["Compiler"].libs = ["Luau.Compiler"] + self.cpp_info.components["Compiler"].set_property("cmake_target_name", "Luau::Compiler") + self.cpp_info.components["Compiler"].requires = ["Ast"] + + self.cpp_info.components["CodeGen"].libs = ["Luau.CodeGen"] + self.cpp_info.components["CodeGen"].set_property("cmake_target_name", "Luau::CodeGen") + self.cpp_info.components["CodeGen"].requires = ["Ast"] + if Version(self.version) >= "0.548": + self.cpp_info.components["CodeGen"].requires.append("VM") + + if self.options.with_cli: + 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) + + if self.options.with_web: + self.cpp_info.components["Web"].libs = ["Luau.Web"] + self.cpp_info.components["Web"].set_property("cmake_target_name", "Luau::Web") + self.cpp_info.components["Web"].requires = ["Compiler", "VM"] diff --git a/recipes/luau/all/patches/0.536-0001-fix-cmake.patch b/recipes/luau/all/patches/0.536-0001-fix-cmake.patch new file mode 100644 index 0000000000000..00dcf66617205 --- /dev/null +++ b/recipes/luau/all/patches/0.536-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9200634..c1cca12 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,12 +21,12 @@ endif() + + project(Luau LANGUAGES CXX C) + add_library(Luau.Common INTERFACE) +-add_library(Luau.Ast STATIC) +-add_library(Luau.Compiler STATIC) +-add_library(Luau.Analysis STATIC) +-add_library(Luau.CodeGen STATIC) +-add_library(Luau.VM STATIC) +-add_library(isocline STATIC) ++add_library(Luau.Ast) ++add_library(Luau.Compiler) ++add_library(Luau.Analysis) ++add_library(Luau.CodeGen) ++add_library(Luau.VM) ++add_library(isocline) + + if(LUAU_BUILD_CLI) + add_executable(Luau.Repl.CLI) diff --git a/recipes/luau/all/patches/0.536-0002-rename-lerp.patch b/recipes/luau/all/patches/0.536-0002-rename-lerp.patch new file mode 100644 index 0000000000000..324b7d737bf16 --- /dev/null +++ b/recipes/luau/all/patches/0.536-0002-rename-lerp.patch @@ -0,0 +1,28 @@ +diff --git a/VM/src/lmathlib.cpp b/VM/src/lmathlib.cpp +index a6e7b49..7c3e3c6 100644 +--- a/VM/src/lmathlib.cpp ++++ b/VM/src/lmathlib.cpp +@@ -300,7 +300,7 @@ static float fade(float t) + return t * t * t * (t * (t * 6 - 15) + 10); + } + +-static float lerp(float t, float a, float b) ++static float lerp_l(float t, float a, float b) + { + return a + t * (b - a); + } +@@ -342,10 +342,10 @@ static float perlin(float x, float y, float z) + int ba = p[b] + zi; + int bb = p[b + 1] + zi; + +- return lerp(w, +- lerp(v, lerp(u, grad(p[aa], xf, yf, zf), grad(p[ba], xf - 1, yf, zf)), lerp(u, grad(p[ab], xf, yf - 1, zf), grad(p[bb], xf - 1, yf - 1, zf))), +- lerp(v, lerp(u, grad(p[aa + 1], xf, yf, zf - 1), grad(p[ba + 1], xf - 1, yf, zf - 1)), +- lerp(u, grad(p[ab + 1], xf, yf - 1, zf - 1), grad(p[bb + 1], xf - 1, yf - 1, zf - 1)))); ++ return lerp_l(w, ++ lerp_l(v, lerp_l(u, grad(p[aa], xf, yf, zf), grad(p[ba], xf - 1, yf, zf)), lerp_l(u, grad(p[ab], xf, yf - 1, zf), grad(p[bb], xf - 1, yf - 1, zf))), ++ lerp_l(v, lerp_l(u, grad(p[aa + 1], xf, yf, zf - 1), grad(p[ba + 1], xf - 1, yf, zf - 1)), ++ lerp_l(u, grad(p[ab + 1], xf, yf - 1, zf - 1), grad(p[bb + 1], xf - 1, yf - 1, zf - 1)))); + } + + static int math_noise(lua_State* L) diff --git a/recipes/luau/all/patches/0.552-0001-fix-cmake.patch b/recipes/luau/all/patches/0.552-0001-fix-cmake.patch new file mode 100644 index 0000000000000..aaff66adb45b9 --- /dev/null +++ b/recipes/luau/all/patches/0.552-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 05d701e..4c73783 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,12 +22,12 @@ endif() + + project(Luau LANGUAGES CXX C) + add_library(Luau.Common INTERFACE) +-add_library(Luau.Ast STATIC) +-add_library(Luau.Compiler STATIC) +-add_library(Luau.Analysis STATIC) +-add_library(Luau.CodeGen STATIC) +-add_library(Luau.VM STATIC) +-add_library(isocline STATIC) ++add_library(Luau.Ast) ++add_library(Luau.Compiler) ++add_library(Luau.Analysis) ++add_library(Luau.CodeGen) ++add_library(Luau.VM) ++add_library(isocline) + + if(LUAU_BUILD_CLI) + add_executable(Luau.Repl.CLI) diff --git a/recipes/luau/all/patches/0.568-0001-fix-cmake.patch b/recipes/luau/all/patches/0.568-0001-fix-cmake.patch new file mode 100644 index 0000000000000..9901376bd09ea --- /dev/null +++ b/recipes/luau/all/patches/0.568-0001-fix-cmake.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6e15e5f..63be1e1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,12 +24,12 @@ endif() + + project(Luau LANGUAGES CXX C) + add_library(Luau.Common INTERFACE) +-add_library(Luau.Ast STATIC) +-add_library(Luau.Compiler STATIC) +-add_library(Luau.Analysis STATIC) +-add_library(Luau.CodeGen STATIC) +-add_library(Luau.VM STATIC) +-add_library(isocline STATIC) ++add_library(Luau.Ast) ++add_library(Luau.Compiler) ++add_library(Luau.Analysis) ++add_library(Luau.CodeGen) ++add_library(Luau.VM) ++add_library(isocline) + + if(LUAU_BUILD_CLI) + add_executable(Luau.Repl.CLI) +diff --git a/Sources.cmake b/Sources.cmake +index 6e0a32e..53d77c6 100644 +--- a/Sources.cmake ++++ b/Sources.cmake +@@ -84,6 +84,7 @@ target_sources(Luau.CodeGen PRIVATE + CodeGen/src/CodeBlockUnwind.cpp + CodeGen/src/CodeGen.cpp + CodeGen/src/CodeGenUtils.cpp ++ CodeGen/src/CodeGenA64.cpp + CodeGen/src/CodeGenX64.cpp + CodeGen/src/EmitBuiltinsX64.cpp + CodeGen/src/EmitCommonX64.cpp diff --git a/recipes/luau/all/patches/0.572-0001-fix-cmake.patch b/recipes/luau/all/patches/0.572-0001-fix-cmake.patch new file mode 100644 index 0000000000000..24acb8d334fb9 --- /dev/null +++ b/recipes/luau/all/patches/0.572-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6e15e5f..63be1e1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,12 +24,12 @@ endif() + + project(Luau LANGUAGES CXX C) + add_library(Luau.Common INTERFACE) +-add_library(Luau.Ast STATIC) +-add_library(Luau.Compiler STATIC) +-add_library(Luau.Analysis STATIC) +-add_library(Luau.CodeGen STATIC) +-add_library(Luau.VM STATIC) +-add_library(isocline STATIC) ++add_library(Luau.Ast) ++add_library(Luau.Compiler) ++add_library(Luau.Analysis) ++add_library(Luau.CodeGen) ++add_library(Luau.VM) ++add_library(isocline) + + if(LUAU_BUILD_CLI) + add_executable(Luau.Repl.CLI) diff --git a/recipes/luau/all/test_package/CMakeLists.txt b/recipes/luau/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6f927f5fc234f --- /dev/null +++ b/recipes/luau/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Luau REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Luau::Luau) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/luau/all/test_package/conanfile.py b/recipes/luau/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/luau/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/luau/all/test_package/test_package.cpp b/recipes/luau/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7211862f8ded9 --- /dev/null +++ b/recipes/luau/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "lua.h" +#include "lualib.h" + +#include + +int main(int argc, char* argv[]) { + lua_State* L = luaL_newstate(); + lua_close(L); + return 0; +} diff --git a/recipes/luau/all/test_v1_package/CMakeLists.txt b/recipes/luau/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/luau/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/luau/all/test_v1_package/conanfile.py b/recipes/luau/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..81a08015e01f1 --- /dev/null +++ b/recipes/luau/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml new file mode 100644 index 0000000000000..7a020ec6f4657 --- /dev/null +++ b/recipes/luau/config.yml @@ -0,0 +1,21 @@ +versions: + "0.572": + folder: all + "0.568": + folder: all + "0.563": + folder: all + "0.558": + folder: all + "0.556": + folder: all + "0.552": + folder: all + "0.548": + folder: all + "0.544": + folder: all + "0.541": + folder: all + "0.540": + folder: all diff --git a/recipes/lunasvg/all/conandata.yml b/recipes/lunasvg/all/conandata.yml new file mode 100644 index 0000000000000..e504366930815 --- /dev/null +++ b/recipes/lunasvg/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "2.3.5": + url: "https://github.com/sammycage/lunasvg/archive/v2.3.5.tar.gz" + sha256: "350ff56aa1acdedefe2ad8a4241a9fb8f9b232868adc7bd36dfb3dbdd57e2e93" + "2.3.4": + url: "https://github.com/sammycage/lunasvg/archive/v2.3.4.tar.gz" + sha256: "1933bf3fcdec81a1c17702b3c6efb00b9e3380e3fcea508f4ee4b11b0d2e45c0" + "2.3.2": + url: "https://github.com/sammycage/lunasvg/archive/v2.3.2.tar.gz" + sha256: "12abe6865dd030adfac70c30592eaa25c4e34fa81379e5149b0186282721f40c" + "2.3.1": + url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz" + sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25" + +patches: + "2.3.5": + - patch_file: "patches/2.3.5-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" + "2.3.4": + - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" + "2.3.2": + - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" + "2.3.1": + - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py new file mode 100644 index 0000000000000..faebad4a7c975 --- /dev/null +++ b/recipes/lunasvg/all/conanfile.py @@ -0,0 +1,115 @@ +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.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.52.0" + +class LunaSVGConan(ConanFile): + name = "lunasvg" + description = "lunasvg is a standalone SVG rendering library in C++." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sammycage/lunasvg" + topics = ("svg", "renderer", ) + 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): + if Version(self.version) <= "2.3.2": + return 14 + else: + return 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) <= "2.3.2": + return { + "gcc": "5", + "clang": "3.5", + "apple-clang": "10" + } + else: + return { + "gcc": "7.1", + "clang": "7", + "apple-clang": "12.0" + } + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "2.3.5": + self.requires("plutovg/cci.20220103") + else: + self.requires("plutovg/cci.20221030") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + if Version(self.version) <= "2.3.2": + check_min_vs(self, 191) + else: + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["lunasvg"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/lunasvg/all/patches/2.3.1-0001-fix-cmake.patch b/recipes/lunasvg/all/patches/2.3.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..3ad95c303fab0 --- /dev/null +++ b/recipes/lunasvg/all/patches/2.3.1-0001-fix-cmake.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9916c67..6433f13 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,7 +13,9 @@ add_library(lunasvg) + add_subdirectory(include) + add_subdirectory(source) + add_subdirectory(3rdparty/software) +-add_subdirectory(3rdparty/plutovg) ++ ++find_package(plutovg CONFIG REQUIRED) ++target_link_libraries(lunasvg plutovg::plutovg) + + if(BUILD_SHARED_LIBS) + target_compile_definitions(lunasvg PUBLIC LUNASVG_SHARED) +@@ -24,16 +26,13 @@ if(LUNASVG_BUILD_EXAMPLES) + add_subdirectory(example) + endif() + +-set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) +-set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include) +- + install(FILES + include/lunasvg.h +- DESTINATION ${LUNASVG_INCDIR} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + install(TARGETS lunasvg +- LIBRARY DESTINATION ${LUNASVG_LIBDIR} +- ARCHIVE DESTINATION ${LUNASVG_LIBDIR} +- INCLUDES DESTINATION ${LUNASVG_INCDIR} ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) diff --git a/recipes/lunasvg/all/patches/2.3.5-0001-fix-cmake.patch b/recipes/lunasvg/all/patches/2.3.5-0001-fix-cmake.patch new file mode 100644 index 0000000000000..4b6e4b7f0ffef --- /dev/null +++ b/recipes/lunasvg/all/patches/2.3.5-0001-fix-cmake.patch @@ -0,0 +1,36 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index b2f07dc..3c40ad5 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -12,7 +12,9 @@ add_library(lunasvg) + + add_subdirectory(include) + add_subdirectory(source) +-add_subdirectory(3rdparty/plutovg) ++ ++find_package(plutovg CONFIG REQUIRED) ++target_link_libraries(lunasvg plutovg::plutovg) + + if(BUILD_SHARED_LIBS) + target_compile_definitions(lunasvg PUBLIC LUNASVG_SHARED) +@@ -23,16 +25,13 @@ if(LUNASVG_BUILD_EXAMPLES) + add_subdirectory(example) + endif() + +-set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) +-set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include) +- + install(FILES + include/lunasvg.h +- DESTINATION ${LUNASVG_INCDIR} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + install(TARGETS lunasvg +- LIBRARY DESTINATION ${LUNASVG_LIBDIR} +- ARCHIVE DESTINATION ${LUNASVG_LIBDIR} +- INCLUDES DESTINATION ${LUNASVG_INCDIR} ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) diff --git a/recipes/lunasvg/all/test_package/CMakeLists.txt b/recipes/lunasvg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1c8a5ea6697c7 --- /dev/null +++ b/recipes/lunasvg/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(lunasvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/lunasvg/all/test_package/conanfile.py b/recipes/lunasvg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/lunasvg/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/lunasvg/all/test_package/test_package.cpp b/recipes/lunasvg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e47dd43f1e9a --- /dev/null +++ b/recipes/lunasvg/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "lunasvg.h" +#include + +int main() { + auto mat = lunasvg::Matrix(); + + std::cout << mat.a << " " << mat.b << " " << mat.c << " " << mat.d << " " << mat.e << " " << mat.f << std::endl; + + return 0; +} diff --git a/recipes/lunasvg/all/test_v1_package/CMakeLists.txt b/recipes/lunasvg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..596ce1fb31ebb --- /dev/null +++ b/recipes/lunasvg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lunasvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/lunasvg/all/test_v1_package/conanfile.py b/recipes/lunasvg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..81a08015e01f1 --- /dev/null +++ b/recipes/lunasvg/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lunasvg/config.yml b/recipes/lunasvg/config.yml new file mode 100644 index 0000000000000..d8c968c29bee6 --- /dev/null +++ b/recipes/lunasvg/config.yml @@ -0,0 +1,9 @@ +versions: + "2.3.5": + folder: all + "2.3.4": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all diff --git a/recipes/luple/all/conandata.yml b/recipes/luple/all/conandata.yml new file mode 100644 index 0000000000000..c2dbecf43978d --- /dev/null +++ b/recipes/luple/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + "1.2": + - url: "https://github.com/alexpolt/luple/archive/1.2.tar.gz" + sha256: "810e622b656fa4f1cae5b299db94f550262eb49c81d373cfe770edcea3e8a68b" + - url: "https://unlicense.org/UNLICENSE" + sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" diff --git a/recipes/luple/all/conanfile.py b/recipes/luple/all/conanfile.py new file mode 100644 index 0000000000000..9334773f3ff8a --- /dev/null +++ b/recipes/luple/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, download, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class LupleConan(ConanFile): + name = "luple" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/alexpolt/luple" + description = "Home to luple, nuple, C++ String Interning, Struct Reader and C++ Type Loophole" + topics = ("loophole", "luple", "nuple", "struct", "intern") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14", + "msvc": "190", + } + + 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 loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + 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][0], + destination=self.source_folder, strip_root=True) + download(self, filename="LICENSE", **self.conan_data["sources"][self.version][1]) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/luple/all/test_package/CMakeLists.txt b/recipes/luple/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b556daffe2a12 --- /dev/null +++ b/recipes/luple/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(luple REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE luple::luple) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/luple/all/test_package/conanfile.py b/recipes/luple/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/luple/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/luple/all/test_package/test_package.cpp b/recipes/luple/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f2fe0bf1e1bd8 --- /dev/null +++ b/recipes/luple/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +#include +#include +#include +#include + +#include + +using nameid_t = nuple< $("name"), char const*, $("id"), int >; + +auto get_person ( int i ) { return nameid_t{ "john", i }; } + +auto get_person2 ( int id ) { + + return as_nuple( $name("key"), std::string{ "ivan" }, $name("value"), id ); +} + +int main() { + + nameid_t n[] = { { "alex", 1 }, { "ivan", 2 } }; + + for( auto& v : n ) + printf( "name: %s, id: %d\n", get<$("name")>( v ), get<$("id")>( v ) ); + + //return as_nuple(...), also using nuple_ns::name_t to get tag name type and print it + + auto p2 = get_person2( 10 ); + using p2_t = decltype( p2 ); + printf( "get_person2 (as_nuple): %s: %s, %s: %d\n", + nuple_ns::name_t< p2_t, 0 >::value, get<$("key")>( p2 ).data(), + nuple_ns::name_t< p2_t, 1 >::value, get<$("value")>( p2 ) ); + + + //return nuple<...>{ ... } + + auto p = get_person( 3 ); + printf( "get_person: tuple size %d, name: %s, id: %d\n", size( p ), get<$("name")>( p ), get<$("id")>( p ) ); + + + //usual luple mehods work too + + get<0>( p ) = "irene"; + get( p ) = 4; + + printf( "name: %s, id: %d\n", get<$("name")>( p ), get<$("id")>( p ) ); + + luple_do( p, []( auto& v ) { + std::cout << v << ": " << typeid( v ).name() << "; "; + } ); + + //nuple inherits from luple and supports its APIs + //see GitHub repo for docs and links to online examples: https://github.com/alexpolt/luple +} diff --git a/recipes/luple/all/test_v1_package/CMakeLists.txt b/recipes/luple/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/luple/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/luple/all/test_v1_package/conanfile.py b/recipes/luple/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/luple/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/luple/config.yml b/recipes/luple/config.yml new file mode 100644 index 0000000000000..68f009d6750ca --- /dev/null +++ b/recipes/luple/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2": + folder: "all" diff --git a/recipes/lurlparser/all/CMakeLists.txt b/recipes/lurlparser/all/CMakeLists.txt new file mode 100644 index 0000000000000..e0daa695ec3ad --- /dev/null +++ b/recipes/lurlparser/all/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +project(LUrlParser LANGUAGES CXX) + +add_library(lurlparser ${LURLPARSER_SRC_DIR}/LUrlParser.cpp) +target_include_directories(lurlparser PRIVATE ${LURLPARSER_SRC_DIR}) +target_compile_features(lurlparser PRIVATE cxx_std_11) +set_target_properties(lurlparser PROPERTIES + PUBLIC_HEADER ${LURLPARSER_SRC_DIR}/LUrlParser.h + CMAKE_CXX_STANDARD_REQUIRED ON + CMAKE_CXX_EXTENSIONS OFF + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +include(GNUInstallDirs) +install( + TARGETS lurlparser + 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/lurlparser/all/conandata.yml b/recipes/lurlparser/all/conandata.yml new file mode 100644 index 0000000000000..5f5dd28919386 --- /dev/null +++ b/recipes/lurlparser/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: "https://github.com/corporateshark/LUrlParser/archive/refs/tags/release-1.1.tar.gz" + sha256: "f697bf9151c78b5e54682ff8f1ff759b15c3cbe73b179576a921b526cdf9ff22" diff --git a/recipes/lurlparser/all/conanfile.py b/recipes/lurlparser/all/conanfile.py new file mode 100644 index 0000000000000..6469f5166a747 --- /dev/null +++ b/recipes/lurlparser/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.50.0" + +class PackageConan(ConanFile): + name = "lurlparser" + description = "Lightweight URL & URI parser (RFC 1738, RFC 3986)" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/corporateshark/LUrlParser/" + topics = ("url", "uri", "parser") + 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 export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + 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["LURLPARSER_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, 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 = ["lurlparser"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/lurlparser/all/test_package/CMakeLists.txt b/recipes/lurlparser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2160e23166fc3 --- /dev/null +++ b/recipes/lurlparser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(lurlparser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lurlparser::lurlparser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lurlparser/all/test_package/conanfile.py b/recipes/lurlparser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/lurlparser/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/lurlparser/all/test_package/test_package.cpp b/recipes/lurlparser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef4db579b3178 --- /dev/null +++ b/recipes/lurlparser/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include "LUrlParser.h" + +int main() { + const auto URL = LUrlParser::ParseURL::parseURL("https://John:Dow@github.com:80/corporateshark/LUrlParser"); + + if (URL.isValid()) { + std::cout << "Scheme : " << URL.scheme_ << std::endl; + std::cout << "Host : " << URL.host_ << std::endl; + std::cout << "Port : " << URL.port_ << std::endl; + std::cout << "Path : " << URL.path_ << std::endl; + std::cout << "Query : " << URL.query_ << std::endl; + std::cout << "Fragment : " << URL.fragment_ << std::endl; + std::cout << "User name : " << URL.userName_ << std::endl; + std::cout << "Password : " << URL.password_ << std::endl; + } + + return 0; +} diff --git a/recipes/lurlparser/all/test_v1_package/CMakeLists.txt b/recipes/lurlparser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..44cd3222ce1e5 --- /dev/null +++ b/recipes/lurlparser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lurlparser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lurlparser::lurlparser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lurlparser/all/test_v1_package/conanfile.py b/recipes/lurlparser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/lurlparser/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lurlparser/config.yml b/recipes/lurlparser/config.yml new file mode 100644 index 0000000000000..3f8a45fae5832 --- /dev/null +++ b/recipes/lurlparser/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1": + folder: all diff --git a/recipes/lyra/all/conandata.yml b/recipes/lyra/all/conandata.yml new file mode 100644 index 0000000000000..f6627e78699fe --- /dev/null +++ b/recipes/lyra/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "1.0.0": + sha256: ede5446cdd2b74a8cbaa12b998e820d0a1489574649bd76e7e67e69cb841ae22 + url: https://github.com/bfgroup/Lyra/archive/lyra-1.0.tar.gz + "1.1.0": + sha256: c2d70a926f698fb7decb99c7215bb55ab770100f9574c290998bf91416bd8217 + url: https://github.com/bfgroup/Lyra/archive/1.1.tar.gz + "1.2.0": + sha256: 3134fb6d170ba78d139068232b12ca9948082fafc54a3373193c8b8d6e760cd9 + url: https://github.com/bfgroup/Lyra/archive/1.2.tar.gz + "1.3.0": + sha256: 1e9757b850d1afc14413ceb9eb47af5693f6f03a0f1231617fac39df8534db2b + url: https://github.com/bfgroup/Lyra/archive/1.3.tar.gz + "1.4.0": + sha256: 86cc0c4978312582393e196d534011a1f186db9e3e09ba34fd250c2a59ebf814 + url: https://github.com/bfgroup/Lyra/archive/1.4.tar.gz + "1.5.0": + sha256: 5a251ba8c1082875a6655cdcd11c3a7771cd9c40011f1b0e5ac8636054f27dfd + url: https://github.com/bfgroup/Lyra/archive/1.5.tar.gz + "1.5.1": + sha256: 11ccdfc6f776b9a2ebe987d9b4e492981f88f3642546fd1c2e1115741863cae0 + url: https://github.com/bfgroup/Lyra/archive/1.5.1.tar.gz + "1.6.0": + sha256: 919e92a9c02fea3f365a3a7bdccd8b306311a28a7f2044dac8e7651106d7b644 + url: https://github.com/bfgroup/Lyra/archive/1.6.tar.gz + "1.6.1": + sha256: a93f247ed89eba11ca36eb24c4f8ba7be636bf24e74aaaa8e1066e0954bec7e3 + url: https://github.com/bfgroup/Lyra/archive/1.6.1.tar.gz diff --git a/recipes/lyra/all/conanfile.py b/recipes/lyra/all/conanfile.py new file mode 100644 index 0000000000000..184573a6e3fe9 --- /dev/null +++ b/recipes/lyra/all/conanfile.py @@ -0,0 +1,59 @@ +import os +from conan import ConanFile +import conan.tools.files +import conan.tools.layout +import conan.tools.build + +required_conan_version = ">=1.50.0" + + +class LyraConan(ConanFile): + name = "lyra" + homepage = "https://bfgroup.github.io/Lyra/" + description = "A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond." + topics = ("cli", "cli-parser", "argparse", "commandline", + "flags", "header-only", "no-dependencies", "c++11") + no_copy_source = True + settings = "compiler" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + conan.tools.build.check_min_cppstd(self, 11) + + def package_id(self): + self.info.clear() + + def layout(self): + conan.tools.layout.basic_layout(self, src_folder="root") + + def source(self): + conan.tools.files.get( + self, + **self.conan_data["sources"][self.version], + strip_root=True) + + def package(self): + conan.tools.files.copy( + self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + conan.tools.files.copy( + self, "*.h*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "lyra") + self.cpp_info.set_property("cmake_target_name", "bfg::lyra") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_lyra"].set_property( + "cmake_target_name", "bfg::lyra") + self.cpp_info.filenames["cmake_find_package"] = "lyra" + self.cpp_info.filenames["cmake_find_package_multi"] = "lyra" + self.cpp_info.names["cmake_find_package"] = "bfg" + self.cpp_info.names["cmake_find_package_multi"] = "bfg" + self.cpp_info.components["_lyra"].names["cmake_find_package"] = "lyra" + self.cpp_info.components["_lyra"].names["cmake_find_package_multi"] = "lyra" diff --git a/recipes/lyra/all/test_package/CMakeLists.txt b/recipes/lyra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..294a9afb37677 --- /dev/null +++ b/recipes/lyra/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(lyra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} bfg::lyra) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lyra/all/test_package/conanfile.py b/recipes/lyra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0b275b10a2f3c --- /dev/null +++ b/recipes/lyra/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +import conan.tools.build +import conan.tools.cmake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + conan.tools.cmake.cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = conan.tools.cmake.CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if conan.tools.build.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/lyra/all/test_package/test_package.cpp b/recipes/lyra/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5298875e31c6a --- /dev/null +++ b/recipes/lyra/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, const char** argv) +{ + auto cli = lyra::cli_parser(); +} diff --git a/recipes/lyra/all/test_v1_package/CMakeLists.txt b/recipes/lyra/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b200e21129c40 --- /dev/null +++ b/recipes/lyra/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lyra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} bfg::lyra) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lyra/all/test_v1_package/conanfile.py b/recipes/lyra/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/lyra/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/lyra/all/test_v1_package/test_package.cpp b/recipes/lyra/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..5298875e31c6a --- /dev/null +++ b/recipes/lyra/all/test_v1_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, const char** argv) +{ + auto cli = lyra::cli_parser(); +} diff --git a/recipes/lyra/config.yml b/recipes/lyra/config.yml new file mode 100644 index 0000000000000..425271e9a388e --- /dev/null +++ b/recipes/lyra/config.yml @@ -0,0 +1,19 @@ +versions: + "1.0.0": + folder: all + "1.1.0": + folder: all + "1.2.0": + folder: all + "1.3.0": + folder: all + "1.4.0": + folder: all + "1.5.0": + folder: all + "1.5.1": + folder: all + "1.6.0": + folder: all + "1.6.1": + folder: all diff --git a/recipes/lz4/all/conandata.yml b/recipes/lz4/all/conandata.yml new file mode 100644 index 0000000000000..577763acfe7a6 --- /dev/null +++ b/recipes/lz4/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.9.4": + sha256: 0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b + url: https://github.com/lz4/lz4/archive/v1.9.4.tar.gz + "1.9.3": + sha256: 030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1 + url: https://github.com/lz4/lz4/archive/v1.9.3.tar.gz + "1.9.2": + sha256: 658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc + url: https://github.com/lz4/lz4/archive/v1.9.2.tar.gz +patches: + "1.9.3": + - patch_file: "patches/0003-cmake-minimum-required-first-1.9.3.patch" + patch_description: "Move cmake_minimum_required to the top of CMakeFile.txt" + patch_type: conan + "1.9.2": + - patch_file: "patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch" + patch_description: "Add LZ4_DLL_EXPORT to MSVC" + patch_type: portability + - patch_file: "patches/0002-cmake-optional-cli.patch" + patch_description: "Add ability not to compile the CLI" + patch_type: conan + - patch_file: "patches/0003-cmake-minimum-required-first-1.9.2.patch" + patch_description: "Move cmake_minimum_required to the top of CMakeFile.txt" + patch_type: conan diff --git a/recipes/lz4/all/conanfile.py b/recipes/lz4/all/conanfile.py new file mode 100644 index 0000000000000..00e8eb7116e69 --- /dev/null +++ b/recipes/lz4/all/conanfile.py @@ -0,0 +1,122 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class LZ4Conan(ConanFile): + name = "lz4" + description = "Extremely Fast Compression algorithm" + license = ("BSD-2-Clause", "BSD-3-Clause") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lz4/lz4" + topics = ("compression") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LZ4_BUILD_CLI"] = False + tc.variables["LZ4_BUILD_LEGACY_LZ4C"] = False + tc.variables["LZ4_BUNDLED_MODE"] = False + tc.variables["LZ4_POSITION_INDEPENDENT_LIB"] = self.options.get_safe("fPIC", True) + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + @property + def _cmakelists_folder(self): + if Version(self.version) < "1.9.3": + subfolder = os.path.join("contrib", "cmake_unofficial") + else: + subfolder = os.path.join("build", "cmake") + return os.path.join(self.source_folder, subfolder) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=self._cmakelists_folder) + cmake.build() + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if Version(self.version) >= "1.9.4": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._lz4_target: "lz4::lz4"}, + ) + + @property + def _lz4_target(self): + return f"LZ4::{'lz4_shared' if self.options.shared else 'lz4_static'}" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "lz4") + self.cpp_info.set_property("cmake_target_name", self._lz4_target) + self.cpp_info.set_property("cmake_target_aliases", ["lz4::lz4"]) # old unofficial target in CCI for lz4, kept for the moment to not break consumers + self.cpp_info.set_property("pkg_config_name", "liblz4") + self.cpp_info.libs = ["lz4"] + if is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("LZ4_DLL_IMPORT=1") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "liblz4" diff --git a/recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch b/recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch new file mode 100644 index 0000000000000..5de5fbc440858 --- /dev/null +++ b/recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch @@ -0,0 +1,16 @@ +--- contrib/cmake_unofficial/CMakeLists.txt ++++ contrib/cmake_unofficial/CMakeLists.txt +@@ -103,9 +103,13 @@ + if(BUILD_SHARED_LIBS) + add_library(lz4_shared SHARED ${LZ4_SOURCES}) + set_target_properties(lz4_shared PROPERTIES + OUTPUT_NAME lz4 + SOVERSION "${LZ4_VERSION_MAJOR}" + VERSION "${LZ4_VERSION_STRING}") + list(APPEND LZ4_LIBRARIES_BUILT lz4_shared) ++ if(MSVC) ++ set_target_properties(lz4_shared PROPERTIES ++ DEFINE_SYMBOL LZ4_DLL_EXPORT=1) ++ endif() + endif() + if(BUILD_STATIC_LIBS) diff --git a/recipes/lz4/all/patches/0002-cmake-optional-cli.patch b/recipes/lz4/all/patches/0002-cmake-optional-cli.patch new file mode 100644 index 0000000000000..b2fe91a0e8bf9 --- /dev/null +++ b/recipes/lz4/all/patches/0002-cmake-optional-cli.patch @@ -0,0 +1,41 @@ +--- a/contrib/cmake_unofficial/CMakeLists.txt ++++ b/contrib/cmake_unofficial/CMakeLists.txt +@@ -12,6 +12,7 @@ + + set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") + ++option(LZ4_BUILD_CLI "Build lz4 program" ON) + option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # Parse version information +@@ -128,10 +129,12 @@ else() + endif() + + # lz4 ++if(LZ4_BUILD_CLI) + set(LZ4_PROGRAMS_BUILT lz4cli) + add_executable(lz4cli ${LZ4_CLI_SOURCES}) + set_target_properties(lz4cli PROPERTIES OUTPUT_NAME lz4) + target_link_libraries(lz4cli ${LZ4_LINK_LIBRARY}) ++endif() + + # lz4c + if (LZ4_BUILD_LEGACY_LZ4C) +@@ -193,7 +196,7 @@ if(NOT LZ4_BUNDLED_MODE) + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + + # install lz4cat and unlz4 symlinks on *nix +- if(UNIX) ++ if(UNIX AND LZ4_BUILD_CLI) + install(CODE " + foreach(f lz4cat unlz4) + set(dest \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/\${f}\") +@@ -209,7 +212,7 @@ if(NOT LZ4_BUNDLED_MODE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f}.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + endforeach() +- endif(UNIX) ++ endif(UNIX AND LZ4_BUILD_CLI) + endif(NOT LZ4_BUNDLED_MODE) + + # pkg-config diff --git a/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch b/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch new file mode 100644 index 0000000000000..2333a27871ed9 --- /dev/null +++ b/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch @@ -0,0 +1,25 @@ +--- a/contrib/cmake_unofficial/CMakeLists.txt ++++ b/contrib/cmake_unofficial/CMakeLists.txt +@@ -9,11 +9,10 @@ + # + # LZ4's CMake support is maintained by Evan Nemerson; when filing + # bugs please mention @nemequ to make sure I see it. ++cmake_minimum_required (VERSION 2.8.6) + + set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") + +-option(LZ4_BUILD_CLI "Build lz4 program" ON) +-option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # Parse version information + file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_MAJOR REGEX "^#define LZ4_VERSION_MAJOR +([0-9]+) +.*$") +@@ -34,7 +33,8 @@ else() + LANGUAGES C) + endif() + +-cmake_minimum_required (VERSION 2.8.6) ++option(LZ4_BUILD_CLI "Build lz4 program" ON) ++option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # If LZ4 is being bundled in another project, we don't want to + # install anything. However, we want to let people override this, so diff --git a/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch b/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch new file mode 100644 index 0000000000000..16c6011122a07 --- /dev/null +++ b/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch @@ -0,0 +1,25 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -9,11 +9,10 @@ + # + # LZ4's CMake support is maintained by Evan Nemerson; when filing + # bugs please mention @nemequ to make sure I see it. ++cmake_minimum_required (VERSION 2.8.6) + + set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") + +-option(LZ4_BUILD_CLI "Build lz4 program" ON) +-option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # Parse version information + file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_MAJOR REGEX "^#define LZ4_VERSION_MAJOR +([0-9]+) +.*$") +@@ -34,7 +33,8 @@ else() + LANGUAGES C) + endif() + +-cmake_minimum_required (VERSION 2.8.6) ++option(LZ4_BUILD_CLI "Build lz4 program" ON) ++option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # If LZ4 is being bundled in another project, we don't want to + # install anything. However, we want to let people override this, so diff --git a/recipes/lz4/all/test_package/CMakeLists.txt b/recipes/lz4/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..14b12b7977c2c --- /dev/null +++ b/recipes/lz4/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lz4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) +endif() + +option(TEST_SHARED_LIB "Use package in a shared library") +if(TEST_AS_SHARED_LIB) + add_library(${PROJECT_NAME}2 SHARED lib.c) + if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) + else() + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) + endif() +endif() diff --git a/recipes/lz4/all/test_package/conanfile.py b/recipes/lz4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e1a1aff777023 --- /dev/null +++ b/recipes/lz4/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + lz4 = self.dependencies["lz4"] + tc = CMakeToolchain(self) + tc.variables["TEST_SHARED_LIB"] = lz4.options.get_safe("fPIC", True) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lz4/all/test_package/lib.c b/recipes/lz4/all/test_package/lib.c new file mode 100644 index 0000000000000..bbf6f76786ea2 --- /dev/null +++ b/recipes/lz4/all/test_package/lib.c @@ -0,0 +1,13 @@ +#include "lz4.h" + +#ifdef _MSC_VER +#define API __declspec(dllexport) +#else +#define API __attribute__ ((visibility("default"))) +#endif + +API +int lz4_version() +{ + return LZ4_versionNumber(); +} diff --git a/recipes/lz4/all/test_package/test_package.c b/recipes/lz4/all/test_package/test_package.c new file mode 100644 index 0000000000000..86071397c846c --- /dev/null +++ b/recipes/lz4/all/test_package/test_package.c @@ -0,0 +1,13 @@ +// LZ4 trivial example : print Library version number +// Copyright : Takayuki Matsuoka & Yann Collet + + +#include +#include "lz4.h" + +int main(int argc, char** argv) +{ + (void)argc; (void)argv; + printf("Hello World ! LZ4 Library version = %d\n", LZ4_versionNumber()); + return 0; +} diff --git a/recipes/lz4/all/test_v1_package/CMakeLists.txt b/recipes/lz4/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9324f7603fe8 --- /dev/null +++ b/recipes/lz4/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lz4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) +endif() + +option(TEST_SHARED_LIB "Use package in a shared library") +if(TEST_AS_SHARED_LIB) + add_library(${PROJECT_NAME}2 SHARED ../test_package/lib.c) + if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) + else() + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) + endif() +endif() diff --git a/recipes/lz4/all/test_v1_package/conanfile.py b/recipes/lz4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..77061a2f84fa0 --- /dev/null +++ b/recipes/lz4/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["TEST_SHARED_LIB"] = dict(self.options["lz4"].items()).get("fPIC", True) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lz4/config.yml b/recipes/lz4/config.yml new file mode 100644 index 0000000000000..f96920e268df8 --- /dev/null +++ b/recipes/lz4/config.yml @@ -0,0 +1,7 @@ +versions: + "1.9.4": + folder: all + "1.9.3": + folder: all + "1.9.2": + folder: all diff --git a/recipes/lzfse/all/conandata.yml b/recipes/lzfse/all/conandata.yml new file mode 100644 index 0000000000000..54cf5d7412ca3 --- /dev/null +++ b/recipes/lzfse/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0": + url: "https://github.com/lzfse/lzfse/archive/lzfse-1.0.tar.gz" + sha256: "cf85f373f09e9177c0b21dbfbb427efaedc02d035d2aade65eb58a3cbf9ad267" +patches: + "1.0": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/lzfse/all/conanfile.py b/recipes/lzfse/all/conanfile.py new file mode 100644 index 0000000000000..a6aa023686644 --- /dev/null +++ b/recipes/lzfse/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class LzfseConan(ConanFile): + name = "lzfse" + description = "Lempel-Ziv style data compression algorithm using Finite State Entropy coding." + license = "BSD-3-Clause" + topics = ("compression", "decompression") + homepage = "https://github.com/lzfse/lzfse" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LZFSE_BUNDLE_MODE"] = False + tc.variables["LZFSE_DISABLE_TESTS"] = False + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["lzfse"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("LZFSE_DLL") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/lzfse/all/patches/0001-fix-cmake.patch b/recipes/lzfse/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..c364b0b0083c4 --- /dev/null +++ b/recipes/lzfse/all/patches/0001-fix-cmake.patch @@ -0,0 +1,33 @@ +* cmake_minimum_required() must be before project() +* Do not force PIC +* Do not force IPO +* fix cross-compilation to iOS/tvOS/watchOS + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-project(lzfse C) + cmake_minimum_required(VERSION 2.8.6) ++project(lzfse C) + + include(CheckCCompilerFlag) + +@@ -82,9 +82,7 @@ else() + endif() + + set_target_properties(lzfse PROPERTIES +- POSITION_INDEPENDENT_CODE TRUE +- C_VISIBILITY_PRESET hidden +- INTERPROCEDURAL_OPTIMIZATION TRUE) ++ C_VISIBILITY_PRESET hidden) + + if(BUILD_SHARED_LIBS) + set_property(TARGET lzfse APPEND PROPERTY COMPILE_DEFINITIONS LZFSE_DLL LZFSE_DLL_EXPORTS) +@@ -97,6 +95,7 @@ if(NOT LZFSE_BUNDLE_MODE) + + install(TARGETS lzfse lzfse_cli + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(FILES src/lzfse.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/lzfse/all/test_package/CMakeLists.txt b/recipes/lzfse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9e7bf97eca042 --- /dev/null +++ b/recipes/lzfse/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lzfse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lzfse::lzfse) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/lzfse/all/test_package/conanfile.py b/recipes/lzfse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a3fbe307717ad --- /dev/null +++ b/recipes/lzfse/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + txt_path = os.path.join(self.source_folder, "test.txt") + self.run(f"{bin_path} -encode -i {txt_path}", env="conanrun") diff --git a/recipes/lzfse/all/test_package/test.txt b/recipes/lzfse/all/test_package/test.txt new file mode 100644 index 0000000000000..a9edec7154bda --- /dev/null +++ b/recipes/lzfse/all/test_package/test.txt @@ -0,0 +1 @@ +I'm waiting to be compressed. diff --git a/recipes/lzfse/all/test_package/test_package.c b/recipes/lzfse/all/test_package/test_package.c new file mode 100644 index 0000000000000..dd4df99a7e0ec --- /dev/null +++ b/recipes/lzfse/all/test_package/test_package.c @@ -0,0 +1,336 @@ +/* +Copyright (c) 2015-2016, Apple Inc. 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. + +3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +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. +*/ + +// LZFSE command line tool + +#if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE < 200112L) +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200112L +#endif + +#if defined(_MSC_VER) +# if !defined(_CRT_NONSTDC_NO_DEPRECATE) +# define _CRT_NONSTDC_NO_DEPRECATE +# endif +# if !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS +# endif +# if !defined(__clang__) +# define inline __inline +# endif +#endif + +#include "lzfse.h" +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) +# include +# include +#else +# include +# include +#endif + +// Same as realloc(x,s), except x is freed when realloc fails +static inline void *lzfse_reallocf(void *x, size_t s) { + void *y = realloc(x, s); + if (y == 0) { + free(x); + return 0; + } + return y; +} + +static double get_time() { +#if defined(_MSC_VER) + LARGE_INTEGER count, freq; + if (QueryPerformanceFrequency(&freq) && QueryPerformanceCounter(&count)) { + return (double)count.QuadPart / (double)freq.QuadPart; + } + return 1.0e-3 * (double)GetTickCount(); +#else + struct timeval tv; + if (gettimeofday(&tv, 0) != 0) { + perror("gettimeofday"); + exit(1); + } + return (double)tv.tv_sec + 1.0e-6 * (double)tv.tv_usec; +#endif +} + +//-------------------- + +enum { LZFSE_ENCODE = 0, LZFSE_DECODE }; + +void usage(int argc, char **argv) { + fprintf( + stderr, + "Usage: %s -encode|-decode [-i input_file] [-o output_file] [-h] [-v]\n", + argv[0]); +} + +#define USAGE(argc, argv) \ + do { \ + usage(argc, argv); \ + exit(0); \ + } while (0) +#define USAGE_MSG(argc, argv, ...) \ + do { \ + usage(argc, argv); \ + fprintf(stderr, __VA_ARGS__); \ + exit(1); \ + } while (0) + +int main(int argc, char **argv) { + const char *in_file = 0; // stdin + const char *out_file = 0; // stdout + int op = -1; // invalid op + int verbosity = 0; // quiet + + // Parse options + for (int i = 1; i < argc;) { + // no args + const char *a = argv[i++]; + if (strcmp(a, "-h") == 0) + USAGE(argc, argv); + if (strcmp(a, "-v") == 0) { + verbosity++; + continue; + } + if (strcmp(a, "-encode") == 0) { + op = LZFSE_ENCODE; + continue; + } + if (strcmp(a, "-decode") == 0) { + op = LZFSE_DECODE; + continue; + } + + // one arg + const char **arg_var = 0; + if (strcmp(a, "-i") == 0 && in_file == 0) + arg_var = &in_file; + else if (strcmp(a, "-o") == 0 && out_file == 0) + arg_var = &out_file; + if (arg_var != 0) { + // Flag is recognized. Check if there is an argument. + if (i == argc) + USAGE_MSG(argc, argv, "Error: Missing arg after %s\n", a); + *arg_var = argv[i++]; + continue; + } + + USAGE_MSG(argc, argv, "Error: invalid flag %s\n", a); + } + if (op < 0) + USAGE_MSG(argc, argv, "Error: -encode|-decode required\n"); + + // Info + if (verbosity > 0) { + if (op == LZFSE_ENCODE) + fprintf(stderr, "LZFSE encode\n"); + if (op == LZFSE_DECODE) + fprintf(stderr, "LZFSE decode\n"); + fprintf(stderr, "Input: %s\n", in_file ? in_file : "stdin"); + fprintf(stderr, "Output: %s\n", out_file ? out_file : "stdout"); + } + + // Load input + size_t in_allocated = 0; // allocated in IN + size_t in_size = 0; // used in IN + uint8_t *in = 0; // input buffer + int in_fd = -1; // input file desc + + if (in_file != 0) { + // If we have a file name, open it, and allocate the exact input size + struct stat st; +#if defined(_WIN32) + in_fd = open(in_file, O_RDONLY | O_BINARY); +#else + in_fd = open(in_file, O_RDONLY); +#endif + if (in_fd < 0) { + perror(in_file); + exit(1); + } + if (fstat(in_fd, &st) != 0) { + perror(in_file); + exit(1); + } + if (st.st_size > SIZE_MAX) { + fprintf(stderr, "File is too large\n"); + exit(1); + } + in_allocated = (size_t)st.st_size; + } else { + // Otherwise, read from stdin, and allocate to 1 MB, grow as needed + in_allocated = 1 << 20; + in_fd = 0; +#if defined(_WIN32) + if (setmode(in_fd, O_BINARY) == -1) { + perror("setmode"); + exit(1); + } +#endif + } + in = (uint8_t *)malloc(in_allocated); + if (in == 0) { + perror("malloc"); + exit(1); + } + + while (1) { + // re-alloc if needed + if (in_size == in_allocated) { + if (in_allocated < (100 << 20)) + in_allocated <<= 1; // double it + else + in_allocated += (100 << 20); // or add 100 MB if already large + in = lzfse_reallocf(in, in_allocated); + if (in == 0) { + perror("malloc"); + exit(1); + } + } + + ptrdiff_t r = read(in_fd, in + in_size, in_allocated - in_size); + if (r < 0) { + perror("read"); + exit(1); + } + if (r == 0) + break; // end of file + in_size += (size_t)r; + } + + if (in_file != 0) { + close(in_fd); + in_fd = -1; + } + + // Size info + if (verbosity > 0) { + fprintf(stderr, "Input size: %zu B\n", in_size); + } + + // Encode/decode + // Compute size for result buffer; we assume here that encode shrinks size, + // and that decode grows by no more than 4x. These are reasonable common- + // case guidelines, but are not formally guaranteed to be satisfied. + size_t out_allocated = (op == LZFSE_ENCODE) ? in_size : (4 * in_size); + size_t out_size = 0; + size_t aux_allocated = (op == LZFSE_ENCODE) ? lzfse_encode_scratch_size() + : lzfse_decode_scratch_size(); + void *aux = aux_allocated ? malloc(aux_allocated) : 0; + if (aux_allocated != 0 && aux == 0) { + perror("malloc"); + exit(1); + } + uint8_t *out = (uint8_t *)malloc(out_allocated); + if (out == 0) { + perror("malloc"); + exit(1); + } + + double c0 = get_time(); + while (1) { + if (op == LZFSE_ENCODE) + out_size = lzfse_encode_buffer(out, out_allocated, in, in_size, aux); + else + out_size = lzfse_decode_buffer(out, out_allocated, in, in_size, aux); + + // If output buffer was too small, grow and retry. + if (out_size == 0 || (op == LZFSE_DECODE && out_size == out_allocated)) { + if (verbosity > 0) + fprintf(stderr, "Output buffer was too small, increasing size...\n"); + out_allocated <<= 1; + out = (uint8_t *)lzfse_reallocf(out, out_allocated); + if (out == 0) { + perror("malloc"); + exit(1); + } + continue; + } + + break; + } + double c1 = get_time(); + + if (verbosity > 0) { + fprintf(stderr, "Output size: %zu B\n", out_size); + size_t raw_size = (op == LZFSE_ENCODE) ? in_size : out_size; + size_t compressed_size = (op == LZFSE_ENCODE) ? out_size : in_size; + fprintf(stderr, "Compression ratio: %.3f\n", + (double)raw_size / (double)compressed_size); + double ns_per_byte = 1.0e9 * (c1 - c0) / (double)raw_size; + double mb_per_s = (double)raw_size / 1024.0 / 1024.0 / (c1 - c0); + fprintf(stderr, "Speed: %.2f ns/B, %.2f MB/s\n",ns_per_byte,mb_per_s); + } + + // Write output + int out_fd = -1; + if (out_file) { +#if defined(_WIN32) + out_fd = open(out_file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, + S_IWRITE); +#else + out_fd = open(out_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); +#endif + if (out_fd < 0) { + perror(out_file); + exit(1); + } + } else { + out_fd = 1; // stdout +#if defined(_WIN32) + if (setmode(out_fd, O_BINARY) == -1) { + perror("setmode"); + exit(1); + } +#endif + } + for (size_t out_pos = 0; out_pos < out_size;) { + ptrdiff_t w = write(out_fd, out + out_pos, out_size - out_pos); + if (w < 0) { + perror("write"); + exit(1); + } + if (w == 0) { + fprintf(stderr, "Failed to write to output file\n"); + exit(1); + } + out_pos += (size_t)w; + } + if (out_file != 0) { + close(out_fd); + out_fd = -1; + } + + free(in); + free(out); + free(aux); + return 0; // OK +} diff --git a/recipes/lzfse/all/test_v1_package/CMakeLists.txt b/recipes/lzfse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/lzfse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/lzfse/all/test_v1_package/conanfile.py b/recipes/lzfse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4e6c8eb3b50fd --- /dev/null +++ b/recipes/lzfse/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + txt_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.txt") + self.run(f"{bin_path} -encode -i {txt_path}", run_environment=True) diff --git a/recipes/lzfse/config.yml b/recipes/lzfse/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/lzfse/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/lzham/all/conandata.yml b/recipes/lzham/all/conandata.yml new file mode 100644 index 0000000000000..17b541de9d7b8 --- /dev/null +++ b/recipes/lzham/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "cci.20220103": + sha256: "3e3ccf7a57b1e6a90099784597aa7da30de3249a5f7fe532cefb3a77db5acbfb" + url: "https://github.com/richgel999/lzham_codec/archive/d379b1f9121e2197881c61cfc4713c78848bdfe7.zip" +patches: + "cci.20220103": + - patch_file: "patches/aarch64-yield-cci.20220103.patch" + patch_description: 'Uses "yield" rather than "pause" mneumonic to fix + aarch64 build' + patch_type: portability + + - patch_file: "patches/cmake-min-req-swap-cci.20220103.patch" + patch_description: 'Puts cmake_minimum_required before project in all + CMakeLists' + patch_type: portability + + - patch_file: "patches/fix-osx-cci.20220103.patch" + patch_description: "Fixes building on OSX" + patch_type: portability + + - patch_file: "patches/use-lzham-types-cci.20220103.patch" + patch_description: 'Uses typedefs prefixed with LZHAM to fix linux build + errors' + patch_type: portability + + - patch_file: "patches/cmake-rm-tests-cci.20220103.patch" + patch_description: "Skips building of lzhamtest for CMake" + patch_type: conan + + - patch_file: "patches/msvc-conan-cci.20220103.patch" + patch_description: 'Skips building of lzhamtest and examples for MSVC, + and injects conan toolchain for MSVC' + patch_type: conan diff --git a/recipes/lzham/all/conanfile.py b/recipes/lzham/all/conanfile.py new file mode 100644 index 0000000000000..b1b9dc2a684e4 --- /dev/null +++ b/recipes/lzham/all/conanfile.py @@ -0,0 +1,158 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rmdir +) +from conan.tools.microsoft import ( + MSBuild, MSBuildDeps, MSBuildToolchain, VCVars, is_msvc, vs_layout +) + +required_conan_version = ">=1.52.0" + +SLN_FILE = "lzham.sln" + + +class PackageConan(ConanFile): + name = "lzham" + + description = ( + "Compression algorithm similar compression ratio and faster " + "decompression than LZMA." + ) + + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/richgel999/lzham_codec" + topics = ("compression", "lz-compression") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + if is_msvc(self): + vs_layout(self) + else: + cmake_layout(self, src_folder="src") + + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + strip_root=True + ) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + tc = MSBuildDeps(self) + tc.generate() + tc = VCVars(self) + tc.generate() + else: + tc = CMakeToolchain(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" + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + msbuild = MSBuild(self) + msbuild.build_type = ( + "Debug" if self.settings.build_type == "Debug" else "Release" + ) + msbuild.platform = ( + "Win32" if self.settings.arch == "x86" else msbuild.platform + ) + msbuild.build(sln="lzham.sln") + else: + 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 + ) + + 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 + ) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + else: + 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, "res")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + if self.settings.os in ["Linux", "FreeBSD"]: + 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] + else: + self.cpp_info.libs = ["lzhamdll", "lzhamcomp", "lzhamdecomp"] + self.cpp_info.set_property("cmake_file_name", "lzham") + self.cpp_info.set_property("cmake_target_name", "lzham::lzham") + self.cpp_info.set_property("pkg_config_name", "lzham") + + # TODO: to remove in conan v2 once cmake_find_package_* generators + # removed + self.cpp_info.names["cmake_find_package"] = "lzham" + self.cpp_info.names["cmake_find_package_multi"] = "lzham" + self.cpp_info.names["pkg_config"] = "lzham" diff --git a/recipes/lzham/all/patches/aarch64-yield-cci.20220103.patch b/recipes/lzham/all/patches/aarch64-yield-cci.20220103.patch new file mode 100644 index 0000000000000..313029dda755c --- /dev/null +++ b/recipes/lzham/all/patches/aarch64-yield-cci.20220103.patch @@ -0,0 +1,16 @@ +diff --git a/lzhamdecomp/lzham_platform.h b/lzhamdecomp/lzham_platform.h +index 01704be..920a8f4 100644 +--- a/lzhamdecomp/lzham_platform.h ++++ b/lzhamdecomp/lzham_platform.h +@@ -24,7 +24,11 @@ void lzham_fail(const char* pExp, const char* pFile, unsigned line); + #if defined(__GNUC__) && LZHAM_PLATFORM_PC + extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) void lzham_yield_processor() + { ++ #if defined(__aarch64__) ++ __asm__ __volatile__("yield"); ++ #else + __asm__ __volatile__("pause"); ++ #endif + } + #elif LZHAM_PLATFORM_X360 + #define lzham_yield_processor() \ diff --git a/recipes/lzham/all/patches/cmake-min-req-swap-cci.20220103.patch b/recipes/lzham/all/patches/cmake-min-req-swap-cci.20220103.patch new file mode 100644 index 0000000000000..8c598c5b49697 --- /dev/null +++ b/recipes/lzham/all/patches/cmake-min-req-swap-cci.20220103.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 428cdfc..b8980e5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-# PROJECT(lzham) + cmake_minimum_required(VERSION 2.8) ++PROJECT(lzham) + option(BUILD_X64 "build 64-bit" ON) + option(BUILD_SHARED_LIBS "build shared/static libs" ON) + +diff --git a/lzhamcomp/CMakeLists.txt b/lzhamcomp/CMakeLists.txt +index c80cc66..a3f77e7 100644 +--- a/lzhamcomp/CMakeLists.txt ++++ b/lzhamcomp/CMakeLists.txt +@@ -1,5 +1,5 @@ +-PROJECT(lzhamcomp) + cmake_minimum_required(VERSION 2.8) ++PROJECT(lzhamcomp) + option(BUILD_X64 "build 64-bit" TRUE) + + message("Initial BUILD_X64=${BUILD_X64}") +diff --git a/lzhamdecomp/CMakeLists.txt b/lzhamdecomp/CMakeLists.txt +index bf87a02..723379e 100644 +--- a/lzhamdecomp/CMakeLists.txt ++++ b/lzhamdecomp/CMakeLists.txt +@@ -1,5 +1,5 @@ +-PROJECT(lzhamdecomp) + cmake_minimum_required(VERSION 2.8) ++PROJECT(lzhamdecomp) + option(BUILD_X64 "build 64-bit" TRUE) + + message("Initial BUILD_X64=${BUILD_X64}") +diff --git a/lzhamdll/CMakeLists.txt b/lzhamdll/CMakeLists.txt +index f77f3fe..5a162b6 100644 +--- a/lzhamdll/CMakeLists.txt ++++ b/lzhamdll/CMakeLists.txt +@@ -1,5 +1,5 @@ +-PROJECT(lzhamdll) + cmake_minimum_required(VERSION 2.8) ++PROJECT(lzhamdll) + option(BUILD_X64 "build 64-bit" TRUE) + + message("Initial BUILD_X64=${BUILD_X64}") +diff --git a/lzhamtest/CMakeLists.txt b/lzhamtest/CMakeLists.txt +index 3349911..b8833b9 100644 +--- a/lzhamtest/CMakeLists.txt ++++ b/lzhamtest/CMakeLists.txt +@@ -1,5 +1,5 @@ +-PROJECT(lzhamtest) + cmake_minimum_required(VERSION 2.8) ++PROJECT(lzhamtest) + option(BUILD_X64 "build 64-bit" TRUE) + + message("Initial BUILD_X64=${BUILD_X64}") diff --git a/recipes/lzham/all/patches/cmake-rm-tests-cci.20220103.patch b/recipes/lzham/all/patches/cmake-rm-tests-cci.20220103.patch new file mode 100644 index 0000000000000..7b5cf8afef5f7 --- /dev/null +++ b/recipes/lzham/all/patches/cmake-rm-tests-cci.20220103.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 428cdfc..1857db2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,6 @@ option(BUILD_SHARED_LIBS "build shared/static libs" ON) + add_subdirectory(lzhamdecomp) + add_subdirectory(lzhamcomp) + add_subdirectory(lzhamdll) +-add_subdirectory(lzhamtest) + + install(FILES include/lzham_dynamic_lib.h + include/lzham_exports.inc diff --git a/recipes/lzham/all/patches/fix-osx-cci.20220103.patch b/recipes/lzham/all/patches/fix-osx-cci.20220103.patch new file mode 100644 index 0000000000000..156502e346443 --- /dev/null +++ b/recipes/lzham/all/patches/fix-osx-cci.20220103.patch @@ -0,0 +1,28 @@ +diff --git a/lzhamdecomp/lzham_platform.cpp b/lzhamdecomp/lzham_platform.cpp +index cfc85c1..599a847 100644 +--- a/lzhamdecomp/lzham_platform.cpp ++++ b/lzhamdecomp/lzham_platform.cpp +@@ -61,7 +61,7 @@ void lzham_debug_break(void) + { + #if LZHAM_USE_WIN32_API + DebugBreak(); +-#elif (TARGET_OS_MAC == 1) && (TARGET_IPHONE_SIMULATOR == 0) && (TARGET_OS_IPHONE == 0) ++#elif (TARGET_OS_MAC == 1) && (TARGET_IPHONE_SIMULATOR == 0) && (TARGET_OS_IPHONE == 0) && !defined(__clang__) + __asm {int 3} + #else + assert(0); +diff --git a/lzhamdecomp/lzham_traits.h b/lzhamdecomp/lzham_traits.h +index ea7214f..e103bad 100644 +--- a/lzhamdecomp/lzham_traits.h ++++ b/lzhamdecomp/lzham_traits.h +@@ -67,7 +67,9 @@ namespace lzham + // Defines type Q as bitwise copyable. + #define LZHAM_DEFINE_BITWISE_COPYABLE(Q) template<> struct bitwise_copyable { enum { cFlag = true }; }; + +-#if defined(__APPLE__) || defined(__NetBSD__) ++#if defined(__APPLE__) ++ #define LZHAM_IS_POD(T) std::is_pod::value ++#elif defined(__NetBSD__) + #define LZHAM_IS_POD(T) std::__is_pod::__value + #else + #define LZHAM_IS_POD(T) __is_pod(T) diff --git a/recipes/lzham/all/patches/msvc-conan-cci.20220103.patch b/recipes/lzham/all/patches/msvc-conan-cci.20220103.patch new file mode 100644 index 0000000000000..ca0b641855eed --- /dev/null +++ b/recipes/lzham/all/patches/msvc-conan-cci.20220103.patch @@ -0,0 +1,83 @@ +diff --git a/lzham.sln b/lzham.sln +index 5c0edb6..63343f3 100644 +--- a/lzham.sln ++++ b/lzham.sln +@@ -3,22 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 11.00 + # Visual Studio 2010 + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzhamdll", "lzhamdll\lzham.vcxproj", "{763BE79D-1280-41B7-81C5-7DC41E2BDB44}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzhamtest", "lzhamtest\lzhamtest.vcxproj", "{BBE16587-150E-460C-8AB4-F18B92D0B981}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzhamdecomp", "lzhamdecomp\lzhamdecomp.vcxproj", "{8DA0CD32-701D-48D7-AE92-728338501500}" + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzhamcomp", "lzhamcomp\lzhamcomp.vcxproj", "{8DA0CD46-791D-48D7-AE92-728338501500}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example1", "example1\example1.vcxproj", "{BBE16587-150E-460C-8AB4-E18B92D0B982}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzhamlib", "lzhamlib\lzhamlib.vcxproj", "{83A2F0B5-1D02-4A13-B579-714F60E31774}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example2", "example2\example2.vcxproj", "{CBE16587-150E-460C-8AB4-E18B92D0B983}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example3", "example3\example3.vcxproj", "{1BE16587-150E-460C-8AB4-E18B92D0BA87}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example4", "example4\example4.vcxproj", "{1BE16587-260E-460C-8AB4-E18B92D0BA87}" +-EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 +diff --git a/lzhamcomp/lzhamcomp.vcxproj b/lzhamcomp/lzhamcomp.vcxproj +index 5fd6155..b45f3dc 100644 +--- a/lzhamcomp/lzhamcomp.vcxproj ++++ b/lzhamcomp/lzhamcomp.vcxproj +@@ -23,6 +23,9 @@ + lzhamcomp + Win32Proj + ++ ++ ++ + + + StaticLibrary +diff --git a/lzhamdecomp/lzhamdecomp.vcxproj b/lzhamdecomp/lzhamdecomp.vcxproj +index dbaf54c..5f78ca5 100644 +--- a/lzhamdecomp/lzhamdecomp.vcxproj ++++ b/lzhamdecomp/lzhamdecomp.vcxproj +@@ -23,6 +23,9 @@ + lzhamdecomp + Win32Proj + ++ ++ ++ + + + StaticLibrary +diff --git a/lzhamdll/lzham.vcxproj b/lzhamdll/lzham.vcxproj +index ec0a280..5536234 100644 +--- a/lzhamdll/lzham.vcxproj ++++ b/lzhamdll/lzham.vcxproj +@@ -24,6 +24,9 @@ + lzham + Win32Proj + ++ ++ ++ + + + DynamicLibrary +diff --git a/lzhamlib/lzhamlib.vcxproj b/lzhamlib/lzhamlib.vcxproj +index 954dd99..cdd2c26 100644 +--- a/lzhamlib/lzhamlib.vcxproj ++++ b/lzhamlib/lzhamlib.vcxproj +@@ -23,6 +23,9 @@ + lzhamlib + Win32Proj + ++ ++ ++ + + + StaticLibrary diff --git a/recipes/lzham/all/patches/use-lzham-types-cci.20220103.patch b/recipes/lzham/all/patches/use-lzham-types-cci.20220103.patch new file mode 100644 index 0000000000000..db6f4925fa490 --- /dev/null +++ b/recipes/lzham/all/patches/use-lzham-types-cci.20220103.patch @@ -0,0 +1,142 @@ +diff --git a/lzhamcomp/lzham_win32_threading.h b/lzhamcomp/lzham_win32_threading.h +index 0e1d16b..4aaff8c 100644 +--- a/lzhamcomp/lzham_win32_threading.h ++++ b/lzhamcomp/lzham_win32_threading.h +@@ -43,9 +43,9 @@ namespace lzham + } + } + +- bool wait(uint32 milliseconds = UINT32_MAX) ++ bool wait(uint32 milliseconds = LZHAM_UINT32_MAX) + { +- LZHAM_ASSUME(INFINITE == UINT32_MAX); ++ LZHAM_ASSUME(INFINITE == LZHAM_UINT32_MAX); + + DWORD result = WaitForSingleObject(m_handle, milliseconds); + +diff --git a/lzhamdecomp/lzham_huffman_codes.cpp b/lzhamdecomp/lzham_huffman_codes.cpp +index 11bdbd4..788414a 100644 +--- a/lzhamdecomp/lzham_huffman_codes.cpp ++++ b/lzhamdecomp/lzham_huffman_codes.cpp +@@ -224,7 +224,7 @@ namespace lzham + + sym_freq& sf = state.syms0[num_used_syms]; + sf.m_left = (uint16)i; +- sf.m_right = UINT16_MAX; ++ sf.m_right = LZHAM_UINT16_MAX; + sf.m_freq = freq; + num_used_syms++; + } +diff --git a/lzhamdecomp/lzham_prefix_coding.cpp b/lzhamdecomp/lzham_prefix_coding.cpp +index e9ada15..52377c9 100644 +--- a/lzhamdecomp/lzham_prefix_coding.cpp ++++ b/lzhamdecomp/lzham_prefix_coding.cpp +@@ -149,7 +149,7 @@ namespace lzham + { + uint c = pCodesizes[i]; + +- LZHAM_ASSERT(!c || (next_code[c] <= UINT16_MAX)); ++ LZHAM_ASSERT(!c || (next_code[c] <= LZHAM_UINT16_MAX)); + + pCodes[i] = static_cast(next_code[c]++); + +@@ -296,7 +296,7 @@ namespace lzham + + LZHAM_ASSERT(t < (1U << table_bits)); + +- LZHAM_ASSERT(pTables->m_lookup[t] == UINT32_MAX); ++ LZHAM_ASSERT(pTables->m_lookup[t] == LZHAM_UINT32_MAX); + + pTables->m_lookup[t] = sym_index | (codesize << 16U); + } +diff --git a/lzhamdecomp/lzham_symbol_codec.cpp b/lzhamdecomp/lzham_symbol_codec.cpp +index 5623584..b2ea7ee 100644 +--- a/lzhamdecomp/lzham_symbol_codec.cpp ++++ b/lzhamdecomp/lzham_symbol_codec.cpp +@@ -581,7 +581,7 @@ namespace lzham + freq++; + m_sym_freq[sym] = static_cast(freq); + +- LZHAM_ASSERT(freq <= UINT16_MAX); ++ LZHAM_ASSERT(freq <= LZHAM_UINT16_MAX); + + if (--m_symbols_until_update == 0) + { +@@ -828,7 +828,7 @@ namespace lzham + freq++; + model.m_sym_freq[sym] = static_cast(freq); + +- LZHAM_ASSERT(freq <= UINT16_MAX); ++ LZHAM_ASSERT(freq <= LZHAM_UINT16_MAX); + + if (--model.m_symbols_until_update == 0) + { +@@ -1265,8 +1265,8 @@ namespace lzham + { + uint32 t = pTables->m_lookup[m_bit_buf >> (cBitBufSize - pTables->m_table_bits)]; + +- LZHAM_ASSERT(t != UINT32_MAX); +- sym = t & UINT16_MAX; ++ LZHAM_ASSERT(t != LZHAM_UINT32_MAX); ++ sym = t & LZHAM_UINT16_MAX; + len = t >> 16; + + LZHAM_ASSERT(model.m_code_sizes[sym] == len); +@@ -1301,7 +1301,7 @@ namespace lzham + freq++; + model.m_sym_freq[sym] = static_cast(freq); + +- LZHAM_ASSERT(freq <= UINT16_MAX); ++ LZHAM_ASSERT(freq <= LZHAM_UINT16_MAX); + + if (--model.m_symbols_until_update == 0) + { +diff --git a/lzhamdecomp/lzham_symbol_codec.h b/lzhamdecomp/lzham_symbol_codec.h +index 306d59b..b231530 100644 +--- a/lzhamdecomp/lzham_symbol_codec.h ++++ b/lzhamdecomp/lzham_symbol_codec.h +@@ -19,7 +19,7 @@ namespace lzham + typedef uint64 bit_cost_t; + const uint32 cBitCostScaleShift = 24; + const uint32 cBitCostScale = (1U << cBitCostScaleShift); +- const bit_cost_t cBitCostMax = UINT64_MAX; ++ const bit_cost_t cBitCostMax = LZHAM_UINT64_MAX; + + inline bit_cost_t convert_to_scaled_bitcost(uint bits) { LZHAM_ASSERT(bits <= 255); uint32 scaled_bits = bits << cBitCostScaleShift; return static_cast(scaled_bits); } + +@@ -444,7 +444,7 @@ namespace lzham + if (LZHAM_BUILTIN_EXPECT(k <= pTables->m_table_max_code, 1)) \ + { \ + uint32 t = pTables->m_lookup[bit_buf >> (symbol_codec::cBitBufSize - pTables->m_table_bits)]; \ +- result = t & UINT16_MAX; \ ++ result = t & LZHAM_UINT16_MAX; \ + len = t >> 16; \ + } \ + else \ +@@ -465,7 +465,7 @@ namespace lzham + uint freq = pModel->m_sym_freq[result]; \ + freq++; \ + pModel->m_sym_freq[result] = static_cast(freq); \ +- LZHAM_ASSERT(freq <= UINT16_MAX); \ ++ LZHAM_ASSERT(freq <= LZHAM_UINT16_MAX); \ + if (LZHAM_BUILTIN_EXPECT(--pModel->m_symbols_until_update == 0, 0)) \ + { \ + pModel->update_tables(); \ +@@ -501,7 +501,7 @@ namespace lzham + if (LZHAM_BUILTIN_EXPECT(k <= pTables->m_table_max_code, 1)) \ + { \ + uint32 t = pTables->m_lookup[bit_buf >> (symbol_codec::cBitBufSize - pTables->m_table_bits)]; \ +- result = t & UINT16_MAX; \ ++ result = t & LZHAM_UINT16_MAX; \ + len = t >> 16; \ + } \ + else \ +@@ -522,7 +522,7 @@ namespace lzham + uint freq = pModel->m_sym_freq[result]; \ + freq++; \ + pModel->m_sym_freq[result] = static_cast(freq); \ +- LZHAM_ASSERT(freq <= UINT16_MAX); \ ++ LZHAM_ASSERT(freq <= LZHAM_UINT16_MAX); \ + if (LZHAM_BUILTIN_EXPECT(--pModel->m_symbols_until_update == 0, 0)) \ + { \ + pModel->update_tables(); \ diff --git a/recipes/lzham/all/test_package/CMakeLists.txt b/recipes/lzham/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c4780ae45756c --- /dev/null +++ b/recipes/lzham/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +find_package(lzham REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC lzham::lzham) diff --git a/recipes/lzham/all/test_package/conanfile.py b/recipes/lzham/all/test_package/conanfile.py new file mode 100644 index 0000000000000..eea09bfb32ab1 --- /dev/null +++ b/recipes/lzham/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lzham/all/test_package/test_package.cpp b/recipes/lzham/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c588215577f5f --- /dev/null +++ b/recipes/lzham/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include + +#include + +int main() { + unsigned char in[] = "Hello Conan Center!"; + unsigned char out[sizeof(in)]; + + 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; + + if (lzham_z_deflate(&stream, LZHAM_Z_FULL_FLUSH) != LZHAM_Z_OK) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} diff --git a/recipes/lzham/all/test_v1_package/CMakeLists.txt b/recipes/lzham/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..231cec51e4ab9 --- /dev/null +++ b/recipes/lzham/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lzham REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC lzham::lzham) diff --git a/recipes/lzham/all/test_v1_package/conanfile.py b/recipes/lzham/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/lzham/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lzham/config.yml b/recipes/lzham/config.yml new file mode 100644 index 0000000000000..d334d7a80bf72 --- /dev/null +++ b/recipes/lzham/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220103": + folder: all diff --git a/recipes/lzip/all/conandata.yml b/recipes/lzip/all/conandata.yml new file mode 100644 index 0000000000000..2b81d53f9b8e1 --- /dev/null +++ b/recipes/lzip/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "1.22": + url: [ + "http://download.savannah.gnu.org/releases/lzip/lzip-1.22.tar.gz", + "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.22.tar.gz", + ] + sha256: "c3342d42e67139c165b8b128d033b5c96893a13ac5f25933190315214e87a948" + "1.21": + url: [ + "http://download.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz", + "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz", + ] + sha256: "e48b5039d3164d670791f9c5dbaa832bf2df080cb1fbb4f33aa7b3300b670d8b" +patches: + "1.22": + - base_path: "source_subfolder" + patch_file: "patches/1.22-0001-any-compiler.patch" + "1.21": + - base_path: "source_subfolder" + patch_file: "patches/1.21-0001-any-compiler.patch" diff --git a/recipes/lzip/all/conanfile.py b/recipes/lzip/all/conanfile.py new file mode 100644 index 0000000000000..96c8fbac3cb58 --- /dev/null +++ b/recipes/lzip/all/conanfile.py @@ -0,0 +1,102 @@ +from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import contextlib +import os +import textwrap + +required_conan_version = ">=1.33.0" + + +class LzipConan(ConanFile): + name = "lzip" + description = "Lzip is a lossless data compressor with a user interface similar to the one of gzip or bzip2" + topics = ("lzip", "compressor", "lzma") + license = "GPL-v2-or-later" + homepage = "https://www.nongnu.org/lzip/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + 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 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") + + def package_id(self): + del self.info.settings.compiler + + def _detect_compilers(self): + tools.rmdir("detectdir") + tools.mkdir("detectdir") + with tools.chdir("detectdir"): + tools.save("CMakeLists.txt", textwrap.dedent("""\ + cmake_minimum_required(VERSION 2.8) + project(test C CXX) + message(STATUS "CC=${CMAKE_C_COMPILER}") + message(STATUS "CXX=${CMAKE_CXX_COMPILER}") + file(WRITE cc.txt "${CMAKE_C_COMPILER}") + file(WRITE cxx.txt "${CMAKE_CXX_COMPILER}") + """)) + CMake(self).configure(source_folder="detectdir", build_folder="detectdir") + cc = tools.load("cc.txt").strip() + cxx = tools.load("cxx.txt").strip() + return cc, cxx + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @contextlib.contextmanager + def _build_context(self): + env = {} + cc, cxx = self._detect_compilers() + if not tools.get_env("CC"): + env["CC"] = cc + if not tools.get_env("CXX"): + env["CXX"] = cxx + with tools.environment_append(env): + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + conf_args = [ + ] + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + return self._autotools + + 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() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + with tools.environment_append({"CONAN_CPU_COUNT": "1"}): + autotools.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + 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/lzip/all/patches/1.21-0001-any-compiler.patch b/recipes/lzip/all/patches/1.21-0001-any-compiler.patch new file mode 100644 index 0000000000000..68dcb6f524644 --- /dev/null +++ b/recipes/lzip/all/patches/1.21-0001-any-compiler.patch @@ -0,0 +1,25 @@ +--- configure ++++ configure +@@ -21,7 +21,7 @@ + infodir='$(datarootdir)/info' + mandir='$(datarootdir)/man' +-CXX=g++ +-CPPFLAGS= +-CXXFLAGS='-Wall -W -O2' +-LDFLAGS= ++#CXX=g++ ++#CPPFLAGS= ++#CXXFLAGS='-Wall -W -O2' ++#LDFLAGS= + +@@ -28,8 +28,8 @@ + # checking whether we are using GNU C++. + /bin/sh -c "${CXX} --version" > /dev/null 2>&1 || + { +- CXX=c++ +- CXXFLAGS=-O2 ++ echo "hello" # CXX=c++ ++ echo "hello" # CXXFLAGS=-O2 + } + + # Loop over all args diff --git a/recipes/lzip/all/patches/1.22-0001-any-compiler.patch b/recipes/lzip/all/patches/1.22-0001-any-compiler.patch new file mode 100644 index 0000000000000..50311f5627b8c --- /dev/null +++ b/recipes/lzip/all/patches/1.22-0001-any-compiler.patch @@ -0,0 +1,18 @@ +--- configure ++++ configure +@@ -24,7 +24,7 @@ + check=no + installdir= +-CXX=g++ +-CPPFLAGS= +-CXXFLAGS='-Wall -W -O2' +-LDFLAGS= ++#CXX=g++ ++#CPPFLAGS= ++#CXXFLAGS='-Wall -W -O2' ++#LDFLAGS= + +@@ -31,2 +31,2 @@ + # checking whether we are using GNU C++. +-/bin/sh -c "${CXX} --version" > /dev/null 2>&1 || { CXX=c++ ; CXXFLAGS=-O2 ; } ++# /bin/sh -c "${CXX} --version" > /dev/null 2>&1 || { CXX=c++ ; CXXFLAGS=-O2 ; } diff --git a/recipes/lzip/all/test_package/conanfile.py b/recipes/lzip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..84ae9d8826de5 --- /dev/null +++ b/recipes/lzip/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + lzip = os.path.join(self.deps_cpp_info["lzip"].bin_paths[0], "lzip") + self.run("{} --version".format(lzip)) + + shutil.copy(os.path.join(self.source_folder, "conanfile.py"), + "conanfile.py") + + sha256_original = tools.sha256sum("conanfile.py") + self.run("{} conanfile.py".format(lzip), run_environment=True) + if not os.path.exists("conanfile.py.lz"): + raise ConanException("conanfile.py.lz does not exist") + if os.path.exists("conanfile.py"): + raise ConanException("copied conanfile.py should not exist anymore") + + self.run("{} -d conanfile.py.lz".format(lzip), run_environment=True) + if tools.sha256sum("conanfile.py") != sha256_original: + raise ConanException("sha256 from extracted conanfile.py does not match original") diff --git a/recipes/lzip/config.yml b/recipes/lzip/config.yml new file mode 100644 index 0000000000000..e027a6bc18156 --- /dev/null +++ b/recipes/lzip/config.yml @@ -0,0 +1,5 @@ +versions: + "1.22": + folder: "all" + "1.21": + folder: "all" diff --git a/recipes/lzma_sdk/9.20/conandata.yml b/recipes/lzma_sdk/9.20/conandata.yml new file mode 100644 index 0000000000000..a8e42ca256064 --- /dev/null +++ b/recipes/lzma_sdk/9.20/conandata.yml @@ -0,0 +1,4 @@ +sources: + "9.20": + url: https://www.7-zip.org/a/lzma920.tar.bz2 + sha256: 8ac221acdca8b6f6dd110120763af42b3707363752fc04e63c7bbff76774a445 diff --git a/recipes/lzma_sdk/9.20/conanfile.py b/recipes/lzma_sdk/9.20/conanfile.py new file mode 100644 index 0000000000000..66f4dfa40693b --- /dev/null +++ b/recipes/lzma_sdk/9.20/conanfile.py @@ -0,0 +1,140 @@ +from conan import ConanFile +from conan.tools.files import get, chdir, replace_in_file, rm +from conans import tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment +import os + +required_conan_version = ">=1.50.0" + + +""" This older lzma release is used to build 7zip (to extract its sources). + That's why this lzma_sdk/9.20 conan package includes a 7zDec executable. + + Recent versions of 7zip are distributed as 7z archives. + So we need 7zip itself to uncompress its sources. + To break this cycle, we have 2 options: + * download an executable and run it + * bootstrap using a previous version (lzma_sdk/9.20) which sources are in .tar.bz2. + Right now it would be a loop in the Conan graph (if we'ld use the same recipe name) +""" + + +class LzmaSdkConan(ConanFile): + name = "lzma_sdk" + url = "https://github.com/conan-io/conan-center-index" + description = "LZMA provides a high compression ratio and fast decompression, so it is very suitable for embedded applications." + license = ("LZMA-exception",) + homepage = "https://www.7-zip.org/sdk.html" + topics = ("lzma", "zip", "compression", "decompression") + settings = "os", "arch", "compiler" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self.settings.compiler != "Visual Studio" and self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def package_id(self): + del self.info.settings.compiler + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder) + rm(self, "7zr.exe", self._source_subfolder) + rm(self, "lzma.exe", self._source_subfolder) + + @property + def _msvc_build_dirs(self): + return ( + (os.path.join(self._source_subfolder, "C", "Util", "7z"), "7zDec.exe"), + (os.path.join(self._source_subfolder, "C", "Util", "Lzma"), "LZMAc.exe"), + (os.path.join(self._source_subfolder, "CPP", "7zip", "UI", "Console"), "7z.exe"), + (os.path.join(self._source_subfolder, "CPP", "7zip","Bundles", "Alone7z"), "7zr.exe"), + (os.path.join(self._source_subfolder, "CPP", "7zip", "Bundles", "LzmaCon"), "lzma.exe"), + ) + + @property + def _msvc_cpu(self): + return { + "x86_64": "AMD64", + "x86": "x86", + }[str(self.settings.arch)] + + @property + def _autotools_build_dirs(self): + es = ".exe" if self.settings.os == "Windows" else "" + return ( + (os.path.join(self._source_subfolder, "C", "Util", "7z"), f"7zDec{es}"), + (os.path.join(self._source_subfolder, "CPP", "7zip", "Bundles", "LzmaCon"), f"lzma{es}"), + ) + + def _build_msvc(self): + for make_dir, _ in self._msvc_build_dirs: + with tools.vcvars(self): + with tools.environment_append(VisualStudioBuildEnvironment(self).vars): + with tools.chdir(make_dir): + self.run(f"nmake /f makefile NEW_COMPILER=1 CPU={self._msvc_cpu} NO_BUFFEROVERFLOWU=1") + + def _build_autotools(self): + env_build = AutoToolsBuildEnvironment(self) + with tools.environment_append(env_build.vars): + for make_dir, _ in self._autotools_build_dirs: + with chdir(self, make_dir): + args = [ + "-f", "makefile.gcc", + ] + if self.settings.os == "Windows": + args.append("IS_MINGW=1") + autotools = AutoToolsBuildEnvironment(self) + autotools.make(args=args) + + def _patch_sources(self): + if self.settings.compiler == "Visual Studio": + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Build.mak"), + "-MT\r", "-" + str(self.settings.compiler.runtime)) + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Build.mak"), + "-MD\r", "-" + str(self.settings.compiler.runtime)) + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Build.mak"), + " -WX ", " ") + + # Patches for other build systems + replace_in_file(self, os.path.join(self._source_subfolder, "C", "Util", "7z", "makefile.gcc"), + "CFLAGS = ", + "CFLAGS = -fpermissive ") + replace_in_file(self, os.path.join(self._source_subfolder, "C", "Util", "7z", "makefile.gcc"), + ": 7zAlloc.c", + ": ../../7zAlloc.c") + replace_in_file(self, os.path.join(self._source_subfolder, "C", "Util", "Lzma", "makefile.gcc"), + "CFLAGS = ", + "CFLAGS = -fpermissive ") + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Common", "MyString.h"), + "#ifdef _WIN32\r\n", + "#ifdef _WIN32\r\n#ifndef UNDER_CE\r\n#include \r\n#endif\r\n") + + def build(self): + self._patch_sources() + if self.settings.compiler == "Visual Studio": + self._build_msvc() + else: + self._build_autotools() + + def package(self): + self.copy("lzma.txt", src=self._source_subfolder, dst="licenses") + self.copy("7zC.txt", src=self._source_subfolder, dst="licenses") + if self.settings.compiler == "Visual Studio": + for make_dir, exe in self._msvc_build_dirs: + self.copy(exe, src=os.path.join(make_dir, self._msvc_cpu), dst="bin", keep_path=False) + else: + for make_dir, exe in self._autotools_build_dirs: + self.copy(exe, src=os.path.join(make_dir), dst="bin", keep_path=False) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + 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) diff --git a/recipes/lzma_sdk/9.20/test_package/conanfile.py b/recipes/lzma_sdk/9.20/test_package/conanfile.py new file mode 100644 index 0000000000000..d956ede854042 --- /dev/null +++ b/recipes/lzma_sdk/9.20/test_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("7zDec", run_environment=True) + self.run("lzma", run_environment=True) diff --git a/recipes/lzma_sdk/config.yml b/recipes/lzma_sdk/config.yml new file mode 100644 index 0000000000000..8d82196257bd6 --- /dev/null +++ b/recipes/lzma_sdk/config.yml @@ -0,0 +1,3 @@ +versions: + "9.20": + folder: "9.20" diff --git a/recipes/lzo/all/conandata.yml b/recipes/lzo/all/conandata.yml new file mode 100644 index 0000000000000..9607883647157 --- /dev/null +++ b/recipes/lzo/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.10": + sha256: c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 + url: http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz diff --git a/recipes/lzo/all/conanfile.py b/recipes/lzo/all/conanfile.py new file mode 100644 index 0000000000000..d5a4ce4f0d916 --- /dev/null +++ b/recipes/lzo/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LZOConan(ConanFile): + name = "lzo" + description = "lzo is a portable lossless data compression library written in ANSI C" + license = "GPL-v2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.oberhumer.com/opensource/lzo/" + topics = ("lzo", "compression") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "bin", "lzo")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "lzo2") + self.cpp_info.includedirs.append(os.path.join("include", "lzo")) + self.cpp_info.libs = ["lzo2"] diff --git a/recipes/lzo/all/test_package/CMakeLists.txt b/recipes/lzo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aae70901bbdc7 --- /dev/null +++ b/recipes/lzo/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lzo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lzo::lzo) diff --git a/recipes/lzo/all/test_package/conanfile.py b/recipes/lzo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/lzo/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lzo/all/test_package/test_package.c b/recipes/lzo/all/test_package/test_package.c new file mode 100644 index 0000000000000..82d98c1e92179 --- /dev/null +++ b/recipes/lzo/all/test_package/test_package.c @@ -0,0 +1,47 @@ +#include "lzo1f.h" +#include +#include + +const char *text = "This is a string that lzo should compress to less bytes then before if it is working fine.\n" +"This compression algorithm appears to only compress bigger inputs so put a lot of text here.\n"; + + +int main() +{ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n"); + return 1; + } + + char compressed[2048]; + size_t compressed_len = sizeof(compressed); + { + char workMemory[LZO1F_MEM_COMPRESS+1]; + int r = lzo1f_1_compress((unsigned char*)text, strlen(text), (unsigned char*)compressed, &compressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - compression failed: %d\n", r); + return 1; + } + } + printf("Size before compression: %zu bytes\n", strlen(text)); + printf("Size after compression: %zu bytes\n", compressed_len); + + + char decompressed[2048]; + size_t decompressed_len = sizeof(decompressed); + { + char workMemory[LZO1F_MEM_DECOMPRESS+1]; + int r = lzo1f_decompress((unsigned char*)compressed, compressed_len, (unsigned char*)decompressed, &decompressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - decompression failed: %d\n", r); + return 1; + } + } + + int ok = (strlen(text) == decompressed_len) && (strncmp(text, decompressed, decompressed_len) == 0); + printf("Decompression: %s\n", ok ? "Success" : "Failure"); + + return ok ? 0 : 1; +} diff --git a/recipes/lzo/all/test_v1_package/CMakeLists.txt b/recipes/lzo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/lzo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/lzo/all/test_v1_package/conanfile.py b/recipes/lzo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..94c6eef557e71 --- /dev/null +++ b/recipes/lzo/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lzo/all/test_v1_package/test_package.c b/recipes/lzo/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..82d98c1e92179 --- /dev/null +++ b/recipes/lzo/all/test_v1_package/test_package.c @@ -0,0 +1,47 @@ +#include "lzo1f.h" +#include +#include + +const char *text = "This is a string that lzo should compress to less bytes then before if it is working fine.\n" +"This compression algorithm appears to only compress bigger inputs so put a lot of text here.\n"; + + +int main() +{ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n"); + return 1; + } + + char compressed[2048]; + size_t compressed_len = sizeof(compressed); + { + char workMemory[LZO1F_MEM_COMPRESS+1]; + int r = lzo1f_1_compress((unsigned char*)text, strlen(text), (unsigned char*)compressed, &compressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - compression failed: %d\n", r); + return 1; + } + } + printf("Size before compression: %zu bytes\n", strlen(text)); + printf("Size after compression: %zu bytes\n", compressed_len); + + + char decompressed[2048]; + size_t decompressed_len = sizeof(decompressed); + { + char workMemory[LZO1F_MEM_DECOMPRESS+1]; + int r = lzo1f_decompress((unsigned char*)compressed, compressed_len, (unsigned char*)decompressed, &decompressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - decompression failed: %d\n", r); + return 1; + } + } + + int ok = (strlen(text) == decompressed_len) && (strncmp(text, decompressed, decompressed_len) == 0); + printf("Decompression: %s\n", ok ? "Success" : "Failure"); + + return ok ? 0 : 1; +} diff --git a/recipes/lzo/config.yml b/recipes/lzo/config.yml new file mode 100644 index 0000000000000..6ba5fbf9d7661 --- /dev/null +++ b/recipes/lzo/config.yml @@ -0,0 +1,3 @@ +versions: + "2.10": + folder: all diff --git a/recipes/m4/all/conandata.yml b/recipes/m4/all/conandata.yml new file mode 100644 index 0000000000000..3b25f4d23294d --- /dev/null +++ b/recipes/m4/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.4.19": + url: + - "https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz" + - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.19.tar.gz" + sha256: "3be4a26d825ffdfda52a56fc43246456989a3630093cced3fbddf4771ee58a70" + "1.4.18": + url: + - "https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz" + - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.18.tar.gz" + sha256: "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab" +patches: + "1.4.19": + - patch_file: "patches/1.4.19-0001-open-files-in-binary-mode.patch" + - patch_file: "patches/1.4.19-0002-ar-lib.patch" + - patch_file: "patches/1.4.19-0003-msvc-debug-assertion.patch" + - patch_file: "patches/1.4.19-0004-disable-hardening-in-source.patch" + "1.4.18": + - patch_file: "patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch" + - patch_file: "patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch" + - patch_file: "patches/1.4.18-0004-fix-checks.patch" + - patch_file: "patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch" + - patch_file: "patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch" + - patch_file: "patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch" + - patch_file: "patches/1.4.18-0008-open-files-in-binary-mode.patch" + - patch_file: "patches/1.4.18-0009-disable-hardening-in-source.patch" + - patch_file: "patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch" diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py new file mode 100644 index 0000000000000..881f4c539d77d --- /dev/null +++ b/recipes/m4/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version +import os +import shutil + +required_conan_version = ">=1.55.0" + + +class M4Conan(ConanFile): + name = "m4" + package_type = "application" + description = "GNU M4 is an implementation of the traditional Unix macro processor" + topics = ("macro", "preprocessor") + homepage = "https://www.gnu.org/software/m4/" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-only" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug + # Visual Studio does not support the %n format flag: + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions + # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, + # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) + if self.settings.build_type in ("Debug", "RelWithDebInfo"): + tc.extra_ldflags.append("-PDB") + elif self.settings.compiler == "clang" and Version(self.version) < "1.4.19": + tc.extra_cflags.extend([ + "-rtlib=compiler-rt", + "-Wno-unused-command-line-argument", + ]) + if self.settings.os == "Windows": + tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes") + env = tc.environment() + # help2man trick + env.prepend_path("PATH", self.source_folder) + # handle msvc + if is_msvc(self): + ar_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "ar-lib")) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("LD", "link") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + if shutil.which("help2man") == None: + # dummy file for configure + help2man = os.path.join(self.source_folder, "help2man") + save(self, help2man, "#!/usr/bin/env bash\n:") + if os.name == "posix": + os.chmod(help2man, os.stat(help2man).st_mode | 0o111) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path + bin_ext = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.package_folder, "bin", f"m4{bin_ext}").replace("\\", "/") + self.runenv_info.define_path("M4", m4_bin) + self.buildenv_info.define_path("M4", m4_bin) + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) + self.env_info.M4 = m4_bin diff --git a/recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch new file mode 100644 index 0000000000000..18da1f97ffd3a --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch @@ -0,0 +1,170 @@ +# this patches is from https://git.busybox.net/buildroot/commit/?id=c48f8a64626c60bd1b46804b7cf1a699ff53cdf3 +# to fix compiler error on certain systems: +# freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." + +From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Mon, 5 Mar 2018 10:56:29 -0800 +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Daniel P. Berrangé in: +https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Check _IO_EOF_SEEN instead of _IO_ftrylockfile. +* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: +Define if not already defined. + +[yann.morin.1998@free.fr: partially backport from upstream gnulib] +Signed-off-by: "Yann E. MORIN" + +--- + lib/fflush.c | 6 +++--- + lib/fpending.c | 2 +- + lib/fpurge.c | 2 +- + lib/freadahead.c | 2 +- + lib/freading.c | 2 +- + lib/fseeko.c | 4 ++-- + lib/stdio-impl.h | 6 ++++++ + 7 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/lib/fflush.c b/lib/fflush.c +index ef2a7f1..787790d 100644 +--- a/lib/fflush.c ++++ b/lib/fflush.c +@@ -33,7 +33,7 @@ + #undef fflush + + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index ce93604..9fe7ffb 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,7 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff --git a/lib/fpurge.c b/lib/fpurge.c +index 53ee68c..7cba3a3 100644 +--- a/lib/fpurge.c ++++ b/lib/fpurge.c +@@ -62,7 +62,7 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/lib/freadahead.c b/lib/freadahead.c +index cfc969b..5e43e13 100644 +--- a/lib/freadahead.c ++++ b/lib/freadahead.c +@@ -25,7 +25,7 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff --git a/lib/freading.c b/lib/freading.c +index 05cb0b8..f1da5b9 100644 +--- a/lib/freading.c ++++ b/lib/freading.c +@@ -31,7 +31,7 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/lib/fseeko.c b/lib/fseeko.c +index 0c01c4f..0601619 100644 +--- a/lib/fseeko.c ++++ b/lib/fseeko.c +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h +index 766d693..75fe3ad 100644 +--- a/lib/stdio-impl.h ++++ b/lib/stdio-impl.h +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + +-- +2.7.4.windows.1 + diff --git a/recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch b/recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch new file mode 100644 index 0000000000000..5fb554caa8ead --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch @@ -0,0 +1,156 @@ +# this patches is from https://git.busybox.net/buildroot/commit/?id=c48f8a64626c60bd1b46804b7cf1a699ff53cdf3 +# to fix compiler error on certain systems: +# freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." + + +From 74d9d6a293d7462dea8f83e7fc5ac792e956a0ad Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Thu, 8 Mar 2018 16:42:45 -0800 +Subject: [PATCH 2/2] fflush: be more paranoid about libio.h change + +Suggested by Eli Zaretskii in: +https://lists.gnu.org/r/emacs-devel/2018-03/msg00270.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Look at _IO_ftrylockfile as well as at _IO_EOF_SEEN. +--- + lib/fflush.c | 9 ++++++--- + lib/fpending.c | 3 ++- + lib/fpurge.c | 3 ++- + lib/freadahead.c | 3 ++- + lib/freading.c | 3 ++- + lib/fseeko.c | 6 ++++-- + 6 files changed, 18 insertions(+), 9 deletions(-) + +[yann.morin.1998@free.fr: partially backport from upstream gnulib] +Signed-off-by: "Yann E. MORIN" + +diff --git a/lib/fflush.c b/lib/fflush.c +index 787790d..d6951a8 100644 +--- a/lib/fflush.c ++++ b/lib/fflush.c +@@ -33,7 +33,8 @@ + #undef fflush + + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++/* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +73,8 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1) ++/* GNU libc, BeOS, Haiku, Linux libc5 */ + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +150,8 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index 9fe7ffb..9433c1a 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,8 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff --git a/lib/fpurge.c b/lib/fpurge.c +index 7cba3a3..55758d7 100644 +--- a/lib/fpurge.c ++++ b/lib/fpurge.c +@@ -62,7 +62,8 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/lib/freadahead.c b/lib/freadahead.c +index 5e43e13..4ccaa09 100644 +--- a/lib/freadahead.c ++++ b/lib/freadahead.c +@@ -25,7 +25,8 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff --git a/lib/freading.c b/lib/freading.c +index f1da5b9..7ae5618 100644 +--- a/lib/freading.c ++++ b/lib/freading.c +@@ -31,7 +31,8 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/lib/fseeko.c b/lib/fseeko.c +index 0601619..2fc1986 100644 +--- a/lib/fseeko.c ++++ b/lib/fseeko.c +@@ -47,7 +47,8 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +124,8 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +-- +2.7.4.windows.1 + diff --git a/recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch b/recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch new file mode 100644 index 0000000000000..0afa4da0a47d0 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch @@ -0,0 +1,16 @@ +patch taken from https://github.com/macports/macports-ports/blob/master/devel/m4/files/secure_snprintf.patch +to fix invalid instruction error on OSX when running m4 + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 246831f..ae47ebf 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #endif + *fbp = dp->conversion; + #if USE_SNPRINTF +-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++#if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; diff --git a/recipes/m4/all/patches/1.4.18-0004-fix-checks.patch b/recipes/m4/all/patches/1.4.18-0004-fix-checks.patch new file mode 100644 index 0000000000000..adbef56b8ea73 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0004-fix-checks.patch @@ -0,0 +1,35 @@ +--- checks/check-them ++++ checks/check-them +@@ -58,12 +58,13 @@ + shift; shift + fi + + # Find out how the executable prints argv[0] + m4name=`"$m4" --help | ${SED} -e 's/Usage: \(.*\) \[OPTION.*/\1/' \ + -e 's/\\\\/\\\\\\\\/g' -e 1q` ++m4name=`basename $m4name` + + # Find out if we should strip \r in the output + "$m4" --version | tee $out + "$m4" --version | tr -d '\015' > $xout + if cmp -s $out $xout; then + : + +---checks/Makefile ++++ checks/Makefile.in +@@ -1612,14 +1612,14 @@ + $(srcdir)/stamp-checks: $(srcdir)/get-them $(top_srcdir)/doc/m4.texi + rm -f $(DOC_CHECKS) + cd $(srcdir) && AWK=$(AWK) ./get-them ../doc/m4.texi + echo stamp >$@ + + check-local: $(srcdir)/stamp-checks +- PATH=`pwd`/../src"$(PATH_SEPARATOR)"$$PATH; export PATH; \ +- $(srcdir)/check-them -I $(srcdir)/../examples $(CHECKS) ++ cd $(srcdir)/.. && PATH=src"$(PATH_SEPARATOR)"$$PATH \ ++ $(srcdir)/check-them -I examples $(CHECKS) + + installcheck: $(srcdir)/stamp-checks + PATH='$(bindir)'"$(PATH_SEPARATOR)"$$PATH; export PATH; \ + $(srcdir)/check-them -I $(srcdir)/../examples \ + -m "`echo m4 | sed '$(program_transform_name)'`" $(CHECKS) diff --git a/recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch b/recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch new file mode 100644 index 0000000000000..65911ef48d088 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch @@ -0,0 +1,124 @@ +From 0d01189c540f63159448ba6bf4740bb20ff1e1ee Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Fri, 21 Apr 2017 17:24:48 +0200 +Subject: vasnprintf: Fix for MSVC 14. + +* lib/vasnprintf.c (USE_MSVC__SNPRINTF): New macro. +Everywhere, use !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF instead +of !HAVE_SNPRINTF_RETVAL_C99. +--- + lib/vasnprintf.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 4962e5893..839f79060 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -156,6 +156,7 @@ + # define SNPRINTF snwprintf + # else + # define SNPRINTF _snwprintf ++# define USE_MSVC__SNPRINTF 1 + # endif + # else + /* Unix. */ +@@ -181,7 +182,9 @@ + /* Here we need to call the native snprintf, not rpl_snprintf. */ + # undef snprintf + # else ++ /* MSVC versions < 14 did not have snprintf, only _snprintf. */ + # define SNPRINTF _snprintf ++# define USE_MSVC__SNPRINTF 1 + # endif + # else + /* Unix. */ +@@ -208,7 +211,7 @@ + #undef remainder + #define remainder rem + +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION + # if (HAVE_STRNLEN && !defined _AIX) + # define local_strnlen strnlen + # else +@@ -224,7 +227,7 @@ local_strnlen (const char *string, size_t maxlen) + # endif + #endif + +-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T ++#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T + # if HAVE_WCSLEN + # define local_wcslen wcslen + # else +@@ -247,7 +250,7 @@ local_wcslen (const wchar_t *s) + # endif + #endif + +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION + # if HAVE_WCSNLEN + # define local_wcsnlen wcsnlen + # else +@@ -1517,7 +1520,7 @@ is_borderline (const char *digits, size_t precision) + + #endif + +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + + /* Use a different function name, to make it possible that the 'wchar_t' + parametrization and the 'char' parametrization get compiled in the same +@@ -2392,7 +2395,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + } + } + #endif +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T + else if (dp->conversion == 's' + # if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +@@ -4591,10 +4594,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int has_width; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + size_t width; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; + #endif +@@ -4623,7 +4626,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 0; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + width = 0; + if (dp->width_start != dp->width_end) + { +@@ -4657,7 +4660,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + } + #endif + +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) +@@ -5127,7 +5130,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + /* Look at the snprintf() return value. */ + if (retcount < 0) + { +-# if !HAVE_SNPRINTF_RETVAL_C99 ++# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length +-- +cgit v1.2.1 + diff --git a/recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch b/recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch new file mode 100644 index 0000000000000..3ef80aee81ab2 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch @@ -0,0 +1,50 @@ +From 5e22aee79f9d02ac37f40f1d18f5696114c3c3c9 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 16 May 2017 09:23:52 -0700 +Subject: manywarnings: update for GCC 7 + +* build-aux/gcc-warning.spec: +* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): +Add GCC 7 warnings, notably -Wimplicit-fallthrough=5, which +requires a non-comment fallthrough attribute. This is a bit +cleaner than the comment versions. +* lib/strftime.c, lib/dfa.c, lib/fnmatch.c, lib/mbrtowc.c: +* lib/vasnprintf.c, tests/macros.h (FALLTHROUGH): New macro. +Use it whenever one switch case falls through into the next. +--- + lib/vasnprintf.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 839f79060..9c2af0e45 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -118,6 +118,14 @@ + # include "fpucw.h" + #endif + ++#ifndef FALLTHROUGH ++# if __GNUC__ < 7 ++# define FALLTHROUGH ((void) 0) ++# else ++# define FALLTHROUGH __attribute__ ((__fallthrough__)) ++# endif ++#endif ++ + /* Default parameters. */ + #ifndef VASNPRINTF + # if WIDE_CHAR_VERSION +@@ -4837,7 +4845,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + *fbp++ = 'l'; + # endif + #endif +- /*FALLTHROUGH*/ ++ FALLTHROUGH; + case TYPE_LONGINT: + case TYPE_ULONGINT: + #if HAVE_WINT_T +-- +cgit v1.2.1 + diff --git a/recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch b/recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch new file mode 100644 index 0000000000000..85a0bdd24270e --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch @@ -0,0 +1,47 @@ +From c41f233c4c38e84023a16339782ee306f03e7f59 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Fri, 7 Jul 2017 14:10:20 -0700 +Subject: vasnprintf: port to macOS 10.13 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by comex in: +http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00056.html +* lib/vasnprintf.c (VASNPRINTF): Don’t use %n on macOS. +--- + lib/vasnprintf.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 9c2af0e45..fecaf27a1 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -4869,7 +4869,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #endif + *fbp = dp->conversion; + #if USE_SNPRINTF +-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++# if ! (((__GLIBC__ > 2 \ ++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ ++ && !defined __UCLIBC__) \ ++ || (defined __APPLE__ && defined __MACH__) \ ++ || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +@@ -4883,6 +4887,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + in format strings in writable memory may crash the program + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it + in this situation. */ ++ /* macOS 10.13 High Sierra behaves like glibc with ++ _FORTIFY_SOURCE=2, and older macOS releases ++ presumably do not need %n. */ + /* On native Windows systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, +-- +cgit v1.2.1 + diff --git a/recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch b/recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch new file mode 100644 index 0000000000000..fefd1a886353a --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch @@ -0,0 +1,15 @@ +This will open all files in binary mode. +files may contain binary data. +This fixes e.g. autoconf, of whose frozen file, contains all characters from 0x00 to 0xff. + +--- src/path.c ++++ src/path.c +@@ -110,7 +110,7 @@ + static FILE * + m4_fopen (const char *file) + { +- FILE *fp = fopen (file, "r"); ++ FILE *fp = fopen (file, "rb"); + if (fp) + { + struct stat st; diff --git a/recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch b/recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch new file mode 100644 index 0000000000000..b72b41304c70a --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- lib/config.hin ++++ lib/config.hin +@@ -96,7 +96,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch b/recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch new file mode 100644 index 0000000000000..5d5a404937e9d --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch @@ -0,0 +1,106 @@ +c-stack: stop using SIGSTKSZ + +It’s been proposed to stop making SIGSTKSZ an integer constant: +https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html +Also, using SIGSTKSZ in #if did not conform to current POSIX. +Also, avoiding SIGSTKSZ makes the code simpler and easier to grok. +* lib/c-stack.c (SIGSTKSZ): Remove. +(alternate_signal_stack): Now a 64 KiB array, for simplicity. +All uses changed. + +[Retrieved (and backported) from: +https://git.savannah.gnu.org/cgit/gnulib.git/patch/?id=f9e2b20a12a230efa30f1d479563ae07d276a94b] +Signed-off-by: Fabrice Fontaine + +diff -Nura lib/c-stack.c lib/c-stack.c +--- lib/c-stack.c 2021-04-11 19:12:14.086494029 +0200 ++++ lib/c-stack.c 2021-04-11 19:48:46.316862760 +0200 +@@ -50,15 +50,16 @@ + #if ! HAVE_STACK_T && ! defined stack_t + typedef struct sigaltstack stack_t; + #endif +-#ifndef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 +-/* libsigsegv 2.6 through 2.8 have a bug where some architectures use +- more than the Linux default of an 8k alternate stack when deciding +- if a fault was caused by stack overflow. */ +-# undef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#endif ++ ++/* Storage for the alternate signal stack. ++ 64 KiB is not too large for Gnulib-using apps, and is large enough ++ for all known platforms. Smaller sizes may run into trouble. ++ For example, libsigsegv 2.6 through 2.8 have a bug where some ++ architectures use more than the Linux default of an 8 KiB alternate ++ stack when deciding if a fault was caused by stack overflow. */ ++static max_align_t alternate_signal_stack[(64 * 1024 ++ + sizeof (max_align_t) - 1) ++ / sizeof (max_align_t)]; + + #include + #include +@@ -128,19 +129,6 @@ + #if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ + && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV + +-/* Storage for the alternate signal stack. */ +-static union +-{ +- char buffer[SIGSTKSZ]; +- +- /* These other members are for proper alignment. There's no +- standard way to guarantee stack alignment, but this seems enough +- in practice. */ +- long double ld; +- long l; +- void *p; +-} alternate_signal_stack; +- + static void + null_action (int signo __attribute__ ((unused))) + { +@@ -205,8 +193,8 @@ + + /* Always install the overflow handler. */ + if (stackoverflow_install_handler (overflow_handler, +- alternate_signal_stack.buffer, +- sizeof alternate_signal_stack.buffer)) ++ alternate_signal_stack, ++ sizeof alternate_signal_stack)) + { + errno = ENOTSUP; + return -1; +@@ -279,14 +267,14 @@ + stack_t st; + struct sigaction act; + st.ss_flags = 0; ++ st.ss_sp = alternate_signal_stack; ++ st.ss_size = sizeof alternate_signal_stack; + # if SIGALTSTACK_SS_REVERSED + /* Irix mistakenly treats ss_sp as the upper bound, rather than + lower bound, of the alternate stack. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *); +- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *); +-# else +- st.ss_sp = alternate_signal_stack.buffer; +- st.ss_size = sizeof alternate_signal_stack.buffer; ++ st.ss_size -= sizeof (void *); ++ char *ss_sp = st.ss_sp; ++ st.ss_sp = ss_sp + st.ss_size; + # endif + r = sigaltstack (&st, NULL); + if (r != 0) +diff -Nura lib/c-stack.h lib/c-stack.h +--- lib/c-stack.h 2021-04-11 19:12:14.098494042 +0200 ++++ lib/c-stack.h 2021-04-11 19:17:42.138848378 +0200 +@@ -34,7 +34,7 @@ + A null ACTION acts like an action that does nothing. + + ACTION must be async-signal-safe. ACTION together with its callees +- must not require more than SIGSTKSZ bytes of stack space. Also, ++ must not require more than 64 KiB bytes of stack space. Also, + ACTION should not call longjmp, because this implementation does + not guarantee that it is safe to return to the original stack. + diff --git a/recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch b/recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch new file mode 100644 index 0000000000000..91f68e00cc80f --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch @@ -0,0 +1,15 @@ +This will open all files in binary mode. +files may contain binary data. +This fixes e.g. autoconf, of whose frozen file, contains all characters from 0x00 to 0xff. + +--- src/path.c ++++ src/path.c +@@ -110,7 +110,7 @@ + static FILE * + m4_fopen (const char *file) + { +- FILE *fp = fopen (file, "re"); ++ FILE *fp = fopen (file, "reb"); + if (fp) + { + struct stat st; diff --git a/recipes/m4/all/patches/1.4.19-0002-ar-lib.patch b/recipes/m4/all/patches/1.4.19-0002-ar-lib.patch new file mode 100644 index 0000000000000..22f7abe8bb873 --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0002-ar-lib.patch @@ -0,0 +1,276 @@ +ar-lib is needed for building m4 with Visual Studio. +Re-use the one from m4/1.4.18. +We can't use automake here to avoid a build cycle (m4 -> automake -> autoconf -> m4) +--- /dev/null ++++ build-aux/ar-lib +@@ -0,0 +1,270 @@ ++#! /bin/sh ++# Wrapper for Microsoft lib.exe ++ ++me=ar-lib ++scriptversion=2012-03-01.08; # UTC ++ ++# Copyright (C) 2010-2014 Free Software Foundation, Inc. ++# Written by Peter Rosin . ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++ ++# func_error message ++func_error () ++{ ++ echo "$me: $1" 1>&2 ++ exit 1 ++} ++ ++file_conv= ++ ++# func_file_conv build_file ++# Convert a $build file to $host form and store it in $file ++# Currently only supports Windows hosts. ++func_file_conv () ++{ ++ file=$1 ++ case $file in ++ / | /[!/]*) # absolute file, and not a UNC file ++ if test -z "$file_conv"; then ++ # lazily determine how to convert abs files ++ case `uname -s` in ++ MINGW*) ++ file_conv=mingw ++ ;; ++ CYGWIN*) ++ file_conv=cygwin ++ ;; ++ *) ++ file_conv=wine ++ ;; ++ esac ++ fi ++ case $file_conv in ++ mingw) ++ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ++ ;; ++ cygwin) ++ file=`cygpath -m "$file" || echo "$file"` ++ ;; ++ wine) ++ file=`winepath -w "$file" || echo "$file"` ++ ;; ++ esac ++ ;; ++ esac ++} ++ ++# func_at_file at_file operation archive ++# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE ++# for each of them. ++# When interpreting the content of the @FILE, do NOT use func_file_conv, ++# since the user would need to supply preconverted file names to ++# binutils ar, at least for MinGW. ++func_at_file () ++{ ++ operation=$2 ++ archive=$3 ++ at_file_contents=`cat "$1"` ++ eval set x "$at_file_contents" ++ shift ++ ++ for member ++ do ++ $AR -NOLOGO $operation:"$member" "$archive" || exit $? ++ done ++} ++ ++case $1 in ++ '') ++ func_error "no command. Try '$0 --help' for more information." ++ ;; ++ -h | --h*) ++ cat < ++#endif ++ + /* TRANSLATORS: This is a non-ASCII name: The first name is (with + Unicode escapes) "Ren\u00e9" or (with HTML entities) "René". */ + #define AUTHORS proper_name_utf8 ("Rene' Seindal", "Ren\xC3\xA9 Seindal") +@@ -423,6 +427,15 @@ main (int argc, char *const *argv) + textdomain (PACKAGE); + atexit (close_stdin); + ++#ifdef _WIN32 ++ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); ++ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); ++ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); ++#endif ++ + include_init (); + debug_init (); + diff --git a/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch b/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch new file mode 100644 index 0000000000000..9386ee55aedce --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- a/lib/config.hin ++++ b/lib/config.hin +@@ -198,7 +198,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b665b86aad8f3 --- /dev/null +++ b/recipes/m4/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +from conan import ConanFile +from conan.tools.files import save +from io import StringIO +import os +import textwrap + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + @property + def _m4_input_path(self): + return os.path.join(self.build_folder, "input.m4") + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + save(self, self._m4_input_path, textwrap.dedent("""\ + m4_define(NAME1, `Harry, Jr.') + m4_define(NAME2, `Sally') + m4_define(MET, `$1 met $2') + MET(`NAME1', `NAME2') + """)) + + def test(self): + self.run("m4 --version") + self.run(f"m4 -P {self._m4_input_path}") + + self.run(f"m4 -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") + + output = StringIO() + self.run(f"m4 -P {self._m4_input_path}", output) + assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/m4/all/test_package/frozen.m4f b/recipes/m4/all/test_package/frozen.m4f new file mode 100644 index 0000000000000..26431a17d4fd6 --- /dev/null +++ b/recipes/m4/all/test_package/frozen.m4f @@ -0,0 +1,11 @@ +# This is a frozen state file generated by GNU M4 1.4.18 +V1 +Q1,1 +[] +T9,27 +say_hello[Hello ]conanize_name([$1]) +T11,203 +all_letters +  !"#*%&'()$+,./0123456789:;<=>?@[\]^_`{|}~- +T13,10 +conanize_name[Conan $1] diff --git a/recipes/m4/all/test_package/test.m4 b/recipes/m4/all/test_package/test.m4 new file mode 100644 index 0000000000000..a04483498966a --- /dev/null +++ b/recipes/m4/all/test_package/test.m4 @@ -0,0 +1,2 @@ +say_hello([World]) +[All letters: ]all_letters diff --git a/recipes/m4/all/test_v1_package/conanfile.py b/recipes/m4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..23409570c2d3d --- /dev/null +++ b/recipes/m4/all/test_v1_package/conanfile.py @@ -0,0 +1,41 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +from io import StringIO +import os +import textwrap + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _m4_input_path(self): + return os.path.join(self.build_folder, "input.m4") + + def build(self): + tools.save(self._m4_input_path, textwrap.dedent("""\ + m4_define(NAME1, `Harry, Jr.') + m4_define(NAME2, `Sally') + m4_define(MET, `$1 met $2') + MET(`NAME1', `NAME2') + """)) + + def test(self): + if hasattr(self, "settings_build"): + exe_suffix = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.deps_cpp_info["m4"].rootpath, "bin", "m4" + exe_suffix) + else: + m4_bin = tools.get_env("M4") + if m4_bin is None or not m4_bin.startswith(self.deps_cpp_info["m4"].rootpath): + raise ConanException("M4 environment variable not set") + + if not tools.cross_building(self, skip_x64_x86=True): + self.run("{} --version".format(m4_bin), run_environment=True) + self.run("{} -P {}".format(m4_bin, self._m4_input_path)) + + self.run("m4 -R {0}/frozen.m4f {0}/test.m4".format(os.path.join(self.source_folder, os.pardir, "test_package"), run_environment=True)) + + output = StringIO() + self.run("{} -P {}".format(m4_bin, self._m4_input_path), output=output) + + assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/m4/config.yml b/recipes/m4/config.yml new file mode 100644 index 0000000000000..d9912c96a2093 --- /dev/null +++ b/recipes/m4/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.19": + folder: all + "1.4.18": + folder: all diff --git a/recipes/maddy/all/conandata.yml b/recipes/maddy/all/conandata.yml new file mode 100644 index 0000000000000..91359378f2072 --- /dev/null +++ b/recipes/maddy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.2": + sha256: ce66e1ee63bda3a6ab9c814edc0ed818abecca1c2218307ff87fb9ec1fc970fc + url: https://github.com/progsource/maddy/archive/refs/tags/1.1.2.tar.gz diff --git a/recipes/maddy/all/conanfile.py b/recipes/maddy/all/conanfile.py new file mode 100644 index 0000000000000..7bcdd1cec24d5 --- /dev/null +++ b/recipes/maddy/all/conanfile.py @@ -0,0 +1,47 @@ +from conans import ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class MaddyConan(ConanFile): + name = "maddy" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/progsource/maddy" + description = ( + "open-source, maddy is a C++ Markdown to HTML header-only parser library." + ) + topics = ("maddy", "markdown", "header-only") + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 14) + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + destination=self._source_subfolder, + strip_root=True + ) + + def package_id(self): + self.info.header_only() + + def package(self): + self.copy( + "LICENSE", + src=os.path.join(self.source_folder, self._source_subfolder), + dst="licenses", + ) + self.copy( + pattern="maddy/*.h", + src=os.path.join(self.source_folder, self._source_subfolder, "include"), + dst="include", + ) diff --git a/recipes/maddy/all/test_package/CMakeLists.txt b/recipes/maddy/all/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..b85bbd5581573 --- /dev/null +++ b/recipes/maddy/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.5) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(maddy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE maddy::maddy) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED + ON) diff --git a/recipes/maddy/all/test_package/conanfile.py b/recipes/maddy/all/test_package/conanfile.py new file mode 100755 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/maddy/all/test_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/maddy/all/test_package/example.cpp b/recipes/maddy/all/test_package/example.cpp new file mode 100755 index 0000000000000..9e6b905aef89e --- /dev/null +++ b/recipes/maddy/all/test_package/example.cpp @@ -0,0 +1,31 @@ +/* + * This example was copied from + * https://github.com/progsource/maddy/blob/master/README.md + */ + +#include +#include +#include +#include + +#include + +int main() { + std::stringstream markdownInput( + "# Hello world from maddy!\nVisit " + "[conan-center-index](https://github.com/conan-io/conan-center-index)\n"); + + // config is optional + std::shared_ptr config = + std::make_shared(); + config->isEmphasizedParserEnabled = true; // default + config->isHTMLWrappedInParagraph = true; // default + + std::shared_ptr parser = + std::make_shared(config); + std::string htmlOutput = parser->Parse(markdownInput); + + std::cout << "html:\n" << htmlOutput << "\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/maddy/config.yml b/recipes/maddy/config.yml new file mode 100644 index 0000000000000..8d13aefb6b4fb --- /dev/null +++ b/recipes/maddy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.2": + folder: all diff --git a/recipes/magic_enum/all/conandata.yml b/recipes/magic_enum/all/conandata.yml new file mode 100644 index 0000000000000..f1eb6c3e30073 --- /dev/null +++ b/recipes/magic_enum/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "0.6.5": + sha256: "37A69482517C8976CB48CD271DA8C6BA92E07EE2AB2BDD7CAEF4C8158AF77359" + url: "https://github.com/Neargye/magic_enum/archive/v0.6.5.tar.gz" + "0.6.6": + sha256: "1033f9a9315023feebb48f20d5a572149ec72c1e95a52bcf7042a412ff9d2e28" + url: "https://github.com/Neargye/magic_enum/archive/v0.6.6.tar.gz" + "0.7.0": + sha256: "4fe6627407a656d0d73879c0346b251ccdcfb718c37bef5410ba172c7c7d5f9a" + url: "https://github.com/Neargye/magic_enum/archive/v0.7.0.tar.gz" + "0.7.1": + url: "https://github.com/Neargye/magic_enum/archive/v0.7.1.tar.gz" + sha256: "11bb590dd055194e92936fa4d0652084c14bd23ac8e4b5a02271b6259a05cec9" + "0.7.2": + url: "https://github.com/Neargye/magic_enum/archive/v0.7.2.tar.gz" + sha256: "a77895ebc684f7a4dd2e4e06529b22e9ae694037f6dee0753d3ce0bbcd5b3e38" + "0.7.3": + url: "https://github.com/Neargye/magic_enum/archive/v0.7.3.tar.gz" + sha256: "b8d0cd848546fee136dc1fa4bb021a1e4dc8fe98e44d8c119faa3ef387636bf7" + "0.8.0": + url: "https://github.com/Neargye/magic_enum/archive/v0.8.0.tar.gz" + sha256: "5e7680e877dd4cf68d9d0c0e3c2a683b432a9ba84fc1993c4da3de70db894c3c" + "0.8.1": + url: "https://github.com/Neargye/magic_enum/archive/v0.8.1.tar.gz" + sha256: "6b948d1680f02542d651fc82154a9e136b341ce55c5bf300736b157e23f9df11" + "0.8.2": + url: "https://github.com/Neargye/magic_enum/archive/v0.8.2.tar.gz" + sha256: "62bd7034bbbfc3d7806001767d5775ab42f3ff33bb38366e1ceb21102f0dff9a" diff --git a/recipes/magic_enum/all/conanfile.py b/recipes/magic_enum/all/conanfile.py new file mode 100644 index 0000000000000..ad2dd7598a2f6 --- /dev/null +++ b/recipes/magic_enum/all/conanfile.py @@ -0,0 +1,71 @@ +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.50.0" + + +class MagicEnumConan(ConanFile): + name = "magic_enum" + description = ( + "Header-only C++17 library provides static reflection for enums, work " + "with any enum type without any macro or boilerplate code." + ) + topics = ("cplusplus", "enum-to-string", "string-to-enum", "serialization", + "reflection", "header-only", "compile-time") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Neargye/magic_enum" + license = "MIT" + 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": "9", + "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.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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "magic_enum") + self.cpp_info.set_property("cmake_target_name", "magic_enum::magic_enum") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/magic_enum/all/test_package/CMakeLists.txt b/recipes/magic_enum/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c185d76435a4f --- /dev/null +++ b/recipes/magic_enum/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(magic_enum REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE magic_enum::magic_enum) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/magic_enum/all/test_package/conanfile.py b/recipes/magic_enum/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/magic_enum/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/magic_enum/all/test_package/test_package.cpp b/recipes/magic_enum/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fcb911e1f966e --- /dev/null +++ b/recipes/magic_enum/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +enum Color { RED = 2, BLUE = 4, GREEN = 8 }; + +int main(){ + + Color color = Color::RED; + std::string color_name { magic_enum::enum_name(color) }; + return color_name == "RED" ? EXIT_SUCCESS : EXIT_FAILURE ; + +} diff --git a/recipes/magic_enum/all/test_v1_package/CMakeLists.txt b/recipes/magic_enum/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de886ea1bc291 --- /dev/null +++ b/recipes/magic_enum/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(magic_enum REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE magic_enum::magic_enum) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/magic_enum/all/test_v1_package/conanfile.py b/recipes/magic_enum/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/magic_enum/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/magic_enum/config.yml b/recipes/magic_enum/config.yml new file mode 100644 index 0000000000000..affbfa65ae445 --- /dev/null +++ b/recipes/magic_enum/config.yml @@ -0,0 +1,19 @@ +versions: + "0.6.5": + folder: all + "0.6.6": + folder: all + "0.7.0": + folder: all + "0.7.1": + folder: all + "0.7.2": + folder: all + "0.7.3": + folder: all + "0.8.0": + folder: all + "0.8.1": + folder: all + "0.8.2": + folder: all diff --git a/recipes/magnum-extras/all/CMakeLists.txt b/recipes/magnum-extras/all/CMakeLists.txt new file mode 100644 index 0000000000000..08c7bbc0b05a4 --- /dev/null +++ b/recipes/magnum-extras/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/Magnum) +#set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/MagnumExternal) + +add_subdirectory("source_subfolder") diff --git a/recipes/magnum-extras/all/conandata.yml b/recipes/magnum-extras/all/conandata.yml new file mode 100644 index 0000000000000..beb3ab34a0599 --- /dev/null +++ b/recipes/magnum-extras/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "2020.06": + url: "https://github.com/mosra/magnum-extras/archive/refs/tags/v2020.06.tar.gz" + sha256: "a8d7babc50ac070984d39f6cc15c3ce2af7b41fe980fe81b0405da6f5ba3c36d" +patches: + "2020.06": + - base_path: "source_subfolder" + patch_file: "patches/2020.06/0001-emscripten-toolchain.patch" + # patch_type: "portability" + # description: "Remove unnecessary dependency on UseEmscripten" + # source: "https://github.com/mosra/magnum/issues/490" diff --git a/recipes/magnum-extras/all/conanfile.py b/recipes/magnum-extras/all/conanfile.py new file mode 100644 index 0000000000000..939aef0b5e69a --- /dev/null +++ b/recipes/magnum-extras/all/conanfile.py @@ -0,0 +1,144 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.43.0" + + +class MagnumExtrasConan(ConanFile): + name = "magnum-extras" + description = "Extras for the Magnum C++11/C++14 graphics engine" + license = "MIT" + topics = ("magnum", "graphics", "rendering", "3d", "2d", "opengl") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://magnum.graphics" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "player": [True, False], + "ui": [True, False], + "ui_gallery": [True, False], + "application": ["android", "emscripten", "glfw", "glx", "sdl2", "xegl"], + } + default_options = { + "shared": False, + "fPIC": True, + "player": True, + "ui": True, + "ui_gallery": True, + "application": "sdl2", + } + + short_paths = True + 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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + if self.settings.os == "Android": + self.options.application = "android" + if self.settings.os == "Emscripten": + self.options.application = "emscripten" + # FIXME: Requires 'magnum:basis_importer=True' + self.options.player = False + # FIXME: Fails to compile + self.options.ui_gallery = False + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("magnum/{}".format(self.version)) + self.requires("corrade/{}".format(self.version)) + if self.settings.os in ["iOS", "Emscripten", "Android"] and self.options.ui_gallery: + self.requires("magnum-plugins/{}".format(self.version)) + + def validate(self): + opt_name = "{}_application".format(self.options.application) + if not getattr(self.options["magnum"], opt_name): + raise ConanInvalidConfiguration("Magnum needs option '{opt}=True'".format(opt=opt_name)) + if self.settings.os == "Emscripten" and self.options["magnum"].target_gl == "gles2": + raise ConanInvalidConfiguration("OpenGL ES 3 required, use option 'magnum:target_gl=gles3'") + + def build_requirements(self): + self.build_requires("corrade/{}".format(self.version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_STATIC"] = not self.options.shared + cmake.definitions["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False) + cmake.definitions["BUILD_TESTS"] = False + cmake.definitions["BUILD_GL_TESTS"] = False + + cmake.definitions["WITH_PLAYER"] = self.options.player + cmake.definitions["WITH_UI"] = self.options.ui + cmake.definitions["WITH_UI_GALLERY"] = self.options.ui_gallery + + cmake.configure() + return cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + 'set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH})', + "") + + cmakelists = [os.path.join("src", "Magnum", "Ui", "CMakeLists.txt"), + os.path.join("src", "player","CMakeLists.txt")] + app_name = "{}Application".format("XEgl" if self.options.application == "xegl" else str(self.options.application).capitalize()) + for cmakelist in cmakelists: + tools.replace_in_file(os.path.join(self._source_subfolder, cmakelist), + "Magnum::Application", + "Magnum::{}".format(app_name)) + + def build(self): + self._patch_sources() + + cm = self._configure_cmake() + cm.build() + + def package(self): + cm = self._configure_cmake() + cm.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "MagnumExtras") + self.cpp_info.names["cmake_find_package"] = "MagnumExtras" + self.cpp_info.names["cmake_find_package_multi"] = "MagnumExtras" + + lib_suffix = "-d" if self.settings.build_type == "Debug" else "" + if self.options.ui: + self.cpp_info.components["ui"].set_property("cmake_target_name", "MagnumExtras::Ui") + self.cpp_info.components["ui"].names["cmake_find_package"] = "Ui" + self.cpp_info.components["ui"].names["cmake_find_package_multi"] = "Ui" + self.cpp_info.components["ui"].libs = ["MagnumUi{}".format(lib_suffix)] + self.cpp_info.components["ui"].requires = ["corrade::interconnect", "magnum::magnum_main", "magnum::gl", "magnum::text"] + + if self.options.player or self.options.ui_gallery: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info('Appending PATH environment variable: %s' % bin_path) + self.env_info.path.append(bin_path) diff --git a/recipes/magnum-extras/all/patches/2020.06/0001-emscripten-toolchain.patch b/recipes/magnum-extras/all/patches/2020.06/0001-emscripten-toolchain.patch new file mode 100644 index 0000000000000..8fab49087628a --- /dev/null +++ b/recipes/magnum-extras/all/patches/2020.06/0001-emscripten-toolchain.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e0e0eb7..65083df 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,10 +58,6 @@ if(CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID) + set(BUILD_STATIC ON) + endif() + +-if(CORRADE_TARGET_EMSCRIPTEN) +- include(UseEmscripten) +-endif() +- + if(BUILD_TESTS) + find_package(Corrade REQUIRED TestSuite) + if(CORRADE_TARGET_IOS) diff --git a/recipes/magnum-extras/all/test_package/CMakeLists.txt b/recipes/magnum-extras/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..976323cbac9ea --- /dev/null +++ b/recipes/magnum-extras/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(MagnumExtras REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE MagnumExtras::Ui) +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) diff --git a/recipes/magnum-extras/all/test_package/conanfile.py b/recipes/magnum-extras/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b79eb4c726ded --- /dev/null +++ b/recipes/magnum-extras/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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): + if self.options["magnum-extras"].ui: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + executable_ext = ".exe" if self.settings.os == "Windows" else "" + if self.options["magnum-extras"].player: + assert os.path.exists(os.path.join(self.deps_cpp_info["magnum-extras"].rootpath, "bin", "magnum-player{}".format(executable_ext))) + # (Cannot run in headless mode) self.run("magnum-player --help") + if self.options["magnum-extras"].ui_gallery: + assert os.path.exists(os.path.join(self.deps_cpp_info["magnum-extras"].rootpath, "bin", "magnum-ui-gallery{}".format(executable_ext))) + # (Cannot run in headless mode) self.run("magnum-ui-gallery --help") + if self.options["magnum-extras"].ui: + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/magnum-extras/all/test_package/test_package.cpp b/recipes/magnum-extras/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..299d3b5cdc511 --- /dev/null +++ b/recipes/magnum-extras/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include "Magnum/Ui/Anchor.h" +#include "Magnum/Ui/BasicPlane.hpp" +#include "Magnum/Ui/BasicUserInterface.hpp" + + +struct UserInterface: Magnum::Ui::BasicUserInterface<> { + using BasicUserInterface::BasicUserInterface; +}; + +struct Plane: Magnum::Ui::BasicPlane<> { + using BasicPlane::BasicPlane; +}; + + +int main() { + std::cout << "magnum-extras\n"; + + UserInterface ui{{800, 600}, {1600, 900}}; + Plane plane{ui, {Magnum::Ui::Snap::Left|Magnum::Ui::Snap::Top, {400.0f, 300.0f}}, {{10.0f, 25.0f}, {-15.0f, -5.0f}}, {7.0f, 3.0f}}; + + auto padding = plane.padding(); + Magnum::Debug{&std::cout} << padding; +} diff --git a/recipes/magnum-extras/config.yml b/recipes/magnum-extras/config.yml new file mode 100644 index 0000000000000..93230781a72ea --- /dev/null +++ b/recipes/magnum-extras/config.yml @@ -0,0 +1,3 @@ +versions: + "2020.06": + folder: all diff --git a/recipes/magnum-integration/all/CMakeLists.txt b/recipes/magnum-integration/all/CMakeLists.txt new file mode 100644 index 0000000000000..e0949ec4127c9 --- /dev/null +++ b/recipes/magnum-integration/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/Magnum) +set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/MagnumExternal) + +add_subdirectory("source_subfolder") diff --git a/recipes/magnum-integration/all/conandata.yml b/recipes/magnum-integration/all/conandata.yml new file mode 100644 index 0000000000000..4634cb503f8ce --- /dev/null +++ b/recipes/magnum-integration/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2020.06": + url: "https://github.com/mosra/magnum-integration/archive/refs/tags/v2020.06.tar.gz" + sha256: "4eb461e0a38d7be69a52b8faf7664493da4e4cabc2c4fa86bd672d2e8f0a9311" diff --git a/recipes/magnum-integration/all/conanfile.py b/recipes/magnum-integration/all/conanfile.py new file mode 100644 index 0000000000000..9bc11fde53f72 --- /dev/null +++ b/recipes/magnum-integration/all/conanfile.py @@ -0,0 +1,171 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration, ConanException +import functools +import os + +required_conan_version = ">=1.43.0" + + +class MagnumIntegrationConan(ConanFile): + name = "magnum-integration" + description = "Integration libraries for the Magnum C++11/C++14 graphics engine" + license = "MIT" + topics = ("magnum", "graphics", "rendering", "3d", "2d", "opengl") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://magnum.graphics" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_bullet": [True, False], + "with_dart": [True, False], + "with_eigen": [True, False], + "with_glm": [True, False], + "with_imgui": [True, False], + "with_ovr": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_bullet": True, + "with_dart": False, + "with_eigen": True, + "with_glm": True, + "with_imgui": True, + "with_ovr": False, + } + + exports_sources = "CMakeLists.txt" + generators = "cmake", "cmake_find_package" + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("magnum/{}".format(self.version)) + if self.options.with_bullet: + self.requires("bullet3/3.22a") + if self.options.with_eigen: + self.requires("eigen/3.4.0") + if self.options.with_glm: + self.requires("glm/0.9.9.8") + if self.options.with_imgui: + self.requires("imgui/1.87") + + def validate(self): + if self.options.with_dart: + # FIXME: Add 'dart' requirement + raise ConanInvalidConfiguration("DART library is not available in ConanCenter (yet)") + if self.options.with_ovr: + # FIXME: Add 'ovr' requirement + raise ConanInvalidConfiguration("OVR library is not available in ConanCenter (yet)") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_STATIC"] = not self.options.shared + cmake.definitions["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", True) + cmake.definitions["BUILD_TESTS"] = False + cmake.definitions["BUILD_GL_TESTS"] = False + + cmake.definitions["WITH_BULLET"] = self.options.with_bullet + cmake.definitions["WITH_DART"] = self.options.with_dart + cmake.definitions["WITH_EIGEN"] = self.options.with_eigen + cmake.definitions["WITH_GLM"] = self.options.with_glm + cmake.definitions["WITH_IMGUI"] = self.options.with_imgui + cmake.definitions["WITH_OVR"] = self.options.with_ovr + + cmake.configure() + return cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + 'set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH})', + "") + # Casing + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "GlmIntegration", "CMakeLists.txt"), + "find_package(GLM REQUIRED)", + "find_package(glm REQUIRED)") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "GlmIntegration", "CMakeLists.txt"), + "GLM::GLM", + "glm::glm") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "ImGuiIntegration", "CMakeLists.txt"), + "find_package(ImGui REQUIRED Sources)", + "find_package(imgui REQUIRED Sources)") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "ImGuiIntegration", "CMakeLists.txt"), + "ImGui::ImGui", + "imgui::imgui") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "ImGuiIntegration", "CMakeLists.txt"), + "ImGui::Sources", + "") + + def build(self): + self._patch_sources() + + cm = self._configure_cmake() + cm.build() + + def package(self): + cm = self._configure_cmake() + cm.install() + + tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "MagnumIntegration") + self.cpp_info.names["cmake_find_package"] = "MagnumIntegration" + self.cpp_info.names["cmake_find_package_multi"] = "MagnumIntegration" + + lib_suffix = "-d" if self.settings.build_type == "Debug" else "" + + if self.options.with_bullet: + self.cpp_info.components["bullet"].set_property("cmake_target_name", "MagnumIntegration::Bullet") + self.cpp_info.components["bullet"].names["cmake_find_package"] = "Bullet" + self.cpp_info.components["bullet"].names["cmake_find_package_multi"] = "Bullet" + self.cpp_info.components["bullet"].libs = ["MagnumBulletIntegration{}".format(lib_suffix)] + self.cpp_info.components["bullet"].requires = ["magnum::magnum_main", "magnum::gl", "magnum::shaders", "bullet3::bullet3"] + + if self.options.with_dart: + raise ConanException("Recipe doesn't define this component 'dart'. Please contribute it") + + if self.options.with_eigen: + self.cpp_info.components["eigen"].set_property("cmake_target_name", "MagnumIntegration::Eigen") + self.cpp_info.components["eigen"].names["cmake_find_package"] = "Eigen" + self.cpp_info.components["eigen"].names["cmake_find_package_multi"] = "Eigen" + self.cpp_info.components["eigen"].requires = ["magnum::magnum_main", "eigen::eigen"] + + if self.options.with_glm: + self.cpp_info.components["glm"].set_property("cmake_target_name", "MagnumIntegration::Glm") + self.cpp_info.components["glm"].names["cmake_find_package"] = "Glm" + self.cpp_info.components["glm"].names["cmake_find_package_multi"] = "Glm" + self.cpp_info.components["glm"].libs = ["MagnumGlmIntegration{}".format(lib_suffix)] + self.cpp_info.components["glm"].requires = ["magnum::magnum_main", "glm::glm"] + + if self.options.with_imgui: + self.cpp_info.components["imgui"].set_property("cmake_target_name", "MagnumIntegration::ImGui") + self.cpp_info.components["imgui"].names["cmake_find_package"] = "ImGui" + self.cpp_info.components["imgui"].names["cmake_find_package_multi"] = "ImGui" + self.cpp_info.components["imgui"].libs = ["MagnumImGuiIntegration{}".format(lib_suffix)] + self.cpp_info.components["imgui"].requires = ["magnum::magnum_main", "magnum::gl", "magnum::shaders", "imgui::imgui"] + + if self.options.with_ovr: + raise ConanException("Recipe doesn't define this component 'ovr'. Please contribute it") diff --git a/recipes/magnum-integration/all/test_package/CMakeLists.txt b/recipes/magnum-integration/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f483ffbe1392 --- /dev/null +++ b/recipes/magnum-integration/all/test_package/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.11) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(MagnumIntegration REQUIRED) +set(CMAKE_CXX_STANDARD 11) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(WITH_BULLET) + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumIntegration::Bullet) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_BULLET) +endif() +if(WITH_DART) + message(FATAL_ERROR "Please, add test with DART") + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumIntegration::Dart) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_DART) +endif() +if(WITH_EIGEN) + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumIntegration::Eigen) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_EIGEN) +endif() +if(WITH_GLM) + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumIntegration::Glm) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_GLM) +endif() +if(WITH_IMGUI) + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumIntegration::ImGui) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_IMGUI) +endif() +if(WITH_OVR) + message(FATAL_ERROR "Please, add test with OVR") + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumIntegration::Ovr) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_OVR) +endif() diff --git a/recipes/magnum-integration/all/test_package/conanfile.py b/recipes/magnum-integration/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1d2d6f7e65f70 --- /dev/null +++ b/recipes/magnum-integration/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackage(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_BULLET"] = self.options["magnum-integration"].with_bullet + cmake.definitions["WITH_DART"] = self.options["magnum-integration"].with_dart + cmake.definitions["WITH_EIGEN"] = self.options["magnum-integration"].with_eigen + cmake.definitions["WITH_GLM"] = self.options["magnum-integration"].with_glm + cmake.definitions["WITH_IMGUI"] = self.options["magnum-integration"].with_imgui + cmake.definitions["WITH_OVR"] = self.options["magnum-integration"].with_ovr + 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 == "Emscripten": + bin_path = os.path.join("bin", "test_package.js") + self.run("node {}".format(bin_path), run_environment=True) diff --git a/recipes/magnum-integration/all/test_package/test_package.cpp b/recipes/magnum-integration/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..afd2f2d68e6f6 --- /dev/null +++ b/recipes/magnum-integration/all/test_package/test_package.cpp @@ -0,0 +1,72 @@ + +#include +#include + +#ifdef WITH_BULLET + #include "Magnum/BulletIntegration/Integration.h" + + void with_bullet() { + std::cout << "With Bullet\n"; + Magnum::Math::Vector3 a{btScalar(1.0), btScalar(2.0), btScalar(3.0)}; + btVector3 b{btScalar(1.0), btScalar(2.0), btScalar(3.0)}; + assert(Magnum::Math::Vector3{b} == a); + } +#endif + +#ifdef WITH_EIGEN + #include + #include "Magnum/EigenIntegration/Integration.h" + + void with_eigen() { + std::cout << "With Eigen\n"; + Magnum::Math::Quaternion q{}; + Eigen::Quaternion eq{q.scalar(), q.vector().x(), q.vector().y(), q.vector().z()}; + } +#endif + +#ifdef WITH_GLM + #include "Magnum/Magnum.h" + #include "Magnum/Math/Matrix3.h" + #include "Magnum/Math/Matrix4.h" + #include "Magnum/GlmIntegration/Integration.h" + + void with_glm() { + std::cout << "With GLM\n"; + Magnum::Math::BoolVector<2> a{0x6}; + glm::bvec2 b{false, true}; + assert(glm::bvec2(a) == b); + } +#endif + +#ifdef WITH_IMGUI + #include + #include + #include "Magnum/ImGuiIntegration/Integration.h" + + void with_imgui() { + std::cout << "With ImGui\n"; + ImVec2 imVec2{1.1f, 1.2f}; + Magnum::Vector2 vec2(1.1f, 1.2f); + assert(Magnum::Vector2{imVec2} == vec2); + } +#endif + +int main() { + #ifdef WITH_BULLET + with_bullet(); + #endif + + #ifdef WITH_EIGEN + with_eigen(); + #endif + + #ifdef WITH_GLM + with_glm(); + #endif + + #ifdef WITH_IMGUI + with_imgui(); + #endif + + return 0; +} diff --git a/recipes/magnum-integration/config.yml b/recipes/magnum-integration/config.yml new file mode 100644 index 0000000000000..93230781a72ea --- /dev/null +++ b/recipes/magnum-integration/config.yml @@ -0,0 +1,3 @@ +versions: + "2020.06": + folder: all diff --git a/recipes/magnum-plugins/all/CMakeLists.txt b/recipes/magnum-plugins/all/CMakeLists.txt new file mode 100644 index 0000000000000..315c0afaf5005 --- /dev/null +++ b/recipes/magnum-plugins/all/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +set(CONAN_CMAKE_SILENT_OUTPUT 1) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +# The original project uses the path to the 'magnum' package, in Conan we cannot modify existing package +set(MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/magnum-d) +set(MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/magnum-d) +set(MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/magnum) +set(MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/magnum) +set(MAGNUM_PLUGINS_FONT_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONT_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONT_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONT_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMPORTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_IMPORTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_IMPORTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_IMPORTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/sceneconverters) +set(MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/sceneconverters) +set(MAGNUM_PLUGINS_SCENECONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/sceneconverters) +set(MAGNUM_PLUGINS_SCENECONVERTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/sceneconverters) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/audioimporters) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/audioimporters) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/audioimporters) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/audioimporters) + +set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/Magnum) +set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/MagnumExternal) +set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/MagnumPlugins) + +add_subdirectory("source_subfolder") diff --git a/recipes/magnum-plugins/all/cmake/conan-bugfix-global-target.cmake b/recipes/magnum-plugins/all/cmake/conan-bugfix-global-target.cmake new file mode 100644 index 0000000000000..c0510f74c3f8b --- /dev/null +++ b/recipes/magnum-plugins/all/cmake/conan-bugfix-global-target.cmake @@ -0,0 +1,24 @@ +# If using 'cmake_find_package', all the components are being added to the global +# target unconditionally. See generated FindMagnumPlugins.cmake file: +# +# if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0") +# if(NOT TARGET MagnumPlugins::MagnumPlugins) +# add_library(MagnumPlugins::MagnumPlugins INTERFACE IMPORTED) +# endif() +# set_property(TARGET MagnumPlugins::MagnumPlugins APPEND PROPERTY +# INTERFACE_LINK_LIBRARIES "${MagnumPlugins_COMPONENTS}") +# endif() +# +# but it doesn't add the library directories and the linker will fail. +# +# Here we fix this bug (breaking change) for this recipe, we just override +# the list of targets again. +# + + +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0") + if(TARGET MagnumPlugins::MagnumPlugins) + set_target_properties(MagnumPlugins::MagnumPlugins PROPERTIES INTERFACE_LINK_LIBRARIES + "${MagnumPlugins_MagnumPlugins_LINK_LIBS};${MagnumPlugins_MagnumPlugins_LINKER_FLAGS_LIST}") + endif() +endif() diff --git a/recipes/magnum-plugins/all/conandata.yml b/recipes/magnum-plugins/all/conandata.yml new file mode 100644 index 0000000000000..1d75399fc10a4 --- /dev/null +++ b/recipes/magnum-plugins/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "2020.06": + url: "https://github.com/mosra/magnum-plugins/archive/refs/tags/v2020.06.tar.gz" + sha256: "8650cab43570c826d2557d5b42459150d253316f7f734af8b3e7d0883510b40a" +patches: + "2020.06": + - base_path: "source_subfolder" + patch_file: "patches/2020.06/0001-emscripten-toolchain.patch" + # patch_type: "portability" + # description: "Remove unnecessary dependency on UseEmscripten" + # source: "https://github.com/mosra/magnum/issues/490" diff --git a/recipes/magnum-plugins/all/conanfile.py b/recipes/magnum-plugins/all/conanfile.py new file mode 100644 index 0000000000000..e321f11942dac --- /dev/null +++ b/recipes/magnum-plugins/all/conanfile.py @@ -0,0 +1,323 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration, ConanException +import os +import textwrap + +required_conan_version = ">=1.33.0" + + +class MagnumConan(ConanFile): + name = "magnum-plugins" + description = "Plugins for the Magnum C++11/C++14 graphics engine" + license = "MIT" + topics = ("magnum", "graphics", "rendering", "3d", "2d", "opengl") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://magnum.graphics" + + settings = "os", "compiler", "build_type", "arch" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "shared_plugins": [True, False], + + "assimp_importer": [True, False], + "basis_imageconverter": [True, False], + "basis_importer": [True, False], + "dds_importer": [True, False], + "devil_imageimporter": [True, False], + "drflac_audioimporter": [True, False], + "drmp3_audioimporter": [True, False], + "drwav_audioimporter": [True, False], + "faad2_audioimporter": [True, False], + "freetype_font": [True, False], + "harfbuzz_font": [True, False], + "ico_importer": [True, False], + "jpeg_imageconverter": [True, False], + "jpeg_importer": [True, False], + "meshoptimizer_sceneconverter": [True, False], + "miniexr_imageconverter": [True, False], + "opengex_importer": [True, False], + "png_imageconverter": [True, False], + "png_importer": [True, False], + "primitive_importer": [True, False], + "stanford_importer": [True, False], + "stanford_sceneconverter": [True, False], + "stb_imageconverter": [True, False], + "stb_imageimporter": [True, False], + "stbtruetype_font": [True, False], + "stbvorbis_audioimporter": [True, False], + "stl_importer": [True, False], + "tinygltf_importer": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "shared_plugins": True, + + "assimp_importer": True, + "basis_imageconverter": False, + "basis_importer": False, + "dds_importer": True, + "devil_imageimporter": False, + "drflac_audioimporter": True, + "drmp3_audioimporter": True, + "drwav_audioimporter": True, + "faad2_audioimporter": False, + "freetype_font": True, + "harfbuzz_font": True, + "ico_importer": True, + "jpeg_imageconverter": True, + "jpeg_importer": True, + "meshoptimizer_sceneconverter": True, + "miniexr_imageconverter": True, + "opengex_importer": True, + "png_imageconverter": True, + "png_importer": True, + "primitive_importer": True, + "stanford_importer": True, + "stanford_sceneconverter": True, + "stb_imageconverter": True, + "stb_imageimporter": True, + "stbtruetype_font": True, + "stbvorbis_audioimporter": True, + "stl_importer": True, + "tinygltf_importer": True, + } + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + exports_sources = ["CMakeLists.txt", "cmake/*", "patches/*"] + + _cmake = None + short_paths = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + 'set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH})', + "") + assimp_importer_cmake_file = os.path.join(self._source_subfolder, "src", "MagnumPlugins", "AssimpImporter", "CMakeLists.txt") + tools.replace_in_file(assimp_importer_cmake_file, + "find_package(Assimp REQUIRED)", + "find_package(assimp REQUIRED)") + tools.replace_in_file(assimp_importer_cmake_file, + "Assimp::Assimp", + "assimp::assimp") + + harfbuzz_cmake_file = os.path.join(self._source_subfolder, "src", "MagnumPlugins", "HarfBuzzFont", "CMakeLists.txt") + tools.replace_in_file(harfbuzz_cmake_file, + "find_package(HarfBuzz REQUIRED)", + "find_package(harfbuzz REQUIRED)") + tools.replace_in_file(harfbuzz_cmake_file, + "HarfBuzz::HarfBuzz", + "harfbuzz::harfbuzz") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + if self.settings.os == "Emscripten": + self.options.shared_plugins = False + # FIXME: Transitive dep 'glib' is not prepared for Emscripten (https://github.com/emscripten-core/emscripten/issues/11066) + self.options.harfbuzz_font = False + # Audio is not provided by Magnum + self.options.drflac_audioimporter = False + self.options.drmp3_audioimporter = False + self.options.drwav_audioimporter = False + self.options.faad2_audioimporter = False + self.options.stbvorbis_audioimporter = False + # FIXME: Conan package fails for 'brotli' + self.options.freetype_font = False + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("magnum/{}".format(self.version)) + if self.options.assimp_importer: + self.requires("assimp/5.0.1") + if self.options.harfbuzz_font: + self.requires("harfbuzz/2.8.2") + if self.options.freetype_font: + self.requires("freetype/2.11.0") + if self.options.jpeg_importer or self.options.jpeg_imageconverter: + self.requires("libjpeg/9d") + if self.options.meshoptimizer_sceneconverter: + self.requires("meshoptimizer/0.15") + if self.options.png_imageconverter: + self.requires("libpng/1.6.37") + if self.options.basis_imageconverter or self.options.basis_importer: + raise ConanInvalidConfiguration("Requires 'basisuniversal', not available in ConanCenter yet") + if self.options.devil_imageimporter: + raise ConanInvalidConfiguration("Requires 'DevIL', not available in ConanCenter yet") + if self.options.faad2_audioimporter: + raise ConanInvalidConfiguration("Requires 'faad2', not available in ConanCenter yet") + + def build_requirements(self): + self.build_requires("corrade/{}".format(self.version)) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + if not self.options["magnum"].trade: + raise ConanInvalidConfiguration("Magnum Trade is required") + + # TODO: There are lot of things to check here: 'magnum::audio' required for audio plugins... + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False) + self._cmake.definitions["BUILD_PLUGINS_STATIC"] = not self.options.shared_plugins + self._cmake.definitions["LIB_SUFFIX"] = "" + self._cmake.definitions["BUILD_TESTS"] = False + + self._cmake.definitions["WITH_ASSIMPIMPORTER"] = self.options.assimp_importer + self._cmake.definitions["WITH_BASISIMAGECONVERTER"] = self.options.basis_imageconverter + self._cmake.definitions["WITH_BASISIMPORTER"] = self.options.basis_importer + self._cmake.definitions["WITH_DDSIMPORTER"] = self.options.dds_importer + self._cmake.definitions["WITH_DEVILIMAGEIMPORTER"] = self.options.devil_imageimporter + self._cmake.definitions["WITH_DRFLACAUDIOIMPORTER"] = self.options.drflac_audioimporter + self._cmake.definitions["WITH_DRMP3AUDIOIMPORTER"] = self.options.drmp3_audioimporter + self._cmake.definitions["WITH_DRWAVAUDIOIMPORTER"] = self.options.drwav_audioimporter + self._cmake.definitions["WITH_FAAD2AUDIOIMPORTER"] = self.options.faad2_audioimporter + self._cmake.definitions["WITH_FREETYPEFONT"] = self.options.freetype_font + self._cmake.definitions["WITH_HARFBUZZFONT"] = self.options.harfbuzz_font + self._cmake.definitions["WITH_ICOIMPORTER"] = self.options.ico_importer + self._cmake.definitions["WITH_JPEGIMAGECONVERTER"] = self.options.jpeg_imageconverter + self._cmake.definitions["WITH_JPEGIMPORTER"] = self.options.jpeg_importer + self._cmake.definitions["WITH_MESHOPTIMIZERSCENECONVERTER"] = self.options.meshoptimizer_sceneconverter + self._cmake.definitions["WITH_MINIEXRIMAGECONVERTER"] = self.options.miniexr_imageconverter + self._cmake.definitions["WITH_OPENGEXIMPORTER"] = self.options.opengex_importer + self._cmake.definitions["WITH_PNGIMAGECONVERTER"] = self.options.png_imageconverter + self._cmake.definitions["WITH_PNGIMPORTER"] = self.options.png_importer + self._cmake.definitions["WITH_PRIMITIVEIMPORTER"] = self.options.primitive_importer + self._cmake.definitions["WITH_STANFORDIMPORTER"] = self.options.stanford_importer + self._cmake.definitions["WITH_STANFORDSCENECONVERTER"] = self.options.stanford_sceneconverter + self._cmake.definitions["WITH_STBIMAGECONVERTER"] = self.options.stb_imageconverter + self._cmake.definitions["WITH_STBIMAGEIMPORTER"] = self.options.stb_imageimporter + self._cmake.definitions["WITH_STBTRUETYPEFONT"] = self.options.stbtruetype_font + self._cmake.definitions["WITH_STBVORBISAUDIOIMPORTER"] = self.options.stbvorbis_audioimporter + self._cmake.definitions["WITH_STLIMPORTER"] = self.options.stl_importer + self._cmake.definitions["WITH_TINYGLTFIMPORTER"] = self.options.tinygltf_importer + + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def build(self): + self._patch_sources() + + cm = self._configure_cmake() + cm.build() + + def package(self): + cm = self._configure_cmake() + cm.install() + + if not self.options.shared_plugins: + build_modules_folder = os.path.join(self.package_folder, "lib", "cmake") + os.makedirs(build_modules_folder) + for component, target, library, folder, deps in self._plugins: + build_module_path = os.path.join(build_modules_folder, "conan-magnum-plugins-{}.cmake".format(component)) + with open(build_module_path, "w+") as f: + f.write(textwrap.dedent("""\ + if(NOT ${{CMAKE_VERSION}} VERSION_LESS "3.0") + if(TARGET MagnumPlugins::{target}) + set_target_properties(MagnumPlugins::{target} PROPERTIES INTERFACE_SOURCES + "${{CMAKE_CURRENT_LIST_DIR}}/../../include/MagnumPlugins/{library}/importStaticPlugin.cpp") + endif() + endif() + """.format(target=target, library=library))) + + tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("*.cmake", src=os.path.join(self.source_folder, "cmake"), dst=os.path.join("lib", "cmake")) + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "MagnumPlugins" + self.cpp_info.names["cmake_find_package_multi"] = "MagnumPlugins" + + magnum_plugin_libdir = "magnum-d" if self.settings.build_type == "Debug" and self.options.shared_plugins else "magnum" + plugin_lib_suffix = "-d" if self.settings.build_type == "Debug" and not self.options.shared_plugins else "" + lib_suffix = "-d" if self.settings.build_type == "Debug" else "" + + self.cpp_info.components["magnumopenddl"].names["cmake_find_package"] = "MagnumOpenDdl" + self.cpp_info.components["magnumopenddl"].names["cmake_find_package_multi"] = "MagnumOpenDdl" + self.cpp_info.components["magnumopenddl"].libs = ["MagnumOpenDdl{}".format(lib_suffix)] + self.cpp_info.components["magnumopenddl"].requires = ["magnum::magnum"] + + # Plugins + if self.options.basis_imageconverter: + raise ConanException("Component not defined, please contribute it to the Conan recipe") + + if self.options.basis_importer: + raise ConanException("Component not defined, please contribute it to the Conan recipe") + + if self.options.devil_imageimporter: + raise ConanException("Component not defined, please contribute it to the Conan recipe") + + if self.options.faad2_audioimporter: + raise ConanException("Component not defined, please contribute it to the Conan recipe") + + # The global target doesn't provide anything in this package. Null it. + self.cpp_info.components["_global_target"].names["cmake_find_package"] = "MagnumPlugins" + self.cpp_info.components["_global_target"].names["cmake_find_package_multi"] = "MagnumPlugins" + self.cpp_info.components["_global_target"].build_modules["cmake_find_package"].append(os.path.join("lib", "cmake", "conan-bugfix-global-target.cmake")) + + # Add all the plugins + for component, target, library, folder, deps in self._plugins: + self.cpp_info.components[component].names["cmake_find_package"] = target + self.cpp_info.components[component].names["cmake_find_package_multi"] = target + self.cpp_info.components[component].libs = ["{}{}".format(library, plugin_lib_suffix)] + self.cpp_info.components[component].libdirs = [os.path.join(self.package_folder, "lib", magnum_plugin_libdir, folder)] + self.cpp_info.components[component].requires = deps + if not self.options.shared_plugins: + self.cpp_info.components[component].build_modules.append(os.path.join("lib", "cmake", "conan-magnum-plugins-{}.cmake".format(component))) + plugin_dir = "bin" if self.settings.os == "Windows" else "lib" + self.user_info.plugins_basepath = os.path.join(self.package_folder, plugin_dir, magnum_plugin_libdir) + + @property + def _plugins(self): + # (opt_name, (component, target, library, folder, deps)) + all_plugins = ( + ("assimp_importer", ("assimp_importer", "AssimpImporter", "AssimpImporter", "importers", ["magnum::trade", "assimp::assimp"])), + ("basis_imageconverter", ("basis_imageconverter", "--", "--", "--", [])), + ("basis_importer", ("basis_importer", "--", "--", "--", [])), + ("dds_importer", ("dds_importer", "DdsImporter", "DdsImporter", "importers", ["magnum::trade"])), + ("devil_imageimporter", ("devil_imageimporter", "--", "--", "--", [])), + ("drflac_audioimporter", ("drflac_audioimporter", "DrFlacAudioImporter", "DrFlacAudioImporter", "audioimporters", ["magnum::audio"])), + ("drmp3_audioimporter", ("drmp3_audioimporter", "DrMp3AudioImporter", "DrMp3AudioImporter", "audioimporters", ["magnum::audio"])), + ("drwav_audioimporter", ("drwav_audioimporter", "DrWavAudioImporter", "DrWavAudioImporter", "audioimporters", ["magnum::audio"])), + ("faad2_audioimporter", ("faad2_audioimporter", "--", "--", "--", [])), + ("freetype_font", ("freetype_font", "FreeTypeFont", "FreeTypeFont", "fonts", ["magnum::text", "freetype::freetype"])), + ("harfbuzz_font", ("harfbuzz_font", "HarfBuzzFont", "HarfBuzzFont", "fonts", ["magnum::text", "harfbuzz::harfbuzz"])), + ("jpeg_imageconverter", ("jpeg_imageconverter", "JpegImageConverter", "JpegImageConverter", "imageconverters", ["magnum::trade", "libjpeg::libjpeg"])), + ("jpeg_importer", ("jpeg_importer", "JpegImporter", "JpegImporter", "importers", ["magnum::trade", "libjpeg::libjpeg"])), + ("meshoptimizer_sceneconverter", ("meshoptimizer_sceneconverter", "MeshOptimizerSceneConverter", "MeshOptimizerSceneConverter", "sceneconverters", ["magnum::trade", "magnum::mesh_tools", "meshoptimizer::meshoptimizer"])), + ("miniexr_imageconverter", ("miniexr_imageconverter", "MiniExrImageConverter", "MiniExrImageConverter", "imageconverters", ["magnum::trade"])), + ("opengex_importer", ("opengex_importer", "OpenGexImporter", "OpenGexImporter", "importers", ["magnum::trade", "magnumopenddl", "magnum::any_image_importer"])), + ("png_importer", ("png_importer", "PngImporter", "PngImporter", "importers", ["magnum::trade", "libpng::libpng"])), + ("png_imageconverter", ("png_imageconverter", "PngImageConverter", "PngImageConverter", "imageconverters", ["magnum::trade"])), + ("primitive_importer", ("primitive_importer", "PrimitiveImporter", "PrimitiveImporter", "importers", ["magnum::primitives", "magnum::trade"])), + ("stanford_importer", ("stanford_importer", "StanfordImporter", "StanfordImporter", "importers", ["magnum::mesh_tools", "magnum::trade"])), + ("stanford_sceneconverter", ("stanford_sceneconverter", "StanfordSceneConverter", "StanfordSceneConverter", "sceneconverters", ["magnum::mesh_tools", "magnum::trade"])), + ("stb_imageconverter", ("stb_imageconverter", "StbImageConverter", "StbImageConverter", "imageconverters", ["magnum::trade"])), + ("stb_imageimporter", ("stb_imageimporter", "StbImageImporter", "StbImageImporter", "importers", ["magnum::trade"])), + ("stbtruetype_font", ("stbtruetype_font", "StbTrueTypeFont", "StbTrueTypeFont", "fonts", ["magnum::text"])), + ("stbvorbis_audioimporter", ("stbvorbis_audioimporter", "StbVorbisAudioImporter", "StbVorbisAudioImporter", "audioimporters", ["magnum::audio"])), + ("tinygltf_importer", ("tinygltf_importer", "TinyGltfImporter", "TinyGltfImporter", "importers", ["magnum::trade", "magnum::any_image_importer"])), + ("stl_importer", ("stl_importer", "StlImporter", "StlImporter", "importers", ["magnum::mesh_tools", "magnum::trade"])), + ) + return [plugin for opt_name, plugin in all_plugins if self.options.get_safe(opt_name)] diff --git a/recipes/magnum-plugins/all/patches/2020.06/0001-emscripten-toolchain.patch b/recipes/magnum-plugins/all/patches/2020.06/0001-emscripten-toolchain.patch new file mode 100644 index 0000000000000..8f3c18b38cd2e --- /dev/null +++ b/recipes/magnum-plugins/all/patches/2020.06/0001-emscripten-toolchain.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c85f70c..217427f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,10 +91,6 @@ elseif(CORRADE_TARGET_IOS OR CORRADE_TARGET_WINDOWS_RT) + set(BUILD_PLUGINS_STATIC ON) + endif() + +-if(CORRADE_TARGET_EMSCRIPTEN) +- include(UseEmscripten) +-endif() +- + if(BUILD_TESTS) + find_package(Corrade REQUIRED TestSuite) + if(CORRADE_TARGET_IOS) diff --git a/recipes/magnum-plugins/all/test_package/CMakeLists.txt b/recipes/magnum-plugins/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3ae91f1bb266f --- /dev/null +++ b/recipes/magnum-plugins/all/test_package/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.11) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(SHARED_PLUGINS) + find_package(MagnumPlugins REQUIRED) +else() + find_package(MagnumPlugins REQUIRED StlImporter) +endif() + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/configure.h) + +add_executable(${PROJECT_NAME} test_package.cpp) +# Intentionally linking with the global 'MagnumPlugins::MagnumPlugins' target, I want to check it is a valid target (although it might be empty) +target_link_libraries(${PROJECT_NAME} PRIVATE Magnum::Trade MagnumPlugins::MagnumPlugins) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +if(NOT SHARED_PLUGINS) + target_link_libraries(${PROJECT_NAME} PRIVATE MagnumPlugins::StlImporter) +endif() +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) + +if(TARGET_EMSCRIPTEN) + message("Embed OBJ file") + set_target_properties(${PROJECT_NAME} + PROPERTIES + LINK_FLAGS "--embed-file ${CONAN_STL_FILE}@${CONAN_STL_FILE}" + ) +endif() diff --git a/recipes/magnum-plugins/all/test_package/conan.stl b/recipes/magnum-plugins/all/test_package/conan.stl new file mode 100644 index 0000000000000000000000000000000000000000..2c3b057418d79884ef44ecd39d8770f48a38462a GIT binary patch literal 9084 zcmb_hO=w+36ds}$7Z0gYkr0XjaqYS)x$iy&rCo|rx~STnS|qqo5UbBhu@J$98>wlC zpl*axq*!#3_d+7*LR<)fwn2&&MZt8@E<}pnZ_fSh`R2~OZ)FzkN9KHUe&@`Yn-Kor zp9^ujapAizjzYM$8Nzb)KQUG#F75XrWQ=;Hi(z|@C$3|?+W%V3AjWFM)tddxWYkh* zz}jDbSSYT}ABuV&*!igZ?s@Zx zOiI}<-)5-PsXw>M&(6-rokF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&-;X=~-d! z@V|8*c53Z#u#jIVQik3#dcSJdP8m9}s19YP41Hm<`VcGCoicPUl}b--9o-FZ)k9*$ zDvfR*L#2qdN}yp}XiU^XjRGY3GcGh%v4C5-rmPhDPpw>etXVs#lIS;wUFe` zxZpep1}6(()^4stSCqkT=^>ca}V z#B7H8q5CS^ZGz{lYSZqs2v0$7l}~q=WSjw?y1&WrRgJy)`n7#^CUU#R1>cr!sg$jZ z)DN{pEmVfiRB63>9lJbYrB?9`*tRfbXsndMm!+|tgR|~2Nu}cN>+f^Q(D|xnM=77L zkSG6v4)@S!L!H9g4Bj$kuSb-(T9+R#rTTgq)x1d0b-EA1^W;7NVZwAqDn;FGhI@+@ zMq#!Nm-1?#&0wbV`$g)L+ST|`Wvwmc{*hsGwff<>IgfECGVs6kUH*Mgy97EaUPXBZ z(K+$A6s)L}vQr)W(hP=5q32U~%FtV1^(i}L=>4Hmsyk)q*;akZP8pn7+J1o19V^wL z`|3`q4!u)#UuCBZ-r=xH*}$02@%xmad#RMN$>4j9)t=T;T4Us(uCzz#%&48n<-y?e zYWDJ^w!a8F$NnnQo<)t#lh*b;?R_q#`F9PliW4OEO{JWjGBoFi58t&Z+c~kfH#a1| Ko{Jx);r{@8)glf6 literal 0 HcmV?d00001 diff --git a/recipes/magnum-plugins/all/test_package/conanfile.py b/recipes/magnum-plugins/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0f32ed1a04aad --- /dev/null +++ b/recipes/magnum-plugins/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackage(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions["IMPORTER_PLUGINS_FOLDER"] = os.path.join(self.deps_user_info["magnum-plugins"].plugins_basepath, "importers").replace("\\", "/") + # STL file taken from https://www.thingiverse.com/thing:2798332 + cmake.definitions["CONAN_STL_FILE"] = os.path.join(self.source_folder, "conan.stl").replace("\\", "/") + cmake.definitions["SHARED_PLUGINS"] = self.options["magnum-plugins"].shared_plugins + cmake.definitions["TARGET_EMSCRIPTEN"] = bool(self.settings.os == "Emscripten") + 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 == "Emscripten": + bin_path = os.path.join("bin", "test_package.js") + self.run("node {}".format(bin_path), run_environment=True) diff --git a/recipes/magnum-plugins/all/test_package/configure.h.in b/recipes/magnum-plugins/all/test_package/configure.h.in new file mode 100644 index 0000000000000..b1e33dc1f4f4c --- /dev/null +++ b/recipes/magnum-plugins/all/test_package/configure.h.in @@ -0,0 +1,4 @@ + + +#cmakedefine IMPORTER_PLUGINS_FOLDER "${IMPORTER_PLUGINS_FOLDER}" +#cmakedefine CONAN_STL_FILE "${CONAN_STL_FILE}" diff --git a/recipes/magnum-plugins/all/test_package/test_package.cpp b/recipes/magnum-plugins/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65c01dcb6da3c --- /dev/null +++ b/recipes/magnum-plugins/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include +#include + +#include "configure.h" + +int main() { + Corrade::PluginManager::Manager manager{IMPORTER_PLUGINS_FOLDER}; + manager.load("StlImporter"); + auto importer = manager.instantiate("StlImporter"); + + if(!importer) Magnum::Fatal{} << "Cannot load the StlImporter plugin"; + + importer->openFile(CONAN_STL_FILE); + std::cout << "Mesh count: " << importer->meshCount() << "\n"; + return 0; +} diff --git a/recipes/magnum-plugins/config.yml b/recipes/magnum-plugins/config.yml new file mode 100644 index 0000000000000..93230781a72ea --- /dev/null +++ b/recipes/magnum-plugins/config.yml @@ -0,0 +1,3 @@ +versions: + "2020.06": + folder: all diff --git a/recipes/magnum/all/CMakeLists.txt b/recipes/magnum/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/magnum/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/magnum/all/cmake/conan-bugfix-global-target.cmake b/recipes/magnum/all/cmake/conan-bugfix-global-target.cmake new file mode 100644 index 0000000000000..b102d8e6d518b --- /dev/null +++ b/recipes/magnum/all/cmake/conan-bugfix-global-target.cmake @@ -0,0 +1,24 @@ +# If using 'cmake_find_package', all the components are being added to the global +# target unconditionally. See generated FindMagnum.cmake file: +# +# if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0") +# if(NOT TARGET Magnum::Magnum) +# add_library(Magnum::Magnum INTERFACE IMPORTED) +# endif() +# set_property(TARGET Magnum::Magnum APPEND PROPERTY +# INTERFACE_LINK_LIBRARIES "${Magnum_COMPONENTS}") +# endif() +# +# but it doesn't add the library directories and the linker will fail. +# +# Here we fix this bug (breaking change) for this recipe, we just override +# the list of targets again. +# + + +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0") + if(TARGET Magnum::Magnum) + set_target_properties(Magnum::Magnum PROPERTIES INTERFACE_LINK_LIBRARIES + "${Magnum_Magnum_LINK_LIBS};${Magnum_Magnum_LINKER_FLAGS_LIST}") + endif() +endif() diff --git a/recipes/magnum/all/cmake/conan-magnum-vars.cmake b/recipes/magnum/all/cmake/conan-magnum-vars.cmake new file mode 100644 index 0000000000000..4364855e99fa4 --- /dev/null +++ b/recipes/magnum/all/cmake/conan-magnum-vars.cmake @@ -0,0 +1,25 @@ + +# Here we are reproducing the variables and call performed by the FindMagnum.cmake provided by the library + +# Read flags from configuration +file(READ "${CMAKE_CURRENT_LIST_DIR}/../../include/Magnum/configure.h" _magnumConfigure) +string(REGEX REPLACE ";" "\\\\;" _magnumConfigure "${_magnumConfigure}") +string(REGEX REPLACE "\n" ";" _magnumConfigure "${_magnumConfigure}") +set(_magnumFlags + BUILD_DEPRECATED + BUILD_STATIC + BUILD_STATIC_UNIQUE_GLOBALS + TARGET_GL + TARGET_GLES + TARGET_GLES2 + TARGET_GLES3 + TARGET_DESKTOP_GLES + TARGET_WEBGL + TARGET_HEADLESS + TARGET_VK) +foreach(_magnumFlag ${_magnumFlags}) + list(FIND _magnumConfigure "#define MAGNUM_${_magnumFlag}" _magnum_${_magnumFlag}) + if(NOT _magnum_${_magnumFlag} EQUAL -1) + set(MAGNUM_${_magnumFlag} 1) + endif() +endforeach() diff --git a/recipes/magnum/all/conandata.yml b/recipes/magnum/all/conandata.yml new file mode 100644 index 0000000000000..65803e3bd15c6 --- /dev/null +++ b/recipes/magnum/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2020.06": + url: "https://github.com/mosra/magnum/archive/refs/tags/v2020.06.tar.gz" + sha256: "98dfe802e56614e4e6bf750d9b693de46a5ed0c6eb479b0268f1a20bf34268bf" diff --git a/recipes/magnum/all/conanfile.py b/recipes/magnum/all/conanfile.py new file mode 100644 index 0000000000000..5ce18b70232f6 --- /dev/null +++ b/recipes/magnum/all/conanfile.py @@ -0,0 +1,708 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os +import re +import textwrap + +required_conan_version = ">=1.43.0" + + +class MagnumConan(ConanFile): + name = "magnum" + description = "Lightweight and modular C++11/C++14 graphics middleware for games and data visualization" + license = "MIT" + topics = ("magnum", "graphics", "middleware", "graphics", "rendering", "gamedev", "opengl", "3d", "2d", "opengl", "game-engine") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://magnum.graphics" + + settings = "os", "compiler", "build_type", "arch" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "shared_plugins": [True, False], + + # Follow documented build-options in https://doc.magnum.graphics/magnum/building.html#building-features + # Options like `with_xxxx` have been renamed to `xxxx` + # Options related to GL are being refactored into a choice option: gles2, gles3 or desktop_gl + # Some documented options are not available in sources: with_shaderstools, vk_info, with_shaderconverter and with_anyshaderconverter + # Option names are converted to snake_case + + "target_gl": ["gles2", "gles3", "desktop_gl", False], + "target_headless": [True, False], + "target_vk": [True, False], + + "audio": [True, False], + "debug_tools": [True, False], + "gl": [True, False], + "mesh_tools": [True, False], + "primitives": [True, False], + "scene_graph": [True, False], + "shaders": [True, False], + "text": [True, False], + "texture_tools": [True, False], + "trade": [True, False], + "vk": [True, False], + + "android_application": [True, False], + "emscripten_application": [True, False], + "glfw_application": [True, False], + "glx_application": [True, False], + "sdl2_application": [True, False], + "xegl_application": [True, False], + "windowless_cgl_application": [True, False], + "windowless_egl_application": [True, False], + "windowless_glx_application": [True, False], + "windowless_ios_application": [True, False], + "windowless_wgl_application": [True, False], + "windowless_windows_egl_application": [True, False], + + "cgl_context": [True, False], + "egl_context": [True, False], + "glx_context": [True, False], + "wgl_context": [True, False], + + "gl_info": [True, False], + "al_info": [True, False], + "distance_field_converter": [True, False], + "font_converter": [True, False], + "image_converter": [True, False], + "scene_converter": [True, False], + + # Plugins + "any_audio_importer": [True, False], + "any_image_converter": [True, False], + "any_image_importer": [True, False], + "any_scene_converter": [True, False], + "any_scene_importer": [True, False], + "magnum_font": [True, False], + "magnum_font_converter": [True, False], + "obj_importer": [True, False], + "tga_importer": [True, False], + "tga_image_converter": [True, False], + "wav_audio_importer": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "shared_plugins": True, + + "target_gl": "desktop_gl", + "target_headless": True, + "target_vk": True, + + "audio": True, + "debug_tools": True, + "gl": True, + "mesh_tools": True, + "primitives": True, + "scene_graph": True, + "shaders": True, + "text": True, + "texture_tools": True, + "trade": True, + "vk": True, + + "android_application": True, + "emscripten_application": True, + "glfw_application": True, + "glx_application": True, + "sdl2_application": True, + "xegl_application": True, + "windowless_cgl_application": True, + "windowless_egl_application": True, + "windowless_glx_application": True, + "windowless_ios_application": True, + "windowless_wgl_application": True, + "windowless_windows_egl_application": True, + + "cgl_context": True, + "egl_context": True, + "glx_context": True, + "wgl_context": True, + + "gl_info": True, + "al_info": True, + "distance_field_converter": True, + "font_converter": True, + "image_converter": True, + "scene_converter": True, + + # Plugins + "any_audio_importer": True, + "any_image_converter": True, + "any_image_importer": True, + "any_scene_converter": True, + "any_scene_importer": True, + "magnum_font": True, + "magnum_font_converter": True, + "obj_importer": True, + "tga_importer": True, + "tga_image_converter": True, + "wav_audio_importer": True, + } + + short_paths = True + generators = "cmake", "cmake_find_package" + exports_sources = ["CMakeLists.txt", "cmake/*"] + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + # Doc says that 'distance_field_converter' is only available with "desktop GL" (the same is said for 'font_converter', but it builds) + # TODO: Here we probably have a CHOICE OPTION + if self.options.target_gl in ["gles2", "gles3"]: + del self.options.distance_field_converter + + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.egl_context + del self.options.xegl_application + del self.options.windowless_egl_application + del self.options.windowless_ios_application + del self.options.windowless_glx_application + del self.options.windowless_windows_egl_application # requires ANGLE + del self.options.target_headless # Requires EGL (when used gl_info) + del self.options.glx_application + del self.options.cgl_context + del self.options.windowless_cgl_application + + if self.settings.os == "Linux": + del self.options.cgl_context + del self.options.windowless_cgl_application + del self.options.wgl_context + del self.options.windowless_wgl_application + del self.options.windowless_windows_egl_application + + if self.settings.os == "Macos": + del self.options.egl_context + del self.options.glx_application # Requires GL/glx.h (maybe XQuartz project) + del self.options.xegl_application + del self.options.windowless_egl_application + del self.options.windowless_glx_application # Requires GL/glx.h (maybe XQuartz project) + del self.options.windowless_wgl_application + del self.options.windowless_windows_egl_application + del self.options.target_headless # Requires EGL (when used gl_info) + + if self.settings.os != "Android": + del self.options.android_application + + if self.settings.os != "Emscripten": + del self.options.emscripten_application + + if self.settings.os != "iOS": + del self.options.windowless_ios_application + + @property + def _executables(self): + # (executable, option name) + all_execs = (("gl-info", "gl_info"), + ("al-info", "al_info"), + ("distancefieldconverter", "distance_field_converter"), + ("fontconverter", "font_converter"), + ("imageconverter", "image_converter"), + ("sceneconverter", "scene_converter")) + return [executable for executable, opt_name in all_execs if self.options.get_safe(opt_name)] + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("corrade/{}".format(self.version)) + if self.options.audio: + self.requires("openal/1.21.1") + if self.options.gl: + self.requires("opengl/system") + if self.options.vk: + self.requires("vulkan-loader/1.3.211.0") + + if self.options.get_safe("egl_context", False) or \ + self.options.get_safe("xegl_application", False) or \ + self.options.get_safe("windowless_egl_application", False) or \ + self.options.get_safe("windowless_ios_application") or \ + self.options.get_safe("windowless_windows_egl_application", False) or \ + self.options.get_safe("target_headless", False): + self.requires("egl/system") + + if self.options.glfw_application: + self.requires("glfw/3.3.7") + + if self.options.sdl2_application: + self.requires("sdl/2.0.20") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("GCC older than 5 is not supported (missing C++11 features)") + + if self.options.shared and not self.options["corrade"].shared: + # To fix issue with resource management, see here: https://github.com/mosra/magnum/issues/304#issuecomment-451768389 + raise ConanInvalidConfiguration("If using 'shared=True', corrade should be shared as well") + + if not self.options.gl and (self.options.target_gl or self.options.get_safe("target_headless", False)): + raise ConanInvalidConfiguration("Option 'gl=True' is required") + + if self.options.target_gl in ["gles2", "gles3"] and self.settings.os == "Macos": + raise ConanInvalidConfiguration("OpenGL ES is not supported in Macos") + + if self.options.target_gl in ["gles2", "gles3"] and self.settings.os == "Windows": + raise ConanInvalidConfiguration("OpenGL ES is not supported in Windows") + + if not self.options.vk and self.options.target_vk: + raise ConanInvalidConfiguration("Option 'vk=True' is required") + + if self.options.get_safe("cgl_context", False) and not self.options.target_gl: + raise ConanInvalidConfiguration("Option 'cgl_context' requires some 'target_gl'") + + if self.options.get_safe("windowless_cgl_application", False) and not self.options.target_gl: + raise ConanInvalidConfiguration("Option 'windowless_cgl_application' requires some 'target_gl'") + + if self.options.al_info and not self.options.audio: + raise ConanInvalidConfiguration("Option 'al_info' requires 'audio=True'") + + if self.options.magnum_font_converter and not self.options.tga_image_converter: + raise ConanInvalidConfiguration("magnum_font_converter requires tga_image_converter") + + def build_requirements(self): + self.build_requires("corrade/{}".format(self.version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_DEPRECATED"] = False + cmake.definitions["BUILD_STATIC"] = not self.options.shared + cmake.definitions["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False) + # cmake.definitions["BUILD_STATIC_UNIQUE_GLOBALS"] + cmake.definitions["BUILD_PLUGINS_STATIC"] = not self.options.shared_plugins + cmake.definitions["LIB_SUFFIX"] = "" + cmake.definitions["BUILD_TESTS"] = False + cmake.definitions["BUILD_GL_TESTS"] = False + cmake.definitions["BUILD_AL_TESTS"] = False + cmake.definitions["WITH_OPENGLTESTER"] = False + cmake.definitions["WITH_VULKANTESTER"] = False + + cmake.definitions["TARGET_GL"] = bool(self.options.target_gl) + cmake.definitions["TARGET_GLES"] = self.options.target_gl == "gles3" + cmake.definitions["TARGET_GLES2"] = self.options.target_gl == "gles2" + cmake.definitions["TARGET_DESKTOP_GLES"] = self.options.target_gl == "desktop_gl" + cmake.definitions["TARGET_HEADLESS"] = self.options.get_safe("target_headless", False) + cmake.definitions["TARGET_VK"] = self.options.target_vk + + cmake.definitions["WITH_AUDIO"] = self.options.audio + cmake.definitions["WITH_DEBUGTOOLS"] = self.options.debug_tools + cmake.definitions["WITH_GL"] = self.options.gl + cmake.definitions["WITH_MESHTOOLS"] = self.options.mesh_tools + cmake.definitions["WITH_PRIMITIVES"] = self.options.primitives + cmake.definitions["WITH_SCENEGRAPH"] = self.options.scene_graph + cmake.definitions["WITH_SHADERS"] = self.options.shaders + cmake.definitions["WITH_TEXT"] = self.options.text + cmake.definitions["WITH_TEXTURETOOLS"] = self.options.texture_tools + cmake.definitions["WITH_TRADE"] = self.options.trade + cmake.definitions["WITH_VK"] = self.options.vk + + cmake.definitions["WITH_ANDROIDAPPLICATION"] = self.options.get_safe("android_application", False) + cmake.definitions["WITH_EMSCRIPTENAPPLICATION"] = self.options.get_safe("emscripten_application", False) + cmake.definitions["WITH_GLFWAPPLICATION"] = self.options.glfw_application + cmake.definitions["WITH_GLXAPPLICATION"] = self.options.get_safe("glx_application", False) + cmake.definitions["WITH_SDL2APPLICATION"] = self.options.sdl2_application + cmake.definitions["WITH_XEGLAPPLICATION"] = self.options.get_safe("xegl_application", False) + cmake.definitions["WITH_WINDOWLESSCGLAPPLICATION"] = self.options.get_safe("windowless_cgl_application", False) + cmake.definitions["WITH_WINDOWLESSEGLAPPLICATION"] = self.options.get_safe("windowless_egl_application", False) + cmake.definitions["WITH_WINDOWLESSGLXAPPLICATION"] = self.options.get_safe("windowless_glx_application", False) + cmake.definitions["WITH_WINDOWLESSIOSAPPLICATION"] = self.options.get_safe("windowless_ios_application", False) + cmake.definitions["WITH_WINDOWLESSWGLAPPLICATION"] = self.options.get_safe("windowless_wgl_application", False) + cmake.definitions["WITH_WINDOWLESSWINDOWSEGLAPPLICATION"] = self.options.get_safe("windowless_windows_egl_application", False) + + cmake.definitions["WITH_CGLCONTEXT"] = self.options.get_safe("cgl_context", False) + cmake.definitions["WITH_EGLCONTEXT"] = self.options.get_safe("egl_context", False) + cmake.definitions["WITH_GLXCONTEXT"] = self.options.glx_context + cmake.definitions["WITH_WGLCONTEXT"] = self.options.get_safe("wgl_context", False) + + ##### Plugins related ##### + cmake.definitions["WITH_ANYAUDIOIMPORTER"] = self.options.any_audio_importer + cmake.definitions["WITH_ANYIMAGECONVERTER"] = self.options.any_image_converter + cmake.definitions["WITH_ANYIMAGEIMPORTER"] = self.options.any_image_importer + cmake.definitions["WITH_ANYSCENECONVERTER"] = self.options.any_scene_converter + cmake.definitions["WITH_ANYSCENEIMPORTER"] = self.options.any_scene_importer + cmake.definitions["WITH_MAGNUMFONT"] = self.options.magnum_font + cmake.definitions["WITH_MAGNUMFONTCONVERTER"] = self.options.magnum_font_converter + cmake.definitions["WITH_OBJIMPORTER"] = self.options.obj_importer + cmake.definitions["WITH_TGAIMPORTER"] = self.options.tga_importer + cmake.definitions["WITH_TGAIMAGECONVERTER"] = self.options.tga_image_converter + cmake.definitions["WITH_WAVAUDIOIMPORTER"] = self.options.wav_audio_importer + + #### Command line utilities #### + cmake.definitions["WITH_GL_INFO"] = self.options.gl_info + cmake.definitions["WITH_AL_INFO"] = self.options.al_info + cmake.definitions["WITH_DISTANCEFIELDCONVERTER"] = self.options.get_safe("distance_field_converter", False) + cmake.definitions["WITH_FONTCONVERTER"] = self.options.font_converter + cmake.definitions["WITH_IMAGECONVERTER"] = self.options.image_converter + cmake.definitions["WITH_SCENECONVERTER"] = self.options.scene_converter + + cmake.configure() + return cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + 'set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH})', + "") + # Get rid of cmake_dependent_option, it can activate features when we try to disable them, + # let the Conan user decide what to use and what not. + with open(os.path.join(self._source_subfolder, "CMakeLists.txt"), 'r+', encoding="utf-8") as f: + text = f.read() + text = re.sub(r'cmake_dependent_option(([0-9A-Z_]+) .*)', r'option(\1 "Option \1 disabled by Conan" OFF)', text) + f.seek(0) + f.write(text) + f.truncate() + + # GLFW naming + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "Platform", "CMakeLists.txt"), + "find_package(GLFW)", + "find_package(glfw3)") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "Platform", "CMakeLists.txt"), + "GLFW_FOUND", + "glfw3_FOUND") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "Platform", "CMakeLists.txt"), + "GLFW::GLFW", + "glfw") + + # EGL naming + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "Platform", "CMakeLists.txt"), + "find_package(EGL)", + "find_package(egl_system)") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "Platform", "CMakeLists.txt"), + "EGL_FOUND", + "egl_system_FOUND") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Magnum", "Platform", "CMakeLists.txt"), + "EGL::EGL", + "egl::egl") + + def build(self): + self._patch_sources() + + cm = self._configure_cmake() + cm.build() + + def package(self): + cm = self._configure_cmake() + cm.install() + + build_modules_folder = os.path.join(self.package_folder, "lib", "cmake") + os.makedirs(build_modules_folder) + for executable in self._executables: + build_module_path = os.path.join(build_modules_folder, "conan-magnum-{}.cmake".format(executable)) + with open(build_module_path, "w+", encoding="utf-8") as f: + f.write(textwrap.dedent("""\ + if(NOT TARGET Magnum::{exec}) + if(CMAKE_CROSSCOMPILING) + find_program(MAGNUM_EXEC_PROGRAM magnum-{exec} PATHS ENV PATH NO_DEFAULT_PATH) + endif() + if(NOT MAGNUM_EXEC_PROGRAM) + set(MAGNUM_EXEC_PROGRAM "${{CMAKE_CURRENT_LIST_DIR}}/../../bin/magnum-{exec}") + endif() + get_filename_component(MAGNUM_EXEC_PROGRAM "${{MAGNUM_EXEC_PROGRAM}}" ABSOLUTE) + add_executable(Magnum::{exec} IMPORTED) + set_property(TARGET Magnum::{exec} PROPERTY IMPORTED_LOCATION ${{MAGNUM_EXEC_PROGRAM}}) + endif() + """.format(exec=executable))) + + if not self.options.shared_plugins: + for component, target, library, _, _ in self._plugins: + build_module_path = os.path.join(build_modules_folder, "conan-magnum-plugins-{}.cmake".format(component)) + with open(build_module_path, "w+", encoding="utf-8") as f: + f.write(textwrap.dedent("""\ + if(NOT ${{CMAKE_VERSION}} VERSION_LESS "3.0") + if(TARGET Magnum::{target}) + set_target_properties(Magnum::{target} PROPERTIES INTERFACE_SOURCES + "${{CMAKE_CURRENT_LIST_DIR}}/../../include/MagnumPlugins/{library}/importStaticPlugin.cpp") + endif() + endif() + """.format(target=target, library=library))) + + tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("*.cmake", src=os.path.join(self.source_folder, "cmake"), dst=os.path.join("lib", "cmake")) + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Magnum") + self.cpp_info.names["cmake_find_package"] = "Magnum" + self.cpp_info.names["cmake_find_package_multi"] = "Magnum" + + magnum_plugin_libdir = "magnum-d" if self.settings.build_type == "Debug" and self.options.shared_plugins else "magnum" + plugin_lib_suffix = "-d" if self.settings.build_type == "Debug" and not self.options.shared_plugins else "" + lib_suffix = "-d" if self.settings.build_type == "Debug" else "" + + build_modules = [] + + # The FindMagnum.cmake file provided by the library populates some extra stuff + build_modules.append(os.path.join("lib", "cmake", "conan-magnum-vars.cmake")) + self.cpp_info.components["_magnum"].build_modules.append(os.path.join("lib", "cmake", "conan-magnum-vars.cmake")) + + # Magnum contains just the main library + self.cpp_info.components["magnum_main"].set_property("cmake_target_name", "Magnum::Magnum") + self.cpp_info.components["magnum_main"].names["cmake_find_package"] = "Magnum" + self.cpp_info.components["magnum_main"].names["cmake_find_package_multi"] = "Magnum" + self.cpp_info.components["magnum_main"].libs = ["Magnum{}".format(lib_suffix)] + self.cpp_info.components["magnum_main"].requires = ["_magnum", "corrade::utility"] + build_modules.append(os.path.join("lib", "cmake", "conan-bugfix-global-target.cmake")) + self.cpp_info.components["magnum_main"].build_modules["cmake_find_package"].append(os.path.join("lib", "cmake", "conan-bugfix-global-target.cmake")) + + # Audio + if self.options.audio: + self.cpp_info.components["audio"].set_property("cmake_target_name", "Magnum::Audio") + self.cpp_info.components["audio"].names["cmake_find_package"] = "Audio" + self.cpp_info.components["audio"].names["cmake_find_package_multi"] = "Audio" + self.cpp_info.components["audio"].libs = ["MagnumAudio{}".format(lib_suffix)] + self.cpp_info.components["audio"].requires = ["magnum_main", "corrade::plugin_manager", "openal::openal"] + if self.options.scene_graph: + self.cpp_info.components["audio"].requires += ["scene_graph"] + + # DebugTools + if self.options.debug_tools: + self.cpp_info.components["debug_tools"].set_property("cmake_target_name", "Magnum::DebugTools") + self.cpp_info.components["debug_tools"].names["cmake_find_package"] = "DebugTools" + self.cpp_info.components["debug_tools"].names["cmake_find_package_multi"] = "DebugTools" + self.cpp_info.components["debug_tools"].libs = ["MagnumDebugTools{}".format(lib_suffix)] + self.cpp_info.components["debug_tools"].requires = ["magnum_main"] + if self.options["corrade"].with_testsuite and self.options.trade: + self.cpp_info.components["debug_tools"].requires += ["corrade::test_suite", "trade"] + + # GL + if self.options.gl: + self.cpp_info.components["gl"].set_property("cmake_target_name", "Magnum::GL") + self.cpp_info.components["gl"].names["cmake_find_package"] = "GL" + self.cpp_info.components["gl"].names["cmake_find_package_multi"] = "GL" + self.cpp_info.components["gl"].libs = ["MagnumGL{}".format(lib_suffix)] + self.cpp_info.components["gl"].requires = ["magnum_main", "opengl::opengl"] + + # MeshTools + if self.options.mesh_tools: + self.cpp_info.components["mesh_tools"].set_property("cmake_target_name", "Magnum::MeshTools") + self.cpp_info.components["mesh_tools"].names["cmake_find_package"] = "MeshTools" + self.cpp_info.components["mesh_tools"].names["cmake_find_package_multi"] = "MeshTools" + self.cpp_info.components["mesh_tools"].libs = ["MagnumMeshTools{}".format(lib_suffix)] + self.cpp_info.components["mesh_tools"].requires = ["magnum_main", "trade", "gl"] + + # Primitives + if self.options.primitives: + self.cpp_info.components["primitives"].set_property("cmake_target_name", "Magnum::Primitives") + self.cpp_info.components["primitives"].names["cmake_find_package"] = "Primitives" + self.cpp_info.components["primitives"].names["cmake_find_package_multi"] = "Primitives" + self.cpp_info.components["primitives"].libs = ["MagnumPrimitives{}".format(lib_suffix)] + self.cpp_info.components["primitives"].requires = ["magnum_main", "mesh_tools", "trade"] + + # SceneGraph + if self.options.scene_graph: + self.cpp_info.components["scene_graph"].set_property("cmake_target_name", "Magnum::SceneGraph") + self.cpp_info.components["scene_graph"].names["cmake_find_package"] = "SceneGraph" + self.cpp_info.components["scene_graph"].names["cmake_find_package_multi"] = "SceneGraph" + self.cpp_info.components["scene_graph"].libs = ["MagnumSceneGraph{}".format(lib_suffix)] + self.cpp_info.components["scene_graph"].requires = ["magnum_main"] + + # Shaders + if self.options.shaders: + self.cpp_info.components["shaders"].set_property("cmake_target_name", "Magnum::Shaders") + self.cpp_info.components["shaders"].names["cmake_find_package"] = "Shaders" + self.cpp_info.components["shaders"].names["cmake_find_package_multi"] = "Shaders" + self.cpp_info.components["shaders"].libs = ["MagnumShaders{}".format(lib_suffix)] + self.cpp_info.components["shaders"].requires = ["magnum_main", "gl"] + + # Text + if self.options.text: + self.cpp_info.components["text"].set_property("cmake_target_name", "Magnum::Text") + self.cpp_info.components["text"].names["cmake_find_package"] = "Text" + self.cpp_info.components["text"].names["cmake_find_package_multi"] = "Text" + self.cpp_info.components["text"].libs = ["MagnumText{}".format(lib_suffix)] + self.cpp_info.components["text"].requires = ["magnum_main", "texture_tools", "corrade::plugin_manager", "gl"] + + # TextureTools + if self.options.texture_tools: + self.cpp_info.components["texture_tools"].set_property("cmake_target_name", "Magnum::TextureTools") + self.cpp_info.components["texture_tools"].names["cmake_find_package"] = "TextureTools" + self.cpp_info.components["texture_tools"].names["cmake_find_package_multi"] = "TextureTools" + self.cpp_info.components["texture_tools"].libs = ["MagnumTextureTools{}".format(lib_suffix)] + self.cpp_info.components["texture_tools"].requires = ["magnum_main"] + if self.options.gl: + self.cpp_info.components["texture_tools"].requires += ["gl"] + + # Trade + if self.options.trade: + self.cpp_info.components["trade"].set_property("cmake_target_name", "Magnum::Trade") + self.cpp_info.components["trade"].names["cmake_find_package"] = "Trade" + self.cpp_info.components["trade"].names["cmake_find_package_multi"] = "Trade" + self.cpp_info.components["trade"].libs = ["MagnumTrade{}".format(lib_suffix)] + self.cpp_info.components["trade"].requires = ["magnum_main", "corrade::plugin_manager"] + + # VK + if self.options.vk: + self.cpp_info.components["vk"].set_property("cmake_target_name", "Magnum::Vk") + self.cpp_info.components["vk"].names["cmake_find_package"] = "Vk" + self.cpp_info.components["vk"].names["cmake_find_package_multi"] = "Vk" + self.cpp_info.components["vk"].libs = ["MagnumVk{}".format(lib_suffix)] + self.cpp_info.components["vk"].requires = ["magnum_main", "vulkan-loader::vulkan-loader"] + + + #### APPLICATIONS #### + if self.options.get_safe("android_application", False): + raise Exception("Recipe doesn't define this component") + + if self.options.get_safe("emscripten_application", False): + raise Exception("Recipe doesn't define this component") + + if self.options.get_safe("windowless_ios_application", False): + raise Exception("Recipe doesn't define this component") + + if self.options.get_safe("glx_application", False): + self.cpp_info.components["glx_application"].set_property("cmake_target_name", "Magnum::GlxApplication") + self.cpp_info.components["glx_application"].names["cmake_find_package"] = "GlxApplication" + self.cpp_info.components["glx_application"].names["cmake_find_package_multi"] = "GlxApplication" + self.cpp_info.components["glx_application"].libs = ["MagnumGlxApplication{}".format(lib_suffix)] + self.cpp_info.components["glx_application"].requires = ["gl"] # TODO: Add x11 + + if self.options.glfw_application: + self.cpp_info.components["glfw_application"].set_property("cmake_target_name", "Magnum::GlfwApplication") + self.cpp_info.components["glfw_application"].names["cmake_find_package"] = "GlfwApplication" + self.cpp_info.components["glfw_application"].names["cmake_find_package_multi"] = "GlfwApplication" + self.cpp_info.components["glfw_application"].libs = ["MagnumGlfwApplication{}".format(lib_suffix)] + self.cpp_info.components["glfw_application"].requires = ["magnum_main", "glfw::glfw"] + if self.options.target_gl: + self.cpp_info.components["glfw_application"].requires.append("gl") + + if self.options.sdl2_application: + self.cpp_info.components["sdl2_application"].set_property("cmake_target_name", "Magnum::Sdl2Application") + self.cpp_info.components["sdl2_application"].names["cmake_find_package"] = "Sdl2Application" + self.cpp_info.components["sdl2_application"].names["cmake_find_package_multi"] = "Sdl2Application" + self.cpp_info.components["sdl2_application"].libs = ["MagnumSdl2Application{}".format(lib_suffix)] + self.cpp_info.components["sdl2_application"].requires = ["magnum_main", "sdl::sdl"] + if self.options.target_gl: + self.cpp_info.components["sdl2_application"].requires += ["gl"] + + if self.options.get_safe("xegl_application", False): + self.cpp_info.components["xegl_application"].set_property("cmake_target_name", "Magnum::XEglApplication") + self.cpp_info.components["xegl_application"].names["cmake_find_package"] = "XEglApplication" + self.cpp_info.components["xegl_application"].names["cmake_find_package_multi"] = "XEglApplication" + self.cpp_info.components["xegl_application"].libs = ["MagnumXEglApplication{}".format(lib_suffix)] + self.cpp_info.components["xegl_application"].requires = ["gl", "egl::egl"] # TODO: Add x11 + + if self.options.get_safe("windowless_cgl_application", False): + self.cpp_info.components["windowless_cgl_application"].set_property("cmake_target_name", "Magnum::WindowlessCglApplication") + self.cpp_info.components["windowless_cgl_application"].names["cmake_find_package"] = "WindowlessCglApplication" + self.cpp_info.components["windowless_cgl_application"].names["cmake_find_package_multi"] = "WindowlessCglApplication" + self.cpp_info.components["windowless_cgl_application"].libs = ["MagnumWindowlessCglApplication{}".format(lib_suffix)] + self.cpp_info.components["windowless_cgl_application"].requires = ["gl"] + + if self.options.get_safe("windowless_egl_application", False): + self.cpp_info.components["windowless_egl_application"].set_property("cmake_target_name", "Magnum::WindowlessEglApplication") + self.cpp_info.components["windowless_egl_application"].names["cmake_find_package"] = "WindowlessEglApplication" + self.cpp_info.components["windowless_egl_application"].names["cmake_find_package_multi"] = "WindowlessEglApplication" + self.cpp_info.components["windowless_egl_application"].libs = ["MagnumWindowlessEglApplication{}".format(lib_suffix)] + self.cpp_info.components["windowless_egl_application"].requires = ["gl", "egl::egl"] + + if self.options.get_safe("windowless_glx_application", False): + self.cpp_info.components["windowless_glx_application"].set_property("cmake_target_name", "Magnum::WindowlessGlxApplication") + self.cpp_info.components["windowless_glx_application"].names["cmake_find_package"] = "WindowlessGlxApplication" + self.cpp_info.components["windowless_glx_application"].names["cmake_find_package_multi"] = "WindowlessGlxApplication" + self.cpp_info.components["windowless_glx_application"].libs = ["MagnumWindowlessGlxApplication{}".format(lib_suffix)] + self.cpp_info.components["windowless_glx_application"].requires = ["gl"] # TODO: Add x11 + + if self.options.get_safe("windowless_wgl_application", False): + self.cpp_info.components["windowless_wgl_application"].set_property("cmake_target_name", "Magnum::WindowlessWglApplication") + self.cpp_info.components["windowless_wgl_application"].names["cmake_find_package"] = "WindowlessWglApplication" + self.cpp_info.components["windowless_wgl_application"].names["cmake_find_package_multi"] = "WindowlessWglApplication" + self.cpp_info.components["windowless_wgl_application"].libs = ["MagnumWindowlessWglApplication{}".format(lib_suffix)] + self.cpp_info.components["windowless_wgl_application"].requires = ["gl"] + + if self.options.get_safe("windowless_windows_egl_application", False): + raise Exception("Recipe doesn't define this component") + + # # If there is only one application, here it is an alias + # self.cpp_info.components["application"].names["cmake_find_package"] = "Application" + # self.cpp_info.components["application"].names["cmake_find_package_multi"] = "Application" + # self.cpp_info.components["application"].requires = ["sdl2_application"] + + #### CONTEXTS #### + if self.options.get_safe("cgl_context", False): + self.cpp_info.components["cgl_context"].set_property("cmake_target_name", "Magnum::CglContext") + self.cpp_info.components["cgl_context"].names["cmake_find_package"] = "CglContext" + self.cpp_info.components["cgl_context"].names["cmake_find_package_multi"] = "CglContext" + self.cpp_info.components["cgl_context"].libs = ["MagnumCglContext{}".format(lib_suffix)] + self.cpp_info.components["cgl_context"].requires = ["gl"] + + if self.options.get_safe("egl_context", False): + self.cpp_info.components["egl_context"].set_property("cmake_target_name", "Magnum::EglContext") + self.cpp_info.components["egl_context"].names["cmake_find_package"] = "EglContext" + self.cpp_info.components["egl_context"].names["cmake_find_package_multi"] = "EglContext" + self.cpp_info.components["egl_context"].libs = ["MagnumEglContext{}".format(lib_suffix)] + self.cpp_info.components["egl_context"].requires = ["gl", "egl::egl"] + + if self.options.glx_context: + self.cpp_info.components["glx_context"].set_property("cmake_target_name", "Magnum::GlxContext") + self.cpp_info.components["glx_context"].names["cmake_find_package"] = "GlxContext" + self.cpp_info.components["glx_context"].names["cmake_find_package_multi"] = "GlxContext" + self.cpp_info.components["glx_context"].libs = ["MagnumGlxContext{}".format(lib_suffix)] + self.cpp_info.components["glx_context"].requires = ["gl"] + + if self.options.get_safe("wgl_context", False): + self.cpp_info.components["wgl_context"].set_property("cmake_target_name", "Magnum::WglContext") + self.cpp_info.components["wgl_context"].names["cmake_find_package"] = "WglContext" + self.cpp_info.components["wgl_context"].names["cmake_find_package_multi"] = "WglContext" + self.cpp_info.components["wgl_context"].libs = ["MagnumWglContext{}".format(lib_suffix)] + self.cpp_info.components["wgl_context"].requires = ["gl"] + + + ######## PLUGINS ######## + for component, target, library, folder, deps in self._plugins: + self.cpp_info.components[component].set_property("cmake_target_name", f"Magnum::{target}") + self.cpp_info.components[component].names["cmake_find_package"] = target + self.cpp_info.components[component].names["cmake_find_package_multi"] = target + self.cpp_info.components[component].libs = ["{}{}".format(library, plugin_lib_suffix)] + self.cpp_info.components[component].libdirs = [os.path.join(self.package_folder, "lib", magnum_plugin_libdir, folder)] + self.cpp_info.components[component].requires = deps + if not self.options.shared_plugins: + build_modules.append(os.path.join("lib", "cmake", "conan-magnum-plugins-{}.cmake".format(component))) + self.cpp_info.components[component].build_modules.append(os.path.join("lib", "cmake", "conan-magnum-plugins-{}.cmake".format(component))) + plugin_dir = "bin" if self.settings.os == "Windows" else "lib" + self.user_info.plugins_basepath = os.path.join(self.package_folder, plugin_dir, magnum_plugin_libdir) + + #### EXECUTABLES #### + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + for executable in self._executables: + build_modules.append(os.path.join("lib", "cmake", "conan-magnum-{}.cmake".format(executable))) + self.cpp_info.components["_magnum"].build_modules.append(os.path.join("lib", "cmake", "conan-magnum-{}.cmake".format(executable))) + + # build modules for CMakeDeps + self.cpp_info.set_property("cmake_build_modules", build_modules) + + @property + def _plugins(self): + # (opt_name, (component, target, library, folder, deps)) + all_plugins = ( + ("any_audio_importer", ("any_audio_importer", "AnyAudioImporter", "AnyAudioImporter", "audioimporters", ["magnum_main", "audio"])), + ("any_image_converter", ("any_image_converter", "AnyImageConverter", "AnyImageConverter", "imageconverters", ["trade"])), + ("any_image_importer", ("any_image_importer", "AnyImageImporter", "AnyImageImporter", "importers", ["trade"])), + ("any_scene_converter", ("any_scene_converter", "AnySceneConverter", "AnySceneConverter", "sceneconverters", ["trade"])), + ("any_scene_importer", ("any_scene_importer", "AnySceneImporter", "AnySceneImporter", "importers", ["trade"])), + ("magnum_font", ("magnum_font", "MagnumFont", "MagnumFont", "fonts", ["magnum_main", "trade", "text"])), + ("magnum_font_converter", ("magnum_font_converter", "MagnumFontConverter", "MagnumFontConverter", "fontconverters", ["magnum_main", "trade", "text", "tga_image_converter"])), + ("obj_importer", ("obj_importer", "ObjImporter", "ObjImporter", "importers", ["trade", "mesh_tools"])), + ("tga_importer", ("tga_importer", "TgaImporter", "TgaImporter", "importers", ["trade"])), + ("tga_image_converter", ("tga_image_converter", "TgaImageConverter", "TgaImageConverter", "imageconverters", ["trade"])), + ("wav_audio_importer", ("wav_audio_importer", "WavAudioImporter", "WavAudioImporter", "audioimporters", ["magnum_main", "audio"])), + ) + return [plugin for opt_name, plugin in all_plugins if self.options.get_safe(opt_name)] diff --git a/recipes/magnum/all/test_package/CMakeLists.txt b/recipes/magnum/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..217f5102eb39f --- /dev/null +++ b/recipes/magnum/all/test_package/CMakeLists.txt @@ -0,0 +1,83 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(SHARED_PLUGINS) + find_package(Magnum REQUIRED CONFIG) +else() + find_package(Magnum REQUIRED ObjImporter CONFIG) +endif() + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/configure.h) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Magnum::Magnum Magnum::Trade) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +if(NOT SHARED_PLUGINS) + target_link_libraries(${PROJECT_NAME} PRIVATE Magnum::ObjImporter) +endif() +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) + + +# Run some executables (we can only be sure they exist if native build) +if (EXEC_GL_INFO AND NOT CMAKE_CROSSCOMPILING) + add_custom_command( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND Magnum::gl-info + ARGS "--help" + COMMENT "Running magnum-gl-info" + ) +endif() + +if (EXEC_AL_INFO AND NOT CMAKE_CROSSCOMPILING) + add_custom_command( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND Magnum::al-info + ARGS "--help" + COMMENT "Running magnum-al-info" + ) +endif() + +if (EXEC_DISTANCEFIELDCONVERTER_INFO AND NOT CMAKE_CROSSCOMPILING) + add_custom_command( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND Magnum::distancefieldconverter + ARGS "--help" + COMMENT "Running magnum-distancefieldconverter" + ) +endif() + +if (EXEC_FONTCONVERTER_INFO AND NOT CMAKE_CROSSCOMPILING) + add_custom_command( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND Magnum::fontconverter + ARGS "--help" + COMMENT "Running magnum-fontconverter" + ) +endif() + +if (EXEC_IMAGECONVERTER_INFO AND NOT CMAKE_CROSSCOMPILING) + add_custom_command( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND Magnum::imageconverter + ARGS "--help" + COMMENT "Running magnum-imageconverter" + ) +endif() + +if (EXEC_SCENECONVERTER_INFO AND NOT CMAKE_CROSSCOMPILING) + add_custom_command( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND Magnum::sceneconverter + ARGS "--help" + COMMENT "Running magnum-sceneconverter" + ) +endif() diff --git a/recipes/magnum/all/test_package/conanfile.py b/recipes/magnum/all/test_package/conanfile.py new file mode 100644 index 0000000000000..efbab832e396c --- /dev/null +++ b/recipes/magnum/all/test_package/conanfile.py @@ -0,0 +1,44 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + @property + def _executables(self): + available = [] + # (executable, option name) + all_execs = (("gl-info", "gl_info"), + ("al-info", "al_info"), + ("distancefieldconverter", "distance_field_converter"), + ("fontconverter", "font_converter"), + ("imageconverter", "image_converter"), + ("sceneconverter", "scene_converter")) + for executable, opt_name in all_execs: + try: + if getattr(self.options["magnum"], opt_name): + available.append(executable) + except ConanException: + pass + return available + + def build(self): + cmake = CMake(self) + for exec in self._executables: + cmake.definitions["EXEC_{}".format(exec.replace("-", "_")).upper()] = True + cmake.definitions["IMPORTER_PLUGINS_FOLDER"] = os.path.join(self.deps_user_info["magnum"].plugins_basepath, "importers").replace("\\", "/") + cmake.definitions["OBJ_FILE"] = os.path.join(self.source_folder, "triangleMesh.obj").replace("\\", "/") + cmake.definitions["SHARED_PLUGINS"] = self.options["magnum"].shared_plugins + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + for exec in self._executables: + self.run("magnum-{} --help".format(exec), run_environment=True) + + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/magnum/all/test_package/configure.h.in b/recipes/magnum/all/test_package/configure.h.in new file mode 100644 index 0000000000000..d722887f3f7c2 --- /dev/null +++ b/recipes/magnum/all/test_package/configure.h.in @@ -0,0 +1,3 @@ + +#cmakedefine IMPORTER_PLUGINS_FOLDER "${IMPORTER_PLUGINS_FOLDER}" +#cmakedefine OBJ_FILE "${OBJ_FILE}" diff --git a/recipes/magnum/all/test_package/test_package.cpp b/recipes/magnum/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c48671c928f5 --- /dev/null +++ b/recipes/magnum/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#include +#include "Magnum/Math/Vector.h" +#include "Magnum/Math/StrictWeakOrdering.h" +#include +#include + +#include "configure.h" + +/* + I would like to use some windowless application to test, like + https://github.com/mosra/magnum-bootstrap/tree/windowless + but it doesn't work in CI, it complains about EGL_NOT_INITIALIZED + (headless machine?) +*/ + +int main() { + // Test some basic Magnum + const Magnum::Math::Vector<2, Magnum::Float> v2a{1.0f, 2.0f}; + const Magnum::Math::Vector<2, Magnum::Float> v2b{2.0f, 3.0f}; + const Magnum::Math::Vector<2, Magnum::Float> v2c{1.0f, 3.0f}; + + Magnum::Math::StrictWeakOrdering o; + if (o(v2a, v2b)) { + std::cout << "Basic Magnum working\n"; + } + + // Test some plugin + Corrade::PluginManager::Manager manager{IMPORTER_PLUGINS_FOLDER}; + manager.load("ObjImporter"); + auto importer = manager.instantiate("ObjImporter"); + + if(!importer) Magnum::Fatal{} << "Cannot load the ObjImporter plugin"; + + importer->openFile(OBJ_FILE); + std::cout << "Mesh count: " << importer->meshCount() << "\n"; + return 0; +} diff --git a/recipes/magnum/all/test_package/triangleMesh.obj b/recipes/magnum/all/test_package/triangleMesh.obj new file mode 100644 index 0000000000000..32fb5196bfd6c --- /dev/null +++ b/recipes/magnum/all/test_package/triangleMesh.obj @@ -0,0 +1,9 @@ +# Positions +v 0.5 2 3 +v 0 1.5 1 +v 2 3 5.0 +v 2.5 0 1 + +# Triangles +f 1 2 3 +f 4 2 1 diff --git a/recipes/magnum/config.yml b/recipes/magnum/config.yml new file mode 100644 index 0000000000000..93230781a72ea --- /dev/null +++ b/recipes/magnum/config.yml @@ -0,0 +1,3 @@ +versions: + "2020.06": + folder: all diff --git a/recipes/mailio/all/conandata.yml b/recipes/mailio/all/conandata.yml new file mode 100644 index 0000000000000..068f2f54981f1 --- /dev/null +++ b/recipes/mailio/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.21.0": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.21.0.tar.gz" + sha256: "8f58dfc8bcbe01224c788f22c544c27611e3c411ed5a2097488fbb32a3c0fb3d" + "0.20.0": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.20.0.tar.gz" + sha256: "073d6b1ff891444b54a01c2a3f17074fd612f9e2e14d9ebd61863c70737b1882" +patches: + "0.21.0": + - patch_file: "patches/0.21.0-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" + "0.20.0": + - patch_file: "patches/0.20.0-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" diff --git a/recipes/mailio/all/conanfile.py b/recipes/mailio/all/conanfile.py new file mode 100644 index 0000000000000..67ea0faeba25f --- /dev/null +++ b/recipes/mailio/all/conanfile.py @@ -0,0 +1,109 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class MailioConan(ConanFile): + name = "mailio" + description = "mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols." + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/karastojko/mailio" + topics = ("smtp", "imap", "email", "mail", "libraries", "cpp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + short_paths = True + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8.3", + "clang": "6", + "Visual Studio": "15", + "msvc": "191", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0", transitive_headers=True) + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16.3 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["MAILIO_BUILD_SHARED_LIBRARY"] = self.options.shared + tc.variables["MAILIO_BUILD_DOCUMENTATION"] = False + tc.variables["MAILIO_BUILD_EXAMPLES"] = 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, 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", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["mailio"] + self.cpp_info.requires = ["boost::system", "boost::date_time", "boost::regex", "openssl::openssl"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/mailio/all/patches/0.20.0-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.20.0-adapt-cmakelists.patch new file mode 100644 index 0000000000000..4280975376b80 --- /dev/null +++ b/recipes/mailio/all/patches/0.20.0-adapt-cmakelists.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9cd343d..3fa8a34 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -142,7 +131,7 @@ install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgco + + configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp) + target_include_directories(${PROJECT_NAME} PUBLIC "${PROJECT_BINARY_DIR}") +-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) ++install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) + + # generate the export header for exporting symbols + # this is needed to generate a shared library. diff --git a/recipes/mailio/all/patches/0.21.0-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.21.0-adapt-cmakelists.patch new file mode 100644 index 0000000000000..8f2e693447e31 --- /dev/null +++ b/recipes/mailio/all/patches/0.21.0-adapt-cmakelists.patch @@ -0,0 +1,32 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 5c9cc6d..86d24fa 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -137,7 +137,7 @@ configure_file(mailio.pc.in ${CMAKE_BINARY_DIR}/mailio.pc IMMEDIATE @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + + configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp) +-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) ++install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) + + # generate the export header for exporting symbols + # this is needed to generate a shared library. +@@ -167,15 +167,15 @@ endif(MINGW) + install(DIRECTORY include/mailio DESTINATION ${INCLUDE_INSTALL_DIR}) + + install(TARGETS ${PROJECT_NAME} +- EXPORT ${PROJECT_NAME}Config ++ # EXPORT ${PROJECT_NAME}Config + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + ) + +-export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_NAME}Config.cmake) ++# export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_NAME}Config.cmake) + +-install(EXPORT ${PROJECT_NAME}Config DESTINATION share/${PROJECT_NAME}/cmake) ++# install(EXPORT ${PROJECT_NAME}Config DESTINATION share/${PROJECT_NAME}/cmake) + + # optionally build examples + if(${MAILIO_BUILD_EXAMPLES}) diff --git a/recipes/mailio/all/test_package/CMakeLists.txt b/recipes/mailio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..efd57b8a24474 --- /dev/null +++ b/recipes/mailio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mailio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mailio::mailio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mailio/all/test_package/conanfile.py b/recipes/mailio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/mailio/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/mailio/all/test_package/test_package.cpp b/recipes/mailio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ffc54c18c0369 --- /dev/null +++ b/recipes/mailio/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() { + mailio::message msg; + msg.from(mailio::mail_address("mailio library", "mailio@gmail.com")); + msg.add_recipient(mailio::mail_address("mailio library", "mailio@gmail.com")); + msg.subject("smtps simple message"); + msg.content("Hello, World!"); + + mailio::smtps conn("smtp.gmail.com", 587); + std::cout << msg.content() << "\n";; +} diff --git a/recipes/mailio/all/test_v1_package/CMakeLists.txt b/recipes/mailio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mailio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mailio/all/test_v1_package/conanfile.py b/recipes/mailio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mailio/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mailio/config.yml b/recipes/mailio/config.yml new file mode 100644 index 0000000000000..ad2748292fb8c --- /dev/null +++ b/recipes/mailio/config.yml @@ -0,0 +1,5 @@ +versions: + "0.21.0": + folder: all + "0.20.0": + folder: all diff --git a/recipes/make/all/conandata.yml b/recipes/make/all/conandata.yml new file mode 100644 index 0000000000000..fb6e6264363e7 --- /dev/null +++ b/recipes/make/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "4.3": + url: "http://ftpmirror.gnu.org/gnu/make/make-4.3.tar.gz" + sha256: "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19" + "4.2.1": + url: "http://ftpmirror.gnu.org/gnu/make/make-4.2.1.tar.bz2" + sha256: "d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589" +patches: + "4.3": + - patch_file: "patches/4.3-0001-clang.patch" + "4.2.1": + - patch_file: "patches/4.2.1-0001-clang.patch" diff --git a/recipes/make/all/conanfile.py b/recipes/make/all/conanfile.py new file mode 100644 index 0000000000000..ca2bde5638e0a --- /dev/null +++ b/recipes/make/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, VCVars +import os + +required_conan_version = ">=1.53.0" + + +class MakeConan(ConanFile): + name = "make" + description = ( + "GNU Make is a tool which controls the generation of executables and " + "other non-source files of a program from the program's source files" + ) + topics = ("make", "build", "makefile") + homepage = "https://www.gnu.org/software/make/" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + if self._settings_build.os != "Windows": + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + with chdir(self, self.source_folder): + # README.W32 + if self._settings_build.os == "Windows": + if is_msvc(self): + command = "build_w32.bat --without-guile" + else: + command = "build_w32.bat --without-guile gcc" + else: + autotools = Autotools(self) + autotools.configure() + command = "./build.sh" + self.run(command) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + for make_exe in ("make", "*gnumake.exe"): + copy(self, make_exe, src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + make = os.path.join(self.package_folder, "bin", "gnumake.exe" if self.settings.os == "Windows" else "make") + self.conf_info.define("tools.gnu:make_program", make) + + # TODO: to remove in conan v2 + self.user_info.make = make + self.env_info.CONAN_MAKE_PROGRAM = make + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/make/all/patches/4.2.1-0001-clang.patch b/recipes/make/all/patches/4.2.1-0001-clang.patch new file mode 100644 index 0000000000000..e1f8b63b75a0e --- /dev/null +++ b/recipes/make/all/patches/4.2.1-0001-clang.patch @@ -0,0 +1,11 @@ +--- glob/glob.c ++++ glob/glob.c +@@ -208,7 +208,7 @@ + #endif /* __GNU_LIBRARY__ || __DJGPP__ */ + + +-#if !defined __alloca && !defined __GNU_LIBRARY__ ++#if (!defined __alloca && defined __GNU_LIBRARY__ && __linux__) || (!defined __alloca && !defined __GNU_LIBRARY__) + + # ifdef __GNUC__ + # undef alloca diff --git a/recipes/make/all/patches/4.3-0001-clang.patch b/recipes/make/all/patches/4.3-0001-clang.patch new file mode 100644 index 0000000000000..6903a4923e64f --- /dev/null +++ b/recipes/make/all/patches/4.3-0001-clang.patch @@ -0,0 +1,11 @@ +--- lib/glob.c ++++ lib/glob.c +@@ -208,7 +208,7 @@ + #endif /* __GNU_LIBRARY__ || __DJGPP__ */ + + +-#if !defined __alloca && !defined __GNU_LIBRARY__ ++#if (!defined __alloca && defined __GNU_LIBRARY__ && __linux__) || (!defined __alloca && !defined __GNU_LIBRARY__) + + # ifdef __GNUC__ + # undef alloca diff --git a/recipes/make/all/test_package/Makefile b/recipes/make/all/test_package/Makefile new file mode 100644 index 0000000000000..21bbcc072d03a --- /dev/null +++ b/recipes/make/all/test_package/Makefile @@ -0,0 +1,2 @@ +love: + echo "not war" diff --git a/recipes/make/all/test_package/conanfile.py b/recipes/make/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7533b4eedc4fc --- /dev/null +++ b/recipes/make/all/test_package/conanfile.py @@ -0,0 +1,14 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + make = self.conf.get("tools.gnu:make_program", check_type=str) + self.run(f"{make} -C {self.source_folder} love") diff --git a/recipes/make/all/test_v1_package/conanfile.py b/recipes/make/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2348d97eef993 --- /dev/null +++ b/recipes/make/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + with tools.run_environment(self): + make = self.deps_user_info["make"].make + makefile_dir = os.path.join(self.source_folder, os.pardir, "test_package") + self.run(f"{make} -C {makefile_dir} love") diff --git a/recipes/make/config.yml b/recipes/make/config.yml new file mode 100644 index 0000000000000..0260fd9e5313f --- /dev/null +++ b/recipes/make/config.yml @@ -0,0 +1,5 @@ +versions: + "4.3": + folder: all + "4.2.1": + folder: all diff --git a/recipes/makefile-project-workspace-creator/all/conandata.yml b/recipes/makefile-project-workspace-creator/all/conandata.yml new file mode 100644 index 0000000000000..cf73be5e00fae --- /dev/null +++ b/recipes/makefile-project-workspace-creator/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.1.46": + url: "https://github.com/objectcomputing/MPC/archive/MPC_4_1_46.tar.gz" + sha256: "7fa43cfe81a5fffdd2e958091661efef08ddcf011f9ef8090e8283d04dd88043" diff --git a/recipes/makefile-project-workspace-creator/all/conanfile.py b/recipes/makefile-project-workspace-creator/all/conanfile.py new file mode 100644 index 0000000000000..c3268efeaebb0 --- /dev/null +++ b/recipes/makefile-project-workspace-creator/all/conanfile.py @@ -0,0 +1,37 @@ +import os +from conans import ConanFile, tools + + +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" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + if self.settings.os == "Windows": + self.requires("strawberryperl/5.30.0.1") + + def build(self): + pass + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("MPC-MPC_" + self.version.replace(".", "_"), self._source_subfolder) + + 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") + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info('Appending PATH environment variable: %s' % bin_path) + 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 new file mode 100644 index 0000000000000..d02d604b53d44 --- /dev/null +++ b/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py @@ -0,0 +1,12 @@ +from conans import ConanFile, tools + + +class DefaultNameConan(ConanFile): + settings = "os" + + def build(self): + pass + + def test(self): + if not tools.cross_building(self.settings): + self.run("perl -S mpc.pl --version", run_environment=True) diff --git a/recipes/makefile-project-workspace-creator/config.yml b/recipes/makefile-project-workspace-creator/config.yml new file mode 100644 index 0000000000000..063d2b044b54c --- /dev/null +++ b/recipes/makefile-project-workspace-creator/config.yml @@ -0,0 +1,3 @@ +versions: + 4.1.46: + folder: all diff --git a/recipes/mapbox-geometry/all/conandata.yml b/recipes/mapbox-geometry/all/conandata.yml new file mode 100644 index 0000000000000..2c995609ac711 --- /dev/null +++ b/recipes/mapbox-geometry/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.3": + url: "https://github.com/mapbox/geometry.hpp/archive/refs/tags/v2.0.3.tar.gz" + sha256: "9d750d34576069bcc4f39677af08cde2862fbe4b8c0d9af504877c2fae2ae273" diff --git a/recipes/mapbox-geometry/all/conanfile.py b/recipes/mapbox-geometry/all/conanfile.py new file mode 100644 index 0000000000000..9edf42d2b8db1 --- /dev/null +++ b/recipes/mapbox-geometry/all/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class MapboxGeometryConan(ConanFile): + name = "mapbox-geometry" + description = ( + "Provides header-only, generic C++ interfaces for geometry types, " + "geometry collections, and features." + ) + topics = ("geometry") + license = "ISC" + homepage = "https://github.com/mapbox/geometry.hpp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("mapbox-variant/1.2.0", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mapbox-geometry/all/test_package/CMakeLists.txt b/recipes/mapbox-geometry/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9bad4b5d60471 --- /dev/null +++ b/recipes/mapbox-geometry/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mapbox-geometry REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-geometry::mapbox-geometry) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/mapbox-geometry/all/test_package/conanfile.py b/recipes/mapbox-geometry/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mapbox-geometry/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/mapbox-geometry/all/test_package/test_package.cpp b/recipes/mapbox-geometry/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a716f17372aad --- /dev/null +++ b/recipes/mapbox-geometry/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + mapbox::geometry::point pt(1.0, 0.0); + std::cout << "x: " << pt.x << " y: " << pt.y << std::endl; + return 0; +} diff --git a/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt b/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e4046b86f9232 --- /dev/null +++ b/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mapbox-geometry REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-geometry::mapbox-geometry) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/mapbox-geometry/all/test_v1_package/conanfile.py b/recipes/mapbox-geometry/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mapbox-geometry/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/mapbox-geometry/config.yml b/recipes/mapbox-geometry/config.yml new file mode 100644 index 0000000000000..7f57148a20478 --- /dev/null +++ b/recipes/mapbox-geometry/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.3": + folder: all diff --git a/recipes/mapbox-variant/all/conandata.yml b/recipes/mapbox-variant/all/conandata.yml new file mode 100644 index 0000000000000..5473c388e5c2d --- /dev/null +++ b/recipes/mapbox-variant/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.0": + url: "https://github.com/mapbox/variant/archive/refs/tags/v1.2.0.tar.gz" + sha256: "7059f4420d504c4bc96f8a462a0f6d029c5be914ba55cc030a0a773366dd7bc8" diff --git a/recipes/mapbox-variant/all/conanfile.py b/recipes/mapbox-variant/all/conanfile.py new file mode 100644 index 0000000000000..dd51a969a8f23 --- /dev/null +++ b/recipes/mapbox-variant/all/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class MapboxVariantConan(ConanFile): + name = "mapbox-variant" + description = "An header-only alternative to boost::variant for C++11 and C++14" + topics = ("variant") + license = "BSD-3-Clause" + homepage = "https://github.com/mapbox/variant" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def 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) + + def build(self): + pass + + 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.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/mapbox-variant/all/test_package/CMakeLists.txt b/recipes/mapbox-variant/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d72d3227f01d3 --- /dev/null +++ b/recipes/mapbox-variant/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mapbox-variant REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-variant::mapbox-variant) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mapbox-variant/all/test_package/conanfile.py b/recipes/mapbox-variant/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/mapbox-variant/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/mapbox-variant/all/test_package/test_package.cpp b/recipes/mapbox-variant/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..969f9efcb56c0 --- /dev/null +++ b/recipes/mapbox-variant/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +#include +#include + +int main() { + typedef mapbox::util::variant variant_type; + variant_type v0(3.14159); + variant_type v1(std::string("3.14159")); + std::cout << "v0: " << v0 << " v1: " << v1 << std::endl; + return 0; +} diff --git a/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt b/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5f12dfeb0954a --- /dev/null +++ b/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mapbox-variant REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-variant::mapbox-variant) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mapbox-variant/all/test_v1_package/conanfile.py b/recipes/mapbox-variant/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mapbox-variant/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/mapbox-variant/config.yml b/recipes/mapbox-variant/config.yml new file mode 100644 index 0000000000000..7ed1f1b6fc695 --- /dev/null +++ b/recipes/mapbox-variant/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.0": + folder: all diff --git a/recipes/mariadb-connector-c/all/conandata.yml b/recipes/mariadb-connector-c/all/conandata.yml new file mode 100644 index 0000000000000..74a7f76fab54c --- /dev/null +++ b/recipes/mariadb-connector-c/all/conandata.yml @@ -0,0 +1,74 @@ +sources: + "3.3.3": + url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.3.3/mariadb-connector-c-3.3.3-src.tar.gz" + sha256: "d77630e2376fe08185b5354621c877b0a203a6b186a0694574d37b764aeb2874" + "3.1.19": + url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.1.19/mariadb-connector-c-3.1.19-src.tar.gz" + sha256: "3cafe6e197a0610e9a77aea4f0733a52e0697e8557998de4c4156c242e1ff405" + "3.1.12": + url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.1.12/mariadb-connector-c-3.1.12-src.tar.gz" + sha256: "2f5ae14708b4813e4ff6857d152c22e6fc0e551c9fa743c1ef81a68e3254fe63" + "3.1.11": + url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.1.11/mariadb-connector-c-3.1.11-src.tar.gz" + sha256: "3e6f6c399493fe90efdc21a3fe70c30434b7480e8195642a959f1dd7a0fa5b0f" +patches: + "3.3.3": + - patch_file: "patches/3.3.3-0001-fix-install-and-static-or-shared.patch" + patch_description: "fix install path, separate static/shared build" + patch_type: "conan" + - patch_file: "patches/3.1.19-0002-remove-wx-flag.patch" + patch_description: "remove WX flags in MSVC" + patch_type: "conan" + - patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch" + patch_description: "fix include order for windows winsock2" + patch_type: "portability" + - patch_file: "patches/3.1.11-0004-include-mysqld_error-header.patch" + patch_description: "always include mysqld_error.h" + patch_type: "portability" + "3.1.19": + - patch_file: "patches/3.1.19-0001-fix-install-and-static-or-shared.patch" + patch_description: "fix install path, separate static/shared build" + patch_type: "conan" + - patch_file: "patches/3.1.19-0002-remove-wx-flag.patch" + patch_description: "remove WX flags in MSVC" + patch_type: "conan" + - patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch" + patch_description: "fix include order for windows winsock2" + patch_type: "portability" + - patch_file: "patches/3.1.11-0004-include-mysqld_error-header.patch" + patch_description: "always include mysqld_error.h" + patch_type: "portability" + "3.1.12": + - patch_file: "patches/3.1.11-0001-fix-install-and-static-or-shared.patch" + patch_description: "fix install path, separate static/shared build" + patch_type: "conan" + - patch_file: "patches/3.1.11-0002-msvc-no-override-md-zi.patch" + patch_description: "honor conan's build type" + patch_type: "conan" + - patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch" + patch_description: "fix include order for windows winsock2" + patch_type: "portability" + - patch_file: "patches/3.1.11-0004-include-mysqld_error-header.patch" + patch_description: "always include mysqld_error.h" + patch_type: "portability" + - patch_file: "patches/3.1.11-0005-fix-cmake-connectorname.patch" + patch_description: "fix wrong function name END()" + patch_type: "bugfix" + patch_source: "https://github.com/mariadb-corporation/mariadb-connector-c/commit/242cab8cbcd91af882233730a83627d3b12ced83" + "3.1.11": + - patch_file: "patches/3.1.11-0001-fix-install-and-static-or-shared.patch" + patch_description: "fix install path, separate static/shared build" + patch_type: "conan" + - patch_file: "patches/3.1.11-0002-msvc-no-override-md-zi.patch" + patch_description: "honor conan's build type" + patch_type: "conan" + - patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch" + patch_description: "fix include order for windows winsock2" + patch_type: "portability" + - patch_file: "patches/3.1.11-0004-include-mysqld_error-header.patch" + patch_description: "always include mysqld_error.h" + patch_type: "portability" + - patch_file: "patches/3.1.11-0005-fix-cmake-connectorname.patch" + patch_description: "fix wrong function name END()" + patch_type: "bugfix" + patch_source: "https://github.com/mariadb-corporation/mariadb-connector-c/commit/242cab8cbcd91af882233730a83627d3b12ced83" diff --git a/recipes/mariadb-connector-c/all/conanfile.py b/recipes/mariadb-connector-c/all/conanfile.py new file mode 100644 index 0000000000000..13b1525cfce34 --- /dev/null +++ b/recipes/mariadb-connector-c/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class MariadbConnectorcConan(ConanFile): + name = "mariadb-connector-c" + description = "MariaDB Connector/C is used to connect applications " \ + "developed in C/C++ to MariaDB and MySQL databases." + license = "LGPL-2.1-or-later" + topics = ("mariadb", "mysql", "database") + homepage = "https://mariadb.com/kb/en/mariadb-connector-c" + 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], + "dyncol": [True, False], + "with_iconv": [True, False], + "with_curl": [True, False], + "with_ssl": [False, "openssl", "gnutls", "schannel"], + } + default_options = { + "shared": False, + "fPIC": True, + "dyncol": True, + "with_iconv": False, + "with_curl": True, + "with_ssl": "openssl", + } + + 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_iconv + self.options.with_ssl = "schannel" + + 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.13") + if self.options.get_safe("with_iconv"): + self.requires("libiconv/1.17") + if self.options.with_curl: + self.requires("libcurl/8.0.1") + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.os != "Windows" and self.options.with_ssl == "schannel": + raise ConanInvalidConfiguration("schannel only supported on Windows") + if self.options.with_ssl == "gnutls": + raise ConanInvalidConfiguration("gnutls not yet available in CCI") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os == "Windows": + tc.variables["WITH_MSI"] = False + tc.variables["WITH_SIGNCODE"] = False + tc.variables["WITH_RTC"] = False + else: + tc.variables["WITH_MYSQLCOMPAT"] = False + tc.variables["WITH_ICONV"] = self.options.with_iconv + tc.variables["WITH_UNIT_TESTS"] = False + tc.variables["WITH_DYNCOL"] = self.options.dyncol + tc.variables["WITH_EXTERNAL_ZLIB"] = True + tc.variables["WITH_CURL"] = self.options.with_curl + tc.variables["WITH_SSL"] = self.options.with_ssl + tc.variables["INSTALL_BINDIR"] = "bin" + tc.variables["INSTALL_LIBDIR"] = "lib" + tc.variables["INSTALL_PLUGINDIR"] = os.path.join("lib", "plugin").replace("\\", "/") + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + root_cmake = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, root_cmake, "${ZLIB_LIBRARY}", "${ZLIB_LIBRARIES}") + replace_in_file(self, + root_cmake, + "SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})", + "SET(SSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)" + ) + replace_in_file(self, root_cmake, "${CURL_LIBRARIES}", "CURL::libcurl") + plugins_io_cmake = os.path.join(self.source_folder, "plugins", "io", "CMakeLists.txt") + replace_in_file(self, plugins_io_cmake, "${CURL_LIBRARIES}", "CURL::libcurl") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.LIB", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "symbols")) + rmdir(self, os.path.join(self.package_folder, "man")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmariadb") + self.cpp_info.includedirs.append(os.path.join("include", "mariadb")) + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "shlwapi"] + if self.options.with_ssl == "schannel": + self.cpp_info.system_libs.append("secur32") + + plugin_dir = os.path.join(self.package_folder, "lib", "plugin").replace("\\", "/") + self.runenv_info.prepend_path("MARIADB_PLUGIN_DIR", plugin_dir) + + # TODO: to remove in conan v2 + self.env_info.MARIADB_PLUGIN_DIR.append(plugin_dir) diff --git a/recipes/mariadb-connector-c/all/patches/3.1.11-0001-fix-install-and-static-or-shared.patch b/recipes/mariadb-connector-c/all/patches/3.1.11-0001-fix-install-and-static-or-shared.patch new file mode 100644 index 0000000000000..20dc0c50587b3 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.11-0001-fix-install-and-static-or-shared.patch @@ -0,0 +1,96 @@ +--- a/libmariadb/CMakeLists.txt ++++ b/libmariadb/CMakeLists.txt +@@ -367,7 +367,7 @@ ELSE() + ENDIF() + + +-IF((NOT WIN32) AND (CMAKE_VERSION VERSION_GREATER 2.8.7)) ++IF(FALSE) + # CREATE OBJECT LIBRARY + ADD_LIBRARY(mariadb_obj OBJECT ${LIBMARIADB_SOURCES}) + IF(UNIX) +@@ -393,27 +393,29 @@ IF(WIN32) + "FILE_DESCRIPTION:Dynamic lib for client/server communication") + ENDIF() + +- ++IF(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE}) + TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS}) ++ELSE() + + IF(UNIX) + ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE}) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ELSE() +- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} mariadbclient.def) +- TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE mariadbclient) ++ ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE} mariadbclient.def) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C) + ENDIF() + + TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS}) + + SIGN_TARGET(libmariadb) ++ENDIF() + +-IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC) ++IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC AND NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64") + ENDIF() + ++IF(BUILD_SHARED_LIBS) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR + CMAKE_SYSTEM_NAME MATCHES "GNU") +@@ -423,10 +425,14 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def") + ENDIF() + ++ELSE() + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") ++ENDIF() ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") + + SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") ++ENDIF() + + # + # Installation +@@ -447,9 +453,11 @@ IF(WITH_MYSQLCOMPAT) + ENDIF() + + ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION + ${CPACK_PACKAGE_VERSION_MAJOR} + SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) ++ELSE() + + IF(NOT WIN32) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES OUTPUT_NAME "${LIBMARIADB_STATIC_NAME}") +@@ -457,10 +465,16 @@ ENDIF() + + INSTALL(TARGETS mariadbclient + COMPONENT Development +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ENDIF() ++IF(BUILD_SHARED_LIBS) + INSTALL(TARGETS libmariadb + COMPONENT SharedLibraries +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + + IF(MSVC) +@@ -469,3 +483,4 @@ IF(MSVC) + CONFIGURATIONS Debug RelWithDebInfo + COMPONENT Development) + ENDIF() ++ENDIF() diff --git a/recipes/mariadb-connector-c/all/patches/3.1.11-0002-msvc-no-override-md-zi.patch b/recipes/mariadb-connector-c/all/patches/3.1.11-0002-msvc-no-override-md-zi.patch new file mode 100644 index 0000000000000..b4fee14baff5d --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.11-0002-msvc-no-override-md-zi.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -98,7 +98,7 @@ IF(MSVC) + # Speedup system tests + INCLUDE(${CC_SOURCE_DIR}/cmake/WindowsCache.cmake) + ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) +- IF (MSVC) ++ IF (FALSE) + SET(CONFIG_TYPES "DEBUG" "RELEASE" "RELWITHDEBINFO") + FOREACH(BUILD_TYPE ${CONFIG_TYPES}) + FOREACH(COMPILER CXX C) diff --git a/recipes/mariadb-connector-c/all/patches/3.1.11-0003-include-order-windows-winsock2.patch b/recipes/mariadb-connector-c/all/patches/3.1.11-0003-include-order-windows-winsock2.patch new file mode 100644 index 0000000000000..59ff14a934e03 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.11-0003-include-order-windows-winsock2.patch @@ -0,0 +1,18 @@ +--- a/libmariadb/secure/schannel_certs.c ++++ b/libmariadb/secure/schannel_certs.c +@@ -33,7 +33,6 @@ + #define _WIN32_WINNT 0x0601 + #endif + +-#include "schannel_certs.h" + #include + #include + #include +@@ -41,6 +40,7 @@ + #include + #include + #include ++#include "schannel_certs.h" + #include "win32_errmsg.h" + + /* diff --git a/recipes/mariadb-connector-c/all/patches/3.1.11-0004-include-mysqld_error-header.patch b/recipes/mariadb-connector-c/all/patches/3.1.11-0004-include-mysqld_error-header.patch new file mode 100644 index 0000000000000..fe0cf43436b15 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.11-0004-include-mysqld_error-header.patch @@ -0,0 +1,11 @@ +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -10,7 +10,7 @@ SET(MARIADB_CLIENT_INCLUDES ${CC_SOURCE_DIR}/include/mariadb_com.h + ${CC_SOURCE_DIR}/include/mariadb_ctype.h + ${CC_SOURCE_DIR}/include/mariadb_rpl.h + ) +-IF(NOT IS_SUBPROJECT) ++IF(TRUE) + SET(MARIADB_CLIENT_INCLUDES ${MARIADB_CLIENT_INCLUDES} + ${CC_SOURCE_DIR}/include/mysqld_error.h + ) diff --git a/recipes/mariadb-connector-c/all/patches/3.1.11-0005-fix-cmake-connectorname.patch b/recipes/mariadb-connector-c/all/patches/3.1.11-0005-fix-cmake-connectorname.patch new file mode 100644 index 0000000000000..01dd24602d156 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.11-0005-fix-cmake-connectorname.patch @@ -0,0 +1,11 @@ +--- a/cmake/ConnectorName.cmake ++++ b/cmake/ConnectorName.cmake +@@ -22,7 +22,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows") + SET(MACHINE_NAME "x64") + ELSE() + SET(MACHINE_NAME "32") +- END() ++ ENDIF() + ENDIF() + + SET(product_name "mysql-connector-c-${CPACK_PACKAGE_VERSION}-${PLATFORM_NAME}${CONCAT_SIGN}${MACHINE_NAME}") diff --git a/recipes/mariadb-connector-c/all/patches/3.1.19-0001-fix-install-and-static-or-shared.patch b/recipes/mariadb-connector-c/all/patches/3.1.19-0001-fix-install-and-static-or-shared.patch new file mode 100644 index 0000000000000..64399d7ee68cb --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.19-0001-fix-install-and-static-or-shared.patch @@ -0,0 +1,122 @@ +diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt +index f257926..a78329e 100644 +--- a/libmariadb/CMakeLists.txt ++++ b/libmariadb/CMakeLists.txt +@@ -379,7 +379,7 @@ ELSE() + ENDIF() + + +-IF(CMAKE_VERSION VERSION_GREATER 2.8.7) ++IF(FALSE) + # CREATE OBJECT LIBRARY + ADD_LIBRARY(mariadb_obj OBJECT ${LIBMARIADB_SOURCES}) + IF(UNIX) +@@ -405,26 +405,28 @@ IF(WIN32) + "FILE_DESCRIPTION:Dynamic lib for client/server communication") + ENDIF() + +- ++IF(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE}) + TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS}) +- ++ELSE() + IF(UNIX) + ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE}) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ELSE() +- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} mariadbclient.def) ++ ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE} mariadbclient.def) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C) + ENDIF() + + TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS}) + + SIGN_TARGET(libmariadb) ++ENDIF() + +-IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC) ++IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC AND NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64") + ENDIF() + ++IF(BUILD_SHARED_LIBS) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR + CMAKE_SYSTEM_NAME MATCHES "GNU") +@@ -434,10 +436,14 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def") + ENDIF() + ++ELSE() + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") ++ENDIF() ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") + + SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") ++ENDIF() + + # + # Installation +@@ -457,11 +463,15 @@ IF(WITH_MYSQLCOMPAT) + ENDIF() + ENDIF() + ++IF(NOT BUILD_SHARED_LIBS) + create_symlink(libmariadb${CMAKE_STATIC_LIBRARY_SUFFIX} mariadbclient ${INSTALL_LIBDIR}) ++ENDIF() + ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION + ${CPACK_PACKAGE_VERSION_MAJOR} + SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) ++ELSE() + + IF(NOT WIN32) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES OUTPUT_NAME "${LIBMARIADB_STATIC_NAME}") +@@ -469,20 +479,33 @@ ENDIF() + + INSTALL(TARGETS mariadbclient + COMPONENT Development +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ENDIF() ++ ++IF(BUILD_SHARED_LIBS) + IF(WIN32) + INSTALL(TARGETS libmariadb + COMPONENT SharedLibraries +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ELSE() + # in cmake 3.12+ we can use + #INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} + # COMPONENT SharedLibraries NAMELINK_COMPONENT Development) + # but as long as we build on CentOS 7 with its cmake 2.8.12.2 we have to use +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT SharedLibraries NAMELINK_SKIP) +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT Development NAMELINK_ONLY) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT SharedLibraries) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT Development) + ENDIF() + + IF(MSVC) +@@ -491,3 +514,4 @@ IF(MSVC) + CONFIGURATIONS Debug RelWithDebInfo + COMPONENT Development) + ENDIF() ++ENDIF() diff --git a/recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch b/recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch new file mode 100644 index 0000000000000..4dde44415f18b --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f3b6cbd..f3e8993 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,7 +100,7 @@ IF(MSVC) + ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) + IF (MSVC) + # Treat warnings as errors +- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -WX") ++ # SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -WX") + SET(CONFIG_TYPES "DEBUG" "RELEASE" "RELWITHDEBINFO") + FOREACH(BUILD_TYPE ${CONFIG_TYPES}) + FOREACH(COMPILER CXX C) diff --git a/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch b/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch new file mode 100644 index 0000000000000..8a6f9ad7f1f55 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch @@ -0,0 +1,127 @@ +diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt +index 070fdc9..77584e6 100644 +--- a/libmariadb/CMakeLists.txt ++++ b/libmariadb/CMakeLists.txt +@@ -288,7 +288,7 @@ SET(MARIADB_NONBLOCK_SYMBOLS + + # handle static plugins + SET(LIBMARIADB_SOURCES ${LIBMARIADB_SOURCES} ${LIBMARIADB_PLUGIN_SOURCES}) +-SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${LIBMARIADB_PLUGIN_LIBS} ${ZSTD_LIBRARY} ${ZLIB_LIBRARY}) ++SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${LIBMARIADB_PLUGIN_LIBS} ${ZSTD_LIBRARY} ZLIB::ZLIB) + MESSAGE(STATUS "SYSTEM_LIBS: ${SYSTEM_LIBS}") + INCLUDE_DIRECTORIES(${LIBMARIADB_PLUGIN_INCLUDES}) + ADD_DEFINITIONS(${LIBMARIADB_PLUGIN_DEFS}) +@@ -404,7 +404,7 @@ ELSE() + ENDIF() + + +-IF(CMAKE_VERSION VERSION_GREATER 2.8.7) ++IF(FALSE) + # CREATE OBJECT LIBRARY + ADD_LIBRARY(mariadb_obj OBJECT ${LIBMARIADB_SOURCES}) + IF(UNIX) +@@ -433,22 +433,24 @@ IF(WIN32) + "FILE_DESCRIPTION:Dynamic lib for client/server communication") + ENDIF() + +- ++IF(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE}) + TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS}) +- ++ELSE() + IF(UNIX) + ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE}) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ELSE() +- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} mariadbclient.def) ++ ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE} mariadbclient.def) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C) + ENDIF() + + TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS}) + + SIGN_TARGET(libmariadb) ++ENDIF() + ++IF(BUILD_SHARED_LIBS) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR + CMAKE_SYSTEM_NAME MATCHES "GNU") +@@ -457,11 +459,14 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + ENDIF() + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def") + ENDIF() +- ++ELSE() + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") ++ENDIF() ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") + + SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") ++ENDIF() + + # + # Installation +@@ -481,11 +486,15 @@ IF(WITH_MYSQLCOMPAT) + ENDIF() + ENDIF() + ++IF(NOT BUILD_SHARED_LIBS) + create_symlink(libmariadb${CMAKE_STATIC_LIBRARY_SUFFIX} mariadbclient ${INSTALL_LIBDIR}) ++ENDIF() + ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION + ${CPACK_PACKAGE_VERSION_MAJOR} + SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) ++ELSE() + + IF(NOT WIN32) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES OUTPUT_NAME "${LIBMARIADB_STATIC_NAME}") +@@ -493,20 +502,33 @@ ENDIF() + + INSTALL(TARGETS mariadbclient + COMPONENT Development +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ENDIF() ++ ++IF(BUILD_SHARED_LIBS) + IF(WIN32) + INSTALL(TARGETS libmariadb + COMPONENT SharedLibraries +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ELSE() + # in cmake 3.12+ we can use + #INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} + # COMPONENT SharedLibraries NAMELINK_COMPONENT Development) + # but as long as we build on CentOS 7 with its cmake 2.8.12.2 we have to use +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT SharedLibraries NAMELINK_SKIP) +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT Development NAMELINK_ONLY) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT SharedLibraries) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT Development) + ENDIF() + + IF(MSVC) +@@ -515,3 +537,4 @@ IF(MSVC) + CONFIGURATIONS Debug RelWithDebInfo + COMPONENT Development) + ENDIF() ++ENDIF() diff --git a/recipes/mariadb-connector-c/all/test_package/CMakeLists.txt b/recipes/mariadb-connector-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d314b6a18b20d --- /dev/null +++ b/recipes/mariadb-connector-c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mariadb-connector-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mariadb-connector-c::mariadb-connector-c) diff --git a/recipes/mariadb-connector-c/all/test_package/conanfile.py b/recipes/mariadb-connector-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mariadb-connector-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/mariadb-connector-c/all/test_package/test_package.c b/recipes/mariadb-connector-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..1bb304f845467 --- /dev/null +++ b/recipes/mariadb-connector-c/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +// See #4530 +#include + +int main(int argc, char **argv) +{ + printf("MySQL client version: %s\n", mysql_get_client_info()); + printf("MARIADB_PLUGINDIR: %s\n", MARIADB_PLUGINDIR); + + return 0; +} diff --git a/recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt b/recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mariadb-connector-c/all/test_v1_package/conanfile.py b/recipes/mariadb-connector-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f5c483de856db --- /dev/null +++ b/recipes/mariadb-connector-c/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +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(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/mariadb-connector-c/config.yml b/recipes/mariadb-connector-c/config.yml new file mode 100644 index 0000000000000..c4757604b999d --- /dev/null +++ b/recipes/mariadb-connector-c/config.yml @@ -0,0 +1,9 @@ +versions: + "3.3.3": + folder: all + "3.1.19": + folder: all + "3.1.12": + folder: all + "3.1.11": + folder: all diff --git a/recipes/marisa/all/CMakeLists.txt b/recipes/marisa/all/CMakeLists.txt new file mode 100644 index 0000000000000..84887fbda2ddf --- /dev/null +++ b/recipes/marisa/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/marisa/all/conandata.yml b/recipes/marisa/all/conandata.yml new file mode 100644 index 0000000000000..087e45138b499 --- /dev/null +++ b/recipes/marisa/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.2.6": + url: "https://github.com/s-yata/marisa-trie/archive/refs/tags/v0.2.6.tar.gz" + sha256: "1063a27c789e75afa2ee6f1716cc6a5486631dcfcb7f4d56d6485d2462e566de" +patches: + "0.2.6": + - patch_file: "patches/0001-add-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/marisa/all/conanfile.py b/recipes/marisa/all/conanfile.py new file mode 100644 index 0000000000000..13b534d613bd9 --- /dev/null +++ b/recipes/marisa/all/conanfile.py @@ -0,0 +1,87 @@ +import os +from conan import ConanFile, tools +from conan.tools.files import apply_conandata_patches +from conans import CMake + +required_conan_version = ">=1.45.0" + + +class MarisaConan(ConanFile): + name = "marisa" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/s-yata/marisa-trie" + description = "Matching Algorithm with Recursively Implemented StorAge " + license = ("BSD-2-Clause", "LGPL-2.1") + topics = ("algorithm", "dictionary", "marisa") + exports_sources = "patches/**", "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": True, + } + + generators = "cmake" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.files.get(**self.conan_data["sources"][self.version], + conanfile=self, destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + self._cmake.definitions["BUILD_TOOLS"] = self.options.tools + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + apply_conandata_patches(self) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYING.md", dst="licenses", + src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.files.rmdir(self, os.path.join( + self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "marisa" + self.cpp_info.names["cmake_find_package_multi"] = "marisa" + self.cpp_info.names["pkgconfig"] = "marisa" + self.cpp_info.libs = ["marisa"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] + + 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/marisa/all/patches/0001-add-cmake.patch b/recipes/marisa/all/patches/0001-add-cmake.patch new file mode 100644 index 0000000000000..4635c52208c27 --- /dev/null +++ b/recipes/marisa/all/patches/0001-add-cmake.patch @@ -0,0 +1,120 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..c7e4c0e +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,114 @@ ++cmake_minimum_required(VERSION 3.1) ++project(marisa CXX) ++ ++include(GNUInstallDirs) ++ ++option(BUILD_SHARED_LIBS "Build as shared library" OFF) ++option(BUILD_TOOLS "Build tools" ON) ++option(ENABLE_TESTS "Build and run tests" ON) ++ ++if(BUILD_SHARED_LIBS) ++ set(MARISA_LIBRARY_TYPE SHARED) ++else() ++ set(MARISA_LIBRARY_TYPE STATIC) ++endif(BUILD_SHARED_LIBS) ++ ++set(CMAKE_CXX_STANDARD 11) ++ ++if(NOT CMAKE_BUILD_TYPE) ++ set(CMAKE_BUILD_TYPE Debug) ++endif() ++ ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") ++ ++if(NOT MSVC) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++ -Wextra -Wconversion") ++endif() ++ ++if(BUILD_SHARED_LIBS AND MSVC) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++endif() ++ ++include_directories("${PROJECT_SOURCE_DIR}/include") ++include_directories("${PROJECT_SOURCE_DIR}/lib") ++ ++set(HDR_COMPAT ++ include/marisa.h) ++ ++set(HDR_PUBLIC ++ include/marisa/agent.h ++ include/marisa/base.h ++ include/marisa/exception.h ++ include/marisa/iostream.h ++ include/marisa/key.h ++ include/marisa/keyset.h ++ include/marisa/query.h ++ include/marisa/scoped-array.h ++ include/marisa/scoped-ptr.h ++ include/marisa/stdio.h ++ include/marisa/trie.h) ++add_library(marisa ${MARISA_LIBRARY_TYPE} ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/mapper.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/reader.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/writer.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/trie/tail.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/trie/louds-trie.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/vector/bit-vector.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/keyset.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/trie.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/agent.cc") ++ ++install(TARGETS marisa ++ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++if(BUILD_TOOLS) ++ add_library(cmdopt OBJECT "${PROJECT_SOURCE_DIR}/tools/cmdopt.cc") ++ set(TOOLS ++ marisa-benchmark ++ marisa-build ++ marisa-common-prefix-search ++ marisa-dump ++ marisa-lookup ++ marisa-predictive-search ++ marisa-reverse-lookup ++ ) ++ ++ foreach(TOOL ${TOOLS}) ++ add_executable(${TOOL} "${PROJECT_SOURCE_DIR}/tools/${TOOL}.cc") ++ target_link_libraries(${TOOL} PRIVATE marisa cmdopt) ++ install(TARGETS ${TOOL} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) ++ endforeach(TOOL) ++endif() ++ ++if(ENABLE_TESTS) ++ enable_testing() ++ set(TESTS ++ base-test ++ io-test ++ trie-test ++ vector-test ++ marisa-test ++ ) ++ ++ foreach(TEST ${TESTS}) ++ add_executable(${TEST} "${PROJECT_SOURCE_DIR}/tests/${TEST}.cc") ++ target_link_libraries(${TEST} PRIVATE marisa) ++ add_test(${TEST} ${TEST}) ++ endforeach(TEST) ++endif() ++ ++configure_file( ++ ${PROJECT_SOURCE_DIR}/marisa.pc.in ++ ${PROJECT_BINARY_DIR}/marisa.pc ++ @ONLY) ++install(FILES ${PROJECT_BINARY_DIR}/marisa.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ ++install(FILES ${HDR_COMPAT} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ ++install(FILES ${HDR_PUBLIC} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/marisa) diff --git a/recipes/marisa/all/test_package/CMakeLists.txt b/recipes/marisa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9bae1c0958b76 --- /dev/null +++ b/recipes/marisa/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(marisa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} marisa::marisa) diff --git a/recipes/marisa/all/test_package/conanfile.py b/recipes/marisa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..251bf8ae3e3dd --- /dev/null +++ b/recipes/marisa/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os +from conans import CMake, ConanFile, tools +from conan.tools.build import cross_building + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/marisa/all/test_package/test_package.cpp b/recipes/marisa/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ba90951dd5e1b --- /dev/null +++ b/recipes/marisa/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "marisa.h" + + +int main() { + int x = 100; + int y = 200; + + marisa::swap(x, y); + + return EXIT_SUCCESS; +} diff --git a/recipes/marisa/config.yml b/recipes/marisa/config.yml new file mode 100644 index 0000000000000..070a32463b25e --- /dev/null +++ b/recipes/marisa/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.6": + folder: all diff --git a/recipes/matchit/all/conandata.yml b/recipes/matchit/all/conandata.yml new file mode 100644 index 0000000000000..b7a9f8241291b --- /dev/null +++ b/recipes/matchit/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.1": + sha256: 2860cb85febf37220f75cef5b499148bafc9f5541fe1298e11b0c169bb3f31ac + url: https://github.com/BowenFu/matchit.cpp/archive/v1.0.1.tar.gz diff --git a/recipes/matchit/all/conanfile.py b/recipes/matchit/all/conanfile.py new file mode 100644 index 0000000000000..55b20c25e3456 --- /dev/null +++ b/recipes/matchit/all/conanfile.py @@ -0,0 +1,71 @@ +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.50.0" + + +class MatchitConan(ConanFile): + name = "matchit" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/BowenFu/matchit.cpp" + license = "Apache-2.0" + description = ("match(it): A lightweight header-only pattern-matching" + " library for C++17 with macro-free APIs.") + topics = ("lightweight", "cpp17", "header-only", "pattern-matching") + no_copy_source = True + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "matchit.h", + 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_file_name", "matchit") + self.cpp_info.set_property("cmake_target_name", "matchit::matchit") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/matchit/all/test_package/CMakeLists.txt b/recipes/matchit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8898d12cfc675 --- /dev/null +++ b/recipes/matchit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(matchit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE matchit::matchit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/matchit/all/test_package/conanfile.py b/recipes/matchit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/matchit/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/matchit/all/test_package/test_package.cpp b/recipes/matchit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2f8099775fd66 --- /dev/null +++ b/recipes/matchit/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +int32_t main() { + using namespace matchit; + auto &strm = std::cout; + constexpr auto v = std::variant{4}; + Id i; + Id f; + match(v)( + // clang-format off + pattern | as(i) = [&]{ + strm << "got int: " << *i; + }, + pattern | as(f) = [&]{ + strm << "got float: " << *f; + } + // clang-format on + ); + + return 0; +} diff --git a/recipes/matchit/all/test_v1_package/CMakeLists.txt b/recipes/matchit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/matchit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/matchit/all/test_v1_package/conanfile.py b/recipes/matchit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/matchit/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/matchit/config.yml b/recipes/matchit/config.yml new file mode 100644 index 0000000000000..67af1aea3aa55 --- /dev/null +++ b/recipes/matchit/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: "all" diff --git a/recipes/mathfu/all/conandata.yml b/recipes/mathfu/all/conandata.yml new file mode 100644 index 0000000000000..580ae1b56ef73 --- /dev/null +++ b/recipes/mathfu/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/google/mathfu/archive/v1.1.0.tar.gz" + sha256: "98f167002085c0ae1b2ac1668d3342fc4bafbe6b2185b3b9e88436d19332f8ca" diff --git a/recipes/mathfu/all/conanfile.py b/recipes/mathfu/all/conanfile.py new file mode 100644 index 0000000000000..1b35d3c154c77 --- /dev/null +++ b/recipes/mathfu/all/conanfile.py @@ -0,0 +1,43 @@ +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 MathfuConan(ConanFile): + name = "mathfu" + description = "C++ math library developed primarily for games focused on simplicity and efficiency." + topics = ("math", "geometry") + license = "Apache-2.0" + homepage = "https://github.com/google/mathfu" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("vectorial/cci.20190628", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/mathfu/all/test_package/CMakeLists.txt b/recipes/mathfu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..71adac698445b --- /dev/null +++ b/recipes/mathfu/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(mathfu REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mathfu::mathfu) diff --git a/recipes/mathfu/all/test_package/conanfile.py b/recipes/mathfu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mathfu/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/mathfu/all/test_package/test_package.cpp b/recipes/mathfu/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2156fe548e6af --- /dev/null +++ b/recipes/mathfu/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include + +int main() { + mathfu::Vector v1(1.0f, 2.0f, 3.0f); + mathfu::Vector v2(3.0f, 2.5f, 0.5f); + mathfu::Vector v3 = v1 + v2; + std::cout << v3.Length() << std::endl; + return 0; +} diff --git a/recipes/mathfu/all/test_v1_package/CMakeLists.txt b/recipes/mathfu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mathfu/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mathfu/all/test_v1_package/conanfile.py b/recipes/mathfu/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mathfu/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/mathfu/config.yml b/recipes/mathfu/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/mathfu/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/mathter/all/conandata.yml b/recipes/mathter/all/conandata.yml new file mode 100644 index 0000000000000..dc5d0897e2e04 --- /dev/null +++ b/recipes/mathter/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/petiaccja/Mathter/archive/v1.0.0.tar.gz" + sha256: "c75cca8d8aec627935250908f2c0f9f1839561e7596a4199bcf80e12b0e6c53b" diff --git a/recipes/mathter/all/conanfile.py b/recipes/mathter/all/conanfile.py new file mode 100644 index 0000000000000..be28b561bbcae --- /dev/null +++ b/recipes/mathter/all/conanfile.py @@ -0,0 +1,49 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +class MathterConan(ConanFile): + name = "mathter" + license = "MIT" + homepage = "https://github.com/petiaccja/Mathter" + url = "https://github.com/conan-io/conan-center-index/" + description = "Powerful 3D math and small-matrix linear algebra library for games and science." + topics = ("game-dev", "linear-algebra", "vector-math", "matrix-library") + no_copy_source = True + settings = "compiler" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": 10, + "clang": 6, + "gcc": 7, + "Visual Studio": 16, + } + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, "17") + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("mathter requires C++17, which your compiler does not support.") + else: + self.output.warn("mathter requires C++17. Your compiler is unknown. Assuming it supports C++17.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("Mathter-" + self.version, self._source_subfolder) + + def package(self): + self.copy("*.hpp", dst=os.path.join("include", "Mathter"), src=os.path.join(self._source_subfolder, "Mathter")) + self.copy("*.natvis", dst=os.path.join("include", "Mathter"), src=os.path.join(self._source_subfolder, "Mathter")) + self.copy("LICENCE", dst="licenses", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/mathter/all/test_package/CMakeLists.txt b/recipes/mathter/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..27af59f1d203b --- /dev/null +++ b/recipes/mathter/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(TestPackage CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) +target_compile_features(test_package PUBLIC cxx_std_17) diff --git a/recipes/mathter/all/test_package/conanfile.py b/recipes/mathter/all/test_package/conanfile.py new file mode 100644 index 0000000000000..30d42d996e79e --- /dev/null +++ b/recipes/mathter/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class MathterTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/mathter/all/test_package/test_package.cpp b/recipes/mathter/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9452f0f208fc1 --- /dev/null +++ b/recipes/mathter/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main() { + using Vec3 = mathter::Vector; + Vec3 v1 = {1, 0, 3}; + Vec3 v2 = {2, 5, 3}; + auto r = v1 + v2; + std::cout << "Mathter installation works." << std::endl; + return 0; +} diff --git a/recipes/mathter/config.yml b/recipes/mathter/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/mathter/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/matio/all/CMakeLists.txt b/recipes/matio/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/matio/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/matio/all/conandata.yml b/recipes/matio/all/conandata.yml new file mode 100644 index 0000000000000..8a659653f91f9 --- /dev/null +++ b/recipes/matio/all/conandata.yml @@ -0,0 +1,42 @@ +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" +patches: + "1.5.18": + - patch_file: "patches/require-cmake-3.10.patch" + base_path: "source_subfolder" + - patch_file: "patches/disable-hdf5-target.patch" + base_path: "source_subfolder" + - patch_file: "patches/patch-apple-no-undefined.patch" + base_path: "source_subfolder" + - patch_file: "patches/cmake-install-bundle.patch" + base_path: "source_subfolder" + "1.5.19": + - patch_file: "patches/require-cmake-3.10.patch" + base_path: "source_subfolder" + - patch_file: "patches/patch-apple-no-undefined.patch" + base_path: "source_subfolder" + - patch_file: "patches/cmake-install-bundle.patch" + base_path: "source_subfolder" + "1.5.21": + - patch_file: "patches/require-cmake-3.10.patch" + base_path: "source_subfolder" + - patch_file: "patches/patch-apple-no-undefined.patch" + base_path: "source_subfolder" + - patch_file: "patches/cmake-install-bundle.patch" + base_path: "source_subfolder" + "1.5.23": + - patch_file: "patches/require-cmake-3.10.patch" + base_path: "source_subfolder" + - patch_file: "patches/cmake-install-bundle.patch" + base_path: "source_subfolder" diff --git a/recipes/matio/all/conanfile.py b/recipes/matio/all/conanfile.py new file mode 100644 index 0000000000000..213dcdf0eba5b --- /dev/null +++ b/recipes/matio/all/conanfile.py @@ -0,0 +1,104 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class MatioConan(ConanFile): + name = "matio" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/matio/" + description = "Matio is a C library for reading and writing binary MATLAB MAT files." + topics = ("conan", "matlab", "mat-file", "file-format", "hdf5") + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + exports_sources = "CMakeLists.txt", "patches/*" + options = { + "shared": [True, False], + "extended_sparse": [True, False], + "fPIC": [True, False], + "mat73": [True, False], + "with_hdf5": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "extended_sparse": True, + "fPIC": True, + "mat73": True, + "with_hdf5": True, + "with_zlib": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_hdf5: + self.requires("hdf5/1.12.1") + if self.options.with_zlib: + self.requires("zlib/1.2.12") + + def validate(self): + if not self.options.with_hdf5 and self.options.mat73: + raise ConanInvalidConfiguration("Support of version 7.3 MAT files requires HDF5") + + 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) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["MATIO_EXTENDED_SPARSE"] = self.options.extended_sparse + self._cmake.definitions["MATIO_PIC"] = self.options.get_safe("fPIC", True) + self._cmake.definitions["MATIO_SHARED"] = self.options.shared + self._cmake.definitions["MATIO_MAT73"] = self.options.mat73 + self._cmake.definitions["MATIO_WITH_HDF5"] = self.options.with_hdf5 + self._cmake.definitions["MATIO_WITH_ZLIB"] = self.options.with_zlib + self._cmake.definitions["HDF5_USE_STATIC_LIBRARIES"] = self.options.with_hdf5 and not self.options["hdf5"].shared + self._cmake.configure() + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + if self.settings.compiler == "Visual Studio": + self.cpp_info.libs = ["libmatio"] + else: + self.cpp_info.libs = ["matio"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.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) diff --git a/recipes/matio/all/patches/cmake-install-bundle.patch b/recipes/matio/all/patches/cmake-install-bundle.patch new file mode 100644 index 0000000000000..b7f261e01500c --- /dev/null +++ b/recipes/matio/all/patches/cmake-install-bundle.patch @@ -0,0 +1,14 @@ +Fix CMake configuration errors while cross-building to iOS/tvOS/watchOS + +--- a/cmake/tools.cmake ++++ b/cmake/tools.cmake +@@ -5,8 +5,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 new file mode 100644 index 0000000000000..8f9c45cb87de8 --- /dev/null +++ b/recipes/matio/all/patches/disable-hdf5-target.patch @@ -0,0 +1,12 @@ +--- 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 new file mode 100644 index 0000000000000..6dbb97ff53471 --- /dev/null +++ b/recipes/matio/all/patches/patch-apple-no-undefined.patch @@ -0,0 +1,17 @@ +--- 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/all/patches/require-cmake-3.10.patch b/recipes/matio/all/patches/require-cmake-3.10.patch new file mode 100644 index 0000000000000..223045c5161eb --- /dev/null +++ b/recipes/matio/all/patches/require-cmake-3.10.patch @@ -0,0 +1,8 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.7) ++cmake_minimum_required(VERSION 3.10) + + if(POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) diff --git a/recipes/matio/all/test_package/CMakeLists.txt b/recipes/matio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f8b971e2db377 --- /dev/null +++ b/recipes/matio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/matio/all/test_package/conanfile.py b/recipes/matio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f96969845ae24 --- /dev/null +++ b/recipes/matio/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os.path + + +class MatioTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/matio/all/test_package/test_package.c b/recipes/matio/all/test_package/test_package.c new file mode 100644 index 0000000000000..27c1127b5efb9 --- /dev/null +++ b/recipes/matio/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include "matio.h" + +#include + +int main() +{ + int major, minor, release; + Mat_GetLibraryVersion(&major, &minor, &release); + printf("Test application successfully ran using matio %d.%d.%d!\n", major, minor, release); + return 0; +} diff --git a/recipes/matio/config.yml b/recipes/matio/config.yml new file mode 100644 index 0000000000000..5ec8ba010e8ec --- /dev/null +++ b/recipes/matio/config.yml @@ -0,0 +1,9 @@ +versions: + "1.5.18": + folder: all + "1.5.19": + folder: all + "1.5.21": + folder: all + "1.5.23": + folder: all diff --git a/recipes/mattiasgustavsson-libs/all/conandata.yml b/recipes/mattiasgustavsson-libs/all/conandata.yml new file mode 100644 index 0000000000000..3bc6660fa8fce --- /dev/null +++ b/recipes/mattiasgustavsson-libs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20200417": + sha256: 1235919eaa9895dbdf060c3252aaf6917b42c3d0a11ee7aabfef4ef7b231e78d + url: https://github.com/mattiasgustavsson/libs/archive/bc03ac2268db88d1fadfbe4cee5ec1d55f715edc.tar.gz diff --git a/recipes/mattiasgustavsson-libs/all/conanfile.py b/recipes/mattiasgustavsson-libs/all/conanfile.py new file mode 100644 index 0000000000000..bfba3abb27bab --- /dev/null +++ b/recipes/mattiasgustavsson-libs/all/conanfile.py @@ -0,0 +1,37 @@ +from conans import ConanFile, tools +import os.path +import glob + +class MattiasgustavssonLibsConan(ConanFile): + name = "mattiasgustavsson-libs" + description = "Single-file public domain libraries for C/C++" + homepage = "https://github.com/mattiasgustavsson/libs" + url = "https://github.com/conan-io/conan-center-index" + license = ("Unlicense", "MIT") + topics = ("utilities", "mattiasgustavsson", "libs") + no_copy_source = True + + @property + def _source_subfolder(self): + return os.path.join(self.source_folder, "source_subfolder") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob('libs-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + def _extract_licenses(self): + header = tools.load(os.path.join(self._source_subfolder, "thread.h")) + mit_content = header[header.find("ALTERNATIVE A - "):header.find("ALTERNATIVE B -")] + tools.save("LICENSE_MIT", mit_content) + unlicense_content = header[header.find("ALTERNATIVE B - "):header.rfind("*/", 1)] + tools.save("LICENSE_UNLICENSE", unlicense_content) + + def package(self): + self.copy(pattern="*.h", dst="include", src=self._source_subfolder) + self._extract_licenses() + self.copy("LICENSE_MIT", dst="licenses") + self.copy("LICENSE_UNLICENSE", dst="licenses") + + def package_id(self): + self.info.header_only() diff --git a/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7557711b6dc83 --- /dev/null +++ b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py b/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mattiasgustavsson-libs/all/test_package/test_package.cpp b/recipes/mattiasgustavsson-libs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..53d01bf8d857d --- /dev/null +++ b/recipes/mattiasgustavsson-libs/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#define RND_IMPLEMENTATION +#include "rnd.h" + +int main() +{ + + rnd_pcg_t pcg; + rnd_pcg_seed(&pcg, 0u); // initialize generator + + std::cout << rnd_pcg_next(&pcg) << std::endl; + + return 0; +} diff --git a/recipes/mattiasgustavsson-libs/config.yml b/recipes/mattiasgustavsson-libs/config.yml new file mode 100644 index 0000000000000..a30a592e1f220 --- /dev/null +++ b/recipes/mattiasgustavsson-libs/config.yml @@ -0,0 +1,3 @@ +versions: + "20200417": + folder: all diff --git a/recipes/mbedtls/all/CMakeLists.txt b/recipes/mbedtls/all/CMakeLists.txt new file mode 100644 index 0000000000000..3d32ee21cb1d7 --- /dev/null +++ b/recipes/mbedtls/all/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +if(MSVC) + if(MSVC_VERSION LESS 1900) + add_definitions(-DMBEDTLS_PLATFORM_SNPRINTF_MACRO=MBEDTLS_PLATFORM_STD_SNPRINTF) + else() + add_definitions(-DMBEDTLS_PLATFORM_SNPRINTF_MACRO=snprintf) + endif() + if(BUILD_SHARED_LIBS) + add_definitions(-DX509_BUILD_SHARED) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif() +endif() + +add_subdirectory(src) diff --git a/recipes/mbedtls/all/conandata.yml b/recipes/mbedtls/all/conandata.yml new file mode 100644 index 0000000000000..2e2a89aefe311 --- /dev/null +++ b/recipes/mbedtls/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "3.2.1": + url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-3.2.1.tar.gz" + sha256: "5850089672560eeaca03dc36678ee8573bb48ef6e38c94f5ce349af60c16da33" + "3.1.0": + url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-3.1.0.tar.gz" + sha256: "64d01a3b22b91cf3a25630257f268f11bc7bfa37981ae6d397802dd4ccec4690" + "3.0.0": + url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-3.0.0.tar.gz" + sha256: "377d376919be19f07c7e7adeeded088a525be40353f6d938a78e4f986bce2ae0" + "2.25.0": + url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.25.0.tar.gz" + sha256: "ea2049c2dd4868693998d5a9780e198194be5aea1706ff4a9d4f882f18c0a101" + "2.24.0": + url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.24.0.tar.gz" + sha256: "b5a779b5f36d5fc4cba55faa410685f89128702423ad07b36c5665441a06a5f3" + "2.23.0": + url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.23.0.tar.gz" + sha256: "5c8998217402aa1fc734f4afaeac38fad2421470fac4b3abc112bd46391054fe" diff --git a/recipes/mbedtls/all/conanfile.py b/recipes/mbedtls/all/conanfile.py new file mode 100644 index 0000000000000..84a6a1f32ace2 --- /dev/null +++ b/recipes/mbedtls/all/conanfile.py @@ -0,0 +1,118 @@ +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, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class MBedTLSConan(ConanFile): + name = "mbedtls" + description = ( + "mbed TLS makes it trivially easy for developers to include " + "cryptographic and SSL/TLS capabilities in their (embedded) products" + ) + topics = ("polarssl", "tls", "security") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tls.mbed.org" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "3.0.0": + # ZLIB support has been ditched on version 3.0.0 + del self.options.with_zlib + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_zlib"): + self.requires("zlib/1.2.13") + + 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.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + # The command line flags set are not supported on older versions of gcc + raise ConanInvalidConfiguration( + f"{self.ref} does not support {self.settings.compiler}-{self.settings.compiler.version}" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root = True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_SHARED_MBEDTLS_LIBRARY"] = self.options.shared + tc.variables["USE_STATIC_MBEDTLS_LIBRARY"] = not self.options.shared + if Version(self.version) < "3.0.0": + tc.variables["ENABLE_ZLIB_SUPPORT"] = self.options.with_zlib + tc.variables["ENABLE_PROGRAMS"] = False + tc.variables["MBEDTLS_FATAL_WARNINGS"] = False + tc.variables["ENABLE_TESTING"] = False + if Version(self.version) < "3.0.0": + # relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "MbedTLS") + self.cpp_info.set_property("cmake_target_name", "MbedTLS::mbedtls") + + self.cpp_info.components["mbedcrypto"].set_property("cmake_target_name", "MbedTLS::mbedcrypto") + self.cpp_info.components["mbedcrypto"].libs = ["mbedcrypto"] + + self.cpp_info.components["mbedx509"].set_property("cmake_target_name", "MbedTLS::mbedx509") + self.cpp_info.components["mbedx509"].libs = ["mbedx509"] + self.cpp_info.components["mbedx509"].requires = ["mbedcrypto"] + + 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 self.options.get_safe("with_zlib"): + for component in self.cpp_info.components: + self.cpp_info.components[component].requires.append("zlib::zlib") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "MbedTLS" + self.cpp_info.names["cmake_find_package_multi"] = "MbedTLS" + self.cpp_info.components["libembedtls"].names["cmake_find_package"] = "mbedtls" + self.cpp_info.components["libembedtls"].names["cmake_find_package_multi"] = "mbedtls" diff --git a/recipes/mbedtls/all/test_package/CMakeLists.txt b/recipes/mbedtls/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..708448e53f170 --- /dev/null +++ b/recipes/mbedtls/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(MbedTLS REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE MbedTLS::mbedtls) diff --git a/recipes/mbedtls/all/test_package/conanfile.py b/recipes/mbedtls/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mbedtls/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/mbedtls/all/test_package/test_package.c b/recipes/mbedtls/all/test_package/test_package.c new file mode 100644 index 0000000000000..a0acf231eeaa6 --- /dev/null +++ b/recipes/mbedtls/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include "mbedtls/version.h" + +#include + +int main() +{ + char mbedtls_version[18]; + mbedtls_version_get_string_full(mbedtls_version); + printf("version: %s\n", mbedtls_version); + + return 0; +} diff --git a/recipes/mbedtls/all/test_v1_package/CMakeLists.txt b/recipes/mbedtls/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mbedtls/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mbedtls/all/test_v1_package/conanfile.py b/recipes/mbedtls/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mbedtls/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/mbedtls/config.yml b/recipes/mbedtls/config.yml new file mode 100644 index 0000000000000..114a3e62d619d --- /dev/null +++ b/recipes/mbedtls/config.yml @@ -0,0 +1,13 @@ +versions: + "3.2.1": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all + "2.25.0": + folder: all + "2.24.0": + folder: all + "2.23.0": + folder: all diff --git a/recipes/mbits-args/all/conandata.yml b/recipes/mbits-args/all/conandata.yml new file mode 100644 index 0000000000000..c5ec46f3c1e27 --- /dev/null +++ b/recipes/mbits-args/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.12.3": + url: "https://github.com/mbits-libs/args/archive/v0.12.3.tar.gz" + sha256: "1a1dc5793e927a7f8c34b77c776b4d4a88f7ce9557657d8e806fca2922bd07a0" +patches: + "0.12.3": + - patch_file: "patches/0.12.3-0001-export-cmake-config.patch" + patch_description: "conan v2: drop the unneeded dependency, export cmake config" + patch_source: "https://github.com/mbits-libs/args/commit/f0593ed24d8edc33bcef5acaad5a2d27bf566ede" + patch_type: "conan" diff --git a/recipes/mbits-args/all/conanfile.py b/recipes/mbits-args/all/conanfile.py new file mode 100644 index 0000000000000..061c5b3a891b0 --- /dev/null +++ b/recipes/mbits-args/all/conanfile.py @@ -0,0 +1,122 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsArgsConan(ConanFile): + name = "mbits-args" + description = ( + "Small open-source library for program argument parser, inspired by Python's `argparse`, " + "depending only on the standard library, with C++17 as minimum requirement." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/args" + topics = ( + "command-line", + "commandline", + "commandline-interface", + "program-arguments", + "argparse", + "argparser", + "argument-parsing", + ) + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "10.0", + } + + 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 validate(self): + if self.settings.get_safe("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 generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBARGS_TESTING"] = False + tc.variables["LIBARGS_INSTALL"] = True + 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() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["args"] + + self.cpp_info.set_property("cmake_file_name", "mbits-args") + self.cpp_info.set_property("cmake_target_name", "mbits::args") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-args" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-args" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["args"].set_property( + "cmake_target_name", "mbits::args" + ) + self.cpp_info.components["args"].libs = ["args"] diff --git a/recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch b/recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch new file mode 100644 index 0000000000000..b14f33f3a470e --- /dev/null +++ b/recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d9271c..28c176f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,9 +9,6 @@ set(PROJECT_VERSION_STABILITY "") # or "-alpha", or "-beta", or "-rc.5" + if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + message(STATUS "Libargs: Standalone") + +- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +- conan_basic_setup(TARGETS) +- + set(LIBARG_TESTING_DEFAULT ON) + set(LIBARG_INSTALL_DEFAULT ON) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -123,8 +120,9 @@ target_compile_definitions(args PRIVATE LIBARGS_EXPORTING) + target_compile_features(args PRIVATE cxx_std_17) + target_include_directories(args + PUBLIC +- ${CMAKE_CURRENT_SOURCE_DIR}/include +- ${CMAKE_CURRENT_BINARY_DIR}/include ++ $ ++ $ ++ $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) + + if (LIBARGS_SHARED) +@@ -149,7 +147,8 @@ endif() + ################################################################## + + if (LIBARGS_INSTALL) +- install(TARGETS args) ++ install(TARGETS args EXPORT mbits) ++ install(EXPORT mbits NAMESPACE "mbits::" DESTINATION lib/cmake) + install(DIRECTORY include/args DESTINATION include) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/args/version.hpp" DESTINATION include/args) + endif() diff --git a/recipes/mbits-args/all/test_package/CMakeLists.txt b/recipes/mbits-args/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6048bc9a7928f --- /dev/null +++ b/recipes/mbits-args/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-args REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::args) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-args/all/test_package/conanfile.py b/recipes/mbits-args/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3202cf875bb92 --- /dev/null +++ b/recipes/mbits-args/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("{} --sum 1000 700 1".format(bin_path), env="conanrun") diff --git a/recipes/mbits-args/all/test_package/test_package.cpp b/recipes/mbits-args/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7c9818064e873 --- /dev/null +++ b/recipes/mbits-args/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include + +template +unsigned accumulate(std::vector const& integers, Pred pred) { + return std::accumulate(integers.begin(), integers.end(), 0u, pred); +} + +int main(int argc, char* argv[]) { + std::vector integers{}; + bool is_sum{false}; + + args::null_translator tr{}; + args::parser parser{"Process some integers.", + args::from_main(argc, argv), &tr}; + parser.set(is_sum, "sum") + .opt() + .help("sum the integers (default: find the max)"); + parser.arg(integers) + .meta("N") + .help("an integer for the accumulator"); + + parser.parse(); + + auto const result = + is_sum ? accumulate(integers, [](auto a, auto b) { return a + b; }) + : accumulate(integers, + [](auto a, auto b) { return std::max(a, b); }); + printf("%u\n", result); +} diff --git a/recipes/mbits-args/all/test_v1_package/CMakeLists.txt b/recipes/mbits-args/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-args/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-args/all/test_v1_package/conanfile.py b/recipes/mbits-args/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..897d76acb188a --- /dev/null +++ b/recipes/mbits-args/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run("{} --sum 1000 700 1".format(bin_path), run_environment=True) diff --git a/recipes/mbits-args/config.yml b/recipes/mbits-args/config.yml new file mode 100644 index 0000000000000..fba0b105d56ef --- /dev/null +++ b/recipes/mbits-args/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12.3": + folder: all diff --git a/recipes/mbits-diags/all/conandata.yml b/recipes/mbits-diags/all/conandata.yml new file mode 100644 index 0000000000000..39c27e3a72100 --- /dev/null +++ b/recipes/mbits-diags/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.4": + url: "https://github.com/mbits-libs/diags/archive/v0.9.4.tar.gz" + sha256: "4fa47e416fa9521c1d268765faf8b313f8e38de249049bc09950a303e11571bf" diff --git a/recipes/mbits-diags/all/conanfile.py b/recipes/mbits-diags/all/conanfile.py new file mode 100644 index 0000000000000..f6c4c3381f0e0 --- /dev/null +++ b/recipes/mbits-diags/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsDiagsConan(ConanFile): + name = "mbits-diags" + description = "Diagnostic library with source positions, ranges and hints." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/diags" + topics = ("diagnostics", "cli", "logging", "errors") + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "11.0.3", + } + + 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): + self.requires("fmt/9.1.0") + self.requires("mbits-semver/0.1.1") + + 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["DIAGS_TESTING"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["diags"] + + self.cpp_info.set_property("cmake_file_name", "mbits-diags") + self.cpp_info.set_property("cmake_target_name", "mbits::diags") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-diags" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-diags" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["diags"].set_property( + "cmake_target_name", "mbits::diags" + ) + self.cpp_info.components["diags"].libs = ["diags"] + self.cpp_info.components["diags"].requires = [ + "fmt::fmt", + "mbits-semver::semver", + ] diff --git a/recipes/mbits-diags/all/test_package/CMakeLists.txt b/recipes/mbits-diags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..931abded16bce --- /dev/null +++ b/recipes/mbits-diags/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-diags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::diags) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-diags/all/test_package/conanfile.py b/recipes/mbits-diags/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/mbits-diags/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/mbits-diags/all/test_package/test_package.cpp b/recipes/mbits-diags/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0408581ead243 --- /dev/null +++ b/recipes/mbits-diags/all/test_package/test_package.cpp @@ -0,0 +1,59 @@ +#include +#include +#include + +using namespace diags; +using namespace std::literals; + +namespace app { +enum class str { in_use }; +UNPACK_DIAGS_TYPES(diags::string::singular); +SINGLE_FORM_DIAGS_SUPPORT(str) + +struct strings : translator_type { + std::string_view get(str id) const noexcept final { + switch (id) { + case str::in_use: + return "Library is in use"sv; + } + return {}; + } + std::string_view get(severity sev) const noexcept final { + switch (sev) { + case severity::note: + return "note"sv; + case severity::warning: + return "warning"sv; + case severity::error: + return "error"sv; + case severity::fatal: + return "fatal"sv; + default: + break; + } + return {}; + } +}; + +location_range_severity pos_from(source_code &source, + severity sev = severity::note) { + auto const start = source.position(1, 13); + auto const stop = start.moved_by(0, 7); + return start - stop[sev]; +} +} // namespace app + +int main() { + app::strings strings{}; + sources host{}; + auto src = host.source("use-diags.cpp"); + + host.set_contents("use-diags.cpp", "- underline [range] in brackets"sv); + auto msg = app::pos_from(src) + << format("{}: {}", app::str::in_use, version.to_string()); + host.push_back(msg); + + auto tr = strings.make(); + host.set_printer(&get_stdout(), tr, color::always, link_type::gcc); + host.print_diagnostics(); +} diff --git a/recipes/mbits-diags/all/test_v1_package/CMakeLists.txt b/recipes/mbits-diags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-diags/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-diags/all/test_v1_package/conanfile.py b/recipes/mbits-diags/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mbits-diags/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mbits-diags/config.yml b/recipes/mbits-diags/config.yml new file mode 100644 index 0000000000000..b894994ccfb77 --- /dev/null +++ b/recipes/mbits-diags/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.4": + folder: all diff --git a/recipes/mbits-mstch/all/conandata.yml b/recipes/mbits-mstch/all/conandata.yml new file mode 100644 index 0000000000000..252a49a795bd6 --- /dev/null +++ b/recipes/mbits-mstch/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + # Newer versions at the top + "1.0.4": + url: "https://github.com/mbits-libs/libmstch/archive/v1.0.4.tar.gz" + sha256: "ee3052b9c2321b46fffabb5db5d5659e5f963070cdfd0004701b515867ed6857" diff --git a/recipes/mbits-mstch/all/conanfile.py b/recipes/mbits-mstch/all/conanfile.py new file mode 100644 index 0000000000000..a06f83e964b39 --- /dev/null +++ b/recipes/mbits-mstch/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsMstchConan(ConanFile): + name = "mbits-mstch" + description = "libmstch implemented in terms of C++17 variant." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/libmstch" + topics = ("parser", "mstch", "mustache", "libmstch", "libmstch-parser") + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "msvc": "192", + "apple-clang": "11.0.3", + } + + 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 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 generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["mstch"] + + self.cpp_info.set_property("cmake_file_name", "mbits-mstch") + self.cpp_info.set_property("cmake_target_name", "mbits::mstch") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-mstch" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-mstch" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["mstch"].set_property( + "cmake_target_name", "mbits::mstch" + ) + self.cpp_info.components["mstch"].libs = ["mstch"] diff --git a/recipes/mbits-mstch/all/test_package/CMakeLists.txt b/recipes/mbits-mstch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b7067fa3ea38e --- /dev/null +++ b/recipes/mbits-mstch/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-mstch REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::mstch) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-mstch/all/test_package/conanfile.py b/recipes/mbits-mstch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/mbits-mstch/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/mbits-mstch/all/test_package/test_package.cpp b/recipes/mbits-mstch/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dee76b9b4ce2e --- /dev/null +++ b/recipes/mbits-mstch/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + +int main() { + mstch::map root{ + {"it", "works"}, + {"happy", true}, + {"various", + mstch::array{ + mstch::map{{"value", nullptr}}, + mstch::map{{"value", 0ll}}, + mstch::map{{"value", 3.14}}, + mstch::map{{"value", false}}, + }}, + }; + + puts(mstch::render(R"(>>> It {{it}} + I'm {{^happy}}not {{/happy}}happy about it. + Various: +{{#various}} + - {{value}}; +{{/various}} +)", + root) + .c_str()); +} diff --git a/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt b/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-mstch/all/test_v1_package/conanfile.py b/recipes/mbits-mstch/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mbits-mstch/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mbits-mstch/config.yml b/recipes/mbits-mstch/config.yml new file mode 100644 index 0000000000000..a7562f7a5313a --- /dev/null +++ b/recipes/mbits-mstch/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0.4": + folder: all diff --git a/recipes/mbits-semver/all/conandata.yml b/recipes/mbits-semver/all/conandata.yml new file mode 100644 index 0000000000000..dfbd10562ef66 --- /dev/null +++ b/recipes/mbits-semver/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.1.1: + url: "https://github.com/mbits-libs/semver/archive/v0.1.1.tar.gz" + sha256: "edfa9b04bdffd8efbdea31c9cfd7064801483d8cab0b2de5734018bdb318cf18" diff --git a/recipes/mbits-semver/all/conanfile.py b/recipes/mbits-semver/all/conanfile.py new file mode 100644 index 0000000000000..f0cda9dbb4ea7 --- /dev/null +++ b/recipes/mbits-semver/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsSemverConan(ConanFile): + name = "mbits-semver" + description = "Semantic Version type for C++17" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/semver" + topics = ("semver", "semantic-versioning") + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "11.0.3", + } + + 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 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["SEMVER_TESTING"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["semver"] + + self.cpp_info.set_property("cmake_file_name", "mbits-semver") + self.cpp_info.set_property("cmake_target_name", "mbits::semver") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-semver" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-semver" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["semver"].set_property( + "cmake_target_name", "mbits::semver" + ) + self.cpp_info.components["semver"].libs = ["semver"] diff --git a/recipes/mbits-semver/all/test_package/CMakeLists.txt b/recipes/mbits-semver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4d8d4734ef155 --- /dev/null +++ b/recipes/mbits-semver/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-semver REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::semver) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-semver/all/test_package/conanfile.py b/recipes/mbits-semver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/mbits-semver/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mbits-semver/all/test_package/test_package.cpp b/recipes/mbits-semver/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fa9dbd47eb837 --- /dev/null +++ b/recipes/mbits-semver/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +int main() { + auto const ver_data = std::string{"1.3.0-beta.5+something.mixed.5"}; + semver::project_version beta5{ver_data}; + + auto const ver_data_rc = std::string{"1.3.0-rc"}; + semver::project_version rc{ver_data_rc}; + + char const *verdict = semver::version.compatible_with(beta5) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + semver::version.to_string().c_str(), verdict, + beta5.to_string().c_str()); + + verdict = semver::version.compatible_with(semver::get_version()) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + semver::version.to_string().c_str(), verdict, + semver::get_version().to_string().c_str()); + + verdict = beta5.compatible_with(rc) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + beta5.to_string().c_str(), verdict, rc.to_string().c_str()); + + verdict = rc.compatible_with(beta5) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + rc.to_string().c_str(), verdict, beta5.to_string().c_str()); +} diff --git a/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt b/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-semver/all/test_v1_package/conanfile.py b/recipes/mbits-semver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/mbits-semver/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mbits-semver/config.yml b/recipes/mbits-semver/config.yml new file mode 100644 index 0000000000000..931f26d75751d --- /dev/null +++ b/recipes/mbits-semver/config.yml @@ -0,0 +1,3 @@ +versions: + 0.1.1: + folder: all diff --git a/recipes/mbits-utfconv/all/conandata.yml b/recipes/mbits-utfconv/all/conandata.yml new file mode 100644 index 0000000000000..f315fc7cf457d --- /dev/null +++ b/recipes/mbits-utfconv/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.3": + url: "https://github.com/mbits-libs/utfconv/archive/v1.0.3.tar.gz" + sha256: "2077e3dcb999dc76d2bdc06cc141b38e10f15762975c261f72cc1a8c2519a27a" diff --git a/recipes/mbits-utfconv/all/conanfile.py b/recipes/mbits-utfconv/all/conanfile.py new file mode 100644 index 0000000000000..28ec757d2eaab --- /dev/null +++ b/recipes/mbits-utfconv/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsUtfConvConan(ConanFile): + name = "mbits-utfconv" + description = ( + "Conversion library between string, u16string, u32string and u8string." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/utfconv" + topics = ("utf-conversion", "utf", "conversion", "utfconv") + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "11.0.3", + } + + 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): + self.requires("mbits-semver/0.1.1") + + 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["UTFCONV_TESTING"] = False + tc.variables["UTFCONV_INSTALL"] = True + tc.variables["UTFCONV_BUILD_AS_STANDALONE"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["utfconv"] + + self.cpp_info.set_property("cmake_file_name", "mbits-utfconv") + self.cpp_info.set_property("cmake_target_name", "mbits::utfconv") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-utfconv" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-utfconv" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["utfconv"].set_property( + "cmake_target_name", "mbits::utfconv" + ) + self.cpp_info.components["utfconv"].libs = ["utfconv"] + self.cpp_info.components["utfconv"].requires = ["mbits-semver::semver"] diff --git a/recipes/mbits-utfconv/all/test_package/CMakeLists.txt b/recipes/mbits-utfconv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1afdb5a7117b8 --- /dev/null +++ b/recipes/mbits-utfconv/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-utfconv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::utfconv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-utfconv/all/test_package/conanfile.py b/recipes/mbits-utfconv/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/mbits-utfconv/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/mbits-utfconv/all/test_package/test_package.cpp b/recipes/mbits-utfconv/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0e688cebdcbaf --- /dev/null +++ b/recipes/mbits-utfconv/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include +#include + +using namespace utf; +using namespace std::literals; + +static constexpr auto smiley8sv = "\360\237\230\200"sv; +static constexpr auto smiley16 = u"\U0001F600"sv; + +int main() { + std::printf("Uses utf/%s\n", version.to_string().c_str()); + if (!utf::is_valid(smiley8sv)) + std::fprintf(stderr, "smiley8s is invalid...\n"); + if (!utf::is_valid(smiley16)) + std::fprintf(stderr, "smiley16 is invalid...\n"); + if (utf::as_str8(smiley16) != smiley8sv) + std::fprintf(stderr, "smiley16 differs from \"%.*s\"\n", + (int)smiley8sv.length(), smiley8sv.data()); +} diff --git a/recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt b/recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-utfconv/all/test_v1_package/conanfile.py b/recipes/mbits-utfconv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mbits-utfconv/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mbits-utfconv/config.yml b/recipes/mbits-utfconv/config.yml new file mode 100644 index 0000000000000..372dd1cb646bd --- /dev/null +++ b/recipes/mbits-utfconv/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.3": + folder: all diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml new file mode 100644 index 0000000000000..4d475c04d971c --- /dev/null +++ b/recipes/mcap/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + 1.0.0: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.0.0/main.tar.gz" + sha256: "e36169e46a67a9431f73df335f67488461817bc423f9af63ac0af7f29e0bd696" + 0.9.0: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.9.0/main.tar.gz" + sha256: "e17702fcc0259bf72eab0d84d3fa6e02c051256357ab7ba4421462f2c02b434f" + 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: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.4.0/main.tar.gz" + sha256: "c0ab99e51005fa8b74fe9ca1ed23b205cf532b8b0723eedd243f35a28d7b466b" + 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: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.2/main.tar.gz" + sha256: "0f456d6c53730445c3dbf57afd285493cf748c66a02f77d6e48c075128fd0896" + 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: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.0/main.tar.gz" + sha256: "a936abb1493b0d189d7909a79c45bdc6703b6016801e10b5cd129ba39642d2b2" diff --git a/recipes/mcap/all/conanfile.py b/recipes/mcap/all/conanfile.py new file mode 100644 index 0000000000000..0ea0db2622ab8 --- /dev/null +++ b/recipes/mcap/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class McapConan(ConanFile): + name = "mcap" + description = ( + "MCAP is a modular, performant, and serialization-agnostic container file format for pub/sub messages, " + "primarily intended for use in robotics applications." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/foxglove/mcap" + topics = ("serialization", "deserialization", "recording", "header-only") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "191", + "gcc": "9", + "clang": "9", + "apple-clang": "12", + } + + @property + def _source_package_path(self): + return os.path.join(self.source_folder, "cpp", "mcap") + + def configure(self): + if Version(self.version) < "0.3.0": + self.license = "Apache-2.0" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("lz4/1.9.4") + self.requires("zstd/1.5.4") + if Version(self.version) < "0.1.1": + self.requires("fmt/9.1.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if Version(self.version) < "0.1.1" and is_msvc(self): + raise ConanInvalidConfiguration("Visual Studio compiler has been supported since 0.1.1") + + 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", dst=os.path.join(self.package_folder, "licenses"), src=self._source_package_path) + copy(self, "*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._source_package_path, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mcap/all/test_package/CMakeLists.txt b/recipes/mcap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fa5c6d575b8ef --- /dev/null +++ b/recipes/mcap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mcap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mcap::mcap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mcap/all/test_package/conanfile.py b/recipes/mcap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..14c16cdc02a92 --- /dev/null +++ b/recipes/mcap/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +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 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/mcap/all/test_package/test_package.cpp b/recipes/mcap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4227377b8d5de --- /dev/null +++ b/recipes/mcap/all/test_package/test_package.cpp @@ -0,0 +1,101 @@ +#define MCAP_IMPLEMENTATION +#include +#include + +#include +#include + +struct Buffer : mcap::IReadable, mcap::IWritable { + std::vector buffer; + + virtual uint64_t size() const { + return buffer.size(); + } + + // IWritable + virtual void end() {} + virtual void handleWrite(const std::byte* data, uint64_t size) { + buffer.insert(buffer.end(), data, data + size); + } + + // IReadable + virtual uint64_t read(std::byte** output, uint64_t offset, uint64_t size) { + if (offset + size > buffer.size()) { + return 0; + } + *output = buffer.data() + offset; + return size; + } +}; + +void assertOk(const mcap::Status& status) { + if (!status.ok()) { + throw std::runtime_error(status.message); + } +} + +void expect(bool condition, const std::string& message) { + if (!condition) { + throw std::runtime_error(message); + } +} + +int main() { + Buffer buffer; + mcap::McapWriter writer; + + auto options = mcap::McapWriterOptions("example"); + options.compression = mcap::Compression::Zstd; + + writer.open(buffer, options); + + mcap::Schema schema("Example", "jsonschema", + R"({ "type": "object", "properties": { "foo": { "type": "string" } } })"); + writer.addSchema(schema); + + mcap::Channel channel("example", "json", schema.id); + writer.addChannel(channel); + + auto now = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count(); + + std::string payload = R"({"foo": "bar"})"; + mcap::Message msg; + msg.channelId = channel.id; + msg.sequence = 0; + msg.publishTime = now; + msg.logTime = msg.publishTime; + msg.data = reinterpret_cast(payload.data()); + msg.dataSize = payload.size(); + assertOk(writer.write(msg)); + + writer.close(); + + mcap::McapReader reader; + assertOk(reader.open(buffer)); + assertOk(reader.readSummary(mcap::ReadSummaryMethod::NoFallbackScan, assertOk)); + expect(reader.statistics().value().schemaCount == 1, "incorrect schemaCount"); + expect(reader.statistics().value().channelCount == 1, "incorrect channelCount"); + expect(reader.statistics().value().messageCount == 1, "incorrect messageCount"); + expect(reader.statistics().value().chunkCount == 1, "incorrect chunkCount"); + for (const auto& msgView : reader.readMessages()) { + expect(msgView.channel->id == channel.id, "incorrect channel id"); + expect(msgView.channel->topic == channel.topic, "incorrect channel topic"); + expect(msgView.channel->messageEncoding == channel.messageEncoding, + "incorrect channel messageEncoding"); + expect(msgView.schema->id == schema.id, "incorrect schema id"); + expect(msgView.schema->name == schema.name, "incorrect schema name"); + expect(msgView.schema->encoding == schema.encoding, "incorrect schema encoding"); + expect(msgView.message.sequence == msg.sequence, "incorrect message sequence"); + expect(msgView.message.logTime == msg.logTime, "incorrect message logTime"); + expect(msgView.message.publishTime == msg.publishTime, "incorrect message publishTime"); + expect(msgView.message.dataSize == msg.dataSize, "incorrect message dataSize"); + expect(msgView.message.data != msg.data, "data should be copied"); + expect(std::equal(msgView.message.data, msgView.message.data + msgView.message.dataSize, + msg.data, msg.data + msg.dataSize), + "incorrect data"); + } + std::cout << "MCAP " << mcap::LibraryVersion << " roundtrip succeeded!" << std::endl; + return 0; +} diff --git a/recipes/mcap/all/test_v1_package/CMakeLists.txt b/recipes/mcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/mcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mcap/all/test_v1_package/conanfile.py b/recipes/mcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/mcap/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mcap/config.yml b/recipes/mcap/config.yml new file mode 100644 index 0000000000000..8d906d6516e97 --- /dev/null +++ b/recipes/mcap/config.yml @@ -0,0 +1,17 @@ +versions: + 1.0.0: + folder: all + 0.9.0: + folder: all + 0.5.0: + folder: all + 0.4.0: + folder: all + 0.3.0: + folder: all + 0.1.2: + folder: all + 0.1.1: + folder: all + 0.1.0: + folder: all diff --git a/recipes/md4c/all/conandata.yml b/recipes/md4c/all/conandata.yml new file mode 100644 index 0000000000000..013088e384ddf --- /dev/null +++ b/recipes/md4c/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.4.8": + url: "https://github.com/mity/md4c/archive/refs/tags/release-0.4.8.tar.gz" + sha256: "4a457df853425b6bb6e3457aa1d1a13bccec587a04c38c622b1013a0da41439f" +patches: + "0.4.8": + - patch_file: "patches/0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py new file mode 100644 index 0000000000000..ad333104761a5 --- /dev/null +++ b/recipes/md4c/all/conanfile.py @@ -0,0 +1,112 @@ +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 + +import os + +required_conan_version = ">=1.54.0" + + +class Md4cConan(ConanFile): + name = "md4c" + description = "C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification." + license = "MIT" + topics = ("markdown-parser", "markdown") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mity/md4c" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "encoding": ["utf-8", "utf-16", "ascii"], + } + default_options = { + "shared": False, + "fPIC": True, + "encoding": "utf-8", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Windows" and self.options.encoding == "utf-16": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support utf-16 options on non-Windows platforms") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.options.encoding == "utf-8": + tc.preprocessor_definitions["MD4C_USE_UTF8"] = "1" + elif self.options.encoding == "utf-16": + tc.preprocessor_definitions["MD4C_USE_UTF16"] = "1" + elif self.options.encoding == "ascii": + tc.preprocessor_definitions["MD4C_USE_ASCII"] = "1" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Honor encoding option + replace_in_file( + self, + os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "COMPILE_FLAGS \"-DMD4C_USE_UTF8\"", + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "md4c") + + self.cpp_info.components["_md4c"].set_property("cmake_target_name", "md4c::md4c") + self.cpp_info.components["_md4c"].set_property("pkg_config_name", "md4c") + self.cpp_info.components["_md4c"].libs = ["md4c"] + if self.settings.os == "Windows" and self.options.encoding == "utf-16": + self.cpp_info.components["_md4c"].defines.append("MD4C_USE_UTF16") + + self.cpp_info.components["md4c_html"].set_property("cmake_target_name", "md4c::md4c-html") + self.cpp_info.components["md4c_html"].set_property("pkg_config_name", "md4c-html") + self.cpp_info.components["md4c_html"].libs = ["md4c-html"] + self.cpp_info.components["md4c_html"].requires = ["_md4c"] + + # workaround so that global target & pkgconfig file have all components while avoiding + # to create unofficial target or pkgconfig file + self.cpp_info.set_property("cmake_target_name", "md4c::md4c-html") + self.cpp_info.set_property("pkg_config_name", "md4c-html") + + # TODO: to remove in conan v2 + self.cpp_info.components["_md4c"].names["cmake_find_package"] = "md4c" + self.cpp_info.components["_md4c"].names["cmake_find_package_multi"] = "md4c" + self.cpp_info.components["md4c_html"].names["cmake_find_package"] = "md4c-html" + self.cpp_info.components["md4c_html"].names["cmake_find_package_multi"] = "md4c-html" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/md4c/all/patches/0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..a20b07a134764 --- /dev/null +++ b/recipes/md4c/all/patches/0001-honor-vc-runtime.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,15 +42,6 @@ elseif(MSVC) + # Disable warnings about the so-called unsecured functions: + add_definitions(/D_CRT_SECURE_NO_WARNINGS) + +- # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) diff --git a/recipes/md4c/all/test_package/CMakeLists.txt b/recipes/md4c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afe8788f52c1d --- /dev/null +++ b/recipes/md4c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(md4c CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(test_package PRIVATE md4c::md4c) diff --git a/recipes/md4c/all/test_package/conanfile.py b/recipes/md4c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/md4c/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/md4c/all/test_package/test_package.c b/recipes/md4c/all/test_package/test_package.c new file mode 100644 index 0000000000000..0bea1fda7770a --- /dev/null +++ b/recipes/md4c/all/test_package/test_package.c @@ -0,0 +1,57 @@ +#include "md4c.h" + +#include +#include + +int enter_block(MD_BLOCKTYPE type, void* detail, void* userdata) { + printf("enter block\n"); + return 0; +} + +int leave_block(MD_BLOCKTYPE type, void* detail, void* userdata) { + printf("leave block\n"); + return 0; +} + +int enter_span(MD_SPANTYPE type, void* detail, void* userdata) { + printf("enter span\n"); + return 0; +} + +int leave_span(MD_SPANTYPE type, void* detail, void* userdata) { + printf("leave span\n"); + return 0; +} + +int text_block(MD_TEXTTYPE type, const MD_CHAR* text, MD_SIZE size, void* usrdata) { + printf("text block\n"); + return 0; +} + +int main() { + const char DATA[] = + "# title\n" + "\n" + "example1\n" + "`example2`\n" + "\n" + "> example3\n" + "\n" + ; + + printf("%s\n", DATA); + + MD_PARSER parser; + + parser.abi_version = 0; + parser.flags = MD_FLAG_TABLES; + parser.enter_block = enter_block; + parser.leave_block = leave_block; + parser.enter_span = enter_span; + parser.leave_span = leave_span; + parser.text = text_block; + + md_parse(DATA, strlen(DATA), &parser, NULL); + + return 0; +} diff --git a/recipes/md4c/all/test_v1_package/CMakeLists.txt b/recipes/md4c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/md4c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/md4c/all/test_v1_package/conanfile.py b/recipes/md4c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/md4c/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/md4c/config.yml b/recipes/md4c/config.yml new file mode 100644 index 0000000000000..e89d9145fbd26 --- /dev/null +++ b/recipes/md4c/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.8": + folder: all diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml new file mode 100644 index 0000000000000..876c188b63e35 --- /dev/null +++ b/recipes/md4qt/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "2.0.8": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.8.tar.gz" + sha256: "50a47d407acf1ca6a5b96af0386da74f7cfb66322ec7453cbb543f4f66251683" + "2.0.7": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.7.tar.gz" + sha256: "2852ac88f95051ce0ce112e5d99695307d8748f47553b101edebecce03ee3eae" + "2.0.6": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.6.tar.gz" + sha256: "be6b227f8e0053fa7bf3a1a11f0e15cda72dabbe64cc9e50c9ea0789313a57c2" + "2.0.5": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.5.tar.gz" + sha256: "363cc13d35c66d8d89df25eef9ac49ec2d259781752208231bad32db4df5dd52" + "2.0.4": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.4.tar.gz" + sha256: "2980a0d0b5d3539a5a1402942a1345e97c8ab36acfc8e00d932df157d2e6edc2" + "2.0.3": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.3.tar.gz" + sha256: "374bfc74aa6ebb1ea7d2332b96f8b2f6001118793bbe4e55109a13d0ffe7ce55" + "2.0.2": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.2.tar.gz" + sha256: "721c7e5f8676dba1023931b9e2fd0d22cbc643bc9864c1d1163df3c5615e7e96" + "2.0.1": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.1.tar.gz" + sha256: "879f069cd12db44f2fcc33590ded1f9d778f4c854be14a7ad72fb2ff4acdb3d2" + "2.0.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.0.tar.gz" + sha256: "3c834c4d832208658f042bd85a821c297fafd0f2eedda9d6ddddced7b724f61a" diff --git a/recipes/md4qt/all/conanfile.py b/recipes/md4qt/all/conanfile.py new file mode 100644 index 0000000000000..ce75e30212e5e --- /dev/null +++ b/recipes/md4qt/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class Md4QtConan(ConanFile): + name = "md4qt" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/igormironchik/md4qt" + license = "MIT" + description = "Header-only C++ library for parsing Markdown." + topics = ("markdown", "gfm", "parser", "icu", "ast", "commonmark", "md", "qt6", "stl", "cpp17") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "191", + "gcc": "9", + "clang": "12", + "apple-clang": "14", + } + + def package_id(self): + self.info.clear() + + def requirements(self): + self.requires("icu/72.1") + self.requires("uriparser/0.9.7") + + 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, 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): + self.cpp_info.set_property("cmake_file_name", "md4qt") + self.cpp_info.set_property("cmake_target_name", "md4qt::md4qt") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/md4qt/all/test_package/CMakeLists.txt b/recipes/md4qt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3c95a973f47fa --- /dev/null +++ b/recipes/md4qt/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(md4qt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE md4qt::md4qt) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/md4qt/all/test_package/conanfile.py b/recipes/md4qt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c78095722f7aa --- /dev/null +++ b/recipes/md4qt/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + md_path = os.path.join(self.source_folder, "test.md") + self.run("{} \"{}\"".format(bin_path, md_path), env="conanrun") diff --git a/recipes/md4qt/all/test_package/test.md b/recipes/md4qt/all/test_package/test.md new file mode 100644 index 0000000000000..3de705a41ff24 --- /dev/null +++ b/recipes/md4qt/all/test_package/test.md @@ -0,0 +1 @@ +Text diff --git a/recipes/md4qt/all/test_package/test_package.cpp b/recipes/md4qt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e1265d68ef6a6 --- /dev/null +++ b/recipes/md4qt/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#define MD4QT_ICU_STL_SUPPORT +#include + +#include +#include +#include +#include +#include + +int main(int argc, char ** argv) +{ + if (argc < 2) { + std::cerr << "Need an argument\n"; + return 1; + } + + MD::Parser< MD::UnicodeStringTrait > parser; + + const auto doc = parser.parse(MD::UnicodeString(argv[1])); + + auto path = std::filesystem::canonical(std::filesystem::path(argv[1], + std::filesystem::path::generic_format)).u8string(); + std::replace( path.begin(), path.end(), '\\', '/' ); + + if(std::static_pointer_cast>(doc->items().at(0))->label() == + MD::UnicodeString(path)) + return 0; + else + return 1; +} diff --git a/recipes/md4qt/all/test_v1_package/CMakeLists.txt b/recipes/md4qt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b24e1b03fbf83 --- /dev/null +++ b/recipes/md4qt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(md4qt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE md4qt::md4qt) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/md4qt/all/test_v1_package/conanfile.py b/recipes/md4qt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df702b6f48d7c --- /dev/null +++ b/recipes/md4qt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + md_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.md") + self.run("{} \"{}\"".format(bin_path, md_path), run_environment=True) diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml new file mode 100644 index 0000000000000..9e06767160daf --- /dev/null +++ b/recipes/md4qt/config.yml @@ -0,0 +1,19 @@ +versions: + "2.0.8": + folder: all + "2.0.7": + folder: all + "2.0.6": + folder: all + "2.0.5": + folder: all + "2.0.4": + folder: all + "2.0.3": + folder: all + "2.0.2": + folder: all + "2.0.1": + folder: all + "2.0.0": + folder: all diff --git a/recipes/mdns/all/conandata.yml b/recipes/mdns/all/conandata.yml new file mode 100644 index 0000000000000..ef0896308dfb2 --- /dev/null +++ b/recipes/mdns/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.0": + sha256: e06ed954b4705f0e48f3e6bd44b75c115ee03f745c62394ee615f466e44e9373 + url: https://github.com/mjansson/mdns/archive/1.0.tar.gz + "1.1": + sha256: a0d170bc88151235b9f2dea10a9ffd1d538e4ce3b098426893fd45890efcbffb + url: https://github.com/mjansson/mdns/archive/1.1.tar.gz + "1.2": + sha256: 1919f8fd01b2b7e1128e51d51e4bd9e48fd4f2ef4ade88c152970a35d2084bae + url: https://github.com/mjansson/mdns/archive/1.2.tar.gz + "1.3": + url: "https://github.com/mjansson/mdns/archive/1.3.tar.gz" + sha256: "d3bfd684ef07beadca71c426586be88a10a92026fe6fe5355609d9e805ff5f85" + "1.4": + url: "https://github.com/mjansson/mdns/archive/1.4.tar.gz" + sha256: "413af72a6ce655dc96d35584dd0134f4ba87534ff78471b5b578e175b9f58dd5" + "1.4.1": + url: "https://github.com/mjansson/mdns/archive/1.4.1.tar.gz" + sha256: "decaf007376c62389712dda67c0eaa8ffb682e7be32ece816b1646119f061be3" + "1.4.2": + url: "https://github.com/mjansson/mdns/archive/1.4.2.tar.gz" + sha256: "c69cfdebe28a489c85f33744f7811c40572a9769a81cd57ecc09ef95802347f2" diff --git a/recipes/mdns/all/conanfile.py b/recipes/mdns/all/conanfile.py new file mode 100644 index 0000000000000..aa012f43092fc --- /dev/null +++ b/recipes/mdns/all/conanfile.py @@ -0,0 +1,38 @@ +import os +from conans import CMake, ConanFile, tools + +required_conan_version = ">=1.43.0" + +class MdnsConan(ConanFile): + name = "mdns" + license = "Unlicense" + homepage = "https://github.com/mjansson/mdns" + url = "https://github.com/conan-io/conan-center-index" + description = "Public domain mDNS/DNS-SD library in C" + topics = ("mdns", "dns", "dns-sd", "multicast discovery", "discovery") + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.h", dst="include", src=self._source_subfolder) + + def package_info(self): + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["iphlpapi", "ws2_32"] + if str(self.settings.os) in ["Linux", "Android"]: + self.cpp_info.system_libs.append('pthread') + + self.cpp_info.set_property("cmake_file_name", "mdns") + self.cpp_info.set_property("cmake_target_name", "mdns::mdns") diff --git a/recipes/mdns/all/test_package/CMakeLists.txt b/recipes/mdns/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c7366be61abf1 --- /dev/null +++ b/recipes/mdns/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99) diff --git a/recipes/mdns/all/test_package/conanfile.py b/recipes/mdns/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c0a50e0f7678 --- /dev/null +++ b/recipes/mdns/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/mdns/all/test_package/test_package.c b/recipes/mdns/all/test_package/test_package.c new file mode 100644 index 0000000000000..b27d9acd4f04b --- /dev/null +++ b/recipes/mdns/all/test_package/test_package.c @@ -0,0 +1,43 @@ + +#ifdef _WIN32 +# define _CRT_SECURE_NO_WARNINGS 1 +#endif + +#include "mdns.h" + +#include +#include + +#ifdef _WIN32 +# include +# define sleep(x) Sleep(x * 1000) +#else +# include +#endif + +int +main(int argc, const char* const* argv) { +#ifdef _WIN32 + WORD versionWanted = MAKEWORD(1, 1); + WSADATA wsaData; + if (WSAStartup(versionWanted, &wsaData)) { + printf("Failed to initialize WinSock\n"); + return -1; + } +#endif + + int port = 0; + int sock = mdns_socket_open_ipv4(port); + if (sock < 0) { + printf("Failed to open socket: %s\n", strerror(errno)); + return -1; + } + + printf("socket cleanup\n"); + mdns_socket_close(sock); +#ifdef _WIN32 + WSACleanup(); +#endif + + return 0; +} diff --git a/recipes/mdns/config.yml b/recipes/mdns/config.yml new file mode 100644 index 0000000000000..cdb4b7bded43e --- /dev/null +++ b/recipes/mdns/config.yml @@ -0,0 +1,15 @@ +versions: + "1.0": + folder: "all" + "1.1": + folder: "all" + "1.2": + folder: "all" + "1.3": + folder: "all" + "1.4": + folder: "all" + "1.4.1": + folder: "all" + "1.4.2": + folder: "all" diff --git a/recipes/mdnsresponder/all/conandata.yml b/recipes/mdnsresponder/all/conandata.yml new file mode 100644 index 0000000000000..cadda75d51e61 --- /dev/null +++ b/recipes/mdnsresponder/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "878.200.35": + url: "https://github.com/apple-oss-distributions/mDNSResponder/archive/mDNSResponder-878.200.35.tar.gz" + sha256: "71769924286328a3c405700856c9897c5277360b2f9fd0f450440304d315f6c1" + "1310.140.1": + url: "https://github.com/apple-oss-distributions/mDNSResponder/archive/mDNSResponder-1310.140.1.tar.gz" + sha256: "ecb0043ffc5a3cbf4f43da0298e351d787654d980b291d1cb567c6ddee9dc983" +patches: + "878.200.35": + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/DLLStub.c.patch" + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/mDNSResponder.sln.patch" + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/mDNSWin32.c.patch" + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/Service.c.patch" + "878.200.35-opt": + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/opt/permit-over-long-service-types.patch" + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/opt/poll-rather-than-select.patch" + - base_path: "source_subfolder" + patch_file: "patches/878.200.35/opt/unicast.patch" + "1310.140.1": + - base_path: "source_subfolder" + patch_file: "patches/1310.140.1/dns_sd.c.patch" diff --git a/recipes/mdnsresponder/all/conanfile.py b/recipes/mdnsresponder/all/conanfile.py new file mode 100644 index 0000000000000..5e0b8a3e6f765 --- /dev/null +++ b/recipes/mdnsresponder/all/conanfile.py @@ -0,0 +1,188 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild +from conans.errors import ConanInvalidConfiguration +from conan.tools.files.symlinks import absolute_to_relative_symlinks +import os + +required_conan_version = ">=1.33.0" + + +class MdnsResponderConan(ConanFile): + name = "mdnsresponder" + description = "Conan package for Apple's mDNSResponder" + topics = ("Bonjour", "DNS-SD", "mDNS") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://opensource.apple.com/tarballs/mDNSResponder/" + license = "Apache-2.0", "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_opt_patches": [True, False], + } + default_options = { + "with_opt_patches": False, + } + exports_sources = ["patches/**"] + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def validate(self): + if self.settings.os not in ["Linux", "Windows"]: + raise ConanInvalidConfiguration("Only Linux and Windows are supported for this package.") + if tools.Version(self.version) >= "1096.0.2": + # recent tarballs (since 1096.0.2) are missing mDNSWindows, so for now, Linux only + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported for version {}.".format(self.version)) + # TCP_NOTSENT_LOWAT is causing build failures for packages built with gcc 4.9 + # the best check would probably be for Linux kernel v3.12, but for now... + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Only gcc 5 or higher is supported for this package.") + # __has_c_attribute is not available in Clang 5 + if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("Only Clang 6 or higher is supported for this package.") + # FIXME: Migration of the project files fails with VS 2017 on c3i (conan-center-index's infrastructure) + # though works OK with VS 2015 and VS 2019, and works with VS 2017 in my local environment + if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) == "15": + raise ConanInvalidConfiguration("Visual Studio 2017 is not supported in CCI (yet).") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @property + def _posix_folder(self): + return os.path.join(self._source_subfolder, "mDNSPosix") + + @property + def _make_build_args(self): + # the Makefile does not support parallel builds + return [ + "os=linux", + "-j1", + ] + + @property + def _make_build_targets(self): + return " ".join(["setup", "Daemon", "libdns_sd", "Clients"]) + + @property + def _make_install_args(self): + return self._make_build_args + [ + "INSTBASE={}".format(self.package_folder), + "STARTUPSCRIPTDIR={}/bin".format(self.package_folder), + "RUNLEVELSCRIPTSDIR=", + ] + + @property + def _make_install_targets(self): + # not installing man pages, NSS plugin + return " ".join(["setup", "InstalledDaemon", "InstalledLib", "InstalledClients"]) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + # fix for error: 'for' loop initial declarations are only allowed in C99 or C11 mode + self._autotools.flags.append("-std=gnu99") + return self._autotools + + def _build_make(self): + with tools.chdir(self._posix_folder): + autotools = self._configure_autotools() + autotools.make(args=self._make_build_args, target=self._make_build_targets) + + @property + def _msvc_targets(self): + return ["mDNSResponder", "DLL", "DLLStub", "dns-sd"] + + @property + def _msvc_definitions(self): + return {"_WINSOCK_DEPRECATED_NO_WARNINGS": None} + + @property + def _msvc_platforms(self): + return {"x86": "Win32", "x86_64": "x64"} + + @property + def _msvc_platform(self): + return self._msvc_platforms[str(self.settings.arch)] + + def _build_msvc(self): + sln = os.path.join(self._source_subfolder, "mDNSResponder.sln") + if "MD" in self.settings.compiler.runtime: + # could use glob and replace_in_file(strict=False, ...) + dll_vcxproj = os.path.join(self._source_subfolder, "mDNSWindows", "DLL", "dnssd.vcxproj") + dllstub_vcxproj = os.path.join(self._source_subfolder, "mDNSWindows", "DLLStub", "DLLStub.vcxproj") + dns_sd_vcxproj = os.path.join(self._source_subfolder, "Clients", "DNS-SD.VisualStudio", "dns-sd.vcxproj") + for vcxproj in [dll_vcxproj, dllstub_vcxproj, dns_sd_vcxproj]: + tools.replace_in_file(vcxproj, "MultiThreaded", "MultiThreadedDLL") + tools.replace_in_file(vcxproj, "MultiThreadedDebug", "MultiThreadedDebugDLL") + + # could use glob and replace_in_file(strict=False, ...) + dll_rc = os.path.join(self._source_subfolder, "mDNSWindows", "DLL", "dll.rc") + dns_sd_rc = os.path.join(self._source_subfolder, "Clients", "DNS-SD.VisualStudio", "dns-sd.rc") + for rc in [dll_rc, dns_sd_rc]: + tools.replace_in_file(rc, "afxres.h", "winres.h") + + msbuild = MSBuild(self) + msbuild.build(sln, targets=self._msvc_targets, platforms=self._msvc_platforms, definitions=self._msvc_definitions) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if self.options.with_opt_patches: + for patch in self.conan_data.get("patches", {}).get("{}-opt".format(self.version), []): + tools.patch(**patch) + if self.settings.os == "Linux": + self._build_make() + elif self.settings.os == "Windows": + self._build_msvc() + + def _install_make(self): + for dir in ["bin", "include", "lib", "sbin"]: + tools.mkdir(os.path.join(self.package_folder, dir)) + with tools.chdir(self._posix_folder): + autotools = self._configure_autotools() + autotools.make(args=self._make_install_args, target=self._make_install_targets) + # package the daemon in bin too + tools.rename(os.path.join(self.package_folder, "sbin", "mdnsd"), + os.path.join(self.package_folder, "bin", "mdnsd")) + tools.rmdir(os.path.join(self.package_folder, "sbin")) + absolute_to_relative_symlinks(self, self.package_folder) + + def _msvc_build_folder(self, *argv): + return os.path.join(self._source_subfolder, *argv, self._msvc_platform, str(self.settings.build_type)) + + def _install_msvc(self): + self.copy("mDNSResponder.exe", dst="bin", src=self._msvc_build_folder("mDNSWindows", "SystemService")) + self.copy("dns_sd.h", dst="include", src=os.path.join(self._source_subfolder, "mDNSShared")) + self.copy("dnssd.dll", dst="bin", src=self._msvc_build_folder("mDNSWindows", "DLL")) + self.copy("dnssdStatic.lib", dst="lib", src=self._msvc_build_folder("mDNSWindows", "DLLStub")) + # rename consistently with Bonjour SDK + tools.rename(src=os.path.join(self.package_folder, "lib", "dnssdStatic.lib"), + dst=os.path.join(self.package_folder, "lib", "dnssd.lib")) + self.copy("dns-sd.exe", dst="bin", src=self._msvc_build_folder("Clients", "DNS-SD.VisualStudio")) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + if self.settings.os == "Linux": + self._install_make() + elif self.settings.os == "Windows": + self._install_msvc() + + def package_info(self): + # although not one of the find-modules in the CMake distribution, FindDNSSD.cmake is commonly used for this package + self.cpp_info.names["cmake_find_package"] = "DNSSD" + self.cpp_info.names["cmake_find_package_multi"] = "DNSSD" + + if self.settings.os == "Linux": + self.cpp_info.libs = ["dns_sd"] + elif self.settings.os == "Windows": + self.cpp_info.libs = ["dnssd"] + + # add path for daemon (mdnsd, mDNSResponder) and client (dns-sd) + 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/mdnsresponder/all/patches/1310.140.1/dns_sd.c.patch b/recipes/mdnsresponder/all/patches/1310.140.1/dns_sd.c.patch new file mode 100644 index 0000000000000..466a24eae2b74 --- /dev/null +++ b/recipes/mdnsresponder/all/patches/1310.140.1/dns_sd.c.patch @@ -0,0 +1,19 @@ +--- Clients/dns-sd.c ++++ Clients/dns-sd.c +@@ -58,6 +58,7 @@ + //#define TEST_NEW_CLIENTSTUB 1 + + #include ++#include // For va_list, va_start, va_end + #include // For stdout, stderr + #include // For exit() + #include // For strlen(), strcpy() +@@ -943,7 +944,7 @@ + va_end(ptr); + if (result > 0 && size > 0) + { +- length = MIN((size_t)result, size-1); ++ length = ((((size_t)result)<(size-1))?((size_t)result):(size-1)); + } + return length; + } diff --git a/recipes/mdnsresponder/all/patches/878.200.35/DLLStub.c.patch b/recipes/mdnsresponder/all/patches/878.200.35/DLLStub.c.patch new file mode 100644 index 0000000000000..67185c78d1cdb --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/DLLStub.c.patch @@ -0,0 +1,32 @@ +--- mDNSWindows/DLLStub/DLLStub.cpp ++++ mDNSWindows/DLLStub/DLLStub.cpp +@@ -83,9 +83,9 @@ + dnssd_sock_t DNSSD_API + DNSServiceRefSockFD(DNSServiceRef sdRef) + { +- typedef int (DNSSD_API * Func)(DNSServiceRef sdRef); ++ typedef dnssd_sock_t (DNSSD_API * Func)(DNSServiceRef sdRef); + static Func func = NULL; +- int ret = INVALID_SOCKET; ++ dnssd_sock_t ret = INVALID_SOCKET; + + if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) ) + { +@@ -354,7 +354,7 @@ + void *context /* may be NULL */ + ) + { +- typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef, DNSRecordRef*, DNSServiceFlags, uint32_t, const char*, uint16_t, uint16_t, uint16_t, const void*, uint16_t, DNSServiceRegisterRecordReply, void* ); ++ typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef, DNSRecordRef*, DNSServiceFlags, uint32_t, const char*, uint16_t, uint16_t, uint16_t, const void*, uint32_t, DNSServiceRegisterRecordReply, void* ); + static Func func = NULL; + DNSServiceErrorType ret = g_defaultErrorCode; + +@@ -432,7 +432,7 @@ + void *context /* may be NULL */ + ) + { +- typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, DNSServiceProtocol, uint16_t, uint16_t, uint16_t, DNSServiceNATPortMappingReply, void* ); ++ typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, DNSServiceProtocol, uint16_t, uint16_t, uint32_t, DNSServiceNATPortMappingReply, void* ); + static Func func = NULL; + DNSServiceErrorType ret = g_defaultErrorCode; + diff --git a/recipes/mdnsresponder/all/patches/878.200.35/Service.c.patch b/recipes/mdnsresponder/all/patches/878.200.35/Service.c.patch new file mode 100644 index 0000000000000..a07e42f9c45af --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/Service.c.patch @@ -0,0 +1,42 @@ +--- mDNSWindows/SystemService/Service.c ++++ mDNSWindows/SystemService/Service.c +@@ -1075,9 +1075,6 @@ + BOOL initialized; + BOOL ok; + +- DEBUG_UNUSED( argc ); +- DEBUG_UNUSED( argv ); +- + initialized = FALSE; + + // Make the service as running before we call ServiceSpecificInitialize. We've +@@ -1197,9 +1194,6 @@ + { + OSStatus err; + +- DEBUG_UNUSED( argc ); +- DEBUG_UNUSED( argv ); +- + mDNSPlatformMemZero( &gMDNSRecord, sizeof gMDNSRecord); + mDNSPlatformMemZero( &gPlatformStorage, sizeof gPlatformStorage); + +@@ -2127,9 +2121,8 @@ + } + + +-mDNSexport void RecordUpdatedNiceLabel(mDNS *const m, mDNSs32 delay) ++mDNSexport void RecordUpdatedNiceLabel(mDNSs32 delay) + { +- (void)m; + (void)delay; + // No-op, for now + } +@@ -2340,8 +2333,6 @@ + { + OSStatus err = kNoErr; + +- DEBUG_UNUSED( inMDNS ); +- + // + // Don't call SetLLRoute on loopback + // Default route on Windows 7 breaks network connectivity diff --git a/recipes/mdnsresponder/all/patches/878.200.35/mDNSResponder.sln.patch b/recipes/mdnsresponder/all/patches/878.200.35/mDNSResponder.sln.patch new file mode 100644 index 0000000000000..b824a508aa80f --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/mDNSResponder.sln.patch @@ -0,0 +1,333 @@ +--- mDNSResponder.sln ++++ mDNSResponder.sln +@@ -4,67 +4,13 @@ + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder", "mDNSWindows\SystemService\Service.vcxproj", "{C1D98254-BA27-4427-A3BE-A68CA2CC5F69}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSPTool", "mDNSWindows\NSPTool\NSPTool.vcxproj", "{208B3A9F-1CA0-4D1D-9D6C-C61616F94705}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdnsNSP", "mDNSWindows\mdnsNSP\mdnsNSP.vcxproj", "{F4F15529-F0EB-402F-8662-73C5797EE557}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPlugin", "Clients\ExplorerPlugin\ExplorerPlugin.vcxproj", "{BB8AC1B5-6587-4163-BDC6-788B157705CA}" +- ProjectSection(ProjectDependencies) = postProject +- {1643427B-F226-4AD6-B413-97DA64D5C6B4} = {1643427B-F226-4AD6-B413-97DA64D5C6B4} +- EndProjectSection +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizard", "Clients\PrinterSetupWizard\PrinterSetupWizard.vcxproj", "{B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}" +- ProjectSection(ProjectDependencies) = postProject +- {967F5375-0176-43D3-ADA3-22EE25551C37} = {967F5375-0176-43D3-ADA3-22EE25551C37} +- EndProjectSection +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizardLocRes", "Clients\PrinterSetupWizard\PrinterSetupWizardLocRes.vcxproj", "{967F5375-0176-43D3-ADA3-22EE25551C37}" +- ProjectSection(ProjectDependencies) = postProject +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52} = {CFCCB176-6CAA-472B-B0A2-90511C8E2E52} +- EndProjectSection +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizardRes", "Clients\PrinterSetupWizard\PrinterSetupWizardRes.vcxproj", "{CFCCB176-6CAA-472B-B0A2-90511C8E2E52}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPluginLocRes", "Clients\ExplorerPlugin\ExplorerPluginLocRes.vcxproj", "{1643427B-F226-4AD6-B413-97DA64D5C6B4}" +- ProjectSection(ProjectDependencies) = postProject +- {871B1492-B4A4-4B57-9237-FA798484D7D7} = {871B1492-B4A4-4B57-9237-FA798484D7D7} +- EndProjectSection +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPluginRes", "Clients\ExplorerPlugin\ExplorerPluginRes.vcxproj", "{871B1492-B4A4-4B57-9237-FA798484D7D7}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dns-sd", "Clients\DNS-SD.VisualStudio\dns-sd.vcxproj", "{AA230639-E115-4A44-AA5A-44A61235BA50}" + ProjectSection(ProjectDependencies) = postProject + {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E} + EndProjectSection + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Java", "mDNSWindows\Java\Java.vcxproj", "{9CE2568A-3170-41C6-9F20-A0188A9EC114}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JavaSamples", "Clients\Java\JavaSamples.vcxproj", "{A987A0C1-344F-475C-869C-F082EB11EEBA}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLLStub", "mDNSWindows\DLLStub\DLLStub.vcxproj", "{3A2B6325-3053-4236-84BD-AA9BE2E323E5}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLLX", "mDNSWindows\DLLX\DLLX.vcxproj", "{78FBFCC5-2873-4AE2-9114-A08082F71124}" +-EndProject +-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DNSServiceBrowser.NET", "Clients\DNSServiceBrowser.NET\DNSServiceBrowser.NET.csproj", "{DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}" +-EndProject +-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DNSServiceBrowser.VB", "Clients\DNSServiceBrowser.VB\DNSServiceBrowser.VB.vbproj", "{FB79E297-5703-435C-A829-51AA51CD71C2}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSNetMonitor", "Clients\mDNSNetMonitor.VisualStudio\mDNSNetMonitor.vcxproj", "{AF35C285-528D-46A1-8A0E-47B0733DC718}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanelLocRes", "mDNSWindows\ControlPanel\ControlPanelLocRes.vcxproj", "{4490229E-025A-478F-A2CF-51154DA83E39}" +- ProjectSection(ProjectDependencies) = postProject +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215} = {5254AA9C-3D2E-4539-86D9-5EB0F4151215} +- EndProjectSection +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanelRes", "mDNSWindows\ControlPanel\ControlPanelRes.vcxproj", "{5254AA9C-3D2E-4539-86D9-5EB0F4151215}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanel", "mDNSWindows\ControlPanel\ControlPanel.vcxproj", "{0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}" +- ProjectSection(ProjectDependencies) = postProject +- {4490229E-025A-478F-A2CF-51154DA83E39} = {4490229E-025A-478F-A2CF-51154DA83E39} +- EndProjectSection +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FirefoxExtension", "Clients\FirefoxExtension\FirefoxExtension.vcxproj", "{7826EA27-D4CC-4FAA-AD23-DF813823227B}" +-EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU +@@ -105,118 +51,6 @@ + {C1D98254-BA27-4427-A3BE-A68CA2CC5F69}.Release|Win32.Build.0 = Release|Win32 + {C1D98254-BA27-4427-A3BE-A68CA2CC5F69}.Release|x64.ActiveCfg = Release|x64 + {C1D98254-BA27-4427-A3BE-A68CA2CC5F69}.Release|x64.Build.0 = Release|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|Win32.ActiveCfg = Debug|Win32 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|Win32.Build.0 = Debug|Win32 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|x64.ActiveCfg = Debug|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Debug|x64.Build.0 = Debug|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|Any CPU.ActiveCfg = Release|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|Mixed Platforms.Build.0 = Release|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|Win32.ActiveCfg = Release|Win32 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|Win32.Build.0 = Release|Win32 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|x64.ActiveCfg = Release|x64 +- {208B3A9F-1CA0-4D1D-9D6C-C61616F94705}.Release|x64.Build.0 = Release|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|Win32.ActiveCfg = Debug|Win32 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|Win32.Build.0 = Debug|Win32 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|x64.ActiveCfg = Debug|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Debug|x64.Build.0 = Debug|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|Any CPU.ActiveCfg = Release|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|Mixed Platforms.Build.0 = Release|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|Win32.ActiveCfg = Release|Win32 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|Win32.Build.0 = Release|Win32 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|x64.ActiveCfg = Release|x64 +- {F4F15529-F0EB-402F-8662-73C5797EE557}.Release|x64.Build.0 = Release|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|Win32.ActiveCfg = Debug|Win32 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|Win32.Build.0 = Debug|Win32 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|x64.ActiveCfg = Debug|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Debug|x64.Build.0 = Debug|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|Any CPU.ActiveCfg = Release|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|Mixed Platforms.Build.0 = Release|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|Win32.ActiveCfg = Release|Win32 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|Win32.Build.0 = Release|Win32 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|x64.ActiveCfg = Release|x64 +- {BB8AC1B5-6587-4163-BDC6-788B157705CA}.Release|x64.Build.0 = Release|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|Win32.ActiveCfg = Debug|Win32 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|Win32.Build.0 = Debug|Win32 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|x64.ActiveCfg = Debug|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Debug|x64.Build.0 = Debug|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|Any CPU.ActiveCfg = Release|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|Mixed Platforms.Build.0 = Release|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|Win32.ActiveCfg = Release|Win32 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|Win32.Build.0 = Release|Win32 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|x64.ActiveCfg = Release|x64 +- {B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}.Release|x64.Build.0 = Release|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|Win32.ActiveCfg = Debug|Win32 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|Win32.Build.0 = Debug|Win32 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|x64.ActiveCfg = Debug|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Debug|x64.Build.0 = Debug|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|Any CPU.ActiveCfg = Release|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|Mixed Platforms.Build.0 = Release|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|Win32.ActiveCfg = Release|Win32 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|Win32.Build.0 = Release|Win32 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|x64.ActiveCfg = Release|x64 +- {967F5375-0176-43D3-ADA3-22EE25551C37}.Release|x64.Build.0 = Release|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|Win32.ActiveCfg = Debug|Win32 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|Win32.Build.0 = Debug|Win32 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|x64.ActiveCfg = Debug|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Debug|x64.Build.0 = Debug|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|Any CPU.ActiveCfg = Release|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|Mixed Platforms.Build.0 = Release|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|Win32.ActiveCfg = Release|Win32 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|Win32.Build.0 = Release|Win32 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|x64.ActiveCfg = Release|x64 +- {CFCCB176-6CAA-472B-B0A2-90511C8E2E52}.Release|x64.Build.0 = Release|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|Win32.ActiveCfg = Debug|Win32 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|Win32.Build.0 = Debug|Win32 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|x64.ActiveCfg = Debug|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Debug|x64.Build.0 = Debug|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|Any CPU.ActiveCfg = Release|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|Mixed Platforms.Build.0 = Release|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|Win32.ActiveCfg = Release|Win32 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|Win32.Build.0 = Release|Win32 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|x64.ActiveCfg = Release|x64 +- {1643427B-F226-4AD6-B413-97DA64D5C6B4}.Release|x64.Build.0 = Release|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|Win32.ActiveCfg = Debug|Win32 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|Win32.Build.0 = Debug|Win32 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|x64.ActiveCfg = Debug|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Debug|x64.Build.0 = Debug|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|Any CPU.ActiveCfg = Release|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|Mixed Platforms.Build.0 = Release|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|Win32.ActiveCfg = Release|Win32 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|Win32.Build.0 = Release|Win32 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|x64.ActiveCfg = Release|x64 +- {871B1492-B4A4-4B57-9237-FA798484D7D7}.Release|x64.Build.0 = Release|x64 + {AA230639-E115-4A44-AA5A-44A61235BA50}.Debug|Any CPU.ActiveCfg = Debug|x64 + {AA230639-E115-4A44-AA5A-44A61235BA50}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {AA230639-E115-4A44-AA5A-44A61235BA50}.Debug|Mixed Platforms.Build.0 = Debug|x64 +@@ -231,32 +65,6 @@ + {AA230639-E115-4A44-AA5A-44A61235BA50}.Release|Win32.Build.0 = Release|Win32 + {AA230639-E115-4A44-AA5A-44A61235BA50}.Release|x64.ActiveCfg = Release|x64 + {AA230639-E115-4A44-AA5A-44A61235BA50}.Release|x64.Build.0 = Release|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|Win32.ActiveCfg = Debug|Win32 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|Win32.Build.0 = Debug|Win32 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|x64.ActiveCfg = Debug|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Debug|x64.Build.0 = Debug|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|Any CPU.ActiveCfg = Release|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|Mixed Platforms.Build.0 = Release|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|Win32.ActiveCfg = Release|Win32 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|Win32.Build.0 = Release|Win32 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|x64.ActiveCfg = Release|x64 +- {9CE2568A-3170-41C6-9F20-A0188A9EC114}.Release|x64.Build.0 = Release|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Debug|Win32.ActiveCfg = Debug|Win32 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Debug|Win32.Build.0 = Debug|Win32 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Debug|x64.ActiveCfg = Debug|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Release|Any CPU.ActiveCfg = Release|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Release|Mixed Platforms.Build.0 = Release|x64 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Release|Win32.ActiveCfg = Release|Win32 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Release|Win32.Build.0 = Release|Win32 +- {A987A0C1-344F-475C-869C-F082EB11EEBA}.Release|x64.ActiveCfg = Release|x64 + {3A2B6325-3053-4236-84BD-AA9BE2E323E5}.Debug|Any CPU.ActiveCfg = Debug|x64 + {3A2B6325-3053-4236-84BD-AA9BE2E323E5}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {3A2B6325-3053-4236-84BD-AA9BE2E323E5}.Debug|Mixed Platforms.Build.0 = Debug|x64 +@@ -271,110 +79,6 @@ + {3A2B6325-3053-4236-84BD-AA9BE2E323E5}.Release|Win32.Build.0 = Release|Win32 + {3A2B6325-3053-4236-84BD-AA9BE2E323E5}.Release|x64.ActiveCfg = Release|x64 + {3A2B6325-3053-4236-84BD-AA9BE2E323E5}.Release|x64.Build.0 = Release|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|Win32.ActiveCfg = Debug|Win32 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|Win32.Build.0 = Debug|Win32 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|x64.ActiveCfg = Debug|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Debug|x64.Build.0 = Debug|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|Any CPU.ActiveCfg = Release|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|Mixed Platforms.Build.0 = Release|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|Win32.ActiveCfg = Release|Win32 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|Win32.Build.0 = Release|Win32 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|x64.ActiveCfg = Release|x64 +- {78FBFCC5-2873-4AE2-9114-A08082F71124}.Release|x64.Build.0 = Release|x64 +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Debug|Win32.ActiveCfg = Debug|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Debug|x64.ActiveCfg = Debug|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Release|Any CPU.Build.0 = Release|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Release|Mixed Platforms.Build.0 = Release|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Release|Win32.ActiveCfg = Release|Any CPU +- {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}.Release|x64.ActiveCfg = Release|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Debug|Win32.ActiveCfg = Debug|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Debug|x64.ActiveCfg = Debug|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Release|Any CPU.Build.0 = Release|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Release|Mixed Platforms.Build.0 = Release|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Release|Win32.ActiveCfg = Release|Any CPU +- {FB79E297-5703-435C-A829-51AA51CD71C2}.Release|x64.ActiveCfg = Release|Any CPU +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Any CPU.ActiveCfg = Debug|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Mixed Platforms.Build.0 = Debug|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Win32.ActiveCfg = Debug|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Win32.Build.0 = Debug|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|x64.ActiveCfg = Debug|x64 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Any CPU.ActiveCfg = Release|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Mixed Platforms.ActiveCfg = Release|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Mixed Platforms.Build.0 = Release|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Win32.ActiveCfg = Release|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Win32.Build.0 = Release|Win32 +- {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|x64.ActiveCfg = Release|Win32 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|Win32.ActiveCfg = Debug|Win32 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|Win32.Build.0 = Debug|Win32 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|x64.ActiveCfg = Debug|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Debug|x64.Build.0 = Debug|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|Any CPU.ActiveCfg = Release|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|Mixed Platforms.Build.0 = Release|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|Win32.ActiveCfg = Release|Win32 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|Win32.Build.0 = Release|Win32 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|x64.ActiveCfg = Release|x64 +- {4490229E-025A-478F-A2CF-51154DA83E39}.Release|x64.Build.0 = Release|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|Win32.ActiveCfg = Debug|Win32 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|Win32.Build.0 = Debug|Win32 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|x64.ActiveCfg = Debug|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Debug|x64.Build.0 = Debug|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|Any CPU.ActiveCfg = Release|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|Mixed Platforms.Build.0 = Release|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|Win32.ActiveCfg = Release|Win32 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|Win32.Build.0 = Release|Win32 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|x64.ActiveCfg = Release|x64 +- {5254AA9C-3D2E-4539-86D9-5EB0F4151215}.Release|x64.Build.0 = Release|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|Any CPU.ActiveCfg = Debug|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|Mixed Platforms.Build.0 = Debug|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|Win32.ActiveCfg = Debug|Win32 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|Win32.Build.0 = Debug|Win32 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|x64.ActiveCfg = Debug|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Debug|x64.Build.0 = Debug|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|Any CPU.ActiveCfg = Release|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|Mixed Platforms.ActiveCfg = Release|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|Mixed Platforms.Build.0 = Release|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|Win32.ActiveCfg = Release|Win32 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|Win32.Build.0 = Release|Win32 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|x64.ActiveCfg = Release|x64 +- {0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}.Release|x64.Build.0 = Release|x64 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Any CPU.ActiveCfg = Debug|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Win32.ActiveCfg = Debug|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Win32.Build.0 = Debug|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|x64.ActiveCfg = Debug|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Any CPU.ActiveCfg = Release|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Mixed Platforms.Build.0 = Release|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Win32.ActiveCfg = Release|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Win32.Build.0 = Release|Win32 +- {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE diff --git a/recipes/mdnsresponder/all/patches/878.200.35/mDNSWin32.c.patch b/recipes/mdnsresponder/all/patches/878.200.35/mDNSWin32.c.patch new file mode 100644 index 0000000000000..2807abe1ea42f --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/mDNSWin32.c.patch @@ -0,0 +1,218 @@ +--- mDNSWindows/mDNSWin32.c ++++ mDNSWindows/mDNSWin32.c +@@ -55,6 +55,8 @@ + #include "dnssec.h" + #include "nsec.h" + ++extern mDNS mDNSStorage; ++ + #if 0 + #pragma mark == Constants == + #endif +@@ -718,16 +720,14 @@ + return ptr; + } + +-mDNSexport void DNSProxyInit(mDNS *const m, mDNSu32 IpIfArr[], mDNSu32 OpIf) ++mDNSexport void DNSProxyInit(mDNSu32 IpIfArr[], mDNSu32 OpIf) + { +- (void) m; + (void) IpIfArr; + (void) OpIf; + } + +-mDNSexport void DNSProxyTerminate(mDNS *const m) ++mDNSexport void DNSProxyTerminate(void) + { +- (void) m; + } + + //=========================================================================================================================== +@@ -972,7 +972,6 @@ + TCPSocket * + mDNSPlatformTCPSocket + ( +- mDNS * const m, + TCPSocketFlags flags, + mDNSIPPort * port, + mDNSBool useBackgroundTrafficClass +@@ -984,7 +983,6 @@ + int len; + mStatus err = mStatus_NoError; + +- DEBUG_UNUSED( m ); + DEBUG_UNUSED( useBackgroundTrafficClass ); + + require_action( flags == 0, exit, err = mStatus_UnsupportedErr ); +@@ -996,7 +994,7 @@ + mDNSPlatformMemZero( sock, sizeof( TCPSocket ) ); + sock->fd = INVALID_SOCKET; + sock->flags = flags; +- sock->m = m; ++ sock->m = &mDNSStorage; + + mDNSPlatformMemZero(&saddr, sizeof(saddr)); + saddr.sin_family = AF_INET; +@@ -1269,7 +1267,7 @@ + // mDNSPlatformUDPSocket + //=========================================================================================================================== + +-mDNSexport UDPSocket* mDNSPlatformUDPSocket(mDNS *const m, const mDNSIPPort requestedport) ++mDNSexport UDPSocket* mDNSPlatformUDPSocket(const mDNSIPPort requestedport) + { + UDPSocket* sock = NULL; + mDNSIPPort port = requestedport; +@@ -1285,10 +1283,10 @@ + // Create the socket + + sock->fd = INVALID_SOCKET; +- sock->recvMsgPtr = m->p->unicastSock4.recvMsgPtr; +- sock->addr = m->p->unicastSock4.addr; ++ sock->recvMsgPtr = mDNSStorage.p->unicastSock4.recvMsgPtr; ++ sock->addr = mDNSStorage.p->unicastSock4.addr; + sock->ifd = NULL; +- sock->m = m; ++ sock->m = &mDNSStorage; + + // Try at most 10000 times to get a unique random port + +@@ -1309,7 +1307,7 @@ + + saddr.sin_port = port.NotAnInteger; + +- err = SetupSocket(m, ( struct sockaddr* ) &saddr, port, &sock->fd ); ++ err = SetupSocket(sock->m, ( struct sockaddr* ) &saddr, port, &sock->fd ); + if (!err) break; + } + +@@ -1398,8 +1396,7 @@ + struct sockaddr_storage addr; + int n; + +- DEBUG_USE_ONLY( inMDNS ); +- DEBUG_USE_ONLY( useBackgroundTrafficClass ); ++ DEBUG_UNUSED( useBackgroundTrafficClass ); + + n = (int)( inMsgEnd - ( (const mDNSu8 * const) inMsg ) ); + check( inMDNS ); +@@ -1464,15 +1461,13 @@ + return( err ); + } + +-mDNSexport void mDNSPlatformUpdateProxyList(mDNS *const m, const mDNSInterfaceID InterfaceID) ++mDNSexport void mDNSPlatformUpdateProxyList(const mDNSInterfaceID InterfaceID) + { +- DEBUG_UNUSED( m ); + DEBUG_UNUSED( InterfaceID ); + } + +-mDNSexport void mDNSPlatformSetAllowSleep(mDNS *const m, mDNSBool allowSleep, const char *reason) ++mDNSexport void mDNSPlatformSetAllowSleep(mDNSBool allowSleep, const char *reason) + { +- DEBUG_UNUSED( m ); + DEBUG_UNUSED( allowSleep ); + DEBUG_UNUSED( reason ); + } +@@ -1481,7 +1476,7 @@ + // mDNSPlatformSendRawPacket + //=========================================================================================================================== + +-mDNSexport void mDNSPlatformSendWakeupPacket(mDNS *const m, mDNSInterfaceID InterfaceID, char *ethaddr, char *ipaddr, int iteration) ++mDNSexport void mDNSPlatformSendWakeupPacket(mDNSInterfaceID InterfaceID, char *ethaddr, char *ipaddr, int iteration) + { + unsigned char mac[ 6 ]; + unsigned char buf[ 102 ]; +@@ -1518,7 +1513,7 @@ + + info = ( MulticastWakeupStruct* ) malloc( sizeof( MulticastWakeupStruct ) ); + require_action( info, exit, err = mStatus_NoMemoryErr ); +- info->inMDNS = m; ++ info->inMDNS = &mDNSStorage; + memset( &info->addr, 0, sizeof( info->addr ) ); + info->addr.sin_family = AF_INET; + info->addr.sin_addr.s_addr = AllDNSLinkGroup_v4.ip.v4.NotAnInteger; +@@ -1566,9 +1561,8 @@ + if (bufsize) buf[0] = 0; + } + +-mDNSexport void mDNSPlatformSetLocalAddressCacheEntry(mDNS *const m, const mDNSAddr *const tpa, const mDNSEthAddr *const tha, mDNSInterfaceID InterfaceID) ++mDNSexport void mDNSPlatformSetLocalAddressCacheEntry(const mDNSAddr *const tpa, const mDNSEthAddr *const tha, mDNSInterfaceID InterfaceID) + { +- DEBUG_UNUSED( m ); + DEBUG_UNUSED( tpa ); + DEBUG_UNUSED( tha ); + DEBUG_UNUSED( InterfaceID ); +@@ -1595,7 +1589,6 @@ + + mDNSexport void mDNSPlatformWriteLogMsg( const char * ident, const char * msg, mDNSLogLevel_t loglevel ) + { +- extern mDNS mDNSStorage; + int type; + + DEBUG_UNUSED( ident ); +@@ -1650,11 +1643,11 @@ + mDNSlocal void SetDNSServers( mDNS *const m ); + mDNSlocal void SetSearchDomainList( void ); + +-mDNSexport mDNSBool mDNSPlatformSetDNSConfig(mDNS *const m, mDNSBool setservers, mDNSBool setsearch, domainname *const fqdn, DNameListElem **regDomains, DNameListElem **browseDomains, mDNSBool ackConfig) ++mDNSexport mDNSBool mDNSPlatformSetDNSConfig(mDNSBool setservers, mDNSBool setsearch, domainname *const fqdn, DNameListElem **regDomains, DNameListElem **browseDomains, mDNSBool ackConfig) + { + (void) ackConfig; + +- if (setservers) SetDNSServers(m); ++ if (setservers) SetDNSServers(&mDNSStorage); + if (setsearch) SetSearchDomainList(); + + if ( fqdn ) +@@ -2033,7 +2026,7 @@ + //=========================================================================================================================== + + mDNSexport mStatus +-mDNSPlatformGetPrimaryInterface( mDNS * const m, mDNSAddr * v4, mDNSAddr * v6, mDNSAddr * router ) ++mDNSPlatformGetPrimaryInterface( mDNSAddr * v4, mDNSAddr * v6, mDNSAddr * router ) + { + IP_ADAPTER_INFO * pAdapterInfo; + IP_ADAPTER_INFO * pAdapter; +@@ -2043,8 +2036,6 @@ + DWORD index; + mStatus err = mStatus_NoError; + +- DEBUG_UNUSED( m ); +- + *v6 = zeroAddr; + + pAdapterInfo = NULL; +@@ -2080,9 +2071,9 @@ + { + // Found one that will work + +- if ( pAdapter->AddressLength == sizeof( m->PrimaryMAC ) ) ++ if ( pAdapter->AddressLength == sizeof( mDNSStorage.PrimaryMAC ) ) + { +- memcpy( &m->PrimaryMAC, pAdapter->Address, pAdapter->AddressLength ); ++ memcpy( &mDNSStorage.PrimaryMAC, pAdapter->Address, pAdapter->AddressLength ); + } + + found = TRUE; +@@ -2111,9 +2102,8 @@ + (void) win; // Unused + } + +-mDNSexport mStatus mDNSPlatformGetRemoteMacAddr(mDNS *const m, mDNSAddr *raddr) ++mDNSexport mStatus mDNSPlatformGetRemoteMacAddr(mDNSAddr *raddr) + { +- (void) m; // Unused + (void) raddr; // Unused + + return mStatus_UnsupportedErr; +@@ -2140,9 +2130,8 @@ + return mStatus_UnsupportedErr; + } + +-mDNSexport mStatus mDNSPlatformRetrieveTCPInfo(mDNS *const m, mDNSAddr *laddr, mDNSIPPort *lport, mDNSAddr *raddr, mDNSIPPort *rport, mDNSTCPInfo *mti) ++mDNSexport mStatus mDNSPlatformRetrieveTCPInfo(mDNSAddr *laddr, mDNSIPPort *lport, mDNSAddr *raddr, mDNSIPPort *rport, mDNSTCPInfo *mti) + { +- (void) m; // Unused + (void) laddr; // Unused + (void) raddr; // Unused + (void) lport; // Unused diff --git a/recipes/mdnsresponder/all/patches/878.200.35/opt/permit-over-long-service-types.patch b/recipes/mdnsresponder/all/patches/878.200.35/opt/permit-over-long-service-types.patch new file mode 100644 index 0000000000000..5a8e85f7ff091 --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/opt/permit-over-long-service-types.patch @@ -0,0 +1,11 @@ +--- a/mDNSCore/DNSCommon.c ++++ b/mDNSCore/DNSCommon.c +@@ -1039,7 +1039,7 @@ + LogMsg("Bad service type in %#s.%##s%##s Application protocol name must be underscore plus 1-15 characters. " + "See ", name->c, type->c, domain->c); + } +- if (len < 2 || len >= 0x40 || (len > 16 && !SameDomainName(domain, &localdomain))) return(mDNSNULL); ++ if (len < 2 || len >= 0x40) return(mDNSNULL); + if (src[1] != '_') { errormsg = "Application protocol name must begin with underscore"; goto fail; } + for (i=2; i<=len; i++) + { diff --git a/recipes/mdnsresponder/all/patches/878.200.35/opt/poll-rather-than-select.patch b/recipes/mdnsresponder/all/patches/878.200.35/opt/poll-rather-than-select.patch new file mode 100644 index 0000000000000..c1edd65a7baca --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/opt/poll-rather-than-select.patch @@ -0,0 +1,121 @@ +From a1b3c1faa53c8c51aa52361bf7035d6fc91b747d Mon Sep 17 00:00:00 2001 +From: garethsb-sony +Date: Mon, 26 Feb 2018 12:58:27 +0000 +Subject: [PATCH] On Linux, use poll rather than select to wait on the socket + +--- + .../mDNSShared/dnssd_clientstub.c | 77 ++++++++-------------- + 1 file changed, 30 insertions(+), 47 deletions(-) + +diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c +index 27e90ee..d0bfcd3 100644 +--- a/mDNSShared/dnssd_clientstub.c ++++ b/mDNSShared/dnssd_clientstub.c +@@ -80,6 +80,7 @@ static void syslog( int priority, const char * message, ...) + } + #else + ++ #include + #include // For O_RDWR etc. + #include + #include +@@ -283,46 +284,23 @@ static int read_all(dnssd_sock_t sd, char *buf, int len) + // Returns 1 if more bytes remain to be read on socket descriptor sd, 0 otherwise + static int more_bytes(dnssd_sock_t sd) + { +- struct timeval tv = { 0, 0 }; +- fd_set readfds; +- fd_set *fs; + int ret; + + #if defined(_WIN32) +- fs = &readfds; +- FD_ZERO(fs); +- FD_SET(sd, fs); +- ret = select((int)sd+1, fs, (fd_set*)NULL, (fd_set*)NULL, &tv); ++ struct timeval tv = { 0, 0 }; ++ fd_set readfds; ++ FD_ZERO(&readfds); ++ FD_SET(sd, &readfds); ++ ret = select((int)sd+1, &readfds, (fd_set*)NULL, (fd_set*)NULL, &tv); + #else +- if (sd < FD_SETSIZE) +- { +- fs = &readfds; +- FD_ZERO(fs); +- } +- else +- { +- // Compute the number of integers needed for storing "sd". Internally fd_set is stored +- // as an array of ints with one bit for each fd and hence we need to compute +- // the number of ints needed rather than the number of bytes. If "sd" is 32, we need +- // two ints and not just one. +- int nfdbits = sizeof (int) * 8; +- int nints = (sd/nfdbits) + 1; +- fs = (fd_set *)calloc(nints, (size_t)sizeof(int)); +- if (fs == NULL) +- { +- syslog(LOG_WARNING, "dnssd_clientstub more_bytes: malloc failed"); +- return 0; +- } +- } +- FD_SET(sd, fs); +- ret = select((int)sd+1, fs, (fd_set*)NULL, (fd_set*)NULL, &tv); +- if (fs != &readfds) +- free(fs); ++ // Use poll in order to be able to wait for a file descriptor larger than FD_SETSIZE ++ struct pollfd pfd_read = { sd, POLLIN, 0 }; ++ ret = poll(&pfd_read, 1, 0); + #endif + return (ret > 0); + } + +-// set_waitlimit() implements a timeout using select. It is called from deliver_request() before recv() OR accept() ++// set_waitlimit() implements a timeout using select or poll. It is called from deliver_request() before recv() OR accept() + // to ensure the UDS clients are not blocked in these system calls indefinitely. + // Note: Ideally one should never be blocked here, because it indicates either mDNSResponder daemon is not yet up/hung/ + // superbusy/crashed or some other OS bug. For eg: On Windows which suffers from 3rd party software +@@ -331,23 +309,28 @@ static int more_bytes(dnssd_sock_t sd) + static int set_waitlimit(dnssd_sock_t sock, int timeout) + { + int gDaemonErr = kDNSServiceErr_NoError; ++ int ret; + +- // To prevent stack corruption since select does not work with timeout if fds > FD_SETSIZE(1024) +- if (!gDaemonErr && sock < FD_SETSIZE) +- { +- struct timeval tv; +- fd_set set; ++#if defined(_WIN32) ++ struct timeval tv; ++ fd_set set; ++ ++ FD_ZERO(&set); ++ FD_SET(sock, &set); ++ tv.tv_sec = timeout; ++ tv.tv_usec = 0; ++ ret = select((int)(sock + 1), &set, NULL, NULL, &tv); ++#else ++ // Use poll in order to be able to wait for a file descriptor larger than FD_SETSIZE ++ struct pollfd pfd_read = { sock, POLLIN, 0 }; ++ ret = poll(&pfd_read, 1, timeout * 1000); ++#endif + +- FD_ZERO(&set); +- FD_SET(sock, &set); +- tv.tv_sec = timeout; +- tv.tv_usec = 0; +- if (!select((int)(sock + 1), &set, NULL, NULL, &tv)) +- { +- // Ideally one should never hit this case: See comments before set_waitlimit() +- syslog(LOG_WARNING, "dnssd_clientstub set_waitlimit:_daemon timed out (%d secs) without any response: Socket %d", timeout, sock); +- gDaemonErr = kDNSServiceErr_Timeout; +- } ++ if (!(ret > 0)) ++ { ++ // Ideally one should never hit this case: See comments before set_waitlimit() ++ syslog(LOG_WARNING, "dnssd_clientstub set_waitlimit:_daemon timed out (%d secs) without any response: Socket %d", timeout, sock); ++ gDaemonErr = kDNSServiceErr_Timeout; + } + return gDaemonErr; + } diff --git a/recipes/mdnsresponder/all/patches/878.200.35/opt/unicast.patch b/recipes/mdnsresponder/all/patches/878.200.35/opt/unicast.patch new file mode 100644 index 0000000000000..3990e7008591c --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/opt/unicast.patch @@ -0,0 +1,538 @@ +--- a/mDNSPosix/Identify.c ++++ b/mDNSPosix/Identify.c +@@ -22,8 +22,10 @@ + // We want to use the functionality provided by "mDNS.c", + // except we'll sneak a peek at the packets before forwarding them to the normal mDNSCoreReceive() routine + #define mDNSCoreReceive __MDNS__mDNSCoreReceive ++#define UDPSocket_struct __UDPSocket_struct + #include "mDNS.c" + #undef mDNSCoreReceive ++#undef UDPSocket_struct + + //************************************************************************************************************* + // Headers +--- a/mDNSPosix/NetMonitor.c ++++ b/mDNSPosix/NetMonitor.c +@@ -22,8 +22,10 @@ + // We want to use much of the functionality provided by "mDNS.c", + // except we'll steal the packets that would be sent to normal mDNSCoreReceive() routine + #define mDNSCoreReceive __NOT__mDNSCoreReceive__NOT__ ++#define UDPSocket_struct __UDPSocket_struct + #include "../mDNSCore/mDNS.c" + #undef mDNSCoreReceive ++#undef UDPSocket_struct + + //************************************************************************************************************* + // Headers +--- a/mDNSPosix/mDNSPosix.c ++++ b/mDNSPosix/mDNSPosix.c +@@ -75,6 +75,13 @@ + }; + typedef struct IfChangeRec IfChangeRec; + ++// Platform-dependent low-level networking stuff ++ ++mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interfaceIndex, int *sktPtr, mDNSIPPort* outport, ++ mDNSBool joinMC); ++ ++static struct UDPSocket_struct* PlatformUDPSockets = NULL; ++ + // Note that static data is initialized to zero in (modern) C. + static fd_set gEventFDs; + static int gMaxFD; // largest fd in gEventFDs +@@ -147,7 +154,6 @@ + PosixNetworkInterface * thisIntf = (PosixNetworkInterface *)(InterfaceID); + int sendingsocket = -1; + +- (void)src; // Will need to use this parameter once we implement mDNSPlatformUDPSocket/mDNSPlatformUDPClose + (void) useBackgroundTrafficClass; + + assert(m != NULL); +@@ -169,7 +175,7 @@ + sin->sin_family = AF_INET; + sin->sin_port = dstPort.NotAnInteger; + sin->sin_addr.s_addr = dst->ip.v4.NotAnInteger; +- sendingsocket = thisIntf ? thisIntf->multicastSocket4 : m->p->unicastSocket4; ++ sendingsocket = (src) ? (src->sktv4) : (thisIntf ? thisIntf->multicastSocket4 : m->p->unicastSocket4); + } + + #if HAVE_IPV6 +@@ -183,7 +189,7 @@ + sin6->sin6_family = AF_INET6; + sin6->sin6_port = dstPort.NotAnInteger; + sin6->sin6_addr = *(struct in6_addr*)&dst->ip.v6; +- sendingsocket = thisIntf ? thisIntf->multicastSocket6 : m->p->unicastSocket6; ++ sendingsocket = (src) ? (src->sktv6) : (thisIntf ? thisIntf->multicastSocket6 : m->p->unicastSocket6); + } + #endif + +@@ -213,7 +219,7 @@ + } + + // This routine is called when the main loop detects that data is available on a socket. +-mDNSlocal void SocketDataReady(mDNS *const m, PosixNetworkInterface *intf, int skt) ++mDNSlocal void SocketDataReady(mDNS *const m, PosixNetworkInterface *intf, int skt, mDNSIPPort localPort) + { + mDNSAddr senderAddr, destAddr; + mDNSIPPort senderPort; +@@ -309,7 +315,7 @@ + + if (packetLen >= 0) + mDNSCoreReceive(m, &packet, (mDNSu8 *)&packet + packetLen, +- &senderAddr, senderPort, &destAddr, MulticastDNSPort, InterfaceID); ++ &senderAddr, senderPort, &destAddr, mDNSIPPortIsZero(localPort) ? MulticastDNSPort : localPort, InterfaceID); + } + + mDNSexport TCPSocket *mDNSPlatformTCPSocket(TCPSocketFlags flags, mDNSIPPort * port, mDNSBool useBackgroundTrafficClass) +@@ -317,6 +323,7 @@ + (void)flags; // Unused + (void)port; // Unused + (void)useBackgroundTrafficClass; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return NULL; + } + +@@ -324,12 +331,14 @@ + { + (void)flags; // Unused + (void)sd; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return NULL; + } + + mDNSexport int mDNSPlatformTCPGetFD(TCPSocket *sock) + { + (void)sock; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return -1; + } + +@@ -343,12 +352,14 @@ + (void)InterfaceID; // Unused + (void)callback; // Unused + (void)context; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return(mStatus_UnsupportedErr); + } + + mDNSexport void mDNSPlatformTCPCloseConnection(TCPSocket *sock) + { + (void)sock; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + mDNSexport long mDNSPlatformReadTCP(TCPSocket *sock, void *buf, unsigned long buflen, mDNSBool * closed) +@@ -357,6 +368,7 @@ + (void)buf; // Unused + (void)buflen; // Unused + (void)closed; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return 0; + } + +@@ -365,23 +377,88 @@ + (void)sock; // Unused + (void)msg; // Unused + (void)len; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return 0; + } + +-mDNSexport UDPSocket *mDNSPlatformUDPSocket(mDNSIPPort port) ++mDNSexport UDPSocket *mDNSPlatformUDPSocket(mDNSIPPort requestedPort) + { +- (void)port; // Unused +- return NULL; ++ mStatus err; ++ mDNSIPPort port = requestedPort; ++ mDNSBool randomizePort = mDNSIPPortIsZero(requestedPort); ++ struct sockaddr sa; ++ int i = 1000; // Try at most 1000 times to get a unique random port ++ UDPSocket *p = mallocL("UDPSocket", sizeof(UDPSocket)); ++ if (!p) { LogMsg("mDNSPlatformUDPSocket: memory exhausted"); return(mDNSNULL); } ++ mDNSPlatformMemZero(p, sizeof(UDPSocket)); ++ p->port = zeroIPPort; ++ p->sktv4 = -1; ++ p->sktv6 = -1; ++ ++ do { ++ // The kernel doesn't do cryptographically strong random port allocation, so we do it ourselves here ++ if (randomizePort) port = mDNSOpaque16fromIntVal(0xC000 + mDNSRandom(0x3FFF)); ++ mDNSPlatformMemZero(&sa, sizeof(struct sockaddr)); ++ sa.sa_family = AF_INET; ++ err = SetupSocket(&sa, port, 0, &p->sktv4, &p->port, mDNSSameIPPort(requestedPort, NATPMPAnnouncementPort)); ++ /* TODO: make me work! ++ if (!err) ++ { ++ mDNSPlatformMemZero(&sa, sizeof(struct sockaddr)); ++ sa.sa_family = AF_INET6; ++ err = SetupSocket(&sa, port, 0, &p->sktv6, &p->port, 0); ++ if (err) { close(p->sktv4); p->sktv4 = -1; } ++ }*/ ++ i--; ++ } while (err == EADDRINUSE && randomizePort && i); ++ ++ if (err) { ++ // In customer builds we don't want to log failures with port 5351, because this is a known issue ++ // of failing to bind to this port when Internet Sharing has already bound to it ++ // We also don't want to log about port 5350, due to a known bug when some other ++ // process is bound to it. ++ if (mDNSSameIPPort(requestedPort, NATPMPPort) || mDNSSameIPPort(requestedPort, NATPMPAnnouncementPort)) ++ LogInfo("mDNSPlatformUDPSocket: SetupSocket %d failed error %d errno %d (%s)", mDNSVal16(requestedPort), err, errno, strerror(errno)); ++ else LogMsg("mDNSPlatformUDPSocket: SetupSocket %d failed error %d errno %d (%s)", mDNSVal16(requestedPort), err, errno, strerror(errno)); ++ freeL("UDPSocket", p); ++ return(mDNSNULL); ++ } ++ ++ p->prev = NULL; ++ p->next = PlatformUDPSockets; ++ if (p->next) ++ p->next->prev = p; ++ PlatformUDPSockets = p; ++ ++ return(p); + } + +-mDNSexport void mDNSPlatformUDPClose(UDPSocket *sock) ++mDNSexport void mDNSPlatformUDPClose(UDPSocket *sock) + { +- (void)sock; // Unused ++ if (sock->sktv4 > -1) { ++ close(sock->sktv4); ++ sock->sktv4 = -1; ++ } ++ if (sock->sktv6 > -1) { ++ close(sock->sktv6); ++ sock->sktv6 = -1; ++ } ++ ++ if (sock->prev) ++ sock->prev->next = sock->next; ++ else ++ PlatformUDPSockets = sock->next; ++ ++ if (sock->next) ++ sock->next->prev = sock->prev; ++ ++ freeL("UDPSocket", sock); + } + + mDNSexport void mDNSPlatformUpdateProxyList(const mDNSInterfaceID InterfaceID) + { + (void)InterfaceID; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + mDNSexport void mDNSPlatformSendRawPacket(const void *const msg, const mDNSu8 *const end, mDNSInterfaceID InterfaceID) +@@ -389,6 +466,7 @@ + (void)msg; // Unused + (void)end; // Unused + (void)InterfaceID; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + mDNSexport void mDNSPlatformSetLocalAddressCacheEntry(const mDNSAddr *const tpa, const mDNSEthAddr *const tha, mDNSInterfaceID InterfaceID) +@@ -396,21 +474,33 @@ + (void)tpa; // Unused + (void)tha; // Unused + (void)InterfaceID; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); ++} ++ ++mDNSexport void mDNSPlatformSetLocalARP(const mDNSv4Addr *const tpa, const mDNSEthAddr *const tha, mDNSInterfaceID InterfaceID) ++{ ++ (void)tpa; // Unused ++ (void)tha; // Unused ++ (void)InterfaceID; // Unused ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + mDNSexport mStatus mDNSPlatformTLSSetupCerts(void) + { ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + return(mStatus_UnsupportedErr); + } + + mDNSexport void mDNSPlatformTLSTearDownCerts(void) + { ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + mDNSexport void mDNSPlatformSetAllowSleep(mDNSBool allowSleep, const char *reason) + { + (void) allowSleep; + (void) reason; ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + #if COMPILER_LIKES_PRAGMA_MARK +@@ -443,19 +533,104 @@ + return mDNStrue; + } + ++#ifdef TARGET_OS_LINUX ++#include ++#endif ++ + mDNSexport mStatus mDNSPlatformGetPrimaryInterface(mDNSAddr * v4, mDNSAddr * v6, mDNSAddr * router) ++#ifdef TARGET_OS_LINUX + { ++ unsigned long d, g; ++ char buf[256]; ++ int line = 0; ++ FILE * f; ++ char * p; ++ ++ // TODO: where/how to get ipv6 address? ++ if (v6) ++ *v6 = zeroAddr; ++ ++ f = fopen("/proc/net/route", "r"); ++ ++ if (!f) ++ return mStatus_UnknownErr; ++ ++ while(fgets(buf, sizeof(buf), f)) { ++ if(line > 0) { /* skip the first line */ ++ p = buf; ++ ++ /* skip the interface name */ ++ while(*p && !isspace(*p)) ++ p++; ++ ++ *p++ = '\0'; ++ ++ while(*p && isspace(*p)) ++ p++; ++ ++ if(sscanf(p, "%lx%lx", &d, &g)==2) { ++ if(d == 0 && g != 0) { ++ if (router) { ++ router->type = mDNSAddrType_IPv4; ++ router->ip.v4.NotAnInteger = g; ++ } ++ fclose(f); ++ ++ int sock = socket(AF_INET, SOCK_DGRAM, 0); ++ if (sock > -1) { ++ struct sockaddr_in sin; ++ socklen_t socklen = sizeof(struct sockaddr_in); ++ ++ mDNSPlatformMemZero(&sin, socklen); ++ sin.sin_port = htons(3000); ++ sin.sin_addr.s_addr = INADDR_ANY; ++ sin.sin_family = AF_INET; ++ ++ ++ if (connect(sock, (struct sockaddr*)&sin, socklen) >= 0 && ++ getsockname(sock, (struct sockaddr*)&sin, &socklen) >= 0) { ++ ++ if (v4) { ++ v4->type = mDNSAddrType_IPv4; ++ v4->ip.v4.NotAnInteger = sin.sin_addr.s_addr; ++ } ++ ++ return mStatus_NoError; ++ } ++ ++ close(sock); ++ } ++ ++ return mStatus_UnknownErr; ++ } ++ } ++ } ++ ++ line++; ++ } ++ ++ /* default route not found ! */ ++ if (f) ++ fclose(f); ++ ++ return mStatus_UnknownErr; ++} ++#else ++{ ++ (void) m; + (void) v4; + (void) v6; + (void) router; + + return mStatus_UnsupportedErr; + } ++#endif + + mDNSexport void mDNSPlatformDynDNSHostNameStatusChanged(const domainname *const dname, const mStatus status) + { + (void) dname; + (void) status; ++ LogMsg("%s:%s(): NOT IMPLEMENTED!", __FILE__, __FUNCTION__); + } + + #if COMPILER_LIKES_PRAGMA_MARK +@@ -502,8 +677,9 @@ + mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, 0, &DNSAddr, UnicastDNSPort, kScopeNone, 0, mDNSfalse, mDNSfalse, 0, mDNStrue, mDNStrue, mDNSfalse); + numOfServers++; + } ++ keyword[0] = nameserver[0] = 0; + } +- fclose(fp); ++ fclose(fp); + return (numOfServers > 0) ? 0 : -1; + } + +@@ -611,13 +787,14 @@ + // Sets up a send/receive socket. + // If mDNSIPPort port is non-zero, then it's a multicast socket on the specified interface + // If mDNSIPPort port is zero, then it's a randomly assigned port number, used for sending unicast queries +-mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interfaceIndex, int *sktPtr) ++mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interfaceIndex, int *sktPtr, mDNSIPPort* outport, mDNSBool joinMC) + { + int err = 0; + static const int kOn = 1; + static const int kIntTwoFiveFive = 255; + static const unsigned char kByteTwoFiveFive = 255; +- const mDNSBool JoinMulticastGroup = (port.NotAnInteger != 0); ++ const mDNSBool JoinMulticastGroup = joinMC; ++ const mDNSBool isNATPMPAnnouncePort = mDNSSameIPPort(port, NATPMPAnnouncementPort); + + (void) interfaceIndex; // This parameter unused on plaforms that don't have IPv6 + assert(intfAddr != NULL); +@@ -703,7 +880,7 @@ + // Add multicast group membership on this interface + if (err == 0 && JoinMulticastGroup) + { +- imr.imr_multiaddr.s_addr = AllDNSLinkGroup_v4.ip.v4.NotAnInteger; ++ imr.imr_multiaddr.s_addr = isNATPMPAnnouncePort ? AllHosts_v4.NotAnInteger : AllDNSLinkGroup_v4.ip.v4.NotAnInteger; + imr.imr_interface = ((struct sockaddr_in*)intfAddr)->sin_addr; + err = setsockopt(*sktPtr, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(imr)); + if (err < 0) { err = errno; perror("setsockopt - IP_ADD_MEMBERSHIP"); } +@@ -738,9 +915,10 @@ + { + bindAddr.sin_family = AF_INET; + bindAddr.sin_port = port.NotAnInteger; +- bindAddr.sin_addr.s_addr = INADDR_ANY; // Want to receive multicasts AND unicasts on this socket ++ bindAddr.sin_addr.s_addr = isNATPMPAnnouncePort ? AllHosts_v4.NotAnInteger : INADDR_ANY; + err = bind(*sktPtr, (struct sockaddr *) &bindAddr, sizeof(bindAddr)); + if (err < 0) { err = errno; perror("bind"); fflush(stderr); } ++ if (outport) outport->NotAnInteger = bindAddr.sin_port; + } + } // endif (intfAddr->sa_family == AF_INET) + +@@ -911,10 +1089,10 @@ + if (err == 0) + { + if (alias->multicastSocket4 == -1 && intfAddr->sa_family == AF_INET) +- err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket4); ++ err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket4, NULL, 1); + #if HAVE_IPV6 + else if (alias->multicastSocket6 == -1 && intfAddr->sa_family == AF_INET6) +- err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket6); ++ err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket6, NULL, 1); + #endif + } + +@@ -1292,11 +1470,11 @@ + + sa.sa_family = AF_INET; + m->p->unicastSocket4 = -1; +- if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket4); ++ if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket4, NULL, 0); + #if HAVE_IPV6 + sa.sa_family = AF_INET6; + m->p->unicastSocket6 = -1; +- if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket6); ++ if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket6, NULL, 0); + #endif + + // Tell mDNS core about the network interfaces on this machine. +@@ -1685,6 +1863,16 @@ + info = (PosixNetworkInterface *)(info->coreIntf.next); + } + ++ UDPSocket* socks = PlatformUDPSockets; ++ while (socks) { ++ if (socks->sktv4 > -1) mDNSPosixAddToFDSet(nfds, readfds, socks->sktv4); ++#if HAVE_IPV6 ++ if (socks->sktv6 > -1) mDNSPosixAddToFDSet(nfds, readfds, socks->sktv6); ++#endif ++ ++ socks = socks->next; ++ } ++ + // 3. Calculate the time remaining to the next scheduled event (in struct timeval format) + ticks = nextevent - mDNS_TimeNow(m); + if (ticks < 1) ticks = 1; +@@ -1707,13 +1895,13 @@ + if (m->p->unicastSocket4 != -1 && FD_ISSET(m->p->unicastSocket4, readfds)) + { + FD_CLR(m->p->unicastSocket4, readfds); +- SocketDataReady(m, NULL, m->p->unicastSocket4); ++ SocketDataReady(m, NULL, m->p->unicastSocket4, zeroIPPort); + } + #if HAVE_IPV6 + if (m->p->unicastSocket6 != -1 && FD_ISSET(m->p->unicastSocket6, readfds)) + { + FD_CLR(m->p->unicastSocket6, readfds); +- SocketDataReady(m, NULL, m->p->unicastSocket6); ++ SocketDataReady(m, NULL, m->p->unicastSocket6, zeroIPPort); + } + #endif + +@@ -1722,17 +1910,33 @@ + if (info->multicastSocket4 != -1 && FD_ISSET(info->multicastSocket4, readfds)) + { + FD_CLR(info->multicastSocket4, readfds); +- SocketDataReady(m, info, info->multicastSocket4); ++ SocketDataReady(m, info, info->multicastSocket4, zeroIPPort); + } + #if HAVE_IPV6 + if (info->multicastSocket6 != -1 && FD_ISSET(info->multicastSocket6, readfds)) + { + FD_CLR(info->multicastSocket6, readfds); +- SocketDataReady(m, info, info->multicastSocket6); ++ SocketDataReady(m, info, info->multicastSocket6, zeroIPPort); + } + #endif + info = (PosixNetworkInterface *)(info->coreIntf.next); + } ++ ++ UDPSocket* socks = PlatformUDPSockets; ++ while (socks) { ++ if (socks->sktv4 > -1 && FD_ISSET(socks->sktv4, readfds)) { ++ FD_CLR(socks->sktv4, readfds); ++ SocketDataReady(m, NULL, socks->sktv4, socks->port); ++ } ++#if HAVE_IPV6 ++ if (socks->sktv6 > -1 && FD_ISSET(socks->sktv6, readfds)) { ++ FD_CLR(socks->sktv6, readfds); ++ SocketDataReady(m, NULL, socks->sktv6, socks->port); ++ } ++#endif ++ ++ socks = socks->next; ++ } + } + + // update gMaxFD +--- a/mDNSPosix/mDNSPosix.h ++++ b/mDNSPosix/mDNSPosix.h +@@ -57,6 +57,17 @@ + #endif + }; + ++// Platform-specific low-level networking code ++ ++struct UDPSocket_struct { ++ mDNSIPPort port; ++ int sktv4; ++ int sktv6; ++ ++ struct UDPSocket_struct* next; ++ struct UDPSocket_struct* prev; ++}; ++ + #define uDNS_SERVERS_FILE "/etc/resolv.conf" + extern int ParseDNSServers(mDNS *m, const char *filePath); + extern mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m); diff --git a/recipes/mdnsresponder/all/test_package/CMakeLists.txt b/recipes/mdnsresponder/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/mdnsresponder/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/mdnsresponder/all/test_package/conanfile.py b/recipes/mdnsresponder/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fdb9f346a1da9 --- /dev/null +++ b/recipes/mdnsresponder/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/mdnsresponder/all/test_package/test_package.c b/recipes/mdnsresponder/all/test_package/test_package.c new file mode 100644 index 0000000000000..bae1467c7d687 --- /dev/null +++ b/recipes/mdnsresponder/all/test_package/test_package.c @@ -0,0 +1,18 @@ +#include +#include + +int main() +{ + DNSServiceRef sdRef; + DNSServiceErrorType err = DNSServiceBrowse(&sdRef, 0, 0, "_example._tcp", NULL, NULL, NULL); + if (err == kDNSServiceErr_NoError) + { + printf("DNSServiceBrowse succeeded\n"); + DNSServiceRefDeallocate(sdRef); + } + else + { + printf("DNSServiceBrowse failed: %d\n", err); + } + return 0; +} diff --git a/recipes/mdnsresponder/config.yml b/recipes/mdnsresponder/config.yml new file mode 100644 index 0000000000000..a8ca75314b5a1 --- /dev/null +++ b/recipes/mdnsresponder/config.yml @@ -0,0 +1,5 @@ +versions: + "878.200.35": + folder: all + "1310.140.1": + folder: all diff --git a/recipes/mdspan/all/conandata.yml b/recipes/mdspan/all/conandata.yml new file mode 100644 index 0000000000000..e43d2577da38b --- /dev/null +++ b/recipes/mdspan/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.6.0": + url: "https://github.com/kokkos/mdspan/archive/refs/tags/mdspan-0.6.0.tar.gz" + sha256: "79f94d7f692cbabfbaff6cd0d3434704435c853ee5087b182965fa929a48a592" + "0.5.0": + url: "https://github.com/kokkos/mdspan/archive/refs/tags/mdspan-0.5.0.tar.gz" + sha256: "ffa73e5e0dcd78e5279cd3b51a4d983a1fbef696e630fd1287ce32d93d6642d1" + "0.4.0": + url: https://github.com/kokkos/mdspan/archive/refs/tags/mdspan-0.4.0.tar.gz + sha256: 7b89db3c7a9c206c8447499456fdea9c9c1b3a34f58fd0b4c4dd87176b3fe20b diff --git a/recipes/mdspan/all/conanfile.py b/recipes/mdspan/all/conanfile.py new file mode 100644 index 0000000000000..e3006cfddddbd --- /dev/null +++ b/recipes/mdspan/all/conanfile.py @@ -0,0 +1,100 @@ +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 MDSpanConan(ConanFile): + name = "mdspan" + description = "Production-quality reference implementation of mdspan" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kokkos/mdspan" + topics = ("multi-dimensional", "array", "span", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "14" if Version(self.version) < "0.6.0" else "17" + + @property + def _minimum_compilers_version(self): + return { + "14": { + "Visual Studio": "15" if Version(self.version) < "0.2.0" else "16", + "msvc": "191" if Version(self.version) < "0.2.0" else "192", + "gcc": "5", + "clang": "3.4", + "apple-clang": "5.1" + }, + "17": { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + }.get(self._min_cppstd, {}) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + min_version = self._minimum_compilers_version.get( + str(self.settings.compiler)) + if not min_version: + self.output.warning(f"{self.ref} recipe lacks information about the {self.settings.compiler} " + "compiler support.") + else: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd} support. " + f"The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + + if str(self.settings.compiler) == "Visual Studio" and "16.6" <= Version(self.settings.compiler.version) < "17.0": + raise ConanInvalidConfiguration( + "Unsupported Visual Studio version due to upstream bug. The supported Visual Studio versions are (< 16.6 or 17.0 <=)." + "See upstream issue https://github.com/kokkos/mdspan/issues/26 for details.") + # TODO: check msvcc version more precisely + if self.settings.compiler == "msvc" and Version(self.settings.compiler.version) == "192": + raise ConanInvalidConfiguration( + "Unsupported MSVC version due to upstream bug. The supported MSVC versions are (< 192 or 193 <=)." + "See upstream issue https://github.com/kokkos/mdspan/issues/26 for details.") + + def source(self): + 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="*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "mdspan") + self.cpp_info.set_property("cmake_target_name", "std::mdspan") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "mdspan" + self.cpp_info.filenames["cmake_find_package_multi"] = "mdspan" + self.cpp_info.names["cmake_find_package"] = "std" + self.cpp_info.names["cmake_find_package_multi"] = "std" + self.cpp_info.components["_mdspan"].names["cmake_find_package"] = "mdspan" + self.cpp_info.components["_mdspan"].names["cmake_find_package_multi"] = "mdspan" diff --git a/recipes/mdspan/all/test_package/CMakeLists.txt b/recipes/mdspan/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ec6ceb3022ff8 --- /dev/null +++ b/recipes/mdspan/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(mdspan REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE std::mdspan) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) + +if(mdspan_VERSION VERSION_GREATER_EQUAL "0.2.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE "MDSPAN_ENABLE_SUBMDSPAN") +endif() + +if(MSVC) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) +elseif(mdspan_VERSION VERSION_GREATER_EQUAL "0.6.0") + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) +endif() diff --git a/recipes/mdspan/all/test_package/conanfile.py b/recipes/mdspan/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/mdspan/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/mdspan/all/test_package/test_package.cpp b/recipes/mdspan/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..21dfdf2403d14 --- /dev/null +++ b/recipes/mdspan/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +namespace stdex = std::experimental; + +int main() +{ + double buffer[2 * 3 * 4] = {}; +#ifdef MDSPAN_ENABLE_SUBMDSPAN + auto s1 = stdex::mdspan>(buffer, 2, 3, 4); +#else + auto s1 = stdex::mdspan(buffer); +#endif + s1(1, 1, 1) = 42; + +#ifdef MDSPAN_ENABLE_SUBMDSPAN + auto sub1 = stdex::submdspan(s1, 1, 1, stdex::full_extent); +#else + auto sub1 = stdex::subspan(s1, 1, 1, stdex::all); +#endif + std::cout << std::boolalpha << (sub1[1] == 42) << std::endl; +} diff --git a/recipes/mdspan/all/test_v1_package/CMakeLists.txt b/recipes/mdspan/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/mdspan/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mdspan/all/test_v1_package/conanfile.py b/recipes/mdspan/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mdspan/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mdspan/config.yml b/recipes/mdspan/config.yml new file mode 100644 index 0000000000000..babcbfb79d964 --- /dev/null +++ b/recipes/mdspan/config.yml @@ -0,0 +1,7 @@ +versions: + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/meshoptimizer/all/conandata.yml b/recipes/meshoptimizer/all/conandata.yml new file mode 100644 index 0000000000000..1132907df3841 --- /dev/null +++ b/recipes/meshoptimizer/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.17": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.17.tar.gz" + sha256: "50f134da6739702d4398f2a3c614acb1d80afb73afed27ac68bc55c9edae64e2" + "0.16": + url: "https://github.com/zeux/meshoptimizer/archive/v0.16.tar.gz" + sha256: "f2bb6518b7a33b20aaa984a72d0094809b971e6aebb62b627cd8108afb3f6937" + "0.15": + url: "https://github.com/zeux/meshoptimizer/archive/v0.15.tar.gz" + sha256: "89d350067c254cc737672600cb74c1ad6a70d2868398d430150ba7834be0b834" + "0.14": + url: "https://github.com/zeux/meshoptimizer/archive/v0.14.tar.gz" + sha256: "5a6e429ecf72325131b439a46297a690f0cab833c7563efdadab26c0a6cf8490" +patches: + "0.14": + - patch_file: "patches/0.14/0001-fix-build-on-old-AppleClang-versions.patch" diff --git a/recipes/meshoptimizer/all/conanfile.py b/recipes/meshoptimizer/all/conanfile.py new file mode 100644 index 0000000000000..38ff3a5d86908 --- /dev/null +++ b/recipes/meshoptimizer/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class MeshOptimizerConan(ConanFile): + name = "meshoptimizer" + description = "Mesh optimization library that makes meshes smaller and faster to render" + topics = ("mesh", "optimizer", "3d") + homepage = "https://github.com/zeux/meshoptimizer" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MESHOPT_BUILD_SHARED_LIBS"] = self.options.shared + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # No warnings as errors + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_compile_options(/W4 /WX)", "") + replace_in_file(self, cmakelists, "-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() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "meshoptimizer") + self.cpp_info.set_property("cmake_target_name", "meshoptimizer::meshoptimizer") + self.cpp_info.libs = ["meshoptimizer"] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + if self.options.shared and self.settings.os == "Windows": + self.cpp_info.defines = ["MESHOPTIMIZER_API=__declspec(dllimport)"] diff --git a/recipes/meshoptimizer/all/patches/0.14/0001-fix-build-on-old-AppleClang-versions.patch b/recipes/meshoptimizer/all/patches/0.14/0001-fix-build-on-old-AppleClang-versions.patch new file mode 100644 index 0000000000000..3463832814668 --- /dev/null +++ b/recipes/meshoptimizer/all/patches/0.14/0001-fix-build-on-old-AppleClang-versions.patch @@ -0,0 +1,13 @@ +--- src/vertexfilter.cpp ++++ src/vertexfilter.cpp +@@ -162,7 +162,9 @@ inline uint64_t rotateleft64(uint64_t v, int x) + { + #if defined(_MSC_VER) && !defined(__clang__) + return _rotl64(v, x); +-#elif defined(__clang__) && __clang_major__ >= 8 ++// Apple's Clang 8 is actually vanilla Clang 3.9, there we need to look for ++// version 11 instead: https://en.wikipedia.org/wiki/Xcode#Toolchain_versions ++#elif defined(__clang__) && ((!defined(__apple_build_version__) && __clang_major__ >= 8) || __clang_major__ >= 11) + return __builtin_rotateleft64(v, x); + #else + return (v << (x & 63)) | (v >> ((64 - x) & 63)); diff --git a/recipes/meshoptimizer/all/test_package/CMakeLists.txt b/recipes/meshoptimizer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..034ae19a0ca08 --- /dev/null +++ b/recipes/meshoptimizer/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(meshoptimizer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE meshoptimizer::meshoptimizer) diff --git a/recipes/meshoptimizer/all/test_package/conanfile.py b/recipes/meshoptimizer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/meshoptimizer/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/meshoptimizer/all/test_package/test_package.c b/recipes/meshoptimizer/all/test_package/test_package.c new file mode 100644 index 0000000000000..854c054e276a3 --- /dev/null +++ b/recipes/meshoptimizer/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "meshoptimizer.h" + +int main() +{ + meshopt_encodeVertexVersion(0); + meshopt_encodeIndexVersion(1); + + return 0; +} diff --git a/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt b/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/meshoptimizer/all/test_v1_package/conanfile.py b/recipes/meshoptimizer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/meshoptimizer/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/meshoptimizer/config.yml b/recipes/meshoptimizer/config.yml new file mode 100644 index 0000000000000..301a8d09f5b3a --- /dev/null +++ b/recipes/meshoptimizer/config.yml @@ -0,0 +1,9 @@ +versions: + "0.17": + folder: all + "0.16": + folder: all + "0.15": + folder: all + "0.14": + folder: all diff --git a/recipes/meson/all/conandata.yml b/recipes/meson/all/conandata.yml new file mode 100644 index 0000000000000..f25b5c36671dc --- /dev/null +++ b/recipes/meson/all/conandata.yml @@ -0,0 +1,58 @@ +sources: + "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" + "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" + "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" + "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" + "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/all/conanfile.py b/recipes/meson/all/conanfile.py new file mode 100644 index 0000000000000..e2d65a1b60825 --- /dev/null +++ b/recipes/meson/all/conanfile.py @@ -0,0 +1,71 @@ +import os +import textwrap + +from conan import ConanFile, conan_version +from conan.tools.files import copy, get, rmdir, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class MesonConan(ConanFile): + name = "meson" + package_type = "application" + description = "Meson is a project to create the best possible next-generation build system" + topics = ("meson", "mesonbuild", "build-system") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mesonbuild/meson" + license = "Apache-2.0" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.conf.get("tools.meson.mesontoolchain:backend", default="ninja", check_type=str) == "ninja": + self.requires("ninja/1.11.1") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "bin", "test cases")) + + # create wrapper scripts + save(self, os.path.join(self.package_folder, "bin", "meson.cmd"), textwrap.dedent("""\ + @echo off + CALL python %~dp0/meson.py %* + """)) + save(self, os.path.join(self.package_folder, "bin", "meson"), textwrap.dedent("""\ + #!/usr/bin/env bash + meson_dir=$(dirname "$0") + exec "$meson_dir/meson.py" "$@" + """)) + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def package_info(self): + meson_root = os.path.join(self.package_folder, "bin") + self._chmod_plus_x(os.path.join(meson_root, "meson")) + self._chmod_plus_x(os.path.join(meson_root, "meson.py")) + + self.cpp_info.builddirs = [os.path.join("bin", "mesonbuild", "cmake", "data")] + + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if Version(conan_version).major < 2: + self.env_info.PATH.append(meson_root) diff --git a/recipes/meson/all/test_package/conanfile.py b/recipes/meson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..19ffe682ab919 --- /dev/null +++ b/recipes/meson/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "MesonToolchain", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + self.run("meson --version") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/meson/all/test_package/meson.build b/recipes/meson/all/test_package/meson.build new file mode 100644 index 0000000000000..fb2ab041f4a3a --- /dev/null +++ b/recipes/meson/all/test_package/meson.build @@ -0,0 +1,2 @@ +project('test_package', 'cpp') +executable('test_package', 'test_package.cpp') diff --git a/recipes/meson/all/test_package/test_package.cpp b/recipes/meson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5ddd507e22b2e --- /dev/null +++ b/recipes/meson/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Hello from Meson.\n"); + return 0; +} diff --git a/recipes/meson/all/test_v1_package/conanfile.py b/recipes/meson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c8624c6f85f40 --- /dev/null +++ b/recipes/meson/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, Meson, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def build(self): + if not tools.cross_building(self): + meson = Meson(self) + meson.configure(build_folder="build") + meson.build() + + def test(self): + self.run("meson --version") + if not tools.cross_building(self): + bin_path = os.path.join("build", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/meson/all/test_v1_package/meson.build b/recipes/meson/all/test_v1_package/meson.build new file mode 100644 index 0000000000000..e67dd979af3c4 --- /dev/null +++ b/recipes/meson/all/test_v1_package/meson.build @@ -0,0 +1,2 @@ +project('test_package', 'cpp') +executable('test_package', '../test_package/test_package.cpp') diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml new file mode 100644 index 0000000000000..8eb6efcdd80dd --- /dev/null +++ b/recipes/meson/config.yml @@ -0,0 +1,39 @@ +versions: + "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/metall/all/conandata.yml b/recipes/metall/all/conandata.yml new file mode 100644 index 0000000000000..788ef5da15507 --- /dev/null +++ b/recipes/metall/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.21": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.21.tar.gz" + sha256: "feaff7a935f98d3cc1e2b21f6eae40edc674a5bd0133306afd3851148aaed026" + "0.20": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.20.tar.gz" + sha256: "cafe54c682004a66a059f54e2d7128ea7622e9941ea492297d04c260675e9af4" + "0.23.1": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.23.1.tar.gz" + sha256: "25e8fbc424e66d09e0faf60029288e4612685675bfd947cc142bd9d6d0645ac4" diff --git a/recipes/metall/all/conanfile.py b/recipes/metall/all/conanfile.py new file mode 100644 index 0000000000000..957ba5421027f --- /dev/null +++ b/recipes/metall/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.50.0" + + +class MetallConan(ConanFile): + name = "metall" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/LLNL/metall" + description = "Meta allocator for persistent memory" + license = "MIT", "Apache-2.0" + topics = "cpp", "allocator", "memory-allocator", "persistent-memory", "ecp", "exascale-computing" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8.3", + "clang": "9", + } + + def requirements(self): + self.requires("boost/1.79.0") + + def package_id(self): + self.info.clear() + + 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.") + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if minimum_version and 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)) + + 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 + + def package(self): + copy(self, "*", 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")) + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Metall") + self.cpp_info.set_property("cmake_target_name", "Metall::Metall") + + self.cpp_info.names["cmake_find_package"] = "Metall" + self.cpp_info.names["cmake_find_package_multi"] = "Metall" + + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + if self.settings.compiler == "gcc" or (self.settings.os == "Linux" and self.settings.compiler == "clang"): + if Version(self.settings.compiler.version) < "9": + self.cpp_info.system_libs += ["stdc++fs"] + + self.cpp_info.requires = ["boost::headers"] diff --git a/recipes/metall/all/test_package/CMakeLists.txt b/recipes/metall/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e4433c83b857b --- /dev/null +++ b/recipes/metall/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Metall REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Metall::Metall) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/metall/all/test_package/conanfile.py b/recipes/metall/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/metall/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/metall/all/test_package/test_package.cpp b/recipes/metall/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5e419e0f81b4a --- /dev/null +++ b/recipes/metall/all/test_package/test_package.cpp @@ -0,0 +1,51 @@ +// Copyright 2019 Lawrence Livermore National Security, LLC and other Metall Project Developers. +// See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#include +#include + +#include // Only one header file is required to be included + +// Type alias +// This is a standard way to give a custom allocator to a container +using vector_t = boost::container::vector>; + +int main() { + + { + // Construct a manager object + // A process can allocate multiple manager objects + metall::manager manager(metall::create_only, // Create a new one + "/tmp/dir"); // The directory to store backing datastore + + // Allocate and construct a vector object in the persistent memory with a name "vec" + auto pvec = manager.construct // Allocate and construct an object of vector_t + ("vec") // Name of the allocated object + (manager.get_allocator()); // Arguments passed to vector_t's constructor + + pvec->push_back(5); // Can use containers normally + + } // Implicitly sync with backing files, i.e., sync() is called in metall::manager's destructor + + // ---------- Assume exit and restart the program at this point ---------- // + + { + // Reattach the manager object + metall::manager manager(metall::open_only, "/tmp/dir"); + + // Find the previously constructed object + // Please do not forget to use ".first" at the end + auto pvec = manager.find("vec").first; + + pvec->push_back(10); // Can restart to use containers normally + + std::cout << (*pvec)[0] << std::endl; // Will print "5" + std::cout << (*pvec)[1] << std::endl; // Will print "10" + + manager.destroy("vec"); // Destroy the object + } + + return 0; +} diff --git a/recipes/metall/all/test_v1_package/CMakeLists.txt b/recipes/metall/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..90ab90a88d549 --- /dev/null +++ b/recipes/metall/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Metall REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Metall::Metall) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/metall/all/test_v1_package/conanfile.py b/recipes/metall/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/metall/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/metall/config.yml b/recipes/metall/config.yml new file mode 100644 index 0000000000000..e3fb6e5067c49 --- /dev/null +++ b/recipes/metall/config.yml @@ -0,0 +1,7 @@ +versions: + "0.21": + folder: all + "0.20": + folder: all + "0.23.1": + folder: all diff --git a/recipes/metis/all/CMakeLists.txt b/recipes/metis/all/CMakeLists.txt new file mode 100644 index 0000000000000..15cbde395086d --- /dev/null +++ b/recipes/metis/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper LANGUAGES C) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +set(GKLIB_PATH "${CMAKE_CURRENT_LIST_DIR}/source_subfolder/GKlib" CACHE PATH "") + +add_subdirectory(source_subfolder) diff --git a/recipes/metis/all/conandata.yml b/recipes/metis/all/conandata.yml new file mode 100644 index 0000000000000..396a06387b94f --- /dev/null +++ b/recipes/metis/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "5.1.1": + url: "https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.tar.gz" + sha256: "cedf0b32d32a8496bac7eb078b2b8260fb00ddb8d50c27e4082968a01bc33331" +patches: + "5.1.1": + - patch_file: "patches/001-add-gklib-system-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/002-support-pure-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/003-remove-programs.patch" + base_path: "source_subfolder" + - patch_file: "patches/004-use-conan-gklib.patch" + base_path: "source_subfolder" + - patch_file: "patches/005-fix-install.patch" + base_path: "source_subfolder" diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py new file mode 100644 index 0000000000000..7e077e7ea6112 --- /dev/null +++ b/recipes/metis/all/conanfile.py @@ -0,0 +1,101 @@ +from conans import ConanFile, CMake, tools +from conan.tools.files import apply_conandata_patches +import os + +required_conan_version = ">=1.43.0" + + +class METISConan(ConanFile): + name = "metis" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/KarypisLab/METIS" + description = "set of serial programs for partitioning graphs," \ + " partitioning finite element meshes, and producing" \ + " fill reducing orderings for sparse matrices" + topics = ("karypislab", "graph", "partitioning-algorithms") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "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 _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("gklib/5.1.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + self._cmake.definitions["SHARED"] = self.options.shared + self._cmake.definitions["METIS_INSTALL"] = True + self._cmake.definitions["ASSERT"] = self.settings.build_type == "Debug" + self._cmake.definitions["ASSERT2"] = self.settings.build_type == "Debug" + self._cmake.definitions["METIS_IDX64"] = True + self._cmake.definitions["METIS_REAL64"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + + def package_info(self): + self.cpp_info.libs = ["metis"] + self.cpp_info.requires.append("gklib::gklib") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self._is_msvc or self._is_mingw: + self.cpp_info.defines.append("USE_GKREGEX") + if self._is_msvc: + self.cpp_info.defines.append("__thread=__declspec(thread)") diff --git a/recipes/metis/all/patches/001-add-gklib-system-cmake.patch b/recipes/metis/all/patches/001-add-gklib-system-cmake.patch new file mode 100644 index 0000000000000..2c6798304339e --- /dev/null +++ b/recipes/metis/all/patches/001-add-gklib-system-cmake.patch @@ -0,0 +1,151 @@ +Add gklib system cmake +--- /dev/null ++++ b/GKlib/GKlibSystem.cmake +@@ -0,0 +1,133 @@ ++# Helper modules. ++include(CheckFunctionExists) ++include(CheckIncludeFile) ++ ++# Setup options. ++option(GDB "enable use of GDB" OFF) ++option(ASSERT "turn asserts on" OFF) ++option(ASSERT2 "additional assertions" OFF) ++option(DEBUG "add debugging support" OFF) ++option(GPROF "add gprof support" OFF) ++option(OPENMP "enable OpenMP support" OFF) ++option(PCRE "enable PCRE support" OFF) ++option(GKREGEX "enable GKREGEX support" OFF) ++option(GKRAND "enable GKRAND support" OFF) ++ ++ ++# Add compiler flags. ++if(MSVC) ++ set(GKlib_COPTS "/Ox") ++ set(GKlib_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") ++elseif(MINGW) ++ set(GKlib_COPTS "-DUSE_GKREGEX") ++else() ++ set(GKlib_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") ++endif(MSVC) ++if(CYGWIN) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DCYGWIN") ++endif(CYGWIN) ++if(CMAKE_COMPILER_IS_GNUCC) ++# GCC opts. ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -std=c99 -fno-strict-aliasing") ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -march=native") ++ if(NOT MINGW) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC") ++ endif(NOT MINGW) ++# GCC warnings. ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") ++elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") ++# Sun insists on -xc99. ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99") ++endif(CMAKE_COMPILER_IS_GNUCC) ++ ++# Intel compiler ++if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -xHost -std=c99") ++endif() ++ ++# Find OpenMP if it is requested. ++if(OPENMP) ++ include(FindOpenMP) ++ if(OPENMP_FOUND) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") ++ else() ++ message(WARNING "OpenMP was requested but support was not found") ++ endif(OPENMP_FOUND) ++endif(OPENMP) ++ ++ ++# Add various definitions. ++if(GDB) ++ set(GKlib_COPTS "${GKlib_COPTS} -g") ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror") ++else() ++ set(GKlib_COPTS "-O3") ++endif(GDB) ++ ++ ++if(DEBUG) ++ set(GKlib_COPTS "-g") ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DDEBUG") ++endif(DEBUG) ++ ++if(GPROF) ++ set(GKlib_COPTS "-pg") ++endif(GPROF) ++ ++if(NOT ASSERT) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG") ++endif(NOT ASSERT) ++ ++if(NOT ASSERT2) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG2") ++endif(NOT ASSERT2) ++ ++ ++# Add various options ++if(PCRE) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__WITHPCRE__") ++endif(PCRE) ++ ++if(GKREGEX) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKREGEX") ++endif(GKREGEX) ++ ++if(GKRAND) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKRAND") ++endif(GKRAND) ++ ++ ++# Check for features. ++check_include_file(execinfo.h HAVE_EXECINFO_H) ++if(HAVE_EXECINFO_H) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_EXECINFO_H") ++endif(HAVE_EXECINFO_H) ++ ++check_function_exists(getline HAVE_GETLINE) ++if(HAVE_GETLINE) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_GETLINE") ++endif(HAVE_GETLINE) ++ ++ ++# Custom check for TLS. ++if(MSVC) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=__declspec(thread)") ++ ++ # This if checks if that value is cached or not. ++ if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") ++ try_compile(HAVE_THREADLOCALSTORAGE ++ ${CMAKE_BINARY_DIR} ++ ${GKLIB_PATH}/conf/check_thread_storage.c) ++ if(HAVE_THREADLOCALSTORAGE) ++ message(STATUS "checking for thread-local storage - found") ++ else() ++ message(STATUS "checking for thread-local storage - not found") ++ endif() ++ endif() ++ if(NOT HAVE_THREADLOCALSTORAGE) ++ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=") ++ endif() ++endif() ++ ++# Finally set the official C flags. ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GKlib_COPTIONS} ${GKlib_COPTS}") +diff --git a/GKlib/conf/check_thread_storage.c b/GKlib/conf/check_thread_storage.c +new file mode 100644 +index 0000000..e6e1e98 +--- /dev/null ++++ b/GKlib/conf/check_thread_storage.c +@@ -0,0 +1,5 @@ ++extern __thread int x; ++ ++int main(int argc, char **argv) { ++ return 0; ++} +-- +2.33.1.windows.1 + diff --git a/recipes/metis/all/patches/002-support-pure-cmake.patch b/recipes/metis/all/patches/002-support-pure-cmake.patch new file mode 100644 index 0000000000000..7fc0e8b45ccb7 --- /dev/null +++ b/recipes/metis/all/patches/002-support-pure-cmake.patch @@ -0,0 +1,771 @@ +Generate metis.h based on CMake options +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,26 +20,28 @@ endif(SHARED) + include(${GKLIB_PATH}/GKlibSystem.cmake) + + # METIS' custom options +-#option(IDX64 "enable 64 bit ints" OFF) +-#option(REAL64 "enable 64 bit floats (i.e., double)" OFF) +-#if(IDX64) +-# set(METIS_COPTIONS "${METIS_COPTIONS} -DIDXTYPEWIDTH=64") +-#else() +-# set(METIS_COPTIONS "${METIS_COPTIONS} -DIDXTYPEWIDTH=32") +-#endif(IDX64) +-#if(REAL64) +-# set(METIS_COPTIONS "${METIS_COPTIONS} -DREALTYPEWIDTH=64") +-#else() +-# set(METIS_COPTIONS "${METIS_COPTIONS} -DREALTYPEWIDTH=32") +-#endif(REAL64) +-# +-#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${METIS_COPTIONS}") +- ++option(METIS_IDX64 "enable 64 bit ints" OFF) ++option(METIS_REAL64 "enable 64 bit floats (i.e., double)" OFF) ++if (METIS_IDX64) ++ set(METIS_IDXTYPEWIDTH 64) ++else () ++ set(METIS_IDXTYPEWIDTH 32) ++endif () ++if (METIS_REAL64) ++ set(METIS_REALTYPEWIDTH 64) ++else () ++ set(METIS_REALTYPEWIDTH 32) ++endif () + + # Add include directories. + include_directories(${GKLIB_PATH}) +-include_directories(build/xinclude) ++configure_file(${PROJECT_SOURCE_DIR}/include/metis.h.in ++ ${PROJECT_BINARY_DIR}/include/metis.h) ++include_directories(${PROJECT_BINARY_DIR}/include) ++if (METIS_INSTALL) ++ install(FILES ${PROJECT_BINARY_DIR}/include/metis.h DESTINATION include) ++endif () ++ + # Recursively look for CMakeLists.txt in subdirs. +-add_subdirectory("build/xinclude") + add_subdirectory("libmetis") + add_subdirectory("programs") +--- a/include/metis.h ++++ /dev/null +@@ -1,358 +0,0 @@ +-/*! +-\file metis.h +-\brief This file contains function prototypes and constant definitions for METIS +- * +-\author George +-\date Started 8/9/02 +-\version\verbatim $Id$\endverbatim +-*/ +- +-#ifndef _METIS_H_ +-#define _METIS_H_ +- +-/**************************************************************************** +-* A set of defines that can be modified by the user +-*****************************************************************************/ +- +-/*-------------------------------------------------------------------------- +- Specifies the width of the elementary data type that will hold information +- about vertices and their adjacency lists. +- +- Possible values: +- 32 : Use 32 bit signed integers +- 64 : Use 64 bit signed integers +- +- A width of 64 should be specified if the number of vertices or the total +- number of edges in the graph exceed the limits of a 32 bit signed integer +- i.e., 2^31-1. +- Proper use of 64 bit integers requires that the c99 standard datatypes +- int32_t and int64_t are supported by the compiler. +- GCC does provides these definitions in stdint.h, but it may require some +- modifications on other architectures. +---------------------------------------------------------------------------*/ +-//#define IDXTYPEWIDTH 32 +- +- +-/*-------------------------------------------------------------------------- +- Specifies the data type that will hold floating-point style information. +- +- Possible values: +- 32 : single precission floating point (float) +- 64 : double precission floating point (double) +---------------------------------------------------------------------------*/ +-//#define REALTYPEWIDTH 32 +- +- +- +-/**************************************************************************** +-* In principle, nothing needs to be changed beyond this point, unless the +-* int32_t and int64_t cannot be found in the normal places. +-*****************************************************************************/ +- +-/* Uniform definitions for various compilers */ +-#if defined(_MSC_VER) +- #define COMPILER_MSC +-#endif +-#if defined(__ICC) +- #define COMPILER_ICC +-#endif +-#if defined(__GNUC__) +- #define COMPILER_GCC +-#endif +- +-/* Include c99 int definitions and need constants. When building the library, +- * these are already defined by GKlib; hence the test for _GKLIB_H_ */ +-#ifndef _GKLIB_H_ +-#ifdef COMPILER_MSC +-#include +- +-typedef __int32 int32_t; +-typedef __int64 int64_t; +-#define PRId32 "I32d" +-#define PRId64 "I64d" +-#define SCNd32 "ld" +-#define SCNd64 "I64d" +-#define INT32_MIN ((int32_t)_I32_MIN) +-#define INT32_MAX _I32_MAX +-#define INT64_MIN ((int64_t)_I64_MIN) +-#define INT64_MAX _I64_MAX +-#else +-#include +-#endif +-#endif +- +- +-/*------------------------------------------------------------------------ +-* Setup the basic datatypes +-*-------------------------------------------------------------------------*/ +-#if IDXTYPEWIDTH == 32 +- typedef int32_t idx_t; +- +- #define IDX_MAX INT32_MAX +- #define IDX_MIN INT32_MIN +- +- #define SCIDX SCNd32 +- #define PRIDX PRId32 +- +- #define strtoidx strtol +- #define iabs abs +-#elif IDXTYPEWIDTH == 64 +- typedef int64_t idx_t; +- +- #define IDX_MAX INT64_MAX +- #define IDX_MIN INT64_MIN +- +- #define SCIDX SCNd64 +- #define PRIDX PRId64 +- +-#ifdef COMPILER_MSC +- #define strtoidx _strtoi64 +-#else +- #define strtoidx strtoll +-#endif +- #define iabs labs +-#else +- #error "Incorrect user-supplied value fo IDXTYPEWIDTH" +-#endif +- +- +-#if REALTYPEWIDTH == 32 +- typedef float real_t; +- +- #define SCREAL "f" +- #define PRREAL "f" +- #define REAL_MAX FLT_MAX +- #define REAL_MIN FLT_MIN +- #define REAL_EPSILON FLT_EPSILON +- +- #define rabs fabsf +- #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) +- +-#ifdef COMPILER_MSC +- #define strtoreal (float)strtod +-#else +- #define strtoreal strtof +-#endif +-#elif REALTYPEWIDTH == 64 +- typedef double real_t; +- +- #define SCREAL "lf" +- #define PRREAL "lf" +- #define REAL_MAX DBL_MAX +- #define REAL_MIN DBL_MIN +- #define REAL_EPSILON DBL_EPSILON +- +- #define rabs fabs +- #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) +- +- #define strtoreal strtod +-#else +- #error "Incorrect user-supplied value for REALTYPEWIDTH" +-#endif +- +- +-/*------------------------------------------------------------------------ +-* Constant definitions +-*-------------------------------------------------------------------------*/ +-/* Metis's version number */ +-#define METIS_VER_MAJOR 5 +-#define METIS_VER_MINOR 1 +-#define METIS_VER_SUBMINOR 0 +- +-/* The maximum length of the options[] array */ +-#define METIS_NOPTIONS 40 +- +- +- +-/*------------------------------------------------------------------------ +-* Function prototypes +-*-------------------------------------------------------------------------*/ +- +-#ifdef _WINDLL +-#define METIS_API(type) __declspec(dllexport) type __cdecl +-#elif defined(__cdecl) +-#define METIS_API(type) type __cdecl +-#else +-#define METIS_API(type) type +-#endif +- +- +- +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, +- idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, +- idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, +- idx_t *edgecut, idx_t *part); +- +-METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, +- idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, +- idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, +- idx_t *edgecut, idx_t *part); +- +-METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, +- idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); +- +-METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, +- idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); +- +-METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, +- idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, +- idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart); +- +-METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, +- idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, +- real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, +- idx_t *npart); +- +-METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, +- idx_t *options, idx_t *perm, idx_t *iperm); +- +-METIS_API(int) METIS_Free(void *ptr); +- +-METIS_API(int) METIS_SetDefaultOptions(idx_t *options); +- +- +-/* These functions are used by ParMETIS */ +- +-METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, +- idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, +- idx_t *sizes); +- +-METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, +- idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part); +- +-METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, +- idx_t *where, idx_t *hmarker, real_t ubfactor); +- +- +-/* These functions are used by DGL */ +- +-METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, +- idx_t *part, idx_t *old2new); +- +-#ifdef __cplusplus +-} +-#endif +- +- +- +-/*------------------------------------------------------------------------ +-* Enum type definitions +-*-------------------------------------------------------------------------*/ +-/*! Return codes */ +-typedef enum { +- METIS_OK = 1, /*!< Returned normally */ +- METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ +- METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ +- METIS_ERROR = -4 /*!< Some other errors */ +-} rstatus_et; +- +- +-/*! Operation type codes */ +-typedef enum { +- METIS_OP_PMETIS, +- METIS_OP_KMETIS, +- METIS_OP_OMETIS +-} moptype_et; +- +- +-/*! Options codes (i.e., options[]) */ +-typedef enum { +- METIS_OPTION_PTYPE, +- METIS_OPTION_OBJTYPE, +- METIS_OPTION_CTYPE, +- METIS_OPTION_IPTYPE, +- METIS_OPTION_RTYPE, +- METIS_OPTION_DBGLVL, +- METIS_OPTION_NIPARTS, +- METIS_OPTION_NITER, +- METIS_OPTION_NCUTS, +- METIS_OPTION_SEED, +- METIS_OPTION_NO2HOP, +- METIS_OPTION_ONDISK, +- METIS_OPTION_MINCONN, +- METIS_OPTION_CONTIG, +- METIS_OPTION_COMPRESS, +- METIS_OPTION_CCORDER, +- METIS_OPTION_PFACTOR, +- METIS_OPTION_NSEPS, +- METIS_OPTION_UFACTOR, +- METIS_OPTION_NUMBERING, +- METIS_OPTION_DROPEDGES, +- +- /* Used for command-line parameter purposes */ +- METIS_OPTION_HELP, +- METIS_OPTION_TPWGTS, +- METIS_OPTION_NCOMMON, +- METIS_OPTION_NOOUTPUT, +- METIS_OPTION_BALANCE, +- METIS_OPTION_GTYPE, +- METIS_OPTION_UBVEC +-} moptions_et; +- +- +-/*! Partitioning Schemes */ +-typedef enum { +- METIS_PTYPE_RB, +- METIS_PTYPE_KWAY +-} mptype_et; +- +-/*! Graph types for meshes */ +-typedef enum { +- METIS_GTYPE_DUAL, +- METIS_GTYPE_NODAL +-} mgtype_et; +- +-/*! Coarsening Schemes */ +-typedef enum { +- METIS_CTYPE_RM, +- METIS_CTYPE_SHEM +-} mctype_et; +- +-/*! Initial partitioning schemes */ +-typedef enum { +- METIS_IPTYPE_GROW, +- METIS_IPTYPE_RANDOM, +- METIS_IPTYPE_EDGE, +- METIS_IPTYPE_NODE, +- METIS_IPTYPE_METISRB +-} miptype_et; +- +- +-/*! Refinement schemes */ +-typedef enum { +- METIS_RTYPE_FM, +- METIS_RTYPE_GREEDY, +- METIS_RTYPE_SEP2SIDED, +- METIS_RTYPE_SEP1SIDED +-} mrtype_et; +- +- +-/*! Debug Levels */ +-typedef enum { +- METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ +- METIS_DBG_TIME = 2, /*!< Perform timing analysis */ +- METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ +- METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ +- METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ +- METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ +- METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ +- METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ +- METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ +- METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */ +-} mdbglvl_et; +- +- +-/* Types of objectives */ +-typedef enum { +- METIS_OBJTYPE_CUT, +- METIS_OBJTYPE_VOL, +- METIS_OBJTYPE_NODE +-} mobjtype_et; +- +- +- +-#endif /* _METIS_H_ */ +--- /dev/null ++++ b/include/metis.h.in +@@ -0,0 +1,358 @@ ++/*! ++\file metis.h ++\brief This file contains function prototypes and constant definitions for METIS ++ * ++\author George ++\date Started 8/9/02 ++\version\verbatim $Id$\endverbatim ++*/ ++ ++#ifndef _METIS_H_ ++#define _METIS_H_ ++ ++/**************************************************************************** ++* A set of defines that can be modified by the user ++*****************************************************************************/ ++ ++/*-------------------------------------------------------------------------- ++ Specifies the width of the elementary data type that will hold information ++ about vertices and their adjacency lists. ++ ++ Possible values: ++ 32 : Use 32 bit signed integers ++ 64 : Use 64 bit signed integers ++ ++ A width of 64 should be specified if the number of vertices or the total ++ number of edges in the graph exceed the limits of a 32 bit signed integer ++ i.e., 2^31-1. ++ Proper use of 64 bit integers requires that the c99 standard datatypes ++ int32_t and int64_t are supported by the compiler. ++ GCC does provides these definitions in stdint.h, but it may require some ++ modifications on other architectures. ++--------------------------------------------------------------------------*/ ++#define IDXTYPEWIDTH @METIS_IDXTYPEWIDTH@ ++ ++ ++/*-------------------------------------------------------------------------- ++ Specifies the data type that will hold floating-point style information. ++ ++ Possible values: ++ 32 : single precission floating point (float) ++ 64 : double precission floating point (double) ++--------------------------------------------------------------------------*/ ++#define REALTYPEWIDTH @METIS_REALTYPEWIDTH@ ++ ++ ++ ++/**************************************************************************** ++* In principle, nothing needs to be changed beyond this point, unless the ++* int32_t and int64_t cannot be found in the normal places. ++*****************************************************************************/ ++ ++/* Uniform definitions for various compilers */ ++#if defined(_MSC_VER) ++ #define COMPILER_MSC ++#endif ++#if defined(__ICC) ++ #define COMPILER_ICC ++#endif ++#if defined(__GNUC__) ++ #define COMPILER_GCC ++#endif ++ ++/* Include c99 int definitions and need constants. When building the library, ++ * these are already defined by GKlib; hence the test for _GKLIB_H_ */ ++#ifndef _GKLIB_H_ ++#ifdef COMPILER_MSC ++#include ++ ++typedef __int32 int32_t; ++typedef __int64 int64_t; ++#define PRId32 "I32d" ++#define PRId64 "I64d" ++#define SCNd32 "ld" ++#define SCNd64 "I64d" ++#define INT32_MIN ((int32_t)_I32_MIN) ++#define INT32_MAX _I32_MAX ++#define INT64_MIN ((int64_t)_I64_MIN) ++#define INT64_MAX _I64_MAX ++#else ++#include ++#endif ++#endif ++ ++ ++/*------------------------------------------------------------------------ ++* Setup the basic datatypes ++*-------------------------------------------------------------------------*/ ++#if IDXTYPEWIDTH == 32 ++ typedef int32_t idx_t; ++ ++ #define IDX_MAX INT32_MAX ++ #define IDX_MIN INT32_MIN ++ ++ #define SCIDX SCNd32 ++ #define PRIDX PRId32 ++ ++ #define strtoidx strtol ++ #define iabs abs ++#elif IDXTYPEWIDTH == 64 ++ typedef int64_t idx_t; ++ ++ #define IDX_MAX INT64_MAX ++ #define IDX_MIN INT64_MIN ++ ++ #define SCIDX SCNd64 ++ #define PRIDX PRId64 ++ ++#ifdef COMPILER_MSC ++ #define strtoidx _strtoi64 ++#else ++ #define strtoidx strtoll ++#endif ++ #define iabs labs ++#else ++ #error "Incorrect user-supplied value fo IDXTYPEWIDTH" ++#endif ++ ++ ++#if REALTYPEWIDTH == 32 ++ typedef float real_t; ++ ++ #define SCREAL "f" ++ #define PRREAL "f" ++ #define REAL_MAX FLT_MAX ++ #define REAL_MIN FLT_MIN ++ #define REAL_EPSILON FLT_EPSILON ++ ++ #define rabs fabsf ++ #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) ++ ++#ifdef COMPILER_MSC ++ #define strtoreal (float)strtod ++#else ++ #define strtoreal strtof ++#endif ++#elif REALTYPEWIDTH == 64 ++ typedef double real_t; ++ ++ #define SCREAL "lf" ++ #define PRREAL "lf" ++ #define REAL_MAX DBL_MAX ++ #define REAL_MIN DBL_MIN ++ #define REAL_EPSILON DBL_EPSILON ++ ++ #define rabs fabs ++ #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) ++ ++ #define strtoreal strtod ++#else ++ #error "Incorrect user-supplied value for REALTYPEWIDTH" ++#endif ++ ++ ++/*------------------------------------------------------------------------ ++* Constant definitions ++*-------------------------------------------------------------------------*/ ++/* Metis's version number */ ++#define METIS_VER_MAJOR 5 ++#define METIS_VER_MINOR 1 ++#define METIS_VER_SUBMINOR 0 ++ ++/* The maximum length of the options[] array */ ++#define METIS_NOPTIONS 40 ++ ++ ++ ++/*------------------------------------------------------------------------ ++* Function prototypes ++*-------------------------------------------------------------------------*/ ++ ++#ifdef _WINDLL ++#define METIS_API(type) __declspec(dllexport) type __cdecl ++#elif defined(__cdecl) ++#define METIS_API(type) type __cdecl ++#else ++#define METIS_API(type) type ++#endif ++ ++ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, ++ idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, ++ idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, ++ idx_t *edgecut, idx_t *part); ++ ++METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, ++ idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, ++ idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, ++ idx_t *edgecut, idx_t *part); ++ ++METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, ++ idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); ++ ++METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, ++ idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); ++ ++METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, ++ idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, ++ idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart); ++ ++METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, ++ idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, ++ real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, ++ idx_t *npart); ++ ++METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, ++ idx_t *options, idx_t *perm, idx_t *iperm); ++ ++METIS_API(int) METIS_Free(void *ptr); ++ ++METIS_API(int) METIS_SetDefaultOptions(idx_t *options); ++ ++ ++/* These functions are used by ParMETIS */ ++ ++METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, ++ idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, ++ idx_t *sizes); ++ ++METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, ++ idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part); ++ ++METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, ++ idx_t *where, idx_t *hmarker, real_t ubfactor); ++ ++ ++/* These functions are used by DGL */ ++ ++METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, ++ idx_t *part, idx_t *old2new); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ ++ ++/*------------------------------------------------------------------------ ++* Enum type definitions ++*-------------------------------------------------------------------------*/ ++/*! Return codes */ ++typedef enum { ++ METIS_OK = 1, /*!< Returned normally */ ++ METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ ++ METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ ++ METIS_ERROR = -4 /*!< Some other errors */ ++} rstatus_et; ++ ++ ++/*! Operation type codes */ ++typedef enum { ++ METIS_OP_PMETIS, ++ METIS_OP_KMETIS, ++ METIS_OP_OMETIS ++} moptype_et; ++ ++ ++/*! Options codes (i.e., options[]) */ ++typedef enum { ++ METIS_OPTION_PTYPE, ++ METIS_OPTION_OBJTYPE, ++ METIS_OPTION_CTYPE, ++ METIS_OPTION_IPTYPE, ++ METIS_OPTION_RTYPE, ++ METIS_OPTION_DBGLVL, ++ METIS_OPTION_NIPARTS, ++ METIS_OPTION_NITER, ++ METIS_OPTION_NCUTS, ++ METIS_OPTION_SEED, ++ METIS_OPTION_NO2HOP, ++ METIS_OPTION_ONDISK, ++ METIS_OPTION_MINCONN, ++ METIS_OPTION_CONTIG, ++ METIS_OPTION_COMPRESS, ++ METIS_OPTION_CCORDER, ++ METIS_OPTION_PFACTOR, ++ METIS_OPTION_NSEPS, ++ METIS_OPTION_UFACTOR, ++ METIS_OPTION_NUMBERING, ++ METIS_OPTION_DROPEDGES, ++ ++ /* Used for command-line parameter purposes */ ++ METIS_OPTION_HELP, ++ METIS_OPTION_TPWGTS, ++ METIS_OPTION_NCOMMON, ++ METIS_OPTION_NOOUTPUT, ++ METIS_OPTION_BALANCE, ++ METIS_OPTION_GTYPE, ++ METIS_OPTION_UBVEC ++} moptions_et; ++ ++ ++/*! Partitioning Schemes */ ++typedef enum { ++ METIS_PTYPE_RB, ++ METIS_PTYPE_KWAY ++} mptype_et; ++ ++/*! Graph types for meshes */ ++typedef enum { ++ METIS_GTYPE_DUAL, ++ METIS_GTYPE_NODAL ++} mgtype_et; ++ ++/*! Coarsening Schemes */ ++typedef enum { ++ METIS_CTYPE_RM, ++ METIS_CTYPE_SHEM ++} mctype_et; ++ ++/*! Initial partitioning schemes */ ++typedef enum { ++ METIS_IPTYPE_GROW, ++ METIS_IPTYPE_RANDOM, ++ METIS_IPTYPE_EDGE, ++ METIS_IPTYPE_NODE, ++ METIS_IPTYPE_METISRB ++} miptype_et; ++ ++ ++/*! Refinement schemes */ ++typedef enum { ++ METIS_RTYPE_FM, ++ METIS_RTYPE_GREEDY, ++ METIS_RTYPE_SEP2SIDED, ++ METIS_RTYPE_SEP1SIDED ++} mrtype_et; ++ ++ ++/*! Debug Levels */ ++typedef enum { ++ METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ ++ METIS_DBG_TIME = 2, /*!< Perform timing analysis */ ++ METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ ++ METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ ++ METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ ++ METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ ++ METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ ++ METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ ++ METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ ++ METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */ ++} mdbglvl_et; ++ ++ ++/* Types of objectives */ ++typedef enum { ++ METIS_OBJTYPE_CUT, ++ METIS_OBJTYPE_VOL, ++ METIS_OBJTYPE_NODE ++} mobjtype_et; ++ ++ ++ ++#endif /* _METIS_H_ */ diff --git a/recipes/metis/all/patches/003-remove-programs.patch b/recipes/metis/all/patches/003-remove-programs.patch new file mode 100644 index 0000000000000..73a59f03ddbac --- /dev/null +++ b/recipes/metis/all/patches/003-remove-programs.patch @@ -0,0 +1,8 @@ +Do not build programs +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,4 +44,3 @@ endif () + + # Recursively look for CMakeLists.txt in subdirs. + add_subdirectory("libmetis") +-add_subdirectory("programs") diff --git a/recipes/metis/all/patches/004-use-conan-gklib.patch b/recipes/metis/all/patches/004-use-conan-gklib.patch new file mode 100644 index 0000000000000..60a824f3c58d1 --- /dev/null +++ b/recipes/metis/all/patches/004-use-conan-gklib.patch @@ -0,0 +1,17 @@ +find gklib from conan +--- a/libmetis/CMakeLists.txt ++++ b/libmetis/CMakeLists.txt +@@ -3,9 +3,11 @@ include_directories(.) + # Find sources. + file(GLOB metis_sources *.c) + # Build libmetis. +-add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources}) ++add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources}) ++find_package(gklib REQUIRED) ++target_link_libraries(metis PRIVATE gklib::gklib) + if(UNIX) +- target_link_libraries(metis m) ++ target_link_libraries(metis PRIVATE m) + endif() + + if(METIS_INSTALL) diff --git a/recipes/metis/all/patches/005-fix-install.patch b/recipes/metis/all/patches/005-fix-install.patch new file mode 100644 index 0000000000000..0ddb28f482535 --- /dev/null +++ b/recipes/metis/all/patches/005-fix-install.patch @@ -0,0 +1,28 @@ +Always install and fix runtime destination +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,11 +4,7 @@ project(METIS C) + set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib") + set(SHARED FALSE CACHE BOOL "build a shared library") + +-if(MSVC) +- set(METIS_INSTALL FALSE) +-else() +- set(METIS_INSTALL TRUE) +-endif() ++set(METIS_INSTALL TRUE) + + # Configure libmetis library. + if(SHARED) +diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt +index b577360..e9c7825 100644 +--- a/libmetis/CMakeLists.txt ++++ b/libmetis/CMakeLists.txt +@@ -13,6 +13,6 @@ endif() + if(METIS_INSTALL) + install(TARGETS metis + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib) + endif() diff --git a/recipes/metis/all/test_package/CMakeLists.txt b/recipes/metis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..04b6e4c9401dc --- /dev/null +++ b/recipes/metis/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(metis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test.cpp) +target_link_libraries(${PROJECT_NAME} metis::metis) diff --git a/recipes/metis/all/test_package/conanfile.py b/recipes/metis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..46d71712aba54 --- /dev/null +++ b/recipes/metis/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +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_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + self.build_requires("cmake/3.20.1") + + def 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/metis/all/test_package/test.cpp b/recipes/metis/all/test_package/test.cpp new file mode 100644 index 0000000000000..df955f7eb7be3 --- /dev/null +++ b/recipes/metis/all/test_package/test.cpp @@ -0,0 +1,37 @@ +#include + +#include +#include + +int main(){ + + idx_t nVertices = 6; + idx_t nEdges = 7; + idx_t nWeights = 1; + idx_t nParts = 2; + + idx_t objval; + idx_t part[6]; + + // Indexes of starting points in adjacent array + idx_t xadj[6+1] = {0,2,5,7,9,12,14}; + + // Adjacent vertices in consecutive index order + idx_t adjncy[2 * 7] = {1,3,0,4,2,1,5,0,4,3,1,5,4,2}; + + // Weights of vertices + // if all weights are equal then can be set to NULL + idx_t vwgt[6 * 1]; + + int ret = METIS_PartGraphKway(&nVertices,& nWeights, xadj, adjncy, + NULL, NULL, NULL, &nParts, NULL, + NULL, NULL, &objval, part); + + std::cout << ret << std::endl; + + for(unsigned part_i = 0; part_i < nVertices; part_i++){ + std::cout << part_i << " " << part[part_i] << std::endl; + } + + return 0; +} diff --git a/recipes/metis/config.yml b/recipes/metis/config.yml new file mode 100644 index 0000000000000..e7148244c2a2f --- /dev/null +++ b/recipes/metis/config.yml @@ -0,0 +1,3 @@ +versions: + "5.1.1": + folder: all diff --git a/recipes/mfast/all/conandata.yml b/recipes/mfast/all/conandata.yml new file mode 100644 index 0000000000000..05805bbb6d14e --- /dev/null +++ b/recipes/mfast/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.2.2": + url: "https://github.com/objectcomputing/mFAST/archive/refs/tags/v1.2.2.tar.gz" + sha256: "a7686c4d2e3121d7c8dd7f43b70424b55d4a1f6843179a6b0709658be27f39cb" + "1.2.1": + url: "https://github.com/objectcomputing/mFAST/archive/v1.2.1.tar.gz" + sha256: "e6ed19e629a33068b7ab5ebdbd860831f2f2b44b3b361068fbbbe975202a4851" +patches: + "1.2.2": + - patch_file: "patches/0001-fix-cmake-1.2.2.patch" + "1.2.1": + - patch_file: "patches/0001-fix-cmake-1.2.1.patch" + - patch_file: "patches/0002-remove-deprecated-boost-detail-endian.patch" + - patch_file: "patches/0003-mfast-sqlite3.patch" diff --git a/recipes/mfast/all/conanfile.py b/recipes/mfast/all/conanfile.py new file mode 100644 index 0000000000000..41c45b6db58d8 --- /dev/null +++ b/recipes/mfast/all/conanfile.py @@ -0,0 +1,283 @@ +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 ( + apply_conandata_patches, copy, export_conandata_patches, get, load, mkdir, + rename, rm, rmdir, save +) +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class mFASTConan(ConanFile): + name = "mfast" + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://objectcomputing.com/" + description = ( + "mFAST is a high performance C++ encoding/decoding library for FAST " + "(FIX Adapted for STreaming) protocol" + ) + topics = ("fast", "fix", "fix-adapted-for-streaming", + "financial-information-exchange", "libraries", "cpp") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_sqlite3": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_sqlite3": False, + } + + short_paths = True + + @property + def _min_cppstd(self): + return "14" if Version(self.version) >= "1.2.2" else "98" + + @property + def _compilers_minimum_version(self): + if Version(self.version) >= "1.2.2": + return { + "gcc": "6", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.4", + "apple-clang": "5.1", + } + else: + return {} + + 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.75.0") + self.requires("tinyxml2/9.0.0") + if self.options.with_sqlite3: + self.requires("sqlite3/3.40.1") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_PACKAGES"] = False + tc.variables["BUILD_SQLITE3"] = self.options.with_sqlite3 + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "licence.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + mkdir(self, os.path.join(self.package_folder, self._new_mfast_config_dir)) + self._extract_fasttypegentarget_macro() + rmdir(self, os.path.join(self.package_folder, self._old_mfast_config_dir)) + rmdir(self, os.path.join(self.package_folder, "share")) + if self.options.shared: + rm(self, "*_static*" if self.settings.os == "Windows" else "*.a", os.path.join(self.package_folder, "lib")) + + # TODO: several CMake variables should also be emulated (casing issues): + # [ ] MFAST_INCLUDE_DIR - include directories for mFAST + # [ ] MFAST_LIBRARY_DIRS - library directories for mFAST + # [ ] MFAST_LIBRARIES - libraries to link against + # [ ] MFAST_COMPONENTS - installed components + # [ ] MFAST__LIBRARY - particular component library + # [x] MFAST_EXECUTABLE - the fast_type_gen executable => done in _prepend_exec_target_in_fasttypegentarget() + self._prepend_exec_target_in_fasttypegentarget() + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._lib_targets_module_file), + {values["target"]:"mFAST::{}".format(values["target"]) for values in self._mfast_lib_components.values()} + ) + + @property + def _new_mfast_config_dir(self): + return os.path.join("lib", "cmake") + + @property + def _old_mfast_config_dir(self): + return "CMake" if self.settings.os == "Windows" else os.path.join("lib", "cmake", "mFAST") + + @property + def _fast_type_gen_target_file(self): + return os.path.join(self._new_mfast_config_dir, "FastTypeGenTarget.cmake") + + def _extract_fasttypegentarget_macro(self): + if Version(self.version) < "1.2.2": + config_file_content = load(self, os.path.join(self.package_folder, self._old_mfast_config_dir, "mFASTConfig.cmake")) + begin = config_file_content.find("macro(FASTTYPEGEN_TARGET Name)") + end = config_file_content.find("endmacro()", begin) + len("endmacro()") + macro_str = config_file_content[begin:end] + save(self, os.path.join(self.package_folder, self._fast_type_gen_target_file), macro_str) + else: + rename(self, os.path.join(self.package_folder, self._old_mfast_config_dir, "FastTypeGenTarget.cmake"), + os.path.join(self.package_folder, self._fast_type_gen_target_file)) + + def _prepend_exec_target_in_fasttypegentarget(self): + extension = ".exe" if self.settings.os == "Windows" else "" + fast_type_filename = "fast_type_gen" + extension + module_folder_depth = len(os.path.normpath(self._new_mfast_config_dir).split(os.path.sep)) + fast_type_rel_path = "{}bin/{}".format("".join(["../"] * module_folder_depth), fast_type_filename) + exec_target_content = textwrap.dedent("""\ + if(NOT TARGET fast_type_gen) + if(CMAKE_CROSSCOMPILING) + find_program(MFAST_EXECUTABLE fast_type_gen PATHS ENV PATH NO_DEFAULT_PATH) + endif() + if(NOT MFAST_EXECUTABLE) + get_filename_component(MFAST_EXECUTABLE "${{CMAKE_CURRENT_LIST_DIR}}/{fast_type_rel_path}" ABSOLUTE) + endif() + add_executable(fast_type_gen IMPORTED) + set_property(TARGET fast_type_gen PROPERTY IMPORTED_LOCATION ${{MFAST_EXECUTABLE}}) + endif() + """.format(fast_type_rel_path=fast_type_rel_path)) + module_abs_path = os.path.join(self.package_folder, self._fast_type_gen_target_file) + old_content = load(self, module_abs_path) + new_content = exec_target_content + old_content + save(self, module_abs_path, new_content) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _lib_targets_module_file(self): + return os.path.join(self._new_mfast_config_dir, f"conan-official-{self.name}-targets.cmake") + + @property + def _mfast_lib_components(self): + target_suffix = "_static" if not self.options.shared else "" + lib_suffix = "_static" if self.settings.os == "Windows" and not self.options.shared else "" + components = { + "libmfast": { + "comp": "mfast", + "target": "mfast" + target_suffix, + "lib": "mfast" + lib_suffix, + "requires": ["boost::headers"], + }, + "mfast_coder": { + "comp": "mfast_coder", + "target": "mfast_coder" + target_suffix, + "lib": "mfast_coder" + lib_suffix, + "requires": ["libmfast", "boost::headers"], + }, + "mfast_xml_parser": { + "comp": "mfast_xml_parser", + "target": "mfast_xml_parser" + target_suffix, + "lib": "mfast_xml_parser" + lib_suffix, + "requires": ["libmfast", "boost::headers", "tinyxml2::tinyxml2"], + }, + "mfast_json": { + "comp": "mfast_json", + "target": "mfast_json" + target_suffix, + "lib": "mfast_json" + lib_suffix, + "requires": ["libmfast", "boost::headers"], + }, + } + if self.options.with_sqlite3: + components.update({ + "mfast_sqlite3": { + "comp": "mfast_sqlite3", + "target": "mfast_sqlite3" + target_suffix, + "lib": "mfast_sqlite3" + lib_suffix, + "requires": ["libmfast", "boost::headers", "sqlite3::sqlite3"], + }, + }) + return components + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mFAST") + self.cpp_info.set_property("cmake_build_modules", [self._fast_type_gen_target_file]) + + for conan_comp, values in self._mfast_lib_components.items(): + target = values["target"] + comp = values["comp"] + lib = values["lib"] + requires = values["requires"] + self.cpp_info.components[conan_comp].set_property("cmake_target_name", target) + if comp != target: + # Also provide alias component for find_package(mFAST COMPONENTS ...) if static + self.cpp_info.components[conan_comp].set_property("cmake_target_aliases", [comp]) + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components[conan_comp].system_libs.append("m") + self.cpp_info.components[conan_comp].libs = [lib] + self.cpp_info.components[conan_comp].requires = requires + if self.options.shared: + self.cpp_info.components[conan_comp].defines = ["MFAST_DYN_LINK"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[conan_comp].names["cmake_find_package"] = target + self.cpp_info.components[conan_comp].names["cmake_find_package_multi"] = target + self.cpp_info.components[conan_comp].build_modules["cmake"] = [self._fast_type_gen_target_file] + build_modules = [self._lib_targets_module_file, self._fast_type_gen_target_file] + self.cpp_info.components[conan_comp].build_modules["cmake_find_package"] = build_modules + self.cpp_info.components[conan_comp].build_modules["cmake_find_package_multi"] = build_modules + if comp != target: + conan_comp_alias = conan_comp + "_alias" + self.cpp_info.components[conan_comp_alias].names["cmake_find_package"] = comp + self.cpp_info.components[conan_comp_alias].names["cmake_find_package_multi"] = comp + self.cpp_info.components[conan_comp_alias].requires = [conan_comp] + self.cpp_info.components[conan_comp_alias].includedirs = [] + self.cpp_info.components[conan_comp_alias].libdirs = [] + self.cpp_info.components[conan_comp_alias].bindirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "mFAST" + self.cpp_info.names["cmake_find_package_multi"] = "mFAST" diff --git a/recipes/mfast/all/patches/0001-fix-cmake-1.2.1.patch b/recipes/mfast/all/patches/0001-fix-cmake-1.2.1.patch new file mode 100644 index 0000000000000..0d5ca77fffb24 --- /dev/null +++ b/recipes/mfast/all/patches/0001-fix-cmake-1.2.1.patch @@ -0,0 +1,196 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,9 +69,11 @@ include_directories ("${PROJECT_BINARY_DIR}" + ## Setting up Boost Library + ################################ + +-find_package( Boost 1.53.0 REQUIRED unit_test_framework system filesystem) +-include_directories(${Boost_INCLUDE_DIR}) +-link_directories(${Boost_LIBRARY_DIRS}) ++find_package(Boost REQUIRED system filesystem) ++find_package(tinyxml2 REQUIRED CONFIG) ++if(BUILD_SQLITE3) ++ find_package(SQLite3 REQUIRED) ++endif() + + ################################################################################ + +@@ -95,7 +97,6 @@ set(MFAST_LIBRARY CACHE INTERNAL "") + + # 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) + + + ############################################################################ +@@ -174,9 +175,7 @@ endmacro() + # Recurse into the "src" and "unit-tests" subdirectories. This does not actually + # cause another cmake executable to run. The same process will walk through + # the project's entire directory structure. +-enable_testing() + +-add_subdirectory (tests) + + if (BUILD_SHARED_LIBS) + set(MFAST_LIBRARIES mfast_coder mfast_xml_parser mfast) +@@ -185,7 +184,6 @@ else() + set(MFAST_LIBRARIES mfast_coder_static mfast_xml_parser_static mfast_static) + endif() + +-add_subdirectory (examples) + + + # Setting up dist target +--- a/src/fast_type_gen/CMakeLists.txt ++++ b/src/fast_type_gen/CMakeLists.txt +@@ -11,9 +11,10 @@ add_executable (fast_type_gen + target_link_libraries (fast_type_gen + mfast_xml_parser_static + mfast_static +- ${Boost_SYSTEM_LIBRARY} +- ${Boost_FILESYSTEM_LIBRARY}) ++ Boost::headers ++ Boost::system ++ Boost::filesystem) + + install(TARGETS fast_type_gen + EXPORT mFASTTargets +- RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin) +\ No newline at end of file ++ DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin) +\ No newline at end of file +--- a/src/mfast/CMakeLists.txt ++++ b/src/mfast/CMakeLists.txt +@@ -10,6 +10,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_SRCS ${sources} ${instruction_sources} ${headers} ${instruction_headers}) + + add_library(mfast_static STATIC ${mfast_SRCS}) ++target_link_libraries(mfast_static Boost::headers) + + + if (UNIX) +@@ -25,6 +26,7 @@ install(TARGETS mfast_static + + if (BUILD_SHARED_LIBS) + add_library(mfast SHARED ${mfast_SRCS}) ++ target_link_libraries(mfast Boost::headers) + # the add_dependencies is necessary for CMake 2.6.4. Otherwise, the shared + # library would be built before the static library, and the shared library + # would be deleted when the static library is built. For CMake 2.8.x, there +@@ -38,6 +40,7 @@ if (BUILD_SHARED_LIBS) + install(TARGETS mfast + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + SET(MFAST_LIBRARY mfast CACHE INTERNAL "mFast Library name") +--- a/src/mfast/coder/CMakeLists.txt ++++ b/src/mfast/coder/CMakeLists.txt +@@ -9,6 +9,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_coder_SRCS ${sources} ${headers}) + + add_library(mfast_coder_static STATIC ${mfast_coder_SRCS}) ++target_link_libraries(mfast_coder_static mfast_static Boost::headers) + + if (UNIX) + set_target_properties(mfast_coder_static PROPERTIES OUTPUT_NAME mfast_coder) +@@ -32,13 +33,14 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_coder PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_coder mfast) ++ target_link_libraries(mfast_coder mfast Boost::headers) + set_target_properties(mfast_coder PROPERTIES COMPILE_FLAGS -DMFAST_DYN_LINK) + + + install(TARGETS mfast_coder + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + SET(MFAST_DYNAMIC_COMPONENTS ${MFAST_DYNAMIC_COMPONENTS} coder CACHE INTERNAL "") +--- a/src/mfast/json/CMakeLists.txt ++++ b/src/mfast/json/CMakeLists.txt +@@ -9,6 +9,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_json_SRCS ${sources} ${headers}) + + add_library(mfast_json_static STATIC ${mfast_json_SRCS}) ++target_link_libraries(mfast_json_static mfast_static Boost::headers) + + if (UNIX) + set_target_properties(mfast_json_static PROPERTIES OUTPUT_NAME mfast_json) +@@ -32,12 +33,13 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_json PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_json mfast) ++ target_link_libraries(mfast_json mfast Boost::headers) + set_target_properties(mfast_json PROPERTIES COMPILE_FLAGS -DMFAST_DYN_LINK) + + install(TARGETS mfast_json + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + SET(MFAST_DYNAMIC_COMPONENTS ${MFAST_DYNAMIC_COMPONENTS} json CACHE INTERNAL "") +--- a/src/mfast/sqlite3/CMakeLists.txt ++++ b/src/mfast/sqlite3/CMakeLists.txt +@@ -6,6 +6,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_sqlite3_SRCS ${sources} ${headers}) + + add_library(mfast_sqlite3_static STATIC ${mfast_sqlite3_SRCS}) ++target_link_libraries(mfast_sqlite3_static mfast_static Boost::headers SQLite::SQLite3) + + if (UNIX) + set_target_properties(mfast_sqlite3_static PROPERTIES OUTPUT_NAME mfast_sqlite3) +@@ -30,13 +31,14 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_sqlite3 PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_sqlite3 mfast sqlite3) ++ target_link_libraries(mfast_sqlite3 mfast Boost::headers SQLite::SQLite3) + set_target_properties(mfast_sqlite3 PROPERTIES COMPILE_FLAGS -DMFAST_DYN_LINK) + + + install(TARGETS mfast_sqlite3 + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + OPTIONAL) + +--- a/src/mfast/xml_parser/CMakeLists.txt ++++ b/src/mfast/xml_parser/CMakeLists.txt +@@ -6,11 +6,11 @@ file (GLOB_RECURSE sources "*.cpp") ## retrieve all source files in current + + SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + +-include_directories("${CMAKE_SOURCE_DIR}/tinyxml2") + +-set(mfast_xml_parser_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../../../tinyxml2/tinyxml2.cpp ${sources} ${headers}) ++set(mfast_xml_parser_SRCS ${sources} ${headers}) + + add_library(mfast_xml_parser_static STATIC ${mfast_xml_parser_SRCS}) ++target_link_libraries(mfast_xml_parser_static mfast_static Boost::headers tinyxml2::tinyxml2) + + if (UNIX) + set_target_properties(mfast_xml_parser_static PROPERTIES OUTPUT_NAME mfast_xml_parser) +@@ -34,13 +34,14 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_xml_parser PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_xml_parser mfast) ++ target_link_libraries(mfast_xml_parser mfast Boost::headers tinyxml2::tinyxml2) + set_target_properties(mfast_xml_parser PROPERTIES COMPILE_FLAGS -DMFAST_DYN_LINK) + + + install(TARGETS mfast_xml_parser + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + SET(MFAST_DYNAMIC_COMPONENTS ${MFAST_DYNAMIC_COMPONENTS} coder CACHE INTERNAL "") diff --git a/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch b/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch new file mode 100644 index 0000000000000..5a64dc0bef36a --- /dev/null +++ b/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch @@ -0,0 +1,194 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,9 +60,11 @@ if(BUILD_PACKAGES) + + endif(BUILD_PACKAGES) + +-find_package(Boost 1.56.0 REQUIRED) +-include_directories(${Boost_INCLUDE_DIR}) +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2) ++find_package(Boost REQUIRED) ++find_package(tinyxml2 REQUIRED CONFIG) ++if(BUILD_SQLITE3) ++ find_package(SQLite3 REQUIRED) ++endif() + include_directories ("${PROJECT_SOURCE_DIR}/src") + + add_definitions(-DSIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}) +@@ -73,7 +75,6 @@ set(MFAST_STATIC_LIBRARIES CACHE INTERNAL "") + set(MFAST_DYNAMIC_COMPONENTS CACHE INTERNAL "") + set(MFAST_STATIC_COMPONENTS CACHE INTERNAL "") + +-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + add_subdirectory (src) + include(FastTypeGenTarget) +--- a/src/fast_type_gen/CMakeLists.txt ++++ b/src/fast_type_gen/CMakeLists.txt +@@ -1,5 +1,5 @@ + +-if (NOT CMAKE_CROSSCOMPILING) ++if (1) + set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) + add_executable (fast_type_gen + fast_type_gen.cpp +@@ -11,13 +11,14 @@ if (NOT CMAKE_CROSSCOMPILING) + target_link_libraries (fast_type_gen + mfast_xml_parser_static + mfast_static ++ Boost::headers + mfast_coder_static) + + set_target_properties(fast_type_gen PROPERTIES VERSION "${MFAST_VERSION}") + + install(TARGETS fast_type_gen + EXPORT mFASTTargets +- RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin) ++ DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin) + add_custom_target(install.fast_type_gen + COMMAND ${CMAKE_COMMAND} -DBUILD_TYPE=${CMAKE_BUILD_TYPE} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake + DEPENDS fast_type_gen) +--- a/src/mfast/CMakeLists.txt ++++ b/src/mfast/CMakeLists.txt +@@ -11,6 +11,7 @@ set(mfast_SRCS ${sources} ${instruction_sources} ${headers} ${instruction_heade + + add_library(mfast_static STATIC ${mfast_SRCS}) + target_include_directories(mfast_static PUBLIC $) ++target_link_libraries(mfast_static Boost::headers) + + if (UNIX) + set_target_properties(mfast_static PROPERTIES OUTPUT_NAME mfast) +@@ -27,6 +28,7 @@ set(MFAST_STATIC_LIBRARIES ${MFAST_STATIC_LIBRARIES} mfast_static CACHE INTERNAL + + if (BUILD_SHARED_LIBS) + add_library(mfast SHARED ${mfast_SRCS}) ++ target_link_libraries(mfast Boost::headers) + + if (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.12") + target_compile_definitions(mfast INTERFACE "-DMFAST_DYN_LINK") +@@ -42,6 +44,7 @@ if (BUILD_SHARED_LIBS) + install(TARGETS mfast + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + set(MFAST_SHARED_LIBRARIES ${MFAST_SHARED_LIBRARIES} mfast CACHE INTERNAL "") +--- a/src/mfast/coder/CMakeLists.txt ++++ b/src/mfast/coder/CMakeLists.txt +@@ -18,7 +18,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_coder_SRCS ${sources} ${headers}) + + add_library(mfast_coder_static STATIC ${mfast_coder_SRCS}) +-target_link_libraries(mfast_coder_static mfast_static) ++target_link_libraries(mfast_coder_static mfast_static Boost::headers) + + if (UNIX) + set_target_properties(mfast_coder_static PROPERTIES OUTPUT_NAME mfast_coder) +@@ -44,7 +44,7 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_coder PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_coder mfast) ++ target_link_libraries(mfast_coder mfast Boost::headers) + set_target_properties(mfast_coder PROPERTIES + VERSION "${MFAST_VERSION}" + SOVERSION "${MFAST_SOVERSION}") +@@ -55,6 +55,7 @@ if (BUILD_SHARED_LIBS) + install(TARGETS mfast_coder + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + set(MFAST_SHARED_LIBRARIES ${MFAST_SHARED_LIBRARIES} mfast_coder CACHE INTERNAL "") +--- a/src/mfast/json/CMakeLists.txt ++++ b/src/mfast/json/CMakeLists.txt +@@ -9,7 +9,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_json_SRCS ${sources} ${headers}) + + add_library(mfast_json_static STATIC ${mfast_json_SRCS}) +-target_link_libraries(mfast_json_static mfast_static) ++target_link_libraries(mfast_json_static mfast_static Boost::headers) + + if (UNIX) + set_target_properties(mfast_json_static PROPERTIES OUTPUT_NAME mfast_json) +@@ -35,7 +35,7 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_json PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_json mfast) ++ target_link_libraries(mfast_json mfast Boost::headers) + set_target_properties(mfast_json PROPERTIES + VERSION "${MFAST_VERSION}" + SOVERSION "${MFAST_SOVERSION}") +@@ -46,6 +46,7 @@ if (BUILD_SHARED_LIBS) + install(TARGETS mfast_json + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + set(MFAST_SHARED_LIBRARIES ${MFAST_SHARED_LIBRARIES} mfast_json CACHE INTERNAL "") +--- a/src/mfast/sqlite3/CMakeLists.txt ++++ b/src/mfast/sqlite3/CMakeLists.txt +@@ -6,7 +6,7 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + set(mfast_sqlite3_SRCS ${sources} ${headers}) + + add_library(mfast_sqlite3_static STATIC ${mfast_sqlite3_SRCS}) +-target_link_libraries(mfast_sqlite3_static mfast_static) ++target_link_libraries(mfast_sqlite3_static mfast_static Boost::headers SQLite::SQLite3) + + if (UNIX) + set_target_properties(mfast_sqlite3_static PROPERTIES OUTPUT_NAME mfast_sqlite3) +@@ -33,7 +33,7 @@ if (BUILD_SHARED_LIBS) + if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(mfast_sqlite3 PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() +- target_link_libraries(mfast_sqlite3 mfast sqlite3) ++ target_link_libraries(mfast_sqlite3 mfast Boost::headers SQLite::SQLite3) + set_target_properties(mfast_sqlite3 PROPERTIES + VERSION "${MFAST_VERSION}" + SOVERSION "${MFAST_SOVERSION}") +@@ -44,6 +44,7 @@ if (BUILD_SHARED_LIBS) + install(TARGETS mfast_sqlite3 + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + OPTIONAL) + +--- a/src/mfast/xml_parser/CMakeLists.txt ++++ b/src/mfast/xml_parser/CMakeLists.txt +@@ -6,12 +6,11 @@ file (GLOB_RECURSE sources "*.cpp") ## retrieve all source files in current + + set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + +-include_directories("${CMAKE_SOURCE_DIR}/tinyxml2") + +-set(mfast_xml_parser_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../../../tinyxml2/tinyxml2.cpp ${sources} ${headers}) ++set(mfast_xml_parser_SRCS ${sources} ${headers}) + + add_library(mfast_xml_parser_static STATIC ${mfast_xml_parser_SRCS}) +-target_link_libraries(mfast_xml_parser_static mfast_static) ++target_link_libraries(mfast_xml_parser_static mfast_static Boost::headers tinyxml2::tinyxml2) + + if (UNIX) + set_target_properties(mfast_xml_parser_static PROPERTIES OUTPUT_NAME mfast_xml_parser) +@@ -39,7 +38,7 @@ if (BUILD_SHARED_LIBS) + set_target_properties(mfast_xml_parser PROPERTIES COMPILE_FLAGS -fvisibility=hidden) + endif() + +- target_link_libraries(mfast_xml_parser mfast) ++ target_link_libraries(mfast_xml_parser mfast Boost::headers tinyxml2::tinyxml2) + set_target_properties(mfast_xml_parser PROPERTIES + LINKER_LANGUAGE CXX + VERSION "${MFAST_VERSION}" +@@ -51,6 +50,7 @@ if (BUILD_SHARED_LIBS) + install(TARGETS mfast_xml_parser + EXPORT mFASTTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) + + set(MFAST_SHARED_LIBRARIES ${MFAST_SHARED_LIBRARIES} mfast_xml_parser CACHE INTERNAL "") diff --git a/recipes/mfast/all/patches/0002-remove-deprecated-boost-detail-endian.patch b/recipes/mfast/all/patches/0002-remove-deprecated-boost-detail-endian.patch new file mode 100644 index 0000000000000..d338b88c258bd --- /dev/null +++ b/recipes/mfast/all/patches/0002-remove-deprecated-boost-detail-endian.patch @@ -0,0 +1,40 @@ +diff --git a/src/mfast/coder/encoder/encoder_presence_map.h b/src/mfast/coder/encoder/encoder_presence_map.h +index aca12a2..2a63516 100644 +--- a/src/mfast/coder/encoder/encoder_presence_map.h ++++ b/src/mfast/coder/encoder/encoder_presence_map.h +@@ -19,7 +19,7 @@ + #ifndef ENCODER_PRESENCE_MAP_H_MQSBLA37 + #define ENCODER_PRESENCE_MAP_H_MQSBLA37 + +-#include ++#include + #include "fast_ostream.h" + + +@@ -70,7 +70,7 @@ namespace mfast + nbytes_ = 0; + value_ = 0; + +-#ifdef BOOST_BIG_ENDIAN ++#if BOOST_ENDIAN_BIG_BYTE + mask_ = 0x80ULL << 56; + #else + mask_ = 0x80ULL; +@@ -80,7 +80,7 @@ namespace mfast + inline void + encoder_presence_map::commit() + { +-#ifdef BOOST_BIG_ENDIAN ++#if BOOST_ENDIAN_BIG_BYTE + const uint64_t stop_bit_mask = (0x8000000000000000ULL >> (nbytes_ * 8)); + #else + const uint64_t stop_bit_mask = (0x80ULL << (nbytes_ * 8)); +@@ -94,7 +94,7 @@ namespace mfast + encoder_presence_map::set_next_bit(bool v) + { + if ( (mask_ & 0x0101010101010101ULL) != 0) { +-#ifdef BOOST_BIG_ENDIAN ++#if BOOST_ENDIAN_BIG_BYTE + mask_ >>= 2; + #else + mask_ <<= 14; diff --git a/recipes/mfast/all/patches/0003-mfast-sqlite3.patch b/recipes/mfast/all/patches/0003-mfast-sqlite3.patch new file mode 100644 index 0000000000000..3b18dcad401c7 --- /dev/null +++ b/recipes/mfast/all/patches/0003-mfast-sqlite3.patch @@ -0,0 +1,22 @@ +--- a/src/mfast/sqlite3/aggregate_inserter.cpp ++++ b/src/mfast/sqlite3/aggregate_inserter.cpp +@@ -35,7 +35,7 @@ namespace mfast + if (primary_key.present()) + return primary_key; + else { +- static const int64_field_instruction rowid_instruction(0,operator_none,presence_optional,0,"","",0, int_value_storage()); ++ static const int64_field_instruction rowid_instruction(operator_none,presence_optional,0,"","",0, int_value_storage()); + field_cref rowid_cref(&this->storage_, &rowid_instruction); + this->storage_.set(rowid); + this->storage_.present(true); +--- a/src/mfast/sqlite3/third_pass_visitor.cpp ++++ b/src/mfast/sqlite3/third_pass_visitor.cpp +@@ -12,7 +12,7 @@ namespace mfast + + if (primary_key_.absent()) { + // the table has no primary key, use the last rowid instead +- static const int64_field_instruction rowid_instruction(0,operator_none,presence_optional,0,"","",0, int_value_storage()); ++ static const int64_field_instruction rowid_instruction(operator_none,presence_optional,0,"","",0, int_value_storage()); + + field_cref rowid_cref(&this->key_storage_, &rowid_instruction); + this->key_storage_.set(rowid); diff --git a/recipes/mfast/all/test_package/CMakeLists.txt b/recipes/mfast/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f00b094711581 --- /dev/null +++ b/recipes/mfast/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mFAST REQUIRED mfast_xml_parser CONFIG) + +FASTTYPEGEN_TARGET(Test Test.xml) +add_executable(${PROJECT_NAME} ${FASTTYPEGEN_Test_OUTPUTS} message_printer.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET mfast_xml_parser_static) + target_link_libraries(${PROJECT_NAME} PRIVATE mfast_xml_parser_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE mfast_xml_parser) +endif() diff --git a/recipes/mfast/all/test_package/Test.xml b/recipes/mfast/all/test_package/Test.xml new file mode 100644 index 0000000000000..dcf8661cc502f --- /dev/null +++ b/recipes/mfast/all/test_package/Test.xml @@ -0,0 +1,8 @@ + + + + diff --git a/recipes/mfast/all/test_package/conanfile.py b/recipes/mfast/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fecd6e83f0b2f --- /dev/null +++ b/recipes/mfast/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps" + test_type = "explicit" + + 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) + + def generate(self): + VirtualRunEnv(self).generate() + if hasattr(self, "settings_build") and cross_building(self): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mfast/all/test_package/message_printer.cpp b/recipes/mfast/all/test_package/message_printer.cpp new file mode 100644 index 0000000000000..46af941f34006 --- /dev/null +++ b/recipes/mfast/all/test_package/message_printer.cpp @@ -0,0 +1,9 @@ +#include +#include "Test.h" + +int main() +{ + Test::Test message; + Test::Test_mref ref = message.ref(); + std:: cout << ref.get_String().c_str() << "\n"; +} diff --git a/recipes/mfast/all/test_v1_package/CMakeLists.txt b/recipes/mfast/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mfast/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mfast/all/test_v1_package/conanfile.py b/recipes/mfast/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e08462ea1a998 --- /dev/null +++ b/recipes/mfast/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +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", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mfast/config.yml b/recipes/mfast/config.yml new file mode 100644 index 0000000000000..af216ac4b02b7 --- /dev/null +++ b/recipes/mfast/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.2": + folder: all + "1.2.1": + folder: all diff --git a/recipes/mgs/all/conandata.yml b/recipes/mgs/all/conandata.yml new file mode 100644 index 0000000000000..803396c03189b --- /dev/null +++ b/recipes/mgs/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.2.1": + url: "https://github.com/theodelrieu/mgs/releases/download/v0.2.1/mgs.zip" + sha256: "da4a74d1cdaeb6c32c2097bcbebe21ba912ad84176a89014ac8232885d76bcc7" + "0.2.0": + url: "https://github.com/theodelrieu/mgs/releases/download/v0.2.0/mgs.zip" + sha256: "aa057a4096da9451bef1950a3e784350df590f09f6bad0c0ca59ed1874df4a36" + "0.1.5": + url: "https://github.com/theodelrieu/mgs/releases/download/v0.1.5/mgs.zip" + sha256: "ca00e5d26be18beac9874270c17bddbc4f96cad6d92aab685c9eb4be0e6d7fc7" + "0.1.4": + url: "https://github.com/theodelrieu/mgs/releases/download/v0.1.4/mgs.zip" + sha256: "e247976860a0c8d237caaf62a918627f59d4f8a5b5bb811ab01e7cbecf31d4ce" + "0.1.2": + url: "https://github.com/theodelrieu/mgs/releases/download/v0.1.2/mgs.zip" + sha256: "aba95870eafad95147c969c167a0e7c09b2c749ccafadbdd477de815e3e5bfd3" diff --git a/recipes/mgs/all/conanfile.py b/recipes/mgs/all/conanfile.py new file mode 100644 index 0000000000000..a1fe1d56d19c7 --- /dev/null +++ b/recipes/mgs/all/conanfile.py @@ -0,0 +1,123 @@ +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.53.0" + + +class MgsConan(ConanFile): + name = "mgs" + description = "C++14 codec library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://theodelrieu.github.io/mgs-docs" + topics = ("codec", "base64", "base32", "base16", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.4", + "apple-clang": "3.4", + } + + 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 fully support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mgs") + + self.cpp_info.components["mgs-config"].set_property("cmake_target_name", "mgs::config") + + self.cpp_info.components["mgs-meta"].set_property("cmake_target_name", "mgs::meta") + self.cpp_info.components["mgs-meta"].requires = ["mgs-config"] + + self.cpp_info.components["mgs-exceptions"].set_property("cmake_target_name", "mgs::exceptions") + self.cpp_info.components["mgs-exceptions"].requires = ["mgs-config"] + + self.cpp_info.components["mgs-codecs"].set_property("cmake_target_name", "mgs::codecs") + self.cpp_info.components["mgs-codecs"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions"] + + self.cpp_info.components["mgs-base_n"].set_property("cmake_target_name", "mgs::base_n") + self.cpp_info.components["mgs-base_n"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions", "mgs-codecs"] + + self.cpp_info.components["mgs-base16"].set_property("cmake_target_name", "mgs::base16") + self.cpp_info.components["mgs-base16"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions", "mgs-codecs", "mgs-base_n"] + + self.cpp_info.components["mgs-base32"].set_property("cmake_target_name", "mgs::base32") + self.cpp_info.components["mgs-base32"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions", "mgs-codecs", "mgs-base_n"] + + self.cpp_info.components["mgs-base64"].set_property("cmake_target_name", "mgs::base64") + self.cpp_info.components["mgs-base64"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions", "mgs-codecs", "mgs-base_n"] + + self.cpp_info.components["mgs-base64url"].set_property("cmake_target_name", "mgs::base64url") + self.cpp_info.components["mgs-base64url"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions", "mgs-codecs", "mgs-base_n"] + + self.cpp_info.components["mgs-base32hex"].set_property("cmake_target_name", "mgs::base32hex") + self.cpp_info.components["mgs-base32hex"].requires = ["mgs-config", "mgs-meta", "mgs-exceptions", "mgs-codecs", "mgs-base_n"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "mgs" + self.cpp_info.names["cmake_find_package_multi"] = "mgs" + + self.cpp_info.components["mgs-config"].names["cmake_find_package"] = "config" + self.cpp_info.components["mgs-config"].names["cmake_find_package_multi"] = "config" + + self.cpp_info.components["mgs-meta"].names["cmake_find_package"] = "meta" + self.cpp_info.components["mgs-meta"].names["cmake_find_package"] = "meta" + + self.cpp_info.components["mgs-exceptions"].names["cmake_find_package"] = "exceptions" + self.cpp_info.components["mgs-exceptions"].names["cmake_find_package_multi"] = "exceptions" + + self.cpp_info.components["mgs-codecs"].names["cmake_find_package"] = "codecs" + self.cpp_info.components["mgs-codecs"].names["cmake_find_package_multi"] = "codecs" + + self.cpp_info.components["mgs-base_n"].names["cmake_find_package"] = "base_n" + self.cpp_info.components["mgs-base_n"].names["cmake_find_package_multi"] = "base_n" + + self.cpp_info.components["mgs-base16"].names["cmake_find_package"] = "base16" + self.cpp_info.components["mgs-base16"].names["cmake_find_package_multi"] = "base16" + + self.cpp_info.components["mgs-base32"].names["cmake_find_package"] = "base32" + self.cpp_info.components["mgs-base32"].names["cmake_find_package_multi"] = "base32" + + self.cpp_info.components["mgs-base64"].names["cmake_find_package"] = "base64" + self.cpp_info.components["mgs-base64"].names["cmake_find_package_multi"] = "base64" + + self.cpp_info.components["mgs-base64url"].names["cmake_find_package"] = "base64url" + self.cpp_info.components["mgs-base64url"].names["cmake_find_package_multi"] = "base64url" + + self.cpp_info.components["mgs-base32hex"].names["cmake_find_package"] = "base32hex" + self.cpp_info.components["mgs-base32hex"].names["cmake_find_package_multi"] = "base32hex" diff --git a/recipes/mgs/all/test_package/CMakeLists.txt b/recipes/mgs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f8ba640718db --- /dev/null +++ b/recipes/mgs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mgs REQUIRED base64 CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mgs::base64) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/mgs/all/test_package/conanfile.py b/recipes/mgs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/mgs/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/mgs/all/test_package/test_package.cpp b/recipes/mgs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..807d6025e030d --- /dev/null +++ b/recipes/mgs/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +#include + +int main() { + std::cout << mgs::base64::encode("Hello, World!") << std::endl; +} diff --git a/recipes/mgs/all/test_v1_package/CMakeLists.txt b/recipes/mgs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/mgs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mgs/all/test_v1_package/conanfile.py b/recipes/mgs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/mgs/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mgs/config.yml b/recipes/mgs/config.yml new file mode 100644 index 0000000000000..579a8f87004dc --- /dev/null +++ b/recipes/mgs/config.yml @@ -0,0 +1,11 @@ +versions: + "0.2.1": + folder: all + "0.2.0": + folder: all + "0.1.5": + folder: all + "0.1.4": + folder: all + "0.1.2": + folder: all diff --git a/recipes/microprofile/all/CMakeLists.txt b/recipes/microprofile/all/CMakeLists.txt new file mode 100644 index 0000000000000..ff45b79a8420c --- /dev/null +++ b/recipes/microprofile/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory("source_subfolder") diff --git a/recipes/microprofile/all/conandata.yml b/recipes/microprofile/all/conandata.yml new file mode 100644 index 0000000000000..6715d7fabbe05 --- /dev/null +++ b/recipes/microprofile/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "3.1": + - url: "https://github.com/jonasmr/microprofile/archive/refs/tags/v3.1.tar.gz" + sha256: "300e1d0d21e4c13ad1de72c5309ba02fbdb3bcbbe26e5ad9ff8b798380781527" + - url: "https://unlicense.org/UNLICENSE" + sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" +patches: + "3.1": + - patch_file: "patches/sources_fix.patch" + base_path: "source_subfolder" + - patch_file: "patches/cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/microprofile/all/conanfile.py b/recipes/microprofile/all/conanfile.py new file mode 100644 index 0000000000000..9f23e3872db58 --- /dev/null +++ b/recipes/microprofile/all/conanfile.py @@ -0,0 +1,203 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class MicroprofileConan(ConanFile): + name = "microprofile" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jonasmr/microprofile" + description = "Microprofile is a embeddable profiler in a few files, written in C++" + topics = ("profiler", "embedded", "timer") + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "microprofile_enabled": [True, False], + "with_miniz": [True, False], + "thread_buffer_size": "ANY", + "thread_gpu_buffer_size": "ANY", + "max_frame_history": "ANY", + "webserver_port": "ANY", + "webserver_maxframes": "ANY", + "webserver_socket_buffer_size": "ANY", + "gpu_frame_delay": "ANY", + "name_max_length": "ANY", + "max_timers": "ANY", + "max_threads": "ANY", + "max_string_length": "ANY", + "timeline_max_tokens": "ANY", + "thread_log_frames_reuse": "ANY", + "max_groups": "ANY", + "use_big_endian": [True, False], + "enable_gpu_timer_callbacks": [True, False], + "enable_timer": [None, "gl", "d3d11", "d3d12", "vulkan"] + } + default_options = { + "shared": False, + "fPIC": True, + "microprofile_enabled": True, + "with_miniz": False, + "thread_buffer_size": 2048 << 10, + "thread_gpu_buffer_size": 128 << 10, + "max_frame_history": 512, + "webserver_port": 1338, + "webserver_maxframes": 30, + "webserver_socket_buffer_size": 16 << 10, + "gpu_frame_delay": 5, + "name_max_length": 64, + "max_timers": 1024, + "max_threads": 32, + "max_string_length": 128, + "timeline_max_tokens": 64, + "thread_log_frames_reuse": 200, + "max_groups": 128, + "use_big_endian": False, + "enable_gpu_timer_callbacks": False, + "enable_timer": None + } + + _cmake = None + + @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 _validate_int_options(self): + positive_int_options = [ + "thread_buffer_size", + "thread_gpu_buffer_size", + "max_frame_history", + "webserver_port", + "webserver_maxframes", + "webserver_socket_buffer_size", + "gpu_frame_delay", + "name_max_length", + "max_timers", + "max_threads", + "max_string_length", + "timeline_max_tokens", + "thread_log_frames_reuse", + "max_groups" + ] + for opt in positive_int_options: + try: + value = int(getattr(self.options, opt)) + if value < 0: + raise ValueError + except ValueError: + raise ConanInvalidConfiguration("microprofile:{} must be a positive integer".format(opt)) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + if self.settings.os != "Windows" and self.options.enable_timer in ["d3d11", "d3d12"]: + raise ConanInvalidConfiguration("DirectX timers can only be used in Windows.") + if self.options.enable_timer and self.options.enable_gpu_timer_callbacks: + raise ConanInvalidConfiguration("Cannot mix GPU callbacks and GPU timers.") + + self._validate_int_options() + + if int(self.options.max_groups) % 32 != 0: + raise ConanInvalidConfiguration("microprofile:max_groups must be multiple of 32.") + if int(self.options.webserver_port) > 2 ** 16 - 1: + raise ConanInvalidConfiguration("microprofile:webserver_port must be between 0 and 65535.") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + if self.options.with_miniz: + self.requires("miniz/2.2.0") + if self.options.enable_timer == "gl": + self.requires("opengl/system") + if self.options.enable_timer == "vulkan": + self.requires("vulkan-loader/1.2.182") + + def source(self): + tools.get(**self.conan_data["sources"][self.version][0], strip_root=True, destination=self._source_subfolder) + tools.download(filename="LICENSE", **self.conan_data["sources"][self.version][1]) + + def build(self): + self._create_defines_file(os.path.join(self._source_subfolder, "microprofile.config.h")) + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["MP_MINIZ"] = self.options.with_miniz + self._cmake.definitions["MP_GPU_TIMERS_VULKAN"] = self.options.enable_timer == "vulkan" + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("LICENSE", dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def _create_defines(self): + return [ + "MICROPROFILE_EXPORT", + ("MICROPROFILE_ENABLED", ("1" if self.options.microprofile_enabled else "0")), + ("MICROPROFILE_DEBUG", ("1" if self.settings.build_type == "Debug" else "0")), + ("MICROPROFILE_MINIZ", ("1" if self.options.with_miniz else "0")), + ("MICROPROFILE_BIG_ENDIAN", ("1" if self.options.use_big_endian else "0")), + ("MICROPROFILE_GPU_TIMERS", ("1" if self.options.enable_timer else "0")), + ("MICROPROFILE_GPU_TIMER_CALLBACKS", ("1" if self.options.enable_gpu_timer_callbacks else "0")), + ("MICROPROFILE_GPU_TIMERS_GL", ("1" if self.options.enable_timer == "gl" else "0")), + ("MICROPROFILE_GPU_TIMERS_D3D11", ("1" if self.options.enable_timer == "d3d11" else "0")), + ("MICROPROFILE_GPU_TIMERS_D3D12", ("1" if self.options.enable_timer == "d3d12" else "0")), + ("MICROPROFILE_GPU_TIMERS_VULKAN", ("1" if self.options.enable_timer == "vulkan" else "0")), + ("MICROPROFILE_PER_THREAD_BUFFER_SIZE", str(self.options.thread_buffer_size)), + ("MICROPROFILE_PER_THREAD_GPU_BUFFER_SIZE", str(self.options.thread_gpu_buffer_size)), + ("MICROPROFILE_MAX_FRAME_HISTORY", str(self.options.max_frame_history)), + ("MICROPROFILE_WEBSERVER_PORT", str(self.options.webserver_port)), + ("MICROPROFILE_WEBSERVER_MAXFRAMES", str(self.options.webserver_maxframes)), + ("MICROPROFILE_WEBSERVER_SOCKET_BUFFER_SIZE", str(self.options.webserver_socket_buffer_size)), + ("MICROPROFILE_GPU_FRAME_DELAY", str(self.options.gpu_frame_delay)), + ("MICROPROFILE_NAME_MAX_LEN", str(self.options.name_max_length)), + ("MICROPROFILE_MAX_TIMERS", str(self.options.max_timers)), + ("MICROPROFILE_MAX_THREADS", str(self.options.max_threads)), + ("MICROPROFILE_MAX_STRING", str(self.options.max_string_length)), + ("MICROPROFILE_TIMELINE_MAX_TOKENS", str(self.options.timeline_max_tokens)), + ("MICROPROFILE_THREAD_LOG_FRAMES_REUSE", str(self.options.thread_log_frames_reuse)), + ("MICROPROFILE_MAX_GROUPS", str(self.options.max_groups)) + ] + + def _create_defines_file(self, filename): + defines = self._create_defines() + defines_list = ["#pragma once\n"] + for define in defines: + if isinstance(define, tuple) or isinstance(define, list): + defines_list.append("#define {} {}\n".format(define[0], define[1])) + else: + defines_list.append("#define {}\n".format(define)) + tools.save(filename, "".join(defines_list)) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.names["cmake_find_package"] = self.name + self.cpp_info.names["cmake_find_package_multi"] = self.name + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + elif self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] + self.cpp_info.defines.append("MICROPROFILE_USE_CONFIG") diff --git a/recipes/microprofile/all/patches/cmake.patch b/recipes/microprofile/all/patches/cmake.patch new file mode 100644 index 0000000000000..b92ba025b0a43 --- /dev/null +++ b/recipes/microprofile/all/patches/cmake.patch @@ -0,0 +1,67 @@ +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,64 @@ ++cmake_minimum_required(VERSION 3.4) ++project(microprofile) ++ ++option(MICROPROFILE_USE_CONFIG_FILE "Use user provided configuration in microprofile.config.h file." ON) ++ ++set(MICROPROFILE_EXPORT_FILENAME microprofile.export.h) ++set(MICROPROFILE_CONFIG_HEADER ${PROJECT_SOURCE_DIR}/microprofile.config.h) ++set(MICROPROFILE_PUBLIC_HEADERS ++ ${PROJECT_SOURCE_DIR}/microprofile.h ++ ${CMAKE_CURRENT_BINARY_DIR}/${MICROPROFILE_EXPORT_FILENAME} ++) ++ ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_package(Threads REQUIRED) ++ ++add_library(${PROJECT_NAME} microprofile.h microprofile.cpp) ++ ++include(GenerateExportHeader) ++generate_export_header(${PROJECT_NAME} ++ EXPORT_MACRO_NAME MICROPROFILE_API ++ EXPORT_FILE_NAME ${MICROPROFILE_EXPORT_FILENAME} ++) ++ ++target_include_directories(${PROJECT_NAME} PUBLIC ++ $ ++ $ ++ $ ++) ++ ++if (MICROPROFILE_USE_CONFIG_FILE) ++ target_compile_definitions(${PROJECT_NAME} PUBLIC MICROPROFILE_USE_CONFIG) ++endif() ++ ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) ++ ++target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) ++ ++if (WIN32) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32) ++endif() ++ ++if (MP_MINIZ) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::miniz) ++endif() ++ ++if (MP_GPU_TIMERS_VULKAN) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::vulkan-loader) ++endif() ++ ++set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${MICROPROFILE_PUBLIC_HEADERS}") ++ ++include(GNUInstallDirs) ++install(TARGETS ${PROJECT_NAME} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ++) ++if (MICROPROFILE_USE_CONFIG_FILE) ++ install(FILES ${MICROPROFILE_CONFIG_HEADER} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ++ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ++ ) ++endif() diff --git a/recipes/microprofile/all/patches/sources_fix.patch b/recipes/microprofile/all/patches/sources_fix.patch new file mode 100644 index 0000000000000..bf1a3fd85fae4 --- /dev/null +++ b/recipes/microprofile/all/patches/sources_fix.patch @@ -0,0 +1,135 @@ +--- a/microprofile.h ++++ b/microprofile.h +@@ -179,6 +179,7 @@ + #define MicroProfileGpuInitD3D11(pDevice,pDeviceContext) do{}while(0) + #define MicroProfileGpuShutdown() do{}while(0) + #define MicroProfileGpuInitGL() do{}while(0) ++#define MicroProfileInitGLCallbacks(cbs) do{}while(0) + #define MicroProfileSetCurrentNodeD3D12(nNode) do{}while(0) + #define MicroProfilePlatformMarkersGetEnabled() 0 + #define MicroProfilePlatformMarkersSetEnabled(bEnabled) do{}while(0) +@@ -192,9 +193,13 @@ + + #include + ++#ifdef MICROPROFILE_EXPORT ++#include "microprofile.export.h" ++#else + #ifndef MICROPROFILE_API + #define MICROPROFILE_API + #endif ++#endif + + #ifdef MICROPROFILE_PS4 + #include "microprofile_ps4.h" +@@ -481,6 +486,7 @@ + struct MicroProfile; + struct MicroProfileThreadLogGpu; + struct MicroProfileScopeStateC; ++struct MicroProfileGLCallbacks; + + #ifdef __cplusplus + extern "C" { +@@ -682,6 +688,7 @@ + #if MICROPROFILE_GPU_TIMERS_GL + #define MICROPROFILE_GL_MAX_QUERIES (8<<10) + MICROPROFILE_API void MicroProfileGpuInitGL(); ++MICROPROFILE_API void MicroProfileInitGLCallbacks(const MicroProfileGLCallbacks* cbs); + #endif + + +@@ -752,6 +759,16 @@ + } + } + }; ++ ++#include ++struct MicroProfileGLCallbacks ++{ ++ std::function genQueriesCb; ++ std::function deleteQueriesCb; ++ std::function queryCounterCb; ++ std::function getQueryObject64Cb; ++ std::function getInteger64Cb; ++}; + #endif //__cplusplus + #endif //enabled + +--- a/microprofile.cpp ++++ b/microprofile.cpp +@@ -952,6 +952,7 @@ + int GpuQueue; + MicroProfileThreadLogGpu* pGpuGlobal; + MicroProfileGpuTimerState* pGPU; ++ MicroProfileGLCallbacks glCallbacks; + + }; + +@@ -4835,6 +4836,7 @@ + } + + #if MICROPROFILE_MINIZ ++#include + #ifndef MICROPROFILE_COMPRESS_BUFFER_SIZE + #define MICROPROFILE_COMPRESS_BUFFER_SIZE (256<<10) + #endif +@@ -8711,29 +8713,37 @@ + vkQueueSubmit(S.pGPU->Queues[nGpu], 1, &SubmitInfo, Fence); + vkWaitForFences(Device, 1, &Fence, 1, (uint64_t)-1); + *pOutGpu = 0; +- vkGetQueryPoolResults(Device, S.pGPU->QueryPool[nGpu], MICROPROFILE_VULKAN_MAX_QUERIES, 1, 8, pOutGpu, 8, VK_QUERY_RESULT_64_BIT); ++ vkGetQueryPoolResults(Device, S.pGPU->QueryPool[nGpu], MICROPROFILE_VULKAN_MAX_QUERIES, 1, 8, pOutGpu, 8, VK_QUERY_RESULT_64_BIT); + *pOutCPU = MP_TICK(); + return 1; + } + #elif MICROPROFILE_GPU_TIMERS_GL ++#define GL_TIMESTAMP 0x8E28 ++#define GL_QUERY_RESULT 0x8866 ++ ++void MicroProfileInitGLCallbacks(const MicroProfileGLCallbacks* cbs) ++{ ++ S.glCallbacks = *cbs; ++} ++ + void MicroProfileGpuInitGL() + { + S.pGPU = MP_ALLOC_OBJECT(MicroProfileGpuTimerState); + S.pGPU->GLTimerPos = 0; +- glGenQueries(MICROPROFILE_GL_MAX_QUERIES, &S.pGPU->GLTimers[0]); ++ S.glCallbacks.genQueriesCb(MICROPROFILE_GL_MAX_QUERIES, &S.pGPU->GLTimers[0]); + } + + uint32_t MicroProfileGpuInsertTimeStamp(void* pContext) + { + uint32_t nIndex = (S.pGPU->GLTimerPos+1)%MICROPROFILE_GL_MAX_QUERIES; +- glQueryCounter(S.pGPU->GLTimers[nIndex], GL_TIMESTAMP); ++ S.glCallbacks.queryCounterCb(S.pGPU->GLTimers[nIndex], GL_TIMESTAMP); + S.pGPU->GLTimerPos = nIndex; + return nIndex; + } + uint64_t MicroProfileGpuGetTimeStamp(uint32_t nKey) + { + uint64_t result; +- glGetQueryObjectui64v(S.pGPU->GLTimers[nKey], GL_QUERY_RESULT, &result); ++ S.glCallbacks.getQueryObject64Cb(S.pGPU->GLTimers[nKey], GL_QUERY_RESULT, &result); + return result; + } + +@@ -8745,7 +8755,7 @@ + int MicroProfileGetGpuTickReference(int64_t* pOutCpu, int64_t* pOutGpu) + { + int64_t nGpuTimeStamp; +- glGetInteger64v(GL_TIMESTAMP, &nGpuTimeStamp); ++ S.glCallbacks.getInteger64Cb(GL_TIMESTAMP, &nGpuTimeStamp); + if(nGpuTimeStamp) + { + *pOutCpu = MP_TICK(); +@@ -8785,7 +8795,7 @@ + + void MicroProfileGpuShutdown() + { +- glDeleteQueries(MICROPROFILE_GL_MAX_QUERIES, &S.pGPU->GLTimers[0]); ++ S.glCallbacks.deleteQueriesCb(MICROPROFILE_GL_MAX_QUERIES, &S.pGPU->GLTimers[0]); + MP_FREE(S.pGPU); + } + diff --git a/recipes/microprofile/all/test_package/CMakeLists.txt b/recipes/microprofile/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed091dc6c1aee --- /dev/null +++ b/recipes/microprofile/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(microprofile REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} microprofile::microprofile) + +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/microprofile/all/test_package/conanfile.py b/recipes/microprofile/all/test_package/conanfile.py new file mode 100644 index 0000000000000..30f8c8cfb0975 --- /dev/null +++ b/recipes/microprofile/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class MicroprofileTestConan(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/microprofile/all/test_package/test_package.cpp b/recipes/microprofile/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2a13e33f9ca1d --- /dev/null +++ b/recipes/microprofile/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +int main() { +#if MICROPROFILE_ENABLED + MicroProfileInit(); + std::cout << "Microprofile successfully initialized." << std::endl; +#endif + std::cout << "Tick = " << MicroProfileTick() << std::endl; + return 0; +} diff --git a/recipes/microprofile/config.yml b/recipes/microprofile/config.yml new file mode 100644 index 0000000000000..992d10eb37c11 --- /dev/null +++ b/recipes/microprofile/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1": + folder: all diff --git a/recipes/microtar/all/CMakeLists.txt b/recipes/microtar/all/CMakeLists.txt new file mode 100644 index 0000000000000..ab2ce85f21a44 --- /dev/null +++ b/recipes/microtar/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) +project(microtar LANGUAGES C) + +include(GNUInstallDirs) + +add_library(microtar ${MICROTAR_SRC_DIR}/src/microtar.c) +set_target_properties(microtar PROPERTIES + PUBLIC_HEADER "${MICROTAR_SRC_DIR}/src/microtar.h" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +install( + TARGETS microtar + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/microtar/all/conandata.yml b/recipes/microtar/all/conandata.yml new file mode 100644 index 0000000000000..1661e9ce105e7 --- /dev/null +++ b/recipes/microtar/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/rxi/microtar/archive/refs/tags/v0.1.0.tar.gz" + sha256: "eb30a906d714c6547841d67f8d49739c56dd8a506fda4c61dd7d6f4da0a9d9aa" diff --git a/recipes/microtar/all/conanfile.py b/recipes/microtar/all/conanfile.py new file mode 100644 index 0000000000000..0cac3914af1fe --- /dev/null +++ b/recipes/microtar/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class MicrotarConan(ConanFile): + name = "microtar" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rxi/microtar" + description = "A lightweight tar library written in ANSI C" + topics = ("tar", "archive") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.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["MICROTAR_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 = ["microtar"] diff --git a/recipes/microtar/all/test_package/CMakeLists.txt b/recipes/microtar/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b1c35c594fadb --- /dev/null +++ b/recipes/microtar/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(microtar REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE microtar::microtar) diff --git a/recipes/microtar/all/test_package/conanfile.py b/recipes/microtar/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/microtar/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/microtar/all/test_package/test_package.c b/recipes/microtar/all/test_package/test_package.c new file mode 100644 index 0000000000000..769145bab7171 --- /dev/null +++ b/recipes/microtar/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +int main() +{ + mtar_t tar; + const char *str1 = "Hello world"; + const char *str2 = "Goodbye world"; + + /* Open archive for writing */ + mtar_open(&tar, "test.tar", "w"); + + /* Write strings to files `test1.txt` and `test2.txt` */ + mtar_write_file_header(&tar, "test1.txt", strlen(str1)); + mtar_write_data(&tar, str1, strlen(str1)); + mtar_write_file_header(&tar, "test2.txt", strlen(str2)); + mtar_write_data(&tar, str2, strlen(str2)); + + /* Finalize -- this needs to be the last thing done before closing */ + mtar_finalize(&tar); + + /* Close archive */ + mtar_close(&tar); +} diff --git a/recipes/microtar/all/test_v1_package/CMakeLists.txt b/recipes/microtar/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/microtar/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/microtar/all/test_v1_package/conanfile.py b/recipes/microtar/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/microtar/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/microtar/config.yml b/recipes/microtar/config.yml new file mode 100644 index 0000000000000..5e5e3d8a61814 --- /dev/null +++ b/recipes/microtar/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: "all" diff --git a/recipes/mikelankamp-fpm/all/conandata.yml b/recipes/mikelankamp-fpm/all/conandata.yml new file mode 100644 index 0000000000000..360fcf6413abc --- /dev/null +++ b/recipes/mikelankamp-fpm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/MikeLankamp/fpm/archive/refs/tags/v1.1.0.tar.gz" + sha256: "e34941b4cd1d1f1fbe9ecf39b740cb20b9c272a832f63be27fa24eddf400e51b" diff --git a/recipes/mikelankamp-fpm/all/conanfile.py b/recipes/mikelankamp-fpm/all/conanfile.py new file mode 100644 index 0000000000000..4f1037ea6348f --- /dev/null +++ b/recipes/mikelankamp-fpm/all/conanfile.py @@ -0,0 +1,56 @@ +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 MikeLankampFpmConan(ConanFile): + name = "mikelankamp-fpm" + description = "C++ header-only fixed-point math library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MikeLankamp/fpm" + topics = ("fixed-point", "math", "header-only") + 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=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", "fpm") + self.cpp_info.set_property("cmake_target_name", "fpm::fpm") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "fpm" + self.cpp_info.filenames["cmake_find_package_multi"] = "fpm" + self.cpp_info.names["cmake_find_package"] = "fpm" + self.cpp_info.names["cmake_find_package_multi"] = "fpm" diff --git a/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt b/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4b78d3f578ec0 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fpm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fpm::fpm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mikelankamp-fpm/all/test_package/conanfile.py b/recipes/mikelankamp-fpm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/mikelankamp-fpm/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mikelankamp-fpm/all/test_package/test_package.cpp b/recipes/mikelankamp-fpm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..207d30e1d5418 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + +#include + +int main() { + fpm::fixed_16_16 x {0.0}; + std::cout << "The cosine of " << x << " radians is: " << cos(x) << std::endl; + + return 0; +} diff --git a/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt b/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py b/recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mikelankamp-fpm/config.yml b/recipes/mikelankamp-fpm/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/mikelankamp-fpm/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/mikktspace/all/CMakeLists.txt b/recipes/mikktspace/all/CMakeLists.txt new file mode 100644 index 0000000000000..d8848832b7e30 --- /dev/null +++ b/recipes/mikktspace/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.4) +project(mikktspace LANGUAGES C) + +add_library(mikktspace ${MIKKTSPACE_SRC_DIR}/mikktspace.c) +target_include_directories(mikktspace PUBLIC ${MIKKTSPACE_SRC_DIR}) +set_target_properties(mikktspace PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(CheckFunctionExists) +check_function_exists(pow HAVE_MATH_SYSTEM) +if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(mikktspace PRIVATE m) +endif() + +include(GNUInstallDirs) +install(TARGETS mikktspace + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(FILES ${MIKKTSPACE_SRC_DIR}/mikktspace.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/mikktspace/all/conandata.yml b/recipes/mikktspace/all/conandata.yml new file mode 100644 index 0000000000000..d874ce5653095 --- /dev/null +++ b/recipes/mikktspace/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200325": + url: "https://github.com/mmikk/MikkTSpace/archive/3e895b49d05ea07e4c2133156cfa94369e19e409.tar.gz" + sha256: "aeba65ddee85a679133d510d71d00b108f603752f90b15b9ecf7777033f6e351" diff --git a/recipes/mikktspace/all/conanfile.py b/recipes/mikktspace/all/conanfile.py new file mode 100644 index 0000000000000..ebe053f1cb1f9 --- /dev/null +++ b/recipes/mikktspace/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, save +import os + +required_conan_version = ">=1.53.0" + + +class MikkTSpaceConan(ConanFile): + name = "mikktspace" + description = " A common standard for tangent space used in baking tools to produce normal maps." + homepage = "https://github.com/mmikk/MikkTSpace" + url = "https://github.com/conan-io/conan-center-index" + license = "Zlib" + topics = ("tangent", "space", "normal") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.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["MIKKTSPACE_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() + + @property + def _extracted_license(self): + content_lines = open(os.path.join(self.source_folder, "mikktspace.h")).readlines() + license_content = [] + for i in range(4, 21): + license_content.append(content_lines[i][4:-1]) + return "\n".join(license_content) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extracted_license) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["mikktspace"] + if not self.options.shared and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/mikktspace/all/test_package/CMakeLists.txt b/recipes/mikktspace/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e098a7e87ec40 --- /dev/null +++ b/recipes/mikktspace/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mikktspace REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.c) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE mikktspace::mikktspace) diff --git a/recipes/mikktspace/all/test_package/conanfile.py b/recipes/mikktspace/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mikktspace/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/mikktspace/all/test_package/test_package.c b/recipes/mikktspace/all/test_package/test_package.c new file mode 100644 index 0000000000000..b1fe82cf21c2a --- /dev/null +++ b/recipes/mikktspace/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include +#include + +static int GetNumFaces(const SMikkTSpaceContext *pContext) +{ + return 0; +} + +int main() +{ + SMikkTSpaceInterface sInterface = {NULL}; + sInterface.m_getNumFaces = GetNumFaces; + + SMikkTSpaceContext sContext = {NULL}; + sContext.m_pInterface = &sInterface; + + genTangSpaceDefault(&sContext); + + return 0; +} diff --git a/recipes/mikktspace/all/test_v1_package/CMakeLists.txt b/recipes/mikktspace/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mikktspace/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mikktspace/all/test_v1_package/conanfile.py b/recipes/mikktspace/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mikktspace/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/mikktspace/config.yml b/recipes/mikktspace/config.yml new file mode 100644 index 0000000000000..95f5961b1be57 --- /dev/null +++ b/recipes/mikktspace/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200325": + folder: all diff --git a/recipes/mimalloc/all/conandata.yml b/recipes/mimalloc/all/conandata.yml new file mode 100644 index 0000000000000..c25b069c45c60 --- /dev/null +++ b/recipes/mimalloc/all/conandata.yml @@ -0,0 +1,91 @@ +sources: + "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.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.0.9": + - patch_file: "patches/2.0.9-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - 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" + patch_type: "portability" + "1.7.9": + - patch_file: "patches/1.7.9-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - 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 new file mode 100644 index 0000000000000..124cfd39af08c --- /dev/null +++ b/recipes/mimalloc/all/conanfile.py @@ -0,0 +1,251 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, 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 +import os +import shutil +import textwrap + +required_conan_version = ">=1.53.0" + + +class MimallocConan(ConanFile): + name = "mimalloc" + 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") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "secure": [True, False], + "override": [True, False], + "inject": [True, False], + "single_object": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "secure": False, + "override": False, + "inject": False, + "single_object": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + # single_object and inject are options + # only when overriding on Unix-like platforms: + if is_msvc(self): + del self.options.single_object + del self.options.inject + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + # single_object is valid only for static + # override: + self.options.rm_safe("single_object") + + # inject is valid only for Unix-like dynamic override: + if not self.options.shared: + self.options.rm_safe("inject") + + # single_object and inject are valid only when + # overriding on Unix-like platforms: + if not self.options.override: + self.options.rm_safe("single_object") + self.options.rm_safe("inject") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + # Currently, mimalloc some version do not work properly with shared MD builds. + # https://github.com/conan-io/conan-center-index/pull/10333#issuecomment-1114110046 + if self.version in ["1.7.6", "1.7.7", "2.0.6", "2.0.7"] and \ + self.options.shared and \ + is_msvc(self) and \ + not is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + f"Currently, {self.ref} doesn't work properly with shared MD builds in CCI. Contributions welcomed") + + # Shared overriding requires dynamic runtime for MSVC: + if self.options.override and \ + self.options.shared and \ + is_msvc(self) and \ + is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Dynamic runtime (MD/MDd) is required when using mimalloc as a shared library for override") + + if self.options.override and \ + self.options.get_safe("single_object") and \ + self.options.get_safe("inject"): + raise ConanInvalidConfiguration("Single object is incompatible with library injection") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MI_BUILD_TESTS"] = "OFF" + tc.variables["MI_BUILD_SHARED"] = self.options.shared + tc.variables["MI_BUILD_STATIC"] = not self.options.shared + 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" + if Version(self.version) >= "1.7.0": + tc.variables["MI_INSTALL_TOPLEVEL"] = "ON" + tc.generate() + + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self) and self.settings.arch == "x86" and self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "mimalloc-redirect.lib", + "mimalloc-redirect32.lib") + 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, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + if self.options.get_safe("single_object"): + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + shutil.move(os.path.join(self.package_folder, self._obj_name + ".o"), + os.path.join(self.package_folder, "lib")) + shutil.copy(os.path.join(self.package_folder, "lib", self._obj_name + ".o"), + os.path.join(self.package_folder, "lib", self._obj_name)) + + if self.settings.os == "Windows" and self.options.shared: + if self.settings.arch == "x86_64": + copy(self, "mimalloc-redirect.dll", + src=os.path.join(self.source_folder, "bin"), + dst=os.path.join(self.package_folder, "bin")) + elif self.settings.arch == "x86": + copy(self, "mimalloc-redirect32.dll", + src=os.path.join(self.source_folder, "bin"), + dst=os.path.join(self.package_folder, "bin")) + + rmdir(self, os.path.join(self.package_folder, "share")) + + cmake_target = "mimalloc" if self.options.shared else "mimalloc-static" + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {cmake_target: "mimalloc::mimalloc"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _obj_name(self): + name = "mimalloc" + if self.options.secure: + name += "-secure" + if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): + name += "-{}".format(str(self.settings.build_type).lower()) + return name + + @property + def _lib_name(self): + name = "mimalloc" if self.settings.os == "Windows" else "libmimalloc" + + if self.settings.os == "Windows" and not self.options.shared: + name += "-static" + if self.options.secure: + name += "-secure" + if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): + name += "-{}".format(str(self.settings.build_type).lower()) + return name + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mimalloc") + self.cpp_info.set_property("cmake_target_name", "mimalloc" if self.options.shared else "mimalloc-static") + + self.cpp_info.names["cmake_find_package"] = "mimalloc" + self.cpp_info.names["cmake_find_package_multi"] = "mimalloc" + 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] + + if self.options.get_safe("inject"): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + return + + if self.options.get_safe("single_object"): + obj_ext = "o" + obj_file = "{}.{}".format(self._obj_name, obj_ext) + obj_path = os.path.join(self.package_folder, "lib", obj_file) + self.cpp_info.exelinkflags = [obj_path] + self.cpp_info.sharedlinkflags = [obj_path] + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + else: + self.cpp_info.libs = collect_libs(self) + + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["psapi", "shell32", "user32", "bcrypt"]) + elif self.settings.os == "Linux": + self.cpp_info.system_libs.append("rt") 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 new file mode 100644 index 0000000000000..6fa2c822d32ef --- /dev/null +++ b/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000000000..b6a13ceb0fb42 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch @@ -0,0 +1,12 @@ +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.5-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/1.7.5-0001-change-install-paths.patch new file mode 100644 index 0000000000000..e4bbfaf36f313 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.7.5-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d1207bb..feeecb6 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/1.7.7-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch new file mode 100644 index 0000000000000..108558a1f1922 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +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.7.9-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/1.7.9-0001-change-install-paths.patch new file mode 100644 index 0000000000000..1091c508194e2 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.7.9-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0011b87..41a15a2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -383,7 +383,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() + +@@ -407,7 +407,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.7.9-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/1.7.9-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..7a9f7edb032b6 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.7.9-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index f590033..a4275c5 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -493,7 +493,7 @@ template struct _mi_heap_stl_allocator_common : public _m + #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; +@@ -504,7 +504,7 @@ protected: + this->heap.reset(hp, (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 new file mode 100644 index 0000000000000..ffbc799da2d8e --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch @@ -0,0 +1,30 @@ +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 new file mode 100644 index 0000000000000..fc8068130bf11 --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000000..00b059ccae3db --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch @@ -0,0 +1,31 @@ +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 new file mode 100644 index 0000000000000..bb266a46ce3f6 --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000000..adf1e00f9607c --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +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.0.9-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/2.0.9-0001-change-install-paths.patch new file mode 100644 index 0000000000000..91c4b6fa129dd --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.9-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74c1f29..d657144 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -383,7 +383,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() + +@@ -407,7 +407,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.9-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/2.0.9-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..d8c391792f463 --- /dev/null +++ b/recipes/mimalloc/all/patches/2.0.9-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index 9b72fbf..b34362f 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -500,7 +500,7 @@ template struct _mi_heap_stl_allocator_common : public _m + #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; +@@ -511,7 +511,7 @@ protected: + this->heap.reset(hp, (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/test_package/CMakeLists.txt b/recipes/mimalloc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cf60e66aa36cb --- /dev/null +++ b/recipes/mimalloc/all/test_package/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) + +enable_testing() + +option(BUILD_NO_CHANGES "Build no_changes sources" ON) +option(BUILD_INCLUDE_OVERRIDE "Build include_override sources" ON) +option(BUILD_MI_API "Build mi_api sources" ON) + +find_package(mimalloc REQUIRED CONFIG) +if(TARGET mimalloc-static) + set(MIMALLOC_LIBS mimalloc-static) +else() + set(MIMALLOC_LIBS mimalloc) +endif() + +if(BUILD_NO_CHANGES) + add_executable(no_changes no_changes.c) + target_link_libraries(no_changes PRIVATE ${MIMALLOC_LIBS}) + target_compile_features(no_changes PRIVATE c_std_11) + add_test(NAME no_changes COMMAND no_changes) + + add_executable(no_changes_cpp no_changes.cpp) + target_link_libraries(no_changes_cpp PRIVATE ${MIMALLOC_LIBS}) + target_compile_features(no_changes_cpp PRIVATE cxx_std_17) + add_test(NAME no_changes_cpp COMMAND no_changes_cpp) +endif() + +if(BUILD_INCLUDE_OVERRIDE) + add_executable(include_override include_override.c) + target_link_libraries(include_override PRIVATE ${MIMALLOC_LIBS}) + target_compile_features(include_override PRIVATE c_std_11) + add_test(NAME include_override COMMAND include_override) + + add_executable(include_override_cpp include_override.cpp) + target_link_libraries(include_override_cpp PRIVATE ${MIMALLOC_LIBS}) + target_compile_features(include_override_cpp PRIVATE cxx_std_17) + add_test(NAME include_override_cpp COMMAND include_override_cpp) +endif() + +if(BUILD_MI_API) + add_executable(mi_api mi_api.c) + target_link_libraries(mi_api PRIVATE ${MIMALLOC_LIBS}) + target_compile_features(mi_api PRIVATE c_std_11) + add_test(NAME mi_api COMMAND mi_api) + + add_executable(mi_api_cpp mi_api.cpp) + target_link_libraries(mi_api_cpp PRIVATE ${MIMALLOC_LIBS}) + target_compile_features(mi_api_cpp PRIVATE cxx_std_17) + add_test(NAME mi_api_cpp COMMAND mi_api_cpp) +endif() diff --git a/recipes/mimalloc/all/test_package/conanfile.py b/recipes/mimalloc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..73d57fff7f138 --- /dev/null +++ b/recipes/mimalloc/all/test_package/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.build import build_jobs, can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import Environment +from conan.tools.files import chdir +import os +import functools + + +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) + + @functools.lru_cache(1) + def _test_files(self): + # No override: + if not self.dependencies["mimalloc"].options.override: + return ["mi_api"] + # Injected override + elif self.dependencies["mimalloc"].options.get_safe("inject"): + if self.settings.os == "Macos": + # Could not simulate Macos preload, so just ignore it + return [] + return ["no_changes"] + # Non injected override + return ["include_override", "mi_api"] + + @property + def _lib_name(self): + name = "mimalloc" if self.settings.os == "Windows" else "libmimalloc" + if self.settings.os == "Windows" and not self.dependencies["mimalloc"].options.shared: + name += "-static" + if self.dependencies["mimalloc"].options.secure: + name += "-secure" + if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): + name += f"-{str(self.settings.build_type).lower()}" + return name + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_NO_CHANGES"] = "no_changes" in self._test_files() + tc.variables["BUILD_INCLUDE_OVERRIDE"] = "include_override" in self._test_files() + tc.variables["BUILD_MI_API"] = "mi_api" in self._test_files() + tc.generate() + + env = Environment() + env.define("MIMALLOC_VERBOSE", "1") + if self.dependencies["mimalloc"].options.get_safe("inject"): + if self.settings.os == "Linux": + env.define("LD_PRELOAD", f"{self._lib_name}.so") + elif self.settings.os == "Macos": + env.define("DYLD_FORCE_FLAT_NAMESPACE", "1") + insert_library = os.path.join(self.dependencies["mimalloc"].cpp_info.libdirs[0], f"{self._lib_name}.dylib") + env.define("DYLD_INSERT_LIBRARIES", insert_library) + env.vars(self, scope="run").save_script("mimalloc_env_file") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/mimalloc/all/test_package/include_override.c b/recipes/mimalloc/all/test_package/include_override.c new file mode 100644 index 0000000000000..5e54990b98f79 --- /dev/null +++ b/recipes/mimalloc/all/test_package/include_override.c @@ -0,0 +1,11 @@ +#include "mimalloc-override.h" + +#include + +int main() { + void *data = malloc(1024); + free(data); + + printf("mimalloc version %d\n", mi_version()); + return 0; +} diff --git a/recipes/mimalloc/all/test_package/include_override.cpp b/recipes/mimalloc/all/test_package/include_override.cpp new file mode 100644 index 0000000000000..edcb49e3434ee --- /dev/null +++ b/recipes/mimalloc/all/test_package/include_override.cpp @@ -0,0 +1,16 @@ +#ifdef _WIN32 +#include +#else +#include +#endif + +#include +#include + +int main() { + auto *data = new int(1024); + delete data; + + std::cout << "mimalloc version " << mi_version() << "\n"; + return 0; +} diff --git a/recipes/mimalloc/all/test_package/mi_api.c b/recipes/mimalloc/all/test_package/mi_api.c new file mode 100644 index 0000000000000..804f582034b95 --- /dev/null +++ b/recipes/mimalloc/all/test_package/mi_api.c @@ -0,0 +1,11 @@ +#include "mimalloc.h" + +#include +#include + +int main() { + void *data = mi_malloc(1024); + + printf("mimalloc version %d\n", mi_version()); + return 0; +} diff --git a/recipes/mimalloc/all/test_package/mi_api.cpp b/recipes/mimalloc/all/test_package/mi_api.cpp new file mode 100644 index 0000000000000..a361ab757bf42 --- /dev/null +++ b/recipes/mimalloc/all/test_package/mi_api.cpp @@ -0,0 +1,13 @@ +#include "mimalloc.h" + +#include +#include + +int main() { + std::vector> vec; + vec.push_back(1); + vec.pop_back(); + + std::cout << "mimalloc version " << mi_version() << "\n"; + return 0; +} diff --git a/recipes/mimalloc/all/test_package/no_changes.c b/recipes/mimalloc/all/test_package/no_changes.c new file mode 100644 index 0000000000000..51737c1ac50f0 --- /dev/null +++ b/recipes/mimalloc/all/test_package/no_changes.c @@ -0,0 +1,12 @@ +#include +#include + +int main() { + void *data = malloc(1024); + + memset(data, '6', 1024); + + free(data); + + return 0; +} diff --git a/recipes/mimalloc/all/test_package/no_changes.cpp b/recipes/mimalloc/all/test_package/no_changes.cpp new file mode 100644 index 0000000000000..7a5ad3df0f22c --- /dev/null +++ b/recipes/mimalloc/all/test_package/no_changes.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + auto *data = new int(1024); + delete data; + + return 0; +} diff --git a/recipes/mimalloc/all/test_v1_package/CMakeLists.txt b/recipes/mimalloc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3f3fae06afa0a --- /dev/null +++ b/recipes/mimalloc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mimalloc/all/test_v1_package/conanfile.py b/recipes/mimalloc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7f8fb52960e7a --- /dev/null +++ b/recipes/mimalloc/all/test_v1_package/conanfile.py @@ -0,0 +1,70 @@ +from conans import ConanFile, CMake, RunEnvironment, tools +from conans.errors import ConanException +import os +import functools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def _mimalloc_option(self, name, default=None): + try: + return getattr(self.options["mimalloc"], name, default) + except (AttributeError, ConanException): + return default + + @functools.lru_cache(1) + def _test_files(self): + # No override: + if not self.options["mimalloc"].override: + return ["mi_api"] + # Injected override: + elif self._mimalloc_option("inject"): + if self.settings.os == "Macos": + # Could not simulate Macos preload, so just ignore it + return [] + return ["no_changes"] + # Non injected override: + return ["include_override", "mi_api"] + + def build(self): + cmake = CMake(self) + cmake.definitions["BUILD_NO_CHANGES"] = "no_changes" in self._test_files() + cmake.definitions["BUILD_INCLUDE_OVERRIDE"] = "include_override" in self._test_files() + cmake.definitions["BUILD_MI_API"] = "mi_api" in self._test_files() + cmake.configure() + cmake.build() + + @property + def _lib_name(self): + name = "mimalloc" if self.settings.os == "Windows" else "libmimalloc" + if self.settings.os == "Windows" and not self.options["mimalloc"].shared: + name += "-static" + if self.options["mimalloc"].secure: + name += "-secure" + if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): + name += f"-{str(self.settings.build_type).lower()}" + return name + + @property + def _environment(self): + environment = {"MIMALLOC_VERBOSE": "1"} + + if self._mimalloc_option("inject"): + if self.settings.os == "Linux": + environment["LD_PRELOAD"] = f"{self._lib_name}.so" + elif self.settings.os == "Macos": + env_build = RunEnvironment(self) + insert_library = os.path.join(env_build.vars["DYLD_LIBRARY_PATH"][0], f"{self._lib_name}.dylib") + + environment["DYLD_FORCE_FLAT_NAMESPACE"] = "1" + environment["DYLD_INSERT_LIBRARIES"] = insert_library + + return environment + + def test(self): + if tools.cross_building(self): + return + with tools.environment_append(self._environment): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/mimalloc/config.yml b/recipes/mimalloc/config.yml new file mode 100644 index 0000000000000..cabec88f14c46 --- /dev/null +++ b/recipes/mimalloc/config.yml @@ -0,0 +1,23 @@ +versions: + "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": + folder: all + "1.7.9": + folder: all + "1.7.7": + folder: all + "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 new file mode 100644 index 0000000000000..6703f0f20681d --- /dev/null +++ b/recipes/mingw-builds/all/conandata.yml @@ -0,0 +1,55 @@ +sources: + "12.2.0": + posix: + seh: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev1/x86_64-12.2.0-release-posix-seh-rt_v10-rev1.7z" + sha256: "077e1857ad2ea5e29d57127b0b9137d01bbae31b5bc65e18a7b98f4b866fd09d" + win32: + seh: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev1/x86_64-12.2.0-release-win32-seh-rt_v10-rev1.7z" + sha256: "774916c4403c5219f8af3a3ee3012de6c017c034895c2c92bc4de99895c2c924" + "12.1.0": + posix: + seh: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.1.0-rt_v10-rev3/x86_64-12.1.0-release-posix-seh-rt_v10-rev3.7z" + sha256: "6b605b990ed868a2b0fd92cf1df2d1964b06155a40a64afe52ca3bc1a7ffa3c6" + sjlj: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.1.0-rt_v10-rev3/x86_64-12.1.0-release-posix-sjlj-rt_v10-rev3.7z" + sha256: "fd744f5f09cd76dc98ae6abce88cd83c044191c2e6f2769936b901bd20171bc9" + win32: + seh: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.1.0-rt_v10-rev3/x86_64-12.1.0-release-win32-seh-rt_v10-rev3.7z" + sha256: "f82c6c881074deb4da4da4197ed7c8a58f0ef8866552519d90a24c8022334300" + sjlj: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.1.0-rt_v10-rev3/x86_64-12.1.0-release-win32-sjlj-rt_v10-rev3.7z" + sha256: "2cd98e9fe93b3fcb1613a9dd20c6ca71acc78817bc38de12159db0552c872e82" + "11.2.0": + posix: + seh: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/11.2.0-rt_v9-rev1/x86_64-11.2.0-release-posix-seh-rt_v9-rev1.7z" + sha256: "2c943b1a9231ce09f227b0c8fc6cabc61da3581f4ef2f7682f9393f5a1d70ae8" + sjlj: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/11.2.0-rt_v9-rev1/x86_64-11.2.0-release-posix-sjlj-rt_v9-rev1.7z" + sha256: "b943ae149c727d0dc91c4671d4e83585c087dca60b19752c9abd4b6ff7917b74" + win32: + seh: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/11.2.0-rt_v9-rev1/x86_64-11.2.0-release-win32-seh-rt_v9-rev1.7z" + sha256: "becaf3c2d036ae1cdfb50b1b807ecc4ae8c70a78f411cf3e1ccc3b7d4f6bb9d8" + sjlj: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/11.2.0-rt_v9-rev1/x86_64-11.2.0-release-win32-sjlj-rt_v9-rev1.7z" + sha256: "25a2ef169342219717e0fab794170ee58eb62879cd05f3bd8eb466bb9be59ed1" + "8.1": + posix: + seh: + url: "http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z" + sha256: "853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8" + sjlj: + url: "http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/sjlj/x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0.7z" + sha256: "0e994b33dc92576ba92377e2c18c0f96a04c684fa2d7a3546890819964275a1f" + win32: + seh: + url: "http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/seh/x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z" + sha256: "73797b9a1d0b007dbdd6f010e6064dc0aa4df835b042f6947f73a3bf9cc348c5" + sjlj: + url: "https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/sjlj/x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z" + sha256: "e8c65ddc655534b0330f66f7b480565621e8617cda9937d76ba141a22bf3b2fa" diff --git a/recipes/mingw-builds/all/conanfile.py b/recipes/mingw-builds/all/conanfile.py new file mode 100644 index 0000000000000..f3b3a8f3278f4 --- /dev/null +++ b/recipes/mingw-builds/all/conanfile.py @@ -0,0 +1,99 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import download, rmdir + + +required_conan_version = ">=1.47.0" + +class MingwConan(ConanFile): + name = "mingw-builds" + description = "MinGW is a contraction of Minimalist GNU for Windows" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/niXman/mingw-builds" + 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"} + + provides = "mingw-w64" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def validate(self): + valid_os = ["Windows"] + if str(self.settings.os) not in valid_os: + raise ConanInvalidConfiguration(f"MinGW {self.version} is only supported for the following operating systems: {valid_os}") + valid_arch = ["x86_64"] + if str(self.settings.arch) not in valid_arch: + raise ConanInvalidConfiguration(f"MinGW {self.version} is only supported for the following architectures on {self.settings.os}: {valid_arch}") + + if getattr(self, "settings_target", None): + if str(self.settings_target.os) not in valid_os: + raise ConanInvalidConfiguration(f"MinGW {self.version} is only supported for the following operating systems: {valid_os}") + valid_arch = ["x86_64"] + if str(self.settings_target.arch) not in valid_arch: + raise ConanInvalidConfiguration(f"MinGW {self.version} is only supported for the following architectures on {self.settings.os}: {valid_arch}") + if self.settings_target.compiler != "gcc": + raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") + if str(self.settings_target.compiler.threads) != str(self.options.threads): + raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " + f"with threads={self.options.threads}, your profile:host declares " + f"threads={self.settings_target.compiler.threads}, please use the same value for both.") + if str(self.settings_target.compiler.exception) != str(self.options.exception): + raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " + f"with exception={self.options.exception}, your profile:host declares " + f"exception={self.settings_target.compiler.exception}, please use the same value for both.") + + def build_requirements(self): + self.build_requires("7zip/19.00") + + 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)] + 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" + self.copy("*", dst="", src=target) + rmdir(self, target) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "opt", "lib", "cmake")) + + def package_info(self): + if getattr(self, "settings_target", None): + if self.settings_target.compiler != "gcc": + raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") + if str(self.settings_target.compiler.threads) != str(self.options.threads): + raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " + f"with threads={self.options.threads}, your profile:host declares " + f"threads={self.settings_target.compiler.threads}, please use the same value for both.") + if str(self.settings_target.compiler.exception) != str(self.options.exception): + raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " + f"with exception={self.options.exception}, your profile:host declares " + f"exception={self.settings_target.compiler.exception}, please use the same value for both.") + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var with : {bin_path}") + self.env_info.PATH.append(bin_path) + self.env_info.MINGW_HOME = str(self.package_folder) + + self.env_info.CONAN_CMAKE_GENERATOR = "MinGW Makefiles" + self.env_info.CXX = os.path.join(self.package_folder, "bin", "g++.exe").replace("\\", "/") + self.env_info.CC = os.path.join(self.package_folder, "bin", "gcc.exe").replace("\\", "/") + self.env_info.LD = os.path.join(self.package_folder, "bin", "ld.exe").replace("\\", "/") + self.env_info.NM = os.path.join(self.package_folder, "bin", "nm.exe").replace("\\", "/") + self.env_info.AR = os.path.join(self.package_folder, "bin", "ar.exe").replace("\\", "/") + self.env_info.AS = os.path.join(self.package_folder, "bin", "as.exe").replace("\\", "/") + self.env_info.STRIP = os.path.join(self.package_folder, "bin", "strip.exe").replace("\\", "/") + self.env_info.RANLIB = os.path.join(self.package_folder, "bin", "ranlib.exe").replace("\\", "/") + self.env_info.STRINGS = os.path.join(self.package_folder, "bin", "strings.exe").replace("\\", "/") + self.env_info.OBJDUMP = os.path.join(self.package_folder, "bin", "objdump.exe").replace("\\", "/") + self.env_info.GCOV = os.path.join(self.package_folder, "bin", "gcov.exe").replace("\\", "/") diff --git a/recipes/mingw-builds/all/test_package/conanfile.py b/recipes/mingw-builds/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fde2fbd35a165 --- /dev/null +++ b/recipes/mingw-builds/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, tools + + +class MinGWTestConan(ConanFile): + generators = "gcc" + settings = "os", "arch", "compiler", "build_type" + + def build(self): + source_file = os.path.join(self.source_folder, "main.cpp") + self.run("gcc.exe {} @conanbuildinfo.gcc -lstdc++ -o main".format(source_file), run_environment=True) + + def test(self): + if not tools.cross_building(self): + self.run("gcc.exe --version", run_environment=True) + self.run("main") diff --git a/recipes/mingw-builds/all/test_package/main.cpp b/recipes/mingw-builds/all/test_package/main.cpp new file mode 100644 index 0000000000000..b5597569f64e0 --- /dev/null +++ b/recipes/mingw-builds/all/test_package/main.cpp @@ -0,0 +1,7 @@ +#include +#include // test if we can include one of MinGW bundled header + +int main(void) { + std::cout << "Hello world!" << std::endl; + return 0; +} diff --git a/recipes/mingw-builds/config.yml b/recipes/mingw-builds/config.yml new file mode 100644 index 0000000000000..6ceaf5fe4c164 --- /dev/null +++ b/recipes/mingw-builds/config.yml @@ -0,0 +1,9 @@ +versions: + "12.2.0": + folder: "all" + "12.1.0": + folder: "all" + "11.2.0": + folder: "all" + "8.1": + folder: "all" diff --git a/recipes/mingw-w64/config.yml b/recipes/mingw-w64/config.yml new file mode 100644 index 0000000000000..ccd4069ab51d6 --- /dev/null +++ b/recipes/mingw-w64/config.yml @@ -0,0 +1,3 @@ +versions: + "8.0.2": + folder: "linux" diff --git a/recipes/mingw-w64/linux/conandata.yml b/recipes/mingw-w64/linux/conandata.yml new file mode 100644 index 0000000000000..4c165fd2e4f36 --- /dev/null +++ b/recipes/mingw-w64/linux/conandata.yml @@ -0,0 +1,12 @@ +sources: + "8.0.2": + mingw-w64: + url: "https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v8.0.2.tar.bz2" + sha256: "f00cf50951867a356d3dc0dcc7a9a9b422972302e23d54a33fc05ee7f73eee4d" + binutils: + url: "http://ftp.gnu.org/gnu/binutils/binutils-2.35.2.tar.bz2" + sha256: "cfa7644dbecf4591e136eb407c1c1da16578bd2b03f0c2e8acdceba194bb9d61" + gcc: + "10.3.0": + url: "http://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz" + sha256: "64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344" diff --git a/recipes/mingw-w64/linux/conanfile.py b/recipes/mingw-w64/linux/conanfile.py new file mode 100644 index 0000000000000..1e781d08b3204 --- /dev/null +++ b/recipes/mingw-w64/linux/conanfile.py @@ -0,0 +1,286 @@ +import os +from conan import ConanFile +from conan.tools.files import get, mkdir, chdir, rm, rmdir +from conan.errors import ConanInvalidConfiguration +from conans import tools, AutoToolsBuildEnvironment + + +required_conan_version = ">=1.50.0" + + +class MingwConan(ConanFile): + name = "mingw-w64" + description = "MinGW is a contraction of Minimalist GNU for Windows" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.mingw-w64.org/" + license = "ZPL-2.1", "MIT", "GPL-2.0-or-later" + topics = ("gcc", "gnu", "unix", "mingw32", "binutils") + settings = "os", "arch", "build_type", "compiler" + options = {"threads": ["posix", "win32"], "exception": ["seh", "sjlj"], "gcc": ["10.3.0"]} + default_options = {"threads": "posix", "exception": "seh", "gcc": "10.3.0"} + no_copy_source = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def validate(self): + valid_os = ["Linux"] + if str(self.settings.os) not in valid_os: + raise ConanInvalidConfiguration("MinGW {} is only supported for the following operating systems: {}" + .format(self.version, valid_os)) + valid_arch = ["x86_64"] + if str(self.settings.arch) not in valid_arch: + raise ConanInvalidConfiguration("MinGW {} is only supported for the following architectures on {}: {}" + .format(self.version, str(self.settings.os), valid_arch)) + + if "gcc" in self.conan_data["sources"][self.version]: + valid_gcc = self.conan_data["sources"][self.version]["gcc"].keys() + if str(self.options.gcc) not in valid_gcc: + raise ConanInvalidConfiguration("gcc version {} is not in the list of valid versions: {}" + .format(str(self.options.gcc), valid_gcc)) + + def build_requirements(self): + self.build_requires("m4/1.4.19") + self.build_requires("gmp/6.2.1") + self.build_requires("mpfr/4.1.0") + self.build_requires("mpc/1.2.0") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def _download_source(self): + arch_data = self.conan_data["sources"][self.version] + + for package in arch_data: + if package == "gcc": + continue + self.output.info("Downloading {} from {}".format(package, arch_data[package]['url'])) + get(self, **arch_data[package], strip_root=True, destination=os.path.join(self.build_folder, "sources", package)) + # Download gcc version + gcc_data = arch_data["gcc"][str(self.options.gcc)] + get(self, **gcc_data, strip_root=True, destination=os.path.join(self.build_folder, "sources", "gcc")) + + @property + def _target_tag(self): + return "x86_64-w64-mingw32" + + def build(self): + # Source should be downloaded in the build step since it depends on specific options + self._download_source() + + target_tag = self._target_tag + host_tag = "x86_64-linux-gnu" + + # We currently cannot build with multilib and threads=posix. Otherwise we get the gcc compile error: + # checking for ld that supports -Wl,--gc-sections... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. + # Makefile:11275: recipe for target 'configure-target-libstdc++-v3' failed + build_multilib = False + + # Instructions see: + # https://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-doc/howto-build/mingw-w64-howto-build.txt + # and + # https://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-doc/howto-build/mingw-w64-howto-build-adv.txt + # also good to see specific commands: + # https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/+/lollipop-dev/build-mingw64-toolchain.sh + + # add binutils to path. Required for gcc build + env = {"PATH": os.environ["PATH"] + ":" + os.path.join(self.package_folder, "bin")} + + with tools.environment_append(env): + with_gmp_mpfc_mpc = [ + "--with-gmp={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), + "--with-mpfr={}".format(self.deps_cpp_info["mpfr"].rootpath.replace("\\", "/")), + "--with-mpc={}".format(self.deps_cpp_info["mpc"].rootpath.replace("\\", "/")) + ] + + self.output.info("Building binutils ...") + mkdir(self, os.path.join(self.build_folder, "binutils")) + with chdir(self, os.path.join(self.build_folder, "binutils")): + autotools = AutoToolsBuildEnvironment(self) + conf_args = [ + "--enable-silent-rules", + "--with-sysroot={}".format(self.package_folder), + "--disable-nls", + "--disable-shared" + ] + if build_multilib: + conf_args.append("--enable-targets=x86_64-w64-mingw32,i686-w64-mingw32") + conf_args.extend(with_gmp_mpfc_mpc) + autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "binutils"), + args=conf_args, target=target_tag, host=False, build=False) + autotools.make() + autotools.install() + + self.output.info("Building mingw-w64-tools ...") + mkdir(self, os.path.join(self.build_folder, "mingw-w64-tools")) + with chdir(self, os.path.join(self.build_folder, "mingw-w64-tools")): + autotools = AutoToolsBuildEnvironment(self) + conf_args = [] + autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-tools", "widl"), + args=conf_args, target=target_tag, host=False, build=False) + autotools.make() + autotools.install() + + self.output.info("Building mingw-w64-headers ...") + mkdir(self, os.path.join(self.build_folder, "mingw-w64-headers")) + with chdir(self, os.path.join(self.build_folder, "mingw-w64-headers")): + autotools = AutoToolsBuildEnvironment(self) + conf_args = [ + "--enable-silent-rules", + "--with-widl={}".format(os.path.join(self.package_folder, "bin")), + "--enable-sdk=all", + "--prefix={}".format(os.path.join(self.package_folder, target_tag)) + ] + autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-headers"), + args=conf_args, target=False, host=target_tag, build=host_tag) + autotools.make() + autotools.install() + # Step 3) GCC requires the x86_64-w64-mingw32 directory be mirrored as a + # directory 'mingw' in the same root. So, if using configure default + # /usr/local, type: + # ln -s /usr/local/x86_64-w64-mingw32 /usr/local/mingw + # or, for sysroot, type: + # ln -s /mypath/x86_64-w64-mingw32 /mypath/mingw + self.run("ln -s {} {}".format(os.path.join(self.package_folder, target_tag), + os.path.join(self.package_folder, 'mingw'))) + # Step 5) Symlink x86_64-w64-mingw32/lib directory as x86_64-w64-mingw32/lib64: + # ln -s /usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib64 + # or, for sysroot: + # ln -s /mypath/x86_64-w64-mingw32/lib /mypath/x86_64-w64-mingw32/lib64 + self.run("ln -s {} {}".format(os.path.join(self.package_folder, target_tag, 'lib'), + os.path.join(self.package_folder, target_tag, 'lib64'))) + + self.output.info("Building core gcc ...") + mkdir(self, os.path.join(self.build_folder, "gcc")) + with chdir(self, os.path.join(self.build_folder, "gcc")): + autotools_gcc = AutoToolsBuildEnvironment(self) + conf_args = [ + "--enable-silent-rules", + "--enable-languages=c,c++", + "--with-sysroot={}".format(self.package_folder), + "--disable-shared" + ] + if build_multilib: + conf_args.append("--enable-targets=all") + conf_args.append("--enable-multilib") + else: + conf_args.append("--disable-multilib") + conf_args.extend(with_gmp_mpfc_mpc) + if self.options.exception == "sjlj": + conf_args.append("--enable-sjlj-exceptions") + if self.options.threads == "posix": + # Some specific options which need to be set for posix thread. Otherwise it fails compiling. + conf_args.extend([ + "--enable-silent-rules", + "--enable-threads=posix", + # Not 100% sure why, but the following options are required, otherwise + # gcc fails to build with posix threads + ]) + autotools_gcc.libs = [] + autotools_gcc.configure(configure_dir=os.path.join(self.build_folder, "sources", "gcc"), + args=conf_args, target=target_tag, host=False, build=False) + autotools_gcc.make(target="all-gcc") + autotools_gcc.make(target="install-gcc") + + env_compiler = dict(env) + # The CC and CXX compiler must be set to the mingw compiler. Conan already sets CC and CXX, therefore we need to overwrite it. + # If the wrong compiler is used for mingw-w64-crt, then you will get the error + # configure: Please check if the mingw-w64 header set and the build/host option are set properly. + env_compiler["CC"] = target_tag + "-gcc" + env_compiler["CXX"] = target_tag + "-g++" + with tools.environment_append(env_compiler): + self.output.info("Building mingw-w64-crt ...") + mkdir(self, os.path.join(self.build_folder, "mingw-w64-crt")) + with chdir(self, os.path.join(self.build_folder, "mingw-w64-crt")): + autotools = AutoToolsBuildEnvironment(self) + conf_args = [ + "--enable-silent-rules", + "--prefix={}".format(os.path.join(self.package_folder, target_tag)), + "--with-sysroot={}".format(self.package_folder) + ] + if build_multilib: + conf_args.append("--enable-lib32") + autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-crt"), + args=conf_args, target=False, host=target_tag, build=False, + use_default_install_dirs=False) + autotools.make() + autotools.install() + + if self.options.threads == "posix": + self.output.info("Building mingw-w64-libraries-winpthreads ...") + mkdir(self, os.path.join(self.build_folder, "mingw-w64-libraries-winpthreads")) + with chdir(self, os.path.join(self.build_folder, "mingw-w64-libraries-winpthreads")): + autotools = AutoToolsBuildEnvironment(self) + conf_args = [ + "--enable-silent-rules", + "--disable-shared", + "--prefix={}".format(os.path.join(self.package_folder, target_tag)) + ] + autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-libraries", "winpthreads"), + args=conf_args, target=False, host=target_tag, build=False) + autotools.make() + autotools.install() + + self.output.info("Building libgcc ...") + with chdir(self, os.path.join(self.build_folder, "gcc")): + autotools_gcc.make() + autotools_gcc.install() + + self.output.info("Building done!") + + def package(self): + self.copy("COPYING", src=os.path.join(self.build_folder, "sources", "mingw-w64"), dst="licenses") + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share", "man")) + rmdir(self, os.path.join(self.package_folder, "share", "doc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + # replace with relative symlinks so they'll resolve correctly on consumer's machine + os.unlink(os.path.join(self.package_folder, 'mingw')) + os.unlink(os.path.join(self.package_folder, self._target_tag, 'lib64')) + self.run("ln -s {} {}".format(os.path.join(os.curdir, self._target_tag), + os.path.join(self.package_folder, 'mingw'))) + self.run("ln -s {} {}".format(os.path.join(os.curdir, 'lib'), + os.path.join(self.package_folder, self._target_tag, 'lib64'))) + + def package_info(self): + if getattr(self, "settings_target", None): + if self.settings_target.compiler != "gcc": + raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") + if str(self.settings_target.compiler.threads) != str(self.options.threads): + raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " + "with threads={}, your profile:host declares " + "threads={}, please use the same value for both." + .format(self.options.threads, + self.settings_target.compiler.threads)) + if str(self.settings_target.compiler.exception) != str(self.options.exception): + raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " + "with exception={}, your profile:host declares " + "exception={}, please use the same value for both." + .format(self.options.exception, + self.settings_target.compiler.exception)) + + 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) + self.env_info.MINGW_HOME = str(self.package_folder) + + prefix = os.path.join(self.package_folder, "bin", self._target_tag + "-") + self.env_info.CC = prefix + "gcc" + self.env_info.CXX = prefix + "g++" + self.env_info.CPP = prefix + "cpp" + self.env_info.AR = prefix + "ar" + self.env_info.AS = prefix + "as" + self.env_info.GDB = prefix + "gdb" + self.env_info.LD = prefix + "ld" + self.env_info.NM = prefix + "nm" + self.env_info.OBJCOPY = prefix + "objcopy" + self.env_info.OBJDUMP = prefix + "objdump" + self.env_info.RANLIB = prefix + "ranlib" + self.env_info.SIZE = prefix + "size" + self.env_info.STRINGS = prefix + "strings" + self.env_info.STRIP = prefix + "strip" + self.env_info.GCOV = prefix + "gcov" + self.env_info.RC = prefix + "windres" + self.env_info.DLLTOOL = prefix + "dlltool" diff --git a/recipes/mingw-w64/linux/test_package/conanfile.py b/recipes/mingw-w64/linux/test_package/conanfile.py new file mode 100644 index 0000000000000..b6ef323de8d96 --- /dev/null +++ b/recipes/mingw-w64/linux/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conan import ConanFile +from conan.tools.build import cross_building + + +class MinGWTestConan(ConanFile): + generators = "gcc" + settings = "os", "arch", "compiler", "build_type" + + def build(self): + source_file = os.path.join(self.source_folder, "main.cpp") + self.run("x86_64-w64-mingw32-g++ {} @conanbuildinfo.gcc -lstdc++ -o main".format(source_file), run_environment=True) + + def test(self): + if not cross_building(self): + self.run("x86_64-w64-mingw32-g++ --version", run_environment=True) diff --git a/recipes/mingw-w64/linux/test_package/main.cpp b/recipes/mingw-w64/linux/test_package/main.cpp new file mode 100644 index 0000000000000..a9fc162357f9c --- /dev/null +++ b/recipes/mingw-w64/linux/test_package/main.cpp @@ -0,0 +1,9 @@ +#if !defined(_WIN32) +# error "_WIN32 not defined" +#endif + +#include + +int main() { + printf("hello world\n"); +} diff --git a/recipes/miniaudio/all/CMakeLists.txt b/recipes/miniaudio/all/CMakeLists.txt new file mode 100644 index 0000000000000..8e18371d5a460 --- /dev/null +++ b/recipes/miniaudio/all/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.4) +project(miniaudio LANGUAGES C) + +include(GNUInstallDirs) + +set(SOURCE_SUBFOLDER ${MINIAUDIO_SRC_DIR}/extras/miniaudio_split/) +add_library(miniaudio ${SOURCE_SUBFOLDER}/miniaudio.c) +target_include_directories(miniaudio PRIVATE ${SOURCE_SUBFOLDER}) + +if (BUILD_SHARED_LIBS) + target_compile_definitions(miniaudio PRIVATE MA_DLL MINIAUDIO_IMPLEMENTATION) +endif() + +set_target_properties(miniaudio + PROPERTIES + VERSION ${MINIAUDIO_VERSION_STRING} + PUBLIC_HEADER ${SOURCE_SUBFOLDER}/miniaudio.h) + +install(TARGETS miniaudio + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/recipes/miniaudio/all/conandata.yml b/recipes/miniaudio/all/conandata.yml new file mode 100644 index 0000000000000..49cc53a5d3381 --- /dev/null +++ b/recipes/miniaudio/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "0.11.11": + url: "https://github.com/mackron/miniaudio/archive/a0dc1037f99a643ff5fad7272cd3d6461f2d63fa.tar.gz" + sha256: "4821e2f796d95b772fd4ef1274181d5302854bfe55680125a5cd9b24b8542dcf" + "0.11.9": + url: "https://github.com/mackron/miniaudio/archive/4dfe7c4c31df46e78d9a1cc0d2d6f1aef5a5d58c.tar.gz" + sha256: "76c154a60e320ae2054ac0e93480f2dffc12a5129bdb2ed4a62e0cce8d345c36" + "0.11.8": + url: "https://github.com/mackron/miniaudio/archive/82e70f4cbe6e613c8edc0ac7b97ff3dd00f2ca27.tar.gz" + sha256: "a18540062e46f6308c962068125c9560a1a51abeb4fa8dc26a91ea55fc043c6b" + "0.11.7": + url: "https://github.com/mackron/miniaudio/archive/073b7bbbba3a27adcf44fd62bd055ccee67e1973.tar.gz" + sha256: "c3cabab7ce9564ffbe136e5111d2569d224051af95d76d85b4354c65d8ede85e" + "0.11.6": + url: "https://github.com/mackron/miniaudio/archive/c3a9ab9b900b1ac316f7e2cb5e05e5cc27179f19.tar.gz" + sha256: "3b0a23ae745592dae19e777cf46784285705b16fba582cbad2534a61d75595d1" + "0.11.2": + url: "https://github.com/mackron/miniaudio/archive/42abbbea4602af80d1ccb4a22cdc35813aceee7a.tar.gz" + sha256: "7d54fbe5c7dae30e30ca6b3ffecaed81c61637752d56a8434a0a66895e36352a" + "0.10.40": + url: "https://github.com/mackron/miniaudio/archive/37fe1343f04f6fd9bd82229ca50a48b77ecce564.tar.gz" + sha256: "363478247C144F94A09B62A6BD27E11FEA7334FE2247B666C0D8891607D3C39C" + "0.10.39": + url: "https://github.com/mackron/miniaudio/archive/8bf157f10e278302f8a6c1c9cd1065f2bea26dd2.tar.gz" + sha256: "573C511F1FD1C64BD331160E357DE611A144E5BDBAF1CD872195B8D535FA557E" diff --git a/recipes/miniaudio/all/conanfile.py b/recipes/miniaudio/all/conanfile.py new file mode 100644 index 0000000000000..f595f804f6c12 --- /dev/null +++ b/recipes/miniaudio/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + +class MiniaudioConan(ConanFile): + name = "miniaudio" + description = "A single file audio playback and capture library." + license = ["Unlicense", "MIT-0"] + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mackron/miniaudio" + topics = ("audio", "header-only", "sound") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.header_only or self.options.shared: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.options.header_only: + return + + tc = CMakeToolchain(self) + tc.variables["MINIAUDIO_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["MINIAUDIO_VERSION_STRING"] = self.version + tc.generate() + + def build(self): + if self.options.header_only: + return + + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="**", + dst=os.path.join(self.package_folder, "include", "extras"), + src=os.path.join(self.source_folder, "extras"), + ) + + if self.options.header_only: + copy( + self, + pattern="miniaudio.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder) + copy( + self, + pattern="miniaudio.*", + dst=os.path.join(self.package_folder, "include", "extras", "miniaudio_split"), + src=os.path.join(self.source_folder, "extras", "miniaudio_split"), + ) + else: + cmake = CMake(self) + cmake.install() + + def package_info(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("dl") + if self.settings.os == "Macos": + self.cpp_info.frameworks.extend( + ["CoreFoundation", "CoreAudio", "AudioUnit"] + ) + self.cpp_info.defines.append("MA_NO_RUNTIME_LINKING=1") + + if self.options.header_only: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + else: + self.cpp_info.libs = ["miniaudio"] + if self.options.shared: + self.cpp_info.defines.append("MA_DLL") diff --git a/recipes/miniaudio/all/test_package/CMakeLists.txt b/recipes/miniaudio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a7a69182169b3 --- /dev/null +++ b/recipes/miniaudio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(miniaudio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE miniaudio::miniaudio) diff --git a/recipes/miniaudio/all/test_package/conanfile.py b/recipes/miniaudio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e140654a3db4e --- /dev/null +++ b/recipes/miniaudio/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/miniaudio/all/test_package/test_package.c b/recipes/miniaudio/all/test_package/test_package.c new file mode 100644 index 0000000000000..b2cf198c183eb --- /dev/null +++ b/recipes/miniaudio/all/test_package/test_package.c @@ -0,0 +1,56 @@ +/* +Demonstrates how to enumerate over devices. +Device enumaration requires a `ma_context` object which is initialized with +`ma_context_init()`. Conceptually, the context sits above a device. You can have +many devices to one context. If you use device enumeration, you should +explicitly specify the same context you used for enumeration in the call to +`ma_device_init()` when you initialize your devices. +*/ + +// With the package in header-only mode, this will embed the implementation of +// miniaudio in this file. +// In lib mode, this will be ignored because we use the stripped version of +// miniaudio.h that only contains definitions. +#define MINIAUDIO_IMPLEMENTATION +#include + +#include + +int main(int argc, char **argv) { + ma_result result; + ma_context context; + ma_device_info *pPlaybackDeviceInfos; + ma_uint32 playbackDeviceCount; + ma_device_info *pCaptureDeviceInfos; + ma_uint32 captureDeviceCount; + ma_uint32 iDevice; + + if (ma_context_init(NULL, 0, NULL, &context) != MA_SUCCESS) { + printf("Failed to initialize context.\n"); + return -2; + } + + result = ma_context_get_devices(&context, &pPlaybackDeviceInfos, + &playbackDeviceCount, &pCaptureDeviceInfos, + &captureDeviceCount); + if (result != MA_SUCCESS) { + printf("Failed to retrieve device information.\n"); + return -3; + } + + printf("Playback Devices\n"); + for (iDevice = 0; iDevice < playbackDeviceCount; ++iDevice) { + printf(" %u: %s\n", iDevice, pPlaybackDeviceInfos[iDevice].name); + } + + printf("\n"); + + printf("Capture Devices\n"); + for (iDevice = 0; iDevice < captureDeviceCount; ++iDevice) { + printf(" %u: %s\n", iDevice, pCaptureDeviceInfos[iDevice].name); + } + + ma_context_uninit(&context); + + return 0; +} diff --git a/recipes/miniaudio/all/test_v1_package/CMakeLists.txt b/recipes/miniaudio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/miniaudio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/miniaudio/all/test_v1_package/conanfile.py b/recipes/miniaudio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/miniaudio/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/miniaudio/config.yml b/recipes/miniaudio/config.yml new file mode 100644 index 0000000000000..52824dc107878 --- /dev/null +++ b/recipes/miniaudio/config.yml @@ -0,0 +1,17 @@ +versions: + "0.11.11": + folder: all + "0.11.9": + folder: all + "0.11.8": + folder: all + "0.11.7": + folder: all + "0.11.6": + folder: all + "0.11.2": + folder: all + "0.10.40": + folder: all + "0.10.39": + folder: all diff --git a/recipes/minimp3/all/conandata.yml b/recipes/minimp3/all/conandata.yml new file mode 100644 index 0000000000000..f86679db763b3 --- /dev/null +++ b/recipes/minimp3/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20200304": + url: "https://github.com/lieff/minimp3/archive/55da78cbeea5fb6757f8df672567714e1e8ca3e9.zip" + sha256: "108074684c080a34f0d08f23a709128ea518d48651c8381bce91b73b29185479" + "20200221": + url: "https://github.com/lieff/minimp3/archive/9229f280ad475a434d7592255dc01534db65504f.zip" + sha256: "263dd1b9538780ae5489dddb4ab0397aa2d2c6ea7783bef4c7a0aad9555569ec" diff --git a/recipes/minimp3/all/conanfile.py b/recipes/minimp3/all/conanfile.py new file mode 100644 index 0000000000000..6886956b3c461 --- /dev/null +++ b/recipes/minimp3/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.50.0" + + +class Minimp3Conan(ConanFile): + name = "minimp3" + description = "Minimalistic MP3 decoder single header library." + license = "CC0-1.0" + topics = ("minimp3", "decoder", "mp3", "header-only") + homepage = "https://github.com/lieff/minimp3" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "minimp3*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/minimp3/all/test_package/CMakeLists.txt b/recipes/minimp3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..685b8a96689cb --- /dev/null +++ b/recipes/minimp3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(minimp3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minimp3::minimp3) diff --git a/recipes/minimp3/all/test_package/conanfile.py b/recipes/minimp3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/minimp3/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/minimp3/all/test_package/test_package.c b/recipes/minimp3/all/test_package/test_package.c new file mode 100644 index 0000000000000..a2ef95cb2f369 --- /dev/null +++ b/recipes/minimp3/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#define MINIMP3_IMPLEMENTATION +#include + +int main() { + static mp3dec_t mp3d; + mp3dec_init(&mp3d); + + return 0; +} diff --git a/recipes/minimp3/all/test_v1_package/CMakeLists.txt b/recipes/minimp3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..659f9200bc193 --- /dev/null +++ b/recipes/minimp3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGET) + +find_package(minimp3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minimp3::minimp3) diff --git a/recipes/minimp3/all/test_v1_package/conanfile.py b/recipes/minimp3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/minimp3/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/minimp3/config.yml b/recipes/minimp3/config.yml new file mode 100644 index 0000000000000..d49b70495df47 --- /dev/null +++ b/recipes/minimp3/config.yml @@ -0,0 +1,5 @@ +versions: + "20200304": + folder: all + "20200221": + folder: all diff --git a/recipes/minisat/all/CMakeLists.txt b/recipes/minisat/all/CMakeLists.txt new file mode 100644 index 0000000000000..b2a136daf4fdb --- /dev/null +++ b/recipes/minisat/all/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.15) +project(minisat LANGUAGES CXX) + +find_package(ZLIB REQUIRED) + +# no Main.cc as these are the command line tools +add_library(minisat + ${MINISAT_SRC_DIR}/core/Solver.cc + ${MINISAT_SRC_DIR}/simp/SimpSolver.cc + ${MINISAT_SRC_DIR}/utils/Options.cc + ${MINISAT_SRC_DIR}/utils/System.cc +) +target_include_directories(minisat PUBLIC ${MINISAT_SRC_DIR}) +target_link_libraries(minisat PUBLIC ZLIB::ZLIB) +set_target_properties(minisat PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(GNUInstallDirs) +install( + TARGETS minisat + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY ${MINISAT_SRC_DIR}/mtl ${MINISAT_SRC_DIR}/utils ${MINISAT_SRC_DIR}/core ${MINISAT_SRC_DIR}/simp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/minisat + FILES_MATCHING PATTERN "*.h" +) diff --git a/recipes/minisat/all/conandata.yml b/recipes/minisat/all/conandata.yml new file mode 100644 index 0000000000000..640607063ff26 --- /dev/null +++ b/recipes/minisat/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "2.2.0": + url: "https://github.com/niklasso/minisat/archive/refs/tags/releases/2.2.0.tar.gz" + sha256: "3ed44da999744c0a1be269df23c3ed8731cdb83c44a4f3aa29b3d6859bb2a4da" +patches: + "2.2.0": + - patch_file: "patches/0001-drop-default-arg-in-friend-declaration-2.2.0.patch" + patch_description: "drop default argument in friend declaration" + patch_type: portability + patch_source: "https://github.com/niklasso/minisat/commit/9256ff36d29cee13fc806dec212ba4309d1cb0d4" + - patch_file: "patches/0002-suffix-literal-2.2.0.patch" + patch_description: "add spaces before user literals" + patch_type: portability + patch_source: "https://github.com/conp-solutions/mergesat/commit/18e138e0b9130833549070dcff9de64ca6ae1f7a" diff --git a/recipes/minisat/all/conanfile.py b/recipes/minisat/all/conanfile.py new file mode 100644 index 0000000000000..6dccb7f852803 --- /dev/null +++ b/recipes/minisat/all/conanfile.py @@ -0,0 +1,71 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class MiniSatConan(ConanFile): + name = "minisat" + description = "minimalistic SAT solver" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://minisat.se" + topics = ("satisfiability", "solver") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + package_type = "library" + + def export_sources(self): + export_conandata_patches(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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/niklasso/minisat/blob/37dc6c67e2af26379d88ce349eb9c4c6160e8543/minisat/utils/ParseUtils.h#L27 + self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MINISAT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="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 = ["minisat"] + self.cpp_info.includedirs.append(os.path.join("include", "minisat")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/minisat/all/patches/0001-drop-default-arg-in-friend-declaration-2.2.0.patch b/recipes/minisat/all/patches/0001-drop-default-arg-in-friend-declaration-2.2.0.patch new file mode 100644 index 0000000000000..4b496704fc5f3 --- /dev/null +++ b/recipes/minisat/all/patches/0001-drop-default-arg-in-friend-declaration-2.2.0.patch @@ -0,0 +1,22 @@ +diff --git a/core/SolverTypes.h b/core/SolverTypes.h +index 1ebcc73..7b1d16a 100644 +--- a/core/SolverTypes.h ++++ b/core/SolverTypes.h +@@ -47,7 +47,7 @@ struct Lit { + int x; + + // Use this as a constructor: +- friend Lit mkLit(Var var, bool sign = false); ++ //friend Lit mkLit(Var var, bool sign = false); + + bool operator == (Lit p) const { return x == p.x; } + bool operator != (Lit p) const { return x != p.x; } +@@ -55,7 +55,7 @@ struct Lit { + }; + + +-inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; } ++inline Lit mkLit (Var var, bool sign = false) { Lit p; p.x = var + var + (int)sign; return p; } + inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; } + inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; } + inline bool sign (Lit p) { return p.x & 1; } diff --git a/recipes/minisat/all/patches/0002-suffix-literal-2.2.0.patch b/recipes/minisat/all/patches/0002-suffix-literal-2.2.0.patch new file mode 100644 index 0000000000000..7b88d7fab9ef1 --- /dev/null +++ b/recipes/minisat/all/patches/0002-suffix-literal-2.2.0.patch @@ -0,0 +1,23 @@ +diff --git a/minisat/utils/Options.h b/minisat/utils/Options.h +index 2dba10f..ea7c185 100644 +--- a/utils/Options.h ++++ b/utils/Options.h +@@ -282,15 +282,15 @@ class Int64Option : public Option + if (range.begin == INT64_MIN) + fprintf(stderr, "imin"); + else +- fprintf(stderr, "%4"PRIi64, range.begin); ++ fprintf(stderr, "%4" PRIi64, range.begin); + + fprintf(stderr, " .. "); + if (range.end == INT64_MAX) + fprintf(stderr, "imax"); + else +- fprintf(stderr, "%4"PRIi64, range.end); ++ fprintf(stderr, "%4" PRIi64, range.end); + +- fprintf(stderr, "] (default: %"PRIi64")\n", value); ++ fprintf(stderr, "] (default: %" PRIi64")\n", value); + if (verbose){ + fprintf(stderr, "\n %s\n", description); + fprintf(stderr, "\n"); diff --git a/recipes/minisat/all/test_package/CMakeLists.txt b/recipes/minisat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ca1a47d74810a --- /dev/null +++ b/recipes/minisat/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(minisat REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE minisat::minisat) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/minisat/all/test_package/conanfile.py b/recipes/minisat/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/minisat/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/minisat/all/test_package/test_package.cpp b/recipes/minisat/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d6ff1a72443c3 --- /dev/null +++ b/recipes/minisat/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +// example from https://accu.org/journals/overload/27/150/horenovsky_2640/ +#include +#include + +using namespace Minisat; + +int main() { + Solver solver; + // Create variables + Var A = solver.newVar(); + Var B = solver.newVar(); + Var C = solver.newVar(); + // Create the clauses + solver.addClause( mkLit(A), mkLit(B), mkLit(C)); + solver.addClause(~mkLit(A), mkLit(B), mkLit(C)); + solver.addClause( mkLit(A), ~mkLit(B), mkLit(C)); + solver.addClause( mkLit(A), mkLit(B), ~mkLit(C)); + // Check for solution and retrieve model if found + bool sat = solver.solve(); + if (sat) { + std::clog << "SAT\n" + << "Model found:\n"; + std::clog << "A := " + << (solver.modelValue(A) == l_True) + << '\n'; + std::clog << "B := " + << (solver.modelValue(B) == l_True) + << '\n'; + std::clog << "C := " + << (solver.modelValue(C) == l_True) + << '\n'; + return 0; + } else { + std::clog << "UNSAT\n"; + return 1; + } +} diff --git a/recipes/minisat/all/test_v1_package/CMakeLists.txt b/recipes/minisat/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/minisat/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/minisat/all/test_v1_package/conanfile.py b/recipes/minisat/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/minisat/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/minisat/config.yml b/recipes/minisat/config.yml new file mode 100644 index 0000000000000..1979b3114ab95 --- /dev/null +++ b/recipes/minisat/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.0": + folder: all diff --git a/recipes/miniscript/all/CMakeLists.txt b/recipes/miniscript/all/CMakeLists.txt new file mode 100644 index 0000000000000..b203ccd24f5f1 --- /dev/null +++ b/recipes/miniscript/all/CMakeLists.txt @@ -0,0 +1,66 @@ +cmake_minimum_required(VERSION 3.8) +project(miniscript LANGUAGES CXX) + +set(MINISCRIPT_SRC + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/Dictionary.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/List.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptInterpreter.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptIntrinsics.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptKeywords.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptLexer.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptParser.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptTAC.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptTypes.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/QA.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/SimpleString.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/SimpleVector.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/SplitJoin.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/UnicodeUtil.cpp + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/UnitTest.cpp +) + +set(MINISCRIPT_INC + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/Dictionary.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/List.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptErrors.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptInterpreter.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptIntrinsics.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptKeywords.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptLexer.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptParser.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptTAC.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/MiniscriptTypes.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/QA.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/RefCountedStorage.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/SimpleString.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/SimpleVector.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/SplitJoin.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/UnicodeUtil.h + ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src/MiniScript/UnitTest.h +) + + +add_library(miniscript ${MINISCRIPT_SRC}) +target_include_directories(miniscript PRIVATE ${MINISCRIPT_SRC_DIR}/MiniScript-cpp/src) +set_target_properties(miniscript PROPERTIES + PUBLIC_HEADER "${MINISCRIPT_INC}" + WINDOWS_EXPORT_ALL_SYMBOLS ON + C_EXTENSIONS OFF +) +target_compile_features(miniscript PRIVATE cxx_std_11) + +if(MSVC) + target_compile_options(miniscript PRIVATE /EHsc /wd4068) +endif() + +find_library(LIBM m) +target_link_libraries(miniscript PRIVATE $<$:${LIBM}>) + +include(GNUInstallDirs) +install( + TARGETS miniscript + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/MiniScript +) diff --git a/recipes/miniscript/all/conandata.yml b/recipes/miniscript/all/conandata.yml new file mode 100644 index 0000000000000..bafad0fb939fc --- /dev/null +++ b/recipes/miniscript/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5.1": + url: "https://github.com/JoeStrout/miniscript/archive/172bea8e762c96b1b2a5ea743228ff6a58702cc3.tar.gz" + sha256: "a82ac634621657e14f046b6fd08dbc624e8e9890b646573edef454a2e540a1e2" diff --git a/recipes/miniscript/all/conanfile.py b/recipes/miniscript/all/conanfile.py new file mode 100644 index 0000000000000..d85d56bf3dc9b --- /dev/null +++ b/recipes/miniscript/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +import os + +required_conan_version = ">=1.53.0" + +class MiniscriptConan(ConanFile): + name = "miniscript" + description = "modern, elegant, easy to learn, and easy to embed in your own C# or C++ projects." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/JoeStrout/miniscript" + topics = ("script", "embedded", "programming-language") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports_sources = ["CMakeLists.txt"] + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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["MINISCRIPT_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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["miniscript"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/miniscript/all/test_package/CMakeLists.txt b/recipes/miniscript/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..677b1ee8fe710 --- /dev/null +++ b/recipes/miniscript/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(miniscript REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE miniscript::miniscript) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/miniscript/all/test_package/conanfile.py b/recipes/miniscript/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/miniscript/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/miniscript/all/test_package/test_package.cpp b/recipes/miniscript/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..91d25c569fcf6 --- /dev/null +++ b/recipes/miniscript/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include + +#include "MiniScript/SimpleString.h" +#include "MiniScript/UnicodeUtil.h" +#include "MiniScript/SimpleVector.h" +#include "MiniScript/List.h" +#include "MiniScript/Dictionary.h" +#include "MiniScript/MiniscriptParser.h" +#include "MiniScript/MiniscriptInterpreter.h" + +int main() { + MiniScript::Interpreter interp; + + interp.standardOutput = [](MiniScript::String s) { std::cout << s.c_str() << std::endl; }; + interp.errorOutput = [](MiniScript::String s) { std::cerr << s.c_str() << std::endl; }; + interp.implicitOutput = [](MiniScript::String s) { std::cout << s.c_str() << std::endl; }; + + interp.REPL("x = 5"); + interp.REPL("print \"x = \" + x"); + interp.REPL("y = 5 + x"); + interp.REPL("print \"y = \" + y"); + + return 0; +} diff --git a/recipes/miniscript/all/test_v1_package/CMakeLists.txt b/recipes/miniscript/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/miniscript/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/miniscript/all/test_v1_package/conanfile.py b/recipes/miniscript/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/miniscript/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/miniscript/config.yml b/recipes/miniscript/config.yml new file mode 100644 index 0000000000000..f1c5e3d313178 --- /dev/null +++ b/recipes/miniscript/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.1": + folder: all diff --git a/recipes/minitrace/all/conandata.yml b/recipes/minitrace/all/conandata.yml new file mode 100644 index 0000000000000..f0c32e1045bb8 --- /dev/null +++ b/recipes/minitrace/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210321": + url: "https://github.com/hrydgard/minitrace/archive/020f42b189e8d6ad50e4d8f45d69edee0a6b3f23.tar.gz" + sha256: "314bcab4dc069c61f2eb813c9bd649efb2bd1fd75f91205a269a4c5abcd3d66b" +patches: + "cci.20210321": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/minitrace/all/conanfile.py b/recipes/minitrace/all/conanfile.py new file mode 100644 index 0000000000000..af8d398e935c1 --- /dev/null +++ b/recipes/minitrace/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class MinitraceConan(ConanFile): + name = "minitrace" + description = "Simple C/C++ library for producing JSON traces suitable for Chrome's built-in trace viewer (about:tracing)." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hrydgard/minitrace" + topics = ("trace", "chrome", "about:tracing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(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 = ["minitrace"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/minitrace/all/patches/0001-fix-cmake.patch b/recipes/minitrace/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..3ab4a600e5e60 --- /dev/null +++ b/recipes/minitrace/all/patches/0001-fix-cmake.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06320bb..52c948c 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1,11 +1,18 @@ + cmake_minimum_required(VERSION 3.10) + project(minitrace) + +-add_library(${PROJECT_NAME} STATIC minitrace.c) ++add_library(${PROJECT_NAME} minitrace.c) + add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) + + target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + ++set_target_properties(${PROJECT_NAME} PROPERTIES ++ PUBLIC_HEADER minitrace.h ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++ C_EXTENSIONS OFF ++ C_STANDARD 99 ++) ++ + option(MTR_ENABLED "Enable minitrace" ON) + if(MTR_ENABLED) + target_compile_definitions(${PROJECT_NAME} PUBLIC MTR_ENABLED) +@@ -19,4 +26,14 @@ if(MTR_BUILD_TEST) + find_package(Threads) + add_executable(minitrace_test_mt minitrace_test_mt.cpp) + target_link_libraries(minitrace_test_mt ${PROJECT_NAME} Threads::Threads) +-endif() +\ No newline at end of file ++endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS ${PROJECT_NAME} ++ 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/minitrace/all/test_package/CMakeLists.txt b/recipes/minitrace/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a6a13090703c1 --- /dev/null +++ b/recipes/minitrace/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +find_package(minitrace REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} minitrace::minitrace) diff --git a/recipes/minitrace/all/test_package/conanfile.py b/recipes/minitrace/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/minitrace/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/minitrace/all/test_package/test_package.c b/recipes/minitrace/all/test_package/test_package.c new file mode 100644 index 0000000000000..522ac8ef4d331 --- /dev/null +++ b/recipes/minitrace/all/test_package/test_package.c @@ -0,0 +1,70 @@ +#include "minitrace.h" + +#ifdef _WIN32 +#include +#define usleep(x) Sleep(x/1000) +#else +#include +#endif + +void c() { + MTR_SCOPE("c++", "c()"); + usleep(10000); +} + +void b() { + MTR_SCOPE("c++", "b()"); + usleep(20000); + c(); + usleep(10000); +} + +void a() { + MTR_SCOPE("c++", "a()"); + usleep(20000); + b(); + usleep(10000); +} + +int main() { + int i; + mtr_init("trace.json"); + mtr_register_sigint_handler(); + + MTR_META_PROCESS_NAME("minitrace_test"); + MTR_META_THREAD_NAME("main thread"); + + int long_running_thing_1; + int long_running_thing_2; + + MTR_START("background", "long_running", &long_running_thing_1); + MTR_START("background", "long_running", &long_running_thing_2); + + MTR_COUNTER("main", "greebles", 3); + MTR_BEGIN("main", "outer"); + usleep(80000); + for (i = 0; i < 3; i++) { + MTR_BEGIN("main", "inner"); + usleep(40000); + MTR_END("main", "inner"); + usleep(10000); + MTR_COUNTER("main", "greebles", 3 * i + 10); + } + MTR_STEP("background", "long_running", &long_running_thing_1, "middle step"); + usleep(80000); + MTR_END("main", "outer"); + MTR_COUNTER("main", "greebles", 0); + + usleep(10000); + a(); + + usleep(50000); + MTR_INSTANT("main", "the end"); + usleep(10000); + MTR_FINISH("background", "long_running", &long_running_thing_1); + MTR_FINISH("background", "long_running", &long_running_thing_2); + + mtr_flush(); + mtr_shutdown(); + return 0; +} diff --git a/recipes/minitrace/all/test_v1_package/CMakeLists.txt b/recipes/minitrace/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/minitrace/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/minitrace/all/test_v1_package/conanfile.py b/recipes/minitrace/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/minitrace/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/minitrace/config.yml b/recipes/minitrace/config.yml new file mode 100644 index 0000000000000..384492f581d34 --- /dev/null +++ b/recipes/minitrace/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210321": + folder: all diff --git a/recipes/miniupnpc/all/conandata.yml b/recipes/miniupnpc/all/conandata.yml new file mode 100644 index 0000000000000..c414f1ae3f3a4 --- /dev/null +++ b/recipes/miniupnpc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.2.2": + url: "https://github.com/miniupnp/miniupnp/archive/refs/tags/miniupnpc_2_2_2.tar.gz" + sha256: "a598890cad635170dfce6281d71fc3052dee5c8220da0109281542156267c762" +patches: + "2.2.2": + - patch_file: "patches/0001-fix-cross-build-ios.patch" diff --git a/recipes/miniupnpc/all/conanfile.py b/recipes/miniupnpc/all/conanfile.py new file mode 100644 index 0000000000000..23ce55638aada --- /dev/null +++ b/recipes/miniupnpc/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class MiniupnpcConan(ConanFile): + name = "miniupnpc" + description = "UPnP client library/tool to access Internet Gateway Devices." + license = "BSD-3-Clause" + topics = ("upnp", "networking", "internet-gateway") + homepage = "https://github.com/miniupnp/miniupnp" + 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, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["UPNPC_BUILD_STATIC"] = not self.options.shared + tc.variables["UPNPC_BUILD_SHARED"] = self.options.shared + tc.variables["UPNPC_BUILD_TESTS"] = False + tc.variables["UPNPC_BUILD_SAMPLE"] = False + tc.variables["NO_GETADDRINFO"] = False + tc.variables["UPNPC_NO_INSTALL"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Do not force PIC + replace_in_file(self, os.path.join(self.source_folder, "miniupnpc", "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "miniupnpc")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=os.path.join(self.source_folder, "miniupnpc"), + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "miniupnpc") + self.cpp_info.set_property("cmake_target_name", "miniupnpc::miniupnpc") + self.cpp_info.set_property("pkg_config_name", "miniupnpc") + prefix = "lib" if self.settings.os == "Windows" and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}miniupnpc"] + if not self.options.shared: + self.cpp_info.defines.append("MINIUPNP_STATICLIB") + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["iphlpapi", "ws2_32"] + elif self.settings.os == "SunOS": + self.cpp_info.system_libs = ["socket", "nsl", "resolv"] diff --git a/recipes/miniupnpc/all/patches/0001-fix-cross-build-ios.patch b/recipes/miniupnpc/all/patches/0001-fix-cross-build-ios.patch new file mode 100644 index 0000000000000..d9b251737e11f --- /dev/null +++ b/recipes/miniupnpc/all/patches/0001-fix-cross-build-ios.patch @@ -0,0 +1,20 @@ +--- a/miniupnpc/CMakeLists.txt ++++ b/miniupnpc/CMakeLists.txt +@@ -29,7 +29,7 @@ if (NOT WIN32) + target_compile_definitions(miniupnpc-private INTERFACE + MINIUPNPC_SET_SOCKET_TIMEOUT + _BSD_SOURCE _DEFAULT_SOURCE) +- if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") ++ if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") + # add_definitions (-D_POSIX_C_SOURCE=200112L) + target_compile_definitions(miniupnpc-private INTERFACE _XOPEN_SOURCE=600) + endif () +@@ -37,7 +37,7 @@ else () + target_compile_definitions(miniupnpc-private INTERFACE _WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends + endif () + +-if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") ++if (APPLE) + target_compile_definitions(miniupnpc-private INTERFACE _DARWIN_C_SOURCE) + endif () + diff --git a/recipes/miniupnpc/all/test_package/CMakeLists.txt b/recipes/miniupnpc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..772ac228b58ae --- /dev/null +++ b/recipes/miniupnpc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(miniupnpc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE miniupnpc::miniupnpc) diff --git a/recipes/miniupnpc/all/test_package/conanfile.py b/recipes/miniupnpc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/miniupnpc/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/miniupnpc/all/test_package/test_package.c b/recipes/miniupnpc/all/test_package/test_package.c new file mode 100644 index 0000000000000..b7ba38ffbf1f2 --- /dev/null +++ b/recipes/miniupnpc/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +int main(void) { + const char * multicastif = 0; + const char * minissdpdpath = 0; + int localport = UPNP_LOCAL_PORT_ANY; + int ipv6 = 0; + unsigned char ttl = 2; + int error = 0; + struct UPNPDev *devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error); + return 0; +} diff --git a/recipes/miniupnpc/all/test_v1_package/CMakeLists.txt b/recipes/miniupnpc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/miniupnpc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/miniupnpc/all/test_v1_package/conanfile.py b/recipes/miniupnpc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/miniupnpc/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/miniupnpc/config.yml b/recipes/miniupnpc/config.yml new file mode 100644 index 0000000000000..6d6cfc66eae07 --- /dev/null +++ b/recipes/miniupnpc/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.2": + folder: all diff --git a/recipes/miniz/all/conandata.yml b/recipes/miniz/all/conandata.yml new file mode 100644 index 0000000000000..5be42f3eada37 --- /dev/null +++ b/recipes/miniz/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "3.0.2": + url: "https://github.com/richgel999/miniz/archive/refs/tags/3.0.2.tar.gz" + sha256: "c4b4c25a4eb81883448ff8924e6dba95c800094a198dc9ce66a292ac2ef8e018" + "3.0.1": + url: "https://github.com/richgel999/miniz/archive/refs/tags/3.0.1.tar.gz" + sha256: "53c29ed75bf1a9dd838349982ec8890f95269c422b17399d3880fd2d0f703af8" + "2.2.0": + url: "https://github.com/richgel999/miniz/archive/refs/tags/2.2.0.tar.gz" + sha256: "bd1136d0a1554520dcb527a239655777148d90fd2d51cf02c36540afc552e6ec" + "2.1.0": + url: "https://github.com/richgel999/miniz/archive/2.1.0.tar.gz" + sha256: "95f9b23c92219ad2670389a23a4ed5723b7329c82c3d933b7047673ecdfc1fea" +patches: + "2.1.0": + - patch_file: "patches/2.1.0/001-remove-examples.patch" + - patch_file: "patches/2.1.0/002-fix-shared-windows.patch" + - patch_file: "patches/2.1.0/003-include-miniz_zip.patch" diff --git a/recipes/miniz/all/conanfile.py b/recipes/miniz/all/conanfile.py new file mode 100644 index 0000000000000..a90739b0d0d4e --- /dev/null +++ b/recipes/miniz/all/conanfile.py @@ -0,0 +1,80 @@ +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.53.0" + + +class MinizConan(ConanFile): + name = "miniz" + description = "Lossless, high performance data compression library that " \ + "implements the zlib (RFC 1950) and Deflate (RFC 1951) " \ + "compressed data format specification standards" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/richgel999/miniz" + topics = ("zlib", "compression", "lossless") + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "2.2.0": + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_FUZZERS"] = False + tc.variables["AMALGAMATE_SOURCES"] = False + tc.variables["BUILD_HEADER_ONLY"] = False + tc.variables["INSTALL_PROJECT"] = True + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "miniz") + self.cpp_info.set_property("cmake_target_name", "miniz::miniz") + self.cpp_info.set_property("pkg_config_name", "miniz") + self.cpp_info.libs = ["miniz"] + self.cpp_info.includedirs.append(os.path.join("include", "miniz")) diff --git a/recipes/miniz/all/patches/2.1.0/001-remove-examples.patch b/recipes/miniz/all/patches/2.1.0/001-remove-examples.patch new file mode 100644 index 0000000000000..8f9cfd0ef7b77 --- /dev/null +++ b/recipes/miniz/all/patches/2.1.0/001-remove-examples.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f3e453a..4d8d385 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,31 +15,6 @@ set(miniz_SOURCE miniz.c miniz_zip.c miniz_tinfl.c miniz_tdef.c) + add_library(miniz ${miniz_SOURCE}) + target_include_directories(miniz PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") + +-set(EXAMPLE1_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example1.c") +-set(EXAMPLE2_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example2.c") +-set(EXAMPLE3_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example3.c") +-set(EXAMPLE4_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example4.c") +-set(EXAMPLE5_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example5.c") +-set(EXAMPLE6_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example6.c") +-set(MINIZ_TESTER_SRC_LIST +- "${CMAKE_CURRENT_SOURCE_DIR}/tests/miniz_tester.cpp" +- "${CMAKE_CURRENT_SOURCE_DIR}/tests/timer.cpp") +- +-add_executable(example1 ${EXAMPLE1_SRC_LIST}) +-target_link_libraries(example1 miniz) +-add_executable(example2 ${EXAMPLE2_SRC_LIST}) +-target_link_libraries(example2 miniz) +-add_executable(example3 ${EXAMPLE3_SRC_LIST}) +-target_link_libraries(example3 miniz) +-add_executable(example4 ${EXAMPLE4_SRC_LIST}) +-target_link_libraries(example4 miniz) +-add_executable(example5 ${EXAMPLE5_SRC_LIST}) +-target_link_libraries(example5 miniz) +-add_executable(example6 ${EXAMPLE6_SRC_LIST}) +-target_link_libraries(example6 miniz) +-if(${UNIX}) +- target_link_libraries(example6 m) +-endif() + + # add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST}) + # target_link_libraries(miniz_tester miniz) diff --git a/recipes/miniz/all/patches/2.1.0/002-fix-shared-windows.patch b/recipes/miniz/all/patches/2.1.0/002-fix-shared-windows.patch new file mode 100644 index 0000000000000..dba1eeea002c2 --- /dev/null +++ b/recipes/miniz/all/patches/2.1.0/002-fix-shared-windows.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4d8d385..7db30dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ ++cmake_minimum_required(VERSION 3.4) + PROJECT(miniz C) +-cmake_minimum_required(VERSION 2.8) + if(CMAKE_BUILD_TYPE STREQUAL "") + # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up + # differentiation between debug and release builds. +@@ -14,12 +14,14 @@ set(miniz_SOURCE miniz.c miniz_zip.c miniz_tinfl.c miniz_tdef.c) + + add_library(miniz ${miniz_SOURCE}) + target_include_directories(miniz PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") ++set_property(TARGET miniz PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) + + + # add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST}) + # target_link_libraries(miniz_tester miniz) + + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + ) diff --git a/recipes/miniz/all/patches/2.1.0/003-include-miniz_zip.patch b/recipes/miniz/all/patches/2.1.0/003-include-miniz_zip.patch new file mode 100644 index 0000000000000..89caafe29a84c --- /dev/null +++ b/recipes/miniz/all/patches/2.1.0/003-include-miniz_zip.patch @@ -0,0 +1,8 @@ +--- a/miniz.h ++++ b/miniz.h +@@ -475,3 +475,5 @@ typedef void *const voidpc; + #ifdef __cplusplus + } + #endif ++ ++#include "miniz_zip.h" diff --git a/recipes/miniz/all/test_package/CMakeLists.txt b/recipes/miniz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..90738d68add27 --- /dev/null +++ b/recipes/miniz/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(miniz REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE miniz::miniz) diff --git a/recipes/miniz/all/test_package/conanfile.py b/recipes/miniz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a8c6c5442b33 --- /dev/null +++ b/recipes/miniz/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import cross_building +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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/miniz/all/test_package/test_package.c b/recipes/miniz/all/test_package/test_package.c new file mode 100644 index 0000000000000..635fa68ad3667 --- /dev/null +++ b/recipes/miniz/all/test_package/test_package.c @@ -0,0 +1,105 @@ +#include + +#include + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint; + +// The string to compress. +static const char *s_pStr = "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \ + "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \ + "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \ + "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \ + "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \ + "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \ + "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson."; + +int main(int argc, char *argv[]) +{ + uint step = 0; + int cmp_status; + uLong src_len = (uLong)strlen(s_pStr); + uLong cmp_len = compressBound(src_len); + uLong uncomp_len = src_len; + uint8 *pCmp, *pUncomp; + uint total_succeeded = 0; + (void)argc, (void)argv; + + printf("miniz.c version: %s\n", MZ_VERSION); + + do + { + // Allocate buffers to hold compressed and uncompressed data. + pCmp = (mz_uint8 *)malloc((size_t)cmp_len); + pUncomp = (mz_uint8 *)malloc((size_t)src_len); + if ((!pCmp) || (!pUncomp)) + { + printf("Out of memory!\n"); + return EXIT_FAILURE; + } + + // Compress the string. + cmp_status = compress(pCmp, &cmp_len, (const unsigned char *)s_pStr, src_len); + if (cmp_status != Z_OK) + { + printf("compress() failed!\n"); + free(pCmp); + free(pUncomp); + return EXIT_FAILURE; + } + + printf("Compressed from %u to %u bytes\n", (mz_uint32)src_len, (mz_uint32)cmp_len); + + if (step) + { + // Purposely corrupt the compressed data if fuzzy testing (this is a very crude fuzzy test). + uint n = 1 + (rand() % 3); + while (n--) + { + uint i = rand() % cmp_len; + pCmp[i] ^= (rand() & 0xFF); + } + } + + // Decompress. + cmp_status = uncompress(pUncomp, &uncomp_len, pCmp, cmp_len); + total_succeeded += (cmp_status == Z_OK); + + if (step) + { + printf("Simple fuzzy test: step %u total_succeeded: %u\n", step, total_succeeded); + } + else + { + if (cmp_status != Z_OK) + { + printf("uncompress failed!\n"); + free(pCmp); + free(pUncomp); + return EXIT_FAILURE; + } + + printf("Decompressed from %u to %u bytes\n", (mz_uint32)cmp_len, (mz_uint32)uncomp_len); + + // Ensure uncompress() returned the expected data. + if ((uncomp_len != src_len) || (memcmp(pUncomp, s_pStr, (size_t)src_len))) + { + printf("Decompression failed!\n"); + free(pCmp); + free(pUncomp); + return EXIT_FAILURE; + } + } + + free(pCmp); + free(pUncomp); + + step++; + + // Keep on fuzzy testing if there's a non-empty command line. + } while (argc >= 2); + + printf("Success.\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/miniz/all/test_v1_package/CMakeLists.txt b/recipes/miniz/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/miniz/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/miniz/all/test_v1_package/conanfile.py b/recipes/miniz/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/miniz/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/miniz/config.yml b/recipes/miniz/config.yml new file mode 100644 index 0000000000000..7c99dc2de1035 --- /dev/null +++ b/recipes/miniz/config.yml @@ -0,0 +1,9 @@ +versions: + "3.0.2": + folder: all + "3.0.1": + folder: all + "2.2.0": + folder: all + "2.1.0": + folder: all diff --git a/recipes/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml new file mode 100644 index 0000000000000..cb0fe2c9abad5 --- /dev/null +++ b/recipes/minizip-ng/all/conandata.yml @@ -0,0 +1,93 @@ +sources: + "3.0.9": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.9.tar.gz" + sha256: "992693a532eb15b20d306e6aeea1a1a6501bd19dca993ebe9a95fd22d6b7fd74" + "3.0.8": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.8.tar.gz" + sha256: "27cc2f62cd02d79b71b346fc6ace02728385f8ba9c6b5f124062b0790a04629a" + "3.0.7": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.7.tar.gz" + sha256: "39981a0db1bb6da504909bce63d7493286c5e50825c056564544c990d15c55cf" + "3.0.6": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.6.tar.gz" + sha256: "383fa1bdc28c482828a8a8db53f758dbd44291b641182724fda5df5b59cce543" + "3.0.5": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.5.tar.gz" + sha256: "1a248c378fdf4ef6c517024bb65577603d5146cffaebe81900bec9c0a5035d4d" + "3.0.4": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.4.tar.gz" + sha256: "2ab219f651901a337a7d3c268128711b80330a99ea36bdc528c76b591a624c3c" + "3.0.3": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.3.tar.gz" + sha256: "5f1dd0d38adbe9785cb9c4e6e47738c109d73a0afa86e58c4025ce3e2cc504ed" + "3.0.2": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.2.tar.gz" + sha256: "6ba4b6629c107c27ab526e517bdb105612232f0965a6747f60150e5a04c2fe5a" + "3.0.1": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.1.tar.gz" + sha256: "96c95b274dd535984ce0e87691691388f2b976106e8cf8d527b15da552ac94e4" +patches: + "3.0.9": + - patch_file: "patches/3.0.9-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + "3.0.8": + - patch_file: "patches/3.0.8-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + "3.0.7": + - patch_file: "patches/3.0.7-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.6-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" + "3.0.6": + - patch_file: "patches/3.0.6-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.6-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" + "3.0.5": + - patch_file: "patches/3.0.5-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.5-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" + "3.0.4": + - patch_file: "patches/3.0.4-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" + "3.0.3": + - patch_file: "patches/3.0.3-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" + "3.0.2": + - patch_file: "patches/3.0.2-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" + "3.0.1": + - patch_file: "patches/3.0.1-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" + - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" + patch_description: "CMake: inject libdir of lzma" + patch_type: "conan" + patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" diff --git a/recipes/minizip-ng/all/conanfile.py b/recipes/minizip-ng/all/conanfile.py new file mode 100644 index 0000000000000..a4e9fe7489e1e --- /dev/null +++ b/recipes/minizip-ng/all/conanfile.py @@ -0,0 +1,194 @@ +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.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class MinizipNgConan(ConanFile): + name = "minizip-ng" + description = "Fork of the popular zip manipulation library found in the zlib distribution." + topics = ("compression", "zip") + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zlib-ng/minizip-ng" + license = "Zlib" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "mz_compatibility": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "with_lzma": [True, False], + "with_zstd": [True, False], + "with_openssl": [True, False], + "with_iconv": [True, False], + "with_libbsd": [True, False], + "with_libcomp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "mz_compatibility": False, + "with_zlib": True, + "with_bzip2": True, + "with_lzma": True, + "with_zstd": True, + "with_openssl": True, + "with_iconv": True, + "with_libbsd": True, + "with_libcomp": True, + } + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + @property + def _needs_pkg_config(self): + return self.options.with_lzma or self.options.with_zstd or self.options.with_openssl + + 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_iconv + del self.options.with_libbsd + if not is_apple_os(self): + del self.options.with_libcomp + + 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.mz_compatibility: + self.provides = "minizip" + if self.options.get_safe("with_libcomp"): + del self.options.with_zlib + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_zlib"): + self.requires("zlib/1.2.13") + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.with_lzma: + self.requires("xz_utils/5.4.2") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.settings.os != "Windows": + if self.options.get_safe("with_iconv"): + self.requires("libiconv/1.17") + + def build_requirements(self): + if self._needs_pkg_config: + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self._needs_pkg_config: + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["MZ_FETCH_LIBS"] = False + tc.cache_variables["MZ_COMPAT"] = self.options.mz_compatibility + tc.cache_variables["MZ_ZLIB"] = self.options.get_safe("with_zlib", False) + tc.cache_variables["MZ_BZIP2"] = self.options.with_bzip2 + tc.cache_variables["MZ_LZMA"] = self.options.with_lzma + tc.cache_variables["MZ_ZSTD"] = self.options.with_zstd + tc.cache_variables["MZ_OPENSSL"] = self.options.with_openssl + tc.cache_variables["MZ_LIBCOMP"] = self.options.get_safe("with_libcomp", False) + if self.settings.os != "Windows": + tc.cache_variables["MZ_ICONV"] = self.options.with_iconv + tc.cache_variables["MZ_LIBBSD"] = self.options.with_libbsd + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if self._needs_pkg_config: + deps = PkgConfigDeps(self) + deps.generate() + # TODO: to remove when properly handled by conan (see https://github.com/conan-io/conan/issues/11962) + env = Environment() + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuild_pkg_config_path") + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE 1)", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "minizip") + self.cpp_info.set_property("cmake_target_name", "MINIZIP::minizip") + self.cpp_info.set_property("pkg_config_name", "minizip") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + prefix = "lib" if is_msvc(self) or self._is_clang_cl else "" + suffix = "" if Version(self.version) < "3.0.5" or self.options.mz_compatibility else "-ng" + self.cpp_info.components["minizip"].libs = [f"{prefix}minizip{suffix}"] + if self.options.with_lzma: + self.cpp_info.components["minizip"].defines.append("HAVE_LZMA") + if is_apple_os(self) and self.options.get_safe("with_libcomp"): + self.cpp_info.components["minizip"].defines.append("HAVE_LIBCOMP") + if self.options.with_bzip2: + self.cpp_info.components["minizip"].defines.append("HAVE_BZIP2") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "minizip" + self.cpp_info.filenames["cmake_find_package_multi"] = "minizip" + self.cpp_info.names["cmake_find_package"] = "MINIZIP" + self.cpp_info.names["cmake_find_package_multi"] = "MINIZIP" + self.cpp_info.components["minizip"].names["cmake_find_package"] = "minizip" + self.cpp_info.components["minizip"].names["cmake_find_package_multi"] = "minizip" + self.cpp_info.components["minizip"].set_property("cmake_target_name", "MINIZIP::minizip") + self.cpp_info.components["minizip"].set_property("pkg_config_name", "minizip") + if self.options.get_safe("with_zlib"): + self.cpp_info.components["minizip"].requires.append("zlib::zlib") + if self.options.with_bzip2: + self.cpp_info.components["minizip"].requires.append("bzip2::bzip2") + if self.options.with_lzma: + self.cpp_info.components["minizip"].requires.append("xz_utils::xz_utils") + if self.options.with_zstd: + self.cpp_info.components["minizip"].requires.append("zstd::zstd") + if self.options.with_openssl: + self.cpp_info.components["minizip"].requires.append("openssl::openssl") + elif is_apple_os(self): + self.cpp_info.components["minizip"].frameworks.extend(["CoreFoundation", "Security"]) + 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/all/patches/3.0.1-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.1-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..c44b1784ce620 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.1-0001-fix-cmake-project.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,10 +63,10 @@ endif() + # BZIP2_ROOT - Parent directory of BZip2 installation + # OPENSSL_ROOT - Parent directory of OpenSSL installation + +-enable_language(C) + + # Library version + set(VERSION "3.0.1") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3.0") +@@ -677,7 +677,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.1-0002-fix-lzma-libdir.patch b/recipes/minizip-ng/all/patches/3.0.1-0002-fix-lzma-libdir.patch new file mode 100644 index 0000000000000..cb1ecba6e8149 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.1-0002-fix-lzma-libdir.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -312,6 +312,7 @@ if(MZ_LZMA) + + list(APPEND MINIZIP_INC ${LIBLZMA_INCLUDE_DIRS}) + list(APPEND MINIZIP_LIB ${LIBLZMA_LIBRARIES}) ++ list(APPEND MINIZIP_LBD ${LIBLZMA_LIBRARY_DIRS}) + + set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lliblzma") + elseif(MZ_FETCH_LIBS) diff --git a/recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..8cfa267f8cff7 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,10 +63,10 @@ endif() + # BZIP2_ROOT - Parent directory of BZip2 installation + # OPENSSL_ROOT - Parent directory of OpenSSL installation + +-enable_language(C) + + # Library version + set(VERSION "3.0.2") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3.0") +@@ -681,7 +681,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..484eb23a91671 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,10 +63,10 @@ endif() + # BZIP2_ROOT - Parent directory of BZip2 installation + # OPENSSL_ROOT - Parent directory of OpenSSL installation + +-enable_language(C) + + # Library version + set(VERSION "3.0.3") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -681,7 +681,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.4-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.4-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..5ae134194c263 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.4-0001-fix-cmake-project.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,10 +63,10 @@ endif() + # BZIP2_ROOT - Parent directory of BZip2 installation + # OPENSSL_ROOT - Parent directory of OpenSSL installation + +-enable_language(C) + + # Library version + set(VERSION "3.0.4") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -681,7 +681,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.5-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.5-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..bc28f8055105e --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.5-0001-fix-cmake-project.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,10 +66,10 @@ endif() + # BZIP2_ROOT - Parent directory of BZip2 installation + # OPENSSL_ROOT - Parent directory of OpenSSL installation + +-enable_language(C) + + # Library version + set(VERSION "3.0.5") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -661,7 +661,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.5-0002-fix-lzma-libdir.patch b/recipes/minizip-ng/all/patches/3.0.5-0002-fix-lzma-libdir.patch new file mode 100644 index 0000000000000..0e4b01050297b --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.5-0002-fix-lzma-libdir.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -303,6 +303,7 @@ if(MZ_LZMA) + + list(APPEND MINIZIP_INC ${LIBLZMA_INCLUDE_DIRS}) + list(APPEND MINIZIP_LIB ${LIBLZMA_LIBRARIES}) ++ list(APPEND MINIZIP_LBD ${LIBLZMA_LIBRARY_DIRS}) + + set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lliblzma") + elseif(MZ_FETCH_LIBS) diff --git a/recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..e08990e93540e --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,6 +70,7 @@ enable_language(C) + + # Library version + set(VERSION "3.0.6") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -663,7 +664,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.6-0002-fix-lzma-libdir.patch b/recipes/minizip-ng/all/patches/3.0.6-0002-fix-lzma-libdir.patch new file mode 100644 index 0000000000000..5e74ea2fc0802 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.6-0002-fix-lzma-libdir.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -304,6 +304,7 @@ if(MZ_LZMA) + + list(APPEND MINIZIP_INC ${LIBLZMA_INCLUDE_DIRS}) + list(APPEND MINIZIP_LIB ${LIBLZMA_LIBRARIES}) ++ list(APPEND MINIZIP_LBD ${LIBLZMA_LIBRARY_DIRS}) + + set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lliblzma") + elseif(MZ_FETCH_LIBS) diff --git a/recipes/minizip-ng/all/patches/3.0.7-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.7-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..5f9e5f69169bc --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.7-0001-fix-cmake-project.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,6 +70,7 @@ enable_language(C) + + # Library version + set(VERSION "3.0.7") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -670,7 +671,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.8-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.8-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..608ac1f98c9c7 --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.8-0001-fix-cmake-project.patch @@ -0,0 +1,20 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index a073919..7ff2b58 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -70,6 +70,7 @@ enable_language(C) + + # Library version + set(VERSION "3.0.8") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -663,7 +664,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.9-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.9-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..d91daa9764fda --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.9-0001-fix-cmake-project.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index be7205c..cad8d50 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,6 +80,7 @@ enable_language(C) + + # Library version + set(VERSION "3.0.9") ++project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) + + # API version + set(SOVERSION "3") +@@ -665,7 +666,6 @@ endif() + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C VERSION ${VERSION}) + + if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") + message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/test_package/CMakeLists.txt b/recipes/minizip-ng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db0b9a15e540e --- /dev/null +++ b/recipes/minizip-ng/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(minizip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE MINIZIP::minizip) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/minizip-ng/all/test_package/conanfile.py b/recipes/minizip-ng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/minizip-ng/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/minizip-ng/all/test_package/test_package.c b/recipes/minizip-ng/all/test_package/test_package.c new file mode 100644 index 0000000000000..0c82478f58bb9 --- /dev/null +++ b/recipes/minizip-ng/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include +#include + +int main(int argc, char** argv) +{ + char output[256]; + memset(output, 'z', sizeof(output)); + int32_t err = mz_path_resolve("c:\\test\\.", output, sizeof(output)); + int32_t ok = (strcmp(output, "c:\\test\\") == 0); + return EXIT_SUCCESS; +} diff --git a/recipes/minizip-ng/all/test_v1_package/CMakeLists.txt b/recipes/minizip-ng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/minizip-ng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/minizip-ng/all/test_v1_package/conanfile.py b/recipes/minizip-ng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/minizip-ng/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/minizip-ng/config.yml b/recipes/minizip-ng/config.yml new file mode 100644 index 0000000000000..d293a6987b124 --- /dev/null +++ b/recipes/minizip-ng/config.yml @@ -0,0 +1,19 @@ +versions: + "3.0.9": + folder: all + "3.0.8": + folder: all + "3.0.7": + folder: all + "3.0.6": + folder: all + "3.0.5": + folder: all + "3.0.4": + folder: all + "3.0.3": + folder: all + "3.0.2": + folder: all + "3.0.1": + folder: all diff --git a/recipes/minizip/all/CMakeLists.txt b/recipes/minizip/all/CMakeLists.txt new file mode 100644 index 0000000000000..c17b5f7dd7466 --- /dev/null +++ b/recipes/minizip/all/CMakeLists.txt @@ -0,0 +1,75 @@ +cmake_minimum_required(VERSION 3.4) +project(minizip LANGUAGES C) + +option(MINIZIP_ENABLE_BZIP2 "Build minizip with bzip2 support" ON) +option(MINIZIP_BUILD_TOOLS "Build minizip tool" OFF) + +include(GNUInstallDirs) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + +find_package(ZLIB REQUIRED) +if(MINIZIP_ENABLE_BZIP2) + find_package(BZip2 REQUIRED) +endif() + +set(SOURCE_FILES + ${MINIZIP_SRC_DIR}/ioapi.c + ${MINIZIP_SRC_DIR}/unzip.c + ${MINIZIP_SRC_DIR}/zip.c + ${MINIZIP_SRC_DIR}/mztools.c +) +if(WIN32) + list(APPEND SOURCE_FILES ${MINIZIP_SRC_DIR}/iowin32.c) +endif() + +set(HEADER_FILES + ${MINIZIP_SRC_DIR}/ioapi.h + ${MINIZIP_SRC_DIR}/unzip.h + ${MINIZIP_SRC_DIR}/zip.h + ${MINIZIP_SRC_DIR}/mztools.h +) +if(WIN32) + list(APPEND HEADER_FILES ${MINIZIP_SRC_DIR}/iowin32.h) +endif() + +add_library(minizip ${SOURCE_FILES}) +target_link_libraries(minizip PUBLIC ZLIB::ZLIB) +target_compile_definitions(minizip PRIVATE -D_ZLIB_H) +target_include_directories(minizip PUBLIC ${MINIZIP_SRC_DIR}) +set_target_properties(minizip PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +if(MINIZIP_ENABLE_BZIP2) + target_compile_definitions(minizip PUBLIC HAVE_BZIP2=1) + target_link_libraries(minizip PUBLIC BZip2::BZip2) +endif() +if(MSVC) + target_compile_options(minizip PRIVATE /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) +endif() + +install( + TARGETS minizip + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/minizip) + +if(MINIZIP_BUILD_TOOLS) + add_executable(minizip_bin ${MINIZIP_SRC_DIR}/minizip.c) + add_executable(miniunz_bin ${MINIZIP_SRC_DIR}/miniunz.c) + + target_link_libraries(minizip_bin PRIVATE minizip) + target_link_libraries(miniunz_bin PRIVATE minizip) + + set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) + set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) + + if(MSVC) + target_compile_options(minizip_bin PRIVATE /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) + target_compile_options(miniunz_bin PRIVATE /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) + endif() + + install(TARGETS minizip_bin miniunz_bin DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/minizip/all/conandata.yml b/recipes/minizip/all/conandata.yml new file mode 100644 index 0000000000000..d1d3166de347b --- /dev/null +++ b/recipes/minizip/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.2.13": + url: "https://zlib.net/fossils/zlib-1.2.13.tar.gz" + sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" + "1.2.12": + url: "https://zlib.net/fossils/zlib-1.2.12.tar.gz" + sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" + "1.2.11": + url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" + sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" +patches: + "1.2.13": + - patch_file: "patches/minizip.patch" + "1.2.12": + - patch_file: "patches/minizip.patch" + - patch_file: "patches/ioapi.patch" + "1.2.11": + - patch_file: "patches/minizip.patch" + - patch_file: "patches/miniunz.patch" diff --git a/recipes/minizip/all/conanfile.py b/recipes/minizip/all/conanfile.py new file mode 100644 index 0000000000000..e4316426a6e9c --- /dev/null +++ b/recipes/minizip/all/conanfile.py @@ -0,0 +1,90 @@ +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, load, save +import os + +required_conan_version = ">=1.53.0" + + +class MinizipConan(ConanFile): + name = "minizip" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://zlib.net" + license = "Zlib" + description = "An experimental package to read and write files in .zip format, written on top of zlib" + topics = ("zip", "compression", "inflate") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "bzip2": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "bzip2": True, + "tools": False, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + 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.13", transitive_headers=True) + if self.options.bzip2: + self.requires("bzip2/1.0.8", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MINIZIP_SRC_DIR"] = os.path.join(self.source_folder, "contrib", "minizip").replace("\\", "/") + tc.variables["MINIZIP_ENABLE_BZIP2"] = self.options.bzip2 + tc.variables["MINIZIP_BUILD_TOOLS"] = self.options.tools + # fopen64 and similar are unavailable before API level 24: https://github.com/madler/zlib/pull/436 + if self.settings.os == "Android" and int(str(self.settings.os.api_level)) < 24: + tc.preprocessor_definitions["IOAPI_NO_64"] = "1" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + zlib_h = load(self, os.path.join(self.source_folder, "zlib.h")) + return zlib_h[2:zlib_h.find("*/", 1)] + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["minizip"] + self.cpp_info.includedirs.append(os.path.join("include", "minizip")) + if self.options.bzip2: + self.cpp_info.defines.append("HAVE_BZIP2") + + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/minizip/all/patches/ioapi.patch b/recipes/minizip/all/patches/ioapi.patch new file mode 100644 index 0000000000000..8ab56b08bf0aa --- /dev/null +++ b/recipes/minizip/all/patches/ioapi.patch @@ -0,0 +1,102 @@ +--- a/contrib/minizip/ioapi.c ++++ b/contrib/minizip/ioapi.c +@@ -94,9 +94,9 @@ static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); + + static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) + { +- (void)opaque; + FILE* file = NULL; + const char* mode_fopen = NULL; ++ (void)opaque; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else +@@ -113,9 +113,9 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in + + static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) + { +- (void)opaque; + FILE* file = NULL; + const char* mode_fopen = NULL; ++ (void)opaque; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else +@@ -133,24 +133,24 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, + + static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) + { +- (void)opaque; + uLong ret; ++ (void)opaque; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; + } + + static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) + { +- (void)opaque; + uLong ret; ++ (void)opaque; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; + } + + static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) + { +- (void)opaque; + long ret; ++ (void)opaque; + ret = ftell((FILE *)stream); + return ret; + } +@@ -158,17 +158,17 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) + + static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) + { +- (void)opaque; + ZPOS64_T ret; ++ (void)opaque; + ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream); + return ret; + } + + static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) + { +- (void)opaque; + int fseek_origin=0; + long ret; ++ (void)opaque; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : +@@ -190,9 +190,9 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs + + static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) + { +- (void)opaque; + int fseek_origin=0; + long ret; ++ (void)opaque; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : +@@ -217,16 +217,16 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T + + static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) + { +- (void)opaque; + int ret; ++ (void)opaque; + ret = fclose((FILE *)stream); + return ret; + } + + static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) + { +- (void)opaque; + int ret; ++ (void)opaque; + ret = ferror((FILE *)stream); + return ret; + } diff --git a/recipes/minizip/all/patches/miniunz.patch b/recipes/minizip/all/patches/miniunz.patch new file mode 100644 index 0000000000000..a9b42551ba7c7 --- /dev/null +++ b/recipes/minizip/all/patches/miniunz.patch @@ -0,0 +1,11 @@ +--- a/contrib/minizip/miniunz.c ++++ b/contrib/minizip/miniunz.c +@@ -52,6 +52,8 @@ + #else + # include + # include ++#include ++#include + #endif + + diff --git a/recipes/minizip/all/patches/minizip.patch b/recipes/minizip/all/patches/minizip.patch new file mode 100644 index 0000000000000..51ec03ade115b --- /dev/null +++ b/recipes/minizip/all/patches/minizip.patch @@ -0,0 +1,16 @@ +diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c +index f12e3329..bfc05f77 100644 +--- a/contrib/minizip/unzip.c ++++ b/contrib/minizip/unzip.c +@@ -68,10 +68,6 @@ + #include + #include + +-#ifndef NOUNCRYPT +- #define NOUNCRYPT +-#endif +- + #include "zlib.h" + #include "unzip.h" + + diff --git a/recipes/minizip/all/test_package/CMakeLists.txt b/recipes/minizip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b56bb073cf606 --- /dev/null +++ b/recipes/minizip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(minizip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minizip::minizip) diff --git a/recipes/minizip/all/test_package/conanfile.py b/recipes/minizip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/minizip/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/minizip/all/test_package/test_package.c b/recipes/minizip/all/test_package/test_package.c new file mode 100644 index 0000000000000..46d12fc8ea16c --- /dev/null +++ b/recipes/minizip/all/test_package/test_package.c @@ -0,0 +1,52 @@ +#include +#include +#include + +#include +#include +#ifdef _WIN32 + #include +#endif + +#include + +const char text[] = "Conveying or northward offending admitting perfectly my."; +const char* zip_fname = "test_minizip.zip"; + +int main(int argc, char** argv) { + zipFile zf = zipOpen64(zip_fname, APPEND_STATUS_CREATE); + if (zf == NULL) { + printf("Error in zipOpen64, fname: %s\n", zip_fname); + exit(EXIT_FAILURE); + } + + int res; + zip_fileinfo zfi = {0}; + res = zipOpenNewFileInZip64(zf, "fname.bin", &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_COMPRESSION, 0); + if (res != ZIP_OK) { + printf("Error in zipOpenNewFileInZip64, code: %d\n", res); + exit(EXIT_FAILURE); + } + + res = zipWriteInFileInZip(zf, text, sizeof(text)); + if (res != ZIP_OK) { + printf("Error in zipWriteInFileInZip, code: %d\n", res); + exit(EXIT_FAILURE); + } + + res = zipCloseFileInZip(zf); + if (res != ZIP_OK) { + printf("Error in zipCloseFileInZip, code: %d\n", res); + exit(EXIT_FAILURE); + } + + res = zipClose(zf, "Test MiniZip"); + if(res != ZIP_OK) { + printf("Error in zipClose, code: %d\n", res); + exit(EXIT_FAILURE); + } + + printf("ZIP file created, name: %s\n", zip_fname); + + return EXIT_SUCCESS; +} diff --git a/recipes/minizip/all/test_v1_package/CMakeLists.txt b/recipes/minizip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/minizip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/minizip/all/test_v1_package/conanfile.py b/recipes/minizip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/minizip/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/minizip/config.yml b/recipes/minizip/config.yml new file mode 100644 index 0000000000000..351c06f68201f --- /dev/null +++ b/recipes/minizip/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.13": + folder: all + "1.2.12": + folder: all + "1.2.11": + folder: all diff --git a/recipes/mio/all/conandata.yml b/recipes/mio/all/conandata.yml new file mode 100644 index 0000000000000..fdad8f55da413 --- /dev/null +++ b/recipes/mio/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "cci.20201220": + url: "https://github.com/mandreyel/mio/archive/3f86a95c0784d73ce6815237ec33ed25f233b643.tar.gz" + sha256: "056ae59d63c5d7f34dd90510adf2996ef1c4c17ec2b26ba9c9cb9974025b2c2c" + "cci.20230303": + url: "https://github.com/mandreyel/mio/archive/8b6b7d878c89e81614d05edca7936de41ccdd2da.tar.gz" + sha256: "86248113BB2F1484F9CD44A260FE09BEAA911307073C6F21FA9E765588D54B4B" +patches: + "cci.20201220": + - patch_file: "patches/0001-fix-include-windows.patch" + patch_source: "https://github.com/mandreyel/mio/pull/73" diff --git a/recipes/mio/all/conanfile.py b/recipes/mio/all/conanfile.py new file mode 100644 index 0000000000000..469a34156ae79 --- /dev/null +++ b/recipes/mio/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class MioConan(ConanFile): + name = "mio" + description = "Cross-platform C++11 header-only library for memory mapped file IO." + license = "MIT" + topics = ("mio", "mmap", "memory-mapping", "fileviewer") + homepage = "https://github.com/mandreyel/mio" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*pp", 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_file_name", "mio") + self.cpp_info.set_property("cmake_target_name", "mio::mio") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.components["mio-headers"].set_property("cmake_target_name", "mio::mio-headers") + self.cpp_info.components["mio-headers"].bindirs = [] + self.cpp_info.components["mio-headers"].frameworkdirs = [] + self.cpp_info.components["mio-headers"].libdirs = [] + self.cpp_info.components["mio-headers"].resdirs = [] + + if self.settings.os == "Windows": + self.cpp_info.components["mio_full_winapi"].set_property("cmake_target_name", "mio::mio_full_winapi") + self.cpp_info.components["mio_full_winapi"].bindirs = [] + self.cpp_info.components["mio_full_winapi"].frameworkdirs = [] + self.cpp_info.components["mio_full_winapi"].libdirs = [] + self.cpp_info.components["mio_full_winapi"].resdirs = [] + + self.cpp_info.components["mio_min_winapi"].set_property("cmake_target_name", "mio::mio_min_winapi") + self.cpp_info.components["mio_min_winapi"].defines = ["WIN32_LEAN_AND_MEAN", "NOMINMAX"] + self.cpp_info.components["mio_min_winapi"].bindirs = [] + self.cpp_info.components["mio_min_winapi"].frameworkdirs = [] + self.cpp_info.components["mio_min_winapi"].libdirs = [] + self.cpp_info.components["mio_min_winapi"].resdirs = [] diff --git a/recipes/mio/all/patches/0001-fix-include-windows.patch b/recipes/mio/all/patches/0001-fix-include-windows.patch new file mode 100644 index 0000000000000..d28f9c1bfe1bd --- /dev/null +++ b/recipes/mio/all/patches/0001-fix-include-windows.patch @@ -0,0 +1,13 @@ +--- a/include/mio/detail/mmap.ipp ++++ b/include/mio/detail/mmap.ipp +@@ -27,7 +27,9 @@ + + #include + +-#ifndef _WIN32 ++#ifdef _WIN32 ++# include ++#else + # include + # include + # include diff --git a/recipes/mio/all/test_package/CMakeLists.txt b/recipes/mio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dd4a0cd1a355b --- /dev/null +++ b/recipes/mio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mio::mio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mio/all/test_package/conanfile.py b/recipes/mio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/mio/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/mio/all/test_package/test_package.cpp b/recipes/mio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aeb37b6519b6f --- /dev/null +++ b/recipes/mio/all/test_package/test_package.cpp @@ -0,0 +1,51 @@ +#include + +#include +#include +#include +#include +#include + +int handle_error(const std::error_code &error) { + const auto &errmsg = error.message(); + std::printf("error mapping file: %s, exiting...\n", errmsg.c_str()); + return error.value(); +} + +void allocate_file(const std::string &path, const int size) { + std::ofstream file(path); + std::string s(size, '0'); + file << s; +} + +int main() { + const auto path = "file.txt"; + allocate_file(path, 155); + + std::error_code error; + mio::mmap_sink rw_mmap = mio::make_mmap_sink(path, 0, mio::map_entire_file, error); + if (error) { return handle_error(error); } + + std::fill(rw_mmap.begin(), rw_mmap.end(), 'a'); + + for (auto &b : rw_mmap) { + b += 10; + } + + const int answer_index = rw_mmap.size() / 2; + rw_mmap[answer_index] = 42; + + rw_mmap.sync(error); + if (error) { return handle_error(error); } + + rw_mmap.unmap(); + + mio::mmap_source ro_mmap; + ro_mmap.map(path, error); + if (error) { return handle_error(error); } + + const int the_answer_to_everything = ro_mmap[answer_index]; + assert(the_answer_to_everything == 42); + + return 0; +} diff --git a/recipes/mio/all/test_v1_package/CMakeLists.txt b/recipes/mio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..84deeaa812c31 --- /dev/null +++ b/recipes/mio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mio::mio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mio/all/test_v1_package/conanfile.py b/recipes/mio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mio/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/mio/config.yml b/recipes/mio/config.yml new file mode 100644 index 0000000000000..ce9e92b9275c8 --- /dev/null +++ b/recipes/mio/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20201220": + folder: all + "cci.20230303": + folder: all diff --git a/recipes/modern-cpp-kafka/all/conandata.yml b/recipes/modern-cpp-kafka/all/conandata.yml new file mode 100644 index 0000000000000..11b37a50dbe81 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2023.03.07": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2023.03.07.tar.gz" + sha256: "4685527a9768d44ed769ec6e502c3edde0b5cf4d341d8f9b476474955c61bba4" + "2023.01.05": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2023.01.05.tar.gz" + sha256: "3ac5256b7b16bab020b32ac048cf53fddc3353682068bb727eb7c95550598b9b" + "2022.12.07": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.12.07.tar.gz" + sha256: "980533fe5e0f5630d7deab6567ed051cf51d61ac341e4a75810f68d58cbff439" + "2022.10.12": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.10.12.tar.gz" + sha256: "f60c6d6328e64a8ae0c3233921078160fc4e42a3484eb823d9918895f5f1b39f" + "2022.08.01": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.08.01.tar.gz" + sha256: "77998caf50ffcc55c77713571d9ce04a37020ccff7b713d14abad9eb8ceb05b3" + "2022.06.15": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/refs/tags/v2022.06.15.tar.gz" + sha256: "478fcf560057b7cf7b4be851838ebf0520806d057b172de23261606fce088d27" diff --git a/recipes/modern-cpp-kafka/all/conanfile.py b/recipes/modern-cpp-kafka/all/conanfile.py new file mode 100644 index 0000000000000..a89b6dfd7b4a5 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.microsoft import check_min_vs, is_msvc +import os + +required_conan_version = ">=1.52.0" + +class ModernCppKafkaConan(ConanFile): + name = "modern-cpp-kafka" + description = "A C++ API for Kafka clients (i.e. KafkaProducer, KafkaConsumer, AdminClient)" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/morganstanley/modern-cpp-kafka" + topics = ("kafka", "librdkafka", "kafkaproducer", "kafkaconsumer", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("librdkafka/2.0.2") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("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], destination=self.source_folder, 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"), + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ModernCppKafka") + self.cpp_info.set_property("cmake_target_name", "ModernCppKafka::ModernCppKafka") + + self.cpp_info.names["cmake_find_package"] = "ModernCppKafka" + self.cpp_info.names["cmake_find_package_multi"] = "ModernCppKafka" + + if self.settings.os in ["Linux", "Macos"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt b/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e00b58eaa4743 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ModernCppKafka REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ModernCppKafka::ModernCppKafka) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/modern-cpp-kafka/all/test_package/conanfile.py b/recipes/modern-cpp-kafka/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/modern-cpp-kafka/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/modern-cpp-kafka/all/test_package/test_package.cpp b/recipes/modern-cpp-kafka/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b9fb4f0bea6d8 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "kafka/Utility.h" + +#include + +int main() +{ + std::cout << "librdkafka version: " << kafka::utility::getLibRdKafkaVersion() << std::endl; +} diff --git a/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt b/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py b/recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/modern-cpp-kafka/config.yml b/recipes/modern-cpp-kafka/config.yml new file mode 100644 index 0000000000000..a01e300c4e30c --- /dev/null +++ b/recipes/modern-cpp-kafka/config.yml @@ -0,0 +1,13 @@ +versions: + "2023.03.07": + folder: all + "2023.01.05": + folder: all + "2022.12.07": + folder: all + "2022.10.12": + folder: all + "2022.08.01": + folder: all + "2022.06.15": + folder: all diff --git a/recipes/mold/1.3.1/conandata.yml b/recipes/mold/1.3.1/conandata.yml new file mode 100644 index 0000000000000..5d89f31c243f2 --- /dev/null +++ b/recipes/mold/1.3.1/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.3.1.tar.gz" + sha256: "d436e2d4c1619a97aca0e28f26c4e79c0242d10ce24e829c1b43cfbdd196fd77" diff --git a/recipes/mold/1.3.1/conanfile.py b/recipes/mold/1.3.1/conanfile.py new file mode 100644 index 0000000000000..132186858b019 --- /dev/null +++ b/recipes/mold/1.3.1/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools import files +from conan.tools.files import copy +from conan.errors import ConanInvalidConfiguration +from conans import AutoToolsBuildEnvironment +import os + +required_conan_version = ">=1.47.0" + +class MoldConan(ConanFile): + name = "mold" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rui314/mold/" + license = "AGPL-3.0" + description = ("mold is a faster drop-in replacement for existing Unix linkers. It is several times faster than the LLVM lld linker") + topics = ("mold", "ld", "linkage", "compilation") + + settings = "os", "arch", "compiler", "build_type" + + generators = "make" + + def validate(self): + if self.settings.build_type == "Debug": + raise ConanInvalidConfiguration('Mold is a build tool, specify mold:build_type=Release in your build profile, see https://github.com/conan-io/conan-center-index/pull/11536#issuecomment-1195607330') + if self.settings.compiler in ["gcc", "clang", "intel-cc"] and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration('Mold can only be built with libstdc++11; specify mold:compiler.libcxx=libstdc++11 in your build profile') + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f'{self.name} can not be built on {self.settings.os}.') + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("GCC version 10 or higher required") + if (self.settings.compiler == "clang" or self.settings.compiler == "apple-clang") and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("Clang version 12 or higher required") + if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : + raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _get_include_path(self, dependency): + include_path = self.deps_cpp_info[dependency].rootpath + include_path = os.path.join(include_path, "include") + return include_path + + def _patch_sources(self): + if self.settings.compiler == "apple-clang" or (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "11"): + files.replace_in_file(self, "source_subfolder/Makefile", "-std=c++20", "-std=c++2a") + + files.replace_in_file(self, "source_subfolder/Makefile", "-Ithird-party/xxhash ", "-I{} -I{} -I{} -I{} -I{}".format( + self._get_include_path("zlib"), + self._get_include_path("openssl"), + self._get_include_path("xxhash"), + self._get_include_path("mimalloc"), + self._get_include_path("onetbb") + )) + + files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -ltbb", "MOLD_LDFLAGS += -L{} -ltbb".format( + self.deps_cpp_info["onetbb"].lib_paths[0])) + + files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -lmimalloc", "MOLD_LDFLAGS += -L{} -lmimalloc".format( + self.deps_cpp_info["mimalloc"].lib_paths[0])) + + def requirements(self): + self.requires("zlib/1.2.12") + self.requires("openssl/1.1.1q") + self.requires("xxhash/0.8.1") + self.requires("onetbb/2021.3.0") + self.requires("mimalloc/2.0.6") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + self._patch_sources() + with files.chdir(self, self._source_subfolder): + autotools = AutoToolsBuildEnvironment(self) + autotools.make(target="mold", args=['SYSTEM_TBB=1', 'SYSTEM_MIMALLOC=1']) + + def package(self): + copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "mold", src="bin", dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "mold", src=self._source_subfolder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + + def package_id(self): + del self.info.settings.compiler + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + mold_location = os.path.join(bindir, "bindir") + + self.output.info('Appending PATH environment variable: {}'.format(bindir)) + self.env_info.PATH.append(bindir) + self.env_info.LD = mold_location + self.buildenv_info.prepend_path("MOLD_ROOT", bindir) + self.cpp_info.includedirs = [] + + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/mold/1.3.1/test_package/conanfile.py b/recipes/mold/1.3.1/test_package/conanfile.py new file mode 100644 index 0000000000000..f4c00d1c189e7 --- /dev/null +++ b/recipes/mold/1.3.1/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conan import ConanFile +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not cross_building(self): + self.run("mold -v", run_environment=True) diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml new file mode 100644 index 0000000000000..22885d71a0ad6 --- /dev/null +++ b/recipes/mold/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.4.2": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.4.2.tar.gz" + sha256: "47e6c48d20f49e5b47dfb8197dd9ffcb11a8833d614f7a03bd29741c658a69cd" + "1.5.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.5.1.tar.gz" + sha256: "ec94aa74758f1bc199a732af95c6304ec98292b87f2f4548ce8436a7c5b054a1" + "1.7.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.7.1.tar.gz" + sha256: "fa2558664db79a1e20f09162578632fa856b3cde966fbcb23084c352b827dfa9" + "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 new file mode 100644 index 0000000000000..7a48206ed3782 --- /dev/null +++ b/recipes/mold/all/conanfile.py @@ -0,0 +1,100 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import copy, get, rmdir +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv + +class MoldConan(ConanFile): + name = "mold" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rui314/mold/" + license = "AGPL-3.0" + description = ("mold is a faster drop-in replacement for existing Unix linkers. It is several times faster than the LLVM lld linker") + topics = ("mold", "ld", "linkage", "compilation") + + settings = "os", "arch", "compiler", "build_type" + options = { + "with_mimalloc": [True, False], + } + default_options = { + "with_mimalloc": False, + } + + def validate(self): + #TODO most of these checks should run on validate_build, but the conan-center hooks are broken and fail the PR because they + # think we're raising on the build() method + if self.settings.build_type == "Debug": + raise ConanInvalidConfiguration('Mold is a build tool, specify mold:build_type=Release in your build profile, see https://github.com/conan-io/conan-center-index/pull/11536#issuecomment-1195607330') + if self.settings.compiler in ["gcc", "clang", "intel-cc"] and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration('Mold can only be built with libstdc++11; specify mold:compiler.libcxx=libstdc++11 in your build profile') + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f'{self.name} can not be built on {self.settings.os}.') + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("GCC version 10 or higher required") + if self.settings.compiler in ('clang', 'apple-clang') and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("Clang version 12 or higher required") + if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : + raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def requirements(self): + self.requires("zlib/1.2.13") + self.requires("openssl/1.1.1q") + self.requires("xxhash/0.8.1") + self.requires("onetbb/2021.3.0") + if self.options.with_mimalloc: + self.requires("mimalloc/2.0.6") + + 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["MOLD_USE_MIMALLOC"] = self.options.with_mimalloc + tc.variables["MOLD_USE_SYSTEM_MIMALLOC"] = True + tc.variables["MOLD_USE_SYSTEM_TBB"] = True + tc.variables["CMAKE_INSTALL_LIBEXECDIR"] = "libexec" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + vbe = VirtualBuildEnv(self) + vbe.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")) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + mold_location = os.path.join(bindir, "mold") + + self.output.info('Appending PATH environment variable: {}'.format(bindir)) + self.env_info.PATH.append(bindir) + self.env_info.LD = mold_location + self.buildenv_info.prepend_path("MOLD_ROOT", bindir) + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] + + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/mold/all/test_package/conanfile.py b/recipes/mold/all/test_package/conanfile.py new file mode 100644 index 0000000000000..60e9ac3ecf6ee --- /dev/null +++ b/recipes/mold/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class MoldTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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("mold -v") + diff --git a/recipes/mold/all/test_v1_package/conanfile.py b/recipes/mold/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ce72e1030b169 --- /dev/null +++ b/recipes/mold/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +import os +from conans import ConanFile, tools +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not cross_building(self): + self.run("mold -v", run_environment=True) diff --git a/recipes/mold/config.yml b/recipes/mold/config.yml new file mode 100644 index 0000000000000..b98e60e56dc68 --- /dev/null +++ b/recipes/mold/config.yml @@ -0,0 +1,13 @@ +versions: + "1.3.1": + folder: 1.3.1 + "1.4.2": + folder: all + "1.5.1": + folder: all + "1.7.1": + folder: all + "1.8.0": + folder: all + "1.11.0": + folder: all diff --git a/recipes/moltenvk/all/CMakeLists.txt b/recipes/moltenvk/all/CMakeLists.txt new file mode 100644 index 0000000000000..0b453780ee747 --- /dev/null +++ b/recipes/moltenvk/all/CMakeLists.txt @@ -0,0 +1,286 @@ +cmake_minimum_required(VERSION 3.12) +project(MoltenVK) + +if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR + CMAKE_SYSTEM_NAME STREQUAL "iOS" OR + CMAKE_SYSTEM_NAME STREQUAL "tvOS")) + message(FATAL_ERROR "MoltenVK only supports MacOS, iOS and tvOS") +endif() + +option(MVK_WITH_SPIRV_TOOLS "Build MoltenVK without the MVK_EXCLUDE_SPIRV_TOOLS build setting" ON) +option(MVK_BUILD_SHADERCONVERTER_TOOL "Build MoltenVKShaderConverter" ON) +if(MVK_VERSION VERSION_GREATER_EQUAL "1.1.7" AND BUILD_SHARED_LIBS) + option(MVK_HIDE_VULKAN_SYMBOLS "Hide Vulkan symbols" OFF) +endif() + +set(MVK_COMMON_DIR ${MVK_SRC_DIR}/common) +set(MVK_SC_DIR ${MVK_SRC_DIR}/MoltenVKShaderConverter) +set(MVK_LIB_DIR ${MVK_SRC_DIR}/MoltenVK) +set(MVK_INSTALL_TARGETS "") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + +# PIC required for objects targets linked into shared MoltenVK +if(BUILD_SHARED_LIBS) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +endif() + +find_package(cereal REQUIRED CONFIG) +find_package(glslang REQUIRED glslang SPIRV CONFIG) +find_package(spirv-cross REQUIRED CONFIG) +find_package(VulkanHeaders REQUIRED CONFIG) +if(MVK_WITH_SPIRV_TOOLS) + find_package(SPIRV-Tools REQUIRED CONFIG) +endif() + +# Find mandatory Apple Frameworks +function(find_library_required foundVar framework) + find_library(${foundVar} ${framework}) + if(NOT ${foundVar}) + message(FATAL_ERROR "${framework} framework not found") + endif() +endfunction() + +find_library_required(METAL_FRAMEWORK Metal) +find_library_required(FOUNDATION_FRAMEWORK Foundation) +find_library_required(QUARTZCORE_FRAMEWORK QuartzCore) +find_library_required(IOSURFACE_FRAMEWORK IOSurface) +find_library_required(COREGRAPHICS_FRAMEWORK CoreGraphics) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + find_library_required(APPKIT_FRAMEWORK AppKit) + find_library_required(IOKIT_FRAMEWORK IOKit) +else() + find_library_required(UIKIT_FRAMEWORK UIKit) +endif() + +add_compile_options( + -Wno-unguarded-availability-new + -Wno-deprecated-declarations + -Wno-nonportable-include-path + -Wno-tautological-pointer-compare + -Wno-non-c-typedef-for-linkage + -Wno-switch +) + +# MoltenVKCommon +file(GLOB MVK_COMMON_SOURCES ${MVK_COMMON_DIR}/*.mm) +add_library(MoltenVKCommon OBJECT ${MVK_COMMON_SOURCES}) +target_include_directories(MoltenVKCommon PUBLIC ${MVK_COMMON_DIR}) +target_compile_definitions(MoltenVKCommon PRIVATE $<$:DEBUG=1>) +target_link_libraries(MoltenVKCommon PRIVATE ${FOUNDATION_FRAMEWORK}) +if(BUILD_SHARED_LIBS) + set_target_properties(MoltenVKCommon PROPERTIES + C_VISIBILITY_PRESET hidden + OBJC_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + OBJCXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON + ) +endif() + +# MoltenVKShaderConverter +if(MVK_VERSION VERSION_LESS "1.1.0") + file(GLOB MVK_SC_SOURCES + ${MVK_SC_DIR}/MoltenVKGLSLToSPIRVConverter/*.cpp + ${MVK_SC_DIR}/MoltenVKGLSLToSPIRVConverter/*.mm + ${MVK_SC_DIR}/MoltenVKSPIRVToMSLConverter/*.cpp + ${MVK_SC_DIR}/MoltenVKSPIRVToMSLConverter/*.mm + ) +else() + file(GLOB MVK_SC_SOURCES + ${MVK_SC_DIR}/MoltenVKShaderConverter/*.cpp + ${MVK_SC_DIR}/MoltenVKShaderConverter/*.mm + ) +endif() +if(MVK_VERSION VERSION_LESS "1.1.4") + file(GLOB MVK_SC_COMMON_SOURCES ${MVK_SC_DIR}/common/*.cpp) + list(APPEND MVK_SC_SOURCES ${MVK_SC_COMMON_SOURCES}) +endif() +add_library(MoltenVKShaderConverter OBJECT ${MVK_SC_SOURCES}) +if(MVK_VERSION VERSION_LESS "1.1.9") + target_compile_features(MoltenVKShaderConverter PUBLIC cxx_std_11) +else() + target_compile_features(MoltenVKShaderConverter PUBLIC cxx_std_17) +endif() +target_include_directories(MoltenVKShaderConverter + PRIVATE + $<$:${MVK_SC_DIR}/MoltenVKSPIRVToMSLConverter> + $<$:${MVK_SC_DIR}/common> + INTERFACE + ${MVK_SC_DIR} +) +target_link_libraries(MoltenVKShaderConverter + PRIVATE + glslang::glslang + glslang::SPIRV + MoltenVKCommon + $<$:SPIRV-Tools> + ${FOUNDATION_FRAMEWORK} + PUBLIC + spirv-cross-core + spirv-cross-msl + spirv-cross-reflect +) +target_compile_definitions(MoltenVKShaderConverter PRIVATE + $<$>:MVK_EXCLUDE_SPIRV_TOOLS> +) +if(BUILD_SHARED_LIBS) + set_target_properties(MoltenVKShaderConverter PROPERTIES + C_VISIBILITY_PRESET hidden + OBJC_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + OBJCXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON + ) +endif() + +# MoltenVKShaderConverterTool +if(MVK_BUILD_SHADERCONVERTER_TOOL) + file(GLOB MVK_SCT_SOURCES + ${MVK_SC_DIR}/MoltenVKShaderConverterTool/*.cpp + ${MVK_SC_DIR}/MoltenVKShaderConverterTool/*.mm + ) + add_executable(MoltenVKShaderConverterTool ${MVK_SCT_SOURCES}) + if(MVK_VERSION VERSION_LESS "1.1.9") + target_compile_features(MoltenVKShaderConverterTool PUBLIC cxx_std_11) + else() + target_compile_features(MoltenVKShaderConverterTool PUBLIC cxx_std_17) + endif() + set_property(TARGET MoltenVKShaderConverterTool PROPERTY OUTPUT_NAME "MoltenVKShaderConverter") + target_include_directories(MoltenVKShaderConverterTool PRIVATE + $<$:${MVK_SC_DIR}/MoltenVKGLSLToSPIRVConverter> + $<$:${MVK_SC_DIR}/MoltenVKSPIRVToMSLConverter> + $<$:${MVK_SC_DIR}/common> + $<$:${MVK_SC_DIR}/MoltenVKShaderConverter> + ) + target_link_libraries(MoltenVKShaderConverterTool PRIVATE + MoltenVKCommon + MoltenVKShaderConverter + ${METAL_FRAMEWORK} + ${FOUNDATION_FRAMEWORK} + ) + list(APPEND MVK_INSTALL_TARGETS MoltenVKShaderConverterTool) +endif() + +# MoltenVK +file(GLOB_RECURSE MVK_SOURCES + ${MVK_LIB_DIR}/MoltenVK/*.m + ${MVK_LIB_DIR}/MoltenVK/*.mm + ${MVK_LIB_DIR}/MoltenVK/*.cpp +) +add_library(MoltenVK ${MVK_SOURCES}) +if(MVK_VERSION VERSION_LESS "1.1.9") + target_compile_features(MoltenVK PUBLIC cxx_std_11) +else() + target_compile_features(MoltenVK PUBLIC cxx_std_17) +endif() +target_include_directories(MoltenVK PRIVATE + ${MVK_LIB_DIR}/MoltenVK/API + ${MVK_LIB_DIR}/MoltenVK/Commands + ${MVK_LIB_DIR}/MoltenVK/GPUObjects + ${MVK_LIB_DIR}/MoltenVK/Layers + ${MVK_LIB_DIR}/MoltenVK/OS + ${MVK_LIB_DIR}/MoltenVK/Utility + ${MVK_LIB_DIR}/MoltenVK/Vulkan +) +target_link_libraries(MoltenVK + PRIVATE + cereal + MoltenVKCommon + MoltenVKShaderConverter + ${FOUNDATION_FRAMEWORK} + ${QUARTZCORE_FRAMEWORK} + $<$:${APPKIT_FRAMEWORK}> + $<$:${IOKIT_FRAMEWORK}> + $<$>:${UIKIT_FRAMEWORK}> + PUBLIC + Vulkan::Headers + ${METAL_FRAMEWORK} + ${IOSURFACE_FRAMEWORK} + ${COREGRAPHICS_FRAMEWORK} +) +if(BUILD_SHARED_LIBS) + set_target_properties(MoltenVK PROPERTIES + C_VISIBILITY_PRESET hidden + OBJC_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + OBJCXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON + ) + if(MVK_VERSION VERSION_GREATER_EQUAL "1.1.7" AND MVK_HIDE_VULKAN_SYMBOLS) + target_compile_definitions(MoltenVK PRIVATE MVK_HIDE_VULKAN_SYMBOLS) + endif() +endif() +list(APPEND MVK_INSTALL_TARGETS MoltenVK) + +# Custom Target to generate internal header file required by MoltenVK target. +# This header should contain: +# - if moltenvk < 1.0.44 : spirv-cross commit hash in spirvCrossRevisionString variable +# - if moltenvk >= 1.0.44: moltenvk commit hash in mvkRevString variable (but we still +# use spirv-cross commit hash, since MoltenVK hash is not available in this context, +# and hash value is no really important) +set(MVK_REV_FILE ${MVK_SRC_DIR}/ExternalRevisions/SPIRV-Cross_repo_revision) +set(MVK_REV_HEADER_DIR ${CMAKE_CURRENT_BINARY_DIR}/mvk_hash_generated) +if(MVK_VERSION VERSION_LESS "1.0.44") + set(MVK_REV_HEADER ${MVK_REV_HEADER_DIR}/SPIRV-Cross/mvkSpirvCrossRevisionDerived.h) + set(MVK_REV_VAR_NAME "spirvCrossRevisionString") +else() + set(MVK_REV_HEADER ${MVK_REV_HEADER_DIR}/mvkGitRevDerived.h) + set(MVK_REV_VAR_NAME "mvkRevString") +endif() +set(MVK_REV_DEFINES -DMVK_REV_FILE=${MVK_REV_FILE} -DMVK_REV_HEADER=${MVK_REV_HEADER} -DMVK_REV_VAR_NAME=${MVK_REV_VAR_NAME}) +set(MVK_REV_GEN_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/mvk_git_hash_generator.cmake") +file(WRITE ${MVK_REV_GEN_SCRIPT} + "file(READ \${MVK_REV_FILE} MVK_SPIRV_CROSS_GIT_REV)\n" + "string(REPLACE \"\\n\" \"\" MVK_SPIRV_CROSS_GIT_REV \${MVK_SPIRV_CROSS_GIT_REV})\n" + "file(WRITE \${MVK_REV_HEADER} \"static const char* \${MVK_REV_VAR_NAME} = \\\"\${MVK_SPIRV_CROSS_GIT_REV}\\\";\")\n" +) +add_custom_target(mvk-commit-hash-header DEPENDS ${MVK_REV_HEADER}) +add_custom_command( + COMMENT "Create ${MVK_REV_HEADER}" + OUTPUT ${MVK_REV_HEADER} + DEPENDS ${MVK_REV_FILE} + COMMAND ${CMAKE_COMMAND} ${MVK_REV_DEFINES} -P ${MVK_REV_GEN_SCRIPT} +) +add_dependencies(MoltenVK mvk-commit-hash-header) +target_include_directories(MoltenVK PRIVATE ${MVK_REV_HEADER_DIR}) + +# Installation +install( + TARGETS ${MVK_INSTALL_TARGETS} + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +if(BUILD_SHARED_LIBS) + install( + FILES ${MVK_LIB_DIR}/icd/MoltenVK_icd.json + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() + +file(GLOB MVK_PUBLIC_HEADERS ${MVK_LIB_DIR}/MoltenVK/API/*.h) +install( + FILES ${MVK_PUBLIC_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/MoltenVK +) + +if(MVK_VERSION VERSION_LESS "1.1.0") + file(GLOB MVK_SC_PUBLIC_HEADERS + ${MVK_SC_DIR}/MoltenVKGLSLToSPIRVConverter/*Conversion.h + ${MVK_SC_DIR}/MoltenVKGLSLToSPIRVConverter/*Converter.h + ${MVK_SC_DIR}/MoltenVKSPIRVToMSLConverter/*Conversion.h + ${MVK_SC_DIR}/MoltenVKSPIRVToMSLConverter/*Converter.h + ) +else() + file(GLOB MVK_SC_PUBLIC_HEADERS + ${MVK_SC_DIR}/MoltenVKShaderConverter/*Conversion.h + ${MVK_SC_DIR}/MoltenVKShaderConverter/*Converter.h + ) +endif() +install( + FILES ${MVK_SC_PUBLIC_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/MoltenVKShaderConverter +) diff --git a/recipes/moltenvk/all/conandata.yml b/recipes/moltenvk/all/conandata.yml new file mode 100644 index 0000000000000..cc7f779fc2f3a --- /dev/null +++ b/recipes/moltenvk/all/conandata.yml @@ -0,0 +1,78 @@ +sources: + "1.2.2": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.2.2.tar.gz" + sha256: "8065a10c2d70b561f48475dedb118e643176527b162d6e439fa127270c2a07dd" + "1.2.1": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.2.1.tar.gz" + sha256: "4742df8f35473c5a737f2b120ae06aa6b9e8a7a3753b88932e501b06b1d17ea8" + "1.2.0": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.2.0.tar.gz" + sha256: "6e7af2dad0530b2b404480dbe437ca4670c6615cc2ec6cf6a20ed04d9d75e0bd" + "1.1.11": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.11.tar.gz" + sha256: "938ea0ba13c6538b0ee505ab391a3020f206ab9d29c869f20dd19318a4ee8997" + "1.1.10": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.10.tar.gz" + sha256: "fac11c2501195c9ce042103685c7778e35484562e6c084963a22072dd0a602e0" + "1.1.9": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.9.tar.gz" + sha256: "ea455a14decb85ec4bc66ffd2b963492afa7b53297b7064a11ca47ca8d2464ea" + "1.1.8": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.8.tar.gz" + sha256: "f316c814d0cb6d60a0e8ad164d8cafa64010dee9dd41748b038b6b67fa40f08a" + "1.1.6": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.6.tar.gz" + sha256: "b60df3ac93b943eb14377019445533b5c451fffd6b1df86187b1b9ac7d6dba6b" + "1.1.5": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.5.tar.gz" + sha256: "2cdcb8dbf2acdcd8cbe70b109dadc05a901038c84970afbe4863e5e23f33deae" + "1.1.4": + url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.4.tar.gz" + sha256: "f9bba6d3bf3648e7685c247cb6d126d62508af614bc549cedd5859a7da64967e" + "1.1.1": + url: "https://github.com/KhronosGroup/MoltenVK/archive/v1.1.1.tar.gz" + sha256: "cd1712c571d4155f4143c435c8551a5cb8cbb311ad7fff03595322ab971682c0" + "1.1.0": + url: "https://github.com/KhronosGroup/MoltenVK/archive/v1.1.0.tar.gz" + sha256: "0538fa1c23ddae495c7f82ccd0db90790a90b7017a258ca7575fbae8021f3058" +patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-version-number-icd-json.patch" + patch_description: "Fix api_version in MoltenVK_icd.json" + patch_type: "portability" + patch_source: "https://github.com/KhronosGroup/MoltenVK/pull/1747" + "1.1.11": + - patch_file: "patches/1.1.11-0001-vulkan-alias-private-extern.patch" + patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" + patch_type: "portability" + "1.1.10": + - patch_file: "patches/1.1.8-0002-vulkan-alias-private-extern.patch" + patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" + patch_type: "portability" + "1.1.9": + - patch_file: "patches/1.1.8-0002-vulkan-alias-private-extern.patch" + patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" + patch_type: "portability" + "1.1.8": + - patch_file: "patches/1.1.8-0001-allow-c++11-std.patch" + patch_description: "Allow to compile with C++11" + patch_type: "portability" + - patch_file: "patches/1.1.8-0002-vulkan-alias-private-extern.patch" + patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" + patch_type: "portability" + "1.1.6": + - patch_file: "patches/1.1.6-0001-allow-c++11-std.patch" + patch_description: "Allow to compile with C++11" + patch_type: "portability" + "1.1.5": + - patch_file: "patches/1.1.5-0001-allow-c++11-std.patch" + patch_description: "Allow to compile with C++11" + patch_type: "portability" + "1.1.1": + - patch_file: "patches/1.1.0-0001-fix-spirv-cross-includes.patch" + patch_description: "Use spirv-cross include convention" + patch_type: "conan" + "1.1.0": + - patch_file: "patches/1.1.0-0001-fix-spirv-cross-includes.patch" + patch_description: "Use spirv-cross include convention" + patch_type: "conan" diff --git a/recipes/moltenvk/all/conanfile.py b/recipes/moltenvk/all/conanfile.py new file mode 100644 index 0000000000000..4a3969113c5a1 --- /dev/null +++ b/recipes/moltenvk/all/conanfile.py @@ -0,0 +1,160 @@ +from conan import ConanFile +from conan.errors import ConanException, 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 +import functools +import os +import yaml + +required_conan_version = ">=1.53.0" + + +class MoltenVKConan(ConanFile): + name = "moltenvk" + description = "MoltenVK is a Vulkan Portability implementation. It " \ + "layers a subset of the high-performance, industry-standard " \ + "Vulkan graphics and compute API over Apple's Metal " \ + "graphics framework, enabling Vulkan applications to run " \ + "on iOS and macOS." + license = "Apache-2.0" + topics = ("moltenvk", "khronos", "vulkan", "metal") + homepage = "https://github.com/KhronosGroup/MoltenVK" + 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], + "hide_vulkan_symbols": [True, False], + "with_spirv_tools": [True, False], + "tools": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "hide_vulkan_symbols": False, + "with_spirv_tools": True, + "tools": True, + } + + @property + def _dependencies_filename(self): + return f"dependencies-{self.version}.yml" + + @property + @functools.lru_cache(1) + def _dependencies_versions(self): + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependencies_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException(f"Cannot find {dependencies_filepath}") + cached_dependencies = yaml.safe_load(open(dependencies_filepath)) + return cached_dependencies + + @property + def _min_cppstd(self): + return 11 if Version(self.version) < "1.1.9" else 17 + + @property + def _has_hide_vulkan_symbols_option(self): + return Version(self.version) >= "1.1.7" + + def export(self): + copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder) + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if not self._has_hide_vulkan_symbols_option: + del self.options.hide_vulkan_symbols + + def configure(self): + if self.options.shared: + del self.options.fPIC + elif self._has_hide_vulkan_symbols_option: + self.options.rm_safe("hide_vulkan_symbols") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("cereal/1.3.2") + self.requires(self._require("glslang")) + self.requires(self._require("spirv-cross")) + self.requires(self._require("vulkan-headers"), transitive_headers=True) + if self.options.with_spirv_tools: + self.requires(self._require("spirv-tools")) + + def _require(self, recipe_name): + if recipe_name not in self._dependencies_versions: + raise ConanException(f"{recipe_name} is missing in {self._dependencies_filename}") + return f"{recipe_name}/{self._dependencies_versions[recipe_name]}" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.settings.os not in ["Macos", "iOS", "tvOS"]: + raise ConanInvalidConfiguration(f"{self.ref} only supported on MacOS, iOS and tvOS") + if self.settings.compiler != "apple-clang": + raise ConanInvalidConfiguration(f"{self.ref} requires apple-clang") + if Version(self.settings.compiler.version) < "12.0": + raise ConanInvalidConfiguration(f"{self.ref} requires XCode 12.0 or higher") + spirv_cross = self.dependencies["spirv-cross"] + if spirv_cross.options.shared or not (spirv_cross.options.msl and spirv_cross.options.reflect): + raise ConanInvalidConfiguration(f"{self.ref} requires spirv-cross static with msl & reflect enabled") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MVK_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["MVK_VERSION"] = self.version + tc.variables["MVK_WITH_SPIRV_TOOLS"] = self.options.with_spirv_tools + tc.variables["MVK_BUILD_SHADERCONVERTER_TOOL"] = self.options.tools + if self._has_hide_vulkan_symbols_option and self.options.shared: + tc.variables["MVK_HIDE_VULKAN_SYMBOLS"] = self.options.hide_vulkan_symbols + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["MoltenVK"] + self.cpp_info.frameworks = ["Metal", "Foundation", "CoreFoundation", "QuartzCore", "IOSurface", "CoreGraphics"] + if self.settings.os == "Macos": + self.cpp_info.frameworks.extend(["AppKit", "IOKit"]) + elif self.settings.os in ["iOS", "tvOS"]: + self.cpp_info.frameworks.append("UIKit") + + self.cpp_info.requires = [ + "cereal::cereal", "glslang::glslang-core", "glslang::spirv", "spirv-cross::spirv-cross-core", + "spirv-cross::spirv-cross-msl", "spirv-cross::spirv-cross-reflect", "vulkan-headers::vulkan-headers", + ] + if self.options.with_spirv_tools: + self.cpp_info.requires.append("spirv-tools::spirv-tools-core") + + if self.options.shared: + moltenvk_icd_path = os.path.join(self.package_folder, "lib", "MoltenVK_icd.json") + self.runenv_info.prepend_path("VK_DRIVER_FILES", moltenvk_icd_path) + self.runenv_info.prepend_path("VK_ICD_FILENAMES", moltenvk_icd_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.VK_DRIVER_FILES.append(moltenvk_icd_path) + self.env_info.VK_ICD_FILENAMES.append(moltenvk_icd_path) + + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml new file mode 100644 index 0000000000000..d8c73818a1f7e --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml @@ -0,0 +1,4 @@ +glslang: "8.13.3559" +spirv-cross: "20200917" +spirv-tools: "2020.5" +vulkan-headers: "1.2.154.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml new file mode 100644 index 0000000000000..3dd4ee92f5875 --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml @@ -0,0 +1,4 @@ +glslang: "8.13.3559" +spirv-cross: "20210115" +spirv-tools: "2020.5" +vulkan-headers: "1.2.162.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml new file mode 100644 index 0000000000000..056b9e003fb57 --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml @@ -0,0 +1,4 @@ +glslang: "1.3.216.0" +spirv-cross: "1.3.216.0" +spirv-tools: "1.3.216.0" +vulkan-headers: "1.3.216.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.11.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.11.yml new file mode 100644 index 0000000000000..1a11b23c8e3ad --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.11.yml @@ -0,0 +1,4 @@ +glslang: "1.3.224.0" +spirv-cross: "1.3.224.0" +spirv-tools: "1.3.224.0" +vulkan-headers: "1.3.224.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml new file mode 100644 index 0000000000000..b1f4555c6b74e --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml @@ -0,0 +1,4 @@ +glslang: "11.5.0" +spirv-cross: "cci.20210621" +spirv-tools: "2021.2" +vulkan-headers: "1.2.182" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml new file mode 100644 index 0000000000000..f358857867637 --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml @@ -0,0 +1,4 @@ +glslang: "11.6.0" +spirv-cross: "cci.20210823" +spirv-tools: "2021.3" +vulkan-headers: "1.2.189" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml new file mode 100644 index 0000000000000..50da3fc9cd75d --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml @@ -0,0 +1,4 @@ +glslang: "11.7.0" +spirv-cross: "cci.20211113" +spirv-tools: "2021.4" +vulkan-headers: "1.2.198.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml new file mode 100644 index 0000000000000..a215ca2513dd4 --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml @@ -0,0 +1,4 @@ +glslang: "1.3.204.0" +spirv-cross: "1.3.204.0" +spirv-tools: "1.3.204.0" +vulkan-headers: "1.3.204.1" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml new file mode 100644 index 0000000000000..d62197eb0b30f --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml @@ -0,0 +1,4 @@ +glslang: "1.3.211.0" +spirv-cross: "1.3.211.0" +spirv-tools: "1.3.211.0" +vulkan-headers: "1.3.211.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml b/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml new file mode 100644 index 0000000000000..33e0cb279be8b --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml @@ -0,0 +1,4 @@ +glslang: "1.3.231.1" +spirv-cross: "1.3.231.1" +spirv-tools: "1.3.231.1" +vulkan-headers: "1.3.231.1" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml b/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml new file mode 100644 index 0000000000000..ba333592e0199 --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml @@ -0,0 +1,4 @@ +glslang: "1.3.236.0" +spirv-cross: "1.3.236.0" +spirv-tools: "1.3.236.0" +vulkan-headers: "1.3.236.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.2.2.yml b/recipes/moltenvk/all/dependencies/dependencies-1.2.2.yml new file mode 100644 index 0000000000000..5d099aa6f64ae --- /dev/null +++ b/recipes/moltenvk/all/dependencies/dependencies-1.2.2.yml @@ -0,0 +1,4 @@ +glslang: "1.3.239.0" +spirv-cross: "1.3.239.0" +spirv-tools: "1.3.239.0" +vulkan-headers: "1.3.239.0" diff --git a/recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch b/recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch new file mode 100644 index 0000000000000..5280ed8ddc361 --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch @@ -0,0 +1,54 @@ +see https://github.com/KhronosGroup/MoltenVK/pull/1287 + +--- a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h ++++ b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h +@@ -22,7 +22,7 @@ + #include "MVKEnvironment.h" + #include "MVKOSExtensions.h" + #include "MVKBaseObject.h" +-#include ++#include + #include + + #import +--- a/MoltenVKShaderConverter/Common/SPIRVSupport.cpp ++++ b/MoltenVKShaderConverter/Common/SPIRVSupport.cpp +@@ -18,7 +18,7 @@ + + #include "SPIRVSupport.h" + #include "MVKStrings.h" +-#include ++#include + #include + + #import +--- a/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVReflection.h ++++ b/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVReflection.h +@@ -19,10 +19,10 @@ + #ifndef __SPIRVReflection_h_ + #define __SPIRVReflection_h_ 1 + +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include + #include + #include + +--- a/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.h ++++ b/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.h +@@ -19,8 +19,8 @@ + #ifndef __SPIRVToMSLConverter_h_ + #define __SPIRVToMSLConverter_h_ 1 + +-#include +-#include ++#include ++#include + #include + #include + #include diff --git a/recipes/moltenvk/all/patches/1.1.11-0001-vulkan-alias-private-extern.patch b/recipes/moltenvk/all/patches/1.1.11-0001-vulkan-alias-private-extern.patch new file mode 100644 index 0000000000000..32ae960f5a370 --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.11-0001-vulkan-alias-private-extern.patch @@ -0,0 +1,21 @@ +--- a/Common/MVKCommonEnvironment.h ++++ b/Common/MVKCommonEnvironment.h +@@ -108,6 +108,9 @@ extern "C" { + /** Directive to make a public alias of another symbol. */ + #define MVK_PUBLIC_ALIAS(ALIAS, TARGET) asm(".globl _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET) + ++/** Directive to make a private extern alias of another symbol. */ ++#define MVK_PRIVATE_EXTERN_ALIAS(ALIAS, TARGET) asm(".private_extern _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET) ++ + /** + * Directives to hide public symbols from the Vulkan API, to avoid library linking + * conflicts when bound to a Vulkan Loader that also exports identical symbols. +@@ -117,7 +120,7 @@ extern "C" { + #endif + #if MVK_HIDE_VULKAN_SYMBOLS + # define MVK_PUBLIC_VULKAN_SYMBOL +-# define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) ++# define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) MVK_PRIVATE_EXTERN_ALIAS(ALIAS, TARGET) + #else + # define MVK_PUBLIC_VULKAN_SYMBOL MVK_PUBLIC_SYMBOL + # define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) MVK_PUBLIC_ALIAS(ALIAS, TARGET) diff --git a/recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch b/recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch new file mode 100644 index 0000000000000..283e7edc667aa --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch @@ -0,0 +1,16 @@ +upstream issue: https://github.com/KhronosGroup/MoltenVK/issues/1474 + +--- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm ++++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm +@@ -769,7 +769,10 @@ void MVKCommandEncoder::markTimestamp(MVKTimestampQueryPool* pQueryPool, uint32_ + if (sampPts) { + for (uint32_t qOfst = 0; qOfst < queryCount; qOfst++) { + if (mvkIsAnyFlagEnabled(sampPts, MVK_COUNTER_SAMPLING_AT_PIPELINE_STAGE)) { +- _timestampStageCounterQueries.push_back({ pQueryPool, query + qOfst }); ++ GPUCounterQuery timestampCounterQuery = {}; ++ timestampCounterQuery.queryPool = pQueryPool; ++ timestampCounterQuery.query = query + qOfst; ++ _timestampStageCounterQueries.push_back(timestampCounterQuery); + } else { + encodeGPUCounterSample(pQueryPool, query + qOfst, sampPts); + } diff --git a/recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch b/recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch new file mode 100644 index 0000000000000..65bfadc2ebffe --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch @@ -0,0 +1,16 @@ +upstream issue: https://github.com/KhronosGroup/MoltenVK/issues/1474 + +--- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm ++++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm +@@ -772,7 +772,10 @@ void MVKCommandEncoder::markTimestamp(MVKTimestampQueryPool* pQueryPool, uint32_ + MVKCounterSamplingFlags sampPts = _device->_pMetalFeatures->counterSamplingPoints; + for (uint32_t qOfst = 0; qOfst < queryCount; qOfst++) { + if (mvkIsAnyFlagEnabled(sampPts, MVK_COUNTER_SAMPLING_AT_PIPELINE_STAGE)) { +- _timestampStageCounterQueries.push_back({ pQueryPool, query + qOfst }); ++ GPUCounterQuery timestampCounterQuery = {}; ++ timestampCounterQuery.queryPool = pQueryPool; ++ timestampCounterQuery.query = query + qOfst; ++ _timestampStageCounterQueries.push_back(timestampCounterQuery); + } else { + encodeGPUCounterSample(pQueryPool, query + qOfst, sampPts); + } diff --git a/recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch b/recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch new file mode 100644 index 0000000000000..420e890ccf5f4 --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch @@ -0,0 +1,14 @@ +--- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm ++++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm +@@ -774,7 +774,10 @@ void MVKCommandEncoder::markTimestamp(MVKTimestampQueryPool* pQueryPool, uint32_ + MVKCounterSamplingFlags sampPts = _device->_pMetalFeatures->counterSamplingPoints; + for (uint32_t qOfst = 0; qOfst < queryCount; qOfst++) { + if (mvkIsAnyFlagEnabled(sampPts, MVK_COUNTER_SAMPLING_AT_PIPELINE_STAGE)) { +- _timestampStageCounterQueries.push_back({ pQueryPool, query + qOfst }); ++ GPUCounterQuery timestampCounterQuery = {}; ++ timestampCounterQuery.queryPool = pQueryPool; ++ timestampCounterQuery.query = query + qOfst; ++ _timestampStageCounterQueries.push_back(timestampCounterQuery); + } else { + encodeGPUCounterSample(pQueryPool, query + qOfst, sampPts); + } diff --git a/recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch b/recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch new file mode 100644 index 0000000000000..e488faca8335a --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch @@ -0,0 +1,21 @@ +--- a/Common/MVKCommonEnvironment.h ++++ b/Common/MVKCommonEnvironment.h +@@ -104,6 +104,9 @@ extern "C" { + /** Directive to make a public alias of another symbol. */ + #define MVK_PUBLIC_ALIAS(ALIAS, TARGET) asm(".globl _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET) + ++/** Directive to make a private extern alias of another symbol. */ ++#define MVK_PRIVATE_EXTERN_ALIAS(ALIAS, TARGET) asm(".private_extern _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET) ++ + /** + * Directives to hide public symbols from the Vulkan API, to avoid library linking + * conflicts when bound to a Vulkan Loader that also exports identical symbols. +@@ -113,7 +116,7 @@ extern "C" { + #endif + #if MVK_HIDE_VULKAN_SYMBOLS + # define MVK_PUBLIC_VULKAN_SYMBOL +-# define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) ++# define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) MVK_PRIVATE_EXTERN_ALIAS(ALIAS, TARGET) + #else + # define MVK_PUBLIC_VULKAN_SYMBOL MVK_PUBLIC_SYMBOL + # define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) MVK_PUBLIC_ALIAS(ALIAS, TARGET) diff --git a/recipes/moltenvk/all/patches/1.2.0-0001-fix-version-number-icd-json.patch b/recipes/moltenvk/all/patches/1.2.0-0001-fix-version-number-icd-json.patch new file mode 100644 index 0000000000000..6f8bf87465fe2 --- /dev/null +++ b/recipes/moltenvk/all/patches/1.2.0-0001-fix-version-number-icd-json.patch @@ -0,0 +1,11 @@ +--- a/MoltenVK/icd/MoltenVK_icd.json ++++ b/MoltenVK/icd/MoltenVK_icd.json +@@ -2,7 +2,7 @@ + "file_format_version" : "1.0.0", + "ICD": { + "library_path": "./libMoltenVK.dylib", +- "api_version" : "1.1.0", ++ "api_version" : "1.2.0", + "is_portability_driver" : true + } + } diff --git a/recipes/moltenvk/all/test_package/CMakeLists.txt b/recipes/moltenvk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a5c97f937b4f7 --- /dev/null +++ b/recipes/moltenvk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(moltenvk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE moltenvk::moltenvk) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/moltenvk/all/test_package/conanfile.py b/recipes/moltenvk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/moltenvk/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/moltenvk/all/test_package/test_package.cpp b/recipes/moltenvk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62c6f9b310736 --- /dev/null +++ b/recipes/moltenvk/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#include + +#include + +int main() +{ + vk::ApplicationInfo appInfo; + appInfo.pApplicationName = "ConanTestApp"; + appInfo.pEngineName = "ConanTestEngine"; + appInfo.apiVersion = VK_API_VERSION_1_0; + + vk::InstanceCreateInfo instanceCreateInfo; + instanceCreateInfo.pApplicationInfo = &appInfo; + + try + { + vk::Instance instance = vk::createInstance(instanceCreateInfo); + + auto physicalDevices = instance.enumeratePhysicalDevices(); + auto physicalDevice = physicalDevices[0]; + auto deviceProperties = physicalDevice.getProperties(); + auto deviceMemoryProperties = physicalDevice.getMemoryProperties(); + + std::cout << "Vulkan device created" << std::endl; + std::cout << "API Version: " << deviceProperties.apiVersion << std::endl; + std::cout << "Driver Version: " << deviceProperties.driverVersion << std::endl; + std::cout << "Device Name: " << deviceProperties.deviceName << std::endl; + std::cout << "Device Type: " << vk::to_string(deviceProperties.deviceType) << std::endl; + std::cout << "Memory Heaps: " << deviceMemoryProperties.memoryHeapCount << std::endl; + } + catch(const vk::SystemError& e) + { + std::cerr << e.what() << '\n'; + } + + return 0; +} diff --git a/recipes/moltenvk/all/test_v1_package/CMakeLists.txt b/recipes/moltenvk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/moltenvk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/moltenvk/all/test_v1_package/conanfile.py b/recipes/moltenvk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/moltenvk/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/moltenvk/config.yml b/recipes/moltenvk/config.yml new file mode 100644 index 0000000000000..e2b738bf7f2a6 --- /dev/null +++ b/recipes/moltenvk/config.yml @@ -0,0 +1,25 @@ +versions: + "1.2.2": + folder: all + "1.2.1": + folder: all + "1.2.0": + folder: all + "1.1.11": + folder: all + "1.1.10": + folder: all + "1.1.9": + folder: all + "1.1.8": + folder: all + "1.1.6": + folder: all + "1.1.5": + folder: all + "1.1.4": + folder: all + "1.1.1": + folder: all + "1.1.0": + folder: all diff --git a/recipes/mongo-c-driver/all/conandata.yml b/recipes/mongo-c-driver/all/conandata.yml new file mode 100644 index 0000000000000..be9c59fe3dc4d --- /dev/null +++ b/recipes/mongo-c-driver/all/conandata.yml @@ -0,0 +1,69 @@ +sources: + "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" + "1.17.4": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.4/mongo-c-driver-1.17.4.tar.gz" + sha256: "9ec8fe7fb54d636886fa823460658ccf660e3d82520d10810fb7c9d302ac974f" + "1.17.3": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.3/mongo-c-driver-1.17.3.tar.gz" + sha256: "6594cbae17389005bcac5a8d4091af3be4894d5314a519504d4b4509effcc0df" + "1.17.2": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.2/mongo-c-driver-1.17.2.tar.gz" + sha256: "bc53d5f72ab628a1ae549db6888325d6dc34db3ca31c5e16e550c1bb4266d864" +patches: + "1.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" + "1.17.4": + - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" + "1.17.3": + - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" + "1.17.2": + - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" diff --git a/recipes/mongo-c-driver/all/conanfile.py b/recipes/mongo-c-driver/all/conanfile.py new file mode 100644 index 0000000000000..9c272cde63df8 --- /dev/null +++ b/recipes/mongo-c-driver/all/conanfile.py @@ -0,0 +1,264 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class MongoCDriverConan(ConanFile): + name = "mongo-c-driver" + description = "A Cross Platform MongoDB Client Library for C" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://mongoc.org/" + topics = ("libbson", "libmongoc", "mongo", "mongodb", "database", "db") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [False, "darwin", "windows", "openssl", "libressl"], + "with_sasl": [False, "sspi", "cyrus"], + "with_snappy": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_icu": [True, False], + "srv": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": "openssl", + "with_sasl": False, + "with_snappy": True, + "with_zlib": True, + "with_zstd": True, + "with_icu": True, + "srv": True, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.with_sasl = "sspi" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + 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") + if self.options.with_snappy: + self.requires("snappy/1.1.10") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_icu: + self.requires("icu/72.1") + + def validate(self): + if self.options.with_ssl == "darwin" and not is_apple_os(self): + raise ConanInvalidConfiguration("with_ssl=darwin only allowed on Apple os family") + if self.options.with_ssl == "windows" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("with_ssl=windows only allowed on Windows") + if self.options.with_sasl == "sspi" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("with_sasl=sspi only allowed on Windows") + + 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/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _ssl_cmake_value(self): + return { + "darwin": "DARWIN", + "windows": "WINDOWS", + "openssl": "OPENSSL", + "libressl": "LIBRESSL", + }.get(str(self.options.with_ssl), "OFF") + + @property + def _sasl_cmake_value(self): + return { + "sspi": "SSPI", + "cyrus": "CYRUS", + }.get(str(self.options.with_sasl), "OFF") + + def generate(self): + tc = CMakeToolchain(self) + # All these variables are option() declared before project() in upstream CMakeLists + # 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_TESTS"] = "OFF" + tc.cache_variables["ENABLE_EXAMPLES"] = "OFF" + tc.cache_variables["ENABLE_SRV"] = "ON" if self.options.srv else "OFF" + tc.cache_variables["ENABLE_MAINTAINER_FLAGS"] = "OFF" + tc.cache_variables["ENABLE_AUTOMATIC_INIT_AND_CLEANUP"] = "ON" + tc.cache_variables["ENABLE_CRYPTO_SYSTEM_PROFILE"] = "OFF" + tc.cache_variables["ENABLE_TRACING"] = "OFF" + tc.cache_variables["ENABLE_COVERAGE"] = "OFF" + 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_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_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_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" + # 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 + 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.generate() + + deps = CMakeDeps(self) + deps.generate() + + if self.options.with_ssl == "libressl" or self.options.with_zstd: + deps = PkgConfigDeps(self) + deps.generate() + env = VirtualBuildEnv(self) + env.generate() + + 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"]) + # cleanup rpath + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set (CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)", "") + + def build(self): + self._patch_sources() + 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")) + copy(self, "THIRD_PARTY_NOTICES", 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, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + # FIXME: two CMake module/config files should be generated (mongoc-1.0-config.cmake and bson-1.0-config.cmake), + # but it can't be modeled right now. + mongoc_target = "mongoc_shared" if self.options.shared else "mongoc_static" + self.cpp_info.set_property("cmake_file_name", "mongoc-1.0") + self.cpp_info.set_property("cmake_target_name", f"mongo::{mongoc_target}") + + self.cpp_info.filenames["cmake_find_package"] = "mongoc-1.0" + self.cpp_info.filenames["cmake_find_package_multi"] = "mongoc-1.0" + self.cpp_info.names["cmake_find_package"] = "mongo" + self.cpp_info.names["cmake_find_package_multi"] = "mongo" + + # mongoc + self.cpp_info.components["mongoc"].set_property("cmake_target_name", f"mongo::{mongoc_target}") + self.cpp_info.components["mongoc"].set_property("pkg_config_name", "libmongoc-1.0" if self.options.shared else "libmongoc-static-1.0") + + self.cpp_info.components["mongoc"].names["cmake_find_package"] = mongoc_target + self.cpp_info.components["mongoc"].names["cmake_find_package_multi"] = mongoc_target + + self.cpp_info.components["mongoc"].includedirs = [os.path.join("include", "libmongoc-1.0")] + self.cpp_info.components["mongoc"].libs = ["mongoc-1.0" if self.options.shared else "mongoc-static-1.0"] + if not self.options.shared: + self.cpp_info.components["mongoc"].defines = ["MONGOC_STATIC"] + self.cpp_info.components["mongoc"].requires = ["bson"] + if self.settings.os == "Windows": + self.cpp_info.components["mongoc"].system_libs.append("ws2_32") + if self.options.with_ssl == "darwin": + self.cpp_info.components["mongoc"].frameworks.extend(["CoreFoundation", "Security"]) + elif self.options.with_ssl == "windows": + self.cpp_info.components["mongoc"].system_libs.extend(["secur32", "crypt32", "bcrypt"]) + elif self.options.with_ssl == "openssl": + self.cpp_info.components["mongoc"].requires.append("openssl::openssl") + elif self.options.with_ssl == "libressl": + self.cpp_info.components["mongoc"].requires.append("libressl::libressl") + if self.options.with_sasl == "sspi": + self.cpp_info.components["mongoc"].system_libs.extend(["secur32", "crypt32", "shlwapi"]) + elif self.options.with_sasl == "cyrus": + self.cpp_info.components["mongoc"].requires.append("cyrus-sasl::cyrus-sasl") + if self.options.with_snappy: + self.cpp_info.components["mongoc"].requires.append("snappy::snappy") + if self.options.with_zlib: + self.cpp_info.components["mongoc"].requires.append("zlib::zlib") + if self.options.with_zstd: + self.cpp_info.components["mongoc"].requires.append("zstd::zstd") + if self.options.with_icu: + self.cpp_info.components["mongoc"].requires.append("icu::icu") + if self.options.srv: + self.cpp_info.components["mongoc"].system_libs.append("dnsapi" if self.settings.os == "Windows" else "resolv") + + # bson + bson_target = "bson_shared" if self.options.shared else "bson_static" + self.cpp_info.components["bson"].set_property("cmake_target_name", f"mongo::{bson_target}") + self.cpp_info.components["bson"].set_property("pkg_config_name", "libbson-1.0" if self.options.shared else "libbson-static-1.0") + + self.cpp_info.components["bson"].names["cmake_find_package"] = bson_target + self.cpp_info.components["bson"].names["cmake_find_package_multi"] = bson_target + + self.cpp_info.components["bson"].includedirs = [os.path.join("include", "libbson-1.0")] + self.cpp_info.components["bson"].libs = ["bson-1.0" if self.options.shared else "bson-static-1.0"] + if not self.options.shared: + self.cpp_info.components["bson"].defines = ["BSON_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["bson"].system_libs = ["m", "pthread", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.components["bson"].system_libs = ["ws2_32"] diff --git a/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch new file mode 100644 index 0000000000000..8767b278cd009 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch @@ -0,0 +1,77 @@ +--- 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) +@@ -272,6 +273,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}) +@@ -330,7 +332,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.17.6-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch new file mode 100644 index 0000000000000..dad7659403d2b --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch @@ -0,0 +1,77 @@ +--- 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 new file mode 100644 index 0000000000000..23d005b89467b --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch @@ -0,0 +1,77 @@ +--- 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-0002-fix-uninitialized-warning.patch b/recipes/mongo-c-driver/all/patches/1.22.0-0002-fix-uninitialized-warning.patch new file mode 100644 index 0000000000000..3c24ab717c0d5 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.22.0-0002-fix-uninitialized-warning.patch @@ -0,0 +1,13 @@ +diff --git a/src/libbson/src/bson/bson-iter.c b/src/libbson/src/bson/bson-iter.c +index 7b4630f..ee70f12 100644 +--- a/src/libbson/src/bson/bson-iter.c ++++ b/src/libbson/src/bson/bson-iter.c +@@ -2141,7 +2141,7 @@ bson_iter_visit_all (bson_iter_t *iter, /* INOUT */ + + if (iter->err_off) { + if (unsupported && visitor->visit_unsupported_type && +- bson_utf8_validate (key, strlen (key), false)) { ++ key != NULL && bson_utf8_validate (key, strlen (key), false)) { + visitor->visit_unsupported_type (iter, key, bson_type, data); + return false; + } diff --git a/recipes/mongo-c-driver/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 new file mode 100644 index 0000000000000..2ade48e877823 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch @@ -0,0 +1,15 @@ +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/all/patches/1.23.2-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.23.2-0001-disable-shared-when-static.patch new file mode 100644 index 0000000000000..1b39914f6b921 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.23.2-0001-disable-shared-when-static.patch @@ -0,0 +1,82 @@ +diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt +index d6df66f..dccdfee 100644 +--- 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 () +diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt +index 39f66ac..3f4eefc 100644 +--- 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,15 @@ 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") +@@ -1128,7 +1137,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/test_package/CMakeLists.txt b/recipes/mongo-c-driver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9ed8451d03a20 --- /dev/null +++ b/recipes/mongo-c-driver/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mongoc-1.0 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET mongo::mongoc_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongoc_shared mongo::bson_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongoc_static mongo::bson_static) +endif() diff --git a/recipes/mongo-c-driver/all/test_package/conanfile.py b/recipes/mongo-c-driver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mongo-c-driver/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/mongo-c-driver/all/test_package/test_package.c b/recipes/mongo-c-driver/all/test_package/test_package.c new file mode 100644 index 0000000000000..ef6f623a4cb67 --- /dev/null +++ b/recipes/mongo-c-driver/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + printf("mongoc version: %s\n", mongoc_get_version()); + printf("bson version: %s\n", bson_get_version()); + + return 0; +} diff --git a/recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt b/recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mongo-c-driver/all/test_v1_package/conanfile.py b/recipes/mongo-c-driver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mongo-c-driver/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/mongo-c-driver/config.yml b/recipes/mongo-c-driver/config.yml new file mode 100644 index 0000000000000..1b2d5cda4e394 --- /dev/null +++ b/recipes/mongo-c-driver/config.yml @@ -0,0 +1,15 @@ +versions: + "1.23.2": + folder: all + "1.22.2": + folder: all + "1.22.0": + folder: all + "1.17.6": + folder: all + "1.17.4": + folder: all + "1.17.3": + folder: all + "1.17.2": + folder: all diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml new file mode 100644 index 0000000000000..63919e45005aa --- /dev/null +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -0,0 +1,52 @@ +sources: + "3.7.0": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz" + sha256: "fb2da11178db728f63147fe4b0c7509eb49b1b02c5cb55f9bee5f927e451a0c7" + "3.6.7": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.7/mongo-cxx-driver-r3.6.7.tar.gz" + sha256: "2c58005d4fe46f1973352fba821f7bb37e818cefc922377ce979a9fd1bff38ac" + "3.6.6": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.6/mongo-cxx-driver-r3.6.6.tar.gz" + sha256: "d5906b9e308a8a353a2ef92b699c9b27ae28ec6b34fdda94e15d2981b27e64ca" + "3.6.2": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.2/mongo-cxx-driver-r3.6.2.tar.gz" + sha256: "24325dce74723f7632da76d0eeb5f5020828498cc5bc1a624c6d7117efb2b7cf" + "3.6.1": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.1/mongo-cxx-driver-r3.6.1.tar.gz" + sha256: "83523e897ef18f7ce05d85d1632dd4ba486c264a1b89c09020163ab29e11eab7" +patches: + "3.7.0": + - patch_file: "patches/3.7.0-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" + "3.6.7": + - patch_file: "patches/3.6.x-dirs_and_tests.patch" + patch_description: "disable test and documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" + "3.6.6": + - patch_file: "patches/3.6.x-dirs_and_tests.patch" + patch_description: "disable test and documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" + "3.6.2": + - patch_file: "patches/3.6.x-dirs_and_tests.patch" + patch_description: "disable test and documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" + "3.6.1": + - patch_file: "patches/3.6.x-dirs_and_tests.patch" + patch_description: "disable test and documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" diff --git a/recipes/mongo-cxx-driver/all/conanfile.py b/recipes/mongo-cxx-driver/all/conanfile.py new file mode 100644 index 0000000000000..118ad3a647540 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -0,0 +1,199 @@ +from conan import ConanFile +from conan.errors import ConanException, 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 export_conandata_patches, apply_conandata_patches, copy, get, rm, rmdir +from conan.tools.scm import Version +import os +import shutil + +required_conan_version = ">=1.54.0" + + +class MongoCxxConan(ConanFile): + name = "mongo-cxx-driver" + 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") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "polyfill": ["std", "boost", "mnmlstc", "experimental"], + "with_ssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "polyfill": "boost", + "with_ssl": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("mongo-c-driver/1.23.2") + if self.options.polyfill == "boost": + self.requires("boost/1.81.0") + + @property + def _minimal_std_version(self): + return { + "std": "17", + "experimental": "14", + "boost": "11", + "polyfill": "11" + }[str(self.options.polyfill)] + + @property + def _compilers_minimum_version(self): + if self.info.options.polyfill == "std": + # C++17 + return { + "Visual Studio": "15", + "gcc": "7", + "clang": "5", + "apple-clang": "10" + } + elif self.info.options.polyfill == "experimental": + # C++14 + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "3.5", + "apple-clang": "10" + } + elif self.info.options.polyfill == "boost": + # C++11 + return { + "Visual Studio": "14", + "gcc": "5", + "clang": "3.3", + "apple-clang": "9" + } + else: + raise ConanException( + f"please, specify _compilers_minimum_version for {self.options.polyfill} polyfill" + ) + + def validate(self): + if self.options.with_ssl and not bool(self.dependencies["mongo-c-driver"].options.with_ssl): + raise ConanInvalidConfiguration("mongo-cxx-driver with_ssl=True requires mongo-c-driver with a ssl implementation") + + if self.options.polyfill == "mnmlstc": + # TODO: add mnmlstc polyfill support + # Cannot model mnmlstc (not packaged, is pulled dynamically) polyfill dependencies + raise ConanInvalidConfiguration("mnmlstc polyfill is not yet supported") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimal_std_version) + + compiler = str(self.settings.compiler) + if self.options.polyfill == "experimental" and compiler == "apple-clang": + raise ConanInvalidConfiguration("experimental polyfill is not supported for apple-clang") + + version = Version(self.settings.compiler.version) + if compiler in self._compilers_minimum_version and version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires a compiler that supports at least C++{self._minimal_std_version}", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BSONCXX_POLY_USE_MNMLSTC"] = self.options.polyfill == "mnmlstc" + tc.variables["BSONCXX_POLY_USE_STD"] = self.options.polyfill == "std" + tc.variables["BSONCXX_POLY_USE_STD_EXPERIMENTAL"] = self.options.polyfill == "experimental" + tc.variables["BSONCXX_POLY_USE_BOOST"] = self.options.polyfill == "boost" + tc.cache_variables["BUILD_VERSION"] = self.version + tc.cache_variables["BSONCXX_LINK_WITH_STATIC_MONGOC"] = "OFF" if self.dependencies["mongo-c-driver"].options.shared else "ON" + tc.cache_variables["MONGOCXX_LINK_WITH_STATIC_MONGOC"] = "OFF" if self.dependencies["mongo-c-driver"].options.shared else "ON" + tc.variables["MONGOCXX_ENABLE_SSL"] = self.options.with_ssl + if not valid_min_cppstd(self, self._minimal_std_version): + tc.variables["CMAKE_CXX_STANDARD"] = self._minimal_std_version + tc.variables["ENABLE_TESTS"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + # FIXME: two CMake module/config files should be generated (mongoc-1.0-config.cmake and bson-1.0-config.cmake), + # but it can't be modeled right now. + # Fix should happen in mongo-c-driver recipe + mongoc_config_file = os.path.join(self.generators_folder, "mongoc-1.0-config.cmake") + bson_config_file = os.path.join(self.generators_folder, "bson-1.0-config.cmake") + if not os.path.exists(bson_config_file): + self.output.info("Copying mongoc config file to bson") + shutil.copy(src=mongoc_config_file, dst=bson_config_file) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "THIRD-PARTY-NOTICES", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if self.settings.os == "Windows": + for vc_file in ("concrt", "msvcp", "vcruntime"): + rm(self, f"{vc_file}*.dll", 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")) + + def package_info(self): + # FIXME: two CMake module/config files should be generated (mongocxx-config.cmake and bsoncxx-config.cmake), + # but it can't be modeled right now. + mongocxx_target = "mongocxx_shared" if self.options.shared else "mongocxx_static" + self.cpp_info.set_property("cmake_file_name", "mongocxx") + self.cpp_info.set_property("cmake_target_name", f"mongo::{mongocxx_target}") + + self.cpp_info.filenames["cmake_find_package"] = "mongocxx" + self.cpp_info.filenames["cmake_find_package_multi"] = "mongocxx" + self.cpp_info.names["cmake_find_package"] = "mongo" + self.cpp_info.names["cmake_find_package_multi"] = "mongo" + + # mongocxx + self.cpp_info.components["mongocxx"].set_property("cmake_target_name", f"mongo::{mongocxx_target}") + self.cpp_info.components["mongocxx"].set_property("pkg_config_name", "libmongocxx" if self.options.shared else "libmongocxx-static") + + self.cpp_info.components["mongocxx"].names["cmake_find_package"] = mongocxx_target + self.cpp_info.components["mongocxx"].names["cmake_find_package_multi"] = mongocxx_target + + self.cpp_info.components["mongocxx"].libs = ["mongocxx" if self.options.shared else "mongocxx-static"] + 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"] + + # bsoncxx + bsoncxx_target = "bsoncxx_shared" if self.options.shared else "bsoncxx_static" + self.cpp_info.components["bsoncxx"].set_property("cmake_target_name", f"mongo::{bsoncxx_target}") + self.cpp_info.components["bsoncxx"].set_property("pkg_config_name", "libbsoncxx" if self.options.shared else "libbsoncxx-static") + + self.cpp_info.components["bsoncxx"].names["cmake_find_package"] = bsoncxx_target + self.cpp_info.components["bsoncxx"].names["cmake_find_package_multi"] = bsoncxx_target + + self.cpp_info.components["bsoncxx"].libs = ["bsoncxx" if self.options.shared else "bsoncxx-static"] + if not self.options.shared: + self.cpp_info.components["bsoncxx"].defines = ["BSONCXX_STATIC"] + self.cpp_info.components["bsoncxx"].requires = ["mongo-c-driver::bson"] + if self.options.polyfill == "boost": + self.cpp_info.components["bsoncxx"].requires.append("boost::headers") diff --git a/recipes/mongo-cxx-driver/all/patches/3.6.x-dirs_and_tests.patch b/recipes/mongo-cxx-driver/all/patches/3.6.x-dirs_and_tests.patch new file mode 100644 index 0000000000000..f1fed9501d06a --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.6.x-dirs_and_tests.patch @@ -0,0 +1,121 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2bc2a1..6b2d5ac 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -190,6 +190,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include (MakeDistFiles) + ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -245,22 +246,20 @@ 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) +- +-enable_testing() ++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(benchmark EXCLUDE_FROM_ALL) +- + # Implement 'dist' target + # + # CMake does not implement anything like 'dist' from autotools. + # This implementation is based on the one in GnuCash. + ++if(FALSE) + add_subdirectory (cmake) + add_subdirectory (data) + add_subdirectory (docs) +@@ -356,4 +355,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 7c79f45..0fcb305 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -71,7 +71,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$ + set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA}) + message ("bsoncxx version: ${BSONCXX_VERSION}") + set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}") +-set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE INTERNAL "") + + set(LIBBSON_REQUIRED_VERSION 1.13.0) + set(LIBBSON_REQUIRED_ABI_VERSION 1.0) +@@ -79,7 +79,8 @@ set(LIBBSON_REQUIRED_ABI_VERSION 1.0) + set(bsoncxx_pkg_dep "") + + # Attempt to find libbson by new package name (without lib). +-find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} QUIET) ++find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED) ++set(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND TRUE) + + if(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND) + message ("found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") +@@ -139,8 +140,8 @@ set(bsoncxx_sources + ) + + include_directories( +- ${CMAKE_SOURCE_DIR}/src +- ${CMAKE_BINARY_DIR}/src ++ ${MONGO_CXX_PROJECT_DIR}/src ++ ${MONGO_CXX_PROJECT_BIN_DIR}/src + ) + + if(BSONCXX_POLY_USE_BOOST) +@@ -204,8 +205,6 @@ if(BSONCXX_BUILD_STATIC) + endif() + bsoncxx_install("${bsoncxx_target_list}" "${bsoncxx_pkg_dep}") + +-add_subdirectory(test) +- + set_local_dist (src_bsoncxx_DIST_local + CMakeLists.txt + array/element.cpp +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index f67ae35..c997f25 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -27,7 +27,7 @@ set(MONGOCXX_VERSION_NO_EXTRA ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR + set(MONGOCXX_VERSION ${MONGOCXX_VERSION_NO_EXTRA}${MONGOCXX_VERSION_EXTRA}) + message ("mongocxx version: ${MONGOCXX_VERSION}") + set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}") +-set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/" CACHE INTERNAL "") + + set(LIBMONGOC_REQUIRED_VERSION 1.17.0) + set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0) +@@ -163,8 +163,8 @@ set(mongocxx_sources + ) + + include_directories( +- ${CMAKE_SOURCE_DIR}/src +- ${CMAKE_BINARY_DIR}/src ++ ${MONGO_CXX_PROJECT_DIR}/src ++ ${MONGO_CXX_PROJECT_BIN_DIR}/src + ) + + # We define both the normal libraries and the testing-only library. The testing-only +@@ -231,8 +231,6 @@ if(MONGOCXX_BUILD_STATIC) + endif() + mongocxx_install("${mongocxx_target_list}" "${mongocxx_pkg_dep}") + +-add_subdirectory(test) +- + set_local_dist (src_mongocxx_DIST_local + CMakeLists.txt + bulk_write.cpp diff --git a/recipes/mongo-cxx-driver/all/patches/3.7.0-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.7.0-dirs.patch new file mode 100644 index 0000000000000..0166bc9b8ae35 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.7.0-dirs.patch @@ -0,0 +1,80 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20254fa..d7dc7c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,6 +206,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include (MakeDistFiles) + ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -261,6 +262,7 @@ add_custom_target(format-lint + add_custom_target(docs + DEPENDS hugo doxygen-current + ) ++endif() + + set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) + +@@ -270,6 +272,9 @@ if (ENABLE_TESTS) + enable_testing() + endif () + ++set(MONGO_CXX_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ++set(MONGO_CXX_PROJECT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) ++ + add_subdirectory(src) + + add_subdirectory(examples EXCLUDE_FROM_ALL) +@@ -281,6 +286,7 @@ add_subdirectory(benchmark EXCLUDE_FROM_ALL) + # CMake does not implement anything like 'dist' from autotools. + # This implementation is based on the one in GnuCash. + ++if(FALSE) + add_subdirectory (cmake) + add_subdirectory (data) + add_subdirectory (docs) +@@ -381,4 +387,4 @@ endif () + if (CMAKE_GENERATOR_TOOLSET) + message (STATUS "\tinstance: ${CMAKE_GENERATOR_TOOLSET}") + endif () +- ++endif() +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index d87d588..1aefd91 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -71,7 +71,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$ + set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA}) + message ("bsoncxx version: ${BSONCXX_VERSION}") + set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}") +-set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE INTERNAL "") + + set(LIBBSON_REQUIRED_VERSION 1.13.0) + set(LIBBSON_REQUIRED_ABI_VERSION 1.0) +@@ -94,7 +94,8 @@ if(TARGET bson_shared OR TARGET bson_static) + endif() + else() + # Attempt to find libbson by new package name (without lib). +- find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} QUIET) ++ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED) ++ set(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND TRUE) + + if(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND) + message ("found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 7106040..3be4b83 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -27,7 +27,7 @@ set(MONGOCXX_VERSION_NO_EXTRA ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR + set(MONGOCXX_VERSION ${MONGOCXX_VERSION_NO_EXTRA}${MONGOCXX_VERSION_EXTRA}) + message ("mongocxx version: ${MONGOCXX_VERSION}") + set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}") +-set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/" CACHE INTERNAL "") + + set(LIBMONGOC_REQUIRED_VERSION 1.19.0) + set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0) diff --git a/recipes/mongo-cxx-driver/all/patches/poly_use_std_define.patch b/recipes/mongo-cxx-driver/all/patches/poly_use_std_define.patch new file mode 100644 index 0000000000000..54fa46009b6a7 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/poly_use_std_define.patch @@ -0,0 +1,13 @@ +diff --git a/src/bsoncxx/stdx/make_unique.hpp b/src/bsoncxx/stdx/make_unique.hpp +index d954eae..737e76b 100644 +--- a/src/bsoncxx/stdx/make_unique.hpp ++++ b/src/bsoncxx/stdx/make_unique.hpp +@@ -48,7 +48,7 @@ using ::boost::make_unique; + BSONCXX_INLINE_NAMESPACE_END + } // namespace bsoncxx + +-#elif __cplusplus >= 201402L ++#elif defined(BSONCXX_POLY_USE_STD) + + #include + diff --git a/recipes/mongo-cxx-driver/all/test_package/CMakeLists.txt b/recipes/mongo-cxx-driver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3d606dc3359ce --- /dev/null +++ b/recipes/mongo-cxx-driver/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mongocxx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +if(${MONGO-CXX-DRIVER_POLYFILL} STREQUAL "std") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +elseif(${MONGO-CXX-DRIVER_POLYFILL} STREQUAL "experimental") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() + +if(TARGET mongo::mongocxx_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_shared mongo::bsoncxx_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_static mongo::bsoncxx_static) +endif() diff --git a/recipes/mongo-cxx-driver/all/test_package/conanfile.py b/recipes/mongo-cxx-driver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..00f1cae8925b9 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MONGO-CXX-DRIVER_POLYFILL"] = self.dependencies["mongo-cxx-driver"].options.polyfill + 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/mongo-cxx-driver/all/test_package/test_package.cpp b/recipes/mongo-cxx-driver/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..57282320fb7a6 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +#include +#include +#include + +// Compilation check +#include +#include +#include + +int main() { + const mongocxx::instance instance_; // This should be done only once. + mongocxx::client client{mongocxx::uri{}}; + return EXIT_SUCCESS; +} diff --git a/recipes/mongo-cxx-driver/all/test_v1_package/CMakeLists.txt b/recipes/mongo-cxx-driver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mongo-cxx-driver/all/test_v1_package/conanfile.py b/recipes/mongo-cxx-driver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..51b7ca5da9cc7 --- /dev/null +++ b/recipes/mongo-cxx-driver/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.definitions["MONGO-CXX-DRIVER_POLYFILL"] = self.options["mongo-cxx-driver"].polyfill + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/mongo-cxx-driver/config.yml b/recipes/mongo-cxx-driver/config.yml new file mode 100644 index 0000000000000..fe3fd8b511744 --- /dev/null +++ b/recipes/mongo-cxx-driver/config.yml @@ -0,0 +1,11 @@ +versions: + "3.7.0": + folder: all + "3.6.7": + folder: all + "3.6.6": + folder: all + "3.6.2": + folder: all + "3.6.1": + folder: all diff --git a/recipes/morton-nd/all/conandata.yml b/recipes/morton-nd/all/conandata.yml new file mode 100644 index 0000000000000..41b2951c67096 --- /dev/null +++ b/recipes/morton-nd/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "4.0.0": + url: "https://github.com/kevinhartman/morton-nd/archive/refs/tags/v4.0.0.tar.gz" + sha256: "29337c7f7afb6361dd483ca4fe2111aad9d590f3b9d3fe519856a5bdf450e059" + "3.0.0": + url: "https://github.com/kevinhartman/morton-nd/archive/v3.0.0.tar.gz" + sha256: "ba57df04a2e1e73709f55fd3fee71082750013c5792de3c6eb84a8c87d40d781" diff --git a/recipes/morton-nd/all/conanfile.py b/recipes/morton-nd/all/conanfile.py new file mode 100644 index 0000000000000..5e3263ed60dd4 --- /dev/null +++ b/recipes/morton-nd/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class MortonndConan(ConanFile): + name = "morton-nd" + 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") + homepage = "https://github.com/kevinhartman/morton-nd" + url = "https://github.com/conan-io/conan-center-index" + 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": "5", + "Visual Studio": "14", + "msvc": "190", + "clang": "3.4", + "apple-clang": "5.1", + } + + 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + 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_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" + self.cpp_info.names["cmake_find_package_multi"] = "morton-nd" + self.cpp_info.components["mortonnd"].names["cmake_find_package"] = "MortonND" + 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/test_package/CMakeLists.txt b/recipes/morton-nd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3d6da2fa9a946 --- /dev/null +++ b/recipes/morton-nd/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(morton-nd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} 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() diff --git a/recipes/morton-nd/all/test_package/conanfile.py b/recipes/morton-nd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/morton-nd/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/morton-nd/all/test_package/test_package.cpp b/recipes/morton-nd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..20216f26365e9 --- /dev/null +++ b/recipes/morton-nd/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#ifdef MORTONND_LESS_4_0_0 +#include +#else +#include +#endif + +int main() { + constexpr auto MortonND_3D_64 = mortonnd::MortonNDLutEncoder<5, 12, 4>(); + auto encoding = MortonND_3D_64.Encode(17, 13, 9, 5, 1); + return 0; +} diff --git a/recipes/morton-nd/all/test_v1_package/CMakeLists.txt b/recipes/morton-nd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..07fa1c30a5235 --- /dev/null +++ b/recipes/morton-nd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +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() diff --git a/recipes/morton-nd/all/test_v1_package/conanfile.py b/recipes/morton-nd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/morton-nd/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/morton-nd/config.yml b/recipes/morton-nd/config.yml new file mode 100644 index 0000000000000..b1681bacb18ae --- /dev/null +++ b/recipes/morton-nd/config.yml @@ -0,0 +1,5 @@ +versions: + "4.0.0": + folder: all + "3.0.0": + folder: all diff --git a/recipes/mosquitto/1.x/conandata.yml b/recipes/mosquitto/1.x/conandata.yml new file mode 100644 index 0000000000000..71a70509ff81d --- /dev/null +++ b/recipes/mosquitto/1.x/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.6.12": + url: "https://mosquitto.org/files/source/mosquitto-1.6.12.tar.gz" + sha256: "548d73d19fb787dd0530334e398fd256ef3a581181678488a741a995c4f007fb" +patches: + "1.6.12": + - patch_file: "patches/1.6.12-0001-fix-cmake.patch" + patch_description: "Several CMake fixes: installation and system libs on Windows, bad CMakeLists initialization" + patch_type: "conan" + - patch_file: "patches/1.6.12-0002-fix-macos.patch" + patch_description: "Add missing includes for macOS" + patch_type: "conan" diff --git a/recipes/mosquitto/1.x/conanfile.py b/recipes/mosquitto/1.x/conanfile.py new file mode 100644 index 0000000000000..c9cd7eb5586db --- /dev/null +++ b/recipes/mosquitto/1.x/conanfile.py @@ -0,0 +1,115 @@ +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, rm, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class MosquittoConan(ConanFile): + name = "mosquitto" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eclipse/mosquitto" + topics = ("mqtt", "broker", "libwebsockets", "eclipse", "iot") + license = "EPL-1.0", "BSD-3-Clause" # https://lists.spdx.org/g/Spdx-legal/message/2701 + description = "Eclipse Mosquitto - An open source MQTT broker" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tls": [True, False], + "with_websockets": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tls": True, + "with_websockets": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_tls: + self.requires("openssl/1.1.1s") + if self.options.with_websockets: + self.requires("libwebsockets/4.3.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["WITH_STATIC_LIBRARIES"] = not self.options.shared + tc.variables["WITH_TLS"] = self.options.with_tls + tc.variables["WITH_TLS_PSK"] = self.options.with_tls + tc.variables["WITH_EC"] = self.options.with_tls + tc.variables["DOCUMENTATION"] = False + tc.variables["WITH_THREADING"] = not is_msvc(self) + tc.variables["CMAKE_INSTALL_SYSCONFDIR"] = "res" + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + for license_file in ("LICENSE.txt", "edl-v10", "epl-v10"): + copy(self, license_file, 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")) + if not self.options.shared: + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "mosquitto.lib", os.path.join(self.package_folder, "lib")) + rm(self, "mosquittopp.lib", os.path.join(self.package_folder, "lib")) + rm(self, "*.dll.a", os.path.join(self.package_folder, "lib")) + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + rm(self, "*.dylib", os.path.join(self.package_folder, "lib")) + + def package_info(self): + lib_suffix = "_static" if not self.options.shared else "" + self.cpp_info.components["libmosquitto"].set_property("pkg_config_name", "libmosquitto") + self.cpp_info.components["libmosquitto"].libs = [f"mosquitto{lib_suffix}"] + self.cpp_info.components["libmosquitto"].resdirs = ["res"] + if not self.options.shared: + self.cpp_info.components["libmosquitto"].defines.append("LIBMOSQUITTO_STATIC") + if self.options.with_tls: + self.cpp_info.components["libmosquitto"].requires.append("openssl::openssl") + self.cpp_info.components["libmosquitto"].defines.extend(["WITH_TLS", "WITH_TLS_PSK", "WITH_EC"]) + if self.options.with_websockets: + self.cpp_info.components["libmosquitto"].requires.append("libwebsockets::libwebsockets") + self.cpp_info.components["libmosquitto"].defines.append("WITH_WEBSOCKETS") + if self.settings.os == "Windows": + self.cpp_info.components["libmosquitto"].system_libs.append("ws2_32") + if self.options.with_tls: + self.cpp_info.components["libmosquitto"].system_libs.append("crypt32") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libmosquitto"].system_libs.extend(["rt", "pthread", "dl"]) + + self.cpp_info.components["libmosquittopp"].set_property("pkg_config_name", "libmosquittopp") + self.cpp_info.components["libmosquittopp"].libs = [f"mosquittopp{lib_suffix}"] + self.cpp_info.components["libmosquittopp"].requires = ["libmosquitto"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/mosquitto/1.x/patches/1.6.12-0001-fix-cmake.patch b/recipes/mosquitto/1.x/patches/1.6.12-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1e2a3630d2035 --- /dev/null +++ b/recipes/mosquitto/1.x/patches/1.6.12-0001-fix-cmake.patch @@ -0,0 +1,68 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,11 +4,11 @@ + # To configure the build options either use the CMake gui, or run the command + # line utility including the "-i" option. + ++cmake_minimum_required(VERSION 3.1) + set(CMAKE_LEGACY_CYGWIN_WIN32 0) + + project(mosquitto) + +-cmake_minimum_required(VERSION 2.8) + # Only for version 3 and up. cmake_policy(SET CMP0042 NEW) + + set (VERSION 1.6.12) +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -65,6 +65,9 @@ endif (UNIX AND NOT APPLE) + + if (WIN32) + set (LIBRARIES ${LIBRARIES} ws2_32) ++ if(WITH_TLS) ++ list(APPEND LIBRARIES crypt32) ++ endif() + endif (WIN32) + + if (WITH_SRV) +@@ -91,7 +94,7 @@ set_target_properties(libmosquitto PROPERTIES + SOVERSION 1 + ) + +-install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if (WITH_STATIC_LIBRARIES) + add_library(libmosquitto_static STATIC ${C_SRC}) +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -13,7 +13,7 @@ set_target_properties(mosquittopp PROPERTIES + VERSION ${VERSION} + SOVERSION 1 + ) +-install(TARGETS mosquittopp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++install(TARGETS mosquittopp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if (WITH_STATIC_LIBRARIES) + add_library(mosquittopp_static STATIC +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -167,6 +167,9 @@ endif (UNIX) + + if (WIN32) + set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32) ++ if(WITH_TLS) ++ list(APPEND MOSQ_LIBS crypt32) ++ endif() + endif (WIN32) + + if (WITH_WEBSOCKETS) +@@ -198,5 +201,8 @@ install(FILES mosquitto_broker.h mosquitto_plugin.h DESTINATION "${CMAKE_INSTALL + if (WITH_TLS) + add_executable(mosquitto_passwd mosquitto_passwd.c ../lib/misc_mosq.c) + target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES}) ++ if(WIN32) ++ target_link_libraries(mosquitto_passwd ws2_32 crypt32) ++ endif() + install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif (WITH_TLS) diff --git a/recipes/mosquitto/1.x/patches/1.6.12-0002-fix-macos.patch b/recipes/mosquitto/1.x/patches/1.6.12-0002-fix-macos.patch new file mode 100644 index 0000000000000..31267eccf3f27 --- /dev/null +++ b/recipes/mosquitto/1.x/patches/1.6.12-0002-fix-macos.patch @@ -0,0 +1,24 @@ +--- a/lib/mosquitto.c ++++ b/lib/mosquitto.c +@@ -23,6 +23,9 @@ Contributors: + #include + #include + #endif ++#ifdef __APPLE__ ++#include ++#endif + + #include "logging_mosq.h" + #include "mosquitto.h" +--- a/src/logging.c ++++ b/src/logging.c +@@ -22,6 +22,9 @@ Contributors: + #include + #endif + #include ++#ifdef __APPLE__ ++#include ++#endif + + #ifdef WITH_DLT + #include diff --git a/recipes/mosquitto/1.x/test_package/CMakeLists.txt b/recipes/mosquitto/1.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1e99239bfe10 --- /dev/null +++ b/recipes/mosquitto/1.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mosquitto REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mosquitto::libmosquitto) diff --git a/recipes/mosquitto/1.x/test_package/conanfile.py b/recipes/mosquitto/1.x/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/mosquitto/1.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/mosquitto/1.x/test_package/test_package.c b/recipes/mosquitto/1.x/test_package/test_package.c new file mode 100644 index 0000000000000..53439ed97c364 --- /dev/null +++ b/recipes/mosquitto/1.x/test_package/test_package.c @@ -0,0 +1,59 @@ +#include +#include +#ifdef WIN32 +# include +#endif + +#include "mosquitto.h" + +/* Hostname and port for the MQTT broker. */ +#define BROKER_HOSTNAME "localhost" +#define BROKER_PORT 1883 + +void connect_callback(struct mosquitto *mosq, void *obj, int result) {} +void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) {} + +int main(int argc, char * argv []) { + struct mosquitto* st_mosquitto = NULL; + + #ifdef WIN32 + WORD wVersionRequested = MAKEWORD(2, 2); + WSADATA wsaData; + WSAStartup(wVersionRequested, &wsaData); + #endif + + puts("mosquitto_lib_init"); + if (mosquitto_lib_init() != MOSQ_ERR_SUCCESS) { + return EXIT_FAILURE; + } + + puts("mosquitto_new"); + st_mosquitto = mosquitto_new("foobar", true, NULL); + if (!st_mosquitto) { + return EXIT_FAILURE; + } + + puts("mosquitto_connect_callback_set"); + mosquitto_connect_callback_set(st_mosquitto, connect_callback); + mosquitto_message_callback_set(st_mosquitto, message_callback); + + puts("mosquitto_connect"); + if (mosquitto_connect(st_mosquitto, BROKER_HOSTNAME, BROKER_PORT, 60) != MOSQ_ERR_SUCCESS) { + fprintf(stderr, "Could not connect to MQTT broker\n"); + } + + puts("mosquitto_subscribe"); + if (mosquitto_subscribe(st_mosquitto, NULL, "#", 0) != MOSQ_ERR_SUCCESS) { + fprintf(stderr, "Could not suscribe to MQTT broker\n"); + } + + puts("mosquitto_destroy"); + mosquitto_destroy(st_mosquitto); + + puts("mosquitto_lib_cleanup"); + if (mosquitto_lib_cleanup() != MOSQ_ERR_SUCCESS) { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/mosquitto/1.x/test_v1_package/CMakeLists.txt b/recipes/mosquitto/1.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mosquitto/1.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mosquitto/1.x/test_v1_package/conanfile.py b/recipes/mosquitto/1.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mosquitto/1.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mosquitto/2.x/conandata.yml b/recipes/mosquitto/2.x/conandata.yml new file mode 100644 index 0000000000000..622f72a77af8b --- /dev/null +++ b/recipes/mosquitto/2.x/conandata.yml @@ -0,0 +1,25 @@ +sources: + "2.0.15": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.15.tar.gz" + sha256: "26dc3f1758b00c1725a0e4dd32f40c61f374375717f09b6af2bac62c5b44f1eb" + "2.0.14": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.14.tar.gz" + sha256: "c0ce97b1911d1769ccfd65da237e919fd7eaa60209fd190c113d63fbd0c40347" + "2.0.12": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.12.tar.gz" + sha256: "b4995d1505f5643d98ff9a921e0399437fc95c4f0c92693cfe28401baf1fed21" + "2.0.11": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.11.tar.gz" + sha256: "0d46f0cbfa98c353ea9562a9e1219f60b9530463ae98b68fbe9bc828fcf9dbbc" + "2.0.10": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.10.tar.gz" + sha256: "448e7cf4b422501c0ce7cb33caa8f31ac350118ce9fc5101db852c1f49a7d096" + "2.0.7": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.7.tar.gz" + sha256: "bd3387259c0db991eb83b13b90fb4c22486cbcad801f826f805066a32ae244f3" + "2.0.5": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.5.tar.gz" + sha256: "733b3e62c4cc41d54acb6ed18a4b585564b32a9e560bcf8165ed30d9043780c5" + "2.0.3": + url: https://github.com/eclipse/mosquitto/archive/v2.0.3.tar.gz + sha256: "a0b02ebb32e6bb09da1c15a32eac2332bd803ddbb5129be2d6d584af601adee5" diff --git a/recipes/mosquitto/2.x/conanfile.py b/recipes/mosquitto/2.x/conanfile.py new file mode 100644 index 0000000000000..6af30191cdf13 --- /dev/null +++ b/recipes/mosquitto/2.x/conanfile.py @@ -0,0 +1,171 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + + +required_conan_version = ">=1.53.0" + + +class Mosquitto(ConanFile): + name = "mosquitto" + license = "EPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://mosquitto.org" + description = """Eclipse Mosquitto MQTT library, broker and more""" + topics = ("MQTT", "IoT", "eclipse") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ssl": [True, False], + "clients": [True, False], + "broker": [True, False], + "apps": [True, False], + "cjson": [True, False], + "build_cpp": [True, False], + "websockets": [True, False], + "threading": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "ssl": True, + "clients": False, + "broker": False, + "apps": False, + "cjson": True, # https://github.com/eclipse/mosquitto/commit/bbe0afbfbe7bb392361de41e275759ee4ef06b1c + "build_cpp": True, + "websockets": False, + "threading": True, + } + generators = "CMakeDeps" + + 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") + if not self.options.clients: + self.options.rm_safe("cjson") + if not self.options.broker: + self.options.rm_safe("websockets") + if not self.options.build_cpp: + self.options.rm_safe("compiler.libcxx") + self.options.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.ssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.get_safe("cjson"): + self.requires("cjson/1.7.14") + if self.options.get_safe("websockets"): + self.requires("libwebsockets/4.2.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_STATIC_LIBRARIES"] = not self.options.shared + tc.variables["WITH_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["WITH_TLS"] = self.options.ssl + tc.variables["WITH_CLIENTS"] = self.options.clients + if Version(self.version) < "2.0.6": + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_cJSON"] = not self.options.get_safe("cjson") + else: + tc.variables["WITH_CJSON"] = self.options.get_safe("cjson") + tc.variables["WITH_BROKER"] = self.options.broker + tc.variables["WITH_APPS"] = self.options.apps + tc.variables["WITH_PLUGINS"] = False + tc.variables["WITH_LIB_CPP"] = self.options.build_cpp + tc.variables["WITH_THREADING"] = not is_msvc(self) and self.options.threading + tc.variables["WITH_WEBSOCKETS"] = self.options.get_safe("websockets", False) + tc.variables["STATIC_WEBSOCKETS"] = self.options.get_safe("websockets", False) and not self.dependencies["libwebsockets"].options.shared + tc.variables["DOCUMENTATION"] = False + tc.variables["CMAKE_INSTALL_SYSCONFDIR"] = os.path.join(self.package_folder, "res").replace("\\", "/") + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + for license_file in ("LICENSE.txt", "edl-v10", "epl-v20"): + copy(self, license_file, 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")) + rm(self, "*.example", os.path.join(self.package_folder, "res")) + package_lib_folder = os.path.join(self.package_folder, "lib") + if not self.options.shared: + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "mosquitto.lib", package_lib_folder) + rm(self, "mosquittopp.lib", package_lib_folder) + rm(self, "*.dll.a", package_lib_folder) + rm(self, "*.so*", package_lib_folder) + rm(self, "*.dylib", package_lib_folder) + elif self.options.shared and is_msvc(self): + lib_folder = os.path.join(self.build_folder, "lib", str(self.settings.build_type)) + copy(self, "mosquitto.lib", lib_folder, package_lib_folder) + if self.options.build_cpp: + libpp_folder = os.path.join(self.build_folder, "lib", "cpp", str(self.settings.build_type)) + copy(self, "mosquittopp.lib", libpp_folder, package_lib_folder) + + def package_info(self): + lib_suffix = "" if self.options.shared else "_static" + self.cpp_info.components["libmosquitto"].set_property("pkg_config_name", "libmosquitto") + self.cpp_info.components["libmosquitto"].libs = [f"mosquitto{lib_suffix}"] + self.cpp_info.components["libmosquitto"].resdirs = ["res"] + if not self.options.shared: + self.cpp_info.components["libmosquitto"].defines = ["LIBMOSQUITTO_STATIC"] + if self.options.ssl: + self.cpp_info.components["libmosquitto"].requires = ["openssl::openssl"] + if self.settings.os == "Linux": + self.cpp_info.components["libmosquitto"].system_libs = ["pthread", "m"] + elif self.settings.os == "Windows": + self.cpp_info.components["libmosquitto"].system_libs = ["ws2_32"] + + if self.options.build_cpp: + self.cpp_info.components["libmosquittopp"].set_property("pkg_config_name", "libmosquittopp") + self.cpp_info.components["libmosquittopp"].libs = [f"mosquittopp{lib_suffix}"] + self.cpp_info.components["libmosquittopp"].requires = ["libmosquitto"] + if self.settings.os == "Linux": + self.cpp_info.components["libmosquittopp"].system_libs = ["pthread", "m"] + elif self.settings.os == "Windows": + self.cpp_info.components["libmosquittopp"].system_libs = ["ws2_32"] + + if self.options.broker: + self.cpp_info.components["mosquitto_broker"].libdirs = [] + self.cpp_info.components["mosquitto_broker"].includedirs = [] + if self.options.websockets: + self.cpp_info.components["mosquitto_broker"].requires.append("libwebsockets::libwebsockets") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["mosquitto_broker"].system_libs = ["pthread", "m"] + elif self.settings.os == "Windows": + self.cpp_info.components["mosquitto_broker"].system_libs = ["ws2_32"] + + for option in ["apps", "clients"]: + if self.options.get_safe(option): + option_comp_name = "mosquitto_{}".format(option) + self.cpp_info.components[option_comp_name].libdirs = [] + self.cpp_info.components[option_comp_name].includedirs = [] + self.cpp_info.components[option_comp_name].requires = ["openssl::openssl", "libmosquitto"] + if self.options.cjson: + self.cpp_info.components[option_comp_name].requires.append("cjson::cjson") + + # TODO: to remove in conan v2 + if self.options.broker or self.options.get_safe("apps") or self.options.get_safe("clients"): + 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) diff --git a/recipes/mosquitto/2.x/test_package/CMakeLists.txt b/recipes/mosquitto/2.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1e99239bfe10 --- /dev/null +++ b/recipes/mosquitto/2.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mosquitto REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mosquitto::libmosquitto) diff --git a/recipes/mosquitto/2.x/test_package/conanfile.py b/recipes/mosquitto/2.x/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/mosquitto/2.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/mosquitto/2.x/test_package/test_package.c b/recipes/mosquitto/2.x/test_package/test_package.c new file mode 100644 index 0000000000000..53439ed97c364 --- /dev/null +++ b/recipes/mosquitto/2.x/test_package/test_package.c @@ -0,0 +1,59 @@ +#include +#include +#ifdef WIN32 +# include +#endif + +#include "mosquitto.h" + +/* Hostname and port for the MQTT broker. */ +#define BROKER_HOSTNAME "localhost" +#define BROKER_PORT 1883 + +void connect_callback(struct mosquitto *mosq, void *obj, int result) {} +void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) {} + +int main(int argc, char * argv []) { + struct mosquitto* st_mosquitto = NULL; + + #ifdef WIN32 + WORD wVersionRequested = MAKEWORD(2, 2); + WSADATA wsaData; + WSAStartup(wVersionRequested, &wsaData); + #endif + + puts("mosquitto_lib_init"); + if (mosquitto_lib_init() != MOSQ_ERR_SUCCESS) { + return EXIT_FAILURE; + } + + puts("mosquitto_new"); + st_mosquitto = mosquitto_new("foobar", true, NULL); + if (!st_mosquitto) { + return EXIT_FAILURE; + } + + puts("mosquitto_connect_callback_set"); + mosquitto_connect_callback_set(st_mosquitto, connect_callback); + mosquitto_message_callback_set(st_mosquitto, message_callback); + + puts("mosquitto_connect"); + if (mosquitto_connect(st_mosquitto, BROKER_HOSTNAME, BROKER_PORT, 60) != MOSQ_ERR_SUCCESS) { + fprintf(stderr, "Could not connect to MQTT broker\n"); + } + + puts("mosquitto_subscribe"); + if (mosquitto_subscribe(st_mosquitto, NULL, "#", 0) != MOSQ_ERR_SUCCESS) { + fprintf(stderr, "Could not suscribe to MQTT broker\n"); + } + + puts("mosquitto_destroy"); + mosquitto_destroy(st_mosquitto); + + puts("mosquitto_lib_cleanup"); + if (mosquitto_lib_cleanup() != MOSQ_ERR_SUCCESS) { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt b/recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f113bcd8a8b0e --- /dev/null +++ b/recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mosquitto/2.x/test_v1_package/conanfile.py b/recipes/mosquitto/2.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9963f7a997273 --- /dev/null +++ b/recipes/mosquitto/2.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mosquitto/config.yml b/recipes/mosquitto/config.yml new file mode 100644 index 0000000000000..7627743e2625f --- /dev/null +++ b/recipes/mosquitto/config.yml @@ -0,0 +1,19 @@ +versions: + "2.0.15": + folder: "2.x" + "2.0.14": + folder: "2.x" + "2.0.12": + folder: "2.x" + "2.0.11": + folder: "2.x" + "2.0.10": + folder: "2.x" + "2.0.7": + folder: "2.x" + "2.0.5": + folder: "2.x" + "2.0.3": + folder: "2.x" + "1.6.12": + folder: "1.x" diff --git a/recipes/mozilla-build/all/conandata.yml b/recipes/mozilla-build/all/conandata.yml new file mode 100644 index 0000000000000..5311816d69140 --- /dev/null +++ b/recipes/mozilla-build/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + "3.3": + - url: "https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-3.3.exe" + sha256: "ac86e5794c6a99c25dee0b60720c7cfd9833ec64785c74838723179830749c9c" + - url: "https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt" + sha256: "fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85" diff --git a/recipes/mozilla-build/all/conanfile.py b/recipes/mozilla-build/all/conanfile.py new file mode 100644 index 0000000000000..c13282cd3e215 --- /dev/null +++ b/recipes/mozilla-build/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import download +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + +class MozillaBuildConan(ConanFile): + name = "mozilla-build" + homepage = "https://wiki.mozilla.org/MozillaBuild" + description = "Mozilla build requirements on Windows" + topics = ("mozilla", "build") + url = "https://github.com/conan-io/conan-center-index" + settings = "arch", "build_type", "compiler", "os" + license = "MPL-2.0" + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("Only Windows supported") + + def build_requirements(self): + self.build_requires("7zip/19.00") + + def build(self): + filename = "mozilla-build.exe" + download(self, **self.conan_data["sources"][self.version][0], filename=filename) + download(self, **self.conan_data["sources"][self.version][1], filename="LICENSE") + self.run(f"7z x {filename}", run_environment=True) + + + def package(self): + self.copy("LICENSE", dst="licenses") + self.copy("nsinstall.exe", src="bin", dst="bin") + + def package_id(self): + del self.info.settings.build_type + del self.info.settings.compiler + + def package_info(self): + self.cpp_info.includedirs = [] + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Adding to PATH: {binpath}") + self.env_info.PATH.append(binpath) diff --git a/recipes/mozilla-build/all/test_package/conanfile.py b/recipes/mozilla-build/all/test_package/conanfile.py new file mode 100644 index 0000000000000..73fd3540bb387 --- /dev/null +++ b/recipes/mozilla-build/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + + def test(self): + tools.save("file.txt", "some text") + assert not os.path.isdir("destionation") + self.run("nsinstall -D destination") + assert os.path.isdir("destination") + assert not os.path.isfile(os.path.join("destination", "file.txt")) + self.run("nsinstall -t -m 644 file.txt destination") + assert os.path.isfile(os.path.join("destination", "file.txt")) + diff --git a/recipes/mozilla-build/config.yml b/recipes/mozilla-build/config.yml new file mode 100644 index 0000000000000..e5e834cfda633 --- /dev/null +++ b/recipes/mozilla-build/config.yml @@ -0,0 +1,3 @@ +versions: + "3.3": + folder: all diff --git a/recipes/mozjpeg/all/conandata.yml b/recipes/mozjpeg/all/conandata.yml new file mode 100644 index 0000000000000..b3cb941ad21eb --- /dev/null +++ b/recipes/mozjpeg/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "4.1.1": + url: "https://github.com/mozilla/mozjpeg/archive/v4.1.1.tar.gz" + sha256: "66b1b8d6b55d263f35f27f55acaaa3234df2a401232de99b6d099e2bb0a9d196" + "4.0.0": + url: "https://github.com/mozilla/mozjpeg/archive/v4.0.0.tar.gz" + sha256: "961e14e73d06a015e9b23b8af416f010187cc0bec95f6e3b0fcb28cc7e2cbdd4" + "3.3.1": + url: "https://github.com/mozilla/mozjpeg/archive/v3.3.1.tar.gz" + sha256: "aebbea60ea038a84a2d1ed3de38fdbca34027e2e54ee2b7d08a97578be72599d" +patches: + "4.1.1": + - patch_file: "patches/4.1.1-0001-cmake-fixes.patch" + patch_description: "fix install folder and disable /NODEFAULT in MSVC" + patch_type: "conan" + "4.0.0": + - patch_file: "patches/4.0.0-0001-cmake-fixes.patch" + patch_description: "fix install folder" + patch_type: "conan" + "3.3.1": + - patch_file: "patches/3.3.1-0001-cmake-fixes.patch" + patch_description: "fix install folder" + patch_type: "conan" diff --git a/recipes/mozjpeg/all/conanfile.py b/recipes/mozjpeg/all/conanfile.py new file mode 100644 index 0000000000000..3dcf78b0f0e8e --- /dev/null +++ b/recipes/mozjpeg/all/conanfile.py @@ -0,0 +1,212 @@ +from conan import ConanFile +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, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + + +class MozjpegConan(ConanFile): + name = "mozjpeg" + description = "MozJPEG is an improved JPEG encoder" + license = ("BSD", "BSD-3-Clause", "ZLIB") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mozilla/mozjpeg" + topics = ("image", "format", "mozjpeg", "jpg", "jpeg", "picture", "multimedia", "graphics") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "SIMD": [True, False], + "arithmetic_encoder": [True, False], + "arithmetic_decoder": [True, False], + "libjpeg7_compatibility": [True, False], + "libjpeg8_compatibility": [True, False], + "mem_src_dst": [True, False], + "turbojpeg": [True, False], + "java": [True, False], + "enable12bit": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "SIMD": True, + "arithmetic_encoder": True, + "arithmetic_decoder": True, + "libjpeg7_compatibility": False, + "libjpeg8_compatibility": False, + "mem_src_dst": True, + "turbojpeg": True, + "java": False, + "enable12bit": False, + } + + @property + def _has_simd_support(self): + return self.settings.arch in ["x86", "x86_64"] + + 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_simd_support: + del self.options.SIMD + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + self.provides = ["libjpeg", "libjpeg-turbo"] if self.options.turbojpeg else "libjpeg" + + @property + def _use_cmake(self): + return self.settings.os == "Windows" or Version(self.version) >= "4.0.0" + + def layout(self): + if self._use_cmake: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder='src') + + def build_requirements(self): + if not self._use_cmake: + 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") + if self.options.get_safe("SIMD"): + self.tool_requires("nasm/2.15.05") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate_cmake(self): + tc = CMakeToolchain(self) + if cross_building(self): + # FIXME: too specific and error prone, should be delegated to CMake helper + cmake_system_processor = { + "armv8": "aarch64", + "armv8.3": "aarch64", + }.get(str(self.settings.arch), str(self.settings.arch)) + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["ENABLE_TESTING"] = False + tc.variables["REQUIRE_SIMD"] = bool(self.options.get_safe("SIMD", False)) + tc.variables["WITH_SIMD"] = bool(self.options.get_safe("SIMD", False)) + tc.variables["WITH_ARITH_ENC"] = bool(self.options.arithmetic_encoder) + tc.variables["WITH_ARITH_DEC"] = bool(self.options.arithmetic_decoder) + tc.variables["WITH_JPEG7"] = bool(self.options.libjpeg7_compatibility) + tc.variables["WITH_JPEG8"] = bool(self.options.libjpeg8_compatibility) + tc.variables["WITH_MEM_SRCDST"] = bool(self.options.mem_src_dst) + tc.variables["WITH_TURBOJPEG"] = bool(self.options.turbojpeg) + tc.variables["WITH_JAVA"] = bool(self.options.java) + tc.variables["WITH_12BIT"] = bool(self.options.enable12bit) + tc.variables["CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT"] = False + tc.variables["PNG_SUPPORTED"] = False # PNG and zlib are only required for executables (and static libraries) + if is_msvc(self): + tc.variables["WITH_CRT_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + + def generate_autotools(self): + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), + "--with-simd={}".format(yes_no(self.options.get_safe("SIMD", False))), + "--with-arith-enc={}".format(yes_no(self.options.arithmetic_encoder)), + "--with-arith-dec={}".format(yes_no(self.options.arithmetic_decoder)), + "--with-jpeg7={}".format(yes_no(self.options.libjpeg7_compatibility)), + "--with-jpeg8={}".format(yes_no(self.options.libjpeg8_compatibility)), + "--with-mem-srcdst={}".format(yes_no(self.options.mem_src_dst)), + "--with-turbojpeg={}".format(yes_no(self.options.turbojpeg)), + "--with-java={}".format(yes_no(self.options.java)), + "--with-12bit={}".format(yes_no(self.options.enable12bit)), + ]) + tc.generate() + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self._use_cmake: + self.generate_cmake() + else: + self.generate_autotools() + + def build(self): + apply_conandata_patches(self) + if self._use_cmake: + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self._use_cmake: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) + else: + autotools = Autotools(self) + autotools.install() + rm(self, pattern="*.la", folder=os.path.join(self.package_folder, "lib")) + + 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")) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=os.path.join(self.package_folder, "lib64")) + rmdir(self, os.path.join(self.package_folder, "lib64")) + # remove binaries and pdb files + for bin_pattern_to_remove in ["cjpeg*", "djpeg*", "jpegtran*", "tjbench*", "wrjpgcom*", "rdjpgcom*", "*.pdb"]: + rm(self, pattern=bin_pattern_to_remove, folder=os.path.join(self.package_folder, "bin")) + + def _lib_name(self, name): + if is_msvc(self) and not self.options.shared: + return name + "-static" + return name + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "JPEG") + self.cpp_info.set_property("cmake_file_name", "mozjpeg") + + cmake_target_suffix = "-static" if not self.options.shared else "" + + # libjpeg + self.cpp_info.components["libjpeg"].set_property("cmake_module_target_name", "JPEG::JPEG") + self.cpp_info.components["libjpeg"].set_property("cmake_target_name", f"mozjpeg::jpeg{cmake_target_suffix}") + self.cpp_info.components["libjpeg"].set_property("pkg_config_name", "libjpeg") + self.cpp_info.components["libjpeg"].libs = [self._lib_name("jpeg")] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libjpeg"].system_libs.append("m") + # libturbojpeg + if self.options.turbojpeg: + self.cpp_info.components["libturbojpeg"].set_property("cmake_target_name", f"mozjpeg::turbojpeg{cmake_target_suffix}") + self.cpp_info.components["libturbojpeg"].set_property("pkg_config_name", "libturbojpeg") + self.cpp_info.components["libturbojpeg"].libs = [self._lib_name("turbojpeg")] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libturbojpeg"].system_libs.append("m") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "JPEG" + self.cpp_info.names["cmake_find_package_multi"] = "mozjpeg" + self.cpp_info.components["libjpeg"].names["cmake_find_package"] = "JPEG" + self.cpp_info.components["libjpeg"].names["cmake_find_package_multi"] = f"jpeg{cmake_target_suffix}" + if self.options.turbojpeg: + self.cpp_info.components["libturbojpeg"].names["cmake_find_package"] = f"turbojpeg{cmake_target_suffix}" + self.cpp_info.components["libturbojpeg"].names["cmake_find_package_multi"] = f"turbojpeg{cmake_target_suffix}" diff --git a/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch new file mode 100644 index 0000000000000..de72859433e6a --- /dev/null +++ b/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch @@ -0,0 +1,121 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 743a243..eb787c8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -168,7 +168,7 @@ message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}") + configure_file(win/jconfig.h.in jconfig.h) + configure_file(win/jconfigint.h.in jconfigint.h) + +-include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_SOURCE_DIR}") ++include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") + + string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) + +@@ -483,7 +483,7 @@ if(ENABLE_STATIC) + set(TEST_LIBTYPES ${TEST_LIBTYPES} static) + endif() + +-set(TESTIMAGES ${CMAKE_SOURCE_DIR}/testimages) ++set(TESTIMAGES ${CMAKE_CURRENT_SOURCE_DIR}/testimages) + set(MD5CMP ${CMAKE_CURRENT_BINARY_DIR}/md5/md5cmp) + if(CMAKE_CROSSCOMPILING) + file(RELATIVE_PATH TESTIMAGES ${CMAKE_CURRENT_BINARY_DIR} ${TESTIMAGES}) +@@ -849,7 +849,7 @@ foreach(libtype ${TEST_LIBTYPES}) + endforeach() + + add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P +- ${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake) ++ ${CMAKE_CURRENT_SOURCE_DIR}/cmakescripts/testclean.cmake) + + + # +@@ -907,38 +907,38 @@ if(WITH_TURBOJPEG) + if(ENABLE_STATIC) + install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib) + if(NOT ENABLE_SHARED) +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe ++ install(PROGRAMS $ + DESTINATION bin RENAME tjbench.exe) + endif() + endif() +- install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include) ++ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h DESTINATION include) + endif() + + if(ENABLE_STATIC) + install(TARGETS jpeg-static ARCHIVE DESTINATION lib) + if(NOT ENABLE_SHARED) +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe ++ install(PROGRAMS $ + DESTINATION bin RENAME cjpeg.exe) +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe ++ install(PROGRAMS $ + DESTINATION bin RENAME djpeg.exe) +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe ++ install(PROGRAMS $ + DESTINATION bin RENAME jpegtran.exe) + endif() + endif() + + install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin) + +-install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README-mozilla.txt +- ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt +- ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt +- ${CMAKE_SOURCE_DIR}/wizard.txt ++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg ${CMAKE_CURRENT_SOURCE_DIR}/README-mozilla.txt ++ ${CMAKE_CURRENT_SOURCE_DIR}/example.c ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt ++ ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ++ ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt + DESTINATION doc) + +-install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h +- ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h + DESTINATION include) + +-configure_file("${CMAKE_SOURCE_DIR}/cmakescripts/cmake_uninstall.cmake.in" ++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmakescripts/cmake_uninstall.cmake.in" + "cmake_uninstall.cmake" IMMEDIATE @ONLY) + + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P cmake_uninstall.cmake) +diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt +index 268cc14..b5dfbdc 100755 +--- a/sharedlib/CMakeLists.txt ++++ b/sharedlib/CMakeLists.txt +@@ -16,7 +16,7 @@ if(MSVC) + endif() + + foreach(src ${JPEG_SOURCES}) +- list(APPEND JPEG_SRCS "${CMAKE_SOURCE_DIR}/${src}") ++ list(APPEND JPEG_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../${src}") + endforeach() + + if(WITH_SIMD) +@@ -26,10 +26,10 @@ endif() + + if(WITH_MEM_SRCDST AND NOT WITH_JPEG8) + add_library(jpeg SHARED ${JPEG_SRCS} ${SIMD_OBJS} +- "${CMAKE_SOURCE_DIR}/win/jpeg${DLL_VERSION}-memsrcdst.def") ++ "${CMAKE_CURRENT_SOURCE_DIR}/../win/jpeg${DLL_VERSION}-memsrcdst.def") + else() + add_library(jpeg SHARED ${JPEG_SRCS} ${SIMD_OBJS} +- "${CMAKE_SOURCE_DIR}/win/jpeg${DLL_VERSION}.def") ++ "${CMAKE_CURRENT_SOURCE_DIR}/../win/jpeg${DLL_VERSION}.def") + endif() + set_target_properties(jpeg PROPERTIES SOVERSION ${DLL_VERSION} + VERSION ${FULLVERSION}) +diff --git a/simd/CMakeLists.txt b/simd/CMakeLists.txt +index 60bd640..3ad929f 100755 +--- a/simd/CMakeLists.txt ++++ b/simd/CMakeLists.txt +@@ -12,7 +12,7 @@ else() + set(NAFLAGS -fwin32 -DWIN32) + endif() + endif() +-set(NAFLAGS ${NAFLAGS} -I${CMAKE_SOURCE_DIR}/win/ -I${CMAKE_CURRENT_SOURCE_DIR}/) ++set(NAFLAGS ${NAFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/../win/ -I${CMAKE_CURRENT_SOURCE_DIR}/) + + # This only works if building from the command line. There is currently no way + # to set a variable's value based on the build type when using the MSVC IDE. diff --git a/recipes/mozjpeg/all/patches/4.0.0-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/4.0.0-0001-cmake-fixes.patch new file mode 100644 index 0000000000000..f6fad20598e0b --- /dev/null +++ b/recipes/mozjpeg/all/patches/4.0.0-0001-cmake-fixes.patch @@ -0,0 +1,32 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1433,7 +1433,7 @@ if(WITH_TURBOJPEG) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/tjbench-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) + endif() + endif() +@@ -1449,16 +1449,16 @@ if(ENABLE_STATIC) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/cjpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) +- install(PROGRAMS ${DIR}/djpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) +- install(PROGRAMS ${DIR}/jpegtran-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) + endif() + endif() + +-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt diff --git a/recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch new file mode 100644 index 0000000000000..0d6ad37fc19fd --- /dev/null +++ b/recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d295c6..b30dacb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1461,7 +1461,7 @@ if(WITH_TURBOJPEG) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/tjbench-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) + endif() + endif() +@@ -1479,16 +1479,16 @@ if(ENABLE_STATIC) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/cjpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) +- install(PROGRAMS ${DIR}/djpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) +- install(PROGRAMS ${DIR}/jpegtran-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) + endif() + endif() + +-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt diff --git a/recipes/mozjpeg/all/test_package/CMakeLists.txt b/recipes/mozjpeg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..43fbdac6cca73 --- /dev/null +++ b/recipes/mozjpeg/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mozjpeg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET mozjpeg::jpeg) + target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::jpeg) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::jpeg-static) +endif() diff --git a/recipes/mozjpeg/all/test_package/conanfile.py b/recipes/mozjpeg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2494f49b77c0d --- /dev/null +++ b/recipes/mozjpeg/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 + + +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") + img_name = os.path.join(self.source_folder, "testimg.jpg") + self.run(f"{bin_path} {img_name}", env="conanrun") diff --git a/recipes/mozjpeg/all/test_package/test_package.c b/recipes/mozjpeg/all/test_package/test_package.c new file mode 100644 index 0000000000000..2f94478d7ef6f --- /dev/null +++ b/recipes/mozjpeg/all/test_package/test_package.c @@ -0,0 +1,528 @@ +/* + * 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 */ +} diff --git a/recipes/mozjpeg/all/test_package/testimg.jpg b/recipes/mozjpeg/all/test_package/testimg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a026e486f57de704ac5e9344ea20bb9973935e1d GIT binary patch literal 5764 zcmbW)XH*kRmjK{|fOM1+q<0V!iu7It={1x<0{9}GptML;LlnJ7?z4+%xAsGk@+}PG2qpu9+AZ8vuYn008)B050bM zdH|X$SE#R0(NI%U)6&w=F|aW*(9<(;vanudH_NTmw)5K_CiB5ET_A<)7@xKl=bmW-1mz z*;`jwVRxy80@>uEGs|d%bsM|E*5d~v@~%NoY3bOnb8vEriro;GfG8*`DXXZe>D|^h zFf=kYv9Yy-+dCkTZtfnQUfw<^^n>7#(6I1`nAm4=@d=4ZS=l+cdHDs;3tyF2U@EJs zvA8!)%`L5M?fADJdwL0d{R4wT#0k>m)R*a**`?(b^6J|9#^%=H(ecUY*|+aM&i`=% z0ib`g{;dCo{SO!O9~T8BC5V#x9~Y1!^v?t_Q&I`aUSYWfqrMx+DkK+8!={^A*4Rxe zEN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SG%Q!>R(h4(G$KpSzZ92TSAaRC2c0u+ z6O0+(4vG(M1?sbX?ej-hc77IUAzo~d{pC5O(%w&w&^okE47^IRnxy0%5KBd8$l7_o zYD?>u4IEW9RDjv))Zz>w5L1qF- +#include + +int main() +{ + using namespace units::physical::si::literals; + std::cout << "Speed = " << 240._q_km / 2_q_h << '\n'; +} diff --git a/recipes/mp-units/0.7.0/conandata.yml b/recipes/mp-units/0.7.0/conandata.yml new file mode 100644 index 0000000000000..9986b435619c5 --- /dev/null +++ b/recipes/mp-units/0.7.0/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.0": + url: https://github.com/mpusz/units/archive/v0.7.0.tar.gz + sha256: 7ff4bc3537e1bd09630fefae513796686a3f97e509283ad658e1ae81fe49de67 diff --git a/recipes/mp-units/0.7.0/conanfile.py b/recipes/mp-units/0.7.0/conanfile.py new file mode 100644 index 0000000000000..71d2cc465a52e --- /dev/null +++ b/recipes/mp-units/0.7.0/conanfile.py @@ -0,0 +1,84 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version, check_min_cppstd +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + +class MPUnitsConan(ConanFile): + name = "mp-units" + homepage = "https://github.com/mpusz/units" + description = "Physical Units library for C++" + topics = ("units", "dimensions", "quantities", "dimensional-analysis", "physical-quantities", "physical-units", "system-of-units", "cpp23", "cpp20", "library", "quantity-manipulation") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake_find_package_multi" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + compiler = self.settings.compiler + self.requires("fmt/7.1.3") + self.requires("gsl-lite/0.38.0") + if compiler == "clang" and compiler.libcxx == "libc++": + self.requires("range-v3/0.11.0") + + def validate(self): + compiler = self.settings.compiler + version = Version(self.settings.compiler.version) + if compiler == "gcc": + if version < "10.0": + raise ConanInvalidConfiguration("mp-units requires at least g++-10") + elif compiler == "clang": + if version < "12": + raise ConanInvalidConfiguration("mp-units requires at least clang++-12") + elif compiler == "Visual Studio": + if version < "16": + raise ConanInvalidConfiguration("mp-units requires at least Visual Studio 16.9") + else: + raise ConanInvalidConfiguration("Unsupported compiler") + if compiler.get_safe("cppstd"): + check_min_cppstd(self, "20") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + cmake = CMake(self) + cmake.configure(source_folder=os.path.join(self._source_subfolder, "src")) + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + compiler = self.settings.compiler + + # core + self.cpp_info.components["core"].requires = ["gsl-lite::gsl-lite"] + if compiler == "Visual Studio": + self.cpp_info.components["core"].cxxflags = ["/utf-8"] + elif compiler == "clang" and compiler.libcxx == "libc++": + self.cpp_info.components["core"].requires.append("range-v3::range-v3") + + # rest + self.cpp_info.components["core-io"].requires = ["core"] + self.cpp_info.components["core-fmt"].requires = ["core", "fmt::fmt"] + self.cpp_info.components["isq"].requires = ["core"] + self.cpp_info.components["isq-natural"].requires = ["isq"] + self.cpp_info.components["si"].requires = ["isq"] + self.cpp_info.components["si-cgs"].requires = ["si"] + self.cpp_info.components["si-fps"].requires = ["si"] + self.cpp_info.components["si-iau"].requires = ["si"] + self.cpp_info.components["si-imperial"].requires = ["si"] + self.cpp_info.components["si-international"].requires = ["si"] + self.cpp_info.components["si-typographic"].requires = ["si"] + self.cpp_info.components["si-uscs"].requires = ["si"] + self.cpp_info.components["isq-iec80000"].requires = ["si"] + self.cpp_info.components["systems"].requires = ["isq", "isq-natural", "si", "si-cgs", "si-fps", "si-iau", "si-imperial", "si-international", "si-typographic", "si-uscs", "isq-iec80000"] diff --git a/recipes/mp-units/0.7.0/test_package/CMakeLists.txt b/recipes/mp-units/0.7.0/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07f3e7cd91e8a --- /dev/null +++ b/recipes/mp-units/0.7.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/0.7.0/test_package/conanfile.py b/recipes/mp-units/0.7.0/test_package/conanfile.py new file mode 100644 index 0000000000000..048e0f9557d47 --- /dev/null +++ b/recipes/mp-units/0.7.0/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi" + + # TODO remove when https://github.com/conan-io/conan/issues/7680 is solved (or VS2019 is updated to at least 16.9) + def _skip_check(self): + return self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) <= "16" + + def build(self): + if self._skip_check(): + return + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if self._skip_check(): + return + if not tools.cross_building(self.settings): + self.run("test_package", run_environment=True) diff --git a/recipes/mp-units/0.7.0/test_package/test_package.cpp b/recipes/mp-units/0.7.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..cd9ed5c7a0227 --- /dev/null +++ b/recipes/mp-units/0.7.0/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include +#include + +using namespace units; + +template +constexpr auto avg_speed(Length d, Time t) +{ + return d / t; +} + +int main() +{ + using namespace units::isq::si::references; + 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 new file mode 100644 index 0000000000000..7ad903a9673a0 --- /dev/null +++ b/recipes/mp-units/config.yml @@ -0,0 +1,5 @@ +versions: + "0.7.0": + folder: 0.7.0 + "0.6.0": + folder: 0.6.0 diff --git a/recipes/mpark-variant/all/conandata.yml b/recipes/mpark-variant/all/conandata.yml new file mode 100644 index 0000000000000..b4488c8cc30b4 --- /dev/null +++ b/recipes/mpark-variant/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/mpark/variant/archive/v1.4.0.tar.gz" + sha256: "8f6b28ab3640b5d76d5b6664dda7257a4405ce59179220431b8fd196c79b2ecb" diff --git a/recipes/mpark-variant/all/conanfile.py b/recipes/mpark-variant/all/conanfile.py new file mode 100644 index 0000000000000..e015db951bf2d --- /dev/null +++ b/recipes/mpark-variant/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class MparkVariantConan(ConanFile): + name = "mpark-variant" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mpark/variant" + description = "C++17 std::variant for C++11/14/17" + license = "BSL-1.0" + topics = ("variant", "mpark-variant") + 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], + destination=self.source_folder, 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, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"mpark_variant": "mpark_variant::mpark_variant"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mpark_variant") + self.cpp_info.set_property("cmake_target_name", "mpark_variant") + 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"] = "mpark_variant" + self.cpp_info.names["cmake_find_package_multi"] = "mpark_variant" + 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/mpark-variant/all/test_package/CMakeLists.txt b/recipes/mpark-variant/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1d878b6a4c4f5 --- /dev/null +++ b/recipes/mpark-variant/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mpark_variant REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mpark_variant) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mpark-variant/all/test_package/conanfile.py b/recipes/mpark-variant/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mpark-variant/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/mpark-variant/all/test_package/test_package.cpp b/recipes/mpark-variant/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6bcff227cca50 --- /dev/null +++ b/recipes/mpark-variant/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +#include + +int main() +{ + std::cout << "mpark/variant\n"; + mpark::variant v(42); + std::cout << mpark::get(v) << "\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/mpark-variant/all/test_v1_package/CMakeLists.txt b/recipes/mpark-variant/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mpark-variant/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mpark-variant/all/test_v1_package/conanfile.py b/recipes/mpark-variant/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mpark-variant/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/mpark-variant/config.yml b/recipes/mpark-variant/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/mpark-variant/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/mpc/all/conandata.yml b/recipes/mpc/all/conandata.yml new file mode 100644 index 0000000000000..cd8f83a739d7d --- /dev/null +++ b/recipes/mpc/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.2.0": + url: https://ftp.gnu.org/gnu/mpc/mpc-1.2.0.tar.gz + sha256: e90f2d99553a9c19911abdb4305bf8217106a957e3994436428572c8dfe8fda6 + "1.1.0": + url: https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz + sha256: 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e +patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-asin-missing-limits.patch" + patch_description: "asin.c needs limits.h" + patch_type: "portability" diff --git a/recipes/mpc/all/conanfile.py b/recipes/mpc/all/conanfile.py new file mode 100644 index 0000000000000..f996155628e5c --- /dev/null +++ b/recipes/mpc/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +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 +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.apple import fix_apple_shared_install_name +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.54.0" + +class MpcConan(ConanFile): + name = "mpc" + package_type = "library" + description = "GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision " \ + "and correct rounding of the result" + topics = ("conan", "mpc", "multiprecision", "math", "mathematics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.multiprecision.org/mpc/home.html" + license = "LGPL-3.0-or-later" + 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': + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def requirements(self): + self.requires("gmp/6.2.1", transitive_headers=True) + self.requires("mpfr/4.1.0", transitive_headers=True) + + def validate(self): + # FIXME: add msvc support, upstream has a makefile.vc + if is_msvc(self): + raise ConanInvalidConfiguration("mpc can be built with msvc, but it's not supported yet in this recipe.") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def 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 generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.append(f'--with-gmp={unix_path(self, self.dependencies["gmp"].package_folder)}') + tc.configure_args.append(f'--with-mpfr={unix_path(self, self.dependencies["mpfr"].package_folder)}') + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + if not os.path.exists(os.path.join(self.source_folder, "configure")): + autotools.autoreconf(["-i"]) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LESSER", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False) + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + + def package_info(self): + self.cpp_info.libs = ["mpc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/mpc/all/patches/1.2.0-0001-asin-missing-limits.patch b/recipes/mpc/all/patches/1.2.0-0001-asin-missing-limits.patch new file mode 100644 index 0000000000000..db3ea7f89c002 --- /dev/null +++ b/recipes/mpc/all/patches/1.2.0-0001-asin-missing-limits.patch @@ -0,0 +1,11 @@ +--- src/asin.c ++++ src/asin.c +@@ -17,7 +17,7 @@ more details. + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see http://www.gnu.org/licenses/ . + */ +- ++#include + #include + #include "mpc-impl.h" + diff --git a/recipes/mpc/all/test_package/CMakeLists.txt b/recipes/mpc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5167a095daebe --- /dev/null +++ b/recipes/mpc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(mpc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mpc::mpc) diff --git a/recipes/mpc/all/test_package/conanfile.py b/recipes/mpc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..da190011b6b6d --- /dev/null +++ b/recipes/mpc/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mpc/all/test_package/test_package.c b/recipes/mpc/all/test_package/test_package.c new file mode 100644 index 0000000000000..c2c46b86453e1 --- /dev/null +++ b/recipes/mpc/all/test_package/test_package.c @@ -0,0 +1,16 @@ +/* example was taken from https://www.gnu.org/ghm/2011/paris/slides/andreas-enge-mpc.pdf */ + +#include +#include + +int main (void) { + mpc_t z; + int inex; + mpc_init2 (z, 123); + mpc_set_ui_ui (z, 0, 2, MPC_RNDNN); + inex = mpc_asin (z, z, MPC_RNDNN); + mpc_out_str (stdout, 10, 0, z, MPC_RNDNN); + printf ("\n%i %i\n", MPC_INEX_RE (inex), MPC_INEX_IM (inex)); + mpc_clear (z); + return 0; +} diff --git a/recipes/mpc/all/test_v1_package/CMakeLists.txt b/recipes/mpc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mpc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mpc/all/test_v1_package/conanfile.py b/recipes/mpc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/mpc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mpc/config.yml b/recipes/mpc/config.yml new file mode 100644 index 0000000000000..d07c95e596619 --- /dev/null +++ b/recipes/mpc/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/recipes/mpdecimal/2.4.2/conandata.yml b/recipes/mpdecimal/2.4.2/conandata.yml new file mode 100644 index 0000000000000..41a874b9a4e1b --- /dev/null +++ b/recipes/mpdecimal/2.4.2/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.4.2": + sha256: "83c628b90f009470981cf084c5418329c88b19835d8af3691b930afccb7d79c7" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.4.2.tar.gz" +patches: + "2.4.2": + - base_path: "source_subfolder" + patch_file: "patches/0001-msvc-fixes.patch" + - base_path: "source_subfolder" + patch_file: "patches/0002-disable-vcstdint-h-vs2015.patch" diff --git a/recipes/mpdecimal/2.4.2/conanfile.py b/recipes/mpdecimal/2.4.2/conanfile.py new file mode 100644 index 0000000000000..e0edbd2d2f318 --- /dev/null +++ b/recipes/mpdecimal/2.4.2/conanfile.py @@ -0,0 +1,208 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os +import shutil + + +class MpdecimalConan(ConanFile): + name = "mpdecimal" + version = "2.4.2" + description = "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." + license = "BSD-2-Clause" + topics = ("mpdecimal", "multiprecision", "library") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.bytereef.org/mpdecimal" + settings = "os", "compiler", "build_type", "arch" + exports_sources = "patches/**" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + def configure(self): + if self._is_msvc and self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("Arch is unsupported") + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + _shared_ext_mapping = { + "Linux": ".so", + "Windows": ".dll", + "Macos": ".dylib", + } + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if not self._is_msvc: + """ + Using autotools: + - Build only shared libraries when shared == True + - Build only static libraries when shared == False + ! This is more complicated on Windows because when shared=True, an implicit static library has to be built + """ + + shared_ext = self._shared_ext_mapping[str(self.settings.os)] + static_ext = ".a" + main_version, _ = self.version.split(".", 1) + + tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), + "libmpdec.a", + "libmpdec{}".format(static_ext)) + tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), + "libmpdec.so", + "libmpdec{}".format(shared_ext)) + + makefile_in = os.path.join(self._source_subfolder, "Makefile.in") + mpdec_makefile_in = os.path.join(self._source_subfolder, "libmpdec", "Makefile.in") + tools.replace_in_file(makefile_in, + "libdir = @libdir@", + "libdir = @libdir@\n" + "bindir = @bindir@") + if self.options.shared: + if self.settings.os == "Windows": + tools.replace_in_file(makefile_in, + "LIBSHARED = @LIBSHARED@", + "LIBSHARED = libmpdec-{}{}".format(main_version, shared_ext)) + tools.replace_in_file(makefile_in, + "install: FORCE", + "install: FORCE\n" + "\t$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)") + tools.replace_in_file(makefile_in, + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(bindir)\n") + tools.replace_in_file(makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", + "") + else: + tools.replace_in_file(makefile_in, + "\t$(INSTALL) -m 644 libmpdec/$(LIBSTATIC) $(DESTDIR)$(libdir)\n", + "") + tools.replace_in_file(makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so", + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec{}".format(shared_ext)) + else: + tools.replace_in_file(makefile_in, + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", + "") + tools.replace_in_file(makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", + "") + + tools.replace_in_file(mpdec_makefile_in, + "default: $(LIBSTATIC) $(LIBSHARED)", + "default: $({})".format("LIBSHARED" if self.options.shared else "LIBSTATIC")) + + if self.settings.os == "Windows": + tools.replace_in_file(mpdec_makefile_in, + "LIBSHARED = @LIBSHARED@", + "LIBSHARED = libmpdec-{}{}".format(main_version, shared_ext)) + tools.replace_in_file(mpdec_makefile_in, + "\tln -sf $(LIBSHARED) libmpdec.so", + "") + tools.replace_in_file(mpdec_makefile_in, + "\tln -sf $(LIBSHARED) $(LIBSONAME)", + "") + tools.replace_in_file(mpdec_makefile_in, + "CONFIGURE_LDFLAGS =", + "CONFIGURE_LDFLAGS = -Wl,--out-implib,libmpdec{}".format(static_ext)) + else: + tools.replace_in_file(mpdec_makefile_in, + "libmpdec.so", + "libmpdec{}".format(shared_ext)) + + def _build_msvc(self): + libmpdec_folder = os.path.join(self.build_folder, self._source_subfolder, "libmpdec") + vcbuild_folder = os.path.join(self.build_folder, self._source_subfolder, "vcbuild") + arch_ext = "{}".format(32 if self.settings.arch == "x86" else 64) + dist_folder = os.path.join(vcbuild_folder, "dist{}".format(arch_ext)) + os.mkdir(dist_folder) + + shutil.copy(os.path.join(libmpdec_folder, "Makefile.vc"), os.path.join(libmpdec_folder, "Makefile")) + + autotools = AutoToolsBuildEnvironment(self) + + with tools.chdir(libmpdec_folder): + with tools.vcvars(self.settings): + self.run("""nmake /nologo MACHINE={machine} DLL={dll} CONAN_CFLAGS="{cflags}" CONAN_LDFLAGS="{ldflags}" """.format( + machine="ppro" if self.settings.arch == "x86" else "x64", + dll="1" if self.options.shared else "0", + cflags=" ".join(autotools.flags), + ldflags=" ".join(autotools.link_flags), + )) + + shutil.copy("mpdecimal.h", dist_folder) + if self.options.shared: + shutil.copy("libmpdec-{}.dll".format(self.version), os.path.join(dist_folder, "libmpdec-{}.dll".format(self.version))) + shutil.copy("libmpdec-{}.dll.exp".format(self.version), os.path.join(dist_folder, "libmpdec-{}.exp".format(self.version))) + shutil.copy("libmpdec-{}.dll.lib".format(self.version), os.path.join(dist_folder, "libmpdec-{}.lib".format(self.version))) + else: + shutil.copy("libmpdec-{}.lib".format(self.version), dist_folder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + if self.settings.os == "Macos" and self.settings.arch == "armv8": + self._autotools.link_flags.append("-arch arm64") + self._autotools .configure() + return self._autotools + + def build(self): + self._patch_sources() + if self._is_msvc: + self._build_msvc() + else: + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + if self._is_msvc: + distfolder = os.path.join(self.build_folder, self._source_subfolder, "vcbuild", "dist{}".format(32 if self.settings.arch == "x86" else 64)) + self.copy("vc*.h", src=os.path.join(self.build_folder, self._source_subfolder, "libmpdec"), dst="include") + self.copy("*.h", src=distfolder, dst="include") + self.copy("*.lib", src=distfolder, dst="lib") + self.copy("*.dll", src=distfolder, dst="bin") + else: + with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + if self._is_msvc: + self.cpp_info.libs = ["libmpdec-{}".format(self.version)] + else: + self.cpp_info.libs = ["mpdec"] + if self.options.shared: + if self._is_msvc: + self.cpp_info.defines = ["USE_DLL"] + else: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch b/recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch new file mode 100644 index 0000000000000..6cf24bf3123be --- /dev/null +++ b/recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch @@ -0,0 +1,34 @@ +--- libmpdec/Makefile.vc ++++ libmpdec/Makefile.vc +@@ -45,25 +45,25 @@ + !if "$(DLL)" == "1" + BFLAGS= /DBUILD_DLL + UFLAGS= /DUSE_DLL +-LFLAGS= $(LFLAGS) /DLL /MANIFEST ++LFLAGS= $(LFLAGS) /DLL /MANIFEST $(CONAN_LDFLAGS) + BUILDLIB = $(LIBSHARED) + USELIB = $(LIBIMPORT) + !if "$(DEBUG)" == "1" +-OPT = /MDd /Od /Zi ++OPT = /Od /Zi + !else +-OPT = /MD /Ox /GS /EHsc ++OPT = /Ox /GS /EHsc + !endif + !else + BUILDLIB = $(LIBSTATIC) + USELIB = $(LIBSTATIC) + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi ++OPT = /Od /Zi + !else +-OPT = /MT /Ox /GS /EHsc ++OPT = /Ox /GS /EHsc + !endif + !endif + +-CFLAGS = /W3 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) ++CFLAGS = /W3 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) $(CONAN_CFLAGS) + + + default: $(BUILDLIB) runtest diff --git a/recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch b/recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch new file mode 100644 index 0000000000000..d33b6590eaa16 --- /dev/null +++ b/recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch @@ -0,0 +1,18 @@ +--- libmpdec/vcstdint.h ++++ libmpdec/vcstdint.h +@@ -32,7 +32,7 @@ + #ifndef _MSC_VER // [ + #error "Use this header only with Microsoft Visual C++ compilers!" + #endif // _MSC_VER ] +- ++#if _MSC_VER < 1900 // Only enable for Visual Studio <2015 + #ifndef _MSC_STDINT_H_ // [ + #define _MSC_STDINT_H_ + +@@ -230,3 +230,6 @@ + + + #endif // _MSC_STDINT_H_ ] ++#else // Only enable for Visual Studio <2015 ++#include ++#endif // Only enable for Visual Studio <2015 diff --git a/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt b/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a403dc404b41 --- /dev/null +++ b/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/mpdecimal/2.4.2/test_package/conanfile.py b/recipes/mpdecimal/2.4.2/test_package/conanfile.py new file mode 100644 index 0000000000000..97c415cdb0a2a --- /dev/null +++ b/recipes/mpdecimal/2.4.2/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run("{} 13 100".format(os.path.join("bin", "test_package")), run_environment=True) diff --git a/recipes/mpdecimal/2.4.2/test_package/test_package.c b/recipes/mpdecimal/2.4.2/test_package/test_package.c new file mode 100644 index 0000000000000..34918c7c1986c --- /dev/null +++ b/recipes/mpdecimal/2.4.2/test_package/test_package.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2008-2016 Stefan Krah. 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 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 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 + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "pow: usage: ./pow x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_pow(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} diff --git a/recipes/mpdecimal/2.5.x/conandata.yml b/recipes/mpdecimal/2.5.x/conandata.yml new file mode 100644 index 0000000000000..93278b2f9479e --- /dev/null +++ b/recipes/mpdecimal/2.5.x/conandata.yml @@ -0,0 +1,15 @@ +sources: + "2.5.1": + sha256: "9f9cd4c041f99b5c49ffb7b59d9f12d95b683d88585608aa56a6307667b2b21f" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz" + "2.5.0": + sha256: "15417edc8e12a57d1d9d75fa7e3f22b158a3b98f44db9d694cfd2acde8dfa0ca" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.0.tar.gz" +patches: + "2.5.1": + - patch_file: "patches/2.5.1-0001-msvc-fixes.patch" + - patch_file: "patches/2.5.1-0002-add-mingw-to-configure-ac.patch" + - patch_file: "patches/2.5.1-0003-use-MPDECIMAL_DLL.patch" + "2.5.0": + - patch_file: "patches/0001-2.5.0-msvc-fixes.patch" + - patch_file: "patches/0002-add-mingw-to-configure-ac.patch" diff --git a/recipes/mpdecimal/2.5.x/conanfile.py b/recipes/mpdecimal/2.5.x/conanfile.py new file mode 100644 index 0000000000000..5d90356bfd228 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/conanfile.py @@ -0,0 +1,242 @@ +from conan import ConanFile +from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, Autotools +from conan.tools.files import get, chdir, copy, export_conandata_patches, apply_conandata_patches, mkdir, rename +from conan.tools.layout import basic_layout +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.microsoft import VCVars, is_msvc, NMakeDeps, NMakeToolchain +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import pathlib + +required_conan_version = ">=1.55.0" + + +class MpdecimalConan(ConanFile): + name = "mpdecimal" + description = "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." + license = "BSD-2-Clause" + topics = ("mpdecimal", "multiprecision", "library") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.bytereef.org/mpdecimal" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cxx": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cxx": True, + } + + @property + def _settings_build(self): + return getattr(self, "setings_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") + if not self.options.cxx: + 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) and self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration( + f"{self.ref} currently does not supported {self.settings.arch}. Contributions are welcomed") + if self.options.cxx: + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "A shared libmpdec++ is not possible on Windows (due to non-exportable thread local storage)") + + def build_requirements(self): + if is_msvc(self): + self.tool_requires("automake/1.16.4") + else: + # required to suppport windows as a build machine + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + deps = NMakeDeps(self) + deps.generate() + + tc = NMakeToolchain(self) + if Version(self.version) >= "2.5.1": + if self.options.shared: + tc.extra_cflags.append("-DMPDECIMAL_DLL") + if self.options.cxx: + tc.extra_cxxflags.append("-DLIBMPDECXX_DLL") + tc.generate() + else: + # inject tool_requires env vars in build scope (not needed if there is no tool_requires) + env = VirtualBuildEnv(self) + 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) + tc.configure_args.append("--enable-cxx" if self.options.cxx else "--disable-cxx") + tc.generate() + + deps = AutotoolsDeps(self) + if is_apple_os(self) and self.settings.arch == "armv8": + deps.environment.append("LDFLAGS", ["-arch arm64"]) + deps.environment.append("LDXXFLAGS", ["-arch arm64"]) + deps.generate() + + def _build_msvc(self): + source_dir = pathlib.Path(self.source_folder) + build_dir = pathlib.Path(self.build_folder) + libmpdec_folder = source_dir / "libmpdec" + libmpdecpp_folder = source_dir / "libmpdec++" + vcbuild_folder = build_dir / "vcbuild" + arch_ext = "{}".format(32 if self.settings.arch == "x86" else 64) + dist_folder = vcbuild_folder / "dist{}".format(arch_ext) + mkdir(self, dist_folder) + + copy(self, "Makefile.vc", libmpdec_folder, build_dir) + rename(self, build_dir / "Makefile.vc", libmpdec_folder / "Makefile") + + mpdec_target = "libmpdec-{}.{}".format(self.version, "dll" if self.options.shared else "lib") + mpdecpp_target = "libmpdec++-{}.{}".format(self.version, "dll" if self.options.shared else "lib") + + builds = [[libmpdec_folder, mpdec_target]] + if self.options.cxx: + builds.append([libmpdecpp_folder, mpdecpp_target]) + + for build_dir, target in builds: + with chdir(self, build_dir): + self.run("""nmake -f Makefile.vc {target} MACHINE={machine} DEBUG={debug} DLL={dll}""".format( + target=target, + machine={"x86": "ppro", "x86_64": "x64"}[str(self.settings.arch)], + # FIXME: else, use ansi32 and ansi64 + debug="1" if self.settings.build_type == "Debug" else "0", + dll="1" if self.options.shared else "0", + )) + + copy(self, "mpdecimal.h", libmpdec_folder, dist_folder) + if self.options.shared: + copy(self, "libmpdec-{}.dll".format(self.version), libmpdec_folder, dist_folder) + copy(self, "libmpdec-{}.dll.exp".format(self.version), libmpdec_folder, dist_folder) + copy(self, "libmpdec-{}.dll.lib".format(self.version), libmpdec_folder, dist_folder) + else: + copy(self, "libmpdec-{}.lib".format(self.version), libmpdec_folder, dist_folder) + if self.options.cxx: + copy(self, "decimal.hh", libmpdecpp_folder, dist_folder) + copy(self, "libmpdec++-{}.lib".format(self.version), libmpdecpp_folder, dist_folder) + + @property + def _shared_suffix(self): + if is_apple_os(self): + return ".dylib" + return { + "Windows": ".dll", + }.get(str(self.settings.os), ".so") + + @property + def _target_names(self): + libsuffix = self._shared_suffix if self.options.shared else ".a" + versionsuffix = ".{}".format(self.version) if self.options.shared else "" + suffix = "{}{}".format(versionsuffix, libsuffix) if is_apple_os( + self) or self.settings.os == "Windows" else "{}{}".format(libsuffix, versionsuffix) + return "libmpdec{}".format(suffix), "libmpdec++{}".format(suffix) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + autotools.configure() + # self.output.info(load(self, pathlib.Path("libmpdec", "Makefile"))) + libmpdec, libmpdecpp = self._target_names + copy(self, "*", pathlib.Path(self.source_folder, "libmpdec"), pathlib.Path(self.build_folder, "libmpdec")) + with chdir(self, "libmpdec"): + autotools.make(target=libmpdec) + if self.options.cxx: + copy(self, "*", pathlib.Path(self.source_folder, "libmpdec++"), + pathlib.Path(self.build_folder, "libmpdec++")) + with chdir(self, "libmpdec++"): + autotools.make(target=libmpdecpp) + + def package(self): + source_dir = pathlib.Path(self.source_folder) + pkg_dir = pathlib.Path(self.package_folder) + copy(self, "LICENSE.txt", src=self.source_folder, dst=pkg_dir / "licenses") + if is_msvc(self): + build_dir = pathlib.Path(self.build_folder) + distfolder = build_dir / "vcbuild" / "dist{}".format(32 if self.settings.arch == "x86" else 64) + copy(self, "vc*.h", src=source_dir / "libmpdec", dst=pkg_dir / "include") + copy(self, "*.h", src=distfolder, dst=pkg_dir / "include") + if self.options.cxx: + copy(self, "*.hh", src=distfolder, dst=pkg_dir / "include") + copy(self, "*.lib", src=distfolder, dst=pkg_dir / "lib") + copy(self, "*.dll", src=distfolder, dst=pkg_dir / "bin") + else: + build_dir = pathlib.Path(self.build_folder) + mpdecdir = build_dir / "libmpdec" + mpdecppdir = build_dir / "libmpdec++" + copy(self, "mpdecimal.h", src=mpdecdir, dst=pkg_dir / "include") + if self.options.cxx: + copy(self, "decimal.hh", src=mpdecppdir, dst=pkg_dir / "include") + builddirs = [mpdecdir] + if self.options.cxx: + builddirs.append(mpdecppdir) + for builddir in builddirs: + copy(self, "*.a", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.so", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.so.*", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.dylib", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.dll", src=builddir, dst=pkg_dir / "bin") + + def package_info(self): + lib_pre_suf = ("", "") + if is_msvc(self): + lib_pre_suf = ("lib", "-{}".format(self.version)) + elif self.settings.os == "Windows": + if self.options.shared: + lib_pre_suf = ("", ".dll") + + self.cpp_info.components["libmpdecimal"].libs = ["{}mpdec{}".format(*lib_pre_suf)] + if self.options.shared and is_msvc(self): + if Version(self.version) >= "2.5.1": + self.cpp_info.components["libmpdecimal"].defines = ["MPDECIMAL_DLL"] + else: + self.cpp_info.components["libmpdecimal"].defines = ["USE_DLL"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libmpdecimal"].system_libs = ["m"] + + if self.options.cxx: + self.cpp_info.components["libmpdecimal++"].libs = ["{}mpdec++{}".format(*lib_pre_suf)] + self.cpp_info.components["libmpdecimal++"].requires = ["libmpdecimal"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libmpdecimal++"].system_libs = ["pthread"] + if self.options.shared and Version(self.version) >= "2.5.1": + self.cpp_info.components["libmpdecimal"].defines = ["MPDECIMALXX_DLL"] diff --git a/recipes/mpdecimal/2.5.x/patches/0001-2.5.0-msvc-fixes.patch b/recipes/mpdecimal/2.5.x/patches/0001-2.5.0-msvc-fixes.patch new file mode 100644 index 0000000000000..b7f440c6d6620 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/patches/0001-2.5.0-msvc-fixes.patch @@ -0,0 +1,65 @@ +--- libmpdec++/Makefile.vc ++++ libmpdec++/Makefile.vc +@@ -16,15 +16,15 @@ + # LIBSHARED_CXX = libmpdec++-2.5.0.dll + + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi /EHsc +-OPT_SHARED = /MDd /Od /Zi /EHsc ++OPT = /Od /Zi /EHsc ++OPT_SHARED = /Od /Zi /EHsc + !else +-OPT = /MT /Ox /GS /EHsc +-OPT_SHARED = /MD /Ox /GS /EHsc ++OPT = /Ox /GS /EHsc ++OPT_SHARED = /Ox /GS /EHsc + !endif + + +-MPD_CXXFLAGS = /W4 /nologo $(CONFIG) $(OPT) +-MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) ++MPD_CXXFLAGS = /W4 /nologo $(CONFIG) $(OPT) $(CONAN_CXXFLAGS) $(CONAN_CFLAGS) ++MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) $(CONAN_LDFLAGS) + + +@@ -34,13 +34,13 @@ + OBJS = decimal.obj + + +-$(LIBSTATIC_CXX): Makefile $(OBJS) ++$(LIBSTATIC_CXX): Makefile.vc $(OBJS) + -@if exist $@ del $(LIBSTATIC_CXX) + lib /out:$(LIBSTATIC_CXX) $(OBJS) + + + decimal.obj:\ +-Makefile decimal.cc decimal.hh ++Makefile.vc decimal.cc decimal.hh + $(CXX) "-I." "-I$(SRCDIR)" $(MPD_CXXFLAGS) -c decimal.cc + + +--- libmpdec/Makefile.vc ++++ libmpdec/Makefile.vc +@@ -36,15 +36,15 @@ + !endif + + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi /EHsc +-OPT_SHARED = /MDd /Od /Zi /EHsc ++OPT = /Od /Zi /EHsc ++OPT_SHARED = /Od /Zi /EHsc + !else +-OPT = /MT /Ox /GS /EHsc +-OPT_SHARED = /MD /Ox /GS /EHsc ++OPT = /Ox /GS /EHsc ++OPT_SHARED = /Ox /GS /EHsc + !endif + +-MPD_CFLAGS = /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) +-MPD_CFLAGS_SHARED = /DBUILD_DLL /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT_SHARED) $(PGOFLAGS) +-MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) ++MPD_CFLAGS = /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) $(CONAN_CFLAGS) ++MPD_CFLAGS_SHARED = /DBUILD_DLL /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT_SHARED) $(PGOFLAGS) $(CONAN_CFLAGS) ++MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) $(CONAN_LDFLAGS) + + diff --git a/recipes/mpdecimal/2.5.x/patches/0002-add-mingw-to-configure-ac.patch b/recipes/mpdecimal/2.5.x/patches/0002-add-mingw-to-configure-ac.patch new file mode 100644 index 0000000000000..15a460336291e --- /dev/null +++ b/recipes/mpdecimal/2.5.x/patches/0002-add-mingw-to-configure-ac.patch @@ -0,0 +1,64 @@ +--- configure.ac ++++ configure.ac +@@ -12,13 +12,22 @@ + AC_MSG_RESULT($ac_sys_system) + + LIBSTATIC=libmpdec.a +-case $ac_sys_system in +- darwin*|Darwin*) ++AC_CANONICAL_HOST ++ ++AC_MSG_NOTICE(["host is $ac_cv_host"]) ++case $ac_cv_host in ++ *darwin*|*Darwin*) + LIBNAME="libmpdec.dylib" + LIBSONAME="libmpdec.2.dylib" + LIBSHARED="libmpdec.2.5.0.dylib" + CONFIGURE_LDFLAGS="-dynamiclib -install_name @rpath/$LIBSONAME -compatibility_version 2.5 -current_version 2.5.0" + ;; ++ *windows*|*w64*) ++ LIBNAME="libmpdec.dll" ++ LIBSONAME="libmpdec-2.dll" ++ LIBSHARED="libmpdec-2.5.0.dll" ++ CONFIGURE_LDFLAGS="-shared -Wl,--out-implib,libmpdec.dll.a" ++ ;; + *) + LIBNAME="libmpdec.so" + LIBSONAME="libmpdec.so.2" +@@ -34,19 +43,25 @@ AC_SUBST(LIBSHARED) + + + LIBSTATIC_CXX=libmpdec++.a +-case $ac_sys_system in +- darwin*|Darwin*) ++case $ac_cv_host in ++ *darwin*|*Darwin*) + LIBNAME_CXX="libmpdec++.dylib" + LIBSONAME_CXX="libmpdec++.2.dylib" + LIBSHARED_CXX="libmpdec++.2.5.0.dylib" + CONFIGURE_LDXXFLAGS="-dynamiclib -install_name @rpath/$LIBSONAME_CXX -undefined dynamic_lookup -compatibility_version 2.5 -current_version 2.5.0" + ;; +- *) ++ *linux*) + LIBNAME_CXX="libmpdec++.so" + LIBSONAME_CXX="libmpdec++.so.2" + LIBSHARED_CXX="libmpdec++.so.2.5.0" + CONFIGURE_LDXXFLAGS="-shared -Wl,-soname,$LIBSONAME_CXX" + ;; ++ *windows* | *w64*) ++ LIBNAME_CXX="libmpdec++.dll" ++ LIBSONAME_CXX="libmpdec++-2.dll" ++ LIBSHARED_CXX="libmpdec++-2.5.0.dll" ++ CONFIGURE_LDXXFLAGS="-shared -Wl,--out-implib,libmpdec++.dll.a" ++ ;; + esac + + AC_SUBST(LIBSTATIC_CXX) +@@ -55,7 +70,6 @@ AC_SUBST(LIBSONAME_CXX) + AC_SUBST(LIBSHARED_CXX) + + # Apparently purely informational for this particular build: +-AC_CANONICAL_HOST + AC_SUBST(build) + AC_SUBST(host) + diff --git a/recipes/mpdecimal/2.5.x/patches/2.5.1-0001-msvc-fixes.patch b/recipes/mpdecimal/2.5.x/patches/2.5.1-0001-msvc-fixes.patch new file mode 100644 index 0000000000000..96446677530c4 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/patches/2.5.1-0001-msvc-fixes.patch @@ -0,0 +1,73 @@ +--- libmpdec++/Makefile.vc ++++ libmpdec++/Makefile.vc +@@ -16,15 +16,15 @@ + + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi /EHsc +-OPT_SHARED = /MDd /Od /Zi /EHsc ++OPT = /Od /Zi /EHsc ++OPT_SHARED = /Od /Zi /EHsc + !else +-OPT = /MT /Ox /GS /EHsc +-OPT_SHARED = /MD /Ox /GS /EHsc ++OPT = /Ox /GS /EHsc ++OPT_SHARED = /Ox /GS /EHsc + !endif + + +-MPD_CXXFLAGS = /W4 /nologo $(OPT) +-MPD_CXXFLAGS_SHARED = /DBUILD_LIBMPDECXX /W4 /nologo $(OPT_SHARED) $(PGOFLAGS) +-MPD_BIN_CXXFLAGS_SHARED = /W4 /nologo $(OPT_SHARED) $(PGOFLAGS) ++MPD_CXXFLAGS = /W4 /nologo $(OPT) $(CONAN_CXXFLAGS) $(CONAN_CFLAGS) ++MPD_CXXFLAGS_SHARED = /DBUILD_LIBMPDECXX /W4 /nologo $(OPT_SHARED) $(PGOFLAGS) $(CONAN_LDFLAGS) ++MPD_BIN_CXXFLAGS_SHARED = /W4 /nologo $(OPT_SHARED) $(PGOFLAGS) $(CONAN_LDFLAGS) + + MPD_LDXXFLAGS= /DLL /MANIFEST $(LDXXFLAGS) +@@ -38,11 +38,11 @@ + SHARED_OBJS = .objs\decimal.obj + + +-$(LIBSTATIC_CXX): Makefile $(OBJS) ++$(LIBSTATIC_CXX): Makefile.vc $(OBJS) + -@if exist $@ del $(LIBSTATIC_CXX) + lib /out:$(LIBSTATIC_CXX) $(OBJS) + +-$(LIBSHARED_CXX): Makefile $(SHARED_OBJS) ++$(LIBSHARED_CXX): Makefile.vc $(SHARED_OBJS) + -@if exist $@ del $(LIBSHARED_CXX) + link $(MPD_LDXXFLAGS) /out:$(LIBSHARED_CXX) /implib:$(LIBIMPORT_CXX) /LIBPATH:$(SRCDIR) $(SHARED_OBJS) $(LIBIMPORT) + mt -manifest $(LIBSHARED_CXX).manifest -outputresource:$(LIBSHARED_CXX);2 +@@ -51,2 +51,2 @@ + decimal.obj:\ +-Makefile decimal.cc decimal.hh ++Makefile.vc decimal.cc decimal.hh +@@ -55,2 +55,2 @@ + .objs\decimal.obj:\ +-Makefile decimal.cc decimal.hh ++Makefile.vc decimal.cc decimal.hh +--- libmpdec/Makefile.vc ++++ libmpdec/Makefile.vc +@@ -36,12 +36,12 @@ + !endif + + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi /EHsc +-OPT_SHARED = /MDd /Od /Zi /EHsc ++OPT = /Od /Zi /EHsc ++OPT_SHARED = /Od /Zi /EHsc + !else +-OPT = /MT /Ox /GS /EHsc +-OPT_SHARED = /MD /Ox /GS /EHsc ++OPT = /Ox /GS /EHsc ++OPT_SHARED = /Ox /GS /EHsc + !endif + +-MPD_CFLAGS = /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) +-MPD_CFLAGS_SHARED = /DBUILD_LIBMPDEC /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT_SHARED) $(PGOFLAGS) ++MPD_CFLAGS = /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) $(CONAN_CFLAGS) ++MPD_CFLAGS_SHARED = /DBUILD_LIBMPDEC /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT_SHARED) $(PGOFLAGS) $(CONAN_CFLAGS) +@@ -52,1 +52,1 @@ +-MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) ++MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) $(CONAN_LDFLAGS) + + diff --git a/recipes/mpdecimal/2.5.x/patches/2.5.1-0002-add-mingw-to-configure-ac.patch b/recipes/mpdecimal/2.5.x/patches/2.5.1-0002-add-mingw-to-configure-ac.patch new file mode 100644 index 0000000000000..0a6948bd560f5 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/patches/2.5.1-0002-add-mingw-to-configure-ac.patch @@ -0,0 +1,36 @@ +--- configure.ac ++++ configure.ac +@@ -11,2 +11,2 @@ +-ac_sys_system=`uname -s` +-AC_MSG_RESULT($ac_sys_system) ++AC_CANONICAL_HOST ++ac_sys_system=$ac_cv_host +@@ -204,2 +204,8 @@ + case $ac_sys_system in ++ *windows*|*w64*) ++ LIBNAME="libmpdec.dll" ++ LIBSONAME="libmpdec.2.dll" ++ LIBSHARED="libmpdec.2.5.1.dll" ++ CONFIGURE_LDFLAGS="-shared -Wl,--out-implib,libmpdec.dll.a" ++ ;; +- darwin*|Darwin*) ++ *darwin*|*Darwin*) +@@ -232,2 +238,8 @@ + case $ac_sys_system in ++ *windows*|*w64*) ++ LIBNAME="libmpdec.dll" ++ LIBSONAME="libmpdec.2.dll" ++ LIBSHARED="libmpdec.2.5.1.dll" ++ CONFIGURE_LDFLAGS="-shared -Wl,--out-implib,libmpdec.dll.a" ++ ;; +- darwin*|Darwin*) ++ *darwin*|*Darwin*) +@@ -546,7 +558,7 @@ + case $CC in + *gcc*|*clang*) # icc >= 11.0 works as well + case $ac_sys_system in +- darwin*|Darwin*) ++ *darwin*|*Darwin*) + ;; + *) + DETECTED_MACHINE="ppro" diff --git a/recipes/mpdecimal/2.5.x/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch b/recipes/mpdecimal/2.5.x/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch new file mode 100644 index 0000000000000..556a74c1d83a5 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch @@ -0,0 +1,15 @@ +--- libmpdec/mpdecimal32vc.h ++++ libmpdec/mpdecimal32vc.h +@@ -63,1 +63,1 @@ +-#elif defined(_DLL) ++#elif defined(MPDECIMAL_DLL) +--- libmpdec/mpdecimal64vc.h ++++ libmpdec/mpdecimal64vc.h +@@ -63,1 +63,1 @@ +-#elif defined(_DLL) ++#elif defined(MPDECIMAL_DLL) +--- libmpdec++/decimal.hh ++++ libmpdec++/devimal.hh +@@ -63,1 +63,1 @@ +- #elif defined(_DLL) ++ #elif defined(MPDECIMALXX_DLL) diff --git a/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt b/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5aa7762f69b0 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +enable_testing() + +# This is a non-official mpdecimal module! +find_package(mpdecimal REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mpdecimal::libmpdecimal) +add_test(NAME test_package COMMAND test_package 10 13) + +if(MPDECIMAL_CXX) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + set_propertY(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE mpdecimal::libmpdecimal++) + add_test(NAME test_package_cpp COMMAND test_package_cpp 10 13) +endif() diff --git a/recipes/mpdecimal/2.5.x/test_package/conanfile.py b/recipes/mpdecimal/2.5.x/test_package/conanfile.py new file mode 100644 index 0000000000000..6ee5b409e31d8 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.build import can_run, build_jobs + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VirtualRunEnv", "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MPDECIMAL_CXX"] = self.dependencies["mpdecimal"].options.cxx + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/mpdecimal/2.5.x/test_package/test_package.c b/recipes/mpdecimal/2.5.x/test_package/test_package.c new file mode 100644 index 0000000000000..fe4dcfc3cac82 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/test_package/test_package.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2008-2016 Stefan Krah. 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 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 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 + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "%s: usage: ./%s x y\n", argv[0], argv[0]); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_pow(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} diff --git a/recipes/mpdecimal/2.5.x/test_package/test_package.cpp b/recipes/mpdecimal/2.5.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..ff3bd2f237696 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include "decimal.hh" + +#include + +int main(int argc, const char *argv[]) { + if (argc != 3) { + std::cerr << "Requires 2 arguments\n"; + return 1; + } + decimal::Decimal d1(argv[1]); + decimal::Decimal d2(argv[2]); + std::cout << d1 << ".pow(" << d2 << ") = " << d1.pow(d2) << "\n"; + return 0; +} diff --git a/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt b/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py b/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..39414f0a3b89d --- /dev/null +++ b/recipes/mpdecimal/2.5.x/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" + + def build(self): + cmake = CMake(self) + cmake.definitions["MPDECIMAL_CXX"] = self.options["mpdecimal"].cxx + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", + run_environment=True) diff --git a/recipes/mpdecimal/config.yml b/recipes/mpdecimal/config.yml new file mode 100644 index 0000000000000..24b096a4ce8a6 --- /dev/null +++ b/recipes/mpdecimal/config.yml @@ -0,0 +1,7 @@ +versions: + "2.5.1": + folder: "2.5.x" + "2.5.0": + folder: "2.5.x" + "2.4.2": + folder: "2.4.2" diff --git a/recipes/mpfr/all/CMakeLists.txt.in b/recipes/mpfr/all/CMakeLists.txt.in new file mode 100644 index 0000000000000..d9812e3e8e5cf --- /dev/null +++ b/recipes/mpfr/all/CMakeLists.txt.in @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.19) +project(cmake_wrapper) + +# autotools project does not allow building a shared mpfr library (because of libtool limitation) + +find_package(gmp REQUIRED CONFIG) + +add_library(mpfr {mpfr_sources}) +target_compile_definitions(mpfr PRIVATE {definitions}) +target_include_directories(mpfr PRIVATE "${{CMAKE_BINARY_DIR}}" "${{CMAKE_BINARY_DIR}}/src" "${{CMAKE_CURRENT_SOURCE_DIR}}/src") +target_link_libraries(mpfr PRIVATE gmp::gmp) +if(BUILD_SHARED_LIBS) + target_compile_definitions(mpfr PRIVATE MPFR_DLL) +endif() +install(TARGETS mpfr + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +install(FILES {mpfr_headers} + DESTINATION include +) diff --git a/recipes/mpfr/all/conandata.yml b/recipes/mpfr/all/conandata.yml new file mode 100644 index 0000000000000..dd4e8f905e5f9 --- /dev/null +++ b/recipes/mpfr/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "4.1.0": + sha256: 3127fe813218f3a1f0adf4e8899de23df33b4cf4b4b3831a5314f78e65ffa2d6 + url: https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.gz + "4.0.2": + sha256: ae26cace63a498f07047a784cd3b0e4d010b44d2b193bab82af693de57a19a78 + url: https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.gz +patches: + "4.1.0": + - patch_file: "patches/4.1.0-0002-windows-header-dll.patch" + patch_description: "Windows header DLL" + patch_type: "portability" + "4.0.2": + - patch_file: "patches/4.0.2-0002-windows-header-dll.patch" + patch_description: "Windows header DLL" + patch_type: "portability" diff --git a/recipes/mpfr/all/conanfile.py b/recipes/mpfr/all/conanfile.py new file mode 100644 index 0000000000000..03acd9af8c081 --- /dev/null +++ b/recipes/mpfr/all/conanfile.py @@ -0,0 +1,182 @@ +from conan import ConanFile +from conan.tools.files import save, load, copy, get, rmdir, replace_in_file, apply_conandata_patches +from conan.tools.layout import basic_layout +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.microsoft import is_msvc, check_min_vs, unix_path +from conan.tools.apple import fix_apple_shared_install_name +from conan.errors import ConanException +import os +import re +import shlex + +required_conan_version = ">=1.58.0" + + +class MpfrConan(ConanFile): + name = "mpfr" + package_type = "library" + description = "The MPFR library is a C library for multiple-precision floating-point computations with " \ + "correct rounding" + topics = ("mpfr", "multiprecision", "math", "mathematics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.mpfr.org/" + license = "LGPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "exact_int": ["mpir", "gmp",], + } + default_options = { + "shared": False, + "fPIC": True, + "exact_int": "gmp", + } + + exports_sources = "CMakeLists.txt.in", "patches/**" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def requirements(self): + if self.options.exact_int == "gmp": + self.requires("gmp/6.2.1", transitive_headers=True) + elif self.options.exact_int == "mpir": + self.requires("mpir/3.0.0") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + 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 generate(self): + if self.settings.os == "Windows": + if is_msvc(self) and not check_min_vs(self, 193, raise_invalid=False) and \ + not self.conf.get("tools.cmake.cmaketoolchain:generator", check_type=str): + # Use NMake to workaround bug in MSBuild versions prior to 2022 that shows up as: + # error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item + # has already been added. Key in dictionary: 'tmp' Key being added: 'TMP' + self.conf.define("tools.cmake.cmaketoolchain:generator", "NMake Makefiles") + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + else: # Even with multiple toolchains (see below), can only have one "deps" generator as multiple ones will collide + tc = AutotoolsDeps(self) + tc.generate() + + # Setup autotools on all platforms because we need to run autotools.configure when using CMake + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-thread-safe") + tc.configure_args.append(f'--with-gmp={unix_path(self, self.dependencies[str(self.options.exact_int)].package_folder)}') + if self.settings.compiler == "clang": + # warning: optimization flag '-ffloat-store' is not supported + tc.configure_args.append("mpfr_cv_gcc_floatconv_bug=no") + if self.settings.arch == "x86": + # fatal error: error in backend: Unsupported library call operation! + tc.configure_args.append("--disable-float128") + + if self.options.exact_int == "mpir": + tc.extra_cflags.append(f"-I{self.build_folder}") + if is_msvc(self): + tc.extra_cflags.append("-FS") + + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + tc.generate(env) # Create conanbuild.conf + + def _extract_makefile_variable(self, makefile, variable): + makefile_contents = load(self, makefile) + match = re.search(f'{variable}[ \t]*=[ \t]*((?:(?:[a-zA-Z0-9 \t.=/_-])|(?:\\\\\"))*(?:\\\\\n(?:(?:[a-zA-Z0-9 \t.=/_-])|(?:\\\"))*)*)\n', makefile_contents) + if not match: + raise ConanException(f"Cannot extract variable {variable} from {makefile_contents}") + lines = [line.strip(" \t\\") for line in match.group(1).split()] + return [item for line in lines for item in shlex.split(line) if item] + + def _extract_mpfr_autotools_variables(self): + makefile_am = os.path.join(self.source_folder, "src", "Makefile.am") # src/src/Makefile.am + makefile = os.path.join("src", "Makefile") + sources = self._extract_makefile_variable(makefile_am, "libmpfr_la_SOURCES") + headers = self._extract_makefile_variable(makefile_am, "include_HEADERS") + defs = self._extract_makefile_variable(makefile, "DEFS") + return sources, headers, defs + + def build(self): + apply_conandata_patches(self) + + if self.settings.os == "Windows": # Allow mixed shared and static libs + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'as_fn_error $? "libgmp isn\'t provided as a DLL: use --enable-static --disable-shared" "$LINENO" 5', + '# as_fn_error $? "libgmp isn\'t provided as a DLL: use --enable-static --disable-shared" "$LINENO" 5') + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'as_fn_error $? "libgmp is provided as a DLL: use --disable-static --enable-shared" "$LINENO" 5', + '# as_fn_error $? "libgmp is provided as a DLL: use --disable-static --enable-shared" "$LINENO" 5') + + if self.options.exact_int == "mpir": + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "-lgmp", "-lmpir") + replace_in_file(self, os.path.join(self.source_folder, "src", "mpfr.h"), + "", "") + save(self, "gmp.h", "#pragma once\n#include \n") + + autotools = Autotools(self) + autotools.configure() # Need to generate Makefile to extract variables for CMake below + + if self.settings.os == "Windows": + cmakelists_in = load(self, os.path.join(self.export_sources_folder, "CMakeLists.txt.in")) + sources, headers, definitions = self._extract_mpfr_autotools_variables() + sources = ["src/" + src for src in sources] + headers = ["src/" + hdr for hdr in headers] + save(self, os.path.join(self.source_folder, "CMakeLists.txt"), cmakelists_in.format( + mpfr_sources=" ".join(sources), + mpfr_headers=" ".join(headers), + definitions=" ".join(definitions), + )) + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools.make(args=["V=0"]) + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + os.unlink(os.path.join(self.package_folder, "lib", "libmpfr.la")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["mpfr"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines = ["MPFR_DLL"] diff --git a/recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch b/recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch new file mode 100644 index 0000000000000..c6b67dbae98b2 --- /dev/null +++ b/recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch @@ -0,0 +1,21 @@ +--- configure.ac ++++ configure.ac +@@ -27,6 +27,7 @@ + + dnl Add check-news when it checks for more than 15 lines + AC_INIT([MPFR],[4.0.2]) ++AC_CANONICAL_TARGET + + dnl Older Automake versions than 1.13 may still be supported, but no longer + dnl tested, and many things have changed in 1.13. Moreover the INSTALL file + +--- acinclude.m4 ++++ acinclude.m4 +@@ -41,7 +41,6 @@ + AC_REQUIRE([AC_OBJEXT]) + AC_REQUIRE([MPFR_CHECK_LIBM]) + AC_REQUIRE([MPFR_CHECK_LIBQUADMATH]) +-AC_REQUIRE([AC_HEADER_TIME]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl Features for the MPFR shared cache. This needs to be done diff --git a/recipes/mpfr/all/patches/4.0.2-0002-windows-header-dll.patch b/recipes/mpfr/all/patches/4.0.2-0002-windows-header-dll.patch new file mode 100644 index 0000000000000..ae4f50823cf59 --- /dev/null +++ b/recipes/mpfr/all/patches/4.0.2-0002-windows-header-dll.patch @@ -0,0 +1,27 @@ +--- src/mpfr.h ++++ src/mpfr.h +@@ -290,16 +290,15 @@ typedef enum { + # endif + #endif + +-/* Support for WINDOWS Dll: +- Check if we are inside a MPFR build, and if so export the functions. +- Otherwise does the same thing as GMP */ +-#if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL +-# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT +-#else +-# ifndef __GMP_DECLSPEC +-# define __GMP_DECLSPEC ++/* Support for WINDOWS Dll */ ++#if defined(MPFR_DLL) ++# if defined(__MPFR_WITHIN_MPFR) ++# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT ++# else ++# define __MPFR_DECLSPEC __GMP_DECLSPEC_IMPORT + # endif +-# define __MPFR_DECLSPEC __GMP_DECLSPEC ++#else ++# define __MPFR_DECLSPEC + #endif + + /* Use MPFR_DEPRECATED to mark MPFR functions, types or variables as diff --git a/recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch b/recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch new file mode 100644 index 0000000000000..888d7d12deb82 --- /dev/null +++ b/recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch @@ -0,0 +1,22 @@ +--- configure.ac ++++ configure.ac +@@ -27,6 +27,7 @@ + + dnl Add check-news when it checks for more than 15 lines + AC_INIT([MPFR],[4.1.0]) ++AC_CANONICAL_TARGET + + dnl Older Automake versions than 1.13 may still be supported, but no longer + dnl tested, and many things have changed in 1.13. Moreover the INSTALL file + +--- acinclude.m4 ++++ acinclude.m4 +@@ -40,7 +40,6 @@ + AC_REQUIRE([AC_OBJEXT]) + AC_REQUIRE([MPFR_CHECK_LIBM]) + AC_REQUIRE([MPFR_CHECK_LIBQUADMATH]) +-AC_REQUIRE([AC_HEADER_TIME]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl Features for the MPFR shared cache. This needs to be done + diff --git a/recipes/mpfr/all/patches/4.1.0-0002-windows-header-dll.patch b/recipes/mpfr/all/patches/4.1.0-0002-windows-header-dll.patch new file mode 100644 index 0000000000000..e3d32423a4783 --- /dev/null +++ b/recipes/mpfr/all/patches/4.1.0-0002-windows-header-dll.patch @@ -0,0 +1,27 @@ +--- src/mpfr.h ++++ src/mpfr.h +@@ -311,16 +311,15 @@ typedef enum { + # endif + #endif + +-/* Support for WINDOWS Dll: +- Check if we are inside a MPFR build, and if so export the functions. +- Otherwise does the same thing as GMP */ +-#if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL +-# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT +-#else +-# ifndef __GMP_DECLSPEC +-# define __GMP_DECLSPEC ++/* Support for WINDOWS Dll */ ++#if defined(MPFR_DLL) ++# if defined(__MPFR_WITHIN_MPFR) ++# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT ++# else ++# define __MPFR_DECLSPEC __GMP_DECLSPEC_IMPORT + # endif +-# define __MPFR_DECLSPEC __GMP_DECLSPEC ++#else ++# define __MPFR_DECLSPEC + #endif + + /* Use MPFR_DEPRECATED to mark MPFR functions, types or variables as diff --git a/recipes/mpfr/all/test_package/CMakeLists.txt b/recipes/mpfr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f4253e8466cb9 --- /dev/null +++ b/recipes/mpfr/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.3.0) +project(test_package LANGUAGES C) + +find_package(mpfr REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mpfr::mpfr) diff --git a/recipes/mpfr/all/test_package/conanfile.py b/recipes/mpfr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c56e8a6249e69 --- /dev/null +++ b/recipes/mpfr/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mpfr/all/test_package/test_package.c b/recipes/mpfr/all/test_package/test_package.c new file mode 100644 index 0000000000000..cd23bafe2a7a0 --- /dev/null +++ b/recipes/mpfr/all/test_package/test_package.c @@ -0,0 +1,32 @@ +/* example was taken from: https://www.mpfr.org/sample.html */ + +#include + +#include + +int main (void) +{ + unsigned int i; + mpfr_t s, t, u; + + mpfr_init2 (t, 200); + mpfr_set_d (t, 1.0, MPFR_RNDD); + mpfr_init2 (s, 200); + mpfr_set_d (s, 1.0, MPFR_RNDD); + mpfr_init2 (u, 200); + for (i = 1; i <= 100; i++) + { + mpfr_mul_ui (t, t, i, MPFR_RNDU); + mpfr_set_d (u, 1.0, MPFR_RNDD); + mpfr_div (u, u, t, MPFR_RNDD); + mpfr_add (s, s, u, MPFR_RNDD); + } + printf ("Sum is "); + mpfr_out_str (stdout, 10, 0, s, MPFR_RNDD); + putchar ('\n'); + mpfr_clear (s); + mpfr_clear (t); + mpfr_clear (u); + mpfr_free_cache (); + return 0; +} diff --git a/recipes/mpfr/all/test_v1_package/CMakeLists.txt b/recipes/mpfr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..222d09629eb12 --- /dev/null +++ b/recipes/mpfr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.3.0) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(mpfr CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} mpfr::mpfr) diff --git a/recipes/mpfr/all/test_v1_package/conanfile.py b/recipes/mpfr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/mpfr/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/mpfr/config.yml b/recipes/mpfr/config.yml new file mode 100644 index 0000000000000..72132855c0cf8 --- /dev/null +++ b/recipes/mpfr/config.yml @@ -0,0 +1,5 @@ +versions: + "4.1.0": + folder: all + "4.0.2": + folder: all diff --git a/recipes/mpg123/all/conandata.yml b/recipes/mpg123/all/conandata.yml new file mode 100644 index 0000000000000..aa66e1050ebb7 --- /dev/null +++ b/recipes/mpg123/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.31.2": + url: + - "https://sourceforge.net/projects/mpg123/files/mpg123/1.31.2/mpg123-1.31.2.tar.bz2" + - "https://www.mpg123.de/download/mpg123-1.31.2.tar.bz2" + sha256: "b17f22905e31f43b6b401dfdf6a71ed11bb7d056f68db449d70b9f9ae839c7de" + "1.29.3": + url: + - "https://sourceforge.net/projects/mpg123/files/mpg123/1.29.3/mpg123-1.29.3.tar.bz2" + - "https://www.mpg123.de/download/mpg123-1.29.3.tar.bz2" + sha256: "963885d8cc77262f28b77187c7d189e32195e64244de2530b798ddf32183e847" + "1.26.4": + url: + - "https://sourceforge.net/projects/mpg123/files/mpg123/1.26.4/mpg123-1.26.4.tar.bz2" + - "https://www.mpg123.de/download/mpg123-1.26.4.tar.bz2" + sha256: "081991540df7a666b29049ad870f293cfa28863b36488ab4d58ceaa7b5846454" + +patches: + "1.31.2": + - patch_file: "patches/0001-msvc-export-symbols.patch" + "1.26.4": + - patch_file: "patches/0001-msvc-export-symbols.patch" + "1.29.3": + - patch_file: "patches/0001-msvc-export-symbols.patch" + - patch_file: "patches/0002-cmake-read_api_version-fix.patch" diff --git a/recipes/mpg123/all/conanfile.py b/recipes/mpg123/all/conanfile.py new file mode 100644 index 0000000000000..5ff9754f83253 --- /dev/null +++ b/recipes/mpg123/all/conanfile.py @@ -0,0 +1,235 @@ +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.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches, rmdir, rm +from conan.tools.microsoft import is_msvc +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.build import cross_building +import os + +required_conan_version = ">=1.53.0" + + +class Mpg123Conan(ConanFile): + name = "mpg123" + description = "Fast console MPEG Audio Player and decoder library" + topics = ("mpeg", "audio", "player", "decoder") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://mpg123.org/" + license = "LGPL-2.1-or-later", "GPL-2.0-or-later" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "flexible_resampling": [True, False], + "network": [True, False], + "icy": [True, False], + "id3v2": [True, False], + "ieeefloat": [True, False], + "layer1": [True, False], + "layer2": [True, False], + "layer3": [True, False], + "moreinfo": [True, False], + "seektable": [None, "ANY"], + "module": ["dummy", "libalsa", "tinyalsa", "win32"], + } + default_options = { + "shared": False, + "fPIC": True, + "flexible_resampling": True, + "network": True, + "icy": True, + "id3v2": True, + "ieeefloat": True, + "layer1": True, + "layer2": True, + "layer3": True, + "moreinfo": True, + "seektable": "1000", + "module": "dummy", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _audio_module(self): + return { + "libalsa": "alsa", + }.get(str(self.options.module), str(self.options.module)) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + 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): + if is_msvc(self): + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.module == "libalsa": + self.requires("libalsa/1.2.7.2") + if self.options.module == "tinyalsa": + self.requires("tinyalsa/2.0.0") + + def validate(self): + if not str(self.options.seektable).isdigit(): + raise ConanInvalidConfiguration(f"The option -o {self.ref.name}:seektable must be an integer number.") + if self.settings.os != "Windows" and self.options.module == "win32": + raise ConanInvalidConfiguration(f"The option -o {self.ref.name}:module should not use 'win32' for non-Windows OS") + + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self.settings.arch in ["x86", "x86_64"]: + self.tool_requires("yasm/1.3.0") + 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") + + 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") + if is_msvc(self): + tc = CMakeToolchain(self) + tc.variables["NO_MOREINFO"] = not self.options.moreinfo + tc.variables["NETWORK"] = self.options.network + tc.variables["NO_NTOM"] = not self.options.flexible_resampling + tc.variables["NO_ICY"] = not self.options.icy + tc.variables["NO_ID3V2"] = not self.options.id3v2 + tc.variables["IEEE_FLOAT"] = self.options.ieeefloat + tc.variables["NO_LAYER1"] = not self.options.layer1 + tc.variables["NO_LAYER2"] = not self.options.layer2 + tc.variables["NO_LAYER3"] = not self.options.layer3 + tc.variables["USE_MODULES"] = False + tc.variables["CHECK_MODULES"] = self._audio_module + tc.variables["WITH_SEEKTABLE"] = self.options.seektable + tc.generate() + tc = CMakeDeps(self) + tc.generate() + else: + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--enable-moreinfo={yes_no(self.options.moreinfo)}", + f"--enable-network={yes_no(self.options.network)}", + f"--enable-ntom={yes_no(self.options.flexible_resampling)}", + f"--enable-icy={yes_no(self.options.icy)}", + f"--enable-id3v2={yes_no(self.options.id3v2)}", + f"--enable-ieeefloat={yes_no(self.options.ieeefloat)}", + f"--enable-layer1={yes_no(self.options.layer1)}", + f"--enable-layer2={yes_no(self.options.layer2)}", + f"--enable-layer3={yes_no(self.options.layer3)}", + f"--with-audio={self._audio_module}", + f"--with-default-audio={self._audio_module}", + f"--with-seektable={self.options.seektable}", + f"--enable-modules=no", + f"--enable-shared={yes_no(self.options.shared)}", + f"--enable-static={yes_no(not self.options.shared)}", + ]) + if is_apple_os(self): + # Needed for fix_apple_shared_install_name invocation in package method + tc.extra_cflags = ["-headerpad_max_install_names"] + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "ports", "cmake")) + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + 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")) + + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mpg123") + + self.cpp_info.components["libmpg123"].libs = ["mpg123"] + self.cpp_info.components["libmpg123"].set_property("pkg_config_name", "libmpg123") + self.cpp_info.components["libmpg123"].set_property("cmake_target_name", "MPG123::libmpg123") + self.cpp_info.components["libmpg123"].names["cmake_find_package"] = "libmpg123" + self.cpp_info.components["libmpg123"].names["cmake_find_package_multi"] = "libmpg123" + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["libmpg123"].defines.append("LINK_MPG123_DLL") + + self.cpp_info.components["libout123"].libs = ["out123"] + self.cpp_info.components["libout123"].set_property("pkg_config_name", "libout123") + self.cpp_info.components["libout123"].set_property("cmake_target_name", "MPG123::libout123") + self.cpp_info.components["libout123"].names["cmake_find_package"] = "libout123" + self.cpp_info.components["libout123"].names["cmake_find_package_multi"] = "libout123" + self.cpp_info.components["libout123"].requires = ["libmpg123"] + + self.cpp_info.components["libsyn123"].libs = ["syn123"] + self.cpp_info.components["libsyn123"].set_property("pkg_config_name", "libsyn123") + self.cpp_info.components["libsyn123"].set_property("cmake_target_name", "MPG123::libsyn123") + self.cpp_info.components["libsyn123"].names["cmake_find_package"] = "libsyn123" + self.cpp_info.components["libsyn123"].names["cmake_find_package_multi"] = "libsyn123" + self.cpp_info.components["libsyn123"].requires = ["libmpg123"] + + if self.settings.os == "Linux": + self.cpp_info.components["libmpg123"].system_libs = ["m"] + if self.settings.arch in ["x86", "x86_64"]: + self.cpp_info.components["libsyn123"].system_libs = ["mvec"] + elif self.settings.os == "Windows": + self.cpp_info.components["libmpg123"].system_libs = ["shlwapi"] + + if self.options.module == "libalsa": + self.cpp_info.components["libout123"].requires.append("libalsa::libalsa") + if self.options.module == "tinyalsa": + self.cpp_info.components["libout123"].requires.append("tinyalsa::tinyalsa") + if self.options.module == "win32": + self.cpp_info.components["libout123"].system_libs.append("winmm") + + + # TODO: Remove after Conan 2.x becomes the standard + self.cpp_info.filenames["cmake_find_package"] = "mpg123" + self.cpp_info.filenames["cmake_find_package_multi"] = "mpg123" + self.cpp_info.names["cmake_find_package"] = "MPG123" + self.cpp_info.names["cmake_find_package_multi"] = "MPG123" + + 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/mpg123/all/patches/0001-msvc-export-symbols.patch b/recipes/mpg123/all/patches/0001-msvc-export-symbols.patch new file mode 100644 index 0000000000000..75a32b2884251 --- /dev/null +++ b/recipes/mpg123/all/patches/0001-msvc-export-symbols.patch @@ -0,0 +1,22 @@ +--- a/ports/cmake/src/libout123/CMakeLists.txt ++++ b/ports/cmake/src/libout123/CMakeLists.txt +@@ -18,7 +18,7 @@ add_library(${TARGET} + $ + $<$:$>) + +-set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME out123) ++set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME out123 WINDOWS_EXPORT_ALL_SYMBOLS ON) + + target_link_libraries(${TARGET} PRIVATE + $ +--- a/ports/cmake/src/libsyn123/CMakeLists.txt ++++ b/ports/cmake/src/libsyn123/CMakeLists.txt +@@ -15,7 +15,7 @@ add_library(${TARGET} + "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libsyn123/sampleconv.c" + $) + +-set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME syn123) ++set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME syn123 WINDOWS_EXPORT_ALL_SYMBOLS ON) + + target_include_directories(${TARGET} INTERFACE + "$" diff --git a/recipes/mpg123/all/patches/0002-cmake-read_api_version-fix.patch b/recipes/mpg123/all/patches/0002-cmake-read_api_version-fix.patch new file mode 100644 index 0000000000000..934fa5ad4579e --- /dev/null +++ b/recipes/mpg123/all/patches/0002-cmake-read_api_version-fix.patch @@ -0,0 +1,10 @@ +--- a/ports/cmake/cmake/read_api_version.cmake ++++ b/ports/cmake/cmake/read_api_version.cmake +@@ -1,6 +1,6 @@ + function(read_api_version project_version api_version outapi_version synapi_version ) + +- file( READ "${CMAKE_SOURCE_DIR}/../../configure.ac" configure_ac ) ++ file( READ "${CMAKE_CURRENT_SOURCE_DIR}/../../configure.ac" configure_ac ) + + string( REGEX MATCH "AC_INIT\\(\\[mpg123\\], \\[([0-9\\.]+)" result ${configure_ac} ) + set( ${project_version} ${CMAKE_MATCH_1} PARENT_SCOPE ) diff --git a/recipes/mpg123/all/test_package/CMakeLists.txt b/recipes/mpg123/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f76bb27a27d92 --- /dev/null +++ b/recipes/mpg123/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(mpg123 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE MPG123::libmpg123) diff --git a/recipes/mpg123/all/test_package/conanfile.py b/recipes/mpg123/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/mpg123/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/mpg123/all/test_package/test_package.c b/recipes/mpg123/all/test_package/test_package.c new file mode 100644 index 0000000000000..9db524c82cb7a --- /dev/null +++ b/recipes/mpg123/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include "mpg123.h" +#include + +int main() { + int error; + mpg123_pars *pars; + + pars = mpg123_new_pars(&error); + mpg123_fmt_all(pars); + mpg123_delete_pars(pars); + return 0; +} diff --git a/recipes/mpg123/all/test_v1_package/CMakeLists.txt b/recipes/mpg123/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mpg123/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mpg123/all/test_v1_package/conanfile.py b/recipes/mpg123/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mpg123/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mpg123/all/test_v1_package/test_package.c b/recipes/mpg123/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..9db524c82cb7a --- /dev/null +++ b/recipes/mpg123/all/test_v1_package/test_package.c @@ -0,0 +1,12 @@ +#include "mpg123.h" +#include + +int main() { + int error; + mpg123_pars *pars; + + pars = mpg123_new_pars(&error); + mpg123_fmt_all(pars); + mpg123_delete_pars(pars); + return 0; +} diff --git a/recipes/mpg123/config.yml b/recipes/mpg123/config.yml new file mode 100644 index 0000000000000..72e2327209ae3 --- /dev/null +++ b/recipes/mpg123/config.yml @@ -0,0 +1,7 @@ +versions: + "1.31.2": + folder: "all" + "1.29.3": + folder: "all" + "1.26.4": + folder: "all" diff --git a/recipes/mpir/all/conandata.yml b/recipes/mpir/all/conandata.yml new file mode 100644 index 0000000000000..c5a67d7b84dca --- /dev/null +++ b/recipes/mpir/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + url: "http://mpir.org/mpir-3.0.0.zip" + sha256: "6277d3cc36ff39c98e4d4cc17b46b5a6ff42a22d30a4130b2d49255f98dd8c1f" diff --git a/recipes/mpir/all/conanfile.py b/recipes/mpir/all/conanfile.py new file mode 100644 index 0000000000000..3c6c16a085f0b --- /dev/null +++ b/recipes/mpir/all/conanfile.py @@ -0,0 +1,217 @@ +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 + +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/" + license = "LGPL-3.0-or-later" + + provides = [] + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_cxx": [True, False], + "enable_gmpcompat": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_cxx": True, + "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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.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 + if self.options.enable_gmpcompat: + self.provides.append("gmp") + + 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("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") + + def source(self): + get(self, keep_permissions=True, **self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + @property + def _platforms(self): + return {"x86": "Win32", "x86_64": "x64"} + + @property + def _dll_or_lib(self): + return "dll" if self.options.shared else "lib" + + @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) + 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)) + ] + if self.options.get_safe("enable_cxx"): + vcxproj_paths.append(os.path.join(self._source_subfolder, 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 + 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 "", + ) + new_runtime = "MultiThreaded{}{}".format( + "Debug" if "d" in msvc_runtime_flag(self) else "", + "DLL" if "MD" in msvc_runtime_flag(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 + + 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) + + for root, _, files in os.walk(new_dir): + for file in files: + full_file = os.path.join(root, file) + replace_in_file(self, full_file, "v141", f"{toolset}", strict=False) + replace_in_file(self, full_file, "prebuild skylake\\avx x64 15", f"prebuild skylake\\avx x64 {ver}", strict=False) + replace_in_file(self, full_file, "prebuild p3 Win32 15", f"prebuild p3 Win32 {ver}", strict=False) + replace_in_file(self, full_file, "prebuild gc Win32 15", f"prebuild gc Win32 {ver}", strict=False) + replace_in_file(self, full_file, "prebuild gc x64 15", f"prebuild gc x64 {ver}", strict=False) + replace_in_file(self, full_file, "prebuild haswell\\avx x64 15", f"prebuild haswell\\avx x64 {ver}", strict=False) + replace_in_file(self, full_file, "prebuild core2 x64 15", f"prebuild core2 x64 {ver}", strict=False) + replace_in_file(self, full_file, 'postbuild "$(TargetPath)" 15', f'postbuild "$(TargetPath)" {ver}', strict=False) + replace_in_file(self, full_file, 'check_config $(Platform) $(Configuration) 15', f'check_config $(Platform) $(Configuration) {ver}', strict=False) + + def _patch_sources(self): + if is_msvc(self): + self._patch_new_msvc_version(16, "v142") + self._patch_new_msvc_version(17, "v143") + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_visual_studio() + else: + with chdir(self, self._source_subfolder), self._build_context(): + # relocatable shared lib on macOS + replace_in_file(self, "configure", "-install_name \\$rpath/", "-install_name @rpath/") + autotools = self._configure_autotools() + 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)) + 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)) + 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: + copy(self, "gmp.h", dst=include_folder, src=lib_folder, keep_path=True) + if self.options.get_safe("enable_cxx"): + 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) + else: + with chdir(self, self._source_subfolder), self._build_context(): + autotools = self._configure_autotools() + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + if self.options.get_safe("enable_cxx"): + self.cpp_info.libs.append("mpirxx") + self.cpp_info.libs.append("mpir") + if self.options.enable_gmpcompat and not is_msvc(self): + if self.options.get_safe("enable_cxx"): + self.cpp_info.libs.append("gmpxx") + self.cpp_info.libs.append("gmp") + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("MSC_USE_DLL") diff --git a/recipes/mpir/all/test_package/CMakeLists.txt b/recipes/mpir/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d64654ce1f75a --- /dev/null +++ b/recipes/mpir/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mpir CONFIG REQUIRED) + +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 new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/mpir/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mpir/all/test_package/test_package.cpp b/recipes/mpir/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6fe45df20d2a7 --- /dev/null +++ b/recipes/mpir/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include + +void foo(mpz_t result, const mpz_t param, unsigned long n) +{ + unsigned long i; + mpz_mul_ui(result, param, n); + for (i = 1; i < n; i++) + mpz_add_ui(result, result, i * 7); +} + +int main(void) +{ + mpz_t r, n; + mpz_init(r); + mpz_init_set_str(n, "123456", 0); + foo(r, n, 20L); + gmp_printf("%Zd\n", r); + return 0; +} diff --git a/recipes/mpir/config.yml b/recipes/mpir/config.yml new file mode 100644 index 0000000000000..c6ac749e0b234 --- /dev/null +++ b/recipes/mpir/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.0": + folder: all diff --git a/recipes/mpmcqueue/all/conandata.yml b/recipes/mpmcqueue/all/conandata.yml new file mode 100644 index 0000000000000..d3dfe57bc07e6 --- /dev/null +++ b/recipes/mpmcqueue/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/rigtorp/MPMCQueue/archive/refs/tags/v1.0.tar.gz" + sha256: "f009ef10b66f2b8bc6e3a4f50577efbdfea0c163464cd7de368378f173007b75" diff --git a/recipes/mpmcqueue/all/conanfile.py b/recipes/mpmcqueue/all/conanfile.py new file mode 100644 index 0000000000000..f31d795bc0cc2 --- /dev/null +++ b/recipes/mpmcqueue/all/conanfile.py @@ -0,0 +1,55 @@ +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.50.0" + + +class MpmcqueueConan(ConanFile): + name = "mpmcqueue" + description = "A bounded multi-producer multi-consumer concurrent queue written in C++11." + license = "MIT" + topics = ("mpmcqueue", "queue", "concurrency") + homepage = "https://github.com/rigtorp/MPMCQueue" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("gcc < 5 not supported") + + 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 + + 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_file_name", "MPMCQueue") + self.cpp_info.set_property("cmake_target_name", "MPMCQueue::MPMCQueue") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "MPMCQueue" + self.cpp_info.names["cmake_find_package_multi"] = "MPMCQueue" diff --git a/recipes/mpmcqueue/all/test_package/CMakeLists.txt b/recipes/mpmcqueue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a914eaad36ece --- /dev/null +++ b/recipes/mpmcqueue/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(MPMCQueue REQUIRED CONFIG) +find_package(Threads REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE MPMCQueue::MPMCQueue Threads::Threads) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mpmcqueue/all/test_package/conanfile.py b/recipes/mpmcqueue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/mpmcqueue/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/mpmcqueue/all/test_package/test_package.cpp b/recipes/mpmcqueue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e3c8d12a9996f --- /dev/null +++ b/recipes/mpmcqueue/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include + +#include +#include + +int main() { + rigtorp::MPMCQueue q(10); + auto t1 = std::thread([&] { + int v; + q.pop(v); + std::cout << "t1 " << v << "\n"; + }); + auto t2 = std::thread([&] { + int v; + q.pop(v); + std::cout << "t2 " << v << "\n"; + }); + q.push(1); + q.push(2); + t1.join(); + t2.join(); + + return 0; +} diff --git a/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt b/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e299736630b60 --- /dev/null +++ b/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(MPMCQueue REQUIRED CONFIG) +find_package(Threads REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE MPMCQueue::MPMCQueue Threads::Threads) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mpmcqueue/all/test_v1_package/conanfile.py b/recipes/mpmcqueue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mpmcqueue/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/mpmcqueue/config.yml b/recipes/mpmcqueue/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/mpmcqueue/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/mppp/all/conandata.yml b/recipes/mppp/all/conandata.yml new file mode 100644 index 0000000000000..60d10df366776 --- /dev/null +++ b/recipes/mppp/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.27": + url: "https://github.com/bluescarni/mppp/archive/v0.27.tar.gz" + sha256: "a1e04f6605b3242d4361742159cf5ab273162fd7c105c2743a9bebcf44c846c3" + "0.26": + url: "https://github.com/bluescarni/mppp/archive/v0.26.tar.gz" + sha256: "4dbfa68802d9a1365eda884f085418afc147d01b7a928e8333e4dcc1c3b3ce9e" +patches: + "0.27": + - patch_file: "patches/0.27-0001-disable-warning-error.patch" + patch_description: "disable the flag for treats warning as errors" + patch_type: "portability" + "0.26": + - patch_file: "patches/0.26-0001-disable-warning-error.patch" + patch_description: "disable the flag for treats warning as errors" + patch_type: "portability" diff --git a/recipes/mppp/all/conanfile.py b/recipes/mppp/all/conanfile.py new file mode 100644 index 0000000000000..4677b62f734c2 --- /dev/null +++ b/recipes/mppp/all/conanfile.py @@ -0,0 +1,131 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + +class MpppConan(ConanFile): + name = "mppp" + description = "Multiprecision for modern C++ Topics" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bluescarni/mppp/" + topics = ("multiprecision", "gmp", "math-bignum", "computer-algebra") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_mpfr": [True, False], + "with_arb": [True, False], + "with_mpc": [True, False], + "with_quadmath": [True, False], + "with_boost": [True, False], + "with_fmt": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_mpfr": False, + "with_arb": False, + "with_mpc": False, + "with_quadmath": False, + "with_boost": False, + "with_fmt": False, + } + + @property + def _min_cppstd(self): + return 11 + + 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 Version(self.version) < "0.27": + del self.options.with_fmt + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("gmp/6.2.1") + if self.options.with_mpfr: + self.requires("mpfr/4.1.0") + if self.options.with_mpc: + self.requires("mpc/1.2.0") + if self.options.with_boost: + self.requires("boost/1.81.0") + if self.options.get_safe("with_fmt"): + self.requires("fmt/9.1.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.options.with_arb: + raise ConanInvalidConfiguration(f"{self.ref}:with_arb=True is not supported because `fredrik-johansson/arb` is not packaged in CCI. (yet)") + if self.options.with_quadmath: + raise ConanInvalidConfiguration(f"{self.ref}:with_quadmath=True is not supported because `libquadmath` is not available from CCI. (yet)") + if self.options.with_boost and self.dependencies["boost"].options.without_serialization: + raise ConanInvalidConfiguration(f"{self.ref}:with_boost=True requires boost:without_serialization=False") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["MPPP_BUILD_STATIC_LIBRARY"] = not self.options.shared + tc.variables["MPPP_WITH_MPFR"] = self.options.with_mpfr + tc.variables["MPPP_WITH_ARB"] = self.options.with_arb + tc.variables["MPPP_WITH_MPC"] = self.options.with_mpc + tc.variables["MPPP_WITH_QUADMATH"] = self.options.with_quadmath + tc.variables["MPPP_WITH_BOOST_S11N"] = self.options.with_boost + if Version(self.version) >= "0.27": + tc.variables["MPPP_WITH_FMT"] = self.options.with_fmt + if not self.options.shared: + tc.variables["MPPP_BUILD_STATIC_LIBRARY_WITH_DYNAMIC_MSVC_RUNTIME"] = not is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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")) + + def package_info(self): + self.cpp_info.libs = ["mp++"] + self.cpp_info.set_property("cmake_file_name", "mp++") + self.cpp_info.set_property("cmake_target_name", "mp++::mp++") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if self.options.get_safe("with_fmt"): + self.cpp_info.defines.append("MPPP_WITH_FMT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "mp++" + self.cpp_info.filenames["cmake_find_package_multi"] = "mp++" + self.cpp_info.names["cmake_find_package"] = "mp++" + self.cpp_info.names["cmake_find_package_multi"] = "mp++" diff --git a/recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch b/recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch new file mode 100644 index 0000000000000..1f43796c81faa --- /dev/null +++ b/recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake +index 7d7aa1b..aaff75f 100644 +--- a/cmake/yacma/YACMACompilerLinkerSettings.cmake ++++ b/cmake/yacma/YACMACompilerLinkerSettings.cmake +@@ -95,7 +95,7 @@ if(NOT _YACMACompilerLinkerSettingsRun) + # NOTE: enable unconditionally, as it seems like the CMake + # machinery for detecting this fails. Perhaps the source code + # used for checking the flag emits warnings? +- list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror") ++ # list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror") + # New warnings in clang 8. + # NOTE: a few issues with macros here, let's disable for now. + # _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra-semi-stmt) +@@ -180,7 +180,7 @@ if(NOT _YACMACompilerLinkerSettingsRun) + # Enable higher warning level than usual. + _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4) + # Treat warnings as errors. +- _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX) ++ # _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX) + endif() + + # Set the cache variables. diff --git a/recipes/mppp/all/patches/0.27-0001-disable-warning-error.patch b/recipes/mppp/all/patches/0.27-0001-disable-warning-error.patch new file mode 100644 index 0000000000000..8906bc4799f22 --- /dev/null +++ b/recipes/mppp/all/patches/0.27-0001-disable-warning-error.patch @@ -0,0 +1,25 @@ +diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake +index edafe6d..10f40ed 100644 +--- a/cmake/yacma/YACMACompilerLinkerSettings.cmake ++++ b/cmake/yacma/YACMACompilerLinkerSettings.cmake +@@ -91,11 +91,6 @@ if(NOT _YACMACompilerLinkerSettingsRun) + # For now it seems like -Wshadow from clang behaves better than GCC's, just enable it here + # for the time being. + _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshadow) +- # Clang is better at this flag than GCC. +- # NOTE: enable unconditionally, as it seems like the CMake +- # machinery for detecting this fails. Perhaps the source code +- # used for checking the flag emits warnings? +- list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror") + # New warnings in clang 8. + # NOTE: a few issues with macros here, let's disable for now. + # _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra-semi-stmt) +@@ -190,8 +185,6 @@ if(NOT _YACMACompilerLinkerSettingsRun) + if(YACMA_COMPILER_IS_MSVC AND NOT YACMA_COMPILER_IS_CLANGXX) + # Enable higher warning level than usual. + _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4) +- # Treat warnings as errors. +- _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX) + endif() + + # Set the cache variables. diff --git a/recipes/mppp/all/test_package/CMakeLists.txt b/recipes/mppp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..320edf00b9406 --- /dev/null +++ b/recipes/mppp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(mp++ REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mp++::mp++) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mppp/all/test_package/conanfile.py b/recipes/mppp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/mppp/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mppp/all/test_package/test_package.cpp b/recipes/mppp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..316ebf8a4ca8c --- /dev/null +++ b/recipes/mppp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include "mp++/integer.hpp" +#include "mp++/rational.hpp" + +int main() { + auto integer = mppp::integer<2>{4}; + std::cout << integer << std::endl; + + auto rational = mppp::rational<2>{4}; + std::cout << rational << std::endl; + + return 0; +} diff --git a/recipes/mppp/all/test_v1_package/CMakeLists.txt b/recipes/mppp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/mppp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mppp/all/test_v1_package/conanfile.py b/recipes/mppp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mppp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mppp/config.yml b/recipes/mppp/config.yml new file mode 100644 index 0000000000000..d4d8ae20a50d8 --- /dev/null +++ b/recipes/mppp/config.yml @@ -0,0 +1,5 @@ +versions: + "0.27": + folder: all + "0.26": + folder: all diff --git a/recipes/ms-gsl/all/conandata.yml b/recipes/ms-gsl/all/conandata.yml new file mode 100644 index 0000000000000..00aab19c60dba --- /dev/null +++ b/recipes/ms-gsl/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "4.0.0": + url: "https://github.com/microsoft/GSL/archive/v4.0.0.tar.gz" + sha256: "f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9" + "3.1.0": + url: "https://github.com/microsoft/GSL/archive/v3.1.0.tar.gz" + sha256: "d3234d7f94cea4389e3ca70619b82e8fb4c2f33bb3a070799f1e18eef500a083" + "3.0.1": + url: "https://github.com/microsoft/GSL/archive/v3.0.1.tar.gz" + sha256: "7ceba191e046e5347357c6b605f53e6bed069c974aeda851254cb6962a233572" + "2.1.0": + url: https://github.com/microsoft/GSL/archive/v2.1.0.tar.gz + sha256: "ef73814657b073e1be86c8f7353718771bf4149b482b6cb54f99e79b23ff899d" + "2.0.0": + url: https://github.com/microsoft/GSL/archive/v2.0.0.tar.gz + sha256: "6cce6fb16b651e62711a4f58e484931013c33979b795d1b1f7646f640cfa9c8e" diff --git a/recipes/ms-gsl/all/conanfile.py b/recipes/ms-gsl/all/conanfile.py new file mode 100644 index 0000000000000..1f2447a4480af --- /dev/null +++ b/recipes/ms-gsl/all/conanfile.py @@ -0,0 +1,105 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.50.0" + + +class MicrosoftGslConan(ConanFile): + name = "ms-gsl" + description = "Microsoft's implementation of the Guidelines Support Library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/GSL" + license = "MIT" + topics = ("gsl", "guidelines", "core", "span") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + options = { + "on_contract_violation": ["terminate", "throw", "unenforced"] + } + default_options = { + "on_contract_violation": "terminate" + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _contract_map(self): + return { + "terminate": "GSL_TERMINATE_ON_CONTRACT_VIOLATION", + "throw": "GSL_THROW_ON_CONTRACT_VIOLATION", + "unenforced": "GSL_UNENFORCED_ON_CONTRACT_VIOLATION", + } + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "3.4", + } + + def config_options(self): + if Version(self.version) >= "3.0.0": + del self.options.on_contract_violation + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + check_min_vs(self, "190") + + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not fully support.") + else: + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. " + "Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}.") + + 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 generate(self): + pass + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Microsoft.GSL") + self.cpp_info.set_property("cmake_target_name", "Microsoft.GSL::GSL") + + self.cpp_info.filenames["cmake_find_package"] = "Microsoft.GSL" + self.cpp_info.filenames["cmake_find_package_multi"] = "Microsoft.GSL" + self.cpp_info.names["cmake_find_package"] = "Microsoft.GSL" + self.cpp_info.names["cmake_find_package_multi"] = "Microsoft.GSL" + + self.cpp_info.components["_ms-gsl"].names["cmake_find_package"] = "GSL" + self.cpp_info.components["_ms-gsl"].names["cmake_find_package_multi"] = "GSL" + + if Version(self.version) < "3.0.0": + self.cpp_info.components["_ms-gsl"].defines = [ + self._contract_map[str(self.options.on_contract_violation)] + ] diff --git a/recipes/ms-gsl/all/test_package/CMakeLists.txt b/recipes/ms-gsl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..81fc0751a73bb --- /dev/null +++ b/recipes/ms-gsl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Microsoft.GSL REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE Microsoft.GSL::GSL) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/ms-gsl/all/test_package/conanfile.py b/recipes/ms-gsl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..074627225806d --- /dev/null +++ b/recipes/ms-gsl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/ms-gsl/all/test_package/test_package.cpp b/recipes/ms-gsl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5999d447df927 --- /dev/null +++ b/recipes/ms-gsl/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() +{ + std::array data{{1, 2, 3, 4, 5}}; + gsl::span span(data); + if (span.size() != 5) { + return 1; + } + return 0; +} diff --git a/recipes/ms-gsl/all/test_v1_package/CMakeLists.txt b/recipes/ms-gsl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/ms-gsl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ms-gsl/all/test_v1_package/conanfile.py b/recipes/ms-gsl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6314fb1c24e96 --- /dev/null +++ b/recipes/ms-gsl/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ms-gsl/config.yml b/recipes/ms-gsl/config.yml new file mode 100644 index 0000000000000..b00b1020b4e16 --- /dev/null +++ b/recipes/ms-gsl/config.yml @@ -0,0 +1,11 @@ +versions: + "4.0.0": + folder: all + "3.1.0": + folder: all + "3.0.1": + folder: all + "2.1.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/msdf-atlas-gen/all/CMakeLists.txt b/recipes/msdf-atlas-gen/all/CMakeLists.txt new file mode 100644 index 0000000000000..39b22c5320bd6 --- /dev/null +++ b/recipes/msdf-atlas-gen/all/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +find_package(msdfgen REQUIRED) + +add_subdirectory(source_subfolder) + diff --git a/recipes/msdf-atlas-gen/all/conandata.yml b/recipes/msdf-atlas-gen/all/conandata.yml new file mode 100644 index 0000000000000..20e043a17e6cd --- /dev/null +++ b/recipes/msdf-atlas-gen/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.2": + url: "https://github.com/Chlumsky/msdf-atlas-gen/archive/refs/tags/v1.2.2.tar.gz" + sha256: "7D2EA46F66E21AB9A205BF7703D520F209B9A035EE13CBB266A3B8322F62FA28" diff --git a/recipes/msdf-atlas-gen/all/conanfile.py b/recipes/msdf-atlas-gen/all/conanfile.py new file mode 100644 index 0000000000000..a6c7d8b9a0b2a --- /dev/null +++ b/recipes/msdf-atlas-gen/all/conanfile.py @@ -0,0 +1,71 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.33.0" + + +class MsdfAtlasGenConan(ConanFile): + name = "msdf-atlas-gen" + license = "MIT" + homepage = "https://github.com/Chlumsky/msdf-atlas-gen" + url = "https://github.com/conan-io/conan-center-index" + description = "MSDF font atlas generator" + topics = ("msdf-atlas-gen", "msdf", "font", "atlas") + settings = "os", "arch", "compiler", "build_type" + + generators = "cmake", "cmake_find_package_multi" + exports_sources = ["CMakeLists.txt"] + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("artery-font-format/1.0") + self.requires("msdfgen/1.9.1") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def package_id(self): + del self.info.settings.compiler + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination=self._source_subfolder) + + def _patch_sources(self): + cmakelists = os.path.join( + self._source_subfolder, "CMakeLists.txt") + + tools.replace_in_file(cmakelists, + "add_subdirectory(msdfgen)", "") + tools.save_append(cmakelists, + "install(TARGETS msdf-atlas-gen-standalone DESTINATION bin)") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True + self._cmake.configure() + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libdirs = [] + + 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/msdf-atlas-gen/all/test_package/Sacramento-Regular.ttf b/recipes/msdf-atlas-gen/all/test_package/Sacramento-Regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..cfd2eabc8699f40b4af3fcd82425c2e434377cd4 GIT binary patch literal 79696 zcmeFacbFUHwKzQQjC${F)%&Wf%4(%8+TMHhdVBE}_jT{Mf^BTT6x)DJ?={4slR&5e z0^}wkA%)&<3YP>DZgO*Dy!)MZM$&4H10>=8^F6xqkK^fY+L(yq#=t6=(SHoFj6RXG9hDSoT z5d`<=u>EFY^F}M-gHH%Kz!T*3+NG;G{nsW4Li#wIvtjA@hP8y2;KTKg!RNB2tF}!) z%=-|-7ZSwFh0CVKC&`Z=`wPGt;b43j98lKso`Uy1@ZPy>^~S9m#|xf@_kSY@_M0oG z*3a}0Y`%yf-Wel^uwvDkiSZ9tX+I~3H`l_~f4X{n>ssnEY69T5!ui&j@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!%l~{-()DSBPg#t9Ye{v$wN8jX*?y`9~woeyJ<8v;HE0-BTppv z|DcZ4)BXpjbdKyjPjcYx0ON5UAIILO!)Nu=(p!7+W3?>-4x)saDMFzb;DqIH^-k`4uf1}g4c?ch5Ki5OgnuM=rOHf|k>u@o_M{n`u#0oo!>wJN z^RLeNSIcl4Z@G-hJ*_r(sRzGP$Gzgwcn=<4%(R}GE2myHEn;ob%sYkuJvwbf%u)85 zv&U_zc<9H9ebb!rB;l&<6=CpGw4DBUM@`*(;K!}j)RrU`KUb{b^>324brlm0Z(@Ia HgfagCjBv*~ literal 0 HcmV?d00001 diff --git a/recipes/msdf-atlas-gen/all/test_package/conanfile.py b/recipes/msdf-atlas-gen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0e314c3e127bb --- /dev/null +++ b/recipes/msdf-atlas-gen/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _atlas_texture_file(self): + return os.path.join(self.build_folder, "atlas_texture.png") + + @property + def _atlas_desc_file(self): + return os.path.join(self.build_folder, "atlas_desc.json") + + def test(self): + if not tools.cross_building(self): + ttf_path = os.path.join( + self.source_folder, "Sacramento-Regular.ttf") + charset_path = os.path.join( + self.source_folder, "uppercase_charset") + + ret_code = self.run( + "msdf-atlas-gen -font {} -charset {} -imageout {} -json {}".format(ttf_path, charset_path, self._atlas_texture_file, self._atlas_desc_file), run_environment=True) + + assert ret_code == 0 + assert os.path.isfile(self._atlas_texture_file) + assert os.path.isfile(self._atlas_desc_file) diff --git a/recipes/msdf-atlas-gen/all/test_package/uppercase_charset b/recipes/msdf-atlas-gen/all/test_package/uppercase_charset new file mode 100644 index 0000000000000..c3c76b7e894ab --- /dev/null +++ b/recipes/msdf-atlas-gen/all/test_package/uppercase_charset @@ -0,0 +1 @@ +['A', 'Z'] diff --git a/recipes/msdf-atlas-gen/config.yml b/recipes/msdf-atlas-gen/config.yml new file mode 100644 index 0000000000000..af40d9653a378 --- /dev/null +++ b/recipes/msdf-atlas-gen/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.2": + folder: all diff --git a/recipes/msdfgen/all/conandata.yml b/recipes/msdfgen/all/conandata.yml new file mode 100644 index 0000000000000..2d80e884e7bf9 --- /dev/null +++ b/recipes/msdfgen/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.10": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.10.tar.gz" + sha256: "2754d1687bfb80968d9c682e0c4c04c8fcf72df1421d076baf44ea0d87aa3662" + "1.9.1": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.9.1.tar.gz" + sha256: "0d2cf3113eea97776731888c711ff836b2be7ff35966a2aa86f3dc57103d0740" + "1.9": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.9.tar.gz" + sha256: "909eb88c71268dc00cdda244a1fa40a0feefae45f68a779fbfddd5463559fa40" +patches: + "1.10": + - patch_file: "patches/1.10-0001-fix-cmake.patch" + patch_description: "move project position to top" + patch_type: "conan" + "1.9.1": + - patch_file: "patches/1.9-0001-unvendor-external-libs.patch" + patch_description: "Use external libs from conan instead of vendored ones" + patch_type: "conan" + "1.9": + - patch_file: "patches/1.9-0001-unvendor-external-libs.patch" + patch_description: "Use external libs from conan instead of vendored ones" + patch_type: "conan" + - patch_file: "patches/1.9-0002-fix-install-bundle.patch" + patch_description: "Fix installation in iOS/tvOS/watchOS" + patch_type: "portability" + patch_source: "https://github.com/Chlumsky/msdfgen/pull/125" diff --git a/recipes/msdfgen/all/conanfile.py b/recipes/msdfgen/all/conanfile.py new file mode 100644 index 0000000000000..03f96bc253715 --- /dev/null +++ b/recipes/msdfgen/all/conanfile.py @@ -0,0 +1,173 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, 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" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openmp": [True, False], + "with_skia": [True, False], + "utility": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": False, + "with_skia": False, + "utility": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("freetype/2.12.1") + if Version(self.version) < "1.10": + self.requires("lodepng/cci.20200615") + else: + self.requires("libpng/1.6.39") + self.requires("tinyxml2/9.0.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + if self.options.with_skia: + 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) + + 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 + if Version(self.version) >= "1.10": + tc.variables["MSDFGEN_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) + tc.variables["MSDFGEN_USE_VCPKG"] = False + 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": + replace_in_file( + self, + cmakelists, + "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() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "msdfgen") + # Required to avoid some side effect in CMakeDeps generator of downstream recipes + self.cpp_info.set_property("cmake_target_name", "msdfgen::msdgen-all-unofficial") + + self.cpp_info.names["cmake_find_package"] = "msdfgen" + self.cpp_info.names["cmake_find_package_multi"] = "msdfgen" + + includedir = os.path.join("include", "msdfgen") + + self.cpp_info.components["_msdfgen"].set_property("cmake_target_name", "msdfgen::msdfgen") + self.cpp_info.components["_msdfgen"].names["cmake_find_package"] = "msdfgen" + self.cpp_info.components["_msdfgen"].names["cmake_find_package_multi"] = "msdfgen" + self.cpp_info.components["_msdfgen"].includedirs.append(includedir) + self.cpp_info.components["_msdfgen"].libs = ["msdfgen" if Version(self.version) < "1.10" else "msdfgen-core"] + self.cpp_info.components["_msdfgen"].defines = ["MSDFGEN_USE_CPP11"] + if Version(self.version) >= "1.10": + if self.options.shared and is_msvc(self): + self.cpp_info.components["_msdfgen"].defines.append("MSDFGEN_PUBLIC=__declspec(dllimport)") + else: + self.cpp_info.components["_msdfgen"].defines.append("MSDFGEN_PUBLIC=") + + self.cpp_info.components["msdfgen-ext"].set_property("cmake_target_name", "msdfgen::msdfgen-ext") + self.cpp_info.components["msdfgen-ext"].names["cmake_find_package"] = "msdfgen-ext" + self.cpp_info.components["msdfgen-ext"].names["cmake_find_package_multi"] = "msdfgen-ext" + self.cpp_info.components["msdfgen-ext"].includedirs.append(includedir) + self.cpp_info.components["msdfgen-ext"].libs = ["msdfgen-ext"] + self.cpp_info.components["msdfgen-ext"].requires = [ + "_msdfgen", "freetype::freetype", + "lodepng::lodepng" if Version(self.version) < "1.10" else "libpng::libpng", + "tinyxml2::tinyxml2", + ] + + if self.options.with_skia: + self.cpp_info.components["msdfgen-ext"].defines.append("MSDFGEN_USE_SKIA") + + 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) diff --git a/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch b/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch new file mode 100644 index 0000000000000..50b04c4c1e5d9 --- /dev/null +++ b/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch @@ -0,0 +1,24 @@ +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.9-0001-unvendor-external-libs.patch b/recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch new file mode 100644 index 0000000000000..825ea34d6cfdf --- /dev/null +++ b/recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch @@ -0,0 +1,29 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,8 +39,6 @@ file(GLOB_RECURSE msdfgen-ext_PRIVATE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DI + + file(GLOB_RECURSE msdfgen-ext_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "ext/*.cpp" +- "lib/*.cpp" +- "lib/*.cpp" + ) + + # Build the library (aliased name because it's the same target name the exe) +@@ -86,14 +84,14 @@ add_library(msdfgen::msdfgen-ext ALIAS msdfgen-ext) + set_target_properties(msdfgen-ext PROPERTIES + PUBLIC_HEADER "${msdfgen-ext_PUBLIC_HEADERS}" + ) +-target_link_libraries(msdfgen-ext PUBLIC msdfgen::msdfgen Freetype::Freetype) ++find_package(lodepng REQUIRED CONFIG) ++find_package(tinyxml2 REQUIRED CONFIG) ++target_link_libraries(msdfgen-ext PUBLIC msdfgen::msdfgen Freetype::Freetype lodepng::lodepng tinyxml2::tinyxml2) + target_include_directories(msdfgen-ext + PUBLIC + $ + $ + +-PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/include + ) + + target_compile_definitions(msdfgen-ext PUBLIC MSDFGEN_CMAKE_BUILD) diff --git a/recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch b/recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch new file mode 100644 index 0000000000000..70618310fd767 --- /dev/null +++ b/recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -168,7 +168,7 @@ if(MSDFGEN_INSTALL) + ) + + if(MSDFGEN_BUILD_MSDFGEN_STANDALONE) +- install(TARGETS msdfgen-standalone EXPORT msdfgenTargets RUNTIME DESTINATION bin) ++ install(TARGETS msdfgen-standalone EXPORT msdfgenTargets DESTINATION bin) + endif() + + install( diff --git a/recipes/msdfgen/all/test_package/CMakeLists.txt b/recipes/msdfgen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6016e8cfe3244 --- /dev/null +++ b/recipes/msdfgen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(msdfgen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE msdfgen::msdfgen msdfgen::msdfgen-ext) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf b/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd79d43bea0293ac1b20e8aca1142627983d2c07 GIT binary patch literal 224592 zcmbTe349bq+CN^^*W8&qlRGn+9E1>Zk;HIi2qAQM&s|SFJ%kcM ztoRa0YJNqpo==B7){*c7z97W@SkL?(1tgw-mGBjZ&?~BEY2ON6wlN#$xK1AGSq zD5=XEgs-#_!XNKjk&?b;$_pWc&;z($J8bNb35hSKj3UIe4+De^oBEj3njH2FA(1*xUL`h==2ehvp%>%NZf8hd%rho_>j8a zE}aO%^E=~u)+jUtC2GrY{us_ zl92eM36q9Tcwf`}2q6&+zFUOhj)t!5_)^Ym4;wrGN;GOT5OOllv016VFM8pQzGbI& zxq3PJY6!<#@xguS)^auAJm@t4J5F5ciajAhZ>sOh+m47dPrUltPqjf1StrvwLw~6)2dGq)H|u z#QC5|Ejb{Dl4;@JZPe3A3a+ga zmJ=drO#Jn3}ACeJ4qc6{t&MC z?*Z;vn?PD`^J4)kp2Mq23Q8w77qJkqbs-ZOzUj8sCbU=c;UtIMuhNtD{xT4_@1o$H z;rtVF#4^kFTg{S_cX1vb$3N=A30MGwsa|W(+QU8Ei zh5A)S1K=UaUvCzVk~}S6bvgMU~%$87_zLY|bd|5$e- z(%oyIF~cdN>;1LrB$=i1*Vg9;8fLt=!_|qCP%jAa1?)|kQ$DrT;Yt7_c zkvS&spl?9#nd~w7zrTh|Z3d4X3-AErdB%5vx!r}ei5wJ^Lc>vi#dLwNiB{4bkn1LL zM%YI-;QXAhi5wK?x4zHhPSmz;lwN7wD1@SJY&|YTwl0#2T95O2ttS;(gRT?mf$x0C zCF2>u#%RyRW;A8=Q}mZ#&jHSIc1^sAcF2zKHgqj;#pWkn0^XtHR2&&A6+y>9E)^L| z2EHef5=K)VMNA|OBHBQc&B9W`DYAm=d^6f`UAPWC!D_}cS73QqzoSHA*A+SXfrO&Z zbftd|+Db?wd#2PM$A??@h89^Yhz=TkV16>>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cV2q--ffxBzFdAxvvoq-q3`jk!R^h($ literal 0 HcmV?d00001 diff --git a/recipes/msdfgen/all/test_package/conanfile.py b/recipes/msdfgen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c4fdfb4dbdc98 --- /dev/null +++ b/recipes/msdfgen/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") + self.run(f"{bin_path} {ttf_path}", env="conanrun") diff --git a/recipes/msdfgen/all/test_package/test_package.cpp b/recipes/msdfgen/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d169064c206c2 --- /dev/null +++ b/recipes/msdfgen/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include + +#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); + } + return 0; +} diff --git a/recipes/msdfgen/all/test_v1_package/CMakeLists.txt b/recipes/msdfgen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/msdfgen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/msdfgen/all/test_v1_package/conanfile.py b/recipes/msdfgen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7b775db727c08 --- /dev/null +++ b/recipes/msdfgen/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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) diff --git a/recipes/msdfgen/config.yml b/recipes/msdfgen/config.yml new file mode 100644 index 0000000000000..9f326bdd6e1a4 --- /dev/null +++ b/recipes/msdfgen/config.yml @@ -0,0 +1,7 @@ +versions: + "1.10": + folder: all + "1.9.1": + folder: all + "1.9": + folder: all diff --git a/recipes/msgpack-c/all/conandata.yml b/recipes/msgpack-c/all/conandata.yml new file mode 100644 index 0000000000000..dc158b2bf02e6 --- /dev/null +++ b/recipes/msgpack-c/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "6.0.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz" + sha256: "3654f5e2c652dc52e0a993e270bb57d5702b262703f03771c152bba51602aeba" + "5.0.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/c-5.0.0/msgpack-c-5.0.0.tar.gz" + sha256: "eb6d77f32dbaaae9174d96cacfe02af30bf1ea329c45018074cd95ac6e6fa6e5" + "4.0.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/c-4.0.0/msgpack-c-4.0.0.tar.gz" + sha256: "420fe35e7572f2a168d17e660ef981a589c9cbe77faa25eb34a520e1fcc032c8" diff --git a/recipes/msgpack-c/all/conanfile.py b/recipes/msgpack-c/all/conanfile.py new file mode 100644 index 0000000000000..eac066163d085 --- /dev/null +++ b/recipes/msgpack-c/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir, save +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + +class MsgpackCConan(ConanFile): + name = "msgpack-c" + description = "MessagePack implementation for C" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/msgpack/msgpack-c" + topics = ("msgpack", "message-pack", "serialization") + package_type = "library" + settings = "os", "arch", "build_type", "compiler" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MSGPACK_ENABLE_SHARED"] = self.options.shared + tc.variables["MSGPACK_ENABLE_STATIC"] = not self.options.shared + tc.variables["MSGPACK_32BIT"] = self.settings.arch == "x86" + tc.variables["MSGPACK_BUILD_EXAMPLES"] = False + tc.cache_variables["MSGPACK_BUILD_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE_1_0.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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"msgpackc": "msgpack::msgpack"} + ) + + 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_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", "msgpack") + self.cpp_info.set_property("pkg_config_name", "msgpack") + if Version(self.version) < "6.0.0": + self.cpp_info.libs = ["msgpackc"] + self.cpp_info.set_property("cmake_target_name", "msgpackc") + else: + self.cpp_info.libs = ["msgpack-c"] + self.cpp_info.set_property("cmake_target_name", "msgpack-c") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "msgpack" + self.cpp_info.names["cmake_find_package_multi"] = "msgpack" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "msgpack" diff --git a/recipes/msgpack-c/all/test_package/CMakeLists.txt b/recipes/msgpack-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8fda341f88c80 --- /dev/null +++ b/recipes/msgpack-c/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(msgpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET msgpackc) + target_link_libraries(${PROJECT_NAME} PRIVATE msgpackc) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE msgpack-c) +endif() diff --git a/recipes/msgpack-c/all/test_package/conanfile.py b/recipes/msgpack-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/msgpack-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/msgpack-c/all/test_package/test_package.c b/recipes/msgpack-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..17422b5a0a3d2 --- /dev/null +++ b/recipes/msgpack-c/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + printf("msgpack version %s\n", msgpack_version()); + return 0; +} diff --git a/recipes/msgpack-c/all/test_v1_package/CMakeLists.txt b/recipes/msgpack-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..961b416af6b07 --- /dev/null +++ b/recipes/msgpack-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/msgpack-c/all/test_v1_package/conanfile.py b/recipes/msgpack-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/msgpack-c/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/msgpack-c/config.yml b/recipes/msgpack-c/config.yml new file mode 100644 index 0000000000000..c43afaf0f726a --- /dev/null +++ b/recipes/msgpack-c/config.yml @@ -0,0 +1,7 @@ +versions: + "6.0.0": + folder: all + "5.0.0": + folder: all + "4.0.0": + folder: all diff --git a/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml new file mode 100644 index 0000000000000..64a5e6f43e3e6 --- /dev/null +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "6.0.0": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-6.0.0.tar.gz" + sha256: "d02f7ffd28b1d38ab9f5f758c4744fadfae92150461fb8154c98ac49226cff90" + "5.0.0": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-5.0.0.tar.gz" + sha256: "bd6b8e255f0a62cf8f50f1d292f979ac8ea9a4aa121938679d6f419d6df70ea3" + "4.1.3": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.3.tar.gz" + sha256: "fd0a685656f11b8aa09ed33bcbdcad3105d25d0034ca3dba9fe957623a42d253" + "4.1.2": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.2.tar.gz" + sha256: "7460ad43552c9d9b56a75f20e1f4fedf18fff1c48715d6cfa91d779b26ca3795" + "4.1.1": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.1.tar.gz" + sha256: "221cc539e77f5ca02f4f0bbb1edafa9ca8c08de7ba8072d7baf2139930d99182" + "4.1.0": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.0.tar.gz" + sha256: "634762502a192026bd5db773f9e18d900ad04cfc312b52faee350a5c76e5ccfb" + "4.0.3": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.0.3.tar.gz" + sha256: "23d737b1e959dfb6ca420564563f098e758adacc0b18003c56abf1b945bd1d4a" diff --git a/recipes/msgpack-cxx/all/conanfile.py b/recipes/msgpack-cxx/all/conanfile.py new file mode 100644 index 0000000000000..2bcaa82b381e6 --- /dev/null +++ b/recipes/msgpack-cxx/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.tools.files import get, copy, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + +class MsgpackCXXConan(ConanFile): + name = "msgpack-cxx" + description = "The official C++ library for MessagePack" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/msgpack/msgpack-c" + topics = ("msgpack", "message-pack", "serialization", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "use_boost": [True, False], + } + default_options = { + "use_boost": True, + } + no_copy_source = True + + def configure_options(self): + # No boost was added since 4.1.0 + if Version(self.version) < "4.1.0": + del self.options.use_boost + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("use_boost", True): + self.requires("boost/1.81.0") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=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"), + ) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"msgpackc-cxx": "msgpackc-cxx::msgpackc-cxx"} + ) + + 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("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "msgpack") + self.cpp_info.set_property("cmake_target_name", "msgpackc-cxx") + + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + + if Version(self.version) >= "4.1.0" and not self.options.use_boost: + self.cpp_info.defines.append("MSGPACK_NO_BOOST") + else: + self.cpp_info.requires.append("boost::headers") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "msgpack" + self.cpp_info.filenames["cmake_find_package_multi"] = "msgpack" + self.cpp_info.names["cmake_find_package"] = "msgpackc-cxx" + self.cpp_info.names["cmake_find_package_multi"] = "msgpackc-cxx" + 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/msgpack-cxx/all/test_package/CMakeLists.txt b/recipes/msgpack-cxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed380c765040e --- /dev/null +++ b/recipes/msgpack-cxx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(msgpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} msgpackc-cxx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/msgpack-cxx/all/test_package/conanfile.py b/recipes/msgpack-cxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/msgpack-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 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/msgpack-cxx/all/test_package/test_package.cpp b/recipes/msgpack-cxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..291dd422b88be --- /dev/null +++ b/recipes/msgpack-cxx/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include + +int main() { + msgpack::object obj(123); + std::cout << obj << "\n"; + return 0; +} diff --git a/recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt b/recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/msgpack-cxx/all/test_v1_package/conanfile.py b/recipes/msgpack-cxx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/msgpack-cxx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml new file mode 100644 index 0000000000000..1c632d41b23dd --- /dev/null +++ b/recipes/msgpack-cxx/config.yml @@ -0,0 +1,15 @@ +versions: + "6.0.0": + folder: all + "5.0.0": + folder: all + "4.1.3": + folder: all + "4.1.2": + folder: all + "4.1.1": + folder: all + "4.1.0": + folder: all + "4.0.3": + folder: all diff --git a/recipes/msgpack/all/CMakeLists.txt b/recipes/msgpack/all/CMakeLists.txt new file mode 100644 index 0000000000000..11573c481bf89 --- /dev/null +++ b/recipes/msgpack/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/msgpack/all/conandata.yml b/recipes/msgpack/all/conandata.yml new file mode 100644 index 0000000000000..faaacd5f1a742 --- /dev/null +++ b/recipes/msgpack/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.2.1": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-3.2.1.tar.gz" + sha256: "464f46744a6be778626d11452c4db3c2d09461080c6db42e358e21af19d542f6" + "3.3.0": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-3.3.0.tar.gz" + sha256: "754c3ace499a63e45b77ef4bcab4ee602c2c414f58403bce826b76ffc2f77d0b" diff --git a/recipes/msgpack/all/conanfile.py b/recipes/msgpack/all/conanfile.py new file mode 100644 index 0000000000000..c99fb76c55aa2 --- /dev/null +++ b/recipes/msgpack/all/conanfile.py @@ -0,0 +1,135 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class MsgpackConan(ConanFile): + name = "msgpack" + description = "The official C++ library for MessagePack" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/msgpack/msgpack-c" + topics = ("conan", "msgpack", "message-pack", "serialization") + license = "BSL-1.0" + exports_sources = "CMakeLists.txt" + generators = "cmake" + settings = "os", "arch", "build_type", "compiler" + options = { + "fPIC": [True, False], + "shared": [True, False], + "c_api": [True, False], + "cpp_api": [True, False], + "with_boost": [True, False], + "header_only": [True, False] + } + default_options = { + "fPIC": True, + "shared": False, + "c_api": True, + "cpp_api": True, + "with_boost": False, + "header_only": False + } + deprecated = "msgpack-c or msgpack-cxx" + + _cmake = None + + @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): + # Deprecate header_only option + if self.options.header_only: + self.options.c_api = False + self.options.cpp_api = True + self.output.warn("header_only option is deprecated, prefer c_api=False and cpp_api=True") + del self.options.header_only + + if not self.options.c_api and not self.options.cpp_api: + raise ConanInvalidConfiguration("You must enable at least c_api or cpp_api.") + if self.options.c_api: + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + else: + del self.options.shared + del self.options.fPIC + if not self.options.cpp_api: + del self.options.with_boost + if self.options.get_safe("with_boost"): + self.options["boost"].header_only = False + self.options["boost"].without_chrono = False + self.options["boost"].without_context = False + self.options["boost"].without_system = False + self.options["boost"].without_timer = False + + def requirements(self): + if self.options.get_safe("with_boost"): + self.requires("boost/1.74.0") + + def package_id(self): + del self.info.options.with_boost + if not self.options.c_api: + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "msgpack-c-cpp-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["MSGPACK_ENABLE_SHARED"] = self.options.shared + self._cmake.definitions["MSGPACK_ENABLE_STATIC"] = not self.options.shared + self._cmake.definitions["MSGPACK_ENABLE_CXX"] = self.options.cpp_api + self._cmake.definitions["MSGPACK_BOOST"] = self.options.get_safe("with_boost", False) + self._cmake.definitions["MSGPACK_32BIT"] = self.settings.arch == "x86" + self._cmake.definitions["MSGPACK_BUILD_EXAMPLES"] = False + self._cmake.definitions["MSGPACK_BUILD_TESTS"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + if self.options.get_safe("with_boost") and \ + (self.options["boost"].header_only or self.options["boost"].without_chrono or \ + self.options["boost"].without_context or self.options["boost"].without_system or \ + self.options["boost"].without_timer): + raise ConanInvalidConfiguration("msgpack with boost requires the following boost components: chrono, context, system and timer.") + if self.options.c_api: + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) + if self.options.c_api: + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + else: + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + + def package_info(self): + # TODO: CMake imported targets shouldn't be namespaced (waiting implementation of https://github.com/conan-io/conan/issues/7615) + if self.options.c_api: + self.cpp_info.components["msgpackc"].names["cmake_find_package"] = "msgpackc" + self.cpp_info.components["msgpackc"].names["cmake_find_package_multi"] = "msgpackc" + self.cpp_info.components["msgpackc"].libs = tools.collect_libs(self) + if self.options.cpp_api: + self.cpp_info.components["msgpackc-cxx"].names["cmake_find_package"] = "msgpackc-cxx" + self.cpp_info.components["msgpackc-cxx"].names["cmake_find_package_multi"] = "msgpackc-cxx" + if self.options.with_boost: + self.cpp_info.components["msgpackc-cxx"].defines = ["MSGPACK_USE_BOOST"] + self.cpp_info.components["msgpackc-cxx"].requires = ["boost::boost"] diff --git a/recipes/msgpack/all/test_package/CMakeLists.txt b/recipes/msgpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b194f0596222 --- /dev/null +++ b/recipes/msgpack/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(msgpack REQUIRED CONFIG) + +# TODO: remove msgpack:: namespace when fixed in cpp_info of recipe +if(MSGPACK_C_API) + add_executable(${PROJECT_NAME}_c test_package.c) + target_link_libraries(${PROJECT_NAME}_c msgpack::msgpackc) +endif() +if(MSGPACK_CPP_API) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp msgpack::msgpackc-cxx) + set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) +endif() diff --git a/recipes/msgpack/all/test_package/conanfile.py b/recipes/msgpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c3432553ca5d0 --- /dev/null +++ b/recipes/msgpack/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +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.definitions["MSGPACK_C_API"] = self.options["msgpack"].c_api + cmake.definitions["MSGPACK_CPP_API"] = self.options["msgpack"].cpp_api + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + if self.options["msgpack"].c_api: + bin_c_path = os.path.join("bin", "test_package_c") + self.run(bin_c_path, run_environment=True) + if self.options["msgpack"].cpp_api: + bin_cpp_path = os.path.join("bin", "test_package_cpp") + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/msgpack/all/test_package/test_package.c b/recipes/msgpack/all/test_package/test_package.c new file mode 100644 index 0000000000000..17422b5a0a3d2 --- /dev/null +++ b/recipes/msgpack/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + printf("msgpack version %s\n", msgpack_version()); + return 0; +} diff --git a/recipes/msgpack/all/test_package/test_package.cpp b/recipes/msgpack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..291dd422b88be --- /dev/null +++ b/recipes/msgpack/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include + +int main() { + msgpack::object obj(123); + std::cout << obj << "\n"; + return 0; +} diff --git a/recipes/msgpack/config.yml b/recipes/msgpack/config.yml new file mode 100644 index 0000000000000..5d0be2319bc1b --- /dev/null +++ b/recipes/msgpack/config.yml @@ -0,0 +1,5 @@ +versions: + "3.2.1": + folder: all + "3.3.0": + folder: all diff --git a/recipes/msix/all/CMakeLists.txt b/recipes/msix/all/CMakeLists.txt new file mode 100644 index 0000000000000..c477e0c1e565e --- /dev/null +++ b/recipes/msix/all/CMakeLists.txt @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000..ef22231170ffe --- /dev/null +++ b/recipes/msix/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.7": + url: "https://github.com/microsoft/msix-packaging/archive/refs/tags/v1.7.zip" + 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" diff --git a/recipes/msix/all/conanfile.py b/recipes/msix/all/conanfile.py new file mode 100644 index 0000000000000..0c62a718f8c29 --- /dev/null +++ b/recipes/msix/all/conanfile.py @@ -0,0 +1,157 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.33.0" + + +class MsixConan(ConanFile): + name = "msix" + 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") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "crypto_lib": ["crypt32", "openssl"], + "pack": [True, False], + "skip_bundles": [True, False], + "use_external_zlib": [True, False], + "use_validation_parser": [True, False], + "xml_parser": ["applexml", "javaxml", "msxml6", "xerces"] + } + default_options = { + "shared": False, + "fPIC": True, + "crypto_lib": "openssl", + "pack": False, + "skip_bundles": False, + "use_external_zlib": True, + "use_validation_parser": False, + "xml_parser": "msxml6" + } + + generators = "cmake" + exports_sources = "CMakeLists.txt", "patches/**" + + _cmake = None + + @property + def _minimum_compilers_version(self): + return { + "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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.crypto_lib = "crypt32" + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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.options.use_external_zlib: + self.requires("zlib/1.2.12") + if self.options.xml_parser == "xerces": + self.requires("xerces-c/3.2.3") + + 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.options.pack: + if self.settings.os == "Macos": + if not self.options.use_external_zlib: + raise ConanInvalidConfiguration("Using libCompression APIs and packaging features is not supported") + if self.options.xml_parser != "xerces": + 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") + + self._validate_compiler_settings() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = tools.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": + self.cpp_info.system_libs.append("msxml6") diff --git a/recipes/msix/all/patches/1.7/cmake.patch b/recipes/msix/all/patches/1.7/cmake.patch new file mode 100644 index 0000000000000..b64f3d1cd79c0 --- /dev/null +++ b/recipes/msix/all/patches/1.7/cmake.patch @@ -0,0 +1,233 @@ + CMakeLists.txt | 18 +++++++----- + src/CMakeLists.txt | 1 - + src/makemsix/CMakeLists.txt | 3 ++ + src/msix/CMakeLists.txt | 67 ++++++++++++++++----------------------------- + 4 files changed, 37 insertions(+), 52 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dc5908cd..b2e857a5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,11 +21,13 @@ if(POLICY CMP0077) + cmake_policy(SET CMP0077 NEW) + endif() + ++if(CALCULATE_VERSION) + # Default version is 0.0.0 + set(VERSION_MAJOR "0") + set(VERSION_MINOR "0") + set(VERSION_PATCH "0") + set(GIT_BRANCH_NAME "master") ++endif() + + # CMake useful variables + set(MSIX_PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) +@@ -35,6 +37,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") + ++if(CALCULATE_VERSION) + ## Git (and its revision) + find_package(Git) # QUIET) # if we don't find git or FindGit.cmake is not on the system we ignore it. + +@@ -77,15 +80,22 @@ if(GIT_FOUND) + else() + message("git not found.") + endif() ++endif() + ++if(CALCULATE_VERSION) + # Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0) + set(MSIX_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + message(STATUS "MSIX Packaging SDK version ${MSIX_VERSION}") + message(STATUS "MSIX Packaging SDK branch name ${GIT_BRANCH_NAME}") + add_definitions(-DSDK_VERSION="${MSIX_VERSION}") ++else() ++message(STATUS "MSIX Packaging SDK version ${PROJECT_VERSION}") ++add_definitions(-DSDK_VERSION="${PROJECT_VERSION}") ++endif() + # Validates CMake options. + include(msix_options) + ++if(ENABLE_NUGET_PACKAGING) + # Configure Package.nuspec + if(WIN32) + set(MSIX_NUGET_NAME "Microsoft.MSIX.Packaging.Windows") +@@ -103,6 +113,7 @@ configure_file(${MSIX_PROJECT_ROOT}/Package.nuspec.cmakein ${MSIX_BINARY_ROOT}/P + configure_file(${MSIX_PROJECT_ROOT}/Microsoft.MSIX.Packaging.targets ${MSIX_BINARY_ROOT}/build/native/${MSIX_NUGET_NAME}.targets) + message(STATUS "Package.Nuspec created") + message(STATUS "--------------------------------") ++endif() + + # Configure license txt + configure_file(${MSIX_PROJECT_ROOT}/LICENSE ${MSIX_BINARY_ROOT}/build/LICENSE) +@@ -170,9 +181,6 @@ if((MACOS) OR (IOS)) + message(FATAL_ERROR "Unsupported iOS version: ${IOS_DEPLOYMENT_TARGET}, this project requires at least iOS version 10.0") + endif() + endif() +-elseif(AOSP OR LINUX) +- # Static libraries must be position independent to be linked with a shared object. +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + + # Mac needed variables +@@ -183,10 +191,6 @@ set(CMAKE_MACOSX_RPATH ON) + #set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + #set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +-add_subdirectory(lib) +-message(STATUS "libs processed") + add_subdirectory(src) + message(STATUS "src processed") +-add_subdirectory(sample) +-message(STATUS "sample processed") + message(STATUS "DONE!") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a2655a7b..5d224b64 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -6,4 +6,3 @@ cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) + + add_subdirectory(msix) + add_subdirectory(makemsix) +-add_subdirectory(test) +diff --git a/src/makemsix/CMakeLists.txt b/src/makemsix/CMakeLists.txt +index 92b082e6..ebae9789 100644 +--- a/src/makemsix/CMakeLists.txt ++++ b/src/makemsix/CMakeLists.txt +@@ -24,3 +24,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${MSIX_BINARY_ROOT}/src/msix) + + add_dependencies(${PROJECT_NAME} msix) + target_link_libraries(${PROJECT_NAME} msix) ++ ++# 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) + + 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) + 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) + 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) + PAL/Signature/Win32/SignatureValidator.cpp + ) + elseif(CRYPTO_LIB MATCHES openssl) +- if(OpenSSL_FOUND) +- list(APPEND MsixSrc +- PAL/Crypto/OpenSSL/Crypto.cpp +- PAL/Signature/OpenSSL/SignatureValidator.cpp +- ) ++ 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) ++ elseif(NOT MSVC) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl -Wl,--gc-sections) + else() +- # ... and were done here... :/ +- message(FATAL_ERROR "OpenSSL NOT FOUND!") ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl) + endif() + endif() + +@@ -220,14 +227,7 @@ foreach(FILE ${MsixSrc}) + message(STATUS "\t${FILE}") + endforeach() + +-# Define the library +-add_library(${PROJECT_NAME} SHARED +- msix.cpp +- ${MsixSrc} +-) +- +-# Adding dependency to the third party libs directory +-add_dependencies(${PROJECT_NAME} LIBS) ++target_sources(${PROJECT_NAME} PRIVATE ${MsixSrc}) + + # Copy out public headers to /src/unpack + configure_file(../inc/MSIXWindows.hpp ${CMAKE_CURRENT_BINARY_DIR}/MSIXWindows.hpp ) +@@ -260,7 +260,7 @@ if(WIN32) + "/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") +- set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /DEF:windowsexports.def") ++ set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /DEF:${CMAKE_CURRENT_BINARY_DIR}/windowsexports.def") + 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) + target_link_libraries(${PROJECT_NAME} PRIVATE -lz) +-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") +- 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") +- target_link_libraries(${PROJECT_NAME} PRIVATE zlibstatic) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::zlib) + endif() + 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 +- ) +- target_link_libraries(${PROJECT_NAME} PRIVATE xerces-c) ++ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::xerces-c) + endif() + + if(XML_PARSER MATCHES applexml) +@@ -363,18 +354,6 @@ endif() + 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}) +- if((IOS) OR (MACOS)) +- target_link_libraries(${PROJECT_NAME} PRIVATE crypto -Wl,-dead_strip) +- elseif(NOT MSVC) +- target_link_libraries(${PROJECT_NAME} PRIVATE crypto -Wl,--gc-sections) +- else() +- 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 new file mode 100644 index 0000000000000..bc8cdf9e699db --- /dev/null +++ b/recipes/msix/all/patches/1.7/signaturevalidator.patch @@ -0,0 +1,39 @@ +diff --git a/src/msix/PAL/Signature/OpenSSL/SignatureValidator.cpp b/src/msix/PAL/Signature/OpenSSL/SignatureValidator.cpp +index 1cc34b20..ccbf68dc 100644 +--- a/src/msix/PAL/Signature/OpenSSL/SignatureValidator.cpp ++++ b/src/msix/PAL/Signature/OpenSSL/SignatureValidator.cpp +@@ -94,11 +94,10 @@ namespace MSIX + STACK_OF(X509) *certStack = p7.get()->d.sign->cert; + for (int i = 0; i < sk_X509_num(certStack); i++) + { +- X509* cert = sk_X509_value(certStack, i); +- STACK_OF(X509_EXTENSION) *exts = cert->cert_info->extensions; +- for (int i = 0; i < sk_X509_EXTENSION_num(exts); i++) ++ X509* cert = sk_X509_value(certStack, i); ++ for (int i = 0; i < X509_get_ext_count(cert); i++) + { +- X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i); ++ X509_EXTENSION *ext = X509_get_ext(cert, i); + if (ext) + { + if (X509_EXTENSION_get_object(ext)) +@@ -106,7 +105,7 @@ namespace MSIX + unique_BIO extbio(BIO_new(BIO_s_mem())); + 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)); + } + // null terminate the string. + BIO_write(extbio.get(), "", 1); +@@ -207,8 +206,8 @@ namespace MSIX + // If we encounter an expired cert error (which is fine) or a critical extension (most MS + // certs contain MS-specific extensions that OpenSSL doesn't know how to evaluate), + // just return success +- if (!ok && (ctx->error == X509_V_ERR_CERT_HAS_EXPIRED || +- ctx->error == X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION)) ++ if (!ok && (X509_STORE_CTX_get_error(ctx) == X509_V_ERR_CERT_HAS_EXPIRED || ++ X509_STORE_CTX_get_error(ctx) == X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION)) + { + ok = static_cast(true); + } diff --git a/recipes/msix/all/test_package/CMakeLists.txt b/recipes/msix/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e28b2e2b66dd9 --- /dev/null +++ b/recipes/msix/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} example.cpp) + +conan_target_link_libraries(${PROJECT_NAME}) diff --git a/recipes/msix/all/test_package/conanfile.py b/recipes/msix/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bee328a3e1aa7 --- /dev/null +++ b/recipes/msix/all/test_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" + + 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/msix/all/test_package/example.cpp b/recipes/msix/all/test_package/example.cpp new file mode 100644 index 0000000000000..292160c8862d6 --- /dev/null +++ b/recipes/msix/all/test_package/example.cpp @@ -0,0 +1,26 @@ +#include + +LPVOID STDMETHODCALLTYPE MyAllocate(SIZE_T cb) { + return std::malloc(cb); +} + +void STDMETHODCALLTYPE MyFree(LPVOID pv) { + std::free(pv); +} + +int main() { + IAppxFactory* appxFactory; + + HRESULT creationResult = CoCreateAppxFactoryWithHeap( + MyAllocate, + MyFree, + MSIX_VALIDATION_OPTION::MSIX_VALIDATION_OPTION_FULL, + &appxFactory + ); + + if (FAILED(creationResult)) { + return creationResult; + } + + return 0; +} diff --git a/recipes/msix/config.yml b/recipes/msix/config.yml new file mode 100644 index 0000000000000..a03e932e1cf87 --- /dev/null +++ b/recipes/msix/config.yml @@ -0,0 +1,3 @@ +versions: + "1.7": + folder: "all" diff --git a/recipes/msys2/all/conandata.yml b/recipes/msys2/all/conandata.yml new file mode 100644 index 0000000000000..01aa597548f23 --- /dev/null +++ b/recipes/msys2/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.latest": + url: [ + "https://github.com/msys2/msys2-installer/releases/download/2022-01-18/msys2-base-x86_64-20220118.tar.xz", + "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20220118.tar.xz", + "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20220118.tar.xz", + ] + sha256: "2ec6fe9c3e01ecba10b9ffa708ea13bf1f8c9739e5ce9da853b77f1f3e270034" diff --git a/recipes/msys2/all/conanfile.py b/recipes/msys2/all/conanfile.py new file mode 100644 index 0000000000000..2606f171ddcec --- /dev/null +++ b/recipes/msys2/all/conanfile.py @@ -0,0 +1,194 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.files import chdir, get, replace_in_file, copy +from conan.tools.layout import basic_layout +import fnmatch +import os +import shutil +import subprocess +import errno +import ctypes + +required_conan_version = ">=1.47.0" + + +class lock: + def __init__(self): + self.handle = ctypes.windll.kernel32.CreateMutexA(None, 0, "Global\\ConanMSYS2".encode()) + if not self.handle: + raise ctypes.WinError() + + def __enter__(self): + status = ctypes.windll.kernel32.WaitForSingleObject(self.handle, 0xFFFFFFFF) + if status not in [0, 0x80]: + raise ctypes.WinError() + + def __exit__(self, exc_type, exc_val, exc_tb): + status = ctypes.windll.kernel32.ReleaseMutex(self.handle) + if not status: + raise ctypes.WinError() + + def close(self): + ctypes.windll.kernel32.CloseHandle(self.handle) + + __del__ = close + +class MSYS2Conan(ConanFile): + name = "msys2" + description = "MSYS2 is a software distro and building platform for Windows" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.msys2.org" + license = "MSYS license" + topics = ("msys", "unix", "subsystem") + + settings = "os", "arch" + # "exclude_files" "packages" "additional_packages" values are a comma separated list + options = { + "exclude_files": ["ANY"], + "packages": ["ANY"], + "additional_packages": [None, "ANY"], + "no_kill": [True, False] + } + default_options = { + "exclude_files": "*/link.exe", + "packages": "base-devel,binutils,gcc", + "additional_packages": None, + "no_kill": False, + } + + short_paths = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.no_kill + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("Only Windows supported") + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Only Windows x64 supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=False) # Preserve tarball root dir (msys64/) + + def _update_pacman(self): + with chdir(self, os.path.join(self._msys_dir, "usr", "bin")): + try: + self._kill_pacman() + + # https://www.msys2.org/docs/ci/ + self.run('bash -l -c "pacman --debug --noconfirm --ask 20 -Syuu"') # Core update (in case any core packages are outdated) + self._kill_pacman() + self.run('bash -l -c "pacman --debug --noconfirm --ask 20 -Syuu"') # Normal update + self._kill_pacman() + self.run('bash -l -c "pacman --debug -Rc dash --noconfirm"') + except ConanException: + self.run('bash -l -c "cat /var/log/pacman.log || echo nolog"') + self._kill_pacman() + raise + + # https://github.com/msys2/MSYS2-packages/issues/1966 + def _kill_pacman(self): + if self.options.no_kill: + return + if (self.settings.os == "Windows"): + taskkill_exe = os.path.join(os.environ.get('SystemRoot'), 'system32', 'taskkill.exe') + + log_out = True + if log_out: + out = subprocess.PIPE + err = subprocess.STDOUT + else: + out = open(os.devnull, 'w', encoding='UTF-8') + err = subprocess.PIPE + + if os.path.exists(taskkill_exe): + taskkill_cmds = [ + f"{taskkill_exe} /f /t /im pacman.exe", + f"{taskkill_exe} /f /im gpg-agent.exe", + f"{taskkill_exe} /f /im dirmngr.exe", + f'{taskkill_exe} /fi "MODULES eq msys-2.0.dll"', + ] + for taskkill_cmd in taskkill_cmds: + try: + proc = subprocess.Popen(taskkill_cmd, stdout=out, stderr=err, bufsize=1) + proc.wait() + except OSError as e: + if e.errno == errno.ENOENT: + raise ConanException("Cannot kill pacman") from e + + @property + def _msys_dir(self): + subdir = "msys64" # top-level directoy in tarball + return os.path.join(self.source_folder, subdir) + + def build(self): + with lock(): + self._do_build() + + def _do_build(self): + packages = [] + if self.options.packages: + packages.extend(str(self.options.packages).split(",")) + if self.options.additional_packages: + packages.extend(str(self.options.additional_packages).split(",")) + + self._update_pacman() + + with chdir(self, os.path.join(self._msys_dir, "usr", "bin")): + for package in packages: + self.run(f'bash -l -c "pacman -S {package} --noconfirm"') + for package in ['pkgconf']: + self.run(f'bash -l -c "pacman -Rs -d -d $(pacman -Qsq {package}) --noconfirm"') + + self._kill_pacman() + + # create /tmp dir in order to avoid + # bash.exe: warning: could not find /tmp, please create! + tmp_dir = os.path.join(self._msys_dir, 'tmp') + if not os.path.isdir(tmp_dir): + os.makedirs(tmp_dir) + tmp_name = os.path.join(tmp_dir, 'dummy') + with open(tmp_name, 'a', encoding='UTF-8'): + os.utime(tmp_name, None) + + # Prepend the PKG_CONFIG_PATH environment variable with an eventual PKG_CONFIG_PATH environment variable + replace_in_file(self, os.path.join(self._msys_dir, "etc", "profile"), + 'PKG_CONFIG_PATH="', 'PKG_CONFIG_PATH="$PKG_CONFIG_PATH:') + + def package(self): + excludes = None + if self.options.exclude_files: + excludes = tuple(str(self.options.exclude_files).split(",")) + for exclude in excludes: + for root, _, filenames in os.walk(self._msys_dir): + for filename in filenames: + fullname = os.path.join(root, filename) + if fnmatch.fnmatch(fullname, exclude): + os.unlink(fullname) + # See https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#kb-h013-default-package-layout + copy(self, "*", dst=os.path.join(self.package_folder, "bin", "msys64"), src=self._msys_dir, excludes=excludes) + shutil.copytree(os.path.join(self._msys_dir, "usr", "share", "licenses"), + os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + msys_root = os.path.join(self.package_folder, "bin", "msys64") + msys_bin = os.path.join(msys_root, "usr", "bin") + self.cpp_info.bindirs.append(msys_bin) + + self.buildenv_info.define_path("MSYS_ROOT", msys_root) + self.buildenv_info.define_path("MSYS_BIN", msys_bin) + + self.conf_info.define("tools.microsoft.bash:subsystem", "msys2") + self.conf_info.define("tools.microsoft.bash:path", os.path.join(msys_bin, "bash.exe")) + + # conan v1 specific stuff + self.env_info.MSYS_ROOT = msys_root + self.env_info.MSYS_BIN = msys_bin + self.env_info.path.append(msys_bin) diff --git a/recipes/msys2/all/test_package/conanfile.py b/recipes/msys2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fa7d81b8ee739 --- /dev/null +++ b/recipes/msys2/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.env import Environment +from io import StringIO + + +class TestPackageConan(ConanFile): + settings = "os", "arch" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + @property + def _secret_value(self): + return "SECRET_CONAN_PKG_VARIABLE" + + def generate(self): + env = Environment() + env.define("PKG_CONFIG_PATH", self._secret_value) + envvars = env.vars(self) + envvars.save_script("conanbuildenv_pkg_config_path") + + def build(self): + pass # nothing to do, skip hook warning + + def test(self): + self.run('bash.exe -c ^"make --version^"') + self.run('bash.exe -c ^"! test -f /bin/link^"') + self.run('bash.exe -c ^"! test -f /usr/bin/link^"') + + output = StringIO() + self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output) + print(output.getvalue()) + assert self._secret_value in output.getvalue() diff --git a/recipes/msys2/all/test_v1_package/conanfile.py b/recipes/msys2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9278b74eeb27b --- /dev/null +++ b/recipes/msys2/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +from io import StringIO + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def build(self): + pass # nothing to do, skip hook warning + + def test(self): + bash = tools.which("bash.exe") + + if bash: + self.output.info("using bash.exe from: " + bash) + else: + raise ConanException("No instance of bash.exe could be found on %PATH%") + + self.run('bash.exe -c ^"make --version^"') + self.run('bash.exe -c ^"! test -f /bin/link^"') + self.run('bash.exe -c ^"! test -f /usr/bin/link^"') + + secret_value = "SECRET_CONAN_PKG_VARIABLE" + with tools.environment_append({"PKG_CONFIG_PATH": secret_value}): + output = StringIO() + self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output=output) + print(output.getvalue()) + assert secret_value in output.getvalue() diff --git a/recipes/msys2/config.yml b/recipes/msys2/config.yml new file mode 100644 index 0000000000000..608a5b0c8a900 --- /dev/null +++ b/recipes/msys2/config.yml @@ -0,0 +1,4 @@ +versions: + "cci.latest": + folder: "all" + diff --git a/recipes/mujs/all/CMakeLists.txt b/recipes/mujs/all/CMakeLists.txt new file mode 100644 index 0000000000000..8ee1eff93fdb3 --- /dev/null +++ b/recipes/mujs/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.4) +project(mujs LANGUAGES C) + +file(GLOB MUJS_SRC ${MUJS_SRC_DIR}/js*.c ${MUJS_SRC_DIR}/utf*.c ${MUJS_SRC_DIR}/regexp.c) + +add_library(${PROJECT_NAME} ${MUJS_SRC}) +set_property(TARGET ${PROJECT_NAME} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +find_library(M_LIB m) +if(M_LIB) + target_link_libraries(${PROJECT_NAME} PRIVATE ${M_LIB}) +endif() + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(FILES ${MUJS_SRC_DIR}/mujs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/mujs/all/conandata.yml b/recipes/mujs/all/conandata.yml new file mode 100644 index 0000000000000..8b8c95eb04cf4 --- /dev/null +++ b/recipes/mujs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.2": + url: "https://mujs.com/downloads/mujs-1.1.2.tar.xz" + sha256: "719e882bb7d98640efa163381e9b68ef1ce35c87a422e2aa4190c9e40225875d" diff --git a/recipes/mujs/all/conanfile.py b/recipes/mujs/all/conanfile.py new file mode 100644 index 0000000000000..4d4b59f453109 --- /dev/null +++ b/recipes/mujs/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class MujsConan(ConanFile): + name = "mujs" + 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" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MUJS_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, "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("pkg_config_name", "mujs") + self.cpp_info.libs = ["mujs"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/mujs/all/test_package/CMakeLists.txt b/recipes/mujs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d5111bdead218 --- /dev/null +++ b/recipes/mujs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(mujs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mujs::mujs) diff --git a/recipes/mujs/all/test_package/conanfile.py b/recipes/mujs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mujs/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/mujs/all/test_package/test_package.c b/recipes/mujs/all/test_package/test_package.c new file mode 100644 index 0000000000000..459444b482f7f --- /dev/null +++ b/recipes/mujs/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include + +#include + +static void hello(js_State *J) +{ + const char *name = js_tostring(J, 1); + printf("Hello, %s!\n", name); + js_pushundefined(J); +} + +int main(void) +{ + js_State *J = js_newstate(NULL, NULL, JS_STRICT); + + js_newcfunction(J, hello, "hello", 1); + js_setglobal(J, "hello"); + + js_dostring(J, "hello('world');"); + + js_freestate(J); + + return 0; +} diff --git a/recipes/mujs/all/test_v1_package/CMakeLists.txt b/recipes/mujs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/mujs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mujs/all/test_v1_package/conanfile.py b/recipes/mujs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mujs/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/mujs/config.yml b/recipes/mujs/config.yml new file mode 100644 index 0000000000000..8d13aefb6b4fb --- /dev/null +++ b/recipes/mujs/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.2": + folder: all diff --git a/recipes/muparser/all/conandata.yml b/recipes/muparser/all/conandata.yml new file mode 100644 index 0000000000000..cd86d2cd3c232 --- /dev/null +++ b/recipes/muparser/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.3.4": + url: "https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.4.tar.gz" + sha256: "0c3fa54a3ebf36dda0ed3e7cd5451c964afbb15102bdbcba08aafb359a290121" + "2.3.2": + url: "https://github.com/beltoforion/muparser/archive/v2.3.2.tar.gz" + sha256: "b35fc84e3667d432e3414c8667d5764dfa450ed24a99eeef7ee3f6647d44f301" diff --git a/recipes/muparser/all/conanfile.py b/recipes/muparser/all/conanfile.py new file mode 100644 index 0000000000000..2de9bbd1cb080 --- /dev/null +++ b/recipes/muparser/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class MuParserConan(ConanFile): + name = "muparser" + license = "BSD-2-Clause" + homepage = "https://beltoforion.de/en/muparser/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("math", "parser",) + description = "Fast Math Parser Library" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openmp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_SAMPLES"] = False + tc.variables["ENABLE_OPENMP"] = self.options.with_openmp + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + license_file = "License.txt" if Version(self.version) < "2.3.3" else "LICENSE" + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "muparser") + self.cpp_info.set_property("cmake_target_name", "muparser::muparser") + self.cpp_info.set_property("pkg_config_name", "muparser") + self.cpp_info.libs = ["muparser"] + if not self.options.shared: + self.cpp_info.defines = ["MUPARSER_STATIC=1"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/muparser/all/test_package/CMakeLists.txt b/recipes/muparser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9cc92e84977a5 --- /dev/null +++ b/recipes/muparser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(muparser CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE muparser::muparser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/muparser/all/test_package/conanfile.py b/recipes/muparser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/muparser/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/muparser/all/test_package/test_package.cpp b/recipes/muparser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..019faa3e17889 --- /dev/null +++ b/recipes/muparser/all/test_package/test_package.cpp @@ -0,0 +1,35 @@ +#include + +#include "muParser.h" + +// Function callback +double MySqr(double a_fVal) +{ + return a_fVal*a_fVal; +} + +// main program +int main(int argc, char* argv[]) +{ + using namespace mu; + + try + { + double fVal = 1; + Parser p; + p.DefineVar("a", &fVal); + p.DefineFun("MySqr", MySqr); + p.SetExpr("MySqr(a)*_pi+min(10,a)"); + + for (std::size_t a=0; a<100; ++a) + { + fVal = a; // Change value of variable a + std::cout << p.Eval() << std::endl; + } + } + catch (Parser::exception_type &e) + { + std::cout << e.GetMsg() << std::endl; + } + return 0; +} diff --git a/recipes/muparser/all/test_v1_package/CMakeLists.txt b/recipes/muparser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/muparser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/muparser/all/test_v1_package/conanfile.py b/recipes/muparser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/muparser/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/muparser/config.yml b/recipes/muparser/config.yml new file mode 100644 index 0000000000000..d7f66fca815a8 --- /dev/null +++ b/recipes/muparser/config.yml @@ -0,0 +1,5 @@ +versions: + "2.3.4": + folder: all + "2.3.2": + folder: all diff --git a/recipes/muparserx/all/conandata.yml b/recipes/muparserx/all/conandata.yml new file mode 100644 index 0000000000000..9f14a4951a1b8 --- /dev/null +++ b/recipes/muparserx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.0.8": + url: "https://github.com/beltoforion/muparserx/archive/v4.0.8.tar.gz" + sha256: "5913e0a4ca29a097baad1b78a4674963bc7a06e39ff63df3c73fbad6fadb34e1" diff --git a/recipes/muparserx/all/conanfile.py b/recipes/muparserx/all/conanfile.py new file mode 100644 index 0000000000000..565601842d1b8 --- /dev/null +++ b/recipes/muparserx/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class MuparserxConan(ConanFile): + name = "muparserx" + description = "A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more" + license = "BSD-2-Clause" + topics = ("math", "parser") + homepage = "https://beltoforion.de/article.php?a=muparserx" + 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, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = False + # Export symbols for msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def _patch_sources(self): + replace_in_file( + self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_property(TARGET muparserx PROPERTY POSITION_INDEPENDENT_CODE TRUE)", + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + 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", "muparserx") + self.cpp_info.set_property("pkg_config_name", "muparserx") + self.cpp_info.libs = ["muparserx"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/muparserx/all/test_package/CMakeLists.txt b/recipes/muparserx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e16107e1d831 --- /dev/null +++ b/recipes/muparserx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(muparserx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE muparserx::muparserx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/muparserx/all/test_package/conanfile.py b/recipes/muparserx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/muparserx/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/muparserx/all/test_package/test_package.cpp b/recipes/muparserx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e720cf5125cb1 --- /dev/null +++ b/recipes/muparserx/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "muparserx/mpParser.h" + +using namespace mup; + +int main() { + // Create the parser instance + ParserX p; + + // Create an array of mixed type + Value arr(3, 0); + arr.At(0) = 2.0; + arr.At(1) = "this is a string"; +} diff --git a/recipes/muparserx/all/test_v1_package/CMakeLists.txt b/recipes/muparserx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/muparserx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/muparserx/all/test_v1_package/conanfile.py b/recipes/muparserx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/muparserx/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/muparserx/config.yml b/recipes/muparserx/config.yml new file mode 100644 index 0000000000000..5bcadc3524910 --- /dev/null +++ b/recipes/muparserx/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.8": + folder: all diff --git a/recipes/mysql-connector-c/all/CMakeLists.txt b/recipes/mysql-connector-c/all/CMakeLists.txt new file mode 100644 index 0000000000000..894d61a215daf --- /dev/null +++ b/recipes/mysql-connector-c/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.12) + +project(cmake_wrapper) +message(WARNING "Conan MySQL Connector/C Wrapped CMake") + +include(../conanbuildinfo.cmake) +conan_basic_setup(NO_OUTPUT_DIRS) +include("CMakeListsOriginal.txt") + +# Turn off -Werror in GCC debug builds. +if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX) + target_compile_options(clientlib + PUBLIC -Wno-error) + target_compile_options(mysys + PUBLIC -Wno-error) + target_compile_options(strings + PUBLIC -Wno-error) +endif() diff --git a/recipes/mysql-connector-c/all/conandata.yml b/recipes/mysql-connector-c/all/conandata.yml new file mode 100644 index 0000000000000..41e3b18a983f4 --- /dev/null +++ b/recipes/mysql-connector-c/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "6.1.11": + sha256: c8664851487200162b38b6f3c8db69850bd4f0e4c5ff5a6d161dbfb5cb76b6c4 + url: "http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-6.1.11-src.tar.gz" +patches: + "6.1.11": + - patch_file: "patches/001-20028_all_mysql-5.6-gcc7.patch" + base_path: "source_subfolder" + - patch_file: "patches/002-mysql_config.patch" + base_path: "source_subfolder" + - patch_file: "patches/003-cmake-install-standard-locations.patch" + base_path: "source_subfolder" + - patch_file: "patches/004-cmake-install-typo.patch" + base_path: "source_subfolder" diff --git a/recipes/mysql-connector-c/all/conanfile.py b/recipes/mysql-connector-c/all/conanfile.py new file mode 100644 index 0000000000000..6d7ea21e58004 --- /dev/null +++ b/recipes/mysql-connector-c/all/conanfile.py @@ -0,0 +1,97 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class MysqlConnectorCConan(ConanFile): + name = "mysql-connector-c" + url = "https://github.com/conan-io/conan-center-index" + description = "A MySQL client library for C development." + topics = ("mysql", "sql", "connector", "database") + homepage = "https://dev.mysql.com/downloads/connector/c/" + license = "GPL-2.0" + exports_sources = ["CMakeLists.txt", "patches/*.patch"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "with_ssl": [True, False], "with_zlib": [True, False]} + default_options = {'shared': False, 'with_ssl': True, 'with_zlib': True} + + deprecated = "libmysqlclient" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + if self.options.with_ssl: + self.requires("openssl/1.0.2u") + + if self.options.with_zlib: + self.requires("zlib/1.2.11") + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. contributions are welcome.") + + 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["DISABLE_SHARED"] = not self.options.shared + self._cmake.definitions["DISABLE_STATIC"] = self.options.shared + self._cmake.definitions["STACK_DIRECTION"] = "-1" # stack grows downwards, on very few platforms stack grows upwards + self._cmake.definitions["REQUIRE_STDCPP"] = tools.stdcpp_library(self) + + if self.settings.compiler == "Visual Studio": + if self.settings.compiler.runtime == "MD" or self.settings.compiler.runtime == "MDd": + self._cmake.definitions["WINDOWS_RUNTIME_MD"] = True + + if self.options.with_ssl: + self._cmake.definitions["WITH_SSL"] = "system" + + if self.options.with_zlib: + self._cmake.definitions["WITH_ZLIB"] = "system" + + self._cmake.configure(source_dir=self._source_subfolder) + return self._cmake + + def _patch_sources(self): + sources_cmake = os.path.join(self._source_subfolder, "CMakeLists.txt") + sources_cmake_orig = os.path.join(self._source_subfolder, "CMakeListsOriginal.txt") + + tools.rename(sources_cmake, sources_cmake_orig) + tools.rename("CMakeLists.txt", sources_cmake) + + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + tools.mkdir(os.path.join(self.package_folder, "licenses")) + tools.rename(os.path.join(self.package_folder, "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING")) + tools.rename(os.path.join(self.package_folder, "COPYING-debug"), os.path.join(self.package_folder, "licenses", "COPYING-debug")) + tools.remove_files_by_mask(self.package_folder, "README*") + tools.remove_files_by_mask(self.package_folder, "*.pdb") + tools.rmdir(os.path.join(self.package_folder, "docs")) + + def package_info(self): + self.cpp_info.libs = ["libmysql" if self.options.shared and self.settings.os == "Windows" else "mysqlclient"] + if not self.options.shared: + stdcpp_library = tools.stdcpp_library(self) + if stdcpp_library: + self.cpp_info.system_libs.append(stdcpp_library) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append('m') diff --git a/recipes/mysql-connector-c/all/patches/001-20028_all_mysql-5.6-gcc7.patch b/recipes/mysql-connector-c/all/patches/001-20028_all_mysql-5.6-gcc7.patch new file mode 100644 index 0000000000000..326bbe3e9f1f3 --- /dev/null +++ b/recipes/mysql-connector-c/all/patches/001-20028_all_mysql-5.6-gcc7.patch @@ -0,0 +1,13 @@ +diff --git a/sql-common/client_authentication.cc b/sql-common/client_authentication.cc +index eaeb2d4..035ecd2 100644 +--- a/sql-common/client_authentication.cc ++++ b/sql-common/client_authentication.cc +@@ -83,7 +83,7 @@ RSA *rsa_init(MYSQL *mysql) + + if (mysql->options.extension != NULL && + mysql->options.extension->server_public_key_path != NULL && +- mysql->options.extension->server_public_key_path != '\0') ++ mysql->options.extension->server_public_key_path[0] != '\0') + { + pub_key_file= fopen(mysql->options.extension->server_public_key_path, + "r"); diff --git a/recipes/mysql-connector-c/all/patches/002-mysql_config.patch b/recipes/mysql-connector-c/all/patches/002-mysql_config.patch new file mode 100644 index 0000000000000..95c1c123bfb36 --- /dev/null +++ b/recipes/mysql-connector-c/all/patches/002-mysql_config.patch @@ -0,0 +1,55 @@ +--- scripts/CMakeLists.txt ++++ scripts/CMakeLists.txt +@@ -50,6 +50,8 @@ IF(POLICY CMP0007) + CMAKE_POLICY(SET CMP0007 OLD) + ENDIF() + ++set(REQUIRE_STDCPP "" CACHE STRING "c++ library") ++ + # Extract dependencies using CMake's internal ${target}_LIB_DEPENDS variable + # returned string in ${var} is can be passed to linker's command line + MACRO(EXTRACT_LINK_LIBRARIES target var) +@@ -72,6 +74,9 @@ MACRO(EXTRACT_LINK_LIBRARIES target var) + ENDIF() + ENDIF() + ENDFOREACH() ++ IF(REQUIRE_STDCPP) ++ SET(${var} "${${var}}-l${REQUIRE_STDCPP}") ++ ENDIF() + ENDIF() + IF(MSVC) + STRING(REPLACE "-l" "" ${var} "${${var}}") +@@ -79,6 +84,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var) + ENDMACRO() + + EXTRACT_LINK_LIBRARIES(mysqlclient CLIENT_LIBS) ++GET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME TARGET mysqlclient PROPERTY OUTPUT_NAME) + + SET(LIBMYSQLD_LIBS_USAGE " + --libmysqld-libs [$embedded_libs]") +diff --git a/source/source_subfolder/scripts/mysql_config.pl.in b/source/source_subfolder/scripts/mysql_config.pl.in +index 54e3f76..b3c10c9 100644 +--- scripts/mysql_config.pl.in ++++ scripts/mysql_config.pl.in +@@ -184,7 +184,7 @@ else + + + my $flags; +-$flags->{libs} = [@lib_opts, qw(@CONFIG_CLIENT_LIBS@)]; ++$flags->{libs} = [@lib_opts, qw(@CLIENT_LIBS@)]; + $flags->{embedded_libs} = [@lib_e_opts, qw(@CONFIG_EMBEDD_LIBS@)]; + + $flags->{include} = ["-I$pkgincludedir"]; +diff --git a/source/source_subfolder/scripts/mysql_config.sh b/source/source_subfolder/scripts/mysql_config.sh +index a900cc6..b8118c1 100644 +--- scripts/mysql_config.sh ++++ scripts/mysql_config.sh +@@ -111,7 +111,7 @@ fi + + # Create options + libs="-L$pkglibdir@RPATH_OPTION@" +-libs="$libs -l@LIBMYSQL_OS_OUTPUT_NAME@ @CONFIG_CLIENT_LIBS@" ++libs="$libs -l@LIBMYSQL_OS_OUTPUT_NAME@ @CLIENT_LIBS@" + embedded_libs="-L$pkglibdir@RPATH_OPTION@" + embedded_libs="$embedded_libs -l@LIBEMBED_OS_OUTPUT_NAME@ @CONFIG_EMBEDD_LIBS@" + diff --git a/recipes/mysql-connector-c/all/patches/003-cmake-install-standard-locations.patch b/recipes/mysql-connector-c/all/patches/003-cmake-install-standard-locations.patch new file mode 100644 index 0000000000000..5681047426401 --- /dev/null +++ b/recipes/mysql-connector-c/all/patches/003-cmake-install-standard-locations.patch @@ -0,0 +1,11 @@ +--- cmake/install_macros.cmake ++++ cmake/install_macros.cmake +@@ -238,7 +238,7 @@ + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ENDIF() +- INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) ++ INSTALL(TARGETS ${TARGETS} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ${COMP}) + IF(CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE MATCHES "Release") + SET(INSTALL_LOCATION ${ARG_DESTINATION} ) + INSTALL_DEBUG_SYMBOLS("${TARGETS}") diff --git a/recipes/mysql-connector-c/all/patches/004-cmake-install-typo.patch b/recipes/mysql-connector-c/all/patches/004-cmake-install-typo.patch new file mode 100644 index 0000000000000..35d2bee366601 --- /dev/null +++ b/recipes/mysql-connector-c/all/patches/004-cmake-install-typo.patch @@ -0,0 +1,15 @@ +--- cmake/install_macros.cmake ++++ cmake/install_macros.cmake +@@ -359,10 +359,10 @@ + INSTALL(FILES ${_target_location} + DESTINATION ${_destination} + ${_rename_param} + CONFIGURATIONS Release RelWithDebInfo + COMPONENT ${ARG_COMPONENT} + OPTIONAL) +- ENDIF() +- ENDFOREACH() ++ ENDFOREACH() ++ ENDIF() + + ENDFUNCTION() diff --git a/recipes/mysql-connector-c/all/test_package/CMakeLists.txt b/recipes/mysql-connector-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..af5ced10013a7 --- /dev/null +++ b/recipes/mysql-connector-c/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(Threads) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) diff --git a/recipes/mysql-connector-c/all/test_package/conanfile.py b/recipes/mysql-connector-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/mysql-connector-c/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mysql-connector-c/all/test_package/test_package.c b/recipes/mysql-connector-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..382117abe3e35 --- /dev/null +++ b/recipes/mysql-connector-c/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("MySQL client version: %s\n", mysql_get_client_info()); + return 0; +} diff --git a/recipes/mysql-connector-c/config.yml b/recipes/mysql-connector-c/config.yml new file mode 100644 index 0000000000000..2c88a55b7af83 --- /dev/null +++ b/recipes/mysql-connector-c/config.yml @@ -0,0 +1,3 @@ +versions: + "6.1.11": + folder: all diff --git a/recipes/mysql-connector-cpp/all/conandata.yml b/recipes/mysql-connector-cpp/all/conandata.yml new file mode 100644 index 0000000000000..ca41898365fef --- /dev/null +++ b/recipes/mysql-connector-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "8.0.33": + url: "https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-8.0.33-src.tar.gz" + sha256: "160cf6881fbde9bd46cd11aaf12930b676bc6e27589ac5c7ba49c196b97e053b" diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py new file mode 100644 index 0000000000000..3a2ef60a38788 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library + +class mysql_connector_cxxRecipe(ConanFile): + name = "mysql-connector-cpp" + license = "GPL-2.0" + author = "Samuel Aazcona " + url = "https://github.com/samuaz/libmysqlcppconn-conan" + homepage = "https://dev.mysql.com/doc/connector-cpp/8.0" + description = "A Conan package for MySQL Connector/C++ with OpenSSL, Boost, and libmysqlclient" + topics = ("conan", "mysql", "connector", "cpp", "openssl", "boost", "libmysqlclient", "jdbc", "static") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + requires = ("boost/1.81.0", "openssl/1.1.1t", "libmysqlclient/8.0.31") + + @property + def _min_cppstd(self): + return "17" if Version(self.version) >= "8.0.27" else "11" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7" if Version(self.version) >= "8.0.27" else "5.3", + "clang": "6", + } + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def validate_build(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.") + + def validate(self): + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} {minimum_version} or newer") + + # I dont have a windows computer to test it + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support windows for now") + + # Sice 8.0.17 this doesn't support shared library on MacOS. + # https://github.com/mysql/mysql-server/blob/mysql-8.0.17/cmake/libutils.cmake#L333-L335 + if self.settings.compiler == "apple-clang" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared library on apple-clang") + + # mysql < 8.0.29 uses `requires` in source code. It is the reserved keyword in C++20. + # https://github.com/mysql/mysql-server/blob/mysql-8.0.0/include/mysql/components/services/dynamic_loader.h#L270 + if self.settings.compiler.get_safe("cppstd") == "20" and Version(self.version) < "8.0.29": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support C++20") + + 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 generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_BUILD_TYPE"] = "Release" + tc.cache_variables["WITH_JDBC"] = "ON" + tc.cache_variables["WITHOUT_SERVER"] = "ON" + if not self.options.shared: + tc.cache_variables["BUILD_STATIC"] = "ON" + tc.cache_variables["MYSQL_LIB_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().libdirs[0].replace("\\", "/") + tc.cache_variables["MYSQL_INCLUDE_DIR"] = self.dependencies["libmysqlclient"].cpp_info.aggregated_components().includedirs[0].replace("\\", "/") + tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libdirs = ["lib","lib64"] + self.cpp_info.includedirs = ["include"] + if not self.options.shared: + self.cpp_info.libs = ["mysqlcppconn-static", "mysqlcppconn8-static"] + stdcpplib = stdcpp_library(self) + if stdcpplib: + self.cpp_info.system_libs.append(stdcpplib) + if self.settings.os in ["Linux", "FreeBSD", "Macos"]: + self.cpp_info.system_libs.extend(["m", "resolv"]) + else: + self.cpp_info.libs = ["mysqlcppconn", "mysqlcppconn8"] + self.cpp_info.names["cmake_find_package"] = "mysql-connector-cpp" + self.cpp_info.names["cmake_find_package_multi"] = "mysql-connector-cpp" diff --git a/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4d4210210765b --- /dev/null +++ b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.15) +project(MySQLConnectorCPPTest CXX) + +find_package(mysql-connector-cpp REQUIRED CONFIG) +add_executable(test_package src/test_package.cpp) +target_link_libraries(test_package mysql-connector-cpp::mysql-connector-cpp) diff --git a/recipes/mysql-connector-cpp/all/test_package/conanfile.py b/recipes/mysql-connector-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b573a1f64ec30 --- /dev/null +++ b/recipes/mysql-connector-cpp/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 mysql_connector_cxxTestConan(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/mysql-connector-cpp/all/test_package/src/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/src/test_package.cpp new file mode 100644 index 0000000000000..b1cadf4d9bba7 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/test_package/src/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include +#include + +int main() { + auto driver = sql::mysql::get_mysql_driver_instance(); + std::cout << "MySQL connector cpp works" << std::endl; + return 0; +} diff --git a/recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt b/recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3fb35b1634750 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) +find_package(mysql-connector-cpp REQUIRED CONFIG) +add_executable(test_package src/test_package.cpp) +target_link_libraries(test_package mysql-connector-cpp::mysql-connector-cpp) diff --git a/recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py b/recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mysql-connector-cpp/config.yml b/recipes/mysql-connector-cpp/config.yml new file mode 100644 index 0000000000000..2fc10511efcf8 --- /dev/null +++ b/recipes/mysql-connector-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "8.0.33": + folder: all diff --git a/recipes/naive-tsearch/all/CMakeLists.txt b/recipes/naive-tsearch/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd3083b512cb9 --- /dev/null +++ b/recipes/naive-tsearch/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/naive-tsearch/all/conandata.yml b/recipes/naive-tsearch/all/conandata.yml new file mode 100644 index 0000000000000..fe6850061cde2 --- /dev/null +++ b/recipes/naive-tsearch/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.1.0": + url: "https://github.com/kulp/naive-tsearch/releases/download/v0.1.0/naive-tsearch-0.1.0.tar.xz" + sha256: "0e45b7ffb5ff98dce56c4e01365905158843f4c75e6bf1061774153f3c63a2a4" + "0.1.1": + url: "https://github.com/kulp/naive-tsearch/releases/download/v0.1.1/naive-tsearch-0.1.1.tar.xz" + sha256: "cb779326a8748fb527ab2f4d199923c92dc7d120988b45400d4b31fd77288a1b" diff --git a/recipes/naive-tsearch/all/conanfile.py b/recipes/naive-tsearch/all/conanfile.py new file mode 100644 index 0000000000000..18e7d263339e4 --- /dev/null +++ b/recipes/naive-tsearch/all/conanfile.py @@ -0,0 +1,78 @@ +from conans import CMake, ConanFile, tools +import os + + +class NaiveTsearchConan(ConanFile): + name = "naive-tsearch" + description = "A simple tsearch() implementation for platforms without one" + topics = ("conan", "naive-tsearch", "tsearch", "search", "tree", "msvc") + license = "MIT" + homepage = "https://github.com/kulp/naive-tsearch" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt"] + options = { + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "fPIC": True, + "header_only": True, + } + generators = "cmake" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".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["NAIVE_TSEARCH_INSTALL"] = True + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_id(self): + del self.info.options.header_only + + def package_info(self): + if self.options.header_only: + self.cpp_info.components["header_only"].libs = [] + self.cpp_info.components["header_only"].libdirs = [] + self.cpp_info.components["header_only"].includedirs.append(os.path.join("include", "naive-tsearch")) + self.cpp_info.components["header_only"].defines = ["NAIVE_TSEARCH_HDRONLY"] + self.cpp_info.components["header_only"].names["cmake_find_package"] = "naive-tsearch-hdronly" + self.cpp_info.components["header_only"].names["cmake_find_package_multi"] = "naive-tsearch-hdronly" + else: + self.cpp_info.components["naive_tsearch"].libs = ["naive-tsearch"] + self.cpp_info.components["naive_tsearch"].includedirs.append(os.path.join("include", "naive-tsearch")) + self.cpp_info.components["naive_tsearch"].names["cmake_find_package"] = "naive-tsearch" + self.cpp_info.components["naive_tsearch"].names["cmake_find_package_multi"] = "naive-tsearch" diff --git a/recipes/naive-tsearch/all/test_package/CMakeLists.txt b/recipes/naive-tsearch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a403dc404b41 --- /dev/null +++ b/recipes/naive-tsearch/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/naive-tsearch/all/test_package/conanfile.py b/recipes/naive-tsearch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/naive-tsearch/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/naive-tsearch/all/test_package/test_package.c b/recipes/naive-tsearch/all/test_package/test_package.c new file mode 100644 index 0000000000000..1ce148237b282 --- /dev/null +++ b/recipes/naive-tsearch/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include + +static void walk_tree(const void *what, VISIT kind, int level) { +} + +int main() { + void *root = NULL; + twalk(root, walk_tree); + return 0; +} diff --git a/recipes/naive-tsearch/config.yml b/recipes/naive-tsearch/config.yml new file mode 100644 index 0000000000000..06eee83c5fb24 --- /dev/null +++ b/recipes/naive-tsearch/config.yml @@ -0,0 +1,5 @@ +versions: + "0.1.0": + folder: "all" + "0.1.1": + folder: "all" diff --git a/recipes/namedtype/all/conandata.yml b/recipes/namedtype/all/conandata.yml new file mode 100644 index 0000000000000..0d790e3072e99 --- /dev/null +++ b/recipes/namedtype/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20190324": + url: https://github.com/joboccara/NamedType/archive/27cb8d9e0a0d40e786ed43da1388c73f0409fda0.zip + sha256: 9bf7df4f2aa0a9267f669091f27a14bf4de127dc4db13cc96b09b255fe224101 + "1.1.0": + url: https://github.com/joboccara/NamedType/archive/v1.1.0.tar.gz + sha256: 9a4f7e2054e25c753b1cc3fbd0883e03acee85a9a0f2299b4e7a47e8b46a4c80 diff --git a/recipes/namedtype/all/conanfile.py b/recipes/namedtype/all/conanfile.py new file mode 100644 index 0000000000000..ff8826be0c227 --- /dev/null +++ b/recipes/namedtype/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 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 NamedTypeConan(ConanFile): + name = "namedtype" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/joboccara/NamedType" + description = "Implementation of strong types in C++" + topics = ("strong types", "header-only") + package_type = "header-library" + settings = "compiler" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "14.1", + "gcc": "5", + "clang": "3.4", + "apple-clang": "5.1", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.version == "20190324": + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include", "NamedType"), + src=self.source_folder, + ) + else: + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + if self.version == "20190324": + self.cpp_info.includedirs.append(os.path.join("include", "NamedType")) diff --git a/recipes/namedtype/all/test_package/CMakeLists.txt b/recipes/namedtype/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a56821d0dc1a6 --- /dev/null +++ b/recipes/namedtype/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(namedtype REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE namedtype::namedtype) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/namedtype/all/test_package/conanfile.py b/recipes/namedtype/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/namedtype/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/namedtype/all/test_package/main.cpp b/recipes/namedtype/all/test_package/main.cpp new file mode 100644 index 0000000000000..7fe62ed5d00ac --- /dev/null +++ b/recipes/namedtype/all/test_package/main.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() { + using Meter = fluent::NamedType< + double, struct MeterParameter, fluent::Addable, fluent::Comparable>; + Meter m{0}; + m.get(); + return 0; +} diff --git a/recipes/namedtype/all/test_v1_package/CMakeLists.txt b/recipes/namedtype/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/namedtype/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/namedtype/all/test_v1_package/conanfile.py b/recipes/namedtype/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/namedtype/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/namedtype/config.yml b/recipes/namedtype/config.yml new file mode 100644 index 0000000000000..19dfa194964ff --- /dev/null +++ b/recipes/namedtype/config.yml @@ -0,0 +1,6 @@ +--- +versions: + "20190324": + folder: all + "1.1.0": + folder: all diff --git a/recipes/nameof/all/conandata.yml b/recipes/nameof/all/conandata.yml new file mode 100644 index 0000000000000..a47ecd560d7e3 --- /dev/null +++ b/recipes/nameof/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.10.3": + url: "https://github.com/Neargye/nameof/archive/v0.10.3.tar.gz" + sha256: "f31dd02841adfbb98949454005a308174645957d2b8d4dc06a7c15e1039e46e6" + "0.10.2": + url: "https://github.com/Neargye/nameof/archive/v0.10.2.tar.gz" + sha256: "b596fd0804c61781bc8d87d9b8e448e2450debddb52c70ed3e89bf02c6c16f4f" + "0.10.1": + url: "https://github.com/Neargye/nameof/archive/v0.10.1.tar.gz" + sha256: "000a55de58fb57cd77043ab9e91a3c91dbea5947b2cb0034cddf869ecf16e86d" + "0.10.0": + url: "https://github.com/Neargye/nameof/archive/v0.10.0.tar.gz" + sha256: "9c4eaaa795ebbdb5d87952b5280d9eb0ca2d1eaab3bac98a296cb1b74f8e673c" + "0.9.4": + url: "https://github.com/Neargye/nameof/archive/v0.9.4.tar.gz" + sha256: "d23505104ce94474318976af8ce334e6891ef0b3927dfa1bc64484f701072aae" diff --git a/recipes/nameof/all/conanfile.py b/recipes/nameof/all/conanfile.py new file mode 100644 index 0000000000000..eeff71754920a --- /dev/null +++ b/recipes/nameof/all/conanfile.py @@ -0,0 +1,78 @@ +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 NameofConan(ConanFile): + name = "nameof" + description = "Header-only C++17 library provides nameof macros and functions to simply obtain the name of a variable, type, function, macro, and enum." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Neargye/nameof" + topics = ( + "enum-to-string", + "serialization", + "reflection", + "header-only", + "compile-time" + ) + 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": "9", + "clang": "5", + "apple-clang": "9", + "Visual Studio": "15.3", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 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] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + 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="nameof.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nameof/all/test_package/CMakeLists.txt b/recipes/nameof/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0e0eb7cf71e17 --- /dev/null +++ b/recipes/nameof/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(nameof REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nameof::nameof) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/nameof/all/test_package/conanfile.py b/recipes/nameof/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b4ff34dc80ca1 --- /dev/null +++ b/recipes/nameof/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, src_folder=".") + + 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/nameof/all/test_package/test_package.cpp b/recipes/nameof/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..379443f1c51f5 --- /dev/null +++ b/recipes/nameof/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +#include + +struct SomeStruct {}; + +SomeStruct structvar; + +int main() { + constexpr auto name = NAMEOF(structvar); + static_assert("structvar" == name); + + auto res1 = NAMEOF(structvar); + auto res2 = NAMEOF(::structvar); + + bool success = (res1 == "structvar") && (res2 == "structvar"); + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/nameof/all/test_v1_package/CMakeLists.txt b/recipes/nameof/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/nameof/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/nameof/all/test_v1_package/conanfile.py b/recipes/nameof/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/nameof/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nameof/config.yml b/recipes/nameof/config.yml new file mode 100644 index 0000000000000..9af7662bde26f --- /dev/null +++ b/recipes/nameof/config.yml @@ -0,0 +1,11 @@ +versions: + "0.10.3": + folder: "all" + "0.10.2": + folder: "all" + "0.10.1": + folder: "all" + "0.10.0": + folder: "all" + "0.9.4": + folder: "all" diff --git a/recipes/nanobench/all/conandata.yml b/recipes/nanobench/all/conandata.yml new file mode 100644 index 0000000000000..3806111c8079d --- /dev/null +++ b/recipes/nanobench/all/conandata.yml @@ -0,0 +1,29 @@ +sources: + "4.3.11": + url: "https://github.com/martinus/nanobench/archive/v4.3.11.tar.gz" + sha256: "53a5a913fa695c23546661bf2cd22b299e10a3e994d9ed97daf89b5cada0da70" + "4.3.9": + url: "https://github.com/martinus/nanobench/archive/v4.3.9.tar.gz" + sha256: "4a7fd8fdd5819e4d1c34ae558df010a0ccf36db0508c41c51cd0181bc04c6356" + "4.3.7": + url: "https://github.com/martinus/nanobench/archive/v4.3.7.tar.gz" + sha256: "6a2dadb8230370c7fb7a9362be1c3677e44d8e06193a4ecb489a4748ef9483d7" + "4.3.6": + url: "https://github.com/martinus/nanobench/archive/v4.3.6.tar.gz" + sha256: "cfa223fefca8752c0c96416f3440a9b02219f4695a8307db7e8c7054aaed7f01" + "4.3.5": + url: "https://github.com/martinus/nanobench/archive/v4.3.5.tar.gz" + sha256: "205e6cf0ea901f64af971335bfe8011c1f6bd66f6ae678c616da0eddfbe70437" + "4.3.0": + url: "https://github.com/martinus/nanobench/archive/v4.3.0.tar.gz" + sha256: "6cf97e940eca42394f64d4e9d341e72804c92575247269695beb24f7e2539e82" + "4.0.0": + url: "https://github.com/martinus/nanobench/archive/v4.0.0.tar.gz" + sha256: "34b9bbfc7bf3bc30599f3b7cb398455539edb8ea67930aaef22b707f1ad3824f" + +patches: + "4.3.9": + - patch_file: "patches/4.3.9-0001-support-older-msvc.patch" + patch_description: "fix compilation error on msvc < 1928" + patch_type: "portability" + patch_source: "https://github.com/martinus/nanobench/pull/82" diff --git a/recipes/nanobench/all/conanfile.py b/recipes/nanobench/all/conanfile.py new file mode 100644 index 0000000000000..67a58bc871cff --- /dev/null +++ b/recipes/nanobench/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class NanobenchConan(ConanFile): + name = "nanobench" + description = """ankerl::nanobench is a platform independent + microbenchmarking library for C++11/14/17/20.""" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinus/nanobench" + topics = ("benchmark", "microbenchmark", "header-only") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + 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): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src", "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch b/recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch new file mode 100644 index 0000000000000..f7d7dccdcefd7 --- /dev/null +++ b/recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch @@ -0,0 +1,51 @@ +diff --git a/src/include/nanobench.h b/src/include/nanobench.h +index c03d9ad..30f7353 100644 +--- a/src/include/nanobench.h ++++ b/src/include/nanobench.h +@@ -405,7 +405,11 @@ struct Config { + Config& operator=(Config const&); + Config& operator=(Config&&); + Config(Config const&); ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++ Config(Config&&); ++#else + Config(Config&&) noexcept; ++#endif + }; + ANKERL_NANOBENCH(IGNORE_PADDED_POP) + +@@ -431,7 +435,11 @@ public: + Result& operator=(Result const&); + Result& operator=(Result&&); + Result(Result const&); ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++ Result(Result&&); ++#else + Result(Result&&) noexcept; ++#endif + + // adds new measurement results + // all values are scaled by iters (except iters...) +@@ -2854,14 +2862,22 @@ Config::~Config() = default; + Config& Config::operator=(Config const&) = default; + Config& Config::operator=(Config&&) = default; + Config::Config(Config const&) = default; ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++Config::Config(Config&&) = default; ++#else + Config::Config(Config&&) noexcept = default; ++#endif + + // provide implementation here so it's only generated once + Result::~Result() = default; + Result& Result::operator=(Result const&) = default; + Result& Result::operator=(Result&&) = default; + Result::Result(Result const&) = default; ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++Result::Result(Result&&) = default; ++#else + Result::Result(Result&&) noexcept = default; ++#endif + + namespace detail { + template diff --git a/recipes/nanobench/all/test_package/CMakeLists.txt b/recipes/nanobench/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..39d04ec4c7104 --- /dev/null +++ b/recipes/nanobench/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(nanobench REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanobench::nanobench) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nanobench/all/test_package/conanfile.py b/recipes/nanobench/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/nanobench/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nanobench/all/test_package/test_package.cpp b/recipes/nanobench/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..faa632a320514 --- /dev/null +++ b/recipes/nanobench/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#define ANKERL_NANOBENCH_IMPLEMENT +#include + +int main() { + double d = 1.0; + ankerl::nanobench::Bench().run("some double ops", [&] { + d += 1.0 / d; + if (d > 5.0) { + d -= 5.0; + } + ankerl::nanobench::doNotOptimizeAway(d); + }); +} diff --git a/recipes/nanobench/all/test_v1_package/CMakeLists.txt b/recipes/nanobench/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/nanobench/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/nanobench/all/test_v1_package/conanfile.py b/recipes/nanobench/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/nanobench/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nanobench/config.yml b/recipes/nanobench/config.yml new file mode 100644 index 0000000000000..226032b8ed3b2 --- /dev/null +++ b/recipes/nanobench/config.yml @@ -0,0 +1,15 @@ +versions: + "4.3.11": + folder: "all" + "4.3.9": + folder: "all" + "4.3.7": + folder: "all" + "4.3.6": + folder: "all" + "4.3.5": + folder: "all" + "4.3.0": + folder: "all" + "4.0.0": + folder: "all" diff --git a/recipes/nanodbc/all/CMakeLists.txt b/recipes/nanodbc/all/CMakeLists.txt new file mode 100644 index 0000000000000..6ba47d078b389 --- /dev/null +++ b/recipes/nanodbc/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_subdirectory(source_subfolder) diff --git a/recipes/nanodbc/all/conandata.yml b/recipes/nanodbc/all/conandata.yml new file mode 100644 index 0000000000000..60ad84e0835de --- /dev/null +++ b/recipes/nanodbc/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "cci.20200807": + url: "https://github.com/nanodbc/nanodbc/archive/ab8d176262f92d5f75aa2d441bfce27041032201.zip" + sha256: "9de057ae6e8d0b9192df1d16ccc70ce7525ca9fe52e56fa8d13cfae9206f8286" + "2.13.0": + url: "https://github.com/nanodbc/nanodbc/archive/v2.13.0.zip" + sha256: "1287869b6ca82728cb6cc53c54f836c72cde15370c16f32d81c9ef6c257f7e43" + "2.14.0": + url: "https://github.com/nanodbc/nanodbc/archive/v2.14.0.tar.gz" + sha256: "56228372042b689beccd96b0ac3476643ea85b3f57b3f23fb11ca4314e68b9a5" +patches: + "cci.20200807": + - patch_file: "patches/0001-odbc-from-cci.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-allow-windows-shared.patch" + base_path: "source_subfolder" + "2.13.0": + - patch_file: "patches/0001-odbc-from-cci.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-allow-windows-shared.patch" + base_path: "source_subfolder" + "2.14.0": + - patch_file: "patches/0001-odbc-from-cci.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-allow-windows-shared.patch" + base_path: "source_subfolder" diff --git a/recipes/nanodbc/all/conanfile.py b/recipes/nanodbc/all/conanfile.py new file mode 100644 index 0000000000000..44cbf934e3a4d --- /dev/null +++ b/recipes/nanodbc/all/conanfile.py @@ -0,0 +1,104 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import glob +import os + + +class NanodbcConan(ConanFile): + name = "nanodbc" + description = "A small C++ wrapper for the native C ODBC API" + topics = ("conan", "nanodbc", "odbc", "database") + license = "MIT" + homepage = "https://github.com/nanodbc/nanodbc/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + exports_sources = "CMakeLists.txt", "patches/**" + options = { + "shared": [True, False], + "fPIC": [True, False], + "async": [True, False], + "unicode": [True, False], + "with_boost": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "async": True, + "unicode": False, + "with_boost": False, + } + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + _compiler_cxx14 = { + "gcc": 5, + "clang": "3.4", + "Visual Studio": 14, + "apple-clang": "9.1", # FIXME: wild guess + } + + def configure(self): + if self.options.shared: + del self.options.fPIC + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 14) + _minimum_compiler = self._compiler_cxx14.get(str(self.settings.compiler)) + if _minimum_compiler: + if tools.Version(self.settings.compiler.version) < _minimum_compiler: + raise ConanInvalidConfiguration("nanodbc requires c++14, which your compiler does not support") + else: + self.output.warn("nanodbc requires c++14, but is unknown to this recipe. Assuming your compiler supports c++14.") + + def requirements(self): + if self.options.with_boost: + self.requires("boost/1.76.0") + if self.settings.os != "Windows": + self.requires("odbc/2.3.9") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(glob.glob("nanodbc-*")[0], self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["NANODBC_DISABLE_ASYNC"] = not self.options.get_safe("async") + self._cmake.definitions["NANODBC_ENABLE_UNICODE"] = self.options.unicode + self._cmake.definitions["NANODBC_ENABLE_BOOST"] = self.options.with_boost + self._cmake.definitions["NANODBC_DISABLE_LIBCXX"] = self.settings.get_safe("compiler.libcxx") != "libc++" + + self._cmake.definitions["NANODBC_DISABLE_INSTALL"] = False + self._cmake.definitions["NANODBC_DISABLE_EXAMPLES"] = True + self._cmake.definitions["NANODBC_DISABLE_TESTS"] = True + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["nanodbc"] + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["odbc32"] diff --git a/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch b/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch new file mode 100644 index 0000000000000..f5a355e45690b --- /dev/null +++ b/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch @@ -0,0 +1,31 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -109,7 +109,7 @@ + ######################################## + ## find unixODBC or iODBC config binary + ######################################## +-if(UNIX) ++if(0) + # Try to find unixODBC first via odbc_config program. + find_program(ODBC_CONFIG odbc_config + PATHS $ENV{ODBC_PATH}/bin /usr/bin /usr/local/bin) +@@ -171,8 +171,8 @@ + ## find ODBC libraries to link + ######################################## + if(UNIX) +- set(ODBC_LIBRARIES ${ODBCLIB}) +- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}") ++ set(ODBC_LIBRARIES CONAN_PKG::odbc) ++ #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}") + elseif(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") + set(ODBC_LIBRARIES odbc32.lib odbccp32.lib Ws2_32.lib) + elseif(MINGW) +@@ -188,7 +188,7 @@ + find_package(Boost COMPONENTS locale REQUIRED) + if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) +- link_directories(${CMAKE_BINARY_DIR}/lib ${Boost_LIBRARY_DIRS}) ++ link_directories(${CMAKE_CURRENT_BINARY_DIR}/lib ${Boost_LIBRARY_DIRS}) + else() + message(FATAL_ERROR "can not find boost") + endif() diff --git a/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch b/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch new file mode 100644 index 0000000000000..5ab2c375b7053 --- /dev/null +++ b/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -215,9 +215,9 @@ else() + message(STATUS "nanodbc build: Enable nanodbc target - STATIC") + endif() + +-if(WIN32 AND NOT MINGW AND BUILD_SHARED_LIBS) +- message(FATAL_ERROR "Building shared libraries on Windows needs MinGW") +-endif() ++#if(WIN32 AND NOT MINGW AND BUILD_SHARED_LIBS) ++# message(FATAL_ERROR "Building shared libraries on Windows needs MinGW") ++#endif() + + add_library(nanodbc nanodbc/nanodbc.cpp nanodbc/nanodbc.h) + diff --git a/recipes/nanodbc/all/test_package/CMakeLists.txt b/recipes/nanodbc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f6bbde9919354 --- /dev/null +++ b/recipes/nanodbc/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/nanodbc/all/test_package/conanfile.py b/recipes/nanodbc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/nanodbc/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nanodbc/all/test_package/test_package.cpp b/recipes/nanodbc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f9d4228096836 --- /dev/null +++ b/recipes/nanodbc/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#include +using namespace nanodbc; + +int main(int /*argc*/, char* /*argv*/[]) +{ + try + { + auto const connection_string = NANODBC_TEXT(""); + connection conn(connection_string); + conn.dbms_name(); + } + catch (std::runtime_error const& e) + { + std::cerr << e.what() << std::endl; + } +} diff --git a/recipes/nanodbc/config.yml b/recipes/nanodbc/config.yml new file mode 100644 index 0000000000000..35d045402c05f --- /dev/null +++ b/recipes/nanodbc/config.yml @@ -0,0 +1,7 @@ +versions: + "cci.20200807": + folder: "all" + "2.13.0": + folder: "all" + "2.14.0": + folder: "all" diff --git a/recipes/nanoflann/all/conandata.yml b/recipes/nanoflann/all/conandata.yml new file mode 100644 index 0000000000000..c3fd08f9f02f0 --- /dev/null +++ b/recipes/nanoflann/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.4.3": + url: "https://github.com/jlblancoc/nanoflann/archive/v1.4.3.tar.gz" + sha256: "cbcecf22bec528a8673a113ee9b0e134f91f1f96be57e913fa1f74e98e4449fa" + "1.4.2": + url: "https://github.com/jlblancoc/nanoflann/archive/refs/tags/v1.4.2.tar.gz" + sha256: "97fce650eb644a359a767af526cab9ba31842e53790a7279887e1ae2fffe7319" + "1.3.2": + url: "https://github.com/jlblancoc/nanoflann/archive/v1.3.2.tar.gz" + sha256: "e100b5fc8d72e9426a80312d852a62c05ddefd23f17cbb22ccd8b458b11d0bea" + "1.3.1": + url: "https://github.com/jlblancoc/nanoflann/archive/v1.3.1.tar.gz" + sha256: "b1b1ac9bf6c3bac284014b326480388ad469bdeca78bd27a34ba2ae1da1a03ff" diff --git a/recipes/nanoflann/all/conanfile.py b/recipes/nanoflann/all/conanfile.py new file mode 100644 index 0000000000000..5e499d9aae48d --- /dev/null +++ b/recipes/nanoflann/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class NanoflannConan(ConanFile): + name = "nanoflann" + description = """nanoflann is a C++11 header-only library for building KD-Trees + of datasets with different topologies: R2, R3 (point clouds), + SO(2) and SO(3) (2D and 3D rotation groups). + """ + topics = ("nanoflann", "nearest-neighbor", "kd-trees") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jlblancoc/nanoflann" + license = "BSD-2-Clause" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + include_folder = os.path.join(self.source_folder, "include") + copy(self, "*", src=include_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "nanoflann") + self.cpp_info.set_property("cmake_target_name", "nanoflann::nanoflann") + self.cpp_info.set_property("pkg_config_name", "nanoflann") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/nanoflann/all/test_package/CMakeLists.txt b/recipes/nanoflann/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f45dd0b28e293 --- /dev/null +++ b/recipes/nanoflann/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(nanoflann REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanoflann::nanoflann) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nanoflann/all/test_package/conanfile.py b/recipes/nanoflann/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/nanoflann/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/nanoflann/all/test_package/test_package.cpp b/recipes/nanoflann/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c3b41e4ed11ed --- /dev/null +++ b/recipes/nanoflann/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "nanoflann.hpp" +#include + +using namespace nanoflann; + +int main() { + + std::cout << NANOFLANN_VERSION << std::endl; + return 0; +} diff --git a/recipes/nanoflann/all/test_v1_package/CMakeLists.txt b/recipes/nanoflann/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8e9967d816e1b --- /dev/null +++ b/recipes/nanoflann/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(nanoflann REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanoflann::nanoflann) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nanoflann/all/test_v1_package/conanfile.py b/recipes/nanoflann/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/nanoflann/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/nanoflann/config.yml b/recipes/nanoflann/config.yml new file mode 100644 index 0000000000000..abdc53043545d --- /dev/null +++ b/recipes/nanoflann/config.yml @@ -0,0 +1,9 @@ +versions: + "1.4.3": + folder: "all" + "1.4.2": + folder: "all" + "1.3.2": + folder: "all" + "1.3.1": + folder: "all" diff --git a/recipes/nanorange/all/conandata.yml b/recipes/nanorange/all/conandata.yml new file mode 100644 index 0000000000000..dd45d10d26868 --- /dev/null +++ b/recipes/nanorange/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20200706": + url: "https://github.com/tcbrindle/NanoRange/archive/bf32251d65673fe170d602777c087786c529ead8.tar.gz" + sha256: "28cf187174b3097c00aa12cc2a3b554f8f768a3b50a9703174af03ee99c3397c" + "cci.20200505": + url: "https://github.com/tcbrindle/NanoRange/archive/a536e2747ba6124f1485dfa6acabca35326b1c5b.tar.gz" + sha256: "9c4b71e6d26cbb85c9bf6751e6c0404922f75701984a85c312c4cf5838f89e2c" diff --git a/recipes/nanorange/all/conanfile.py b/recipes/nanorange/all/conanfile.py new file mode 100644 index 0000000000000..5cab7bccc7168 --- /dev/null +++ b/recipes/nanorange/all/conanfile.py @@ -0,0 +1,70 @@ +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.50.0" + + +class NanorangeConan(ConanFile): + name = "nanorange" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tcbrindle/NanoRange" + description = "NanoRange is a C++17 implementation of the C++20 Ranges proposals (formerly the Ranges TS)." + topics = ("ranges", "C++17", "Ranges TS") + 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": "16", + "msvc": "192", + "gcc": "7", + "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.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_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # https://github.com/tcbrindle/NanoRange/blob/bf32251d65673fe170d602777c087786c529ead8/CMakeLists.txt#L216 + self.cpp_info.set_property("cmake_file_name", "nanorange") + self.cpp_info.set_property("cmake_target_name", "nanorange::nanorange") diff --git a/recipes/nanorange/all/test_package/CMakeLists.txt b/recipes/nanorange/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a3383209f6f68 --- /dev/null +++ b/recipes/nanorange/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(nanorange REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanorange::nanorange) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/nanorange/all/test_package/conanfile.py b/recipes/nanorange/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/nanorange/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nanorange/all/test_package/test_package.cpp b/recipes/nanorange/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a83433671d37b --- /dev/null +++ b/recipes/nanorange/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + int elems[] = { 0, 42, 666}; + return *nano::min_element( elems ); +} diff --git a/recipes/nanorange/all/test_v1_package/CMakeLists.txt b/recipes/nanorange/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd41ac7f45757 --- /dev/null +++ b/recipes/nanorange/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) # if the project uses 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/nanorange/all/test_v1_package/conanfile.py b/recipes/nanorange/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/nanorange/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nanorange/config.yml b/recipes/nanorange/config.yml new file mode 100644 index 0000000000000..f8f01f0c1204d --- /dev/null +++ b/recipes/nanorange/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20200706": + folder: all + "cci.20200505": + folder: all diff --git a/recipes/nanosvg/all/conandata.yml b/recipes/nanosvg/all/conandata.yml new file mode 100644 index 0000000000000..8191482a0d600 --- /dev/null +++ b/recipes/nanosvg/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20210904": + url: "https://github.com/memononen/nanosvg/archive/ccdb1995134d340a93fb20e3a3d323ccb3838dd0.zip" + sha256: "d45fb75b9652f45f3ab4e23e76d77c4a4db02939702d36def6fcd244fb0a44c6" + "20190405": + url: "https://github.com/memononen/nanosvg/archive/3e2a632c29c294e83e773cbb53f8af25d2bee15a.zip" + sha256: "aba32b6de5123480a80ae84dbbb3c08a68bac787e647fd1e1dd5786c3087808a" diff --git a/recipes/nanosvg/all/conanfile.py b/recipes/nanosvg/all/conanfile.py new file mode 100644 index 0000000000000..907d8771861b8 --- /dev/null +++ b/recipes/nanosvg/all/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class NanosvgConan(ConanFile): + name = "nanosvg" + description = "NanoSVG is a simple stupid single-header-file SVG parser." + license = "Zlib" + topics = ("nanosvg", "svg", "parser", "header-only") + homepage = "https://github.com/memononen/nanosvg" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include", "nanosvg")) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "nanosvg")) + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/nanosvg/all/test_package/CMakeLists.txt b/recipes/nanosvg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..581e05411c02f --- /dev/null +++ b/recipes/nanosvg/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(nanosvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE nanosvg::nanosvg) diff --git a/recipes/nanosvg/all/test_package/conanfile.py b/recipes/nanosvg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..621a8ff8e6daf --- /dev/null +++ b/recipes/nanosvg/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + svg_name = os.path.join(self.source_folder, "nano.svg") + self.run(f"{bin_path} {svg_name}", env="conanrun") diff --git a/recipes/nanosvg/all/test_package/nano.svg b/recipes/nanosvg/all/test_package/nano.svg new file mode 100644 index 0000000000000..882830f8df772 --- /dev/null +++ b/recipes/nanosvg/all/test_package/nano.svg @@ -0,0 +1,27 @@ + + + + + + diff --git a/recipes/nanosvg/all/test_package/test_package.c b/recipes/nanosvg/all/test_package/test_package.c new file mode 100644 index 0000000000000..96267b3511ae1 --- /dev/null +++ b/recipes/nanosvg/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include +#define NANOSVG_IMPLEMENTATION +#include + + +int main(int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "Need at least one argument\n"); + return 1; + } + + struct NSVGimage *image = nsvgParseFromFile(argv[1], "px", 96); + printf("size: %f x %f\n", image->width, image->height); + nsvgDelete(image); + + return 0; +} diff --git a/recipes/nanosvg/all/test_v1_package/CMakeLists.txt b/recipes/nanosvg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8f69e251c10a7 --- /dev/null +++ b/recipes/nanosvg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(nanosvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE nanosvg::nanosvg) diff --git a/recipes/nanosvg/all/test_v1_package/conanfile.py b/recipes/nanosvg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e5fed27a4959a --- /dev/null +++ b/recipes/nanosvg/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + svg_name = os.path.join(self.source_folder, os.pardir, "test_package", "nano.svg") + self.run(f"{bin_path} {svg_name}", run_environment=True) diff --git a/recipes/nanosvg/config.yml b/recipes/nanosvg/config.yml new file mode 100644 index 0000000000000..4cfe8bfdf0bc4 --- /dev/null +++ b/recipes/nanosvg/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210904": + folder: all + "20190405": + folder: all diff --git a/recipes/nas/all/conandata.yml b/recipes/nas/all/conandata.yml new file mode 100644 index 0000000000000..1215a1cb1a46d --- /dev/null +++ b/recipes/nas/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.9.5": + - url: "https://downloads.sourceforge.net/nas/nas-1.9.5.tar.gz" + sha256: "b7884afb38feec03a196bd3b7e9c47b803c830ecd10d7455e9c97e122c37944c" + - url: "https://unlicense.org/UNLICENSE" + sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" + "1.9.4": + - url: "https://downloads.sourceforge.net/project/nas/nas/nas%201.9.4%20%28stable%29/nas-1.9.4.src.tar.gz" + sha256: "cf36ea63751ce86cfd3b76c1659ce0d6a361a2e7cb34069854e156532703b39d" + - url: "https://unlicense.org/UNLICENSE" + sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" +patches: + "1.9.4": + - patch_file: "patches/0001-1.9.4-extern-variable-bugfix.patch" + patch_description: "Extern variable to fix bug" + patch_type: "bugfix" diff --git a/recipes/nas/all/conanfile.py b/recipes/nas/all/conanfile.py new file mode 100644 index 0000000000000..a6ece9857a5b2 --- /dev/null +++ b/recipes/nas/all/conanfile.py @@ -0,0 +1,144 @@ +from conan import ConanFile + +from conan.errors import ConanInvalidConfiguration +from conan.tools.layout import basic_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, get, download, export_conandata_patches, apply_conandata_patches, rm, copy +from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps +import os + + +required_conan_version = ">=1.54.0" + + +class NasRecipe(ConanFile): + name = "nas" + description = "The Network Audio System is a network transparent, client/server audio transport system." + topics = ("audio", "sound") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.radscan.com/nas.html" + license = "Unlicense" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def layout(self): + basic_layout(self, src_folder="src") + + 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 export_sources(self): + export_conandata_patches(self) + + def validate(self): + if self.settings.os not in ("FreeBSD", "Linux"): + raise ConanInvalidConfiguration("Recipe supports Linux only") + if self.settings.compiler == "clang": + # See https://github.com/conan-io/conan-center-index/pull/16267#issuecomment-1469824504 + raise ConanInvalidConfiguration("Recipe cannot be built with clang") + + def requirements(self): + self.requires("xorg/system") + + def build_requirements(self): + self.tool_requires("bison/3.7.1") + self.tool_requires("flex/2.6.4") + self.tool_requires("imake/1.0.8") + self.tool_requires("xorg-cf-files/1.0.7") + self.tool_requires("xorg-makedepend/1.0.6") + self.tool_requires("xorg-gccmakedep/1.0.3") + self.tool_requires("gnu-config/cci.20210814") + + def source(self): + get(self, **self.conan_data["sources"][self.version][0], strip_root=True) + # This library does not come with a License file by itself, package it from an external source + download(self, filename="LICENSE", **self.conan_data["sources"][self.version][1]) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def generate(self): + autotools = AutotoolsToolchain(self) + autotools.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + @property + def _imake_irulesrc(self): + return self.conf.get("user.xorg-cf-files:config-path") + + @property + def _imake_defines(self): + return "-DUsrLibDir={}".format(os.path.join(self.package_folder, "lib")) + + @property + def _imake_make_args(self): + return ["IRULESRC={}".format(self._imake_irulesrc), "IMAKE_DEFINES={}".format(self._imake_defines)] + + def build(self): + apply_conandata_patches(self) + + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + config_folder = os.path.join(self.source_folder, "config") + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=config_folder) + + with chdir(self, self.source_folder): + self.run("imake -DUseInstalled -I{} {}".format(self._imake_irulesrc, self._imake_defines), env="conanbuild") + autotools = Autotools(self) + # j1 avoids some errors while trying to run this target + autotools.make(target="World", args=["-j1"] + self._imake_make_args) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + tmp_install = os.path.join(self.build_folder, "prefix") + self.output.warning(tmp_install) + install_args = [ + "DESTDIR={}".format(tmp_install), + "INCDIR=/include", + "ETCDIR=/etc", + "USRLIBDIR=/lib", + "BINDIR=/bin", + ] + self._imake_make_args + with chdir(self, self.source_folder): + autotools = Autotools(self) + # j1 avoids some errors while trying to install + autotools.install(args=["-j1"] + install_args) + + copy(self, "*", src=os.path.join(tmp_install, "bin"), dst=os.path.join(self.package_folder, "bin")) + copy(self, "*.h", src=os.path.join(tmp_install, "include"), dst=os.path.join(self.package_folder, "include", "audio")) + copy(self, "*", src=os.path.join(tmp_install, "lib"), dst=os.path.join(self.package_folder, "lib")) + + # Both are present in the final build and there does not seem to be an obvious way to tell the build system + # to only generate one of them, so remove the unwanted one + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["audio"] + self.cpp_info.requires = ["xorg::xau"] + + 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/nas/all/patches/0001-1.9.4-extern-variable-bugfix.patch b/recipes/nas/all/patches/0001-1.9.4-extern-variable-bugfix.patch new file mode 100644 index 0000000000000..dec6423609c24 --- /dev/null +++ b/recipes/nas/all/patches/0001-1.9.4-extern-variable-bugfix.patch @@ -0,0 +1,13 @@ +diff --git a/server/dia/main.c b/server/dia/main.c +index 83601ae..e5d2287 100644 +--- a/server/dia/main.c ++++ b/server/dia/main.c +@@ -76,7 +76,7 @@ static char *AuServerName(void); + extern char *display; + + static int restart = 0; +-FILE *yyin; /* for the config parser */ ++extern FILE *yyin; /* for the config parser */ + + void + NotImplemented() diff --git a/recipes/nas/all/test_package/CMakeLists.txt b/recipes/nas/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..12f5de7a8d67c --- /dev/null +++ b/recipes/nas/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(nas REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE nas::nas) diff --git a/recipes/nas/all/test_package/conanfile.py b/recipes/nas/all/test_package/conanfile.py new file mode 100644 index 0000000000000..eede891e8102c --- /dev/null +++ b/recipes/nas/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class NasTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/nas/all/test_package/test_package.c b/recipes/nas/all/test_package/test_package.c new file mode 100644 index 0000000000000..836c0d10e54e5 --- /dev/null +++ b/recipes/nas/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include

AQ{bOgEN~m!uhG- zb32d=Ejd*XkHO+(Y+#XT`_X{L>3FT(io?TC`d*-JND1UnTN?oYpp^fX6rJ8YtIPN4 z0Cx9!5aGTd=l6hU?G<_a9aVo{Jnazl;XGm;+kmq^g(nNkDd%HR9Y)(Ighh4U6Qc<4 zTDn51YfSxdy`ZjG-I6^H5%q8rr4{4%?2L=8b>8a>sNro+P@sceh zmIYX;A))t(@eOb`_7$A32ArcT3FD@At7p|)_ZOWg^T-ZP_r2iM3*)73tOtau)+Mr* z*3M5Tj4B>gQ^Yj3moHC>63_-BSOSR=maxfioJG)*qA%?Vv@2PC0W*;l5f;)nKwT=) z7bs$dyqzgWC6-1^=r%T~fJJqFF-F~Berc*rnje-sc{&5IRBlNgsBC>ik1}D!eT1TH zefH|jGtC0mL?2AfMzZ>8vczIrJp-5Q zK3&RtpnXLHag7o8uT*Ad5@!2M{E81@#p|XlL$9qa2ic*8?Dbq2lR#M8hE=>UH-xrc zWaM-e*Z`<|l+!L~N-v@mt_)fskAp@&D3t8gM(3&9@<&7UEYhM_3>3k(dAYMsFuK|5 z^Se7k!_<;r5N$(nFiQ9k{k=G1)%2|;j2@G>=6Z>{tQ*#VV1lmY0I(6Xe@sLOKqs@w zR(b0E_ft%;0W?f?$j&bhV9yOjsLQWp=(S7!+#WUXYf+$el4l@y3sqnVIne5 zp$&D`7H?R3LW3z=uU^9Z?dn25j$i)1VG->7rBIA>fN*K0jLy9Bkq>^dOTpuVz`KiT z+gN+_?=4vx`|DWVB06avZunl2oE~n3>4C?K;Y$}p2(_$@Z+ihvztPJHv+DC+^=B-= zO02NWPOW1(Mmh0^1eY`(?0I?~v{BS-IL!zI%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C9O`%;Fod&{=v0VnGM9&}hn`R%E$xIx~>3IR*0BIIHhcaf4Z7u4VANgrzXwu43bOqK>M_-h4j*{_oo1-#LDN5rp}J#_AK}|7rinJ}934 ziI0Eg$3OW2VgMaKHwYq zTm;%Fz^G3%z*B%DK-&ZOIlu#eL4Y$rs|WlA;4wfqKnlnDm0FYgf%xGH^t*wv^VSkNp(V zAEylfMz%$^2isuLi5~(C10Y$Dt=U?Q$_faU~sq%Z3C0RY)>HDKg# zL`U`nU9rff$i~S3NVhBi84j1s1dI;kWGw&>9)(K+?BYk|V<=*jf82J5t$H?z#iFBz li33j?+uNUaoXbQEXHiJ}!H6lwjuhZ&XsoRVo5Tdd{{e76S8D(O literal 0 HcmV?d00001 diff --git a/recipes/libmediainfo/config.yml b/recipes/libmediainfo/config.yml new file mode 100644 index 0000000000000..b9bb652050b63 --- /dev/null +++ b/recipes/libmediainfo/config.yml @@ -0,0 +1,9 @@ +versions: + "22.03": + folder: "all" + "21.09": + folder: "all" + "21.03": + folder: "all" + "20.03": + folder: "all" diff --git a/recipes/libmetalink/all/conandata.yml b/recipes/libmetalink/all/conandata.yml new file mode 100644 index 0000000000000..abebbdecbec33 --- /dev/null +++ b/recipes/libmetalink/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://github.com/metalink-dev/libmetalink/releases/download/release-0.1.3/libmetalink-0.1.3.tar.xz" + sha256: "86312620c5b64c694b91f9cc355eabbd358fa92195b3e99517504076bf9fe33a" diff --git a/recipes/libmetalink/all/conanfile.py b/recipes/libmetalink/all/conanfile.py new file mode 100644 index 0000000000000..26b6f8a3d9655 --- /dev/null +++ b/recipes/libmetalink/all/conanfile.py @@ -0,0 +1,119 @@ +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 copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.53.0" + + +class LibmetalinkConan(ConanFile): + name = "libmetalink" + description = ( + "Libmetalink is a library to read Metalink XML download description format. " + "It supports both Metalink version 3 and Metalink version 4 (RFC 5854)." + ) + license = "MIT" + topics = ("metalink", "xml") + homepage = "https://launchpad.net/libmetalink" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "xml_backend": ["expat", "libxml2"], + } + default_options = { + "shared": False, + "fPIC": True, + "xml_backend": "expat", + } + + @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): + if self.options.xml_backend == "expat": + self.requires("expat/2.4.9") + elif self.options.xml_backend == "libxml2": + self.requires("libxml2/2.9.14") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio yet") + + def build_requirements(self): + self.tool_requires("gnu-config/cci.20210814") + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--with-libexpat={yes_no(self.options.xml_backend == 'expat')}", + f"--with-libxml2={yes_no(self.options.xml_backend == 'libxml2')}", + "ac_cv_func_malloc_0_nonnull=yes", + ]) + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + # Support more configurations + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + 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", "libmetalink") + self.cpp_info.libs = ["metalink"] diff --git a/recipes/libmetalink/all/test_package/CMakeLists.txt b/recipes/libmetalink/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3327ee2e69390 --- /dev/null +++ b/recipes/libmetalink/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmetalink REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmetalink::libmetalink) diff --git a/recipes/libmetalink/all/test_package/conanfile.py b/recipes/libmetalink/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libmetalink/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/libmetalink/all/test_package/test_package.c b/recipes/libmetalink/all/test_package/test_package.c new file mode 100644 index 0000000000000..acf1ce262b47b --- /dev/null +++ b/recipes/libmetalink/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main(void) { + int major, minor, patch; + metalink_get_version(&major, &minor, &patch); + printf("libmetalink version %i.%i.%i\n", major, minor, patch); + return 0; +} diff --git a/recipes/libmetalink/all/test_v1_package/CMakeLists.txt b/recipes/libmetalink/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmetalink/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmetalink/all/test_v1_package/conanfile.py b/recipes/libmetalink/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmetalink/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/libmetalink/config.yml b/recipes/libmetalink/config.yml new file mode 100644 index 0000000000000..b7f57204004e4 --- /dev/null +++ b/recipes/libmetalink/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/libmicrohttpd/all/conandata.yml b/recipes/libmicrohttpd/all/conandata.yml new file mode 100644 index 0000000000000..ead353a01eb87 --- /dev/null +++ b/recipes/libmicrohttpd/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.9.75": + url: "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.75.tar.gz" + sha256: "9278907a6f571b391aab9644fd646a5108ed97311ec66f6359cebbedb0a4e3bb" +patches: + "0.9.75": + - patch_file: "patches/0.9.75-0001-allow-release-with-debug-runtime.patch" + patch_description: "Allow to build Release with Debug runtime" + patch_type: "conan" diff --git a/recipes/libmicrohttpd/all/conanfile.py b/recipes/libmicrohttpd/all/conanfile.py new file mode 100644 index 0000000000000..82ca43a61b7ad --- /dev/null +++ b/recipes/libmicrohttpd/all/conanfile.py @@ -0,0 +1,192 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildToolchain +import os + +required_conan_version = ">=1.54.0" + + +class LibmicrohttpdConan(ConanFile): + name = "libmicrohttpd" + description = "A small C library that is supposed to make it easy to run an HTTP server" + homepage = "https://www.gnu.org/software/libmicrohttpd/" + topics = ("httpd", "server", "service") + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_https": [True, False], + "with_error_messages": [True, False], + "with_postprocessor": [True, False], + "with_digest_authentification": [True, False], + "epoll": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_https": False, # FIXME: should be True, but gnutls is not yet available in cci + "with_error_messages": True, + "with_postprocessor": True, + "with_digest_authentification": True, + "epoll": True, + "with_zlib": 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 + if self.settings.os != "Linux": + del self.options.epoll + if is_msvc(self): + del self.options.with_https + del self.options.with_error_messages + del self.options.with_postprocessor + del self.options.with_digest_authentification + del self.options.with_zlib + + 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_zlib"): + self.requires("zlib/1.2.13") + + def validate(self): + if is_msvc(self) and self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("Unsupported architecture (only x86 and x86_64 are supported)") + if self.options.get_safe("with_https"): + raise ConanInvalidConfiguration("gnutls is not (yet) available in cci") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msvc_configuration + tc.properties["WholeProgramOptimization"] = "false" + tc.generate() + else: + VirtualBuildEnv(self).generate() + if not cross_building(self): + VirtualRunEnv(self).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)}", + f"--enable-https={yes_no(self.options.with_https)}", + f"--enable-messages={yes_no(self.options.with_error_messages)}", + f"--enable-postprocessor={yes_no(self.options.with_postprocessor)}", + f"--enable-dauth={yes_no(self.options.with_digest_authentification)}", + f"--enable-epoll={yes_no(self.options.get_safe('epoll'))}", + "--disable-doc", + "--disable-examples", + "--disable-curl", + ]) + tc.generate() + AutotoolsDeps(self).generate() + + @property + def _msvc_configuration(self): + prefix = "Debug" if self.settings.build_type == "Debug" else "Release" + suffix = "dll" if self.options.shared else "static" + return f"{prefix}-{suffix}" + + @property + def _msvc_sln_folder(self): + # TODO: use VS-Any-Version folder once https://github.com/conan-io/conan/pull/12817 available in conan client + return os.path.join(self.source_folder, "w32", "VS2022") + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + vcxproj_file = os.path.join(self._msvc_sln_folder, "libmicrohttpd.vcxproj") + replace_in_file( + self, vcxproj_file, + "true", + "", + ) + toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, vcxproj_file, + "v143", + f"{toolset}", + ) + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, vcxproj_file, + "", + f"", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msvc_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(sln=os.path.join(self._msvc_sln_folder, "libmicrohttpd.sln"), targets=["libmicrohttpd"]) + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + output_dir = os.path.join(self._msvc_sln_folder, "Output") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.h", src=output_dir, dst=os.path.join(self.package_folder, "include"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmicrohttps") + libname = "microhttpd" + if is_msvc(self): + libname = "libmicrohttpd" + if self.options.shared: + libname += "-dll" + if self.settings.build_type == "Debug": + libname += "_d" + self.cpp_info.libs = [libname] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.defines.append("MHD_W32DLL") + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libmicrohttpd/all/patches/0.9.75-0001-allow-release-with-debug-runtime.patch b/recipes/libmicrohttpd/all/patches/0.9.75-0001-allow-release-with-debug-runtime.patch new file mode 100644 index 0000000000000..1f25b932b8a7a --- /dev/null +++ b/recipes/libmicrohttpd/all/patches/0.9.75-0001-allow-release-with-debug-runtime.patch @@ -0,0 +1,11 @@ +--- src/microhttpd/mhd_assert.h ++++ src/microhttpd/mhd_assert.h +@@ -35,7 +35,7 @@ + #define NDEBUG 1 /* Use NDEBUG by default */ + #endif /* !_DEBUG && !NDEBUG */ + #if defined(_DEBUG) && defined(NDEBUG) +-#error Both _DEBUG and NDEBUG are defined ++//#error Both _DEBUG and NDEBUG are defined + #endif /* _DEBUG && NDEBUG */ + #ifdef NDEBUG + # define mhd_assert(ignore) ((void) 0) diff --git a/recipes/libmicrohttpd/all/test_package/CMakeLists.txt b/recipes/libmicrohttpd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..534adba0c584f --- /dev/null +++ b/recipes/libmicrohttpd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmicrohttpd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmicrohttpd::libmicrohttpd) diff --git a/recipes/libmicrohttpd/all/test_package/conanfile.py b/recipes/libmicrohttpd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libmicrohttpd/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmicrohttpd/all/test_package/test_package.c b/recipes/libmicrohttpd/all/test_package/test_package.c new file mode 100644 index 0000000000000..cb40829c7a43b --- /dev/null +++ b/recipes/libmicrohttpd/all/test_package/test_package.c @@ -0,0 +1,74 @@ +#include +#include +#include +#include + +#define PORT 8888 +#define PAGE \ + "" \ + "" \ + "libmicrohttpd demo" \ + "" \ + "" \ + "libmicrohttpd demo" \ + "" \ + "" + +static enum MHD_Result ahc_echo(void * cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + long unsigned int *upload_data_size, + void **con_cls) { + struct MHD_Response *response; + int ret; + + if (strcmp(method, "GET") != 0) { + /** + * unexpected method + */ + return MHD_NO; + } + if (*con_cls == NULL) { + /** + * The first time only the headers are valid, + * do not respond in the first round. + * But accept the connection. + */ + *con_cls = connection; + return MHD_YES; + } + if (*upload_data_size != 0) { + /** + * upload data in a GET!? + */ + return MHD_NO; + } + response = MHD_create_response_from_buffer(strlen(PAGE), (void*)PAGE, MHD_RESPMEM_PERSISTENT); + ret = MHD_queue_response(connection, MHD_HTTP_OK, response); + MHD_destroy_response(response); + return ret; +} + +int main(int argc, char *argv[]) { + struct MHD_Daemon *daemon; + + // Don't open a port and do not block so CI isn't interrupted. +#if 0 + daemon = MHD_start_daemon(MHD_USE_INTERNAL_POLLING_THREAD, + PORT, NULL, NULL, + &ahc_echo, NULL, MHD_OPTION_END); + if (daemon == NULL) { + return 1; + } + + (void)getchar(); +#else + daemon = NULL; +#endif + + MHD_stop_daemon(daemon); + return 0; +} diff --git a/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt b/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmicrohttpd/all/test_v1_package/conanfile.py b/recipes/libmicrohttpd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmicrohttpd/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/libmicrohttpd/config.yml b/recipes/libmicrohttpd/config.yml new file mode 100644 index 0000000000000..48e6a23d34df6 --- /dev/null +++ b/recipes/libmicrohttpd/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.75": + folder: all diff --git a/recipes/libmikmod/all/CMakeLists.txt b/recipes/libmikmod/all/CMakeLists.txt new file mode 100644 index 0000000000000..8bdaa1e47bfa0 --- /dev/null +++ b/recipes/libmikmod/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libmikmod/all/conandata.yml b/recipes/libmikmod/all/conandata.yml new file mode 100644 index 0000000000000..8104d18a62f26 --- /dev/null +++ b/recipes/libmikmod/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "3.3.11.1": + url: "https://sourceforge.net/projects/mikmod/files/libmikmod/3.3.11.1/libmikmod-3.3.11.1.tar.gz" + sha256: "ad9d64dfc8f83684876419ea7cd4ff4a41d8bcd8c23ef37ecb3a200a16b46d19" +patches: + "3.3.11.1": + - base_path: "source_subfolder" + patch_file: "patches/0001-CMakeLists.txt.patch" diff --git a/recipes/libmikmod/all/conanfile.py b/recipes/libmikmod/all/conanfile.py new file mode 100644 index 0000000000000..1d04522f0806a --- /dev/null +++ b/recipes/libmikmod/all/conanfile.py @@ -0,0 +1,131 @@ +from conans import ConanFile, CMake, tools +import os + + +class LibmikmodConan(ConanFile): + name = "libmikmod" + description = "Module player and library supporting many formats, including mod, s3m, it, and xm." + topics = ("libmikmod", "audio") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://mikmod.sourceforge.net" + license = "LGPL-2.1-or-later" + exports_sources = ["patches/*", "CMakeLists.txt"] + generators = "cmake" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_dsound": [True, False], + "with_mmsound": [True, False], + "with_alsa": [True, False], + "with_oss": [True, False], + "with_pulse": [True, False], + "with_coreaudio": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_dsound": True, + "with_mmsound": True, + "with_alsa": True, + "with_oss": True, + "with_pulse": True, + "with_coreaudio": True + } + + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + + _cmake = None + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.with_dsound + del self.options.with_mmsound + if self.settings.os != "Linux": + del self.options.with_alsa + # Non-Apple Unices + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_oss + del self.options.with_pulse + # Apple + if tools.is_apple_os(self.settings.os): + del self.options.with_coreaudio + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.settings.os == "Linux": + if self.options.with_alsa: + self.requires("libalsa/1.2.7.2") + if self.options.with_pulse: + self.requires("pulseaudio/14.2") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self, set_cmake_flags=True) + self._cmake.definitions["ENABLE_STATIC"] = not self.options.shared + self._cmake.definitions["ENABLE_DOC"] = False + self._cmake.definitions["ENABLE_DSOUND"] = self.options.get_safe("with_dsound", False) + self._cmake.definitions["ENABLE_MMSOUND"] = self.options.get_safe("with_mmsound", False) + self._cmake.definitions["ENABLE_ALSA"] = self.options.get_safe("with_alsa", False) + self._cmake.definitions["ENABLE_OSS"] = self.options.get_safe("with_oss", False) + self._cmake.definitions["ENABLE_PULSE"] = self.options.get_safe("with_pulse", False) + self._cmake.definitions["ENABLE_COREAUDIO"] = self.options.get_safe("with_coreaudio", False) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "CMAKE_SOURCE_DIR", + "PROJECT_SOURCE_DIR") + + # Ensure missing dependencies yields errors + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "MESSAGE(WARNING", + "MESSAGE(FATAL_ERROR") + + tools.replace_in_file(os.path.join(self._source_subfolder, "drivers", "drv_alsa.c"), + "alsa_pcm_close(pcm_h);", + "if (pcm_h) alsa_pcm_close(pcm_h);") + + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYING.LESSER", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + os.remove(os.path.join(self.package_folder, "bin", "libmikmod-config")) + if not self.options.shared: + tools.rmdir(os.path.join(self.package_folder, "bin")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if not self.options.shared: + self.cpp_info.defines = ["MIKMOD_STATIC"] + self.cpp_info.filenames["pkg_config"] = "libmikmod" + + if self.options.get_safe("with_dsound"): + self.cpp_info.system_libs.append("dsound") + if self.options.get_safe("with_mmsound"): + self.cpp_info.system_libs.append("winmm") + if self.options.get_safe("with_coreaudio"): + self.cpp_info.frameworks.append("CoreAudio") diff --git a/recipes/libmikmod/all/patches/0001-CMakeLists.txt.patch b/recipes/libmikmod/all/patches/0001-CMakeLists.txt.patch new file mode 100644 index 0000000000000..a6c87e4f1e4da --- /dev/null +++ b/recipes/libmikmod/all/patches/0001-CMakeLists.txt.patch @@ -0,0 +1,56 @@ +avoid building shared lib when shared=False, +and a fix to install .dlls correctly on Windows +--- "CMakeLists.txt" 2017-04-07 16:55:00.000000000 +0200 ++++ CMakeLists.txt 2017-07-21 20:01:33.330845600 +0200 +@@ -389,12 +391,6 @@ + + SET (LIBMIKMOD_LIBS) + +-ADD_LIBRARY (mikmod +- SHARED +- ${MIKMOD_LIB_MODULES} +- ) +- +-LIST (APPEND LIBMIKMOD_LIBS "mikmod") + IF (ENABLE_STATIC) + ADD_LIBRARY (mikmod-static + STATIC +@@ -410,16 +406,22 @@ + ${LIBMIKMOD_LIBS} + PROPERTIES CLEAN_DIRECT_OUTPUT 1 + ) +-ENDIF (ENABLE_STATIC) +- +-SET_TARGET_PROPERTIES(mikmod +- PROPERTIES VERSION 3.3.0 SOVERSION 3 +-) +-IF(WIN32) ++ELSE (ENABLE_STATIC) ++ ADD_LIBRARY (mikmod ++ SHARED ++ ${MIKMOD_LIB_MODULES} ++ ) ++ LIST (APPEND LIBMIKMOD_LIBS "mikmod") + SET_TARGET_PROPERTIES(mikmod +- PROPERTIES DEFINE_SYMBOL DLL_EXPORT ++ PROPERTIES VERSION 3.3.0 SOVERSION 3 + ) +-ENDIF(WIN32) ++ IF(WIN32) ++ SET_TARGET_PROPERTIES(mikmod ++ PROPERTIES DEFINE_SYMBOL DLL_EXPORT ++ ) ++ ENDIF(WIN32) ++ENDIF (ENABLE_STATIC) ++ + + IF(DISABLE_HQMIXER) + SET(NO_HQMIXER 1) +@@ -854,6 +856,7 @@ + TARGETS ${LIBMIKMOD_LIBS} + LIBRARY DESTINATION "lib${LIB_SUFFIX}" + ARCHIVE DESTINATION "lib${LIB_SUFFIX}" ++ RUNTIME DESTINATION "bin${LIB_SUFFIX}" + ) + + INSTALL( diff --git a/recipes/libmikmod/all/test_package/CMakeLists.txt b/recipes/libmikmod/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..afa2476357074 --- /dev/null +++ b/recipes/libmikmod/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +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/libmikmod/all/test_package/conanfile.py b/recipes/libmikmod/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/libmikmod/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libmikmod/all/test_package/test_package.c b/recipes/libmikmod/all/test_package/test_package.c new file mode 100644 index 0000000000000..e3af4eb22fb80 --- /dev/null +++ b/recipes/libmikmod/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#define _CRT_SECURE_NO_WARNINGS +#include +#include + +int main() +{ + int err; + // register all the drivers + MikMod_RegisterAllDrivers(); + + // initialize the library + if (err = MikMod_Init("")) { + printf("Couldn't initialize sound, error %d, reason: %s\n", err, MikMod_strerror(MikMod_errno)); + return 0; + } + + // cleanup + MikMod_Exit(); + return 0; +} diff --git a/recipes/libmikmod/config.yml b/recipes/libmikmod/config.yml new file mode 100644 index 0000000000000..02b3c3df235f6 --- /dev/null +++ b/recipes/libmikmod/config.yml @@ -0,0 +1,3 @@ +versions: + "3.3.11.1": + folder: all diff --git a/recipes/libmnl/all/conandata.yml b/recipes/libmnl/all/conandata.yml new file mode 100644 index 0000000000000..bde6a08f3c7d1 --- /dev/null +++ b/recipes/libmnl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.4": + sha256: 171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81 + url: https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2 diff --git a/recipes/libmnl/all/conanfile.py b/recipes/libmnl/all/conanfile.py new file mode 100644 index 0000000000000..14628c1889b0d --- /dev/null +++ b/recipes/libmnl/all/conanfile.py @@ -0,0 +1,63 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.29.1" + +class LibmnlConan(ConanFile): + name = "libmnl" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://netfilter.org/projects/libmnl/index.html" + description = "Minimalistic Netlink communication library" + topics = ("libmnl", "netlink") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libmnl is only supported on Linux") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + conf_args = [] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["mnl"] diff --git a/recipes/libmnl/all/test_package/CMakeLists.txt b/recipes/libmnl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4fdee1a8a79c --- /dev/null +++ b/recipes/libmnl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/libmnl/all/test_package/conanfile.py b/recipes/libmnl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..58e0d68615142 --- /dev/null +++ b/recipes/libmnl/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class LibmnlTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libmnl/all/test_package/example.cpp b/recipes/libmnl/all/test_package/example.cpp new file mode 100644 index 0000000000000..31322f0389e86 --- /dev/null +++ b/recipes/libmnl/all/test_package/example.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() { + struct mnl_socket *nl = mnl_socket_open(NETLINK_NETFILTER); + if (nl == NULL) { + std::cerr << "mnl_socket_open\n"; + return EXIT_FAILURE; + } + mnl_socket_close(nl); + + return EXIT_SUCCESS; +} diff --git a/recipes/libmnl/config.yml b/recipes/libmnl/config.yml new file mode 100644 index 0000000000000..33bdc0114d503 --- /dev/null +++ b/recipes/libmnl/config.yml @@ -0,0 +1,3 @@ +versions: + 1.0.4: + folder: all diff --git a/recipes/libmodbus/all/conandata.yml b/recipes/libmodbus/all/conandata.yml new file mode 100644 index 0000000000000..176711066e07f --- /dev/null +++ b/recipes/libmodbus/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "3.1.8": + url: "https://github.com/stephane/libmodbus/releases/download/v3.1.8/libmodbus-3.1.8.tar.gz" + sha256: "b122f2bc29f749702a22c0a760a7ca2182d541f5fa26bf25e3431f907b606f3c" + "3.1.6": + url: "https://libmodbus.org/releases/libmodbus-3.1.6.tar.gz" + sha256: "d7d9fa94a16edb094e5fdf5d87ae17a0dc3f3e3d687fead81835d9572cf87c16" +patches: + "3.1.8": + - patch_file: "patches/3.1.8-0001-msvc-fixes.patch" + "3.1.6": + - patch_file: "patches/3.1.6-0001-msvc-fixes.patch" diff --git a/recipes/libmodbus/all/conanfile.py b/recipes/libmodbus/all/conanfile.py new file mode 100644 index 0000000000000..a83ac1acd367a --- /dev/null +++ b/recipes/libmodbus/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.57.0" + + +class LibmodbusConan(ConanFile): + name = "libmodbus" + description = "libmodbus is a free software library to send/receive data according to the Modbus protocol" + homepage = "https://libmodbus.org/" + topics = ("modbus", "protocol", "industry", "automation") + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if is_msvc(self): + self.tool_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if Version(self.version) < "3.1.8": + tc.configure_args.append("--without-documentation") + tc.configure_args.append("--disable-tests") + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "compile")) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + if not self.options.shared: + for decl in ("__declspec(dllexport)", "__declspec(dllimport)"): + replace_in_file(self, os.path.join(self.source_folder, "src", "modbus.h"), decl, "") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + 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) + if is_msvc(self) and self.options.shared: + rename(self, + os.path.join(self.package_folder, "lib", "modbus.dll.lib"), + os.path.join(self.package_folder, "lib", "modbus.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmodbus") + self.cpp_info.libs = ["modbus"] + self.cpp_info.includedirs.append(os.path.join("include", "modbus")) + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.system_libs = ["ws2_32", "wsock32"] diff --git a/recipes/libmodbus/all/patches/3.1.6-0001-msvc-fixes.patch b/recipes/libmodbus/all/patches/3.1.6-0001-msvc-fixes.patch new file mode 100644 index 0000000000000..de64a8e50f76f --- /dev/null +++ b/recipes/libmodbus/all/patches/3.1.6-0001-msvc-fixes.patch @@ -0,0 +1,22 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -327,7 +327,7 @@ + localstatedir = @localstatedir@ + mandir = @mandir@ + mkdir_p = @mkdir_p@ +-my_CFLAGS = @my_CFLAGS@ ++my_CFLAGS = + oldincludedir = @oldincludedir@ + pdfdir = @pdfdir@ + prefix = @prefix@ +--- src/modbus-private.h ++++ src/modbus-private.h +@@ -13,7 +13,7 @@ + #else + # include "stdint.h" + # include +-typedef int ssize_t; ++//typedef int ssize_t; + #endif + #include + #include diff --git a/recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch b/recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch new file mode 100644 index 0000000000000..376a6b3f1ea82 --- /dev/null +++ b/recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch @@ -0,0 +1,22 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -326,7 +326,7 @@ + localstatedir = @localstatedir@ + mandir = @mandir@ + mkdir_p = @mkdir_p@ +-my_CFLAGS = @my_CFLAGS@ ++my_CFLAGS = + oldincludedir = @oldincludedir@ + pdfdir = @pdfdir@ + prefix = @prefix@ +--- src/modbus-private.h ++++ src/modbus-private.h +@@ -13,7 +13,7 @@ + #else + # include "stdint.h" + # include +-typedef int ssize_t; ++//typedef int ssize_t; + #endif + #include + #include diff --git a/recipes/libmodbus/all/test_package/CMakeLists.txt b/recipes/libmodbus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..589d598cde656 --- /dev/null +++ b/recipes/libmodbus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +find_package(libmodbus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmodbus::libmodbus) + diff --git a/recipes/libmodbus/all/test_package/conanfile.py b/recipes/libmodbus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49ea0c6cecc47 --- /dev/null +++ b/recipes/libmodbus/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", "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/libmodbus/all/test_package/test_package.c b/recipes/libmodbus/all/test_package/test_package.c new file mode 100644 index 0000000000000..e9bd9b1a77ac6 --- /dev/null +++ b/recipes/libmodbus/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include +#include + +int main() { + if (modbus_get_slave(NULL) != -1) { + fprintf(stderr, "modbus_get_slave(NULL) failed\n"); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/libmodbus/all/test_v1_package/CMakeLists.txt b/recipes/libmodbus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmodbus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmodbus/all/test_v1_package/conanfile.py b/recipes/libmodbus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a691174f8ed16 --- /dev/null +++ b/recipes/libmodbus/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/libmodbus/config.yml b/recipes/libmodbus/config.yml new file mode 100644 index 0000000000000..49c098a9b7d41 --- /dev/null +++ b/recipes/libmodbus/config.yml @@ -0,0 +1,5 @@ +versions: + "3.1.8": + folder: all + "3.1.6": + folder: all diff --git a/recipes/libmodplug/all/conandata.yml b/recipes/libmodplug/all/conandata.yml new file mode 100644 index 0000000000000..73d80ebfe882c --- /dev/null +++ b/recipes/libmodplug/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.8.9.0": + url: "https://github.com/Konstanty/libmodplug/archive/5a39f5913d07ba3e61d8d5afdba00b70165da81d.zip" + sha256: "12d12362428ebcefd473e56ff94faa6ee5c066b777e153d2bbca15c1e379d1bc" +patches: + "0.8.9.0": + - patch_file: "patches/0001-cmake-install-dll.patch" + - patch_file: "patches/0002-cpp17-compat.patch" + patch_description: "C++17 support" + patch_type: portability diff --git a/recipes/libmodplug/all/conanfile.py b/recipes/libmodplug/all/conanfile.py new file mode 100644 index 0000000000000..93a23cc96d6aa --- /dev/null +++ b/recipes/libmodplug/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class LibmodplugConan(ConanFile): + name = "libmodplug" + description = "libmodplug - the library which was part of the Modplug-xmms project" + topics = ("auduo", "multimedia", "sound", "music", "mod", "mod music", "tracket music") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://modplug-xmms.sourceforge.net" + license = "Unlicense" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.preprocessor_definitions["HAVE_STDINT_H"] = 1 + tc.preprocessor_definitions["HAVE_SINF"] = 1 + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmodplug") + self.cpp_info.libs = ["modplug"] + self.cpp_info.includedirs.append(os.path.join("include", "libmodplug")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m"]) + if not self.options.shared: + self.cpp_info.defines.append("MODPLUG_STATIC") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/libmodplug/all/patches/0001-cmake-install-dll.patch b/recipes/libmodplug/all/patches/0001-cmake-install-dll.patch new file mode 100644 index 0000000000000..f37402e012f91 --- /dev/null +++ b/recipes/libmodplug/all/patches/0001-cmake-install-dll.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,7 +109,7 @@ add_library(modplug ${LIB_TYPE} + ) + + # install the library: +-install(TARGETS modplug DESTINATION lib) ++install(TARGETS modplug RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + + # incstall the headers: + install(FILES diff --git a/recipes/libmodplug/all/patches/0002-cpp17-compat.patch b/recipes/libmodplug/all/patches/0002-cpp17-compat.patch new file mode 100644 index 0000000000000..599cdcc293536 --- /dev/null +++ b/recipes/libmodplug/all/patches/0002-cpp17-compat.patch @@ -0,0 +1,20 @@ +--- a/src/fastmix.cpp ++++ b/src/fastmix.cpp +@@ -288,7 +288,7 @@ CzWINDOWEDFIR sfir; + // MIXING MACROS + // ---------------------------------------------------------------------------- + #define SNDMIX_BEGINSAMPLELOOP8\ +- register MODCHANNEL * const pChn = pChannel;\ ++ MODCHANNEL * const pChn = pChannel;\ + nPos = pChn->nPosLo;\ + const signed char *p = (signed char *)(pChn->pCurrentSample+pChn->nPos);\ + if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\ +@@ -296,7 +296,7 @@ CzWINDOWEDFIR sfir; + do { + + #define SNDMIX_BEGINSAMPLELOOP16\ +- register MODCHANNEL * const pChn = pChannel;\ ++ MODCHANNEL * const pChn = pChannel;\ + nPos = pChn->nPosLo;\ + const signed short *p = (signed short *)(pChn->pCurrentSample+(pChn->nPos*2));\ + if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\ diff --git a/recipes/libmodplug/all/test_package/CMakeLists.txt b/recipes/libmodplug/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2701aecd76f11 --- /dev/null +++ b/recipes/libmodplug/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmodplug REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmodplug::libmodplug) diff --git a/recipes/libmodplug/all/test_package/conanfile.py b/recipes/libmodplug/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libmodplug/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/libmodplug/all/test_package/test_package.c b/recipes/libmodplug/all/test_package/test_package.c new file mode 100644 index 0000000000000..6658ff355ef8d --- /dev/null +++ b/recipes/libmodplug/all/test_package/test_package.c @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include + +/* https://github.com/lclevy/unmo3/blob/master/spec/xm.txt */ + +#pragma pack(push, 1) + +typedef struct xm_t +{ + char id_text[17]; + char module_name[20]; + char nl; + char tracker_name[20]; + uint16_t version; + uint32_t header_size; + uint16_t song_length; + uint16_t restart_position; + uint16_t number_of_channels; + uint16_t number_of_patterns; + uint16_t number_of_instruments; + uint16_t flags; + uint16_t default_tempo; + uint16_t default_bmp; + uint8_t pattern_order_table[256]; +} +xm_t; + +#pragma pack(pop) + +#define SIZE 0x200 + +int main(int argc, char * const argv[]) +{ + unsigned char b[SIZE]; + FILE * f = NULL; + long fsize = 0; + ModPlugFile * m = NULL; + xm_t * xm = (xm_t*) b; + memset(b, 0, SIZE); + + memcpy(xm->id_text, "Extended Module:", 17); + memcpy(xm->module_name, "My Module ", 20); + xm->nl = 0x1A; + memcpy(xm->tracker_name, "FastTracker II ", 20); + xm->version = 0x0103; + xm->header_size = sizeof(xm_t); + xm->song_length = 1; + xm->restart_position = 0; + xm->number_of_channels = 2; + xm->number_of_patterns = 0; + xm->number_of_instruments = 0; + xm->flags = 1; + xm->default_tempo = 1; + xm->default_bmp = 1; + + m = ModPlug_Load(b, SIZE); + if (!m) + { + return -4; + } + printf("name: %s\n", ModPlug_GetName(m)); + printf("length: %d ms\n", (int) ModPlug_GetLength(m)); + + ModPlug_Unload(m); + return 0; +} diff --git a/recipes/libmodplug/all/test_v1_package/CMakeLists.txt b/recipes/libmodplug/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmodplug/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmodplug/all/test_v1_package/conanfile.py b/recipes/libmodplug/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmodplug/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/libmodplug/config.yml b/recipes/libmodplug/config.yml new file mode 100644 index 0000000000000..1f954ad16a97b --- /dev/null +++ b/recipes/libmodplug/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.9.0": + folder: all diff --git a/recipes/libmorton/all/conandata.yml b/recipes/libmorton/all/conandata.yml new file mode 100644 index 0000000000000..388df27940d46 --- /dev/null +++ b/recipes/libmorton/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.2.11": + url: "https://github.com/Forceflow/libmorton/archive/refs/tags/v0.2.11.tar.gz" + sha256: "3650ce8eb3deee28bc580e5bb1594fe07f7a33aa2531490bf09b5ab8207d55f6" + "0.2.10": + url: "https://github.com/Forceflow/libmorton/archive/refs/tags/v0.2.10.tar.gz" + sha256: "5f4a8dbf350222b0bec35ad1bee6b76fa22e16ea364e1e80ca47d8f5a7210d6f" + "0.2.9": + url: "https://github.com/Forceflow/libmorton/archive/refs/tags/v0.2.9.tar.gz" + sha256: "a3c86360a6cb97bfcad60216d44f30870e9d20c6f62610c4617a74bf678c9cc8" + "0.2.7": + url: "https://github.com/Forceflow/libmorton/archive/refs/tags/v0.2.7.tar.gz" + sha256: "02bf640732750a5db638991b9f63049252f9656ef52a00d30d2a90df542b9ecf" + "0.2.6": + url: "https://github.com/Forceflow/libmorton/archive/v0.2.6.tar.gz" + sha256: "466e31af19b49399426a860107f7fe9336ee784e46e49070959b3ac300f0d90d" + "0.2.5": + url: "https://github.com/Forceflow/libmorton/archive/v0.2.5.tar.gz" + sha256: "744c64e598a753928b7b643347ab36d89ddc36e786453028238aa8f3515399f6" +patches: + "0.2.5": + - patch_file: "patches/missing-includes.patch" diff --git a/recipes/libmorton/all/conanfile.py b/recipes/libmorton/all/conanfile.py new file mode 100644 index 0000000000000..3c93b1613e056 --- /dev/null +++ b/recipes/libmorton/all/conanfile.py @@ -0,0 +1,53 @@ +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.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class LibmortonConan(ConanFile): + name = "libmorton" + description = "C++ header-only library with methods to efficiently " \ + "encode/decode 64, 32 and 16-bit Morton codes and coordinates, in 2D and 3D." + license = "MIT" + topics = ("morton", "encoding", "decoding") + homepage = "https://github.com/Forceflow/libmorton" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "0.2.7": + src_hdrs = os.path.join(self.source_folder, "libmorton", "include") + elif Version(self.version) < "0.2.8": + src_hdrs = os.path.join(self.source_folder, "libmorton") + else: + src_hdrs = os.path.join(self.source_folder, "include", "libmorton") + copy(self, "*.h", src=src_hdrs, dst=os.path.join(self.package_folder, "include", "libmorton")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libmorton") + self.cpp_info.set_property("cmake_target_name", "libmorton::libmorton") + self.cpp_info.set_property("pkg_config_name", "libmorton") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libmorton/all/patches/missing-includes.patch b/recipes/libmorton/all/patches/missing-includes.patch new file mode 100644 index 0000000000000..8a1872e04403c --- /dev/null +++ b/recipes/libmorton/all/patches/missing-includes.patch @@ -0,0 +1,20 @@ +--- a/libmorton/include/morton2D.h ++++ b/libmorton/include/morton2D.h +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include "morton2D_LUTs.h" + #include "morton_common.h" + +--- a/libmorton/include/morton3D.h ++++ b/libmorton/include/morton3D.h +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include "morton3D_LUTs.h" + #include "morton_common.h" + diff --git a/recipes/libmorton/all/test_package/CMakeLists.txt b/recipes/libmorton/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..375f2c7456c98 --- /dev/null +++ b/recipes/libmorton/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(libmorton REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libmorton::libmorton) diff --git a/recipes/libmorton/all/test_package/conanfile.py b/recipes/libmorton/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libmorton/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/libmorton/all/test_package/test_package.cpp b/recipes/libmorton/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f80ea584ebb2e --- /dev/null +++ b/recipes/libmorton/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << libmorton::morton3D_64_encode(1, 2, 3) << std::endl; + return 0; +} diff --git a/recipes/libmorton/all/test_v1_package/CMakeLists.txt b/recipes/libmorton/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmorton/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmorton/all/test_v1_package/conanfile.py b/recipes/libmorton/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmorton/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/libmorton/config.yml b/recipes/libmorton/config.yml new file mode 100644 index 0000000000000..88387c424a149 --- /dev/null +++ b/recipes/libmorton/config.yml @@ -0,0 +1,13 @@ +versions: + "0.2.11": + folder: all + "0.2.10": + folder: all + "0.2.9": + folder: all + "0.2.7": + folder: all + "0.2.6": + folder: all + "0.2.5": + folder: all diff --git a/recipes/libmount/all/conandata.yml b/recipes/libmount/all/conandata.yml new file mode 100644 index 0000000000000..5bf946443eb38 --- /dev/null +++ b/recipes/libmount/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.36.2": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.2.tar.xz" + sha256: "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f" + "2.36": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.tar.xz" + sha256: "9e4b1c67eb13b9b67feb32ae1dc0d50e08ce9e5d82e1cccd0ee771ad2fa9e0b1" + "2.33.1": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.33/util-linux-2.33.1.tar.xz" + sha256: "c14bd9f3b6e1792b90db87696e87ec643f9d63efa0a424f092a5a6b2f2dbef21" diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py new file mode 100644 index 0000000000000..8152bd466af26 --- /dev/null +++ b/recipes/libmount/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibmountConan(ConanFile): + name = "libmount" + description = ( + "The libmount library is used to parse /etc/fstab, /etc/mtab and " + "/proc/self/mountinfo files, manage the mtab file, evaluate mount options, etc" + ) + topics = ("mount", "linux", "util-linux") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git" + license = "GPL-2.0-or-later" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def configure(self): + if self.options.shared: + del self.options.fPIC + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-all-programs", + "--enable-libmount", + "--enable-libblkid", + ]) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "sbin")) + 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, "usr")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["mount", "blkid"] + self.cpp_info.system_libs = ["rt"] + self.cpp_info.includedirs.append(os.path.join("include", "libmount")) + self.cpp_info.set_property("pkg_config_name", "mount") diff --git a/recipes/libmount/all/test_package/CMakeLists.txt b/recipes/libmount/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79b7610d1fb9b --- /dev/null +++ b/recipes/libmount/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmount REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmount::libmount) diff --git a/recipes/libmount/all/test_package/conanfile.py b/recipes/libmount/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libmount/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/libmount/all/test_package/test_package.c b/recipes/libmount/all/test_package/test_package.c new file mode 100644 index 0000000000000..d4e4d653742e8 --- /dev/null +++ b/recipes/libmount/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include + +#include +#include + +int main() +{ + struct libmnt_context *ctx = mnt_new_context(); + if (!ctx) { + printf("failed to initialize libmount\n"); + return EXIT_FAILURE; + } + printf("path to fstab: %s", mnt_get_fstab_path()); + mnt_free_context(ctx); + return EXIT_SUCCESS; +} diff --git a/recipes/libmount/all/test_v1_package/CMakeLists.txt b/recipes/libmount/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmount/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmount/all/test_v1_package/conanfile.py b/recipes/libmount/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmount/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/libmount/config.yml b/recipes/libmount/config.yml new file mode 100644 index 0000000000000..c0f9ff233a2c0 --- /dev/null +++ b/recipes/libmount/config.yml @@ -0,0 +1,7 @@ +versions: + "2.36.2": + folder: all + "2.36": + folder: all + "2.33.1": + folder: all diff --git a/recipes/libmp3lame/all/conandata.yml b/recipes/libmp3lame/all/conandata.yml new file mode 100644 index 0000000000000..ccb693b07c678 --- /dev/null +++ b/recipes/libmp3lame/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "3.100": + url: "https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz" + sha256: "ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e" +patches: + "3.100": + - patch_file: "patches/6410.patch" + patch_type: "backport" + patch_description: "bug tracker item #487: v3.100 breaks Windows compatibility" + patch_source: "https://sourceforge.net/p/lame/svn/commit_browser -- [r6410]" + - patch_file: "patches/6416.patch" + patch_type: "backport" + patch_description: "lame patches ticket #75: Fix for completing svn-r6410" + patch_source: "https://sourceforge.net/p/lame/svn/commit_browser -- [r6410]" + - patch_file: "patches/android.patch" + patch_type: "portability" + patch_description: "Add __ANDROID__ test to one bit" diff --git a/recipes/libmp3lame/all/conanfile.py b/recipes/libmp3lame/all/conanfile.py new file mode 100644 index 0000000000000..d8a366c7eb019 --- /dev/null +++ b/recipes/libmp3lame/all/conanfile.py @@ -0,0 +1,152 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, 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, NMakeToolchain +import os +import shutil + +required_conan_version = ">=1.55.0" + + +class LibMP3LameConan(ConanFile): + name = "libmp3lame" + url = "https://github.com/conan-io/conan-center-index" + description = "LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL." + homepage = "http://lame.sourceforge.net" + topics = "multimedia", "audio", "mp3", "decoder", "encoding", "decoding" + license = "LGPL-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_clang_cl(self): + return str(self.settings.compiler) in ["clang"] and str(self.settings.os) in ['Windows'] + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if not is_msvc(self) and not self._is_clang_cl: + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self) or self._is_clang_cl: + tc = NMakeToolchain(self) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-frontend") + if self.settings.compiler == "clang" and self.settings.arch in ["x86", "x86_64"]: + tc.extra_cxxflags.extend(["-mmmx", "-msse"]) + tc.generate() + + def _build_vs(self): + with chdir(self, self.source_folder): + shutil.copy2("configMS.h", "config.h") + # Honor vc runtime + replace_in_file(self, "Makefile.MSVC", "CC_OPTS = $(CC_OPTS) /MT", "") + # Do not hardcode LTO + replace_in_file(self, "Makefile.MSVC", " /GL", "") + replace_in_file(self, "Makefile.MSVC", " /LTCG", "") + replace_in_file(self, "Makefile.MSVC", "ADDL_OBJ = bufferoverflowU.lib", "") + command = "nmake -f Makefile.MSVC comp=msvc" + 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") + replace_in_file(self, "Makefile.MSVC", "CC = cl", f"CC = {cl}") + replace_in_file(self, "Makefile.MSVC", "LN = link", f"LN = {link}") + # what is /GAy? MSDN doesn't know it + # clang-cl: error: no such file or directory: '/GAy' + # https://docs.microsoft.com/en-us/cpp/build/reference/ga-optimize-for-windows-application?view=msvc-170 + replace_in_file(self, "Makefile.MSVC", "/GAy", "/GA") + if self.settings.arch == "x86_64": + replace_in_file(self, "Makefile.MSVC", "MACHINE = /machine:I386", "MACHINE =/machine:X64") + command += " MSVCVER=Win64 asm=yes" + elif self.settings.arch == "armv8": + replace_in_file(self, "Makefile.MSVC", "MACHINE = /machine:I386", "MACHINE =/machine:ARM64") + command += " MSVCVER=Win64" + else: + command += " asm=yes" + command += " libmp3lame.dll" if self.options.shared else " libmp3lame-static.lib" + self.run(command) + + def _build_autotools(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def build(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "include", "libmp3lame.sym"), "lame_init_old\n", "") + + if is_msvc(self) or self._is_clang_cl: + self._build_vs() + else: + self._build_autotools() + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder,"licenses")) + if is_msvc(self) or self._is_clang_cl: + copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder,"include", "lame")) + name = "libmp3lame.lib" if self.options.shared else "libmp3lame-static.lib" + copy(self, name, src=os.path.join(self.source_folder, "output"), dst=os.path.join(self.package_folder,"lib")) + if self.options.shared: + copy(self, pattern="*.dll", src=os.path.join(self.source_folder, "output"), dst=os.path.join(self.package_folder,"bin")) + rename(self, os.path.join(self.package_folder, "lib", name), + os.path.join(self.package_folder, "lib", "mp3lame.lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["mp3lame"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libmp3lame/all/patches/6410.patch b/recipes/libmp3lame/all/patches/6410.patch new file mode 100644 index 0000000000000..be5b608edd1fb --- /dev/null +++ b/recipes/libmp3lame/all/patches/6410.patch @@ -0,0 +1,77 @@ +--- a/frontend/parse.c ++++ b/frontend/parse.c +@@ -70,8 +70,10 @@ + #ifdef HAVE_ICONV + #include + #include ++#ifdef HAVE_LANGINFO + #include + #include ++#endif + #endif + + #if defined _ALLOW_INTERNAL_OPTIONS +@@ -146,6 +148,18 @@ + return n; + } + ++static char* ++currentCharacterEncoding() ++{ ++#ifdef HAVE_LANGINFO ++ char* cur_code = nl_langinfo(CODESET); ++#else ++ char* env_lang = getenv("LANG"); ++ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.'); ++ char* cur_code = xxx_code == NULL ? "" : xxx_code+1; ++#endif ++ return cur_code; ++} + + static size_t + currCharCodeSize(void) +@@ -153,7 +167,7 @@ + size_t n = 1; + char dst[32]; + char* src = "A"; +- char* cur_code = nl_langinfo(CODESET); ++ char* cur_code = currentCharacterEncoding(); + iconv_t xiconv = iconv_open(cur_code, "ISO_8859-1"); + if (xiconv != (iconv_t)-1) { + for (n = 0; n < 32; ++n) { +@@ -181,7 +195,7 @@ + size_t const n = l*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* cur_code = currentCharacterEncoding(); + iconv_t xiconv = iconv_open(cur_code, "ISO_8859-1"); + if (xiconv != (iconv_t)-1) { + char* i_ptr = src; +@@ -205,7 +219,7 @@ + size_t const n = l*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* cur_code = currentCharacterEncoding(); + iconv_t xiconv = iconv_open(cur_code, "UTF-16LE"); + if (xiconv != (iconv_t)-1) { + char* i_ptr = (char*)src; +@@ -231,7 +245,7 @@ + size_t const n = l*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* cur_code = currentCharacterEncoding(); + iconv_t xiconv = iconv_open("ISO_8859-1//TRANSLIT", cur_code); + if (xiconv != (iconv_t)-1) { + char* i_ptr = (char*)src; +@@ -257,7 +271,7 @@ + size_t const n = (l+1)*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* cur_code = currentCharacterEncoding(); + iconv_t xiconv = iconv_open("UTF-16LE//TRANSLIT", cur_code); + dst[0] = 0xff; + dst[1] = 0xfe; diff --git a/recipes/libmp3lame/all/patches/6416.patch b/recipes/libmp3lame/all/patches/6416.patch new file mode 100644 index 0000000000000..65ee30e94e510 --- /dev/null +++ b/recipes/libmp3lame/all/patches/6416.patch @@ -0,0 +1,39 @@ +--- a/configure.in ++++ b/configure.in +@@ -421,6 +421,7 @@ + AC_CHECK_LIB(termcap, initscr, HAVE_TERMCAP="termcap") + AC_CHECK_LIB(curses, initscr, HAVE_TERMCAP="curses") + AC_CHECK_LIB(ncurses, initscr, HAVE_TERMCAP="ncurses") ++AC_CHECK_HEADERS(langinfo.h, AC_CHECK_FUNCS(nl_langinfo)) + + AM_ICONV + +--- a/frontend/parse.c ++++ b/frontend/parse.c +@@ -70,7 +70,7 @@ + #ifdef HAVE_ICONV + #include + #include +-#ifdef HAVE_LANGINFO ++#ifdef HAVE_LANGINFO_H + #include + #include + #endif +@@ -151,7 +151,7 @@ + static char* + currentCharacterEncoding() + { +-#ifdef HAVE_LANGINFO ++#ifdef HAVE_LANGINFO_H + char* cur_code = nl_langinfo(CODESET); + #else + char* env_lang = getenv("LANG"); +@@ -1527,7 +1527,7 @@ + enum TextEncoding id3_tenc = TENC_LATIN1; + #endif + +-#ifdef HAVE_ICONV ++#ifdef HAVE_LANGINFO_H + setlocale(LC_CTYPE, ""); + #endif + inPath[0] = '\0'; diff --git a/recipes/libmp3lame/all/patches/android.patch b/recipes/libmp3lame/all/patches/android.patch new file mode 100644 index 0000000000000..6ea069c01c147 --- /dev/null +++ b/recipes/libmp3lame/all/patches/android.patch @@ -0,0 +1,11 @@ +--- a/libmp3lame/util.c ++++ b/libmp3lame/util.c +@@ -911,7 +911,7 @@ + mask &= ~(_EM_OVERFLOW | _EM_ZERODIVIDE | _EM_INVALID); + _FPU_SETCW(mask); + } +-# elif defined(__linux__) ++# elif defined(__linux__) && !defined(__ANDROID__) + { + + # include diff --git a/recipes/libmp3lame/all/test_package/CMakeLists.txt b/recipes/libmp3lame/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c1f711f1d8871 --- /dev/null +++ b/recipes/libmp3lame/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmp3lame REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmp3lame::libmp3lame) diff --git a/recipes/libmp3lame/all/test_package/conanfile.py b/recipes/libmp3lame/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libmp3lame/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmp3lame/all/test_package/test_package.c b/recipes/libmp3lame/all/test_package/test_package.c new file mode 100644 index 0000000000000..dc25ae51ee161 --- /dev/null +++ b/recipes/libmp3lame/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include +#include + +int main() +{ + printf("%s\n", get_lame_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/libmp3lame/all/test_v1_package/CMakeLists.txt b/recipes/libmp3lame/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmp3lame/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libmp3lame/all/test_v1_package/conanfile.py b/recipes/libmp3lame/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmp3lame/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/libmp3lame/config.yml b/recipes/libmp3lame/config.yml new file mode 100644 index 0000000000000..65d4204c528e2 --- /dev/null +++ b/recipes/libmp3lame/config.yml @@ -0,0 +1,3 @@ +versions: + "3.100": + folder: all diff --git a/recipes/libmysqlclient/all/conandata.yml b/recipes/libmysqlclient/all/conandata.yml new file mode 100644 index 0000000000000..7533ad1b401d8 --- /dev/null +++ b/recipes/libmysqlclient/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "8.0.31": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.31.tar.gz" + sha256: "67bb8cba75b28e95c7f7948563f01fb84528fcbb1a35dba839d4ce44fe019baa" + "8.0.30": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.30.tar.gz" + sha256: "c988d5c6ba9a56692a6cd6e9813465b5fc9368ed4b461df97059a2fc160c8b84" + "8.0.25": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.25.tar.gz" + sha256: "c16aa9cf621bc028efba2bb11f3c36a323b125fa0d108ff92fab60e46309206e" +patches: + "8.0.31": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.30": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.25": + - patch_file: "patches/0004-fix-805-cpp17-build.patch" + patch_description: "Fix C++17 compilation" + patch_type: "portability" + - patch_file: "patches/0005-fix-macos-12.0.x-version-detection.patch" + patch_description: "Fix macOS 12.0 version detection" + patch_type: "bugfix" diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py new file mode 100644 index 0000000000000..46f8df1537d5e --- /dev/null +++ b/recipes/libmysqlclient/all/conanfile.py @@ -0,0 +1,279 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +from conan.tools.files import rename, get, apply_conandata_patches, replace_in_file, rmdir, rm, export_conandata_patches, copy, mkdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class LibMysqlClientCConan(ConanFile): + name = "libmysqlclient" + description = "A MySQL client library for C development." + license = "GPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + topics = ("mysql", "sql", "connector", "database") + homepage = "https://dev.mysql.com/downloads/mysql/" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + package_type = "library" + short_paths = True + + @property + def _min_cppstd(self): + return "17" if Version(self.version) >= "8.0.27" else "11" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7" if Version(self.version) >= "8.0.27" else "5.3", + "clang": "6", + } + + 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): + if Version(self.version) < "8.0.30": + self.requires("openssl/1.1.1t") + else: + self.requires("openssl/[>=1.1 <4]") + self.requires("zlib/1.2.13") + self.requires("zstd/1.5.5") + self.requires("lz4/1.9.4") + if self.settings.os == "FreeBSD": + self.requires("libunwind/1.6.2") + + def validate_build(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.") + + def validate(self): + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} {minimum_version} or newer") + + # Sice 8.0.17 this doesn't support shared library on MacOS. + # https://github.com/mysql/mysql-server/blob/mysql-8.0.17/cmake/libutils.cmake#L333-L335 + if self.settings.compiler == "apple-clang" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared library") + + # mysql < 8.0.29 uses `requires` in source code. It is the reserved keyword in C++20. + # https://github.com/mysql/mysql-server/blob/mysql-8.0.0/include/mysql/components/services/dynamic_loader.h#L270 + if self.settings.compiler.get_safe("cppstd") == "20" and Version(self.version) < "8.0.29": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support C++20") + + def build_requirements(self): + if is_apple_os(self): + self.tool_requires("cmake/[>=3.18 <4]") + if self.settings.os == "FreeBSD" and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + libs_to_remove = ["icu", "libevent", "re2", "rapidjson", "protobuf", "libedit"] + for lib in libs_to_remove: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"MYSQL_CHECK_{lib.upper()}()\n", + "", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"INCLUDE({lib})\n", + "", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", + f"# WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", + strict=False) + + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"SET({lib.upper()}_WARN_GIVEN)", + f"# SET({lib.upper()}_WARN_GIVEN)", + strict=False) + + rmdir(self, os.path.join(self.source_folder, "extra")) + for folder in ["client", "man", "mysql-test", "libbinlogstandalone"]: + rmdir(self, os.path.join(self.source_folder, folder)) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"ADD_SUBDIRECTORY({folder})\n", + "", + strict=False) + rmdir(self, os.path.join(self.source_folder, "storage", "ndb")) + for t in ["INCLUDE(cmake/boost.cmake)\n", "MYSQL_CHECK_EDITLINE()\n"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + t, + "", + strict=False) + + # Upstream does not actually load lz4 directories for system, force it to + replace_in_file(self, os.path.join(self.source_folder, "libbinlogevents", "CMakeLists.txt"), + "INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)", + "MY_INCLUDE_SYSTEM_DIRECTORIES(LZ4)\nINCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)") + + replace_in_file(self, os.path.join(self.source_folder, "cmake", "zstd.cmake"), + "NAMES zstd", + f"NAMES zstd {self.dependencies['zstd'].cpp_info.aggregated_components().libs[0]}") + + # Fix discovery & link to OpenSSL + ssl_cmake = os.path.join(self.source_folder, "cmake", "ssl.cmake") + replace_in_file(self, ssl_cmake, + "NAMES ssl", + f"NAMES ssl {self.dependencies['openssl'].cpp_info.components['ssl'].libs[0]}") + + replace_in_file(self, ssl_cmake, + "NAMES crypto", + f"NAMES crypto {self.dependencies['openssl'].cpp_info.components['crypto'].libs[0]}") + + replace_in_file(self, ssl_cmake, + "IF(NOT OPENSSL_APPLINK_C)\n", + "IF(FALSE AND NOT OPENSSL_APPLINK_C)\n", + strict=False) + + replace_in_file(self, ssl_cmake, + "SET(SSL_LIBRARIES ${MY_OPENSSL_LIBRARY} ${MY_CRYPTO_LIBRARY})", + "find_package(OpenSSL REQUIRED MODULE)\nset(SSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)") + + # And do not merge OpenSSL libs into mysqlclient lib + replace_in_file(self, os.path.join(self.source_folder, "cmake", "libutils.cmake"), + 'IF(WIN32 AND ${TARGET} STREQUAL "mysqlclient")', + "if(0)") + + # Do not copy shared libs of dependencies to package folder + deps_shared = ["SSL", "KERBEROS", "SASL", "LDAP", "PROTOBUF", "CURL"] + for dep in deps_shared: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"MYSQL_CHECK_{dep}_DLLS()", + "") + + if self.settings.os == "Macos": + replace_in_file(self, os.path.join(self.source_folder, "libmysql", "CMakeLists.txt"), + f"COMMAND {'libmysql_api_test'}", + f"COMMAND DYLD_LIBRARY_PATH={os.path.join(self.build_folder, 'library_output_directory')} {os.path.join(self.build_folder, 'runtime_output_directory', 'libmysql_api_test')}") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "install_macros.cmake"), + " INSTALL_DEBUG_SYMBOLS(", + " # INSTALL_DEBUG_SYMBOLS(") + + def generate(self): + vbenv = VirtualBuildEnv(self) + vbenv.generate() + + if not cross_building(self): + vrenv = VirtualRunEnv(self) + vrenv.generate(scope="build") + + tc = CMakeToolchain(self) + # Not used anywhere in the CMakeLists + tc.cache_variables["DISABLE_SHARED"] = not self.options.shared + tc.cache_variables["STACK_DIRECTION"] = "-1" # stack grows downwards, on very few platforms stack grows upwards + tc.cache_variables["WITHOUT_SERVER"] = True + tc.cache_variables["WITH_UNIT_TESTS"] = False + tc.cache_variables["ENABLED_PROFILING"] = False + tc.cache_variables["MYSQL_MAINTAINER_MODE"] = False + tc.cache_variables["WIX_DIR"] = False + # Disable additional Linux distro-specific compiler checks. + # The recipe already checks for minimum versions of supported + # compilers. + tc.cache_variables["FORCE_UNSUPPORTED_COMPILER"] = True + + tc.cache_variables["WITH_LZ4"] = "system" + + tc.cache_variables["WITH_ZSTD"] = "system" + tc.cache_variables["ZSTD_INCLUDE_DIR"] = self.dependencies["zstd"].cpp_info.aggregated_components().includedirs[0].replace("\\", "/") + + if is_msvc(self): + tc.cache_variables["WINDOWS_RUNTIME_MD"] = not is_msvc_static_runtime(self) + + tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + + tc.cache_variables["WITH_ZLIB"] = "system" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if self.settings.os == "FreeBSD": + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + mkdir(self, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "LICENSE"), os.path.join(self.package_folder, "licenses", "LICENSE")) + rm(self, "README", self.package_folder) + rm(self, "*.pdb", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "docs")) + rmdir(self, os.path.join(self.package_folder, "share")) + 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) + if self.options.shared: + rm(self, "*.a", self.package_folder, recursive=True) + else: + rm(self, "*.dll", self.package_folder, recursive=True) + rm(self, "*.dylib", self.package_folder, recursive=True) + rm(self, "*.so*", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "mysqlclient") + self.cpp_info.libs = ["libmysql" if self.settings.os == "Windows" and self.options.shared else "mysqlclient"] + if not self.options.shared: + stdcpplib = stdcpp_library(self) + if stdcpplib: + self.cpp_info.system_libs.append(stdcpplib) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "resolv"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["dnsapi", "secur32"]) + + # TODO: There is no official FindMySQL.cmake, but it's a common Find files in many projects + # do we want to support it in CMakeDeps? + self.cpp_info.names["cmake_find_package"] = "MySQL" + self.cpp_info.names["cmake_find_package_multi"] = "MySQL" diff --git a/recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch b/recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch new file mode 100644 index 0000000000000..883a39e5624ed --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch @@ -0,0 +1,13 @@ +diff --git a/mysys/my_default.cc b/mysys/my_default.cc +--- a/mysys/my_default.cc ++++ b/mysys/my_default.cc +@@ -1180,7 +1180,7 @@ static mysql_file_getline_ret mysql_file_getline(char *buff, int size, + + /* If the supplied buff/size is enough to store the line, then we return the + * buff itself. In this case, we use this noop deleter */ +- static auto noop_free = [](void *) {}; ++ static auto noop_free = [](void *) noexcept {}; + + if (is_login_file) { + if (mysql_file_ftell(file) == 0) { + diff --git a/recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch b/recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch new file mode 100644 index 0000000000000..ee385c3187fef --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake +index 192035dd..dedc59c6 100644 +--- a/cmake/package_name.cmake ++++ b/cmake/package_name.cmake +@@ -94,7 +94,7 @@ MACRO(GET_PACKAGE_FILE_NAME Var) + + STRING(REGEX MATCH + "ProductVersion:[\n\t ]*([0-9]+)\\.([0-9]+)" UNUSED ${SW_VERS_PRODUCTVERSION}) +- IF(NOT CMAKE_MATCH_1 OR NOT CMAKE_MATCH_2) ++ IF(CMAKE_MATCH_1 STREQUAL "" OR CMAKE_MATCH_2 STREQUAL "") + MESSAGE(FATAL_ERROR "Could not run sw_vers") + ENDIF() + diff --git a/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch new file mode 100644 index 0000000000000..b7c82d910b7ea --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch @@ -0,0 +1,17 @@ +diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h +index a03d754..381216d 100644 +--- a/sql/sql_bitmap.h ++++ b/sql/sql_bitmap.h +@@ -138,10 +138,10 @@ class Bitmap<64> { + ulonglong map; + + public: +- Bitmap<64>() { init(); } ++ Bitmap() { init(); } + enum { ALL_BITS = 64 }; + +- explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); } ++ explicit Bitmap(uint prefix_to_set) { set_prefix(prefix_to_set); } + void init() { clear_all(); } + void init(uint prefix_to_set) { set_prefix(prefix_to_set); } + uint length() const { return 64; } diff --git a/recipes/libmysqlclient/all/test_package/CMakeLists.txt b/recipes/libmysqlclient/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9151a7e370ad9 --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmysqlclient REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmysqlclient::libmysqlclient) diff --git a/recipes/libmysqlclient/all/test_package/conanfile.py b/recipes/libmysqlclient/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmysqlclient/all/test_package/test_package.c b/recipes/libmysqlclient/all/test_package/test_package.c new file mode 100644 index 0000000000000..382117abe3e35 --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("MySQL client version: %s\n", mysql_get_client_info()); + return 0; +} diff --git a/recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt b/recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8d83bec304914 --- /dev/null +++ b/recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(MySQL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE MySQL::MySQL) diff --git a/recipes/libmysqlclient/all/test_v1_package/conanfile.py b/recipes/libmysqlclient/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/libmysqlclient/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libmysqlclient/config.yml b/recipes/libmysqlclient/config.yml new file mode 100644 index 0000000000000..d2183e51a5f3c --- /dev/null +++ b/recipes/libmysqlclient/config.yml @@ -0,0 +1,7 @@ +versions: + "8.0.31": + folder: all + "8.0.30": + folder: all + "8.0.25": + folder: all diff --git a/recipes/libnabo/all/conandata.yml b/recipes/libnabo/all/conandata.yml new file mode 100644 index 0000000000000..86054cc4bd55a --- /dev/null +++ b/recipes/libnabo/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.7": + url: "https://github.com/ethz-asl/libnabo/archive/refs/tags/1.0.7.tar.gz" + sha256: "817f43ba77668a7fab2834e78f0a9ff80e294d69c9818142084a32040547d10a" +patches: + "1.0.7": + - patch_file: "patches/1.0.7-0001-fix-cmake.patch" + patch_description: "Fix upstream CMakeLists" + patch_type: "conan" diff --git a/recipes/libnabo/all/conanfile.py b/recipes/libnabo/all/conanfile.py new file mode 100644 index 0000000000000..7ea7ce19cee21 --- /dev/null +++ b/recipes/libnabo/all/conanfile.py @@ -0,0 +1,81 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class LibnaboConan(ConanFile): + name = "libnabo" + description = "A fast K Nearest Neighbor library for low-dimensional spaces" + license = "BSD-3-Clause" + topics = ("nearest-neighbor", "kd-tree") + homepage = "https://github.com/ethz-asl/libnabo" + 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_openmp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["USE_OPEN_MP"] = self.options.with_openmp + tc.cache_variables["USE_OPEN_CL"] = False + tc.cache_variables["SHARED_LIBS"] = self.options.shared + 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, "copyright", src=os.path.join(self.source_folder, "debian"), + dst=os.path.join(self.package_folder, "licenses")) + 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", "libnabo") + self.cpp_info.set_property("cmake_target_name", "libnabo::nabo") + # TODO: back to global scope in conan v2 + self.cpp_info.components["nabo"].libs = ["nabo"] + + # TODO: to remove in conan v2 + self.cpp_info.components["nabo"].names["cmake_find_package"] = "nabo" + self.cpp_info.components["nabo"].names["cmake_find_package_multi"] = "nabo" + self.cpp_info.components["nabo"].set_property("cmake_target_name", "libnabo::nabo") + self.cpp_info.components["nabo"].requires = ["eigen::eigen"] diff --git a/recipes/libnabo/all/patches/1.0.7-0001-fix-cmake.patch b/recipes/libnabo/all/patches/1.0.7-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8efc965410dc9 --- /dev/null +++ b/recipes/libnabo/all/patches/1.0.7-0001-fix-cmake.patch @@ -0,0 +1,94 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.6) ++cmake_minimum_required(VERSION 3.15) + + if (NOT CMAKE_VERSION VERSION_LESS "3.1") + cmake_policy(SET CMP0054 NEW) +@@ -7,6 +7,10 @@ endif () + set(LIB_NAME nabo) + project("lib${LIB_NAME}") + ++file(READ "nabo/nabo.h" NABO_HEADER_CONTENT) ++string(REGEX MATCH "#define NABO_VERSION \"([0-9]+\.[0-9]+\.[0-9]+)\"" _ ${NABO_HEADER_CONTENT}) ++set(PROJECT_VERSION ${CMAKE_MATCH_1}) ++if(0) + # Extract version from header + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + execute_process( +@@ -86,6 +90,7 @@ if (CMAKE_VERSION VERSION_LESS "3.1") + else () + set (CMAKE_CXX_STANDARD 11) + endif () ++endif() + + # openmp + set(USE_OPEN_MP TRUE CACHE BOOL "Set to FALSE to not use OpenMP") +@@ -101,15 +106,7 @@ if (USE_OPEN_MP) + endif (USE_OPEN_MP) + + # eigen 2 or 3 +-find_path(EIGEN_INCLUDE_DIR Eigen/Core +- /usr/local/include/eigen3 +- /usr/local/include/eigen2 +- /usr/local/include/eigen +- /usr/include/eigen3 +- /usr/include/eigen2 +- /usr/include/eigen +- /opt/local/include/eigen3 +-) ++find_package(Eigen3 REQUIRED CONFIG) + + # optionally, opencl + # OpenCL disabled as its code is not up-to-date with API +@@ -141,7 +138,6 @@ else (USE_OPEN_CL) + endif (USE_OPEN_CL) + + # include all libs so far +-include_directories(${CMAKE_SOURCE_DIR} ${EIGEN_INCLUDE_DIR}) + + # main nabo lib + set(NABO_SRC +@@ -153,12 +149,14 @@ set(NABO_SRC + set(SHARED_LIBS FALSE CACHE BOOL "Set to TRUE to build shared library") + if (SHARED_LIBS) + add_library(${LIB_NAME} SHARED ${NABO_SRC}) +- install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib) ++ install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) ++ set_target_properties(${LIB_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + else (SHARED_LIBS) + add_library(${LIB_NAME} ${NABO_SRC}) +- add_definitions(-fPIC) + install(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib) + endif (SHARED_LIBS) ++target_link_libraries(${LIB_NAME} PUBLIC Eigen3::Eigen) ++target_compile_features(${LIB_NAME} PUBLIC cxx_std_11) + set_target_properties(${LIB_NAME} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION 1) + + # create doc before installing +@@ -170,11 +168,7 @@ if (DOXYGEN_FOUND) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html DESTINATION ${DOC_INSTALL_TARGET}) + endif (DOXYGEN_FOUND) + +-enable_testing() + +-add_subdirectory(examples) +-add_subdirectory(tests) +-add_subdirectory(python) + + # Install catkin package.xml + install(FILES package.xml DESTINATION share/libnabo) +@@ -195,6 +189,7 @@ install(FILES package.xml DESTINATION share/libnabo) + # 1- local build # + + # Register the local build in case one doesn't use "make install" ++if(0) + export(PACKAGE libnabo) + + # Create variable with the library location +@@ -244,3 +239,4 @@ configure_file( + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) ++endif() diff --git a/recipes/libnabo/all/test_package/CMakeLists.txt b/recipes/libnabo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6398a814018da --- /dev/null +++ b/recipes/libnabo/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libnabo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libnabo::nabo) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libnabo/all/test_package/conanfile.py b/recipes/libnabo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnabo/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/libnabo/all/test_package/test_package.cpp b/recipes/libnabo/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7f61223412edc --- /dev/null +++ b/recipes/libnabo/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +#include + +int main() +{ + Eigen::MatrixXf M = Eigen::MatrixXf::Random(3, 100); + Eigen::VectorXf q = Eigen::VectorXf::Random(3); + auto nns = std::unique_ptr(Nabo::NNSearchF::createKDTreeLinearHeap(M)); + + const int K = 5; + Eigen::VectorXi indices(K); + Eigen::VectorXf dists2(K); + nns->knn(q, indices, dists2, K); + + return 0; +} diff --git a/recipes/libnabo/all/test_v1_package/CMakeLists.txt b/recipes/libnabo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnabo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnabo/all/test_v1_package/conanfile.py b/recipes/libnabo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnabo/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/libnabo/config.yml b/recipes/libnabo/config.yml new file mode 100644 index 0000000000000..377623d3a93f7 --- /dev/null +++ b/recipes/libnabo/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.7": + folder: all diff --git a/recipes/libnet/all/conandata.yml b/recipes/libnet/all/conandata.yml new file mode 100644 index 0000000000000..56c7fdd2f75d8 --- /dev/null +++ b/recipes/libnet/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2": + sha256: caa4868157d9e5f32e9c7eac9461efeff30cb28357f7f6bf07e73933fb4edaa7 + url: https://github.com/libnet/libnet/releases/download/v1.2/libnet-1.2.tar.gz diff --git a/recipes/libnet/all/conanfile.py b/recipes/libnet/all/conanfile.py new file mode 100644 index 0000000000000..94be83e79e721 --- /dev/null +++ b/recipes/libnet/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanException, 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 +from conan.tools.files import 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 +import os + +required_conan_version = ">=1.53.0" + + +class LibnetConan(ConanFile): + name = "libnet" + description = "Libnet is an API to help with the construction and injection of network packets." + topics = ("network") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://libnet.sourceforge.net/" + license = ["BSD-2-Clause"] + 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 validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("libnet is not supported by Visual Studio") + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("libnet can't be built as shared on Windows") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-doxygen-doc") + if cross_building(self): + if self.settings.os == "Linux": + link_layer = "linux" + elif self.settings.os == "Windows": + link_layer = "win32" + elif is_apple_os(self): + link_layer = "bpf" + else: + raise ConanException( + f"link-layer unknown for {self.settings.os}, feel free to contribute to libnet recipe", + ) + tc.configure_args.append(f"--with-link-layer={link_layer}") + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libnet") + self.cpp_info.libs = ["net"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libnet/all/test_package/CMakeLists.txt b/recipes/libnet/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..24a3da7a29419 --- /dev/null +++ b/recipes/libnet/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libnet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnet::libnet) diff --git a/recipes/libnet/all/test_package/conanfile.py b/recipes/libnet/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnet/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/libnet/all/test_package/test_package.c b/recipes/libnet/all/test_package/test_package.c new file mode 100644 index 0000000000000..46ab2521eef21 --- /dev/null +++ b/recipes/libnet/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include + +int main() +{ + libnet_t *l = NULL; + unsigned char enet_dst[6] = {0x0d, 0x0e, 0x0a, 0x0d, 0x00, 0x00}; + libnet_ptag_t t = libnet_autobuild_ethernet( + enet_dst, /* ethernet destination */ + ETHERTYPE_ARP, /* protocol type */ + l); /* libnet handle */ + if (t != (-1)) { + fprintf(stderr, "[-] Failed!\n"); + return 1; + } + + fprintf(stderr, "[+] Passed!\n"); + return 0; +} diff --git a/recipes/libnet/all/test_v1_package/CMakeLists.txt b/recipes/libnet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnet/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnet/all/test_v1_package/conanfile.py b/recipes/libnet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnet/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/libnet/config.yml b/recipes/libnet/config.yml new file mode 100644 index 0000000000000..a0777b5aa931c --- /dev/null +++ b/recipes/libnet/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2": + folder: all diff --git a/recipes/libnetfilter_conntrack/all/conandata.yml b/recipes/libnetfilter_conntrack/all/conandata.yml new file mode 100644 index 0000000000000..15ebea6f3f76c --- /dev/null +++ b/recipes/libnetfilter_conntrack/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.8": + sha256: 0cd13be008923528687af6c6b860f35392d49251c04ee0648282d36b1faec1cf + url: https://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-1.0.8.tar.bz2 diff --git a/recipes/libnetfilter_conntrack/all/conanfile.py b/recipes/libnetfilter_conntrack/all/conanfile.py new file mode 100644 index 0000000000000..b4f68103f83c1 --- /dev/null +++ b/recipes/libnetfilter_conntrack/all/conanfile.py @@ -0,0 +1,67 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + +class Libnetfilter_conntrackConan(ConanFile): + name = "libnetfilter_conntrack" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://netfilter.org/projects/libnetfilter_conntrack/index.html" + description = "userspace library that provides an API to the in-kernel connection tracking state table" + topics = ("libnetfilter_conntrack", "netfilter") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "pkg_config" + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("libmnl/1.0.4") + self.requires("libnfnetlink/1.0.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libnetfilter_conntrack is only supported on Linux") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + conf_args = [] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["netfilter_conntrack"] + self.cpp_info.names["pkg_config"] = "libnetfilter_conntrack" diff --git a/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt b/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4dbc40cd2c4d9 --- /dev/null +++ b/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(PackageTest) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.c) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/libnetfilter_conntrack/all/test_package/conanfile.py b/recipes/libnetfilter_conntrack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4959660649186 --- /dev/null +++ b/recipes/libnetfilter_conntrack/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class Libnetfilter_conntrackTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run("{} {}".format(bin_path, 0), run_environment=True) diff --git a/recipes/libnetfilter_conntrack/all/test_package/example.c b/recipes/libnetfilter_conntrack/all/test_package/example.c new file mode 100644 index 0000000000000..331a7d9d4f854 --- /dev/null +++ b/recipes/libnetfilter_conntrack/all/test_package/example.c @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include + +#include +#include + +static int data_cb(const struct nlmsghdr *nlh, void *data) +{ + struct nf_conntrack *ct; + char buf[4096]; + + ct = nfct_new(); + if (ct == NULL) + return MNL_CB_OK; + + nfct_nlmsg_parse(nlh, ct); + + nfct_snprintf(buf, sizeof(buf), ct, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, 0); + printf("%s\n", buf); + + nfct_destroy(ct); + + return MNL_CB_OK; +} + +int main(void) +{ + struct mnl_socket *nl; + struct nlmsghdr *nlh; + struct nfgenmsg *nfh; + char buf[MNL_SOCKET_BUFFER_SIZE]; + unsigned int seq, portid; + int ret; + + nl = mnl_socket_open(NETLINK_NETFILTER); + if (nl == NULL) { + perror("mnl_socket_open"); + exit(EXIT_FAILURE); + } + + if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { + perror("mnl_socket_bind"); + exit(EXIT_FAILURE); + } + portid = mnl_socket_get_portid(nl); + + nlh = mnl_nlmsg_put_header(buf); + nlh->nlmsg_type = (NFNL_SUBSYS_CTNETLINK << 8) | IPCTNL_MSG_CT_GET; + nlh->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP; + nlh->nlmsg_seq = seq = time(NULL); + + nfh = mnl_nlmsg_put_extra_header(nlh, sizeof(struct nfgenmsg)); + nfh->nfgen_family = AF_INET; + nfh->version = NFNETLINK_V0; + nfh->res_id = 0; + + ret = mnl_socket_sendto(nl, nlh, nlh->nlmsg_len); + if (ret == -1) { + perror("mnl_socket_recvfrom"); + exit(EXIT_FAILURE); + } + + ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); + if (ret == -1) { + perror("mnl_socket_recvfrom"); + exit(EXIT_FAILURE); + } + + mnl_socket_close(nl); + + return 0; +} diff --git a/recipes/libnetfilter_conntrack/config.yml b/recipes/libnetfilter_conntrack/config.yml new file mode 100644 index 0000000000000..3d5953260054d --- /dev/null +++ b/recipes/libnetfilter_conntrack/config.yml @@ -0,0 +1,3 @@ +versions: + 1.0.8: + folder: all diff --git a/recipes/libnetfilter_queue/all/conandata.yml b/recipes/libnetfilter_queue/all/conandata.yml new file mode 100644 index 0000000000000..07aa5c218dacf --- /dev/null +++ b/recipes/libnetfilter_queue/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.5": + sha256: f9ff3c11305d6e03d81405957bdc11aea18e0d315c3e3f48da53a24ba251b9f5 + url: https://www.netfilter.org/projects/libnetfilter_queue/files/libnetfilter_queue-1.0.5.tar.bz2 diff --git a/recipes/libnetfilter_queue/all/conanfile.py b/recipes/libnetfilter_queue/all/conanfile.py new file mode 100644 index 0000000000000..56576ded262ce --- /dev/null +++ b/recipes/libnetfilter_queue/all/conanfile.py @@ -0,0 +1,69 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.29.1" + +class Libnetfilter_queueConan(ConanFile): + name = "libnetfilter_queue" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://netfilter.org/projects/libnetfilter_queue/index.html" + description = "userspace library that provides an API to packets that have been queued by the kernel packet filter" + topics = ("libnetfilter_queue", "netfilter") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "pkg_config" + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("libmnl/1.0.4") + self.requires("libnfnetlink/1.0.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def configure(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libnetfilter_queue is only supported on Linux") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + conf_args = [] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["netfilter_queue"] + self.cpp_info.names["pkg_config"] = "libnetfilter_queue" diff --git a/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt b/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4dbc40cd2c4d9 --- /dev/null +++ b/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(PackageTest) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.c) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/libnetfilter_queue/all/test_package/conanfile.py b/recipes/libnetfilter_queue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1097433829a7c --- /dev/null +++ b/recipes/libnetfilter_queue/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class Libnetfilter_queueTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run("{} {}".format(bin_path, 0), run_environment=True) diff --git a/recipes/libnetfilter_queue/all/test_package/example.c b/recipes/libnetfilter_queue/all/test_package/example.c new file mode 100644 index 0000000000000..f229443f228aa --- /dev/null +++ b/recipes/libnetfilter_queue/all/test_package/example.c @@ -0,0 +1,172 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +/* only for NFQA_CT, not needed otherwise: */ +#include + +static struct mnl_socket *nl; + +static void +nfq_send_verdict(int queue_num, uint32_t id) +{ + char buf[MNL_SOCKET_BUFFER_SIZE]; + struct nlmsghdr *nlh; + struct nlattr *nest; + + nlh = nfq_nlmsg_put(buf, NFQNL_MSG_VERDICT, queue_num); + nfq_nlmsg_verdict_put(nlh, id, NF_ACCEPT); + + /* example to set the connmark. First, start NFQA_CT section: */ + nest = mnl_attr_nest_start(nlh, NFQA_CT); + + /* then, add the connmark attribute: */ + mnl_attr_put_u32(nlh, CTA_MARK, htonl(42)); + /* more conntrack attributes, e.g. CTA_LABELS could be set here */ + + /* end conntrack section */ + mnl_attr_nest_end(nlh, nest); + + if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { + perror("mnl_socket_send"); + exit(EXIT_FAILURE); + } +} + +static int queue_cb(const struct nlmsghdr *nlh, void *data) +{ + struct nfqnl_msg_packet_hdr *ph = NULL; + struct nlattr *attr[NFQA_MAX+1] = {}; + uint32_t id = 0, skbinfo; + struct nfgenmsg *nfg; + uint16_t plen; + + if (nfq_nlmsg_parse(nlh, attr) < 0) { + perror("problems parsing"); + return MNL_CB_ERROR; + } + + nfg = mnl_nlmsg_get_payload(nlh); + + if (attr[NFQA_PACKET_HDR] == NULL) { + fputs("metaheader not set\n", stderr); + return MNL_CB_ERROR; + } + + ph = mnl_attr_get_payload(attr[NFQA_PACKET_HDR]); + + plen = mnl_attr_get_payload_len(attr[NFQA_PAYLOAD]); + /* void *payload = mnl_attr_get_payload(attr[NFQA_PAYLOAD]); */ + + skbinfo = attr[NFQA_SKB_INFO] ? ntohl(mnl_attr_get_u32(attr[NFQA_SKB_INFO])) : 0; + + if (attr[NFQA_CAP_LEN]) { + uint32_t orig_len = ntohl(mnl_attr_get_u32(attr[NFQA_CAP_LEN])); + if (orig_len != plen) + printf("truncated "); + } + + if (skbinfo & NFQA_SKB_GSO) + printf("GSO "); + + id = ntohl(ph->packet_id); + printf("packet received (id=%u hw=0x%04x hook=%u, payload len %u", + id, ntohs(ph->hw_protocol), ph->hook, plen); + + /* + * ip/tcp checksums are not yet valid, e.g. due to GRO/GSO. + * The application should behave as if the checksums are correct. + * + * If these packets are later forwarded/sent out, the checksums will + * be corrected by kernel/hardware. + */ + if (skbinfo & NFQA_SKB_CSUMNOTREADY) + printf(", checksum not ready"); + puts(")"); + + nfq_send_verdict(ntohs(nfg->res_id), id); + + return MNL_CB_OK; +} + +int main(int argc, char *argv[]) +{ + char *buf; + /* largest possible packet payload, plus netlink data overhead: */ + size_t sizeof_buf = 0xffff + (MNL_SOCKET_BUFFER_SIZE/2); + struct nlmsghdr *nlh; + int ret; + unsigned int portid, queue_num; + + if (argc != 2) { + printf("Usage: %s [queue_num]\n", argv[0]); + exit(EXIT_FAILURE); + } + queue_num = atoi(argv[1]); + + nl = mnl_socket_open(NETLINK_NETFILTER); + if (nl == NULL) { + perror("mnl_socket_open"); + exit(EXIT_FAILURE); + } + + if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { + perror("mnl_socket_bind"); + exit(EXIT_FAILURE); + } + portid = mnl_socket_get_portid(nl); + + buf = malloc(sizeof_buf); + if (!buf) { + perror("allocate receive buffer"); + exit(EXIT_FAILURE); + } + + nlh = nfq_nlmsg_put(buf, NFQNL_MSG_CONFIG, queue_num); + nfq_nlmsg_cfg_put_cmd(nlh, AF_INET, NFQNL_CFG_CMD_BIND); + + if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { + perror("mnl_socket_send"); + exit(EXIT_FAILURE); + } + + nlh = nfq_nlmsg_put(buf, NFQNL_MSG_CONFIG, queue_num); + nfq_nlmsg_cfg_put_params(nlh, NFQNL_COPY_PACKET, 0xffff); + + mnl_attr_put_u32(nlh, NFQA_CFG_FLAGS, htonl(NFQA_CFG_F_GSO)); + mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(NFQA_CFG_F_GSO)); + + if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { + perror("mnl_socket_send"); + exit(EXIT_FAILURE); + } + + /* ENOBUFS is signalled to userspace when packets were lost + * on kernel side. In most cases, userspace isn't interested + * in this information, so turn it off. + */ + ret = 1; + mnl_socket_setsockopt(nl, NETLINK_NO_ENOBUFS, &ret, sizeof(int)); + ret = mnl_socket_recvfrom(nl, buf, sizeof_buf); + if (ret == -1) { + perror("mnl_socket_recvfrom"); + exit(EXIT_FAILURE); + } + + mnl_socket_close(nl); + + return 0; +} diff --git a/recipes/libnetfilter_queue/config.yml b/recipes/libnetfilter_queue/config.yml new file mode 100644 index 0000000000000..c29b1cee6f3b5 --- /dev/null +++ b/recipes/libnetfilter_queue/config.yml @@ -0,0 +1,3 @@ +versions: + 1.0.5: + folder: all diff --git a/recipes/libnfnetlink/all/conandata.yml b/recipes/libnfnetlink/all/conandata.yml new file mode 100644 index 0000000000000..b5ce8a9c9adc1 --- /dev/null +++ b/recipes/libnfnetlink/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.1": + sha256: f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a + url: https://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-1.0.1.tar.bz2 + "1.0.2": + sha256: b064c7c3d426efb4786e60a8e6859b82ee2f2c5e49ffeea640cfe4fe33cbc376 + url: https://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-1.0.2.tar.bz2 diff --git a/recipes/libnfnetlink/all/conanfile.py b/recipes/libnfnetlink/all/conanfile.py new file mode 100644 index 0000000000000..10540d39fbf9c --- /dev/null +++ b/recipes/libnfnetlink/all/conanfile.py @@ -0,0 +1,67 @@ +import os +import functools +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + +class LibnfnetlinkConan(ConanFile): + name = "libnfnetlink" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://netfilter.org/projects/libnfnetlink/index.html" + description = "low-level library for netfilter related kernel/userspace communication" + topics = ("libnfnetlink", "netlink", "netfilter") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libnfnetlink is only supported on Linux") + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + @functools.lru_cache(1) + def _configure_autotools(self): + autotools = AutoToolsBuildEnvironment(self) + conf_args = [] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + autotools.configure(configure_dir=self._source_subfolder, args=conf_args) + return autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["nfnetlink"] + self.cpp_info.set_property("pkg_config_name", "libnfnetlink") + + # TODO: to remove in conan v2 once pkg_config generator is removed + self.cpp_info.names["pkg_config"] = "libnfnetlink" diff --git a/recipes/libnfnetlink/all/test_package/CMakeLists.txt b/recipes/libnfnetlink/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4fdee1a8a79c --- /dev/null +++ b/recipes/libnfnetlink/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/libnfnetlink/all/test_package/conanfile.py b/recipes/libnfnetlink/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e4f1965959dec --- /dev/null +++ b/recipes/libnfnetlink/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class LibnfnetlinkTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libnfnetlink/all/test_package/example.cpp b/recipes/libnfnetlink/all/test_package/example.cpp new file mode 100644 index 0000000000000..95153d8532f51 --- /dev/null +++ b/recipes/libnfnetlink/all/test_package/example.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() { + struct nfnl_handle *nl = nfnl_open(); + if (nl == NULL) { + std::cerr << "nfnl_open\n"; + return EXIT_FAILURE; + } + nfnl_close(nl); + + return EXIT_SUCCESS; +} diff --git a/recipes/libnfnetlink/config.yml b/recipes/libnfnetlink/config.yml new file mode 100644 index 0000000000000..94db826314106 --- /dev/null +++ b/recipes/libnfnetlink/config.yml @@ -0,0 +1,5 @@ +versions: + 1.0.1: + folder: all + 1.0.2: + folder: all diff --git a/recipes/libnfs/all/conandata.yml b/recipes/libnfs/all/conandata.yml new file mode 100644 index 0000000000000..5c9b795165455 --- /dev/null +++ b/recipes/libnfs/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "5.0.1": + url: "https://github.com/sahlberg/libnfs/archive/refs/tags/libnfs-5.0.1.tar.gz" + sha256: "7ef445410b42f36b9bad426608b53ccb9ccca4101e545c383f564c11db672ca8" +patches: + "5.0.1": + - patch_file: "patches/5.0.1-0001-remove-exports.patch" + patch_description: "Fix installation" + patch_type: "conan" + patch_source: "https://github.com/sahlberg/libnfs/pull/377" diff --git a/recipes/libnfs/all/conanfile.py b/recipes/libnfs/all/conanfile.py new file mode 100644 index 0000000000000..3b943c080be1a --- /dev/null +++ b/recipes/libnfs/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibnfsConan(ConanFile): + name = "libnfs" + description = "LIBNFS is a client library for accessing NFS shares over a network." + topics = ("async", "nfsv4", "nfs") + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sahlberg/libnfs" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENCE*.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libnfs") + self.cpp_info.set_property("cmake_target_name", "libnfs::libnfs") + self.cpp_info.set_property("pkg_config_name", "libnfs") + self.cpp_info.libs = ["nfs"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libnfs/all/patches/5.0.1-0001-remove-exports.patch b/recipes/libnfs/all/patches/5.0.1-0001-remove-exports.patch new file mode 100644 index 0000000000000..8c95197b65585 --- /dev/null +++ b/recipes/libnfs/all/patches/5.0.1-0001-remove-exports.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake +index 257b52d..a44e562 100644 +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -12,4 +12,12 @@ function(core_add_library name) + add_library(${name} OBJECT ${SOURCES} ${HEADERS}) + target_include_directories(${name} PUBLIC $) + set(CORE_LIBRARIES "${name};${CORE_LIBRARIES}" CACHE INTERNAL "") ++ ++ # no need to install core libs if we build shared library ++ if(NOT BUILD_SHARED_LIBS) ++ install(TARGETS ${name} EXPORT libnfs ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) ++ endif() + endfunction() diff --git a/recipes/libnfs/all/test_package/CMakeLists.txt b/recipes/libnfs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c693f64cb2e4c --- /dev/null +++ b/recipes/libnfs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libnfs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnfs::libnfs) diff --git a/recipes/libnfs/all/test_package/conanfile.py b/recipes/libnfs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnfs/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/libnfs/all/test_package/test_package.c b/recipes/libnfs/all/test_package/test_package.c new file mode 100644 index 0000000000000..0a5f34fd8f626 --- /dev/null +++ b/recipes/libnfs/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "nfsc/libnfs.h" + +int main() { + struct nfs_context* nfs = nfs_init_context(); + + if (nfs == NULL) { + return 0; + } + nfs_destroy_context(nfs); + return 0; +} diff --git a/recipes/libnfs/all/test_v1_package/CMakeLists.txt b/recipes/libnfs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnfs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnfs/all/test_v1_package/conanfile.py b/recipes/libnfs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnfs/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/libnfs/config.yml b/recipes/libnfs/config.yml new file mode 100644 index 0000000000000..12fc1d264fabb --- /dev/null +++ b/recipes/libnfs/config.yml @@ -0,0 +1,3 @@ +versions: + "5.0.1": + folder: "all" diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml new file mode 100644 index 0000000000000..9078b4202e02b --- /dev/null +++ b/recipes/libnghttp2/all/conandata.yml @@ -0,0 +1,72 @@ +sources: + "1.53.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.53.0/nghttp2-1.53.0.tar.xz" + sha256: "b867184254e5a29b0ba68413aa14f8b0ce1142a371761374598dec092dabb809" + "1.51.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.51.0/nghttp2-1.51.0.tar.xz" + sha256: "66aa76d97c143f42295405a31413e5e7d157968dad9f957bb4b015b598882e6b" + "1.50.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.50.0/nghttp2-1.50.0.tar.xz" + sha256: "af24007e34c18c782393a1dc3685f8fd5b50283e90a9191d25488eb50aa2c825" + "1.49.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.49.0/nghttp2-1.49.0.tar.xz" + sha256: "b0cfd492bbf0b131c472e8f6501c9f4ee82b51b68130f47b278c0b7c9848a66e" + "1.48.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.48.0/nghttp2-1.48.0.tar.xz" + sha256: "47d8f30ee4f1bc621566d10362ca1b3ac83a335c63da7144947c806772d016e4" + "1.47.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.47.0/nghttp2-1.47.0.tar.xz" + sha256: "68271951324554c34501b85190f22f2221056db69f493afc3bbac8e7be21e7cc" + "1.46.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.46.0/nghttp2-1.46.0.tar.xz" + sha256: "1a68cc4a5732afb735baf50aaac3cb3a6771e49f744bd5db6c49ab5042f12a43" + "1.45.1": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.45.1/nghttp2-1.45.1.tar.xz" + sha256: "abdc4addccadbc7d89abe27c4d6427d78e57d139f69c1f45749227393c68bf79" + "1.43.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.43.0/nghttp2-1.43.0.tar.xz" + sha256: "f7d54fa6f8aed29f695ca44612136fa2359013547394d5dffeffca9e01a26b0f" + "1.42.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.xz" + sha256: "c5a7f09020f31247d0d1609078a75efadeccb7e5b86fc2e4389189b1b431fe63" + "1.40.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.40.0/nghttp2-1.40.0.tar.xz" + sha256: "09fc43d428ff237138733c737b29fb1a7e49d49de06d2edbed3bc4cdcee69073" + "1.39.2": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.39.2/nghttp2-1.39.2.tar.xz" + sha256: "a2d216450abd2beaf4e200c168957968e89d602ca4119338b9d7ab059fd4ce8b" +patches: + "1.49.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.48.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.47.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.46.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.45.1": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.43.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.42.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + "1.40.0": + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" + - patch_file: "patches/1.40.0-remove-static-suffix.patch" + patch_type: "backport" + patch_source: https://github.com/curl/curl/pull/7515#issuecomment-890320856 + patch_description: >- + Fix the breaking change that was introduced in 1.40.0 and made optional + in 1.40.1 + "1.39.2": + - patch_file: "patches/fix-addNghttp2IncludesPathCMake.patch" + - patch_file: "patches/fix-findJemalloc.cmake" + - patch_file: "patches/fix-findLibevent.cmake" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py new file mode 100644 index 0000000000000..d6777fe1e084b --- /dev/null +++ b/recipes/libnghttp2/all/conanfile.py @@ -0,0 +1,186 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, save, replace_in_file, rmdir, copy +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class Nghttp2Conan(ConanFile): + name = "libnghttp2" + description = "HTTP/2 C Library and tools" + topics = ("http", "http2") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://nghttp2.org" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_app": [True, False], + "with_hpack": [True, False], + "with_jemalloc": [True, False], + "with_asio": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_app": False, + "with_hpack": False, + "with_jemalloc": False, + "with_asio": 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") + if not (self.options.with_app or self.options.with_hpack or self.options.with_asio): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.with_app: + del self.options.with_jemalloc + if Version(self.version) >= "1.52.0": + del self.options.with_asio + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_app or self.options.get_safe("with_asio"): + self.requires("openssl/[>=1.1 <4]") + if self.options.with_app: + self.requires("c-ares/1.19.0") + self.requires("libev/4.33") + self.requires("libevent/2.1.12") + self.requires("libxml2/2.10.4") + self.requires("zlib/1.2.13") + if self.options.with_jemalloc: + self.requires("jemalloc/5.3.0") + if self.options.with_hpack: + self.requires("jansson/2.14") + if self.options.get_safe("with_asio"): + self.requires("boost/1.81.0") + + def validate(self): + if self.options.get_safe("with_asio") and is_msvc(self): + raise ConanInvalidConfiguration("Build with asio and MSVC is not supported yet, see upstream bug #589") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >= 6.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_SHARED_LIB"] = self.options.shared + tc.variables["ENABLE_STATIC_LIB"] = 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 + if Version(self.version) < "1.52.0": + tc.variables["ENABLE_PYTHON_BINDINGS"] = False + tc.variables["ENABLE_FAILMALLOC"] = False + # disable unneeded auto-picked dependencies + tc.variables["WITH_LIBXML2"] = False + tc.variables["WITH_JEMALLOC"] = self.options.get_safe("with_jemalloc", False) + if Version(self.version) < "1.47.0": + tc.variables["WITH_SPDYLAY"] = False + if Version(self.version) < "1.52.0": + tc.variables["ENABLE_ASIO_LIB"] = self.options.with_asio + 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.generate() + + tc = CMakeDeps(self) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if not self.options.shared: + # 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" + "${CMAKE_CURRENT_BINARY_DIR}/includes\n" + "${CMAKE_CURRENT_SOURCE_DIR}/includes)\n", + append=True) + target_libnghttp2 = "nghttp2" if self.options.shared else "nghttp2_static" + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "\n" + "link_libraries(\n" + " nghttp2\n", + "\n" + "link_libraries(\n" + " {} ${{CONAN_LIBS}}\n".format(target_libnghttp2)) + if not self.options.shared and Version(self.version) < "1.52.0": + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "\n" + " add_library(nghttp2_asio SHARED\n", + "\n" + " add_library(nghttp2_asio\n") + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "\n" + " target_link_libraries(nghttp2_asio\n" + " nghttp2\n", + "\n" + " target_link_libraries(nghttp2_asio\n" + f" {target_libnghttp2}\n") + + 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, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.components["nghttp2"].set_property("pkg_config_name", "libnghttp2") + self.cpp_info.components["nghttp2"].libs = ["nghttp2"] + if is_msvc(self) and not self.options.shared: + self.cpp_info.components["nghttp2"].defines.append("NGHTTP2_STATICLIB") + + if self.options.get_safe("with_asio"): + self.cpp_info.components["nghttp2_asio"].set_property("pkg_config_name", "libnghttp2_asio") + self.cpp_info.components["nghttp2_asio"].libs = ["nghttp2_asio"] + self.cpp_info.components["nghttp2_asio"].requires = [ + "nghttp2", "boost::headers", "openssl::openssl", + ] + + if self.options.with_app: + self.cpp_info.components["nghttp2_app"].requires = [ + "openssl::openssl", "c-ares::c-ares", "libev::libev", + "libevent::libevent", "libxml2::libxml2", "zlib::zlib", + ] + if self.options.with_jemalloc: + self.cpp_info.components["nghttp2_app"].requires.append("jemalloc::jemalloc") + + if self.options.with_hpack: + self.cpp_info.components["nghttp2_hpack"].requires = ["jansson::jansson"] + + if self.options.with_app or self.options.with_hpack: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + + # trick for internal conan usage to pick up in downsteam pc files the pc file including all libs components + self.cpp_info.set_property("pkg_config_name", "libnghttp2_asio" if self.options.get_safe("with_asio") else "libnghttp2") diff --git a/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch b/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch new file mode 100644 index 0000000000000..b769d5a577c38 --- /dev/null +++ b/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch @@ -0,0 +1,11 @@ +--- lib/CMakeLists.txt.orig 2022-12-23 11:01:09.000000000 +0200 ++++ lib/CMakeLists.txt 2022-12-23 11:01:22.000000000 +0200 +@@ -62,7 +62,7 @@ if(HAVE_CUNIT OR ENABLE_STATIC_LIB) + set_target_properties(nghttp2_static PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}" + VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} +- ARCHIVE_OUTPUT_NAME nghttp2_static ++ ARCHIVE_OUTPUT_NAME nghttp2 + ) + target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") + if(ENABLE_STATIC_LIB) diff --git a/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch b/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch new file mode 100644 index 0000000000000..f3458ec8b39b9 --- /dev/null +++ b/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2019-12-12 20:23:38.855819744 +0100 ++++ CMakeLists.txt 2019-12-12 20:22:54.194563670 +0100 +@@ -449,6 +449,8 @@ + + install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}") + ++include_directories(lib/includes) ++ + add_subdirectory(lib) + #add_subdirectory(lib/includes) + add_subdirectory(third-party) diff --git a/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake b/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake new file mode 100644 index 0000000000000..f072d3a7f8d5a --- /dev/null +++ b/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake @@ -0,0 +1,14 @@ +--- cmake/FindJemalloc.cmake ++++ cmake/FindJemalloc.cmake +@@ -10,10 +10,10 @@ + find_path(JEMALLOC_INCLUDE_DIR + NAMES jemalloc/jemalloc.h + HINTS ${PC_JEMALLOC_INCLUDE_DIRS} + ) + find_library(JEMALLOC_LIBRARY +- NAMES jemalloc ++ NAMES jemalloc jemalloc_s jemalloc_pic + HINTS ${PC_JEMALLOC_LIBRARY_DIRS} + ) + + if(JEMALLOC_INCLUDE_DIR) diff --git a/recipes/libnghttp2/all/patches/fix-findLibevent.cmake b/recipes/libnghttp2/all/patches/fix-findLibevent.cmake new file mode 100644 index 0000000000000..b58cd730c3bff --- /dev/null +++ b/recipes/libnghttp2/all/patches/fix-findLibevent.cmake @@ -0,0 +1,11 @@ +--- cmake/FindLibevent.cmake ++++ cmake/FindLibevent.cmake +@@ -35,7 +35,7 @@ + ) + + if(LIBEVENT_INCLUDE_DIR) +- set(_version_regex "^#define[ \t]+_EVENT_VERSION[ \t]+\"([^\"]+)\".*") ++ set(_version_regex "^#define[ \t]+EVENT__VERSION[ \t]+\"([^\"]+)\".*") + if(EXISTS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h") + # Libevent 2.0 + file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h" diff --git a/recipes/libnghttp2/all/test_package/CMakeLists.txt b/recipes/libnghttp2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb7f9cd8b9769 --- /dev/null +++ b/recipes/libnghttp2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(libnghttp2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libnghttp2::libnghttp2) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libnghttp2/all/test_package/conanfile.py b/recipes/libnghttp2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libnghttp2/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/libnghttp2/all/test_package/test_package.cpp b/recipes/libnghttp2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78eefc27ef9d6 --- /dev/null +++ b/recipes/libnghttp2/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +#if defined(_MSC_VER) +// nghttp2 defaults to int +typedef int ssize_t; +#endif +#include +#include + +int main() +{ + nghttp2_info* info = nghttp2_version(NGHTTP2_VERSION_NUM); + if (info) { + printf("nghttp2 ver=%d version=%s\n", info->version_num, info->version_str); + } else { + printf("nghttp2: cannot get version\n"); + } + return 0; +} + +// vim: et ts=4 sw=4 diff --git a/recipes/libnghttp2/all/test_v1_package/CMakeLists.txt b/recipes/libnghttp2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a7596ce0a8b97 --- /dev/null +++ b/recipes/libnghttp2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +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}/binary_dir/) diff --git a/recipes/libnghttp2/all/test_v1_package/conanfile.py b/recipes/libnghttp2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnghttp2/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/libnghttp2/config.yml b/recipes/libnghttp2/config.yml new file mode 100644 index 0000000000000..35bd03552b39b --- /dev/null +++ b/recipes/libnghttp2/config.yml @@ -0,0 +1,25 @@ +versions: + "1.53.0": + folder: all + "1.51.0": + folder: all + "1.50.0": + folder: all + "1.49.0": + folder: all + "1.48.0": + folder: all + "1.47.0": + folder: all + "1.46.0": + folder: all + "1.45.1": + folder: all + "1.43.0": + folder: all + "1.42.0": + folder: all + "1.40.0": + folder: all + "1.39.2": + folder: all diff --git a/recipes/libnice/all/conandata.yml b/recipes/libnice/all/conandata.yml new file mode 100644 index 0000000000000..603d8d4fc1235 --- /dev/null +++ b/recipes/libnice/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.1.21: + url: https://libnice.freedesktop.org/releases/libnice-0.1.21.tar.gz + sha256: 72e73a2acf20f59093e21d5601606e405873503eb35f346fa621de23e99b3b39 diff --git a/recipes/libnice/all/conanfile.py b/recipes/libnice/all/conanfile.py new file mode 100644 index 0000000000000..5fd9fcdbbc036 --- /dev/null +++ b/recipes/libnice/all/conanfile.py @@ -0,0 +1,114 @@ +import os +from conan import ConanFile +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.files import copy, get, rmdir, rename, chdir, rm +from conan.tools.layout import basic_layout +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc_static_runtime +from conan.errors import ConanInvalidConfiguration + + +class LibniceConan(ConanFile): + name = "libnice" + homepage = "https://libnice.freedesktop.org/" + license = ("MPL-1.1", "LGPL-2.1-only") + url = "https://github.com/conan-io/conan-center-index" + description = "a GLib ICE implementation" + topics = ("ice", "stun", "turn") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "crypto_library": ["openssl", "win32"], + "with_gstreamer": [True, False], + "with_gtk_doc": [True, False], + "with_introspection": [True, False]} + default_options = { + "shared": False, + "fPIC": True, + "with_gstreamer": False, + "with_gtk_doc": False, + "with_introspection": False} + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.crypto_library = "win32" + else: + self.options.crypto_library = "openssl" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Windows" and self.options.crypto_library == "win32": + raise ConanInvalidConfiguration( + f"-o {self.ref}:crypto_library=win32 is not supported on non-Windows") + if self.settings.os == "Windows" and self.options.with_gtk_doc: + raise ConanInvalidConfiguration( + f"-o {self.ref}:with_gtk_doc=True is not support on Windows") + if is_msvc_static_runtime(self) and self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "-o glib/*:shared=True with static runtime is not supported") + + def requirements(self): + self.requires("glib/2.75.2") + if self.options.crypto_library == "openssl": + self.requires("openssl/1.1.1t") + if self.options.with_gstreamer: + self.requires("gstreamer/1.19.2") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + self.tool_requires("pkgconf/1.9.3") + self.tool_requires("glib/2.75.2") # for glib-mkenums + if self.options.with_introspection: + self.tool_requires("gobject-introspection/1.72.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = PkgConfigDeps(self) + tc.generate() + tc = MesonToolchain(self) + tc.project_options["gupnp"] = "disabled" + tc.project_options["gstreamer"] = "enabled" if self.options.with_gstreamer else "disabled" + tc.project_options["crypto-library"] = "auto" if self.options.crypto_library == "win32" else str( + self.options.crypto_library) + + tc.project_options["examples"] = "disabled" + tc.project_options["tests"] = "disabled" + tc.project_options["gtk_doc"] = "disabled" if self.options.with_gtk_doc else "disabled" + tc.project_options["introspection"] = "enabled" if self.options.with_introspection else "disabled" + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="COPYING*", dst=os.path.join(self.package_folder, + "licenses"), src=self.source_folder) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.settings.os == "Windows": + if not self.options.shared: + with chdir(self, os.path.join(self.package_folder, "lib")): + rename(self, "libnice.a", "nice.lib") + + def package_info(self): + self.cpp_info.libs = ["nice"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("advapi32") diff --git a/recipes/libnice/all/test_package/CMakeLists.txt b/recipes/libnice/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d61c442b074a4 --- /dev/null +++ b/recipes/libnice/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(example LANGUAGES C) + +find_package(libnice REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} src/example.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnice::libnice) diff --git a/recipes/libnice/all/test_package/conanfile.py b/recipes/libnice/all/test_package/conanfile.py new file mode 100644 index 0000000000000..22dd4e9d14ebe --- /dev/null +++ b/recipes/libnice/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake +from conan.tools.layout import cmake_layout +from conan.tools.build import can_run + + +class LibniceTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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], "example") + self.run(cmd, env="conanrun") diff --git a/recipes/libnice/all/test_package/src/example.c b/recipes/libnice/all/test_package/src/example.c new file mode 100644 index 0000000000000..de04a569af0f5 --- /dev/null +++ b/recipes/libnice/all/test_package/src/example.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + NiceAgent *agent = nice_agent_new(NULL, NICE_COMPATIBILITY_RFC5245); + g_object_unref(agent); +} diff --git a/recipes/libnice/all/test_v1_package/CMakeLists.txt b/recipes/libnice/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libnice/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libnice/all/test_v1_package/conanfile.py b/recipes/libnice/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8c9580d2d52b2 --- /dev/null +++ b/recipes/libnice/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conan import ConanFile +from conans import CMake +from conan.tools.build import can_run + + +class LibniceTestConan(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 can_run(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libnice/config.yml b/recipes/libnice/config.yml new file mode 100644 index 0000000000000..68b088642e3c7 --- /dev/null +++ b/recipes/libnice/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.21": + folder: all diff --git a/recipes/libnl/all/conandata.yml b/recipes/libnl/all/conandata.yml new file mode 100644 index 0000000000000..edfebcd8dad20 --- /dev/null +++ b/recipes/libnl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.2.25": + sha256: 8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5 + url: https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz diff --git a/recipes/libnl/all/conanfile.py b/recipes/libnl/all/conanfile.py new file mode 100644 index 0000000000000..1bd02b2f42194 --- /dev/null +++ b/recipes/libnl/all/conanfile.py @@ -0,0 +1,85 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class LibNlConan(ConanFile): + name = "libnl" + description = "A collection of libraries providing APIs to netlink protocol based Linux kernel interfaces." + topics = ("netlink") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.infradead.org/~tgr/libnl/" + license = "LGPL-2.1-only" + settings = "os", "arch", "compiler", "build_type" + options = {"fPIC": [True, False], "shared": [True, False]} + default_options = {"fPIC": True, "shared": False} + build_requires = ( "flex/2.6.4", "bison/3.7.6" ) + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("Libnl is only supported on Linux") + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + config_args = [ + "--prefix={}".format(tools.unix_path(self.package_folder)), + ] + if self.options.shared: + config_args.extend(["--enable-shared=yes", "--enable-static=no"]) + else: + config_args.extend(["--enable-shared=no", "--enable-static=yes"]) + + self._autotools.configure(configure_dir=self._source_subfolder, args=config_args) + return self._autotools + + def build(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + autotools = self._configure_autotools() + autotools.install() + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def package_info(self): + self.cpp_info.components["nl"].libs = ["nl-3"] + self.cpp_info.components["nl"].includedirs = [os.path.join('include', 'libnl3')] + if self._settings_build.os != "Windows": + self.cpp_info.components["nl"].system_libs = ["pthread", "m"] + self.cpp_info.components["nl-route"].libs = ["nl-route-3"] + self.cpp_info.components["nl-route"].requires = ["nl"] + self.cpp_info.components["nl-genl"].libs = ["nl-genl-3"] + self.cpp_info.components["nl-genl"].requires = ["nl"] + self.cpp_info.components["nl-nf"].libs = ["nl-nf-3"] + self.cpp_info.components["nl-nf"].requires = ["nl-route"] + self.cpp_info.components["nl-cli"].libs = ["nl-cli-3"] + self.cpp_info.components["nl-cli"].requires = ["nl-nf", "nl-genl"] + self.cpp_info.components["nl-idiag"].libs = ["nl-idiag-3"] + self.cpp_info.components["nl-idiag"].requires = ["nl"] diff --git a/recipes/libnl/all/test_package/CMakeLists.txt b/recipes/libnl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..df9446e8809cf --- /dev/null +++ b/recipes/libnl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.5) +project(netlink_example) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(show_links show_links.c) +target_link_libraries(show_links ${CONAN_LIBS}) diff --git a/recipes/libnl/all/test_package/conanfile.py b/recipes/libnl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c130487451ae0 --- /dev/null +++ b/recipes/libnl/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os.path + +from conans import ConanFile, CMake, tools + + +class NetlinkTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(self.build_folder, "bin", "show_links") + self.run(bin_path, cwd=self.source_folder, run_environment=True) diff --git a/recipes/libnl/all/test_package/show_links.c b/recipes/libnl/all/test_package/show_links.c new file mode 100644 index 0000000000000..0928191f4dbfd --- /dev/null +++ b/recipes/libnl/all/test_package/show_links.c @@ -0,0 +1,164 @@ +/* Libnl example taken from stackoverflow: + * https://stackoverflow.com/questions/42307658/how-to-get-ipv4-address-of-an-interface-using-libnl3-netlink-version-3-on-linu +*/ + +#include +#include +#include +#include +#include + +#include + + + +/* +gcc ipchange.c -o ipchange $(pkg-config --cflags --libs libnl-3.0 libnl-route-3.0 libnl-cli-3.0) +*/ + +#include + +#define ADDR_STR_BUF_SIZE 80 + +void addr_cb(struct nl_object *p_nl_object, void *data) { + + int ifindex = (int) (intptr_t) data; // this is the link index passed as a parm + struct rtnl_addr *p_rtnl_addr; + p_rtnl_addr = (struct rtnl_addr *) p_nl_object; + int result; + + if (NULL == p_rtnl_addr) { + /* error */ + printf("addr is NULL %d\n", errno); + return; + } + + // This routine is not mentioned in the doxygen help. + // It is listed under Attributes, but no descriptive text. + // this routine just returns p_rtnl_addr->a_ifindex + int cur_ifindex = rtnl_addr_get_ifindex(p_rtnl_addr); + if(cur_ifindex != ifindex) { + // skip interaces where the index differs. + return; + } + + // Adding this to see if I can filter on ipv4 addr + // this routine just returns p_rtnl_addr->a_family + // this is not the one to use + // ./linux/netfilter.h: NFPROTO_IPV6 = 10, + // ./linux/netfilter.h: NFPROTO_IPV4 = 2, + // this is the one to use + // x86_64-linux-gnu/bits/socket.h + // defines AF_INET6 = PF_INET6 = 10 + // defines AF_INET = PF_INET = 2 + result = rtnl_addr_get_family(p_rtnl_addr); + // printf( "family is %d\n",result); + if (AF_INET6 == result) { + // early exit, I don't care about IPV6 + return; + } + + // This routine just returns p_rtnl_addr->a_local + struct nl_addr *p_nl_addr_local = rtnl_addr_get_local(p_rtnl_addr); + if (NULL == p_nl_addr_local) { + /* error */ + printf("rtnl_addr_get failed\n"); + return; + } + + char addr_str[ADDR_STR_BUF_SIZE]; + const char *addr_s = nl_addr2str(p_nl_addr_local, addr_str, sizeof(addr_str)); + if (NULL == addr_s) { + /* error */ + printf("nl_addr2str failed\n"); + return; + } + fprintf(stdout, "\naddr is: %s\n", addr_s); + +} + +int main(int argc, char **argv, char **envp) { + + int err, i; + + struct nl_sock *p_nl_sock; + struct nl_cache *link_cache; + struct nl_cache *addr_cache; + + struct rtnl_addr *p_rtnl_addr; + struct nl_addr *p_nl_addr; + struct nl_link *p_nl_link; + struct rtnl_link *p_rtnl_link; + + char addr_str[ADDR_STR_BUF_SIZE]; + + p_nl_sock = nl_socket_alloc(); + if (!p_nl_sock) + { + fprintf(stderr, "Could not allocate netlink socket.\n"); + exit(ENOMEM); + } + + // Connect to socket + if(err = nl_connect(p_nl_sock, NETLINK_ROUTE)) + { + fprintf(stderr, "netlink error: %s\n", nl_geterror(err)); + p_nl_sock = NULL; + exit(err); + } + + // Either choice, the result below is a mac address + err = rtnl_link_alloc_cache(p_nl_sock, AF_UNSPEC, &link_cache); + //err = rtnl_link_alloc_cache(p_nl_sock, AF_INET, &link_cache); + //err = rtnl_link_alloc_cache(p_nl_sock, IFA_LOCAL, &link_cache); + if (0 != err) + { + /* error */ + printf("rtnl_link_alloc_cache failed: %s\n", nl_geterror(err)); + return(EXIT_FAILURE); + } + + err = rtnl_addr_alloc_cache(p_nl_sock, &addr_cache); + if (0 != err) + { + /* error */ + printf("rtnl_addr_alloc_cache failed: %s\n", nl_geterror(err)); + return(EXIT_FAILURE); + } + + // This will iterate through the cache of ip's + printf("Getting the list of interfaces by ip addr cache\n"); + int count = nl_cache_nitems(addr_cache); + printf("addr_cache has %d items\n",count); + struct nl_object *p_nl_object; + p_nl_object = nl_cache_get_first(addr_cache); + p_rtnl_addr = (struct rtnl_addr *) p_nl_object; + for (i=0; ia_local + struct nl_addr *p_nl_addr_local = rtnl_addr_get_local(p_rtnl_addr); + if (NULL == p_nl_addr_local) { + /* error */ + printf("rtnl_addr_get failed\n"); + return(EXIT_FAILURE); + } + + int cur_ifindex = rtnl_addr_get_ifindex(p_rtnl_addr); + printf("This is index %d\n",cur_ifindex); + + const char *addr_s = nl_addr2str(p_nl_addr_local, addr_str, sizeof(addr_str)); + if (NULL == addr_s) + { + /* error */ + printf("nl_addr2str failed\n"); + return(EXIT_FAILURE); + } + fprintf(stdout, "\naddr is: %s\n", addr_s); + + printf("%d\n",i); + p_nl_object = nl_cache_get_next(p_nl_object); + p_rtnl_addr = (struct rtnl_addr *) p_nl_object; + } + + return(EXIT_SUCCESS); +} diff --git a/recipes/libnl/config.yml b/recipes/libnl/config.yml new file mode 100644 index 0000000000000..992cfb9a265e6 --- /dev/null +++ b/recipes/libnl/config.yml @@ -0,0 +1,3 @@ +versions: + 3.2.25: + folder: all diff --git a/recipes/libnoise/all/CMakeLists.txt b/recipes/libnoise/all/CMakeLists.txt new file mode 100644 index 0000000000000..5f314cdfee089 --- /dev/null +++ b/recipes/libnoise/all/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.4) +project(noise LANGUAGES CXX) + +set(NOISE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/noise/src) + +file(GLOB NOISE_SRC_FILES + ${NOISE_SRC_DIR}/*.cpp + ${NOISE_SRC_DIR}/model/*.cpp + ${NOISE_SRC_DIR}/module/*.cpp +) + +add_library(${PROJECT_NAME} ${NOISE_SRC_FILES}) +set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +find_library(M_LIB m) +if(M_LIB) + target_link_libraries(${PROJECT_NAME} PUBLIC ${M_LIB}) +endif() + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +foreach(SRC_SUBDIR "." "model" "module") + file(GLOB NOISE_HDR_FILES ${NOISE_SRC_DIR}/${SRC_SUBDIR}/*.h) + install(FILES ${NOISE_HDR_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/noise/${SRC_SUBDIR}) +endforeach() diff --git a/recipes/libnoise/all/conandata.yml b/recipes/libnoise/all/conandata.yml new file mode 100644 index 0000000000000..1091f5761161e --- /dev/null +++ b/recipes/libnoise/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://sourceforge.net/projects/libnoise/files/libnoise%20sources/1.0.0/libnoisesrc-1.0.0.zip" + sha256: "34ed402f43f30ce5e39812642c9533c11082cd2bc092341c65160f5c743be95b" diff --git a/recipes/libnoise/all/conanfile.py b/recipes/libnoise/all/conanfile.py new file mode 100644 index 0000000000000..f1ad2b518e534 --- /dev/null +++ b/recipes/libnoise/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class LibnoiseConan(ConanFile): + name = "libnoise" + description = ( + "A general-purpose library that generates three-dimensional coherent " + "noise. Useful for terrain generation and procedural texture " + "generation. Uses a broad number of techniques (Perlin noise, ridged " + "multifractal, etc.) and combinations of those techniques." + ) + license = "LGPL-2.1-or-later" + topics = ("graphics", "noise-generator") + homepage = "http://libnoise.sourceforge.net" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + 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, "COPYING.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 = ["noise"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libnoise/all/test_package/CMakeLists.txt b/recipes/libnoise/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e018594465e5d --- /dev/null +++ b/recipes/libnoise/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(libnoise REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libnoise::libnoise) diff --git a/recipes/libnoise/all/test_package/conanfile.py b/recipes/libnoise/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnoise/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/libnoise/all/test_package/test_package.cpp b/recipes/libnoise/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2424339a8248c --- /dev/null +++ b/recipes/libnoise/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << noise::IntValueNoise3D(4, 2, 5) << std::endl; + return 0; +} diff --git a/recipes/libnoise/all/test_v1_package/CMakeLists.txt b/recipes/libnoise/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnoise/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnoise/all/test_v1_package/conanfile.py b/recipes/libnoise/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnoise/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/libnoise/config.yml b/recipes/libnoise/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/libnoise/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/libnop/all/conandata.yml b/recipes/libnop/all/conandata.yml new file mode 100644 index 0000000000000..b6bbd6443fc3d --- /dev/null +++ b/recipes/libnop/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200728": + url: "https://github.com/google/libnop/archive/45dfe0f2cbb055010068f81e2d094b3805c068fb.zip" + sha256: "c9828ee844dcef31292459c15d1ec8ee384e8f949ae31d026c71ad4c35aaf50a" diff --git a/recipes/libnop/all/conanfile.py b/recipes/libnop/all/conanfile.py new file mode 100644 index 0000000000000..75343526d3c90 --- /dev/null +++ b/recipes/libnop/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class LibnopConan(ConanFile): + name = "libnop" + description = "libnop is a header-only library for serializing and " \ + "deserializing C++ data types without external code " \ + "generators or runtime support libraries." + license = "Apache-2.0" + topics = ("header-only", "serializer") + homepage = "https://github.com/google/libnop" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/libnop/all/test_package/CMakeLists.txt b/recipes/libnop/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb1e148dab4cf --- /dev/null +++ b/recipes/libnop/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libnop REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libnop::libnop) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libnop/all/test_package/conanfile.py b/recipes/libnop/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnop/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/libnop/all/test_package/test_package.cpp b/recipes/libnop/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9a2e8facfbfd8 --- /dev/null +++ b/recipes/libnop/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include + +#include +#include +#include +#include +#include + +int main() { + using Writer = nop::StreamWriter; + nop::Serializer serializer; + + serializer.Write(std::vector{1, 2, 3, 4}); + serializer.Write(std::vector{"foo", "bar", "baz"}); + + using MapType = std::map>; + serializer.Write(MapType{{0, {10, "foo"}}, {1, {20, "bar"}}, {2, {30, "baz"}}}); + + const std::string data = serializer.writer().stream().str(); + std::cout << "Wrote " << data.size() << " bytes." << std::endl; + return 0; +} diff --git a/recipes/libnop/all/test_v1_package/CMakeLists.txt b/recipes/libnop/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnop/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnop/all/test_v1_package/conanfile.py b/recipes/libnop/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnop/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/libnop/config.yml b/recipes/libnop/config.yml new file mode 100644 index 0000000000000..41de4cc034ed3 --- /dev/null +++ b/recipes/libnop/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200728": + folder: all diff --git a/recipes/libnova/all/conandata.yml b/recipes/libnova/all/conandata.yml new file mode 100644 index 0000000000000..ebb1679fa5799 --- /dev/null +++ b/recipes/libnova/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "0.16.0": + post: + url: "https://sourceforge.net/p/libnova/libnova/ci/v0.16/tarball" + sha256: "not_needed" + archive: + url: "https://sourceforge.net/code-snapshots/git/l/li/libnova/libnova.git/libnova-libnova-edbf65abe27ef1a2520eb9e839daaf58f15a6941.zip" + sha256: "2703497573f949146895dedb6fdf74c8d1f15dbdb831074bbaabc5052bdedc07" +patches: + "0.16.0": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-fix-win32-def.patch" + - patch_file: "patches/0003-no-redefine-nan.patch" + - patch_file: "patches/0004-constellation-syntax-error.patch" + - patch_file: "patches/0005-fix-mingw-w64.patch" diff --git a/recipes/libnova/all/conanfile.py b/recipes/libnova/all/conanfile.py new file mode 100644 index 0000000000000..cd98651eacb6f --- /dev/null +++ b/recipes/libnova/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os +import requests + +required_conan_version = ">=1.53.0" + + +class LibnovaConan(ConanFile): + name = "libnova" + description = ( + "libnova is a general purpose, double precision, celestial mechanics, " + "astrometry and astrodynamics library." + ) + license = "LGPL-2.0-only" + topics = ("celestial-mechanics", "astrometry", "astrodynamics") + homepage = "https://sourceforge.net/projects/libnova" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + @staticmethod + def _generate_git_tag_archive_sourceforge(url, timeout=10, retry=2): + def try_post(retry_count): + try: + requests.post(url, timeout=timeout) + except: + if retry_count < retry: + try_post(retry_count + 1) + else: + raise ConanException("All the attempt to generate archive url have failed.") + try_post(0) + + def source(self): + # Generate the archive download link + self._generate_git_tag_archive_sourceforge(self.conan_data["sources"][self.version]["post"]["url"]) + + # Download archive + get(self, **self.conan_data["sources"][self.version]["archive"], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBRARY"] = self.options.shared + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + postfix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"nova{postfix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libnova/all/patches/0001-fix-cmake.patch b/recipes/libnova/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..e37e50fc6440c --- /dev/null +++ b/recipes/libnova/all/patches/0001-fix-cmake.patch @@ -0,0 +1,103 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,9 @@ +-cmake_minimum_required(VERSION 2.6 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.1) + +-project(libnova) ++project(libnova C) + + # define the name of the library +-set(LIBRARY_NAME libnova) ++set(LIBRARY_NAME nova) + + option(BUILD_SHARED_LIBRARY "Set to ON to build libnova as a shared library." ON) + if(BUILD_SHARED_LIBRARY) +@@ -23,10 +23,10 @@ if(WIN32) + endif(WIN32) + + # add more optimization flags to the visual studio release compilation +-if(MSVC) ++if(0) + set(CMAKE_CXX_FLAGS_RELEASE "/MD /Ox /Ob2 /D NDEBUG") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /GS-") +-endif(MSVC) ++endif() + + + # set the debug postfix +@@ -69,5 +69,3 @@ include_directories(${libnova_SOURCE_DIR}/src) + + # traverse the sub directories + add_subdirectory(src) +-add_subdirectory(lntest) +-add_subdirectory(examples) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(HEADER_PATH ${libnova_SOURCE_DIR}/src/${LIBRARY_NAME}) ++set(HEADER_PATH libnova) + + set(LIBRARY_PUBLIC_HEADERS + ${HEADER_PATH}/julian_day.h +@@ -36,6 +36,7 @@ set(LIBRARY_PUBLIC_HEADERS + ${HEADER_PATH}/parallax.h + ${HEADER_PATH}/airmass.h + ${HEADER_PATH}/heliocentric_time.h ++ ${HEADER_PATH}/constellation.h + ) + + add_library(${LIBRARY_NAME} +@@ -73,15 +74,22 @@ add_library(${LIBRARY_NAME} + parallax.c + airmass.c + heliocentric_time.c ++ constellation.c + ) + +-if(MSVC) ++set_target_properties(${LIBRARY_NAME} PROPERTIES C_STANDARD 99) ++target_compile_definitions(${LIBRARY_NAME} PRIVATE HAVE_ROUND) ++find_library(M_LIB m) ++if(M_LIB) ++ target_link_libraries(${LIBRARY_NAME} PRIVATE ${M_LIB}) ++endif() ++if(0) + if(BUILD_SHARED_LIBRARY) + set_target_properties(${LIBRARY_NAME} PROPERTIES PREFIX "../../bin/" IMPORT_PREFIX "../") + else(BUILD_SHARED_LIBRARY) + set_target_properties(${LIBRARY_NAME} PROPERTIES PREFIX "../") + endif(BUILD_SHARED_LIBRARY) +-endif(MSVC) ++endif() + + + +@@ -93,8 +101,8 @@ if(WIN32) + set(INSTALL_LIBDIR bin) + set(INSTALL_ARCHIVEDIR lib) + else(WIN32) +- set(INSTALL_LIBDIR lib${LIB_POSTFIX}) +- set(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX}) ++ set(INSTALL_LIBDIR lib) ++ set(INSTALL_ARCHIVEDIR lib) + endif(WIN32) + + install( +@@ -106,5 +114,5 @@ install( + + install( + FILES ${LIBRARY_PUBLIC_HEADERS} +- DESTINATION ${INSTALL_INCDIR}/${LIBRARY_NAME} ++ DESTINATION ${INSTALL_INCDIR}/libnova + ) +--- a/src/julian_day.c ++++ b/src/julian_day.c +@@ -27,7 +27,6 @@ + #include + #include + +-#include "config.h" + + #if !defined(__WIN32__) || defined(__MINGW__) + #include diff --git a/recipes/libnova/all/patches/0002-fix-win32-def.patch b/recipes/libnova/all/patches/0002-fix-win32-def.patch new file mode 100644 index 0000000000000..0a59bcb41d6ed --- /dev/null +++ b/recipes/libnova/all/patches/0002-fix-win32-def.patch @@ -0,0 +1,16 @@ +--- a/src/libnova/ln_types.h ++++ b/src/libnova/ln_types.h +@@ -19,9 +19,11 @@ + #ifndef _LN_TYPES_H + #define _LN_TYPES_H + +-#if !defined(__WIN32__) && (defined(__WIN32) || defined(WIN32)) +-#define __WIN32__ ++#if (defined(__WIN32__) || defined(_WIN32) || defined(WIN32)) + #define ALIGN32 ++#if !defined(__WIN32__) ++#define __WIN32__ ++#endif + #else + #define ALIGN32 __attribute__((aligned(32))) + #endif diff --git a/recipes/libnova/all/patches/0003-no-redefine-nan.patch b/recipes/libnova/all/patches/0003-no-redefine-nan.patch new file mode 100644 index 0000000000000..d9d99e1abadc2 --- /dev/null +++ b/recipes/libnova/all/patches/0003-no-redefine-nan.patch @@ -0,0 +1,22 @@ +--- a/src/libnova/utility.h ++++ b/src/libnova/utility.h +@@ -247,7 +247,7 @@ double cbrt(double x); + + #endif /* __C89_SUB__ */ + +-#if defined(__WIN32__) || defined(sun) || defined(__C89_SUB__) ++#if defined(__C89_SUB__) + + /* Not a Number function generator */ + double nan(const char *code); +--- a/src/utility.c ++++ b/src/utility.c +@@ -740,7 +740,7 @@ double cbrt(double x) + + #endif /* __C89_SUB__ */ + +-#if defined(__WIN32__) || defined(sun) || defined(__C89_SUB__) ++#if defined(__C89_SUB__) + + /* Not a Number function generator */ + double nan(const char *code) diff --git a/recipes/libnova/all/patches/0004-constellation-syntax-error.patch b/recipes/libnova/all/patches/0004-constellation-syntax-error.patch new file mode 100644 index 0000000000000..e4a5fcf73a8ce --- /dev/null +++ b/recipes/libnova/all/patches/0004-constellation-syntax-error.patch @@ -0,0 +1,20 @@ +--- a/src/libnova/constellation.h ++++ b/src/libnova/constellation.h +@@ -19,6 +19,8 @@ + #ifndef _LN_CONSTELLATION_H + #define _LN_CONSTELLATION_H + ++#include ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -31,7 +33,7 @@ extern "C" { + * \ingroup constellations + * \brief Returns name of the constellation at the given position + */ +-const char* LIBNOVA_EXPORT ln_get_constellation(struct ln_equ_posn *position); ++const char LIBNOVA_EXPORT *ln_get_constellation(struct ln_equ_posn *position); + + #ifdef __cplusplus + }; diff --git a/recipes/libnova/all/patches/0005-fix-mingw-w64.patch b/recipes/libnova/all/patches/0005-fix-mingw-w64.patch new file mode 100644 index 0000000000000..a2319ccc96def --- /dev/null +++ b/recipes/libnova/all/patches/0005-fix-mingw-w64.patch @@ -0,0 +1,11 @@ +--- a/src/julian_day.c ++++ b/src/julian_day.c +@@ -16,7 +16,7 @@ + * Copyright (C) 2000 - 2005 Liam Girdwood + */ + +-#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__) ++#if defined(__MINGW32__) && !defined(__MINGW64__) + #define _USE_32BIT_TIME_T + #endif //__MINGW__ + diff --git a/recipes/libnova/all/test_package/CMakeLists.txt b/recipes/libnova/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fea9b303f2a63 --- /dev/null +++ b/recipes/libnova/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libnova REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnova::libnova) diff --git a/recipes/libnova/all/test_package/conanfile.py b/recipes/libnova/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnova/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/libnova/all/test_package/test_package.c b/recipes/libnova/all/test_package/test_package.c new file mode 100644 index 0000000000000..d69fcbb71b726 --- /dev/null +++ b/recipes/libnova/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include + +#include + +int main(void) { + struct ln_date date; + date.years = 1987; + date.months = 4; + date.days = 10; + date.hours = 19; + date.minutes = 21; + date.seconds = 0.0; + double julian_day = ln_get_julian_day(&date); + printf("JD %f\n", julian_day); + + struct ln_helio_posn pos; + ln_get_mars_helio_coords(julian_day, &pos); + printf("Mars L %f B %f R %f\n", pos.L, pos.B, pos.R); + + return 0; +} diff --git a/recipes/libnova/all/test_v1_package/CMakeLists.txt b/recipes/libnova/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnova/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnova/all/test_v1_package/conanfile.py b/recipes/libnova/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnova/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/libnova/config.yml b/recipes/libnova/config.yml new file mode 100644 index 0000000000000..e5e40881d5003 --- /dev/null +++ b/recipes/libnova/config.yml @@ -0,0 +1,3 @@ +versions: + "0.16.0": + folder: all diff --git a/recipes/libnuma/all/conandata.yml b/recipes/libnuma/all/conandata.yml new file mode 100644 index 0000000000000..0c573279e69f1 --- /dev/null +++ b/recipes/libnuma/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.14": + url: "https://github.com/numactl/numactl/releases/download/v2.0.14/numactl-2.0.14.tar.gz" + sha256: "826bd148c1b6231e1284e42a4db510207747484b112aee25ed6b1078756bcff6" +patches: + "2.0.14": + - patch_file: "patches/symver.patch" diff --git a/recipes/libnuma/all/conanfile.py b/recipes/libnuma/all/conanfile.py new file mode 100644 index 0000000000000..949eef6d498c5 --- /dev/null +++ b/recipes/libnuma/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibnumaConan(ConanFile): + name = "libnuma" + description = "NUMA support for Linux." + license = "LGPL-2.1-or-later" + topics = ("numa",) + homepage = "https://github.com/numactl/numactl" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + del self.options.fPIC + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libnuma is only supported on Linux") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE.LGPL2.1", 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, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "numa") + self.cpp_info.libs = ["numa"] + self.cpp_info.system_libs = ["dl", "pthread"] diff --git a/recipes/libnuma/all/patches/symver.patch b/recipes/libnuma/all/patches/symver.patch new file mode 100644 index 0000000000000..cf1fbc1cee1a5 --- /dev/null +++ b/recipes/libnuma/all/patches/symver.patch @@ -0,0 +1,21 @@ +https://github.com/numactl/numactl/pull/95 +From 87cba5ff171744920597f68049664b721f0af112 Mon Sep 17 00:00:00 2001 +From: Scott McMillan +Date: Fri, 9 Oct 2020 08:56:52 -0500 +Subject: [PATCH] Do not stringify SYMVER symbols + +--- + util.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util.h b/util.h +index 99ada33..f2a20ac 100644 +--- a/util.h ++++ b/util.h +@@ -22,5 +22,5 @@ extern char *policy_name(int policy); + #if HAVE_ATTRIBUTE_SYMVER + #define SYMVER(a,b) __attribute__ ((symver (b))) + #else +-#define SYMVER(a,b) __asm__ (".symver " #a "," #b); ++#define SYMVER(a,b) __asm__ (".symver " a "," b); + #endif diff --git a/recipes/libnuma/all/test_package/CMakeLists.txt b/recipes/libnuma/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4a335520f487b --- /dev/null +++ b/recipes/libnuma/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libnuma REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnuma::libnuma) diff --git a/recipes/libnuma/all/test_package/conanfile.py b/recipes/libnuma/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libnuma/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/libnuma/all/test_package/test_package.c b/recipes/libnuma/all/test_package/test_package.c new file mode 100644 index 0000000000000..4f54f802f2325 --- /dev/null +++ b/recipes/libnuma/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("numa available: %d\n", numa_available()); + return 0; +} diff --git a/recipes/libnuma/all/test_v1_package/CMakeLists.txt b/recipes/libnuma/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libnuma/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnuma/all/test_v1_package/conanfile.py b/recipes/libnuma/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libnuma/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/libnuma/config.yml b/recipes/libnuma/config.yml new file mode 100644 index 0000000000000..819ebd6fb8395 --- /dev/null +++ b/recipes/libnuma/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.14": + folder: all diff --git a/recipes/liboping/all/conandata.yml b/recipes/liboping/all/conandata.yml new file mode 100644 index 0000000000000..383d4f884713f --- /dev/null +++ b/recipes/liboping/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.10.0": + url: "https://noping.cc/files/liboping-1.10.0.tar.gz" + sha256: "c206b05743d0730814be3115b48abd0b00016677525153c78730da307aba0846" +patches: + "1.10.0": + - patch_file: "patches/1.10.0-suppress_truncate.patch" + base_path: "source_subfolder" + diff --git a/recipes/liboping/all/conanfile.py b/recipes/liboping/all/conanfile.py new file mode 100644 index 0000000000000..21125770e672e --- /dev/null +++ b/recipes/liboping/all/conanfile.py @@ -0,0 +1,103 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class LibopingConan(ConanFile): + name = "liboping" + description = "A multi server ping library" + topics = ("oping", "ping", "icmp") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://noping.cc" + license = ["LGPL-2.1", "GPL-2.0"] + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["patches/**"] + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("liboping is not supported by Visual Studio") + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Liboping could not be built on {} as shared library".format(self.settings.os)) + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # Build error - NO Access to a Mac/M1 - please fix when possible - see issue 8634 + raise ConanInvalidConfiguration("Liboping cannot be built on a Mac/M1 at this time") + + 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 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) + 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)), + "--without-ncurses", + "--without-perl-bindings", + ] + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def build(self): + self._patch_sources() + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + 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") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + 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.libs = ["oping"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/liboping/all/patches/1.10.0-suppress_truncate.patch b/recipes/liboping/all/patches/1.10.0-suppress_truncate.patch new file mode 100644 index 0000000000000..15fae8ddf0ab4 --- /dev/null +++ b/recipes/liboping/all/patches/1.10.0-suppress_truncate.patch @@ -0,0 +1,18 @@ +--- a/src/liboping.c 2022-01-04 12:15:14.312483115 -0700 ++++ b/src/liboping.c 2022-01-04 12:16:40.031084749 -0700 +@@ -203,8 +203,15 @@ + static void ping_set_error (pingobj_t *obj, const char *function, + const char *message) + { ++#if __GNUC__ >= 7 ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-truncation" ++#endif + snprintf (obj->errmsg, sizeof (obj->errmsg), + "%s: %s", function, message); ++#if __GNUC__ >= 7 ++#pragma GCC diagnostic pop ++#endif + obj->errmsg[sizeof (obj->errmsg) - 1] = 0; + } + diff --git a/recipes/liboping/all/test_package/CMakeLists.txt b/recipes/liboping/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30961cdb0ded2 --- /dev/null +++ b/recipes/liboping/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(liboping CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} liboping::liboping) diff --git a/recipes/liboping/all/test_package/conanfile.py b/recipes/liboping/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b7bbf79eba926 --- /dev/null +++ b/recipes/liboping/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "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/liboping/all/test_package/test_package.c b/recipes/liboping/all/test_package/test_package.c new file mode 100644 index 0000000000000..775d10557877b --- /dev/null +++ b/recipes/liboping/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include + +int main() { + printf("************* Testing liboping ***************\n"); + pingobj_t *po; + po = ping_construct(); + if (po == NULL) { + printf("\tFAIL\n"); + return 1; + } + ping_destroy(po); + printf("\tOK\n"); + printf("***********************************************\n"); + return 0; +} diff --git a/recipes/liboping/config.yml b/recipes/liboping/config.yml new file mode 100644 index 0000000000000..703aaba144d10 --- /dev/null +++ b/recipes/liboping/config.yml @@ -0,0 +1,3 @@ +versions: + "1.10.0": + folder: all diff --git a/recipes/libpcap/all/conandata.yml b/recipes/libpcap/all/conandata.yml new file mode 100644 index 0000000000000..c909e32c74890 --- /dev/null +++ b/recipes/libpcap/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.10.1": + url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.10.1.tar.gz" + sha256: "7b650c9e0ce246aa41ba5463fe8e903efc444c914a3ccb986547350bed077ed6" + "1.10.0": + url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.10.0.tar.gz" + sha256: "7d8c18f740c0b630f55699ea22191ffbbba483f48ea60506848f9241d3973763" + "1.9.1": + url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.9.1.tar.gz" + sha256: "8ac670de8dd6eff39441580c67f0520f326773422bbf89fdffcd269bd0cfddde" diff --git a/recipes/libpcap/all/conanfile.py b/recipes/libpcap/all/conanfile.py new file mode 100644 index 0000000000000..f8f592dda7427 --- /dev/null +++ b/recipes/libpcap/all/conanfile.py @@ -0,0 +1,173 @@ +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.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import glob +import os +import shutil + +required_conan_version = ">=1.53.0" + + +class LibPcapConan(ConanFile): + name = "libpcap" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/the-tcpdump-group/libpcap" + description = "libpcap is an API for capturing network traffic" + license = "BSD-3-Clause" + topics = ("networking", "pcap", "sniffing", "network-traffic") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_libusb": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_libusb": False, + } + + # TODO: Add dbus-glib when available + # TODO: Add libnl-genl when available + # TODO: Add libbluetooth when available + # TODO: Add libibverbs when available + + @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 + if self.settings.os != "Linux": + del self.options.enable_libusb + + 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): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("enable_libusb"): + self.requires("libusb/1.0.26") + + def validate(self): + if Version(self.version) < "1.10.0" and self.settings.os == "Macos" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on OSX.") + if hasattr(self, "settings_build") and cross_building(self) and \ + self.options.shared and is_apple_os(self): + raise ConanInvalidConfiguration("cross-build of libpcap shared is broken on Apple") + if Version(self.version) < "1.10.1" and self.settings.os == "Windows" and not self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built static on Windows") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + if not self.options.shared: + tc.variables["ENABLE_REMOTE"] = False + if is_msvc(self): + tc.variables["USE_STATIC_RT"] = is_msvc_static_runtime(self) + else: + # Don't force -static-libgcc for MinGW, because conan users expect + # to inject this compilation flag themselves + tc.variables["USE_STATIC_RT"] = False + tc.generate() + else: + if not cross_building(self): + VirtualRunEnv(self).generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-usb={yes_no(self.options.get_safe('enable_libusb'))}", + "--disable-universal", + "--without-libnl", + "--disable-bluetooth", + "--disable-packet-ring", + "--disable-dbus", + "--disable-rdma", + ]) + if cross_building(self): + target_os = "linux" if self.settings.os == "Linux" else "null" + tc.configure_args.append(f"--with-pcap={target_os}") + elif "arm" in self.settings.arch and self.settings.os == "Linux": + tc.configure_args.append("--host=arm-linux") + tc.generate() + + AutotoolsDeps(self).generate() + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + + def flatten_filetree(folder): + for file in glob.glob(folder + "/**/*"): + shutil.move(file, folder + os.sep) + for subdir in [dir[0] for dir in os.walk(folder) if dir[0] != folder]: + os.rmdir(subdir) + + # libpcap installs into a subfolder like x64 or amd64 + with chdir(self, self.package_folder): + flatten_filetree("bin") + flatten_filetree("lib") + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.shared: + rm(self, "pcap_static.lib", os.path.join(self.package_folder, "lib")) + rm(self, "libpcap.a", os.path.join(self.package_folder, "lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libpcap") + suffix = "_static" if self.settings.os == "Windows" and not self.options.shared else "" + self.cpp_info.libs = [f"pcap{suffix}"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libpcap/all/test_package/CMakeLists.txt b/recipes/libpcap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..647522630d58c --- /dev/null +++ b/recipes/libpcap/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libpcap REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libpcap::libpcap) diff --git a/recipes/libpcap/all/test_package/conanfile.py b/recipes/libpcap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libpcap/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libpcap/all/test_package/test_package.c b/recipes/libpcap/all/test_package/test_package.c new file mode 100644 index 0000000000000..38d5fcdbefaab --- /dev/null +++ b/recipes/libpcap/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include + +#include "pcap.h" + +int main(void) +{ + char errbuf[PCAP_ERRBUF_SIZE] = {0}; + bpf_u_int32 netp = 0; + bpf_u_int32 maskp = 0; + const char* dev = NULL; + + // device lookup + dev = pcap_lookupdev(errbuf); + if (dev != NULL) { + if (pcap_lookupnet(dev, &netp, &maskp, errbuf) == -1) { + fprintf(stderr, "Couldn't get netmask for device %s: %s\n", dev, errbuf); + } else { + fprintf(stdout, "Lookup success on device %s\n", dev); + } + } else { + fprintf(stderr, "Couldn't lookup devices: %s\n", errbuf); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/libpcap/all/test_v1_package/CMakeLists.txt b/recipes/libpcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libpcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpcap/all/test_v1_package/conanfile.py b/recipes/libpcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libpcap/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/libpcap/config.yml b/recipes/libpcap/config.yml new file mode 100644 index 0000000000000..102e778434a57 --- /dev/null +++ b/recipes/libpcap/config.yml @@ -0,0 +1,7 @@ +versions: + "1.10.1": + folder: all + "1.10.0": + folder: all + "1.9.1": + folder: all diff --git a/recipes/libpciaccess/all/conandata.yml b/recipes/libpciaccess/all/conandata.yml new file mode 100644 index 0000000000000..223034d0c456a --- /dev/null +++ b/recipes/libpciaccess/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.17": + url: "https://www.x.org/archive//individual/lib/libpciaccess-0.17.tar.xz" + sha256: "74283ba3c974913029e7a547496a29145b07ec51732bbb5b5c58d5025ad95b73" + "0.16": + url: "https://www.x.org/archive//individual/lib/libpciaccess-0.16.tar.gz" + sha256: "84413553994aef0070cf420050aa5c0a51b1956b404920e21b81e96db6a61a27" diff --git a/recipes/libpciaccess/all/conanfile.py b/recipes/libpciaccess/all/conanfile.py new file mode 100644 index 0000000000000..fffe763dbedc4 --- /dev/null +++ b/recipes/libpciaccess/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.53.0" + + +class LibPciAccessConan(ConanFile): + name = "libpciaccess" + description = "Generic PCI access library" + topics = ("pci", "xorg") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.freedesktop.org/xorg/lib/libpciaccess" + license = "MIT", "X11" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + def is_supported(settings): + if settings.os in ("Linux", "FreeBSD", "SunOS"): + return True + return settings.os == "Windows" and settings.get_safe("os.subsystem") == "cygwin" + if not is_supported(self.settings): + raise ConanInvalidConfiguration("Unsupported architecture.") + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + self.tool_requires("xorg-macros/1.19.3") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + ms = VirtualBuildEnv(self) + ms.generate() + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["pciaccess"] + self.cpp_info.set_property("pkg_config_name", "pciaccess") diff --git a/recipes/libpciaccess/all/test_package/CMakeLists.txt b/recipes/libpciaccess/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6f3ddc50ab4d --- /dev/null +++ b/recipes/libpciaccess/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libpciaccess REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpciaccess::libpciaccess) diff --git a/recipes/libpciaccess/all/test_package/conanfile.py b/recipes/libpciaccess/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libpciaccess/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/libpciaccess/all/test_package/test_package.c b/recipes/libpciaccess/all/test_package/test_package.c new file mode 100644 index 0000000000000..08fdca1d2e02f --- /dev/null +++ b/recipes/libpciaccess/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(void) { + pci_system_init(); + pci_system_cleanup(); + return EXIT_SUCCESS; +} diff --git a/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt b/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpciaccess/all/test_v1_package/conanfile.py b/recipes/libpciaccess/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libpciaccess/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/libpciaccess/config.yml b/recipes/libpciaccess/config.yml new file mode 100644 index 0000000000000..5b9c678c9d392 --- /dev/null +++ b/recipes/libpciaccess/config.yml @@ -0,0 +1,5 @@ +versions: + "0.17": + folder: all + "0.16": + folder: all diff --git a/recipes/libpfm4/all/conandata.yml b/recipes/libpfm4/all/conandata.yml new file mode 100644 index 0000000000000..ccfa567e2963b --- /dev/null +++ b/recipes/libpfm4/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.12.0": + url: "https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.12.0.tar.gz" + sha256: "4b0c1f53f39a61525b69bebf532c68040c1b984d7544a8ae0844b13cd91e1ee4" diff --git a/recipes/libpfm4/all/conanfile.py b/recipes/libpfm4/all/conanfile.py new file mode 100644 index 0000000000000..89894d3e1796e --- /dev/null +++ b/recipes/libpfm4/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.files import get, rmdir, copy, replace_in_file +from conan.errors import ConanInvalidConfiguration +import os + + +class Libpfm4Conan(ConanFile): + name = "libpfm4" + license = "MIT" + homepage = "http://perfmon2.sourceforge.net" + url = "https://github.com/conan-io/conan-center-index" + description = ("A helper library to program the performance monitoring events") + topics = ("perf", "pmu", "benchmark", "microbenchmark") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + def validate(self): + # The library doesn't really make much sense without perf_events API + # and currently does not compile on modern Mac OS X && Windows + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("This library is Linux only") + + def config_options(self): + # and currently does not compile on modern Mac OS X && Windows + 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.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def _patch_sources(self): + if not self.options.shared: + # honor fPIC option + replace_in_file(self, os.path.join(self.source_folder, "rules.mk"), "-fPIC", "") + replace_in_file(self, os.path.join(self.source_folder, "rules.mk"), "-DPIC", "") + + def build(self): + self._patch_sources() + args = [ + 'DBG=', + 'CONFIG_PFMLIB_SHARED={}'.format("y" if self.options.shared else "n"), + f'-C {self.source_folder}' + ] + autotools = Autotools(self) + autotools.make(args=args) + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + args = [ + 'DBG=', + 'LDCONFIG=true', + 'CONFIG_PFMLIB_SHARED={}'.format("y" if self.options.shared else "n"), + f'DESTDIR={self.package_folder}{os.sep}', + f'INCDIR=include{os.sep}', + f'LIBDIR=lib{os.sep}', + f'-C {self.source_folder}' + ] + # due to bug, Mac install phase fails with config shared + if self.settings.os == 'Macos': + args.append('CONFIG_PFMLIB_SHARED=n') + + copy(self, "err.h", dst=os.path.join(self.package_folder, "include", "perfmon"), src=os.path.join(self.source_folder, "include", "perfmon")) + autotools = Autotools(self) + autotools.install(args=args) + rmdir(self, os.path.join(self.package_folder, "usr")) + + def package_info(self): + self.cpp_info.libs = ["pfm"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libpfm4/all/test_package/CMakeLists.txt b/recipes/libpfm4/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c93d1fbd7ce51 --- /dev/null +++ b/recipes/libpfm4/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(libpfm4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpfm4::libpfm4) diff --git a/recipes/libpfm4/all/test_package/conanfile.py b/recipes/libpfm4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libpfm4/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/libpfm4/all/test_package/test_package.c b/recipes/libpfm4/all/test_package/test_package.c new file mode 100644 index 0000000000000..22dc57834a15e --- /dev/null +++ b/recipes/libpfm4/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include + + +int main(void) { + int version = 0; + + pfm_initialize(); + version = pfm_get_version(); + printf("PFM VERSION: %d\n", version); + pfm_terminate(); + + return EXIT_SUCCESS; +} diff --git a/recipes/libpfm4/all/test_v1_package/CMakeLists.txt b/recipes/libpfm4/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..92ff6b140a2cc --- /dev/null +++ b/recipes/libpfm4/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libpfm4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpfm4::libpfm4) diff --git a/recipes/libpfm4/all/test_v1_package/conanfile.py b/recipes/libpfm4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/libpfm4/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libpfm4/config.yml b/recipes/libpfm4/config.yml new file mode 100644 index 0000000000000..b06c46e0f08f9 --- /dev/null +++ b/recipes/libpfm4/config.yml @@ -0,0 +1,3 @@ +versions: + "4.12.0": + folder: all diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml new file mode 100644 index 0000000000000..e10462996e48c --- /dev/null +++ b/recipes/libpng/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "1.6.39": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.39/libpng-1.6.39.tar.xz" + sha256: "1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937" + "1.6.38": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.38/libpng-1.6.38.tar.xz" + sha256: "b3683e8b8111ebf6f1ac004ebb6b0c975cd310ec469d98364388e9cedbfa68be" + "1.6.37": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.xz" + sha256: "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" + "1.5.30": + url: "https://sourceforge.net/projects/libpng/files/libpng15/1.5.30/libpng-1.5.30.tar.xz" + sha256: "7d76275fad2ede4b7d87c5fd46e6f488d2a16b5a69dc968ffa840ab39ba756ed" +patches: + "1.6.37": + - patch_file: "patches/0001-1.6.37-cmakefile-zlib.patch" + patch_description: "Update ZLib include and library paths for conan to provide\ + \ lib. Remove Zlib dll definition." + patch_type: "conan" + "1.5.30": + - patch_file: "patches/0001-1.5.30-cmakefile-zlib.patch" + patch_description: "Update ZLib include and library paths for conan to provide\ + \ lib. Remove Zlib dll definition." + patch_type: "conan" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py new file mode 100644 index 0000000000000..5b838438efa3b --- /dev/null +++ b/recipes/libpng/all/conanfile.py @@ -0,0 +1,185 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibpngConan(ConanFile): + name = "libpng" + description = "libpng is the official PNG file format reference library." + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.libpng.org" + license = "libpng-2.0" + topics = ("png", "graphics", "image") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "neon": [True, "check", False], + "msa": [True, False], + "sse": [True, False], + "vsx": [True, False], + "api_prefix": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "neon": True, + "msa": True, + "sse": True, + "vsx": True, + "api_prefix": "", + } + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _has_neon_support(self): + return "arm" in self.settings.arch + + @property + def _has_msa_support(self): + return "mips" in self.settings.arch + + @property + def _has_sse_support(self): + return self.settings.arch in ["x86", "x86_64"] + + @property + def _has_vsx_support(self): + return "ppc" in self.settings.arch + + @property + def _neon_msa_sse_vsx_mapping(self): + return { + "True": "on", + "False": "off", + "check": "check", + } + + 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_neon_support: + del self.options.neon + if not self._has_msa_support: + del self.options.msa + if not self._has_sse_support: + del self.options.sse + if not self._has_vsx_support: + del self.options.vsx + + 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): + self.requires("zlib/1.2.13") + + def validate(self): + if Version(self.version) < "1.6" and self.settings.arch == "armv8" and is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} currently does not building for {self.settings.os} {self.settings.arch}. Contributions are welcomed") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PNG_TESTS"] = False + tc.variables["PNG_SHARED"] = self.options.shared + tc.variables["PNG_STATIC"] = not self.options.shared + tc.variables["PNG_DEBUG"] = self.settings.build_type == "Debug" + tc.variables["PNG_PREFIX"] = self.options.api_prefix + if self._has_neon_support: + tc.variables["PNG_ARM_NEON"] = self._neon_msa_sse_vsx_mapping[str(self.options.neon)] + if self._has_msa_support: + tc.variables["PNG_MIPS_MSA"] = self._neon_msa_sse_vsx_mapping[str(self.options.msa)] + if self._has_sse_support: + tc.variables["PNG_INTEL_SSE"] = self._neon_msa_sse_vsx_mapping[str(self.options.sse)] + if self._has_vsx_support: + tc.variables["PNG_POWERPC_VSX"] = self._neon_msa_sse_vsx_mapping[str(self.options.vsx)] + if Version(self.version) >= "1.6.38": + tc.variables["PNG_EXECUTABLES"] = False + + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.settings.os == "Windows": + if Version(self.version) <= "1.5.2": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)', + 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME})') + else: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + 'OUTPUT_NAME "${PNG_LIB_NAME}_static', + 'OUTPUT_NAME "${PNG_LIB_NAME}') + if not (is_msvc(self) or self._is_clang_cl): + if Version(self.version) < "1.6.38": + src_text = 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}' + else: + src_text = '''COMMAND "${CMAKE_COMMAND}" + -E copy_if_different + $ + $/${DEST_FILE}''' + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + src_text, + 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') + + def build(self): + self._patch_sources() + 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() + if self.options.shared: + rm(self, "*[!.dll]", os.path.join(self.package_folder, "bin")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "libpng")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + major_min_version = f"{Version(self.version).major}{Version(self.version).minor}" + + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "PNG") + self.cpp_info.set_property("cmake_target_name", "PNG::PNG") + self.cpp_info.set_property("pkg_config_name", "libpng") + self.cpp_info.set_property("pkg_config_aliases", [f"libpng{major_min_version}"]) + + prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" + suffix = major_min_version if self.settings.os == "Windows" else "" + suffix += "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"{prefix}png{suffix}"] + if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: + self.cpp_info.system_libs.append("m") + + # TODO: Remove after Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "PNG" + self.cpp_info.names["cmake_find_package_multi"] = "PNG" diff --git a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch new file mode 100644 index 0000000000000..d78bd326e5e4c --- /dev/null +++ b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b861195..8e3d2ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,7 @@ set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) + + # needed packages + find_package(ZLIB REQUIRED) +-include_directories(${ZLIB_INCLUDE_DIR}) ++include_directories(${ZLIB_INCLUDE_DIRS}) + + if(NOT WIN32) + find_library(M_LIBRARY +@@ -312,7 +312,7 @@ if(PNG_DEBUG) + endif() + + # NOW BUILD OUR TARGET +-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) + + unset(PNG_LIB_TARGETS) + +@@ -326,7 +326,7 @@ if(PNG_SHARED) + set_target_properties(png PROPERTIES PREFIX "lib") + set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") + endif() +- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) + + if(UNIX AND AWK) + if(HAVE_LD_VERSION_SCRIPT) +@@ -361,7 +361,7 @@ if(PNG_STATIC) + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(png_static PROPERTIES PREFIX "lib") + endif() +- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) + endif() + + if(PNG_FRAMEWORK) +@@ -378,7 +378,7 @@ if(PNG_FRAMEWORK) + XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" + PUBLIC_HEADER "${libpng_public_hdrs}" + OUTPUT_NAME png) +- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) + endif() + + if(NOT PNG_LIB_TARGETS) diff --git a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch new file mode 100644 index 0000000000000..aaf8fda5cb495 --- /dev/null +++ b/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch @@ -0,0 +1,56 @@ +--- CMakeLists.txt 2019-04-14 20:10:32.000000000 +0200 ++++ CMakeLists.txt 2019-07-04 11:25:33.862280292 +0200 +@@ -40,7 +40,7 @@ + + if(NOT PNG_BUILD_ZLIB) + find_package(ZLIB REQUIRED) +- include_directories(${ZLIB_INCLUDE_DIR}) ++ include_directories(${ZLIB_INCLUDE_DIRS}) + endif() + + if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) +@@ -522,7 +522,7 @@ + endif() + + # NOW BUILD OUR TARGET +-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) + + unset(PNG_LIB_TARGETS) + +@@ -536,7 +536,7 @@ + set_target_properties(png PROPERTIES PREFIX "lib") + set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") + endif() +- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) + + if(UNIX AND AWK) + if(HAVE_LD_VERSION_SCRIPT) +@@ -571,7 +571,7 @@ + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(png_static PROPERTIES PREFIX "lib") + endif() +- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) + endif() + + if(PNG_FRAMEWORK) +@@ -588,7 +588,7 @@ + XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" + PUBLIC_HEADER "${libpng_public_hdrs}" + OUTPUT_NAME png) +- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) + endif() + + if(NOT PNG_LIB_TARGETS) +@@ -753,7 +753,7 @@ + set(PNG_BIN_TARGETS pngfix) + + add_executable(png-fix-itxt ${png_fix_itxt_sources}) +- target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY}) + list(APPEND PNG_BIN_TARGETS png-fix-itxt) + endif() + diff --git a/recipes/libpng/all/test_package/CMakeLists.txt b/recipes/libpng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..59e144e90a535 --- /dev/null +++ b/recipes/libpng/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(PNG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PNG::PNG) diff --git a/recipes/libpng/all/test_package/conanfile.py b/recipes/libpng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libpng/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/libpng/all/test_package/test_package.c b/recipes/libpng/all/test_package/test_package.c new file mode 100644 index 0000000000000..1f4c2a28428ab --- /dev/null +++ b/recipes/libpng/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include "png.h" + + +int main(void) { + png_structp png_ptr; + png_infop info_ptr; + + fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n", PNG_LIBPNG_VER_STRING, png_libpng_ver); + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info_ptr = png_create_info_struct(png_ptr); + + return EXIT_SUCCESS; +} diff --git a/recipes/libpng/all/test_v1_package/CMakeLists.txt b/recipes/libpng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libpng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpng/all/test_v1_package/conanfile.py b/recipes/libpng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libpng/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libpng/config.yml b/recipes/libpng/config.yml new file mode 100644 index 0000000000000..feabbd00c1919 --- /dev/null +++ b/recipes/libpng/config.yml @@ -0,0 +1,9 @@ +versions: + "1.6.39": + folder: all + "1.6.38": + folder: all + "1.6.37": + folder: all + "1.5.30": + folder: all diff --git a/recipes/libpointmatcher/all/conandata.yml b/recipes/libpointmatcher/all/conandata.yml new file mode 100644 index 0000000000000..448e7fdb12dff --- /dev/null +++ b/recipes/libpointmatcher/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.3.1": + url: "https://github.com/ethz-asl/libpointmatcher/archive/refs/tags/1.3.1.tar.gz" + sha256: "82f93d2e7689efeef8837b8e969919b51c51ad4a1d1fa921c4dd8df4811378ab" +patches: + "1.3.1": + - patch_file: "patches/1.3.1-0001-fix-cmake.patch" + patch_description: "Fix upstream CMakeLists" + patch_type: "conan" diff --git a/recipes/libpointmatcher/all/conanfile.py b/recipes/libpointmatcher/all/conanfile.py new file mode 100644 index 0000000000000..b189d68d9c79e --- /dev/null +++ b/recipes/libpointmatcher/all/conanfile.py @@ -0,0 +1,88 @@ +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, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibpointmatcherConan(ConanFile): + name = "libpointmatcher" + description = "An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics" + license = "BSD-3-Clause" + topics = ("robotics", "lidar", "point-cloud") + homepage = "https://github.com/ethz-asl/libpointmatcher" + 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_openmp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": False, + } + + @property + def _min_cppstd(self): + return "11" + + 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.81.0", transitive_headers=True) + # FIXME: eigen 3.4.0 is not compatible yet (see https://github.com/ethz-asl/libpointmatcher/issues/496) + self.requires("eigen/3.3.9", transitive_headers=True) + self.requires("libnabo/1.0.7") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["USE_OPEN_MP"] = self.options.with_openmp + tc.cache_variables["USE_OPEN_CL"] = False + tc.cache_variables["SHARED_LIBS"] = self.options.shared + # TODO: to unvendor, but libpointmatcher depends on legacy API of yaml-cpp (0.3.x) + tc.variables["USE_SYSTEM_YAML_CPP"] = 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, "copyright", src=os.path.join(self.source_folder, "debian"), + dst=os.path.join(self.package_folder, "licenses")) + 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", "libpointmatcher") + self.cpp_info.set_property("pkg_config_name", "libpointmatcher") + self.cpp_info.libs = ["pointmatcher"] diff --git a/recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch b/recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..bec21dac0c243 --- /dev/null +++ b/recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch @@ -0,0 +1,208 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.8.11) ++cmake_minimum_required(VERSION 3.15) + + include(CheckSymbolExists) + +@@ -46,6 +46,7 @@ if( BUILD_32 ) + endif( BUILD_32 ) + + # Ensure proper build type ++if(0) + if (NOT CMAKE_BUILD_TYPE) + message("-- No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.") + set(CMAKE_BUILD_TYPE Release CACHE STRING +@@ -65,12 +66,14 @@ endif (NOT CMAKE_BUILD_TYPE) + if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-O3) + endif(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") ++endif() + + # For Windows + if( MSVC ) + add_definitions( /D _VARIADIC_MAX=10 ) # VS2012 does not support tuples correctly yet + add_definitions( /D _USE_MATH_DEFINES) # defines M_PI for Visual Studio + add_definitions( /D _ENABLE_EXTENDED_ALIGNED_STORAGE) # this variable must be defined with VS2017 to acknowledge alignment changes of aligned_storage ++ add_compile_options(/bigobj) + endif() + + #======================= installation ===================================== +@@ -120,19 +123,16 @@ if (Boost_MINOR_VERSION GREATER 47) + find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono REQUIRED) + endif (Boost_MINOR_VERSION GREATER 47) + include_directories(${Boost_INCLUDE_DIRS}) +-set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${Boost_LIBRARIES}) ++set(EXTERNAL_LIBS ${EXTERNAL_LIBS} Boost::headers Boost::thread Boost::filesystem Boost::system Boost::program_options Boost::date_time Boost::chrono) + + + #-------------------- + # DEPENDENCY: eigen 3 + #-------------------- +-find_path(EIGEN_INCLUDE_DIR Eigen/Core +- /usr/local/include/eigen3 +- /usr/include/eigen3 +-) ++find_package(Eigen3 REQUIRED CONFIG) ++set(EXTERNAL_LIBS ${EXTERNAL_LIBS} Eigen3::Eigen ) + + # Suppress Eigen's warning by adding it to the system's library +-include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}") + + #TODO: this should be a more standard way + #find_package(Eigen3 REQUIRED) +@@ -143,10 +143,9 @@ include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}") + #-------------------- + # DEPENDENCY: nabo + #-------------------- +-find_package(libnabo REQUIRED PATHS ${LIBNABO_INSTALL_DIR}) ++find_package(libnabo REQUIRED CONFIG) + #include(libnaboConfig) +-include_directories(${libnabo_INCLUDE_DIRS}) +-set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${libnabo_LIBRARIES}) ++set(EXTERNAL_LIBS ${EXTERNAL_LIBS} libnabo::nabo) + message(STATUS "libnabo found, version ${libnabo_VERSION} (include=${libnabo_INCLUDE_DIRS} libs=${libnabo_LIBRARIES})") + + #-------------------- +@@ -215,8 +214,7 @@ else(USE_SYSTEM_YAML_CPP) + #get_property(yaml-cpp-pm_INCLUDE TARGET yaml-cpp-pm PROPERTY INCLUDE_DIRECTORIES) + #include_directories(${yaml-cpp-pm_INCLUDE}) + +- get_property(yaml-cpp-pm_LIB TARGET yaml-cpp-pm PROPERTY LOCATION) +- set (EXTERNAL_LIBS ${EXTERNAL_LIBS} ${yaml-cpp-pm_LIB} ) ++ set (EXTERNAL_LIBS ${EXTERNAL_LIBS} yaml-cpp-pm ) + set (EXTRA_DEPS ${EXTRA_DEPS} yaml-cpp-pm) + set(yamlcpp_FOUND) + +@@ -241,6 +239,7 @@ endif (POSIX_TIMERS AND NOT APPLE) + #========================== libpointmatcher itself ============================== + + # Check the compiler version as we need full C++11 support. ++if(0) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # using Clang + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3") +@@ -276,6 +275,7 @@ if (CMAKE_VERSION VERSION_LESS "3.1") + else () + set (CMAKE_CXX_STANDARD 11) + endif () ++endif() + + # SOURCE + +@@ -350,12 +350,12 @@ file(GLOB_RECURSE POINTMATCHER_HEADERS "pointmatcher/*.h") + + # MacOS and Windows deal with shared/dynamic library differently. For + # simplicity, we only authorize static library in those cases. +-if(APPLE OR WIN32) ++if(0) + + add_library(pointmatcher ${POINTMATCHER_SRC} ${POINTMATCHER_HEADERS} ) + install(TARGETS pointmatcher ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) + +-else(APPLE OR WIN32) ++else() + set(SHARED_LIBS "true" CACHE BOOL "To build shared (true) or static (false) library") + + if (SHARED_LIBS) +@@ -369,14 +369,15 @@ else(APPLE OR WIN32) + add_library(pointmatcher ${POINTMATCHER_SRC} ${POINTMATCHER_HEADERS} ) + install(TARGETS pointmatcher ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) + endif(SHARED_LIBS) +-endif(APPLE OR WIN32) ++ set_target_properties(pointmatcher PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) ++ target_compile_features(pointmatcher PUBLIC cxx_std_11) ++endif() + + target_include_directories(pointmatcher PRIVATE ${CMAKE_SOURCE_DIR}/pointmatcher) + target_include_directories(pointmatcher PRIVATE ${CMAKE_SOURCE_DIR}/pointmatcher/DataPointsFilters) + target_include_directories(pointmatcher PRIVATE ${CMAKE_SOURCE_DIR}/pointmatcher/DataPointsFilters/utils) + + # link all libraries to libpointmatcher +-add_definitions(-Wall) + #target_link_libraries(pointmatcher ${yaml-cpp_LIBRARIES} ${libnabo_LIBRARIES}) + target_link_libraries(pointmatcher ${EXTERNAL_LIBS}) + +@@ -432,11 +433,8 @@ endif(GENERATE_API_DOC) + #=============== trigger other makefile ====================== + + # Example programs +-add_subdirectory(examples) + # Evaluation programs +-add_subdirectory(evaluations) + # Unit testing +-add_subdirectory(utest) + + + #=================== allow find_package() ========================= +@@ -451,6 +449,7 @@ add_subdirectory(utest) + # 1- local build # + + # Register the local build in case one doesn't use "make install" ++if(0) + export(PACKAGE libpointmatcher) + + # Create variable for the local build tree +@@ -537,3 +536,4 @@ configure_file( + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) ++endif() +--- a/contrib/CMakeLists.txt ++++ b/contrib/CMakeLists.txt +@@ -1,8 +1,6 @@ + # External libraries packed with libpointmatcher + + # GTest +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +-add_library(gtest gtest/gtest-all.cc) + + # Wrapped yaml-cpp + if(NOT USE_SYSTEM_YAML_CPP) +--- a/contrib/yaml-cpp-pm/CMakeLists.txt ++++ b/contrib/yaml-cpp-pm/CMakeLists.txt +@@ -19,7 +19,6 @@ set(YAML_CPP_BUILD_CONTRIB OFF) + # --> General + # see http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:BUILD_SHARED_LIBS + # http://www.cmake.org/cmake/help/cmake2.6docs.html#command:add_library +-set(BUILD_SHARED_LIBS OFF) + + # --> Apple + option(APPLE_UNIVERSAL_BIN "Apple: Build universal binary" OFF) +@@ -55,7 +54,6 @@ endif() + + if(WIN32) + if(BUILD_SHARED_LIBS) +- add_definitions(-D${PROJECT_NAME}_DLL) # use or build Windows DLL + endif() + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "C:/") +@@ -63,7 +61,7 @@ if(WIN32) + endif() + + # GCC / Clang specialities +-if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") ++if(0) + ### General stuff + if(WIN32) + set(CMAKE_SHARED_LIBRARY_PREFIX "") # DLLs do not have a "lib" prefix +@@ -105,7 +103,7 @@ endif() + ### + ### Library + ### +-add_library(yaml-cpp-pm ++add_library(yaml-cpp-pm OBJECT + ${sources} + ${public_headers} + ${private_headers} +@@ -113,6 +111,9 @@ add_library(yaml-cpp-pm + ${contrib_public_headers} + ${contrib_private_headers} + ) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(yaml-cpp-pm PROPERTIES POSITION_INDEPENDENT_CODE ON) ++endif() + + set_target_properties(yaml-cpp-pm PROPERTIES + VERSION "${YAML_CPP_VERSION}" diff --git a/recipes/libpointmatcher/all/test_package/CMakeLists.txt b/recipes/libpointmatcher/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b3a37d353b52c --- /dev/null +++ b/recipes/libpointmatcher/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libpointmatcher REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libpointmatcher::libpointmatcher) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libpointmatcher/all/test_package/conanfile.py b/recipes/libpointmatcher/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libpointmatcher/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/libpointmatcher/all/test_package/test_package.cpp b/recipes/libpointmatcher/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec1d2ba86285d --- /dev/null +++ b/recipes/libpointmatcher/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + auto rigidTrans = PointMatcher::get().REG(Transformation).create("RigidTransformation"); + return 0; +} diff --git a/recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt b/recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpointmatcher/all/test_v1_package/conanfile.py b/recipes/libpointmatcher/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libpointmatcher/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/libpointmatcher/config.yml b/recipes/libpointmatcher/config.yml new file mode 100644 index 0000000000000..59334d5077368 --- /dev/null +++ b/recipes/libpointmatcher/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.1": + folder: all diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml new file mode 100644 index 0000000000000..3f978881fafe5 --- /dev/null +++ b/recipes/libpq/all/conandata.yml @@ -0,0 +1,58 @@ +sources: + "14.7": + url: "https://ftp.postgresql.org/pub/source/v14.7/postgresql-14.7.tar.bz2" + sha256: "cef60f0098fa8101c1546f4254e45b722af5431337945b37af207007630db331" + "14.5": + url: "https://ftp.postgresql.org/pub/source/v14.5/postgresql-14.5.tar.bz2" + sha256: "d4f72cb5fb857c9a9f75ec8cf091a1771272802f2178f0b2e65b7b6ff64f4a30" + "14.2": + url: "https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.bz2" + sha256: "2cf78b2e468912f8101d695db5340cf313c2e9f68a612fb71427524e8c9a977a" + "13.6": + url: "https://ftp.postgresql.org/pub/source/v13.6/postgresql-13.6.tar.gz" + sha256: "42dcde620b627d35bf51dfc2c1d0f7f25f44d3dbedd81cc459da2d2c9e859059" + "12.10": + url: "https://ftp.postgresql.org/pub/source/v12.10/postgresql-12.10.tar.gz" + sha256: "987e008699d52d5de4bae0580416f6c75aa28016b11543c42f5fbde5efbdfb56" + "11.15": + url: "https://ftp.postgresql.org/pub/source/v11.15/postgresql-11.15.tar.gz" + sha256: "5f6ef2add1acb93d69012a55c3f276b91f4f0c91aa9a91243d9c5737ed5b5541" + "10.20": + url: "https://ftp.postgresql.org/pub/source/v10.20/postgresql-10.20.tar.gz" + sha256: "403bdad47101f7c0a15824627dd0fa0ad4abf1fa26d2bde77dea8921da25a48e" + "9.6.24": + url: "https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz" + sha256: "52947ecc119846eace5164399d173576c0d4a47ec116ae58a46a8fd0c576c7c3" +patches: + "14.7": + - patch_file: "patches/14.7/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "14.5": + - patch_file: "patches/14.5/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "14.2": + - patch_file: "patches/14.2/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "13.6": + - patch_file: "patches/13.6/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "12.10": + - patch_file: "patches/12.10/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "11.15": + - patch_file: "patches/11.15/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "10.20": + - patch_file: "patches/10.20/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "9.6.24": + - patch_file: "patches/9.6.24/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py new file mode 100644 index 0000000000000..b4e66be74d363 --- /dev/null +++ b/recipes/libpq/all/conanfile.py @@ -0,0 +1,282 @@ +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, chdir, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, VCVars +from conan.tools.scm import Version +import glob +import os + +required_conan_version = ">=1.54.0" + + +class LibpqConan(ConanFile): + name = "libpq" + description = "The library used by all the standard PostgreSQL tools." + topics = ("libpq", "postgresql", "database", "db") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.postgresql.org/docs/current/static/libpq.html" + license = "PostgreSQL" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "disable_rpath": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": False, + "disable_rpath": False, + } + + @property + def _is_clang8_x86(self): + return self.settings.os == "Linux" and \ + self.settings.compiler == "clang" and \ + self.settings.compiler.version == "8" and \ + self.settings.arch == "x86" + + @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": + self.options.rm_safe("fPIC") + self.options.rm_safe("disable_rpath") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/1.1.1t") + + def build_requirements(self): + if is_msvc(self): + self.tool_requires("strawberryperl/5.32.1.1") + elif 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 is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + config = "DEBUG" if self.settings.build_type == "Debug" else "RELEASE" + env = Environment() + env.define("CONFIG", config) + env.vars(self).save_script("conanbuild_msvc") + else: + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.append('--without-readline') + tc.configure_args.append('--without-zlib') + tc.configure_args.append('--with-openssl' if self.options.with_openssl else '--without-openssl') + if cross_building(self) and not self.options.with_openssl: + tc.configure_args.append("--disable-strong-random") + if cross_building(self, skip_x64_x86=True): + tc.configure_args.append("USE_DEV_URANDOM=1") + if self.settings.os != "Windows" and self.options.disable_rpath: + tc.configure_args.append('--disable-rpath') + if self._is_clang8_x86: + tc.extra_cflags.append("-msse2") + tc.make_args.append(f"DESTDIR={unix_path(self, self.package_folder)}") + if self.settings.os == "Windows": + tc.make_args.append("MAKE_DLL={}".format(str(self.options.shared).lower())) + tc.generate() + AutotoolsDeps(self).generate() + + def _patch_sources(self): + if is_msvc(self): + # https://www.postgresql.org/docs/8.3/install-win32-libpq.html + # https://github.com/postgres/postgres/blob/master/src/tools/msvc/README + if not self.options.shared: + replace_in_file(self,os.path.join(self.source_folder, "src", "tools", "msvc", "MKvcbuild.pm"), + "$libpq = $solution->AddProject('libpq', 'dll', 'interfaces',", + "$libpq = $solution->AddProject('libpq', 'lib', 'interfaces',") + host_deps = [dep for _, dep in self.dependencies.host.items()] + system_libs = [] + for dep in host_deps: + system_libs.extend(dep.cpp_info.aggregated_components().system_libs) + + linked_system_libs = ", ".join(["'{}.lib'".format(lib) for lib in system_libs]) + replace_in_file(self,os.path.join(self.source_folder, "src", "tools", "msvc", "Project.pm"), + "libraries => [],", + "libraries => [{}],".format(linked_system_libs)) + runtime = { + "MT": "MultiThreaded", + "MTd": "MultiThreadedDebug", + "MD": "MultiThreadedDLL", + "MDd": "MultiThreadedDebugDLL", + }.get(msvc_runtime_flag(self)) + msbuild_project_pm = os.path.join(self.source_folder, "src", "tools", "msvc", "MSBuildProject.pm") + replace_in_file(self,msbuild_project_pm, "", """ + + $targetmachine + """) + replace_in_file(self,msbuild_project_pm, "'MultiThreadedDebugDLL'", "'%s'" % runtime) + replace_in_file(self,msbuild_project_pm, "'MultiThreadedDLL'", "'%s'" % runtime) + config_default_pl = os.path.join(self.source_folder, "src", "tools", "msvc", "config_default.pl") + solution_pm = os.path.join(self.source_folder, "src", "tools", "msvc", "Solution.pm") + if self.options.with_openssl: + openssl = self.dependencies["openssl"] + for ssl in ["VC\\libssl32", "VC\\libssl64", "libssl"]: + replace_in_file(self,solution_pm, + "%s.lib" % ssl, + "%s.lib" % openssl.cpp_info.components["ssl"].libs[0]) + for crypto in ["VC\\libcrypto32", "VC\\libcrypto64", "libcrypto"]: + replace_in_file(self,solution_pm, + "%s.lib" % crypto, + "%s.lib" % openssl.cpp_info.components["crypto"].libs[0]) + replace_in_file(self,config_default_pl, + "openssl => undef", + "openssl => '%s'" % openssl.package_folder.replace("\\", "/")) + elif self.settings.os == "Windows": + if self.settings.get_safe("compiler.threads") == "posix": + # Use MinGW pthread library + replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), + "ifeq ($(enable_thread_safety), yes)\nOBJS += pthread-win32.o\nendif", + "") + + def build(self): + apply_conandata_patches(self) + self._patch_sources() + if is_msvc(self): + with chdir(self, os.path.join(self.source_folder, "src", "tools", "msvc")): + self.run("perl build.pl libpq") + if not self.options.shared: + self.run("perl build.pl libpgport") + else: + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder)): + autotools.configure() + with chdir(self, os.path.join(self.source_folder, "src", "backend")): + autotools.make(target="generated-headers") + with chdir(self, os.path.join(self.source_folder, "src", "common")): + autotools.make() + with chdir(self, os.path.join(self.source_folder, "src", "include")): + autotools.make() + with chdir(self, os.path.join(self.source_folder, "src", "interfaces", "libpq")): + autotools.make() + if Version(self.version) >= 12: + with chdir(self, os.path.join(self.source_folder, "src", "port")): + autotools.make() + with chdir(self, os.path.join(self.source_folder, "src", "bin", "pg_config")): + autotools.make() + + def _remove_unused_libraries_from_package(self): + bin_folder = os.path.join(self.package_folder, "bin") + lib_folder = os.path.join(self.package_folder, "lib") + rm(self, "*.dll", lib_folder) + if self.options.shared: + for lib in glob.glob(os.path.join(lib_folder, "*.a")): + if not (self.settings.os == "Windows" and os.path.basename(lib) == "libpq.dll.a"): + os.remove(lib) + else: + rm(self, "*.dll", bin_folder) + rm(self, "*.dll.a", lib_folder) + rm(self, "*.so*", lib_folder) + rm(self, "*.dylib", lib_folder) + + def package(self): + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, pattern="*postgres_ext.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*pg_config.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*pg_config_ext.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*libpq-fe.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*libpq-events.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.h", src=os.path.join(self.source_folder, "src", "include", "libpq"), + dst=os.path.join(self.package_folder, "include", "libpq"), + keep_path=False) + copy(self, pattern="*genbki.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "catalog"), keep_path=False) + copy(self, pattern="*pg_type.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "catalog"), keep_path=False) + if self.options.shared: + copy(self, pattern="**/libpq.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) + copy(self, pattern="**/libpq.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + else: + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + else: + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder, "src", "common")): + autotools.install() + with chdir(self, os.path.join(self.source_folder, "src", "include")): + autotools.install() + with chdir(self, os.path.join(self.source_folder, "src", "interfaces", "libpq")): + autotools.install() + if Version(self.version) >= 12: + with chdir(self, os.path.join(self.source_folder, "src", "port")): + autotools.install() + with chdir(self, os.path.join(self.source_folder, "src", "bin", "pg_config")): + autotools.install() + copy(self, "*.h", src=os.path.join(self.build_folder, "src", "include", "catalog"), + dst=os.path.join(self.package_folder, "include", "catalog")) + 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, "include", "postgresql", "server")) + self._remove_unused_libraries_from_package() + fix_apple_shared_install_name(self) + copy(self, "*.h", src=os.path.join(self.build_folder, "src", "backend", "catalog"), + dst=os.path.join(self.package_folder, "include", "catalog")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "PostgreSQL") + self.cpp_info.set_property("cmake_target_name", "PostgreSQL::PostgreSQL") + self.cpp_info.set_property("pkg_config_name", "libpq") + + self.env_info.PostgreSQL_ROOT = self.package_folder + + self.cpp_info.components["pq"].libs = [f"{'lib' if is_msvc(self) else ''}pq"] + + if self.options.with_openssl: + self.cpp_info.components["pq"].requires.append("openssl::openssl") + + if not self.options.shared: + if is_msvc(self): + self.cpp_info.components["pgport"].libs = ["libpgport"] + self.cpp_info.components["pq"].requires.append("pgport") + if Version(self.version) >= "12": + self.cpp_info.components["pgcommon"].libs = ["libpgcommon"] + self.cpp_info.components["pq"].requires.append("pgcommon") + else: + self.cpp_info.components["pgcommon"].libs = ["pgcommon"] + self.cpp_info.components["pq"].requires.append("pgcommon") + if Version(self.version) >= "12": + self.cpp_info.components["pgcommon"].libs.append("pgcommon_shlib") + self.cpp_info.components["pgport"].libs = ["pgport", "pgport_shlib"] + if self.settings.os == "Windows": + self.cpp_info.components["pgport"].system_libs = ["ws2_32"] + self.cpp_info.components["pgcommon"].requires.append("pgport") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["pq"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["pq"].system_libs = ["ws2_32", "secur32", "advapi32", "shell32", "crypt32", "wldap32"] + + self.cpp_info.names["cmake_find_package"] = "PostgreSQL" + self.cpp_info.names["cmake_find_package_multi"] = "PostgreSQL" diff --git a/recipes/libpq/all/patches/10.20/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/10.20/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..bfa322133c73c --- /dev/null +++ b/recipes/libpq/all/patches/10.20/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -371,7 +371,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -384,12 +387,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + endif + + endif # PORTNAME == cygwin +@@ -484,6 +487,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..bfa322133c73c --- /dev/null +++ b/recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -371,7 +371,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -384,12 +387,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + endif + + endif # PORTNAME == cygwin +@@ -484,6 +487,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/12.10/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/12.10/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..ee5dfabdf330e --- /dev/null +++ b/recipes/libpq/all/patches/12.10/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -370,7 +370,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -383,12 +386,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + endif + + endif # PORTNAME == cygwin +@@ -483,6 +486,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch b/recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch new file mode 100644 index 0000000000000..c650bf767f6d5 --- /dev/null +++ b/recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch @@ -0,0 +1,65 @@ +diff --git a/configure b/configure +index cbbaf77..f723154 100755 +--- a/configure ++++ b/configure +@@ -18836,60 +18836,6 @@ fi + fi + fi + +-# Thread testing +- +-# We have to run the thread test near the end so we have all our symbols +-# defined. Cross compiling throws a warning. +-# +-if test "$enable_thread_safety" = yes; then +-if test "$PORTNAME" != "win32" +-then +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5 +-$as_echo_n "checking thread safety of required library functions... " >&6; } +- +-_CFLAGS="$CFLAGS" +-_LIBS="$LIBS" +-CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE" +-LIBS="$LIBS $PTHREAD_LIBS" +-if test "$cross_compiling" = yes; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5 +-$as_echo "maybe" >&6; } +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +-*** Skipping thread test program because of cross-compile build. +-*** Run the program in src/test/thread on the target machine. +-" >&5 +-$as_echo "$as_me: WARNING: +-*** Skipping thread test program because of cross-compile build. +-*** Run the program in src/test/thread on the target machine. +-" >&2;} +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include "$srcdir/src/test/thread/thread_test.c" +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- as_fn_error $? "thread test program failed +-This platform is not thread-safe. Check the file 'config.log' or compile +-and run src/test/thread/thread_test for the exact reason. +-Use --disable-thread-safety to disable thread safety." "$LINENO" 5 +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +-CFLAGS="$_CFLAGS" +-LIBS="$_LIBS" +-else +-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5 +-$as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;} +-fi +-fi +- + # If compiler will take -Wl,--as-needed (or various platform-specific + # spellings thereof) then add that to LDFLAGS. This is much easier than + # trying to filter LIBS to the minimum for each executable. diff --git a/recipes/libpq/all/patches/13.6/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/13.6/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..ce58850706373 --- /dev/null +++ b/recipes/libpq/all/patches/13.6/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -358,7 +358,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -452,6 +455,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..ce58850706373 --- /dev/null +++ b/recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -358,7 +358,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -452,6 +455,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..ce58850706373 --- /dev/null +++ b/recipes/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -358,7 +358,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -452,6 +455,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..ce58850706373 --- /dev/null +++ b/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -358,7 +358,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -452,6 +455,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/9.6.24/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/9.6.24/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..c81e02bd78f53 --- /dev/null +++ b/recipes/libpq/all/patches/9.6.24/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -384,7 +384,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -397,12 +400,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + endif + + endif # PORTNAME == cygwin +@@ -505,6 +508,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/test_package/CMakeLists.txt b/recipes/libpq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db0dafd7c0984 --- /dev/null +++ b/recipes/libpq/all/test_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) +find_package(PostgreSQL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PostgreSQL::PostgreSQL) diff --git a/recipes/libpq/all/test_package/conanfile.py b/recipes/libpq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libpq/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libpq/all/test_package/test_package.c b/recipes/libpq/all/test_package/test_package.c new file mode 100644 index 0000000000000..4214d8be7e3ac --- /dev/null +++ b/recipes/libpq/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "libpq-fe.h" + +#include +#include + + +int main() { + PGconn *conn = NULL; + const int version = PQlibVersion(); + printf("PQlibVersion: %d\n", version); + + conn = PQconnectdb("dbname = postgres"); + PQstatus(conn); + + PQfinish(conn); + return EXIT_SUCCESS; +} diff --git a/recipes/libpq/all/test_v1_package/CMakeLists.txt b/recipes/libpq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/libpq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libpq/all/test_v1_package/conanfile.py b/recipes/libpq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5f9efeb33878b --- /dev/null +++ b/recipes/libpq/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + 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/libpq/config.yml b/recipes/libpq/config.yml new file mode 100644 index 0000000000000..01599254d7d82 --- /dev/null +++ b/recipes/libpq/config.yml @@ -0,0 +1,17 @@ +versions: + "14.7": + folder: all + "14.5": + folder: all + "14.2": + folder: all + "13.6": + folder: all + "12.10": + folder: all + "11.15": + folder: all + "10.20": + folder: all + "9.6.24": + folder: all diff --git a/recipes/libpqxx/all/conandata.yml b/recipes/libpqxx/all/conandata.yml new file mode 100644 index 0000000000000..a8a8be54d6643 --- /dev/null +++ b/recipes/libpqxx/all/conandata.yml @@ -0,0 +1,80 @@ +sources: + "7.7.5": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.5.tar.gz" + sha256: "c7dc3e8fa2eee656f2b6a8179d72f15db10e97a80dc4f173f806e615ea990973" + "7.7.4": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.4.tar.gz" + sha256: "65b0a06fffd565a19edacedada1dcfa0c1ecd782cead0ee067b19e2464875c36" + "7.7.3": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.3.tar.gz" + sha256: "11e147bbe2d3024d68d29b38eab5d75899dbb6131e421a2dbf9f88bac9bf4b0d" + "7.7.2": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.2.tar.gz" + sha256: "4b7a0b67cbd75d1c31e1e8a07c942ffbe9eec4e32c29b15d71cc225dc737e243" + "7.7.0": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.0.tar.gz" + sha256: "2d99de960aa3016915bc69326b369fcee04425e57fbe9dad48dd3fa6203879fb" + "7.6.1": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.6.1.tar.gz" + sha256: "7f4ad37fce20e8c9a61387cd5d6f85cf264f2bc9c0e6b27e8d5751a5429f87d0" + "7.6.0": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.6.0.tar.gz" + sha256: "8194ce4eff3fee5325963ccc28d3542cfaa54ba1400833d0df6948de3573c118" + "7.5.3": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.5.3.tar.gz" + sha256: "4229ed9205e484a4bafb10edd6ce75b98c12d63c082a98baada0c01766d218e0" + "7.4.2": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.4.2.tar.gz" + sha256: "325d50c51a417e890f7d71805f90a8d7949dce659f721b0f15d7f91bf954091d" + "7.3.2": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.3.2.tar.gz" + sha256: "493991345de5cbddfed8836917a333add2cd00ecbfd21b1acbc9345ce784225f" + "7.2.1": + url: "https://github.com/jtv/libpqxx/archive/7.2.1.tar.gz" + sha256: "3fd8318d2e421483495bf1a8ea1365fce4105934e9600ca87be0dff470d8c8dc" + "7.1.2": + url: "https://github.com/jtv/libpqxx/archive/7.1.2.tar.gz" + sha256: "3af7b4cfd572c67275ad24fea31bcf9d9f365ec16a1b7e90d4bde930936707f3" + "7.0.7": + url: "https://github.com/jtv/libpqxx/archive/7.0.7.tar.gz" + sha256: "856fffb76141a236df608a86aa7d63b04f82816c9bbf80d33189705a0b2682eb" + "6.4.8": + url: "https://github.com/jtv/libpqxx/archive/6.4.8.tar.gz" + sha256: "3f7aba951822e01f1b9f9f353702954773323dd9f9dc376ffb57cb6bbd9a7a2f" +patches: + "7.7.5": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.7.4": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.7.3": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.7.2": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/fix-install-library-symlink-7.7.2.patch" + "7.7.0": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/fix-clang-compilation-7.7.0.patch" + "7.6.1": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch" + - patch_file: "patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch" + "7.6.0": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch" + - patch_file: "patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch" + "7.5.3": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.4.2": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.3.2": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/fix-msvc-compilation-7.3.1.patch" + "7.2.1": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.1.2": + - patch_file: "patches/0001-cmake-fix-module.patch" + "7.0.7": + - patch_file: "patches/0001-cmake-fix-module.patch" + - patch_file: "patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch" + "6.4.8": + - patch_file: "patches/0001-cmake-fix-module-6.4.8.patch" diff --git a/recipes/libpqxx/all/conanfile.py b/recipes/libpqxx/all/conanfile.py new file mode 100644 index 0000000000000..ef9bfe326bc0a --- /dev/null +++ b/recipes/libpqxx/all/conanfile.py @@ -0,0 +1,143 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.microsoft import check_min_vs, is_msvc, msvc_runtime_flag +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class LibpqxxConan(ConanFile): + name = "libpqxx" + description = "The official C++ client API for PostgreSQL" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jtv/libpqxx" + topics = ("libpqxx", "postgres", "postgresql", "database", "db") + + 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 if Version(self.version) < "7.0" else "17" + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "7.0": + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10" + } + else: + return { + "gcc": "7" if Version(self.version) < "7.5.0" else "8", + "clang": "6", + "apple-clang": "10" + } + + @property + def _mac_os_minimum_required_version(self): + return "10.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): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libpq/14.5") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if Version(self.version) < "7.0": + check_min_vs(self, 190) + elif Version(self.version) < "7.6": + check_min_vs(self, 191) + else: + check_min_vs(self, 192) + + if is_msvc(self) and self.options.shared and msvc_runtime_flag(self) == "MTd": + raise ConanInvalidConfiguration(f"{self.ref} recipes does not support build shared library with MTd runtime.") + + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if is_apple_os(self): + os_version = self.settings.get_safe("os.version") + if os_version and Version(os_version) < self._mac_os_minimum_required_version: + raise ConanInvalidConfiguration( + "Macos Mojave (10.14) and earlier cannot to be built because C++ standard library too old.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DOC"] = False + tc.variables["BUILD_TEST"] = False + # Set `-mmacosx-version-min` to enable C++17 standard library support. + tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self._mac_os_minimum_required_version + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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, "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.set_property("cmake_file_name", "libpqxx") + self.cpp_info.set_property("cmake_target_name", "libpqxx::pqxx") + self.cpp_info.set_property("pkg_config_name", "libpqxx") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["pqxx"].libs = ["pqxx"] + if self.settings.os == "Windows": + self.cpp_info.components["pqxx"].system_libs = ["wsock32", "ws2_32"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["pqxx"].set_property("cmake_target_name", "libpqxx::pqxx") + self.cpp_info.components["pqxx"].set_property("pkg_config_name", "libpqxx") + self.cpp_info.components["pqxx"].requires = ["libpq::libpq"] diff --git a/recipes/libpqxx/all/patches/0001-cmake-fix-module-6.4.8.patch b/recipes/libpqxx/all/patches/0001-cmake-fix-module-6.4.8.patch new file mode 100644 index 0000000000000..5d0c9b14d2933 --- /dev/null +++ b/recipes/libpqxx/all/patches/0001-cmake-fix-module-6.4.8.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 86ffa24..e35824b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,7 +10,8 @@ if(NOT "${CMAKE_CXX_STANDARD}") + endif() + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ++ + + if(NOT SKIP_BUILD_TEST) + option(BUILD_TEST "Build all test cases" ON) diff --git a/recipes/libpqxx/all/patches/0001-cmake-fix-module.patch b/recipes/libpqxx/all/patches/0001-cmake-fix-module.patch new file mode 100644 index 0000000000000..3111fb155f497 --- /dev/null +++ b/recipes/libpqxx/all/patches/0001-cmake-fix-module.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 849912bd..e5b2b80f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,7 @@ if(NOT "${CMAKE_CXX_STANDARD}") + endif() + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + + option(BUILD_DOC "Build documentation" OFF) + diff --git a/recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch b/recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch new file mode 100644 index 0000000000000..f09c9055d160c --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch @@ -0,0 +1,25 @@ +Fix Apple clang compilation 7.4.0 only (https://github.com/jtv/libpqxx/commit/cbd2b35ef5bce8a1fc8bfd1efd804d965976ce23) +diff --git a/include/pqxx/connection.hxx b/include/pqxx/connection.hxx +index b44daa18..21dc1fd3 100644 +--- a/include/pqxx/connection.hxx ++++ b/include/pqxx/connection.hxx +@@ -33,6 +33,7 @@ + #include "pqxx/errorhandler.hxx" + #include "pqxx/except.hxx" + #include "pqxx/prepared_statement.hxx" ++#include "pqxx/separated_list.hxx" + #include "pqxx/strconv.hxx" + #include "pqxx/util.hxx" + #include "pqxx/zview.hxx" +diff --git a/include/pqxx/stream_to.hxx b/include/pqxx/stream_to.hxx +index 96ddbf56..5ed91b23 100644 +--- a/include/pqxx/stream_to.hxx ++++ b/include/pqxx/stream_to.hxx +@@ -16,6 +16,7 @@ + #include "pqxx/compiler-public.hxx" + #include "pqxx/internal/compiler-internal-pre.hxx" + ++#include "pqxx/separated_list.hxx" + #include "pqxx/transaction_base.hxx" + + diff --git a/recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch b/recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch new file mode 100644 index 0000000000000..ad9d3eeea1da7 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch @@ -0,0 +1,25 @@ +Fix clang compile error 7.7.0 (https://github.com/jtv/libpqxx/pull/519) +diff --git a/src/strconv.cxx b/src/strconv.cxx +index 36758307..824d0d28 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -438,7 +438,8 @@ template + if (pqxx::internal::is_digit(initial)) + { + for (; pqxx::internal::is_digit(data[i]); ++i) +- result = absorb_digit_positive(result, digit_to_number(data[i])); ++ result = absorb_digit_positive( ++ result, pqxx::internal::digit_to_number(data[i])); + } + else if (initial == '-') + { +@@ -452,7 +453,8 @@ template + "Converting string to " + pqxx::type_name + + ", but it contains only a sign."}; + for (; i < std::size(text) and pqxx::internal::is_digit(data[i]); ++i) +- result = absorb_digit_negative(result, digit_to_number(data[i])); ++ result = absorb_digit_negative( ++ result, pqxx::internal::digit_to_number(data[i])); + } + else + { diff --git a/recipes/libpqxx/all/patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch b/recipes/libpqxx/all/patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch new file mode 100644 index 0000000000000..f2f3dcc4c078a --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch @@ -0,0 +1,50 @@ +Fixed a problem that some compilers did not allow `inline constexpr` local +variable declarations (https://github.com/jtv/libpqxx/pull/468). +diff --git a/src/strconv.cxx b/src/strconv.cxx +index 57188dee..0eba014b 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -317,6 +317,20 @@ namespace + "Could not convert string to integer: value out of range."}; + } + ++template struct numeric_ten ++{ ++ static inline constexpr T value = 10; ++}; ++ ++template struct numeric_high_threshold ++{ ++ static inline constexpr T value = (std::numeric_limits::max)() / numeric_ten::value; ++}; ++ ++template struct numeric_low_threshold ++{ ++ static inline constexpr T value = (std::numeric_limits::min)() / numeric_ten::value; ++}; + + /// Return 10*n, or throw exception if it overflows. + template +@@ -324,19 +338,16 @@ template + { + using limits = std::numeric_limits; + +- inline constexpr T ten{10}; +- inline constexpr T high_threshold(std::numeric_limits::max() / ten); +- if (n > high_threshold) ++ if (n > numeric_high_threshold::value) + PQXX_UNLIKELY + report_overflow(); + if constexpr (limits::is_signed) + { +- inline constexpr T low_threshold(std::numeric_limits::min() / ten); +- if (low_threshold > n) ++ if (numeric_low_threshold::value > n) + PQXX_UNLIKELY + report_overflow(); + } +- return T(n * ten); ++ return T(n * numeric_ten::value); + } + + diff --git a/recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch b/recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch new file mode 100644 index 0000000000000..076ad6cc874e3 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch @@ -0,0 +1,14 @@ +Fix install library symlink error 7.7.2 (https://github.com/jtv/libpqxx/pull/552) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6eafd7b3..1d697ab7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -58,7 +58,7 @@ macro(library_target_setup tgt) + VERBATIM + COMMAND_EXPAND_LISTS + ) +- install(FILES $/${library_prefix}${name}${library_suffix} ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${library_prefix}${name}${library_suffix} + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif() diff --git a/recipes/libpqxx/all/patches/fix-missing-limits-include.patch b/recipes/libpqxx/all/patches/fix-missing-limits-include.patch new file mode 100644 index 0000000000000..7e3e49e4fe91c --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-missing-limits-include.patch @@ -0,0 +1,13 @@ +Fix the bug that `` is missing in versions less than 7.0.5 (https://github.com/jtv/libpqxx/commit/143e139fafadfb153a5d0c84c429e6ced3ed06fc) +diff --git a/include/pqxx/util.hxx b/include/pqxx/util.hxx +index d91d978e..c589a42c 100644 +--- a/include/pqxx/util.hxx ++++ b/include/pqxx/util.hxx +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/recipes/libpqxx/all/patches/fix-msvc-compilation-7.3.1.patch b/recipes/libpqxx/all/patches/fix-msvc-compilation-7.3.1.patch new file mode 100644 index 0000000000000..bed80866a71e8 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-msvc-compilation-7.3.1.patch @@ -0,0 +1,248 @@ +Fix msvc compilation 3.7.1 only (https://github.com/jtv/libpqxx/pull/406) +diff --git a/include/pqxx/binarystring.hxx b/include/pqxx/binarystring.hxx +index 780cd6ec..433854ca 100644 +--- a/include/pqxx/binarystring.hxx ++++ b/include/pqxx/binarystring.hxx +@@ -65,7 +65,7 @@ public: + using const_iterator = const_pointer; + using const_reverse_iterator = std::reverse_iterator; + +- [[deprecated("Use std::byte for binary data.")]] binarystring( ++ PQXX_DEPRECATED("Use std::byte for binary data.") binarystring( + binarystring const &) = default; + + /// Read and unescape bytea field. +@@ -73,22 +73,22 @@ public: + * isn't. + * @param F the field to read; must be a bytea field + */ +- [[deprecated("Use std::byte for binary data.")]] explicit binarystring( ++ PQXX_DEPRECATED("Use std::byte for binary data.") explicit binarystring( + field const &); + + /// Copy binary data from std::string_view on binary data. + /** This is inefficient in that it copies the data to a buffer allocated on + * the heap. + */ +- [[deprecated("Use std::byte for binary data.")]] explicit binarystring( ++ PQXX_DEPRECATED("Use std::byte for binary data.") explicit binarystring( + std::string_view); + + /// Copy binary data of given length straight out of memory. +- [[deprecated("Use std::byte for binary data.")]] binarystring( ++ PQXX_DEPRECATED("Use std::byte for binary data.") binarystring( + void const *, std::size_t); + + /// Efficiently wrap a buffer of binary data in a @c binarystring. +- [[deprecated("Use std::byte for binary data.")]] binarystring( ++ PQXX_DEPRECATED("Use std::byte for binary data.") binarystring( + std::shared_ptr ptr, size_type size) : + m_buf{std::move(ptr)}, m_size{size} + {} +diff --git a/include/pqxx/compiler-public.hxx b/include/pqxx/compiler-public.hxx +index 08d7ac9a..d5d49477 100644 +--- a/include/pqxx/compiler-public.hxx ++++ b/include/pqxx/compiler-public.hxx +@@ -43,6 +43,11 @@ + // Workarounds for Microsoft Visual C++ + # ifdef _MSC_VER + ++// Workarounds for deprecated attribute syntax error in Visual Studio 2017. ++# if _MSC_VER < 1920 ++# define PQXX_DEPRECATED(MESSAGE) __declspec(deprecated( #MESSAGE )) ++# endif ++ + // Suppress vtables on abstract classes. + # define PQXX_NOVTABLE __declspec(novtable) + +@@ -112,4 +117,8 @@ + # define PQXX_NOVTABLE + #endif + ++#ifndef PQXX_DEPRECATED ++# define PQXX_DEPRECATED(MESSAGE) [[deprecated( #MESSAGE )]] ++#endif ++ + #endif +diff --git a/include/pqxx/largeobject.hxx b/include/pqxx/largeobject.hxx +index 072a490b..54d6c0df 100644 +--- a/include/pqxx/largeobject.hxx ++++ b/include/pqxx/largeobject.hxx +@@ -36,19 +36,19 @@ public: + + /// Refer to a nonexistent large object (similar to what a null pointer + /// does). +- [[deprecated("Use blob instead.")]] largeobject() noexcept = default; ++ PQXX_DEPRECATED("Use blob instead.") largeobject() noexcept = default; + + /// Create new large object. + /** @param t Backend transaction in which the object is to be created. + */ +- [[deprecated("Use blob instead.")]] explicit largeobject(dbtransaction &t); ++ PQXX_DEPRECATED("Use blob instead.") explicit largeobject(dbtransaction &t); + + /// Wrap object with given oid. + /** Convert combination of a transaction and object identifier into a + * large object identity. Does not affect the database. + * @param o Object identifier for the given object. + */ +- [[deprecated("Use blob instead.")]] explicit largeobject(oid o) noexcept : ++ PQXX_DEPRECATED("Use blob instead.") explicit largeobject(oid o) noexcept : + m_id{o} + {} + +@@ -57,7 +57,7 @@ public: + * @param t Backend transaction in which the large object is to be created. + * @param file A filename on the client program's filesystem. + */ +- [[deprecated("Use blob instead.")]] largeobject( ++ PQXX_DEPRECATED("Use blob instead.") largeobject( + dbtransaction &t, std::string_view file); + + /// Take identity of an opened large object. +@@ -65,7 +65,7 @@ public: + * as an implicit conversion. + * @param o Already opened large object to copy identity from. + */ +- [[deprecated("Use blob instead.")]] largeobject( ++ PQXX_DEPRECATED("Use blob instead.") largeobject( + largeobjectaccess const &o) noexcept; + + /// Object identifier. +@@ -179,7 +179,7 @@ public: + * @param mode Access mode, defaults to ios_base::in | ios_base::out | + * ios_base::binary. + */ +- [[deprecated("Use blob instead.")]] explicit largeobjectaccess( ++ PQXX_DEPRECATED("Use blob instead.") explicit largeobjectaccess( + dbtransaction &t, openmode mode = default_mode); + + /// Open large object with given oid. +@@ -190,7 +190,7 @@ public: + * @param mode Access mode, defaults to ios_base::in | ios_base::out | + * ios_base::binary. + */ +- [[deprecated("Use blob instead.")]] largeobjectaccess( ++ PQXX_DEPRECATED("Use blob instead.") largeobjectaccess( + dbtransaction &t, oid o, openmode mode = default_mode); + + /// Open given large object. +@@ -200,7 +200,7 @@ public: + * @param mode Access mode, defaults to ios_base::in | ios_base::out | + * ios_base::binary. + */ +- [[deprecated("Use blob instead.")]] largeobjectaccess( ++ PQXX_DEPRECATED("Use blob instead.") largeobjectaccess( + dbtransaction &t, largeobject o, openmode mode = default_mode); + + /// Import large object from a local file and open it. +@@ -209,7 +209,7 @@ public: + * @param file A filename on the client program's filesystem. + * @param mode Access mode, defaults to ios_base::in | ios_base::out. + */ +- [[deprecated("Use blob instead.")]] largeobjectaccess( ++ PQXX_DEPRECATED("Use blob instead.") largeobjectaccess( + dbtransaction &t, std::string_view file, openmode mode = default_mode); + + ~largeobjectaccess() noexcept { close(); } +@@ -386,7 +386,7 @@ public: + static constexpr auto default_mode{ + std::ios::in | std::ios::out | std::ios::binary}; + +- [[deprecated("Use blob instead.")]] largeobject_streambuf( ++ PQXX_DEPRECATED("Use blob instead.") largeobject_streambuf( + dbtransaction &t, largeobject o, openmode mode = default_mode, + size_type buf_size = 512) : + m_bufsize{buf_size}, m_obj{t, o, mode}, m_g{nullptr}, m_p{nullptr} +@@ -394,7 +394,7 @@ public: + initialize(mode); + } + +- [[deprecated("Use blob instead.")]] largeobject_streambuf( ++ PQXX_DEPRECATED("Use blob instead.") largeobject_streambuf( + dbtransaction &t, oid o, openmode mode = default_mode, + size_type buf_size = 512) : + m_bufsize{buf_size}, m_obj{t, o, mode}, m_g{nullptr}, m_p{nullptr} +@@ -556,7 +556,7 @@ public: + * @param o Large object to access. + * @param buf_size Size of buffer to use internally (optional). + */ +- [[deprecated("Use blob instead.")]] basic_ilostream( ++ PQXX_DEPRECATED("Use blob instead.") basic_ilostream( + dbtransaction &t, largeobject o, largeobject::size_type buf_size = 512) : + super{nullptr}, + m_buf{t, o, std::ios::in | std::ios::binary, buf_size} +@@ -570,7 +570,7 @@ public: + * @param o Identifier of a large object to access. + * @param buf_size Size of buffer to use internally (optional). + */ +- [[deprecated("Use blob instead.")]] basic_ilostream( ++ PQXX_DEPRECATED("Use blob instead.") basic_ilostream( + dbtransaction &t, oid o, largeobject::size_type buf_size = 512) : + super{nullptr}, + m_buf{t, o, std::ios::in | std::ios::binary, buf_size} +@@ -612,7 +612,7 @@ public: + * @param o a large object to access. + * @param buf_size size of buffer to use internally (optional). + */ +- [[deprecated("Use blob instead.")]] basic_olostream( ++ PQXX_DEPRECATED("Use blob instead.") basic_olostream( + dbtransaction &t, largeobject o, largeobject::size_type buf_size = 512) : + super{nullptr}, + m_buf{t, o, std::ios::out | std::ios::binary, buf_size} +@@ -626,7 +626,7 @@ public: + * @param o a large object to access. + * @param buf_size size of buffer to use internally (optional). + */ +- [[deprecated("Use blob instead.")]] basic_olostream( ++ PQXX_DEPRECATED("Use blob instead.") basic_olostream( + dbtransaction &t, oid o, largeobject::size_type buf_size = 512) : + super{nullptr}, + m_buf{t, o, std::ios::out | std::ios::binary, buf_size} +@@ -682,7 +682,7 @@ public: + * @param o Large object to access. + * @param buf_size Size of buffer to use internally (optional). + */ +- [[deprecated("Use blob instead.")]] basic_lostream( ++ PQXX_DEPRECATED("Use blob instead.") basic_lostream( + dbtransaction &t, largeobject o, largeobject::size_type buf_size = 512) : + super{nullptr}, + m_buf{ +@@ -697,7 +697,7 @@ public: + * @param o Large object to access. + * @param buf_size Size of buffer to use internally (optional). + */ +- [[deprecated("Use blob instead.")]] basic_lostream( ++ PQXX_DEPRECATED("Use blob instead.") basic_lostream( + dbtransaction &t, oid o, largeobject::size_type buf_size = 512) : + super{nullptr}, + m_buf{ +diff --git a/include/pqxx/stream_from.hxx b/include/pqxx/stream_from.hxx +index 7d059660..955e6828 100644 +--- a/include/pqxx/stream_from.hxx ++++ b/include/pqxx/stream_from.hxx +@@ -128,21 +128,21 @@ public: + Columns const &columns); + + /// @deprecated Use the @c from_table_t overload instead. +- [[deprecated("Use the from_table_t overload instead.")]] stream_from( ++ PQXX_DEPRECATED("Use the from_table_t overload instead.") stream_from( + transaction_base &tx, std::string_view table) : + stream_from{tx, from_table, table} + {} + + /// @deprecated Use the @c from_table_t overload instead. + template +- [[deprecated("Use the from_table_t overload instead.")]] stream_from( ++ PQXX_DEPRECATED("Use the from_table_t overload instead.") stream_from( + transaction_base &tx, std::string_view table, Columns const &columns) : + stream_from{tx, from_table, table, columns} + {} + + /// @deprecated Use the @c from_table_t overload instead. + template +- [[deprecated("Use the from_table_t overload instead.")]] stream_from( ++ PQXX_DEPRECATED("Use the from_table_t overload instead.") stream_from( + transaction_base &, std::string_view table, Iter columns_begin, + Iter columns_end); + //@} diff --git a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch new file mode 100644 index 0000000000000..c32258155f947 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch @@ -0,0 +1,21 @@ +Fix 'dumb_stringstream' was not declared (https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1) +diff --git a/src/strconv.cxx b/src/strconv.cxx +index 66276802..390192ac 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -587,6 +587,7 @@ template char * + float_traits::into_buf(char *, char *, long double const &); + + ++#if !defined(PQXX_HAVE_CHARCONV_FLOAT) + template + inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) + { +@@ -594,6 +595,7 @@ inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) + s << value; + return s.str(); + } ++#endif + + + /// Floating-point implementations for @c pqxx::to_string(). diff --git a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch new file mode 100644 index 0000000000000..e372b90444861 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch @@ -0,0 +1,21 @@ +Fix 'dumb_stringstream' was not declared (https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1) +diff --git a/src/strconv.cxx b/src/strconv.cxx +index 72217455..b34bd394 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -591,6 +591,7 @@ template char * + float_traits::into_buf(char *, char *, long double const &); + + ++#if !defined(PQXX_HAVE_CHARCONV_FLOAT) + template + inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) + { +@@ -598,6 +599,7 @@ inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) + s << value; + return s.str(); + } ++#endif + + + /// Floating-point implementations for @c pqxx::to_string(). diff --git a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch new file mode 100644 index 0000000000000..acc981628428c --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch @@ -0,0 +1,21 @@ +Fix 'dumb_stringstream' was not declared (https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1) +diff --git a/src/strconv.cxx b/src/strconv.cxx +index 13b0b9ab..c0b7510d 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -591,6 +591,7 @@ template char * + float_traits::into_buf(char *, char *, long double const &); + + ++#if !defined(PQXX_HAVE_CHARCONV_FLOAT) + template + inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) + { +@@ -598,6 +599,7 @@ inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) + s << value; + return s.str(); + } ++#endif + + + /// Floating-point implementations for @c pqxx::to_string(). diff --git a/recipes/libpqxx/all/patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch b/recipes/libpqxx/all/patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch new file mode 100644 index 0000000000000..697450d9e37a2 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch @@ -0,0 +1,13 @@ +fix: Remove `unlikely` annotation before `return` (https://github.com/jtv/libpqxx/pull/476) +diff --git a/src/robusttransaction.cxx b/src/robusttransaction.cxx +index ba110b12..88d8bd32 100644 +--- a/src/robusttransaction.cxx ++++ b/src/robusttransaction.cxx +@@ -64,7 +64,6 @@ constexpr tx_stat parse_status(std::string_view text) noexcept + PQXX_LIKELY return tx_in_progress; + break; + } +- PQXX_UNLIKELY + return tx_unknown; + } + diff --git a/recipes/libpqxx/all/test_package/CMakeLists.txt b/recipes/libpqxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e27c585fd702f --- /dev/null +++ b/recipes/libpqxx/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.8) + +# Set `-mmacosx-version-min` to enable C++17 standard library support. +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version") + +project(test_package LANGUAGES CXX) + +find_package(libpqxx REQUIRED CONFIG) + + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libpqxx::pqxx) +if(libpqxx_VERSION VERSION_LESS "7.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/libpqxx/all/test_package/conanfile.py b/recipes/libpqxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/libpqxx/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libpqxx/all/test_package/test_package.cpp b/recipes/libpqxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d6ee2f061e2b0 --- /dev/null +++ b/recipes/libpqxx/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include "pqxx/pqxx" + +#include +#include + + +int main() +{ + std::cout << "libpqxx version: " << PQXX_VERSION << std::endl; + + try { + pqxx::connection conn("hostaddr='.conan' port=5432 dbname=conan user=conan connect_timeout=2"); + + pqxx::work tx(conn); + + pqxx::row row = tx.exec1("SELECT 1"); + + tx.commit(); + + std::cout << row[0].as() << "\n"; + } catch (const pqxx::broken_connection &ex) { + std::cout << "error thrown: " << ex.what() << "\n"; + + return EXIT_SUCCESS; + } + + return EXIT_FAILURE; +} diff --git a/recipes/libpqxx/all/test_v1_package/CMakeLists.txt b/recipes/libpqxx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libpqxx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libpqxx/all/test_v1_package/conanfile.py b/recipes/libpqxx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/libpqxx/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libpqxx/config.yml b/recipes/libpqxx/config.yml new file mode 100644 index 0000000000000..96d5c5cc00956 --- /dev/null +++ b/recipes/libpqxx/config.yml @@ -0,0 +1,29 @@ +versions: + "7.7.5": + folder: all + "7.7.4": + folder: all + "7.7.3": + folder: all + "7.7.2": + folder: all + "7.7.0": + folder: all + "7.6.1": + folder: all + "7.6.0": + folder: all + "7.5.3": + folder: all + "7.4.2": + folder: all + "7.3.2": + folder: all + "7.2.1": + folder: all + "7.1.2": + folder: all + "7.0.7": + folder: all + "6.4.8": + folder: all diff --git a/recipes/libproperties/all/CMakeLists.txt b/recipes/libproperties/all/CMakeLists.txt new file mode 100644 index 0000000000000..8b8af47ecdb56 --- /dev/null +++ b/recipes/libproperties/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1.2) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libproperties/all/conandata.yml b/recipes/libproperties/all/conandata.yml new file mode 100644 index 0000000000000..bff2c33335401 --- /dev/null +++ b/recipes/libproperties/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.1.2": + url: "https://github.com/tinyhubs/libproperties/archive/1.1.2.zip" + sha256: "9ee3903648f8de6c9e2d71fd778721844cc9881dcc2afe2c66cdb2d1cb86b39a" +patches: + "1.1.2": + - patch_file: "patches/0001-set-CMAKE_C_STANDARD.patch" + base_path: "source_subfolder" diff --git a/recipes/libproperties/all/conanfile.py b/recipes/libproperties/all/conanfile.py new file mode 100644 index 0000000000000..5741d7e7fb2c6 --- /dev/null +++ b/recipes/libproperties/all/conanfile.py @@ -0,0 +1,67 @@ +from conans import ConanFile, CMake, tools +import os + +class LibpropertiesConan(ConanFile): + name = "libproperties" + license = "Apache-2.0" + homepage = "https://github.com/tinyhubs/libproperties" + url = "https://github.com/conan-io/conan-center-index" + description = "libproperties is a library to parse the Java .properties files. It was writen in pure C. And fully compatible with the Java .properties file format." + topics = ("properties", "java", "pure-c") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False], } + default_options = {"shared": False, "fPIC": True, } + generators = "cmake" + exports_sources = "CMakeLists.txt", "patches/**" + + _cmake = None + + @property + def _source_package_tag(self): + return "{}-{}".format(self.name, self.version) + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + source_dir = "{}-{}".format(self.name, self.version) + os.rename(source_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["LIBPROPERTIES_INSTALL"] = True + self._cmake.definitions["LIBPROPERTIES_TEST"] = False + self._cmake.configure() + return self._cmake + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + if not self.options.shared: + self.cpp_info.defines = ["LIBPROPERTIES_STATIC"] + self.cpp_info.libs = ["properties"] diff --git a/recipes/libproperties/all/patches/0001-set-CMAKE_C_STANDARD.patch b/recipes/libproperties/all/patches/0001-set-CMAKE_C_STANDARD.patch new file mode 100644 index 0000000000000..0782d22340a2e --- /dev/null +++ b/recipes/libproperties/all/patches/0001-set-CMAKE_C_STANDARD.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -21,7 +21,7 @@ + + # Define the target + add_library(properties buf.c properties.c) +-set_target_properties(properties PROPERTIES ++set_target_properties(properties PROPERTIES C_STANDARD 99 C_EXTENSIONS OFF C_STANDARD_REQUIRED ON + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + EXPORT_NAME libproperties diff --git a/recipes/libproperties/all/test_package/CMakeLists.txt b/recipes/libproperties/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1db6320d425c2 --- /dev/null +++ b/recipes/libproperties/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libproperties REQUIRED) + +add_executable("${PROJECT_NAME}" test_package.c) +target_link_libraries("${PROJECT_NAME}" PRIVATE libproperties::libproperties) diff --git a/recipes/libproperties/all/test_package/conanfile.py b/recipes/libproperties/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e55cd6197c257 --- /dev/null +++ b/recipes/libproperties/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LibpropertiesTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libproperties/all/test_package/test_package.c b/recipes/libproperties/all/test_package/test_package.c new file mode 100644 index 0000000000000..f06e9d786d768 --- /dev/null +++ b/recipes/libproperties/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "properties.h" + +#include +#include +#include + +#define LIBPROPERTIES_TEST_ASSERT(X) do {if(!(X)) {fprintf(stderr, "FAIL: %s\n", #X); abort();}} while(0) + + +int check_handler(void* context, char* key, int key_len, char* val, int val_len) +{ + LIBPROPERTIES_TEST_ASSERT(key_len == 3); + LIBPROPERTIES_TEST_ASSERT(val_len == 3); + LIBPROPERTIES_TEST_ASSERT(strncmp("aaa", key, 3) == 0); + LIBPROPERTIES_TEST_ASSERT(strncmp("bbb", val, 3) == 0); + return 0; +} + + +int main(int argc, char* argv[]) +{ + char str[] = "aaa=bbb"; + struct properties_source_string_t source = + { + str, + str + strlen(str) + }; + properties_parse(&source, properties_source_string_read, NULL, check_handler); + + return 0; +} diff --git a/recipes/libproperties/config.yml b/recipes/libproperties/config.yml new file mode 100644 index 0000000000000..8d13aefb6b4fb --- /dev/null +++ b/recipes/libproperties/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.2": + folder: all diff --git a/recipes/libprotobuf-mutator/all/CMakeLists.txt b/recipes/libprotobuf-mutator/all/CMakeLists.txt new file mode 100644 index 0000000000000..694038520f556 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) + +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() diff --git a/recipes/libprotobuf-mutator/all/conandata.yml b/recipes/libprotobuf-mutator/all/conandata.yml new file mode 100644 index 0000000000000..813688d3f74a5 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210831": + url: "https://github.com/google/libprotobuf-mutator/archive/ffd86a32874e5c08a143019aad1aaf0907294c9f.zip" + sha256: "14f595863452808483776ce1964209db00cdac79e649b31eb4d4b06ca72912d8" diff --git a/recipes/libprotobuf-mutator/all/conanfile.py b/recipes/libprotobuf-mutator/all/conanfile.py new file mode 100644 index 0000000000000..f0419a2397845 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/conanfile.py @@ -0,0 +1,88 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class LibProtobufMutatorConan(ConanFile): + name = "libprotobuf-mutator" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/libprotobuf-mutator" + 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 + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + 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) + + 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) + + 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 + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "OFF")) + tools.rmdir(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")) diff --git a/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt b/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00520b9489805 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package 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) diff --git a/recipes/libprotobuf-mutator/all/test_package/conanfile.py b/recipes/libprotobuf-mutator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/test_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/libprotobuf-mutator/all/test_package/msg.proto b/recipes/libprotobuf-mutator/all/test_package/msg.proto new file mode 100644 index 0000000000000..cb25c9d008352 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/test_package/msg.proto @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000000..c169f66031176 --- /dev/null +++ b/recipes/libprotobuf-mutator/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include + +#include "msg.pb.h" +#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; +} diff --git a/recipes/libprotobuf-mutator/config.yml b/recipes/libprotobuf-mutator/config.yml new file mode 100644 index 0000000000000..9d5b0e4c50569 --- /dev/null +++ b/recipes/libprotobuf-mutator/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210831": + folder: all diff --git a/recipes/libpsl/all/conandata.yml b/recipes/libpsl/all/conandata.yml new file mode 100644 index 0000000000000..0f43ba25d532c --- /dev/null +++ b/recipes/libpsl/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.21.1": + url: "https://github.com/rockdaboot/libpsl/releases/download/0.21.1/libpsl-0.21.1.tar.gz" + sha256: "ac6ce1e1fbd4d0254c4ddb9d37f1fa99dec83619c1253328155206b896210d4c" +patches: + "0.21.1": + - patch_file: "patches/0001-0.21.2-meson-no-tests.patch" diff --git a/recipes/libpsl/all/conanfile.py b/recipes/libpsl/all/conanfile.py new file mode 100644 index 0000000000000..ec026aac098e8 --- /dev/null +++ b/recipes/libpsl/all/conanfile.py @@ -0,0 +1,122 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, 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" + + +class LibPslConan(ConanFile): + name = "libpsl" + description = "C library for the Public Suffix List" + homepage = "https://github.com/rockdaboot/libpsl" + topics = ("psl", "suffix", "TLD", "gTLD", ".com", ".net") + license = "GPL-2.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], + "fPIC": [True, False], + "with_idna": [False, "icu", "libidn", "libidn2"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_idna": "icu", + } + + 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_idna == "icu": + self.requires("icu/72.1") + elif self.options.with_idna == "libidn": + self.requires("libidn/1.36") + elif self.options.with_idna == "libidn2": + self.requires("libidn2/2.3.0") + if self.options.with_idna in ("libidn", "libidn2"): + self.requires("libunistring/0.9.10") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _idna_option(self): + return { + "False": "no", + "icu": "libicu", + }.get(str(self.options.with_idna), str(self.options.with_idna)) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["runtime"] = self._idna_option + tc.project_options["builtin"] = self._idna_option + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + 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, "LICENSE", src=self.source_folder, dst=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, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libpsl") + self.cpp_info.libs = ["psl"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + if not self.options.shared: + self.cpp_info.defines = ["PSL_STATIC"] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libpsl/all/patches/0001-0.21.2-meson-no-tests.patch b/recipes/libpsl/all/patches/0001-0.21.2-meson-no-tests.patch new file mode 100644 index 0000000000000..46bd2ea7a2c59 --- /dev/null +++ b/recipes/libpsl/all/patches/0001-0.21.2-meson-no-tests.patch @@ -0,0 +1,11 @@ +--- meson.build ++++ meson.build +@@ -148,5 +148,5 @@ + subdir('include') + subdir('src') +-subdir('tools') +-subdir('tests') +-subdir('fuzz') ++#subdir('tools') # FIXME!!!! https://github.com/rockdaboot/libpsl/issues/160 ++#subdir('tests') ++#subdir('fuzz') diff --git a/recipes/libpsl/all/test_package/CMakeLists.txt b/recipes/libpsl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd12a8bc8d580 --- /dev/null +++ b/recipes/libpsl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libpsl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpsl::libpsl) diff --git a/recipes/libpsl/all/test_package/conanfile.py b/recipes/libpsl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/libpsl/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, run=True) + + 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/libpsl/all/test_package/test_package.c b/recipes/libpsl/all/test_package/test_package.c new file mode 100644 index 0000000000000..836b29efc0375 --- /dev/null +++ b/recipes/libpsl/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "libpsl.h" + +#include + +int main() +{ + printf("libpsl version: %s\n", psl_get_version()); + return 0; +} diff --git a/recipes/libpsl/all/test_v1_package/CMakeLists.txt b/recipes/libpsl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libpsl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpsl/all/test_v1_package/conanfile.py b/recipes/libpsl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libpsl/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/libpsl/config.yml b/recipes/libpsl/config.yml new file mode 100644 index 0000000000000..079bf2c67f869 --- /dev/null +++ b/recipes/libpsl/config.yml @@ -0,0 +1,3 @@ +versions: + "0.21.1": + folder: "all" diff --git a/recipes/libqrencode/all/conandata.yml b/recipes/libqrencode/all/conandata.yml new file mode 100644 index 0000000000000..7df4f866c6a55 --- /dev/null +++ b/recipes/libqrencode/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "4.1.1": + url: "https://github.com/fukuchi/libqrencode/archive/v4.1.1.tar.gz" + sha256: "5385bc1b8c2f20f3b91d258bf8ccc8cf62023935df2d2676b5b67049f31a049c" + "4.0.0": + url: "https://github.com/fukuchi/libqrencode/archive/v4.0.0.tar.gz" + sha256: "c2c8a8110354463a3332cb48abf8581c8d94136af4dc1418f891cc9c7719e3c1" +patches: + "4.1.1": + - patch_file: "patches/0003-cmake-fix-install-4.1.1.patch" + "4.0.0": + - patch_file: "patches/0001-remove-deprecated-attribute.patch" + - patch_file: "patches/0002-cmake-fix-install.patch" diff --git a/recipes/libqrencode/all/conanfile.py b/recipes/libqrencode/all/conanfile.py new file mode 100644 index 0000000000000..85ea6578aaa01 --- /dev/null +++ b/recipes/libqrencode/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class LibqrencodeConan(ConanFile): + name = "libqrencode" + description = "A fast and compact QR Code encoding library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fukuchi/libqrencode" + license = "LGPL-2.1-or-later" + topics = ("qr-code", "encoding") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_TOOLS"] = False + tc.variables["WITH_TESTS"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # libpng is required by tools only & libiconv is not used at all + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(PNG)", "") + replace_in_file(self, cmakelists, "find_package(Iconv)", "") + + def build(self): + self._patch_sources() + 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libqrencode") + suffix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"qrencode{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libqrencode/all/patches/0001-remove-deprecated-attribute.patch b/recipes/libqrencode/all/patches/0001-remove-deprecated-attribute.patch new file mode 100644 index 0000000000000..19b9901a21f53 --- /dev/null +++ b/recipes/libqrencode/all/patches/0001-remove-deprecated-attribute.patch @@ -0,0 +1,11 @@ +--- a/qrencode.h ++++ b/qrencode.h +@@ -555,7 +555,7 @@ extern char *QRcode_APIVersionString(void); + /** + * @deprecated + */ +-extern void QRcode_clearCache(void) __attribute__ ((deprecated)); ++extern void QRcode_clearCache(void); + + #if defined(__cplusplus) + } diff --git a/recipes/libqrencode/all/patches/0002-cmake-fix-install.patch b/recipes/libqrencode/all/patches/0002-cmake-fix-install.patch new file mode 100644 index 0000000000000..de88544935ad4 --- /dev/null +++ b/recipes/libqrencode/all/patches/0002-cmake-fix-install.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -120,7 +120,7 @@ + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qrencode.1 DESTINATION share/man/man1) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqrencode.pc DESTINATION lib/pkgconfig) + install(FILES qrencode.h DESTINATION include) +-install(TARGETS qrencode DESTINATION lib) ++install(TARGETS qrencode ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) + + ## Build utility tools + if(WITH_TOOLS AND TARGET PNG::PNG) diff --git a/recipes/libqrencode/all/patches/0003-cmake-fix-install-4.1.1.patch b/recipes/libqrencode/all/patches/0003-cmake-fix-install-4.1.1.patch new file mode 100644 index 0000000000000..08545054ed741 --- /dev/null +++ b/recipes/libqrencode/all/patches/0003-cmake-fix-install-4.1.1.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 773e037..9ffd002 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -133,7 +133,7 @@ configure_file(libqrencode.pc.in libqrencode.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qrencode.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqrencode.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(FILES qrencode.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +-install(TARGETS qrencode DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS qrencode ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + ## Build utility tools + if(WITH_TOOLS) diff --git a/recipes/libqrencode/all/test_package/CMakeLists.txt b/recipes/libqrencode/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dcb9df3c597be --- /dev/null +++ b/recipes/libqrencode/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libqrencode REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libqrencode::libqrencode) diff --git a/recipes/libqrencode/all/test_package/conanfile.py b/recipes/libqrencode/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libqrencode/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/libqrencode/all/test_package/test_package.c b/recipes/libqrencode/all/test_package/test_package.c new file mode 100644 index 0000000000000..1d321e8213493 --- /dev/null +++ b/recipes/libqrencode/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + QRcode *code = QRcode_encodeString("conan-center", 0, QR_ECLEVEL_L, QR_MODE_8, 1); + return 0; +} diff --git a/recipes/libqrencode/all/test_v1_package/CMakeLists.txt b/recipes/libqrencode/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libqrencode/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libqrencode/all/test_v1_package/conanfile.py b/recipes/libqrencode/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libqrencode/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/libqrencode/config.yml b/recipes/libqrencode/config.yml new file mode 100644 index 0000000000000..50f2b6c8613f3 --- /dev/null +++ b/recipes/libqrencode/config.yml @@ -0,0 +1,5 @@ +versions: + "4.1.1": + folder: all + "4.0.0": + folder: all diff --git a/recipes/librasterlite/all/conandata.yml b/recipes/librasterlite/all/conandata.yml new file mode 100644 index 0000000000000..8e05bde05f4df --- /dev/null +++ b/recipes/librasterlite/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1g": + url: "https://www.gaia-gis.it/gaia-sins/librasterlite-sources/librasterlite-1.1g.tar.gz" + sha256: "0a8dceb75f8dec2b7bd678266e0ffd5210d7c33e3d01b247e9e92fa730eebcb3" +patches: + "1.1g": + - patch_file: "patches/0001-fix-autotools.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-nmake-honor-flags.patch" + base_path: "source_subfolder" diff --git a/recipes/librasterlite/all/conanfile.py b/recipes/librasterlite/all/conanfile.py new file mode 100644 index 0000000000000..5fbfd045b9808 --- /dev/null +++ b/recipes/librasterlite/all/conanfile.py @@ -0,0 +1,147 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment, tools +import functools +import os + +required_conan_version = ">=1.36.0" + + +class LibrasterliteConan(ConanFile): + name = "librasterlite" + description = ( + "librasterlite is an open source library that stores and retrieves " + "huge raster coverages using a SpatiaLite DBMS." + ) + license = ("MPL-1.1", "GPL-2.0-or-later", "LGPL-2.1-or-later") + topics = ("rasterlite", "raster", "spatialite") + homepage = "https://www.gaia-gis.it/fossil/librasterlite" + 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, + } + + generators = "pkg_config" + + @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) + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("libgeotiff/1.7.0") + self.requires("libjpeg/9d") + self.requires("libpng/1.6.37") + self.requires("libspatialite/5.0.1") + self.requires("libtiff/4.3.0") + self.requires("sqlite3/3.38.1") + + def build_requirements(self): + if not self._is_msvc: + self.build_requires("libtool/2.4.6") + self.build_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _build_msvc(self): + target = "rasterlite_i.lib" if self.options.shared else "rasterlite.lib" + optflags = ["-D_USE_MATH_DEFINES"] + system_libs = [lib + ".lib" for lib in self.deps_cpp_info.system_libs] + if self.options.shared: + optflags.append("-DDLL_EXPORT") + with tools.chdir(self._source_subfolder): + tools.save(os.path.join("headers", "config.h"), "#define VERSION \"{}\"\n".format(self.version)) + with tools.vcvars(self): + with tools.environment_append(VisualStudioBuildEnvironment(self).vars): + self.run("nmake -f makefile.vc {} OPTFLAGS=\"{}\" SYSTEM_LIBS=\"{}\"".format(target, + " ".join(optflags), + " ".join(system_libs))) + + def _build_autotools(self): + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + # relocatable shared libs on macOS + tools.replace_in_file("configure", "-install_name \\$rpath/", "-install_name @rpath/") + # avoid SIP issues on macOS when dependencies are shared + if tools.is_apple_os(self.settings.os): + libpaths = ":".join(self.deps_cpp_info.lib_paths) + tools.replace_in_file( + "configure", + "#! /bin/sh\n", + "#! /bin/sh\nexport DYLD_LIBRARY_PATH={}:$DYLD_LIBRARY_PATH\n".format(libpaths), + ) + with tools.run_environment(self): + autotools = self._configure_autotools() + autotools.make() + + @functools.lru_cache(1) + def _configure_autotools(self): + yes_no = lambda v: "yes" if v else "no" + args = [ + "--enable-static={}".format(yes_no(not self.options.shared)), + "--enable-shared={}".format(yes_no(self.options.shared)), + "--disable-gcov", + ] + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.configure(args=args) + return autotools + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + if self._is_msvc: + self._build_msvc() + else: + self._build_autotools() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + if self._is_msvc: + self.copy("rasterlite.h", dst="include", src=os.path.join(self._source_subfolder, "headers")) + self.copy("*.lib", dst="lib", src=self._source_subfolder) + self.copy("*.dll", dst="bin", src=self._source_subfolder) + else: + with tools.chdir(self._source_subfolder): + with tools.run_environment(self): + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "rasterlite") + suffix = "_i" if self._is_msvc and self.options.shared else "" + self.cpp_info.libs = ["rasterlite{}".format(suffix)] + + # TODO: to remove in conan v2 once pkg_config generator removed + self.cpp_info.names["pkg_config"] = "rasterlite" diff --git a/recipes/librasterlite/all/patches/0001-fix-autotools.patch b/recipes/librasterlite/all/patches/0001-fix-autotools.patch new file mode 100644 index 0000000000000..296edad0d5ea9 --- /dev/null +++ b/recipes/librasterlite/all/patches/0001-fix-autotools.patch @@ -0,0 +1,27 @@ +Fix autotools: +* Disable test and tools +* Do not check transitive dependencies (zlib and proj) + +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = headers lib src test ++SUBDIRS = headers lib + + AUTOMAKE_OPTIONS = dist-zip + +--- a/configure.ac ++++ b/configure.ac +@@ -73,10 +73,8 @@ AC_FUNC_STRFTIME + AC_CHECK_FUNCS([memset sqrt strcasecmp strerror strncasecmp strstr fdatasync ftruncate getcwd gettimeofday localtime_r memmove strerror]) + + # Checks for required libraries +-AC_CHECK_LIB(z,inflateInit_,,AC_MSG_ERROR(['libz' is required but it doesn't seem to be installed on this system.]),-lm) + AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(['libjpeg' is required but it doesn't seem to be installed on this system.]),-lm) + AC_CHECK_LIB(tiff,TIFFClientOpen,,AC_MSG_ERROR(['libtiff' is required but it doesn't seem to be installed on this system.]),-lm) +-AC_CHECK_LIB(proj,pj_init_plus,,AC_MSG_ERROR(['libproj' is required but it doesn't seem to be installed on this system.]),-lm) + AC_CHECK_LIB(geotiff,GTIFSetFromProj4,,AC_MSG_ERROR(['libgeotiff' [>= v.1.2.5] is required but it doesn't seem to be installed on this system.]),-lm) + + PKG_CHECK_MODULES([LIBSPATIALITE], [spatialite], , AC_MSG_ERROR(['libspatialite' is required but it doesn't seem to be installed on this system.])) diff --git a/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch b/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch new file mode 100644 index 0000000000000..ff434e3cfd949 --- /dev/null +++ b/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch @@ -0,0 +1,43 @@ +This patch for msvc build allows to: +* define OPTFLAG ourself from conanfile (allow to honor profile) +* inject a custom SYSTEM_LIBS variable from conanfile (allow robust shared build) +* not hardcode this very specific C:\OSGeo4W environment +* define rasterliteGetVersion() to be compliant with autotools build + +--- a/makefile.vc ++++ b/makefile.vc +@@ -2,7 +2,6 @@ + # + # NMAKE Makefile to build librasterlite on Windows + # +-!INCLUDE nmake.opt + + OBJ_EXT = obj + EXT = $(OBJ_EXT) +@@ -11,10 +10,10 @@ LIBOBJ = lib\rasterlite.$(EXT) lib\rasterlite_gif.$(EXT) \ + lib\rasterlite_png.$(EXT) lib\rasterlite_jpeg.$(EXT) \ + lib\rasterlite_io.$(EXT) lib\rasterlite_image.$(EXT) \ + lib\rasterlite_tiff.$(EXT) lib\rasterlite_aux.$(EXT) \ +- lib\rasterlite_quantize.$(EXT) ++ lib\rasterlite_quantize.$(EXT) lib\rasterlite_version.$(EXT) + RASTERLITE_DLL = rasterlite$(VERSION).dll + +-CFLAGS = /nologo -IC:\OSGeo4W\include -I.\headers $(OPTFLAGS) ++CFLAGS = /nologo -I.\headers $(CFLAGS) $(OPTFLAGS) + + CFLAGS2 = /nologo -IC:\OSGeo4W\include -I.\headers $(OPTFLAGS2) + +@@ -30,11 +29,8 @@ rasterlite.lib: $(LIBOBJ) + $(RASTERLITE_DLL): rasterlite_i.lib + + rasterlite_i.lib: $(LIBOBJ) +- link /debug /dll /out:$(RASTERLITE_DLL) \ +- /implib:rasterlite_i.lib $(LIBOBJ) \ +- C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \ +- C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \ +- C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib ++ link /dll /out:$(RASTERLITE_DLL) \ ++ /implib:rasterlite_i.lib $(LIBOBJ) $(SYSTEM_LIBS) + if exist $(RASTERLITE_DLL).manifest mt -manifest \ + $(RASTERLITE_DLL).manifest -outputresource:$(RASTERLITE_DLL);2 + diff --git a/recipes/librasterlite/all/test_package/CMakeLists.txt b/recipes/librasterlite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..66ed4461774cf --- /dev/null +++ b/recipes/librasterlite/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(librasterlite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} librasterlite::librasterlite) diff --git a/recipes/librasterlite/all/test_package/conanfile.py b/recipes/librasterlite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..79178ce11469e --- /dev/null +++ b/recipes/librasterlite/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 self.settings.os == "Macos" 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.3") + + 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/librasterlite/all/test_package/test_package.c b/recipes/librasterlite/all/test_package/test_package.c new file mode 100644 index 0000000000000..0ec59df2a0ee7 --- /dev/null +++ b/recipes/librasterlite/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include + +#include + +int main(void) { + printf("rasterlite %s\n", rasterliteGetVersion()); + return 0; +} diff --git a/recipes/librasterlite/config.yml b/recipes/librasterlite/config.yml new file mode 100644 index 0000000000000..9903cd560d3b4 --- /dev/null +++ b/recipes/librasterlite/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1g": + folder: all diff --git a/recipes/librasterlite2/all/conandata.yml b/recipes/librasterlite2/all/conandata.yml new file mode 100644 index 0000000000000..4b32e30c8e014 --- /dev/null +++ b/recipes/librasterlite2/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.1.0-beta1": + url: "http://www.gaia-gis.it/gaia-sins/librasterlite2-sources/librasterlite2-1.1.0-beta1.tar.gz" + sha256: "f7284cdfc07ad343a314e4878df0300874b0145d9d331b063b096b482e7e44f4" +patches: + "1.1.0-beta1": + - patch_file: "patches/0001-missing-include.patch" + base_path: "source_subfolder" diff --git a/recipes/librasterlite2/all/conanfile.py b/recipes/librasterlite2/all/conanfile.py new file mode 100644 index 0000000000000..f7a1b69c371ae --- /dev/null +++ b/recipes/librasterlite2/all/conanfile.py @@ -0,0 +1,169 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.36.0" + + +class Librasterlite2Conan(ConanFile): + name = "librasterlite2" + description = ( + "librasterlite2 is an open source library that stores and retrieves " + "huge raster coverages using a SpatiaLite DBMS." + ) + license = ("MPL-1.1", "GPL-2.0-or-later", "LGPL-2.1-or-later") + topics = ("rasterlite", "raster", "spatialite") + homepage = "https://www.gaia-gis.it/fossil/librasterlite2" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openjpeg": [True, False], + "with_webp": [True, False], + "with_lzma": [True, False], + "with_lz4": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openjpeg": True, + "with_webp": True, + "with_lzma": True, + "with_lz4": True, + "with_zstd": True, + } + + generators = "pkg_config" + + @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) + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("cairo/1.17.4") + self.requires("freetype/2.11.1") + self.requires("giflib/5.2.1") + self.requires("libcurl/7.80.0") + self.requires("libgeotiff/1.7.1") + self.requires("libjpeg/9d") + self.requires("libpng/1.6.37") + self.requires("libspatialite/5.0.1") + self.requires("libtiff/4.3.0") + self.requires("libxml2/2.9.13") + self.requires("sqlite3/3.38.1") + self.requires("zlib/1.2.12") + if self.options.with_openjpeg: + self.requires("openjpeg/2.4.0") + if self.options.with_webp: + self.requires("libwebp/1.2.2") + if self.options.with_lzma: + self.requires("xz_utils/5.2.5") + if self.options.with_lz4: + self.requires("lz4/1.9.3") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + + def validate(self): + if self._is_msvc: + raise ConanInvalidConfiguration("Visual Studio not supported yet") + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + self.build_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + 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) + # Disable tests, tools and examples + tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.am"), + "SUBDIRS = headers src test tools examples", + "SUBDIRS = headers src") + # fix MinGW + tools.replace_in_file(os.path.join(self._source_subfolder, "configure.ac"), + "AC_CHECK_LIB(z,", + "AC_CHECK_LIB({},".format(self.deps_cpp_info["zlib"].libs[0])) + + @functools.lru_cache(1) + def _configure_autotools(self): + yes_no = lambda v: "yes" if v else "no" + args = [ + "--enable-static={}".format(yes_no(not self.options.shared)), + "--enable-shared={}".format(yes_no(self.options.shared)), + "--disable-gcov", + "--enable-openjpeg={}".format(yes_no(self.options.with_openjpeg)), + "--enable-webp={}".format(yes_no(self.options.with_webp)), + "--enable-lzma={}".format(yes_no(self.options.with_lzma)), + "--enable-lz4={}".format(yes_no(self.options.with_lz4)), + "--enable-zstd={}".format(yes_no(self.options.with_zstd)), + ] + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.configure(args=args) + return autotools + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + # relocatable shared libs on macOS + tools.replace_in_file("configure", "-install_name \\$rpath/", "-install_name @rpath/") + # avoid SIP issues on macOS when dependencies are shared + if tools.is_apple_os(self.settings.os): + libpaths = ":".join(self.deps_cpp_info.lib_paths) + tools.replace_in_file( + "configure", + "#! /bin/sh\n", + "#! /bin/sh\nexport DYLD_LIBRARY_PATH={}:$DYLD_LIBRARY_PATH\n".format(libpaths), + ) + with tools.run_environment(self): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + with tools.chdir(self._source_subfolder): + with tools.run_environment(self): + autotools = self._configure_autotools() + autotools.install() + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "rasterlite2") + self.cpp_info.libs = ["rasterlite2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once pkg_config generator removed + self.cpp_info.names["pkg_config"] = "rasterlite2" diff --git a/recipes/librasterlite2/all/patches/0001-missing-include.patch b/recipes/librasterlite2/all/patches/0001-missing-include.patch new file mode 100644 index 0000000000000..d2ffe4d7482f3 --- /dev/null +++ b/recipes/librasterlite2/all/patches/0001-missing-include.patch @@ -0,0 +1,11 @@ +--- a/headers/rasterlite2_private.h ++++ b/headers/rasterlite2_private.h +@@ -77,6 +77,8 @@ the terms of any one of the MPL, the GPL or the LGPL. + #include + #endif + ++#include ++ + #ifndef DOXYGEN_SHOULD_SKIP_THIS + #ifdef _WIN32 + #ifdef DLL_EXPORT diff --git a/recipes/librasterlite2/all/test_package/CMakeLists.txt b/recipes/librasterlite2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8c3dd28e2bff3 --- /dev/null +++ b/recipes/librasterlite2/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(librasterlite2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} librasterlite2::librasterlite2) diff --git a/recipes/librasterlite2/all/test_package/conanfile.py b/recipes/librasterlite2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/librasterlite2/all/test_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/librasterlite2/all/test_package/test_package.c b/recipes/librasterlite2/all/test_package/test_package.c new file mode 100644 index 0000000000000..dab3d2554330d --- /dev/null +++ b/recipes/librasterlite2/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include + +int main(void) { + printf("rasterlite2 %s\n", rl2_version()); + printf("-- target cpu: %s\n", rl2_target_cpu()); + return 0; +} diff --git a/recipes/librasterlite2/config.yml b/recipes/librasterlite2/config.yml new file mode 100644 index 0000000000000..063711165754b --- /dev/null +++ b/recipes/librasterlite2/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0-beta1": + folder: all diff --git a/recipes/libraw/all/CMakeLists.txt b/recipes/libraw/all/CMakeLists.txt new file mode 100644 index 0000000000000..1aba64dbf532a --- /dev/null +++ b/recipes/libraw/all/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.8) +project(LibRaw LANGUAGES CXX) + +file(GLOB_RECURSE headers "${LIBRAW_SRC_DIR}/libraw/*.h") + + +if(RAW_LIB_VERSION_STRING VERSION_LESS 0.21) + set(libraw_LIB_SRCS ${LIBRAW_SRC_DIR}/internal/dcraw_common.cpp + ${LIBRAW_SRC_DIR}/internal/dcraw_fileio.cpp + ${LIBRAW_SRC_DIR}/internal/demosaic_packs.cpp + ${LIBRAW_SRC_DIR}/src/libraw_cxx.cpp + ${LIBRAW_SRC_DIR}/src/libraw_c_api.cpp + ${LIBRAW_SRC_DIR}/src/libraw_datastream.cpp + ) +else() + file(GLOB_RECURSE libraw_LIB_SRCS CONFIGURE_DEPENDS "${LIBRAW_SRC_DIR}/src/*.cpp") + + # Exclude placeholder (stub) implementations + file(GLOB_RECURSE exclude_libraw_LIB_SRCS CONFIGURE_DEPENDS "${LIBRAW_SRC_DIR}/src/*_ph.cpp") + list(REMOVE_ITEM libraw_LIB_SRCS ${exclude_libraw_LIB_SRCS}) +endif() + +if(WIN32) + add_definitions(-DWIN32) + + if(BUILD_SHARED_LIBS) + add_definitions(-DLIBRAW_BUILDLIB) + else() + add_definitions(-DLIBRAW_NODLL) + endif() +endif() + +find_package(JPEG CONFIG) +find_package(libjpeg-turbo CONFIG) +find_package(lcms CONFIG) +find_package(Jasper CONFIG) + +if (TARGET JPEG::JPEG OR TARGET libjpeg-turbo::jpeg OR TARGET libjpeg-turbo::jpeg_static) + add_definitions(-DUSE_JPEG -DUSE_JPEG8) +endif () +if (TARGET lcms::lcms) + add_definitions(-DUSE_LCMS2) +endif () +if (TARGET Jasper::Jasper) + add_definitions(-DUSE_JASPER) +endif () + +add_library(raw ${headers} ${libraw_LIB_SRCS}) +target_compile_features(raw PRIVATE cxx_std_11) +target_include_directories(raw PUBLIC "${LIBRAW_SRC_DIR}") +set_target_properties(raw PROPERTIES LINKER_LANGUAGE CXX) +target_compile_options(raw PUBLIC $<$:/W0>) +if (TARGET JPEG::JPEG) + target_link_libraries(raw PUBLIC JPEG::JPEG) +endif () +if (TARGET libjpeg-turbo::jpeg) + target_link_libraries(raw PUBLIC libjpeg-turbo::jpeg) +endif () +if (TARGET libjpeg-turbo::jpeg_static) + target_link_libraries(raw PUBLIC libjpeg-turbo::jpeg_static) +endif () +if (TARGET lcms::lcms) + target_link_libraries(raw PUBLIC lcms::lcms) +endif () +if (TARGET Jasper::Jasper) + target_link_libraries(raw PUBLIC Jasper::Jasper) +endif () + +install(DIRECTORY "${LIBRAW_SRC_DIR}/libraw" DESTINATION include) +install(TARGETS raw ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) diff --git a/recipes/libraw/all/conandata.yml b/recipes/libraw/all/conandata.yml new file mode 100644 index 0000000000000..2293cc11d33ee --- /dev/null +++ b/recipes/libraw/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.21.1": + url: "https://github.com/LibRaw/LibRaw/archive/0.21.1.tar.gz" + sha256: "b63d7ffa43463f74afcc02f9083048c231349b41cc9255dec0840cf8a67b52e0" + "0.20.2": + url: "https://github.com/LibRaw/LibRaw/archive/0.20.2.tar.gz" + sha256: "02df7d403b34602b769bb38e5bf7d4258e075eeefbe980b6832e6e1491989d60" + "0.20.0": + url: "https://github.com/LibRaw/LibRaw/archive/0.20.0.tar.gz" + sha256: "f38cd2620d5adc32d2c9f51cd0dc66d72c75671f1c81dfd13d30c45c6be80d40" + "0.19.5": + url: "https://github.com/LibRaw/LibRaw/archive/0.19.5.tar.gz" + sha256: "9a2a40418e4fb0ab908f6d384ff6f9075f4431f8e3d79a0e44e5a6ea9e75abdc" diff --git a/recipes/libraw/all/conanfile.py b/recipes/libraw/all/conanfile.py new file mode 100644 index 0000000000000..e68c86171e78e --- /dev/null +++ b/recipes/libraw/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.files import get, copy, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class LibRawConan(ConanFile): + name = "libraw" + description = "LibRaw is a library for reading RAW files obtained from digital photo cameras (CRW/CR2, NEF, RAF, DNG, and others)." + license = "CDDL-1.0", "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libraw.org/" + topics = ["image", "photography", "raw"] + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], + "with_lcms": [True, False], + "with_jasper": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_jpeg": "libjpeg", + "with_lcms": True, + "with_jasper": True + } + exports_sources = ["CMakeLists.txt"] + + @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 requirements(self): + # TODO: RawSpeed dependency (-DUSE_RAWSPEED) + # TODO: DNG SDK dependency (-DUSE_DNGSDK) + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + if self.options.with_lcms: + self.requires("lcms/2.14") + if self.options.with_jasper: + self.requires("jasper/4.0.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RAW_LIB_VERSION_STRING"] = self.version + tc.variables["LIBRAW_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.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, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="COPYRIGHT", 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 = collect_libs(self) + + if self.settings.os == "Windows": + self.cpp_info.defines.append("WIN32") + self.cpp_info.system_libs.append("ws2_32") + + if not self.options.shared: + self.cpp_info.defines.append("LIBRAW_NODLL") diff --git a/recipes/libraw/all/test_package/CMakeLists.txt b/recipes/libraw/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a201657a76080 --- /dev/null +++ b/recipes/libraw/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libraw REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libraw::libraw) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libraw/all/test_package/conanfile.py b/recipes/libraw/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libraw/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/libraw/all/test_package/test_package.cpp b/recipes/libraw/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8cd9bc1532674 --- /dev/null +++ b/recipes/libraw/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + std::cout << libraw_version() << "\n"; + return 0; +} diff --git a/recipes/libraw/all/test_v1_package/CMakeLists.txt b/recipes/libraw/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libraw/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libraw/all/test_v1_package/conanfile.py b/recipes/libraw/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libraw/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libraw/config.yml b/recipes/libraw/config.yml new file mode 100644 index 0000000000000..35c98427b7408 --- /dev/null +++ b/recipes/libraw/config.yml @@ -0,0 +1,9 @@ +versions: + "0.21.1": + folder: all + "0.20.2": + folder: all + "0.20.0": + folder: all + "0.19.5": + folder: all diff --git a/recipes/librdkafka/all/conandata.yml b/recipes/librdkafka/all/conandata.yml new file mode 100644 index 0000000000000..79827450beb2c --- /dev/null +++ b/recipes/librdkafka/all/conandata.yml @@ -0,0 +1,92 @@ +sources: + "2.0.2": + url: "https://github.com/edenhill/librdkafka/archive/v2.0.2.tar.gz" + sha256: "f321bcb1e015a34114c83cf1aa7b99ee260236aab096b85c003170c90a47ca9d" + "1.9.2": + url: "https://github.com/edenhill/librdkafka/archive/v1.9.2.tar.gz" + sha256: "3fba157a9f80a0889c982acdd44608be8a46142270a389008b22d921be1198ad" + "1.9.1": + url: "https://github.com/edenhill/librdkafka/archive/v1.9.1.tar.gz" + sha256: "3a54cf375218977b7af4716ed9738378e37fe400a6c5ddb9d622354ca31fdc79" + "1.8.2": + url: "https://github.com/edenhill/librdkafka/archive/v1.8.2.tar.gz" + sha256: "6a747d293a7a4613bd2897e28e8791476fbe1ae7361f2530a876e0fd483482a6" + "1.8.0": + url: "https://github.com/edenhill/librdkafka/archive/v1.8.0.tar.gz" + sha256: "93b12f554fa1c8393ce49ab52812a5f63e264d9af6a50fd6e6c318c481838b7f" + "1.7.0": + url: "https://github.com/edenhill/librdkafka/archive/v1.7.0.tar.gz" + sha256: "c71b8c5ff419da80c31bb8d3036a408c87ad523e0c7588e7660ee5f3c8973057" + "1.6.1": + url: "https://github.com/edenhill/librdkafka/archive/v1.6.1.tar.gz" + sha256: "689028b5fdfdce026f396fc2f3bfe9e38947210d9bd22be28c3159cc8c41b57e" + "1.6.0": + url: "https://github.com/edenhill/librdkafka/archive/v1.6.0.tar.gz" + sha256: "3130cbd391ef683dc9acf9f83fe82ff93b8730a1a34d0518e93c250929be9f6b" + "1.5.3": + url: "https://github.com/edenhill/librdkafka/archive/v1.5.3.tar.gz" + sha256: "2105ca01fef5beca10c9f010bc50342b15d5ce6b73b2489b012e6d09a008b7bf" +patches: + "2.0.2": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-0-2.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.9.2": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-9-1.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.9.1": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-9-1.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.8.2": + - patch_file: patches/0001-Change-library-names-1-7-0.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-7-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.8.0": + - patch_file: patches/0001-Change-library-names-1-7-0.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-7-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.7.0": + - patch_file: patches/0001-Change-library-names-1-7-0.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-7-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.6.1": + - patch_file: patches/0001-Change-library-names-1-5-2.patch + patch_description: "find_package conan packages, link sasl libraries" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-6-1.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.6.0": + - patch_file: patches/0001-Change-library-names-1-5-2.patch + patch_description: "find_package conan packages, link sasl libraries" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-6-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.5.3": + - patch_file: patches/0001-Change-library-names-1-5-2.patch + patch_description: "find_package conan packages, link sasl libraries" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-5-2.patch + patch_description: "refer conan package names" + patch_type: "conan" diff --git a/recipes/librdkafka/all/conanfile.py b/recipes/librdkafka/all/conanfile.py new file mode 100644 index 0000000000000..fbd6361872d87 --- /dev/null +++ b/recipes/librdkafka/all/conanfile.py @@ -0,0 +1,167 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class LibrdkafkaConan(ConanFile): + name = "librdkafka" + description = ( + "Librdkafka is an Apache Kafka C/C++ library designed with message " + "delivery reliability and high performance in mind." + ) + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edenhill/librdkafka" + topics = ("kafka", "consumer", "producer") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "zlib": [True, False], + "zstd": [True, False], + "plugins": [True, False], + "ssl": [True, False], + "sasl": [True, False], + "curl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "zlib": False, + "zstd": False, + "plugins": False, + "ssl": False, + "sasl": False, + "curl": False, + } + + @property + def _depends_on_cyrus_sasl(self): + return self.options.sasl and self.settings.os != "Windows" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "1.9.0": + del self.options.curl + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("lz4/1.9.4") + if self.options.zlib: + self.requires("zlib/1.2.13") + if self.options.zstd: + self.requires("zstd/1.5.5") + if self.options.ssl: + self.requires("openssl/[>=1.1 <4]") + if self._depends_on_cyrus_sasl: + self.requires("cyrus-sasl/2.1.27") + if self.options.get_safe("curl", False): + self.requires("libcurl/8.0.1") + + def build_requirements(self): + if self._depends_on_cyrus_sasl: + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["WITHOUT_OPTIMIZATION"] = self.settings.build_type == "Debug" + tc.variables["ENABLE_DEVEL"] = self.settings.build_type == "Debug" + tc.variables["RDKAFKA_BUILD_STATIC"] = not self.options.shared + tc.variables["RDKAFKA_BUILD_EXAMPLES"] = False + tc.variables["RDKAFKA_BUILD_TESTS"] = False + tc.variables["WITHOUT_WIN32_CONFIG"] = True + tc.variables["WITH_BUNDLED_SSL"] = False + tc.variables["WITH_ZLIB"] = self.options.zlib + tc.variables["WITH_ZSTD"] = self.options.zstd + tc.variables["WITH_PLUGINS"] = self.options.plugins + tc.variables["WITH_SSL"] = self.options.ssl + tc.variables["WITH_SASL"] = self.options.sasl + tc.variables["ENABLE_LZ4_EXT"] = True + if Version(self.version) >= "1.9.0": + tc.variables["WITH_CURL"] = self.options.curl + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + if self._depends_on_cyrus_sasl: + pc = PkgConfigDeps(self) + pc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSES.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "RdKafka") + # Avoid to create undesirables librdkafka::librdkafka target and librdkafka.pc + # it's fine since rdkafka++ component depends on all components + self.cpp_info.set_property("cmake_target_name", "RdKafka::rdkafka++") + self.cpp_info.set_property("pkg_config_name", "rdkafka++") + + # rdkafka + self.cpp_info.components["rdkafka"].set_property("cmake_target_name", "RdKafka::rdkafka") + self.cpp_info.components["rdkafka"].set_property("pkg_config_name", "rdkafka") + self.cpp_info.components["rdkafka"].libs = ["rdkafka"] + self.cpp_info.components["rdkafka"].requires = ["lz4::lz4"] + if self.options.zlib: + self.cpp_info.components["rdkafka"].requires.append("zlib::zlib") + if self.options.zstd: + self.cpp_info.components["rdkafka"].requires.append("zstd::zstd") + if self.options.ssl: + self.cpp_info.components["rdkafka"].requires.append("openssl::openssl") + if self._depends_on_cyrus_sasl: + self.cpp_info.components["rdkafka"].requires.append("cyrus-sasl::cyrus-sasl") + if self.options.get_safe("curl", False): + self.cpp_info.components["rdkafka"].requires.append("libcurl::libcurl") + if self.settings.os == "Windows": + self.cpp_info.components["rdkafka"].system_libs = ["ws2_32", "secur32"] + if self.options.ssl: + self.cpp_info.components["rdkafka"].system_libs.append("crypt32") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["rdkafka"].system_libs.extend(["pthread", "rt", "dl", "m"]) + if not self.options.shared: + self.cpp_info.components["rdkafka"].defines.append("LIBRDKAFKA_STATICLIB") + + # rdkafka++ + self.cpp_info.components["rdkafka++"].set_property("cmake_target_name", "RdKafka::rdkafka++") + self.cpp_info.components["rdkafka++"].set_property("pkg_config_name", "rdkafka++") + self.cpp_info.components["rdkafka++"].libs = ["rdkafka++"] + self.cpp_info.components["rdkafka++"].requires = ["rdkafka"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "RdKafka" + self.cpp_info.names["cmake_find_package_multi"] = "RdKafka" diff --git a/recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch b/recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch new file mode 100644 index 0000000000000..63c4787d111f3 --- /dev/null +++ b/recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,7 +54,7 @@ endif() + # } + + # ZSTD { +-find_package(ZSTD QUIET) ++find_package(zstd QUIET CONFIG) + if(ZSTD_FOUND) + set(with_zstd_default ON) + else() +@@ -133,6 +133,9 @@ else() + endif() + option(WITH_SASL "With SASL" ${with_sasl_default}) + if(WITH_SASL) ++ if(SASL_FOUND) ++ link_directories(${SASL_LIBRARY_DIRS}) ++ endif() + if(WITH_SSL) + set(WITH_SASL_SCRAM ON) + set(WITH_SASL_OAUTHBEARER ON) +@@ -149,7 +152,8 @@ endif() + option(ENABLE_LZ4_EXT "Enable external LZ4 library support" ON) + set(WITH_LZ4_EXT OFF) + if(ENABLE_LZ4_EXT) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND ON) + if(LZ4_FOUND) + set(WITH_LZ4_EXT ON) + list(APPEND BUILT_WITH "LZ4_EXT") diff --git a/recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch b/recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch new file mode 100644 index 0000000000000..966ba38247ca4 --- /dev/null +++ b/recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch @@ -0,0 +1,35 @@ +From 07bd30c67a532be3c1f31aa383a1061c832a034d Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Sun, 30 May 2021 11:02:57 +0200 +Subject: [PATCH] Change library names + +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d1129bce..14d9e7f0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,7 +54,7 @@ endif() + # } + + # ZSTD { +-find_package(ZSTD QUIET) ++find_package(zstd QUIET CONFIG) + if(ZSTD_FOUND) + set(with_zstd_default ON) + else() +@@ -152,7 +152,8 @@ endif() + option(ENABLE_LZ4_EXT "Enable external LZ4 library support" ON) + set(WITH_LZ4_EXT OFF) + if(ENABLE_LZ4_EXT) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND ON) + if(LZ4_FOUND) + set(WITH_LZ4_EXT ON) + list(APPEND BUILT_WITH "LZ4_EXT") +-- +2.32.0.rc0 + diff --git a/recipes/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch b/recipes/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch new file mode 100644 index 0000000000000..93de57a4d1ee6 --- /dev/null +++ b/recipes/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f3dd0f..89a21e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -67,7 +67,7 @@ endif() + # } + + # ZSTD { +-find_package(ZSTD QUIET) ++find_package(zstd QUIET CONFIG) + if(ZSTD_FOUND) + set(with_zstd_default ON) + else() +@@ -169,7 +169,8 @@ endif() + option(ENABLE_LZ4_EXT "Enable external LZ4 library support" ON) + set(WITH_LZ4_EXT OFF) + if(ENABLE_LZ4_EXT) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND ON) + if(LZ4_FOUND) + set(WITH_LZ4_EXT ON) + list(APPEND BUILT_WITH "LZ4_EXT") diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch new file mode 100644 index 0000000000000..2c6f62c68a478 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch @@ -0,0 +1,23 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -209,9 +209,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PUBLIC ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PUBLIC ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PUBLIC $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -246,8 +244,7 @@ if(WITH_LIBDL) + endif() + + if(WITH_LZ4_EXT) +- target_include_directories(rdkafka PUBLIC ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + # Set up path to these sources for other sub-projects (tests, examples) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch new file mode 100644 index 0000000000000..71155e468786f --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch @@ -0,0 +1,23 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -212,9 +212,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PUBLIC ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PUBLIC ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PUBLIC $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -249,8 +247,7 @@ if(WITH_LIBDL) + endif() + + if(WITH_LZ4_EXT) +- target_include_directories(rdkafka PUBLIC ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + # Set up path to these sources for other sub-projects (tests, examples) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch new file mode 100644 index 0000000000000..0a478997b2373 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch @@ -0,0 +1,23 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -212,9 +212,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PUBLIC ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PUBLIC ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PUBLIC $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -253,8 +251,7 @@ if(WITH_LIBDL) + endif() + + if(WITH_LZ4_EXT) +- target_include_directories(rdkafka PUBLIC ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + # Set up path to these sources for other sub-projects (tests, examples) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch new file mode 100644 index 0000000000000..377bc8af8e437 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch @@ -0,0 +1,37 @@ +From 994ad21e1a136e11d1dc5870d991b034e41e6a4c Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Sun, 30 May 2021 11:08:36 +0200 +Subject: [PATCH] Change library targets and result variables + +--- + src/CMakeLists.txt | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6e24a238..4379c060 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -198,9 +198,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -239,8 +237,7 @@ if(WITH_LIBDL) + endif() + + if(WITH_LZ4_EXT) +- target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) +-- +2.32.0.rc0 + diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch new file mode 100644 index 0000000000000..c3347279b9251 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch @@ -0,0 +1,25 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 33b3ced..93f49b1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -207,9 +207,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -248,8 +246,7 @@ if(WITH_LIBDL) + endif() + + if(WITH_LZ4_EXT) +- target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch new file mode 100644 index 0000000000000..740fe7f025bc5 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch @@ -0,0 +1,24 @@ +diff --git a/a/src/CMakeLists.txt b/b/src/CMakeLists.txt +index 37b43c4..78745a7 100644 +--- a/a/src/CMakeLists.txt ++++ b/b/src/CMakeLists.txt +@@ -214,9 +214,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -256,7 +254,7 @@ endif() + + if(WITH_LZ4_EXT) + target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) diff --git a/recipes/librdkafka/all/test_package/CMakeLists.txt b/recipes/librdkafka/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..636b897b6b9d6 --- /dev/null +++ b/recipes/librdkafka/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C CXX) + +find_package(RdKafka REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE RdKafka::rdkafka) + +add_executable(${PROJECT_NAME}_cpp test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RdKafka::rdkafka++) diff --git a/recipes/librdkafka/all/test_package/conanfile.py b/recipes/librdkafka/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6b68cbd742d30 --- /dev/null +++ b/recipes/librdkafka/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/librdkafka/all/test_package/test_package.c b/recipes/librdkafka/all/test_package/test_package.c new file mode 100644 index 0000000000000..9670aa9ff8583 --- /dev/null +++ b/recipes/librdkafka/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const *argv[]) { + rd_kafka_conf_t *conf = rd_kafka_conf_new(); + + printf("\n"); + printf("----------------->Tests are done.<---------------------\n"); + printf("Using version (from C lib) %s\n", rd_kafka_version_str()); + printf("///////////////////////////////////////////////////////\n"); + return 0; +} diff --git a/recipes/librdkafka/all/test_package/test_package.cpp b/recipes/librdkafka/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d1ea0762857ed --- /dev/null +++ b/recipes/librdkafka/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const *argv[]) { + RdKafka::Conf* confpp = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); + + std::cout << std::endl + << "----------------->Tests are done.<---------------------" << std::endl + << "Using version (from C++ lib) " << RdKafka::version() << std::endl + << "///////////////////////////////////////////////////////" << std::endl; + return 0; +} diff --git a/recipes/librdkafka/all/test_v1_package/CMakeLists.txt b/recipes/librdkafka/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/librdkafka/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/librdkafka/all/test_v1_package/conanfile.py b/recipes/librdkafka/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2be697c561678 --- /dev/null +++ b/recipes/librdkafka/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) diff --git a/recipes/librdkafka/config.yml b/recipes/librdkafka/config.yml new file mode 100644 index 0000000000000..92b3b67d04bdf --- /dev/null +++ b/recipes/librdkafka/config.yml @@ -0,0 +1,19 @@ +versions: + "2.0.2": + folder: all + "1.9.2": + folder: all + "1.9.1": + folder: all + "1.8.2": + folder: all + "1.8.0": + folder: all + "1.7.0": + folder: all + "1.6.1": + folder: all + "1.6.0": + folder: all + "1.5.3": + folder: all diff --git a/recipes/librealsense/all/conandata.yml b/recipes/librealsense/all/conandata.yml new file mode 100644 index 0000000000000..881a52d920da1 --- /dev/null +++ b/recipes/librealsense/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "2.49.0": + source: + url: "https://github.com/IntelRealSense/librealsense/archive/refs/tags/v2.49.0.tar.gz" + sha256: "2578ea0e75546aeebd908da732f52e0122bf37750d5a45f3adf92945a673aefd" + firmware: + - url: "https://librealsense.intel.com/Releases/RS4xx/FW/D4XX_FW_Image-5.12.15.50.bin" + sha256: "1030c06e0d266fd5a2704ba38d8615c88a86758034750e58e1656b90156a2d16" + - url: "https://librealsense.intel.com/Releases/SR300/FW/SR3XX_FW_Image-3.26.1.0.bin" + sha256: "c4ac2144df13c3a64fca9d16c175595c903e6e45f02f0f238630a223b07c14d1" + - url: "https://librealsense.intel.com/Releases/TM2/FW/target/0.2.0.951/target-0.2.0.951.mvcmd" + sha256: "0265fd111611908b822cdaf4a3fe5b631c50539b2805d2f364c498aa71c007c0" + - url: "https://librealsense.intel.com/Releases/L5xx/FW/L51X_FW_Image-1.5.8.1.bin" + sha256: "87a9a91b613d9d807b2bfc424abe9cac63cad75dfc04718592c44777cb0b4452" + - url: "https://librealsense.intel.com/Releases/L5xx/FW/L53X_FW_Image-3.5.5.1.bin" + sha256: "b837b2cff2b270b89eed3c0b212ab4108389a20b6e07c19dd5957918ff9ce7e0" +patches: + "2.49.0": + - patch_file: "patches/2.49.0-0001-fix-cmake.patch" + - patch_file: "patches/2.49.0-0002-fix-avx-check.patch" + - patch_file: "patches/2.49.0-0003-atlstr-removal.patch" + patch_description: "Remove Windows ATL libraries usage because it's missing in CI of conancenter" + patch_type: "conan" + - patch_file: "patches/2.49.0-0004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch" + patch_description: "Fix undefined ref to GUID_DEVINTERFACE_USB_DEVICE on Windows" + patch_type: "conan" diff --git a/recipes/librealsense/all/conanfile.py b/recipes/librealsense/all/conanfile.py new file mode 100644 index 0000000000000..3bc7e1c733c5a --- /dev/null +++ b/recipes/librealsense/all/conanfile.py @@ -0,0 +1,146 @@ +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, download, export_conandata_patches, get, rm, rmdir +from conan.tools.microsoft import is_msvc +import os +import urllib + +required_conan_version = ">=1.53.0" + + +class LibrealsenseConan(ConanFile): + name = "librealsense" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/IntelRealSense/librealsense" + description = "Intel(R) RealSense(tm) Cross Platform API for accessing Intel RealSense cameras." + topics = ("usb", "camera") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + "rsusb_backend": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": True, + "rsusb_backend": True, # TODO: change to False when CI gets MSVC ATL support + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.rsusb_backend + + 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("libusb/1.0.26") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def source(self): + sources = self.conan_data["sources"][self.version] + get(self, **sources["source"], strip_root=True) + for firmware in sources["firmware"]: + filename = os.path.basename(urllib.parse.urlparse(firmware["url"]).path) + download(self, filename=filename, **firmware) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CHECK_FOR_UPDATES"] = False + tc.variables["BUILD_WITH_STATIC_CRT"] = False + tc.variables["BUILD_EASYLOGGINGPP"] = False + tc.variables["BUILD_TOOLS"] = self.options.tools + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_GLSL_EXTENSIONS"] = False + tc.variables["BUILD_GRAPHICAL_EXAMPLES"] = False + tc.variables["BUILD_INTERNAL_UNIT_TESTS"] = False + tc.variables["BUILD_NETWORK_DEVICE"] = False + tc.variables["BUILD_UNIT_TESTS"] = False + tc.variables["BUILD_WITH_CUDA"] = False + tc.variables["BUILD_WITH_OPENMP"] = False + tc.variables["BUILD_WITH_TM2"] = True + tc.variables["BUILD_PYTHON_BINDINGS"] = False + tc.variables["BUILD_PYTHON_DOCS"] = False + tc.variables["BUILD_NODEJS_BINDINGS"] = False + tc.variables["BUILD_CV_EXAMPLES"] = False + tc.variables["BUILD_DLIB_EXAMPLES"] = False + tc.variables["BUILD_OPENVINO_EXAMPLES"] = False + tc.variables["BUILD_OPEN3D_EXAMPLES"] = False + tc.variables["BUILD_MATLAB_BINDINGS"] = False + tc.variables["BUILD_PCL_EXAMPLES"] = False + tc.variables["BUILD_UNITY_BINDINGS"] = False + tc.variables["BUILD_CSHARP_BINDINGS"] = False + tc.variables["BUILD_OPENNI2_BINDINGS"] = False + tc.variables["BUILD_CV_KINFU_EXAMPLE"] = False + if self.settings.os == "Windows": + tc.variables["FORCE_RSUSB_BACKEND"] = self.options.rsusb_backend + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if self.options.shared: + postfix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" + rm(self, f"libfw{postfix}.*", os.path.join(self.package_folder, "lib")) + rm(self, f"librealsense-file{postfix}.*", 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, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "realsense2") + + postfix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" + if not self.options.shared: + self.cpp_info.components["fw"].set_property("cmake_target_name", "realsense2::fw") + self.cpp_info.components["fw"].libs = [f"fw{postfix}"] + self.cpp_info.components["realsense-file"].set_property("cmake_target_name", "realsense2::realsense-file") + self.cpp_info.components["realsense-file"].libs = [f"realsense-file{postfix}"] + + self.cpp_info.components["realsense2"].set_property("cmake_target_name", "realsense2::realsense2") + self.cpp_info.components["realsense2"].set_property("pkg_config_name", "realsense2") + self.cpp_info.components["realsense2"].libs = [f"realsense2{postfix}"] + self.cpp_info.components["realsense2"].requires = ["libusb::libusb"] + if not self.options.shared: + self.cpp_info.components["realsense2"].requires.extend(["realsense-file", "fw"]) + if self.settings.os == "Linux": + self.cpp_info.components["realsense2"].system_libs.extend(["m", "pthread", "udev"]) + elif self.settings.os == "Windows": + self.cpp_info.components["realsense2"].system_libs.extend([ + "cfgmgr32", "setupapi", + "sensorsapi", "portabledeviceguids", + "winusb", + "shlwapi", "mf", "mfplat", "mfreadwrite", "mfuuid" + ]) + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "realsense2" + self.cpp_info.names["cmake_find_package_multi"] = "realsense2" diff --git a/recipes/librealsense/all/patches/2.49.0-0001-fix-cmake.patch b/recipes/librealsense/all/patches/2.49.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..19e6de7bccc77 --- /dev/null +++ b/recipes/librealsense/all/patches/2.49.0-0001-fix-cmake.patch @@ -0,0 +1,82 @@ +--- a/CMake/install_config.cmake ++++ b/CMake/install_config.cmake +@@ -48,4 +48,4 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/config/realsense2.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + ) + +-install(CODE "execute_process(COMMAND ldconfig)") ++# install(CODE "execute_process(COMMAND ldconfig)") +--- a/CMake/libusb_config.cmake ++++ b/CMake/libusb_config.cmake +@@ -1,14 +1,5 @@ + if (NOT TARGET usb) +- find_library(LIBUSB_LIB usb-1.0) +- find_path(LIBUSB_INC libusb.h HINTS PATH_SUFFIXES libusb-1.0) +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(usb "libusb not found; using internal version" LIBUSB_LIB LIBUSB_INC) +- if (USB_FOUND AND NOT USE_EXTERNAL_USB) +- add_library(usb INTERFACE) +- target_include_directories(usb INTERFACE ${LIBUSB_INC}) +- target_link_libraries(usb INTERFACE ${LIBUSB_LIB}) +- else() +- include(CMake/external_libusb.cmake) +- endif() +- install(TARGETS usb EXPORT realsense2Targets) ++ find_package(libusb REQUIRED CONFIG) ++ add_library(usb INTERFACE IMPORTED) ++ set_property(TARGET usb PROPERTY INTERFACE_LINK_LIBRARIES libusb::libusb) + endif() +--- a/CMake/windows_config.cmake ++++ b/CMake/windows_config.cmake +@@ -57,8 +57,9 @@ macro(os_target_config) + if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) + message("Preparing Windows 7 drivers" ) + make_directory(${CMAKE_CURRENT_BINARY_DIR}/drivers/) +- file(GLOB DRIVERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/" "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/*") +- foreach(item IN LISTS DRIVERS) ++ file(GLOB DRIVERS "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/" "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/*") ++ foreach(_driver_path IN LISTS DRIVERS) ++ get_filename_component(item ${_driver_path} NAME) + message("Copying ${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/${item} to ${CMAKE_CURRENT_BINARY_DIR}/drivers/" ) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/${item}" "${CMAKE_CURRENT_BINARY_DIR}/drivers/${item}" COPYONLY) + endforeach() +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.1.0) + project(librealsense2 LANGUAGES CXX C) + + include(CMake/lrs_options.cmake) +-include(CMake/connectivity_check.cmake) ++set(INTERNET_CONNECTION ON) + + #Deprecation message, should be removed in future releases + if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC}) +--- a/common/fw/CMakeLists.txt ++++ b/common/fw/CMakeLists.txt +@@ -57,16 +57,16 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Resources) + + function(target_binary url version sha1 symbol ext) + set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-${version}${ext}") +- message(STATUS "${url}/${symbol}-${version}${ext}") +- file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}" +- EXPECTED_HASH SHA1=${sha1} +- STATUS status) +- list(GET status 0 error_code) +- if (NOT ${error_code} EQUAL 0) +- message(FATAL_ERROR "Download firmwnare (${status}) - ${url}") +- else() +- message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}") +- endif() ++ # message(STATUS "${url}/${symbol}-${version}${ext}") ++ file(COPY "${CMAKE_SOURCE_DIR}/${symbol}-${version}${ext}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") ++ # EXPECTED_HASH SHA1=${sha1} ++ # STATUS status) ++ # list(GET status 0 error_code) ++ # if (NOT ${error_code} EQUAL 0) ++ # message(FATAL_ERROR "Download firmwnare (${status}) - ${url}") ++ # else() ++ # message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}") ++ # endif() + string(TOUPPER ${symbol} SYMBOL) + string(REPLACE "." "," version_commas ${version}) + string(REPLACE "\\" "\\\\" binary_escaped "${binary}") diff --git a/recipes/librealsense/all/patches/2.49.0-0002-fix-avx-check.patch b/recipes/librealsense/all/patches/2.49.0-0002-fix-avx-check.patch new file mode 100644 index 0000000000000..50c3e40f8f32d --- /dev/null +++ b/recipes/librealsense/all/patches/2.49.0-0002-fix-avx-check.patch @@ -0,0 +1,13 @@ +diff --git a/src/proc/color-formats-converter.cpp b/src/proc/color-formats-converter.cpp +index cc0146a04..920b06c31 100644 +--- a/src/proc/color-formats-converter.cpp ++++ b/src/proc/color-formats-converter.cpp +@@ -18,7 +18,7 @@ + #include // For SSSE3 intrinsics + #endif + +-#if defined (ANDROID) || (defined (__linux__) && !defined (__x86_64__)) ++#if defined (ANDROID) || !(defined (_M_IX86) || defined (__i386__)) + + bool has_avx() { return false; } + diff --git a/recipes/librealsense/all/patches/2.49.0-0003-atlstr-removal.patch b/recipes/librealsense/all/patches/2.49.0-0003-atlstr-removal.patch new file mode 100644 index 0000000000000..4017cb83f524b --- /dev/null +++ b/recipes/librealsense/all/patches/2.49.0-0003-atlstr-removal.patch @@ -0,0 +1,127 @@ +Removes Windows ATL libraries usage. Needed if your Visual Studio installation does +not have ATL libraries installed. + +This patch should be removed when Conan CI gets ATL support. @sh0 + +diff --git a/src/win/win-helpers.cpp b/src/win/win-helpers.cpp +index 643211fb6..e3efd7d93 100644 +--- a/src/win/win-helpers.cpp ++++ b/src/win/win-helpers.cpp +@@ -12,7 +12,7 @@ + #include + #include + #include +-#include ++//#include + #include + #include + #include +@@ -817,11 +817,11 @@ namespace librealsense + + create_and_open_status named_mutex::create_named_mutex(const char* camID) + { +- CString lstr; +- CString IDstr(camID); ++ //CString lstr; ++ //CString IDstr(camID); + // IVCAM_DLL string is left in librealsense to allow safe + // interoperability with existing tools like DCM +- lstr.Format(L"Global\\IVCAM_DLL_WINUSB_MUTEX%s", IDstr); ++ std::string lstr = std::string("Global\\IVCAM_DLL_WINUSB_MUTEX") + std::string(camID); + auto pSecDesc = make_allow_all_security_descriptor(); + if (pSecDesc) + { +@@ -830,10 +830,10 @@ namespace librealsense + SecAttr.lpSecurityDescriptor = pSecDesc; + SecAttr.bInheritHandle = FALSE; + +- _winusb_mutex = CreateMutex( ++ _winusb_mutex = CreateMutexA( + &SecAttr, + FALSE, +- lstr); ++ lstr.c_str()); + LocalFree(pSecDesc); + } + //CreateMutex failed +@@ -850,16 +850,16 @@ namespace librealsense + + create_and_open_status named_mutex::open_named_mutex(const char* camID) + { +- CString lstr; +- CString IDstr(camID); ++ //CString lstr; ++ //CString IDstr(camID); + // IVCAM_DLL string is left in librealsense to allow safe + // interoperability with existing tools like DCM +- lstr.Format(L"Global\\IVCAM_DLL_WINUSB_MUTEX%s", IDstr.GetString()); ++ std::string lstr = std::string("Global\\IVCAM_DLL_WINUSB_MUTEX") + std::string(camID); + +- _winusb_mutex = OpenMutex( ++ _winusb_mutex = OpenMutexA( + MUTEX_ALL_ACCESS, // request full access + FALSE, // handle not inheritable +- lstr); // object name ++ lstr.c_str()); // object name + + if (_winusb_mutex == nullptr) + { +diff --git a/src/winusb/device-winusb.cpp b/src/winusb/device-winusb.cpp +index cda8d44c2..92bb62566 100644 +--- a/src/winusb/device-winusb.cpp ++++ b/src/winusb/device-winusb.cpp +@@ -12,7 +12,7 @@ + #include "interface-winusb.h" + #include "types.h" + +-#include ++//#include + #include + #include + #include +diff --git a/src/winusb/device-winusb.h b/src/winusb/device-winusb.h +index dd942375a..a5449282f 100644 +--- a/src/winusb/device-winusb.h ++++ b/src/winusb/device-winusb.h +@@ -11,7 +11,7 @@ + #include "messenger-winusb.h" + + #include +-#include ++//#include + #include + #include + #include +@@ -47,4 +47,4 @@ namespace librealsense + std::vector> query_device_interfaces(const std::wstring& path); + }; + } +-} +\ No newline at end of file ++} +diff --git a/src/winusb/enumerator-winusb.cpp b/src/winusb/enumerator-winusb.cpp +index 4cab92403..051291670 100644 +--- a/src/winusb/enumerator-winusb.cpp ++++ b/src/winusb/enumerator-winusb.cpp +@@ -11,7 +11,7 @@ + #include "win/win-helpers.h" + #include "types.h" + +-#include ++//#include + #include + #include + #include +diff --git a/src/winusb/messenger-winusb.cpp b/src/winusb/messenger-winusb.cpp +index d5fab7c8d..d4ba7c350 100644 +--- a/src/winusb/messenger-winusb.cpp ++++ b/src/winusb/messenger-winusb.cpp +@@ -10,7 +10,7 @@ + #include "usb/usb-enumerator.h" + #include "types.h" + +-#include ++//#include + #include + #include + #include diff --git a/recipes/librealsense/all/patches/2.49.0-0004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch b/recipes/librealsense/all/patches/2.49.0-0004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch new file mode 100644 index 0000000000000..5993f3e0d4e20 --- /dev/null +++ b/recipes/librealsense/all/patches/2.49.0-0004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch @@ -0,0 +1,14 @@ +--- a/src/win/win-helpers.cpp ++++ b/src/win/win-helpers.cpp +@@ -26,9 +26,9 @@ + #include // DEVPKEY_... + + //https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/supported-usb-classes#microsoft-provided-usb-device-class-drivers +-#ifndef WITH_TRACKING ++// #ifndef WITH_TRACKING + DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); +-#endif ++// #endif + DEFINE_GUID(GUID_DEVINTERFACE_IMAGE_WIN10, 0x6bdd1fc6L, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); + DEFINE_GUID(GUID_DEVINTERFACE_CAMERA_WIN10, 0xca3e7ab9, 0xb4c3, 0x4ae6, 0x82, 0x51, 0x57, 0x9e, 0xf9, 0x33, 0x89, 0x0f); + diff --git a/recipes/librealsense/all/test_package/CMakeLists.txt b/recipes/librealsense/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9853eeb40e1a1 --- /dev/null +++ b/recipes/librealsense/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(realsense2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE realsense2::realsense2) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/librealsense/all/test_package/conanfile.py b/recipes/librealsense/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/librealsense/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/librealsense/all/test_package/test_package.cpp b/recipes/librealsense/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b30e881e2d57d --- /dev/null +++ b/recipes/librealsense/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + rs2::context context; + return EXIT_SUCCESS; +} diff --git a/recipes/librealsense/all/test_v1_package/CMakeLists.txt b/recipes/librealsense/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/librealsense/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/librealsense/all/test_v1_package/conanfile.py b/recipes/librealsense/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/librealsense/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/librealsense/config.yml b/recipes/librealsense/config.yml new file mode 100644 index 0000000000000..3505cc5770e1a --- /dev/null +++ b/recipes/librealsense/config.yml @@ -0,0 +1,3 @@ +versions: + "2.49.0": + folder: all diff --git a/recipes/libressl/all/conandata.yml b/recipes/libressl/all/conandata.yml new file mode 100644 index 0000000000000..8d70158fca32f --- /dev/null +++ b/recipes/libressl/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.5.3": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.3.tar.gz" + sha256: "3ab5e5eaef69ce20c6b170ee64d785b42235f48f2e62b095fca5d7b6672b8b28" + "3.5.2": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.2.tar.gz" + sha256: "56feab8e21c3fa6549f8b7d7511658b8e98518162838a795314732654adf3e5f" + "3.4.3": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.3.tar.gz" + sha256: "ff88bffe354818b3ccf545e3cafe454c5031c7a77217074f533271d63c37f08d" + "3.2.1": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.2.1.tar.gz" + sha256: "d28db224cfb6d18009b2a7e8cb213cd5c943bbec87550062fef6a38479250315" + "3.2.0": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.2.0.tar.gz" + sha256: "47bd2eb4b4503e47c02efa7e67d2fcd95c7eac6bc9d06b343a1b4705793ed1d5" + "3.0.2": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.0.2.tar.gz" + sha256: "df7b172bf79b957dd27ef36dcaa1fb162562c0e8999e194aa8c1a3df2f15398e" + "2.9.2": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.9.2.tar.gz" + sha256: "c4c78167fae325b47aebd8beb54b6041d6f6a56b3743f4bd5d79b15642f9d5d4" diff --git a/recipes/libressl/all/conanfile.py b/recipes/libressl/all/conanfile.py new file mode 100644 index 0000000000000..83b9b2abeb131 --- /dev/null +++ b/recipes/libressl/all/conanfile.py @@ -0,0 +1,145 @@ +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, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import glob +import os + +required_conan_version = ">=1.53.0" + + +class LibreSSLConan(ConanFile): + name = "libressl" + topics = ("SSL", "TLS", "openssl") + description = ( + "LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in " + "2014, with goals of modernizing the codebase, improving security, and " + "applying best practice development processes." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libressl.org/" + license = ("OpenSSL", "BSD", "ISC") + + provides = "openssl" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Static runtime linked into shared LibreSSL not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBRESSL_SKIP_INSTALL"] = False + tc.variables["LIBRESSL_APPS"] = False # Warning: if enabled, do not use cmake installation, to avoid installing files in OPENSSLDIR + tc.variables["LIBRESSL_TESTS"] = False + tc.variables["ENABLE_ASM"] = True + tc.variables["ENABLE_EXTRATESTS"] = False + tc.variables["ENABLE_NC"] = False + tc.variables["OPENSSLDIR"] = "res" + if is_msvc(self): + tc.preprocessor_definitions["_CRT_SUPPRESS_RESTRICT"] = 1 + tc.generate() + + def _patch_sources(self): + if Version(self.version) >= "3.1.1": + replace_in_file( + self, os.path.join(self.source_folder, "CMakeLists.txt"), + "cmake_minimum_required (VERSION 3.16.4)", + "cmake_minimum_required (VERSION 3.15.6)", + ) + + def build(self): + self._patch_sources() + 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() + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "LibreSSL") + self.cpp_info.set_property("pkg_config_name", "openssl") + + # Crypto + self.cpp_info.components["crypto"].set_property("cmake_target_name", "LibreSSL::Crypto") + self.cpp_info.components["crypto"].set_property("pkg_config_name", "libcrypto") + self.cpp_info.components["crypto"].libs = [self._lib_name("crypto")] + self.cpp_info.components["crypto"].resdirs = ["res"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["crypto"].system_libs = ["pthread", "rt"] + elif self.settings.os == "SunOS": + self.cpp_info.components["crypto"].system_libs = ["nsl", "socket"] + elif self.settings.os == "Windows": + self.cpp_info.components["crypto"].system_libs = ["ws2_32"] + if Version(self.version) >= "3.3.0": + self.cpp_info.components["crypto"].system_libs.append("bcrypt") + + # SSL + self.cpp_info.components["ssl"].set_property("cmake_target_name", "LibreSSL::SSL") + self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") + self.cpp_info.components["ssl"].libs = [self._lib_name("ssl")] + self.cpp_info.components["ssl"].resdirs = ["res"] + self.cpp_info.components["ssl"].requires = ["crypto"] + + # TLS + self.cpp_info.components["tls"].set_property("cmake_target_name", "LibreSSL::TLS") + self.cpp_info.components["tls"].set_property("pkg_config_name", "libtls") + self.cpp_info.components["tls"].libs = [self._lib_name("tls")] + self.cpp_info.components["tls"].resdirs = ["res"] + self.cpp_info.components["tls"].requires = ["crypto", "ssl"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "LibreSSL" + self.cpp_info.names["cmake_find_package_multi"] = "LibreSSL" + self.cpp_info.names["pkg_config"] = "openssl" + self.cpp_info.components["crypto"].names["cmake_find_package"] = "Crypto" + self.cpp_info.components["crypto"].names["cmake_find_package_multi"] = "Crypto" + self.cpp_info.components["ssl"].names["cmake_find_package"] = "SSL" + self.cpp_info.components["ssl"].names["cmake_find_package_multi"] = "SSL" + self.cpp_info.components["tls"].names["cmake_find_package"] = "TLS" + self.cpp_info.components["tls"].names["cmake_find_package_multi"] = "TLS" + + def _lib_name(self, name): + libressl_version = Version(self.version) + if self.settings.os == "Windows" and \ + (libressl_version >= "3.1.0" or (libressl_version < "3.1.0" and self.options.shared)): + lib_fullpath = glob.glob(os.path.join(self.package_folder, "lib", f"*{name}*"))[0] + lib_name = os.path.basename(lib_fullpath).split(".")[0].replace("lib", "") + return lib_name + return name diff --git a/recipes/libressl/all/test_package/CMakeLists.txt b/recipes/libressl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..af51f6d63a4cc --- /dev/null +++ b/recipes/libressl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(LibreSSL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibreSSL::SSL) diff --git a/recipes/libressl/all/test_package/conanfile.py b/recipes/libressl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libressl/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/libressl/all/test_package/test_package.c b/recipes/libressl/all/test_package/test_package.c new file mode 100644 index 0000000000000..10d21074f3afa --- /dev/null +++ b/recipes/libressl/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include +#include + +int main(int argc, char* argv[]) +{ + SSL_library_init(); + SSL_CTX* ctx = SSL_CTX_new(SSLv23_client_method()); + if (!ctx) + return -1; + return 0; +} diff --git a/recipes/libressl/all/test_v1_package/CMakeLists.txt b/recipes/libressl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libressl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libressl/all/test_v1_package/conanfile.py b/recipes/libressl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libressl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libressl/config.yml b/recipes/libressl/config.yml new file mode 100644 index 0000000000000..bfca6d19b58d7 --- /dev/null +++ b/recipes/libressl/config.yml @@ -0,0 +1,15 @@ +versions: + "3.5.3": + folder: all + "3.5.2": + folder: all + "3.4.3": + folder: all + "3.2.1": + folder: all + "3.2.0": + folder: all + "3.0.2": + folder: all + "2.9.2": + folder: all diff --git a/recipes/librhash/all/conandata.yml b/recipes/librhash/all/conandata.yml new file mode 100644 index 0000000000000..7551a33f27039 --- /dev/null +++ b/recipes/librhash/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "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 new file mode 100644 index 0000000000000..5528b9c183b00 --- /dev/null +++ b/recipes/librhash/all/conanfile.py @@ -0,0 +1,121 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class LibRHashConan(ConanFile): + name = "librhash" + description = "Great utility for computing hash sums" + topics = ("rhash", "hash", "checksum") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://rhash.sourceforge.net/" + license = "MIT" + 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, + } + + 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 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 + + 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") + + 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"]) + + 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 + + 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() + + 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")) + + def package_info(self): + 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 new file mode 100644 index 0000000000000..f6e51246e4dea --- /dev/null +++ b/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch @@ -0,0 +1,29 @@ +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 new file mode 100644 index 0000000000000..80f208bb6a15a --- /dev/null +++ b/recipes/librhash/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.3) +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) +target_link_libraries(${PROJECT_NAME} PRIVATE LibRHash::LibRHash) diff --git a/recipes/librhash/all/test_package/conanfile.py b/recipes/librhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2c7657d70d5d9 --- /dev/null +++ b/recipes/librhash/all/test_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/all/test_package/test_package.c b/recipes/librhash/all/test_package/test_package.c new file mode 100644 index 0000000000000..029374c3a9841 --- /dev/null +++ b/recipes/librhash/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include "rhash.h" + +#include +#include + +#define MSG "hello world" +#define SHA256_REF "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9" + +int main() { + rhash_library_init(); + unsigned char rhash_bin_buffer[128]; + char rhash_char_buffer[128]; + rhash_msg(RHASH_SHA256, MSG, strlen(MSG), rhash_bin_buffer); + int nb = rhash_print_bytes(rhash_char_buffer, rhash_bin_buffer, rhash_get_hash_length(RHASH_SHA256), RHPR_HEX); + rhash_char_buffer[rhash_get_hash_length(RHASH_SHA256)] = '\0'; + printf("calculated SHA256 hash= %s\n", rhash_char_buffer); + + printf("reference SHA256 hash= %s\n", SHA256_REF); + return strcmp(rhash_char_buffer, SHA256_REF); +} diff --git a/recipes/librhash/config.yml b/recipes/librhash/config.yml new file mode 100644 index 0000000000000..24eb5d89c9135 --- /dev/null +++ b/recipes/librhash/config.yml @@ -0,0 +1,5 @@ +versions: + 1.4.2: + folder: all + 1.3.9: + folder: all diff --git a/recipes/librttopo/all/CMakeLists.txt b/recipes/librttopo/all/CMakeLists.txt new file mode 100644 index 0000000000000..34ff2e19a69a6 --- /dev/null +++ b/recipes/librttopo/all/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.4) +project(rttopo LANGUAGES C) + +set(RTTOPO_HDR_DIR ${LIBRTTOPO_SRC_DIR}/headers) + +set(SRID_MAX 999999) +set(SRID_USR_MAX 998999) +configure_file(${RTTOPO_HDR_DIR}/librttopo_geom.h.in librttopo_geom.h @ONLY) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/rttopo_config.h "") + +file(GLOB RTTOPO_SRC_FILES ${LIBRTTOPO_SRC_DIR}/src/*.c) +add_library(${PROJECT_NAME} ${RTTOPO_SRC_FILES}) +target_compile_definitions(${PROJECT_NAME} PRIVATE + $<$:_CRT_SECURE_NO_WARNINGS> + RTGEOM_DEBUG_LEVEL=0 + LIBRTGEOM_VERSION="${LIBRTGEOM_VERSION_MAJOR}.${LIBRTGEOM_VERSION_MINOR}.${LIBRTGEOM_VERSION_PATCH}" + RTGEOM_GEOS_VERSION=${RTGEOM_GEOS_VERSION} +) +set_target_properties(${PROJECT_NAME} PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + SOVERSION ${LIBRTGEOM_VERSION_MAJOR} +) +target_include_directories(${PROJECT_NAME} PUBLIC ${RTTOPO_HDR_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + +find_package(geos REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PUBLIC GEOS::geos_c) + +find_library(M_LIB m) +if(M_LIB) + target_link_libraries(${PROJECT_NAME} PRIVATE m) +endif() + +include(GNUInstallDirs) +install( + TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install(FILES ${RTTOPO_HDR_DIR}/librttopo.h ${CMAKE_CURRENT_BINARY_DIR}/librttopo_geom.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/librttopo/all/conandata.yml b/recipes/librttopo/all/conandata.yml new file mode 100644 index 0000000000000..8563feebea0b6 --- /dev/null +++ b/recipes/librttopo/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://gitlab.com/rttopo/rttopo/-/archive/librttopo-1.1.0/rttopo-librttopo-1.1.0.tar.bz2" + sha256: "4b28732c0322849c8754751a384ee3596d06ab316dfc57fe9bbe757c82a27efe" diff --git a/recipes/librttopo/all/conanfile.py b/recipes/librttopo/all/conanfile.py new file mode 100644 index 0000000000000..ceb7c7bc70c18 --- /dev/null +++ b/recipes/librttopo/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibrttopoConan(ConanFile): + name = "librttopo" + description = ( + "The RT Topology Library exposes an API to create and manage " + "standard (ISO 13249 aka SQL/MM) topologies." + ) + license = "GPL-2.0-or-later" + topics = ("topology", "geospatial", "gis") + homepage = "https://git.osgeo.org/gitea/rttopo/librttopo" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("geos/3.11.1", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBRTTOPO_SRC_DIR"] = self.source_folder.replace("\\", "/") + librttopo_version = Version(self.version) + tc.variables["LIBRTGEOM_VERSION_MAJOR"] = librttopo_version.major + tc.variables["LIBRTGEOM_VERSION_MINOR"] = librttopo_version.minor + tc.variables["LIBRTGEOM_VERSION_PATCH"] = librttopo_version.patch + geos_version = Version(self.dependencies["geos"].ref.version) + tc.variables["RTGEOM_GEOS_VERSION"] = f"{geos_version.major}{geos_version.minor}" + tc.generate() + deps = CMakeDeps(self) + deps.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, "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("pkg_config_name", "rttopo") + self.cpp_info.libs = ["rttopo"] + self.cpp_info.requires = ["geos::geos_c"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/librttopo/all/test_package/CMakeLists.txt b/recipes/librttopo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5871be92e3e0b --- /dev/null +++ b/recipes/librttopo/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(librttopo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE librttopo::librttopo) diff --git a/recipes/librttopo/all/test_package/conanfile.py b/recipes/librttopo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/librttopo/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/librttopo/all/test_package/test_package.c b/recipes/librttopo/all/test_package/test_package.c new file mode 100644 index 0000000000000..655926daf39d7 --- /dev/null +++ b/recipes/librttopo/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main(void) { + printf("%s\n", rtgeom_version()); + return 0; +} diff --git a/recipes/librttopo/all/test_v1_package/CMakeLists.txt b/recipes/librttopo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/librttopo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/librttopo/all/test_v1_package/conanfile.py b/recipes/librttopo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/librttopo/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/librttopo/config.yml b/recipes/librttopo/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/librttopo/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/libsafec/all/conandata.yml b/recipes/libsafec/all/conandata.yml new file mode 100644 index 0000000000000..469b7183d9644 --- /dev/null +++ b/recipes/libsafec/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.6.0": + url: "https://github.com/rurban/safeclib/archive/v3.6.tar.gz" + sha256: "bd99d4555030719a83807649b3749bc483143b3548278daaa0a4af0fed5dc4de" diff --git a/recipes/libsafec/all/conanfile.py b/recipes/libsafec/all/conanfile.py new file mode 100644 index 0000000000000..6924adfd04703 --- /dev/null +++ b/recipes/libsafec/all/conanfile.py @@ -0,0 +1,122 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.files import get, rmdir, copy, rm, chdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools +import os + +required_conan_version = ">=1.53.0" + + +class LibSafeCConan(ConanFile): + name = "libsafec" + description = "This library implements the secure C11 Annex K[^5] functions" \ + " on top of most libc implementations, which are missing from them." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rurban/safeclib" + license = "MIT" + topics = ("safec", "libc", "bounds-checking") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "strmax": ["ANY"], + "memmax": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "strmax": 4096, + "memmax": 268435456, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def build_requirements(self): + self.tool_requires("libtool/2.4.6") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.tool_requires("msys2/cci.latest") + + @property + def _supported_compiler(self): + compiler = self.settings.compiler + version = Version(self.settings.compiler.version) + if is_msvc(self): + return False + if compiler == "gcc" and version < "5": + return False + return True + + def validate(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration(f"This platform is not yet supported by {self.ref} (os=Macos arch=armv8)") + if not self._supported_compiler: + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support {self.settings.compiler}-{self.settings.compiler.version}") + + if not str(self.info.options.strmax).isdigit(): + raise ConanException(f"{self.ref} option 'strmax' must be a valid integer number.") + + 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, 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)), + "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), + "--disable-doc", + "--disable-Werror", + "--enable-strmax={}".format(self.options.strmax), + "--enable-memmax={}".format(self.options.memmax), + ] + self._autotools.configure(args=args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + with chdir(self, self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), + win_bash=tools.os_info.is_windows, run_environment=True) + autotools = self._configure_autotools() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + autotools = self._configure_autotools() + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "libsafec")) + self.cpp_info.libs = ["safec-{}".format(self.version)] + self.cpp_info.set_property("pkg_config_name", "libsafec") + + bin_dir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_dir)) + self.env_info.PATH.append(bin_dir) diff --git a/recipes/libsafec/all/test_package/CMakeLists.txt b/recipes/libsafec/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..31762006efa77 --- /dev/null +++ b/recipes/libsafec/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.c) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/libsafec/all/test_package/conanfile.py b/recipes/libsafec/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b7cd0e8fa4f62 --- /dev/null +++ b/recipes/libsafec/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsafec/all/test_package/test_package.c b/recipes/libsafec/all/test_package/test_package.c new file mode 100644 index 0000000000000..adb52ce27b56d --- /dev/null +++ b/recipes/libsafec/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include +#include + +void +constraint_handler(const char* msg, void* ptr, errno_t error) +{ + printf("Constraint handler: %s\n", msg); + printf("Success!\n"); + exit(0); +} + +int +main(int argc, char** argv) +{ + char dst[2]; + + set_str_constraint_handler_s(constraint_handler); + + strcpy_s(dst, sizeof dst, "Too long!"); + printf("Fail!\n"); + + return 1; +} diff --git a/recipes/libsafec/config.yml b/recipes/libsafec/config.yml new file mode 100644 index 0000000000000..31ef12415e244 --- /dev/null +++ b/recipes/libsafec/config.yml @@ -0,0 +1,3 @@ +versions: + "3.6.0": + folder: all diff --git a/recipes/libsamplerate/all/conandata.yml b/recipes/libsamplerate/all/conandata.yml new file mode 100644 index 0000000000000..c21907c54b1f0 --- /dev/null +++ b/recipes/libsamplerate/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.2": + url: "https://github.com/libsndfile/libsamplerate/releases/download/0.2.2/libsamplerate-0.2.2.tar.xz" + sha256: "3258da280511d24b49d6b08615bbe824d0cacc9842b0e4caf11c52cf2b043893" + "0.2.1": + url: "https://github.com/libsndfile/libsamplerate/releases/download/0.2.1/libsamplerate-0.2.1.tar.bz2" + sha256: "f6323b5e234753579d70a0af27796dde4ebeddf58aae4be598e39b3cee00c90a" diff --git a/recipes/libsamplerate/all/conanfile.py b/recipes/libsamplerate/all/conanfile.py new file mode 100644 index 0000000000000..5342c615e4072 --- /dev/null +++ b/recipes/libsamplerate/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibsamplerateConan(ConanFile): + name = "libsamplerate" + description = ( + "libsamplerate (also known as Secret Rabbit Code) is a library for " + "performing sample rate conversion of audio data." + ) + license = "BSD-2-Clause" + topics = ("audio", "resample-audio-files") + homepage = "https://github.com/libsndfile/libsamplerate" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + if is_apple_os(self) and self.options.shared and Version(self.version) >= "0.2.2": + # see https://github.com/libsndfile/libsamplerate/blob/0.2.2/src/CMakeLists.txt#L110-L119 + self.tool_requires("cmake/[>=3.17 <4]") + + 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["LIBSAMPLERATE_EXAMPLES"] = False + tc.variables["LIBSAMPLERATE_INSTALL"] = True + tc.variables["BUILD_TESTING"] = False + tc.generate() + + def _patch_sources(self): + # Disable upstream logic about msvc runtime policy, called before conan toolchain resolution + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "cmake_policy(SET CMP0091 OLD)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SampleRate") + self.cpp_info.set_property("cmake_target_name", "SampleRate::samplerate") + self.cpp_info.set_property("pkg_config_name", "samplerate") + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["samplerate"].libs = ["samplerate"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["samplerate"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "SampleRate" + self.cpp_info.names["cmake_find_package_multi"] = "SampleRate" + self.cpp_info.names["pkg_config"] = "samplerate" + self.cpp_info.components["samplerate"].names["cmake_find_package"] = "samplerate" + self.cpp_info.components["samplerate"].names["cmake_find_package_multi"] = "samplerate" + self.cpp_info.components["samplerate"].set_property("cmake_target_name", "SampleRate::samplerate") diff --git a/recipes/libsamplerate/all/test_package/CMakeLists.txt b/recipes/libsamplerate/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cae81ee05d0e0 --- /dev/null +++ b/recipes/libsamplerate/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(SampleRate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SampleRate::samplerate) diff --git a/recipes/libsamplerate/all/test_package/conanfile.py b/recipes/libsamplerate/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libsamplerate/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/libsamplerate/all/test_package/test_package.c b/recipes/libsamplerate/all/test_package/test_package.c new file mode 100644 index 0000000000000..68781083a8cc0 --- /dev/null +++ b/recipes/libsamplerate/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main(void) { + printf("%s\n", src_get_version()); + return 0; +} diff --git a/recipes/libsamplerate/all/test_v1_package/CMakeLists.txt b/recipes/libsamplerate/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsamplerate/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsamplerate/all/test_v1_package/conanfile.py b/recipes/libsamplerate/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsamplerate/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/libsamplerate/config.yml b/recipes/libsamplerate/config.yml new file mode 100644 index 0000000000000..0fc2e4cb164bd --- /dev/null +++ b/recipes/libsamplerate/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.2": + folder: all + "0.2.1": + folder: all diff --git a/recipes/libsass/all/conandata.yml b/recipes/libsass/all/conandata.yml new file mode 100644 index 0000000000000..a3583eec521db --- /dev/null +++ b/recipes/libsass/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.6.5": + url: "https://github.com/sass/libsass/archive/3.6.5.tar.gz" + sha256: "89d8f2c46ae2b1b826b58ce7dde966a176bac41975b82e84ad46b01a55080582" + "3.6.4": + sha256: f9484d9a6df60576e791566eab2f757a97fd414fce01dd41fc0a693ea5db2889 + url: https://github.com/sass/libsass/archive/3.6.4.tar.gz diff --git a/recipes/libsass/all/conanfile.py b/recipes/libsass/all/conanfile.py new file mode 100644 index 0000000000000..374c7b2afb2fd --- /dev/null +++ b/recipes/libsass/all/conanfile.py @@ -0,0 +1,147 @@ +from conan import ConanFile +from conan.tools.files import get, chdir, save, replace_in_file, rmdir, rm +from conan.tools.microsoft import is_msvc +from conans import AutoToolsBuildEnvironment, MSBuild, tools +import os +import re + +required_conan_version = ">=1.52.0" + + +class LibsassConan(ConanFile): + name = "libsass" + license = "MIT" + homepage = "libsass.org" + url = "https://github.com/conan-io/conan-center-index" + description = "A C/C++ implementation of a Sass compiler" + topics = ("Sass", "LibSass", "compiler") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def build_requirements(self): + if self.settings.os != "Windows": + 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) + args = [] + args.append("--disable-tests") + args.append("--enable-%s" % ("shared" if self.options.shared else "static")) + args.append("--disable-%s" % ("static" if self.options.shared else "shared")) + self._autotools.configure(args=args) + return self._autotools + + def _build_autotools(self): + with chdir(self, self._source_subfolder): + save(self, path="VERSION", content=f"{self.version}") + self.run("{} -fiv".format(tools.get_env("AUTORECONF"))) + autotools = self._configure_autotools() + autotools.make() + + @property + def _make_program(self): + return tools.get_env("CONAN_MAKE_PROGRAM", tools.which("make") or tools.which("mingw32-make")) + + def _build_mingw(self): + makefile = os.path.join(self._source_subfolder, "Makefile") + replace_in_file(self, makefile, "CFLAGS += -O2", "") + replace_in_file(self, makefile, "CXXFLAGS += -O2", "") + replace_in_file(self, makefile, "LDFLAGS += -O2", "") + with chdir(self, self._source_subfolder): + env_vars = AutoToolsBuildEnvironment(self).vars + env_vars.update({ + "BUILD": "shared" if self.options.shared else "static", + "PREFIX": tools.unix_path(os.path.join(self.package_folder)), + # Don't force static link to mingw libs, leave this decision to consumer (through LDFLAGS in env) + "STATIC_ALL": "0", + "STATIC_LIBGCC": "0", + "STATIC_LIBSTDCPP": "0", + }) + with tools.environment_append(env_vars): + self.run(f"{self._make_program} -f Makefile") + + def _build_visual_studio(self): + with chdir(self, self._source_subfolder): + properties = { + "LIBSASS_STATIC_LIB": "" if self.options.shared else "true", + "WholeProgramOptimization": "true" if any(re.finditer("(^| )[/-]GL($| )", tools.get_env("CFLAGS", ""))) else "false", + } + platforms = { + "x86": "Win32", + "x86_64": "Win64" + } + msbuild = MSBuild(self) + msbuild.build(os.path.join("win", "libsass.sln"), platforms=platforms, properties=properties) + + def build(self): + if self._is_mingw: + self._build_mingw() + elif is_msvc(self): + self._build_visual_studio() + else: + self._build_autotools() + + def _install_autotools(self): + with chdir(self, self._source_subfolder): + autotools = self._configure_autotools() + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + + def _install_mingw(self): + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("*.dll", dst="bin", src=os.path.join(self._source_subfolder, "lib")) + self.copy("*.a", dst="lib", src=os.path.join(self._source_subfolder, "lib")) + + def _install_visual_studio(self): + self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + self.copy("*.dll", dst="bin", src=os.path.join(self._source_subfolder, "win", "bin"), keep_path=False) + self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "win", "bin"), keep_path=False) + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + if self._is_mingw: + self._install_mingw() + elif is_msvc(self): + self._install_visual_studio() + else: + self._install_autotools() + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libsass" + self.cpp_info.libs = ["libsass" if is_msvc(self) else "sass"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m"]) + if not self.options.shared and tools.stdcpp_library(self): + self.cpp_info.system_libs.append(tools.stdcpp_library(self)) diff --git a/recipes/libsass/all/test_package/CMakeLists.txt b/recipes/libsass/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2c3751c7f5fee --- /dev/null +++ b/recipes/libsass/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libsass REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libsass::libsass) diff --git a/recipes/libsass/all/test_package/conanfile.py b/recipes/libsass/all/test_package/conanfile.py new file mode 100644 index 0000000000000..814aa7bbb26c7 --- /dev/null +++ b/recipes/libsass/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LibsassTestConan(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/libsass/all/test_package/test_package.c b/recipes/libsass/all/test_package/test_package.c new file mode 100644 index 0000000000000..33bd73b9a2757 --- /dev/null +++ b/recipes/libsass/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + printf("libsass version %s\t language version %s\n", libsass_version(), libsass_language_version()); + return 0; +} diff --git a/recipes/libsass/config.yml b/recipes/libsass/config.yml new file mode 100644 index 0000000000000..dad090706c27e --- /dev/null +++ b/recipes/libsass/config.yml @@ -0,0 +1,5 @@ +versions: + "3.6.5": + folder: all + "3.6.4": + folder: all diff --git a/recipes/libschrift/all/CMakeLists.txt b/recipes/libschrift/all/CMakeLists.txt new file mode 100644 index 0000000000000..89baaf56270d3 --- /dev/null +++ b/recipes/libschrift/all/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.8) +project(schrift LANGUAGES C) + +include(GNUInstallDirs) + +add_library(schrift ${LIBSCHRIFT_SRC_DIR}/schrift.c) +set_target_properties(schrift PROPERTIES + PUBLIC_HEADER ${LIBSCHRIFT_SRC_DIR}/schrift.h + WINDOWS_EXPORT_ALL_SYMBOLS ON + C_EXTENSIONS OFF + C_STANDARD 99 +) + +find_library(LIBM m) +target_link_libraries(schrift PRIVATE $<$:${LIBM}>) + +install( + TARGETS schrift + 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/libschrift/all/conandata.yml b/recipes/libschrift/all/conandata.yml new file mode 100644 index 0000000000000..f950f67f232f7 --- /dev/null +++ b/recipes/libschrift/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.10.2": + url: "https://github.com/tomolt/libschrift/archive/v0.10.2.tar.gz" + sha256: "23e98611f0dfc6e22dcf531f2de987042ca5a81864911b4e917fb3218795fae0" + "0.10.1": + url: "https://github.com/tomolt/libschrift/archive/refs/tags/v0.10.1.tar.gz" + sha256: "3590c1f9d9cf752edbe51908584aa3dc4d8b466c93bdd3771e830880e143f94c" diff --git a/recipes/libschrift/all/conanfile.py b/recipes/libschrift/all/conanfile.py new file mode 100644 index 0000000000000..949296527320a --- /dev/null +++ b/recipes/libschrift/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.46.0" + + +class LibschriftConan(ConanFile): + name = "libschrift" + description = "A lightweight TrueType font rendering library " + topics = ("truetype", "suckless", ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tomolt/libschrift" + license = "ISC", + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = ["CMakeLists.txt"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 + + 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["LIBSCHRIFT_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 = ["schrift"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libschrift/all/test_package/CMakeLists.txt b/recipes/libschrift/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..36819133561d5 --- /dev/null +++ b/recipes/libschrift/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libschrift REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libschrift::libschrift) diff --git a/recipes/libschrift/all/test_package/OpenSans-Bold.ttf b/recipes/libschrift/all/test_package/OpenSans-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd79d43bea0293ac1b20e8aca1142627983d2c07 GIT binary patch literal 224592 zcmbTe349bq+CN^^*W8&qlRGn+9E1>Zk;HIi2qAQM&s|SFJ%kcM ztoRa0YJNqpo==B7){*c7z97W@SkL?(1tgw-mGBjZ&?~BEY2ON6wlN#$xK1AGSq zD5=XEgs-#_!XNKjk&?b;$_pWc&;z($J8bNb35hSKj3UIe4+De^oBEj3njH2FA(1*xUL`h==2ehvp%>%NZf8hd%rho_>j8a zE}aO%^E=~u)+jUtC2GrY{us_ zl92eM36q9Tcwf`}2q6&+zFUOhj)t!5_)^Ym4;wrGN;GOT5OOllv016VFM8pQzGbI& zxq3PJY6!<#@xguS)^auAJm@t4J5F5ciajAhZ>sOh+m47dPrUltPqjf1StrvwLw~6)2dGq)H|u z#QC5|Ejb{Dl4;@JZPe3A3a+ga zmJ=drO#Jn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Krsi!`?rr3LGQ>H(~^X!~iH!j(G z`ubJ3t*N>v>-sNNPM`bMlcySo)r*VPJ-%zv4VioXI4w2v{&NPt8ujU2+it(`f|r`- z=Y0A;ckMURJO323;M8X~zxF>X3i=QI;Oy|5Rpufs^7Qj3y}WGK1-lM^qG3w+w$EDc z+WVesW!aRR{J(n!L>I|oJ7>(;_{9IWvd2gLO3;Vqsdn@kqlUGJERURL7@wRqN*A82 zVTX0nxuNEh=@~&26hqr%j01-<>K?lPeOpp?^T9d(^#zZNT(z()>l`EXsfOV#jmCfa z#tp|6ei}Whd~mJN%-iydj(TQwdd9B$rxvEYQnY^6*&qDRjOjPE6^yxL`<`0^$IZLs zk7tTS8z0@e`X8tCO#a)IcW%A-(ks3RZ@D~e^ZO-F-@GjAv{}c$zvZjVRc|ltfBJ%X zUAuihy0gCgaLNszUh~(9xB3o#>F%!%3(URuVD^t0kt*NqgXgcAQ3X8&ZeZdg=S(&I&9l96JNncPTa6oTZD6wgSyrO}E$qsUWSL@$b) zeiedGcV2q--ffxBzFdAxvvoq-q3`jk!R^h($ literal 0 HcmV?d00001 diff --git a/recipes/libschrift/all/test_package/conanfile.py b/recipes/libschrift/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d4c18b77de306 --- /dev/null +++ b/recipes/libschrift/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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/libschrift/all/test_package/test_package.c b/recipes/libschrift/all/test_package/test_package.c new file mode 100644 index 0000000000000..154c09dca4013 --- /dev/null +++ b/recipes/libschrift/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include "schrift.h" + +int main(int argc, char* argv[]) { + sft_loadfile(argv[1]); + + return 0; +} diff --git a/recipes/libschrift/all/test_v1_package/CMakeLists.txt b/recipes/libschrift/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a36c74cedeb93 --- /dev/null +++ b/recipes/libschrift/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libschrift REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libschrift::libschrift) diff --git a/recipes/libschrift/all/test_v1_package/conanfile.py b/recipes/libschrift/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..da2d908b1d4a7 --- /dev/null +++ b/recipes/libschrift/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + 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/libschrift/config.yml b/recipes/libschrift/config.yml new file mode 100644 index 0000000000000..3a41bddc4c382 --- /dev/null +++ b/recipes/libschrift/config.yml @@ -0,0 +1,5 @@ +versions: + "0.10.2": + folder: all + "0.10.1": + folder: all diff --git a/recipes/libsecret/all/conandata.yml b/recipes/libsecret/all/conandata.yml new file mode 100644 index 0000000000000..55e19d25249c5 --- /dev/null +++ b/recipes/libsecret/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.20.5": + url: "https://download.gnome.org/sources/libsecret/0.20/libsecret-0.20.5.tar.xz" + sha256: "3fb3ce340fcd7db54d87c893e69bfc2b1f6e4d4b279065ffe66dac9f0fd12b4d" + "0.20.4": + url: "https://download.gnome.org/sources/libsecret/0.20/libsecret-0.20.4.tar.xz" + sha256: "325a4c54db320c406711bf2b55e5cb5b6c29823426aa82596a907595abb39d28" diff --git a/recipes/libsecret/all/conanfile.py b/recipes/libsecret/all/conanfile.py new file mode 100644 index 0000000000000..3311696c926bf --- /dev/null +++ b/recipes/libsecret/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import can_run +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + +required_conan_version = ">=1.53.0" + + +class LibsecretConan(ConanFile): + name = "libsecret" + description = "A library for storing and retrieving passwords and other secrets" + topics = ("gobject", "password", "secret") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://wiki.gnome.org/Projects/Libsecret" + license = "LGPL-2.1-or-later" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libgcrypt": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libgcrypt": True, + } + + @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 + + 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("glib/2.76.0", transitive_headers=True, transitive_libs=True, run=can_run(self)) + if self._use_gcrypt: + self.requires("libgcrypt/1.8.4") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "libsecret recipe is not yet compatible with Windows." + ) + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if not can_run(self): + self.tool_requires("glib/2.76.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = MesonToolchain(self) + tc.project_options["introspection"] = "false" + tc.project_options["manpage"] = "false" + tc.project_options["gtk_doc"] = "false" + tc.project_options["gcrypt"] = "true" if self._use_gcrypt else "false" + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + 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", "libsecret-1") + self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-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"] diff --git a/recipes/libsecret/all/test_package/CMakeLists.txt b/recipes/libsecret/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0158ca54705aa --- /dev/null +++ b/recipes/libsecret/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(libsecret REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libsecret::libsecret) diff --git a/recipes/libsecret/all/test_package/conanfile.py b/recipes/libsecret/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/libsecret/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, run=True) + + 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/libsecret/all/test_package/test_package.cpp b/recipes/libsecret/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4c4c65bd2e106 --- /dev/null +++ b/recipes/libsecret/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main(int argc, char *argv[]) { + const SecretSchema schema = { + "libsecret-conan", + SECRET_SCHEMA_NONE, + { + {"libsecret-conan-testpackage", SECRET_SCHEMA_ATTRIBUTE_STRING}, + {"frogarian", SECRET_SCHEMA_ATTRIBUTE_STRING}, + {NULL, SecretSchemaAttributeType(0)}, + }}; + std::cout << schema.name << std::endl; + + return 0; +} diff --git a/recipes/libsecret/all/test_v1_package/CMakeLists.txt b/recipes/libsecret/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsecret/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsecret/all/test_v1_package/conanfile.py b/recipes/libsecret/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsecret/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/libsecret/config.yml b/recipes/libsecret/config.yml new file mode 100644 index 0000000000000..470f4b110022f --- /dev/null +++ b/recipes/libsecret/config.yml @@ -0,0 +1,5 @@ +versions: + "0.20.5": + folder: all + "0.20.4": + folder: all diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml new file mode 100644 index 0000000000000..bc06101ad2d72 --- /dev/null +++ b/recipes/libselinux/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "3.3": + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.3/libselinux-3.3.tar.gz" + sha256: "acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057" + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.3/libsepol-3.3.tar.gz" + sha256: "2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b" + "3.2": + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.2/libselinux-3.2.tar.gz" + sha256: "df758ef1d9d4811051dd901ea6b029ae334ffd7c671c128beb16bce1e25ac161" + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.2/libsepol-3.2.tar.gz" + sha256: "dfc7f662af8000116e56a01de6a0394ed79be1b34b999e551346233c5dd19508" + "3.1": + - url: "https://github.com/SELinuxProject/selinux/releases/download/20200710/libselinux-3.1.tar.gz" + sha256: "ea5dcbb4d859e3f999c26a13c630da2f16dff9462e3cc8cb7b458ac157d112e7" + - url: "https://github.com/SELinuxProject/selinux/releases/download/20200710/libsepol-3.1.tar.gz" + sha256: "ae6778d01443fdd38cd30eeee846494e19f4d407b09872580372f4aa4bf8a3cc" + "3.0": + - url: "https://github.com/SELinuxProject/selinux/releases/download/20191204/libselinux-3.0.tar.gz" + sha256: "2ea2b30f671dae9d6b1391cbe8fb2ce5d36a3ee4fb1cd3c32f0d933c31b82433" + - url: "https://github.com/SELinuxProject/selinux/releases/download/20191204/libsepol-3.0.tar.gz" + sha256: "5b7ae1881909f1048b06f7a0c364c5c8a86ec12e0ec76e740fe9595a6033eb79" + "2.9": + - url: "https://github.com/SELinuxProject/selinux/releases/download/20190315/libselinux-2.9.tar.gz" + sha256: "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693" + - url: "https://github.com/SELinuxProject/selinux/releases/download/20190315/libsepol-2.9.tar.gz" + sha256: "a34b12b038d121e3e459b1cbaca3c9202e983137819c16baf63658390e3f1d5d" +patches: + "3.0": + - patch_file: patches/0001-fix-fno-common-3.0.patch + base_path: libsepol-3.0 + - patch_file: patches/0002-remove-cil_mem_error_handler.patch + base_path: libsepol-3.0 + "2.9": + - patch_file: patches/0001-fix-fno-common-2.9.patch + base_path: libsepol-2.9 + - patch_file: patches/0002-remove-cil_mem_error_handler.patch + base_path: libsepol-2.9 diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py new file mode 100644 index 0000000000000..b584e1b1696aa --- /dev/null +++ b/recipes/libselinux/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class LibSELinuxConan(ConanFile): + name = "libselinux" + description = ( + "Security-enhanced Linux is a patch of the Linux kernel and a number " + "of utilities with enhanced security functionality designed to add " + "mandatory access controls to Linux" + ) + topics = ("linux", "selinux", "security", "security-enhanced") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SELinuxProject/selinux" + license = "Unlicense" + 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 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("pcre2/10.42") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") + + 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/1.9.3") + + def source(self): + for download in self.conan_data["sources"][self.version]: + get(self, **download) + + @property + def _sepol_soversion(self): + return "2" if Version(self.version) >= "3.2" else "1" + + @property + def _selinux_soversion(self): + return "1" + + @property + def _sepol_library_target(self): + return f"libsepol.so.{self._sepol_soversion}" if self.options.shared else "libsepol.a" + + @property + def _selinux_library_target(self): + return f"libselinux.so.{self._selinux_soversion}" if self.options.shared else "libselinux.a" + + @property + def _sepol_source_folder(self): + return os.path.join(self.source_folder, f"libsepol-{self.version}") + + @property + def _selinux_source_folder(self): + return os.path.join(self.source_folder, f"libselinux-{self.version}") + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + tc = AutotoolsToolchain(self) + sepol_include_folder = os.path.join(self._sepol_source_folder, "include") + tc.extra_cflags.append(f"-I{sepol_include_folder}") + 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() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + with chdir(self, os.path.join(self._sepol_source_folder, "src")): + autotools.make(self._sepol_library_target) + with chdir(self, os.path.join(self._selinux_source_folder)): + autotools.make() + + def package(self): + copy(self, "LICENSE", self._selinux_source_folder, os.path.join(self.package_folder, "licenses")) + for library in [self._sepol_source_folder, self._selinux_source_folder]: + copy(self, "*.h", os.path.join(library, "include"), os.path.join(self.package_folder, "include")) + if self.options.shared: + copy(self, "*.so*", library, os.path.join(self.package_folder, "lib"), keep_path=False) + else: + copy(self, "*.a", library, os.path.join(self.package_folder, "lib"), keep_path=False) + + def package_info(self): + self.cpp_info.components["selinux"].set_property("pkg_config_name", "libselinux") + self.cpp_info.components["selinux"].libs = ["selinux"] + self.cpp_info.components["selinux"].requires = ["sepol", "pcre2::pcre2"] + if self.options.shared: + self.cpp_info.components["selinux"].system_libs = ["dl"] + + self.cpp_info.components["sepol"].set_property("pkg_config_name", "libsepol") + self.cpp_info.components["sepol"].libs = ["sepol"] diff --git a/recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch b/recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch new file mode 100644 index 0000000000000..7235c6c4d5659 --- /dev/null +++ b/recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch @@ -0,0 +1,507 @@ +libsepol: fix CIL_KEY_* build errors with -fno-common + +GCC 10 comes with -fno-common enabled by default - fix the CIL_KEY_* +global variables to be defined only once in cil.c and declared in the +header file correctly with the 'extern' keyword, so that other units +including the file don't generate duplicate definitions. + +see https://github.com/SELinuxProject/selinux/commit/a96e8c59ecac84096d870b42701a504791a8cc8c + +--- a/cil/src/cil.c ++++ b/cil/src/cil.c +@@ -77,6 +77,167 @@ int cil_sym_sizes[CIL_SYM_ARRAY_NUM][CIL_SYM_NUM] = { + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + }; + ++char *CIL_KEY_CONS_T1; ++char *CIL_KEY_CONS_T2; ++char *CIL_KEY_CONS_T3; ++char *CIL_KEY_CONS_R1; ++char *CIL_KEY_CONS_R2; ++char *CIL_KEY_CONS_R3; ++char *CIL_KEY_CONS_U1; ++char *CIL_KEY_CONS_U2; ++char *CIL_KEY_CONS_U3; ++char *CIL_KEY_CONS_L1; ++char *CIL_KEY_CONS_L2; ++char *CIL_KEY_CONS_H1; ++char *CIL_KEY_CONS_H2; ++char *CIL_KEY_AND; ++char *CIL_KEY_OR; ++char *CIL_KEY_NOT; ++char *CIL_KEY_EQ; ++char *CIL_KEY_NEQ; ++char *CIL_KEY_CONS_DOM; ++char *CIL_KEY_CONS_DOMBY; ++char *CIL_KEY_CONS_INCOMP; ++char *CIL_KEY_CONDTRUE; ++char *CIL_KEY_CONDFALSE; ++char *CIL_KEY_SELF; ++char *CIL_KEY_OBJECT_R; ++char *CIL_KEY_STAR; ++char *CIL_KEY_TCP; ++char *CIL_KEY_UDP; ++char *CIL_KEY_DCCP; ++char *CIL_KEY_SCTP; ++char *CIL_KEY_AUDITALLOW; ++char *CIL_KEY_TUNABLEIF; ++char *CIL_KEY_ALLOW; ++char *CIL_KEY_DONTAUDIT; ++char *CIL_KEY_TYPETRANSITION; ++char *CIL_KEY_TYPECHANGE; ++char *CIL_KEY_CALL; ++char *CIL_KEY_TUNABLE; ++char *CIL_KEY_XOR; ++char *CIL_KEY_ALL; ++char *CIL_KEY_RANGE; ++char *CIL_KEY_GLOB; ++char *CIL_KEY_FILE; ++char *CIL_KEY_DIR; ++char *CIL_KEY_CHAR; ++char *CIL_KEY_BLOCK; ++char *CIL_KEY_SOCKET; ++char *CIL_KEY_PIPE; ++char *CIL_KEY_SYMLINK; ++char *CIL_KEY_ANY; ++char *CIL_KEY_XATTR; ++char *CIL_KEY_TASK; ++char *CIL_KEY_TRANS; ++char *CIL_KEY_TYPE; ++char *CIL_KEY_ROLE; ++char *CIL_KEY_USER; ++char *CIL_KEY_USERATTRIBUTE; ++char *CIL_KEY_USERATTRIBUTESET; ++char *CIL_KEY_SENSITIVITY; ++char *CIL_KEY_CATEGORY; ++char *CIL_KEY_CATSET; ++char *CIL_KEY_LEVEL; ++char *CIL_KEY_LEVELRANGE; ++char *CIL_KEY_CLASS; ++char *CIL_KEY_IPADDR; ++char *CIL_KEY_MAP_CLASS; ++char *CIL_KEY_CLASSPERMISSION; ++char *CIL_KEY_BOOL; ++char *CIL_KEY_STRING; ++char *CIL_KEY_NAME; ++char *CIL_KEY_SOURCE; ++char *CIL_KEY_TARGET; ++char *CIL_KEY_LOW; ++char *CIL_KEY_HIGH; ++char *CIL_KEY_LOW_HIGH; ++char *CIL_KEY_HANDLEUNKNOWN; ++char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++char *CIL_KEY_HANDLEUNKNOWN_DENY; ++char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++char *CIL_KEY_MACRO; ++char *CIL_KEY_IN; ++char *CIL_KEY_MLS; ++char *CIL_KEY_DEFAULTRANGE; ++char *CIL_KEY_BLOCKINHERIT; ++char *CIL_KEY_BLOCKABSTRACT; ++char *CIL_KEY_CLASSORDER; ++char *CIL_KEY_CLASSMAPPING; ++char *CIL_KEY_CLASSPERMISSIONSET; ++char *CIL_KEY_COMMON; ++char *CIL_KEY_CLASSCOMMON; ++char *CIL_KEY_SID; ++char *CIL_KEY_SIDCONTEXT; ++char *CIL_KEY_SIDORDER; ++char *CIL_KEY_USERLEVEL; ++char *CIL_KEY_USERRANGE; ++char *CIL_KEY_USERBOUNDS; ++char *CIL_KEY_USERPREFIX; ++char *CIL_KEY_SELINUXUSER; ++char *CIL_KEY_SELINUXUSERDEFAULT; ++char *CIL_KEY_TYPEATTRIBUTE; ++char *CIL_KEY_TYPEATTRIBUTESET; ++char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++char *CIL_KEY_TYPEALIAS; ++char *CIL_KEY_TYPEALIASACTUAL; ++char *CIL_KEY_TYPEBOUNDS; ++char *CIL_KEY_TYPEPERMISSIVE; ++char *CIL_KEY_RANGETRANSITION; ++char *CIL_KEY_USERROLE; ++char *CIL_KEY_ROLETYPE; ++char *CIL_KEY_ROLETRANSITION; ++char *CIL_KEY_ROLEALLOW; ++char *CIL_KEY_ROLEATTRIBUTE; ++char *CIL_KEY_ROLEATTRIBUTESET; ++char *CIL_KEY_ROLEBOUNDS; ++char *CIL_KEY_BOOLEANIF; ++char *CIL_KEY_NEVERALLOW; ++char *CIL_KEY_TYPEMEMBER; ++char *CIL_KEY_SENSALIAS; ++char *CIL_KEY_SENSALIASACTUAL; ++char *CIL_KEY_CATALIAS; ++char *CIL_KEY_CATALIASACTUAL; ++char *CIL_KEY_CATORDER; ++char *CIL_KEY_SENSITIVITYORDER; ++char *CIL_KEY_SENSCAT; ++char *CIL_KEY_CONSTRAIN; ++char *CIL_KEY_MLSCONSTRAIN; ++char *CIL_KEY_VALIDATETRANS; ++char *CIL_KEY_MLSVALIDATETRANS; ++char *CIL_KEY_CONTEXT; ++char *CIL_KEY_FILECON; ++char *CIL_KEY_IBPKEYCON; ++char *CIL_KEY_IBENDPORTCON; ++char *CIL_KEY_PORTCON; ++char *CIL_KEY_NODECON; ++char *CIL_KEY_GENFSCON; ++char *CIL_KEY_NETIFCON; ++char *CIL_KEY_PIRQCON; ++char *CIL_KEY_IOMEMCON; ++char *CIL_KEY_IOPORTCON; ++char *CIL_KEY_PCIDEVICECON; ++char *CIL_KEY_DEVICETREECON; ++char *CIL_KEY_FSUSE; ++char *CIL_KEY_POLICYCAP; ++char *CIL_KEY_OPTIONAL; ++char *CIL_KEY_DEFAULTUSER; ++char *CIL_KEY_DEFAULTROLE; ++char *CIL_KEY_DEFAULTTYPE; ++char *CIL_KEY_ROOT; ++char *CIL_KEY_NODE; ++char *CIL_KEY_PERM; ++char *CIL_KEY_ALLOWX; ++char *CIL_KEY_AUDITALLOWX; ++char *CIL_KEY_DONTAUDITX; ++char *CIL_KEY_NEVERALLOWX; ++char *CIL_KEY_PERMISSIONX; ++char *CIL_KEY_IOCTL; ++char *CIL_KEY_UNORDERED; ++char *CIL_KEY_SRC_INFO; ++char *CIL_KEY_SRC_CIL; ++char *CIL_KEY_SRC_HLL; ++ + static void cil_init_keys(void) + { + /* Initialize CIL Keys into strpool */ +--- a/cil/src/cil_internal.h ++++ b/cil/src/cil_internal.h +@@ -74,165 +74,325 @@ enum cil_pass { + /* + Keywords + */ ++extern + char *CIL_KEY_CONS_T1; ++extern + char *CIL_KEY_CONS_T2; ++extern + char *CIL_KEY_CONS_T3; ++extern + char *CIL_KEY_CONS_R1; ++extern + char *CIL_KEY_CONS_R2; ++extern + char *CIL_KEY_CONS_R3; ++extern + char *CIL_KEY_CONS_U1; ++extern + char *CIL_KEY_CONS_U2; ++extern + char *CIL_KEY_CONS_U3; ++extern + char *CIL_KEY_CONS_L1; ++extern + char *CIL_KEY_CONS_L2; ++extern + char *CIL_KEY_CONS_H1; ++extern + char *CIL_KEY_CONS_H2; ++extern + char *CIL_KEY_AND; ++extern + char *CIL_KEY_OR; ++extern + char *CIL_KEY_NOT; ++extern + char *CIL_KEY_EQ; ++extern + char *CIL_KEY_NEQ; ++extern + char *CIL_KEY_CONS_DOM; ++extern + char *CIL_KEY_CONS_DOMBY; ++extern + char *CIL_KEY_CONS_INCOMP; ++extern + char *CIL_KEY_CONDTRUE; ++extern + char *CIL_KEY_CONDFALSE; ++extern + char *CIL_KEY_SELF; ++extern + char *CIL_KEY_OBJECT_R; ++extern + char *CIL_KEY_STAR; ++extern + char *CIL_KEY_TCP; ++extern + char *CIL_KEY_UDP; ++extern + char *CIL_KEY_DCCP; ++extern + char *CIL_KEY_SCTP; ++extern + char *CIL_KEY_AUDITALLOW; ++extern + char *CIL_KEY_TUNABLEIF; ++extern + char *CIL_KEY_ALLOW; ++extern + char *CIL_KEY_DONTAUDIT; ++extern + char *CIL_KEY_TYPETRANSITION; ++extern + char *CIL_KEY_TYPECHANGE; ++extern + char *CIL_KEY_CALL; ++extern + char *CIL_KEY_TUNABLE; ++extern + char *CIL_KEY_XOR; ++extern + char *CIL_KEY_ALL; ++extern + char *CIL_KEY_RANGE; ++extern + char *CIL_KEY_GLOB; ++extern + char *CIL_KEY_FILE; ++extern + char *CIL_KEY_DIR; ++extern + char *CIL_KEY_CHAR; ++extern + char *CIL_KEY_BLOCK; ++extern + char *CIL_KEY_SOCKET; ++extern + char *CIL_KEY_PIPE; ++extern + char *CIL_KEY_SYMLINK; ++extern + char *CIL_KEY_ANY; ++extern + char *CIL_KEY_XATTR; ++extern + char *CIL_KEY_TASK; ++extern + char *CIL_KEY_TRANS; ++extern + char *CIL_KEY_TYPE; ++extern + char *CIL_KEY_ROLE; ++extern + char *CIL_KEY_USER; ++extern + char *CIL_KEY_USERATTRIBUTE; ++extern + char *CIL_KEY_USERATTRIBUTESET; ++extern + char *CIL_KEY_SENSITIVITY; ++extern + char *CIL_KEY_CATEGORY; ++extern + char *CIL_KEY_CATSET; ++extern + char *CIL_KEY_LEVEL; ++extern + char *CIL_KEY_LEVELRANGE; ++extern + char *CIL_KEY_CLASS; ++extern + char *CIL_KEY_IPADDR; ++extern + char *CIL_KEY_MAP_CLASS; ++extern + char *CIL_KEY_CLASSPERMISSION; ++extern + char *CIL_KEY_BOOL; ++extern + char *CIL_KEY_STRING; ++extern + char *CIL_KEY_NAME; ++extern + char *CIL_KEY_SOURCE; ++extern + char *CIL_KEY_TARGET; ++extern + char *CIL_KEY_LOW; ++extern + char *CIL_KEY_HIGH; ++extern + char *CIL_KEY_LOW_HIGH; ++extern + char *CIL_KEY_HANDLEUNKNOWN; ++extern + char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++extern + char *CIL_KEY_HANDLEUNKNOWN_DENY; ++extern + char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++extern + char *CIL_KEY_MACRO; ++extern + char *CIL_KEY_IN; ++extern + char *CIL_KEY_MLS; ++extern + char *CIL_KEY_DEFAULTRANGE; ++extern + char *CIL_KEY_BLOCKINHERIT; ++extern + char *CIL_KEY_BLOCKABSTRACT; ++extern + char *CIL_KEY_CLASSORDER; ++extern + char *CIL_KEY_CLASSMAPPING; ++extern + char *CIL_KEY_CLASSPERMISSIONSET; ++extern + char *CIL_KEY_COMMON; ++extern + char *CIL_KEY_CLASSCOMMON; ++extern + char *CIL_KEY_SID; ++extern + char *CIL_KEY_SIDCONTEXT; ++extern + char *CIL_KEY_SIDORDER; ++extern + char *CIL_KEY_USERLEVEL; ++extern + char *CIL_KEY_USERRANGE; ++extern + char *CIL_KEY_USERBOUNDS; ++extern + char *CIL_KEY_USERPREFIX; ++extern + char *CIL_KEY_SELINUXUSER; ++extern + char *CIL_KEY_SELINUXUSERDEFAULT; ++extern + char *CIL_KEY_TYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEATTRIBUTESET; ++extern + char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEALIAS; ++extern + char *CIL_KEY_TYPEALIASACTUAL; ++extern + char *CIL_KEY_TYPEBOUNDS; ++extern + char *CIL_KEY_TYPEPERMISSIVE; ++extern + char *CIL_KEY_RANGETRANSITION; ++extern + char *CIL_KEY_USERROLE; ++extern + char *CIL_KEY_ROLETYPE; ++extern + char *CIL_KEY_ROLETRANSITION; ++extern + char *CIL_KEY_ROLEALLOW; ++extern + char *CIL_KEY_ROLEATTRIBUTE; ++extern + char *CIL_KEY_ROLEATTRIBUTESET; ++extern + char *CIL_KEY_ROLEBOUNDS; ++extern + char *CIL_KEY_BOOLEANIF; ++extern + char *CIL_KEY_NEVERALLOW; ++extern + char *CIL_KEY_TYPEMEMBER; ++extern + char *CIL_KEY_SENSALIAS; ++extern + char *CIL_KEY_SENSALIASACTUAL; ++extern + char *CIL_KEY_CATALIAS; ++extern + char *CIL_KEY_CATALIASACTUAL; ++extern + char *CIL_KEY_CATORDER; ++extern + char *CIL_KEY_SENSITIVITYORDER; ++extern + char *CIL_KEY_SENSCAT; ++extern + char *CIL_KEY_CONSTRAIN; ++extern + char *CIL_KEY_MLSCONSTRAIN; ++extern + char *CIL_KEY_VALIDATETRANS; ++extern + char *CIL_KEY_MLSVALIDATETRANS; ++extern + char *CIL_KEY_CONTEXT; ++extern + char *CIL_KEY_FILECON; ++extern + char *CIL_KEY_IBPKEYCON; ++extern + char *CIL_KEY_IBENDPORTCON; ++extern + char *CIL_KEY_PORTCON; ++extern + char *CIL_KEY_NODECON; ++extern + char *CIL_KEY_GENFSCON; ++extern + char *CIL_KEY_NETIFCON; ++extern + char *CIL_KEY_PIRQCON; ++extern + char *CIL_KEY_IOMEMCON; ++extern + char *CIL_KEY_IOPORTCON; ++extern + char *CIL_KEY_PCIDEVICECON; ++extern + char *CIL_KEY_DEVICETREECON; ++extern + char *CIL_KEY_FSUSE; ++extern + char *CIL_KEY_POLICYCAP; ++extern + char *CIL_KEY_OPTIONAL; ++extern + char *CIL_KEY_DEFAULTUSER; ++extern + char *CIL_KEY_DEFAULTROLE; ++extern + char *CIL_KEY_DEFAULTTYPE; ++extern + char *CIL_KEY_ROOT; ++extern + char *CIL_KEY_NODE; ++extern + char *CIL_KEY_PERM; ++extern + char *CIL_KEY_ALLOWX; ++extern + char *CIL_KEY_AUDITALLOWX; ++extern + char *CIL_KEY_DONTAUDITX; ++extern + char *CIL_KEY_NEVERALLOWX; ++extern + char *CIL_KEY_PERMISSIONX; ++extern + char *CIL_KEY_IOCTL; ++extern + char *CIL_KEY_UNORDERED; ++extern + char *CIL_KEY_SRC_INFO; ++extern + char *CIL_KEY_SRC_CIL; ++extern + char *CIL_KEY_SRC_HLL; + + /* diff --git a/recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch b/recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch new file mode 100644 index 0000000000000..91052fa990784 --- /dev/null +++ b/recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch @@ -0,0 +1,510 @@ +libsepol: fix CIL_KEY_* build errors with -fno-common + +GCC 10 comes with -fno-common enabled by default - fix the CIL_KEY_* +global variables to be defined only once in cil.c and declared in the +header file correctly with the 'extern' keyword, so that other units +including the file don't generate duplicate definitions. + +see https://github.com/SELinuxProject/selinux/commit/a96e8c59ecac84096d870b42701a504791a8cc8c + +--- a/cil/src/cil.c ++++ b/cil/src/cil.c +@@ -77,6 +77,168 @@ int cil_sym_sizes[CIL_SYM_ARRAY_NUM][CIL_SYM_NUM] = { + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + }; + ++char *CIL_KEY_CONS_T1; ++char *CIL_KEY_CONS_T2; ++char *CIL_KEY_CONS_T3; ++char *CIL_KEY_CONS_R1; ++char *CIL_KEY_CONS_R2; ++char *CIL_KEY_CONS_R3; ++char *CIL_KEY_CONS_U1; ++char *CIL_KEY_CONS_U2; ++char *CIL_KEY_CONS_U3; ++char *CIL_KEY_CONS_L1; ++char *CIL_KEY_CONS_L2; ++char *CIL_KEY_CONS_H1; ++char *CIL_KEY_CONS_H2; ++char *CIL_KEY_AND; ++char *CIL_KEY_OR; ++char *CIL_KEY_NOT; ++char *CIL_KEY_EQ; ++char *CIL_KEY_NEQ; ++char *CIL_KEY_CONS_DOM; ++char *CIL_KEY_CONS_DOMBY; ++char *CIL_KEY_CONS_INCOMP; ++char *CIL_KEY_CONDTRUE; ++char *CIL_KEY_CONDFALSE; ++char *CIL_KEY_SELF; ++char *CIL_KEY_OBJECT_R; ++char *CIL_KEY_STAR; ++char *CIL_KEY_TCP; ++char *CIL_KEY_UDP; ++char *CIL_KEY_DCCP; ++char *CIL_KEY_SCTP; ++char *CIL_KEY_AUDITALLOW; ++char *CIL_KEY_TUNABLEIF; ++char *CIL_KEY_ALLOW; ++char *CIL_KEY_DONTAUDIT; ++char *CIL_KEY_TYPETRANSITION; ++char *CIL_KEY_TYPECHANGE; ++char *CIL_KEY_CALL; ++char *CIL_KEY_TUNABLE; ++char *CIL_KEY_XOR; ++char *CIL_KEY_ALL; ++char *CIL_KEY_RANGE; ++char *CIL_KEY_GLOB; ++char *CIL_KEY_FILE; ++char *CIL_KEY_DIR; ++char *CIL_KEY_CHAR; ++char *CIL_KEY_BLOCK; ++char *CIL_KEY_SOCKET; ++char *CIL_KEY_PIPE; ++char *CIL_KEY_SYMLINK; ++char *CIL_KEY_ANY; ++char *CIL_KEY_XATTR; ++char *CIL_KEY_TASK; ++char *CIL_KEY_TRANS; ++char *CIL_KEY_TYPE; ++char *CIL_KEY_ROLE; ++char *CIL_KEY_USER; ++char *CIL_KEY_USERATTRIBUTE; ++char *CIL_KEY_USERATTRIBUTESET; ++char *CIL_KEY_SENSITIVITY; ++char *CIL_KEY_CATEGORY; ++char *CIL_KEY_CATSET; ++char *CIL_KEY_LEVEL; ++char *CIL_KEY_LEVELRANGE; ++char *CIL_KEY_CLASS; ++char *CIL_KEY_IPADDR; ++char *CIL_KEY_MAP_CLASS; ++char *CIL_KEY_CLASSPERMISSION; ++char *CIL_KEY_BOOL; ++char *CIL_KEY_STRING; ++char *CIL_KEY_NAME; ++char *CIL_KEY_SOURCE; ++char *CIL_KEY_TARGET; ++char *CIL_KEY_LOW; ++char *CIL_KEY_HIGH; ++char *CIL_KEY_LOW_HIGH; ++char *CIL_KEY_GLBLUB; ++char *CIL_KEY_HANDLEUNKNOWN; ++char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++char *CIL_KEY_HANDLEUNKNOWN_DENY; ++char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++char *CIL_KEY_MACRO; ++char *CIL_KEY_IN; ++char *CIL_KEY_MLS; ++char *CIL_KEY_DEFAULTRANGE; ++char *CIL_KEY_BLOCKINHERIT; ++char *CIL_KEY_BLOCKABSTRACT; ++char *CIL_KEY_CLASSORDER; ++char *CIL_KEY_CLASSMAPPING; ++char *CIL_KEY_CLASSPERMISSIONSET; ++char *CIL_KEY_COMMON; ++char *CIL_KEY_CLASSCOMMON; ++char *CIL_KEY_SID; ++char *CIL_KEY_SIDCONTEXT; ++char *CIL_KEY_SIDORDER; ++char *CIL_KEY_USERLEVEL; ++char *CIL_KEY_USERRANGE; ++char *CIL_KEY_USERBOUNDS; ++char *CIL_KEY_USERPREFIX; ++char *CIL_KEY_SELINUXUSER; ++char *CIL_KEY_SELINUXUSERDEFAULT; ++char *CIL_KEY_TYPEATTRIBUTE; ++char *CIL_KEY_TYPEATTRIBUTESET; ++char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++char *CIL_KEY_TYPEALIAS; ++char *CIL_KEY_TYPEALIASACTUAL; ++char *CIL_KEY_TYPEBOUNDS; ++char *CIL_KEY_TYPEPERMISSIVE; ++char *CIL_KEY_RANGETRANSITION; ++char *CIL_KEY_USERROLE; ++char *CIL_KEY_ROLETYPE; ++char *CIL_KEY_ROLETRANSITION; ++char *CIL_KEY_ROLEALLOW; ++char *CIL_KEY_ROLEATTRIBUTE; ++char *CIL_KEY_ROLEATTRIBUTESET; ++char *CIL_KEY_ROLEBOUNDS; ++char *CIL_KEY_BOOLEANIF; ++char *CIL_KEY_NEVERALLOW; ++char *CIL_KEY_TYPEMEMBER; ++char *CIL_KEY_SENSALIAS; ++char *CIL_KEY_SENSALIASACTUAL; ++char *CIL_KEY_CATALIAS; ++char *CIL_KEY_CATALIASACTUAL; ++char *CIL_KEY_CATORDER; ++char *CIL_KEY_SENSITIVITYORDER; ++char *CIL_KEY_SENSCAT; ++char *CIL_KEY_CONSTRAIN; ++char *CIL_KEY_MLSCONSTRAIN; ++char *CIL_KEY_VALIDATETRANS; ++char *CIL_KEY_MLSVALIDATETRANS; ++char *CIL_KEY_CONTEXT; ++char *CIL_KEY_FILECON; ++char *CIL_KEY_IBPKEYCON; ++char *CIL_KEY_IBENDPORTCON; ++char *CIL_KEY_PORTCON; ++char *CIL_KEY_NODECON; ++char *CIL_KEY_GENFSCON; ++char *CIL_KEY_NETIFCON; ++char *CIL_KEY_PIRQCON; ++char *CIL_KEY_IOMEMCON; ++char *CIL_KEY_IOPORTCON; ++char *CIL_KEY_PCIDEVICECON; ++char *CIL_KEY_DEVICETREECON; ++char *CIL_KEY_FSUSE; ++char *CIL_KEY_POLICYCAP; ++char *CIL_KEY_OPTIONAL; ++char *CIL_KEY_DEFAULTUSER; ++char *CIL_KEY_DEFAULTROLE; ++char *CIL_KEY_DEFAULTTYPE; ++char *CIL_KEY_ROOT; ++char *CIL_KEY_NODE; ++char *CIL_KEY_PERM; ++char *CIL_KEY_ALLOWX; ++char *CIL_KEY_AUDITALLOWX; ++char *CIL_KEY_DONTAUDITX; ++char *CIL_KEY_NEVERALLOWX; ++char *CIL_KEY_PERMISSIONX; ++char *CIL_KEY_IOCTL; ++char *CIL_KEY_UNORDERED; ++char *CIL_KEY_SRC_INFO; ++char *CIL_KEY_SRC_CIL; ++char *CIL_KEY_SRC_HLL; ++ + static void cil_init_keys(void) + { + /* Initialize CIL Keys into strpool */ +--- a/cil/src/cil_internal.h ++++ b/cil/src/cil_internal.h +@@ -74,166 +74,327 @@ enum cil_pass { + /* + Keywords + */ ++extern + char *CIL_KEY_CONS_T1; ++extern + char *CIL_KEY_CONS_T2; ++extern + char *CIL_KEY_CONS_T3; ++extern + char *CIL_KEY_CONS_R1; ++extern + char *CIL_KEY_CONS_R2; ++extern + char *CIL_KEY_CONS_R3; ++extern + char *CIL_KEY_CONS_U1; ++extern + char *CIL_KEY_CONS_U2; ++extern + char *CIL_KEY_CONS_U3; ++extern + char *CIL_KEY_CONS_L1; ++extern + char *CIL_KEY_CONS_L2; ++extern + char *CIL_KEY_CONS_H1; ++extern + char *CIL_KEY_CONS_H2; ++extern + char *CIL_KEY_AND; ++extern + char *CIL_KEY_OR; ++extern + char *CIL_KEY_NOT; ++extern + char *CIL_KEY_EQ; ++extern + char *CIL_KEY_NEQ; ++extern + char *CIL_KEY_CONS_DOM; ++extern + char *CIL_KEY_CONS_DOMBY; ++extern + char *CIL_KEY_CONS_INCOMP; ++extern + char *CIL_KEY_CONDTRUE; ++extern + char *CIL_KEY_CONDFALSE; ++extern + char *CIL_KEY_SELF; ++extern + char *CIL_KEY_OBJECT_R; ++extern + char *CIL_KEY_STAR; ++extern + char *CIL_KEY_TCP; ++extern + char *CIL_KEY_UDP; ++extern + char *CIL_KEY_DCCP; ++extern + char *CIL_KEY_SCTP; ++extern + char *CIL_KEY_AUDITALLOW; ++extern + char *CIL_KEY_TUNABLEIF; ++extern + char *CIL_KEY_ALLOW; ++extern + char *CIL_KEY_DONTAUDIT; ++extern + char *CIL_KEY_TYPETRANSITION; ++extern + char *CIL_KEY_TYPECHANGE; ++extern + char *CIL_KEY_CALL; ++extern + char *CIL_KEY_TUNABLE; ++extern + char *CIL_KEY_XOR; ++extern + char *CIL_KEY_ALL; ++extern + char *CIL_KEY_RANGE; ++extern + char *CIL_KEY_GLOB; ++extern + char *CIL_KEY_FILE; ++extern + char *CIL_KEY_DIR; ++extern + char *CIL_KEY_CHAR; ++extern + char *CIL_KEY_BLOCK; ++extern + char *CIL_KEY_SOCKET; ++extern + char *CIL_KEY_PIPE; ++extern + char *CIL_KEY_SYMLINK; ++extern + char *CIL_KEY_ANY; ++extern + char *CIL_KEY_XATTR; ++extern + char *CIL_KEY_TASK; ++extern + char *CIL_KEY_TRANS; ++extern + char *CIL_KEY_TYPE; ++extern + char *CIL_KEY_ROLE; ++extern + char *CIL_KEY_USER; ++extern + char *CIL_KEY_USERATTRIBUTE; ++extern + char *CIL_KEY_USERATTRIBUTESET; ++extern + char *CIL_KEY_SENSITIVITY; ++extern + char *CIL_KEY_CATEGORY; ++extern + char *CIL_KEY_CATSET; ++extern + char *CIL_KEY_LEVEL; ++extern + char *CIL_KEY_LEVELRANGE; ++extern + char *CIL_KEY_CLASS; ++extern + char *CIL_KEY_IPADDR; ++extern + char *CIL_KEY_MAP_CLASS; ++extern + char *CIL_KEY_CLASSPERMISSION; ++extern + char *CIL_KEY_BOOL; ++extern + char *CIL_KEY_STRING; ++extern + char *CIL_KEY_NAME; ++extern + char *CIL_KEY_SOURCE; ++extern + char *CIL_KEY_TARGET; ++extern + char *CIL_KEY_LOW; ++extern + char *CIL_KEY_HIGH; ++extern + char *CIL_KEY_LOW_HIGH; ++extern + char *CIL_KEY_GLBLUB; ++extern + char *CIL_KEY_HANDLEUNKNOWN; ++extern + char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++extern + char *CIL_KEY_HANDLEUNKNOWN_DENY; ++extern + char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++extern + char *CIL_KEY_MACRO; ++extern + char *CIL_KEY_IN; ++extern + char *CIL_KEY_MLS; ++extern + char *CIL_KEY_DEFAULTRANGE; ++extern + char *CIL_KEY_BLOCKINHERIT; ++extern + char *CIL_KEY_BLOCKABSTRACT; ++extern + char *CIL_KEY_CLASSORDER; ++extern + char *CIL_KEY_CLASSMAPPING; ++extern + char *CIL_KEY_CLASSPERMISSIONSET; ++extern + char *CIL_KEY_COMMON; ++extern + char *CIL_KEY_CLASSCOMMON; ++extern + char *CIL_KEY_SID; ++extern + char *CIL_KEY_SIDCONTEXT; ++extern + char *CIL_KEY_SIDORDER; ++extern + char *CIL_KEY_USERLEVEL; ++extern + char *CIL_KEY_USERRANGE; ++extern + char *CIL_KEY_USERBOUNDS; ++extern + char *CIL_KEY_USERPREFIX; ++extern + char *CIL_KEY_SELINUXUSER; ++extern + char *CIL_KEY_SELINUXUSERDEFAULT; ++extern + char *CIL_KEY_TYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEATTRIBUTESET; ++extern + char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEALIAS; ++extern + char *CIL_KEY_TYPEALIASACTUAL; ++extern + char *CIL_KEY_TYPEBOUNDS; ++extern + char *CIL_KEY_TYPEPERMISSIVE; ++extern + char *CIL_KEY_RANGETRANSITION; ++extern + char *CIL_KEY_USERROLE; ++extern + char *CIL_KEY_ROLETYPE; ++extern + char *CIL_KEY_ROLETRANSITION; ++extern + char *CIL_KEY_ROLEALLOW; ++extern + char *CIL_KEY_ROLEATTRIBUTE; ++extern + char *CIL_KEY_ROLEATTRIBUTESET; ++extern + char *CIL_KEY_ROLEBOUNDS; ++extern + char *CIL_KEY_BOOLEANIF; ++extern + char *CIL_KEY_NEVERALLOW; ++extern + char *CIL_KEY_TYPEMEMBER; ++extern + char *CIL_KEY_SENSALIAS; ++extern + char *CIL_KEY_SENSALIASACTUAL; ++extern + char *CIL_KEY_CATALIAS; ++extern + char *CIL_KEY_CATALIASACTUAL; ++extern + char *CIL_KEY_CATORDER; ++extern + char *CIL_KEY_SENSITIVITYORDER; ++extern + char *CIL_KEY_SENSCAT; ++extern + char *CIL_KEY_CONSTRAIN; ++extern + char *CIL_KEY_MLSCONSTRAIN; ++extern + char *CIL_KEY_VALIDATETRANS; ++extern + char *CIL_KEY_MLSVALIDATETRANS; ++extern + char *CIL_KEY_CONTEXT; ++extern + char *CIL_KEY_FILECON; ++extern + char *CIL_KEY_IBPKEYCON; ++extern + char *CIL_KEY_IBENDPORTCON; ++extern + char *CIL_KEY_PORTCON; ++extern + char *CIL_KEY_NODECON; ++extern + char *CIL_KEY_GENFSCON; ++extern + char *CIL_KEY_NETIFCON; ++extern + char *CIL_KEY_PIRQCON; ++extern + char *CIL_KEY_IOMEMCON; ++extern + char *CIL_KEY_IOPORTCON; ++extern + char *CIL_KEY_PCIDEVICECON; ++extern + char *CIL_KEY_DEVICETREECON; ++extern + char *CIL_KEY_FSUSE; ++extern + char *CIL_KEY_POLICYCAP; ++extern + char *CIL_KEY_OPTIONAL; ++extern + char *CIL_KEY_DEFAULTUSER; ++extern + char *CIL_KEY_DEFAULTROLE; ++extern + char *CIL_KEY_DEFAULTTYPE; ++extern + char *CIL_KEY_ROOT; ++extern + char *CIL_KEY_NODE; ++extern + char *CIL_KEY_PERM; ++extern + char *CIL_KEY_ALLOWX; ++extern + char *CIL_KEY_AUDITALLOWX; ++extern + char *CIL_KEY_DONTAUDITX; ++extern + char *CIL_KEY_NEVERALLOWX; ++extern + char *CIL_KEY_PERMISSIONX; ++extern + char *CIL_KEY_IOCTL; ++extern + char *CIL_KEY_UNORDERED; ++extern + char *CIL_KEY_SRC_INFO; ++extern + char *CIL_KEY_SRC_CIL; ++extern + char *CIL_KEY_SRC_HLL; + + /* diff --git a/recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch b/recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch new file mode 100644 index 0000000000000..d985b01ce83ae --- /dev/null +++ b/recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch @@ -0,0 +1,45 @@ +libsepol: remove leftovers of cil_mem_error_handler + +Commit 4459d63 ("libsepol: Remove cil_mem_error_handler() function +pointer") replaced cil_mem_error_handler usage with inline contents of +the default handler. However, it left over the header declaration and +two callers. Convert these as well and remove the header declaration. + +This also fixes a build failure with -fno-common. + +see https://github.com/SELinuxProject/selinux/commit/3d32fc24d6aff360a538c63dad08ca5c957551b0 + +--- a/cil/src/cil_mem.h ++++ b/cil/src/cil_mem.h +@@ -36,7 +36,6 @@ void *cil_calloc(size_t num_elements, size_t element_size); + void *cil_realloc(void *ptr, size_t size); + char *cil_strdup(const char *str); + int cil_asprintf(char **strp, const char *fmt, ...); +-void (*cil_mem_error_handler)(void); + + #endif /* CIL_MEM_H_ */ + +--- a/cil/src/cil_strpool.c ++++ b/cil/src/cil_strpool.c +@@ -80,8 +80,8 @@ char *cil_strpool_add(const char *str) + int rc = hashtab_insert(cil_strpool_tab, (hashtab_key_t)strpool_ref->str, strpool_ref); + if (rc != SEPOL_OK) { + pthread_mutex_unlock(&cil_strpool_mutex); +- (*cil_mem_error_handler)(); +- pthread_mutex_lock(&cil_strpool_mutex); ++ cil_log(CIL_ERR, "Failed to allocate memory\n"); ++ exit(1); + } + } + +@@ -104,8 +104,8 @@ void cil_strpool_init(void) + cil_strpool_tab = hashtab_create(cil_strpool_hash, cil_strpool_compare, CIL_STRPOOL_TABLE_SIZE); + if (cil_strpool_tab == NULL) { + pthread_mutex_unlock(&cil_strpool_mutex); +- (*cil_mem_error_handler)(); +- return; ++ cil_log(CIL_ERR, "Failed to allocate memory\n"); ++ exit(1); + } + } + cil_strpool_readers++; diff --git a/recipes/libselinux/all/test_package/CMakeLists.txt b/recipes/libselinux/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a316858398f3 --- /dev/null +++ b/recipes/libselinux/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libselinux REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libselinux::libselinux) diff --git a/recipes/libselinux/all/test_package/conanfile.py b/recipes/libselinux/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libselinux/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/libselinux/all/test_package/test_package.c b/recipes/libselinux/all/test_package/test_package.c new file mode 100644 index 0000000000000..193f49fd41379 --- /dev/null +++ b/recipes/libselinux/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include + +int main() +{ + if (is_selinux_enabled()) + printf("SELinux is enabled\n"); + else + printf("SELinux is not enabled\n"); + return 0; +} diff --git a/recipes/libselinux/all/test_v1_package/CMakeLists.txt b/recipes/libselinux/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libselinux/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libselinux/all/test_v1_package/conanfile.py b/recipes/libselinux/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libselinux/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/libselinux/config.yml b/recipes/libselinux/config.yml new file mode 100644 index 0000000000000..3fc66eb377b84 --- /dev/null +++ b/recipes/libselinux/config.yml @@ -0,0 +1,11 @@ +versions: + "3.3": + folder: all + "3.2": + folder: all + "3.1": + folder: all + "3.0": + folder: all + "2.9": + folder: all diff --git a/recipes/libserial/all/conandata.yml b/recipes/libserial/all/conandata.yml new file mode 100644 index 0000000000000..6677947184a94 --- /dev/null +++ b/recipes/libserial/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200930": + url: "https://github.com/crayzeewulf/libserial/archive/1d1e47a2faae0470f93eb291263b0ce7ea119a81.tar.gz" + sha256: "a433b04bd42e8b4504e5e1fbe7ec22b648f2872d3d125e58c17b9c6c1b171bba" diff --git a/recipes/libserial/all/conanfile.py b/recipes/libserial/all/conanfile.py new file mode 100644 index 0000000000000..9415f1c8d2625 --- /dev/null +++ b/recipes/libserial/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class LibserialConan(ConanFile): + name = "libserial" + description = "Serial Port Programming in C++" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/crayzeewulf/libserial" + topics = ("serial-ports", "rs232", "usb-serial") + 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 { + "gcc": "7", + "clang": "7", + } + + 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.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} support Linux only.") + + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBSERIAL_ENABLE_TESTING"] = False + tc.variables["LIBSERIAL_BUILD_EXAMPLES"] = False + tc.variables["LIBSERIAL_PYTHON_ENABLE"] = False + tc.variables["LIBSERIAL_BUILD_DOCS"] = False + tc.variables["INSTALL_STATIC"] = not self.options.shared + tc.variables["INSTALL_SHARED"] = self.options.shared + tc.generate() + + def build(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() + + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "Makefile.am", os.path.join(self.package_folder, "include", "libserial")) + + def package_info(self): + self.cpp_info.libs = ["serial"] + + self.cpp_info.set_property("pkg_config_name", "libserial") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libserial/all/test_package/CMakeLists.txt b/recipes/libserial/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c896bd464b19d --- /dev/null +++ b/recipes/libserial/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(libserial REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libserial::libserial) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libserial/all/test_package/conanfile.py b/recipes/libserial/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libserial/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/libserial/all/test_package/test_package.cpp b/recipes/libserial/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..00c0ba2b470c9 --- /dev/null +++ b/recipes/libserial/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#include +#include + +int main(void) { + using LibSerial::SerialPort ; + using LibSerial::SerialStream ; + + // Instantiate a Serial Port and a Serial Stream object. + SerialPort serial_port ; + SerialStream serial_stream ; + + serial_port.IsOpen(); + serial_stream.IsOpen(); + + return EXIT_SUCCESS; +} diff --git a/recipes/libserial/all/test_v1_package/CMakeLists.txt b/recipes/libserial/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libserial/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libserial/all/test_v1_package/conanfile.py b/recipes/libserial/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libserial/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libserial/config.yml b/recipes/libserial/config.yml new file mode 100644 index 0000000000000..27812caf46f4d --- /dev/null +++ b/recipes/libserial/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200930": + folder: all diff --git a/recipes/libsgp4/all/conandata.yml b/recipes/libsgp4/all/conandata.yml new file mode 100644 index 0000000000000..acdc9ee85a453 --- /dev/null +++ b/recipes/libsgp4/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20191207": + url: "https://github.com/dnwrnr/sgp4/archive/f5cb54b382a5b4787432ab5b9a1e83de1a224610.zip" + sha256: "e8ce05b5e62ffe81e2e07020ac693cb5f3eb7dd90587e9c2203639564c030495" +patches: + "20191207": + - patch_file: "patches/fix-cmake-files.patch" diff --git a/recipes/libsgp4/all/conanfile.py b/recipes/libsgp4/all/conanfile.py new file mode 100644 index 0000000000000..740a3e58743e5 --- /dev/null +++ b/recipes/libsgp4/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class Libsgp4Conan(ConanFile): + name = "libsgp4" + description = "C++11 library for SGP4 Simplified perturbations model." + license = "Apache-2.0" + topics = ("sgp4", "orbit", "satellite", "perturbation") + homepage = "https://github.com/dnwrnr/sgp4" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + 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): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build(target="sgp4") + + 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 = ["sgp4s" if self.options.shared else "sgp4"] + self.cpp_info.includedirs.append(os.path.join("include", "SGP4")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libsgp4/all/patches/fix-cmake-files.patch b/recipes/libsgp4/all/patches/fix-cmake-files.patch new file mode 100644 index 0000000000000..c465c32853439 --- /dev/null +++ b/recipes/libsgp4/all/patches/fix-cmake-files.patch @@ -0,0 +1,52 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,16 +1,7 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.8) + PROJECT(SGP4) + +-include(CheckCXXCompilerFlag) +-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +-if(COMPILER_SUPPORTS_CXX11) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +-else() +- message(SEND_ERROR "The compiler ${CMAKE_CXX_COMPILER} doesnt support C++11.") +-endif() +- +-set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +- ++if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") +@@ -19,12 +10,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion") ++endif() + + include_directories(libsgp4) + + add_subdirectory(libsgp4) +-add_subdirectory(sattrack) +-add_subdirectory(runtest) +-add_subdirectory(passpredict) +- +-file(COPY SGP4-VER.TLE DESTINATION ${PROJECT_BINARY_DIR}) +--- a/libsgp4/CMakeLists.txt ++++ b/libsgp4/CMakeLists.txt +@@ -35,7 +35,11 @@ set(SRCS + Vector.h + ) + +-add_library(sgp4 STATIC ${SRCS} ${INCS}) +-add_library(sgp4s SHARED ${SRCS} ${INCS}) +-install( TARGETS sgp4s LIBRARY DESTINATION lib ) ++add_library(sgp4 ${SRCS}) ++set_target_properties(sgp4 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(sgp4 PROPERTIES OUTPUT_NAME sgp4s) ++endif() ++target_compile_features(sgp4 PRIVATE cxx_std_11) ++install( TARGETS sgp4 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install( FILES ${INCS} DESTINATION include/SGP4 ) diff --git a/recipes/libsgp4/all/test_package/CMakeLists.txt b/recipes/libsgp4/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..97488a3cba806 --- /dev/null +++ b/recipes/libsgp4/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libsgp4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libsgp4::libsgp4) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libsgp4/all/test_package/SGP4-VER.TLE b/recipes/libsgp4/all/test_package/SGP4-VER.TLE new file mode 100644 index 0000000000000..381a7c3716e73 --- /dev/null +++ b/recipes/libsgp4/all/test_package/SGP4-VER.TLE @@ -0,0 +1,110 @@ +# ------------------ Verification test cases ---------------------- +# # TEME example +1 00005U 58002B 00179.78495062 .00000023 00000-0 28098-4 0 4753 +2 00005 34.2682 348.7242 1859667 331.7664 19.3264 10.82419157413667 0.00 4320.0 360.00 +# ## fig show lyddane fix error with gsfc ver +1 04632U 70093B 04031.91070959 -.00000084 00000-0 10000-3 0 9955 +2 04632 11.4628 273.1101 1450506 207.6000 143.9350 1.20231981 44145 -5184.0 -4896.0 120.00 +# DELTA 1 DEB # near earth normal drag equation +# # perigee = 377.26km, so moderate drag case +1 06251U 62025E 06176.82412014 .00008885 00000-0 12808-3 0 3985 +2 06251 58.0579 54.0425 0030035 139.1568 221.1854 15.56387291 6774 0.0 2880.0 120.00 +# MOLNIYA 2-14 # 12h resonant ecc in 0.65 to 0.7 range +1 08195U 75081A 06176.33215444 .00000099 00000-0 11873-3 0 813 +2 08195 64.1586 279.0717 6877146 264.7651 20.2257 2.00491383225656 0.0 2880.0 120.00 +# MOLNIYA 1-36 ## fig 12h resonant ecc in 0.7 to 0.715 range +1 09880U 77021A 06176.56157475 .00000421 00000-0 10000-3 0 9814 +2 09880 64.5968 349.3786 7069051 270.0229 16.3320 2.00813614112380 0.0 2880.0 120.00 +# SMS 1 AKM # show the integrator problem with gsfc ver +1 09998U 74033F 05148.79417928 -.00000112 00000-0 00000+0 0 4480 +2 09998 9.4958 313.1750 0270971 327.5225 30.8097 1.16186785 45878 -1440.0 -720.00 60.0 +# # Original STR#3 SDP4 test +1 11801U 80230.29629788 .01431103 00000-0 14311-1 13 +2 11801 46.7916 230.4354 7318036 47.4722 10.4117 2.28537848 13 0.0 1440.0 360.00 +# EUTELSAT 1-F1 (ECS1)## fig lyddane choice in GSFC at 2080 min +1 14128U 83058A 06176.02844893 -.00000158 00000-0 10000-3 0 9627 +2 14128 11.4384 35.2134 0011562 26.4582 333.5652 0.98870114 46093 0.0 2880.0 120.00 +# SL-6 R/B(2) # Deep space, perigee = 82.48 (<98) for +# # s4 > 20 mod +1 16925U 86065D 06151.67415771 .02550794 -30915-6 18784-3 0 4486 +2 16925 62.0906 295.0239 5596327 245.1593 47.9690 4.88511875148616 0.0 1440.0 120.00 +# SL-12 R/B # Shows Lyddane choice at 1860 and 4700 min +1 20413U 83020D 05363.79166667 .00000000 00000-0 00000+0 0 7041 +2 20413 12.3514 187.4253 7864447 196.3027 356.5478 0.24690082 7978 1440.0 4320.0 120.00 +# MOLNIYA 1-83 # 12h resonant, ecc > 0.715 (negative BSTAR) +1 21897U 92011A 06176.02341244 -.00001273 00000-0 -13525-3 0 3044 +2 21897 62.1749 198.0096 7421690 253.0462 20.1561 2.01269994104880 0.0 2880.0 120.00 +# SL-6 R/B(2) # last tle given, decayed 2006-04-04, day 94 +1 22312U 93002D 06094.46235912 .99999999 81888-5 49949-3 0 3953 +2 22312 62.1486 77.4698 0308723 267.9229 88.7392 15.95744531 98783 54.2028672 1440.0 20.00 +# SL-6 R/B(2) # 12h resonant ecc in the > 0.715 range +1 22674U 93035D 06176.55909107 .00002121 00000-0 29868-3 0 6569 +2 22674 63.5035 354.4452 7541712 253.3264 18.7754 1.96679808 93877 0.0 2880.0 120.00 +# ARIANE 44L+ R/B # Lyddane bug at <= 70 min for atan2(), +# # no quadrant fix +1 23177U 94040C 06175.45752052 .00000386 00000-0 76590-3 0 95 +2 23177 7.0496 179.8238 7258491 296.0482 8.3061 2.25906668 97438 0.0 1440.0 120.00 +# WIND # STR#3 Kepler failes past about 200 min +1 23333U 94071A 94305.49999999 -.00172956 26967-3 10000-3 0 15 +2 23333 28.7490 2.3720 9728298 30.4360 1.3500 0.07309491 70 0.0 1600.0 120.00 +# ARIANE 42P+3 R/B ## fig Lyddane bug at > 280.5 min for AcTan() +1 23599U 95029B 06171.76535463 .00085586 12891-6 12956-2 0 2905 +2 23599 6.9327 0.2849 5782022 274.4436 25.2425 4.47796565123555 0.0 720.0 20.00 +# ITALSAT 2 # 24h resonant GEO, inclination > 3 deg +1 24208U 96044A 06177.04061740 -.00000094 00000-0 10000-3 0 1600 +2 24208 3.8536 80.0121 0026640 311.0977 48.3000 1.00778054 36119 0.0 1440.0 120.00 +# AMC-4 ## fig low incl, show incl shift with +# ## gsfc version from 240 to 1440 min +1 25954U 99060A 04039.68057285 -.00000108 00000-0 00000-0 0 6847 +2 25954 0.0004 243.8136 0001765 15.5294 22.7134 1.00271289 15615 -1440.0 1440.0 120.00 +# INTELSAT 902 # negative incl at 9313 min then +# # 270 deg Lyddane bug at 37606 min +1 26900U 01039A 06106.74503247 .00000045 00000-0 10000-3 0 8290 +2 26900 0.0164 266.5378 0003319 86.1794 182.2590 1.00273847 16981 9300.00 9400.00 60.00 +# COSMOS 1024 DEB # 12h resonant ecc in 0.5 to 0.65 range +1 26975U 78066F 06174.85818871 .00000620 00000-0 10000-3 0 6809 +2 26975 68.4714 236.1303 5602877 123.7484 302.5767 2.05657553 67521 0.0 2880.0 120.00 +# CBERS 2 # Near Earth, ecc = 8.84E-5 (< 1.0e-4) +# # drop certain normal drag terms +1 28057U 03049A 06177.78615833 .00000060 00000-0 35940-4 0 1836 +2 28057 98.4283 247.6961 0000884 88.1964 271.9322 14.35478080140550 0.0 2880.0 120.00 +# NAVSTAR 53 (USA 175)# 12h non-resonant GPS (ecc < 0.5 ecc) +1 28129U 03058A 06175.57071136 -.00000104 00000-0 10000-3 0 459 +2 28129 54.7298 324.8098 0048506 266.2640 93.1663 2.00562768 18443 0.0 1440.0 120.00 +# COSMOS 2405 # Near Earth, perigee = 127.20 (< 156) s4 mod +1 28350U 04020A 06167.21788666 .16154492 76267-5 18678-3 0 8894 +2 28350 64.9977 345.6130 0024870 260.7578 99.9590 16.47856722116490 0.0 2880.0 120.00 +# H-2 R/B # Deep space, perigee = 135.75 (<156) s4 mod +1 28623U 05006B 06177.81079184 .00637644 69054-6 96390-3 0 6000 +2 28623 28.5200 114.9834 6249053 170.2550 212.8965 3.79477162 12753 0.0 1440.0 120.00 +# XM-3 # 24h resonant geo, incl < 3 deg goes +# # negative around 1130 min +1 28626U 05008A 06176.46683397 -.00000205 00000-0 10000-3 0 2190 +2 28626 0.0019 286.9433 0000335 13.7918 55.6504 1.00270176 4891 0.0 1440.0 120.00 +# MINOTAUR R/B # Sub-orbital case - Decayed 2005-11-29 +# #(perigee = -51km), lost in 50 minutes +1 28872U 05037B 05333.02012661 .25992681 00000-0 24476-3 0 1534 +2 28872 96.4736 157.9986 0303955 244.0492 110.6523 16.46015938 10708 0.0 60.0 5.00 +# SL-14 DEB # Last stage of decay - lost in under 420 min +1 29141U 85108AA 06170.26783845 .99999999 00000-0 13519-0 0 718 +2 29141 82.4288 273.4882 0015848 277.2124 83.9133 15.93343074 6828 0.0 440.0 20.00 +# SL-12 DEB # Near Earth, perigee = 212.24 < 220 +# # simplified drag eq +1 29238U 06022G 06177.28732010 .00766286 10823-4 13334-2 0 101 +2 29238 51.5595 213.7903 0202579 95.2503 267.9010 15.73823839 1061 0.0 1440.0 120.00 +# # Original STR#3 SGP4 test +1 88888U 80275.98708465 .00073094 13844-3 66816-4 0 87 +2 88888 72.8435 115.9689 0086731 52.6988 110.5714 16.05824518 1058 0.0 1440.0 120.00 +# +# # check error code 4 +1 33333U 05037B 05333.02012661 .25992681 00000-0 24476-3 0 1534 +2 33333 96.4736 157.9986 9950000 244.0492 110.6523 4.00004038 10708 0.0 150.0 5.00 +# # try and check error code 2 but this +1 33334U 78066F 06174.85818871 .00000620 00000-0 10000-3 0 6809 +2 33334 68.4714 236.1303 5602877 123.7484 302.5767 0.00001000 67521 0.0 1440.0 1.00 +# # try to check error code 3 looks like ep never goes below zero, tied close to ecc +1 33335U 05008A 06176.46683397 -.00000205 00000-0 10000-3 0 2190 +2 33335 0.0019 286.9433 0000004 13.7918 55.6504 1.00270176 4891 0.0 1440.0 20.00 +# SL-12 R/B # Shows Lyddane choice at 1860 and 4700 min +1 20413U 83020D 05363.79166667 .00000000 00000-0 00000+0 0 7041 +2 20413 12.3514 187.4253 7864447 196.3027 356.5478 0.24690082 7978 1844000 1845100 5.00 diff --git a/recipes/libsgp4/all/test_package/conanfile.py b/recipes/libsgp4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9c4155c807a23 --- /dev/null +++ b/recipes/libsgp4/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + tle_name = os.path.join(self.source_folder, "SGP4-VER.TLE") + self.run(f"{bin_path} {tle_name}", env="conanrun") diff --git a/recipes/libsgp4/all/test_package/test_package.cpp b/recipes/libsgp4/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8bf8118f5e302 --- /dev/null +++ b/recipes/libsgp4/all/test_package/test_package.cpp @@ -0,0 +1,240 @@ +/* + * Copyright 2013 Daniel Warner + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +void RunTle(Tle tle, double start, double end, double inc) { + double current = start; + SGP4 model(tle); + bool running = true; + bool first_run = true; + + std::cout << std::setprecision(0) << tle.NoradNumber() << " xx" << std::endl; + + while (running) { + bool error = false; + Vector position; + Vector velocity; + double tsince; + + try { + if (first_run && current != 0.0) { + /* + * make sure first run is always as zero + */ + tsince = 0.0; + } else { + /* + * otherwise run as normal + */ + tsince = current; + } + + Eci eci = model.FindPosition(tsince); + position = eci.Position(); + velocity = eci.Velocity(); + } catch (SatelliteException &e) { + std::cerr << e.what() << std::endl; + error = true; + running = false; + } catch (DecayedException &e) { + std::cerr << e.what() << std::endl; + + position = e.Position(); + velocity = e.Velocity(); + + if (!first_run) { + // print out position on first run + error = true; + } + + running = false; + } + + if (!error) { + std::cout << std::setprecision(8) << std::fixed; + std::cout.width(17); + std::cout << tsince << " "; + std::cout.width(16); + std::cout << position.x << " "; + std::cout.width(16); + std::cout << position.y << " "; + std::cout.width(16); + std::cout << position.z << " "; + std::cout << std::setprecision(9) << std::fixed; + std::cout.width(14); + std::cout << velocity.x << " "; + std::cout.width(14); + std::cout << velocity.y << " "; + std::cout.width(14); + std::cout << velocity.z << std::endl; + } + + if ((first_run && current == 0.0) || !first_run) { + if (current == end) { + running = false; + } else if (current + inc > end) { + current = end; + } else { + current += inc; + } + } + first_run = false; + } +} + +void tokenize(const std::string &str, std::vector &tokens) { + const std::string& delimiters = " "; + + /* + * skip delimiters at beginning + */ + std::string::size_type last_pos = str.find_first_not_of(delimiters, 0); + + /* + * find first non-delimiter + */ + std::string::size_type pos = str.find_first_of(delimiters, last_pos); + + while (std::string::npos != pos || std::string::npos != last_pos) { + /* + * add found token to vector + */ + tokens.push_back(str.substr(last_pos, pos - last_pos)); + /* + * skip delimiters + */ + last_pos = str.find_first_not_of(delimiters, pos); + /* + * find next non-delimiter + */ + pos = str.find_first_of(delimiters, last_pos); + } +} + +void RunTest(const char *infile) { + std::ifstream file; + + file.open(infile); + + if (!file.is_open()) { + std::cerr << "Error opening file" << std::endl; + return; + } + + bool got_first_line = false; + std::string line1; + std::string line2; + std::string parameters; + + while (!file.eof()) { + std::string line; + std::getline(file, line); + + Util::Trim(line); + + /* + * skip blank lines or lines starting with # + */ + if (line.length() == 0 || line[0] == '#') { + got_first_line = false; + continue; + } + + /* + * find first line + */ + if (!got_first_line) { + try { + if (line.length() >= Tle::LineLength()) { + //Tle::IsValidLine(line.substr(0, Tle::LineLength()), 1); + /* + * store line and now read in second line + */ + got_first_line = true; + line1 = line; + } + } + catch (TleException& e) { + std::cerr << "Error: " << e.what() << std::endl; + std::cerr << line << std::endl; + } + } else { + /* + * no second chances, second line should follow the first + */ + got_first_line = false; + /* + * split line, first 69 is the second line of the tle + * the rest is the test parameters, if there is any + */ + line2 = line.substr(0, Tle::LineLength()); + double start = 0.0; + double end = 1440.0; + double inc = 120.0; + if (line.length() > 69) { + std::vector tokens; + parameters = line.substr(Tle::LineLength() + 1, + line.length() - Tle::LineLength()); + tokenize(parameters, tokens); + if (tokens.size() >= 3) { + start = atof(tokens[0].c_str()); + end = atof(tokens[1].c_str()); + inc = atof(tokens[2].c_str()); + } + } + + /* + * following line must be the second line + */ + try { + if (line.length() >= Tle::LineLength()) { + //Tle::IsValidLine(line.substr(0, Tle::LineLength()), 2); + Tle tle("Test", line1, line2); + RunTle(tle, start, end, inc); + } + } catch (TleException& e) { + std::cerr << "Error: " << e.what() << std::endl; + std::cerr << line << std::endl; + } + } + } + + file.close(); +} + +int main(int argc, char **argv) { + if (argc < 2) { + std::cerr << "Need at least one argument\n"; + return 1; + } + + RunTest(argv[1]); + return 0; +} diff --git a/recipes/libsgp4/all/test_v1_package/CMakeLists.txt b/recipes/libsgp4/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsgp4/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsgp4/all/test_v1_package/conanfile.py b/recipes/libsgp4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2b79c5abc2774 --- /dev/null +++ b/recipes/libsgp4/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + tle_name = os.path.join(self.source_folder, os.pardir, "test_package", "SGP4-VER.TLE") + self.run(f"{bin_path} {tle_name}", run_environment=True) diff --git a/recipes/libsgp4/config.yml b/recipes/libsgp4/config.yml new file mode 100644 index 0000000000000..72af20020d59f --- /dev/null +++ b/recipes/libsgp4/config.yml @@ -0,0 +1,3 @@ +versions: + "20191207": + folder: all diff --git a/recipes/libsigcpp/2.x.x/conandata.yml b/recipes/libsigcpp/2.x.x/conandata.yml new file mode 100644 index 0000000000000..604636a369d17 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.10.8": + url: "https://ftp2.nluug.nl/windowing/gnome/sources/libsigc++/2.10/libsigc++-2.10.8.tar.xz" + sha256: "235a40bec7346c7b82b6a8caae0456353dc06e71f14bc414bcc858af1838719a" diff --git a/recipes/libsigcpp/2.x.x/conanfile.py b/recipes/libsigcpp/2.x.x/conanfile.py new file mode 100644 index 0000000000000..9cb40725e278e --- /dev/null +++ b/recipes/libsigcpp/2.x.x/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rename, replace_in_file, rm, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import glob +import os + +required_conan_version = ">=1.53.0" + + +class LibSigCppConan(ConanFile): + name = "libsigcpp" + homepage = "https://github.com/libsigcplusplus/libsigcplusplus" + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-3.0-only" + description = "libsigc++ implements a typesafe callback system for standard C++." + topics = ("callback") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def build_requirements(self): + self.tool_requires("meson/0.64.1") + + 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() + tc = MesonToolchain(self) + tc.project_options["build-examples"] = "false" + tc.project_options["build-documentation"] = "false" + tc.generate() + + def _patch_sources(self): + if not self.options.shared: + replace_in_file( + self, os.path.join(self.source_folder, "sigc++config.h.meson"), + "define SIGC_DLL 1", "undef SIGC_DLL", + ) + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + for header_file in glob.glob(os.path.join(self.package_folder, "lib", "sigc++-2.0", "include", "*.h")): + dst = os.path.join(self.package_folder, "include", "sigc++-2.0", os.path.basename(header_file)) + rename(self, header_file, dst) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "sigc++-2.0")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "sigc++-2.0") + self.cpp_info.includedirs.append(os.path.join("include", "sigc++-2.0")) + self.cpp_info.libs = ["sigc-2.0"] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib""" + from conan.tools.files import rename + from conan.tools.microsoft import is_msvc + import glob + import os + if not is_msvc(conanfile): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt b/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0fb07d5ca03ae --- /dev/null +++ b/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_search_module(SIGCPP IMPORTED_TARGET REQUIRED sigc++-2.0) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::SIGCPP) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libsigcpp/2.x.x/test_package/conanfile.py b/recipes/libsigcpp/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..d5daeb4ad5467 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/test_package/conanfile.py @@ -0,0 +1,37 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import Environment +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "PkgConfigDeps", "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 not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def generate(self): + # TODO: to remove once conan 1.55.0 deployed in c3i (see https://github.com/conan-io/conan/pull/12513) + env = Environment() + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuild_pkg_config_path") + + 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/libsigcpp/2.x.x/test_package/test_package.cpp b/recipes/libsigcpp/2.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..ba99b27431500 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/test_package/test_package.cpp @@ -0,0 +1,24 @@ +/* Copyright 2003 - 2016, The libsigc++ Development Team + * + * Assigned to the public domain. Use as you wish without + * restriction. + */ + +#include +#include + +#include +// make sure that sigc++config.h can be included +#include + +void on_print(const std::string &str) { std::cout << str; } + +int main() { + sigc::signal signal_print; + + signal_print.connect(sigc::ptr_fun(&on_print)); + + signal_print.emit("hello world\n"); + + return 0; +} diff --git a/recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt b/recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py b/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/libsigcpp/3.x.x/conandata.yml b/recipes/libsigcpp/3.x.x/conandata.yml new file mode 100644 index 0000000000000..ca82ebd4ecc93 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/conandata.yml @@ -0,0 +1,12 @@ +sources: + "3.0.7": + url: "https://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.0/libsigc++-3.0.7.tar.xz" + sha256: "bfbe91c0d094ea6bbc6cbd3909b7d98c6561eea8b6d9c0c25add906a6e83d733" + "3.0.0": + url: "https://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.0/libsigc++-3.0.0.tar.xz" + sha256: "50a0855c1eb26e6044ffe888dbe061938ab4241f96d8f3754ea7ead38ab8ed06" +patches: + "3.0.7": + - patch_file: "patches/3.0.7-0001-libsigcpp.patch" + "3.0.0": + - patch_file: "patches/3.0.0-0001-libsigcpp.patch" diff --git a/recipes/libsigcpp/3.x.x/conanfile.py b/recipes/libsigcpp/3.x.x/conanfile.py new file mode 100644 index 0000000000000..7f5cc01dd330a --- /dev/null +++ b/recipes/libsigcpp/3.x.x/conanfile.py @@ -0,0 +1,147 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, + rename, replace_in_file, rmdir, save +) +import glob +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class LibSigCppConan(ConanFile): + name = "libsigcpp" + homepage = "https://github.com/libsigcplusplus/libsigcplusplus" + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-3.0-only" + description = "libsigc++ implements a typesafe callback system for standard C++." + topics = ("callback") + + 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 _minimum_compilers_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "sigc++config.h.cmake"), + "define SIGC_DLL 1", "undef SIGC_DLL") + + def build(self): + self._patch_sources() + 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() + for header_file in glob.glob(os.path.join(self.package_folder, "lib", "sigc++-3.0", "include", "*.h")): + dst = os.path.join(self.package_folder, "include", "sigc++-3.0", os.path.basename(header_file)) + rename(self, header_file, dst) + for dir_to_remove in ["cmake", "pkgconfig", "sigc++-3.0"]: + rmdir(self, os.path.join(self.package_folder, "lib", dir_to_remove)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"sigc-3.0": "sigc++-3::sigc-3.0"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sigc++-3") + self.cpp_info.set_property("cmake_target_name", "sigc-3.0") + self.cpp_info.set_property("pkg_config_name", "sigc++-3.0") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["sigc++"].includedirs = [os.path.join("include", "sigc++-3.0")] + self.cpp_info.components["sigc++"].libs = collect_libs(self) + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["sigc++"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "sigc++-3" + self.cpp_info.names["cmake_find_package_multi"] = "sigc++-3" + self.cpp_info.components["sigc++"].names["cmake_find_package"] = "sigc-3.0" + self.cpp_info.components["sigc++"].names["cmake_find_package_multi"] = "sigc-3.0" + self.cpp_info.components["sigc++"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["sigc++"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["sigc++"].set_property("pkg_config_name", "sigc++-3.0") diff --git a/recipes/libsigcpp/3.x.x/patches/3.0.0-0001-libsigcpp.patch b/recipes/libsigcpp/3.x.x/patches/3.0.0-0001-libsigcpp.patch new file mode 100644 index 0000000000000..938d5b0c7ab4b --- /dev/null +++ b/recipes/libsigcpp/3.x.x/patches/3.0.0-0001-libsigcpp.patch @@ -0,0 +1,31 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -71,8 +71,6 @@ + + + add_subdirectory (sigc++) +-add_subdirectory (examples) +-add_subdirectory (tests) + + + set (PROJECT_CMAKE_NAME "${PROJECT_NAME}-3") +--- sigc++/CMakeLists.txt ++++ sigc++/CMakeLists.txt +@@ -23,7 +23,7 @@ + + set (SIGCPP_LIB_NAME sigc-${SIGCXX_API_VERSION}) + +-add_library(${SIGCPP_LIB_NAME} SHARED ${SOURCE_FILES}) ++add_library(${SIGCPP_LIB_NAME} ${SOURCE_FILES}) + + set_property (TARGET ${SIGCPP_LIB_NAME} PROPERTY VERSION ${PACKAGE_VERSION}) + set_property(TARGET ${SIGCPP_LIB_NAME} PROPERTY SOVERSION ${LIBSIGCPP_SOVERSION}) +@@ -42,6 +42,8 @@ + install ( + TARGETS ${SIGCPP_LIB_NAME} + EXPORT "${PROJECT_CMAKE_NAME}Targets" ++ ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" ++ RUNTIME DESTINATION "bin" + INCLUDES DESTINATION "${INCLUDE_INSTALL_DIR}" + ) diff --git a/recipes/libsigcpp/3.x.x/patches/3.0.7-0001-libsigcpp.patch b/recipes/libsigcpp/3.x.x/patches/3.0.7-0001-libsigcpp.patch new file mode 100644 index 0000000000000..a0455859fec29 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/patches/3.0.7-0001-libsigcpp.patch @@ -0,0 +1,31 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -89,8 +89,6 @@ + + + add_subdirectory (sigc++) +-add_subdirectory (examples) +-add_subdirectory (tests) + + + set (PROJECT_CMAKE_NAME "${PROJECT_NAME}-3") +--- sigc++/CMakeLists.txt ++++ sigc++/CMakeLists.txt +@@ -23,7 +23,7 @@ + + set (SIGCPP_LIB_NAME sigc-${SIGCXX_API_VERSION}) + +-add_library(${SIGCPP_LIB_NAME} SHARED ${SOURCE_FILES}) ++add_library(${SIGCPP_LIB_NAME} ${SOURCE_FILES}) + + set_property (TARGET ${SIGCPP_LIB_NAME} PROPERTY VERSION ${PACKAGE_VERSION}) + set_property(TARGET ${SIGCPP_LIB_NAME} PROPERTY SOVERSION ${LIBSIGCPP_SOVERSION}) +@@ -42,6 +42,8 @@ + install ( + TARGETS ${SIGCPP_LIB_NAME} + EXPORT "${PROJECT_CMAKE_NAME}Targets" ++ ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" ++ RUNTIME DESTINATION "bin" + INCLUDES DESTINATION "${INCLUDE_INSTALL_DIR}" + ) diff --git a/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt b/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3c0d6af8191fb --- /dev/null +++ b/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sigc++-3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sigc-3.0) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libsigcpp/3.x.x/test_package/conanfile.py b/recipes/libsigcpp/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/libsigcpp/3.x.x/test_package/test_package.cpp b/recipes/libsigcpp/3.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..35eff123b07bf --- /dev/null +++ b/recipes/libsigcpp/3.x.x/test_package/test_package.cpp @@ -0,0 +1,26 @@ +/* Copyright 2003 - 2016, The libsigc++ Development Team + * + * Assigned to the public domain. Use as you wish without + * restriction. + */ + +#include +#include + +#include + +void on_print(const std::string& str) +{ + std::cout << str; +} + +int main() +{ + sigc::signal signal_print; + + signal_print.connect(sigc::ptr_fun(&on_print)); + + signal_print.emit("hello world\n"); + + return 0; +} diff --git a/recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt b/recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py b/recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsigcpp/config.yml b/recipes/libsigcpp/config.yml new file mode 100644 index 0000000000000..9590a7ad0b61a --- /dev/null +++ b/recipes/libsigcpp/config.yml @@ -0,0 +1,7 @@ +versions: + "3.0.7": + folder: "3.x.x" + "3.0.0": + folder: "3.x.x" + "2.10.8": + folder: "2.x.x" diff --git a/recipes/libsixel/all/conandata.yml b/recipes/libsixel/all/conandata.yml new file mode 100644 index 0000000000000..ba89a550dbc5e --- /dev/null +++ b/recipes/libsixel/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.10.3": + url: "https://github.com/libsixel/libsixel/archive/refs/tags/v1.10.3.tar.gz" + sha256: "028552eb8f2a37c6effda88ee5e8f6d87b5d9601182ddec784a9728865f821e0" diff --git a/recipes/libsixel/all/conanfile.py b/recipes/libsixel/all/conanfile.py new file mode 100644 index 0000000000000..8748a8a951d30 --- /dev/null +++ b/recipes/libsixel/all/conanfile.py @@ -0,0 +1,106 @@ +import os +import functools +from conans import ConanFile, Meson, tools +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.33.0" + +class LibSixelConan(ConanFile): + name = "libsixel" + description = "A SIXEL encoder/decoder implementation derived from kmiya's sixel (https://github.com/saitoha/sixel)." + topics = ("sixel") + license = "MIT" + homepage = "https://github.com/libsixel/libsixel" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_curl": [True, False], + "with_gdk_pixbuf2": [True, False], + "with_gd": [True, False], + "with_jpeg": [True, False], + "with_png": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_curl": True, + "with_gd": False, + "with_gdk_pixbuf2": False, + "with_jpeg": True, + "with_png": True, + } + generators = "cmake", "pkg_config" + + @property + def _source_subfolder(self): + return "source_subfolder" + + 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 + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + if is_msvc(self): + raise ConanInvalidConfiguration("{}/{} does not support Visual Studio".format(self.name, self.version)) + + def build_requirements(self): + self.build_requires("meson/0.62.2") + self.build_requires("pkgconf/1.7.4") + + def requirements(self): + if self.options.with_curl: + self.requires("libcurl/7.83.1") + if self.options.with_gd: + self.requires("libgd/2.3.2") + if self.options.with_gdk_pixbuf2: + self.requires("gdk-pixbuf/2.42.6") + if self.options.with_jpeg: + self.requires("libjpeg/9d") + if self.options.with_png: + self.requires("libpng/1.6.37") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_meson(self): + meson = Meson(self) + defs = { + "libcurl": "enabled" if self.options.with_curl else "disabled", + "gd": "enabled" if self.options.with_gd else "disabled", + "gdk-pixbuf2": "enabled" if self.options.with_gdk_pixbuf2 else "disabled", + "img2sixel": "disabled", + "sixel2png": "disabled", + "python2": "disabled", + } + meson.configure( + defs=defs, + source_folder=self._source_subfolder, + ) + return meson + + def build(self): + meson = self._configure_meson() + meson.build() + + def package(self): + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + meson.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["sixel"] diff --git a/recipes/libsixel/all/test_package/CMakeLists.txt b/recipes/libsixel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..199ae95ae65fc --- /dev/null +++ b/recipes/libsixel/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libsixel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c) +target_link_libraries(${PROJECT_NAME} libsixel::libsixel) diff --git a/recipes/libsixel/all/test_package/conanfile.py b/recipes/libsixel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e556cc050d509 --- /dev/null +++ b/recipes/libsixel/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsixel/all/test_package/test_package.c b/recipes/libsixel/all/test_package/test_package.c new file mode 100644 index 0000000000000..bb8f32fc3cf31 --- /dev/null +++ b/recipes/libsixel/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include + +static int sixel_write(char *data, int size, void *priv) +{ + return fwrite(data, 1, size, (FILE *)priv); +} + +int main() { + SIXELSTATUS status = SIXEL_FALSE; + sixel_output_t *output = NULL; + + status = sixel_output_new(&output, sixel_write, stdout, NULL); + if (SIXEL_FAILED(status)) + return 1; + + return 0; +} + diff --git a/recipes/libsixel/config.yml b/recipes/libsixel/config.yml new file mode 100644 index 0000000000000..89d055dd00604 --- /dev/null +++ b/recipes/libsixel/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "1.10.3": + folder: all diff --git a/recipes/libslz/all/CMakeLists.txt b/recipes/libslz/all/CMakeLists.txt new file mode 100644 index 0000000000000..3086b45fa1be2 --- /dev/null +++ b/recipes/libslz/all/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.8) +project(slz LANGUAGES C) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +include(GNUInstallDirs) + +add_library(slz source_subfolder/src/slz.c) +include_directories(source_subfolder/src) +set_target_properties(slz PROPERTIES + PUBLIC_HEADER source_subfolder/src/slz.h + WINDOWS_EXPORT_ALL_SYMBOLS ON + C_STANDARD 11 + C_EXTENSIONS ON +) + +install( + TARGETS slz + 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/libslz/all/conandata.yml b/recipes/libslz/all/conandata.yml new file mode 100644 index 0000000000000..8f01e85db189d --- /dev/null +++ b/recipes/libslz/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.2.1": + url: "https://github.com/wtarreau/libslz/archive/v1.2.1.tar.gz" + sha256: "c1fa88556e97541a550e59fd1f0fc8f6b4c02444b14c13eb553c9827123122c5" + "1.2.0": + url: "https://github.com/wtarreau/libslz/archive/refs/tags/v1.2.0.tar.gz" + sha256: "723a8ef648ac5b30e5074c013ff61a5e5f54a5aafc9496f7dab9f6b02030bf24" diff --git a/recipes/libslz/all/conanfile.py b/recipes/libslz/all/conanfile.py new file mode 100644 index 0000000000000..b33407244e1eb --- /dev/null +++ b/recipes/libslz/all/conanfile.py @@ -0,0 +1,67 @@ +import functools +from conans import ConanFile, CMake, tools +from conans.tools import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.43.0" + +class LibslzConan(ConanFile): + name = "libslz" + description = "Simple, modern libpng alternative " + topics = ("zlib", "compression",) + license = "X11" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.libslz.org/" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("{}/{} does not support Visual Studio.".format(self.name, self.version)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["slz"] diff --git a/recipes/libslz/all/test_package/CMakeLists.txt b/recipes/libslz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..13e3af8ad2791 --- /dev/null +++ b/recipes/libslz/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libslz REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libslz::libslz) +set_target_properties(${PROJECT_NAME} PROPERTIES + C_STANDARD 11 + C_EXTENSIONS ON +) diff --git a/recipes/libslz/all/test_package/conanfile.py b/recipes/libslz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libslz/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libslz/all/test_package/test_package.c b/recipes/libslz/all/test_package/test_package.c new file mode 100644 index 0000000000000..afb3084384c50 --- /dev/null +++ b/recipes/libslz/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include +#include +#include + +#include "slz.h" + +int main(void) { + struct slz_stream strm; + unsigned char *outbuf; + + slz_make_crc_table(); + slz_prepare_dist_table(); + + slz_init(&strm, 3, SLZ_FMT_GZIP); + + outbuf = calloc(1, 1024 * 1024 * 2 + 4096); + + slz_finish(&strm, outbuf); + + return 0; +} diff --git a/recipes/libslz/config.yml b/recipes/libslz/config.yml new file mode 100644 index 0000000000000..9f174d514c33f --- /dev/null +++ b/recipes/libslz/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.1": + folder: all + "1.2.0": + folder: all diff --git a/recipes/libsmacker/all/conandata.yml b/recipes/libsmacker/all/conandata.yml new file mode 100644 index 0000000000000..5b45f961f0cf1 --- /dev/null +++ b/recipes/libsmacker/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.1r35": + url: "https://sourceforge.net/projects/libsmacker/files/libsmacker-1.1/libsmacker-1.1.1r35.tar.gz" + sha256: "bb9c22c02ecda189a3389c9340a0eb6a8f287aa257099b54c3d9e1802a454630" +patches: + "1.1.1r35": + - patch_file: "patches/0001-install-header.patch" diff --git a/recipes/libsmacker/all/conanfile.py b/recipes/libsmacker/all/conanfile.py new file mode 100644 index 0000000000000..a26d4116c39b3 --- /dev/null +++ b/recipes/libsmacker/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc +import os + +required_conan_version = ">=1.57.0" + + +class LibsmackerConan(ConanFile): + name = "libsmacker" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://libsmacker.sourceforge.net" + topics = ("decoding ", "smk", "smacker", "video", "file") + license = "LGPL-2.1-or-later" + description = "A C library for decoding .smk Smacker Video files" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "smacker.dll.lib"), + os.path.join(self.package_folder, "lib", "smacker.lib")) + + def package_info(self): + self.cpp_info.libs = ["smacker"] diff --git a/recipes/libsmacker/all/patches/0001-install-header.patch b/recipes/libsmacker/all/patches/0001-install-header.patch new file mode 100644 index 0000000000000..fea46f478c61b --- /dev/null +++ b/recipes/libsmacker/all/patches/0001-install-header.patch @@ -0,0 +1,11 @@ +--- Makefile.am ++++ Makefile.am +@@ -7,1 +7,1 @@ +-libsmacker_la_LDFLAGS = -version-info 1:1:1 ++libsmacker_la_LDFLAGS = -version-info 1:1:1 -no-undefined +@@ -15,3 +15,5 @@ + smk2avi_SOURCES = smk2avi.c + smk2avi_LDADD = $(lib_LTLIBRARIES) + smk2avi_DEPENDENCIES = $(lib_LTLIBRARIES) ++ ++include_HEADERS = smacker.h diff --git a/recipes/libsmacker/all/test_package/CMakeLists.txt b/recipes/libsmacker/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..27003d64c4b5a --- /dev/null +++ b/recipes/libsmacker/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libsmacker REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libsmacker::libsmacker) diff --git a/recipes/libsmacker/all/test_package/conanfile.py b/recipes/libsmacker/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ca4f1763e0de3 --- /dev/null +++ b/recipes/libsmacker/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout + + +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): + # No free .smk file to test. + pass diff --git a/recipes/libsmacker/all/test_package/test_package.c b/recipes/libsmacker/all/test_package/test_package.c new file mode 100644 index 0000000000000..2603295863039 --- /dev/null +++ b/recipes/libsmacker/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "smacker.h" + +#include + +int main(int argc, char *argv[]) { + if (argc < 2) { + printf("Need an argument\n"); + return 1; + } + smk obj = smk_open_file(argv[1], 'r'); + if (obj == NULL) { + printf("Failed to open smk\n"); + return 1; + } + smk_close(obj); + return 0; +} diff --git a/recipes/libsmacker/all/test_v1_package/CMakeLists.txt b/recipes/libsmacker/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsmacker/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsmacker/all/test_v1_package/conanfile.py b/recipes/libsmacker/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3c3f444e8cad9 --- /dev/null +++ b/recipes/libsmacker/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, CMake + + +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): + # No free .smk file to test. + pass diff --git a/recipes/libsmacker/config.yml b/recipes/libsmacker/config.yml new file mode 100644 index 0000000000000..96757b69af184 --- /dev/null +++ b/recipes/libsmacker/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1r35": + folder: all diff --git a/recipes/libsndfile/all/conandata.yml b/recipes/libsndfile/all/conandata.yml new file mode 100644 index 0000000000000..77ba2985f3b59 --- /dev/null +++ b/recipes/libsndfile/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "1.2.0": + url: "https://github.com/libsndfile/libsndfile/releases/download/1.2.0/libsndfile-1.2.0.tar.xz" + sha256: "0e30e7072f83dc84863e2e55f299175c7e04a5902ae79cfb99d4249ee8f6d60a" + "1.0.31": + url: "https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2" + sha256: "a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163" + "1.0.30": + url: "https://github.com/libsndfile/libsndfile/releases/download/v1.0.30/libsndfile-1.0.30.tar.bz2" + sha256: "9df273302c4fa160567f412e10cc4f76666b66281e7ba48370fb544e87e4611a" + "1.0.29": + url: "https://github.com/libsndfile/libsndfile/releases/download/v1.0.29/libsndfile-1.0.29.tar.bz2" + sha256: "2ba20d44817c8176f097ab25eff44ef0aeec9e00973def5a7174c5ae0764b22f" +patches: + "1.2.0": + - patch_file: "patches/1.0.31-0001-fix-msvc-runtime-logic.patch" + patch_description: "always set CMP0091" + patch_type: "portability" + "1.0.31": + - patch_file: "patches/1.0.31-0001-fix-msvc-runtime-logic.patch" + patch_description: "always set CMP0091" + patch_type: "portability" + "1.0.30": + - patch_file: "patches/1.0.30-0001-disable-static-libgcc-mingw.patch" + patch_description: "disable link libgcc statically on MINGW" + patch_type: "portability" diff --git a/recipes/libsndfile/all/conanfile.py b/recipes/libsndfile/all/conanfile.py new file mode 100644 index 0000000000000..ef6e2406db761 --- /dev/null +++ b/recipes/libsndfile/all/conanfile.py @@ -0,0 +1,145 @@ +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.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LibsndfileConan(ConanFile): + name = "libsndfile" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.mega-nerd.com/libsndfile" + description = ( + "Libsndfile is a library of C routines for reading and writing files " + "containing sampled audio data." + ) + topics = ("audio",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "programs": [True, False], + "experimental": [True, False], + "with_alsa": [True, False], + "with_external_libs": [True, False], + "with_mpeg": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "programs": True, + "experimental": False, + "with_alsa": False, + "with_external_libs": True, + "with_mpeg": 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_alsa + if Version(self.version) < "1.1.0": + del self.options.with_mpeg + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_alsa"): + self.requires("libalsa/1.2.7.2") + if self.options.with_external_libs: + self.requires("ogg/1.3.5") + self.requires("vorbis/1.3.7") + self.requires("flac/1.4.2") + self.requires("opus/1.3.1") + if self.options.get_safe("with_mpeg", False): + self.requires("mpg123/1.31.2") + self.requires("libmp3lame/3.100") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Sndio"] = True # FIXME: missing sndio cci recipe (check whether it is really required) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Speex"] = True # FIXME: missing sndio cci recipe (check whether it is really required) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_SQLite3"] = True # only used for regtest + tc.variables["ENABLE_EXTERNAL_LIBS"] = self.options.with_external_libs + if not self.options.with_external_libs: + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Ogg"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Vorbis"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_FLAC"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Opus"] = True + if not self.options.get_safe("with_alsa", False): + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ALSA"] = True + tc.variables["BUILD_PROGRAMS"] = self.options.programs + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["ENABLE_CPACK"] = False + tc.variables["ENABLE_EXPERIMENTAL"] = self.options.experimental + if is_msvc(self) and Version(self.version) < "1.0.30": + tc.variables["ENABLE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.variables["BUILD_REGTEST"] = False + if Version(self.version) > "1.11.0": + tc.variables["ENABLE_MPEG"] = self.options.with_mpeg + # Fix iOS/tvOS/watchOS + tc.variables["CMAKE_MACOSX_BUNDLE"] = 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, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SndFile") + self.cpp_info.set_property("cmake_target_name", "SndFile::sndfile") + self.cpp_info.set_property("pkg_config_name", "sndfile") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["sndfile"].libs = ["sndfile"] + if self.options.with_external_libs: + self.cpp_info.components["sndfile"].requires.extend([ + "ogg::ogg", "vorbis::vorbismain", "vorbis::vorbisenc", + "flac::flac", "opus::opus", + ]) + if self.options.get_safe("with_mpeg", False): + self.cpp_info.components["sndfile"].requires.append("mpg123::mpg123") + self.cpp_info.components["sndfile"].requires.append("libmp3lame::libmp3lame") + if self.options.get_safe("with_alsa"): + self.cpp_info.components["sndfile"].requires.append("libalsa::libalsa") + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sndfile"].system_libs = ["m", "dl", "pthread", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.components["sndfile"].system_libs.append("winmm") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "SndFile" + self.cpp_info.names["cmake_find_package_multi"] = "SndFile" + self.cpp_info.components["sndfile"].set_property("cmake_target_name", "SndFile::sndfile") + if self.options.programs: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libsndfile/all/patches/1.0.30-0001-disable-static-libgcc-mingw.patch b/recipes/libsndfile/all/patches/1.0.30-0001-disable-static-libgcc-mingw.patch new file mode 100644 index 0000000000000..f7e1a5bf32674 --- /dev/null +++ b/recipes/libsndfile/all/patches/1.0.30-0001-disable-static-libgcc-mingw.patch @@ -0,0 +1,11 @@ +--- a/cmake/SndFileChecks.cmake ++++ b/cmake/SndFileChecks.cmake +@@ -213,7 +213,7 @@ if (MSVC) + add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) + endif (MSVC) + +-if (MINGW) ++if (FALSE) + if (CMAKE_C_COMPILER_ID STREQUAL GNU) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s") diff --git a/recipes/libsndfile/all/patches/1.0.31-0001-fix-msvc-runtime-logic.patch b/recipes/libsndfile/all/patches/1.0.31-0001-fix-msvc-runtime-logic.patch new file mode 100644 index 0000000000000..abada26c071ce --- /dev/null +++ b/recipes/libsndfile/all/patches/1.0.31-0001-fix-msvc-runtime-logic.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,7 +8,7 @@ if (POLICY CMP0091) + return () + endif () + +- if (DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) ++ if (1) + cmake_policy (SET CMP0091 NEW) + else () + cmake_policy (SET CMP0091 OLD) diff --git a/recipes/libsndfile/all/test_package/CMakeLists.txt b/recipes/libsndfile/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3fb4ef12f8bc8 --- /dev/null +++ b/recipes/libsndfile/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(SndFile REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SndFile::sndfile) diff --git a/recipes/libsndfile/all/test_package/conanfile.py b/recipes/libsndfile/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libsndfile/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/libsndfile/all/test_package/test_package.cpp b/recipes/libsndfile/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2f577c46055c5 --- /dev/null +++ b/recipes/libsndfile/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "sndfile.hh" + +#if __cplusplus < 201100 && defined(_MSC_VER) +#undef nullptr +#endif + +#include + +int main(int argc, char *argv[]) { + if (argc < 2) { + std::cout << "Usage: example \n"; + } else { + SndfileHandle handle(argv[1]); + std::cout << "Sample rate: " << handle.samplerate() << "\n"; + } + return 0; +} diff --git a/recipes/libsndfile/all/test_v1_package/CMakeLists.txt b/recipes/libsndfile/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libsndfile/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libsndfile/all/test_v1_package/conanfile.py b/recipes/libsndfile/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsndfile/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/libsndfile/config.yml b/recipes/libsndfile/config.yml new file mode 100644 index 0000000000000..2248a847a68f0 --- /dev/null +++ b/recipes/libsndfile/config.yml @@ -0,0 +1,9 @@ +versions: + "1.2.0": + folder: "all" + "1.0.31": + folder: "all" + "1.0.30": + folder: "all" + "1.0.29": + folder: "all" diff --git a/recipes/libsodium/all/conandata.yml b/recipes/libsodium/all/conandata.yml new file mode 100644 index 0000000000000..d0974216f8865 --- /dev/null +++ b/recipes/libsodium/all/conandata.yml @@ -0,0 +1,18 @@ +# To update the version on CCI, add a new cci.date entry from the stable branch: +# https://github.com/jedisct1/libsodium/commits/stable +sources: + "1.0.18": + url: "https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz" + sha256: "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1" + "cci.20220430": + url: "https://github.com/jedisct1/libsodium/archive/78b6f57493a02a70fca44e5ef3f9d7d1cae9029f.tar.gz" + sha256: "5274b09894c0a7d6676325277cb2e278f45e1e5e077bae4bd8778aba4d6d40da" +patches: + "1.0.18": + - patch_file: "patches/0001-1.0.18-msvc_props.patch" + patch_type: "portability" + patch_description: "Switch MSVC to use PDB" + "cci.20220430": + - patch_file: "patches/0001-1.0.18-msvc_props.patch" + patch_type: "portability" + patch_description: "Switch MSVC to use PDB" diff --git a/recipes/libsodium/all/conanfile.py b/recipes/libsodium/all/conanfile.py new file mode 100644 index 0000000000000..f895ac1f52b3c --- /dev/null +++ b/recipes/libsodium/all/conanfile.py @@ -0,0 +1,189 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuild, MSBuildToolchain +import os + +required_conan_version = ">=1.54.0" + + +class LibsodiumConan(ConanFile): + name = "libsodium" + description = "A modern and easy-to-use crypto library." + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://doc.libsodium.org/" + topics = "encryption", "signature", "hashing" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_soname": [True, False], + "PIE": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_soname": True, + "PIE": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Cannot build shared libsodium libraries with static runtime") + + def build_requirements(self): + if not is_msvc(self): + if self._is_mingw: + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = "{}{}".format( + "Debug" if self.settings.build_type == "Debug" else "Release", + "DLL" if self.options.shared else "LIB", + ) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.append("--enable-soname-versions={}".format(yes_no(self.options.use_soname))) + tc.configure_args.append("--enable-pie={}".format(yes_no(self.options.PIE))) + if self._is_mingw: + tc.extra_ldflags.append("-lssp") + if self.settings.os == "Emscripten": + # FIXME: this is an old comment/test, has not been re-tested with conan2 upgrade + self.output.warn("os=Emscripten is not tested/supported by this recipe") + # FIXME: ./dist-build/emscripten.sh does not respect options of this recipe + tc.generate() + + @property + def _msvc_sln_folder(self): + sln_folders = { + "Visual Studio": { + "10": "vs2010", + "11": "vs2012", + "12": "vs2013", + "14": "vs2015", + "15": "vs2017", + "16": "vs2019", + }, + "msvc": { + "170": "vs2012", + "180": "vs2013", + "190": "vs2015", + "191": "vs2017", + "192": "vs2019", + }, + } + default_folder = "vs2019" + if self.version != "1.0.18": + sln_folders["Visual Studio"]["17"] = "vs2022" + sln_folders["msvc"]["193"] = "vs2022" + default_folder = "vs2022" + + return sln_folders.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version), default_folder) + + def _build_msvc(self): + msvc_sln_folder = os.path.join(self.source_folder, "builds", "msvc", self._msvc_sln_folder) + + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + if self.version == "1.0.18" and self._msvc_sln_folder == "vs2019": + toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj"), + "v142", + f"{toolset}", + ) + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj"), + "", + f"", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = "{}{}".format( + "Dyn" if self.options.shared else "Static", + "Debug" if self.settings.build_type == "Debug" else "Release", + ) + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(msvc_sln_folder, "libsodium.sln")) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + if self._is_mingw: + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + output_dir = os.path.join(self.source_folder, "bin") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + inc_src = os.path.join(self.source_folder, "src", "libsodium", "include") + copy(self, "*.h", src=inc_src, dst=os.path.join(self.package_folder, "include"), excludes=("*/private/*")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libsodium") + self.cpp_info.libs = ["{}sodium".format("lib" if is_msvc(self) else "")] + if not self.options.shared: + self.cpp_info.defines = ["SODIUM_STATIC"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("pthread") + if self._is_mingw: + self.cpp_info.system_libs.append("ssp") diff --git a/recipes/libsodium/all/patches/0001-1.0.18-msvc_props.patch b/recipes/libsodium/all/patches/0001-1.0.18-msvc_props.patch new file mode 100644 index 0000000000000..9475c86381aeb --- /dev/null +++ b/recipes/libsodium/all/patches/0001-1.0.18-msvc_props.patch @@ -0,0 +1,38 @@ +diff --git a/builds/msvc/properties/DebugLIB.props b/builds/msvc/properties/DebugLIB.props +index c5f10128..86eb0449 100644 +--- a/builds/msvc/properties/DebugLIB.props ++++ b/builds/msvc/properties/DebugLIB.props +@@ -12,10 +12,10 @@ + + + +- OldStyle ++ ProgramDatabase + MultiThreadedDebug + true + + + +- +\ No newline at end of file ++ +diff --git a/builds/msvc/properties/Release.props b/builds/msvc/properties/Release.props +index 1c5415bc..1f754ca5 100644 +--- a/builds/msvc/properties/Release.props ++++ b/builds/msvc/properties/Release.props +@@ -14,7 +14,7 @@ + + + /Oy- %(AdditionalOptions) +- ++ ProgramDatabase + true + true + OnlyExplicitInline +@@ -38,4 +38,4 @@ + + + +- +\ No newline at end of file ++ diff --git a/recipes/libsodium/all/test_package/CMakeLists.txt b/recipes/libsodium/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ffb72d743454e --- /dev/null +++ b/recipes/libsodium/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libsodium REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libsodium::libsodium) diff --git a/recipes/libsodium/all/test_package/conanfile.py b/recipes/libsodium/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libsodium/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libsodium/all/test_package/test_package.c b/recipes/libsodium/all/test_package/test_package.c new file mode 100644 index 0000000000000..3db01e0a3bd07 --- /dev/null +++ b/recipes/libsodium/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +int main() { + printf("************* Testing libsodium ***************\n"); + if (sodium_init() == -1) { + printf("\tFAIL\n"); + return 1; + } + printf("\tOK\n"); + printf("***********************************************\n"); + return 0; +} diff --git a/recipes/libsodium/all/test_v1_package/CMakeLists.txt b/recipes/libsodium/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsodium/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsodium/all/test_v1_package/conanfile.py b/recipes/libsodium/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsodium/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsodium/config.yml b/recipes/libsodium/config.yml new file mode 100644 index 0000000000000..819e72ce10826 --- /dev/null +++ b/recipes/libsodium/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.18": + folder: all + "cci.20220430": + folder: all diff --git a/recipes/libsolace/all/conandata.yml b/recipes/libsolace/all/conandata.yml new file mode 100644 index 0000000000000..f0faad0897234 --- /dev/null +++ b/recipes/libsolace/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.3.6": + sha256: ea9847005d0a680264986ddab5b1c077b04b80f02a2529cc38e8191b64ea97c7 + url: https://github.com/abbyssoul/libsolace/archive/v0.3.6.zip + "0.3.7": + sha256: 7f9790f850a0d7209f95be03e1c58e67f91faeec2e12709893cf32e5f09aa6d0 + url: https://github.com/abbyssoul/libsolace/archive/v0.3.7.zip + "0.3.9": + sha256: 5a91cc000d0ef5c51fb58197a8e3ef003fa191926f4f2511b7e8940648f007ce + url: https://github.com/abbyssoul/libsolace/archive/v0.3.9.zip + diff --git a/recipes/libsolace/all/conanfile.py b/recipes/libsolace/all/conanfile.py new file mode 100644 index 0000000000000..ba37d1a345156 --- /dev/null +++ b/recipes/libsolace/all/conanfile.py @@ -0,0 +1,66 @@ +import os + +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +class LibsolaceConan(ConanFile): + name = "libsolace" + description = "High performance components for mission critical applications" + topics = ("HPC", "High reliability", "P10", "solace", "performance", "c++", "conan") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/abbyssoul/libsolace" + license = "Apache-2.0" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = {"shared": False, "fPIC": True} + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _supported_cppstd(self): + return ["17", "gnu17", "20", "gnu20"] + + def configure(self): + compiler_version = tools.Version(str(self.settings.compiler.version)) + + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("This library is not yet compatible with Windows") + # Exclude compilers that claims to support C++17 but do not in practice + if (self.settings.compiler == "gcc" and compiler_version < "7") or \ + (self.settings.compiler == "clang" and compiler_version < "5") or \ + (self.settings.compiler == "apple-clang" and compiler_version < "9"): + raise ConanInvalidConfiguration("This library requires C++17 or higher support standard. {} {} is not supported".format(self.settings.compiler, self.settings.compiler.version)) + if self.settings.compiler.cppstd and not self.settings.compiler.cppstd in self._supported_cppstd: + raise ConanInvalidConfiguration("This library requires c++17 standard or higher. {} required".format(self.settings.compiler.cppstd)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self, parallel=True) + cmake.definitions["PKG_CONFIG"] = "OFF" + cmake.definitions["SOLACE_GTEST_SUPPORT"] = "OFF" + cmake.configure(source_folder=self._source_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = ["solace"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") diff --git a/recipes/libsolace/all/test_package/CMakeLists.txt b/recipes/libsolace/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4b980e0e807c --- /dev/null +++ b/recipes/libsolace/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.3) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_CXX_STANDARD_REQUIRED on) + +add_executable(example example.cpp) + +# libsolace requires at least C++17 +set_target_properties(example PROPERTIES CXX_STANDARD 17) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/libsolace/all/test_package/conanfile.py b/recipes/libsolace/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ce9505669ad4f --- /dev/null +++ b/recipes/libsolace/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conans import ConanFile, CMake, tools + + +class SolaceTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + # Current dir is "test_package/build/" and CMakeLists.txt is + # in "test_package" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + with tools.chdir("bin"): + self.run(".%sexample" % os.sep, run_environment=True) diff --git a/recipes/libsolace/all/test_package/example.cpp b/recipes/libsolace/all/test_package/example.cpp new file mode 100644 index 0000000000000..8596b92cecc5a --- /dev/null +++ b/recipes/libsolace/all/test_package/example.cpp @@ -0,0 +1,7 @@ +#include "solace/version.hpp" + +int main() { + return Solace::getBuildVersion().build.empty() + ? 0 + : 1; +} diff --git a/recipes/libsolace/config.yml b/recipes/libsolace/config.yml new file mode 100644 index 0000000000000..e3af7d3426c10 --- /dev/null +++ b/recipes/libsolace/config.yml @@ -0,0 +1,7 @@ +versions: + 0.3.6: + folder: all + 0.3.7: + folder: all + 0.3.9: + folder: all diff --git a/recipes/libspatialindex/all/conandata.yml b/recipes/libspatialindex/all/conandata.yml new file mode 100644 index 0000000000000..86f7d30291378 --- /dev/null +++ b/recipes/libspatialindex/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.9.3": + url: "https://github.com/libspatialindex/libspatialindex/releases/download/1.9.3/spatialindex-src-1.9.3.tar.bz2" + sha256: "4a529431cfa80443ab4dcd45a4b25aebbabe1c0ce2fa1665039c80e999dcc50a" +patches: + "1.9.3": + - patch_file: "patches/0001-fix-static-and-mingw.patch" + - patch_file: "patches/0002-fix-capi.patch" + - patch_file: "patches/0003-macos-install-name.patch" diff --git a/recipes/libspatialindex/all/conanfile.py b/recipes/libspatialindex/all/conanfile.py new file mode 100644 index 0000000000000..f0e08820bfdc4 --- /dev/null +++ b/recipes/libspatialindex/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class LibspatialindexConan(ConanFile): + name = "libspatialindex" + description = "C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API." + license = "MIT" + topics = ("spatial-indexing", "tree") + homepage = "https://github.com/libspatialindex/libspatialindex" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SIDX_BUILD_TESTS"] = False + tc.variables["SIDX_BIN_SUBDIR"] = "bin" + tc.variables["SIDX_LIB_SUBDIR"] = "lib" + tc.variables["SIDX_INCLUDE_SUBDIR"] = "include" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libspatialindex") + self.cpp_info.set_property("pkg_config_name", "libspatialindex") + + suffix = self._get_lib_suffix() + + self.cpp_info.components["spatialindex"].set_property("cmake_target_name", "libspatialindex::spatialindex") + self.cpp_info.components["spatialindex"].libs = ["spatialindex" + suffix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spatialindex"].system_libs.append("m") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["spatialindex"].system_libs.append(libcxx) + + self.cpp_info.components["spatialindex_c"].set_property("cmake_target_name", "libspatialindex::spatialindex_c") + self.cpp_info.components["spatialindex_c"].libs = ["spatialindex_c" + suffix] + self.cpp_info.components["spatialindex_c"].requires = ["spatialindex"] + + if not self.options.shared and is_msvc(self): + self.cpp_info.components["spatialindex"].defines.append("SIDX_STATIC") + self.cpp_info.components["spatialindex_c"].defines.append("SIDX_STATIC") + + def _get_lib_suffix(self): + suffix = "" + if is_msvc(self): + libs = collect_libs(self) + for lib in libs: + if "spatialindex_c" in lib: + suffix = lib.split("spatialindex_c", 1)[1] + break + return suffix diff --git a/recipes/libspatialindex/all/patches/0001-fix-static-and-mingw.patch b/recipes/libspatialindex/all/patches/0001-fix-static-and-mingw.patch new file mode 100644 index 0000000000000..aaa8db6f98015 --- /dev/null +++ b/recipes/libspatialindex/all/patches/0001-fix-static-and-mingw.patch @@ -0,0 +1,92 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,6 @@ SET(SIDX_VERSION_MINOR "9") + SET(SIDX_VERSION_PATCH "3") + SET(SIDX_LIB_VERSION "6.1.1") + SET(SIDX_LIB_SOVERSION "6") +-SET(BUILD_SHARED_LIBS ON) + + + set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERSION_PATCH}") +@@ -52,6 +51,7 @@ set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERS + # libspatialindex general cmake options + #------------------------------------------------------------------------------ + ++option(BUILD_SHARED_LIBS "Build shared libraries" ON) + option(SIDX_BUILD_TESTS "Enables integrated test suites" OFF) + + +--- a/include/spatialindex/capi/sidx_export.h ++++ b/include/spatialindex/capi/sidx_export.h +@@ -29,16 +29,21 @@ + #pragma once + + #ifndef SIDX_C_DLL +-#if defined(_MSC_VER) +-# define SIDX_C_DLL __declspec(dllexport) +-# define SIDX_DLL __declspec(dllexport) ++#if (defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64) && !defined __GNUC__ ++ #ifndef SIDX_STATIC ++ #ifdef SIDX_DLL_EXPORT ++ #define SIDX_C_DLL __declspec(dllexport) ++ #define SIDX_DLL __declspec(dllexport) ++ #else ++ #define SIDX_C_DLL __declspec(dllimport) ++ #define SIDX_DLL __declspec(dllimport) ++ #endif ++ #else ++ #define SIDX_C_DLL ++ #define SIDX_DLL ++ #endif + #else +-# if defined(USE_GCC_VISIBILITY_FLAG) +-# define SIDX_C_DLL __attribute__ ((visibility("default"))) +-# define SIDX_DLL __attribute__ ((visibility("default"))) +-# else +-# define SIDX_C_DLL +-# define SIDX_DLL +-# endif ++ #define SIDX_C_DLL ++ #define SIDX_DLL + #endif + #endif +--- a/include/spatialindex/tools/Tools.h ++++ b/include/spatialindex/tools/Tools.h +@@ -43,10 +43,14 @@ + #endif + + #if (defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64) && !defined __GNUC__ +- #ifdef SIDX_DLL_EXPORT +- #define SIDX_DLL __declspec(dllexport) ++ #ifndef SIDX_STATIC ++ #ifdef SIDX_DLL_EXPORT ++ #define SIDX_DLL __declspec(dllexport) ++ #else ++ #define SIDX_DLL __declspec(dllimport) ++ #endif + #else +- #define SIDX_DLL __declspec(dllimport) ++ #define SIDX_DLL + #endif + + // Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -204,12 +204,16 @@ set_target_properties(${SIDX_C_LIB_NAME} + PROPERTIES VERSION "${SIDX_LIB_VERSION}" + SOVERSION "${SIDX_LIB_SOVERSION}" ) + +-if(WIN32) ++if(MSVC) + target_compile_options(${SIDX_LIB_NAME} PRIVATE "/wd4068") + target_compile_options(${SIDX_C_LIB_NAME} PRIVATE "/wd4068") + + target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1") + target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1") ++ if(NOT BUILD_SHARED_LIBS) ++ target_compile_definitions(${SIDX_C_LIB_NAME} PUBLIC "-DSIDX_STATIC") ++ target_compile_definitions(${SIDX_LIB_NAME} PUBLIC "-DSIDX_STATIC") ++ endif() + if (NOT WITH_STATIC_SIDX) + target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1") + target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1") diff --git a/recipes/libspatialindex/all/patches/0002-fix-capi.patch b/recipes/libspatialindex/all/patches/0002-fix-capi.patch new file mode 100644 index 0000000000000..77e8b98365a72 --- /dev/null +++ b/recipes/libspatialindex/all/patches/0002-fix-capi.patch @@ -0,0 +1,26 @@ +--- a/include/spatialindex/capi/sidx_api.h ++++ b/include/spatialindex/capi/sidx_api.h +@@ -33,6 +33,8 @@ + + #include "sidx_config.h" + ++#include ++ + IDX_C_START + + SIDX_DLL IndexH Index_Create(IndexPropertyH properties); +--- a/include/spatialindex/capi/sidx_config.h ++++ b/include/spatialindex/capi/sidx_config.h +@@ -42,10 +42,8 @@ + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; +-#endif +- +-#if _MSC_VER >= 1900 +- #include ++#else ++ #include + #endif + + #include diff --git a/recipes/libspatialindex/all/patches/0003-macos-install-name.patch b/recipes/libspatialindex/all/patches/0003-macos-install-name.patch new file mode 100644 index 0000000000000..ce6a3416ea278 --- /dev/null +++ b/recipes/libspatialindex/all/patches/0003-macos-install-name.patch @@ -0,0 +1,18 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -246,6 +246,7 @@ endif() + + + ++if(0) + if (APPLE) + set_target_properties( + ${SIDX_LIB_NAME} +@@ -257,6 +258,7 @@ if (APPLE) + PROPERTIES + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH OFF) + endif() ++endif() + + ############################################################################### + # Targets installation diff --git a/recipes/libspatialindex/all/test_package/CMakeLists.txt b/recipes/libspatialindex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..485d6719dfdb8 --- /dev/null +++ b/recipes/libspatialindex/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(libspatialindex REQUIRED CONFIG) + +add_executable(test_package_c test_package.c) +target_link_libraries(test_package_c PRIVATE libspatialindex::spatialindex_c) + +add_executable(test_package_cpp test_package.cpp) +target_link_libraries(test_package_cpp PRIVATE libspatialindex::spatialindex) +target_compile_features(test_package_cpp PRIVATE cxx_std_11) diff --git a/recipes/libspatialindex/all/test_package/conanfile.py b/recipes/libspatialindex/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8b97085429a57 --- /dev/null +++ b/recipes/libspatialindex/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") + bin_path_cpp = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path_cpp, env="conanrun") diff --git a/recipes/libspatialindex/all/test_package/test_package.c b/recipes/libspatialindex/all/test_package/test_package.c new file mode 100644 index 0000000000000..828e98c87fbad --- /dev/null +++ b/recipes/libspatialindex/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include + +#include + +int main() { + double min[] = {0.5, 0.5}; + double max[] = {0.5, 0.5}; + int nDims = 2; + int nId = 1; + + char pszData[5]; + + IndexPropertyH props = IndexProperty_Create(); + IndexProperty_SetIndexType(props, RT_RTree); + IndexProperty_SetIndexStorage(props, RT_Memory); + IndexH idx = Index_Create(props); + IndexProperty_Destroy(props); + Index_InsertData(idx, nId, min, max, nDims, (uint8_t *)pszData, strlen(pszData) + 1); + Index_Destroy(idx); + + return 0; +} diff --git a/recipes/libspatialindex/all/test_package/test_package.cpp b/recipes/libspatialindex/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..30f6204efeb97 --- /dev/null +++ b/recipes/libspatialindex/all/test_package/test_package.cpp @@ -0,0 +1,76 @@ +#include + +using namespace SpatialIndex; +using namespace std; + +/* + * Test the Geometry + * Nowhere near complete, but it's something + */ +int main(int, char**) { + //define points + double c1[2] = {1.0, 0.0}; + double c2[2] = {3.0, 2.0}; + double c3[2] = {2.0, 0.0}; + double c4[2] = {2.0, 4.0}; + double c5[2] = {1.0, 1.0}; + double c6[2] = {2.5, 3.0}; + double c7[2] = {1.0, 2.0}; + double c8[2] = {0.0, -1.0}; + double c9[2] = {4.0, 3.0}; + Point p1 = Point(&c1[0], 2); + Point p2 = Point(&c2[0], 2); + Point p3 = Point(&c3[0], 2); + Point p4 = Point(&c4[0], 2); + Point p5 = Point(&c5[0], 2); + Point p6 = Point(&c6[0], 2); + Point p7 = Point(&c7[0], 2); + Point p8 = Point(&c8[0], 2); + Point p9 = Point(&c9[0], 2); + + double c3a[2] = {2.0, 3.0}; + Point p3a = Point(&c3a[0], 2); + + //Now Test LineSegment intersection + LineSegment ls1 = LineSegment(p1, p2); + LineSegment ls2 = LineSegment(p3, p4); + LineSegment ls3 = LineSegment(p3a, p4); + + if (!ls1.intersectsShape(ls2)) { + cerr << "Test failed: intersectsShape returned false, but should be true." << endl; + cerr << ls1 << ", " << ls2 << endl; + return 0; + } + + if (ls1.intersectsShape(ls3)) { + cerr << "Test failed: intersectsShape returned true, but should be false." << endl; + cerr << ls1 << ", " << ls3 << endl; + return 0; + } + + //Now LineSegment Region intersection + Region r1 = Region(p5, p6); + Region r2 = Region(p7, p6); + Region r3 = Region(p8, p9); + + if (!r1.intersectsShape(ls1) || !ls1.intersectsShape(r1)) { + cerr << "Test failed: intersectsShape returned false, but should be true." << endl; + cerr << r1 << ", " << ls1 << endl; + return 0; + } + + if (r2.intersectsShape(ls1) || ls1.intersectsShape(r2)) { + cerr << "Test failed: intersectsShape returned true, but should be false." << endl; + cerr << r2 << ", " << ls1 << endl; + return 0; + } + + // This is the contains test + if (!r3.intersectsShape(ls1) || !ls1.intersectsShape(r3)) { + cerr << "Test failed: intersectsShape returned false, but should be true." << endl; + cerr << r3 << ", " << ls1 << endl; + return 0; + } + + return 0; +} diff --git a/recipes/libspatialindex/all/test_v1_package/CMakeLists.txt b/recipes/libspatialindex/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libspatialindex/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libspatialindex/all/test_v1_package/conanfile.py b/recipes/libspatialindex/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..302285c48aded --- /dev/null +++ b/recipes/libspatialindex/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) + bin_path_cpp = os.path.join("bin", "test_package_cpp") + self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/libspatialindex/config.yml b/recipes/libspatialindex/config.yml new file mode 100644 index 0000000000000..29d165f54e14c --- /dev/null +++ b/recipes/libspatialindex/config.yml @@ -0,0 +1,3 @@ +versions: + "1.9.3": + folder: all diff --git a/recipes/libspatialite/all/conandata.yml b/recipes/libspatialite/all/conandata.yml new file mode 100644 index 0000000000000..c9378f957e838 --- /dev/null +++ b/recipes/libspatialite/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "5.0.1": + url: "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-5.0.1.tar.gz" + sha256: "eecbc94311c78012d059ebc0fae86ea5ef6eecb13303e6e82b3753c1b3409e98" +patches: + "5.0.1": + - patch_file: "patches/0001-autotools-no-geos-config.patch" + - patch_file: "patches/0002-nmake-honor-flags.patch" + - patch_file: "patches/0003-msvc-minizip.patch" diff --git a/recipes/libspatialite/all/conanfile.py b/recipes/libspatialite/all/conanfile.py new file mode 100644 index 0000000000000..e6186b890b333 --- /dev/null +++ b/recipes/libspatialite/all/conanfile.py @@ -0,0 +1,247 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeDeps, NMakeToolchain +import os + +required_conan_version = ">=1.58.0" + + +class LibspatialiteConan(ConanFile): + name = "libspatialite" + description = ( + "SpatiaLite is an open source library intended to extend the SQLite " + "core to support fully fledged Spatial SQL capabilities." + ) + license = ("MPL-1.1", "GPL-2.0-or-later", "LGPL-2.1-or-later") + topics = ("spatialite", "database", "sql", "sqlite", "ogc") + homepage = "https://www.gaia-gis.it/fossil/libspatialite" + 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], + "mathsql": [True, False], + "geocallbacks": [True, False], + "knn": [True, False], + "epsg": [True, False], + "geopackage": [True, False], + "gcp": [True, False], + "with_proj": [True, False], + "with_iconv": [True, False], + "with_freexl": [True, False], + "with_geos": [True, False], + "with_rttopo": [True, False], + "with_libxml2": [True, False], + "with_minizip": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "mathsql": True, + "geocallbacks": True, + "knn": True, + "epsg": True, + "geopackage": True, + "gcp": True, + "with_proj": True, + "with_iconv": True, + "with_freexl": True, + "with_geos": True, + "with_rttopo": True, + "with_libxml2": True, + "with_minizip": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.with_geos: + del self.options.with_rttopo + del self.options.gcp + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("sqlite3/3.41.1") + self.requires("zlib/1.2.13") + if self.options.with_proj: + self.requires("proj/9.1.1") + if self.options.with_iconv: + self.requires("libiconv/1.17") + if self.options.with_freexl: + self.requires("freexl/1.0.6") + if self.options.with_geos: + self.requires("geos/3.11.1") + if self.options.get_safe("with_rttopo"): + self.requires("librttopo/1.1.0") + if self.options.with_libxml2: + self.requires("libxml2/2.10.3") + if self.options.with_minizip: + self.requires("minizip/1.2.13") + + 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") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + else: + 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-mathsql={yes_no(self.options.mathsql)}", + f"--enable-geocallbacks={yes_no(self.options.geocallbacks)}", + f"--enable-knn={yes_no(self.options.knn)}", + f"--enable-proj={yes_no(self.options.with_proj)}", + f"--enable-iconv={yes_no(self.options.with_iconv)}", + f"--enable-freexl={yes_no(self.options.with_freexl)}", + f"--enable-epsg={yes_no(self.options.epsg)}", + f"--enable-geos={yes_no(self.options.with_geos)}", + f"--enable-libxml2={yes_no(self.options.with_libxml2)}", + f"--enable-minizip={yes_no(self.options.with_minizip)}", + f"--enable-geopackage={yes_no(self.options.geopackage)}", + "--disable-gcov", + "--disable-examples", + "--disable-module-only", + ]) + if self.options.with_geos: + tc.configure_args.extend([ + f"--enable-gcp={yes_no(self.options.gcp)}", + "--enable-geosadvanced=yes", + "--enable-geosreentrant=yes", + "--enable-geosonlyreentrant=no", + "--enable-geos370=yes", + f"--enable-rttopo={yes_no(self.options.with_rttopo)}", + ]) + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _build_msvc(self): + # Visual Studio build doesn't provide options, we need to manually edit gaiaconfig-msvc.h + gaiaconfig_msvc = os.path.join(self.source_folder, "src", "headers", "spatialite", "gaiaconfig-msvc.h") + if not self.options.mathsql: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_MATHSQL */", "#define OMIT_MATHSQL 1") + if self.options.geocallbacks: + replace_in_file(self, gaiaconfig_msvc, "#define OMIT_GEOCALLBACKS 1", "") + if not self.options.knn: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_KNN */", "#define OMIT_KNN 1") + if not self.options.epsg: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_EPSG */", "#define OMIT_EPSG 1") + if not self.options.geopackage: + replace_in_file(self, gaiaconfig_msvc, "#define ENABLE_GEOPACKAGE 1", "") + if not self.options.get_safe("gcp", False): + replace_in_file(self, gaiaconfig_msvc, "#define ENABLE_GCP 1", "") + if not self.options.with_proj: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_PROJ */", "#define OMIT_PROJ 1") + if not self.options.with_iconv: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_ICONV */", "#define OMIT_ICONV 1") + if not self.options.with_freexl: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_FREEXL */", "#define OMIT_FREEXL 1") + if not self.options.with_geos: + replace_in_file(self, gaiaconfig_msvc, "/* #undef OMIT_GEOS */", "#define OMIT_GEOS 1") + if not self.options.get_safe("with_rttopo", False): + replace_in_file(self, gaiaconfig_msvc, "#define ENABLE_RTTOPO 1", "") + if not self.options.with_libxml2: + replace_in_file(self, gaiaconfig_msvc, "#define ENABLE_LIBXML2 1", "") + if not self.options.with_minizip: + replace_in_file(self, gaiaconfig_msvc, "#define ENABLE_MINIZIP 1", "") + + target = "spatialite_i.lib" if self.options.shared else "spatialite.lib" + optflags = ["-DYY_NO_UNISTD_H"] + if self.options.shared: + optflags.append("-DDLL_EXPORT") + with chdir(self, self.source_folder): + self.run(f"nmake -f makefile.vc {target} OPTFLAGS=\"{' '.join(optflags)}\"") + + def _build_autotools(self): + # fix MinGW + replace_in_file( + self, os.path.join(self.source_folder, "configure.ac"), + "AC_CHECK_LIB(z,", + "AC_CHECK_LIB({},".format(self.dependencies["zlib"].cpp_info.aggregated_components().libs[0]), + ) + # Disable tests + replace_in_file(self, os.path.join(self.source_folder, "Makefile.am"), + "SUBDIRS = src test $(EXAMPLES)", + "SUBDIRS = src $(EXAMPLES)") + + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + self._build_autotools() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "spatialite.h", src=os.path.join(self.source_folder, "src", "headers"), + dst=os.path.join(self.package_folder, "include")) + copy(self, "*.h", src=os.path.join(self.source_folder, "src", "headers", "spatialite"), + dst=os.path.join(self.package_folder, "include", "spatialite")) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "spatialite") + suffix = "_i" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"spatialite{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch b/recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch new file mode 100644 index 0000000000000..0da26fe7f8512 --- /dev/null +++ b/recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch @@ -0,0 +1,22 @@ +We can't use geos-config file in conan because it's a non-relocatable file, +therefore not packaged by geos recipe of conan-center-index. +Instead we rely on AutoToolsBuildEnvironment helper to inject proper flags. + +--- a/configure.ac ++++ b/configure.ac +@@ -311,6 +311,7 @@ AC_ARG_ENABLE(geos, [AS_HELP_STRING( + [--enable-geos], [enables GEOS inclusion [default=yes]])], + [], [enable_geos=yes]) + if test x"$enable_geos" != "xno"; then ++ if false; then + #----------------------------------------------------------------------- + # --with-geosconfig + # +@@ -352,6 +353,7 @@ if test x"$enable_geos" != "xno"; then + AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.3.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig])) + LIBS="$LIBS_SAVE" + LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c" ++ fi + + #----------------------------------------------------------------------- + # --enable-controlpoints diff --git a/recipes/libspatialite/all/patches/0002-nmake-honor-flags.patch b/recipes/libspatialite/all/patches/0002-nmake-honor-flags.patch new file mode 100644 index 0000000000000..d879bcc3f22dc --- /dev/null +++ b/recipes/libspatialite/all/patches/0002-nmake-honor-flags.patch @@ -0,0 +1,36 @@ +This patch for msvc build allows to: +* define OPTFLAG ourself from conanfile (allow to honor profile) +* not hardcode this very specific C:\OSGeo4W environment + +--- a/makefile.vc ++++ b/makefile.vc +@@ -2,7 +2,6 @@ + # + # NMAKE Makefile to build libspatialite on Windows + # +-!INCLUDE nmake.opt + + LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \ + src\gaiaexif\gaia_exif.obj src\gaiageo\gg_advanced.obj \ +@@ -93,7 +92,7 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \ + SPATIALITE_DLL = spatialite$(VERSION).dll + + CFLAGS = /nologo -I.\src\headers -I.\src\topology \ +- -I. -IC:\OSGeo4W\include $(OPTFLAGS) ++ -I. $(CFLAGS) $(OPTFLAGS) + + default: all + +@@ -108,11 +107,7 @@ $(SPATIALITE_DLL): spatialite_i.lib + + spatialite_i.lib: $(LIBOBJ) + link /dll /out:$(SPATIALITE_DLL) \ +- /implib:spatialite_i.lib $(LIBOBJ) \ +- C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \ +- C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \ +- C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \ +- C:\OSGeo4W\lib\libxml2.lib C:\OSGeo4W\lib\librttopo.lib ++ /implib:spatialite_i.lib $(LIBOBJ) + if exist $(SPATIALITE_DLL).manifest mt -manifest \ + $(SPATIALITE_DLL).manifest -outputresource:$(SPATIALITE_DLL);2 + diff --git a/recipes/libspatialite/all/patches/0003-msvc-minizip.patch b/recipes/libspatialite/all/patches/0003-msvc-minizip.patch new file mode 100644 index 0000000000000..82678ede01691 --- /dev/null +++ b/recipes/libspatialite/all/patches/0003-msvc-minizip.patch @@ -0,0 +1,12 @@ +--- a/src/headers/spatialite/gaiaconfig-msvc.h ++++ b/src/headers/spatialite/gaiaconfig-msvc.h +@@ -10,6 +10,9 @@ + /* Should be defined in order to enable LIBXML2 support. */ + #define ENABLE_LIBXML2 1 + ++/* Should be defined in order to enable MiniZIP support. */ ++#define ENABLE_MINIZIP 1 ++ + /* Should be defined in order to enable RTTOPO support. */ + #define ENABLE_RTTOPO 1 + diff --git a/recipes/libspatialite/all/test_package/CMakeLists.txt b/recipes/libspatialite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9e65e602672c8 --- /dev/null +++ b/recipes/libspatialite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libspatialite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libspatialite::libspatialite) diff --git a/recipes/libspatialite/all/test_package/conanfile.py b/recipes/libspatialite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libspatialite/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/libspatialite/all/test_package/test_package.c b/recipes/libspatialite/all/test_package/test_package.c new file mode 100644 index 0000000000000..a61e47b9833c1 --- /dev/null +++ b/recipes/libspatialite/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +#include + +int main(void) { + printf("libspatialite info:\n"); + printf("-- version: %s\n", spatialite_version()); + printf("-- target cpu: %s\n", spatialite_target_cpu()); + spatialite_initialize(); + spatialite_shutdown(); + return 0; +} diff --git a/recipes/libspatialite/all/test_v1_package/CMakeLists.txt b/recipes/libspatialite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libspatialite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libspatialite/all/test_v1_package/conanfile.py b/recipes/libspatialite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libspatialite/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/libspatialite/config.yml b/recipes/libspatialite/config.yml new file mode 100644 index 0000000000000..5787f28e91cf3 --- /dev/null +++ b/recipes/libspatialite/config.yml @@ -0,0 +1,3 @@ +versions: + "5.0.1": + folder: all diff --git a/recipes/libspng/all/conandata.yml b/recipes/libspng/all/conandata.yml new file mode 100644 index 0000000000000..20e5a777bfee5 --- /dev/null +++ b/recipes/libspng/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.7.3": + url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.3.tar.gz" + sha256: "a50cadbe808ffda1a7fab17d145f52a23b163f34b3eb3696c7ecb5a52340fc1d" + "0.7.2": + url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.2.tar.gz" + sha256: "4acf25571d31f540d0b7ee004f5461d68158e0a13182505376805da99f4ccc4e" +patches: + "0.7.3": + - patch_file: "patches/0.7.3-0001-fix-dll-install.patch" + patch_description: "fix install path" + patch_type: "portability" + - patch_file: "patches/0.7.3-0002-allow-miniz.patch" + patch_description: "add miniz option which is written in docs/BUILD.md" + patch_type: "portability" + "0.7.2": + - patch_file: "patches/0.7.2-0001-fix-dll-install.patch" + patch_description: "fix install path" + patch_type: "portability" + - patch_file: "patches/0.7.2-0002-allow-miniz.patch" + patch_description: "add miniz option which is written in docs/BUILD.md" + patch_type: "portability" diff --git a/recipes/libspng/all/conanfile.py b/recipes/libspng/all/conanfile.py new file mode 100644 index 0000000000000..47f9d1ea0e572 --- /dev/null +++ b/recipes/libspng/all/conanfile.py @@ -0,0 +1,82 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class LibspngConan(ConanFile): + name = "libspng" + description = "Simple, modern libpng alternative " + topics = ("png", "libpng", "spng") + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/randy408/libspng/" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_miniz": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_miniz": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_miniz: + self.requires("miniz/3.0.2") + else: + self.requires("zlib/1.2.13") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPNG_SHARED"] = self.options.shared + tc.variables["SPNG_STATIC"] = not self.options.shared + tc.variables["SPNG_USE_MINIZ"] = self.options.with_miniz + tc.variables["BUILD_EXAMPLES"] = 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", 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libspng") + if not self.options.shared: + self.cpp_info.defines = ["SPNG_STATIC"] + self.cpp_info.libs = ["spng"] if self.options.shared else ["spng_static"] + if self.settings.os in ["Linux", "Android", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch b/recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch new file mode 100644 index 0000000000000..223612a7c7b6c --- /dev/null +++ b/recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,7 +32,12 @@ endif() + if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) + target_link_libraries(spng ${spng_LIBS}) +- install(TARGETS spng DESTINATION lib) ++ install( ++ TARGETS spng ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) + + if(BUILD_EXAMPLES) + add_executable(example examples/example.c) diff --git a/recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch b/recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch new file mode 100644 index 0000000000000..7393b3d483583 --- /dev/null +++ b/recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.0) ++cmake_minimum_required(VERSION 3.1) + + project(libspng C) + +@@ -10,19 +10,24 @@ set(SPNG_VERSION ${SPNG_MAJOR}.${SPNG_MINOR}.${SPNG_REVISION}) + option(ENABLE_OPT "Enable architecture-specific optimizations" ON) + option(SPNG_SHARED "Build shared lib" ON) + option(SPNG_STATIC "Build static lib" ON) ++option(SPNG_USE_MINIZ "Use Miniz instead of zlib" OFF) + option(BUILD_EXAMPLES "Build examples" ON) + + include(GNUInstallDirs) + +-find_package(ZLIB REQUIRED) +-include_directories(${ZLIB_INCLUDE_DIRS}) ++if(SPNG_USE_MINIZ) ++ find_package(miniz REQUIRED) ++ set(spng_LIBS miniz::miniz) ++else() ++ find_package(ZLIB REQUIRED) ++ set(spng_LIBS ZLIB::ZLIB) ++endif() + + set(spng_SOURCES spng/spng.c) + +-if(NOT CMAKE_HOST_WIN32) +- set(spng_LIBS -lm ${ZLIB_LIBRARIES}) +-else() +- set(spng_LIBS ${ZLIB_LIBRARIES}) ++find_library(LIBM NAMES m) ++if(LIBM) ++ list(APPEND spng_LIBS ${LIBM}) + endif() + + if(NOT ENABLE_OPT) +@@ -31,7 +36,10 @@ endif() + + if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) +- target_link_libraries(spng ${spng_LIBS}) ++ target_link_libraries(spng PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng PRIVATE SPNG_USE_MINIZ) ++ endif() + install( + TARGETS spng + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +@@ -48,6 +56,10 @@ endif() + + if(SPNG_STATIC) + add_library(spng_static STATIC ${spng_SOURCES}) ++ target_link_libraries(spng_static PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng_static PRIVATE SPNG_USE_MINIZ) ++ endif() + target_compile_definitions(spng_static PUBLIC SPNG_STATIC) + install(TARGETS spng_static DESTINATION lib) + endif() diff --git a/recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch b/recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch new file mode 100644 index 0000000000000..4178460de5ec4 --- /dev/null +++ b/recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e6630a0..fff5d68 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,12 @@ if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) + target_include_directories(spng PUBLIC ${PROJECT_SOURCE_DIR}/spng) + target_link_libraries(spng ${spng_LIBS}) +- install(TARGETS spng DESTINATION lib) ++ install( ++ TARGETS spng ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) + + if(BUILD_EXAMPLES) + add_executable(example examples/example.c) diff --git a/recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch b/recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch new file mode 100644 index 0000000000000..88dd6636031a7 --- /dev/null +++ b/recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch @@ -0,0 +1,64 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fff5d68..5ed4ad0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ set(SPNG_VERSION ${SPNG_MAJOR}.${SPNG_MINOR}.${SPNG_REVISION}) + option(ENABLE_OPT "Enable architecture-specific optimizations" ON) + option(SPNG_SHARED "Build shared lib" ON) + option(SPNG_STATIC "Build static lib" ON) ++option(SPNG_USE_MINIZ "Use Miniz instead of zlib" OFF) + option(BUILD_EXAMPLES "Build examples" ON) + + include(GNUInstallDirs) +@@ -21,15 +22,19 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12") + cmake_policy(SET CMP0074 NEW) + endif() + +-find_package(ZLIB REQUIRED) +-include_directories(${ZLIB_INCLUDE_DIRS}) ++if(SPNG_USE_MINIZ) ++ find_package(miniz REQUIRED) ++ set(spng_LIBS miniz::miniz) ++else() ++ find_package(ZLIB REQUIRED) ++ set(spng_LIBS ZLIB::ZLIB) ++endif() + + set(spng_SOURCES spng/spng.c) + +-if(NOT CMAKE_HOST_WIN32) +- set(spng_LIBS -lm ${ZLIB_LIBRARIES}) +-else() +- set(spng_LIBS ${ZLIB_LIBRARIES}) ++find_library(LIBM NAMES m) ++if(LIBM) ++ list(APPEND spng_LIBS ${LIBM}) + endif() + + if(NOT ENABLE_OPT) +@@ -39,7 +44,10 @@ endif() + if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) + target_include_directories(spng PUBLIC ${PROJECT_SOURCE_DIR}/spng) +- target_link_libraries(spng ${spng_LIBS}) ++ target_link_libraries(spng PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng PRIVATE SPNG_USE_MINIZ) ++ endif() + install( + TARGETS spng + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +@@ -56,7 +64,12 @@ endif() + + if(SPNG_STATIC) + add_library(spng_static STATIC ${spng_SOURCES}) +- target_include_directories(spng PUBLIC ${PROJECT_SOURCE_DIR}/spng) ++ target_link_libraries(spng_static PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng_static PRIVATE SPNG_USE_MINIZ) ++ endif() ++ ++ target_include_directories(spng_static PUBLIC ${PROJECT_SOURCE_DIR}/spng) + target_compile_definitions(spng_static PUBLIC SPNG_STATIC) + install(TARGETS spng_static DESTINATION lib) + endif() diff --git a/recipes/libspng/all/test_package/CMakeLists.txt b/recipes/libspng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c8aa2ff46daf5 --- /dev/null +++ b/recipes/libspng/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libspng REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) diff --git a/recipes/libspng/all/test_package/conanfile.py b/recipes/libspng/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libspng/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/libspng/all/test_package/test_package.c b/recipes/libspng/all/test_package/test_package.c new file mode 100644 index 0000000000000..95b202395f7c0 --- /dev/null +++ b/recipes/libspng/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +#include "spng.h" + +int main(void) { + fprintf(stderr, " Compiled with libspng %s.\n", spng_version_string()); + + return 0; +} diff --git a/recipes/libspng/all/test_v1_package/CMakeLists.txt b/recipes/libspng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libspng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libspng/all/test_v1_package/conanfile.py b/recipes/libspng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libspng/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/libspng/config.yml b/recipes/libspng/config.yml new file mode 100644 index 0000000000000..ed848445a96cc --- /dev/null +++ b/recipes/libspng/config.yml @@ -0,0 +1,5 @@ +versions: + "0.7.3": + folder: all + "0.7.2": + folder: all diff --git a/recipes/libsquish/all/conandata.yml b/recipes/libsquish/all/conandata.yml new file mode 100644 index 0000000000000..bc1d40ba45206 --- /dev/null +++ b/recipes/libsquish/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.15": + url: "https://sourceforge.net/projects/libsquish/files/libsquish-1.15.tgz" + sha256: "628796eeba608866183a61d080d46967c9dda6723bc0a3ec52324c85d2147269" +patches: + "1.15": + - patch_file: "patches/0001-fix-cmake-simd-openmp-install.patch" + - patch_file: "patches/0002-export-symbols.patch" diff --git a/recipes/libsquish/all/conanfile.py b/recipes/libsquish/all/conanfile.py new file mode 100644 index 0000000000000..aaefbce93b7c7 --- /dev/null +++ b/recipes/libsquish/all/conanfile.py @@ -0,0 +1,86 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class LibsquishConan(ConanFile): + name = "libsquish" + description = "The libSquish library compresses images with the DXT " \ + "standard (also known as S3TC)." + license = "MIT" + topics = ("image", "compression", "dxt", "s3tc") + homepage = "https://sourceforge.net/projects/libsquish" + 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], + "openmp": [True, False], + "sse2_intrinsics": [True, False], + "altivec_intrinsics": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "openmp": False, + "sse2_intrinsics": False, + "altivec_intrinsics": False, + } + + @property + def _sse2_compliant_archs(self): + return ["x86", "x86_64"] + + @property + def _altivec_compliant_archs(self): + return ["ppc32be", "ppc32", "ppc64le", "ppc64"] + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in self._sse2_compliant_archs: + del self.options.sse2_intrinsics + if self.settings.arch not in self._altivec_compliant_archs: + del self.options.altivec_intrinsics + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SQUISH_WITH_OPENMP"] = self.options.openmp + tc.variables["BUILD_SQUISH_WITH_SSE2"] = self.options.get_safe("sse2_intrinsics") or False + tc.variables["BUILD_SQUISH_WITH_ALTIVEC"] = self.options.get_safe("altivec_intrinsics") or False + tc.variables["BUILD_SQUISH_EXTRA"] = False + tc.generate() + + 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 = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libsquish/all/patches/0001-fix-cmake-simd-openmp-install.patch b/recipes/libsquish/all/patches/0001-fix-cmake-simd-openmp-install.patch new file mode 100644 index 0000000000000..66ec394efce8b --- /dev/null +++ b/recipes/libsquish/all/patches/0001-fix-cmake-simd-openmp-install.patch @@ -0,0 +1,94 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,9 +9,9 @@ + # Unix and VS: SSE2 support is enabled by default + # use BUILD_SQUISH_WITH_SSE2 and BUILD_SQUISH_WITH_ALTIVEC to override + ++CMAKE_MINIMUM_REQUIRED(VERSION 3.13) + PROJECT(squish) + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3) + + OPTION(BUILD_SQUISH_WITH_OPENMP "Build with OpenMP." ON) + +@@ -22,25 +22,6 @@ OPTION(BUILD_SHARED_LIBS "Build shared libraries." OFF) + + OPTION(BUILD_SQUISH_EXTRA "Build extra source code." OFF) + +-IF (BUILD_SQUISH_WITH_OPENMP) +- FIND_PACKAGE(OpenMP) +- IF (OPENMP_FOUND) +- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") +- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +- ADD_DEFINITIONS(-DSQUISH_USE_OPENMP) +- ENDIF() +-ENDIF() +- +-IF (CMAKE_GENERATOR STREQUAL "Xcode") +- SET(CMAKE_OSX_ARCHITECTURES "i386;ppc") +-ELSE (CMAKE_GENERATOR STREQUAL "Xcode") +- IF (BUILD_SQUISH_WITH_SSE2 AND NOT WIN32) +- ADD_DEFINITIONS(-DSQUISH_USE_SSE=2 -msse2) +- ENDIF (BUILD_SQUISH_WITH_SSE2 AND NOT WIN32) +- IF (BUILD_SQUISH_WITH_ALTIVEC AND NOT WIN32) +- ADD_DEFINITIONS(-DSQUISH_USE_ALTIVEC=1 -maltivec) +- ENDIF (BUILD_SQUISH_WITH_ALTIVEC AND NOT WIN32) +-ENDIF (CMAKE_GENERATOR STREQUAL "Xcode") + + SET(SQUISH_HDRS + squish.h +@@ -74,6 +55,34 @@ SET(SQUISH_SRCS + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + + ADD_LIBRARY(squish ${SQUISH_SRCS} ${SQUISH_HDRS}) ++IF(BUILD_SQUISH_WITH_OPENMP) ++ IF(NOT TARGET OpenMP::OpenMP_CXX) ++ FIND_PACKAGE(Threads REQUIRED) ++ ADD_LIBRARY(OpenMP::OpenMP_CXX IMPORTED INTERFACE) ++ SET_PROPERTY(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS}) ++ SET_PROPERTY(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads) ++ ENDIF() ++ TARGET_LINK_LIBRARIES(squish PRIVATE OpenMP::OpenMP_CXX) ++ TARGET_COMPILE_DEFINITIONS(squish PRIVATE "SQUISH_USE_OPENMP") ++ENDIF() ++ ++IF(BUILD_SQUISH_WITH_SSE2) ++ TARGET_COMPILE_DEFINITIONS(squish PRIVATE "SQUISH_USE_SSE=2") ++ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR ++ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR ++ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") ++ TARGET_COMPILE_OPTIONS(squish PRIVATE -msse2) ++ ENDIF() ++ENDIF() ++ ++IF(BUILD_SQUISH_WITH_ALTIVEC) ++ TARGET_COMPILE_DEFINITIONS(squish PRIVATE "SQUISH_USE_ALTIVEC=1") ++ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR ++ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR ++ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") ++ TARGET_COMPILE_OPTIONS(squish PRIVATE -maltivec) ++ ENDIF() ++ENDIF() + + SET_TARGET_PROPERTIES( + squish PROPERTIES +@@ -81,12 +90,6 @@ SET_TARGET_PROPERTIES( + VERSION 0.0 + SOVERSION 0.0 + DEBUG_POSTFIX "d" +- XCODE_ATTRIBUTE_GCC_PREPROCESSOR_DEFINITIONS "$(SQUISH_CPP_$(CURRENT_ARCH))" +- XCODE_ATTRIBUTE_OTHER_CFLAGS "$(SQUISH_CFLAGS_$(CURRENT_ARCH))" +- XCODE_ATTRIBUTE_SQUISH_CPP_i386 "SQUISH_USE_SSE=2" +- XCODE_ATTRIBUTE_SQUISH_CFLAGS_i386 "" +- XCODE_ATTRIBUTE_SQUISH_CPP_ppc "SQUISH_USE_ALTIVEC=1" +- XCODE_ATTRIBUTE_SQUISH_CFLAGS_ppc "-maltivec" + ) + + IF (BUILD_SQUISH_EXTRA) +@@ -113,5 +116,6 @@ INSTALL( + TARGETS squish + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include + ) diff --git a/recipes/libsquish/all/patches/0002-export-symbols.patch b/recipes/libsquish/all/patches/0002-export-symbols.patch new file mode 100644 index 0000000000000..75e8cf3ad77f2 --- /dev/null +++ b/recipes/libsquish/all/patches/0002-export-symbols.patch @@ -0,0 +1,88 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -119,3 +119,14 @@ INSTALL( + RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include + ) ++target_include_directories(squish PUBLIC ++ $ ++ $ ++) ++set_target_properties(squish PROPERTIES ++ CXX_VISIBILITY_PRESET hidden ++ VISIBILITY_INLINES_HIDDEN TRUE ++) ++include(GenerateExportHeader) ++generate_export_header(squish) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/squish_export.h DESTINATION include) +--- a/squish.h ++++ b/squish.h +@@ -26,6 +26,8 @@ + #ifndef SQUISH_H + #define SQUISH_H + ++#include "squish_export.h" ++ + //! All squish API functions live in this namespace. + namespace squish { + +@@ -113,7 +115,7 @@ enum + { 0.2126f, 0.7152f, 0.0722f }. If non-NULL, the metric should point to a + contiguous array of 3 floats. + */ +-void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 ); ++SQUISH_EXPORT void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 ); + + // ----------------------------------------------------------------------------- + +@@ -176,7 +178,7 @@ inline void Compress( u8 const* rgba, void* block, int flags, float* metric = 0 + however, DXT1 will be used by default if none is specified. All other flags + are ignored. + */ +-void Decompress( u8* rgba, void const* block, int flags ); ++SQUISH_EXPORT void Decompress( u8* rgba, void const* block, int flags ); + + // ----------------------------------------------------------------------------- + +@@ -194,7 +196,7 @@ void Decompress( u8* rgba, void const* block, int flags ); + function supports arbitrary size images by allowing the outer blocks to + be only partially used. + */ +-int GetStorageRequirements( int width, int height, int flags ); ++SQUISH_EXPORT int GetStorageRequirements( int width, int height, int flags ); + + // ----------------------------------------------------------------------------- + +@@ -249,8 +251,8 @@ int GetStorageRequirements( int width, int height, int flags ); + Windows platform but for other platforms like MacOS X a different + gamma value may be more suitable. + */ +-void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 ); +-void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 ); ++SQUISH_EXPORT void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 ); ++SQUISH_EXPORT void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 ); + + // ----------------------------------------------------------------------------- + +@@ -274,8 +276,8 @@ void CompressImage( u8 const* rgba, int width, int height, void* blocks, int fla + + Internally this function calls squish::Decompress for each block. + */ +-void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags ); +-void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags ); ++SQUISH_EXPORT void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags ); ++SQUISH_EXPORT void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags ); + + // ----------------------------------------------------------------------------- + +@@ -299,8 +301,8 @@ void DecompressImage( u8* rgba, int width, int height, void const* blocks, int f + + Internally this function calls squish::Decompress for each block. + */ +-void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE); +-void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE); ++SQUISH_EXPORT void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE); ++SQUISH_EXPORT void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE); + + // ----------------------------------------------------------------------------- + diff --git a/recipes/libsquish/all/test_package/CMakeLists.txt b/recipes/libsquish/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a57d2011ccdd9 --- /dev/null +++ b/recipes/libsquish/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(libsquish REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libsquish::libsquish) diff --git a/recipes/libsquish/all/test_package/conanfile.py b/recipes/libsquish/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libsquish/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/libsquish/all/test_package/test_package.cpp b/recipes/libsquish/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..32a3e90d05d93 --- /dev/null +++ b/recipes/libsquish/all/test_package/test_package.cpp @@ -0,0 +1,77 @@ +#include + +#include +#include +#include +#include + +double getColourError(const squish::u8 *a, const squish::u8 *b) { + double error = 0.0; + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 3; ++j) { + int index = 4 * i + j; + int diff = static_cast(a[index]) - static_cast(b[index]); + error += static_cast(diff * diff); + } + } + return error / 16.0; +} + +void testTwoColour(int flags) { + squish::u8 input[4 * 16]; + squish::u8 output[4 * 16]; + squish::u8 block[16]; + + double avg = 0.0; + double min = std::numeric_limits::max(); + double max = - std::numeric_limits::max(); + int counter = 0; + + // test all single-channel colours + for (int i = 0; i < 16 * 4; ++i) { + input[i] = ((i % 4) == 3) ? 255 : 0; + } + + for (int channel = 0; channel < 3; ++channel) { + for (int value1 = 0; value1 < 255; ++value1) { + for (int value2 = value1 + 1; value2 < 255; ++value2) { + // set the channnel value + for (int i = 0; i < 16; ++i) { + input[4 * i + channel] = static_cast((i < 8) ? value1 : value2); + } + + // compress and decompress + squish::Compress(input, block, flags); + squish::Decompress(output, block, flags); + + // test the results + double rm = getColourError(input, output); + double rms = std::sqrt(rm); + + // accumulate stats + min = std::min(min, rms); + max = std::max(max, rms); + avg += rm; + ++counter; + } + } + + // reset the channel value + for (int i = 0; i < 16; ++i) { + input[4 * i + channel] = 0; + } + } + + // finish stats + avg = std::sqrt(avg / counter); + + // show stats + std::cout << "two colour error (min, max, avg): " + << min << ", " << max << ", " << avg + << std::endl; +} + +int main() { + testTwoColour(squish::kDxt1); + return 0; +} diff --git a/recipes/libsquish/all/test_v1_package/CMakeLists.txt b/recipes/libsquish/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsquish/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsquish/all/test_v1_package/conanfile.py b/recipes/libsquish/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsquish/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/libsquish/config.yml b/recipes/libsquish/config.yml new file mode 100644 index 0000000000000..31ab4c7136787 --- /dev/null +++ b/recipes/libsquish/config.yml @@ -0,0 +1,3 @@ +versions: + "1.15": + folder: all diff --git a/recipes/libsrtp/all/conandata.yml b/recipes/libsrtp/all/conandata.yml new file mode 100644 index 0000000000000..b0630ee5a7c2f --- /dev/null +++ b/recipes/libsrtp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.4.2": + url: "https://github.com/cisco/libsrtp/archive/v2.4.2.tar.gz" + sha256: "3b1bcb14ebda572b04b9bdf07574a449c84cb924905414e4d94e62837d22b628" + "2.4.0": + url: "https://github.com/cisco/libsrtp/archive/v2.4.0.tar.gz" + sha256: "713c5c1dc740707422307f39834c0b0fbb76769168d87e92c438a3cca8233d3d" + "2.3.0": + url: "https://github.com/cisco/libsrtp/archive/v2.3.0.tar.gz" + sha256: "94093a5d04c5f4743e8d81182b76938374df6d393b45322f24960d250b0110e8" diff --git a/recipes/libsrtp/all/conanfile.py b/recipes/libsrtp/all/conanfile.py new file mode 100644 index 0000000000000..3bf9617ba21c6 --- /dev/null +++ b/recipes/libsrtp/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, replace_in_file +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibsrtpRecipe(ConanFile): + name = "libsrtp" + description = ( + "This package provides an implementation of the Secure Real-time Transport" + "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" + 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": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_OPENSSL"] = self.options.with_openssl + tc.variables["TEST_APPS"] = False + if Version(self.version) < "2.4.0": + # Relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + replace_in_file( + self, os.path.join(self.source_folder, "CMakeLists.txt"), + "install(TARGETS srtp2 DESTINATION lib)", + ( + "include(GNUInstallDirs)\n" + "install(TARGETS srtp2\n" + "RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n" + "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\n" + "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})" + ), + ) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", f"libsrtp{Version(self.version).major}") + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libsrtp/all/test_package/CMakeLists.txt b/recipes/libsrtp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..88bdca8976ea9 --- /dev/null +++ b/recipes/libsrtp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libsrtp REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libsrtp::libsrtp) diff --git a/recipes/libsrtp/all/test_package/conanfile.py b/recipes/libsrtp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libsrtp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libsrtp/all/test_package/test_package.c b/recipes/libsrtp/all/test_package/test_package.c new file mode 100644 index 0000000000000..92d512e40247b --- /dev/null +++ b/recipes/libsrtp/all/test_package/test_package.c @@ -0,0 +1,33 @@ +// from: https://github.com/cisco/libsrtp#example-code + +#include + +#include + +int main(void) +{ + srtp_t session; + srtp_policy_t policy; + + // Set key to predetermined value + uint8_t key[30] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D}; + + // initialize libSRTP + srtp_init(); + + // default policy values + memset(&policy, 0x0, sizeof(srtp_policy_t)); + + // set policy to describe a policy for an SRTP stream + srtp_crypto_policy_set_rtp_default(&policy.rtp); + srtp_crypto_policy_set_rtcp_default(&policy.rtcp); + policy.key = key; + + // allocate and initialize the SRTP session + srtp_create(&session, &policy); + + return 0; +} diff --git a/recipes/libsrtp/all/test_v1_package/CMakeLists.txt b/recipes/libsrtp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsrtp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsrtp/all/test_v1_package/conanfile.py b/recipes/libsrtp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsrtp/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/libsrtp/config.yml b/recipes/libsrtp/config.yml new file mode 100644 index 0000000000000..d17b791c9f454 --- /dev/null +++ b/recipes/libsrtp/config.yml @@ -0,0 +1,7 @@ +versions: + "2.4.2": + folder: all + "2.4.0": + folder: all + "2.3.0": + folder: all diff --git a/recipes/libssh2/all/CMakeLists.txt b/recipes/libssh2/all/CMakeLists.txt new file mode 100644 index 0000000000000..8315062fd31ee --- /dev/null +++ b/recipes/libssh2/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper C) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/libssh2/all/conandata.yml b/recipes/libssh2/all/conandata.yml new file mode 100644 index 0000000000000..710cae0e7118d --- /dev/null +++ b/recipes/libssh2/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "1.10.0": + sha256: 2d64e90f3ded394b91d3a2e774ca203a4179f69aebee03003e5a6fa621e41d51 + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.10.0/libssh2-1.10.0.tar.gz + "1.9.0": + sha256: d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.9.0/libssh2-1.9.0.tar.gz + "1.8.2": + sha256: 088307d9f6b6c4b8c13f34602e8ff65d21c2dc4d55284dfe15d502c4ee190d67 + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.8.2/libssh2-1.8.2.tar.gz + "1.8.0": + sha256: 39f34e2f6835f4b992cafe8625073a88e5a28ba78f83e8099610a7b3af4676d4 + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.8.0/libssh2-1.8.0.tar.gz +patches: + "1.10.0": + - patch_file: "patches/0001-threads.patch" + base_path: "source_subfolder" + "1.9.0": + - patch_file: "patches/0001-threads.patch" + base_path: "source_subfolder" + "1.8.2": + - patch_file: "patches/0001-threads.patch" + base_path: "source_subfolder" + "1.8.0": + - patch_file: "patches/0001-threads.patch" + base_path: "source_subfolder" diff --git a/recipes/libssh2/all/conanfile.py b/recipes/libssh2/all/conanfile.py new file mode 100644 index 0000000000000..bb49ef120e615 --- /dev/null +++ b/recipes/libssh2/all/conanfile.py @@ -0,0 +1,132 @@ +from conans import ConanFile, CMake, tools +import functools +import os + +required_conan_version = ">=1.43.0" + + +class Libssh2Conan(ConanFile): + name = "libssh2" + description = "libssh2 is a client-side C library implementing the SSH2 protocol" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libssh2.org" + topics = ("libssh", "ssh", "shell", "ssh2", "connection") + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "enable_crypt_none": [True, False], + "enable_mac_none": [True, False], + "crypto_backend": ["openssl", "mbedtls"], + "enable_debug_logging": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "enable_crypt_none": False, + "enable_mac_none": False, + "crypto_backend": "openssl", + "enable_debug_logging": False, + } + + 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"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.12") + if self.options.crypto_backend == "openssl": + self.requires("openssl/1.1.1q") + elif self.options.crypto_backend == "mbedtls": + # libssh2/<=1.10.0 doesn't support mbedtls/3.x.x + self.requires("mbedtls/2.25.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)", + "list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)") + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["ENABLE_ZLIB_COMPRESSION"] = self.options.with_zlib + cmake.definitions["ENABLE_CRYPT_NONE"] = self.options.enable_crypt_none + cmake.definitions["ENABLE_MAC_NONE"] = self.options.enable_mac_none + cmake.definitions["ENABLE_DEBUG_LOGGING"] = self.options.enable_debug_logging + if self.options.crypto_backend == "openssl": + cmake.definitions["CRYPTO_BACKEND"] = "OpenSSL" + cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath + elif self.options.crypto_backend == "mbedtls": + cmake.definitions["CRYPTO_BACKEND"] = "mbedTLS" + cmake.definitions["BUILD_EXAMPLES"] = False + cmake.definitions["BUILD_TESTING"] = False + # To install relocatable shared lib on Macos by default + cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + cmake.configure() + return cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Libssh2") + self.cpp_info.set_property("cmake_target_name", "Libssh2::libssh2") + self.cpp_info.set_property("pkg_config_name", "libssh2") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_libssh2"].libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.components["_libssh2"].system_libs.append("ws2_32") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_libssh2"].system_libs.extend(["pthread", "dl"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Libssh2" + self.cpp_info.names["cmake_find_package_multi"] = "Libssh2" + self.cpp_info.components["_libssh2"].names["cmake_find_package"] = "libssh2" + self.cpp_info.components["_libssh2"].names["cmake_find_package_multi"] = "libssh2" + self.cpp_info.components["_libssh2"].set_property("cmake_target_name", "Libssh2::libssh2") + self.cpp_info.components["_libssh2"].set_property("pkg_config_name", "libssh2") + if self.options.with_zlib: + self.cpp_info.components["_libssh2"].requires.append("zlib::zlib") + if self.options.crypto_backend == "openssl": + self.cpp_info.components["_libssh2"].requires.append("openssl::openssl") + elif self.options.crypto_backend == "mbedtls": + self.cpp_info.components["_libssh2"].requires.append("mbedtls::mbedtls") diff --git a/recipes/libssh2/all/patches/0001-threads.patch b/recipes/libssh2/all/patches/0001-threads.patch new file mode 100644 index 0000000000000..05985dac07a46 --- /dev/null +++ b/recipes/libssh2/all/patches/0001-threads.patch @@ -0,0 +1,16 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index eee1a80..3373f2a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -42,6 +42,11 @@ include(CheckSymbolExists) + include(CheckNonblockingSocketSupport) + include(SocketLibraries) + ++if(UNIX AND NOT APPLE) ++ find_package(Threads REQUIRED) ++ list(APPEND LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) ++endif() ++ + ## Cryptography backend choice + + set(CRYPTO_BACKEND diff --git a/recipes/libssh2/all/test_package/CMakeLists.txt b/recipes/libssh2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dfda6b6e8ad0d --- /dev/null +++ b/recipes/libssh2/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Libssh2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} Libssh2::libssh2) diff --git a/recipes/libssh2/all/test_package/conanfile.py b/recipes/libssh2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/libssh2/all/test_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/libssh2/all/test_package/test_package.c b/recipes/libssh2/all/test_package/test_package.c new file mode 100644 index 0000000000000..3996348f0212d --- /dev/null +++ b/recipes/libssh2/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(int argc, char *argv[]) +{ + LIBSSH2_SESSION* session = libssh2_session_init(); + libssh2_session_disconnect(session, "Normal Shutdown"); + libssh2_session_free(session); + + return 0; +} diff --git a/recipes/libssh2/config.yml b/recipes/libssh2/config.yml new file mode 100644 index 0000000000000..42bce17ced607 --- /dev/null +++ b/recipes/libssh2/config.yml @@ -0,0 +1,9 @@ +versions: + "1.10.0": + folder: all + "1.9.0": + folder: all + "1.8.2": + folder: all + "1.8.0": + folder: all diff --git a/recipes/libstudxml/1.0.x/conandata.yml b/recipes/libstudxml/1.0.x/conandata.yml new file mode 100644 index 0000000000000..66056d9dcd92c --- /dev/null +++ b/recipes/libstudxml/1.0.x/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.1": + url: "https://www.codesynthesis.com/download/libstudxml/1.0/libstudxml-1.0.1.tar.gz" + sha256: "4665e0dbd4849988d61d039b22effc93439caadb92a84ca3aa41048973e284e4" +patches: + "1.0.1": + - patch_file: "patches/configure-ac.patch" + base_path: "source_subfolder" + - patch_file: "patches/makefile-am.patch" + base_path: "source_subfolder" diff --git a/recipes/libstudxml/1.0.x/conanfile.py b/recipes/libstudxml/1.0.x/conanfile.py new file mode 100644 index 0000000000000..f2a8f72a20d39 --- /dev/null +++ b/recipes/libstudxml/1.0.x/conanfile.py @@ -0,0 +1,186 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, MSBuild, tools +import os + +required_conan_version = ">=1.53.0" + + +class LibStudXmlConan(ConanFile): + name = "libstudxml" + description = "A streaming XML pull parser and streaming XML serializer implementation for modern, standard C++." + topics = ("xml", "xml-parser", "serialization") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.codesynthesis.com/projects/libstudxml/" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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): + pass + + def requirements(self): + self.requires("expat/2.5.0", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.info.settings.compiler == "Visual Studio" and Version(self.info.settings.compiler.version) < "9": + raise ConanInvalidConfiguration(f"Visual Studio {self.info.settings.compiler.version} is not supported.") + + def build_requirements(self): + if not is_msvc(self): + self.tool_requires("gnu-config/cci.20210814") + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_autotools(self): + if not self._autotools: + args = ["--with-external-expat"] + if self.options.shared: + args.extend(["--enable-shared", "--disable-static"]) + else: + args.extend(["--disable-shared", "--enable-static"]) + + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.configure(configure_dir=self._source_subfolder, args=args) + return self._autotools + + @property + def _vc_ver(self): + if self.settings.compiler == "Visual Studio": + return str(Version(self.settings.compiler.version).major) + elif self.settings.compiler == "msvc": + return { + "170": "11", + "180": "12", + "190": "14", + "191": "15", + "192": "16", + "193": "17", + }[str(self.settings.compiler.version)] + return None + + def _build_vs(self): + vc_ver = int(self._vc_ver) + sln_path = None + def get_sln_path(): + return os.path.join(self.source_folder, self._source_subfolder, f"libstudxml-vc{vc_ver}.sln") + + sln_path = get_sln_path() + while not os.path.exists(sln_path): + vc_ver -= 1 + sln_path = get_sln_path() + + proj_path = os.path.join(self.source_folder, self._source_subfolder, "xml", f"libstudxml-vc{vc_ver}.vcxproj") + + if not self.options.shared: + replace_in_file(self, proj_path, "DynamicLibrary", "StaticLibrary") + replace_in_file(self, proj_path, "LIBSTUDXML_DYNAMIC_LIB", "LIBSTUDXML_STATIC_LIB") + + msbuild = MSBuild(self) + msbuild.build(sln_path, platforms={"x86": "Win32"}) + + def _build_autotools(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy( + self, + os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=os.path.join(self.source_folder, self._source_subfolder, "config"), + ) + + if self.settings.compiler.get_safe("libcxx") == "libc++": + # libc++ includes a file called 'version', and since libstudxml adds source_subfolder as an + # include dir, libc++ ends up including their 'version' file instead, causing a compile error + rm(self, "version", os.path.join(self.source_folder, self._source_subfolder)) + + with chdir(self, os.path.join(self.source_folder, self._source_subfolder)): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + + autotools = self._configure_autotools() + autotools.make() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_vs() + else: + self._build_autotools() + + def package(self): + copy(self, "LICENSE", src=os.path.join(self.source_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + self.copy("xml/value-traits", dst="include", src=self._source_subfolder) + self.copy("xml/serializer", dst="include", src=self._source_subfolder) + self.copy("xml/qname", dst="include", src=self._source_subfolder) + self.copy("xml/parser", dst="include", src=self._source_subfolder) + self.copy("xml/forward", dst="include", src=self._source_subfolder) + self.copy("xml/exception", dst="include", src=self._source_subfolder) + self.copy("xml/content", dst="include", src=self._source_subfolder) + self.copy("xml/*.ixx", dst="include", src=self._source_subfolder) + self.copy("xml/*.txx", dst="include", src=self._source_subfolder) + self.copy("xml/*.hxx", dst="include", src=self._source_subfolder) + self.copy("xml/*.h", dst="include", src=self._source_subfolder) + + suffix = "" + if self.settings.arch == "x86_64": + suffix = "64" + if self.options.shared: + self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "lib" + suffix)) + self.copy("*.dll", dst="bin", src=os.path.join(self._source_subfolder, "bin" + suffix)) + else: + self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "bin" + suffix)) + else: + autotools = self._configure_autotools() + 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libstudxml") + self.cpp_info.libs = collect_libs(self) + + # If built with makefile, static library mechanism is provided by their buildsystem already + if is_msvc(self) and not self.options.shared: + self.cpp_info.defines = ["LIBSTUDXML_STATIC_LIB=1"] diff --git a/recipes/libstudxml/1.0.x/patches/configure-ac.patch b/recipes/libstudxml/1.0.x/patches/configure-ac.patch new file mode 100644 index 0000000000000..75c6ba9da0956 --- /dev/null +++ b/recipes/libstudxml/1.0.x/patches/configure-ac.patch @@ -0,0 +1,10 @@ +--- configure.ac ++++ configure.ac +@@ -80,6 +80,6 @@ + # Output. + # + AC_CONFIG_HEADERS([xml/config.h xml/details/config.h]) +-AC_CONFIG_FILES([ doc/Makefile examples/hybrid/Makefile examples/inheritance/Makefile examples/Makefile examples/performance/Makefile examples/persistence/Makefile examples/processing/Makefile examples/roundtrip/Makefile libstudxml.pc Makefile tester tests/Makefile tests/parser/Makefile tests/roundtrip/Makefile tests/serializer/Makefile xml/Makefile]) ++AC_CONFIG_FILES([ libstudxml.pc Makefile xml/Makefile]) + AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester]) + AC_OUTPUT diff --git a/recipes/libstudxml/1.0.x/patches/makefile-am.patch b/recipes/libstudxml/1.0.x/patches/makefile-am.patch new file mode 100644 index 0000000000000..50069a032481c --- /dev/null +++ b/recipes/libstudxml/1.0.x/patches/makefile-am.patch @@ -0,0 +1,12 @@ +--- Makefile.am ++++ Makefile.am +@@ -2,7 +2,7 @@ + # copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC + # license : MIT; see accompanying LICENSE file + +-SUBDIRS = xml tests examples doc +-dist_doc_DATA = LICENSE NEWS README INSTALL version ++SUBDIRS = xml ++dist_doc_DATA = LICENSE NEWS README INSTALL + EXTRA_DIST = tester.bat libstudxml-vc9.sln libstudxml-vc10.sln libstudxml-vc11.sln libstudxml-vc12.sln bootstrap tester.in + ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libstudxml/1.0.x/test_package/CMakeLists.txt b/recipes/libstudxml/1.0.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e931d3be71851 --- /dev/null +++ b/recipes/libstudxml/1.0.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(libstudxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libstudxml::libstudxml) diff --git a/recipes/libstudxml/1.0.x/test_package/conanfile.py b/recipes/libstudxml/1.0.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libstudxml/1.0.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/libstudxml/1.0.x/test_package/test_package.cpp b/recipes/libstudxml/1.0.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..7803a10a33e05 --- /dev/null +++ b/recipes/libstudxml/1.0.x/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +int main() { + std::istringstream is("X"); + xml::parser p(is, "test"); + + bool success = true; + success &= p.next() == xml::parser::start_element; + success &= p.next() == xml::parser::start_element; + success &= p.next() == xml::parser::characters && p.value() == "X"; + + return success ? 0 : -1; +} diff --git a/recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt b/recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libstudxml/1.0.x/test_v1_package/conanfile.py b/recipes/libstudxml/1.0.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libstudxml/1.0.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libstudxml/1.1.x/CMakeLists.txt b/recipes/libstudxml/1.1.x/CMakeLists.txt new file mode 100644 index 0000000000000..4eaaf23bf2205 --- /dev/null +++ b/recipes/libstudxml/1.1.x/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.1) +project(libstudxml LANGUAGES C CXX) + +find_package(EXPAT REQUIRED MODULE) + +add_library(studxml + ${LIBSTUDXML_SRC_DIR}/libstudxml/parser.cxx + ${LIBSTUDXML_SRC_DIR}/libstudxml/qname.cxx + ${LIBSTUDXML_SRC_DIR}/libstudxml/serializer.cxx + ${LIBSTUDXML_SRC_DIR}/libstudxml/value-traits.cxx + ${LIBSTUDXML_SRC_DIR}/libstudxml/details/genx/char-props.c + ${LIBSTUDXML_SRC_DIR}/libstudxml/details/genx/genx.c +) +target_include_directories(studxml PUBLIC ${LIBSTUDXML_SRC_DIR}) +target_link_libraries(studxml PUBLIC EXPAT::EXPAT) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(studxml + PRIVATE LIBSTUDXML_SHARED_BUILD + INTERFACE LIBSTUDXML_SHARED + ) +else() + target_compile_definitions(studxml + PRIVATE LIBSTUDXML_STATIC_BUILD + INTERFACE LIBSTUDXML_STATIC + ) +endif() + +include(GNUInstallDirs) +install( + TARGETS studxml + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install( + DIRECTORY ${LIBSTUDXML_SRC_DIR}/libstudxml + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING REGEX "(.*).(h|hxx|ixx|txx)$" +) diff --git a/recipes/libstudxml/1.1.x/conandata.yml b/recipes/libstudxml/1.1.x/conandata.yml new file mode 100644 index 0000000000000..2001802fdfa42 --- /dev/null +++ b/recipes/libstudxml/1.1.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0-b.10+1": + url: "https://git.codesynthesis.com/cgit/libstudxml/libstudxml/snapshot/v1.1.0-b.10%2b1.tar.xz" + sha256: "6773bb700b0b61fb117f0737f3c754d2be67d70766d63430b8a95bf147cc0368" diff --git a/recipes/libstudxml/1.1.x/conanfile.py b/recipes/libstudxml/1.1.x/conanfile.py new file mode 100644 index 0000000000000..42db9e71046d4 --- /dev/null +++ b/recipes/libstudxml/1.1.x/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LibStudXmlConan(ConanFile): + name = "libstudxml" + description = "A streaming XML pull parser and streaming XML serializer implementation for modern, standard C++." + topics = ("xml", "xml-parser", "serialization") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.codesynthesis.com/projects/libstudxml/" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("expat/2.5.0", transitive_headers=True, transitive_libs=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.variables["LIBSTUDXML_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + # unvendor expat + rmdir(self, os.path.join(self.source_folder, "libstudxml", "details", "expat")) + replace_in_file( + self, + os.path.join(self.source_folder, "libstudxml", "parser.hxx"), + "#ifndef LIBSTUDXML_EXTERNAL_EXPAT", + "#if 0", + ) + + def build(self): + self._patch_sources() + 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.set_property("pkg_config_name", "libstudxml") + self.cpp_info.libs = ["studxml"] + self.cpp_info.defines = ["LIBSTUDXML_SHARED" if self.options.shared else "LIBSTUDXML_STATIC"] diff --git a/recipes/libstudxml/1.1.x/test_package/CMakeLists.txt b/recipes/libstudxml/1.1.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e931d3be71851 --- /dev/null +++ b/recipes/libstudxml/1.1.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(libstudxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libstudxml::libstudxml) diff --git a/recipes/libstudxml/1.1.x/test_package/conanfile.py b/recipes/libstudxml/1.1.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libstudxml/1.1.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/libstudxml/1.1.x/test_package/test_package.cpp b/recipes/libstudxml/1.1.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..9ebd7090dd31e --- /dev/null +++ b/recipes/libstudxml/1.1.x/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +int main() { + std::istringstream is("X"); + xml::parser p(is, "test"); + + bool success = true; + success &= p.next() == xml::parser::start_element; + success &= p.next() == xml::parser::start_element; + success &= p.next() == xml::parser::characters && p.value() == "X"; + + return success ? 0 : -1; +} diff --git a/recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt b/recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libstudxml/1.1.x/test_v1_package/conanfile.py b/recipes/libstudxml/1.1.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libstudxml/1.1.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libstudxml/config.yml b/recipes/libstudxml/config.yml new file mode 100644 index 0000000000000..119e8114fa194 --- /dev/null +++ b/recipes/libstudxml/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0-b.10+1": + folder: "1.1.x" + "1.0.1": + folder: "1.0.x" diff --git a/recipes/libsvm/all/CMakeLists.txt b/recipes/libsvm/all/CMakeLists.txt new file mode 100644 index 0000000000000..3c3e2d6052401 --- /dev/null +++ b/recipes/libsvm/all/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.4) +project(svm C CXX) + +include(GNUInstallDirs) + +add_library(svm ${LIBSVM_SRC_DIR}/svm.cpp) +set_property(TARGET svm PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) +set_target_properties(svm PROPERTIES PUBLIC_HEADER ${LIBSVM_SRC_DIR}/svm.h) + +add_executable(svm-predict ${LIBSVM_SRC_DIR}/svm-predict.c) +target_link_libraries(svm-predict svm) + +add_executable(svm-train ${LIBSVM_SRC_DIR}/svm-train.c) +target_link_libraries(svm-train svm) + +add_executable(svm-scale ${LIBSVM_SRC_DIR}/svm-scale.c) + +install(TARGETS svm + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/svm + ) + +install(TARGETS svm-predict svm-train svm-scale + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) diff --git a/recipes/libsvm/all/conandata.yml b/recipes/libsvm/all/conandata.yml new file mode 100644 index 0000000000000..5712311441eb3 --- /dev/null +++ b/recipes/libsvm/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "330": + url: "https://github.com/cjlin1/libsvm/archive/v330.tar.gz" + sha256: "e4fe41308c87cc210aec73e4f5f0fb4da14234d90e7a131763fbad3788ca2d80" + "325": + url: "https://github.com/cjlin1/libsvm/archive/v325.tar.gz" + sha256: "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963" + "324": + url: "https://github.com/cjlin1/libsvm/archive/v324.tar.gz" + sha256: "3ba1ac74ee08c4dd57d3a9e4a861ffb57dab88c6a33fd53eac472fc84fbb2a8f" diff --git a/recipes/libsvm/all/conanfile.py b/recipes/libsvm/all/conanfile.py new file mode 100644 index 0000000000000..5391a6c157e8a --- /dev/null +++ b/recipes/libsvm/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.54.0" + + +class libsvmConan(ConanFile): + name = "libsvm" + description = "Libsvm is a simple, easy-to-use, and efficient software for SVM classification and regression" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/" + license = "BSD-3-Clause" + topics = "svm", "vector" + 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, 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + f"{self.ref} can not be built as shared library with Visual Studio and static runtime" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBSVM_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, "COPYRIGHT", 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 = ["svm"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/libsvm/all/test_package/CMakeLists.txt b/recipes/libsvm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dca2cfa3e609e --- /dev/null +++ b/recipes/libsvm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libsvm CONFIG REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libsvm::libsvm) diff --git a/recipes/libsvm/all/test_package/conanfile.py b/recipes/libsvm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..70b80fc025616 --- /dev/null +++ b/recipes/libsvm/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libsvm/all/test_package/test_package.c b/recipes/libsvm/all/test_package/test_package.c new file mode 100644 index 0000000000000..fc322d31c2797 --- /dev/null +++ b/recipes/libsvm/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include +#include + +struct svm_parameter param; + +int main(int argc, char **argv) +{ + param.svm_type = C_SVC; + param.kernel_type = PRECOMPUTED; + + //Allocate some dummy data + param.weight = (double*)malloc(10 * sizeof(double)); + svm_destroy_param(¶m); + + printf("libsvm version %d test_package OK \n", LIBSVM_VERSION); + return 0; +} diff --git a/recipes/libsvm/all/test_v1_package/CMakeLists.txt b/recipes/libsvm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsvm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsvm/all/test_v1_package/conanfile.py b/recipes/libsvm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c1c8554eae243 --- /dev/null +++ b/recipes/libsvm/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building + +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsvm/config.yml b/recipes/libsvm/config.yml new file mode 100644 index 0000000000000..026fbb9e30356 --- /dev/null +++ b/recipes/libsvm/config.yml @@ -0,0 +1,7 @@ +versions: + "330": + folder: all + "325": + folder: all + "324": + folder: all diff --git a/recipes/libsvtav1/all/conandata.yml b/recipes/libsvtav1/all/conandata.yml new file mode 100644 index 0000000000000..74d595eb1046f --- /dev/null +++ b/recipes/libsvtav1/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "1.4.1": + url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.4.1/SVT-AV1-v1.4.1.tar.bz2 + sha256: 0e988582f315fe76c909accf5e7f81b975c5bd2b850ee760d8e9fac297f70b5d + "1.3.0": + url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.3.0/SVT-AV1-v1.3.0.tar.bz2 + sha256: f85fd13ef16880550e425797bdfdf1b0ba310c21d6b343f74ea79dd2fbb2336e + "1.2.1": + url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.2.1/SVT-AV1-v1.2.1.tar.bz2 + sha256: 805827daa8aedec4f1362b959f377075e2a811680bfc76b6f4fbf2ef4e7101d4 +patches: + "1.4.1": + - patch_file: "patches/llvm-clang-macos.patch" + patch_type: "portability" + patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2087 + patch_description: "Allow statically compiling on macos with llvm-clang" + "1.3.0": + - patch_file: "patches/llvm-clang-macos.patch" + patch_type: "portability" + patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2087 + patch_description: "Allow statically compiling on macos with llvm-clang" + "1.2.1": + - patch_file: "patches/llvm-clang-macos.patch" + patch_type: "portability" + patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2087 + patch_description: "Allow statically compiling on macos with llvm-clang" diff --git a/recipes/libsvtav1/all/conanfile.py b/recipes/libsvtav1/all/conanfile.py new file mode 100644 index 0000000000000..ae303bae006ef --- /dev/null +++ b/recipes/libsvtav1/all/conanfile.py @@ -0,0 +1,92 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake +from conan.tools.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +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" + 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], + "build_encoder": [True, False], + "build_decoder": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_encoder": True, + "build_decoder": True, + } + + def export_sources(self): + export_conandata_patches(self) + + 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 build_requirements(self): + if Version(self.version) >= "1.3.0": + self.tool_requires("cmake/[>=3.16 <4]") + if self.settings.arch in ("x86", "x86_64"): + self.tool_requires("nasm/2.15.05") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_APPS"] = False + tc.variables["BUILD_DEC"] = self.options.build_decoder + tc.variables["BUILD_ENC"] = self.options.build_encoder + if self.settings.arch in ("x86", "x86_64"): + tc.variables["ENABLE_NASM"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + for license_file in ("LICENSE.md", "PATENTS.md"): + copy(self, license_file, self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure() + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + if self.options.build_encoder: + self.cpp_info.components["encoder"].libs = ["SvtAv1Enc"] + self.cpp_info.components["encoder"].includedirs = ["include/svt-av1"] + self.cpp_info.components["encoder"].set_property("pkg_config_name", "SvtAv1Enc") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["encoder"].system_libs = ["pthread", "dl", "m"] + if self.options.build_decoder: + self.cpp_info.components["decoder"].libs = ["SvtAv1Dec"] + self.cpp_info.components["decoder"].includedirs = ["include/svt-av1"] + self.cpp_info.components["decoder"].set_property("pkg_config_name", "SvtAv1Dec") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["encoder"].system_libs = ["pthread", "dl", "m"] diff --git a/recipes/libsvtav1/all/patches/llvm-clang-macos.patch b/recipes/libsvtav1/all/patches/llvm-clang-macos.patch new file mode 100644 index 0000000000000..f94af5af73744 --- /dev/null +++ b/recipes/libsvtav1/all/patches/llvm-clang-macos.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25a40f09..9c861554 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -203,10 +203,12 @@ endif() + if(UNIX) + if(APPLE) + set(CMAKE_MACOSX_RPATH 1) +- set(CMAKE_C_ARCHIVE_CREATE " Scr ") +- set(CMAKE_CXX_ARCHIVE_CREATE " Scr ") +- set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") +- set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") ++ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang") ++ set(CMAKE_C_ARCHIVE_CREATE " Scr ") ++ set(CMAKE_CXX_ARCHIVE_CREATE " Scr ") ++ set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") ++ set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") ++ endif() + else() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack -z relro -z now") + endif() diff --git a/recipes/libsvtav1/all/test_package/CMakeLists.txt b/recipes/libsvtav1/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..57e131a83ee08 --- /dev/null +++ b/recipes/libsvtav1/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(libsvtav1 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::encoder) +target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::decoder) diff --git a/recipes/libsvtav1/all/test_package/conanfile.py b/recipes/libsvtav1/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f76921cc6be61 --- /dev/null +++ b/recipes/libsvtav1/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "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/libsvtav1/all/test_package/test_package.cpp b/recipes/libsvtav1/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cb808440d268e --- /dev/null +++ b/recipes/libsvtav1/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "EbSvtAv1Enc.h" +#include "EbSvtAv1Dec.h" + +#include + +int main() { std::cout << svt_av1_get_version() << "\n"; } diff --git a/recipes/libsvtav1/all/test_v1_package/CMakeLists.txt b/recipes/libsvtav1/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libsvtav1/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libsvtav1/all/test_v1_package/conanfile.py b/recipes/libsvtav1/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libsvtav1/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsvtav1/config.yml b/recipes/libsvtav1/config.yml new file mode 100644 index 0000000000000..37cfc8825c04f --- /dev/null +++ b/recipes/libsvtav1/config.yml @@ -0,0 +1,7 @@ +versions: + "1.4.1": + folder: all + "1.3.0": + folder: all + "1.2.1": + folder: all diff --git a/recipes/libsystemd/all/conandata.yml b/recipes/libsystemd/all/conandata.yml new file mode 100644 index 0000000000000..8c721280d7274 --- /dev/null +++ b/recipes/libsystemd/all/conandata.yml @@ -0,0 +1,74 @@ +sources: + "253.3": + url: "https://github.com/systemd/systemd-stable/archive/v253.3.tar.gz" + sha256: "569775d77084e45d15e103004cf4fbc00d7249c33791471b80f0c3296962bbfd" + "252.9": + url: "https://github.com/systemd/systemd-stable/archive/v252.9.tar.gz" + sha256: "c386aac4ba39fa1bca3a3c9ef9df5a737e3184c9c6a04340e34d6d0254007845" + "251.15": + url: "https://github.com/systemd/systemd-stable/archive/v251.15.tar.gz" + sha256: "570b30b5b9a649d7481ca2bd0355a2d659f9a0ebb71a24588c6c365cda90c298" + "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: + "253.3": + - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" + patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" + patch_type: "conan" + - patch_file: "patches/251.15/0001-Remove-dependency-from-coreutils.patch" + patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" + patch_type: "conan" + "252.9": + - 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.15/0001-Remove-dependency-from-coreutils.patch" + patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" + patch_type: "conan" + "251.15": + - 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.15/0001-Remove-dependency-from-coreutils.patch" + patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" + patch_type: "conan" + "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 new file mode 100644 index 0000000000000..17ae41f5c8e6a --- /dev/null +++ b/recipes/libsystemd/all/conanfile.py @@ -0,0 +1,199 @@ +import os +import re + +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, replace_in_file +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class LibsystemdConan(ConanFile): + name = "libsystemd" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/systemd/" + description = "System and Service Manager API library" + topics = ("systemd", "service", "manager") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_selinux": [True, False], + "with_lz4": [True, False], + "with_xz": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_selinux": True, + "with_lz4": True, + "with_xz": True, + "with_zstd": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + del self.options.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("libcap/2.68") + self.requires("libmount/2.36.2") + if self.options.with_selinux: + self.requires("libselinux/3.3") + if self.options.with_lz4: + self.requires("lz4/1.9.4") + if self.options.with_xz: + self.requires("xz_utils/5.4.2") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("Only Linux supported") + + def build_requirements(self): + self.tool_requires("meson/1.1.0") + self.tool_requires("m4/1.4.19") + self.tool_requires("gperf/3.1") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _so_version(self): + meson_build = os.path.join(self.source_folder, "meson.build") + with open(meson_build, "r") as build_file: + for line in build_file: + match = re.match(r"^libsystemd_version = '(.*)'$", line) + if match: + return match.group(1) + return "" + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = MesonToolchain(self) + tc.project_options["selinux"] = ("true" if self.options.with_selinux + else "false") + tc.project_options["lz4"] = ("true" if self.options.with_lz4 + else "false") + tc.project_options["xz"] = "true" if self.options.with_xz else "false" + tc.project_options["zstd"] = ("true" if self.options.with_zstd + else "false") + + if self.options.shared: + tc.project_options["static-libsystemd"] = "false" + elif self.options.fPIC: + tc.project_options["static-libsystemd"] = "pic" + else: + tc.project_options["static-libsystemd"] = "no-pic" + + # options unrelated to libsystemd + unrelated = [ + "fdisk", "seccomp", "pwquality", "apparmor", "polkit", "audit", + "kmod", "microhttpd", "libcryptsetup", "libcurl", "libidn", + "libidn2", "qrencode", "openssl", "libfido2", "zlib", "xkbcommon", + "pcre2", "glib", "dbus", "blkid", "gcrypt", "p11kit", "ima", + "smack", "bzip2", "gnutls", "idn", "initrd", "binfmt", "vconsole", + "quotacheck", "tmpfiles", "environment-d", "sysusers", "firstboot", + "randomseed", "backlight", "rfkill", "xdg-autostart", "logind", + "hibernate", "machined", "portabled", "userdb", "hostnamed", + "timedated", "timesyncd", "localed", "networkd", "resolve", + "coredump", "pstore", "efi", "nss-myhostname", "nss-mymachines", + "nss-resolve", "nss-systemd", "hwdb", "tpm", "man", "html", "utmp", + "ldconfig", "adm-group", "wheel-group", "gshadow", "install-tests", + "link-udev-shared", "link-systemctl-shared", "analyze", "pam", + "link-networkd-shared", "link-timesyncd-shared", "kernel-install", + "libiptc", "elfutils", "repart", "homed", "importd", "acl", + "dns-over-tls", "gnu-efi", "valgrind", "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") + + 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 + + # 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 + # that it is not enough to use the 'PkgConfigDeps' generator here. It + # is also required to provide a path to the header files directly to + # the compiler. + for dependency in self.dependencies.values(): + for includedir in dependency.cpp_info.aggregated_components().includedirs: + tc.c_args.append(f"-I{includedir}") + + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + meson_build = os.path.join(self.source_folder, "meson.build") + replace_in_file(self, meson_build, "@CONAN_SRC_REL_PATH@", + "'../{}'".format(os.path.basename(self.source_folder))) + + def build(self): + self._patch_sources() + + meson = Meson(self) + meson.configure() + target = ("systemd:shared_library" if self.options.shared + else "systemd:static_library") + meson.build(target=f"version.h {target}") + + def package(self): + copy(self, "LICENSE.LGPL2.1", self.source_folder, + os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", os.path.join(self.source_folder, "src", "systemd"), + os.path.join(self.package_folder, "include", "systemd")) + + if self.options.shared: + copy(self, "libsystemd.so", self.build_folder, + os.path.join(self.package_folder, "lib")) + copy(self, "libsystemd.so.{}".format(self._so_version.split('.')), + self.build_folder, os.path.join(self.package_folder, "lib")) + copy(self, "libsystemd.so.{}".format(self._so_version), + self.build_folder, os.path.join(self.package_folder, "lib")) + else: + copy(self, "libsystemd.a", self.build_folder, + os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libsystemd") + self.cpp_info.set_property("component_version", str(Version(self.version).major)) + self.cpp_info.libs = ["systemd"] + self.cpp_info.system_libs = ["rt", "pthread", "dl"] + + # TODO: to remove in conan v2 + self.cpp_info.version = str(Version(self.version).major) 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 new file mode 100644 index 0000000000000..cb77bf0883880 --- /dev/null +++ b/recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch @@ -0,0 +1,223 @@ +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 new file mode 100644 index 0000000000000..8ad824a0820d5 --- /dev/null +++ b/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000000000..9aa5388102343 --- /dev/null +++ b/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch @@ -0,0 +1,29 @@ +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 new file mode 100644 index 0000000000000..4114c124814c8 --- /dev/null +++ b/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch @@ -0,0 +1,31 @@ +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 new file mode 100644 index 0000000000000..b040e39278226 --- /dev/null +++ b/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000000000..1df9689ea3a32 --- /dev/null +++ b/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch @@ -0,0 +1,31 @@ +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/all/patches/251.15/0001-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/251.15/0001-Remove-dependency-from-coreutils.patch new file mode 100644 index 0000000000000..d186a13d30fbb --- /dev/null +++ b/recipes/libsystemd/all/patches/251.15/0001-Remove-dependency-from-coreutils.patch @@ -0,0 +1,32 @@ +From 0cd72ba5fc1e0b7927522e91d4a1b5172bbc818e 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 | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/meson.build b/meson.build +index d27796e85e..1a31824c8c 100644 +--- a/meson.build ++++ b/meson.build +@@ -25,10 +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, +- check : true).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: a6422b7bd7001dc38d658f3197073a3e22ca9f1b +-- +2.40.1 + diff --git a/recipes/libsystemd/all/patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch b/recipes/libsystemd/all/patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch new file mode 100644 index 0000000000000..c6abf3d61d056 --- /dev/null +++ b/recipes/libsystemd/all/patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch @@ -0,0 +1,32 @@ +From da3472d677dd30065f8745a124d580e5c24d3868 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 5ccf02adec..14169e67f3 100644 +--- a/src/basic/missing_syscalls.py ++++ b/src/basic/missing_syscalls.py +@@ -31,7 +31,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: ed18c2ab79e8b94182d5dcf31d58457763f3e3e1 +-- +2.40.1 + diff --git a/recipes/libsystemd/all/test_package/CMakeLists.txt b/recipes/libsystemd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..63d72a88f1cb3 --- /dev/null +++ b/recipes/libsystemd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.6) +project(test_package LANGUAGES C) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::SYSTEMD) diff --git a/recipes/libsystemd/all/test_package/conanfile.py b/recipes/libsystemd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4fc0d2de603bc --- /dev/null +++ b/recipes/libsystemd/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def build(self): + cmake = CMake(self) + 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/libsystemd/all/test_package/test_package.c b/recipes/libsystemd/all/test_package/test_package.c new file mode 100644 index 0000000000000..97e8b8389e2a4 --- /dev/null +++ b/recipes/libsystemd/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include + +#include + +int main(void) { + puts("check object path"); + if (sd_bus_object_path_is_valid("/valid/path")) { + puts("ok"); + return EXIT_SUCCESS; + } + puts("failed"); + return EXIT_FAILURE; +} diff --git a/recipes/libsystemd/all/test_v1_package/CMakeLists.txt b/recipes/libsystemd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsystemd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsystemd/all/test_v1_package/conanfile.py b/recipes/libsystemd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/libsystemd/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/libsystemd/config.yml b/recipes/libsystemd/config.yml new file mode 100644 index 0000000000000..83bb58c5a15a2 --- /dev/null +++ b/recipes/libsystemd/config.yml @@ -0,0 +1,15 @@ +versions: + "253.3": + folder: all + "252.9": + folder: all + "251.15": + folder: all + "249.16": + folder: all + "248.12": + folder: all + "247.13": + folder: all + "246.16": + folder: all diff --git a/recipes/libtar/all/conandata.yml b/recipes/libtar/all/conandata.yml new file mode 100644 index 0000000000000..d914d34b5c995 --- /dev/null +++ b/recipes/libtar/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.20": + url: "https://repo.or.cz/libtar.git/snapshot/0907a9034eaf2a57e8e4a9439f793f3f05d446cd.tar.gz" + sha256: "4847207d878e79a4acbe32f096e57cd72c9507171953849e4d7eafe312418d95" diff --git a/recipes/libtar/all/conanfile.py b/recipes/libtar/all/conanfile.py new file mode 100644 index 0000000000000..ee12aac6802cc --- /dev/null +++ b/recipes/libtar/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.54.0" + + +class LibTarConan(ConanFile): + name = "libtar" + description = "libtar is a library for manipulating tar files from within C programs." + topics = ("tar",) + license = "BSD-3-Clause" + homepage = "https://repo.or.cz/libtar.git" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("libtar does not support Windows") + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--with-zlib" if self.options.with_zlib else "--without-zlib", + ]) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + if self.options.with_zlib: + replace_in_file( + self, + os.path.join(self.source_folder, "configure.ac"), + "AC_CHECK_LIB([z], [gzread])", + "AC_CHECK_LIB([{}], [gzread])".format(self.dependencies["zlib"].cpp_info.aggregated_components().libs[0]), + ) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["tar"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libtar/all/test_package/CMakeLists.txt b/recipes/libtar/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..be08382306a84 --- /dev/null +++ b/recipes/libtar/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libtar REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libtar::libtar) diff --git a/recipes/libtar/all/test_package/conanfile.py b/recipes/libtar/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3ca1fe65b7b4d --- /dev/null +++ b/recipes/libtar/all/test_package/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import load +import os +import tarfile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + with tarfile.open("test.tar", "w", format=tarfile.GNU_FORMAT) as f: + import io + bio = io.BytesIO() + bio.write(b"secret text\n") + tarinfo = tarfile.TarInfo("hello_world") + tarinfo.size = bio.tell() + import time + tarinfo.mtime = time.time() + bio.seek(0) + f.addfile(tarinfo, bio) + + if can_run(self): + if os.path.exists("hello_world"): + raise ConanException("file extracted by tar archive should not exist yet") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} test.tar", env="conanrun") + if not os.path.exists("hello_world"): + raise ConanException("file not extracted") + extracted_text = load(self, "hello_world") + if extracted_text != "secret text\n": + raise ConanException(f"File not loaded correctly. Got \"{repr(extracted_text)}\"") + + self.run("libtar -t test.tar", env="conanrun") diff --git a/recipes/libtar/all/test_package/test_package.c b/recipes/libtar/all/test_package/test_package.c new file mode 100644 index 0000000000000..c23a2ca6b40c4 --- /dev/null +++ b/recipes/libtar/all/test_package/test_package.c @@ -0,0 +1,40 @@ +#include + +#include +#include +#include + +#if defined(_MSC_VER) +# include +#else +# include +#endif + +int main(int argc, const char *argv[]) { + if (argc != 2) { + fprintf(stderr, "Need one argument\n"); + return 1; + } + TAR *handle; + tartype_t *type = NULL; + const int oflags = O_RDONLY; + const int mode = 0755; + const int options = TAR_GNU | TAR_VERBOSE | TAR_CHECK_MAGIC; + if (tar_open(&handle, argv[1], type, oflags, mode, options) < 0) { + fprintf(stderr, "tar_open failed: errno = %d\n", errno); + return 1; + } + if (th_read(handle) < 0) { + fprintf(stderr, "th_read failed\n"); + return 1; + } + if (tar_extract_file(handle, "hello_world") < 0) { + fprintf(stderr, "tar_extract failed\n"); + return 1; + } + if (tar_close(handle) < 0) { + fprintf(stderr, "tar_close failed\n"); + return 1; + } + return 0; +} diff --git a/recipes/libtar/all/test_v1_package/CMakeLists.txt b/recipes/libtar/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libtar/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libtar/all/test_v1_package/conanfile.py b/recipes/libtar/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ace7da972a9e0 --- /dev/null +++ b/recipes/libtar/all/test_v1_package/conanfile.py @@ -0,0 +1,39 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os +import tarfile + + +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): + with tarfile.open("test.tar", "w", format=tarfile.GNU_FORMAT) as f: + import io + bio = io.BytesIO() + bio.write(b"secret text\n") + tarinfo = tarfile.TarInfo("hello_world") + tarinfo.size = bio.tell() + import time + tarinfo.mtime = time.time() + bio.seek(0) + f.addfile(tarinfo, bio) + + if not tools.cross_building(self): + if os.path.exists("hello_world"): + raise ConanException("file extracted by tar archive should not exist yet") + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} test.tar", run_environment=True) + if not os.path.exists("hello_world"): + raise ConanException("file not extracted") + extracted_text = tools.load("hello_world") + if extracted_text != "secret text\n": + raise ConanException(f"File not loaded correctly. Got \"{repr(extracted_text)}\"") + + self.run("libtar -t test.tar", run_environment=True) diff --git a/recipes/libtar/config.yml b/recipes/libtar/config.yml new file mode 100644 index 0000000000000..6d46bd5795339 --- /dev/null +++ b/recipes/libtar/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.20": + folder: "all" diff --git a/recipes/libtasn1/all/conandata.yml b/recipes/libtasn1/all/conandata.yml new file mode 100644 index 0000000000000..4c2bc670569f5 --- /dev/null +++ b/recipes/libtasn1/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "4.16.0": + url: "https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.16.0.tar.gz" + sha256: "0e0fb0903839117cb6e3b56e68222771bebf22ad7fc2295a0ed7d576e8d4329d" +patches: + "4.16.0": + - patch_file: "patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch" diff --git a/recipes/libtasn1/all/conanfile.py b/recipes/libtasn1/all/conanfile.py new file mode 100644 index 0000000000000..069830d3c9f36 --- /dev/null +++ b/recipes/libtasn1/all/conanfile.py @@ -0,0 +1,101 @@ +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.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class LibTasn1Conan(ConanFile): + name = "libtasn1" + homepage = "https://www.gnu.org/software/libtasn1/" + description = "Libtasn1 is the ASN.1 library used by GnuTLS, p11-kit and some other packages." + topics = ("ASN.1", "cryptography") + url = "https://github.com/conan-io/conan-center-index" + license = "LGPL-2.1-or-later" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio") + + def build_requirements(self): + self.tool_requires("bison/3.8.2") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if not is_msvc(self): + tc.extra_cflags.append("-std=c99") + tc.configure_args.append("--disable-doc") + # Workaround against SIP on macOS + if self.settings.os == "Macos" and self.options.shared: + tc.extra_ldflags.append("-Wl,-rpath,@loader_path/../lib") + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libtasn1") + self.cpp_info.libs = ["tasn1"] + if not self.options.shared: + self.cpp_info.defines = ["ASN1_STATIC"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libtasn1/all/patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch b/recipes/libtasn1/all/patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch new file mode 100644 index 0000000000000..d0ae27fa86b3b --- /dev/null +++ b/recipes/libtasn1/all/patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch @@ -0,0 +1,11 @@ +--- config.h.in ++++ config.h.in +@@ -380,7 +380,7 @@ + # define _GL_EXTERN_INLINE_IN_USE + #else + # define _GL_INLINE static _GL_UNUSED +-# define _GL_EXTERN_INLINE static _GL_UNUSED ++# define _GL_EXTERN_INLINE _GL_UNUSED + #endif + + /* In GCC 4.6 (inclusive) to 5.1 (exclusive), diff --git a/recipes/libtasn1/all/test_package/CMakeLists.txt b/recipes/libtasn1/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a3bf383182c3 --- /dev/null +++ b/recipes/libtasn1/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_program(ASN1_PARSER NAMES asn1Parser) +if(NOT ASN1_PARSER) + message(FATAL_ERROR "asn1Parser not found") +endif() +find_package(libtasn1 REQUIRED CONFIG) + +set(PKIX_ASN1_TAB_C "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c") +set(PKIX_ASN_IN "${CMAKE_CURRENT_SOURCE_DIR}/pkix.asn") +add_custom_command( + COMMAND ${ASN1_PARSER} -o ${PKIX_ASN1_TAB_C} ${PKIX_ASN_IN} + OUTPUT ${PKIX_ASN1_TAB_C} + DEPENDS ${PKIX_ASN_IN} +) +add_custom_target(pkix_asn DEPENDS ${PKIX_ASN1_TAB_C}) + +add_executable(${PROJECT_NAME} test_package.c ${PKIX_ASN1_TAB_C}) +target_link_libraries(${PROJECT_NAME} PRIVATE libtasn1::libtasn1) +add_dependencies(${PROJECT_NAME} pkix_asn) diff --git a/recipes/libtasn1/all/test_package/conanfile.py b/recipes/libtasn1/all/test_package/conanfile.py new file mode 100644 index 0000000000000..dd6d9808a7b5d --- /dev/null +++ b/recipes/libtasn1/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=not cross_building(self)) + + def build_requirements(self): + if cross_building(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + VirtualRunEnv(self).generate() + if cross_building(self): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + asn = os.path.join(self.source_folder, "pkix.asn") + self.run(f"{bin_path} {asn}", env="conanrun") diff --git a/recipes/libtasn1/all/test_package/pkix.asn b/recipes/libtasn1/all/test_package/pkix.asn new file mode 100644 index 0000000000000..973bdcb947dc6 --- /dev/null +++ b/recipes/libtasn1/all/test_package/pkix.asn @@ -0,0 +1,954 @@ +-- Copyright (C) 2002-2014 Free Software Foundation, Inc. +-- +-- This file is part of LIBTASN1. +-- +-- 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 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +PKIX1Implicit88 {iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-implicit-88(2)} + +DEFINITIONS IMPLICIT TAGS ::= + +BEGIN + +-- ISO arc for standard certificate and CRL extensions + +id-ce OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 29} + + +-- authority key identifier OID and syntax + +id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 } + +AuthorityKeyIdentifier ::= SEQUENCE { + keyIdentifier [0] KeyIdentifier OPTIONAL, + authorityCertIssuer [1] GeneralNames OPTIONAL, + authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL } + -- authorityCertIssuer and authorityCertSerialNumber shall both + -- be present or both be absgent + +KeyIdentifier ::= OCTET STRING + +-- subject key identifier OID and syntax + +id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 } + +SubjectKeyIdentifier ::= KeyIdentifier + +-- key usage extension OID and syntax + +id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 } + +KeyUsage ::= BIT STRING { + digitalSignature (0), + nonRepudiation (1), + keyEncipherment (2), + dataEncipherment (3), + keyAgreement (4), + keyCertSign (5), + cRLSign (6), + encipherOnly (7), + decipherOnly (8) } + +-- private key usage period extension OID and syntax + +id-ce-privateKeyUsagePeriod OBJECT IDENTIFIER ::= { id-ce 16 } + +PrivateKeyUsagePeriod ::= SEQUENCE { + notBefore [0] GeneralizedTime OPTIONAL, + notAfter [1] GeneralizedTime OPTIONAL } + -- either notBefore or notAfter shall be present + +-- certificate policies extension OID and syntax + +id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 } + +CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation + +PolicyInformation ::= SEQUENCE { + policyIdentifier CertPolicyId, + policyQualifiers SEQUENCE SIZE (1..MAX) OF + PolicyQualifierInfo OPTIONAL } + +CertPolicyId ::= OBJECT IDENTIFIER + +PolicyQualifierInfo ::= SEQUENCE { + policyQualifierId PolicyQualifierId, + qualifier ANY DEFINED BY policyQualifierId } + +-- Implementations that recognize additional policy qualifiers shall +-- augment the following definition for PolicyQualifierId + +PolicyQualifierId ::= + OBJECT IDENTIFIER -- ( id-qt-cps | id-qt-unotice ) + +-- CPS pointer qualifier + +CPSuri ::= IA5String + +-- user notice qualifier + +UserNotice ::= SEQUENCE { + noticeRef NoticeReference OPTIONAL, + explicitText DisplayText OPTIONAL} + +NoticeReference ::= SEQUENCE { + organization DisplayText, + noticeNumbers SEQUENCE OF INTEGER } + +DisplayText ::= CHOICE { + visibleString VisibleString (SIZE (1..200)), + bmpString BMPString (SIZE (1..200)), + utf8String UTF8String (SIZE (1..200)) } + +-- policy mapping extension OID and syntax + +id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 } + +PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE { + issuerDomainPolicy CertPolicyId, + subjectDomainPolicy CertPolicyId } + +-- subject alternative name extension OID and syntax + +id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 } + +SubjectAltName ::= GeneralNames + +GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName + +GeneralName ::= CHOICE { + otherName [0] AnotherName, + rfc822Name [1] IA5String, + dNSName [2] IA5String, + x400Address [3] ORAddress, + directoryName [4] Name, + ediPartyName [5] EDIPartyName, + uniformResourceIdentifier [6] IA5String, + iPAddress [7] OCTET STRING, + registeredID [8] OBJECT IDENTIFIER } + +-- AnotherName replaces OTHER-NAME ::= TYPE-IDENTIFIER, as +-- TYPE-IDENTIFIER is not supported in the '88 ASN.1 syntax + +AnotherName ::= SEQUENCE { + type-id OBJECT IDENTIFIER, + value [0] EXPLICIT ANY DEFINED BY type-id } + +EDIPartyName ::= SEQUENCE { + nameAssigner [0] DirectoryString OPTIONAL, + partyName [1] DirectoryString } + +-- issuer alternative name extension OID and syntax + +id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 } + +IssuerAltName ::= GeneralNames + +id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::= { id-ce 9 } + +SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute + +-- basic constraints extension OID and syntax + +id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 } + +BasicConstraints ::= SEQUENCE { + cA BOOLEAN DEFAULT FALSE, + pathLenConstraint INTEGER (0..MAX) OPTIONAL } + +-- name constraints extension OID and syntax + +id-ce-nameConstraints OBJECT IDENTIFIER ::= { id-ce 30 } + +NameConstraints ::= SEQUENCE { + permittedSubtrees [0] GeneralSubtrees OPTIONAL, + excludedSubtrees [1] GeneralSubtrees OPTIONAL } + +GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree + +GeneralSubtree ::= SEQUENCE { + base GeneralName, + minimum [0] BaseDistance DEFAULT 0, + maximum [1] BaseDistance OPTIONAL } + +BaseDistance ::= INTEGER (0..MAX) + +-- policy constraints extension OID and syntax + +id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 } + +PolicyConstraints ::= SEQUENCE { + requireExplicitPolicy [0] SkipCerts OPTIONAL, + inhibitPolicyMapping [1] SkipCerts OPTIONAL } + +SkipCerts ::= INTEGER (0..MAX) + +-- CRL distribution points extension OID and syntax + +id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= {id-ce 31} + +CRLDistPointsSyntax ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint + +DistributionPoint ::= SEQUENCE { + distributionPoint [0] DistributionPointName OPTIONAL, + reasons [1] ReasonFlags OPTIONAL, + cRLIssuer [2] GeneralNames OPTIONAL } + +DistributionPointName ::= CHOICE { + fullName [0] GeneralNames, + nameRelativeToCRLIssuer [1] RelativeDistinguishedName } + + + +ReasonFlags ::= BIT STRING { + unused (0), + keyCompromise (1), + cACompromise (2), + affiliationChanged (3), + superseded (4), + cessationOfOperation (5), + certificateHold (6) } + +-- extended key usage extension OID and syntax + +id-ce-extKeyUsage OBJECT IDENTIFIER ::= {id-ce 37} + +ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId + +KeyPurposeId ::= OBJECT IDENTIFIER + +-- extended key purpose OIDs +id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } +id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } +id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } +id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } +id-kp-ipsecEndSystem OBJECT IDENTIFIER ::= { id-kp 5 } +id-kp-ipsecTunnel OBJECT IDENTIFIER ::= { id-kp 6 } +id-kp-ipsecUser OBJECT IDENTIFIER ::= { id-kp 7 } +id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } + +-- authority info access + +id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 } + +AuthorityInfoAccessSyntax ::= + SEQUENCE SIZE (1..MAX) OF AccessDescription + +AccessDescription ::= SEQUENCE { + accessMethod OBJECT IDENTIFIER, + accessLocation GeneralName } + +-- CRL number extension OID and syntax + +id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 } + +CRLNumber ::= INTEGER (0..MAX) + +-- issuing distribution point extension OID and syntax + +id-ce-issuingDistributionPoint OBJECT IDENTIFIER ::= { id-ce 28 } + +IssuingDistributionPoint ::= SEQUENCE { + distributionPoint [0] DistributionPointName OPTIONAL, + onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE, + onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE, + onlySomeReasons [3] ReasonFlags OPTIONAL, + indirectCRL [4] BOOLEAN DEFAULT FALSE } + + +id-ce-deltaCRLIndicator OBJECT IDENTIFIER ::= { id-ce 27 } + +-- deltaCRLIndicator ::= BaseCRLNumber + +BaseCRLNumber ::= CRLNumber + +-- CRL reasons extension OID and syntax + +id-ce-cRLReasons OBJECT IDENTIFIER ::= { id-ce 21 } + +CRLReason ::= ENUMERATED { + unspecified (0), + keyCompromise (1), + cACompromise (2), + affiliationChanged (3), + superseded (4), + cessationOfOperation (5), + certificateHold (6), + removeFromCRL (8) } + +-- certificate issuer CRL entry extension OID and syntax + +id-ce-certificateIssuer OBJECT IDENTIFIER ::= { id-ce 29 } + +CertificateIssuer ::= GeneralNames + +-- hold instruction extension OID and syntax + +id-ce-holdInstructionCode OBJECT IDENTIFIER ::= { id-ce 23 } + +HoldInstructionCode ::= OBJECT IDENTIFIER + +-- ANSI x9 holdinstructions + +-- ANSI x9 arc holdinstruction arc +holdInstruction OBJECT IDENTIFIER ::= + {joint-iso-itu-t(2) member-body(2) us(840) x9cm(10040) 2} + +-- ANSI X9 holdinstructions referenced by this standard +id-holdinstruction-none OBJECT IDENTIFIER ::= + {holdInstruction 1} -- deprecated +id-holdinstruction-callissuer OBJECT IDENTIFIER ::= + {holdInstruction 2} +id-holdinstruction-reject OBJECT IDENTIFIER ::= + {holdInstruction 3} + +-- invalidity date CRL entry extension OID and syntax + +id-ce-invalidityDate OBJECT IDENTIFIER ::= { id-ce 24 } + +InvalidityDate ::= GeneralizedTime + + +-- -------------------------------------- +-- EXPLICIT +-- -------------------------------------- + +-- UNIVERSAL Types defined in '93 and '98 ASN.1 +-- but required by this specification + +VisibleString ::= [UNIVERSAL 26] IMPLICIT OCTET STRING + +NumericString ::= [UNIVERSAL 18] IMPLICIT OCTET STRING + +IA5String ::= [UNIVERSAL 22] IMPLICIT OCTET STRING + +TeletexString ::= [UNIVERSAL 20] IMPLICIT OCTET STRING + +PrintableString ::= [UNIVERSAL 19] IMPLICIT OCTET STRING + +UniversalString ::= [UNIVERSAL 28] IMPLICIT OCTET STRING + -- UniversalString is defined in ASN.1:1993 + +BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING + -- BMPString is the subtype of UniversalString and models + -- the Basic Multilingual Plane of ISO/IEC/ITU 10646-1 + +UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING + -- The content of this type conforms to RFC 2279. + + +-- PKIX specific OIDs + +id-pkix OBJECT IDENTIFIER ::= + { iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) } + +-- PKIX arcs + +id-pe OBJECT IDENTIFIER ::= { id-pkix 1 } + -- arc for private certificate extensions +id-qt OBJECT IDENTIFIER ::= { id-pkix 2 } + -- arc for policy qualifier types +id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } + -- arc for extended key purpose OIDS +id-ad OBJECT IDENTIFIER ::= { id-pkix 48 } + -- arc for access descriptors + +-- policyQualifierIds for Internet policy qualifiers + +id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 } + -- OID for CPS qualifier +id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 } + -- OID for user notice qualifier + +-- access descriptor definitions + +id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 } +id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 } + +-- attribute data types -- + +Attribute ::= SEQUENCE { + type AttributeType, + values SET OF AttributeValue + -- at least one value is required -- +} + +AttributeType ::= OBJECT IDENTIFIER + +AttributeValue ::= ANY + +AttributeTypeAndValue ::= SEQUENCE { + type AttributeType, + value AttributeValue } + +-- suggested naming attributes: Definition of the following +-- information object set may be augmented to meet local +-- requirements. Note that deleting members of the set may +-- prevent interoperability with conforming implementations. +-- presented in pairs: the AttributeType followed by the +-- type definition for the corresponding AttributeValue + +-- Arc for standard naming attributes +id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} + +-- Attributes of type NameDirectoryString +id-at-name AttributeType ::= {id-at 41} +id-at-surname AttributeType ::= {id-at 4} +id-at-givenName AttributeType ::= {id-at 42} +id-at-initials AttributeType ::= {id-at 43} +id-at-generationQualifier AttributeType ::= {id-at 44} + +X520name ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-name)), + printableString PrintableString (SIZE (1..ub-name)), + universalString UniversalString (SIZE (1..ub-name)), + utf8String UTF8String (SIZE (1..ub-name)), + bmpString BMPString (SIZE(1..ub-name)) } + +-- + +id-at-commonName AttributeType ::= {id-at 3} + +X520CommonName ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-common-name)), + printableString PrintableString (SIZE (1..ub-common-name)), + universalString UniversalString (SIZE (1..ub-common-name)), + utf8String UTF8String (SIZE (1..ub-common-name)), + bmpString BMPString (SIZE(1..ub-common-name)) } + +-- + +id-at-localityName AttributeType ::= {id-at 7} + +X520LocalityName ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-locality-name)), + printableString PrintableString (SIZE (1..ub-locality-name)), + universalString UniversalString (SIZE (1..ub-locality-name)), + utf8String UTF8String (SIZE (1..ub-locality-name)), + bmpString BMPString (SIZE(1..ub-locality-name)) } + +-- + +id-at-stateOrProvinceName AttributeType ::= {id-at 8} + +X520StateOrProvinceName ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-state-name)), + printableString PrintableString (SIZE (1..ub-state-name)), + universalString UniversalString (SIZE (1..ub-state-name)), + utf8String UTF8String (SIZE (1..ub-state-name)), + bmpString BMPString (SIZE(1..ub-state-name)) } + +-- + +id-at-organizationName AttributeType ::= {id-at 10} + +X520OrganizationName ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-organization-name)), + printableString PrintableString (SIZE (1..ub-organization-name)), + universalString UniversalString (SIZE (1..ub-organization-name)), + utf8String UTF8String (SIZE (1..ub-organization-name)), + bmpString BMPString (SIZE(1..ub-organization-name)) } + +-- + +id-at-organizationalUnitName AttributeType ::= {id-at 11} + +X520OrganizationalUnitName ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-organizational-unit-name)), + printableString PrintableString + (SIZE (1..ub-organizational-unit-name)), + universalString UniversalString + (SIZE (1..ub-organizational-unit-name)), + utf8String UTF8String (SIZE (1..ub-organizational-unit-name)), + bmpString BMPString (SIZE(1..ub-organizational-unit-name)) } + +-- + +id-at-title AttributeType ::= {id-at 12} + +X520Title ::= CHOICE { + teletexString TeletexString (SIZE (1..ub-title)), + printableString PrintableString (SIZE (1..ub-title)), + universalString UniversalString (SIZE (1..ub-title)), + utf8String UTF8String (SIZE (1..ub-title)), + bmpString BMPString (SIZE(1..ub-title)) } + +-- + +id-at-dnQualifier AttributeType ::= {id-at 46} +X520dnQualifier ::= PrintableString + +id-at-countryName AttributeType ::= {id-at 6} +X520countryName ::= PrintableString (SIZE (2)) -- IS 3166 codes + + -- Legacy attributes + +pkcs-9 OBJECT IDENTIFIER ::= + { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } + +emailAddress AttributeType ::= { pkcs-9 1 } + +Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length)) + +-- naming data types -- + +Name ::= CHOICE { -- only one possibility for now -- + rdnSequence RDNSequence } + +RDNSequence ::= SEQUENCE OF RelativeDistinguishedName + +DistinguishedName ::= RDNSequence + +RelativeDistinguishedName ::= + SET SIZE (1 .. MAX) OF AttributeTypeAndValue + +-- Directory string type -- + +DirectoryString ::= CHOICE { + teletexString TeletexString (SIZE (1..MAX)), + printableString PrintableString (SIZE (1..MAX)), + universalString UniversalString (SIZE (1..MAX)), + utf8String UTF8String (SIZE (1..MAX)), + bmpString BMPString (SIZE(1..MAX)) } + + +-- -------------------------------------------------------- +-- certificate and CRL specific structures begin here +-- -------------------------------------------------------- + +Certificate ::= SEQUENCE { + tbsCertificate TBSCertificate, + signatureAlgorithm AlgorithmIdentifier, + signature BIT STRING } + +TBSCertificate ::= SEQUENCE { + version [0] EXPLICIT Version DEFAULT v1, + serialNumber CertificateSerialNumber, + signature AlgorithmIdentifier, + issuer Name, + validity Validity, + subject Name, + subjectPublicKeyInfo SubjectPublicKeyInfo, + issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, + -- If present, version shall be v2 or v3 + subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, + -- If present, version shall be v2 or v3 + extensions [3] EXPLICIT Extensions OPTIONAL + -- If present, version shall be v3 -- +} + +Version ::= INTEGER { v1(0), v2(1), v3(2) } + +CertificateSerialNumber ::= INTEGER + +Validity ::= SEQUENCE { + notBefore Time, + notAfter Time } + +Time ::= CHOICE { + utcTime UTCTime, + generalTime GeneralizedTime } + +UniqueIdentifier ::= BIT STRING + +SubjectPublicKeyInfo ::= SEQUENCE { + algorithm AlgorithmIdentifier, + subjectPublicKey BIT STRING } + +Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension + +Extension ::= SEQUENCE { + extnID OBJECT IDENTIFIER, + critical BOOLEAN DEFAULT FALSE, + extnValue OCTET STRING } + + +-- ------------------------------------------ +-- CRL structures +-- ------------------------------------------ + +CertificateList ::= SEQUENCE { + tbsCertList TBSCertList, + signatureAlgorithm AlgorithmIdentifier, + signature BIT STRING } + +TBSCertList ::= SEQUENCE { + version Version OPTIONAL, + -- if present, shall be v2 + signature AlgorithmIdentifier, + issuer Name, + thisUpdate Time, + nextUpdate Time OPTIONAL, + revokedCertificates SEQUENCE OF SEQUENCE { + userCertificate CertificateSerialNumber, + revocationDate Time, + crlEntryExtensions Extensions OPTIONAL + -- if present, shall be v2 + } OPTIONAL, + crlExtensions [0] EXPLICIT Extensions OPTIONAL + -- if present, shall be v2 -- +} + +-- Version, Time, CertificateSerialNumber, and Extensions were +-- defined earlier for use in the certificate structure + +AlgorithmIdentifier ::= SEQUENCE { + algorithm OBJECT IDENTIFIER, + parameters ANY DEFINED BY algorithm OPTIONAL } + -- contains a value of the type + -- registered for use with the + -- algorithm object identifier value + +-- Algorithm OIDs and parameter structures + +pkcs-1 OBJECT IDENTIFIER ::= { + iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } + +rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } + +md2WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 2 } + +md5WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 4 } + +sha1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 } + +id-dsa-with-sha1 OBJECT IDENTIFIER ::= { + iso(1) member-body(2) us(840) x9-57 (10040) x9algorithm(4) 3 } + +Dss-Sig-Value ::= SEQUENCE { + r INTEGER, + s INTEGER } + +dhpublicnumber OBJECT IDENTIFIER ::= { + iso(1) member-body(2) us(840) ansi-x942(10046) number-type(2) 1 } + +DomainParameters ::= SEQUENCE { + p INTEGER, -- odd prime, p=jq +1 + g INTEGER, -- generator, g + q INTEGER, -- factor of p-1 + j INTEGER OPTIONAL, -- subgroup factor, j>= 2 + validationParms ValidationParms OPTIONAL } + +ValidationParms ::= SEQUENCE { + seed BIT STRING, + pgenCounter INTEGER } + +id-dsa OBJECT IDENTIFIER ::= { + iso(1) member-body(2) us(840) x9-57(10040) x9algorithm(4) 1 } + +Dss-Parms ::= SEQUENCE { + p INTEGER, + q INTEGER, + g INTEGER } + +-- x400 address syntax starts here +-- OR Names + +ORAddress ::= SEQUENCE { + built-in-standard-attributes BuiltInStandardAttributes, + built-in-domain-defined-attributes + BuiltInDomainDefinedAttributes OPTIONAL, + -- see also teletex-domain-defined-attributes + extension-attributes ExtensionAttributes OPTIONAL } +-- The OR-address is semantically absent from the OR-name if the +-- built-in-standard-attribute sequence is empty and the +-- built-in-domain-defined-attributes and extension-attributes are +-- both omitted. + +-- Built-in Standard Attributes + +BuiltInStandardAttributes ::= SEQUENCE { + country-name CountryName OPTIONAL, + administration-domain-name AdministrationDomainName OPTIONAL, + network-address [0] EXPLICIT NetworkAddress OPTIONAL, + -- see also extended-network-address + terminal-identifier [1] EXPLICIT TerminalIdentifier OPTIONAL, + private-domain-name [2] EXPLICIT PrivateDomainName OPTIONAL, + organization-name [3] EXPLICIT OrganizationName OPTIONAL, + -- see also teletex-organization-name + numeric-user-identifier [4] EXPLICIT NumericUserIdentifier OPTIONAL, + personal-name [5] EXPLICIT PersonalName OPTIONAL, + -- see also teletex-personal-name + organizational-unit-names [6] EXPLICIT OrganizationalUnitNames OPTIONAL + -- see also teletex-organizational-unit-names -- +} + +CountryName ::= [APPLICATION 1] CHOICE { + x121-dcc-code NumericString + (SIZE (ub-country-name-numeric-length)), + iso-3166-alpha2-code PrintableString + (SIZE (ub-country-name-alpha-length)) } + +AdministrationDomainName ::= [APPLICATION 2] EXPLICIT CHOICE { + numeric NumericString (SIZE (0..ub-domain-name-length)), + printable PrintableString (SIZE (0..ub-domain-name-length)) } + +NetworkAddress ::= X121Address -- see also extended-network-address + +X121Address ::= NumericString (SIZE (1..ub-x121-address-length)) + +TerminalIdentifier ::= PrintableString (SIZE (1..ub-terminal-id-length)) + +PrivateDomainName ::= CHOICE { + numeric NumericString (SIZE (1..ub-domain-name-length)), + printable PrintableString (SIZE (1..ub-domain-name-length)) } + +OrganizationName ::= PrintableString + (SIZE (1..ub-organization-name-length)) +-- see also teletex-organization-name + +NumericUserIdentifier ::= NumericString + (SIZE (1..ub-numeric-user-id-length)) + +PersonalName ::= SET { + surname [0] PrintableString (SIZE (1..ub-surname-length)), + given-name [1] PrintableString + (SIZE (1..ub-given-name-length)) OPTIONAL, + initials [2] PrintableString (SIZE (1..ub-initials-length)) OPTIONAL, + generation-qualifier [3] PrintableString + (SIZE (1..ub-generation-qualifier-length)) OPTIONAL } +-- see also teletex-personal-name + +OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units) + OF OrganizationalUnitName +-- see also teletex-organizational-unit-names + +OrganizationalUnitName ::= PrintableString (SIZE + (1..ub-organizational-unit-name-length)) + +-- Built-in Domain-defined Attributes + +BuiltInDomainDefinedAttributes ::= SEQUENCE SIZE + (1..ub-domain-defined-attributes) OF + BuiltInDomainDefinedAttribute + +BuiltInDomainDefinedAttribute ::= SEQUENCE { + type PrintableString (SIZE + (1..ub-domain-defined-attribute-type-length)), + value PrintableString (SIZE + (1..ub-domain-defined-attribute-value-length))} + +-- Extension Attributes + +ExtensionAttributes ::= SET SIZE (1..ub-extension-attributes) OF + ExtensionAttribute + +ExtensionAttribute ::= SEQUENCE { + extension-attribute-type [0] EXPLICIT INTEGER (0..ub-extension-attributes), + extension-attribute-value [1] EXPLICIT + ANY DEFINED BY extension-attribute-type } + +-- Extension types and attribute values +-- + +common-name INTEGER ::= 1 + +CommonName ::= PrintableString (SIZE (1..ub-common-name-length)) + +teletex-common-name INTEGER ::= 2 + +TeletexCommonName ::= TeletexString (SIZE (1..ub-common-name-length)) + +teletex-organization-name INTEGER ::= 3 + +TeletexOrganizationName ::= + TeletexString (SIZE (1..ub-organization-name-length)) + +teletex-personal-name INTEGER ::= 4 + +TeletexPersonalName ::= SET { + surname [0] EXPLICIT TeletexString (SIZE (1..ub-surname-length)), + given-name [1] EXPLICIT TeletexString + (SIZE (1..ub-given-name-length)) OPTIONAL, + initials [2] EXPLICIT TeletexString (SIZE (1..ub-initials-length)) OPTIONAL, + generation-qualifier [3] EXPLICIT TeletexString (SIZE + (1..ub-generation-qualifier-length)) OPTIONAL } + +teletex-organizational-unit-names INTEGER ::= 5 + +TeletexOrganizationalUnitNames ::= SEQUENCE SIZE + (1..ub-organizational-units) OF TeletexOrganizationalUnitName + +TeletexOrganizationalUnitName ::= TeletexString + (SIZE (1..ub-organizational-unit-name-length)) + +pds-name INTEGER ::= 7 + +PDSName ::= PrintableString (SIZE (1..ub-pds-name-length)) + +physical-delivery-country-name INTEGER ::= 8 + +PhysicalDeliveryCountryName ::= CHOICE { + x121-dcc-code NumericString (SIZE (ub-country-name-numeric-length)), + iso-3166-alpha2-code PrintableString + (SIZE (ub-country-name-alpha-length)) } + +postal-code INTEGER ::= 9 + +PostalCode ::= CHOICE { + numeric-code NumericString (SIZE (1..ub-postal-code-length)), + printable-code PrintableString (SIZE (1..ub-postal-code-length)) } + +physical-delivery-office-name INTEGER ::= 10 + +PhysicalDeliveryOfficeName ::= PDSParameter + +physical-delivery-office-number INTEGER ::= 11 + +PhysicalDeliveryOfficeNumber ::= PDSParameter + +extension-OR-address-components INTEGER ::= 12 + +ExtensionORAddressComponents ::= PDSParameter + +physical-delivery-personal-name INTEGER ::= 13 + +PhysicalDeliveryPersonalName ::= PDSParameter + +physical-delivery-organization-name INTEGER ::= 14 + +PhysicalDeliveryOrganizationName ::= PDSParameter + +extension-physical-delivery-address-components INTEGER ::= 15 + +ExtensionPhysicalDeliveryAddressComponents ::= PDSParameter + +unformatted-postal-address INTEGER ::= 16 + +UnformattedPostalAddress ::= SET { + printable-address SEQUENCE SIZE (1..ub-pds-physical-address-lines) OF + PrintableString (SIZE (1..ub-pds-parameter-length)) OPTIONAL, + teletex-string TeletexString + (SIZE (1..ub-unformatted-address-length)) OPTIONAL } + +street-address INTEGER ::= 17 + +StreetAddress ::= PDSParameter + +post-office-box-address INTEGER ::= 18 + +PostOfficeBoxAddress ::= PDSParameter + +poste-restante-address INTEGER ::= 19 + +PosteRestanteAddress ::= PDSParameter + +unique-postal-name INTEGER ::= 20 + +UniquePostalName ::= PDSParameter + +local-postal-attributes INTEGER ::= 21 + +LocalPostalAttributes ::= PDSParameter + +PDSParameter ::= SET { + printable-string PrintableString + (SIZE(1..ub-pds-parameter-length)) OPTIONAL, + teletex-string TeletexString + (SIZE(1..ub-pds-parameter-length)) OPTIONAL } + +extended-network-address INTEGER ::= 22 + +ExtendedNetworkAddress ::= CHOICE { + e163-4-address SEQUENCE { + number [0] EXPLICIT NumericString (SIZE (1..ub-e163-4-number-length)), + sub-address [1] EXPLICIT NumericString + (SIZE (1..ub-e163-4-sub-address-length)) OPTIONAL }, + psap-address [0] EXPLICIT PresentationAddress } + +PresentationAddress ::= SEQUENCE { + pSelector [0] EXPLICIT OCTET STRING OPTIONAL, + sSelector [1] EXPLICIT OCTET STRING OPTIONAL, + tSelector [2] EXPLICIT OCTET STRING OPTIONAL, + nAddresses [3] EXPLICIT SET SIZE (1..MAX) OF OCTET STRING } + +terminal-type INTEGER ::= 23 + +TerminalType ::= INTEGER { + telex (3), + teletex (4), + g3-facsimile (5), + g4-facsimile (6), + ia5-terminal (7), + videotex (8) } (0..ub-integer-options) + +-- Extension Domain-defined Attributes + +teletex-domain-defined-attributes INTEGER ::= 6 + +TeletexDomainDefinedAttributes ::= SEQUENCE SIZE + (1..ub-domain-defined-attributes) OF TeletexDomainDefinedAttribute + +TeletexDomainDefinedAttribute ::= SEQUENCE { + type TeletexString + (SIZE (1..ub-domain-defined-attribute-type-length)), + value TeletexString + (SIZE (1..ub-domain-defined-attribute-value-length)) } + +-- specifications of Upper Bounds shall be regarded as mandatory +-- from Annex B of ITU-T X.411 Reference Definition of MTS Parameter +-- Upper Bounds + +-- Upper Bounds +ub-name INTEGER ::= 32768 +ub-common-name INTEGER ::= 64 +ub-locality-name INTEGER ::= 128 +ub-state-name INTEGER ::= 128 +ub-organization-name INTEGER ::= 64 +ub-organizational-unit-name INTEGER ::= 64 +ub-title INTEGER ::= 64 +ub-match INTEGER ::= 128 + +ub-emailaddress-length INTEGER ::= 128 + +ub-common-name-length INTEGER ::= 64 +ub-country-name-alpha-length INTEGER ::= 2 +ub-country-name-numeric-length INTEGER ::= 3 +ub-domain-defined-attributes INTEGER ::= 4 +ub-domain-defined-attribute-type-length INTEGER ::= 8 +ub-domain-defined-attribute-value-length INTEGER ::= 128 +ub-domain-name-length INTEGER ::= 16 +ub-extension-attributes INTEGER ::= 256 +ub-e163-4-number-length INTEGER ::= 15 +ub-e163-4-sub-address-length INTEGER ::= 40 +ub-generation-qualifier-length INTEGER ::= 3 +ub-given-name-length INTEGER ::= 16 +ub-initials-length INTEGER ::= 5 +ub-integer-options INTEGER ::= 256 +ub-numeric-user-id-length INTEGER ::= 32 +ub-organization-name-length INTEGER ::= 64 +ub-organizational-unit-name-length INTEGER ::= 32 +ub-organizational-units INTEGER ::= 4 +ub-pds-name-length INTEGER ::= 16 +ub-pds-parameter-length INTEGER ::= 30 +ub-pds-physical-address-lines INTEGER ::= 6 +ub-postal-code-length INTEGER ::= 16 +ub-surname-length INTEGER ::= 40 +ub-terminal-id-length INTEGER ::= 24 +ub-unformatted-address-length INTEGER ::= 180 +ub-x121-address-length INTEGER ::= 16 + +-- Note - upper bounds on string types, such as TeletexString, are +-- measured in characters. Excepting PrintableString or IA5String, a +-- significantly greater number of octets will be required to hold +-- such a value. As a minimum, 16 octets, or twice the specified upper +-- bound, whichever is the larger, should be allowed for TeletexString. +-- For UTF8String or UniversalString at least four times the upper +-- bound should be allowed. + + + +END diff --git a/recipes/libtasn1/all/test_package/test_package.c b/recipes/libtasn1/all/test_package/test_package.c new file mode 100644 index 0000000000000..4b97418d31322 --- /dev/null +++ b/recipes/libtasn1/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include "libtasn1.h" + +#include + +int main (int argc, char *argv[]) +{ + ASN1_TYPE PKIX1Implicit88 = ASN1_TYPE_EMPTY; + if (argc != 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + + int result; + char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; + result = asn1_parser2tree(argv[1], &PKIX1Implicit88, errorDescription); + + if (result != ASN1_SUCCESS) { + asn1_perror (result); + fprintf(stderr, "asn1error: %s\n", errorDescription); + return 1; + } + + return 0; +} diff --git a/recipes/libtasn1/all/test_v1_package/CMakeLists.txt b/recipes/libtasn1/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a27809d08ee69 --- /dev/null +++ b/recipes/libtasn1/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +# Note: See https://github.com/conan-io/conan/issues/12237 +# `NO_CMAKE_PATH` is added to avoid searching in `CMAKE_PREFIX_PATH` +# it should find the correct executable by falling back on the `PATH` +# environment variable defined by Conan during the test_package run. +find_program(ASN1_PARSER NAMES asn1Parser NO_CMAKE_PATH) +if(NOT ASN1_PARSER) + message(FATAL_ERROR "asn1Parser not found") +endif() +find_package(libtasn1 REQUIRED CONFIG) + +set(PKIX_ASN1_TAB_C "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c") +set(PKIX_ASN_IN "${CMAKE_CURRENT_SOURCE_DIR}/../test_package/pkix.asn") +add_custom_command( + COMMAND ${ASN1_PARSER} -o ${PKIX_ASN1_TAB_C} ${PKIX_ASN_IN} + OUTPUT ${PKIX_ASN1_TAB_C} + DEPENDS ${PKIX_ASN_IN} +) +add_custom_target(pkix_asn DEPENDS ${PKIX_ASN1_TAB_C}) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c ${PKIX_ASN1_TAB_C}) +target_link_libraries(${PROJECT_NAME} PRIVATE libtasn1::libtasn1) +add_dependencies(${PROJECT_NAME} pkix_asn) diff --git a/recipes/libtasn1/all/test_v1_package/conanfile.py b/recipes/libtasn1/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..efc9236407184 --- /dev/null +++ b/recipes/libtasn1/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +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", "test_package") + asn = os.path.join(self.source_folder, os.pardir, "test_package", "pkix.asn") + self.run(f"{bin_path} {asn}", run_environment=True) diff --git a/recipes/libtasn1/config.yml b/recipes/libtasn1/config.yml new file mode 100644 index 0000000000000..58e8952dc80df --- /dev/null +++ b/recipes/libtasn1/config.yml @@ -0,0 +1,3 @@ +versions: + "4.16.0": + folder: "all" diff --git a/recipes/libtiff/all/conandata.yml b/recipes/libtiff/all/conandata.yml new file mode 100644 index 0000000000000..a3b0e93e72a46 --- /dev/null +++ b/recipes/libtiff/all/conandata.yml @@ -0,0 +1,67 @@ +sources: + "4.5.0": + url: "http://download.osgeo.org/libtiff/tiff-4.5.0.tar.gz" + sha256: "c7a1d9296649233979fa3eacffef3fa024d73d05d589cb622727b5b08c423464" + "4.4.0": + url: "http://download.osgeo.org/libtiff/tiff-4.4.0.tar.gz" + sha256: "917223b37538959aca3b790d2d73aa6e626b688e02dcda272aec24c2f498abed" + "4.3.0": + url: "http://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz" + sha256: "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" + "4.2.0": + url: "http://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz" + sha256: "eb0484e568ead8fa23b513e9b0041df7e327f4ee2d22db5a533929dfc19633cb" + "4.1.0": + url: "http://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz" + sha256: "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634" + "4.0.9": + url: "http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz" + sha256: "6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd" + "4.0.8": + url: "http://download.osgeo.org/libtiff/tiff-4.0.8.tar.gz" + sha256: "59d7a5a8ccd92059913f246877db95a2918e6c04fb9d43fd74e5c3390dac2910" +patches: + "4.5.0": + - patch_file: "patches/4.5.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + "4.4.0": + - patch_file: "patches/4.4.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + "4.3.0": + - patch_file: "patches/4.3.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + "4.2.0": + - patch_file: "patches/4.2.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + "4.1.0": + - patch_file: "patches/4.1.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + - patch_file: "patches/4.1.0-0002-no-libm-mingw.patch" + patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" + patch_type: "portability" + patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" + "4.0.9": + - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" + patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" + patch_type: "portability" + patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" + "4.0.8": + - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" + patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" + patch_type: "portability" + patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" + - patch_file: "patches/4.0.8-0003-file-offsets-bits-mingw.patch" + patch_description: "port to MINGW: enable Large file support by defining _FILE_OFFSET_BITS=64" + patch_type: "portability" + patch_source: "https://gitlab.com/libtiff/libtiff/-/commit/f2a3b020402943f90957552a884788e70ece6cd7" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py new file mode 100644 index 0000000000000..9d78f893c2d31 --- /dev/null +++ b/recipes/libtiff/all/conanfile.py @@ -0,0 +1,199 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibtiffConan(ConanFile): + name = "libtiff" + description = "Library for Tag Image File Format (TIFF)" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "http://www.simplesystems.org/libtiff" + topics = ("tiff", "image", "bigtiff", "tagged-image-file-format") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "lzma": [True, False], + "jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "zlib": [True, False], + "libdeflate": [True, False], + "zstd": [True, False], + "jbig": [True, False], + "webp": [True, False], + "cxx": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "lzma": True, + "jpeg": "libjpeg", + "zlib": True, + "libdeflate": True, + "zstd": True, + "jbig": True, + "webp": True, + "cxx": True, + } + + @property + def _has_webp_option(self): + return Version(self.version) >= "4.0.10" + + @property + def _has_zstd_option(self): + return Version(self.version) >= "4.0.10" + + @property + def _has_libdeflate_option(self): + return Version(self.version) >= "4.2.0" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_webp_option: + del self.options.webp + if not self._has_zstd_option: + del self.options.zstd + if not self._has_libdeflate_option: + del self.options.libdeflate + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.cxx: + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.zlib: + self.requires("zlib/1.2.13") + if self.options.get_safe("libdeflate"): + self.requires("libdeflate/1.18") + if self.options.lzma: + self.requires("xz_utils/5.4.2") + if self.options.jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + if self.options.jbig: + self.requires("jbig/20160605") + if self.options.get_safe("zstd"): + self.requires("zstd/1.5.5") + if self.options.get_safe("webp"): + self.requires("libwebp/1.3.0") + + def validate(self): + if self.options.get_safe("libdeflate") and not self.options.zlib: + raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["lzma"] = self.options.lzma + tc.variables["jpeg"] = bool(self.options.jpeg) + tc.variables["jpeg12"] = False + tc.variables["jbig"] = self.options.jbig + tc.variables["zlib"] = self.options.zlib + if self._has_libdeflate_option: + tc.variables["libdeflate"] = self.options.libdeflate + if self._has_zstd_option: + tc.variables["zstd"] = self.options.zstd + if self._has_webp_option: + tc.variables["webp"] = self.options.webp + if Version(self.version) >= "4.3.0": + tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 + if Version(self.version) >= "4.5.0": + # Disable tools, test, contrib, man & html generation + tc.variables["tiff-tools"] = False + tc.variables["tiff-tests"] = False + tc.variables["tiff-contrib"] = False + tc.variables["tiff-docs"] = False + tc.variables["cxx"] = self.options.cxx + # BUILD_SHARED_LIBS must be set in command line because defined upstream before project() + tc.cache_variables["BUILD_SHARED_LIBS"] = bool(self.options.shared) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Export symbols of tiffxx for msvc shared + replace_in_file(self, os.path.join(self.source_folder, "libtiff", "CMakeLists.txt"), + "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})", + "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION} WINDOWS_EXPORT_ALL_SYMBOLS ON)") + + # Disable tools, test, contrib, man & html generation + if Version(self.version) < "4.5.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(tools)\nadd_subdirectory(test)\nadd_subdirectory(contrib)\nadd_subdirectory(build)\n" + "add_subdirectory(man)\nadd_subdirectory(html)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + license_file = "COPYRIGHT" if Version(self.version) < "4.5.0" else "LICENSE.md" + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True, keep_path=False) + 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_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "TIFF") + self.cpp_info.set_property("cmake_target_name", "TIFF::TIFF") + self.cpp_info.set_property("pkg_config_name", f"libtiff-{Version(self.version).major}") + suffix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" + if self.options.cxx: + self.cpp_info.libs.append(f"tiffxx{suffix}") + self.cpp_info.libs.append(f"tiff{suffix}") + if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: + self.cpp_info.system_libs.append("m") + + self.cpp_info.requires = [] + if self.options.zlib: + self.cpp_info.requires.append("zlib::zlib") + if self.options.get_safe("libdeflate"): + self.cpp_info.requires.append("libdeflate::libdeflate") + if self.options.lzma: + self.cpp_info.requires.append("xz_utils::xz_utils") + if self.options.jpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.jpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") + if self.options.jbig: + self.cpp_info.requires.append("jbig::jbig") + if self.options.get_safe("zstd"): + self.cpp_info.requires.append("zstd::zstd") + if self.options.get_safe("webp"): + self.cpp_info.requires.append("libwebp::libwebp") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "TIFF" + self.cpp_info.names["cmake_find_package_multi"] = "TIFF" diff --git a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..7b7979045b5a1 --- /dev/null +++ b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch @@ -0,0 +1,38 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -544,12 +544,10 @@ endif() + option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) + if (jbig) + set(JBIG_FOUND 0) +- find_path(JBIG_INCLUDE_DIR jbig.h) +- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) +- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) +- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) ++ find_package(jbig REQUIRED CONFIG) ++ if (1) + set(JBIG_FOUND 1) +- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) ++ set(JBIG_LIBRARIES jbig::jbig) + endif() + endif() + set(JBIG_SUPPORT 0) +@@ -564,7 +562,7 @@ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY}) +-check_function_exists(jbg_newlen HAVE_JBG_NEWLEN) ++set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + +@@ -701,8 +699,8 @@ endif() + if(ZLIB_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) + endif() +-if(JPEG_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) ++if(JPEG_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) + endif() + if(JPEG12_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch new file mode 100644 index 0000000000000..216911511380b --- /dev/null +++ b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,7 +206,9 @@ else() + endif() + + # Find libm, if available +-find_library(M_LIBRARY m) ++if (NOT MINGW) ++ find_library(M_LIBRARY m) ++endif() + + check_include_file(assert.h HAVE_ASSERT_H) + check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch new file mode 100644 index 0000000000000..44a861121db9c --- /dev/null +++ b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -469,7 +469,7 @@ report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER + HOST_BIG_ENDIAN HAVE_IEEEFP) + + # Large file support +-if (UNIX) ++if (UNIX OR MINGW) + # This might not catch every possibility catered for by + # AC_SYS_LARGEFILE. + add_definitions(-D_FILE_OFFSET_BITS=64) diff --git a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..b8a3ec4a4b033 --- /dev/null +++ b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch @@ -0,0 +1,85 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -489,12 +489,10 @@ endif() + option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) + if (jbig) + set(JBIG_FOUND 0) +- find_path(JBIG_INCLUDE_DIR jbig.h) +- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) +- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) +- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) ++ find_package(jbig REQUIRED CONFIG) ++ if (1) + set(JBIG_FOUND 1) +- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) ++ set(JBIG_LIBRARIES jbig::jbig) + endif() + endif() + set(JBIG_SUPPORT 0) +@@ -507,7 +505,7 @@ endif() + + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) +-check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + + # liblzma2 +@@ -523,13 +521,11 @@ endif() + # libzstd + option(zstd "use libzstd (required for ZSTD compression)" ON) + if (zstd) +- find_path(ZSTD_INCLUDE_DIR zstd.h) +- find_library(ZSTD_LIBRARY NAMES zstd) +- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) +- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) ++ find_package(zstd REQUIRED CONFIG) ++ if (1) ++ set(ZSTD_RECENT_ENOUGH TRUE) + if (ZSTD_RECENT_ENOUGH) + set(ZSTD_FOUND TRUE) +- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) + message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") + else () + message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") +@@ -544,15 +540,13 @@ endif() + # libwebp + option(webp "use libwebp (required for WEBP compression)" ON) + if (webp) +- find_path(WEBP_INCLUDE_DIR /webp/decode.h) +- find_library(WEBP_LIBRARY NAMES webp) ++ find_package(WebP REQUIRED CONFIG) + endif() + set(WEBP_SUPPORT 0) +-set(WEBP_FOUND FALSE) +-if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) ++if (WebP_FOUND) + set(WEBP_SUPPORT 1) + set(WEBP_FOUND TRUE) +- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) ++ set(WEBP_LIBRARIES WebP::webp) + message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") + endif() + +@@ -681,8 +675,8 @@ endif() + if(ZLIB_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) + endif() +-if(JPEG_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) ++if(JPEG_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) + endif() + if(JPEG12_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) +@@ -693,8 +687,8 @@ endif() + if(LIBLZMA_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) + endif() +-if(ZSTD_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) ++if(ZSTD_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + if(WEBP_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch new file mode 100644 index 0000000000000..0fcf8f5711810 --- /dev/null +++ b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -207,7 +207,9 @@ else() + endif() + + # Find libm, if available +-find_library(M_LIBRARY m) ++if (NOT MINGW) ++ find_library(M_LIBRARY m) ++endif() + + check_include_file(assert.h HAVE_ASSERT_H) + check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..7b04f533eb0f4 --- /dev/null +++ b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch @@ -0,0 +1,102 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -463,12 +463,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ON) + if (libdeflate) + set(DEFLATE_FOUND 0) +- find_path(DEFLATE_INCLUDE_DIR libdeflate.h) +- set(DEFLATE_NAMES ${DEFLATE_NAMES} deflate) +- find_library(DEFLATE_LIBRARY NAMES ${DEFLATE_NAMES}) +- if (DEFLATE_INCLUDE_DIR AND DEFLATE_LIBRARY) ++ find_package(libdeflate REQUIRED CONFIG) ++ if (1) + set(DEFLATE_FOUND 1) +- set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY}) ++ set(DEFLATE_LIBRARIES $,libdeflate::libdeflate,libdeflate::libdeflate_static>) + endif() + endif() + set(LIBDEFLATE_SUPPORT FALSE) +@@ -517,12 +515,10 @@ endif() + option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) + if (jbig) + set(JBIG_FOUND 0) +- find_path(JBIG_INCLUDE_DIR jbig.h) +- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) +- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) +- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) ++ find_package(jbig REQUIRED CONFIG) ++ if (1) + set(JBIG_FOUND 1) +- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) ++ set(JBIG_LIBRARIES jbig::jbig) + endif() + endif() + set(JBIG_SUPPORT 0) +@@ -535,7 +531,7 @@ endif() + + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) +-check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + + # liblzma2 +@@ -551,14 +547,11 @@ endif() + # libzstd + option(zstd "use libzstd (required for ZSTD compression)" ON) + if (zstd) +- find_path(ZSTD_INCLUDE_DIR zstd.h) +- find_library(ZSTD_LIBRARY NAMES zstd) +- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) +- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) ++ find_package(zstd REQUIRED CONFIG) ++ if (1) ++ set(ZSTD_RECENT_ENOUGH TRUE) + if (ZSTD_RECENT_ENOUGH) + set(ZSTD_FOUND TRUE) +- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) +- message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") + else () + message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") + endif () +@@ -572,15 +565,13 @@ endif() + # libwebp + option(webp "use libwebp (required for WEBP compression)" ON) + if (webp) +- find_path(WEBP_INCLUDE_DIR /webp/decode.h) +- find_library(WEBP_LIBRARY NAMES webp) ++ find_package(WebP REQUIRED CONFIG) + endif() + set(WEBP_SUPPORT 0) +-set(WEBP_FOUND FALSE) +-if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) ++if (WebP_FOUND) + set(WEBP_SUPPORT 1) + set(WEBP_FOUND TRUE) +- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) ++ set(WEBP_LIBRARIES WebP::webp) + message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") + endif() + +@@ -715,8 +706,8 @@ endif() + if(DEFLATE_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES}) + endif() +-if(JPEG_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) ++if(JPEG_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) + endif() + if(JPEG12_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) +@@ -727,8 +718,8 @@ endif() + if(LIBLZMA_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) + endif() +-if(ZSTD_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) ++if(ZSTD_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + if(WEBP_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..497c6171bba32 --- /dev/null +++ b/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch @@ -0,0 +1,91 @@ +--- a/cmake/DeflateCodec.cmake ++++ b/cmake/DeflateCodec.cmake +@@ -35,7 +35,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) + + # libdeflate + set(LIBDEFLATE_SUPPORT FALSE) +-find_package(Deflate) ++find_package(libdeflate CONFIG) ++if(libdeflate_FOUND) ++ set(Deflate_FOUND TRUE) ++endif() + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND}) + if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT) + set(LIBDEFLATE_SUPPORT TRUE) +--- a/cmake/JBIGCodec.cmake ++++ b/cmake/JBIGCodec.cmake +@@ -27,14 +27,17 @@ + # JBIG-KIT + set(JBIG_SUPPORT FALSE) + +-find_package(JBIG) ++find_package(jbig CONFIG) ++if(jbig_FOUND) ++ set(JBIG_FOUND TRUE) ++endif() + + if(JBIG_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) +- check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++ set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() +--- a/cmake/ZSTDCodec.cmake ++++ b/cmake/ZSTDCodec.cmake +@@ -28,14 +28,17 @@ + set(ZSTD_SUPPORT FALSE) + set(ZSTD_USABLE FALSE) + +-find_package(ZSTD) ++find_package(zstd CONFIG) ++if(zstd_FOUND) ++ set(ZSTD_FOUND TRUE) ++endif() + + if(ZSTD_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES}) +- check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_RECENT_ENOUGH) ++ set(ZSTD_RECENT_ENOUGH TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + +--- a/libtiff/CMakeLists.txt ++++ b/libtiff/CMakeLists.txt +@@ -110,7 +110,7 @@ if(ZIP_SUPPORT) + target_link_libraries(tiff PRIVATE ZLIB::ZLIB) + endif() + if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) +- target_link_libraries(tiff PRIVATE Deflate::Deflate) ++ target_link_libraries(tiff PRIVATE $,libdeflate::libdeflate,libdeflate::libdeflate_static>) + endif() + if(JPEG_SUPPORT) + target_link_libraries(tiff PRIVATE JPEG::JPEG) +@@ -120,7 +120,7 @@ if(JPEG_SUPPORT) + endif() + endif() + if(JBIG_SUPPORT) +- target_link_libraries(tiff PRIVATE JBIG::JBIG) ++ target_link_libraries(tiff PRIVATE jbig::jbig) + endif() + if(LERC_SUPPORT) + target_link_libraries(tiff PRIVATE LERC::LERC) +@@ -129,10 +129,10 @@ if(LZMA_SUPPORT) + target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA) + endif() + if(ZSTD_SUPPORT) +- target_link_libraries(tiff PRIVATE ZSTD::ZSTD) ++ target_link_libraries(tiff PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + if(WEBP_SUPPORT) +- target_link_libraries(tiff PRIVATE WebP::WebP) ++ target_link_libraries(tiff PRIVATE WebP::webp) + endif() + target_link_libraries(tiff PRIVATE CMath::CMath) + diff --git a/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..e2a9148325180 --- /dev/null +++ b/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch @@ -0,0 +1,92 @@ +--- a/cmake/DeflateCodec.cmake ++++ b/cmake/DeflateCodec.cmake +@@ -35,7 +35,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) + + # libdeflate + set(LIBDEFLATE_SUPPORT FALSE) +-find_package(Deflate) ++find_package(libdeflate CONFIG) ++if(libdeflate_FOUND) ++ set(Deflate_FOUND TRUE) ++endif() + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND}) + if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT) + set(LIBDEFLATE_SUPPORT TRUE) +--- a/cmake/JBIGCodec.cmake ++++ b/cmake/JBIGCodec.cmake +@@ -27,14 +27,17 @@ + # JBIG-KIT + set(JBIG_SUPPORT FALSE) + +-find_package(JBIG) ++find_package(jbig CONFIG) ++if(jbig_FOUND) ++ set(JBIG_FOUND TRUE) ++endif() + + if(JBIG_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) +- check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++ set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() +--- a/cmake/ZSTDCodec.cmake ++++ b/cmake/ZSTDCodec.cmake +@@ -28,14 +28,17 @@ + set(ZSTD_SUPPORT FALSE) + set(ZSTD_USABLE FALSE) + +-find_package(ZSTD) ++find_package(zstd CONFIG) ++if(zstd_FOUND) ++ set(ZSTD_FOUND TRUE) ++endif() + + if(ZSTD_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES}) +- check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_RECENT_ENOUGH) ++ set(ZSTD_RECENT_ENOUGH TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + +--- a/libtiff/CMakeLists.txt ++++ b/libtiff/CMakeLists.txt +@@ -114,7 +114,7 @@ if(ZIP_SUPPORT) + string(APPEND tiff_requires_private " zlib") + endif() + if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) +- target_link_libraries(tiff PRIVATE Deflate::Deflate) ++ target_link_libraries(tiff PRIVATE $,libdeflate::libdeflate,libdeflate::libdeflate_static>) + list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") + endif() + if(JPEG_SUPPORT) +@@ -126,7 +126,7 @@ if(JPEG_SUPPORT) + endif() + endif() + if(JBIG_SUPPORT) +- target_link_libraries(tiff PRIVATE JBIG::JBIG) ++ target_link_libraries(tiff PRIVATE jbig::jbig) + list(APPEND tiff_libs_private_list "${JBIG_LIBRARY}") + endif() + if(LERC_SUPPORT) +@@ -141,11 +141,11 @@ if(LZMA_SUPPORT) + string(APPEND tiff_requires_private " liblzma") + endif() + if(ZSTD_SUPPORT) +- target_link_libraries(tiff PRIVATE ZSTD::ZSTD) ++ target_link_libraries(tiff PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + string(APPEND tiff_requires_private " libzstd") + endif() + if(WEBP_SUPPORT) +- target_link_libraries(tiff PRIVATE WebP::WebP) ++ target_link_libraries(tiff PRIVATE WebP::webp) + string(APPEND tiff_requires_private " libwebp") + endif() + target_link_libraries(tiff PRIVATE CMath::CMath) diff --git a/recipes/libtiff/all/patches/4.5.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.5.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..7780017230ea1 --- /dev/null +++ b/recipes/libtiff/all/patches/4.5.0-0001-cmake-dependencies.patch @@ -0,0 +1,116 @@ +--- a/cmake/DeflateCodec.cmake ++++ b/cmake/DeflateCodec.cmake +@@ -35,7 +35,10 @@ set(LIBDEFLATE_SUPPORT FALSE) + + # libdeflate + set(LIBDEFLATE_SUPPORT FALSE) +-find_package(Deflate) ++find_package(libdeflate CONFIG) ++if(libdeflate_FOUND) ++ set(Deflate_FOUND TRUE) ++endif() + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND}) + if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT) + set(LIBDEFLATE_SUPPORT TRUE) +--- a/cmake/JBIGCodec.cmake ++++ b/cmake/JBIGCodec.cmake +@@ -27,14 +27,17 @@ set(JBIG_SUPPORT FALSE) + # JBIG-KIT + set(JBIG_SUPPORT FALSE) + +-find_package(JBIG) ++find_package(jbig CONFIG) ++if(jbig_FOUND) ++ set(JBIG_FOUND TRUE) ++endif() + + if(JBIG_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) +- check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++ set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() +--- a/cmake/JPEGCodec.cmake ++++ b/cmake/JPEGCodec.cmake +@@ -47,19 +47,7 @@ + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARIES}") +- check_c_source_compiles( +- " +- #include +- #include +- #include \"jpeglib.h\" +- int main() +- { +- jpeg_read_scanlines(0,0,0); +- jpeg12_read_scanlines(0,0,0); +- return 0; +- } +- " +- HAVE_JPEGTURBO_DUAL_MODE_8_12) ++ set(HAVE_JPEGTURBO_DUAL_MODE_8_12 FALSE) + cmake_pop_check_state() + endif() + +--- a/cmake/ZSTDCodec.cmake ++++ b/cmake/ZSTDCodec.cmake +@@ -28,7 +28,10 @@ set(ZSTD_USABLE FALSE) + set(ZSTD_SUPPORT FALSE) + set(ZSTD_USABLE FALSE) + +-find_package(ZSTD) ++find_package(zstd CONFIG) ++if(zstd_FOUND) ++ set(ZSTD_FOUND TRUE) ++endif() + + if(ZSTD_FOUND) + if(NOT DEFINED ZSTD_HAVE_DECOMPRESS_STREAM) +@@ -36,7 +39,7 @@ if(ZSTD_FOUND) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES}) +- check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_HAVE_DECOMPRESS_STREAM) ++ set(ZSTD_HAVE_DECOMPRESS_STREAM TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() +--- a/libtiff/CMakeLists.txt ++++ b/libtiff/CMakeLists.txt +@@ -116,7 +116,7 @@ if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) + string(APPEND tiff_requires_private " zlib") + endif() + if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) +- target_link_libraries(tiff PRIVATE Deflate::Deflate) ++ target_link_libraries(tiff PRIVATE $,libdeflate::libdeflate,libdeflate::libdeflate_static>) + list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") + endif() + if(JPEG_SUPPORT) +@@ -130,7 +130,7 @@ if(JBIG_SUPPORT) + endif() + endif() + if(JBIG_SUPPORT) +- target_link_libraries(tiff PRIVATE JBIG::JBIG) ++ target_link_libraries(tiff PRIVATE jbig::jbig) + list(APPEND tiff_libs_private_list "${JBIG_LIBRARY}") + endif() + if(LERC_SUPPORT) +@@ -145,11 +145,11 @@ if(ZSTD_SUPPORT) + string(APPEND tiff_requires_private " liblzma") + endif() + if(ZSTD_SUPPORT) +- target_link_libraries(tiff PRIVATE ZSTD::ZSTD) ++ target_link_libraries(tiff PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + string(APPEND tiff_requires_private " libzstd") + endif() + if(WEBP_SUPPORT) +- target_link_libraries(tiff PRIVATE WebP::WebP) ++ target_link_libraries(tiff PRIVATE WebP::webp) + string(APPEND tiff_requires_private " libwebp") + endif() + if(CMath_LIBRARY) diff --git a/recipes/libtiff/all/test_package/CMakeLists.txt b/recipes/libtiff/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd389da928806 --- /dev/null +++ b/recipes/libtiff/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(TIFF REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE TIFF::TIFF) diff --git a/recipes/libtiff/all/test_package/conanfile.py b/recipes/libtiff/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libtiff/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/libtiff/all/test_package/test_package.c b/recipes/libtiff/all/test_package/test_package.c new file mode 100644 index 0000000000000..0b73b99d432d5 --- /dev/null +++ b/recipes/libtiff/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + TIFF* tif = TIFFOpen("foo.tif", "w"); + TIFFClose(tif); + return 0; +} diff --git a/recipes/libtiff/all/test_v1_package/CMakeLists.txt b/recipes/libtiff/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libtiff/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libtiff/all/test_v1_package/conanfile.py b/recipes/libtiff/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libtiff/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libtiff/config.yml b/recipes/libtiff/config.yml new file mode 100644 index 0000000000000..bbe65356cc08b --- /dev/null +++ b/recipes/libtiff/config.yml @@ -0,0 +1,15 @@ +versions: + "4.5.0": + folder: all + "4.4.0": + folder: all + "4.3.0": + folder: all + "4.2.0": + folder: all + "4.1.0": + folder: all + "4.0.9": + folder: all + "4.0.8": + folder: all diff --git a/recipes/libtins/all/CMakeLists.txt b/recipes/libtins/all/CMakeLists.txt new file mode 100644 index 0000000000000..61f3d3b039e2b --- /dev/null +++ b/recipes/libtins/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/libtins/all/conandata.yml b/recipes/libtins/all/conandata.yml new file mode 100644 index 0000000000000..d565c818eeabe --- /dev/null +++ b/recipes/libtins/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.4": + url: "https://github.com/mfontanini/libtins/archive/v4.4.tar.gz" + sha256: "ff0121b4ec070407e29720c801b7e1a972042300d37560a62c57abadc9635634" + "4.3": + url: "https://github.com/mfontanini/libtins/archive/v4.3.tar.gz" + sha256: "c70bce5a41a27258bf0e3ad535d8238fb747d909a4b87ea14620f25dd65828fd" + "4.2": + url: "https://github.com/mfontanini/libtins/archive/v4.2.tar.gz" + sha256: "a9fed73e13f06b06a4857d342bb30815fa8c359d00bd69547e567eecbbb4c3a1" diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py new file mode 100644 index 0000000000000..27984b1647f64 --- /dev/null +++ b/recipes/libtins/all/conanfile.py @@ -0,0 +1,134 @@ +from conans import tools, CMake, ConanFile +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class LibTinsConan(ConanFile): + name = "libtins" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mfontanini/libtins" + description = "High-level, multiplatform C++ network packet sniffing and crafting library." + license = "BSD-2-Clause" + topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ack_tracker": [True, False], + "with_wpa2": [True, False], + "with_dot11": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ack_tracker": True, + "with_wpa2": True, + "with_dot11": True, + } + + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + _cmake = None + + @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): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("libpcap/1.10.1") + if self.options.with_ack_tracker: + self.requires("boost/1.79.0") + if self.options.with_wpa2: + self.requires("openssl/1.1.1q") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _patch_sources(self): + # Use Findlibpcap.cmake from cmake_find_package + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + "FIND_PACKAGE(PCAP REQUIRED)", + "find_package(libpcap REQUIRED)") + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), + "${PCAP_LIBRARY}", + "libpcap::libpcap") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["LIBTINS_BUILD_EXAMPLES"] = False + self._cmake.definitions["LIBTINS_BUILD_TESTS"] = False + + self._cmake.definitions["LIBTINS_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["LIBTINS_ENABLE_CXX11"] = tools.valid_min_cppstd(self, 11) + self._cmake.definitions["LIBTINS_ENABLE_ACK_TRACKER"] = self.options.with_ack_tracker + self._cmake.definitions["LIBTINS_ENABLE_WPA2"] = self.options.with_wpa2 + self._cmake.definitions["LIBTINS_ENABLE_DOT11"] = self.options.with_dot11 + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(os.path.join(self._source_subfolder, "LICENSE"), dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "CMake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"libtins": "libtins::libtins"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libtins") + self.cpp_info.set_property("cmake_target_name", "libtins") + self.cpp_info.set_property("pkg_config_name", "libtins") + self.cpp_info.libs = ["tins"] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("TINS_STATIC") + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + + # 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/libtins/all/test_package/CMakeLists.txt b/recipes/libtins/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e785b2b7bd437 --- /dev/null +++ b/recipes/libtins/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libtins REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package libtins) diff --git a/recipes/libtins/all/test_package/conanfile.py b/recipes/libtins/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a4f1e01b10ec3 --- /dev/null +++ b/recipes/libtins/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import tools, ConanFile, CMake +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/libtins/all/test_package/test_package.cpp b/recipes/libtins/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..54d999bafa1ac --- /dev/null +++ b/recipes/libtins/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +using namespace Tins; + +int main() { + SnifferConfiguration config; + config.set_filter("port 80"); + config.set_promisc_mode(true); + config.set_snap_len(400); +} diff --git a/recipes/libtins/config.yml b/recipes/libtins/config.yml new file mode 100644 index 0000000000000..ce55c187fafe1 --- /dev/null +++ b/recipes/libtins/config.yml @@ -0,0 +1,7 @@ +versions: + "4.4": + folder: all + "4.3": + folder: all + "4.2": + folder: all diff --git a/recipes/libtommath/all/conandata.yml b/recipes/libtommath/all/conandata.yml new file mode 100644 index 0000000000000..ecbf1c3cd0078 --- /dev/null +++ b/recipes/libtommath/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.2.0": + url: "https://github.com/libtom/libtommath/releases/download/v1.2.0/ltm-1.2.0.tar.xz" + sha256: "b7c75eecf680219484055fcedd686064409254ae44bc31a96c5032843c0e18b1" +patches: + "1.2.0": + - patch_file: "patches/0001-enable-building-dll-s-using-makefile-msvc.patch" + base_path: "source_subfolder" diff --git a/recipes/libtommath/all/conanfile.py b/recipes/libtommath/all/conanfile.py new file mode 100644 index 0000000000000..6bdf6dd129d98 --- /dev/null +++ b/recipes/libtommath/all/conanfile.py @@ -0,0 +1,139 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import os + +required_conan_version = ">=1.33.0" + + +class LibTomMathConan(ConanFile): + name = "libtommath" + description = "LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C." + topics = "libtommath", "math", "multiple", "precision" + license = "Unlicense" + homepage = "https://www.libtom.net/" + 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, + } + + exports_sources = "patches/*" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @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: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def build_requirements(self): + if self._settings_build.os == "Windows" and self.settings.compiler != "Visual Studio": + self.build_requires("make/4.3") + if self.settings.compiler != "Visual Studio" and self.settings.os != "Windows" and self.options.shared: + self.build_requires("libtool/2.4.6") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _run_makefile(self, target=None): + target = target or "" + autotools = AutoToolsBuildEnvironment(self) + autotools.libs = [] + if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio": + autotools.link_flags.append("-lcrypt32") + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # FIXME: should be handled by helper + autotools.link_flags.append("-arch arm64") + args = autotools.vars + args.update({ + "PREFIX": self.package_folder, + }) + if self.settings.compiler != "Visual Studio": + if tools.get_env("CC"): + args["CC"] = tools.get_env("CC") + if tools.get_env("LD"): + args["LD"] = tools.get_env("LD") + if tools.get_env("AR"): + args["AR"] = tools.get_env("AR") + + args["LIBTOOL"] = "libtool" + arg_str = " ".join("{}=\"{}\"".format(k, v) for k, v in args.items()) + + with tools.environment_append(args): + with tools.chdir(self._source_subfolder): + if self.settings.compiler == "Visual Studio": + if self.options.shared: + target = "tommath.dll" + else: + target = "tommath.lib" + with tools.vcvars(self): + self.run("nmake -f makefile.msvc {} {}".format( + target, + arg_str, + ), run_environment=True) + else: + if self.settings.os == "Windows": + makefile = "makefile.mingw" + if self.options.shared: + target = "libtommath.dll" + else: + target = "libtommath.a" + else: + if self.options.shared: + makefile = "makefile.shared" + else: + makefile = "makefile.unix" + self.run("{} -f {} {} {} -j{}".format( + tools.get_env("CONAN_MAKE_PROGRAM", "make"), + makefile, + target, + arg_str, + tools.cpu_count(), + ), run_environment=True) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + self._run_makefile() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + if self.settings.os == "Windows": + # The mingw makefile uses `cmd`, which is only available on Windows + self.copy("*.a", src=self._source_subfolder, dst="lib") + self.copy("*.lib", src=self._source_subfolder, dst="lib") + self.copy("*.dll", src=self._source_subfolder, dst="bin") + self.copy("tommath.h", src=self._source_subfolder, dst="include") + else: + self._run_makefile("install") + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + if self.settings.compiler == "Visual Studio" and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "tommath.dll.lib"), + os.path.join(self.package_folder, "lib", "tommath.lib")) + + def package_info(self): + self.cpp_info.libs = ["tommath"] + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["advapi32", "crypt32"] + + self.cpp_info.names["pkg_config"] = "libtommath" diff --git a/recipes/libtommath/all/patches/0001-enable-building-dll-s-using-makefile-msvc.patch b/recipes/libtommath/all/patches/0001-enable-building-dll-s-using-makefile-msvc.patch new file mode 100644 index 0000000000000..8a24dc18457e4 --- /dev/null +++ b/recipes/libtommath/all/patches/0001-enable-building-dll-s-using-makefile-msvc.patch @@ -0,0 +1,146 @@ +--- makefile.msvc ++++ makefile.msvc +@@ -12,13 +12,16 @@ + #The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs + PREFIX = c:\devel + CFLAGS = /Ox ++LDFLAGS = + + #Compilation flags + LTM_CFLAGS = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D__STDC_WANT_SECURE_LIB__=1 /D_CRT_HAS_CXX17=0 /Wall /wd4146 /wd4127 /wd4668 /wd4710 /wd4711 /wd4820 /wd5045 /WX $(CFLAGS) +-LTM_LDFLAGS = advapi32.lib ++LTM_LDFLAGS = $(LDFLAGS) advapi32.lib + +-#Libraries to be created (this makefile builds only static libraries) +-LIBMAIN_S =tommath.lib ++#Libraries to be created ++LIBMAIN_S = tommath.lib ++LIBMAIN_I = tommath.dll.lib ++LIBMAIN_D = tommath.dll + + #List of objects to compile (all goes to tommath.lib) + OBJECTS=bn_cutoffs.obj bn_deprecated.obj bn_mp_2expt.obj bn_mp_abs.obj bn_mp_add.obj bn_mp_add_d.obj bn_mp_addmod.obj \ +@@ -67,15 +70,19 @@ + $(LIBMAIN_S): $(OBJECTS) + lib /out:$(LIBMAIN_S) $(OBJECTS) + ++#Create DLL + import library tommath.dll.lib ++$(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) tommath.def ++ link /dll /out:$(LIBMAIN_D) /implib:$(LIBMAIN_I) /def:tommath.def $(LTM_LDFLAGS) $(OBJECTS) ++ + #Build test suite + test.exe: $(LIBMAIN_S) demo/shared.obj demo/test.obj + cl $(LTM_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTM_LDFLAGS) demo/shared.c demo/test.c /Fe$@ + @echo NOTICE: start the tests by launching test.exe + + test_standalone: test.exe + @echo test_standalone is deprecated, please use make-target 'test.exe' + +-all: $(LIBMAIN_S) test.exe ++all: $(LIBMAIN_S) test.exe $(LIBMAIN_D) + + tune: $(LIBMAIN_S) + $(MAKE) -C etc tune +@@ -85,9 +92,11 @@ clean: + @-cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul + + #Install the library + headers +-install: $(LIBMAIN_S) ++install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" + cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" ++ copy /Y $(LIBMAIN_I) "$(PREFIX)\lib" ++ copy /Y $(LIBMAIN_D) "$(PREFIX)\bin" + copy /Y tommath*.h "$(PREFIX)\include" +--- bn_s_mp_rand_platform.c ++++ bn_s_mp_rand_platform.c +@@ -14,6 +14,12 @@ + arc4random_buf(p, n); + return MP_OKAY; + } ++#else ++static mp_err s_read_arc4random(void *p, size_t n) ++{ ++ (void)p; (void)n; ++ return MP_ERR; ++} + #endif + + #if defined(_WIN32) || defined(_WIN32_WCE) +@@ -46,6 +46,12 @@ + } + return CryptGenRandom(hProv, (DWORD)n, (BYTE *)p) == TRUE ? MP_OKAY : MP_ERR; + } ++#else ++static mp_err s_read_wincsp(void *p, size_t n) ++{ ++ (void)p; (void)n; ++ return MP_ERR; ++} + #endif /* WIN32 */ + + #if !defined(BN_S_READ_WINCSP_C) && defined(__linux__) && defined(__GLIBC_PREREQ) +@@ -73,6 +85,14 @@ + #endif + #endif + ++#ifndef BN_S_READ_GETRANDOM_C ++static mp_err s_read_getrandom(void *p, size_t n) ++{ ++ (void)p; (void)n; ++ return MP_ERR; ++} ++#endif ++ + /* We assume all platforms besides windows provide "/dev/urandom". + * In case yours doesn't, define MP_NO_DEV_URANDOM at compile-time. + */ +@@ -111,6 +131,12 @@ + close(fd); + return MP_OKAY; + } ++#else ++static mp_err s_read_urandom(void *p, size_t n) ++{ ++ (void)p; (void)n; ++ return MP_ERR; ++} + #endif + + #if defined(MP_PRNG_ENABLE_LTM_RNG) +@@ -126,6 +132,12 @@ + if (res != n) return MP_ERR; + return MP_OKAY; + } ++#else ++static mp_err s_read_ltm_rng(void *p, size_t n) ++{ ++ (void)p; (void)n; ++ return MP_ERR; ++} + #endif + + mp_err s_read_arc4random(void *p, size_t n); +--- tommath.def ++++ tommath.def +@@ -102,6 +102,7 @@ + mp_prime_strong_lucas_selfridge + mp_radix_size + mp_rand ++ mp_rand_source + mp_read_radix + mp_reduce + mp_reduce_2k +--- bn_mp_set_double.c ++++ bn_mp_set_double.c +@@ -3,7 +3,7 @@ + /* LibTomMath, multiple-precision integer library -- Tom St Denis */ + /* SPDX-License-Identifier: Unlicense */ + +-#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) ++#if 1 + mp_err mp_set_double(mp_int *a, double b) + { + uint64_t frac; diff --git a/recipes/libtommath/all/test_package/CMakeLists.txt b/recipes/libtommath/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..90762dc612cbd --- /dev/null +++ b/recipes/libtommath/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +include(FindPkgConfig) +pkg_check_modules(LibTomMath REQUIRED IMPORTED_TARGET libtommath) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LibTomMath) diff --git a/recipes/libtommath/all/test_package/conanfile.py b/recipes/libtommath/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9e09e219fdcb3 --- /dev/null +++ b/recipes/libtommath/all/test_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", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.7.4") + + 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/libtommath/all/test_package/test_package.c b/recipes/libtommath/all/test_package/test_package.c new file mode 100644 index 0000000000000..cad90cb5780b2 --- /dev/null +++ b/recipes/libtommath/all/test_package/test_package.c @@ -0,0 +1,34 @@ +#include "tommath.h" + +#include +#include + +#define check(V) \ + if ((V) != MP_OKAY) { \ + fprintf(stderr, #V " FAILURE\n"); \ + return 1; \ + } + +int main() { + mp_int a, b, c; + + check(mp_init(&a)); + check(mp_init(&b)); + check(mp_init(&c)); + + check(mp_rand(&a, 30)); + check(mp_rand(&b, 30)); + + check(mp_add(&a, &b, &c)); + + printf("a = "); + check(mp_fwrite(&a, 10, stdout)); + printf("\nb = "); + check(mp_fwrite(&b, 10, stdout)); + printf("\na + b = "); + check(mp_fwrite(&c, 10, stdout)); + printf("\n"); + + mp_clear_multi(&a, &b, &c, NULL); + return 0; +} diff --git a/recipes/libtommath/config.yml b/recipes/libtommath/config.yml new file mode 100644 index 0000000000000..b8ea8afb5a353 --- /dev/null +++ b/recipes/libtommath/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.0": + folder: "all" diff --git a/recipes/libtool/all/conandata.yml b/recipes/libtool/all/conandata.yml new file mode 100644 index 0000000000000..fb9d7cad360c8 --- /dev/null +++ b/recipes/libtool/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.4.7": + url: "https://ftp.gnu.org/gnu/libtool/libtool-2.4.7.tar.gz" + sha256: "04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8" + "2.4.6": + url: "https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz" + sha256: "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3" +patches: + "2.4.7": + - patch_file: "patches/2.4.7-0001-libtool-relocatable.patch" + patch_description: "Make libtool relocatable" + patch_type: "portability" + "2.4.6": + - patch_file: "patches/2.4.6-0001-libtool-relocatable.patch" + patch_description: "Make libtool relocatable" + patch_type: "portability" + - patch_file: "patches/2.4.6-0002-libtool-fix-type-libtool.patch" + patch_description: "Fix type libtool" + patch_type: "portability" diff --git a/recipes/libtool/all/conanfile.py b/recipes/libtool/all/conanfile.py new file mode 100644 index 0000000000000..6f90b31da6ebc --- /dev/null +++ b/recipes/libtool/all/conanfile.py @@ -0,0 +1,241 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.env import Environment +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rename, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path_package_info_legacy + +import os +import re +import shutil + +required_conan_version = ">=1.57.0" + +class LibtoolConan(ConanFile): + name = "libtool" + # most common use is as "application", but library traits + # are a superset of application so this should cover all cases + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libtool/" + description = "GNU libtool is a generic library support script. " + topics = ("configure", "library", "shared", "static") + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("automake/1.16.5") + + #TODO: consider adding m4 as direct dependency, perhaps when we start using version ranges. + # https://github.com/conan-io/conan-center-index/pull/16248#discussion_r1116332095 + #self.requires("m4/1.4.19") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.tool_requires("automake/1.16.5") + self.tool_requires("m4/1.4.19") # Needed by configure + + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + + def generate(self): + if is_msvc(self): + # __VSCMD_ARG_NO_LOGO: this test_package has too many invocations, + # this avoids printing the logo everywhere + # VSCMD_SKIP_SENDTELEMETRY: avoid the telemetry process holding onto the directory + # unnecessarily + env = Environment() + env.define("__VSCMD_ARG_NO_LOGO", "1") + env.define("VSCMD_SKIP_SENDTELEMETRY", "1") + env.vars(self, scope="build").save_script("conanbuild_vcvars_options.bat") + + tc = AutotoolsToolchain(self) + + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + "--enable-shared", + "--enable-static", + "--enable-ltdl-install", + ]) + + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + + # Disable Fortran detection to handle issue with VS 2022 + # See: https://savannah.gnu.org/patch/?9313#comment1 + # In the future this could be removed if a new version fixes this + # upstream + env.define("F77", "no") + env.define("FC", "no") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + config_guess = self.dependencies.build["gnu-config"].conf_info.get("user.gnu-config:config_guess") + config_sub = self.dependencies.build["gnu-config"].conf_info.get("user.gnu-config:config_sub") + shutil.copy(config_sub, os.path.join(self.source_folder, "build-aux", "config.sub")) + shutil.copy(config_guess, os.path.join(self.source_folder, "build-aux", "config.guess")) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _shared_ext(self): + if self.settings.os == "Windows": + return "dll" + elif is_apple_os(self): + return "dylib" + else: + return "so" + + @property + def _static_ext(self): + if is_msvc(self): + return "lib" + else: + return "a" + + def _rm_binlib_files_containing(self, ext_inclusive, ext_exclusive=None): + regex_in = re.compile(r".*\.({})($|\..*)".format(ext_inclusive)) + if ext_exclusive: + regex_out = re.compile(r".*\.({})($|\..*)".format(ext_exclusive)) + else: + regex_out = re.compile("^$") + for directory in ( + os.path.join(self.package_folder, "bin"), + os.path.join(self.package_folder, "lib"), + ): + for file in os.listdir(directory): + if regex_in.match(file) and not regex_out.match(file): + os.unlink(os.path.join(directory, file)) + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + + rmdir(self, os.path.join(self._datarootdir, "info")) + rmdir(self, os.path.join(self._datarootdir, "man")) + + os.unlink(os.path.join(self.package_folder, "lib", "libltdl.la")) + if self.options.shared: + self._rm_binlib_files_containing(self._static_ext, self._shared_ext) + else: + self._rm_binlib_files_containing(self._shared_ext) + + files = ( + os.path.join(self.package_folder, "bin", "libtool"), + os.path.join(self.package_folder, "bin", "libtoolize"), + ) + replaces = { + "GREP": "/usr/bin/env grep", + "EGREP": "/usr/bin/env grep -E", + "FGREP": "/usr/bin/env grep -F", + "SED": "/usr/bin/env sed", + } + for file in files: + contents = open(file).read() + for key, repl in replaces.items(): + contents, nb1 = re.subn("^{}=\"[^\"]*\"".format(key), "{}=\"{}\"".format(key, repl), contents, flags=re.MULTILINE) + contents, nb2 = re.subn("^: \\$\\{{{}=\"[^$\"]*\"\\}}".format(key), ": ${{{}=\"{}\"}}".format(key, repl), contents, flags=re.MULTILINE) + if nb1 + nb2 == 0: + raise ConanException("Failed to find {} in {}".format(key, repl)) + open(file, "w").write(contents) + + binpath = os.path.join(self.package_folder, "bin") + if self.settings.os == "Windows": + rename(self, os.path.join(binpath, "libtoolize"), + os.path.join(binpath, "libtoolize.exe")) + rename(self, os.path.join(binpath, "libtool"), + os.path.join(binpath, "libtool.exe")) + + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "ltdl.dll.lib"), + os.path.join(self.package_folder, "lib", "ltdl.lib")) + + # allow libtool to link static libs into shared for more platforms + libtool_m4 = os.path.join(self._datarootdir, "aclocal", "libtool.m4") + method_pass_all = "lt_cv_deplibs_check_method=pass_all" + replace_in_file(self, libtool_m4, + "lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'", + method_pass_all) + replace_in_file(self, libtool_m4, + "lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'", + method_pass_all) + + def package_info(self): + self.cpp_info.libs = ["ltdl"] + + if self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.defines = ["LIBLTDL_DLL_IMPORT"] + else: + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] + + # Define environment variables such that libtool m4 files are seen by Automake + libtool_aclocal_dir = os.path.join(self._datarootdir, "aclocal") + + self.buildenv_info.append_path("ACLOCAL_PATH", libtool_aclocal_dir) + self.buildenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) + self.runenv_info.append_path("ACLOCAL_PATH", libtool_aclocal_dir) + self.runenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) + + # For Conan 1.x downstream consumers, can be removed once recipe is Conan 1.x only: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env: bin_path{bin_path}") + self.env_info.PATH.append(bin_path) + + self.env_info.ACLOCAL_PATH.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) + diff --git a/recipes/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch b/recipes/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch new file mode 100644 index 0000000000000..de3326ea712b7 --- /dev/null +++ b/recipes/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile.in b/Makefile.in +index 178bdec..6f1062c 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -2324,10 +2324,10 @@ $(notes_txt): $(notes_texi) + # files created in the build tree, so instead we regenerate the + # manual pages if the sources for the build-tree files we want to + # run have changed. +-$(libtool_1): $(ltmain_sh) +- $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool +-$(libtoolize_1): $(libtoolize_in) +- $(AM_V_GEN)$(update_mans) libtoolize ++#$(libtool_1): $(ltmain_sh) ++# $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool ++#$(libtoolize_1): $(libtoolize_in) ++# $(AM_V_GEN)$(update_mans) libtoolize + + install-data-local: $(lt_Makefile_in) install-scripts-local + @$(NORMAL_INSTALL) +diff --git a/libtoolize.in b/libtoolize.in +index 798bd0a..bdd3d88 100644 +--- a/libtoolize.in ++++ b/libtoolize.in +@@ -1901,11 +1901,12 @@ func_require_seen_libtool () + pkgmacro_files="@pkgmacro_files@" + + # Locations for important files: +- prefix="@prefix@" +- datadir="@datadir@" +- pkgauxdir="@pkgauxdir@" +- pkgltdldir="@pkgdatadir@" +- aclocaldir="@aclocaldir@" ++ scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) ++ prefix="$scriptdir/.." ++ datadir="$scriptdir/../res" ++ pkgauxdir="$scriptdir/../res/libtool/build-aux" ++ pkgltdldir="$scriptdir/../res/libtool" ++ aclocaldir="$scriptdir/../res/aclocal" + + # Allow the user to override the master libtoolize repository: + if test -n "$_lt_pkgdatadir"; then diff --git a/recipes/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch b/recipes/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch new file mode 100644 index 0000000000000..992c311b5fd1a --- /dev/null +++ b/recipes/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch @@ -0,0 +1,22 @@ +--- build-aux/ltmain.in ++++ build-aux/ltmain.in +@@ -212,7 +212,7 @@ + # a configuration failure hint, and exit. + func_fatal_configuration () + { +- func__fatal_error ${1+"$@"} \ ++ func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." + } +--- build-aux/ltmain.sh ++++ build-aux/ltmain.sh +@@ -2124,7 +2124,7 @@ + # a configuration failure hint, and exit. + func_fatal_configuration () + { +- func__fatal_error ${1+"$@"} \ ++ func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." + } diff --git a/recipes/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch b/recipes/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch new file mode 100644 index 0000000000000..0d9cf8555840b --- /dev/null +++ b/recipes/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile.in b/Makefile.in +index 29db7be..3046cdf 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -2423,10 +2423,10 @@ $(notes_txt): $(notes_texi) + # files created in the build tree, so instead we regenerate the + # manual pages if the sources for the build-tree files we want to + # run have changed. +-$(libtool_1): $(ltmain_sh) +- $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool +-$(libtoolize_1): $(libtoolize_in) +- $(AM_V_GEN)$(update_mans) libtoolize ++#$(libtool_1): $(ltmain_sh) ++# $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool ++#$(libtoolize_1): $(libtoolize_in) ++# $(AM_V_GEN)$(update_mans) libtoolize + + install-data-local: $(lt_Makefile_in) install-scripts-local + @$(NORMAL_INSTALL) +diff --git a/libtoolize.in b/libtoolize.in +index 0c40fed..e82e467 100644 +--- a/libtoolize.in ++++ b/libtoolize.in +@@ -1903,11 +1903,12 @@ func_require_seen_libtool () + pkgmacro_files="@pkgmacro_files@" + + # Locations for important files: +- prefix="@prefix@" +- datadir="@datadir@" +- pkgauxdir="@pkgauxdir@" +- pkgltdldir="@pkgdatadir@" +- aclocaldir="@aclocaldir@" ++ scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) ++ prefix="$scriptdir/.." ++ datadir="$scriptdir/../res" ++ pkgauxdir="$scriptdir/../res/libtool/build-aux" ++ pkgltdldir="$scriptdir/../res/libtool" ++ aclocaldir="$scriptdir/../res/aclocal" + + # Allow the user to override the master libtoolize repository: + if test -n "$_lt_pkgdatadir"; then diff --git a/recipes/libtool/all/test_package/autotools/Makefile.am b/recipes/libtool/all/test_package/autotools/Makefile.am new file mode 100644 index 0000000000000..aae3d3042e762 --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/Makefile.am @@ -0,0 +1,13 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +lib_LTLIBRARIES = libtestlib.la + +test_package_SOURCES = test_package.c +test_package_LDADD = libtestlib.la + +libtestlib_la_SOURCES = lib.c +libtestlib_la_LDFLAGS = -no-undefined -export-symbols "$(srcdir)/libtestlib.sym" +include_HEADERS = lib.h + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_package/autotools/configure.ac b/recipes/libtool/all/test_package/autotools/configure.ac new file mode 100644 index 0000000000000..e56278b3ae822 --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/configure.ac @@ -0,0 +1,41 @@ +AC_PREREQ(2.69) +# Must init the autoconf setup +# The first parameter is project name +# second is version number +# third is bug report address +AC_INIT([test_package], [1.0]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.c]) + +# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) +# in this dir (build-aux) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) + +# Init automake, and specify this program use relaxed structures. +# i.e. this program doesn't follow the gnu coding standards, and doesn't have +# ChangeLog, COPYING, AUTHORS, INSTALL, README etc. files. +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX + +# Check for archiver +AM_PROG_AR + +LT_PREREQ([2.4.6]) +LT_INIT([win32-dll]) + +AC_SEARCH_LIBS([sqrt], [m]) + +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) + +## Generate the output +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/recipes/libtool/all/test_package/autotools/lib.c b/recipes/libtool/all/test_package/autotools/lib.c new file mode 100644 index 0000000000000..a633facec2691 --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/lib.c @@ -0,0 +1,11 @@ +#include "testlib_private.h" + +#include +#include + +double my_function(double val) { + fprintf(stderr, "inside my_function(%e)\n", val); + return sqrt(val); +} + +TESTLIB_API const int libtestlib_value = 42; diff --git a/recipes/libtool/all/test_package/autotools/lib.h b/recipes/libtool/all/test_package/autotools/lib.h new file mode 100644 index 0000000000000..170f9676735dc --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/lib.h @@ -0,0 +1,34 @@ +#ifndef TESTLIB_LIB_H +#define TESTLIB_LIB_H + +#if defined(_WIN32) +# define TESTLIB_IMPORT_SHARED __declspec(dllimport) +# define TESTLIB_EXPORT_SHARED __declspec(dllexport) +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_IMPORT_SHARED +# define TESTLIB_EXPORT_SHARED +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#endif + +#if defined(LIBTEST_BUILDING) +# define TESTLIB_SHARED TESTLIB_EXPORT_SHARED +# define TESTLIB_STATIC TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_SHARED TESTLIB_IMPORT_SHARED +# define TESTLIB_STATIC TESTLIB_IMPORT_STATIC +#endif + +#if defined(LIBHELLO_STATIC) +# define TESTLIB_API TESTLIB_STATIC +#else +# define TESTLIB_API TESTLIB_SHARED +#endif + +double my_function(double); + +extern TESTLIB_API const int libtestlib_value; + +#endif // TESTLIB_LIB_H diff --git a/recipes/libtool/all/test_package/autotools/libtestlib.sym b/recipes/libtool/all/test_package/autotools/libtestlib.sym new file mode 100644 index 0000000000000..8464fb190369d --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/libtestlib.sym @@ -0,0 +1,2 @@ +my_function +libtestlib_value diff --git a/recipes/libtool/all/test_package/autotools/test_package.c b/recipes/libtool/all/test_package/autotools/test_package.c new file mode 100644 index 0000000000000..4fd8442a6895e --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/test_package.c @@ -0,0 +1,11 @@ +#include "lib.h" + +#include + +int main(int argc, char * argv[]) +{ + double res = my_function(1.44); + printf("Result is %e\n", res); + printf("The secret value is %d\n", libtestlib_value); + return 0; +} diff --git a/recipes/libtool/all/test_package/autotools/testlib_private.h b/recipes/libtool/all/test_package/autotools/testlib_private.h new file mode 100644 index 0000000000000..81831aee0dc1f --- /dev/null +++ b/recipes/libtool/all/test_package/autotools/testlib_private.h @@ -0,0 +1,8 @@ +#ifndef TESTLIB_PRIVATE_H +#define TESTLIB_PRIVATE_H + +#define LIBTEST_BUILDING + +#include "lib.h" + +#endif // TESTLIB_PRIVATE_H diff --git a/recipes/libtool/all/test_package/conanfile.py b/recipes/libtool/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fa6b79d0ca968 --- /dev/null +++ b/recipes/libtool/all/test_package/conanfile.py @@ -0,0 +1,199 @@ +from conan import ConanFile +from conan.tools.build import cross_building, can_run +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, mkdir, rmdir +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.apple import is_apple_os + +import glob +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + short_paths = True + win_bash = True # This assignment must be *here* to avoid "Cannot wrap command with different envs." in Conan 1.x + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) # Since we are testing libltdl as well + + def build_requirements(self): + if hasattr(self, "settings_build") and not cross_building(self): + self.tool_requires(self.tested_reference_str) # We are testing libtool/libtoolize + + self.tool_requires("autoconf/2.71") + self.tool_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + @property + def autotools_package_folder(self): + return os.path.join(self.build_folder, "pkg_autotools") + + @property + def sis_package_folder(self): + return os.path.join(self.build_folder, "pkg_sis") + + def generate(self): + if is_msvc(self): + # __VSCMD_ARG_NO_LOGO: this test_package has too many invocations, + # this avoids printing the logo everywhere + # VSCMD_SKIP_SENDTELEMETRY: avoid the telemetry process holding onto the directory + # unnecessarily + env = Environment() + env.define("__VSCMD_ARG_NO_LOGO", "1") + env.define("VSCMD_SKIP_SENDTELEMETRY", "1") + env.vars(self, scope="build").save_script("conanbuild_vcvars_options.bat") + + # Use two instances of AutotoolsToolchain with namespaceas, + # as we have two different projects with different settings. + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + msvc_vars = { + "CC": "cl -nologo", + "CXX": "cl -nologo", + "AR": f"{ar_wrapper} lib", + "LD": "link" + } + + # "Autotools" subfolder: project to test integration of Autotools with libtool + # at build time + tc = AutotoolsToolchain(self, namespace="autotools") + env = tc.environment() + if is_msvc(self): + for key, value in msvc_vars.items(): + env.append(key, value) + tc.generate(env) + + # "sis" subfder: project to test building shared library using libtool + # while linking to a static library + tc = AutotoolsToolchain(self, namespace="sis") + tc.configure_args.extend(["--enable-shared", "--disable-static"]) + lib_folder = unix_path(self, os.path.join(self.sis_package_folder, "lib")) + tc.extra_ldflags.append(f"-L{lib_folder}") + env = tc.environment() + if is_msvc(self): + for key, value in msvc_vars.items(): + env.append(key, value) + tc.generate(env) + + # Note: Using AutotoolsDeps causes errors on Windows when configure tries to determine compiler + # because injected values for environment variables CPPFLAGS and LDFLAGS that are not + # interpreted correctly + if is_msvc(self): + # Use NMake to workaround bug in MSBuild versions prior to 2022 that shows up as: + # error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item + # has already been added. Key in dictionary: 'tmp' Key being added: 'TMP' + self.conf.define("tools.cmake.cmaketoolchain:generator", "NMake Makefiles") + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + env = Environment() + for var in ["DYLD_LIBRARY_PATH", "LD_LIBRARY_PATH"]: + env.append_path(var, os.path.join(self.autotools_package_folder, "lib")) + env.vars(self, scope="run").save_script("conanrun_libtool_testpackage") + + runenv = VirtualRunEnv(self) + runenv.generate() + + + def _build_autotools(self): + """ Test autotools integration """ + # Copy autotools directory to build folder + autotools_build_folder = os.path.join(self.build_folder, "autotools") + rmdir(self, autotools_build_folder) + shutil.copytree(os.path.join(self.source_folder, "autotools"), autotools_build_folder) + with chdir(self, "autotools"): + self.run("autoreconf --install --verbose --force -Wall") + + mkdir(self, self.autotools_package_folder) + with chdir(self, autotools_build_folder): + autotools = Autotools(self, namespace="autotools") + autotools.configure(build_script_folder=autotools_build_folder) + autotools.make(args=["V=1"]) + autotools.install(args=[f'DESTDIR={unix_path(self, self.autotools_package_folder)}']) + + def _test_autotools(self): + assert os.path.isdir(os.path.join(self.autotools_package_folder, "bin")) + assert os.path.isfile(os.path.join(self.autotools_package_folder, "include", "lib.h")) + assert os.path.isdir(os.path.join(self.autotools_package_folder, "lib")) + + if can_run(self): + self.run(f'{unix_path(self, os.path.join(self.autotools_package_folder, "bin", "test_package"))}', env="conanrun") + + def _build_ltdl(self): + """ Build library using ltdl library """ + cmake = CMake(self) + cmake.configure(build_script_folder="ltdl") + cmake.build() + + def _test_ltdl(self): + """ Test library using ltdl library""" + lib_prefix = "lib" if self.settings.os != "Windows" else "" + lib_extension = "dll" if self.settings.os == "Windows" else "so" + + if can_run(self): + bin_executable = unix_path(self, os.path.join(self.cpp.build.bindirs[0], "test_package")) + lib_path = unix_path(self, os.path.join(self.cpp.build.libdirs[0], f'{lib_prefix}liba.{lib_extension}')) + self.run(f'{bin_executable} {lib_path}', env="conanrun") + + def _build_static_lib_in_shared(self): + """ Build shared library using libtool (while linking to a static library) """ + + # Copy static-in-shared directory to build folder + autotools_sis_folder = os.path.join(self.build_folder, "sis") + rmdir(self, autotools_sis_folder) + shutil.copytree(os.path.join(self.source_folder, "sis"), autotools_sis_folder) + + # Build static library using CMake and install into a folder inside the build folder + cmake = CMake(self) + cmake.configure(build_script_folder="ltdl") + cmake.build(target="static_lib") + install_prefix = unix_path(self, self.sis_package_folder) + self.run(f"cmake --install . --config {self.settings.build_type} --prefix {install_prefix} --component static_lib") + + with chdir(self, autotools_sis_folder): + self.run("autoreconf --install --verbose --force -Wall") + autotools = Autotools(self, namespace="sis") + autotools.configure(build_script_folder=autotools_sis_folder) + autotools.install(args=[f"DESTDIR={unix_path(self, self.sis_package_folder)}"]) + + def _test_static_lib_in_shared(self): + """ Test existence of shared library """ + with chdir(self, self.sis_package_folder): + if self.settings.os == "Windows": + assert len(list(glob.glob(os.path.join("bin", "*.dll")))) > 0 + elif is_apple_os(self): + assert len(list(glob.glob(os.path.join("lib", "*.dylib")))) > 0 + else: + assert len(list(glob.glob(os.path.join("lib", "*.so")))) > 0 + + def build(self): + self._build_ltdl() + if not cross_building(self): + self._build_autotools() + self._build_static_lib_in_shared() + + def test(self): + if can_run(self): + self._test_ltdl() + self._test_autotools() + self._test_static_lib_in_shared() diff --git a/recipes/libtool/all/test_package/ltdl/CMakeLists.txt b/recipes/libtool/all/test_package/ltdl/CMakeLists.txt new file mode 100644 index 0000000000000..e15a97d31d1b2 --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +find_package(libtool REQUIRED CONFIG) + +include(GenerateExportHeader) + +add_library(liba MODULE liba.c) +generate_export_header(liba) +target_include_directories(liba + PUBLIC $ +) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libtool::libtool) + +add_library(static_lib STATIC + static_lib.c +) + +install(TARGETS static_lib + LIBRARY + DESTINATION lib + COMPONENT static_lib + ARCHIVE + DESTINATION lib + COMPONENT static_lib) diff --git a/recipes/libtool/all/test_package/ltdl/liba.c b/recipes/libtool/all/test_package/ltdl/liba.c new file mode 100644 index 0000000000000..790903848f667 --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/liba.c @@ -0,0 +1,6 @@ +#include "liba_export.h" + +LIBA_EXPORT +int liba_function(int arg) { + return 2 * arg; +} diff --git a/recipes/libtool/all/test_package/ltdl/static_lib.c b/recipes/libtool/all/test_package/ltdl/static_lib.c new file mode 100644 index 0000000000000..2ebed9d056844 --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/static_lib.c @@ -0,0 +1,4 @@ +int +static_function(int arg) { + return arg + 42; +} diff --git a/recipes/libtool/all/test_package/ltdl/test_package.c b/recipes/libtool/all/test_package/ltdl/test_package.c new file mode 100644 index 0000000000000..51329f415f56f --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/test_package.c @@ -0,0 +1,36 @@ +#include "ltdl.h" + +#include +#include + +typedef int (*liba_func_t)(int); + +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return EXIT_FAILURE; + } + const char* libname = argv[1]; + lt_dlinit(); + + fprintf(stderr, "lt_dlopenext(\"%s\")\n", libname); + lt_dlhandle ltdl_liba = lt_dlopenext(libname); + if (!ltdl_liba) { + fprintf(stderr, "lt_dlopenext failed.\n"); + return EXIT_FAILURE; + } + + liba_func_t liba_func = (liba_func_t) lt_dlsym(ltdl_liba, "liba_function"); + int res = liba_func(21); + printf("Result is %d\n", res); + if (res != 42) { + fprintf(stderr, "Result is incorrect\n"); + return EXIT_FAILURE; + } + + lt_dlclose(ltdl_liba); + + lt_dlexit(); + return EXIT_SUCCESS; +} diff --git a/recipes/libtool/all/test_package/sis/Makefile.am b/recipes/libtool/all/test_package/sis/Makefile.am new file mode 100644 index 0000000000000..824106cabe1d8 --- /dev/null +++ b/recipes/libtool/all/test_package/sis/Makefile.am @@ -0,0 +1,8 @@ +# @configure_input@ + +lib_LTLIBRARIES = libshared.la + +libshared_la_SOURCES = shared_lib.c +libshared_la_LDFLAGS = -no-undefined -lstatic_lib + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_package/sis/configure.ac b/recipes/libtool/all/test_package/sis/configure.ac new file mode 100644 index 0000000000000..0272fc8f862a2 --- /dev/null +++ b/recipes/libtool/all/test_package/sis/configure.ac @@ -0,0 +1,13 @@ +AC_PREREQ(2.69) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([shared_lib.c]) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AM_PROG_AR +LT_PREREQ([2.4]) +LT_INIT([win32-dll]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/recipes/libtool/all/test_package/sis/shared.sym b/recipes/libtool/all/test_package/sis/shared.sym new file mode 100644 index 0000000000000..e05e2d3117c07 --- /dev/null +++ b/recipes/libtool/all/test_package/sis/shared.sym @@ -0,0 +1 @@ +shared_function diff --git a/recipes/libtool/all/test_package/sis/shared_lib.c b/recipes/libtool/all/test_package/sis/shared_lib.c new file mode 100644 index 0000000000000..b92cbe207afe1 --- /dev/null +++ b/recipes/libtool/all/test_package/sis/shared_lib.c @@ -0,0 +1,7 @@ +int +static_function(int); + +int +shared_function(int arg) { + return static_function(arg) + 1337; +} diff --git a/recipes/libtool/all/test_v1_package/autotools/Makefile.am b/recipes/libtool/all/test_v1_package/autotools/Makefile.am new file mode 100644 index 0000000000000..aae3d3042e762 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/Makefile.am @@ -0,0 +1,13 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +lib_LTLIBRARIES = libtestlib.la + +test_package_SOURCES = test_package.c +test_package_LDADD = libtestlib.la + +libtestlib_la_SOURCES = lib.c +libtestlib_la_LDFLAGS = -no-undefined -export-symbols "$(srcdir)/libtestlib.sym" +include_HEADERS = lib.h + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_v1_package/autotools/configure.ac b/recipes/libtool/all/test_v1_package/autotools/configure.ac new file mode 100644 index 0000000000000..e56278b3ae822 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/configure.ac @@ -0,0 +1,41 @@ +AC_PREREQ(2.69) +# Must init the autoconf setup +# The first parameter is project name +# second is version number +# third is bug report address +AC_INIT([test_package], [1.0]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.c]) + +# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) +# in this dir (build-aux) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) + +# Init automake, and specify this program use relaxed structures. +# i.e. this program doesn't follow the gnu coding standards, and doesn't have +# ChangeLog, COPYING, AUTHORS, INSTALL, README etc. files. +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX + +# Check for archiver +AM_PROG_AR + +LT_PREREQ([2.4.6]) +LT_INIT([win32-dll]) + +AC_SEARCH_LIBS([sqrt], [m]) + +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) + +## Generate the output +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/recipes/libtool/all/test_v1_package/autotools/lib.c b/recipes/libtool/all/test_v1_package/autotools/lib.c new file mode 100644 index 0000000000000..a633facec2691 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/lib.c @@ -0,0 +1,11 @@ +#include "testlib_private.h" + +#include +#include + +double my_function(double val) { + fprintf(stderr, "inside my_function(%e)\n", val); + return sqrt(val); +} + +TESTLIB_API const int libtestlib_value = 42; diff --git a/recipes/libtool/all/test_v1_package/autotools/lib.h b/recipes/libtool/all/test_v1_package/autotools/lib.h new file mode 100644 index 0000000000000..170f9676735dc --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/lib.h @@ -0,0 +1,34 @@ +#ifndef TESTLIB_LIB_H +#define TESTLIB_LIB_H + +#if defined(_WIN32) +# define TESTLIB_IMPORT_SHARED __declspec(dllimport) +# define TESTLIB_EXPORT_SHARED __declspec(dllexport) +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_IMPORT_SHARED +# define TESTLIB_EXPORT_SHARED +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#endif + +#if defined(LIBTEST_BUILDING) +# define TESTLIB_SHARED TESTLIB_EXPORT_SHARED +# define TESTLIB_STATIC TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_SHARED TESTLIB_IMPORT_SHARED +# define TESTLIB_STATIC TESTLIB_IMPORT_STATIC +#endif + +#if defined(LIBHELLO_STATIC) +# define TESTLIB_API TESTLIB_STATIC +#else +# define TESTLIB_API TESTLIB_SHARED +#endif + +double my_function(double); + +extern TESTLIB_API const int libtestlib_value; + +#endif // TESTLIB_LIB_H diff --git a/recipes/libtool/all/test_v1_package/autotools/libtestlib.sym b/recipes/libtool/all/test_v1_package/autotools/libtestlib.sym new file mode 100644 index 0000000000000..8464fb190369d --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/libtestlib.sym @@ -0,0 +1,2 @@ +my_function +libtestlib_value diff --git a/recipes/libtool/all/test_v1_package/autotools/test_package.c b/recipes/libtool/all/test_v1_package/autotools/test_package.c new file mode 100644 index 0000000000000..4fd8442a6895e --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/test_package.c @@ -0,0 +1,11 @@ +#include "lib.h" + +#include + +int main(int argc, char * argv[]) +{ + double res = my_function(1.44); + printf("Result is %e\n", res); + printf("The secret value is %d\n", libtestlib_value); + return 0; +} diff --git a/recipes/libtool/all/test_v1_package/autotools/testlib_private.h b/recipes/libtool/all/test_v1_package/autotools/testlib_private.h new file mode 100644 index 0000000000000..81831aee0dc1f --- /dev/null +++ b/recipes/libtool/all/test_v1_package/autotools/testlib_private.h @@ -0,0 +1,8 @@ +#ifndef TESTLIB_PRIVATE_H +#define TESTLIB_PRIVATE_H + +#define LIBTEST_BUILDING + +#include "lib.h" + +#endif // TESTLIB_PRIVATE_H diff --git a/recipes/libtool/all/test_v1_package/conanfile.py b/recipes/libtool/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4b29d6a395ef7 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/conanfile.py @@ -0,0 +1,159 @@ +from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools +from contextlib import contextmanager +import glob +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + test_type = "explicit" + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str) # Needed as a requirement for CMake to see libraries + + def build_requirements(self): + if hasattr(self, "settings_build") and not tools.cross_building(self): + self.build_requires(self.tested_reference_str) + self.build_requires("automake/1.16.5") # Needed for aclocal called by autoreconf + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + with tools.environment_append({ + "CC": "cl -nologo", + "CXX": "cl -nologo", + }): + yield + else: + yield + + @property + def _package_folder(self): + return os.path.join(self.build_folder, "package") + + def _build_autotools(self): + """ Test autotools integration """ + # Copy autotools directory to build folder + shutil.copytree(os.path.join(self.source_folder, "autotools"), os.path.join(self.build_folder, "autotools")) + with tools.chdir("autotools"): + self.run("autoreconf --install --verbose -Wall", win_bash=tools.os_info.is_windows) + + tools.mkdir(self._package_folder) + conf_args = [ + "--prefix={}".format(tools.unix_path(self._package_folder)), + "--enable-shared", "--enable-static", + ] + + os.mkdir("bin_autotools") + with tools.chdir("bin_autotools"): + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + autotools.configure(args=conf_args, configure_dir=os.path.join(self.build_folder, "autotools")) + autotools.make(args=["V=1"]) + autotools.install() + + def _test_autotools(self): + assert os.path.isdir(os.path.join(self._package_folder, "bin")) + assert os.path.isfile(os.path.join(self._package_folder, "include", "lib.h")) + assert os.path.isdir(os.path.join(self._package_folder, "lib")) + + if not tools.cross_building(self): + self.run(os.path.join(self._package_folder, "bin", "test_package"), run_environment=True) + + def _build_ltdl(self): + """ Build library using ltdl library """ + with self._build_context(): + if self.settings.compiler == "Visual Studio": + cmake = CMake(self, generator="NMake Makefiles") + else: + cmake = CMake(self) + cmake.configure(source_folder="ltdl") + cmake.build() + + def _test_ltdl(self): + """ Test library using ltdl library""" + lib_suffix = { + "Linux": "so", + "FreeBSD": "so", + "Macos": "dylib", + "Windows": "dll", + }[str(self.settings.os)] + + if not tools.cross_building(self): + bin_path = tools.unix_path(os.path.join("bin", "test_package")) + libdir = "bin" if self.settings.os == "Windows" else "lib" + lib_path = tools.unix_path(os.path.join(libdir, "liba.{}".format(lib_suffix))) + self.run("{} {}".format(bin_path, lib_path), run_environment=True, win_bash=tools.os_info.is_windows) + + def _build_static_lib_in_shared(self): + """ Build shared library using libtool (while linking to a static library) """ + + # Copy static-in-shared directory to build folder + autotools_folder = os.path.join(self.build_folder, "sis") + shutil.copytree(os.path.join(self.source_folder, "sis"), autotools_folder) + + install_prefix = os.path.join(autotools_folder, "prefix") + + # Build static library using CMake + with self._build_context(): + if self.settings.compiler == "Visual Studio": + cmake = CMake(self, generator="NMake Makefiles") + else: + cmake = CMake(self) + cmake.definitions["CMAKE_INSTALL_PREFIX"] = install_prefix + cmake.configure(source_folder=autotools_folder, build_folder=os.path.join(autotools_folder, "cmake_build")) + cmake.build() + cmake.install() + + # Copy autotools directory to build folder + with tools.chdir(autotools_folder): + self.run("autoreconf -ifv -Wall", win_bash=tools.os_info.is_windows) + + with tools.chdir(autotools_folder): + conf_args = [ + "--enable-shared", + "--disable-static", + "--prefix={}".format(tools.unix_path(os.path.join(install_prefix))), + ] + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + autotools.link_flags.append("-L{}".format(tools.unix_path(os.path.join(install_prefix, "lib")))) + autotools.configure(args=conf_args, configure_dir=autotools_folder) + autotools.make(args=["V=1"]) + autotools.install() + + def _test_static_lib_in_shared(self): + """ Test existence of shared library """ + install_prefix = os.path.join(self.build_folder, "sis", "prefix") + + with tools.chdir(install_prefix): + if self.settings.os == "Windows": + assert len(list(glob.glob(os.path.join("bin", "*.dll")))) > 0 + elif tools.is_apple_os(self.settings.os): + assert len(list(glob.glob(os.path.join("lib", "*.dylib")))) > 0 + else: + assert len(list(glob.glob(os.path.join("lib", "*.so")))) > 0 + + def build(self): + self._build_ltdl() + if not tools.cross_building(self): + self._build_autotools() + self._build_static_lib_in_shared() + + def test(self): + self._test_ltdl() + if not tools.cross_building(self): + self._test_autotools() + self._test_static_lib_in_shared() diff --git a/recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt b/recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt new file mode 100644 index 0000000000000..7fc6140320af7 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +include(GenerateExportHeader) + +add_library(liba SHARED liba.c) +generate_export_header(liba) +target_include_directories(liba + PUBLIC $ +) +set_property(TARGET liba PROPERTY PREFIX "") + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_include_directories(test_package + PUBLIC "$" +) diff --git a/recipes/libtool/all/test_v1_package/ltdl/liba.c b/recipes/libtool/all/test_v1_package/ltdl/liba.c new file mode 100644 index 0000000000000..790903848f667 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/ltdl/liba.c @@ -0,0 +1,6 @@ +#include "liba_export.h" + +LIBA_EXPORT +int liba_function(int arg) { + return 2 * arg; +} diff --git a/recipes/libtool/all/test_v1_package/ltdl/test_package.c b/recipes/libtool/all/test_v1_package/ltdl/test_package.c new file mode 100644 index 0000000000000..51329f415f56f --- /dev/null +++ b/recipes/libtool/all/test_v1_package/ltdl/test_package.c @@ -0,0 +1,36 @@ +#include "ltdl.h" + +#include +#include + +typedef int (*liba_func_t)(int); + +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return EXIT_FAILURE; + } + const char* libname = argv[1]; + lt_dlinit(); + + fprintf(stderr, "lt_dlopenext(\"%s\")\n", libname); + lt_dlhandle ltdl_liba = lt_dlopenext(libname); + if (!ltdl_liba) { + fprintf(stderr, "lt_dlopenext failed.\n"); + return EXIT_FAILURE; + } + + liba_func_t liba_func = (liba_func_t) lt_dlsym(ltdl_liba, "liba_function"); + int res = liba_func(21); + printf("Result is %d\n", res); + if (res != 42) { + fprintf(stderr, "Result is incorrect\n"); + return EXIT_FAILURE; + } + + lt_dlclose(ltdl_liba); + + lt_dlexit(); + return EXIT_SUCCESS; +} diff --git a/recipes/libtool/all/test_v1_package/sis/CMakeLists.txt b/recipes/libtool/all/test_v1_package/sis/CMakeLists.txt new file mode 100644 index 0000000000000..dff9ec13a4939 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/sis/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(static_dependency C) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +add_library(static_lib STATIC + static_lib.c +) +install(TARGETS static_lib + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) diff --git a/recipes/libtool/all/test_v1_package/sis/Makefile.am b/recipes/libtool/all/test_v1_package/sis/Makefile.am new file mode 100644 index 0000000000000..824106cabe1d8 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/sis/Makefile.am @@ -0,0 +1,8 @@ +# @configure_input@ + +lib_LTLIBRARIES = libshared.la + +libshared_la_SOURCES = shared_lib.c +libshared_la_LDFLAGS = -no-undefined -lstatic_lib + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_v1_package/sis/configure.ac b/recipes/libtool/all/test_v1_package/sis/configure.ac new file mode 100644 index 0000000000000..0272fc8f862a2 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/sis/configure.ac @@ -0,0 +1,13 @@ +AC_PREREQ(2.69) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([shared_lib.c]) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AM_PROG_AR +LT_PREREQ([2.4]) +LT_INIT([win32-dll]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/recipes/libtool/all/test_v1_package/sis/shared.sym b/recipes/libtool/all/test_v1_package/sis/shared.sym new file mode 100644 index 0000000000000..e05e2d3117c07 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/sis/shared.sym @@ -0,0 +1 @@ +shared_function diff --git a/recipes/libtool/all/test_v1_package/sis/shared_lib.c b/recipes/libtool/all/test_v1_package/sis/shared_lib.c new file mode 100644 index 0000000000000..b92cbe207afe1 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/sis/shared_lib.c @@ -0,0 +1,7 @@ +int +static_function(int); + +int +shared_function(int arg) { + return static_function(arg) + 1337; +} diff --git a/recipes/libtool/all/test_v1_package/sis/static_lib.c b/recipes/libtool/all/test_v1_package/sis/static_lib.c new file mode 100644 index 0000000000000..2ebed9d056844 --- /dev/null +++ b/recipes/libtool/all/test_v1_package/sis/static_lib.c @@ -0,0 +1,4 @@ +int +static_function(int arg) { + return arg + 42; +} diff --git a/recipes/libtool/config.yml b/recipes/libtool/config.yml new file mode 100644 index 0000000000000..f33083be4e783 --- /dev/null +++ b/recipes/libtool/config.yml @@ -0,0 +1,5 @@ +versions: + "2.4.7": + folder: all + "2.4.6": + folder: all diff --git a/recipes/libtorrent/all/conandata.yml b/recipes/libtorrent/all/conandata.yml new file mode 100644 index 0000000000000..c0a04e36275d4 --- /dev/null +++ b/recipes/libtorrent/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "2.0.8": + url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.8/libtorrent-rasterbar-2.0.8.tar.gz" + sha256: "09dd399b4477638cf140183f5f85d376abffb9c192bc2910002988e27d69e13e" + "2.0.1": + url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.1/libtorrent-rasterbar-2.0.1.tar.gz" + sha256: "7b39599bf602bf2f208f8f05bf2327576356a3c192175b3a4603262ede42ffd7" + "1.2.3": + url: "https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_2_3/libtorrent-rasterbar-1.2.3.tar.gz" + sha256: "1582fdbbd0449bcfe4ffae2ccb9e5bf0577459a32bb25604e01accb847da1a2d" +patches: + "1.2.3": + - patch_file: "patches/1.2.3-0002-boost-system-header-only-1.69+.patch" + patch_description: "use find_package with component only boost >= 1.69" + patch_type: "portability" + - patch_file: "patches/1.2.3-0003-include-cstddef.patch" + patch_description: "include cstddef instead stddef.h" + patch_type: "portability" + - patch_file: "patches/1.2.3-0004-increase-handle-storage-sizes.patch" + patch_description: "increase handle storage size" + patch_type: "portability" diff --git a/recipes/libtorrent/all/conanfile.py b/recipes/libtorrent/all/conanfile.py new file mode 100644 index 0000000000000..f21e595615c63 --- /dev/null +++ b/recipes/libtorrent/all/conanfile.py @@ -0,0 +1,213 @@ +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 apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +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 LibtorrentConan(ConanFile): + name = "libtorrent" + description = ( + "libtorrent is a feature complete C++ bittorrent implementation " + "focusing on efficiency and scalability" + ) + topics = ("p2p", "network", "mesh") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://libtorrent.org" + license = ("BSD-3-clause", "ZLIB", "BSL-1.0") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_deprecated_functions": [True, False], + "enable_dht": [True, False], + "enable_encryption": [True, False], + "enable_exceptions": [True, False], + "enable_extensions": [True, False], + "enable_i2p": [True, False], + "enable_iconv": [True, False], + "enable_logging": [True, False], + "enable_mutable_torrents": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_dht": True, + "enable_deprecated_functions": True, + "enable_encryption": True, + "enable_exceptions": True, + "enable_extensions": True, + "enable_i2p": True, + "enable_iconv": False, + "enable_logging": True, + "enable_mutable_torrents": True, + } + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "2.0.0" else "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5" if Version(self.version) < "2.0.8" else "6", + "clang": "5", + "apple-clang": "5", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # libtorrent 2.0.x [x<=6] have issue for recent boost https://github.com/arvidn/libtorrent/discussions/6757 + if Version(self.version) < "2.0.0" or Version(self.version) >= "2.0.7": + self.requires("boost/1.81.0", transitive_headers=True) + else: + self.requires("boost/1.76.0", transitive_headers=True) + if self.options.enable_encryption: + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + if self.options.enable_iconv: + self.requires("libiconv/1.17") + + 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 Version(self.dependencies["boost"].ref.version) < "1.69.0" and \ + (self.dependencies["boost"].options.header_only or self.dependencies["boost"].options.without_system): + raise ConanInvalidConfiguration(f"{self.ref} requires boost with system, which is non-header only in boost < 1.69.0") + + def build_requirements(self): + if Version(self.version) >= "2.0.4": + self.tool_requires("cmake/[>=3.16 <4]") + + 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["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.get_safe("shared", False) + tc.variables["deprecated-functions"] = self.options.enable_deprecated_functions + tc.variables["dht"] = self.options.enable_dht + tc.variables["encryption"] = self.options.enable_encryption + tc.variables["exceptions"] = self.options.enable_exceptions + tc.variables["i2p"] = self.options.enable_i2p + tc.variables["logging"] = self.options.enable_logging + tc.variables["mutable-torrents"] = self.options.enable_mutable_torrents + tc.variables["build_tests"] = False + tc.variables["build_examples"] = False + tc.variables["build_tools"] = False + tc.variables["python-bindings"] = False + tc.variables["python-bindings"] = False + if is_msvc(self): + tc.variables["static_runtime"] = is_msvc_static_runtime(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "/W4", "") + if Version(self.version) < "2.0": + if self.options.enable_iconv: + replace = "find_public_dependency(Iconv REQUIRED)" + else: + replace = "set(Iconv_FOUND OFF)" + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "find_public_dependency(Iconv)", + replace) + if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++": + # https://github.com/arvidn/libtorrent/issues/3557 + replace_in_file(self, os.path.join(self.source_folder, "include", "libtorrent", "file_storage.hpp"), + "file_entry& operator=(file_entry&&) & noexcept = default;", + "file_entry& operator=(file_entry&&) & = default;") + + 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LibtorrentRasterbar") + self.cpp_info.set_property("cmake_target_name", "LibtorrentRasterbar::torrent-rasterbar") + self.cpp_info.set_property("pkg_config_name", "libtorrent-rasterbar") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["libtorrent-rasterbar"].includedirs = ["include", os.path.join("include", "libtorrent")] + self.cpp_info.components["libtorrent-rasterbar"].libs = ["torrent-rasterbar"] + + self.cpp_info.components["libtorrent-rasterbar"].requires = ["boost::headers", "boost::system"] + if self.options.enable_encryption: + self.cpp_info.components["libtorrent-rasterbar"].requires.append("openssl::openssl") + if self.options.enable_iconv: + 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"] + elif self.settings.os == "Windows": + self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp"] + elif self.settings.os == "Macos": + self.cpp_info.components["libtorrent-rasterbar"].frameworks = ["CoreFoundation", "SystemConfiguration"] + + if self.options.shared: + self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_LINKING_SHARED") + if self.options.enable_encryption: + self.cpp_info.components["libtorrent-rasterbar"].defines.extend(["TORRENT_USE_OPENSSL", "TORRENT_USE_LIBCRYPTO"]) + else: + self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_DISABLE_ENCRYPTION") + if self.options.enable_iconv: + self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_USE_ICONV") + if not self.options.enable_dht: + self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_DISABLE_DHT") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "LibtorrentRasterbar" + self.cpp_info.names["cmake_find_package_multi"] = "LibtorrentRasterbar" + self.cpp_info.components["libtorrent-rasterbar"].names["cmake_find_package"] = "torrent-rasterbar" + self.cpp_info.components["libtorrent-rasterbar"].names["cmake_find_package_multi"] = "torrent-rasterbar" + self.cpp_info.components["libtorrent-rasterbar"].set_property("cmake_target_name", "LibtorrentRasterbar::torrent-rasterbar") + self.cpp_info.components["libtorrent-rasterbar"].set_property("pkg_config_name", "libtorrent-rasterbar") diff --git a/recipes/libtorrent/all/patches/1.2.3-0002-boost-system-header-only-1.69+.patch b/recipes/libtorrent/all/patches/1.2.3-0002-boost-system-header-only-1.69+.patch new file mode 100644 index 0000000000000..5524288db7f45 --- /dev/null +++ b/recipes/libtorrent/all/patches/1.2.3-0002-boost-system-header-only-1.69+.patch @@ -0,0 +1,19 @@ +Allow to use boost::system in header-only form when compiling with boost >= 1.69 +from https://github.com/arvidn/libtorrent/pull/5206 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -672,9 +672,12 @@ else() + endif() + + # Boost +-find_public_dependency(Boost REQUIRED COMPONENTS system) ++find_public_dependency(Boost REQUIRED) + target_include_directories(torrent-rasterbar PUBLIC ${Boost_INCLUDE_DIRS}) +-target_link_libraries(torrent-rasterbar PUBLIC ${Boost_SYSTEM_LIBRARY}) ++if (Boost_VERSION VERSION_LESS 106900) # CMP0093 OLD behavior ++ find_package(Boost REQUIRED COMPONENTS system) ++ target_link_libraries(torrent-rasterbar PUBLIC ${Boost_SYSTEM_LIBRARY}) ++endif() + + if (exceptions) + if (MSVC) diff --git a/recipes/libtorrent/all/patches/1.2.3-0003-include-cstddef.patch b/recipes/libtorrent/all/patches/1.2.3-0003-include-cstddef.patch new file mode 100644 index 0000000000000..3f02abddcd699 --- /dev/null +++ b/recipes/libtorrent/all/patches/1.2.3-0003-include-cstddef.patch @@ -0,0 +1,22 @@ +--- a/include/libtorrent/config.hpp ++++ b/include/libtorrent/config.hpp +@@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. + #ifndef TORRENT_CONFIG_HPP_INCLUDED + #define TORRENT_CONFIG_HPP_INCLUDED + ++#include ++ + #include "libtorrent/aux_/disable_warnings_push.hpp" + + #define _FILE_OFFSET_BITS 64 +--- a/include/libtorrent/ed25519.hpp ++++ b/include/libtorrent/ed25519.hpp +@@ -2,7 +2,7 @@ + #define ED25519_HPP + + #include "libtorrent/aux_/export.hpp" // for TORRENT_EXPORT +-#include // for size_t ++#include // for ptrdiff_t, size_t + + namespace libtorrent { + diff --git a/recipes/libtorrent/all/patches/1.2.3-0004-increase-handle-storage-sizes.patch b/recipes/libtorrent/all/patches/1.2.3-0004-increase-handle-storage-sizes.patch new file mode 100644 index 0000000000000..fd10945b0a863 --- /dev/null +++ b/recipes/libtorrent/all/patches/1.2.3-0004-increase-handle-storage-sizes.patch @@ -0,0 +1,64 @@ +Adapted from https://patch-diff.githubusercontent.com/raw/arvidn/libtorrent/pull/5170 + +From e771e347fc7559bc238264f47c8e9cb372628e59 Mon Sep 17 00:00:00 2001 +From: Arvid Norberg +Date: Sat, 19 Sep 2020 10:14:44 +0200 +Subject: [PATCH] increase handler storage sizes + +--- + include/libtorrent/aux_/allocating_handler.hpp | 2 ++ + include/libtorrent/aux_/session_impl.hpp | 4 ++-- + include/libtorrent/torrent.hpp | 2 +- + 3 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/include/libtorrent/aux_/allocating_handler.hpp b/include/libtorrent/aux_/allocating_handler.hpp +index f2353f724d..7014560273 100644 +--- a/include/libtorrent/aux_/allocating_handler.hpp ++++ b/include/libtorrent/aux_/allocating_handler.hpp +@@ -123,6 +123,7 @@ namespace libtorrent { namespace aux { + { + TORRENT_UNUSED(size); + TORRENT_ASSERT_VAL(size <= Size, size); ++ if (size > Size) std::abort(); + #if TORRENT_USE_ASSERTS + TORRENT_ASSERT(!ctx->storage.used); + ctx->storage.used = true; +@@ -138,6 +139,7 @@ namespace libtorrent { namespace aux { + TORRENT_UNUSED(ctx); + + TORRENT_ASSERT_VAL(size <= Size, size); ++ if (size > Size) std::abort(); + TORRENT_ASSERT(ptr == &ctx->storage.bytes); + #if TORRENT_USE_ASSERTS + ctx->storage.used = false; +diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp +index 4456c364cc..573039a4db 100644 +--- a/include/libtorrent/aux_/session_impl.hpp ++++ b/include/libtorrent/aux_/session_impl.hpp +@@ -1220,9 +1220,9 @@ namespace aux { + + // abort may not fail and cannot allocate memory + #if defined BOOST_ASIO_ENABLE_HANDLER_TRACKING +- aux::handler_storage<100> m_abort_handler_storage; ++ aux::handler_storage<104> m_abort_handler_storage; + #elif defined _M_AMD64 +- aux::handler_storage<88> m_abort_handler_storage; ++ aux::handler_storage<96> m_abort_handler_storage; + #else +- aux::handler_storage<56> m_abort_handler_storage; ++ aux::handler_storage<64> m_abort_handler_storage; + #endif +diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp +index d1cc872ace..0df00263f1 100644 +--- a/include/libtorrent/torrent.hpp ++++ b/include/libtorrent/torrent.hpp +@@ -1441,7 +1441,7 @@ namespace libtorrent { + // used to post a message to defer disconnecting peers + std::vector> m_peers_to_disconnect; + aux::deferred_handler m_deferred_disconnect; + #ifdef _M_AMD64 +- aux::handler_storage<96> m_deferred_handler_storage; ++ aux::handler_storage<104> m_deferred_handler_storage; + #else +- aux::handler_storage<64> m_deferred_handler_storage; ++ aux::handler_storage<72> m_deferred_handler_storage; diff --git a/recipes/libtorrent/all/test_package/CMakeLists.txt b/recipes/libtorrent/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ad88123584e9b --- /dev/null +++ b/recipes/libtorrent/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) +endif() + +find_package(LibtorrentRasterbar REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LibtorrentRasterbar::torrent-rasterbar) +if(LibtorrentRasterbar_VERSION VERSION_LESS "2.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/libtorrent/all/test_package/conanfile.py b/recipes/libtorrent/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9dc671ff8c098 --- /dev/null +++ b/recipes/libtorrent/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_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") + # from https://en.wikipedia.org/wiki/Magnet_URI_scheme + magnet_url = "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a" + self.run(f"{bin_path} {magnet_url}", env="conanrun") diff --git a/recipes/libtorrent/all/test_package/test_package.cpp b/recipes/libtorrent/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f5601a6b151de --- /dev/null +++ b/recipes/libtorrent/all/test_package/test_package.cpp @@ -0,0 +1,53 @@ +// From https://www.libtorrent.org/tutorial.html + +#include +#include +#include +#include +#include + +#include +#include +#include + +int main(int argc, char const* argv[]) try +{ + if (argc != 2) { + std::cerr << "usage: " << argv[0] << " " << std::endl; + return 1; + } + lt::settings_pack p; + p.set_int(lt::settings_pack::alert_mask, lt::alert::status_notification + | lt::alert::error_notification); + lt::session ses(p); + + lt::add_torrent_params atp = lt::parse_magnet_uri(argv[1]); + atp.save_path = "."; // save in current dir +// lt::torrent_handle h = ses.add_torrent(std::move(atp)); + + std::cout << "skipping download...\n"; + +// for (;;) { +// std::vector alerts; +// ses.pop_alerts(&alerts); +// +// for (lt::alert const* a : alerts) { +// std::cout << a->message() << std::endl; +// // if we receive the finished alert or an error, we're done +// if (lt::alert_cast(a)) { +// goto done; +// } +// if (lt::alert_cast(a)) { +// goto done; +// } +// } +// std::this_thread::sleep_for(std::chrono::milliseconds(200)); +// } + + done: + std::cout << "done, shutting down" << std::endl; +} +catch (std::exception& e) +{ + std::cerr << "Error: " << e.what() << std::endl; +} diff --git a/recipes/libtorrent/all/test_v1_package/CMakeLists.txt b/recipes/libtorrent/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/libtorrent/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libtorrent/all/test_v1_package/conanfile.py b/recipes/libtorrent/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d96fde1be2e9a --- /dev/null +++ b/recipes/libtorrent/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +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") + # from https://en.wikipedia.org/wiki/Magnet_URI_scheme + magnet_url = "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a" + self.run("{} {}".format(bin_path, magnet_url), run_environment=True) diff --git a/recipes/libtorrent/config.yml b/recipes/libtorrent/config.yml new file mode 100644 index 0000000000000..aabaf7330b305 --- /dev/null +++ b/recipes/libtorrent/config.yml @@ -0,0 +1,7 @@ +versions: + "2.0.8": + folder: "all" + "2.0.1": + folder: "all" + "1.2.3": + folder: "all" diff --git a/recipes/libucl/all/conandata.yml b/recipes/libucl/all/conandata.yml new file mode 100644 index 0000000000000..11db4b55879f9 --- /dev/null +++ b/recipes/libucl/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "0.8.2": + url: "https://github.com/vstakhov/libucl/archive/refs/tags/0.8.2.tar.gz" + sha256: "d95a0e2151cc167a0f3e51864fea4e8977a0f4c473faa805269a347f7fb4e165" + "0.8.1": + url: "https://github.com/vstakhov/libucl/archive/refs/tags/0.8.1.tar.gz" + sha256: "a6397e179672f0e8171a0f9a2cfc37e01432b357fd748b13f4394436689d24ef" +patches: + "0.8.2": + - patch_file: "patches/0001-0.8.1-shared-win32.patch" + patch_description: "fix UCL_EXTERN definition for shared build on win32" + patch_type: "portability" + - patch_file: "patches/0002-0.8.2-cmake-add-install+use-find_package.patch" + patch_description: "improve installation, use cci package" + patch_type: "conan" + - patch_file: "patches/0003-no-strings-h.patch" + patch_description: "include string.h instead of strings.h" + patch_type: "portability" + - patch_file: "patches/0004-0.8.2-cmake-minimum-required.patch" + patch_description: "declare cmake_minimum_required first" + patch_type: "portability" + - patch_file: "patches/0005-0.8.1-add-_tmp.patch" + patch_description: "add _tmp variables in sort macros" + patch_type: "portability" + "0.8.1": + - patch_file: "patches/0001-0.8.1-shared-win32.patch" + patch_description: "fix UCL_EXTERN definition for shared build on win32" + patch_type: "portability" + - patch_file: "patches/0002-0.8.1-cmake-add-install+use-find_package.patch" + patch_description: "improve installation, use cci package" + patch_type: "conan" + - patch_file: "patches/0003-no-strings-h.patch" + patch_description: "include string.h instead of strings.h" + patch_type: "portability" + - patch_file: "patches/0004-0.8.1-cmake-minimum-required.patch" + patch_description: "declare cmake_minimum_required first" + patch_type: "portability" + - patch_file: "patches/0005-0.8.1-add-_tmp.patch" + patch_description: "add _tmp variables in sort macros" + patch_type: "portability" diff --git a/recipes/libucl/all/conanfile.py b/recipes/libucl/all/conanfile.py new file mode 100644 index 0000000000000..99131d4e95863 --- /dev/null +++ b/recipes/libucl/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class LibuclConan(ConanFile): + name = "libucl" + description = "Universal configuration library parser" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vstakhov/libucl" + topics = ("universal", "configuration", "language", "parser", "ucl") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_url_include": [True, False], + "enable_url_sign": [True, False], + "with_lua": [False, "lua", "luajit"], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_url_include": False, + "enable_url_sign": False, + "with_lua": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.enable_url_include: + self.requires("libcurl/7.86.0") + if self.options.enable_url_sign: + self.requires("openssl/1.1.1s") + if self.options.with_lua == "lua": + self.requires("lua/5.4.4") + elif self.options.with_lua == "luajit": + self.requires("luajit/2.0.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + on_off = lambda v: "ON" if v else "OFF" + tc.variables["ENABLE_URL_INCLUDE"] = on_off(self.options.enable_url_include) + tc.variables["ENABLE_URL_SIGN"] = on_off(self.options.enable_url_sign) + tc.variables["ENABLE_LUA"] = on_off(self.options.with_lua == "lua") + tc.variables["ENABLE_LUAJIT"] = on_off(self.options.with_lua == "luajit") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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, "share")) + + def package_info(self): + self.cpp_info.libs = ["ucl"] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("UCL_STATIC") + + self.cpp_info.set_property("pkg_config_name", "libucl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["pkg_config"] = "libucl" diff --git a/recipes/libucl/all/patches/0001-0.8.1-shared-win32.patch b/recipes/libucl/all/patches/0001-0.8.1-shared-win32.patch new file mode 100644 index 0000000000000..4308bb8589a0d --- /dev/null +++ b/recipes/libucl/all/patches/0001-0.8.1-shared-win32.patch @@ -0,0 +1,16 @@ +--- include/ucl.h ++++ include/ucl.h +@@ -33,7 +33,12 @@ + #include +- + #ifdef _WIN32 ++#ifdef ucl_EXPORTS + # define UCL_EXTERN __declspec(dllexport) ++#elif !defined(UCL_STATIC) ++# define UCL_EXTERN __declspec(dllimport) + #else + # define UCL_EXTERN ++#endif ++#else ++# define UCL_EXTERN + #endif diff --git a/recipes/libucl/all/patches/0002-0.8.1-cmake-add-install+use-find_package.patch b/recipes/libucl/all/patches/0002-0.8.1-cmake-add-install+use-find_package.patch new file mode 100644 index 0000000000000..1d7992b85f978 --- /dev/null +++ b/recipes/libucl/all/patches/0002-0.8.1-cmake-add-install+use-find_package.patch @@ -0,0 +1,112 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b55faf..f1da7ea 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,11 +5,14 @@ SET(LIBUCL_VERSION_MAJOR 0) + SET(LIBUCL_VERSION_MINOR 5) + SET(LIBUCL_VERSION_PATCH 0) + +-SET(LIBUCL_VERSION +- "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") ++SET(LIBUCL_VERSION "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") + + INCLUDE(CheckCCompilerFlag) +-INCLUDE(FindOpenSSL) ++IF(ENABLE_URL_SIGN) ++ FIND_PACKAGE(OpenSSL REQUIRED) ++ SET(HAVE_OPENSSL 1) ++ ADD_DEFINITIONS(-DHAVE_OPENSSL) ++ENDIF(ENABLE_URL_SIGN) + + OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) + OPTION(ENABLE_URL_SIGN "Enable signatures check in ucl includes (requires openssl) [default: OFF]" OFF) +@@ -131,31 +134,11 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt) + ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + +-IF(ENABLE_URL_INCLUDE MATCHES "ON") +- FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib +- PATHS +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local +- /usr +- /sw +- /opt/local +- /opt/csw +- /opt +- DOC "Path where the libfetch library can be found") +- IF(LIBFETCH_LIBRARY) +- FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include +- /opt/include +- /usr/local/include +- DOC "Path to libfetch header") +- ELSE(LIBFETCH_LIBRARY) +- # Try to find libcurl +- ProcessPackage(CURL libcurl) +- IF(NOT CURL_FOUND) +- MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") +- ENDIF(NOT CURL_FOUND) +- ENDIF(LIBFETCH_LIBRARY) +-ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") ++IF(ENABLE_URL_INCLUDE) ++ FIND_PACKAGE(CURL REQUIRED) ++ ADD_DEFINITIONS(-DCURL_FOUND) ++ SET(CURL_LIBRARIES CURL::libcurl) ++ENDIF() + + SET(CMAKE_C_WARN_FLAGS "") + CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) +@@ -214,35 +198,22 @@ IF (BUILD_SHARED_LIBS) + ENDIF (BUILD_SHARED_LIBS) + ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC}) + SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) +- +-IF(ENABLE_LUA MATCHES "ON") +- IF(ENABLE_LUAJIT MATCHES "ON") +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") +- IF(NOT LUA_FOUND) +- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") +- ELSE(NOT LUA_FOUND) +- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") +- ENDIF(NOT LUA_FOUND) +- ELSE(ENABLE_LUAJIT MATCHES "ON") +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") +- IF(NOT LUA_FOUND) +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") +- ENDIF(NOT LUA_FOUND) +- IF(NOT LUA_FOUND) +- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") +- ELSE(NOT LUA_FOUND) +- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") +- ENDIF(NOT LUA_FOUND) +- ENDIF(ENABLE_LUAJIT MATCHES "ON") ++INSTALL(TARGETS ucl RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++IF(ENABLE_LUA OR ENABLE_LUAJIT) + SET(UCL_LUA_SRC lua/lua_ucl.c) + ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) +- IF(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") +- ELSE(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") +- ENDIF(ENABLE_LUAJIT MATCHES "ON") + TARGET_LINK_LIBRARIES(lua-ucl ucl) + SET_TARGET_PROPERTIES(lua-ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) ++ IF(ENABLE_LUA) ++ FIND_PACKAGE(lua REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) ++ ++ ELSEIF(ENABLE_LUAJIT) ++ FIND_PACKAGE(luajit REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) ++ ENDIF() ++ INSTALL(TARGETS lua-ucl RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ INSTALL(FILES include/lua_ucl.h DESTINATION include) + ENDIF() + + IF(HAVE_FETCH_H) +@@ -257,3 +228,4 @@ IF(ENABLE_URL_SIGN MATCHES "ON") + TARGET_LINK_LIBRARIES(ucl ${OPENSSL_LIBRARIES}) + ENDIF(OPENSSL_FOUND) + ENDIF(ENABLE_URL_SIGN MATCHES "ON") ++INSTALL(FILES include/ucl.h include/ucl++.h DESTINATION include) diff --git a/recipes/libucl/all/patches/0002-0.8.2-cmake-add-install+use-find_package.patch b/recipes/libucl/all/patches/0002-0.8.2-cmake-add-install+use-find_package.patch new file mode 100644 index 0000000000000..77a86c7056b3c --- /dev/null +++ b/recipes/libucl/all/patches/0002-0.8.2-cmake-add-install+use-find_package.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2201988..3698b95 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,12 +5,15 @@ SET(LIBUCL_VERSION_MAJOR 0) + SET(LIBUCL_VERSION_MINOR 8) + SET(LIBUCL_VERSION_PATCH 2) + +-SET(LIBUCL_VERSION +- "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") ++SET(LIBUCL_VERSION "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") + + INCLUDE(CheckCCompilerFlag) + INCLUDE(CheckCSourceCompiles) +-INCLUDE(FindOpenSSL) ++IF(ENABLE_URL_SIGN) ++ FIND_PACKAGE(OpenSSL REQUIRED) ++ SET(HAVE_OPENSSL 1) ++ ADD_DEFINITIONS(-DHAVE_OPENSSL) ++ENDIF(ENABLE_URL_SIGN) + INCLUDE(GNUInstallDirs) + + OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) +@@ -135,30 +138,10 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + + IF(ENABLE_URL_INCLUDE MATCHES "ON") +- FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib +- PATHS +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local +- /usr +- /sw +- /opt/local +- /opt/csw +- /opt +- DOC "Path where the libfetch library can be found") +- IF(LIBFETCH_LIBRARY) +- FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include +- /opt/include +- /usr/local/include +- DOC "Path to libfetch header") +- ELSE(LIBFETCH_LIBRARY) +- # Try to find libcurl +- FIND_PACKAGE(CURL) +- IF(NOT CURL_FOUND) +- MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") +- ENDIF(NOT CURL_FOUND) +- ENDIF(LIBFETCH_LIBRARY) +-ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") ++ FIND_PACKAGE(CURL REQUIRED) ++ ADD_DEFINITIONS(-DCURL_FOUND) ++ SET(CURL_LIBRARIES CURL::libcurl) ++ENDIF() + + set(SYNC_BUILTINS_TEST_SOURCE [====[ + int main() +@@ -249,35 +232,24 @@ TARGET_COMPILE_DEFINITIONS(ucl + ${UCL_COMPILE_DEFS} + ) + +-IF(ENABLE_LUA MATCHES "ON") +- IF(ENABLE_LUAJIT MATCHES "ON") +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") +- IF(NOT LUA_FOUND) +- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") +- ELSE(NOT LUA_FOUND) +- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") +- ENDIF(NOT LUA_FOUND) +- ELSE(ENABLE_LUAJIT MATCHES "ON") +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") +- IF(NOT LUA_FOUND) +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") +- ENDIF(NOT LUA_FOUND) +- IF(NOT LUA_FOUND) +- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") +- ELSE(NOT LUA_FOUND) +- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") +- ENDIF(NOT LUA_FOUND) +- ENDIF(ENABLE_LUAJIT MATCHES "ON") ++IF(ENABLE_LUA OR ENABLE_LUAJIT) + SET(UCL_LUA_SRC lua/lua_ucl.c) + ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) + ADD_LIBRARY(ucl::lua ALIAS lua-ucl) ++ TARGET_LINK_LIBRARIES(lua-ucl ucl) + IF(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") ++ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) + ELSE(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") ++ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) + ENDIF(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl ucl) + TARGET_INCLUDE_DIRECTORIES(lua-ucl PUBLIC include PRIVATE src uthash) ++ IF(ENABLE_LUA) ++ FIND_PACKAGE(lua REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) ++ ELSEIF(ENABLE_LUAJIT) ++ FIND_PACKAGE(luajit REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) ++ ENDIF() + SET_TARGET_PROPERTIES(lua-ucl PROPERTIES + VERSION ${LIBUCL_VERSION} + SOVERSION ${LIBUCL_VERSION_MAJOR} +@@ -306,7 +278,10 @@ ENDIF(UNIX) + SET_TARGET_PROPERTIES(ucl PROPERTIES + PUBLIC_HEADER "${UCLHDR}") + +-INSTALL(TARGETS ucl EXPORT uclConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} ++INSTALL(TARGETS ucl EXPORT uclConfig ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + IF(ENABLE_UTILS MATCHES "ON") +@@ -318,4 +293,3 @@ install(EXPORT uclConfig + NAMESPACE ucl:: + DESTINATION "share/ucl" + ) +- diff --git a/recipes/libucl/all/patches/0003-no-strings-h.patch b/recipes/libucl/all/patches/0003-no-strings-h.patch new file mode 100644 index 0000000000000..dffd4b0ed1895 --- /dev/null +++ b/recipes/libucl/all/patches/0003-no-strings-h.patch @@ -0,0 +1,11 @@ +--- lua/lua_ucl.c ++++ lua/lua_ucl.c +@@ -28,7 +28,7 @@ + #include "ucl.h" + #include "ucl_internal.h" + #include "lua_ucl.h" +-#include ++#include + + /*** + * @module ucl diff --git a/recipes/libucl/all/patches/0004-0.8.1-cmake-minimum-required.patch b/recipes/libucl/all/patches/0004-0.8.1-cmake-minimum-required.patch new file mode 100644 index 0000000000000..e7867f1cb9467 --- /dev/null +++ b/recipes/libucl/all/patches/0004-0.8.1-cmake-minimum-required.patch @@ -0,0 +1,11 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b55faf..2cb451f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-PROJECT(libucl C) + CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) ++PROJECT(libucl C) + + SET(LIBUCL_VERSION_MAJOR 0) + SET(LIBUCL_VERSION_MINOR 5) diff --git a/recipes/libucl/all/patches/0004-0.8.2-cmake-minimum-required.patch b/recipes/libucl/all/patches/0004-0.8.2-cmake-minimum-required.patch new file mode 100644 index 0000000000000..85485f92c8168 --- /dev/null +++ b/recipes/libucl/all/patches/0004-0.8.2-cmake-minimum-required.patch @@ -0,0 +1,11 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2201988..0b29181 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ +-PROJECT(libucl C) + CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0 FATAL_ERROR) ++PROJECT(libucl C) + + SET(LIBUCL_VERSION_MAJOR 0) + SET(LIBUCL_VERSION_MINOR 8) diff --git a/recipes/libucl/all/patches/0005-0.8.1-add-_tmp.patch b/recipes/libucl/all/patches/0005-0.8.1-add-_tmp.patch new file mode 100644 index 0000000000000..fc6e6059b0ed9 --- /dev/null +++ b/recipes/libucl/all/patches/0005-0.8.1-add-_tmp.patch @@ -0,0 +1,20 @@ +diff --git a/a/uthash/utlist.h b/b/uthash/utlist.h +index c82dd91..7369161 100644 +--- a/a/uthash/utlist.h ++++ b/b/uthash/utlist.h +@@ -111,6 +111,7 @@ do { + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ ++ LDECLTYPE(list) _tmp; \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ +@@ -174,6 +175,7 @@ do { + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ ++ LDECLTYPE(list) _tmp; \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ diff --git a/recipes/libucl/all/test_package/CMakeLists.txt b/recipes/libucl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6bc1b43c40b43 --- /dev/null +++ b/recipes/libucl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libucl REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libucl::libucl) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libucl/all/test_package/conanfile.py b/recipes/libucl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1848829203c84 --- /dev/null +++ b/recipes/libucl/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") + sample_conf = os.path.join(self.source_folder, "sample.conf") + self.run(f"{bin_path} {sample_conf}", env="conanrun") diff --git a/recipes/libucl/all/test_package/sample.conf b/recipes/libucl/all/test_package/sample.conf new file mode 100644 index 0000000000000..762cf3ad052d3 --- /dev/null +++ b/recipes/libucl/all/test_package/sample.conf @@ -0,0 +1,19 @@ +param = value; +section { + param = value; + param1 = value1; + flag = true; + number = 10k; + time = 0.2s; + string = "something"; + subsection { + host = { + host = "hostname"; + port = 900; + } + host = { + host = "hostname"; + port = 901; + } + } +} diff --git a/recipes/libucl/all/test_package/test_package.cpp b/recipes/libucl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c36638ce655ec --- /dev/null +++ b/recipes/libucl/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include "ucl++.h" + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + if (argc < 2) { + std::cerr << "Usage: " << argv[0] << " FILE\n"; + return 1; + } + std::string input, err; + + std::ifstream ifs(argv[1]); + input.assign(std::istreambuf_iterator(ifs), std::istreambuf_iterator()); + + auto obj = ucl::Ucl::parse(input, err); + + if (obj) { + std::cout << "input config is:\n"; + std::cout << obj.dump(UCL_EMIT_CONFIG) << std::endl; + std::cout << "======\n"; + + for (const auto &o : obj) { + std::cout << "obj: " << o.dump(UCL_EMIT_CONFIG) << std::endl; + } + } + else { + std::cerr << "error: " << err << std::endl; + return 1; + } + return 0; +} diff --git a/recipes/libucl/all/test_v1_package/CMakeLists.txt b/recipes/libucl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/libucl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libucl/all/test_v1_package/conanfile.py b/recipes/libucl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..bb7585234f070 --- /dev/null +++ b/recipes/libucl/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class 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") + sample_conf = os.path.join(self.source_folder, os.pardir, "test_package", "sample.conf") + self.run(f"{bin_path} {sample_conf}", run_environment=True) diff --git a/recipes/libucl/config.yml b/recipes/libucl/config.yml new file mode 100644 index 0000000000000..7a9cbb2ce8ecb --- /dev/null +++ b/recipes/libucl/config.yml @@ -0,0 +1,5 @@ +versions: + "0.8.2": + folder: all + "0.8.1": + folder: all diff --git a/recipes/libudev/all/conanfile.py b/recipes/libudev/all/conanfile.py new file mode 100644 index 0000000000000..46c164d11074a --- /dev/null +++ b/recipes/libudev/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.system import package_manager +from conan.tools.gnu import PkgConfig + +required_conan_version = ">=1.50.0" + + +class LibUDEVConan(ConanFile): + name = "libudev" + version = "system" + description = "API for enumerating and introspecting local devices" + topics = ("udev", "devices", "enumerating") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/software/systemd/man/udev.html" + license = "GPL-2.0-or-later", "LGPL-2.1-or-later" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libudev is only supported on Linux.") + + def package_id(self): + self.info.clear() + + def system_requirements(self): + dnf = package_manager.Dnf(self) + dnf.install(["systemd-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["systemd-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libudev-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["systemd-libs"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install_substitutes(["libudev-devel"], ["systemd-devel"], update=True, check=True) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + pkg_config = PkgConfig(self, "libudev") + pkg_config.fill_cpp_info(self.cpp_info) diff --git a/recipes/libudev/all/test_package/CMakeLists.txt b/recipes/libudev/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c22649f436e09 --- /dev/null +++ b/recipes/libudev/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(libudev REQUIRED CONFIG) + + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libudev::libudev) diff --git a/recipes/libudev/all/test_package/conanfile.py b/recipes/libudev/all/test_package/conanfile.py new file mode 100644 index 0000000000000..07906beea6e20 --- /dev/null +++ b/recipes/libudev/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +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" + + 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/libudev/all/test_package/test_package.c b/recipes/libudev/all/test_package/test_package.c new file mode 100644 index 0000000000000..05b8913de0a37 --- /dev/null +++ b/recipes/libudev/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include +#include +#include + + +int main() { + struct udev *udev; + struct udev_enumerate *enumerate; + + udev = udev_new(); + if (!udev) { + fprintf(stderr, "Cannot create udev context.\n"); + return 1; + } + + enumerate = udev_enumerate_new(udev); + if (!enumerate) { + fprintf(stderr, "Cannot create enumerate context.\n"); + } + + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return EXIT_SUCCESS; +} diff --git a/recipes/libudev/all/test_v1_package/CMakeLists.txt b/recipes/libudev/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libudev/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libudev/all/test_v1_package/conanfile.py b/recipes/libudev/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libudev/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libudev/config.yml b/recipes/libudev/config.yml new file mode 100644 index 0000000000000..0594dfd676099 --- /dev/null +++ b/recipes/libudev/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: all diff --git a/recipes/libui/all/CMakeLists.txt b/recipes/libui/all/CMakeLists.txt new file mode 100644 index 0000000000000..1848ca5a77c35 --- /dev/null +++ b/recipes/libui/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libui/all/conandata.yml b/recipes/libui/all/conandata.yml new file mode 100644 index 0000000000000..0a67f738841ba --- /dev/null +++ b/recipes/libui/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.1": + url: "https://github.com/andlabs/libui/archive/refs/tags/alpha4.1.tar.gz" + sha256: "f51a9e20e9f9a4c0bce1571ee37f203f42de33e3ac7359a6aac87a54798e8716" diff --git a/recipes/libui/all/conanfile.py b/recipes/libui/all/conanfile.py new file mode 100644 index 0000000000000..ad51102fff618 --- /dev/null +++ b/recipes/libui/all/conanfile.py @@ -0,0 +1,79 @@ +from conans import ConanFile, CMake, tools +from conans.tools import os_info +import os + + +class libuiConan(ConanFile): + name = "libui" + description = "Simple and portable GUI library in C that uses the native GUI technologies of each platform it supports." + topics = ("conan", "libui", "ui", "gui") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/andlabs/libui" + license = "MIT" + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "pkg_config" + 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" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def requirements(self): + self.requires("gtk/3.24.24") + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", + src=self._source_subfolder) + self.copy(pattern="*.h", dst="include", src=self._source_subfolder) + self.copy(pattern="*.dll", dst="bin", keep_path=False) + self.copy(pattern="*.lib", dst="lib", keep_path=False) + self.copy(pattern="*.a", dst="lib", keep_path=False) + self.copy(pattern="*.so*", dst="lib", keep_path=False) + self.copy(pattern="*.dylib", dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend( + [ + "user32", + "kernel32", + "gdi32", + "comctl32", + "msimg32", + "comdlg32", + "d2d1", + "dwrite", + "ole32", + "oleaut32", + "oleacc", + "uuid", + "windowscodecs", + ] + ) diff --git a/recipes/libui/all/test_package/CMakeLists.txt b/recipes/libui/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e04a827e1a3a6 --- /dev/null +++ b/recipes/libui/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libui/all/test_package/conanfile.py b/recipes/libui/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/libui/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libui/all/test_package/test_package.c b/recipes/libui/all/test_package/test_package.c new file mode 100644 index 0000000000000..05cbda99a5182 --- /dev/null +++ b/recipes/libui/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include "ui.h" +#include + +int main(void) +{ + uiInitOptions o; + + const char *err; + o.Size = 0; + err = uiInit(&o); + if (err != NULL) + { + fprintf(stderr, "error initializing ui: %s\n", err); + uiFreeInitError(err); + return 0; + } + + uiMain(); + uiUninit(); + return 0; +} diff --git a/recipes/libui/config.yml b/recipes/libui/config.yml new file mode 100644 index 0000000000000..7a1b9bbda9fca --- /dev/null +++ b/recipes/libui/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.1": + folder: "all" diff --git a/recipes/libunifex/all/CMakeLists.txt b/recipes/libunifex/all/CMakeLists.txt new file mode 100644 index 0000000000000..4beb13671fe5e --- /dev/null +++ b/recipes/libunifex/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8) +project(cmake_wrapper) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libunifex/all/conandata.yml b/recipes/libunifex/all/conandata.yml new file mode 100644 index 0000000000000..2eaea0e7a17a7 --- /dev/null +++ b/recipes/libunifex/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220430": + url: "https://github.com/facebookexperimental/libunifex/archive/c359fd8e7d97d91359cf4a6c1dbef99b0b1767b6.tar.gz" + sha256: "c306891967fa4cc1a22f3401581d35ceea41eb1dbdac3e6157ecf3defaa4b15d" diff --git a/recipes/libunifex/all/conanfile.py b/recipes/libunifex/all/conanfile.py new file mode 100644 index 0000000000000..49d7f959dc539 --- /dev/null +++ b/recipes/libunifex/all/conanfile.py @@ -0,0 +1,110 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import functools +import os + +required_conan_version = ">=1.43.0" + + +class LibunifexConan(ConanFile): + name = "libunifex" + license = ("Apache-2.0", "LLVM-exception") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/facebookexperimental/libunifex" + description = "A prototype implementation of the C++ sender/receiver async programming model" + topics = ("async", "cpp") + + settings = "os", "arch", "compiler", "build_type" + + generators = "cmake", "cmake_find_package_multi" + no_copy_source = True + exports_sources = ["CMakeLists.txt"] + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "16", + "clang": "10", + "apple-clang": "11", + } + + @property + def _minimum_standard(self): + return "17" + + # FIXME: Add support for liburing + # def requirements(self): + # TODO: Make an option to opt-out of liburing for old kernel versions + # if self.settings.os == "Linux": + # self.requires("liburing/2.1") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd( + self, self._minimum_standard) + + def lazy_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if not minimum_version: + self.output.warn( + "{0} {1} requires C++{2}. Your compiler is unknown. Assuming it supports C++{2}." + .format(self.name, self.version, self._minimum_standard)) + elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + "{} {} requires C++{}, which your compiler does not support." + .format(self.name, self.version, self._minimum_standard)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_TESTING"] = "OFF" + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "unifex") + self.cpp_info.set_property("cmake_target_name", "unifex::unifex") + self.cpp_info.set_property("pkg_config_name", "unifex") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "unifex" + self.cpp_info.filenames["cmake_find_package_multi"] = "unifex" + self.cpp_info.names["cmake_find_package"] = "unifex" + self.cpp_info.names["cmake_find_package_multi"] = "unifex" + self.cpp_info.names["pkg_config"] = "unifex" + self.cpp_info.components["unifex"].names["cmake_find_package"] = "unifex" + self.cpp_info.components["unifex"].names["cmake_find_package_multi"] = "unifex" + self.cpp_info.components["unifex"].set_property( + "cmake_target_name", "unifex::unifex") + self.cpp_info.components["unifex"].libs = ["unifex"] + + if self.settings.os == "Linux": + self.cpp_info.components["unifex"].system_libs = ["pthread"] + # self.cpp_info.components["unifex"].requires.append( + # "liburing::liburing") diff --git a/recipes/libunifex/all/test_package/CMakeLists.txt b/recipes/libunifex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a487dfdf2b7ad --- /dev/null +++ b/recipes/libunifex/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(unifex REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE unifex::unifex) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/libunifex/all/test_package/conanfile.py b/recipes/libunifex/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libunifex/all/test_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/libunifex/all/test_package/test_package.cpp b/recipes/libunifex/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d800f29f3a0d9 --- /dev/null +++ b/recipes/libunifex/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include + +#include + +using namespace unifex; +using namespace std::chrono_literals; + +int main() { + timed_single_thread_context context; + auto scheduler = context.get_scheduler(); + + int count = 0; + sync_wait(then(schedule_after(scheduler, 200ms), [&] { ++count; })); + + return !(count == 1); +} diff --git a/recipes/libunifex/config.yml b/recipes/libunifex/config.yml new file mode 100644 index 0000000000000..1bf3ed95d8368 --- /dev/null +++ b/recipes/libunifex/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220430": + folder: "all" diff --git a/recipes/libunistring/all/conandata.yml b/recipes/libunistring/all/conandata.yml new file mode 100644 index 0000000000000..c22acd0ca0e42 --- /dev/null +++ b/recipes/libunistring/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.10": + url: "https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.gz" + sha256: "a82e5b333339a88ea4608e4635479a1cfb2e01aafb925e1290b65710d43f610b" diff --git a/recipes/libunistring/all/conanfile.py b/recipes/libunistring/all/conanfile.py new file mode 100644 index 0000000000000..472b3ef45ff34 --- /dev/null +++ b/recipes/libunistring/all/conanfile.py @@ -0,0 +1,97 @@ +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 copy, get, rm, 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 +import os + +required_conan_version = ">=1.53.0" + + +class LibUnistringConan(ConanFile): + name = "libunistring" + description = ( + "This library provides functions for manipulating Unicode strings and " + "for manipulating C strings according to the Unicode standard." + ) + homepage = "https://www.gnu.org/software/libunistring/" + topics = ("unicode", "string") + license = "LGPL-3.0-or-later" + 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 _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("Visual Studio is unsupported") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + 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) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["unistring"] + if not self.options.shared and is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") diff --git a/recipes/libunistring/all/test_package/CMakeLists.txt b/recipes/libunistring/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07b5ca4d6ab00 --- /dev/null +++ b/recipes/libunistring/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libunistring REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libunistring::libunistring) diff --git a/recipes/libunistring/all/test_package/conanfile.py b/recipes/libunistring/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libunistring/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/libunistring/all/test_package/test_package.c b/recipes/libunistring/all/test_package/test_package.c new file mode 100644 index 0000000000000..9050fcb1e3494 --- /dev/null +++ b/recipes/libunistring/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include + +#include +#include +#include + +int main(int argc, char * argv[]) { + const char *text = "This is some text"; + if (u8_check(text, strlen(text)) != NULL) { + printf("u8_check failed on input string\n"); + return 1; + } + uint16_t resultbuf[64]; + size_t resultSize = 64; + u8_to_u16(text, strlen(text)+1, resultbuf, &resultSize); + if (u16_check(resultbuf, resultSize) != NULL) { + printf("u16_check failed\n"); + return 1; + } + printf( "char array: '%s'\n", text); + wprintf(L"wide char array: '%s'\n", resultbuf); + return 0; +} diff --git a/recipes/libunistring/all/test_v1_package/CMakeLists.txt b/recipes/libunistring/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libunistring/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libunistring/all/test_v1_package/conanfile.py b/recipes/libunistring/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libunistring/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/libunistring/config.yml b/recipes/libunistring/config.yml new file mode 100644 index 0000000000000..b2646e05f90e5 --- /dev/null +++ b/recipes/libunistring/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.10": + folder: all diff --git a/recipes/libunwind/all/conandata.yml b/recipes/libunwind/all/conandata.yml new file mode 100644 index 0000000000000..3379c640096e5 --- /dev/null +++ b/recipes/libunwind/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.6.2": + url: "https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz" + sha256: "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976" + "1.5.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.5/libunwind-1.5.0.tar.gz" + sha256: "90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017" + "1.3.1": + url: "https://github.com/libunwind/libunwind/releases/download/v1.3.1/libunwind-1.3.1.tar.gz" + sha256: "43997a3939b6ccdf2f669b50fdb8a4d3205374728c2923ddc2354c65260214f8" +patches: + "1.3.1": + - patch_file: "patches/0001-multiple-definition-gcc10.patch" diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py new file mode 100644 index 0000000000000..dd6ce3246217b --- /dev/null +++ b/recipes/libunwind/all/conanfile.py @@ -0,0 +1,133 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +import os +import shutil + +required_conan_version = ">=1.53.0" + +class LiunwindConan(ConanFile): + name = "libunwind" + description = "Manipulate the preserved state of each call-frame and resume the execution at any point." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libunwind/libunwind" + topics = ("unwind", "debuggers", "exception-handling", "introspection", "setjmp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "coredump": [True, False], + "ptrace": [True, False], + "setjmp": [True, False], + "minidebuginfo": [True, False], + "zlibdebuginfo": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "coredump": True, + "ptrace": True, + "setjmp": True, + "minidebuginfo": True, + "zlibdebuginfo": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.minidebuginfo: + self.requires("xz_utils/5.4.0") + if self.options.zlibdebuginfo: + self.requires("zlib/1.2.13") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("libunwind is only supported on Linux and FreeBSD") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-coredump={yes_no(self.options.coredump)}", + f"--enable-ptrace={yes_no(self.options.ptrace)}", + f"--enable-setjmp={yes_no(self.options.setjmp)}", + f"--enable-minidebuginfo={yes_no(self.options.minidebuginfo)}", + f"--enable-zlibdebuginfo={yes_no(self.options.zlibdebuginfo)}", + "--disable-tests", + "--disable-documentation", + ]) + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + # In install-exec-hook in Makefile.am, libunwind_generic is linked to libunwind_${arch}. + # As this seems to be unnecessary for the conan package. + # rename the real file to libunwind_generic, + lib_ext = "so" if self.options.shared else "a" + symlink_path = os.path.join(self.package_folder, "lib", f"libunwind-generic.{lib_ext}") + source_path = os.path.realpath(symlink_path) + rm(self, os.path.basename(symlink_path), os.path.dirname(symlink_path)) + shutil.copy(source_path, symlink_path) + + def package_info(self): + self.cpp_info.components["unwind"].set_property("pkg_config_name", "libunwind") + self.cpp_info.components["unwind"].libs = ["unwind"] + if self.options.minidebuginfo: + self.cpp_info.components["unwind"].requires.append("xz_utils::xz_utils") + if self.options.zlibdebuginfo: + self.cpp_info.components["unwind"].requires.append("zlib::zlib") + if self.settings.os == "Linux": + self.cpp_info.components["unwind"].system_libs.append("pthread") + self.cpp_info.components["generic"].set_property("pkg_config_name", "libunwind-generic") + self.cpp_info.components["generic"].libs = ["unwind-generic"] + self.cpp_info.components["generic"].requires = ["unwind"] + if self.options.ptrace: + self.cpp_info.components["ptrace"].set_property("pkg_config_name", "libunwind-ptrace") + self.cpp_info.components["ptrace"].libs = ["unwind-ptrace"] + self.cpp_info.components["ptrace"].requires = ["generic", "unwind"] + if self.options.setjmp: + self.cpp_info.components["setjmp"].set_property("pkg_config_name", "libunwind-setjmp") + self.cpp_info.components["setjmp"].libs = ["unwind-setjmp"] + self.cpp_info.components["setjmp"].requires = ["unwind"] + if self.options.coredump: + self.cpp_info.components["coredump"].set_property("pkg_config_name", "libunwind-coredump") + self.cpp_info.components["coredump"].libs = ["unwind-coredump"] + self.cpp_info.components["coredump"].requires = ["generic", "unwind"] diff --git a/recipes/libunwind/all/patches/0001-multiple-definition-gcc10.patch b/recipes/libunwind/all/patches/0001-multiple-definition-gcc10.patch new file mode 100644 index 0000000000000..93fd952b73a28 --- /dev/null +++ b/recipes/libunwind/all/patches/0001-multiple-definition-gcc10.patch @@ -0,0 +1,252 @@ +Fix from https://github.com/libunwind/libunwind/pull/166 + +--- a/src/aarch64/Ginit.c ++++ b/src/aarch64/Ginit.c +@@ -61,7 +61,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -78,7 +77,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/arm/Ginit.c ++++ b/src/arm/Ginit.c +@@ -57,7 +57,6 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -68,7 +67,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/hppa/Ginit.c ++++ b/src/hppa/Ginit.c +@@ -64,7 +64,6 @@ _Uhppa_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -81,7 +80,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/mips/Ginit.c ++++ b/src/mips/Ginit.c +@@ -69,7 +69,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -86,7 +85,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/ppc32/Ginit.c ++++ b/src/ppc32/Ginit.c +@@ -91,7 +91,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + + static void +@@ -104,7 +103,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/ppc64/Ginit.c ++++ b/src/ppc64/Ginit.c +@@ -95,7 +95,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + + static void +@@ -108,7 +107,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/sh/Ginit.c ++++ b/src/sh/Ginit.c +@@ -58,7 +58,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -75,7 +74,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/tilegx/Ginit.c ++++ b/src/tilegx/Ginit.c +@@ -64,7 +64,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -81,7 +80,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/x86/Ginit.c ++++ b/src/x86/Ginit.c +@@ -54,7 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -71,7 +70,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/x86_64/Ginit.c ++++ b/src/x86_64/Ginit.c +@@ -49,7 +49,6 @@ static struct unw_addr_space local_addr_space; + + unw_addr_space_t unw_local_addr_space = &local_addr_space; + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -66,7 +65,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + diff --git a/recipes/libunwind/all/test_package/CMakeLists.txt b/recipes/libunwind/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e857c1d9df841 --- /dev/null +++ b/recipes/libunwind/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libunwind REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libunwind::libunwind) diff --git a/recipes/libunwind/all/test_package/conanfile.py b/recipes/libunwind/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libunwind/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libunwind/all/test_package/test_package.c b/recipes/libunwind/all/test_package/test_package.c new file mode 100644 index 0000000000000..2d41d8260982c --- /dev/null +++ b/recipes/libunwind/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include +#define UNW_LOCAL_ONLY +#include + + +void show_backtrace (void) { + unw_cursor_t cursor; unw_context_t uc; + unw_word_t ip, sp; + + unw_getcontext(&uc); + unw_init_local(&cursor, &uc); + while (unw_step(&cursor) > 0) { + unw_get_reg(&cursor, UNW_REG_IP, &ip); + unw_get_reg(&cursor, UNW_REG_SP, &sp); + printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp); + } +} + +int main() { + show_backtrace(); + return 0; +} diff --git a/recipes/libunwind/all/test_v1_package/CMakeLists.txt b/recipes/libunwind/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/libunwind/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libunwind/all/test_v1_package/conanfile.py b/recipes/libunwind/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/libunwind/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libunwind/config.yml b/recipes/libunwind/config.yml new file mode 100644 index 0000000000000..26cf6b32aa2bf --- /dev/null +++ b/recipes/libunwind/config.yml @@ -0,0 +1,7 @@ +versions: + "1.6.2": + folder: all + "1.5.0": + folder: all + "1.3.1": + folder: all diff --git a/recipes/liburing/all/conandata.yml b/recipes/liburing/all/conandata.yml new file mode 100644 index 0000000000000..ca85945754398 --- /dev/null +++ b/recipes/liburing/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.2": + url: "https://github.com/axboe/liburing/archive/liburing-2.2.tar.gz" + sha256: "e092624af6aa244ade2d52181cc07751ac5caba2f3d63e9240790db9ed130bbc" + "2.1": + url: "https://github.com/axboe/liburing/archive/liburing-2.1.tar.gz" + sha256: "f1e0500cb3934b0b61c5020c3999a973c9c93b618faff1eba75aadc95bb03e07" + "2.0": + url: "https://github.com/axboe/liburing/archive/liburing-2.0.tar.gz" + sha256: "ca069ecc4aa1baf1031bd772e4e97f7e26dfb6bb733d79f70159589b22ab4dc0" + "0.7": + url: "https://github.com/axboe/liburing/archive/liburing-0.7.tar.gz" + sha256: "8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543" + +patches: + "2.1": + - base_path: "source_subfolder" + patch_file: "patches/0001-liburing-2.1-memfd-create.patch" diff --git a/recipes/liburing/all/conanfile.py b/recipes/liburing/all/conanfile.py new file mode 100644 index 0000000000000..9035e2b799208 --- /dev/null +++ b/recipes/liburing/all/conanfile.py @@ -0,0 +1,108 @@ +from conans import AutoToolsBuildEnvironment +from conan import ConanFile +from conan.tools.files import get, patch, chdir, rmdir, copy +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.33.0" + + +class LiburingConan(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.") + topics = ("asynchronous-io", "async", "kernel") + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + "with_libc": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "with_libc": True, + } + + exports_sources = ["patches/*"] + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "2.2": + del self.options.with_libc + + def configure(self): + if self.options.shared: + del self.options.fPIC + + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("linux-headers-generic/5.13.9") + + 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") + + 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) + args = [] + if self.options.get_safe("with_libc") == False: + args.append("--nolibc") + self._autotools.configure(args=args) + self._autotools.flags.append("-std=gnu99") + return self._autotools + + def _patch_sources(self): + for data in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, **data) + + def build(self): + self._patch_sources() + with chdir(self, self._source_subfolder): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + copy(self, "COPYING*", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + + with chdir(self, self._source_subfolder): + autotools = self._configure_autotools() + install_args = [ + "ENABLE_SHARED={}".format(1 if self.options.shared else 0) + ] + autotools.install(args=install_args) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "man")) + + if self.options.shared: + os.remove(os.path.join(self.package_folder, "lib", "liburing.a")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "liburing" + self.cpp_info.libs = ["uring"] diff --git a/recipes/liburing/all/patches/0001-liburing-2.1-memfd-create.patch b/recipes/liburing/all/patches/0001-liburing-2.1-memfd-create.patch new file mode 100644 index 0000000000000..6249b5b1c6e01 --- /dev/null +++ b/recipes/liburing/all/patches/0001-liburing-2.1-memfd-create.patch @@ -0,0 +1,71 @@ +diff --git a/configure b/configure +index afccef1..a7caa07 100755 +--- a/configure ++++ b/configure +@@ -338,6 +338,23 @@ if compile_prog "" "" "has_ucontext"; then + fi + print_config "has_ucontext" "$has_ucontext" + ++########################################## ++# check for memfd_create(2) ++has_memfd_create="no" ++cat > $TMPC << EOF ++#define _GNU_SOURCE ++#include ++int main(int argc, char **argv) ++{ ++ int memfd = memfd_create("test", 0); ++ return 0; ++} ++EOF ++if compile_prog "-Werror=implicit-function-declaration" "" "has_memfd_create"; then ++ has_memfd_create="yes" ++fi ++print_config "has_memfd_create" "$has_memfd_create" ++ + + ############################################################################# + +@@ -365,6 +382,9 @@ fi + if test "$array_bounds" = "yes"; then + output_sym "CONFIG_HAVE_ARRAY_BOUNDS" + fi ++if test "$has_memfd_create" = "yes"; then ++ output_sym "CONFIG_HAVE_MEMFD_CREATE" ++fi + + echo "CC=$cc" >> $config_host_mak + print_config "CC" "$cc" +diff --git a/liburing.spec b/liburing.spec +index 0268d23..7eb5731 100644 +--- a/liburing.spec ++++ b/liburing.spec +@@ -1,5 +1,5 @@ + Name: liburing +-Version: 2.0 ++Version: 2.1 + Release: 1%{?dist} + Summary: Linux-native io_uring I/O access library + License: (GPLv2 with exceptions and LGPLv2+) or MIT +diff --git a/test/io_uring_register.c b/test/io_uring_register.c +index da7bc0d..b8a4ea5 100644 +--- a/test/io_uring_register.c ++++ b/test/io_uring_register.c +@@ -31,6 +31,17 @@ static int pagesize; + static rlim_t mlock_limit; + static int devnull; + ++#if !defined(CONFIG_HAVE_MEMFD_CREATE) ++#include ++#include ++ ++static int memfd_create(const char *name, unsigned int flags) ++{ ++ return (int)syscall(SYS_memfd_create, name, flags); ++} ++#endif ++ ++ + int + expect_fail(int fd, unsigned int opcode, void *arg, + unsigned int nr_args, int error) diff --git a/recipes/liburing/all/test_package/CMakeLists.txt b/recipes/liburing/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b8135611cec52 --- /dev/null +++ b/recipes/liburing/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(liburing REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE liburing::liburing) diff --git a/recipes/liburing/all/test_package/conanfile.py b/recipes/liburing/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6fbb963afebbd --- /dev/null +++ b/recipes/liburing/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conans import CMake +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.scm import Version +import platform +import re +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() + + @property + def _sufficient_linux_kernel_version(self): + # FIXME: use kernel version of build/host machine. kernel version should be encoded in profile + linux_kernel_version = re.match("([0-9.]+)", platform.release()).group(1) + return Version(linux_kernel_version) >= "5.1" + + def test(self): + if not cross_building(self) and self._sufficient_linux_kernel_version: + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/liburing/all/test_package/test_package.c b/recipes/liburing/all/test_package/test_package.c new file mode 100644 index 0000000000000..578582341c322 --- /dev/null +++ b/recipes/liburing/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include "liburing.h" + +const unsigned entries = 5; + +int main(int argc, char** argv) +{ + struct io_uring ring; + int ret = io_uring_queue_init(entries, &ring, 0); + if (ret < 0) { + return -ret; + } + + io_uring_queue_exit(&ring); + return 0; +} diff --git a/recipes/liburing/config.yml b/recipes/liburing/config.yml new file mode 100644 index 0000000000000..7c72c93d4edcd --- /dev/null +++ b/recipes/liburing/config.yml @@ -0,0 +1,9 @@ +versions: + "2.2": + folder: all + "2.1": + folder: all + "2.0": + folder: all + "0.7": + folder: all diff --git a/recipes/libusb-compat/all/CMakeLists.txt.in b/recipes/libusb-compat/all/CMakeLists.txt.in new file mode 100644 index 0000000000000..36dea026beea9 --- /dev/null +++ b/recipes/libusb-compat/all/CMakeLists.txt.in @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include("${{CMAKE_BINARY_DIR}}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +# autotools project does not allow building a shared mpfr library (because of libtool limitation) + +add_library(usb {libusb_sources}) +target_include_directories(usb PRIVATE "${{CMAKE_BINARY_DIR}}" "${{CMAKE_BINARY_DIR}}/libusb" "${{CMAKE_CURRENT_SOURCE_DIR}}") +set_property(TARGET usb PROPERTY DEFINE_SYMBOL LIBUSB_COMPAT_EXPORT) +if(BUILD_SHARED_LIBS) + set_property(TARGET usb PROPERTY C_VISIBILITY_PRESET hidden) +else() + target_compile_definitions(usb PRIVATE LIBUSB_COMPAT_STATIC) +endif() +target_link_libraries(usb PRIVATE $) +if(MSVC) + target_compile_definitions(usb PRIVATE _CRT_SECURE_NO_WARNINGS) + target_link_libraries(usb PRIVATE CONAN_PKG::dirent) +endif() + +install(TARGETS usb + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +install(FILES {libusb_headers} + DESTINATION include +) diff --git a/recipes/libusb-compat/all/conandata.yml b/recipes/libusb-compat/all/conandata.yml new file mode 100644 index 0000000000000..8e55c99a4d6e0 --- /dev/null +++ b/recipes/libusb-compat/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.1.7": + url: "https://github.com/libusb/libusb-compat-0.1/releases/download/v0.1.7/libusb-compat-0.1.7.tar.gz" + sha256: "0679ce38aa02498c1eea9c13398a0d2356883d574632a59c1e25274ed4925cf8" +patches: + "0.1.7": + - patch_file: "patches/0001-fix-autoconf-msvc-mingw.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-msvc-linkage-and-fix-msvc-vararg-macros.patch" + base_path: "source_subfolder" diff --git a/recipes/libusb-compat/all/conanfile.py b/recipes/libusb-compat/all/conanfile.py new file mode 100644 index 0000000000000..0319dc88794d1 --- /dev/null +++ b/recipes/libusb-compat/all/conanfile.py @@ -0,0 +1,209 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools +from conans.errors import ConanException +from contextlib import contextmanager +import os +import re +import shlex +import shutil + +required_conan_version = ">=1.33.0" + + +class LibUSBCompatConan(ConanFile): + name = "libusb-compat" + description = "A compatibility layer allowing applications written for libusb-0.1 to work with libusb-1.0" + license = ("LGPL-2.1", "BSD-3-Clause") + homepage = "https://github.com/libusb/libusb-compat-0.1" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = "patches/**", "CMakeLists.txt.in" + topics = ("conan", "libusb", "compatibility", "usb") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_logging": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_logging": False, + } + generators = "cmake", "pkg_config" + + _autotools = None + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + self.requires("libusb/1.0.24") + if self.settings.compiler == "Visual Studio": + self.requires("dirent/1.23.2") + + @property + def _settings_build(self): + return self.settings_build if hasattr(self, "settings_build") else self.settings + + def build_requirements(self): + self.build_requires("gnu-config/cci.20201022") + self.build_requires("libtool/2.4.6") + self.build_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _iterate_lib_paths_win(self, lib): + """Return all possible library paths for lib""" + for lib_path in self.deps_cpp_info.lib_paths: + for prefix in "", "lib": + for suffix in "", ".a", ".dll.a", ".lib", ".dll.lib": + fn = os.path.join(lib_path, "{}{}{}".format(prefix, lib, suffix)) + if not fn.endswith(".a") and not fn.endswith(".lib"): + continue + yield fn + + @property + def _absolute_dep_libs_win(self): + absolute_libs = [] + for lib in self.deps_cpp_info.libs: + for fn in self._iterate_lib_paths_win(lib): + if not os.path.isfile(fn): + continue + absolute_libs.append(fn) + break + return absolute_libs + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure(source_dir=os.path.join(self._source_subfolder, "libusb")) + return self._cmake + + 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 == "Visual Studio": + # Use absolute paths of the libraries instead of the library names only. + # Otherwise, the configure script will say that the compiler not working + # (because it interprets the libs as input source files) + self._autotools.libs = list(tools.unix_path(l) for l in self._absolute_dep_libs_win) + self.deps_cpp_info.system_libs + conf_args = [ + "--disable-examples-build", + "--enable-log" if self.options.enable_logging else "--disable-log", + ] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + pkg_config_paths = [tools.unix_path(os.path.abspath(self.install_folder))] + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder, pkg_config_paths=pkg_config_paths) + return self._autotools + + @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", + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "DLLTOOL": ":", + "OBJDUMP": ":", + "RANLIB": ":", + "STRIP": ":", + } + with tools.environment_append(env): + yield + else: + yield + + def _extract_makefile_variable(self, makefile, variable): + makefile_contents = tools.load(makefile) + match = re.search("{}[ \t]*=[ \t]*((?:(?:[a-zA-Z0-9 \t.=/_-])|(?:\\\\\"))*(?:\\\\\n(?:(?:[a-zA-Z0-9 \t.=/_-])|(?:\\\"))*)*)\n".format(variable), makefile_contents) + if not match: + raise ConanException("Cannot extract variable {} from {}".format(variable, makefile_contents)) + lines = [line.strip(" \t\\") for line in match.group(1).split()] + return [item for line in lines for item in shlex.split(line) if item] + + def _extract_autotools_variables(self): + makefile = os.path.join(self._source_subfolder, "libusb", "Makefile.am") + sources = self._extract_makefile_variable(makefile, "libusb_la_SOURCES") + headers = self._extract_makefile_variable(makefile, "include_HEADERS") + return sources, headers + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + 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")) + if self.settings.os == "Windows": + api = "__declspec(dllexport)" if self.options.shared else "" + tools.replace_in_file(os.path.join(self._source_subfolder, "configure.ac"), + "\nAC_DEFINE([API_EXPORTED]", + "\nAC_DEFINE([API_EXPORTED], [{}], [API])\n#".format(api)) + # libtool disallows building shared libraries that link to static libraries + # This will override this and add the dependency + tools.replace_in_file(os.path.join(self._source_subfolder, "ltmain.sh"), + "droppeddeps=yes", "droppeddeps=no && func_append newdeplibs \" $a_deplib\"") + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", None) or self.deps_user_info + + def build(self): + self._patch_sources() + with self._build_context(): + autotools = self._configure_autotools() + if self.settings.os == "Windows": + cmakelists_in = tools.load("CMakeLists.txt.in") + sources, headers = self._extract_autotools_variables() + tools.save(os.path.join(self._source_subfolder, "libusb", "CMakeLists.txt"), cmakelists_in.format( + libusb_sources=" ".join(sources), + libusb_headers=" ".join(headers), + )) + tools.replace_in_file("config.h", "\n#define API_EXPORTED", "\n#define API_EXPORTED //") + cmake = self._configure_cmake() + cmake.build() + else: + with self._build_context(): + autotools.make() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + if self.settings.os == "Windows": + cmake = self._configure_cmake() + cmake.install() + else: + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + + os.unlink(os.path.join(self.package_folder, "bin", "libusb-config")) + os.unlink(os.path.join(self.package_folder, "lib", "libusb.la")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["pkg_config"] = "libusb" + self.cpp_info.libs = ["usb"] + if not self.options.shared: + self.cpp_info.defines = ["LIBUSB_COMPAT_STATIC"] diff --git a/recipes/libusb-compat/all/patches/0001-fix-autoconf-msvc-mingw.patch b/recipes/libusb-compat/all/patches/0001-fix-autoconf-msvc-mingw.patch new file mode 100644 index 0000000000000..9e14aae531ef4 --- /dev/null +++ b/recipes/libusb-compat/all/patches/0001-fix-autoconf-msvc-mingw.patch @@ -0,0 +1,29 @@ +--- configure.ac ++++ configure.ac +@@ -9,7 +9,7 @@ + AC_PROG_LIBTOOL + AC_C_INLINE + AM_PROG_CC_C_O +- ++LT_INIT([win32-dll]) + # Library versioning + LT_MAJOR="8" + LT_REVISION="4" +@@ -22,7 +22,7 @@ + LIBUSB01_VERSION="0.1.12" + AC_SUBST(LIBUSB01_VERSION) + +-PKG_CHECK_MODULES([LIBUSB_1_0], libusb-1.0 >= 0.9.1) ++PKG_CHECK_MODULES([LIBUSB_1_0], [libusb-1.0 >= 0.9.1]) + AC_SUBST(LIBUSB_1_0_CFLAGS) + AC_SUBST(LIBUSB_1_0_LIBS) + +@@ -70,7 +70,7 @@ + CFLAGS="$saved_cflags" + + AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) +-AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow" ++AM_CFLAGS="-std=gnu99 $inline_cflags -Wall" + AC_SUBST(AM_CFLAGS) + + AC_CONFIG_FILES([libusb.pc] [libusb-config] [Makefile] [libusb/Makefile] [examples/Makefile]) diff --git a/recipes/libusb-compat/all/patches/0002-fix-msvc-linkage-and-fix-msvc-vararg-macros.patch b/recipes/libusb-compat/all/patches/0002-fix-msvc-linkage-and-fix-msvc-vararg-macros.patch new file mode 100644 index 0000000000000..2d8378b253419 --- /dev/null +++ b/recipes/libusb-compat/all/patches/0002-fix-msvc-linkage-and-fix-msvc-vararg-macros.patch @@ -0,0 +1,208 @@ +--- libusb/core.c ++++ libusb/core.c +@@ -28,6 +28,11 @@ + + #include + ++#define WIN32_LEAN_AND_MEAN ++#ifdef _MSC_VER ++#include ++#endif ++ + #include "usb.h" + #include "usbi.h" + +@@ -55,25 +60,61 @@ + }; + + #ifdef ENABLE_LOGGING ++#ifdef _MSC_VER ++#define _usbi_log(level, ...) usbi_log(level, __FUNCTION__, __VA_ARGS__) ++#else + #define _usbi_log(level, fmt...) usbi_log(level, __FUNCTION__, fmt) ++#endif + #else +-#define _usbi_log(level, fmt...) ++#define _usbi_log(level, ...) + #endif + + #ifdef ENABLE_DEBUG_LOGGING ++#ifdef _MSC_VER ++#define usbi_dbg(...) _usbi_log(LOG_LEVEL_DEBUG, __VA_ARGS__) ++#else + #define usbi_dbg(fmt...) _usbi_log(LOG_LEVEL_DEBUG, fmt) ++#endif + #else +-#define usbi_dbg(fmt...) ++#define usbi_dbg(...) + #endif + ++#ifdef _MSC_VER ++#define usbi_info(...) _usbi_log(LOG_LEVEL_INFO, __VA_ARGS__) ++#define usbi_warn(...) _usbi_log(LOG_LEVEL_WARNING, __VA_ARGS__) ++#define usbi_err(...) _usbi_log(LOG_LEVEL_ERROR, __VA_ARGS__) ++#else + #define usbi_info(fmt...) _usbi_log(LOG_LEVEL_INFO, fmt) + #define usbi_warn(fmt...) _usbi_log(LOG_LEVEL_WARNING, fmt) + #define usbi_err(fmt...) _usbi_log(LOG_LEVEL_ERROR, fmt) ++#endif + + API_EXPORTED struct usb_bus *usb_busses = NULL; + + #define compat_err(e) -(errno=libusb_to_errno(e)) + ++#ifdef _MSC_VER ++BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { ++ switch(fdwReason) { ++ case DLL_PROCESS_ATTACH: ++#ifdef LIBUSB_1_0_SONAME ++ libusb_dl_init (); ++#endif ++ break; ++ case DLL_PROCESS_DETACH: ++ if (ctx) { ++ libusb_exit (ctx); ++ ctx = NULL; ++ } ++#ifdef LIBUSB_1_0_SONAME ++ libusb_dl_exit (); ++#endif ++ break; ++ } ++ return TRUE; ++} ++ ++#else + #ifdef LIBUSB_1_0_SONAME + static void __attribute__ ((constructor)) _usb_init (void) + { +@@ -91,6 +132,7 @@ + libusb_dl_exit (); + #endif + } ++#endif + + static int libusb_to_errno(int result) + { +--- libusb/usb.h ++++ libusb/usb.h +@@ -26,7 +26,9 @@ + #ifndef USB_H + #define USB_H + ++#if !defined(_MSC_VER) + #include ++#endif + #include + #include + +@@ -45,6 +47,20 @@ + #include + #endif + ++#if defined(_WIN32) ++#if defined(LIBUSB_COMPAT_EXPORT) ++#define USB_COMPAT_EXPORTED __declspec(dllexport) ++#elif !defined(LIBUSB_COMPAT_STATIC) ++#define USB_COMPAT_EXPORTED __declspec(dllimport) ++#else ++#define USB_COMPAT_EXPORTED ++#endif ++#else ++#define USB_COMPAT_EXPORTED ++#endif ++ ++ ++ + /* + * USB spec information + * +@@ -289,7 +305,7 @@ + typedef struct usb_dev_handle usb_dev_handle; + + /* Variables */ +-extern struct usb_bus *usb_busses; ++USB_COMPAT_EXPORTED extern struct usb_bus *usb_busses; + + #ifdef __cplusplus + extern "C" { +@@ -298,52 +314,52 @@ + /* Function prototypes */ + + /* usb.c */ +-usb_dev_handle *usb_open(struct usb_device *dev); +-int usb_close(usb_dev_handle *dev); +-int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, ++USB_COMPAT_EXPORTED usb_dev_handle *usb_open(struct usb_device *dev); ++USB_COMPAT_EXPORTED int usb_close(usb_dev_handle *dev); ++USB_COMPAT_EXPORTED int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen); +-int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, ++USB_COMPAT_EXPORTED int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen); + + /* descriptors.c */ +-int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, ++USB_COMPAT_EXPORTED int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, void *buf, int size); +-int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, ++USB_COMPAT_EXPORTED int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); + + /* .c */ +-int usb_bulk_write(usb_dev_handle *dev, int ep, const char *bytes, int size, ++USB_COMPAT_EXPORTED int usb_bulk_write(usb_dev_handle *dev, int ep, const char *bytes, int size, + int timeout); +-int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, ++USB_COMPAT_EXPORTED int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); +-int usb_interrupt_write(usb_dev_handle *dev, int ep, const char *bytes, ++USB_COMPAT_EXPORTED int usb_interrupt_write(usb_dev_handle *dev, int ep, const char *bytes, + int size, int timeout); +-int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, ++USB_COMPAT_EXPORTED int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); +-int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, ++USB_COMPAT_EXPORTED int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, int timeout); +-int usb_set_configuration(usb_dev_handle *dev, int configuration); +-int usb_claim_interface(usb_dev_handle *dev, int interface); +-int usb_release_interface(usb_dev_handle *dev, int interface); +-int usb_set_altinterface(usb_dev_handle *dev, int alternate); +-int usb_resetep(usb_dev_handle *dev, unsigned int ep); +-int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); +-int usb_reset(usb_dev_handle *dev); ++USB_COMPAT_EXPORTED int usb_set_configuration(usb_dev_handle *dev, int configuration); ++USB_COMPAT_EXPORTED int usb_claim_interface(usb_dev_handle *dev, int interface); ++USB_COMPAT_EXPORTED int usb_release_interface(usb_dev_handle *dev, int interface); ++USB_COMPAT_EXPORTED int usb_set_altinterface(usb_dev_handle *dev, int alternate); ++USB_COMPAT_EXPORTED int usb_resetep(usb_dev_handle *dev, unsigned int ep); ++USB_COMPAT_EXPORTED int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); ++USB_COMPAT_EXPORTED int usb_reset(usb_dev_handle *dev); + + #define LIBUSB_HAS_GET_DRIVER_NP 1 +-int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, ++USB_COMPAT_EXPORTED int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, + unsigned int namelen); + #define LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP 1 +-int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); ++USB_COMPAT_EXPORTED int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); + +-char *usb_strerror(void); ++USB_COMPAT_EXPORTED char *usb_strerror(void); + +-void usb_init(void); +-void usb_set_debug(int level); +-int usb_find_busses(void); +-int usb_find_devices(void); +-struct usb_device *usb_device(usb_dev_handle *dev); +-struct usb_bus *usb_get_busses(void); ++USB_COMPAT_EXPORTED void usb_init(void); ++USB_COMPAT_EXPORTED void usb_set_debug(int level); ++USB_COMPAT_EXPORTED int usb_find_busses(void); ++USB_COMPAT_EXPORTED int usb_find_devices(void); ++USB_COMPAT_EXPORTED struct usb_device *usb_device(usb_dev_handle *dev); ++USB_COMPAT_EXPORTED struct usb_bus *usb_get_busses(void); + + #ifdef __cplusplus + } diff --git a/recipes/libusb-compat/all/test_package/CMakeLists.txt b/recipes/libusb-compat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a5ffd526aaea7 --- /dev/null +++ b/recipes/libusb-compat/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.c) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libusb-compat/all/test_package/conanfile.py b/recipes/libusb-compat/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4fdc223664bd8 --- /dev/null +++ b/recipes/libusb-compat/all/test_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" + + 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/libusb-compat/all/test_package/test_package.c b/recipes/libusb-compat/all/test_package/test_package.c new file mode 100644 index 0000000000000..6cdda7a4a359c --- /dev/null +++ b/recipes/libusb-compat/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include "usb.h" + +#include + + +int main(int argc, char *argv[]) { + usb_init(); + usb_find_busses(); + usb_find_devices(); + return EXIT_SUCCESS; +} diff --git a/recipes/libusb-compat/config.yml b/recipes/libusb-compat/config.yml new file mode 100644 index 0000000000000..e6830418cc45c --- /dev/null +++ b/recipes/libusb-compat/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.7": + folder: all diff --git a/recipes/libusb/all/conandata.yml b/recipes/libusb/all/conandata.yml new file mode 100644 index 0000000000000..447075d3a8df8 --- /dev/null +++ b/recipes/libusb/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "1.0.26": + url: "https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2" + sha256: "12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5" + "1.0.25": + url: "https://github.com/libusb/libusb/releases/download/v1.0.25/libusb-1.0.25.tar.bz2" + sha256: "8a28ef197a797ebac2702f095e81975e2b02b2eeff2774fa909c78a74ef50849" + "1.0.24": + url: "https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.tar.bz2" + sha256: "7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a" + "1.0.23": + url: "https://github.com/libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.tar.bz2" + sha256: "db11c06e958a82dac52cf3c65cb4dd2c3f339c8a988665110e0d24d19312ad8d" +patches: + "1.0.26": + - patch_file: "patches/1.0.24-0001-relax-windows-sdk-restriction.patch" + patch_description: "Relax Windows SDK restriction" + patch_type: "conan" + "1.0.25": + - patch_file: "patches/1.0.24-0001-relax-windows-sdk-restriction.patch" + patch_description: "Relax Windows SDK restriction" + patch_type: "conan" + "1.0.24": + - patch_file: "patches/1.0.24-0001-relax-windows-sdk-restriction.patch" + patch_description: "Relax Windows SDK restriction" + patch_type: "conan" + "1.0.23": + - patch_file: "patches/1.0.23-0001-relax-windows-sdk-restriction.patch" + patch_description: "Relax Windows SDK restriction" + patch_type: "conan" diff --git a/recipes/libusb/all/conanfile.py b/recipes/libusb/all/conanfile.py new file mode 100644 index 0000000000000..0ec668083cf4e --- /dev/null +++ b/recipes/libusb/all/conanfile.py @@ -0,0 +1,156 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, 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, MSBuild, MSBuildToolchain +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LibUSBConan(ConanFile): + name = "libusb" + description = "A cross-platform library to access USB devices" + license = "LGPL-2.1" + homepage = "https://github.com/libusb/libusb" + url = "https://github.com/conan-io/conan-center-index" + topics = ("usb", "device") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_udev": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_udev": True, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os not in ["Linux", "Android"]: + del self.options.enable_udev + # FIXME: enable_udev should be True for Android, but libudev recipe is missing + if self.settings.os == "Android": + self.options.enable_udev = 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") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os == "Linux": + if self.options.enable_udev: + self.requires("libudev/system") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.properties["WholeProgramOptimization"] = "false" + tc.generate() + else: + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) + if self.settings.os in ["Linux", "Android"]: + tc.configure_args.append("--enable-udev" if self.options.enable_udev else "--disable-udev") + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + solution_msvc_year = "2017" if Version(self.version) < "1.0.24" else "2019" + solution = f"libusb_{'dll' if self.options.shared else 'static'}_{solution_msvc_year}.vcxproj" + vcxproj_path = os.path.join(self.source_folder, "msvc", solution) + + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + replace_in_file( + self, vcxproj_path, + "true", + "", + ) + old_toolset = "v141" if Version(self.version) < "1.0.24" else "v142" + new_toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, vcxproj_path, + f"{old_toolset}", + f"{new_toolset}", + ) + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, vcxproj_path, + "", + f"", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.build(vcxproj_path) + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "libusb.h", src=os.path.join(self.source_folder, "libusb"), + dst=os.path.join(self.package_folder, "include", "libusb-1.0")) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libusb-1.0") + prefix = "lib" if is_msvc(self) else "" + self.cpp_info.libs = [f"{prefix}usb-1.0"] + self.cpp_info.includedirs.append(os.path.join("include", "libusb-1.0")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + elif self.settings.os == "Macos": + self.cpp_info.system_libs = ["objc"] + self.cpp_info.frameworks = ["IOKit", "CoreFoundation", "Security"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["advapi32"] diff --git a/recipes/libusb/all/patches/1.0.23-0001-relax-windows-sdk-restriction.patch b/recipes/libusb/all/patches/1.0.23-0001-relax-windows-sdk-restriction.patch new file mode 100644 index 0000000000000..1c12693d1700c --- /dev/null +++ b/recipes/libusb/all/patches/1.0.23-0001-relax-windows-sdk-restriction.patch @@ -0,0 +1,20 @@ +--- a/msvc/libusb_dll_2017.vcxproj ++++ b/msvc/libusb_dll_2017.vcxproj +@@ -38,7 +38,6 @@ + libusb-1.0 (dll) + {349EE8FA-7D25-4909-AAF5-FF3FADE72187} + libusbdll +- 10.0.16299.0 + true + true + +--- a/msvc/libusb_static_2017.vcxproj ++++ b/msvc/libusb_static_2017.vcxproj +@@ -38,7 +38,6 @@ + libusb-1.0 (static) + {349EE8F9-7D25-4909-AAF5-FF3FADE72187} + libusb +- 10.0.16299.0 + true + true + diff --git a/recipes/libusb/all/patches/1.0.24-0001-relax-windows-sdk-restriction.patch b/recipes/libusb/all/patches/1.0.24-0001-relax-windows-sdk-restriction.patch new file mode 100644 index 0000000000000..a45db143ab1b1 --- /dev/null +++ b/recipes/libusb/all/patches/1.0.24-0001-relax-windows-sdk-restriction.patch @@ -0,0 +1,20 @@ +--- a/msvc/libusb_dll_2019.vcxproj ++++ b/msvc/libusb_dll_2019.vcxproj +@@ -40,7 +40,6 @@ + libusbdll + true + true +- 10.0 + + + +--- a/msvc/libusb_static_2019.vcxproj ++++ b/msvc/libusb_static_2019.vcxproj +@@ -40,7 +40,6 @@ + libusb + true + true +- 10.0 + + + diff --git a/recipes/libusb/all/test_package/CMakeLists.txt b/recipes/libusb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..968df07ffe10a --- /dev/null +++ b/recipes/libusb/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libusb REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.c) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libusb::libusb) diff --git a/recipes/libusb/all/test_package/conanfile.py b/recipes/libusb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libusb/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libusb/all/test_package/test_package.c b/recipes/libusb/all/test_package/test_package.c new file mode 100644 index 0000000000000..0ccc95e9223f0 --- /dev/null +++ b/recipes/libusb/all/test_package/test_package.c @@ -0,0 +1,18 @@ +#include + +int main(int argc, char *argv[]) { + libusb_device **devs; + + int r = libusb_init(NULL); + if (r < 0) + return r; + + ssize_t cnt = libusb_get_device_list(NULL, &devs); + if (cnt < 0) + return (int)cnt; + + libusb_free_device_list(devs, 1); + libusb_exit(NULL); + + return 0; +} diff --git a/recipes/libusb/all/test_v1_package/CMakeLists.txt b/recipes/libusb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libusb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libusb/all/test_v1_package/conanfile.py b/recipes/libusb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..81f9e01d9be5d --- /dev/null +++ b/recipes/libusb/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/libusb/config.yml b/recipes/libusb/config.yml new file mode 100644 index 0000000000000..21a7ffcef562b --- /dev/null +++ b/recipes/libusb/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.26": + folder: all + "1.0.25": + folder: all + "1.0.24": + folder: all + "1.0.23": + folder: all diff --git a/recipes/libuuid/all/conandata.yml b/recipes/libuuid/all/conandata.yml new file mode 100644 index 0000000000000..65a63e13dcdf9 --- /dev/null +++ b/recipes/libuuid/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.3": + url: "https://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz" + sha256: "46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644" +patches: + "1.0.3": + - patch_file: "patches/0001-check-sys-syscall-h+wrap-includes.patch" diff --git a/recipes/libuuid/all/conanfile.py b/recipes/libuuid/all/conanfile.py new file mode 100644 index 0000000000000..7d995adb8138c --- /dev/null +++ b/recipes/libuuid/all/conanfile.py @@ -0,0 +1,89 @@ +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.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LibuuidConan(ConanFile): + name = "libuuid" + description = "Portable uuid C library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/libuuid/" + license = "BSD-3-Clause" + topics = "id", "identifier", "unique", "uuid" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _has_sys_file_header(self): + return self.settings.os in ["FreeBSD", "Linux", "Macos"] + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows") + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + if self._has_sys_file_header: + tc.extra_defines.append("HAVE_SYS_FILE_H") + if "x86" in self.settings.arch: + tc.extra_cflags.append("-mstackrealign") + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "uuid") + self.cpp_info.libs = ["uuid"] + self.cpp_info.includedirs.append(os.path.join("include", "uuid")) diff --git a/recipes/libuuid/all/patches/0001-check-sys-syscall-h+wrap-includes.patch b/recipes/libuuid/all/patches/0001-check-sys-syscall-h+wrap-includes.patch new file mode 100644 index 0000000000000..27be8a420fdd8 --- /dev/null +++ b/recipes/libuuid/all/patches/0001-check-sys-syscall-h+wrap-includes.patch @@ -0,0 +1,38 @@ +--- configure.ac ++++ configure.ac +@@ -20,7 +20,7 @@ AC_SEARCH_LIBS([socket], [socket], + AC_SUBST([SOCKET_LIBS]) + + # Checks for header files. +-AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h unistd.h]) ++AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/file.h sys/ioctl.h sys/socket.h sys/syscall.h sys/time.h unistd.h]) + AC_CHECK_DECLS([_SC_HOST_NAME_MAX]) + + # Checks for typedefs, structures, and compiler characteristics. +--- randutils.c ++++ randutils.c +@@ -6,14 +6,24 @@ + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ ++ ++#if defined(HAVE_CONFIG_H) ++#include "config.h" ++#endif ++ + #include + #include + #include + #include + #include ++ ++#if defined(HAVE_SYS_TIME_H) + #include ++#endif + ++#if defined(HAVE_SYS_SYSCALL_H) + #include ++#endif + + #include "randutils.h" + diff --git a/recipes/libuuid/all/test_package/CMakeLists.txt b/recipes/libuuid/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..75c717f769900 --- /dev/null +++ b/recipes/libuuid/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(libuuid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libuuid::libuuid) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libuuid/all/test_package/conanfile.py b/recipes/libuuid/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libuuid/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libuuid/all/test_package/test_package.c b/recipes/libuuid/all/test_package/test_package.c new file mode 100644 index 0000000000000..792d1d3fbf414 --- /dev/null +++ b/recipes/libuuid/all/test_package/test_package.c @@ -0,0 +1,33 @@ +#include + +#include "uuid/uuid.h" + +int main(int argc, char *argv[]) { + uuid_t uuid; + uuid_generate_time_safe(uuid); + + char uuid_str[37]; + uuid_unparse_lower(uuid, uuid_str); + printf("generate uuid=%s\n", uuid_str); + + uuid_t uuid2; + uuid_parse(uuid_str, uuid2); + + int rv; + rv = uuid_compare(uuid, uuid2); + printf("uuid_compare() result=%d\n", rv); + + uuid_t uuid3; + uuid_parse("1b4e28ba-2fa1-11d2-883f-0016d3cca427", uuid3); + rv = uuid_compare(uuid, uuid3); + printf("uuid_compare() result=%d\n", rv); + + rv = uuid_is_null(uuid); + printf("uuid_null() result=%d\n", rv); + + uuid_clear(uuid); + rv = uuid_is_null(uuid); + printf("uuid_null() result=%d\n", rv); + + return 0; +} diff --git a/recipes/libuuid/all/test_v1_package/CMakeLists.txt b/recipes/libuuid/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libuuid/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libuuid/all/test_v1_package/conanfile.py b/recipes/libuuid/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libuuid/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/libuuid/config.yml b/recipes/libuuid/config.yml new file mode 100644 index 0000000000000..372dd1cb646bd --- /dev/null +++ b/recipes/libuuid/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.3": + folder: all diff --git a/recipes/libuv/all/conandata.yml b/recipes/libuv/all/conandata.yml new file mode 100644 index 0000000000000..e251d497e772d --- /dev/null +++ b/recipes/libuv/all/conandata.yml @@ -0,0 +1,65 @@ +sources: + "1.44.2": + url: "https://github.com/libuv/libuv/archive/v1.44.2.tar.gz" + sha256: "e6e2ba8b4c349a4182a33370bb9be5e23c51b32efb9b9e209d0e8556b73a48da" + "1.44.1": + url: "https://github.com/libuv/libuv/archive/v1.44.1.tar.gz" + sha256: "e91614e6dc2dd0bfdd140ceace49438882206b7a6fb00b8750914e67a9ed6d6b" + "1.43.0": + url: "https://github.com/libuv/libuv/archive/v1.43.0.tar.gz" + sha256: "9e27825a55279de69a7c43e42d509fd1337c9bece2547c761e91a1592e91cc4d" + "1.42.0": + url: "https://github.com/libuv/libuv/archive/v1.42.0.tar.gz" + sha256: "371e5419708f6aaeb8656671f89400b92a9bba6443369af1bb70bcd6e4b3c764" + "1.41.1": + url: "https://github.com/libuv/libuv/archive/v1.41.1.tar.gz" + sha256: "62c29d1d76b0478dc8aaed0ed1f874324f6cd2d6ff4cb59a44026c09e818cd53" + "1.41.0": + url: "https://github.com/libuv/libuv/archive/v1.41.0.zip" + sha256: "cb89a8b9f686c5ccf7ed09a9e0ece151a73ebebc17af3813159c335b02181794" + "1.40.0": + url: "https://github.com/libuv/libuv/archive/v1.40.0.zip" + sha256: "61366e30d8484197dc9e4a94dbd98a0ba52fb55cb6c6d991af1f3701b10f322b" + "1.38.1": + url: "https://github.com/libuv/libuv/archive/v1.38.1.zip" + sha256: "0359369492742eb2a36312fffe26f80bcffe4cec981a4fd72d182b061ee14890" +patches: + "1.44.2": + - patch_file: "patches/1.44.2/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.44.1": + - patch_file: "patches/1.44.1/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.43.0": + - patch_file: "patches/1.43.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.42.0": + - patch_file: "patches/1.42.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.41.1": + - patch_file: "patches/1.41.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + - patch_file: "patches/1.40.0/fix-ios.patch" + "1.41.0": + - patch_file: "patches/1.41.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + - patch_file: "patches/1.40.0/fix-ios.patch" + patch_description: "fix dlopen filename" + patch_type: "portability" + "1.40.0": + - patch_file: "patches/1.40.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + - patch_file: "patches/1.40.0/fix-ios.patch" + patch_description: "fix dlopen filename" + patch_type: "portability" + "1.38.1": + - patch_file: "patches/1.38.1/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" diff --git a/recipes/libuv/all/conanfile.py b/recipes/libuv/all/conanfile.py new file mode 100644 index 0000000000000..a147f0a7124e2 --- /dev/null +++ b/recipes/libuv/all/conanfile.py @@ -0,0 +1,122 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, check_min_vs +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class LibuvConan(ConanFile): + name = "libuv" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libuv.org" + description = "A multi-platform support library with a focus on asynchronous I/O" + topics = ("libuv", "asynchronous", "io", "networking", "multi-platform") + + 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: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + check_min_vs(self, "190") + + 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["LIBUV_BUILD_TESTS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + for license_file in ["LICENSE", "LICENSE-docs"]: + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._target_lib_name: "libuv::libuv"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _target_lib_name(self): + return "uv" if self.options.shared else "uv_a" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libuv") + self.cpp_info.set_property("cmake_target_name", self._target_lib_name) + self.cpp_info.set_property("pkg_config_name", "libuv" if self.options.shared else "libuv-static") + self.cpp_info.libs = [self._target_lib_name] + if self.options.shared: + self.cpp_info.defines = ["USING_UV_SHARED=1"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "pthread", "rt"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["iphlpapi", "psapi", "userenv", "ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["pkg_config"] = "libuv" if self.options.shared else "libuv-static" + 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/libuv/all/patches/1.38.1/fix-cmake.patch b/recipes/libuv/all/patches/1.38.1/fix-cmake.patch new file mode 100644 index 0000000000000..752d2ecdc5cea --- /dev/null +++ b/recipes/libuv/all/patches/1.38.1/fix-cmake.patch @@ -0,0 +1,80 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2518c747..05b5add1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -297,13 +297,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) +-target_compile_definitions(uv +- INTERFACE +- USING_UV_SHARED=1 +- PRIVATE +- BUILDING_UV_SHARED=1 +- ${uv_defines}) ++add_library(uv ${uv_sources}) ++get_target_property(target_type uv TYPE) ++if (target_type STREQUAL "SHARED_LIBRARY") ++ target_compile_definitions(uv ++ INTERFACE ++ USING_UV_SHARED=1 ++ PRIVATE ++ BUILDING_UV_SHARED=1 ++ ) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++endif() ++target_compile_definitions(uv PRIVATE ${uv_defines}) + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -313,17 +319,6 @@ target_include_directories(uv + $) + target_link_libraries(uv ${uv_libraries}) + +-add_library(uv_a STATIC ${uv_sources}) +-target_compile_definitions(uv_a PRIVATE ${uv_defines}) +-target_compile_options(uv_a PRIVATE ${uv_cflags}) +-target_include_directories(uv_a +- PUBLIC +- $ +- $ +- PRIVATE +- $) +-target_link_libraries(uv_a ${uv_libraries}) +- + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, + # before the actual tests are added. +@@ -558,22 +553,20 @@ if(UNIX) + set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) + set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(prefix ${CMAKE_INSTALL_PREFIX}) +- configure_file(libuv.pc.in libuv.pc @ONLY) + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- install(FILES ${PROJECT_BINARY_DIR}/libuv.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + if(WIN32) + install(DIRECTORY include/ DESTINATION include) +- install(FILES LICENSE DESTINATION .) +- install(TARGETS uv uv_a +- RUNTIME DESTINATION lib/$ +- ARCHIVE DESTINATION lib/$) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib) + endif() + + message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.40.0/fix-cmake.patch b/recipes/libuv/all/patches/1.40.0/fix-cmake.patch new file mode 100644 index 0000000000000..194123f2f2d1b --- /dev/null +++ b/recipes/libuv/all/patches/1.40.0/fix-cmake.patch @@ -0,0 +1,77 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e648b00..080f403 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -326,13 +326,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) +-target_compile_definitions(uv +- INTERFACE +- USING_UV_SHARED=1 +- PRIVATE +- BUILDING_UV_SHARED=1 +- ${uv_defines}) ++add_library(uv ${uv_sources}) ++get_target_property(target_type uv TYPE) ++if (target_type STREQUAL "SHARED_LIBRARY") ++ target_compile_definitions(uv ++ INTERFACE ++ USING_UV_SHARED=1 ++ PRIVATE ++ BUILDING_UV_SHARED=1 ++ ) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++endif() ++target_compile_definitions(uv PRIVATE ${uv_defines}) + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -342,17 +348,6 @@ target_include_directories(uv + $) + target_link_libraries(uv ${uv_libraries}) + +-add_library(uv_a STATIC ${uv_sources}) +-target_compile_definitions(uv_a PRIVATE ${uv_defines}) +-target_compile_options(uv_a PRIVATE ${uv_cflags}) +-target_include_directories(uv_a +- PUBLIC +- $ +- $ +- PRIVATE +- $) +-target_link_libraries(uv_a ${uv_libraries}) +- + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, + # before the actual tests are added. +@@ -595,19 +590,18 @@ if(UNIX OR MINGW) + configure_file(libuv-static.pc.in libuv-static.pc @ONLY) + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + if(MSVC) + install(DIRECTORY include/ DESTINATION include) +- install(FILES LICENSE DESTINATION .) +- install(TARGETS uv uv_a +- RUNTIME DESTINATION lib/$ +- ARCHIVE DESTINATION lib/$) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib) + endif() + + message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.40.0/fix-ios.patch b/recipes/libuv/all/patches/1.40.0/fix-ios.patch new file mode 100644 index 0000000000000..616e7c2083eea --- /dev/null +++ b/recipes/libuv/all/patches/1.40.0/fix-ios.patch @@ -0,0 +1,28 @@ +patch from https://github.com/libuv/libuv/commit/1addf9b88a17bc32d009d377a14d540ccddd06db +fixed in 1.42.0 + +--- a/src/unix/darwin.c ++++ b/src/unix/darwin.c +@@ -33,9 +33,7 @@ + #include + #include /* sysconf */ + +-#if !TARGET_OS_IPHONE + #include "darwin-stub.h" +-#endif + + static uv_once_t once = UV_ONCE_INIT; + static uint64_t (*time_func)(void); +@@ -223,10 +221,10 @@ static int uv__get_cpu_speed(uint64_t* speed) { + err = UV_ENOENT; + core_foundation_handle = dlopen("/System/Library/Frameworks/" + "CoreFoundation.framework/" +- "Versions/A/CoreFoundation", ++ "CoreFoundation", + RTLD_LAZY | RTLD_LOCAL); + iokit_handle = dlopen("/System/Library/Frameworks/IOKit.framework/" +- "Versions/A/IOKit", ++ "IOKit", + RTLD_LAZY | RTLD_LOCAL); + + if (core_foundation_handle == NULL || iokit_handle == NULL) diff --git a/recipes/libuv/all/patches/1.41.0/fix-cmake.patch b/recipes/libuv/all/patches/1.41.0/fix-cmake.patch new file mode 100644 index 0000000000000..08dd6f34be1b3 --- /dev/null +++ b/recipes/libuv/all/patches/1.41.0/fix-cmake.patch @@ -0,0 +1,77 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c8e881d1..82daa0d2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -335,13 +335,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) +-target_compile_definitions(uv +- INTERFACE +- USING_UV_SHARED=1 +- PRIVATE +- BUILDING_UV_SHARED=1 +- ${uv_defines}) ++add_library(uv ${uv_sources}) ++get_target_property(target_type uv TYPE) ++if (target_type STREQUAL "SHARED_LIBRARY") ++ target_compile_definitions(uv ++ INTERFACE ++ USING_UV_SHARED=1 ++ PRIVATE ++ BUILDING_UV_SHARED=1 ++ ) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++endif() ++target_compile_definitions(uv PRIVATE ${uv_defines}) + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -351,17 +357,6 @@ target_include_directories(uv + $) + target_link_libraries(uv ${uv_libraries}) + +-add_library(uv_a STATIC ${uv_sources}) +-target_compile_definitions(uv_a PRIVATE ${uv_defines}) +-target_compile_options(uv_a PRIVATE ${uv_cflags}) +-target_include_directories(uv_a +- PUBLIC +- $ +- $ +- PRIVATE +- $) +-target_link_libraries(uv_a ${uv_libraries}) +- + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, + # before the actual tests are added. +@@ -605,19 +600,18 @@ if(UNIX OR MINGW) + configure_file(libuv-static.pc.in libuv-static.pc @ONLY) + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + if(MSVC) + install(DIRECTORY include/ DESTINATION include) +- install(FILES LICENSE DESTINATION .) +- install(TARGETS uv uv_a +- RUNTIME DESTINATION lib/$ +- ARCHIVE DESTINATION lib/$) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib) + endif() + + message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.42.0/fix-cmake.patch b/recipes/libuv/all/patches/1.42.0/fix-cmake.patch new file mode 100644 index 0000000000000..e344df35558d4 --- /dev/null +++ b/recipes/libuv/all/patches/1.42.0/fix-cmake.patch @@ -0,0 +1,81 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 148d0e6..da614b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -359,13 +359,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) +-target_compile_definitions(uv +- INTERFACE +- USING_UV_SHARED=1 +- PRIVATE +- BUILDING_UV_SHARED=1 +- ${uv_defines}) ++add_library(uv ${uv_sources}) ++get_target_property(target_type uv TYPE) ++if (target_type STREQUAL "SHARED_LIBRARY") ++ target_compile_definitions(uv ++ INTERFACE ++ USING_UV_SHARED=1 ++ PRIVATE ++ BUILDING_UV_SHARED=1 ++ ) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++endif() ++target_compile_definitions(uv PRIVATE ${uv_defines}) + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -379,21 +385,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + endif() + target_link_libraries(uv ${uv_libraries}) + +-add_library(uv_a STATIC ${uv_sources}) +-target_compile_definitions(uv_a PRIVATE ${uv_defines}) +-target_compile_options(uv_a PRIVATE ${uv_cflags}) +-target_include_directories(uv_a +- PUBLIC +- $ +- $ +- PRIVATE +- $) +-if(CMAKE_SYSTEM_NAME STREQUAL "OS390") +- target_include_directories(uv_a PUBLIC $) +- set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX) +-endif() +-target_link_libraries(uv_a ${uv_libraries}) +- + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, + # before the actual tests are added. +@@ -646,19 +637,18 @@ if(UNIX OR MINGW) + configure_file(libuv-static.pc.in libuv-static.pc @ONLY) + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + if(MSVC) + install(DIRECTORY include/ DESTINATION include) +- install(FILES LICENSE DESTINATION .) +- install(TARGETS uv uv_a +- RUNTIME DESTINATION lib/$ +- ARCHIVE DESTINATION lib/$) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib) + endif() + + message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.43.0/fix-cmake.patch b/recipes/libuv/all/patches/1.43.0/fix-cmake.patch new file mode 100644 index 0000000000000..97e97844e2385 --- /dev/null +++ b/recipes/libuv/all/patches/1.43.0/fix-cmake.patch @@ -0,0 +1,50 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -372,13 +372,18 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) ++add_library(uv ${uv_sources}) ++if(BUILD_SHARED_LIBS) + target_compile_definitions(uv + INTERFACE + USING_UV_SHARED=1 + PRIVATE + BUILDING_UV_SHARED=1 + ${uv_defines}) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++ target_compile_definitions(uv PRIVATE ${uv_defines}) ++endif() + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -392,6 +397,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + endif() + target_link_libraries(uv ${uv_libraries}) + ++if(0) + add_library(uv_a STATIC ${uv_sources}) + target_compile_definitions(uv_a PRIVATE ${uv_defines}) + target_compile_options(uv_a PRIVATE ${uv_cflags}) +@@ -406,6 +412,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX) + endif() + target_link_libraries(uv_a ${uv_libraries}) ++endif() + + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, +@@ -663,9 +670,9 @@ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) + install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(TARGETS uv EXPORT libuvConfig +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv) + + if(MSVC) diff --git a/recipes/libuv/all/patches/1.44.1/fix-cmake.patch b/recipes/libuv/all/patches/1.44.1/fix-cmake.patch new file mode 100644 index 0000000000000..1eca678eae5d9 --- /dev/null +++ b/recipes/libuv/all/patches/1.44.1/fix-cmake.patch @@ -0,0 +1,47 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -382,13 +382,18 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) ++add_library(uv ${uv_sources}) ++if(BUILD_SHARED_LIBS) + target_compile_definitions(uv + INTERFACE + USING_UV_SHARED=1 + PRIVATE + BUILDING_UV_SHARED=1 + ${uv_defines}) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++ target_compile_definitions(uv PRIVATE ${uv_defines}) ++endif() + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -402,6 +407,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + endif() + target_link_libraries(uv ${uv_libraries}) + ++if(0) + add_library(uv_a STATIC ${uv_sources}) + target_compile_definitions(uv_a PRIVATE ${uv_defines}) + target_compile_options(uv_a PRIVATE ${uv_cflags}) +@@ -416,6 +422,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX) + endif() + target_link_libraries(uv_a ${uv_libraries}) ++endif() + + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, +@@ -677,8 +684,6 @@ install(TARGETS uv EXPORT libuvConfig + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-install(TARGETS uv_a EXPORT libuvConfig +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv) + + if(MSVC) diff --git a/recipes/libuv/all/patches/1.44.2/fix-cmake.patch b/recipes/libuv/all/patches/1.44.2/fix-cmake.patch new file mode 100644 index 0000000000000..8bae960541ddc --- /dev/null +++ b/recipes/libuv/all/patches/1.44.2/fix-cmake.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f46682..3477beb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -388,13 +388,18 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) ++add_library(uv ${uv_sources}) ++if(BUILD_SHARED_LIBS) + target_compile_definitions(uv + INTERFACE + USING_UV_SHARED=1 + PRIVATE + BUILDING_UV_SHARED=1 + ${uv_defines}) ++else() ++ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") ++ target_compile_definitions(uv PRIVATE ${uv_defines}) ++endif() + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -408,6 +413,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + endif() + target_link_libraries(uv ${uv_libraries}) + ++if(0) + add_library(uv_a STATIC ${uv_sources}) + target_compile_definitions(uv_a PRIVATE ${uv_defines}) + target_compile_options(uv_a PRIVATE ${uv_cflags}) +@@ -422,6 +428,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390") + set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX) + endif() + target_link_libraries(uv_a ${uv_libraries}) ++endif() + + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, +@@ -685,8 +692,6 @@ install(TARGETS uv EXPORT libuvConfig + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-install(TARGETS uv_a EXPORT libuvConfig +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv) + + if(MSVC) diff --git a/recipes/libuv/all/test_package/CMakeLists.txt b/recipes/libuv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..582a892fd9c5b --- /dev/null +++ b/recipes/libuv/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libuv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET uv_a) + target_link_libraries(${PROJECT_NAME} PRIVATE uv_a) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE uv) +endif() diff --git a/recipes/libuv/all/test_package/conanfile.py b/recipes/libuv/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libuv/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/libuv/all/test_package/test_package.c b/recipes/libuv/all/test_package/test_package.c new file mode 100644 index 0000000000000..7f637ecb9d603 --- /dev/null +++ b/recipes/libuv/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include +#include +#include + +int main() { +#ifdef _WIN32 + // probably bug: + // src/win/winapi.c assumes + // that advapi32.dll has been already loaded, + // so load it before using anything from winapi.c + // for static build + LoadLibrary("advapi32.dll"); +#endif + + uv_loop_t *loop = malloc(sizeof(uv_loop_t)); + uv_loop_init(loop); + + printf("Package test completed successfully\n"); + uv_run(loop, UV_RUN_DEFAULT); + + uv_loop_close(loop); + free(loop); + + return 0; +} diff --git a/recipes/libuv/all/test_v1_package/CMakeLists.txt b/recipes/libuv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cc50e3b1333c0 --- /dev/null +++ b/recipes/libuv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libuv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET uv_a) + target_link_libraries(${PROJECT_NAME} PRIVATE uv_a) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE uv) +endif() diff --git a/recipes/libuv/all/test_v1_package/conanfile.py b/recipes/libuv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libuv/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/libuv/config.yml b/recipes/libuv/config.yml new file mode 100644 index 0000000000000..cc83d80cfe19b --- /dev/null +++ b/recipes/libuv/config.yml @@ -0,0 +1,17 @@ +versions: + "1.44.2": + folder: all + "1.44.1": + folder: all + "1.43.0": + folder: all + "1.42.0": + folder: all + "1.41.1": + folder: all + "1.41.0": + folder: all + "1.40.0": + folder: all + "1.38.1": + folder: all diff --git a/recipes/libuvc/all/conandata.yml b/recipes/libuvc/all/conandata.yml new file mode 100644 index 0000000000000..9ed43ec234a2c --- /dev/null +++ b/recipes/libuvc/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.0.7": + url: "https://github.com/libuvc/libuvc/archive/v0.0.7.tar.gz" + sha256: "7c6ba79723ad5d0ccdfbe6cadcfbd03f9f75b701d7ba96631eb1fd929a86ee72" + "0.0.6": + url: "https://github.com/libuvc/libuvc/archive/v0.0.6.tar.gz" + sha256: "42175a53c1c704365fdc782b44233925e40c9344fbb7f942181c1090f06e2873" +patches: + "0.0.7": + - patch_file: "patches/0.0.7-0001-fix-cci-packagename.patch" + patch_description: "use cci package name" + patch_type: "conan" + "0.0.6": + - patch_file: "patches/0001-adjust-libusb-libjpeg.patch" + patch_description: "Robust discovery and injection of libusb & libjpeg" + patch_type: "conan" + - patch_file: "patches/0002-adjust-install-folder.patch" + patch_description: "Install to standard layout" + patch_type: "conan" diff --git a/recipes/libuvc/all/conanfile.py b/recipes/libuvc/all/conanfile.py new file mode 100644 index 0000000000000..c10470d935e60 --- /dev/null +++ b/recipes/libuvc/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibuvcConan(ConanFile): + name = "libuvc" + description = "A cross-platform library for USB video devices" + topics = ("libusb", "usb", "video") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libuvc/libuvc" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "jpeg_turbo": [True, False, "deprecated"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_jpeg": "libjpeg", + "jpeg_turbo": "deprecated", + } + + 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") + + # TODO: to remove once deprecated jpeg_turbo option removed + if self.options.jpeg_turbo != "deprecated": + self.output.warning("jpeg_turbo option is deprecated, please use with_jpeg option instead") + if self.options.jpeg_turbo: + self.options.with_jpeg == "libjpeg-turbo" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libusb/1.0.26") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + + def package_id(self): + # TODO: to remove once deprecated jpeg_turbo option removed + del self.info.options.jpeg_turbo + + def validate(self): + if is_msvc(self): + # Upstream issues, e.g.: + # https://github.com/libuvc/libuvc/issues/100 + # https://github.com/libuvc/libuvc/issues/105 + raise ConanInvalidConfiguration("libuvc is not compatible with Visual Studio.") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_BUILD_TARGET"] = "Shared" if self.options.shared else "Static" + tc.variables["LIBUVC_WITH_JPEG"] = bool(self.options.with_jpeg) + if Version(self.version) >= "0.0.7": + tc.variables["BUILD_EXAMPLE"] = False + + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + CMakeDeps(self).generate() + PkgConfigDeps(self).generate() + # TODO: to remove when properly handled by conan (see https://github.com/conan-io/conan/issues/11962) + env = Environment() + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuildenv_pkg_config_path") + + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + cmake_target = "UVCShared" if self.options.shared else "UVCStatic" + self.cpp_info.set_property("cmake_file_name", "libuvc") + self.cpp_info.set_property("cmake_target_name", f"LibUVC::{cmake_target}") + self.cpp_info.set_property("pkg_config_name", "libuvc") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_libuvc"].libs = ["uvc"] + self.cpp_info.components["_libuvc"].requires = ["libusb::libusb"] + if self.options.with_jpeg == "libjpeg": + self.cpp_info.components["_libuvc"].requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.components["_libuvc"].requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.components["_libuvc"].requires.append("mozjpeg::libjpeg") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libuvc" + self.cpp_info.filenames["cmake_find_package_multi"] = "libuvc" + self.cpp_info.names["cmake_find_package"] = "LibUVC" + self.cpp_info.names["cmake_find_package_multi"] = "LibUVC" + self.cpp_info.components["_libuvc"].names["cmake_find_package"] = cmake_target + self.cpp_info.components["_libuvc"].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components["_libuvc"].set_property("cmake_target_name", f"LibUVC::{cmake_target}") + self.cpp_info.components["_libuvc"].set_property("pkg_config_name", "libuvc") diff --git a/recipes/libuvc/all/patches/0.0.7-0001-fix-cci-packagename.patch b/recipes/libuvc/all/patches/0.0.7-0001-fix-cci-packagename.patch new file mode 100644 index 0000000000000..06c70b926bb50 --- /dev/null +++ b/recipes/libuvc/all/patches/0.0.7-0001-fix-cci-packagename.patch @@ -0,0 +1,13 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index fbaffc9..e14daf4 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -116,7 +116,7 @@ foreach(target_name IN LISTS UVC_TARGETS) + ) + target_link_libraries(${target_name} + # libusb-1.0 used internally so we link to it privately. +- PRIVATE LibUSB::LibUSB ${threads} ++ PRIVATE libusb::libusb ${threads} + ) + if(JPEG_FOUND) + target_link_libraries(${target_name} diff --git a/recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch b/recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch new file mode 100644 index 0000000000000..7becb18ff92a3 --- /dev/null +++ b/recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch @@ -0,0 +1,63 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,13 +19,16 @@ set(libuvc_VERSION ${libuvc_VERSION_MAJOR}.${libuvc_VERSION_MINOR}.${libuvc_VERS + set(libuvc_DESCRIPTION "A cross-platform library for USB video devices") + set(libuvc_URL "https://github.com/ktossell/libuvc") + +-find_package(PkgConfig) ++find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBUSB libusb-1.0) ++link_directories(${LIBUSB_LIBRARY_DIRS}) + + # Try to find JPEG using a module or pkg-config. If that doesn't work, search for the header. +-find_package(jpeg QUIET) +-if(JPEG_FOUND) +- set(JPEG_LINK_FLAGS ${JPEG_LIBRARIES}) ++option(LIBUVC_WITH_JPEG "Support JPEG decoding" ON) ++if(LIBUVC_WITH_JPEG) ++find_package(JPEG REQUIRED) ++if(1) ++ set(JPEG_LINK_FLAGS JPEG::JPEG) + else() + pkg_check_modules(JPEG QUIET libjpeg) + if(JPEG_FOUND) +@@ -39,6 +42,7 @@ else() + endif() + endif() + endif() ++endif() + + include(GNUInstallDirs) + +@@ -57,7 +61,7 @@ include_directories( + ${LIBUSB_INCLUDE_DIRS} + ) + +-if(JPEG_FOUND) ++if(LIBUVC_WITH_JPEG) + message(STATUS "Building libuvc with JPEG support.") + include_directories(${JPEG_INCLUDE_DIR}) + SET(LIBUVC_HAS_JPEG TRUE) +@@ -84,6 +88,10 @@ endif() + + if(BUILD_UVC_STATIC) + add_library(uvc_static STATIC ${SOURCES}) ++ target_link_libraries(uvc_static ${LIBUSB_LIBRARIES}) ++ if(LIBUVC_WITH_JPEG) ++ target_link_libraries(uvc_static ${JPEG_LINK_FLAGS}) ++ endif() + set_target_properties(uvc_static PROPERTIES OUTPUT_NAME uvc) + list(APPEND UVC_TARGETS uvc_static) + endif() +@@ -97,9 +105,9 @@ foreach(target_name ${UVC_TARGETS}) + endforeach() + + if(BUILD_UVC_SHARED) +- if(JPEG_FOUND) ++ if(LIBUVC_WITH_JPEG) + target_link_libraries (uvc ${JPEG_LINK_FLAGS}) +- endif(JPEG_FOUND) ++ endif() + + target_link_libraries(uvc ${LIBUSB_LIBRARIES}) + diff --git a/recipes/libuvc/all/patches/0002-adjust-install-folder.patch b/recipes/libuvc/all/patches/0002-adjust-install-folder.patch new file mode 100644 index 0000000000000..aa773f521427f --- /dev/null +++ b/recipes/libuvc/all/patches/0002-adjust-install-folder.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,9 +118,10 @@ endif() + + install(TARGETS ${UVC_TARGETS} + EXPORT libuvcTargets +- LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" +- ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" +- PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include/libuvc" ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libuvc + ) + + export(TARGETS ${UVC_TARGETS} diff --git a/recipes/libuvc/all/test_package/CMakeLists.txt b/recipes/libuvc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ff4548b24f295 --- /dev/null +++ b/recipes/libuvc/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libuvc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET LibUVC::UVCShared) + target_link_libraries(${PROJECT_NAME} PRIVATE LibUVC::UVCShared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LibUVC::UVCStatic) +endif() diff --git a/recipes/libuvc/all/test_package/conanfile.py b/recipes/libuvc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/libuvc/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libuvc/all/test_package/test_package.c b/recipes/libuvc/all/test_package/test_package.c new file mode 100644 index 0000000000000..03aaa897d331d --- /dev/null +++ b/recipes/libuvc/all/test_package/test_package.c @@ -0,0 +1,47 @@ +#include +#include +#include + +int main() +{ + uvc_context_t *ctx; + uvc_error_t res; + uvc_device_t *dev; + uvc_device_handle_t *devh; + + res = uvc_init(&ctx, NULL); + + if (res < 0) { + uvc_perror(res, "uvc_init"); + return res; + } + + puts("UVC initialized"); + + res = uvc_find_device( + ctx, &dev, + 0, 0, NULL); + + if (res < 0) { + uvc_perror(res, "uvc_find_device"); + } else { + puts("Device found"); + + res = uvc_open(dev, &devh); + + if (res < 0) { + uvc_perror(res, "uvc_open"); + } else { + puts("Device opened"); + uvc_print_diag(devh, stderr); + uvc_close(devh); + puts("Device closed"); + } + uvc_unref_device(dev); + } + + uvc_exit(ctx); + puts("UVC exited"); + + return 0; +} diff --git a/recipes/libuvc/all/test_v1_package/CMakeLists.txt b/recipes/libuvc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libuvc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libuvc/all/test_v1_package/conanfile.py b/recipes/libuvc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libuvc/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/libuvc/config.yml b/recipes/libuvc/config.yml new file mode 100644 index 0000000000000..8915eeb6ead5c --- /dev/null +++ b/recipes/libuvc/config.yml @@ -0,0 +1,5 @@ +versions: + "0.0.7": + folder: all + "0.0.6": + folder: all diff --git a/recipes/libvault/all/CMakeLists.txt b/recipes/libvault/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/libvault/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libvault/all/conandata.yml b/recipes/libvault/all/conandata.yml new file mode 100644 index 0000000000000..c828fc89b0560 --- /dev/null +++ b/recipes/libvault/all/conandata.yml @@ -0,0 +1,23 @@ +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/fix-cmake-0.51.0.patch" + patch_type: "conan" + patch_description: "use libcurl from conan center" + "0.51.0": + - patch_file: "patches/fix-cmake-0.51.0.patch" + patch_type: "conan" + patch_description: "use libcurl from conan center" + "0.48.0": + - patch_file: "patches/fix-cmake-0.48.0.patch" + patch_type: "conan" + patch_description: "use libcurl from conan center" diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py new file mode 100644 index 0000000000000..659305c5f732b --- /dev/null +++ b/recipes/libvault/all/conanfile.py @@ -0,0 +1,117 @@ +import os + +from conan import ConanFile, Version +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 +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime + +required_conan_version = ">=1.53.0" + + +class LibvaultConan(ConanFile): + name = "libvault" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/abedra/libvault" + description = "A C++ library for Hashicorp Vault" + topics = ("vault", "libvault", "secrets", "passwords") + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt", "patches/**"] + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + @property + def _mac_os_minimum_required_version(self): + return "10.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 requirements(self): + self.requires("libcurl/7.86.0") + self.requires("catch2/3.2.0") + + def validate(self): + compiler = str(self.info.settings.compiler) + compiler_version = Version(self.settings.compiler.version.value) + + minimum_compiler_version = { + "Visual Studio": "19", + "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]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++{minimum_cpp_standard}. " + f"{compiler} {compiler_version} is not supported.") + + if 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): + os_version = self.info.settings.get_safe("os.version") + if os_version and Version(os_version) < self._mac_os_minimum_required_version: + 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], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TEST"] = "OFF" + tc.variables["ENABLE_INTEGRATION_TEST"] = "OFF" + tc.variables["ENABLE_COVERAGE"] = "OFF" + tc.variables["LINK_CURL"] = "OFF" + 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() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=self.build_folder) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["vault"] + self.cpp_info.system_libs = ["m"] + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + self.cpp_info.system_libs.append("stdc++fs") + # TODO: Remove after Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "libvault" + self.cpp_info.names["cmake_find_package_multi"] = "libvault" + + self.cpp_info.set_property("pkg_config_name", "vault") + self.cpp_info.set_property("cmake_file_name", "libvault") + self.cpp_info.set_property("cmake_target_name", "libvault::libvault") diff --git a/recipes/libvault/all/patches/fix-cmake-0.48.0.patch b/recipes/libvault/all/patches/fix-cmake-0.48.0.patch new file mode 100644 index 0000000000000..510090973c349 --- /dev/null +++ b/recipes/libvault/all/patches/fix-cmake-0.48.0.patch @@ -0,0 +1,63 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,6 @@ + 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,13 +13,6 @@ + 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) +- + include(GNUInstallDirs) + include_directories("${PROJECT_SOURCE_DIR}/lib") + +@@ -120,11 +112,20 @@ + + target_include_directories(vault PRIVATE src) + ++OPTION(UseCurl "UseCurl" ON) ++IF (UseCurl) ++ FIND_PACKAGE(CURL) ++ IF (CURL_FOUND) ++ target_link_libraries(vault CURL::libcurl) ++ ENDIF() ++ENDIF() ++ + if(LINK_CURL) + target_link_libraries(vault curl) + endif(LINK_CURL) + + if (ENABLE_COVERAGE) ++ set(CMAKE_CXX_FLAGS_DEBUG --coverage) + target_link_libraries(vault gcov) + endif () + +@@ -155,7 +156,7 @@ + "${CMAKE_CURRENT_BINARY_DIR}/libvaultConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libvault") + +- configure_file(vault.pc.in vault.pc @ONLY) ++ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vault.pc.in" "${CMAKE_BINARY_DIR}/vault.pc" @ONLY) + install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif (INSTALL) +@@ -176,7 +177,7 @@ + target_include_directories(libvault_test PRIVATE include) + + target_link_libraries(libvault_test vault) +- target_link_libraries(libvault_test curl) ++ target_link_libraries(libvault_test CURL::libcurl) + target_link_libraries(libvault_test Catch2::Catch2) + + include(CTest) diff --git a/recipes/libvault/all/patches/fix-cmake-0.51.0.patch b/recipes/libvault/all/patches/fix-cmake-0.51.0.patch new file mode 100644 index 0000000000000..74ce9e72d06db --- /dev/null +++ b/recipes/libvault/all/patches/fix-cmake-0.51.0.patch @@ -0,0 +1,49 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,13 +13,6 @@ 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) +- + include(GNUInstallDirs) + include_directories("${PROJECT_SOURCE_DIR}/lib") + +@@ -119,6 +112,14 @@ set_target_properties(vault PROPERTIES + + target_include_directories(vault PRIVATE src) + ++OPTION(UseCurl "UseCurl" ON) ++IF (UseCurl) ++ FIND_PACKAGE(CURL) ++ IF (CURL_FOUND) ++ target_link_libraries(vault CURL::libcurl) ++ ENDIF() ++ENDIF() ++ + if(LINK_CURL) + target_link_libraries(vault curl) + endif(LINK_CURL) +@@ -155,7 +156,7 @@ if (INSTALL) + "${CMAKE_CURRENT_BINARY_DIR}/libvaultConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libvault") + +- configure_file(vault.pc.in vault.pc @ONLY) ++ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vault.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/vault.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif (INSTALL) +@@ -176,7 +177,7 @@ if (ENABLE_TEST) + target_include_directories(libvault_test PRIVATE include) + + target_link_libraries(libvault_test vault) +- target_link_libraries(libvault_test curl) ++ target_link_libraries(libvault_test CURL::libcurl) + target_link_libraries(libvault_test Catch2::Catch2) + target_link_libraries(libvault_test stdc++fs) + diff --git a/recipes/libvault/all/test_package/CMakeLists.txt b/recipes/libvault/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..265e54ec6a967 --- /dev/null +++ b/recipes/libvault/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(libvault REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libvault::libvault) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libvault/all/test_package/conanfile.py b/recipes/libvault/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libvault/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/libvault/all/test_package/test_package.cpp b/recipes/libvault/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..354d2b5a580fe --- /dev/null +++ b/recipes/libvault/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main(void) { + Vault::Config config = Vault::ConfigBuilder().build(); + return EXIT_SUCCESS; +} diff --git a/recipes/libvault/all/test_v1_package/CMakeLists.txt b/recipes/libvault/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libvault/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libvault/all/test_v1_package/conanfile.py b/recipes/libvault/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/libvault/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libvault/config.yml b/recipes/libvault/config.yml new file mode 100644 index 0000000000000..327b1962634e5 --- /dev/null +++ b/recipes/libvault/config.yml @@ -0,0 +1,7 @@ +versions: + "0.52.0": + folder: "all" + "0.51.0": + folder: "all" + "0.48.0": + folder: "all" diff --git a/recipes/libverto/all/conandata.yml b/recipes/libverto/all/conandata.yml new file mode 100644 index 0000000000000..9d2dec7091b4a --- /dev/null +++ b/recipes/libverto/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.2": + url: "https://github.com/latchset/libverto/releases/download/0.3.2/libverto-0.3.2.tar.gz" + sha256: "8d1756fd704f147549f606cd987050fb94b0b1ff621ea6aa4d6bf0b74450468a" diff --git a/recipes/libverto/all/conanfile.py b/recipes/libverto/all/conanfile.py new file mode 100644 index 0000000000000..a35c9bf481ff4 --- /dev/null +++ b/recipes/libverto/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 +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, 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 LibVertoConan(ConanFile): + name = "libverto" + description = "An async event loop abstraction library." + homepage = "https://github.com/latchset/libverto" + topics = ("async", "eventloop") + license = "MIT" + 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], + "pthread": [True, False], + "with_glib": ["builtin", "external", False], + "with_libev": ["builtin", "external", False], + "with_libevent": ["builtin", "external", False], + "with_tevent": ["external", False], # tevent cannot be a builtin backend + "default": ["glib", "libev", "libevent", "tevent"], + } + default_options = { + "shared": False, + "fPIC": True, + "pthread": True, + "with_glib": False, + "with_libev": False, + "with_libevent": "builtin", + "with_tevent": False, + "default": "libevent", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _backend_dict(self): + return { + "glib": self.options.with_glib, + "libev": self.options.with_libev, + "libevent": self.options.with_libevent, + "tevent": self.options.with_tevent, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.pthread + + 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_glib: + self.requires("glib/2.76.0") + if self.options.with_libevent: + self.requires("libevent/2.1.12") + if self.options.with_libev: + self.requires("libev/4.33") + + def package_id(self): + del self.info.options.default + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("libverto does not support Visual Studio") + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Shared libraries are not supported on Windows") + + if not self._backend_dict[str(self.options.default)]: + raise ConanInvalidConfiguration(f"Default backend({self.options.default}) must be available") + + count = lambda iterable: sum(1 if it else 0 for it in iterable) + count_builtins = count(str(opt) == "builtin" for opt in self._backend_dict.values()) + count_externals = count(str(opt) == "external" for opt in self._backend_dict.values()) + if count_builtins > 1: + raise ConanInvalidConfiguration("Cannot have more then one builtin backend") + if not self.options.shared: + if count_externals > 0: + raise ConanInvalidConfiguration("Cannot have an external backend when building a static libverto") + if count_builtins > 0 and count_externals > 0: + raise ConanInvalidConfiguration("Cannot combine builtin and external backends") + if self.options.with_tevent: + # FIXME: missing tevent recipe + raise ConanInvalidConfiguration("tevent is not (yet) available on conan-center") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + yes_no_builtin = lambda v: {"external": "yes", "False": "no", "builtin": "builtin"}[str(v)] + tc.configure_args.extend([ + f"--with-pthread={yes_no(self.options.get_safe('pthread'))}", + f"--with-glib={yes_no_builtin(self.options.with_glib)}", + f"--with-libev={yes_no_builtin(self.options.with_libev)}", + f"--with-libevent={yes_no_builtin(self.options.with_libevent)}", + f"--with-tevent={yes_no_builtin(self.options.with_tevent)}", + ]) + tc.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self,"COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.components["verto"].set_property("pkg_config_name", "libverto") + self.cpp_info.components["verto"].libs = ["verto"] + if self.settings.os == "Linux": + self.cpp_info.components["verto"].system_libs.append("dl") + if self.options.pthread: + self.cpp_info.components["verto"].system_libs.append("pthread") + + if self.options.with_glib == "builtin": + self.cpp_info.components["verto"].requires.append("glib::glib") + elif self.options.with_glib: + self.cpp_info.components["verto-glib"].set_property("pkg_config_name", "libverto-glib") + self.cpp_info.components["verto-glib"].libs = ["verto-glib"] + self.cpp_info.components["verto-glib"].requires = ["verto", "glib::glib"] + + if self.options.with_libev == "builtin": + self.cpp_info.components["verto"].requires.append("libev::libev") + elif self.options.with_libev: + self.cpp_info.components["verto-libev"].set_property("pkg_config_name", "libverto-libev") + self.cpp_info.components["verto-libev"].libs = ["verto-libev"] + self.cpp_info.components["verto-libev"].requires = ["verto", "libev::libev"] + + if self.options.with_libevent == "builtin": + self.cpp_info.components["verto"].requires.append("libevent::libevent") + elif self.options.with_libevent: + self.cpp_info.components["verto-libevent"].set_property("pkg_config_name", "libverto-libevent") + self.cpp_info.components["verto-libevent"].libs = ["verto-libevent"] + self.cpp_info.components["verto-libevent"].requires = ["verto", "libevent::libevent"] + + if self.options.with_tevent: + self.cpp_info.components["verto-tevent"].set_property("pkg_config_name", "libverto-tevent") + self.cpp_info.components["verto-tevent"].libs = ["verto-tevent"] + self.cpp_info.components["verto-tevent"].requires = ["verto", "tevent::tevent"] diff --git a/recipes/libverto/all/test_package/CMakeLists.txt b/recipes/libverto/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..78d37a6a36d00 --- /dev/null +++ b/recipes/libverto/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +enable_testing() + +find_package(libverto REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libverto::libverto) + +if(LIBVERTO_WITH_GLIB) + add_test(NAME libverto_with_glib COMMAND ${PROJECT_NAME} glib) +endif() +if(LIBVERTO_WITH_LIBEV) + add_test(NAME libverto_with_libev COMMAND ${PROJECT_NAME} libev) +endif() +if(LIBVERTO_WITH_LIBEVENT) + add_test(NAME libverto_with_libevent COMMAND ${PROJECT_NAME} libevent) +endif() +if(LIBVERTO_WITH_TEVENT) + add_test(NAME libverto_with_tevent COMMAND ${PROJECT_NAME} tevent) +endif() diff --git a/recipes/libverto/all/test_package/conanfile.py b/recipes/libverto/all/test_package/conanfile.py new file mode 100644 index 0000000000000..010f253d06fa3 --- /dev/null +++ b/recipes/libverto/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.build import build_jobs, can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "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) + libverto_options = self.dependencies["libverto"].options + tc.variables["LIBVERTO_WITH_GLIB"] = bool(libverto_options.with_glib) + tc.variables["LIBVERTO_WITH_LIBEV"] = bool(libverto_options.with_libev) + tc.variables["LIBVERTO_WITH_LIBEVENT"] = bool(libverto_options.with_libevent) + tc.variables["LIBVERTO_WITH_TEVENT"] = bool(libverto_options.with_tevent) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/libverto/all/test_package/test_package.c b/recipes/libverto/all/test_package/test_package.c new file mode 100644 index 0000000000000..1913e927c5213 --- /dev/null +++ b/recipes/libverto/all/test_package/test_package.c @@ -0,0 +1,54 @@ +#include "verto.h" + +#include +#include + +struct timeout_info { + int count; +}; + +static void on_timeout(verto_ctx *ctx, verto_ev *ev) { + struct timeout_info *tinfo = (struct timeout_info *) verto_get_private(ev); + tinfo->count++; + printf("callback called: %d\n", tinfo->count); + fflush(stdout); + if (tinfo->count != 20) { + verto_set_private(ev, NULL, NULL); + verto_ev *ev_new = verto_add_timeout(ctx, VERTO_EV_FLAG_NONE, on_timeout, 50); + verto_set_private(ev_new, tinfo, NULL); + } else { + verto_break(ctx); + } +} + +int main(int argc, char *argv[]) +{ + verto_ctx *ctx; + verto_ev *ev; + + if (argc < 2) { + fprintf(stderr, "Need to pass the backend as an argument\n"); + return 1; + } + + ctx = verto_new(argv[1], VERTO_EV_TYPE_TIMEOUT); + if (ctx == NULL) { + fprintf(stderr, "verto_new failed\n"); + return 1; + } + struct timeout_info *tinfo = (struct timeout_info*) malloc(sizeof(struct timeout_info)); + tinfo->count = 0; + ev = verto_add_timeout(ctx, VERTO_EV_FLAG_NONE, on_timeout, 50); + if (ev == NULL) { + fprintf(stderr, "verto_add_timeout failed\n"); + return 1; + } + verto_set_private(ev, tinfo, NULL); + + verto_run(ctx); + free(tinfo); + + verto_free(ctx); +// verto_cleanup(); // <= munmap_chunk(): invalid pointer here + return 0; +} diff --git a/recipes/libverto/all/test_v1_package/CMakeLists.txt b/recipes/libverto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c23ed5cfe6d98 --- /dev/null +++ b/recipes/libverto/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libverto/all/test_v1_package/conanfile.py b/recipes/libverto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..dba2a86154e1e --- /dev/null +++ b/recipes/libverto/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +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.definitions["LIBVERTO_WITH_GLIB"] = bool(self.options["libverto"].with_glib) + cmake.definitions["LIBVERTO_WITH_LIBEV"] = bool(self.options["libverto"].with_libev) + cmake.definitions["LIBVERTO_WITH_LIBEVENT"] = bool(self.options["libverto"].with_libevent) + cmake.definitions["LIBVERTO_WITH_TEVENT"] = bool(self.options["libverto"].with_tevent) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/libverto/config.yml b/recipes/libverto/config.yml new file mode 100644 index 0000000000000..5597932a8f4a7 --- /dev/null +++ b/recipes/libverto/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.2": + folder: "all" diff --git a/recipes/libvips/all/conandata.yml b/recipes/libvips/all/conandata.yml new file mode 100644 index 0000000000000..63e4c5485d4ad --- /dev/null +++ b/recipes/libvips/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "8.14.2": + url: "https://github.com/libvips/libvips/releases/download/v8.14.2/vips-8.14.2.tar.xz" + sha256: "27dad021f0835a5ab14e541d02abd41e4c3bd012d2196438df5a9e754984f7ce" diff --git a/recipes/libvips/all/conanfile.py b/recipes/libvips/all/conanfile.py new file mode 100644 index 0000000000000..e977e0d7cab2b --- /dev/null +++ b/recipes/libvips/all/conanfile.py @@ -0,0 +1,375 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import can_run +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.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 +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class LibvipsConan(ConanFile): + name = "libvips" + description = "libvips is a demand-driven, horizontally threaded image processing library." + license = "LGPL-2.1-or-later" + topics = ("image", "image-processing") + homepage = "https://www.libvips.org" + 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], + "deprecated": [True, False], + "cpp": [True, False], + "introspection": [True, False], + "vapi": [True, False], + "with_cfitsio": [True, False], + "with_cgif": [True, False], + "with_exif": [True, False], + "with_fftw": [True, False], + "with_fontconfig": [True, False], + "with_gsf": [True, False], + "with_heif": [True, False], + "with_imagequant": [True, False], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg", False], + "with_jpeg_xl": [True, False], + "with_lcms": [True, False], + "with_magick": [True, False], + "with_matio": [True, False], + "with_nifti": [True, False], + "with_openexr": [True, False], + "with_openjpeg": [True, False], + "with_openslide": [True, False], + "with_orc": [True, False], + "with_pangocairo": [True, False], + "with_pdfium": [True, False], + "with_png": ["libpng", "libspng", False], + "with_poppler": [True, False], + "with_quantizr": [True, False], + "with_rsvg": [True, False], + "with_tiff": [True, False], + "with_webp": [True, False], + "with_zlib": [True, False], + "with_nsgif": [True, False], + "with_ppm": [True, False], + "with_analyse": [True, False], + "with_radiance": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "deprecated": True, + "cpp": True, + "introspection": False, + "vapi": False, + "with_cfitsio": False, + "with_cgif": False, + "with_exif": False, + "with_fftw": True, + "with_fontconfig": False, + "with_gsf": False, + "with_heif": False, + "with_imagequant": False, + "with_jpeg": "libjpeg", + "with_jpeg_xl": False, + "with_lcms": True, + "with_magick": False, + "with_matio": False, + "with_nifti": False, + "with_openexr": False, + "with_openjpeg": False, + "with_openslide": False, + "with_orc": False, + "with_pangocairo": False, + "with_pdfium": False, + "with_png": "libspng", + "with_poppler": False, + "with_quantizr": False, + "with_rsvg": False, + "with_tiff": True, + "with_webp": True, + "with_zlib": True, + "with_nsgif": True, + "with_ppm": True, + "with_analyse": True, + "with_radiance": 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 not self.options.cpp: + 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("expat/2.5.0") + self.requires("glib/2.76.1", transitive_headers=True, transitive_libs=True, run=can_run(self)) + if self.options.with_cfitsio: + self.requires("cfitsio/4.1.0") + if self.options.with_cgif: + self.requires("cgif/0.3.0") + if self.options.with_exif: + self.requires("libexif/0.6.24") + if self.options.with_fftw: + self.requires("fftw/3.3.10") + if self.options.with_fontconfig: + self.requires("fontconfig/2.14.2") + if self.options.with_heif: + self.requires("libheif/1.13.0") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + if self.options.with_jpeg_xl: + self.requires("libjxl/0.6.1") + if self.options.with_lcms: + self.requires("lcms/2.14") + if self.options.with_magick: + self.requires("imagemagick/7.0.11-14") + if self.options.with_matio: + self.requires("matio/1.5.23") + if self.options.with_openexr: + self.requires("openexr/3.1.5") + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + if self.options.with_pangocairo: + self.requires("pango/1.50.10") + if self.options.with_pdfium: + self.requires("pdfium/cci.20210730") + if self.options.with_png == "libpng": + self.requires("libpng/1.6.39") + elif self.options.with_png == "libspng": + self.requires("libspng/0.7.3") + if self.options.with_poppler: + self.requires("poppler/21.07.0") + if self.options.with_tiff: + self.requires("libtiff/4.4.0") + if self.options.with_webp: + self.requires("libwebp/1.3.0") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + + def validate(self): + if self.options.vapi and not self.options.introspection: + raise ConanInvalidConfiguration("vapi requires introspection") + if self.options.with_pangocairo and not self.dependencies["pango"].options.with_cairo: + raise ConanInvalidConfiguration(f"{self.ref}:with_pangocairo=True requires pango/*:with_cairo=True") + if self.options.with_pdfium and self.options.with_poppler: + raise ConanInvalidConfiguration("pdf support is enabled either with pdfium or poppler") + if self.options.with_cgif and not (self.options.with_imagequant or self.options.with_quantizr): + raise ConanInvalidConfiguration("with_cgif requires either with_imagequant or with_quantizr") + + # Visual Studio < 2019 doesn't seem to like pointer restrict of pointer restrict in libnsgif + check_min_vs(self, "192") + + if is_msvc(self) and is_msvc_static_runtime(self) and not self.options.shared and \ + self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} static with MT runtime not supported if glib shared due to conancenter CI limitations" + ) + + if self.options.with_gsf: + raise ConanInvalidConfiguration("libgsf recipe not available in conancenter yet") + if self.options.with_imagequant: + raise ConanInvalidConfiguration("libimagequant recipe not available in conancenter yet") + if self.options.with_nifti: + raise ConanInvalidConfiguration("nifti recipe not available in conancenter yet") + if self.options.with_openslide: + raise ConanInvalidConfiguration("openslide recipe not available in conancenter yet") + if self.options.with_orc: + raise ConanInvalidConfiguration("orc recipe not available in conancenter yet") + if self.options.with_quantizr: + raise ConanInvalidConfiguration("quantizr recipe not available in conancenter yet") + if self.options.with_rsvg: + raise ConanInvalidConfiguration("librsvg recipe not available in conancenter yet") + + def build_requirements(self): + self.tool_requires("meson/1.0.1") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self.options.introspection: + self.tool_requires("gobject-introspection/1.72.0") + if not can_run(self): + self.tool_requires("glib/2.76.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = MesonToolchain(self) + true_false = lambda v: "true" if v else "false" + enabled_disabled = lambda v: "enabled" if v else "disabled" + tc.project_options["deprecated"] = true_false(self.options.deprecated) + tc.project_options["examples"] = "false" + tc.project_options["cplusplus"] = true_false(self.options.cpp) + tc.project_options["doxygen"] = "false" + tc.project_options["gtk_doc"] = "false" + tc.project_options["modules"] = "disabled" + tc.project_options["introspection"] = true_false(self.options.introspection) + tc.project_options["vapi"] = true_false(self.options.vapi) + # External libraries + tc.project_options["cfitsio"] = enabled_disabled(self.options.with_cfitsio) + tc.project_options["cgif"] = enabled_disabled(self.options.with_cgif) + tc.project_options["exif"] = enabled_disabled(self.options.with_exif) + tc.project_options["fftw"] = enabled_disabled(self.options.with_fftw) + tc.project_options["fontconfig"] = enabled_disabled(self.options.with_fontconfig) + tc.project_options["gsf"] = enabled_disabled(self.options.with_gsf) + tc.project_options["heif"] = enabled_disabled(self.options.with_heif) + tc.project_options["heif-module"] = "disabled" + tc.project_options["imagequant"] = enabled_disabled(self.options.with_imagequant) + tc.project_options["jpeg"] = enabled_disabled(bool(self.options.with_jpeg)) + tc.project_options["jpeg-xl"] = enabled_disabled(self.options.with_jpeg_xl) + tc.project_options["jpeg-xl-module"] = "disabled" + tc.project_options["lcms"] = enabled_disabled(self.options.with_lcms) + tc.project_options["magick"] = enabled_disabled(self.options.with_magick) + tc.project_options["magick-module"] = "disabled" + tc.project_options["matio"] = enabled_disabled(self.options.with_matio) + tc.project_options["nifti"] = enabled_disabled(self.options.with_nifti) + tc.project_options["openexr"] = enabled_disabled(self.options.with_openexr) + tc.project_options["openjpeg"] = enabled_disabled(self.options.with_openjpeg) + tc.project_options["openslide"] = enabled_disabled(self.options.with_openslide) + tc.project_options["openslide-module"] = "disabled" + tc.project_options["orc"] = enabled_disabled(self.options.with_orc) + tc.project_options["pangocairo"] = enabled_disabled(self.options.with_pangocairo) + tc.project_options["pdfium"] = enabled_disabled(self.options.with_pdfium) + tc.project_options["png"] = enabled_disabled(self.options.with_png == "libpng") + tc.project_options["poppler"] = enabled_disabled(self.options.with_poppler) + tc.project_options["poppler-module"] = "disabled" + tc.project_options["quantizr"] = enabled_disabled(self.options.with_quantizr) + tc.project_options["rsvg"] = enabled_disabled(self.options.with_rsvg) + tc.project_options["spng"] = enabled_disabled(self.options.with_png == "libspng") + tc.project_options["tiff"] = enabled_disabled(self.options.with_tiff) + tc.project_options["webp"] = enabled_disabled(self.options.with_webp) + tc.project_options["zlib"] = enabled_disabled(self.options.with_zlib) + # Other supported formats without external libs + tc.project_options["nsgif"] = true_false(self.options.with_nsgif) + tc.project_options["ppm"] = true_false(self.options.with_ppm) + tc.project_options["analyze"] = true_false(self.options.with_analyse) + tc.project_options["radiance"] = true_false(self.options.with_radiance) + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + # Disable tests + meson_build = os.path.join(self.source_folder, "meson.build") + replace_in_file(self, meson_build, "subdir('test')", "") + replace_in_file(self, meson_build, "subdir('fuzz')", "") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=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, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.components["vips"].set_property("pkg_config_name", "vips") + self.cpp_info.components["vips"].libs = ["vips"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["vips"].system_libs.extend(["m", "pthread"]) + self.cpp_info.components["vips"].requires = [ + "expat::expat", "glib::glib-2.0", "glib::gio-2.0", "glib::gobject-2.0", + ] + if self.options.with_cfitsio: + self.cpp_info.components["vips"].requires.append("cfitsio::cfitsio") + if self.options.with_cgif: + self.cpp_info.components["vips"].requires.append("cgif::cgif") + if self.options.with_exif: + self.cpp_info.components["vips"].requires.append("libexif::libexif") + if self.options.with_fftw: + self.cpp_info.components["vips"].requires.append("fftw::fftw") + if self.options.with_fontconfig: + self.cpp_info.components["vips"].requires.append("fontconfig::fontconfig") + if self.options.with_heif: + self.cpp_info.components["vips"].requires.append("libheif::libheif") + if self.options.with_jpeg == "libjpeg": + self.cpp_info.components["vips"].requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.components["vips"].requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.components["vips"].requires.append("mozjpeg::libjpeg") + if self.options.with_jpeg_xl: + self.cpp_info.components["vips"].requires.append("libjxl::libjxl") + if self.options.with_lcms: + self.cpp_info.components["vips"].requires.append("lcms::lcms") + if self.options.with_magick: + self.cpp_info.components["vips"].requires.append("imagemagick::MagickCore") + if self.options.with_matio: + self.cpp_info.components["vips"].requires.append("matio::matio") + if self.options.with_openexr: + self.cpp_info.components["vips"].requires.append("openexr::openexr") + if self.options.with_openjpeg: + self.cpp_info.components["vips"].requires.append("openjpeg::openjpeg") + if self.options.with_pangocairo: + self.cpp_info.components["vips"].requires.append("pango::pangocairo") + if self.options.with_pdfium: + self.cpp_info.components["vips"].requires.append("pdfium::pdfium") + if self.options.with_png == "libpng": + self.cpp_info.components["vips"].requires.append("libpng::libpng") + elif self.options.with_png == "libspng": + self.cpp_info.components["vips"].requires.append("libspng::libspng") + if self.options.with_poppler: + self.cpp_info.components["vips"].requires.append("poppler::poppler") + if self.options.with_tiff: + self.cpp_info.components["vips"].requires.append("libtiff::libtiff") + if self.options.with_webp: + self.cpp_info.components["vips"].requires.append("libwebp::libwebp") + if self.options.with_zlib: + self.cpp_info.components["vips"].requires.append("zlib::zlib") + + if self.options.cpp: + self.cpp_info.components["vips-cpp"].set_property("pkg_config_name", "vips-cpp") + self.cpp_info.components["vips-cpp"].libs = ["vips-cpp"] + self.cpp_info.components["vips-cpp"].requires = ["vips"] + + # TODO: to remove once conan v1 support dropped + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libvips/all/test_package/CMakeLists.txt b/recipes/libvips/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a0c5a27965e1f --- /dev/null +++ b/recipes/libvips/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libvips REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libvips::vips) diff --git a/recipes/libvips/all/test_package/conanfile.py b/recipes/libvips/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea70607af0172 --- /dev/null +++ b/recipes/libvips/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + 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") + img_path = os.path.join(self.source_folder, "testimg.jpg") + self.run(f"{bin_path} {img_path}", env="conanrun") diff --git a/recipes/libvips/all/test_package/test_package.c b/recipes/libvips/all/test_package/test_package.c new file mode 100644 index 0000000000000..4218e858f81db --- /dev/null +++ b/recipes/libvips/all/test_package/test_package.c @@ -0,0 +1,29 @@ +#include + +#include + +int main(int argc, char **argv) { + VipsImage *in; + double mean; + VipsImage *out; + + if (VIPS_INIT(argv[0])) vips_error_exit(NULL); + + if (argc < 2) vips_error_exit("usage: %s infile", argv[0]); + + if (!(in = vips_image_new_from_file(argv[1], NULL))) vips_error_exit(NULL); + + printf("image width = %d\n", vips_image_get_width(in)); + + if (vips_avg(in, &mean, NULL)) vips_error_exit(NULL); + + if (vips_invert(in, &out, NULL)) vips_error_exit(NULL); + + g_object_unref(in); + + if (vips_image_write_to_file(out, "out.jpg", NULL)) vips_error_exit(NULL); + + g_object_unref(out); + + return 0; +} diff --git a/recipes/libvips/all/test_package/testimg.jpg b/recipes/libvips/all/test_package/testimg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a026e486f57de704ac5e9344ea20bb9973935e1d GIT binary patch literal 5764 zcmbW)XH*kRmjK{|fOM1+q<0V!iu7It={1x<0{9}GptML;LlnJ7?z4+%xAsGk@+}PG2qpu9+AZ8vuYn008)B050bM zdH|X$SE#R0(NI%U)6&w=F|aW*(9<(;vanudH_NTm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XTJCA!k4cq%}z@PDQ>P%spXBx1`7=dd~YF>&qLVuDLrqXKCe6^#k)t z=zNP|`_6;&QFNPb?LY1Mb4I_mEk)neVQ-4{-3lTT$W+gZi*Rn&Y}U7`8>WcIb{SI2+lxgCIV z#LoI!)vCcwAY=rGm#PNLCYN(l{{fmkq>*7_=!y3${CEIYB-E`ZwawbFOVpALhSXcu z#WwD-qnWG9-HPC1*y_<^@h)ERS4kad6dUIerZPoGvTmcn^q=X(YvMmT^;@&*v&mU8 zq3!lU{nLGOImt{XFcU{6^}L7Hvdc;0r5}6SG%Q!>R(h4(G$KpSzZ92TSAaRC2c0u+ z6O0+(4vG(M1?sbX?ej-hc77IUAzo~d{pC5O(%w&w&^okE47^IRnxy0%5KBd8$l7_o zYD?>u4IEW9RDjv))Zz>w5L1qF-/dev/null)" = "Cygwin" ] \ ++if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] || [ "$(uname -o 2>/dev/null)" = "Msys" ]\ + && cygpath --help >/dev/null 2>&1; then + FIXPATH='cygpath -m' + else diff --git a/recipes/libvpx/all/test_package/CMakeLists.txt b/recipes/libvpx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2cd854f46c254 --- /dev/null +++ b/recipes/libvpx/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libvpx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libvpx::libvpx) diff --git a/recipes/libvpx/all/test_package/conanfile.py b/recipes/libvpx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libvpx/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libvpx/all/test_package/test_package.c b/recipes/libvpx/all/test_package/test_package.c new file mode 100644 index 0000000000000..8c17317989095 --- /dev/null +++ b/recipes/libvpx/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include + +int main() +{ + printf("vpx version %s\n", vpx_codec_version_str()); + return 0; +} diff --git a/recipes/libvpx/all/test_v1_package/CMakeLists.txt b/recipes/libvpx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f6b1a2f7ec79 --- /dev/null +++ b/recipes/libvpx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libvpx/all/test_v1_package/conanfile.py b/recipes/libvpx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/libvpx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libvpx/config.yml b/recipes/libvpx/config.yml new file mode 100644 index 0000000000000..460cf69bd04b2 --- /dev/null +++ b/recipes/libvpx/config.yml @@ -0,0 +1,7 @@ +versions: + "1.11.0": + folder: all + "1.10.0": + folder: all + "1.9.0": + folder: all diff --git a/recipes/libwebp/all/conandata.yml b/recipes/libwebp/all/conandata.yml new file mode 100644 index 0000000000000..ac9853ed7cd15 --- /dev/null +++ b/recipes/libwebp/all/conandata.yml @@ -0,0 +1,71 @@ +sources: + "1.3.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.0.tar.gz" + sha256: "64ac4614db292ae8c5aa26de0295bf1623dbb3985054cb656c55e67431def17c" + "1.2.4": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.4.tar.gz" + sha256: "7bf5a8a28cc69bcfa8cb214f2c3095703c6b73ac5fba4d5480c205331d9494df" + "1.2.3": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.3.tar.gz" + sha256: "f5d7ab2390b06b8a934a4fc35784291b3885b557780d099bd32f09241f9d83f9" + "1.2.2": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz" + sha256: "7656532f837af5f4cec3ff6bafe552c044dc39bf453587bd5b77450802f4aee6" + "1.2.1": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.1.tar.gz" + sha256: "808b98d2f5b84e9b27fdef6c5372dac769c3bda4502febbfa5031bd3c4d7d018" + "1.2.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.0.tar.gz" + sha256: "2fc8bbde9f97f2ab403c0224fb9ca62b2e6852cbc519e91ceaa7c153ffd88a0c" + "1.1.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz" + sha256: "98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f50ef043" + "1.0.3": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.3.tar.gz" + sha256: "e20a07865c8697bba00aebccc6f54912d6bc333bb4d604e6b07491c1a226b34f" +patches: + "1.3.0": + - patch_file: "patches/1.3.0-0001-fix-cmake.patch" + patch_description: "disable PIC, disable prefix library name on MSVC" + patch_type: "conan" + "1.2.4": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + "1.2.3": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + "1.2.2": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + "1.2.1": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + "1.2.0": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-build-libwebpmux.patch" + patch_description: "always build libwebpmux" + patch_type: "conan" + "1.1.0": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + - patch_file: "patches/1.1.0-0002-qnx.patch" + patch_description: "work around cmake bug on QNX" + patch_type: "conan" + patch_source: "https://chromium-review.googlesource.com/c/webm/libwebp/+/2637274" + - patch_file: "patches/1.1.0-0003-build-libwebpmux.patch" + patch_description: "always build libwebpmux" + patch_type: "conan" + "1.0.3": + - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + patch_description: "define WEBP_EXTERN for windows shared build" + patch_type: "portability" + - patch_file: "patches/1.0.3-0002-build-libwebpmux.patch" + patch_description: "always build libwebpmux" + patch_type: "conan" diff --git a/recipes/libwebp/all/conanfile.py b/recipes/libwebp/all/conanfile.py new file mode 100644 index 0000000000000..0044f425b95b1 --- /dev/null +++ b/recipes/libwebp/all/conanfile.py @@ -0,0 +1,144 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibwebpConan(ConanFile): + name = "libwebp" + description = "Library to encode and decode images in WebP format" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://chromium.googlesource.com/webm/libwebp" + topics = ("image", "libwebp", "webp", "decoding", "encoding") + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_simd": [True, False], + "near_lossless": [True, False], + "swap_16bit_csp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_simd": True, + "near_lossless": True, + "swap_16bit_csp": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # should be an option but it doesn't work yet + tc.variables["WEBP_ENABLE_SIMD"] = self.options.with_simd + if Version(self.version) >= "1.0.0": + tc.variables["WEBP_NEAR_LOSSLESS"] = self.options.near_lossless + else: + tc.variables["WEBP_ENABLE_NEAR_LOSSLESS"] = self.options.near_lossless + tc.variables["WEBP_ENABLE_SWAP_16BIT_CSP"] = self.options.swap_16bit_csp + # avoid finding system libs + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_GIF"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_PNG"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_TIFF"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_JPEG"] = True + tc.variables["WEBP_BUILD_ANIM_UTILS"] = False + tc.variables["WEBP_BUILD_CWEBP"] = False + tc.variables["WEBP_BUILD_DWEBP"] = False + tc.variables["WEBP_BUILD_IMG2WEBP"] = False + tc.variables["WEBP_BUILD_GIF2WEBP"] = False + tc.variables["WEBP_BUILD_VWEBP"] = False + tc.variables["WEBP_BUILD_EXTRAS"] = False + tc.variables["WEBP_BUILD_WEBPINFO"] = False + if Version(self.version) >= "1.2.1": + tc.variables["WEBP_BUILD_LIBWEBPMUX"] = True + tc.variables["WEBP_BUILD_WEBPMUX"] = False + if self.options.shared and is_msvc(self): + # Building a dll (see fix-dll-export patch) + tc.preprocessor_definitions["WEBP_DLL"] = 1 + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "WebP") + self.cpp_info.set_property("pkg_config_name", "libwebp-all-do-not-use") + + # webpdecoder + self.cpp_info.components["webpdecoder"].set_property("cmake_target_name", "WebP::webpdecoder") + self.cpp_info.components["webpdecoder"].set_property("pkg_config_name", "libwebpdecoder") + self.cpp_info.components["webpdecoder"].libs = ["webpdecoder"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["webpdecoder"].system_libs = ["m", "pthread"] + + # webp + self.cpp_info.components["webp"].set_property("cmake_target_name", "WebP::webp") + self.cpp_info.components["webp"].set_property("pkg_config_name", "libwebp") + self.cpp_info.components["webp"].libs = ["webp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["webp"].system_libs = ["m", "pthread"] + + if Version(self.version) >= "1.3.0": + # sharpyuv + self.cpp_info.components["sharpyuv"].set_property("cmake_target_name", "WebP::sharpyuv") + self.cpp_info.components["sharpyuv"].set_property("pkg_config_name", "libsharpyuv") + self.cpp_info.components["sharpyuv"].libs = ["sharpyuv"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sharpyuv"].system_libs = ["m", "pthread"] + # note: webp now depends on sharpyuv + self.cpp_info.components["webp"].requires = ["sharpyuv"] + + # webpdemux + self.cpp_info.components["webpdemux"].set_property("cmake_target_name", "WebP::webpdemux") + self.cpp_info.components["webpdemux"].set_property("pkg_config_name", "libwebpdemux") + self.cpp_info.components["webpdemux"].libs = ["webpdemux"] + self.cpp_info.components["webpdemux"].requires = ["webp"] + + # webpmux + self.cpp_info.components["webpmux"].set_property("cmake_target_name", "WebP::libwebpmux") + self.cpp_info.components["webpmux"].set_property("pkg_config_name", "libwebpmux") + self.cpp_info.components["webpmux"].libs = ["webpmux"] + self.cpp_info.components["webpmux"].requires = ["webp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["webpmux"].system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "WebP" + self.cpp_info.names["cmake_find_package_multi"] = "WebP" + self.cpp_info.names["pkg_config"] = "libwebp-all-do-not-use" + self.cpp_info.components["webpmux"].names["cmake_find_package"] = "libwebpmux" + self.cpp_info.components["webpmux"].names["cmake_find_package_multi"] = "libwebpmux" diff --git a/recipes/libwebp/all/patches/1.0.3-0001-fix-dll-export.patch b/recipes/libwebp/all/patches/1.0.3-0001-fix-dll-export.patch new file mode 100644 index 0000000000000..ec00b8a258a99 --- /dev/null +++ b/recipes/libwebp/all/patches/1.0.3-0001-fix-dll-export.patch @@ -0,0 +1,15 @@ +diff --git a/src/webp/types.h b/src/webp/types.h +index 0ce2622..69f7e89 100644 +--- a/src/webp/types.h ++++ b/src/webp/types.h +@@ -39,7 +39,9 @@ typedef long long int int64_t; + #ifndef WEBP_EXTERN + // This explicitly marks library functions and allows for changing the + // signature for e.g., Windows DLL builds. +-# if defined(__GNUC__) && __GNUC__ >= 4 ++# if defined(_MSC_VER) && defined(WEBP_DLL) ++# define WEBP_EXTERN __declspec(dllexport) ++# elif defined(__GNUC__) && __GNUC__ >= 4 + # define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) + # else + # define WEBP_EXTERN extern diff --git a/recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch b/recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch new file mode 100644 index 0000000000000..0892ee3bdacd9 --- /dev/null +++ b/recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -401,7 +401,7 @@ if(WEBP_BUILD_CWEBP) + install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + +-if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP) ++if(1) + parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "") + add_library(libwebpmux ${WEBP_MUX_SRCS}) + target_link_libraries(libwebpmux webp) diff --git a/recipes/libwebp/all/patches/1.1.0-0002-qnx.patch b/recipes/libwebp/all/patches/1.1.0-0002-qnx.patch new file mode 100644 index 0000000000000..00f5a9a0aa598 --- /dev/null +++ b/recipes/libwebp/all/patches/1.1.0-0002-qnx.patch @@ -0,0 +1,14 @@ +diff --git a/cmake/deps.cmake b/cmake/deps.cmake +index f19c0378..7b2d7cd7 100644 +--- a/cmake/deps.cmake ++++ b/cmake/deps.cmake +@@ -24,7 +24,8 @@ check_c_source_compiles(" + # Check for libraries. + find_package(Threads) + if(Threads_FOUND) +- if(CMAKE_USE_PTHREADS_INIT) ++ # work around cmake bug on QNX (https://chromium-review.googlesource.com/c/webm/libwebp/+/2637274) ++ if(CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_SYSTEM_NAME STREQUAL "QNX") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") + endif() + foreach(PTHREAD_TEST HAVE_PTHREAD_PRIO_INHERIT PTHREAD_CREATE_UNDETACHED) diff --git a/recipes/libwebp/all/patches/1.1.0-0003-build-libwebpmux.patch b/recipes/libwebp/all/patches/1.1.0-0003-build-libwebpmux.patch new file mode 100644 index 0000000000000..a6ef960dc695c --- /dev/null +++ b/recipes/libwebp/all/patches/1.1.0-0003-build-libwebpmux.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -402,7 +402,7 @@ if(WEBP_BUILD_CWEBP) + install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + +-if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP) ++if(1) + parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "") + add_library(libwebpmux ${WEBP_MUX_SRCS}) + target_link_libraries(libwebpmux webp) diff --git a/recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch b/recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch new file mode 100644 index 0000000000000..5f228670d57c8 --- /dev/null +++ b/recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -449,7 +449,7 @@ if(WEBP_BUILD_CWEBP) + install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + +-if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP) ++if(1) + parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "") + add_library(libwebpmux ${WEBP_MUX_SRCS}) + target_link_libraries(libwebpmux webp) diff --git a/recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f9c41d4f6a541 --- /dev/null +++ b/recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 0a5af42..781f4c7 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -58,7 +58,6 @@ if(WEBP_LINK_STATIC) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + endif() +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # vwebp does not compile on Ubuntu with static libraries so disabling it for + # now. + set(WEBP_BUILD_VWEBP OFF) +@@ -142,7 +141,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/all/test_package/CMakeLists.txt b/recipes/libwebp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5c4f1c676a652 --- /dev/null +++ b/recipes/libwebp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(WebP REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE WebP::webp) diff --git a/recipes/libwebp/all/test_package/conanfile.py b/recipes/libwebp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libwebp/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/libwebp/all/test_package/test_package.c b/recipes/libwebp/all/test_package/test_package.c new file mode 100644 index 0000000000000..de9dbff162aa2 --- /dev/null +++ b/recipes/libwebp/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main(void) +{ + int version = WebPGetDecoderVersion(); + printf("Webp Decoder version: %d\n", version); + + return 0; +} diff --git a/recipes/libwebp/all/test_v1_package/CMakeLists.txt b/recipes/libwebp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libwebp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libwebp/all/test_v1_package/conanfile.py b/recipes/libwebp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libwebp/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/libwebp/config.yml b/recipes/libwebp/config.yml new file mode 100644 index 0000000000000..df097a6cc668f --- /dev/null +++ b/recipes/libwebp/config.yml @@ -0,0 +1,17 @@ +versions: + "1.3.0": + folder: all + "1.2.4": + folder: all + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.2.1": + folder: all + "1.2.0": + folder: all + "1.1.0": + folder: all + "1.0.3": + folder: all diff --git a/recipes/libwebsockets/all/CMakeLists.txt b/recipes/libwebsockets/all/CMakeLists.txt new file mode 100644 index 0000000000000..f3c9da822bfbd --- /dev/null +++ b/recipes/libwebsockets/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory("source_subfolder") diff --git a/recipes/libwebsockets/all/conandata.yml b/recipes/libwebsockets/all/conandata.yml new file mode 100644 index 0000000000000..119725ef837be --- /dev/null +++ b/recipes/libwebsockets/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "4.3.2": + url: "https://github.com/warmcat/libwebsockets/archive/v4.3.2.tar.gz" + sha256: "6a85a1bccf25acc7e8e5383e4934c9b32a102880d1e4c37c70b27ae2a42406e1" + "4.3.0": + url: "https://github.com/warmcat/libwebsockets/archive/v4.3.0.tar.gz" + sha256: "ceef46e3bffb368efe4959202f128fd93d74e10cd2e6c3ac289a33b075645c3b" + "4.2.1": + url: "https://github.com/warmcat/libwebsockets/archive/v4.2.1.tar.gz" + sha256: "842da21f73ccba2be59e680de10a8cce7928313048750eb6ad73b6fa50763c51" + "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 new file mode 100644 index 0000000000000..c2dfe332c1332 --- /dev/null +++ b/recipes/libwebsockets/all/conanfile.py @@ -0,0 +1,544 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException, ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.43.0" + + +class LibwebsocketsConan(ConanFile): + name = "libwebsockets" + description = "Canonical libwebsockets.org websocket library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/warmcat/libwebsockets" + license = "MIT" + topics = ("libwebsockets", "websocket") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libuv": [True, False], + "with_libevent": [False, "libevent", "libev"], + "with_zlib": [False, "zlib", "miniz", "bundled"], + "with_ssl": [False, "openssl", "mbedtls", "wolfssl"], + "with_sqlite3": [True, False], + "with_libmount": [True, False], + "with_hubbub": [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 + + "enable_network": [True, False], # Compile with network-related code + "role_h1": [True, False], # Compile with support for http/1 (needed for ws) + "role_ws": [True, False], # Compile with support for websockets + "role_mqtt": [True, False], # Build with support for MQTT client + "role_dbus": [True, False], # Compile with support for DBUS + "role_raw_proxy": [True, False], # Raw packet proxy + "role_raw_file": [True, False], # Compile with support for raw files + "enable_http2": [True, False], # Compile with server support for HTTP/2 + "enable_lwsws": [True, False], # Libwebsockets Webserver + "enable_cgi": [True, False], # Include CGI (spawn process with network-connected stdin/out/err) APIs + "enable_ipv6": [True, False], # Compile with support for ipv6 + "enable_unix_sock": [True, False], # Compile with support for UNIX domain socket + "enable_plugins": [True, False], # Support plugins for protocols and extensions + "enable_http_proxy": [True, False], # Support for active HTTP proxying + "enable_zip_fops": [True, False], # Support serving pre-zipped files + "enable_socks5": [True, False], # Allow use of SOCKS5 proxy on client connections + "enable_generic_sessions": [True, False], # With the Generic Sessions plugin + "enable_peer_limits": [True, False], # Track peers and restrict resources a single peer can allocate + "enable_access_log": [True, False], # Support generating Apache-compatible access logs + "enable_ranges": [True, False], # Support http ranges (RFC7233) + "enable_server_status": [True, False], # Support json + jscript server monitoring + "enable_threadpool": [True, False], # Managed worker thread pool support (relies on pthreads) + "enable_http_stream_compression": [True, False], # Support HTTP stream compression + "enable_http_brotli": [True, False], # Also offer brotli http stream compression (requires LWS_WITH_HTTP_STREAM_COMPRESSION) + "enable_acme": [True, False], # Enable support for ACME automatic cert acquisition + maintenance (letsencrypt etc) + "enable_fts": [True, False], # Full Text Search support + "enable_sys_async_dns": [True, False], # Nonblocking internal IPv4 + IPv6 DNS resolver + "enable_sys_ntpclient": [True, False], # Build in tiny ntpclient good for tls date validation and run via lws_system + "enable_sys_dhcp_client": [True, False], # Build in tiny DHCP client + "enable_http_basic_auth": [True, False], # Support Basic Auth + "enable_http_uncommon_headers": [True, False], # Include less common http header support + "enable_secure_streams": [True, False], # Secure Streams protocol-agnostic API + "enable_secure_streams_proxy_api": [True, False], # Secure Streams support to work across processes + "enable_secure_streams_sys_auth_api_amazon_com": [True, False], # Auth support for api.amazon.com + "enable_secure_streams_static_policy_only": [True, False], + + "without_client": [True, False], # Don't build the client part of the library + "without_server": [True, False], # Don't build the server part of the library + + "enable_extensions": [True, False], # Compile with extensions + "enable_builtin_getifaddrs": [True, False], # Use the BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... The default is to assume that your libc provides it. On some systems such as uclibc it doesn't exist. + "enable_fallback_gethostbyname": [True, False], # Also try to do dns resolution using gethostbyname if getaddrinfo fails + "enable_builtin_sha1": [True, False], # Build the lws sha-1 (eg, because openssl will provide it + "enable_daemonize": [True, False], # Build the daemonization api + "enable_lejp": [True, False], # With the Lightweight JSON Parser + "enable_struct_json": [True, False], # Generic struct serialization to and from JSON + "enable_struct_sqlite3": [True, False], # Generic struct serialization to and from SQLITE3 + + "disable_logs": [True, False], # Disable all logging other than _err and _user from being compiled in + "logs_timestamp": [True, False], # Timestamp at start of logs + "avoid_sigpipe_ign": [True, False], # Android 7+ reportedly needs this + "enable_stats": [True, False], # Keep statistics of lws internal operations + "enable_jose": [True, False], # JSON Web Signature / Encryption / Keys (RFC7515/6/) API + "enable_gencrypto": [True, False], # Enable support for Generic Crypto apis independent of TLS backend + "enable_selftests": [True, False], # Selftests run at context creation + "enable_gcov": [True, False], # Build with gcc gcov coverage instrumentation + "enable_lwsac": [True, False], # lwsac Chunk Allocation api + "enable_custom_headers": [True, False], # Store and allow querying custom HTTP headers (H1 only) + "enable_diskcache": [True, False], # Hashed cache directory with lazy LRU deletion to size limit + "enable_dir": [True, False], # Directory scanning api support + "enable_lejp_conf": [True, False], # With LEJP configuration parser as used by lwsws + "enable_deprecated_lws_dll": [True, False], # Migrate to lws_dll2 instead ASAP + "enable_sequencer": [True, False], # lws_seq_t support + "enable_external_poll": [True, False], # Support external POLL integration using callback messages (not recommended) + "enable_lws_dsh": [True, False], # Support lws_dsh_t Disordered Shared Heap + "enable_external_http_proxying": [True, False], # Support external http proxies for client connections + "enable_file_ops": [True, False], # Support file operations vfs + "enable_detailed_latency": [True, False], # Record detailed latency stats for each read and write + "enable_udp": [True, False], # Platform supports UDP + "enable_spawn": [True, False], # Spawn subprocesses with piped stdin/out/stderr + } + default_options = { + "shared": False, + "fPIC": True, + "with_libuv": False, + "with_libevent": False, + "with_zlib": False, + "with_ssl": "openssl", + "with_sqlite3": False, + "with_libmount": False, + "with_hubbub": False, + + "ssl_client_use_os_ca_certs": True, + "ssl_server_with_ecdh_cert": False, + + "enable_network": True, + "role_h1": True, + "role_ws": True, + "role_mqtt": False, + "role_dbus": False, + "role_raw_proxy": False, + "role_raw_file": True, + "enable_http2": True, + "enable_lwsws": False, + "enable_cgi": False, + "enable_ipv6": False, + "enable_unix_sock": True, + "enable_plugins": False, + "enable_http_proxy": False, + "enable_zip_fops": False, + "enable_socks5": False, + "enable_generic_sessions": False, + "enable_peer_limits": False, + "enable_access_log": False, + "enable_ranges": False, + "enable_server_status": False, + "enable_threadpool": False, + "enable_http_stream_compression": False, + "enable_http_brotli": False, + "enable_acme": False, + "enable_fts": False, + "enable_sys_async_dns": False, + "enable_sys_ntpclient": False, + "enable_sys_dhcp_client": False, + "enable_http_basic_auth": True, + "enable_http_uncommon_headers": True, + "enable_secure_streams": False, + "enable_secure_streams_proxy_api": False, + "enable_secure_streams_sys_auth_api_amazon_com": False, + "enable_secure_streams_static_policy_only": False, + + "without_client": False, + "without_server": False, + + "enable_extensions": False, + "enable_builtin_getifaddrs": True, + "enable_fallback_gethostbyname": False, + "enable_builtin_sha1": True, + "enable_daemonize": False, + "enable_lejp": True, + "enable_struct_json": False, + "enable_struct_sqlite3": False, + + "disable_logs": False, + "logs_timestamp": True, + "avoid_sigpipe_ign": False, + "enable_stats": False, + "enable_jose": False, + "enable_gencrypto": False, + "enable_selftests": False, + "enable_gcov": False, + "enable_lwsac": True, + "enable_custom_headers": True, + "enable_diskcache": False, + "enable_dir": False, + "enable_lejp_conf": False, + "enable_deprecated_lws_dll": False, + "enable_sequencer": True, + "enable_external_poll": False, + "enable_lws_dsh": False, + "enable_external_http_proxying": True, + "enable_file_ops": True, + "enable_detailed_latency": False, + "enable_udp": True, + "enable_spawn": False + } + + exports_sources = "CMakeLists.txt" + generators = "cmake" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _is_msvc(self): + return str(self.settings.compiler) in ["Visual Studio", "msvc"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_libuv: + self.requires("libuv/1.44.1") + + if self.options.with_libevent == "libevent": + self.requires("libevent/2.1.12") + elif self.options.with_libevent == "libev": + self.requires("libev/4.33") + + if self.options.with_zlib == "zlib": + self.requires("zlib/1.2.12") + elif self.options.with_zlib == "miniz": + self.requires("miniz/2.2.0") + + if self.options.with_libmount: + self.requires("libmount/2.36.2") + + if self.options.with_sqlite3: + self.requires("sqlite3/3.37.2") + + if self.options.with_ssl == "openssl": + self.requires("openssl/1.1.1o") + elif self.options.with_ssl == "mbedtls": + self.requires("mbedtls/2.25.0") + elif self.options.with_ssl == "wolfssl": + self.requires("wolfssl/4.8.1") + + def validate(self): + if self.options.shared and self.settings.compiler == "gcc" and tools.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 tools.Version(self.version) <= "4.0.15" and self.settings.compiler == "apple-clang" and tools.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 self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < 16 and tools.Version(self.version) >= "4.3.2": + raise ConanInvalidConfiguration ("{}/{} requires at least Visual Studio 2019".format(self.name, self.version)) + + if self.options.with_hubbub: + raise ConanInvalidConfiguration("Library hubbub not implemented (yet) in CCI") + # TODO - Add hubbub package when available. + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _get_library_extension(self, dep): + if self.options[dep].shared: + if self.settings.os == "Windows" : + if self._is_msvc: + return ".lib" + else: + return ".dll.a" + elif self.settings.os == "Macos": + return ".dylib" + else: + return ".so" + else: + if self.settings.os == "Windows" and self._is_msvc: + return ".lib" + else: + return ".a" + + @property + def _get_library_prefix(self): + if self.settings.os == "Windows" : + return "" + return "lib" + + def _cmakify_path_list(self, paths): + return ";".join(paths).replace("\\", "/") + + def _find_library(self, libname, dep): + for path in self.deps_cpp_info[dep].lib_paths: + lib_fullpath = os.path.join(path, self._get_library_prefix + libname + self._get_library_extension(dep)) + + print("Test : " + str(lib_fullpath)) + if os.path.isfile(lib_fullpath): + return lib_fullpath + raise ConanException("Library {} not found".format(lib_fullpath)) + + def _find_libraries(self, dep): + return [self._find_library(lib, dep) for lib in self.deps_cpp_info[dep].libs] + + def _configure_cmake(self): + if self._cmake is not None: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["LWS_WITHOUT_TESTAPPS"] = True + self._cmake.definitions["LWS_WITHOUT_TEST_SERVER"] = True + self._cmake.definitions["LWS_WITHOUT_TEST_SERVER_EXTPOLL"] = True + self._cmake.definitions["LWS_WITHOUT_TEST_PING"] = True + self._cmake.definitions["LWS_WITHOUT_TEST_CLIENT"] = True + + self._cmake.definitions["LWS_LINK_TESTAPPS_DYNAMIC"] = True + self._cmake.definitions["LWS_WITH_SHARED"] = self.options.shared + self._cmake.definitions["LWS_WITH_STATIC"] = not self.options.shared + self._cmake.definitions["LWS_WITH_SSL"] = bool(self.options.with_ssl) + + if self.options.with_ssl == "openssl": + self._cmake.definitions["LWS_OPENSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("openssl")) + self._cmake.definitions["LWS_OPENSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["openssl"].include_paths) + elif self.options.with_ssl == "mbedtls": + self._cmake.definitions["LWS_WITH_MBEDTLS"] = True + self._cmake.definitions["LWS_MBEDTLS_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("mbedtls")) + self._cmake.definitions["LWS_MBEDTLS_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["mbedtls"].include_paths) + elif self.options.with_ssl == "wolfssl": + self._cmake.definitions["LWS_WITH_WOLFSSL"] = True + self._cmake.definitions["LWS_WOLFSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("wolfssl")) + self._cmake.definitions["LWS_WOLFSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["wolfssl"].include_paths) + else: + self._cmake.definitions["LWS_WITH_WOLFSSL"] = False + + self._cmake.definitions["LWS_WITH_LIBEV"] = self.options.with_libevent == "libev" + if self.options.with_libevent == "libev": + self._cmake.definitions["LWS_LIBEV_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libev")) + self._cmake.definitions["LWS_LIBEV_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libev"].include_paths).replace("\\", "/") + + self._cmake.definitions["LWS_WITH_LIBUV"] = self.options.with_libuv + if self.options.with_libuv: + self._cmake.definitions["LWS_LIBUV_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libuv")) + self._cmake.definitions["LWS_LIBUV_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libuv"].include_paths) + + self._cmake.definitions["LWS_WITH_LIBEVENT"] = self.options.with_libevent == "libevent" + if self.options.with_libevent == "libevent": + self._cmake.definitions["LWS_LIBEVENT_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libevent")) + self._cmake.definitions["LWS_LIBEVENT_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libevent"].include_paths) + + self._cmake.definitions["LWS_WITH_ZLIB"] = self.options.with_zlib != False + self._cmake.definitions["LWS_WITH_MINIZ"] = self.options.with_zlib == "miniz" + self._cmake.definitions["LWS_WITH_BUNDLED_ZLIB"] = self.options.with_zlib == "bundled" + if self.options.with_zlib == "zlib": + self._cmake.definitions["LWS_ZLIB_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("zlib")) + self._cmake.definitions["LWS_ZLIB_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["zlib"].include_paths) + elif self.options.with_zlib == "miniz": + self._cmake.definitions["MINIZ_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("miniz")) + self._cmake.definitions["MINIZ_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["miniz"].include_paths) + + self._cmake.definitions["LWS_WITH_SQLITE3"] = self.options.with_sqlite3 + if self.options.with_sqlite3: + self._cmake.definitions["LWS_SQLITE3_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("sqlite3")) + self._cmake.definitions["LWS_SQLITE3_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["sqlite3"].include_paths) + + self._cmake.definitions["LWS_WITH_FSMOUNT"] = self.options.with_libmount + if self.options.with_libmount: + self._cmake.definitions["LWS_LIBMOUNT_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libmount")) + self._cmake.definitions["LWS_LIBMOUNT_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libmount"].include_paths) + + self._cmake.definitions["LWS_WITH_HUBBUB"] = self.options.with_hubbub + + self._cmake.definitions["LWS_SSL_CLIENT_USE_OS_CA_CERTS"] = self.options.ssl_client_use_os_ca_certs + self._cmake.definitions["LWS_SSL_SERVER_WITH_ECDH_CERT"] = self.options.ssl_server_with_ecdh_cert + + self._cmake.definitions["LWS_WITH_NETWORK"] = self.options.enable_network + self._cmake.definitions["LWS_ROLE_H1"] = self.options.role_h1 + self._cmake.definitions["LWS_ROLE_WS"] = self.options.role_ws + self._cmake.definitions["LWS_ROLE_MQTT"] = self.options.role_mqtt + self._cmake.definitions["LWS_ROLE_DBUS"] = self.options.role_dbus + self._cmake.definitions["LWS_ROLE_RAW_PROXY"] = self.options.role_raw_proxy + self._cmake.definitions["LWS_ROLE_RAW_FILE"] = self.options.role_raw_file + self._cmake.definitions["LWS_WITH_HTTP2"] = self.options.enable_http2 + self._cmake.definitions["LWS_WITH_LWSWS"] = self.options.enable_lwsws + self._cmake.definitions["LWS_WITH_CGI"] = self.options.enable_cgi + self._cmake.definitions["LWS_IPV6"] = self.options.enable_ipv6 + self._cmake.definitions["LWS_UNIX_SOCK"] = self.options.enable_unix_sock + self._cmake.definitions["LWS_WITH_PLUGINS"] = self.options.enable_plugins + self._cmake.definitions["LWS_WITH_HTTP_PROXY"] = self.options.enable_http_proxy + self._cmake.definitions["LWS_WITH_ZIP_FOPS"] = self.options.enable_zip_fops + self._cmake.definitions["LWS_WITH_SOCKS5"] = self.options.enable_socks5 + self._cmake.definitions["LWS_WITH_GENERIC_SESSIONS"] = self.options.enable_generic_sessions + self._cmake.definitions["LWS_WITH_PEER_LIMITS"] = self.options.enable_peer_limits + self._cmake.definitions["LWS_WITH_ACCESS_LOG"] = self.options.enable_access_log + self._cmake.definitions["LWS_WITH_RANGES"] = self.options.enable_ranges + self._cmake.definitions["LWS_WITH_SERVER_STATUS"] = self.options.enable_server_status + self._cmake.definitions["LWS_WITH_THREADPOOL"] = self.options.enable_threadpool + self._cmake.definitions["LWS_WITH_HTTP_STREAM_COMPRESSION"] = self.options.enable_http_stream_compression + self._cmake.definitions["LWS_WITH_HTTP_BROTLI"] = self.options.enable_http_brotli + self._cmake.definitions["LWS_WITH_ACME"] = self.options.enable_acme + self._cmake.definitions["LWS_WITH_FTS"] = self.options.enable_fts + self._cmake.definitions["LWS_WITH_SYS_ASYNC_DNS"] = self.options.enable_sys_async_dns + self._cmake.definitions["LWS_WITH_SYS_NTPCLIENT"] = self.options.enable_sys_ntpclient + self._cmake.definitions["LWS_WITH_SYS_DHCP_CLIENT"] = self.options.enable_sys_dhcp_client + self._cmake.definitions["LWS_WITH_HTTP_BASIC_AUTH"] = self.options.enable_http_basic_auth + self._cmake.definitions["LWS_WITH_HTTP_UNCOMMON_HEADERS"] = self.options.enable_http_uncommon_headers + + self._cmake.definitions["LWS_WITHOUT_EXTENSIONS"] = not self.options.enable_extensions + self._cmake.definitions["LWS_WITHOUT_BUILTIN_GETIFADDRS"] = not self.options.enable_builtin_getifaddrs + self._cmake.definitions["LWS_FALLBACK_GETHOSTBYNAME"] = self.options.enable_fallback_gethostbyname + self._cmake.definitions["LWS_WITHOUT_BUILTIN_SHA1"] = not self.options.enable_builtin_sha1 + self._cmake.definitions["LWS_WITHOUT_DAEMONIZE"] = not self.options.enable_daemonize + self._cmake.definitions["LWS_WITH_LEJP"] = self.options.enable_lejp + self._cmake.definitions["LWS_WITH_STRUCT_JSON"] = self.options.enable_struct_json + self._cmake.definitions["LWS_WITH_STRUCT_SQLITE3"] = self.options.enable_struct_sqlite3 + + self._cmake.definitions["LWS_WITH_NO_LOGS"] = self.options.disable_logs + self._cmake.definitions["LWS_LOGS_TIMESTAMP"] = self.options.logs_timestamp + self._cmake.definitions["LWS_AVOID_SIGPIPE_IGN"] = self.options.avoid_sigpipe_ign + self._cmake.definitions["LWS_WITH_STATS"] = self.options.enable_stats + self._cmake.definitions["LWS_WITH_JOSE"] = self.options.enable_jose + self._cmake.definitions["LWS_WITH_GENCRYPTO"] = self.options.enable_gencrypto + self._cmake.definitions["LWS_WITH_SELFTESTS"] = self.options.enable_selftests + self._cmake.definitions["LWS_WITH_GCOV"] = self.options.enable_gcov + self._cmake.definitions["LWS_WITH_LWSAC"] = self.options.enable_lwsac + self._cmake.definitions["LWS_WITH_CUSTOM_HEADERS"] = self.options.enable_custom_headers + self._cmake.definitions["LWS_WITH_DISKCACHE"] = self.options.enable_diskcache + self._cmake.definitions["LWS_WITH_DIR"] = self.options.enable_dir + self._cmake.definitions["LWS_WITH_LEJP_CONF"] = self.options.enable_lejp_conf + self._cmake.definitions["LWS_WITH_DEPRECATED_LWS_DLL"] = self.options.enable_deprecated_lws_dll + self._cmake.definitions["LWS_WITH_SEQUENCER"] = self.options.enable_sequencer + self._cmake.definitions["LWS_WITH_EXTERNAL_POLL"] = self.options.enable_external_poll + self._cmake.definitions["LWS_WITH_LWS_DSH"] = self.options.enable_lws_dsh + self._cmake.definitions["LWS_CLIENT_HTTP_PROXYING"] = self.options.enable_external_http_proxying + self._cmake.definitions["LWS_WITH_FILE_OPS"] = self.options.enable_file_ops + self._cmake.definitions["LWS_WITH_DETAILED_LATENCY"] = self.options.enable_detailed_latency + self._cmake.definitions["LWS_WITH_UDP"] = self.options.enable_udp + self._cmake.definitions["LWS_WITH_SPAWN"] = self.options.enable_spawn + + self._cmake.definitions["LWS_WITH_ALSA"] = False + self._cmake.definitions["LWS_WITH_GTK"] = False + + if tools.Version(self.version) >= "4.1.0": + self._cmake.definitions["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows" + self._cmake.definitions["DISABLE_WERROR"] = True + + # Temporary override Windows 10 SDK for Visual Studio 2019, see issue #4450 + # CCI worker has 10.0.17763.0 SDK installed alongside with 10.0.20348 but only 20348 can be used with Visual Studio 2019 + if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) == 16: + self._cmake.definitions["CMAKE_SYSTEM_VERSION"] = "10.0.20348" + + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") + tools.replace_in_file( + cmakelists, + "SET(CMAKE_INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\")", + "", + ) + if tools.Version(self.version) == "4.0.15" and self.options.with_ssl: + tools.replace_in_file( + 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 tools.Version(self.version) < "4.1.0": + tools.replace_in_file(cmakelists, "-Werror", "") + if tools.Version(self.version) >= "4.1.4": + tools.replace_in_file(cmakelists, "add_compile_options(/W3 /WX)", "add_compile_options(/W3)") + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._cmake_target: "Libwebsockets::{}".format(self._cmake_target)} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + + @property + def _cmake_target(self): + return "websockets_shared" if self.options.shared else "websockets" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Libwebsockets") + self.cpp_info.set_property("cmake_target_name", self._cmake_target) + pkgconfig_name = "libwebsockets" if self.options.shared else "libwebsockets_static" + self.cpp_info.set_property("pkg_config_name", pkgconfig_name) + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["_libwebsockets"].libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.components["_libwebsockets"].system_libs.extend(["ws2_32", "crypt32"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_libwebsockets"].system_libs.extend(["dl", "m"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Libwebsockets" + self.cpp_info.names["cmake_find_package_multi"] = "Libwebsockets" + self.cpp_info.names["pkg_config"] = pkgconfig_name + self.cpp_info.components["_libwebsockets"].names["cmake_find_package"] = self._cmake_target + self.cpp_info.components["_libwebsockets"].names["cmake_find_package_multi"] = self._cmake_target + self.cpp_info.components["_libwebsockets"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["_libwebsockets"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["_libwebsockets"].builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.components["_libwebsockets"].set_property("cmake_target_name", self._cmake_target) + self.cpp_info.components["_libwebsockets"].set_property("pkg_config_name", pkgconfig_name) + if self.options.with_libuv: + self.cpp_info.components["_libwebsockets"].requires.append("libuv::libuv") + if self.options.with_libevent == "libevent": + self.cpp_info.components["_libwebsockets"].requires.append("libevent::libevent") + elif self.options.with_libevent == "libev": + self.cpp_info.components["_libwebsockets"].requires.append("libev::libev") + if self.options.with_zlib == "zlib": + self.cpp_info.components["_libwebsockets"].requires.append("zlib::zlib") + elif self.options.with_zlib == "miniz": + self.cpp_info.components["_libwebsockets"].requires.append("miniz::miniz") + if self.options.with_libmount: + self.cpp_info.components["_libwebsockets"].requires.append("libmount::libmount") + if self.options.with_sqlite3: + self.cpp_info.components["_libwebsockets"].requires.append("sqlite3::sqlite3") + if self.options.with_ssl == "openssl": + self.cpp_info.components["_libwebsockets"].requires.append("openssl::openssl") + elif self.options.with_ssl == "mbedtls": + self.cpp_info.components["_libwebsockets"].requires.append("mbedtls::mbedtls") + elif self.options.with_ssl == "wolfssl": + self.cpp_info.components["_libwebsockets"].requires.append("wolfssl::wolfssl") + if self.options.with_hubbub: + # TODO - Add hubbub package when available. + pass diff --git a/recipes/libwebsockets/all/test_package/CMakeLists.txt b/recipes/libwebsockets/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ca319a6f6da7 --- /dev/null +++ b/recipes/libwebsockets/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Libwebsockets REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET websockets_shared) + target_link_libraries(${PROJECT_NAME} websockets_shared) +else() + target_link_libraries(${PROJECT_NAME} websockets) +endif() +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/libwebsockets/all/test_package/conanfile.py b/recipes/libwebsockets/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9b63bd176646b --- /dev/null +++ b/recipes/libwebsockets/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/libwebsockets/all/test_package/test_package.c b/recipes/libwebsockets/all/test_package/test_package.c new file mode 100644 index 0000000000000..e09bc89a8abe9 --- /dev/null +++ b/recipes/libwebsockets/all/test_package/test_package.c @@ -0,0 +1,92 @@ +#include +#include +#include + +#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 ); + + return 0; +} diff --git a/recipes/libwebsockets/config.yml b/recipes/libwebsockets/config.yml new file mode 100644 index 0000000000000..76fbd6a7ba025 --- /dev/null +++ b/recipes/libwebsockets/config.yml @@ -0,0 +1,15 @@ +versions: + "4.3.2": + folder: all + "4.3.0": + folder: all + "4.2.1": + 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/libx264/all/conandata.yml b/recipes/libx264/all/conandata.yml new file mode 100644 index 0000000000000..394a54354a73d --- /dev/null +++ b/recipes/libx264/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20220602": + url: "https://code.videolan.org/videolan/x264/-/archive/baee400fa9ced6f5481a728138fed6e867b0ff7f/x264-baee400fa9ced6f5481a728138fed6e867b0ff7f.tar.bz2" + sha256: "ce6623b8b289765daee04a297c2fd1a293cb2565a1749c76d66c8d72c7ddc1ab" + "20191217": + url: "https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20191217-2245.tar.bz2" + sha256: "0bb67d095513391e637b3b47e8efc3ba4603c3844f1b4c2690f4d36da7763055" + "20190605": + url: "http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20190605-2245.tar.bz2" + sha256: "c75203ef4759e4d7bc38e686b156c54c43b78edc73123c0b25db5224758bd1fc" diff --git a/recipes/libx264/all/conanfile.py b/recipes/libx264/all/conanfile.py new file mode 100644 index 0000000000000..d1bf4936ed733 --- /dev/null +++ b/recipes/libx264/all/conanfile.py @@ -0,0 +1,177 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os, XCRun, fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy, rename, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class LibX264Conan(ConanFile): + name = "libx264" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.videolan.org/developers/x264.html" + description = "x264 is a free software library and application for encoding video streams into the " \ + "H.264/MPEG-4 AVC compression format" + topics = ("video", "encoding") + license = "GPL-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "bit_depth": [8, 10, "all"], + } + default_options = { + "shared": False, + "fPIC": True, + "bit_depth": "all", + } + + # otherwise build fails with: ln: failed to create symbolic link './Makefile' -> '../../../../../../../../../../../../../j/w/prod/buildsinglereference@2/.conan/data/libx264/cci.20220602/_/_/build/622692a7dbc145becf87f01b017e2a0d93cc644e/src/Makefile': File name too long + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + @property + def _with_nasm(self): + return self.settings.arch in ("x86", "x86_64") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._with_nasm: + self.tool_requires("nasm/2.15.05") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + + extra_asflags = [] + extra_cflags = [] + extra_ldflags = [] + args = { + "--bit-depth": self.options.bit_depth, + "--disable-cli": "", + "--sbindir": None, # Not understood by configure + "--oldincludedir": None # Not understood by configure + } + args["--disable-shared"] = None # --disable-shared is not understood + if self.options.shared: + args["--enable-shared"] = "" + else: + args["--enable-static"] = "" + if self.options.get_safe("fPIC", self.settings.os != "Windows"): + args["--enable-pic"] = "" + if self.settings.build_type == "Debug": + args["--enable-debug"] = "" + if is_apple_os(self) and self.settings.arch == "armv8": + # bitstream-a.S:29:18: error: unknown token in expression + extra_asflags.append("-arch arm64") + extra_ldflags.append("-arch arm64") + args["--host"] = "aarch64-apple-darwin" + if self.settings.os != "Macos": # TODO not sure why this is != "Macos" ... shouldn't it be == ?? + xcrun = XCRun(self) + platform_flags = ["-isysroot", xcrun.sdk_path] + apple_min_version_flag = AutotoolsToolchain(self).apple_min_version_flag + if apple_min_version_flag: + platform_flags.append(apple_min_version_flag) + extra_asflags.extend(platform_flags) + extra_cflags.extend(platform_flags) + extra_ldflags.extend(platform_flags) + + if self._with_nasm: + env = Environment() + # FIXME: get using user_build_info + env.define("AS", unix_path(self, os.path.join(self.dependencies.build["nasm"].package_folder, "bin", "nasm{}".format(".exe" if self.settings.os == "Windows" else "")))) + env.vars(self).save_script("conanbuild_nasm") + if cross_building(self): + if self.settings.os == "Android": + # the as of ndk does not work well for building libx264 + env = Environment() + + compilers_from_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + buildenv_vars = VirtualBuildEnv(self).vars() + cc = compilers_from_conf.get("c", buildenv_vars.get("CC", "clang-cl")) + env.define("AS", cc) + + ndk_root = self.conf.get("tools.android:ndk_path") + + arch = { + "armv7": "arm", + "armv8": "aarch64", + "x86": "i686", + "x86_64": "x86_64", + }.get(str(self.settings.arch)) + abi = "androideabi" if self.settings.arch == "armv7" else "android" + args["--cross-prefix"] = f"{ndk_root}/bin/{arch}-linux-{abi}-" + env.vars(self).save_script("conanbuild_android") + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + if check_min_vs(self, 180, False): + extra_cflags.append("-FS") + env.vars(self).save_script("conanbuild_msvc") + if extra_asflags: + args["--extra-asflags"] = " ".join(extra_asflags) + if extra_cflags: + args["--extra-cflags"] = " ".join(extra_cflags) + if extra_ldflags: + args["--extra-ldflags"] = " ".join(extra_ldflags) + tc.update_configure_args(args) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if is_msvc(self): + ext = ".dll.lib" if self.options.shared else ".lib" + rename(self, os.path.join(self.package_folder, "lib", f"libx264{ext}"), + os.path.join(self.package_folder, "lib", "x264.lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "x264") + self.cpp_info.libs = ["x264"] + if is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("X264_API_IMPORTS") + if self.settings.os in ["FreeBSD", "Linux"]: + self.cpp_info.system_libs.extend(["dl", "pthread", "m"]) + elif self.settings.os == "Android": + self.cpp_info.system_libs.extend(["dl", "m"]) + + # TODO: to remove in conan v2 once pkg_config generator removed + self.cpp_info.names["pkg_config"] = "x264" diff --git a/recipes/libx264/all/test_package/CMakeLists.txt b/recipes/libx264/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9ef0da2dea968 --- /dev/null +++ b/recipes/libx264/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libx264 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libx264::libx264) diff --git a/recipes/libx264/all/test_package/conanfile.py b/recipes/libx264/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libx264/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libx264/all/test_package/test_package.c b/recipes/libx264/all/test_package/test_package.c new file mode 100644 index 0000000000000..c4d50fb7babad --- /dev/null +++ b/recipes/libx264/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include "x264.h" + +#include + +int main() +{ + x264_param_t preset; + x264_t *encoder; + x264_param_default_preset(&preset, "ultrafast", "zerolatency"); + preset.i_width = 640; + preset.i_height = 480; + encoder = x264_encoder_open(&preset); + x264_encoder_close(encoder); + return EXIT_SUCCESS; +} diff --git a/recipes/libx264/all/test_v1_package/CMakeLists.txt b/recipes/libx264/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..dbc8e1774b07c --- /dev/null +++ b/recipes/libx264/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libx264 REQUIRED CONFIG) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libx264/all/test_v1_package/conanfile.py b/recipes/libx264/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libx264/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libx264/config.yml b/recipes/libx264/config.yml new file mode 100644 index 0000000000000..be7607c4d1266 --- /dev/null +++ b/recipes/libx264/config.yml @@ -0,0 +1,7 @@ +versions: + "cci.20220602": + folder: all + "20191217": + folder: all + "20190605": + folder: all diff --git a/recipes/libx265/all/conandata.yml b/recipes/libx265/all/conandata.yml new file mode 100644 index 0000000000000..c3b14b8a74194 --- /dev/null +++ b/recipes/libx265/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "3.4": + url: "https://github.com/videolan/x265/archive/refs/tags/3.4.tar.gz" + sha256: "544d147bf146f8994a7bf8521ed878c93067ea1c7c6e93ab602389be3117eaaf" + "3.2.1": + url: "https://bitbucket.org/multicoreware/x265_git/downloads/x265_3.2.1.tar.gz" + sha256: "b68939625356459e7055b9589451689924f236bac8deba3db21e3c2fb062d328" +patches: + "3.4": + - patch_file: "patches/3.2.1-0001-remove_register_classifier.patch" + - patch_file: "patches/3.2.1-0002-cmake-min-required.patch" + - patch_file: "patches/3.4-0001-numa.patch" + "3.2.1": + - patch_file: "patches/3.2.1-0001-remove_register_classifier.patch" + - patch_file: "patches/3.2.1-0002-cmake-min-required.patch" diff --git a/recipes/libx265/all/conanfile.py b/recipes/libx265/all/conanfile.py new file mode 100644 index 0000000000000..4938bb3011950 --- /dev/null +++ b/recipes/libx265/all/conanfile.py @@ -0,0 +1,155 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.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.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class Libx265Conan(ConanFile): + name = "libx265" + description = "x265 is the leading H.265 / HEVC encoder software library" + topics = ("x265", "codec", "video", "H.265") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.videolan.org/developers/x265.html" + license = ("GPL-2.0-only", "commercial") # https://bitbucket.org/multicoreware/x265/src/default/COPYING + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "assembly": [True, False], + "bit_depth": [8, 10, 12], + "HDR10": [True, False], + "SVG_HEVC_encoder": [True, False], + "with_numa": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "assembly": True, + "bit_depth": 8, + "HDR10": False, + "SVG_HEVC_encoder": False, + "with_numa": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.with_numa + # FIXME: Disable assembly by default if host is arm and compiler apple-clang for the moment. + # Indeed, apple-clang is not able to understand some asm instructions of libx265 + if self.settings.compiler == "apple-clang" and "arm" in self.settings.arch: + self.options.assembly = 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): + if self.options.get_safe("with_numa", False): + self.requires("libnuma/2.0.14") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("shared not supported with static runtime") + + def build_requirements(self): + if self.options.assembly: + if self.settings.arch in ["x86", "x86_64"]: + self.tool_requires("nasm/2.15.05") + + 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["ENABLE_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.variables["ENABLE_ASSEMBLY"] = self.options.assembly + tc.variables["ENABLE_LIBNUMA"] = self.options.get_safe("with_numa", False) + if self.settings.os == "Macos": + tc.variables["CMAKE_SHARED_LINKER_FLAGS"] = "-Wl,-read_only_relocs,suppress" + tc.variables["HIGH_BIT_DEPTH"] = self.options.bit_depth != 8 + tc.variables["MAIN12"] = self.options.bit_depth == 12 + tc.variables["ENABLE_HDR10_PLUS"] = self.options.HDR10 + tc.variables["ENABLE_SVT_HEVC"] = self.options.SVG_HEVC_encoder + if is_msvc(self): + tc.variables["STATIC_LINK_CRT"] = is_msvc_static_runtime(self) + if self.settings.os == "Linux": + tc.variables["PLATFORM_LIBS"] = "dl" + if "arm" in self.settings.arch: + tc.variables["CROSS_COMPILE_ARM"] = cross_building(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "source", "CMakeLists.txt") + replace_in_file(self, cmakelists, + "if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED))", + "if(FALSE)") + if self.settings.os == "Android": + replace_in_file(self, cmakelists, "list(APPEND PLATFORM_LIBS pthread)", "") + replace_in_file(self, cmakelists, "list(APPEND PLATFORM_LIBS rt)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "source")) + 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() + + if self.options.shared: + if is_msvc(self): + static_lib = "x265-static.lib" + else: + static_lib = "libx265.a" + os.unlink(os.path.join(self.package_folder, "lib", static_lib)) + + if is_msvc(self): + name = "libx265.lib" if self.options.shared else "x265-static.lib" + rename(self, os.path.join(self.package_folder, "lib", name), + os.path.join(self.package_folder, "lib", "x265.lib")) + + if self.settings.os == "Windows" and self.options.shared: + rm(self, "*[!.dll]", os.path.join(self.package_folder, "bin")) + else: + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "x265") + self.cpp_info.libs = ["x265"] + if self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.defines.append("X265_API_IMPORTS") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "pthread", "m"]) + if not self.options.shared: + self.cpp_info.sharedlinkflags = ["-Wl,-Bsymbolic,-znoexecstack"] + elif self.settings.os == "Android": + self.cpp_info.libs.extend(["dl", "m"]) + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/libx265/all/patches/3.2.1-0001-remove_register_classifier.patch b/recipes/libx265/all/patches/3.2.1-0001-remove_register_classifier.patch new file mode 100644 index 0000000000000..6ad2d2edd1117 --- /dev/null +++ b/recipes/libx265/all/patches/3.2.1-0001-remove_register_classifier.patch @@ -0,0 +1,13 @@ +diff --git a/source/common/md5.cpp b/source/common/md5.cpp +index 285b44a..c4964e7 100644 +--- a/source/common/md5.cpp ++++ b/source/common/md5.cpp +@@ -185,7 +185,7 @@ void MD5Final(MD5Context *ctx, uint8_t *digest) + */ + void MD5Transform(uint32_t *buf, uint32_t *in) + { +- register uint32_t a, b, c, d; ++ uint32_t a, b, c, d; + + a = buf[0]; + b = buf[1]; diff --git a/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch b/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch new file mode 100644 index 0000000000000..93f9560bd7156 --- /dev/null +++ b/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch @@ -0,0 +1,22 @@ +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -1,10 +1,4 @@ +-# vim: syntax=cmake +-if(NOT CMAKE_BUILD_TYPE) +- # default to Release build for GCC builds +- set(CMAKE_BUILD_TYPE Release CACHE STRING +- "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." +- FORCE) +-endif() ++cmake_minimum_required(VERSION 3.1) + message(STATUS "cmake version ${CMAKE_VERSION}") + if(POLICY CMP0025) + cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang +@@ -17,7 +11,6 @@ if(POLICY CMP0054) + endif() + + project (x265) +-cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8 + include(CheckIncludeFiles) + include(CheckFunctionExists) + include(CheckSymbolExists) diff --git a/recipes/libx265/all/patches/3.4-0001-numa.patch b/recipes/libx265/all/patches/3.4-0001-numa.patch new file mode 100644 index 0000000000000..789c574f674fc --- /dev/null +++ b/recipes/libx265/all/patches/3.4-0001-numa.patch @@ -0,0 +1,27 @@ +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -90,20 +90,10 @@ if(UNIX) + endif() + option(ENABLE_LIBNUMA "Enable libnuma usage (Linux only)" ON) + if(ENABLE_LIBNUMA) +- find_package(Numa) +- if(NUMA_FOUND) +- link_directories(${NUMA_LIBRARY_DIR}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES numa) +- list(APPEND CMAKE_REQUIRED_INCLUDES ${NUMA_INCLUDE_DIR}) +- list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-L${NUMA_LIBRARY_DIR}") +- check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2) +- if(NUMA_V2) +- add_definitions(-DHAVE_LIBNUMA) +- message(STATUS "libnuma found, building with support for NUMA nodes") +- list(APPEND PLATFORM_LIBS numa) +- include_directories(${NUMA_INCLUDE_DIR}) +- endif() +- endif() ++ find_package(libnuma REQUIRED) ++ list(APPEND PLATFORM_LIBS ${libnuma_LIBRARIES}) ++ include_directories(${libnuma_INCLUDE_DIR}) ++ add_definitions(-DHAVE_LIBNUMA) + mark_as_advanced(NUMA_FOUND) + endif(ENABLE_LIBNUMA) + option(NO_ATOMICS "Use a slow mutex to replace atomics" OFF) diff --git a/recipes/libx265/all/test_package/CMakeLists.txt b/recipes/libx265/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b8fa451c9e6c3 --- /dev/null +++ b/recipes/libx265/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libx265 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libx265::libx265) diff --git a/recipes/libx265/all/test_package/conanfile.py b/recipes/libx265/all/test_package/conanfile.py new file mode 100644 index 0000000000000..539e617675db7 --- /dev/null +++ b/recipes/libx265/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, run=True) + + 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/libx265/all/test_package/test_package.c b/recipes/libx265/all/test_package/test_package.c new file mode 100644 index 0000000000000..8b1893cf74346 --- /dev/null +++ b/recipes/libx265/all/test_package/test_package.c @@ -0,0 +1,32 @@ +#include "x265.h" + +#include + +#ifdef WITH_LIB +# ifdef _WIN32 +# define TEST_IMPORT __declspec(dllimport) +# else +# define TEST_IMPORT +# endif + +TEST_IMPORT const char *test_library_version(void); +TEST_IMPORT void test_library_something(void); +#endif + +int main() +{ + x265_param * param = x265_param_alloc(); + x265_param_default(param); + param->sourceWidth = 640; + param->sourceHeight = 480; + param->fpsNum = 25; + param->fpsDenom = 1; + x265_encoder * encoder = x265_encoder_open(param); + x265_encoder_close(encoder); + x265_param_free(param); +#ifdef WITH_LIB + test_library_version(); + test_library_something(); +#endif + return EXIT_SUCCESS; +} diff --git a/recipes/libx265/all/test_v1_package/CMakeLists.txt b/recipes/libx265/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libx265/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libx265/all/test_v1_package/conanfile.py b/recipes/libx265/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libx265/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/libx265/config.yml b/recipes/libx265/config.yml new file mode 100644 index 0000000000000..76ea1c6fa9b73 --- /dev/null +++ b/recipes/libx265/config.yml @@ -0,0 +1,5 @@ +versions: + "3.4": + folder: "all" + "3.2.1": + folder: "all" diff --git a/recipes/libxcrypt/all/conandata.yml b/recipes/libxcrypt/all/conandata.yml new file mode 100644 index 0000000000000..df7c72ca12c22 --- /dev/null +++ b/recipes/libxcrypt/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "4.4.28": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.28.tar.gz" + sha256: "db7e37901969cb1d1e8020cb73a991ef81e48e31ea5b76a101862c806426b457" + "4.4.27": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.27.tar.gz" + sha256: "e4ff47b7fa5370fa08e27258f8a0de5cb7e9b09c297ec7ab56a8a82e229a1c84" + "4.4.26": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.26.tar.gz" + sha256: "e8a544dd19171c1e6191a6044c96cc31496d781ba08b5a00f53310d001d58114" + "4.4.25": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.25.tar.gz" + sha256: "caea3d032a46c4855ff818637884c7f5719ad228b79387b62ee023c8fbef17b4" + "4.4.23": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.23.tar.gz" + sha256: "9cbbcb795ed5d121a1613eb0e40c77173b53e15a746796fc7cd7bd71cfd64533" + "4.4.22": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.22.tar.gz" + sha256: "8d67c33837b8e5e930ca878c88f1856913b749cc95844fb11e7f1b4c8aab4f8e" + "4.4.18": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.18.tar.gz" + sha256: "3801f0263a8596b15ec466343fc1fdc4ad4ec7416c51e038a3528fd47f3be01a" + "4.4.17": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.17.tar.gz" + sha256: "7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07" + "4.4.16": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.16.tar.gz" + sha256: "a98f65b8baffa2b5ba68ee53c10c0a328166ef4116bce3baece190c8ce01f375" diff --git a/recipes/libxcrypt/all/conanfile.py b/recipes/libxcrypt/all/conanfile.py new file mode 100644 index 0000000000000..7f1e95bcfd907 --- /dev/null +++ b/recipes/libxcrypt/all/conanfile.py @@ -0,0 +1,95 @@ +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 copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.53.0" + + +class LibxcryptConan(ConanFile): + name = "libxcrypt" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/besser82/libxcrypt" + description = "Extended crypt library for descrypt, md5crypt, bcrypt, and others" + topics = ("hash", "password", "one-way", "bcrypt", "md5", "sha256", "sha512") + license = ("LGPL-2.1-or-later", ) + 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.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} does not support Visual Studio") + + 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") + + 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() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-werror") + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "Makefile.am"), + "\nlibcrypt_la_LDFLAGS = ", "\nlibcrypt_la_LDFLAGS = -no-undefined ") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + if self.settings.os == "Windows": + replace_in_file(self, os.path.join(self.build_folder, "libtool"), "-DPIC", "") + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + 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", "libxcrypt") + self.cpp_info.libs = ["crypt"] diff --git a/recipes/libxcrypt/all/test_package/CMakeLists.txt b/recipes/libxcrypt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..af52be8acede9 --- /dev/null +++ b/recipes/libxcrypt/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libxcrypt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libxcrypt::libxcrypt) diff --git a/recipes/libxcrypt/all/test_package/conanfile.py b/recipes/libxcrypt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libxcrypt/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/libxcrypt/all/test_package/test_package.c b/recipes/libxcrypt/all/test_package/test_package.c new file mode 100644 index 0000000000000..d1548cbb9050b --- /dev/null +++ b/recipes/libxcrypt/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "crypt.h" + +#include +int main() +{ + printf("preferred method: %s\n", crypt_preferred_method()); + return 0; +} diff --git a/recipes/libxcrypt/all/test_v1_package/CMakeLists.txt b/recipes/libxcrypt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libxcrypt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libxcrypt/all/test_v1_package/conanfile.py b/recipes/libxcrypt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libxcrypt/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/libxcrypt/config.yml b/recipes/libxcrypt/config.yml new file mode 100644 index 0000000000000..5f226d94e67a1 --- /dev/null +++ b/recipes/libxcrypt/config.yml @@ -0,0 +1,19 @@ +versions: + "4.4.28": + folder: all + "4.4.27": + folder: all + "4.4.26": + folder: all + "4.4.25": + folder: all + "4.4.23": + folder: all + "4.4.22": + folder: all + "4.4.18": + folder: all + "4.4.17": + folder: all + "4.4.16": + folder: all diff --git a/recipes/libxft/all/conandata.yml b/recipes/libxft/all/conandata.yml new file mode 100644 index 0000000000000..e56e888b5fdb6 --- /dev/null +++ b/recipes/libxft/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "2.3.6": + url: "https://www.x.org/archive/individual/lib/libXft-2.3.6.tar.gz" + sha256: "b7e59f69e0bbabe9438088775f7e5a7c16a572e58b11f9722519385d38192df5" + "2.3.4": + url: "https://www.x.org/archive/individual/lib/libXft-2.3.4.tar.gz" + sha256: "1eca71bec9cb483165ce1ab94f5cd3036269f5268651df6a2d99c4a7ab644d79" +patches: + "2.3.6": + - patch_file: "patches/0001-fix-gcc-5-and-11.patch" + patch_description: "fix gcc 5 and gcc 11 compilation" + patch_type: "portability" + patch_source: "https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/17" + base_path: "source_subfolder" diff --git a/recipes/libxft/all/conanfile.py b/recipes/libxft/all/conanfile.py new file mode 100644 index 0000000000000..c237fe2cfea9c --- /dev/null +++ b/recipes/libxft/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, chdir, rm, rmdir +from conans import AutoToolsBuildEnvironment +import functools + +required_conan_version = ">=1.52.0" + +class libxftConan(ConanFile): + name = "libxft" + description = 'X FreeType library' + topics = ("libxft", "x11", "xorg") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.x.org/wiki/" + license = "X11" + + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "pkg_config" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + self.requires("xorg/system") + self.requires("freetype/2.13.0") + self.requires("fontconfig/2.14.2") + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + self.build_requires("xorg-macros/1.19.3") + self.build_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(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.options.shared: + del self.options.fPIC + + @functools.lru_cache(1) + def _configure_autotools(self): + args = ["--disable-dependency-tracking"] + if self.options.shared: + args.extend(["--disable-static", "--enable-shared"]) + else: + args.extend(["--disable-shared", "--enable-static"]) + autotools = AutoToolsBuildEnvironment(self) + autotools.configure(args=args, pkg_config_paths=self.build_folder) + return autotools + + def build(self): + apply_conandata_patches(self) + with chdir(self, self._source_subfolder): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with chdir(self, self._source_subfolder): + autotools = self._configure_autotools() + autotools.install(args=["-j1"]) + rm(self, "*.la", f"{self.package_folder}/lib", recursive=True) + rmdir(self, f"{self.package_folder}/lib/pkgconfig") + rmdir(self, f"{self.package_folder}/share") + + def package_info(self): + self.cpp_info.names['pkg_config'] = "Xft" + self.cpp_info.set_property("pkg_config_name", "xft") + self.cpp_info.libs = ["Xft"] diff --git a/recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch b/recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch new file mode 100644 index 0000000000000..c7b72d5585aa0 --- /dev/null +++ b/recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch @@ -0,0 +1,24 @@ +From 84310d83bf4c057dd0866e7116779c9c2f043007 Mon Sep 17 00:00:00 2001 +From: ericLemanissier +Date: Fri, 23 Sep 2022 07:59:55 +0000 +Subject: [PATCH] fix compilation with gcc 5 and gcc 11 + +stdint.h header is needed for SIZE_MAX +--- + src/xftrender.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/xftrender.c b/src/xftrender.c +index 3021d56..c15237e 100644 +--- a/src/xftrender.c ++++ b/src/xftrender.c +@@ -21,6 +21,7 @@ + */ + + #include "xftint.h" ++#include + + #define NUM_LOCAL 1024 + #define NUM_ELT_LOCAL 128 +-- +GitLab diff --git a/recipes/libxft/all/test_package/CMakeLists.txt b/recipes/libxft/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e55ad61e844f5 --- /dev/null +++ b/recipes/libxft/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libxft REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libxft::libxft) diff --git a/recipes/libxft/all/test_package/conanfile.py b/recipes/libxft/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/libxft/all/test_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/libxft/all/test_package/test_package.c b/recipes/libxft/all/test_package/test_package.c new file mode 100644 index 0000000000000..4dd1da9eb81e7 --- /dev/null +++ b/recipes/libxft/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "X11/Xft/Xft.h" + +#include +int main() +{ + if(!XftInit("")) + printf("Could not init Xft\n"); + printf("Xft version: %d\n", XftGetVersion()); + return 0; +} diff --git a/recipes/libxft/config.yml b/recipes/libxft/config.yml new file mode 100644 index 0000000000000..6caf25620b5dc --- /dev/null +++ b/recipes/libxft/config.yml @@ -0,0 +1,5 @@ +versions: + "2.3.6": + folder: all + "2.3.4": + folder: all diff --git a/recipes/libxls/all/conandata.yml b/recipes/libxls/all/conandata.yml new file mode 100644 index 0000000000000..73215812f5900 --- /dev/null +++ b/recipes/libxls/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.6.2": + url: "https://github.com/libxls/libxls/releases/download/v1.6.2/libxls-1.6.2.tar.gz" + sha256: "5dacc34d94bf2115926c80c6fb69e4e7bd2ed6403d51cff49041a94172f5e371" +patches: + "1.6.2": + - patch_file: "patches/1.6.2-0001-fix-ssize_t-msvc.patch" + patch_description: "Solve ssize_t when building on Windows" + patch_type: "conan" diff --git a/recipes/libxls/all/conanfile.py b/recipes/libxls/all/conanfile.py new file mode 100644 index 0000000000000..32c04966aac0e --- /dev/null +++ b/recipes/libxls/all/conanfile.py @@ -0,0 +1,117 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + +import os + +required_conan_version = ">=1.54.0" + + +class LibxlsConan(ConanFile): + name = "libxls" + description = "a C library which can read Excel (xls) files." + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libxls/libxls/" + topics = ("excel", "xls") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_cli": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cli": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if not is_apple_os(self): + self.requires("libiconv/1.17") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio (yet). Contributions are always welcomed") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + if cross_building(self): + tc.configure_args.append("ac_cv_func_malloc_0_nonnull=yes") + tc.configure_args.append("ac_cv_func_realloc_0_nonnull=yes") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + config_h_content = """ +#define HAVE_ICONV 1 +#define ICONV_CONST +#define PACKAGE_VERSION "{}" +""".format(self.version) + if self.settings.os == "Macos": + config_h_content += "#define HAVE_XLOCALE_H 1\n" + save(self, os.path.join(self.source_folder, "include", "config.h"), config_h_content) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libxls") + self.cpp_info.libs = ["xlsreader"] + if is_apple_os(self): + self.cpp_info.system_libs.append("iconv") diff --git a/recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch b/recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch new file mode 100644 index 0000000000000..028e50681cc68 --- /dev/null +++ b/recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch @@ -0,0 +1,14 @@ +diff --git a/include/libxls/xlstypes.h b/include/libxls/xlstypes.h +index 52da772..3efba21 100644 +--- a/include/libxls/xlstypes.h ++++ b/include/libxls/xlstypes.h +@@ -53,4 +53,9 @@ typedef unsigned __int64 unsigned64_t; + typedef uint64_t unsigned64_t; + #endif + ++#ifdef _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#endif ++ + #endif diff --git a/recipes/libxls/all/test_package/CMakeLists.txt b/recipes/libxls/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4b50bc78de77 --- /dev/null +++ b/recipes/libxls/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libxls REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libxls::libxls) diff --git a/recipes/libxls/all/test_package/conanfile.py b/recipes/libxls/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/libxls/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libxls/all/test_package/test_package.c b/recipes/libxls/all/test_package/test_package.c new file mode 100644 index 0000000000000..09d94a0eaa57d --- /dev/null +++ b/recipes/libxls/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include "xls.h" + +int main() { + struct xlsWorkBook* wb; + struct xlsWorkSheet* ws; + + printf("libxls version : %s\n", xls_getVersion()); + + return 0; +} diff --git a/recipes/libxls/all/test_v1_package/CMakeLists.txt b/recipes/libxls/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libxls/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libxls/all/test_v1_package/conanfile.py b/recipes/libxls/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/libxls/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libxls/config.yml b/recipes/libxls/config.yml new file mode 100644 index 0000000000000..9b1f6cb9f3642 --- /dev/null +++ b/recipes/libxls/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.2": + folder: "all" diff --git a/recipes/libxlsxwriter/all/conandata.yml b/recipes/libxlsxwriter/all/conandata.yml new file mode 100644 index 0000000000000..44eb2bad3dada --- /dev/null +++ b/recipes/libxlsxwriter/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.1.5": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.5.tar.gz" + sha256: "12843587d591cf679e6ec63ecc629245befec2951736804a837696cdb5d61946" + "1.1.4": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.4.tar.gz" + sha256: "b379eb35fdd9c653ebe72485b9c992f612c7ea66f732784457997d6e782f619b" + "1.1.3": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.3.tar.gz" + sha256: "bd7a3d38c6a8ef5e31d07a61fded23ac00d29d758417ca42db89da60bf796d78" + "1.0.0": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.0.0.tar.gz" + sha256: "8b353379333c323d14a9d265cd2491d3a6c0032c8d6ec2141f10b82ab66a087c" +patches: + "1.1.5": + - patch_file: "patches/1.1.5-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" + sha256: "54bf92c1f9423d9c7b3820122ff806679e254392d66ae72696f58e7d36e4b16f" + "1.1.4": + - patch_file: "patches/1.1.3-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" + sha256: "54bf92c1f9423d9c7b3820122ff806679e254392d66ae72696f58e7d36e4b16f" + "1.1.3": + - patch_file: "patches/1.1.3-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" + sha256: "54bf92c1f9423d9c7b3820122ff806679e254392d66ae72696f58e7d36e4b16f" + "1.0.0": + - patch_file: "patches/1.0.0-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" + sha256: "d310313e55f4819db7401e1dc27795481b4a3b258fbba19f9eb5211141b09972" diff --git a/recipes/libxlsxwriter/all/conanfile.py b/recipes/libxlsxwriter/all/conanfile.py new file mode 100644 index 0000000000000..0d8e6136fd0e5 --- /dev/null +++ b/recipes/libxlsxwriter/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, 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 LibxlsxwriterConan(ConanFile): + name = "libxlsxwriter" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jmcnamara/libxlsxwriter" + topics = ("excel", "xlsx") + description = "A C library for creating Excel XLSX files" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tmpfile": [True, False], + "md5": [False, "openwall", "openssl"], + "fmemopen": [True, False], + "dtoa": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tmpfile": False, + "md5": "openwall", + "fmemopen": False, + "dtoa": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.fmemopen + + 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): + self.requires("minizip/1.2.13") + self.requires("zlib/1.2.13") + if self.options.md5 == "openssl": + self.requires("openssl/1.1.1s") + + def validate(self): + if Version(self.version) < "1.0.6" and self.info.options.md5 == "openssl": + raise ConanInvalidConfiguration(f"{self.name}:md5=openssl is not suppported in {self.ref}") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["USE_SYSTEM_MINIZIP"] = True + tc.variables["USE_STANDARD_TMPFILE"] = self.options.tmpfile + tc.variables["USE_NO_MD5"] = not bool(self.options.md5) + if Version(self.version) >= "1.0.6": + tc.variables["USE_OPENSSL_MD5"] = self.options.md5 == "openssl" + tc.variables["USE_FMEMOPEN"] = self.options.get_safe("fmemopen", False) + tc.variables["USE_DTOA_LIBRARY"] = self.options.dtoa + if is_msvc(self): + tc.variables["USE_STATIC_MSVC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "xlsxwriter") + self.cpp_info.libs = ["xlsxwriter"] diff --git a/recipes/libxlsxwriter/all/patches/1.0.0-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..ea03f6ee126ba --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.0.0-0001-fix-cmake.patch @@ -0,0 +1,38 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -153,9 +153,8 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- 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\"") +@@ -183,13 +182,13 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB REQUIRED "1.0") ++find_package(ZLIB REQUIRED) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + + # MINIZIP + if (USE_SYSTEM_MINIZIP) +- find_package(MINIZIP REQUIRED "1.0") ++ find_package(minizip REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) + endif() + +@@ -237,7 +236,7 @@ target_sources(${PROJECT_NAME} + PRIVATE ${LXW_SOURCES} + PUBLIC ${LXW_HEADERS} + ) +-target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES}) ++target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB minizip::minizip) + target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS}) + + # /utf-8 needs VS2015 Update 2 or above. diff --git a/recipes/libxlsxwriter/all/patches/1.1.3-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.3-0001-fix-cmake.patch new file mode 100644 index 0000000000000..473fc10337147 --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.3-0001-fix-cmake.patch @@ -0,0 +1,41 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -175,9 +175,8 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- 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\"") +@@ -216,13 +215,13 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB REQUIRED "1.0") ++find_package(ZLIB REQUIRED) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + + # MINIZIP + if (USE_SYSTEM_MINIZIP) +- find_package(MINIZIP REQUIRED "1.0") ++ find_package(minizip REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) + endif() + +@@ -278,7 +277,10 @@ 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. diff --git a/recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch new file mode 100644 index 0000000000000..46175dd3778a6 --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e656184..b9002e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -178,9 +178,8 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- 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\"") +@@ -219,13 +218,13 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB REQUIRED "1.0") ++find_package(ZLIB REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + + # MINIZIP + if (USE_SYSTEM_MINIZIP) +- find_package(MINIZIP REQUIRED "1.0") ++ find_package(MINIZIP REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) + endif() + +@@ -281,7 +280,10 @@ 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. diff --git a/recipes/libxlsxwriter/all/test_package/CMakeLists.txt b/recipes/libxlsxwriter/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..267b50e398033 --- /dev/null +++ b/recipes/libxlsxwriter/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libxlsxwriter REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libxlsxwriter::libxlsxwriter) diff --git a/recipes/libxlsxwriter/all/test_package/conanfile.py b/recipes/libxlsxwriter/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libxlsxwriter/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/libxlsxwriter/all/test_package/test_package.c b/recipes/libxlsxwriter/all/test_package/test_package.c new file mode 100644 index 0000000000000..44bb2c8a62d88 --- /dev/null +++ b/recipes/libxlsxwriter/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "xlsxwriter.h" + +int main() +{ + /* Create a new workbook and add a worksheet. */ + lxw_workbook *workbook = workbook_new("demo.xlsx"); + lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL); + + /* Add a format. */ + lxw_format *format = workbook_add_format(workbook); + + /* Set the bold property for the format */ + format_set_bold(format); + + /* Change the column width for clarity. */ + worksheet_set_column(worksheet, 0, 0, 20, NULL); + + /* Write some simple text. */ + worksheet_write_string(worksheet, 0, 0, "Hello", NULL); + + /* Text with formatting. */ + worksheet_write_string(worksheet, 1, 0, "World", format); + + /* Write some numbers. */ + worksheet_write_number(worksheet, 2, 0, 123, NULL); + worksheet_write_number(worksheet, 3, 0, 123.456, NULL); + + workbook_close(workbook); + + return 0; +} diff --git a/recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt b/recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libxlsxwriter/all/test_v1_package/conanfile.py b/recipes/libxlsxwriter/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libxlsxwriter/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/libxlsxwriter/config.yml b/recipes/libxlsxwriter/config.yml new file mode 100644 index 0000000000000..4690b80fd5fb3 --- /dev/null +++ b/recipes/libxlsxwriter/config.yml @@ -0,0 +1,9 @@ +versions: + "1.1.5": + folder: "all" + "1.1.4": + folder: "all" + "1.1.3": + folder: "all" + "1.0.0": + folder: "all" diff --git a/recipes/libxml2/all/conandata.yml b/recipes/libxml2/all/conandata.yml new file mode 100644 index 0000000000000..9a478e4940277 --- /dev/null +++ b/recipes/libxml2/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.10.4": + url: "https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.4.tar.xz" + sha256: "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45" + "2.10.3": + url: "https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.3.tar.xz" + sha256: "5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c" + "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" + "2.9.10": + url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.10.tar.xz" + sha256: "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" + "2.9.9": + url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.9.tar.xz" + sha256: "58a5c05a2951f8b47656b676ce1017921a29f6b1419c45e3baed0d6435ba03f5" diff --git a/recipes/libxml2/all/conanfile.py b/recipes/libxml2/all/conanfile.py new file mode 100644 index 0000000000000..04bda9f32e243 --- /dev/null +++ b/recipes/libxml2/all/conanfile.py @@ -0,0 +1,407 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building, build_jobs +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rename, rm, rmdir, replace_in_file, save, chdir, mkdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, NMakeDeps, NMakeToolchain +from conan.tools.scm import Version +import os + +import itertools +import textwrap + +required_conan_version = ">=1.55.0" + + +class Libxml2Conan(ConanFile): + name = "libxml2" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + description = "libxml2 is a software library for parsing XML documents" + topics = "xml", "parser", "validation" + homepage = "https://gitlab.gnome.org/GNOME/libxml2/-/wikis/" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + # from ./configure and ./win32/configure.js + default_options = { + "shared": False, + "fPIC": True, + "include_utils": True, + "c14n": True, + "catalog": True, + "docbook": True, # dropped after 2.10.3 + "ftp": True, + "http": True, + "html": True, + "iconv": True, + "icu": False, + "iso8859x": True, + "legacy": True, + "mem-debug": False, + "output": True, + "pattern": True, + "push": True, + "python": False, + "reader": True, + "regexps": True, + "run-debug": False, + "sax1": True, + "schemas": True, + "schematron": True, + "threads": True, + "tree": True, + "valid": True, + "writer": True, + "xinclude": True, + "xpath": True, + "xptr": True, + "zlib": True, + "lzma": False, + } + + options = {name: [True, False] for name in default_options.keys()} + + @property + def _configure_option_names(self): + return [name for name in self.default_options.keys() if (name in self.options) + and (name not in ["shared", "fPIC", "include_utils"])] + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_mingw_windows(self): + return self.settings.compiler == "gcc" and self.settings.os == "Windows" and self._settings_build.os == "Windows" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "2.10.3": + del self.options.docbook + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.zlib: + self.requires("zlib/1.2.13") + if self.options.lzma: + self.requires("xz_utils/5.4.0") + if self.options.iconv: + self.requires("libiconv/1.17", transitive_headers=True, transitive_libs=True) + if self.options.icu: + self.requires("icu/72.1") + + def build_requirements(self): + if not (is_msvc(self) or self._is_mingw_windows): + if self.options.zlib or self.options.lzma or self.options.icu: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + elif self._is_mingw_windows: + pass # nothing to do for mingw? it calls mingw-make directly + else: + 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)}", + ]) + for option_name in self._configure_option_names: + option_value = getattr(self.options, option_name) + tc.configure_args.append(f"--with-{option_name}={yes_no(option_value)}") + + tc.generate() + + tc = PkgConfigDeps(self) + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def _build_msvc(self): + with chdir(self, os.path.join(self.source_folder, 'win32')): + debug = "yes" if self.settings.build_type == "Debug" else "no" + static = "no" if self.options.shared else "yes" + + args = [ + "cscript", + "configure.js", + "compiler=msvc", + f"prefix={self.package_folder}", + f"cruntime=/{msvc_runtime_flag(self)}", + f"debug={debug}", + f"static={static}", + ] + + incdirs = [incdir for dep in self.dependencies.values() for incdir in dep.cpp_info.includedirs] + libdirs = [libdir for dep in self.dependencies.values() for libdir in dep.cpp_info.libdirs] + args.append(f"include=\"{';'.join(incdirs)}\"") + args.append(f"lib=\"{';'.join(libdirs)}\"") + + for name in self._configure_option_names: + cname = {"mem-debug": "mem_debug", + "run-debug": "run_debug", + "docbook": "docb"}.get(name, name) + value = getattr(self.options, name) + value = "yes" if value else "no" + args.append(f"{cname}={value}") + + configure_command = ' '.join(args) + self.output.info(configure_command) + self.run(configure_command) + + # Fix library names because they can be not just zlib.lib + def fix_library(option, package, old_libname): + if option: + libs = [] + aggregated_cpp_info = self.dependencies[package].cpp_info.aggregated_components() + for lib in itertools.chain(aggregated_cpp_info.libs, aggregated_cpp_info.system_libs): + libname = lib + if not libname.endswith('.lib'): + libname += '.lib' + libs.append(libname) + replace_in_file(self, "Makefile.msvc", + f"LIBS = $(LIBS) {old_libname}", + f"LIBS = $(LIBS) {' '.join(libs)}") + + fix_library(self.options.zlib, 'zlib', 'zlib.lib') + fix_library(self.options.lzma, "xz_utils", "liblzma.lib") + fix_library(self.options.iconv, 'libiconv', 'iconv.lib') + fix_library(self.options.icu, 'icu', 'advapi32.lib sicuuc.lib sicuin.lib sicudt.lib') + fix_library(self.options.icu, 'icu', 'icuuc.lib icuin.lib icudt.lib') + + self.run("nmake /f Makefile.msvc libxml libxmla libxmladll") + + if self.options.include_utils: + self.run("nmake /f Makefile.msvc utils") + + def _package_msvc(self): + with chdir(self, os.path.join(self.source_folder, 'win32')): + self.run("nmake /f Makefile.msvc install-libs") + + if self.options.include_utils: + self.run("nmake /f Makefile.msvc install-dist") + + def _build_mingw(self): + with chdir(self, os.path.join(self.source_folder, "win32")): + # configuration + yes_no = lambda v: "yes" if v else "no" + args = [ + "cscript", + "configure.js", + "compiler=mingw", + f"prefix={self.package_folder}", + f"debug={yes_no(self.settings.build_type == 'Debug')}", + f"static={yes_no(not self.options.shared)}", + ] + + incdirs = [incdir for dep in self.dependencies.values() for incdir in dep.cpp_info.includedirs] + libdirs = [libdir for dep in self.dependencies.values() for libdir in dep.cpp_info.libdirs] + args.append(f"include=\"{' -I'.join(incdirs)}\"") + args.append(f"lib=\"{' -L'.join(libdirs)}\"") + + for name in self._configure_option_names: + cname = { + "mem-debug": "mem_debug", + "run-debug": "run_debug", + "docbook": "docb", + }.get(name, name) + args.append(f"{cname}={yes_no(getattr(self.options, name))}") + configure_command = " ".join(args) + self.output.info(configure_command) + self.run(configure_command) + + # build + def fix_library(option, package, old_libname): + if option: + aggregated_cpp_info = self.dependencies[package].cpp_info.aggregated_components() + replace_in_file(self, + "Makefile.mingw", + f"LIBS += -l{old_libname}", + f"LIBS += -l{' -l'.join(aggregated_cpp_info.libs)}", + ) + + fix_library(self.options.iconv, "libiconv", "iconv") + fix_library(self.options.zlib, "zlib", "z") + fix_library(self.options.lzma, "xz_utils", "lzma") + + self.run(f"mingw32-make -j{build_jobs(self)} -f Makefile.mingw libxml libxmla") + if self.options.include_utils: + self.run(f"mingw32-make -j{build_jobs(self)} -f Makefile.mingw utils") + + def _package_mingw(self): + with chdir(self, os.path.join(self.source_folder, "win32")): + mkdir(self, os.path.join(self.package_folder, "include", "libxml2")) + self.run("mingw32-make -f Makefile.mingw install-libs") + if self.options.include_utils: + self.run("mingw32-make -f Makefile.mingw install-dist") + + def _patch_sources(self): + # Break dependency of install on build + for makefile in ("Makefile.mingw", "Makefile.msvc"): + replace_in_file(self, os.path.join(self.source_folder, "win32", makefile), + "install-libs : all", + "install-libs :") + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_msvc() + elif self._is_mingw_windows: + self._build_mingw() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make("libxml2.la") + + if self.options.include_utils: + for target in ["xmllint", "xmlcatalog", "xml2-config"]: + autotools.make(target) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True, keep_path=False) + copy(self, "Copyright", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True, keep_path=False) + if is_msvc(self): + self._package_msvc() + # remove redundant libraries to avoid confusion + if not self.options.shared: + rm(self, "libxml2.dll", os.path.join(self.package_folder, "bin")) + rm(self, "libxml2_a_dll.lib", os.path.join(self.package_folder, "lib")) + rm(self, "libxml2_a.lib" if self.options.shared else "libxml2.lib", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + elif self._is_mingw_windows: + self._package_mingw() + if self.options.shared: + rm(self, "libxml2.a", os.path.join(self.package_folder, "lib")) + rename(self, os.path.join(self.package_folder, "lib", "libxml2.lib"), + os.path.join(self.package_folder, "lib", "libxml2.dll.a")) + else: + rm(self, "libxml2.dll", os.path.join(self.package_folder, "bin")) + rm(self, "libxml2.lib", os.path.join(self.package_folder, "lib")) + else: + autotools = Autotools(self) + + for target in ["install-libLTLIBRARIES", "install-data"]: + autotools.make(target=target, args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + + if self.options.include_utils: + autotools.install() + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.sh", os.path.join(self.package_folder, "lib")) + rm(self, "run*", os.path.join(self.package_folder, "bin")) + rm(self, "test*", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + for header in ["win32config.h", "wsockcompat.h"]: + copy(self, pattern=header, src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include", "libxml2"), keep_path=False) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + # FIXME: also define LIBXML2_XMLLINT_EXECUTABLE variable + content = textwrap.dedent(f"""\ + set(LibXml2_FOUND TRUE) + set(LIBXML2_FOUND TRUE) + if(DEFINED LibXml2_INCLUDE_DIRS) + set(LIBXML2_INCLUDE_DIR ${{LibXml2_INCLUDE_DIRS}}) + set(LIBXML2_INCLUDE_DIRS ${{LibXml2_INCLUDE_DIRS}}) + elseif(DEFINED libxml2_INCLUDE_DIRS) + set(LIBXML2_LIBRARIES ${{libxml2_INCLUDE_DIRS}}) + set(LIBXML2_LIBRARY ${{libxml2_INCLUDE_DIRS}}) + endif() + if(DEFINED LibXml2_LIBRARIES) + set(LIBXML2_LIBRARIES ${{LibXml2_LIBRARIES}}) + set(LIBXML2_LIBRARY ${{LibXml2_LIBRARIES}}) + elseif(DEFINED libxml2_LIBRARIES) + set(LIBXML2_LIBRARIES ${{libxml2_LIBRARIES}}) + set(LIBXML2_LIBRARY ${{libxml2_LIBRARIES}}) + endif() + if(DEFINED LibXml2_DEFINITIONS) + set(LIBXML2_DEFINITIONS ${{LibXml2_DEFINITIONS}}) + elseif(DEFINED libxml2_DEFINITIONS) + set(LIBXML2_DEFINITIONS ${{libxml2_DEFINITIONS}}) + else() + set(LIBXML2_DEFINITIONS "") + endif() + set(LIBXML2_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): + # FIXME: Provide LibXml2::xmllint & LibXml2::xmlcatalog imported target for executables + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "LibXml2") + self.cpp_info.set_property("cmake_file_name", "libxml2") + self.cpp_info.set_property("cmake_target_name", "LibXml2::LibXml2") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "libxml-2.0") + prefix = "lib" if is_msvc(self) else "" + suffix = "_a" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}xml2{suffix}"] + self.cpp_info.includedirs.append(os.path.join("include", "libxml2")) + if not self.options.shared: + self.cpp_info.defines = ["LIBXML_STATIC"] + if self.options.include_utils: + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.system_libs.append("m") + if self.options.threads and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("dl") + elif self.settings.os == "Windows": + if self.options.ftp or self.options.http: + self.cpp_info.system_libs.extend(["ws2_32", "wsock32"]) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "LibXml2" + self.cpp_info.filenames["cmake_find_package_multi"] = "libxml2" + self.cpp_info.names["cmake_find_package"] = "LibXml2" + self.cpp_info.names["cmake_find_package_multi"] = "LibXml2" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "libxml-2.0" diff --git a/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000000000..de255480513cc --- /dev/null +++ b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES C) + +find_package(LibXml2 REQUIRED MODULE) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibXml2.html +# are properly defined in conan generators +set(_custom_vars + LibXml2_FOUND # since CMake 3.14 + LIBXML2_FOUND # until CMake 3.14 + LIBXML2_INCLUDE_DIR + LIBXML2_INCLUDE_DIRS + LIBXML2_LIBRARIES + LIBXML2_DEFINITIONS + LIBXML2_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/libxml2/all/test_cmake_module_package/conanfile.py b/recipes/libxml2/all/test_cmake_module_package/conanfile.py new file mode 100644 index 0000000000000..20481a742d614 --- /dev/null +++ b/recipes/libxml2/all/test_cmake_module_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 + + +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") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "books.xml") + self.run(f"{bin_path} {xml_path}", env="conanrun") diff --git a/recipes/libxml2/all/test_package/CMakeLists.txt b/recipes/libxml2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d8bc300051af --- /dev/null +++ b/recipes/libxml2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libxml2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2) diff --git a/recipes/libxml2/all/test_package/books.xml b/recipes/libxml2/all/test_package/books.xml new file mode 100644 index 0000000000000..7c254f1204dd2 --- /dev/null +++ b/recipes/libxml2/all/test_package/books.xml @@ -0,0 +1,120 @@ + + + + Gambardella, Matthew + XML Developer's Guide + Computer + 44.95 + 2000-10-01 + An in-depth look at creating applications + with XML. + + + Ralls, Kim + Midnight Rain + Fantasy + 5.95 + 2000-12-16 + A former architect battles corporate zombies, + an evil sorceress, and her own childhood to become queen + of the world. + + + Corets, Eva + Maeve Ascendant + Fantasy + 5.95 + 2000-11-17 + After the collapse of a nanotechnology + society in England, the young survivors lay the + foundation for a new society. + + + Corets, Eva + Oberon's Legacy + Fantasy + 5.95 + 2001-03-10 + In post-apocalypse England, the mysterious + agent known only as Oberon helps to create a new life + for the inhabitants of London. Sequel to Maeve + Ascendant. + + + Corets, Eva + The Sundered Grail + Fantasy + 5.95 + 2001-09-10 + The two daughters of Maeve, half-sisters, + battle one another for control of England. Sequel to + Oberon's Legacy. + + + Randall, Cynthia + Lover Birds + Romance + 4.95 + 2000-09-02 + When Carla meets Paul at an ornithology + conference, tempers fly as feathers get ruffled. + + + Thurman, Paula + Splish Splash + Romance + 4.95 + 2000-11-02 + A deep sea diver finds true love twenty + thousand leagues beneath the sea. + + + Knorr, Stefan + Creepy Crawlies + Horror + 4.95 + 2000-12-06 + An anthology of horror stories about roaches, + centipedes, scorpions and other insects. + + + Kress, Peter + Paradox Lost + Science Fiction + 6.95 + 2000-11-02 + After an inadvertant trip through a Heisenberg + Uncertainty Device, James Salway discovers the problems + of being quantum. + + + O'Brien, Tim + Microsoft .NET: The Programming Bible + Computer + 36.95 + 2000-12-09 + Microsoft's .NET initiative is explored in + detail in this deep programmer's reference. + + + O'Brien, Tim + MSXML3: A Comprehensive Guide + Computer + 36.95 + 2000-12-01 + The Microsoft MSXML3 parser is covered in + detail, with attention to XML DOM interfaces, XSLT processing, + SAX and more. + + + Galos, Mike + Visual Studio 7: A Comprehensive Guide + Computer + 49.95 + 2001-04-16 + Microsoft Visual Studio 7 is explored in depth, + looking at how Visual Basic, Visual C++, C#, and ASP+ are + integrated into a comprehensive development + environment. + + diff --git a/recipes/libxml2/all/test_package/conanfile.py b/recipes/libxml2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..dc536a85d6547 --- /dev/null +++ b/recipes/libxml2/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 + + +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") + xml_path = os.path.join(self.source_folder, "books.xml") + self.run(f"{bin_path} {xml_path}", env="conanrun") diff --git a/recipes/libxml2/all/test_package/test_package.c b/recipes/libxml2/all/test_package/test_package.c new file mode 100644 index 0000000000000..b4b977f00d342 --- /dev/null +++ b/recipes/libxml2/all/test_package/test_package.c @@ -0,0 +1,44 @@ +#include +#include +#include +#include + +static void print_element_names(xmlNode *a_node) +{ + xmlNode *cur_node = NULL; + for (cur_node = a_node; cur_node; cur_node = cur_node->next) + { + if (cur_node->type == XML_ELEMENT_NODE) + { + printf("node type: Element, name: %s\n", cur_node->name); + } + print_element_names(cur_node->children); + } +} + +int main(int argc, char **argv) +{ + xmlDoc *doc = NULL; + xmlNode *root_element = NULL; + + if (argc != 2) + return (1); + + LIBXML_TEST_VERSION + + /*parse the file and get the DOM */ + doc = xmlReadFile(argv[1], NULL, 0); + + if (doc == NULL) + { + printf("error: could not parse file %s\n", argv[1]); + exit(-1); + } + + /*Get the root element node */ + root_element = xmlDocGetRootElement(doc); + print_element_names(root_element); + xmlFreeDoc(doc); // free document + xmlCleanupParser(); // Free globals + return 0; +} diff --git a/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt b/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000000000..1de7a7ee473fd --- /dev/null +++ b/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_cmake_module_package + ${CMAKE_CURRENT_BINARY_DIR}/test_cmake_module_package) diff --git a/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py b/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py new file mode 100644 index 0000000000000..ca3b4e232a4f3 --- /dev/null +++ b/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "books.xml") + self.run(f"{bin_path} {xml_path}", run_environment=True) diff --git a/recipes/libxml2/all/test_v1_package/CMakeLists.txt b/recipes/libxml2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libxml2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libxml2/all/test_v1_package/conanfile.py b/recipes/libxml2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ae0f76f08489b --- /dev/null +++ b/recipes/libxml2/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "books.xml") + self.run(f"{bin_path} {xml_path}", run_environment=True) diff --git a/recipes/libxml2/config.yml b/recipes/libxml2/config.yml new file mode 100644 index 0000000000000..62805541d55d5 --- /dev/null +++ b/recipes/libxml2/config.yml @@ -0,0 +1,15 @@ +versions: + "2.10.4": + folder: all + "2.10.3": + folder: all + "2.9.14": + folder: all + "2.9.13": + folder: all + "2.9.12": + folder: all + "2.9.10": + folder: all + "2.9.9": + folder: all diff --git a/recipes/libxmlpp/2.x.x/conandata.yml b/recipes/libxmlpp/2.x.x/conandata.yml new file mode 100644 index 0000000000000..c28f5a99de926 --- /dev/null +++ b/recipes/libxmlpp/2.x.x/conandata.yml @@ -0,0 +1,15 @@ +sources: + "5.0.1": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.0.1/libxml++-5.0.1.tar.xz" + sha256: "15c38307a964fa6199f4da6683a599eb7e63cc89198545b36349b87cf9aa0098" + "2.42.1": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/2.42.1/libxml++-2.42.1.tar.xz" + sha256: "9b59059abe5545d28ceb388a55e341095f197bd219c73e6623aeb6d801e00be8" + +patches: + "5.0.1": + - patch_file: "patches/5.0.1-0001-enable_static_builds_on_msvc.patch" + base_path: "source_subfolder" + "2.42.1": + - patch_file: "patches/2.42.1-0001-enable_static_builds_on_msvc.patch" + base_path: "source_subfolder" diff --git a/recipes/libxmlpp/2.x.x/conanfile.py b/recipes/libxmlpp/2.x.x/conanfile.py new file mode 100644 index 0000000000000..1297a686c1b40 --- /dev/null +++ b/recipes/libxmlpp/2.x.x/conanfile.py @@ -0,0 +1,155 @@ +from conans import ConanFile, Meson, tools +from conan.tools.files import rename +from conans.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +import shutil +import os +import functools + +required_conan_version = ">=1.45.0" + +class LibXMLPlusPlus(ConanFile): + # FIXME: naming the library "libxml++" causes conan not to add it to the + # environment path on windows + name = "libxmlpp" + description = "libxml++ (a.k.a. libxmlplusplus) provides a C++ interface to XML files" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libxmlplusplus/libxmlplusplus" + topics = ["xml", "parser", "wrapper"] + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "pkg_config" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def requirements(self): + self.requires("libxml2/2.9.14") + if tools.Version(self.version) <= "2.42.1": + self.requires("glibmm/2.66.4") + else: + self.requires("glibmm/2.72.1") + + def validate(self): + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + + def build_requirements(self): + self.build_requires("meson/0.63.0") + self.build_requires("pkgconf/1.7.4") + + def source(self): + tools.get( + **self.conan_data["sources"][self.version], + strip_root=True, + destination=self._source_subfolder, + ) + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + if is_msvc(self): + # 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 the Windows SDK isn't standard conformant! + # see: + # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 + tools.replace_in_file( + os.path.join(self._source_subfolder, "meson.build"), + "cpp_std=c++", "cpp_std=vc++") + + @functools.lru_cache(1) + def _configure_meson(self): + meson = Meson(self) + defs = { + "build-examples": "false", + "build-tests": "false", + "build-documentation": "false", + "msvc14x-parallel-installable": "false", + "default_library": "shared" if self.options.shared else "static", + } + meson.configure( + defs=defs, + build_folder=self._build_subfolder, + source_folder=self._source_subfolder, + pkg_config_paths=[self.install_folder], + ) + return meson + + def build(self): + self._patch_sources() + with tools.environment_append(tools.RunEnvironment(self).vars): + meson = self._configure_meson() + meson.build() + + def package(self): + lib_version = "2.6" if tools.Version(self.version) <= "2.42.1" else "5.0" + + self.copy("COPYING", dst="licenses", src=self._source_subfolder) + meson = self._configure_meson() + meson.install() + + shutil.move( + os.path.join(self.package_folder, "lib", f"libxml++-{lib_version}", "include", "libxml++config.h"), + os.path.join(self.package_folder, "include", f"libxml++-{lib_version}", "libxml++config.h")) + + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", f"libxml++-{lib_version}")) + + if is_msvc(self): + tools.remove_files_by_mask( + os.path.join(self.package_folder, "bin"), "*.pdb") + if not self.options.shared: + rename( + self, + os.path.join(self.package_folder, "lib", f"libxml++-{lib_version}.a"), + os.path.join(self.package_folder, "lib", f"xml++-{lib_version}.lib")) + + def package_info(self): + lib_version = "2.6" if tools.Version(self.version) <= "2.42.1" else "5.0" + + self.cpp_info.set_property("cmake_module_file_name", "libxml++") + self.cpp_info.set_property("cmake_module_target_name", "libxml++::libxml++") + self.cpp_info.set_property("pkg_config_name", "libxml++") + self.cpp_info.components[f"libxml++-{lib_version}"].set_property("pkg_config_name", f"libxml++-{lib_version}") + self.cpp_info.components[f"libxml++-{lib_version}"].libs = [f"xml++-{lib_version}"] + self.cpp_info.components[f"libxml++-{lib_version}"].includedirs = [ + os.path.join("include", f"libxml++-{lib_version}") + ] + self.cpp_info.components[f"libxml++-{lib_version}"].requires = [ + "glibmm::glibmm", "libxml2::libxml2" + ] + + self.cpp_info.names["cmake_find_package"] = "libxml++" + self.cpp_info.names["cmake_find_package_multi"] = "libxml++" + self.cpp_info.names["pkg_config"] = "libxml++" + self.cpp_info.components[f"libxml++-{lib_version}"].names["pkg_config"] = f"libxml++-{lib_version}" diff --git a/recipes/libxmlpp/2.x.x/patches/2.42.1-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/2.x.x/patches/2.42.1-0001-enable_static_builds_on_msvc.patch new file mode 100644 index 0000000000000..32d4ca9bbdc42 --- /dev/null +++ b/recipes/libxmlpp/2.x.x/patches/2.42.1-0001-enable_static_builds_on_msvc.patch @@ -0,0 +1,47 @@ +diff --git a/libxml++config.h.meson b/libxml++config.h.meson +index fdae143..5d853c2 100755 +--- a/libxml++config.h.meson ++++ b/libxml++config.h.meson +@@ -21,9 +21,16 @@ + /* Micro version number of libxml++. */ + #mesondefine LIBXMLXX_MICRO_VERSION + +-#if defined (GLIBMM_DLL) && !defined (LIBXMLXX_STATIC) ++/* Defined if libxml++ is built as a static library. */ ++#mesondefine LIBXMLXX_STATIC ++ ++#if !defined (LIBXMLXX_STATIC) + #ifdef LIBXMLPP_BUILD +- #define LIBXMLPP_API __declspec(dllexport) ++ #ifdef __GNUC__ ++ #define LIBXMLPP_API __attribute__((visibility("default"))) ++ #else ++ #define LIBXMLPP_API __declspec(dllexport) ++ #endif + #elif !defined (__GNUC__) + #define LIBXMLPP_API __declspec(dllimport) + #else /* don't dllimport classes/methods on GCC/MinGW */ +diff --git a/meson.build b/meson.build +index e89f2c6..20d66ed 100644 +--- a/meson.build ++++ b/meson.build +@@ -292,15 +292,13 @@ endif + # Always set for backwards compatibility. + pkg_conf_data.set('LIBXMLCPP_EXCEPTIONS_ENABLED', 1) + ++if get_option('default_library') == 'static' ++ pkg_conf_data.set('LIBXMLXX_STATIC', 1) ++endif ++ + # Static library? + 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 +- + configure_file( + input: 'libxml++-2.6.pc.in', + output: '@BASENAME@', diff --git a/recipes/libxmlpp/2.x.x/patches/5.0.1-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/2.x.x/patches/5.0.1-0001-enable_static_builds_on_msvc.patch new file mode 100644 index 0000000000000..135415955e944 --- /dev/null +++ b/recipes/libxmlpp/2.x.x/patches/5.0.1-0001-enable_static_builds_on_msvc.patch @@ -0,0 +1,38 @@ +diff --git a/libxml++config.h.meson b/libxml++config.h.meson +index 2f0264f..11e0c2c 100755 +--- a/libxml++config.h.meson ++++ b/libxml++config.h.meson +@@ -16,6 +16,9 @@ + /* Micro version number of libxml++. */ + #mesondefine LIBXMLXX_MICRO_VERSION + ++/* Defined if libxml++ is built as a static library. */ ++#mesondefine LIBXMLXX_STATIC ++ + // Enable DLL-specific stuff only when not building a static library + #if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined(_MSC_VER)) && !defined(LIBXMLXX_STATIC) + # define LIBXMLPP_DLL 1 +diff --git a/meson.build b/meson.build +index 6e86ca3..8557846 100644 +--- a/meson.build ++++ b/meson.build +@@ -274,15 +274,13 @@ if cpp_compiler.compiles(files('tools' / 'conf_tests' / 'have_exception_ptr.cc') + pkg_conf_data.set('LIBXMLXX_HAVE_EXCEPTION_PTR', 1) + endif + ++if get_option('default_library') == 'static' ++ pkg_conf_data.set('LIBXMLXX_STATIC', 1) ++endif ++ + # Static library? + 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 +- + configure_file( + input: 'libxml++.pc.in', + output: xmlxx_pcname + '.pc', diff --git a/recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt b/recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..acd4c1ac2441b --- /dev/null +++ b/recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libxml++ REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(TARGET libxml++::libxml++-2.6) + target_link_libraries(${PROJECT_NAME} libxml++::libxml++-2.6) +else() + target_link_libraries(${PROJECT_NAME} libxml++::libxml++-5.0) +endif() diff --git a/recipes/libxmlpp/2.x.x/test_package/conanfile.py b/recipes/libxmlpp/2.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..8aaecaac427e8 --- /dev/null +++ b/recipes/libxmlpp/2.x.x/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = f'{os.path.join("bin", "test_package")} \ + {os.path.join(self.source_folder, "example.xml")}' + self.run(bin_path, run_environment=True) diff --git a/recipes/libxmlpp/2.x.x/test_package/example.xml b/recipes/libxmlpp/2.x.x/test_package/example.xml new file mode 100644 index 0000000000000..a7a9ee8349141 --- /dev/null +++ b/recipes/libxmlpp/2.x.x/test_package/example.xml @@ -0,0 +1,11 @@ + + + + + + + + + Some content :-) + + diff --git a/recipes/libxmlpp/2.x.x/test_package/test_package.cpp b/recipes/libxmlpp/2.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..028b0bb3d0bac --- /dev/null +++ b/recipes/libxmlpp/2.x.x/test_package/test_package.cpp @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2002 The libxml++ development team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + +#include +#include + +struct indent { + int depth_; + explicit indent(int depth): depth_(depth) {}; +}; + +std::ostream & operator<<(std::ostream & o, indent const & in) +{ + for(int i = 0; i != in.depth_; ++i) + { + o << " "; + } + return o; +} + +int main(int argc, char** argv) +{ + if (argc == 1) { + std::cerr << "Expected an xml file as a command line argument!\n"; + return EXIT_FAILURE; + } + + try + { + xmlpp::TextReader reader(argv[1]); + + while(reader.read()) + { + int depth = reader.get_depth(); + std::cout << indent(depth) << "--- node ---" << std::endl; + std::cout << indent(depth) << "name: " << reader.get_name() << std::endl; + std::cout << indent(depth) << "depth: " << reader.get_depth() << std::endl; + + if(reader.has_attributes()) + { + std::cout << indent(depth) << "attributes: " << std::endl; + reader.move_to_first_attribute(); + do + { + std::cout << indent(depth) << " " << reader.get_name() << ": " << reader.get_value() << std::endl; + } while(reader.move_to_next_attribute()); + reader.move_to_element(); + } + else + { + std::cout << indent(depth) << "no attributes" << std::endl; + } + + if(reader.has_value()) + std::cout << indent(depth) << "value: '" << reader.get_value() << "'" << std::endl; + else + std::cout << indent(depth) << "novalue" << std::endl; + + } + } + catch(const std::exception& e) + { + std::cerr << "Exception caught: " << e.what() << std::endl; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} + diff --git a/recipes/libxmlpp/config.yml b/recipes/libxmlpp/config.yml new file mode 100644 index 0000000000000..4976ee096e564 --- /dev/null +++ b/recipes/libxmlpp/config.yml @@ -0,0 +1,5 @@ +versions: + "5.0.1": + folder: "2.x.x" + "2.42.1": + folder: "2.x.x" diff --git a/recipes/libxpm/all/CMakeLists.txt b/recipes/libxpm/all/CMakeLists.txt new file mode 100644 index 0000000000000..77475adeda3d9 --- /dev/null +++ b/recipes/libxpm/all/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.1) + +project(libXpm VERSION "${CONAN_libXpm_VERSION}" LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +# ---- X11 dependency ---- + +if(NOT WIN32) + find_path(X11_INCLUDE_DIR X11/Xlib.h) + find_library(X11_LIBRARY X11) + foreach(var X11_INCLUDE_DIR X11_LIBRARY) + if(NOT ${var}) + message(FATAL_ERROR "${var} is required. (Value: ${${var}})") + endif() + endforeach() +endif() + +# ---- Library ---- + +add_library( + Xpm + src/Attrib.c + src/CrBufFrI.c + src/CrDatFrI.c + src/create.c + src/CrIFrBuf.c + src/CrIFrDat.c + src/data.c + src/hashtab.c + src/Image.c + src/Info.c + src/misc.c + src/parse.c + src/RdFToBuf.c + src/RdFToDat.c + src/RdFToI.c + src/rgb.c + src/scan.c + src/simx.c + src/WrFFrBuf.c + src/WrFFrDat.c + src/WrFFrI.c +) + +if(WIN32) + target_sources(Xpm PRIVATE windows/libXpm.def) + target_compile_definitions(Xpm PRIVATE FOR_MSW) +else() + target_sources( + Xpm PRIVATE + src/CrBufFrP.c + src/CrDatFrP.c + src/CrIFrP.c + src/RdFToP.c + src/WrFFrP.c + ) + target_include_directories(Xpm PRIVATE "${X11_INCLUDE_DIR}") + target_link_libraries(Xpm PRIVATE "${X11_LIBRARY}") +endif() + +if(MSVC) + target_compile_definitions( + Xpm PRIVATE + _CRT_SECURE_NO_WARNINGS + _CRT_NONSTDC_NO_DEPRECATE + ) + target_compile_options(Xpm PRIVATE /wd4267 /wd4244 /wd4018) +endif() + +target_include_directories(Xpm PRIVATE include/X11) + +set_target_properties( + Xpm PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}" +) + +# ---- Install ---- + +include(GNUInstallDirs) + +install( + TARGETS Xpm + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) + +install(DIRECTORY include/X11 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +if(WIN32) + install(FILES src/simx.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/X11") +endif() diff --git a/recipes/libxpm/all/conandata.yml b/recipes/libxpm/all/conandata.yml new file mode 100644 index 0000000000000..3db82178c2eeb --- /dev/null +++ b/recipes/libxpm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.5.13": + sha256: "516fcb7a3cc5b491ca2b95df29018b1643c40649d72473d3c62379d8fdc472ff" + url: https://gitlab.freedesktop.org/xorg/lib/libxpm/-/archive/libXpm-3.5.13/libxpm-libXpm-3.5.13.tar.gz diff --git a/recipes/libxpm/all/conanfile.py b/recipes/libxpm/all/conanfile.py new file mode 100644 index 0000000000000..63d51162a71f7 --- /dev/null +++ b/recipes/libxpm/all/conanfile.py @@ -0,0 +1,71 @@ +import functools +import os + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.43.0" + + +class LibXpmConan(ConanFile): + name = "libxpm" + description = "X Pixmap (XPM) image file format library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.freedesktop.org/xorg/lib/libxpm" + topics = "xpm" + license = "MIT-open-group" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + exports_sources = "CMakeLists.txt", "windows/*" + no_copy_source = True + + def validate(self): + if self.settings.os not in ("Windows", "Linux", "FreeBSD"): + raise ConanInvalidConfiguration( + "libXpm is supported only on Windows, Linux and FreeBSD" + ) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.settings.os != "Windows": + self.requires("xorg/system") + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["CONAN_libXpm_VERSION"] = self.version + cmake.configure() + return cmake + + def build(self): + self._configure_cmake().build() + + def package(self): + self.copy("COPYING", "licenses") + self.copy("COPYRIGHT", "licenses") + self._configure_cmake().install() + + def package_info(self): + self.cpp_info.libs = ["Xpm"] + if self.settings.os == "Windows": + self.cpp_info.defines = ["FOR_MSW"] diff --git a/recipes/libxpm/all/test_package/CMakeLists.txt b/recipes/libxpm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0ea6d5bc37b28 --- /dev/null +++ b/recipes/libxpm/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(libxpm REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libxpm::libxpm) diff --git a/recipes/libxpm/all/test_package/conanfile.py b/recipes/libxpm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a8c92dea63335 --- /dev/null +++ b/recipes/libxpm/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.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/libxpm/all/test_package/test_package.c b/recipes/libxpm/all/test_package/test_package.c new file mode 100644 index 0000000000000..ed1efad8c383c --- /dev/null +++ b/recipes/libxpm/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const* argv[]) +{ + (void)argc; + (void)argv; + + XpmFree(NULL); + + return 0; +} diff --git a/recipes/libxpm/all/windows/libXpm.def b/recipes/libxpm/all/windows/libXpm.def new file mode 100644 index 0000000000000..5381386ee75ee --- /dev/null +++ b/recipes/libxpm/all/windows/libXpm.def @@ -0,0 +1,29 @@ +EXPORTS + +XpmCreateImageFromData +XpmCreateDataFromImage +XpmReadFileToImage +XpmWriteFileFromImage +XpmCreateImageFromBuffer +XpmReadFileToBuffer +XpmWriteFileFromBuffer +XpmReadFileToData +XpmWriteFileFromData +XpmAttributesSize +XpmFreeAttributes +XpmFreeExtensions +XpmFreeXpmImage +XpmFreeXpmInfo +XpmGetErrorString +XpmLibraryVersion + +XpmReadFileToXpmImage +XpmWriteFileFromXpmImage +XpmCreateImageFromXpmImage +XpmCreateXpmImageFromImage +XpmCreateDataFromXpmImage +XpmCreateXpmImageFromData +XpmCreateXpmImageFromBuffer +XpmCreateBufferFromXpmImage + +XpmFree diff --git a/recipes/libxpm/config.yml b/recipes/libxpm/config.yml new file mode 100644 index 0000000000000..96f25a4bd1d23 --- /dev/null +++ b/recipes/libxpm/config.yml @@ -0,0 +1,3 @@ +versions: + "3.5.13": + folder: all diff --git a/recipes/libxshmfence/all/conandata.yml b/recipes/libxshmfence/all/conandata.yml new file mode 100644 index 0000000000000..8c16f251fa486 --- /dev/null +++ b/recipes/libxshmfence/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3": + url: "https://www.x.org/archive//individual/lib/libxshmfence-1.3.tar.gz" + sha256: "7eb3d46ad91bab444f121d475b11b39273142d090f7e9ac43e6a87f4ff5f902c" diff --git a/recipes/libxshmfence/all/conanfile.py b/recipes/libxshmfence/all/conanfile.py new file mode 100644 index 0000000000000..abd496668a102 --- /dev/null +++ b/recipes/libxshmfence/all/conanfile.py @@ -0,0 +1,116 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir +from conans import tools, AutoToolsBuildEnvironment +import contextlib +import os + +required_conan_version = ">=1.53.0" + +class LibxshmfenceConan(ConanFile): + name = "libxshmfence" + license = "X11" + homepage = "https://gitlab.freedesktop.org/xorg/lib/libxshmfence" + url = "https://github.com/conan-io/conan-center-index" + description = "Shared memory 'SyncFence' synchronization primitive" + topics = ("shared", "memory", "syncfence", "synchronization", "interprocess") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + generators = "pkg_config" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def export_sources(self): + 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") + # for plain C projects only + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported by libxshmfence recipe. Contributions are welcome") + + def build_requirements(self): + self.build_requires("automake/1.16.5") + self.build_requires("pkgconf/1.9.3") + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def requirements(self): + self.requires("xorg-proto/2022.2") + + 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(self._user_info_build["automake"].compile).replace("\\", "/"), + } + with tools.environment_append(env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") + self._autotools.libs = [] + 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)), + ] + self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + apply_conandata_patches(self) + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["xshmfence"] + self.cpp_info.names["pkg_config"] = "xshmfence" + self.cpp_info.set_property("pkg_config_name", "xshmfence") diff --git a/recipes/libxshmfence/all/test_package/CMakeLists.txt b/recipes/libxshmfence/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b08d77d4e4328 --- /dev/null +++ b/recipes/libxshmfence/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libxshmfence REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} libxshmfence::libxshmfence) diff --git a/recipes/libxshmfence/all/test_package/conanfile.py b/recipes/libxshmfence/all/test_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libxshmfence/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libxshmfence/all/test_package/test_package.c b/recipes/libxshmfence/all/test_package/test_package.c new file mode 100644 index 0000000000000..2dc0779250663 --- /dev/null +++ b/recipes/libxshmfence/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include "X11/xshmfence.h" + +int main() { + int fd; + struct xshmfence *x; + + fd = xshmfence_alloc_shm(); + if (fd < 0) { + return 1; + } + + + x = xshmfence_map_shm(fd); + if (!x) { + return 1; + } + + xshmfence_unmap_shm(x); + + return 0; +} diff --git a/recipes/libxshmfence/config.yml b/recipes/libxshmfence/config.yml new file mode 100644 index 0000000000000..d2eb4ed4a511f --- /dev/null +++ b/recipes/libxshmfence/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3": + folder: all diff --git a/recipes/libxslt/all/conandata.yml b/recipes/libxslt/all/conandata.yml new file mode 100644 index 0000000000000..8795d460be899 --- /dev/null +++ b/recipes/libxslt/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.1.34": + sha256: "28c47db33ab4daefa6232f31ccb3c65260c825151ec86ec461355247f3f56824" + url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.34.tar.xz" +patches: + "1.1.34": + - patch_file: "patches/0001-allow-xsltproc-link-shared-mt.patch" + - patch_file: "patches/0002-Add-configuration-for-profiler.patch" diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py new file mode 100644 index 0000000000000..35861075ebb78 --- /dev/null +++ b/recipes/libxslt/all/conanfile.py @@ -0,0 +1,234 @@ +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 apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, NMakeDeps, NMakeToolchain +import os + +required_conan_version = ">=1.55.0" + + +class LibxsltConan(ConanFile): + name = "libxslt" + url = "https://github.com/conan-io/conan-center-index" + description = "libxslt is a software library implementing XSLT processor, based on libxml2" + topics = ("xslt", "processor") + homepage = "https://xmlsoft.org" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "debugger": [True, False], + "crypto": [True, False], + "profiler": [True, False], + "plugins": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "debugger": False, + "crypto": False, + "profiler": False, + "plugins": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # see https://github.com/conan-io/conan-center-index/pull/16205#discussion_r1149570846 + self.requires("libxml2/2.10.3", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.options.plugins and not self.options.shared: + raise ConanInvalidConfiguration("plugins require shared") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + else: + 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([ + "--with-python=no", + f"--with-libxml-src={unix_path(self, self.dependencies['libxml2'].package_folder)}", + f"--with-debugger={yes_no(self.options.debugger)}", + f"--with-crypto={yes_no(self.options.crypto)}", + f"--with-profiler={yes_no(self.options.profiler)}", + f"--with-plugins={yes_no(self.options.plugins)}", + ]) + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def _build_msvc(self): + # Configure step to generate Makefile.msvc + deps_includedirs = [] + deps_libdirs = [] + for deps in self.dependencies.values(): + deps_cpp_info = deps.cpp_info.aggregated_components() + deps_includedirs.extend(deps_cpp_info.includedirs) + deps_libdirs.extend(deps_cpp_info.libdirs) + + yes_no = lambda v: "yes" if v else "no" + args = [ + "compiler=msvc", + f"prefix={self.package_folder}", + f"cruntime=/{msvc_runtime_flag(self)}", + f"debug={yes_no(self.settings.build_type == 'Debug')}", + f"static={yes_no(not self.options.shared)}", + "include=\"{}\"".format(";".join(deps_includedirs)), + "lib=\"{}\"".format(";".join(deps_libdirs)), + "iconv=no", + "xslt_debug=no", + f"debugger={yes_no(self.options.debugger)}", + f"crypto={yes_no(self.options.crypto)}", + f"profiler={yes_no(self.options.profiler)}", + f"modules={yes_no(self.options.plugins)}", + ] + + with chdir(self, os.path.join(self.source_folder, "win32")): + self.run(f"cscript configure.js {' '.join(args)}") + + # Fix library names in generated Makefile.msvc + def format_libs(package): + libs = [] + dep_cpp_info = self.dependencies[package].cpp_info.aggregated_components() + for lib in dep_cpp_info.libs + dep_cpp_info.system_libs: + libname = lib + if not libname.endswith(".lib"): + libname += ".lib" + libs.append(libname) + return " ".join(libs) + + makefile_msvc = os.path.join(self.source_folder, "win32", "Makefile.msvc") + replace_in_file(self, makefile_msvc, "libxml2.lib", format_libs("libxml2")) + replace_in_file(self, makefile_msvc, "libxml2_a.lib", format_libs("libxml2")) + if self.dependencies["libxml2"].options.get_safe("icu"): + replace_in_file(self, makefile_msvc, "LIBS = wsock32.lib", f"LIBS = {format_libs('icu')}") + + # Avoid to indirectly build both static & shared when we build utils + lib_suffix = "" if self.options.shared else "a" + replace_in_file( + self, makefile_msvc, + "$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxslt libxslta libexslt libexslta", + f"$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxslt{lib_suffix} libexslt{lib_suffix}", + ) + + # Build with NMake + with chdir(self, os.path.join(self.source_folder, "win32")): + targets = f"libxslt{lib_suffix} libexslt{lib_suffix} utils" + self.run(f"nmake -f Makefile.msvc {targets}") + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "*.h", src=os.path.join(self.source_folder, "libxslt"), + dst=os.path.join(self.package_folder, "include", "libxslt")) + copy(self, "*.h", src=os.path.join(self.source_folder, "libexslt"), + dst=os.path.join(self.package_folder, "include", "libexslt")) + build_dir = os.path.join(self.source_folder, "win32", "bin.msvc") + copy(self, "*.exe", src=build_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + if self.options.shared: + copy(self, "*xslt.lib", src=build_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*xslt.dll", src=build_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + else: + copy(self, "*xslt_a.lib", src=build_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + else: + autotools = Autotools(self) + autotools.install() + os.remove(os.path.join(self.package_folder, "bin", "xslt-config")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.sh", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "LibXslt") + self.cpp_info.set_property("pkg_config_name", "libxslt_full_package") # unofficial, avoid conflicts in conan generators + + prefix = "lib" if is_msvc(self) else "" + suffix = "_a" if is_msvc(self) and not self.options.shared else "" + + # xslt + self.cpp_info.components["xslt"].set_property("cmake_target_name", "LibXslt::LibXslt") + self.cpp_info.components["xslt"].set_property("pkg_config_name", "libxslt") + self.cpp_info.components["xslt"].libs = [f"{prefix}xslt{suffix}"] + if not self.options.shared: + self.cpp_info.components["xslt"].defines = ["LIBXSLT_STATIC"] + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.components["xslt"].system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.components["xslt"].system_libs.append("ws2_32") + self.cpp_info.components["xslt"].requires = ["libxml2::libxml2"] + + # exslt + self.cpp_info.components["exslt"].set_property("cmake_target_name", "LibXslt::LibExslt") + self.cpp_info.components["exslt"].set_property("pkg_config_name", "libexslt") + self.cpp_info.components["exslt"].libs = [f"{prefix}exslt{suffix}"] + self.cpp_info.components["exslt"].requires = ["xslt"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "LibXslt" + self.cpp_info.names["cmake_find_package_multi"] = "LibXslt" + self.cpp_info.names["pkg_config"] = "libxslt_full_package" + self.cpp_info.components["xslt"].names["cmake_find_package"] = "LibXslt" + self.cpp_info.components["xslt"].names["cmake_find_package_multi"] = "LibXslt" + self.cpp_info.components["xslt"].names["pkg_config"] = "libxslt" + self.cpp_info.components["exslt"].names["cmake_find_package"] = "LibExslt" + self.cpp_info.components["exslt"].names["cmake_find_package_multi"] = "LibExslt" + self.cpp_info.components["exslt"].names["pkg_config"] = "libexslt" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libxslt/all/patches/0001-allow-xsltproc-link-shared-mt.patch b/recipes/libxslt/all/patches/0001-allow-xsltproc-link-shared-mt.patch new file mode 100644 index 0000000000000..ea8fa8f72e635 --- /dev/null +++ b/recipes/libxslt/all/patches/0001-allow-xsltproc-link-shared-mt.patch @@ -0,0 +1,11 @@ +--- a/win32/configure.js ++++ b/win32/configure.js +@@ -394,7 +394,7 @@ if (error != 0) { + // with /MT and friends, then we need to enable static linking for xsltproc + if (cruntime == "/MT" || cruntime == "/MTd" || + cruntime == "/ML" || cruntime == "/MLd") { +- buildStatic = 1; ++ // buildStatic = 1; + } + + if (buildStatic == 1 && withModules == 1) { diff --git a/recipes/libxslt/all/patches/0002-Add-configuration-for-profiler.patch b/recipes/libxslt/all/patches/0002-Add-configuration-for-profiler.patch new file mode 100644 index 0000000000000..6aa55442ff43e --- /dev/null +++ b/recipes/libxslt/all/patches/0002-Add-configuration-for-profiler.patch @@ -0,0 +1,71 @@ +From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001 +From: Chun-wei Fan +Date: Tue, 12 Nov 2019 17:37:05 +0800 +Subject: [PATCH] win32: Add configuration for profiler + +Without this the generated xsltconfig.h will not be complete as there +will be a configuration variable that is left in the header, breaking +builds. + +This will allow one to enable or disable profiler support in Windows +builds, and the default is to enable this. +--- + win32/configure.js | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/win32/configure.js b/win32/configure.js +index 56694cce..12c99f30 100644 +--- a/win32/configure.js ++++ b/win32/configure.js +@@ -47,6 +47,7 @@ var withIconv = true; + var withZlib = false; + var withCrypto = true; + var withModules = false; ++var withProfiler = true; + /* Win32 build options. */ + var dirSep = "\\"; + var compiler = "msvc"; +@@ -106,6 +107,7 @@ function usage() + txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; + txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; + txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n"; ++ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n"; + txt += "\nWin32 build options, default value given in parentheses:\n\n"; + txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; + txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; +@@ -192,6 +194,7 @@ function discoverVersion() + vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); + vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); + vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); ++ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0")); + vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); + vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); + vf.WriteLine("PREFIX=" + buildPrefix); +@@ -240,6 +243,8 @@ function configureXslt() + of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); + } else if (s.search(/\@WITH_MODULES\@/) != -1) { + of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0")); ++ } else if (s.search(/\@WITH_PROFILER\@/) != -1) { ++ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0")); + } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) { + of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL")); + } else +@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { + withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "modules") + withModules = strToBool(arg.substring(opt.length + 1, arg.length)); ++ else if (opt == "profiler") ++ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "compiler") + compiler = arg.substring(opt.length + 1, arg.length); + else if (opt == "cruntime") +@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; + txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; + txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; + txtOut += " Modules: " + boolToStr(withModules) + "\n"; ++txtOut += " Profiler: " + boolToStr(withProfiler) + "\n"; + txtOut += "\n"; + txtOut += "Win32 build configuration\n"; + txtOut += "-------------------------\n"; +-- +2.26.2 diff --git a/recipes/libxslt/all/test_package/CMakeLists.txt b/recipes/libxslt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ca93bd0e8116 --- /dev/null +++ b/recipes/libxslt/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(LibXslt REQUIRED) +find_package(LibXml2 REQUIRED) + +add_executable(${PROJECT_NAME} libxslt_tutorial.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXslt::LibXslt LibXml2::LibXml2) diff --git a/recipes/libxslt/all/test_package/conanfile.py b/recipes/libxslt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..749c8c5fab90e --- /dev/null +++ b/recipes/libxslt/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xsl_path = os.path.join(self.source_folder, "example.xsl") + xml_path = os.path.join(self.source_folder, "example.xml") + self.run(f"{bin_path} {xsl_path} {xml_path}", env="conanrun") + self.run("xsltproc -V", env="conanrun") diff --git a/recipes/libxslt/all/test_package/example.xml b/recipes/libxslt/all/test_package/example.xml new file mode 100644 index 0000000000000..694bee170e1b5 --- /dev/null +++ b/recipes/libxslt/all/test_package/example.xml @@ -0,0 +1,11 @@ + + + + Empire Burlesque + Bob Dylan + USA + Columbia + 10.90 + 1985 + + diff --git a/recipes/libxslt/all/test_package/example.xsl b/recipes/libxslt/all/test_package/example.xsl new file mode 100644 index 0000000000000..4a55710458bfe --- /dev/null +++ b/recipes/libxslt/all/test_package/example.xsl @@ -0,0 +1,22 @@ + + + + + +

CjzuOjC>}UM0SR{oC7^B zt1Q8tOTxjzi!j|mn6Awh=m*rbZBp{cO)!1FP%&VkA=0d8mk^nhv<Pj%0eNO!JdRNr8%O5;LrRiX#n`)ii5 zT1`14zuNGp=oP#LJCt?~?&oZ4j6oZK*IW-zWru%j$dT;5!q{lOb08bl@@hf#ov_mA z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ICENSE_AGREEMENT.md @@ -0,0 +1,23 @@ +Conan-Center-Index project Contributor License Agreement +-------------------------------------------------------- + +The following terms are used throughout this agreement: + +- You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it. +- Contribution - any type of work that is submitted to the repository, including any modifications or additions to existing work. +- Project - Conan-Center-Index project (https://github.com/conan-io/conan-center-index) +- Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with the copyright owner, contributors or maintainers. + +1. Grant of Copyright License. + + Subject to the terms and conditions of this agreement, You grant to JFrog LTD, a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works. + +2. Grant of Patent License. + + Subject to the terms and conditions of this agreement, You grant to JFrog LTD, a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, where such license applies only to those patent claims licensable by you that are necessarily infringed by your contribution or by combination of your contribution with the project to which this contribution was submitted. + + If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging that your contribution or any project it was submitted to constitutes or is responsible for direct or contributory patent infringement, then any patent licenses granted to that entity under this agreement shall terminate as of the date such litigation is filed. + +3. Source of Contribution. + + Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, is covered under an appropriate open source license and you have the right under that license to submit that work with modifications, whether created in whole or in part by you, or you have clearly identified the source of the contribution and any license or other restriction (like related patents, trademarks, and license agreements) of which you are personally aware. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000000..566801917e5f3 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,24 @@ + + +This repository, ConanCenterIndex, contains recipes for the remote [JFrog ConanCenter](https://conan.io/center/). +This remote is added by default to a clean installation of the Conan client. Recipes are contributed by opening pull requests as explained in the sections below. +When pull requests are merged, the CI will upload the generated packages to the [ConanCenter](https://conan.io/center/) remote. + +# Documentation + +* [Code of conduct](code_of_conduct.md) +* [Changelog](changelog.md) + +* User documentation + + [Contributing to Conan Center Index](../CONTRIBUTING.md) + + [Developing Recipes Locally](developing_recipes_locally.md) + + [Adding Packages to ConanCenter](adding_packages/README.md) :point_left: Best place to learn how to contribute + + [Bumping versions to existing packages](bump_version.md) + + [Errors from the conan-center hook (KB-Hxxx)](error_knowledge_base.md) + + [Review Process](review_process.md) + + [Labels](labels.md) + + [Supported platforms and configurations](supported_platforms_and_configurations.md) + + [Consuming Recipes](consuming_recipes.md) :information_source: Learn how to limit the impact of recipe changes + + [Community Resources](community_resources.md) + + [Preparing recipes for Conan 2.0](v2_migration.md) + + [FAQs](faqs.md) diff --git a/docs/adding_packages/README.md b/docs/adding_packages/README.md new file mode 100644 index 0000000000000..3f310562fdf6a --- /dev/null +++ b/docs/adding_packages/README.md @@ -0,0 +1,133 @@ +# Adding Packages to ConanCenter + +ConanCenterIndex aims to provide the best quality packages of any open source project. +Any C/C++ project can be made available by contributing a "recipe". + +Getting started is easy. Try building an existing package with our [developing recipes](../developing_recipes_locally.md) +tutorial. To deepen you understanding, start with the [How to provide a good recipe](#how-to-provide-a-good-recipe) section. +You can follow the three steps (:one: :two: :three:) described below! :tada: + + +## Contents + + * [:one: Request access](#one-request-access) + * [Inactivity and user removal](#inactivity-and-user-removal) + * [:two: Creating a package](#two-creating-a-package) + * [How to provide a good recipe](#how-to-provide-a-good-recipe) + * [:three: Submitting a Package](#three-submitting-a-package) + * [The Build Service](#the-build-service) + +## :one: Request access + +The first step to add packages to ConanCenter is requesting access. To enroll in ConanCenterIndex repository, please write a comment +requesting access in this GitHub [issue #4](https://github.com/conan-io/conan-center-index/issues/4). Feel free to introduce yourself and +your motivation to join ConanCenter community. + +This process helps ConanCenter against spam and malicious code. The process is not fully automated on purpose and the requests are +generally approved on a weekly basis. Feel free to continue to step :two: while waiting for approval. + +> **Note** The requests are reviewed manually, checking the GitHub profile activity of the requester to avoid any misuse of the service. +> All interactions are subject to the expectations of the [code of conduct](../code_of_conduct.md). Any misuse or inappropriate behavior +> are subject to the same principals. + +When submitting a pull request for the first time, you will be prompted to sign the [CLA](../CONTRIBUTOR_LICENSE_AGREEMENT.md) for your +code contributions. You can view your signed CLA's by going to and signing in. + +## Inactivity and user removal + +For security reasons related to the CI, when a user no longer contributes for a long period, it will be considered inactive and removed from the authorized user's list. +For now, it's configured for **4 months**, and it's computed based on the latest commit, not comments or opened issues. +After that time, the CI bot will ask to remove the user name from the authorized users' list through the access request PR, which occurs a few times every week. + +When you are interested in contributing again, simply ask again to be included in the [issue #4](https://github.com/conan-io/conan-center-index/issues/4). +The process will be precisely like for newcomers. + +## :two: Creating a package + +Once you've successfully built an existing recipe following [developing recipes](../developing_recipes_locally.md) tutorial. +You are set to being adding a new package. + +Make sure you have: + +* Forked and then cloned the [conan-center-index](https://github.com/conan-io/conan-center-index) git repository. +* Make sure you are using a recent [Conan client](https://conan.io/downloads) version, as recipes improve by introducing features of the newer Conan releases. + +The easiest way to start is copying a template from our [`package_templates/`](../package_templates) folder to the [`recipes/`](../../recipes/) folder. +Rename the new folder following the [project name](conanfile_attributes.md#name) guidelines. Read templates [documentation](../package_templates/README.md) +to find more information. + +Quickly, there's a few items to look at: + +* Add _only_ the latest version in the [`config.yml`](folders_and_files.md#configyml) and [`conandata.yml`](folders_and_files.md#conandatayml) +* Make sure to update the [`ConanFile` attributes](conanfile_attributes.md) like `license`, `description`, etc... + +In ConanCenter, our belief is recipes should always match upstream, in other words, what the original author(s) intended. + +* Options should [follow these recommendations](conanfile_attributes.md#options) as well as match the default value used by the upstream project. +* [Package information](build_and_package.md), libraries, components should match as well. This includes exposing supported build system names. + +Where dependencies are involved, there's no shortcuts, inspect the upstream's build scripts for how they are usually consumed. Pick the Conan +generator that matches. The most common example is CMake's `find_package` that can be satisfied by Conan's +[`CMakeDeps`](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html) generator. There are a few +things to be cautious about, many projects like to "vendor" other projects within them. This can be files checked into the repository or +downloaded during the build process. These should be removed, see the [Dependencies section](dependencies.md#handling-internal-dependencies) +for more information. + +### How to provide a good recipe + +Take a look at existing [recipes](https://github.com/conan-io/conan-center-index/tree/master/recipes) available in ConanCenterIndex which can be +used as good examples, you can use them as the base for your recipe. The GitHub search is very good for matching code snippets, you can see if, +how or when a function is used in other recipes. + +> **Note**: Conan features change over time and our best practices evolve so some minor details may be out of date due to the vast number of recipes. + +More often than not, ConanCenter recipes are built in more configuration than the upstream project. This means some edge cases need minor tweaks. +We **strongly encourage** everyone to contribute back to the upstream project. This reduces the burden of re-applying patches and overall makes the +the code more accessible. + +Read the docs! The [FAQs](../faqs.md) are a great place to find short answers. +The documents in this folder are written to explain each folder, file, method, and attribute. + +1. [Folders and Files](folders_and_files.md) +2. [Sources and Patches](sources_and_patches.md) + 1. [`conandata.yml` format](conandata_yml_format.md) +3. [`ConanFile` Attributes](conanfile_attributes.md) +4. [Dependencies](dependencies.md) +5. [Build and Package](build_and_package.md) + 1. [Revisit Patches](sources_and_patches.md#policy-about-patching) +6. [Test Package](test_packages.md) + +The one place you are certain to find a lot of information is , this has the documentation for everything in Conan. +There are helpful tutorials for cross-build, detailed explication for profiles and settings and much much more! + +## :three: Submitting a Package + +To contribute a package, you can submit a [Pull Request](https://github.com/conan-io/conan-center-index/pulls) to this GitHub +repository . + +The specific steps to submitting changes are: + +* Build and test the new recipe in several combinations. Check [developing recipes](../developing_recipes_locally.md) for tips. +* [Commit and push to your fork repository](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) then + [submit a pull request](https://github.com/conan-io/conan-center-index/compare). +* Our automated [build service](#the-build-service) will build 100+ different configurations, and provide messages that indicate if there + were any issues found during the pull request on GitHub. + +When the pull request is [reviewed and merged](../review_process.md), those packages are published to [JFrog's ConanCenter](https://conan.io/center/) +and are made available for everyone. + +## The Build Service + +The **build service** associated to this repository will generate binary packages automatically for the most common platforms and compilers. +See [the Supported Platforms and Configurations page](../supported_platforms_and_configurations.md) for a list of generated configurations. +For a C++ library, the system is currently generating more than 100 binary packages. + +> **Note**: This not a testing service, it is a binary building service for **released** packages. Unit tests shouldn't be built nor run in recipes by default, see the [FAQs](../faqs.md#why-conancenter-does-not-build-and-execute-tests-in-recipes) for more. Before submitting a pull request, please ensure that it works locally for some configurations. + +* The CI bot will start a new build only [after the author is approved](#one-request-access). Your PR may be reviewed in the mean time, but is not guaranteed. +* The CI system will also report errors and build logs by creating a comment in the pull-request, the message will include links to the logs for inspecting. +* The Actions are used to lint and ensure the latest conventions are being used. You'll see comments from bots letting you know. + +Packages generated and uploaded by this build service do not include any _user_ or _channel_ (we generally recommend using `@user/channel` for private package +repositories as an easy way to distinguish them from public ones). Once the packages are uploaded, you will be able to install them using the reference as +`name/version` so example `conan install fmt/9.1.0@` for 1.x client or `conan install --requires=fmt/9.1.0` for 2.x clients. diff --git a/docs/adding_packages/build_and_package.md b/docs/adding_packages/build_and_package.md new file mode 100644 index 0000000000000..a64769f6e6b52 --- /dev/null +++ b/docs/adding_packages/build_and_package.md @@ -0,0 +1,112 @@ +# Build and Package + +This document gathers all the relevant information regarding the general lines to follow while writing either the `build()` or the `package()` methods. +Both methods often use build helpers to build binaries and install them into the `package_folder`. + + +## Contents + + * [Build Method](#build-method) + * [Package Method](#package-method) + * [Build System Examples](#build-system-examples) + * [Header Only](#header-only) + * [CMake](#cmake) + * [Autotools](#autotools) + * [No Upstream Build Scripts](#no-upstream-build-scripts) + * [System Packages](#system-packages) + +## Build Method + +* `build()` method should focus on build only, not installation. During the build, nothing should be written in `package` folder. Installation step should only occur in `package()` method. + +* The build itself should only rely on local files. Nothing should be downloaded from the internet during this step. If external files are required, they should come from `requirements` or `build_requirements` in addition to source files downloaded in `source()` or coming from the recipe itself through `export()` or `export_sources()`. + +* Except for CMake, a working build toolchain (compiler, linker, archiver, etc.), and a "native generator" (`make` on *nix platforms, `mingw32-make` for MinGW, `MSBuild`/`NMake` for Visual Studio), the recipe should not assume that any other build tool is installed on the user-build machine (like Meson, autotools, or pkg-config). On Windows, the recipe should not assume that a shell is available (like MSYS2). Therefore, if the build method requires additional tools, they should be added to `build_requirements()`. + Tools explicitly marked as available by users through conf like `tools.gnu:make_program`, `tools.gnu:pkg_config`, `tools.microsoft.bash:path`, `tools.microsoft.bash:subsystem` should be taken into account to conditionally inject a build requirement (these conf should have precedence over build requirement equivalent hardcoded in the recipe). + +* It is forbidden to run other conan client commands during build. In other words, if upstream build files call conan under the hood (through `cmake-conan` for example or any other logic), this logic must be removed. + +* Settings from profile should be honored (`build_type`, `compiler.libcxx`, `compiler.cppstd`, `compiler.runtime` etc). + +* Compiler paths from host profile should be honored and properly propagated to underlying build system during the build: + + | compiler type | conf / env var | + |---------------|----------------| + | C compiler | `c` key of `tools.build:compiler_executables`, otherwise `CC` environment variable | + | C++ compiler | `cpp` key of `tools.build:compiler_executables`, otherwise `CXX` environment variable | + | ASM compiler | `asm` key of `tools.build:compiler_executables`, otherwise `CCAS` environment variable | + | CUDA compiler | `cuda` key of `tools.build:compiler_executables` | + | Fortran compiler | `fortran` key of `tools.build:compiler_executables`, otherwise `FC` environment variable | + | Objective-C compiler | `objc` key of `tools.build:compiler_executables` | + | Objective-C++ compiler | `objcpp` key of `tools.build:compiler_executables` | + | Resource files compiler | `rc` key of `tools.build:compiler_executables`, otherwise `RC` environment variable | + | Archiver | `AR` environment variable | + | Linker | `LD` environment variable | + + They should be curated on the fly if underlying build system expects a specific format (no spaces in path, forward slash instead of back slash, etc). + +* These compiler and linker conf from host profile should be honored and propagated to underlying build system during the build: + * `tools.build:cflags` + * `tools.build:cxxflags` + * `tools.build:defines` + * `tools.build:sharedlinklags` + * `tools.build:exelinkflags` + * `tools.apple:enable_bitcode` (only if host OS is `iOS`/`watchOS`/`tvOS`) + +* Multithread build (if supported by underlying build system): + * if some steps are sensitive to race conditions, monothread should be enforced. + * otherwise multithreaded build should be enabled with a number of cores controlled by `tools.build:jobs` conf from host profile if it is set, otherwise to all cores of build machine. + +## Package Method + +* CMake config files must be removed. They will be generated for consumers by `CMakeDeps` generator (or legacy `cmake_find_package`/`cmake_find_package_multi` generators). + +* pkg-config files must be removed. They will be generated for consumers by `PkgConfigDeps` generator (or legacy `pkg_config` generator). + +* On *nix systems, executables and shared libraries should have empty `RPATH`/`RUNPATH`/`LC_RPATH`. Though, a relative path pointing inside package itself is allowed. + +* On Apple OS family: + * shared libs: name field of `LC_ID_DYLIB` load command must be `@rpath/`. + * shared libs & executables: name field of each `LC_LOAD_DYLIB` load command should be `@rpath/` (except those refering to system libs or frameworks). + +* Installed files must not contain absolute paths specific to build machine. Relative paths to other packages is also forbidden since relative paths of dependencies during build may not be the same for consumers. Hardcoded relative paths pointing to a location in the package itself are allowed. + +* Static and shared flavors of the same library must not be packaged together. + +## Build System Examples + +The [Conan's documentation](https://docs.conan.io) is always a good place for technical details. +General patterns about how they can be used for OSS in ConanCenterIndex can be found in the +[package templates](../package_templates/README.md) sections. These are excellent to copy and start from. + +### Header Only + +If you are looking for header-only projects, you can take a look on [header-only template](../package_templates/header_only). +Also, Conan Docs have a section about [how to package header-only libraries](https://docs.conan.io/1/howtos/header_only.html). + +### CMake + +For C/C++ projects which use CMake for building, you can take a look on [cmake package template](../package_templates/cmake_package). + +Another common use case for CMake based projects, both header only and compiled, is _modeling components_ to match the `find_package` and export the correct targets from Conan's generators. A basic examples of this is [cpu_features](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpu_features/all/conanfile.py), a moderate/intermediate example is [cpprestsdk](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpprestsdk/all/conanfile.py), and a very complex example is [OpenCV](https://github.com/conan-io/conan-center-index/blob/master/recipes/opencv/4.x/conanfile.py). + +### Autotools + +There is an [autotools package template](../package_templates/autotools_package/) amiable to start from. + +However, if you need to use autotools for building, you can take a look on [libalsa](https://github.com/conan-io/conan-center-index/blob/master/recipes/libalsa/all/conanfile.py), [kmod](https://github.com/conan-io/conan-center-index/blob/master/recipes/kmod/all/conanfile.py), [libcap](https://github.com/conan-io/conan-center-index/blob/master/recipes/libcap/all/conanfile.py). + +Many projects offer [**pkg-config**'s](https://www.freedesktop.org/wiki/Software/pkg-config/) `*.pc` files which need to be modeled using components. A prime example of this is [Wayland](https://github.com/conan-io/conan-center-index/blob/master/recipes/wayland/all/conanfile.py). + +### No Upstream Build Scripts + +For cases where a project only offers source files, but not a build script, you can add CMake support, but first, contact the upstream and open a PR offering building support. If it's rejected because the author doesn't want any kind of build script, or the project is abandoned, CCI can accept your build script. Take a look at [Bzip2](https://github.com/conan-io/conan-center-index/blob/master/recipes/bzip2/all/CMakeLists.txt) and [DirectShowBaseClasses](https://github.com/conan-io/conan-center-index/blob/master/recipes/directshowbaseclasses/all/CMakeLists.txt) as examples. + +### System Packages + +> **Note**: For exceptional cases where only system packages can be used and a regular Conan package may result in an incompatible and fragile package, a separated system package may be created. See the [FAQs](../faqs.md#can-i-install-packages-from-the-system-package-manager) for more. + +The [SystemPackageTool](https://docs.conan.io/1/reference/conanfile/methods.html#systempackagetool) can easily manage a system package manager (e.g. apt, +pacman, brew, choco) and install packages which are missing on Conan Center but available for most distributions. It is key to correctly fill in the `cpp_info` for the consumers of a system package to have access to whatever was installed. + +As example there is [xorg](https://github.com/conan-io/conan-center-index/blob/master/recipes/xorg/all/conanfile.py). Also, it will require an exception rule for [conan-center hook](https://github.com/conan-io/hooks#conan-center), a [pull request](https://github.com/conan-io/hooks/pulls) should be open to allow it over the KB-H032. diff --git a/docs/adding_packages/conandata_yml_format.md b/docs/adding_packages/conandata_yml_format.md new file mode 100644 index 0000000000000..e1b7f89ee3173 --- /dev/null +++ b/docs/adding_packages/conandata_yml_format.md @@ -0,0 +1,243 @@ +# conandata.yml + +[conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) is a [YAML](https://yaml.org/) +file to provide declarative data for the recipe (which is imperative). This is a built-in Conan feature (available since +1.22.0) without a fixed structure, but ConanCenter has a specific format to ensure quality of recipes. + +In the context of ConanCenterIndex, this file is _mandatory_ and consists of two main sections that will be explained in the +next sections with more detail: + +* `sources`: Library sources origin with their verification checksums. +* `patches`: A list of patches to apply and supporting information. See the [Patching Policy](sources_and_patches.md#policy-about-patching) for the criteria. + + +## Contents + + * [sources](#sources) + * [Mirrors](#mirrors) + * [Multiple Assets](#multiple-assets) + * [Different source archives per configuration](#different-source-archives-per-configuration) + * [Sources fields](#sources-fields) + * [url](#url) + * [sha256](#sha256) + * [patches](#patches) + * [Patches fields](#patches-fields) + * [patch_file](#patch_file) + * [patch_description](#patch_description) + * [patch_type](#patch_type) + * [official](#official) + * [vulnerability](#vulnerability) + * [portability](#portability) + * [conan](#conan) + * [bugfix](#bugfix) + * [patch_source](#patch_source) + * [base_path](#base_path) + +## sources + +`sources` is a top level dictionary, containing entries of sources and checksums for each of the supported versions. + +This is the entry that contains all the items that are downloaded from the internet and used in a recipe. This section contains one entry per version and each version should declare its own sources. + +> **Note**: For deciding which source to pick, see [Picking Sources](sources_and_patches.md#picking-the-sources) guide. + +This is a basic example of a regular library, it should satisfy most of the use cases: + +```yml +sources: + "1.2.11": + url: "..." + sha256: "..." + "1.2.12": + url: "..." + sha256: "..." +``` + +Every entry for a version consists in a dictionary with the `url` and the hashing algorithm of the artifact. `sha256` is required, but others like `sha1` or `md5` can be used as well. + +### Mirrors + +Sometimes it is useful to declare mirrors, use a list in the `url` field. Conan will try to download the artifacts from any of those mirrors. + +```yml +sources: + "1.2.11": + url: + - "https://zlib.net/zlib-1.2.11.tar.gz", + - "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz", + sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" +``` + +Keep in mind all the mirrors have to provide the exactly same source (e.g. no repackaging), thus using the same hash sum. + +### Multiple Assets + +It's rare but some projects ship archives missing files that are required to build or specifically to ConanCenter requirements. +You can name each asset and download them in the `conanfile.py`'s `source()` referring to the names. + +```yml +sources: + "10.12.2": + "sources": + url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.2/ApprovalTests.v.10.12.2.hpp + sha256: 4c43d0ea98669e3d6fbb5810cc47b19adaf88cabb1421b488aa306b08c434131 + "license": + url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.12.2/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 +``` + +You can list as many assets you need and reference them by their index. But make sure you keep them in order if there is any specific +logic about handling. + +```yml +sources: + "10.12.2": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.2/ApprovalTests.v.10.12.2.hpp + sha256: 4c43d0ea98669e3d6fbb5810cc47b19adaf88cabb1421b488aa306b08c434131 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.12.2/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 +``` + +#### Different source archives per configuration + +This is the most advanced and sophisticated use-case, but not so common. Some projects may provide different sources for different platforms, it could be expressed as: + +```yml +sources: + "0066": + "Macos": # Operating system + "x86": # Architecture + - url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/MacIntel_OSX_AppleC_32bit/packages/cspice.tar.Z" + sha256: "9a4b5f674ea76821c43aa9140829da4091de646ef3ce40fd5be1d09d7c37b6b3" + "x86_64": + - url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0066/C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z" + sha256: "f5d48c4b0d558c5d71e8bf6fcdf135b0943210c1ff91f8191dfc447419a6b12e" +``` + +This approach requires a special code within [build](https://docs.conan.io/1/reference/conanfile/methods.html#build) method to handle. + +### Sources fields + +#### url + +`url` contains a string specifying [URI](https://tools.ietf.org/html/rfc3986) where to download released sources. +Usually, `url` has a [https](https://tools.ietf.org/html/rfc2660) scheme, but other schemes, such as [ftp](https://tools.ietf.org/html/rfc959) are accepted as well. + +#### sha256 + +[sha256](https://tools.ietf.org/html/rfc6234) is a preferred method to specify hash sum for the released sources. It allows to check the integrity of sources downloaded. +You may use an [online service](https://hash.online-convert.com/sha256-generator) to compute `sha256` sum for the given `url`. +Also, you may use [sha256sum](https://linux.die.net/man/1/sha256sum) command ([windows](http://www.labtestproject.com/files/win/sha256sum/sha256sum.exe)). + +## patches + +Sometimes sources provided by project require patching for various reasons. The `conandata.yml` file is the right place to indicate this information as well. + +> **Note**: Under our mission to ensure quality, patches undergo extra scrutiny. **Make sure to review** our +> [Patching Policy](sources_and_patches.md#policy-about-patching) to understand the requirements before adding any. + +This section follows the same pattern as the `sources` above - one entry per version with a list of patches to apply. + +```yaml +patches: + "1.2.0": + - patch_file: "patches/1.2.0-002-link-core-with-find-library.patch" + patch_description: "Link CoreFoundation and CoreServices with find_library" + patch_type: "portability" + patch_source: "https://a-url-to-a-pull-request-mail-list-topic-issue-or-question" +``` + +### Patches fields + +Theres are necessary for Conan to work as well as provide key information to reviewers and consumers which need to understand +the reasoning behind patches. + +#### patch_file + +_Required_ + +Patch file that are committed to the ConanCenterIndex, go into the `patches` sub-directory (next to the `conanfile.py`). Such patch files usually have either `.diff` or `.patch` extension. The recommended way to generate such patches is [git format-patch](https://git-scm.com/docs/git-format-patch). The path to the patch is relative to the directory containing `conandata.yml` and `conanfile.py`. + +#### patch_description + +_Required_ + +`patch_description` is an arbitrary text describing the following aspects of the patch: + +* What does patch do (example - `add missing unistd.h header`) +* Why is it necessary (example - `port to Android`) +* How exactly does patch achieve that (example - `update configure.ac`) + +An example of a full patch description could be: `port to Android: update configure.ac adding missing unistd.h header`. + +#### patch_type + +_Required_ + +The `patch_type` field specifies the type of the patch. In ConanCenterIndex we currently accept only several kind of patches: + +##### official + +`patch_type: official` indicates the patch is distributed with source code itself. usually, this happens if release managers +failed to include a critical fix to the release, but it's too much burden for them to make a new release just because of that single fix. +[example](https://www.boost.org/users/history/version_1_72_0.html) (notice the `coroutine` patch). The [`patch_source`](#patch_source) +field shall point to the official distribution of the patch. + +##### vulnerability + +`patch_type: vulnerability`: Indicates a patch that addresses the security issue. The patch description should include the index of CVE +or CWE the patch addresses. Usually, original library projects do new releases fixing vulnerabilities for this kind of issues, but in some +cases they are either abandoned or inactive. The [`patch_source`](#patch_source) must be a commit to the official fix of the vulnerability. + +##### portability + +`patch_type: portability`: Indicates a patch that improves the portability of the library, e.g. adding supports of new architectures (ARM, Sparc, etc.), operating systems (FreeBSD, Android, etc.), compilers (Intel, MinGW, etc.), and other types of configurations which are not originally supported by the project. +In such cases, the patch could be adopted from another package repository (e.g. MSYS packages, Debian packages, Homebrew, FreeBSD ports, etc.). +Patches of this kind are preferred to be submitted upstream to the original project repository first, but it's not always possible. +Some projects simply do not accept patches for platforms they don't have a build/test infrastructure, or maybe they are just either abandoned or inactive. + +##### conan + +`patch_type: conan`: Indicates a patch that is Conan-specific, patches of such kind are usually not welcomed upstream at all, because they provide zero value outside of Conan. +Examples of such a patches may include modifications of build system files to allow dependencies provided by Conan instead of dependencies provided by projects themselves (e.g. as submodule or just 3rd-party sub-directory) or by the system package manager (rpm/deb). +Such patches may contain variables and targets generated only by Conan, but not generated normally by the build system (e.g. `CONAN_INCLUDE_DIRS`). + +##### bugfix + +> **Warning**: These will undergo extra scrutiny during review as they may modify the source code. + +`patch_type: bugfix`: Indicates a patch that backports an existing bug fix from the newer release or master branch (or equivalent, such as main/develop/trunk/etc). The [`patch_source`](#patch_source) may be a pull request, or bug within the project's issue tracker. +Backports are accepted only for bugs that break normal execution flow, never for feature requests. +Usually, the following kind of problems are good candidates for backports: + +* Program doesn't start at all. +* Crash (segmentation fault or access violation). +* Hang up or deadlock. +* Memory leak or resource leak in general. +* Garbage output. +* Abnormal termination without a crash (e.g. just exit code 1 at very beginning of the execution). +* Data corruption. +* Use of outdated or deprecated API or library. + +As sources with backports don't act exactly the same as the version officially released, it may be a source of confusion for the consumers who are relying on the buggy behavior (even if it's completely wrong). Therefore, it's required to introduce a new `cci.` version for such backports, so consumers may choose to use either official version, or modified version with backport(s) included. + +#### patch_source + +_Recommended_ + +`patch_source` is the URL from where patch was taken from. https scheme is preferred, but other URLs (e.g. git/svn/hg) are also accepted if there is no alternative. Types of patch sources are: + +* Link to the public commit in project hosting like GitHub/GitLab/BitBucket/Savanha/SourceForge/etc. +* Link to the Pull Request or equivalent (e.g. gerrit review). +* Link to the bug tracker (such as JIRA, BugZilla, etc.). +* Link to the mail list discussion. +* Link to the patch itself in another repository (e.g. MSYS, Debian, etc.). + +For the `patch_type: portability` there might be no patch source matching the definition above. Although we encourage contributors to submit all such portability fixes upstream first, it's not always possible (e.g. for projects no longer maintained). In that case, a link to the Conan issue is a valid patch source (if there is no issue, you may [create](https://github.com/conan-io/conan-center-index/issues/new/choose) one). +For the `patch_type: conan`, it doesn't make sense to submit patch upstream, so there will be no patch source. + +#### base_path + +_Optional_ + +Specifies a sub-directory in project's sources to apply patch. This directory is relative to the [source_folder](https://docs.conan.io/1/reference/conanfile/attributes.html?highlight=source_folder#source-folder). Usually, it would be a `source_subfolder`, but could be a lower-level sub-directory (e.g. if it's a patch for a submodule). diff --git a/docs/adding_packages/conanfile_attributes.md b/docs/adding_packages/conanfile_attributes.md new file mode 100644 index 0000000000000..37395fdd866c3 --- /dev/null +++ b/docs/adding_packages/conanfile_attributes.md @@ -0,0 +1,193 @@ +# `ConanFile` Attributes + +The `ConanFile` class has a lot of different properties that can help consumers search for projects, help the client build packages for different configurations +or are known by ConanCenter's build service and have special meaning. + + +## Contents + + * [Attributes](#attributes) + * [Name](#name) + * [Version](#version) + * [ConanCenter specific releases format](#conancenter-specific-releases-format) + * [License Attribute](#license-attribute) + * [Order of methods and attributes](#order-of-methods-and-attributes) + * [Settings](#settings) + * [Options](#options) + * [Recommended Names](#recommended-names) + * [Predefined Options and Known Defaults](#predefined-options-and-known-defaults) + * [Options to Avoid](#options-to-avoid) + +## Attributes + +These are a [key feature](https://docs.conan.io/1/reference/conanfile/attributes.html) which allow the Conan client to understand, +identify, and expose recipes and which project they expose. + +In ConanCenter, there are a few conventions that need to be respected to ensure recipes can be discovered there `conan search` command +of through the web UI. Many of which are enforces with the [hooks](../error_knowledge_base.md). + +### Name + +Same as the _recipe folder_ and always lowercase. + +Please see the FAQs for: + +* [name collisions](../faqs.md#what-is-the-policy-on-recipe-name-collisions) +* [space and symbols](../faqs.md#should-reference-names-use---or-_) + +### Version + +ConanCenter is geared towards quickly added new release, the build service always pass the version it is currently building to the recipe. +The `version` attribute MUST NOT be added to any recipe - with exception to "system packages". + +#### ConanCenter specific releases format + +The notation shown below is used for publishing packages which do not match the original library's official releases. This format which includes the "datestamp" corresponding to the date of a commit: `cci.`. + +In order to create reproducible builds, we also "commit-lock" to the latest commit on that day. Otherwise, users would get inconsistent results over time when rebuilding the package. An example of this is the [RapidJSON](https://github.com/Tencent/rapidjson) library, where its package reference is `rapidjson/cci.20200410` and its sources are locked the latest commit on that date in [config.yml](https://github.com/conan-io/conan-center-index/blob/master/recipes/rapidjson/config.yml#L4). The prefix `cci.` is mandatory to distinguish as a virtual version provided by CCI. If you are interested to know about the origin, please, read [here](https://github.com/conan-io/conan-center-index/pull/1464). + +### License Attribute + +The mandatory license attribute of each recipe **should** be a [SPDX license](https://spdx.org/licenses/) [short Identifiers](https://spdx.dev/ids/) when applicable. + +Where the SPDX guidelines do not apply, packages should do the following: + +* When no license is provided or it's under the ["public domain"](https://fairuse.stanford.edu/overview/public-domain/welcome/) - these are not a license by itself. Thus, we have [equivalent licenses](https://en.wikipedia.org/wiki/Public-domain-equivalent_license) that should be used instead. If a project falls under these criteria it should be identified as the [Unlicense](https://spdx.org/licenses/Unlicense) license. +* When a custom (e.g. project specific) license is given, the value should be set to `LicenseRef-` as a prefix, followed by the name of the file which contains the custom license. See [this example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/fft/all/conanfile.py#L8). For more details, [read this conversation](https://github.com/conan-io/conan-center-index/pull/4928/files#r596216206). + + +## Order of methods and attributes + +Prefer the following order of documented methods in python code (`conanfile.py`, `test_package/conanfile.py`): + +For `conan create` the order is listed [here](https://docs.conan.io/1/reference/commands/creator/create.html#methods-execution-order) +test packages recipes should append the following methods: + +* deploy +* test + +the order above resembles the execution order of methods on CI. therefore, for instance, `build` is always executed before `package` method, so `build` should appear before the +`package` in `conanfile.py`. + +## Settings + +As a general rule, recipes should set the `settings` attribute to: `os`, `arch`, `compiler` and `build_type`, and let Conan compute the package ID based on the settings. Some exceptions apply, as detailed below. For cases not covered here, please reach out to the Conan Center maintainers team for assistance. The following list is not exhaustive: + +* **Recipes for _header only_ libraries** or where the contents of the package are the same irrespective of settings, might omit the `settings` attribute altogether, unless there is any logic conditional on a setting value. If the recipe has options or dependencies, but the contents of the package are invariant irrespective of their values, the following logic must be added to ensure a single, unique package ID: + + ```python + def package_id(self): + self.info.clear() + ``` + +* **Recipes that primarily provide _compiled_ applications** (e.g. `b2`, `cmake`, `make`, ...), which typically applies to packages that are consumed as _tool requires_) must list all + the settings as well, as they are required during package creation. However, it is advised that the `compiler` setting is removed one in the `package_id()` method as follows: + + ```python + def package_id(self): + del self.info.settings.compiler + ``` + + This reflects those cases where tools are consumed exclusively as executables, irrespective of how they were built. Additionally, this reduces the number of configurations generated by CI. + + > **Note** We do not recommend removing the `build_type` setting on these packages, in order to preserve the ability of consumers to run debug executables should they wish to do so. + +## Options + +Recipes can list any number of options with any meaning, and defaults are up to the recipe itself. The CI cannot enforce anything +in this direction. However, there are a couple of options that have a special meaning for the CI. + +### Recommended Names + +Adding options is often needed to toggle specific library features on/off. Regardless of the default, there is a strong preference for using positive naming for options. In order to avoid the fragmentation, we recommend using the following naming conventions for such options: + +* enable_ / disable_ +* with_ / without_ +* use_ + +The actual recipe code then may look like: + +```py + options = {"enable_locales": [True, False]} # Changes which files are compiled in to the library + default_options = {"enable_locales": True} +``` + +```py + options = {"with_zlib": [True, False]} # Will add a `self.requires` with more deps to link against + default_options = {"with_zlib": True} +``` + +```py + options = {"use_tzdb": [True, False]} # Might install more headers to expose more features + default_options = {"use_tzdb": True} +``` + +Having the same naming conventions for the options helps consumers. It allows users to specify options with wildcards: `-o *:with_threads=True`. Therefore, the `with_threads` options will be enabled for all packages in the graph that support it. + +### Predefined Options and Known Defaults + +ConanCenter supports many combinations, these are outline in the [supported configurations](../supported_platforms_and_configurations.md) document for each platform. +By default recipes should use `shared=False` with `fPIC=True`. If support, `header_only=False` is the default. + +Usage of each option should follow the rules: + +* `shared` (with values `True` or `False`). The CI inspects the recipe looking for this option. The **default should be `shared=False`** and will + generate all the configurations with values `shared=True` and `shared=False`. + + > **Note**: The CI applies `shared=True` only to the package being built, while every other requirement will `shared=False`. To consume everything as a shared library you will set `--build=always` and/or `-o *:shared=True`) + > It's important to keep this in mind when trying to consume shared packages from ConanCenter + > as their requirements were linked inside the shared library. See [FAQs](../faqs.md#how-to-consume-a-graph-of-shared-libraries) for more information. + +* `fPIC` (with values `True` or `False`). The **default should be `fPIC=True`** and will generate all the configurations with values `fPIC=True` and `fPIC=False`. + This option does not make sense on all the support configurations so it should be removed. + + ```python + 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") + ``` + +* `header_only` (with values `True` or `False`). The **default should be `header_only=False`**. If the CI detects this option, it will generate all the + configurations for the value `header_only=False` and add one more configuration with `header_only=True`. **Only one package** + will be generated for `header_only=True`, so it is crucial that the package is actually a _header only_ library, with header files only (no libraries or executables inside). + + Recipes with such option should include the following in their `package_id` method + + ```python + def package_id(self): + if self.options.header_only: + self.info.clear() + ``` + + ensuring that, when the option is active, the recipe ignores all the settings and only one package ID is generated. + +### Options to Avoid + +* `build_testing` should not be added, nor any other related unit test option. Options affect the package ID, therefore, testing should not be part of that. + Instead, use Conan config [skip_test](https://docs.conan.io/1/reference/config_files/global_conf.html#tools-configurations) feature: + + ```python + def generate(self): + tc = CMakeToolChain(self) + tc.variables['BUILD_TESTING'] = not self.conf.get("tools.build:skip_test", default=true, check_type=bool) + ``` + + The `skip_test` configuration is supported by [CMake](https://docs.conan.io/1/reference/build_helpers/cmake.html#test) and [Meson](https://docs.conan.io/1/reference/build_helpers/meson.html#test). + + ### Removing from `package_id` + + By default, options are included in the calculation for the `package_id` ([docs](https://docs.conan.io/1/reference/conanfile/methods.html#package-id)). + Options which do not impact the generated packages should be deleted, for instance adding a `#define` for a package. + + ```python +def package_id(self): + del self.info.options.enable_feature + +def package_info(self): + if self.options.enable_feature: + self.cpp_info.defines.append("FOBAR_FEATURE=1") +``` diff --git a/docs/adding_packages/dependencies.md b/docs/adding_packages/dependencies.md new file mode 100644 index 0000000000000..a45c6c0f3c31c --- /dev/null +++ b/docs/adding_packages/dependencies.md @@ -0,0 +1,195 @@ +# Dependencies + +This section outlines all the practices and guidelines for the `requirements()` and `build_requirements()` methods. This includes everything +from handling "vendored" dependencies to what versions should be used. + + +## Contents + + * [List Dependencies](#list-dependencies) + * [Optional Requirements](#optional-requirements) + * [Build Requirements](#build-requirements) + * [Accessing Dependencies](#accessing-dependencies) + * [Handling Requirement's Options](#handling-requirements-options) + * [Verifying Dependency's Version](#verifying-dependencys-version) + * [Passing Requirement's info to `build()`](#passing-requirements-info-to-build) + * [Overriding the provided properties from the consumer](#overriding-the-provided-properties-from-the-consumer) + * [Adherence to Build Service](#adherence-to-build-service) + * [Version Ranges](#version-ranges) + * [Handling "internal" dependencies](#handling-internal-dependencies) + +## List Dependencies + +Since all ConanCenterIndex recipes are to build and/or package projects they are exclusively done in [`conanfile.py`](https://docs.conan.io/1/reference/conanfile.html). This offers a few +ways to add requirements. The most common way is [requirements](https://docs.conan.io/1/reference/conanfile/methods.html#requirements): + +```py + def requirements(self): + self.requires("fmt/9.1.0") +``` + +> **Note**: With Conan 2.0, you'll also need to pay attention to new properties like the `transitive_header` attributed which is +> needed when a project include a dependencies header files in its public headers. + +When a project supports a range of version of a dependency, it's generally advised to pick the **most recent available in ConanCenter**. +This helps ensure there are fewer conflicts with other, up to-date, recipes that share the same requirement. + +### Optional Requirements + +Many projects support enabling certain features by adding dependencies. In ConanCenterIndex this is done by adding an option, see +[naming recommendation](conanfile_attributes.md#recommended-names), which should be set to match the upstream project's by default. + +```py +class ExampleConan(ConanFile): + options = { + "with_zlib": [True, False], # Possible values + } + default_options = { + "with_zlib": True, # Should match upstream's CMakeLists.txt `option(...)` + } + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") +``` + +If a dependency was added (or removed) with a release, then the `if` condition could check [`self.version`](https://docs.conan.io/1/reference/conanfile/attributes.html#version). Another common case is +`self.settings.os` dependant requirements which need to be added for certain plaforms. + +### Build Requirements + +In ConanCenter we only assume +[CMake is available](../faqs.md#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default). +If a project requires any other specific tool, those can be added as well. We like to do this with [build_requirements](https://docs.conan.io/1/reference/conanfile/methods.html#build-requirements): + +```py + def build_requirements(self): + self.tool_requires("ninja/1.1.0") +``` + +## Accessing Dependencies + +It's fairly common to need to pass information from a dependency to the project. This is the job of the [`generate()`](https://docs.conan.io/1/reference/conanfile/methods.html#generate) method. This +is generally covered by the built-in generators like [`CMakeDeps`](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html) +However the [`self.dependencies`](https://docs.conan.io/1/reference/conanfile/dependencies.html?highlight=generate) are available. + +Alternatively, a project may depend on a specific versions or configuration of a dependency. This use case is again covered by the +[`self.dependencies`](https://docs.conan.io/1/reference/conanfile/dependencies.html?highlight=validate) within the +[`validate()`](https://docs.conan.io/1/reference/conanfile/methods.html#validate) method. Additionally it's possible to suggest the option's values while the graph is built through [`configure()`](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options) +this is not guaranteed and not a common practice. + +### Handling Requirement's Options + +Forcing options of dependencies inside a ConanCenter should be avoided, except if it is mandatory for the library to build. +Our general belief is the users input should be the most important; it's unexpected for command line arguments to be over ruled +by specifc recipes. + +You need to use the [`validate()`](https://docs.conan.io/1/reference/conanfile/methods.html#validate) method in order to ensure they check after the Conan graph is completely built. + +Certain projects are dependent on the configuration (also known as options) of a dependency. This can be enforced in a recipe by +accessing the [`options`](https://docs.conan.io/1/reference/conanfile/dependencies.html?highlight=options) field of +the dependency. + +```py + def configure(self): + self.options["foobar"].enable_feature = True # This will still allow users to override this option + + def validate(self): + if not self.dependencies["foobar"].options.enable_feature: + raise ConanInvalidConfiguration(f"{self.ref} requires foobar/*:enable_feature=True.") +``` + +### Verifying Dependency's Version + +Some project requirements need to respect a version constraint, this can be done as follows: + +```py +def validate(self): + if Version(self.dependencies["foobar"].ref.version) < "1.2": + raise ConanInvalidConfiguration(f"{self.ref} requires [foobar>=1.2] to build and work.") +``` + +### Passing Requirement's info to `build()` + +The [`self.dependencies`](https://docs.conan.io/1/reference/conanfile/dependencies.html) are limited to [`generate()`](https://docs.conan.io/1/reference/conanfile/methods.html#generate) and [`validate()`](https://docs.conan.io/1/reference/conanfile/methods.html#validate). This means configuring a projects build scripts +is a touch more complicated when working with unsupported build scripts. + +In general, with [CMake](https://cmake.org/) project, this can be very simple with the [`CMakeToolchain`](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmaketoolchain.html), such as: + +```py + def generate(self): + tc = CMakeToolchain(self) + # deps_cpp_info, deps_env_info and deps_user_info are no longer used + if self.dependencies["dependency"].options.foobar: + tc.variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs +``` + +This pattern can be recreated for less common build system by, generating a script to call configure or capture the +required values in a YAML files for example. + +> **Note**: This needs to be saved to disk because the [`conan install`](https://docs.conan.io/1/reference/commands/consumer/install.html) and [`conan build`](https://docs.conan.io/1/reference/commands/development/build.html) commands can be separated when +> developing packages so for this reason the `class` may not persists the information. This is a very common workflow, +> even used in ConanCenter in other areas such as testing. + +```py +from conan import ConanFile +from conan.tools.files import save, load + + +class ExampleConan(ConanFile): + _optional_build_args = [] + + @property + def _optional_build_args_filename(self): + return os.path.join(self.recipe_folder, self.folders.generators, "build_args.yml") + + def generate(self): + # This is required as `self.dependencies` is not available in `build()` or `test()` + if self.dependencies["foobar"].options.with_compression: + self._optional_build_args.append("--enable-foobar-compression") + + save(self, self._optional_build_args_filename, file) + + def build(self): + opts_args = load(self, self._optional_build_args_filename) + # Some magic setup + self.run(f"./configure.sh {opts_args}") +``` + +### Overriding the provided properties from the consumer + +> **Note**: This was adding in [Conan 1.55](https://github.com/conan-io/conan/pull/12609) to the generators... we need to +> write docs for when that's available + +## Adherence to Build Service + +It's very rare we layout "rules", most often it's guidelines, however in order to ensure graph and the package generated are usable +for consumer, we do impose some limits on Conan features to provide a smoother first taste to using Conan. + +> **Note**: These are very specific to the ConanCenter being the default remote and may not be relevant to your specifc use case. + +* [Version ranges](https://docs.conan.io/1/versioning/version_ranges.html) are generally not allowed (see below for exemption). +* Specify explicit [RREV](https://docs.conan.io/1/versioning/revisions.html) (recipe revision) of dependencies is not allowed. +* Only ConanCenter recipes are allowed in `requires`/`requirements()` and `build_requires`/`build_requirements()`. +* [`python_requires`](https://docs.conan.io/1/reference/conanfile/other.html#python-requires) are not allowed. + +### Version Ranges + +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: + +* 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. + +> **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 +> can user the defunct `--require-override openssl/1.1.1t@` from the command line, or override from the recipe with `self.requires(openssl/1.1.1t, override=True)` +> to ensure a lower version is picked. + +Conan maintainers may introduce this for other dependencies over time. Outside of the cases outlined above, version ranges are not allowed in ConanCenter recipes. + +## Handling "internal" dependencies + +Vendoring in library source code should be removed (best effort) to avoid potential ODR violations. If upstream takes care to rename +symbols, it may be acceptable. diff --git a/docs/adding_packages/folders_and_files.md b/docs/adding_packages/folders_and_files.md new file mode 100644 index 0000000000000..0136f36792b5b --- /dev/null +++ b/docs/adding_packages/folders_and_files.md @@ -0,0 +1,192 @@ +# Folder and Files Structure + +ConanCenterIndex has a specific structure for its recipes, this allows the [build service](../README.md#the-build-service) +to work most efficiently. + + +## Contents + + * [Recipe File Structure](#recipe-file-structure) + * [`config.yml`](#configyml) + * [The _recipe folder_](#the-_recipe-folder_) + * [`conandata.yml`](#conandatayml) + * [`conanfile.py`](#conanfilepy) + * [`test_package`](#test_package) + +## Recipe File Structure + +Every entry in the `recipes` folder contains all the files required by Conan to create the binaries for all the versions of one library. Those +files don't depend on any other file in the repository (we are not using `python_requires`) and every pull-request can modify only one of those +folders at a time. + +This is the canonical structure of one of these folders, where the same `conanfile.py` recipe is suitable to build all the versions of the library: + +> **Note**: For updating the structure during the [v2 migration](../v2_migration.md) see the [test package](test_packages.md#cmake-targets) document. + +```txt +. ++-- recipes +| +-- library_name/ +| +-- config.yml +| +-- all/ +| +-- conanfile.py +| +-- conandata.yml +| +-- patches/ +| +-- add-missing-string-header-2.1.0.patch +| +-- test_package/ +| +-- conanfile.py +| +-- CMakeLists.txt +| +-- test_pacakge.cpp +``` + +If it becomes too complex to maintain the logic for all the versions in a single `conanfile.py`, it is possible to split the folder `all/` into +more folders, dedicated to different versions, each one with its own `conanfile.py` recipe. In any case, those folders should replicate the +same structure. + +### `config.yml` + +This file lists the versions that should be built along with the corresponding [recipe folder](#the-recipe-folder) that will be used to package the project. + +> **Note**: It's strongly preferred to only have one recipe which should be in the `all/` folder. + +```yml +versions: + # It's encouraged to add new versions on the top + "2.1.0": + folder: all + "2.0.0": + folder: all +``` + +This simple file has the following format: + +* `versions` is a top level dictionary, containing a list of known versions. +* `folder` is a string entry providing the name of the folder, relative to the current directory where the `conanfile.py` that +can package that given folder. + +If it's not possible to maintain one recipe for all version, older version maybe moved to a separate folder. + +```yml +versions: + "2.1.0": + folder: all + "2.0.0": + folder: all + "1.1.1": + folder: 1.x.x # Older version with different build system and options that are not compatible with newer version +``` + +### The _recipe folder_ + +This contains every needed to build packages. + +#### `conandata.yml` + +This file lists **all the sources** that are needed to build the package. The most common examples are +source code, build scripts, license files. + +The file is organized into two sections, `"sources"` and `"patches"`, each one of them contains the files that are required +for each version of the library. Resources which need to be downloaded are listed under `"source"` should include a checksum +to validate that they do not change. This helps to ensure the build is reproducible at a later point in time. Often +modifications are required for a variety of reasons, which ones are associated to which version are listed under the `"patches"`. + +```yml +sources: + "9.0.0": + url: "https://github.com/fmtlib/fmt/archive/9.0.0.tar.gz" + sha256: "9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5" +``` + +For more information about picking source tarballs, adding or removing versions, or what the rules are for patches, continue reading our +[Sources and Patches](sources_and_patches.md) guide. + +> **Note**: Under our mission to ensure quality, patches undergo extra scrutiny. **Make sure to review** our +> [modifying sources policy](sources_and_patches.md#policy-about-patching) before making changes. + +A detailed breakdown of all the fields can be found in [conandata_yml_format.md](conandata_yml_format.md). We **strongly** recommend adding the +[patch fields](conandata_yml_format.md#patches-fields) to help track where patches come from and what issue they solve. + +Inside the `conanfile.py` recipe, this data is available in a `self.conan_data` attribute that can be used as follows: + +```py +def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) +``` + +See the [Export Patches](sources_and_patches.md#exporting-patches) and [Applying Patches](sources_and_patches.md#applying-patches) +for more use cases and examples. + +#### `conanfile.py` + +This file is the recipe, it contains the logic to build the libraries from source for all the configurations. +It's the single most important part of writing a package. Every `conanfile.py` should be accompanied by at least one +[folder to test the generated packages](#test_package). + +Each recipe should derive the `ConanFile` class and implement key attributes and methods. + +* Basic attributes and conversions can be found in [`ConanFile` attributes](conanfile_attributes.md) +* Some of the key methods are outlined in this document and will link to more details + +```python +from conan import ConanFile + +class FmtConan(ConanFile): + name = "fmt" + homepage = "https://github.com/fmtlib/fmt" + # ... +``` + +When a package needs other packages those can be include with the `requirements()` method. + +```python + def requirements(self): + self.require("fmt/9.0.0") +``` + +For more information see the [Dependencies](dependencies.md) documentation. + +For compiled libraries, the `build()` method is used along side the [build helpers](https://docs.conan.io/1/reference/build_helpers.html). +This allows you to use the official build script from a project, see [build and package](build_and_package.md) instructions. + +```python + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() +``` + +Most of the projects with build scripts support installing the important files. Avoid installing documentation or examples. + +```python + def package(self): + cmake = CMake(self) + cmake.configure() + cmake.install() +``` + +For some projects, you will need to manually copy files. +Here's an example for a header only library: + +```python + def package(self): + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) +``` + +#### `test_package` + +All the packages in this repository need to be tested before they join ConanCenter. A `test_package` folder with its +corresponding `conanfile.py` and a minimal project to test the package is strictly required. You can read about it in the +[Conan documentation](https://docs.conan.io/1/creating_packages/getting_started.html) and learn about ConanCenterIndex +specific conventions in [test package](test_packages.md) section. + +The goal for the test package is to make sure the + +* header files are available +* libraries are available to link against +* components are correctly exposed + +> **Note** It's required to verify that the old generators are not broken. You can do so by using the pattern, see +> [KB-H073](../error_knowledge_base.md#kb-h078) for details. + +Remember that the `test_` recipes should **test the package configuration that has just been generated** for the +_host_ context, otherwise it will fail in cross-building scenarios. diff --git a/docs/adding_packages/sources_and_patches.md b/docs/adding_packages/sources_and_patches.md new file mode 100644 index 0000000000000..66f10a1232726 --- /dev/null +++ b/docs/adding_packages/sources_and_patches.md @@ -0,0 +1,199 @@ +# Sources and Patches + +This documents contains everything related to the `source()`. This includes picking sources, where they should come from and goes into when and how to modify sources. +These are a very important aspects and it helps us to establish the quality of the packages offered by ConanCenter. + + +## Contents + + * [Picking the Sources](#picking-the-sources) + * [Source immutability](#source-immutability) + * [Sources not accessible](#sources-not-accessible) + * [Supported Versions](#supported-versions) + * [Removing old versions](#removing-old-versions) + * [Adding old versions](#adding-old-versions) + * [Policy about patching](#policy-about-patching) + * [Format and Conventions](#format-and-conventions) + * [Exporting Patches](#exporting-patches) + * [Applying Patches](#applying-patches) + * [Rules](#rules) + * [Exceptions](#exceptions) + +## Picking the Sources + +This is one of the most important steps when contributing and the quality of the sources directly dictates the quality of the packages produced. +The **origin of sources** should come from an official origin like the library source code repository or the official +release/download webpage. If an official source archive is available, it should be preferred over an auto-generated archive. + +Recipes should always be **built from library sources**. It aims to provide packages that respect the complete setting model of Conan. +Where ever possible, downloading source files and compiling is mandated. Downloading pre-compiled binaries should be avoided. + +### Source immutability + +Downloaded source code must have a deterministic results where the exact same archive is download each time. See +[Conandata's `"sha"` fields](conandata_yml_format.md#sha256) for how this is achieved in ConanCenterIndex. + +The sources stored under `self.source_folder` should not be modified. This will enable local workflows to "keep sources" and avoid extra downloads. +Any patch should be applied to the copy of this source code when a build is executed (basically in `build()` method). See [Applying Patches](#applying-patches) +below for more information. + +### Sources not accessible + +Library sources that are not publicly available will not be allowed in this repository even if the license allows their redistribution. See +our [closed source FAQ answer for more](../faqs.md#how-to-package-libraries-that-depend-on-proprietary-closed-source-libraries). +If library sources cannot be downloaded from their official origin or cannot be consumed directly due to their +format, the recommendation is to contact the publisher and ask them to provide the sources in a way/format that can be consumed +programmatically. + +As a final option, in case you need to use those binaries as a "build require" for some library, we will consider adding it +as a system recipe (`/system`) and making those binaries available in the CI machines (if the license allows it). + +## Supported Versions + +In this repository we are building a subset of all the versions for a given library. This set of version changes over time as new versions +are released and old ones stop being used. + +We always welcome latest releases as soon as they are available, and from time to time we remove old versions mainly due to technical reasons: +the more versions we have, the more resources that are needed in the CI and the more time it takes to build each pull-request (also, the +more chances of failing because of unexpected errors). + +### Removing old versions + +The Conan Team may ask you to remove more if they are taking a lot of resources. When removing old versions, please follow these considerations: + +* keep one version for every major release +* for the latest major release, at least three versions should be available (latest three minor versions) + +Logic associated with removed revisions implies that entries in the `config.yml` and `conandata.yml` files should also be removed. If anyone needs to +recover them in the future, Git contains the full history and changes can be recovered from it. + +Please, note that even if those versions are removed from this repository, **the packages will always be accessible in ConanCenter remote** +associated to the recipe revision used to build them. + +### Adding old versions + +We love to hear why in the opening description of the pull requests you need this exact version. +We usually don't add old versions unless there is a specific request for it. Adding versions that are not used by author of the pull request reduces overall resources and time from [the build services](README.md#the-build-service). + +Take into account that the version might be removed in future pull requests according to the [guidelines above](#removing-old-versions). + +## Policy about patching + +The main guideline in ConanCenter is to provide already compiled binaries for a set of architectures in the least surprising way as possible, so Conan +can be plugged into existing projects trying to minimize the modifications needed. Packages from Conan Center should fulfill the expectations of anyone +reading the changelog of the library, the documentation, or any statement by the library maintainers. + +### Format and Conventions + +Patch files are preferred over programmatic `replace_in_file` statements. This makes it easier to review and prevent +unwanted side effects when new versions are added. They will be listed in [`conandata.yml`](conandata_yml_format.md) +file and exported together with the recipe. Patches must always include [patch fields](conandata_yml_format.md#patches-fields) +which are enforced by the [linters](../../linter/conandata_yaml_linter.py). + +Patches must be located in the recipe folder in a `patches/` sub-directory. + +There are a few recommendations about naming patches: + +* be descriptive but terse +* number them so they can be re-used +* note the specific version + +By clearly indicating what the patch does, when it's applied, and how it relates to existing patches, you can +help make the [review process](../review_process.md) easier for readers and help speed up your pull requests. + +### Exporting Patches + +It's ideal to minimize the number of files in a package to exactly what's required. When recipes support multiple +versions with differing patches, it's strongly encouraged to only export the patches used for that given recipe. + +Make sure the `export_sources` attribute is replaced by +[`conan.tools.files.export_conandata_patches`](https://docs.conan.io/1/reference/conanfile/tools/files/patches.html?highlight=export_conandata_patches) +helper. + +```py +def export_sources(self): + export_conandata_patches(self) +``` + +### Applying Patches + +Patches can be applied in a separate method, the pattern name is `_patch_sources`. When applying patch files, +using [`conan.tools.files.apply_conandata_patches`](https://docs.conan.io/1/reference/conanfile/tools/files/patches.html?highlight=apply_conandata_patches) +is the best option. + +```py +def build(self): + apply_conandata_patches(self) +``` + +For more complicated cases, +[`conan.tools.files.rm`](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rm) +or [`conan.tools.files.replace_in_file`](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-replace-in-file) +are good choices. + +```py +def _patch_sources(self): + # remove bundled libfmt + rmdir(self, os.path.join(self.source_folder, "lib", "fmt")) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${CMAKE_SOURCE_DIR}", "${CMAKE_CURRENT_SOURCE_DIR}") +``` + +### Rules + +These are the rules that apply to regular versions of Conan packages: + +**Build system patches.** In order to add libraries into ConanCenter sometimes +it is NEEDED to apply patches so they can consume existing packages +for requirements and binaries can be generated. These patches are totally +needed for the purpose of ConanCenter and Conan keeps adding features trying +to minimize these changes. + +**Source patches.** ConanCenter DOES NOT accept patches **backporting bugfixes or +features** from upcoming releases, they break the principle of minimum surprise, +they change the behavior of the library and it will no longer match the +documentation or the changelog originally delivered by the authors. + +However, ConanCenter DOES accept **working software patches**, these patches +are needed to generate the binaries for architectures not considered by +library maintainers, or to use some compilers or configurations. These patches +make it possible to generate binaries that cannot be generated otherwise, or +they can turn a crashing binary into a working software one (bugs, errors, or +faults are considered working software as long as they produce deterministic +results). + +Patches to sources to add support to newer versions of dependencies are +considered feature patches and they are not allowed either. They can +introduce new behaviors or bugs not considered when delivering the +library by maintainers. If a requirement is known not to work, the recipe +should raise a `ConanInvalidConfiguration` from the `validate()` method. + +**Vulnerability patches.** Patches published to CVE databases or declared as +vulnerabilities by the authors in non-mainstream libraries WILL be applied +to packages generated in Conan Center. + +**Official release patches.** If the library documents that a patch should be +applied to sources when building a tag/release from sources, ConanCenter WILL +apply that patch too. This is needed to match the documented behavior or the +binaries of that library offered by other means. +[Example here](https://www.boost.org/users/history/version_1_73_0.html). + +### Exceptions + +Exceptionally, we might find libraries that aren't actively developed and consumers +might benefit from having some bugfixes applied to previous versions while +waiting for the next release, or because the library is no longer maintained. These +are the rules for this exceptional scenario: + +* **new release**, based on some official release and clearly identifiable will + be created to apply these patches to: <>. +* **only patches backporting bugfixes** will be accepted after they have + been submitted to the upstream and there is a consensus that it's a bug and the patch is the solution. + +ConanCenter will build this patched release and serve its binaries like it does with +any other Conan reference. + +Notice that these <> releases are unique to ConanCenter +and they can get new patches or discard existing ones according to upstream +considerations. It means that these releases will modify their behavior without previous +notice, the documentation or changelog for these specific releases won't exist. Use +them carefully in your projects. diff --git a/docs/adding_packages/test_packages.md b/docs/adding_packages/test_packages.md new file mode 100644 index 0000000000000..5870221fbc94b --- /dev/null +++ b/docs/adding_packages/test_packages.md @@ -0,0 +1,111 @@ +# Test Packages + +This is the main way that ConanCenter is able to validate the contents of a package are valid. +It is required to provide a [`test_package/`](https://docs.conan.io/1/reference/commands/creator/create.html?highlight=test_package) +sub-directory with every recipe. These are expected to work regardless of the options or settings used as this is what consumer will encounter when doing a `conan create` +themselves. It's possible to have ConanCenter run `conan test` on more then one `test folder` by using the `test_` prefix. + + +## Contents + + * [Files and Structure](#files-and-structure) + * [CMake targets](#cmake-targets) + * [Testing more generators with `test_`](#testing-more-generators-with-test_something) + * [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules) + * [How it works](#how-it-works) + * [Minimalist Source Code](#minimalist-source-code) + +### Files and Structure + +See the [recipe files and structures](README.md#recipe-files-structure) for a visual. + +All ConanCenterIndex recipe should have a two [test_folders](https://docs.conan.io/1/reference/commands/creator/create.html?highlight=test_folder) +One for the current CMake generator in `test_package/` and on for the deprecated generators in `test_v1_package/`. + +Please refer to the [Package Templates](../package_templates/) for the current practices about which files and what their content should be. + +### CMake targets + +When using CMake to test a package, the information should be consumed using the +[`CMakeDeps` generator](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html?highlight=cmakedeps). + +This typically will look like a `CMakeLists.txt` which contain lines similar to + +```cmake +find_package(fmt REQUIRED CONFIG) +# ... +target_link_libraries(test_ranges PRIVATE fmt::fmt) +``` + +Refer to the [package template](https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt) for more examples. + +> **Notes** It's still important to test targets provided by `cmake_find_package[_multi]` generators. +> It should help in the migration (and compatibility) with Conan v2. See [v1 test package template](https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt) for details. +> You can see read [this conversation](https://github.com/conan-io/conan-center-index/issues/12888#issuecomment-1290817799) for more context. + +In ConanCenter we try to accurately represent the names of the targets and the information provided by CMake's modules and config files that some libraries +provide. If CMake or the library itself don't enforce any target name, the default ones provided by Conan should be recommended. The minimal project +in the `test_package` folder should serve as an example of the best way to consume the package, and targets are preferred over raw variables. + +This rule applies for the _global_ target and for components ones. The following snippet should serve as example: + +We encourage contributors to check that not only the _global_ target works properly, but also the ones for the components. It can be +done creating and linking different libraries and/or executables. + +### Testing more generators with `test_` + +The CI will explore all the folders and run the tests for the ones matching `test_*/conanfile.py` pattern. You can find the output of all +of them together in the testing logs. + +Sometimes it is useful to test the package using different build systems (CMake, Autotools,...). Instead of adding complex logic to one +`test_package/conanfile.py` file, it is better to add another `test_/conanfile.py` file with a minimal example for that build system. That +way the examples will be short and easy to understand and maintain. In some other situations it could be useful to test different Conan generators +(`cmake_find_package`, `CMakeDeps`,...) using different folders and `conanfile.py` files. + +When using more than one `test_` folder, create a different project for each of them to keep the content of the `conanfile.py` and the +project files as simple as possible, without the need of extra logic to handle different scenarios. + +``` +. ++-- recipes +| +-- library_name/ +| +-- config.yml +| +-- all/ +| +-- ... +| +-- test_package/ +| +-- ... +| +-- test_cmakedeps/ +| +-- conanfile.py +| +-- CMakeLists.txt +| +-- test_package.cpp +``` + +### Testing CMake variables from FindModules + +Recipes which provide [Find Modules](https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules) are strongly encouraged to +module the file name, targets and or variables. + +**We will provide better docs in the near future**, for now here are a few references: + +- Convo: https://github.com/conan-io/conan-center-index/pull/13511 +- early example: https://github.com/conan-io/conan-center-index/tree/master/recipes/libxml2/all/test_cmake_module_package +- Best reference: https://github.com/conan-io/conan-center-index/blob/master/recipes/expat/all/test_package_module/CMakeLists.txt#L9 + +### How it works + +The [build service](README.md#the-build-service) will explore all the folders and run the tests for the ones matching `test_*/conanfile.py` pattern. +You can find the output of all of them together in the testing logs. Only the end of the logs are posted even if an earlier "test folder" may have failed. + +> **Note**: If, for any reason, it is useful to write a test that should only be checked using Conan v1, you can do so by using the pattern +> `test_v1_*/conanfile.py` for the folder. Please, have a look to [linter notes](../v2_linter.md) to know how to prevent the linter from +> checking these files. + +Remember that the `test_` recipes should **test the package configuration that has just been generated** for the _host_ context, otherwise +it will fail in cross-building scenarios; before running executables, recipes should check +[`conan.tools.build.can_run`](https://docs.conan.io/1/reference/conanfile/tools/build.html?highlight=can_run#conan-tools-build-can-run) + +### Minimalist Source Code + +The contents of `test_package.c` or `test_package.cpp` should be as minimal as possible, including a few headers at most with simple +instantiation of objects to ensure linkage and dependencies are correct. Any build system can be used to test the package, but +CMake or Meson are usually preferred. diff --git a/docs/bump_version.md b/docs/bump_version.md new file mode 100644 index 0000000000000..132d4ff1bf685 --- /dev/null +++ b/docs/bump_version.md @@ -0,0 +1,48 @@ +# How to bump a package version for an existing recipe in ConanCenterIndex? + +Once a recipe is approved and merged to ConanCenterIndex, it may need to be updated with new versions released by the upstream. +When someone needs a new package version that is not available in ConanCenterIndex, that person can open an issue [resquesting a new version](https://github.com/conan-io/conan-center-index/issues/new?assignees=&labels=upstream+update&template=package_upstream_update.yml&title=%5Brequest%5D+%3CLIBRARY-NAME%3E%2F%3CLIBRARY-VERSION%3E). +Or, by opening a pull request changing and adding that needed version, this is called a `bump version`. +The [build service](adding_packages/README.md#the-build-service) bumping process is limited to pull requests which **only** adds a new package version and nothing more. Removing older versions, or updating +the recipe will disqualify a pull request from the `Bump version` [review process](review_process.md) + +## Choosing which version should be updated + +The first step is checking the version which should be added from the upstream. Please, avoid adding multiple versions which you do not +need. Adding a new version will increase the building time and storage for each new package configuration. + +Once you detect which version should be updated, please, first check if the project `license` keeps the same. + +> In case you need to update attributes, dependencies versions, patches, or anything besides the package version in `conandata.yml` and `config.yml`, + then your pull request will not be classified as bump version. + +## What should be modified when bumping a version? + +Only the `config.yml` and `conandata.yml` should be updated with that new version: + +```yaml +# config.yml +versions: + "1.1.0": <-- New version added. It should be protected by quotes + folder: all <-- Folder name where conandata.yml is installed + "1.0.0": + folder: all +``` + +```yaml +# all/conandata.yml +sources: + "1.1.0": <-- New version added + url: "https://example.com/repo/exameple-1.1.0.tar.gz" + sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" + "1.0.0": + url: "https://example.com/repo/exameple-1.0.0.tar.gz" + sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" +``` + +In case a patch should be re-used, it should be present in `conandata.yml` to the specific version as well. + +## Reviewing and merging + +Bumping version PRs follow the same regular [review process](review_process.md), except for being merged automatically +as listed on [Labels](labels.md#bump-version) section. diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000000000..1f0425119cede --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,761 @@ +# Changelog + +### 04-May-2023 - 16:05 CEST + +- [bugfix] Fix cppstd issues when selecting the value to use in profiles. +- [feature] Add support for raising `InvalidConfiguration` in `validate_build()` method in recipes. +- [feature] Update library requirements for Conan client 2.0.4 +- [feature] Inform users when Conan v2 CI build is mandatory for merging. +- [feature] Implement different "under maintenance" levels: OFF, MINOR, MAJOR, CRITICAL. +- [feature] ValidateInfrastrucure: Check Artifactory repos exist. +- [feature] Move variables to new folder properties approach. + +### 12-April-2023 - 16:18 CEST + +- [feature] Add ListPackages job the posibility to update a list via PR +- [feature] Add c3i-conan2-ready label when modifying .c3i/conan_v2_ready_references.yml +- [hotfix] Use Conan helpers to update Conan Center page +- [hotfix] Automatic Merge reduces the number of requests for each execution + +### 03-April-2023 - 10:26 CEST + +- [fix] Remove options usage from build profile. +- [fix] Fix promotion of recipe/packages when artifacts already exist in target repo. +- [feature] Make master branch promotion job wait for sibling jobs (to avoid recipe promotion race condition). +- [feature] Improve request of reviews and remove timeout. + +### 24-March-2023 - 12:00 CET + +- [feature] Install Conan command extensions for Conan v2 +- [feature] Reduce Github requests number to execute Automatic Merge CI job +- [hotfix] Improve Promote Package CI job logging for better debug + +### 10-March-2023 - 19:55 CET + +- [feature] Add priority to pull requests +- [hotfix] Avoid extra http requests to run automatic merge faster + +### 10-March-2023 - 13:15 CET + +- [hotfix] No longer update conan_v2_ready_references.yml automatically +- [bugfix] Validate Green and clean PRs first when executing automatic merge CI job + +### 07-March-2023 - 17:05 CET + +- [hotfix] Automatic merge skips git conflicts +- [hotfix] config label for "v2 ready" depends on PR author + +### 03-March-2023 - 11:05 CET + +- [feature] Update ready_v2_references.yml file automatically +- [fix] Do not reuse the same build folder to avoid busy files + +### 21-February-2023 - 17:22 CET + +- [fix] Fix bug with cppstd entry in configuration files. +- [fix] Fix configuration read of list from an external yaml file. + +### 21-February-2023 - 12:44 CET + +- [feature] ScheduledExportCheck: Collect warnings from hooks and publish them to a separate table. +- [feature] AutomaticMerge: Add conditional status checks with allowlist. +- [feature] AutomaticMerge: Add branches config to merge branches automatically. +- [feature] Conan: Add methods to get the latest recipe revision. +- [feature] Bump library requirements to support the latest Conan versions. +- [fix] PromotePackages: Fix an issue when promoting multiple references. +- [fix] UpdateSearchIndex: Fix conan inspect call command. + +### 14-February-2023 - 15:32 CET + +- [fix] Fix ScheduledExportCheck job not updating hook validation issues. +- [fix] Fix missing GitHub labels for PRs with "bump version" and "bump dependencies" +- [feature] PromotePackages: Add a parameter to promote multiple references. +- [feature] Increase `conan test` time limit to 1 hour. +- [feature] Add request header for GitHub API version. + +### 03-February-2023 - 10:24 CET + +- [fix] Fix macOS deployment target / minos value. +- [feature] Validate: Add return code for license check. +- [feature] Add references list and force parameters to TapaholesRepo job. +- [feature] Add new ListPackages job. +- [feature] Update Conan versions library requirements to 1.58.0 and 2.0.0-beta9. + +### 20-January-2023 - 16:09 CET + +- [feature] Make feedback messages of PRs configurable. +- [feature] Add status icon to the title of PRs comments. +- [fix] Fix Conan v2 error when getting revisions. + +### 16-January-2023 - 16:43 CET + +- [fix] ValidateInfrastructure: Fix Conan version check. +- [feature] TapaholesRepo: Build references when there are 0 packages for a recipe revision. + +### 12-January-2023 - 19:33 CET + +- [fix] Fix Conan v2 download/upload recipe commands. + +### 12-January-2023 - 11:21 CET + +- [feature] Add support for Conan v2 beta 7. +- [feature] Check complete Conan version on ValidateInfrastructure. +- [fix] Increase `conan test` timeout value. +- [fix] Fix stage name when calculating build configurations. + +### 10-January-2023 - 15:20 CET + +- [feature] Add entry in config to disable merging labels from the multibranch job. +- [feature] Add timeout to `conan test` command. +- [feature] Add API wrapper support for status page. +- [refactor] Separate build configuration calculation from pull-request interaction (labels/comments). +- [feature] Take main repository from configuration for Tapaholes jobs. + +### 15-December-2022 - 11:12 CET + +- [feature] Set github feeback title via config file (`feedback_title`). +- [fix] Fix log summary html table for shared option with Conan v2. +- [fix] ValidateInfra: Remove same OS version check for Macos nodes. + +### 09-December-2022 - 11:38 CET + +- [feature] Add environment variable to build with different Xcode/apple-clang compilers on Macos agents. +- [feature] Add `MACOSX_DEPLOYMENT_TARGET` and `SDKROOT` env variables to build stages on Macos. +- [feature] Add `LongPathsEnabled` registry key check on Windows to Validate Infrastructure job. +- [fix] Fix git user on commits when updating docs for supported platforms and configurations. +- [fix] Fix getting commit hash when writing GitHub error messages. +- [fix] Fix Conan v2 inspect command. +- [fix] Fix condition when waiting for another job to finish. + +### 14-November-2022 - 11:54 CET + +- [feature] Disable inactivity count for Access Request job. +- [feature] Add `github-actions[bot]` to permanent users list. +- [feature] No need to run ValidateInfrastructure job for Access Request and Reviewers update pull-requests. +- [fix] JobRelauncher retry property fix. + +### 07-November-2022 - 11:17 CET + +- [feature] Improve Access Request's pull-request description mentioning users. +- [fix] Access Request should not remove reviewers and maintainers. +- [fix] Access Request should count requests done on the same day as the pull request. +- [fix] Avoid posting pipeline title in GitHub messages if feedback is empty. + +### 27-October-2022 - 15:18 CEST + +- [feature] Add under maintenance check to AccessRequest and ScheduledExportCheck jobs. +- [feature] AccessRequest: Remove inactive users. +- [feature] Accept Major.Minor as bump version. +- [feature] Add message title to gihtub comments. +- [fix] Update maintainers list and fix output. +- [fix] Remove dummy files from tests. +- [fix] Make sure contributors are not removed in Access request PR. + +### 17-October-2022 - 10:33 CEST + +- [feature] Improve management of GitHub labels on pull requests. +- [feature] New EpochsSummary job to show epoch status for each reference. +- [feature] Save bot comments as labels as job artifacts for easier user feedback. +- [feature] Ability to wait for a job and merge bot messages from another pipeline: Allows to provide feedback to users in PRs from the Conan v2 pipeline in the future. +- [feature] Add timeout to AutomaticMerge job. +- [feature] Add note about Windows SDK on supported platforms documentation. +- [fix] Fix getting package IDs from Artifactory in the Conan v2 pipeline. +- [fix] Bump dependencies pull requests should only consider modified comments. +- [fix] ValidateInfrastructure job parameter for macos executors. + +### 20-September-2022 - 14:27 CEST + +- [feature] Handle scenarios where some files are removed. +- [feature] Simplify logic to detect references to be built in a pull request. +- [feature] Workaround in Conan v2 commands to list package IDs in a pull request. +- [feature] Bump minimum required Conan client version. +- [fix] When merging a pull request, check recipe revisions only against the pull-request repository. +- [fix] Do not consider GitHub check runs for pull requests opened by a bot. +- [fix] Consider files renamed in pull requests as "added" and "removed". +- [fix] Cover use-case when a pull request adds just one conanfile.py. +- [fix] Simplify assignment of GitHub labels. +- [fix] Use backquotes in GitHub comments. +- [fix] Fix promotion of packages with Conan v2. + +### 1-September-2022 - 10:21 CEST + +- [feature] Avoid `test_v?_package` folders that don't match the Conan version. +- [feature] Keep at least 3 days of job logs. +- [fix] Properly encode GitHub API URLs. +- [fix] Replace invalid chars when generating profiles. +- [refactor] Refactors around the GitHub classes implementation. + +### 18-August-2022 - 15:21 CEST + +- [fix] Conan v2: Check recipe revision only if it has been successfully exported. +- [feature]: Consider changes from `master` before merging a pull-request. If those changes result in a new recipe revision, the pull-request is triggered again. + +### 8-August-2022 - 11:25 CEST + +- [fix] Take into account status checks from GitHub actions before merging a pull-request. +- [feature] Double check that the recipe revision exported using Conan v2 matches the one exported by Conan v1. +- [feature] Fail if required Conan version is not available on Linux containers instead of falling back to latest. + +### 22-July-2022 - 12:13 CEST + +- [feature]: ValidateInfrastructure: Add check to verify CMake 3.21 is installed in Windows machines. +- [feature]: ValidateInfrastructure: Execute the validation when a pull-request is modifying configuration files. +- [feature]: Conan v2: Iterate `cppstd` values in profiles to build first match. +- [feature]: Conan v2: Apply `shared` option for the whole dependency graph. +- [feature]: Add `tools.apple.sdk_path` to configuration in Macos (required by new build helpers). +- [feature]: Set `tools.system.package_manager:mode=install` and `tools.system.package_manager:sudo=True` in configuration files (required by new system package manager helpers to mimic the behavior of old ones). +- [feature]: Upgrade required Conan versions to work with the library. Minimum versions tested are now `1.49.0` and `2.0.0b1`. +- [fix]: ValidateInfrastructure: Fix error message split. +- [bugfix]: Accept missing HTTP code for requests. + +### 06-July-2022 - 14:28 CEST + +- [feature]: Configure AccessRequest job to run on Mondays and Thursdays. +- [fix]: Improve Conan v2 export message. +- [fix]: Fix config parameters for RelaunchUnexpected job +- [fix]: Make AccessRequest job open PR against cci repo. +- [fix]: DSL: Remove old jobs by date only +- [refactor]: Refactor GitHub-related code utilities. + +### 27-June-2022 - 17:29 CEST + +- [fix] Fix "no changes detected" issue in some pull-requests. +- [fix] Avoid static builds with static runtime in MSVC compiler. +- [fix] Fix Conan v2 export checkout of sources. +- [fix] Conan v2: Avoid reading configuration entries that do not exist. +- [feature] Avoid failure in some jobs when the system is under maintenance. +- [feature] ValidateInfrastructure job now works for `msvc` & Visual Studio 2022. +- [feature] Conan v2: support hooks installation. +- [feature] Add more parameters to DSL scripts. + +### 08-June-2022 - 16:29 CEST + +- [feature] Allow changes in multiple folders (except for the `recipes` one). +- [feature] Detect changes made in a future `linters` folder. +- [feature] Validate configuration files in pull-requests that modifies them. +- [feature] Add support for more Conan v2 commands. +- [feature] DSL: Parameterize jenkinsfile path. +- [fix] DSL: Discard old builds to avoid consuming all inodes. +- [fix] Remove `under maintenance` label in pull requests. +- [fix] Add a detailed message for Conan v2 export. +- [fix] Abort `RelaunchUnexpectedError` job when the system is under maintenance. + +### 19-May-2022 - 15:52 CEST + +- [feature] Add Conan v2 export extra step in pull-request job. +- [feature] Tag pull-requests as "under maintenance" when the build service is not available. +- [config] Update Conan version to 1.47.0. +- [feature] Check right WinSDK in ValidateInfrastructure job. +- [fix] Fix access request job for authorized users. +- [feature] New Conan v2 commands: info and recipe revision. +- [feature] Store package ID cache at job level. + +### 10-May-2022 - 17:05 CEST + +- [fix] Exclude `shared=True` and runtime `MT/MTd` profile configuration from builds. +- [job] RelaunchUnexpectedError: a new job to automatically retrigger failed jobs. +- [feature] Ability to load the configuration file from an external source. +- [feature] Allow changes to files in the `.c3i` folder. +- [config] Move reviewers and approved users to configuration files. +- [config] Move automatic merge parameters to the configuration file. +- [config] Move GitHub activation to configuration file. +- [config] Remove default configuration. +- [feature] Added compatibility for more Conan 2 commands. +- [fix] Avoid regeneration of folder and multibranch jobs by the DSL cron job. + +### 28-April-2022 - 9:56 CEST + +- [config] Update Conan client to 1.46.2 +- [fix] Do not create GitHub pull-request statuses in advance. +- [fix] Move some Conan command calls to the wrapper. +- [feature] Added compatibility for Conan v2 export command. +- [config] Changed the required number of reviewers: 1 team and 1 community is enough + +### 21-April-2022 - 13:46 CEST + +- [feature] Updated Python version to > 3.7 in all build agents. +- [feature] Added CMake and Python versions to the infrastructure information. +- [config] Added new community reviewers. +- [feature] Moved Jenkins and Slack to the configuration file. +- [feature] Retry each build config if there is an unexpected error. +- [feature] Added logging to collect information about some jobs. +- [feature] Use a real build profile for cross-building configurations. +- [bugfix] Improve export error report. + +### 31-March-2022 - 11:55 CEST + +- [config] Upgrade Conan client version to 1.45.0. + +### 25-March-2022 - 09:54 CET + +- [feature] Updated CMake version to 3.20 only in MacOS machines. +- [feature] Collect requirements from test_package as well. +- [feature] Make the conan-center-bot write a comment after merging a `Bump version` or `Bump dependencies` labeled pull request. +- [feature] Allow SecheduledExportCheck job to report in any issue. +- [feature] DSL: Add cron triggers to some jobs. +- [feature] DSL: Disable concurrent builds on some jobs. +- [feature] Adapt paths for Ansible machines. +- [bugfix] Fix wrong log links in conan-center-bot message. +- [fix] Use consistent slashes in paths. +- [fix] Fix alert for job cancellation. + +### 09-March-2022 - 13:37 CET + +- [feature] Merge pull-requests that bump version automatically. +- [feature] Get requirements from `conan info --dry-build` command. +- [feature] Use reference with recipe revision for `conan info` commands. +- [feature] Add possibility to load the configuration from file. +- [fix] Fix DSL typo for access request job. +- [fix] Removed retries from pull-request builds (introduced long ago to avoid timeout issues). +- [refactor] Completely remove resource locking for executors. + +### 24-February-2022 - 14:03 CET + +- [fix] Fix encoding issues in `summary.html` file. +- [fix] Specify branch discovery in DSL for cci multibranch job. + +### 22-February-2022 - 10:26 CET + +- [feature] Merge pull-request that bump dependencies automatically. +- [feature] Notify about Visual Studio license status in ValidateInfrastructure. +- [config] Upgrade Conan client version to 1.44.1. +- [fix] Fix potential race condition calculating package IDs. + +### 16-February-2022 - 12:46 CET + +- [fix] Pin Artifactory client library version. + +### 10-February-2022 - 16:44 CET + +- [fix] Fix DSL parameters and TapaholesList name. +- [feature] Added ConanReference string conversion in call-stacks. +- [fix] Fix ValidateInfrastructure executors and labels count. + +### 04-February-2022 - 12:48 CET + +- [bugfix] Avoid race-conditions in Conan client instance. +- [hotfix] Race condition reading/writing a file. + +### 03-February-2022 - 17:01 CET + +- [feature] New label to identify pull-requests that are just bumping dependencies version. +- [bugfix] Fixed bugs with promotion and properties for references that don't build any binary. +- [feature] Add parameter to chose if documentation of supported platforms should be updated automatically. +- [feature] Improve Conan version regex to accept development versions + +### 26-January-2022 - 11:14 CET + +- [config] Add MacOS apple-clang 13.0 configuration to a new epoch. +- [feature] Handle `header_only=True` default option in recipes. +- [feature] Notify failed builds due to expired Visual Studio licenses. +- [feature] Tapaholes job now sets epoch as well. +- [fix] Throw error if configuration file to use is not found. +- [feature] Add missing DSL job descriptions. +- [feature] Child jobs use the same parent folder. +- [refactor] Remove resource locking. + +### 18-January-2022 - 16:49 CET + +- [config] Bump Conan client version to 1.43.3. + +### 29-December-2021 - 16:41 CET + +- [config] Add Linux GCC 11, Clang 12 & 13 configurations with new epoch feature. +- [config] Drop Linux GCC 6 and clang 10 configurations. +- [fix] Fixed some unexpected errors. +- [feature] Prepare pipeline to work with ansible provisioned machines. + +### 17-December-2021 - 09:56 CET + +- [feature] Introduce 'epoch' concept to build configurations as a strategy to build packages for new compilers. +- [feature] Allow pull-requests to build packages from different recipes for the same library. +- [feature] Profiles and logs from builds in the packages generated summary are now open in a new tab. +- [fix] Improve error reporting of mismatched revision in PRs. + +### 14-December-2021 - 09:13 CET + +- [config] Bump Conan client version to 1.43.0. + +### 01-December-2021 - 12:29 CET + +- [config] Bump Conan client version to 1.42.2. + +### 24-November-2021 - 17:49 CET + +- [feature] Return host requirements when computing package IDs. + +### 22-November-2021 - 17:53 CET + +- [feature] Cache computation of package IDs. + +### 15-November-2021 - 11:03 CET + +- [feature] Add `xlarge` pod size in Linux for building packages with higher memory requirements. + +### 11-November-2021 - 13:22 CET + +- [config] Bump Conan client version to 1.41.0 +- [fix] Identify PRs to `CONTRIBUTING.md` as changes in docs. +- [feature] Added Jenkins DSLs for job descriptions. +- [fix] Parse integer value when assigning properties. + +### 18-October-2021 - 17:05 CEST + +- [config] Upgrade Conan version to 1.40.4 +- [fix] Replace `Unauthorized User` label by `User-approval pending` +- [feat] Remove `os_build` and `arch_build` from generated profiles + +### 11-October-2021 - 12:14 CEST + +- [configs] Configurable Github statuses to check +- [configs] Pairing between configurations and workers (docker images, win/macos servers,...) is configurable in runtime. +- [feature] Early(iest) stop after failure: ignore any extra messages. It provides faster feedback for users. +- [feature] Skip stale pull-requests from automatic review requests. +- [feature] Add node-pool with more resources. It allows the CI to delegate certain builds that require higher RAM limits to it (configured manually). +- [fix] Removed EAP, now it should be named _"Access requests"_ everywhere +- [fix] Improved checks for infrastructure and configuration. It also fixes the auto-generated documentation for _"Supported platforms and configurations"_. +- [job] New job to remove dead branches from CI + +### 01-October-2021 - 13:08 CEST + +- [hotfix] Apply patch for (Added root certificate for Let's encrypt) + +### 21-September-2021 - 12:09 CEST + +- [config] Upgrade Conan version to 1.39.0. + +### 7-September-2021 - 16:49 CEST + +- [configs] Remove Visual Studio 2015 +- [configs] Remove Macos apple-clang 10 +- [configs] Remove Linux GCC 4.9 +- [configs] Linux Clang: keep only latest versions 10 and 11 +- [feature] Rename EAP to Access Request. +- [feature] Display merge error in pull-requests. + +### 6-September-2021 - 11:15 CEST + +- [feature] Display useful CI status notifications in Github pull requests. +- [feature] Upgrade Conan client version to 1.38.0. +- [feature] Move the Conan and Artifactory configuration out of the Jenkins library. +- [feature] Use separated files for the different profile configurations. + +### 3-August-2021 - 13:29 CEST + +- [feature] BuildSingleReference: Create packages for apple-clang armv8 (Apple M1) in pull-requests' builds. +- [feature] BuildSingleReference: Enforce empty workspace for Windows and MacOS nodes. +- [feature] Different approach to work with configuration files for profiles (internal modularibility). +- [feature] Allow jobs to use multiple configuration files for profiles. +- [fix] ValidateInfrastructure: Minor fixes to the automatic generation of "Supported platforms and configurations" documentation page. +- [fix] PromotePackages: Fix promotion of references that contain symbols. + +### 13-July-2021 - 10:24 CEST + +- [fix] DeleteRepo: Fix JFrog CLI commands. + +### 07-July-2021 - 08:36 CEST + +- [feature] UpgradeConan: Upgrade pip before installing Conan. +- [feature] Upgrade Conan client to the 1.37.2 version. + +### 02-July-2021 - 16:45 CEST + +- [feature] Do not run the CI for branches starting with `bot/...` (branches intended for automations). +- [feature] Remove all remotes when configuring the Conan client. +- [feature] ValidateInfrastructure: Update "Supported platforms and configurations" doc automatically. +- [fix] UpdateSearchIndex: Fix parsing of package data. +- [feature] BuildSingleReference: Add `MSBUILDDISABLENODEREUSE` environment variable for MSBuild to avoid errors when compiling in parallel. + +### 01-June-2021 - 08:59 CEST + +- [feature] RequestReviews: Add column to enable/disable review requests (any user). +- [testing] Use declared Conan version to run tests. +- [internal] Pay some technical debt. +- [internal] Simplify workflow, all packages already have properties. + +### 25-May-2021 - 13:42 CEST + +- [feature] AutomaticMerge: Skip pull-requests that fail to merge. + +### 24-May-2021 - 15:59 CEST + +- [feature] Start to crossbuild Apple M1 using two profiles approach (extra build). +- [feature] Detect and report when a PR has missing dependencies. +- [feature] Upgrade Conan version to 1.35.2. +- [feature] Use only one Artifactory repository per pull request. + +### 14-May-2021 - 17:24 CEST + +- [fix] Add `--dry-build` to `conan info` commands, it will expand also the build-requires that would have + failed during the build stage. +- [fix] Escape character comma when assigning properties to Artifactory. +- [fix] Add `--force` when adding remotes. + +### 30-April-2021 - 13:52 CEST + +- [feature] Add mark in logs to indicate output has been trimmed. +- [feature] Stop uploading packages to Bintray. +- [job] RequestReviews: Automatically request team reviews for PRs ready for review. +- [job] Add checks to validate infrastructure: MacOS version and AVX2 in CPU features. + +### 08-April-2021 - 17:01 CEST + +- [feature] Hide previous comments by the bot. +- [feature] Use Artifactory API to promote packages from one repository to another. +- [job] Add ability to specify a repository and branch for the hooks when running the export check. +- [job] Add checks to validate infrastructure: Python version, Macos features. + +### 05-March-2021 - 15:28 CET + +- [feature] Stop generating packages for apple-clang 9.1. +- [feature] Raise error if `ConanInvalidConfiguration` is raised from `build()` method. +- [feature] BuildSingleReference: All PRs use the new workflow. +- [feature] Allow modifications in the _.github_ folder for GitHub bots and actions. +- [feature] Use BuildSingleReference job to build packages (if needed) during a merge. +- [feature] BuildSingleReference: Add build environment property to packages. +- [feature] Tapaholes: Delete repositories after running jobs. +- [feature] AutomaticMerge: Add information to the description of the job. +- [feature] Add new "CleanupArtifactory" job to remove repositories of unmerged PRs. +- [feature] PopulateProperties: Remove packages after using them to compute properties. +- [fix] Add timeout and retry flags to all `curl` commands to avoid intermittent job failures. + +### 22-February-2021 - 10:42 CET + +- [feature] Add new profiles to generate new compiler configurations in pull requests: + - Linux: gcc 10, clang 10, clang 11. + - Macos: apple-clang 12.0. +- [feature] Updated Conan client to the 1.33.1 version. +- [engineering] PromotePackages: Remove packages after uploading. + +### 05-February-2021 - 13:20 CET + +- [job] New job to upgrade Conan version (Windows and Macos workers). +- [job] New job to validate infrastructure: versions of tools, installed components,... (more checks to be added). +- [feature] Call external DeleteRepo job to remove repositories from Artifactory after a pull-request is merged. +- [feature] New workflow for pull-requests: use `BuildSingleReference` job and better messages (canary deployment). +- [engineering] Refactor functions to retrieve information from GitHub API. + +### 27-January-2021 - 09:37 CET + +- Feature: PropulateProperties: Notify alert error if there are orphan packages, but keep going. +- Feature: Capture output and exit code running Conan commands. +- Feature: New job to delete an Artifactory repo. +- Fix: AutomaticMerge: Fix alerts when there are no errors. +- Fix: PopulateProperties: Do not raise if a property assignment fails, go with the next one. +- Fix: Improve packages generated message. +- Fix: BuildSingleReference: Add boolean parameter to configure hooks errors. +- Fix: Handle scenario where a package doesn't have properties. + +### 30-December-2020 - 13:24 CET + +- [feature] BuildSingleReference: Run tests for packages that already exist. +- [feature] BuildSingleReference: Add functionality so it is able to build a PR merging into 'master'. +- [feature] Specify Conan version to use in every node call (decouple from conan-docker-tools updates). +- [fix] AddBetaUser: Fix "ghost" user added weekly for deleted users. + +### 29-December-2020 - 17:18 CET + +- Updated Conan client to the 1.32.1 version in Windows and Mac agents. + +### 14-December-2020 - 09:51 CET + +- [feature] Remove repositories after a pull-request is merged. +- [feature] Run promotion in parallel for merge-commits. +- [feature] Viewer for summary.json files. +- [feature] Trigger a BuildSingleReference job at the end of pull-request jobs to build new configurations. +- [fix] Manage repository permissions independently in pull-requests. + +### 27-November-2020 - 10:14 CEST + +- [feature] More (and better) properties are stored in Artifactory for each package. +- [feature] Use modularized jobs in CI to run parts of the pipeline. +- [fix] Fix error affecting PRs that were blocked in the past by a team member. +- [fix] Fix issue with properties associated to new configurations. + +### 18-November-2020 - 12:58 CEST + +- [fix] Notify unexpected errors to slack channel (add link to message). +- [job] AutomaticMerge: Fix PRs blocked by non team member users. +- [bug] Build everything but OK or INVALID_CONFIG. +- [fix] Do not use `--all` argument with `conan upload` when the package ID is given. +- [fix] Fix error getting properties when the recipe doesn't have options. +- [job] Tapaholes: Propose new profile set including new compiler configurations. + +### 18-November-2020 - 11:23 CEST + +- Updated Conan client to the 1.31.3 version in Windows and Mac agents. + +### 23-October-2020 - 17:13 CEST + +- [feature] ListProfiles: Add 'profiles' to inputs, make it required. +- [feature] Tapaholes: Parameter to accept packages in order from a JSON list. +- [fix] AutomaticMerge: Consider pagination when reading pull-request reviews. +- [job] PopulateProperties: Compute and assign properties to packages-revs and recipe-revs. +- [job] PromotePackages: Copy Conan packages and properties from one repo to another. + +### 19-October-2020 - 17:15 CEST + +- Updated Conan client to the 1.30.2 version in Windows and Mac agents. + +### 14-October-2020 - 17:49 CEST + +- [hotfix] Use non greedy regex to capture the pull-request number. + +### 10-October-2020 - 21:20 CEST + +- [fix] Wait longer for Artifactory to create new repositories. + +### 10-October-2020 - 20:52 CEST + +- [job] TapaholesRepo: use full path to the recipe itself. + +### 10-October-2020 - 20:36 CEST + +- [job] BuildSingleReference: assign properties at recipe-revision level + +### 10-October-2020 - 15:53 CEST + +- [job] TapaholesRepo: create remote repository for each run. +- [job] BuildSingleReference: apply environment to every Conan command. + +### 09-October-2020 - 23:43 CEST + +- [fix] AutomaticMerge: if the PR cannot be merged (conflicts) go and try the next one. +- [fix] Use existing TMP folder in Windows. +- [fix] BuildSingleReference: minor fixes. + +### 07-October-2020 - 17:06 CEST + +- [fix] Minor fix to AutomaticMerge job (#390) +- [fix] Modify temp folder, it will no longer be the root of the workspace. +- [job] Populate artifact properties from BuildSingleReference job. +- [job] New job to iterate Github repository (and commit) and find packages missing from remote. + +### 29-September-2020 - 16:21 CEST + +- [feature] Use indexer V2 API. +- [job] Add force parameter to UpdateSearchIndex job to force reindex of packages. +- [job] New UpdateSearchIndexMaster job to reindex (if needed) packages in ConanCenter repository. + +### 23-September-2020 - 15:48 CEST + +- [job] AutomaticMerge: Approved and changes requested reviews should prevail. + +### 21-September-2020 - 17:59 CEST + +- [fix] Remove duplicated credentials. +- [job] AutomaticMerge: Block if a team member requested changes on any commit. +- [job] AutomaticMerge: Show pull request number on the summary. + +### 21-September-2020 - 10:44 CEST + +- Updated Conan client to the 1.29.1 version in Windows and Mac agents. + +### 17-September-2020 - 17:42 CEST + +- [job] Inspect PRs and merge automatically if approved. +- [job] Build single reference. +- [job] Main tapaholes job: Build single references in correct order. +- [feature] Iterate profiles in a given order (adding tests to check). +- [feature] Add new users to EAP automatically only on Mondays. +- [feature] Distribute jobs taking into account resources. +- [feature] Labels 'Error' and 'Unexpected error' are mutually exclusive. +- [bugfix] Every new node offers a clean workspace (shorter paths). +- [bugfix] Upload packages: upload one first, then the rest to avoid missing files issue. +- [bugfix] Fix 'parallelGroup' when there are more workers than tasks. +- [bugfix] Retry if failure setting the BuildStatus property. +- [fix] Use the actual commit from the 'master' branch to compute diffs. +- [fix] Use environment variables to log into Conan repository. + +### 17-August-2020 - 11:20 CEST + +- Raise error if zero packages are generated +- Remove "No beta user" label if corresponding check pass +- [engineering] Unify catchs and simplify slackSend function +- [engineering] Pipeline step to create all packages in stages +- [engineering] Pipeline step to compute and reduce 'packageID' +- [engineering] Simplify 'ComputePackageIDs' command + +### 12-August-2020 - 10:12 CEST + +- Updated Conan client to the 1.28.1 version in Windows and Mac agents. + +### 11-August-2020 - 14:19 CEST + +- [engineering] Read allowed users from a file. +- [engineering] Check for beta users in all environments. +- [engineering] Set date in issue description for hooks validation job. + +### 4-August-2020 - 20:19 CEST + +- [engineering] Remove short-paths home after creating packages. + +### 31-July-2020 - 23:14 CEST + +- [engineering] Use `force` flag to update the ConanCenter metadata. +- [engineering] Remove local packages created after their upload to avoid disk space issues. + +### 24-July-2020 - 13:05 CEST + +- Renamed Jenkins project from `conan-center-pull-request` to `cci` to improve issues with long workspace paths in Windows agents. + +### 24-July-2020 - 12:52 CEST + +- Updated Conan client to the 1.27.1 version in Windows and Mac agents. + +### 17-July-2020 - 18:54 CEST + +- [feature] Allow documentation inside the repository itself in the `docs` folder +- [feature] Add scheduled job to validate recipes using last released hooks +- [feature] Minimize paths used by the CCI library to build packages +- [bugfix] Recover the shortest path for the `CONAN_USER_HOME_SHORT` environment variable +- [engineering] Improve regression testing for pipeline jobs. + +### 30-June-2020 - 16:10 CEST + +- Add JenkinsPipelineUnit to test the Jenkinsfile +- [bug] Compare keys in maps using actual strings +- Clean workspace after running the job +- Clean workspace for all nodes +- [refact] Promote usage of 'ConanReference' +- [ListProfiles] New job to list profiles +- [fix] Add grabs to all vars +- [Refactor] getTmpDir() util +- [ListProfiles] Optionally use reference to list profiles +- [refact] Some cleaning around build configurations +- [fix] Profiles no longer contain empty [env] and [build_requires] sections +- [fix] Fix checkExportSanity function + +### 24-June-2020 - 10:55 CEST + +- Updated Conan client to the 1.26.1 version in Windows and Mac agents. + +### 18-June-2020 - 18:40 CEST + +- Remove short paths limitation in all Windows agents. + +### 04-June-2020 - 10:39 CEST + +- Add `CONAN_SKIP_BROKEN_SYMLINKS_CHECK=1` in master jobs. + +### 02-June-2020 - 13:06 CEST + +- Avoid partial rebuilds in master jobs. Added `all_packages_done` property for every reference to track the completion of packages creation. + +### 02-June-2020 - 00:02 CEST + +- Updated CMake to 3.16.4 in Windows and Mac agents. + +### 20-May-2020 - 10:34 CEST + +- Updated Conan client to the 1.25.2 version in Windows and Mac agents. + +### 14-May-2020 - 15:52 CEST + +- Updated Conan client to 1.25.1 version in Windows and Mac agents. + +### 13-May-2020 - 09:47 CEST (08e2be6) + +- [refact] Simplify around ComputePackageID and CreatePackage +- [refact] No need to pass 'winTmpPath' everywhere +- Move the 'retryIze' call inside the scope of the node (Might improve [#1020](https://github.com/conan-io/conan-center-index/issues/1020)) diff --git a/docs/code_of_conduct.md b/docs/code_of_conduct.md new file mode 100644 index 0000000000000..fe533ead1e99a --- /dev/null +++ b/docs/code_of_conduct.md @@ -0,0 +1,17 @@ +# Code of conduct + +Try to be polite, CCI maintainers and contributors are really willing to help and we enjoy it. + +Please keep in mind these points: + +- There are limited resources/time and not all issues/pull requests can be considered as well as we would like. +- ``conan-io`` maintainers can tag/close/modify any opened issue and it should not be interpreted as a rude or disrespectful action. It + **always** responds to organizational purposes. A closed issue can be perfectly reopened or further commented. +- It is very hard to keep the project in good health in terms of technical debt, usability, serviceability, etc. If the proposed feature is + not clearly stated, enough information is not provided or it is not sure that would be a good feature for the future development of the project, it won't be accepted. The community plays a very important role during this discussion so it strongly encouraged to + explain the value of a feature for the community, the needed documentation and its use cases. +- Backwards compatibility and not breaking users' packages is very important and it won't be done unless there are very good reasons. +- You should not get bothered if you feel unattended, CCI is an Open Source project, not a commercial product. Try to explain what you + really need and we will try to help you. + + For possible violations of the CoC, please report to info@conan.io **and** conancenter@jfrog.com diff --git a/docs/community_resources.md b/docs/community_resources.md new file mode 100644 index 0000000000000..06aa0558a52f3 --- /dev/null +++ b/docs/community_resources.md @@ -0,0 +1,37 @@ +# Community Resources + +This is a curated list of various bots and helpful tools that aim to making approaching Conan-Center-Index and contributing easier. + + +## Contents + + * [Social Media and More](#social-media-and-more) + * [Bots](#bots) + * [Tools](#tools) + +## Social Media and More + +The community is very active on the [Cpplang's Slack channel](https://cpplang.slack.com/archives/C41CWV9HA), it's a great place to get help. + +If you are looking to stay up to date with the last Conan news, follow us on Twitter [@conan_io](https://twitter.com/conan_io) + +## Bots + +- [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 new file mode 100644 index 0000000000000..a777e97d08e79 --- /dev/null +++ b/docs/consuming_recipes.md @@ -0,0 +1,70 @@ +# Consuming recipes + +ConanCenter has always maintained recipes consumers need to have an up to date client for the best experience. +The reason is there are constantly improvements and fixes being made, sometimes those require new Conan features +to be possible. There are usually waves of new features, patches and fixes that allow for even better quality recipes. + + +## Contents + + * [Breaking changes](#breaking-changes) + * [Isolate your project from upstream changes](#isolate-your-project-from-upstream-changes) + +## Breaking changes + +There can be several causes if a recipe (a new revision) might stopped to work in your project: + +- **Fixes in recipes** that modify the libraries they are creating: exported symbols, + compiler flags, generated files for your build system, CMake target names,... + + Every contributor tries to do their best and reviewers do an amazing work checking that the + changes are really improving recipes. +- **New Conan features (breaking syntax)** sometimes requires new attributes or statements in recipes. + If your Conan client is not new enough, + Conan will fail to parse the recipe and will raise a cryptic Python syntax error. + +- **New Conan Version**: Conan keeps evolving and adding new features, and ConanCenter is committed in this + as well, and tries to prepare the user base to these new features in order to ease the migration to new versions. + + New recipe revisions can take into account changes that are introduced in new Conan client + version, sometimes these changes modify some experimental behavior without modifying recipe syntax. + +This use case is covered by the [`required_conan_version`](https://docs.conan.io/1/reference/conanfile/other.html?highlight=required_conan_version#requiring-a-conan-version-for-the-recipe) feature. It will +substitute the syntax error by one nicer error provided by Conan client. + +To be sure that people using these new experimental features are using the required Conan version and testing the actual behavior +of those features (feedback about them is very important to Conan). + +## Isolate your project from upstream changes + +This has always been a concern from ConanCenter consumers. + +Conan is very flexible; you can add your own remote or modify your client’s configuration for more granularity. We see the majority of Conan users hosting their own remote, and only consuming packages from there. For production this is the recommended way to add some infrastructure to ensure stability. This is generally a good practice when relying on package managers - not just Conan. + +Here are a few choices: + +- [Running your own Conan Server](https://docs.conan.io/1/uploading_packages/running_your_server.html) - great for local ad-hoc setups +- [Cache recipes in your own ArtifactoryCE](https://docs.conan.io/1/uploading_packages/using_artifactory.html) - recommended for production environments + +Using your own ArtifactoryCE instance is easy. You can [deploy it on-premise](https://conan.io/downloads.html) or use a +[cloud provided solution](https://jfrog.com/community/start-free) for **free**. Your project should +[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: + +- [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`. + This feature needs to be enabled in Conan 1.x, see the [Activation Instructions](https://docs.conan.io/1/versioning/revisions.html#how-to-activate-the-revisions) for details. +- [Lockfiles](https://docs.conan.io/1/versioning/lockfiles.html) can be created with the `conan lock create` and read with by + adding `--lockfile=conan.lock` to `conan install` or `conan create` commands. See the [lockfile introduction](https://docs.conan.io/1/versioning/lockfiles/introduction.html#) for more information. + +> **Warning** Please, be aware there are some known bugs related to lockfiles that are not being fixed in Conan v1.x - we are really excited for the 2.0 improvements to be widely used. + +Both of these give you better control and will allow you to choose when to upgrade your Conan client. + +--- + +This repository will keep evolving, and Conan will release new features. Even if these breaking +changes can cause some disruption, we think that they are needed and they contribute +to improve the overall experience in the C++ ecosystem. diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md new file mode 100644 index 0000000000000..e34902537f2b6 --- /dev/null +++ b/docs/developing_recipes_locally.md @@ -0,0 +1,278 @@ +# Developing Recipes Locally + +Before you can contribute any code changes, you'll need to make sure you are familiar with the Conan client and have an environment that is conducive to developing recipes. + +This file is intended to provide all the commands you need to run in order to be an expert ConanCenterIndex contributor. + +> **Note**: If you are working with Conan 2.0, the [instructions are below](#using-conan-20) + + +## Contents + + * [Clone your fork](#clone-your-fork) + * [Setup your environment](#setup-your-environment) + * [Installing the ConanCenter Hooks](#installing-the-conancenter-hooks) + * [Updating conan hooks on your machine](#updating-conan-hooks-on-your-machine) + * [Basic Commands](#basic-commands) + * [Try it yourself](#try-it-yourself) + * [Debugging Failed Builds](#debugging-failed-builds) + * [Running the Python Linters](#running-the-python-linters) + * [Running the YAML Linters](#running-the-yaml-linters) + * [Yamllint](#yamllint) + * [Yamlschema](#yamlschema) + * [Testing the different `test__package`](#testing-the-different-test__package) + * [Testing more environments](#testing-more-environments) + * [Using Conan 2.0](#using-conan-20) + * [Installing Conan 2.0 beta](#installing-conan-20-beta) + * [Trying it out](#trying-it-out) + +## Clone your fork + +1. Follow the GitHub UI to [fork this repository](https://github.com/conan-io/conan-center-index/fork) +2. [Clone your fork](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) + +## Setup your environment + +1. Install a C++ development toolchain - ConanCenter's [build images](#testing-more-environments) are available +2. [Install the Conan client](https://docs.conan.io/1/installation.html) - make sure to keep it up to date! +3. Install CMake - this is the only tool which is assumed to be present + [see FAQ](faqs.md#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default) for details. + +> **Note**: It's recommended to use a dedicated Python virtualenv when installing with `pip`. + +### Installing the ConanCenter Hooks + +> **Warning**: This is not yet supported with Conan 2.0 + +The system will use the [conan-center hooks](https://github.com/conan-io/hooks) to perform some quality checks. You can install the hooks by running: + +```sh +conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks +conan config set hooks.conan-center +``` + +> **Note**: Hooks are generally for package correctness and the pylinters are for the recipe syntax + +The hooks will show error messages but the `conan create` won’t fail unless you export the environment variable `CONAN_HOOK_ERROR_LEVEL=40`. +All hooks checks will print a similar message: + +```txt +[HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK +[HOOK - conan-center.py] post_package(): ERROR: [PACKAGE LICENSE] No package licenses found +``` + +#### Updating conan hooks on your machine + +The hooks are updated from time to time, so it's worth keeping your own copy of the hooks updated regularly. To do this, simply run: + +```sh +conan config install +``` + +## Basic Commands + +We recommend working from the `recipes/project` folder itself. You can learn about the [recipe file structure](adding_packages/README.md#recipe-files-structure) to understand the folder and files located there. + +> **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: + +* `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. + +### Try it yourself + +For instance you can create packages for `fmt` in various supported configurations by running: + +```sh +cd recipes/fmt +conan create all/conanfile.py fmt/9.0.0@ -pr:b=default -pr:h=default +conan create all/conanfile.py fmt/9.0.0@ -o fmt:header_only=True -pr:b=default -pr:h=default +conan create all/conanfile.py fmt/9.0.0@ -s build_type=Debug -o fmt:shared=True -pr:b=default -pr:h=default +``` + +## Debugging Failed Builds + +Some common errors related to Conan can be found on [troubleshooting](https://docs.conan.io/1/faq/troubleshooting.html) section. +For ConanCenter Hook errors, go to the [Error Knowledge Base](error_knowledge_base.md) page to know more about those. + +To test with the same environment, the [build images](supported_platforms_and_configurations.md#build-images) are available. +Instructions for using these images can be found in [Testing more environments](#testing-more-environments) section. + +In ConanCenterIndex, the most common failure point is upstream build scripts tailored to their specific use cases. +It's not uncommon to [patch build scripts](adding_packages/sources_and_patches.md#rules) but make sure to read the +[patch policy](adding_packages/sources_and_patches.md#policy-about-patching). You are encouraged to submit pull requests upstream. + +## Running the Python Linters + +> **Warning**: This is not yet supported with Conan 2.0 + +Linters are always executed by GitHub Actions to validate parts of your recipe, for instance, if it uses migrated Conan tools imports. + +It is possible to run the linter locally the same way it is being run [using Github actions](../.github/workflows/linter-conan-v2.yml) by: + +* (Recommended) Use a dedicated Python virtualenv. +* Ensure you have required tools installed: `conan` and `pylint` (better to uses fixed versions) + + ```sh + pip install conan~=1.0 pylint==2.14 + ``` + +* Set environment variable `PYTHONPATH` to the root of the repository + + ```sh + export PYTHONPATH=your/path/conan-center-index + ``` + +* Now you just need to execute the `pylint` commands: + + ```sh + # Lint a recipe: + pylint --rcfile=linter/pylintrc_recipe recipes/fmt/all/conanfile.py + + # Lint the test_package + pylint --rcfile=linter/pylintrc_testpackage recipes/fmt/all/test_package/conanfile.py + ``` + +## Running the YAML Linters + +There's two levels of YAML validation, first is syntax and the second is schema. +The style rules are located in [`linter/yamllint_rules.yml`](../linter/yamllint_rules.yml) and are used to ensure consistence. +The [`config.yml`](adding_packages/README.md#configyml) is required for the build infrastructure and the +[`conandata.yml` patch fields](adding_packages/conandata_yml_format.md#patches-fields) have required elements that are enforced with +schema validation. There's are to encourage the best possible quality of recipes and make reviewing faster. + +### Yamllint + +* (Recommended) Use a dedicated Python virtualenv. +* Ensure you have required tools installed: `yamllint` (better to uses fixed versions) + + ```sh + pip install yamllint==1.28 + ``` + +* Now you just need to execute the `yamllint` commands: + + ```sh + # Lint a recipe: + yamllint --config-file linter/yamllint_rules.yml -f standard recipes/config.yml + yamllint --config-file linter/yamllint_rules.yml -f standard recipes/fmt/all/conandata.yml + ``` + +### Yamlschema + +* (Recommended) Use a dedicated Python virtualenv. +* Ensure you have required tools installed: `strictyaml` and `argparse` (better to uses fixed versions) + + ```sh + pip install strictyaml==1.16 argparse==1.4 + ``` + +* Now you just need to execute the validation scripts: + + ```sh + # Lint a config.yml: + python3 linter/config_yaml_linter.py recipes/fmt/config.yml + + # Lint a conandata.yml + python3 linter/conandata_yaml_linter.py recipes/fmt/all/conandata.yml + ``` + +## Testing the different `test_*_package` + +This can be selected when calling `conan create` or separately with `conan test` + +```sh +# By adding the `-tf` argument +conan create recipes/fmt/all/conanfile.py 9.0.0@ -tf test_v1_package/ -pr:b=default -pr:h=default +``` + +```sh +# Passing test package's conanfile directly (make sure to export first) +conan test recipes/fmt/all/test_v1_package/conanfile.py fmt/9.0.0@ -pr:h=default -pr:b=default +``` + +## Testing more environments + +This can be difficult for some platforms given virtualization support. + +For Windows and MacOS users, you can test the Linux build environments with the Docker build images. + +Assuming you've already tested it locally and it's been successfully exported to your cache, you can: + +1. Creating a new profile. + * You can also download them from CCI build summary +2. Build missing packages + +Example. + +```sh +docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "conan profile new --detect gcc8" +docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "conan install -pr gcc8 fmt/9.0.0@ --build missing" +``` + +> **Note**: If you are running on Mac M1, the follow Docker argument is required: `--platform=linux/amd64` + +If you are working with packages that have system dependencies that are managed by Conan + +```sh +docker run -e CONAN_SYSREQUIRES_MODE=enabled conanio/gcc11-ubuntu16.04 conan install fmt/9.0.0@ -if build --build missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=yes +``` + +## Using Conan 2.0 + +Everything you need to know about the methods, commands line, outputs can be found in the +[Conan 2.0 Migrations](https://docs.conan.io/1/conan_v2.html) docs. + +This should be non-intrusive. Conan 2.0 by default has a different `CONAN_USER_HOME` location, which means that it has separate caches, profiles, and settings. +This will leave your Conan 1.0 setup completely intact when using Conan 2.0. + +> **Note**: There are substantial changes to the CLI so very few of the commands will remain the same. +> The new [Unified Command Pattern](https://docs.conan.io/1/migrating_to_2.0/commands.html#unified-patterns-in-command-arguments), +> as an example, changes how settings and options are passed. + +### Installing Conan 2.0 beta + +Simply install Conan 2.0 with `pip install conan --upgrade --pre`. + +You can confirm the installation with: + +```sh +$ conan --version +Conan version 2.0.0-beta3 +$ conan config home +Current Conan home: /Users/barbarian/.conan2 +``` + +> **Note**: You will most likely see +> +> ```sh +> Initialized file: '/Users/barbarian/.conan2/settings.yml' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/compatibility.py' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/app_compat.py' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/cppstd_compat.py' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/profile.py' +> ``` +> +> When running the client for the first time. + +You will need to setup profiles. This is one of the changes in 2.0. The default profile is now opt-in and no longer generated automatically. + +```sh +conan profile detect +``` + +> **Warning**: This is a best guess, you need to make sure it's correct. + +### Trying it out + +Try building an existing recipe. We'll repeat the 1.x example with `fmt` to build the same configurations: + +```sh +cd recipes/fmt +conan create all/conanfile.py --version 9.0.0 +conan create all/conanfile.py --version 9.0.0 -o fmt/9.0.0:header_only=True +conan create all/conanfile.py --version 9.0.0 -s build_type=Debug -o fmt/9.0.0:shared=True +``` diff --git a/docs/error_knowledge_base.md b/docs/error_knowledge_base.md new file mode 100644 index 0000000000000..2cd397492d49b --- /dev/null +++ b/docs/error_knowledge_base.md @@ -0,0 +1,503 @@ +# Errors from the conan-center hook (KB-Hxxx) + +These are located at [conan-io/hooks](https://github.com/conan-io/hooks/blob/master/hooks/conan-center.py). + +#### **#KB-H001: "DEPRECATED GLOBAL CPPSTD"** + +`Conan > 1.15` deprecated the usage of the global ``cppstd`` setting in favor of ``compiler.cppstd`` to [manage C++ standard](https://docs.conan.io/1/howtos/manage_cpp_standard.html). As a subsetting of the compiler, it shouldn't be declared in the `conanfile.py`. + +#### **#KB-H002: "REFERENCE LOWERCASE"** + +The package names in conan-center have to be [lowercase](https://github.com/conan-io/tribe/blob/main/design/017-lowercase-references.md). e.g: ``zlib/1.2.8``. + +#### **#KB-H003: "RECIPE METADATA"** + +The recipe has to declare the following attributes: + +- [url](https://docs.conan.io/1/reference/conanfile/attributes.html#url) +- [license](https://docs.conan.io/1/reference/conanfile/attributes.html#license) +- [description](https://docs.conan.io/1/reference/conanfile/attributes.html#description) +- [homepage](https://docs.conan.io/1/reference/conanfile/attributes.html#homepage). + +Also we recommend adding [topics](https://docs.conan.io/1/reference/conanfile/attributes.html#topics) attribute. + +#### **#KB-H005: "HEADER_ONLY, NO COPY SOURCE"** + +If the recipe calls [self.info.header_only()](https://docs.conan.io/1/howtos/header_only.html) in the [package_id()](https://docs.conan.io/1/reference/conanfile/methods.html#package-id) method and doesn't declare settings, it should use the [no_copy_source](https://docs.conan.io/1/reference/conanfile/attributes.html#no-copy-source) attribute to avoid unnecessary copies of the source code. + +#### **#KB-H006: "FPIC OPTION"** + +The recipe is not for a header-only library and should have an `fPIC` option: + +```python +class SomeRecipe(ConanFile): + ... + + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} +``` + +#### **#KB-H007: "FPIC MANAGEMENT"** + +The recipe declares `fPIC` but doesn't remove the option for Windows (where it doesn't make sense). + +```python +class SomeRecipe(ConanFile): + ... + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC +``` + +Or, a package is built as `shared` library and `fPIC` is declared. The option `fPIC` should be removed: + +```python +class SomeRecipe(ConanFile): + ... + + def configure(self): + if self.options.shared: + del self.options.fPIC +``` + +Here we use [configure()](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options) method, because user options are loaded after [config_options()](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options) only. + +#### **#KB-H008: "VERSION RANGES"** + +See [Dependencies Version Ranges](adding_packages/dependencies.md#version-ranges) for details. + +#### **#KB-H009: "RECIPE FOLDER SIZE"** + +The recipe folder (including the `test_package` folder) cannot exceed 256KB. + +#### **#KB-H010: "IMMUTABLE SOURCES"** + +Create a file [conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) in the recipe folder containing the source code origins: + +**_recipes/lib/1.2.0/conandata.yml_**: + +```yaml +sources: + 1.2.0: + url: "http://downloads.sourceforge.net/project/mylib/1.2.0/sources.tar.gz" + sha256: "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d" +``` + +Then in the recipe, you can access the data to download the URL and validate the checksum doing: + +```python +class SomeRecipe(ConanFile): + ... + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) +``` + +#### **#KB-H011: "LIBCXX MANAGEMENT"** + +If the library is detected as a pure C library (sources doesn't conatain any file with the following extensions: ["cc", "cpp", "cxx", "c++m", "cppm", "cxxm", "h++", "hh", "hxx", "hpp"]) then it has to remove the [compiler.libcxx](https://docs.conan.io/1/reference/config_files/settings.yml.html#c-standard-libraries-aka-compiler-libcxx) subsetting, because the cpp standard library shouldn't affect the binary ID: + +```python +class SomeRecipe(ConanFile): + ... + + def configure(self): + del self.settings.compiler.libcxx +``` + +#### **#KB-H012: "PACKAGE LICENSE"** + +The binary packages should contain a folder named `licenses` containing the contents (library, tool, etc) license/s. + +#### **#KB-H013: "DEFAULT PACKAGE LAYOUT"** + +The binary packages generally do not need any other files or folder except the following: `["lib", "bin", "include", "res", "licenses"]`. +This closely matches the default [`cpp_info`](https://docs.conan.io/1/reference/conanfile/methods.html#package-info) from the client. +The upstream package layout should be followed as much as possible, if a folder is not in the list (like `"share"`) then an exception +can very easily be added by adding it to [this list of exceptions](https://github.com/conan-io/hooks/blob/d587cfebbf2b31c16e477b79c0c2fd4501f60fc8/hooks/conan-center.py#L1089-L1090). + +> **Note**: We are in the process of evaluating this rule, looking at calculating the size impact for problematic packages + +#### **#KB-H014: "MATCHING CONFIGURATION"** + +The binary package contains some file that not corresponds to the configuration of the package, for example, binary libraries for a header-only library, a DLL file when the `settings.os != Windows` and so on. The error message will contain information about the offending file. + +#### **#KB-H015: "SHARED ARTIFACTS"** + +The binary package is shared (self.options.shared == True) but there is no `dll`, `so` or `dylib` files inside the package. + +#### **#KB-H016: "CMAKE-MODULES-CONFIG-FILES"** + +The binary package cannot contain module or config CMake files ("Find\*.cmake", "\*Config.cmake", "\*-config.cmake"). +The package shouldn't contain specific build-system files to inform to the consumers how to link with it. +In order to make sure that the package will be consumed with any build-system, conan-center repository encourages to declare a [def package_info(self)](https://docs.conan.io/1/reference/conanfile/methods.html#package-info) method with all the needed information about the package. + +The consumers of the package will be able to consume the packages using a specific [generators](https://docs.conan.io/1/using_packages/conanfile_txt.html#generators) for the build system they use. + +See also: [Why are CMake find/config files and pkg-config files not packaged?](faqs.md#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged). + +#### **#KB-H017: "PDB FILES NOT ALLOWED"** + +Because of the big size of the [PDB](https://github.com/Microsoft/microsoft-pdb) files (Program Databse, a debug information format) and the issues using them changing the original folders, the PDB files are not allowed to be packaged. + +See also: [Why PDB files are not allowed?](faqs.md#why-pdb-files-are-not-allowed). + +#### **#KB-H018: "LIBTOOL FILES PRESENCE"** + +Packaging [libtool files](https://www.linuxfromscratch.org/blfs/view/svn/introduction/la-files.html) (\*.la) instead of library files (\*.a) is not allowed. + +#### **#KB-H019: "CMAKE FILE NOT IN BUILD FOLDERS"** + +Some file with `*.cmake` extension has been found in a folder not declared in [cpp_info.builddirs](https://docs.conan.io/1/reference/conanfile/attributes.html#cpp-info). +It is only allowed to put build files in `builddirs` because the generators might be able to include them when needed, but only if they are located in well known paths. + +#### **#KB-H020: "PC-FILES"** + +For the same reasons explained at [KB-H016](#KB-H016) it is not allowed to package `*.pc` files. + +See also: [Why are CMake find/config files and pkg-config files not packaged?](faqs.md#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged). + +#### **#KB-H021: "MS RUNTIME FILES"** + +For the legal reasons, and in order to reduce the size of packages, it's not allowed to package Microsoft Visual Studio runtime libraries, such as `msvcr80.dll`, `msvcp80.dll`, `vcruntime140.dll` and so on. + +#### **#KB-H022: "CPPSTD MANAGEMENT"** + +If the library is detected as a pure C library (sources doesn't conatain any file with the following extensions: ["cc", "cpp", "cxx", "c++m", "cppm", "cxxm", "h++", "hh", "hxx", "hpp"]) then it has to remove the [compiler.cppstd](https://docs.conan.io/1/howtos/manage_cpp_standard.html) subsetting, because the cpp standard library shouldn't affect the binary ID: + +```python +class SomeRecipe(ConanFile): + ... + + def configure(self): + del self.settings.compiler.cppstd +``` + +#### **#KB-H023: "EXPORT LICENSE"** + +A recipe should not export any license file, as all recipes are under the same license type (in the root of this repo). + +```python +class SomeRecipe(ConanFile): + ... + + exports = "LICENSE.md" # not allowed +``` + +There is a complete explanation in the [FAQ](faqs.md#should-recipes-export-a-recipes-license). + +#### **#KB-H024: "TEST PACKAGE FOLDER"** + +The [test_package](https://docs.conan.io/1/creating_packages/getting_started.html) folder is required for every recipe in Conan Center Index. + +``` +. conanfile.py +. test_package + |- conanfile.py +``` + +#### **#KB-H025: "META LINES"** + +The following metadata lines (and similiar) are not allowed in recipes: + +- [Shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) to specify Python version: + +```python +#!/usr/bin/env python # not allowed +#!/usr/local/bin/python # not allowed + +class SomeRecipe(ConanFile): + ... +``` + +- [Vim](https://www.vim.org/) configuration: + +```python +# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # not allowed + +class SomeRecipe(ConanFile): + ... +``` + +- [Encoding](https://www.python.org/dev/peps/pep-0263/): + +```python +# -*- coding: utf-8 -*- # not allowed +# coding=utf-16 # not allowed + +class SomeRecipe(ConanFile): + ... +``` + +#### **#KB-H027: "CONAN CENTER INDEX URL"** + +The attribute [url](https://docs.conan.io/1/reference/conanfile/attributes.html#url) should point to the address where the recipe is located. +The current Conan Center Index address is + +#### **#KB-H028: "CMAKE MINIMUM VERSION"** + +All CMake files added to recipe package should contain a [minimal version](https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html) (Not necessarily 2.8.11, it can be any version) available in the file: + +```cmake +# CMakeLists.txt +cmake_minimum_required(VERSION 2.8.11) +project(conanwrapper) + +... +``` + +#### **#KB-H029: "TEST PACKAGE - RUN ENVIRONMENT"** + +The [RunEnvironment()](https://docs.conan.io/1/reference/build_helpers/run_environment.html#runenvironment) build helper is no longer needed in the `test_package/conanfile.py`. It has been integrated by [run_environment](https://docs.conan.io/1/devtools/running_packages.html#running-from-packages) parameter. + +```python +# test_package/conanfile.py +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + self.run("bin/test", run_environment=True) +``` + +#### **#KB-H030: "CONANDATA.YML FORMAT"** + +The structure of the [conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) file should follow the schema +defined in [Adding Packages - `Conandata.yml` Format](adding_packages/conandata_yml_format.md). + +#### **#KB-H031: "CONANDATA.YML REDUCE"** + +This [hook](https://docs.conan.io/1/extending/hooks.html) re-creates the information of the [conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) file, discarding the fields not relevant to the version of the package exported. This avoids creating new recipe revisions for every new change introduced in the file. +Any additional field in the YAML file will raise an error. + +#### **#KB-H032: "SYSTEM REQUIREMENTS"** + +[System requirements](https://docs.conan.io/1/reference/conanfile/methods.html#systempackagetool) can be used as an option when a Conan package is not available ,the same package can be installed by system package manager. However, it can cause reproducibility problems, since the package may vary according the distribution or OS. Conan is not able to track its metadata, so that, installing system packages by recipe is not allowed. + +See also: [Can I install packages from the system package manager?](faqs.md#can-i-install-packages-from-the-system-package-manager). + +#### **#KB-H034: "TEST PACKAGE - NO IMPORTS()"** + +The method [imports](https://docs.conan.io/1/reference/conanfile/methods.html#imports) helps the test package stage copying all dynamic libraries and special resources. However, the [run_environment](https://docs.conan.io/1/reference/conanfile/other.html#running-commands) parameter, used when running commands, is able to solve all paths to the dynamic libraries installed in your cache. + +#### **#KB-H037: "NO AUTHOR"** + +Since the entire community is maintaining all CCI recipes, putting just one name in a recipe is unfair, putting all names is unmanageable. All authors can be found in the Git logs. + +#### **#KB-H040: "NO TARGET NAME"** + +According the Conan issue [#6269](https://github.com/conan-io/conan/issues/6269), the attribute `cpp_info.name` should be avoided for Conan Center Index in favor of `cpp_info.names["cmake_find_package"]` and `cpp_info.names["cmake_find_package_multi"]`. + +See also: [Migrating legacy cpp_info attributes to set_property()](https://docs.conan.io/1/migrating_to_2.0/properties.html). + +#### **#KB-H041: "NO FINAL ENDLINE"** + +Source files should end with a final endline. +This avoids potential warnings/errors like `no new line at the end of file`. + +#### **#KB-H044: "NO REQUIRES.ADD()"** + +Both `self.requires.add()` and `self.build_requires.add()` have been deprecated in favor of [self.requires()](https://docs.conan.io/1/reference/conanfile/methods.html#requirements) and [self.build_requires()](https://docs.conan.io/1/reference/conanfile/methods.html#build-requirements) which were introduced on Conan 1.x. Both `add()` were introduced during Conan 0.x and since Conan 1.23 they no longer follow the original behavior. + +#### **#KB-H045: "DELETE OPTIONS"** + +The method `self.options.remove()` was introduced in Conan 0.x, however, Conan 1.x brings a more pythonic way for removing options from your recipe: `del self.options.` + +See also: [configure(), config_options()](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options). + +#### **#KB-H046: "CMAKE VERBOSE MAKEFILE"** + +The CMake definition [CMAKE_VERBOSE_MAKEFILE](https://cmake.org/cmake/help/latest/variable/CMAKE_VERBOSE_MAKEFILE.html) helps for debugging when developing, however, for regular CI build, it increases the log size and it's only required when problems occur and need to be verified. + +#### **#KB-H048: "CMAKE VERSION REQUIRED"** + +> **Warning**: This is a legacy Conan 1.x details from the deprecated generators + +The file test_package/CMakeLists.txt should require CMake 3.15 by default: [cmake_minimum_required(VERSION 3.15)](https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html). The CMake wrapper file can require CMake 2.8, because Conan recipe and the test package are totally separated. However, if [CMAKE_CXX_STANDARD](https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_STANDARD.html) or [CXX_STANDARD](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD) is explicit, CMake 3.1 is mandatory. + +#### **#KB-H049: "CMAKE WINDOWS EXPORT ALL SYMBOLS"** + +The CMakeLists.txt definitions [CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS](https://cmake.org/cmake/help/v3.4/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.html) and [WINDOWS_EXPORT_ALL_SYMBOLS](https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html) are available since CMake 3.4 only. Any previous version will ignore it. + +#### **#KB-H050: "DEFAULT SHARED OPTION VALUE"** + +By default, all packages should be built as static library (the option ``shared`` is ``False`` in ``default_options``). However, some projects can be restricted to shared library only, for those cases, open a new [issue](https://github.com/conan-io/hooks/issues) to include the package name in the allowlist. + +#### **#KB-H051: "DEFAULT OPTIONS AS DICTIONARY"** + +The attribue [default_options](https://docs.conan.io/1/reference/conanfile/attributes.html#default-options) should be a dictionary, for example `default_options = {'shared': False, 'fPIC': True}`. + +#### **#KB-H052: "CONFIG.YML HAS NEW VERSION"** + +It's important to have new library version defined in both [config.yml](adding_packages/folders_and_files.md#configyml) and +[conandata.yml](adding_packages/folders_and_files.md#conandatayml), otherwise newly added version will not be checked and built +by CI and will not be available for download. + +#### **#KB-H053: "PRIVATE IMPORTS"** + +The recipe imports private Conan API, this is strongly discouraged - private imports are subjects to breaking changes. Avoid usage of private APIs, +request to publicly expose needed methods, if necessary. + +#### **#KB-H054: "LIBRARY DOES NOT EXIST"** + +Libraries which are listed on [Components](https://docs.conan.io/1/creating_packages/package_information.html#package-information-components) must be present in [libdirs](https://docs.conan.io/1/reference/conanfile/attributes.html#cpp-info). Check if the library name is correct, or if a library is only generated for a specific platform. + +#### **#KB-H055: "SINGLE REQUIRES"** + +Do not use [requirements()](https://docs.conan.io/1/reference/conanfile/methods.html#requirements) method and [self.requires](https://docs.conan.io/1/reference/conanfile/attributes.html#requires) attribute together in the same recipe. +The duality creates a heterogeneous way of solving dependencies, making it difficult to review and susceptible to prone errors. + +#### **#KB-H056: "LICENSE PUBLIC DOMAIN"** + +See [License Attribute](adding_packages/conanfile_attributes.md#license-attribute) for details. + +#### **#KB-H057: "TOOLS RENAME"** + +The [rename()](https://docs.conan.io/1/reference/conanfile/tools/files.html#conan-tools-rename) method will be the standard for Conan 2.0, and +also, it uses [robocopy](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy), which is safer on Windows. + +#### **#KB-H058: "ILLEGAL CHARACTERS"** + +Windows [naming conventions](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) and [reserved](https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words) characters must be avoided for file naming, otherwise the will not be supported on Windows. + +#### **#KB-H059: "CLASS NAME"** + +Generic class names can cause review confusion. To keep a better naming, it should use `Conan`. + +#### **#KB-H060: "NO CRLF"** + +Files with [CRLF](https://en.wikipedia.org/wiki/Newline) as endline can cause CI errors when building a package, due the conversion to LF and false detection from CI as changed file. +The [.gitattributes](https://git-scm.com/docs/gitattributes) file lists which files should be converted to LF when commit. However, if you want to enforce it in your local copy, you may run: + + > git config --local core.autocrlf false + > git config --local core.eol lf + +The [core.autocrlf](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration) disabled means that git will not convert from CRLF to LF on commit. The [core.eol](https://git-scm.com/docs/git-config) sets the specific line ending to be used for every commit. + +#### **#KB-H062: "TOOLS CROSS BUILDING"** + +Replace all occurrences of `tools.cross_building(self.settings)` with [tools.cross_building(self)](https://docs.conan.io/1/reference/tools.html#tools-cross-building). +When cross building, conan needs to compare [self.settings](https://docs.conan.io/1/reference/conanfile/attributes.html#settings) and [self.settings_build](https://docs.conan.io/1/systems_cross_building/cross_building.html), which are attributes of `self`. + +#### **#KB-H064: "INVALID TOPICS"** + +An invalid [topic](https://docs.conan.io/1/reference/conanfile/attributes.html#topics) has been detected. Remove or rename it. +Right now, topic `conan` is considered redundant and it's not needed to explicitly list it within recipe. + +#### **#KB-H065: "NO REQUIRED_CONAN_VERSION"** + +The recipe misses [required_conan_version](https://docs.conan.io/1/reference/conanfile/other.html#requiring-a-conan-version-for-the-recipe) attribute. +It may happen due to the usage of new features within recipe (such as `strip_root` parameter of the [tools.get](https://docs.conan.io/1/reference/conanfile/tools/files/downloads.html#conan-tools-files-get) helper). +The policy of Conan Center Index to support only the latest version of the Conan Client, so it's safe to put the version Conan Center Index currently runs into the recipe. +Otherwise, it's not an easy task on its own to determine the minimal version that has to be specified: checking the Conan Client [Changelog](https://docs.conan.io/1/changelog.html), one has to know in which Conan Client releases all the attributes, methods, build helpers, etc. used by the recipe were first introduced, and then select the most recent of them. +Consider adding the following code: + +```python +required_conan_version = ">=1.43.0" # use the version that Conan Center Index runs + +class SomeRecipe(ConanFile): + ... + +``` + +See also: [Submitting a Package](adding_packages/README.md#submitting-a-package). + +#### **#KB-H066: "SHORT_PATHS USAGE"** + +The recipe missess [short_paths](https://docs.conan.io/1/reference/conanfile/attributes.html#short-paths) attribute. +It may happen due to the very long paths within source, build or package directories during the package creating. +Consider adding the following code: + +```python +class SomeRecipe(ConanFile): + ... + + short_paths = True +``` + +See also: [Maximum Path Length Limitation](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd). + +#### **#KB-H068: "TEST_TYPE MANAGEMENT"** + +In Conan 2.0, see [migration guide](https://docs.conan.io/1/migrating_to_2.0/recipes.html#changes-in-the-test-package-recipe), +the `test_package/conanfile.py` needs to declare the requirement being tested explicitly. To be prepared you +have to set the attribute `test_type="explicit"` (this will be ignored in 2.0) to make Conan activate the explicit +mode, then declaring the requirement using the `self.tested_reference_str` that contains the reference being tested. + +#### **#KB-H069: "TEST PACKAGE - NO DEFAULT OPTIONS"** + +This is to ensure the exact package that is built and uploaded is tested against. When `options` of `default_options` are modified in a +`test_package` it can possibly result in the graph being modified. The objective is to enforce quality of the packages and to avoid confusing +"missing packages" errors. + +#### **#KB-H070: "MANDATORY SETTINGS"** + +> :information_source: This rule was put in place as it was deemed safe for evaluation however there is room for improvement + +ConanCenter operates is profiles with a predefined list of settings, all of these much be present in the recipe to ensure `package_id`s are +computed correctly. Some libraries, for instance header-only, do not require all the settings and those should be deleted from the `package_id`. +This approach ensure consistency and reduces the learning curve. + +Recipes should include: + +```python +class SomeRecipe(ConanFile): + ... + + settings = "os", "compiler", "build_type", "arch" +``` + +- For header-only recipes ([example](https://github.com/conan-io/conan-center-index/blob/3a773e2d69ada3bd931252c43a48daf636ddfe87/recipes/eigen/all/conanfile.py#L35-L36)): + + ```python + def package_id(self): + self.info.header_only() + ``` + +There is the case when the package is header-only, but the options affects the generated artifact, (e.g. kanguru, pagmo2 ...), so you need to use `self.info.settings.clear()` instead. + +- @prince-chrismc This needs to a better example; For "tool" recipes ([example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/cmake/3.x.x/conanfile.py#L104-L105)) which only provide binaries, see [our packaging policy](adding_packages/build_and_package.md) for more, should do as follows: + + ```python + def package_id(self): + del self.info.settings.compiler + ``` + +#### **#KB-H071: "INCLUDE PATH DOES NOT EXIST"** + +It's erroneous to leave the default `include` directory when it's not present. Consider adding: + +```python +def package_info(self): + self.cpp_info.includedirs = [] +``` + +#### **#KB-H072: "PYLINT EXECUTION"** + +Pylint is executed by default over all `conanfile.py` files in ConanCenterIndex and it should not be skipped. It's an important tool which helps us keep a standard level of acceptance. Otherwise, it would be incredibly hard to review all recipes and keep them to the same level of standards. + +#### **#KB-H073: "TEST V1 PACKAGE FOLDER"** + +The legacy content in test_package should not be removed. Instead, rename that folder to `test_v1_package` and create a new `test_package` folder following the [file structure](adding_packages/README.md#recipe-files-structure) related to Conan v2 and v1 compatibility. Also, you can obtain good examples of Conan v2 test packages from the [template packages](package_templates/README.md) folder. + +#### **#KB-H075: "REQUIREMENT OVERRIDE PARAMETER"** + +The [self.requires()](https://docs.conan.io/1/reference/conanfile/methods.html#requirements) allows to override a dependency version, forcing to use that version imposed by the recipe only. As a side-effect, dependencies can use different versions of the same project at the same package, which may cause unpredicted errors, like ABI incompatibility. For that reason, the `override` parameter is forbidden and should not be used. Instead, all dependencies should align their package versions, even when it's necessary to open more pull requests to update dependency versions. + +#### **#KB-H076: "EITHER STATIC OR SHARED OF EACH LIB"** + +It checks whether static & shared artifacts of the same lib are packaged together. Also, if there are tuples of (.a/.dylib) or (.a/.so) files with the same name. +So it works on Unix systems only, not Windows. Putting both same library name as shared and static in the very same package is considered an error, as it should be separated +and managed by the package option `shared`. + +#### **#KB-H077: "APPLE RELOCATABLE SHARED LIBS"** + +It checks whether installed shared libs are relocatable on Linux & macOS. All shared libs on macOS properly have `@rpath/` in install tree (@rpath token is supported since macOS 10.5 Leopard). + +## Deprecated errors + +The following errors from the hooks are deprecated and no longer reported: + +### **#KB-H047: "NO ASCII CHARACTERS"** + +According to PEP [263](https://www.python.org/dev/peps/pep-0263/), Unicode literals should only appear in Python code if the encoding is declared on one of the first two lines of the source file. Without such a declaration, any Unicode literal will cause a syntax error for Python 2 interpreters. diff --git a/docs/faqs.md b/docs/faqs.md new file mode 100644 index 0000000000000..80b4a41020b98 --- /dev/null +++ b/docs/faqs.md @@ -0,0 +1,466 @@ +# FAQs + +This section gathers the most common questions from the community related to packages and usability of this repository. + + +## Contents + + * [What is the policy on recipe name collisions?](#what-is-the-policy-on-recipe-name-collisions) + * [What is the policy on creating packages from pre-compiled binaries?](#what-is-the-policy-on-creating-packages-from-pre-compiled-binaries) + * [Should reference names use `-` or `_`?](#should-reference-names-use---or-_) + * [Why are CMake find/config files and pkg-config files not packaged?](#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged) + * [Should recipes export a recipe's license?](#should-recipes-export-a-recipes-license) + * [Why recipes that use build tools (like CMake) that have packages in Conan Center do not use it as a build require by default?](#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default) + * [How are rare build systems without generators packaged?](#how-are-rare-build-systems-without-generators-packaged) + * [Are python requires allowed in the `conan-center-index`?](#are-python-requires-allowed-in-the-conan-center-index) + * [What version should packages use for libraries without official releases?](#what-version-should-packages-use-for-libraries-without-official-releases) + * [Is the Jenkins orchestration library publicly available?](#is-the-jenkins-orchestration-library-publicly-available) + * [Why not x86 binaries?](#why-not-x86-binaries) + * [But if there are no packages available, what will the x86 validation look like?](#but-if-there-are-no-packages-available-what-will-the-x86-validation-look-like) + * [Do static libraries tend to be compiled as PIC by default?](#do-static-libraries-tend-to-be-compiled-as-pic-by-default) + * [Why PDB files are not allowed?](#why-pdb-files-are-not-allowed) + * [Why is there no option for PDB, as there is for fPIC?](#why-is-there-no-option-for-pdb-as-there-is-for-fpic) + * [Doesn't this make debug builds useless?](#doesnt-this-make-debug-builds-useless) + * [Can I remove an option from a recipe?](#can-i-remove-an-option-from-a-recipe) + * [Can I split a project into an installer and library package?](#can-i-split-a-project-into-an-installer-and-library-package) + * [What license should I use for Public Domain?](#what-license-should-i-use-for-public-domain) + * [What license should I use for a custom project specific license?](#what-license-should-i-use-for-a-custom-project-specific-license) + * [How do I flag a problem to a recipe consumer?](#how-do-i-flag-a-problem-to-a-recipe-consumer) + * [Why is a `build.check_min_cppstd` call not enough?](#why-is-a-buildcheck_min_cppstd-call-not-enough) + * [What is the policy for adding older versions of a package?](#what-is-the-policy-for-adding-older-versions-of-a-package) + * [What is the policy for removing older versions of a package?](#what-is-the-policy-for-removing-older-versions-of-a-package) + * [Can I install packages from the system package manager?](#can-i-install-packages-from-the-system-package-manager) + * [Why ConanCenter does not build and execute tests in recipes](#why-conancenter-does-not-build-and-execute-tests-in-recipes) + * [Why not add an option to build unit tests](#why-not-add-an-option-to-build-unit-tests) + * [What is the policy for supported python versions?](#what-is-the-policy-for-supported-python-versions) + * [How to package libraries that depend on proprietary closed-source libraries?](#how-to-package-libraries-that-depend-on-proprietary-closed-source-libraries) + * [How to protect my project from breaking changes in recipes?](#how-to-protect-my-project-from-breaking-changes-in-recipes) + * [What's the policy on version ranges?](#whats-the-policy-on-version-ranges) + * [How to consume a graph of shared libraries?](#how-to-consume-a-graph-of-shared-libraries) + * [How to watch only specific recipes?](#how-to-watch-only-specific-recipes) + * [Is it possible to disable Pylint?](#is-it-possible-to-disable-pylint) + * [How long can I be inactive before being removed from the authorized users list?](#how-long-can-i-be-inactive-before-being-removed-from-the-authorized-users-list) + * [Can we add package which are parts of bigger projects like Boost?](#can-we-add-package-which-are-parts-of-bigger-projects-like-boost) + * [Can I add my project which I will submit to Boost?](#can-i-add-my-project-which-i-will-submit-to-boost) + * [Can I add options that do not affect `package_id` or the package contents](#can-i-add-options-that-do-not-affect-package_id-or-the-package-contents) + * [Can I use full_package_mode for a requirement in my recipe?](#can-i-use-full_package_mode-for-a-requirement-in-my-recipe) + +## What is the policy on recipe name collisions? + +Packages generated by the build service and uploaded to Conan Center follow the structure of `/` for the reference. Although the ecosystem of C/C++ open-source libraries is not as big as in other languages there is still a risk of having a name collision for the names of the package. + +This repository will try to follow the most well-known names for each of the recipes contributed, paying attention to all the contributions and checking any collision with other popular libraries beforehand. In the case of having to face disambiguation (due to different libraries with the same name), we would look at other sources and look for a consensus. + +However, if it is not possible and there is the case of a new recipe producing a name collision, the first recipe contributed will have precedence over it. Generally, recipes contributed to the repo won't change its name in order to not break users. + +For example, `GSL` is the name of `Guidelines Support Library` from Microsoft and `GNU Scientific Library` from GNU. Both libraries are commonly known as `gsl`, however, to disambiguate (if there is already a `gsl` package in this repo) we could use `ms-gsl` in the first case or `gnu-gsl` in the second. + +## What is the policy on creating packages from pre-compiled binaries? + +The policy is that in the general case [recipes should build packages from sources](adding_packages/sources_and_patches.md#picking-the-sources), because of reproducibility and security concerns. The implication is that the sources must be publicly available, and in a format that can be consumed programmatically. + +See [Picking Sources](adding_packages/sources_and_patches.md#picking-the-sources) for more information. + +## Should reference names use `-` or `_`? + +Recipes should stick to the original name of a library as much as possible. For example `libjpeg-turbo`, `expected-lite` and `optional-lite` have a `-` in their original names. + +In the case of spaces in the name, the most common approach is to use `_` as done in `xz_utils`. + +For libraries with a too generic name, like `variant`, the name of the organization can be used as prefix separated by a `-`, like `mpark-variant`, `tl-expected` or `taocpp-tuple`. + +## Why are CMake find/config files and pkg-config files not packaged? + +We know that using `find_package()` and relying on the CMake behavior to find the dependencies is something that should be avoided in favor of the information provided by the package manager. + +Conan has an abstraction over the packages build system and description by using [generators](https://docs.conan.io/1/reference/generators.html). Those generators translate the information of the dependency graph and create a suitable file that can be consumed by your build system. + +In the past, we have found that the logic of some of the CMake's find/config or pkg-config files can lead to broken scenarios due to issues with: + +- Transitive dependencies: The find logic of CMake can lead to link libraries with system libraries instead of the ones specified in the conanfile. +- Different build type configurations: Usually those files are not prepared to handle multi-configuration development while switching between release/debug build types for example. +- Absolute paths: Usually, those files include absolute paths that would make the package broken when shared and consumed. +- Hardcoded versions of dependencies as well as build options that make overriding dependencies from the consumer not possible. + +We believe that the package manager should be the one responsible to handle this information in order to achieve a deterministic and controlled behavior. +Regarding the integration with CMake, Conan already provides ways to consume those packages in the same way by using generators like [cmake_find_package](https://docs.conan.io/1/reference/generators/cmake_find_package.html)* or [cmake_find_package_multi](https://docs.conan.io/1/reference/generators/cmake_find_package.html) and features like [components](https://docs.conan.io/1/creating_packages/package_information.html#using-components) to define internal libraries of a package and generate proper CMake targets or [build_modules](https://docs.conan.io/1/reference/conanfile/attributes.html) to package build system utilities like CMake macros. + +Defining the package information in the recipe is also useful in order to consume those packages from a different build system, for example using pkg-config with the [pkg_config generator](https://docs.conan.io/1/reference/generators/pkg_config.html). + +Finally, by not allowing these files we make packages agnostic to the consumer as the logic of those files is not in the package but in the way the consumer wants the information. + +If you really think this is an issue and there is something missing to cover the use case of a library you want to contribute to ConanCenter, please do not hesitate to open an issue and we will be happy to hear your feedback. + +\* Take a look at the integrations section to learn more: https://docs.conan.io/1/integrations/build_system/cmake/cmake_find_package_generator.html + +## Should recipes export a recipe's license? + +No, recipes do not need to export a recipe license. Recipes and all files contributed to this repository are licensed under the license in the root of the repository. Using any recipe from this repository or directly from conan-center implies the same licensing. + +## Why recipes that use build tools (like CMake) that have packages in Conan Center do not use it as a build require by default? + +We generally consider tools like CMake as a standard tool to have installed in your system. Having the `cmake` package as a build require in **all** the recipes that use it will be an overkill, as every build requirement is installed like a requirement and takes time to download. However, `cmake` could still be useful to use in your profile: + +``` +[tool_requires] +cmake/3.17.2 +``` + +Other packages using more unusual build tools should refer to the [Dependencies - Adding Build Requirements](adding_packages/dependencies.md#build-requirements) section for more information. + +## How are rare build systems without generators packaged? + +The C++ ecosystem has a lot of rare, unique and obscure build systems. Some of these are available in ConanCenter but they do not have built-in generators from the main Conan client. +The recipe is expected to encode the specifics of the build system, mapping the `settings`, `options` for the binary configuration, and also mapping `self.dependencies` so the build system can locate the dependencies libraries as required. +For these cases, contributors are asked to help reviewers as much as possible as it's likely we will not have expertise. + +> TODO: Add a link to docs.conan.io which explains how to write a custom generator in the 2.0 sense + +For quality assurance the build service is expected to be green and the [hooks](https://github.com/conan-io/hooks) will ensure the package contents match what is expected given the options. These recipes are more likely to have +inconsistency with other recipes but make for excellent contributions. + +## Are python requires allowed in the `conan-center-index`? + +Unless they are a general and extended utility in recipes (in which case, we should study its inclusion in the Conan tools module), python requires are not allowed in `conan-center-index` repository. + +## What version should packages use for libraries without official releases? + +This happens for a number of reasons, some projects have a "live on main" others are less maintained but still merge pull requests. +Read about the [ConanCenter specific version format](adding_packages/conanfile_attributes.md#conancenter-specific-releases-format) for more information. + +## Is the Jenkins orchestration library publicly available? + +Currently, the Jenkins orchestration library for this build service is not available. We believe this solution is too specific for this purpose, as we are massively building binaries for many configurations and the main purpose of a CI system with Conan in an organization should be to rebuild only the need packages. However, we know this could be interesting for organizations in order to learn new approaches for CI flows. We will release this information and CI flow recommendations as soon as possible. + +## Why not x86 binaries? + +As described in the [Supported platforms and configurations](supported_platforms_and_configurations.md), only the x86_64 architecture is available for download, the rest must be built from sources. The reasons behind this decision are: + +* Few users need different pre-built packages that are not x86_64 packages, this number is less than 10% of total users (data obtained through the download counter from Bintray), and tends to decrease over the years; +* Some OS are putting the x86 as obsolete, examples [macOS](https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes) and Ubuntu 20.04; +* For security reasons, most companies build their own packages from sources, even if they already have a pre-built version available, which further reduces the need for extra configurations; +* Each recipe results in around 130 packages, and this is only for x86_64, but not all packages are used, some settings remain with zero downloads throughout their life. So, imagine adding more settings that will rarely be used, but that will consume more resources as time and storage, this leaves us in an impractical situation. + +### But if there are no packages available, what will the x86 validation look like? + +As stated earlier, any increase in the number of configurations will result in an impractical scenario. In addition, more validations require more review time for a recipe, which would increase the time for all PRs, delaying the release of a new package. For these reasons, x86 is not validated by the CCI. + +We often receive new fixes and improvements to the recipes already available for x86_64, including help for other architectures like x86 and ARM. In addition, we also receive new cases of bugs, for recipes that do not work on a certain platform, but that are necessary for use, which is important to understand where we should put more effort. So we believe that the best way to maintain and add support for other architectures is through the community. + +## Do static libraries tend to be compiled as PIC by default? + +Yes! You can learn more about default options in [Packaging Policy](adding_packages/conanfile_attributes.md#predefined-options-and-known-defaults). + +## Why PDB files are not allowed? + +The project initially decided not to support the PDB files primarily due to the size of the final package, which could add an exaggerated size and not even used by users. In addition, PDB files need the source code to perform the debugging and even follow the path in which it was created and not the one used by the user, which makes it difficult to use when compared to the regular development flow with the IDE. + +However, there are ways to get around this, one of them is through the [/Z7](https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format) compilation flag, which can be passed through [environment variables](https://docs.microsoft.com/en-us/cpp/build/reference/cl-environment-variables). You can use your [profile](https://docs.conan.io/1/reference/profiles.html#package-settings-and-env-vars) to customize your compiler command line. + +### Why is there no option for PDB, as there is for fPIC? + +Adding one more common option, it seems the most simple and obvious solution, but it contains a side effect already seen with fPIC. It is necessary to manage the entire recipe, it has become a Boilerplate. So, adding PDB would be one more point to be reviewed for each recipe. In addition, in the future new options could arise, such as sanity or benchmark, further inflating the recipes. For this reason, a new option will not be added. However, the inclusion of the PDB files is discussed in issue [#1982](https://github.com/conan-io/conan-center-index/issues/1982) and there are some ideas for making this possible through a new feature. If you want to comment on the subject, please visit issue. + +### Doesn't this make debug builds useless? + +No. The PDBs are only needed to debug dependency code. By providing the libraries you are able to link and build your application and debug your own code. +This is by far the more common scenario which we want to enable. + +## Can I remove an option from a recipe? + +It's preferable to leave all options (ie. not removing them) because it may break other packages which require those deleted options. +Prefer the deprecation path with a mapping from old options to new ones: + +* Add "deprecated" as option value +* Set "deprecated" as default option +* Check the option value, if the value is different from "deprecated", raise a warning +* Remove the option from Package ID + +```python +options = {"foobar": [True, False, "deprecated"]} +default_options = {"foobar": "deprecated"} + +def configure(self): + if self.options.foobar != "deprecated": + self.output.warning("foobar option is deprecated, do not use anymore.") + +def package_id(self): + del self.info.options.foobar +``` + +This is the safest way, users will be warned of deprecation and their projects will not risk breaking. +As additional examples, take a look on follow recipes: [dcmtk](https://github.com/conan-io/conan-center-index/blob/5e6089005f0bb66cd16db7b0e5f37f5081c7820c/recipes/dcmtk/all/conanfile.py#L24), [gtsam](https://github.com/conan-io/conan-center-index/blob/f7f18ab050e5d97fac70932b0ba4c115a930958c/recipes/gtsam/all/conanfile.py#L40) +and [libcurl](https://github.com/conan-io/conan-center-index/blob/f834ee1c82564199fdd9ca2f95231693c1a7136a/recipes/libcurl/all/conanfile.py#L24). + +However, if logic is too complex (this is subjective and depends on the Conan review team) then just remove the option. +After one month, we will welcome a PR removing the option that was deprecated. + +## Can I split a project into an installer and library package? + +No. Some projects provide more than a simple library, but also applications. For those projects, both libraries and executables should be kept together under the same Conan package. In the past, we tried to separate popular projects, like Protobuf, and it proved to be a complex and hard task to be maintained, requiring custom patches to disable parts of the building. Also, with the [context](https://docs.conan.io/1/systems_cross_building/cross_building.html#conan-v1-24-and-newer) feature, we can use the same package as build requirement, for the same build platform, and as a regular requirement, for the host platform, when cross-building. It's recommended using 2 profiles in that case, one for build platform (where the compilation tools are being executed) and one for host platform (where the generated binaries will run). + +## What license should I use for Public Domain? + +See [License Attribute](adding_packages/conanfile_attributes.md#license-attribute) for details. + +## What license should I use for a custom project specific license? + +See [License Attribute](adding_packages/conanfile_attributes.md#license-attribute) for details. + +## How do I flag a problem to a recipe consumer? + +Regardless of why, if the recipe detects a problem where binaries might not be generated correctly, an exception must be raised. This to prevent the publishing +incorrect packages which do not work as intended. Use `ConanInvalidConfiguration` which is specially support in ConanCenter. + +```py +raise ConanInvalidConfiguration(f"The project {self.ref} requires liba.enable_feature=True.") +``` + +You should not be using the `self.output.warn` and it is not enough to alter consumers or stop the build service. + +## Why is a `build.check_min_cppstd` call not enough? + +Very often C++ projects require a minimum standard version, such as 14 or 17, in order to compile. Conan offers tools which enable checking the relevant setting is enabled and above this support for a certain version is present. Otherwise, it uses the compiler's default. + +```python +def configure(self): + build.check_min_cppstd(self, 14) 👈 Wrong! +``` + +This fails to cover the vast number of use cases for the following reasons: + +1. `cppstd` is not configured in the `--detect`ed profiles generated by Conan, the majority of users simply do not have this setting. +2. A shocking number of projects override this setting within their respective build scripts, this setting does not get applied in those cases. +3. Conan-Center-Index does **not** manage the `cppstd` setting for the compilers it supports to generate binaries. + +```python +def validate(self): + # 👇 Correct + if self.settings.compiler.cppstd: + build.check_min_cppstd(self, 14) +``` + +As a result, all calls to `build.check_min_cppstd` must be guarded by a check for the setting and the only way to ensure the C++ standard is to check the compiler's version to know if it offers sufficient support. An example of this can be found [here](https://github.com/conan-io/conan/issues/8002). + +## What is the policy for adding older versions of a package? + +See [Adding older versions](adding_packages/sources_and_patches.md#adding-old-versions) for details. + +## What is the policy for removing older versions of a package? + +See [Removing older versions](adding_packages/sources_and_patches.md#removing-old-versions) for details. + +## Can I install packages from the system package manager? + +It depends. You can not mix both regular projects with system packages, but you can provide package wrappers for system packages. However, Conan can not track system packages, like their version and options, which creates a fragile situation where affects libraries and binaries built in your package but can not be totally reproduced. +Also, system package managers require administrator permission to install packages, which is not always possible and may break limited users. Moreover, more than one Conan package may require the same system package and there is no way to track their mutual usage. + +The hook [KB-H032](error_knowledge_base.md#KB-H032) does not allow `system_requirement` nor `SystemPackageTool` in recipes, to avoid mixing both regular projects with +system packages at same recipe. + +There are exceptions where some projects are closer to system drivers or hardware and packaging as a regular library could result +in an incompatible Conan package. To deal with those cases, you are allowed to provide an exclusive Conan package which only installs system packages, see the [How-to](adding_packages/build_and_package.md#system-packages) for more. + +## Why ConanCenter does **not** build and execute tests in recipes + + + +There are different motivations: + +- time and resources: adding the build time required by the test suite plus execution time can increase our building times significantly across the 100+ configurations. +- ConanCenter is a service that builds binaries for the community for existing library versions, this is not an integration system to test the libraries. + +## Why not add an option to build unit tests + +- Adding a testing option will change the package ID, but will not provide different packaged binaries +- Use the configuration [skip_test](adding_packages/conanfile_attributes.md#options-to-avoid) to define the testing behavior. + +## What is the policy for supported python versions? + +`Python 2.7` and earlier is not supported by the ConanCenter, as it's already [EOL](https://www.python.org/doc/sunset-python-2/). + +`Python 3.6` and earlier is also not supported by the ConanCenter, as it's already [EOL](https://peps.python.org/pep-0494/#lifespan). + +Versions `Python 3.7+` onwards are currently supported by the infrastructure and the recipes. + +Our [docker images](https://github.com/conan-io/conan-docker-tools) use `Python 3.7.13+` ATM. + +Windows agents currently use `Python 3.7.9+`. macOS agents use version `Python 3.7.12+`. + +The version run by our agents and docker images is a subject to change, as security updates to the Python are released, or they enter EOL. + +Additional concerns about supported versions within conan ecosystem (not just ConanCenter, but client itself and other tools) are documented in [tribe](https://github.com/conan-io/tribe/pull/3). + +For ConanCenter, besides security, there are various concerns about critical features provided by the Python interpreter, include its syntax and the standard library, e.g.: + +- LZMA compression support +- Unicode awareness +- long-path awareness + +Right now, only the [CPython](https://github.com/python/cpython) flavor of the interpreter is supported (e.g. we never tested recipes work with IronPython, JPython, Cython, etc.). + +In addition, we support only 64-bit builds of the interpreter (amd64/x86_64 architecture) - 32-bit builds (x86) are not supported and not installed on the agents. + +There are no guarantees that recipes will work correctly in future Python versions having breaking changes to the interpreter, + as we don't test all the possible combinations (and probably will never be). Patches are welcomed if problems are found. + +## How to package libraries that depend on proprietary closed-source libraries? + +There are several popular software libraries provided by Intel: + +* [Intel Math Kernel Library (MKL)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html) +* [Intel Integrated Performance Primitives (IPP)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ipp.html) +* [Intel Deep Neural Networking Library (DNN)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onednn.html) + +these Intel libraries are widely used by various well-known open-source projects (e.g. [OpenCV](https://opencv.org/) or [TensorFlow](https://www.tensorflow.org/)). + +Unfortunately, these Intel libraries cannot be accepted into ConanCenter due to several important reasons: + +* they are closed-source and commercial products, ConanCenter cannot redistribute their binaries due to the license restrictions +* registration on the Intel portal is required in order to download the libraries, there are no permanent public direct download links +* they use graphical installers which are hard to automate within conan recipe + +instead, the libraries that depend on *MKL*, *IPP* or *DNN* should use the following references: + +* `intel-mkl/`, e.g. `intel-mkl/2021` +* `intel-ipp/`, e.g. `intel-ipp/2021` +* `intel-dnn/`, e.g. `intel-dnn/2021` + +**Note**: These references are not available in ConanCenter and will likely never be! it's the consumer's responsibility to provide the recipes for these libraries. + +Since these references will be never available in ConanCenter, they will be deactivated in the consuming recipes by default: + +```python + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_intel_mkl": [True, False]} + default_options = { + "shared": False, + "fPIC": True, + "with_intel_mkl": False} + + def requirements(self): + if self.options.with_intel_mkl: + self.requires("intel-mkl/2021") +``` + +If consumers activate the option explicitly (`with_intel_mkl=True`), Conan will fail because of the unknown reference. + +Consumers may use an [override](https://docs.conan.io/1/using_packages/conanfile_txt.html#overriding-requirements) facility in order to use their own private references for Intel MKL, IPP or DNN libraries. + +For instance, if you have a private reference `intel-mkl/2021@mycompany/stable`, then you may use the following override in your `conanfile.txt`: + +``` +[requires] +intel-mkl/2021@mycompany/stable +``` + +## How to protect my project from breaking changes in recipes? + +This repository and the CI building recipes is continuously pushing to new Conan versions, +sometimes adopting new features as soon as they are released +([Conan client changelog](https://docs.conan.io/1/changelog.html)). + +You should expect that latest revision of recipes can introduce breaking changes and new +features that will be broken unless you also upgrade Conan client (and sometimes you will +need to modify your project if the recipe changes the binaries, flags,... it provides). + +To isolate from these changes there are different strategies you can follow. +Keep reading in the [consuming recipes section](consuming_recipes.md#isolate-your-project-from-upstream-changes). + +## What's the policy on version ranges? + +Version ranges are currently allowed on a handful of dependencies, but not for general use. +See [Dependencies Version Ranges](adding_packages/dependencies.md#version-ranges) for additional details. + +## How to consume a graph of shared libraries? + +When the CI builds packages with `shared=True`, it applies the option only to the package being created, but not to +the requirements. As the default value for the `shared` option is usually `False`, you can expect that the dynamic +library that has just being generated has linked all its requirements as static libraries. + +It is important to remark the default [package id mode](https://docs.conan.io/1/creating_packages/define_abi_compatibility.html#versioning-schema) +used by Conan (which is the same default used by ConanCenter): `semver_direct_mode`. With this default only the major +version of the requirements is encoded in the package ID. + +The two previous behaviors together can lead to unexpected results for a user that want to consume a graph of +dependencies as shared libraries from ConanCenter. They might think that using `*:shared=True` in their profile is +enough, and indeed Conan will retrieve from ConanCenter all the dynamic libraries for all the graph of dependencies, but +**all of them will contain the logic of their respective requirements embedded in the dynamic library**, and this +logic is embedded at the time of building, so it might not match the version of the requirements that was resolved +by Conan, and for sure, the other dynamic libraries won't be used, only the ones linked directly by the consumer +project. See a more detailed [example here](https://github.com/conan-io/conan/issues/9712). + +In order to consume all those libraries as shared ones, building from sources is needed. This can be +easily achievable using `*:shared=True` in the _host_ profile and `--build` in the install command. With these inputs, +Conan will build from sources all the packages and use the shared libraries when linking. + +> **Note**: If you are hosting your own recipes, the proper solution for recipes would be to use something like +> [`shared_library_package_id`](https://docs.conan.io/1/reference/conanfile/methods.html?highlight=shared_library_package_id#self-info-shared-library-package-id), +> that will encode this information in the package ID and ensure that any change in the static libraries that are +> embedded into a shared one is taken into account when computing the package ID. +> +> In this repository we are not using it, because it will lead to many missing packages, making it impossible +> for the CI to actually build consumers in PRs. + +## How to watch only specific recipes? + +The [Code Owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) feature requires +write permission for any listed user in the file `.github/CODEOWNERS`, which makes it impossible to be accepted by Conan. However, that file is still important as it can be re-used in +a future Github Action to parse and communicate users. Meanwhile, there is the project https://app.github-file-watcher.com/, +which is able to notify users, but only after merging to the master branch. Feel free to contribute to a new Github Action that +implements a file watcher feature. + +## Is it possible to disable Pylint? + +No. The [pylint](v2_linter.md) has an important role of keeping any recipe prepared for [Conan v2 migration](v2_migration.md). In case you are having +difficult to understand [linter errors](linters.md), please comment on your pull request about the problem to receive help from the community. + +## How long can I be inactive before being removed from the authorized users list? + +Please, read [Inactivity and user removal section](adding_packages/README.md#inactivity-and-user-removal). + +## Can we add package which are parts of bigger projects like Boost? + +Sadly no. There have been many efforts in the past and we feel it's not sustainable given the number of combinations of libraries and version. +See #14660 for recent discussions. There is one main "boost" recipe with many versions maintained. Adding boost libraries with no dependencies +just opens the door to graph resolution problems and once available allows for dependent libraries to be added. + +In order to avoid this the sole permutation which is permissible is when the project does not package any headers under the `boost/` folder, does not use the boost namespace +and does not install libraries with the boost prefix. + +### Can I add my project which I will submit to Boost? + +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. + +## 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 +and would otherwise dynamically embed this into the CMake config files or generated pkg-config files then it should be allowed. + +Doing so requires [deleting the option from the `package_id`](adding_packages/conanfile_attributes.md#removing-from-package_id). + +## Can I use full_package_mode for a requirement in my recipe? + +For some irregular projects, they may need to be aligned when being used as a requirement, using the very same version, options, and settings and maybe not mixing shared with static linkage. +Those projects usually break between patch versions and are very sensitive, so we can not use different versions through Conan graph dependencies, +otherwise, it may result in unexpected behavior or even runtime errors. + +A very known project is GLib, which requires the very same configuration to prevent multiple instances when using static linkage. +As a solution, we could consume GLib on full package id mode, like: + +```python +def package_id(self): + self.info.requires["glib"].full_package_mode() +``` + +Perfect solution on the consumer side, but there is a side-effect: CCI will not re-generate all involved packages for any change in the dependencies graph with which glib is associated, which means, users will start to see **MISSING_PACKAGES** error during their pull requests. +As a trade-off, it would be necessary to update all recipes involved, by opening new PRs, +then it should generate new packages, but it takes many days and still is a process that is not supported by CCI internally. + +To have more context about it, please, visit issues #11684 and #11022 + +In summary, we do not recommend `full_package_mode` or any other custom package id mode for requirements on CCI, it will break other PRs soon or later. +Instead, prefer using `shared=True` by default, when needed. +Also, when having a similar situation, do not hesitate in opening an issue explaining your case, and ask for support from the community. diff --git a/docs/labels.md b/docs/labels.md new file mode 100644 index 0000000000000..b5f3f5d9cf396 --- /dev/null +++ b/docs/labels.md @@ -0,0 +1,96 @@ +# Labels + +We use [GitHub labels](https://github.com/conan-io/conan-center-index/labels) to signal the status +of pull-requests and issues. Here you can find more information about the ones that have some +special meaning: + + +## Contents + + * [Bump dependencies](#bump-dependencies) + * [Bump version](#bump-version) + * [C3I Conan2 Ready](#c3i-conan2-ready) + * [Infrastructure](#infrastructure) + * [Stale](#stale) + * [Unexpected Error](#unexpected-error) + * [User-approval pending](#user-approval-pending) + * [Library Request](#library-request) + * [Question](#question) + * [Upstream Update](#upstream-update) + * [conan.io/center](#conaniocenter) + +## Bump dependencies + +Label [`Bump dependencies`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+dependencies%22+) +is assigned by the bot to pull-requests that are just upgrading the version of the requirements that were already in the +recipe. + +> These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). + +If the pull request modifies anything else, the label won't be assigned, we need to be very careful about false positives. + +## Bump version + +Label [`Bump version`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+version%22) +is assigned by the bot to pull-requests that are just adding a new version of the library. The new version should satisfy +some extra conditions: sources should provide from the same URL domain as previous versions. +For now, only [SEMVER](https://semver.org/#semantic-versioning-200) and `` are acceptable version formats. + +> These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). + +If the pull request modifies anything else, the label won't be assigned, we need to be very careful about false positives. + +## C3I Conan2 Ready + +Label [`c3i-conan2-ready`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22c3i-conan2-ready%22) +is assigned by the bot to pull-requests that are just adding a new package references which passed by Conan v2 and are not listed in `.c3i/conan_v2_ready_references.yml`. +This is a regression test, in case package is working with Conan v2, it can not be merged in a future pull request in case of failure. + +> These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). + +Only team members can open a pull request with these changes. + +## Infrastructure + +Label [`infrastructure`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3Ainfrastructure) is +manually assigned to pull requests that are waiting for something on the infrastructure side. Usually they are blocked and +cannot succeed because they need some tools, more memory,... these pull requests won't be marked as `stale`. + +## Stale + +Label [`stale`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3Astale) is assigned to +pull requests without any activity during a long period of time. These pull requests will be closed if they don't get +any further activity. + +## Unexpected Error + +Label [`Unexpected Error`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Unexpected+Error%22) +is assigned by the CI when the process finishes abnormally. +Usually it is some _random_ internal error and it won't happen next time the CI runs. +The CI will re-start your build automatically, the Github check `continuous-integration/jenkins/pr-merge` +will be changed to the status `Pending — This commit is being built` to signalize as running. + +> **Note**: Manually restarting a new build, by closing/opening the PR, will be added to the end of the CI build queue. + +## User-approval pending + +Label [`User-approval pending`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22User-approval+pending%22) +signals the pull request that have been submitted by an user who is not yet approved in ConanCenter. Once the user is +approved these pull requests will be triggered again automatically. + +## Library Request + +Request a new package to be created. + +## Question + +Further information is requested. Usually these are for issue where help is needed to solve a specific issue. These are a great way +to look for advice or recommendation about making changes to recipes. + +## Upstream Update + +Request a bump of a new package version. + +## conan.io/center + +Issues and features related to Web UI. diff --git a/docs/linters.md b/docs/linters.md new file mode 100644 index 0000000000000..c108d63beb5a0 --- /dev/null +++ b/docs/linters.md @@ -0,0 +1,190 @@ +# ConanCenterIndex Linters + +Some linter configuration files are available in the folder [linter](../linter), which are executed by Github Actions +and are displayed during [code review](https://github.com/features/code-review) as annotations, to improve recipe quality. +They consume python scripts which are executed to fit CCI rules. Those scripts use [astroid](https://github.com/PyCQA/astroid) +and [pylint](https://pylint.pycqa.org/en/latest/) classes to parse Conan recipe files and manage their warnings and errors. + +Pylint by itself is not able to find ConanCenterIndex rules, so astroid is used to iterate over a conanfile's content and +validate CCI requirements. Pylint uses an [rcfile](https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html) +to configure plugins, warnings and errors which should be enabled or disabled. + + +## Contents + + * [Understanding the different linters](#understanding-the-different-linters) + * [Running the linters locally](#running-the-linters-locally) + * [Pylint configuration files](#pylint-configuration-files) + * [Linter Warning and Errors](#linter-warning-and-errors) + * [E9006 - conan-import-conanfile: ConanFile should be imported from conan](#e9006---conan-import-conanfile-conanfile-should-be-imported-from-conan) + * [E9005 - conan-missing-name: Every conan recipe must contain the attribute name](#e9005---conan-missing-name-every-conan-recipe-must-contain-the-attribute-name) + * [E9004 - conan-package-name: Conan package names must be lower-case](#e9004---conan-package-name-conan-package-names-must-be-lower-case) + * [E9007 - conan-test-no-name: Do not add name attribute in test package recipes](#e9007---conan-test-no-name-do-not-add-name-attribute-in-test-package-recipes) + * [E9008 - conan-import-errors: Deprecated imports should be replaced by new imports](#e9008---conan-import-errors-deprecated-imports-should-be-replaced-by-new-imports) + * [E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead](#e9009---conan-import-error-conanexception-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead) + * [E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead](#e9010---conan-import-error-conaninvalidconfiguration-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead) + * [E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private](#e9011---conan-import-tools-importing-conantools-or-conantoolsxxxzzzyyy-should-be-considered-as-private) + * [E9012 - conan-attr-version: Recipe should not contain version attribute](#e9012---conan-attr-version-recipe-should-not-contain-version-attribute) + +## Understanding the different linters + +There's a three classes of linters currently in place for ConanCenterIndex + +- ConanCenter Hook - these are responsible for validating the structure of the recipes and packages. +- Pylint Linter - these are used to ensure the code quality and conventions of a recipes (i.e `conanfile.py`) +- Yaml Checks - stylistic guidance and schema validation check for support files and best practices + +## Running the linters locally + +Check the [Developing Recipes](developing_recipes_locally.md) for more information on each of the three linters. + +## Pylint configuration files + +- [Pylint Recipe](../linter/pylintrc_recipe): This `rcfile` lists plugins and rules to be executed over all recipes (not test package) and validate them. +- [Pylint Test Package Recipe](../linter/pylintrc_testpackage): This `rcfile` lists plugins and rules to be executed over all recipes in test package folders only: + +## Linter Warning and Errors + +Here is the list of current warning and errors provided by pylint, when using CCI configuration. + +### E9006 - conan-import-conanfile: ConanFile should be imported from conan + +```python +from conans import ConanFile +``` + +Should be replaced by: + +```python +from conan import Conanfile +``` + +### E9005 - conan-missing-name: Every conan recipe must contain the attribute name + +The attribute `name` is always expected. On the other hand, `version` should not be listed. + +```python +def BazConanfile(ConanFile): + name = "baz" +``` + +### E9004 - conan-package-name: Conan package names must be lower-case + +The package name is always lower-case, even when the upstream uses another format + +```python +def FoobarConanfile(ConanFile): + name = "foobar" +``` + +### E9007 - conan-test-no-name: Do not add name attribute in test package recipes + +The test package is not a recipe, thus, it should not have a name + +```python +def TestPackageConanFile(ConanFile): + name = "test_package" # Wrong! +``` + +### E9008 - conan-import-errors: Deprecated imports should be replaced by new imports + +Read [v2_linter](v2_linter.md) for a list of mappings of v1 to v2. +Regular imports from `conans.tools` are now updated: + +```python +from conans import tools +... + +tools.rmdir(os.path.join(self.package_folder, "shared")) +``` + +Should be replaced by specialized tools, prepared for Conan 2.0 + +```python +from conan.tools.files import rmdir +... + +rmdir(self, os.path.join(self.package_folder, "shared")) +``` + +### E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead + +```python +from conans.errors import ConanException +``` + +Should be replaced by: + +```python +from conan.errors import ConanException +``` + +Only the namespace `conans` has been replaced by `conan`. + +### E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead + +```python +from conans.errors import ConanInvalidConfiguration +``` + +Should be replaced by: + +```python +from conan.errors import ConanInvalidConfiguration +``` + +Only the namespace `conans` has been replaced by `conan`. + +### E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private + +Documented on [conanfile.tools](https://docs.conan.io/1/reference/conanfile/tools.html): +It's not allowed to use `tools.xxx` directly: + +```python +from conan import tools +... + +tools.scm.Version(self.version) +``` + +Neither sub modules: + +```python +from conan.tools.apple.apple import is_apple_os +``` + +Only modules under `conan.tools` and `conan.tools.xxx` are allowed: + +```python +from conan.tools.files import rmdir +from conan.tools import scm +``` + +### E9012 - conan-attr-version: Recipe should not contain version attribute + +All recipes on CCI should be generic enough to support as many versions as possible, so enforcing a specific +version as attribute will not allow to re-use the same recipe for multiple release versions. + +```python +from conan import ConanFile + +class FooConanFile(ConanFile): + version = "1.0.0" # Wrong! +``` + +The package version should be passed as command argument, e.g: + + conan create all/ 1.0.0@ -pr:h=default -pr:b=default + +Or, if you are running Conan 2.0: + + conan create all/ --version=1.0.0 -pr:h=default -pr:b=default + +The only exception is when providing ``system`` packages, which are allowed. + +```python +from conan import ConanFile + +class FooConanFile(ConanFile): + version = "system" # Okay! +``` diff --git a/docs/package_templates/README.md b/docs/package_templates/README.md new file mode 100644 index 0000000000000..76d696e57b0a0 --- /dev/null +++ b/docs/package_templates/README.md @@ -0,0 +1,27 @@ +## Package Templates + +A brief description about each template available: + +#### Autotools package + +It's listed under [autotools_package](autotools_package) folder. It fits projects which use `autotools` or `make` to be built. + +#### CMake package + +It's listed under [cmake_package](cmake_package) folder. It fits projects which use `CMake` to be built. + +#### Header only + +It's listed under [header_only](header_only) folder. It fits projects which only copy header and have the same package ID always. + +#### MSBuild package + +It's listed under [msbuild_package](msbuild_package) folder. It fits projects which use `msbuild` to be built. + +#### Prebuilt tool package + +It's listed under [prebuilt_tool_package](prebuilt_tool_package) folder. It fits projects which only copy generated binaries (executables and libraries). + +#### Meson package + +It's listed under [meson_package](meson_package) folder. It fits projects which use `Meson` to be built. diff --git a/docs/package_templates/autotools_package/all/conandata.yml b/docs/package_templates/autotools_package/all/conandata.yml new file mode 100644 index 0000000000000..629a5640adc16 --- /dev/null +++ b/docs/package_templates/autotools_package/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + # Newer versions at the top + "1.2.0": + url: + - "https://mirror1.net/package-1.2.0.tar.gz" + - "https://mirror2.net/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "1.1.0": + url: + - "https://mirror1.net/package-1.1.0.tar.gz" + - "https://mirror2.net/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" +patches: + # Newer versions at the top + "1.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "backport" + patch_source: "https://github.com/owner/package/pulls/42" + - patch_file: "patches/0002-fix-linux.patch" + patch_description: "add missing header to support linux" + patch_type: "portability" + patch_source: "https://github.com/owner/package/issues/0" diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py new file mode 100644 index 0000000000000..0719baa9da770 --- /dev/null +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -0,0 +1,178 @@ +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, cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + + +required_conan_version = ">=1.54.0" + +# +# INFO: Please, remove all comments before pushing your PR! +# + + +class PackageConan(ConanFile): + name = "package" + description = "short description" + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_foobar": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_foobar": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + # no exports_sources attribute, but export_sources(self) method instead + # this allows finer grain exportation of patches per 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") + # for plain C projects only + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + # src_folder must use the same source folder name the project + basic_layout(self, src_folder="src") + + def requirements(self): + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") + if self.options.with_foobar: + self.requires("foobar/0.1.0") + + def validate(self): + # validate the minimum cpp standard supported. Only for C++ projects + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + # if another tool than the compiler or autotools is required to build the project (pkgconf, bison, flex etc) + def build_requirements(self): + # only if we have to call autoreconf + self.tool_requires("libtool/x.y.z") + # only if upstream configure.ac relies on PKG_CHECK_MODULES macro + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/x.y.z") + # required to suppport windows as a build machine + 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") + # for msvc support to get compile & ar-lib scripts (may be avoided if shipped in source code of the library) + # not needed if libtool already in build requirements + if is_msvc(self): + self.tool_requires("automake/x.y.z") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + # inject tool_requires env vars in build scope (not needed if there is no tool_requires) + env = VirtualBuildEnv(self) + 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") + # --fpic is automatically managed when 'fPIC'option is declared + # --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" + tc.configure_args.extend([ + f"--with-foobar={yes_no(self.options.with_foobar)}", + "--enable-tools=no", + "--enable-manpages=no", + ]) + tc.generate() + # generate pkg-config files of dependencies (useless if upstream configure.ac doesn't rely on PKG_CHECK_MODULES macro) + tc = PkgConfigDeps(self) + tc.generate() + # generate dependencies for autotools + tc = AutotoolsDeps(self) + tc.generate() + + # If Visual Studio is supported + if is_msvc(self): + env = Environment() + # get compile & ar-lib from automake (or eventually lib source code if available) + # it's not always required to wrap CC, CXX & AR with these scripts, it depends on how much love was put in + # upstream build files + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + def build(self): + # apply patches listed in conandata.yml + apply_conandata_patches(self) + autotools = Autotools(self) + # (optional) run autoreconf to regenerate configure file (libtool should be in tool_requires) + autotools.autoreconf() + # ./configure + toolchain file + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + 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")) + + # In shared lib/executable files, autotools set install_name (macOS) to lib dir absolute path instead of @rpath, it's not relocatable, so fix it + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["package_lib"] + + # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "package") + + # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) diff --git a/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt b/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..006bc198df7b0 --- /dev/null +++ b/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(package REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +# don't link to ${CONAN_LIBS} or CONAN_PKG::package +target_link_libraries(${PROJECT_NAME} PRIVATE package::package) +# In case the target project need a specific C++ standard +# target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/docs/package_templates/autotools_package/all/test_package/conanfile.py b/docs/package_templates/autotools_package/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/docs/package_templates/autotools_package/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/docs/package_templates/autotools_package/all/test_package/test_package.c b/docs/package_templates/autotools_package/all/test_package/test_package.c new file mode 100644 index 0000000000000..f949b7f4a20f4 --- /dev/null +++ b/docs/package_templates/autotools_package/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include "package/foobar.h" // Make sure includes work as expected + + +int main(void) { + printf("Create a minimal usage for the target project here.\n"); + printf("Avoid big examples, bigger than 100 lines\n"); + printf("Avoid networking connections.\n"); + printf("Avoid background apps or servers.\n"); + printf("The propose is testing the generated artifacts only.\n"); + + foobar_print_version(); // Make sure to call something that will require linkage for compiled libraries + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..206d47b726b56 --- /dev/null +++ b/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses c++ + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(package REQUIRED CONFIG) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/docs/package_templates/autotools_package/all/test_v1_package/conanfile.py b/docs/package_templates/autotools_package/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/docs/package_templates/autotools_package/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/docs/package_templates/autotools_package/config.yml b/docs/package_templates/autotools_package/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/autotools_package/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/docs/package_templates/cmake_package/all/conandata.yml b/docs/package_templates/cmake_package/all/conandata.yml new file mode 100644 index 0000000000000..629a5640adc16 --- /dev/null +++ b/docs/package_templates/cmake_package/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + # Newer versions at the top + "1.2.0": + url: + - "https://mirror1.net/package-1.2.0.tar.gz" + - "https://mirror2.net/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "1.1.0": + url: + - "https://mirror1.net/package-1.1.0.tar.gz" + - "https://mirror2.net/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" +patches: + # Newer versions at the top + "1.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "backport" + patch_source: "https://github.com/owner/package/pulls/42" + - patch_file: "patches/0002-fix-linux.patch" + patch_description: "add missing header to support linux" + patch_type: "portability" + patch_source: "https://github.com/owner/package/issues/0" diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py new file mode 100644 index 0000000000000..47f9a403b5cf1 --- /dev/null +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -0,0 +1,169 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +import os + + +required_conan_version = ">=1.53.0" + +# +# INFO: Please, remove all comments before pushing your PR! +# + + +class PackageConan(ConanFile): + name = "package" + description = "short description" + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + # in case the project requires C++14/17/20/... the minimum compiler version should be listed + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + # no exports_sources attribute, but export_sources(self) method instead + # this allows finer grain exportation of patches per 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") + # for plain C projects only + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + # src_folder must use the same source folder name the project + cmake_layout(self, src_folder="src") + + def requirements(self): + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") + + 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) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + # in case it does not work in another configuration, it should validated here too + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + # if another tool than the compiler or CMake is required to build the project (pkgconf, bison, flex etc) + def build_requirements(self): + self.tool_requires("tool/x.y.z") + + 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) + # Boolean values are preferred instead of "ON"/"OFF" + tc.variables["PACKAGE_CUSTOM_DEFINITION"] = True + if is_msvc(self): + # don't use self.settings.compiler.runtime + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + # deps_cpp_info, deps_env_info and deps_user_info are no longer used + if self.dependencies["dependency"].options.foobar: + tc.variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs + # cache_variables should be used sparingly, example setting cmake policies + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + # In case there are dependencies listed on requirements, CMakeDeps should be used + tc = CMakeDeps(self) + tc.generate() + # In case there are dependencies listed on build_requirements, VirtualBuildEnv should be used + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def _patch_sources(self): + apply_conandata_patches(self) + # remove bundled xxhash + rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "...", "") + + def build(self): + self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed + 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() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + 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 = ["package_lib"] + + # if package has an official FindPACKAGE.cmake listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules + # examples: bzip2, freetype, gdal, icu, libcurl, libjpeg, libpng, libtiff, openssl, sqlite3, zlib... + self.cpp_info.set_property("cmake_module_file_name", "PACKAGE") + self.cpp_info.set_property("cmake_module_target_name", "PACKAGE::PACKAGE") + # if package provides a CMake config file (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) + self.cpp_info.set_property("cmake_file_name", "package") + self.cpp_info.set_property("cmake_target_name", "package::package") + # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "package") + + # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PACKAGE" + self.cpp_info.filenames["cmake_find_package_multi"] = "package" + self.cpp_info.names["cmake_find_package"] = "PACKAGE" + self.cpp_info.names["cmake_find_package_multi"] = "package" diff --git a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d742678fc6e67 --- /dev/null +++ b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package C) # if the project is pure C +# project(test_package CXX) # if the project uses c++ + +find_package(package 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 package::package) +# In case the target project need a specific C++ standard +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/docs/package_templates/cmake_package/all/test_package/conanfile.py b/docs/package_templates/cmake_package/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/docs/package_templates/cmake_package/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/docs/package_templates/cmake_package/all/test_package/test_package.cpp b/docs/package_templates/cmake_package/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8e653f30a5476 --- /dev/null +++ b/docs/package_templates/cmake_package/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include "package/foobar.hpp" + + +int main(void) { + std::cout << "Create a minimal usage for the target project here." << std::endl; + std::cout << "Avoid big examples, bigger than 100 lines" << std::endl; + std::cout << "Avoid networking connections." << std::endl; + std::cout << "Avoid background apps or servers." << std::endl; + std::cout << "The propose is testing the generated artifacts only." << std::endl; + + foobar.print_version(); + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/docs/package_templates/cmake_package/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/docs/package_templates/cmake_package/all/test_v1_package/conanfile.py b/docs/package_templates/cmake_package/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/docs/package_templates/cmake_package/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/docs/package_templates/cmake_package/config.yml b/docs/package_templates/cmake_package/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/cmake_package/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/docs/package_templates/header_only/all/conandata.yml b/docs/package_templates/header_only/all/conandata.yml new file mode 100644 index 0000000000000..629a5640adc16 --- /dev/null +++ b/docs/package_templates/header_only/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + # Newer versions at the top + "1.2.0": + url: + - "https://mirror1.net/package-1.2.0.tar.gz" + - "https://mirror2.net/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "1.1.0": + url: + - "https://mirror1.net/package-1.1.0.tar.gz" + - "https://mirror2.net/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" +patches: + # Newer versions at the top + "1.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "backport" + patch_source: "https://github.com/owner/package/pulls/42" + - patch_file: "patches/0002-fix-linux.patch" + patch_description: "add missing header to support linux" + patch_type: "portability" + patch_source: "https://github.com/owner/package/issues/0" diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py new file mode 100644 index 0000000000000..51ea9a72fb954 --- /dev/null +++ b/docs/package_templates/header_only/all/conanfile.py @@ -0,0 +1,122 @@ +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 PackageConan(ConanFile): + name = "package" + description = "short description" + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case it's not listed there, use "LicenseRef-" + license = "" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # Do not put "conan" nor the project name in topics. Use topics from the upstream listed on GH + # Keep 'header-only' as topic + topics = ("topic1", "topic2", "topic3", "header-only") + package_type = "header-library" + # Keep these or explain why it's not required for this particular case + settings = "os", "arch", "compiler", "build_type" + # Do not copy sources to build folder for header only projects, unless you need to apply patches + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + # In case the project requires C++14/17/20/... the minimum compiler version should be listed + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "14.1", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + # Use the export_sources(self) method instead of the exports_sources attribute. + # This allows finer grain exportation of patches per version + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + # src_folder must use the same source folder name than the project + basic_layout(self, src_folder="src") + + def requirements(self): + # Prefer self.requires method instead of requires attribute + # Direct dependencies of header only libs are always transitive since they are included in public headers + self.requires("dependency/0.8.1", transitive_headers=True) + + # same package ID for any package + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + # Validate the minimum cpp standard supported when installing the package. For C++ projects only + 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." + ) + + # In case this library does not work in some another configuration, it should be validated here too + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} can not be used on Windows.") + + def source(self): + # Download source package and extract to source folder + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + # Not mandatory when there is no patch, but will suppress warning message about missing build() method + def build(self): + # The attribute no_copy_source should not be used when applying patches in build + apply_conandata_patches(self) + + # Copy all files to the package folder + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + # Folders not used for header-only + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # Set these to the appropriate values if the package has an official FindPACKAGE.cmake + # listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules + # examples: bzip2, freetype, gdal, icu, libcurl, libjpeg, libpng, libtiff, openssl, sqlite3, zlib... + self.cpp_info.set_property("cmake_module_file_name", "PACKAGE") + self.cpp_info.set_property("cmake_module_target_name", "PACKAGE::PACKAGE") + # Set these to the appropriate values if package provides a CMake config file + # (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) + self.cpp_info.set_property("cmake_file_name", "package") + self.cpp_info.set_property("cmake_target_name", "package::package") + # Set this to the appropriate value if the package provides a pkgconfig file + # (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "package") + + # Add m, pthread and dl if needed in Linux/FreeBSD + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PACKAGE" + self.cpp_info.filenames["cmake_find_package_multi"] = "package" + self.cpp_info.names["cmake_find_package"] = "PACKAGE" + self.cpp_info.names["cmake_find_package_multi"] = "package" diff --git a/docs/package_templates/header_only/all/test_package/CMakeLists.txt b/docs/package_templates/header_only/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eaac388e85a10 --- /dev/null +++ b/docs/package_templates/header_only/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(package 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 package::package) +# In case the target project need a specific C++ standard +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/docs/package_templates/header_only/all/test_package/conanfile.py b/docs/package_templates/header_only/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/docs/package_templates/header_only/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/docs/package_templates/header_only/all/test_package/test_package.cpp b/docs/package_templates/header_only/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8e653f30a5476 --- /dev/null +++ b/docs/package_templates/header_only/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include "package/foobar.hpp" + + +int main(void) { + std::cout << "Create a minimal usage for the target project here." << std::endl; + std::cout << "Avoid big examples, bigger than 100 lines" << std::endl; + std::cout << "Avoid networking connections." << std::endl; + std::cout << "Avoid background apps or servers." << std::endl; + std::cout << "The propose is testing the generated artifacts only." << std::endl; + + foobar.print_version(); + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt b/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7738c036b5d79 --- /dev/null +++ b/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) # if the project is pure C +project(test_package LANGUAGES CXX) # if the project uses 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/docs/package_templates/header_only/all/test_v1_package/conanfile.py b/docs/package_templates/header_only/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/docs/package_templates/header_only/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/docs/package_templates/header_only/config.yml b/docs/package_templates/header_only/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/header_only/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/docs/package_templates/meson_package/all/conandata.yml b/docs/package_templates/meson_package/all/conandata.yml new file mode 100644 index 0000000000000..629a5640adc16 --- /dev/null +++ b/docs/package_templates/meson_package/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + # Newer versions at the top + "1.2.0": + url: + - "https://mirror1.net/package-1.2.0.tar.gz" + - "https://mirror2.net/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "1.1.0": + url: + - "https://mirror1.net/package-1.1.0.tar.gz" + - "https://mirror2.net/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" +patches: + # Newer versions at the top + "1.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "backport" + patch_source: "https://github.com/owner/package/pulls/42" + - patch_file: "patches/0002-fix-linux.patch" + patch_description: "add missing header to support linux" + patch_type: "portability" + patch_source: "https://github.com/owner/package/issues/0" diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py new file mode 100644 index 0000000000000..ef4bad7fd4d3b --- /dev/null +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -0,0 +1,155 @@ +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, 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.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + +# +# INFO: Please, remove all comments before pushing your PR! +# + + +class PackageConan(ConanFile): + name = "package" + description = "short description" + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + # in case the project requires C++14/17/20/... the minimum compiler version should be listed + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + # no exports_sources attribute, but export_sources(self) method instead + # this allows finer grain exportation of patches per 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") + # for plain C projects only + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + # src_folder must use the same source folder name the project + basic_layout(self, src_folder="src") + + def requirements(self): + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") + + def validate(self): + # validate the minimum cpp standard supported. For C++ projects only + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + # in case it does not work in another configuration, it should validated here too + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + # if another tool than the compiler or Meson is required to build the project (pkgconf, bison, flex etc) + def build_requirements(self): + # CCI policy assumes that Meson may not be installed on consumers machine + self.tool_requires("meson/0.63.3") + # pkgconf is largely used by Meson, it should be added in build requirement when there are dependencies + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + # default_library and b_staticpic are automatically parsed when self.options.shared and self.options.fpic exist + # buildtype is automatically parsed for self.settings + tc = MesonToolchain(self) + # In case need to pass definitions directly to the compiler + tc.preprocessor_definitions["MYDEFINE"] = "MYDEF_VALUE" + # Meson project options may vary their types + tc.project_options["tests"] = False + tc.generate() + # In case there are dependencies listed on requirements, PkgConfigDeps should be used + tc = PkgConfigDeps(self) + tc.generate() + # In case there are dependencies listed on build_requirements, VirtualBuildEnv should be used + tc = VirtualBuildEnv(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # remove bundled xxhash + rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "...", "") + + def build(self): + self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed + 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() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + # In shared lib/executable files, meson set install_name (macOS) to lib dir absolute path instead of @rpath, it's not relocatable, so fix it + fix_apple_shared_install_name(self) + + def package_info(self): + # avoid collect_libs(), prefer explicit library name instead + self.cpp_info.libs = ["package_lib"] + # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "package") + # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/docs/package_templates/meson_package/all/test_package/conanfile.py b/docs/package_templates/meson_package/all/test_package/conanfile.py new file mode 100644 index 0000000000000..61b7b28c28d9d --- /dev/null +++ b/docs/package_templates/meson_package/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +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 + + +# It will become the standard on Conan 2.x +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/0.63.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + 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/docs/package_templates/meson_package/all/test_package/meson.build b/docs/package_templates/meson_package/all/test_package/meson.build new file mode 100644 index 0000000000000..481f6cfd116c1 --- /dev/null +++ b/docs/package_templates/meson_package/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'cpp') +package_dep = dependency('package') +executable('test_package', + sources : ['test_package.cpp'], + dependencies : [package_dep]) diff --git a/docs/package_templates/meson_package/all/test_package/test_package.cpp b/docs/package_templates/meson_package/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..315875d954777 --- /dev/null +++ b/docs/package_templates/meson_package/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include "package/foobar.hpp" + + +int main(void) { + /* + * Create a minimal usage for the target project here. + * Avoid big examples, bigger than 100 lines. + * Avoid networking connections. + * Avoid background apps or servers. + * The propose is testing the generated artifacts only. + */ + + foobar.print_version(); + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/meson_package/all/test_v1_package/conanfile.py b/docs/package_templates/meson_package/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c5b074313827d --- /dev/null +++ b/docs/package_templates/meson_package/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conans import ConanFile, Meson +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 = "pkg_config" + + def build_requirements(self): + self.build_requires("meson/0.63.3") + self.build_requires("pkgconf/1.9.3") + + def build(self): + meson = Meson(self) + meson.configure(build_folder="bin", source_folder="../test_package") + meson.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/docs/package_templates/meson_package/config.yml b/docs/package_templates/meson_package/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/meson_package/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/docs/package_templates/msbuild_package/all/conandata.yml b/docs/package_templates/msbuild_package/all/conandata.yml new file mode 100644 index 0000000000000..629a5640adc16 --- /dev/null +++ b/docs/package_templates/msbuild_package/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + # Newer versions at the top + "1.2.0": + url: + - "https://mirror1.net/package-1.2.0.tar.gz" + - "https://mirror2.net/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "1.1.0": + url: + - "https://mirror1.net/package-1.1.0.tar.gz" + - "https://mirror2.net/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" +patches: + # Newer versions at the top + "1.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "backport" + patch_source: "https://github.com/owner/package/pulls/42" + - patch_file: "patches/0002-fix-linux.patch" + patch_description: "add missing header to support linux" + patch_type: "portability" + patch_source: "https://github.com/owner/package/issues/0" diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py new file mode 100644 index 0000000000000..5fd9fc9251d3e --- /dev/null +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -0,0 +1,134 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildDeps, MSBuildToolchain +import os + + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "package" + description = "short description" + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + # no exports_sources attribute, but export_sources(self) method instead + # this allows finer grain exportation of patches per 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") + # for plain C projects only + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") + + def validate(self): + # in case it does not work in another configuration, it should validated here too + if not is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can be built only by Visual Studio and msvc.") + + # if another tool than the compiler or CMake is required to build the project (pkgconf, bison, flex etc) + def build_requirements(self): + self.tool_requires("tool/x.y.z") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _msbuild_configuration(self): + # Customize to Release when RelWithDebInfo or MinSizeRel, if upstream build files + # don't have RelWithDebInfo and MinSizeRel. + # Moreover: + # - you may have to change these values if upstream build file uses custom configuration names. + # - configuration of MSBuildToolchain/MSBuildDeps & build_type of MSBuild may have to be different. + # Its unusual, but it happens when there is a preSolution/postSolution mapping with different names. + # * build_type attribute of MSBuild should match preSolution + # * configuration attribute of MSBuildToolchain/MSBuildDeps should match postSolution + return "Debug" if self.settings.build_type == "Debug" else "Release" + + def generate(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.generate() + + # If there are requirements + deps = MSBuildDeps(self) + deps.configuration = self._msbuild_configuration + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # remove bundled xxhash + rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "...", "") + + # Allows to inject platform toolset, and props file generated by MSBuildToolchain & MSBuildDeps + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + vcxproj_files = ["path/to/vcxproj_file1", "path/to/vcxproj_file2", "..."] + platform_toolset = MSBuildToolchain(self).toolset + import_conan_generators = "" + for props_file in ["conantoolchain.props", "conandeps.props"]: + props_path = os.path.join(self.generators_folder, props_file) + if os.path.exists(props_path): + import_conan_generators += f"" + for vcxproj_file in vcxproj_files: + replace_in_file( + self, vcxproj_file, + # change this v142 value depending on actual value in vcxproj file + "v142", + f"{platform_toolset}", + ) + if props_path: + replace_in_file( + self, vcxproj_file, + "", + f"{import_conan_generators}", + ) + + def build(self): + self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + # customize according the solution file and compiler version + msbuild.build(sln="project_2017.sln") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.libs = ["package_lib"] diff --git a/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..15b25667576d6 --- /dev/null +++ b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package C) # if the project is pure C +project(test_package CXX) # if the project uses c++ + +find_package(package 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 package::package) diff --git a/docs/package_templates/msbuild_package/all/test_package/conanfile.py b/docs/package_templates/msbuild_package/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/docs/package_templates/msbuild_package/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/docs/package_templates/msbuild_package/all/test_package/test_package.cpp b/docs/package_templates/msbuild_package/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8e653f30a5476 --- /dev/null +++ b/docs/package_templates/msbuild_package/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include "package/foobar.hpp" + + +int main(void) { + std::cout << "Create a minimal usage for the target project here." << std::endl; + std::cout << "Avoid big examples, bigger than 100 lines" << std::endl; + std::cout << "Avoid networking connections." << std::endl; + std::cout << "Avoid background apps or servers." << std::endl; + std::cout << "The propose is testing the generated artifacts only." << std::endl; + + foobar.print_version(); + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..510461758af8b --- /dev/null +++ b/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package C) # if the project is pure C +project(test_package CXX) # if the project uses c++ + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(package REQUIRED CONFIG) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/docs/package_templates/msbuild_package/all/test_v1_package/conanfile.py b/docs/package_templates/msbuild_package/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/docs/package_templates/msbuild_package/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/docs/package_templates/msbuild_package/config.yml b/docs/package_templates/msbuild_package/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/msbuild_package/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/docs/package_templates/prebuilt_tool_package/all/conandata.yml b/docs/package_templates/prebuilt_tool_package/all/conandata.yml new file mode 100644 index 0000000000000..efcc89654623a --- /dev/null +++ b/docs/package_templates/prebuilt_tool_package/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + # Newer versions at the top + "1.2.0": + "Windows": + "x86_64": + url: "https://example.com/download/windows/amd64/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "Linux": + "x86_64": + url: "https://example.com/download/linux/amd64/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "Macos": + "x86_64": + url: "https://example.com/download/osx/amd64/package-1.2.0.tar.gz" + sha256: "________________________________________________________________" + "1.1.0": + "Windows": + "x86_64": + url: "https://example.com/download/windows/amd64/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" + "Linux": + "x86_64": + url: "https://example.com/download/linux/amd64/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" + "Macos": + "x86_64": + url: "https://example.com/download/osx/amd64/package-1.1.0.tar.gz" + sha256: "________________________________________________________________" diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py new file mode 100644 index 0000000000000..8a52bdeb5c74f --- /dev/null +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.47.0" + + +class PackageConan(ConanFile): + name = "package" + description = "short description" + license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # no "conan" and project name in topics. Use "pre-built" for tooling packages + topics = ("topic1", "topic2", "topic3", "pre-built") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" # even for pre-built executables + + # not needed but supress warning message from conan commands + def layout(self): + pass + + # specific compiler and build type, usually are not distributed by vendors + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + # in case some configuration is not supported + def validate(self): + if self.settings.os == "Macos" and Version(self.settings.os.version) < 11: + raise ConanInvalidConfiguration(f"{self.ref} requires OSX >=11.") + + # do not cache as source, instead, use build folder + def source(self): + pass + + # download the source here, than copy to package folder + def build(self): + get( + self, + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)], + strip_root=True, + ) + + # copy all needed files to the package folder + def package(self): + # a license file is always mandatory + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.exe", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + copy(self, pattern="foo", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + + def package_info(self): + # folders not used for pre-built binaries + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 + bin_folder = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_folder) diff --git a/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b3a58664b7d6b --- /dev/null +++ b/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("tool --version") diff --git a/docs/package_templates/prebuilt_tool_package/all/test_v1_package/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..36fd085b2d6b7 --- /dev/null +++ b/docs/package_templates/prebuilt_tool_package/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile +from conan.tools.build import can_run + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if can_run(self): + # self.run checks the command exit code + # the tool must be available on PATH, which is configured by self.env_info.PATH + self.run("tool --version", run_environment=True) diff --git a/docs/package_templates/prebuilt_tool_package/config.yml b/docs/package_templates/prebuilt_tool_package/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/prebuilt_tool_package/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all diff --git a/docs/review_process.md b/docs/review_process.md new file mode 100644 index 0000000000000..55eadf1bd0738 --- /dev/null +++ b/docs/review_process.md @@ -0,0 +1,140 @@ +# Review process + +Behind the scenes of conan-center-index, there is a heavily automated process to test and merge pull requests. +As there is a lot of activity from many users and various bots (e.g. bumping versions or updating conventions), many PRs are opened every day. +conan-center-index tries to make the process as smooth and simple as possible for the contributors, providing feedback in PRs. In this document will explain the review process in detail. + + +## Contents + + * [conan-center-bot](#conan-center-bot) + * [Green build](#green-build) + * [Unexpected error](#unexpected-error) + * [Avoiding conflicts](#avoiding-conflicts) + * [Draft](#draft) + * [Getting your pull request reviewed](#getting-your-pull-request-reviewed) + * [Rule of 2 reviews](#rule-of-2-reviews) + * [Reviews from others](#reviews-from-others) + * [Addressing review comments](#addressing-review-comments) + * [Automatic Merges](#automatic-merges) + * [Merge](#merge) + * [Package available to consume](#package-available-to-consume) + * [Updating web front end](#updating-web-front-end) + * [Stale PRs](#stale-prs) + +## [conan-center-bot](https://github.com/conan-center-bot) + +In general, reviews are driven by the automated [bot](https://github.com/conan-center-bot). The bot is responsible for: + +- Adding or removing labels (such as [Bump version](https://github.com/conan-io/conan-center-index/pulls?q=is%3Apr+is%3Aopen+label%3A%22Bump+version%22) or [Docs](https://github.com/conan-io/conan-center-index/pulls?q=is%3Apr+is%3Aopen+label%3ADocs)). +- Writing comments (most of the time, it's a build status, either failure with logs or success). +- Merging pull requests. +- Closing issues (after merging pull requests with GitHub keywords). +- Starting CI builds. +- Assigning CI status (running/failed/successful). + +## Green build + +The first important prerequisite is ensuring your PR is green (build is successful). +It requires a bit of patience, because there are many PRs running and we're building a lot of configurations for a numerous versions of libraries. +Keep attention to the error messages from the bot, and address all the build failures. +The bot tries to provide all the helpful information needed to understand and reproduce an issue, such as: + +- The profile that failed (in other words, the configuration: architecture, operation system, compiler, etc.) +- Failed command line (it might have failed on early stages, like recipe syntax errors, hook errors or later stages, like build or test). +- Logs containing the actual output of the build process (note that some logs like *configure.log* or *CMakeError.log* are not captured, only stdout/stderr). + +If you struggle to fix build errors yourself, you may want to ask for help from other users by mentioning (`@`) individual users in the pull request comments. + +### Unexpected error + +Sometimes, build fails with `Unexpected error` message. This indicates an infrastructure problem, and usually it's unrelated to the changes within PR itself. + +To learn more, checkout the [label definition](labels.md#unexpected-error). + +## Avoiding conflicts + +Right now, neither GitHub itself nor conan-center-bot notify about merge conflicts, so it's the contributor's responsibility to periodically check for the conflicts. Pull Requests that have merge conflicts can't be merged, and all the conflicts have to be resolved first. + +Please [synchronize your branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to take into account the latest changes in the main branch. This is important for ConanCenter to ensure it is building the correct recipe revision, see [this comment](https://github.com/conan-io/conan-center-index/pull/8797#discussion_r781993233) for details. One trick is to look out for comments from the [Community's Conflict PR Bot](https://github.com/prince-chrismc/conan-center-index/blob/patch-41/docs/community_resources.md#bots) which can anticipate possible problems. + +## Draft + +Draft pull requests are also never merged, and they won't likely be reviewed. +Once you're done with your changes, remember to convert from "Draft" to "Normal" pull request. + +## Getting your pull request reviewed + +Each PR must be reviewed by several reviewers before it will be merged. It cannot be just reviews from anyone, we have two categories of reviewers: + +- Official reviewers: these are active team members who are responsible for developing Conan, ConanCenter, and ConanCenterIndex. +- Community reviewers: this list includes former Conan team members and ConanCenterIndex contributors who are very active and proven to be trusted - they frequently submit pull requests and provide their own useful reviews + +The list or reviewers, located [here](../.c3i/reviewers.yml), +is not constant and will change periodically based on contribution. +That also means **you can be included in this list** as well - submit PRs and provide reviews, and in time you may be added as a trusted contributor. + +> **Note**: GitHubs user interface does not support such custom rules so you should not rely solely on the message it provides. + +### Rule of 2 reviews + +At least 2 approving reviews are required, and at least one of them has to be from the official reviewers. +So, it might be 1 official + 1 community, or 2 official, but it couldn't be just 2 community reviews. +Approvals are only counted if they are associated with the latest commit in the PR, while "Change requested" ones (from the Conan team) will persist even if there are new commits. Don't hesitate to dismiss old reviews if the issues have already been addressed. + +> **Note** Pull requests labelled as [`Bump version`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+version%22) +> or [`Bump dependencies`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+dependencies%22+) are merged by +> the bot without requiring any approval. + +### Reviews from others + +All reviews are still valuable and very helpful. Even if you're not listed as an official or community reviewer, **your reviews are very welcome**, so please do not hesitate to provide them. + +### Addressing review comments + +Please ensure to address the review comments and respond to them in order to get your PR approved and finally merged. +It doesn't always mean accepting all the suggestions, but at least providing a response, so people can understand your position. + +## Automatic Merges + +The bot runs Automatic Merges every 20 minutes. Currently, it can only merge a single PR in this timeframe, so there is a theoretical limit of ~70 PRs merged per day (in practice, it's even less for reasons listed below). +PR is selected for the merge only if: + +- Author is already [approved](https://github.com/conan-io/conan-center-index/issues/4). +- Author has signed the [CLA](CONTRIBUTOR_LICENSE_AGREEMENT.md). +- PR is not a Draft. +- PR has a green status (successful build). +- PR doesn't have merge conflicts with `master` branch. +- PR has approved reviews (as described above). +- PR does not have any [official reviewers](#official-reviewers) requesting changes +- Master build is not running already (see below) + +If these conditions are fulfilled, the PR is merged (associated issues are automatically closed), and then the build of `master` is launched. + +The conan-center-bot will perform a [squash and merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-pull-request-commits). You don't need to rebase +your pull request, we ask you not to do it because it will dismiss any reviews and the reviewer will need to restart. + +### Merge + +After merging a pull request, if an actual merge happened (for instance, the recipe changed in PR was already updated in `master` by the time PR merged), +it will introduce a new recipe revision. Therefore, the build should be run one more time, so the `master` build is launched. +In reality this could happen frequently enough if there are multiple PRs aiming to update the same recipe (even if they touch different files in the same recipe). +Such builds can take hours for big packages (like boost), blocking other merges for a while. +So we really appreciate it if changes in `master` to the same recipe are already merged into the proposed PR. + +### Package available to consume + +New packages are promoted from the internal repository to ConanCenter. This process is an internal Artifactory promotion that is quite +fast, nevertheless there are some caches and CDNs that need to be invalidated and propagated before the package is finally available for consumption. +The process can take several minutes, so please, consider a *grace period* and understand that the package won't be available immediately. + +### Updating web front end + +[ConanCenter](https://conan.io/center/) doesn't directly pull the information from conan-center-index +repository. Instead, it's updated by the conan center CI job as its own step. The metadata from the conan repository is +converted to the format the web-front-end understands and then sent to it as a scheduled update. As a result, there may occasionally be delays in updating the web-front-end. +That may explain the fact there are moments when the information showed in the frontend doesn't match the actual state on the ConanCenter repository. + +## Stale PRs + +Conan Center Index uses [stale bot](https://github.com/probot/stale) to close abandoned pull requests. It's configured by [stale.yml](../.github/stale.yml). When a pull request gets stale, we encourage anyone to take ownership of the PR (even submit changes to the author's branch if possible) so existing work doesn't get lost when the pull request is closed without merging. diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md new file mode 100644 index 0000000000000..f39ae2fe9c847 --- /dev/null +++ b/docs/supported_platforms_and_configurations.md @@ -0,0 +1,87 @@ +# Supported platforms and configurations + + +## Contents + + * [Introduction](#introduction) + * [Build Images](#build-images) + * [Windows](#windows) + * [Linux](#linux) + * [MacOS](#macos) + +## Introduction + +The pipeline iterates a fixed list of profiles for every Conan reference, +it computes the packageID for each profile and discard duplicates. Then it +builds the packages for the remaining profiles and upload them to +[JFrog ConanCenter](https://conan.io/center/) once the pull-request is merged. + +Because duplicated packageIDs are discarded, the pipeline iterates the +profiles always in the same order and the profiles selected to build when +there is a duplicate follow some rules: + + * Static linkage (option `shared=False`) is preferred over dynamic linking. + * On Windows, `MT/MTd` runtime linkage goes before `MD/MDd` linkage. + * Optimized binaries (`build_type=Release`) are preferred over its _debug_ counterpart. + * Older compiler versions are considered first. + * In Linux, GCC is iterated before Clang. + +Currently, given the following supported platforms and configurations we +are generating **136 different binary packages for a C++ library** +and **88 for a C library**. + +### Build Images + +For more information see [conan-io/conan-docker-tools](https://github.com/conan-io/conan-docker-tools) + +## Windows + +- Python: 3.7.9 +- CMake: 3.21.6 +- WinSDK: 10.0.20348 + > WinSDK version is rolled periodically as [discussed previously](https://github.com/conan-io/conan-center-index/issues/4450). + > Please open an issue in case it needs to be updated. +- Compilers: Visual Studio: + + + - 2019 (19.29.30148) + +- Release (MT/MD) and Debug (MTd, MDd) +- Architectures: x86_64 +- Build types: Release, Debug +- Runtimes: MT/MD (Release), MTd/MDd (Debug) +- Options: + - Shared, Static (option `"shared": [True, False]` in the recipe when available) + - Header Only (option `"header_only": [True, False]` if available) + +> :warning: The profile with the option `shared=True` and runtime `MT/MTd` is not built. + +## 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)) +- Compilers: + - GCC versions: 5, 7, 9, 10, 11 + - Clang versions: 12, 13 +- C++ Standard Library (`libcxx`): + - GCC compiler: `libstdc++`, `libstdc++11` + - Clang compiler: `libstdc++`, `libc++` +- Architectures: x86_64 +- Build types: Release, Debug +- Options: + - Shared, Static (option `"shared": [True, False]` in the recipe when available) + - Header Only (option `"header_only": [True, False]` is only added with the value True) + +## MacOS + +- Python: 3.7.12 +- CMake: 3.20.1 +- Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 +- Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 +- Macos deployment target (`minos`): 10.15, 11.0, 11.3 +- C++ Standard Library (`libcxx`): `libc++` +- Architectures: x86_64, armv8 +- Build types: Release, Debug +- Options: + - Shared, Static (option ``"shared": [True, False]`` in the recipe when available) + - Header Only (option `"header_only": [True, False]` is only added with the value True) diff --git a/docs/v2_linter.md b/docs/v2_linter.md new file mode 100644 index 0000000000000..3d6e3a3f6be33 --- /dev/null +++ b/docs/v2_linter.md @@ -0,0 +1,71 @@ +# Linter to help migration to Conan v2 + + +## Contents + + * [Running the linter locally](#running-the-linter-locally) + * [Import ConanFile from `conan`](#import-conanfile-from-conan) + * [Import tools from `conan`](#import-tools-from-conan) + +We are leveraging on custom Pylint rules. This +linter will run for every pull-request that is submitted to the repository and will +raise some warnings and errors that should be addressed in order to migrate the +recipes to Conan v2. + +It is important to note that these rules are targeting Conan v2 compatibility layer, their +purpose is to fail for v1 syntax that will be no longer available in v2. Even if the syntax +if perfectly valid in Conan v1, the recipe might fail here because it is not v2-compliant. + +> **Note** Some of the errored checks might be just plain Python syntax errors, while +> others might be related to the custom rules added by us. + +Here you can find some examples of the extra rules we are adding: + +## Running the linter locally + +Check the [Developing Recipes](developing_recipes_locally.md#running-the-python-linters) for details. + +## Import ConanFile from `conan` + +The module `conans` is deprecated in Conan v2. Now all the imports should be done from +module `conan`: + +```python +from conan import ConanFile +``` + +## Import tools from `conan` + +All v2-compatible tools are available in module `conan.tools` under different submodules. Recipes +should start to import their tools from this new module. Some of the new tools accept new +argument, please, check the [Conan documentation](https://docs.conan.io/1/reference/conanfile/tools.html). + +Here is a list of different imports and their new equivalent (note that the interface for most of this functions changed, see their respective link to the documentation): + +| **Conan v1** | **Conan v2** | **Required Conan Version** | +|---|---|---| +| conans.tools.get | [conan.tools.files.get](https://docs.conan.io/1/reference/conanfile/tools/files/downloads.html#conan-tools-files-get) | 1.41.0 | +| conans.tools.download | [conan.tools.files.download](https://docs.conan.io/1/reference/conanfile/tools/files/downloads.html#conan-tools-files-download) | 1.41.0 | +| conans.tools.rmdir | [conan.tools.files.rmdir](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rmdir) | 1.47.0 | +| conans.tools.patch | [conan.tools.files.patch](https://docs.conan.io/1/reference/tools.html#tools-patch) | 1.35.0 | +| conans.tools.remove_files_by_mask | [conan.tools.files.rm](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rm) | 1.50.0 | +| conans.copy | [conan.tools.files.copy](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-copy) | 1.46.0 | +| conans.tools.load | [conan.tools.files.load](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-load) | 1.35.0 | +| conans.tools.save | [conan.tools.files.save](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-save) | 1.35.0 | +| conans.tools.rename | [conan.tools.files.rename](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rename) | 1.37.0 | +| conans.tools.replace_in_file | [conan.tools.files.replace_in_file](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-replace-in-file) | 1.46.0 | +| conans.tools.mkdir | [conan.tools.files.mkdir](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-mkdir) | 1.35.0 | +| conans.tools.chdir | [conan.tools.files.chdir](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-chdir) | 1.40.0 | +| conans.tools.unzip | [conan.tools.files.unzip](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-unzip) | 1.46.0 | +| conans.tools.collect_libs | [conan.tools.files.collect_libs](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-collect-libs) | 1.46.0 | +| conans.tools.Version | [conan.tools.scm.Version](https://docs.conan.io/1/reference/conanfile/tools/scm/other.html#version) | 1.46.0 | +| conans.tools.sha256sum | [conan.tools.files.check_sha256](https://docs.conan.io/1/reference/conanfile/tools/files/checksum.html#conan-tools-files-check-sha256) | 1.46.0 | +| conans.tools.unix_path | [conan.tools.microsoft.unix_path](https://docs.conan.io/1/reference/conanfile/tools/microsoft.html#conan-tools-microsoft-unix-path) | 1.47.0 | +| conans.tools.is_apple_os | [conan.tools.apple.is_apple_os](https://docs.conan.io/1/reference/conanfile/tools/apple.html#is-apple-os) | 1.51.3 | +| conans.tools.cpu_count | [conan.tools.build.build_jobs](https://docs.conan.io/1/reference/conanfile/tools/build.html#conan-tools-build-build-jobs) | 1.43.0 | +| conans.tools.check_min_cppstd | [conan.tools.build.check_min_cppstd](https://docs.conan.io/1/reference/conanfile/tools/build.html#conan-tools-build-check-min-cppstd) | 1.50.0 | +| conans.tools.cross_building | [conan.tools.build.cross_building](https://docs.conan.io/1/reference/conanfile/tools/build.html#conan-tools-build-cross-building) | 1.46.0 | +| conans.errors.ConanInvalidConfiguration | [conan.errors.ConanInvalidConfiguration](https://docs.conan.io/1/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | +| conans.errors.ConanException | [conan.errors.ConanException](https://docs.conan.io/1/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | + +--- diff --git a/docs/v2_migration.md b/docs/v2_migration.md new file mode 100644 index 0000000000000..629cef881ac0e --- /dev/null +++ b/docs/v2_migration.md @@ -0,0 +1,208 @@ +# Preparing recipes for Conan 2.0 + +This is expected for recipes to be updates in each pull request. + +- Updated helpers are expected, this is enforced by the [v2_linter](v2_linter.md) +- Once a recipe publishes v2 packages, it must pass the v2 pipeline +- The v2 pipeline with **shortly be required** for changes to be merged. + + +## Contents + + * [Using Layout](#using-layout) + * [With New Generators](#with-new-generators) + * [With Multiple Build Helpers](#with-multiple-build-helpers) + * [CMakeToolchain](#cmaketoolchain) + * [New conf_info properties](#new-conf_info-properties) + * [New cpp_info set_property model](#new-cpp_info-set_property-model) + * [Translating .names information to cmake_target_name, cmake_module_target_name and cmake_file_name](#translating-names-information-to-cmake_target_name-cmake_module_target_name-and-cmake_file_name) + * [Translating .filenames information to cmake_file_name, cmake_module_file_name and cmake_find_mode](#translating-filenames-information-to-cmake_file_name-cmake_module_file_name-and-cmake_find_mode) + * [Translating .build_modules to cmake_build_modules](#translating-build_modules-to-cmake_build_modules) + * [PkgConfigDeps](#pkgconfigdeps) + +> **Note**: Read about the [linter in pull requests](v2_linter.md) to learn how this is being enforced. + +It's time to start thinking seriously about Conan v2 and prepare recipes +for the incoming changes. Conan v2 comes with many +changes and improvements, you can read about them in the +[Conan documentation](https://docs.conan.io/1/conan_v2.html). + +This document is a practical guide, offering extended information particular to Conan +Center Index recipes to get them ready to upgrade to Conan 2.0. + +## Using Layout + +All recipes should use a layout. Without one, more manual configuration of folders (e.g. source, build, etc) +and package structure will be required. + +### With New Generators + +When doing this there is no need to manually define `self._subfolder_[...]` in a recipe. +Simply use `self.source_folder` and `self.build_folder` instead of "subfolder properties" that used to be the norm. + +### With Multiple Build Helpers + +When different build tools are use, at least one layout needs to be set. + +```python + def layout(self): + if self._use_cmake(): + cmake_layout(self) + else: # using autotools + basic_layout(self) +``` + +The `src_folder` must be the same when using different layouts and should +not depend on settings or options. + +## CMakeToolchain + +The old `CMake.definition` should be replaced by `CMakeToolchain.variables` and moved to the `generate` method. +However, certain options need to be passed as `cache_variables`. You'll need to check project's `CMakeLists.txt` +as there are a few cases to look out for: + +- When an `option` is configured before `project()` is called. + + ```cmake + cmake_minimum_required(3.1) + option(BUILD_EXAMPLES "Build examples using foorbar") + project(foobar) + ``` + +- When an variable is declared with `CACHE`. + + ```cmake + cmake_minimum_required(3.1) + project(foobar) + set(USE_JPEG ON CACHE BOOL "include jpeg support?") + ``` + +For more information refere to the [CMakeToolchain docs](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmaketoolchain.html) +or check out the converstaion in conan-io/conan#11937 for the brave. + +## New conf_info properties + +As described in the documentation `self.user_info` has been depreated and you are now required to use +`self.conf_info` to define individual properties to expose to downstream recipes. +The [2.0 migrations docs](https://docs.conan.io/1/migrating_to_2.0/recipes.html#removed-self-user-info) +should cover the technical details, however for ConanCenterIndex we need to make sure there are no collisions +`conf_info` must be named `user.:`. + +For usage options of `conf_info`, the [documenation](https://docs.conan.io/1/reference/config_files/global_conf.html?highlight=conf_info#configuration-in-your-recipes) + +In ConanCenterIndex this will typically looks like: + +- defining a value + ```py + def package_info(self): + tool_path = os.path.join(self.package_folder, "bin", "tool") + self.conf_info.define("user.pkg:tool", tool_path) + ``` +- using a value + ```py + #generators = "VirtualBuildEnv", "VirtualRunEnv" + + def build_requirements(self): + self.tool_requires("tool/0.1") + + def build(self): + tool_path = self.conf_info.get("user.pkg:tool") + self.run(f"{tool_path} --build") + ``` + +> **Note**: This should only be used when absolutely required. In the vast majority of cases, the new +> ["Environments"](https://docs.conan.io/1/reference/conanfile/tools/env/environment.html?highlight=Virtual) +> will include the `self.cpp_info.bindirs` which will provide access to the tools in the correct scopes. + +## New cpp_info set_property model + +New Conan generators like +[CMakeDeps](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html) +and +[PkgConfigDeps](https://docs.conan.io/1/reference/conanfile/tools/gnu/pkgconfigdeps.html), +don't listen to `cpp_info`'s ``.names``, ``.filenames`` or ``.build_modules`` attributes. +There is a new way of setting the `cpp_info` information with these +generators using the ``set_property(property_name, value)`` method. + +All the information in the recipes, already set with the current model, should be +translated to the new model. These two models **will live together in recipes** to make +recipes compatible **with both new and current generators** for some time. + +We will cover some cases of porting all the information set with the current model to the +new one. To read more about the properties available for each generator and how the +properties model work, please check the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html). + +> **Note**: Please, remember that the **new** ``set_property`` and the **current** attributes +> model are *completely independent since Conan 1.43*. Setting ``set_property`` in recipes will +> not affect current CMake 1.X generators (``cmake``, ``cmake_multi``, ``cmake_find_package`` and +> ``cmake_find_package_multi``) at all. + +### Translating .names information to cmake_target_name, cmake_module_target_name and cmake_file_name + +The variation of `names` is covered by the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html#migrating-from-names-to-cmake-target-name). + +### Translating .filenames information to cmake_file_name, cmake_module_file_name and cmake_find_mode + +As for `filenames`, refer to [this section](https://docs.conan.io/1/migrating_to_2.0/properties.html#migrating-from-filenames-to-cmake-file-name). + +### Translating .build_modules to cmake_build_modules + +The declared `.build_modules` come from the original package that declares useful CMake functions, variables +etc. We need to use the property `cmake_build_modules` to declare a list of cmake files instead of using `cpp_info.build_modules`: + +```python +class PyBind11Conan(ConanFile): + name = "pybind11" + ... + + def package_info(self): + ... + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["main"].build_modules[generator].append(os.path.join("lib", "cmake", "pybind11", "pybind11Common.cmake")) + ... + +``` + +To translate this information to the new model we declare the `cmake_build_modules` property in the `root cpp_info` object: + +```python +class PyBind11Conan(ConanFile): + name = "pybind11" + ... + + def package_info(self): + ... + self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "pybind11", "pybind11Common.cmake")]) + ... + +``` + +### PkgConfigDeps + +The current [pkg_config](https://docs.conan.io/1/reference/generators/pkg_config.html) +generator suports the new ``set_property`` model for most of the properties. Then, the current +model can be translated to the new one without having to leave the old attributes in the +recipes. Let's see an example: + +```python +class AprConan(ConanFile): + name = "apr" + ... + def package_info(self): + self.cpp_info.names["pkg_config"] = "apr-1" + ... +``` + +In this case, you can remove the ``.names`` attribute and just leave: + +```python +class AprConan(ConanFile): + name = "apr" + ... + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "apr-1") + ... +``` + +For more information about properties supported by ``PkgConfigDeps`` generator, please check the [Conan +documentation](https://docs.conan.io/1/reference/conanfile/tools/gnu/pkgconfigdeps.html#properties). diff --git a/docs/v2_roadmap.md b/docs/v2_roadmap.md new file mode 100644 index 0000000000000..324ec01c47527 --- /dev/null +++ b/docs/v2_roadmap.md @@ -0,0 +1,150 @@ +# Road to Conan v2 + + +## Contents + + * [Short term](#short-term) + * [Prepare the CI infrastructure](#prepare-the-ci-infrastructure) + * [Export recipes using Conan v2 (warning)](#export-recipes-using-conan-v2-warning) + * [Prepare a syntax linter (CCI specific)](#prepare-a-syntax-linter-cci-specific) + * [Run an scheduled job exporting all recipes](#run-an-scheduled-job-exporting-all-recipes) + * [Mid term](#mid-term) + * [Add CI running Conan v2 (hidden)](#add-ci-running-conan-v2-hidden) + * [Show CI results to contributors (info)](#show-ci-results-to-contributors-info) + * [Linter - turn more warnings to errors](#linter---turn-more-warnings-to-errors) + * [Export using Conan v2 becomes an error](#export-using-conan-v2-becomes-an-error) + * [Long term](#long-term) + * [CI running v2 is reported (and required)](#ci-running-v2-is-reported-and-required) + * [Conan v2 remote](#conan-v2-remote) + * [Webpage with v2 information](#webpage-with-v2-information) + * [Future](#future) + * [CI running Conan v1 dropping configuration support](#ci-running-conan-v1-dropping-configuration-support) + +> **Note** This document is not a [guide about how to migrate recipes to Conan v2](v2_migration.md). + +> **Note** This is a working document that will be updated as we walk +> this path. There are no dates intentionally, and if any they should be +> considered as an estimation, there are still some unknowns to provide +> certain steps and dates. + +Conan v2 is under heavy development and it will be released in the +following months. It comes with many improvements that will benefit +recipes and users, and we are willing to adopt it. + +It is a new major version that will come with many breaking changes. Lot +of the features and syntax that we were used to in Conan v1 will no longer +be available and will be supersedes by improved alternatives. All these +alternatives should be backported to v1.x releases, so **there will be a +subset of features that will work using Conan v1 and v2**. + +**Our main goal in ConanCenter during this migration process is to ensure +that recipes work with v1 and v2** and to make the transition as smooth as +possible for contributors and users. In the end we will be providing +working recipes and binaries for both versions. + +This process will require a lot of work also in the internals, we will keep +communicating those changes and the relevant updates in the +[changelog](changelog.md). Here there are the main steps that we are +planning for the following months. + +## Short term + +### Prepare the CI infrastructure + +Workers for Conan v2 will be ready for Windows, Macos and Linux alternatives. +[Modern docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern) with Conan v2 are already +available to use, for example `conanio/gcc11-ubuntu16.04:2.0.0-pre`. +Note that we will be using tag name `2.0.0-pre` until there is an +actual Conan v2 release, this tag will use the latest pre-release +available (alpha, beta or release candidate). + +### Export recipes using Conan v2 (warning) + +We will start to run `conan export` using Conan v2 and the result will be +added to the comments by the bot. Failing this command won't make the +pull-request fail at this moment, but we expect contributors to start +gaining awareness about changes in Conan v2. + +### Prepare a syntax linter (CCI specific) + +We want to provide a Conan recipe's linter in this repository. We will add +warnings and errors to it following the pace dictated by the community. +The purpose is that this linter will fail pull-requests if there is any +error and, this way, we can start to migrate small (and easy) bits of +recipes... and ensure that future pull-requests don't introduce +regressions. + +This linter can (and surely will) implement some of the checks that are +being currently done by [hooks](https://github.com/conan-io/hooks), but +the purpose is not replace them: + +* hooks are really useful from the CLI, and are easier to install and run. +* linter provides much better output in GitHub interface. + +### Run an scheduled job exporting all recipes + +The same way we [export all the recipes every night using Conan v1](https://github.com/conan-io/conan-center-index/issues/2232), we will +run something similar using Conan v2 and report the results to an issue in +this repository. + +It will help us to know how many recipes are fixed at a given time and +think about efforts and impact of next steps. + +## Mid term + +### Add CI running Conan v2 (hidden) + +We will start working on a CI running Conan v2. Once recipes start to be +exported successfully, next step is to start building the packages. + +We are going to prepare the CI and start running it behind the scenes +(sorry, at this moment hidden to users) in order to understand and +experiment ourself some challenges that will come with Conan v2: syntax, +configuration defaults,... + +### Show CI results to contributors (info) + +Once the errors start to make sense, we will start to provide these outputs +in pull-requests (although successful builds using v2 won't be required to +merge). Again, we expect some contributors to be aware of these errors, +maybe try to fix those builds, and for sure report feedback. + +### Linter - turn more warnings to errors + +During all this time, the plan is to move linter warnings to errors, one +by one and taking into account the effort required to fix them. With the +help of the linter more recipes should start to work (just `conan export`) +using Conan v2. + +### Export using Conan v2 becomes an error + +When a significant number (TBD) of recipes start to be exported +successfully, we will turn those export warnings into actual errors and +they will be become required to merge the pull-requests + +## Long term + +### CI running v2 is reported (and required) + +Next step is to start running and reporting the results of the builds using +v2 for all the configurations, like we do for Conan v1. At this time all +pull-requests need to work with v1 and v2 to be merged. + +### Conan v2 remote + +Packages built using Conan v2 are available for users on ``conancenter`` remote. + +### Webpage with v2 information + +ConanCenter webpage will start to show relevant information related to v2 +packages and, eventually, v2 information will be the only available. + +## Future + +After this process in completed, we will consider the deprecation and +decommission of the infrastructure to generate v1 packages. + +### CI running Conan v1 dropping configuration support + +The change should occur by steps, less used configurations, like older compiler versions, will be dropped first. +Any changed will notified before to occur, so users can be prepared. diff --git a/linter/__init__.py b/linter/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/linter/check_import_conanfile.py b/linter/check_import_conanfile.py new file mode 100644 index 0000000000000..bd5a90391b096 --- /dev/null +++ b/linter/check_import_conanfile.py @@ -0,0 +1,28 @@ + +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes, Const, AssignName + + +class ImportConanFile(BaseChecker): + """ + Import ConanFile from new 'conan' module + """ + + __implements__ = IAstroidChecker + + name = "conan-import-conanfile" + msgs = { + "E9006": ( + "Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.", + "conan-import-conanfile", + "Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.", + ), + } + + def visit_importfrom(self, node: nodes.ImportFrom) -> None: + basename = node.modname + if basename == 'conans': + names = [name for name, _ in node.names] + if 'ConanFile' in names: + self.add_message("conan-import-conanfile", node=node) diff --git a/linter/check_import_errors.py b/linter/check_import_errors.py new file mode 100644 index 0000000000000..b6a0ac1aa9973 --- /dev/null +++ b/linter/check_import_errors.py @@ -0,0 +1,77 @@ + +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes, Const, AssignName + + +class ImportErrors(BaseChecker): + """ + Import errors from new 'conan' module + """ + + __implements__ = IAstroidChecker + + name = "conan-import-errors" + msgs = { + "E9008": ( + "Import errors from new module: `from conan import errors`. Old import is deprecated in Conan v2.", + "conan-import-errors", + "Import errors from new module: `from conan import errors`. Old import is deprecated in Conan v2.", + ), + } + + def visit_importfrom(self, node: nodes.ImportFrom) -> None: + basename = node.modname + if basename == 'conans': + names = [name for name, _ in node.names] + if 'errors' in names: + self.add_message("conan-import-errors", node=node) + + +class ImportErrorsConanException(BaseChecker): + """ + Import errors from new 'conan' module + """ + + __implements__ = IAstroidChecker + + name = "conan-import-error-conanexception" + msgs = { + "E9009": ( + "Import ConanException from new module: `from conan.errors import ConanException`. Old import is deprecated in Conan v2.", + "conan-import-error-conanexception", + "Import ConanException from new module: `from conan.errors import ConanException`. Old import is deprecated in Conan v2.", + ), + } + + def visit_importfrom(self, node: nodes.ImportFrom) -> None: + basename = node.modname + if basename == 'conans.errors': + names = [name for name, _ in node.names] + if 'ConanException' in names: + self.add_message("conan-import-error-conanexception", node=node) + + +class ImportErrorsConanInvalidConfiguration(BaseChecker): + """ + Import errors from new 'conan' module + """ + + __implements__ = IAstroidChecker + + name = "conan-import-error-conaninvalidconfiguration" + msgs = { + "E9010": ( + "Import ConanInvalidConfiguration from new module: `from conan.errors import ConanInvalidConfiguration`. Old import is deprecated in Conan v2.", + "conan-import-error-conaninvalidconfiguration", + "Import ConanInvalidConfiguration from new module: `from conan.errors import ConanInvalidConfiguration`. Old import is deprecated in Conan v2.", + ), + } + + def visit_importfrom(self, node: nodes.ImportFrom) -> None: + basename = node.modname + if basename == 'conans.errors': + names = [name for name, _ in node.names] + if 'ConanInvalidConfiguration' in names: + self.add_message("conan-import-error-conaninvalidconfiguration", node=node) + diff --git a/linter/check_import_tools.py b/linter/check_import_tools.py new file mode 100644 index 0000000000000..1621c7b3dfd2a --- /dev/null +++ b/linter/check_import_tools.py @@ -0,0 +1,30 @@ +import re +from email.mime import base +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes, Const, AssignName + + +class ImportTools(BaseChecker): + """ + Import tools following pattern 'from conan.tools.xxxx import yyyyy' + """ + + __implements__ = IAstroidChecker + + name = "conan-import-tools" + msgs = { + "E9011": ( + "Import tools following pattern 'from conan.tools.xxxx import yyyyy' (https://docs.conan.io/en/latest/reference/conanfile/tools.html).", + "conan-import-tools", + "Import tools following pattern 'from conan.tools.xxxx import yyyyy' (https://docs.conan.io/en/latest/reference/conanfile/tools.html).", + ), + } + + def visit_importfrom(self, node: nodes.ImportFrom) -> None: + basename = node.modname + names = [name for name, _ in node.names] + if basename == 'conan' and 'tools' in names: + self.add_message("conan-import-tools", node=node) + elif re.match(r'conan\.tools\.[^.]+\..+', basename): + self.add_message("conan-import-tools", node=node) diff --git a/linter/check_layout_src_folder.py b/linter/check_layout_src_folder.py new file mode 100644 index 0000000000000..b7d418884ca45 --- /dev/null +++ b/linter/check_layout_src_folder.py @@ -0,0 +1,44 @@ +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes + +WHY_SRC_FOLDER = "Setting the `src_folder` for layouts will help keep an organized and clean workspace when developing recipes locally. " \ + "The extra folder will help ensure there are no collisions between the upstream sources and recipe's exports - which " \ + "also extends to what happens in the cache when creating packages" + + +class LayoutSrcFolder(BaseChecker): + """ + Ensure `src_folder=src` when using built-in layouts + """ + + __implements__ = IAstroidChecker + + name = "conan-layout-src-folder" + msgs = { + "E9012": ( + "layout is missing `src_folder` argument which should be to `src`", + "conan-missing-layout-src-folder", + WHY_SRC_FOLDER, + ), + "E9013": ( + "layout should set `src_folder` to `src`", + "conan-layout-src-folder-is-src", + WHY_SRC_FOLDER, + ), + } + + def visit_call(self, node: nodes.Call) -> None: + if not isinstance(node.func, nodes.Name): + return + + if node.func.name in ["cmake_layout", "bazel_layout", "basic_layout"]: + for kw in node.keywords: + if kw.arg == "src_folder": + if not kw.value or kw.value.as_string().strip("\"'") != "src": + self.add_message( + "conan-layout-src-folder-is-src", node=node, line=node.lineno + ) + break + else: + self.add_message("conan-missing-layout-src-folder", node=node, line=node.lineno) diff --git a/linter/check_package_name.py b/linter/check_package_name.py new file mode 100644 index 0000000000000..9068241f96b18 --- /dev/null +++ b/linter/check_package_name.py @@ -0,0 +1,52 @@ +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes, Const, AssignName +from pathlib import Path + + +class PackageName(BaseChecker): + """ + All packages must have a lower-case name + """ + + __implements__ = IAstroidChecker + + name = "conan-package-name" + msgs = { + "E9004": ( + "Reference name should be all lowercase", + "conan-bad-name", + "Use only lower-case on the package name: `name = 'foobar'`." + ), + "E9005": ( + "Missing name attribute", + "conan-missing-name", + "The member attribute `name` must be declared: `name = 'foobar'`." + ), + "E9007": ( + "No 'name' attribute in test_package conanfile", + "conan-test-no-name", + "No 'name' attribute in test_package conanfile." + ), + } + + def visit_classdef(self, node: nodes) -> None: + filename = Path(node.root().file) + is_test = filename.match('test_package/*.py') or filename.match('test_v1_package/*.py') + + if node.basenames == ['ConanFile']: + for attr in node.body: + children = list(attr.get_children()) + if len(children) == 2 and \ + isinstance(children[0], AssignName) and \ + children[0].name == "name" and \ + isinstance(children[1], Const): + if is_test: + self.add_message("conan-test-no-name", node=attr, line=attr.lineno) + return + value = children[1].as_string() + if value.lower() != value: + self.add_message("conan-bad-name", node=attr, line=attr.lineno) + return + if not is_test: + self.add_message("conan-missing-name", node=node) diff --git a/linter/check_version_attribute.py b/linter/check_version_attribute.py new file mode 100644 index 0000000000000..66e61f47ef183 --- /dev/null +++ b/linter/check_version_attribute.py @@ -0,0 +1,33 @@ +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes, Const, AssignName + + +class VersionAttribute(BaseChecker): + """ + All packages should not enforce a specific version in the recipe + """ + + __implements__ = IAstroidChecker + + name = "conan-attr-version" + msgs = { + "E9014": ( + "Recipe should not contain version attribute", + "conan-forced-version", + "Do not enforce a specific version in your recipe. Keep it generic for any version." + ), + } + + def visit_classdef(self, node: nodes) -> None: + if node.basenames == ['ConanFile']: + for attr in node.body: + children = list(attr.get_children()) + if len(children) == 2 and \ + isinstance(children[0], AssignName) and \ + children[0].name == "version" and \ + isinstance(children[1], Const): + value = children[1].as_string().replace('"', "").replace("'", "") + if value and value != "system": + self.add_message("conan-forced-version", node=attr, line=attr.lineno) + return diff --git a/linter/conandata_yaml_linter.py b/linter/conandata_yaml_linter.py new file mode 100644 index 0000000000000..9e7133803906e --- /dev/null +++ b/linter/conandata_yaml_linter.py @@ -0,0 +1,125 @@ +import argparse +from strictyaml import ( + load, + Map, + Str, + YAMLValidationError, + MapPattern, + Optional, + Seq, + Enum, + Any, +) +from yaml_linting import file_path + + +CONANDATA_YAML_URL = "https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md" + + +def main(): + parser = argparse.ArgumentParser( + description="Validate Conan's 'conandata.yaml' file to ConanCenterIndex's requirements." + ) + parser.add_argument( + "path", + nargs="?", + type=file_path, + help="file to validate.", + ) + args = parser.parse_args() + + patch_fields = Map( + { + "patch_file": Str(), + "patch_description": Str(), + "patch_type": Enum( + ["official", "conan", "portability", "bugfix", "vulnerability"] + ), + Optional("patch_source"): Str(), + # No longer required for v2 recipes with layouts + Optional("base_path"): Str(), + } + ) + schema = Map( + { + "sources": MapPattern(Str(), Any(), minimum_keys=1), + Optional("patches"): MapPattern(Str(), Seq(Any()), minimum_keys=1), + } + ) + + with open(args.path, encoding="utf-8") as f: + content = f.read() + + try: + parsed = load(content, schema) + except YAMLValidationError as error: + pretty_print_yaml_validate_error(args, error) # Error when "source" is missing or when "patches" has no versions + return + except BaseException as error: + pretty_print_yaml_validate_error(args, error) # YAML could not be parsed + return + + if "patches" in parsed: + for version in parsed["patches"]: + patches = parsed["patches"][version] + if version not in parsed["sources"]: + print( + f"::warning file={args.path},line={patches.start_line},endline={patches.end_line}," + f"title=conandata.yml inconsistency" + f"::Patch(es) are listed for version `{version}`, but there is source for this version." + f" You should either remove `{version}` from the `patches` section, or add it to the" + f" `sources` section" + ) + for i, patch in enumerate(patches): + # Individual report errors for each patch object + try: + parsed["patches"][version][i].revalidate(patch_fields) + except YAMLValidationError as error: + 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" + ) + + # v2 migrations suggestion + if "base_path" in parsed["patches"][version][i]: + base_path = parsed["patches"][version][i]["base_path"] + print( + f"::notice file={args.path},line={base_path.start_line},endline={base_path.end_line}," + f"title=conandata.yml v2 migration suggestion" + "::'base_path' should not be required once a recipe has been upgraded to take advantage of" + " layouts (see https://docs.conan.io/en/latest/reference/conanfile/tools/layout.html) and" + " the new helper (see https://docs.conan.io/en/latest/reference/conanfile/tools/files/patches.html#conan-tools-files-apply-conandata-patches)" + ) + + +def pretty_print_yaml_validate_error(args, error): + snippet = error.context_mark.get_snippet().replace("\n", "%0A") + print( + f"::error file={args.path},line={error.context_mark.line},endline={error.problem_mark.line+1}," + f"title=conandata.yml schema error" + f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" + ) + +def pretty_print_yaml_validate_warning(args, error): + snippet = error.context_mark.get_snippet().replace("\n", "%0A") + print( + f"::warning file={args.path},line={error.context_mark.line},endline={error.problem_mark.line+1}," + f"title=conandata.yml schema warning" + f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" + ) + + +if __name__ == "__main__": + main() diff --git a/linter/conanv2_transition.py b/linter/conanv2_transition.py new file mode 100644 index 0000000000000..e330ff1d44590 --- /dev/null +++ b/linter/conanv2_transition.py @@ -0,0 +1,24 @@ +""" + +Pylint plugin/rules for conanfiles in Conan Center Index + +""" + +from pylint.lint import PyLinter +from linter.check_package_name import PackageName +from linter.check_import_conanfile import ImportConanFile +from linter.check_import_errors import ImportErrorsConanException, ImportErrorsConanInvalidConfiguration, ImportErrors +from linter.check_import_tools import ImportTools +from linter.check_layout_src_folder import LayoutSrcFolder +from linter.check_version_attribute import VersionAttribute + + +def register(linter: PyLinter) -> None: + linter.register_checker(PackageName(linter)) + linter.register_checker(ImportConanFile(linter)) + linter.register_checker(ImportErrors(linter)) + linter.register_checker(ImportErrorsConanException(linter)) + linter.register_checker(ImportErrorsConanInvalidConfiguration(linter)) + linter.register_checker(ImportTools(linter)) + linter.register_checker(LayoutSrcFolder(linter)) + linter.register_checker(VersionAttribute(linter)) diff --git a/linter/config_yaml_linter.py b/linter/config_yaml_linter.py new file mode 100644 index 0000000000000..29807e6ce3b99 --- /dev/null +++ b/linter/config_yaml_linter.py @@ -0,0 +1,37 @@ +import argparse +from strictyaml import load, Map, Str, YAMLValidationError, MapPattern +from yaml_linting import file_path + + +def main(): + parser = argparse.ArgumentParser( + description="Validate ConanCenterIndex's 'config.yaml' file." + ) + parser.add_argument( + "path", + nargs="?", + type=file_path, + help="file to validate.", + ) + args = parser.parse_args() + + schema = Map( + {"versions": MapPattern(Str(), Map({"folder": Str()}), minimum_keys=1)} + ) + + with open(args.path) as f: + content = f.read() + + try: + load(content, schema) + except YAMLValidationError as error: + e = error.__str__().replace("\n", "%0A") + print( + f"::error file={args.path},line={error.context_mark.line},endline={error.problem_mark.line}," + f"title=config.yml schema error" + f"::{e}\n" + ) + + +if __name__ == "__main__": + main() diff --git a/linter/pylintrc_recipe b/linter/pylintrc_recipe new file mode 100644 index 0000000000000..5b4db4ad401f0 --- /dev/null +++ b/linter/pylintrc_recipe @@ -0,0 +1,30 @@ +[MASTER] +load-plugins=linter.conanv2_transition, + linter.transform_conanfile, + linter.transform_imports + +py-version=3.6 +recursive=no +suggestion-mode=yes +unsafe-load-any-extension=no + +[MESSAGES CONTROL] +disable=fixme, + line-too-long, + missing-module-docstring, + missing-function-docstring, + missing-class-docstring, + invalid-name, + wrong-import-order, # TODO: Remove + import-outside-toplevel # TODO: Remove + +enable=conan-bad-name, + conan-missing-name, + conan-import-conanfile, + conan-forced-version + +[REPORTS] +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error) / statement) * 10)) +output-format=text +reports=no +score=no diff --git a/linter/pylintrc_testpackage b/linter/pylintrc_testpackage new file mode 100644 index 0000000000000..c5cf96e8cadf7 --- /dev/null +++ b/linter/pylintrc_testpackage @@ -0,0 +1,32 @@ +[MASTER] +load-plugins=linter.conanv2_transition, + linter.transform_conanfile, + linter.transform_imports + +py-version=3.6 +recursive=no +suggestion-mode=yes +unsafe-load-any-extension=no + +[MESSAGES CONTROL] +disable=fixme, + line-too-long, + missing-module-docstring, + missing-function-docstring, + missing-class-docstring, + invalid-name, + wrong-import-order, # TODO: Remove + import-outside-toplevel, # TODO: Remove + + # Not relevant to test package + conan-missing-layout-src-folder, + conan-layout-src-folder-is-src + +enable=conan-test-no-name, + conan-import-conanfile + +[REPORTS] +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error) / statement) * 10)) +output-format=text +reports=no +score=no diff --git a/linter/recipe_linter.json b/linter/recipe_linter.json new file mode 100644 index 0000000000000..0b9ff4566b051 --- /dev/null +++ b/linter/recipe_linter.json @@ -0,0 +1,43 @@ +{ + "problemMatcher": [ + { + "owner": "recipe_linter_fatals", + "severity": "error", + "pattern": [ + { + "regexp": "(\\S+):(\\d+): \\[(F\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)", + "file": 1, + "line": 2, + "message": 5, + "code": 3 + } + ] + }, + { + "owner": "recipe_linter_errors", + "severity": "error", + "pattern": [ + { + "regexp": "(\\S+):(\\d+): \\[(E\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)", + "file": 1, + "line": 2, + "message": 5, + "code": 3 + } + ] + }, + { + "owner": "recipe_linter_warnings", + "severity": "warning", + "pattern": [ + { + "regexp": "(\\S+):(\\d+): \\[(W\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)", + "file": 1, + "line": 2, + "message": 5, + "code": 3 + } + ] + } + ] +} diff --git a/linter/transform_conanfile.py b/linter/transform_conanfile.py new file mode 100644 index 0000000000000..8e33d368643b1 --- /dev/null +++ b/linter/transform_conanfile.py @@ -0,0 +1,74 @@ + +# Class ConanFile doesn't declare all the valid members and functions, +# some are injected by Conan dynamically to the class. + +import textwrap +import astroid +from astroid.builder import AstroidBuilder +from astroid.manager import AstroidManager + + +def _settings_transform(): + module = AstroidBuilder(AstroidManager()).string_build( + textwrap.dedent(""" + class Settings(object): + os = None + arch = None + compiler = None + build_type = None + """) + ) + return module['Settings'] + +def _user_info_build_transform(): + module = AstroidBuilder(AstroidManager()).string_build( + textwrap.dedent(""" + class UserInfoBuild(defaultdict): + pass + """) + ) + return module['UserInfoBuild'] + + +def register(_): + pass + +def transform_conanfile(node): + """Transform definition of ConanFile class so dynamic fields are visible to pylint""" + + str_class = astroid.builtin_lookup("str") + dict_class = astroid.builtin_lookup("dict") + info_class = astroid.MANAGER.ast_from_module_name("conans.model.info").lookup( + "ConanInfo") + build_requires_class = astroid.MANAGER.ast_from_module_name( + "conans.client.graph.graph_manager").lookup("_RecipeBuildRequires") + file_copier_class = astroid.MANAGER.ast_from_module_name( + "conans.client.file_copier").lookup("FileCopier") + file_importer_class = astroid.MANAGER.ast_from_module_name( + "conans.client.importer").lookup("_FileImporter") + python_requires_class = astroid.MANAGER.ast_from_module_name( + "conans.client.graph.python_requires").lookup("PyRequires") + + dynamic_fields = { + "conan_data": str_class, + "build_requires": build_requires_class, + "tool_requires": build_requires_class, + "info_build": info_class, + "user_info_build": [_user_info_build_transform()], + "info": info_class, + "copy": file_copier_class, + "copy_deps": file_importer_class, + "python_requires": [str_class, python_requires_class], + "recipe_folder": str_class, + "settings_build": [_settings_transform()], + "settings_target": [_settings_transform()], + "conf": dict_class, + } + + for f, t in dynamic_fields.items(): + node.locals[f] = [i for i in t] + + +astroid.MANAGER.register_transform( + astroid.ClassDef, transform_conanfile, + lambda node: node.qname() == "conans.model.conan_file.ConanFile") diff --git a/linter/transform_imports.py b/linter/transform_imports.py new file mode 100644 index 0000000000000..78b72e4b16880 --- /dev/null +++ b/linter/transform_imports.py @@ -0,0 +1,46 @@ + +import astroid +from pylint.lint import PyLinter + +""" +Here we are transforming the imports to mimic future Conan v2 release. With +these changes, built-in checks in Pylint will raise with different errors, so +we are modifying the messages to point users in the right direction. +""" + + +def register(linter: PyLinter): + msge1101 = linter.msgs_store._messages_definitions["E1101"] + msge1101.msg += ". Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md" + linter.msgs_store.register_message(msge1101) + + msge0611 = linter.msgs_store._messages_definitions["E0611"] + msge0611.msg += ". Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md" + linter.msgs_store.register_message(msge0611) + +def transform_tools(module): + """ Transform import module """ + if 'get' in module.locals: + del module.locals['get'] + if 'cross_building' in module.locals: + del module.locals['cross_building'] + if 'rmdir' in module.locals: + del module.locals['rmdir'] + if 'Version' in module.locals: + del module.locals['Version'] + +def transform_errors(module): + pass + #if 'ConanInvalidConfiguration' in module.locals: + # del module.locals['ConanInvalidConfiguration'] + #if 'ConanException' in module.locals: + # del module.locals['ConanException'] + + +astroid.MANAGER.register_transform( + astroid.Module, transform_tools, + lambda node: node.qname() == "conans.tools") + +astroid.MANAGER.register_transform( + astroid.Module, transform_errors, + lambda node: node.qname() == "conans.errors") diff --git a/linter/yaml_linting.py b/linter/yaml_linting.py new file mode 100644 index 0000000000000..8b61d99ba39f9 --- /dev/null +++ b/linter/yaml_linting.py @@ -0,0 +1,9 @@ +import argparse + + +def file_path(a_string): + from os.path import isfile + + if not isfile(a_string): + raise argparse.ArgumentTypeError(f"{a_string} does not point to a file") + return a_string diff --git a/linter/yamllint_matcher.json b/linter/yamllint_matcher.json new file mode 100644 index 0000000000000..42a3ef93b5956 --- /dev/null +++ b/linter/yamllint_matcher.json @@ -0,0 +1,22 @@ +{ + "problemMatcher": [ + { + "owner": "yamllint_matcher", + "pattern": [ + { + "regexp": "^(.*\\.ya?ml)$", + "file": 1 + }, + { + "regexp": "^\\s{2}(\\d+):(\\d+)\\s+(error|warning)\\s+(.*?)\\s+\\((.*)\\)$", + "line": 1, + "column": 2, + "severity": 3, + "message": 4, + "code": 5, + "loop": true + } + ] + } + ] +} diff --git a/linter/yamllint_rules.yml b/linter/yamllint_rules.yml new file mode 100644 index 0000000000000..7c0ce102ddc36 --- /dev/null +++ b/linter/yamllint_rules.yml @@ -0,0 +1,26 @@ +extends: default +rules: + document-start: + level: error + present: false + document-end: + level: error + present: false + 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 + new-lines: + type: unix + key-duplicates: + level: error diff --git a/recipes/7zip/19.00/conandata.yml b/recipes/7zip/19.00/conandata.yml new file mode 100644 index 0000000000000..0d36819b4de39 --- /dev/null +++ b/recipes/7zip/19.00/conandata.yml @@ -0,0 +1,4 @@ +sources: + "19.00": + url: https://www.7-zip.org/a/7z1900-src.7z + sha256: "9ba70a5e8485cf9061b30a2a84fe741de5aeb8dd271aab8889da0e9b3bf1868e" diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/19.00/conanfile.py new file mode 100644 index 0000000000000..d18ee2242a6e7 --- /dev/null +++ b/recipes/7zip/19.00/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import download, chdir, replace_in_file +from conans import tools, AutoToolsBuildEnvironment +import os + +required_conan_version = ">=1.47.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", "BSD-3-Clause", "Unrar") + homepage = "https://www.7-zip.org" + topics = ("7zip", "zip", "compression", "decompression") + settings = "os", "arch", "compiler" + + @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 build_requirements(self): + self.build_requires("lzma_sdk/9.20") + + if self.settings.compiler != "Visual Studio" 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.compiler + + def _uncompress_7z(self, filename): + self.run(f"7zr x {filename}") + + def source(self): + from six.moves.urllib.parse import urlparse + url = self.conan_data["sources"][self.version]["url"] + filename = os.path.basename(urlparse(url).path) + sha256 = self.conan_data["sources"][self.version]["sha256"] + download(self, url, filename, sha256) + self._uncompress_7z(filename) + os.unlink(filename) + + @property + def _msvc_platform(self): + return { + "x86_64": "x64", + "x86": "x86", + }[str(self.settings.arch)] + + def _build_msvc(self): + with tools.vcvars(self.settings): + with chdir(self, os.path.join("CPP", "7zip")): + self.run(f"nmake /f makefile PLATFORM={self._msvc_platform}") + + def _build_autotools(self): + # TODO: Enable non-Windows methods in configure + autotools = AutoToolsBuildEnvironment(self) + extra_env = {} + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + extra_env["IS_MINGW"] = "1" + with tools.environment_append(extra_env): + with chdir(self, os.path.join("CPP", "7zip", "Bundles", "LzmaCon")): + autotools.make(args=["-f", "makefile.gcc"], target="all") + + def _patch_sources(self): + if self.settings.compiler == "Visual Studio": + fn = os.path.join("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}") + + def build(self): + self._patch_sources() + if self.settings.compiler == "Visual Studio": + self._build_msvc() + else: + self._build_autotools() + + def package(self): + self.copy("DOC/License.txt", src="", dst="licenses") + self.copy("DOC/unRarLicense.txt", src="", dst="licenses") + if self.settings.os == "Windows": + self.copy("*.exe", src="CPP/7zip", dst="bin", keep_path=False) + self.copy("*.dll", src="CPP/7zip", dst="bin", 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/19.00/test_package/conanfile.py new file mode 100644 index 0000000000000..f6a6ccb388a8e --- /dev/null +++ b/recipes/7zip/19.00/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("7z.exe") diff --git a/recipes/7zip/config.yml b/recipes/7zip/config.yml new file mode 100644 index 0000000000000..46489517ceb78 --- /dev/null +++ b/recipes/7zip/config.yml @@ -0,0 +1,3 @@ +versions: + "19.00": + folder: "19.00" diff --git a/recipes/aaf/all/conandata.yml b/recipes/aaf/all/conandata.yml new file mode 100644 index 0000000000000..47f1b39d22fea --- /dev/null +++ b/recipes/aaf/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.2.0": + url: "https://downloads.sourceforge.net/project/aaf/AAF-src/1.2.0/AAF-src-1.2.0.tar.gz" + sha256: "02789b22c96a6f0da112ba990967a8b3fe7228b0435db8ea328d88f9e424086d" +patches: + "1.2.0": + - patch_file: "patches/1.2.0-001-simpler-cmakelists.patch" + patch_type: "conan" + patch_description: "Simplify CMakeLists.txt" + - patch_file: "patches/1.2.0-002-link-core-with-find-library.patch" + patch_type: "portability" + patch_description: "Link CoreFoundation and CoreServices with find_library" + - patch_file: "patches/1.2.0-003-remove-register-keyword.patch" + patch_type: "portability" + patch_description: "Remove deprecated use of register keyword for c++11 builds" + - patch_file: "patches/1.2.0-004-remove-expat.patch" + patch_type: "conan" + patch_description: "Remove expat dependency directory" + - patch_file: "patches/1.2.0-005-remove-libjpeg.patch" + patch_type: "conan" + patch_description: "Remove libjpeg dependency directory" + - patch_file: "patches/1.2.0-006-link-libuuid.patch" + patch_type: "conan" + patch_description: "Link libuuid" + - patch_file: "patches/1.2.0-007-support-all-generators.patch" + patch_type: "portability" + patch_description: "Support all CMake generators" diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py new file mode 100644 index 0000000000000..358a4f96210ec --- /dev/null +++ b/recipes/aaf/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + + +class AafConan(ConanFile): + name = "aaf" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceforge.net/projects/aaf/" + description = ( + "A cross-platform SDK for AAF. AAF is a metadata management system and " + "file format for use in professional multimedia creation and authoring." + ) + topics = ("multimedia", "crossplatform") + license = "AAFSDKPSL-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "structured_storage": [True, False], + } + default_options = { + "structured_storage": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("expat/2.5.0") + self.requires("libjpeg/9e") + if self.settings.os in ("FreeBSD", "Linux"): + self.requires("libuuid/1.0.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_apple_os(self): + tc.cache_variables["PLATFORM"] = "apple-clang" + elif is_msvc(self): + tc.cache_variables["PLATFORM"] = "vc" + else: + tc.cache_variables["PLATFORM"] = str(self.settings.os) + # ARCH is used only for setting the output directory, except if host is macOS + # where ARCH is used to select proper pre-compiled proprietary Structured Storage library. + if self.settings.os == "Macos" and self.settings.arch == "armv8": + tc.cache_variables["ARCH"] = "arm64" + else: + tc.cache_variables["ARCH"] = "x86_64" + tc.cache_variables["AAF_NO_STRUCTURED_STORAGE"] = not self.options.structured_storage + jpeg_res_dirs = ";".join([p.replace("\\", "/") for p in self.dependencies["libjpeg"].cpp_info.aggregated_components().resdirs]) + tc.variables["JPEG_RES_DIRS"] = jpeg_res_dirs + 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, "AAFSDKPSL.TXT", src=os.path.join(self.source_folder, "LEGAL"), dst=os.path.join(self.package_folder, "licenses")) + out_include_folder = os.path.join(self.source_folder, "out", "shared", "include") + out_target_folder = os.path.join(self.source_folder, "out", "target") + copy(self, "*.h", src=out_include_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "*/RefImpl/*.dll", src=out_target_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*/RefImpl/*.lib", src=out_target_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*/RefImpl/*.so*", src=out_target_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*/RefImpl/*.dylib", src=out_target_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*/RefImpl/*.a", src=out_target_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + + def package_info(self): + if self.settings.os == "Windows": + suffix = "D" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"AAF{suffix}", f"AAFIID{suffix}", "AAFCOAPI"] + else: + self.cpp_info.libs = ["aaflib", "aafiid", "com-api"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["dl"] + elif is_apple_os(self): + self.cpp_info.frameworks = ["CoreServices", "CoreFoundation"] diff --git a/recipes/aaf/all/patches/1.2.0-001-simpler-cmakelists.patch b/recipes/aaf/all/patches/1.2.0-001-simpler-cmakelists.patch new file mode 100644 index 0000000000000..35894ccd93c36 --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-001-simpler-cmakelists.patch @@ -0,0 +1,36 @@ +commit b84775c16e49bf84a021a281fcdb86ac1ecca319 +Author: Martin Delille +Date: Tue Aug 3 11:26:55 2021 +0200 + + Simpler CMakeLists.txt + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e77cb93cc..a7474dc2f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,25 +58,14 @@ set(AAFSDK_OUT_DIR "${AAFSDK_ROOT}/out" CACHE STRING "Path to AAFSDK output dire + + project(AAF-SDK LANGUAGES CXX) + +-enable_testing() +- + include(pdefs) + include(cdefs) + include(common) + include(ss) + +-add_subdirectory(DevUtils) +-add_subdirectory(examples) +-add_subdirectory(examples2) + add_subdirectory(ref-impl) +-add_subdirectory(test) +-add_subdirectory(Utilities) + + add_custom_target(Everything) + add_dependencies(Everything + MakeSDK +- MakeSDKExamples +- MakeSDKExamples2 +- MakeSDKTests +- MakeSDKUtilities + ) diff --git a/recipes/aaf/all/patches/1.2.0-002-link-core-with-find-library.patch b/recipes/aaf/all/patches/1.2.0-002-link-core-with-find-library.patch new file mode 100644 index 0000000000000..4032271f93828 --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-002-link-core-with-find-library.patch @@ -0,0 +1,51 @@ +commit a72ae1b4486769c76bb40683388ee52845c09bfe +Author: Martin Delille +Date: Sat Jul 17 18:22:17 2021 +0200 + + Link CoreFoundation and CoreServices with find_library + +diff --git a/build/cdefs.cmake b/build/cdefs.cmake +index e1b924599..7096b3464 100644 +--- a/build/cdefs.cmake ++++ b/build/cdefs.cmake +@@ -36,10 +36,6 @@ cmake_minimum_required(VERSION 3.0.2) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") + if(APPLE) +- set(LINKER_FLAGS "-framework CoreFoundation -framework CoreServices") +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}") +- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}") +- set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${LINKER_FLAGS}") + elseif(WIN32) + add_definitions( + -D_WIN32 +diff --git a/ref-impl/src/com-api/CMakeLists.txt b/ref-impl/src/com-api/CMakeLists.txt +index d092d9ad2..f0afde40a 100644 +--- a/ref-impl/src/com-api/CMakeLists.txt ++++ b/ref-impl/src/com-api/CMakeLists.txt +@@ -236,11 +236,25 @@ target_include_directories(comapi PRIVATE + ${AAFSDK_ROOT}/ref-impl/src/impl + ) + ++if(APPLE) ++ find_library(CORE_FOUNDATION CoreFoundation) ++ if (NOT CORE_FOUNDATION) ++ message(FATAL_ERROR "CoreFoundation not found") ++ endif() ++ ++ find_library(CORE_SERVICES CoreServices) ++ if (NOT CORE_SERVICES) ++ message(FATAL_ERROR "CoreServices not found") ++ endif() ++endif() ++ + target_link_libraries(comapi PRIVATE + Impl + OM + expat + ss ++ ${CORE_FOUNDATION} ++ ${CORE_SERVICES} + ) + + target_compile_definitions(comapi PUBLIC -DAAFCOAPI) diff --git a/recipes/aaf/all/patches/1.2.0-003-remove-register-keyword.patch b/recipes/aaf/all/patches/1.2.0-003-remove-register-keyword.patch new file mode 100644 index 0000000000000..10819079ff8e5 --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-003-remove-register-keyword.patch @@ -0,0 +1,46 @@ +diff --git a/ref-impl/plugins/AAFPluginUtils.cpp b/ref-impl/plugins/AAFPluginUtils.cpp +index daa02cadf..5c6767ba4 100755 +--- a/ref-impl/plugins/AAFPluginUtils.cpp ++++ b/ref-impl/plugins/AAFPluginUtils.cpp +@@ -96,7 +96,7 @@ aafBool aafIsEqualGUID( const GUID& guid1, const GUID& guid2 ) + void AAFByteSwap16( + aafInt16 * wp) /* IN/OUT -- Byte swap this value */ + { +- register unsigned char *cp = (unsigned char *) wp; ++ unsigned char *cp = (unsigned char *) wp; + int t; + + t = cp[1]; +@@ -122,7 +122,7 @@ void AAFByteSwap16( + void AAFByteSwap32( + aafInt32 *lp) /* IN/OUT -- Byte swap this value */ + { +- register unsigned char *cp = (unsigned char *) lp; ++ unsigned char *cp = (unsigned char *) lp; + int t; + + t = cp[3]; +@@ -151,7 +151,7 @@ void AAFByteSwap32( + void AAFByteSwap64( + aafInt64 *lp) /* IN/OUT -- Byte swap this value */ + { +- register unsigned char *cp = (unsigned char *) lp; ++ unsigned char *cp = (unsigned char *) lp; + int t; + + t = cp[7]; +diff --git a/ref-impl/src/impl/aafTable.cpp b/ref-impl/src/impl/aafTable.cpp +index 8f18b8e6a..16f231403 100644 +--- a/ref-impl/src/impl/aafTable.cpp ++++ b/ref-impl/src/impl/aafTable.cpp +@@ -1068,8 +1068,8 @@ static aafBool cmpSensitive( void *temp1, void *temp2) + + static aafBool cmpInsensitive( void *temp1, void *temp2) + { +- register char *a = (char *)temp1; +- register char *b = (char *)temp2; ++ char *a = (char *)temp1; ++ char *b = (char *)temp2; + + for ( ; (*a != '\0') && (*b != '\0'); a++, b++) + { diff --git a/recipes/aaf/all/patches/1.2.0-004-remove-expat.patch b/recipes/aaf/all/patches/1.2.0-004-remove-expat.patch new file mode 100644 index 0000000000000..e715111f6d78e --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-004-remove-expat.patch @@ -0,0 +1,49 @@ +commit a9b8fe86b3d8659e02653a4a502827a6f779e4ba +Author: Martin Delille +Date: Thu Sep 2 16:38:59 2021 +0200 + + Remove expat + +diff --git a/ref-impl/CMakeLists.txt b/ref-impl/CMakeLists.txt +index b1fe34c52..8f4df30b9 100644 +--- a/ref-impl/CMakeLists.txt ++++ b/ref-impl/CMakeLists.txt +@@ -37,7 +37,6 @@ project(MakeSDK LANGUAGES CXX) + + add_subdirectory(aafiid) + add_subdirectory(aaflib) +-add_subdirectory(expat) + add_subdirectory(libjpeg) + add_subdirectory(plugins) + add_subdirectory(src/com-api) +diff --git a/ref-impl/src/OM/CMakeLists.txt b/ref-impl/src/OM/CMakeLists.txt +index e0c5be195..1210f4d99 100644 +--- a/ref-impl/src/OM/CMakeLists.txt ++++ b/ref-impl/src/OM/CMakeLists.txt +@@ -158,9 +158,13 @@ target_include_directories(OM PRIVATE + # HACK (see OMStructuredStorage.h): Required with OM_USE_SCHEMASOFT_SS and OM_USE_GSF_SS + ${AAFSDK_ROOT}/ss-impl/ref + # AAF-XML stored format support requires the expat library which is bundled with the AAF SDK. +- ${AAFSDK_ROOT}/ref-impl/expat ++ #${AAFSDK_ROOT}/ref-impl/expat + ) + ++find_package(EXPAT REQUIRED MODULE) ++ ++target_link_libraries(OM PUBLIC EXPAT::EXPAT) ++ + target_compile_definitions(OM PUBLIC + XML_STATIC + $<$:OM_DEBUG> +diff --git a/ref-impl/src/com-api/CMakeLists.txt b/ref-impl/src/com-api/CMakeLists.txt +index f0afde40a..e60955f7f 100644 +--- a/ref-impl/src/com-api/CMakeLists.txt ++++ b/ref-impl/src/com-api/CMakeLists.txt +@@ -251,7 +251,6 @@ endif() + target_link_libraries(comapi PRIVATE + Impl + OM +- expat + ss + ${CORE_FOUNDATION} + ${CORE_SERVICES} diff --git a/recipes/aaf/all/patches/1.2.0-005-remove-libjpeg.patch b/recipes/aaf/all/patches/1.2.0-005-remove-libjpeg.patch new file mode 100644 index 0000000000000..231aa193faf47 --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-005-remove-libjpeg.patch @@ -0,0 +1,46 @@ +commit 03d84af50a106955f3af7a8f27b9b2f77fa9ddb7 +Author: Martin Delille +Date: Thu Sep 2 16:45:22 2021 +0200 + + Remove libjpeg + +diff --git a/ref-impl/CMakeLists.txt b/ref-impl/CMakeLists.txt +index 8f4df30b9..cdcf808de 100644 +--- a/ref-impl/CMakeLists.txt ++++ b/ref-impl/CMakeLists.txt +@@ -37,7 +37,6 @@ project(MakeSDK LANGUAGES CXX) + + add_subdirectory(aafiid) + add_subdirectory(aaflib) +-add_subdirectory(libjpeg) + add_subdirectory(plugins) + add_subdirectory(src/com-api) + add_subdirectory(src/impl) +diff --git a/ref-impl/plugins/CMakeLists.txt b/ref-impl/plugins/CMakeLists.txt +index a9ed0163f..0570e0b98 100644 +--- a/ref-impl/plugins/CMakeLists.txt ++++ b/ref-impl/plugins/CMakeLists.txt +@@ -71,6 +71,8 @@ add_library(AAFStandardCodecs SHARED + ../src/OM/utf8.cpp + ) + ++find_package(JPEG REQUIRED) ++ + target_include_directories(AAFStandardCodecs PUBLIC + . + ../include/OM +@@ -79,12 +81,13 @@ target_include_directories(AAFStandardCodecs PUBLIC + ../src/impl + ../src/OM + ../../Utilities/Include ++ ${JPEG_RES_DIRS} + ) + + target_link_libraries(AAFStandardCodecs PRIVATE + AAFIID + AAFLIB +- libjpeg ++ JPEG::JPEG + ) + + if(MSVC) diff --git a/recipes/aaf/all/patches/1.2.0-006-link-libuuid.patch b/recipes/aaf/all/patches/1.2.0-006-link-libuuid.patch new file mode 100644 index 0000000000000..4fd45bf2d6ef2 --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-006-link-libuuid.patch @@ -0,0 +1,25 @@ +--- a/ref-impl/aaflib/CMakeLists.txt ++++ b/ref-impl/aaflib/CMakeLists.txt +@@ -75,7 +75,7 @@ target_compile_definitions(AAFLIB PRIVATE + ) + + if(UNIX AND NOT APPLE) +- target_link_libraries(AAFLIB dl uuid) ++ target_link_libraries(AAFLIB dl) + endif() + + # TODO: find a way to get the actual 'comapi' target output binary name +--- a/ref-impl/src/OM/CMakeLists.txt ++++ b/ref-impl/src/OM/CMakeLists.txt +@@ -165,6 +165,11 @@ find_package(EXPAT REQUIRED MODULE) + + target_link_libraries(OM PUBLIC EXPAT::EXPAT) + ++find_package(libuuid CONFIG) ++if(libuuid_FOUND) ++ target_link_libraries(OM PRIVATE libuuid::libuuid) ++endif() ++ + target_compile_definitions(OM PUBLIC + XML_STATIC + $<$:OM_DEBUG> diff --git a/recipes/aaf/all/patches/1.2.0-007-support-all-generators.patch b/recipes/aaf/all/patches/1.2.0-007-support-all-generators.patch new file mode 100644 index 0000000000000..15eb2c9ffb7a5 --- /dev/null +++ b/recipes/aaf/all/patches/1.2.0-007-support-all-generators.patch @@ -0,0 +1,31 @@ +--- a/build/pdefs.cmake ++++ b/build/pdefs.cmake +@@ -45,26 +45,11 @@ if(NOT ARCH) + message(FATAL_ERROR "'ARCH' must be set.") + endif() + +-if(APPLE) +- if(${CMAKE_GENERATOR} STREQUAL "Xcode") +- set(CONFIGURATION "${CMAKE_CFG_INTDIR}") +- elseif(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") +- set(CONFIGURATION "${CMAKE_BUILD_TYPE}") +- else() +- message(FATAL_ERROR "CMake generator '${CMAKE_GENERATOR}' is not supported by this platform.") +- endif() +-elseif(WIN32) +- string(REGEX REPLACE "Visual Studio ([0-9]+) .*" "\\1" MSVS_VERSION_NUMBER "${CMAKE_GENERATOR}") +- if(NOT ${CMAKE_GENERATOR} STREQUAL "${MSVS_VERSION_NUMBER}") ++if(APPLE OR WIN32 OR UNIX) ++ if(GENERATOR_IS_MULTI_CONFIG) + set(CONFIGURATION "${CMAKE_CFG_INTDIR}") + else() +- message(FATAL_ERROR "CMake generator '${CMAKE_GENERATOR}' is not supported by this platform.") +- endif() +-elseif(UNIX) +- if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") + set(CONFIGURATION "${CMAKE_BUILD_TYPE}") +- else() +- message(FATAL_ERROR "CMake generator '${CMAKE_GENERATOR}' is not supported by this platform.") + endif() + else() + message(FATAL_ERROR "This platform is not supported.") diff --git a/recipes/aaf/all/test_package/CMakeLists.txt b/recipes/aaf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b1e5d9915990 --- /dev/null +++ b/recipes/aaf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(aaf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE aaf::aaf) diff --git a/recipes/aaf/all/test_package/conanfile.py b/recipes/aaf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/aaf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aaf/all/test_package/test_package.cpp b/recipes/aaf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..038a079789844 --- /dev/null +++ b/recipes/aaf/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "AAF.h" +#include "AAFResult.h" + +int main() { + HRESULT hr = AAFLoad(NULL); + + if (AAFRESULT_SUCCEEDED(hr)) { + return 0; + } else { + return -1; + } +} diff --git a/recipes/aaf/all/test_v1_package/CMakeLists.txt b/recipes/aaf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aaf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aaf/all/test_v1_package/conanfile.py b/recipes/aaf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aaf/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/aaf/config.yml b/recipes/aaf/config.yml new file mode 100644 index 0000000000000..b8ea8afb5a353 --- /dev/null +++ b/recipes/aaf/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.0": + folder: "all" diff --git a/recipes/aaplus/all/conandata.yml b/recipes/aaplus/all/conandata.yml new file mode 100644 index 0000000000000..f1c7c0805bfae --- /dev/null +++ b/recipes/aaplus/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.41": + url: "http://www.naughter.com/download/aaplus_v2.41.zip" + sha256: "7aede2802f3542c91eeefa0cdd4419911c7547073c84a6faa4bf31f6b6f172da" +patches: + "2.41": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/aaplus/all/conanfile.py b/recipes/aaplus/all/conanfile.py new file mode 100644 index 0000000000000..22ad9d6440ddc --- /dev/null +++ b/recipes/aaplus/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, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, load, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class Aaplusconan(ConanFile): + name = "aaplus" + description = ( + "AA+ is a C++ implementation for the algorithms as presented in the " + "book \"Astronomical Algorithms\" by Jean Meeus" + ) + license = "Unlicense" + topics = ("aa+", "astronomy", "astronomical-algorithms", "orbital-mechanics") + homepage = "http://www.naughter.com/aa.html" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "9", + "apple-clang": "11", + "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 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) + compiler_version = Version(self.settings.compiler.version) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if self.settings.compiler == "clang" and (compiler_version >= "10" and compiler_version < "12"): + raise ConanInvalidConfiguration( + "AA+ cannot handle clang 10 and 11 due to filesystem being under experimental namespace" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def _extract_license(self): + aaplus_header = load(self, os.path.join(self.source_folder, "AA+.h")) + begin = aaplus_header.find("Copyright") + end = aaplus_header.find("*/", begin) + return aaplus_header[begin:end] + + def package_info(self): + self.cpp_info.libs = ["aaplus"] + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": + self.cpp_info.system_libs.append("stdc++fs") diff --git a/recipes/aaplus/all/patches/0001-fix-cmake.patch b/recipes/aaplus/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..fa9d9680f0b14 --- /dev/null +++ b/recipes/aaplus/all/patches/0001-fix-cmake.patch @@ -0,0 +1,117 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,7 @@ ++cmake_minimum_required(VERSION 3.8) + PROJECT (AstronomicalAlgorithms) + +-cmake_minimum_required(VERSION 3.8) + +-SET(CMAKE_CXX_STANDARD 17) +-SET(CMAKE_CXX_STANDARD_REQUIRED ON) + + #----------------------------------------------------------------------------- + # Output directories. +@@ -133,12 +131,11 @@ SET ( SRCS_LIB + AAVSOP87_SAT.cpp + AAVSOP87_URA.cpp + AAVSOP87_VEN.cpp +- stdafx.cpp + ) + + #----------------------------------------------------------------------------- + SET ( INCS +-# AA+.h ++ AA+.h + AA2DCoordinate.h + AA3DCoordinate.h + AAAberration.h +@@ -149,6 +146,8 @@ SET ( INCS + AADefines.h + AADiameters.h + AADynamicalTime.h ++ AAELP2000.h ++ AAELPMPP02.h + AAEarth.h + AAEaster.h + AAEclipses.h +@@ -157,6 +156,7 @@ SET ( INCS + AAElliptical.h + AAEquationOfTime.h + AAEquinoxesAndSolstices.h ++ AAEquinoxesAndSolstices2.h + AAFK5.h + AAGalileanMoons.h + AAGlobe.h +@@ -170,10 +170,15 @@ SET ( INCS + AAMoon.h + AAMoonIlluminatedFraction.h + AAMoonMaxDeclinations.h ++ AAMoonMaxDeclinations2.h + AAMoonNodes.h ++ AAMoonNodes2.h + AAMoonPerigeeApogee.h ++ AAMoonPerigeeApogee2.h + AAMoonPhases.h ++ AAMoonPhases2.h + AAMoslemCalendar.h ++ AANearParabolic.h + AANeptune.h + AANodes.h + AANutation.h +@@ -192,6 +197,7 @@ SET ( INCS + AAPrecession.h + AARefraction.h + AARiseTransitSet.h ++ AARiseTransitSet2.h + AASaturn.h + AASaturnMoons.h + AASaturnRings.h +@@ -252,7 +258,6 @@ SET ( INCS + AAVSOP87_SAT.h + AAVSOP87_URA.h + AAVSOP87_VEN.h +- stdafx.h + ) + + SET ( SRCS +@@ -262,18 +267,32 @@ SET ( SRCS + #----------------------------------------------------------------------------- + # Executables. + #----------------------------------------------------------------------------- +-ADD_EXECUTABLE(AATest ${SRCS} ) + + #----------------------------------------------------------------------------- + # Libraries. +-ADD_LIBRARY(aaplus-static STATIC ${SRCS_LIB} ${INCS}) +-SET_TARGET_PROPERTIES(aaplus-static PROPERTIES OUTPUT_NAME "aaplus") ++add_library(aaplus ${SRCS_LIB}) ++target_compile_features(aaplus PUBLIC cxx_std_17) ++target_link_libraries(aaplus PRIVATE ++ $<$:ws2_32> ++ $<$,$,9.0>>:stdc++fs> ++) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(aaplus PROPERTIES ++ CXX_VISIBILITY_PRESET hidden ++ VISIBILITY_INLINES_HIDDEN TRUE ++ ) ++ if(WIN32) ++ target_compile_definitions(aaplus PRIVATE "AAPLUS_EXT_CLASS=__declspec(dllexport)") ++ else() ++ target_compile_definitions(aaplus PRIVATE "AAPLUS_EXT_CLASS=__attribute__((visibility(\"default\")))") ++ endif() ++endif() + +-ADD_LIBRARY(aaplus-shared SHARED ${SRCS_LIB} ${INCS}) +-SET_TARGET_PROPERTIES(aaplus-shared PROPERTIES OUTPUT_NAME "aaplus") + +-install(TARGETS aaplus-shared aaplus-static +- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) ++install(TARGETS aaplus ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) ++install(FILES ${INCS} DESTINATION include) + +-TARGET_LINK_LIBRARIES(AATest aaplus-static) + diff --git a/recipes/aaplus/all/test_package/CMakeLists.txt b/recipes/aaplus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..709ce7a5f945a --- /dev/null +++ b/recipes/aaplus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(aaplus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE aaplus::aaplus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/aaplus/all/test_package/conanfile.py b/recipes/aaplus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/aaplus/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/aaplus/all/test_package/test_package.cpp b/recipes/aaplus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f186e11473bc6 --- /dev/null +++ b/recipes/aaplus/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << CAAVSOP87_Mercury::A(2451545.0) << std::endl; + return 0; +} diff --git a/recipes/aaplus/all/test_v1_package/CMakeLists.txt b/recipes/aaplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aaplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aaplus/all/test_v1_package/conanfile.py b/recipes/aaplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aaplus/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/aaplus/config.yml b/recipes/aaplus/config.yml new file mode 100644 index 0000000000000..9e92b3b5d3553 --- /dev/null +++ b/recipes/aaplus/config.yml @@ -0,0 +1,3 @@ +versions: + "2.41": + folder: all diff --git a/recipes/abseil/all/abi_trick/abi.h.in b/recipes/abseil/all/abi_trick/abi.h.in new file mode 100644 index 0000000000000..ea1ab395976cb --- /dev/null +++ b/recipes/abseil/all/abi_trick/abi.h.in @@ -0,0 +1,5 @@ +#cmakedefine01 USE_STD_STRING_VIEW +#cmakedefine01 USE_STD_ANY +#cmakedefine01 USE_STD_OPTIONAL +#cmakedefine01 USE_STD_VARIANT + diff --git a/recipes/abseil/all/abi_trick/conan_abi_test.cmake b/recipes/abseil/all/abi_trick/conan_abi_test.cmake new file mode 100644 index 0000000000000..cebf60c355a8d --- /dev/null +++ b/recipes/abseil/all/abi_trick/conan_abi_test.cmake @@ -0,0 +1,44 @@ +get_target_property(ABSL_INCLUDES absl::config INTERFACE_INCLUDE_DIRECTORIES) +set(CMAKE_REQUIRED_INCLUDES ${ABSL_INCLUDES}) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_STRING_VIEW) && ABSL_HAVE_STD_STRING_VIEW == 1 +int main() {} +#else +#error \"no std::string_view\" +#endif +" +USE_STD_STRING_VIEW) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_ANY) && ABSL_HAVE_STD_ANY == 1 +int main() {} +#else +#error \"no std::any\" +#endif +" +USE_STD_ANY) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_OPTIONAL) && ABSL_HAVE_STD_OPTIONAL == 1 +int main() {} +#else +#error \"no std::optional\" +#endif +" +USE_STD_OPTIONAL) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_VARIANT) && ABSL_HAVE_STD_VARIANT == 1 +int main() {} +#else +#error \"no std::variant\" +#endif +" +USE_STD_VARIANT) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/abi.h.in ${PROJECT_BINARY_DIR}/abi.h) diff --git a/recipes/abseil/all/conandata.yml b/recipes/abseil/all/conandata.yml new file mode 100644 index 0000000000000..26d7ab5e3cd64 --- /dev/null +++ b/recipes/abseil/all/conandata.yml @@ -0,0 +1,95 @@ +sources: + "20230125.3": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.3.tar.gz" + sha256: "5366D7E7FA7BA0D915014D387B66D0D002C03236448E1BA9EF98122C13B35C36" + "20230125.2": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.2.tar.gz" + sha256: "9a2b5752d7bfade0bdeee2701de17c9480620f8b237e1964c1b9967c75374906" + "20230125.1": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.1.tar.gz" + sha256: "81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145" + "20230125.0": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.0.tar.gz" + sha256: "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21" + "20220623.1": + url: "https://github.com/abseil/abseil-cpp/archive/20220623.1.tar.gz" + sha256: "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8" + "20220623.0": + url: "https://github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz" + sha256: "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602" + "20211102.0": + url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz" + sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4" + "20210324.2": + url: "https://github.com/abseil/abseil-cpp/archive/20210324.2.tar.gz" + sha256: "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f" + "20200923.3": + url: "https://github.com/abseil/abseil-cpp/archive/20200923.3.tar.gz" + sha256: "ebe2ad1480d27383e4bf4211e2ca2ef312d5e6a09eba869fd2e8a5c5d553ded2" + "20200225.3": + url: "https://github.com/abseil/abseil-cpp/archive/20200225.3.tar.gz" + sha256: "66d4d009050f39c104b03f79bdca9d930c4964016f74bf24867a43fbdbd00d23" +patches: + "20230125.3": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20230125.2": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20230125.1": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20230125.0": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20220623.1": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0005-has-unique-object-representations.patch" + patch_description: "Workaround bug in GCC 7.2" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" + patch_type: "portability" + "20220623.0": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0005-has-unique-object-representations.patch" + patch_description: "Workaround bug in GCC 7.2" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" + patch_type: "portability" + "20211102.0": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20210324.2": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0004-cpp-standard-20210324.patch" + patch_description: "define absl cpp standard(C++11)" + patch_type: "portability" + "20200923.3": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0004-cpp-standard-20200923.patch" + patch_description: "define absl cpp standard(C++11)" + patch_type: "portability" + "20200225.3": + - patch_file: "patches/0001-cmake-install.patch" + patch_description: "make ABSL_ENABLE_INSTALL option" + patch_type: "conan" + - patch_file: "patches/0002-missing-numeric_limits.h.patch" + patch_description: "include limits.h" + patch_type: "portability" + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0004-cpp-standard-20200225.patch" + patch_description: "define absl cpp standard(C++11)" + patch_type: "portability" diff --git a/recipes/abseil/all/conanfile.py b/recipes/abseil/all/conanfile.py new file mode 100644 index 0000000000000..1705dce38f64f --- /dev/null +++ b/recipes/abseil/all/conanfile.py @@ -0,0 +1,267 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, load, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import json +import os +import re +import textwrap + +required_conan_version = ">=1.53.0" + +class AbseilConan(ConanFile): + name = "abseil" + description = "Abseil Common Libraries (C++) from Google" + topics = ("algorithm", "container", "google", "common", "utility") + homepage = "https://github.com/abseil/abseil-cpp" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + short_paths = True + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "20230125.0" else "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + copy(self, "abi_trick/*", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.shared and is_msvc(self): + # 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)") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ABSL_ENABLE_INSTALL"] = True + tc.variables["ABSL_PROPAGATE_CXX_STD"] = True + tc.variables["BUILD_TESTING"] = False + # We force CMP0067 policy to NEW for our abi trick in _patch_sources() + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0067"] = "NEW" + if is_msvc(self): + # see https://github.com/abseil/abseil-cpp/issues/649 + tc.preprocessor_definitions["_HAS_DEPRECATED_RESULT_OF"] = 1 + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # In case of cross-build, set CMAKE_SYSTEM_PROCESSOR if not set by toolchain or user + if cross_building(self): + toolchain_file = os.path.join(self.generators_folder, "conan_toolchain.cmake") + cmake_system_processor_block = textwrap.dedent("""\ + if(NOT CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR {}) + endif() + """.format(str(self.settings.arch))) + save(self, toolchain_file, cmake_system_processor_block, append=True) + + # Trick to capture ABI + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + abi_trick_block = textwrap.dedent("""\ + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../abi_trick") + include(conan_abi_test) + """) + save(self, cmakelists, abi_trick_block, append=True) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + abi_file = _ABIFile(self, os.path.join(self.build_folder, "abi.h")) + abi_file.replace_in_options_file(os.path.join(self.source_folder, "absl", "base", "options.h")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # Load components hierarchy before removing CMake files generated by abseil installation + cmake_folder = os.path.join(self.package_folder, "lib", "cmake") + absl_targets_file = os.path.join(cmake_folder, "absl", "abslTargets.cmake") + components = self._load_components_from_cmake_target_file(absl_targets_file) + rmdir(self, cmake_folder) + + # Create a json helper file in order to populate package_info() at consume time + self._create_components_file(self._components_helper_filepath, components) + + # Create a build-module that will propagate the required cxx_std to consumers of this recipe's targets + # TODO: Revisit with feedback from https://github.com/conan-io/conan/issues/10281 + self._create_cxx_std_module_file(self._cxx_std_module_filepath, components) + + def _load_components_from_cmake_target_file(self, absl_target_file_path): + components = {} + + abs_target_content = load(self, absl_target_file_path) + + # Replace the line endings to support building with MSys2 on Windows + abs_target_content = abs_target_content.replace("\r\n", "\n") + + cmake_functions = re.findall(r"(?Padd_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", abs_target_content) + for (cmake_function_name, cmake_function_args) in cmake_functions: + cmake_function_args = re.split(r"[\s|\n]+", cmake_function_args, maxsplit=2) + + cmake_imported_target_name = cmake_function_args[0] + cmake_target_nonamespace = cmake_imported_target_name.replace("absl::", "") + potential_lib_name = "absl_" + cmake_target_nonamespace + + components.setdefault(potential_lib_name, {"cmake_target": cmake_target_nonamespace}) + + if cmake_function_name == "add_library": + cmake_imported_target_type = cmake_function_args[1] + if cmake_imported_target_type in ["STATIC", "SHARED"]: + components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else [] + elif cmake_function_name == "set_target_properties": + target_properties = re.findall(r"(?PINTERFACE_COMPILE_DEFINITIONS|INTERFACE_INCLUDE_DIRECTORIES|INTERFACE_LINK_LIBRARIES)[\n|\s]+(?P.+)", cmake_function_args[2]) + for target_property in target_properties: + property_type = target_property[0] + if property_type == "INTERFACE_LINK_LIBRARIES": + values_list = target_property[1].replace('"', "").split(";") + for dependency in values_list: + if dependency.startswith("absl::"): # abseil targets + components[potential_lib_name].setdefault("requires", []).append(dependency.replace("absl::", "absl_")) + else: # system libs or frameworks + if self.settings.os in ["Linux", "FreeBSD"]: + if dependency == "Threads::Threads": + components[potential_lib_name].setdefault("system_libs", []).append("pthread") + elif "-lm" in dependency: + components[potential_lib_name].setdefault("system_libs", []).append("m") + elif "-lrt" in dependency: + components[potential_lib_name].setdefault("system_libs", []).append("rt") + elif self.settings.os == "Windows": + for system_lib in ["bcrypt", "advapi32", "dbghelp"]: + if system_lib in dependency: + components[potential_lib_name].setdefault("system_libs", []).append(system_lib) + elif is_apple_os(self): + for framework in ["CoreFoundation"]: + if framework in dependency: + components[potential_lib_name].setdefault("frameworks", []).append(framework) + elif property_type == "INTERFACE_COMPILE_DEFINITIONS": + values_list = target_property[1].replace('"', "").split(";") + for definition in values_list: + components[potential_lib_name].setdefault("defines", []).append(definition) + + return components + + def _create_components_file(self, output_file, components): + content = json.dumps(components, indent=4) + save(self, output_file, content) + + @property + def _components_helper_filepath(self): + return os.path.join(self.package_folder, "lib", "components.json") + + def _create_cxx_std_module_file(self, output_file, components): + content = "" + cxx_std_required = _ABIFile(self, os.path.join(self.build_folder, "abi.h")).cxx_std() + for _, values in components.items(): + cmake_target = values["cmake_target"] + content += f"target_compile_features(absl::{cmake_target} INTERFACE cxx_std_{cxx_std_required})\n" + save(self, output_file, content) + + @property + def _cxx_std_module_filepath(self): + return os.path.join(self.package_folder, "lib", "cmake", "conan_trick", "cxx_std.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "absl") + + components_json_file = load(self, self._components_helper_filepath) + abseil_components = json.loads(components_json_file) + for pkgconfig_name, values in abseil_components.items(): + cmake_target = values["cmake_target"] + self.cpp_info.components[pkgconfig_name].set_property("cmake_target_name", "absl::{}".format(cmake_target)) + self.cpp_info.components[pkgconfig_name].set_property("pkg_config_name", pkgconfig_name) + self.cpp_info.components[pkgconfig_name].libs = values.get("libs", []) + self.cpp_info.components[pkgconfig_name].defines = values.get("defines", []) + self.cpp_info.components[pkgconfig_name].system_libs = values.get("system_libs", []) + self.cpp_info.components[pkgconfig_name].frameworks = values.get("frameworks", []) + self.cpp_info.components[pkgconfig_name].requires = values.get("requires", []) + if is_msvc(self) and self.settings.compiler.get_safe("cppstd") == "20": + self.cpp_info.components[pkgconfig_name].defines.extend([ + "_HAS_DEPRECATED_RESULT_OF", + "_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING", + ]) + + self.cpp_info.components[pkgconfig_name].names["cmake_find_package"] = cmake_target + self.cpp_info.components[pkgconfig_name].names["cmake_find_package_multi"] = cmake_target + + self.cpp_info.names["cmake_find_package"] = "absl" + self.cpp_info.names["cmake_find_package_multi"] = "absl" + + self.cpp_info.set_property("cmake_build_modules", [self._cxx_std_module_filepath]) + self.cpp_info.components["absl_config"].build_modules["cmake_find_package"] = [self._cxx_std_module_filepath] + self.cpp_info.components["absl_config"].build_modules["cmake_find_package_multi"] = [self._cxx_std_module_filepath] + + +class _ABIFile: + abi = {} + + def __init__(self, conanfile, filepath): + self.conanfile = conanfile + abi_h = load(self.conanfile, filepath) + for line in abi_h.splitlines(): + if line.startswith("#define"): + tokens = line.split() + if len(tokens) == 3: + self.abi[tokens[1]] = tokens[2] + + def replace_in_options_file(self, options_filepath): + for name, value in self.abi.items(): + replace_in_file(self.conanfile, options_filepath, + "#define ABSL_OPTION_{} 2".format(name), + "#define ABSL_OPTION_{} {}".format(name, value)) + + def cxx_std(self): + return 17 if any([v == "1" for k, v in self.abi.items()]) else 11 diff --git a/recipes/abseil/all/patches/0001-cmake-install.patch b/recipes/abseil/all/patches/0001-cmake-install.patch new file mode 100644 index 0000000000000..a3b8fb54c4699 --- /dev/null +++ b/recipes/abseil/all/patches/0001-cmake-install.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -41,9 +41,9 @@ + # when absl is included as subproject (i.e. using add_subdirectory(abseil-cpp)) + # in the source tree of a project that uses it, install rules are disabled. + if(NOT "^${CMAKE_SOURCE_DIR}$" STREQUAL "^${PROJECT_SOURCE_DIR}$") +- set(ABSL_ENABLE_INSTALL FALSE) ++ option(ABSL_ENABLE_INSTALL "Enable install rule" OFF) + else() +- set(ABSL_ENABLE_INSTALL TRUE) ++ option(ABSL_ENABLE_INSTALL "Enable install rule" ON) + endif() + + list(APPEND CMAKE_MODULE_PATH diff --git a/recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch b/recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch new file mode 100644 index 0000000000000..b21d60b80ba1b --- /dev/null +++ b/recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch @@ -0,0 +1,11 @@ +--- absl/synchronization/internal/graphcycles.cc ++++ absl/synchronization/internal/graphcycles.cc +@@ -34,7 +34,7 @@ + #ifndef ABSL_LOW_LEVEL_ALLOC_MISSING + + #include "absl/synchronization/internal/graphcycles.h" +- ++#include + #include + #include + #include "absl/base/internal/hide_ptr.h" diff --git a/recipes/abseil/all/patches/0003-absl-string-libm.patch b/recipes/abseil/all/patches/0003-absl-string-libm.patch new file mode 100644 index 0000000000000..8c69d423c871f --- /dev/null +++ b/recipes/abseil/all/patches/0003-absl-string-libm.patch @@ -0,0 +1,15 @@ +--- a/absl/strings/CMakeLists.txt ++++ b/absl/strings/CMakeLists.txt +@@ -14,9 +14,12 @@ + # limitations under the License. + # + ++find_library(LIBM m) + absl_cc_library( + NAME + strings ++ LINKOPTS ++ $<$:-lm> + HDRS + "ascii.h" + "charconv.h" diff --git a/recipes/abseil/all/patches/0004-cpp-standard-20200225.patch b/recipes/abseil/all/patches/0004-cpp-standard-20200225.patch new file mode 100644 index 0000000000000..00042089d1476 --- /dev/null +++ b/recipes/abseil/all/patches/0004-cpp-standard-20200225.patch @@ -0,0 +1,15 @@ +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -204,8 +204,12 @@ function(absl_cc_library) + endif() + + # INTERFACE libraries can't have the CXX_STANDARD property set ++ if(ABSL_PROPAGATE_CXX_STD) ++ target_compile_features(${_NAME} PUBLIC cxx_std_11) ++ else() + set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) + set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) ++ endif() + + # When being installed, we lose the absl_ prefix. We want to put it back + # to have properly named lib files. This is a no-op when we are not being diff --git a/recipes/abseil/all/patches/0004-cpp-standard-20200923.patch b/recipes/abseil/all/patches/0004-cpp-standard-20200923.patch new file mode 100644 index 0000000000000..cabbdbc8eaa57 --- /dev/null +++ b/recipes/abseil/all/patches/0004-cpp-standard-20200923.patch @@ -0,0 +1,15 @@ +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -206,8 +206,12 @@ function(absl_cc_library) + endif() + + # INTERFACE libraries can't have the CXX_STANDARD property set ++ if(ABSL_PROPAGATE_CXX_STD) ++ target_compile_features(${_NAME} PUBLIC cxx_std_11) ++ else() + set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) + set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) ++ endif() + + # When being installed, we lose the absl_ prefix. We want to put it back + # to have properly named lib files. This is a no-op when we are not being diff --git a/recipes/abseil/all/patches/0004-cpp-standard-20210324.patch b/recipes/abseil/all/patches/0004-cpp-standard-20210324.patch new file mode 100644 index 0000000000000..fab934c4ee8b8 --- /dev/null +++ b/recipes/abseil/all/patches/0004-cpp-standard-20210324.patch @@ -0,0 +1,15 @@ +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -254,8 +254,12 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") + endif() + + # INTERFACE libraries can't have the CXX_STANDARD property set ++ if(ABSL_PROPAGATE_CXX_STD) ++ target_compile_features(${_NAME} PUBLIC cxx_std_11) ++ else() + set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) + set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) ++ endif() + + # When being installed, we lose the absl_ prefix. We want to put it back + # to have properly named lib files. This is a no-op when we are not being diff --git a/recipes/abseil/all/patches/0005-has-unique-object-representations.patch b/recipes/abseil/all/patches/0005-has-unique-object-representations.patch new file mode 100644 index 0000000000000..2a8dffe536382 --- /dev/null +++ b/recipes/abseil/all/patches/0005-has-unique-object-representations.patch @@ -0,0 +1,11 @@ +--- a/absl/hash/internal/hash.h 2022-06-24 06:22:47.000000000 +1200 ++++ b/absl/hash/internal/hash.h 2022-07-28 17:00:02.241173356 +1200 +@@ -444,7 +444,7 @@ + // On other platforms, we assume that pointers-to-members do not have + // padding. + #ifdef __cpp_lib_has_unique_object_representations +- static_assert(std::has_unique_object_representations_v); ++ static_assert(std::has_unique_object_representations::value); + #endif // __cpp_lib_has_unique_object_representations + return n; + #endif diff --git a/recipes/abseil/all/test_package/CMakeLists.txt b/recipes/abseil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee593a507a47a --- /dev/null +++ b/recipes/abseil/all/test_package/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(absl REQUIRED CONFIG) + +# Test components +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) +# Abseil now requires at least C++14 since 20230125.0 +if(absl_VERSION VERSION_LESS "20230125.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() + +if(cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_14 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_14 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_14 PRIVATE cxx_std_14) +endif() +if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_17 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_17 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_17 PRIVATE cxx_std_17) +endif() +# old abseil used std::result_of (which was removed in C++20) https://github.com/abseil/abseil-cpp/issues/649 +if(CXX20_SUPPORTED) + if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_20 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_20 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_20 PRIVATE cxx_std_20) + endif() + if(cxx_std_23 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_23 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_23 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_23 PRIVATE cxx_std_23) + endif() +endif() + +# Test also (unofficial) global target +add_executable(${PROJECT_NAME}_global test_package.cpp) +if(TARGET abseil::abseil) + target_link_libraries(${PROJECT_NAME}_global PRIVATE abseil::abseil) +else() + target_link_libraries(${PROJECT_NAME}_global PRIVATE absl::absl) +endif() +# Abseil now requires at least C++14 since 20230125.0 +if(absl_VERSION VERSION_LESS "20230125.0") + target_compile_features(${PROJECT_NAME}_global PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME}_global PRIVATE cxx_std_14) +endif() diff --git a/recipes/abseil/all/test_package/conanfile.py b/recipes/abseil/all/test_package/conanfile.py new file mode 100644 index 0000000000000..eab050e1bc9ef --- /dev/null +++ b/recipes/abseil/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CXX20_SUPPORTED"] = Version(self.dependencies["abseil"].ref.version) > "20210324.2" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} -s", env="conanrun") + bin_global_path = os.path.join(self.cpp.build.bindirs[0], "test_package_global") + self.run(f"{bin_global_path} -s", env="conanrun") diff --git a/recipes/abseil/all/test_package/test_package.cpp b/recipes/abseil/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b3813a81e4e81 --- /dev/null +++ b/recipes/abseil/all/test_package/test_package.cpp @@ -0,0 +1,56 @@ +#include +#include +#include +#include + +#include "absl/strings/str_cat.h" +#include "absl/strings/str_split.h" +#include "absl/container/flat_hash_map.h" +#include "absl/container/flat_hash_set.h" +#include "absl/numeric/int128.h" +#include "absl/time/time.h" +#include "absl/types/variant.h" + +int main() +{ + absl::flat_hash_set set1; + absl::flat_hash_map map1; + absl::flat_hash_set set2 = { + {"huey"}, + {"dewey"}, + {"louie"}, + }; + absl::flat_hash_map map2 = { + {1, "huey"}, + {2, "dewey"}, + {3, "louie"}, + }; + absl::flat_hash_set set3(set2); + absl::flat_hash_map map3(map2); + + absl::flat_hash_set set4; + set4 = set3; + absl::flat_hash_map map4; + map4 = map3; + + absl::flat_hash_set set5(std::move(set4)); + absl::flat_hash_map map5(std::move(map4)); + absl::flat_hash_set set6; + set6 = std::move(set5); + absl::flat_hash_map map6; + map6 = std::move(map5); + + const absl::uint128 big = absl::Uint128Max(); + std::cout << absl::StrCat("Arg ", "foo", "\n"); + std::vector v = absl::StrSplit("a,b,,c", ','); + + absl::Time t1 = absl::Now(); + absl::Time t2 = absl::Time(); + absl::Time t3 = absl::UnixEpoch(); + + absl::variant v1 = absl::variant(); + absl::bad_variant_access e1; + + std::string const year = absl::FormatTime("%Y", absl::Now(), absl::UTCTimeZone()); + std::cout << "year " << year << std::endl; +} diff --git a/recipes/abseil/all/test_v1_package/CMakeLists.txt b/recipes/abseil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/abseil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/abseil/all/test_v1_package/conanfile.py b/recipes/abseil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5c87f554bbab2 --- /dev/null +++ b/recipes/abseil/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["CXX20_SUPPORTED"] = tools.Version(self.deps_cpp_info["abseil"].version) > "20210324.2" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} -s", run_environment=True) + bin_global_path = os.path.join("bin", "test_package_global") + self.run(f"{bin_global_path} -s", run_environment=True) diff --git a/recipes/abseil/config.yml b/recipes/abseil/config.yml new file mode 100644 index 0000000000000..b44abb830b77f --- /dev/null +++ b/recipes/abseil/config.yml @@ -0,0 +1,21 @@ +versions: + "20230125.3": + folder: all + "20230125.2": + folder: all + "20230125.1": + folder: all + "20230125.0": + folder: all + "20220623.1": + folder: all + "20220623.0": + folder: all + "20211102.0": + folder: all + "20210324.2": + folder: all + "20200923.3": + folder: all + "20200225.3": + folder: all diff --git a/recipes/absent/all/conandata.yml b/recipes/absent/all/conandata.yml new file mode 100644 index 0000000000000..474b5d79c89ae --- /dev/null +++ b/recipes/absent/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.3.1": + url: "https://github.com/rvarago/absent/archive/0.3.1.tar.gz" + sha256: "fe0a96303c6438f1095273b093e56c8f10a3b79dea86676b59aec94e6ed89224" + "0.3.0": + url: "https://github.com/rvarago/absent/archive/0.3.0.tar.gz" + sha256: "ac6d1b9cc2e57318eab1252bf5aa13c7bac25e316285a687c61dfdfa71e71e8d" + "0.2.0": + url: "https://github.com/rvarago/absent/archive/0.2.0.tar.gz" + sha256: "f3a587f1a5bdd74e4363378201e56c362830a62f0f92f1872038e71b7a1462c7" + "0.1.0": + url: "https://github.com/rvarago/absent/archive/0.1.0.tar.gz" + sha256: "32be167191d695f7663cd6043b226c83798aeb617504ad6c82ddf3b3fdb08498" + "0.0.1": + url: "https://github.com/rvarago/absent/archive/0.0.1.tar.gz" + sha256: "4fa1e40cc06c2147f5308e63f51a8785fcc41515b6a6a7c280459d005f1c0aeb" diff --git a/recipes/absent/all/conanfile.py b/recipes/absent/all/conanfile.py new file mode 100644 index 0000000000000..bdc5f5e18836b --- /dev/null +++ b/recipes/absent/all/conanfile.py @@ -0,0 +1,86 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.43.0" + + +class AbsentConan(ConanFile): + name = "absent" + description = ( + "A small C++17 library meant to simplify the composition of nullable " + "types in a generic, type-safe, and declarative way" + ) + homepage = "https://github.com/rvarago/absent" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + topics = ("nullable-types", "composition", "monadic-interface", "declarative-programming") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15.7", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + "{} requires C++17, which your compiler does not support.".format(self.name) + ) + + def package_id(self): + self.info.header_only() + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["BUILD_TESTS"] = "OFF" + cmake.configure(source_folder=self._source_subfolder) + return cmake + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "absent") + self.cpp_info.set_property("cmake_target_name", "rvarago::absent") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["absentlib"].bindirs = [] + self.cpp_info.components["absentlib"].frameworkdirs = [] + self.cpp_info.components["absentlib"].libdirs = [] + self.cpp_info.components["absentlib"].resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "absent" + self.cpp_info.filenames["cmake_find_package_multi"] = "absent" + self.cpp_info.names["cmake_find_package"] = "rvarago" + self.cpp_info.names["cmake_find_package_multi"] = "rvarago" + self.cpp_info.components["absentlib"].names["cmake_find_package"] = "absent" + self.cpp_info.components["absentlib"].names["cmake_find_package_multi"] = "absent" + self.cpp_info.components["absentlib"].set_property("cmake_target_name", "rvarago::absent") diff --git a/recipes/absent/all/test_package/CMakeLists.txt b/recipes/absent/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fe998526125cb --- /dev/null +++ b/recipes/absent/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(absent REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_link_libraries(${PROJECT_NAME} rvarago::absent) diff --git a/recipes/absent/all/test_package/conanfile.py b/recipes/absent/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/absent/all/test_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/absent/all/test_package/test_package.cpp b/recipes/absent/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..580ec7457b272 --- /dev/null +++ b/recipes/absent/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +using namespace rvarago::absent; + +int main() { + constexpr auto maybe_an_approximated_answer = std::optional{41}; + constexpr auto exact_answer = (maybe_an_approximated_answer | [](auto v) { return v + 1; }).value(); + static_assert(exact_answer == 42); + std::cout << "rvarago::absent works! The exact answer is: " << exact_answer << '\n'; + return 0; +} diff --git a/recipes/absent/config.yml b/recipes/absent/config.yml new file mode 100644 index 0000000000000..4c4c018d5454b --- /dev/null +++ b/recipes/absent/config.yml @@ -0,0 +1,11 @@ +versions: + "0.3.1": + folder: all + "0.3.0": + folder: all + "0.2.0": + folder: all + "0.1.0": + folder: all + "0.0.1": + folder: all diff --git a/recipes/acado/all/CMakeLists.txt b/recipes/acado/all/CMakeLists.txt new file mode 100644 index 0000000000000..bdffdd1faa9c7 --- /dev/null +++ b/recipes/acado/all/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.10) +project(cmake_wrapper) + +set(CMAKE_CXX_STANDARD 11) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cmake") + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/acado/all/cmake/qpoases.cmake b/recipes/acado/all/cmake/qpoases.cmake new file mode 100644 index 0000000000000..d944291553890 --- /dev/null +++ b/recipes/acado/all/cmake/qpoases.cmake @@ -0,0 +1,17 @@ +SET( ACADO_QPOASES_EMBEDDED_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Bounds.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/CyclingManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/MessageHandling.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/QProblem.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Utils.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Constraints.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Indexlist.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/QProblemB.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/SubjectTo.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/EXTRAS/SolutionAnalysis.cpp +) +SET( ACADO_QPOASES_EMBEDDED_INC_DIRS + ${CMAKE_CURRENT_LIST_DIR}/qpoases/ + ${CMAKE_CURRENT_LIST_DIR}/qpoases/INCLUDE + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC +) diff --git a/recipes/acado/all/conandata.yml b/recipes/acado/all/conandata.yml new file mode 100644 index 0000000000000..b0f501df26562 --- /dev/null +++ b/recipes/acado/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.2-beta": + url: "https://github.com/acado/acado/archive/v1.2.2beta.tar.gz" + sha256: "cf0779e64dd5d20989e97340c04ecccf542fe8d993c96b53e5c465693cb354b7" +patches: + "1.2.2-beta": + - base_path: "source_subfolder" + patch_file: "patches/0001-binding-temp-object.patch" + - base_path: "source_subfolder" + patch_file: "patches/0002-read-template-path-from-env.patch" diff --git a/recipes/acado/all/conanfile.py b/recipes/acado/all/conanfile.py new file mode 100644 index 0000000000000..d9e09e4b5548b --- /dev/null +++ b/recipes/acado/all/conanfile.py @@ -0,0 +1,130 @@ +import os +import glob + +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class AcadoConan(ConanFile): + name = "acado" + description = "ACADO Toolkit is a software environment and algorithm collection for automatic control and dynamic optimization." + license = "LGPL-3.0" + topics = ("conan", "acado", "control", "optimization", "mpc") + homepage = "https://github.com/acado/acado" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = ["CMakeLists.txt", "cmake/qpoases.cmake", "patches/**"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "codegen_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "codegen_only": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob.glob("acado-*/")[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + self._cmake.definitions["ACADO_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["ACADO_BUILD_STATIC"] = not self.options.shared + + self._cmake.definitions["ACADO_WITH_EXAMPLES"] = False + self._cmake.definitions["ACADO_WITH_TESTING"] = False + self._cmake.definitions["ACADO_DEVELOPER"] = False + self._cmake.definitions["ACADO_INTERNAL"] = False + self._cmake.definitions["ACADO_BUILD_CGT_ONLY"] = self.options.codegen_only + + # ACADO logs 170.000 lines of warnings, so we disable them + self._cmake.definitions["CMAKE_C_FLAGS"] = "-w" + self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-w" + + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + @property + def _qpoases_sources(self): + return os.path.join("lib", "cmake", "qpoases") + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + self.copy("*", src="lib", dst="lib") + self.copy("qpoases.cmake", src="cmake", dst="lib/cmake") + qpoases_sources_from = os.path.join(self.package_folder, "share", "acado", "external_packages", "qpoases") + self.copy("*", src=qpoases_sources_from, dst=self._qpoases_sources) + + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.remove_files_by_mask(self.package_folder, "*.pdb") + + def package_info(self): + acado_template_paths = os.path.join(self.package_folder, "include", "acado", "code_generation", "templates") + self.output.info("Setting ACADO_TEMPLATE_PATHS environment variable: {}".format(acado_template_paths)) + self.env_info.ACADO_TEMPLATE_PATHS = acado_template_paths + + if self.options.shared: + self.cpp_info.libs = ["acado_toolkit_s", "acado_casadi"] + else: + self.cpp_info.libs = ["acado_toolkit", "acado_casadi"] + + self.cpp_info.names["cmake_find_package"] = "ACADO" + self.cpp_info.names["cmake_find_package_multi"] = "ACADO" + + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.build_modules.append(os.path.join("lib", "cmake", "qpoases.cmake")) + + self.cpp_info.includedirs.append(os.path.join("include", "acado")) + self.cpp_info.includedirs.append(self._qpoases_sources) + self.cpp_info.includedirs.append(os.path.join(self._qpoases_sources, "INCLUDE")) + self.cpp_info.includedirs.append(os.path.join(self._qpoases_sources, "SRC")) + + def validate(self): + if self.settings.compiler == "Visual Studio" and self.options.shared: + # https://github.com/acado/acado/blob/b4e28f3131f79cadfd1a001e9fff061f361d3a0f/CMakeLists.txt#L77-L80 + raise ConanInvalidConfiguration("Acado does not support shared builds on Windows.") + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("apple-clang not supported") + if self.settings.compiler == "clang" and self.settings.compiler.version == "9": + raise ConanInvalidConfiguration("acado can not be built by Clang 9.") + + # acado requires libstdc++11 for shared builds + # https://github.com/conan-io/conan-center-index/pull/3967#issuecomment-752985640 + if self.options.shared and self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration("libstdc++11 required") + if self.options.shared and self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration("libstdc++11 required") diff --git a/recipes/acado/all/patches/0001-binding-temp-object.patch b/recipes/acado/all/patches/0001-binding-temp-object.patch new file mode 100644 index 0000000000000..04fdbd3b685aa --- /dev/null +++ b/recipes/acado/all/patches/0001-binding-temp-object.patch @@ -0,0 +1,19 @@ +diff --git a/acado/code_generation/export_function_declaration.cpp b/acado/code_generation/export_function_declaration.cpp +index d6450b50..46a3269f 100644 +--- a/acado/code_generation/export_function_declaration.cpp ++++ b/acado/code_generation/export_function_declaration.cpp +@@ -36,12 +36,12 @@ + + BEGIN_NAMESPACE_ACADO + +- ++const ExportFunction& _ff = ExportFunction(); + // + // PUBLIC MEMBER FUNCTIONS: + // + +-ExportFunctionDeclaration::ExportFunctionDeclaration( ) : ExportStatement( ), f( ExportFunction() ) ++ExportFunctionDeclaration::ExportFunctionDeclaration( ) : ExportStatement( ), f( _ff ) + {} + + diff --git a/recipes/acado/all/patches/0002-read-template-path-from-env.patch b/recipes/acado/all/patches/0002-read-template-path-from-env.patch new file mode 100644 index 0000000000000..20202fd1dd0cc --- /dev/null +++ b/recipes/acado/all/patches/0002-read-template-path-from-env.patch @@ -0,0 +1,25 @@ +diff --git a/acado/code_generation/export_templated_file.cpp b/acado/code_generation/export_templated_file.cpp +index 76ec47a2..937a9c7b 100644 +--- a/acado/code_generation/export_templated_file.cpp ++++ b/acado/code_generation/export_templated_file.cpp +@@ -34,6 +34,8 @@ + #include + #include + ++#include ++ + using namespace std; + + BEGIN_NAMESPACE_ACADO +@@ -66,7 +68,10 @@ returnValue ExportTemplatedFile::setup( const std::string& _templateName, + { + ExportFile::setup( _fileName, _commonHeaderName, _realString, _intString, _precision, _commentString ); + +- folders = TEMPLATE_PATHS; ++ if(const char* template_paths = std::getenv("ACADO_TEMPLATE_PATHS")) ++ { ++ folders = template_paths; ++ } + templateName = _templateName; + + return SUCCESSFUL_RETURN; diff --git a/recipes/acado/all/test_package/CMakeLists.txt b/recipes/acado/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..29d9de3546c79 --- /dev/null +++ b/recipes/acado/all/test_package/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package CXX C) + +set(CMAKE_CXX_STANDARD 11) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(ACADO REQUIRED) + +add_executable(codegen codegen.cpp) +target_link_libraries(codegen PRIVATE ACADO::ACADO) + +set(CODEGEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_code) + +set(codegen_GENERATED_FILES + ${CODEGEN_DIR}/acado_common.h + ${CODEGEN_DIR}/acado_solver.c + ${CODEGEN_DIR}/acado_integrator.c + ${CODEGEN_DIR}/acado_qpoases_interface.hpp + ${CODEGEN_DIR}/acado_qpoases_interface.cpp + ${CODEGEN_DIR}/acado_auxiliary_functions.h + ${CODEGEN_DIR}/acado_auxiliary_functions.c +) + +add_custom_command( + OUTPUT ${codegen_GENERATED_FILES} + COMMAND codegen ${CODEGEN_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS codegen) + +add_library(mpc_codegen STATIC ${codegen_GENERATED_FILES} ${ACADO_QPOASES_EMBEDDED_SOURCES}) +target_include_directories(mpc_codegen + SYSTEM PUBLIC + ${CODEGEN_DIR} + ${ACADO_QPOASES_EMBEDDED_INC_DIRS}) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE mpc_codegen) diff --git a/recipes/acado/all/test_package/codegen.cpp b/recipes/acado/all/test_package/codegen.cpp new file mode 100644 index 0000000000000..2e3b2838a97fc --- /dev/null +++ b/recipes/acado/all/test_package/codegen.cpp @@ -0,0 +1,72 @@ +#include +#include + +USING_NAMESPACE_ACADO + +int main(int argc, char *argv[]) +{ + const double dt = 0.1; + const int N = 10; + const int Ni = 1; + + DifferentialState pos_x; + DifferentialState pos_y; + DifferentialState velocity; + DifferentialState heading; + + Control acceleration; + Control steering_angle; + + DifferentialEquation kinematics; + kinematics << dot(pos_x) == velocity * cos(heading); + kinematics << dot(pos_y) == velocity * sin(heading); + kinematics << dot(velocity) == acceleration; + kinematics << dot(heading) == velocity * steering_angle; + + OCP control_problem(0.0, N * dt, N); + + control_problem.subjectTo(kinematics); + + control_problem.subjectTo(-1.0 <= heading <= 1.0); + control_problem.subjectTo(0.0 <= velocity <= 30.0); + control_problem.subjectTo(-1.0 <= steering_angle <= 1.0); + control_problem.setNOD(3); + + control_problem.subjectTo(-3.0 <= acceleration <= 3.0); + + Function observation; + observation << velocity; + observation << steering_angle; + observation << acceleration; + + BMatrix weights = eye(observation.getDim()); + + control_problem.minimizeLSQ(weights, observation); + + Function terminal_observation; + terminal_observation << velocity; + + BMatrix terminal_weights = eye(terminal_observation.getDim()); + + control_problem.minimizeLSQEndTerm(terminal_weights, terminal_observation); + + OCPexport mpc(control_problem); + mpc.set(INTEGRATOR_TYPE, INT_RK4); + mpc.set(NUM_INTEGRATOR_STEPS, N * Ni); + mpc.set(QP_SOLVER, QP_QPOASES); + mpc.set(HESSIAN_APPROXIMATION, GAUSS_NEWTON); + mpc.set(DISCRETIZATION_TYPE, MULTIPLE_SHOOTING); + mpc.set(GENERATE_TEST_FILE, NO); + mpc.set(GENERATE_MAKE_FILE, NO); + mpc.set(HOTSTART_QP, YES); + mpc.set(SPARSE_QP_SOLUTION, CONDENSING); + mpc.set(FIX_INITIAL_STATE, YES); + mpc.set(CG_USE_VARIABLE_WEIGHTING_MATRIX, YES); + + if (mpc.exportCode(argv[1]) != SUCCESSFUL_RETURN) + { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/acado/all/test_package/conanfile.py b/recipes/acado/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3cdacb96b0c8c --- /dev/null +++ b/recipes/acado/all/test_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" + + def build(self): + cmake = CMake(self) + # FIXME: CCI infrastructure should provide cpu count input to avoid errors + cmake.parallel = False + 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/acado/all/test_package/test_package.cpp b/recipes/acado/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4fc7e80932607 --- /dev/null +++ b/recipes/acado/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include +#include + +ACADOvariables acadoVariables; +ACADOworkspace acadoWorkspace; + +int main() +{ + acado_initializeSolver(); + + acado_preparationStep(); + + for (std::size_t iter{0}; iter < 10U; ++iter) + { + // Perform the feedback step + acado_feedbackStep(); + + // Prepare for the next step + acado_preparationStep(); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/acado/config.yml b/recipes/acado/config.yml new file mode 100644 index 0000000000000..b257855b60919 --- /dev/null +++ b/recipes/acado/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.2-beta": + folder: all diff --git a/recipes/accellera-uvm-systemc/all/conandata.yml b/recipes/accellera-uvm-systemc/all/conandata.yml new file mode 100644 index 0000000000000..682dede9ac02c --- /dev/null +++ b/recipes/accellera-uvm-systemc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0-beta4": + url: "https://www.accellera.org/images/downloads/standards/systemc/uvm-systemc-1.0-beta4.tar.gz" + sha256: "7b7d9167ab590204ec3a4aae0626d7103b3af47865311e05a7187396d7628276" diff --git a/recipes/accellera-uvm-systemc/all/conanfile.py b/recipes/accellera-uvm-systemc/all/conanfile.py new file mode 100644 index 0000000000000..15689e9fd7ded --- /dev/null +++ b/recipes/accellera-uvm-systemc/all/conanfile.py @@ -0,0 +1,90 @@ +from conan import ConanFile +from conans import AutoToolsBuildEnvironment +from conan.tools.files import get, rmdir, rm, copy, rename +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + +class UvmSystemC(ConanFile): + name = "accellera-uvm-systemc" + description = """Universal Verification Methodology for SystemC""" + homepage = "https://systemc.org/about/systemc-verification/uvm-systemc-faq" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("systemc", "verification", "tlm", "uvm") + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + self.requires("systemc/2.3.3") + + def build_requirements(self): + self.tool_requires("cmake/3.24.0") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def validate(self): + if self.settings.os == "Macos": + raise ConanInvalidConfiguration("Macos build not supported") + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows build not yet supported") + if self.settings.compiler.get_safe("cppstd"): + 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], + strip_root=True, destination=self._source_subfolder) + + def build(self): + autotools = AutoToolsBuildEnvironment(self) + args = [f"--with-systemc={self.deps_cpp_info['systemc'].rootpath}"] + if self.options.shared: + args.extend(["--enable-shared", "--disable-static"]) + else: + args.extend(["--enable-static", "--disable-shared"]) + autotools.configure(configure_dir=self._source_subfolder, args=args) + autotools.make() + + def package(self): + copy(self, "LICENSE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "NOTICE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) + autotools = AutoToolsBuildEnvironment(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "docs")) + rmdir(self, os.path.join(self.package_folder, "examples")) + rm(self, "AUTHORS", self.package_folder) + rm(self, "COPYING", self.package_folder) + rm(self, "ChangeLog", self.package_folder) + rm(self, "LICENSE", self.package_folder) + rm(self, "NOTICE", self.package_folder) + rm(self, "NEWS", self.package_folder) + rm(self, "RELEASENOTES", self.package_folder) + rm(self, "README", self.package_folder) + rm(self, "INSTALL", self.package_folder) + rename(self, os.path.join(self.package_folder, "lib-linux64"), os.path.join(self.package_folder, "lib")) + rm(self, "libuvm-systemc.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["uvm-systemc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt b/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..29a5f29bd6062 --- /dev/null +++ b/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(accellera-uvm-systemc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} accellera-uvm-systemc::accellera-uvm-systemc) diff --git a/recipes/accellera-uvm-systemc/all/test_package/conanfile.py b/recipes/accellera-uvm-systemc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7c46504cf008f --- /dev/null +++ b/recipes/accellera-uvm-systemc/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake +from conan.tools.build import cross_building + +class UvmSystemcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/accellera-uvm-systemc/all/test_package/example.cpp b/recipes/accellera-uvm-systemc/all/test_package/example.cpp new file mode 100644 index 0000000000000..db58543c27400 --- /dev/null +++ b/recipes/accellera-uvm-systemc/all/test_package/example.cpp @@ -0,0 +1,12 @@ +#include "uvmsc/base/uvm_version.h" +#include + +using namespace uvm; + +int main(int, char*[]) +{ + std::cout << "uvm-systemc version " << uvm_revision_string() << " loaded successfully."; + + return 0; +} + diff --git a/recipes/accellera-uvm-systemc/config.yml b/recipes/accellera-uvm-systemc/config.yml new file mode 100644 index 0000000000000..da7de76e639d1 --- /dev/null +++ b/recipes/accellera-uvm-systemc/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0-beta4": + folder: "all" diff --git a/recipes/access_private/all/conandata.yml b/recipes/access_private/all/conandata.yml new file mode 100644 index 0000000000000..cb7e88313a5f0 --- /dev/null +++ b/recipes/access_private/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210621": + url: "https://github.com/martong/access_private/archive/c65d54b17bf7b212cb4df867edf143f2ebb0186a.zip" + sha256: "d4af97cdc5b652b05ae71fb310b98c488e1f987a5e31216e4ec41a6d3c758449" diff --git a/recipes/access_private/all/conanfile.py b/recipes/access_private/all/conanfile.py new file mode 100644 index 0000000000000..da35dc6ea7e6e --- /dev/null +++ b/recipes/access_private/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class AccessPrivateConan(ConanFile): + name = "access_private" + description = "Access private members and statics of a C++ class" + license = "MIT" + topics = ("access", "private", "header-only") + homepage = "https://github.com/martong/access_private" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "access_private.hpp", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include", "access_private")) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "access_private")) + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/access_private/all/test_package/CMakeLists.txt b/recipes/access_private/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6d981e9b4484e --- /dev/null +++ b/recipes/access_private/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(access_private REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE access_private::access_private) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/access_private/all/test_package/conanfile.py b/recipes/access_private/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/access_private/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/access_private/all/test_package/test_package.cpp b/recipes/access_private/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7c4f5cf312459 --- /dev/null +++ b/recipes/access_private/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +class A { + int m_i = 3; +}; + +ACCESS_PRIVATE_FIELD(A, int, m_i) + +int main() +{ + const A a; + const int val = access_private::m_i(a); + if (val == 3) { + return 0; + } + return -1; +} diff --git a/recipes/access_private/all/test_v1_package/CMakeLists.txt b/recipes/access_private/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..01b3a8050e773 --- /dev/null +++ b/recipes/access_private/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(access_private REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE access_private::access_private) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/access_private/all/test_v1_package/conanfile.py b/recipes/access_private/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/access_private/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/access_private/config.yml b/recipes/access_private/config.yml new file mode 100644 index 0000000000000..e589b8d1685bc --- /dev/null +++ b/recipes/access_private/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210621": + folder: all diff --git a/recipes/acl/all/conandata.yml b/recipes/acl/all/conandata.yml new file mode 100644 index 0000000000000..3a30a3346bfd5 --- /dev/null +++ b/recipes/acl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.1": + url: "http://download.savannah.nongnu.org/releases/acl/acl-2.3.1.tar.xz" + sha256: "c0234042e17f11306c23c038b08e5e070edb7be44bef6697fb8734dcff1c66b1" diff --git a/recipes/acl/all/conanfile.py b/recipes/acl/all/conanfile.py new file mode 100644 index 0000000000000..f273d2731c12d --- /dev/null +++ b/recipes/acl/all/conanfile.py @@ -0,0 +1,74 @@ +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 copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class AclConan(ConanFile): + name = "acl" + description = "Commands for Manipulating POSIX Access Control Lists" + topics = ("posix",) + license = "GPL-2.0-or-later" + homepage = "https://savannah.nongnu.org/projects/acl/" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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("libattr/2.5.1") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libacl is just supported for Linux") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=os.path.join(self.source_folder, "doc"), dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libacl") + self.cpp_info.libs = ["acl"] diff --git a/recipes/acl/all/test_package/CMakeLists.txt b/recipes/acl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3c77dd4bcf50a --- /dev/null +++ b/recipes/acl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(acl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE acl::acl) diff --git a/recipes/acl/all/test_package/conanfile.py b/recipes/acl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/acl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/acl/all/test_package/test_package.c b/recipes/acl/all/test_package/test_package.c new file mode 100644 index 0000000000000..7fa01aad7d2b2 --- /dev/null +++ b/recipes/acl/all/test_package/test_package.c @@ -0,0 +1,95 @@ +/* + Copyright (C) 2009 Andreas Gruenbacher + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include +#include +#include +#include +#include + +const char *progname; + +int main(int argc, char *argv[]) +{ + int n, ret = 0; + + progname = basename(argv[0]); + + if (argc == 1) { + printf("%s -- get access control lists of files\n" + "Usage: %s file ...\n", + progname, progname); + return 0; + } + + for (n = 1; n < argc; n++) { + struct stat st; + acl_t acl, default_acl; + char *acl_text, *default_acl_text, *token; + + if (stat(argv[n], &st) != 0) { + fprintf(stderr, "%s: %s: %s\n", + progname, argv[n], strerror(errno)); + ret = 1; + continue; + } + + acl = acl_get_file(argv[n], ACL_TYPE_ACCESS); + if (acl == NULL) { + fprintf(stderr, "%s: getting acl of %s: %s\n", + progname, argv[n], strerror(errno)); + ret = 1; + continue; + } + acl_text = acl_to_text(acl, NULL); + acl_free(acl); + + if (S_ISDIR(st.st_mode)) { + default_acl = acl_get_file(argv[n], ACL_TYPE_DEFAULT); + if (default_acl == NULL) { + acl_free(acl_text); + fprintf(stderr, "%s: getting default acl " + "of %s: %s\n", progname, argv[n], + strerror(errno)); + ret = 1; + continue; + } + default_acl_text = acl_to_text(default_acl, NULL); + acl_free(default_acl); + } + + printf("# file: %s\n" + "# owner: %d\n" + "# group: %d\n" + "%s", + argv[n], st.st_uid, st.st_gid, acl_text); + + if (S_ISDIR(st.st_mode)) { + token = strtok(default_acl_text, "\n"); + while (token) { + printf("default:%s\n", token); + token = strtok(NULL, "\n"); + } + acl_free(default_acl_text); + } + printf("\n"); + + acl_free(acl_text); + } + return ret; +} diff --git a/recipes/acl/all/test_v1_package/CMakeLists.txt b/recipes/acl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/acl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/acl/all/test_v1_package/conanfile.py b/recipes/acl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/acl/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/acl/config.yml b/recipes/acl/config.yml new file mode 100644 index 0000000000000..215bc57fe4993 --- /dev/null +++ b/recipes/acl/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.1": + folder: all diff --git a/recipes/ada/all/conandata.yml b/recipes/ada/all/conandata.yml new file mode 100644 index 0000000000000..58c7e0e41688d --- /dev/null +++ b/recipes/ada/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.4.0": + url: "https://github.com/ada-url/ada/archive/refs/tags/v2.4.0.tar.gz" + sha256: "14624f1dfd966fee85272688064714172ff70e6e304a1e1850f352a07e4c6dc7" + "2.3.1": + url: "https://github.com/ada-url/ada/archive/refs/tags/v2.3.1.tar.gz" + sha256: "298992ec0958979090566c7835ea60c14f5330d6372ee092ef6eee1d2e6ac079" + "2.3.0": + url: "https://github.com/ada-url/ada/archive/refs/tags/v2.3.0.tar.gz" + sha256: "932a93f6a745775343ebdbaafca295e07b9513f6aaeb738f9e85dcb397925e33" + "2.2.0": + url: "https://github.com/ada-url/ada/archive/refs/tags/v2.2.0.tar.gz" + sha256: "40a6b3fe0d5c62936c081e8403790ec05d5afe3d0909eece894efcfef7e678ee" + "2.0.0": + url: "https://github.com/ada-url/ada/archive/refs/tags/v2.0.0.tar.gz" + sha256: "a18272e1c5d6580f62a333df88149e3810ffedcb61b3fb06c480a5b52e458b5e" diff --git a/recipes/ada/all/conanfile.py b/recipes/ada/all/conanfile.py new file mode 100644 index 0000000000000..dcb06ed03de1a --- /dev/null +++ b/recipes/ada/all/conanfile.py @@ -0,0 +1,99 @@ +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 AdaConan(ConanFile): + name = "ada" + description = "WHATWG-compliant URL parser written in modern C++" + license = ("Apache-2.0", "MIT") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ada-url/ada" + topics = ("url", "parser", "WHATWG") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "10", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if Version(self.version) <= "2.0.0": + self.options.rm_safe("shared") + self.package_type = "static-library" + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + 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.compiler == "clang" and Version(self.settings.compiler.version) < "12.0.0" and self.settings.compiler.libcxx != "libc++": + raise ConanInvalidConfiguration( + f"{self.ref} requires , please use libc++ or upgrade compiler." + ) + + def build_requirements(self): + if Version(self.version) >= "0.6.0": + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["ada"] diff --git a/recipes/ada/all/test_package/CMakeLists.txt b/recipes/ada/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..524bc69392b7b --- /dev/null +++ b/recipes/ada/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(ada REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ada::ada) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ada/all/test_package/conanfile.py b/recipes/ada/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/ada/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ada/all/test_package/test_package.cpp b/recipes/ada/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e326ebf6d12c0 --- /dev/null +++ b/recipes/ada/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include "ada.h" + +int main() { + ada::result url = ada::parse("https://www.google.com"); + if(!url) { + return 1; + } + + std::cout << url->get_host() << std::endl; + + return 0; +} diff --git a/recipes/ada/all/test_v1_package/CMakeLists.txt b/recipes/ada/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/ada/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ada/all/test_v1_package/conanfile.py b/recipes/ada/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/ada/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ada/config.yml b/recipes/ada/config.yml new file mode 100644 index 0000000000000..fb1219967c27e --- /dev/null +++ b/recipes/ada/config.yml @@ -0,0 +1,11 @@ +versions: + "2.4.0": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/ade/all/conandata.yml b/recipes/ade/all/conandata.yml new file mode 100644 index 0000000000000..954c10dfe2c1d --- /dev/null +++ b/recipes/ade/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.1.2a": + url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.2a.tar.gz" + sha256: "c022a688b0554017e46e1cbdeb0105e625ca090fc3755c15df8c4451a304e084" + "0.1.1f": + url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.1f.tar.gz" + sha256: "c316680efbb5dd3ac4e10bb8cea345cf26a6a25ebc22418f8f0b8ca931a550e9" diff --git a/recipes/ade/all/conanfile.py b/recipes/ade/all/conanfile.py new file mode 100644 index 0000000000000..56f8248013585 --- /dev/null +++ b/recipes/ade/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class AdeConan(ConanFile): + name = "ade" + license = "Apache-2.0" + homepage = "https://github.com/opencv/ade" + url = "https://github.com/conan-io/conan-center-index" + description = "Graph construction, manipulation, and processing framework" + topics = ("graphs", "opencv") + + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), " if(UNIX)", " if(UNIX OR CYGWIN OR MINGW OR MSYS)") + 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, "share")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"ade": "ade::ade"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ade") + self.cpp_info.set_property("cmake_target_name", "ade") + self.cpp_info.libs = ["ade"] + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + self.cpp_info.system_libs.append("ssp") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/ade/all/test_package/CMakeLists.txt b/recipes/ade/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c573b9026dcbc --- /dev/null +++ b/recipes/ade/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ade REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ade) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ade/all/test_package/conanfile.py b/recipes/ade/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/ade/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/ade/all/test_package/test_package.cpp b/recipes/ade/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..524d173220d96 --- /dev/null +++ b/recipes/ade/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include "ade/graph.hpp" + +int main() { + ade::Graph graph; +} diff --git a/recipes/ade/all/test_v1_package/CMakeLists.txt b/recipes/ade/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/ade/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ade/all/test_v1_package/conanfile.py b/recipes/ade/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ade/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/ade/config.yml b/recipes/ade/config.yml new file mode 100644 index 0000000000000..cbf2f373fb630 --- /dev/null +++ b/recipes/ade/config.yml @@ -0,0 +1,5 @@ +versions: + "0.1.2a": + folder: "all" + "0.1.1f": + folder: "all" diff --git a/recipes/aeron/all/conandata.yml b/recipes/aeron/all/conandata.yml new file mode 100644 index 0000000000000..a888d0c721120 --- /dev/null +++ b/recipes/aeron/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.35.1": + url: "https://github.com/real-logic/aeron/archive/1.35.1.tar.gz" + sha256: "19b0f27c2cbc27b422e26a533e4a04a60592217e1c70fdbdd48a92a7b932cccb" + "1.34.0": + url: https://github.com/real-logic/aeron/archive/refs/tags/1.34.0.tar.gz + sha256: "e475f895f0f75654bc7e25e21169d656401f446bf63a03d4efd931deb60246ca" + "1.33.1": + url: https://github.com/real-logic/aeron/archive/refs/tags/1.33.1.tar.gz + sha256: "a4d936ba82d3aefa0342056680790246620f67de4e275fdd07a013dee795233d" + "1.32.0": + url: https://github.com/real-logic/aeron/archive/refs/tags/1.32.0.tar.gz + sha256: "998ca14c895cd154345c85298b7c2e2ef76aef45b10c742030fd3a32065b9b1c" diff --git a/recipes/aeron/all/conanfile.py b/recipes/aeron/all/conanfile.py new file mode 100644 index 0000000000000..aef0519cfd69a --- /dev/null +++ b/recipes/aeron/all/conanfile.py @@ -0,0 +1,145 @@ +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 collect_libs, copy, get, replace_in_file, rename, rm +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import glob +import os + +required_conan_version = ">=1.53.0" + + +class AeronConan(ConanFile): + name = "aeron" + description = "Efficient reliable UDP unicast, UDP multicast, and IPC message transport" + topics = ("udp", "messaging", "low-latency") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/real-logic/aeron/wiki" + license = "Apache-2.0" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_aeron_driver": [True, False], + "build_aeron_archive_api": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_aeron_driver": True, + "build_aeron_archive_api": True, + } + + @property + def _min_cppstd(self): + return "11" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "5", + } + + 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) + + 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 == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("This platform (os=Macos arch=armv8) is not yet supported by this recipe") + + def build_requirements(self): + self.tool_requires("zulu-openjdk/11.0.15") + + 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.cache_variables["BUILD_AERON_DRIVER"] = self.options.build_aeron_driver + tc.cache_variables["BUILD_AERON_ARCHIVE_API"] = self.options.build_aeron_archive_api + tc.cache_variables["AERON_TESTS"] = False + tc.cache_variables["AERON_SYSTEM_TESTS"] = False + tc.cache_variables["AERON_SLOW_SYSTEM_TESTS"] = False + tc.cache_variables["AERON_BUILD_SAMPLES"] = False + tc.cache_variables["AERON_BUILD_DOCUMENTATION"] = False + tc.cache_variables["AERON_INSTALL_TARGETS"] = True + tc.cache_variables["AERON_ENABLE_NONSTANDARD_OPTIMIZATIONS"] = True + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "/MTd", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "/MT", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + archive_resources_dir = os.path.join(self.source_folder, "aeron-archive", "src", "main", "resources") + copy(self, "*", src=archive_resources_dir, dst=os.path.join(self.package_folder, "res")) + + archive_include_dir = os.path.join(self.source_folder, "aeron-archive", "src", "main", "cpp", "client") + copy(self, "*.h", src=archive_include_dir, dst=os.path.join(self.package_folder, "include", "aeron-archive")) + + lib_folder = os.path.join(self.package_folder, "lib") + bin_folder = os.path.join(self.package_folder, "bin") + for dll in glob.glob(os.path.join(lib_folder, "*.dll")): + rename(self, dll, os.path.join(bin_folder, os.path.basename(dll))) + + if self.options.shared: + for lib in glob.glob(os.path.join(lib_folder, "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) + rm(self, "*static.lib", lib_folder) + rm(self, "aeron_client.lib", lib_folder) + else: + rm(self, "*.dll", bin_folder) + rm(self, "*.so*", lib_folder) + rm(self, "*.dylib", lib_folder) + rm(self, "*.dll.a", lib_folder) + rm(self, "*shared.lib", lib_folder) + rm(self, "aeron.lib", lib_folder) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + if is_msvc(self): + self.cpp_info.defines.append("_ENABLE_EXTENDED_ALIGNED_STORAGE") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["winmm", "wsock32", "ws2_32", "iphlpapi"] + self.cpp_info.defines.append("HAVE_WSAPOLL") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/aeron/all/test_package/CMakeLists.txt b/recipes/aeron/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a3773bc5e7424 --- /dev/null +++ b/recipes/aeron/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(aeron REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE aeron::aeron) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aeron/all/test_package/conanfile.py b/recipes/aeron/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/aeron/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aeron/all/test_package/test_package.cpp b/recipes/aeron/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5c4caf9fca298 --- /dev/null +++ b/recipes/aeron/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include +#include + + +int main() +{ + std::cout << "Aeron: " << ::aeron::Aeron::version() << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/aeron/all/test_v1_package/CMakeLists.txt b/recipes/aeron/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aeron/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aeron/all/test_v1_package/conanfile.py b/recipes/aeron/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aeron/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/aeron/config.yml b/recipes/aeron/config.yml new file mode 100644 index 0000000000000..0c20e51036f8b --- /dev/null +++ b/recipes/aeron/config.yml @@ -0,0 +1,9 @@ +versions: + "1.35.1": + folder: all + "1.34.0": + folder: all + "1.33.1": + folder: all + "1.32.0": + folder: all diff --git a/recipes/ags/all/conandata.yml b/recipes/ags/all/conandata.yml new file mode 100644 index 0000000000000..80c23a11369cc --- /dev/null +++ b/recipes/ags/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "5.4.1": + url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v5.4.1.tar.gz + sha256: d72766152bc83fe75c12a26db02fcf01dcff269817994dc337c7eca52d69a669 + "6.0": + url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v6.0.tar.gz + sha256: 3278ae381b1169f2f70be4412e351a427686cca9728dd6870fbb0c26d8d33b5b + "6.0.1": + url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v6.0.1.tar.gz + sha256: 7827e3c48b09a216b539c70d861e49580d57ae5fb6808f34dcf97067281c2a52 diff --git a/recipes/ags/all/conanfile.py b/recipes/ags/all/conanfile.py new file mode 100644 index 0000000000000..ce3253516ac16 --- /dev/null +++ b/recipes/ags/all/conanfile.py @@ -0,0 +1,89 @@ +import os +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.33.0" + + +class AGSConan(ConanFile): + name = "ags" + description = "The AMD GPU Services (AGS) library provides software developers with the ability to query AMD GPU " \ + "software and hardware state information that is not normally available through standard operating " \ + "systems or graphics APIs." + homepage = "https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK" + topics = ("conan", "amd", "gpu") + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + license = "MIT" + no_copy_source = True + options = { + "shared": [True, False], + } + default_options = { + "shared": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _supported_msvc_versions(self): + return ["14", "15", "16"] + + @property + def _supported_archs(self): + return ["x86_64", "x86"] + + def configure(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("ags doesn't support OS: {}.".format(self.settings.os)) + if self.settings.compiler != "Visual Studio": + raise ConanInvalidConfiguration("ags doesn't support compiler: {} on OS: {}.". + format(self.settings.compiler, self.settings.os)) + + if self.settings.compiler == "Visual Studio": + if self.settings.compiler.version not in self._supported_msvc_versions: + raise ConanInvalidConfiguration("ags doesn't support MSVC version: {}".format(self.settings.compiler.version)) + if self.settings.arch not in self._supported_archs: + raise ConanInvalidConfiguration("ags doesn't support arch: {}".format(self.settings.arch)) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _convert_msvc_version_to_vs_version(self, msvc_version): + vs_versions = { + "14": "2015", + "15": "2017", + "16": "2019", + } + return vs_versions.get(str(msvc_version), None) + + def _convert_arch_to_win_arch(self, msvc_version): + vs_versions = { + "x86_64": "x64", + "x86": "x86", + } + return vs_versions.get(str(msvc_version), None) + + def package(self): + ags_lib_path = os.path.join(self.source_folder, self._source_subfolder, "ags_lib") + self.copy("LICENSE.txt", dst="licenses", src=ags_lib_path) + self.copy("*.h", dst="include", src=os.path.join(ags_lib_path, "inc")) + + if self.settings.compiler == "Visual Studio": + win_arch = self._convert_arch_to_win_arch(self.settings.arch) + if self.options.shared: + shared_lib = "amd_ags_{arch}.dll".format(arch=win_arch) + symbol_lib = "amd_ags_{arch}.lib".format(arch=win_arch) + self.copy(shared_lib, dst="bin", src=os.path.join(ags_lib_path, "lib")) + self.copy(symbol_lib, dst="lib", src=os.path.join(ags_lib_path, "lib")) + else: + vs_version = self._convert_msvc_version_to_vs_version(self.settings.compiler.version) + static_lib = "amd_ags_{arch}_{vs_version}_{runtime}.lib".format(arch=win_arch, vs_version=vs_version, runtime=self.settings.compiler.runtime) + self.copy(static_lib, dst="lib", src=os.path.join(ags_lib_path, "lib")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/ags/all/test_package/CMakeLists.txt b/recipes/ags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..523fab4f02b6a --- /dev/null +++ b/recipes/ags/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CONAN_PKG::ags) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/ags/all/test_package/conanfile.py b/recipes/ags/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c08206c505563 --- /dev/null +++ b/recipes/ags/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/ags/all/test_package/test_package.cpp b/recipes/ags/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..416f3119a86fa --- /dev/null +++ b/recipes/ags/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#define WIN32_LEAN_AND_MEAN +#include +#include "amd_ags.h" + +int main() +{ + AGSDriverVersionResult result = agsCheckDriverVersion("18.8.2", AGS_MAKE_VERSION(18, 8, 3)); + return 0; +} diff --git a/recipes/ags/config.yml b/recipes/ags/config.yml new file mode 100644 index 0000000000000..a799261020b31 --- /dev/null +++ b/recipes/ags/config.yml @@ -0,0 +1,7 @@ +versions: + "5.4.1": + folder: all + "6.0": + folder: all + "6.0.1": + folder: all diff --git a/recipes/alac/all/CMakeLists.txt b/recipes/alac/all/CMakeLists.txt new file mode 100644 index 0000000000000..fe2d89ad21170 --- /dev/null +++ b/recipes/alac/all/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.8) +project(alac LANGUAGES C CXX) + +include(GNUInstallDirs) + +file(GLOB ALAC_LIB_SRCS ${ALAC_SRC_DIR}/codec/*.c ${ALAC_SRC_DIR}/codec/*.cpp) +file(GLOB ALAC_LIB_PUBLIC_HDRS ${ALAC_SRC_DIR}/codec/ALAC*.h) + +add_library(alac ${ALAC_LIB_SRCS}) +target_include_directories(alac PUBLIC ${ALAC_SRC_DIR}/codec) +set_property(TARGET alac PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +target_compile_definitions(alac + PRIVATE + $,TARGET_OS_MAC=1,TARGET_OS_MAC=0> +) + +install(FILES ${ALAC_LIB_PUBLIC_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(TARGETS alac + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +if(ALAC_BUILD_UTILITY) + file(GLOB ALAC_CONVERTER_SRCS ${ALAC_SRC_DIR}/convert-utility/*.cpp) + + add_executable(alacconvert ${ALAC_CONVERTER_SRCS}) + target_link_libraries(alacconvert PRIVATE alac) + target_compile_definitions(alacconvert + PRIVATE + $,TARGET_OS_WIN32=1,TARGET_OS_WIN32=0> + ) + + install(TARGETS alacconvert DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/recipes/alac/all/conandata.yml b/recipes/alac/all/conandata.yml new file mode 100644 index 0000000000000..1645b0ea50086 --- /dev/null +++ b/recipes/alac/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20121212": + url: "https://github.com/macosforge/alac/archive/3814718153165b15b30804f525d3c4e93cf86300.zip" + sha256: "17636c24343e43a6543a0fc513945e331b0bef6d813139e20464316acf4d985d" diff --git a/recipes/alac/all/conanfile.py b/recipes/alac/all/conanfile.py new file mode 100644 index 0000000000000..03e8814c8b1fd --- /dev/null +++ b/recipes/alac/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile, conan_version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class AlacConan(ConanFile): + name = "alac" + description = "The Apple Lossless Audio Codec (ALAC) is a lossless audio " \ + "codec developed by Apple and deployed on all of its platforms and devices." + license = "Apache-2.0" + topics = ("alac", "audio-codec") + homepage = "https://macosforge.github.io/alac" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "utility": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "utility": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + 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["ALAC_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["ALAC_BUILD_UTILITY"] = self.options.utility + 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 = ["alac"] + + if Version(conan_version).major < 2 and self.options.utility: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/alac/all/test_package/CMakeLists.txt b/recipes/alac/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..237396b4c3323 --- /dev/null +++ b/recipes/alac/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(alac REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE alac::alac) diff --git a/recipes/alac/all/test_package/conanfile.py b/recipes/alac/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/alac/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/alac/all/test_package/test_package.cpp b/recipes/alac/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..99c6a42ec8058 --- /dev/null +++ b/recipes/alac/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + ALACEncoder encoder; + return 0; +} diff --git a/recipes/alac/all/test_v1_package/CMakeLists.txt b/recipes/alac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e042a1c74181 --- /dev/null +++ b/recipes/alac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(alac REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE alac::alac) diff --git a/recipes/alac/all/test_v1_package/conanfile.py b/recipes/alac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/alac/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/alac/config.yml b/recipes/alac/config.yml new file mode 100644 index 0000000000000..f7d9052aae4d6 --- /dev/null +++ b/recipes/alac/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20121212": + folder: all diff --git a/recipes/alembic/all/conandata.yml b/recipes/alembic/all/conandata.yml new file mode 100644 index 0000000000000..bf7fb209af8bc --- /dev/null +++ b/recipes/alembic/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.8.3": + url: "https://github.com/alembic/alembic/archive/1.8.3.tar.gz" + sha256: "b0bc74833bff118a869e81e6acb810a58797e77ef63143954b2f8e817c7f65cb" + "1.8.2": + url: "https://github.com/alembic/alembic/archive/refs/tags/1.8.2.tar.gz" + sha256: "3f1c466ee1600578689b32b1f2587066d3259704ec7ed1fcf80c324d01274f48" +patches: + "1.8.3": + - patch_file: "patches/1.8.2-0001-fix-cmake.patch" + "1.8.2": + - patch_file: "patches/1.8.2-0001-fix-cmake.patch" diff --git a/recipes/alembic/all/conanfile.py b/recipes/alembic/all/conanfile.py new file mode 100644 index 0000000000000..73264829b63a3 --- /dev/null +++ b/recipes/alembic/all/conanfile.py @@ -0,0 +1,97 @@ +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, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class AlembicConan(ConanFile): + name = "alembic" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.alembic.io" + description = "Open framework for storing and sharing scene data." + topics = ("3d", "scene", "geometry", "graphics") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_hdf5": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_hdf5": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("imath/3.1.6") + if self.options.with_hdf5: + self.requires("hdf5/1.14.0") + + 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["USE_ARNOLD"] = False + tc.variables["USE_MAYA"] = False + tc.variables["USE_PRMAN"] = False + tc.variables["USE_PYALEMBIC"] = False + tc.variables["USE_BINARIES"] = False + tc.variables["USE_EXAMPLES"] = False + tc.variables["USE_HDF5"] = self.options.with_hdf5 + tc.variables["USE_TESTS"] = False + tc.variables["ALEMBIC_BUILD_LIBS"] = True + tc.variables["ALEMBIC_ILMBASE_LINK_STATIC"] = True # for -DOPENEXR_DLL, handled by OpenEXR package + tc.variables["ALEMBIC_SHARED_LIBS"] = self.options.shared + tc.variables["ALEMBIC_USING_IMATH_3"] = False + tc.variables["ALEMBIC_ILMBASE_FOUND"] = 1 + tc.variables["ALEMBIC_ILMBASE_LIBS"] = "OpenEXR::OpenEXR" + 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.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Alembic") + self.cpp_info.set_property("cmake_target_name", "Alembic::Alembic") + self.cpp_info.libs = ["Alembic"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Alembic" + self.cpp_info.names["cmake_find_package_multi"] = "Alembic" diff --git a/recipes/alembic/all/patches/1.8.2-0001-fix-cmake.patch b/recipes/alembic/all/patches/1.8.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8b83f19775d82 --- /dev/null +++ b/recipes/alembic/all/patches/1.8.2-0001-fix-cmake.patch @@ -0,0 +1,57 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -99,9 +99,6 @@ SET(DARWIN FALSE) + IF ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + SET(DARWIN TRUE) + # suppress rpath warning +- IF (POLICY CMP0042) +- CMAKE_POLICY(SET CMP0042 OLD) +- ENDIF() + ENDIF() + + IF (APPLE) +@@ -127,7 +124,6 @@ ENDIF() + + # Set some debug vs opt flags + if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND NOT MSVC) +- add_definitions(-Wall -Werror -Wextra -Wno-unused-parameter -Wno-deprecated) + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR + CMAKE_CXX_COMPILER_ID MATCHES "CLANG") + add_definitions( -Wno-error=implicit-fallthrough) +@@ -215,7 +211,6 @@ INCLUDE("./cmake/AlembicIlmBase.cmake") + + # HDF5 + IF (USE_HDF5) +- FIND_PACKAGE(ZLIB REQUIRED) + SET(ALEMBIC_WITH_HDF5 "1") + INCLUDE("./cmake/AlembicHDF5.cmake") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5_USE_18_API") +--- a/lib/Alembic/CMakeLists.txt ++++ b/lib/Alembic/CMakeLists.txt +@@ -69,21 +69,20 @@ ENDIF() + + + TARGET_LINK_LIBRARIES(Alembic +- LINK_PUBLIC ++ PUBLIC + ${ALEMBIC_ILMBASE_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ${EXTERNAL_MATH_LIBS} +- LINK_PRIVATE ++ PRIVATE + ${HDF5_LIBRARIES} +- ${ZLIB_LIBRARY} + ) + + SET( ALEMBIC_LIB_INSTALL_DIR lib CACHE PATH "Where to install the Alembic libs") + INSTALL(TARGETS Alembic + EXPORT AlembicTargets +- LIBRARY DESTINATION ${ALEMBIC_LIB_INSTALL_DIR} +- ARCHIVE DESTINATION ${ALEMBIC_LIB_INSTALL_DIR} +- RUNTIME DESTINATION ${ALEMBIC_LIB_INSTALL_DIR}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + #-****************************************************************************** + # PACKAGE EXPORTS diff --git a/recipes/alembic/all/test_package/CMakeLists.txt b/recipes/alembic/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e152ce5e9421a --- /dev/null +++ b/recipes/alembic/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Alembic REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Alembic::Alembic) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/alembic/all/test_package/conanfile.py b/recipes/alembic/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/alembic/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/alembic/all/test_package/test_package.cpp b/recipes/alembic/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..91c73696e1465 --- /dev/null +++ b/recipes/alembic/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include + +#include +#include +#include + +void write() +{ + Alembic::Abc::OArchive archive(Alembic::AbcCoreOgawa::WriteArchive(), "Collection.abc"); + Alembic::Abc::OObject root(archive, Alembic::Abc::kTop); + Alembic::Abc::OObject test(root, "test"); +} + +void read() +{ + Alembic::Abc::IArchive archive(Alembic::AbcCoreOgawa::ReadArchive(), "Collection.abc"); + Alembic::Abc::IObject test(archive.getTop(), "test"); +} + +int main() { + write(); + read(); + return EXIT_SUCCESS; +} diff --git a/recipes/alembic/all/test_v1_package/CMakeLists.txt b/recipes/alembic/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/alembic/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/alembic/all/test_v1_package/conanfile.py b/recipes/alembic/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/alembic/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/alembic/config.yml b/recipes/alembic/config.yml new file mode 100644 index 0000000000000..68197c279a4ee --- /dev/null +++ b/recipes/alembic/config.yml @@ -0,0 +1,5 @@ +versions: + "1.8.3": + folder: all + "1.8.2": + folder: all diff --git a/recipes/alpaca/all/conandata.yml b/recipes/alpaca/all/conandata.yml new file mode 100644 index 0000000000000..4be0a369c7f9a --- /dev/null +++ b/recipes/alpaca/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.1": + url: "https://github.com/p-ranav/alpaca/archive/refs/tags/v0.2.1.tar.gz" + sha256: "05d49a2dc9c6a9e07c0cbc4e26caec273a8666270c82d7c3f0ede4f3a9258f4e" diff --git a/recipes/alpaca/all/conanfile.py b/recipes/alpaca/all/conanfile.py new file mode 100644 index 0000000000000..a7227d4427d29 --- /dev/null +++ b/recipes/alpaca/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 get, copy +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class AlpacaConan(ConanFile): + name = "alpaca" + description = "Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/alpaca" + topics = ("reflection", "checksum", "serialization", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "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) + 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], destination=self.source_folder, 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"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "alpaca") diff --git a/recipes/alpaca/all/test_package/CMakeLists.txt b/recipes/alpaca/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..790a5eaae638a --- /dev/null +++ b/recipes/alpaca/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(alpaca REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE alpaca::alpaca) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/alpaca/all/test_package/conanfile.py b/recipes/alpaca/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/alpaca/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/alpaca/all/test_package/test_package.cpp b/recipes/alpaca/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0134e1d6e0d2d --- /dev/null +++ b/recipes/alpaca/all/test_package/test_package.cpp @@ -0,0 +1,35 @@ +#include + +struct Config { + std::string device; + std::pair resolution; + std::array K_matrix; + std::vector distortion_coeffients; + std::map> parameters; +}; + +int main() { + // Construct the object + Config c{"/dev/video0", {640, 480}, + {223.28249888247538, 0.0, 152.30570853111396, + 0.0, 223.8756535707556, 124.5606000035353, + 0.0, 0.0, 1.0}, + {-0.44158343539568284, 0.23861463831967872, 0.0016338407443826572, + 0.0034950038632981604, -0.05239245892096022}, + {{"start_server", bool{true}}, + {"max_depth", uint16_t{5}}, + {"model_path", std::string{"foo/bar.pt"}}}}; + + // Serialize + std::vector bytes; + auto bytes_written = alpaca::serialize(c, bytes); + + // Deserialize + std::error_code ec; + auto object = alpaca::deserialize(bytes, ec); + if (ec) { + return 1; + } + return 0; +} + diff --git a/recipes/alpaca/all/test_v1_package/CMakeLists.txt b/recipes/alpaca/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0aeb3e1d92584 --- /dev/null +++ b/recipes/alpaca/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) # if the project is pure C +project(test_package LANGUAGES CXX) # if the project uses c++ + +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/alpaca/all/test_v1_package/conanfile.py b/recipes/alpaca/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/alpaca/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/alpaca/config.yml b/recipes/alpaca/config.yml new file mode 100644 index 0000000000000..f975c1e3261f7 --- /dev/null +++ b/recipes/alpaca/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/amgcl/all/conandata.yml b/recipes/amgcl/all/conandata.yml new file mode 100644 index 0000000000000..cbd774ff5f231 --- /dev/null +++ b/recipes/amgcl/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.4.3": + url: "https://github.com/ddemidov/amgcl/archive/1.4.3.tar.gz" + sha256: "e920d5767814ce697d707d1f359a16c9b9eb79eba28fe19e14c18c2a505fe0ad" + "1.4.2": + url: "https://github.com/ddemidov/amgcl/archive/1.4.2.tar.gz" + sha256: "db0de6b75e6c205f44542c3ac8d9935c8357a58072963228d0bb11a54181aea8" + "1.4.0": + url: "https://github.com/ddemidov/amgcl/archive/refs/tags/1.4.0.tar.gz" + sha256: "018b824396494c8958faa6337cebcaba48a2584d828f279eef0bbf9e05f900a7" diff --git a/recipes/amgcl/all/conanfile.py b/recipes/amgcl/all/conanfile.py new file mode 100644 index 0000000000000..d2ddd6171e66f --- /dev/null +++ b/recipes/amgcl/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + + +class AmgclConan(ConanFile): + name = "amgcl" + description = ( + "AMGCL is a header-only C++ library for solving large sparse linear " + "systems with algebraic multigrid (AMG) method." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ddemidov/amgcl" + topics = ("mathematics", "opencl", "openmp", "cuda", "amg") + 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 requirements(self): + self.requires("boost/1.81.0") + + 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 build(self): + pass + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "amgcl"), + dst=os.path.join(self.package_folder, "include", "amgcl")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "amgcl") + self.cpp_info.set_property("cmake_target_name", "amgcl::amgcl") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/amgcl/all/test_package/CMakeLists.txt b/recipes/amgcl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a31b491cc133 --- /dev/null +++ b/recipes/amgcl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(amgcl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE amgcl::amgcl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/amgcl/all/test_package/conanfile.py b/recipes/amgcl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/amgcl/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/amgcl/all/test_package/test_package.cpp b/recipes/amgcl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e51a692a976df --- /dev/null +++ b/recipes/amgcl/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + amgcl::profiler<> profile; + profile.tic("assemble"); + + return EXIT_SUCCESS; +} diff --git a/recipes/amgcl/all/test_v1_package/CMakeLists.txt b/recipes/amgcl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/amgcl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/amgcl/all/test_v1_package/conanfile.py b/recipes/amgcl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/amgcl/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/amgcl/config.yml b/recipes/amgcl/config.yml new file mode 100644 index 0000000000000..1d12970eb4fba --- /dev/null +++ b/recipes/amgcl/config.yml @@ -0,0 +1,7 @@ +versions: + "1.4.3": + folder: all + "1.4.2": + folder: all + "1.4.0": + folder: all diff --git a/recipes/amqp-cpp/all/conandata.yml b/recipes/amqp-cpp/all/conandata.yml new file mode 100644 index 0000000000000..d5f7ffbc385d2 --- /dev/null +++ b/recipes/amqp-cpp/all/conandata.yml @@ -0,0 +1,47 @@ +sources: + "4.3.24": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.24.tar.gz" + sha256: "c3312f8af813cacabf6c257dfaf41bf9e66606bbf7d62d085a9b7da695355245" + "4.3.18": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.18.tar.gz" + sha256: "cc2c1fc5da00a1778c2804306e06bdedc782a5f74762b9d9b442d3a498dd0c4f" + "4.3.16": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.16.tar.gz" + sha256: "66c96e0db1efec9e7ddcf7240ff59a073d68c09752bd3e94b8bc4c506441fbf7" + "4.3.11": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.11.tar.gz" + sha256: "be2b11ada1020f77b859857310be54bd073c3a4f579d99a5e251a738576ca28c" + "4.3.10": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.10.tar.gz" + sha256: "4fa1e9650f7a08ae7217899431a3b3f0a173ad826dd819f0b8c760e4e2a65298" + "4.2.1": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.2.1.tar.gz" + sha256: "33306d6cdb60554998afb304cdc3e3120a71ea539b4be187812065b1b9e59c2f" + "4.1.7": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.7.tar.gz" + sha256: "71b504f21f62b69c76b371fe7044e0dfc6d42650a15c267431c5084badb0ade7" + "4.1.6": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.6.tar.gz" + sha256: "48832068dc1e25a5313dd9e96fb33ba954c19f9dc04eeca8f7b2c6cecde3afc9" + "4.1.5": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.5.tar.gz" + sha256: "9840c7fb17bb0c0b601d269e528b7f9cac5ec008dcf8d66bef22434423b468aa" +patches: + "4.3.24": + - patch_file: "patches/4.3.24-0001-cmake-openssl-install-directories.patch" + "4.3.18": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.3.16": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.3.11": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.3.10": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.2.1": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.1.7": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.1.6": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + "4.1.5": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" diff --git a/recipes/amqp-cpp/all/conanfile.py b/recipes/amqp-cpp/all/conanfile.py new file mode 100644 index 0000000000000..c1e0ec3696e4e --- /dev/null +++ b/recipes/amqp-cpp/all/conanfile.py @@ -0,0 +1,146 @@ +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, save +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AmqpcppConan(ConanFile): + name = "amqp-cpp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CopernicaMarketingSoftware/AMQP-CPP" + topics = ("amqp", "network", "queue") + license = "Apache-2.0" + description = "C++ library for asynchronous non-blocking communication with RabbitMQ" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "linux_tcp_module": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "linux_tcp_module": 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.linux_tcp_module + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("linux_tcp_module"): + self.requires("openssl/[>=1.1 <4]") + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "4.3.20" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "7.4", + "Visual Studio": "15.7", + "msvc": "191", + "clang": "6", + "apple-clang": "10", + }, + }.get(self._min_cppstd, {}) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["AMQP-CPP_BUILD_SHARED"] = self.options.shared + tc.variables["AMQP-CPP_BUILD_EXAMPLES"] = False + tc.variables["AMQP-CPP_LINUX_TCP"] = self.options.get_safe("linux_tcp_module", False) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"amqpcpp": "amqpcpp::amqpcpp"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "amqpcpp") + self.cpp_info.set_property("cmake_target_name", "amqpcpp") + self.cpp_info.set_property("pkg_config_name", "amqpcpp") + self.cpp_info.libs = ["amqpcpp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["pkg_config"] = "amqpcpp" + self.cpp_info.names["cmake_find_package"] = "amqpcpp" + self.cpp_info.names["cmake_find_package_multi"] = "amqpcpp" + 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/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch b/recipes/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch new file mode 100644 index 0000000000000..f47d6bd4b19df --- /dev/null +++ b/recipes/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch @@ -0,0 +1,23 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -88,7 +88,10 @@ + #add_library(${PROJECT_NAME} STATIC ${SRCS}) + add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP}) + endif() +- ++if(AMQP-CPP_LINUX_TCP) ++find_package(OpenSSL REQUIRED) ++target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto) ++endif() + # install rules + # ------------------------------------------------------------------------------------------------------ + +@@ -97,7 +99,7 @@ + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ) + else() + # copy static lib diff --git a/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch b/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch new file mode 100644 index 0000000000000..3ab0f79114118 --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 69deeaf..4623ab2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,7 +91,10 @@ else() + #add_library(${PROJECT_NAME} STATIC ${SRCS}) + add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP}) + endif() +- ++if(AMQP-CPP_LINUX_TCP) ++find_package(OpenSSL REQUIRED) ++target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto) ++endif() + # install rules + # ------------------------------------------------------------------------------------------------------ + +@@ -100,7 +103,7 @@ if(AMQP-CPP_BUILD_SHARED) + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ) + else() + # copy static lib diff --git a/recipes/amqp-cpp/all/test_package/CMakeLists.txt b/recipes/amqp-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dcd602f230785 --- /dev/null +++ b/recipes/amqp-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(amqpcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE amqpcpp) +if(amqpcpp_VERSION VERSION_LESS "4.3.20") +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/amqp-cpp/all/test_package/conanfile.py b/recipes/amqp-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/amqp-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/amqp-cpp/all/test_package/test_package.cpp b/recipes/amqp-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1cdb0b370f0ca --- /dev/null +++ b/recipes/amqp-cpp/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#if defined(_WIN32) +#define NOMINMAX +#endif +#include + +#include +#include + +int +main(int argc, char **argv) +{ + const std::string s = "Hello, World!"; + AMQP::ByteBuffer buffer(s.data(), s.size()); + if (buffer.size() == 13) + std::cout << "Done" << std::endl; + else + std::cout << "Wrong buffer of " << buffer.size() << std::endl; + return 0; +} diff --git a/recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt b/recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/amqp-cpp/all/test_v1_package/conanfile.py b/recipes/amqp-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/amqp-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/amqp-cpp/config.yml b/recipes/amqp-cpp/config.yml new file mode 100644 index 0000000000000..31f91dc40c919 --- /dev/null +++ b/recipes/amqp-cpp/config.yml @@ -0,0 +1,19 @@ +versions: + "4.3.24": + folder: all + "4.3.18": + folder: all + "4.3.16": + folder: all + "4.3.11": + folder: all + "4.3.10": + folder: all + "4.2.1": + folder: all + "4.1.7": + folder: all + "4.1.6": + folder: all + "4.1.5": + folder: all diff --git a/recipes/andreasbuhr-cppcoro/all/CMakeLists.txt b/recipes/andreasbuhr-cppcoro/all/CMakeLists.txt new file mode 100644 index 0000000000000..fe06f4e0b9505 --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper CXX) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/andreasbuhr-cppcoro/all/conandata.yml b/recipes/andreasbuhr-cppcoro/all/conandata.yml new file mode 100644 index 0000000000000..8db5685072de7 --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210113": + url: "https://github.com/andreasbuhr/cppcoro/archive/7cc9433436fe8f2482138019cfaafce8e1d7a896.zip" + sha256: "5edc72bb19616ae5b794c7d83f9a5d4973f32c966f1966ab81779d3a38b36a2c" diff --git a/recipes/andreasbuhr-cppcoro/all/conanfile.py b/recipes/andreasbuhr-cppcoro/all/conanfile.py new file mode 100644 index 0000000000000..2acc06b34e08b --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/all/conanfile.py @@ -0,0 +1,112 @@ +import os +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.33.0" + +class AndreasbuhrCppCoroConan(ConanFile): + name = "andreasbuhr-cppcoro" + description = "A library of C++ coroutine abstractions for the coroutines TS" + topics = ("conan", "cpp", "async", "coroutines") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/andreasbuhr/cppcoro" + license = "MIT" + settings = "os", "compiler", "build_type", "arch" + provides = "cppcoro" + + exports_sources = "CMakeLists.txt" + generators = "cmake" + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "gcc": "10", + "clang": "8", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + # We can't simply check for C++20, because clang and MSVC support the coroutine TS despite not having labeled (__cplusplus macro) C++20 support + 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 coroutine TS support. The current compiler {} {} does not support it.".format( + self.name, self.settings.compiler, self.settings.compiler.version)) + + # Currently clang expects coroutine to be implemented in a certain way (under std::experiemental::), while libstdc++ puts them under std:: + # There are also other inconsistencies, see https://bugs.llvm.org/show_bug.cgi?id=48172 + # This should be removed after both gcc and clang implements the final coroutine TS + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration("{} does not support clang with libstdc++. Use libc++ instead.".format(self.name)) + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + if self.settings.os == "Windows" and self.options.shared: + self._cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = "ON" + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "cppcoro" + self.cpp_info.filenames["cmake_find_package_multi"] = "cppcoro" + self.cpp_info.names["cmake_find_package"] = "cppcoro" + self.cpp_info.names["cmake_find_package_multi"] = "cppcoro" + + comp = self.cpp_info.components["cppcoro"] + comp.names["cmake_find_package"] = "cppcoro" + comp.names["cmake_find_package_multi"] = "cppcoro" + comp.libs = ["cppcoro"] + + if self.settings.os == "Linux" and self.options.shared: + comp.system_libs = ["pthread"] + if self.settings.os == "Windows": + comp.system_libs = ["synchronization"] + + if self.settings.compiler == "Visual Studio": + comp.cxxflags.append("/await") + elif self.settings.compiler == "gcc": + comp.cxxflags.append("-fcoroutines") + comp.defines.append("CPPCORO_COMPILER_SUPPORTS_SYMMETRIC_TRANSFER=1") + elif self.settings.compiler == "clang" or self.settings.compiler == "apple-clang": + comp.cxxflags.append("-fcoroutines-ts") diff --git a/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt b/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c6a625130a35 --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(cppcoro CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cppcoro::cppcoro) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) diff --git a/recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py b/recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..910ae60d10438 --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +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/andreasbuhr-cppcoro/all/test_package/test_package.cpp b/recipes/andreasbuhr-cppcoro/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..303b1be48d2f2 --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include + +cppcoro::generator intYielder() { + co_yield 0; + co_yield 1; +} + +cppcoro::task task() { + co_return 42; +} + +int main() { + auto _ = cppcoro::sync_wait(task()); + + std::vector v; + for (int n : intYielder()) { + std::cout << "yielded " << n << '\n'; + v.push_back(n); + } + + bool success = v[0] == 0 && v[1] == 1; + if (success) { + std::cout << "success"; + return 0; + } else { + return 1; + } +} diff --git a/recipes/andreasbuhr-cppcoro/config.yml b/recipes/andreasbuhr-cppcoro/config.yml new file mode 100644 index 0000000000000..1ae5eab0b9b8f --- /dev/null +++ b/recipes/andreasbuhr-cppcoro/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210113": + folder: "all" diff --git a/recipes/android-ndk/all/cmake-wrapper b/recipes/android-ndk/all/cmake-wrapper new file mode 100755 index 0000000000000..47d0305a87d07 --- /dev/null +++ b/recipes/android-ndk/all/cmake-wrapper @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +echo "Calling CMake via Android-NDK wrapper" + +ALL_ARGS=$@ + +BUILD=no +for i in "$@": +do + case $i in + --build) + BUILD=yes + ;; + *) + ;; + esac +done + +# https://gitlab.kitware.com/cmake/cmake/issues/18739 Android: NDK r19 support +# https://github.com/conan-io/conan/issues/2402 Android and CONAN_LIBCXX do not play well together +# https://github.com/conan-io/conan/issues/4537 Pass ANDROID_ABI & ANDROID_NDK variables to cmake +# https://github.com/conan-io/conan/issues/4629 set(CMAKE_FIND_ROOT_PATH_MODE_* ONLY) when cross-compiling, for Android at least + +if [ $BUILD == "yes" ]; then + cmake "$@" +else + cmake \ + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=$CMAKE_FIND_ROOT_PATH_MODE_PROGRAM \ + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=$CMAKE_FIND_ROOT_PATH_MODE_LIBRARY \ + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=$CMAKE_FIND_ROOT_PATH_MODE_INCLUDE \ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=$CMAKE_FIND_ROOT_PATH_MODE_PACKAGE \ + -DANDROID_STL=$ANDROID_STL \ + -DANDROID_NDK=$ANDROID_NDK \ + -DANDROID_ABI=$ANDROID_ABI \ + -DANDROID_PLATFORM=$ANDROID_PLATFORM \ + -DANDROID_TOOLCHAIN=$ANDROID_TOOLCHAIN \ + -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL \ + "$@" +fi diff --git a/recipes/android-ndk/all/cmake-wrapper.cmd b/recipes/android-ndk/all/cmake-wrapper.cmd new file mode 100644 index 0000000000000..626324e2da8ab --- /dev/null +++ b/recipes/android-ndk/all/cmake-wrapper.cmd @@ -0,0 +1,35 @@ +@echo off + +set BUILD=no + +for %%i in (%*) do ( + + if %%i==--build set BUILD=yes +) + + +if %BUILD%==yes ( + +cmake %* + +) else ( + +REM https://gitlab.kitware.com/cmake/cmake/issues/18739 Android: NDK r19 support +REM https://github.com/conan-io/conan/issues/2402 Android and CONAN_LIBCXX do not play well together +REM https://github.com/conan-io/conan/issues/4537 Pass ANDROID_ABI & ANDROID_NDK variables to cmake +REM https://github.com/conan-io/conan/issues/4629 set(CMAKE_FIND_ROOT_PATH_MODE_* ONLY) when cross-compiling, for Android at least + +cmake ^ + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=%CMAKE_FIND_ROOT_PATH_MODE_PROGRAM% ^ + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=%CMAKE_FIND_ROOT_PATH_MODE_LIBRARY% ^ + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=%CMAKE_FIND_ROOT_PATH_MODE_INCLUDE% ^ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=%CMAKE_FIND_ROOT_PATH_MODE_PACKAGE% ^ + -DANDROID_STL=%ANDROID_STL% ^ + -DANDROID_NDK=%ANDROID_NDK% ^ + -DANDROID_ABI=%ANDROID_ABI% ^ + -DANDROID_PLATFORM=%ANDROID_PLATFORM% ^ + -DANDROID_TOOLCHAIN=%ANDROID_TOOLCHAIN% ^ + -DANDROID_NATIVE_API_LEVEL=%ANDROID_NATIVE_API_LEVEL% ^ + %* + +) diff --git a/recipes/android-ndk/all/conandata.yml b/recipes/android-ndk/all/conandata.yml new file mode 100644 index 0000000000000..3276410e65493 --- /dev/null +++ b/recipes/android-ndk/all/conandata.yml @@ -0,0 +1,144 @@ +sources: + "r25c": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25c-windows.zip" + sha256: "f70093964f6cbbe19268f9876a20f92d3a593db3ad2037baadd25fd8d71e84e2" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25c-linux.zip" + sha256: "769ee342ea75f80619d985c2da990c48b3d8eaf45f48783a2d48870d04b46108" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25c-darwin.zip" + sha256: "b01bae969a5d0bfa0da18469f650a1628dc388672f30e0ba231da5c74245bc92" + "r25b": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25b-windows.zip" + sha256: "c9a72beda4663ab714c9fb3dc06bb9b9f124f2b5199957c86cd6f57eb59fd49a" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" + sha256: "403ac3e3020dd0db63a848dcaba6ceb2603bf64de90949d5c4361f848e44b005" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25b-darwin.zip" + sha256: "7e12f1f809878d4f5d5a901809277aa31546d36c10730fade2036d7d95b3607a" + "r25": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25-windows.zip" + sha256: "bdb25e75647532f979844f549a33eaf75c54a2cb4367f349be187ae9bfee9234" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25-linux.zip" + sha256: "cd661aeda5d9b7cfb6e64bd80737c274d7c1c0d026df2f85be3bf3327b25e545" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r25-darwin.zip" + sha256: "2373424b91bba4cdd15e4c82e05f77a44ba3617aa3329843958ea3d0e25e62d0" + "r24": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r24-windows.zip" + sha256: "b2a9fab1481c3c21df0b78608747dde0747b50890134a62a81c983a5250066d6" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r24-linux.zip" + sha256: "caac638f060347c9aae994e718ba00bb18413498d8e0ad4e12e1482964032997" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r24-darwin.zip" + sha256: "162a7000515be07489f2ed70d6d3a117d236150f83f3fcb601c163349429ba23" + "r23c": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23c-windows.zip" + sha256: "48a0a7b38fb1c69cae6d17b70e03aab8d6138e65a30f8d3faebeb0dc09bf6940" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23c-linux.zip" + sha256: "6ce94604b77d28113ecd588d425363624a5228d9662450c48d2e4053f8039242" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23c-darwin.zip" + sha256: "baf793127741eda36f2eabe69cdec23a70c814deb3c75df8744af35aed21e59d" + "r23b": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23b-windows.zip" + sha256: "36270f8b2cfdd940f410bd8ffe6ce86ffaa8e87ff1c4fd4a8be5130268357778" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23b-linux.zip" + sha256: "c6e97f9c8cfe5b7be0a9e6c15af8e7a179475b7ded23e2d1c1fa0945d6fb4382" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23b-darwin.zip" + sha256: "e067b7402fdae85bfbe8af1822afd573b8e73dce443a8292fdaeb2e8dc3aeb86" + "r23": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23-windows.zip" + sha256: "40325b5bfdb7f6de016ea3efee0468a7d306eda55a6f80966a501645ba01fbfa" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23-linux.zip" + sha256: "e3eacf80016b91d4cd2c8ca9f34eebd32df912bb799c859cc5450b6b19277b4f" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r23-darwin.zip" + sha256: "163ff3bb72306ffa814de35c49819bccae9df10855a4e3fbba52ad4111fcccae" + "r22b": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r22b-windows-x86_64.zip" + sha256: "6d2fe8dbba8342634e88ecbaf321bcbfc07e579b6281f426639002dd35046d03" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r22b-linux-x86_64.zip" + sha256: "ac3a0421e76f71dd330d0cd55f9d99b9ac864c4c034fc67e0d671d022d4e806b" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r22b-darwin-x86_64.zip" + sha256: "b05d2087a6346d66cd26a1dc89fcc877b59e49feab6269b665aa67c784a81512" + "r22": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r22-windows-x86_64.zip" + sha256: "5a0eafa83c8bba3c76e8427aa3d83d169215f62963a277b1914a3651aa47f751" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip" + sha256: "d37fc69cd81e5660234a686e20adef39bc0244086e4d66525a40af771c020718" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r22-darwin-x86_64.zip" + sha256: "14fce4dea7fb3facbc0e3d20270007bffec3ba383aec02e8b0e0dad8d8782892" + "r21e": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r21e-windows-x86_64.zip" + sha256: "f71307c5c572e2c163d602b3704b8bc024bec0c43ba2800de36bd10f3a21492b" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip" + sha256: "ad7ce5467e18d40050dc51b8e7affc3e635c85bd8c59be62de32352328ed467e" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r21e-darwin-x86_64.zip" + sha256: "437278103a3db12632c05b1be5c41bbb8522791a67e415cc54411a65366f499d" + "r21d": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip" + sha256: "18335e57f8acab5a4acf6a2204130e64f99153015d55eb2667f8c28d4724d927" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip" + sha256: "dd6dc090b6e2580206c64bcee499bc16509a5d017c6952dcd2bed9072af67cbd" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r21d-darwin-x86_64.zip" + sha256: "5851115c6fc4cce26bc320295b52da240665d7ff89bda2f5d5af1887582f5c48" diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py new file mode 100644 index 0000000000000..7d9d0cacc05ec --- /dev/null +++ b/recipes/android-ndk/all/conanfile.py @@ -0,0 +1,402 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, download, unzip, load, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os +import re +import shutil + +required_conan_version = ">=1.52.0" + + +class AndroidNDKConan(ConanFile): + name = "android-ndk" + description = "The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://developer.android.com/ndk/" + topics = ("android", "ndk", "toolchain", "compiler") + license = "Apache-2.0" + + settings = "os", "arch", "build_type", "compiler" + + short_paths = True + exports_sources = "cmake-wrapper.cmd", "cmake-wrapper" + + def _is_universal2(self, info=False): + settings = self.info.settings if info else self.settings + major, minor = self._ndk_major_minor + return ((major == 23 and minor >= "b") or major >= 24) and \ + settings.os == "Macos" and settings.arch in ["x86_64", "armv8"] + + @property + def _arch(self): + return "x86_64" if self._is_universal2() else self.settings.arch + + @property + def _settings_os_supported(self): + return self.conan_data["sources"][self.version].get(str(self.settings.os)) is not None + + @property + def _settings_arch_supported(self): + return self.conan_data["sources"][self.version].get(str(self.settings.os), {}).get(str(self._arch)) is not None + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + if self._is_universal2(info=True): + self.info.settings.arch = "universal:armv8/x86_64" + del self.info.settings.compiler + del self.info.settings.build_type + + def validate(self): + if not self._settings_os_supported: + raise ConanInvalidConfiguration(f"os={self.settings.os} is not supported by {self.name} (no binaries are available)") + if not self._settings_arch_supported: + raise ConanInvalidConfiguration(f"os,arch={self.settings.os},{self.settings.arch} is not supported by {self.name} (no binaries are available)") + + def source(self): + pass + + def build(self): + major, _ = self._ndk_major_minor + if major >= 23: + data = self.conan_data["sources"][self.version][str(self.settings.os)][str(self._arch)] + self._unzip_fix_symlinks(url=data["url"], target_folder=self.source_folder, sha256=data["sha256"]) + else: + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][str(self._arch)], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "*", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + copy(self, "*NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*NOTICE.toolchain", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "cmake-wrapper.cmd", src=os.path.join(self.source_folder, os.pardir), dst=os.path.join(self.package_folder, "bin")) + copy(self, "cmake-wrapper", src=os.path.join(self.source_folder, os.pardir), dst=os.path.join(self.package_folder, "bin")) + self._fix_broken_links() + self._fix_permissions() + + # from here on, everything is assumed to run in 2 profile mode, using this android-ndk recipe as a build requirement + + @property + def _platform(self): + return { + "Linux": "linux", + "Macos": "darwin", + "Windows": "windows", + }.get(str(self.settings_build.os)) + + @property + def _android_abi(self): + return { + "armv7": "armeabi-v7a", + "armv8": "arm64-v8a", + "x86": "x86", + "x86_64": "x86_64", + }.get(str(self.settings_target.arch)) + + @property + def _llvm_triplet(self): + arch = { + "armv7": "arm", + "armv8": "aarch64", + "x86": "i686", + "x86_64": "x86_64", + }.get(str(self.settings_target.arch)) + abi = "androideabi" if self.settings_target.arch == "armv7" else "android" + return f"{arch}-linux-{abi}" + + @property + def _clang_triplet(self): + arch = { + "armv7": "armv7a", + "armv8": "aarch64", + "x86": "i686", + "x86_64": "x86_64", + }.get(str(self.settings_target.arch)) + abi = "androideabi" if self.settings_target.arch == "armv7" else "android" + return f"{arch}-linux-{abi}" + + @property + def _ndk_major_minor(self): + match = re.search(r"r(\d+)(\w?)", self.version) + assert match + major, minor = match.groups() + assert major + return int(major), minor if minor else "a" + + @property + def _ndk_version_major(self): + return self._ndk_major_minor[0] + + @property + def _ndk_version_minor(self): + return self._ndk_major_minor[1] + + def _fix_permissions(self): + if os.name != "posix": + return + for root, _, files in os.walk(os.path.join(self.package_folder, "bin")): + for filename in files: + filename = os.path.join(root, filename) + with open(filename, "rb") as f: + sig = f.read(4) + if isinstance(sig, str): + sig = [ord(s) for s in sig] + else: + sig = list(sig) + if len(sig) > 2 and sig[0] == 0x23 and sig[1] == 0x21: + self.output.info(f"chmod on script file: '{filename}'") + self._chmod_plus_x(filename) + elif sig == [0x7F, 0x45, 0x4C, 0x46]: + self.output.info(f"chmod on ELF file: '{filename}'") + self._chmod_plus_x(filename) + elif sig in ( + [0xCA, 0xFE, 0xBA, 0xBE], + [0xBE, 0xBA, 0xFE, 0xCA], + [0xFE, 0xED, 0xFA, 0xCF], + [0xCF, 0xFA, 0xED, 0xFE], + [0xFE, 0xEF, 0xFA, 0xCE], + [0xCE, 0xFA, 0xED, 0xFE] + ): + self.output.info(f"chmod on Mach-O file: '{filename}'") + self._chmod_plus_x(filename) + + def _fix_broken_links(self): + # https://github.com/android/ndk/issues/1671 + # https://github.com/android/ndk/issues/1569 + if self.version in ["r23b", "r23c"] and self.settings.os in ["Linux", "Macos"]: + platform = "darwin" if self.settings.os == "Macos" else "linux" + links = {f"toolchains/llvm/prebuilt/{platform}-x86_64/aarch64-linux-android/bin/as": "../../bin/aarch64-linux-android-as", + f"toolchains/llvm/prebuilt/{platform}-x86_64/arm-linux-androideabi/bin/as": "../../bin/arm-linux-androideabi-as", + f"toolchains/llvm/prebuilt/{platform}-x86_64/x86_64-linux-android/bin/as": "../../bin/x86_64-linux-android-as", + f"toolchains/llvm/prebuilt/{platform}-x86_64/i686-linux-android/bin/as": "../../bin/i686-linux-android-as"} + for path, target in links.items(): + path = os.path.join(self.package_folder, "bin", path) + os.unlink(path) + os.symlink(target, path) + + @property + def _host(self): + return f"{self._platform}-{self._arch}" + + @property + def _ndk_root_rel_path(self): + return os.path.join("bin", "toolchains", "llvm", "prebuilt", self._host) + + @property + def _ndk_root(self): + return os.path.join(self.package_folder, self._ndk_root_rel_path) + + def _wrap_executable(self, tool): + suffix = ".exe" if self.settings_build.os == "Windows" else "" + return f"{tool}{suffix}" + + def _tool_name(self, tool, bare=False): + prefix = "" + if "clang" in tool: + suffix = ".cmd" if self.settings_build.os == "Windows" else "" + prefix = "llvm" if bare else f"{self._clang_triplet}{self.settings_target.os.api_level}" + return f"{prefix}-{tool}{suffix}" + else: + prefix = "llvm" if bare else f"{self._llvm_triplet}" + executable = f"{prefix}-{tool}" + return self._wrap_executable(executable) + + @property + def _cmake_system_processor(self): + cmake_system_processor = { + "x86_64": "x86_64", + "x86": "i686", + "mips": "mips", + "mips64": "mips64", + }.get(str(self.settings.arch)) + if self.settings_target.arch == "armv8": + cmake_system_processor = "aarch64" + elif "armv7" in str(self.settings.arch): + cmake_system_processor = "armv7-a" + elif "armv6" in str(self.settings.arch): + cmake_system_processor = "armv6" + elif "armv5" in str(self.settings.arch): + cmake_system_processor = "armv5te" + return cmake_system_processor + + def _define_tool_var(self, name, value, bare = False): + ndk_bin = os.path.join(self._ndk_root, "bin") + path = os.path.join(ndk_bin, self._tool_name(value, bare)) + if not os.path.isfile(path): + self.output.error(f"'Environment variable {name} could not be created: '{path}'") + return "UNKNOWN" + return path + + def _define_tool_var_naked(self, name, value): + ndk_bin = os.path.join(self._ndk_root, "bin") + path = os.path.join(ndk_bin, self._wrap_executable(value)) + if not os.path.isfile(path): + self.output.error(f"'Environment variable {name} could not be created: '{path}'") + return "UNKNOWN" + return path + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # You should use the ANDROID_NDK_ROOT environment variable to indicate where the NDK is located. + # That's what most NDK-related scripts use (inside the NDK, and outside of it). + # https://groups.google.com/g/android-ndk/c/qZjhOaynHXc + self.buildenv_info.define_path("ANDROID_NDK_ROOT", os.path.join(self.package_folder, "bin")) + + self.buildenv_info.define_path("ANDROID_NDK_HOME", os.path.join(self.package_folder, "bin")) + + # this is not enough, I can kill that ..... + if not hasattr(self, "settings_target"): + return + + # interestingly I can reach that with + # conan test --profile:build nsdk-default --profile:host default /Users/a4z/elux/conan/myrecipes/android-ndk/all/test_package android-ndk/r21d@ + if self.settings_target is None: + return + + # And if we are not building for Android, why bother at all + if not self.settings_target.os == "Android": + self.output.warning(f"You've added {self.ref} as a build requirement, while os={self.settings_target.os} != Android") + return + + self.cpp_info.bindirs.append(os.path.join(self._ndk_root_rel_path, "bin")) + + self.buildenv_info.define_path("NDK_ROOT", self._ndk_root) + + self.buildenv_info.define("CHOST", self._llvm_triplet) + + ndk_sysroot = os.path.join(self._ndk_root, "sysroot") + self.conf_info.define("tools.build:sysroot", ndk_sysroot) + self.buildenv_info.define_path("SYSROOT", ndk_sysroot) + + self.buildenv_info.define("ANDROID_NATIVE_API_LEVEL", str(self.settings_target.os.api_level)) + + # CMakeToolchain automatically adds the standard Android toolchain file that ships with the NDK + # when `tools.android:ndk_path` is provided, so it MUST NOT be manually injected here to `tools.cmake.cmaketoolchain:user_toolchain` conf_info + self.conf_info.define("tools.android:ndk_path", os.path.join(self.package_folder, "bin")) + + compiler_executables = { + "c": self._define_tool_var("CC", "clang"), + "cpp": self._define_tool_var("CXX", "clang++"), + } + 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"]) + + # 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)) + self.buildenv_info.define_path("NM", self._define_tool_var("NM", "nm", bare)) + self.buildenv_info.define_path("OBJCOPY", self._define_tool_var("OBJCOPY", "objcopy", bare)) + self.buildenv_info.define_path("OBJDUMP", self._define_tool_var("OBJDUMP", "objdump", bare)) + self.buildenv_info.define_path("READELF", self._define_tool_var("READELF", "readelf", bare)) + # there doesn't seem to be an 'elfedit' included anymore. + 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) + libcxx_str = str(self.settings_target.compiler.libcxx) + self.buildenv_info.define("ANDROID_STL", libcxx_str if libcxx_str.startswith("c++_") else "c++_shared") + + # TODO: conan v1 stuff to remove later + if Version(conan_version).major < 2: + self.env_info.PATH.extend([os.path.join(self.package_folder, "bin"), os.path.join(self._ndk_root, "bin")]) + self.env_info.ANDROID_NDK_ROOT = os.path.join(self.package_folder, "bin") + self.env_info.ANDROID_NDK_HOME = os.path.join(self.package_folder, "bin") + cmake_system_processor = self._cmake_system_processor + if cmake_system_processor: + self.env_info.CONAN_CMAKE_SYSTEM_PROCESSOR = cmake_system_processor + else: + self.output.warning("Could not find a valid CMAKE_SYSTEM_PROCESSOR variable, supported by CMake") + self.env_info.NDK_ROOT = self._ndk_root + self.env_info.CHOST = self._llvm_triplet + self.env_info.CONAN_CMAKE_FIND_ROOT_PATH = ndk_sysroot + self.env_info.SYSROOT = ndk_sysroot + self.env_info.ANDROID_NATIVE_API_LEVEL = str(self.settings_target.os.api_level) + self._chmod_plus_x(os.path.join(self.package_folder, "bin", "cmake-wrapper")) + cmake_wrapper = "cmake-wrapper.cmd" if self.settings.os == "Windows" else "cmake-wrapper" + cmake_wrapper = os.path.join(self.package_folder, "bin", cmake_wrapper) + self.env_info.CONAN_CMAKE_PROGRAM = cmake_wrapper + self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = os.path.join(self.package_folder, "bin", "build", "cmake", "android.toolchain.cmake") + self.env_info.CC = compiler_executables["c"] + self.env_info.CXX = compiler_executables["cpp"] + self.env_info.AR = self._define_tool_var("AR", "ar", bare) + self.env_info.AS = self._define_tool_var("AS", "as", bare) + self.env_info.RANLIB = self._define_tool_var("RANLIB", "ranlib", bare) + self.env_info.STRIP = self._define_tool_var("STRIP", "strip", bare) + self.env_info.ADDR2LINE = self._define_tool_var("ADDR2LINE", "addr2line", bare) + self.env_info.NM = self._define_tool_var("NM", "nm", bare) + self.env_info.OBJCOPY = self._define_tool_var("OBJCOPY", "objcopy", bare) + self.env_info.OBJDUMP = self._define_tool_var("OBJDUMP", "objdump", bare) + self.env_info.READELF = self._define_tool_var("READELF", "readelf", bare) + if self._ndk_version_major < 23: + self.env_info.ELFEDIT = self._define_tool_var("ELFEDIT", "elfedit") + if self._ndk_version_major >= 22: + self.env_info.LD = self._define_tool_var_naked("LD", "ld") + else: + self.env_info.LD = self._define_tool_var("LD", "ld") + self.env_info.ANDROID_PLATFORM = f"android-{self.settings_target.os.api_level}" + self.env_info.ANDROID_TOOLCHAIN = "clang" + self.env_info.ANDROID_ABI = self._android_abi + self.env_info.ANDROID_STL = libcxx_str if libcxx_str.startswith("c++_") else "c++_shared" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = "BOTH" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = "BOTH" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = "BOTH" + + def _unzip_fix_symlinks(self, url, target_folder, sha256): + # Python's built-in module 'zipfile' won't handle symlinks (https://bugs.python.org/issue37921) + # Most of the logic borrowed from this PR https://github.com/conan-io/conan/pull/8100 + + filename = "android_sdk.zip" + download(self, url, filename, sha256=sha256) + unzip(self, filename, destination=target_folder, strip_root=True) + + def is_symlink_zipinfo(zi): + return (zi.external_attr >> 28) == 0xA + + full_path = os.path.normpath(target_folder) + import zipfile + with zipfile.ZipFile(filename, "r") as z: + zip_info = z.infolist() + + names = [n.replace("\\", "/") for n in z.namelist()] + common_folder = os.path.commonprefix(names).split("/", 1)[0] + + for file_ in zip_info: + if is_symlink_zipinfo(file_): + rel_path = os.path.relpath(file_.filename, common_folder) + full_name = os.path.join(full_path, rel_path) + target = load(self, full_name) + os.unlink(full_name) + + try: + os.symlink(target, full_name) + except OSError: + if not os.path.isabs(target): + target = os.path.normpath(os.path.join(os.path.dirname(full_name), target)) + shutil.copy2(target, full_name) + + os.unlink(filename) diff --git a/recipes/android-ndk/all/test_package/CMakeLists.txt b/recipes/android-ndk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f776bcb524ea6 --- /dev/null +++ b/recipes/android-ndk/all/test_package/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/android-ndk/all/test_package/conanfile.py b/recipes/android-ndk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..db186fc2c369f --- /dev/null +++ b/recipes/android-ndk/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackgeConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + # INFO: 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 self.settings.os == "Windows": + self.run("ndk-build.cmd --version") + else: + self.run("ndk-build --version") + + # INFO: Run the project that was built using Android NDK + if self.settings.os == "Android": + test_file = os.path.join(self.cpp.build.bindirs[0], "test_package") + assert os.path.exists(test_file) diff --git a/recipes/android-ndk/all/test_package/test_package.cpp b/recipes/android-ndk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dc0f143f2972b --- /dev/null +++ b/recipes/android-ndk/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + std::cout << "conan-center-index\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt b/recipes/android-ndk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/android-ndk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/android-ndk/all/test_v1_package/conanfile.py b/recipes/android-ndk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e7a2d6060ddc7 --- /dev/null +++ b/recipes/android-ndk/all/test_v1_package/conanfile.py @@ -0,0 +1,32 @@ +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" + + 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 new file mode 100644 index 0000000000000..bf4ed9150d9a2 --- /dev/null +++ b/recipes/android-ndk/config.yml @@ -0,0 +1,23 @@ +versions: + "r25c": + folder: all + "r25b": + folder: all + "r25": + folder: all + "r24": + folder: all + "r23c": + folder: all + "r23b": + folder: all + "r23": + folder: all + "r22b": + folder: all + "r22": + folder: all + "r21e": + folder: all + "r21d": + folder: all diff --git a/recipes/angelscript/all/conandata.yml b/recipes/angelscript/all/conandata.yml new file mode 100644 index 0000000000000..1dec7ac1d3e71 --- /dev/null +++ b/recipes/angelscript/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "2.36.0": + url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.36.0.zip" + sha256: "33f95f7597bc0d88b097d35e7b1320d15419ffc5779851d9d2a6cccec57811b3" + "2.35.1": + url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.35.1.zip" + sha256: "5c1096b6d6cf50c7e77ae93c736d35b69b07b1e5047161c7816bca25b413a18b" + "2.35.0": + url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.35.0.zip" + sha256: "010dd45e23e734d46f5891d70e268607a12cb9ab12503dda42f842d9db7e8857" +patches: + "2.36.0": + - patch_file: "patches/2.36.0-0001-missing-include-stdint.patch" + patch_description: "Add missing stdint.h include" + patch_type: "portability" + sha256: "16d08c43a871a2ab4695e63829e9c07f9fab4237515185c1921e55c0b76483d3" + "2.35.1": + - patch_file: "patches/2.35.1-0001-fix-compatibility-apple-clang.patch" + patch_description: "Fix apple-clang compatibility of ASM arm" + patch_type: "portability" + patch_source: "https://github.com/codecat/angelscript-mirror/commit/7ec10a763d9c078b57c413b552a2d05c2638878f" + sha256: "6cd39d941cc9e674f5ec2f94d2dc0d2eec04dfb348bbc8956eb2c6e6f5b2b895" + "2.35.0": + - patch_file: "patches/2.35.0-0001-fix-compatibility-apple-clang.patch" + patch_description: "Fix apple-clang compatibility of ASM arm" + patch_type: "portability" + patch_source: "https://github.com/codecat/angelscript-mirror/commit/7ec10a763d9c078b57c413b552a2d05c2638878f" + sha256: "03446786a60dbf53e0e69385ae918dbc4004bcf1a64c14960d11b856f3b0c64a" diff --git a/recipes/angelscript/all/conanfile.py b/recipes/angelscript/all/conanfile.py new file mode 100644 index 0000000000000..174e1d9732354 --- /dev/null +++ b/recipes/angelscript/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.build import valid_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, get, export_conandata_patches, load, rmdir, save +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + + +class AngelScriptConan(ConanFile): + name = "angelscript" + license = "Zlib" + homepage = "http://www.angelcode.com/angelscript" + url = "https://github.com/conan-io/conan-center-index" + description = ( + "An extremely flexible cross-platform scripting library designed to " + "allow applications to extend their functionality through external scripts." + ) + topics = ("angelcode", "embedded", "scripting", "language", "compiler", "interpreter") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [False, True], + "fPIC": [False, True], + "no_exceptions": [False, True], + } + default_options = { + "shared": False, + "fPIC": True, + "no_exceptions": False, + } + + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + # Website blocks default user agent string. + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, + headers={"User-Agent": "ConanCenter"}, + strip_root=True, + ) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["AS_NO_EXCEPTIONS"] = self.options.no_exceptions + if not valid_min_cppstd(self, 11): + tc.variables["CMAKE_CXX_STANDARD"] = 11 + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "angelscript", "projects", "cmake")) + cmake.build() + + def _extract_license(self): + header = load(self, os.path.join(self.source_folder, "angelscript", "include", "angelscript.h")) + return header[header.find("/*", 1) + 3 : header.find("*/", 1)] + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + 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", "Angelscript") + self.cpp_info.set_property("cmake_target_name", "Angelscript::angelscript") + postfix = "d" if is_msvc(self) 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["_angelscript"].libs = [f"angelscript{postfix}"] + if self.settings.os in ("Linux", "FreeBSD", "SunOS"): + self.cpp_info.components["_angelscript"].system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Angelscript" + self.cpp_info.names["cmake_find_package_multi"] = "Angelscript" + self.cpp_info.components["_angelscript"].names["cmake_find_package"] = "angelscript" + self.cpp_info.components["_angelscript"].names["cmake_find_package_multi"] = "angelscript" + self.cpp_info.components["_angelscript"].set_property("cmake_target_name", "Angelscript::angelscript") diff --git a/recipes/angelscript/all/patches/2.35.0-0001-fix-compatibility-apple-clang.patch b/recipes/angelscript/all/patches/2.35.0-0001-fix-compatibility-apple-clang.patch new file mode 100644 index 0000000000000..acf1d8b621bbf --- /dev/null +++ b/recipes/angelscript/all/patches/2.35.0-0001-fix-compatibility-apple-clang.patch @@ -0,0 +1,30 @@ +--- a/angelscript/projects/cmake/CMakeLists.txt ++++ b/angelscript/projects/cmake/CMakeLists.txt +@@ -110,7 +110,9 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") + enable_language(ASM) + if(CMAKE_ASM_COMPILER_WORKS) + set(ANGELSCRIPT_SOURCE ${ANGELSCRIPT_SOURCE} ../../source/as_callfunc_arm.cpp ../../source/as_callfunc_arm_gcc.S) ++ if (NOT APPLE) + set_property(SOURCE ../../source/as_callfunc_arm_gcc.S APPEND PROPERTY COMPILE_FLAGS " -Wa,-mimplicit-it=always") ++ endif() + else() + message(FATAL ERROR "ARM target requires a working assembler") + endif() +--- a/angelscript/source/as_callfunc_arm64_gcc.S ++++ b/angelscript/source/as_callfunc_arm64_gcc.S +@@ -46,6 +46,7 @@ + .global CallARM64Float + .global CallARM64 + ++#if !defined(__MACH__) + .type GetHFAReturnDouble, %function + .type GetHFAReturnFloat, %function + .type CallARM64Ret128, %function +@@ -53,6 +54,7 @@ + .type CallARM64Double, %function + .type CallARM64Float, %function + .type CallARM64, %function ++#endif + + .align 2 + GetHFAReturnDouble: diff --git a/recipes/angelscript/all/patches/2.35.1-0001-fix-compatibility-apple-clang.patch b/recipes/angelscript/all/patches/2.35.1-0001-fix-compatibility-apple-clang.patch new file mode 100644 index 0000000000000..49ca65e890f7a --- /dev/null +++ b/recipes/angelscript/all/patches/2.35.1-0001-fix-compatibility-apple-clang.patch @@ -0,0 +1,18 @@ +--- a/angelscript/source/as_callfunc_arm64_gcc.S ++++ b/angelscript/source/as_callfunc_arm64_gcc.S +@@ -50,6 +50,7 @@ + .global CallARM64Float + .global CallARM64 + ++#if !defined(__MACH__) + .type GetHFAReturnDouble, %function + .type GetHFAReturnFloat, %function + .type CallARM64Ret128, %function +@@ -57,6 +58,7 @@ + .type CallARM64Double, %function + .type CallARM64Float, %function + .type CallARM64, %function ++#endif + + .align 2 + GetHFAReturnDouble: diff --git a/recipes/angelscript/all/patches/2.36.0-0001-missing-include-stdint.patch b/recipes/angelscript/all/patches/2.36.0-0001-missing-include-stdint.patch new file mode 100644 index 0000000000000..f2e883bacf543 --- /dev/null +++ b/recipes/angelscript/all/patches/2.36.0-0001-missing-include-stdint.patch @@ -0,0 +1,10 @@ +--- a/angelscript/source/as_context.cpp ++++ b/angelscript/source/as_context.cpp +@@ -36,6 +36,7 @@ + // + + #include // fmodf() pow() ++#include + + #include "as_config.h" + #include "as_context.h" diff --git a/recipes/angelscript/all/test_package/CMakeLists.txt b/recipes/angelscript/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee85cb2f6cc3c --- /dev/null +++ b/recipes/angelscript/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(Angelscript REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Angelscript::angelscript) diff --git a/recipes/angelscript/all/test_package/conanfile.py b/recipes/angelscript/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/angelscript/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/angelscript/all/test_package/test_package.cpp b/recipes/angelscript/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..06aaa43e191ef --- /dev/null +++ b/recipes/angelscript/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include + +int main() +{ + asIScriptEngine* const engine = asCreateScriptEngine(); + if (engine) { + std::cerr << "successfully created engine" << std::endl; + engine->ShutDownAndRelease(); + return 0; + } else { + std::cerr << "failed to create engine" << std::endl; + return 1; + } +} diff --git a/recipes/angelscript/all/test_v1_package/CMakeLists.txt b/recipes/angelscript/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/angelscript/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/angelscript/all/test_v1_package/conanfile.py b/recipes/angelscript/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a3b9c17e2ea29 --- /dev/null +++ b/recipes/angelscript/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class AngelScriptTestConan(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/angelscript/config.yml b/recipes/angelscript/config.yml new file mode 100644 index 0000000000000..22190418b16a2 --- /dev/null +++ b/recipes/angelscript/config.yml @@ -0,0 +1,7 @@ +versions: + "2.36.0": + folder: all + "2.35.1": + folder: all + "2.35.0": + folder: all diff --git a/recipes/antlr4-cppruntime/all/conandata.yml b/recipes/antlr4-cppruntime/all/conandata.yml new file mode 100644 index 0000000000000..cbefbe9948203 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/conandata.yml @@ -0,0 +1,42 @@ +sources: + "4.12.0": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.12.0.tar.gz" + sha256: "8b6050a2111a6bb6405cc5e9e7bca80c136548ac930e4b2c27566d1eb32f8aed" + "4.11.1": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.11.1.tar.gz" + sha256: "81f87f03bb83b48da62e4fc8bfdaf447efb9fb3b7f19eb5cbc37f64e171218cf" + "4.10.1": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.10.1.tar.gz" + sha256: "a320568b738e42735946bebc5d9d333170e14a251c5734e8b852ad1502efa8a2" + "4.9.3": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.9.3.tar.gz" + sha256: "efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae" +patches: + "4.11.1": + - patch_file: "patches/0002-update-FlatHashSet.patch" + patch_description: "Fix the compiler errors reported by GCC 7 due to the new type FlatHashSet introduced in 4.11." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/3885" + - patch_file: "patches/0003-update-FlatHashMap.patch" + patch_description: "Fix the compiler errors reported by GCC 7 due to the new type FlatHashMap introduced in 4.11." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/3885" + "4.10.1": + - patch_file: "patches/0004-update-DropLibuuid-4.10.x-1.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#1) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + - patch_file: "patches/0004-update-DropLibuuid-4.10.x-2.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#2) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + "4.9.3": + - patch_file: "patches/0001-update-cmakelist.patch" + - patch_file: "patches/0004-update-DropLibuuid-4.9.3-1.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#1) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + - patch_file: "patches/0004-update-DropLibuuid-4.9.3-2.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#2) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" diff --git a/recipes/antlr4-cppruntime/all/conanfile.py b/recipes/antlr4-cppruntime/all/conanfile.py new file mode 100644 index 0000000000000..99a6339b6c746 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/conanfile.py @@ -0,0 +1,177 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, check_min_vs +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir, save +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Antlr4CppRuntimeConan(ConanFile): + name = "antlr4-cppruntime" + homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" + description = "C++ runtime support for ANTLR (ANother Tool for Language Recognition)" + topics = ("antlr", "parser", "runtime") + url = "https://github.com/conan-io/conan-center-index" + license = "BSD-3-Clause" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + short_paths = True + + @property + def _min_cppstd(self): + # Antlr 4.9.3 requires C++11 while newer versions require C++17 + return "17" if Version(self.version) >= "4.10" else "11" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "7", + "clang": "5", + "apple-clang": "9.1", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # 1. As of 4.10, antlr4-cppruntime no longer requires `utfcpp`. + # Reference: [C++] Implement standalone Unicode encoding and decoding handling + # Link: https://github.com/antlr/antlr4/pull/3398 + # 2. As of 4.11, antlr4-cppruntime no longer requires `libuuid`. + # Reference: [C++] Remove libuuid dependency + # Link: https://github.com/antlr/antlr4/pull/3787 + # Note that the above PR points that libuuid can be removed from 4.9.3, 4.10 and 4.10.1 as well. + # We have patched the CMakeLists.txt to drop the dependency on libuuid from aforementioned antlr versions. + if Version(self.version) < "4.10": + self.requires("utfcpp/3.2.3") + + def validate(self): + # Compilation of this library on version 15 claims C2668 Error. + # This could be Bogus error or malformed Antlr4 library. + # Guard: The minimum MSVC version is 16 or 1920 (which already supports C++17) + check_min_vs(self, "192") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ANTLR4_INSTALL"] = True + tc.variables["WITH_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++" + tc.variables["ANTLR_BUILD_CPP_TESTS"] = False + if is_msvc(self): + tc.cache_variables["WITH_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["WITH_DEMO"] = False + # As of ANTLR 4.12.0, one can choose to build the shared/static library only instead of both of them + # Related Issue: https://github.com/antlr/antlr4/issues/3993 + # Related PR: https://github.com/antlr/antlr4/pull/3996 + if Version(self.version) >= "4.12": + tc.variables["ANTLR_BUILD_SHARED"] = self.options.shared + tc.variables["ANTLR_BUILD_STATIC"] = not self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder="runtime/Cpp") + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if self.options.shared: + rm(self, "*antlr4-runtime-static.*", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "antlr4-runtime.lib", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.so*", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.dll*", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.*dylib", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # FIXME: this also removes lib/cmake/antlr4-generator + # This cmake config script is needed to provide the cmake function `antlr4_generate` + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + fix_apple_shared_install_name(self) + + # TODO: to remove in conan v2 once cmake_find_package* generatores removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"antlr4_shared" if self.options.shared else "antlr4_static": "antlr4-cppruntime::antlr4-cppruntime"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "antlr4-runtime") + self.cpp_info.set_property("cmake_target_name", "antlr4_shared" if self.options.shared else "antlr4_static") + libname = "antlr4-runtime" + if is_msvc(self) and not self.options.shared: + libname += "-static" + self.cpp_info.libs = [libname] + self.cpp_info.includedirs.append(os.path.join("include", "antlr4-runtime")) + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("ANTLR4CPP_STATIC") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["m", "pthread"] + elif is_apple_os(self): + self.cpp_info.frameworks = ["CoreFoundation"] + + # TODO: to remove in conan v2 once cmake_find_package* generatores removed + self.cpp_info.filenames["cmake_find_package"] = "antlr4-runtime" + self.cpp_info.filenames["cmake_find_package_multi"] = "antlr4-runtime" + 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/antlr4-cppruntime/all/patches/0001-update-cmakelist.patch b/recipes/antlr4-cppruntime/all/patches/0001-update-cmakelist.patch new file mode 100644 index 0000000000000..d42d778ee2d61 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0001-update-cmakelist.patch @@ -0,0 +1,13 @@ +--- runtime/Cpp/runtime/CMakeLists.txt ++++ runtime/Cpp/runtime/CMakeLists.txt +@@ -141,8 +141,8 @@ + COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}") + + install(TARGETS antlr4_shared +- DESTINATION lib +- EXPORT antlr4-targets) ++ EXPORT antlr4-targets ++ ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS antlr4_static + DESTINATION lib + EXPORT antlr4-targets) diff --git a/recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch b/recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch new file mode 100644 index 0000000000000..336271b756971 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch @@ -0,0 +1,15 @@ +--- runtime/Cpp/runtime/src/FlatHashSet.h ++++ runtime/Cpp/runtime/src/FlatHashSet.h +@@ -48,9 +48,9 @@ + using FlatHashSet = absl::flat_hash_set; + #else + template ::hasher, +- typename Equal = typename std::unordered_set::key_equal, +- typename Allocator = typename std::unordered_set::allocator_type> ++ typename Hash = std::hash, ++ typename Equal = std::equal_to, ++ typename Allocator = std::allocator> + using FlatHashSet = std::unordered_set; + #endif + diff --git a/recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch b/recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch new file mode 100644 index 0000000000000..e841ee8933643 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch @@ -0,0 +1,15 @@ +--- runtime/Cpp/runtime/src/FlatHashMap.h ++++ runtime/Cpp/runtime/src/FlatHashMap.h +@@ -48,9 +48,9 @@ + using FlatHashMap = absl::flat_hash_map; + #else + template ::hasher, +- typename Equal = typename std::unordered_map::key_equal, +- typename Allocator = typename std::unordered_map::allocator_type> ++ typename Hash = std::hash, ++ typename Equal = std::equal_to, ++ typename Allocator = std::allocator>> + using FlatHashMap = std::unordered_map; + #endif + diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch new file mode 100644 index 0000000000000..52e813be947a8 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch @@ -0,0 +1,13 @@ +--- runtime/Cpp/CMakeLists.txt ++++ runtime/Cpp/CMakeLists.txt +@@ -41,10 +41,6 @@ + CMAKE_POLICY(SET CMP0054 OLD) + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- find_package(PkgConfig REQUIRED) +- pkg_check_modules(UUID REQUIRED uuid) +-endif() + if(APPLE) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + endif() diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch new file mode 100644 index 0000000000000..f1fffa5599c8b --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch @@ -0,0 +1,14 @@ +--- runtime/Cpp/runtime/CMakeLists.txt ++++ runtime/Cpp/runtime/CMakeLists.txt +@@ -69,10 +69,7 @@ + gtest_discover_tests(antlr4_tests) + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- target_link_libraries(antlr4_shared ${UUID_LIBRARIES}) +- target_link_libraries(antlr4_static ${UUID_LIBRARIES}) +-elseif(APPLE) ++if(APPLE) + target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY}) + target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY}) + endif() diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch new file mode 100644 index 0000000000000..6412c93b3d0b5 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch @@ -0,0 +1,13 @@ +--- runtime/Cpp/CMakeLists.txt ++++ runtime/Cpp/CMakeLists.txt +@@ -39,10 +39,6 @@ + CMAKE_POLICY(SET CMP0054 OLD) + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- find_package(PkgConfig REQUIRED) +- pkg_check_modules(UUID REQUIRED uuid) +-endif() + if(APPLE) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + endif() diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch new file mode 100644 index 0000000000000..a9b062d8bea5a --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch @@ -0,0 +1,14 @@ +--- runtime/Cpp/runtime/CMakeLists.txt ++++ runtime/Cpp/runtime/CMakeLists.txt +@@ -75,10 +75,7 @@ + endif() + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- target_link_libraries(antlr4_shared ${UUID_LIBRARIES}) +- target_link_libraries(antlr4_static ${UUID_LIBRARIES}) +-elseif(APPLE) ++if(APPLE) + target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY}) + target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY}) + endif() diff --git a/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e4aff6ceb5ae4 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(antlr4-runtime REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(TARGET antlr4_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE antlr4_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE antlr4_static) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/antlr4-cppruntime/all/test_package/conanfile.py b/recipes/antlr4-cppruntime/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/antlr4-cppruntime/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/antlr4-cppruntime/all/test_package/test_package.cpp b/recipes/antlr4-cppruntime/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f8f8a195d6d57 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "antlr4-runtime/antlr4-runtime.h" + +int main(int argc, const char *args[]) +{ + antlr4::ANTLRInputStream input; + return 0; +} diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py b/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/antlr4-cppruntime/config.yml b/recipes/antlr4-cppruntime/config.yml new file mode 100644 index 0000000000000..58018c9cc3666 --- /dev/null +++ b/recipes/antlr4-cppruntime/config.yml @@ -0,0 +1,9 @@ +versions: + "4.12.0": + folder: all + "4.11.1": + folder: all + "4.10.1": + folder: all + "4.9.3": + folder: all diff --git a/recipes/any-lite/all/conandata.yml b/recipes/any-lite/all/conandata.yml new file mode 100644 index 0000000000000..50c84efb1a3d9 --- /dev/null +++ b/recipes/any-lite/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.4.0": + url: "https://github.com/martinmoene/any-lite/archive/v0.4.0.tar.gz" + sha256: "889549098291a1313d2fc8cd12dcdab13214d05cdce7ed5fe2dc724cdd7b3125" + "0.3.0": + url: "https://github.com/martinmoene/any-lite/archive/v0.3.0.tar.gz" + sha256: "fa7087ef7b4455c00b4b715649eb7176d6d0806c3a57cd4734845611ebe9888e" + "0.2.0": + url: "https://github.com/martinmoene/any-lite/archive/v0.2.0.tar.gz" + sha256: "945ac39f14273be742c8a060af100182e38920f641e5d8fa16699e74a09e9850" diff --git a/recipes/any-lite/all/conanfile.py b/recipes/any-lite/all/conanfile.py new file mode 100644 index 0000000000000..19f65824ca091 --- /dev/null +++ b/recipes/any-lite/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class AnyLiteConan(ConanFile): + name = "any-lite" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/any-lite" + description = ("any lite - A C++17-like any, a type-safe container for single values of \ + any type for C++98, C++11 and later in a single-file header-only library") + topics = ("cpp11", "cpp14", "cpp17", "any", "any-implementations") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "any-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::any-lite") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "any-lite" + self.cpp_info.filenames["cmake_find_package_multi"] = "any-lite" + self.cpp_info.names["cmake_find_package"] = "nonstd" + self.cpp_info.names["cmake_find_package_multi"] = "nonstd" + self.cpp_info.components["anylite"].names["cmake_find_package"] = "any-lite" + self.cpp_info.components["anylite"].names["cmake_find_package_multi"] = "any-lite" + self.cpp_info.components["anylite"].set_property("cmake_target_name", "nonstd::any-lite") diff --git a/recipes/any-lite/all/test_package/CMakeLists.txt b/recipes/any-lite/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..52b8d2bac37bb --- /dev/null +++ b/recipes/any-lite/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(any-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::any-lite) diff --git a/recipes/any-lite/all/test_package/conanfile.py b/recipes/any-lite/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/any-lite/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/any-lite/all/test_package/test_package.cpp b/recipes/any-lite/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d15222e00d25a --- /dev/null +++ b/recipes/any-lite/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include "nonstd/any.hpp" + +#include +#include + +using namespace nonstd; + +int main() +{ + const std::string hello = "hello, world"; + + any var; + + var = 'v' ; if( any_cast( var ) != 'v' ) throw std::exception(); + var = 7 ; if( any_cast( var ) != 7 ) throw std::exception(); + var = 42L ; if( any_cast( var ) != 42L ) throw std::exception(); + var = hello; if( any_cast( var ) != hello ) throw std::exception(); +} diff --git a/recipes/any-lite/all/test_v1_package/CMakeLists.txt b/recipes/any-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3d223cfc63eee --- /dev/null +++ b/recipes/any-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(any-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::any-lite) diff --git a/recipes/any-lite/all/test_v1_package/conanfile.py b/recipes/any-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/any-lite/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/any-lite/config.yml b/recipes/any-lite/config.yml new file mode 100644 index 0000000000000..8afd20f5689ba --- /dev/null +++ b/recipes/any-lite/config.yml @@ -0,0 +1,7 @@ +versions: + "0.4.0": + folder: all + "0.3.0": + folder: all + "0.2.0": + folder: all diff --git a/recipes/anyrpc/all/conandata.yml b/recipes/anyrpc/all/conandata.yml new file mode 100644 index 0000000000000..11c9a8b3eb434 --- /dev/null +++ b/recipes/anyrpc/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "1.0.2": + url: "https://github.com/sgieseking/anyrpc/archive/refs/tags/v1.0.2.tar.gz" + sha256: "236c9fa0ba417af945d950866c9671a1efa06506af8c86efa2e89ab67607969f" +patches: + "1.0.2": + - patch_file: "patches/0001-fix-asan-1.0.2.patch" + patch_description: "Handle ASAN flag properly in CMakeLists.txt" + patch_type: "portability" + patch_source: "https://github.com/sgieseking/anyrpc/pull/42" + - patch_file: "patches/0002-fix-shared-library-1.0.2.patch" + patch_description: "Fixed 'undefined reference' error when compile for windows platform" + patch_type: "portability" + patch_source: "https://github.com/sgieseking/anyrpc/pull/43" + - patch_file: "patches/0003-use-conan-libs-1.0.2.patch" + patch_description: "Link to conan libs" + patch_type: "conan" diff --git a/recipes/anyrpc/all/conanfile.py b/recipes/anyrpc/all/conanfile.py new file mode 100644 index 0000000000000..e5887586c576e --- /dev/null +++ b/recipes/anyrpc/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 CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.53.0" + + +class AnyRPCConan(ConanFile): + name = "anyrpc" + description = "A multiprotocol remote procedure call system for C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sgieseking/anyrpc" + topics = ("rpc",) + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_log4cplus": [True, False], + "with_threading": [True, False], + "with_regex": [True, False], + "with_wchar": [True, False], + "with_protocol_json": [True, False], + "with_protocol_xml": [True, False], + "with_protocol_messagepack": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_log4cplus": False, + "with_threading": True, + "with_wchar": True, + "with_regex": True, + "with_protocol_json": True, + "with_protocol_xml": True, + "with_protocol_messagepack": True, + } + + @property + def _min_cppstd(self): + return 11 + + 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): + if self.options.with_log4cplus: + self.requires("log4cplus/2.0.7") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if self.options.with_log4cplus and self.options.with_wchar: + raise ConanInvalidConfiguration(f"{self.ref} can not be built with both log4cplus and wchar, see https://github.com/sgieseking/anyrpc/issues/25") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ANYRPC_LIB_BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TEST"] = False + tc.variables["BUILD_WITH_ADDRESS_SANITIZE"] = False + tc.variables["BUILD_WITH_LOG4CPLUS"] = self.options.with_log4cplus + tc.variables["BUILD_WITH_THREADING"] = self.options.with_threading + tc.variables["BUILD_WITH_REGEX"] = self.options.with_regex + tc.variables["BUILD_WITH_WCHAR"] = self.options.with_wchar + tc.variables["BUILD_PROTOCOL_JSON"] = self.options.with_protocol_json + tc.variables["BUILD_PROTOCOL_XML"] = self.options.with_protocol_xml + tc.variables["BUILD_PROTOCOL_MESSAGEPACK"] = self.options.with_protocol_messagepack + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="license", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["anyrpc"] + if not self.options.shared and self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/anyrpc/all/patches/0001-fix-asan-1.0.2.patch b/recipes/anyrpc/all/patches/0001-fix-asan-1.0.2.patch new file mode 100644 index 0000000000000..23a8dc94863a2 --- /dev/null +++ b/recipes/anyrpc/all/patches/0001-fix-asan-1.0.2.patch @@ -0,0 +1,28 @@ +From 74b4fbb92b654a9483ef3ff64b708fda46bd7b2b Mon Sep 17 00:00:00 2001 +From: Falko Axmann +Date: Sun, 12 Jan 2020 12:43:00 +0100 +Subject: [PATCH] Handle ASAN flag properly in CMakeLists.txt + +Because of a typo ("else" instead of "elseif"), the +BUILD_WITH_ADDRESS_SANITIZE option was ignored and on +Linux, anyrpc would always be built with ASAN enabled. +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cfeb604..87991bb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,7 +63,7 @@ if (MSVC) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" ) + elseif (MINGW) + SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__STRICT_ANSI__" ) +-else (BUILD_WITH_ADDRESS_SANITIZE) ++elseif (BUILD_WITH_ADDRESS_SANITIZE) + SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer" ) + SET( ASAN_LIBRARY asan ) + endif () +-- +2.36.1.windows.1 + diff --git a/recipes/anyrpc/all/patches/0002-fix-shared-library-1.0.2.patch b/recipes/anyrpc/all/patches/0002-fix-shared-library-1.0.2.patch new file mode 100644 index 0000000000000..bb861d675230e --- /dev/null +++ b/recipes/anyrpc/all/patches/0002-fix-shared-library-1.0.2.patch @@ -0,0 +1,54 @@ +From c8ece5d572bf68a7d0f63405089a7a8d7d6206ee Mon Sep 17 00:00:00 2001 +From: "email@email.com" +Date: Fri, 31 Jul 2020 15:37:29 +0300 +Subject: [PATCH] fixed 'undefined reference' error when compile for windows + platform + +--- + include/anyrpc/json/jsonserver.h | 2 +- + include/anyrpc/messagepack/messagepackserver.h | 2 +- + include/anyrpc/xml/xmlserver.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/anyrpc/json/jsonserver.h b/include/anyrpc/json/jsonserver.h +index d883b16..000bbd4 100644 +--- a/include/anyrpc/json/jsonserver.h ++++ b/include/anyrpc/json/jsonserver.h +@@ -24,7 +24,7 @@ + namespace anyrpc + { + +-bool JsonRpcHandler(MethodManager* manager, char* request, std::size_t length, Stream &response); ++ANYRPC_API bool JsonRpcHandler(MethodManager* manager, char* request, std::size_t length, Stream &response); + + //////////////////////////////////////////////////////////////////////////////// + +diff --git a/include/anyrpc/messagepack/messagepackserver.h b/include/anyrpc/messagepack/messagepackserver.h +index cc708f8..708bd72 100644 +--- a/include/anyrpc/messagepack/messagepackserver.h ++++ b/include/anyrpc/messagepack/messagepackserver.h +@@ -24,7 +24,7 @@ + namespace anyrpc + { + +-bool MessagePackRpcHandler(MethodManager* manager, char* request, std::size_t length, Stream &response); ++ANYRPC_API bool MessagePackRpcHandler(MethodManager* manager, char* request, std::size_t length, Stream &response); + + //////////////////////////////////////////////////////////////////////////////// + +diff --git a/include/anyrpc/xml/xmlserver.h b/include/anyrpc/xml/xmlserver.h +index 5350ca5..fe0ed23 100644 +--- a/include/anyrpc/xml/xmlserver.h ++++ b/include/anyrpc/xml/xmlserver.h +@@ -24,7 +24,7 @@ + namespace anyrpc + { + +-bool XmlRpcHandler(MethodManager* manager, char* request, std::size_t length, Stream &response); ++ANYRPC_API bool XmlRpcHandler(MethodManager* manager, char* request, std::size_t length, Stream &response); + + //////////////////////////////////////////////////////////////////////////////// + +-- +2.36.1.windows.1 + diff --git a/recipes/anyrpc/all/patches/0003-use-conan-libs-1.0.2.patch b/recipes/anyrpc/all/patches/0003-use-conan-libs-1.0.2.patch new file mode 100644 index 0000000000000..b1c4f4b1d7f2e --- /dev/null +++ b/recipes/anyrpc/all/patches/0003-use-conan-libs-1.0.2.patch @@ -0,0 +1,44 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 2.8) + + Project(AnyRPC CXX) + +-# Some of the cmake find_package files are part of this distribution +-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +- + # Read out version from "version" file + file(STRINGS "version" ANYRPC_VERSION_FILE) + +@@ -91,7 +88,7 @@ CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/version.h.in" + "${PROJECT_SOURCE_DIR}/include/anyrpc/version.h" ) + + if (BUILD_WITH_LOG4CPLUS) +- find_package( Log4cplus ) +- if (NOT LOG4CPLUS_FOUND) ++ find_package( log4cplus ) ++ if (NOT log4cplus_FOUND) + # the find_package call for Log4cplus doesn't generate an error even if marked as required + message( FATAL_ERROR "LOG4CPLUS library required if BUILD_WITH_LOG4CPLUS on" ) + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -44,15 +44,15 @@ set(ANYRPC_HEADERS ${ANYRPC_HEADERS} ${ANYRPC_INTERNAL_HEADERS} + + # Add the necessary external library references + if (BUILD_WITH_LOG4CPLUS) +- include_directories(${LOG4CPLUS_INCLUDE_DIRS}) ++ set( LOG4CPLUS_TARGET "log4cplus::log4cplus" ) + add_definitions( -DBUILD_WITH_LOG4CPLUS ) + else () +- set( LOG4CPLUS_LIBRARIES "" ) ++ set( LOG4CPLUS_TARGET "" ) + endif () + + # Create the libraries with these header and source files + add_library( anyrpc ${ANYRPC_LIB_TYPE} ${ANYRPC_SOURCES} ${ANYRPC_HEADERS} ) +-target_link_libraries( anyrpc ${ASAN_LIBRARY} ${LOG4CPLUS_LIBRARIES}) ++target_link_libraries( anyrpc ${ASAN_LIBRARY} ${LOG4CPLUS_TARGET}) + + # Need the winsock library for Windows + if (WIN32) diff --git a/recipes/anyrpc/all/test_package/CMakeLists.txt b/recipes/anyrpc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9c6894d75a0f --- /dev/null +++ b/recipes/anyrpc/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_anyrpc CXX) + +find_package(anyrpc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_anyrpc.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE anyrpc::anyrpc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/anyrpc/all/test_package/conanfile.py b/recipes/anyrpc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7f2b358ed020e --- /dev/null +++ b/recipes/anyrpc/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 TestAnyRpcConan(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_anyrpc") + self.run(bin_path, env="conanrun") diff --git a/recipes/anyrpc/all/test_package/test_anyrpc.cpp b/recipes/anyrpc/all/test_package/test_anyrpc.cpp new file mode 100644 index 0000000000000..3a1af31f88b40 --- /dev/null +++ b/recipes/anyrpc/all/test_package/test_anyrpc.cpp @@ -0,0 +1,17 @@ +#include +#include + +#include "anyrpc/anyrpc.h" + +void testFunc(anyrpc::Value& params, anyrpc::Value& result) +{ +} + +int main(void) +{ + anyrpc::JsonHttpServer server; + anyrpc::MethodManager* methodManager = server.GetMethodManager(); + methodManager->AddFunction(&testFunc, "testFunc", "Test function"); + + return EXIT_SUCCESS; +} diff --git a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8272097b5b3da --- /dev/null +++ b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,6 @@ +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/anyrpc/all/test_v1_package/conanfile.py b/recipes/anyrpc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e946eccc88b51 --- /dev/null +++ b/recipes/anyrpc/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestAnyRpcV1Conan(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_anyrpc") + self.run(bin_path, run_environment=True) diff --git a/recipes/anyrpc/config.yml b/recipes/anyrpc/config.yml new file mode 100644 index 0000000000000..8457ca9a4a8cd --- /dev/null +++ b/recipes/anyrpc/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all diff --git a/recipes/approvaltests.cpp/all/conandata.yml b/recipes/approvaltests.cpp/all/conandata.yml new file mode 100644 index 0000000000000..b3f371f3d0cdd --- /dev/null +++ b/recipes/approvaltests.cpp/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "10.12.2": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.2/ApprovalTests.v.10.12.2.hpp + sha256: 4c43d0ea98669e3d6fbb5810cc47b19adaf88cabb1421b488aa306b08c434131 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.12.2/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "10.12.1": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.1/ApprovalTests.v.10.12.1.hpp + sha256: 5e87f2e4b39f027676c9259c3edd4a4a8078c0814cdfb371718ef0eb685477c2 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.12.1/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "10.12.0": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.0/ApprovalTests.v.10.12.0.hpp + sha256: 5084ad71b8cc73ea9d753685b652d8828842335a59ab93a2199ceac879a4b292 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.12.0/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "10.11.0": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.11.0/ApprovalTests.v.10.11.0.hpp + sha256: 7f4efb835d59b2f31c3dc8a6f35335ad621da538ccb09abf2037d29d4f13f0b2 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.11.0/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "10.10.0": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.10.0/ApprovalTests.v.10.10.0.hpp + sha256: e8fbe19011adad46d8a6309b1e2112fb9de729dddaa12f5fd9dfd6adb44dba2e + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.10.0/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "10.9.1": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.9.1/ApprovalTests.v.10.9.1.hpp + sha256: 65aa9ab1afa1b9c2df5890274010eed0f8c2f57b08a81c5cb719b71a0ad9d14c + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.9.1/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "9.0.0": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.9.0.0/ApprovalTests.v.9.0.0.hpp + sha256: cae3599dc29bd50c2cf48967e209c854e7b867ecdc8a5aec143b6fb4a7dcc739 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.9.0.0/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 + "8.9.2": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.8.9.2/ApprovalTests.v.8.9.2.hpp + sha256: e743f1b83afb045cb9bdee310e438a3ed610a549240e4b4c4c995e548c773da5 + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.8.9.2/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 diff --git a/recipes/approvaltests.cpp/all/conanfile.py b/recipes/approvaltests.cpp/all/conanfile.py new file mode 100644 index 0000000000000..a61797eefb14b --- /dev/null +++ b/recipes/approvaltests.cpp/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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" + + +class ApprovalTestsCppConan(ConanFile): + name = "approvaltests.cpp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/approvals/ApprovalTests.cpp" + license = "Apache-2.0" + description = "Approval Tests allow you to verify a chunk of output " \ + "(such as a file) in one operation as opposed to writing " \ + "test assertions for each element." + topics = ("testing", "unit-testing", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_boosttest": [True, False], + "with_catch2": [True, False], + "with_gtest": [True, False], + "with_doctest": [True, False], + "with_cpputest": [True, False], + } + default_options = { + "with_boosttest": False, + "with_catch2": False, + "with_gtest": False, + "with_doctest": False, + "with_cpputest": False, + } + no_copy_source = True + + @property + def _header_file(self): + return "ApprovalTests.hpp" + + def config_options(self): + if Version(self.version) < "8.6.0": + del self.options.with_boosttest + if Version(self.version) < "10.4.0": + del self.options.with_cpputest + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_boosttest"): + self.requires("boost/1.81.0") + if self.options.with_catch2: + self.requires("catch2/2.13.10") + if self.options.with_gtest: + self.requires("gtest/1.12.1") + if self.options.with_doctest: + self.requires("doctest/2.4.10") + if self.options.get_safe("with_cpputest"): + self.requires("cpputest/4.0") + + def package_id(self): + self.info.clear() + + def validate(self): + 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") + + def source(self): + for source in self.conan_data["sources"][self.version]: + url = source["url"] + filename = url[url.rfind("/") + 1:] + download(self, url, filename, sha256=source["sha256"]) + rename(self, src=os.path.join(self.source_folder, f"ApprovalTests.v.{self.version}.hpp"), + dst=os.path.join(self.source_folder, self._header_file)) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, self._header_file, src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ApprovalTests") + self.cpp_info.set_property("cmake_target_name", "ApprovalTests::ApprovalTests") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "ApprovalTests" + self.cpp_info.names["cmake_find_package_multi"] = "ApprovalTests" diff --git a/recipes/approvaltests.cpp/all/test_package/CMakeLists.txt b/recipes/approvaltests.cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6037353a3dc3d --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +enable_testing() + +find_package(ApprovalTests REQUIRED CONFIG) + +if(WITH_BOOSTTEST) + add_executable(test_package_boosttest test_boosttest.cpp) + target_link_libraries(test_package_boosttest PRIVATE ApprovalTests::ApprovalTests) + target_compile_features(test_package_boosttest PRIVATE cxx_std_11) + add_test(NAME test_package_boosttest COMMAND test_package_boosttest) +endif() +if(WITH_CATCH) + add_executable(test_package_catch test_catch.cpp) + target_link_libraries(test_package_catch PRIVATE ApprovalTests::ApprovalTests) + target_compile_features(test_package_catch PRIVATE cxx_std_11) + add_test(NAME test_package_catch COMMAND test_package_catch) +endif() +if(WITH_GTEST) + add_executable(test_package_gtest test_gtest.cpp) + target_link_libraries(test_package_gtest PRIVATE ApprovalTests::ApprovalTests) + target_compile_features(test_package_gtest PRIVATE cxx_std_11) + add_test(NAME test_package_gtest COMMAND test_package_gtest) +endif() +if(WITH_DOCTEST) + add_executable(test_package_doctest test_doctest.cpp) + target_link_libraries(test_package_doctest PRIVATE ApprovalTests::ApprovalTests) + target_compile_features(test_package_doctest PRIVATE cxx_std_11) + add_test(NAME test_package_doctest COMMAND test_package_doctest) +endif() +if(WITH_CPPUTEST) + add_executable(test_package_cpputest test_cpputest.cpp) + target_link_libraries(test_package_cpputest PRIVATE ApprovalTests::ApprovalTests) + target_compile_features(test_package_cpputest PRIVATE cxx_std_11) + add_test(NAME test_package_cpputest COMMAND test_package_cpputest) +endif() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE ApprovalTests::ApprovalTests) +target_compile_features(test_package PRIVATE cxx_std_11) +add_test(NAME test_package COMMAND test_package) diff --git a/recipes/approvaltests.cpp/all/test_package/conanfile.py b/recipes/approvaltests.cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..50f4e26c4fdc7 --- /dev/null +++ b/recipes/approvaltests.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, CMakeToolchain, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_BOOSTTEST"] = self.dependencies["approvaltests.cpp"].options.get_safe("with_boosttest", False) + tc.variables["WITH_CATCH"] = self.dependencies["approvaltests.cpp"].options.with_catch2 + tc.variables["WITH_GTEST"] = self.dependencies["approvaltests.cpp"].options.with_gtest + tc.variables["WITH_DOCTEST"] = self.dependencies["approvaltests.cpp"].options.with_doctest + tc.variables["WITH_CPPUTEST"] = self.dependencies["approvaltests.cpp"].options.get_safe("with_cpputest", False) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/recipes/approvaltests.cpp/all/test_package/test_boosttest.Module.Suite.TestCase.approved.txt b/recipes/approvaltests.cpp/all/test_package/test_boosttest.Module.Suite.TestCase.approved.txt new file mode 100644 index 0000000000000..e24331c47a05e --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_boosttest.Module.Suite.TestCase.approved.txt @@ -0,0 +1 @@ +Hello Approvals diff --git a/recipes/approvaltests.cpp/all/test_package/test_boosttest.cpp b/recipes/approvaltests.cpp/all/test_package/test_boosttest.cpp new file mode 100644 index 0000000000000..03cf108f1f39d --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_boosttest.cpp @@ -0,0 +1,22 @@ +#define BOOST_TEST_MODULE Module + +//#include // static or dynamic boost build +#include // header only boost + +#define APPROVALS_BOOSTTEST +#include "ApprovalTests.hpp" + +BOOST_AUTO_TEST_SUITE(Suite) + +BOOST_AUTO_TEST_CASE(TestCase) +{ + BOOST_CHECK(true); + + auto defaultReporterDisposer = + ApprovalTests::Approvals::useAsFrontLoadedReporter( + std::make_shared()); + + ApprovalTests::Approvals::verify("Hello Approvals"); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/recipes/approvaltests.cpp/all/test_package/test_catch.Package.approved.txt b/recipes/approvaltests.cpp/all/test_package/test_catch.Package.approved.txt new file mode 100644 index 0000000000000..e24331c47a05e --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_catch.Package.approved.txt @@ -0,0 +1 @@ +Hello Approvals diff --git a/recipes/approvaltests.cpp/all/test_package/test_catch.cpp b/recipes/approvaltests.cpp/all/test_package/test_catch.cpp new file mode 100644 index 0000000000000..b10e4272e2633 --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_catch.cpp @@ -0,0 +1,12 @@ +#define APPROVALS_CATCH +#include "ApprovalTests.hpp" + +TEST_CASE("Package") { + REQUIRE(true); + + auto defaultReporterDisposer = + ApprovalTests::Approvals::useAsFrontLoadedReporter( + std::make_shared()); + + ApprovalTests::Approvals::verify("Hello Approvals"); +} diff --git a/recipes/approvaltests.cpp/all/test_package/test_cpputest.Group.Package.approved.txt b/recipes/approvaltests.cpp/all/test_package/test_cpputest.Group.Package.approved.txt new file mode 100644 index 0000000000000..e24331c47a05e --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_cpputest.Group.Package.approved.txt @@ -0,0 +1 @@ +Hello Approvals diff --git a/recipes/approvaltests.cpp/all/test_package/test_cpputest.cpp b/recipes/approvaltests.cpp/all/test_package/test_cpputest.cpp new file mode 100644 index 0000000000000..0c67992c24b13 --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_cpputest.cpp @@ -0,0 +1,17 @@ +#define APPROVALS_CPPUTEST +#include "ApprovalTests.hpp" + +#include "CppUTest/TestHarness.h" + +using namespace ApprovalTests; + +TEST_GROUP(Group){}; + +TEST(Group, Package) +{ + auto defaultReporterDisposer = + ApprovalTests::Approvals::useAsFrontLoadedReporter( + std::make_shared()); + + ApprovalTests::Approvals::verify("Hello Approvals"); +} diff --git a/recipes/approvaltests.cpp/all/test_package/test_doctest.Package.approved.txt b/recipes/approvaltests.cpp/all/test_package/test_doctest.Package.approved.txt new file mode 100644 index 0000000000000..e24331c47a05e --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_doctest.Package.approved.txt @@ -0,0 +1 @@ +Hello Approvals diff --git a/recipes/approvaltests.cpp/all/test_package/test_doctest.cpp b/recipes/approvaltests.cpp/all/test_package/test_doctest.cpp new file mode 100644 index 0000000000000..25eb1fdc54d04 --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_doctest.cpp @@ -0,0 +1,12 @@ +#define APPROVALS_DOCTEST +#include "ApprovalTests.hpp" + +TEST_CASE("Package") { + CHECK(true); + + auto defaultReporterDisposer = + ApprovalTests::Approvals::useAsFrontLoadedReporter( + std::make_shared()); + + ApprovalTests::Approvals::verify("Hello Approvals"); +} diff --git a/recipes/approvaltests.cpp/all/test_package/test_gtest.Package.GTest.approved.txt b/recipes/approvaltests.cpp/all/test_package/test_gtest.Package.GTest.approved.txt new file mode 100644 index 0000000000000..e24331c47a05e --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_gtest.Package.GTest.approved.txt @@ -0,0 +1 @@ +Hello Approvals diff --git a/recipes/approvaltests.cpp/all/test_package/test_gtest.cpp b/recipes/approvaltests.cpp/all/test_package/test_gtest.cpp new file mode 100644 index 0000000000000..cc61abcc139ce --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_gtest.cpp @@ -0,0 +1,12 @@ +#define APPROVALS_GOOGLETEST +#include "ApprovalTests.hpp" + +TEST(Package, GTest) { + SUCCEED(); + + auto defaultReporterDisposer = + ApprovalTests::Approvals::useAsFrontLoadedReporter( + std::make_shared()); + + ApprovalTests::Approvals::verify("Hello Approvals"); +} diff --git a/recipes/approvaltests.cpp/all/test_package/test_package.cpp b/recipes/approvaltests.cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2618ff65967f1 --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include "ApprovalTests.hpp" + + +int main(void) { + std::cout << ApprovalTests::StringMaker::toString(42) << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt b/recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ce0e08c3c918 --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_v1_package LANGUAGES CXX) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/approvaltests.cpp/all/test_v1_package/conanfile.py b/recipes/approvaltests.cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8a49736d0c6b2 --- /dev/null +++ b/recipes/approvaltests.cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def _approvaltests_option(self, name, default): + try: + return getattr(self.options["approvaltests.cpp"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_BOOSTTEST"] = self._approvaltests_option("with_boosttest", False) + cmake.definitions["WITH_CATCH"] = self.options["approvaltests.cpp"].with_catch2 + cmake.definitions["WITH_GTEST"] = self.options["approvaltests.cpp"].with_gtest + cmake.definitions["WITH_DOCTEST"] = self.options["approvaltests.cpp"].with_doctest + cmake.definitions["WITH_CPPUTEST"] = self._approvaltests_option("with_cpputest", False) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) diff --git a/recipes/approvaltests.cpp/config.yml b/recipes/approvaltests.cpp/config.yml new file mode 100644 index 0000000000000..caf3f177e07c7 --- /dev/null +++ b/recipes/approvaltests.cpp/config.yml @@ -0,0 +1,17 @@ +versions: + "10.12.2": + folder: all + "10.12.1": + folder: all + "10.12.0": + folder: all + "10.11.0": + folder: all + "10.10.0": + folder: all + "10.9.1": + folder: all + "9.0.0": + folder: all + "8.9.2": + folder: all diff --git a/recipes/apr-util/all/conandata.yml b/recipes/apr-util/all/conandata.yml new file mode 100644 index 0000000000000..a6e26f0be8aa7 --- /dev/null +++ b/recipes/apr-util/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.6.1": + url: + - "https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz" + - "https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz" + sha256: "b65e40713da57d004123b6319828be7f1273fbc6490e145874ee1177e112c459" +patches: + "1.6.1": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-apu-config-prefix-env.patch" diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py new file mode 100644 index 0000000000000..86dd0a9fc160c --- /dev/null +++ b/recipes/apr-util/all/conanfile.py @@ -0,0 +1,221 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class AprUtilConan(ConanFile): + name = "apr-util" + description = ( + "The Apache Portable Runtime (APR) provides a predictable and " + "consistent interface to underlying platform-specific implementations" + ) + license = "Apache-2.0" + topics = ("apache", "platform", "library") + homepage = "https://apr.apache.org/" + 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_openssl": [True, False], + "with_nss": [True, False], + "with_commoncrypto": [True, False], + "dbm": [False, "gdbm", "ndbm", "db"], + "with_expat": [True, False], + "with_mysql": [True, False], + "with_postgresql": [True, False], + "with_sqlite3": [True, False], + "with_lber": [True, False], + "with_ldap": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": False, + "with_nss": False, + "with_commoncrypto": False, + "dbm": False, + "with_expat": True, + "with_mysql": False, + "with_postgresql": False, + "with_sqlite3": False, + "with_lber": False, + "with_ldap": 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") + self.options["apr"].shared = self.options.shared + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("apr/1.7.0", transitive_headers=True) + if self.settings.os != "Windows": + #cmake build doesn't allow injection of iconv yet + # https://github.com/conan-io/conan-center-index/pull/16142#issuecomment-1494282164 + # transitive_libs needs to be set because some sys-frameworks on the old mac images for c3i + # are pulling it in - discovered in https://github.com/conan-io/conan-center-index/pull/16266 + self.requires("libiconv/1.17", transitive_libs=True) + if self.options.with_openssl: + self.requires("openssl/1.1.1t") + if self.options.with_mysql: + self.requires("libmysqlclient/8.0.31") + if self.options.with_sqlite3: + self.requires("sqlite3/3.41.1") + if self.options.with_expat: + self.requires("expat/2.5.0") + if self.options.with_postgresql: + self.requires("libpq/14.5") + + def validate(self): + if not self.options.with_expat: + raise ConanInvalidConfiguration("expat cannot be disabled (at this time) (check back later)") + if self.options.shared != self.dependencies["apr"].options.shared: + raise ConanInvalidConfiguration("apr-util must be built with same shared option as apr") + if self.options.with_nss: + raise ConanInvalidConfiguration("CCI has no nss recipe (yet)") + if self.options.with_commoncrypto: + raise ConanInvalidConfiguration("CCI has no commoncrypto recipe (yet)") + if self.options.dbm == "gdbm": + raise ConanInvalidConfiguration("CCI has no gdbm recipe (yet)") + elif self.options.dbm == "ndbm": + raise ConanInvalidConfiguration("CCI has no ndbm recipe (yet)") + elif self.options.dbm == "db": + raise ConanInvalidConfiguration("CCI has no libdb recipe (yet)") + if self.options.with_lber: + raise ConanInvalidConfiguration("CCI has no lber recipe (yet)") + if self.options.with_ldap: + raise ConanInvalidConfiguration("CCI has no ldap recipe (yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _with_crypto(self): + return self.options.with_openssl or self.options.with_nss or self.options.with_commoncrypto + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["INSTALL_PDB"] = False + tc.variables["APU_HAVE_CRYPTO"] = self._with_crypto + tc.variables["APR_HAS_LDAP"] = self.options.with_ldap + tc.generate() + deps = CMakeDeps(self) + deps.generate() + else: + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + rootpath_no = lambda v, req: self.dependencies[req].package_folder if v else "no" + tc.configure_args.extend([ + f"--with-apr={rootpath_no(True, 'apr')}", + f"--with-crypto={yes_no(self._with_crypto)}", + f"--with-iconv={rootpath_no(True, 'libiconv')}", + f"--with-openssl={rootpath_no(self.options.with_openssl, 'openssl')}", + f"--with-expat={rootpath_no(self.options.with_expat, 'expat')}", + f"--with-mysql={rootpath_no(self.options.with_mysql, 'libmysqlclient')}", + f"--with-pgsql={rootpath_no(self.options.with_postgresql, 'libpq')}", + f"--with-sqlite3={rootpath_no(self.options.with_sqlite3, 'sqlite3')}", + f"--with-ldap={rootpath_no(self.options.with_ldap, 'ldap')}", + f"--with-berkeley-db={rootpath_no(self.options.dbm == 'db', 'libdb')}", + f"--with-gdbm={rootpath_no(self.options.dbm == 'gdbm', 'gdbm')}", + f"--with-ndbm={rootpath_no(self.options.dbm == 'ndbm', 'ndbm')}", + ]) + if self.options.dbm: + tc.configure_args.append(f"--with-dbm={self.options.dbm}") + if self._with_crypto and self.settings.os in ["Linux", "FreeBSD"]: + tc.extra_ldflags.append("-ldl") + env = tc.environment() + env.define_path("APR_ROOT", self.dependencies["apr"].package_folder) + env.define_path("_APR_BUILDDIR", os.path.join(self.dependencies["apr"].package_folder, "res", "build-1")) + tc.generate(env) + + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib"), 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", "apr-util-1") + if self.settings.os == "Windows": + self.cpp_info.libs = ["apr_dbd_odbc-1"] + if self._with_crypto: + self.cpp_info.libs.append("apr_crypto_openssl-1") + if self.options.with_ldap: + self.cpp_info.libs.append("apr_ldap-1") + prefix = "lib" if self.options.shared else "" + self.cpp_info.libs.append(f"{prefix}aprutil-1") + else: + self.cpp_info.libs = ["aprutil-1"] + self.cpp_info.libdirs.append(os.path.join("lib", "apr-util-1")) + if not self.options.shared: + self.cpp_info.defines = ["APU_DECLARE_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["crypt", "dl", "pthread", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["mswsock", "odbc32", "rpcrt4", "ws2_32"] + + self.runenv_info.define_path("APR_UTIL_ROOT", self.package_folder) + + deps = [dep for dep in reversed(self.dependencies.host.topological_sort.values())] + libdirs = [p for dep in deps for p in dep.cpp_info.aggregated_components().includedirs] + aprutil_ldflags = " ".join([f"-L{p}" for p in libdirs]) + self.runenv_info.define("APRUTIL_LDFLAGS", aprutil_ldflags) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.APR_UTIL_ROOT = self.package_folder + if not is_msvc(self): + self.env_info.APRUTIL_LDFLAGS = aprutil_ldflags diff --git a/recipes/apr-util/all/patches/0001-fix-cmake.patch b/recipes/apr-util/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..0083d495d06dc --- /dev/null +++ b/recipes/apr-util/all/patches/0001-fix-cmake.patch @@ -0,0 +1,89 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,13 +15,13 @@ + # + # Read README.cmake before using this. + ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(APR-Util C) + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + + FIND_PACKAGE(OpenSSL) + +-FIND_PACKAGE(expat) ++FIND_PACKAGE(EXPAT MODULE) + + OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) + OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) +@@ -29,17 +29,14 @@ OPTION(APR_HAS_LDAP "LDAP support" ON) + OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) + OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) + OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) +-SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files") +-SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with") ++find_package(apr REQUIRED CONFIG) ++if(NOT DEFINED APR_INCLUDE_DIR) ++ set(APR_INCLUDE_DIR apr_INCLUDE_DIRS) ++endif() ++if(NOT DEFINED APR_LIBRARIES) ++ set(APR_LIBRARIES apr::apr) ++endif() + +-IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h") +- MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.") +-ENDIF() +-FOREACH(onelib ${APR_LIBRARIES}) +- IF(NOT EXISTS ${onelib}) +- MESSAGE(FATAL_ERROR "APR library ${onelib} was not found.") +- ENDIF() +-ENDFOREACH() + + IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) +@@ -228,23 +225,26 @@ SET(dbd_drivers) + + # Note: The WINNT definition on some targets is used only by libaprutil.rc. + ++if(BUILD_SHARED_LIBS) + # libaprutil-1 is shared, aprutil-1 is static + ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc) + SET(install_targets ${install_targets} libaprutil-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb) + TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) + SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT") ++else() + + ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) + SET(install_targets ${install_targets} aprutil-1) + TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) + SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC") ++endif() + + IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") + ENDIF() +- ADD_LIBRARY(apr_crypto_openssl-1 SHARED crypto/apr_crypto_openssl.c libaprutil.rc) ++ ADD_LIBRARY(apr_crypto_openssl-1 crypto/apr_crypto_openssl.c libaprutil.rc) + SET(install_targets ${install_targets} apr_crypto_openssl-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb) + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") +@@ -254,7 +254,7 @@ IF(APU_HAVE_CRYPTO) + ENDIF() + + IF(APU_HAVE_ODBC) +- ADD_LIBRARY(apr_dbd_odbc-1 SHARED dbd/apr_dbd_odbc.c libaprutil.rc) ++ ADD_LIBRARY(apr_dbd_odbc-1 dbd/apr_dbd_odbc.c libaprutil.rc) + SET(install_targets ${install_targets} apr_dbd_odbc-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-1.pdb) + SET(dbd_drivers ${dbd_drivers} odbc) +@@ -265,7 +265,7 @@ IF(APU_HAVE_ODBC) + ENDIF() + + IF(APR_HAS_LDAP) +- ADD_LIBRARY(apr_ldap-1 SHARED ldap/apr_ldap_init.c ldap/apr_ldap_option.c ++ ADD_LIBRARY(apr_ldap-1 ldap/apr_ldap_init.c ldap/apr_ldap_option.c + ldap/apr_ldap_rebind.c libaprutil.rc) + SET(install_targets ${install_targets} apr_ldap-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb) diff --git a/recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch b/recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch new file mode 100644 index 0000000000000..49f8852d06031 --- /dev/null +++ b/recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch @@ -0,0 +1,22 @@ +--- apu-config.in ++++ apu-config.in +@@ -21,7 +21,7 @@ + APRUTIL_MAJOR_VERSION="@APRUTIL_MAJOR_VERSION@" + APRUTIL_DOTTED_VERSION="@APRUTIL_DOTTED_VERSION@" + +-prefix="@prefix@" ++prefix="$APR_UTIL_ROOT" + exec_prefix="@exec_prefix@" + bindir="@bindir@" + libdir="@libdir@" +@@ -28,8 +28,8 @@ + includedir="@includedir@" + + LIBS="@APRUTIL_EXPORT_LIBS@" +-INCLUDES="@APRUTIL_INCLUDES@" +-LDFLAGS="@APRUTIL_LDFLAGS@" ++INCLUDES="" ++LDFLAGS="$APRUTIL_LDFLAGS" + LDAP_LIBS="@LDADD_ldap@" + DBM_LIBS="@LDADD_dbm_db@ @LDADD_dbm_gdbm@ @LDADD_dbm_ndbm@" + diff --git a/recipes/apr-util/all/test_package/CMakeLists.txt b/recipes/apr-util/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c273ab3463a77 --- /dev/null +++ b/recipes/apr-util/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(apr-util REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE apr-util::apr-util) diff --git a/recipes/apr-util/all/test_package/conanfile.py b/recipes/apr-util/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/apr-util/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/apr-util/all/test_package/test_package.c b/recipes/apr-util/all/test_package/test_package.c new file mode 100644 index 0000000000000..81b3e01d31c43 --- /dev/null +++ b/recipes/apr-util/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "apr_uuid.h" +#include "apu_version.h" + +#include + +int main() { + apr_uuid_t uuid; + char uuid_buffer[APR_UUID_FORMATTED_LENGTH+1]; + apr_uuid_get(&uuid); + apr_uuid_format(uuid_buffer, &uuid); + uuid_buffer[APR_UUID_FORMATTED_LENGTH] = '\0'; + printf("uuid: %s\n", uuid_buffer); + + printf("apr-util version %s\n", apu_version_string()); + + return 0; +} diff --git a/recipes/apr-util/all/test_v1_package/CMakeLists.txt b/recipes/apr-util/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/apr-util/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/apr-util/all/test_v1_package/conanfile.py b/recipes/apr-util/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/apr-util/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/apr-util/config.yml b/recipes/apr-util/config.yml new file mode 100644 index 0000000000000..bd3f43d241a52 --- /dev/null +++ b/recipes/apr-util/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.1": + folder: all diff --git a/recipes/apr/all/conandata.yml b/recipes/apr/all/conandata.yml new file mode 100644 index 0000000000000..99413b626b3c6 --- /dev/null +++ b/recipes/apr/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.7.0": + url: "https://archive.apache.org/dist/apr/apr-1.7.0.tar.bz2" + sha256: "e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea" +patches: + "1.7.0": + - patch_file: "patches/0001-cmake-build-only-shared-static.patch" + - patch_file: "patches/0002-apr-config-prefix-env.patch" + - patch_file: "patches/0003-cmake-gen_test_char-use-target.patch" + - patch_file: "patches/0004-autotools-mingw.patch" + - patch_file: "patches/0005-clang12-apple.patch" + - patch_file: "patches/0006-sys_siglist-fix.patch" + - patch_file: "patches/0007-cmake-minimum-required.patch" diff --git a/recipes/apr/all/conanfile.py b/recipes/apr/all/conanfile.py new file mode 100644 index 0000000000000..9ca885e105eb6 --- /dev/null +++ b/recipes/apr/all/conanfile.py @@ -0,0 +1,155 @@ +from conan import ConanFile +from conan.errors import ConanException, 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.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import re + +required_conan_version = ">=1.54.0" + + +class AprConan(ConanFile): + name = "apr" + description = ( + "The Apache Portable Runtime (APR) provides a predictable and consistent " + "interface to underlying platform-specific implementations" + ) + license = "Apache-2.0" + topics = ("apache", "platform", "library") + homepage = "https://apr.apache.org/" + 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], + "force_apr_uuid": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "force_apr_uuid": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _should_call_autoreconf(self): + return self.settings.compiler == "apple-clang" and \ + Version(self.settings.compiler.version) >= "12" and \ + self.version == "1.7.0" + + 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): + if is_msvc(self): + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks") + + def build_requirements(self): + if not is_msvc(self): + if self._should_call_autoreconf: + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = CMakeToolchain(self) + tc.variables["INSTALL_PDB"] = False + tc.variables["APR_BUILD_TESTAPR"] = False + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + 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.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.options.force_apr_uuid: + replace_in_file(self, os.path.join(self.source_folder, "include", "apr.h.in"), + "@osuuid@", "0") + + def build(self): + self._patch_sources() + if is_msvc(self): + cmake = CMake(self) + cmake.configure() + cmake.build(target="libapr-1" if self.options.shared else "apr-1") + else: + autotools = Autotools(self) + if self._should_call_autoreconf: + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "build-1")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + apr_rules_mk = os.path.join(self.package_folder, "res", "build-1", "apr_rules.mk") + apr_rules_cnt = open(apr_rules_mk).read() + for key in ("apr_builddir", "apr_builders", "top_builddir"): + apr_rules_cnt, nb = re.subn(f"^{key}=[^\n]*\n", f"{key}=$(_APR_BUILDDIR)\n", apr_rules_cnt, flags=re.MULTILINE) + if nb == 0: + raise ConanException(f"Could not find/replace {key} in {apr_rules_mk}") + open(apr_rules_mk, "w").write(apr_rules_cnt) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "apr-1") + prefix = "lib" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"{prefix}apr-1"] + self.cpp_info.resdirs = ["res"] + if not self.options.shared: + self.cpp_info.defines = ["APR_DECLARE_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["crypt", "dl", "pthread", "rt"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["mswsock", "rpcrt4", "ws2_32"] + + # TODO: to remove in conan v2 + self.env_info.APR_ROOT = self.package_folder + self.env_info._APR_BUILDDIR = os.path.join(self.package_folder, "res", "build-1") diff --git a/recipes/apr/all/patches/0001-cmake-build-only-shared-static.patch b/recipes/apr/all/patches/0001-cmake-build-only-shared-static.patch new file mode 100644 index 0000000000000..193b94f19acb4 --- /dev/null +++ b/recipes/apr/all/patches/0001-cmake-build-only-shared-static.patch @@ -0,0 +1,33 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -258,27 +258,26 @@ + SET(install_targets) + SET(install_bin_pdb) + + # libapr-1 is shared, apr-1 is static ++IF(BUILD_SHARED_LIBS) + ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc) + SET(install_targets ${install_targets} libapr-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-1.pdb) + TARGET_LINK_LIBRARIES(libapr-1 ${APR_SYSTEM_LIBS}) + SET_TARGET_PROPERTIES(libapr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;WINNT") + ADD_DEPENDENCIES(libapr-1 test_char_header) +- ++ELSE() + ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) + SET(install_targets ${install_targets} apr-1) + TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS}) + SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT") + ADD_DEPENDENCIES(apr-1 test_char_header) +- ++ENDIF() + # libaprapp-1 and aprapp-1 are static + ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) +-SET(install_targets ${install_targets} libaprapp-1) + SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT") + + ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) +-SET(install_targets ${install_targets} aprapp-1) + SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT") + + IF(APR_BUILD_TESTAPR) diff --git a/recipes/apr/all/patches/0002-apr-config-prefix-env.patch b/recipes/apr/all/patches/0002-apr-config-prefix-env.patch new file mode 100644 index 0000000000000..83545b03e35c6 --- /dev/null +++ b/recipes/apr/all/patches/0002-apr-config-prefix-env.patch @@ -0,0 +1,11 @@ +--- apr-config.in ++++ apr-config.in +@@ -21,7 +21,7 @@ + APR_MAJOR_VERSION="@APR_MAJOR_VERSION@" + APR_DOTTED_VERSION="@APR_DOTTED_VERSION@" + +-prefix="@prefix@" ++prefix="$APR_ROOT" + exec_prefix="@exec_prefix@" + bindir="@bindir@" + libdir="@libdir@" diff --git a/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch b/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch new file mode 100644 index 0000000000000..171d7365eb26e --- /dev/null +++ b/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,11 +49,11 @@ CONFIGURE_FILE(include/apr.hwc + ${PROJECT_BINARY_DIR}/apr.h) + + ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c) +-GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) ++# GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) + ADD_CUSTOM_COMMAND( + COMMENT "Generating character tables, apr_escape_test_char.h, for current locale" + DEPENDS gen_test_char +- COMMAND ${GEN_TEST_CHAR_EXE} > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h ++ COMMAND $ > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h + OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h + ) + ADD_CUSTOM_TARGET( diff --git a/recipes/apr/all/patches/0004-autotools-mingw.patch b/recipes/apr/all/patches/0004-autotools-mingw.patch new file mode 100644 index 0000000000000..c04ea7218fafc --- /dev/null +++ b/recipes/apr/all/patches/0004-autotools-mingw.patch @@ -0,0 +1,160 @@ +--- configure.in ++++ configure.in +@@ -1864,11 +1864,13 @@ esac + + dnl I would expect much of the above to go away with new compile test + APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, long, ld, [ssize_t_fmt="ld"], [ +-APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, int, d, [ssize_t_fmt="d"]) +-]) ++APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, int, d, [ssize_t_fmt="d"], [ ++APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, long long, lld, [ssize_t_fmt="lld"]) ++])]) + APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned long, lu, [size_t_fmt="lu"], [ +-APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned int, u, [size_t_fmt="u"]) +-]) ++APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned int, u, [size_t_fmt="u"], [ ++APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned long long, llu, [size_t_fmt="llu"]) ++])]) + + APR_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) + +--- configure ++++ configure +@@ -14194,7 +14194,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(apr_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + +@@ -24674,8 +24674,62 @@ + else + : + ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ssize_t and long long use fmt %lld" >&5 ++$as_echo_n "checking whether ssize_t and long long use fmt %lld... " >&6; } ++if ${apr_cv_typematch_ssize_t_long_long_lld+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++apr_save_CFLAGS=$CFLAGS ++ CFLAGS="$CFLAGS $CFLAGS_WARN" ++ if test "$ac_cv_c_compiler_gnu" = "yes"; then ++ CFLAGS="$CFLAGS -Werror" ++ fi ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include "confdefs.h" ++ ++ #include ++#include ++#ifdef HAVE_STDINT_H ++#include ++#endif ++ ++ int main(int argc, const char *const *argv) { ++ ++ ssize_t chk1, *ptr1; ++ long long chk2, *ptr2 = &chk1; ++ ptr1 = &chk2; ++ *ptr1 = *ptr2 = 0; ++ printf("%lld %lld", chk1, chk2); ++ ++ return 0; } ++ ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ CFLAGS=$apr_save_CFLAGS ++apr_cv_typematch_ssize_t_long_long_lld=yes ++else ++ CFLAGS=$apr_save_CFLAGS ++apr_cv_typematch_ssize_t_long_long_lld=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ + fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_ssize_t_long_long_lld" >&5 ++$as_echo "$apr_cv_typematch_ssize_t_long_long_lld" >&6; } ++if test "$apr_cv_typematch_ssize_t_long_long_lld" = "yes"; then ++ : ++ ssize_t_fmt="lld" ++else ++ : ++ ++fi ++ + ++fi + + fi + +@@ -24783,11 +24837,65 @@ + else + : + ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether size_t and unsigned long long use fmt %llu" >&5 ++$as_echo_n "checking whether size_t and unsigned long long use fmt %llu... " >&6; } ++if ${apr_cv_typematch_size_t_unsigned_long_long_llu+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++apr_save_CFLAGS=$CFLAGS ++ CFLAGS="$CFLAGS $CFLAGS_WARN" ++ if test "$ac_cv_c_compiler_gnu" = "yes"; then ++ CFLAGS="$CFLAGS -Werror" ++ fi ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include "confdefs.h" ++ ++ #include ++#include ++#ifdef HAVE_STDINT_H ++#include ++#endif ++ ++ int main(int argc, const char *const *argv) { ++ ++ size_t chk1, *ptr1; ++ unsigned long long chk2, *ptr2 = &chk1; ++ ptr1 = &chk2; ++ *ptr1 = *ptr2 = 0; ++ printf("%llu %llu", chk1, chk2); ++ ++ return 0; } ++ ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ CFLAGS=$apr_save_CFLAGS ++apr_cv_typematch_size_t_unsigned_long_long_llu=yes ++else ++ CFLAGS=$apr_save_CFLAGS ++apr_cv_typematch_size_t_unsigned_long_long_llu=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_size_t_unsigned_long_long_llu" >&5 ++$as_echo "$apr_cv_typematch_size_t_unsigned_long_long_llu" >&6; } ++if test "$apr_cv_typematch_size_t_unsigned_long_long_llu" = "yes"; then ++ : ++ size_t_fmt="llu" ++else ++ : ++ + fi + + + fi + ++fi ++ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5 + $as_echo_n "checking size of ssize_t... " >&6; } diff --git a/recipes/apr/all/patches/0005-clang12-apple.patch b/recipes/apr/all/patches/0005-clang12-apple.patch new file mode 100644 index 0000000000000..18a21b9587705 --- /dev/null +++ b/recipes/apr/all/patches/0005-clang12-apple.patch @@ -0,0 +1,12 @@ +diff --git a/build/apr_common.m4 b/build/apr_common.m4 +index f4e2dfd..01d9a44 100644 +--- build/apr_common.m4 ++++ build/apr_common.m4 +@@ -467,6 +467,7 @@ changequote([, ])dnl + AC_MSG_CHECKING(size of $2) + AC_CACHE_VAL(AC_CV_NAME, + [AC_TRY_RUN([#include ++#include + $1 + #ifdef WIN32 + #define binmode "b" diff --git a/recipes/apr/all/patches/0006-sys_siglist-fix.patch b/recipes/apr/all/patches/0006-sys_siglist-fix.patch new file mode 100644 index 0000000000000..eca8b4d71dfee --- /dev/null +++ b/recipes/apr/all/patches/0006-sys_siglist-fix.patch @@ -0,0 +1,13 @@ +diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c +index c735eab..e8b44c3 100644 +--- a/threadproc/unix/signals.c ++++ b/threadproc/unix/signals.c +@@ -116,7 +116,7 @@ void apr_signal_init(apr_pool_t *pglobal) + } + const char *apr_signal_description_get(int signum) + { +- return (signum >= 0) ? sys_siglist[signum] : "unknown signal (number)"; ++ return (signum >= 0) ? strsignal(signum) : "unknown signal (number)"; + } + + #else /* !(SYS_SIGLIST_DECLARED || HAVE_DECL_SYS_SIGLIST) */ diff --git a/recipes/apr/all/patches/0007-cmake-minimum-required.patch b/recipes/apr/all/patches/0007-cmake-minimum-required.patch new file mode 100644 index 0000000000000..161b16e8f7269 --- /dev/null +++ b/recipes/apr/all/patches/0007-cmake-minimum-required.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,9 +15,9 @@ + # + # Read README.cmake before using this. + ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(APR C) + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + + OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) + OPTION(APR_HAVE_IPV6 "IPv6 support" ON) diff --git a/recipes/apr/all/test_package/CMakeLists.txt b/recipes/apr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c82ee1f7cca4b --- /dev/null +++ b/recipes/apr/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(apr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE apr::apr) diff --git a/recipes/apr/all/test_package/conanfile.py b/recipes/apr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/apr/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/apr/all/test_package/test_package.c b/recipes/apr/all/test_package/test_package.c new file mode 100644 index 0000000000000..69e98075895ff --- /dev/null +++ b/recipes/apr/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "apr_version.h" + +#include + +int main() { + printf("APR version %s\n", apr_version_string()); + return 0; +} diff --git a/recipes/apr/all/test_v1_package/CMakeLists.txt b/recipes/apr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/apr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/apr/all/test_v1_package/conanfile.py b/recipes/apr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/apr/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/apr/config.yml b/recipes/apr/config.yml new file mode 100644 index 0000000000000..0f57b11de8fb0 --- /dev/null +++ b/recipes/apr/config.yml @@ -0,0 +1,3 @@ +versions: + "1.7.0": + folder: all diff --git a/recipes/apriltag/all/conandata.yml b/recipes/apriltag/all/conandata.yml new file mode 100644 index 0000000000000..612b22768b3e7 --- /dev/null +++ b/recipes/apriltag/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "3.1.4": + url: "https://github.com/AprilRobotics/apriltag/archive/refs/tags/v3.1.4.tar.gz" + sha256: "ad2888d432e9ddcad2f639f243479934a4cd677ed5d2f8dee3b3418617b64f5d" + "3.1.2": + url: "https://github.com/AprilRobotics/apriltag/archive/3.1.2.tar.gz" + sha256: "2759b044ff1dc9ef725e7c456b49283399ef78deee24754bc3617cbe369584f1" + "3.1.1": + url: "https://github.com/AprilRobotics/apriltag/archive/3.1.1.tar.gz" + sha256: "7349e1fcc8b2979230b46c0d62ccf2ba2bbd611d87ef80cfd37ffe74425f5efb" +patches: + "3.1.4": + - patch_file: "patches/3.1.4-0001-fix-cmake.patch" + - patch_file: "patches/3.1.1-0002-windows-nominmax.patch" + "3.1.2": + - patch_file: "patches/3.1.2-0001-fix-cmake.patch" + - patch_file: "patches/3.1.1-0002-windows-nominmax.patch" + "3.1.1": + - patch_file: "patches/3.1.1-0001-fix-cmake.patch" + - patch_file: "patches/3.1.1-0002-windows-nominmax.patch" diff --git a/recipes/apriltag/all/conanfile.py b/recipes/apriltag/all/conanfile.py new file mode 100644 index 0000000000000..c5ee7a9043fc1 --- /dev/null +++ b/recipes/apriltag/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class ApriltagConan(ConanFile): + name = "apriltag" + description = ("AprilTag is a visual fiducial system, useful for a wide variety of tasks \ + including augmented reality, robotics, and camera calibration") + homepage = "https://april.eecs.umich.edu/software/apriltag" + topics = ("robotics",) + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if is_msvc(self): + self.requires("pthreads4w/3.0.0", transitive_headers=True) + + def validate(self): + if is_msvc(self) and self.settings.build_type == "Debug": + # segfault in test package... + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Debug with msvc yet") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "3.1.4": + tc.variables["BUILD_PYTHON_WRAPPER"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + if is_msvc(self): + 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.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "apriltag") + self.cpp_info.set_property("cmake_target_name", "apriltag::apriltag") + self.cpp_info.set_property("pkg_config_name", "apriltag") + self.cpp_info.libs = ["apriltag"] + self.cpp_info.includedirs.append(os.path.join("include", "apriltag")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["winmm"] diff --git a/recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..74b09907feed6 --- /dev/null +++ b/recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch @@ -0,0 +1,67 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,24 +1,29 @@ +-cmake_minimum_required(VERSION 3.1) +-project(apriltag) ++cmake_minimum_required(VERSION 3.8) ++project(apriltag LANGUAGES C) + +-find_package(OpenCV QUIET) + + include_directories(.) + aux_source_directory(common COMMON_SRC) + aux_source_directory(. APRILTAG_SRCS) + +-set(CMAKE_BUILD_TYPE Release) + + # Library +-add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC}) ++add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC}) ++target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) + if (MSVC) + # FindThreads will not find pthread.h with MSVC + # winmm is necessary for __imp_timeGetTime +- find_library(PTHREAD_LIBRARIES NAMES pthreads) +- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) ++ find_package(pthreads4w REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) + else() + find_package(Threads REQUIRED) +- target_link_libraries(${PROJECT_NAME} Threads::Threads m) ++ target_link_libraries(${PROJECT_NAME} Threads::Threads) ++ include(CheckFunctionExists) ++ check_function_exists(pow HAVE_MATH_SYSTEM) ++ if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(${PROJECT_NAME} m) ++ endif() + endif() + + set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) +@@ -39,6 +43,7 @@ set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) + + # install library + install(TARGETS ${PROJECT_NAME} EXPORT apriltag ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +@@ -63,16 +68,13 @@ install(FILES "${PROJECT_BINARY_DIR}/apriltag.pc" DESTINATION "lib/pkgconfig/") + + # Examples + # apriltag_demo +-add_executable(apriltag_demo example/apriltag_demo.c) +-target_link_libraries(apriltag_demo apriltag) + + # opencv_demo +-if(OpenCV_FOUND) ++if(0) + add_executable(opencv_demo example/opencv_demo.cc) + target_link_libraries(opencv_demo apriltag ${OpenCV_LIBRARIES}) + install(TARGETS opencv_demo RUNTIME DESTINATION bin) +-endif(OpenCV_FOUND) ++endif() + + # install example programs +-install(TARGETS apriltag_demo RUNTIME DESTINATION bin) + diff --git a/recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch b/recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch new file mode 100644 index 0000000000000..6ca9d00b5704e --- /dev/null +++ b/recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch @@ -0,0 +1,20 @@ +--- a/common/time_util.h ++++ b/common/time_util.h +@@ -30,6 +30,7 @@ either expressed or implied, of the Regents of The University of Michigan. + #include + #include + #ifdef _WIN32 ++#define NOMINMAX + #include + typedef long long suseconds_t; + #endif +--- a/common/workerpool.c ++++ b/common/workerpool.c +@@ -33,6 +33,7 @@ either expressed or implied, of the Regents of The University of Michigan. + #include + #include + #ifdef _WIN32 ++#define NOMINMAX + #include + #else + #include diff --git a/recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..58464b0668d96 --- /dev/null +++ b/recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch @@ -0,0 +1,83 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,26 +1,31 @@ +-cmake_minimum_required(VERSION 3.1) +-project(apriltag) ++cmake_minimum_required(VERSION 3.8) ++project(apriltag LANGUAGES C) + +-find_package(OpenCV QUIET) + + include_directories(.) + aux_source_directory(common COMMON_SRC) + set(APRILTAG_SRCS apriltag.c apriltag_pose.c apriltag_quad_thresh.c) + +-set(CMAKE_BUILD_TYPE Release) + + # Library + file(GLOB TAG_FILES ${CMAKE_SOURCE_DIR}/tag*.c) + set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) +-add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) ++add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) ++target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) + if (MSVC) + # FindThreads will not find pthread.h with MSVC + # winmm is necessary for __imp_timeGetTime +- find_library(PTHREAD_LIBRARIES NAMES pthreads) +- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) ++ find_package(pthreads4w REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) + else() + find_package(Threads REQUIRED) +- target_link_libraries(${PROJECT_NAME} Threads::Threads m) ++ target_link_libraries(${PROJECT_NAME} Threads::Threads) ++ include(CheckFunctionExists) ++ check_function_exists(pow HAVE_MATH_SYSTEM) ++ if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(${PROJECT_NAME} m) ++ endif() + endif() + + set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) +@@ -39,6 +43,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES + + # install library + install(TARGETS ${PROJECT_NAME} EXPORT apriltag ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +@@ -63,6 +68,7 @@ install(FILES "${PROJECT_BINARY_DIR}/apriltag.pc" DESTINATION "lib/pkgconfig/") + + + # Python wrapper ++if(0) + SET(Python_ADDITIONAL_VERSIONS 3) + find_package(PythonLibs) + execute_process(COMMAND which python3 OUTPUT_QUIET RESULT_VARIABLE Python3_NOT_FOUND) +@@ -95,21 +101,19 @@ execute_process(COMMAND python3 -m site --user-site OUTPUT_VARIABLE PY_DEST) + string(STRIP ${PY_DEST} PY_DEST) + install(CODE "execute_process(COMMAND cp ${PROJECT_BINARY_DIR}/apriltag${PY_EXT_SUFFIX} ${PY_DEST})") + endif (NOT Python3_NOT_FOUND AND NOT Numpy_NOT_FOUND AND PYTHONLIBS_FOUND) ++endif() + + + # Examples + # apriltag_demo +-add_executable(apriltag_demo example/apriltag_demo.c) +-target_link_libraries(apriltag_demo apriltag) + + # opencv_demo +-if(OpenCV_FOUND) ++if(0) + add_executable(opencv_demo example/opencv_demo.cc) + target_link_libraries(opencv_demo apriltag ${OpenCV_LIBRARIES}) + set_target_properties(opencv_demo PROPERTIES CXX_STANDARD 11) + install(TARGETS opencv_demo RUNTIME DESTINATION bin) +-endif(OpenCV_FOUND) ++endif() + + # install example programs +-install(TARGETS apriltag_demo RUNTIME DESTINATION bin) + diff --git a/recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch new file mode 100644 index 0000000000000..ba813f1dc3969 --- /dev/null +++ b/recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch @@ -0,0 +1,69 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,26 +1,31 @@ +-cmake_minimum_required(VERSION 3.1) +-project(apriltag) ++cmake_minimum_required(VERSION 3.8) ++project(apriltag LANGUAGES C) + +-find_package(OpenCV QUIET) + + include_directories(.) + aux_source_directory(common COMMON_SRC) + set(APRILTAG_SRCS apriltag.c apriltag_pose.c apriltag_quad_thresh.c) + +-set(CMAKE_BUILD_TYPE Release) + + # Library + file(GLOB TAG_FILES ${PROJECT_SOURCE_DIR}/tag*.c) + set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) +-add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) ++add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) ++target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) + if (MSVC) + # FindThreads will not find pthread.h with MSVC + # winmm is necessary for __imp_timeGetTime +- find_library(PTHREAD_LIBRARIES NAMES pthreads) +- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) ++ find_package(pthreads4w REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) + else() + find_package(Threads REQUIRED) +- target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads m) ++ target_link_libraries(${PROJECT_NAME} Threads::Threads) ++ include(CheckFunctionExists) ++ check_function_exists(pow HAVE_MATH_SYSTEM) ++ if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(${PROJECT_NAME} m) ++ endif() + endif() + + set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) +@@ -33,6 +37,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC + + # install library + install(TARGETS ${PROJECT_NAME} EXPORT apriltagTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +@@ -102,16 +107,13 @@ endif (NOT Python3_NOT_FOUND AND NOT Numpy_NOT_FOUND AND PYTHONLIBS_FOUND AND BU + + # Examples + # apriltag_demo +-add_executable(apriltag_demo example/apriltag_demo.c) +-target_link_libraries(apriltag_demo apriltag) + + # opencv_demo +-if(OpenCV_FOUND) ++if(0) + add_executable(opencv_demo example/opencv_demo.cc) + target_link_libraries(opencv_demo apriltag ${OpenCV_LIBRARIES}) + set_target_properties(opencv_demo PROPERTIES CXX_STANDARD 11) + install(TARGETS opencv_demo RUNTIME DESTINATION bin) +-endif(OpenCV_FOUND) ++endif() + + # install example programs +-install(TARGETS apriltag_demo RUNTIME DESTINATION bin) diff --git a/recipes/apriltag/all/test_package/CMakeLists.txt b/recipes/apriltag/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..61df950dde2ef --- /dev/null +++ b/recipes/apriltag/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(apriltag REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE apriltag::apriltag) diff --git a/recipes/apriltag/all/test_package/conanfile.py b/recipes/apriltag/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/apriltag/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/apriltag/all/test_package/test_package.c b/recipes/apriltag/all/test_package/test_package.c new file mode 100644 index 0000000000000..098b0a3741e4d --- /dev/null +++ b/recipes/apriltag/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include +#include + +#include + +int main(int argc, char *argv[]) +{ + apriltag_detector_t *td = apriltag_detector_create(); + apriltag_family_t *tf = tagStandard41h12_create(); + apriltag_detector_add_family(td, tf); + + tagStandard41h12_destroy(tf); + apriltag_detector_destroy(td); + + printf("Apriltag test_package ran successfully\n"); + + return 0; +} diff --git a/recipes/apriltag/all/test_v1_package/CMakeLists.txt b/recipes/apriltag/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/apriltag/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/apriltag/all/test_v1_package/conanfile.py b/recipes/apriltag/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/apriltag/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/apriltag/config.yml b/recipes/apriltag/config.yml new file mode 100644 index 0000000000000..6aa1925bfcd8e --- /dev/null +++ b/recipes/apriltag/config.yml @@ -0,0 +1,7 @@ +versions: + "3.1.4": + folder: all + "3.1.2": + folder: all + "3.1.1": + folder: all diff --git a/recipes/aravis/all/conandata.yml b/recipes/aravis/all/conandata.yml new file mode 100644 index 0000000000000..f4c6ccd2ff9e6 --- /dev/null +++ b/recipes/aravis/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "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.20": + - patch_file: "patches/0.8.19-gst-shared-lib.patch" diff --git a/recipes/aravis/all/conanfile.py b/recipes/aravis/all/conanfile.py new file mode 100644 index 0000000000000..aaa8cad5fb1b4 --- /dev/null +++ b/recipes/aravis/all/conanfile.py @@ -0,0 +1,166 @@ +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 apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, 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.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag +from conan.tools.scm import Version +import os +import glob + +required_conan_version = ">=1.53.0" + + +class AravisConan(ConanFile): + name = "aravis" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AravisProject/aravis" + description = "A vision library for genicam based cameras." + topics = ("usb", "camera") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "usb": [True, False], + "packet_socket": [True, False], + "gst_plugin": [True, False], + "tools": [True, False], + "introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "usb": True, + "packet_socket": True, + "gst_plugin": False, + "tools": True, + "introspection": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.packet_socket + + 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.shared: + self.options["glib"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.75.2") + self.requires("libxml2/2.10.3") + self.requires("zlib/1.2.13") + if self.options.usb: + self.requires("libusb/1.0.26") + if self.options.gst_plugin: + self.requires("gstreamer/1.19.2") + self.requires("gst-plugins-base/1.19.2") + + def validate(self): + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Static runtime is not supported on Windows due to GLib issues") + if self.options.shared and not self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration("Shared Aravis cannot link to static GLib") + if self.settings.os == "Macos" and self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "macOS builds are disabled when glib is shared until " + "conan-io/conan#7324 gets merged to fix macOS SIP issue #8443" + ) + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("glib/2.75.2") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self.options.introspection: + self.tool_requires("gobject-introspection/1.72.0") + + 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 = MesonToolchain(self) + tc.project_options["usb"] = "enabled" if self.options.usb else "disabled" + tc.project_options["gst-plugin"] = "enabled" if self.options.gst_plugin else "disabled" + tc.project_options["packet-socket"] = "enabled" if self.options.get_safe("packet_socket") else "disabled" + tc.project_options["introspection"] = "enabled" if self.options.introspection else "disabled" + tc.project_options["viewer"] = "disabled" + tc.project_options["tests"] = False + tc.project_options["documentation"] = "disabled" + if self.settings.get_safe("compiler.runtime"): + tc.project_options["b_vscrt"] = msvc_runtime_flag(self).lower() + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + meson = Meson(self) + meson.configure() + meson.build() + + def _fix_library_names(self, path): + # https://github.com/mesonbuild/meson/issues/1412 + if not self.options.shared and is_msvc(self): + with chdir(self, path): + for filename_old in glob.glob("*.a"): + filename_new = filename_old[3:-2] + ".lib" + self.output.info(f"rename {filename_old} into {filename_new}") + rename(self, filename_old, filename_new) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + self._fix_library_names(os.path.join(self.package_folder, "lib")) + if self.options.gst_plugin: + self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", self.package_folder, recursive=True) + if not self.options.tools: + rm(self, "arv-*", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + + def package_info(self): + version = Version(self.version) + aravis_name = f"aravis-{version.major}.{version.minor}" + self.cpp_info.set_property("pkg_config_name", aravis_name) + self.cpp_info.includedirs = [os.path.join("include", aravis_name)] + self.cpp_info.libs = [aravis_name] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "pthread", "m", "resolv"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + + if self.options.gst_plugin and self.options.shared: + gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") + self.runenv_info.prepend_path("GST_PLUGIN_PATH", gst_plugin_path) + if self.options.tools: + self.buildenv_info.prepend_path("GST_PLUGIN_PATH", gst_plugin_path) + self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) 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 new file mode 100644 index 0000000000000..fec845831e656 --- /dev/null +++ b/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch @@ -0,0 +1,11 @@ +--- 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/all/test_package/CMakeLists.txt b/recipes/aravis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a5d8c220194f --- /dev/null +++ b/recipes/aravis/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aravis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE aravis::aravis) diff --git a/recipes/aravis/all/test_package/conanfile.py b/recipes/aravis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/aravis/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aravis/all/test_package/test_package.c b/recipes/aravis/all/test_package/test_package.c new file mode 100644 index 0000000000000..9a63b9ea3a864 --- /dev/null +++ b/recipes/aravis/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + printf("Enumerating Aravis interfaces:\n"); + unsigned int if_count = arv_get_n_interfaces(); + for (unsigned int if_index = 0; if_index < if_count; if_index++) { + const char* if_name = arv_get_interface_id(if_index); + if (if_name) + printf("* '%s'\n", if_name); + } + arv_shutdown(); + return EXIT_SUCCESS; +} diff --git a/recipes/aravis/all/test_v1_package/CMakeLists.txt b/recipes/aravis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aravis/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aravis/all/test_v1_package/conanfile.py b/recipes/aravis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aravis/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/aravis/config.yml b/recipes/aravis/config.yml new file mode 100644 index 0000000000000..a7431a882c8d4 --- /dev/null +++ b/recipes/aravis/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.20": + folder: all diff --git a/recipes/archicad-apidevkit/all/conandata.yml b/recipes/archicad-apidevkit/all/conandata.yml new file mode 100644 index 0000000000000..d3788a4383b77 --- /dev/null +++ b/recipes/archicad-apidevkit/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "26": + Macos: + "x86_64": + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/220529.v2022Release.3000.FULL.FIN.MAC64.DevKitAPI.tar.gz" + sha256: "326643eb79619166b6cb8f2858be3b24c1c3e3dd6749d20d2960baa0690f8e9c" + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/licenses.zip" + sha256: "ad798e4760d784a84d2708be77b3c8d7562a88ac8cddbc3177f21a6d6e91772a" + Windows: + "x86_64": + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/220529.v2022Release.3000.FULL.FIN.WIN64.DevKitAPI.zip" + sha256: "588c411b8bb8263bd417c271bb5a8d01136a802cb60116732ab5c1e2fbbf0558" + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/licenses.zip" + sha256: "ad798e4760d784a84d2708be77b3c8d7562a88ac8cddbc3177f21a6d6e91772a" + + "25": + Macos: + "x86_64": + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/210709.v2021Release.3006.FULL.FIN.MAC64.DevKitAPI.tar.gz" + sha256: "d692a59bdec7847ef4632e2c6741be064822a91eda2735dcff768985eaf4ec1e" + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/licenses.zip" + sha256: "ad798e4760d784a84d2708be77b3c8d7562a88ac8cddbc3177f21a6d6e91772a" + Windows: + "x86_64": + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/210519.v2021Release.3002.FULL.FIN.WIN64.DevKitAPI.zip" + sha256: "e7da392408f6150c58f3cba5d4f05118f1eaed4519fdb76895e13aed9ceede97" + - url: "https://stgsswsconan001.blob.core.windows.net/apidevkit/licenses.zip" + sha256: "ad798e4760d784a84d2708be77b3c8d7562a88ac8cddbc3177f21a6d6e91772a" diff --git a/recipes/archicad-apidevkit/all/conanfile.py b/recipes/archicad-apidevkit/all/conanfile.py new file mode 100644 index 0000000000000..55e0ec99e9a6b --- /dev/null +++ b/recipes/archicad-apidevkit/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + + +class ArchicadApidevkitConan(ConanFile): + name = "archicad-apidevkit" + description = "The General API Development Kit enables software developers to extend the functionality of Archicad" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://archicadapi.graphisoft.com/" + license = "LicenseRef-LICENSE" + settings = "os", "compiler", "arch", "build_type" + no_copy_source = True + topics = "api", "archicad", "development" + short_paths = True + + def validate(self): + if self.settings.build_type == "Debug": + raise ConanInvalidConfiguration("Debug configuration is not supported") + if is_msvc(self): + # Approximate requirement for toolset >= v142 + check_min_vs(self, "192") + if not self.info.settings.os in ("Macos", "Windows"): + raise ConanInvalidConfiguration( + f"{self.ref} is not supported by the OS {self.info.settings.os}") + if not str(self.settings.arch) in ("x86_64"): + raise ConanInvalidConfiguration( + f"{self.ref} is not supported yet.") + if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < "16": + raise ConanInvalidConfiguration( + "This recipe does not support this compiler version") + + def build(self): + devkit, licenses = self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)] + get(self, **devkit, destination=os.path.join(self.package_folder, "bin"), strip_root=True) + get(self, **licenses, destination=os.path.join(self.package_folder, "licenses"), strip_root=True) + + def package(self): + copy(self, "bin", src=self.build_folder, dst=self.package_folder) + copy(self, "licenses", src=self.build_folder, dst=self.package_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # These are dependencies of third party vendored libraries + self.cpp_info.system_libs = [ + "WinMM", "MSImg32", "WS2_32", "USP10", "DNSApi"] + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreText", "CoreFoundation", "CoreServices", + "ApplicationServices", "Carbon", "CoreGraphics", "AppKit", "Foundation"] + else: + self.cpp_info.system_libs.extend(["gdiplus", "iphlpapi"]) + + devkit_dir = os.path.join(self.package_folder, "bin") + self.output.info(f"Setting AC_API_DEVKIT_DIR environment variable: {devkit_dir}") + self.env_info.AC_API_DEVKIT_DIR = devkit_dir + self.buildenv_info.define("AC_API_DEVKIT_DIR", devkit_dir) diff --git a/recipes/archicad-apidevkit/all/test_package/CMakeLists.txt b/recipes/archicad-apidevkit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e25d3d3b7690 --- /dev/null +++ b/recipes/archicad-apidevkit/all/test_package/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +function(SetCompilerOptions target ac_version) + if(ac_version GREATER "26") + target_compile_features("${target}" PUBLIC cxx_std_17) + else() + target_compile_features("${target}" PUBLIC cxx_std_14) + endif() +endfunction() + +set(AC_API_DEVKIT_DIR "$ENV{AC_API_DEVKIT_DIR}" CACHE PATH "API DevKit directory.") + +find_package(archicad-apidevkit REQUIRED CONFIG) + +add_executable(test_package test_gsroot.cpp) +SetCompilerOptions(test_package "${archicad-apidevkit_VERSION}") + +if(WIN32) + target_compile_definitions(test_package PRIVATE UNICODE _UNICODE) +else() + target_compile_definitions(test_package PRIVATE macintosh=1) +endif() + +target_include_directories(test_package SYSTEM PRIVATE "${AC_API_DEVKIT_DIR}/Modules/GSRoot") + +if(WIN32) + target_link_libraries( + test_package PRIVATE + "${AC_API_DEVKIT_DIR}/Modules/GSRoot/Win/GSRootImp.lib" + ) +else() + find_library( + GSROOT_FRAMEWORK GSRoot + PATHS "${AC_API_DEVKIT_DIR}/Frameworks" + ) + + if(NOT GSROOT_FRAMEWORK) + message(FATAL_ERROR "GSRoot not found: ${GSROOT_FRAMEWORK}") + endif() + + target_link_libraries(test_package PRIVATE "${GSROOT_FRAMEWORK}") +endif() diff --git a/recipes/archicad-apidevkit/all/test_package/conanfile.py b/recipes/archicad-apidevkit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f6d3c68ca3efb --- /dev/null +++ b/recipes/archicad-apidevkit/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + 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/archicad-apidevkit/all/test_package/test_gsroot.cpp b/recipes/archicad-apidevkit/all/test_package/test_gsroot.cpp new file mode 100644 index 0000000000000..8712d2cd553d3 --- /dev/null +++ b/recipes/archicad-apidevkit/all/test_package/test_gsroot.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main () +{ + Gfx::Color someColor; + someColor.SetRed (176); + + return someColor.GetRed () == 176 ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/archicad-apidevkit/all/test_v1_package/CMakeLists.txt b/recipes/archicad-apidevkit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..50f1488b009a2 --- /dev/null +++ b/recipes/archicad-apidevkit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS KEEP_RPATHS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/archicad-apidevkit/all/test_v1_package/conanfile.py b/recipes/archicad-apidevkit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..af4b5cc85f42f --- /dev/null +++ b/recipes/archicad-apidevkit/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +from conan.errors import ConanInvalidConfiguration +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/archicad-apidevkit/config.yml b/recipes/archicad-apidevkit/config.yml new file mode 100644 index 0000000000000..ca23918e2d0f4 --- /dev/null +++ b/recipes/archicad-apidevkit/config.yml @@ -0,0 +1,5 @@ +versions: + "25": + folder: all + "26": + folder: all diff --git a/recipes/arcus/all/conandata.yml b/recipes/arcus/all/conandata.yml new file mode 100644 index 0000000000000..688b758b7cf3c --- /dev/null +++ b/recipes/arcus/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.9.1": + url: "https://github.com/Ultimaker/libArcus/archive/refs/tags/4.9.1.tar.gz" + sha256: "18d939fd2428c72fdce35a286c196438327cfc3c8476e463e5ca46570168c9ce" +patches: + "4.9.1": + - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/0002-protobuf-compat-ge-3.18.patch" + patch_description: "Compatibility with protobuf >= 3.18" + patch_type: "portability" diff --git a/recipes/arcus/all/conanfile.py b/recipes/arcus/all/conanfile.py new file mode 100644 index 0000000000000..d2e0d9c10f99c --- /dev/null +++ b/recipes/arcus/all/conanfile.py @@ -0,0 +1,114 @@ +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, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class ArcusConan(ConanFile): + name = "arcus" + description = "This library contains C++ code and Python3 bindings for " \ + "creating a socket in a thread and using this socket to send " \ + "and receive messages based on the Protocol Buffers library." + license = "LGPL-3.0-or-later" + topics = ("protobuf", "socket", "cura") + homepage = "https://github.com/Ultimaker/libArcus" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("protobuf/3.21.9") + + 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_PYTHON"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_STATIC"] = not self.options.shared + if is_msvc(self): + tc.variables["MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"Arcus": "Arcus::Arcus"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Arcus") + self.cpp_info.set_property("cmake_target_name", "Arcus") + self.cpp_info.libs = ["Arcus"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Arcus" + self.cpp_info.names["cmake_find_package_multi"] = "Arcus" + 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/arcus/all/patches/0001-fix-cmake.patch b/recipes/arcus/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..581de6fa9b257 --- /dev/null +++ b/recipes/arcus/all/patches/0001-fix-cmake.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ ++cmake_minimum_required(VERSION 3.8) + project(arcus) +-cmake_minimum_required(VERSION 3.6) + + include(GNUInstallDirs) + include(CMakePackageConfigHelpers) +@@ -19,7 +19,6 @@ endif() + set(protobuf_MODULE_COMPATIBLE ON CACHE INTERNAL "" FORCE) + find_package(Protobuf 3.0.0 REQUIRED) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) #Required if a patch to libArcus needs to be made via templates. + + if(BUILD_PYTHON) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +@@ -37,11 +36,7 @@ if(BUILD_PYTHON) + include_directories(python/ src/ ${SIP_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) + endif() + +-set(CMAKE_CXX_STANDARD 11) + +-if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +-endif() + + set(arcus_SRCS + src/Socket.cpp +@@ -63,17 +58,16 @@ set(arcus_HDRS + set(ARCUS_VERSION 1.1.0) + set(ARCUS_SOVERSION 3) + +-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") + + if(BUILD_STATIC) + add_library(Arcus STATIC ${arcus_SRCS}) + if(NOT WIN32 OR CMAKE_COMPILER_IS_GNUCXX) + target_link_libraries(Arcus PRIVATE pthread) +- set_target_properties(Arcus PROPERTIES COMPILE_FLAGS -fPIC) + endif() + else() + add_library(Arcus SHARED ${arcus_SRCS}) + endif() ++target_compile_features(Arcus PUBLIC cxx_std_11) + + if(MSVC_STATIC_RUNTIME) + foreach(flag_var +@@ -97,11 +91,11 @@ target_include_directories(Arcus PUBLIC + $ + ${PROTOBUF_INCLUDE_DIR} + ) +-target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES}) ++target_link_libraries(Arcus PUBLIC protobuf::libprotobuf) + + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0600) # Declare we require Vista or higher, this allows us to use IPv6 functions. +- target_link_libraries(Arcus PUBLIC Ws2_32) ++ target_link_libraries(Arcus PUBLIC ws2_32) + endif() + + if(${CMAKE_BUILD_TYPE}) diff --git a/recipes/arcus/all/patches/0002-protobuf-compat-ge-3.18.patch b/recipes/arcus/all/patches/0002-protobuf-compat-ge-3.18.patch new file mode 100644 index 0000000000000..64e2ba1e5b1a6 --- /dev/null +++ b/recipes/arcus/all/patches/0002-protobuf-compat-ge-3.18.patch @@ -0,0 +1,22 @@ +--- a/src/Socket_p.h ++++ b/src/Socket_p.h +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #include "Socket.h" + #include "Types.h" +@@ -548,7 +549,11 @@ namespace Arcus + + google::protobuf::io::ArrayInputStream array(wire_message->data, wire_message->size); + google::protobuf::io::CodedInputStream stream(&array); ++#if GOOGLE_PROTOBUF_VERSION >= 3006000 ++ stream.SetTotalBytesLimit(message_size_maximum); ++#else + stream.SetTotalBytesLimit(message_size_maximum, message_size_warning); ++#endif + if(!message->ParseFromCodedStream(&stream)) + { + error(ErrorCode::ParseFailedError, "Failed to parse message:" + std::string(wire_message->data)); diff --git a/recipes/arcus/all/test_package/CMakeLists.txt b/recipes/arcus/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..376d65791e678 --- /dev/null +++ b/recipes/arcus/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Arcus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Arcus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/arcus/all/test_package/conanfile.py b/recipes/arcus/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/arcus/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/arcus/all/test_package/test_package.cpp b/recipes/arcus/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f213963f9dbec --- /dev/null +++ b/recipes/arcus/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + Arcus::Socket socket; + return 0; +} diff --git a/recipes/arcus/all/test_v1_package/CMakeLists.txt b/recipes/arcus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/arcus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/arcus/all/test_v1_package/conanfile.py b/recipes/arcus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/arcus/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/arcus/config.yml b/recipes/arcus/config.yml new file mode 100644 index 0000000000000..4831b25407aa2 --- /dev/null +++ b/recipes/arcus/config.yml @@ -0,0 +1,3 @@ +versions: + "4.9.1": + folder: all diff --git a/recipes/arduinojson/all/conandata.yml b/recipes/arduinojson/all/conandata.yml new file mode 100644 index 0000000000000..d44d34b58314d --- /dev/null +++ b/recipes/arduinojson/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "6.21.2": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.2/ArduinoJson-v6.21.2.zip" + sha256: "1dc888061f6e7828f7a0a4e71bf059796e5ce202ce6ddb4e3a2e384d32b5cba0" + "6.21.0": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.0/ArduinoJson-v6.21.0.zip" + sha256: "08f7cad5fca2393c40fcb479c43235a2fa7da1a40331377ddf617eda2f123583" + "6.20.1": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.20.1/ArduinoJson-v6.20.1.zip" + sha256: "3dc53f55dcb6913b9a097263852ddc7c030f6d93c8cf00efb5d0eff3dd4bd8b9" + "6.19.4": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.19.4/ArduinoJson-v6.19.4.zip" + sha256: "5d1d778a438efd298d9e378e086e1ccf7b01903315ffc8a68ec31b98d6cb3039" + "6.18.5": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.18.5/ArduinoJson-v6.18.5.zip" + sha256: "f10a904fa1f6372ee069ed2a5eff50530a29e9c10958a5bd24ce62eda7f7d74e" + "6.18.0": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.18.0/ArduinoJson-v6.18.0.zip" + sha256: "2ade6a0097845d6bc0292a7f9ffa58cbd7e11a34a26616ac9e40a7754a18f1a9" + "6.16.1": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.16.1/ArduinoJson-v6.16.1.zip" + sha256: "d8cab18d50a9487766e195c68c14a552403994ecae3e5051d509e62914444ecd" + "6.15.2": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.15.2/ArduinoJson-v6.15.2.zip" + sha256: "84f89197bf5161ddccaf74dc288ce7bcc307f5ffef4b17e2ddab3c2f88cc6da9" diff --git a/recipes/arduinojson/all/conanfile.py b/recipes/arduinojson/all/conanfile.py new file mode 100644 index 0000000000000..74cc1a0a27699 --- /dev/null +++ b/recipes/arduinojson/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class ArduinojsonConan(ConanFile): + name = "arduinojson" + description = "C++ JSON library for IoT. Simple and efficient." + homepage = "https://github.com/bblanchon/ArduinoJson" + topics = ("json", "arduino", "iot", "embedded", "esp8266") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "98" if Version(self.version) < "6.21.0" else "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): + has_arduinojson_root=Version(self.version) < "6.18.2" + get(self, **self.conan_data["sources"][self.version], strip_root=has_arduinojson_root) + + 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=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"ArduinoJson": "ArduinoJson::ArduinoJson"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "ArduinoJson") + self.cpp_info.set_property("cmake_target_name", "ArduinoJson") + 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"] = "ArduinoJson" + self.cpp_info.names["cmake_find_package_multi"] = "ArduinoJson" + 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/arduinojson/all/test_package/CMakeLists.txt b/recipes/arduinojson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..759822ccd5496 --- /dev/null +++ b/recipes/arduinojson/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ArduinoJson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ArduinoJson) +if(ArduinoJson_VERSION VERSION_GREATER_EQUAL "6.21.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/arduinojson/all/test_package/conanfile.py b/recipes/arduinojson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/arduinojson/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/arduinojson/all/test_package/test_package.cpp b/recipes/arduinojson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..240a2c8d2ba60 --- /dev/null +++ b/recipes/arduinojson/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include + +int main(void) +{ + char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; + + DynamicJsonDocument doc(1024); + + deserializeJson(doc, json); + + const char* sensor = doc["sensor"].as(); + int time = doc["time"].as(); + double latitude = doc["data"][0].as(); + double longitude = doc["data"][1].as(); + + std::cout << "sensor: " << sensor << std::endl; + std::cout << "time: " << time << std::endl; + std::cout << "latitude: " << latitude << std::endl; + std::cout << "longitude: " << longitude << std::endl; + + return 0; +} diff --git a/recipes/arduinojson/all/test_v1_package/CMakeLists.txt b/recipes/arduinojson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/arduinojson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/arduinojson/all/test_v1_package/conanfile.py b/recipes/arduinojson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/arduinojson/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/arduinojson/config.yml b/recipes/arduinojson/config.yml new file mode 100644 index 0000000000000..3358de6326521 --- /dev/null +++ b/recipes/arduinojson/config.yml @@ -0,0 +1,17 @@ +versions: + "6.21.2": + folder: all + "6.21.0": + folder: all + "6.20.1": + folder: all + "6.19.4": + folder: all + "6.18.5": + folder: all + "6.18.0": + folder: all + "6.16.1": + folder: all + "6.15.2": + folder: all diff --git a/recipes/arg_router/all/conandata.yml b/recipes/arg_router/all/conandata.yml new file mode 100644 index 0000000000000..6908e33d995b8 --- /dev/null +++ b/recipes/arg_router/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.0": + url: "https://github.com/cmannett85/arg_router/archive/refs/tags/v1.3.0.tar.gz" + sha256: "4ef2ec923046c26d65b19f06630b3180a81189362d8920a68113c7d921ca968b" diff --git a/recipes/arg_router/all/conanfile.py b/recipes/arg_router/all/conanfile.py new file mode 100644 index 0000000000000..54aaba2c90442 --- /dev/null +++ b/recipes/arg_router/all/conanfile.py @@ -0,0 +1,57 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, rmdir +from conan.tools.cmake import CMake, cmake_layout + + +class arg_routerRecipe(ConanFile): + name = "arg_router" + license = "BSL-1.0" + homepage = "https://github.com/cmannett85/arg_router" + url = "https://github.com/conan-io/conan-center-index" + description = "C++ command line argument parsing and routing." + topics = ("cpp", "command-line", "argument-parser", "header-only") + + # CMake >= 3.18 is required https://github.com/cmannett85/arg_router/blob/449567723d6c0e9db0a4c89277066c9a53b299fa/CMakeLists.txt#L5 + tool_requires = "cmake/3.25.3" + requires = "boost/1.81.0", "span-lite/0.10.3" + + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + generators = "CMakeDeps", "CMakeToolchain" + no_copy_source = True + + def validate(self): + check_min_cppstd(self, 17) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def build(self): + cmake = CMake(self) + cmake.configure(variables={"INSTALLATION_ONLY": True}) + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + # Folders not used for header-only + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "arg_router") + self.cpp_info.set_property( + "cmake_target_name", "arg_router::arg_router") + + def package_id(self): + # build_type and compiler are needed for the Conan's CMake tools but are not actually used + self.info.clear() diff --git a/recipes/arg_router/all/test_package/CMakeLists.txt b/recipes/arg_router/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..39ee9fb7862e2 --- /dev/null +++ b/recipes/arg_router/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(conan_test_project + LANGUAGES CXX) + +find_package(arg_router REQUIRED) + +add_executable(conan_test_project "main.cpp") +target_link_libraries(conan_test_project PUBLIC arg_router::arg_router) diff --git a/recipes/arg_router/all/test_package/conanfile.py b/recipes/arg_router/all/test_package/conanfile.py new file mode 100644 index 0000000000000..900fcbc977e1b --- /dev/null +++ b/recipes/arg_router/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "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, + "conan_test_project") + " --help" + self.run(cmd, env="conanrun") diff --git a/recipes/arg_router/all/test_package/main.cpp b/recipes/arg_router/all/test_package/main.cpp new file mode 100644 index 0000000000000..21d89bdc8696a --- /dev/null +++ b/recipes/arg_router/all/test_package/main.cpp @@ -0,0 +1,61 @@ +#include + +namespace ar = arg_router; +namespace arp = ar::policy; + +#if (__cplusplus >= 202002L) +using namespace ar::literals; + +int main(int argc, char *argv[]) { + ar::root( + arp::validation::default_validator, + ar::help("help"_S, "h"_S, "Display this help and exit"_S, + arp::program_name_t{"just-cats"_S}, + arp::program_intro_t{"Prints cats!"_S}, + arp::program_addendum_t{"An example program for arg_router."_S}), + ar::flag("cat"_S, "English cat"_S, + arp::router{[](bool) { std::cout << "cat" << std::endl; }}), + ar::flag("猫"_S, // + arp::description_t{"日本語の猫"_S}, + arp::router{[](bool) { std::cout << "猫" << std::endl; }}), + ar::flag("🐱"_S, // + arp::description_t{"Emoji cat"_S}, + arp::router{[](bool) { std::cout << "🐱" << std::endl; }}), + ar::flag("แมว"_S, // + "แมวไทย"_S, + arp::router{[](bool) { std::cout << "แมว" << std::endl; }}), + ar::flag("кіт"_S, // + "український кіт"_S, + arp::router{[](bool) { std::cout << "кіт" << std::endl; }})) + .parse(argc, argv); + + return EXIT_SUCCESS; +} +#else +int main(int argc, char *argv[]) { + ar::root( + arp::validation::default_validator, + ar::help(S_("help"){}, S_('h'){}, S_("Display this help and exit"){}, + arp::program_name, + arp::program_intro, + arp::program_addendum), + ar::flag(S_("cat"){}, // + S_("English cat"){}, + arp::router{[](bool) { std::cout << "cat" << std::endl; }}), + ar::flag(S_("猫"){}, // + arp::description, + arp::router{[](bool) { std::cout << "猫" << std::endl; }}), + ar::flag(S_("🐱"){}, // + arp::description, + arp::router{[](bool) { std::cout << "🐱" << std::endl; }}), + ar::flag(S_("แมว"){}, // + S_("แมวไทย"){}, + arp::router{[](bool) { std::cout << "แมว" << std::endl; }}), + ar::flag(S_("кіт"){}, // + S_("український кіт"){}, + arp::router{[](bool) { std::cout << "кіт" << std::endl; }})) + .parse(argc, argv); + + return EXIT_SUCCESS; +} +#endif diff --git a/recipes/arg_router/all/test_v1_package/CMakeLists.txt b/recipes/arg_router/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8689ccd828863 --- /dev/null +++ b/recipes/arg_router/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) + +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/arg_router/all/test_v1_package/conanfile.py b/recipes/arg_router/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ea5b012df89c5 --- /dev/null +++ b/recipes/arg_router/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", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindir, + "conan_test_project") + " --help" + self.run(cmd, env="conanrun") diff --git a/recipes/arg_router/config.yml b/recipes/arg_router/config.yml new file mode 100644 index 0000000000000..a1e000ca33c5b --- /dev/null +++ b/recipes/arg_router/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.3.0": + folder: all diff --git a/recipes/argh/all/conandata.yml b/recipes/argh/all/conandata.yml new file mode 100644 index 0000000000000..2335ee8915d08 --- /dev/null +++ b/recipes/argh/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.3.2": + url: "https://github.com/adishavit/argh/archive/v1.3.2.tar.gz" + sha256: "4b76d8c55e97cc0752feee4f00b99dc58464dd030dea9ba257c0a7d24a84f9dd" + "1.3.1": + url: "https://github.com/adishavit/argh/archive/refs/tags/v1.3.1.tar.gz" + sha256: "48e09999f2768afbe90ef98864980933cf0ed5323dce3593c3f2f44b0ffda3de" diff --git a/recipes/argh/all/conanfile.py b/recipes/argh/all/conanfile.py new file mode 100644 index 0000000000000..f6f6a44814ca4 --- /dev/null +++ b/recipes/argh/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class ArgparseConan(ConanFile): + name = "argh" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/adishavit/argh" + topics = ("argh", "argument", "parsing") + license = "BSD-3" + description = "Frustration-free command line processing" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "argh.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"argh": "argh::argh"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "argh") + self.cpp_info.set_property("cmake_target_name", "argh") + 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.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/argh/all/test_package/CMakeLists.txt b/recipes/argh/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fcd79af5da306 --- /dev/null +++ b/recipes/argh/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(argh REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE argh) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/argh/all/test_package/conanfile.py b/recipes/argh/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/argh/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/argh/all/test_package/test_package.cpp b/recipes/argh/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3baffebd6a9cb --- /dev/null +++ b/recipes/argh/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +int main(int, char* argv[]) +{ // if this works, the package works + argh::parser cmdl(argv); + + if (cmdl[{ "-v", "--verbose" }]) + std::cout << "Working.\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/argh/all/test_v1_package/CMakeLists.txt b/recipes/argh/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..65e0578c4c0f6 --- /dev/null +++ b/recipes/argh/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(argh REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE argh) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/argh/all/test_v1_package/conanfile.py b/recipes/argh/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c394e09142659 --- /dev/null +++ b/recipes/argh/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package")) diff --git a/recipes/argh/config.yml b/recipes/argh/config.yml new file mode 100644 index 0000000000000..4977bb7915a7c --- /dev/null +++ b/recipes/argh/config.yml @@ -0,0 +1,5 @@ +versions: + "1.3.2": + folder: all + "1.3.1": + folder: all diff --git a/recipes/argon2/all/conandata.yml b/recipes/argon2/all/conandata.yml new file mode 100644 index 0000000000000..9241ad3ee86cd --- /dev/null +++ b/recipes/argon2/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "20190702": + url: "https://github.com/P-H-C/phc-winner-argon2/archive/20190702.tar.gz" + sha256: "daf972a89577f8772602bf2eb38b6a3dd3d922bf5724d45e7f9589b5e830442c" +patches: + "20190702": + - patch_file: "patches/0001-makefile-no-march.patch" diff --git a/recipes/argon2/all/conanfile.py b/recipes/argon2/all/conanfile.py new file mode 100644 index 0000000000000..9881bc93bce37 --- /dev/null +++ b/recipes/argon2/all/conanfile.py @@ -0,0 +1,166 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, chdir, copy, export_conandata_patches, get, mkdir, + 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, MSBuild, MSBuildToolchain +import os + +required_conan_version = ">=1.53.0" + + +class Argon2Conan(ConanFile): + name = "argon2" + license = "Apache 2.0", "CC0-1.0" + homepage = "https://github.com/P-H-C/phc-winner-argon2" + url = "https://github.com/conan-io/conan-center-index" + description = "Argon2 password hashing library" + topics = ("crypto", "password hashing") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _kernel_name(self): + if is_apple_os(self): + return "Darwin" + return { + "Windows": "MINGW", + }.get(str(self.settings.os), str(self.settings.os)) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.properties["WholeProgramOptimization"] = "false" + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.make_args.extend([ + "LIBRARY_REL=lib", + f"KERNEL_NAME={self._kernel_name}", + "RUN_EXT={}".format(".exe" if self.settings.os == "Windows" else ""), + ]) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + vcxproj = os.path.join(self.source_folder, "vs2015", "Argon2OptDll", "Argon2OptDll.vcxproj") + argon2_header = os.path.join(self.source_folder, "include", "argon2.h") + if not self.options.shared: + replace_in_file(self, argon2_header, "__declspec(dllexport)", "") + replace_in_file(self, vcxproj, "DynamicLibrary", "StaticLibrary") + replace_in_file( + self, vcxproj, + "", + "$(SolutionDir)include;%(AdditionalIncludeDirectories)", + ) + replace_in_file(self, vcxproj, "8.1", "") + + #========================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file(self, vcxproj, "true", "") + platform_toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, vcxproj, + "$(DefaultPlatformToolset)", + f"{platform_toolset}", + ) + replace_in_file( + self, vcxproj, + "", + f"", + ) + #========================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.build(os.path.join(self.source_folder, "Argon2.sln"), targets=["Argon2OptDll"]) + if self.options.shared: + replace_in_file(self, argon2_header, "__declspec(dllexport)", "__declspec(dllimport)") + else: + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make(target="libs") + + def package(self): + copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + bin_folder = os.path.join(self.package_folder, "bin") + lib_folder = os.path.join(self.package_folder, "lib") + if is_msvc(self): + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + output_folder = os.path.join(self.source_folder, "vs2015", "build") + copy(self, "*.dll", src=output_folder, dst=bin_folder, keep_path=False) + copy(self, "*.lib", src=output_folder, dst=lib_folder, keep_path=False) + rename(self, os.path.join(lib_folder, "Argon2OptDll.lib"), os.path.join(lib_folder, "argon2.lib")) + else: + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}", "PREFIX=/"]) + rmdir(self, os.path.join(lib_folder, "pkgconfig")) + rmdir(self, bin_folder) + if self.options.shared: + rm(self, "*.a", lib_folder) + if self.settings.os == "Windows": + mkdir(self, bin_folder) + rename(self, os.path.join(lib_folder, "libargon2.dll"), os.path.join(bin_folder, "libargon2.dll")) + copy(self, "libargon2.dll.a", src=self.source_folder, dst=lib_folder) + else: + rm(self, "*.dll", lib_folder) + rm(self, "*.so*", lib_folder) + rm(self, "*.dylib", lib_folder) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libargon2") + self.cpp_info.libs = ["argon2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/argon2/all/patches/0001-makefile-no-march.patch b/recipes/argon2/all/patches/0001-makefile-no-march.patch new file mode 100644 index 0000000000000..1a7f938c9332d --- /dev/null +++ b/recipes/argon2/all/patches/0001-makefile-no-march.patch @@ -0,0 +1,34 @@ +- Pass bin extension though Makefile args (.exe for mingw) +- Remove -march= such that consumers of argon2 can add a more specialized `-march=...` to their profile. + +--- Makefile ++++ Makefile +@@ -15,7 +15,7 @@ + # software. If not, they may be obtained at the above URLs. + # + +-RUN = argon2 ++RUN = argon2$(RUN_EXT) + BENCH = bench + GENKAT = genkat + ARGON2_VERSION ?= ZERO +--- Makefile ++++ Makefile +@@ -49,7 +49,7 @@ + -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM + + OPTTARGET ?= native +-OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \ ++OPTTEST := $(shell $(CC) $(CFLAGS) -Iinclude -Isrc src/opt.c -c \ + -o /dev/null 2>/dev/null; echo $$?) + # Detect compatible platform + ifneq ($(OPTTEST), 0) +@@ -57,7 +57,7 @@ + SRC += src/ref.c + else + $(info Building with optimizations for $(OPTTARGET)) +- CFLAGS += -march=$(OPTTARGET) ++ #CFLAGS += -march=$(OPTTARGET) + SRC += src/opt.c + endif + diff --git a/recipes/argon2/all/test_package/CMakeLists.txt b/recipes/argon2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..665425a420e57 --- /dev/null +++ b/recipes/argon2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(argon2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE argon2::argon2) diff --git a/recipes/argon2/all/test_package/conanfile.py b/recipes/argon2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/argon2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/argon2/all/test_package/test_package.c b/recipes/argon2/all/test_package/test_package.c new file mode 100644 index 0000000000000..e53c74b315943 --- /dev/null +++ b/recipes/argon2/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include "argon2.h" +#include + +int main() { + const char *salt = "SALTSTR"; + const char *pwd = "password"; + + char encoded[97]; + + // high-level API + argon2id_hash_encoded(2, 1<<16, 2, pwd, sizeof(pwd), salt, sizeof(salt), 32, encoded, sizeof(encoded)); + + printf("Encoded password: %s", encoded); + int res = argon2id_verify(encoded, pwd, sizeof(pwd)); + + if (res == 0){ + printf("Verify password OK\n"); + } else { + printf("Something went wrong while verify password\n"); + } + + return 0; +} diff --git a/recipes/argon2/all/test_v1_package/CMakeLists.txt b/recipes/argon2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/argon2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/argon2/all/test_v1_package/conanfile.py b/recipes/argon2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/argon2/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/argon2/config.yml b/recipes/argon2/config.yml new file mode 100644 index 0000000000000..1c97263cf858f --- /dev/null +++ b/recipes/argon2/config.yml @@ -0,0 +1,3 @@ +versions: + "20190702": + folder: all diff --git a/recipes/argparse/all/conandata.yml b/recipes/argparse/all/conandata.yml new file mode 100644 index 0000000000000..18f4555649896 --- /dev/null +++ b/recipes/argparse/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "2.9": + url: "https://github.com/p-ranav/argparse/archive/v2.9.tar.gz" + sha256: "cd563293580b9dc592254df35b49cf8a19b4870ff5f611c7584cf967d9e6031e" + "2.6": + url: "https://github.com/p-ranav/argparse/archive/v2.6.tar.gz" + sha256: "da261c3b3010c10a163f4535bbe2b160319d2a6b1e0fd2eb5a7b9f6a85c29021" + "2.5": + url: "https://github.com/p-ranav/argparse/archive/refs/tags/v2.5.tar.gz" + sha256: "aad087125bed01ae73e650ce33f9a5edbcbceb6c30f6a43824b1afa8df5a6fac" + "2.4": + url: "https://github.com/p-ranav/argparse/archive/refs/tags/v2.4.tar.gz" + sha256: "3589559f115bfedfef2edffb3e7b61d88657ba7b70a0b1f47352ff3043abc825" + "2.3": + url: "https://github.com/p-ranav/argparse/archive/v2.3.tar.gz" + sha256: "6895d0f30d250ebb58bd93c1f07dbbcd0234216cb99ccc3ad211aa769bc5cf43" + "2.2": + url: "https://github.com/p-ranav/argparse/archive/v2.2.tar.gz" + sha256: "f0fc6ab7e70ac24856c160f44ebb0dd79dc1f7f4a614ee2810d42bb73799872b" + "2.1": + url: "https://github.com/p-ranav/argparse/archive/v2.1.tar.gz" + sha256: "0a82f464b568b8ee6650fc837f371eb9c81417e2ef9fb3b51f65ad50fa3b8662" +patches: + "2.4": + - patch_file: "patches/0001-v2.3-add-missing-include.patch" + "2.3": + - patch_file: "patches/0001-v2.3-add-missing-include.patch" + "2.2": + - patch_file: "patches/0001-v2.2-add-missing-include.patch" + "2.1": + - patch_file: "patches/0001-v2.1-add-missing-include.patch" diff --git a/recipes/argparse/all/conanfile.py b/recipes/argparse/all/conanfile.py new file mode 100644 index 0000000000000..e7e9de237fe52 --- /dev/null +++ b/recipes/argparse/all/conanfile.py @@ -0,0 +1,84 @@ +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, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class ArgparseConan(ConanFile): + name = "argparse" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/argparse" + topics = ("argparse", "argument", "parsing") + license = "MIT" + description = "Argument Parser for Modern C++" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7" if Version(self.version) <= "2.1" else "8", + "clang": "5" if Version(self.version) <= "2.1" else "7", + # trantor/2.5 uses [[maybe_unused]] in range-based for loop + # Visual Studio 15 doesn't support it: + # https://developercommunity.visualstudio.com/t/compiler-bug-on-parsing-maybe-unused-in-range-base/209488 + "Visual Studio": "15" if Version(self.version) < "2.5" else "16", + "msvc": "191" if Version(self.version) < "2.5" else "192", + "apple-clang": "10", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if Version(self.version) > "2.1" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++": + raise ConanInvalidConfiguration("This recipe does not permit >2.1 with clang and stdlibc++. There may be an infrastructure issue in CCI.") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + 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")) + if Version(self.version) <= "2.1": + include_dst = os.path.join(self.package_folder, "include", "argparse") + else: + include_dst = os.path.join(self.package_folder, "include") + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=include_dst) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "argparse") + self.cpp_info.set_property("cmake_target_name", "argparse::argparse") + self.cpp_info.set_property("pkg_config_name", "argparse") + if Version(self.version) <= "2.1": + self.cpp_info.includedirs.append(os.path.join("include", "argparse")) + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/argparse/all/patches/0001-v2.1-add-missing-include.patch b/recipes/argparse/all/patches/0001-v2.1-add-missing-include.patch new file mode 100644 index 0000000000000..245ce23c3652e --- /dev/null +++ b/recipes/argparse/all/patches/0001-v2.1-add-missing-include.patch @@ -0,0 +1,12 @@ +diff --git a/include/argparse.hpp b/include/argparse.hpp +index 30c42da..7bf16a3 100644 +--- a/include/argparse.hpp ++++ b/include/argparse.hpp +@@ -44,6 +44,7 @@ SOFTWARE. + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/argparse/all/patches/0001-v2.2-add-missing-include.patch b/recipes/argparse/all/patches/0001-v2.2-add-missing-include.patch new file mode 100644 index 0000000000000..8e3c371c754b3 --- /dev/null +++ b/recipes/argparse/all/patches/0001-v2.2-add-missing-include.patch @@ -0,0 +1,12 @@ +diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp +index 7da3462..efd78b2 100644 +--- a/include/argparse/argparse.hpp ++++ b/include/argparse/argparse.hpp +@@ -47,6 +47,7 @@ SOFTWARE. + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/argparse/all/patches/0001-v2.3-add-missing-include.patch b/recipes/argparse/all/patches/0001-v2.3-add-missing-include.patch new file mode 100644 index 0000000000000..4d0fbae4e910e --- /dev/null +++ b/recipes/argparse/all/patches/0001-v2.3-add-missing-include.patch @@ -0,0 +1,12 @@ +diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp +index 55828ed..112534b 100644 +--- a/include/argparse/argparse.hpp ++++ b/include/argparse/argparse.hpp +@@ -48,6 +48,7 @@ SOFTWARE. + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/argparse/all/test_package/CMakeLists.txt b/recipes/argparse/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e8794b9790e15 --- /dev/null +++ b/recipes/argparse/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(argparse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE argparse::argparse) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/argparse/all/test_package/conanfile.py b/recipes/argparse/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a972d9e6309b9 --- /dev/null +++ b/recipes/argparse/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + val = 42 + self.run(f"{bin_path} {val}", env="conanrun") diff --git a/recipes/argparse/all/test_package/test_package.cpp b/recipes/argparse/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c2df16ddec35f --- /dev/null +++ b/recipes/argparse/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include + +int main(int argc, char *argv[]) { + argparse::ArgumentParser program("test_package"); + + program.add_argument("square") + .help("display the square of a given integer") + .action([](const std::string& value) { return std::stoi(value); }); + + try { + program.parse_args(argc, argv); + } + catch (const std::runtime_error& err) { + std::cout << err.what() << std::endl; + std::cout << program; + return 0; + } + + auto input = program.get("square"); + std::cout << (input * input) << std::endl; + + return 0; +} diff --git a/recipes/argparse/all/test_v1_package/CMakeLists.txt b/recipes/argparse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..59cfa3b376305 --- /dev/null +++ b/recipes/argparse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(argparse REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE argparse::argparse) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/argparse/all/test_v1_package/conanfile.py b/recipes/argparse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a3b19a8d499a6 --- /dev/null +++ b/recipes/argparse/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + val = 42 + self.run(f"{bin_path} {val}", run_environment=True) diff --git a/recipes/argparse/config.yml b/recipes/argparse/config.yml new file mode 100644 index 0000000000000..5a743e89da3ef --- /dev/null +++ b/recipes/argparse/config.yml @@ -0,0 +1,15 @@ +versions: + "2.9": + folder: all + "2.6": + folder: all + "2.5": + folder: all + "2.4": + folder: all + "2.3": + folder: all + "2.2": + folder: all + "2.1": + folder: all diff --git a/recipes/args-parser/all/conandata.yml b/recipes/args-parser/all/conandata.yml new file mode 100644 index 0000000000000..787c510a62b53 --- /dev/null +++ b/recipes/args-parser/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "6.3.2": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.2.tar.gz" + sha256: "cd89549a9f5b5cfd16db2f8b9c93fd164cea334147c58890d5322365789e05e5" + "6.3.1": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.1.tar.gz" + sha256: "7509639553708baf03aca57cfb0c9e5824b705782b69ebb71de5e4f1c6ad18ab" + "6.3.0": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.0.tar.gz" + sha256: "a21d1ad1b4648f3fff0fe898514040312c7eae17b6347cb9aa1da5c74d9815f0" + "6.2.0.1": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.2.0.1.tar.gz" + sha256: "9fd34a717f9dbaf1ebbce35645f71ce1f5079ced8d6b77a240911bd580914ecd" + "6.2.0.0": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.2.0.0.tar.gz" + sha256: "77aa15ad637e48ddbf7dca1311519ad53d73fee6395989f7922754da59138915" + "6.1.1.0": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.1.1.0.tar.gz" + sha256: "41135cb79034f8f8940fc0bd0346059446df98a8df47ca461af8757e9cb3e33b" + "6.1.0.0": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.1.0.0.tar.gz" + sha256: "f6fadc1458e8821160a287a7dd096e94a36f968ba9719fa2a7ce8cec6bfb6969" + "6.0.1.0": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.0.1.0.tar.gz" + sha256: "d3569ee05f89d361f28fcca32e5ff782578e55aeea5559ebf1f394a689e2ae26" diff --git a/recipes/args-parser/all/conanfile.py b/recipes/args-parser/all/conanfile.py new file mode 100644 index 0000000000000..f4ea312819ef0 --- /dev/null +++ b/recipes/args-parser/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class ArgsParserConan(ConanFile): + name = "args-parser" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/igormironchik/args-parser" + license = "MIT" + description = "Small C++ header-only library for parsing command line arguments." + topics = ("argument", "parsing") + 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": "3.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.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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, 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): + self.cpp_info.set_property("cmake_file_name", "args-parser") + self.cpp_info.set_property("cmake_target_name", "args-parser::args-parser") + self.cpp_info.includedirs.append(os.path.join("include", "args-parser")) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/args-parser/all/test_package/CMakeLists.txt b/recipes/args-parser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..94b80c9c35998 --- /dev/null +++ b/recipes/args-parser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(args-parser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE args-parser::args-parser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/args-parser/all/test_package/conanfile.py b/recipes/args-parser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/args-parser/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/args-parser/all/test_package/test_package.cpp b/recipes/args-parser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..35aa3c5547a70 --- /dev/null +++ b/recipes/args-parser/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include + +int main() +{ + static const int argc = 2; + static const char * argv[argc] = {"args-parser.test", "-a"}; + + Args::CmdLine cmd(argc, argv); + + try { + cmd.addArgWithFlagOnly('a'); + + cmd.parse(); + } + catch(const Args::BaseException &) + { + return 1; + } + + if(cmd.isDefined("-a")) + return 0; + else + return 1; +} diff --git a/recipes/args-parser/all/test_v1_package/CMakeLists.txt b/recipes/args-parser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/args-parser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/args-parser/all/test_v1_package/conanfile.py b/recipes/args-parser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/args-parser/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/args-parser/config.yml b/recipes/args-parser/config.yml new file mode 100644 index 0000000000000..08a70490fa0ab --- /dev/null +++ b/recipes/args-parser/config.yml @@ -0,0 +1,17 @@ +versions: + "6.3.2": + folder: all + "6.3.1": + folder: all + "6.3.0": + folder: all + "6.2.0.1": + folder: all + "6.2.0.0": + folder: all + "6.1.1.0": + folder: all + "6.1.0.0": + folder: all + "6.0.1.0": + folder: all diff --git a/recipes/argtable2/all/conandata.yml b/recipes/argtable2/all/conandata.yml new file mode 100644 index 0000000000000..d126dc0b958f8 --- /dev/null +++ b/recipes/argtable2/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.13": + url: "http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz" + sha256: "8f77e8a7ced5301af6e22f47302fdbc3b1ff41f2b83c43c77ae5ca041771ddbf" +patches: + "2.13": + - patch_file: "patches/2.13-0001-enable-mingw-dll.patch" + - patch_file: "patches/2.13-0002-msvc-nmake-honor-profile.patch" + - patch_file: "patches/2.13-0003-armv8-build.patch" diff --git a/recipes/argtable2/all/conanfile.py b/recipes/argtable2/all/conanfile.py new file mode 100644 index 0000000000000..4e3ccd375b1a6 --- /dev/null +++ b/recipes/argtable2/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain +import os + +required_conan_version = ">=1.55.0" + + +class Argtable2Conan(ConanFile): + name = "argtable2" + description = "Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss." + topics = ("argument", "parsing", "getopt") + license = "LGPL-2.0+" + homepage = "http://argtable.sourceforge.net/" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + with chdir(self, os.path.join(self.source_folder, "src")): + target = "argtable2.dll" if self.options.shared else "argtable2.lib" + self.run(f"nmake -f Makefile.nmake {target}") + else: + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + output_folder = os.path.join(self.source_folder, "src") + copy(self, "*.lib", src=output_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "argtable2.h", src=output_folder, dst=os.path.join(self.package_folder, "include"), keep_path=False) + if self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "impargtable2.lib"), + os.path.join(self.package_folder, "lib", "argtable2.lib")) + else: + 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")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "argtable2") + self.cpp_info.libs = ["argtable2"] diff --git a/recipes/argtable2/all/patches/2.13-0001-enable-mingw-dll.patch b/recipes/argtable2/all/patches/2.13-0001-enable-mingw-dll.patch new file mode 100644 index 0000000000000..c75358a44b350 --- /dev/null +++ b/recipes/argtable2/all/patches/2.13-0001-enable-mingw-dll.patch @@ -0,0 +1,11 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -239,7 +239,7 @@ + # argtable-2.11 is 1:6:1 (minor tweaks to makefiles, src code is identical to argtable-2.8) + # argtable-2.12 is 1:7:1 (added support for parsing hex,octal,binary integer formats) + # argtable-2.13 is 1:8:1 (added CMake support and improved parsing of filenames) +-libargtable2_la_LDFLAGS = -version-info 1:8:1 ++libargtable2_la_LDFLAGS = -version-info 1:8:1 -no-undefined + include_HEADERS = argtable2.h + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/recipes/argtable2/all/patches/2.13-0002-msvc-nmake-honor-profile.patch b/recipes/argtable2/all/patches/2.13-0002-msvc-nmake-honor-profile.patch new file mode 100644 index 0000000000000..5fc8451015ecb --- /dev/null +++ b/recipes/argtable2/all/patches/2.13-0002-msvc-nmake-honor-profile.patch @@ -0,0 +1,14 @@ +--- a/src/Makefile.nmake ++++ b/src/Makefile.nmake +@@ -16,9 +16,9 @@ + CFLAGS = /W4 /D "WIN32" /D "_MBCS" /D "STDC_HEADERS" /D "HAVE_STDLIB_H" /D "HAVE_STRING_H" /nologo + + !IF "$(DEBUG)" == "1" +-CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /MLd /RTC1 /ZI ++CFLAGS = $(CFLAGS) /D "_DEBUG" + !ELSE +-CFLAGS = $(CFLAGS) /D "NDEBUG" /O2 /ML /GS /Zi ++CFLAGS = $(CFLAGS) /D "NDEBUG" + !ENDIF + + all: argtable2.lib argtable2.dll diff --git a/recipes/argtable2/all/patches/2.13-0003-armv8-build.patch b/recipes/argtable2/all/patches/2.13-0003-armv8-build.patch new file mode 100644 index 0000000000000..84bce24b2273d --- /dev/null +++ b/recipes/argtable2/all/patches/2.13-0003-armv8-build.patch @@ -0,0 +1,12 @@ +diff --git a/src/arg_int.c b/src/arg_int.c +index 29c20e5..bc10012 100644 +--- a/src/arg_int.c ++++ b/src/arg_int.c +@@ -30,6 +30,7 @@ USA. + + #include "argtable2.h" + #include ++#include + + /* local error codes */ + enum {EMINCOUNT=1,EMAXCOUNT,EBADINT,EOVERFLOW}; diff --git a/recipes/argtable2/all/test_package/CMakeLists.txt b/recipes/argtable2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9ae95a47d2481 --- /dev/null +++ b/recipes/argtable2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(argtable2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE argtable2::argtable2) diff --git a/recipes/argtable2/all/test_package/conanfile.py b/recipes/argtable2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cde4572fbe457 --- /dev/null +++ b/recipes/argtable2/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(f"{bin_path} -n", env="conanrun") diff --git a/recipes/argtable2/all/test_package/test_package.c b/recipes/argtable2/all/test_package/test_package.c new file mode 100644 index 0000000000000..d3f8a9d58cd7e --- /dev/null +++ b/recipes/argtable2/all/test_package/test_package.c @@ -0,0 +1,120 @@ +/********************************************************************* +Example source code for using the argtable2 library to implement: + + echo [-neE] [--help] [--version] [STRING]... + +This file is part of the argtable2 library. +Copyright (C) 1998-2001,2003-2011 Stewart Heitmann +sheitmann@users.sourceforge.net + +The argtable2 library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +This software is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. +**********************************************************************/ + +#include "argtable2.h" + +/* Here we only approximate the echo functionality */ +void mymain(int n, int e, int E, const char** strings, int nstrings) + { + int j; + + printf("option -n = %s\n", ((n)?"YES":"NO")); + printf("option -e = %s\n", ((e)?"YES":"NO")); + printf("option -E = %s\n", ((E)?"YES":"NO")); + for (j=0; js"); + struct arg_lit *help = arg_lit0(NULL,"help", "print this help and exit"); + struct arg_lit *vers = arg_lit0(NULL,"version", "print version information and exit"); + struct arg_str *strs = arg_strn(NULL,NULL,"STRING",0,argc+2,NULL); + struct arg_end *end = arg_end(20); + void* argtable[] = {n,e,E,help,vers,strs,end}; + const char* progname = "echo"; + int exitcode=0; + int nerrors; + + /* verify the argtable[] entries were allocated sucessfully */ + if (arg_nullcheck(argtable) != 0) + { + /* NULL entries were detected, some allocations must have failed */ + printf("%s: insufficient memory\n",progname); + exitcode=1; + goto exit; + } + + /* Parse the command line as defined by argtable[] */ + nerrors = arg_parse(argc,argv,argtable); + + /* special case: '--help' takes precedence over error reporting */ + if (help->count > 0) + { + printf("Usage: %s", progname); + arg_print_syntax(stdout,argtable,"\n"); + printf("Echo the STRINGs to standard output.\n\n"); + arg_print_glossary(stdout,argtable," %-10s %s\n"); + printf("\nWithout -E, the following sequences are recognized and interpolated:\n\n" + " \\NNN the character whose ASCII code is NNN (octal)\n" + " \\\\ backslash\n" + " \\a alert (BEL)\n" + " \\b backspace\n" + " \\c suppress trailing newline\n" + " \\f form feed\n" + " \\n new line\n" + " \\r carriage return\n" + " \\t horizontal tab\n" + " \\v vertical tab\n\n" + "Report bugs to .\n"); + exitcode=0; + goto exit; + } + + /* special case: '--version' takes precedence error reporting */ + if (vers->count > 0) + { + printf("'%s' example program for the \"argtable\" command line argument parser.\n",progname); + printf("September 2003, Stewart Heitmann\n"); + exitcode=0; + goto exit; + } + + /* If the parser returned any errors then display them and exit */ + if (nerrors > 0) + { + /* Display the error details contained in the arg_end struct.*/ + arg_print_errors(stdout,end,progname); + printf("Try '%s --help' for more information.\n",progname); + exitcode=1; + goto exit; + } + + /* Command line parsing is complete, do the main processing */ + mymain(n->count, e->count, E->count, strs->sval, strs->count); + + exit: + /* deallocate each non-null entry in argtable[] */ + arg_freetable(argtable,sizeof(argtable)/sizeof(argtable[0])); + + printf("Finish! (%d)\n", exitcode); + return exitcode; + } diff --git a/recipes/argtable2/all/test_v1_package/CMakeLists.txt b/recipes/argtable2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/argtable2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/argtable2/all/test_v1_package/conanfile.py b/recipes/argtable2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5c79f133054fa --- /dev/null +++ b/recipes/argtable2/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(f"{bin_path} -n", run_environment=True) diff --git a/recipes/argtable2/config.yml b/recipes/argtable2/config.yml new file mode 100644 index 0000000000000..65675322acc8d --- /dev/null +++ b/recipes/argtable2/config.yml @@ -0,0 +1,3 @@ +versions: + "2.13": + folder: "all" diff --git a/recipes/argtable3/all/conandata.yml b/recipes/argtable3/all/conandata.yml new file mode 100644 index 0000000000000..3dfcb090995fa --- /dev/null +++ b/recipes/argtable3/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.2.2": + url: "https://github.com/argtable/argtable3/archive/refs/tags/v3.2.2.f25c624.tar.gz" + sha256: "a5c66d819fa0be0435f37ed2fb3f23e371091722ff74219de97b65f6b9914e51" + "3.2.1": + url: "https://github.com/argtable/argtable3/releases/download/v3.2.1.52f24e5/argtable-v3.2.1.52f24e5.tar.gz" + sha256: "bf02394a21378fdca95937fc4e3aeff8af63a2bfed7e3f87b1c1eda8bf9227dc" + "3.2.0": + url: "https://github.com/argtable/argtable3/archive/refs/tags/v3.2.0.7402e6e.tar.gz" + sha256: "e692ce51fb51dc750b47ef0ef2941573c8c49195aa2ddc48cb369239c400efa7" + "3.1.5": + url: "https://github.com/argtable/argtable3/archive/v3.1.5.1c1bb23.tar.gz" + sha256: "e2435562ece10bbf52c21811fe6ec25a3574054886cb56d483e5c17451329bb4" +patches: + "3.2.0": + - patch_file: "patches/3.2.0-0001-cmake-fixes.patch" + patch_description: "disable example build, make shared/static build separated" + patch_type: "conan" + "3.1.5": + - patch_file: "patches/3.1.5-0001-cmake-fixes.patch" + patch_description: "disable example build, make shared/static build separated" + patch_type: "conan" diff --git a/recipes/argtable3/all/conanfile.py b/recipes/argtable3/all/conanfile.py new file mode 100644 index 0000000000000..2b2ed84a2b4f5 --- /dev/null +++ b/recipes/argtable3/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os +import textwrap + +required_conan_version = ">=1.53.0" + +class Argtable3Conan(ConanFile): + name = "argtable3" + description = "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options." + license = "BSD-3-clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.argtable.org/" + topics = ("conan", "argtable3", "command", "line", "argument", "parse", "parsing", "getopt") + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ARGTABLE3_ENABLE_TESTS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + # The initial space is important (the cmake script does OFFSET 0) + save(self, os.path.join(self.build_folder, "version.tag"), f" {self.version}.0\n") + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + 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, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # These targets were for versions < 3.2.1 (newer create argtable3::argtable3) + target_name = "argtable3" if self.options.shared else "argtable3_static" + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {target_name: "argtable3::argtable3"} + ) + + def package_info(self): + suffix = "" + if not self.options.shared: + suffix += "_static" + if Version(self.version) >= "3.2.1" and self.settings.build_type == "Debug": + suffix += "d" + self.cpp_info.libs = [f"argtable3{suffix}"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("m") + + self.cpp_info.set_property("cmake_file_name", "Argtable3") + self.cpp_info.set_property("cmake_target_name", "argtable3::argtable3") + # These targets were for versions < 3.2.1 (newer create argtable3::argtable3) + self.cpp_info.set_property("cmake_target_aliases", ["argtable3" if self.options.shared else "argtable3_static"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Argtable3" + self.cpp_info.filenames["cmake_find_package_multi"] = "Argtable3" + self.cpp_info.names["cmake_find_package"] = "argtable3" + self.cpp_info.names["cmake_find_package_multi"] = "argtable3" + 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/argtable3/all/patches/3.1.5-0001-cmake-fixes.patch b/recipes/argtable3/all/patches/3.1.5-0001-cmake-fixes.patch new file mode 100644 index 0000000000000..38cca8b080bfc --- /dev/null +++ b/recipes/argtable3/all/patches/3.1.5-0001-cmake-fixes.patch @@ -0,0 +1,59 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -90,7 +90,7 @@ if(APPLE) + endif() + + add_subdirectory(src) +-add_subdirectory(examples) ++#add_subdirectory(examples) + + if(ARGTABLE3_ENABLE_TESTS) + enable_testing() +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -44,7 +44,7 @@ + endif() + + add_definitions(-D_XOPEN_SOURCE=700) +- ++if(BUILD_SHARED_LIBS) + if(WIN32) + set(COMPANY_NAME "The Argtable3 Project") + set(FILE_DESC "ANSI C command-line parsing library") +@@ -62,13 +62,13 @@ + add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES}) + endif() + target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) +- +-add_library(argtable3_static STATIC ${ARGTABLE3_SRC_FILES}) +-target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) +- +-set_target_properties(argtable3 argtable3_static PROPERTIES ++set_target_properties(argtable3 PROPERTIES + VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} + SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) ++target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) ++else() ++add_library(argtable3_static STATIC ${ARGTABLE3_SRC_FILES}) ++endif() + + include(GNUInstallDirs) + if(UNIX OR MSYS OR MINGW) +@@ -76,14 +76,16 @@ + elseif(WIN32) + set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") + endif() +- ++if(BUILD_SHARED_LIBS) + install(TARGETS argtable3 + EXPORT ${ARGTABLE3_PACKAGE_NAME}Config + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++else() + install(TARGETS argtable3_static + EXPORT ${ARGTABLE3_PACKAGE_NAME}Config + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() + install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_CMAKEDIR}) diff --git a/recipes/argtable3/all/patches/3.2.0-0001-cmake-fixes.patch b/recipes/argtable3/all/patches/3.2.0-0001-cmake-fixes.patch new file mode 100644 index 0000000000000..79ff2d7ad82ba --- /dev/null +++ b/recipes/argtable3/all/patches/3.2.0-0001-cmake-fixes.patch @@ -0,0 +1,59 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -93,7 +93,7 @@ + endif() + + add_subdirectory(src) +-add_subdirectory(examples) ++#add_subdirectory(examples) + + if(ARGTABLE3_ENABLE_TESTS) + enable_testing() +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -57,7 +57,7 @@ + endif() + + add_definitions(-D_XOPEN_SOURCE=700) +- ++if(BUILD_SHARED_LIBS) + if(WIN32) + set(COMPANY_NAME "The Argtable3 Project") + set(FILE_DESC "ANSI C command-line parsing library") +@@ -75,13 +75,13 @@ + add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES}) + endif() + target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) +- +-add_library(argtable3_static STATIC ${ARGTABLE3_SRC_FILES}) +-target_include_directories(argtable3_static PRIVATE ${PROJECT_SOURCE_DIR}/src) +- +-set_target_properties(argtable3 argtable3_static PROPERTIES ++set_target_properties(argtable3 PROPERTIES + VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} + SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) ++target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) ++else() ++add_library(argtable3_static STATIC ${ARGTABLE3_SRC_FILES}) ++endif() + + include(GNUInstallDirs) + if(UNIX OR MSYS OR MINGW) +@@ -89,14 +89,16 @@ + elseif(WIN32) + set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") + endif() +- ++if(BUILD_SHARED_LIBS) + install(TARGETS argtable3 + EXPORT ${ARGTABLE3_PACKAGE_NAME}Config + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++else() + install(TARGETS argtable3_static + EXPORT ${ARGTABLE3_PACKAGE_NAME}Config + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() + install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_CMAKEDIR}) diff --git a/recipes/argtable3/all/test_package/CMakeLists.txt b/recipes/argtable3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79004b3e726d4 --- /dev/null +++ b/recipes/argtable3/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Argtable3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(Argtable3_VERSION VERSION_GREATER_EQUAL "3.2.1") + target_link_libraries(${PROJECT_NAME} PRIVATE argtable3::argtable3) +elseif(TARGET argtable3) + target_link_libraries(${PROJECT_NAME} PRIVATE argtable3) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE argtable3_static) +endif() diff --git a/recipes/argtable3/all/test_package/conanfile.py b/recipes/argtable3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0ab6dbb34f3d6 --- /dev/null +++ b/recipes/argtable3/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} --help", run_environment=True) diff --git a/recipes/argtable3/all/test_package/test_package.c b/recipes/argtable3/all/test_package/test_package.c new file mode 100644 index 0000000000000..b144621bb58d0 --- /dev/null +++ b/recipes/argtable3/all/test_package/test_package.c @@ -0,0 +1,55 @@ +// Fetched from https://www.argtable.org/ + +#include "argtable3.h" + +/* global arg_xxx structs */ +struct arg_lit *verb, *help, *version; +struct arg_int *level; +struct arg_file *o, *file; +struct arg_end *end; + +int main(int argc, char *argv[]) +{ + /* the global arg_xxx structs are initialised within the argtable */ + void *argtable[] = { + help = arg_litn(NULL, "help", 0, 1, "display this help and exit"), + version = arg_litn(NULL, "version", 0, 1, "display version info and exit"), + level = arg_intn(NULL, "level", "", 0, 1, "foo value"), + verb = arg_litn("v", "verbose", 0, 1, "verbose output"), + o = arg_filen("o", NULL, "myfile", 0, 1, "output file"), + file = arg_filen(NULL, NULL, "", 1, 100, "input files"), + end = arg_end(20), + }; + + int exitcode = 0; + char *progname = argv[0]; + + int nerrors; + nerrors = arg_parse(argc,argv,argtable); + + /* special case: '--help' takes precedence over error reporting */ + if (help->count > 0) + { + printf("Usage: %s", progname); + arg_print_syntax(stdout, argtable, "\n"); + printf("Demonstrate command-line parsing in argtable3.\n\n"); + arg_print_glossary(stdout, argtable, " %-25s %s\n"); + exitcode = 0; + goto exit; + } + + /* If the parser returned any errors then display them and exit */ + if (nerrors > 0) + { + /* Display the error details contained in the arg_end struct.*/ + arg_print_errors(stdout, end, progname); + printf("Try '%s --help' for more information.\n", progname); + exitcode = 1; + goto exit; + } + +exit: + /* deallocate each non-null entry in argtable[] */ + arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0])); + return exitcode; +} diff --git a/recipes/argtable3/all/test_v1_package/CMakeLists.txt b/recipes/argtable3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/argtable3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argtable3/all/test_v1_package/conanfile.py b/recipes/argtable3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b36b4025b8a6a --- /dev/null +++ b/recipes/argtable3/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} --help", run_environment=True) diff --git a/recipes/argtable3/config.yml b/recipes/argtable3/config.yml new file mode 100644 index 0000000000000..70453d7b259cf --- /dev/null +++ b/recipes/argtable3/config.yml @@ -0,0 +1,9 @@ +versions: + "3.2.2": + folder: "all" + "3.2.1": + folder: "all" + "3.2.0": + folder: "all" + "3.1.5": + folder: "all" diff --git a/recipes/armadillo/all/conandata.yml b/recipes/armadillo/all/conandata.yml new file mode 100644 index 0000000000000..91baae076a36f --- /dev/null +++ b/recipes/armadillo/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "10.7.0": + url: "http://sourceforge.net/projects/arma/files/armadillo-10.7.0.tar.xz" + sha256: "9bf60db6fd237721908747a0e56797b97b7ceae3603f2cca0b012a3b88265d3f" + "10.7.3": + url: "https://sourceforge.net/projects/arma/files/armadillo-10.7.3.tar.xz" + sha256: "aac930d5fbc23dca9453ff3647d03f7d90d9584a4556719ad7bc7adab7db6ff5" + "11.4.3": + url: "https://sourceforge.net/projects/arma/files/armadillo-11.4.3.tar.xz" + sha256: "87603263664988af41da2ca4f36205e36ea47a9281fa6cfd463115f3797a1da2" + +patches: + "10.7.0": + - patch_file: "patches/0001-Guard-dependency-discovery-10.7.x.patch" + patch_description: "Add find_package statements to inject conan dependencies" + patch_type: "conan" + "10.7.3": + - patch_file: "patches/0001-Guard-dependency-discovery-10.7.x.patch" + patch_description: "Add find_package statements to inject conan dependencies" + patch_type: "conan" + "11.4.3": + - patch_file: "patches/0002-Guard-dependency-discovery-11.4.x.patch" + patch_description: "Add find_package statements to inject conan dependencies" + patch_type: "conan" diff --git a/recipes/armadillo/all/conanfile.py b/recipes/armadillo/all/conanfile.py new file mode 100644 index 0000000000000..4c814b3794dad --- /dev/null +++ b/recipes/armadillo/all/conanfile.py @@ -0,0 +1,314 @@ +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.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class ArmadilloConan(ConanFile): + name = "armadillo" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://arma.sourceforge.net" + description = "Armadillo is a high quality C++ library for linear algebra and scientific computing, aiming towards a good balance between speed and ease of use." + topics = ( + "linear algebra", + "scientific computing", + "matrix", + "vector", + "math", + "blas", + "lapack", + "mkl", + "hdf5", + ) + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_blas": [ + False, + "openblas", + "intel_mkl", + "system_blas", + "system_flexiblas", + "framework_accelerate", + ], + "use_lapack": [ + False, + "openblas", + "intel_mkl", + "system_lapack", + "system_atlas", + "framework_accelerate", + ], + "use_hdf5": [True, False], + "use_superlu": [False, "system_superlu"], + "use_extern_rng": [True, False], + "use_arpack": [False, "system_arpack"], + "use_wrapper": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_blas": "openblas", + "use_lapack": False, + "use_hdf5": True, + "use_superlu": False, + "use_extern_rng": False, + "use_arpack": False, + "use_wrapper": False, + } + # Values that must be set for multiple options to be valid + _co_dependencies = { + "intel_mkl": [ + "use_blas", + "use_lapack", + ], + "framework_accelerate": [ + "use_blas", + "use_lapack", + ], + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os == "Macos": + # Macos will default to Accelerate framework + self.options.use_blas = "framework_accelerate" + self.options.use_lapack = "framework_accelerate" + + # According with the CMakeLists file in armadillo, MinGW doesn't correctly handle thread_local. + # If any of MINGW, MSYS, CYGWIN or MSVC are True in during cmake configure, the ARMA_USE_EXTERN_RNG option will be set to false. + # Therefore, in these cases we remove the `use_extern_rng` option in conan + if self.settings.os == "Windows": + del self.options.use_extern_rng + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + if self.settings.os != "Macos" and ( + self.options.use_blas == "framework_accelerate" + or self.options.use_lapack == "framework_accelerate" + ): + raise ConanInvalidConfiguration( + "framework_accelerate can only be used on Macos" + ) + + for value, options in self._co_dependencies.items(): + options_without_value = [ + x for x in options if getattr(self.options, x) != value + ] + if options_without_value and (len(options) != len(options_without_value)): + raise ConanInvalidConfiguration( + "Options {} must all be set to '{}' to use this feature. To fix this, set option {} to '{}'.".format( + ", ".join(options), + value, + ", ".join(options_without_value), + value, + ) + ) + + if ( + self.options.use_lapack == "openblas" + and self.options.use_blas != "openblas" + ): + raise ConanInvalidConfiguration( + "OpenBLAS can only provide LAPACK functionality when also providing BLAS functionality. Set use_blas=openblas and try again." + ) + + deprecated_opts = list( + set( + [ + opt + for opt in [ + str(self.options.use_blas), + str(self.options.use_lapack), + ] + if "system" in opt + ] + ) + ) + + for opt in deprecated_opts: + self.output.warning( + f"DEPRECATION NOTICE: Value {opt} uses armadillo's default dependency search and will be replaced when this package becomes available in ConanCenter" + ) + + # Ignore use_extern_rng when the option has been removed + if self.options.use_wrapper and not self.options.get_safe("use_extern_rng", True): + raise ConanInvalidConfiguration( + "The wrapper requires the use of an external RNG. Set use_extern_rng=True and try again." + ) + + def requirements(self): + # Optional requirements + # TODO: "atlas/3.10.3" # Pending https://github.com/conan-io/conan-center-index/issues/6757 + # TODO: "superlu/5.2.2" # Pending https://github.com/conan-io/conan-center-index/issues/6756 + # TODO: "arpack/1.0" # Pending https://github.com/conan-io/conan-center-index/issues/6755 + # TODO: "flexiblas/3.0.4" # Pending https://github.com/conan-io/conan-center-index/issues/6827 + + if self.options.use_hdf5: + # Use the conan dependency if the system lib isn't being used + self.requires("hdf5/1.14.0") + + if self.options.use_blas == "openblas": + self.requires("openblas/0.3.20") + # Note that if you're relying on this to build LAPACK, you _must_ have + # a fortran compiler installed. If you don't, OpenBLAS will build successfully but + # without LAPACK support, which isn't obvious. + # This can be achieved by setting the FC environment variable in your conan profile + self.options["openblas"].build_lapack = ( + self.options.use_lapack == "openblas" + ) + if ( + self.options.use_blas == "intel_mkl" + and self.options.use_lapack == "intel_mkl" + ): + # Consumers can override this requirement with their own + # by using self.requires("intel-mkl/version@user/channel, override=True) + # in their consumer conanfile.py + if ( + self.options.use_blas == "intel_mkl" + or self.options.use_lapack == "intel_mkl" + ): + self.output.warning( + "The intel-mkl package does not exist in CCI. To use an Intel MKL package, override this requirement with your own recipe." + ) + self.requires("intel-mkl/2021.4") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ARMA_USE_LAPACK"] = self.options.use_lapack + tc.variables["ARMA_USE_BLAS"] = self.options.use_blas + tc.variables["ARMA_USE_ATLAS"] = self.options.use_lapack == "system_atlas" + tc.variables["ARMA_USE_HDF5"] = self.options.use_hdf5 + tc.variables["ARMA_USE_HDF5_CMAKE"] = self.options.use_hdf5 + tc.variables["ARMA_USE_ARPACK"] = self.options.use_arpack + tc.variables["ARMA_USE_EXTERN_RNG"] = self.options.get_safe("use_exern_rng", default=False) + tc.variables["ARMA_USE_SUPERLU"] = self.options.use_superlu + tc.variables["ARMA_USE_WRAPPER"] = self.options.use_wrapper + tc.variables["ARMA_USE_ACCELERATE"] = ( + self.options.use_blas == "framework_accelerate" + or self.options.use_lapack == "framework_accelerate" + ) and self.settings.os == "Macos" + tc.variables["DETECT_HDF5"] = self.options.use_hdf5 + tc.variables["USE_OPENBLAS"] = (self.options.use_blas == "openblas") + tc.variables["USE_MKL"] = self.options.use_blas == "intel_mkl" and self.options.use_lapack == "intel_mkl" + tc.variables["USE_SYSTEM_LAPACK"] = self.options.use_lapack == "system_lapack" + tc.variables["USE_SYSTEM_BLAS"] = (self.options.use_blas == "system_blas") + tc.variables["USE_SYSTEM_ATLAS"] = self.options.use_lapack == "system_atlas" + tc.variables["USE_SYSTEM_HDF5"] = False + tc.variables["USE_SYSTEM_ARPACK"] = self.options.use_arpack + tc.variables["USE_SYSTEM_SUPERLU"] = self.options.use_superlu + tc.variables["USE_SYSTEM_OPENBLAS"] = False + tc.variables["USE_SYSTEM_FLEXIBLAS"] = self.options.use_blas == "system_flexiblas" + tc.variables["ALLOW_FLEXIBLAS_LINUX"] = self.options.use_blas == "system_flexiblas" and self.settings.os == "Linux" + tc.variables["ALLOW_OPENBLAS_MACOS"] = self.options.use_blas == "openblas" and self.settings.os == "Macos" + tc.variables["OPENBLAS_PROVIDES_LAPACK"] = self.options.use_lapack == "openblas" + tc.variables["ALLOW_BLAS_LAPACK_MACOS"] = self.options.use_blas != "framework_accelerate" + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_SMOKE_TEST"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def source(self): + get(self, + **self.conan_data["sources"][self.version], + strip_root=True, + filename="f{self.name}-{self.version}.tar.xz" + ) + + def build(self): + apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + 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")) + + def package_info(self): + self.cpp_info.libs = ["armadillo"] + self.cpp_info.set_property("pkg_config_name", "armadillo") + + if self.options.get_safe("use_extern_rng"): + self.cpp_info.defines.append("ARMA_USE_EXTERN_RNG") + + if self.settings.build_type == "Release": + self.cpp_info.defines.append("ARMA_NO_DEBUG") + + # The wrapper library links everything together. If disabled, system libs must be + # linked manually + if not self.options.use_wrapper: + self.cpp_info.defines.append("ARMA_DONT_USE_WRAPPER") + if self.options.use_blas == "framework_accelerate": + self.cpp_info.frameworks.append("Accelerate") + + if self.options.use_hdf5: + self.cpp_info.defines.append("ARMA_USE_HDF5") + else: + self.cpp_info.defines.append("ARMA_DONT_USE_HDF5") + + if self.options.use_blas: + self.cpp_info.defines.append("ARMA_USE_BLAS") + if self.options.use_blas == "system_blas" and not self.options.use_wrapper: + self.cpp_info.system_libs.extend(["blas"]) + else: + self.cpp_info.defines.append("ARMA_DONT_USE_BLAS") + + if self.options.use_lapack: + self.cpp_info.defines.append("ARMA_USE_LAPACK") + if ( + self.options.use_lapack == "system_lapack" + and not self.options.use_wrapper + ): + self.cpp_info.system_libs.extend(["lapack"]) + else: + self.cpp_info.defines.append("ARMA_DONT_USE_LAPACK") + + if self.options.use_arpack: + self.cpp_info.defines.append("ARMA_USE_ARPACK") + if not self.options.use_wrapper: + self.cpp_info.system_libs.extend(["arpack"]) + else: + self.cpp_info.defines.append("ARMA_DONT_USE_ARPACK") + + if self.options.use_superlu: + self.cpp_info.defines.append("ARMA_USE_SUPERLU") + if not self.options.use_wrapper: + self.cpp_info.system_libs.extend(["superlu"]) + else: + self.cpp_info.defines.append("ARMA_DONT_USE_SUPERLU") + + if self.options.use_lapack == "system_atlas": + self.cpp_info.defines.append("ARMA_USE_ATLAS") + if not self.options.use_wrapper: + self.cpp_info.system_libs.extend(["atlas"]) + else: + self.cpp_info.defines.append("ARMA_DONT_USE_ATLAS") diff --git a/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch b/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch new file mode 100644 index 0000000000000..89386d2e8686f --- /dev/null +++ b/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch @@ -0,0 +1,148 @@ +From 48a5162899ebeb0ba3ca3141b587a53d2eda4223 Mon Sep 17 00:00:00 2001 +From: Samuel Dowling +Date: Thu, 30 Sep 2021 23:51:35 +0930 +Subject: [PATCH] Guard dependency discovery + +* Add guards to prevent usage of custom cmake find package scripts. +* Remove ability to inject hdf5 include directory into compiled binary +--- + CMakeLists.txt | 72 ++++++++++++++++++++----- + include/armadillo_bits/config.hpp.cmake | 2 +- + 2 files changed, 60 insertions(+), 14 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7857f8c..5f87f7e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -274,7 +274,11 @@ if(APPLE) + set(ARMA_USE_ACCELERATE true) + + if(ALLOW_OPENBLAS_MACOS) +- include(ARMA_FindOpenBLAS) ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() + message(STATUS "OpenBLAS_FOUND = ${OpenBLAS_FOUND}") + message(STATUS "") + message(STATUS "*** If use of OpenBLAS is causing problems,") +@@ -289,8 +293,16 @@ if(APPLE) + endif() + + if(ALLOW_BLAS_LAPACK_MACOS) +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) ++ endif() + message(STATUS " BLAS_FOUND = ${BLAS_FOUND}" ) + message(STATUS "LAPACK_FOUND = ${LAPACK_FOUND}") + message(STATUS "") +@@ -329,14 +341,42 @@ if(APPLE) + + else() + +- include(ARMA_FindMKL) +- include(ARMA_FindOpenBLAS) +- include(ARMA_FindATLAS) +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) ++ if(USE_MKL) ++ find_package(MKL) ++ else() ++ set(MKL_FOUND NO) ++ endif() ++ ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_ATLAS) ++ include(ARMA_FindATLAS) ++ else() ++ set(ATLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) ++ endif() + + if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) +- include(ARMA_FindFlexiBLAS) ++ if(USE_SYSTEM_FLEXIBLAS) ++ include(ARMA_FindFlexiBLAS) ++ else() ++ set(FlexiBLAS_FOUND NO) ++ endif() + endif() + + message(STATUS " MKL_FOUND = ${MKL_FOUND}" ) +@@ -470,8 +510,6 @@ if(DETECT_HDF5) + # HDF5_INCLUDE_DIRS is the correct include directory. So, in either case we + # can use the first element in the list. Issue a status message, too, just + # for good measure. +- list(GET HDF5_INCLUDE_DIRS 0 ARMA_HDF5_INCLUDE_DIR) +- message(STATUS "ARMA_HDF5_INCLUDE_DIR = ${ARMA_HDF5_INCLUDE_DIR}") + message(STATUS "") + message(STATUS "*** If use of HDF5 is causing problems,") + message(STATUS "*** rerun cmake with HDF5 detection disabled:") +@@ -480,7 +518,11 @@ if(DETECT_HDF5) + endif() + endif() + +-include(ARMA_FindARPACK) ++if(USE_SYSTEM_ARPACK) ++ include(ARMA_FindARPACK) ++else() ++ set(ARPACK_FOUND NO) ++endif() + message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}") + + if(ARPACK_FOUND) +@@ -488,7 +530,11 @@ if(ARPACK_FOUND) + set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY}) + endif() + +-include(ARMA_FindSuperLU5) ++if(USE_SYSTEM_SUPERLU) ++ include(ARMA_FindSuperLU5) ++else() ++ set(SuperLU_FOUND NO) ++endif() + message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}") + + if(SuperLU_FOUND) +diff --git a/include/armadillo_bits/config.hpp.cmake b/include/armadillo_bits/config.hpp.cmake +index 3f7f874..998f6ec 100644 +--- a/include/armadillo_bits/config.hpp.cmake ++++ b/include/armadillo_bits/config.hpp.cmake +@@ -152,7 +152,7 @@ + #undef ARMA_USE_HDF5 + #define ARMA_USE_HDF5 + +- #define ARMA_HDF5_INCLUDE_DIR ${ARMA_HDF5_INCLUDE_DIR}/ ++ // #define ARMA_HDF5_INCLUDE_DIR ${ARMA_HDF5_INCLUDE_DIR}/ + #endif + + #if !defined(ARMA_MAT_PREALLOC) +-- +2.36.0 + diff --git a/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch b/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch new file mode 100644 index 0000000000000..33fb53382e9ee --- /dev/null +++ b/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch @@ -0,0 +1,155 @@ +From aa49b619333a25d892d119836ca97dd1d833475d Mon Sep 17 00:00:00 2001 +From: Samuel Dowling +Date: Thu, 5 Jan 2023 00:02:06 +1030 +Subject: [PATCH 1/1] Guard dependency discovery + +* Add guards to prevent usage of custom cmake find package scripts. +* Remove ability to inject hdf5 include directory into compiled binary +--- + CMakeLists.txt | 78 ++++++++++++++++++++----- + include/armadillo_bits/config.hpp.cmake | 2 +- + 2 files changed, 64 insertions(+), 16 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index da1ff3a..7bdd808 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -275,7 +275,11 @@ if(APPLE) + set(ARMA_USE_ACCELERATE true) + + if(ALLOW_OPENBLAS_MACOS) +- include(ARMA_FindOpenBLAS) ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() + message(STATUS "OpenBLAS_FOUND = ${OpenBLAS_FOUND}") + message(STATUS "") + message(STATUS "*** If use of OpenBLAS is causing problems,") +@@ -290,8 +294,16 @@ if(APPLE) + endif() + + if(ALLOW_BLAS_LAPACK_MACOS) +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) ++ endif() + message(STATUS " BLAS_FOUND = ${BLAS_FOUND}" ) + message(STATUS "LAPACK_FOUND = ${LAPACK_FOUND}") + message(STATUS "") +@@ -331,17 +343,45 @@ if(APPLE) + else() + + if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) +- include(ARMA_FindFlexiBLAS) ++ if(USE_SYSTEM_FLEXIBLAS) ++ include(ARMA_FindFlexiBLAS) ++ else() ++ set(FlexiBLAS_FOUND NO) ++ endif() + else() + set(FlexiBLAS_FOUND false) + endif() +- +- include(ARMA_FindMKL) +- include(ARMA_FindOpenBLAS) +- include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) +- ++ ++ if(USE_MKL) ++ find_package(MKL) ++ else() ++ set(MKL_FOUND NO) ++ endif() ++ ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_ATLAS) ++ include(ARMA_FindATLAS) ++ else() ++ set(ATLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) ++ endif() ++ + message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) + message(STATUS " MKL_FOUND = ${MKL_FOUND}" ) + message(STATUS " OpenBLAS_FOUND = ${OpenBLAS_FOUND}" ) +@@ -493,8 +533,6 @@ if(DETECT_HDF5) + # HDF5_INCLUDE_DIRS is the correct include directory. So, in either case we + # can use the first element in the list. Issue a status message, too, just + # for good measure. +- list(GET HDF5_INCLUDE_DIRS 0 ARMA_HDF5_INCLUDE_DIR) +- message(STATUS "ARMA_HDF5_INCLUDE_DIR = ${ARMA_HDF5_INCLUDE_DIR}") + message(STATUS "") + message(STATUS "*** If use of HDF5 is causing problems,") + message(STATUS "*** rerun cmake with HDF5 detection disabled:") +@@ -503,7 +541,12 @@ if(DETECT_HDF5) + endif() + endif() + +-include(ARMA_FindARPACK) ++if(USE_SYSTEM_ARPACK) ++ include(ARMA_FindARPACK) ++else() ++ set(ARPACK_FOUND NO) ++endif() ++ + message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}") + + if(ARPACK_FOUND) +@@ -511,7 +554,12 @@ if(ARPACK_FOUND) + set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY}) + endif() + +-include(ARMA_FindSuperLU5) ++if(USE_SYSTEM_SUPERLU) ++ include(ARMA_FindSuperLU5) ++else() ++ set(SuperLU_FOUND NO) ++endif() ++ + message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}") + + if(SuperLU_FOUND) +diff --git a/include/armadillo_bits/config.hpp.cmake b/include/armadillo_bits/config.hpp.cmake +index 07c85b8..584e01e 100644 +--- a/include/armadillo_bits/config.hpp.cmake ++++ b/include/armadillo_bits/config.hpp.cmake +@@ -164,7 +164,7 @@ + #undef ARMA_USE_HDF5 + #define ARMA_USE_HDF5 + +- #define ARMA_HDF5_INCLUDE_DIR ${ARMA_HDF5_INCLUDE_DIR}/ ++ // #define ARMA_HDF5_INCLUDE_DIR ${ARMA_HDF5_INCLUDE_DIR}/ + #endif + + #if !defined(ARMA_MAT_PREALLOC) +-- +2.39.0 + diff --git a/recipes/armadillo/all/test_package/CMakeLists.txt b/recipes/armadillo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2ede063cb4884 --- /dev/null +++ b/recipes/armadillo/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(armadillo CONFIG REQUIRED) + +add_executable(example src/example.cpp) +target_link_libraries(example armadillo::armadillo) +set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/armadillo/all/test_package/conanfile.py b/recipes/armadillo/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4a901f505fcdd --- /dev/null +++ b/recipes/armadillo/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import cross_building + + +class FooTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + # VirtualBuildEnv and VirtualRunEnv can be avoided if "tools.env.virtualenv:auto_use" is defined + # (it will be defined in Conan 2.0) + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" + apply_env = False + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "example") + self.run(cmd, env="conanrun") diff --git a/recipes/armadillo/all/test_package/src/example.cpp b/recipes/armadillo/all/test_package/src/example.cpp new file mode 100644 index 0000000000000..2244a238d35fb --- /dev/null +++ b/recipes/armadillo/all/test_package/src/example.cpp @@ -0,0 +1,207 @@ +#include +#include + +using namespace std; +using namespace arma; + +// Armadillo documentation is available at: +// http://arma.sourceforge.net/docs.html + +// NOTE: the C++11 "auto" keyword is not recommended for use with Armadillo objects and functions + +int +main(int argc, char** argv) +{ + cout << "Armadillo version: " << arma_version::as_string() << endl; + + // construct a matrix according to given size and form of element initialisation + mat A(2,3,fill::zeros); + + // .n_rows and .n_cols are read only + cout << "A.n_rows: " << A.n_rows << endl; + cout << "A.n_cols: " << A.n_cols << endl; + + A(1,2) = 456.0; // access an element (indexing starts at 0) + A.print("A:"); + + A = 5.0; // scalars are treated as a 1x1 matrix + A.print("A:"); + + A.set_size(4,5); // change the size (data is not preserved) + + A.fill(5.0); // set all elements to a specific value + A.print("A:"); + + A = { { 0.165300, 0.454037, 0.995795, 0.124098, 0.047084 }, + { 0.688782, 0.036549, 0.552848, 0.937664, 0.866401 }, + { 0.348740, 0.479388, 0.506228, 0.145673, 0.491547 }, + { 0.148678, 0.682258, 0.571154, 0.874724, 0.444632 }, + { 0.245726, 0.595218, 0.409327, 0.367827, 0.385736 } }; + + A.print("A:"); + +#ifdef ARMA_USE_LAPACK + // determinant + cout << "det(A): " << det(A) << endl; + + // inverse + cout << "inv(A): " << endl << inv(A) << endl; +#else + cout << "LAPACK not available. Skipping calls to functions det() and inv()" << endl; +#endif + + // save matrix as a text file + A.save("A.txt", raw_ascii); + + // load from file + mat B; + B.load("A.txt"); + + // submatrices + cout << "B( span(0,2), span(3,4) ):" << endl << B( span(0,2), span(3,4) ) << endl; + + cout << "B( 0,3, size(3,2) ):" << endl << B( 0,3, size(3,2) ) << endl; + + cout << "B.row(0): " << endl << B.row(0) << endl; + + cout << "B.col(1): " << endl << B.col(1) << endl; + + // transpose + cout << "B.t(): " << endl << B.t() << endl; + + // maximum from each column (traverse along rows) + cout << "max(B): " << endl << max(B) << endl; + + // maximum from each row (traverse along columns) + cout << "max(B,1): " << endl << max(B,1) << endl; + + // maximum value in B + cout << "max(max(B)) = " << max(max(B)) << endl; + + // sum of each column (traverse along rows) + cout << "sum(B): " << endl << sum(B) << endl; + + // sum of each row (traverse along columns) + cout << "sum(B,1) =" << endl << sum(B,1) << endl; + + // sum of all elements + cout << "accu(B): " << accu(B) << endl; + + // trace = sum along diagonal + cout << "trace(B): " << trace(B) << endl; + + // generate the identity matrix + mat C = eye(4,4); + + // random matrix with values uniformly distributed in the [0,1] interval + mat D = randu(4,4); + D.print("D:"); + + // row vectors are treated like a matrix with one row + rowvec r = { 0.59119, 0.77321, 0.60275, 0.35887, 0.51683 }; + r.print("r:"); + + // column vectors are treated like a matrix with one column + vec q = { 0.14333, 0.59478, 0.14481, 0.58558, 0.60809 }; + q.print("q:"); + + // convert matrix to vector; data in matrices is stored column-by-column + vec v = vectorise(A); + v.print("v:"); + + // dot or inner product + cout << "as_scalar(r*q): " << as_scalar(r*q) << endl; + + // outer product + cout << "q*r: " << endl << q*r << endl; + + // multiply-and-accumulate operation (no temporary matrices are created) + cout << "accu(A % B) = " << accu(A % B) << endl; + + // example of a compound operation + B += 2.0 * A.t(); + B.print("B:"); + + // imat specifies an integer matrix + imat AA = { { 1, 2, 3 }, + { 4, 5, 6 }, + { 7, 8, 9 } }; + + imat BB = { { 3, 2, 1 }, + { 6, 5, 4 }, + { 9, 8, 7 } }; + + // comparison of matrices (element-wise); output of a relational operator is a umat + umat ZZ = (AA >= BB); + ZZ.print("ZZ:"); + + // cubes ("3D matrices") + cube Q( B.n_rows, B.n_cols, 2 ); + + Q.slice(0) = B; + Q.slice(1) = 2.0 * B; + + Q.print("Q:"); + + // 2D field of matrices; 3D fields are also supported + field F(4,3); + + for(uword col=0; col < F.n_cols; ++col) + for(uword row=0; row < F.n_rows; ++row) + { + F(row,col) = randu(2,3); // each element in field is a matrix + } + + F.print("F:"); + + // Test that the result of the use_extern_rng option in the conan recipe +#ifdef ARMA_USE_EXTERN_RNG + cout << "ARMA_USE_EXTERN_RNG set." << endl; +#else + cout << "ARMA_USE_EXTERN_RNG not set." << endl; +#endif + + arma::vec v2{1,2,3,4}; + arma::arma_rng::set_seed(1237); + v2.randn(); + v2.print("v2 (randn):"); + +#ifdef ARMA_USE_HDF5 + std::cout << "ARMA_USE_HDF5 set" << std::endl; + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + bool result = true; + for (uword i = 0; i < a.n_elem; ++i) + { + result *= a[i] == b[i]; + } + std::cout << "Matrix written to and read from file.h5 are equivalent: " << result << "\n"; + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + result = true; + for (uword i = 0; i < a.n_elem; ++i) + { + result *= a[i] == c[i]; + } + std::cout << "Matrix written to and autoloaded from file.h5 are equivalent: " << result << "\n"; + + std::remove("file.h5"); +#else + std::cout << "ARMA_USE_HDF5 not set" << std::endl; +#endif + + return 0; +} diff --git a/recipes/armadillo/all/test_v1_package/CMakeLists.txt b/recipes/armadillo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3ac69a9731274 --- /dev/null +++ b/recipes/armadillo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.6) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(armadillo REQUIRED) + +add_executable(example ../test_package/src/example.cpp) +target_link_libraries(example armadillo::armadillo) +set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/armadillo/all/test_v1_package/conanfile.py b/recipes/armadillo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5eba7cbe1bb9c --- /dev/null +++ b/recipes/armadillo/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class ArmadilloTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/armadillo/config.yml b/recipes/armadillo/config.yml new file mode 100644 index 0000000000000..8af743e5561bd --- /dev/null +++ b/recipes/armadillo/config.yml @@ -0,0 +1,7 @@ +versions: + "10.7.0": + folder: all + "10.7.3": + folder: all + "11.4.3": + folder: all diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml new file mode 100644 index 0000000000000..63008d8eba8f6 --- /dev/null +++ b/recipes/arrow/all/conandata.yml @@ -0,0 +1,67 @@ +sources: + "11.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-11.0.0/apache-arrow-11.0.0.tar.gz?action=download" + sha256: "2dd8f0ea0848a58785628ee3a57675548d509e17213a2f5d72b0d900b43f5430" + "10.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.1/apache-arrow-10.0.1.tar.gz?action=download" + sha256: "c814e0670112a22c1a6ec03ab420a52ae236a9a42e9e438c3cbd37f37e658fb3" + "10.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.0/apache-arrow-10.0.0.tar.gz?action=download" + sha256: "5b46fa4c54f53e5df0019fe0f9d421e93fc906b625ebe8e89eed010d561f1f12" + "8.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.1/apache-arrow-8.0.1.tar.gz?action=download" + sha256: "82d46929f7574715551da21700f100b39f99c3c4d6790f26cac86d869d64e94e" + "8.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz?action=download" + sha256: "ad9a05705117c989c116bae9ac70492fe015050e1b80fb0e38fde4b5d863aaa3" + "7.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-7.0.0/apache-arrow-7.0.0.tar.gz?action=download" + sha256: "e8f49b149a15ecef4e40fcfab1b87c113c6b1ee186005c169e5cdf95d31a99de" + "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_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "8.0.0": + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "7.0.0": + - patch_file: "patches/7.0.0-0006-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/7.0.0-0007-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "2.0.0": + - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" + patch_description: "make shared enabled in msvc" + patch_type: "official" + - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" + patch_description: "fix grandiva compilation error" + patch_type: "official" + - patch_file: "patches/2.0.0-0008-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "1.0.0": + - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" + patch_description: "make shared enabled in msvc" + patch_type: "official" + - patch_file: "patches/1.0.0-0005-fix-make12-namespace.patch" + patch_description: "fix ambiguous `make12` function between std and date" + patch_type: "official" + - patch_file: "patches/1.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py new file mode 100644 index 0000000000000..1def26f4a6ab8 --- /dev/null +++ b/recipes/arrow/all/conanfile.py @@ -0,0 +1,686 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc, check_min_vs +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rmdir +from conan.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 +import glob + +required_conan_version = ">=1.53.0" + +class ArrowConan(ConanFile): + name = "arrow" + description = "Apache Arrow is a cross-language development platform for in-memory data" + license = ("Apache-2.0",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://arrow.apache.org/" + topics = ("memory", "gandiva", "parquet", "skyhook", "plasma", "hdfs", "csv", "cuda", "gcs", "json", "hive", "s3", "grpc") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "gandiva": [True, False], + "parquet": ["auto", True, False], + "substrait": [True, False], + "skyhook": [True, False], + "plasma": [True, False], + "cli": [True, False], + "compute": ["auto", True, False], + "dataset_modules": ["auto", True, False], + "deprecated": [True, False], + "encryption": [True, False], + "filesystem_layer": [True, False], + "hdfs_bridgs": [True, False], + "simd_level": [None, "default", "sse4_2", "avx2", "avx512", "neon", ], + "runtime_simd_level": [None, "sse4_2", "avx2", "avx512", "max"], + "with_backtrace": [True, False], + "with_boost": ["auto", True, False], + "with_csv": [True, False], + "with_cuda": [True, False], + "with_flight_rpc": ["auto", True, False], + "with_flight_sql": [True, False], + "with_gcs": [True, False], + "with_gflags": ["auto", True, False], + "with_glog": ["auto", True, False], + "with_grpc": ["auto", True, False], + "with_jemalloc": ["auto", True, False], + "with_mimalloc": ["auto", True, False], + "with_json": [True, False], + "with_llvm": ["auto", True, False], + "with_openssl": ["auto", True, False], + "with_opentelemetry": [True, False], + "with_orc": [True, False], + "with_protobuf": ["auto", True, False], + "with_re2": ["auto", True, False], + "with_s3": [True, False], + "with_utf8proc": ["auto", True, False], + "with_brotli": [True, False], + "with_bz2": [True, False], + "with_lz4": [True, False], + "with_snappy": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "gandiva": False, + "parquet": "auto", + "skyhook": False, + "substrait": False, + "plasma": False, + "cli": False, + "compute": "auto", + "dataset_modules": "auto", + "deprecated": True, + "encryption": False, + "filesystem_layer": False, + "hdfs_bridgs": False, + "simd_level": "default", + "runtime_simd_level": "max", + "with_backtrace": False, + "with_boost": "auto", + "with_brotli": False, + "with_bz2": False, + "with_csv": False, + "with_cuda": False, + "with_flight_rpc": "auto", + "with_flight_sql": False, + "with_gcs": False, + "with_gflags": "auto", + "with_jemalloc": "auto", + "with_mimalloc": False, + "with_glog": "auto", + "with_grpc": "auto", + "with_json": False, + "with_llvm": "auto", + "with_openssl": "auto", + "with_opentelemetry": False, + "with_orc": False, + "with_protobuf": "auto", + "with_re2": "auto", + "with_s3": False, + "with_utf8proc": "auto", + "with_lz4": False, + "with_snappy": False, + "with_zlib": False, + "with_zstd": False, + } + short_paths = True + + @property + def _minimum_cpp_standard(self): + # arrow >= 10.0.0 requires C++17. + # https://github.com/apache/arrow/pull/13991 + return 11 if Version(self.version) < "10.0.0" else 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + 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 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + if self._minimum_cpp_standard == 11: + if self.info.settings.compiler == "clang" and self.info.settings.compiler.version <= Version("3.9"): + raise ConanInvalidConfiguration("This recipe does not support this compiler version") + else: + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + if self.options.shared: + del self.options.fPIC + if self.options.compute == False and not self._compute(True): + raise ConanInvalidConfiguration("compute options is required (or choose auto)") + if self.options.parquet == False and self._parquet(True): + raise ConanInvalidConfiguration("parquet options is required (or choose auto)") + if self.options.dataset_modules == False and self._dataset_modules(True): + raise ConanInvalidConfiguration("dataset_modules options is required (or choose auto)") + if self.options.get_safe("skyhook", False): + raise ConanInvalidConfiguration("CCI has no librados recipe (yet)") + if self.options.with_jemalloc == False and self._with_jemalloc(True): + raise ConanInvalidConfiguration("with_jemalloc option is required (or choose auto)") + if self.options.with_re2 == False and self._with_re2(True): + raise ConanInvalidConfiguration("with_re2 option is required (or choose auto)") + if self.options.with_protobuf == False and self._with_protobuf(True): + raise ConanInvalidConfiguration("with_protobuf option is required (or choose auto)") + if self.options.with_gflags == False and self._with_gflags(True): + raise ConanInvalidConfiguration("with_gflags options is required (or choose auto)") + if self.options.with_flight_rpc == False and self._with_flight_rpc(True): + raise ConanInvalidConfiguration("with_flight_rpc options is required (or choose auto)") + if self.options.with_grpc == False and self._with_grpc(True): + raise ConanInvalidConfiguration("with_grpc options is required (or choose auto)") + if self.options.with_boost == False and self._with_boost(True): + raise ConanInvalidConfiguration("with_boost options is required (or choose auto)") + if self.options.with_openssl == False and self._with_openssl(True): + raise ConanInvalidConfiguration("with_openssl options is required (or choose auto)") + if self.options.with_llvm == False and self._with_llvm(True): + raise ConanInvalidConfiguration("with_llvm options is required (or choose auto)") + if self.options.with_cuda: + raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") + if self.options.with_orc: + raise ConanInvalidConfiguration("CCI has no orc recipe (yet)") + if self.options.with_s3 and not self.options["aws-sdk-cpp"].config: + raise ConanInvalidConfiguration("arrow:with_s3 requires aws-sdk-cpp:config is True.") + + if self.options.shared and self._with_jemalloc(): + if self.options["jemalloc"].enable_cxx: + raise ConanInvalidConfiguration("jemmalloc.enable_cxx of a static jemalloc must be disabled") + + if Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": + raise ConanInvalidConfiguration(f"In {self.ref}, simd_level options is not supported `default` value.") + + def layout(self): + cmake_layout(self, src_folder="src") + + def _compute(self, required=False): + if required or self.options.compute == "auto": + return bool(self._parquet() or self._dataset_modules()) or bool(self.options.get_safe("substrait", False)) + else: + return bool(self.options.compute) + + def _parquet(self, required=False): + if required or self.options.parquet == "auto": + return bool(self.options.get_safe("substrait", False)) + else: + return bool(self.options.parquet) + + def _dataset_modules(self, required=False): + if required or self.options.dataset_modules == "auto": + return bool(self.options.get_safe("substrait", False)) + else: + return bool(self.options.dataset_modules) + + def _with_jemalloc(self, required=False): + if required or self.options.with_jemalloc == "auto": + return bool("BSD" in str(self.settings.os)) + else: + return bool(self.options.with_jemalloc) + + def _with_re2(self, required=False): + if required or self.options.with_re2 == "auto": + if self.options.gandiva or self.options.parquet: + return True + if Version(self) >= "7.0.0" and (self._compute() or self._dataset_modules()): + return True + return False + else: + return bool(self.options.with_re2) + + def _with_protobuf(self, required=False): + if required or self.options.with_protobuf == "auto": + return bool(self.options.gandiva or self._with_flight_rpc() or self.options.with_orc or self.options.get_safe("substrait", False)) + else: + return bool(self.options.with_protobuf) + + def _with_flight_rpc(self, required=False): + if required or self.options.with_flight_rpc == "auto": + return bool(self.options.get_safe("with_flight_sql", False)) + else: + return bool(self.options.with_flight_rpc) + + def _with_gflags(self, required=False): + if required or self.options.with_gflags == "auto": + return bool(self.options.plasma or self._with_glog() or self._with_grpc()) + else: + return bool(self.options.with_gflags) + + def _with_glog(self, required=False): + if required or self.options.with_glog == "auto": + return False + else: + return bool(self.options.with_glog) + + def _with_grpc(self, required=False): + if required or self.options.with_grpc == "auto": + return self._with_flight_rpc() + else: + return bool(self.options.with_grpc) + + def _with_boost(self, required=False): + if required or self.options.with_boost == "auto": + if self.options.gandiva: + return True + version = Version(self.version) + if version.major == "1": + if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): + return True + elif version.major >= "2": + if is_msvc(self): + return True + return False + else: + return bool(self.options.with_boost) + + def _with_thrift(self, required=False): + # No self.options.with_thift exists + return bool(required or self._parquet()) + + def _with_utf8proc(self, required=False): + if required or self.options.with_utf8proc == "auto": + return bool(self._compute() or self.options.gandiva) + else: + return bool(self.options.with_utf8proc) + + def _with_llvm(self, required=False): + if required or self.options.with_llvm == "auto": + return bool(self.options.gandiva) + else: + return bool(self.options.with_llvm) + + def _with_openssl(self, required=False): + if required or self.options.with_openssl == "auto": + return bool(self.options.encryption or self._with_flight_rpc() or self.options.with_s3) + else: + return bool(self.options.with_openssl) + + def _with_rapidjson(self): + if self.options.with_json: + return True + if Version(self.version) >= "7.0.0" and self.options.encryption: + return True + return False + + def requirements(self): + if self._with_thrift(): + self.requires("thrift/0.17.0") + if self._with_protobuf(): + self.requires("protobuf/3.21.4") + if self._with_jemalloc(): + self.requires("jemalloc/5.3.0") + if self.options.with_mimalloc: + self.requires("mimalloc/1.7.6") + if self._with_boost(): + self.requires("boost/1.80.0") + if self._with_gflags(): + self.requires("gflags/2.2.2") + if self._with_glog(): + self.requires("glog/0.6.0") + if self.options.get_safe("with_gcs"): + self.requires("google-cloud-cpp/1.40.1") + if self._with_grpc(): + self.requires("grpc/1.50.0") + if self._with_rapidjson(): + self.requires("rapidjson/1.1.0") + if self._with_llvm(): + self.requires("llvm-core/13.0.0") + if self._with_openssl(): + # aws-sdk-cpp requires openssl/1.1.1. it uses deprecated functions in openssl/3.0.0 + if self.options.with_s3: + self.requires("openssl/1.1.1s") + else: + self.requires("openssl/1.1.1s") + if self.options.get_safe("with_opentelemetry"): + self.requires("opentelemetry-cpp/1.7.0") + if self.options.with_s3: + self.requires("aws-sdk-cpp/1.9.234") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + if self.options.with_bz2: + self.requires("bzip2/1.0.8") + if self.options.with_lz4: + self.requires("lz4/1.9.4") + if self.options.with_snappy: + self.requires("snappy/1.1.9") + if Version(self.version) >= "6.0.0" and \ + self.options.get_safe("simd_level") != None or \ + self.options.get_safe("runtime_simd_level") != None: + self.requires("xsimd/9.0.1") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + if self._with_re2(): + self.requires("re2/20220601") + if self._with_utf8proc(): + self.requires("utf8proc/2.8.0") + if self.options.with_backtrace: + self.requires("libbacktrace/cci.20210118") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + filename=f"apache-arrow-{self.version}.tar.gz", destination=self.source_folder, strip_root=True) + + def generate(self): + # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist + tc = CMakeToolchain(self) + if cross_building(self): + cmake_system_processor = { + "armv8": "aarch64", + "armv8.3": "aarch64", + }.get(str(self.settings.arch), str(self.settings.arch)) + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor + if cmake_system_processor == "aarch64": + tc.variables["ARROW_CPU_FLAG"] = "armv8" + if is_msvc(self): + tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" + tc.variables["ARROW_PACKAGE_KIND"] = "conan" # See https://github.com/conan-io/conan-center-index/pull/14903/files#r1057938314 for details + tc.variables["ARROW_GANDIVA"] = bool(self.options.gandiva) + tc.variables["ARROW_PARQUET"] = self._parquet() + tc.variables["ARROW_SUBSTRAIT"] = bool(self.options.get_safe("substrait", False)) + tc.variables["ARROW_PLASMA"] = bool(self.options.plasma) + tc.variables["ARROW_DATASET"] = self._dataset_modules() + tc.variables["ARROW_FILESYSTEM"] = bool(self.options.filesystem_layer) + tc.variables["PARQUET_REQUIRE_ENCRYPTION"] = bool(self.options.encryption) + tc.variables["ARROW_HDFS"] = bool(self.options.hdfs_bridgs) + tc.variables["ARROW_VERBOSE_THIRDPARTY_BUILD"] = True + tc.variables["ARROW_BUILD_SHARED"] = bool(self.options.shared) + tc.variables["ARROW_BUILD_STATIC"] = not bool(self.options.shared) + tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) + tc.variables["ARROW_FLIGHT"] = self._with_flight_rpc() + tc.variables["ARROW_FLIGHT_SQL"] = bool(self.options.get_safe("with_flight_sql", False)) + tc.variables["ARROW_COMPUTE"] = self._compute() + tc.variables["ARROW_CSV"] = bool(self.options.with_csv) + tc.variables["ARROW_CUDA"] = bool(self.options.with_cuda) + tc.variables["ARROW_JEMALLOC"] = self._with_jemalloc() + tc.variables["jemalloc_SOURCE"] = "SYSTEM" + tc.variables["ARROW_MIMALLOC"] = bool(self.options.with_mimalloc) + tc.variables["ARROW_JSON"] = bool(self.options.with_json) + tc.variables["google_cloud_cpp_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GCS"] = bool(self.options.get_safe("with_gcs", False)) + tc.variables["BOOST_SOURCE"] = "SYSTEM" + tc.variables["Protobuf_SOURCE"] = "SYSTEM" + if self._with_protobuf(): + tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool(self.options["protobuf"].shared) + tc.variables["gRPC_SOURCE"] = "SYSTEM" + if self._with_grpc(): + tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.options["grpc"].shared) + + tc.variables["ARROW_USE_GLOG"] = self._with_glog() + tc.variables["GLOG_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_BACKTRACE"] = bool(self.options.with_backtrace) + tc.variables["ARROW_WITH_BROTLI"] = bool(self.options.with_brotli) + tc.variables["brotli_SOURCE"] = "SYSTEM" + if self.options.with_brotli: + tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.options["brotli"].shared) + tc.variables["gflags_SOURCE"] = "SYSTEM" + if self._with_gflags(): + tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool(self.options["gflags"].shared) + tc.variables["ARROW_WITH_BZ2"] = bool(self.options.with_bz2) + tc.variables["BZip2_SOURCE"] = "SYSTEM" + if self.options.with_bz2: + tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.options["bzip2"].shared) + tc.variables["ARROW_WITH_LZ4"] = bool(self.options.with_lz4) + tc.variables["lz4_SOURCE"] = "SYSTEM" + if self.options.with_lz4: + tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.options["lz4"].shared) + tc.variables["ARROW_WITH_SNAPPY"] = bool(self.options.with_snappy) + tc.variables["RapidJSON_SOURCE"] = "SYSTEM" + tc.variables["Snappy_SOURCE"] = "SYSTEM" + if self.options.with_snappy: + tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool(self.options["snappy"].shared) + tc.variables["ARROW_WITH_ZLIB"] = bool(self.options.with_zlib) + tc.variables["re2_SOURCE"] = "SYSTEM" + tc.variables["ZLIB_SOURCE"] = "SYSTEM" + tc.variables["xsimd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_ZSTD"] = bool(self.options.with_zstd) + if Version(self.version) >= "2.0": + tc.variables["zstd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() + else: + tc.variables["ZSTD_SOURCE"] = "SYSTEM" + if self.options.with_zstd: + tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.options["zstd"].shared) + tc.variables["ORC_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_THRIFT"] = self._with_thrift() + tc.variables["Thrift_SOURCE"] = "SYSTEM" + if self._with_thrift(): + tc.variables["THRIFT_VERSION"] = bool(self.deps_cpp_info["thrift"].version) # a recent thrift does not require boost + tc.variables["ARROW_THRIFT_USE_SHARED"] = bool(self.options["thrift"].shared) + tc.variables["ARROW_USE_OPENSSL"] = self._with_openssl() + if self._with_openssl(): + tc.variables["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") + tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool(self.options["openssl"].shared) + if self._with_boost(): + tc.variables["ARROW_USE_BOOST"] = True + tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.options["boost"].shared) + tc.variables["ARROW_S3"] = bool(self.options.with_s3) + tc.variables["AWSSDK_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BUILD_UTILITIES"] = bool(self.options.cli) + tc.variables["ARROW_BUILD_INTEGRATION"] = False + tc.variables["ARROW_INSTALL_NAME_RPATH"] = True + tc.variables["ARROW_BUILD_EXAMPLES"] = False + tc.variables["ARROW_BUILD_TESTS"] = False + tc.variables["ARROW_ENABLE_TIMING_TESTS"] = False + tc.variables["ARROW_BUILD_BENCHMARKS"] = False + tc.variables["LLVM_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() + tc.variables["ARROW_BOOST_REQUIRED"] = self._with_boost() + tc.variables["utf8proc_SOURCE"] = "SYSTEM" + if self._with_utf8proc(): + tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool(self.options["utf8proc"].shared) + tc.variables["BUILD_WARNING_LEVEL"] = "PRODUCTION" + if is_msvc(self): + tc.variables["ARROW_USE_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) + if self._with_llvm(): + tc.variables["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if "7.0.0" <= Version(self.version) < "10.0.0": + for filename in glob.glob(os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake")): + if os.path.basename(filename) not in [ + "FindArrow.cmake", + "FindArrowCUDA.cmake", + "FindArrowDataset.cmake", + "FindArrowFlight.cmake", + "FindArrowFlightSql.cmake", + "FindArrowFlightTesting.cmake", + "FindArrowPython.cmake", + "FindArrowPythonFlight.cmake", + "FindArrowSubstrait.cmake", + "FindArrowTesting.cmake", + "FindGandiva.cmake", + "FindParquet.cmake", + "FindPlasma.cmake", + ]: + os.remove(filename) + + def build(self): + self._patch_sources() + 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.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def _lib_name(self, name): + if is_msvc(self) and not self.options.shared: + return "{}_static".format(name) + else: + return "{}".format(name) + + def package_id(self): + self.info.options.with_gflags = self._with_gflags() + self.info.options.with_protobuf = self._with_protobuf() + self.info.options.with_re2 = self._with_re2() + self.info.options.with_jemalloc = self._with_jemalloc() + self.info.options.with_openssl = self._with_openssl() + self.info.options.with_boost = self._with_boost() + self.info.options.with_glog = self._with_glog() + self.info.options.with_grpc = self._with_grpc() + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "Arrow" + self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" + self.cpp_info.components["libarrow"].libs = [self._lib_name("arrow")] + self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow" + self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow" + self.cpp_info.components["libarrow"].names["pkg_config"] = "arrow" + if not self.options.shared: + self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libarrow"].system_libs = ["pthread", "m", "dl", "rt"] + + if self._parquet(): + self.cpp_info.components["libparquet"].libs = [self._lib_name("parquet")] + self.cpp_info.components["libparquet"].names["cmake_find_package"] = "parquet" + self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = "parquet" + self.cpp_info.components["libparquet"].names["pkg_config"] = "parquet" + self.cpp_info.components["libparquet"].requires = ["libarrow"] + if not self.options.shared: + self.cpp_info.components["libparquet"].defines = ["PARQUET_STATIC"] + + if self.options.get_safe("substrait", False): + self.cpp_info.components["libarrow_substrait"].libs = [self._lib_name("arrow_substrait")] + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = "arrow_substrait" + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = "arrow_substrait" + self.cpp_info.components["libarrow_substrait"].names["pkg_config"] = "arrow_substrait" + self.cpp_info.components["libarrow_substrait"].requires = ["libparquet", "dataset"] + + if self.options.plasma: + self.cpp_info.components["libplasma"].libs = [self._lib_name("plasma")] + self.cpp_info.components["libplasma"].names["cmake_find_package"] = "plasma" + self.cpp_info.components["libplasma"].names["cmake_find_package_multi"] = "plasma" + self.cpp_info.components["libplasma"].names["pkg_config"] = "plasma" + self.cpp_info.components["libplasma"].requires = ["libarrow"] + + if self.options.gandiva: + self.cpp_info.components["libgandiva"].libs = [self._lib_name("gandiva")] + self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva" + self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva" + self.cpp_info.components["libgandiva"].names["pkg_config"] = "gandiva" + self.cpp_info.components["libgandiva"].requires = ["libarrow"] + if not self.options.shared: + self.cpp_info.components["libgandiva"].defines = ["GANDIVA_STATIC"] + + if self._with_flight_rpc(): + self.cpp_info.components["libarrow_flight"].libs = [self._lib_name("arrow_flight")] + self.cpp_info.components["libarrow_flight"].names["cmake_find_package"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].names["cmake_find_package_multi"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].names["pkg_config"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] + + if self.options.get_safe("with_flight_sql"): + self.cpp_info.components["libarrow_flight_sql"].libs = [self._lib_name("arrow_flight_sql")] + self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package_multi"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].names["pkg_config"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].requires = ["libarrow", "libarrow_flight"] + + if self._dataset_modules(): + self.cpp_info.components["dataset"].libs = ["arrow_dataset"] + + if (self.options.cli and (self.options.with_cuda or self._with_flight_rpc() or self._parquet())) or self.options.plasma: + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var: {binpath}") + self.env_info.PATH.append(binpath) + + if self._with_boost(): + if self.options.gandiva: + # FIXME: only filesystem component is used + self.cpp_info.components["libgandiva"].requires.append("boost::boost") + if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): + self.cpp_info.components["libparquet"].requires.append("boost::boost") + if Version(self.version) >= "2.0": + # FIXME: only headers components is used + self.cpp_info.components["libarrow"].requires.append("boost::boost") + if self._with_openssl(): + self.cpp_info.components["libarrow"].requires.append("openssl::openssl") + if self._with_gflags(): + self.cpp_info.components["libarrow"].requires.append("gflags::gflags") + if self._with_glog(): + self.cpp_info.components["libarrow"].requires.append("glog::glog") + if self._with_jemalloc(): + self.cpp_info.components["libarrow"].requires.append("jemalloc::jemalloc") + if self.options.with_mimalloc: + self.cpp_info.components["libarrow"].requires.append("mimalloc::mimalloc") + if self._with_re2(): + if self.options.gandiva: + self.cpp_info.components["libgandiva"].requires.append("re2::re2") + if self._parquet(): + self.cpp_info.components["libparquet"].requires.append("re2::re2") + self.cpp_info.components["libarrow"].requires.append("re2::re2") + if self._with_llvm(): + self.cpp_info.components["libgandiva"].requires.append("llvm-core::llvm-core") + if self._with_protobuf(): + self.cpp_info.components["libarrow"].requires.append("protobuf::protobuf") + if self._with_utf8proc(): + self.cpp_info.components["libarrow"].requires.append("utf8proc::utf8proc") + if self._with_thrift(): + self.cpp_info.components["libarrow"].requires.append("thrift::thrift") + if self.options.with_backtrace: + self.cpp_info.components["libarrow"].requires.append("libbacktrace::libbacktrace") + if self.options.with_cuda: + self.cpp_info.components["libarrow"].requires.append("cuda::cuda") + if self._with_rapidjson(): + self.cpp_info.components["libarrow"].requires.append("rapidjson::rapidjson") + if self.options.with_s3: + self.cpp_info.components["libarrow"].requires.append("aws-sdk-cpp::s3") + if self.options.get_safe("with_gcs"): + self.cpp_info.components["libarrow"].requires.append("google-cloud-cpp::storage") + if self.options.with_orc: + self.cpp_info.components["libarrow"].requires.append("orc::orc") + if self.options.get_safe("with_opentelemetry"): + self.cpp_info.components["libarrow"].requires.append("opentelemetry-cpp::opentelemetry-cpp") + if self.options.with_brotli: + self.cpp_info.components["libarrow"].requires.append("brotli::brotli") + if self.options.with_bz2: + self.cpp_info.components["libarrow"].requires.append("bzip2::bzip2") + if self.options.with_lz4: + self.cpp_info.components["libarrow"].requires.append("lz4::lz4") + if self.options.with_snappy: + self.cpp_info.components["libarrow"].requires.append("snappy::snappy") + if self.options.get_safe("simd_level") != None or self.options.get_safe("runtime_simd_level") != None: + self.cpp_info.components["libarrow"].requires.append("xsimd::xsimd") + if self.options.with_zlib: + self.cpp_info.components["libarrow"].requires.append("zlib::zlib") + if self.options.with_zstd: + self.cpp_info.components["libarrow"].requires.append("zstd::zstd") + if self._with_boost(): + self.cpp_info.components["libarrow"].requires.append("boost::boost") + if self._with_grpc(): + self.cpp_info.components["libarrow"].requires.append("grpc::grpc") + if self._with_flight_rpc(): + self.cpp_info.components["libarrow_flight"].requires.append("protobuf::protobuf") 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 new file mode 100644 index 0000000000000..3c7e86d5ff279 --- /dev/null +++ b/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch @@ -0,0 +1,13 @@ +--- 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 new file mode 100644 index 0000000000000..5f0f6f4c52d5c --- /dev/null +++ b/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000000..eb6816262214b --- /dev/null +++ b/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch @@ -0,0 +1,333 @@ +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 new file mode 100644 index 0000000000000..f3268abf74e2c --- /dev/null +++ b/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch @@ -0,0 +1,13 @@ +--- 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 new file mode 100644 index 0000000000000..9fcc4b1a36a8a --- /dev/null +++ b/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch @@ -0,0 +1,13 @@ +--- 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 new file mode 100644 index 0000000000000..7153d641e0c61 --- /dev/null +++ b/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch @@ -0,0 +1,273 @@ +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/patches/7.0.0-0006-install-utils.patch b/recipes/arrow/all/patches/7.0.0-0006-install-utils.patch new file mode 100644 index 0000000000000..468fe3a6a6ab5 --- /dev/null +++ b/recipes/arrow/all/patches/7.0.0-0006-install-utils.patch @@ -0,0 +1,17 @@ +diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt +index 495018e..f6cee6f 100644 +--- a/cpp/src/arrow/ipc/CMakeLists.txt ++++ b/cpp/src/arrow/ipc/CMakeLists.txt +@@ -61,8 +61,12 @@ endif() + if(ARROW_BUILD_UTILITIES OR ARROW_BUILD_INTEGRATION) + add_executable(arrow-file-to-stream file_to_stream.cc) + target_link_libraries(arrow-file-to-stream ${ARROW_UTIL_LIB}) ++ install(TARGETS arrow-file-to-stream ${INSTALL_IS_OPTIONAL} ++ DESTINATION ${CMAKE_INSTALL_BINDIR}) + add_executable(arrow-stream-to-file stream_to_file.cc) + target_link_libraries(arrow-stream-to-file ${ARROW_UTIL_LIB}) ++ install(TARGETS arrow-stream-to-file ${INSTALL_IS_OPTIONAL} ++ DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(ARROW_BUILD_INTEGRATION) + add_dependencies(arrow-integration arrow-file-to-stream) diff --git a/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch b/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch new file mode 100644 index 0000000000000..8b4d5d5518dcc --- /dev/null +++ b/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch @@ -0,0 +1,347 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 2d7baf1..dff5b1a 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -699,7 +699,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") +@@ -715,10 +715,17 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) +- if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) +- endif() ++ if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) ++ endif() ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) ++ endif() ++endif() + endif() + + if(ARROW_WITH_SNAPPY) +@@ -907,8 +914,13 @@ 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 bc38952..62bf314 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -954,7 +954,7 @@ endif() + + if(ARROW_BOOST_REQUIRED) + resolve_dependency(Boost +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_BOOST_REQUIRED_VERSION} +@@ -965,7 +965,7 @@ if(ARROW_BOOST_REQUIRED) + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) + set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) +- elseif(BoostAlt_FOUND) ++ elseif(Boost_FOUND) + set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) + set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) + else() +@@ -1108,9 +1108,9 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + # 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}) + endif() +@@ -1302,22 +1302,17 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1411,9 +1406,9 @@ if(ARROW_WITH_THRIFT) + thrift) + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + +- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) ++ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) + list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) + list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) + list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) +@@ -1528,6 +1523,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf ++ USE_CONFIG + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} + PC_PACKAGE_NAMES +@@ -1538,7 +1534,7 @@ if(ARROW_WITH_PROTOBUF) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(TARGET arrow::protobuf::libprotobuf) + set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) +@@ -1547,9 +1543,9 @@ if(ARROW_WITH_PROTOBUF) + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf UNKNOWN IMPORTED) + set_target_properties(protobuf::libprotobuf +- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" ++ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) + endif() +@@ -1569,7 +1565,7 @@ if(ARROW_WITH_PROTOBUF) + set_target_properties(protobuf::libprotoc + PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) + endif() +@@ -1600,6 +1596,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 +@@ -1665,12 +1662,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. + +@@ -1716,6 +1719,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() + + # ---------------------------------------------------------------------- +@@ -2001,7 +2009,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2038,10 +2046,9 @@ endmacro() + + if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" + )) +- set(xsimd_SOURCE "BUNDLED") + resolve_dependency(xsimd) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) ++ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) + endif() + + macro(build_zlib) +@@ -2140,10 +2147,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) ++ 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) ++ 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}) + endif() + +@@ -2274,7 +2285,7 @@ if(ARROW_WITH_RE2) + # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may + # include -std=c++11. It's not compatible with C source and C++ + # source not uses C++ 11. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION) + string(APPEND ARROW_PC_LIBS_PRIVATE " ${RE2_LIB}") +@@ -2337,7 +2348,7 @@ endmacro() + if(ARROW_WITH_BZ2) + resolve_dependency(BZip2) + if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") + endif() + + if(NOT TARGET BZip2::BZip2) +@@ -2346,7 +2357,7 @@ if(ARROW_WITH_BZ2) + PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") + endif() +- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") ++ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") + endif() + + macro(build_utf8proc) +@@ -3555,7 +3566,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3573,9 +3584,9 @@ if(ARROW_WITH_GRPC) + 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 ${gPC_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}") +@@ -4097,9 +4108,9 @@ macro(build_opentelemetry) + endmacro() + + if(ARROW_WITH_OPENTELEMETRY) +- set(opentelemetry-cpp_SOURCE "AUTO") ++ set(opentelemetry-cpp_SOURCE "SYSTEM") + resolve_dependency(opentelemetry-cpp) +- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api ++ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) + message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index b984bc1..2c78cd9 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -323,10 +323,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/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt +index 2cf8c99..90ebb9a 100644 +--- a/cpp/src/arrow/flight/CMakeLists.txt ++++ b/cpp/src/arrow/flight/CMakeLists.txt +@@ -17,6 +17,9 @@ + + add_custom_target(arrow_flight) + ++# TODO: This is a temporary workaround. absl should be LINKED as TARGET. ++include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ + arrow_install_all_headers("arrow/flight") + + set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 2dcfb01..0394c01 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -48,7 +48,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/patches/8.0.0-0005-install-utils.patch b/recipes/arrow/all/patches/8.0.0-0005-install-utils.patch new file mode 100644 index 0000000000000..397c4b1d043c7 --- /dev/null +++ b/recipes/arrow/all/patches/8.0.0-0005-install-utils.patch @@ -0,0 +1,43 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index aba18c8..bb463d0 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -721,7 +721,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) + if(Lz4_SOURCE STREQUAL "SYSTEM") + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) + endif() +@@ -907,8 +907,8 @@ endif() + if(ARROW_JEMALLOC) + add_definitions(-DARROW_JEMALLOC) + add_definitions(-DARROW_JEMALLOC_INCLUDE_DIR=${JEMALLOC_INCLUDE_DIR}) +- list(APPEND ARROW_LINK_LIBS jemalloc::jemalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS jemalloc::jemalloc) ++ list(APPEND ARROW_LINK_LIBS jemalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS jemalloc) + endif() + + if(ARROW_MIMALLOC) +diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt +index 495018e..3dcb35d 100644 +--- a/cpp/src/arrow/ipc/CMakeLists.txt ++++ b/cpp/src/arrow/ipc/CMakeLists.txt +@@ -61,9 +61,13 @@ endif() + if(ARROW_BUILD_UTILITIES OR ARROW_BUILD_INTEGRATION) + add_executable(arrow-file-to-stream file_to_stream.cc) + target_link_libraries(arrow-file-to-stream ${ARROW_UTIL_LIB}) ++ install(TARGETS arrow-file-to-stream ${INSTALL_IS_OPTIONAL} ++ DESTINATION ${CMAKE_INSTALL_BINDIR}) + add_executable(arrow-stream-to-file stream_to_file.cc) + target_link_libraries(arrow-stream-to-file ${ARROW_UTIL_LIB}) +- ++ install(TARGETS arrow-stream-to-file ${INSTALL_IS_OPTIONAL} ++ DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ + if(ARROW_BUILD_INTEGRATION) + add_dependencies(arrow-integration arrow-file-to-stream) + add_dependencies(arrow-integration arrow-stream-to-file) diff --git a/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch new file mode 100644 index 0000000000000..eb60d6e795ad5 --- /dev/null +++ b/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch @@ -0,0 +1,425 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index bb463d0..ce2d1df 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -705,7 +705,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") +@@ -721,11 +721,18 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) +- if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) ++ if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) ++ endif() ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) + endif() + endif() ++endif() + + if(ARROW_WITH_SNAPPY) + list(APPEND ARROW_STATIC_LINK_LIBS Snappy::snappy) +@@ -913,8 +920,13 @@ 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 f070323..16faf73 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -959,6 +959,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_FLIGHT AND ARROW_BUILD_BENCHMARKS) + OR (ARROW_S3 AND ARROW_BUILD_BENCHMARKS)) +@@ -975,7 +976,7 @@ endif() + + if(ARROW_BOOST_REQUIRED) + resolve_dependency(Boost +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_BOOST_REQUIRED_VERSION} +@@ -986,7 +987,7 @@ if(ARROW_BOOST_REQUIRED) + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) + set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) +- elseif(BoostAlt_FOUND) ++ elseif(Boost_FOUND) + set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) + set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) + else() +@@ -1129,9 +1130,9 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + # 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}) + endif() +@@ -1323,22 +1324,16 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) +- +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1432,9 +1427,9 @@ if(ARROW_WITH_THRIFT) + thrift) + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + +- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) ++ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) + list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) + list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) + list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) +@@ -1557,6 +1552,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf ++ USE_CONFIG + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} + PC_PACKAGE_NAMES +@@ -1567,7 +1563,7 @@ if(ARROW_WITH_PROTOBUF) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(TARGET arrow::protobuf::libprotobuf) + set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) +@@ -1576,9 +1572,9 @@ if(ARROW_WITH_PROTOBUF) + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf UNKNOWN IMPORTED) + set_target_properties(protobuf::libprotobuf +- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" ++ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) + endif() +@@ -1598,7 +1594,7 @@ if(ARROW_WITH_PROTOBUF) + set_target_properties(protobuf::libprotoc + PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) + endif() +@@ -1690,11 +1686,12 @@ macro(build_substrait) + + add_custom_target(substrait_gen ALL DEPENDS ${SUBSTRAIT_PROTO_GEN_ALL}) + +- set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${PROTOBUF_INCLUDE_DIR}) ++ set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${protobuf_INCLUDE_DIR}) + + add_library(substrait STATIC ${SUBSTRAIT_SOURCES}) + set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_include_directories(substrait PUBLIC ${SUBSTRAIT_INCLUDES}) ++ target_include_directories(substrait PUBLIC ${PROTOBUF_INCLUDE_DIR}) + target_link_libraries(substrait INTERFACE ${ARROW_PROTOBUF_LIBPROTOBUF}) + add_dependencies(substrait substrait_gen) + +@@ -1711,6 +1708,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 +@@ -1780,12 +1778,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. + +@@ -1836,6 +1840,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() + + # ---------------------------------------------------------------------- +@@ -2121,7 +2130,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2158,10 +2167,10 @@ endmacro() + + if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" + )) +- set(xsimd_SOURCE "BUNDLED") ++ set(xsimd_SOURCE "SYSTEM") + resolve_dependency(xsimd) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) ++ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) + endif() + + macro(build_zlib) +@@ -2260,10 +2269,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) ++ 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) ++ 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}) + endif() + +@@ -2394,7 +2407,7 @@ if(ARROW_WITH_RE2) + # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may + # include -std=c++11. It's not compatible with C source and C++ + # source not uses C++ 11. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE}) + if(NOT RE2_LIB) +@@ -2464,7 +2477,7 @@ endmacro() + if(ARROW_WITH_BZ2) + resolve_dependency(BZip2) + if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") + endif() + + if(NOT TARGET BZip2::BZip2) +@@ -2473,7 +2486,7 @@ if(ARROW_WITH_BZ2) + PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") + endif() +- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") ++ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") + endif() + + macro(build_utf8proc) +@@ -3709,7 +3722,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3727,9 +3740,9 @@ if(ARROW_WITH_GRPC) + 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}") +@@ -3937,7 +3950,7 @@ macro(build_google_cloud_cpp_storage) + endmacro() + + if(ARROW_WITH_GOOGLE_CLOUD_CPP) +- resolve_dependency(google_cloud_cpp_storage) ++ resolve_dependency(google_cloud_cpp) + get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) +@@ -4264,9 +4277,9 @@ if(ARROW_WITH_OPENTELEMETRY) + # cURL is required whether we build from source or use an existing installation + # (OTel's cmake files do not call find_curl for you) + find_curl() +- set(opentelemetry-cpp_SOURCE "AUTO") ++ set(opentelemetry-cpp_SOURCE "SYSTEM") + resolve_dependency(opentelemetry-cpp) +- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api ++ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) + message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 690c51a..752f3b9 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -326,10 +326,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/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt +index f9d1356..c9bcf79 100644 +--- a/cpp/src/arrow/flight/CMakeLists.txt ++++ b/cpp/src/arrow/flight/CMakeLists.txt +@@ -17,6 +17,9 @@ + + add_custom_target(arrow_flight) + ++# TODO: This is a temporary workaround. absl should be LINKED as TARGET. ++include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ + arrow_install_all_headers("arrow/flight") + + set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index ed1c2d8..37a89da 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -52,7 +52,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 71faf9a..3aabea1 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}) +@@ -40,7 +40,7 @@ endif() + + add_definitions(-DGANDIVA_LLVM_VERSION=${LLVM_VERSION_MAJOR}) + +-find_package(OpenSSLAlt REQUIRED) ++find_package(OpenSSL REQUIRED) + + # Set the path where the bitcode file generated, see precompiled/CMakeLists.txt + set(GANDIVA_PRECOMPILED_BC_PATH "${CMAKE_CURRENT_BINARY_DIR}/irhelpers.bc") +@@ -98,10 +98,11 @@ set(SRC_FILES + random_generator_holder.cc + ${GANDIVA_PRECOMPILED_CC_PATH}) + +-set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE +- ${GANDIVA_OPENSSL_LIBS}) ++set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core NTERFACE ++ ${GANDIVA_OPENSSL_LIBS}) ++ ++set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core ${GANDIVA_OPENSSL_LIBS}) + +-set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE ${GANDIVA_OPENSSL_LIBS}) + + if(ARROW_GANDIVA_STATIC_LIBSTDCPP AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX + )) +@@ -139,7 +140,7 @@ add_arrow_lib(gandiva + arrow_dependencies + precompiled + EXTRA_INCLUDES +- $ ++ $ + ${GANDIVA_OPENSSL_INCLUDE_DIR} + ${UTF8PROC_INCLUDE_DIR} + SHARED_LINK_FLAGS diff --git a/recipes/arrow/all/test_package/CMakeLists.txt b/recipes/arrow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9b721bbe6a17c --- /dev/null +++ b/recipes/arrow/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +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 (${Arrow_VERSION} VERSION_LESS "10.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/arrow/all/test_package/conanfile.py b/recipes/arrow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/arrow/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/arrow/all/test_package/test_package.cpp b/recipes/arrow/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..42cab6cc76e7a --- /dev/null +++ b/recipes/arrow/all/test_package/test_package.cpp @@ -0,0 +1,190 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include +#include +#include + +#include + +using arrow::DoubleBuilder; +using arrow::Int64Builder; +using arrow::ListBuilder; + +// While we want to use columnar data structures to build efficient operations, we +// often receive data in a row-wise fashion from other systems. In the following, +// we want give a brief introduction into the classes provided by Apache Arrow by +// showing how to transform row-wise data into a columnar table. +// +// The data in this example is stored in the following struct: +struct data_row { + int64_t id; + double cost; + std::vector cost_components; +}; + +// Transforming a vector of structs into a columnar Table. +// +// The final representation should be an `arrow::Table` which in turn +// is made up of an `arrow::Schema` and a list of +// `arrow::ChunkedArray` instances. As the first step, we will iterate +// over the data and build up the arrays incrementally. For this +// task, we provide `arrow::ArrayBuilder` classes that help in the +// construction of the final `arrow::Array` instances. +// +// For each type, Arrow has a specially typed builder class. For the primitive +// values `id` and `cost` we can use the respective `arrow::Int64Builder` and +// `arrow::DoubleBuilder`. For the `cost_components` vector, we need to have two +// builders, a top-level `arrow::ListBuilder` that builds the array of offsets and +// a nested `arrow::DoubleBuilder` that constructs the underlying values array that +// is referenced by the offsets in the former array. +arrow::Status VectorToColumnarTable(const std::vector& rows, + std::shared_ptr* table) { + // The builders are more efficient using + // arrow::jemalloc::MemoryPool::default_pool() as this can increase the size of + // the underlying memory regions in-place. At the moment, arrow::jemalloc is only + // supported on Unix systems, not Windows. + arrow::MemoryPool* pool = arrow::default_memory_pool(); + + Int64Builder id_builder(pool); + DoubleBuilder cost_builder(pool); + ListBuilder components_builder(pool, std::make_shared(pool)); + // The following builder is owned by components_builder. + DoubleBuilder& cost_components_builder = + *(static_cast(components_builder.value_builder())); + + // Now we can loop over our existing data and insert it into the builders. The + // `Append` calls here may fail (e.g. we cannot allocate enough additional memory). + // Thus we need to check their return values. For more information on these values, + // check the documentation about `arrow::Status`. + for (const data_row& row : rows) { + ARROW_RETURN_NOT_OK(id_builder.Append(row.id)); + ARROW_RETURN_NOT_OK(cost_builder.Append(row.cost)); + + // Indicate the start of a new list row. This will memorise the current + // offset in the values builder. + ARROW_RETURN_NOT_OK(components_builder.Append()); + // Store the actual values. The final nullptr argument tells the underyling + // builder that all added values are valid, i.e. non-null. + ARROW_RETURN_NOT_OK(cost_components_builder.AppendValues(row.cost_components.data(), + row.cost_components.size())); + } + + // At the end, we finalise the arrays, declare the (type) schema and combine them + // into a single `arrow::Table`: + std::shared_ptr id_array; + ARROW_RETURN_NOT_OK(id_builder.Finish(&id_array)); + std::shared_ptr cost_array; + ARROW_RETURN_NOT_OK(cost_builder.Finish(&cost_array)); + // No need to invoke cost_components_builder.Finish because it is implied by + // the parent builder's Finish invocation. + std::shared_ptr cost_components_array; + ARROW_RETURN_NOT_OK(components_builder.Finish(&cost_components_array)); + + std::vector> schema_vector = { + arrow::field("id", arrow::int64()), arrow::field("cost", arrow::float64()), + arrow::field("cost_components", arrow::list(arrow::float64()))}; + + auto schema = std::make_shared(schema_vector); + + // The final `table` variable is the one we then can pass on to other functions + // that can consume Apache Arrow memory structures. This object has ownership of + // all referenced data, thus we don't have to care about undefined references once + // we leave the scope of the function building the table and its underlying arrays. + *table = arrow::Table::Make(schema, {id_array, cost_array, cost_components_array}); + + return arrow::Status::OK(); +} + +arrow::Status ColumnarTableToVector(const std::shared_ptr& table, + std::vector* rows) { + // To convert an Arrow table back into the same row-wise representation as in the + // above section, we first will check that the table conforms to our expected + // schema and then will build up the vector of rows incrementally. + // + // For the check if the table is as expected, we can utilise solely its schema. + std::vector> schema_vector = { + arrow::field("id", arrow::int64()), arrow::field("cost", arrow::float64()), + arrow::field("cost_components", arrow::list(arrow::float64()))}; + auto expected_schema = std::make_shared(schema_vector); + + if (!expected_schema->Equals(*table->schema())) { + // The table doesn't have the expected schema thus we cannot directly + // convert it to our target representation. + return arrow::Status::Invalid("Schemas are not matching!"); + } + + // As we have ensured that the table has the expected structure, we can unpack the + // underlying arrays. For the primitive columns `id` and `cost` we can use the high + // level functions to get the values whereas for the nested column + // `cost_components` we need to access the C-pointer to the data to copy its + // contents into the resulting `std::vector`. Here we need to be care to + // also add the offset to the pointer. This offset is needed to enable zero-copy + // slicing operations. While this could be adjusted automatically for double + // arrays, this cannot be done for the accompanying bitmap as often the slicing + // border would be inside a byte. + + auto ids = + std::static_pointer_cast(table->column(0)->chunk(0)); + auto costs = + std::static_pointer_cast(table->column(1)->chunk(0)); + auto cost_components = + std::static_pointer_cast(table->column(2)->chunk(0)); + auto cost_components_values = + std::static_pointer_cast(cost_components->values()); + // To enable zero-copy slices, the native values pointer might need to account + // for this slicing offset. This is not needed for the higher level functions + // like Value(…) that already account for this offset internally. + const double* ccv_ptr = cost_components_values->data()->GetValues(1); + + for (int64_t i = 0; i < table->num_rows(); i++) { + // Another simplification in this example is that we assume that there are + // no null entries, e.g. each row is fill with valid values. + int64_t id = ids->Value(i); + double cost = costs->Value(i); + const double* first = ccv_ptr + cost_components->value_offset(i); + const double* last = ccv_ptr + cost_components->value_offset(i + 1); + std::vector components_vec(first, last); + rows->push_back({id, cost, components_vec}); + } + + return arrow::Status::OK(); +} + +#define EXIT_ON_FAILURE(expr) \ + do { \ + arrow::Status status_ = (expr); \ + if (!status_.ok()) { \ + std::cerr << status_.message() << std::endl; \ + return EXIT_FAILURE; \ + } \ + } while (0); + +int main(int argc, char** argv) { + std::vector rows = { + {1, 1.0, {1.0}}, {2, 2.0, {1.0, 2.0}}, {3, 3.0, {1.0, 2.0, 3.0}}}; + + std::shared_ptr table; + EXIT_ON_FAILURE(VectorToColumnarTable(rows, &table)); + + std::vector expected_rows; + EXIT_ON_FAILURE(ColumnarTableToVector(table, &expected_rows)); + + assert(rows.size() == expected_rows.size()); + + return EXIT_SUCCESS; +} diff --git a/recipes/arrow/all/test_v1_package/CMakeLists.txt b/recipes/arrow/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a9b48732268c --- /dev/null +++ b/recipes/arrow/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/arrow/all/test_v1_package/conanfile.py b/recipes/arrow/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/arrow/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/arrow/config.yml b/recipes/arrow/config.yml new file mode 100644 index 0000000000000..f8d5aa9001a2b --- /dev/null +++ b/recipes/arrow/config.yml @@ -0,0 +1,17 @@ +versions: + "11.0.0": + folder: all + "10.0.1": + folder: all + "10.0.0": + folder: all + "8.0.1": + folder: all + "8.0.0": + folder: all + "7.0.0": + folder: all + "2.0.0": + folder: all + "1.0.0": + folder: all diff --git a/recipes/arsenalgear/all/CMakeLists.txt b/recipes/arsenalgear/all/CMakeLists.txt new file mode 100644 index 0000000000000..3656fbcc9d3a0 --- /dev/null +++ b/recipes/arsenalgear/all/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.8) +project(arsenalgear LANGUAGES CXX) + +include(GNUInstallDirs) + +add_library(arsenalgear ${arsenalgear_src}) +target_sources(arsenalgear PRIVATE + $<$: + ${ARSENALGEAR_SRC_DIR}/src/operators.cpp + > + ${ARSENALGEAR_SRC_DIR}/src/stream.cpp + ${ARSENALGEAR_SRC_DIR}/src/system.cpp + ${ARSENALGEAR_SRC_DIR}/src/utils.cpp +) +target_include_directories(arsenalgear PRIVATE "${ARSENALGEAR_SRC_DIR}/include") +set_target_properties(arsenalgear PROPERTIES + PUBLIC_HEADER "${arsenalgear_inc}" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) +target_compile_features(arsenalgear PUBLIC cxx_std_17) + +if(${ARSENALGEAR_VERSION} VERSION_LESS 2.0.0) + find_package(Boost REQUIRED CONFIG) + target_link_libraries(arsenalgear PUBLIC Boost::headers) + + find_package(exprtk CONFIG) + if(${exprtk_FOUND}) + target_link_libraries(arsenalgear PUBLIC exprtk::exprtk) + endif() +endif() + +find_library(LIBM m) +target_link_libraries(arsenalgear PRIVATE $<$:${LIBM}>) + +install( + TARGETS arsenalgear + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install( + DIRECTORY ${ARSENALGEAR_SRC_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arsenalgear +) diff --git a/recipes/arsenalgear/all/conandata.yml b/recipes/arsenalgear/all/conandata.yml new file mode 100644 index 0000000000000..3b459d19be1fc --- /dev/null +++ b/recipes/arsenalgear/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.1.0": + url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v2.1.0.tar.gz" + sha256: "2548a0452f3c290f4912ccc3511ae70be62ef4cd8e5d372e27423184d72785f9" + "2.0.1": + url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v2.0.1.tar.gz" + sha256: "d0fa1639abb3c41aa60e596b9d70966281a1206c5527b34a4526f6577c3bac6f" + "1.2.2": + url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v1.2.2.tar.gz" + sha256: "556155d0be0942bcdd5df02fcda258579915e76b5a70e7220de6ef38c8ca7779" diff --git a/recipes/arsenalgear/all/conanfile.py b/recipes/arsenalgear/all/conanfile.py new file mode 100644 index 0000000000000..6e42344321144 --- /dev/null +++ b/recipes/arsenalgear/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +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 ArsenalgearConan(ConanFile): + name = "arsenalgear" + description = "A library containing general purpose C++ utils." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/JustWhit3/arsenalgear-cpp" + topics = ("constants", "math", "operators", "stream") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def export_sources(self): + if Version(self.version) < "2.1.0": + 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "2.0.0": + self.requires("boost/1.81.0") + if self.settings.os in ["Linux", "Macos"]: + self.requires("exprtk/0.0.2") + + def validate(self): + # arsenalgear doesn't support Visual Studio(yet). + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio(yet)") + + 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) + if Version(self.version) < "2.1.0": + tc.variables["ARSENALGEAR_VERSION"] = str(self.version) + tc.variables["ARSENALGEAR_SRC_DIR"] = self.source_folder.replace("\\", "/") + else: + tc.variables["ARSENALGEAR_TESTS"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + if Version(self.version) < "2.1.0": + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + else: + 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 = ["arsenalgear"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/arsenalgear/all/test_package/CMakeLists.txt b/recipes/arsenalgear/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3ff34ca782123 --- /dev/null +++ b/recipes/arsenalgear/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(arsenalgear REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE arsenalgear::arsenalgear) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/arsenalgear/all/test_package/conanfile.py b/recipes/arsenalgear/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/arsenalgear/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/arsenalgear/all/test_package/test_package.cpp b/recipes/arsenalgear/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..895be62629f85 --- /dev/null +++ b/recipes/arsenalgear/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include "arsenalgear/constants.hpp" +#include "arsenalgear/operators.hpp" + +void operators() { + std::cout << "\n" + << "======================================================" + << "\n" + << " OPERATORS " + << "\n" + << "======================================================" + << "\n" + << "\n"; + + std::string a = "a"; + std::cout << "Multiplying \"a\" for 5 times: " << a * 5 + << agr::empty_space * 5 << "adding spaces." + << "\n\n"; +} + +int main() { + operators(); + return 0; +} diff --git a/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bc541ea90b512 --- /dev/null +++ b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +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/arsenalgear/all/test_v1_package/conanfile.py b/recipes/arsenalgear/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/arsenalgear/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/arsenalgear/config.yml b/recipes/arsenalgear/config.yml new file mode 100644 index 0000000000000..b3de9cadbac04 --- /dev/null +++ b/recipes/arsenalgear/config.yml @@ -0,0 +1,7 @@ +versions: + "2.1.0": + folder: all + "2.0.1": + folder: all + "1.2.2": + folder: all diff --git a/recipes/artery-font-format/all/conandata.yml b/recipes/artery-font-format/all/conandata.yml new file mode 100644 index 0000000000000..b248576ab34a5 --- /dev/null +++ b/recipes/artery-font-format/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.1": + url: "https://github.com/Chlumsky/artery-font-format/archive/v1.0.1.tar.gz" + sha256: "23dc9450d2364c9f1a67fcb0ae8f2bef365fabc5a3f4af55d9a646f8fbcdc537" + "1.0": + url: "https://github.com/Chlumsky/artery-font-format/archive/refs/tags/v1.0.tar.gz" + sha256: "311172C09E6B74574C93C382EBB92212FFC1710DFCF04FC25376A575DFE16DA8" diff --git a/recipes/artery-font-format/all/conanfile.py b/recipes/artery-font-format/all/conanfile.py new file mode 100644 index 0000000000000..a477d0ff0e98a --- /dev/null +++ b/recipes/artery-font-format/all/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, CMake, tools + +required_conan_version = ">=1.33.0" + + +class ArteryFontFormatConan(ConanFile): + name = "artery-font-format" + 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") + + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + self.copy("*.h", src=self._source_subfolder, dst="include") + self.copy("*.hpp", src=self._source_subfolder, dst="include") diff --git a/recipes/artery-font-format/all/test_package/CMakeLists.txt b/recipes/artery-font-format/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..454c47bb2cbab --- /dev/null +++ b/recipes/artery-font-format/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/artery-font-format/all/test_package/conanfile.py b/recipes/artery-font-format/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c53028872776c --- /dev/null +++ b/recipes/artery-font-format/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "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") + arfont = os.path.join(self.source_folder, "example.arfont") + self.run("{} {}".format(bin_path, arfont), run_environment=True) diff --git a/recipes/artery-font-format/all/test_package/example.arfont b/recipes/artery-font-format/all/test_package/example.arfont new file mode 100644 index 0000000000000000000000000000000000000000..a1530434762b659980ec1494c080c2f55b5c68b8 GIT binary patch literal 66580 zcmb@ObyQVd+wM2r-AH!{NOwy&2uL@GNOyN5E!`#3(n=$e(j|zrfOMC@S$n&mH^%wK z8Q&jgk1@wY_^pd;-t(UKoNKY3M^aP!x#mj_Sv6H{5cp$g$EX4W`3eNWhxY$d2WAp+ zK_GB{e*8ZX|L^aCuS5KQBha5>OMyT^5=B;Cmnt9hArAzibZ=kmTg2Y5c|;4}+}J_D3T#E)v%R&VGyEaDOGKmzkz00-vd zA$({z3xsEc@@8m!knx5-)%!c%AWwh=yaQgq{(-rM#D@vWR|xou4E&7lbPD?@7Nnp6 zXvqV9UIOeFpbz|4Jei^V{gc9WFu#{k0OdUZZ7~1$cl;Ai7ATMPE4tlnv0LoCc~oqR z2s~d_01FFT;|BC%Qn0K85I?L?o|4$OUAg34hs_PKxL7U<;716E`-B7t6bg&b+ z5Ox8)3y?QhKm+0vMEI}qvP1c&l$9a@6fPYUr(R;2h>QRaj%P45o=JeGzxl}l<@Zq& zJK+1WJF+zE#cXcm0k2yC3(Qv#4AA(1eE92!6Us+N{hePN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shak0bQ-BR}ycCkzJa|eP8kOMi~@5jNx*ZVG>+SkE! z^-V<-x3ERG!djt0o8W+Z$n6PwN;E)V7QqMtz#rgcE!-F287Gx?-dfZd)PGsDeasv-RW>(2RZAv^yfO`V{^h<&RkVRm9{p)=f zPwneqx)b_h0V)Ox8v#q;eyKWCK|h~AO;CClcq~&BMy;51)?y z^1#m>nfuh9+F4C^-U$hT>x4oB$$=^Yl+nMp_u+PR>8$84564pmJhdk=-IGn*!`>=Z z=}tIR0;~lPiF`!6s>O0#`cr#qPwlBawWs#fp4wA;YESK{J+-Iy)SlW?dumVZ3GM$c z4-NzX0001h{9g;f4l)XmDil~i$p8QV07*qoM6N<$f&c&j0001Ev&>Zh0000000000 S000000000K1OWg(hk18jFr>Nw literal 0 HcmV?d00001 diff --git a/recipes/artery-font-format/all/test_package/test_package.cpp b/recipes/artery-font-format/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8e85c6f96e501 --- /dev/null +++ b/recipes/artery-font-format/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#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; +} diff --git a/recipes/artery-font-format/config.yml b/recipes/artery-font-format/config.yml new file mode 100644 index 0000000000000..7b06dd8bf61ea --- /dev/null +++ b/recipes/artery-font-format/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.1": + folder: all + "1.0": + folder: all diff --git a/recipes/aruco/3.x.x/conandata.yml b/recipes/aruco/3.x.x/conandata.yml new file mode 100644 index 0000000000000..eb3415158ea14 --- /dev/null +++ b/recipes/aruco/3.x.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.1.12": + url: "https://downloads.sourceforge.net/project/aruco/3.1.12/aruco-3.1.12.zip" + sha256: "70b9ec8aa8eac6fe3f622201747a3e32c77bbb5f015e28a95c1c7c91f8ee8a09" diff --git a/recipes/aruco/3.x.x/conanfile.py b/recipes/aruco/3.x.x/conanfile.py new file mode 100644 index 0000000000000..fb95bc3ec62e7 --- /dev/null +++ b/recipes/aruco/3.x.x/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class ArucoConan(ConanFile): + name = "aruco" + description = "Augmented reality library based on OpenCV " + topics = ("augmented-reality", "robotics", "markers") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.uco.es/investiga/grupos/ava/node/26" + license = "GPL-3.0-only" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [False, True], + "fPIC": [False, True], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("opencv/4.5.5") + self.requires("eigen/3.4.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ARUCO_DEVINSTALL"] = True + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_GLSAMPLES"] = False + tc.variables["BUILD_UTILS"] = False + tc.variables["BUILD_DEBPACKAGE"] = False + tc.variables["BUILD_SVM"] = False + tc.variables["INSTALL_DOC"] = False + tc.variables["USE_OWN_EIGEN3"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "aruco") + self.cpp_info.includedirs.append(os.path.join("include", "aruco")) + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/aruco/3.x.x/test_package/CMakeLists.txt b/recipes/aruco/3.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..30e5df3e94e16 --- /dev/null +++ b/recipes/aruco/3.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(aruco REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE aruco::aruco) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aruco/3.x.x/test_package/conanfile.py b/recipes/aruco/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..98ab55852ad56 --- /dev/null +++ b/recipes/aruco/3.x.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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/aruco/3.x.x/test_package/test_package.cpp b/recipes/aruco/3.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..4632ed7b42bd6 --- /dev/null +++ b/recipes/aruco/3.x.x/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include + +#include +#include + +#include + +int main() { + cv::Mat image = cv::Mat::zeros(600,600,CV_8UC3); + + aruco::MarkerDetector MDetector; + MDetector.setDictionary("ARUCO_MIP_36h12"); + + //detect + std::vector markers = MDetector.detect(image); + + return EXIT_SUCCESS; +} diff --git a/recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt b/recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aruco/3.x.x/test_v1_package/conanfile.py b/recipes/aruco/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aruco/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aruco/config.yml b/recipes/aruco/config.yml new file mode 100644 index 0000000000000..243128b45c736 --- /dev/null +++ b/recipes/aruco/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.12": + folder: 3.x.x diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml new file mode 100644 index 0000000000000..67c8b715cb2d3 --- /dev/null +++ b/recipes/asio-grpc/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.4.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.4.0.tar.gz" + sha256: "d71de4f8de91dc0ad44d6a161fc628496b80622a6f9030dcd4c53b516629b8b7" + "2.3.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.3.0.tar.gz" + sha256: "eb48e72c98d45d9251fe1cbdca3a72a4d67435a7020357cd33ff717cc5851c01" + "2.2.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.2.0.tar.gz" + sha256: "a820e48681bc66834f7e6dbc326e245416f4ef009769f45826b3d09079afad4c" + "2.1.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.1.0.tar.gz" + sha256: "51da699eb442db3ec3af1caae5a29d78733ebbd9d1b781f75abe6ce2802fc7c1" + "2.0.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.0.0.tar.gz" + sha256: "e36ab4f286dccfd6589b8001d6560e994c753539738680588264c1c0e0a6ce4f" + "1.7.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v1.7.0.tar.gz" + sha256: "1b2a3c832c72d1f3be90c9665731fc6076a970d6249723a49ea12dbe2b0749ea" diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py new file mode 100644 index 0000000000000..3bb6966103744 --- /dev/null +++ b/recipes/asio-grpc/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class AsioGrpcConan(ConanFile): + name = "asio-grpc" + description = ("Asynchronous gRPC with Asio/unified executors") + homepage = "https://github.com/Tradias/asio-grpc" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("cpp", "asynchronous", "grpc", "asio", "asynchronous-programming", "cpp17", "coroutine", "cpp20", "executors") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + options = { + "backend": ["boost", "asio", "unifex"], + "local_allocator": ["auto", "memory_resource", "boost_container", "recycling_allocator"], + } + default_options = { + "backend": "boost", + "local_allocator": "auto", + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "clang": "6", + "apple-clang": "11", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, which your compiler does not support.") + else: + self.output.warn(f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + + def configure(self): + self._local_allocator_option = self.options.local_allocator + if self._local_allocator_option == "auto": + libcxx = self.settings.compiler.get_safe("libcxx") + compiler_version = Version(self.settings.compiler.version) + prefer_boost_container = libcxx and str(libcxx) == "libc++" or \ + (self.settings.compiler == "gcc" and compiler_version < "9") or \ + (self.settings.compiler == "clang" and compiler_version < "12" and libcxx and str(libcxx) == "libstdc++") + self._local_allocator_option = "boost_container" if prefer_boost_container else "memory_resource" + if self._local_allocator_option == "recycling_allocator" and self.options.backend == "unifex": + raise ConanInvalidConfiguration(f"{self.name} 'recycling_allocator' cannot be used in combination with the 'unifex' backend.") + + def requirements(self): + self.requires("grpc/1.50.1") + if self._local_allocator_option == "boost_container" or self.options.backend == "boost": + self.requires("boost/1.81.0") + if self.options.backend == "asio": + self.requires("asio/1.24.0") + if self.options.backend == "unifex": + self.requires("libunifex/cci.20220430") + + def package_id(self): + self.info.clear() + self.info.options.local_allocator = self._local_allocator_option + + 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["ASIO_GRPC_USE_BOOST_CONTAINER"] = self._local_allocator_option == "boost_container" + tc.variables["ASIO_GRPC_USE_RECYCLING_ALLOCATOR"] = self._local_allocator_option == "recycling_allocator" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "asio-grpc*", os.path.join(self.package_folder, "lib", "cmake", "asio-grpc")) + + def package_info(self): + build_modules = [os.path.join("lib", "cmake", "asio-grpc", "AsioGrpcProtobufGenerator.cmake")] + + self.cpp_info.requires = ["grpc::grpc++_unsecure"] + if self.options.backend == "boost": + self.cpp_info.defines = ["AGRPC_BOOST_ASIO"] + self.cpp_info.requires.append("boost::headers") + if self.options.backend == "asio": + self.cpp_info.defines = ["AGRPC_STANDALONE_ASIO"] + self.cpp_info.requires.append("asio::asio") + if self.options.backend == "unifex": + self.cpp_info.defines = ["AGRPC_UNIFEX"] + self.cpp_info.requires.append("libunifex::unifex") + + if self._local_allocator_option == "boost_container": + self.cpp_info.requires.append("boost::container") + + self.cpp_info.set_property("cmake_file_name", "asio-grpc") + self.cpp_info.set_property("cmake_target_name", "asio-grpc::asio-grpc") + self.cpp_info.set_property("cmake_build_modules", build_modules) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.build_modules["cmake_find_package"] = build_modules + self.cpp_info.build_modules["cmake_find_package_multi"] = build_modules diff --git a/recipes/asio-grpc/all/test_package/CMakeLists.txt b/recipes/asio-grpc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3566d527f1ca9 --- /dev/null +++ b/recipes/asio-grpc/all/test_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.14) +project(test_package LANGUAGES CXX) + +find_package(asio-grpc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +# See https://github.com/chriskohlhoff/asio/issues/955 +target_compile_definitions(${PROJECT_NAME} + PRIVATE BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC) + +if(${asio-grpc_VERSION} VERSION_GREATER_EQUAL 2) + target_compile_definitions(${PROJECT_NAME} PRIVATE ASIO_GRPC_V2) +endif() + +if(CMAKE_CROSSCOMPILING) + # Assuming protoc plugins needed by `asio_grpc_protobuf_generate` are not + # available when cross compiling + target_compile_definitions(${PROJECT_NAME} PRIVATE CROSSCOMPILING) +else() + asio_grpc_protobuf_generate( + GENERATE_GRPC + TARGET + ${PROJECT_NAME} + OUT_DIR + "${CMAKE_CURRENT_BINARY_DIR}/generated" + PROTOS + "${CMAKE_CURRENT_LIST_DIR}/test.proto") +endif() diff --git a/recipes/asio-grpc/all/test_package/conanfile.py b/recipes/asio-grpc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/asio-grpc/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/asio-grpc/all/test_package/test.proto b/recipes/asio-grpc/all/test_package/test.proto new file mode 100644 index 0000000000000..2434126edc5aa --- /dev/null +++ b/recipes/asio-grpc/all/test_package/test.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package test; + +service Test { + rpc Unary(TestRequest) returns (TestReply) {} +} + +message TestRequest { string message = 1; } + +message TestReply { string message = 1; } diff --git a/recipes/asio-grpc/all/test_package/test_package.cpp b/recipes/asio-grpc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b784be03686dc --- /dev/null +++ b/recipes/asio-grpc/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +#ifdef ASIO_GRPC_V2 +#include +#else +#include +#endif +#include + +#ifndef CROSSCOMPILING +#include +#include +#endif + +int main() { + agrpc::GrpcContext grpc_context{std::make_unique()}; + + boost::asio::post(grpc_context, [] {}); + +#ifndef CROSSCOMPILING + std::unique_ptr stub; + grpc::ClientContext client_context; + std::unique_ptr> reader; + test::TestRequest request; + test::TestReply response; + grpc::Status status; + + boost::asio::post(grpc_context, [&]() { + stub = test::Test::NewStub(grpc::CreateChannel( + "localhost:50051", grpc::InsecureChannelCredentials())); + request.set_message("hello"); + reader = agrpc::request(&test::Test::Stub::AsyncUnary, *stub, + client_context, request, grpc_context); + agrpc::finish(reader, response, status, + boost::asio::bind_executor(grpc_context, [](bool) {})); + }); +#endif +} diff --git a/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e68b2def0d618 --- /dev/null +++ b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.14) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(asio-grpc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +# See https://github.com/chriskohlhoff/asio/issues/955 +target_compile_definitions(${PROJECT_NAME} + PRIVATE BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC) + +if(${asio-grpc_VERSION} VERSION_GREATER_EQUAL 2) + target_compile_definitions(${PROJECT_NAME} PRIVATE ASIO_GRPC_V2) +endif() + +if(CMAKE_CROSSCOMPILING) + # Assuming protoc plugins needed by `asio_grpc_protobuf_generate` are not + # available when cross compiling + target_compile_definitions(${PROJECT_NAME} PRIVATE CROSSCOMPILING) +else() + asio_grpc_protobuf_generate( + GENERATE_GRPC + TARGET + ${PROJECT_NAME} + OUT_DIR + "${CMAKE_CURRENT_BINARY_DIR}/generated" + PROTOS + "${CMAKE_CURRENT_LIST_DIR}/../test_package/test.proto") +endif() diff --git a/recipes/asio-grpc/all/test_v1_package/conanfile.py b/recipes/asio-grpc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2da76eac8dd35 --- /dev/null +++ b/recipes/asio-grpc/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml new file mode 100644 index 0000000000000..25e51279385fd --- /dev/null +++ b/recipes/asio-grpc/config.yml @@ -0,0 +1,13 @@ +versions: + "2.4.0": + folder: all + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.1.0": + folder: all + "2.0.0": + folder: all + "1.7.0": + folder: all diff --git a/recipes/asio/all/conandata.yml b/recipes/asio/all/conandata.yml new file mode 100644 index 0000000000000..46bc4f8f41b43 --- /dev/null +++ b/recipes/asio/all/conandata.yml @@ -0,0 +1,67 @@ +sources: + "1.28.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-28-0.tar.gz" + sha256: "226438b0798099ad2a202563a83571ce06dd13b570d8fded4840dbc1f97fa328" + "1.27.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-27-0.tar.gz" + sha256: "b31c63867daaba0e460ee2c85dc508a52c81db0a7318e0d2147f444b26f80ed7" + "1.26.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-26-0.tar.gz" + sha256: "935583f86825b7b212479277d03543e0f419a55677fa8cb73a79a927b858a72d" + "1.24.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-24-0.tar.gz" + sha256: "cbcaaba0f66722787b1a7c33afe1befb3a012b5af3ad7da7ff0f6b8c9b7a8a5b" + "1.23.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-23-0.tar.gz" + sha256: "facae7627ce6c716add3f328eee3d78c2e6e133a46ac5ecb80897b37ebacf05e" + "1.22.1": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-22-1.tar.gz" + sha256: "30cb54a5de5e465d10ec0c2026d6b5917f5e89fffabdbabeb1475846fc9a2cf0" + "1.22.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-22-0.tar.gz" + sha256: "17bfd506f6d55c85a33603277a256b42ca5883bf290930040489ffeeed23724a" + "1.21.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-21-0.tar.gz" + sha256: "5d2d2dcb7bfb39bff941cabbfc8c27ee322a495470bf0f3a7c5238648cf5e6a9" + "1.20.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-20-0.tar.gz" + sha256: "34a8f07be6f54e3753874d46ecfa9b7ab7051c4e3f67103c52a33dfddaea48e6" + "1.19.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-19-2.tar.gz" + sha256: "5ee191aee825dfb1325cbacf643d599b186de057c88464ea98f1bae5ba4ff47a" + "1.19.1": + url: "https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-19-1.tar.gz" + sha256: "2555e0a29256de5c77d6a34b14faefd28c76555e094ba0371acb0b91d483520e" + "1.19.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-19-0.tar.gz" + sha256: "11bc0e22fcdfb3f0b77574ac33760a3592c0dac7e7eece7668b823c158243629" + "1.18.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-18-2.tar.gz" + sha256: "8d67133b89e0f8b212e9f82fdcf1c7b21a978d453811e2cd941c680e72c2ca32" + "1.18.1": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-18-1.tar.gz" + sha256: "39c721b987b7a0d2fe2aee64310bd128cd8cc10f43481604d18cb2d8b342fd40" + "1.18.0": + sha256: 820688d1e0387ff55194ae20036cbae0fb3c7d11b7c3f46492369723c01df96f + url: https://github.com/chriskohlhoff/asio/archive/asio-1-18-0.tar.gz + "1.17.0": + sha256: 46406a830f8334b3789e7352ed7309a39c7c30b685b0499d289eda4fd4ae2067 + url: https://github.com/chriskohlhoff/asio/archive/asio-1-17-0.tar.gz + "1.16.1": + sha256: e40bbd531530f08318b7c7d7e84e457176d8eae6f5ad2e3714dc27b9131ecd35 + url: https://github.com/chriskohlhoff/asio/archive/asio-1-16-1.tar.gz + "1.16.0": + sha256: c87410ea62de6245aa239b9ed2057edf01d7f66acc3f5e50add9a29343c87512 + url: https://github.com/chriskohlhoff/asio/archive/asio-1-16-0.tar.gz + "1.14.1": + sha256: 5b12ce2cdb658025e67785f954f74b052709cfc9b5941b8fb889c049b0955e1d + url: https://github.com/chriskohlhoff/asio/archive/asio-1-14-1.tar.gz + "1.14.0": + sha256: bdb01a649c24d73ca4a836662e7af442d935313ed6deef6b07f17f3bc5f78d7a + url: https://github.com/chriskohlhoff/asio/archive/asio-1-14-0.tar.gz + "1.13.0": + sha256: 54a1208d20f2104dbd6b7a04a9262f5ab649f4b7a9faf7eac4c2294e9e104c06 + url: https://github.com/chriskohlhoff/asio/archive/asio-1-13-0.tar.gz + "1.12.2": + sha256: 1de23266b956674e766cd0b6c929a11259f2284ea8e96b765cc8c67b1689e0fd + url: https://github.com/chriskohlhoff/asio/archive/asio-1-12-2.tar.gz diff --git a/recipes/asio/all/conanfile.py b/recipes/asio/all/conanfile.py new file mode 100644 index 0000000000000..b96eb6fa96e4a --- /dev/null +++ b/recipes/asio/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class Asio(ConanFile): + name = "asio" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://think-async.com/Asio" + description = "Asio is a cross-platform C++ library for network and low-level I/O" + topics = ("asio", "network", "io", "low-level") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + root_dir = os.path.join(self.source_folder, "asio") + include_dir = os.path.join(root_dir, "include") + copy(self, "LICENSE_1_0.txt", src=root_dir, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=include_dir, dst=os.path.join(self.package_folder, "include")) + copy(self, "*.ipp", src=include_dir, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "asio") + self.cpp_info.defines.append("ASIO_STANDALONE") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/asio/all/test_package/CMakeLists.txt b/recipes/asio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c41c5729ae0a5 --- /dev/null +++ b/recipes/asio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(asio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asio::asio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/asio/all/test_package/conanfile.py b/recipes/asio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/asio/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/asio/all/test_package/test_package.cpp b/recipes/asio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fb757317ed0a3 --- /dev/null +++ b/recipes/asio/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + auto && service = asio::io_service{}; + (void)service; +} diff --git a/recipes/asio/all/test_v1_package/CMakeLists.txt b/recipes/asio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0308114c0432b --- /dev/null +++ b/recipes/asio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(asio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asio::asio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/asio/all/test_v1_package/conanfile.py b/recipes/asio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/asio/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/asio/config.yml b/recipes/asio/config.yml new file mode 100644 index 0000000000000..06fbadd587b1a --- /dev/null +++ b/recipes/asio/config.yml @@ -0,0 +1,45 @@ +versions: + "1.28.0": + folder: all + "1.27.0": + folder: all + "1.26.0": + folder: all + "1.24.0": + folder: all + "1.23.0": + folder: all + "1.22.1": + folder: all + "1.22.0": + folder: all + "1.21.0": + folder: all + "1.20.0": + folder: all + "1.19.2": + folder: all + "1.19.1": + folder: all + "1.19.0": + folder: all + "1.18.2": + folder: all + "1.18.1": + folder: all + "1.18.0": + folder: all + "1.17.0": + folder: all + "1.16.1": + folder: all + "1.16.0": + folder: all + "1.14.1": + folder: all + "1.14.0": + folder: all + "1.13.0": + folder: all + "1.12.2": + folder: all diff --git a/recipes/asmjit/all/conandata.yml b/recipes/asmjit/all/conandata.yml new file mode 100644 index 0000000000000..c714f763c3707 --- /dev/null +++ b/recipes/asmjit/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "cci.20230325": + url: "https://github.com/asmjit/asmjit/archive/51b10b19b6631434d3f9ad536a6fb140944a36d2.zip" + sha256: "4f62b1b6247864417fb50a2928d541ccf8e9273b0c3ce36ccd443c9d6ca7bc9a" + "cci.20221111": + url: "https://github.com/asmjit/asmjit/archive/0c03ed2f7497441ac0de232bda2e6b8cc041b2dc.zip" + sha256: "85d8f3edabd708658b63d8a9bc2e7ccb72edd1d14b668fa681b5f7fa529601a4" + "cci.20220210": + url: "https://github.com/asmjit/asmjit/archive/23ddf56b00f47d8aa0c82ad225e4b3a92661da7e.zip" + sha256: "8832003526dbb9329b308246ffe34ebda9dcbe9b5116d7c3fbbe7ab15e5fd7b3" + "cci.20210306": + url: "https://github.com/asmjit/asmjit/archive/8b35b4cffb62ecb58a903bf91cb7537d7a672211.zip" + sha256: "3404db651051d48f31d0638c75346284929114e7038ac89353345db595f9e154" diff --git a/recipes/asmjit/all/conanfile.py b/recipes/asmjit/all/conanfile.py new file mode 100644 index 0000000000000..ad8cb46dcf24d --- /dev/null +++ b/recipes/asmjit/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +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" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + 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["ASMJIT_EMBED"] = False + tc.variables["ASMJIT_STATIC"] = not self.options.shared + if self.version == "cci.20210306": + tc.variables["ASMJIT_BUILD_X86"] = self.settings.arch in ["x86", "x86_64"] + tc.variables["ASMJIT_TEST"] = False + tc.variables["ASMJIT_NO_NATVIS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "asmjit") + self.cpp_info.set_property("cmake_target_name", "asmjit::asmjit") + + self.cpp_info.names["cmake_find_package"] = "asmjit" + self.cpp_info.names["cmake_find_package_multi"] = "asmjit" + + self.cpp_info.libs = ["asmjit"] + if not self.options.shared: + self.cpp_info.defines = ["ASMJIT_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "rt", "m"] diff --git a/recipes/asmjit/all/test_package/CMakeLists.txt b/recipes/asmjit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..39640d23a5929 --- /dev/null +++ b/recipes/asmjit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(asmjit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asmjit::asmjit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/asmjit/all/test_package/conanfile.py b/recipes/asmjit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/asmjit/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/asmjit/all/test_package/test_package.cpp b/recipes/asmjit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4b85962e0942d --- /dev/null +++ b/recipes/asmjit/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include + +typedef int (*Func)(void); + +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); + + return 0; +} diff --git a/recipes/asmjit/all/test_v1_package/CMakeLists.txt b/recipes/asmjit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/asmjit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/asmjit/all/test_v1_package/conanfile.py b/recipes/asmjit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/asmjit/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/asmjit/config.yml b/recipes/asmjit/config.yml new file mode 100644 index 0000000000000..ea0049ba18227 --- /dev/null +++ b/recipes/asmjit/config.yml @@ -0,0 +1,9 @@ +versions: + "cci.20230325": + folder: all + "cci.20221111": + folder: all + "cci.20220210": + folder: all + "cci.20210306": + folder: all diff --git a/recipes/asn1c/all/conandata.yml b/recipes/asn1c/all/conandata.yml new file mode 100644 index 0000000000000..03e3e0e44b689 --- /dev/null +++ b/recipes/asn1c/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.28": + url: "https://github.com/vlm/asn1c/releases/download/v0.9.28/asn1c-0.9.28.tar.gz" + sha256: "8007440b647ef2dd9fb73d931c33ac11764e6afb2437dbe638bb4e5fc82386b9" diff --git a/recipes/asn1c/all/conanfile.py b/recipes/asn1c/all/conanfile.py new file mode 100644 index 0000000000000..83429575a7f31 --- /dev/null +++ b/recipes/asn1c/all/conanfile.py @@ -0,0 +1,82 @@ +from conans import AutoToolsBuildEnvironment, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, rmdir, chdir +import os + +required_conan_version = ">=1.47.0" + + +class Asn1cConan(ConanFile): + name = "asn1c" + description = "The ASN.1 Compiler" + license = "BSD-2-Clause" + topics = ("asn.1", "compiler") + homepage = "https://lionet.info/asn1c" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def build_requirements(self): + self.tool_requires("bison/3.7.6") + self.tool_requires("flex/2.6.4") + self.tool_requires("libtool/2.4.7") + + def validate(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("Visual Studio is not supported") + + 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) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + conf_args = [ + "--datarootdir={}".format(tools.unix_path(self._datarootdir)), + ] + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + with chdir(self, self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + autotools = self._configure_autotools() + autotools.install() + rmdir(self, os.path.join(self.package_folder, "res", "doc")) + rmdir(self, os.path.join(self.package_folder, "res", "man")) + + def package_info(self): + 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) + + # asn1c cannot use environment variables to specify support files path + # so `SUPPORT_PATH` should be propagated to command line invocation to `-S` argument + self.env_info.SUPPORT_PATH = os.path.join(self.package_folder, "res/asn1c") + + self.cpp_info.includedirs = [] diff --git a/recipes/asn1c/all/test_package/CMakeLists.txt b/recipes/asn1c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..72f86ddd2bed5 --- /dev/null +++ b/recipes/asn1c/all/test_package/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(STANDARD_ASN1_FILES + BIT_STRING.c + INTEGER.c + NativeEnumerated.c + NativeInteger.c + OBJECT_IDENTIFIER.c + OCTET_STRING.c + asn_SEQUENCE_OF.c + asn_SET_OF.c + asn_codecs_prim.c + ber_decoder.c + ber_tlv_length.c + ber_tlv_tag.c + constr_SEQUENCE.c + constr_SEQUENCE_OF.c + constr_SET_OF.c + constr_TYPE.c + constraints.c + der_encoder.c + per_decoder.c + per_encoder.c + per_opentype.c + per_support.c + xer_decoder.c + xer_encoder.c + xer_support.c +) + +set(GENERATED_FILES + MyTypes.c + MyInt.c +) + +add_custom_command( + OUTPUT ${GENERATED_FILES} ${STANDARD_ASN1_FILES} + COMMAND asn1c -S ${SUPPORT_PATH} MyModule.asn1 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS MyModule.asn1 +) + +add_executable(${PROJECT_NAME} test_package.c ${GENERATED_FILES} ${STANDARD_ASN1_FILES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/recipes/asn1c/all/test_package/MyModule.asn1 b/recipes/asn1c/all/test_package/MyModule.asn1 new file mode 100644 index 0000000000000..3b9e5e66ecddb --- /dev/null +++ b/recipes/asn1c/all/test_package/MyModule.asn1 @@ -0,0 +1,15 @@ +MyModule DEFINITIONS ::= +BEGIN + +MyTypes ::= SEQUENCE { + myObjectId OBJECT IDENTIFIER, + mySeqOf SEQUENCE OF MyInt, + myBitString BIT STRING { + muxToken(0), + modemToken(1) + } +} + +MyInt ::= INTEGER (0..65535) + +END diff --git a/recipes/asn1c/all/test_package/conanfile.py b/recipes/asn1c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..534923606ca41 --- /dev/null +++ b/recipes/asn1c/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import CMake +from conan import ConanFile +from conan.tools.files import copy +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + generators = "cmake" + + def build_requirements(self): + self.tool_requires(str(self.requires["asn1c"])) + + def build(self): + if not cross_building(self): + copy(self, "MyModule.asn1", src=self.source_folder, dst=self.build_folder) + cmake = CMake(self) + cmake.definitions["SUPPORT_PATH"] = self.deps_env_info["asn1c"].SUPPORT_PATH + 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/asn1c/all/test_package/test_package.c b/recipes/asn1c/all/test_package/test_package.c new file mode 100644 index 0000000000000..d85fa83f55cd1 --- /dev/null +++ b/recipes/asn1c/all/test_package/test_package.c @@ -0,0 +1,73 @@ +#include /* for stdout */ +#include /* for malloc() */ +#include /* for run-time control */ +#include "MyTypes.h" /* Include MyTypes definition */ + +int main() { + /* Define an OBJECT IDENTIFIER value */ + int oid[] = { 1, 3, 6, 1, 4, 1, 9363, 1, 5, 0 }; /* or whatever */ + + /* Declare a pointer to a new instance of MyTypes type */ + MyTypes_t *myType; + /* Declare a pointer to a MyInt type */ + MyInt_t *myInt; + + /* Temporary return value */ + int ret; + + /* Allocate an instance of MyTypes */ + myType = calloc(1, sizeof *myType); + assert(myType); /* Assume infinite memory */ + + /* + * Fill in myObjectId + */ + ret = OBJECT_IDENTIFIER_set_arcs(&myType->myObjectId, + oid, sizeof(oid[0]), sizeof(oid) / sizeof(oid[0])); + assert(ret == 0); + + /* + * Fill in mySeqOf with a couple of integers. + */ + + /* Prepare a certain INTEGER */ + myInt = calloc(1, sizeof *myInt); + assert(myInt); + *myInt = 123; /* Set integer value */ + + /* Fill in mySeqOf with the prepared INTEGER */ + ret = ASN_SEQUENCE_ADD(&myType->mySeqOf, myInt); + assert(ret == 0); + + /* Prepare another integer */ + myInt = calloc(1, sizeof *myInt); + assert(myInt); + *myInt = 111222333; /* Set integer value */ + + /* Append another INTEGER into mySeqOf */ + ret = ASN_SEQUENCE_ADD(&myType->mySeqOf, myInt); + assert(ret == 0); + + /* + * Fill in myBitString + */ + + /* Allocate some space for bitmask */ + myType->myBitString.buf = calloc(1, 1); + assert(myType->myBitString.buf); + myType->myBitString.size = 1; /* 1 byte */ + + /* Set the value of muxToken */ + myType->myBitString.buf[0] |= 1 << (7 - myBitString_muxToken); + + /* Also set the value of modemToken */ + myType->myBitString.buf[0] |= 1 << (7 - myBitString_modemToken); + + /* Trim unused bits (optional) */ + myType->myBitString.bits_unused = 6; + + /* + * Print the resulting structure as XER (XML) + */ + return xer_fprint(stdout, &asn_DEF_MyTypes, myType); +} diff --git a/recipes/asn1c/config.yml b/recipes/asn1c/config.yml new file mode 100644 index 0000000000000..0008d426a65e5 --- /dev/null +++ b/recipes/asn1c/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.28": + folder: all diff --git a/recipes/assimp/5.x/conandata.yml b/recipes/assimp/5.x/conandata.yml new file mode 100644 index 0000000000000..c99892ad1d8a8 --- /dev/null +++ b/recipes/assimp/5.x/conandata.yml @@ -0,0 +1,31 @@ +sources: + "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" + "5.1.0": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.1.0.tar.gz" + sha256: "b96f609bca45cc4747bf8ea4b696816ada484aed2812e60ea4d16aae18360b0b" + "5.0.1": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.0.1.tar.gz" + sha256: "11310ec1f2ad2cd46b95ba88faca8f7aaa1efe9aa12605c55e3de2b977b3dbfc" + "5.0.0": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.0.0.tar.gz" + sha256: "b0110a91650d6bb4000e3d5c2185bf77b0ff0a2e7a284bc2c4af81b33988b63c" +patches: + "5.2.2": + - patch_file: "patches/0005-fix-unzip.patch" + - patch_file: "patches/0006-unvendor-deps-5.2.x.patch" + "5.1.6": + - patch_file: "patches/0004-unvendor-deps-5.1.6.patch" + - patch_file: "patches/0005-fix-unzip.patch" + "5.1.0": + - patch_file: "patches/0003-unvendor-deps-5.1.x.patch" + "5.0.1": + - patch_file: "patches/0001-unvendor-deps-5.0.x.patch" + - patch_file: "patches/0002-fix-all-exporters-disabled.patch" + "5.0.0": + - patch_file: "patches/0001-unvendor-deps-5.0.x.patch" + - patch_file: "patches/0002-fix-all-exporters-disabled.patch" diff --git a/recipes/assimp/5.x/conanfile.py b/recipes/assimp/5.x/conanfile.py new file mode 100644 index 0000000000000..6f021e008adb4 --- /dev/null +++ b/recipes/assimp/5.x/conanfile.py @@ -0,0 +1,283 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class AssimpConan(ConanFile): + name = "assimp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/assimp/assimp" + description = ( + "A library to import and export various 3d-model-formats including " + "scene-post-processing to generate missing render data." + ) + topics = ("assimp", "3d", "game development", "3mf", "collada") + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "double_precision": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "double_precision": False, + } + + _format_option_map = { + "with_3d": ("ASSIMP_BUILD_3D_IMPORTER", "5.0.0"), + "with_3ds": ("ASSIMP_BUILD_3DS_IMPORTER", "5.0.0"), + "with_3ds_exporter": ("ASSIMP_BUILD_3DS_EXPORTER", "5.0.0"), + "with_3mf": ("ASSIMP_BUILD_3MF_IMPORTER", "5.0.0"), + "with_3mf_exporter": ("ASSIMP_BUILD_3MF_EXPORTER", "5.0.0"), + "with_ac": ("ASSIMP_BUILD_AC_IMPORTER", "5.0.0"), + "with_amf": ("ASSIMP_BUILD_AMF_IMPORTER", "5.0.0"), + "with_ase": ("ASSIMP_BUILD_ASE_IMPORTER", "5.0.0"), + "with_assbin": ("ASSIMP_BUILD_ASSBIN_IMPORTER", "5.0.0"), + "with_assbin_exporter": ("ASSIMP_BUILD_ASSBIN_EXPORTER", "5.0.0"), + "with_assxml_exporter": ("ASSIMP_BUILD_ASSXML_EXPORTER", "5.0.0"), + "with_assjson_exporter": ("ASSIMP_BUILD_ASSJSON_EXPORTER", "5.0.0"), + "with_b3d": ("ASSIMP_BUILD_B3D_IMPORTER", "5.0.0"), + "with_blend": ("ASSIMP_BUILD_BLEND_IMPORTER", "5.0.0"), + "with_bvh": ("ASSIMP_BUILD_BVH_IMPORTER", "5.0.0"), + "with_ms3d": ("ASSIMP_BUILD_MS3D_IMPORTER", "5.0.0"), + "with_cob": ("ASSIMP_BUILD_COB_IMPORTER", "5.0.0"), + "with_collada": ("ASSIMP_BUILD_COLLADA_IMPORTER", "5.0.0"), + "with_collada_exporter": ("ASSIMP_BUILD_COLLADA_EXPORTER", "5.0.0"), + "with_csm": ("ASSIMP_BUILD_CSM_IMPORTER", "5.0.0"), + "with_dxf": ("ASSIMP_BUILD_DXF_IMPORTER", "5.0.0"), + "with_fbx": ("ASSIMP_BUILD_FBX_IMPORTER", "5.0.0"), + "with_fbx_exporter": ("ASSIMP_BUILD_FBX_EXPORTER", "5.0.0"), + "with_gltf": ("ASSIMP_BUILD_GLTF_IMPORTER", "5.0.0"), + "with_gltf_exporter": ("ASSIMP_BUILD_GLTF_EXPORTER", "5.0.0"), + "with_hmp": ("ASSIMP_BUILD_HMP_IMPORTER", "5.0.0"), + "with_ifc": ("ASSIMP_BUILD_IFC_IMPORTER", "5.0.0"), + "with_irr": ("ASSIMP_BUILD_IRR_IMPORTER", "5.0.0"), + "with_irrmesh": ("ASSIMP_BUILD_IRRMESH_IMPORTER", "5.0.0"), + "with_lwo": ("ASSIMP_BUILD_LWO_IMPORTER", "5.0.0"), + "with_lws": ("ASSIMP_BUILD_LWS_IMPORTER", "5.0.0"), + "with_md2": ("ASSIMP_BUILD_MD2_IMPORTER", "5.0.0"), + "with_md3": ("ASSIMP_BUILD_MD3_IMPORTER", "5.0.0"), + "with_md5": ("ASSIMP_BUILD_MD5_IMPORTER", "5.0.0"), + "with_mdc": ("ASSIMP_BUILD_MDC_IMPORTER", "5.0.0"), + "with_mdl": ("ASSIMP_BUILD_MDL_IMPORTER", "5.0.0"), + "with_mmd": ("ASSIMP_BUILD_MMD_IMPORTER", "5.0.0"), + "with_ndo": ("ASSIMP_BUILD_NDO_IMPORTER", "5.0.0"), + "with_nff": ("ASSIMP_BUILD_NFF_IMPORTER", "5.0.0"), + "with_obj": ("ASSIMP_BUILD_OBJ_IMPORTER", "5.0.0"), + "with_obj_exporter": ("ASSIMP_BUILD_OBJ_EXPORTER", "5.0.0"), + "with_off": ("ASSIMP_BUILD_OFF_IMPORTER", "5.0.0"), + "with_ogre": ("ASSIMP_BUILD_OGRE_IMPORTER", "5.0.0"), + "with_opengex": ("ASSIMP_BUILD_OPENGEX_IMPORTER", "5.0.0"), + "with_opengex_exporter": ("ASSIMP_BUILD_OPENGEX_EXPORTER", "5.0.0"), + "with_pbrt_exporter": ("ASSIMP_BUILD_PBRT_EXPORTER", "5.1.0"), + "with_ply": ("ASSIMP_BUILD_PLY_IMPORTER", "5.0.0"), + "with_ply_exporter": ("ASSIMP_BUILD_PLY_EXPORTER", "5.0.0"), + "with_q3bsp": ("ASSIMP_BUILD_Q3BSP_IMPORTER", "5.0.0"), + "with_q3d": ("ASSIMP_BUILD_Q3D_IMPORTER", "5.0.0"), + "with_raw": ("ASSIMP_BUILD_RAW_IMPORTER", "5.0.0"), + "with_sib": ("ASSIMP_BUILD_SIB_IMPORTER", "5.0.0"), + "with_smd": ("ASSIMP_BUILD_SMD_IMPORTER", "5.0.0"), + "with_step": ("ASSIMP_BUILD_STEP_IMPORTER", "5.0.0"), + "with_step_exporter": ("ASSIMP_BUILD_STEP_EXPORTER", "5.0.0"), + "with_stl": ("ASSIMP_BUILD_STL_IMPORTER", "5.0.0"), + "with_stl_exporter": ("ASSIMP_BUILD_STL_EXPORTER", "5.0.0"), + "with_terragen": ("ASSIMP_BUILD_TERRAGEN_IMPORTER", "5.0.0"), + "with_x": ("ASSIMP_BUILD_X_IMPORTER", "5.0.0"), + "with_x_exporter": ("ASSIMP_BUILD_X_EXPORTER", "5.0.0"), + "with_x3d": ("ASSIMP_BUILD_X3D_IMPORTER", "5.0.0"), + "with_x3d_exporter": ("ASSIMP_BUILD_X3D_EXPORTER", "5.0.0"), + "with_xgl": ("ASSIMP_BUILD_XGL_IMPORTER", "5.0.0"), + "with_m3d": ("ASSIMP_BUILD_M3D_IMPORTER", "5.1.0"), + "with_m3d_exporter": ("ASSIMP_BUILD_M3D_EXPORTER", "5.1.0"), + "with_iqm": ("ASSIMP_BUILD_IQM_IMPORTER", "5.2.0"), + } + options.update(dict.fromkeys(_format_option_map, [True, False])) + default_options.update(dict.fromkeys(_format_option_map, True)) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + for option, (_, min_version) in self._format_option_map.items(): + if Version(self.version) < Version(min_version): + delattr(self.options, option) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + @property + def _depends_on_kuba_zip(self): + return self.options.with_3mf_exporter + + @property + def _depends_on_poly2tri(self): + return self.options.with_blend or self.options.with_ifc + + @property + def _depends_on_rapidjson(self): + return self.options.with_gltf or self.options.with_gltf_exporter + + @property + def _depends_on_draco(self): + if Version(self.version) < "5.1.0": + return False + return self.options.with_gltf or self.options.with_gltf_exporter + + @property + def _depends_on_clipper(self): + return self.options.with_ifc + + @property + def _depends_on_stb(self): + if Version(self.version) < "5.1.0": + return False + return self.options.with_m3d or self.options.with_m3d_exporter or \ + self.options.with_pbrt_exporter + + @property + def _depends_on_zlib(self): + return self.options.with_assbin or self.options.with_assbin_exporter or \ + self.options.with_assxml_exporter or self.options.with_blend or self.options.with_fbx or \ + self.options.with_q3bsp or self.options.with_x or self.options.with_xgl + + @property + def _depends_on_openddlparser(self): + if Version(self.version) < "5.1.0": + return False + return self.options.with_opengex + + def requirements(self): + # TODO: unvendor others libs: + # - Open3DGC + self.requires("minizip/1.2.13") + self.requires("utfcpp/3.2.3") + if Version(self.version) < "5.1.0": + self.requires("irrxml/1.2") + else: + self.requires("pugixml/1.13") + if self._depends_on_kuba_zip: + self.requires("kuba-zip/0.2.6") + if self._depends_on_poly2tri: + self.requires("poly2tri/cci.20130502") + if self._depends_on_rapidjson: + self.requires("rapidjson/cci.20220822") + if self._depends_on_zlib: + self.requires("zlib/1.2.13") + if self._depends_on_draco: + self.requires("draco/1.5.5") + if self._depends_on_clipper: + self.requires("clipper/4.10.0") # Only 4.x supported + if self._depends_on_stb: + self.requires("stb/cci.20220909") + if self._depends_on_openddlparser: + self.requires("openddl-parser/0.5.0") + + def validate(self): + if self._depends_on_clipper and Version(self.dependencies["clipper"].ref.version).major != "4": + raise ConanInvalidConfiguration("Only 'clipper/4.x' is supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) >= "5.1.0": + tc.variables["ASSIMP_HUNTER_ENABLED"] = False + tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True + tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False + else: + tc.variables["HUNTER_ENABLED"] = False + tc.variables["IGNORE_GIT_HASH"] = True + tc.variables["SYSTEM_IRRXML"] = True + 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_SAMPLES"] = False + tc.variables["ASSIMP_BUILD_TESTS"] = False + tc.variables["ASSIMP_DOUBLE_PRECISION"] = self.options.double_precision + tc.variables["ASSIMP_INSTALL_PDB"] = False + tc.variables["ASSIMP_NO_EXPORT"] = False + tc.variables["ASSIMP_BUILD_MINIZIP"] = False + 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 + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Don't force several compiler and linker flags + replace_mapping = [ + ("-fPIC", ""), + ("-g ", ""), + ("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")', ""), + ("/WX", "") + ] + + for before, after in replace_mapping: + replace_in_file(self, os.path.join( + self.source_folder, "CMakeLists.txt"), before, after, strict=False) + # Take care to not use these vendored libs + vendors = ["poly2tri", "rapidjson", "utf8cpp", "zip", "unzip", "stb", "zlib", "clipper"] + if Version(self.version) < "5.1.0": + vendors.append("irrXML") + else: + vendors.extend(["pugixml", "draco", "openddlparser"]) + for vendor in vendors: + rmdir(self, os.path.join(self.source_folder, "contrib", vendor)) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "assimp") + self.cpp_info.set_property("cmake_target_name", "assimp::assimp") + self.cpp_info.set_property("pkg_config_name", "assimp") + self.cpp_info.libs = collect_libs(self) + if is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("ASSIMP_DLL") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["rt", "m", "pthread"] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch b/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch new file mode 100644 index 0000000000000..1445d96a11b7c --- /dev/null +++ b/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch @@ -0,0 +1,278 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -437,7 +437,12 @@ IF(HUNTER_ENABLED) + set(ASSIMP_BUILD_MINIZIP TRUE) + ELSE(HUNTER_ENABLED) + IF ( NOT ASSIMP_BUILD_ZLIB ) +- FIND_PACKAGE(ZLIB) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ find_package(ZLIB REQUIRED) ++ endif() ++ set(ZLIB_FOUND TRUE) + ENDIF( NOT ASSIMP_BUILD_ZLIB ) + + IF( NOT ZLIB_FOUND ) +@@ -470,14 +475,14 @@ ENDIF(HUNTER_ENABLED) + + IF( NOT IOS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF( NOT ASSIMP_BUILD_MINIZIP ) + ELSE ( NOT IOS ) +- IF( NOT BUILD_SHARED_LIBS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF( NOT ASSIMP_BUILD_MINIZIP ) +- ENDIF ( NOT BUILD_SHARED_LIBS ) + ENDIF ( NOT IOS ) + + IF ( ASSIMP_NO_EXPORT ) +--- a/code/3MF/D3MFExporter.cpp ++++ b/code/3MF/D3MFExporter.cpp +@@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + namespace Assimp { +--- a/code/Blender/BlenderTessellator.h ++++ b/code/Blender/BlenderTessellator.h +@@ -147,7 +147,7 @@ namespace Assimp + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" ++# include + #endif + + namespace Assimp +--- a/code/CMakeLists.txt ++++ b/code/CMakeLists.txt +@@ -866,6 +866,7 @@ IF(HUNTER_ENABLED) + hunter_add_package(irrXML) + find_package(irrXML CONFIG REQUIRED) + ELSE(HUNTER_ENABLED) ++ find_package(irrxml REQUIRED CONFIG) + # irrXML already included in contrib directory by parent CMakeLists.txt. + ENDIF(HUNTER_ENABLED) + +@@ -874,6 +875,7 @@ IF(HUNTER_ENABLED) + hunter_add_package(utf8) + find_package(utf8 CONFIG REQUIRED) + ELSE(HUNTER_ENABLED) ++ find_package(utf8cpp REQUIRED CONFIG) + # utf8 is header-only, so Assimp doesn't need to do anything. + ENDIF(HUNTER_ENABLED) + +@@ -882,6 +884,9 @@ IF(HUNTER_ENABLED) + hunter_add_package(polyclipping) + find_package(polyclipping CONFIG REQUIRED) + ELSE(HUNTER_ENABLED) ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(clipper REQUIRED CONFIG) ++ endif() + SET( Clipper_SRCS + ../contrib/clipper/clipper.hpp + ../contrib/clipper/clipper.cpp +@@ -894,6 +899,9 @@ IF(HUNTER_ENABLED) + hunter_add_package(poly2tri) + find_package(poly2tri CONFIG REQUIRED) + ELSE(HUNTER_ENABLED) ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(poly2tri REQUIRED CONFIG) ++ endif() + SET( Poly2Tri_SRCS + ../contrib/poly2tri/poly2tri/common/shapes.cc + ../contrib/poly2tri/poly2tri/common/shapes.h +@@ -930,6 +938,9 @@ IF(HUNTER_ENABLED) + hunter_add_package(zip) + find_package(zip CONFIG REQUIRED) + ELSE(HUNTER_ENABLED) ++ if(ASSIMP_BUILD_3MF_EXPORTER) ++ find_package(zip REQUIRED CONFIG) ++ endif() + SET( ziplib_SRCS + ../contrib/zip/src/miniz.h + ../contrib/zip/src/zip.c +@@ -1025,8 +1036,9 @@ IF(HUNTER_ENABLED) + hunter_add_package(RapidJSON) + find_package(RapidJSON CONFIG REQUIRED) + ELSE(HUNTER_ENABLED) +- INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) +- INCLUDE_DIRECTORIES( "../contrib" ) ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(RapidJSON REQUIRED CONFIG) ++ endif() + ENDIF(HUNTER_ENABLED) + + # VC2010 fixes +@@ -1076,13 +1088,8 @@ SET( assimp_src + ${ASSIMP_EXPORTER_SRCS} + + # Third-party libraries +- ${IrrXML_SRCS} +- ${unzip_compile_SRCS} +- ${Poly2Tri_SRCS} +- ${Clipper_SRCS} + ${openddl_parser_SRCS} + ${open3dgc_SRCS} +- ${ziplib_SRCS} + # Necessary to show the headers in the project when using the VC++ generator: + + ${PUBLIC_HEADERS} +@@ -1094,6 +1101,7 @@ IF(NOT HUNTER_ENABLED) + INCLUDE_DIRECTORIES( + ${IRRXML_INCLUDE_DIR} + ../contrib/openddlparser/include ++ ../contrib # for Open3DGC + ) + ENDIF(NOT HUNTER_ENABLED) + +@@ -1125,7 +1133,24 @@ IF(HUNTER_ENABLED) + zip::zip + ) + ELSE(HUNTER_ENABLED) +- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} ) ++ target_link_libraries(assimp irrxml::irrxml utf8cpp) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ target_link_libraries(assimp ZLIB::ZLIB) ++ endif() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp clipper::clipper) ++ endif() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp poly2tri::poly2tri) ++ endif() ++ if(ASSIMP_BUILD_3MF_EXPORTER) ++ target_link_libraries(assimp zip::zip) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp rapidjson) ++ endif() + ENDIF(HUNTER_ENABLED) + + if(ASSIMP_ANDROID_JNIIOSYSTEM) +@@ -1210,8 +1235,7 @@ ENDIF(APPLE) + # assimp can #include "unzip.h" + IF(NOT HUNTER_ENABLED) + if (UNZIP_FOUND) +- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) ++ target_link_libraries(assimp minizip::minizip) + else (UNZIP_FOUND) + INCLUDE_DIRECTORIES("../") + endif (UNZIP_FOUND) +--- a/code/Common/BaseImporter.cpp ++++ b/code/Common/BaseImporter.cpp +@@ -344,7 +344,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) { + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + + // ------------------------------------------------------------------------------------------------ +--- a/code/Common/ZipArchiveIOSystem.cpp ++++ b/code/Common/ZipArchiveIOSystem.cpp +@@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + namespace Assimp { +--- a/code/Importer/IFC/IFCGeometry.cpp ++++ b/code/Importer/IFC/IFCGeometry.cpp +@@ -53,8 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/Importer/IFC/IFCLoader.cpp ++++ b/code/Importer/IFC/IFCLoader.cpp +@@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # ifdef ASSIMP_USE_HUNTER + # include + # else +-# include ++# include + # endif + #endif + +--- a/code/Importer/IFC/IFCOpenings.cpp ++++ b/code/Importer/IFC/IFCOpenings.cpp +@@ -53,8 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/Importer/STEPParser/STEPFileEncoding.cpp ++++ b/code/Importer/STEPParser/STEPFileEncoding.cpp +@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + #include +--- a/code/MMD/MMDPmxParser.cpp ++++ b/code/MMD/MMDPmxParser.cpp +@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + #include + +--- a/code/SIB/SIBImporter.cpp ++++ b/code/SIB/SIBImporter.cpp +@@ -63,7 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # include + #else + //# include "../contrib/ConvertUTF/ConvertUTF.h" +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + #include + #include +--- a/code/X3D/FIReader.cpp ++++ b/code/X3D/FIReader.cpp +@@ -63,7 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + #include + #include diff --git a/recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch b/recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch new file mode 100644 index 0000000000000..2e71d7e86ff86 --- /dev/null +++ b/recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch @@ -0,0 +1,253 @@ +patch from https://github.com/assimp/assimp/pull/2759 + +--- a/code/Common/Exporter.cpp ++++ b/code/Common/Exporter.cpp +@@ -105,90 +105,88 @@ void ExportScene3MF( const char*, IOSystem*, const aiScene*, const ExportPropert + void ExportAssimp2Json(const char* , IOSystem*, const aiScene* , const Assimp::ExportProperties*); + + // ------------------------------------------------------------------------------------------------ +-// global array of all export formats which Assimp supports in its current build +-Exporter::ExportFormatEntry gExporters[] = ++static void setupExporterArray(std::vector &exporters) + { + #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER +- Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada ), ++ exporters.push_back(Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada )); + #endif + + #ifndef ASSIMP_BUILD_NO_X_EXPORTER +- Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile, +- aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs ), ++ exporters.push_back(Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile, ++ aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs )); + #endif + + #ifndef ASSIMP_BUILD_NO_STEP_EXPORTER +- Exporter::ExportFormatEntry( "stp", "Step Files", "stp", &ExportSceneStep, 0 ), ++ exporters.push_back(Exporter::ExportFormatEntry( "stp", "Step Files", "stp", &ExportSceneStep, 0 )); + #endif + + #ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER +- Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj, +- aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ), +- Exporter::ExportFormatEntry( "objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl, +- aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ), ++ exporters.push_back(Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj, ++ aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ )); ++ exporters.push_back(Exporter::ExportFormatEntry( "objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl, ++ aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ )); + #endif + + #ifndef ASSIMP_BUILD_NO_STL_EXPORTER +- Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL, ++ exporters.push_back(Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL, + aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices +- ), +- Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary, ++ )); ++ exporters.push_back(Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary, + aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices +- ), ++ )); + #endif + + #ifndef ASSIMP_BUILD_NO_PLY_EXPORTER +- Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly, ++ exporters.push_back(Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly, + aiProcess_PreTransformVertices +- ), +- Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary, ++ )); ++ exporters.push_back(Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary, + aiProcess_PreTransformVertices +- ), ++ )); + #endif + + #ifndef ASSIMP_BUILD_NO_3DS_EXPORTER +- Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS, +- aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices ), ++ exporters.push_back(Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS, ++ aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices )); + #endif + + #ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER +- Exporter::ExportFormatEntry( "gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, +- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), +- Exporter::ExportFormatEntry( "glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, +- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), +- Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, +- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), +- Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, +- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), ++ exporters.push_back(Exporter::ExportFormatEntry( "gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, ++ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); ++ exporters.push_back(Exporter::ExportFormatEntry( "glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, ++ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); ++ exporters.push_back(Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, ++ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); ++ exporters.push_back(Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, ++ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); + #endif + + #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER +- Exporter::ExportFormatEntry( "assbin", "Assimp Binary File", "assbin" , &ExportSceneAssbin, 0 ), ++ exporters.push_back(Exporter::ExportFormatEntry( "assbin", "Assimp Binary File", "assbin" , &ExportSceneAssbin, 0 )); + #endif + + #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER +- Exporter::ExportFormatEntry( "assxml", "Assimp XML Document", "assxml" , &ExportSceneAssxml, 0 ), ++ exporters.push_back(Exporter::ExportFormatEntry( "assxml", "Assimp XML Document", "assxml" , &ExportSceneAssxml, 0 )); + #endif + + #ifndef ASSIMP_BUILD_NO_X3D_EXPORTER +- Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0 ), ++ exporters.push_back(Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0 )); + #endif + + #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER +- Exporter::ExportFormatEntry( "fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0 ), +- Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 ), ++ exporters.push_back(Exporter::ExportFormatEntry( "fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0 )); ++ exporters.push_back(Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 )); + #endif + + #ifndef ASSIMP_BUILD_NO_3MF_EXPORTER +- Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ), ++ exporters.push_back(Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 )); + #endif + + #ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER +- Exporter::ExportFormatEntry( "assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0) ++ exporters.push_back(Exporter::ExportFormatEntry( "assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0)); + #endif +-}; ++} + +-#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0])) + + + class ExporterPimpl { +@@ -205,10 +203,7 @@ public: + GetPostProcessingStepInstanceList(mPostProcessingSteps); + + // grab all built-in exporters +- if ( 0 != ( ASSIMP_NUM_EXPORTERS ) ) { +- mExporters.resize( ASSIMP_NUM_EXPORTERS ); +- std::copy( gExporters, gExporters + ASSIMP_NUM_EXPORTERS, mExporters.begin() ); +- } ++ setupExporterArray(mExporters); + } + + ~ExporterPimpl() { +@@ -252,23 +247,27 @@ Exporter :: Exporter() + + // ------------------------------------------------------------------------------------------------ + Exporter::~Exporter() { ++ ai_assert(nullptr != pimpl); + FreeBlob(); + delete pimpl; + } + + // ------------------------------------------------------------------------------------------------ + void Exporter::SetIOHandler( IOSystem* pIOHandler) { ++ ai_assert(nullptr != pimpl); + pimpl->mIsDefaultIOHandler = !pIOHandler; + pimpl->mIOSystem.reset(pIOHandler); + } + + // ------------------------------------------------------------------------------------------------ + IOSystem* Exporter::GetIOHandler() const { ++ ai_assert(nullptr != pimpl); + return pimpl->mIOSystem.get(); + } + + // ------------------------------------------------------------------------------------------------ + bool Exporter::IsDefaultIOHandler() const { ++ ai_assert(nullptr != pimpl); + return pimpl->mIsDefaultIOHandler; + } + +@@ -295,6 +294,7 @@ void Exporter::SetProgressHandler(ProgressHandler* pHandler) { + // ------------------------------------------------------------------------------------------------ + const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, + unsigned int pPreprocessing, const ExportProperties* pProperties) { ++ ai_assert(nullptr != pimpl); + if (pimpl->blob) { + delete pimpl->blob; + pimpl->blob = nullptr; +@@ -319,6 +319,7 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha + aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const char* pPath, + unsigned int pPreprocessing, const ExportProperties* pProperties) { + ASSIMP_BEGIN_EXCEPTION_REGION(); ++ ai_assert(nullptr != pimpl); + + // when they create scenes from scratch, users will likely create them not in verbose + // format. They will likely not be aware that there is a flag in the scene to indicate +@@ -466,11 +467,13 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c + + // ------------------------------------------------------------------------------------------------ + const char* Exporter::GetErrorString() const { ++ ai_assert(nullptr != pimpl); + return pimpl->mError.c_str(); + } + + // ------------------------------------------------------------------------------------------------ + void Exporter::FreeBlob() { ++ ai_assert(nullptr != pimpl); + delete pimpl->blob; + pimpl->blob = nullptr; + +@@ -479,11 +482,13 @@ void Exporter::FreeBlob() { + + // ------------------------------------------------------------------------------------------------ + const aiExportDataBlob* Exporter::GetBlob() const { ++ ai_assert(nullptr != pimpl); + return pimpl->blob; + } + + // ------------------------------------------------------------------------------------------------ + const aiExportDataBlob* Exporter::GetOrphanedBlob() const { ++ ai_assert(nullptr != pimpl); + const aiExportDataBlob* tmp = pimpl->blob; + pimpl->blob = nullptr; + return tmp; +@@ -491,18 +496,20 @@ const aiExportDataBlob* Exporter::GetOrphanedBlob() const { + + // ------------------------------------------------------------------------------------------------ + size_t Exporter::GetExportFormatCount() const { ++ ai_assert(nullptr != pimpl); + return pimpl->mExporters.size(); + } + + // ------------------------------------------------------------------------------------------------ + const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) const { ++ ai_assert(nullptr != pimpl); + if (index >= GetExportFormatCount()) { + return nullptr; + } + + // Return from static storage if the requested index is built-in. +- if (index < sizeof(gExporters) / sizeof(gExporters[0])) { +- return &gExporters[index].mDescription; ++ if (index < pimpl->mExporters.size()) { ++ return &pimpl->mExporters[index].mDescription; + } + + return &pimpl->mExporters[index].mDescription; +@@ -510,6 +517,7 @@ const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) c + + // ------------------------------------------------------------------------------------------------ + aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) { ++ ai_assert(nullptr != pimpl); + for(const ExportFormatEntry& e : pimpl->mExporters) { + if (!strcmp(e.mDescription.id,desc.mDescription.id)) { + return aiReturn_FAILURE; +@@ -522,6 +530,7 @@ aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) { + + // ------------------------------------------------------------------------------------------------ + void Exporter::UnregisterExporter(const char* id) { ++ ai_assert(nullptr != pimpl); + for(std::vector::iterator it = pimpl->mExporters.begin(); + it != pimpl->mExporters.end(); ++it) { + if (!strcmp((*it).mDescription.id,id)) { diff --git a/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch b/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch new file mode 100644 index 0000000000000..fdd67862ddb24 --- /dev/null +++ b/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch @@ -0,0 +1,354 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -465,7 +465,12 @@ ELSE() + ENDIF() + + IF ( NOT ASSIMP_BUILD_ZLIB ) +- FIND_PACKAGE(ZLIB) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ find_package(ZLIB REQUIRED) ++ endif() ++ set(ZLIB_FOUND TRUE) + ENDIF() + + IF( NOT ZLIB_FOUND ) +@@ -498,12 +503,14 @@ ENDIF() + + IF( NOT IOS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF() + ELSE () + IF( NOT BUILD_SHARED_LIBS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF() + ENDIF () + ENDIF () +--- a/code/AssetLib/3MF/D3MFExporter.cpp ++++ b/code/AssetLib/3MF/D3MFExporter.cpp +@@ -57,7 +57,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include ++#include + #endif + + namespace Assimp { +--- a/code/AssetLib/Blender/BlenderTessellator.h ++++ b/code/AssetLib/Blender/BlenderTessellator.h +@@ -147,7 +147,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" ++# include + #endif + + namespace Assimp +--- a/code/AssetLib/IFC/IFCGeometry.cpp ++++ b/code/AssetLib/IFC/IFCGeometry.cpp +@@ -53,8 +53,8 @@ + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/AssetLib/IFC/IFCLoader.cpp ++++ b/code/AssetLib/IFC/IFCLoader.cpp +@@ -54,7 +54,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include ++#include + #endif + #endif + +--- a/code/AssetLib/IFC/IFCOpenings.cpp ++++ b/code/AssetLib/IFC/IFCOpenings.cpp +@@ -53,8 +53,8 @@ + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/AssetLib/M3D/M3DWrapper.hpp ++++ b/code/AssetLib/M3D/M3DWrapper.h +@@ -59,7 +59,7 @@ + + // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. + #define STBI_ONLY_PNG +-#include ++#include + + #include "m3d.h" + +--- a/code/AssetLib/MMD/MMDPmxParser.cpp ++++ b/code/AssetLib/MMD/MMDPmxParser.cpp +@@ -45,7 +45,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + #include + +--- a/code/AssetLib/SIB/SIBImporter.cpp ++++ b/code/AssetLib/SIB/SIBImporter.cpp +@@ -62,7 +62,7 @@ + #include + #else + //# include "../contrib/ConvertUTF/ConvertUTF.h" +-#include "../contrib/utf8cpp/source/utf8.h" ++#include + #endif + #include + #include +--- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp ++++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp +@@ -48,7 +48,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + #include +--- a/code/CMakeLists.txt ++++ b/code/CMakeLists.txt +@@ -887,6 +887,7 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(pugixml) + find_package(pugixml CONFIG REQUIRED) + ELSE() ++ find_package(pugixml REQUIRED CONFIG) + SET( Pugixml_SRCS + ../contrib/pugixml/src/pugiconfig.hpp + ../contrib/pugixml/src/pugixml.hpp +@@ -900,6 +901,7 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(utf8) + find_package(utf8cpp CONFIG REQUIRED) + ELSE() ++ find_package(utf8cpp REQUIRED CONFIG) + # utf8 is header-only, so Assimp doesn't need to do anything. + ENDIF() + +@@ -908,6 +910,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(polyclipping) + find_package(polyclipping CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(clipper REQUIRED CONFIG) ++ endif() + SET( Clipper_SRCS + ../contrib/clipper/clipper.hpp + ../contrib/clipper/clipper.cpp +@@ -920,6 +925,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(poly2tri) + find_package(poly2tri CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(poly2tri REQUIRED CONFIG) ++ endif() + SET( Poly2Tri_SRCS + ../contrib/poly2tri/poly2tri/common/shapes.cc + ../contrib/poly2tri/poly2tri/common/shapes.h +@@ -957,6 +965,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(zip) + find_package(zip CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_3MF_EXPORTER) ++ find_package(zip REQUIRED CONFIG) ++ endif() + SET( ziplib_SRCS + ../contrib/zip/src/miniz.h + ../contrib/zip/src/zip.c +@@ -978,6 +989,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(openddlparser) + find_package(openddlparser CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_OPENGEX_IMPORTER) ++ find_package(openddlparser REQUIRED CONFIG) ++ endif() + SET ( openddl_parser_SRCS + ../contrib/openddlparser/code/OpenDDLParser.cpp + ../contrib/openddlparser/code/DDLNode.cpp +@@ -1052,7 +1066,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(RapidJSON) + find_package(RapidJSON CONFIG REQUIRED) + ELSE() +- INCLUDE_DIRECTORIES("../contrib/rapidjson/include") ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(RapidJSON REQUIRED CONFIG) ++ endif() + ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) + option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) + if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) +@@ -1065,10 +1081,12 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(stb) + find_package(stb CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) ++ find_package(stb REQUIRED CONFIG) ++ endif() + SET( stb_SRCS + ../contrib/stb/stb_image.h + ) +- INCLUDE_DIRECTORIES("../contrib") + SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS}) + ENDIF() + +@@ -1123,14 +1141,7 @@ SET( assimp_src + ${ASSIMP_EXPORTER_SRCS} + + # Third-party libraries +- ${unzip_compile_SRCS} +- ${Poly2Tri_SRCS} +- ${Clipper_SRCS} +- ${openddl_parser_SRCS} + ${open3dgc_SRCS} +- ${ziplib_SRCS} +- ${Pugixml_SRCS} +- ${stb_SRCS} + # Necessary to show the headers in the project when using the VC++ generator: + + ${PUBLIC_HEADERS} +@@ -1141,7 +1152,7 @@ ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) + IF(NOT ASSIMP_HUNTER_ENABLED) + INCLUDE_DIRECTORIES( + ${IRRXML_INCLUDE_DIR} +- ../contrib/openddlparser/include ++ ../contrib # for Open3DGC + ) + ENDIF() + +@@ -1150,8 +1161,8 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) + INCLUDE_DIRECTORIES(${C4D_INCLUDES}) + ENDIF () + +-IF (ASSIMP_BUILD_DRACO) +- INCLUDE_DIRECTORIES(${draco_INCLUDE_DIRS}) ++if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(draco REQUIRED CONFIG) + ADD_DEFINITIONS( -DASSIMP_ENABLE_DRACO ) + ENDIF() + +@@ -1162,9 +1173,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) + + # enable warnings as errors ######################################## + IF (MSVC) +- TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) + ELSE() +- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) + ENDIF() + + # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler +@@ -1195,9 +1204,32 @@ IF(ASSIMP_HUNTER_ENABLED) + target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) + endif() + ELSE() +- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) +- if (ASSIMP_BUILD_DRACO) +- target_link_libraries(assimp ${draco_LIBRARIES}) ++ target_link_libraries(assimp pugixml::pugixml utf8cpp) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ target_link_libraries(assimp ZLIB::ZLIB) ++ endif() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp clipper::clipper) ++ endif() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp poly2tri::poly2tri) ++ endif() ++ if(ASSIMP_BUILD_3MF_EXPORTER) ++ target_link_libraries(assimp zip::zip) ++ endif() ++ if(ASSIMP_BUILD_OPENGEX_IMPORTER) ++ target_link_libraries(assimp openddlparser::openddlparser) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp rapidjson) ++ endif() ++ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) ++ target_link_libraries(assimp stb::stb) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp draco::draco) + endif() + ENDIF() + +@@ -1279,8 +1311,7 @@ ENDIF() + # assimp can #include "unzip.h" + IF(NOT ASSIMP_HUNTER_ENABLED) + if (UNZIP_FOUND) +- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) ++ target_link_libraries(assimp minizip::minizip) + else () + INCLUDE_DIRECTORIES("../") + endif () +--- a/code/Common/Assimp.cpp ++++ b/code/Common/Assimp.cpp +@@ -1290,7 +1290,7 @@ + # endif + + # define STB_IMAGE_IMPLEMENTATION +-# include "stb/stb_image.h" ++# include "stb_image.h" + + # if _MSC_VER + # pragma warning(pop) +--- a/code/Common/BaseImporter.cpp ++++ b/code/Common/BaseImporter.cpp +@@ -330,7 +330,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include "../contrib/utf8cpp/source/utf8.h" ++#include + #endif + + // ------------------------------------------------------------------------------------------------ +--- a/code/Common/ZipArchiveIOSystem.cpp ++++ b/code/Common/ZipArchiveIOSystem.cpp +@@ -54,7 +54,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + namespace Assimp { +--- a/code/Pbrt/PbrtExporter.cpp ++++ b/code/Pbrt/PbrtExporter.cpp +@@ -83,7 +83,7 @@ + #include + #include + +-#include "stb/stb_image.h" ++#include "stb_image.h" + + using namespace Assimp; + diff --git a/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch b/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch new file mode 100644 index 0000000000000..67d2f67fd3661 --- /dev/null +++ b/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch @@ -0,0 +1,330 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -466,7 +466,12 @@ ELSE() + ENDIF() + + IF ( NOT ASSIMP_BUILD_ZLIB ) +- FIND_PACKAGE(ZLIB) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ find_package(ZLIB REQUIRED) ++ endif() ++ set(ZLIB_FOUND TRUE) + ENDIF() + + IF( NOT ZLIB_FOUND ) +@@ -499,12 +504,14 @@ ENDIF() + + IF( NOT IOS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF() + ELSE () + IF( NOT BUILD_SHARED_LIBS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF() + ENDIF () + ENDIF () +--- a/code/AssetLib/3MF/D3MFExporter.cpp ++++ b/code/AssetLib/3MF/D3MFExporter.cpp +@@ -57,7 +57,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include ++#include + #endif + + namespace Assimp { +--- a/code/AssetLib/Blender/BlenderTessellator.h ++++ b/code/AssetLib/Blender/BlenderTessellator.h +@@ -147,7 +147,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" ++# include + #endif + + namespace Assimp +--- a/code/AssetLib/IFC/IFCGeometry.cpp ++++ b/code/AssetLib/IFC/IFCGeometry.cpp +@@ -53,8 +53,8 @@ + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/AssetLib/IFC/IFCOpenings.cpp ++++ b/code/AssetLib/IFC/IFCOpenings.cpp +@@ -53,8 +53,8 @@ + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/AssetLib/M3D/M3DWrapper.h ++++ b/code/AssetLib/M3D/M3DWrapper.h +@@ -59,7 +59,7 @@ + + // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. + #define STBI_ONLY_PNG +-#include ++#include + + #include "m3d.h" + +--- a/code/AssetLib/MMD/MMDPmxParser.cpp ++++ b/code/AssetLib/MMD/MMDPmxParser.cpp +@@ -45,7 +45,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + #include + +--- a/code/AssetLib/SIB/SIBImporter.cpp ++++ b/code/AssetLib/SIB/SIBImporter.cpp +@@ -62,7 +62,7 @@ + #include + #else + //# include "../contrib/ConvertUTF/ConvertUTF.h" +-#include "../contrib/utf8cpp/source/utf8.h" ++#include + #endif + #include + #include +--- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp ++++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp +@@ -48,7 +48,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + #include +--- a/code/CMakeLists.txt ++++ b/code/CMakeLists.txt +@@ -888,6 +888,7 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(pugixml) + find_package(pugixml CONFIG REQUIRED) + ELSE() ++ find_package(pugixml REQUIRED CONFIG) + SET( Pugixml_SRCS + ../contrib/pugixml/src/pugiconfig.hpp + ../contrib/pugixml/src/pugixml.hpp +@@ -901,6 +902,7 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(utf8) + find_package(utf8cpp CONFIG REQUIRED) + ELSE() ++ find_package(utf8cpp REQUIRED CONFIG) + # utf8 is header-only, so Assimp doesn't need to do anything. + ENDIF() + +@@ -909,6 +911,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(polyclipping) + find_package(polyclipping CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(clipper REQUIRED CONFIG) ++ endif() + SET( Clipper_SRCS + ../contrib/clipper/clipper.hpp + ../contrib/clipper/clipper.cpp +@@ -921,6 +926,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(poly2tri) + find_package(poly2tri CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(poly2tri REQUIRED CONFIG) ++ endif() + SET( Poly2Tri_SRCS + ../contrib/poly2tri/poly2tri/common/shapes.cc + ../contrib/poly2tri/poly2tri/common/shapes.h +@@ -960,6 +968,7 @@ IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST) + hunter_add_package(zip) + find_package(zip CONFIG REQUIRED) + ELSE() ++ find_package(zip REQUIRED CONFIG) + SET( ziplib_SRCS + ../contrib/zip/src/miniz.h + ../contrib/zip/src/zip.c +@@ -982,6 +991,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(openddlparser) + find_package(openddlparser CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_OPENGEX_IMPORTER) ++ find_package(openddlparser REQUIRED CONFIG) ++ endif() + SET ( openddl_parser_SRCS + ../contrib/openddlparser/code/OpenDDLParser.cpp + ../contrib/openddlparser/code/DDLNode.cpp +@@ -1056,7 +1068,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(RapidJSON) + find_package(RapidJSON CONFIG REQUIRED) + ELSE() +- INCLUDE_DIRECTORIES("../contrib/rapidjson/include") ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(RapidJSON REQUIRED CONFIG) ++ endif() + ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) + option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) + if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) +@@ -1069,10 +1083,12 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(stb) + find_package(stb CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) ++ find_package(stb REQUIRED CONFIG) ++ endif() + SET( stb_SRCS + ../contrib/stb/stb_image.h + ) +- INCLUDE_DIRECTORIES("../contrib") + SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS}) + ENDIF() + +@@ -1127,14 +1143,7 @@ SET( assimp_src + ${ASSIMP_EXPORTER_SRCS} + + # Third-party libraries +- ${unzip_compile_SRCS} +- ${Poly2Tri_SRCS} +- ${Clipper_SRCS} +- ${openddl_parser_SRCS} + ${open3dgc_SRCS} +- ${ziplib_SRCS} +- ${Pugixml_SRCS} +- ${stb_SRCS} + # Necessary to show the headers in the project when using the VC++ generator: + + ${PUBLIC_HEADERS} +@@ -1145,7 +1154,7 @@ ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) + IF(NOT ASSIMP_HUNTER_ENABLED) + INCLUDE_DIRECTORIES( + ${IRRXML_INCLUDE_DIR} +- ../contrib/openddlparser/include ++ ../contrib # for Open3DGC + ) + ENDIF() + +@@ -1154,8 +1163,8 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) + INCLUDE_DIRECTORIES(${C4D_INCLUDES}) + ENDIF () + +-IF (ASSIMP_BUILD_DRACO) +- INCLUDE_DIRECTORIES(${draco_INCLUDE_DIRS}) ++if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(draco REQUIRED CONFIG) + ADD_DEFINITIONS( -DASSIMP_ENABLE_DRACO ) + ENDIF() + +@@ -1166,9 +1175,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) + + # enable warnings as errors ######################################## + IF (MSVC) +- TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) + ELSE() +- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) + ENDIF() + + # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler +@@ -1201,9 +1208,32 @@ IF(ASSIMP_HUNTER_ENABLED) + target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) + endif() + ELSE() +- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) +- if (ASSIMP_BUILD_DRACO) +- target_link_libraries(assimp ${draco_LIBRARIES}) ++ target_link_libraries(assimp pugixml::pugixml utf8cpp) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ target_link_libraries(assimp ZLIB::ZLIB) ++ endif() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp clipper::clipper) ++ endif() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp poly2tri::poly2tri) ++ endif() ++ if(ASSIMP_BUILD_3MF_EXPORTER) ++ target_link_libraries(assimp zip::zip) ++ endif() ++ if(ASSIMP_BUILD_OPENGEX_IMPORTER) ++ target_link_libraries(assimp openddlparser::openddlparser) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp rapidjson) ++ endif() ++ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) ++ target_link_libraries(assimp stb::stb) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp draco::draco) + endif() + ENDIF() + +@@ -1291,8 +1321,7 @@ ENDIF() + # assimp can #include "unzip.h" + IF(NOT ASSIMP_HUNTER_ENABLED) + if (UNZIP_FOUND) +- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) ++ target_link_libraries(assimp minizip::minizip) + else () + INCLUDE_DIRECTORIES("../") + endif () +--- a/code/Common/Assimp.cpp ++++ b/code/Common/Assimp.cpp +@@ -1290,7 +1290,7 @@ + # endif + + # define STB_IMAGE_IMPLEMENTATION +-# include "stb/stb_image.h" ++# include "stb_image.h" + + # if _MSC_VER + # pragma warning(pop) +--- a/code/Common/BaseImporter.cpp ++++ b/code/Common/BaseImporter.cpp +@@ -331,7 +331,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include "../contrib/utf8cpp/source/utf8.h" ++#include + #endif + + // ------------------------------------------------------------------------------------------------ +--- a/code/Pbrt/PbrtExporter.cpp ++++ b/code/Pbrt/PbrtExporter.cpp +@@ -83,7 +83,7 @@ + #include + #include + +-#include "stb/stb_image.h" ++#include "stb_image.h" + + using namespace Assimp; + diff --git a/recipes/assimp/5.x/patches/0005-fix-unzip.patch b/recipes/assimp/5.x/patches/0005-fix-unzip.patch new file mode 100644 index 0000000000000..c6980a6575974 --- /dev/null +++ b/recipes/assimp/5.x/patches/0005-fix-unzip.patch @@ -0,0 +1,13 @@ +# https://github.com/assimp/assimp/issues/4334 +--- a/code/Common/ZipArchiveIOSystem.cpp ++++ b/code/Common/ZipArchiveIOSystem.cpp +@@ -196,7 +196,9 @@ + zlib_filefunc_def mapping; + + mapping.zopen_file = (open_file_func)open; ++#ifdef ZOPENDISK64 + mapping.zopendisk_file = (opendisk_file_func)opendisk; ++#endif + mapping.zread_file = (read_file_func)read; + mapping.zwrite_file = (write_file_func)write; + mapping.ztell_file = (tell_file_func)tell; diff --git a/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch b/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch new file mode 100644 index 0000000000000..2a1e7bc39e620 --- /dev/null +++ b/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch @@ -0,0 +1,330 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -488,7 +488,12 @@ ELSE() + ENDIF() + + IF ( NOT ASSIMP_BUILD_ZLIB ) +- FIND_PACKAGE(ZLIB) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ find_package(ZLIB REQUIRED) ++ endif() ++ set(ZLIB_FOUND TRUE) + ENDIF() + + IF( NOT ZLIB_FOUND ) +@@ -521,12 +526,14 @@ ENDIF() + + IF( NOT IOS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF() + ELSE () + IF( NOT BUILD_SHARED_LIBS ) + IF( NOT ASSIMP_BUILD_MINIZIP ) +- use_pkgconfig(UNZIP minizip) ++ find_package(minizip REQUIRED CONFIG) ++ set(UNZIP_FOUND TRUE) + ENDIF() + ENDIF () + ENDIF () +--- a/code/AssetLib/3MF/D3MFExporter.cpp ++++ b/code/AssetLib/3MF/D3MFExporter.cpp +@@ -57,7 +57,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include ++#include + #endif + + namespace Assimp { +--- a/code/AssetLib/Blender/BlenderTessellator.h ++++ b/code/AssetLib/Blender/BlenderTessellator.h +@@ -147,7 +147,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" ++# include + #endif + + namespace Assimp +--- a/code/AssetLib/IFC/IFCGeometry.cpp ++++ b/code/AssetLib/IFC/IFCGeometry.cpp +@@ -53,8 +53,8 @@ + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/AssetLib/IFC/IFCOpenings.cpp ++++ b/code/AssetLib/IFC/IFCOpenings.cpp +@@ -53,8 +53,8 @@ + # include + # include + #else +-# include "../contrib/poly2tri/poly2tri/poly2tri.h" +-# include "../contrib/clipper/clipper.hpp" ++# include ++# include + #endif + + #include +--- a/code/AssetLib/M3D/M3DWrapper.h ++++ b/code/AssetLib/M3D/M3DWrapper.h +@@ -59,7 +59,7 @@ + + // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. + #define STBI_ONLY_PNG +-#include ++#include + + #include "m3d.h" + +--- a/code/AssetLib/MMD/MMDPmxParser.cpp ++++ b/code/AssetLib/MMD/MMDPmxParser.cpp +@@ -45,7 +45,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include "../contrib/utf8cpp/source/utf8.h" ++# include + #endif + #include + +--- a/code/AssetLib/SIB/SIBImporter.cpp ++++ b/code/AssetLib/SIB/SIBImporter.cpp +@@ -59,7 +59,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include "../contrib/utf8cpp/source/utf8.h" ++#include + #endif + #include + #include +--- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp ++++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp +@@ -48,7 +48,7 @@ + #ifdef ASSIMP_USE_HUNTER + # include + #else +-# include ++# include + #endif + + #include +--- a/code/CMakeLists.txt ++++ b/code/CMakeLists.txt +@@ -899,6 +899,7 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(pugixml) + find_package(pugixml CONFIG REQUIRED) + ELSE() ++ find_package(pugixml REQUIRED CONFIG) + SET( Pugixml_SRCS + ../contrib/pugixml/src/pugiconfig.hpp + ../contrib/pugixml/src/pugixml.hpp +@@ -912,6 +913,7 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(utf8) + find_package(utf8cpp CONFIG REQUIRED) + ELSE() ++ find_package(utf8cpp REQUIRED CONFIG) + # utf8 is header-only, so Assimp doesn't need to do anything. + ENDIF() + +@@ -920,6 +922,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(polyclipping) + find_package(polyclipping CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(clipper REQUIRED CONFIG) ++ endif() + SET( Clipper_SRCS + ../contrib/clipper/clipper.hpp + ../contrib/clipper/clipper.cpp +@@ -932,6 +937,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(poly2tri) + find_package(poly2tri CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ find_package(poly2tri REQUIRED CONFIG) ++ endif() + SET( Poly2Tri_SRCS + ../contrib/poly2tri/poly2tri/common/shapes.cc + ../contrib/poly2tri/poly2tri/common/shapes.h +@@ -971,6 +979,7 @@ IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST) + hunter_add_package(zip) + find_package(zip CONFIG REQUIRED) + ELSE() ++ find_package(zip REQUIRED CONFIG) + SET( ziplib_SRCS + ../contrib/zip/src/miniz.h + ../contrib/zip/src/zip.c +@@ -993,6 +1002,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(openddlparser) + find_package(openddlparser CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_OPENGEX_IMPORTER) ++ find_package(openddlparser REQUIRED CONFIG) ++ endif() + SET ( openddl_parser_SRCS + ../contrib/openddlparser/code/OpenDDLParser.cpp + ../contrib/openddlparser/code/DDLNode.cpp +@@ -1067,7 +1079,9 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(RapidJSON) + find_package(RapidJSON CONFIG REQUIRED) + ELSE() +- INCLUDE_DIRECTORIES("../contrib/rapidjson/include") ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(RapidJSON REQUIRED CONFIG) ++ endif() + ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) + option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) + if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) +@@ -1080,10 +1094,12 @@ IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(stb) + find_package(stb CONFIG REQUIRED) + ELSE() ++ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) ++ find_package(stb REQUIRED CONFIG) ++ endif() + SET( stb_SRCS + ../contrib/stb/stb_image.h + ) +- INCLUDE_DIRECTORIES("../contrib") + SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS}) + ENDIF() + +@@ -1138,14 +1154,7 @@ SET( assimp_src + ${ASSIMP_EXPORTER_SRCS} + + # Third-party libraries +- ${unzip_compile_SRCS} +- ${Poly2Tri_SRCS} +- ${Clipper_SRCS} +- ${openddl_parser_SRCS} + ${open3dgc_SRCS} +- ${ziplib_SRCS} +- ${Pugixml_SRCS} +- ${stb_SRCS} + # Necessary to show the headers in the project when using the VC++ generator: + + ${PUBLIC_HEADERS} +@@ -1156,7 +1165,7 @@ ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) + IF(NOT ASSIMP_HUNTER_ENABLED) + INCLUDE_DIRECTORIES( + ${IRRXML_INCLUDE_DIR} +- ../contrib/openddlparser/include ++ ../contrib # for Open3DGC + ) + ENDIF() + +@@ -1165,8 +1174,8 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) + INCLUDE_DIRECTORIES(${C4D_INCLUDES}) + ENDIF () + +-IF (ASSIMP_BUILD_DRACO) +- INCLUDE_DIRECTORIES(${draco_INCLUDE_DIRS}) ++if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ find_package(draco REQUIRED CONFIG) + ADD_DEFINITIONS( -DASSIMP_ENABLE_DRACO ) + ENDIF() + +@@ -1177,9 +1186,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) + + # enable warnings as errors ######################################## + IF (MSVC) +- TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) + ELSE() +- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) + ENDIF() + + # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler +@@ -1212,9 +1219,32 @@ IF(ASSIMP_HUNTER_ENABLED) + target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) + endif() + ELSE() +- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) +- if (ASSIMP_BUILD_DRACO) +- target_link_libraries(assimp ${draco_LIBRARIES}) ++ target_link_libraries(assimp pugixml::pugixml utf8cpp) ++ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR ++ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR ++ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) ++ target_link_libraries(assimp ZLIB::ZLIB) ++ endif() ++ if(ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp clipper::clipper) ++ endif() ++ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) ++ target_link_libraries(assimp poly2tri::poly2tri) ++ endif() ++ if(ASSIMP_BUILD_3MF_EXPORTER) ++ target_link_libraries(assimp zip::zip) ++ endif() ++ if(ASSIMP_BUILD_OPENGEX_IMPORTER) ++ target_link_libraries(assimp openddlparser::openddlparser) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp rapidjson) ++ endif() ++ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) ++ target_link_libraries(assimp stb::stb) ++ endif() ++ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) ++ target_link_libraries(assimp draco::draco) + endif() + ENDIF() + +@@ -1302,8 +1332,7 @@ ENDIF() + # assimp can #include "unzip.h" + IF(NOT ASSIMP_HUNTER_ENABLED) + if (UNZIP_FOUND) +- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) +- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) ++ target_link_libraries(assimp minizip::minizip) + else () + INCLUDE_DIRECTORIES("../") + endif () +--- a/code/Common/Assimp.cpp ++++ b/code/Common/Assimp.cpp +@@ -1290,7 +1290,7 @@ + # endif + + # define STB_IMAGE_IMPLEMENTATION +-# include "stb/stb_image.h" ++# include "stb_image.h" + + # if _MSC_VER + # pragma warning(pop) +--- a/code/Common/BaseImporter.cpp ++++ b/code/Common/BaseImporter.cpp +@@ -332,7 +332,7 @@ + #ifdef ASSIMP_USE_HUNTER + #include + #else +-#include "../contrib/utf8cpp/source/utf8.h" ++#include + #endif + + // ------------------------------------------------------------------------------------------------ +--- a/code/Pbrt/PbrtExporter.cpp ++++ b/code/Pbrt/PbrtExporter.cpp +@@ -83,7 +83,7 @@ + #include + #include + +-#include "stb/stb_image.h" ++#include "stb_image.h" + + using namespace Assimp; + diff --git a/recipes/assimp/5.x/test_package/CMakeLists.txt b/recipes/assimp/5.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b0a89276dbf1 --- /dev/null +++ b/recipes/assimp/5.x/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) + +find_package(assimp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE assimp::assimp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE assimp::assimp) diff --git a/recipes/assimp/5.x/test_package/box.obj b/recipes/assimp/5.x/test_package/box.obj new file mode 100644 index 0000000000000..5653b604283d7 --- /dev/null +++ b/recipes/assimp/5.x/test_package/box.obj @@ -0,0 +1,30 @@ +# Vertices: 8 +# Points: 0 +# Lines: 0 +# Faces: 6 +# Materials: 1 + +o 1 + +# Vertex list + +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 0.5 -0.5 +v -0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 + +# Point/Line/Face list + +usemtl Default +f 4 3 2 1 +f 2 6 5 1 +f 3 7 6 2 +f 8 7 3 4 +f 5 8 4 1 +f 6 7 8 5 + +# End of file diff --git a/recipes/assimp/5.x/test_package/conanfile.py b/recipes/assimp/5.x/test_package/conanfile.py new file mode 100644 index 0000000000000..93ba652962cbf --- /dev/null +++ b/recipes/assimp/5.x/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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): + obj_path = os.path.join(self.source_folder, "box.obj") + + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} {obj_path}", env="conanrun") + + bin_c_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(f"{bin_c_path} {obj_path}", env="conanrun") diff --git a/recipes/assimp/5.x/test_package/test_package.c b/recipes/assimp/5.x/test_package/test_package.c new file mode 100644 index 0000000000000..29f2f75a6b8d2 --- /dev/null +++ b/recipes/assimp/5.x/test_package/test_package.c @@ -0,0 +1,26 @@ +#include + +#include +#include +#include + +int main(int argc, char **argv) { + if (argc < 2) { + printf("Need at least one argument\n"); + return 1; + } + + const C_STRUCT aiScene *scene = aiImportFile(argv[1], + aiProcess_CalcTangentSpace | + aiProcess_Triangulate | + aiProcess_JoinIdenticalVertices | + aiProcess_SortByPType); + + if (!scene) { + return 1; + } + + aiReleaseImport(scene); + + return 0; +} diff --git a/recipes/assimp/5.x/test_package/test_package.cpp b/recipes/assimp/5.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..322265547b29f --- /dev/null +++ b/recipes/assimp/5.x/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include +#include +#include + +int main(int argc, char **argv) { + if (argc < 2) { + std::cerr << "Need at least one argument" << std::endl; + return 1; + } + + Assimp::Importer importer; + const aiScene* scene = importer.ReadFile(argv[1], + aiProcess_CalcTangentSpace | + aiProcess_Triangulate | + aiProcess_JoinIdenticalVertices | + aiProcess_SortByPType); + + if (!scene) { + return 1; + } + + return 0; +} diff --git a/recipes/assimp/5.x/test_v1_package/CMakeLists.txt b/recipes/assimp/5.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/assimp/5.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/assimp/5.x/test_v1_package/conanfile.py b/recipes/assimp/5.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..32dae739b46ce --- /dev/null +++ b/recipes/assimp/5.x/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): + obj_path = os.path.join(self.source_folder, os.pardir, "test_package", "box.obj") + + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} {obj_path}", run_environment=True) + + bin_c_path = os.path.join("bin", "test_package_c") + self.run(f"{bin_c_path} {obj_path}", run_environment=True) diff --git a/recipes/assimp/config.yml b/recipes/assimp/config.yml new file mode 100644 index 0000000000000..2542b27436840 --- /dev/null +++ b/recipes/assimp/config.yml @@ -0,0 +1,11 @@ +versions: + "5.2.2": + folder: "5.x" + "5.1.6": + folder: "5.x" + "5.1.0": + folder: "5.x" + "5.0.1": + folder: "5.x" + "5.0.0": + folder: "5.x" diff --git a/recipes/astc-codec/all/conandata.yml b/recipes/astc-codec/all/conandata.yml new file mode 100644 index 0000000000000..455c19647e7bd --- /dev/null +++ b/recipes/astc-codec/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20190617": + url: "https://github.com/google/astc-codec/archive/9757befb64db6662aad45de09ca87cd6f599ac02.tar.gz" + sha256: "19034fed68401a612655b026e713c351df8caa768f55ce29a0f628378e988eac" +patches: + "cci.20190617": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "CMake: add install target, export symbols" + patch_type: "conan" diff --git a/recipes/astc-codec/all/conanfile.py b/recipes/astc-codec/all/conanfile.py new file mode 100644 index 0000000000000..a02aae0b4d930 --- /dev/null +++ b/recipes/astc-codec/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + +required_conan_version = ">=1.54.0" + + +class AstcCodecConan(ConanFile): + name = "astc-codec" + description = " A software ASTC decoder implementation which supports the ASTC LDR profile" + homepage = "https://github.com/google/astc-codec" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("astc", "codec") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OPTION_ASTC_TESTS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["astc-codec"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/astc-codec/all/patches/0001-fix-cmake.patch b/recipes/astc-codec/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..bde6c9106dbe4 --- /dev/null +++ b/recipes/astc-codec/all/patches/0001-fix-cmake.patch @@ -0,0 +1,76 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,7 +11,7 @@ + # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + # License for the specific language governing permissions and limitations under + # the License. +-cmake_minimum_required(VERSION 3.1.0) ++cmake_minimum_required(VERSION 3.8) + project(astc-codec) + + option(OPTION_ASTC_TESTS "Build all the unit tests." ON) +@@ -20,7 +20,6 @@ option(OPTION_ASTC_TESTS "Build all the unit tests." ON) + # yet bringing in. + option(OPTION_BUILD_FUZZER "Build the fuzzer tests." OFF) + +-set (CMAKE_CXX_STANDARD 11) + if(OPTION_ASTC_TESTS) + enable_testing() + +@@ -44,3 +43,13 @@ endif() + + add_subdirectory(src/base) + add_subdirectory(src/decoder) ++ ++include(GNUInstallDirs) ++install(DIRECTORY include/astc-codec DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install( ++ TARGETS astc-codec ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++install(TARGETS astc_inspector_cli DESTINATION ${CMAKE_INSTALL_BINDIR}) +--- a/src/decoder/CMakeLists.txt ++++ b/src/decoder/CMakeLists.txt +@@ -11,10 +11,11 @@ + # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + # License for the specific language governing permissions and limitations under + # the License. +-add_library(footprint footprint.cc) ++add_library(footprint OBJECT footprint.cc) ++target_compile_features(footprint PUBLIC cxx_std_11) + target_link_libraries(footprint base) + +-add_library(astc_utils ++add_library(astc_utils OBJECT + astc_file.cc + endpoint_codec.cc + integer_sequence_codec.cc +@@ -24,17 +25,24 @@ add_library(astc_utils + physical_astc_block.cc + quantization.cc + weight_infill.cc) ++target_compile_features(astc_utils PUBLIC cxx_std_11) + target_link_libraries(astc_utils PRIVATE base footprint) + target_include_directories(astc_utils PRIVATE ../..) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(footprint PROPERTIES POSITION_INDEPENDENT_CODE ON) ++ set_target_properties(astc_utils PROPERTIES POSITION_INDEPENDENT_CODE ON) ++endif() + + add_library(astc-codec codec.cc) +-target_link_libraries(astc-codec PRIVATE astc_utils) ++target_compile_features(astc-codec PRIVATE cxx_std_11) ++set_target_properties(astc-codec PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) ++target_link_libraries(astc-codec PRIVATE astc_utils footprint) + target_include_directories(astc-codec PUBLIC ../../include) + target_include_directories(astc-codec PRIVATE ../..) + + add_executable(astc_inspector_cli tools/astc_inspector_cli.cc) + target_include_directories(astc_inspector_cli PRIVATE ../..) +-target_link_libraries(astc_inspector_cli PRIVATE astc_utils) ++target_link_libraries(astc_inspector_cli PRIVATE astc_utils footprint) + + # + # Testing diff --git a/recipes/astc-codec/all/test_package/CMakeLists.txt b/recipes/astc-codec/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fecfc194504f2 --- /dev/null +++ b/recipes/astc-codec/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(astc-codec REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE astc-codec::astc-codec) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/astc-codec/all/test_package/atlas_small_4x4.astc b/recipes/astc-codec/all/test_package/atlas_small_4x4.astc new file mode 100644 index 0000000000000000000000000000000000000000..0dd080b12d23fa6b1227b676c7fe7e53eb8ab3fe GIT binary patch literal 65552 zcmZU52{=@3{PuIs48~StD@$3%o)%2Xl9)4O$u=|DiIl9BU6vS94XLb^>`9iAL`n8Z zMMQ;!m{hW7OG3!>{t(c3$ z7}p_pJFY%vQxoPl5(_xN768Co^dCB?$dD=r5as|$80k|@{RgOiI_Eu;T<%E0swaH= zPKpY(#;X}xKHE^M`y%Dy@(ByQ=B9}UzaNcI(HN*!HYcgKauZVrO-*X3Eb`5PbMk~% z?(Y60Usy{!G*&Og#u}+xks+(k?;T8eyaa91e*l&;{MhUIpehd-$BnWNf-Ysa*EhwG zk_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